@cdx-ui/components 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/docs/components/accordion/content.md +2 -2
  2. package/docs/components/alert/content.md +1 -1
  3. package/docs/components/badge/content.md +5 -15
  4. package/docs/components/bottom-sheet/content.md +16 -14
  5. package/docs/components/box/content.md +141 -0
  6. package/docs/components/breadcrumbs/content.md +9 -9
  7. package/docs/components/button/content.md +19 -19
  8. package/docs/components/card/content.md +2 -2
  9. package/docs/components/carousel/content.md +9 -8
  10. package/docs/components/chip/content.md +1 -1
  11. package/docs/components/color-area/content.md +3 -5
  12. package/docs/components/color-field/content.md +3 -5
  13. package/docs/components/color-picker/content.md +5 -4
  14. package/docs/components/color-slider/content.md +3 -5
  15. package/docs/components/color-swatch/content.md +3 -5
  16. package/docs/components/color-swatch-picker/content.md +3 -5
  17. package/docs/components/content.md +10 -9
  18. package/docs/components/data-grid/content.md +10 -11
  19. package/docs/components/drawer/content.md +17 -25
  20. package/docs/components/full-screen-dialog/content.md +2 -2
  21. package/docs/components/icon/content.md +1 -1
  22. package/docs/components/icon-button/content.md +3 -3
  23. package/docs/components/input/content.md +65 -0
  24. package/docs/components/list-item/content.md +9 -9
  25. package/docs/components/menu/content.md +57 -50
  26. package/docs/components/reorderable-list/content.md +5 -3
  27. package/docs/components/scoped-theme/content.md +1 -1
  28. package/docs/components/scroll-shadow/content.md +43 -36
  29. package/docs/components/select/content.md +80 -7
  30. package/docs/components/skeleton/content.md +7 -6
  31. package/docs/components/table/content.md +2 -2
  32. package/docs/components/tabs/content.md +14 -9
  33. package/docs/components/tile/content.md +9 -10
  34. package/docs/components/toggle-button/content.md +1 -1
  35. package/docs/components/tooltip/content.md +9 -9
  36. package/docs/components/virtualized-list/content.md +14 -14
  37. package/docs/getting-started/developers/content.md +2 -2
  38. package/docs/getting-started/developers/styling/content.md +20 -18
  39. package/docs/llms.txt +11 -9
  40. package/docs/patterns/authentication/content.md +4 -6
  41. package/docs/patterns/dashboard/content.md +8 -13
  42. package/docs/patterns/empty-states/content.md +7 -6
  43. package/docs/patterns/forms/content.md +6 -7
  44. package/docs/patterns/onboarding/content.md +4 -4
  45. package/docs/patterns/settings/content.md +5 -5
  46. package/docs/resources/release-notes/0.2.4/content.md +17 -0
  47. package/docs/resources/release-notes/content.md +1 -0
  48. package/lib/commonjs/components/Box/Box.js +9 -1
  49. package/lib/commonjs/components/Box/Box.js.map +1 -1
  50. package/lib/commonjs/components/Breadcrumbs/index.js +28 -3
  51. package/lib/commonjs/components/Breadcrumbs/index.js.map +1 -1
  52. package/lib/commonjs/components/Breadcrumbs/styles.js +27 -0
  53. package/lib/commonjs/components/Breadcrumbs/styles.js.map +1 -1
  54. package/lib/commonjs/components/Stack/HStack.js +6 -2
  55. package/lib/commonjs/components/Stack/HStack.js.map +1 -1
  56. package/lib/commonjs/components/Stack/VStack.js +6 -2
  57. package/lib/commonjs/components/Stack/VStack.js.map +1 -1
  58. package/lib/commonjs/index.js +10 -10
  59. package/lib/commonjs/index.js.map +1 -1
  60. package/lib/module/components/Box/Box.js +9 -1
  61. package/lib/module/components/Box/Box.js.map +1 -1
  62. package/lib/module/components/Breadcrumbs/index.js +29 -4
  63. package/lib/module/components/Breadcrumbs/index.js.map +1 -1
  64. package/lib/module/components/Breadcrumbs/styles.js +26 -0
  65. package/lib/module/components/Breadcrumbs/styles.js.map +1 -1
  66. package/lib/module/components/Stack/HStack.js +6 -2
  67. package/lib/module/components/Stack/HStack.js.map +1 -1
  68. package/lib/module/components/Stack/VStack.js +6 -2
  69. package/lib/module/components/Stack/VStack.js.map +1 -1
  70. package/lib/module/index.js +6 -1
  71. package/lib/module/index.js.map +1 -1
  72. package/lib/typescript/animation/hooks/usePopupDialogContentAnimation.d.ts +2 -2
  73. package/lib/typescript/animation/hooks/usePopupOverlayAnimation.d.ts +2 -2
  74. package/lib/typescript/components/Box/Box.d.ts +4 -0
  75. package/lib/typescript/components/Box/Box.d.ts.map +1 -1
  76. package/lib/typescript/components/Breadcrumbs/index.d.ts +3 -1
  77. package/lib/typescript/components/Breadcrumbs/index.d.ts.map +1 -1
  78. package/lib/typescript/components/Breadcrumbs/styles.d.ts +2 -0
  79. package/lib/typescript/components/Breadcrumbs/styles.d.ts.map +1 -1
  80. package/lib/typescript/components/Stack/HStack.d.ts +3 -2
  81. package/lib/typescript/components/Stack/HStack.d.ts.map +1 -1
  82. package/lib/typescript/components/Stack/VStack.d.ts +3 -2
  83. package/lib/typescript/components/Stack/VStack.d.ts.map +1 -1
  84. package/lib/typescript/components/Toast/animation.d.ts +3 -3
  85. package/lib/typescript/components/Toast/animation.d.ts.map +1 -1
  86. package/lib/typescript/index.d.ts +6 -1
  87. package/lib/typescript/index.d.ts.map +1 -1
  88. package/package.json +8 -8
  89. package/src/components/Box/Box.tsx +18 -4
  90. package/src/components/Breadcrumbs/index.tsx +28 -4
  91. package/src/components/Breadcrumbs/styles.ts +30 -0
  92. package/src/components/Stack/HStack.tsx +8 -4
  93. package/src/components/Stack/VStack.tsx +8 -4
  94. 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 className="gap-0.5">
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 color="action" fullWidth>
245
+ <Button fullWidth>
246
246
  <Button.Label>Review payment</Button.Label>
247
247
  </Button>
248
248
  </Card.Footer>
@@ -15,7 +15,7 @@ import { Alert } from '@cdx-ui/components';
15
15
 
16
16
  export default function AlertBasicDemo() {
17
17
  return (
18
- <Alert severity="info">
18
+ <Alert>
19
19
  <Alert.Icon />
20
20
  <Alert.Title>Scheduled maintenance</Alert.Title>
21
21
  <Alert.Description>
@@ -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" color="action">
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" color="action">
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 variant="solid" color="action">
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 variant="solid" color="action" onPress={present}>
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 variant="solid" color="action" onPress={present}>
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 variant="solid" color="action" onPress={dismiss}>
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" color="action" onPress={presentBasic}>
99
+ <Button variant="outline" onPress={presentBasic}>
100
100
  <Button.Label>Title + close</Button.Label>
101
101
  </Button>
102
- <Button variant="outline" color="action" onPress={presentFull}>
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, useBottomSheet, Box, Button, Text } from '@cdx-ui/components';
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 variant="solid" color="action" onPress={present}>
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 variant="solid" color="action" onPress={dismiss}>
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
- <Box key={item.id} className="border-b border-stroke-secondary py-3">
170
- <Text>{item.label}</Text>
171
- </Box>
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 variant="solid" color="action" onPress={present}>
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 variant="solid" color="action" onPress={dismiss}>
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 variant="solid" color="action" onPress={present}>
237
+ <Button onPress={present}>
236
238
  <Button.Label>No drag handle</Button.Label>
237
239
  </Button>
238
240
  <BottomSheet.Modal ref={ref} handleVisible={false}>
@@ -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 web:text-inherit native:text-content-primary"
92
+ className="size-4"
93
93
  accessibilityElementsHidden
94
94
  importantForAccessibility="no-hide-descendants"
95
95
  />
96
- <Text className="text-inherit">Home</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 web:text-inherit native:text-content-primary"
101
+ className="size-4"
102
102
  accessibilityElementsHidden
103
103
  importantForAccessibility="no-hide-descendants"
104
104
  />
105
- <Text className="text-inherit">Marketplace</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 variant="solid" color="action">
41
+ <Button color="action">
42
42
  <Button.Label>Action</Button.Label>
43
43
  </Button>
44
- <Button variant="solid" color="danger">
44
+ <Button color="danger">
45
45
  <Button.Label>Danger</Button.Label>
46
46
  </Button>
47
- <Button variant="solid" color="warning">
47
+ <Button color="warning">
48
48
  <Button.Label>Warning</Button.Label>
49
49
  </Button>
50
- <Button variant="solid" color="success">
50
+ <Button color="success">
51
51
  <Button.Label>Success</Button.Label>
52
52
  </Button>
53
- <Button variant="solid" color="info">
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 variant="solid" size="default">
126
+ <Button size="default">
127
127
  <Button.Label>Default</Button.Label>
128
128
  </Button>
129
- <Button variant="solid" size="small">
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 { Button, View } from '@cdx-ui/components';
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
- <View className="flex-row flex-wrap gap-4">
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
- </View>
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 variant="solid" color="action">
188
+ <Button>
189
189
  <Button.Spinner />
190
190
  <Button.Label>Loading</Button.Label>
191
191
  </Button>
192
- <Button variant="outline" color="action">
192
+ <Button variant="outline">
193
193
  <Button.Spinner />
194
194
  <Button.Label>Loading</Button.Label>
195
195
  </Button>
196
- <Button variant="ghost" color="action">
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 variant="solid">
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 variant="solid" color="action" isDisabled>
235
+ <Button color="action" isDisabled>
236
236
  <Button.Label>Action</Button.Label>
237
237
  </Button>
238
- <Button variant="solid" color="danger" isDisabled>
238
+ <Button color="danger" isDisabled>
239
239
  <Button.Label>Danger</Button.Label>
240
240
  </Button>
241
- <Button variant="solid" color="warning" isDisabled>
241
+ <Button color="warning" isDisabled>
242
242
  <Button.Label>Warning</Button.Label>
243
243
  </Button>
244
- <Button variant="solid" color="success" isDisabled>
244
+ <Button color="success" isDisabled>
245
245
  <Button.Label>Success</Button.Label>
246
246
  </Button>
247
- <Button variant="solid" color="info" isDisabled>
247
+ <Button color="info" isDisabled>
248
248
  <Button.Label>Info</Button.Label>
249
249
  </Button>
250
250
  </Box>
@@ -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 color="action" className="flex-1">
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" color="action" fullWidth onPress={() => {}}>
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
- style={{ width: 320, height: 220 }}
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
- style={{ width: 320, height: 220 }}
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
- style={{ width: 320, height: 220 }}
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
- style={{ width: 252, height: 220 }}
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
- style={{ width: 320, height: 420 }}
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
- style={{ width: 320, height: 220 }}
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
- style={{ width: 320, height: 220 }}
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/facebook/react-native/issues/34424 |
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. |
@@ -393,7 +393,7 @@ Displays an avatar inside the chip, sized to fit the chip's `size` variant.
393
393
  | `accessible?` | `boolean` | — | When true, indicates that the view is an accessibility element. By default, all the touchable elements are accessible. |
394
394
  | `accessibilityActions?` | `readonly Readonly<{ name: AccessibilityActionName \| string; label?: string; }>[]` | — | Provides an array of custom actions available for accessibility. |
395
395
  | `accessibilityLabel?` | `string` | — | Overrides the text that's read by the screen reader when the user interacts with the element. By default, the label is constructed by traversing all the children and accumulating all the Text nodes separated by space. |
396
- | `aria-label?` | `string` | — | Alias for accessibilityLabel https://reactnative.dev/docs/view#accessibilitylabel https://github.com/facebook/react-native/issues/34424 |
396
+ | `aria-label?` | `string` | — | Alias for accessibilityLabel https://reactnative.dev/docs/view#accessibilitylabel https://github.com/react/react-native/issues/34424 |
397
397
  | `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. |
398
398
  | `accessibilityState?` | `AccessibilityState` | — | Accessibility State tells a person using either VoiceOver on iOS or TalkBack on Android the state of the element currently focused on. |
399
399
  | `aria-busy?` | `boolean` | — | alias for accessibilityState see https://reactnative.dev/docs/accessibility#accessibilitystate |
@@ -1,20 +1,18 @@
1
- # ColorArea (https://design.candescent.com/docs/components/color-area)
1
+ # Color Area (https://design.candescent.com/docs/components/color-area)
2
2
 
3
3
  Resources: [Storybook](https://victorious-wave-0daadf00f.6.azurestaticapps.net/?path=/story/inputs-colorarea--default)
4
4
 
5
5
  `ColorArea` selects saturation horizontally and brightness vertically.
6
6
 
7
7
  ```tsx
8
- import { ColorArea } from '@cdx-ui/components';
9
- import { parseColor } from '@cdx-ui/primitives';
8
+ import { ColorArea, parseColor } from '@cdx-ui/components';
10
9
  ```
11
10
 
12
11
  ## Basic
13
12
 
14
13
  ```tsx
15
14
  import { useState } from 'react';
16
- import { ColorArea } from '@cdx-ui/components';
17
- import { parseColor, type Color } from '@cdx-ui/primitives';
15
+ import { ColorArea, parseColor, type Color } from '@cdx-ui/components';
18
16
 
19
17
  function requiredColor(value: string): Color {
20
18
  const color = parseColor(value);