@cdx-ui/components 0.2.4 → 0.3.0
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/docs/components/accordion/content.md +2 -2
- package/docs/components/alert/content.md +1 -1
- package/docs/components/badge/content.md +5 -15
- package/docs/components/bottom-sheet/content.md +18 -14
- package/docs/components/box/content.md +141 -0
- package/docs/components/breadcrumbs/content.md +9 -9
- package/docs/components/button/content.md +19 -19
- package/docs/components/calendar/content.md +25 -1
- package/docs/components/card/content.md +2 -2
- package/docs/components/carousel/content.md +9 -8
- package/docs/components/chip/content.md +1 -1
- package/docs/components/color-area/content.md +3 -5
- package/docs/components/color-field/content.md +3 -5
- package/docs/components/color-picker/content.md +5 -4
- package/docs/components/color-slider/content.md +3 -5
- package/docs/components/color-swatch/content.md +3 -5
- package/docs/components/color-swatch-picker/content.md +3 -5
- package/docs/components/content.md +10 -9
- package/docs/components/data-grid/content.md +10 -11
- package/docs/components/drawer/content.md +17 -25
- package/docs/components/full-screen-dialog/content.md +2 -2
- package/docs/components/icon/content.md +1 -1
- package/docs/components/icon-button/content.md +3 -3
- package/docs/components/input/content.md +65 -0
- package/docs/components/list-item/content.md +9 -9
- package/docs/components/menu/content.md +57 -50
- package/docs/components/month-calendar/content.md +2 -0
- package/docs/components/range-calendar/content.md +3 -1
- package/docs/components/reorderable-list/content.md +5 -3
- package/docs/components/scoped-theme/content.md +1 -1
- package/docs/components/scroll-shadow/content.md +43 -36
- package/docs/components/select/content.md +80 -7
- package/docs/components/skeleton/content.md +7 -6
- package/docs/components/table/content.md +2 -2
- package/docs/components/tabs/content.md +14 -9
- package/docs/components/tile/content.md +9 -10
- package/docs/components/toggle-button/content.md +1 -1
- package/docs/components/tooltip/content.md +9 -9
- package/docs/components/virtualized-list/content.md +14 -14
- package/docs/getting-started/developers/content.md +2 -2
- package/docs/getting-started/developers/styling/content.md +20 -18
- package/docs/llms.txt +12 -9
- package/docs/patterns/authentication/content.md +4 -6
- package/docs/patterns/dashboard/content.md +8 -13
- package/docs/patterns/empty-states/content.md +7 -6
- package/docs/patterns/forms/content.md +6 -7
- package/docs/patterns/onboarding/content.md +4 -4
- package/docs/patterns/settings/content.md +5 -5
- package/docs/resources/release-notes/0.2.4/content.md +17 -0
- package/docs/resources/release-notes/0.2.5/content.md +25 -0
- package/docs/resources/release-notes/content.md +2 -0
- package/lib/commonjs/components/BottomSheet/index.js +25 -1
- package/lib/commonjs/components/BottomSheet/index.js.map +1 -1
- package/lib/commonjs/components/BottomSheet/styles.js +8 -2
- package/lib/commonjs/components/BottomSheet/styles.js.map +1 -1
- package/lib/commonjs/components/Box/Box.js +9 -1
- package/lib/commonjs/components/Box/Box.js.map +1 -1
- package/lib/commonjs/components/Breadcrumbs/index.js +28 -3
- package/lib/commonjs/components/Breadcrumbs/index.js.map +1 -1
- package/lib/commonjs/components/Breadcrumbs/styles.js +27 -0
- package/lib/commonjs/components/Breadcrumbs/styles.js.map +1 -1
- package/lib/commonjs/components/Calendar/CalendarMonthHeader.js +15 -5
- package/lib/commonjs/components/Calendar/CalendarMonthHeader.js.map +1 -1
- package/lib/commonjs/components/Calendar/CalendarYearList.js +116 -0
- package/lib/commonjs/components/Calendar/CalendarYearList.js.map +1 -0
- package/lib/commonjs/components/Calendar/CalendarYearPickerGrid.js +58 -31
- package/lib/commonjs/components/Calendar/CalendarYearPickerGrid.js.map +1 -1
- package/lib/commonjs/components/Calendar/flashCalendarAdapter.js +22 -3
- package/lib/commonjs/components/Calendar/flashCalendarAdapter.js.map +1 -1
- package/lib/commonjs/components/Calendar/index.js +6 -2
- package/lib/commonjs/components/Calendar/index.js.map +1 -1
- package/lib/commonjs/components/Calendar/styles.js +16 -2
- package/lib/commonjs/components/Calendar/styles.js.map +1 -1
- package/lib/commonjs/components/MonthCalendar/index.js +39 -13
- package/lib/commonjs/components/MonthCalendar/index.js.map +1 -1
- package/lib/commonjs/components/RangeCalendar/index.js +6 -2
- package/lib/commonjs/components/RangeCalendar/index.js.map +1 -1
- package/lib/commonjs/components/Stack/HStack.js +6 -2
- package/lib/commonjs/components/Stack/HStack.js.map +1 -1
- package/lib/commonjs/components/Stack/VStack.js +6 -2
- package/lib/commonjs/components/Stack/VStack.js.map +1 -1
- package/lib/commonjs/index.js +10 -10
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/components/BottomSheet/index.js +27 -3
- package/lib/module/components/BottomSheet/index.js.map +1 -1
- package/lib/module/components/BottomSheet/styles.js +8 -2
- package/lib/module/components/BottomSheet/styles.js.map +1 -1
- package/lib/module/components/Box/Box.js +9 -1
- package/lib/module/components/Box/Box.js.map +1 -1
- package/lib/module/components/Breadcrumbs/index.js +29 -4
- package/lib/module/components/Breadcrumbs/index.js.map +1 -1
- package/lib/module/components/Breadcrumbs/styles.js +26 -0
- package/lib/module/components/Breadcrumbs/styles.js.map +1 -1
- package/lib/module/components/Calendar/CalendarMonthHeader.js +15 -5
- package/lib/module/components/Calendar/CalendarMonthHeader.js.map +1 -1
- package/lib/module/components/Calendar/CalendarYearList.js +112 -0
- package/lib/module/components/Calendar/CalendarYearList.js.map +1 -0
- package/lib/module/components/Calendar/CalendarYearPickerGrid.js +61 -34
- package/lib/module/components/Calendar/CalendarYearPickerGrid.js.map +1 -1
- package/lib/module/components/Calendar/flashCalendarAdapter.js +20 -2
- package/lib/module/components/Calendar/flashCalendarAdapter.js.map +1 -1
- package/lib/module/components/Calendar/index.js +7 -3
- package/lib/module/components/Calendar/index.js.map +1 -1
- package/lib/module/components/Calendar/styles.js +15 -1
- package/lib/module/components/Calendar/styles.js.map +1 -1
- package/lib/module/components/MonthCalendar/index.js +42 -15
- package/lib/module/components/MonthCalendar/index.js.map +1 -1
- package/lib/module/components/RangeCalendar/index.js +7 -3
- package/lib/module/components/RangeCalendar/index.js.map +1 -1
- package/lib/module/components/Stack/HStack.js +6 -2
- package/lib/module/components/Stack/HStack.js.map +1 -1
- package/lib/module/components/Stack/VStack.js +6 -2
- package/lib/module/components/Stack/VStack.js.map +1 -1
- package/lib/module/index.js +6 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/animation/hooks/usePopupDialogContentAnimation.d.ts +2 -2
- package/lib/typescript/animation/hooks/usePopupOverlayAnimation.d.ts +2 -2
- package/lib/typescript/components/BottomSheet/index.d.ts +8 -0
- package/lib/typescript/components/BottomSheet/index.d.ts.map +1 -1
- package/lib/typescript/components/BottomSheet/styles.d.ts +5 -1
- package/lib/typescript/components/BottomSheet/styles.d.ts.map +1 -1
- package/lib/typescript/components/Box/Box.d.ts +4 -0
- package/lib/typescript/components/Box/Box.d.ts.map +1 -1
- package/lib/typescript/components/Breadcrumbs/index.d.ts +3 -1
- package/lib/typescript/components/Breadcrumbs/index.d.ts.map +1 -1
- package/lib/typescript/components/Breadcrumbs/styles.d.ts +2 -0
- package/lib/typescript/components/Breadcrumbs/styles.d.ts.map +1 -1
- package/lib/typescript/components/Calendar/CalendarMonthHeader.d.ts.map +1 -1
- package/lib/typescript/components/Calendar/CalendarYearList.d.ts +23 -0
- package/lib/typescript/components/Calendar/CalendarYearList.d.ts.map +1 -0
- package/lib/typescript/components/Calendar/CalendarYearPickerGrid.d.ts +5 -1
- package/lib/typescript/components/Calendar/CalendarYearPickerGrid.d.ts.map +1 -1
- package/lib/typescript/components/Calendar/flashCalendarAdapter.d.ts +8 -0
- package/lib/typescript/components/Calendar/flashCalendarAdapter.d.ts.map +1 -1
- package/lib/typescript/components/Calendar/index.d.ts.map +1 -1
- package/lib/typescript/components/Calendar/styles.d.ts +7 -1
- package/lib/typescript/components/Calendar/styles.d.ts.map +1 -1
- package/lib/typescript/components/MonthCalendar/index.d.ts.map +1 -1
- package/lib/typescript/components/RangeCalendar/index.d.ts.map +1 -1
- package/lib/typescript/components/Stack/HStack.d.ts +3 -2
- package/lib/typescript/components/Stack/HStack.d.ts.map +1 -1
- package/lib/typescript/components/Stack/VStack.d.ts +3 -2
- package/lib/typescript/components/Stack/VStack.d.ts.map +1 -1
- package/lib/typescript/components/Toast/animation.d.ts +3 -3
- package/lib/typescript/components/Toast/animation.d.ts.map +1 -1
- package/lib/typescript/components/ToggleButton/styles.d.ts +1 -1
- package/lib/typescript/index.d.ts +6 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/components/BottomSheet/index.tsx +174 -138
- package/src/components/BottomSheet/styles.ts +11 -3
- package/src/components/Box/Box.tsx +18 -4
- package/src/components/Breadcrumbs/index.tsx +28 -4
- package/src/components/Breadcrumbs/styles.ts +30 -0
- package/src/components/Calendar/CalendarMonthHeader.tsx +29 -22
- package/src/components/Calendar/CalendarYearList.tsx +136 -0
- package/src/components/Calendar/CalendarYearPickerGrid.tsx +60 -33
- package/src/components/Calendar/flashCalendarAdapter.ts +27 -2
- package/src/components/Calendar/index.tsx +8 -3
- package/src/components/Calendar/styles.ts +17 -1
- package/src/components/MonthCalendar/index.tsx +55 -33
- package/src/components/RangeCalendar/index.tsx +8 -3
- package/src/components/Stack/HStack.tsx +8 -4
- package/src/components/Stack/VStack.tsx +8 -4
- package/src/index.ts +8 -1
|
@@ -161,7 +161,7 @@ export default function AccordionFullBleedDemo() {
|
|
|
161
161
|
return (
|
|
162
162
|
<Card className="w-full max-w-md">
|
|
163
163
|
<Card.Header>
|
|
164
|
-
<VStack
|
|
164
|
+
<VStack space="xs">
|
|
165
165
|
<Text size="sm" color="secondary">
|
|
166
166
|
Upcoming payment
|
|
167
167
|
</Text>
|
|
@@ -242,7 +242,7 @@ export default function AccordionFullBleedDemo() {
|
|
|
242
242
|
</VStack>
|
|
243
243
|
</Card.Content>
|
|
244
244
|
<Card.Footer>
|
|
245
|
-
<Button
|
|
245
|
+
<Button fullWidth>
|
|
246
246
|
<Button.Label>Review payment</Button.Label>
|
|
247
247
|
</Button>
|
|
248
248
|
</Card.Footer>
|
|
@@ -28,7 +28,7 @@ export default function BadgeBasicDemo() {
|
|
|
28
28
|
</Avatar>
|
|
29
29
|
</Badge>
|
|
30
30
|
<Badge label="New" color="info" overlap="rectangular">
|
|
31
|
-
<Button variant="outline"
|
|
31
|
+
<Button variant="outline">
|
|
32
32
|
<Button.Label>Inbox</Button.Label>
|
|
33
33
|
</Button>
|
|
34
34
|
</Badge>
|
|
@@ -113,12 +113,7 @@ export default function BadgeWithIconDemo() {
|
|
|
113
113
|
</Avatar>
|
|
114
114
|
</Badge>
|
|
115
115
|
<Badge icon={Check} color="action" overlap="circular">
|
|
116
|
-
<IconButton
|
|
117
|
-
as={Notifications}
|
|
118
|
-
variant="subtle"
|
|
119
|
-
color="neutral"
|
|
120
|
-
accessibilityLabel="Notifications"
|
|
121
|
-
/>
|
|
116
|
+
<IconButton as={Notifications} variant="subtle" accessibilityLabel="Notifications" />
|
|
122
117
|
</Badge>
|
|
123
118
|
</Box>
|
|
124
119
|
);
|
|
@@ -176,22 +171,17 @@ export default function BadgeOverlapDemo() {
|
|
|
176
171
|
</Avatar>
|
|
177
172
|
</Badge>
|
|
178
173
|
<Badge label={5} color="danger" overlap="circular" accessibilityLabel="5 notifications">
|
|
179
|
-
<IconButton
|
|
180
|
-
as={Notifications}
|
|
181
|
-
variant="subtle"
|
|
182
|
-
color="neutral"
|
|
183
|
-
accessibilityLabel="Notifications"
|
|
184
|
-
/>
|
|
174
|
+
<IconButton as={Notifications} variant="subtle" accessibilityLabel="Notifications" />
|
|
185
175
|
</Badge>
|
|
186
176
|
</Box>
|
|
187
177
|
<Box className="flex-row flex-wrap items-center gap-6">
|
|
188
178
|
<Badge label={5} color="danger" overlap="rectangular" accessibilityLabel="5 notifications">
|
|
189
|
-
<Button variant="outline"
|
|
179
|
+
<Button variant="outline">
|
|
190
180
|
<Button.Label>Inbox</Button.Label>
|
|
191
181
|
</Button>
|
|
192
182
|
</Badge>
|
|
193
183
|
<Badge label="New" color="info" overlap="rectangular">
|
|
194
|
-
<Button
|
|
184
|
+
<Button>
|
|
195
185
|
<Button.Label>Updates</Button.Label>
|
|
196
186
|
</Button>
|
|
197
187
|
</Badge>
|
|
@@ -25,7 +25,7 @@ export default function BottomSheetBasicDemo() {
|
|
|
25
25
|
|
|
26
26
|
return (
|
|
27
27
|
<BottomSheetDemoFrame>
|
|
28
|
-
<Button
|
|
28
|
+
<Button onPress={present}>
|
|
29
29
|
<Button.Label>Open sheet</Button.Label>
|
|
30
30
|
</Button>
|
|
31
31
|
<BottomSheet.Modal ref={ref}>
|
|
@@ -56,14 +56,14 @@ export default function BottomSheetWithFooterDemo() {
|
|
|
56
56
|
|
|
57
57
|
return (
|
|
58
58
|
<BottomSheetDemoFrame>
|
|
59
|
-
<Button
|
|
59
|
+
<Button onPress={present}>
|
|
60
60
|
<Button.Label>Open sheet</Button.Label>
|
|
61
61
|
</Button>
|
|
62
62
|
<BottomSheet.Modal
|
|
63
63
|
ref={ref}
|
|
64
64
|
footer={
|
|
65
65
|
<BottomSheet.Footer>
|
|
66
|
-
<Button
|
|
66
|
+
<Button onPress={dismiss}>
|
|
67
67
|
<Button.Label>Confirm</Button.Label>
|
|
68
68
|
</Button>
|
|
69
69
|
</BottomSheet.Footer>
|
|
@@ -96,10 +96,10 @@ export default function BottomSheetHeaderVariantsDemo() {
|
|
|
96
96
|
return (
|
|
97
97
|
<BottomSheetDemoFrame>
|
|
98
98
|
<Box className="flex-row gap-3">
|
|
99
|
-
<Button variant="outline"
|
|
99
|
+
<Button variant="outline" onPress={presentBasic}>
|
|
100
100
|
<Button.Label>Title + close</Button.Label>
|
|
101
101
|
</Button>
|
|
102
|
-
<Button variant="outline"
|
|
102
|
+
<Button variant="outline" onPress={presentFull}>
|
|
103
103
|
<Button.Label>Back + subtitle</Button.Label>
|
|
104
104
|
</Button>
|
|
105
105
|
</Box>
|
|
@@ -134,7 +134,7 @@ export default function BottomSheetHeaderVariantsDemo() {
|
|
|
134
134
|
## Scrollable content
|
|
135
135
|
|
|
136
136
|
```tsx
|
|
137
|
-
import { BottomSheet,
|
|
137
|
+
import { BottomSheet, Button, ListItem, useBottomSheet } from '@cdx-ui/components';
|
|
138
138
|
import { BottomSheetDemoFrame } from './_frame';
|
|
139
139
|
|
|
140
140
|
const ITEMS = Array.from({ length: 12 }, (_, i) => ({
|
|
@@ -147,7 +147,7 @@ export default function BottomSheetScrollableDemo() {
|
|
|
147
147
|
|
|
148
148
|
return (
|
|
149
149
|
<BottomSheetDemoFrame>
|
|
150
|
-
<Button
|
|
150
|
+
<Button onPress={present}>
|
|
151
151
|
<Button.Label>Scrollable content</Button.Label>
|
|
152
152
|
</Button>
|
|
153
153
|
<BottomSheet.Modal
|
|
@@ -156,7 +156,7 @@ export default function BottomSheetScrollableDemo() {
|
|
|
156
156
|
enableDynamicSizing={false}
|
|
157
157
|
footer={
|
|
158
158
|
<BottomSheet.Footer>
|
|
159
|
-
<Button
|
|
159
|
+
<Button onPress={dismiss}>
|
|
160
160
|
<Button.Label>Done</Button.Label>
|
|
161
161
|
</Button>
|
|
162
162
|
</BottomSheet.Footer>
|
|
@@ -166,9 +166,11 @@ export default function BottomSheetScrollableDemo() {
|
|
|
166
166
|
<BottomSheet.ScrollView style={{ flex: 1 }} contentContainerStyle={{ flexGrow: 1 }}>
|
|
167
167
|
<BottomSheet.Content>
|
|
168
168
|
{ITEMS.map((item) => (
|
|
169
|
-
<
|
|
170
|
-
<
|
|
171
|
-
|
|
169
|
+
<ListItem key={item.id}>
|
|
170
|
+
<ListItem.Content>
|
|
171
|
+
<ListItem.Title>{item.label}</ListItem.Title>
|
|
172
|
+
</ListItem.Content>
|
|
173
|
+
</ListItem>
|
|
172
174
|
))}
|
|
173
175
|
</BottomSheet.Content>
|
|
174
176
|
</BottomSheet.ScrollView>
|
|
@@ -191,7 +193,7 @@ export default function BottomSheetSnapPointsDemo() {
|
|
|
191
193
|
|
|
192
194
|
return (
|
|
193
195
|
<BottomSheetDemoFrame>
|
|
194
|
-
<Button
|
|
196
|
+
<Button onPress={present}>
|
|
195
197
|
<Button.Label>Fixed snap points</Button.Label>
|
|
196
198
|
</Button>
|
|
197
199
|
<BottomSheet.Modal
|
|
@@ -200,7 +202,7 @@ export default function BottomSheetSnapPointsDemo() {
|
|
|
200
202
|
enableDynamicSizing={false}
|
|
201
203
|
footer={
|
|
202
204
|
<BottomSheet.Footer>
|
|
203
|
-
<Button
|
|
205
|
+
<Button onPress={dismiss}>
|
|
204
206
|
<Button.Label>Close</Button.Label>
|
|
205
207
|
</Button>
|
|
206
208
|
</BottomSheet.Footer>
|
|
@@ -232,7 +234,7 @@ export default function BottomSheetHandleHiddenDemo() {
|
|
|
232
234
|
|
|
233
235
|
return (
|
|
234
236
|
<BottomSheetDemoFrame>
|
|
235
|
-
<Button
|
|
237
|
+
<Button onPress={present}>
|
|
236
238
|
<Button.Label>No drag handle</Button.Label>
|
|
237
239
|
</Button>
|
|
238
240
|
<BottomSheet.Modal ref={ref} handleVisible={false}>
|
|
@@ -259,6 +261,7 @@ export default function BottomSheetHandleHiddenDemo() {
|
|
|
259
261
|
| --- | --- | --- | --- |
|
|
260
262
|
| `handleVisible?` | `boolean` | `true` | Show the drag handle indicator. When false, `handleComponent` is set to null. |
|
|
261
263
|
| `footer?` | `React.ReactNode` | — | Footer content rendered via gorhom's BottomSheetFooter for animated positioning and safe-area handling. Pass it through this prop; a footer placed as a child does not animate with the sheet. |
|
|
264
|
+
| `fullBleed?` | `boolean \| null` | — | Removes `BottomSheet.Content`'s horizontal padding so content can span the sheet edge to edge. `BottomSheet.Content` inherits this unless it sets its own `fullBleed`. The footer keeps its padding. |
|
|
262
265
|
|
|
263
266
|
Also accepts all props from `@gorhom/bottom-sheet`'s `BottomSheetModal` including `snapPoints`, `enableDynamicSizing`, `onDismiss`, and `onChange`.
|
|
264
267
|
|
|
@@ -282,6 +285,7 @@ Also accepts all props from `@gorhom/bottom-sheet`'s `BottomSheetModal` includin
|
|
|
282
285
|
| `children?` | `React.ReactNode` | — | — |
|
|
283
286
|
| `className?` | `string` | — | — |
|
|
284
287
|
| `hasSafeAreaInset?` | `boolean` | — | Adds bottom padding equal to the safe-area inset. |
|
|
288
|
+
| `fullBleed?` | `boolean \| null` | — | Removes horizontal padding. Inherits the parent `BottomSheet.Modal`'s `fullBleed` when omitted. |
|
|
285
289
|
| `style?` | `ViewStyle` | — | — |
|
|
286
290
|
|
|
287
291
|
### BottomSheet.Footer
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# Box (https://design.candescent.com/docs/components/box)
|
|
2
|
+
|
|
3
|
+
Resources: [Storybook](https://victorious-wave-0daadf00f.6.azurestaticapps.net/?path=/story/layout-box--default)
|
|
4
|
+
|
|
5
|
+
`Box` groups and lays out content on every platform. Use it wherever you would reach for a `View` or `div`.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { Box } from '@cdx-ui/components';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Basic
|
|
12
|
+
|
|
13
|
+
Use `Box` with layout classes, spacing-scale padding and a semantic surface background to build a section of a screen. For rows and columns with a token gap, use [`HStack` and `VStack`](https://design.candescent.com/docs/components/stack/content.md).
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { Box, Heading, Text } from '@cdx-ui/components';
|
|
17
|
+
|
|
18
|
+
export default function BoxBasicDemo() {
|
|
19
|
+
return (
|
|
20
|
+
<Box className="w-full max-w-sm gap-1 bg-surface-secondary p-4">
|
|
21
|
+
<Heading size="sm">Everyday Checking</Heading>
|
|
22
|
+
<Text color="secondary">Available balance $2,481.06</Text>
|
|
23
|
+
</Box>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Semantic elements
|
|
29
|
+
|
|
30
|
+
Set `role` to render a semantic element on web. Native platforms expose the same role to assistive technology and render a view.
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
import { Box, Link } from '@cdx-ui/components';
|
|
34
|
+
|
|
35
|
+
const LINKS = [
|
|
36
|
+
{ label: 'Accounts', href: 'https://example.com/accounts' },
|
|
37
|
+
{ label: 'Transfers', href: 'https://example.com/transfers' },
|
|
38
|
+
{ label: 'Statements', href: 'https://example.com/statements' },
|
|
39
|
+
] as const;
|
|
40
|
+
|
|
41
|
+
export default function BoxSemanticElementsDemo() {
|
|
42
|
+
return (
|
|
43
|
+
<Box role="navigation" aria-label="Banking">
|
|
44
|
+
<Box role="list" className="flex-row gap-6">
|
|
45
|
+
{LINKS.map((link) => (
|
|
46
|
+
<Box key={link.label} role="listitem">
|
|
47
|
+
<Link href={link.href}>
|
|
48
|
+
<Link.Label>{link.label}</Link.Label>
|
|
49
|
+
</Link>
|
|
50
|
+
</Box>
|
|
51
|
+
))}
|
|
52
|
+
</Box>
|
|
53
|
+
</Box>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
| `role` | Web element |
|
|
59
|
+
| --------------- | ----------- |
|
|
60
|
+
| `article` | `<article>` |
|
|
61
|
+
| `banner` | `<header>` |
|
|
62
|
+
| `complementary` | `<aside>` |
|
|
63
|
+
| `contentinfo` | `<footer>` |
|
|
64
|
+
| `figure` | `<figure>` |
|
|
65
|
+
| `form` | `<form>` |
|
|
66
|
+
| `list` | `<ul>` |
|
|
67
|
+
| `listitem` | `<li>` |
|
|
68
|
+
| `main` | `<main>` |
|
|
69
|
+
| `navigation` | `<nav>` |
|
|
70
|
+
| `region` | `<section>` |
|
|
71
|
+
|
|
72
|
+
Any other role, or no role, renders a `<div>`. For headings and text use [`Heading`](https://design.candescent.com/docs/components/heading/content.md) and [`Text`](https://design.candescent.com/docs/components/text/content.md), not a `Box` with a text role.
|
|
73
|
+
|
|
74
|
+
## As child
|
|
75
|
+
|
|
76
|
+
Set `asChild` to apply Box's props to its only child instead of rendering another view. Here a `ScrollView` takes the Box's role, label and layout classes.
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
import { Box, HStack, ScrollView, Text } from '@cdx-ui/components';
|
|
80
|
+
|
|
81
|
+
const TRANSACTIONS = [
|
|
82
|
+
{ label: 'Springfield Electric', amount: '−$84.12' },
|
|
83
|
+
{ label: 'Payroll deposit', amount: '+$2,150.00' },
|
|
84
|
+
{ label: 'Corner Market', amount: '−$23.47' },
|
|
85
|
+
{ label: 'Transfer to Savings', amount: '−$200.00' },
|
|
86
|
+
{ label: 'City Water', amount: '−$41.90' },
|
|
87
|
+
{ label: 'Coffee House', amount: '−$5.25' },
|
|
88
|
+
] as const;
|
|
89
|
+
|
|
90
|
+
export default function BoxAsChildDemo() {
|
|
91
|
+
return (
|
|
92
|
+
<Box
|
|
93
|
+
asChild
|
|
94
|
+
role="region"
|
|
95
|
+
aria-label="Recent transactions"
|
|
96
|
+
className="h-40 w-full max-w-sm bg-surface-secondary"
|
|
97
|
+
>
|
|
98
|
+
<ScrollView contentContainerClassName="gap-3 p-4">
|
|
99
|
+
{TRANSACTIONS.map((transaction) => (
|
|
100
|
+
<HStack key={transaction.label} className="justify-between">
|
|
101
|
+
<Text>{transaction.label}</Text>
|
|
102
|
+
<Text color="secondary">{transaction.amount}</Text>
|
|
103
|
+
</HStack>
|
|
104
|
+
))}
|
|
105
|
+
</ScrollView>
|
|
106
|
+
</Box>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## API
|
|
112
|
+
|
|
113
|
+
### Box
|
|
114
|
+
|
|
115
|
+
| Prop | Type | Default | Description |
|
|
116
|
+
| --- | --- | --- | --- |
|
|
117
|
+
| `className?` | `string` | — | — |
|
|
118
|
+
| `children?` | `React.ReactNode` | — | — |
|
|
119
|
+
| `asChild?` | `boolean` | — | Renders the child element in place of the default `View`, merging Box's props onto it. |
|
|
120
|
+
|
|
121
|
+
Inherits all [`ViewProps`](https://reactnative.dev/docs/view#props). Every `ViewProps` prop and the `ref` pass through to the rendered view unchanged. Type a ref with `BoxRef`:
|
|
122
|
+
|
|
123
|
+
```tsx
|
|
124
|
+
import { Box, type BoxRef } from '@cdx-ui/components';
|
|
125
|
+
|
|
126
|
+
const ref = useRef<BoxRef>(null);
|
|
127
|
+
|
|
128
|
+
<Box ref={ref} />;
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Anatomy
|
|
132
|
+
|
|
133
|
+
| `data-slot` | Element |
|
|
134
|
+
| ----------- | ------- |
|
|
135
|
+
| `box` | Root |
|
|
136
|
+
|
|
137
|
+
## Accessibility
|
|
138
|
+
|
|
139
|
+
`Box` sets no role and adds no keyboard, focus or labeling behavior. Accessibility props such as `role`, `aria-label`, `accessibilityLabel` and `importantForAccessibility` pass through to the rendered view.
|
|
140
|
+
|
|
141
|
+
Give a landmark role (`navigation`, `region`, `complementary`) an `aria-label` when the page has more than one landmark of that type, so screen-reader users can tell them apart.
|
|
@@ -65,13 +65,14 @@ export default function BreadcrumbsCustomSeparatorDemo() {
|
|
|
65
65
|
## With icons
|
|
66
66
|
|
|
67
67
|
Items accept custom content, including icons and text. A custom icon can also be used as the separator.
|
|
68
|
+
An `Icon` or `Text` placed directly in an item follows the item's color in every state (ancestor, hover,
|
|
69
|
+
current page, disabled), and one passed as `separator` follows the separator color, so neither needs color
|
|
70
|
+
classes. Set `color` on it to override.
|
|
68
71
|
|
|
69
72
|
```tsx
|
|
70
73
|
import { Breadcrumbs, Icon, Text } from '@cdx-ui/components';
|
|
71
74
|
import { ChevronRight, Home, Storefront } from '@cdx-ui/icons';
|
|
72
75
|
|
|
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
76
|
export default function BreadcrumbsWithIconsDemo() {
|
|
76
77
|
return (
|
|
77
78
|
<Breadcrumbs
|
|
@@ -79,7 +80,6 @@ export default function BreadcrumbsWithIconsDemo() {
|
|
|
79
80
|
separator={
|
|
80
81
|
<Icon
|
|
81
82
|
as={ChevronRight}
|
|
82
|
-
color="tertiary"
|
|
83
83
|
className="size-4"
|
|
84
84
|
accessibilityElementsHidden
|
|
85
85
|
importantForAccessibility="no-hide-descendants"
|
|
@@ -89,20 +89,20 @@ export default function BreadcrumbsWithIconsDemo() {
|
|
|
89
89
|
<Breadcrumbs.Item href="#home">
|
|
90
90
|
<Icon
|
|
91
91
|
as={Home}
|
|
92
|
-
className="size-4
|
|
92
|
+
className="size-4"
|
|
93
93
|
accessibilityElementsHidden
|
|
94
94
|
importantForAccessibility="no-hide-descendants"
|
|
95
95
|
/>
|
|
96
|
-
<Text
|
|
96
|
+
<Text>Home</Text>
|
|
97
97
|
</Breadcrumbs.Item>
|
|
98
98
|
<Breadcrumbs.Item href="#marketplace">
|
|
99
99
|
<Icon
|
|
100
100
|
as={Storefront}
|
|
101
|
-
className="size-4
|
|
101
|
+
className="size-4"
|
|
102
102
|
accessibilityElementsHidden
|
|
103
103
|
importantForAccessibility="no-hide-descendants"
|
|
104
104
|
/>
|
|
105
|
-
<Text
|
|
105
|
+
<Text>Marketplace</Text>
|
|
106
106
|
</Breadcrumbs.Item>
|
|
107
107
|
<Breadcrumbs.Item>Product details</Breadcrumbs.Item>
|
|
108
108
|
</Breadcrumbs>
|
|
@@ -138,7 +138,7 @@ The navigation landmark and state provider for the breadcrumb trail.
|
|
|
138
138
|
| --- | --- | --- | --- |
|
|
139
139
|
| `className?` | `string` | — | — |
|
|
140
140
|
| `children?` | `ReactNode` | — | — |
|
|
141
|
-
| `separator?` | `ReactNode` | ``/`` | Separator rendered between breadcrumb items. |
|
|
141
|
+
| `separator?` | `ReactNode` | ``/`` | Separator rendered between breadcrumb items. A direct `Icon` or `Text` child takes the separator color unless it sets `color`. |
|
|
142
142
|
| `isDisabled?` | `boolean` | `false` | When `true`, ancestor items are not interactive and use muted text. The current page keeps its color. |
|
|
143
143
|
| `isUnderlined?` | `boolean` | `false` | When `true`, interactive ancestor items are underlined. |
|
|
144
144
|
| `color?` | `'neutral' \| 'action' \| 'danger' \| 'warning' \| 'success' \| 'info'` | `'neutral'` | Semantic color for ancestor items. `neutral` uses the standard text hierarchy. |
|
|
@@ -154,7 +154,7 @@ A segment in the trail. Ancestor items with an `href` are interactive. The final
|
|
|
154
154
|
| Prop | Type | Default | Description |
|
|
155
155
|
| --- | --- | --- | --- |
|
|
156
156
|
| `className?` | `string` | — | — |
|
|
157
|
-
| `children?` | `ReactNode` | — |
|
|
157
|
+
| `children?` | `ReactNode` | — | Item content. A direct `Icon` or `Text` child takes the item's state color unless it sets `color`. |
|
|
158
158
|
| `href?` | `string` | — | URL or route path opened on press. Omit when the link only runs `onPress`. |
|
|
159
159
|
| `action?` | `'navigate' \| 'push' \| 'replace'` | — | Navigation action forwarded to the `LinkProvider`. Defaults to `'navigate'`. |
|
|
160
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. |
|
|
@@ -38,19 +38,19 @@ import { Button, Box } from '@cdx-ui/components';
|
|
|
38
38
|
export default function ButtonSolidDemo() {
|
|
39
39
|
return (
|
|
40
40
|
<Box className="flex-row gap-4">
|
|
41
|
-
<Button
|
|
41
|
+
<Button color="action">
|
|
42
42
|
<Button.Label>Action</Button.Label>
|
|
43
43
|
</Button>
|
|
44
|
-
<Button
|
|
44
|
+
<Button color="danger">
|
|
45
45
|
<Button.Label>Danger</Button.Label>
|
|
46
46
|
</Button>
|
|
47
|
-
<Button
|
|
47
|
+
<Button color="warning">
|
|
48
48
|
<Button.Label>Warning</Button.Label>
|
|
49
49
|
</Button>
|
|
50
|
-
<Button
|
|
50
|
+
<Button color="success">
|
|
51
51
|
<Button.Label>Success</Button.Label>
|
|
52
52
|
</Button>
|
|
53
|
-
<Button
|
|
53
|
+
<Button color="info">
|
|
54
54
|
<Button.Label>Info</Button.Label>
|
|
55
55
|
</Button>
|
|
56
56
|
</Box>
|
|
@@ -123,10 +123,10 @@ export default function ButtonSizeDemo() {
|
|
|
123
123
|
return (
|
|
124
124
|
<Box className="flex-row gap-4">
|
|
125
125
|
<Box className="flex-col gap-4">
|
|
126
|
-
<Button
|
|
126
|
+
<Button size="default">
|
|
127
127
|
<Button.Label>Default</Button.Label>
|
|
128
128
|
</Button>
|
|
129
|
-
<Button
|
|
129
|
+
<Button size="small">
|
|
130
130
|
<Button.Label>Small</Button.Label>
|
|
131
131
|
</Button>
|
|
132
132
|
</Box>
|
|
@@ -154,12 +154,12 @@ export default function ButtonSizeDemo() {
|
|
|
154
154
|
## With icons
|
|
155
155
|
|
|
156
156
|
```tsx
|
|
157
|
-
import {
|
|
157
|
+
import { Box, Button } from '@cdx-ui/components';
|
|
158
158
|
import { AddIcon, DeleteIcon, SendIcon } from '@cdx-ui/icons';
|
|
159
159
|
|
|
160
160
|
export default function ButtonIconsDemo() {
|
|
161
161
|
return (
|
|
162
|
-
<
|
|
162
|
+
<Box className="flex-row flex-wrap gap-4">
|
|
163
163
|
<Button variant="outline">
|
|
164
164
|
<Button.Icon as={AddIcon} />
|
|
165
165
|
<Button.Label>Add</Button.Label>
|
|
@@ -172,7 +172,7 @@ export default function ButtonIconsDemo() {
|
|
|
172
172
|
<Button.Label>Send</Button.Label>
|
|
173
173
|
<Button.Icon as={SendIcon} />
|
|
174
174
|
</Button>
|
|
175
|
-
</
|
|
175
|
+
</Box>
|
|
176
176
|
);
|
|
177
177
|
}
|
|
178
178
|
```
|
|
@@ -185,15 +185,15 @@ import { Button, Box } from '@cdx-ui/components';
|
|
|
185
185
|
export default function ButtonLoadingDemo() {
|
|
186
186
|
return (
|
|
187
187
|
<Box className="flex-row flex-wrap gap-4">
|
|
188
|
-
<Button
|
|
188
|
+
<Button>
|
|
189
189
|
<Button.Spinner />
|
|
190
190
|
<Button.Label>Loading</Button.Label>
|
|
191
191
|
</Button>
|
|
192
|
-
<Button variant="outline"
|
|
192
|
+
<Button variant="outline">
|
|
193
193
|
<Button.Spinner />
|
|
194
194
|
<Button.Label>Loading</Button.Label>
|
|
195
195
|
</Button>
|
|
196
|
-
<Button variant="ghost"
|
|
196
|
+
<Button variant="ghost">
|
|
197
197
|
<Button.Spinner />
|
|
198
198
|
<Button.Label>Loading</Button.Label>
|
|
199
199
|
</Button>
|
|
@@ -210,7 +210,7 @@ import { Button, Box } from '@cdx-ui/components';
|
|
|
210
210
|
export default function ButtonFullWidthDemo() {
|
|
211
211
|
return (
|
|
212
212
|
<Box className="gap-4 w-64">
|
|
213
|
-
<Button fullWidth
|
|
213
|
+
<Button fullWidth>
|
|
214
214
|
<Button.Label>Submit</Button.Label>
|
|
215
215
|
</Button>
|
|
216
216
|
<Button fullWidth variant="outline">
|
|
@@ -232,19 +232,19 @@ import { Button, Box } from '@cdx-ui/components';
|
|
|
232
232
|
export default function ButtonDisabledDemo() {
|
|
233
233
|
return (
|
|
234
234
|
<Box className="flex-row flex-wrap gap-4">
|
|
235
|
-
<Button
|
|
235
|
+
<Button color="action" isDisabled>
|
|
236
236
|
<Button.Label>Action</Button.Label>
|
|
237
237
|
</Button>
|
|
238
|
-
<Button
|
|
238
|
+
<Button color="danger" isDisabled>
|
|
239
239
|
<Button.Label>Danger</Button.Label>
|
|
240
240
|
</Button>
|
|
241
|
-
<Button
|
|
241
|
+
<Button color="warning" isDisabled>
|
|
242
242
|
<Button.Label>Warning</Button.Label>
|
|
243
243
|
</Button>
|
|
244
|
-
<Button
|
|
244
|
+
<Button color="success" isDisabled>
|
|
245
245
|
<Button.Label>Success</Button.Label>
|
|
246
246
|
</Button>
|
|
247
|
-
<Button
|
|
247
|
+
<Button color="info" isDisabled>
|
|
248
248
|
<Button.Label>Info</Button.Label>
|
|
249
249
|
</Button>
|
|
250
250
|
</Box>
|
|
@@ -33,7 +33,7 @@ export default function CalendarBasicDemo() {
|
|
|
33
33
|
|
|
34
34
|
## Date limits
|
|
35
35
|
|
|
36
|
-
Set `minValue` and `maxValue` to restrict which days can be selected.
|
|
36
|
+
Set `minValue` and `maxValue` to restrict which days can be selected. The bounds also set the year picker's range: it lists every year from the `minValue` year to the `maxValue` year and scrolls to the visible year when it opens.
|
|
37
37
|
|
|
38
38
|
```tsx
|
|
39
39
|
import { useState } from 'react';
|
|
@@ -57,6 +57,28 @@ export default function CalendarMinMaxDemo() {
|
|
|
57
57
|
}
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
+
With a bound unset, the year picker extends 100 years from today on that side. For a date of birth, set `maxValue` to today and leave `minValue` unset to reach any year in the past century.
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
import { useState } from 'react';
|
|
64
|
+
import { Calendar } from '@cdx-ui/components';
|
|
65
|
+
import { todayDateId, type DateId } from '@cdx-ui/formatters';
|
|
66
|
+
|
|
67
|
+
export default function CalendarDateOfBirthDemo() {
|
|
68
|
+
const [value, setValue] = useState<DateId | undefined>();
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<Calendar
|
|
72
|
+
value={value}
|
|
73
|
+
onValueChange={setValue}
|
|
74
|
+
maxValue={todayDateId()}
|
|
75
|
+
aria-label="Date of birth"
|
|
76
|
+
className="w-full max-w-sm"
|
|
77
|
+
/>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
60
82
|
## Unavailable dates
|
|
61
83
|
|
|
62
84
|
Pass `isDateUnavailable` to disable individual days — here, weekends and a holiday list for business-days-only payments.
|
|
@@ -109,6 +131,8 @@ export default function CalendarDisabledDemo() {
|
|
|
109
131
|
|
|
110
132
|
By default, `Calendar` renders a month header with previous/next navigation and a year drill-down, followed by the day grid. `locale` defaults to `en-US` and controls weekday and month formatting.
|
|
111
133
|
|
|
134
|
+
The year drill-down replaces the day grid with a scrolling list of years at the same height. It lists the years from `minValue` to `maxValue`; a side with no bound extends 100 years before or after the current year. Selecting a year keeps the visible month, moved inside the bounds when the chosen year is a boundary year, and returns to the day grid. `isDateUnavailable` does not hide years.
|
|
135
|
+
|
|
112
136
|
`isDateUnavailable` combines with `minValue` and `maxValue`: a day is selectable only when it is inside the bounds and the predicate returns `false`. The predicate runs for every day of the visible month; define it outside the component or memoize it so that check is skipped on renders that do not change it.
|
|
113
137
|
|
|
114
138
|
| Prop | Type | Default | Description |
|
|
@@ -96,7 +96,7 @@ export default function CardWithActionsDemo() {
|
|
|
96
96
|
<Button variant="outline" className="flex-1">
|
|
97
97
|
<Button.Label>Learn more</Button.Label>
|
|
98
98
|
</Button>
|
|
99
|
-
<Button
|
|
99
|
+
<Button className="flex-1">
|
|
100
100
|
<Button.Label>Apply</Button.Label>
|
|
101
101
|
</Button>
|
|
102
102
|
</Card.Footer>
|
|
@@ -168,7 +168,7 @@ export default function CardFullBleedDemo() {
|
|
|
168
168
|
))}
|
|
169
169
|
</Card.Content>
|
|
170
170
|
<Card.Footer>
|
|
171
|
-
<Button variant="outline"
|
|
171
|
+
<Button variant="outline" fullWidth onPress={() => {}}>
|
|
172
172
|
<Button.Label>Pay due bills</Button.Label>
|
|
173
173
|
</Button>
|
|
174
174
|
</Card.Footer>
|
|
@@ -20,7 +20,7 @@ export default function CarouselBasicDemo() {
|
|
|
20
20
|
return (
|
|
21
21
|
<Carousel
|
|
22
22
|
data={SLIDES}
|
|
23
|
-
|
|
23
|
+
className="h-55 w-80"
|
|
24
24
|
loop
|
|
25
25
|
renderItem={({ item }) => <CarouselSlide {...item} />}
|
|
26
26
|
/>
|
|
@@ -43,7 +43,7 @@ export default function CarouselWithPaginationDemo() {
|
|
|
43
43
|
<Box className="w-80 gap-3">
|
|
44
44
|
<Carousel
|
|
45
45
|
data={SLIDES}
|
|
46
|
-
|
|
46
|
+
className="h-55 w-80"
|
|
47
47
|
loop
|
|
48
48
|
renderItem={({ item }) => <CarouselSlide {...item} />}
|
|
49
49
|
>
|
|
@@ -87,7 +87,7 @@ function HeaderRowSample() {
|
|
|
87
87
|
<Carousel
|
|
88
88
|
ref={ref}
|
|
89
89
|
data={SLIDES}
|
|
90
|
-
|
|
90
|
+
className="h-55 w-80"
|
|
91
91
|
loop={false}
|
|
92
92
|
onProgressChange={progress}
|
|
93
93
|
renderItem={({ item }) => <CarouselSlide {...item} />}
|
|
@@ -110,7 +110,7 @@ function FlankingSample() {
|
|
|
110
110
|
<Carousel
|
|
111
111
|
ref={ref}
|
|
112
112
|
data={SLIDES}
|
|
113
|
-
|
|
113
|
+
className="h-55 w-63"
|
|
114
114
|
loop={false}
|
|
115
115
|
onProgressChange={progress}
|
|
116
116
|
renderItem={({ item }) => <CarouselSlide {...item} />}
|
|
@@ -151,7 +151,7 @@ export default function CarouselVerticalDemo() {
|
|
|
151
151
|
return (
|
|
152
152
|
<Carousel
|
|
153
153
|
data={SLIDES}
|
|
154
|
-
|
|
154
|
+
className="h-105 w-80"
|
|
155
155
|
vertical
|
|
156
156
|
renderItem={({ item }) => <CarouselSlide {...item} />}
|
|
157
157
|
/>
|
|
@@ -173,7 +173,7 @@ export default function CarouselParallaxDemo() {
|
|
|
173
173
|
return (
|
|
174
174
|
<Carousel
|
|
175
175
|
data={SLIDES}
|
|
176
|
-
|
|
176
|
+
className="h-55 w-80"
|
|
177
177
|
mode="parallax"
|
|
178
178
|
modeConfig={{ parallaxScrollingScale: 0.9, parallaxScrollingOffset: 50 }}
|
|
179
179
|
renderItem={({ item }) => <CarouselSlide {...item} />}
|
|
@@ -200,7 +200,7 @@ export default function CarouselAutoplayDemo() {
|
|
|
200
200
|
<Carousel
|
|
201
201
|
ref={ref}
|
|
202
202
|
data={SLIDES}
|
|
203
|
-
|
|
203
|
+
className="h-55 w-80"
|
|
204
204
|
loop
|
|
205
205
|
autoPlay
|
|
206
206
|
autoPlayInterval={2000}
|
|
@@ -327,7 +327,7 @@ Ghost `IconButton` prev/next controls. Nest inside `Carousel` to read context, o
|
|
|
327
327
|
| `onPointerUpCapture?` | `((event: PointerEvent) => void)` | — | — |
|
|
328
328
|
| `accessible?` | `boolean` | — | When true, indicates that the view is an accessibility element. By default, all the touchable elements are accessible. |
|
|
329
329
|
| `accessibilityActions?` | `readonly Readonly<{ name: AccessibilityActionName \| string; label?: string; }>[]` | — | Provides an array of custom actions available for accessibility. |
|
|
330
|
-
| `aria-label?` | `string` | — | Alias for accessibilityLabel https://reactnative.dev/docs/view#accessibilitylabel https://github.com/
|
|
330
|
+
| `aria-label?` | `string` | — | Alias for accessibilityLabel https://reactnative.dev/docs/view#accessibilitylabel https://github.com/react/react-native/issues/34424 |
|
|
331
331
|
| `accessibilityRole?` | `'none' \| 'button' \| 'togglebutton' \| 'link' \| 'search' \| 'image' \| 'keyboardkey' \| 'text' \| 'adjustable' \| 'imagebutton' \| 'header' \| 'summary' \| 'alert' \| 'checkbox' \| 'combobox' \| 'menu' \| 'menubar' \| 'menuitem' \| 'progressbar' \| 'radio' \| 'radiogroup' \| 'scrollbar' \| 'spinbutton' \| 'switch' \| 'tab' \| 'tabbar' \| 'tablist' \| 'timer' \| 'list' \| 'toolbar'` | — | Accessibility Role tells a person using either VoiceOver on iOS or TalkBack on Android the type of element that is focused on. |
|
|
332
332
|
| `accessibilityState?` | `AccessibilityState` | — | Accessibility State tells a person using either VoiceOver on iOS or TalkBack on Android the state of the element currently focused on. |
|
|
333
333
|
| `aria-busy?` | `boolean` | — | alias for accessibilityState see https://reactnative.dev/docs/accessibility#accessibilitystate |
|
|
@@ -367,6 +367,7 @@ Ghost `IconButton` prev/next controls. Nest inside `Carousel` to read context, o
|
|
|
367
367
|
| `onHoverIn?` | `((event: MouseEvent) => void) \| null` | — | Called when the hover is activated to provide visual feedback. |
|
|
368
368
|
| `onHoverOut?` | `((event: MouseEvent) => void) \| null` | — | Called when the hover is deactivated to undo visual feedback. |
|
|
369
369
|
| `onPressIn?` | `((event: GestureResponderEvent) => void) \| null` | — | Called when a touch is engaged before `onPress`. |
|
|
370
|
+
| `onPressMove?` | `((event: GestureResponderEvent) => void) \| null` | — | Called when the press location moves. |
|
|
370
371
|
| `onPressOut?` | `((event: GestureResponderEvent) => void) \| null` | — | Called when a touch is released before `onPress`. |
|
|
371
372
|
| `onLongPress?` | `((event: GestureResponderEvent) => void) \| null` | — | Called when a long-tap gesture is detected. |
|
|
372
373
|
| `cancelable?` | `boolean \| null` | — | Whether a press gesture can be interrupted by a parent gesture such as a scroll event. Defaults to true. |
|