Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progress documentation #25194

Merged
merged 5 commits into from
Oct 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Add documentation",
"packageName": "@fluentui/react-progress",
"email": "[email protected]",
"dependentChangeType": "patch"
}
26 changes: 26 additions & 0 deletions packages/react-components/react-progress/MIGRATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Progress Migration
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO a better place for this documentation is in the v9 doc site but this is not a blocker for me.

To me, we should minimize the number of places documentation lives and the doc site is much more visible to our users that a Markdown file.


## Migration from v8

v8 offers a component equivalent to v9's `Progress`. However, the API is slightly different. The main difference is that v9's `Progress` does not have the `label` or `description` props. Instead, the `label` and `hint` are located in the `ProgressField` that can be used in conjunction with `Progress`.

Here's how the API of v8's `Progress` compares to the one from v9's `Progress` component:

- `className` => `className`
- `description` => Use `ProgressField` to use the `hint` prop
- `label` => Use `ProgressField` to use the `label` prop
- `onRenderProgress` => NOT SUPPORTED
- `percentComplete` => Use the `value` prop
- `progressHidden` => NOT SUPPORTED
- `styles` => Use style customization through `className` instead

## Property Mapping

| v8 `ProgressIndicator` | v9 `Progress` |
| ---------------------- | ------------------------------- |
| `barHeight` | `thickness` |
| `className` | `className` |
| `componentRef` | `ref` |
| `description` | use `ProgressField` hint |
| `label` | use `ProgressField` label |
| `percentComplete` | `value` |
45 changes: 45 additions & 0 deletions packages/react-components/react-progress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,48 @@
**React Progress components for [Fluent UI React](https://react.fluentui.dev/)**

These are not production-ready components and **should never be used in product**. This space is useful for testing new components whose APIs might change before final release.

## Usage

To import `Progress`:

```js
import { Progress } from '@fluentui/react-progress';
```

Once the Progress component graduates to a production release, the component will be available at:

```js
import { Progress } from '@fluentui/react-components';
```

### Examples

```jsx
const ProgressExample = () => {
return <Progress thickness="large" value={0.5} />;
};
```

#### Using ProgressField

The `ProgressField` component is a wrapper around the `Progress` component that allows the user to add a `label`, `hint`, `validationMessage`, and `validationState` to the `Progress` component. You can pass these props, as well as the regular `Progress` props to a `ProgressField` component.

To import `ProgressField`:

```js
import { ProgressField } from '@fluentui/react-field';
```

```jsx
const ProgressFieldExample = () => {
return (
<ProgressField
label="Determinate Progress"
hint="This is a determinate Progress with description"
value={0.5}
validationState="warning"
/>
);
};
```