@behavioral-agentic-design-system/core 0.23.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 (139) hide show
  1. package/package.json +8 -4
  2. package/scripts/build-tokens.cjs +79 -5
  3. package/src/app/preview/components/page.tsx +4760 -213
  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/data-list.tsx +169 -0
  31. package/src/components/ui/date-picker.tsx +6 -3
  32. package/src/components/ui/date-range-picker.tsx +6 -3
  33. package/src/components/ui/fieldset.tsx +8 -2
  34. package/src/components/ui/float-label.tsx +114 -0
  35. package/src/components/ui/floating-panel.tsx +129 -0
  36. package/src/components/ui/format-number.tsx +122 -0
  37. package/src/components/ui/highlight.tsx +85 -0
  38. package/src/components/ui/image.tsx +195 -0
  39. package/src/components/ui/index.ts +52 -0
  40. package/src/components/ui/indicator.tsx +2 -2
  41. package/src/components/ui/input-group.tsx +11 -1
  42. package/src/components/ui/input.tsx +48 -4
  43. package/src/components/ui/kbd.tsx +1 -1
  44. package/src/components/ui/link.tsx +158 -0
  45. package/src/components/ui/listbox.tsx +426 -0
  46. package/src/components/ui/loading-overlay.tsx +80 -0
  47. package/src/components/ui/marquee.tsx +193 -0
  48. package/src/components/ui/masonry.tsx +164 -0
  49. package/src/components/ui/meter.tsx +186 -0
  50. package/src/components/ui/motion-toggle.tsx +170 -0
  51. package/src/components/ui/notification.tsx +175 -0
  52. package/src/components/ui/overlay.tsx +63 -0
  53. package/src/components/ui/progress.tsx +95 -4
  54. package/src/components/ui/qr-code.tsx +107 -0
  55. package/src/components/ui/rating-group.tsx +1 -0
  56. package/src/components/ui/separator.tsx +57 -1
  57. package/src/components/ui/sidebar.tsx +1 -1
  58. package/src/components/ui/signature-pad.tsx +381 -0
  59. package/src/components/ui/skeleton.tsx +59 -2
  60. package/src/components/ui/skip-link.tsx +117 -0
  61. package/src/components/ui/slider.tsx +86 -1
  62. package/src/components/ui/spoiler.tsx +131 -0
  63. package/src/components/ui/tabs.tsx +1 -1
  64. package/src/components/ui/text.tsx +135 -0
  65. package/src/components/ui/textarea.tsx +66 -2
  66. package/src/components/ui/timeline.tsx +71 -14
  67. package/src/components/ui/timer.tsx +183 -0
  68. package/src/components/ui/tour.tsx +332 -0
  69. package/src/components/ui/transfer-list.tsx +308 -0
  70. package/src/components/ui/visually-hidden.tsx +42 -0
  71. package/src/components/ui/watermark.tsx +0 -0
  72. package/src/data/docs-index.ts +10 -2
  73. package/src/stories/ActionBar.stories.tsx +201 -0
  74. package/src/stories/Affix.stories.tsx +165 -0
  75. package/src/stories/Alert.stories.tsx +58 -0
  76. package/src/stories/Anchor.stories.tsx +236 -0
  77. package/src/stories/AngleSlider.stories.tsx +128 -0
  78. package/src/stories/Autocomplete.stories.tsx +216 -0
  79. package/src/stories/Avatar.stories.tsx +73 -1
  80. package/src/stories/Blockquote.stories.tsx +148 -0
  81. package/src/stories/BottomNavigation.stories.tsx +195 -0
  82. package/src/stories/Burger.stories.tsx +79 -0
  83. package/src/stories/Button.stories.tsx +103 -2
  84. package/src/stories/Calendar.stories.tsx +4 -0
  85. package/src/stories/Card.stories.tsx +30 -0
  86. package/src/stories/Carousel.stories.tsx +2 -1
  87. package/src/stories/Cascader.stories.tsx +285 -0
  88. package/src/stories/Checkbox.stories.tsx +13 -0
  89. package/src/stories/CheckboxCard.stories.tsx +210 -0
  90. package/src/stories/CheckboxGroup.stories.tsx +186 -0
  91. package/src/stories/Chip.stories.tsx +173 -0
  92. package/src/stories/CircularProgress.stories.tsx +3 -0
  93. package/src/stories/ColorSwatch.stories.tsx +81 -0
  94. package/src/stories/CopyButton.stories.tsx +3 -3
  95. package/src/stories/DataList.stories.tsx +160 -0
  96. package/src/stories/DatePicker.stories.tsx +3 -0
  97. package/src/stories/DateRangePicker.stories.tsx +3 -0
  98. package/src/stories/Editable.stories.tsx +14 -0
  99. package/src/stories/Fieldset.stories.tsx +4 -0
  100. package/src/stories/FloatLabel.stories.tsx +148 -0
  101. package/src/stories/FloatingPanel.stories.tsx +176 -0
  102. package/src/stories/FormatNumber.stories.tsx +308 -0
  103. package/src/stories/Highlight.stories.tsx +140 -0
  104. package/src/stories/Image.stories.tsx +141 -0
  105. package/src/stories/Indicator.stories.tsx +3 -0
  106. package/src/stories/Input.stories.tsx +33 -0
  107. package/src/stories/InputGroup.stories.tsx +39 -41
  108. package/src/stories/Kbd.stories.tsx +3 -0
  109. package/src/stories/Link.stories.tsx +198 -0
  110. package/src/stories/Listbox.stories.tsx +240 -0
  111. package/src/stories/LoadingOverlay.stories.tsx +148 -0
  112. package/src/stories/Marquee.stories.tsx +170 -0
  113. package/src/stories/Masonry.stories.tsx +227 -0
  114. package/src/stories/Meter.stories.tsx +143 -0
  115. package/src/stories/MotionToggle.stories.tsx +85 -0
  116. package/src/stories/Notification.stories.tsx +264 -0
  117. package/src/stories/Overlay.stories.tsx +169 -0
  118. package/src/stories/PasswordInput.stories.tsx +4 -0
  119. package/src/stories/Progress.stories.tsx +70 -27
  120. package/src/stories/QrCode.stories.tsx +146 -0
  121. package/src/stories/RatingGroup.stories.tsx +5 -0
  122. package/src/stories/Separator.stories.tsx +41 -5
  123. package/src/stories/Sidebar.stories.tsx +2 -1
  124. package/src/stories/SignaturePad.stories.tsx +112 -0
  125. package/src/stories/Skeleton.stories.tsx +23 -4
  126. package/src/stories/SkipLink.stories.tsx +137 -0
  127. package/src/stories/Slider.stories.tsx +28 -0
  128. package/src/stories/Spoiler.stories.tsx +122 -0
  129. package/src/stories/Tabs.stories.tsx +2 -1
  130. package/src/stories/Text.stories.tsx +191 -0
  131. package/src/stories/Textarea.stories.tsx +58 -6
  132. package/src/stories/Timeline.stories.tsx +82 -0
  133. package/src/stories/Timer.stories.tsx +160 -0
  134. package/src/stories/Tour.stories.tsx +191 -0
  135. package/src/stories/TransferList.stories.tsx +169 -0
  136. package/src/stories/VisuallyHidden.stories.tsx +105 -0
  137. package/src/stories/Watermark.stories.tsx +212 -0
  138. package/src/styles.css +80 -6
  139. package/src/tokens.json +2 -2
package/src/styles.css CHANGED
@@ -53,7 +53,7 @@
53
53
  /* Brand sans from tokens.json leads. Atkinson Hyperlegible (loaded via the
54
54
  Google Fonts @import above) is the canonical fallback so unbranded
55
55
  consumers still get a high-legibility face out of the box. */
56
- --font-sans: 'Inter', 'Hyperlegible Sans', ui-sans-serif, sans-serif, system-ui, 'Atkinson Hyperlegible', ui-sans-serif, sans-serif, system-ui;
56
+ --font-sans: 'Hyperlegible Sans', 'Inter', ui-sans-serif, sans-serif, system-ui, 'Atkinson Hyperlegible', ui-sans-serif, sans-serif, system-ui;
57
57
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
58
58
  --font-serif: ui-serif, Georgia, serif;
59
59
  --font-variation-settings: normal;
@@ -340,6 +340,11 @@
340
340
  size / weight axes without touching component source. "normal" is a
341
341
  no-op for static fonts. */
342
342
  font-variation-settings: var(--font-variation-settings, normal);
343
+ /* Enable opsz axis on variable fonts (Inter ships opsz 14–32). Without
344
+ this, browser behavior is implementation-defined and silently inconsistent
345
+ across engines; forks that swap in a different variable font may not
346
+ inherit the setting. */
347
+ font-optical-sizing: auto;
343
348
  }
344
349
  /* Match: monospace elements pick up --font-mono without each component
345
350
  having to remember a `font-mono` class. */
@@ -402,11 +407,31 @@
402
407
  /* WCAG AAA 2.3.3 Animation from Interactions: respect the user's
403
408
  reduced-motion preference globally. Components with essential
404
409
  motion (loading spinners, progress bars) opt back in via
405
- `motion-safe:` Tailwind utilities or scoped @media queries. */
410
+ `motion-safe:` Tailwind utilities or scoped @media queries.
411
+
412
+ Three-state model, driven by the optional `data-motion` attribute the
413
+ MotionToggle primitive sets on <html> (opt-in — no attribute is the
414
+ default and behaves exactly as an OS-only reduce query):
415
+ • `data-motion="reduce"` → force motion OFF regardless of OS.
416
+ • `data-motion="full"` → force motion ON even if the OS prefers
417
+ reduce (some users set OS reduce globally
418
+ but trust a given site with motion).
419
+ • absent (`system`) → the OS media query governs, as before.
420
+ The OS query below is gated on `:not([data-motion="full"])` so "full"
421
+ can override it; the attribute rule above wins on specificity for
422
+ "reduce". */
423
+ html[data-motion="reduce"] *,
424
+ html[data-motion="reduce"] *::before,
425
+ html[data-motion="reduce"] *::after {
426
+ animation-duration: 0.01ms !important;
427
+ animation-iteration-count: 1 !important;
428
+ transition-duration: 0.01ms !important;
429
+ scroll-behavior: auto !important;
430
+ }
406
431
  @media (prefers-reduced-motion: reduce) {
407
- *,
408
- *::before,
409
- *::after {
432
+ html:not([data-motion="full"]) *,
433
+ html:not([data-motion="full"]) *::before,
434
+ html:not([data-motion="full"]) *::after {
410
435
  animation-duration: 0.01ms !important;
411
436
  animation-iteration-count: 1 !important;
412
437
  transition-duration: 0.01ms !important;
@@ -572,12 +597,61 @@ html, body {
572
597
  animation: accordion-up var(--duration-base) var(--ease-out);
573
598
  }
574
599
 
600
+ /* Marquee continuous-scroll keyframe — applied via data-slot selectors
601
+ (spec §4 pattern (b): plain CSS in the design-system layer, no Tailwind
602
+ utility generation in the path). The track holds 2×K identical groups,
603
+ so translateX(-50%) is always exactly one loop — seamless at any width.
604
+
605
+ - "linear" timing is a seamless-loop REQUIREMENT, not a style choice:
606
+ any easing curve pulses at the loop seam.
607
+ - --marquee-duration is the consumer tunable (the component computes it
608
+ from the `speed` prop in px/s and writes it inline; a consumer style
609
+ override wins). --marquee-gap tunes item density.
610
+ - Pausing (SC 2.2.2 Pause, Stop, Hide): hover, focus-within, and the
611
+ component's visible control (data-state="paused") all pause playback.
612
+ - Reduced motion: the base layer already forces animation-duration to
613
+ 0.01ms with iteration-count 1, which halts the strip; the explicit
614
+ play-state rule below is belt-and-suspenders and self-documenting. */
615
+ @keyframes marquee-scroll {
616
+ from { transform: translateX(0); }
617
+ to { transform: translateX(-50%); }
618
+ }
619
+ [data-slot="marquee-track"] {
620
+ animation: marquee-scroll var(--marquee-duration, 30s) linear infinite;
621
+ }
622
+ [data-slot="marquee-track"][data-direction="right"] {
623
+ animation-direction: reverse;
624
+ }
625
+ [data-slot="marquee-group"] {
626
+ display: flex;
627
+ align-items: center;
628
+ gap: var(--marquee-gap, 3rem);
629
+ padding-inline-end: var(--marquee-gap, 3rem);
630
+ }
631
+ [data-slot="marquee"][data-state="paused"] [data-slot="marquee-track"],
632
+ [data-slot="marquee"]:hover [data-slot="marquee-track"],
633
+ [data-slot="marquee"]:focus-within [data-slot="marquee-track"] {
634
+ animation-play-state: paused;
635
+ }
636
+ [data-slot="marquee-viewport"][data-fade] {
637
+ -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
638
+ mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
639
+ }
640
+ @media (prefers-reduced-motion: reduce) {
641
+ [data-slot="marquee-track"] { animation-play-state: paused; }
642
+ }
643
+
575
644
  ::view-transition-new(root) {
576
645
  animation: theme-reveal 0.4s ease-in-out forwards;
577
646
  }
578
647
 
648
+ /* Honor the app-level MotionToggle for the iris wipe too (same three-state
649
+ model as the global kill-all). "reduce" snaps the theme swap instantly;
650
+ "full" keeps the wipe even under an OS reduce preference; absent = OS
651
+ query governs. `animation: none` on the pseudo just does an instant swap. */
652
+ html[data-motion="reduce"]::view-transition-new(root) { animation: none; }
579
653
  @media (prefers-reduced-motion: reduce) {
580
- ::view-transition-new(root) { animation: none; }
654
+ html:not([data-motion="full"])::view-transition-new(root) { animation: none; }
581
655
  }
582
656
 
583
657
  @layer utilities {
package/src/tokens.json CHANGED
@@ -158,9 +158,9 @@
158
158
  },
159
159
  "fontFamily": {
160
160
  "sans": {
161
- "$value": "'Inter', 'Hyperlegible Sans', ui-sans-serif, sans-serif, system-ui",
161
+ "$value": "'Hyperlegible Sans', 'Inter', ui-sans-serif, sans-serif, system-ui",
162
162
  "$type": "fontFamily",
163
- "$description": "Primary sans (body, UI). Inter Variable is the BADS default — a single variable woff2 covers weights 100–900, enabling responsive type axes and per-fork weight tuning via --font-variation-settings. Hyperlegible Sans (the Braille Institute's low-vision face) stays second in the stack as the accessibility-preserving fallback and is still self-hosted. ACCESSIBILITY NOTE: forks with a low-vision-heavy audience should reorder to lead with 'Hyperlegible Sans'. Override per client."
163
+ "$description": "Primary sans (body, UI). Hyperlegible Sans (the Braille Institute's low-vision face) is the BADS default — an accessibility-first letterform with disambiguated glyphs, self-hosted via fonts.css (6 static weights). Inter Variable stays second in the stack as a fallback for forks that want a single variable woff2 covering weights 100–900 with responsive type axes; reorder to lead with 'Inter' per client if that's the priority. Override per client."
164
164
  },
165
165
  "serif": {
166
166
  "$value": "ui-serif, Georgia, serif",