@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
|
@@ -24,7 +24,7 @@ export default function MenuBasicDemo() {
|
|
|
24
24
|
<Box className="items-start gap-2">
|
|
25
25
|
<Menu>
|
|
26
26
|
<Menu.Trigger asChild>
|
|
27
|
-
<Button
|
|
27
|
+
<Button variant="outline">
|
|
28
28
|
<Button.Label>Everyday Checking</Button.Label>
|
|
29
29
|
<Button.Icon as={KeyboardArrowDown} position="trailing" />
|
|
30
30
|
</Button>
|
|
@@ -73,7 +73,7 @@ export default function MenuCheckboxItemsDemo() {
|
|
|
73
73
|
return (
|
|
74
74
|
<Menu>
|
|
75
75
|
<Menu.Trigger asChild>
|
|
76
|
-
<Button
|
|
76
|
+
<Button variant="outline">
|
|
77
77
|
<Button.Label>Account view · {enabledCount} enabled</Button.Label>
|
|
78
78
|
<Button.Icon as={KeyboardArrowDown} position="trailing" />
|
|
79
79
|
</Button>
|
|
@@ -122,7 +122,7 @@ export default function MenuRadioItemsDemo() {
|
|
|
122
122
|
return (
|
|
123
123
|
<Menu>
|
|
124
124
|
<Menu.Trigger asChild>
|
|
125
|
-
<Button
|
|
125
|
+
<Button variant="outline">
|
|
126
126
|
<Button.Label>{selectedLabel}</Button.Label>
|
|
127
127
|
<Button.Icon as={KeyboardArrowDown} position="trailing" />
|
|
128
128
|
</Button>
|
|
@@ -183,7 +183,7 @@ import { Menu } from '@cdx-ui/components';
|
|
|
183
183
|
|
|
184
184
|
export default function MenuWithShortcutsDemo() {
|
|
185
185
|
return (
|
|
186
|
-
<Menu.Content accessibilityLabel="Edit menu" className="w-56">
|
|
186
|
+
<Menu.Content accessibilityLabel="Edit menu" className="w-full max-w-56">
|
|
187
187
|
<Menu.Item onPress={() => undefined}>
|
|
188
188
|
<Menu.ItemLabel>Undo</Menu.ItemLabel>
|
|
189
189
|
<Menu.ItemShortcut>⌘Z</Menu.ItemShortcut>
|
|
@@ -211,7 +211,7 @@ import { Delete, Edit } from '@cdx-ui/icons';
|
|
|
211
211
|
|
|
212
212
|
export default function MenuDestructiveDemo() {
|
|
213
213
|
return (
|
|
214
|
-
<Menu.Content accessibilityLabel="Account actions" className="w-56">
|
|
214
|
+
<Menu.Content accessibilityLabel="Account actions" className="w-full max-w-56">
|
|
215
215
|
<Menu.Item onPress={() => undefined}>
|
|
216
216
|
<Menu.ItemIcon as={Edit} />
|
|
217
217
|
<Menu.ItemLabel>Edit nickname</Menu.ItemLabel>
|
|
@@ -235,7 +235,7 @@ import { Menu } from '@cdx-ui/components';
|
|
|
235
235
|
|
|
236
236
|
export default function MenuSectionsDemo() {
|
|
237
237
|
return (
|
|
238
|
-
<Menu.Content accessibilityLabel="Account filters" className="w-56">
|
|
238
|
+
<Menu.Content accessibilityLabel="Account filters" className="w-full max-w-56">
|
|
239
239
|
<Menu.SectionLabel>Status</Menu.SectionLabel>
|
|
240
240
|
<Menu.Item onPress={() => undefined}>
|
|
241
241
|
<Menu.ItemLabel>Active</Menu.ItemLabel>
|
|
@@ -266,7 +266,7 @@ import { Edit, Person } from '@cdx-ui/icons';
|
|
|
266
266
|
|
|
267
267
|
export default function MenuInsetDemo() {
|
|
268
268
|
return (
|
|
269
|
-
<Menu.Content accessibilityLabel="Profile actions" className="w-56">
|
|
269
|
+
<Menu.Content accessibilityLabel="Profile actions" className="w-full max-w-56">
|
|
270
270
|
<Menu.Item onPress={() => undefined}>
|
|
271
271
|
<Menu.ItemIcon as={Person} />
|
|
272
272
|
<Menu.ItemLabel>View profile</Menu.ItemLabel>
|
|
@@ -295,11 +295,11 @@ export default function MenuGroupHeaderDemo() {
|
|
|
295
295
|
const [showPending, setShowPending] = useState(true);
|
|
296
296
|
|
|
297
297
|
return (
|
|
298
|
-
<Menu.Content accessibilityLabel="Transaction filters" className="w-72">
|
|
298
|
+
<Menu.Content accessibilityLabel="Transaction filters" className="w-full max-w-72">
|
|
299
299
|
<Menu.GroupHeader>
|
|
300
300
|
<Menu.ItemLabel>Filter by</Menu.ItemLabel>
|
|
301
301
|
<Menu.ItemAction>
|
|
302
|
-
<Button variant="ghost"
|
|
302
|
+
<Button variant="ghost" size="small" onPress={() => setShowPending(false)}>
|
|
303
303
|
<Button.Label>Clear</Button.Label>
|
|
304
304
|
</Button>
|
|
305
305
|
</Menu.ItemAction>
|
|
@@ -328,7 +328,7 @@ export default function MenuItemControlDemo() {
|
|
|
328
328
|
const [status, setStatus] = useState('open');
|
|
329
329
|
|
|
330
330
|
return (
|
|
331
|
-
<Menu.Content accessibilityLabel="Transaction filters" className="w-64">
|
|
331
|
+
<Menu.Content accessibilityLabel="Transaction filters" className="w-full max-w-64">
|
|
332
332
|
<Menu.SectionLabel>Activity</Menu.SectionLabel>
|
|
333
333
|
<Menu.CheckboxItem isChecked={pending} onChange={setPending}>
|
|
334
334
|
<Menu.ItemControl />
|
|
@@ -372,7 +372,7 @@ export default function MenuItemCountDemo() {
|
|
|
372
372
|
const [categories, setCategories] = useState<Record<string, boolean>>({ admin: true });
|
|
373
373
|
|
|
374
374
|
return (
|
|
375
|
-
<Menu.Content accessibilityLabel="Categories" className="w-64">
|
|
375
|
+
<Menu.Content accessibilityLabel="Categories" className="w-full max-w-64">
|
|
376
376
|
{CATEGORIES.map((category) => (
|
|
377
377
|
<Menu.CheckboxItem
|
|
378
378
|
key={category.id}
|
|
@@ -408,19 +408,18 @@ export default function MenuItemActionDemo() {
|
|
|
408
408
|
<Box className="items-start gap-2">
|
|
409
409
|
<Menu>
|
|
410
410
|
<Menu.Trigger asChild>
|
|
411
|
-
<Button
|
|
411
|
+
<Button variant="outline">
|
|
412
412
|
<Button.Label>Everyday Checking</Button.Label>
|
|
413
413
|
<Button.Icon as={KeyboardArrowDown} position="trailing" />
|
|
414
414
|
</Button>
|
|
415
415
|
</Menu.Trigger>
|
|
416
|
-
<Menu.Popup className="w-72">
|
|
416
|
+
<Menu.Popup className="w-full max-w-72">
|
|
417
417
|
<Menu.Content accessibilityLabel="Everyday Checking actions">
|
|
418
418
|
<Menu.Item onPress={() => setResult('Opening account details')}>
|
|
419
419
|
<Menu.ItemLabel>View details</Menu.ItemLabel>
|
|
420
420
|
<Menu.ItemAction>
|
|
421
421
|
<Button
|
|
422
422
|
variant="ghost"
|
|
423
|
-
color="action"
|
|
424
423
|
size="small"
|
|
425
424
|
onPress={() => setResult('Copied account number')}
|
|
426
425
|
>
|
|
@@ -491,17 +490,17 @@ export default function MenuWithFiltersDemo() {
|
|
|
491
490
|
return (
|
|
492
491
|
<Menu>
|
|
493
492
|
<Menu.Trigger asChild>
|
|
494
|
-
<Button
|
|
493
|
+
<Button variant="outline">
|
|
495
494
|
<Button.Label>Catalog filters</Button.Label>
|
|
496
495
|
<Button.Icon as={KeyboardArrowDown} position="trailing" />
|
|
497
496
|
</Button>
|
|
498
497
|
</Menu.Trigger>
|
|
499
|
-
<Menu.Popup className="w-72">
|
|
498
|
+
<Menu.Popup className="w-full max-w-72">
|
|
500
499
|
<Menu.Content accessibilityLabel="Catalog filters">
|
|
501
500
|
<Menu.GroupHeader>
|
|
502
501
|
<Menu.ItemLabel>Filter by</Menu.ItemLabel>
|
|
503
502
|
<Menu.ItemAction>
|
|
504
|
-
<Button variant="ghost"
|
|
503
|
+
<Button variant="ghost" size="small" onPress={clearFilters}>
|
|
505
504
|
<Button.Label>Clear filters</Button.Label>
|
|
506
505
|
</Button>
|
|
507
506
|
</Menu.ItemAction>
|
|
@@ -583,7 +582,7 @@ export default function MenuScrollableDemo() {
|
|
|
583
582
|
return (
|
|
584
583
|
<Menu>
|
|
585
584
|
<Menu.Trigger asChild>
|
|
586
|
-
<Button
|
|
585
|
+
<Button variant="outline">
|
|
587
586
|
<Button.Label>Statement · {selectedPeriod}</Button.Label>
|
|
588
587
|
<Button.Icon as={KeyboardArrowDown} position="trailing" />
|
|
589
588
|
</Button>
|
|
@@ -611,7 +610,7 @@ export default function MenuScrollableDemo() {
|
|
|
611
610
|
Use `asChild` to open a menu from any pressable component, such as a button, chip, or icon button.
|
|
612
611
|
|
|
613
612
|
```tsx
|
|
614
|
-
import { Box, Button, Card, Chip, IconButton, Menu, Text } from '@cdx-ui/components';
|
|
613
|
+
import { Box, Button, Card, Chip, IconButton, ListItem, Menu, Text } from '@cdx-ui/components';
|
|
615
614
|
import { AccountBalance, KeyboardArrowDown, MoreHoriz } from '@cdx-ui/icons';
|
|
616
615
|
|
|
617
616
|
export default function MenuCustomTriggersDemo() {
|
|
@@ -623,7 +622,7 @@ export default function MenuCustomTriggersDemo() {
|
|
|
623
622
|
</Text>
|
|
624
623
|
<Menu>
|
|
625
624
|
<Menu.Trigger asChild>
|
|
626
|
-
<Button
|
|
625
|
+
<Button>
|
|
627
626
|
<Button.Label>Move money</Button.Label>
|
|
628
627
|
<Button.Icon as={KeyboardArrowDown} position="trailing" />
|
|
629
628
|
</Button>
|
|
@@ -676,31 +675,39 @@ export default function MenuCustomTriggersDemo() {
|
|
|
676
675
|
<Text color="secondary" size="sm">
|
|
677
676
|
Card management
|
|
678
677
|
</Text>
|
|
679
|
-
<Card
|
|
680
|
-
<
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
678
|
+
<Card fullBleed>
|
|
679
|
+
<Card.Content>
|
|
680
|
+
<ListItem showSeparator={false}>
|
|
681
|
+
<ListItem.Content>
|
|
682
|
+
<ListItem.Title>Cash Rewards ••1842</ListItem.Title>
|
|
683
|
+
</ListItem.Content>
|
|
684
|
+
<ListItem.TrailingSlot>
|
|
685
|
+
<Menu placement="bottom-end">
|
|
686
|
+
<Menu.Trigger asChild>
|
|
687
|
+
<IconButton
|
|
688
|
+
as={MoreHoriz}
|
|
689
|
+
variant="ghost"
|
|
690
|
+
size="small"
|
|
691
|
+
accessibilityLabel="Cash Rewards card actions"
|
|
692
|
+
/>
|
|
693
|
+
</Menu.Trigger>
|
|
694
|
+
<Menu.Popup>
|
|
695
|
+
<Menu.Content accessibilityLabel="Cash Rewards card actions">
|
|
696
|
+
<Menu.Item onPress={() => undefined}>
|
|
697
|
+
<Menu.ItemLabel>Lock card</Menu.ItemLabel>
|
|
698
|
+
</Menu.Item>
|
|
699
|
+
<Menu.Item onPress={() => undefined}>
|
|
700
|
+
<Menu.ItemLabel>Replace card</Menu.ItemLabel>
|
|
701
|
+
</Menu.Item>
|
|
702
|
+
<Menu.Item color="danger" onPress={() => undefined}>
|
|
703
|
+
<Menu.ItemLabel>Report lost or stolen</Menu.ItemLabel>
|
|
704
|
+
</Menu.Item>
|
|
705
|
+
</Menu.Content>
|
|
706
|
+
</Menu.Popup>
|
|
707
|
+
</Menu>
|
|
708
|
+
</ListItem.TrailingSlot>
|
|
709
|
+
</ListItem>
|
|
710
|
+
</Card.Content>
|
|
704
711
|
</Card>
|
|
705
712
|
</Box>
|
|
706
713
|
</Box>
|
|
@@ -745,7 +752,7 @@ function PlacementMenu({ placement }: PlacementMenuProps) {
|
|
|
745
752
|
return (
|
|
746
753
|
<Menu placement={placement}>
|
|
747
754
|
<Menu.Trigger asChild>
|
|
748
|
-
<Button variant="outline"
|
|
755
|
+
<Button variant="outline" size="small">
|
|
749
756
|
<Button.Label>{placement}</Button.Label>
|
|
750
757
|
</Button>
|
|
751
758
|
</Menu.Trigger>
|
|
@@ -807,7 +814,7 @@ function AutomaticPlacementMenu({ placement }: Readonly<{ placement: AutomaticPl
|
|
|
807
814
|
return (
|
|
808
815
|
<Menu placement={placement}>
|
|
809
816
|
<Menu.Trigger asChild>
|
|
810
|
-
<Button variant="outline"
|
|
817
|
+
<Button variant="outline" size="small">
|
|
811
818
|
<Button.Label>{placement}</Button.Label>
|
|
812
819
|
</Button>
|
|
813
820
|
</Menu.Trigger>
|
|
@@ -847,7 +854,7 @@ import { Menu } from '@cdx-ui/components';
|
|
|
847
854
|
|
|
848
855
|
export default function MenuDisabledDemo() {
|
|
849
856
|
return (
|
|
850
|
-
<Menu.Content accessibilityLabel="Account actions" className="w-64">
|
|
857
|
+
<Menu.Content accessibilityLabel="Account actions" className="w-full max-w-64">
|
|
851
858
|
<Menu.Item onPress={() => undefined}>
|
|
852
859
|
<Menu.ItemLabel>Edit</Menu.ItemLabel>
|
|
853
860
|
</Menu.Item>
|
|
@@ -934,12 +941,12 @@ export default function MenuCustomItemsDemo() {
|
|
|
934
941
|
return (
|
|
935
942
|
<Menu>
|
|
936
943
|
<Menu.Trigger asChild>
|
|
937
|
-
<Button
|
|
944
|
+
<Button variant="outline">
|
|
938
945
|
<Button.Label>From {selectedAccount.name}</Button.Label>
|
|
939
946
|
<Button.Icon as={KeyboardArrowDown} position="trailing" />
|
|
940
947
|
</Button>
|
|
941
948
|
</Menu.Trigger>
|
|
942
|
-
<Menu.Popup className="w-80">
|
|
949
|
+
<Menu.Popup className="w-full max-w-80">
|
|
943
950
|
<Menu.Content accessibilityLabel="Funding account">
|
|
944
951
|
<Menu.RadioGroup
|
|
945
952
|
value={selectedAccountId}
|
|
@@ -57,6 +57,8 @@ export default function MonthCalendarDisabledDemo() {
|
|
|
57
57
|
|
|
58
58
|
By default, `MonthCalendar` renders a year header — tap it to switch to the year picker, or use the previous/next controls to shift the visible year — followed by a twelve-month grid. `locale` defaults to `en-US` and controls month formatting.
|
|
59
59
|
|
|
60
|
+
The year picker replaces the month grid with a scrolling list of years at the same height and opens scrolled to the visible year. It lists the years from `minValue` to `maxValue`; a side with no bound extends 100 years before or after the current year.
|
|
61
|
+
|
|
60
62
|
| Prop | Type | Default | Description |
|
|
61
63
|
| --- | --- | --- | --- |
|
|
62
64
|
| `className?` | `string` | — | — |
|
|
@@ -38,7 +38,7 @@ export default function RangeCalendarBasicDemo() {
|
|
|
38
38
|
|
|
39
39
|
## Date limits
|
|
40
40
|
|
|
41
|
-
Set `minValue` and `maxValue` to restrict which days can be selected.
|
|
41
|
+
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 a side with no bound extends 100 years from today.
|
|
42
42
|
|
|
43
43
|
```tsx
|
|
44
44
|
import { useState } from 'react';
|
|
@@ -94,6 +94,8 @@ export default function RangeCalendarDisabledDemo() {
|
|
|
94
94
|
|
|
95
95
|
By default, `RangeCalendar` renders a month header with previous/next navigation and a year drill-down, followed by the day grid. Selecting a day while a range is empty or complete starts a new range; the second tap completes it, and an inverted selection is normalized so the earlier day becomes the start. `locale` defaults to `en-US` and controls weekday and month formatting.
|
|
96
96
|
|
|
97
|
+
The year drill-down replaces the day grid with a scrolling list of years at the same height, scrolled to the visible year when it opens. 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.
|
|
98
|
+
|
|
97
99
|
| Prop | Type | Default | Description |
|
|
98
100
|
| --- | --- | --- | --- |
|
|
99
101
|
| `className?` | `string` | — | Additional Uniwind/Tailwind classes, merged after the calendar's own styles. |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Reorderable List (https://design.candescent.com/docs/components/reorderable-list)
|
|
2
2
|
|
|
3
3
|
Resources: [Storybook](https://victorious-wave-0daadf00f.6.azurestaticapps.net/?path=/story/layout-reorderablelist--default)
|
|
4
4
|
|
|
@@ -66,7 +66,7 @@ export default function ReorderableListBasicDemo() {
|
|
|
66
66
|
<ListItem showSeparator={index < contacts.length - 1}>
|
|
67
67
|
<ListItem.DragHandle accessibilityLabel={`Reorder ${item.name}`} />
|
|
68
68
|
<ListItem.LeadingSlot>
|
|
69
|
-
<Avatar
|
|
69
|
+
<Avatar>
|
|
70
70
|
<Avatar.Text>{item.name}</Avatar.Text>
|
|
71
71
|
</Avatar>
|
|
72
72
|
</ListItem.LeadingSlot>
|
|
@@ -249,7 +249,9 @@ export default function ReorderableListRemovableDemo() {
|
|
|
249
249
|
)}
|
|
250
250
|
/>
|
|
251
251
|
) : (
|
|
252
|
-
<Text
|
|
252
|
+
<Text size="sm" color="secondary" className="m-4">
|
|
253
|
+
No payees left.
|
|
254
|
+
</Text>
|
|
253
255
|
)}
|
|
254
256
|
</Card.Content>
|
|
255
257
|
</Card>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Scoped Theme (https://design.candescent.com/docs/components/scoped-theme)
|
|
2
2
|
|
|
3
3
|
Resources: [Storybook](https://victorious-wave-0daadf00f.6.azurestaticapps.net/?path=/story/theming-scopedtheme--default)
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Scroll Shadow (https://design.candescent.com/docs/components/scroll-shadow)
|
|
2
2
|
|
|
3
3
|
Resources: [Storybook](https://victorious-wave-0daadf00f.6.azurestaticapps.net/?path=/story/layout-scrollshadow--default)
|
|
4
4
|
|
|
@@ -165,6 +165,7 @@ export default function ScrollShadowHorizontalDemo() {
|
|
|
165
165
|
|
|
166
166
|
```tsx
|
|
167
167
|
import {
|
|
168
|
+
Box,
|
|
168
169
|
Card,
|
|
169
170
|
QuickActionButton,
|
|
170
171
|
ScrollShadow,
|
|
@@ -192,21 +193,23 @@ export default function ScrollShadowSurfacesDemo() {
|
|
|
192
193
|
{surface}
|
|
193
194
|
</Text>
|
|
194
195
|
<Card fullBleed className={className}>
|
|
195
|
-
<Card.Content
|
|
196
|
-
<
|
|
197
|
-
<
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
<QuickActionButton
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
196
|
+
<Card.Content>
|
|
197
|
+
<Box className="py-5">
|
|
198
|
+
<ScrollShadow surface={surface} size="large">
|
|
199
|
+
<ScrollView
|
|
200
|
+
horizontal
|
|
201
|
+
showsHorizontalScrollIndicator={false}
|
|
202
|
+
contentContainerClassName="gap-4 px-5"
|
|
203
|
+
>
|
|
204
|
+
{QUICK_ACTIONS.map((action) => (
|
|
205
|
+
<QuickActionButton key={action.label}>
|
|
206
|
+
<QuickActionButton.Icon as={action.icon} />
|
|
207
|
+
<QuickActionButton.Label>{action.label}</QuickActionButton.Label>
|
|
208
|
+
</QuickActionButton>
|
|
209
|
+
))}
|
|
210
|
+
</ScrollView>
|
|
211
|
+
</ScrollShadow>
|
|
212
|
+
</Box>
|
|
210
213
|
</Card.Content>
|
|
211
214
|
</Card>
|
|
212
215
|
</VStack>
|
|
@@ -432,16 +435,18 @@ export default function ScrollShadowStylingDemo() {
|
|
|
432
435
|
edgeClassName="w-24"
|
|
433
436
|
</Text>
|
|
434
437
|
<Card fullBleed>
|
|
435
|
-
<Card.Content
|
|
436
|
-
<
|
|
437
|
-
<
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
438
|
+
<Card.Content>
|
|
439
|
+
<Box className="py-5">
|
|
440
|
+
<ScrollShadow surface="primary" edgeClassName="w-24">
|
|
441
|
+
<ScrollView
|
|
442
|
+
horizontal
|
|
443
|
+
showsHorizontalScrollIndicator={false}
|
|
444
|
+
contentContainerClassName="px-5"
|
|
445
|
+
>
|
|
446
|
+
<CategoryPicker />
|
|
447
|
+
</ScrollView>
|
|
448
|
+
</ScrollShadow>
|
|
449
|
+
</Box>
|
|
445
450
|
</Card.Content>
|
|
446
451
|
</Card>
|
|
447
452
|
</VStack>
|
|
@@ -451,16 +456,18 @@ export default function ScrollShadowStylingDemo() {
|
|
|
451
456
|
edgeClassName="opacity-85"
|
|
452
457
|
</Text>
|
|
453
458
|
<Card fullBleed>
|
|
454
|
-
<Card.Content
|
|
455
|
-
<
|
|
456
|
-
<
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
459
|
+
<Card.Content>
|
|
460
|
+
<Box className="py-5">
|
|
461
|
+
<ScrollShadow surface="primary" size="small" edgeClassName="opacity-85">
|
|
462
|
+
<ScrollView
|
|
463
|
+
horizontal
|
|
464
|
+
showsHorizontalScrollIndicator={false}
|
|
465
|
+
contentContainerClassName="px-5"
|
|
466
|
+
>
|
|
467
|
+
<CategoryPicker />
|
|
468
|
+
</ScrollView>
|
|
469
|
+
</ScrollShadow>
|
|
470
|
+
</Box>
|
|
464
471
|
</Card.Content>
|
|
465
472
|
</Card>
|
|
466
473
|
</VStack>
|
|
@@ -40,16 +40,16 @@ export default function SelectBasicDemo() {
|
|
|
40
40
|
Use the default size for most forms and `small` for compact layouts.
|
|
41
41
|
|
|
42
42
|
```tsx
|
|
43
|
-
import { Select, Text,
|
|
43
|
+
import { Box, Select, Text, type SelectProps } from '@cdx-ui/components';
|
|
44
44
|
import { accounts } from './_data';
|
|
45
45
|
|
|
46
46
|
const sizes = ['default', 'small'] as const satisfies readonly NonNullable<SelectProps['size']>[];
|
|
47
47
|
|
|
48
48
|
export default function SelectSizesDemo() {
|
|
49
49
|
return (
|
|
50
|
-
<
|
|
50
|
+
<Box className="w-full gap-4">
|
|
51
51
|
{sizes.map((size) => (
|
|
52
|
-
<
|
|
52
|
+
<Box key={size} className="gap-2">
|
|
53
53
|
<Text size="sm" color="secondary">
|
|
54
54
|
{size}
|
|
55
55
|
</Text>
|
|
@@ -70,9 +70,9 @@ export default function SelectSizesDemo() {
|
|
|
70
70
|
))}
|
|
71
71
|
</Select.Content>
|
|
72
72
|
</Select>
|
|
73
|
-
</
|
|
73
|
+
</Box>
|
|
74
74
|
))}
|
|
75
|
-
</
|
|
75
|
+
</Box>
|
|
76
76
|
);
|
|
77
77
|
}
|
|
78
78
|
```
|
|
@@ -123,7 +123,7 @@ export default function SelectCustomTriggerDemo() {
|
|
|
123
123
|
asChild
|
|
124
124
|
indicator={<Button.Icon as={KeyboardArrowDown} position="trailing" />}
|
|
125
125
|
>
|
|
126
|
-
<Button variant="outline"
|
|
126
|
+
<Button variant="outline">
|
|
127
127
|
<Button.Label>Filter accounts</Button.Label>
|
|
128
128
|
</Button>
|
|
129
129
|
</Select.Trigger>
|
|
@@ -132,7 +132,7 @@ export default function SelectCustomTriggerDemo() {
|
|
|
132
132
|
<Select.Item
|
|
133
133
|
key={account.value}
|
|
134
134
|
value={account.value}
|
|
135
|
-
indicator={<Icon as={CheckCircle} color="action"
|
|
135
|
+
indicator={<Icon as={CheckCircle} color="action" />}
|
|
136
136
|
>
|
|
137
137
|
<Select.ItemLabel>{account.label}</Select.ItemLabel>
|
|
138
138
|
</Select.Item>
|
|
@@ -143,6 +143,79 @@ export default function SelectCustomTriggerDemo() {
|
|
|
143
143
|
}
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
+
## Custom value display
|
|
147
|
+
|
|
148
|
+
Pass children to `Select.Value` to replace the default label. Read the selected option from your own state, and render the placeholder by leaving the children empty when nothing is selected.
|
|
149
|
+
|
|
150
|
+
```tsx
|
|
151
|
+
import { useState } from 'react';
|
|
152
|
+
import { Select, Text } from '@cdx-ui/components';
|
|
153
|
+
import { accountDetails } from './_data';
|
|
154
|
+
|
|
155
|
+
export default function SelectCustomValueDemo() {
|
|
156
|
+
const [value, setValue] = useState<string>();
|
|
157
|
+
const selected = accountDetails.find((account) => account.value === value);
|
|
158
|
+
|
|
159
|
+
return (
|
|
160
|
+
<Select
|
|
161
|
+
items={accountDetails}
|
|
162
|
+
value={value}
|
|
163
|
+
onValueChange={setValue}
|
|
164
|
+
accessibilityLabel="Account"
|
|
165
|
+
className="w-full"
|
|
166
|
+
>
|
|
167
|
+
<Select.Trigger>
|
|
168
|
+
<Select.Value placeholder="Select an account…">
|
|
169
|
+
{selected && (
|
|
170
|
+
<>
|
|
171
|
+
{selected.label} <Text color="secondary">{selected.mask}</Text>
|
|
172
|
+
</>
|
|
173
|
+
)}
|
|
174
|
+
</Select.Value>
|
|
175
|
+
</Select.Trigger>
|
|
176
|
+
<Select.Content>
|
|
177
|
+
{accountDetails.map((account) => (
|
|
178
|
+
<Select.Item key={account.value} value={account.value}>
|
|
179
|
+
<Select.ItemLabel>{account.label}</Select.ItemLabel>
|
|
180
|
+
</Select.Item>
|
|
181
|
+
))}
|
|
182
|
+
</Select.Content>
|
|
183
|
+
</Select>
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Custom item display
|
|
189
|
+
|
|
190
|
+
Compose any content inside `Select.Item` to show more than a label, such as a secondary line. Keep `Select.ItemLabel` for the primary text so the selected state and keyboard navigation stay in sync.
|
|
191
|
+
|
|
192
|
+
```tsx
|
|
193
|
+
import { Select, Text, VStack } from '@cdx-ui/components';
|
|
194
|
+
import { accountDetails } from './_data';
|
|
195
|
+
|
|
196
|
+
export default function SelectCustomItemDemo() {
|
|
197
|
+
return (
|
|
198
|
+
<Select items={accountDetails} accessibilityLabel="Account" className="w-full">
|
|
199
|
+
<Select.Trigger>
|
|
200
|
+
<Select.Value placeholder="Select an account…" />
|
|
201
|
+
</Select.Trigger>
|
|
202
|
+
<Select.Content>
|
|
203
|
+
{accountDetails.map((account) => (
|
|
204
|
+
<Select.Item key={account.value} value={account.value}>
|
|
205
|
+
<VStack className="flex-1">
|
|
206
|
+
<Select.ItemLabel>{account.label}</Select.ItemLabel>
|
|
207
|
+
<Text size="sm" color="secondary">
|
|
208
|
+
{account.mask} · {account.balance}
|
|
209
|
+
</Text>
|
|
210
|
+
</VStack>
|
|
211
|
+
</Select.Item>
|
|
212
|
+
))}
|
|
213
|
+
</Select.Content>
|
|
214
|
+
</Select>
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
146
219
|
## Placement
|
|
147
220
|
|
|
148
221
|
The default placement is `bottom-start`. Choose a side alone to center the overlay, or append `-start` or `-end` to align it with the corresponding edge of the trigger. The requested side is preferred rather than guaranteed: when the overlay would overflow the viewport it still flips to the opposite side and shifts along the cross axis.
|
|
@@ -14,7 +14,7 @@ import { Skeleton } from '@cdx-ui/components';
|
|
|
14
14
|
import { Skeleton } from '@cdx-ui/components';
|
|
15
15
|
|
|
16
16
|
export default function SkeletonBasicDemo() {
|
|
17
|
-
return <Skeleton className="h-5 w-
|
|
17
|
+
return <Skeleton className="h-5 w-50" />;
|
|
18
18
|
}
|
|
19
19
|
```
|
|
20
20
|
|
|
@@ -27,7 +27,7 @@ import { Box, Skeleton } from '@cdx-ui/components';
|
|
|
27
27
|
|
|
28
28
|
export default function SkeletonTextLinesDemo() {
|
|
29
29
|
return (
|
|
30
|
-
<Box className="w-
|
|
30
|
+
<Box className="w-70 gap-2">
|
|
31
31
|
<Skeleton className="h-4 w-full" />
|
|
32
32
|
<Skeleton className="h-4 w-4/5" />
|
|
33
33
|
<Skeleton className="h-4 w-3/5" />
|
|
@@ -48,7 +48,7 @@ export default function SkeletonAvatarDemo() {
|
|
|
48
48
|
<HStack space="md" className="items-center">
|
|
49
49
|
<Skeleton className="h-10 w-10 rounded-full" />
|
|
50
50
|
<VStack space="sm">
|
|
51
|
-
<Skeleton className="h-3.5 w-
|
|
51
|
+
<Skeleton className="h-3.5 w-30" />
|
|
52
52
|
<Skeleton className="h-3 w-20" />
|
|
53
53
|
</VStack>
|
|
54
54
|
</HStack>
|
|
@@ -77,11 +77,12 @@ export default function SkeletonCardDemo() {
|
|
|
77
77
|
</Card.Header>
|
|
78
78
|
<Card.Content className="gap-3">
|
|
79
79
|
<Skeleton className="h-3.5 w-full" />
|
|
80
|
-
<Skeleton className="h-3.5 w-
|
|
81
|
-
<Skeleton className="h-3.5 w-
|
|
80
|
+
<Skeleton className="h-3.5 w-9/10" />
|
|
81
|
+
<Skeleton className="h-3.5 w-7/10" />
|
|
82
82
|
</Card.Content>
|
|
83
83
|
<Card.Footer>
|
|
84
|
-
|
|
84
|
+
{/* TODO(forge-ui): Skeleton has no button shape that follows the theme's button radius; using the default radius. */}
|
|
85
|
+
<Skeleton className="h-11 w-full" />
|
|
85
86
|
</Card.Footer>
|
|
86
87
|
</Card>
|
|
87
88
|
);
|
|
@@ -276,7 +276,7 @@ const categories = [
|
|
|
276
276
|
|
|
277
277
|
export default function TableMobileSpendingBreakdownDemo() {
|
|
278
278
|
return (
|
|
279
|
-
<Card className="w-full max-w-sm
|
|
279
|
+
<Card className="w-full max-w-sm">
|
|
280
280
|
<Card.Stripe />
|
|
281
281
|
<Card.Header>
|
|
282
282
|
<Heading size="sm">Spending this month</Heading>
|
|
@@ -340,7 +340,7 @@ const spendingDays = [
|
|
|
340
340
|
|
|
341
341
|
export default function TableMobileSpendingComparisonDemo() {
|
|
342
342
|
return (
|
|
343
|
-
<Card className="w-full max-w-sm
|
|
343
|
+
<Card className="w-full max-w-sm">
|
|
344
344
|
<Card.Stripe />
|
|
345
345
|
<Card.Header className="flex-row items-center justify-between">
|
|
346
346
|
<Heading size="sm">Spending patterns</Heading>
|