@cdx-ui/components 0.2.3 → 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 +2 -0
- package/coverage.svg +1 -1
- package/docs/components/accordion/content.md +538 -0
- package/docs/components/alert/content.md +203 -0
- package/docs/components/alert-dialog/content.md +319 -0
- package/docs/components/avatar/content.md +368 -0
- package/docs/components/avatar/design.md +202 -0
- package/docs/components/badge/content.md +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/DateTimeList/index.js +11 -26
- package/lib/commonjs/components/DateTimeList/index.js.map +1 -1
- package/lib/commonjs/components/DateTimeList/styles.js +2 -12
- package/lib/commonjs/components/DateTimeList/styles.js.map +1 -1
- package/lib/commonjs/components/ListItem/index.js.map +1 -1
- package/lib/commonjs/components/ListItem/styles.js +2 -1
- package/lib/commonjs/components/ListItem/styles.js.map +1 -1
- package/lib/commonjs/components/Menu/index.js +11 -5
- package/lib/commonjs/components/Menu/index.js.map +1 -1
- package/lib/commonjs/components/ScrollShadow/gradient.js +29 -0
- package/lib/commonjs/components/ScrollShadow/gradient.js.map +1 -0
- package/lib/commonjs/components/ScrollShadow/index.js +171 -44
- package/lib/commonjs/components/ScrollShadow/index.js.map +1 -1
- package/lib/commonjs/components/ScrollShadow/styles.js +58 -14
- package/lib/commonjs/components/ScrollShadow/styles.js.map +1 -1
- package/lib/commonjs/components/ScrollShadow/useComposedScrollHandler.js +63 -0
- package/lib/commonjs/components/ScrollShadow/useComposedScrollHandler.js.map +1 -0
- package/lib/commonjs/components/ScrollShadow/useScrollShadow.js +48 -8
- package/lib/commonjs/components/ScrollShadow/useScrollShadow.js.map +1 -1
- package/lib/commonjs/components/Tabs/index.js +16 -23
- package/lib/commonjs/components/Tabs/index.js.map +1 -1
- package/lib/commonjs/components/Tabs/styles.js +1 -10
- package/lib/commonjs/components/Tabs/styles.js.map +1 -1
- package/lib/commonjs/figma/ListItem.SectionHeader.figma.js +20 -5
- package/lib/commonjs/figma/ListItem.SectionHeader.figma.js.map +1 -1
- package/lib/module/components/DateTimeList/index.js +12 -27
- package/lib/module/components/DateTimeList/index.js.map +1 -1
- package/lib/module/components/DateTimeList/styles.js +1 -11
- package/lib/module/components/DateTimeList/styles.js.map +1 -1
- package/lib/module/components/ListItem/index.js.map +1 -1
- package/lib/module/components/ListItem/styles.js +2 -1
- package/lib/module/components/ListItem/styles.js.map +1 -1
- package/lib/module/components/Menu/index.js +11 -5
- package/lib/module/components/Menu/index.js.map +1 -1
- package/lib/module/components/ScrollShadow/gradient.js +24 -0
- package/lib/module/components/ScrollShadow/gradient.js.map +1 -0
- package/lib/module/components/ScrollShadow/index.js +170 -48
- package/lib/module/components/ScrollShadow/index.js.map +1 -1
- package/lib/module/components/ScrollShadow/styles.js +57 -13
- package/lib/module/components/ScrollShadow/styles.js.map +1 -1
- package/lib/module/components/ScrollShadow/useComposedScrollHandler.js +57 -0
- package/lib/module/components/ScrollShadow/useComposedScrollHandler.js.map +1 -0
- package/lib/module/components/ScrollShadow/useScrollShadow.js +46 -8
- package/lib/module/components/ScrollShadow/useScrollShadow.js.map +1 -1
- package/lib/module/components/Tabs/index.js +17 -24
- package/lib/module/components/Tabs/index.js.map +1 -1
- package/lib/module/components/Tabs/styles.js +0 -9
- package/lib/module/components/Tabs/styles.js.map +1 -1
- package/lib/module/figma/ListItem.SectionHeader.figma.js +20 -5
- package/lib/module/figma/ListItem.SectionHeader.figma.js.map +1 -1
- package/lib/typescript/components/DateTimeList/index.d.ts.map +1 -1
- package/lib/typescript/components/DateTimeList/styles.d.ts +1 -4
- package/lib/typescript/components/DateTimeList/styles.d.ts.map +1 -1
- package/lib/typescript/components/ListItem/index.d.ts +5 -4
- package/lib/typescript/components/ListItem/index.d.ts.map +1 -1
- package/lib/typescript/components/ListItem/styles.d.ts +1 -1
- package/lib/typescript/components/ListItem/styles.d.ts.map +1 -1
- package/lib/typescript/components/Menu/index.d.ts.map +1 -1
- package/lib/typescript/components/ScrollShadow/gradient.d.ts +7 -0
- package/lib/typescript/components/ScrollShadow/gradient.d.ts.map +1 -0
- package/lib/typescript/components/ScrollShadow/index.d.ts +57 -15
- package/lib/typescript/components/ScrollShadow/index.d.ts.map +1 -1
- package/lib/typescript/components/ScrollShadow/styles.d.ts +8 -2
- package/lib/typescript/components/ScrollShadow/styles.d.ts.map +1 -1
- package/lib/typescript/components/ScrollShadow/useComposedScrollHandler.d.ts +13 -0
- package/lib/typescript/components/ScrollShadow/useComposedScrollHandler.d.ts.map +1 -0
- package/lib/typescript/components/ScrollShadow/useScrollShadow.d.ts +15 -2
- package/lib/typescript/components/ScrollShadow/useScrollShadow.d.ts.map +1 -1
- package/lib/typescript/components/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/figma/ListItem.SectionHeader.figma.d.ts.map +1 -1
- package/package.json +8 -6
- package/src/components/DateTimeList/index.tsx +13 -26
- package/src/components/DateTimeList/styles.ts +1 -10
- package/src/components/ListItem/index.tsx +5 -4
- package/src/components/ListItem/styles.ts +1 -0
- package/src/components/Menu/index.tsx +11 -8
- package/src/components/ScrollShadow/gradient.ts +48 -0
- package/src/components/ScrollShadow/index.tsx +300 -69
- package/src/components/ScrollShadow/styles.ts +45 -28
- package/src/components/ScrollShadow/useComposedScrollHandler.ts +58 -0
- package/src/components/ScrollShadow/useScrollShadow.ts +72 -10
- package/src/components/Tabs/index.tsx +25 -35
- package/src/components/Tabs/styles.ts +0 -9
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
# Bottom Sheet — Design (https://design.candescent.com/docs/components/bottom-sheet)
|
|
2
|
+
|
|
3
|
+
## Usage
|
|
4
|
+
|
|
5
|
+
**Common alternative names:** Sheet, Action sheet, Slide-up panel, Bottom drawer
|
|
6
|
+
|
|
7
|
+
## Anatomy
|
|
8
|
+
|
|
9
|
+
A bottom sheet is built from a **header** area (top of the sheet), a **body**, and a **footer**.
|
|
10
|
+
|
|
11
|
+
**Anatomy\_avatar**
|
|
12
|
+
|
|
13
|
+
1. **Sheet surface:** The panel anchored to the bottom of the screen; rounded top corners, square at the bottom edge.
|
|
14
|
+
2. **Drag handle:** Horizontal bar at the top of the sheet that indicates the sheet can be dragged vertically.
|
|
15
|
+
3. **Leading button** (optional)**:** Optional action in the leading corner (top-left), for example back or a contextual icon.
|
|
16
|
+
4. **Title** (optional)**:** Optional label for the sheet task, shown when the sheet needs a clear name.
|
|
17
|
+
5. **Close control** (optional)**:** Optional dismiss control in the trailing corner (top-right).
|
|
18
|
+
6. **Slot:** Space for lists, forms, controls, or any other components used as the sheet content. Scrolls when the sheet uses the scroll view.
|
|
19
|
+
7. **Footer:** Includes a primary button by default at the bottom of the sheet. Secondary actions can be added when needed.
|
|
20
|
+
|
|
21
|
+
### Full bleed
|
|
22
|
+
|
|
23
|
+
Full bleed controls how slot content is laid out horizontally within the bottom sheet, defining whether it stays within the standard gutters or can extend edge to edge within safe area boundaries.
|
|
24
|
+
|
|
25
|
+
- **fullBleed: False (default)**
|
|
26
|
+
|
|
27
|
+
Slot uses horizontal inset; lists and fields do not touch the sheet side edges.
|
|
28
|
+
- **fullBleed: True**
|
|
29
|
+
|
|
30
|
+
Slot content runs edge-to-edge within the sheet; use when full-width lists, imagery, or dividers should meet the sheet boundary.
|
|
31
|
+
|
|
32
|
+
### Scroll view
|
|
33
|
+
|
|
34
|
+
The scroll view defines how the bottom sheet handles content height and scrolling, determining whether it expands to full screen with internal scrolling or remains fixed at a shorter height.
|
|
35
|
+
|
|
36
|
+
- **Use ScrollView?: True (default)**
|
|
37
|
+
|
|
38
|
+
Built-in scrolling in the slot; pairs with fixed height and long content.
|
|
39
|
+
- **Use ScrollView?: False**
|
|
40
|
+
|
|
41
|
+
No component-level scroll wrapper; best when content is short, hugs content height is used, or the slot owns its own scroll behavior.
|
|
42
|
+
|
|
43
|
+
### Footer
|
|
44
|
+
|
|
45
|
+
- **Show Footer?: True (default)**
|
|
46
|
+
|
|
47
|
+
Footer strip visible; includes the default primary button and optional secondary actions per button hierarchy.
|
|
48
|
+
- **Show Footer: False**
|
|
49
|
+
|
|
50
|
+
Footer hidden; use when the flow completes from slot selection alone or from header actions only (document when this is appropriate).
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
Usage
|
|
55
|
+
|
|
56
|
+
### When to use
|
|
57
|
+
|
|
58
|
+
> [!TIP]
|
|
59
|
+
>
|
|
60
|
+
> **For short tasks or choices tied to the current screen**
|
|
61
|
+
>
|
|
62
|
+
> - ex: Sort or filter a list
|
|
63
|
+
> - ex: Share or export
|
|
64
|
+
> - ex: Overflow (“More”) actions
|
|
65
|
+
|
|
66
|
+
> [!TIP]
|
|
67
|
+
>
|
|
68
|
+
> **For extra detail or options without changing screens**
|
|
69
|
+
>
|
|
70
|
+
> - ex: Item details or metadata
|
|
71
|
+
> - ex: Pickers and lightweight previews
|
|
72
|
+
|
|
73
|
+
> [!TIP]
|
|
74
|
+
>
|
|
75
|
+
> **For a small amount of secondary input**
|
|
76
|
+
>
|
|
77
|
+
> - ex: Rename or add a label
|
|
78
|
+
> - ex: A few fields that support the main task
|
|
79
|
+
|
|
80
|
+
> [!TIP]
|
|
81
|
+
>
|
|
82
|
+
> **When people should stay oriented to what is underneath**
|
|
83
|
+
>
|
|
84
|
+
> - ex: A map or list still visible (dimmed) behind the sheet
|
|
85
|
+
|
|
86
|
+
### When not to use
|
|
87
|
+
|
|
88
|
+
> [!CAUTION]
|
|
89
|
+
>
|
|
90
|
+
> **For primary, multi-step flows**
|
|
91
|
+
>
|
|
92
|
+
> - ex: Full onboarding or checkout as a single sheet flow
|
|
93
|
+
> - ex: Complex wizards that need a dedicated layout
|
|
94
|
+
|
|
95
|
+
> [!CAUTION]
|
|
96
|
+
>
|
|
97
|
+
> **For critical system-level alerts**
|
|
98
|
+
>
|
|
99
|
+
> - ex: Errors or warnings that must interrupt everywhere—use a dialog or platform alert
|
|
100
|
+
|
|
101
|
+
> [!CAUTION]
|
|
102
|
+
>
|
|
103
|
+
> **For deep hierarchical navigation**
|
|
104
|
+
>
|
|
105
|
+
> - ex: Many nested levels inside the sheet
|
|
106
|
+
|
|
107
|
+
> [!CAUTION]
|
|
108
|
+
>
|
|
109
|
+
> **For side- or top-anchored panels on large layouts**
|
|
110
|
+
>
|
|
111
|
+
> - ex: A right-side detail rail or expanding left nav—use Drawer.
|
|
112
|
+
|
|
113
|
+
### Placement
|
|
114
|
+
|
|
115
|
+
Bottom sheets float above all content, separated by a translucent overlay that indicates a modal state. They are pinned to the bottom of the viewport, span the available width within safe areas, and expand upward with a rounded top edge.
|
|
116
|
+
|
|
117
|
+
_usage\_placement\_mobile_
|
|
118
|
+
|
|
119
|
+
### Bottom sheet vs Drawer
|
|
120
|
+
|
|
121
|
+
Bottom sheet supports tasks at the bottom edge of the mobile viewport. Drawer supports panels from the left, right, or top. Keep usage consistent to maintain predictable behavior.
|
|
122
|
+
|
|
123
|
+
- **Do:** Put sort, share, overflow, and short forms that rise from the bottom on Bottom sheet on mobile and narrow web.
|
|
124
|
+
- **Don't:** Don't use a bottom sheet as a right-hand detail rail or left navigation surface on desktop—that belongs on Drawer.
|
|
125
|
+
|
|
126
|
+
### Responsive behavior
|
|
127
|
+
|
|
128
|
+
Responsive behavior defines how the bottom sheet adapts across screen sizes, ensuring the same task remains in a bottom‑anchored pattern without shifting to a different surface.
|
|
129
|
+
|
|
130
|
+
- **Do:** Make scroll in the slot obvious when the sheet uses fixed height (fade, clipped row, or scroll bar).
|
|
131
|
+
- **Don't:** Don’t use scrollable content without a clear affordance or place the primary action below the viewport.
|
|
132
|
+
|
|
133
|
+
### Action hierarchy in the footer
|
|
134
|
+
|
|
135
|
+
The footer ships with a **default action button** when shown. Secondary actions should follow Button hierarchy.
|
|
136
|
+
|
|
137
|
+
- **Do:** Keep one clear primary in the footer for the sheet’s main outcome.
|
|
138
|
+
- **Don't:** Don't show two competing primaries of the same weight.
|
|
139
|
+
|
|
140
|
+
### Destructive actions
|
|
141
|
+
|
|
142
|
+
Bottom sheet footers follow the same **order and placement** rules as other mobile action areas: on a stacked footer, put the **primary** (for example **Save changes**) **at the bottom** as the full-width control; place **secondary** and **destructive** actions **above** it or in a row above it, using **lower emphasis** (text or ghost/outlined)—never as a competing filled primary.
|
|
143
|
+
|
|
144
|
+
- **Do:** Place destructive actions as a secondary pattern with clear labeling and confirmation when needed.
|
|
145
|
+
- **Don't:** Don't use destructive fill as the default primary except on a dedicated destructive confirm sheet.
|
|
146
|
+
|
|
147
|
+
### Breakpoints
|
|
148
|
+
|
|
149
|
+
On wider viewports, bottom sheets follow defined patterns for max width, horizontal alignment, and overlay behavior. When behavior shifts at specific breakpoints, maintain a consistent pattern for how the component adapts.
|
|
150
|
+
|
|
151
|
+
A common responsive pattern is to transition the bottom sheet into a drawer on larger viewports. This allows content to scale more naturally with available space while preserving a familiar interaction model across breakpoints.
|
|
152
|
+
|
|
153
|
+
_usage\_breakpoints\_01-ex_
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Behavior
|
|
158
|
+
|
|
159
|
+
### Opening and closing
|
|
160
|
+
|
|
161
|
+
Bottom sheets open with a short upward motion and a overlay fade-in, and close with the reverse. Motion should follow established motion guidelines. For modal use, focus moves into the sheet on open and returns to the triggering control on close.
|
|
162
|
+
|
|
163
|
+
_behavior\_opening\_closing\_01-ex_
|
|
164
|
+
|
|
165
|
+
### Dismissal
|
|
166
|
+
|
|
167
|
+
Bottom sheets support common dismissal patterns such as overlay tap (for modal use), a close control, swipe down when enabled, and platform back where applicable. Available dismissal methods remain consistent across supported platforms.
|
|
168
|
+
|
|
169
|
+
_behavior\_dismissal\_01-ex_
|
|
170
|
+
|
|
171
|
+
### Interaction states
|
|
172
|
+
|
|
173
|
+
Footer actions follow standard button states, including hover on web. Content within the sheet, such as rows or options, follows established list or control patterns. Loading states appear within the content area and do not shift footer actions in a way that could cause mis-taps.
|
|
174
|
+
|
|
175
|
+
_behavior\_keyboard\_and\_textinput\_01-ex_
|
|
176
|
+
|
|
177
|
+
### Keyboard and text input
|
|
178
|
+
|
|
179
|
+
When a bottom sheet includes form fields, the layout adjusts while the keyboard is open to keep the focused input and primary actions visible. The primary CTA remains pinned to the top of the keyboard so it is always accessible. Content within the sheet may scroll to maintain access to fields and actions on smaller viewports.
|
|
180
|
+
|
|
181
|
+
Behavior remains consistent across breakpoints so the same task is supported in both bottom sheet and drawer patterns without shifting the interaction model.
|
|
182
|
+
|
|
183
|
+
_behavior\_keyboard\_and\_textinput\_02-ex_
|
|
184
|
+
|
|
185
|
+
### Keyboard and assistive technology
|
|
186
|
+
|
|
187
|
+
For modal use, focus remains within the sheet until it is closed. On web, Escape closes the sheet when it does not conflict with nested interactions. The component uses an appropriate accessible role and is labeled from its visible title.
|
|
188
|
+
|
|
189
|
+
_behavior\_keyboard\_unfocusing\_01-ex_
|
|
190
|
+
|
|
191
|
+
### Stacking
|
|
192
|
+
|
|
193
|
+
Bottom sheets do not stack. For multi-step flows, content updates within the same sheet or follows a clear back navigation pattern.
|
|
194
|
+
|
|
195
|
+
## Content
|
|
196
|
+
|
|
197
|
+
## Titles
|
|
198
|
+
|
|
199
|
+
Titles should clearly describe the task or decision presented in the bottom sheet.
|
|
200
|
+
|
|
201
|
+
Use these guidelines when writing titles:
|
|
202
|
+
|
|
203
|
+
- Use short, task-based phrasing (aim for 1 to 3 words when possible)
|
|
204
|
+
- Write in sentence case (aside from proper nouns)
|
|
205
|
+
- Focus on the user action (for example, “Sort by,” “Share,” “Edit label”)
|
|
206
|
+
|
|
207
|
+
* **Do:** Use clear, action-focused titles.
|
|
208
|
+
* **Caution:** Avoid marketing or promotional language.
|
|
209
|
+
* **Don't:** Don’t use vague or decorative language.
|
|
210
|
+
|
|
211
|
+
## Primary action
|
|
212
|
+
|
|
213
|
+
The primary action represents the main outcome of the bottom sheet.
|
|
214
|
+
|
|
215
|
+
Use these guidelines when writing primary actions:
|
|
216
|
+
|
|
217
|
+
- Use a clear verb + object structure (for example, “Save changes,” “Apply filters”)
|
|
218
|
+
- Keep labels concise and specific to the outcome
|
|
219
|
+
- Ensure the action reflects what happens next
|
|
220
|
+
|
|
221
|
+
* **Do:** Make the outcome clear and actionable.
|
|
222
|
+
* **Don't:** Don’t use generic labels like “Continue” when a more specific action is possible.
|
|
223
|
+
|
|
224
|
+
## List and option labels
|
|
225
|
+
|
|
226
|
+
Lists and options help users scan and select quickly within the bottom sheet.
|
|
227
|
+
|
|
228
|
+
Use these guidelines when writing list content:
|
|
229
|
+
|
|
230
|
+
- Use sentence case (aside from proper nouns)
|
|
231
|
+
- Maintain parallel structure across options
|
|
232
|
+
- Keep labels short and easy to scan
|
|
233
|
+
- Aim for single-line items when possible
|
|
234
|
+
|
|
235
|
+
* **Do:** Prioritize clarity and scannability.
|
|
236
|
+
* **Don't:** Don’t use inconsistent phrasing or overly long labels.
|
|
237
|
+
|
|
238
|
+
## Triggers
|
|
239
|
+
|
|
240
|
+
Triggers are the controls that open the bottom sheet.
|
|
241
|
+
|
|
242
|
+
Use these guidelines when labeling triggers:
|
|
243
|
+
|
|
244
|
+
- Use clear, outcome-based labels (for example, “Sort,” “Filters,” “More”)
|
|
245
|
+
- Ensure the trigger label aligns with the title shown in the sheet
|
|
246
|
+
- Keep labels short and predictable
|
|
247
|
+
|
|
248
|
+
* **Do:** Match the trigger to the task presented in the sheet.
|
|
249
|
+
* **Don't:** Don’t create mismatches between the trigger and the sheet content.
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# Breadcrumbs (https://design.candescent.com/docs/components/breadcrumbs)
|
|
2
|
+
|
|
3
|
+
Resources: [Storybook](https://victorious-wave-0daadf00f.6.azurestaticapps.net/?path=/story/navigation-breadcrumbs--default)
|
|
4
|
+
|
|
5
|
+
A compound component for hierarchical navigation. Compose each segment with `Breadcrumbs.Item`; the final item is always the current page and is not interactive.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { Breadcrumbs } from '@cdx-ui/components';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Basic
|
|
12
|
+
|
|
13
|
+
Add `href` to ancestor items so they can navigate. Wrap your app with `LinkProvider` to connect breadcrumb navigation to your router.
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { Breadcrumbs } from '@cdx-ui/components';
|
|
17
|
+
|
|
18
|
+
export default function BreadcrumbsBasicDemo() {
|
|
19
|
+
return (
|
|
20
|
+
<Breadcrumbs accessibilityLabel="Account navigation">
|
|
21
|
+
<Breadcrumbs.Item href="#home">Home</Breadcrumbs.Item>
|
|
22
|
+
<Breadcrumbs.Item href="#accounts">Accounts</Breadcrumbs.Item>
|
|
23
|
+
<Breadcrumbs.Item>Checking account</Breadcrumbs.Item>
|
|
24
|
+
</Breadcrumbs>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Underlined
|
|
30
|
+
|
|
31
|
+
Set `isUnderlined` to underline interactive ancestor items.
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
import { Breadcrumbs } from '@cdx-ui/components';
|
|
35
|
+
|
|
36
|
+
export default function BreadcrumbsUnderlinedDemo() {
|
|
37
|
+
return (
|
|
38
|
+
<Breadcrumbs isUnderlined accessibilityLabel="Catalog navigation">
|
|
39
|
+
<Breadcrumbs.Item href="#home">Home</Breadcrumbs.Item>
|
|
40
|
+
<Breadcrumbs.Item href="#catalog">Catalog</Breadcrumbs.Item>
|
|
41
|
+
<Breadcrumbs.Item>Product details</Breadcrumbs.Item>
|
|
42
|
+
</Breadcrumbs>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Custom separator
|
|
48
|
+
|
|
49
|
+
Pass text or any React element to `separator`.
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
import { Breadcrumbs } from '@cdx-ui/components';
|
|
53
|
+
|
|
54
|
+
export default function BreadcrumbsCustomSeparatorDemo() {
|
|
55
|
+
return (
|
|
56
|
+
<Breadcrumbs separator="›" accessibilityLabel="Settings navigation">
|
|
57
|
+
<Breadcrumbs.Item href="#home">Home</Breadcrumbs.Item>
|
|
58
|
+
<Breadcrumbs.Item href="#settings">Settings</Breadcrumbs.Item>
|
|
59
|
+
<Breadcrumbs.Item>Security</Breadcrumbs.Item>
|
|
60
|
+
</Breadcrumbs>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## With icons
|
|
66
|
+
|
|
67
|
+
Items accept custom content, including icons and text. A custom icon can also be used as the separator.
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
import { Breadcrumbs, Icon, Text } from '@cdx-ui/components';
|
|
71
|
+
import { ChevronRight, Home, Storefront } from '@cdx-ui/icons';
|
|
72
|
+
|
|
73
|
+
// Interim: an Icon inside Breadcrumbs.Item does not inherit the item's color yet, so the icons set
|
|
74
|
+
// it with `web:text-inherit native:text-content-primary`.
|
|
75
|
+
export default function BreadcrumbsWithIconsDemo() {
|
|
76
|
+
return (
|
|
77
|
+
<Breadcrumbs
|
|
78
|
+
accessibilityLabel="Marketplace navigation"
|
|
79
|
+
separator={
|
|
80
|
+
<Icon
|
|
81
|
+
as={ChevronRight}
|
|
82
|
+
color="tertiary"
|
|
83
|
+
className="size-4"
|
|
84
|
+
accessibilityElementsHidden
|
|
85
|
+
importantForAccessibility="no-hide-descendants"
|
|
86
|
+
/>
|
|
87
|
+
}
|
|
88
|
+
>
|
|
89
|
+
<Breadcrumbs.Item href="#home">
|
|
90
|
+
<Icon
|
|
91
|
+
as={Home}
|
|
92
|
+
className="size-4 web:text-inherit native:text-content-primary"
|
|
93
|
+
accessibilityElementsHidden
|
|
94
|
+
importantForAccessibility="no-hide-descendants"
|
|
95
|
+
/>
|
|
96
|
+
<Text className="text-inherit">Home</Text>
|
|
97
|
+
</Breadcrumbs.Item>
|
|
98
|
+
<Breadcrumbs.Item href="#marketplace">
|
|
99
|
+
<Icon
|
|
100
|
+
as={Storefront}
|
|
101
|
+
className="size-4 web:text-inherit native:text-content-primary"
|
|
102
|
+
accessibilityElementsHidden
|
|
103
|
+
importantForAccessibility="no-hide-descendants"
|
|
104
|
+
/>
|
|
105
|
+
<Text className="text-inherit">Marketplace</Text>
|
|
106
|
+
</Breadcrumbs.Item>
|
|
107
|
+
<Breadcrumbs.Item>Product details</Breadcrumbs.Item>
|
|
108
|
+
</Breadcrumbs>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Disabled
|
|
114
|
+
|
|
115
|
+
Set `isDisabled` to make every ancestor item non-interactive. The final item remains styled as the current page.
|
|
116
|
+
|
|
117
|
+
```tsx
|
|
118
|
+
import { Breadcrumbs } from '@cdx-ui/components';
|
|
119
|
+
|
|
120
|
+
export default function BreadcrumbsDisabledDemo() {
|
|
121
|
+
return (
|
|
122
|
+
<Breadcrumbs isDisabled accessibilityLabel="Disabled account navigation">
|
|
123
|
+
<Breadcrumbs.Item href="#home">Home</Breadcrumbs.Item>
|
|
124
|
+
<Breadcrumbs.Item href="#accounts">Accounts</Breadcrumbs.Item>
|
|
125
|
+
<Breadcrumbs.Item>Checking account</Breadcrumbs.Item>
|
|
126
|
+
</Breadcrumbs>
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## API
|
|
132
|
+
|
|
133
|
+
### Breadcrumbs
|
|
134
|
+
|
|
135
|
+
The navigation landmark and state provider for the breadcrumb trail.
|
|
136
|
+
|
|
137
|
+
| Prop | Type | Default | Description |
|
|
138
|
+
| --- | --- | --- | --- |
|
|
139
|
+
| `className?` | `string` | — | — |
|
|
140
|
+
| `children?` | `ReactNode` | — | — |
|
|
141
|
+
| `separator?` | `ReactNode` | ``/`` | Separator rendered between breadcrumb items. |
|
|
142
|
+
| `isDisabled?` | `boolean` | `false` | When `true`, ancestor items are not interactive and use muted text. The current page keeps its color. |
|
|
143
|
+
| `isUnderlined?` | `boolean` | `false` | When `true`, interactive ancestor items are underlined. |
|
|
144
|
+
| `color?` | `'neutral' \| 'action' \| 'danger' \| 'warning' \| 'success' \| 'info'` | `'neutral'` | Semantic color for ancestor items. `neutral` uses the standard text hierarchy. |
|
|
145
|
+
|
|
146
|
+
Inherits all [`ViewProps`](https://reactnative.dev/docs/view#props).
|
|
147
|
+
|
|
148
|
+
## Sub-components
|
|
149
|
+
|
|
150
|
+
### Breadcrumbs.Item
|
|
151
|
+
|
|
152
|
+
A segment in the trail. Ancestor items with an `href` are interactive. The final item is always rendered as the non-interactive current page, even when it receives an `href`.
|
|
153
|
+
|
|
154
|
+
| Prop | Type | Default | Description |
|
|
155
|
+
| --- | --- | --- | --- |
|
|
156
|
+
| `className?` | `string` | — | — |
|
|
157
|
+
| `children?` | `ReactNode` | — | — |
|
|
158
|
+
| `href?` | `string` | — | URL or route path opened on press. Omit when the link only runs `onPress`. |
|
|
159
|
+
| `action?` | `'navigate' \| 'push' \| 'replace'` | — | Navigation action forwarded to the `LinkProvider`. Defaults to `'navigate'`. |
|
|
160
|
+
| `isVisited?` | `boolean` | — | If true, the link will render in its visited style (native). On web, visited styling is driven by the CSS `:visited` pseudo-class. |
|
|
161
|
+
| `webProps?` | `React.AnchorHTMLAttributes<HTMLAnchorElement>` | — | HTML anchor attributes applied only on web. Ignored on native platforms. `target`, `rel`, and `download` are forwarded via react-native-web's `hrefAttrs`. |
|
|
162
|
+
|
|
163
|
+
Inherits all [`PressableProps`](https://reactnative.dev/docs/pressable#props) used by interactive ancestor items.
|
|
164
|
+
|
|
165
|
+
## Accessibility
|
|
166
|
+
|
|
167
|
+
On web, `Breadcrumbs` renders a named `navigation` landmark. Its `accessibilityLabel` defaults to "Breadcrumb".
|
|
168
|
+
|
|
169
|
+
Separators are hidden from assistive technologies. The final item receives `aria-current="page"` on web and `accessibilityState.selected` on native platforms.
|