@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,157 @@
|
|
|
1
|
+
# Date Time Field (https://design.candescent.com/docs/components/date-time-field)
|
|
2
|
+
|
|
3
|
+
Resources: [Figma](https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--Components?node-id=11787-10754)
|
|
4
|
+
|
|
5
|
+
`DateTimeField` is a segmented input for typing a date and time together. Values are `DateTimeId` strings — local ISO with no timezone, e.g. `2026-07-28T10:01`. Its `granularity` controls which time segments appear, and `hour12` toggles the AM/PM segment.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { DateTimeField } from '@cdx-ui/components';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Basic
|
|
12
|
+
|
|
13
|
+
Wrap `DateTimeField.Input` in `DateTimeField.Group` and render each segment with a `DateTimeField.Segment`. Control the value with `value` and `onValueChange`. Empty segments show localized placeholders until the user types.
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { useState } from 'react';
|
|
17
|
+
import { DateTimeField } from '@cdx-ui/components';
|
|
18
|
+
import type { DateTimeId } from '@cdx-ui/formatters';
|
|
19
|
+
|
|
20
|
+
export default function DateTimeFieldBasicDemo() {
|
|
21
|
+
const [value, setValue] = useState<DateTimeId | undefined>();
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<DateTimeField
|
|
25
|
+
value={value}
|
|
26
|
+
onValueChange={setValue}
|
|
27
|
+
granularity="minute"
|
|
28
|
+
hour12
|
|
29
|
+
aria-label="Appointment"
|
|
30
|
+
className="w-full max-w-xs"
|
|
31
|
+
>
|
|
32
|
+
<DateTimeField.Group>
|
|
33
|
+
<DateTimeField.Input>
|
|
34
|
+
{(segment) => <DateTimeField.Segment segment={segment} />}
|
|
35
|
+
</DateTimeField.Input>
|
|
36
|
+
</DateTimeField.Group>
|
|
37
|
+
</DateTimeField>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## 24-hour clock
|
|
43
|
+
|
|
44
|
+
Set `hour12` to `false` to enter the time on a 24-hour clock, which drops the AM/PM segment.
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
import { useState } from 'react';
|
|
48
|
+
import { DateTimeField } from '@cdx-ui/components';
|
|
49
|
+
import type { DateTimeId } from '@cdx-ui/formatters';
|
|
50
|
+
|
|
51
|
+
export default function DateTimeField24HourDemo() {
|
|
52
|
+
const [value, setValue] = useState<DateTimeId | undefined>();
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<DateTimeField
|
|
56
|
+
value={value}
|
|
57
|
+
onValueChange={setValue}
|
|
58
|
+
granularity="minute"
|
|
59
|
+
hour12={false}
|
|
60
|
+
aria-label="Appointment"
|
|
61
|
+
className="w-full max-w-xs"
|
|
62
|
+
>
|
|
63
|
+
<DateTimeField.Group>
|
|
64
|
+
<DateTimeField.Input>
|
|
65
|
+
{(segment) => <DateTimeField.Segment segment={segment} />}
|
|
66
|
+
</DateTimeField.Input>
|
|
67
|
+
</DateTimeField.Group>
|
|
68
|
+
</DateTimeField>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## API
|
|
74
|
+
|
|
75
|
+
### DateTimeField
|
|
76
|
+
|
|
77
|
+
Root of the compound. Owns the value, `granularity`, `hour12`, and `locale`, and provides styling context to `DateTimeField.Group`. It composes the segmented parts of `DatePicker`'s sibling [`DateField`](https://design.candescent.com/docs/components/date-field/content.md) with time segments.
|
|
78
|
+
|
|
79
|
+
| Prop | Type | Default | Description |
|
|
80
|
+
| --- | --- | --- | --- |
|
|
81
|
+
| `className?` | `string` | — | — |
|
|
82
|
+
| `children?` | `ReactNode` | — | — |
|
|
83
|
+
| `variant?` | `'outline' \| null` | — | — |
|
|
84
|
+
| `size?` | `'default' \| 'small' \| null` | — | — |
|
|
85
|
+
| `fullWidth?` | `boolean` | — | When true (the default), the group stretches to fill its container; when false, it hugs the segments. |
|
|
86
|
+
| `asChild?` | `boolean` | — | — |
|
|
87
|
+
| `value?` | `DateTimeId` | — | — |
|
|
88
|
+
| `defaultValue?` | `DateTimeId` | — | — |
|
|
89
|
+
| `onValueChange?` | `((value: DateTimeId) => void)` | — | Called with the new `DateTimeId`, or `undefined` when the field is cleared. |
|
|
90
|
+
| `granularity?` | `'day' \| 'hour' \| 'minute' \| 'second'` | — | — |
|
|
91
|
+
| `locale?` | `string` | — | — |
|
|
92
|
+
| `hour12?` | `boolean` | — | Force a 12- or 24-hour clock. Defaults to the locale's convention when omitted. |
|
|
93
|
+
| `labels?` | `Partial<DateComponentLabels>` | — | — |
|
|
94
|
+
| `isDisabled?` | `boolean` | — | — |
|
|
95
|
+
| `isReadOnly?` | `boolean` | — | — |
|
|
96
|
+
| `isInvalid?` | `boolean` | — | — |
|
|
97
|
+
| `isRequired?` | `boolean` | — | — |
|
|
98
|
+
|
|
99
|
+
Inherits all [`ViewProps`](https://reactnative.dev/docs/view#props).
|
|
100
|
+
|
|
101
|
+
## Sub-components
|
|
102
|
+
|
|
103
|
+
### DateTimeField.Group
|
|
104
|
+
|
|
105
|
+
Input chrome that surrounds the segments, shared with [`DateField.Group`](https://design.candescent.com/docs/components/date-field/content.md). Add a trailing `DateTimeField.Suffix` inside it for a picker trigger.
|
|
106
|
+
|
|
107
|
+
| Prop | Type | Default | Description |
|
|
108
|
+
| --- | --- | --- | --- |
|
|
109
|
+
| `className?` | `string` | — | — |
|
|
110
|
+
| `children?` | `ReactNode` | — | — |
|
|
111
|
+
| `ref?` | `React.Ref<View>` | — | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). |
|
|
112
|
+
| `variant?` | `'outline' \| null` | — | — |
|
|
113
|
+
| `size?` | `'default' \| 'small' \| null` | — | — |
|
|
114
|
+
| `fullWidth?` | `boolean` | — | — |
|
|
115
|
+
| `key?` | `React.Key \| null` | — | — |
|
|
116
|
+
|
|
117
|
+
Inherits all [`ViewProps`](https://reactnative.dev/docs/view#props).
|
|
118
|
+
|
|
119
|
+
### DateTimeField.Input
|
|
120
|
+
|
|
121
|
+
Renders the editable segments. Pass a render function as `children` that returns a `DateTimeField.Segment` for each segment.
|
|
122
|
+
|
|
123
|
+
| Prop | Type | Default | Description |
|
|
124
|
+
| --- | --- | --- | --- |
|
|
125
|
+
| `className?` | `string` | — | — |
|
|
126
|
+
| `children` | `(segment: import("@cdx-ui/formatters").DateSegment) => ReactNode` | — | — |
|
|
127
|
+
| `ref?` | `React.Ref<View>` | — | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). |
|
|
128
|
+
| `key?` | `React.Key \| null` | — | — |
|
|
129
|
+
|
|
130
|
+
### DateTimeField.Segment
|
|
131
|
+
|
|
132
|
+
A single editable or literal segment, yielded to the `DateTimeField.Input` render function so a specific segment type can be styled.
|
|
133
|
+
|
|
134
|
+
| Prop | Type | Default | Description |
|
|
135
|
+
| --- | --- | --- | --- |
|
|
136
|
+
| `className?` | `string` | — | — |
|
|
137
|
+
| `ref?` | `React.Ref<View>` | — | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). |
|
|
138
|
+
| `segment` | `DateSegment` | — | — |
|
|
139
|
+
| `key?` | `React.Key \| null` | — | — |
|
|
140
|
+
|
|
141
|
+
### DateTimeField.Suffix
|
|
142
|
+
|
|
143
|
+
Trailing content inside `DateTimeField.Group`, typically a picker trigger icon, shared with [`DateField.Suffix`](https://design.candescent.com/docs/components/date-field/content.md). Set `asChild` to render a custom trigger element in its place.
|
|
144
|
+
|
|
145
|
+
| Prop | Type | Default | Description |
|
|
146
|
+
| --- | --- | --- | --- |
|
|
147
|
+
| `className?` | `string` | — | — |
|
|
148
|
+
| `children?` | `ReactNode` | — | — |
|
|
149
|
+
| `ref?` | `React.Ref<View>` | — | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). |
|
|
150
|
+
| `asChild?` | `boolean` | — | — |
|
|
151
|
+
| `key?` | `React.Key \| null` | — | — |
|
|
152
|
+
|
|
153
|
+
Inherits all [`ViewProps`](https://reactnative.dev/docs/view#props).
|
|
154
|
+
|
|
155
|
+
## Accessibility
|
|
156
|
+
|
|
157
|
+
Give the field an accessible name with `aria-label` or by pairing it with `Field.Label`; the root carries no label of its own. Each segment is individually focusable and editable with the keyboard. While `isDisabled` or `isReadOnly`, segments do not accept edits.
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Date Time List (https://design.candescent.com/docs/components/date-time-list)
|
|
2
|
+
|
|
3
|
+
`DateTimeList` presents a date and time as scrollable wheel columns. Values are `DateTimeId` strings — local ISO with no timezone, e.g. `2026-07-28T10:01`. It renders its columns from `granularity` and `hour12`, or you can compose `DateTimeList.DateColumn`, `DateTimeList.TimeColumn`, and `DateTimeList.PeriodColumn` explicitly.
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { DateTimeList } from '@cdx-ui/components';
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Basic
|
|
10
|
+
|
|
11
|
+
Control the value with `value` and `onValueChange`. With no children, `DateTimeList` renders the columns implied by `granularity` and `hour12` — a date column, time columns, and an AM/PM column.
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { useState } from 'react';
|
|
15
|
+
import { DateTimeList } from '@cdx-ui/components';
|
|
16
|
+
import type { DateTimeId } from '@cdx-ui/formatters';
|
|
17
|
+
|
|
18
|
+
export default function DateTimeListBasicDemo() {
|
|
19
|
+
const [value, setValue] = useState<DateTimeId | undefined>();
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<DateTimeList
|
|
23
|
+
value={value}
|
|
24
|
+
onValueChange={setValue}
|
|
25
|
+
granularity="minute"
|
|
26
|
+
hour12
|
|
27
|
+
aria-label="Appointment"
|
|
28
|
+
className="w-full max-w-xs"
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Explicit columns
|
|
35
|
+
|
|
36
|
+
Compose `DateTimeList.DateColumn`, `DateTimeList.TimeColumn`, and `DateTimeList.PeriodColumn` as children to control which columns render and in what order.
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
import { useState } from 'react';
|
|
40
|
+
import { DateTimeList } from '@cdx-ui/components';
|
|
41
|
+
import type { DateTimeId } from '@cdx-ui/formatters';
|
|
42
|
+
|
|
43
|
+
export default function DateTimeListColumnsDemo() {
|
|
44
|
+
const [value, setValue] = useState<DateTimeId | undefined>();
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<DateTimeList
|
|
48
|
+
value={value}
|
|
49
|
+
onValueChange={setValue}
|
|
50
|
+
granularity="minute"
|
|
51
|
+
hour12
|
|
52
|
+
aria-label="Appointment"
|
|
53
|
+
className="w-full max-w-xs"
|
|
54
|
+
>
|
|
55
|
+
<DateTimeList.DateColumn />
|
|
56
|
+
<DateTimeList.TimeColumn />
|
|
57
|
+
<DateTimeList.PeriodColumn />
|
|
58
|
+
</DateTimeList>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## API
|
|
64
|
+
|
|
65
|
+
### DateTimeList
|
|
66
|
+
|
|
67
|
+
Root of the compound. Owns the selected value, `granularity`, `hour12`, and `locale`, and renders the wheel columns. It is the standalone surface that [`DateTimePicker`](https://design.candescent.com/docs/components/date-time-picker/content.md) presents through `DateTimePicker.List`.
|
|
68
|
+
|
|
69
|
+
| Prop | Type | Default | Description |
|
|
70
|
+
| --- | --- | --- | --- |
|
|
71
|
+
| `className?` | `string` | — | — |
|
|
72
|
+
| `children?` | `ReactNode` | — | — |
|
|
73
|
+
| `asChild?` | `boolean` | — | — |
|
|
74
|
+
| `value?` | `DateTimeId` | — | — |
|
|
75
|
+
| `defaultValue?` | `DateTimeId` | — | — |
|
|
76
|
+
| `onValueChange?` | `((value: DateTimeId) => void)` | — | — |
|
|
77
|
+
| `onUserInteract?` | `(() => void)` | — | — |
|
|
78
|
+
| `granularity?` | `'day' \| 'hour' \| 'minute' \| 'second'` | — | — |
|
|
79
|
+
| `locale?` | `string` | — | — |
|
|
80
|
+
| `hour12?` | `boolean` | — | Force a 12- or 24-hour clock. Defaults to the locale's convention when omitted. |
|
|
81
|
+
| `disabled?` | `boolean` | — | — |
|
|
82
|
+
| `minValue?` | `DateTimeId` | — | Earliest selectable date-time. Dates before it are hidden; times are clamped. Build with `dateTimeId(...)`. |
|
|
83
|
+
| `maxValue?` | `DateTimeId` | — | Latest selectable date-time. Dates after it are hidden; times are clamped. Build with `dateTimeId(...)`. |
|
|
84
|
+
|
|
85
|
+
Inherits all [`ViewProps`](https://reactnative.dev/docs/view#props).
|
|
86
|
+
|
|
87
|
+
## Sub-components
|
|
88
|
+
|
|
89
|
+
### DateTimeList.DateColumn
|
|
90
|
+
|
|
91
|
+
The scrollable column of dates. By default the wheel spans ±90 days around today; when the
|
|
92
|
+
selected date falls outside that window, the list recenters on the selected date so controlled
|
|
93
|
+
values remain visible and selected. Takes no own props.
|
|
94
|
+
|
|
95
|
+
### DateTimeList.TimeColumn
|
|
96
|
+
|
|
97
|
+
The scrollable time columns. Renders an hour column, plus minute and second columns when `granularity` includes them. Takes no own props.
|
|
98
|
+
|
|
99
|
+
### DateTimeList.PeriodColumn
|
|
100
|
+
|
|
101
|
+
The AM/PM column, meaningful only when `hour12` is set. Takes no own props.
|
|
102
|
+
|
|
103
|
+
## Accessibility
|
|
104
|
+
|
|
105
|
+
Give the list an accessible name with `aria-label` or by pairing it with `Field.Label`. Each column is a list of pressable options that report their selected state, so a value can be chosen by scrolling the wheel or by activating an option directly. While `disabled`, the columns do not accept changes.
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
# Date Time Picker (https://design.candescent.com/docs/components/date-time-picker)
|
|
2
|
+
|
|
3
|
+
Resources: [Storybook](https://victorious-wave-0daadf00f.6.azurestaticapps.net/?path=/story/date-time-datetimepicker--dialog)
|
|
4
|
+
|
|
5
|
+
`DateTimePicker` pairs a segmented `DateTimeField` with a scroll-wheel `DateTimeList` and coordinates the surface that presents it. Values are `DateTimeId` strings — local ISO with no timezone, e.g. `2026-07-28T10:01`.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { DateTimeField, DateTimePicker, DateTimeList, Field } from '@cdx-ui/components';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Basic
|
|
12
|
+
|
|
13
|
+
Because the date and time field is editable, keep the `DateTimePicker.Trigger` around the suffix icon only, so typing in the field does not open the columns. Then present the columns — `DateTimePicker.Popover` anchors to the field and is the preferred surface on web. For surface-driven selection with no typing, you can instead wrap the whole `DateTimeField.Group` in the trigger, as [DateRangePicker](https://design.candescent.com/docs/components/date-range-picker/content.md) and [MonthPicker](https://design.candescent.com/docs/components/month-picker/content.md) do.
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { useState } from 'react';
|
|
17
|
+
import { DateTimeField, DateTimePicker, Field } from '@cdx-ui/components';
|
|
18
|
+
import type { DateTimeId } from '@cdx-ui/formatters';
|
|
19
|
+
|
|
20
|
+
export default function DateTimePickerBasicDemo() {
|
|
21
|
+
const [value, setValue] = useState<DateTimeId | undefined>();
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<Field className="w-full max-w-xs">
|
|
25
|
+
<DateTimePicker value={value} onValueChange={setValue} granularity="minute" hour12>
|
|
26
|
+
<Field.Label>Appointment</Field.Label>
|
|
27
|
+
<DateTimeField.Group fullWidth>
|
|
28
|
+
<DateTimeField.Input>
|
|
29
|
+
{(segment) => <DateTimeField.Segment segment={segment} />}
|
|
30
|
+
</DateTimeField.Input>
|
|
31
|
+
<DateTimeField.Suffix>
|
|
32
|
+
<DateTimePicker.Trigger>
|
|
33
|
+
<DateTimePicker.TriggerIndicator />
|
|
34
|
+
</DateTimePicker.Trigger>
|
|
35
|
+
</DateTimeField.Suffix>
|
|
36
|
+
</DateTimeField.Group>
|
|
37
|
+
<DateTimePicker.Popover>
|
|
38
|
+
<DateTimePicker.List aria-label="Appointment" />
|
|
39
|
+
</DateTimePicker.Popover>
|
|
40
|
+
</DateTimePicker>
|
|
41
|
+
</Field>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Dialog
|
|
47
|
+
|
|
48
|
+
Use `DateTimePicker.Dialog` to present the columns in a modal surface.
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
import { useState } from 'react';
|
|
52
|
+
import { DateTimeField, DateTimePicker, Field } from '@cdx-ui/components';
|
|
53
|
+
import type { DateTimeId } from '@cdx-ui/formatters';
|
|
54
|
+
|
|
55
|
+
export default function DateTimePickerDialogDemo() {
|
|
56
|
+
const [value, setValue] = useState<DateTimeId | undefined>();
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<Field className="w-full max-w-xs">
|
|
60
|
+
<DateTimePicker value={value} onValueChange={setValue} granularity="minute" hour12>
|
|
61
|
+
<Field.Label>Appointment</Field.Label>
|
|
62
|
+
<DateTimeField.Group fullWidth>
|
|
63
|
+
<DateTimeField.Input>
|
|
64
|
+
{(segment) => <DateTimeField.Segment segment={segment} />}
|
|
65
|
+
</DateTimeField.Input>
|
|
66
|
+
<DateTimeField.Suffix>
|
|
67
|
+
<DateTimePicker.Trigger>
|
|
68
|
+
<DateTimePicker.TriggerIndicator />
|
|
69
|
+
</DateTimePicker.Trigger>
|
|
70
|
+
</DateTimeField.Suffix>
|
|
71
|
+
</DateTimeField.Group>
|
|
72
|
+
<DateTimePicker.Dialog>
|
|
73
|
+
<DateTimePicker.List aria-label="Appointment" />
|
|
74
|
+
</DateTimePicker.Dialog>
|
|
75
|
+
</DateTimePicker>
|
|
76
|
+
</Field>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Bottom sheet
|
|
82
|
+
|
|
83
|
+
Use `DateTimePicker.BottomSheet` to present the columns in a sheet that slides up from the bottom — the preferred surface on native. It wires open state only, so compose `BottomSheet.Header` and `BottomSheet.Content` as its children.
|
|
84
|
+
|
|
85
|
+
```tsx
|
|
86
|
+
import { useState } from 'react';
|
|
87
|
+
import { BottomSheet, DateTimeField, DateTimePicker, Field } from '@cdx-ui/components';
|
|
88
|
+
import type { DateTimeId } from '@cdx-ui/formatters';
|
|
89
|
+
import { PickerBottomSheetFrame } from './_frame';
|
|
90
|
+
|
|
91
|
+
export default function DateTimePickerBottomSheetDemo() {
|
|
92
|
+
const [value, setValue] = useState<DateTimeId | undefined>();
|
|
93
|
+
const [open, setOpen] = useState(false);
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<PickerBottomSheetFrame>
|
|
97
|
+
<Field className="w-full max-w-xs">
|
|
98
|
+
<DateTimePicker
|
|
99
|
+
value={value}
|
|
100
|
+
onValueChange={setValue}
|
|
101
|
+
isOpen={open}
|
|
102
|
+
onOpenChange={setOpen}
|
|
103
|
+
granularity="minute"
|
|
104
|
+
hour12
|
|
105
|
+
>
|
|
106
|
+
<Field.Label>Appointment</Field.Label>
|
|
107
|
+
<DateTimeField.Group fullWidth>
|
|
108
|
+
<DateTimeField.Input>
|
|
109
|
+
{(segment) => <DateTimeField.Segment segment={segment} />}
|
|
110
|
+
</DateTimeField.Input>
|
|
111
|
+
<DateTimeField.Suffix>
|
|
112
|
+
<DateTimePicker.Trigger>
|
|
113
|
+
<DateTimePicker.TriggerIndicator />
|
|
114
|
+
</DateTimePicker.Trigger>
|
|
115
|
+
</DateTimeField.Suffix>
|
|
116
|
+
</DateTimeField.Group>
|
|
117
|
+
<DateTimePicker.BottomSheet>
|
|
118
|
+
<BottomSheet.Header title="Select date and time" onClose={() => setOpen(false)} />
|
|
119
|
+
<BottomSheet.Content>
|
|
120
|
+
<DateTimePicker.List aria-label="Appointment" />
|
|
121
|
+
</BottomSheet.Content>
|
|
122
|
+
</DateTimePicker.BottomSheet>
|
|
123
|
+
</DateTimePicker>
|
|
124
|
+
</Field>
|
|
125
|
+
</PickerBottomSheetFrame>
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Standalone
|
|
131
|
+
|
|
132
|
+
`DateTimePicker` has no inline surface. When the field and columns share the screen, render a `DateTimeList` on its own — it renders its columns from `granularity` and `hour12`, or you can compose `DateTimeList.DateColumn`, `DateTimeList.TimeColumn`, and `DateTimeList.PeriodColumn` explicitly.
|
|
133
|
+
|
|
134
|
+
```tsx
|
|
135
|
+
import { useState } from 'react';
|
|
136
|
+
import { DateTimeList } from '@cdx-ui/components';
|
|
137
|
+
import type { DateTimeId } from '@cdx-ui/formatters';
|
|
138
|
+
|
|
139
|
+
export default function DateTimePickerStandaloneDemo() {
|
|
140
|
+
const [value, setValue] = useState<DateTimeId | undefined>();
|
|
141
|
+
|
|
142
|
+
return (
|
|
143
|
+
<DateTimeList
|
|
144
|
+
className="w-full max-w-xs"
|
|
145
|
+
value={value}
|
|
146
|
+
onValueChange={setValue}
|
|
147
|
+
granularity="minute"
|
|
148
|
+
hour12
|
|
149
|
+
aria-label="Appointment"
|
|
150
|
+
>
|
|
151
|
+
<DateTimeList.DateColumn />
|
|
152
|
+
<DateTimeList.TimeColumn />
|
|
153
|
+
<DateTimeList.PeriodColumn />
|
|
154
|
+
</DateTimeList>
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Custom trigger
|
|
160
|
+
|
|
161
|
+
Set `asChild` on `DateTimePicker.Trigger` to open the columns from a custom pressable such as an `IconButton`, keeping the segmented field for direct entry. The trigger merges its press and expanded-state accessibility props onto the child.
|
|
162
|
+
|
|
163
|
+
```tsx
|
|
164
|
+
import { Box, DateTimeField, DateTimePicker, Field, IconButton } from '@cdx-ui/components';
|
|
165
|
+
import { Schedule } from '@cdx-ui/icons';
|
|
166
|
+
|
|
167
|
+
export default function DateTimePickerCustomTriggerDemo() {
|
|
168
|
+
return (
|
|
169
|
+
<Field className="w-full max-w-xs">
|
|
170
|
+
<DateTimePicker granularity="minute" hour12>
|
|
171
|
+
<Field.Label>Appointment</Field.Label>
|
|
172
|
+
<Box className="flex-row items-center gap-2">
|
|
173
|
+
<DateTimeField.Group fullWidth>
|
|
174
|
+
<DateTimeField.Input>
|
|
175
|
+
{(segment) => <DateTimeField.Segment segment={segment} />}
|
|
176
|
+
</DateTimeField.Input>
|
|
177
|
+
</DateTimeField.Group>
|
|
178
|
+
<DateTimePicker.Trigger asChild>
|
|
179
|
+
<IconButton as={Schedule} variant="ghost" accessibilityLabel="Open time picker" />
|
|
180
|
+
</DateTimePicker.Trigger>
|
|
181
|
+
</Box>
|
|
182
|
+
<DateTimePicker.Popover>
|
|
183
|
+
<DateTimePicker.List aria-label="Appointment" />
|
|
184
|
+
</DateTimePicker.Popover>
|
|
185
|
+
</DateTimePicker>
|
|
186
|
+
</Field>
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## API
|
|
192
|
+
|
|
193
|
+
### DateTimePicker
|
|
194
|
+
|
|
195
|
+
Root of the compound. Owns the selected value, open state, `granularity`, `hour12`, `locale`, and `labels`, and provides `DateTimeField` styling context to the field. Compose exactly one presentation surface — `DateTimePicker.Popover`, `DateTimePicker.Dialog`, or `DateTimePicker.BottomSheet` — per picker.
|
|
196
|
+
|
|
197
|
+
| Prop | Type | Default | Description |
|
|
198
|
+
| --- | --- | --- | --- |
|
|
199
|
+
| `className?` | `string` | — | — |
|
|
200
|
+
| `children?` | `ReactNode` | — | — |
|
|
201
|
+
| `asChild?` | `boolean` | — | — |
|
|
202
|
+
| `value?` | `DateTimeId` | — | — |
|
|
203
|
+
| `defaultValue?` | `DateTimeId` | — | — |
|
|
204
|
+
| `onValueChange?` | `((value: DateTimeId) => void)` | — | Called with the new `DateTimeId`, or `undefined` when the selection is cleared. |
|
|
205
|
+
| `isOpen?` | `boolean` | — | Controlled open state. Use `defaultOpen` for the uncontrolled variant. |
|
|
206
|
+
| `defaultOpen?` | `boolean` | — | — |
|
|
207
|
+
| `onOpenChange?` | `((open: boolean) => void)` | — | — |
|
|
208
|
+
| `isDisabled?` | `boolean` | — | — |
|
|
209
|
+
| `isReadOnly?` | `boolean` | — | — |
|
|
210
|
+
| `isInvalid?` | `boolean` | — | — |
|
|
211
|
+
| `isRequired?` | `boolean` | — | — |
|
|
212
|
+
| `minValue?` | `DateTimeId` | — | Earliest selectable date-time, applied to the scroll list. Build with `dateTimeId(...)`. |
|
|
213
|
+
| `maxValue?` | `DateTimeId` | — | Latest selectable date-time, applied to the scroll list. Build with `dateTimeId(...)`. |
|
|
214
|
+
| `name?` | `string` | — | — |
|
|
215
|
+
| `locale?` | `string` | — | — |
|
|
216
|
+
| `labels?` | `Partial<DateComponentLabels>` | — | — |
|
|
217
|
+
| `granularity?` | `'day' \| 'hour' \| 'minute' \| 'second'` | — | Which field segments and list columns to show, from coarsest (`day`) to finest (`second`). |
|
|
218
|
+
| `hour12?` | `boolean` | — | Force a 12-hour clock (AM/PM column) or a 24-hour clock. Defaults to the locale's convention when omitted. |
|
|
219
|
+
|
|
220
|
+
Inherits all [`ViewProps`](https://reactnative.dev/docs/view#props).
|
|
221
|
+
|
|
222
|
+
## Sub-components
|
|
223
|
+
|
|
224
|
+
### DateTimePicker.Trigger
|
|
225
|
+
|
|
226
|
+
Toggles the presentation surface and announces its expanded state. For an editable field, wrap only the `DateTimePicker.TriggerIndicator` inside a `DateTimeField.Suffix`; for surface-driven selection, wrap the whole `DateTimeField.Group` so the entire field is the tap target. Its accessible name defaults to the picker's `openDateTimePicker` label. Set `asChild` to merge its press and accessibility props onto a custom interactive child — for example an `IconButton` — instead of rendering the default pressable.
|
|
227
|
+
|
|
228
|
+
| Prop | Type | Default | Description |
|
|
229
|
+
| --- | --- | --- | --- |
|
|
230
|
+
| `className?` | `string` | — | — |
|
|
231
|
+
| `children?` | `ReactNode` | — | Either children or a render prop that receives a boolean reflecting whether the component is currently pressed. |
|
|
232
|
+
| `ref?` | `React.Ref<View>` | — | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). |
|
|
233
|
+
| `asChild?` | `boolean` | — | Merge press / a11y props onto the single child instead of rendering a `Pressable`. Use when the trigger should be another interactive host (e.g. `IconButton`). For a larger field hit target, prefer wrapping `DateField.Group` as children without `asChild` so the outer `Pressable` covers the whole input chrome. |
|
|
234
|
+
| `key?` | `React.Key \| null` | — | — |
|
|
235
|
+
|
|
236
|
+
Inherits all [`PressableProps`](https://reactnative.dev/docs/pressable#props).
|
|
237
|
+
|
|
238
|
+
### DateTimePicker.TriggerIndicator
|
|
239
|
+
|
|
240
|
+
Renders the clock icon inside `DateTimePicker.Trigger`. Takes no props.
|
|
241
|
+
|
|
242
|
+
### DateTimePicker.List
|
|
243
|
+
|
|
244
|
+
Renders the picker's `DateTimeList`, wired to the shared value, `granularity`, `hour12`, and `locale`. Accepts all `DateTimeList` props except those the picker controls (`value`, `onValueChange`, `granularity`, `hour12`, and `locale`).
|
|
245
|
+
|
|
246
|
+
| Prop | Type | Default | Description |
|
|
247
|
+
| --- | --- | --- | --- |
|
|
248
|
+
| `className?` | `string` | — | — |
|
|
249
|
+
| `children?` | `ReactNode` | — | — |
|
|
250
|
+
| `ref?` | `React.Ref<View>` | — | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). |
|
|
251
|
+
| `asChild?` | `boolean` | — | — |
|
|
252
|
+
| `defaultValue?` | `DateTimeId` | — | — |
|
|
253
|
+
| `disabled?` | `boolean` | — | — |
|
|
254
|
+
| `key?` | `React.Key \| null` | — | — |
|
|
255
|
+
|
|
256
|
+
Inherits all [`ViewProps`](https://reactnative.dev/docs/view#props).
|
|
257
|
+
|
|
258
|
+
### DateTimePicker.Popover
|
|
259
|
+
|
|
260
|
+
Presents the columns in an anchored popover, positioned above or below the field based on available space. Wires the surface's open state and renders its children.
|
|
261
|
+
|
|
262
|
+
### DateTimePicker.Dialog
|
|
263
|
+
|
|
264
|
+
Presents the columns in a modal dialog. Wires the surface's open state and renders its children.
|
|
265
|
+
|
|
266
|
+
### DateTimePicker.BottomSheet
|
|
267
|
+
|
|
268
|
+
Presents the columns in a bottom sheet, the preferred surface on native. It wires open state only — compose `BottomSheet.Header` and `BottomSheet.Content` (or any sheet layout) as its children.
|
|
269
|
+
|
|
270
|
+
## Accessibility
|
|
271
|
+
|
|
272
|
+
Give the picker an accessible name with `Field.Label` or `aria-label`, and pass `aria-label` to `DateTimePicker.List` to name the columns. `DateTimePicker.Trigger` announces the localized `openDateTimePicker` label, which `labels` can override. Each column is a list of pressable options that report their selected state, so a value can be chosen by scrolling or by activating an option directly. While `disabled`, the trigger does not open a surface.
|