@salesforce/design-system-react 11.0.0-rc.1 → 11.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -2
- package/dist/cjs/components/accordion/index.cjs +1 -1
- package/dist/cjs/components/accordion/index.cjs.map +1 -1
- package/dist/cjs/components/accordion/panel.cjs.map +1 -1
- package/dist/cjs/components/builder-header/nav-dropdown.cjs.map +1 -1
- package/dist/cjs/components/builder-header/nav-link.cjs.map +1 -1
- package/dist/cjs/components/builder-header/toolbar.cjs.map +1 -1
- package/dist/cjs/components/button/index.cjs.map +1 -1
- package/dist/cjs/components/button-stateful/index.cjs.map +1 -1
- package/dist/cjs/components/checkbox/index.cjs.map +1 -1
- package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
- package/dist/cjs/components/combobox/combobox.cjs +1 -1
- package/dist/cjs/components/combobox/combobox.cjs.map +1 -1
- package/dist/cjs/components/date-picker/date-picker.cjs +1 -1
- package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
- package/dist/cjs/components/date-picker/index.cjs.map +1 -1
- package/dist/cjs/components/files/file.cjs.map +1 -1
- package/dist/cjs/components/icon/index.cjs.map +1 -1
- package/dist/cjs/components/icon/input-icon/index.cjs.map +1 -1
- package/dist/cjs/components/icon-settings/index.cjs.map +1 -1
- package/dist/cjs/components/input/index.cjs.map +1 -1
- package/dist/cjs/components/input/private/inner-input.cjs.map +1 -1
- package/dist/cjs/components/menu-dropdown/button-trigger.cjs.map +1 -1
- package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs.map +1 -1
- package/dist/cjs/components/modal/index.cjs.map +1 -1
- package/dist/cjs/components/panel/filtering/group.cjs.map +1 -1
- package/dist/cjs/components/pill/index.cjs.map +1 -1
- package/dist/cjs/components/popover/edit-dialog.cjs.map +1 -1
- package/dist/cjs/components/popover/popover.cjs.map +1 -1
- package/dist/cjs/components/progress-indicator/index.cjs.map +1 -1
- package/dist/cjs/components/progress-ring/index.cjs.map +1 -1
- package/dist/cjs/components/radio/index.cjs.map +1 -1
- package/dist/cjs/components/radio-group/check-props.cjs.map +1 -1
- package/dist/cjs/components/radio-group/index.cjs.map +1 -1
- package/dist/cjs/components/scoped-notification/index.cjs.map +1 -1
- package/dist/cjs/components/setup-assistant/step.cjs.map +1 -1
- package/dist/cjs/components/slider/index.cjs.map +1 -1
- package/dist/cjs/components/split-view/header.cjs.map +1 -1
- package/dist/cjs/components/tabs/index.cjs.map +1 -1
- package/dist/cjs/components/tabs/panel.cjs.map +1 -1
- package/dist/cjs/components/textarea/index.cjs +1 -1
- package/dist/cjs/components/textarea/index.cjs.map +1 -1
- package/dist/cjs/components/tooltip/index.cjs.map +1 -1
- package/dist/cjs/components/tree/tree.cjs.map +1 -1
- package/dist/cjs/components/trial-bar/button.cjs.map +1 -1
- package/dist/cjs/components/trial-bar/dropdown.cjs.map +1 -1
- package/dist/cjs/components/utilities/menu-list/item-label.cjs.map +1 -1
- package/dist/cjs/utilities/get-component-doc.cjs +1 -1
- package/dist/cjs/utilities/get-component-doc.cjs.map +1 -1
- package/dist/cjs/utilities/warning/children-as-trigger.cjs +1 -1
- package/dist/cjs/utilities/warning/children-as-trigger.cjs.map +1 -1
- package/dist/cjs/utilities/warning/deprecated-property-value.cjs +1 -1
- package/dist/cjs/utilities/warning/deprecated-property-value.cjs.map +1 -1
- package/dist/cjs/utilities/warning/deprecated-property.cjs +1 -1
- package/dist/cjs/utilities/warning/deprecated-property.cjs.map +1 -1
- package/dist/cjs/utilities/warning/removal-version.cjs +2 -0
- package/dist/cjs/utilities/warning/removal-version.cjs.map +1 -0
- package/dist/es/components/accordion/index.js +7 -3
- package/dist/es/components/accordion/index.js.map +1 -1
- package/dist/es/components/accordion/panel.js.map +1 -1
- package/dist/es/components/builder-header/nav-dropdown.js.map +1 -1
- package/dist/es/components/builder-header/nav-link.js.map +1 -1
- package/dist/es/components/builder-header/toolbar.js.map +1 -1
- package/dist/es/components/button/index.js.map +1 -1
- package/dist/es/components/button-stateful/index.js.map +1 -1
- package/dist/es/components/checkbox/index.js.map +1 -1
- package/dist/es/components/color-picker/color-picker.js.map +1 -1
- package/dist/es/components/combobox/combobox.js +4 -2
- package/dist/es/components/combobox/combobox.js.map +1 -1
- package/dist/es/components/date-picker/date-picker.js +1 -1
- package/dist/es/components/date-picker/date-picker.js.map +1 -1
- package/dist/es/components/date-picker/index.js.map +1 -1
- package/dist/es/components/files/file.js.map +1 -1
- package/dist/es/components/icon/index.js.map +1 -1
- package/dist/es/components/icon/input-icon/index.js.map +1 -1
- package/dist/es/components/icon-settings/index.js.map +1 -1
- package/dist/es/components/input/index.js.map +1 -1
- package/dist/es/components/input/private/inner-input.js.map +1 -1
- package/dist/es/components/menu-dropdown/button-trigger.js.map +1 -1
- package/dist/es/components/menu-dropdown/menu-dropdown.js.map +1 -1
- package/dist/es/components/modal/index.js.map +1 -1
- package/dist/es/components/panel/filtering/group.js.map +1 -1
- package/dist/es/components/pill/index.js.map +1 -1
- package/dist/es/components/popover/edit-dialog.js.map +1 -1
- package/dist/es/components/popover/popover.js.map +1 -1
- package/dist/es/components/progress-indicator/index.js.map +1 -1
- package/dist/es/components/progress-ring/index.js.map +1 -1
- package/dist/es/components/radio/index.js.map +1 -1
- package/dist/es/components/radio-group/check-props.js.map +1 -1
- package/dist/es/components/radio-group/index.js.map +1 -1
- package/dist/es/components/scoped-notification/index.js.map +1 -1
- package/dist/es/components/setup-assistant/step.js.map +1 -1
- package/dist/es/components/slider/index.js.map +1 -1
- package/dist/es/components/split-view/header.js.map +1 -1
- package/dist/es/components/tabs/index.js.map +1 -1
- package/dist/es/components/tabs/panel.js.map +1 -1
- package/dist/es/components/textarea/index.js +29 -44
- package/dist/es/components/textarea/index.js.map +1 -1
- package/dist/es/components/tooltip/index.js.map +1 -1
- package/dist/es/components/tree/tree.js.map +1 -1
- package/dist/es/components/trial-bar/button.js.map +1 -1
- package/dist/es/components/trial-bar/dropdown.js.map +1 -1
- package/dist/es/components/utilities/menu-list/item-label.js.map +1 -1
- package/dist/es/utilities/get-component-doc.js +6 -6
- package/dist/es/utilities/get-component-doc.js.map +1 -1
- package/dist/es/utilities/warning/children-as-trigger.js +9 -8
- package/dist/es/utilities/warning/children-as-trigger.js.map +1 -1
- package/dist/es/utilities/warning/deprecated-property-value.js +11 -10
- package/dist/es/utilities/warning/deprecated-property-value.js.map +1 -1
- package/dist/es/utilities/warning/deprecated-property.js +9 -8
- package/dist/es/utilities/warning/deprecated-property.js.map +1 -1
- package/dist/es/utilities/warning/removal-version.js +6 -0
- package/dist/es/utilities/warning/removal-version.js.map +1 -0
- package/dist/llms/components/accordion.md +267 -0
- package/dist/llms/components/alert.md +228 -0
- package/dist/llms/components/avatar.md +167 -0
- package/dist/llms/components/badge.md +153 -0
- package/dist/llms/components/breadcrumb.md +148 -0
- package/dist/llms/components/builder-header.examples.md +239 -0
- package/dist/llms/components/builder-header.md +736 -0
- package/dist/llms/components/button-group.md +167 -0
- package/dist/llms/components/button-stateful.md +246 -0
- package/dist/llms/components/button.md +661 -0
- package/dist/llms/components/card.md +368 -0
- package/dist/llms/components/carousel.md +365 -0
- package/dist/llms/components/checkbox.md +887 -0
- package/dist/llms/components/color-picker.md +591 -0
- package/dist/llms/components/combobox.examples.md +802 -0
- package/dist/llms/components/combobox.md +929 -0
- package/dist/llms/components/date-picker.md +546 -0
- package/dist/llms/components/docked-composer.md +173 -0
- package/dist/llms/components/dynamic-icon.md +226 -0
- package/dist/llms/components/expandable-section.md +198 -0
- package/dist/llms/components/files.md +337 -0
- package/dist/llms/components/filter.md +775 -0
- package/dist/llms/components/icon-settings.md +301 -0
- package/dist/llms/components/icon.md +1040 -0
- package/dist/llms/components/input.md +746 -0
- package/dist/llms/components/media-object.md +125 -0
- package/dist/llms/components/menu-dropdown.md +732 -0
- package/dist/llms/components/modal.md +504 -0
- package/dist/llms/components/page-header.md +282 -0
- package/dist/llms/components/panel.md +256 -0
- package/dist/llms/components/pill-container.md +218 -0
- package/dist/llms/components/pill.md +266 -0
- package/dist/llms/components/popover.md +600 -0
- package/dist/llms/components/portal-settings.md +371 -0
- package/dist/llms/components/progress-bar.md +175 -0
- package/dist/llms/components/progress-indicator.md +399 -0
- package/dist/llms/components/progress-ring.md +146 -0
- package/dist/llms/components/radio-button-group.md +285 -0
- package/dist/llms/components/radio-group.md +242 -0
- package/dist/llms/components/radio.md +269 -0
- package/dist/llms/components/scoped-notification.md +156 -0
- package/dist/llms/components/setup-assistant.md +398 -0
- package/dist/llms/components/simple-data-table.examples.md +2773 -0
- package/dist/llms/components/simple-data-table.md +919 -0
- package/dist/llms/components/slider.md +217 -0
- package/dist/llms/components/spinner.md +232 -0
- package/dist/llms/components/split-view.md +350 -0
- package/dist/llms/components/tabs.md +311 -0
- package/dist/llms/components/textarea.md +331 -0
- package/dist/llms/components/toast.md +267 -0
- package/dist/llms/components/tooltip.md +470 -0
- package/dist/llms/components/tree.md +1011 -0
- package/dist/llms/components/trial-bar.md +383 -0
- package/dist/llms/components/vertical-navigation.md +196 -0
- package/dist/llms/components/visual-picker.md +362 -0
- package/dist/llms/components/welcome-mat.md +885 -0
- package/dist/llms/docs/migration-v11.md +471 -0
- package/dist/llms/llms-full.txt +6874 -0
- package/dist/llms/llms.txt +133 -0
- package/dist/llms/rules.md +36 -0
- package/dist/types/components/accordion/index.d.ts.map +1 -1
- package/dist/types/components/accordion/panel.d.ts +7 -7
- package/dist/types/components/builder-header/nav-dropdown.d.ts +1 -0
- package/dist/types/components/builder-header/nav-dropdown.d.ts.map +1 -1
- package/dist/types/components/builder-header/nav-link.d.ts +0 -1
- package/dist/types/components/builder-header/nav-link.d.ts.map +1 -1
- package/dist/types/components/builder-header/toolbar.d.ts +0 -1
- package/dist/types/components/builder-header/toolbar.d.ts.map +1 -1
- package/dist/types/components/button/index.d.ts +6 -3
- package/dist/types/components/button/index.d.ts.map +1 -1
- package/dist/types/components/button-stateful/index.d.ts +4 -1
- package/dist/types/components/button-stateful/index.d.ts.map +1 -1
- package/dist/types/components/checkbox/index.d.ts +19 -5
- package/dist/types/components/checkbox/index.d.ts.map +1 -1
- package/dist/types/components/color-picker/color-picker.d.ts +6 -4
- package/dist/types/components/color-picker/color-picker.d.ts.map +1 -1
- package/dist/types/components/color-picker/types.d.ts +2 -2
- package/dist/types/components/combobox/combobox.d.ts +22 -0
- package/dist/types/components/combobox/combobox.d.ts.map +1 -1
- package/dist/types/components/date-picker/date-picker.d.ts +16 -4
- package/dist/types/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/types/components/date-picker/index.d.ts +2 -6
- package/dist/types/components/date-picker/index.d.ts.map +1 -1
- package/dist/types/components/files/file.d.ts +1 -1
- package/dist/types/components/icon/index.d.ts +1 -0
- package/dist/types/components/icon/index.d.ts.map +1 -1
- package/dist/types/components/icon/input-icon/index.d.ts +3 -0
- package/dist/types/components/icon/input-icon/index.d.ts.map +1 -1
- package/dist/types/components/icon-settings/index.d.ts.map +1 -1
- package/dist/types/components/input/index.d.ts +2 -1
- package/dist/types/components/input/index.d.ts.map +1 -1
- package/dist/types/components/menu-dropdown/button-trigger.d.ts +5 -0
- package/dist/types/components/menu-dropdown/button-trigger.d.ts.map +1 -1
- package/dist/types/components/menu-dropdown/menu-dropdown.d.ts +4 -0
- package/dist/types/components/menu-dropdown/menu-dropdown.d.ts.map +1 -1
- package/dist/types/components/modal/index.d.ts +5 -5
- package/dist/types/components/page-header/types.d.ts +3 -0
- package/dist/types/components/page-header/types.d.ts.map +1 -1
- package/dist/types/components/panel/filtering/group.d.ts +2 -0
- package/dist/types/components/panel/filtering/group.d.ts.map +1 -1
- package/dist/types/components/pill/index.d.ts +1 -0
- package/dist/types/components/pill/index.d.ts.map +1 -1
- package/dist/types/components/popover/edit-dialog.d.ts +1 -3
- package/dist/types/components/popover/edit-dialog.d.ts.map +1 -1
- package/dist/types/components/popover/popover.d.ts +1 -0
- package/dist/types/components/popover/popover.d.ts.map +1 -1
- package/dist/types/components/progress-indicator/index.d.ts +1 -0
- package/dist/types/components/progress-indicator/index.d.ts.map +1 -1
- package/dist/types/components/progress-ring/index.d.ts +1 -0
- package/dist/types/components/progress-ring/index.d.ts.map +1 -1
- package/dist/types/components/radio/index.d.ts +2 -2
- package/dist/types/components/radio/index.d.ts.map +1 -1
- package/dist/types/components/radio-group/index.d.ts +2 -0
- package/dist/types/components/radio-group/index.d.ts.map +1 -1
- package/dist/types/components/scoped-notification/index.d.ts +1 -0
- package/dist/types/components/scoped-notification/index.d.ts.map +1 -1
- package/dist/types/components/setup-assistant/step.d.ts +0 -1
- package/dist/types/components/setup-assistant/step.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/types.d.ts +1 -0
- package/dist/types/components/simple-data-table/types.d.ts.map +1 -1
- package/dist/types/components/slider/index.d.ts +4 -2
- package/dist/types/components/slider/index.d.ts.map +1 -1
- package/dist/types/components/tabs/index.d.ts +1 -0
- package/dist/types/components/tabs/index.d.ts.map +1 -1
- package/dist/types/components/tabs/panel.d.ts +2 -1
- package/dist/types/components/tabs/panel.d.ts.map +1 -1
- package/dist/types/components/textarea/index.d.ts +9 -40
- package/dist/types/components/textarea/index.d.ts.map +1 -1
- package/dist/types/components/tooltip/index.d.ts +5 -0
- package/dist/types/components/tooltip/index.d.ts.map +1 -1
- package/dist/types/components/tree/tree.d.ts +5 -0
- package/dist/types/components/tree/tree.d.ts.map +1 -1
- package/dist/types/components/utilities/menu-list/item-label.d.ts +12 -0
- package/dist/types/components/utilities/menu-list/item-label.d.ts.map +1 -1
- package/package.json +8 -5
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
# ProgressIndicator
|
|
2
|
+
|
|
3
|
+
Progress Indicator communicates to the user the progress of a particular process.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { ProgressIndicator } from '@salesforce/design-system-react';
|
|
9
|
+
// or, one entry point per module:
|
|
10
|
+
import ProgressIndicator from '@salesforce/design-system-react/components/progress-indicator';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## ProgressIndicator props
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import type { ProgressIndicatorProps } from '@salesforce/design-system-react/components/progress-indicator';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The props type is a union: some props only apply to some variants (see the Types block). A prop is marked required only when every variant requires it.
|
|
20
|
+
|
|
21
|
+
| Prop | Type | Required | Description |
|
|
22
|
+
| --- | --- | --- | --- |
|
|
23
|
+
| `assistiveText` | `ProgressIndicatorAssistiveText` | | Assistive text for accessibility |
|
|
24
|
+
| `className` | `string \| string[] \| Record<string, boolean>` | | CSS classes |
|
|
25
|
+
| `completedSteps` | `ProgressStep[]` | | **Deprecated.** Set `status: 'completed'` on the step. Matched by `id`. |
|
|
26
|
+
| `disabledSteps` | `ProgressStep[]` | | **Deprecated.** Set `status: 'disabled'` on the step. Matched by `id`. |
|
|
27
|
+
| `errorSteps` | `ProgressStep[]` | | **Deprecated.** Set `status: 'error'` on the step. Matched by `id`. |
|
|
28
|
+
| `id` | `string` | | HTML id attribute |
|
|
29
|
+
| `labels` | `ProgressIndicatorLabels` | | **Text labels for internationalization** |
|
|
30
|
+
| `onStepClick` | `(event: React.MouseEvent \| React.KeyboardEvent, data: StepEventData) => void` | | Click handler for steps |
|
|
31
|
+
| `onStepFocus` | `(event: React.FocusEvent, data: StepEventData) => void` | | Focus handler for steps |
|
|
32
|
+
| `orientation` | `ProgressIndicatorOrientation \| 'vertical'` (`'horizontal' \| 'vertical'`) | | Orientation (horizontal or vertical). |
|
|
33
|
+
| `selectedStep` | `ProgressStep \| ProgressStep['id']` | Yes | Currently selected step: the `id` of one of the `steps` (a step object is also accepted and matched by its `id`; one without an `id` is matched by its content, which is deprecated). The first step is selected when nothing matches. |
|
|
34
|
+
| `steps` | `ProgressStep[]` | Yes | Array of all steps |
|
|
35
|
+
| `tooltip` | `undefined` | | |
|
|
36
|
+
| `tooltipIsOpenSteps` | `ProgressStep[]` | | Steps with open tooltips (for development). |
|
|
37
|
+
| `tooltipPosition` | `TooltipPosition` (`'absolute' \| 'overflowBoundaryElement' \| 'relative'`) | | Tooltip position strategy. |
|
|
38
|
+
| `type` | `'base' \| 'path'` | | Visual pattern, like `type` on `lightning-progress-indicator`. * `base` - (default) Step markers on a progress bar. |
|
|
39
|
+
| `variant` | `Exclude<ProgressIndicatorVariant, 'setup-assistant'> \| 'setup-assistant'` (`'base' \| 'modal' \| 'shade' \| 'setup-assistant'`) | | Component variant. |
|
|
40
|
+
|
|
41
|
+
## Types
|
|
42
|
+
|
|
43
|
+
Declarations the props above refer to, from the package `.d.ts`:
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
/**
|
|
47
|
+
* Props for the ProgressIndicator component: a union on `type` and `variant`,
|
|
48
|
+
* so a prop that a pattern ignores (or `orientation` that Setup Assistant
|
|
49
|
+
* overrides) does not compile.
|
|
50
|
+
*/
|
|
51
|
+
export type ProgressIndicatorProps = ProgressIndicatorBarProps | ProgressIndicatorSetupAssistantProps | ProgressIndicatorPathProps;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Step markers on a progress bar, with each step's label in a tooltip.
|
|
55
|
+
* * `base` - (default) For white backgrounds.
|
|
56
|
+
* * `shade` - For shaded backgrounds. Adds a light gray border to the step markers, like `variant="shade"` on `lightning-progress-indicator`.
|
|
57
|
+
* * `modal` - The `shade` styling, with tooltips positioned for a modal footer.
|
|
58
|
+
*/
|
|
59
|
+
interface ProgressIndicatorBarProps extends ProgressIndicatorBaseProps, ProgressIndicatorMarkerProps {
|
|
60
|
+
/**
|
|
61
|
+
* Visual pattern, like `type` on `lightning-progress-indicator`.
|
|
62
|
+
* * `base` - (default) Step markers on a progress bar.
|
|
63
|
+
*/
|
|
64
|
+
type?: 'base';
|
|
65
|
+
/** Component variant. */
|
|
66
|
+
variant?: Exclude<ProgressIndicatorVariant, 'setup-assistant'>;
|
|
67
|
+
/** Orientation (horizontal or vertical). */
|
|
68
|
+
orientation?: ProgressIndicatorOrientation;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Progress indicator variant
|
|
73
|
+
*/
|
|
74
|
+
export type ProgressIndicatorVariant = 'base' | 'modal' | 'setup-assistant' | 'shade';
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Progress indicator orientation
|
|
78
|
+
*/
|
|
79
|
+
export type ProgressIndicatorOrientation = 'horizontal' | 'vertical';
|
|
80
|
+
|
|
81
|
+
/** Vertical steps with a bordered list, for Setup Assistant. Always vertical. */
|
|
82
|
+
interface ProgressIndicatorSetupAssistantProps extends ProgressIndicatorBaseProps, ProgressIndicatorMarkerProps {
|
|
83
|
+
/** Visual pattern. Setup Assistant uses the base progress indicator. */
|
|
84
|
+
type?: 'base';
|
|
85
|
+
/** Vertical steps with a bordered list, for Setup Assistant. */
|
|
86
|
+
variant: 'setup-assistant';
|
|
87
|
+
/** Setup Assistant is always vertical. */
|
|
88
|
+
orientation?: 'vertical';
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* SLDS Path, with each step's label shown in its stage. Use the arrow keys to
|
|
93
|
+
* move between stages. Completion comes from `status: 'completed'`; there are no
|
|
94
|
+
* error, disabled, tooltip, orientation or variant props.
|
|
95
|
+
*/
|
|
96
|
+
interface ProgressIndicatorPathProps extends ProgressIndicatorBaseProps {
|
|
97
|
+
/** Visual pattern: SLDS Path, with each step's label shown in its stage. */
|
|
98
|
+
type: 'path';
|
|
99
|
+
disabledSteps?: never;
|
|
100
|
+
errorSteps?: never;
|
|
101
|
+
orientation?: never;
|
|
102
|
+
tooltip?: never;
|
|
103
|
+
tooltipIsOpenSteps?: never;
|
|
104
|
+
tooltipPosition?: never;
|
|
105
|
+
variant?: never;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Assistive text for ProgressIndicator
|
|
110
|
+
*/
|
|
111
|
+
export interface ProgressIndicatorAssistiveText {
|
|
112
|
+
/** `type="path"` only: read before a completed stage's name. Defaults to `Stage Complete` */
|
|
113
|
+
completedStage?: string;
|
|
114
|
+
/** Label for completed steps */
|
|
115
|
+
completedStep?: string;
|
|
116
|
+
/** `type="path"` only: read before the current stage's name. Defaults to `Current Stage:` */
|
|
117
|
+
currentStage?: string;
|
|
118
|
+
/** Label for disabled steps */
|
|
119
|
+
disabledStep?: string;
|
|
120
|
+
/** Label for error steps */
|
|
121
|
+
errorStep?: string;
|
|
122
|
+
/** Label for progress percentage */
|
|
123
|
+
percentage?: string;
|
|
124
|
+
/** Label prefix for steps */
|
|
125
|
+
step?: string;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Step object structure
|
|
130
|
+
*/
|
|
131
|
+
export interface ProgressStep {
|
|
132
|
+
/** Unique identifier. Steps are matched by `id`. */
|
|
133
|
+
id: string | number;
|
|
134
|
+
/**
|
|
135
|
+
* Status of the step. A step has one status, so it cannot be both `error` and `completed`.
|
|
136
|
+
* `disabled` and `error` apply to `type="base"` only; `type="path"` shows `completed`.
|
|
137
|
+
*/
|
|
138
|
+
status?: ProgressStepStatus;
|
|
139
|
+
/** Tooltip label */
|
|
140
|
+
label: string;
|
|
141
|
+
/** Optional assistive text override */
|
|
142
|
+
assistiveText?: string;
|
|
143
|
+
/** Action shown next to the step label. Only used by the `setup-assistant` variant. */
|
|
144
|
+
setupAssistantAction?: ReactNode;
|
|
145
|
+
/** Estimated time shown next to the step label. Only used by the `setup-assistant` variant. */
|
|
146
|
+
setupAssistantEstimatedTime?: ReactNode;
|
|
147
|
+
/** @deprecated Use `setupAssistantAction` instead. */
|
|
148
|
+
onRenderSetupAssistantAction?: ReactNode;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Status of a single step. A step has at most one status.
|
|
153
|
+
*/
|
|
154
|
+
export type ProgressStepStatus = 'completed' | 'disabled' | 'error';
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Text labels for ProgressIndicator
|
|
158
|
+
*/
|
|
159
|
+
export interface ProgressIndicatorLabels {
|
|
160
|
+
/** `type="path"` only: text before the current stage's name, which shows when the path collapses on narrow screens. Include any spacing between it and the name. Defaults to `Stage: ` */
|
|
161
|
+
stageNameBefore?: React.ReactNode;
|
|
162
|
+
/** `type="path"` only: text after the current stage's name. Include any spacing between it and the name. */
|
|
163
|
+
stageNameAfter?: React.ReactNode;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Step event data
|
|
168
|
+
*/
|
|
169
|
+
export interface StepEventData {
|
|
170
|
+
isCompleted: boolean;
|
|
171
|
+
isDisabled: boolean;
|
|
172
|
+
isError: boolean;
|
|
173
|
+
isSelected: boolean;
|
|
174
|
+
step: ProgressStep;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Tooltip position
|
|
179
|
+
*/
|
|
180
|
+
export type TooltipPosition = 'absolute' | 'overflowBoundaryElement' | 'relative';
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## Examples
|
|
184
|
+
|
|
185
|
+
Every story in Storybook for this component, in sidebar order, as code for an app: imports use the package paths, and Storybook's own code (`meta`, decorators, `parameters`) is left out. A story that renders an `__examples__` file shows that file the first time. Icons are served from `/assets/icons` (see `IconSettings`). Storybook: <https://opensource.salesforce.com/design-system-react/?path=/docs/components-progressindicator--docs>.
|
|
186
|
+
|
|
187
|
+
### Shared code: `components/progress-indicator/__docs__/ProgressIndicator.stories.jsx`
|
|
188
|
+
|
|
189
|
+
The stories from Components/ProgressIndicator below use these imports and helpers.
|
|
190
|
+
|
|
191
|
+
```jsx
|
|
192
|
+
import { useState } from 'react';
|
|
193
|
+
import ProgressIndicator from '@salesforce/design-system-react/components/progress-indicator';
|
|
194
|
+
|
|
195
|
+
const steps = [
|
|
196
|
+
{ id: 0, label: 'Step 1: Introduction' },
|
|
197
|
+
{ id: 1, label: 'Step 2: Configuration' },
|
|
198
|
+
{ id: 2, label: 'Step 3: Review' },
|
|
199
|
+
{ id: 3, label: 'Step 4: Confirmation' },
|
|
200
|
+
{ id: 4, label: 'Step 5: Complete' },
|
|
201
|
+
];
|
|
202
|
+
|
|
203
|
+
const stages = [
|
|
204
|
+
{ id: 0, label: 'Contacted' },
|
|
205
|
+
{ id: 1, label: 'Open' },
|
|
206
|
+
{ id: 2, label: 'Unqualified' },
|
|
207
|
+
{ id: 3, label: 'Nurturing' },
|
|
208
|
+
{ id: 4, label: 'Closed' },
|
|
209
|
+
];
|
|
210
|
+
|
|
211
|
+
// Returns copies of `list` with `statuses[index]` as each step's `status`
|
|
212
|
+
const withStatus = (list, statuses) =>
|
|
213
|
+
list.map((step, index) => ({ ...step, status: statuses[index] }));
|
|
214
|
+
|
|
215
|
+
// Interactive example
|
|
216
|
+
const InteractiveExample = () => {
|
|
217
|
+
const [currentStep, setCurrentStep] = useState(0);
|
|
218
|
+
|
|
219
|
+
const handleStepClick = (event, { step }) => {
|
|
220
|
+
const stepIndex = steps.findIndex((s) => s.id === step.id);
|
|
221
|
+
if (stepIndex !== -1) {
|
|
222
|
+
setCurrentStep(stepIndex);
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
return (
|
|
227
|
+
<div>
|
|
228
|
+
<ProgressIndicator
|
|
229
|
+
steps={withStatus(steps, Array(currentStep).fill('completed'))}
|
|
230
|
+
selectedStep={currentStep}
|
|
231
|
+
onStepClick={handleStepClick}
|
|
232
|
+
/>
|
|
233
|
+
<div className="slds-m-top_large slds-grid slds-grid_align-center">
|
|
234
|
+
<button
|
|
235
|
+
className="slds-button slds-button_neutral slds-m-right_small"
|
|
236
|
+
onClick={() => setCurrentStep(Math.max(0, currentStep - 1))}
|
|
237
|
+
disabled={currentStep === 0}
|
|
238
|
+
>
|
|
239
|
+
Previous
|
|
240
|
+
</button>
|
|
241
|
+
<button
|
|
242
|
+
className="slds-button slds-button_brand"
|
|
243
|
+
onClick={() =>
|
|
244
|
+
setCurrentStep(Math.min(steps.length - 1, currentStep + 1))
|
|
245
|
+
}
|
|
246
|
+
disabled={currentStep === steps.length - 1}
|
|
247
|
+
>
|
|
248
|
+
Next
|
|
249
|
+
</button>
|
|
250
|
+
</div>
|
|
251
|
+
</div>
|
|
252
|
+
);
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
// Interactive path: click a stage, or Tab to the path and use the arrow keys
|
|
256
|
+
const InteractivePathExample = () => {
|
|
257
|
+
const [currentStage, setCurrentStage] = useState(1);
|
|
258
|
+
|
|
259
|
+
const handleStepClick = (event, { step }) => {
|
|
260
|
+
const stageIndex = stages.findIndex((s) => s.id === step.id);
|
|
261
|
+
if (stageIndex !== -1) {
|
|
262
|
+
setCurrentStage(stageIndex);
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
return (
|
|
267
|
+
<ProgressIndicator
|
|
268
|
+
type="path"
|
|
269
|
+
steps={withStatus(stages, Array(currentStage).fill('completed'))}
|
|
270
|
+
selectedStep={currentStage}
|
|
271
|
+
onStepClick={handleStepClick}
|
|
272
|
+
/>
|
|
273
|
+
);
|
|
274
|
+
};
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
### Default
|
|
278
|
+
|
|
279
|
+
```jsx
|
|
280
|
+
const Default = () => (
|
|
281
|
+
<ProgressIndicator
|
|
282
|
+
steps={withStatus(steps, ['completed', 'completed'])}
|
|
283
|
+
selectedStep={2}
|
|
284
|
+
/>
|
|
285
|
+
);
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### Interactive
|
|
289
|
+
|
|
290
|
+
```jsx
|
|
291
|
+
const Interactive = () => <InteractiveExample />;
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### Vertical
|
|
295
|
+
|
|
296
|
+
```jsx
|
|
297
|
+
const Vertical = () => (
|
|
298
|
+
<ProgressIndicator
|
|
299
|
+
steps={withStatus(steps, ['completed', 'completed'])}
|
|
300
|
+
selectedStep={2}
|
|
301
|
+
orientation="vertical"
|
|
302
|
+
/>
|
|
303
|
+
);
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
### With Error
|
|
307
|
+
|
|
308
|
+
```jsx
|
|
309
|
+
const WithError = () => (
|
|
310
|
+
<ProgressIndicator
|
|
311
|
+
steps={withStatus(steps, ['completed', 'completed', 'error'])}
|
|
312
|
+
selectedStep={2}
|
|
313
|
+
/>
|
|
314
|
+
);
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### With Disabled Steps
|
|
318
|
+
|
|
319
|
+
```jsx
|
|
320
|
+
const WithDisabledSteps = () => (
|
|
321
|
+
<ProgressIndicator
|
|
322
|
+
steps={withStatus(steps, [
|
|
323
|
+
'completed',
|
|
324
|
+
undefined,
|
|
325
|
+
undefined,
|
|
326
|
+
'disabled',
|
|
327
|
+
'disabled',
|
|
328
|
+
])}
|
|
329
|
+
selectedStep={1}
|
|
330
|
+
/>
|
|
331
|
+
);
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
### Shade Variant
|
|
335
|
+
|
|
336
|
+
```jsx
|
|
337
|
+
const ShadeVariant = () => (
|
|
338
|
+
<div className="slds-theme_shade slds-p-around_medium">
|
|
339
|
+
<ProgressIndicator
|
|
340
|
+
steps={withStatus(steps, ['completed', 'completed'])}
|
|
341
|
+
selectedStep={2}
|
|
342
|
+
variant="shade"
|
|
343
|
+
/>
|
|
344
|
+
</div>
|
|
345
|
+
);
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### Modal Variant
|
|
349
|
+
|
|
350
|
+
```jsx
|
|
351
|
+
const ModalVariant = () => (
|
|
352
|
+
<ProgressIndicator
|
|
353
|
+
steps={withStatus(steps, ['completed', 'completed'])}
|
|
354
|
+
selectedStep={2}
|
|
355
|
+
variant="modal"
|
|
356
|
+
/>
|
|
357
|
+
);
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### Setup Assistant Variant
|
|
361
|
+
|
|
362
|
+
```jsx
|
|
363
|
+
const SetupAssistantVariant = () => (
|
|
364
|
+
<ProgressIndicator
|
|
365
|
+
steps={withStatus(steps, ['completed', 'completed'])}
|
|
366
|
+
selectedStep={2}
|
|
367
|
+
variant="setup-assistant"
|
|
368
|
+
/>
|
|
369
|
+
);
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
### All Complete
|
|
373
|
+
|
|
374
|
+
```jsx
|
|
375
|
+
const AllComplete = () => (
|
|
376
|
+
<ProgressIndicator
|
|
377
|
+
steps={withStatus(steps, Array(5).fill('completed'))}
|
|
378
|
+
selectedStep={4}
|
|
379
|
+
/>
|
|
380
|
+
);
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
### Path
|
|
384
|
+
|
|
385
|
+
```jsx
|
|
386
|
+
const Path = () => (
|
|
387
|
+
<ProgressIndicator
|
|
388
|
+
type="path"
|
|
389
|
+
steps={withStatus(stages, ['completed', 'completed'])}
|
|
390
|
+
selectedStep={2}
|
|
391
|
+
/>
|
|
392
|
+
);
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
### Interactive Path
|
|
396
|
+
|
|
397
|
+
```jsx
|
|
398
|
+
const InteractivePath = () => <InteractivePathExample />;
|
|
399
|
+
```
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# ProgressRing
|
|
2
|
+
|
|
3
|
+
Customizable progress ring displaying progress in a circular format.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { ProgressRing } from '@salesforce/design-system-react';
|
|
9
|
+
// or, one entry point per module:
|
|
10
|
+
import ProgressRing from '@salesforce/design-system-react/components/progress-ring';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## ProgressRing props
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import type { ProgressRingProps } from '@salesforce/design-system-react/components/progress-ring';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The props type is a union: some props only apply to some variants (see the Types block). A prop is marked required only when every variant requires it.
|
|
20
|
+
|
|
21
|
+
| Prop | Type | Required | Description |
|
|
22
|
+
| --- | --- | --- | --- |
|
|
23
|
+
| `className` | `string \| string[] \| Record<string, boolean>` | | CSS classes |
|
|
24
|
+
| `flowDirection` | `ProgressRingFlowDirection` (`'fill' \| 'drain'`) | | Flow direction of progress |
|
|
25
|
+
| `hasIcon` | `false \| true` | | Whether to display the theme icon |
|
|
26
|
+
| `icon` | `ReactNode` | | Custom icon to display instead of the theme icon |
|
|
27
|
+
| `id` | `string` | | HTML id attribute |
|
|
28
|
+
| `size` | `ProgressRingSize` (`'medium' \| 'large'`) | | Size of the progress ring |
|
|
29
|
+
| `theme` | `ProgressRingTheme` (`'warning' \| 'active' \| 'expired' \| 'complete'`) | | Theme applied to the ring |
|
|
30
|
+
| `value` | `number` | Yes | Progress percentage (0-100) |
|
|
31
|
+
|
|
32
|
+
## Types
|
|
33
|
+
|
|
34
|
+
Declarations the props above refer to, from the package `.d.ts`:
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
/**
|
|
38
|
+
* Props for the ProgressRing component. `icon` is only honored with `hasIcon`,
|
|
39
|
+
* so it is only accepted there.
|
|
40
|
+
*/
|
|
41
|
+
export type ProgressRingProps = ProgressRingBaseProps & (ProgressRingWithoutIconProps | ProgressRingWithIconProps);
|
|
42
|
+
|
|
43
|
+
/** No icon is rendered, so a custom `icon` would be ignored. */
|
|
44
|
+
interface ProgressRingWithoutIconProps {
|
|
45
|
+
/** Whether to display the theme icon */
|
|
46
|
+
hasIcon?: false;
|
|
47
|
+
icon?: never;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Renders the theme icon, or the custom `icon` when set. */
|
|
51
|
+
interface ProgressRingWithIconProps {
|
|
52
|
+
/** Whether to display the theme icon */
|
|
53
|
+
hasIcon: true;
|
|
54
|
+
/** Custom icon to display instead of the theme icon */
|
|
55
|
+
icon?: ReactNode;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export type ProgressRingFlowDirection = 'drain' | 'fill';
|
|
59
|
+
|
|
60
|
+
export type ProgressRingSize = 'medium' | 'large';
|
|
61
|
+
|
|
62
|
+
export type ProgressRingTheme = 'active' | 'warning' | 'expired' | 'complete';
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Examples
|
|
66
|
+
|
|
67
|
+
Every story in Storybook for this component, in sidebar order, as code for an app: imports use the package paths, and Storybook's own code (`meta`, decorators, `parameters`) is left out. A story that renders an `__examples__` file shows that file the first time. Icons are served from `/assets/icons` (see `IconSettings`). Storybook: <https://opensource.salesforce.com/design-system-react/?path=/docs/components-progressring--docs>.
|
|
68
|
+
|
|
69
|
+
### Shared code: `components/progress-ring/__docs__/ProgressRing.stories.jsx`
|
|
70
|
+
|
|
71
|
+
The stories from Components/ProgressRing below use these imports and helpers.
|
|
72
|
+
|
|
73
|
+
```jsx
|
|
74
|
+
import ProgressRing from '@salesforce/design-system-react/components/progress-ring';
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Default
|
|
78
|
+
|
|
79
|
+
```jsx
|
|
80
|
+
const Default = () => <ProgressRing value={75} />;
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Active
|
|
84
|
+
|
|
85
|
+
```jsx
|
|
86
|
+
const Active = () => <ProgressRing value={50} theme="active" hasIcon />;
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Warning
|
|
90
|
+
|
|
91
|
+
```jsx
|
|
92
|
+
const Warning = () => <ProgressRing value={80} theme="warning" hasIcon />;
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Expired
|
|
96
|
+
|
|
97
|
+
```jsx
|
|
98
|
+
const Expired = () => <ProgressRing value={100} theme="expired" hasIcon />;
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Complete
|
|
102
|
+
|
|
103
|
+
```jsx
|
|
104
|
+
const Complete = () => <ProgressRing value={100} theme="complete" hasIcon />;
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Fill Direction
|
|
108
|
+
|
|
109
|
+
```jsx
|
|
110
|
+
const FillDirection = () => (
|
|
111
|
+
<ProgressRing value={60} flowDirection="fill" theme="active" />
|
|
112
|
+
);
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Large
|
|
116
|
+
|
|
117
|
+
```jsx
|
|
118
|
+
const Large = () => (
|
|
119
|
+
<ProgressRing value={75} size="large" theme="active" hasIcon />
|
|
120
|
+
);
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### All Themes
|
|
124
|
+
|
|
125
|
+
```jsx
|
|
126
|
+
const AllThemes = () => (
|
|
127
|
+
<div className="slds-grid slds-wrap slds-gutters">
|
|
128
|
+
<div className="slds-col slds-size_1-of-4 slds-text-align_center">
|
|
129
|
+
<ProgressRing value={50} theme="active" hasIcon />
|
|
130
|
+
<p className="slds-m-top_small">Active (50%)</p>
|
|
131
|
+
</div>
|
|
132
|
+
<div className="slds-col slds-size_1-of-4 slds-text-align_center">
|
|
133
|
+
<ProgressRing value={75} theme="warning" hasIcon />
|
|
134
|
+
<p className="slds-m-top_small">Warning (75%)</p>
|
|
135
|
+
</div>
|
|
136
|
+
<div className="slds-col slds-size_1-of-4 slds-text-align_center">
|
|
137
|
+
<ProgressRing value={100} theme="expired" hasIcon />
|
|
138
|
+
<p className="slds-m-top_small">Expired (100%)</p>
|
|
139
|
+
</div>
|
|
140
|
+
<div className="slds-col slds-size_1-of-4 slds-text-align_center">
|
|
141
|
+
<ProgressRing value={100} theme="complete" hasIcon />
|
|
142
|
+
<p className="slds-m-top_small">Complete (100%)</p>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
);
|
|
146
|
+
```
|