@cdx-ui/components 0.2.2 → 0.2.4
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 +6 -2
- 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 +235 -0
- package/docs/components/bottom-sheet/content.md +351 -0
- package/docs/components/bottom-sheet/design.md +249 -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 +416 -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 +86 -0
- package/docs/components/color-field/content.md +134 -0
- package/docs/components/color-picker/content.md +208 -0
- package/docs/components/color-slider/content.md +120 -0
- package/docs/components/color-swatch/content.md +64 -0
- package/docs/components/color-swatch-picker/content.md +126 -0
- package/docs/components/content.md +97 -0
- package/docs/components/currency-input/content.md +205 -0
- package/docs/components/data-grid/content.md +522 -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 +436 -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 +281 -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 +1247 -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 +309 -0
- package/docs/components/scoped-theme/content.md +47 -0
- package/docs/components/scroll-shadow/content.md +686 -0
- package/docs/components/select/content.md +400 -0
- package/docs/components/select/design.md +301 -0
- package/docs/components/skeleton/content.md +103 -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 +292 -0
- package/docs/components/text/content.md +142 -0
- package/docs/components/textarea/content.md +222 -0
- package/docs/components/tile/content.md +703 -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 +193 -0
- package/docs/llms.txt +193 -0
- package/docs/patterns/account-management/content.md +75 -0
- package/docs/patterns/authentication/content.md +52 -0
- package/docs/patterns/content.md +10 -0
- package/docs/patterns/dashboard/content.md +39 -0
- package/docs/patterns/empty-states/content.md +31 -0
- package/docs/patterns/forms/content.md +109 -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/content.md +64 -0
- package/lib/commonjs/components/Checkbox/index.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/Heading/index.js.map +1 -1
- package/lib/commonjs/components/Icon/index.js.map +1 -1
- package/lib/commonjs/components/ListItem/index.js +170 -9
- package/lib/commonjs/components/ListItem/index.js.map +1 -1
- package/lib/commonjs/components/ListItem/styles.js +38 -2
- 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/RangeCalendar/index.js.map +1 -1
- package/lib/commonjs/components/ReorderableList/ReorderableListShared.js +91 -0
- package/lib/commonjs/components/ReorderableList/ReorderableListShared.js.map +1 -0
- package/lib/commonjs/components/ReorderableList/index.js +135 -0
- package/lib/commonjs/components/ReorderableList/index.js.map +1 -0
- package/lib/commonjs/components/ReorderableList/index.web.js +233 -0
- package/lib/commonjs/components/ReorderableList/index.web.js.map +1 -0
- package/lib/commonjs/components/ReorderableList/labels.js +47 -0
- package/lib/commonjs/components/ReorderableList/labels.js.map +1 -0
- package/lib/commonjs/components/ReorderableList/reorderItems.js +16 -0
- package/lib/commonjs/components/ReorderableList/reorderItems.js.map +1 -0
- package/lib/commonjs/components/ReorderableList/rowContext.js +42 -0
- package/lib/commonjs/components/ReorderableList/rowContext.js.map +1 -0
- package/lib/commonjs/components/ReorderableList/types.js +6 -0
- package/lib/commonjs/components/ReorderableList/types.js.map +1 -0
- package/lib/commonjs/components/ReorderableList/useReorder.js +131 -0
- package/lib/commonjs/components/ReorderableList/useReorder.js.map +1 -0
- package/lib/commonjs/components/ReorderableList/webDnd.js +64 -0
- package/lib/commonjs/components/ReorderableList/webDnd.js.map +1 -0
- package/lib/commonjs/components/ScopedTheme/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/Skeleton/index.js.map +1 -1
- package/lib/commonjs/components/TablePagination/index.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/components/Text/index.js.map +1 -1
- package/lib/commonjs/components/Tile/styles.js +1 -1
- package/lib/commonjs/components/Tile/styles.js.map +1 -1
- package/lib/commonjs/components/index.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/reorderable-list.js +17 -0
- package/lib/commonjs/reorderable-list.js.map +1 -0
- package/lib/module/components/Checkbox/index.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/Heading/index.js.map +1 -1
- package/lib/module/components/Icon/index.js.map +1 -1
- package/lib/module/components/ListItem/index.js +163 -14
- package/lib/module/components/ListItem/index.js.map +1 -1
- package/lib/module/components/ListItem/styles.js +37 -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/RangeCalendar/index.js.map +1 -1
- package/lib/module/components/ReorderableList/ReorderableListShared.js +86 -0
- package/lib/module/components/ReorderableList/ReorderableListShared.js.map +1 -0
- package/lib/module/components/ReorderableList/index.js +130 -0
- package/lib/module/components/ReorderableList/index.js.map +1 -0
- package/lib/module/components/ReorderableList/index.web.js +229 -0
- package/lib/module/components/ReorderableList/index.web.js.map +1 -0
- package/lib/module/components/ReorderableList/labels.js +41 -0
- package/lib/module/components/ReorderableList/labels.js.map +1 -0
- package/lib/module/components/ReorderableList/reorderItems.js +12 -0
- package/lib/module/components/ReorderableList/reorderItems.js.map +1 -0
- package/lib/module/components/ReorderableList/rowContext.js +38 -0
- package/lib/module/components/ReorderableList/rowContext.js.map +1 -0
- package/lib/module/components/ReorderableList/types.js +4 -0
- package/lib/module/components/ReorderableList/types.js.map +1 -0
- package/lib/module/components/ReorderableList/useReorder.js +123 -0
- package/lib/module/components/ReorderableList/useReorder.js.map +1 -0
- package/lib/module/components/ReorderableList/webDnd.js +59 -0
- package/lib/module/components/ReorderableList/webDnd.js.map +1 -0
- package/lib/module/components/ScopedTheme/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/Skeleton/index.js.map +1 -1
- package/lib/module/components/TablePagination/index.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/components/Text/index.js.map +1 -1
- package/lib/module/components/Tile/styles.js +1 -1
- package/lib/module/components/Tile/styles.js.map +1 -1
- package/lib/module/components/index.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/reorderable-list.js +4 -0
- package/lib/module/reorderable-list.js.map +1 -0
- package/lib/typescript/components/Checkbox/index.d.ts +22 -0
- package/lib/typescript/components/Checkbox/index.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/Heading/index.d.ts +20 -2
- package/lib/typescript/components/Heading/index.d.ts.map +1 -1
- package/lib/typescript/components/Icon/index.d.ts +2 -0
- package/lib/typescript/components/Icon/index.d.ts.map +1 -1
- package/lib/typescript/components/ListItem/index.d.ts +28 -5
- package/lib/typescript/components/ListItem/index.d.ts.map +1 -1
- package/lib/typescript/components/ListItem/styles.d.ts +6 -1
- package/lib/typescript/components/ListItem/styles.d.ts.map +1 -1
- package/lib/typescript/components/Menu/index.d.ts +116 -4
- package/lib/typescript/components/Menu/index.d.ts.map +1 -1
- package/lib/typescript/components/RangeCalendar/index.d.ts +2 -0
- package/lib/typescript/components/RangeCalendar/index.d.ts.map +1 -1
- package/lib/typescript/components/ReorderableList/ReorderableListShared.d.ts +31 -0
- package/lib/typescript/components/ReorderableList/ReorderableListShared.d.ts.map +1 -0
- package/lib/typescript/components/ReorderableList/index.d.ts +8 -0
- package/lib/typescript/components/ReorderableList/index.d.ts.map +1 -0
- package/lib/typescript/components/ReorderableList/index.web.d.ts +8 -0
- package/lib/typescript/components/ReorderableList/index.web.d.ts.map +1 -0
- package/lib/typescript/components/ReorderableList/labels.d.ts +16 -0
- package/lib/typescript/components/ReorderableList/labels.d.ts.map +1 -0
- package/lib/typescript/components/ReorderableList/reorderItems.d.ts +3 -0
- package/lib/typescript/components/ReorderableList/reorderItems.d.ts.map +1 -0
- package/lib/typescript/components/ReorderableList/rowContext.d.ts +57 -0
- package/lib/typescript/components/ReorderableList/rowContext.d.ts.map +1 -0
- package/lib/typescript/components/ReorderableList/types.d.ts +75 -0
- package/lib/typescript/components/ReorderableList/types.d.ts.map +1 -0
- package/lib/typescript/components/ReorderableList/useReorder.d.ts +31 -0
- package/lib/typescript/components/ReorderableList/useReorder.d.ts.map +1 -0
- package/lib/typescript/components/ReorderableList/webDnd.d.ts +27 -0
- package/lib/typescript/components/ReorderableList/webDnd.d.ts.map +1 -0
- package/lib/typescript/components/ScopedTheme/index.d.ts +6 -1
- package/lib/typescript/components/ScopedTheme/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/Skeleton/index.d.ts +3 -0
- package/lib/typescript/components/Skeleton/index.d.ts.map +1 -1
- package/lib/typescript/components/TablePagination/index.d.ts +54 -0
- package/lib/typescript/components/TablePagination/index.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/Text/index.d.ts +12 -2
- package/lib/typescript/components/Text/index.d.ts.map +1 -1
- package/lib/typescript/components/Tile/styles.d.ts.map +1 -1
- package/lib/typescript/components/ToggleButton/styles.d.ts +1 -1
- package/lib/typescript/components/index.d.ts +1 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/figma/ListItem.SectionHeader.figma.d.ts.map +1 -1
- package/lib/typescript/reorderable-list.d.ts +2 -0
- package/lib/typescript/reorderable-list.d.ts.map +1 -0
- package/package.json +37 -8
- package/src/components/Checkbox/index.tsx +22 -0
- package/src/components/DateTimeList/index.tsx +13 -26
- package/src/components/DateTimeList/styles.ts +1 -10
- package/src/components/Heading/index.tsx +10 -1
- package/src/components/Icon/index.tsx +2 -0
- package/src/components/ListItem/index.tsx +232 -15
- package/src/components/ListItem/styles.ts +41 -0
- package/src/components/Menu/index.tsx +128 -12
- package/src/components/RangeCalendar/index.tsx +2 -0
- package/src/components/ReorderableList/ReorderableListShared.tsx +113 -0
- package/src/components/ReorderableList/index.tsx +162 -0
- package/src/components/ReorderableList/index.web.tsx +254 -0
- package/src/components/ReorderableList/labels.ts +52 -0
- package/src/components/ReorderableList/reorderItems.ts +16 -0
- package/src/components/ReorderableList/rowContext.tsx +72 -0
- package/src/components/ReorderableList/types.ts +80 -0
- package/src/components/ReorderableList/useReorder.ts +159 -0
- package/src/components/ReorderableList/webDnd.ts +60 -0
- package/src/components/ScopedTheme/index.tsx +6 -1
- 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/Skeleton/index.tsx +3 -0
- package/src/components/TablePagination/index.tsx +54 -0
- package/src/components/Tabs/index.tsx +25 -35
- package/src/components/Tabs/styles.ts +0 -9
- package/src/components/Text/index.tsx +6 -1
- package/src/components/Tile/styles.ts +4 -1
- package/src/components/index.ts +5 -0
- package/src/reorderable-list.ts +1 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# Table Pagination (https://design.candescent.com/docs/components/table-pagination)
|
|
2
|
+
|
|
3
|
+
Resources: [Storybook](https://victorious-wave-0daadf00f.6.azurestaticapps.net/?path=/story/navigation-tablepagination--default)
|
|
4
|
+
|
|
5
|
+
`TablePagination` is chrome for moving between pages of a list or table. The parent owns `page` and `count` (1-based). Distinct from `Carousel.Pagination` dots. The `Pagination` name is reserved for a later numbered pager.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { TablePagination } from '@cdx-ui/components';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Basic
|
|
12
|
+
|
|
13
|
+
Pass `page`, `count`, and `onPageChange` to render a compact item window with previous/next controls and a “Page X of Y” label.
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { TablePagination } from '@cdx-ui/components';
|
|
17
|
+
|
|
18
|
+
export default function TablePaginationBasicDemo() {
|
|
19
|
+
return <TablePagination page={1} count={12} accessibilityLabel="Table pagination" />;
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Compound
|
|
24
|
+
|
|
25
|
+
Compose items yourself when you need a custom window. Current page uses `current`.
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
import { TablePagination } from '@cdx-ui/components';
|
|
29
|
+
|
|
30
|
+
export default function TablePaginationCompoundDemo() {
|
|
31
|
+
return (
|
|
32
|
+
<TablePagination accessibilityLabel="Table pagination">
|
|
33
|
+
<TablePagination.Previous />
|
|
34
|
+
<TablePagination.Item current>1</TablePagination.Item>
|
|
35
|
+
<TablePagination.Item>2</TablePagination.Item>
|
|
36
|
+
<TablePagination.Ellipsis />
|
|
37
|
+
<TablePagination.Item>12</TablePagination.Item>
|
|
38
|
+
<TablePagination.Next />
|
|
39
|
+
</TablePagination>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Page size
|
|
45
|
+
|
|
46
|
+
Set `pageSize` and `pageSizeOptions` to show a rows-per-page `Select`.
|
|
47
|
+
|
|
48
|
+
```tsx
|
|
49
|
+
import { TablePagination } from '@cdx-ui/components';
|
|
50
|
+
|
|
51
|
+
export default function TablePaginationPageSizeDemo() {
|
|
52
|
+
return (
|
|
53
|
+
<TablePagination
|
|
54
|
+
page={1}
|
|
55
|
+
count={8}
|
|
56
|
+
pageSize={25}
|
|
57
|
+
pageSizeOptions={[10, 25, 50]}
|
|
58
|
+
accessibilityLabel="Table pagination"
|
|
59
|
+
/>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## API
|
|
65
|
+
|
|
66
|
+
### TablePagination
|
|
67
|
+
|
|
68
|
+
Landmark root. On web, renders `<nav>`. On native, renders a labelled `View`.
|
|
69
|
+
|
|
70
|
+
| Prop | Type | Default | Description |
|
|
71
|
+
| --- | --- | --- | --- |
|
|
72
|
+
| `className?` | `string` | — | Additional Uniwind/Tailwind classes, merged after the container's own styles. |
|
|
73
|
+
| `children?` | `ReactNode` | — | Custom layout of pagination parts. Omit to render the status, controls and generated page items. |
|
|
74
|
+
| `asChild?` | `boolean` | — | Render the consumer's child element in place of the default container. |
|
|
75
|
+
| `page?` | `number` | — | 1-based current page. Controlled when set. |
|
|
76
|
+
| `defaultPage?` | `number` | `1` | Initial 1-based page when uncontrolled. |
|
|
77
|
+
| `count?` | `number` | — | Total page count. When set with no children, items are generated. |
|
|
78
|
+
| `onPageChange?` | `((page: number) => void)` | — | Called with the new 1-based page when the user changes page. |
|
|
79
|
+
| `siblingCount?` | `number` | `1` | Number of page items shown on each side of the current page before an ellipsis. |
|
|
80
|
+
| `pageSize?` | `number` | — | Current rows-per-page value. When set with no children, the page-size select is rendered. |
|
|
81
|
+
| `pageSizeOptions?` | `readonly TablePaginationPageSizeOption[]` | `[25, 50, 100]` | Choices offered by `TablePagination.PageSize`, as numbers or `{ value, label }` pairs. |
|
|
82
|
+
| `onPageSizeChange?` | `((pageSize: number) => void)` | — | Called with the new rows-per-page value when the user picks one. |
|
|
83
|
+
| `disabled?` | `boolean` | `false` | Disables every control in the pagination. |
|
|
84
|
+
|
|
85
|
+
Inherits all [`ViewProps`](https://reactnative.dev/docs/view#props).
|
|
86
|
+
|
|
87
|
+
| Attribute | Values | Description |
|
|
88
|
+
| ----------- | ------------------ | ----------- |
|
|
89
|
+
| `data-slot` | `table-pagination` | Root |
|
|
90
|
+
|
|
91
|
+
## Sub-components
|
|
92
|
+
|
|
93
|
+
### TablePagination.Previous
|
|
94
|
+
|
|
95
|
+
| Prop | Type | Default | Description |
|
|
96
|
+
| --- | --- | --- | --- |
|
|
97
|
+
| `className?` | `string` | — | Additional Uniwind/Tailwind classes, merged after the control's own styles. |
|
|
98
|
+
| `children?` | `ReactNode` | — | The element to render when `asChild` is set. |
|
|
99
|
+
| `asChild?` | `boolean` | — | Render the consumer's child element in place of the default icon button. |
|
|
100
|
+
| `disabled?` | `boolean` | — | Disables the control. It is also disabled at the first or last page, or when the pagination is disabled. |
|
|
101
|
+
| `onPress?` | `((event: GestureResponderEvent) => void) \| null` | — | Called on press, before the pagination moves to the adjacent page. |
|
|
102
|
+
|
|
103
|
+
| Attribute | Values | Description |
|
|
104
|
+
| ----------- | --------------------------- | ----------- |
|
|
105
|
+
| `data-slot` | `table-pagination-previous` | Previous |
|
|
106
|
+
|
|
107
|
+
### TablePagination.Next
|
|
108
|
+
|
|
109
|
+
| Prop | Type | Default | Description |
|
|
110
|
+
| --- | --- | --- | --- |
|
|
111
|
+
| `className?` | `string` | — | Additional Uniwind/Tailwind classes, merged after the control's own styles. |
|
|
112
|
+
| `children?` | `ReactNode` | — | The element to render when `asChild` is set. |
|
|
113
|
+
| `asChild?` | `boolean` | — | Render the consumer's child element in place of the default icon button. |
|
|
114
|
+
| `disabled?` | `boolean` | — | Disables the control. It is also disabled at the first or last page, or when the pagination is disabled. |
|
|
115
|
+
| `onPress?` | `((event: GestureResponderEvent) => void) \| null` | — | Called on press, before the pagination moves to the adjacent page. |
|
|
116
|
+
|
|
117
|
+
| Attribute | Values | Description |
|
|
118
|
+
| ----------- | ----------------------- | ----------- |
|
|
119
|
+
| `data-slot` | `table-pagination-next` | Next |
|
|
120
|
+
|
|
121
|
+
### TablePagination.Item
|
|
122
|
+
|
|
123
|
+
| Prop | Type | Default | Description |
|
|
124
|
+
| --- | --- | --- | --- |
|
|
125
|
+
| `className?` | `string` | — | Additional Uniwind/Tailwind classes, merged after the item's own styles. |
|
|
126
|
+
| `children?` | `ReactNode` | — | The page number or label to display. |
|
|
127
|
+
| `asChild?` | `boolean` | — | Render the consumer's child element in place of the default page button. |
|
|
128
|
+
| `page?` | `number` | — | 1-based page this item navigates to when pressed. |
|
|
129
|
+
| `current?` | `boolean` | `false` | Marks the item as the current page. Set automatically when `page` matches the current page. |
|
|
130
|
+
| `disabled?` | `boolean` | — | Disables the item. Defaults to the pagination's `disabled`. |
|
|
131
|
+
| `onPress?` | `((event: GestureResponderEvent) => void) \| null` | — | Called on press, before the pagination navigates to `page`. |
|
|
132
|
+
|
|
133
|
+
| Attribute | Values | Description |
|
|
134
|
+
| ----------- | ----------------------- | ----------- |
|
|
135
|
+
| `data-slot` | `table-pagination-item` | Page number |
|
|
136
|
+
|
|
137
|
+
### TablePagination.Ellipsis
|
|
138
|
+
|
|
139
|
+
| Prop | Type | Default | Description |
|
|
140
|
+
| --- | --- | --- | --- |
|
|
141
|
+
| `className?` | `string` | — | Additional Uniwind/Tailwind classes, merged after the ellipsis's own styles. |
|
|
142
|
+
| `children?` | `ReactNode` | — | Custom content in place of the default `…`. |
|
|
143
|
+
| `asChild?` | `boolean` | — | Render the consumer's child element in place of the default `View` host. |
|
|
144
|
+
|
|
145
|
+
| Attribute | Values | Description |
|
|
146
|
+
| ----------- | --------------------------- | ----------- |
|
|
147
|
+
| `data-slot` | `table-pagination-ellipsis` | Gap |
|
|
148
|
+
|
|
149
|
+
### TablePagination.Status
|
|
150
|
+
|
|
151
|
+
Connected mode renders “Page X of Y” automatically. Compose this slot when building a custom window.
|
|
152
|
+
|
|
153
|
+
| Prop | Type | Default | Description |
|
|
154
|
+
| --- | --- | --- | --- |
|
|
155
|
+
| `className?` | `string` | — | Additional Uniwind/Tailwind classes, merged after the status's own styles. |
|
|
156
|
+
| `children?` | `ReactNode` | — | Custom status content in place of the default "Page N of M" text. |
|
|
157
|
+
| `asChild?` | `boolean` | — | Render the consumer's child element in place of the default `View` host. |
|
|
158
|
+
|
|
159
|
+
| Attribute | Values | Description |
|
|
160
|
+
| ----------- | ------------------------- | ----------- |
|
|
161
|
+
| `data-slot` | `table-pagination-status` | Page X of Y |
|
|
162
|
+
|
|
163
|
+
### TablePagination.PageSize
|
|
164
|
+
|
|
165
|
+
| Prop | Type | Default | Description |
|
|
166
|
+
| --- | --- | --- | --- |
|
|
167
|
+
| `className?` | `string` | — | Additional Uniwind/Tailwind classes, merged after the select's own styles. |
|
|
168
|
+
| `children?` | `ReactNode` | — | The element to render when `asChild` is set. |
|
|
169
|
+
| `asChild?` | `boolean` | — | Render the consumer's child element in place of the default select. |
|
|
170
|
+
|
|
171
|
+
| Attribute | Values | Description |
|
|
172
|
+
| ----------- | ---------------------------- | ----------- |
|
|
173
|
+
| `data-slot` | `table-pagination-page-size` | Rows/page |
|
|
174
|
+
|
|
175
|
+
## Accessibility
|
|
176
|
+
|
|
177
|
+
The web root is a `nav` landmark. The current page uses `aria-current="page"`. Previous and next are disabled at the ends.
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
# Tabs (https://design.candescent.com/docs/components/tabs)
|
|
2
|
+
|
|
3
|
+
Resources: [Figma](https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--Components?node-id=10266-3192), [Storybook](https://victorious-wave-0daadf00f.6.azurestaticapps.net/?path=/story/navigation-tabs--default)
|
|
4
|
+
|
|
5
|
+
A compound component for switching between related content panels. Match each `Tabs.Tab` with a `Tabs.Panel` using the same `value`.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { Tabs } from '@cdx-ui/components';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Basic
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { Tabs, Text } from '@cdx-ui/components';
|
|
15
|
+
|
|
16
|
+
export default function TabsBasicDemo() {
|
|
17
|
+
return (
|
|
18
|
+
<Tabs defaultValue="overview" className="w-[360px]">
|
|
19
|
+
<Tabs.List accessibilityLabel="Account sections">
|
|
20
|
+
<Tabs.Tab value="overview">
|
|
21
|
+
<Tabs.TabLabel>Overview</Tabs.TabLabel>
|
|
22
|
+
</Tabs.Tab>
|
|
23
|
+
<Tabs.Tab value="activity">
|
|
24
|
+
<Tabs.TabLabel>Activity</Tabs.TabLabel>
|
|
25
|
+
</Tabs.Tab>
|
|
26
|
+
<Tabs.Tab value="settings">
|
|
27
|
+
<Tabs.TabLabel>Settings</Tabs.TabLabel>
|
|
28
|
+
</Tabs.Tab>
|
|
29
|
+
</Tabs.List>
|
|
30
|
+
<Tabs.Panel value="overview" className="mt-4">
|
|
31
|
+
<Text>Review balances and recent account details.</Text>
|
|
32
|
+
</Tabs.Panel>
|
|
33
|
+
<Tabs.Panel value="activity" className="mt-4">
|
|
34
|
+
<Text>View recent account activity.</Text>
|
|
35
|
+
</Tabs.Panel>
|
|
36
|
+
<Tabs.Panel value="settings" className="mt-4">
|
|
37
|
+
<Text>Manage account preferences.</Text>
|
|
38
|
+
</Tabs.Panel>
|
|
39
|
+
</Tabs>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Variants
|
|
45
|
+
|
|
46
|
+
Use the `solid` variant for a filled segmented control or `outline` for a line indicator.
|
|
47
|
+
|
|
48
|
+
```tsx
|
|
49
|
+
import { Box, Tabs, Text } from '@cdx-ui/components';
|
|
50
|
+
|
|
51
|
+
export default function TabsVariantsDemo() {
|
|
52
|
+
return (
|
|
53
|
+
<Box className="w-[360px] gap-8">
|
|
54
|
+
<Tabs defaultValue="checking">
|
|
55
|
+
<Tabs.List accessibilityLabel="Solid account tabs">
|
|
56
|
+
<Tabs.Tab value="checking">
|
|
57
|
+
<Tabs.TabLabel>Checking</Tabs.TabLabel>
|
|
58
|
+
</Tabs.Tab>
|
|
59
|
+
<Tabs.Tab value="savings">
|
|
60
|
+
<Tabs.TabLabel>Savings</Tabs.TabLabel>
|
|
61
|
+
</Tabs.Tab>
|
|
62
|
+
</Tabs.List>
|
|
63
|
+
<Tabs.Panel value="checking" className="pt-3">
|
|
64
|
+
<Text>Solid (default)</Text>
|
|
65
|
+
</Tabs.Panel>
|
|
66
|
+
<Tabs.Panel value="savings" className="pt-3">
|
|
67
|
+
<Text>Savings account</Text>
|
|
68
|
+
</Tabs.Panel>
|
|
69
|
+
</Tabs>
|
|
70
|
+
|
|
71
|
+
<Tabs defaultValue="checking" variant="outline">
|
|
72
|
+
<Tabs.List accessibilityLabel="Outline account tabs">
|
|
73
|
+
<Tabs.Tab value="checking">
|
|
74
|
+
<Tabs.TabLabel>Checking</Tabs.TabLabel>
|
|
75
|
+
</Tabs.Tab>
|
|
76
|
+
<Tabs.Tab value="savings">
|
|
77
|
+
<Tabs.TabLabel>Savings</Tabs.TabLabel>
|
|
78
|
+
</Tabs.Tab>
|
|
79
|
+
</Tabs.List>
|
|
80
|
+
<Tabs.Panel value="checking" className="pt-3">
|
|
81
|
+
<Text>Outline</Text>
|
|
82
|
+
</Tabs.Panel>
|
|
83
|
+
<Tabs.Panel value="savings" className="pt-3">
|
|
84
|
+
<Text>Savings account</Text>
|
|
85
|
+
</Tabs.Panel>
|
|
86
|
+
</Tabs>
|
|
87
|
+
</Box>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Vertical
|
|
93
|
+
|
|
94
|
+
Set `orientation="vertical"` to place the tab list beside its panels. Orientation also determines which arrow keys move focus on web.
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
import { Box, Tabs, Text, type TabsVariant } from '@cdx-ui/components';
|
|
98
|
+
|
|
99
|
+
function VerticalTabs({ variant }: { variant: TabsVariant }) {
|
|
100
|
+
return (
|
|
101
|
+
<Box className="gap-2">
|
|
102
|
+
<Text weight="semibold" className="capitalize">
|
|
103
|
+
{variant}
|
|
104
|
+
</Text>
|
|
105
|
+
<Tabs defaultValue="profile" orientation="vertical" variant={variant} className="w-105">
|
|
106
|
+
<Tabs.List accessibilityLabel={`${variant} settings sections`}>
|
|
107
|
+
<Tabs.Tab value="profile">
|
|
108
|
+
<Tabs.TabLabel>Profile</Tabs.TabLabel>
|
|
109
|
+
</Tabs.Tab>
|
|
110
|
+
<Tabs.Tab value="security">
|
|
111
|
+
<Tabs.TabLabel>Security</Tabs.TabLabel>
|
|
112
|
+
</Tabs.Tab>
|
|
113
|
+
<Tabs.Tab value="notifications">
|
|
114
|
+
<Tabs.TabLabel>Notifications</Tabs.TabLabel>
|
|
115
|
+
</Tabs.Tab>
|
|
116
|
+
</Tabs.List>
|
|
117
|
+
<Tabs.Panel value="profile">
|
|
118
|
+
<Text>Update your personal information.</Text>
|
|
119
|
+
</Tabs.Panel>
|
|
120
|
+
<Tabs.Panel value="security">
|
|
121
|
+
<Text>Manage passwords and sign-in methods.</Text>
|
|
122
|
+
</Tabs.Panel>
|
|
123
|
+
<Tabs.Panel value="notifications">
|
|
124
|
+
<Text>Choose which alerts you receive.</Text>
|
|
125
|
+
</Tabs.Panel>
|
|
126
|
+
</Tabs>
|
|
127
|
+
</Box>
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export default function TabsVerticalDemo() {
|
|
132
|
+
return (
|
|
133
|
+
<Box className="gap-8">
|
|
134
|
+
<VerticalTabs variant="solid" />
|
|
135
|
+
<VerticalTabs variant="outline" />
|
|
136
|
+
</Box>
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Overflow
|
|
142
|
+
|
|
143
|
+
Horizontal lists scroll by default when their tabs exceed the available width. Edge fades appear on iOS, Android, and web. Paging controls are web-only. On iOS and Android, selecting a tab scrolls it into view. Vertical lists do not scroll.
|
|
144
|
+
|
|
145
|
+
```tsx
|
|
146
|
+
import { Tabs, Text } from '@cdx-ui/components';
|
|
147
|
+
|
|
148
|
+
const sections = ['Overview', 'Activity', 'Statements', 'Settings', 'Security', 'Documents'];
|
|
149
|
+
|
|
150
|
+
export default function TabsOverflowDemo() {
|
|
151
|
+
return (
|
|
152
|
+
<Tabs defaultValue="overview" className="w-[360px]">
|
|
153
|
+
<Tabs.List accessibilityLabel="Account sections">
|
|
154
|
+
{sections.map((section) => {
|
|
155
|
+
const value = section.toLowerCase();
|
|
156
|
+
|
|
157
|
+
return (
|
|
158
|
+
<Tabs.Tab key={value} value={value}>
|
|
159
|
+
<Tabs.TabLabel>{section}</Tabs.TabLabel>
|
|
160
|
+
</Tabs.Tab>
|
|
161
|
+
);
|
|
162
|
+
})}
|
|
163
|
+
</Tabs.List>
|
|
164
|
+
{sections.map((section) => {
|
|
165
|
+
const value = section.toLowerCase();
|
|
166
|
+
|
|
167
|
+
return (
|
|
168
|
+
<Tabs.Panel key={value} value={value} className="mt-4">
|
|
169
|
+
<Text>{section} content</Text>
|
|
170
|
+
</Tabs.Panel>
|
|
171
|
+
);
|
|
172
|
+
})}
|
|
173
|
+
</Tabs>
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Disabled
|
|
179
|
+
|
|
180
|
+
Disable an individual `Tabs.Tab`, or set `disabled` on `Tabs` to disable every tab.
|
|
181
|
+
|
|
182
|
+
```tsx
|
|
183
|
+
import { Tabs, Text } from '@cdx-ui/components';
|
|
184
|
+
|
|
185
|
+
export default function TabsDisabledDemo() {
|
|
186
|
+
return (
|
|
187
|
+
<Tabs defaultValue="open" className="w-[360px]">
|
|
188
|
+
<Tabs.List accessibilityLabel="Request status">
|
|
189
|
+
<Tabs.Tab value="open">
|
|
190
|
+
<Tabs.TabLabel>Open</Tabs.TabLabel>
|
|
191
|
+
</Tabs.Tab>
|
|
192
|
+
<Tabs.Tab value="pending" disabled>
|
|
193
|
+
<Tabs.TabLabel>Pending</Tabs.TabLabel>
|
|
194
|
+
</Tabs.Tab>
|
|
195
|
+
<Tabs.Tab value="closed">
|
|
196
|
+
<Tabs.TabLabel>Closed</Tabs.TabLabel>
|
|
197
|
+
</Tabs.Tab>
|
|
198
|
+
</Tabs.List>
|
|
199
|
+
<Tabs.Panel value="open" className="mt-4">
|
|
200
|
+
<Text>Requests awaiting review.</Text>
|
|
201
|
+
</Tabs.Panel>
|
|
202
|
+
<Tabs.Panel value="pending" className="mt-4">
|
|
203
|
+
<Text>Requests in progress.</Text>
|
|
204
|
+
</Tabs.Panel>
|
|
205
|
+
<Tabs.Panel value="closed" className="mt-4">
|
|
206
|
+
<Text>Resolved requests.</Text>
|
|
207
|
+
</Tabs.Panel>
|
|
208
|
+
</Tabs>
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## API
|
|
214
|
+
|
|
215
|
+
### Tabs
|
|
216
|
+
|
|
217
|
+
Manages the selected value and shares orientation, activation, and disabled state with its sub-components. Supports controlled selection with `value` and `onValueChange`, or uncontrolled selection with `defaultValue`.
|
|
218
|
+
|
|
219
|
+
| Prop | Type | Default | Description |
|
|
220
|
+
| --- | --- | --- | --- |
|
|
221
|
+
| `className?` | `string` | — | — |
|
|
222
|
+
| `children?` | `ReactNode` | — | — |
|
|
223
|
+
| `variant?` | `'outline' \| 'solid'` | — | `solid` (default) slides a filled indicator behind the active tab; `outline` draws a sliding line indicator. Styled per Forge DS SegmentedControl (solid). |
|
|
224
|
+
| `value?` | `string` | — | Controlled selected tab value. |
|
|
225
|
+
| `defaultValue?` | `string` | — | Default selected tab value for uncontrolled usage. |
|
|
226
|
+
| `onValueChange?` | `((value: string) => void)` | — | — |
|
|
227
|
+
| `activationMode?` | `'automatic' \| 'manual'` | — | `automatic` (default) selects a tab as soon as it receives focus via arrow keys. `manual` only moves focus — press Enter or Space to select. Web only; native selection follows press. Use `manual` when rendering the next panel is expensive. |
|
|
228
|
+
| `orientation?` | `'horizontal' \| 'vertical'` | — | Layout axis and roving-focus key set. `horizontal` (default) uses ArrowLeft/ArrowRight; `vertical` uses ArrowUp/ArrowDown, per the ARIA APG tabs pattern. |
|
|
229
|
+
| `disabled?` | `boolean` | — | Disables every tab. Disable a single tab with `disabled` on that `Tabs.Tab`. |
|
|
230
|
+
|
|
231
|
+
Inherits all [`ViewProps`](https://reactnative.dev/docs/view#props).
|
|
232
|
+
|
|
233
|
+
## Sub-components
|
|
234
|
+
|
|
235
|
+
### Tabs.List
|
|
236
|
+
|
|
237
|
+
The `tablist` container. It renders the animated selection indicator automatically. Provide an `accessibilityLabel` or `aria-label` because the list has no visible label of its own.
|
|
238
|
+
|
|
239
|
+
| Prop | Type | Default | Description |
|
|
240
|
+
| --- | --- | --- | --- |
|
|
241
|
+
| `className?` | `string` | — | — |
|
|
242
|
+
| `children?` | `ReactNode` | — | — |
|
|
243
|
+
| `asChild?` | `boolean` | — | — |
|
|
244
|
+
| `scrollable?` | `boolean` | `true` | When `orientation="horizontal"`, scroll tab triggers if they overflow the list width. On native, selecting a tab scrolls it into view. On web, edge fades and paging controls appear when more tabs are off-screen. Vertical lists do not scroll. |
|
|
245
|
+
| `showsHorizontalScrollIndicator?` | `boolean` | — | — |
|
|
246
|
+
|
|
247
|
+
Inherits all [`ViewProps`](https://reactnative.dev/docs/view#props).
|
|
248
|
+
|
|
249
|
+
### Tabs.Tab
|
|
250
|
+
|
|
251
|
+
An individual `tab` trigger. Its required `value` correlates it with the matching panel.
|
|
252
|
+
|
|
253
|
+
| Prop | Type | Default | Description |
|
|
254
|
+
| --- | --- | --- | --- |
|
|
255
|
+
| `className?` | `string` | — | — |
|
|
256
|
+
| `children?` | `ReactNode` | — | — |
|
|
257
|
+
| `value` | `string` | — | Required — correlates this tab with its `Tabs.Panel` counterpart. |
|
|
258
|
+
| `asChild?` | `boolean` | — | — |
|
|
259
|
+
|
|
260
|
+
Inherits all [`PressableProps`](https://reactnative.dev/docs/pressable#props).
|
|
261
|
+
|
|
262
|
+
### Tabs.TabLabel
|
|
263
|
+
|
|
264
|
+
The text label inside a tab. It automatically applies active and inactive typography from the parent tab state.
|
|
265
|
+
|
|
266
|
+
| Prop | Type | Default | Description |
|
|
267
|
+
| --- | --- | --- | --- |
|
|
268
|
+
| `className?` | `string` | — | — |
|
|
269
|
+
| `children?` | `ReactNode` | — | — |
|
|
270
|
+
| `asChild?` | `boolean` | — | — |
|
|
271
|
+
|
|
272
|
+
Inherits all [`TextProps`](https://reactnative.dev/docs/text#props).
|
|
273
|
+
|
|
274
|
+
### Tabs.Panel
|
|
275
|
+
|
|
276
|
+
The `tabpanel` content region correlated with a tab by `value`. Inactive panels remain mounted and hidden by default; set `unmountWhenInactive` when inactive content should be destroyed.
|
|
277
|
+
|
|
278
|
+
| Prop | Type | Default | Description |
|
|
279
|
+
| --- | --- | --- | --- |
|
|
280
|
+
| `className?` | `string` | — | — |
|
|
281
|
+
| `children?` | `ReactNode` | — | — |
|
|
282
|
+
| `asChild?` | `boolean` | — | — |
|
|
283
|
+
| `value` | `string` | — | Required — correlates this panel with its `Tabs.Tab` counterpart. |
|
|
284
|
+
| `unmountWhenInactive?` | `boolean` | — | Unmount when inactive instead of keeping the panel mounted and hidden. The default keeps it mounted so the tab's `aria-controls` target stays in the tree. |
|
|
285
|
+
|
|
286
|
+
Inherits all [`ViewProps`](https://reactnative.dev/docs/view#props).
|
|
287
|
+
|
|
288
|
+
## Accessibility
|
|
289
|
+
|
|
290
|
+
`Tabs.List`, `Tabs.Tab`, and `Tabs.Panel` provide `tablist`, `tab`, and `tabpanel` semantics and connect tabs to panels with `aria-controls` and `aria-labelledby`.
|
|
291
|
+
|
|
292
|
+
On web, only the selected tab — or the tab that currently has keyboard focus — is in the tab order. `ArrowLeft` and `ArrowRight` move through horizontal tabs; `ArrowUp` and `ArrowDown` move through vertical tabs. Navigation wraps and skips disabled tabs. `Home` and `End` move to the first and last enabled tabs. With `activationMode="automatic"` (default), moving focus selects a tab. With `activationMode="manual"`, press `Enter` or `Space` to select the focused tab. On iOS and Android, focus follows the platform's sequential order. When `value` is controlled, changing it clears keyboard focus on a different tab so arrow keys follow the committed selection.
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Text (https://design.candescent.com/docs/components/text)
|
|
2
|
+
|
|
3
|
+
Resources: [Figma](https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--React-Native-Components?node-id=400-3), [Storybook](https://victorious-wave-0daadf00f.6.azurestaticapps.net/?path=/story/content-text--default)
|
|
4
|
+
|
|
5
|
+
`Text` wraps React Native's text element with Forge UI typography and content color tokens.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { Text } from '@cdx-ui/components';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Basic
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { Text } from '@cdx-ui/components';
|
|
15
|
+
|
|
16
|
+
export default function TextBasicDemo() {
|
|
17
|
+
return <Text>The quick brown fox jumps over the lazy dog.</Text>;
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Sizes
|
|
22
|
+
|
|
23
|
+
Use `size` to select one of the five body typography styles.
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import { Box, Text, type TextProps } from '@cdx-ui/components';
|
|
27
|
+
|
|
28
|
+
const SIZES = ['xs', 'sm', 'md', 'lg', 'xl'] as const satisfies readonly NonNullable<
|
|
29
|
+
TextProps['size']
|
|
30
|
+
>[];
|
|
31
|
+
|
|
32
|
+
export default function TextSizesDemo() {
|
|
33
|
+
return (
|
|
34
|
+
<Box className="gap-3">
|
|
35
|
+
{SIZES.map((size) => (
|
|
36
|
+
<Text key={size} size={size}>
|
|
37
|
+
{size} — The quick brown fox jumps over the lazy dog.
|
|
38
|
+
</Text>
|
|
39
|
+
))}
|
|
40
|
+
</Box>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Colors
|
|
46
|
+
|
|
47
|
+
Use `color` to select a semantic content color. It maps to the matching theme-aware `text-content-*` token, so prefer it over a color class. A `Text` nested inside another text element — another `Text`, a `Heading`, or a text slot such as `Button.Label` — inherits the parent's `color`, `size` and `weight` unless it sets its own.
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
import { Box, Text, type TextProps } from '@cdx-ui/components';
|
|
51
|
+
|
|
52
|
+
const COLORS = [
|
|
53
|
+
'primary',
|
|
54
|
+
'secondary',
|
|
55
|
+
'tertiary',
|
|
56
|
+
'action',
|
|
57
|
+
'danger',
|
|
58
|
+
'warning',
|
|
59
|
+
'success',
|
|
60
|
+
'info',
|
|
61
|
+
] as const satisfies readonly NonNullable<TextProps['color']>[];
|
|
62
|
+
|
|
63
|
+
export default function TextColorsDemo() {
|
|
64
|
+
return (
|
|
65
|
+
<Box className="gap-3">
|
|
66
|
+
{COLORS.map((color) => (
|
|
67
|
+
<Text key={color} color={color}>
|
|
68
|
+
{color} — The quick brown fox jumps over the lazy dog.
|
|
69
|
+
</Text>
|
|
70
|
+
))}
|
|
71
|
+
<Text color="secondary" size="sm">
|
|
72
|
+
Balance updated <Text weight="semibold">just now</Text>
|
|
73
|
+
</Text>
|
|
74
|
+
</Box>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Weight
|
|
80
|
+
|
|
81
|
+
Use `weight` to select a font weight. It selects a face of the body family on every platform, so prefer it over a `font-*` weight class.
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
import { Box, Text, type TextProps } from '@cdx-ui/components';
|
|
85
|
+
|
|
86
|
+
const WEIGHTS = ['normal', 'medium', 'semibold', 'bold'] as const satisfies readonly NonNullable<
|
|
87
|
+
TextProps['weight']
|
|
88
|
+
>[];
|
|
89
|
+
|
|
90
|
+
export default function TextWeightDemo() {
|
|
91
|
+
return (
|
|
92
|
+
<Box className="gap-3">
|
|
93
|
+
{WEIGHTS.map((weight) => (
|
|
94
|
+
<Text key={weight} weight={weight}>
|
|
95
|
+
{weight} — The quick brown fox jumps over the lazy dog.
|
|
96
|
+
</Text>
|
|
97
|
+
))}
|
|
98
|
+
</Box>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Italic
|
|
104
|
+
|
|
105
|
+
Set `italic` to render the text in an italic style.
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
import { Box, Text, type TextProps } from '@cdx-ui/components';
|
|
109
|
+
|
|
110
|
+
const WEIGHTS = ['normal', 'medium', 'semibold', 'bold'] as const satisfies readonly NonNullable<
|
|
111
|
+
TextProps['weight']
|
|
112
|
+
>[];
|
|
113
|
+
|
|
114
|
+
export default function TextItalicDemo() {
|
|
115
|
+
return (
|
|
116
|
+
<Box className="gap-3">
|
|
117
|
+
{WEIGHTS.map((weight) => (
|
|
118
|
+
<Text key={weight} weight={weight} italic>
|
|
119
|
+
{weight} — The quick brown fox jumps over the lazy dog.
|
|
120
|
+
</Text>
|
|
121
|
+
))}
|
|
122
|
+
</Box>
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## API
|
|
128
|
+
|
|
129
|
+
### Text
|
|
130
|
+
|
|
131
|
+
| Prop | Type | Default | Description |
|
|
132
|
+
| --- | --- | --- | --- |
|
|
133
|
+
| `className?` | `string` | — | Additional Uniwind/Tailwind classes, merged after the text's own styles. |
|
|
134
|
+
| `children?` | `React.ReactNode` | — | Text content, which may include nested `Text` elements. |
|
|
135
|
+
| `color?` | `'primary' \| 'secondary' \| 'tertiary' \| 'action' \| 'danger' \| 'warning' \| 'success' \| 'info'` | `'primary'` | Semantic content color, mapped to the matching `text-content-*` token. A `Text` nested inside another text element inherits its parent's color when omitted. |
|
|
136
|
+
| `weight?` | `'normal' \| 'medium' \| 'semibold' \| 'bold'` | `'normal'` | Font weight. A nested `Text` inherits its parent's weight when omitted. |
|
|
137
|
+
| `italic?` | `boolean \| null` | — | Renders the text in italics. A nested `Text` inherits its parent's style when omitted. |
|
|
138
|
+
| `size?` | `'xl' \| 'lg' \| 'md' \| 'sm' \| 'xs'` | `'md'` | Body typography style. A nested `Text` inherits its parent's size when omitted, and setting it keeps the parent's font family and weight. |
|
|
139
|
+
|
|
140
|
+
Inherits all [`TextProps`](https://reactnative.dev/docs/text#props). A top-level `Text` defaults to `color="primary"`, `size="md"` and `weight="normal"`. A nested `Text` inherits each of these from its parent text element when it omits them, along with the parent's font family. Setting only `size` on a nested `Text` changes the size and keeps the parent's font family and weight.
|
|
141
|
+
|
|
142
|
+
A `View` between two text elements ends the nesting on iOS and Android, so a `Text` inside a `View` inside a `Text` takes the top-level defaults there. On web it keeps inheriting from the outer text. Content rendered through an overlay or portal is never nested in the text it was opened from.
|