@behavioral-agentic-design-system/core 0.24.0 → 0.26.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.
Files changed (131) hide show
  1. package/package.json +5 -2
  2. package/scripts/build-tokens.cjs +79 -5
  3. package/src/app/preview/components/page.tsx +4474 -208
  4. package/src/app/shell.tsx +18 -6
  5. package/src/components/customize/brand-mark-section.tsx +1 -1
  6. package/src/components/customize-tab.tsx +2 -2
  7. package/src/components/home-tab.tsx +2 -2
  8. package/src/components/ui/action-bar.tsx +142 -0
  9. package/src/components/ui/affix.tsx +109 -0
  10. package/src/components/ui/alert.tsx +37 -3
  11. package/src/components/ui/anchor.tsx +136 -0
  12. package/src/components/ui/angle-slider.tsx +265 -0
  13. package/src/components/ui/autocomplete.tsx +223 -0
  14. package/src/components/ui/avatar.tsx +8 -2
  15. package/src/components/ui/blockquote.tsx +112 -0
  16. package/src/components/ui/bottom-navigation.tsx +144 -0
  17. package/src/components/ui/burger.tsx +117 -0
  18. package/src/components/ui/button.tsx +101 -3
  19. package/src/components/ui/calendar.tsx +1 -1
  20. package/src/components/ui/card.tsx +43 -5
  21. package/src/components/ui/carousel.tsx +10 -5
  22. package/src/components/ui/cascader.tsx +253 -0
  23. package/src/components/ui/checkbox-card.tsx +176 -0
  24. package/src/components/ui/checkbox-group.tsx +231 -0
  25. package/src/components/ui/checkbox.tsx +14 -3
  26. package/src/components/ui/chip.tsx +143 -0
  27. package/src/components/ui/circular-progress.tsx +2 -2
  28. package/src/components/ui/color-swatch.tsx +73 -0
  29. package/src/components/ui/copy-button.tsx +21 -4
  30. package/src/components/ui/date-picker.tsx +6 -3
  31. package/src/components/ui/date-range-picker.tsx +6 -3
  32. package/src/components/ui/float-label.tsx +114 -0
  33. package/src/components/ui/floating-panel.tsx +129 -0
  34. package/src/components/ui/format-number.tsx +122 -0
  35. package/src/components/ui/highlight.tsx +85 -0
  36. package/src/components/ui/image.tsx +195 -0
  37. package/src/components/ui/index.ts +50 -0
  38. package/src/components/ui/indicator.tsx +2 -2
  39. package/src/components/ui/input.tsx +48 -4
  40. package/src/components/ui/kbd.tsx +1 -1
  41. package/src/components/ui/link.tsx +158 -0
  42. package/src/components/ui/listbox.tsx +426 -0
  43. package/src/components/ui/loading-overlay.tsx +80 -0
  44. package/src/components/ui/marquee.tsx +193 -0
  45. package/src/components/ui/masonry.tsx +164 -0
  46. package/src/components/ui/meter.tsx +186 -0
  47. package/src/components/ui/motion-toggle.tsx +170 -0
  48. package/src/components/ui/notification.tsx +175 -0
  49. package/src/components/ui/overlay.tsx +63 -0
  50. package/src/components/ui/progress.tsx +95 -4
  51. package/src/components/ui/rating-group.tsx +1 -0
  52. package/src/components/ui/separator.tsx +57 -1
  53. package/src/components/ui/sidebar.tsx +1 -1
  54. package/src/components/ui/signature-pad.tsx +381 -0
  55. package/src/components/ui/skeleton.tsx +59 -2
  56. package/src/components/ui/skip-link.tsx +117 -0
  57. package/src/components/ui/slider.tsx +86 -1
  58. package/src/components/ui/spoiler.tsx +131 -0
  59. package/src/components/ui/tabs.tsx +1 -1
  60. package/src/components/ui/text.tsx +135 -0
  61. package/src/components/ui/textarea.tsx +66 -2
  62. package/src/components/ui/timeline.tsx +71 -14
  63. package/src/components/ui/timer.tsx +183 -0
  64. package/src/components/ui/tour.tsx +332 -0
  65. package/src/components/ui/transfer-list.tsx +308 -0
  66. package/src/components/ui/visually-hidden.tsx +42 -0
  67. package/src/components/ui/watermark.tsx +0 -0
  68. package/src/data/docs-index.ts +9 -2
  69. package/src/stories/ActionBar.stories.tsx +201 -0
  70. package/src/stories/Affix.stories.tsx +165 -0
  71. package/src/stories/Alert.stories.tsx +58 -0
  72. package/src/stories/Anchor.stories.tsx +236 -0
  73. package/src/stories/AngleSlider.stories.tsx +128 -0
  74. package/src/stories/Autocomplete.stories.tsx +216 -0
  75. package/src/stories/Avatar.stories.tsx +73 -1
  76. package/src/stories/Blockquote.stories.tsx +148 -0
  77. package/src/stories/BottomNavigation.stories.tsx +195 -0
  78. package/src/stories/Burger.stories.tsx +79 -0
  79. package/src/stories/Button.stories.tsx +103 -2
  80. package/src/stories/Calendar.stories.tsx +4 -0
  81. package/src/stories/Card.stories.tsx +30 -0
  82. package/src/stories/Carousel.stories.tsx +2 -1
  83. package/src/stories/Cascader.stories.tsx +285 -0
  84. package/src/stories/Checkbox.stories.tsx +13 -0
  85. package/src/stories/CheckboxCard.stories.tsx +210 -0
  86. package/src/stories/CheckboxGroup.stories.tsx +186 -0
  87. package/src/stories/Chip.stories.tsx +173 -0
  88. package/src/stories/CircularProgress.stories.tsx +3 -0
  89. package/src/stories/ColorSwatch.stories.tsx +81 -0
  90. package/src/stories/CopyButton.stories.tsx +3 -3
  91. package/src/stories/DatePicker.stories.tsx +3 -0
  92. package/src/stories/DateRangePicker.stories.tsx +3 -0
  93. package/src/stories/Editable.stories.tsx +14 -0
  94. package/src/stories/FloatLabel.stories.tsx +148 -0
  95. package/src/stories/FloatingPanel.stories.tsx +176 -0
  96. package/src/stories/FormatNumber.stories.tsx +308 -0
  97. package/src/stories/Highlight.stories.tsx +140 -0
  98. package/src/stories/Image.stories.tsx +141 -0
  99. package/src/stories/Indicator.stories.tsx +3 -0
  100. package/src/stories/Input.stories.tsx +33 -0
  101. package/src/stories/Kbd.stories.tsx +3 -0
  102. package/src/stories/Link.stories.tsx +198 -0
  103. package/src/stories/Listbox.stories.tsx +240 -0
  104. package/src/stories/LoadingOverlay.stories.tsx +148 -0
  105. package/src/stories/Marquee.stories.tsx +170 -0
  106. package/src/stories/Masonry.stories.tsx +227 -0
  107. package/src/stories/Meter.stories.tsx +143 -0
  108. package/src/stories/MotionToggle.stories.tsx +85 -0
  109. package/src/stories/Notification.stories.tsx +264 -0
  110. package/src/stories/Overlay.stories.tsx +169 -0
  111. package/src/stories/PasswordInput.stories.tsx +4 -0
  112. package/src/stories/Progress.stories.tsx +70 -27
  113. package/src/stories/RatingGroup.stories.tsx +5 -0
  114. package/src/stories/Separator.stories.tsx +41 -5
  115. package/src/stories/Sidebar.stories.tsx +2 -1
  116. package/src/stories/SignaturePad.stories.tsx +112 -0
  117. package/src/stories/Skeleton.stories.tsx +23 -4
  118. package/src/stories/SkipLink.stories.tsx +137 -0
  119. package/src/stories/Slider.stories.tsx +28 -0
  120. package/src/stories/Spoiler.stories.tsx +122 -0
  121. package/src/stories/Tabs.stories.tsx +2 -1
  122. package/src/stories/Text.stories.tsx +191 -0
  123. package/src/stories/Textarea.stories.tsx +58 -6
  124. package/src/stories/Timeline.stories.tsx +82 -0
  125. package/src/stories/Timer.stories.tsx +160 -0
  126. package/src/stories/Tour.stories.tsx +191 -0
  127. package/src/stories/TransferList.stories.tsx +169 -0
  128. package/src/stories/VisuallyHidden.stories.tsx +105 -0
  129. package/src/stories/Watermark.stories.tsx +212 -0
  130. package/src/styles.css +80 -6
  131. package/src/tokens.json +2 -2
@@ -17,6 +17,12 @@ import {
17
17
  AccordionContent,
18
18
  } from "@behavioral-agentic-design-system/core/components/ui/accordion";
19
19
  import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
20
+ import {
21
+ Marquee,
22
+ MarqueeItem,
23
+ } from "@behavioral-agentic-design-system/core/components/ui/marquee";
24
+ import { Masonry } from "@behavioral-agentic-design-system/core/components/ui/masonry";
25
+ import { FormatNumber } from "@behavioral-agentic-design-system/core/components/ui/format-number";
20
26
  import { ButtonGroup } from "@behavioral-agentic-design-system/core/components/ui/button-group";
21
27
  import { Input } from "@behavioral-agentic-design-system/core/components/ui/input";
22
28
  import {
@@ -39,13 +45,30 @@ import {
39
45
  DataListValue,
40
46
  } from "@behavioral-agentic-design-system/core/components/ui/data-list";
41
47
  import { Label } from "@behavioral-agentic-design-system/core/components/ui/label";
48
+ import { Meter } from "@behavioral-agentic-design-system/core/components/ui/meter";
49
+ import {
50
+ SignaturePad,
51
+ type SignaturePadHandle,
52
+ } from "@behavioral-agentic-design-system/core/components/ui/signature-pad";
42
53
  import { Badge } from "@behavioral-agentic-design-system/core/components/ui/badge";
43
54
  import { Switch } from "@behavioral-agentic-design-system/core/components/ui/switch";
44
55
  import { Checkbox } from "@behavioral-agentic-design-system/core/components/ui/checkbox";
56
+ import {
57
+ CheckboxGroup,
58
+ CheckboxGroupItem,
59
+ CheckboxGroupSelectAll,
60
+ } from "@behavioral-agentic-design-system/core/components/ui/checkbox-group";
61
+ import {
62
+ Blockquote,
63
+ BlockquoteContent,
64
+ BlockquoteAttribution,
65
+ } from "@behavioral-agentic-design-system/core/components/ui/blockquote";
66
+ import { Text, Heading } from "@behavioral-agentic-design-system/core/components/ui/text";
67
+ import { Link } from "@behavioral-agentic-design-system/core/components/ui/link";
45
68
  import { RadioGroup, RadioGroupItem } from "@behavioral-agentic-design-system/core/components/ui/radio-group";
46
69
  import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@behavioral-agentic-design-system/core/components/ui/card";
47
70
  import { Alert, AlertDescription, AlertTitle } from "@behavioral-agentic-design-system/core/components/ui/alert";
48
- import { Avatar, AvatarFallback, AvatarImage } from "@behavioral-agentic-design-system/core/components/ui/avatar";
71
+ import { Avatar, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage } from "@behavioral-agentic-design-system/core/components/ui/avatar";
49
72
  import { Separator } from "@behavioral-agentic-design-system/core/components/ui/separator";
50
73
  import { Skeleton } from "@behavioral-agentic-design-system/core/components/ui/skeleton";
51
74
  import { Progress } from "@behavioral-agentic-design-system/core/components/ui/progress";
@@ -91,6 +114,8 @@ import {
91
114
  } from "@behavioral-agentic-design-system/core/components/ui/stepper";
92
115
  import { PinInput } from "@behavioral-agentic-design-system/core/components/ui/pin-input";
93
116
  import { PasswordInput } from "@behavioral-agentic-design-system/core/components/ui/password-input";
117
+ import { Notification } from "@behavioral-agentic-design-system/core/components/ui/notification";
118
+ import { FloatingPanel } from "@behavioral-agentic-design-system/core/components/ui/floating-panel";
94
119
  import { NumberInput } from "@behavioral-agentic-design-system/core/components/ui/number-input";
95
120
  import { FileUpload } from "@behavioral-agentic-design-system/core/components/ui/file-upload";
96
121
  import { Spinner } from "@behavioral-agentic-design-system/core/components/ui/spinner";
@@ -150,6 +175,7 @@ import {
150
175
  RedoIcon,
151
176
  ChevronLeftIcon,
152
177
  ChevronRightIcon,
178
+ ArrowUpIcon,
153
179
  } from "lucide-react";
154
180
  import {
155
181
  Menubar,
@@ -175,14 +201,41 @@ import {
175
201
  HoverCardDescription,
176
202
  HoverCardTrigger,
177
203
  } from "@behavioral-agentic-design-system/core/components/ui/hover-card";
178
- import { Sparkles, Info, CircleAlert, CalendarIcon, BuildingIcon, CheckIcon, CreditCardIcon, ClipboardCheckIcon, TrophyIcon, UserCheckIcon, XIcon, ZapIcon, StarIcon, ShieldCheckIcon, InboxIcon, WifiOffIcon, ClipboardListIcon, PlusIcon } from "lucide-react";
204
+ import { Sparkles, Info, CircleAlert, CalendarIcon, BuildingIcon, CheckIcon, CreditCardIcon, ClipboardCheckIcon, TrophyIcon, UserCheckIcon, XIcon, ZapIcon, StarIcon, ShieldCheckIcon, InboxIcon, WifiOffIcon, ClipboardListIcon, PlusIcon, HomeIcon, SearchIcon, LibraryIcon, PaletteIcon, UserIcon, BellIcon, BookOpenIcon, DownloadIcon, TriangleAlertIcon, CheckCircle2Icon, GitPullRequestIcon, MessageSquareIcon } from "lucide-react";
205
+ import {
206
+ BottomNavigation,
207
+ BottomNavigationItem,
208
+ } from "@behavioral-agentic-design-system/core/components/ui/bottom-navigation";
209
+ import { TransferList as TransferListComponent } from "@behavioral-agentic-design-system/core/components/ui/transfer-list";
210
+ import { Watermark } from "@behavioral-agentic-design-system/core/components/ui/watermark";
211
+ import { Tour } from "@behavioral-agentic-design-system/core/components/ui/tour";
212
+ import {
213
+ Listbox,
214
+ ListboxRoot,
215
+ ListboxOption,
216
+ } from "@behavioral-agentic-design-system/core/components/ui/listbox";
217
+ import { Image } from "@behavioral-agentic-design-system/core/components/ui/image";
218
+ import { Anchor } from "@behavioral-agentic-design-system/core/components/ui/anchor";
219
+ import { FloatLabel } from "@behavioral-agentic-design-system/core/components/ui/float-label";
220
+ import { LoadingOverlay } from "@behavioral-agentic-design-system/core/components/ui/loading-overlay";
221
+ import { Overlay } from "@behavioral-agentic-design-system/core/components/ui/overlay";
222
+ import { Cascader, type CascaderOption } from "@behavioral-agentic-design-system/core/components/ui/cascader";
223
+ import { Affix } from "@behavioral-agentic-design-system/core/components/ui/affix";
224
+ import { SkipLink, SkipTarget } from "@behavioral-agentic-design-system/core/components/ui/skip-link";
225
+ import { Timer } from "@behavioral-agentic-design-system/core/components/ui/timer";
226
+ import { Burger } from "@behavioral-agentic-design-system/core/components/ui/burger";
179
227
  import { DatePicker } from "@behavioral-agentic-design-system/core/components/ui/date-picker";
180
228
  import { DateRangePicker } from "@behavioral-agentic-design-system/core/components/ui/date-range-picker";
181
229
  import { RatingGroup } from "@behavioral-agentic-design-system/core/components/ui/rating-group";
182
230
  import { SegmentedControl, SegmentedControlItem } from "@behavioral-agentic-design-system/core/components/ui/segmented-control";
231
+ import { MotionToggle } from "@behavioral-agentic-design-system/core/components/ui/motion-toggle";
183
232
  import { Timeline, TimelineItem } from "@behavioral-agentic-design-system/core/components/ui/timeline";
184
233
  import { TagsInput } from "@behavioral-agentic-design-system/core/components/ui/tags-input";
234
+ import { Autocomplete } from "@behavioral-agentic-design-system/core/components/ui/autocomplete";
185
235
  import { TimePicker } from "@behavioral-agentic-design-system/core/components/ui/time-picker";
236
+ import { VisuallyHidden } from "@behavioral-agentic-design-system/core/components/ui/visually-hidden";
237
+ import { AngleSlider } from "@behavioral-agentic-design-system/core/components/ui/angle-slider";
238
+ import { Chip } from "@behavioral-agentic-design-system/core/components/ui/chip";
186
239
 
187
240
  import { Toaster } from "@behavioral-agentic-design-system/core/components/ui/sonner";
188
241
  import { toast } from "sonner";
@@ -274,7 +327,7 @@ import {
274
327
  SheetTitle,
275
328
  SheetTrigger,
276
329
  } from "@behavioral-agentic-design-system/core/components/ui/sheet";
277
- import { TrendingUp, MoreHorizontal, Folder, File, FileText, Settings as SettingsIcon, Users as UsersIcon, Search } from "lucide-react";
330
+ import { TrendingUp, MoreHorizontal, Folder, File, FileText, Settings as SettingsIcon, Users as UsersIcon, Search, Archive as ArchiveIcon, Trash2 as Trash2Icon } from "lucide-react";
278
331
  import {
279
332
  Tree,
280
333
  TreeItem,
@@ -282,6 +335,7 @@ import {
282
335
  TreeItemContent,
283
336
  } from "@behavioral-agentic-design-system/core/components/ui/tree-view";
284
337
  import { ColorPicker } from "@behavioral-agentic-design-system/core/components/ui/color-picker";
338
+ import { ColorSwatch } from "@behavioral-agentic-design-system/core/components/ui/color-swatch";
285
339
  import { NativeSelect } from "@behavioral-agentic-design-system/core/components/ui/native-select";
286
340
  import {
287
341
  Editable,
@@ -291,6 +345,10 @@ import {
291
345
  EditableSubmit,
292
346
  } from "@behavioral-agentic-design-system/core/components/ui/editable";
293
347
  import { QRCode } from "@behavioral-agentic-design-system/core/components/ui/qr-code";
348
+ import { Highlight } from "@behavioral-agentic-design-system/core/components/ui/highlight";
349
+ import { Spoiler } from "@behavioral-agentic-design-system/core/components/ui/spoiler";
350
+ import { ActionBar } from "@behavioral-agentic-design-system/core/components/ui/action-bar";
351
+ import { CheckboxCard, RadioCard } from "@behavioral-agentic-design-system/core/components/ui/checkbox-card";
294
352
 
295
353
  // Stable, deterministic data for ScrollArea — never use Math.random in
296
354
  // SSR-rendered output, it causes hydration mismatches.
@@ -540,6 +598,17 @@ export default function ComponentsPreview() {
540
598
  <Button variant="destructive">Destructive</Button>
541
599
  <Button variant="accent">Accent</Button>
542
600
  </div>
601
+ <Separator className="my-4" />
602
+ <div className="space-y-1.5">
603
+ <p className="text-xs font-medium text-muted-foreground">Loading — spinner + aria-busy, disabled so it can&apos;t re-fire</p>
604
+ <div className="flex flex-wrap items-center gap-3">
605
+ <Button loading>Saving</Button>
606
+ <Button loading variant="secondary">Saving</Button>
607
+ <Button loading variant="outline">Saving</Button>
608
+ <Button loading variant="destructive">Deleting</Button>
609
+ <Button loading size="xl">Publishing</Button>
610
+ </div>
611
+ </div>
543
612
  </Section>
544
613
 
545
614
  <Section title="ButtonGroup">
@@ -676,10 +745,41 @@ export default function ComponentsPreview() {
676
745
  </div>
677
746
  <Separator className="my-4" />
678
747
  <div className="space-y-3">
679
- <Label>Slider</Label>
680
- <Slider defaultValue={[40]} max={100} step={1} />
748
+ <Label id="form-controls-slider-label">Slider</Label>
749
+ <Slider
750
+ defaultValue={[40]}
751
+ max={100}
752
+ step={1}
753
+ aria-labelledby="form-controls-slider-label"
754
+ />
755
+ <Label className="pt-3">Slider with marks</Label>
756
+ <Slider
757
+ defaultValue={[50]}
758
+ max={100}
759
+ step={25}
760
+ aria-label="Quality"
761
+ marks={[
762
+ { value: 0, label: "Low" },
763
+ { value: 25 },
764
+ { value: 50, label: "Med" },
765
+ { value: 75 },
766
+ { value: 100, label: "High" },
767
+ ]}
768
+ />
681
769
  <Label className="pt-3">Progress</Label>
682
- <Progress value={62} />
770
+ <Progress value={62} aria-label="Progress" />
771
+ <Label className="pt-3">Progress with label &amp; value</Label>
772
+ <div className="space-y-4">
773
+ <Progress value={62} label="Token migration" />
774
+ <Progress value={100} label="Storybook coverage" showValue />
775
+ <Progress
776
+ value={14}
777
+ max={36}
778
+ label="a11y contracts reviewed"
779
+ showValue
780
+ getValueLabel={(value, max) => `${value} of ${max} components`}
781
+ />
782
+ </div>
683
783
  </div>
684
784
  </Section>
685
785
 
@@ -702,6 +802,45 @@ export default function ComponentsPreview() {
702
802
  <Skeleton className="h-9 w-9 rounded-full" />
703
803
  <Skeleton className="h-9 w-32" />
704
804
  </div>
805
+ <div className="mt-3 flex items-center gap-3">
806
+ <span className="text-xs font-medium text-muted-foreground">shape:</span>
807
+ <Avatar shape="circle" size="lg">
808
+ <AvatarFallback>JR</AvatarFallback>
809
+ </Avatar>
810
+ <Avatar shape="square" size="lg">
811
+ <AvatarFallback>AP</AvatarFallback>
812
+ </Avatar>
813
+ <Avatar shape="square">
814
+ <AvatarFallback>KA</AvatarFallback>
815
+ </Avatar>
816
+ <Avatar shape="square" size="sm">
817
+ <AvatarFallback>SP</AvatarFallback>
818
+ </Avatar>
819
+ </div>
820
+ <div className="mt-3 flex items-center gap-3">
821
+ <span className="text-xs font-medium text-muted-foreground">group:</span>
822
+ <AvatarGroup aria-label="Project contributors: Jordan Reeves, Seo-yun Park, Marcus Lindqvist, and 3 more">
823
+ <Avatar>
824
+ <AvatarFallback>JR</AvatarFallback>
825
+ </Avatar>
826
+ <Avatar>
827
+ <AvatarFallback>SP</AvatarFallback>
828
+ </Avatar>
829
+ <Avatar>
830
+ <AvatarFallback>ML</AvatarFallback>
831
+ </Avatar>
832
+ <AvatarGroupCount title="Anika Patel and 2 more">+3</AvatarGroupCount>
833
+ </AvatarGroup>
834
+ </div>
835
+ <div className="mt-3 flex items-start gap-3">
836
+ <span className="text-xs font-medium text-muted-foreground">skeleton shape:</span>
837
+ <Skeleton shape="circle" className="size-6" />
838
+ <Skeleton shape="circle" />
839
+ <div className="w-40">
840
+ <Skeleton shape="text" lines={3} />
841
+ </div>
842
+ <Skeleton className="h-10 w-24" />
843
+ </div>
705
844
  </Section>
706
845
 
707
846
  <Section title="Cards & Alerts">
@@ -717,6 +856,20 @@ export default function ComponentsPreview() {
717
856
  </p>
718
857
  </CardContent>
719
858
  </Card>
859
+ <Card variant="elevated">
860
+ <CardHeader>
861
+ <CardTitle>Elevated card</CardTitle>
862
+ <CardDescription>
863
+ variant=&quot;elevated&quot; — the lifted surface tier.
864
+ </CardDescription>
865
+ </CardHeader>
866
+ <CardContent>
867
+ <p className="text-sm text-muted-foreground">
868
+ Use for the primary card on a surface; elevation signals
869
+ priority, not decoration.
870
+ </p>
871
+ </CardContent>
872
+ </Card>
720
873
  <Alert>
721
874
  <Info className="size-5" />
722
875
  <AlertTitle>Heads up</AlertTitle>
@@ -1409,20 +1562,30 @@ export default function ComponentsPreview() {
1409
1562
  </div>
1410
1563
  </div>
1411
1564
  </div>
1412
- {/* Variants */}
1565
+ {/* Variants — shown on their natural surfaces so color reads correctly.
1566
+ In BADS's monochromatic default palette, --primary ≈ --foreground,
1567
+ so default and primary look similar here. Forks with a colorful
1568
+ --primary (blue, teal, etc.) will see a distinct brand-colored ring. */}
1413
1569
  <div className="space-y-3">
1414
1570
  <p className="text-sm font-medium text-muted-foreground">Variants</p>
1415
- <div className="flex flex-wrap items-center gap-6">
1571
+ <div className="flex flex-wrap items-center gap-4">
1416
1572
  <div className="flex flex-col items-center gap-2">
1417
- <Spinner variant="default" />
1573
+ <div className="flex size-16 items-center justify-center rounded-md border bg-card">
1574
+ <Spinner variant="default" />
1575
+ </div>
1418
1576
  <span className="text-xs text-muted-foreground">default</span>
1419
1577
  </div>
1420
1578
  <div className="flex flex-col items-center gap-2">
1421
- <Spinner variant="muted" />
1579
+ <div className="flex size-16 items-center justify-center rounded-md bg-muted">
1580
+ <Spinner variant="muted" />
1581
+ </div>
1422
1582
  <span className="text-xs text-muted-foreground">muted</span>
1423
1583
  </div>
1424
1584
  <div className="flex flex-col items-center gap-2">
1425
- <Spinner variant="primary" />
1585
+ <div className="flex size-16 items-center justify-center rounded-md bg-primary">
1586
+ {/* [&>svg] targets the SVG directly since className on Spinner goes to the wrapper span */}
1587
+ <Spinner variant="primary" className="[&>svg]:text-primary-foreground" />
1588
+ </div>
1426
1589
  <span className="text-xs text-muted-foreground">primary</span>
1427
1590
  </div>
1428
1591
  </div>
@@ -2301,6 +2464,37 @@ export default function ComponentsPreview() {
2301
2464
  />
2302
2465
  </Timeline>
2303
2466
  </div>
2467
+ <div className="space-y-3">
2468
+ <p className="text-sm font-medium text-muted-foreground">
2469
+ Alternate orientation — centered spine, items alternate sides at md+ (falls back to vertical below md)
2470
+ </p>
2471
+ <Timeline orientation="alternate">
2472
+ <TimelineItem
2473
+ status="complete"
2474
+ title="Token proposal shared"
2475
+ description="tokens-v2 draft sent to Jordan Reeves."
2476
+ time="May 26"
2477
+ />
2478
+ <TimelineItem
2479
+ status="complete"
2480
+ title="Semantic layer approved"
2481
+ description="Seo-yun Park signed off on the 7:1 contrast pairs."
2482
+ time="Jun 20"
2483
+ />
2484
+ <TimelineItem
2485
+ status="active"
2486
+ title="Component migration"
2487
+ description="14 of 36 components on the new tokens."
2488
+ time="Jul 9 (today)"
2489
+ />
2490
+ <TimelineItem
2491
+ status="pending"
2492
+ title="tokens-v2 released"
2493
+ description="Published to npm with the migration guide."
2494
+ time="Jul 21 (estimated)"
2495
+ />
2496
+ </Timeline>
2497
+ </div>
2304
2498
  <div className="space-y-3">
2305
2499
  <p className="text-sm font-medium text-muted-foreground">Realistic use — component adoption journey</p>
2306
2500
  <TimelineRealisticDemo />
@@ -2487,6 +2681,19 @@ export default function ComponentsPreview() {
2487
2681
  <Label htmlFor="ta-invalid">Invalid</Label>
2488
2682
  <Textarea id="ta-invalid" aria-invalid defaultValue="Too short" />
2489
2683
  </div>
2684
+ <div className="space-y-2">
2685
+ <Label htmlFor="ta-count">Character count</Label>
2686
+ <Textarea id="ta-count" placeholder="Tell the team about yourself…" showCount />
2687
+ </div>
2688
+ <div className="space-y-2">
2689
+ <Label htmlFor="ta-count-max">Count with max</Label>
2690
+ <Textarea
2691
+ id="ta-count-max"
2692
+ placeholder="Short bio (max 160 chars)…"
2693
+ showCount
2694
+ maxLength={160}
2695
+ />
2696
+ </div>
2490
2697
  </div>
2491
2698
  </Section>
2492
2699
 
@@ -3423,151 +3630,2776 @@ export default function ComponentsPreview() {
3423
3630
  </div>
3424
3631
  </div>
3425
3632
  </Section>
3426
- </div>
3427
- </div>
3428
- );
3429
- }
3430
3633
 
3431
- function DatePickerShowcase({
3432
- size,
3433
- placeholder,
3434
- defaultValue,
3435
- clearable,
3436
- }: {
3437
- size?: "sm" | "default" | "lg";
3438
- placeholder?: string;
3439
- defaultValue?: Date;
3440
- clearable?: boolean;
3441
- }) {
3442
- const [date, setDate] = React.useState<Date | undefined>(defaultValue);
3443
- return (
3444
- <DatePicker
3445
- size={size}
3446
- value={date}
3447
- onValueChange={setDate}
3448
- placeholder={placeholder}
3449
- clearable={clearable}
3450
- />
3451
- );
3452
- }
3634
+ <Section title="Color Swatch">
3635
+ <div className="space-y-8">
3636
+ <div>
3637
+ <p className="mb-3 text-xs text-muted-foreground">
3638
+ Shapes — rounded (default), circle, square. Each carries a
3639
+ token-driven inset ring so it reads on any canvas.
3640
+ </p>
3641
+ <div className="flex items-center gap-3">
3642
+ <ColorSwatch color="#2563eb" shape="rounded" aria-label="Blue, rounded" />
3643
+ <ColorSwatch color="#16a34a" shape="circle" aria-label="Green, circle" />
3644
+ <ColorSwatch color="#ea580c" shape="square" aria-label="Orange, square" />
3645
+ </div>
3646
+ </div>
3453
3647
 
3454
- function DatePickerScheduleForm() {
3455
- const [startDate, setStartDate] = React.useState<Date | undefined>(undefined);
3456
- const [endDate, setEndDate] = React.useState<Date | undefined>(undefined);
3457
- return (
3458
- <Card className="w-80"><CardContent className="p-4 space-y-4">
3459
- <div className="space-y-1">
3460
- <p className="text-sm font-semibold">Schedule release window</p>
3461
- <p className="text-xs text-muted-foreground">
3462
- Design System Team · Q2 2026
3463
- </p>
3464
- </div>
3465
- <div className="space-y-3">
3466
- <div className="space-y-1.5">
3467
- <label className="text-sm font-medium">Start date</label>
3468
- <DatePicker
3469
- value={startDate}
3470
- onValueChange={setStartDate}
3471
- placeholder="Pick start date"
3472
- clearable
3473
- toDate={endDate}
3474
- />
3475
- </div>
3476
- <div className="space-y-1.5">
3477
- <label className="text-sm font-medium">End date</label>
3478
- <DatePicker
3479
- value={endDate}
3480
- onValueChange={setEndDate}
3481
- placeholder="Pick end date"
3482
- clearable
3483
- fromDate={startDate}
3484
- />
3485
- </div>
3486
- </div>
3487
- <div className="flex justify-end gap-2">
3488
- <Button variant="outline" size="sm" className="min-h-11">Cancel</Button>
3489
- <Button size="sm" className="min-h-11">Schedule</Button>
3490
- </div>
3491
- </CardContent></Card>
3492
- );
3493
- }
3648
+ <div>
3649
+ <p className="mb-3 text-xs text-muted-foreground">
3650
+ Sizes — sm (16px) / default (24px) / lg (32px)
3651
+ </p>
3652
+ <div className="flex items-center gap-3">
3653
+ <ColorSwatch color="#2563eb" size="sm" aria-label="Blue, small" />
3654
+ <ColorSwatch color="#2563eb" size="default" aria-label="Blue, default" />
3655
+ <ColorSwatch color="#2563eb" size="lg" aria-label="Blue, large" />
3656
+ </div>
3657
+ </div>
3494
3658
 
3495
- function RatingGroupShowcase({
3496
- size,
3497
- defaultValue = 0,
3498
- label,
3499
- }: {
3500
- size?: "sm" | "default" | "lg";
3501
- defaultValue?: number;
3502
- label: string;
3503
- }) {
3504
- const [value, setValue] = React.useState(defaultValue);
3505
- return <RatingGroup size={size} value={value} onValueChange={setValue} label={label} />;
3506
- }
3659
+ <div>
3660
+ <p className="mb-3 text-xs text-muted-foreground">
3661
+ Realistic use — a palette row plus a selected swatch that
3662
+ composes a check icon as a child.
3663
+ </p>
3664
+ <div className="flex flex-col gap-4">
3665
+ <div className="flex items-center gap-2">
3666
+ {[
3667
+ { c: "#ef4444", n: "Red" },
3668
+ { c: "#f97316", n: "Orange" },
3669
+ { c: "#eab308", n: "Amber" },
3670
+ { c: "#22c55e", n: "Green" },
3671
+ { c: "#06b6d4", n: "Cyan" },
3672
+ { c: "#3b82f6", n: "Blue" },
3673
+ { c: "#8b5cf6", n: "Violet" },
3674
+ ].map((s) => (
3675
+ <ColorSwatch key={s.c} color={s.c} shape="circle" aria-label={s.n} />
3676
+ ))}
3677
+ </div>
3678
+ <div className="flex items-center gap-3 text-sm">
3679
+ <ColorSwatch color="#171717" size="lg" aria-label="Selected: near-black">
3680
+ <CheckIcon strokeWidth={1.5} className="text-white" />
3681
+ </ColorSwatch>
3682
+ <span className="tabular-nums text-muted-foreground">
3683
+ #171717 · selected
3684
+ </span>
3685
+ </div>
3686
+ </div>
3687
+ </div>
3688
+ </div>
3689
+ </Section>
3507
3690
 
3508
- function SegmentedControlShowcase() {
3509
- const [view, setView] = React.useState("grid");
3510
- const [period, setPeriod] = React.useState("month");
3511
- const [filter, setFilter] = React.useState("active");
3512
- return (
3513
- <div className="flex flex-col gap-6">
3514
- <div className="flex flex-col gap-4">
3515
- <p className="text-sm font-medium text-muted-foreground">Size sm</p>
3516
- <SegmentedControl value={period} onValueChange={setPeriod} size="sm" label="Time period">
3517
- <SegmentedControlItem value="day">Day</SegmentedControlItem>
3518
- <SegmentedControlItem value="week">Week</SegmentedControlItem>
3519
- <SegmentedControlItem value="month">Month</SegmentedControlItem>
3520
- </SegmentedControl>
3691
+ <Section title="Highlight">
3692
+ <div className="space-y-8">
3693
+ <div>
3694
+ <p className="mb-3 text-xs text-muted-foreground">
3695
+ Default — every case-insensitive occurrence of the query wraps
3696
+ in a semantic {"<mark>"} on the audited primary token pair.
3697
+ </p>
3698
+ <p className="max-w-md text-sm leading-relaxed">
3699
+ <Highlight highlight="tokens">
3700
+ BADS ships with tokens, components, and accessibility baked
3701
+ in. Fork it, rename it, customize the brand colors, and
3702
+ start building.
3703
+ </Highlight>
3704
+ </p>
3705
+ </div>
3521
3706
 
3522
- <p className="text-sm font-medium text-muted-foreground">Default — view toggle</p>
3523
- <SegmentedControl value={view} onValueChange={setView} label="View">
3524
- <SegmentedControlItem value="list">List</SegmentedControlItem>
3525
- <SegmentedControlItem value="grid">Grid</SegmentedControlItem>
3526
- <SegmentedControlItem value="map">Map</SegmentedControlItem>
3527
- </SegmentedControl>
3707
+ <div>
3708
+ <p className="mb-3 text-xs text-muted-foreground">
3709
+ Multiple terms — pass an array; regex-special characters in
3710
+ queries (7:1, $249.00) are escaped automatically.
3711
+ </p>
3712
+ <p className="max-w-md text-sm leading-relaxed">
3713
+ <Highlight highlight={["AAA", "7:1", "$249.00"]}>
3714
+ Every shipped token pair passes 7:1 (AAA) in both modes, and
3715
+ the Pro tier is $249.00 per seat.
3716
+ </Highlight>
3717
+ </p>
3718
+ </div>
3528
3719
 
3529
- <p className="text-sm font-medium text-muted-foreground">With disabled item</p>
3530
- <SegmentedControl value={filter} onValueChange={setFilter} label="Filter">
3531
- <SegmentedControlItem value="all">All</SegmentedControlItem>
3532
- <SegmentedControlItem value="active">Active</SegmentedControlItem>
3533
- <SegmentedControlItem value="archived">Archived</SegmentedControlItem>
3534
- <SegmentedControlItem value="deleted" disabled>Deleted</SegmentedControlItem>
3535
- </SegmentedControl>
3720
+ <div>
3721
+ <p className="mb-3 text-xs text-muted-foreground">
3722
+ Custom mark — markClassName restyles the marks with token
3723
+ classes for subtler surfaces.
3724
+ </p>
3725
+ <p className="max-w-md text-sm leading-relaxed">
3726
+ <Highlight
3727
+ highlight="semantic layer"
3728
+ markClassName="bg-secondary text-secondary-foreground underline underline-offset-4 decoration-2"
3729
+ >
3730
+ A semantic layer names tokens for their purpose — like
3731
+ primary or destructive — rather than their raw value.
3732
+ </Highlight>
3733
+ </p>
3734
+ </div>
3536
3735
 
3537
- <p className="text-sm font-medium text-muted-foreground">Disabled</p>
3538
- <SegmentedControl value="week" onValueChange={() => {}} disabled label="Disabled">
3539
- <SegmentedControlItem value="day">Day</SegmentedControlItem>
3540
- <SegmentedControlItem value="week">Week</SegmentedControlItem>
3541
- <SegmentedControlItem value="month">Month</SegmentedControlItem>
3542
- </SegmentedControl>
3543
- </div>
3736
+ <div>
3737
+ <p className="mb-3 text-xs text-muted-foreground">
3738
+ Realistic use — search results with the query marked in titles
3739
+ and snippets. The result count carries the information; the
3740
+ marks are visual emphasis (screen readers skip {"<mark>"}).
3741
+ </p>
3742
+ <Card className="w-96">
3743
+ <CardContent className="space-y-4 p-4">
3744
+ <div className="space-y-1">
3745
+ <p className="text-sm font-semibold">Search results</p>
3746
+ <p className="text-xs text-muted-foreground">
3747
+ 3 matches for &ldquo;token&rdquo; · design.bads.com/docs
3748
+ </p>
3749
+ </div>
3750
+ <ul className="space-y-3">
3751
+ {[
3752
+ {
3753
+ title: "Customize your tokens",
3754
+ snippet:
3755
+ "Token changes saved. Run pnpm build:tokens to regenerate CSS.",
3756
+ },
3757
+ {
3758
+ title: "Set up your design system in five minutes",
3759
+ snippet:
3760
+ "Token build failed. Check tokens.json for syntax errors and run pnpm build:tokens again.",
3761
+ },
3762
+ {
3763
+ title: "Your design system at a glance",
3764
+ snippet:
3765
+ "36 components, all passing AAA contrast. Last token change was 3 days ago.",
3766
+ },
3767
+ ].map((result) => (
3768
+ <li key={result.title} className="space-y-0.5">
3769
+ <p className="text-sm font-medium">
3770
+ <Highlight highlight="token">
3771
+ {result.title}
3772
+ </Highlight>
3773
+ </p>
3774
+ <p className="text-xs leading-relaxed text-muted-foreground">
3775
+ <Highlight highlight="token">
3776
+ {result.snippet}
3777
+ </Highlight>
3778
+ </p>
3779
+ </li>
3780
+ ))}
3781
+ </ul>
3782
+ </CardContent>
3783
+ </Card>
3784
+ </div>
3785
+ </div>
3786
+ </Section>
3544
3787
 
3545
- <Card className="w-80"><CardContent className="p-4 space-y-3">
3546
- <p className="text-sm font-semibold">Component library</p>
3547
- <SegmentedControl value={filter} onValueChange={setFilter} label="Status filter">
3548
- <SegmentedControlItem value="active">Active</SegmentedControlItem>
3549
- <SegmentedControlItem value="archived">Deprecated</SegmentedControlItem>
3550
- <SegmentedControlItem value="all">All</SegmentedControlItem>
3551
- </SegmentedControl>
3552
- <p className="text-xs text-muted-foreground">
3553
- Showing{" "}
3554
- <span className="font-medium text-foreground">
3555
- {filter === "active" ? "active" : filter === "archived" ? "deprecated" : "all"}
3556
- </span>{" "}
3557
- components · reviewed by Avery Castillo
3558
- </p>
3559
- </CardContent></Card>
3560
- </div>
3561
- );
3562
- }
3788
+ <Section title="Spoiler">
3789
+ <div className="space-y-8">
3790
+ <div>
3791
+ <p className="mb-3 text-xs text-muted-foreground">
3792
+ Default — long content overflows the 96px clamp, so the
3793
+ measured toggle appears. Expand/collapse animates max-height
3794
+ on the motion tokens.
3795
+ </p>
3796
+ <div className="max-w-md">
3797
+ <Spoiler maxHeight={96}>
3798
+ <p className="text-sm leading-relaxed">
3799
+ Jordan Reeves leads the design systems practice at a
3800
+ mid-size product company in Austin. They spent six years
3801
+ shipping component libraries before this one — first a
3802
+ homegrown Sass framework nobody documented, then a
3803
+ Figma-library-only system that drifted from the code
3804
+ within a quarter. Now they run a three-person team that
3805
+ owns the tokens, reviews every new primitive against its
3806
+ a11y contract, and pressure-tests each release against
3807
+ the personas file before it ships. Jordan reads component
3808
+ source before adopting anything, cares about 7:1 contrast
3809
+ the way other people care about typography, and will
3810
+ absolutely bounce a PR for a hardcoded hex value.
3811
+ </p>
3812
+ </Spoiler>
3813
+ </div>
3814
+ </div>
3563
3815
 
3564
- function TimelineRealisticDemo() {
3565
- return (
3566
- <Card className="w-96">
3567
- <CardContent className="p-5 space-y-4">
3568
- <div className="space-y-0.5">
3569
- <p className="text-sm font-semibold">Button · v2.4.0 release</p>
3570
- <p className="text-xs text-muted-foreground">Design System Team</p>
3816
+ <div>
3817
+ <p className="mb-3 text-xs text-muted-foreground">
3818
+ Short content — fits under maxHeight, so NO toggle renders.
3819
+ The measured, conditional control is the contract; short
3820
+ content never grows a dead button.
3821
+ </p>
3822
+ <div className="max-w-md">
3823
+ <Spoiler maxHeight={96}>
3824
+ <p className="text-sm leading-relaxed">
3825
+ 36 components, all passing AAA contrast. Last token
3826
+ change was 3 days ago.
3827
+ </p>
3828
+ </Spoiler>
3829
+ </div>
3830
+ </div>
3831
+
3832
+ <div>
3833
+ <p className="mb-3 text-xs text-muted-foreground">
3834
+ Custom labels + realistic use — release notes clamped inside
3835
+ a card, expanded by default via defaultExpanded on the
3836
+ second example.
3837
+ </p>
3838
+ <div className="flex flex-wrap gap-6">
3839
+ <Card className="w-96">
3840
+ <CardHeader>
3841
+ <CardTitle>Release notes — v2.4.0</CardTitle>
3842
+ <CardDescription>
3843
+ Published 2026-05-26 · design.bads.com
3844
+ </CardDescription>
3845
+ </CardHeader>
3846
+ <CardContent>
3847
+ <Spoiler
3848
+ maxHeight={72}
3849
+ showLabel="Read full notes"
3850
+ hideLabel="Show less"
3851
+ >
3852
+ <p className="text-sm leading-relaxed text-muted-foreground">
3853
+ This release adds three primitives to the registry,
3854
+ tightens the focus-ring offset to 2px across every
3855
+ interactive component, and regenerates both CSS files
3856
+ from tokens.json. The orphan-token lint now runs
3857
+ quarterly instead of weekly after two false-positive
3858
+ cycles flagged chart-config inputs that were never
3859
+ meant to be utility classes. Upgrading is a standard
3860
+ package bump — no breaking API changes, but re-run
3861
+ pnpm build:tokens if your fork overrides the motion
3862
+ durations.
3863
+ </p>
3864
+ </Spoiler>
3865
+ </CardContent>
3866
+ </Card>
3867
+ <Card className="w-96">
3868
+ <CardHeader>
3869
+ <CardTitle>Seo-yun Park</CardTitle>
3870
+ <CardDescription>Senior Design Engineer</CardDescription>
3871
+ </CardHeader>
3872
+ <CardContent>
3873
+ <Spoiler maxHeight={96} defaultExpanded>
3874
+ <p className="text-sm leading-relaxed text-muted-foreground">
3875
+ Seo-yun Park is a senior design engineer who joined
3876
+ the platform team to stop the same button being
3877
+ rebuilt in four codebases. She wrote the team&apos;s
3878
+ first token pipeline, wired Storybook coverage into
3879
+ pre-commit, and now spends most weeks reviewing
3880
+ variants against the registry and talking product
3881
+ teams out of one-off components. Her rule of thumb:
3882
+ if a primitive needs a paragraph of explanation, the
3883
+ API is wrong.
3884
+ </p>
3885
+ </Spoiler>
3886
+ </CardContent>
3887
+ </Card>
3888
+ </div>
3889
+ </div>
3890
+ </div>
3891
+ </Section>
3892
+
3893
+ <Section title="Separator">
3894
+ <div className="max-w-md space-y-6">
3895
+ <div className="space-y-2">
3896
+ <p className="text-xs font-medium text-muted-foreground">Plain</p>
3897
+ <p className="text-sm">Section one.</p>
3898
+ <Separator />
3899
+ <p className="text-sm">Section two.</p>
3900
+ </div>
3901
+ <div className="space-y-3">
3902
+ <p className="text-xs font-medium text-muted-foreground">Labeled — center / start / end</p>
3903
+ <Separator label="or" />
3904
+ <Separator label="Recent" labelPosition="start" />
3905
+ <Separator label="Archived" labelPosition="end" />
3906
+ </div>
3907
+ <div className="flex h-10 items-center gap-3">
3908
+ <p className="text-xs font-medium text-muted-foreground">Vertical</p>
3909
+ <span className="text-sm">Drafts</span>
3910
+ <Separator orientation="vertical" />
3911
+ <span className="text-sm">Sent</span>
3912
+ <Separator orientation="vertical" />
3913
+ <span className="text-sm">Archived</span>
3914
+ </div>
3915
+ </div>
3916
+ </Section>
3917
+
3918
+ <Section title="Checkbox Group">
3919
+ <div className="grid gap-8 md:grid-cols-2">
3920
+ <div className="space-y-3">
3921
+ <p className="text-xs font-medium text-muted-foreground">
3922
+ Default — shared value state
3923
+ </p>
3924
+ <CheckboxGroup
3925
+ aria-label="Notification preferences"
3926
+ defaultValue={["email", "push"]}
3927
+ >
3928
+ <div className="flex items-center gap-2.5">
3929
+ <CheckboxGroupItem value="email" id="cg-show-email" />
3930
+ <Label htmlFor="cg-show-email" className="font-normal">
3931
+ Email digest
3932
+ </Label>
3933
+ </div>
3934
+ <div className="flex items-center gap-2.5">
3935
+ <CheckboxGroupItem value="push" id="cg-show-push" />
3936
+ <Label htmlFor="cg-show-push" className="font-normal">
3937
+ Push notifications
3938
+ </Label>
3939
+ </div>
3940
+ <div className="flex items-center gap-2.5">
3941
+ <CheckboxGroupItem value="sms" id="cg-show-sms" />
3942
+ <Label htmlFor="cg-show-sms" className="font-normal">
3943
+ SMS alerts
3944
+ </Label>
3945
+ </div>
3946
+ </CheckboxGroup>
3947
+ </div>
3948
+
3949
+ <div className="space-y-3">
3950
+ <p className="text-xs font-medium text-muted-foreground">
3951
+ Disabled — group cascade + single item
3952
+ </p>
3953
+ <CheckboxGroup
3954
+ aria-label="Notification preferences (read-only plan)"
3955
+ defaultValue={["email"]}
3956
+ disabled
3957
+ >
3958
+ <div className="flex items-center gap-2.5">
3959
+ <CheckboxGroupItem value="email" id="cg-show-dis-email" />
3960
+ <Label htmlFor="cg-show-dis-email" className="font-normal">
3961
+ Email digest
3962
+ </Label>
3963
+ </div>
3964
+ <div className="flex items-center gap-2.5">
3965
+ <CheckboxGroupItem value="push" id="cg-show-dis-push" />
3966
+ <Label htmlFor="cg-show-dis-push" className="font-normal">
3967
+ Push notifications
3968
+ </Label>
3969
+ </div>
3970
+ </CheckboxGroup>
3971
+ <CheckboxGroup
3972
+ aria-label="Sync targets"
3973
+ defaultValue={["tokens", "stories"]}
3974
+ >
3975
+ <div className="flex items-center gap-2.5">
3976
+ <CheckboxGroupItem value="tokens" id="cg-show-tokens" />
3977
+ <Label htmlFor="cg-show-tokens" className="font-normal">
3978
+ Design tokens
3979
+ </Label>
3980
+ </div>
3981
+ <div className="flex items-center gap-2.5">
3982
+ <CheckboxGroupItem value="stories" id="cg-show-stories" disabled />
3983
+ <Label htmlFor="cg-show-stories" className="font-normal">
3984
+ Storybook stories
3985
+ </Label>
3986
+ </div>
3987
+ </CheckboxGroup>
3988
+ </div>
3989
+
3990
+ <div className="space-y-3">
3991
+ <p className="text-xs font-medium text-muted-foreground">
3992
+ Select all — tri-state parent (partial renders a minus)
3993
+ </p>
3994
+ <CheckboxGroupSelectAllDemo />
3995
+ </div>
3996
+
3997
+ <div className="space-y-3">
3998
+ <p className="text-xs font-medium text-muted-foreground">
3999
+ Realistic use — inside a Fieldset, with form name
4000
+ </p>
4001
+ <CheckboxGroupRealisticDemo />
4002
+ </div>
4003
+ </div>
4004
+ </Section>
4005
+
4006
+ <Section title="Blockquote">
4007
+ <div className="grid gap-8 md:grid-cols-2">
4008
+ <div className="space-y-3">
4009
+ <p className="text-xs font-medium text-muted-foreground">
4010
+ Default — border-border left rule
4011
+ </p>
4012
+ <Blockquote className="max-w-md">
4013
+ <BlockquoteContent>
4014
+ If a primitive needs a paragraph of explanation, the API is
4015
+ wrong.
4016
+ </BlockquoteContent>
4017
+ <BlockquoteAttribution>
4018
+ — Seo-yun Park, Senior Design Engineer
4019
+ </BlockquoteAttribution>
4020
+ </Blockquote>
4021
+ </div>
4022
+
4023
+ <div className="space-y-3">
4024
+ <p className="text-xs font-medium text-muted-foreground">
4025
+ Variant: accent — border-primary rule, cite attr + visible{" "}
4026
+ <code>&lt;cite&gt;</code>
4027
+ </p>
4028
+ <Blockquote variant="accent" className="max-w-md">
4029
+ <BlockquoteContent cite="https://design.bads.com/docs/getting-started">
4030
+ BADS ships with tokens, components, and accessibility baked
4031
+ in.
4032
+ </BlockquoteContent>
4033
+ <BlockquoteAttribution>
4034
+ — Jordan Reeves, <cite>Getting started guide</cite>
4035
+ </BlockquoteAttribution>
4036
+ </Blockquote>
4037
+ </div>
4038
+
4039
+ <div className="space-y-3">
4040
+ <p className="text-xs font-medium text-muted-foreground">
4041
+ Variant: plain — no rule or indent, flows inside prose
4042
+ </p>
4043
+ <div className="max-w-md space-y-3 text-sm leading-relaxed text-foreground">
4044
+ <p>
4045
+ The onboarding doc opens with the team&rsquo;s working rule
4046
+ for every fork:
4047
+ </p>
4048
+ <Blockquote variant="plain">
4049
+ <BlockquoteContent className="text-sm">
4050
+ Fork it, rename it, customize the brand colors, and start
4051
+ building.
4052
+ </BlockquoteContent>
4053
+ <BlockquoteAttribution>
4054
+ — BADS onboarding
4055
+ </BlockquoteAttribution>
4056
+ </Blockquote>
4057
+ </div>
4058
+ </div>
4059
+
4060
+ <div className="space-y-3">
4061
+ <p className="text-xs font-medium text-muted-foreground">
4062
+ Long content in a 320px box — overflow contract (wraps, never
4063
+ bleeds)
4064
+ </p>
4065
+ <div className="w-[320px]">
4066
+ <Blockquote>
4067
+ <BlockquoteContent>
4068
+ This release adds three primitives to the registry,
4069
+ tightens the focus-ring offset to 2px across every
4070
+ interactive component, and regenerates both CSS files from
4071
+ tokens.json.
4072
+ </BlockquoteContent>
4073
+ <BlockquoteAttribution>
4074
+ — Wilhelmina-Constance Featherstonehaugh-Vance,
4075
+ wilhelmina.featherstonehaugh-vance@subdomain.consulting.example.org
4076
+ </BlockquoteAttribution>
4077
+ </Blockquote>
4078
+ </div>
4079
+ </div>
4080
+
4081
+ <div className="space-y-3 md:col-span-2">
4082
+ <p className="text-xs font-medium text-muted-foreground">
4083
+ Realistic use — testimonial card
4084
+ </p>
4085
+ <Card className="max-w-xl">
4086
+ <CardHeader>
4087
+ <CardTitle className="text-lg">What adopters say</CardTitle>
4088
+ </CardHeader>
4089
+ <CardContent className="space-y-6">
4090
+ <Blockquote variant="accent">
4091
+ <BlockquoteContent cite="https://design.bads.com/share/tokens-v2-proposal">
4092
+ She wrote the team&rsquo;s first token pipeline, wired
4093
+ Storybook coverage into pre-commit, and now spends most
4094
+ weeks talking product teams out of one-off components.
4095
+ </BlockquoteContent>
4096
+ <BlockquoteAttribution>
4097
+ — Seo-yun Park, Senior Design Engineer
4098
+ </BlockquoteAttribution>
4099
+ </Blockquote>
4100
+ <Blockquote>
4101
+ <BlockquoteContent>
4102
+ 36 components, all passing AAA contrast. Last token
4103
+ change was 3 days ago. Your Storybook coverage is at
4104
+ 100%.
4105
+ </BlockquoteContent>
4106
+ <BlockquoteAttribution>
4107
+ — Jordan Reeves, <cite>adoption review, 2026-05-26</cite>
4108
+ </BlockquoteAttribution>
4109
+ </Blockquote>
4110
+ </CardContent>
4111
+ </Card>
4112
+ </div>
4113
+ </div>
4114
+ </Section>
4115
+
4116
+ <Section title="Text">
4117
+ <div className="space-y-10">
4118
+ <div className="grid gap-8 md:grid-cols-2">
4119
+ <div className="space-y-3">
4120
+ <p className="text-xs font-medium text-muted-foreground">
4121
+ Text variants — 1:1 with tokens.json textStyles (body 20px /
4122
+ body-sm 16px / caption 14px, the AAA floor)
4123
+ </p>
4124
+ <div className="max-w-md space-y-3">
4125
+ <Text variant="body">
4126
+ BADS ships with tokens, components, and accessibility baked
4127
+ in. Fork it, rename it, customize the brand colors, and
4128
+ start building.
4129
+ </Text>
4130
+ <Text variant="body-sm">
4131
+ 36 components, all passing AAA contrast. Last token change
4132
+ was 3 days ago.
4133
+ </Text>
4134
+ <Text variant="caption" tone="muted">
4135
+ Updated 2026-05-26 by Jordan Reeves · 7:1 contrast ·
4136
+ 44×44px target
4137
+ </Text>
4138
+ </div>
4139
+ </div>
4140
+
4141
+ <div className="space-y-3">
4142
+ <p className="text-xs font-medium text-muted-foreground">
4143
+ Tone: muted — orthogonal to variant, so a color change never
4144
+ smuggles in a size change
4145
+ </p>
4146
+ <div className="max-w-md space-y-2">
4147
+ <Text variant="body-sm">
4148
+ Tokens propagate to both CSS files when you run pnpm
4149
+ build:tokens.
4150
+ </Text>
4151
+ <Text variant="body-sm" tone="muted">
4152
+ Changes via the Customize tab are per-user overrides only.
4153
+ </Text>
4154
+ </div>
4155
+ </div>
4156
+ </div>
4157
+
4158
+ <div className="space-y-3">
4159
+ <p className="text-xs font-medium text-muted-foreground">
4160
+ Heading sizes — heading-sm (25px) / md (31px) / lg (39px) / xl
4161
+ (49px, top of the body scale; the marketing tier is
4162
+ deliberately not exposed)
4163
+ </p>
4164
+ <div className="space-y-2">
4165
+ <Heading as="h3" size="sm">
4166
+ Customize your tokens
4167
+ </Heading>
4168
+ <Heading as="h3" size="md">
4169
+ Your design system at a glance
4170
+ </Heading>
4171
+ <Heading as="h3" size="lg">
4172
+ Set up your design system in five minutes
4173
+ </Heading>
4174
+ <Heading as="h3" size="xl">
4175
+ No components yet
4176
+ </Heading>
4177
+ </div>
4178
+ </div>
4179
+
4180
+ <div className="grid gap-8 md:grid-cols-2">
4181
+ <div className="space-y-3">
4182
+ <p className="text-xs font-medium text-muted-foreground">
4183
+ Levels decoupled from size — h2 → h3 → h4 in the outline, one
4184
+ visual size (SC 1.3.1)
4185
+ </p>
4186
+ <div className="max-w-md space-y-2">
4187
+ <Heading as="h2" size="sm">
4188
+ Design tokens
4189
+ </Heading>
4190
+ <Heading as="h3" size="sm">
4191
+ Semantic layer
4192
+ </Heading>
4193
+ <Heading as="h4" size="sm">
4194
+ CVA variants
4195
+ </Heading>
4196
+ <Text variant="body-sm" tone="muted">
4197
+ The level comes from the page structure, never from the
4198
+ look.
4199
+ </Text>
4200
+ </div>
4201
+ </div>
4202
+
4203
+ <div className="space-y-3">
4204
+ <p className="text-xs font-medium text-muted-foreground">
4205
+ Long content in a 320px box — overflow contract (wraps, never
4206
+ bleeds)
4207
+ </p>
4208
+ <div className="w-[320px] space-y-2">
4209
+ <Heading as="h3" size="sm">
4210
+ Account owner
4211
+ </Heading>
4212
+ <Text variant="body-sm">
4213
+ Wilhelmina-Constance Featherstonehaugh-Vance,
4214
+ wilhelmina.featherstonehaugh-vance@subdomain.consulting.example.org
4215
+ </Text>
4216
+ </div>
4217
+ </div>
4218
+ </div>
4219
+
4220
+ <div className="space-y-3">
4221
+ <p className="text-xs font-medium text-muted-foreground">
4222
+ Realistic use — settings-page fragment composed entirely from
4223
+ Text + Heading
4224
+ </p>
4225
+ <div className="max-w-xl space-y-6">
4226
+ <div className="space-y-2">
4227
+ <Heading as="h3" size="lg">
4228
+ Customize your tokens
4229
+ </Heading>
4230
+ <Text tone="muted">
4231
+ Colors, spacing, and typography for every fork of this
4232
+ system.
4233
+ </Text>
4234
+ </div>
4235
+ <Card>
4236
+ <CardHeader>
4237
+ <CardTitle className="text-lg">Token health</CardTitle>
4238
+ </CardHeader>
4239
+ <CardContent className="space-y-4">
4240
+ <div className="space-y-1">
4241
+ <Heading as="h4" size="sm">
4242
+ Contrast audit
4243
+ </Heading>
4244
+ <Text variant="body-sm">
4245
+ 36 components, all passing AAA contrast. Last token
4246
+ change was 3 days ago.
4247
+ </Text>
4248
+ <Text variant="caption" tone="muted">
4249
+ Ran 2026-05-26 · floor 7:1 normal text, 3:1 non-text
4250
+ </Text>
4251
+ </div>
4252
+ <Separator />
4253
+ <div className="space-y-1">
4254
+ <Heading as="h4" size="sm">
4255
+ Type floor
4256
+ </Heading>
4257
+ <Text variant="body-sm">
4258
+ Smallest rendered size is 14px minimum — the caption
4259
+ style sits exactly on the floor.
4260
+ </Text>
4261
+ <Text variant="caption" tone="muted">
4262
+ Verified by Seo-yun Park · seoyun.park@figma.com
4263
+ </Text>
4264
+ </div>
4265
+ </CardContent>
4266
+ </Card>
4267
+ </div>
4268
+ </div>
4269
+ </div>
4270
+ </Section>
4271
+
4272
+ <Section title="Autocomplete">
4273
+ <div className="space-y-8">
4274
+ <div className="space-y-3">
4275
+ <p className="text-xs font-medium text-muted-foreground">
4276
+ Default — free-text input with a filtered suggestions listbox.
4277
+ Type to filter (try &quot;tok&quot;), ArrowDown/Up to navigate,
4278
+ Enter to commit; typed text is always valid — the list is an
4279
+ accelerator, never a restriction (that&apos;s Combobox&apos;s
4280
+ job)
4281
+ </p>
4282
+ <AutocompleteBasicDemo />
4283
+ </div>
4284
+
4285
+ <div className="space-y-3">
4286
+ <p className="text-xs font-medium text-muted-foreground">
4287
+ Sizes — sm / default / xl (passthrough to Input; use xl where
4288
+ the field is a primary flow control — 44px target)
4289
+ </p>
4290
+ <AutocompleteSizesDemo />
4291
+ </div>
4292
+
4293
+ <div className="space-y-3">
4294
+ <p className="text-xs font-medium text-muted-foreground">
4295
+ Disabled — the listbox never opens
4296
+ </p>
4297
+ <AutocompleteDisabledDemo />
4298
+ </div>
4299
+
4300
+ <div className="space-y-3">
4301
+ <p className="text-xs font-medium text-muted-foreground">
4302
+ Long-label overflow — unbroken strings (emails) truncate inside
4303
+ a 224px container instead of bleeding (type &quot;.&quot; to
4304
+ open)
4305
+ </p>
4306
+ <AutocompleteLongOptionsDemo />
4307
+ </div>
4308
+
4309
+ <div className="space-y-3">
4310
+ <p className="text-xs font-medium text-muted-foreground">
4311
+ Realistic use — assign a design review: pick a teammate from
4312
+ the suggestions or type any external name
4313
+ </p>
4314
+ <AutocompleteRealisticDemo />
4315
+ </div>
4316
+ </div>
4317
+ </Section>
4318
+
4319
+ <Section title="Marquee">
4320
+ <div className="space-y-8">
4321
+ <div className="space-y-3">
4322
+ <p className="text-xs font-medium text-muted-foreground">
4323
+ Default — continuous auto-scroll with the visible pause/resume
4324
+ control ON by default (SC 2.2.2). Hover or focus anywhere on
4325
+ the strip also pauses it; under prefers-reduced-motion it
4326
+ halts entirely
4327
+ </p>
4328
+ <MarqueeTickerDemo />
4329
+ </div>
4330
+
4331
+ <div className="space-y-3">
4332
+ <p className="text-xs font-medium text-muted-foreground">
4333
+ Reverse direction + edge fade — direction=&quot;right&quot;
4334
+ flips travel; fade masks both edges so items dissolve instead
4335
+ of hard-clipping
4336
+ </p>
4337
+ <MarqueeTickerDemo direction="right" fade />
4338
+ </div>
4339
+
4340
+ <div className="space-y-3">
4341
+ <p className="text-xs font-medium text-muted-foreground">
4342
+ Tuning — speed is px/s (constant regardless of auto-fill
4343
+ repeat count); item density via the --marquee-gap CSS var
4344
+ </p>
4345
+ <MarqueeTickerDemo
4346
+ speed={80}
4347
+ style={{ "--marquee-gap": "1.5rem" } as React.CSSProperties}
4348
+ />
4349
+ </div>
4350
+
4351
+ <div className="space-y-3">
4352
+ <p className="text-xs font-medium text-muted-foreground">
4353
+ Realistic use — testimonial strip. Cards from the persona
4354
+ content pool; duplicated copies are aria-hidden so screen
4355
+ readers hear each quote exactly once
4356
+ </p>
4357
+ <MarqueeTestimonialsDemo />
4358
+ </div>
4359
+ </div>
4360
+ </Section>
4361
+
4362
+ <Section title="Format Number">
4363
+ <div className="space-y-8">
4364
+ <div className="space-y-3">
4365
+ <p className="text-xs font-medium text-muted-foreground">
4366
+ Default — locale-aware grouping via Intl.NumberFormat. The
4367
+ locale defaults to an explicit &quot;en-US&quot; (never
4368
+ navigator.language) so server and client render the same
4369
+ string
4370
+ </p>
4371
+ <p className="text-sm text-foreground">
4372
+ Orphan-token lint scanned{" "}
4373
+ <FormatNumber value={12417} /> token
4374
+ references this quarter.
4375
+ </p>
4376
+ </div>
4377
+
4378
+ <div className="space-y-3">
4379
+ <p className="text-xs font-medium text-muted-foreground">
4380
+ Currency — style=&quot;currency&quot; handles symbol
4381
+ placement, grouping, and negative signs per locale; never
4382
+ hand-concatenate &quot;$&quot;
4383
+ </p>
4384
+ <div className="flex flex-wrap gap-x-8 gap-y-2 text-sm text-foreground">
4385
+ <span>
4386
+ Client savings{" "}
4387
+ <FormatNumber
4388
+ value={182450}
4389
+ style="currency"
4390
+ currency="USD"
4391
+ />
4392
+ </span>
4393
+ <span>
4394
+ Defect EV avoided{" "}
4395
+ <FormatNumber
4396
+ value={24500}
4397
+ style="currency"
4398
+ currency="USD"
4399
+ />
4400
+ </span>
4401
+ <span>
4402
+ Credit issued{" "}
4403
+ <FormatNumber
4404
+ value={-1249.5}
4405
+ style="currency"
4406
+ currency="USD"
4407
+ className="text-destructive"
4408
+ />
4409
+ </span>
4410
+ </div>
4411
+ </div>
4412
+
4413
+ <div className="space-y-3">
4414
+ <p className="text-xs font-medium text-muted-foreground">
4415
+ Percent and unit — ratios and measured quantities go through
4416
+ Intl too, so fraction digits and unit names localize
4417
+ </p>
4418
+ <div className="flex flex-wrap gap-x-8 gap-y-2 text-sm text-foreground">
4419
+ <span>
4420
+ Story coverage{" "}
4421
+ <FormatNumber
4422
+ value={0.984}
4423
+ style="percent"
4424
+ maximumFractionDigits={1}
4425
+ />
4426
+ </span>
4427
+ <span>
4428
+ Build hours avoided{" "}
4429
+ <FormatNumber
4430
+ value={1432}
4431
+ style="unit"
4432
+ unit="hour"
4433
+ unitDisplay="long"
4434
+ />
4435
+ </span>
4436
+ <span>
4437
+ Core bundle{" "}
4438
+ <FormatNumber
4439
+ value={42.7}
4440
+ style="unit"
4441
+ unit="kilobyte"
4442
+ />
4443
+ </span>
4444
+ </div>
4445
+ </div>
4446
+
4447
+ <div className="space-y-3">
4448
+ <p className="text-xs font-medium text-muted-foreground">
4449
+ Compact notation — abbreviates for dashboards and axis ticks;
4450
+ the full-precision value auto-rides the native title
4451
+ attribute (hover the number), and surfaces where the exact
4452
+ figure is load-bearing use standard notation instead
4453
+ </p>
4454
+ <p className="text-sm text-foreground">
4455
+ Token references scanned:{" "}
4456
+ <FormatNumber
4457
+ value={12417}
4458
+ notation="compact"
4459
+ />
4460
+ </p>
4461
+ </div>
4462
+
4463
+ <div className="space-y-3">
4464
+ <p className="text-xs font-medium text-muted-foreground">
4465
+ Locales — pass the consumer&apos;s i18n locale explicitly;
4466
+ symbol position, grouping, and spacing follow
4467
+ </p>
4468
+ <div className="flex flex-wrap gap-x-8 gap-y-2 text-sm text-foreground">
4469
+ <span>
4470
+ en-US{" "}
4471
+ <FormatNumber
4472
+ value={182450}
4473
+ style="currency"
4474
+ currency="USD"
4475
+ />
4476
+ </span>
4477
+ <span>
4478
+ sv-SE{" "}
4479
+ <FormatNumber
4480
+ value={182450}
4481
+ locale="sv-SE"
4482
+ style="currency"
4483
+ currency="SEK"
4484
+ />
4485
+ </span>
4486
+ <span>
4487
+ ko-KR{" "}
4488
+ <FormatNumber
4489
+ value={182450}
4490
+ locale="ko-KR"
4491
+ style="currency"
4492
+ currency="KRW"
4493
+ />
4494
+ </span>
4495
+ </div>
4496
+ </div>
4497
+
4498
+ <div className="space-y-3">
4499
+ <p className="text-xs font-medium text-muted-foreground">
4500
+ Tabular alignment — tabular figures (the default) occupy equal
4501
+ widths so digits line up in right-aligned columns
4502
+ </p>
4503
+ <div className="grid w-64 grid-cols-[1fr_auto] gap-x-6 gap-y-1 text-sm text-foreground">
4504
+ <span className="text-muted-foreground">Client savings</span>
4505
+ <FormatNumber
4506
+ value={182450}
4507
+ style="currency"
4508
+ currency="USD"
4509
+ tabular
4510
+ className="text-right font-medium"
4511
+ />
4512
+ <span className="text-muted-foreground">
4513
+ Defect EV avoided
4514
+ </span>
4515
+ <FormatNumber
4516
+ value={24500}
4517
+ style="currency"
4518
+ currency="USD"
4519
+ tabular
4520
+ className="text-right font-medium"
4521
+ />
4522
+ <span className="text-muted-foreground">Credit issued</span>
4523
+ <FormatNumber
4524
+ value={-1249.5}
4525
+ style="currency"
4526
+ currency="USD"
4527
+ tabular
4528
+ className="text-right font-medium"
4529
+ />
4530
+ </div>
4531
+ </div>
4532
+
4533
+ <div className="space-y-3">
4534
+ <p className="text-xs font-medium text-muted-foreground">
4535
+ Realistic use — ROI snapshot with every style composed in a
4536
+ DataList (figures from the persona metrics pool)
4537
+ </p>
4538
+ <Card className="max-w-md">
4539
+ <CardHeader>
4540
+ <CardTitle>ROI snapshot</CardTitle>
4541
+ <CardDescription>
4542
+ What the BADS engagement returned this quarter.
4543
+ </CardDescription>
4544
+ </CardHeader>
4545
+ <CardContent>
4546
+ <DataList orientation="horizontal">
4547
+ <DataListItem>
4548
+ <DataListLabel>Client savings</DataListLabel>
4549
+ <DataListValue>
4550
+ <FormatNumber
4551
+ value={182450}
4552
+ style="currency"
4553
+ currency="USD"
4554
+ tabular
4555
+ />
4556
+ </DataListValue>
4557
+ </DataListItem>
4558
+ <DataListItem>
4559
+ <DataListLabel>Build hours avoided</DataListLabel>
4560
+ <DataListValue>
4561
+ <FormatNumber
4562
+ value={1432}
4563
+ style="unit"
4564
+ unit="hour"
4565
+ tabular
4566
+ />
4567
+ </DataListValue>
4568
+ </DataListItem>
4569
+ <DataListItem>
4570
+ <DataListLabel>Story coverage</DataListLabel>
4571
+ <DataListValue>
4572
+ <FormatNumber
4573
+ value={0.984}
4574
+ style="percent"
4575
+ maximumFractionDigits={1}
4576
+ tabular
4577
+ />
4578
+ </DataListValue>
4579
+ </DataListItem>
4580
+ <DataListItem>
4581
+ <DataListLabel>Token refs scanned</DataListLabel>
4582
+ <DataListValue>
4583
+ <FormatNumber value={12417} notation="compact" tabular />
4584
+ </DataListValue>
4585
+ </DataListItem>
4586
+ <DataListItem>
4587
+ <DataListLabel>Registry components</DataListLabel>
4588
+ <DataListValue>
4589
+ <FormatNumber value={88} tabular />
4590
+ </DataListValue>
4591
+ </DataListItem>
4592
+ </DataList>
4593
+ </CardContent>
4594
+ </Card>
4595
+ </div>
4596
+ </div>
4597
+ </Section>
4598
+
4599
+ <Section title="Motion Toggle">
4600
+ <div className="space-y-8">
4601
+ <div className="space-y-3">
4602
+ <p className="text-xs font-medium text-muted-foreground">
4603
+ Default — an opt-in, in-app companion to the OS reduce-motion
4604
+ setting. Three states, not a boolean: System follows the device,
4605
+ Reduced forces motion off on this site, Full forces it on even
4606
+ when the device prefers reduce. Writes the{" "}
4607
+ <code className="text-foreground">data-motion</code> attribute the
4608
+ base layer reads. Not mounted in the default BADS shell — a fork
4609
+ drops it into its own settings surface.
4610
+ </p>
4611
+ <MotionToggle storageSuffix="motion-showcase-default" />
4612
+ </div>
4613
+
4614
+ <div className="space-y-3">
4615
+ <p className="text-xs font-medium text-muted-foreground">
4616
+ With hint — the active option&apos;s reason renders as muted
4617
+ helper text (aria-live) so keyboard users get what the title
4618
+ tooltip can&apos;t give them
4619
+ </p>
4620
+ <MotionToggle showHint storageSuffix="motion-showcase-hint" />
4621
+ </div>
4622
+
4623
+ <div className="space-y-3">
4624
+ <p className="text-xs font-medium text-muted-foreground">
4625
+ Sizes — sm / default / lg, inheriting the SegmentedControl scale
4626
+ (default and lg keep the 44px touch-target floor)
4627
+ </p>
4628
+ <div className="flex flex-col items-start gap-4">
4629
+ <MotionToggle size="sm" storageSuffix="motion-showcase-sm" />
4630
+ <MotionToggle size="default" storageSuffix="motion-showcase-md" />
4631
+ <MotionToggle size="lg" storageSuffix="motion-showcase-lg" />
4632
+ </div>
4633
+ </div>
4634
+
4635
+ <div className="space-y-3">
4636
+ <p className="text-xs font-medium text-muted-foreground">
4637
+ Realistic use — an Appearance settings row, the shape a fork
4638
+ composes into its own preferences screen
4639
+ </p>
4640
+ <Card className="max-w-md">
4641
+ <CardHeader>
4642
+ <CardTitle>Motion</CardTitle>
4643
+ <CardDescription>
4644
+ Control animations across the app. Reduced turns them off
4645
+ here even if your device allows motion.
4646
+ </CardDescription>
4647
+ </CardHeader>
4648
+ <CardContent>
4649
+ <MotionToggle showHint storageSuffix="motion-showcase-settings" />
4650
+ </CardContent>
4651
+ </Card>
4652
+ </div>
4653
+ </div>
4654
+ </Section>
4655
+
4656
+ <Section title="Link">
4657
+ <div className="space-y-8">
4658
+ <div className="space-y-3">
4659
+ <p className="text-xs font-medium text-muted-foreground">
4660
+ Default — a navigation anchor inside prose. Underlined by
4661
+ default because color alone can&apos;t mark a link in running
4662
+ text (SC 1.4.1); the underline solidifies on hover. Distinct
4663
+ from <code className="text-foreground">Button variant=&quot;link&quot;</code>,
4664
+ which is a button for actions — this is an{" "}
4665
+ <code className="text-foreground">&lt;a href&gt;</code> that
4666
+ wraps mid-sentence and inherits the surrounding text size.
4667
+ </p>
4668
+ <Text className="max-w-md">
4669
+ Read the{" "}
4670
+ <Link href="https://design.bads.com/docs/getting-started">
4671
+ getting started guide
4672
+ </Link>{" "}
4673
+ before customizing tokens, then review{" "}
4674
+ <Link href="https://design.bads.com/share/tokens-v2-proposal">
4675
+ Seo-yun Park&rsquo;s tokens v2 proposal
4676
+ </Link>{" "}
4677
+ for the methodology.
4678
+ </Text>
4679
+ </div>
4680
+
4681
+ <div className="space-y-3">
4682
+ <p className="text-xs font-medium text-muted-foreground">
4683
+ Underline: hover / none — for chrome where position identifies
4684
+ the link (nav lists, footer rows). Never mid-prose.
4685
+ </p>
4686
+ <div className="flex flex-col gap-4">
4687
+ <nav aria-label="Documentation" className="flex items-center gap-4 text-sm">
4688
+ <Link href="https://design.bads.com/docs/getting-started" underline="hover">
4689
+ Getting started
4690
+ </Link>
4691
+ <Link href="https://design.bads.com/share/tokens-v2-proposal" underline="hover">
4692
+ Tokens v2 proposal
4693
+ </Link>
4694
+ <Link href="https://design.bads.com" underline="hover">
4695
+ Component registry
4696
+ </Link>
4697
+ </nav>
4698
+ <div className="flex items-center gap-4 text-sm">
4699
+ <Link href="https://design.bads.com" underline="none">
4700
+ Docs
4701
+ </Link>
4702
+ <Link href="https://design.bads.com" underline="none">
4703
+ Changelog
4704
+ </Link>
4705
+ <Link href="https://design.bads.com" underline="none">
4706
+ Support
4707
+ </Link>
4708
+ </div>
4709
+ </div>
4710
+ </div>
4711
+
4712
+ <div className="space-y-3">
4713
+ <p className="text-xs font-medium text-muted-foreground">
4714
+ Tones — default uses the <code className="text-foreground">--link</code>{" "}
4715
+ token (= <code className="text-foreground">--primary</code> unless
4716
+ the fork overrides it); foreground for links inside emphasized
4717
+ text; muted lifts to foreground on hover (footer / legal rows).
4718
+ </p>
4719
+ <div className="flex flex-col gap-2 text-sm">
4720
+ <Link href="https://design.bads.com">Default tone</Link>
4721
+ <Link href="https://design.bads.com" tone="foreground">
4722
+ Foreground tone
4723
+ </Link>
4724
+ <Link href="https://design.bads.com" tone="muted">
4725
+ Muted tone
4726
+ </Link>
4727
+ </div>
4728
+ </div>
4729
+
4730
+ <div className="space-y-3">
4731
+ <p className="text-xs font-medium text-muted-foreground">
4732
+ External — sets{" "}
4733
+ <code className="text-foreground">target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;</code>,
4734
+ appends the 1.5-stroke icon, and announces &quot;(opens in new
4735
+ tab)&quot; to screen readers. Long URLs as link text wrap via
4736
+ the overflow contract instead of bleeding.
4737
+ </p>
4738
+ <Text variant="body-sm" className="max-w-[320px]">
4739
+ Full proposal:{" "}
4740
+ <Link href="https://design.bads.com/share/tokens-v2-proposal" external>
4741
+ https://design.bads.com/share/tokens-v2-proposal
4742
+ </Link>
4743
+ </Text>
4744
+ </div>
4745
+
4746
+ <div className="space-y-3">
4747
+ <p className="text-xs font-medium text-muted-foreground">
4748
+ Realistic use — a docs card with prose links, a mailto, and a
4749
+ muted footer row. A standalone flow-changing CTA is still
4750
+ Button territory (min-h-11), not Link.
4751
+ </p>
4752
+ <Card className="max-w-md">
4753
+ <CardHeader>
4754
+ <CardTitle className="text-lg">
4755
+ Set up your design system in five minutes
4756
+ </CardTitle>
4757
+ </CardHeader>
4758
+ <CardContent className="space-y-4">
4759
+ <Text variant="body-sm">
4760
+ Start with the{" "}
4761
+ <Link href="https://design.bads.com/docs/getting-started">
4762
+ getting started guide
4763
+ </Link>
4764
+ , then wire Storybook coverage into pre-commit. Escalations
4765
+ go to{" "}
4766
+ <Link href="mailto:jordan@reeves.design">
4767
+ jordan@reeves.design
4768
+ </Link>
4769
+ .
4770
+ </Text>
4771
+ <Text variant="body-sm" tone="muted">
4772
+ Last token change was 3 days ago. Story coverage is at
4773
+ 98.4%.
4774
+ </Text>
4775
+ <Separator />
4776
+ <div className="flex items-center gap-3 text-sm">
4777
+ <Link href="https://design.bads.com" tone="muted" underline="hover">
4778
+ Docs
4779
+ </Link>
4780
+ <Link href="https://design.bads.com" tone="muted" underline="hover">
4781
+ Registry
4782
+ </Link>
4783
+ <Link href="https://design.bads.com" tone="muted" underline="hover" external>
4784
+ Storybook
4785
+ </Link>
4786
+ </div>
4787
+ </CardContent>
4788
+ </Card>
4789
+ </div>
4790
+ </div>
4791
+ </Section>
4792
+
4793
+ <Section title="Bottom Navigation">
4794
+ <div className="space-y-8">
4795
+ <div className="space-y-3">
4796
+ <p className="text-xs font-medium text-muted-foreground">
4797
+ Default — a <code className="text-foreground">&lt;nav&gt;</code>{" "}
4798
+ landmark with 3&ndash;5 icon+label destinations;{" "}
4799
+ <code className="text-foreground">aria-current=&quot;page&quot;</code>{" "}
4800
+ marks the active one. NOT a tablist — it changes top-level
4801
+ destinations, not in-place content panels (that&rsquo;s Tabs).
4802
+ Rendered in-flow here; pass{" "}
4803
+ <code className="text-foreground">fixed</code> to pin it to the
4804
+ viewport bottom with safe-area padding.
4805
+ </p>
4806
+ <BottomNavigationDefaultDemo />
4807
+ </div>
4808
+
4809
+ <div className="space-y-3">
4810
+ <p className="text-xs font-medium text-muted-foreground">
4811
+ Disabled item — pointer-events-none + opacity-50, skipped by
4812
+ activation but still visible so the IA stays legible.
4813
+ </p>
4814
+ <BottomNavigationDisabledDemo />
4815
+ </div>
4816
+
4817
+ <div className="space-y-3">
4818
+ <p className="text-xs font-medium text-muted-foreground">
4819
+ Five items — the upper bound of the convention. Beyond five,
4820
+ targets shrink below usable width; move overflow into a
4821
+ &quot;More&quot; destination instead.
4822
+ </p>
4823
+ <BottomNavigationFiveDemo />
4824
+ </div>
4825
+
4826
+ <div className="space-y-3">
4827
+ <p className="text-xs font-medium text-muted-foreground">
4828
+ Realistic use — a phone-frame docs app: content region above,
4829
+ bar at the frame&rsquo;s bottom edge. Active state reads via
4830
+ color + label weight + icon lift, never color alone.
4831
+ </p>
4832
+ <BottomNavigationPhoneDemo />
4833
+ </div>
4834
+ </div>
4835
+ </Section>
4836
+
4837
+ <Section title="Visually Hidden">
4838
+ <div className="space-y-8">
4839
+ <div className="space-y-3">
4840
+ <p className="text-xs font-medium text-muted-foreground">
4841
+ Icon-only buttons with a{" "}
4842
+ <code className="text-foreground">&lt;VisuallyHidden&gt;</code>{" "}
4843
+ label — the accessible name is announced by screen readers but
4844
+ renders no pixels. Nothing to see here is the point: inspect
4845
+ the DOM and each button contains a{" "}
4846
+ <code className="text-foreground">
4847
+ data-slot=&quot;visually-hidden&quot;
4848
+ </code>{" "}
4849
+ span with the full label (sr-only clip technique, CSS-only, no
4850
+ extra dependency).
4851
+ </p>
4852
+ <div className="flex items-center gap-2">
4853
+ <Button variant="outline" size="icon-xl">
4854
+ <DownloadIcon strokeWidth={1.5} />
4855
+ <VisuallyHidden>Download tokens-v2-proposal</VisuallyHidden>
4856
+ </Button>
4857
+ <Button variant="outline" size="icon-xl">
4858
+ <BellIcon strokeWidth={1.5} />
4859
+ <VisuallyHidden>
4860
+ Notify me when tokens-v2-proposal changes
4861
+ </VisuallyHidden>
4862
+ </Button>
4863
+ <Button variant="ghost" size="icon-xl">
4864
+ <XIcon strokeWidth={1.5} />
4865
+ <VisuallyHidden>Dismiss</VisuallyHidden>
4866
+ </Button>
4867
+ </div>
4868
+ </div>
4869
+
4870
+ <div className="space-y-3">
4871
+ <p className="text-xs font-medium text-muted-foreground">
4872
+ Screen-reader-only context after visible text — the sentence
4873
+ below ends with a hidden follow-up instruction that assistive
4874
+ tech announces in full. Zero interactive states, so this is
4875
+ the system&rsquo;s documented zero-motion primitive.
4876
+ </p>
4877
+ <p className="text-sm text-foreground">
4878
+ Token changes saved.
4879
+ <VisuallyHidden>
4880
+ Run pnpm build:tokens to regenerate CSS.
4881
+ </VisuallyHidden>
4882
+ </p>
4883
+ </div>
4884
+ </div>
4885
+ </Section>
4886
+
4887
+ <Section title="Angle Slider">
4888
+ <div className="space-y-8">
4889
+ <div className="space-y-3">
4890
+ <p className="text-xs font-medium text-muted-foreground">
4891
+ Default — drag the handle (or click anywhere on the ring) to
4892
+ pick an angle; the arc sweeps from 12 o&rsquo;clock. Keyboard:
4893
+ arrows &plusmn;1&deg;, Shift+Arrow &plusmn;10&deg;, Home/End.
4894
+ </p>
4895
+ <AngleSliderControlledDemo initial={45} label="Angle" />
4896
+ </div>
4897
+
4898
+ <div className="space-y-3">
4899
+ <p className="text-xs font-medium text-muted-foreground">
4900
+ Sizes — sm (64px), md (96px), lg (128px). The whole circle is
4901
+ the target, so every size clears the 44px floor.
4902
+ </p>
4903
+ <div className="flex items-end gap-8">
4904
+ <AngleSliderControlledDemo size="sm" initial={45} label="Small angle" />
4905
+ <AngleSliderControlledDemo size="md" initial={135} label="Medium angle" />
4906
+ <AngleSliderControlledDemo size="lg" initial={270} label="Large angle" />
4907
+ </div>
4908
+ </div>
4909
+
4910
+ <div className="space-y-3">
4911
+ <p className="text-xs font-medium text-muted-foreground">
4912
+ Disabled — non-focusable, 50% opacity, value frozen.
4913
+ </p>
4914
+ <AngleSlider disabled defaultValue={135} aria-label="Angle (disabled)" />
4915
+ </div>
4916
+
4917
+ <div className="space-y-3">
4918
+ <p className="text-xs font-medium text-muted-foreground">
4919
+ Realistic use — tuning the brand gradient angle on Jordan
4920
+ Reeves&rsquo; tokens-v2-proposal, with a live swatch preview.
4921
+ </p>
4922
+ <AngleSliderGradientDemo />
4923
+ </div>
4924
+ </div>
4925
+ </Section>
4926
+
4927
+ <Section title="Meter">
4928
+ <div className="space-y-8">
4929
+ <div className="space-y-3">
4930
+ <p className="text-xs font-medium text-muted-foreground">
4931
+ Default — a determinate reading within a known range
4932
+ (role=&quot;meter&quot;, the semantic sibling of Progress). Fill
4933
+ width eases via motion tokens.
4934
+ </p>
4935
+ <div className="max-w-sm">
4936
+ <Meter
4937
+ value={12.4}
4938
+ min={0}
4939
+ max={20}
4940
+ label="Asset storage"
4941
+ showValue
4942
+ getValueLabel={(v, _min, m) => `${v} GB of ${m} GB`}
4943
+ />
4944
+ </div>
4945
+ </div>
4946
+
4947
+ <div className="space-y-3">
4948
+ <p className="text-xs font-medium text-muted-foreground">
4949
+ Sizes — sm (h-1.5), default (h-2), lg (h-3).
4950
+ </p>
4951
+ <div className="max-w-sm space-y-4">
4952
+ <Meter value={62} size="sm" aria-label="Storage used (small)" />
4953
+ <Meter value={62} size="default" aria-label="Storage used (default)" />
4954
+ <Meter value={62} size="lg" aria-label="Storage used (large)" />
4955
+ </div>
4956
+ </div>
4957
+
4958
+ <div className="space-y-3">
4959
+ <p className="text-xs font-medium text-muted-foreground">
4960
+ Variants — explicit threshold color, always paired with a
4961
+ numeric readout (never color alone).
4962
+ </p>
4963
+ <div className="max-w-sm space-y-4">
4964
+ <Meter value={82} variant="success" label="Battery — healthy" showValue />
4965
+ <Meter value={34} variant="warning" label="Battery — getting low" showValue />
4966
+ <Meter value={9} variant="destructive" label="Battery — critical" showValue />
4967
+ </div>
4968
+ </div>
4969
+
4970
+ <div className="space-y-3">
4971
+ <p className="text-xs font-medium text-muted-foreground">
4972
+ Disabled — dimmed reading for a disabled context; a meter is
4973
+ never focusable either way.
4974
+ </p>
4975
+ <div className="max-w-sm">
4976
+ <Meter
4977
+ value={62}
4978
+ disabled
4979
+ label="Asset storage (workspace archived)"
4980
+ showValue
4981
+ />
4982
+ </div>
4983
+ </div>
4984
+
4985
+ <div className="space-y-3">
4986
+ <p className="text-xs font-medium text-muted-foreground">
4987
+ Realistic use — Jordan Reeves&rsquo; workspace storage with a
4988
+ threshold-mapped variant; upload batches to watch the fill and
4989
+ color ease.
4990
+ </p>
4991
+ <MeterStorageDemo />
4992
+ </div>
4993
+ </div>
4994
+ </Section>
4995
+
4996
+ <Section title="Chip">
4997
+ <div className="space-y-8">
4998
+ <div className="space-y-3">
4999
+ <p className="text-xs font-medium text-muted-foreground">
5000
+ Variants — interactive filter toggles (role=checkbox). Click
5001
+ or press Space to toggle; the check icon marks selection so
5002
+ state never reads by color alone. Not a Tag: Tag is a passive
5003
+ label, Chip is a stateful selector.
5004
+ </p>
5005
+ <div className="flex flex-wrap gap-2">
5006
+ <Chip defaultSelected>design tokens</Chip>
5007
+ <Chip>a11y contract</Chip>
5008
+ <Chip variant="outline" defaultSelected>
5009
+ visual regression
5010
+ </Chip>
5011
+ <Chip variant="outline">token drift</Chip>
5012
+ </div>
5013
+ </div>
5014
+
5015
+ <div className="space-y-3">
5016
+ <p className="text-xs font-medium text-muted-foreground">
5017
+ Sizes — sm (36px, dense filter chrome exception), default
5018
+ (44px, the CTA floor), lg (48px).
5019
+ </p>
5020
+ <div className="flex flex-wrap items-center gap-2">
5021
+ <Chip size="sm" defaultSelected>
5022
+ CVA variants
5023
+ </Chip>
5024
+ <Chip size="default" defaultSelected>
5025
+ CVA variants
5026
+ </Chip>
5027
+ <Chip size="lg" defaultSelected>
5028
+ CVA variants
5029
+ </Chip>
5030
+ </div>
5031
+ </div>
5032
+
5033
+ <div className="space-y-3">
5034
+ <p className="text-xs font-medium text-muted-foreground">
5035
+ With icon — a leading icon (strokeWidth 1.5) swaps for the
5036
+ check indicator while selected.
5037
+ </p>
5038
+ <div className="flex flex-wrap gap-2">
5039
+ <Chip icon={<PaletteIcon strokeWidth={1.5} />}>
5040
+ design tokens
5041
+ </Chip>
5042
+ <Chip icon={<PaletteIcon strokeWidth={1.5} />} defaultSelected>
5043
+ design tokens
5044
+ </Chip>
5045
+ </div>
5046
+ </div>
5047
+
5048
+ <div className="space-y-3">
5049
+ <p className="text-xs font-medium text-muted-foreground">
5050
+ Disabled — non-focusable, 50% opacity, state frozen.
5051
+ </p>
5052
+ <div className="flex flex-wrap gap-2">
5053
+ <Chip disabled>forced colors</Chip>
5054
+ <Chip disabled defaultSelected>
5055
+ forced colors
5056
+ </Chip>
5057
+ </div>
5058
+ </div>
5059
+
5060
+ <div className="space-y-3">
5061
+ <p className="text-xs font-medium text-muted-foreground">
5062
+ Realistic use — Jordan Reeves filtering the component docs by
5063
+ topic; the result count updates live.
5064
+ </p>
5065
+ <ChipFilterDemo />
5066
+ </div>
5067
+ </div>
5068
+ </Section>
5069
+
5070
+ <Section title="Notification">
5071
+ <div className="max-w-md space-y-8">
5072
+ <div className="space-y-3">
5073
+ <p className="text-xs font-medium text-muted-foreground">
5074
+ Default — persisted feed item with title + description. Distinct
5075
+ from Alert (static, no dismiss) and Sonner (ephemeral toast).
5076
+ </p>
5077
+ <Notification
5078
+ title="Chromatic baseline updated"
5079
+ description="4 visual changes are ready to review on the tokens-v2-proposal branch."
5080
+ />
5081
+ </div>
5082
+
5083
+ <div className="space-y-3">
5084
+ <p className="text-xs font-medium text-muted-foreground">
5085
+ Unread — dot indicator + data-unread attribute (never color
5086
+ alone; the dot is decorative, the attribute is the contract).
5087
+ </p>
5088
+ <Notification
5089
+ unread
5090
+ title="Jordan Reeves mentioned you"
5091
+ description="&ldquo;Can you confirm the 7:1 pair on the new success accent before I merge?&rdquo;"
5092
+ />
5093
+ </div>
5094
+
5095
+ <div className="space-y-3">
5096
+ <p className="text-xs font-medium text-muted-foreground">
5097
+ With timestamp — meta line in tabular numerals.
5098
+ </p>
5099
+ <Notification
5100
+ title="Story coverage report ready"
5101
+ description="Coverage is at 98.4% after last night's build pass."
5102
+ timestamp="2 min ago"
5103
+ />
5104
+ </div>
5105
+
5106
+ <div className="space-y-3">
5107
+ <p className="text-xs font-medium text-muted-foreground">
5108
+ With icon — leading 20px icon slot (also takes an Avatar).
5109
+ </p>
5110
+ <Notification
5111
+ icon={<GitPullRequestIcon strokeWidth={1.5} />}
5112
+ title="PR #482 opened"
5113
+ description="feat(notification): add Notification primitive [Night Shift]"
5114
+ timestamp="Just now"
5115
+ />
5116
+ </div>
5117
+
5118
+ <div className="space-y-3">
5119
+ <p className="text-xs font-medium text-muted-foreground">
5120
+ Loading — Spinner takes the icon slot; aria-busy on the root.
5121
+ </p>
5122
+ <Notification
5123
+ loading
5124
+ title="Publishing tokens v2"
5125
+ description="Running pnpm build:tokens and pushing to the registry."
5126
+ />
5127
+ </div>
5128
+
5129
+ <div className="space-y-3">
5130
+ <p className="text-xs font-medium text-muted-foreground">
5131
+ Variants — the hue lives only in the non-text accent bar +
5132
+ icon; text stays foreground/muted for the AAA 7:1 floor.
5133
+ </p>
5134
+ <div className="space-y-2">
5135
+ <Notification
5136
+ title="Default"
5137
+ description="Neutral informational update."
5138
+ />
5139
+ <Notification
5140
+ variant="destructive"
5141
+ icon={<TriangleAlertIcon strokeWidth={1.5} />}
5142
+ title="CI gate failed"
5143
+ description="lint:microanimation found a duration-200 literal in sheet.tsx."
5144
+ />
5145
+ <Notification
5146
+ variant="success"
5147
+ icon={<CheckCircle2Icon strokeWidth={1.5} />}
5148
+ title="WCAG audit passed"
5149
+ description="All 41 token pairs meet the AAA 7:1 floor."
5150
+ />
5151
+ <Notification
5152
+ variant="warning"
5153
+ icon={<TriangleAlertIcon strokeWidth={1.5} />}
5154
+ title="Token drift detected"
5155
+ description="3 hardcoded hex values found in components/examples/cards."
5156
+ />
5157
+ </div>
5158
+ </div>
5159
+
5160
+ <div className="space-y-3">
5161
+ <p className="text-xs font-medium text-muted-foreground">
5162
+ Dismissible — passing onDismiss renders the built-in close
5163
+ button (keyboard accessible, labeled from the title).
5164
+ </p>
5165
+ <NotificationDismissDemo />
5166
+ </div>
5167
+
5168
+ <div className="space-y-3">
5169
+ <p className="text-xs font-medium text-muted-foreground">
5170
+ Realistic use — notification-center feed (role=&quot;feed&quot;
5171
+ list, role=&quot;article&quot; items, mixed read/unread).
5172
+ Dismissing removes the item from the list.
5173
+ </p>
5174
+ <NotificationFeedDemo />
5175
+ </div>
5176
+ </div>
5177
+ </Section>
5178
+
5179
+ <Section title="Transfer List">
5180
+ <TransferListShowcase />
5181
+ </Section>
5182
+
5183
+ <Section title="Burger">
5184
+ <BurgerShowcase />
5185
+ </Section>
5186
+
5187
+ <Section title="Action Bar">
5188
+ <ActionBarShowcase />
5189
+ </Section>
5190
+
5191
+ <Section title="Checkbox Card">
5192
+ <CheckboxCardShowcase />
5193
+ </Section>
5194
+ <Section title="Watermark">
5195
+ <WatermarkShowcase />
5196
+ </Section>
5197
+
5198
+ <Section title="LoadingOverlay">
5199
+ <LoadingOverlayShowcase />
5200
+ </Section>
5201
+
5202
+ <Section title="FloatLabel">
5203
+ <FloatLabelShowcase />
5204
+ </Section>
5205
+
5206
+ <Section title="Image">
5207
+ <ImageShowcase />
5208
+ </Section>
5209
+
5210
+ <Section title="Tour">
5211
+ <TourShowcase />
5212
+ </Section>
5213
+
5214
+ <Section title="Masonry">
5215
+ <MasonryShowcase />
5216
+ </Section>
5217
+
5218
+ <Section title="Listbox">
5219
+ <ListboxShowcase />
5220
+ </Section>
5221
+
5222
+ <Section title="FloatingPanel">
5223
+ <FloatingPanelShowcase />
5224
+ </Section>
5225
+
5226
+ <Section title="Anchor">
5227
+ <AnchorShowcase />
5228
+ </Section>
5229
+
5230
+ <Section title="Overlay">
5231
+ <OverlayShowcase />
5232
+ </Section>
5233
+ <Section title="Cascader">
5234
+ <CascaderShowcase />
5235
+ </Section>
5236
+ <Section title="Affix">
5237
+ <AffixShowcase />
5238
+ </Section>
5239
+ <Section title="SkipLink">
5240
+ <SkipLinkShowcase />
5241
+ </Section>
5242
+ <Section title="Timer">
5243
+ <TimerShowcase />
5244
+ </Section>
5245
+ <Section title="Signature Pad">
5246
+ <SignaturePadShowcase />
5247
+ </Section>
5248
+ </div>
5249
+ </div>
5250
+ );
5251
+ }
5252
+
5253
+ function SignaturePadShowcase() {
5254
+ const consentPadRef = React.useRef<SignaturePadHandle>(null);
5255
+ const [consentSigned, setConsentSigned] = React.useState(false);
5256
+ return (
5257
+ <div className="space-y-6">
5258
+ <p className="text-sm text-muted-foreground">
5259
+ Canvas-based freehand signature input for legal, consent, medical, and
5260
+ e-signing flows. Pointer capture covers mouse, touch, and pen; ink is
5261
+ the computed foreground token (existing strokes replay on light/dark
5262
+ flip); Undo and Clear are 44px keyboard-operable controls; captured and
5263
+ cleared states announce politely to screen readers. Strokes live in
5264
+ memory only — persistence is the caller&apos;s responsibility.
5265
+ </p>
5266
+ <div className="grid gap-6 lg:grid-cols-2">
5267
+ <div className="space-y-2">
5268
+ <p className="text-xs font-medium text-muted-foreground">
5269
+ Default — foreground ink, 2px pen. Draw, then Undo removes the
5270
+ last stroke and Clear starts over.
5271
+ </p>
5272
+ <SignaturePad />
5273
+ </div>
5274
+ <div className="space-y-2">
5275
+ <p className="text-xs font-medium text-muted-foreground">
5276
+ Custom pen — <code className="font-mono">penColor=&quot;var(--primary)&quot;</code>,
5277
+ 3px width. Any var(--x) value resolves against the live theme.
5278
+ </p>
5279
+ <SignaturePad penColor="var(--primary)" penWidth={3} />
5280
+ </div>
5281
+ </div>
5282
+ <div className="max-w-md space-y-2">
5283
+ <p className="text-xs font-medium text-muted-foreground">
5284
+ Realistic use — sign-to-confirm consent card. The submit CTA stays
5285
+ disabled until a stroke lands (onEnd), and the imperative handle
5286
+ exports the opaque data URL.
5287
+ </p>
5288
+ <Card>
5289
+ <CardHeader>
5290
+ <CardTitle>Sign to confirm</CardTitle>
5291
+ <CardDescription>
5292
+ By signing below, Jordan Reeves agrees to the BADS design system
5293
+ license terms effective 2026-07-25.
5294
+ </CardDescription>
5295
+ </CardHeader>
5296
+ <CardContent className="flex flex-col gap-4">
5297
+ <SignaturePad
5298
+ ref={consentPadRef}
5299
+ aria-label="Signature pad — sign to accept the license terms"
5300
+ onEnd={() => setConsentSigned(true)}
5301
+ />
5302
+ <Button
5303
+ size="xl"
5304
+ className="w-full"
5305
+ disabled={!consentSigned}
5306
+ onClick={() => consentPadRef.current?.toDataURL()}
5307
+ >
5308
+ Accept and submit
5309
+ </Button>
5310
+ </CardContent>
5311
+ </Card>
5312
+ </div>
5313
+ </div>
5314
+ );
5315
+ }
5316
+
5317
+ function AnchorShowcase() {
5318
+ const sections: { id: string; title: string; body: string; depth?: number }[] = [
5319
+ {
5320
+ id: "anchor-demo-fork",
5321
+ title: "Fork and rename",
5322
+ body: "Every engagement starts by forking BADS and running pnpm rename with the client display name and slug. The npm package name stays stable; the header and localStorage prefix follow the new brand.",
5323
+ },
5324
+ {
5325
+ id: "anchor-demo-brief",
5326
+ title: "Write the brief",
5327
+ body: "BRIEF.md is the AI-readable one-pager — mission, audience, surfaces, tone, refusals. Until it exists, generated UI reads as generic SaaS.",
5328
+ },
5329
+ {
5330
+ id: "anchor-demo-tokens",
5331
+ title: "Customize tokens",
5332
+ body: "Edit tokens.json, run pnpm build:tokens, and both the published theme and the local preview regenerate. The wcag audit keeps every pair at the 7:1 AAA floor while you tune.",
5333
+ depth: 1,
5334
+ },
5335
+ {
5336
+ id: "anchor-demo-fonts",
5337
+ title: "Verify fonts",
5338
+ body: "A family named in a font stack without a declared source silently falls back — pnpm verify:fonts catches it before a brand font ships as its fallback.",
5339
+ depth: 1,
5340
+ },
5341
+ {
5342
+ id: "anchor-demo-ship",
5343
+ title: "Verify and ship",
5344
+ body: "pnpm a11y runs the contrast audit, the static lint, and the size contract in one pass. Chromatic baselines every story on the next push to main.",
5345
+ },
5346
+ ];
5347
+ return (
5348
+ <div className="space-y-6">
5349
+ <p className="text-sm text-muted-foreground">
5350
+ Scroll-linked in-page navigation (scroll-spy). The nav observes each
5351
+ target section with IntersectionObserver and moves{" "}
5352
+ <code className="font-mono">aria-current=&quot;location&quot;</code> plus
5353
+ the primary indicator line to the section currently in view. Links are
5354
+ real <code className="font-mono">&lt;a href=&quot;#id&quot;&gt;</code>{" "}
5355
+ anchors — keyboard and screen-reader behavior is native. Distinct from
5356
+ NavigationMenu (multi-page) and Breadcrumb (path hierarchy).
5357
+ </p>
5358
+ <div>
5359
+ <p className="mb-3 text-sm font-medium text-muted-foreground">
5360
+ Default — scroll the article; the active link follows. Nested items
5361
+ use <code className="font-mono">depth</code> for indentation.
5362
+ </p>
5363
+ <div className="flex max-w-2xl gap-8">
5364
+ <div className="h-72 min-w-0 flex-1 overflow-y-auto rounded-lg border border-border p-5">
5365
+ {sections.map((s) => (
5366
+ <section key={s.id} id={s.id} className="scroll-mt-4 space-y-2 pb-10">
5367
+ <h3 className="text-lg font-semibold tracking-tight">{s.title}</h3>
5368
+ <p className="text-sm text-muted-foreground">{s.body}</p>
5369
+ </section>
5370
+ ))}
5371
+ </div>
5372
+ <Anchor
5373
+ className="w-48 shrink-0 self-start"
5374
+ items={sections.map((s) => ({ id: s.id, label: s.title, depth: s.depth }))}
5375
+ />
5376
+ </div>
5377
+ </div>
5378
+ <div>
5379
+ <p className="mb-3 text-sm font-medium text-muted-foreground">
5380
+ Custom landmark label via <code className="font-mono">label</code> —
5381
+ announced to screen readers; <code className="font-mono">offset</code>{" "}
5382
+ compensates for sticky headers.
5383
+ </p>
5384
+ <Anchor
5385
+ className="w-56"
5386
+ label="Onboarding steps"
5387
+ offset={64}
5388
+ items={[
5389
+ { id: "anchor-demo-fork", label: "Fork and rename" },
5390
+ { id: "anchor-demo-brief", label: "Write the brief" },
5391
+ { id: "anchor-demo-ship", label: "Verify and ship" },
5392
+ ]}
5393
+ />
5394
+ </div>
5395
+ </div>
5396
+ );
5397
+ }
5398
+
5399
+ function FloatingPanelShowcase() {
5400
+ const [helpOpen, setHelpOpen] = React.useState(true);
5401
+ return (
5402
+ <div className="space-y-6">
5403
+ <p className="text-sm text-muted-foreground">
5404
+ Floating, always-rendered, non-modal companion panel anchored to a
5405
+ viewport corner — contextual help that stays available while the user
5406
+ works, debug overlays, sticky-note panels. A{" "}
5407
+ <code className="font-mono">role=&quot;complementary&quot;</code>{" "}
5408
+ landmark: focus is never trapped, and when closed the panel carries
5409
+ the <code className="font-mono">hidden</code> attribute so it leaves
5410
+ the tab order. Demos below override the default{" "}
5411
+ <code className="font-mono">fixed</code> positioning with{" "}
5412
+ <code className="font-mono">className=&quot;absolute&quot;</code> so
5413
+ the panels anchor to this container instead of the viewport.
5414
+ </p>
5415
+ <div>
5416
+ <p className="mb-3 text-sm font-medium text-muted-foreground">
5417
+ Default (bottom-right, no title) and WithTitle (bottom-left)
5418
+ </p>
5419
+ <div className="relative h-64 overflow-hidden rounded-lg border border-border bg-muted/30 p-4">
5420
+ <p className="max-w-sm text-sm text-muted-foreground">
5421
+ Page content keeps working underneath — the panels float over it
5422
+ without blocking clicks or tab order elsewhere.
5423
+ </p>
5424
+ <FloatingPanel className="absolute">
5425
+ <p className="text-sm">Hello from the floating panel</p>
5426
+ </FloatingPanel>
5427
+ <FloatingPanel className="absolute" defaultPosition="bottom-left" title="Help">
5428
+ <p className="text-sm text-muted-foreground">
5429
+ Every token pair on this screen is audited at 7:1 contrast.
5430
+ </p>
5431
+ </FloatingPanel>
5432
+ </div>
5433
+ </div>
5434
+ <div>
5435
+ <p className="mb-3 text-sm font-medium text-muted-foreground">
5436
+ Close button + closed state —{" "}
5437
+ <code className="font-mono">onOpenChange</code> renders the labelled
5438
+ close X; <code className="font-mono">open=&#123;false&#125;</code>{" "}
5439
+ applies <code className="font-mono">hidden</code> (no invisible tab
5440
+ stops)
5441
+ </p>
5442
+ <div className="relative h-56 overflow-hidden rounded-lg border border-border bg-muted/30 p-4">
5443
+ {!helpOpen && (
5444
+ <Button size="xl" variant="outline" onClick={() => setHelpOpen(true)}>
5445
+ Reopen contextual help
5446
+ </Button>
5447
+ )}
5448
+ <FloatingPanel
5449
+ className="absolute"
5450
+ defaultPosition="top-right"
5451
+ title="Contextual Help"
5452
+ open={helpOpen}
5453
+ onOpenChange={setHelpOpen}
5454
+ >
5455
+ <p className="text-sm text-muted-foreground">
5456
+ Review flows walk every proposed token pair through the AAA
5457
+ contrast audit before the change lands.
5458
+ </p>
5459
+ </FloatingPanel>
5460
+ </div>
5461
+ </div>
5462
+ <p className="text-xs text-muted-foreground">
5463
+ Non-modal by design: no focus trap, no auto-focus, no backdrop. Use
5464
+ Dialog for anything that must interrupt, Sheet for edge-anchored task
5465
+ surfaces, Popover for trigger-anchored content.
5466
+ </p>
5467
+ </div>
5468
+ );
5469
+ }
5470
+
5471
+ function WatermarkShowcase() {
5472
+ return (
5473
+ <div className="space-y-6">
5474
+ <p className="text-sm text-muted-foreground">
5475
+ Repeating diagonal mark for draft, confidential, or provenance-bearing
5476
+ surfaces. Canvas-tiled, theme-reactive (default ink is
5477
+ muted-foreground), aria-hidden, and pointer-events-none — the content
5478
+ underneath stays selectable, focusable, and fully readable by
5479
+ assistive tech. A visual cue, never a security control.
5480
+ </p>
5481
+ <div className="grid gap-6 lg:grid-cols-2">
5482
+ <div className="space-y-2">
5483
+ <p className="text-xs font-medium text-muted-foreground">
5484
+ Default — single-line text mark at -45°, 0.15 opacity. Note the
5485
+ visible &ldquo;Draft&rdquo; Badge: the watermark is aria-hidden,
5486
+ so status always ships in a readable element too.
5487
+ </p>
5488
+ <Watermark content="Internal review — do not distribute">
5489
+ <Card>
5490
+ <CardHeader className="flex-row items-start justify-between space-y-0">
5491
+ <div className="space-y-1.5">
5492
+ <CardTitle>Tokens v2 proposal</CardTitle>
5493
+ <CardDescription>
5494
+ Shared by Anika Patel · design.bads.com
5495
+ </CardDescription>
5496
+ </div>
5497
+ <Badge variant="secondary">Draft</Badge>
5498
+ </CardHeader>
5499
+ <CardContent className="text-sm leading-relaxed text-muted-foreground">
5500
+ The semantic layer gets three new aliases so chart surfaces
5501
+ stop borrowing from the sidebar palette. Every pair was
5502
+ audited at 7:1 before this draft went out.
5503
+ </CardContent>
5504
+ </Card>
5505
+ </Watermark>
5506
+ </div>
5507
+ <div className="space-y-2">
5508
+ <p className="text-xs font-medium text-muted-foreground">
5509
+ Tuned — multi-line content (classification + identity), custom
5510
+ rotation, gap, and type size for per-viewer provenance marks.
5511
+ </p>
5512
+ <Watermark
5513
+ content={["Confidential", "jordan@reeves.design"]}
5514
+ rotate={-30}
5515
+ gap={[90, 80]}
5516
+ font={{ fontSize: 14, fontWeight: "medium" }}
5517
+ opacity={0.12}
5518
+ >
5519
+ <Card>
5520
+ <CardHeader>
5521
+ <CardTitle>Invoice #2047</CardTitle>
5522
+ <CardDescription>
5523
+ Issued 2026-05-26 · Pro tier, annual · $249.00 per seat
5524
+ </CardDescription>
5525
+ </CardHeader>
5526
+ <CardContent className="text-sm leading-relaxed text-muted-foreground">
5527
+ Pricing terms on this invoice are pre-announcement. The
5528
+ overlay never intercepts selection or clicks — copy this text
5529
+ to prove it.
5530
+ </CardContent>
5531
+ </Card>
5532
+ </Watermark>
5533
+ </div>
5534
+ </div>
5535
+ </div>
5536
+ );
5537
+ }
5538
+
5539
+ function BurgerShowcase() {
5540
+ const [opened, setOpened] = React.useState(false);
5541
+ const [navOpen, setNavOpen] = React.useState(false);
5542
+ return (
5543
+ <div className="space-y-6">
5544
+ <div>
5545
+ <p className="mb-3 text-sm font-medium text-muted-foreground">
5546
+ Interactive — click to morph between hamburger and X
5547
+ </p>
5548
+ <div className="flex flex-wrap items-center gap-6">
5549
+ <Burger
5550
+ opened={opened}
5551
+ onClick={() => setOpened((v) => !v)}
5552
+ aria-label="Toggle navigation"
5553
+ />
5554
+ <Burger opened aria-label="Toggle navigation" />
5555
+ <Burger disabled aria-label="Toggle navigation" />
5556
+ </div>
5557
+ </div>
5558
+ <div>
5559
+ <p className="mb-3 text-sm font-medium text-muted-foreground">
5560
+ Sizes — glyph scales, the 44px touch target doesn&rsquo;t
5561
+ </p>
5562
+ <div className="flex flex-wrap items-center gap-6">
5563
+ <Burger size="sm" aria-label="Toggle navigation" />
5564
+ <Burger size="md" aria-label="Toggle navigation" />
5565
+ <Burger size="lg" aria-label="Toggle navigation" />
5566
+ </div>
5567
+ </div>
5568
+ <div>
5569
+ <p className="mb-3 text-sm font-medium text-muted-foreground">
5570
+ Realistic use — mobile top bar controlling a nav drawer
5571
+ </p>
5572
+ <div className="w-full max-w-sm rounded-lg border border-border">
5573
+ <header className="flex items-center justify-between border-b border-border p-2 pl-4">
5574
+ <span className="text-sm font-semibold">BADS Docs</span>
5575
+ <Burger
5576
+ opened={navOpen}
5577
+ onClick={() => setNavOpen((v) => !v)}
5578
+ aria-label="Toggle navigation"
5579
+ aria-controls="showcase-burger-nav"
5580
+ />
5581
+ </header>
5582
+ <nav
5583
+ id="showcase-burger-nav"
5584
+ aria-label="Main"
5585
+ hidden={!navOpen}
5586
+ className="p-4"
5587
+ >
5588
+ <ul className="space-y-2 text-sm text-muted-foreground">
5589
+ <li>Getting started</li>
5590
+ <li>Tokens</li>
5591
+ <li>Components</li>
5592
+ <li>Accessibility</li>
5593
+ </ul>
5594
+ </nav>
5595
+ </div>
5596
+ </div>
5597
+ </div>
5598
+ );
5599
+ }
5600
+
5601
+ function ActionBarStaticDemo({
5602
+ count,
5603
+ caption,
5604
+ disabled = false,
5605
+ }: {
5606
+ count: number;
5607
+ caption: string;
5608
+ disabled?: boolean;
5609
+ }) {
5610
+ return (
5611
+ <div className="space-y-2">
5612
+ <p className="text-sm text-muted-foreground">{caption}</p>
5613
+ <div className="relative min-h-28 overflow-hidden rounded-lg border border-dashed border-border bg-muted/20">
5614
+ <ActionBar
5615
+ selectedCount={count}
5616
+ onClearSelection={() => {}}
5617
+ className="absolute bottom-4"
5618
+ >
5619
+ <Button variant="ghost" size="xl" className="px-4" disabled={disabled}>
5620
+ <ArchiveIcon strokeWidth={1.5} aria-hidden="true" />
5621
+ Archive
5622
+ </Button>
5623
+ <Button variant="ghost" size="xl" className="px-4" disabled={disabled}>
5624
+ <DownloadIcon strokeWidth={1.5} aria-hidden="true" />
5625
+ Export
5626
+ </Button>
5627
+ <Button
5628
+ variant="ghost"
5629
+ size="xl"
5630
+ className="px-4 text-destructive hover:text-destructive"
5631
+ disabled={disabled}
5632
+ >
5633
+ <Trash2Icon strokeWidth={1.5} aria-hidden="true" />
5634
+ Delete
5635
+ </Button>
5636
+ </ActionBar>
5637
+ </div>
5638
+ </div>
5639
+ );
5640
+ }
5641
+
5642
+ const ACTION_BAR_REVIEWERS = [
5643
+ { id: "jordan", name: "Jordan Reeves", email: "jordan@reeves.design" },
5644
+ { id: "seoyun", name: "Seo-yun Park", email: "seoyun.park@figma.com" },
5645
+ { id: "marcus", name: "Marcus Lindqvist", email: "marcus@lindqvist.dev" },
5646
+ { id: "anika", name: "Anika Patel", email: "anika.patel@stripe.com" },
5647
+ { id: "tomas", name: "Tomás Herrera", email: "tomas.herrera@vercel.com" },
5648
+ ];
5649
+
5650
+ function ActionBarShowcase() {
5651
+ const [selected, setSelected] = React.useState<Set<string>>(
5652
+ () => new Set(["seoyun"])
5653
+ );
5654
+
5655
+ const toggle = (id: string, next: boolean) =>
5656
+ setSelected((prev) => {
5657
+ const copy = new Set(prev);
5658
+ if (next) copy.add(id);
5659
+ else copy.delete(id);
5660
+ return copy;
5661
+ });
5662
+
5663
+ return (
5664
+ <div className="space-y-8">
5665
+ <ActionBarStaticDemo
5666
+ count={3}
5667
+ caption="Default — 3 items selected, count plus slotted bulk actions and the built-in clear button."
5668
+ />
5669
+ <ActionBarStaticDemo
5670
+ count={47}
5671
+ caption="Select-all across a long list — the tabular-nums count stays on one line at any magnitude."
5672
+ />
5673
+ <ActionBarStaticDemo
5674
+ count={0}
5675
+ caption="Zero selected — the bar dismisses (opacity 0, translated down, inert) but stays in the DOM so the exit transition plays."
5676
+ />
5677
+ <div className="space-y-2">
5678
+ <p className="text-sm text-muted-foreground">
5679
+ Realistic use — check reviewers below and the bar appears; clear the
5680
+ selection (or press the ×) and it dismisses.
5681
+ </p>
5682
+ <div className="relative min-h-96 overflow-hidden rounded-lg border bg-background p-6">
5683
+ <div className="mx-auto max-w-md">
5684
+ <p className="text-sm font-medium text-foreground">
5685
+ Workspace reviewers
5686
+ </p>
5687
+ <ul className="mt-3 divide-y divide-border rounded-lg border">
5688
+ {ACTION_BAR_REVIEWERS.map((person) => (
5689
+ <li
5690
+ key={person.id}
5691
+ className="flex items-center gap-3 px-4 py-2"
5692
+ >
5693
+ <Checkbox
5694
+ id={`action-bar-reviewer-${person.id}`}
5695
+ checked={selected.has(person.id)}
5696
+ onCheckedChange={(next) => toggle(person.id, next === true)}
5697
+ />
5698
+ <Label
5699
+ htmlFor={`action-bar-reviewer-${person.id}`}
5700
+ className="flex min-w-0 flex-1 cursor-pointer flex-col gap-0.5 py-1.5"
5701
+ >
5702
+ <span className="truncate text-sm font-medium text-foreground">
5703
+ {person.name}
5704
+ </span>
5705
+ <span className="truncate text-sm text-muted-foreground">
5706
+ {person.email}
5707
+ </span>
5708
+ </Label>
5709
+ </li>
5710
+ ))}
5711
+ </ul>
5712
+ </div>
5713
+ <ActionBar
5714
+ selectedCount={selected.size}
5715
+ onClearSelection={() => setSelected(new Set())}
5716
+ className="absolute bottom-4"
5717
+ >
5718
+ <Button variant="ghost" size="xl" className="px-4">
5719
+ <DownloadIcon strokeWidth={1.5} aria-hidden="true" />
5720
+ Export
5721
+ </Button>
5722
+ <Button
5723
+ variant="ghost"
5724
+ size="xl"
5725
+ className="px-4 text-destructive hover:text-destructive"
5726
+ onClick={() => setSelected(new Set())}
5727
+ >
5728
+ <Trash2Icon strokeWidth={1.5} aria-hidden="true" />
5729
+ Remove
5730
+ </Button>
5731
+ </ActionBar>
5732
+ </div>
5733
+ </div>
5734
+ </div>
5735
+ );
5736
+ }
5737
+
5738
+
5739
+
5740
+ function TransferListShowcase() {
5741
+ const [available, setAvailable] = React.useState([
5742
+ "Accordion",
5743
+ "Badge",
5744
+ "Calendar",
5745
+ "Checkbox",
5746
+ "Dialog",
5747
+ "Tooltip",
5748
+ ]);
5749
+ const [selected, setSelected] = React.useState<string[]>([]);
5750
+ return (
5751
+ <div className="space-y-4">
5752
+ <p className="text-sm text-muted-foreground">
5753
+ Dual-panel list with transfer controls. Check items, then move them
5754
+ between panels using the directional buttons.
5755
+ </p>
5756
+ <TransferListComponent
5757
+ available={available}
5758
+ selected={selected}
5759
+ onAvailableChange={setAvailable}
5760
+ onSelectedChange={setSelected}
5761
+ availableLabel="Available"
5762
+ selectedLabel="Selected"
5763
+ searchable={false}
5764
+ />
5765
+ {selected.length > 0 && (
5766
+ <p className="text-sm text-muted-foreground">
5767
+ Selected:{" "}
5768
+ <span className="font-medium text-foreground">
5769
+ {selected.join(", ")}
5770
+ </span>
5771
+ </p>
5772
+ )}
5773
+ </div>
5774
+ );
5775
+ }
5776
+
5777
+ function ChipFilterDemo() {
5778
+ const topics = [
5779
+ "design tokens",
5780
+ "a11y contract",
5781
+ "CVA variants",
5782
+ "visual regression",
5783
+ "token drift",
5784
+ "focus trap",
5785
+ ];
5786
+ const [active, setActive] = React.useState<string[]>([
5787
+ "design tokens",
5788
+ "a11y contract",
5789
+ ]);
5790
+ const toggle = (topic: string, next: boolean) =>
5791
+ setActive((prev) =>
5792
+ next ? [...prev, topic] : prev.filter((t) => t !== topic)
5793
+ );
5794
+ return (
5795
+ <div className="w-full max-w-md rounded-lg border border-border p-4">
5796
+ <div className="mb-3 flex items-baseline justify-between gap-3">
5797
+ <p className="text-sm font-medium text-foreground">Filter docs</p>
5798
+ <p className="text-sm text-muted-foreground" aria-live="polite">
5799
+ {active.length} of {topics.length} topics
5800
+ </p>
5801
+ </div>
5802
+ <div
5803
+ role="group"
5804
+ aria-label="Filter docs by topic"
5805
+ className="flex flex-wrap gap-2"
5806
+ >
5807
+ {topics.map((topic) => (
5808
+ <Chip
5809
+ key={topic}
5810
+ size="sm"
5811
+ variant="outline"
5812
+ selected={active.includes(topic)}
5813
+ onSelectedChange={(next) => toggle(topic, next)}
5814
+ >
5815
+ {topic}
5816
+ </Chip>
5817
+ ))}
5818
+ </div>
5819
+ </div>
5820
+ );
5821
+ }
5822
+
5823
+ function MeterStorageDemo() {
5824
+ const [used, setUsed] = React.useState(12.4);
5825
+ const max = 20;
5826
+ const pct = (used / max) * 100;
5827
+ const variant = pct >= 90 ? "destructive" : pct >= 75 ? "warning" : "default";
5828
+ return (
5829
+ <Card className="w-80">
5830
+ <CardHeader>
5831
+ <CardTitle className="text-2xl">Storage</CardTitle>
5832
+ <CardDescription>
5833
+ design.bads.com &middot; Jordan Reeves&rsquo; workspace
5834
+ </CardDescription>
5835
+ </CardHeader>
5836
+ <CardContent className="space-y-4">
5837
+ <Meter
5838
+ value={used}
5839
+ min={0}
5840
+ max={max}
5841
+ variant={variant}
5842
+ label="Asset storage"
5843
+ showValue
5844
+ getValueLabel={(v, _min, m) => `${v.toFixed(1)} GB of ${m} GB`}
5845
+ />
5846
+ <Button
5847
+ variant="outline"
5848
+ size="xl"
5849
+ className="w-full"
5850
+ onClick={() =>
5851
+ setUsed((u) =>
5852
+ u >= max - 2 ? 12.4 : Math.round((u + 2.4) * 10) / 10
5853
+ )
5854
+ }
5855
+ >
5856
+ Upload exemplar batch (+2.4 GB)
5857
+ </Button>
5858
+ </CardContent>
5859
+ </Card>
5860
+ );
5861
+ }
5862
+
5863
+ function BottomNavigationDefaultDemo() {
5864
+ const [value, setValue] = React.useState("home");
5865
+ return (
5866
+ <div className="w-80 overflow-hidden rounded-lg border border-border">
5867
+ <BottomNavigation value={value} onValueChange={setValue} label="Primary">
5868
+ <BottomNavigationItem value="home" icon={<HomeIcon strokeWidth={1.5} />} label="Home" />
5869
+ <BottomNavigationItem value="search" icon={<SearchIcon strokeWidth={1.5} />} label="Search" />
5870
+ <BottomNavigationItem value="library" icon={<LibraryIcon strokeWidth={1.5} />} label="Library" />
5871
+ </BottomNavigation>
5872
+ </div>
5873
+ );
5874
+ }
5875
+
5876
+ function BottomNavigationDisabledDemo() {
5877
+ const [value, setValue] = React.useState("home");
5878
+ return (
5879
+ <div className="w-80 overflow-hidden rounded-lg border border-border">
5880
+ <BottomNavigation value={value} onValueChange={setValue} label="Primary with disabled item">
5881
+ <BottomNavigationItem value="home" icon={<HomeIcon strokeWidth={1.5} />} label="Home" />
5882
+ <BottomNavigationItem value="alerts" icon={<BellIcon strokeWidth={1.5} />} label="Alerts" disabled />
5883
+ <BottomNavigationItem value="profile" icon={<UserIcon strokeWidth={1.5} />} label="Profile" />
5884
+ </BottomNavigation>
5885
+ </div>
5886
+ );
5887
+ }
5888
+
5889
+ function BottomNavigationFiveDemo() {
5890
+ const [value, setValue] = React.useState("components");
5891
+ return (
5892
+ <div className="w-full max-w-md overflow-hidden rounded-lg border border-border">
5893
+ <BottomNavigation value={value} onValueChange={setValue} label="Design system">
5894
+ <BottomNavigationItem value="home" icon={<HomeIcon strokeWidth={1.5} />} label="Home" />
5895
+ <BottomNavigationItem value="components" icon={<LibraryIcon strokeWidth={1.5} />} label="Components" />
5896
+ <BottomNavigationItem value="tokens" icon={<PaletteIcon strokeWidth={1.5} />} label="Tokens" />
5897
+ <BottomNavigationItem value="docs" icon={<BookOpenIcon strokeWidth={1.5} />} label="Docs" />
5898
+ <BottomNavigationItem value="profile" icon={<UserIcon strokeWidth={1.5} />} label="Profile" />
5899
+ </BottomNavigation>
5900
+ </div>
5901
+ );
5902
+ }
5903
+
5904
+ function BottomNavigationPhoneDemo() {
5905
+ const [section, setSection] = React.useState("components");
5906
+ const screens: Record<string, { title: string; body: string }> = {
5907
+ home: {
5908
+ title: "Welcome back, Jordan",
5909
+ body: "Story coverage is at 98.4%. Last token change was 3 days ago.",
5910
+ },
5911
+ components: {
5912
+ title: "Component registry",
5913
+ body: "88 registry components with a11y contracts. Newest: QRCode, DataList, FormatNumber.",
5914
+ },
5915
+ tokens: {
5916
+ title: "Tokens",
5917
+ body: "12,417 token references scanned in the last orphan-lint sweep. Zero orphans flagged.",
5918
+ },
5919
+ profile: {
5920
+ title: "Jordan Reeves",
5921
+ body: "Design Systems Lead · jordan@reeves.design · Austin, TX",
5922
+ },
5923
+ };
5924
+ const screen = screens[section];
5925
+ return (
5926
+ <div className="flex h-[440px] w-72 flex-col overflow-hidden rounded-xl border border-border bg-background shadow-sm">
5927
+ <div className="flex-1 space-y-3 overflow-y-auto p-4">
5928
+ <Badge variant="secondary">design.bads.com</Badge>
5929
+ <h3 className="text-lg font-semibold">{screen.title}</h3>
5930
+ <Card>
5931
+ <CardContent className="p-4">
5932
+ <p className="text-sm text-muted-foreground">{screen.body}</p>
5933
+ </CardContent>
5934
+ </Card>
5935
+ </div>
5936
+ <BottomNavigation value={section} onValueChange={setSection} label="Docs app primary">
5937
+ <BottomNavigationItem value="home" icon={<HomeIcon strokeWidth={1.5} />} label="Home" />
5938
+ <BottomNavigationItem value="components" icon={<LibraryIcon strokeWidth={1.5} />} label="Components" />
5939
+ <BottomNavigationItem value="tokens" icon={<PaletteIcon strokeWidth={1.5} />} label="Tokens" />
5940
+ <BottomNavigationItem value="profile" icon={<UserIcon strokeWidth={1.5} />} label="Profile" />
5941
+ </BottomNavigation>
5942
+ </div>
5943
+ );
5944
+ }
5945
+
5946
+ function MarqueeTickerDemo(
5947
+ props: Omit<React.ComponentProps<typeof Marquee>, "children" | "aria-label">
5948
+ ) {
5949
+ const topics = [
5950
+ "design tokens",
5951
+ "semantic layer",
5952
+ "a11y contract",
5953
+ "CVA variants",
5954
+ "Radix primitive",
5955
+ "anti-pattern",
5956
+ "token drift",
5957
+ "visual regression",
5958
+ "forced colors",
5959
+ "focus trap",
5960
+ ];
5961
+ return (
5962
+ <Marquee aria-label="Documentation topics" {...props}>
5963
+ {topics.map((topic) => (
5964
+ <MarqueeItem key={topic}>
5965
+ <Badge variant="secondary">{topic}</Badge>
5966
+ </MarqueeItem>
5967
+ ))}
5968
+ </Marquee>
5969
+ );
5970
+ }
5971
+
5972
+ function MarqueeTestimonialsDemo() {
5973
+ const testimonials = [
5974
+ {
5975
+ name: "Jordan Reeves",
5976
+ role: "Design Systems Lead",
5977
+ quote:
5978
+ "First system I've adopted without reading a single apology in the docs. The a11y contracts are actually enforced.",
5979
+ },
5980
+ {
5981
+ name: "Seo-yun Park",
5982
+ role: "Senior Design Engineer",
5983
+ quote:
5984
+ "The token pipeline paid for itself in a week. One tokens.json change, both CSS files regenerate, every fork picks it up.",
5985
+ },
5986
+ {
5987
+ name: "Marcus Lindqvist",
5988
+ role: "Staff Engineer",
5989
+ quote:
5990
+ "Storybook coverage wired into pre-commit means nobody ships a variant without a story. That alone ended our drift problem.",
5991
+ },
5992
+ {
5993
+ name: "Anika Patel",
5994
+ role: "Design Engineer",
5995
+ quote:
5996
+ "7:1 contrast out of the box. I stopped auditing every PR for hardcoded hex values because the lint does it for me.",
5997
+ },
5998
+ ];
5999
+ return (
6000
+ <Marquee aria-label="Customer testimonials" fade speed={30}>
6001
+ {testimonials.map((t) => (
6002
+ <MarqueeItem key={t.name}>
6003
+ <Card className="w-80 shadow-none">
6004
+ <CardContent className="space-y-2 p-4">
6005
+ <p className="text-sm leading-relaxed">&ldquo;{t.quote}&rdquo;</p>
6006
+ <p className="text-xs text-muted-foreground">
6007
+ <span className="font-medium text-foreground">{t.name}</span>
6008
+ {" — "}
6009
+ {t.role}
6010
+ </p>
6011
+ </CardContent>
6012
+ </Card>
6013
+ </MarqueeItem>
6014
+ ))}
6015
+ </Marquee>
6016
+ );
6017
+ }
6018
+
6019
+ function AutocompleteBasicDemo() {
6020
+ const [value, setValue] = React.useState("");
6021
+ return (
6022
+ <div className="w-80 space-y-1.5">
6023
+ <Label htmlFor="ac-show-basic">Search docs topics</Label>
6024
+ <Autocomplete
6025
+ id="ac-show-basic"
6026
+ value={value}
6027
+ onValueChange={setValue}
6028
+ options={[
6029
+ "design tokens",
6030
+ "semantic layer",
6031
+ "a11y contract",
6032
+ "CVA variants",
6033
+ "Radix primitive",
6034
+ "anti-pattern",
6035
+ "token drift",
6036
+ "visual regression",
6037
+ "forced colors",
6038
+ "focus trap",
6039
+ ]}
6040
+ placeholder="Try “tok” or “focus”…"
6041
+ />
6042
+ </div>
6043
+ );
6044
+ }
6045
+
6046
+ function AutocompleteSizesDemo() {
6047
+ const [sm, setSm] = React.useState("");
6048
+ const [md, setMd] = React.useState("");
6049
+ const [xl, setXl] = React.useState("");
6050
+ const topics = ["design tokens", "token drift", "focus trap"];
6051
+ return (
6052
+ <div className="grid max-w-3xl gap-4 md:grid-cols-3">
6053
+ <div className="space-y-1.5">
6054
+ <Label htmlFor="ac-show-sm">Size sm</Label>
6055
+ <Autocomplete
6056
+ id="ac-show-sm"
6057
+ size="sm"
6058
+ value={sm}
6059
+ onValueChange={setSm}
6060
+ options={topics}
6061
+ placeholder="Search topics…"
6062
+ />
6063
+ </div>
6064
+ <div className="space-y-1.5">
6065
+ <Label htmlFor="ac-show-default">Size default</Label>
6066
+ <Autocomplete
6067
+ id="ac-show-default"
6068
+ value={md}
6069
+ onValueChange={setMd}
6070
+ options={topics}
6071
+ placeholder="Search topics…"
6072
+ />
6073
+ </div>
6074
+ <div className="space-y-1.5">
6075
+ <Label htmlFor="ac-show-xl">Size xl</Label>
6076
+ <Autocomplete
6077
+ id="ac-show-xl"
6078
+ size="xl"
6079
+ value={xl}
6080
+ onValueChange={setXl}
6081
+ options={topics}
6082
+ placeholder="Search topics…"
6083
+ />
6084
+ </div>
6085
+ </div>
6086
+ );
6087
+ }
6088
+
6089
+ function AutocompleteDisabledDemo() {
6090
+ return (
6091
+ <div className="w-80 space-y-1.5">
6092
+ <Label htmlFor="ac-show-disabled">Search docs topics</Label>
6093
+ <Autocomplete
6094
+ id="ac-show-disabled"
6095
+ disabled
6096
+ value="design tokens"
6097
+ onValueChange={() => {}}
6098
+ options={["design tokens", "token drift"]}
6099
+ />
6100
+ </div>
6101
+ );
6102
+ }
6103
+
6104
+ function AutocompleteLongOptionsDemo() {
6105
+ const [value, setValue] = React.useState("");
6106
+ return (
6107
+ <div className="w-56 space-y-1.5">
6108
+ <Label htmlFor="ac-show-long">Reviewer email</Label>
6109
+ <Autocomplete
6110
+ id="ac-show-long"
6111
+ value={value}
6112
+ onValueChange={setValue}
6113
+ options={[
6114
+ "seoyun.park@figma.com",
6115
+ "chloe@dubois-martin.fr",
6116
+ "tomas.herrera@vercel.com",
6117
+ "marcus@lindqvist.dev",
6118
+ "anika.patel@stripe.com",
6119
+ ]}
6120
+ placeholder="Reviewer email…"
6121
+ />
6122
+ </div>
6123
+ );
6124
+ }
6125
+
6126
+ function AutocompleteRealisticDemo() {
6127
+ const [value, setValue] = React.useState("");
6128
+ const [picked, setPicked] = React.useState<string | null>(null);
6129
+ return (
6130
+ <Card className="w-96">
6131
+ <CardContent className="space-y-4 p-5">
6132
+ <div className="space-y-0.5">
6133
+ <p className="text-sm font-semibold">Button · v2.4.0 release</p>
6134
+ <p className="text-xs text-muted-foreground">
6135
+ Design review · due Jun 26
6136
+ </p>
6137
+ </div>
6138
+ <div className="space-y-1.5">
6139
+ <Label htmlFor="ac-show-realistic">Assign reviewer</Label>
6140
+ <Autocomplete
6141
+ id="ac-show-realistic"
6142
+ size="xl"
6143
+ value={value}
6144
+ onValueChange={(v) => {
6145
+ setValue(v);
6146
+ setPicked(null);
6147
+ }}
6148
+ onOptionSelect={setPicked}
6149
+ options={[
6150
+ "Jordan Reeves",
6151
+ "Seo-yun Park",
6152
+ "Marcus Lindqvist",
6153
+ "Anika Patel",
6154
+ "Tomás Herrera",
6155
+ "Yuki Tanaka",
6156
+ "Chloé Dubois-Martin",
6157
+ "Kofi Asante",
6158
+ ]}
6159
+ placeholder="Start typing a name…"
6160
+ />
6161
+ <p className="text-xs text-muted-foreground">
6162
+ Pick a teammate or type any name — free text is accepted.
6163
+ </p>
6164
+ </div>
6165
+ {value && (
6166
+ <p className="text-sm text-muted-foreground">
6167
+ Review will be assigned to{" "}
6168
+ <span className="font-medium text-foreground">{value}</span>
6169
+ {picked === null ? " (external)" : ""}
6170
+ </p>
6171
+ )}
6172
+ </CardContent>
6173
+ </Card>
6174
+ );
6175
+ }
6176
+
6177
+ function CheckboxGroupSelectAllDemo() {
6178
+ const [value, setValue] = React.useState<string[]>(["button", "card"]);
6179
+ return (
6180
+ <CheckboxGroup
6181
+ aria-label="Components to publish"
6182
+ allValues={["button", "card", "input", "dialog"]}
6183
+ value={value}
6184
+ onValueChange={setValue}
6185
+ className="max-w-xs"
6186
+ >
6187
+ <div className="flex items-center gap-2.5">
6188
+ <CheckboxGroupSelectAll id="cg-show-all" />
6189
+ <Label htmlFor="cg-show-all">Select all</Label>
6190
+ </div>
6191
+ <Separator />
6192
+ {[
6193
+ ["button", "Button"],
6194
+ ["card", "Card"],
6195
+ ["input", "Input"],
6196
+ ["dialog", "Dialog"],
6197
+ ].map(([value, label]) => (
6198
+ <div key={value} className="flex items-center gap-2.5">
6199
+ <CheckboxGroupItem value={value} id={`cg-show-pub-${value}`} />
6200
+ <Label htmlFor={`cg-show-pub-${value}`} className="font-normal">
6201
+ {label}
6202
+ </Label>
6203
+ </div>
6204
+ ))}
6205
+ <p className="text-sm text-muted-foreground">
6206
+ {value.length} of 4 selected
6207
+ </p>
6208
+ </CheckboxGroup>
6209
+ );
6210
+ }
6211
+
6212
+ function CheckboxGroupRealisticDemo() {
6213
+ const [value, setValue] = React.useState<string[]>([
6214
+ "jordan.reeves",
6215
+ "seoyun_park",
6216
+ ]);
6217
+ return (
6218
+ <form className="max-w-sm" onSubmit={(e) => e.preventDefault()}>
6219
+ <Fieldset size="sm">
6220
+ <FieldsetLegend>Review reminders</FieldsetLegend>
6221
+ <FieldsetHelper>
6222
+ Who gets pinged when a token change lands.
6223
+ </FieldsetHelper>
6224
+ <CheckboxGroup
6225
+ aria-label="Reviewers to remind"
6226
+ name="reviewers"
6227
+ allValues={["jordan.reeves", "seoyun_park", "mlindqvist"]}
6228
+ value={value}
6229
+ onValueChange={setValue}
6230
+ >
6231
+ <div className="flex items-center gap-2.5">
6232
+ <CheckboxGroupSelectAll id="cg-show-ru-all" />
6233
+ <Label htmlFor="cg-show-ru-all">All reviewers</Label>
6234
+ </div>
6235
+ <Separator />
6236
+ {[
6237
+ ["jordan.reeves", "Jordan Reeves", false],
6238
+ ["seoyun_park", "Seo-yun Park", false],
6239
+ ["mlindqvist", "Marcus Lindqvist", false],
6240
+ ["anika.p", "Anika Patel (on leave)", true],
6241
+ ].map(([value, label, disabled]) => (
6242
+ <div key={value as string} className="flex items-center gap-2.5">
6243
+ <CheckboxGroupItem
6244
+ value={value as string}
6245
+ id={`cg-show-ru-${value}`}
6246
+ disabled={disabled as boolean}
6247
+ />
6248
+ <Label htmlFor={`cg-show-ru-${value}`} className="font-normal">
6249
+ {label as string}
6250
+ </Label>
6251
+ </div>
6252
+ ))}
6253
+ </CheckboxGroup>
6254
+ <p className="text-sm text-muted-foreground">
6255
+ {value.length} of 4 reviewers will be reminded before the 2026-05-26
6256
+ release.
6257
+ </p>
6258
+ </Fieldset>
6259
+ </form>
6260
+ );
6261
+ }
6262
+
6263
+ function DatePickerShowcase({
6264
+ size,
6265
+ placeholder,
6266
+ defaultValue,
6267
+ clearable,
6268
+ }: {
6269
+ size?: "sm" | "default" | "lg";
6270
+ placeholder?: string;
6271
+ defaultValue?: Date;
6272
+ clearable?: boolean;
6273
+ }) {
6274
+ const [date, setDate] = React.useState<Date | undefined>(defaultValue);
6275
+ return (
6276
+ <DatePicker
6277
+ size={size}
6278
+ value={date}
6279
+ onValueChange={setDate}
6280
+ placeholder={placeholder}
6281
+ clearable={clearable}
6282
+ />
6283
+ );
6284
+ }
6285
+
6286
+ function DatePickerScheduleForm() {
6287
+ const [startDate, setStartDate] = React.useState<Date | undefined>(undefined);
6288
+ const [endDate, setEndDate] = React.useState<Date | undefined>(undefined);
6289
+ return (
6290
+ <Card className="w-80"><CardContent className="p-4 space-y-4">
6291
+ <div className="space-y-1">
6292
+ <p className="text-sm font-semibold">Schedule release window</p>
6293
+ <p className="text-xs text-muted-foreground">
6294
+ Design System Team · Q2 2026
6295
+ </p>
6296
+ </div>
6297
+ <div className="space-y-3">
6298
+ <div className="space-y-1.5">
6299
+ <label className="text-sm font-medium">Start date</label>
6300
+ <DatePicker
6301
+ value={startDate}
6302
+ onValueChange={setStartDate}
6303
+ placeholder="Pick start date"
6304
+ clearable
6305
+ toDate={endDate}
6306
+ />
6307
+ </div>
6308
+ <div className="space-y-1.5">
6309
+ <label className="text-sm font-medium">End date</label>
6310
+ <DatePicker
6311
+ value={endDate}
6312
+ onValueChange={setEndDate}
6313
+ placeholder="Pick end date"
6314
+ clearable
6315
+ fromDate={startDate}
6316
+ />
6317
+ </div>
6318
+ </div>
6319
+ <div className="flex justify-end gap-2">
6320
+ <Button variant="outline" size="sm" className="min-h-11">Cancel</Button>
6321
+ <Button size="sm" className="min-h-11">Schedule</Button>
6322
+ </div>
6323
+ </CardContent></Card>
6324
+ );
6325
+ }
6326
+
6327
+ function RatingGroupShowcase({
6328
+ size,
6329
+ defaultValue = 0,
6330
+ label,
6331
+ }: {
6332
+ size?: "sm" | "default" | "lg";
6333
+ defaultValue?: number;
6334
+ label: string;
6335
+ }) {
6336
+ const [value, setValue] = React.useState(defaultValue);
6337
+ return <RatingGroup size={size} value={value} onValueChange={setValue} label={label} />;
6338
+ }
6339
+
6340
+ function SegmentedControlShowcase() {
6341
+ const [view, setView] = React.useState("grid");
6342
+ const [period, setPeriod] = React.useState("month");
6343
+ const [filter, setFilter] = React.useState("active");
6344
+ return (
6345
+ <div className="flex flex-col gap-6">
6346
+ <div className="flex flex-col gap-4">
6347
+ <p className="text-sm font-medium text-muted-foreground">Size sm</p>
6348
+ <SegmentedControl value={period} onValueChange={setPeriod} size="sm" label="Time period">
6349
+ <SegmentedControlItem value="day">Day</SegmentedControlItem>
6350
+ <SegmentedControlItem value="week">Week</SegmentedControlItem>
6351
+ <SegmentedControlItem value="month">Month</SegmentedControlItem>
6352
+ </SegmentedControl>
6353
+
6354
+ <p className="text-sm font-medium text-muted-foreground">Default — view toggle</p>
6355
+ <SegmentedControl value={view} onValueChange={setView} label="View">
6356
+ <SegmentedControlItem value="list">List</SegmentedControlItem>
6357
+ <SegmentedControlItem value="grid">Grid</SegmentedControlItem>
6358
+ <SegmentedControlItem value="map">Map</SegmentedControlItem>
6359
+ </SegmentedControl>
6360
+
6361
+ <p className="text-sm font-medium text-muted-foreground">With disabled item</p>
6362
+ <SegmentedControl value={filter} onValueChange={setFilter} label="Filter">
6363
+ <SegmentedControlItem value="all">All</SegmentedControlItem>
6364
+ <SegmentedControlItem value="active">Active</SegmentedControlItem>
6365
+ <SegmentedControlItem value="archived">Archived</SegmentedControlItem>
6366
+ <SegmentedControlItem value="deleted" disabled>Deleted</SegmentedControlItem>
6367
+ </SegmentedControl>
6368
+
6369
+ <p className="text-sm font-medium text-muted-foreground">Disabled</p>
6370
+ <SegmentedControl value="week" onValueChange={() => {}} disabled label="Disabled">
6371
+ <SegmentedControlItem value="day">Day</SegmentedControlItem>
6372
+ <SegmentedControlItem value="week">Week</SegmentedControlItem>
6373
+ <SegmentedControlItem value="month">Month</SegmentedControlItem>
6374
+ </SegmentedControl>
6375
+ </div>
6376
+
6377
+ <Card className="w-80"><CardContent className="p-4 space-y-3">
6378
+ <p className="text-sm font-semibold">Component library</p>
6379
+ <SegmentedControl value={filter} onValueChange={setFilter} label="Status filter">
6380
+ <SegmentedControlItem value="active">Active</SegmentedControlItem>
6381
+ <SegmentedControlItem value="archived">Deprecated</SegmentedControlItem>
6382
+ <SegmentedControlItem value="all">All</SegmentedControlItem>
6383
+ </SegmentedControl>
6384
+ <p className="text-xs text-muted-foreground">
6385
+ Showing{" "}
6386
+ <span className="font-medium text-foreground">
6387
+ {filter === "active" ? "active" : filter === "archived" ? "deprecated" : "all"}
6388
+ </span>{" "}
6389
+ components · reviewed by Avery Castillo
6390
+ </p>
6391
+ </CardContent></Card>
6392
+ </div>
6393
+ );
6394
+ }
6395
+
6396
+ function TimelineRealisticDemo() {
6397
+ return (
6398
+ <Card className="w-96">
6399
+ <CardContent className="p-5 space-y-4">
6400
+ <div className="space-y-0.5">
6401
+ <p className="text-sm font-semibold">Button · v2.4.0 release</p>
6402
+ <p className="text-xs text-muted-foreground">Design System Team</p>
3571
6403
  </div>
3572
6404
  <Timeline>
3573
6405
  <TimelineItem
@@ -3604,93 +6436,1527 @@ function TimelineRealisticDemo() {
3604
6436
  description="Published to npm · release notes"
3605
6437
  time="Jun 28, 2026"
3606
6438
  />
3607
- </Timeline>
6439
+ </Timeline>
6440
+ </CardContent>
6441
+ </Card>
6442
+ );
6443
+ }
6444
+
6445
+ function RatingGroupFeedbackDemo() {
6446
+ const [value, setValue] = React.useState(0);
6447
+ const [submitted, setSubmitted] = React.useState(false);
6448
+ const labels = ["", "Needs work", "Below average", "Average", "Good", "Excellent"];
6449
+ return (
6450
+ <Card className="w-72"><CardContent className="p-4 space-y-4">
6451
+ <div className="space-y-1">
6452
+ <p className="text-sm font-semibold">Rate this component</p>
6453
+ <p className="text-xs text-muted-foreground">Design System Team · v2.4.0</p>
6454
+ </div>
6455
+ {submitted ? (
6456
+ <div className="space-y-2">
6457
+ <RatingGroup value={value} readOnly label="Your submitted rating" />
6458
+ <p className="text-sm text-muted-foreground">Thanks for your feedback!</p>
6459
+ </div>
6460
+ ) : (
6461
+ <div className="space-y-3">
6462
+ <div className="space-y-1.5">
6463
+ <RatingGroup value={value} onValueChange={setValue} label="Component rating" />
6464
+ {value > 0 && (
6465
+ <p className="text-xs text-muted-foreground">{labels[value]}</p>
6466
+ )}
6467
+ </div>
6468
+ <Button
6469
+ disabled={value === 0}
6470
+ size="sm"
6471
+ className="w-full min-h-11"
6472
+ onClick={() => setSubmitted(true)}
6473
+ >
6474
+ Submit rating
6475
+ </Button>
6476
+ </div>
6477
+ )}
6478
+ </CardContent></Card>
6479
+ );
6480
+ }
6481
+
6482
+ function TagsInputShowcase({
6483
+ initialTags = [],
6484
+ ...props
6485
+ }: Omit<React.ComponentProps<typeof TagsInput>, "value" | "onValueChange"> & {
6486
+ initialTags?: string[];
6487
+ }) {
6488
+ const [tags, setTags] = React.useState<string[]>(initialTags);
6489
+ return (
6490
+ <div className="w-80">
6491
+ <TagsInput value={tags} onValueChange={setTags} {...props} />
6492
+ </div>
6493
+ );
6494
+ }
6495
+
6496
+ function TagsInputFilterDemo() {
6497
+ const [tags, setTags] = React.useState<string[]>(["Button", "v2.4.0"]);
6498
+ return (
6499
+ <div className="w-96 space-y-3">
6500
+ <Card>
6501
+ <CardContent className="p-4 space-y-3">
6502
+ <div>
6503
+ <p className="text-sm font-semibold">Component library</p>
6504
+ <p className="text-xs text-muted-foreground">Filter components by tag</p>
6505
+ </div>
6506
+ <div className="space-y-1.5">
6507
+ <label className="text-sm font-medium">Active filters</label>
6508
+ <TagsInput
6509
+ value={tags}
6510
+ onValueChange={setTags}
6511
+ placeholder="Add filter tag…"
6512
+ maxTags={6}
6513
+ />
6514
+ <p className="text-xs text-muted-foreground">
6515
+ Press Enter or comma to add · Backspace to remove last
6516
+ </p>
6517
+ </div>
6518
+ </CardContent>
6519
+ </Card>
6520
+ {tags.length > 0 && (
6521
+ <p className="text-sm text-muted-foreground">
6522
+ Filtering by:{" "}
6523
+ <span className="font-medium text-foreground">{tags.join(", ")}</span>
6524
+ </p>
6525
+ )}
6526
+ </div>
6527
+ );
6528
+ }
6529
+
6530
+ function AngleSliderControlledDemo({
6531
+ size = "md",
6532
+ initial,
6533
+ label,
6534
+ }: {
6535
+ size?: "sm" | "md" | "lg";
6536
+ initial: number;
6537
+ label: string;
6538
+ }) {
6539
+ const [angle, setAngle] = React.useState(initial);
6540
+ return (
6541
+ <div className="flex flex-col items-center gap-3">
6542
+ <AngleSlider size={size} value={angle} onChange={setAngle} aria-label={label} />
6543
+ <p className="text-sm font-medium tabular-nums text-foreground">{angle}&deg;</p>
6544
+ </div>
6545
+ );
6546
+ }
6547
+
6548
+ function AngleSliderGradientDemo() {
6549
+ const [angle, setAngle] = React.useState(135);
6550
+ return (
6551
+ <Card className="w-80">
6552
+ <CardHeader>
6553
+ <CardTitle className="text-2xl">Rotation</CardTitle>
6554
+ <CardDescription>tokens-v2-proposal &middot; Jordan Reeves</CardDescription>
6555
+ </CardHeader>
6556
+ <CardContent className="space-y-4">
6557
+ <div className="flex items-center justify-between gap-6">
6558
+ <div className="space-y-1">
6559
+ <Label htmlFor="showcase-gradient-angle">Gradient angle</Label>
6560
+ <p
6561
+ id="showcase-gradient-angle"
6562
+ className="text-sm font-medium tabular-nums text-foreground"
6563
+ aria-live="polite"
6564
+ >
6565
+ {angle}&deg;
6566
+ </p>
6567
+ <p className="text-xs text-muted-foreground">
6568
+ Drives --brand-gradient across hero and share surfaces.
6569
+ </p>
6570
+ </div>
6571
+ <AngleSlider value={angle} onChange={setAngle} aria-label="Gradient angle" />
6572
+ </div>
6573
+ <div
6574
+ aria-hidden="true"
6575
+ className="h-16 rounded-md border border-border"
6576
+ style={{
6577
+ backgroundImage: `linear-gradient(${angle}deg, var(--primary), var(--muted))`,
6578
+ }}
6579
+ />
6580
+ </CardContent>
6581
+ </Card>
6582
+ );
6583
+ }
6584
+
6585
+ function NotificationDismissDemo() {
6586
+ const [visible, setVisible] = React.useState(true);
6587
+ if (!visible) {
6588
+ return (
6589
+ <Button variant="outline" size="xl" onClick={() => setVisible(true)}>
6590
+ Restore notification
6591
+ </Button>
6592
+ );
6593
+ }
6594
+ return (
6595
+ <Notification
6596
+ unread
6597
+ icon={<BellIcon strokeWidth={1.5} />}
6598
+ title="Weekly digest ready"
6599
+ description="12 registry changes and 2 new corrections this week."
6600
+ timestamp="Mon 09:00"
6601
+ onDismiss={() => setVisible(false)}
6602
+ />
6603
+ );
6604
+ }
6605
+
6606
+ type NotificationFeedDemoItem = {
6607
+ id: string;
6608
+ variant?: "default" | "destructive" | "success" | "warning";
6609
+ unread?: boolean;
6610
+ icon: React.ReactNode;
6611
+ title: string;
6612
+ description: string;
6613
+ timestamp: string;
6614
+ };
6615
+
6616
+ const NOTIFICATION_FEED_ITEMS: NotificationFeedDemoItem[] = [
6617
+ {
6618
+ id: "comment",
6619
+ unread: true,
6620
+ icon: (
6621
+ <Avatar className="size-6">
6622
+ <AvatarFallback className="text-xs">JR</AvatarFallback>
6623
+ </Avatar>
6624
+ ),
6625
+ title: "Jordan Reeves commented on Chip",
6626
+ description:
6627
+ "“The selected fill should use the AAA-verified primary pair, not secondary.”",
6628
+ timestamp: "2 min ago",
6629
+ },
6630
+ {
6631
+ id: "ci",
6632
+ variant: "destructive",
6633
+ unread: true,
6634
+ icon: <TriangleAlertIcon strokeWidth={1.5} />,
6635
+ title: "CI gate failed: lint:microanimation",
6636
+ description:
6637
+ "notification.tsx must not use duration-fast — use var(--duration-fast).",
6638
+ timestamp: "14 min ago",
6639
+ },
6640
+ {
6641
+ id: "chromatic",
6642
+ variant: "success",
6643
+ icon: <CheckCircle2Icon strokeWidth={1.5} />,
6644
+ title: "Chromatic baseline updated",
6645
+ description:
6646
+ "4 changes to review across Button, Tabs, and the Foundations stories.",
6647
+ timestamp: "1 hr ago",
6648
+ },
6649
+ {
6650
+ id: "mention",
6651
+ icon: <MessageSquareIcon strokeWidth={1.5} />,
6652
+ title: "Anika Patel replied in #bads",
6653
+ description:
6654
+ "“Morning brief looks good — shipping the orphan-lint sweep today.”",
6655
+ timestamp: "Yesterday",
6656
+ },
6657
+ ];
6658
+
6659
+ function NotificationFeedDemo() {
6660
+ const [items, setItems] = React.useState(NOTIFICATION_FEED_ITEMS);
6661
+ return (
6662
+ <div role="feed" aria-label="Notifications" className="flex flex-col gap-2">
6663
+ {items.map((item) => (
6664
+ <Notification
6665
+ key={item.id}
6666
+ role="article"
6667
+ variant={item.variant}
6668
+ unread={item.unread}
6669
+ icon={item.icon}
6670
+ title={item.title}
6671
+ description={item.description}
6672
+ timestamp={item.timestamp}
6673
+ onDismiss={() =>
6674
+ setItems((prev) => prev.filter((i) => i.id !== item.id))
6675
+ }
6676
+ />
6677
+ ))}
6678
+ {items.length === 0 && (
6679
+ <p className="py-6 text-center text-sm text-muted-foreground">
6680
+ You&rsquo;re all caught up.
6681
+ </p>
6682
+ )}
6683
+ </div>
6684
+ );
6685
+ }
6686
+
6687
+ function CheckboxCardShowcase() {
6688
+ const services = [
6689
+ {
6690
+ value: "wcag-audit",
6691
+ title: "WCAG AAA token audit",
6692
+ description: "7:1 text pairs, 3:1 non-text — fails CI below the floor.",
6693
+ },
6694
+ {
6695
+ value: "visual-regression",
6696
+ title: "Chromatic visual regression",
6697
+ description: "Baseline every story; diff every PR.",
6698
+ },
6699
+ {
6700
+ value: "orphan-lint",
6701
+ title: "Orphan-token sweep",
6702
+ description: "12,417 token references scanned; zeros flagged quarterly.",
6703
+ },
6704
+ {
6705
+ value: "ethics-contract",
6706
+ title: "Ethics contract gate",
6707
+ description: "Data-entry primitives blocked without an ethicsContract.",
6708
+ },
6709
+ ];
6710
+ const [selected, setSelected] = React.useState<string[]>([
6711
+ "wcag-audit",
6712
+ "visual-regression",
6713
+ ]);
6714
+ const toggle = (value: string, next: boolean) =>
6715
+ setSelected((prev) =>
6716
+ next ? [...prev, value] : prev.filter((v) => v !== value)
6717
+ );
6718
+
6719
+ const plans = [
6720
+ {
6721
+ value: "starter",
6722
+ title: "Starter",
6723
+ description: "$0.00 — fork the system, community support, self-serve.",
6724
+ },
6725
+ {
6726
+ value: "pro",
6727
+ title: "Pro",
6728
+ description: "$249.00/mo — every primitive, Chromatic, priority support.",
6729
+ },
6730
+ {
6731
+ value: "enterprise",
6732
+ title: "Enterprise",
6733
+ description:
6734
+ "$12,500.00/engagement — full brand calibration and onboarding.",
6735
+ },
6736
+ ];
6737
+ const [plan, setPlan] = React.useState("pro");
6738
+
6739
+ return (
6740
+ <div className="space-y-8">
6741
+ <div>
6742
+ <p className="mb-3 text-sm font-medium text-muted-foreground">
6743
+ States — the whole card is the hit area; Space toggles the hidden
6744
+ native input
6745
+ </p>
6746
+ <div className="grid gap-3 sm:grid-cols-3">
6747
+ <CheckboxCard>
6748
+ <span className="text-sm font-medium text-foreground">Default</span>
6749
+ <span className="text-sm text-muted-foreground">
6750
+ Click anywhere on the card.
6751
+ </span>
6752
+ </CheckboxCard>
6753
+ <CheckboxCard defaultChecked>
6754
+ <span className="text-sm font-medium text-foreground">Checked</span>
6755
+ <span className="text-sm text-muted-foreground">
6756
+ border-primary + bg-primary/10.
6757
+ </span>
6758
+ </CheckboxCard>
6759
+ <CheckboxCard disabled>
6760
+ <span className="text-sm font-medium text-foreground">
6761
+ Disabled
6762
+ </span>
6763
+ <span className="text-sm text-muted-foreground">
6764
+ Native disabled on the input.
6765
+ </span>
6766
+ </CheckboxCard>
6767
+ </div>
6768
+ </div>
6769
+ <div>
6770
+ <p className="mb-3 text-sm font-medium text-muted-foreground">
6771
+ Multi-select — enforcement passes for a client fork ({selected.length}{" "}
6772
+ of {services.length} enabled)
6773
+ </p>
6774
+ <div
6775
+ role="group"
6776
+ aria-label="Enforcement passes for this fork"
6777
+ className="grid gap-3 sm:grid-cols-2"
6778
+ >
6779
+ {services.map((service) => (
6780
+ <CheckboxCard
6781
+ key={service.value}
6782
+ value={service.value}
6783
+ checked={selected.includes(service.value)}
6784
+ onCheckedChange={(next) => toggle(service.value, next)}
6785
+ >
6786
+ <span className="text-sm font-medium text-foreground">
6787
+ {service.title}
6788
+ </span>
6789
+ <span className="text-sm text-muted-foreground">
6790
+ {service.description}
6791
+ </span>
6792
+ </CheckboxCard>
6793
+ ))}
6794
+ </div>
6795
+ </div>
6796
+ <div>
6797
+ <p className="mb-3 text-sm font-medium text-muted-foreground">
6798
+ Single-select — RadioCards sharing a name form a native radio group
6799
+ (one tab stop, arrows move selection)
6800
+ </p>
6801
+ <fieldset className="border-0 p-0">
6802
+ <legend className="mb-3 text-sm font-medium text-foreground">
6803
+ Engagement tier
6804
+ </legend>
6805
+ <div className="grid gap-3 sm:grid-cols-3">
6806
+ {plans.map((option) => (
6807
+ <RadioCard
6808
+ key={option.value}
6809
+ name="showcase-engagement-tier"
6810
+ value={option.value}
6811
+ checked={plan === option.value}
6812
+ onChange={() => setPlan(option.value)}
6813
+ >
6814
+ <span className="text-sm font-medium text-foreground">
6815
+ {option.title}
6816
+ </span>
6817
+ <span className="text-sm text-muted-foreground">
6818
+ {option.description}
6819
+ </span>
6820
+ </RadioCard>
6821
+ ))}
6822
+ </div>
6823
+ </fieldset>
6824
+ </div>
6825
+ </div>
6826
+ );
6827
+ }
6828
+
6829
+ function LoadingOverlayShowcase() {
6830
+ const [containedLoading, setContainedLoading] = React.useState(true);
6831
+ const [fullscreenLoading, setFullscreenLoading] = React.useState(false);
6832
+ const showFullscreen = () => {
6833
+ setFullscreenLoading(true);
6834
+ setTimeout(() => setFullscreenLoading(false), 2000);
6835
+ };
6836
+ return (
6837
+ <div className="space-y-6">
6838
+ <p className="text-sm text-muted-foreground">
6839
+ Full-coverage loading state. The overlay fades a semi-transparent
6840
+ backdrop with a centered Spinner over its wrapped content while
6841
+ loading, and announces via a polite live region.
6842
+ </p>
6843
+ <div className="flex flex-wrap items-start gap-8">
6844
+ <div className="space-y-3">
6845
+ <p className="text-sm font-medium text-foreground">Contained</p>
6846
+ <LoadingOverlay loading={containedLoading}>
6847
+ <Card className="w-80">
6848
+ <CardHeader>
6849
+ <CardTitle className="text-2xl">Token audit</CardTitle>
6850
+ <CardDescription>
6851
+ design.bads.com &middot; Jordan Reeves&rsquo; workspace
6852
+ </CardDescription>
6853
+ </CardHeader>
6854
+ <CardContent className="space-y-1">
6855
+ <p className="text-sm text-foreground">36 components</p>
6856
+ <p className="text-sm text-muted-foreground">
6857
+ 7:1 contrast floor &middot; 14px minimum
6858
+ </p>
6859
+ </CardContent>
6860
+ </Card>
6861
+ </LoadingOverlay>
6862
+ <Button
6863
+ variant="outline"
6864
+ size="xl"
6865
+ onClick={() => setContainedLoading((l) => !l)}
6866
+ >
6867
+ {containedLoading ? "Finish loading" : "Start loading"}
6868
+ </Button>
6869
+ </div>
6870
+ <div className="space-y-3">
6871
+ <p className="text-sm font-medium text-foreground">With blur</p>
6872
+ <LoadingOverlay loading blur>
6873
+ <Card className="w-80">
6874
+ <CardHeader>
6875
+ <CardTitle className="text-2xl">tokens-v2-proposal</CardTitle>
6876
+ <CardDescription>
6877
+ Shared by Seo-yun Park &middot; seoyun.park@figma.com
6878
+ </CardDescription>
6879
+ </CardHeader>
6880
+ <CardContent>
6881
+ <p className="text-sm text-muted-foreground">
6882
+ 4 changes to review across Button, Tabs, and the
6883
+ Foundations stories.
6884
+ </p>
6885
+ </CardContent>
6886
+ </Card>
6887
+ </LoadingOverlay>
6888
+ </div>
6889
+ <div className="space-y-3">
6890
+ <p className="text-sm font-medium text-foreground">Fullscreen</p>
6891
+ <p className="max-w-xs text-sm text-muted-foreground">
6892
+ Fixed positioning covers the whole viewport — reserved for
6893
+ page-level transitions. Dismisses itself after 2 seconds.
6894
+ </p>
6895
+ <Button variant="outline" size="xl" onClick={showFullscreen}>
6896
+ Show fullscreen overlay
6897
+ </Button>
6898
+ <LoadingOverlay loading={fullscreenLoading} fullscreen blur />
6899
+ </div>
6900
+ </div>
6901
+ </div>
6902
+ );
6903
+ }
6904
+
6905
+ function FloatLabelShowcase() {
6906
+ return (
6907
+ <div className="space-y-8">
6908
+ <p className="text-sm text-muted-foreground">
6909
+ Floating-label field — the label starts inside the field and floats to
6910
+ the top border on focus, fill, or autofill. Click into a field to see
6911
+ the motion.
6912
+ </p>
6913
+
6914
+ <div className="grid max-w-2xl gap-5 sm:grid-cols-2">
6915
+ <FloatLabel label="Email" type="email" autoComplete="email" />
6916
+ <FloatLabel
6917
+ label="Email (filled)"
6918
+ type="email"
6919
+ defaultValue="jordan@reeves.design"
6920
+ />
6921
+ <FloatLabel
6922
+ label="Workspace slug"
6923
+ type="text"
6924
+ defaultValue="bads-core"
6925
+ disabled
6926
+ />
6927
+ <FloatLabel label="Full name" type="text" required />
6928
+ </div>
6929
+
6930
+ <div className="grid max-w-2xl gap-5 sm:grid-cols-3">
6931
+ <FloatLabel label="Small" size="sm" type="text" />
6932
+ <FloatLabel label="Default" type="text" />
6933
+ <FloatLabel label="Large" size="lg" type="text" />
6934
+ </div>
6935
+
6936
+ <div className="grid max-w-sm gap-2">
6937
+ <FloatLabel
6938
+ label="Email"
6939
+ type="email"
6940
+ defaultValue="not-an-email"
6941
+ aria-invalid
6942
+ aria-describedby="float-label-showcase-error"
6943
+ />
6944
+ <p
6945
+ id="float-label-showcase-error"
6946
+ className="text-sm text-destructive"
6947
+ >
6948
+ Enter a valid email address.
6949
+ </p>
6950
+ </div>
6951
+
6952
+ <Card className="w-full max-w-sm">
6953
+ <CardHeader>
6954
+ <CardTitle className="text-2xl">Sign in</CardTitle>
6955
+ <CardDescription>
6956
+ Pick up where you left off in the token workspace.
6957
+ </CardDescription>
6958
+ </CardHeader>
6959
+ <CardContent>
6960
+ <form
6961
+ className="grid gap-5"
6962
+ onSubmit={(e) => e.preventDefault()}
6963
+ aria-label="Sign in"
6964
+ >
6965
+ <div className="grid gap-4">
6966
+ <FloatLabel
6967
+ label="Email"
6968
+ type="email"
6969
+ autoComplete="email"
6970
+ defaultValue="anika.patel@stripe.com"
6971
+ required
6972
+ />
6973
+ <FloatLabel
6974
+ label="Password"
6975
+ type="password"
6976
+ autoComplete="current-password"
6977
+ required
6978
+ />
6979
+ </div>
6980
+ <Button type="submit" size="xl">
6981
+ Sign in
6982
+ </Button>
6983
+ </form>
6984
+ </CardContent>
6985
+ </Card>
6986
+ </div>
6987
+ );
6988
+ }
6989
+
6990
+ function ImageShowcase() {
6991
+ return (
6992
+ <div className="space-y-6">
6993
+ <div>
6994
+ <p className="mb-3 text-sm font-medium text-muted-foreground">
6995
+ Default — lazy loads, skeleton while loading, token-driven fade-in
6996
+ </p>
6997
+ <div className="max-w-md">
6998
+ <Image
6999
+ src="/blog/web-dev-trends.jpg"
7000
+ alt="Abstract cover art for a web development trends article"
7001
+ ratio="16/9"
7002
+ />
7003
+ </div>
7004
+ </div>
7005
+ <div>
7006
+ <p className="mb-3 text-sm font-medium text-muted-foreground">
7007
+ Ratio and radius — square, circle, and contain fit
7008
+ </p>
7009
+ <div className="flex flex-wrap items-start gap-4">
7010
+ <div className="w-32">
7011
+ <Image src="/avatars/01.png" alt="Portrait of Jordan Reeves" ratio="1/1" />
7012
+ </div>
7013
+ <div className="w-32">
7014
+ <Image
7015
+ src="/avatars/02.png"
7016
+ alt="Portrait of Seo-yun Park"
7017
+ ratio="1/1"
7018
+ radius="full"
7019
+ />
7020
+ </div>
7021
+ <div className="w-48">
7022
+ <Image
7023
+ src="/avatars/03.png"
7024
+ alt="Portrait of Marcus Lindqvist, letterboxed in a wide frame"
7025
+ ratio="16/9"
7026
+ fit="contain"
7027
+ />
7028
+ </div>
7029
+ </div>
7030
+ </div>
7031
+ <div>
7032
+ <p className="mb-3 text-sm font-medium text-muted-foreground">
7033
+ Broken src — fallback keeps the accessible name (default glyph, and with text)
7034
+ </p>
7035
+ <div className="flex flex-wrap items-start gap-4">
7036
+ <div className="w-64">
7037
+ <Image
7038
+ src="/blog/this-image-does-not-exist.jpg"
7039
+ alt="Cover art for a retired article"
7040
+ ratio="16/9"
7041
+ />
7042
+ </div>
7043
+ <div className="w-64">
7044
+ <Image
7045
+ src="/blog/this-image-does-not-exist.jpg"
7046
+ alt="Cover art for a retired article"
7047
+ ratio="16/9"
7048
+ fallback="Image unavailable"
7049
+ />
7050
+ </div>
7051
+ </div>
7052
+ </div>
7053
+ <div>
7054
+ <p className="mb-3 text-sm font-medium text-muted-foreground">
7055
+ With caption — semantic figure and figcaption
7056
+ </p>
7057
+ <div className="max-w-md">
7058
+ <Image
7059
+ src="/blog/web-dev-trends.jpg"
7060
+ alt="Abstract geometric shapes in the BADS brand palette"
7061
+ ratio="16/9"
7062
+ caption="Cover art from the design.bads.com blog, July 2026."
7063
+ />
7064
+ </div>
7065
+ </div>
7066
+ </div>
7067
+ );
7068
+ }
7069
+
7070
+ function TourShowcase() {
7071
+ const [open, setOpen] = React.useState(false);
7072
+ const [welcomeOpen, setWelcomeOpen] = React.useState(false);
7073
+ return (
7074
+ <div className="space-y-6">
7075
+ <div>
7076
+ <p className="mb-3 text-sm font-medium text-muted-foreground">
7077
+ Anchored steps — each step highlights a target and positions beside it
7078
+ </p>
7079
+ <div className="flex flex-col items-start gap-4">
7080
+ <Button size="xl" onClick={() => setOpen(true)}>
7081
+ Start the tour
7082
+ </Button>
7083
+ <div className="flex w-full max-w-md flex-wrap items-center gap-3 rounded-lg border border-border p-4">
7084
+ <Button id="tour-demo-search" variant="outline" size="xl" className="px-4">
7085
+ <SearchIcon strokeWidth={1.5} className="size-4" aria-hidden="true" />
7086
+ Search
7087
+ </Button>
7088
+ <Button id="tour-demo-alerts" variant="outline" size="xl" className="px-4">
7089
+ <BellIcon strokeWidth={1.5} className="size-4" aria-hidden="true" />
7090
+ Alerts
7091
+ </Button>
7092
+ <Button id="tour-demo-customize" size="xl" className="px-4">
7093
+ <PaletteIcon strokeWidth={1.5} className="size-4" aria-hidden="true" />
7094
+ Customize
7095
+ </Button>
7096
+ </div>
7097
+ <Tour
7098
+ open={open}
7099
+ onOpenChange={setOpen}
7100
+ steps={[
7101
+ {
7102
+ title: "Search the registry",
7103
+ description: "Find any primitive, token, or pattern by name.",
7104
+ target: "#tour-demo-search",
7105
+ placement: "bottom",
7106
+ },
7107
+ {
7108
+ title: "Watch for token changes",
7109
+ description:
7110
+ "Alerts fire when a token change affects components you own.",
7111
+ target: "#tour-demo-alerts",
7112
+ placement: "bottom",
7113
+ },
7114
+ {
7115
+ title: "Customize your tokens",
7116
+ description:
7117
+ "Brand color overrides live here, with AAA contrast warnings built in.",
7118
+ target: "#tour-demo-customize",
7119
+ placement: "top",
7120
+ },
7121
+ ]}
7122
+ />
7123
+ </div>
7124
+ </div>
7125
+ <div>
7126
+ <p className="mb-3 text-sm font-medium text-muted-foreground">
7127
+ Centered welcome step — <code className="font-mono">target: null</code> renders
7128
+ mid-screen, then later steps anchor
7129
+ </p>
7130
+ <Button variant="outline" size="xl" onClick={() => setWelcomeOpen(true)}>
7131
+ Start with a welcome step
7132
+ </Button>
7133
+ <Tour
7134
+ open={welcomeOpen}
7135
+ onOpenChange={setWelcomeOpen}
7136
+ steps={[
7137
+ {
7138
+ title: "Set up your design system in five minutes",
7139
+ description:
7140
+ "BADS ships with tokens, components, and accessibility baked in. This short tour shows the surfaces you'll use most.",
7141
+ target: null,
7142
+ },
7143
+ {
7144
+ title: "Search the registry",
7145
+ description: "Find any primitive, token, or pattern by name.",
7146
+ target: "#tour-demo-search",
7147
+ },
7148
+ ]}
7149
+ />
7150
+ </div>
7151
+ <p className="text-xs text-muted-foreground">
7152
+ Escape closes. ArrowLeft / ArrowRight step backward and forward. Focus is
7153
+ trapped in the panel; progress announces politely to screen readers.
7154
+ </p>
7155
+ </div>
7156
+ );
7157
+ }
7158
+
7159
+ function MasonryShowcase() {
7160
+ const docNotes = [
7161
+ {
7162
+ topic: "design tokens",
7163
+ body: "tokens.json is the source of truth. Run pnpm build:tokens and both CSS files regenerate.",
7164
+ },
7165
+ {
7166
+ topic: "a11y contract",
7167
+ body: "Every registry entry declares role, keyboard, focus, and target size. 7:1 contrast, 14px minimum, 44×44px target.",
7168
+ },
7169
+ {
7170
+ topic: "token drift",
7171
+ body: "The orphan lint scans every shipped theme token and flags zeros.",
7172
+ },
7173
+ {
7174
+ topic: "visual regression",
7175
+ body: "Chromatic runs on every push to main. First run establishes the baseline; every PR after that gets visual diffs against it, so a stray token change can't reflow a surface unnoticed.",
7176
+ },
7177
+ {
7178
+ topic: "focus trap",
7179
+ body: "Dialog and Sheet trap focus while open and return it to the trigger on close.",
7180
+ },
7181
+ {
7182
+ topic: "semantic layer",
7183
+ body: "Primitives resolve through semantic tokens — bg-card, text-muted-foreground — never raw hex. Rebrand by editing the semantic layer once.",
7184
+ },
7185
+ ];
7186
+ const testimonials = [
7187
+ {
7188
+ name: "Jordan Reeves",
7189
+ role: "Design Systems Lead",
7190
+ quote:
7191
+ "First system I've adopted without reading a single apology in the docs. The a11y contracts are actually enforced.",
7192
+ },
7193
+ {
7194
+ name: "Seo-yun Park",
7195
+ role: "Senior Design Engineer",
7196
+ quote:
7197
+ "The token pipeline paid for itself in a week. One tokens.json change, both CSS files regenerate, every fork picks it up.",
7198
+ },
7199
+ {
7200
+ name: "Marcus Lindqvist",
7201
+ role: "Staff Engineer",
7202
+ quote:
7203
+ "Storybook coverage wired into pre-commit means nobody ships a variant without a story. That alone ended our drift problem.",
7204
+ },
7205
+ {
7206
+ name: "Anika Patel",
7207
+ role: "Design Engineer",
7208
+ quote:
7209
+ "7:1 contrast out of the box. I stopped auditing every PR for hardcoded hex values because the lint does it for me.",
7210
+ },
7211
+ ];
7212
+ const stats = [
7213
+ { label: "Client savings to date", value: "$182,450" },
7214
+ { label: "Build hours avoided", value: "1,432 hrs" },
7215
+ { label: "Story coverage", value: "98.4%" },
7216
+ ];
7217
+ const initials = (name: string) =>
7218
+ name
7219
+ .split(" ")
7220
+ .map((part) => part[0])
7221
+ .join("");
7222
+ const testimonialCard = (t: (typeof testimonials)[number]) => (
7223
+ <Card key={t.name}>
7224
+ <CardContent className="pt-6">
7225
+ <blockquote className="text-sm text-foreground">
7226
+ &ldquo;{t.quote}&rdquo;
7227
+ </blockquote>
7228
+ <div className="mt-4 flex items-center gap-3">
7229
+ <Avatar>
7230
+ <AvatarFallback>{initials(t.name)}</AvatarFallback>
7231
+ </Avatar>
7232
+ <div className="min-w-0">
7233
+ <p className="truncate text-sm font-medium">{t.name}</p>
7234
+ <p className="truncate text-xs text-muted-foreground">{t.role}</p>
7235
+ </div>
7236
+ </div>
3608
7237
  </CardContent>
3609
7238
  </Card>
3610
7239
  );
7240
+ return (
7241
+ <div className="space-y-8">
7242
+ <p className="text-sm text-muted-foreground">
7243
+ Column-flowing layout for variable-height content — pure CSS columns,
7244
+ no JS measurement. Items keep their intrinsic height and flow
7245
+ top-to-bottom down each column in turn; break-inside-avoid and the
7246
+ gap-matched vertical rhythm are applied structurally to every child.
7247
+ Column-major order, so it&rsquo;s for galleries and walls — not for
7248
+ ranked or chronological sequences.
7249
+ </p>
7250
+ <div>
7251
+ <p className="mb-3 text-xs text-muted-foreground">
7252
+ Default — 3 columns, gap &ldquo;4&rdquo;
7253
+ </p>
7254
+ <Masonry>
7255
+ {docNotes.map((note) => (
7256
+ <Card key={note.topic}>
7257
+ <CardHeader>
7258
+ <CardTitle className="text-lg">{note.topic}</CardTitle>
7259
+ </CardHeader>
7260
+ <CardContent>
7261
+ <p className="text-sm text-muted-foreground">{note.body}</p>
7262
+ </CardContent>
7263
+ </Card>
7264
+ ))}
7265
+ </Masonry>
7266
+ </div>
7267
+ <div>
7268
+ <p className="mb-3 text-xs text-muted-foreground">
7269
+ Responsive — columns=&#123;&#123; sm: 1, md: 2, lg: 3 &#125;&#125;
7270
+ (resize the window: single column below sm, two at md, three at lg)
7271
+ </p>
7272
+ <Masonry columns={{ sm: 1, md: 2, lg: 3 }}>
7273
+ {docNotes.slice(0, 4).map((note) => (
7274
+ <Card key={note.topic}>
7275
+ <CardHeader>
7276
+ <CardTitle className="text-lg">{note.topic}</CardTitle>
7277
+ </CardHeader>
7278
+ <CardContent>
7279
+ <p className="text-sm text-muted-foreground">{note.body}</p>
7280
+ </CardContent>
7281
+ </Card>
7282
+ ))}
7283
+ </Masonry>
7284
+ </div>
7285
+ <div>
7286
+ <p className="mb-3 text-xs text-muted-foreground">
7287
+ Realistic use — community wall mixing testimonial cards and stat
7288
+ tiles of uneven height
7289
+ </p>
7290
+ <Masonry columns={{ sm: 1, md: 2, lg: 3 }} gap="4">
7291
+ {testimonials.slice(0, 2).map(testimonialCard)}
7292
+ {stats.map((stat) => (
7293
+ <Card key={stat.label}>
7294
+ <CardHeader>
7295
+ <CardDescription>{stat.label}</CardDescription>
7296
+ <CardTitle className="text-3xl tabular-nums">
7297
+ {stat.value}
7298
+ </CardTitle>
7299
+ </CardHeader>
7300
+ </Card>
7301
+ ))}
7302
+ {testimonials.slice(2).map(testimonialCard)}
7303
+ <Card>
7304
+ <CardHeader>
7305
+ <div className="flex items-center gap-2">
7306
+ <CardTitle className="text-lg">BADS 1.0</CardTitle>
7307
+ <Badge variant="secondary">shipped 2026-05-26</Badge>
7308
+ </div>
7309
+ <CardDescription>
7310
+ 88 registry components, 7:1 contrast floor, 44×44px targets —
7311
+ every fork starts here.
7312
+ </CardDescription>
7313
+ </CardHeader>
7314
+ </Card>
7315
+ </Masonry>
7316
+ </div>
7317
+ </div>
7318
+ );
3611
7319
  }
3612
7320
 
3613
- function RatingGroupFeedbackDemo() {
3614
- const [value, setValue] = React.useState(0);
3615
- const [submitted, setSubmitted] = React.useState(false);
3616
- const labels = ["", "Needs work", "Below average", "Average", "Good", "Excellent"];
7321
+ function ListboxShowcase() {
7322
+ const [singleValue, setSingleValue] = React.useState("active");
7323
+ const [multiValue, setMultiValue] = React.useState<string[]>(["active", "in-review"]);
7324
+
7325
+ const statuses = [
7326
+ { value: "active", label: "Active" },
7327
+ { value: "in-review", label: "In Review" },
7328
+ { value: "on-hold", label: "On Hold" },
7329
+ { value: "archived", label: "Archived" },
7330
+ ];
7331
+
3617
7332
  return (
3618
- <Card className="w-72"><CardContent className="p-4 space-y-4">
3619
- <div className="space-y-1">
3620
- <p className="text-sm font-semibold">Rate this component</p>
3621
- <p className="text-xs text-muted-foreground">Design System Team · v2.4.0</p>
7333
+ <div className="space-y-8">
7334
+ {/* Default single-select */}
7335
+ <div className="space-y-2">
7336
+ <p className="text-sm font-medium text-muted-foreground">
7337
+ Default — single-select, keyboard navigable (Up/Down/Home/End/Space/Enter)
7338
+ </p>
7339
+ <div className="flex flex-wrap items-start gap-8">
7340
+ <div className="w-56 space-y-2">
7341
+ <Listbox
7342
+ value={singleValue}
7343
+ onValueChange={(v) => setSingleValue(v as string)}
7344
+ aria-label="Filter by project status"
7345
+ >
7346
+ <ListboxOption value="active">Active</ListboxOption>
7347
+ <ListboxOption value="in-review">In Review</ListboxOption>
7348
+ <ListboxOption value="on-hold">On Hold</ListboxOption>
7349
+ <ListboxOption value="draft">Draft</ListboxOption>
7350
+ <ListboxOption value="archived">Archived</ListboxOption>
7351
+ </Listbox>
7352
+ <p className="text-sm text-muted-foreground">
7353
+ Selected:{" "}
7354
+ <span className="font-medium text-foreground">{singleValue}</span>
7355
+ </p>
7356
+ </div>
7357
+
7358
+ {/* Disabled */}
7359
+ <div className="w-56 space-y-2">
7360
+ <p className="text-xs font-medium text-muted-foreground">
7361
+ Whole listbox disabled
7362
+ </p>
7363
+ <Listbox
7364
+ value="active"
7365
+ disabled
7366
+ aria-label="Project status (read-only)"
7367
+ >
7368
+ <ListboxOption value="active">Active</ListboxOption>
7369
+ <ListboxOption value="in-review">In Review</ListboxOption>
7370
+ <ListboxOption value="on-hold">On Hold</ListboxOption>
7371
+ <ListboxOption value="archived">Archived</ListboxOption>
7372
+ </Listbox>
7373
+ </div>
7374
+ </div>
3622
7375
  </div>
3623
- {submitted ? (
7376
+
7377
+ {/* Multi-select */}
7378
+ <div className="space-y-2">
7379
+ <p className="text-sm font-medium text-muted-foreground">
7380
+ Multi-select — Shift+Arrow extends selection range; Shift+Click for pointer range
7381
+ </p>
7382
+ <div className="w-56 space-y-2">
7383
+ <ListboxRoot
7384
+ multiple
7385
+ value={multiValue}
7386
+ onValueChange={(v) => setMultiValue(v as string[])}
7387
+ aria-label="Filter by status"
7388
+ >
7389
+ {statuses.map((s) => (
7390
+ <ListboxOption key={s.value} value={s.value}>
7391
+ {s.label}
7392
+ </ListboxOption>
7393
+ ))}
7394
+ </ListboxRoot>
7395
+ <p className="text-sm text-muted-foreground">
7396
+ {multiValue.length > 0
7397
+ ? `${multiValue.length} selected: ${multiValue.join(", ")}`
7398
+ : "None selected"}
7399
+ </p>
7400
+ </div>
7401
+ </div>
7402
+
7403
+ {/* Realistic filter panel */}
7404
+ <div className="space-y-2">
7405
+ <p className="text-sm font-medium text-muted-foreground">
7406
+ Realistic use — filter sidebar panel with label and count summary
7407
+ </p>
7408
+ <Card className="w-64 p-4 shadow-sm">
7409
+ <p className="mb-1.5 text-sm font-semibold">Filter by status</p>
7410
+ <ListboxRoot
7411
+ multiple
7412
+ value={multiValue}
7413
+ onValueChange={(v) => setMultiValue(v as string[])}
7414
+ aria-label="Filter by status"
7415
+ >
7416
+ {statuses.map((s) => (
7417
+ <ListboxOption key={s.value} value={s.value}>
7418
+ {s.label}
7419
+ </ListboxOption>
7420
+ ))}
7421
+ </ListboxRoot>
7422
+ <p className="mt-2 text-xs text-muted-foreground">
7423
+ {multiValue.length === 0
7424
+ ? "All statuses shown"
7425
+ : `Filtered to ${multiValue.length} of ${statuses.length} statuses`}
7426
+ </p>
7427
+ </Card>
7428
+ </div>
7429
+ </div>
7430
+ );
7431
+ }
7432
+
7433
+ function OverlayShowcase() {
7434
+ const [submitting, setSubmitting] = React.useState(false);
7435
+ const [fixedShown, setFixedShown] = React.useState(false);
7436
+
7437
+ React.useEffect(() => {
7438
+ if (!submitting) return;
7439
+ const t = setTimeout(() => setSubmitting(false), 2400);
7440
+ return () => clearTimeout(t);
7441
+ }, [submitting]);
7442
+
7443
+ React.useEffect(() => {
7444
+ if (!fixedShown) return;
7445
+ const t = setTimeout(() => setFixedShown(false), 3000);
7446
+ return () => clearTimeout(t);
7447
+ }, [fixedShown]);
7448
+
7449
+ return (
7450
+ <div className="space-y-8">
7451
+ <p className="text-sm text-muted-foreground">
7452
+ Thin translucent layer covering the nearest <code className="font-mono">position: relative</code>{" "}
7453
+ ancestor (or the viewport with <code className="font-mono">fixed</code>). The backdrop
7454
+ primitive <code className="font-mono">LoadingOverlay</code> builds on. Purely decorative —
7455
+ aria-hidden; the reason a region is frozen belongs in a sibling announcement.
7456
+ </p>
7457
+
7458
+ <div className="grid grid-cols-1 gap-6 sm:grid-cols-3">
7459
+ {/* Default */}
3624
7460
  <div className="space-y-2">
3625
- <RatingGroup value={value} readOnly label="Your submitted rating" />
3626
- <p className="text-sm text-muted-foreground">Thanks for your feedback!</p>
7461
+ <p className="text-xs font-medium text-muted-foreground">Default (bg-background/80)</p>
7462
+ <div className="relative overflow-hidden rounded-lg border border-border">
7463
+ <div className="space-y-2 p-4">
7464
+ <p className="text-sm font-medium text-foreground">tokens-v2-proposal</p>
7465
+ <p className="text-sm text-muted-foreground">
7466
+ Jordan Reeves shared 36 components for review.
7467
+ </p>
7468
+ </div>
7469
+ <Overlay radius="rounded-lg" />
7470
+ </div>
3627
7471
  </div>
3628
- ) : (
3629
- <div className="space-y-3">
3630
- <div className="space-y-1.5">
3631
- <RatingGroup value={value} onValueChange={setValue} label="Component rating" />
3632
- {value > 0 && (
3633
- <p className="text-xs text-muted-foreground">{labels[value]}</p>
7472
+
7473
+ {/* With blur */}
7474
+ <div className="space-y-2">
7475
+ <p className="text-xs font-medium text-muted-foreground">With blur</p>
7476
+ <div className="relative overflow-hidden rounded-lg border border-border">
7477
+ <div className="space-y-2 p-4">
7478
+ <p className="text-sm font-medium text-foreground">tokens-v2-proposal</p>
7479
+ <p className="text-sm text-muted-foreground">
7480
+ Jordan Reeves shared 36 components for review.
7481
+ </p>
7482
+ </div>
7483
+ <Overlay blur radius="rounded-lg" />
7484
+ </div>
7485
+ </div>
7486
+
7487
+ {/* Custom color */}
7488
+ <div className="space-y-2">
7489
+ <p className="text-xs font-medium text-muted-foreground">Custom color (bg-primary/10)</p>
7490
+ <div className="relative overflow-hidden rounded-lg border border-border">
7491
+ <div className="space-y-2 p-4">
7492
+ <p className="text-sm font-medium text-foreground">tokens-v2-proposal</p>
7493
+ <p className="text-sm text-muted-foreground">
7494
+ Jordan Reeves shared 36 components for review.
7495
+ </p>
7496
+ </div>
7497
+ <Overlay color="bg-primary/10" radius="rounded-lg" />
7498
+ </div>
7499
+ </div>
7500
+ </div>
7501
+
7502
+ {/* Realistic use: form freeze */}
7503
+ <div className="space-y-3">
7504
+ <p className="text-xs font-medium text-muted-foreground">
7505
+ Realistic use — form freeze on submit (Overlay + disabled inputs + role=&quot;status&quot;)
7506
+ </p>
7507
+ <div className="relative overflow-hidden rounded-lg border border-border p-4">
7508
+ <form
7509
+ className="flex flex-col gap-4"
7510
+ onSubmit={(e) => {
7511
+ e.preventDefault();
7512
+ setSubmitting(true);
7513
+ }}
7514
+ >
7515
+ <div className="flex flex-col gap-2">
7516
+ <label className="text-sm font-medium" htmlFor="overlay-showcase-name">
7517
+ Full name
7518
+ </label>
7519
+ <input
7520
+ id="overlay-showcase-name"
7521
+ className="flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"
7522
+ defaultValue="Jordan Reeves"
7523
+ autoComplete="name"
7524
+ disabled={submitting}
7525
+ />
7526
+ </div>
7527
+ <Button size="xl" type="submit" disabled={submitting}>
7528
+ {submitting ? "Saving…" : "Save contact"}
7529
+ </Button>
7530
+ </form>
7531
+ {submitting && <Overlay radius="rounded-lg" />}
7532
+ </div>
7533
+ <p role="status" aria-live="polite" className="text-sm text-muted-foreground">
7534
+ {submitting ? "Saving your contact…" : " "}
7535
+ </p>
7536
+ </div>
7537
+
7538
+ {/* Fixed viewport */}
7539
+ <div className="space-y-3">
7540
+ <p className="text-xs font-medium text-muted-foreground">
7541
+ Fixed viewport overlay (3 s auto-dismiss)
7542
+ </p>
7543
+ <Button
7544
+ size="xl"
7545
+ variant="outline"
7546
+ onClick={() => setFixedShown(true)}
7547
+ disabled={fixedShown}
7548
+ >
7549
+ {fixedShown ? "Covering the viewport…" : "Show fixed overlay"}
7550
+ </Button>
7551
+ {fixedShown && <Overlay fixed blur zIndex={40} />}
7552
+ </div>
7553
+ </div>
7554
+ );
7555
+ }
7556
+
7557
+ const geographyOptions: CascaderOption[] = [
7558
+ {
7559
+ value: "na",
7560
+ label: "North America",
7561
+ children: [
7562
+ {
7563
+ value: "us",
7564
+ label: "United States",
7565
+ children: [
7566
+ { value: "ca", label: "California" },
7567
+ { value: "ny", label: "New York" },
7568
+ { value: "tx", label: "Texas" },
7569
+ ],
7570
+ },
7571
+ {
7572
+ value: "ca-country",
7573
+ label: "Canada",
7574
+ children: [
7575
+ { value: "on", label: "Ontario" },
7576
+ { value: "bc", label: "British Columbia" },
7577
+ ],
7578
+ },
7579
+ ],
7580
+ },
7581
+ {
7582
+ value: "eu",
7583
+ label: "Europe",
7584
+ children: [
7585
+ {
7586
+ value: "gb",
7587
+ label: "United Kingdom",
7588
+ children: [
7589
+ { value: "eng", label: "England" },
7590
+ { value: "sco", label: "Scotland" },
7591
+ ],
7592
+ },
7593
+ {
7594
+ value: "de",
7595
+ label: "Germany",
7596
+ children: [
7597
+ { value: "by", label: "Bavaria" },
7598
+ { value: "be", label: "Berlin" },
7599
+ ],
7600
+ },
7601
+ ],
7602
+ },
7603
+ {
7604
+ value: "apac",
7605
+ label: "Asia Pacific",
7606
+ children: [
7607
+ {
7608
+ value: "jp",
7609
+ label: "Japan",
7610
+ children: [
7611
+ { value: "to", label: "Tokyo" },
7612
+ { value: "os", label: "Osaka" },
7613
+ ],
7614
+ },
7615
+ ],
7616
+ },
7617
+ ];
7618
+
7619
+ const cascaderCategoryOptions: CascaderOption[] = [
7620
+ {
7621
+ value: "electronics",
7622
+ label: "Electronics",
7623
+ children: [
7624
+ {
7625
+ value: "phones",
7626
+ label: "Phones",
7627
+ children: [
7628
+ { value: "smartphones", label: "Smartphones" },
7629
+ { value: "feature-phones", label: "Feature Phones" },
7630
+ ],
7631
+ },
7632
+ {
7633
+ value: "laptops",
7634
+ label: "Laptops",
7635
+ children: [
7636
+ { value: "gaming", label: "Gaming" },
7637
+ { value: "ultrabooks", label: "Ultrabooks" },
7638
+ ],
7639
+ },
7640
+ ],
7641
+ },
7642
+ {
7643
+ value: "clothing",
7644
+ label: "Clothing",
7645
+ children: [
7646
+ {
7647
+ value: "mens",
7648
+ label: "Men's",
7649
+ children: [
7650
+ { value: "mens-shirts", label: "Shirts" },
7651
+ { value: "mens-pants", label: "Pants" },
7652
+ ],
7653
+ },
7654
+ {
7655
+ value: "womens",
7656
+ label: "Women's",
7657
+ children: [
7658
+ { value: "womens-dresses", label: "Dresses" },
7659
+ { value: "womens-tops", label: "Tops" },
7660
+ ],
7661
+ },
7662
+ ],
7663
+ },
7664
+ ];
7665
+
7666
+ function CascaderShowcase() {
7667
+ const [region, setRegion] = React.useState<string[]>([]);
7668
+ const [category, setCategory] = React.useState<string[]>([]);
7669
+
7670
+ return (
7671
+ <div className="flex flex-col gap-8">
7672
+ {/* Default — 3-level geography */}
7673
+ <div className="space-y-3">
7674
+ <p className="text-xs font-medium text-muted-foreground">
7675
+ 3-level geography select
7676
+ </p>
7677
+ <div className="w-72">
7678
+ <Cascader
7679
+ options={geographyOptions}
7680
+ placeholder="Select region…"
7681
+ value={region}
7682
+ onValueChange={(v) => setRegion(v)}
7683
+ />
7684
+ {region.length > 0 && (
7685
+ <p className="mt-2 text-sm text-muted-foreground">
7686
+ {region.join(" / ")}
7687
+ </p>
7688
+ )}
7689
+ </div>
7690
+ </div>
7691
+
7692
+ {/* Pre-selected */}
7693
+ <div className="space-y-3">
7694
+ <p className="text-xs font-medium text-muted-foreground">
7695
+ Pre-selected value
7696
+ </p>
7697
+ <div className="w-72">
7698
+ <Cascader
7699
+ options={geographyOptions}
7700
+ value={["na", "us", "ca"]}
7701
+ onValueChange={() => {}}
7702
+ />
7703
+ </div>
7704
+ </div>
7705
+
7706
+ {/* Disabled */}
7707
+ <div className="space-y-3">
7708
+ <p className="text-xs font-medium text-muted-foreground">Disabled</p>
7709
+ <div className="w-72">
7710
+ <Cascader
7711
+ options={geographyOptions}
7712
+ value={["eu", "gb", "eng"]}
7713
+ onValueChange={() => {}}
7714
+ disabled
7715
+ />
7716
+ </div>
7717
+ </div>
7718
+
7719
+ {/* Realistic: listing form */}
7720
+ <div className="space-y-3">
7721
+ <p className="text-xs font-medium text-muted-foreground">
7722
+ In a form — product listing
7723
+ </p>
7724
+ <Card className="w-[420px] p-6 shadow-sm">
7725
+ <h3 className="mb-4 text-base font-semibold">New Listing</h3>
7726
+ <div className="space-y-4">
7727
+ <div className="space-y-1.5">
7728
+ <label id="csc-region-label" className="text-sm font-medium">
7729
+ Target Region
7730
+ </label>
7731
+ <Cascader
7732
+ options={geographyOptions}
7733
+ value={region}
7734
+ onValueChange={(v) => setRegion(v)}
7735
+ placeholder="Select region…"
7736
+ aria-labelledby="csc-region-label"
7737
+ />
7738
+ </div>
7739
+ <div className="space-y-1.5">
7740
+ <label id="csc-cat-label" className="text-sm font-medium">
7741
+ Product Category
7742
+ </label>
7743
+ <Cascader
7744
+ options={cascaderCategoryOptions}
7745
+ value={category}
7746
+ onValueChange={(v) => setCategory(v)}
7747
+ placeholder="Browse categories…"
7748
+ aria-labelledby="csc-cat-label"
7749
+ />
7750
+ </div>
7751
+ {(region.length > 0 || category.length > 0) && (
7752
+ <div className="rounded-md bg-muted px-3 py-2 text-sm text-muted-foreground">
7753
+ {region.length > 0 && <p>Region: {region.join(" / ")}</p>}
7754
+ {category.length > 0 && <p>Category: {category.join(" / ")}</p>}
7755
+ </div>
3634
7756
  )}
3635
7757
  </div>
7758
+ </Card>
7759
+ </div>
7760
+ </div>
7761
+ );
7762
+ }
7763
+
7764
+ function AffixShowcase() {
7765
+ const scrollRef = React.useRef<HTMLDivElement>(null);
7766
+ const entries = [
7767
+ {
7768
+ author: "Jordan Reeves",
7769
+ date: "2026-05-26",
7770
+ body: "Shared 36 components for review at design.bads.com/share/tokens-v2-proposal.",
7771
+ },
7772
+ {
7773
+ author: "Seo-yun Park",
7774
+ date: "2026-01-15",
7775
+ body: "Raised the contrast floor to 7:1 across every shipped token pair.",
7776
+ },
7777
+ {
7778
+ author: "Marcus Lindqvist",
7779
+ date: "2025-11-20",
7780
+ body: "Moved the touch-target audit to the 44×44px floor across all CTAs.",
7781
+ },
7782
+ {
7783
+ author: "Anika Patel",
7784
+ date: "2027-03-01",
7785
+ body: "Scheduled the semantic-layer migration — token drift lint goes strict.",
7786
+ },
7787
+ {
7788
+ author: "Tomás Herrera",
7789
+ date: "2026-05-26",
7790
+ body: "Tuned every hover and state-change to the 180ms transition baseline.",
7791
+ },
7792
+ ];
7793
+ return (
7794
+ <div className="space-y-6">
7795
+ <p className="text-sm text-muted-foreground">
7796
+ Pins arbitrary content to a fixed viewport position — scroll-to-top
7797
+ buttons, chat FABs, floating action chrome. Renders through a{" "}
7798
+ <code className="font-mono">document.body</code> portal by default so
7799
+ ancestor overflow or transforms can&apos;t clip it; the wrapper is
7800
+ presentational, and the children own their accessible name and 44×44px
7801
+ target. This demo uses{" "}
7802
+ <code className="font-mono">withinPortal={"{false}"}</code> inside a
7803
+ transformed frame, so the &quot;fixed&quot; button pins to the frame
7804
+ instead of your browser viewport.
7805
+ </p>
7806
+ {/* lint-disable: card-bypass — needs CSS transform to confine Affix positioning to this frame */}
7807
+ <div className="relative h-72 w-full max-w-md overflow-hidden rounded-lg border bg-card [transform:translateZ(0)]">
7808
+ <div ref={scrollRef} className="h-full overflow-y-auto p-4">
7809
+ <h3 className="text-base font-semibold">Design system changelog</h3>
7810
+ <ul className="mt-3 space-y-4">
7811
+ {[...entries, ...entries].map((item, i) => (
7812
+ <li key={i} className="space-y-1">
7813
+ <p className="text-sm font-medium">
7814
+ {item.author}{" "}
7815
+ <span className="font-normal text-muted-foreground">
7816
+ · {item.date}
7817
+ </span>
7818
+ </p>
7819
+ <p className="text-sm text-muted-foreground">{item.body}</p>
7820
+ </li>
7821
+ ))}
7822
+ </ul>
7823
+ </div>
7824
+ <Affix withinPortal={false} position={{ bottom: 16, right: 16 }}>
3636
7825
  <Button
3637
- disabled={value === 0}
3638
- size="sm"
3639
- className="w-full min-h-11"
3640
- onClick={() => setSubmitted(true)}
7826
+ size="icon-xl"
7827
+ variant="secondary"
7828
+ aria-label="Scroll to top"
7829
+ onClick={() =>
7830
+ scrollRef.current?.scrollTo({ top: 0, behavior: "smooth" })
7831
+ }
3641
7832
  >
3642
- Submit rating
7833
+ <ArrowUpIcon strokeWidth={1.5} aria-hidden="true" />
3643
7834
  </Button>
3644
- </div>
3645
- )}
3646
- </CardContent></Card>
7835
+ </Affix>
7836
+ </div>
7837
+ </div>
3647
7838
  );
3648
7839
  }
3649
7840
 
3650
- function TagsInputShowcase({
3651
- initialTags = [],
3652
- ...props
3653
- }: Omit<React.ComponentProps<typeof TagsInput>, "value" | "onValueChange"> & {
3654
- initialTags?: string[];
3655
- }) {
3656
- const [tags, setTags] = React.useState<string[]>(initialTags);
7841
+ function SkipLinkShowcase() {
3657
7842
  return (
3658
- <div className="w-80">
3659
- <TagsInput value={tags} onValueChange={setTags} {...props} />
7843
+ <div className="space-y-6">
7844
+ <p className="text-sm text-muted-foreground">
7845
+ WCAG 2.4.1 (Bypass Blocks). <code className="font-mono">SkipLink</code>{" "}
7846
+ is <code className="font-mono">sr-only</code> until keyboard focus
7847
+ reveals it as a fixed top-left pill; activating it moves scroll and
7848
+ sequential focus to the paired{" "}
7849
+ <code className="font-mono">SkipTarget</code> (
7850
+ <code className="font-mono">tabIndex=-1</code>, never a Tab stop). In a
7851
+ real app it renders as the first child of{" "}
7852
+ <code className="font-mono">&lt;body&gt;</code>. Try it: click just
7853
+ before the demo shell below, press Tab until the pill appears at the
7854
+ top-left of the viewport, then press Enter — the next Tab lands inside
7855
+ the main region, past the nav.
7856
+ </p>
7857
+ <div className="overflow-hidden rounded-lg border">
7858
+ <SkipLink href="#skiplink-showcase-main" />
7859
+ <header className="flex items-center justify-between border-b bg-muted px-4 py-3">
7860
+ <span className="text-sm font-semibold">design.bads.com</span>
7861
+ <nav aria-label="Demo primary" className="flex items-center gap-2">
7862
+ <Button variant="ghost" size="sm">
7863
+ Docs
7864
+ </Button>
7865
+ <Button variant="ghost" size="sm">
7866
+ Components
7867
+ </Button>
7868
+ <Button variant="ghost" size="sm">
7869
+ jordan.reeves
7870
+ </Button>
7871
+ </nav>
7872
+ </header>
7873
+ <div className="p-4">
7874
+ <SkipTarget id="skiplink-showcase-main" />
7875
+ <main>
7876
+ <h3 className="text-base font-semibold">Tokens v2 proposal</h3>
7877
+ <p className="mt-1 text-sm text-muted-foreground">
7878
+ Jordan Reeves shared 36 components for review at
7879
+ design.bads.com/share/tokens-v2-proposal. Every pair holds the
7880
+ 7:1 contrast floor.
7881
+ </p>
7882
+ <Button className="mt-3" size="xl">
7883
+ Open review
7884
+ </Button>
7885
+ </main>
7886
+ </div>
7887
+ </div>
3660
7888
  </div>
3661
7889
  );
3662
7890
  }
3663
7891
 
3664
- function TagsInputFilterDemo() {
3665
- const [tags, setTags] = React.useState<string[]>(["Button", "v2.4.0"]);
7892
+ function TimerShowcase() {
7893
+ const [paused, setPaused] = React.useState(true);
7894
+ const [sessionOver, setSessionOver] = React.useState(false);
3666
7895
  return (
3667
- <div className="w-96 space-y-3">
3668
- <Card>
3669
- <CardContent className="p-4 space-y-3">
3670
- <div>
3671
- <p className="text-sm font-semibold">Component library</p>
3672
- <p className="text-xs text-muted-foreground">Filter components by tag</p>
3673
- </div>
3674
- <div className="space-y-1.5">
3675
- <label className="text-sm font-medium">Active filters</label>
3676
- <TagsInput
3677
- value={tags}
3678
- onValueChange={setTags}
3679
- placeholder="Add filter tag…"
3680
- maxTags={6}
7896
+ <div className="space-y-6">
7897
+ <p className="text-sm text-muted-foreground">
7898
+ Live countdown or count-up that ticks on a configurable interval —
7899
+ drift-free (wall-clock anchored), <code className="font-mono">tabular-nums</code>{" "}
7900
+ digits, <code className="font-mono">aria-live=&quot;off&quot;</code> on
7901
+ the ticking value with a single polite announcement at completion.
7902
+ Ethics contract: bind only to REAL deadlines — invented urgency is a
7903
+ dark pattern.
7904
+ </p>
7905
+ <div className="flex flex-wrap items-start gap-6">
7906
+ <div className="space-y-1">
7907
+ <p className="text-sm font-medium">Countdown (default MM:SS)</p>
7908
+ <Timer mode="countdown" startMs={5 * 60 * 1000} className="text-2xl" />
7909
+ </div>
7910
+ <div className="space-y-1">
7911
+ <p className="text-sm font-medium">Count-up (HH:MM:SS)</p>
7912
+ <Timer mode="countup" format="HH:MM:SS" className="text-2xl" />
7913
+ </div>
7914
+ <div className="space-y-1">
7915
+ <p className="text-sm font-medium">Paused control</p>
7916
+ <div className="flex items-center gap-3">
7917
+ <Timer
7918
+ mode="countdown"
7919
+ startMs={90 * 1000}
7920
+ paused={paused}
7921
+ className="text-2xl"
3681
7922
  />
3682
- <p className="text-xs text-muted-foreground">
3683
- Press Enter or comma to add · Backspace to remove last
3684
- </p>
7923
+ <Button
7924
+ variant="outline"
7925
+ size="xl"
7926
+ aria-pressed={!paused}
7927
+ onClick={() => setPaused((p) => !p)}
7928
+ >
7929
+ {paused ? "Start" : "Pause"}
7930
+ </Button>
3685
7931
  </div>
3686
- </CardContent>
3687
- </Card>
3688
- {tags.length > 0 && (
3689
- <p className="text-sm text-muted-foreground">
3690
- Filtering by:{" "}
3691
- <span className="font-medium text-foreground">{tags.join(", ")}</span>
7932
+ </div>
7933
+ </div>
7934
+ {/* lint-disable: card-bypass — Timer showcase uses p-5 custom padding, not Card's default layout */}
7935
+ <div className="w-full max-w-md rounded-lg border bg-card p-5">
7936
+ <div className="flex items-center justify-between gap-3">
7937
+ <h3 className="min-w-0 truncate text-base font-semibold">
7938
+ Tokens v2 proposal — live review
7939
+ </h3>
7940
+ <Badge variant={sessionOver ? "destructive" : "secondary"}>
7941
+ {sessionOver ? "Session ended" : "In session"}
7942
+ </Badge>
7943
+ </div>
7944
+ <p className="mt-1 text-sm text-muted-foreground">
7945
+ Jordan Reeves is walking 36 components through the 7:1 contrast
7946
+ floor at design.bads.com/share/tokens-v2-proposal.
3692
7947
  </p>
3693
- )}
7948
+ <div className="mt-3 flex items-baseline gap-2">
7949
+ <span className="text-sm font-medium">Time remaining</span>
7950
+ <Timer
7951
+ mode="countdown"
7952
+ startMs={25 * 60 * 1000}
7953
+ format="MM:SS"
7954
+ className="text-2xl"
7955
+ completeAnnouncement="Review session ended"
7956
+ onComplete={() => setSessionOver(true)}
7957
+ />
7958
+ </div>
7959
+ </div>
3694
7960
  </div>
3695
7961
  );
3696
7962
  }