@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@behavioral-agentic-design-system/core",
3
- "version": "0.24.0",
3
+ "version": "0.26.0",
4
4
  "description": "BADS core — tokens, shadcn/ui components, and the BADS template shell (app routes, customize tab, theme hooks). Forks consume this and re-export, keeping client repos to ~30 lines of glue.",
5
5
  "license": "MIT",
6
6
  "author": "Matthew Stephens <work@matthewstephens.com> (https://github.com/matthewlarn)",
@@ -145,7 +145,7 @@
145
145
  "lucide-react": "*",
146
146
  "next-themes": "*",
147
147
  "react": ">=18",
148
- "react-day-picker": "^9.14.0",
148
+ "react-day-picker": "^10.0.1",
149
149
  "react-dom": ">=18",
150
150
  "react-resizable-panels": "*",
151
151
  "recharts": "*",
@@ -248,5 +248,8 @@
248
248
  "sonner": {
249
249
  "optional": true
250
250
  }
251
+ },
252
+ "devDependencies": {
253
+ "@types/react-dom": "^19.2.3"
251
254
  }
252
255
  }
@@ -428,6 +428,11 @@ const baseLayer = `@layer base {
428
428
  size / weight axes without touching component source. "normal" is a
429
429
  no-op for static fonts. */
430
430
  font-variation-settings: var(--font-variation-settings, normal);
431
+ /* Enable opsz axis on variable fonts (Inter ships opsz 14–32). Without
432
+ this, browser behavior is implementation-defined and silently inconsistent
433
+ across engines; forks that swap in a different variable font may not
434
+ inherit the setting. */
435
+ font-optical-sizing: auto;
431
436
  }
432
437
  /* Match: monospace elements pick up --font-mono without each component
433
438
  having to remember a \`font-mono\` class. */
@@ -490,11 +495,31 @@ const baseLayer = `@layer base {
490
495
  /* WCAG AAA 2.3.3 Animation from Interactions: respect the user's
491
496
  reduced-motion preference globally. Components with essential
492
497
  motion (loading spinners, progress bars) opt back in via
493
- \`motion-safe:\` Tailwind utilities or scoped @media queries. */
498
+ \`motion-safe:\` Tailwind utilities or scoped @media queries.
499
+
500
+ Three-state model, driven by the optional \`data-motion\` attribute the
501
+ MotionToggle primitive sets on <html> (opt-in — no attribute is the
502
+ default and behaves exactly as an OS-only reduce query):
503
+ • \`data-motion="reduce"\` → force motion OFF regardless of OS.
504
+ • \`data-motion="full"\` → force motion ON even if the OS prefers
505
+ reduce (some users set OS reduce globally
506
+ but trust a given site with motion).
507
+ • absent (\`system\`) → the OS media query governs, as before.
508
+ The OS query below is gated on \`:not([data-motion="full"])\` so "full"
509
+ can override it; the attribute rule above wins on specificity for
510
+ "reduce". */
511
+ html[data-motion="reduce"] *,
512
+ html[data-motion="reduce"] *::before,
513
+ html[data-motion="reduce"] *::after {
514
+ animation-duration: 0.01ms !important;
515
+ animation-iteration-count: 1 !important;
516
+ transition-duration: 0.01ms !important;
517
+ scroll-behavior: auto !important;
518
+ }
494
519
  @media (prefers-reduced-motion: reduce) {
495
- *,
496
- *::before,
497
- *::after {
520
+ html:not([data-motion="full"]) *,
521
+ html:not([data-motion="full"]) *::before,
522
+ html:not([data-motion="full"]) *::after {
498
523
  animation-duration: 0.01ms !important;
499
524
  animation-iteration-count: 1 !important;
500
525
  transition-duration: 0.01ms !important;
@@ -660,12 +685,61 @@ html, body {
660
685
  animation: accordion-up var(--duration-base) var(--ease-out);
661
686
  }
662
687
 
688
+ /* Marquee continuous-scroll keyframe — applied via data-slot selectors
689
+ (spec §4 pattern (b): plain CSS in the design-system layer, no Tailwind
690
+ utility generation in the path). The track holds 2×K identical groups,
691
+ so translateX(-50%) is always exactly one loop — seamless at any width.
692
+
693
+ - "linear" timing is a seamless-loop REQUIREMENT, not a style choice:
694
+ any easing curve pulses at the loop seam.
695
+ - --marquee-duration is the consumer tunable (the component computes it
696
+ from the \`speed\` prop in px/s and writes it inline; a consumer style
697
+ override wins). --marquee-gap tunes item density.
698
+ - Pausing (SC 2.2.2 Pause, Stop, Hide): hover, focus-within, and the
699
+ component's visible control (data-state="paused") all pause playback.
700
+ - Reduced motion: the base layer already forces animation-duration to
701
+ 0.01ms with iteration-count 1, which halts the strip; the explicit
702
+ play-state rule below is belt-and-suspenders and self-documenting. */
703
+ @keyframes marquee-scroll {
704
+ from { transform: translateX(0); }
705
+ to { transform: translateX(-50%); }
706
+ }
707
+ [data-slot="marquee-track"] {
708
+ animation: marquee-scroll var(--marquee-duration, 30s) linear infinite;
709
+ }
710
+ [data-slot="marquee-track"][data-direction="right"] {
711
+ animation-direction: reverse;
712
+ }
713
+ [data-slot="marquee-group"] {
714
+ display: flex;
715
+ align-items: center;
716
+ gap: var(--marquee-gap, 3rem);
717
+ padding-inline-end: var(--marquee-gap, 3rem);
718
+ }
719
+ [data-slot="marquee"][data-state="paused"] [data-slot="marquee-track"],
720
+ [data-slot="marquee"]:hover [data-slot="marquee-track"],
721
+ [data-slot="marquee"]:focus-within [data-slot="marquee-track"] {
722
+ animation-play-state: paused;
723
+ }
724
+ [data-slot="marquee-viewport"][data-fade] {
725
+ -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
726
+ mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
727
+ }
728
+ @media (prefers-reduced-motion: reduce) {
729
+ [data-slot="marquee-track"] { animation-play-state: paused; }
730
+ }
731
+
663
732
  ::view-transition-new(root) {
664
733
  animation: theme-reveal 0.4s ease-in-out forwards;
665
734
  }
666
735
 
736
+ /* Honor the app-level MotionToggle for the iris wipe too (same three-state
737
+ model as the global kill-all). "reduce" snaps the theme swap instantly;
738
+ "full" keeps the wipe even under an OS reduce preference; absent = OS
739
+ query governs. \`animation: none\` on the pseudo just does an instant swap. */
740
+ html[data-motion="reduce"]::view-transition-new(root) { animation: none; }
667
741
  @media (prefers-reduced-motion: reduce) {
668
- ::view-transition-new(root) { animation: none; }
742
+ html:not([data-motion="full"])::view-transition-new(root) { animation: none; }
669
743
  }`;
670
744
 
671
745
  // ---- Border-color utilities (workaround for a TURBOPACK bug) --------------