@cdx-ui/components 0.2.3 → 0.2.5
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/AGENTS.md +24 -0
- package/README.md +2 -0
- package/coverage.svg +1 -1
- package/docs/components/accordion/content.md +538 -0
- package/docs/components/alert/content.md +203 -0
- package/docs/components/alert-dialog/content.md +319 -0
- package/docs/components/avatar/content.md +368 -0
- package/docs/components/avatar/design.md +202 -0
- package/docs/components/badge/content.md +225 -0
- package/docs/components/bottom-sheet/content.md +353 -0
- package/docs/components/bottom-sheet/design.md +249 -0
- package/docs/components/box/content.md +141 -0
- package/docs/components/breadcrumbs/content.md +169 -0
- package/docs/components/button/content.md +398 -0
- package/docs/components/button/design.md +258 -0
- package/docs/components/calendar/content.md +137 -0
- package/docs/components/card/content.md +283 -0
- package/docs/components/carousel/content.md +417 -0
- package/docs/components/checkbox/content.md +236 -0
- package/docs/components/checkbox/design.md +214 -0
- package/docs/components/chip/content.md +439 -0
- package/docs/components/chip/design.md +418 -0
- package/docs/components/color-area/content.md +84 -0
- package/docs/components/color-field/content.md +132 -0
- package/docs/components/color-picker/content.md +209 -0
- package/docs/components/color-slider/content.md +118 -0
- package/docs/components/color-swatch/content.md +62 -0
- package/docs/components/color-swatch-picker/content.md +124 -0
- package/docs/components/content.md +98 -0
- package/docs/components/currency-input/content.md +205 -0
- package/docs/components/data-grid/content.md +521 -0
- package/docs/components/date-field/content.md +147 -0
- package/docs/components/date-picker/content.md +360 -0
- package/docs/components/date-range-picker/content.md +301 -0
- package/docs/components/date-time-field/content.md +157 -0
- package/docs/components/date-time-list/content.md +105 -0
- package/docs/components/date-time-picker/content.md +272 -0
- package/docs/components/dialog/content.md +436 -0
- package/docs/components/dialog/design.md +192 -0
- package/docs/components/divider/content.md +112 -0
- package/docs/components/drawer/content.md +428 -0
- package/docs/components/field/content.md +277 -0
- package/docs/components/form/content.md +62 -0
- package/docs/components/full-screen-dialog/content.md +881 -0
- package/docs/components/heading/content.md +55 -0
- package/docs/components/icon/content.md +190 -0
- package/docs/components/icon-button/content.md +200 -0
- package/docs/components/icon-button/design.md +165 -0
- package/docs/components/image/content.md +104 -0
- package/docs/components/input/content.md +346 -0
- package/docs/components/input/design.md +389 -0
- package/docs/components/insurance-disclosure/content.md +103 -0
- package/docs/components/link/content.md +180 -0
- package/docs/components/link/design.md +160 -0
- package/docs/components/list-item/content.md +695 -0
- package/docs/components/menu/content.md +1254 -0
- package/docs/components/month-calendar/content.md +84 -0
- package/docs/components/month-picker/content.md +273 -0
- package/docs/components/otp-input/content.md +327 -0
- package/docs/components/progress-bar/content.md +87 -0
- package/docs/components/progress-circle/content.md +176 -0
- package/docs/components/progress-segmented/content.md +119 -0
- package/docs/components/quick-action-button/content.md +154 -0
- package/docs/components/quick-action-button/design.md +170 -0
- package/docs/components/radio/content.md +224 -0
- package/docs/components/range-calendar/content.md +123 -0
- package/docs/components/reorderable-list/content.md +311 -0
- package/docs/components/scoped-theme/content.md +47 -0
- package/docs/components/scroll-shadow/content.md +693 -0
- package/docs/components/select/content.md +473 -0
- package/docs/components/select/design.md +301 -0
- package/docs/components/skeleton/content.md +104 -0
- package/docs/components/slider/content.md +423 -0
- package/docs/components/stack/content.md +161 -0
- package/docs/components/switch/content.md +150 -0
- package/docs/components/switch/design.md +208 -0
- package/docs/components/table/content.md +548 -0
- package/docs/components/table-pagination/content.md +177 -0
- package/docs/components/tabs/content.md +297 -0
- package/docs/components/text/content.md +142 -0
- package/docs/components/textarea/content.md +222 -0
- package/docs/components/tile/content.md +702 -0
- package/docs/components/toast/content.md +456 -0
- package/docs/components/toggle-button/content.md +505 -0
- package/docs/components/tooltip/content.md +350 -0
- package/docs/components/virtualized-list/content.md +250 -0
- package/docs/foundations/content.md +9 -0
- package/docs/foundations/expressions/icons/content.md +19 -0
- package/docs/foundations/styles/tokens/all-tokens/content.md +192 -0
- package/docs/foundations/styles/tokens/what-are-tokens/content.md +33 -0
- package/docs/foundations/styles/tokens/what-are-tokens/design.md +33 -0
- package/docs/getting-started/content.md +4 -0
- package/docs/getting-started/designers/content.md +13 -0
- package/docs/getting-started/designers/design.md +13 -0
- package/docs/getting-started/developers/accessibility/content.md +31 -0
- package/docs/getting-started/developers/content.md +612 -0
- package/docs/getting-started/developers/styling/content.md +195 -0
- package/docs/llms.txt +195 -0
- package/docs/patterns/account-management/content.md +75 -0
- package/docs/patterns/authentication/content.md +50 -0
- package/docs/patterns/content.md +10 -0
- package/docs/patterns/dashboard/content.md +34 -0
- package/docs/patterns/empty-states/content.md +32 -0
- package/docs/patterns/forms/content.md +108 -0
- package/docs/patterns/onboarding/content.md +69 -0
- package/docs/patterns/payments/content.md +35 -0
- package/docs/patterns/settings/content.md +72 -0
- package/docs/resources/content.md +9 -0
- package/docs/resources/figma-libraries/content.md +42 -0
- package/docs/resources/release-notes/0.0.1-beta.118/content.md +27 -0
- package/docs/resources/release-notes/0.0.1-beta.122/content.md +21 -0
- package/docs/resources/release-notes/0.0.1-beta.124/content.md +16 -0
- package/docs/resources/release-notes/0.0.1-beta.126/content.md +10 -0
- package/docs/resources/release-notes/0.0.1-beta.127/content.md +14 -0
- package/docs/resources/release-notes/0.0.1-beta.128/content.md +9 -0
- package/docs/resources/release-notes/0.0.1-beta.129/content.md +18 -0
- package/docs/resources/release-notes/0.0.1-beta.130/content.md +18 -0
- package/docs/resources/release-notes/0.0.1-beta.133/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.134/content.md +17 -0
- package/docs/resources/release-notes/0.0.1-beta.136/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.137/content.md +10 -0
- package/docs/resources/release-notes/0.0.1-beta.138/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.139/content.md +13 -0
- package/docs/resources/release-notes/0.0.1-beta.140/content.md +26 -0
- package/docs/resources/release-notes/0.0.1-beta.141/content.md +63 -0
- package/docs/resources/release-notes/0.0.1-beta.142/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.143/content.md +12 -0
- package/docs/resources/release-notes/0.0.1-beta.144/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.145/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.147/content.md +10 -0
- package/docs/resources/release-notes/0.0.1-beta.149/content.md +10 -0
- package/docs/resources/release-notes/0.0.1-beta.150/content.md +13 -0
- package/docs/resources/release-notes/0.0.1-beta.152/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.154/content.md +15 -0
- package/docs/resources/release-notes/0.0.1-beta.156/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.158/content.md +9 -0
- package/docs/resources/release-notes/0.0.1-beta.159/content.md +11 -0
- package/docs/resources/release-notes/0.0.1-beta.160/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.161/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.163/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.164/content.md +9 -0
- package/docs/resources/release-notes/0.0.1-beta.166/content.md +17 -0
- package/docs/resources/release-notes/0.0.1-beta.167/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.168/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.169/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.171/content.md +16 -0
- package/docs/resources/release-notes/0.0.1-beta.172/content.md +24 -0
- package/docs/resources/release-notes/0.0.1-beta.173/content.md +15 -0
- package/docs/resources/release-notes/0.0.1-beta.174/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.176/content.md +32 -0
- package/docs/resources/release-notes/0.0.1-beta.179/content.md +11 -0
- package/docs/resources/release-notes/0.0.1-beta.182/content.md +13 -0
- package/docs/resources/release-notes/0.0.1-beta.185/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.187/content.md +27 -0
- package/docs/resources/release-notes/0.1.1/content.md +23 -0
- package/docs/resources/release-notes/0.1.2/content.md +7 -0
- package/docs/resources/release-notes/0.1.4/content.md +19 -0
- package/docs/resources/release-notes/0.1.5/content.md +7 -0
- package/docs/resources/release-notes/0.1.6/content.md +7 -0
- package/docs/resources/release-notes/0.2.0/content.md +31 -0
- package/docs/resources/release-notes/0.2.1/content.md +17 -0
- package/docs/resources/release-notes/0.2.2/content.md +11 -0
- package/docs/resources/release-notes/0.2.3/content.md +15 -0
- package/docs/resources/release-notes/0.2.4/content.md +17 -0
- package/docs/resources/release-notes/content.md +65 -0
- package/lib/commonjs/components/Box/Box.js +9 -1
- package/lib/commonjs/components/Box/Box.js.map +1 -1
- package/lib/commonjs/components/Breadcrumbs/index.js +28 -3
- package/lib/commonjs/components/Breadcrumbs/index.js.map +1 -1
- package/lib/commonjs/components/Breadcrumbs/styles.js +27 -0
- package/lib/commonjs/components/Breadcrumbs/styles.js.map +1 -1
- package/lib/commonjs/components/DateTimeList/index.js +11 -26
- package/lib/commonjs/components/DateTimeList/index.js.map +1 -1
- package/lib/commonjs/components/DateTimeList/styles.js +2 -12
- package/lib/commonjs/components/DateTimeList/styles.js.map +1 -1
- package/lib/commonjs/components/ListItem/index.js.map +1 -1
- package/lib/commonjs/components/ListItem/styles.js +2 -1
- package/lib/commonjs/components/ListItem/styles.js.map +1 -1
- package/lib/commonjs/components/Menu/index.js +11 -5
- package/lib/commonjs/components/Menu/index.js.map +1 -1
- package/lib/commonjs/components/ScrollShadow/gradient.js +29 -0
- package/lib/commonjs/components/ScrollShadow/gradient.js.map +1 -0
- package/lib/commonjs/components/ScrollShadow/index.js +171 -44
- package/lib/commonjs/components/ScrollShadow/index.js.map +1 -1
- package/lib/commonjs/components/ScrollShadow/styles.js +58 -14
- package/lib/commonjs/components/ScrollShadow/styles.js.map +1 -1
- package/lib/commonjs/components/ScrollShadow/useComposedScrollHandler.js +63 -0
- package/lib/commonjs/components/ScrollShadow/useComposedScrollHandler.js.map +1 -0
- package/lib/commonjs/components/ScrollShadow/useScrollShadow.js +48 -8
- package/lib/commonjs/components/ScrollShadow/useScrollShadow.js.map +1 -1
- package/lib/commonjs/components/Stack/HStack.js +6 -2
- package/lib/commonjs/components/Stack/HStack.js.map +1 -1
- package/lib/commonjs/components/Stack/VStack.js +6 -2
- package/lib/commonjs/components/Stack/VStack.js.map +1 -1
- package/lib/commonjs/components/Tabs/index.js +16 -23
- package/lib/commonjs/components/Tabs/index.js.map +1 -1
- package/lib/commonjs/components/Tabs/styles.js +1 -10
- package/lib/commonjs/components/Tabs/styles.js.map +1 -1
- package/lib/commonjs/figma/ListItem.SectionHeader.figma.js +20 -5
- package/lib/commonjs/figma/ListItem.SectionHeader.figma.js.map +1 -1
- package/lib/commonjs/index.js +10 -10
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/components/Box/Box.js +9 -1
- package/lib/module/components/Box/Box.js.map +1 -1
- package/lib/module/components/Breadcrumbs/index.js +29 -4
- package/lib/module/components/Breadcrumbs/index.js.map +1 -1
- package/lib/module/components/Breadcrumbs/styles.js +26 -0
- package/lib/module/components/Breadcrumbs/styles.js.map +1 -1
- package/lib/module/components/DateTimeList/index.js +12 -27
- package/lib/module/components/DateTimeList/index.js.map +1 -1
- package/lib/module/components/DateTimeList/styles.js +1 -11
- package/lib/module/components/DateTimeList/styles.js.map +1 -1
- package/lib/module/components/ListItem/index.js.map +1 -1
- package/lib/module/components/ListItem/styles.js +2 -1
- package/lib/module/components/ListItem/styles.js.map +1 -1
- package/lib/module/components/Menu/index.js +11 -5
- package/lib/module/components/Menu/index.js.map +1 -1
- package/lib/module/components/ScrollShadow/gradient.js +24 -0
- package/lib/module/components/ScrollShadow/gradient.js.map +1 -0
- package/lib/module/components/ScrollShadow/index.js +170 -48
- package/lib/module/components/ScrollShadow/index.js.map +1 -1
- package/lib/module/components/ScrollShadow/styles.js +57 -13
- package/lib/module/components/ScrollShadow/styles.js.map +1 -1
- package/lib/module/components/ScrollShadow/useComposedScrollHandler.js +57 -0
- package/lib/module/components/ScrollShadow/useComposedScrollHandler.js.map +1 -0
- package/lib/module/components/ScrollShadow/useScrollShadow.js +46 -8
- package/lib/module/components/ScrollShadow/useScrollShadow.js.map +1 -1
- package/lib/module/components/Stack/HStack.js +6 -2
- package/lib/module/components/Stack/HStack.js.map +1 -1
- package/lib/module/components/Stack/VStack.js +6 -2
- package/lib/module/components/Stack/VStack.js.map +1 -1
- package/lib/module/components/Tabs/index.js +17 -24
- package/lib/module/components/Tabs/index.js.map +1 -1
- package/lib/module/components/Tabs/styles.js +0 -9
- package/lib/module/components/Tabs/styles.js.map +1 -1
- package/lib/module/figma/ListItem.SectionHeader.figma.js +20 -5
- package/lib/module/figma/ListItem.SectionHeader.figma.js.map +1 -1
- package/lib/module/index.js +6 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/animation/hooks/usePopupDialogContentAnimation.d.ts +2 -2
- package/lib/typescript/animation/hooks/usePopupOverlayAnimation.d.ts +2 -2
- package/lib/typescript/components/Box/Box.d.ts +4 -0
- package/lib/typescript/components/Box/Box.d.ts.map +1 -1
- package/lib/typescript/components/Breadcrumbs/index.d.ts +3 -1
- package/lib/typescript/components/Breadcrumbs/index.d.ts.map +1 -1
- package/lib/typescript/components/Breadcrumbs/styles.d.ts +2 -0
- package/lib/typescript/components/Breadcrumbs/styles.d.ts.map +1 -1
- package/lib/typescript/components/DateTimeList/index.d.ts.map +1 -1
- package/lib/typescript/components/DateTimeList/styles.d.ts +1 -4
- package/lib/typescript/components/DateTimeList/styles.d.ts.map +1 -1
- package/lib/typescript/components/ListItem/index.d.ts +5 -4
- package/lib/typescript/components/ListItem/index.d.ts.map +1 -1
- package/lib/typescript/components/ListItem/styles.d.ts +1 -1
- package/lib/typescript/components/ListItem/styles.d.ts.map +1 -1
- package/lib/typescript/components/Menu/index.d.ts.map +1 -1
- package/lib/typescript/components/ScrollShadow/gradient.d.ts +7 -0
- package/lib/typescript/components/ScrollShadow/gradient.d.ts.map +1 -0
- package/lib/typescript/components/ScrollShadow/index.d.ts +57 -15
- package/lib/typescript/components/ScrollShadow/index.d.ts.map +1 -1
- package/lib/typescript/components/ScrollShadow/styles.d.ts +8 -2
- package/lib/typescript/components/ScrollShadow/styles.d.ts.map +1 -1
- package/lib/typescript/components/ScrollShadow/useComposedScrollHandler.d.ts +13 -0
- package/lib/typescript/components/ScrollShadow/useComposedScrollHandler.d.ts.map +1 -0
- package/lib/typescript/components/ScrollShadow/useScrollShadow.d.ts +15 -2
- package/lib/typescript/components/ScrollShadow/useScrollShadow.d.ts.map +1 -1
- package/lib/typescript/components/Stack/HStack.d.ts +3 -2
- package/lib/typescript/components/Stack/HStack.d.ts.map +1 -1
- package/lib/typescript/components/Stack/VStack.d.ts +3 -2
- package/lib/typescript/components/Stack/VStack.d.ts.map +1 -1
- package/lib/typescript/components/Tabs/index.d.ts.map +1 -1
- package/lib/typescript/components/Tabs/styles.d.ts +0 -7
- package/lib/typescript/components/Tabs/styles.d.ts.map +1 -1
- package/lib/typescript/components/Toast/animation.d.ts +3 -3
- package/lib/typescript/components/Toast/animation.d.ts.map +1 -1
- package/lib/typescript/figma/ListItem.SectionHeader.figma.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +6 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +11 -9
- package/src/components/Box/Box.tsx +18 -4
- package/src/components/Breadcrumbs/index.tsx +28 -4
- package/src/components/Breadcrumbs/styles.ts +30 -0
- package/src/components/DateTimeList/index.tsx +13 -26
- package/src/components/DateTimeList/styles.ts +1 -10
- package/src/components/ListItem/index.tsx +5 -4
- package/src/components/ListItem/styles.ts +1 -0
- package/src/components/Menu/index.tsx +11 -8
- package/src/components/ScrollShadow/gradient.ts +48 -0
- package/src/components/ScrollShadow/index.tsx +300 -69
- package/src/components/ScrollShadow/styles.ts +45 -28
- package/src/components/ScrollShadow/useComposedScrollHandler.ts +58 -0
- package/src/components/ScrollShadow/useScrollShadow.ts +72 -10
- package/src/components/Stack/HStack.tsx +8 -4
- package/src/components/Stack/VStack.tsx +8 -4
- package/src/components/Tabs/index.tsx +25 -35
- package/src/components/Tabs/styles.ts +0 -9
- package/src/index.ts +8 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Progress Bar (https://design.candescent.com/docs/components/progress-bar)
|
|
2
|
+
|
|
3
|
+
Resources: [Figma](https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--Components?node-id=4927-541), [Storybook](https://victorious-wave-0daadf00f.6.azurestaticapps.net/?path=/story/feedback-progressbar--default)
|
|
4
|
+
|
|
5
|
+
A compound component: the root acts as the track, and `ProgressBar.Indicator` fills proportionally to the current value.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { ProgressBar } from '@cdx-ui/components';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Basic
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { ProgressBar } from '@cdx-ui/components';
|
|
15
|
+
|
|
16
|
+
export default function ProgressBarBasicDemo() {
|
|
17
|
+
return (
|
|
18
|
+
<ProgressBar value={45} max={100} accessibilityLabel="Upload progress">
|
|
19
|
+
<ProgressBar.Indicator />
|
|
20
|
+
</ProgressBar>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Values
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
import { Box, ProgressBar, Text } from '@cdx-ui/components';
|
|
29
|
+
|
|
30
|
+
const values = [0, 25, 70, 100] as const;
|
|
31
|
+
|
|
32
|
+
export default function ProgressBarValuesDemo() {
|
|
33
|
+
return (
|
|
34
|
+
<Box className="w-full max-w-md gap-4">
|
|
35
|
+
{values.map((value) => (
|
|
36
|
+
<Box key={value} className="gap-1.5">
|
|
37
|
+
<Text size="sm" color="secondary">
|
|
38
|
+
{value}%
|
|
39
|
+
</Text>
|
|
40
|
+
<ProgressBar value={value} max={100} accessibilityLabel={`${value}% complete`}>
|
|
41
|
+
<ProgressBar.Indicator />
|
|
42
|
+
</ProgressBar>
|
|
43
|
+
</Box>
|
|
44
|
+
))}
|
|
45
|
+
</Box>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## API
|
|
51
|
+
|
|
52
|
+
### ProgressBar
|
|
53
|
+
|
|
54
|
+
Sets `role="progressbar"` and `accessibilityRole="progressbar"`. Pass `value={null}` for indeterminate state. Provide an `accessibilityLabel` that names the progress being measured.
|
|
55
|
+
|
|
56
|
+
| Prop | Type | Default | Description |
|
|
57
|
+
| --- | --- | --- | --- |
|
|
58
|
+
| `className?` | `string` | — | — |
|
|
59
|
+
| `children?` | `React.ReactNode` | — | — |
|
|
60
|
+
| `value?` | `number \| null` | `0` | Current value in the range `[0, max]`, or `null` for indeterminate progress. Values below `0` clamp to `0`; values above `max` clamp to `max`. Non-finite values (such as `NaN`) are treated as `0`. |
|
|
61
|
+
| `max?` | `number` | `100` | Maximum value. The minimum is always `0`. A `max` of `0` or less is treated as complete. |
|
|
62
|
+
| `getValueLabel?` | `((value: number, max: number) => string)` | — | Screen-reader text for determinate progress (`accessibilityValue.text`). Defaults to a rounded percentage of `max`, such as `"45%"`. No effect when `value` is `null`, or when `accessibilityValue` is set. |
|
|
63
|
+
|
|
64
|
+
Inherits all [`ViewProps`](https://reactnative.dev/docs/view#props).
|
|
65
|
+
|
|
66
|
+
| Attribute | Values | Description |
|
|
67
|
+
| ------------ | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------- |
|
|
68
|
+
| `data-state` | `loading` \| `complete` \| `indeterminate` | `loading` while `0 ≤ value < max`; `complete` at `value ≥ max` or `max ≤ 0`; `indeterminate` when `value` is `null` |
|
|
69
|
+
| `data-value` | string (absent when indeterminate) | Clamped numeric value |
|
|
70
|
+
| `data-max` | string | Maximum value |
|
|
71
|
+
|
|
72
|
+
## Sub-components
|
|
73
|
+
|
|
74
|
+
### ProgressBar.Indicator
|
|
75
|
+
|
|
76
|
+
The filled portion of the track. Width is set automatically from `value / max`.
|
|
77
|
+
|
|
78
|
+
| Prop | Type | Default | Description |
|
|
79
|
+
| --- | --- | --- | --- |
|
|
80
|
+
| `className?` | `string` | — | — |
|
|
81
|
+
| `children?` | `React.ReactNode` | — | — |
|
|
82
|
+
|
|
83
|
+
Inherits all [`ViewProps`](https://reactnative.dev/docs/view#props).
|
|
84
|
+
|
|
85
|
+
## Accessibility
|
|
86
|
+
|
|
87
|
+
The root is a progressbar. Determinate values announce `accessibilityValue` with `min`, `max`, `now`, and `text`. The default `text` is a rounded percentage of `max`; pass `getValueLabel` to replace it. Indeterminate (`value={null}`) omits `now` and announces `"Indeterminate"`. Pass `accessibilityValue` to replace that announcement, including a localized indeterminate label.
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# Progress Circle (https://design.candescent.com/docs/components/progress-circle)
|
|
2
|
+
|
|
3
|
+
Resources: [Figma](https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--Components?node-id=2616-182), [Storybook](https://victorious-wave-0daadf00f.6.azurestaticapps.net/?path=/story/feedback-progresscircle--default)
|
|
4
|
+
|
|
5
|
+
A compound component: the root sizes the ring, and `ProgressCircle.Indicator` draws the arc fill.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { ProgressCircle } from '@cdx-ui/components';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Basic
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { ProgressCircle } from '@cdx-ui/components';
|
|
15
|
+
|
|
16
|
+
export default function ProgressCircleBasicDemo() {
|
|
17
|
+
return (
|
|
18
|
+
<ProgressCircle value={45} max={100} accessibilityLabel="Upload progress">
|
|
19
|
+
<ProgressCircle.Indicator />
|
|
20
|
+
</ProgressCircle>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Values
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
import { Box, ProgressCircle, Text } from '@cdx-ui/components';
|
|
29
|
+
|
|
30
|
+
const values = [0, 25, 70, 100] as const;
|
|
31
|
+
|
|
32
|
+
export default function ProgressCircleValuesDemo() {
|
|
33
|
+
return (
|
|
34
|
+
<Box className="flex-row flex-wrap items-center gap-6">
|
|
35
|
+
{values.map((value) => (
|
|
36
|
+
<Box key={value} className="items-center gap-1.5">
|
|
37
|
+
<ProgressCircle value={value} max={100} accessibilityLabel={`${value}% complete`}>
|
|
38
|
+
<ProgressCircle.Indicator />
|
|
39
|
+
</ProgressCircle>
|
|
40
|
+
<Text size="sm" color="secondary">
|
|
41
|
+
{value}%
|
|
42
|
+
</Text>
|
|
43
|
+
</Box>
|
|
44
|
+
))}
|
|
45
|
+
</Box>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Sizes
|
|
51
|
+
|
|
52
|
+
Size is inherited by `ProgressCircle.Indicator` unless overridden.
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
import { Box, ProgressCircle, Text } from '@cdx-ui/components';
|
|
56
|
+
|
|
57
|
+
export default function ProgressCircleSizesDemo() {
|
|
58
|
+
return (
|
|
59
|
+
<Box className="flex-row items-end gap-6">
|
|
60
|
+
<Box className="items-center gap-1.5">
|
|
61
|
+
<ProgressCircle value={60} size="large" accessibilityLabel="Large progress">
|
|
62
|
+
<ProgressCircle.Indicator />
|
|
63
|
+
</ProgressCircle>
|
|
64
|
+
<Text size="sm" color="secondary">
|
|
65
|
+
large
|
|
66
|
+
</Text>
|
|
67
|
+
</Box>
|
|
68
|
+
<Box className="items-center gap-1.5">
|
|
69
|
+
<ProgressCircle value={60} size="small" accessibilityLabel="Small progress">
|
|
70
|
+
<ProgressCircle.Indicator />
|
|
71
|
+
</ProgressCircle>
|
|
72
|
+
<Text size="sm" color="secondary">
|
|
73
|
+
small
|
|
74
|
+
</Text>
|
|
75
|
+
</Box>
|
|
76
|
+
</Box>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Colors
|
|
82
|
+
|
|
83
|
+
`inherit` uses `currentColor` so the ring follows the surrounding text color.
|
|
84
|
+
|
|
85
|
+
```tsx
|
|
86
|
+
import { Box, ProgressCircle, Text } from '@cdx-ui/components';
|
|
87
|
+
|
|
88
|
+
export default function ProgressCircleColorsDemo() {
|
|
89
|
+
return (
|
|
90
|
+
<Box className="flex-row items-end gap-6">
|
|
91
|
+
<Box className="items-center gap-1.5">
|
|
92
|
+
<ProgressCircle value={60} color="default" accessibilityLabel="Default color">
|
|
93
|
+
<ProgressCircle.Indicator />
|
|
94
|
+
</ProgressCircle>
|
|
95
|
+
<Text size="sm" color="secondary">
|
|
96
|
+
default
|
|
97
|
+
</Text>
|
|
98
|
+
</Box>
|
|
99
|
+
<Box className="items-center gap-1.5 text-content-danger">
|
|
100
|
+
<ProgressCircle value={60} color="inherit" accessibilityLabel="Inherit color">
|
|
101
|
+
<ProgressCircle.Indicator />
|
|
102
|
+
</ProgressCircle>
|
|
103
|
+
<Text size="sm" color="secondary">
|
|
104
|
+
inherit
|
|
105
|
+
</Text>
|
|
106
|
+
</Box>
|
|
107
|
+
</Box>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Indeterminate
|
|
113
|
+
|
|
114
|
+
Pass `value={null}` for an infinite spinning loader.
|
|
115
|
+
|
|
116
|
+
```tsx
|
|
117
|
+
import { ProgressCircle } from '@cdx-ui/components';
|
|
118
|
+
|
|
119
|
+
export default function ProgressCircleIndeterminateDemo() {
|
|
120
|
+
return (
|
|
121
|
+
<ProgressCircle value={null} accessibilityLabel="Loading">
|
|
122
|
+
<ProgressCircle.Indicator />
|
|
123
|
+
</ProgressCircle>
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## API
|
|
129
|
+
|
|
130
|
+
### ProgressCircle
|
|
131
|
+
|
|
132
|
+
Sets `role="progressbar"` and `accessibilityRole="progressbar"`. Pass `value={null}` for indeterminate state. Provide an `accessibilityLabel` that names the progress being measured.
|
|
133
|
+
|
|
134
|
+
| Prop | Type | Default | Description |
|
|
135
|
+
| --- | --- | --- | --- |
|
|
136
|
+
| `className?` | `string` | — | — |
|
|
137
|
+
| `children?` | `React.ReactNode` | — | — |
|
|
138
|
+
| `size?` | `'large' \| 'small' \| null` | — | — |
|
|
139
|
+
| `color?` | `'default' \| 'inherit' \| null` | `'default'` | Stroke color. `inherit` uses `currentColor` with the track at 24% opacity. Inherited by `ProgressCircle.Indicator` unless overridden. |
|
|
140
|
+
| `value?` | `number \| null` | `0` | Current value in the range `[0, max]`, or `null` for indeterminate progress. Values below `0` clamp to `0`; values above `max` clamp to `max`. Non-finite values (such as `NaN`) are treated as `0`. |
|
|
141
|
+
| `max?` | `number` | `100` | Maximum value. The minimum is always `0`. A `max` of `0` or less is treated as complete. |
|
|
142
|
+
| `getValueLabel?` | `((value: number, max: number) => string)` | — | Screen-reader text for determinate progress (`accessibilityValue.text`). Defaults to a rounded percentage of `max`, such as `"45%"`. No effect when `value` is `null`, or when `accessibilityValue` is set. |
|
|
143
|
+
|
|
144
|
+
Inherits all [`ViewProps`](https://reactnative.dev/docs/view#props).
|
|
145
|
+
|
|
146
|
+
| Attribute | Values | Description |
|
|
147
|
+
| ------------ | ------------------------------------------ | ---------------------- |
|
|
148
|
+
| `data-state` | `loading` \| `complete` \| `indeterminate` | Current progress state |
|
|
149
|
+
| `data-value` | string (absent when indeterminate) | Clamped numeric value |
|
|
150
|
+
| `data-max` | string | Maximum value |
|
|
151
|
+
|
|
152
|
+
## Sub-components
|
|
153
|
+
|
|
154
|
+
### ProgressCircle.Indicator
|
|
155
|
+
|
|
156
|
+
The SVG ring. Arc length is set automatically from `value / max`. In indeterminate mode the ring spins a partial arc.
|
|
157
|
+
|
|
158
|
+
| Prop | Type | Default | Description |
|
|
159
|
+
| --- | --- | --- | --- |
|
|
160
|
+
| `className?` | `string` | — | — |
|
|
161
|
+
| `children?` | `React.ReactNode` | — | — |
|
|
162
|
+
| `size?` | `'large' \| 'small' \| null` | — | Overrides the size inherited from `ProgressCircle`. |
|
|
163
|
+
| `color?` | `'default' \| 'inherit' \| null` | — | Overrides the color inherited from `ProgressCircle`. |
|
|
164
|
+
|
|
165
|
+
Inherits all [`ViewProps`](https://reactnative.dev/docs/view#props).
|
|
166
|
+
|
|
167
|
+
## Anatomy
|
|
168
|
+
|
|
169
|
+
| `data-slot` | Element |
|
|
170
|
+
| --------------------------- | ----------------- |
|
|
171
|
+
| `progress-circle` | Root |
|
|
172
|
+
| `progress-circle-indicator` | Indicator wrapper |
|
|
173
|
+
|
|
174
|
+
## Accessibility
|
|
175
|
+
|
|
176
|
+
The root is a progressbar. Determinate values announce `accessibilityValue` with `min`, `max`, `now`, and `text` (default English percentage). Indeterminate (`value={null}`) omits `now` and announces `"Indeterminate"`. Use `getValueLabel` for i18n.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Progress Segmented (https://design.candescent.com/docs/components/progress-segmented)
|
|
2
|
+
|
|
3
|
+
Resources: [Figma](https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--React-Native-Components?node-id=449-449), [Storybook](https://victorious-wave-0daadf00f.6.azurestaticapps.net/?path=/story/feedback-progresssegmented--default)
|
|
4
|
+
|
|
5
|
+
A single (non-compound) component for step-based progress. Pair with a visible step label when WCAG 1.4.1 color-independence is required.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { ProgressSegmented } from '@cdx-ui/components';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Basic
|
|
12
|
+
|
|
13
|
+
Mid-step in-progress state (`step={2}` of `segments={5}`).
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { ProgressSegmented } from '@cdx-ui/components';
|
|
17
|
+
|
|
18
|
+
export default function ProgressSegmentedBasicDemo() {
|
|
19
|
+
return (
|
|
20
|
+
<ProgressSegmented
|
|
21
|
+
step={2}
|
|
22
|
+
segments={5}
|
|
23
|
+
accessibilityLabel="Onboarding progress"
|
|
24
|
+
className="max-w-md"
|
|
25
|
+
/>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## States
|
|
31
|
+
|
|
32
|
+
Steps `0` through `N`, plus `isStepComplete` on the final step. Visible labels accompany each bar so progress is not conveyed by color alone.
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import { Box, ProgressSegmented, Text, VStack } from '@cdx-ui/components';
|
|
36
|
+
|
|
37
|
+
const segments = 4;
|
|
38
|
+
|
|
39
|
+
const rows = [
|
|
40
|
+
{ step: 0, isStepComplete: false, label: 'Not started' },
|
|
41
|
+
{ step: 1, isStepComplete: false, label: 'Step 1 of 4' },
|
|
42
|
+
{ step: 2, isStepComplete: false, label: 'Step 2 of 4' },
|
|
43
|
+
{ step: 3, isStepComplete: false, label: 'Step 3 of 4' },
|
|
44
|
+
{ step: 4, isStepComplete: false, label: 'Step 4 of 4' },
|
|
45
|
+
{ step: 4, isStepComplete: true, label: 'Step 4 of 4, completed' },
|
|
46
|
+
] as const;
|
|
47
|
+
|
|
48
|
+
export default function ProgressSegmentedStatesDemo() {
|
|
49
|
+
return (
|
|
50
|
+
<VStack space="lg" className="w-full max-w-md">
|
|
51
|
+
{rows.map(({ step, isStepComplete, label }) => (
|
|
52
|
+
<Box key={label} className="gap-1.5">
|
|
53
|
+
<Text size="sm" color="secondary">
|
|
54
|
+
{label}
|
|
55
|
+
</Text>
|
|
56
|
+
<ProgressSegmented
|
|
57
|
+
step={step}
|
|
58
|
+
segments={segments}
|
|
59
|
+
isStepComplete={isStepComplete}
|
|
60
|
+
accessibilityLabel={label}
|
|
61
|
+
/>
|
|
62
|
+
</Box>
|
|
63
|
+
))}
|
|
64
|
+
</VStack>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Segment counts
|
|
70
|
+
|
|
71
|
+
Custom `segments` values (for example 3 and 6).
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
import { Box, ProgressSegmented, Text, VStack } from '@cdx-ui/components';
|
|
75
|
+
|
|
76
|
+
export default function ProgressSegmentedSegmentsDemo() {
|
|
77
|
+
return (
|
|
78
|
+
<VStack space="lg" className="w-full max-w-md">
|
|
79
|
+
<Box className="gap-1.5">
|
|
80
|
+
<Text size="sm" color="secondary">
|
|
81
|
+
3 segments
|
|
82
|
+
</Text>
|
|
83
|
+
<ProgressSegmented step={2} segments={3} accessibilityLabel="3-segment progress" />
|
|
84
|
+
</Box>
|
|
85
|
+
<Box className="gap-1.5">
|
|
86
|
+
<Text size="sm" color="secondary">
|
|
87
|
+
6 segments
|
|
88
|
+
</Text>
|
|
89
|
+
<ProgressSegmented step={4} segments={6} accessibilityLabel="6-segment progress" />
|
|
90
|
+
</Box>
|
|
91
|
+
</VStack>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## API
|
|
97
|
+
|
|
98
|
+
### ProgressSegmented
|
|
99
|
+
|
|
100
|
+
| Prop | Type | Default | Description |
|
|
101
|
+
| --- | --- | --- | --- |
|
|
102
|
+
| `className?` | `string` | — | — |
|
|
103
|
+
| `children?` | `React.ReactNode` | — | — |
|
|
104
|
+
| `step` | `number` | — | Current step (1-based index into the segment count). Clamped to `[0, segments]` (`0` leaves every segment incomplete). |
|
|
105
|
+
| `segments?` | `number` | `5` | Number of segments in the bar. Matches the Figma `segments` variant (2–6 in the design system file); the prop accepts any positive integer for backward compatibility. |
|
|
106
|
+
| `isStepComplete?` | `boolean` | `false` | When true, the current step segment is marked as complete rather than in-progress. |
|
|
107
|
+
| `getAccessibilityText?` | `((step: number, segmentCount: number, isStepComplete: boolean) => string)` | — | Returns the accessibility value text announced by screen readers. Receives the clamped step, segment count, and whether the step is complete. Replaces the English default. |
|
|
108
|
+
|
|
109
|
+
Inherits all [`ViewProps`](https://reactnative.dev/docs/view#props).
|
|
110
|
+
|
|
111
|
+
| State | Visual | Condition |
|
|
112
|
+
| ------------ | --------------------------------------------------------------- | ----------------------------------------------------------------- |
|
|
113
|
+
| `complete` | Solid fill (`bg-surface-action-strong`) | Step index \< current step, or current step when `isStepComplete` |
|
|
114
|
+
| `inprogress` | Half-filled (`surface-action-strong` → `surface-action-subtle`) | Current step when `isStepComplete` is `false` |
|
|
115
|
+
| `incomplete` | Light fill (`bg-surface-action-subtle`) | Step index > current step |
|
|
116
|
+
|
|
117
|
+
## Accessibility
|
|
118
|
+
|
|
119
|
+
Sets `accessibilityRole="progressbar"` and reports `accessibilityValue` with `min: 0`, `max` equal to the segment count, `now` equal to the clamped step, and `text`. Default value text is English (`"Step 2 of 5"`, or `"Step 2 of 5, completed"` when `isStepComplete` is true). Use `getAccessibilityText` for other locales or domain-specific labels. `accessibilityLabel` defaults to `"Progress"`.
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Quick Action Button (https://design.candescent.com/docs/components/quick-action-button)
|
|
2
|
+
|
|
3
|
+
Resources: [Figma](https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--Components?node-id=5283-1723), [Storybook](https://victorious-wave-0daadf00f.6.azurestaticapps.net/?path=/story/actions-quickactionbutton--default)
|
|
4
|
+
|
|
5
|
+
A compound button for common actions such as transfers, payments, and deposits.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { QuickActionButton } from '@cdx-ui/components';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Basic
|
|
12
|
+
|
|
13
|
+
Compose the icon and visible label inside the root button.
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { QuickActionButton } from '@cdx-ui/components';
|
|
17
|
+
import { Send } from '@cdx-ui/icons';
|
|
18
|
+
|
|
19
|
+
export default function QuickActionButtonBasicDemo() {
|
|
20
|
+
return (
|
|
21
|
+
<QuickActionButton>
|
|
22
|
+
<QuickActionButton.Icon as={Send} />
|
|
23
|
+
<QuickActionButton.Label>Transfer</QuickActionButton.Label>
|
|
24
|
+
</QuickActionButton>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Action group
|
|
30
|
+
|
|
31
|
+
Arrange related quick actions in a row or wrapping grid.
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
import { Box, QuickActionButton } from '@cdx-ui/components';
|
|
35
|
+
import { AccountBalance, MoreHoriz, Payments, Send } from '@cdx-ui/icons';
|
|
36
|
+
|
|
37
|
+
export default function QuickActionButtonActionGroupDemo() {
|
|
38
|
+
return (
|
|
39
|
+
<Box className="flex-row flex-wrap justify-center gap-4">
|
|
40
|
+
<QuickActionButton>
|
|
41
|
+
<QuickActionButton.Icon as={Send} />
|
|
42
|
+
<QuickActionButton.Label>Transfer</QuickActionButton.Label>
|
|
43
|
+
</QuickActionButton>
|
|
44
|
+
<QuickActionButton>
|
|
45
|
+
<QuickActionButton.Icon as={Payments} />
|
|
46
|
+
<QuickActionButton.Label>Pay</QuickActionButton.Label>
|
|
47
|
+
</QuickActionButton>
|
|
48
|
+
<QuickActionButton>
|
|
49
|
+
<QuickActionButton.Icon as={AccountBalance} />
|
|
50
|
+
<QuickActionButton.Label>Deposit</QuickActionButton.Label>
|
|
51
|
+
</QuickActionButton>
|
|
52
|
+
<QuickActionButton>
|
|
53
|
+
<QuickActionButton.Icon as={MoreHoriz} />
|
|
54
|
+
<QuickActionButton.Label>More</QuickActionButton.Label>
|
|
55
|
+
</QuickActionButton>
|
|
56
|
+
</Box>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Disabled
|
|
62
|
+
|
|
63
|
+
Set `isDisabled` on the root to disable interaction and apply disabled styling to the indicator and label.
|
|
64
|
+
|
|
65
|
+
```tsx
|
|
66
|
+
import { QuickActionButton } from '@cdx-ui/components';
|
|
67
|
+
import { Send } from '@cdx-ui/icons';
|
|
68
|
+
|
|
69
|
+
export default function QuickActionButtonDisabledDemo() {
|
|
70
|
+
return (
|
|
71
|
+
<QuickActionButton isDisabled>
|
|
72
|
+
<QuickActionButton.Icon as={Send} />
|
|
73
|
+
<QuickActionButton.Label>Transfer</QuickActionButton.Label>
|
|
74
|
+
</QuickActionButton>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Long labels
|
|
80
|
+
|
|
81
|
+
Labels display up to two lines and truncate overflowing text. Provide the full action name with `accessibilityLabel` when truncation is likely.
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
import { QuickActionButton } from '@cdx-ui/components';
|
|
85
|
+
import { AccountBalance } from '@cdx-ui/icons';
|
|
86
|
+
|
|
87
|
+
export default function QuickActionButtonLongLabelDemo() {
|
|
88
|
+
return (
|
|
89
|
+
<QuickActionButton accessibilityLabel="International wire transfer abroad">
|
|
90
|
+
<QuickActionButton.Icon as={AccountBalance} />
|
|
91
|
+
<QuickActionButton.Label>International wire transfer abroad</QuickActionButton.Label>
|
|
92
|
+
</QuickActionButton>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## API
|
|
98
|
+
|
|
99
|
+
### QuickActionButton
|
|
100
|
+
|
|
101
|
+
The pressable root that lays out the circular indicator and label vertically.
|
|
102
|
+
|
|
103
|
+
| Prop | Type | Default | Description |
|
|
104
|
+
| --- | --- | --- | --- |
|
|
105
|
+
| `className?` | `string` | — | — |
|
|
106
|
+
| `children?` | `ReactNode` | — | Either children or a render prop that receives a boolean reflecting whether the component is currently pressed. |
|
|
107
|
+
| `isDisabled?` | `boolean` | — | If true, the button will be disabled. |
|
|
108
|
+
|
|
109
|
+
Inherits all [`PressableProps`](https://reactnative.dev/docs/pressable#props) (including `onPress`).
|
|
110
|
+
|
|
111
|
+
## Sub-components
|
|
112
|
+
|
|
113
|
+
### QuickActionButton.Icon
|
|
114
|
+
|
|
115
|
+
The primary icon slot. It renders the Forge icon inside `QuickActionButton.Indicator`.
|
|
116
|
+
|
|
117
|
+
| Prop | Type | Default | Description |
|
|
118
|
+
| --- | --- | --- | --- |
|
|
119
|
+
| `as` | `ForgeIcon` | — | Forge icon component to render inside the circular indicator. |
|
|
120
|
+
| `className?` | `string` | — | Applied to the icon glyph, not the indicator circle. |
|
|
121
|
+
| `indicatorClassName?` | `string` | — | Applied to the indicator circle wrapper. |
|
|
122
|
+
|
|
123
|
+
### QuickActionButton.Indicator
|
|
124
|
+
|
|
125
|
+
The circular container around the icon. It is rendered automatically by `QuickActionButton.Icon` and exposed for custom compositions.
|
|
126
|
+
|
|
127
|
+
| Prop | Type | Default | Description |
|
|
128
|
+
| --- | --- | --- | --- |
|
|
129
|
+
| `className?` | `string` | — | — |
|
|
130
|
+
| `children?` | `ReactNode` | — | — |
|
|
131
|
+
|
|
132
|
+
Inherits all [`ViewProps`](https://reactnative.dev/docs/view#props).
|
|
133
|
+
|
|
134
|
+
### QuickActionButton.Label
|
|
135
|
+
|
|
136
|
+
The text beneath the indicator. Labels are centered and limited to two lines with tail truncation.
|
|
137
|
+
|
|
138
|
+
| Prop | Type | Default | Description |
|
|
139
|
+
| --- | --- | --- | --- |
|
|
140
|
+
| `className?` | `string` | — | — |
|
|
141
|
+
| `children?` | `ReactNode` | — | — |
|
|
142
|
+
|
|
143
|
+
Inherits all [`TextProps`](https://reactnative.dev/docs/text#props). `numberOfLines` and `ellipsizeMode` are fixed to `2` and `"tail"`.
|
|
144
|
+
|
|
145
|
+
## Accessibility
|
|
146
|
+
|
|
147
|
+
| Attribute | Behavior |
|
|
148
|
+
| -------------------------- | --------------------------------------------------------------- |
|
|
149
|
+
| `accessibilityRole` | Defaults to `button` on the root |
|
|
150
|
+
| Accessible name | Derived from `QuickActionButton.Label` text |
|
|
151
|
+
| Truncated or omitted label | Provide a descriptive `accessibilityLabel` on the root |
|
|
152
|
+
| Disabled | `isDisabled` prevents activation and exposes the disabled state |
|
|
153
|
+
|
|
154
|
+
The button supports Space and Enter activation on web and displays a focus-visible ring around the indicator.
|