@behavioral-agentic-design-system/core 0.39.0 → 0.40.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 (78) hide show
  1. package/package.json +8 -3
  2. package/scripts/a11y-lint.cjs +93 -39
  3. package/scripts/a11y-ratchet.mjs +10 -23
  4. package/scripts/bads-components.mjs +118 -0
  5. package/scripts/build-tokens.cjs +175 -17
  6. package/scripts/check-stories.mjs +1 -1
  7. package/scripts/health-report.mjs +52 -10
  8. package/scripts/lib/scan-roots.cjs +143 -0
  9. package/scripts/lint-component-source.mjs +100 -0
  10. package/scripts/lint-microanimation.mjs +267 -0
  11. package/scripts/lint-slop.mjs +21 -28
  12. package/scripts/lint-token-intent.mjs +10 -16
  13. package/scripts/size-audit.cjs +94 -27
  14. package/scripts/source-of-truth.cjs +58 -0
  15. package/scripts/ux-smoke.mjs +438 -0
  16. package/scripts/wcag-audit.cjs +49 -1
  17. package/src/api/layers/file.ts +2 -0
  18. package/src/app/preview/components/page.tsx +972 -0
  19. package/src/app/preview/health/page.tsx +8 -5
  20. package/src/app/preview/history/page.tsx +11 -0
  21. package/src/app/shell.tsx +261 -87
  22. package/src/components/customize/brand-mark-section.tsx +4 -2
  23. package/src/components/customize/design-controls.tsx +1 -1
  24. package/src/components/customize/discipline-section.tsx +91 -0
  25. package/src/components/customize/font-pickers.tsx +1 -1
  26. package/src/components/customize/letter-spacing.tsx +1 -1
  27. package/src/components/customize/save-bar.tsx +2 -2
  28. package/src/components/customize/theme-io.tsx +7 -7
  29. package/src/components/customize/type-scale.tsx +1 -1
  30. package/src/components/customize-tab.tsx +9 -4
  31. package/src/components/home-tab.tsx +3 -0
  32. package/src/components/ui/accordion.tsx +7 -0
  33. package/src/components/ui/alert.tsx +1 -0
  34. package/src/components/ui/announcement-bar.tsx +256 -0
  35. package/src/components/ui/badge.tsx +1 -0
  36. package/src/components/ui/callout.tsx +218 -0
  37. package/src/components/ui/chart.tsx +2 -14
  38. package/src/components/ui/color-picker.tsx +1 -1
  39. package/src/components/ui/format-relative-time.tsx +139 -0
  40. package/src/components/ui/grid.tsx +255 -0
  41. package/src/components/ui/icon.tsx +108 -0
  42. package/src/components/ui/index.ts +8 -0
  43. package/src/components/ui/page-header.tsx +63 -0
  44. package/src/components/ui/portal.tsx +111 -0
  45. package/src/components/ui/presence.tsx +172 -0
  46. package/src/components/ui/progress-stack.tsx +258 -0
  47. package/src/components/ui/select.tsx +89 -4
  48. package/src/components/ui/separator.tsx +1 -0
  49. package/src/components/ui/slider.tsx +83 -3
  50. package/src/components/ui/sparkline.tsx +15 -15
  51. package/src/components/ui/textarea.tsx +28 -1
  52. package/src/data/docs-index.ts +5 -0
  53. package/src/data/history.json +269 -0
  54. package/src/hooks/use-reduced-motion.ts +6 -0
  55. package/src/stories/Accordion.stories.tsx +59 -0
  56. package/src/stories/Alert.stories.tsx +3 -1
  57. package/src/stories/AnnouncementBar.stories.tsx +261 -0
  58. package/src/stories/Badge.stories.tsx +3 -0
  59. package/src/stories/Calendar.stories.tsx +1 -1
  60. package/src/stories/Callout.stories.tsx +219 -0
  61. package/src/stories/Chart.stories.tsx +4 -0
  62. package/src/stories/ColorPicker.stories.tsx +23 -0
  63. package/src/stories/FormatRelativeTime.stories.tsx +116 -0
  64. package/src/stories/Grid.stories.tsx +197 -0
  65. package/src/stories/Icon.stories.tsx +175 -0
  66. package/src/stories/MultiSelect.stories.tsx +1 -1
  67. package/src/stories/PageHeader.stories.tsx +102 -0
  68. package/src/stories/Portal.stories.tsx +189 -0
  69. package/src/stories/Presence.stories.tsx +228 -0
  70. package/src/stories/ProgressStack.stories.tsx +287 -0
  71. package/src/stories/Select.stories.tsx +25 -0
  72. package/src/stories/Separator.stories.tsx +3 -0
  73. package/src/stories/Sheet.stories.tsx +9 -3
  74. package/src/stories/Slider.stories.tsx +54 -5
  75. package/src/stories/Sparkline.stories.tsx +39 -0
  76. package/src/stories/Textarea.stories.tsx +18 -0
  77. package/src/stories/story-groups.json +14 -5
  78. package/src/styles.css +133 -12
@@ -11,6 +11,12 @@ import { cn } from "../../lib/utils"
11
11
  */
12
12
  type SliderMark = number | { value: number; label?: React.ReactNode }
13
13
 
14
+ /**
15
+ * When the per-thumb value bubble shows. `auto` = on hover / focus / drag
16
+ * (drag focuses the thumb in Radix), `always` = persistent, `never` = off.
17
+ */
18
+ type SliderValueLabelMode = "auto" | "always" | "never"
19
+
14
20
  function Slider({
15
21
  className,
16
22
  defaultValue,
@@ -19,6 +25,9 @@ function Slider({
19
25
  max = 100,
20
26
  orientation = "horizontal",
21
27
  marks,
28
+ valueLabel = "never",
29
+ valueLabelFormat,
30
+ onValueChange,
22
31
  "aria-label": ariaLabel,
23
32
  "aria-labelledby": ariaLabelledby,
24
33
  ...props
@@ -29,6 +38,17 @@ function Slider({
29
38
  * the slider's default rendering when omitted.
30
39
  */
31
40
  marks?: SliderMark[]
41
+ /**
42
+ * Thumb-anchored current-value bubble (Mantine `label`, MUI
43
+ * `valueLabelDisplay`, Ant `tooltip`). Default `never` — the slider renders
44
+ * byte-identically to before when omitted. The bubble is `aria-hidden`:
45
+ * the thumb already announces `aria-valuenow`, and a string returned by
46
+ * `valueLabelFormat` is mirrored to `aria-valuetext` so screen readers hear
47
+ * the same formatted value.
48
+ */
49
+ valueLabel?: SliderValueLabelMode
50
+ /** Formats the bubble text, e.g. `(v) => \`$${v}\``. Defaults to the raw number. */
51
+ valueLabelFormat?: (value: number) => React.ReactNode
32
52
  }) {
33
53
  const _values = React.useMemo(
34
54
  () =>
@@ -40,6 +60,22 @@ function Slider({
40
60
  [value, defaultValue, min, max]
41
61
  )
42
62
 
63
+ // Mirror the live values so the value bubble can render in uncontrolled
64
+ // mode (Radix owns the state; we only tap onValueChange). Controlled mode
65
+ // reads `value` directly.
66
+ const [tracked, setTracked] = React.useState<number[]>(
67
+ () => value ?? defaultValue ?? [min]
68
+ )
69
+ const currentValues = value ?? tracked
70
+ const handleValueChange = React.useCallback(
71
+ (next: number[]) => {
72
+ setTracked(next)
73
+ onValueChange?.(next)
74
+ },
75
+ [onValueChange]
76
+ )
77
+ const showValueLabel = valueLabel !== "never"
78
+
43
79
  const _marks = React.useMemo(
44
80
  () =>
45
81
  (marks ?? []).map((m) =>
@@ -61,10 +97,15 @@ function Slider({
61
97
  min={min}
62
98
  max={max}
63
99
  orientation={orientation}
100
+ onValueChange={handleValueChange}
64
101
  className={cn(
65
102
  "relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
66
103
  // Reserve room for mark labels so they never overlap following content.
67
104
  hasLabels && (isVertical ? "mr-12" : "mb-7"),
105
+ // A persistent value bubble sits above (or beside) the thumb — reserve
106
+ // room for it the same way. `auto` bubbles are transient, like a
107
+ // tooltip, so they may overlap and reserve nothing.
108
+ valueLabel === "always" && (isVertical ? "mr-16" : "mt-9"),
68
109
  className
69
110
  )}
70
111
  {...props}
@@ -150,14 +191,53 @@ function Slider({
150
191
  ariaLabel && _values.length > 1
151
192
  ? `${ariaLabel} ${index === 0 ? "minimum" : "maximum"}`
152
193
  : ariaLabel
194
+ const rawValue = currentValues[index] ?? min
195
+ const formatted = valueLabelFormat ? valueLabelFormat(rawValue) : rawValue
196
+ // Only a string/number formatter result can be announced; a ReactNode
197
+ // label falls back to Radix's own aria-valuenow.
198
+ const valueText =
199
+ valueLabelFormat &&
200
+ (typeof formatted === "string" || typeof formatted === "number")
201
+ ? String(formatted)
202
+ : undefined
153
203
  return (
154
204
  <SliderPrimitive.Thumb
155
205
  data-slot="slider-thumb"
156
206
  key={index}
157
207
  aria-label={thumbLabel}
158
208
  aria-labelledby={ariaLabelledby}
159
- className="block size-8 shrink-0 rounded-full border-2 border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
160
- />
209
+ aria-valuetext={valueText}
210
+ className="group/thumb relative block size-8 shrink-0 rounded-full border-2 border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
211
+ >
212
+ {showValueLabel && (
213
+ // Inverted surface, same audited pair Tooltip uses
214
+ // (bg-foreground / text-background). aria-hidden: the thumb
215
+ // announces the value. Pattern-c motion for the fade + lift.
216
+ <span
217
+ data-slot="slider-value-label"
218
+ aria-hidden
219
+ className={cn(
220
+ "pointer-events-none absolute rounded-md bg-foreground px-2 py-0.5 text-xs font-medium whitespace-nowrap tabular-nums text-background shadow-sm transition-[opacity,transform]",
221
+ isVertical
222
+ ? "top-1/2 left-full ml-3 -translate-y-1/2"
223
+ : "bottom-full left-1/2 mb-2 -translate-x-1/2",
224
+ valueLabel === "auto" &&
225
+ cn(
226
+ "opacity-0 group-hover/thumb:opacity-100 group-focus/thumb:opacity-100",
227
+ isVertical
228
+ ? "translate-x-1 group-hover/thumb:translate-x-0 group-focus/thumb:translate-x-0"
229
+ : "translate-y-1 group-hover/thumb:translate-y-0 group-focus/thumb:translate-y-0"
230
+ )
231
+ )}
232
+ style={{
233
+ transitionDuration: "var(--duration-fast)",
234
+ transitionTimingFunction: "var(--ease-out)",
235
+ }}
236
+ >
237
+ {formatted}
238
+ </span>
239
+ )}
240
+ </SliderPrimitive.Thumb>
161
241
  )
162
242
  })}
163
243
  </SliderPrimitive.Root>
@@ -165,4 +245,4 @@ function Slider({
165
245
  }
166
246
 
167
247
  export { Slider }
168
- export type { SliderMark }
248
+ export type { SliderMark, SliderValueLabelMode }
@@ -8,9 +8,11 @@ import {
8
8
  Area,
9
9
  Line,
10
10
  Dot,
11
+ YAxis,
11
12
  } from "recharts"
12
13
 
13
14
  import { cn } from "../../lib/utils"
15
+ import { useReducedMotion } from "../../hooks/use-reduced-motion"
14
16
 
15
17
  export interface SparklineProps extends React.ComponentProps<"span"> {
16
18
  /**
@@ -48,19 +50,6 @@ export interface SparklineProps extends React.ComponentProps<"span"> {
48
50
  // Each Sparkline instance gets its own gradient so multiple sparklines on
49
51
  // the same page don't share gradient ids and create incorrect fill colors.
50
52
 
51
- function usePrefersReducedMotion(): boolean {
52
- const [reduced, setReduced] = React.useState(false)
53
- React.useEffect(() => {
54
- if (typeof window === "undefined" || !window.matchMedia) return
55
- const mql = window.matchMedia("(prefers-reduced-motion: reduce)")
56
- setReduced(mql.matches)
57
- const onChange = (e: MediaQueryListEvent) => setReduced(e.matches)
58
- mql.addEventListener("change", onChange)
59
- return () => mql.removeEventListener("change", onChange)
60
- }, [])
61
- return reduced
62
- }
63
-
64
53
  /**
65
54
  * Compact inline sparkline for trend visualization. Renders a mini area or
66
55
  * line chart with no axes, no labels, and no tooltip — just the data shape.
@@ -90,7 +79,7 @@ function Sparkline({
90
79
  const uniqueId = React.useId()
91
80
  const gradientId = `sparkline-grad-${uniqueId.replace(/:/g, "")}`
92
81
 
93
- const prefersReducedMotion = usePrefersReducedMotion()
82
+ const prefersReducedMotion = useReducedMotion()
94
83
  const animate = !prefersReducedMotion
95
84
 
96
85
  // ResizeObserver gate — same pattern as ChartContainer.
@@ -116,7 +105,10 @@ function Sparkline({
116
105
  [data]
117
106
  )
118
107
 
119
- // Compute domain so flat/negative data still renders a visible shape.
108
+ // Compute domain so flat/negative data still renders a visible shape. This
109
+ // is fed to a hidden <YAxis> below — without it Recharts nice-ticks its own
110
+ // default axis (and anchors positive-only series at 0), which squeezes the
111
+ // series into a fraction of the box.
120
112
  const min = Math.min(...data)
121
113
  const max = Math.max(...data)
122
114
  const padding = max === min ? 1 : (max - min) * 0.1
@@ -174,11 +166,18 @@ function Sparkline({
174
166
  <stop offset="95%" stopColor={color} stopOpacity={0} />
175
167
  </linearGradient>
176
168
  </defs>
169
+ <YAxis domain={domain} hide yAxisId={0} />
177
170
  <Area
178
171
  {...commonLineProps}
179
172
  fill={`url(#${gradientId})`}
180
173
  fillOpacity={1}
181
174
  yAxisId={0}
175
+ // Anchor the fill to the bottom of the plot area. Recharts'
176
+ // default baseValue resolves to 0, which for a mixed-sign
177
+ // series draws a hard horizontal edge across the middle of the
178
+ // sparkline and leaves the negative lobes in the gradient's
179
+ // transparent tail.
180
+ baseValue={domain[0]}
182
181
  />
183
182
  </AreaChart>
184
183
  ) : (
@@ -186,6 +185,7 @@ function Sparkline({
186
185
  data={chartData}
187
186
  margin={{ top: 2, right: 2, bottom: 2, left: 2 }}
188
187
  >
188
+ <YAxis domain={domain} hide yAxisId={0} />
189
189
  <Line {...commonLineProps} yAxisId={0} />
190
190
  </LineChart>
191
191
  )}
@@ -36,6 +36,17 @@ interface TextareaProps
36
36
  maxLength?: number
37
37
  /** Label id for the character count `<output>` element. Auto-derived when omitted. */
38
38
  countId?: string
39
+ /**
40
+ * Cap auto-grow height at this many text rows. Works in tandem with
41
+ * `field-sizing-content` (the CSS auto-resize baseline): the textarea
42
+ * still grows freely up to this limit, then scrolls.
43
+ *
44
+ * Uses 1lh (line height) units for precision. 1lh resolves to the
45
+ * element's computed line-height so the cap tracks the font size.
46
+ *
47
+ * Peer parity: Mantine autosize maxRows, MUI maxRows, Ant Design autoSize.maxRows.
48
+ */
49
+ maxRows?: number
39
50
  }
40
51
 
41
52
  function Textarea({
@@ -44,6 +55,7 @@ function Textarea({
44
55
  showCount = false,
45
56
  maxLength,
46
57
  countId,
58
+ maxRows,
47
59
  onChange,
48
60
  defaultValue,
49
61
  value,
@@ -69,7 +81,22 @@ function Textarea({
69
81
  data-slot="textarea"
70
82
  maxLength={maxLength}
71
83
  aria-describedby={showCount ? resolvedCountId : undefined}
72
- className={cn(textareaVariants({ size }), className)}
84
+ className={cn(
85
+ textareaVariants({ size }),
86
+ // When maxRows is set, cap the auto-grow height and let excess scroll.
87
+ maxRows != null && "overflow-y-auto",
88
+ className
89
+ )}
90
+ style={
91
+ maxRows != null
92
+ ? {
93
+ // 1lh = computed line-height (Chrome 109+, Safari 16.4+).
94
+ // totalPy accounts for the top + bottom padding of each size tier.
95
+ // 2px covers the 1px border on each side.
96
+ maxHeight: `calc(${maxRows} * 1lh + ${{ sm: "0.75rem", default: "1rem", lg: "1.25rem", xl: "1.5rem" }[String(size ?? "default")] ?? "1rem"} + 2px)`,
97
+ }
98
+ : undefined
99
+ }
73
100
  value={value}
74
101
  defaultValue={defaultValue}
75
102
  onChange={handleChange}
@@ -39,6 +39,7 @@ export const DOCS_INDEX: DocGroup[] = [
39
39
  entries: [
40
40
  { title: "README", path: "README.md", summary: "The first thing to read — what BADS is, how to run it, where to look next." },
41
41
  { title: "Brief", path: "BRIEF.md", summary: "The one-pager — what BADS is, who it's for, what it refuses." },
42
+ { title: "Product record", path: "PRODUCT.md", summary: "Durable product truth for the design skills: users, positioning, constraints, principles, and what must never be fabricated." },
42
43
  { title: "Design system stack", path: "DESIGN_SYSTEM_STACK.md", summary: "The 10-layer architecture in one document." },
43
44
  { title: "Tech stack", path: "docs/tech-stack.md", summary: "What BADS is built on and why — framework, tokens, testing, AI layer — plus the 30-second spoken answer." },
44
45
  { title: "Sync model", path: "BADS_SYNC.md", summary: "How forks pull upstream BADS improvements." },
@@ -90,7 +91,9 @@ export const DOCS_INDEX: DocGroup[] = [
90
91
  { title: "Night Shift spec", path: "CIRCADIAN.md", summary: "The overnight agent: what it audits, researches, builds, tests, merges, and reports each night." },
91
92
  { title: "Night Shift prompt", path: "scripts/prompts/night-shift.md", summary: "The full nightly research + auto-PR pass." },
92
93
  { title: "Agent roadmap", path: "docs/agent-roadmap.md" },
94
+ { title: "Disciplines — product vs marketing", path: "disciplines/README.md", summary: "The discipline axis: one fork serves both product and marketing work on a shared spine, and a four-signal router (explicit \u2192 route \u2192 classify \u2192 default) decides which rule tree loads. The three spine manifests load for every discipline because the accessibility and ethics floors are discipline-neutral. Promoted upstream 2026-09-09 from the ohmyaura fork when a second client needed it." },
93
95
  { title: "Intent-driven context", path: "docs/intent-driven-context.md", summary: "Constraint vs guideline vs framing vs workflow — and what delivery each demands." },
96
+ { title: "Social sources bench", path: "docs/social-sources.md", summary: "Sir-curated bench of practitioner accounts (X, LinkedIn, Reddit, Medium, Bluesky/Mastodon) the Night Shift's social signal sweep checks — so it reads known-good signal, not the firehose. Carries the lowest-trust-tier rules (a social post alone is never an actionable finding) and the ToS boundaries (search-driven, never logged-in scraping; LinkedIn read-through-search only)." },
94
97
  ],
95
98
  },
96
99
  {
@@ -222,6 +225,8 @@ export const DOCS_INDEX: DocGroup[] = [
222
225
  { title: "Spec — self-healing layer", path: "docs/specs/2026-08-21-self-healing-layer.md", summary: "Phase A contract: informational-only health score (Goodhart guard), no runtime telemetry, deterministic visible-copy intent rules, drift-ledger status convention, and the calibration record (6→0 false positives; two scoring bugs caught by face-checking)." },
223
226
  { title: "Plan — drift elimination", path: "docs/plans/2026-08-31-drift-elimination.md", summary: "Closing the loop between upstream, client forks, and prototype repos. Built on the one artifact every working template-sync tool shares: a committed record of which upstream version a downstream copy is layered on. Three phases ordered by risk — additive checks, then PR-gated fork sync, then the deferred structural calls." },
224
227
  { title: "Spec — drift elimination", path: "docs/specs/2026-08-31-drift-elimination.md", summary: "Phase A contract: precision over recall (unverifiable is never reported as drift), advisory-by-default with one blocking generated-artifact gate, additive-only sync manifest, and declared expected-drift allowlists. Calibration: 51→0 false positives on the registry checker, and real drift caught including llms.txt advertising 79 components when there were 173." },
228
+ { title: "Plan — Best-of-N", path: "docs/plans/2026-09-10-best-of-n.md", summary: "Run one judgment N times and treat disagreement as the signal. Two uses: a three-verifier unanimity panel before Code Review Carl can force-merge a fix, and an eval agreement score that finds the rules repeated runs resolve differently. Rejects a merge agent and majority vote for the gate, and says why." },
229
+ { title: "Spec — Best-of-N", path: "docs/specs/2026-09-10-best-of-n.md", summary: "The contract for scripts/verifier-panel.mjs (unanimous, fail-closed, distinct lenses, evidence-backed approvals) and scripts/eval-agreement.mjs (check stability, primitive choice, import path, drift rows only from the with-context arm). Records the first measurement: a skill rule sending agents to the package root, 3 of 15 before the fix and 0 of 15 after." },
225
230
  { title: "Roadmap — ClosedLoop import candidates", path: "docs/roadmap-closedloop-import.md", summary: "Fourteen production patterns surfaced by auditing the closedloop-ai GitHub org (40 repos, 17 cloned, 2026-09-03). Three shipped immediately; the rest carry activation signals matching the standard roadmap format." },
226
231
  ],
227
232
  },
@@ -0,0 +1,269 @@
1
+ {
2
+ "$comment": "GENERATED by scripts/build-history.mjs — do not edit. Regenerate with `pnpm build:history`.",
3
+ "generatedAt": "2026-09-09",
4
+ "stats": [
5
+ {
6
+ "label": "commits",
7
+ "value": 1214
8
+ },
9
+ {
10
+ "label": "components",
11
+ "value": 180
12
+ },
13
+ {
14
+ "label": "semantic tokens",
15
+ "value": 45
16
+ },
17
+ {
18
+ "label": "layers",
19
+ "value": 10
20
+ }
21
+ ],
22
+ "genesis": {
23
+ "sha": "548b1ffe",
24
+ "date": "2026-05-04",
25
+ "subject": "Initial commit: BADS template v0.1.0"
26
+ },
27
+ "milestones": [
28
+ {
29
+ "sha": "f916cd24",
30
+ "date": "2026-09-09",
31
+ "scope": "shell",
32
+ "title": "replace the top tabs with a left rail, and promote the discipline tree upstream"
33
+ },
34
+ {
35
+ "sha": "2b3fe69f",
36
+ "date": "2026-09-09",
37
+ "scope": "storybook",
38
+ "title": "keep the variant galleries out of the AI manifest (#460)"
39
+ },
40
+ {
41
+ "sha": "31fd2924",
42
+ "date": "2026-09-09",
43
+ "scope": "progress",
44
+ "title": "add xl size (16px) to track height ladder (#445)"
45
+ },
46
+ {
47
+ "sha": "98ca9802",
48
+ "date": "2026-09-09",
49
+ "scope": "alert",
50
+ "title": "add sm size variant for compact / dense-layout use (#446)"
51
+ },
52
+ {
53
+ "sha": "7cda871b",
54
+ "date": "2026-09-09",
55
+ "scope": "components",
56
+ "title": "FormatDate + WeekPicker + Sparkline [Night Shift]"
57
+ },
58
+ {
59
+ "sha": "0fedeb8c",
60
+ "date": "2026-09-06",
61
+ "scope": "accordion",
62
+ "title": "add contained and separated visual variants (#447)"
63
+ },
64
+ {
65
+ "sha": "a7e9e817",
66
+ "date": "2026-09-06",
67
+ "scope": "tags-input",
68
+ "title": "add size prop sm/default/lg/xl (#444)"
69
+ },
70
+ {
71
+ "sha": "cef5617b",
72
+ "date": "2026-09-06",
73
+ "scope": "checkbox-card",
74
+ "title": "add size prop sm/default/lg (#443)"
75
+ },
76
+ {
77
+ "sha": "3e333c2f",
78
+ "date": "2026-09-06",
79
+ "scope": "checkbox",
80
+ "title": "add lg size 40px (#442)"
81
+ },
82
+ {
83
+ "sha": "640e144f",
84
+ "date": "2026-09-06",
85
+ "scope": "breadcrumb",
86
+ "title": "add dropdown variant for long paths (#439)"
87
+ },
88
+ {
89
+ "sha": "03279eba",
90
+ "date": "2026-09-05",
91
+ "scope": "components",
92
+ "title": "Avatar xl/xs sizes, ToggleGroup vertical, Tag icon slot (night-shift 2026-09-03)"
93
+ },
94
+ {
95
+ "sha": "f9c74daa",
96
+ "date": "2026-09-03",
97
+ "scope": "night-shift",
98
+ "title": "give Carl a bundle-delta efficiency floor"
99
+ },
100
+ {
101
+ "sha": "b1e04bbc",
102
+ "date": "2026-09-03",
103
+ "scope": "night-shift",
104
+ "title": "add four governance crew members + weekly deep-dive"
105
+ },
106
+ {
107
+ "sha": "cfc3e8d9",
108
+ "date": "2026-09-03",
109
+ "scope": "night-shift",
110
+ "title": "add Code Review Carl — staff-engineer review pass (step 3f)"
111
+ },
112
+ {
113
+ "sha": "8aee3811",
114
+ "date": "2026-09-01",
115
+ "scope": "scripts",
116
+ "title": "port accent-as-text lint from CL-BADS, add stale-exception detection to wcag-audit"
117
+ },
118
+ {
119
+ "sha": "e2165388",
120
+ "date": "2026-09-01",
121
+ "scope": "eval",
122
+ "title": "score the rules BADS actually enforces, from one shared definition"
123
+ },
124
+ {
125
+ "sha": "02b90ce5",
126
+ "date": "2026-09-01",
127
+ "scope": "multi-select",
128
+ "title": "add size prop (sm/default/lg/xl) (#430)"
129
+ },
130
+ {
131
+ "sha": "6878a6a2",
132
+ "date": "2026-09-01",
133
+ "scope": "combobox",
134
+ "title": "add size prop (sm/default/lg/xl) threading to Button trigger (#429)"
135
+ },
136
+ {
137
+ "sha": "020526e3",
138
+ "date": "2026-08-31",
139
+ "scope": "cards",
140
+ "title": "add ChatThread composition (#421)"
141
+ },
142
+ {
143
+ "sha": "8a53f8db",
144
+ "date": "2026-08-31",
145
+ "scope": "radio-group",
146
+ "title": "wire orientation prop to visual layout (#420)"
147
+ },
148
+ {
149
+ "sha": "266f9d18",
150
+ "date": "2026-08-31",
151
+ "scope": "switch",
152
+ "title": "add lg size variant (44×80px, SC 2.5.5 Enhanced compliant) (#419)"
153
+ },
154
+ {
155
+ "sha": "ff566d2a",
156
+ "date": "2026-08-31",
157
+ "scope": "home",
158
+ "title": "upstream shows a fork prompt; forks show their own prompts"
159
+ },
160
+ {
161
+ "sha": "cfa883eb",
162
+ "date": "2026-08-31",
163
+ "scope": "drift",
164
+ "title": "Phase B — ship the checks to consumers, make fleet drift visible"
165
+ },
166
+ {
167
+ "sha": "6ecf12ac",
168
+ "date": "2026-08-31",
169
+ "scope": "drift",
170
+ "title": "drift elimination Phase A — generated-artifact gate, registry truth, doctor, sync manifest v2, CLAUDE.md freshness"
171
+ },
172
+ {
173
+ "sha": "0f7128a2",
174
+ "date": "2026-08-30",
175
+ "scope": "pagination",
176
+ "title": "size prop — sm / default / lg (Tier 4, Night Shift 2026-08-30) (#414)"
177
+ },
178
+ {
179
+ "sha": "dabbf55e",
180
+ "date": "2026-08-30",
181
+ "scope": "progress",
182
+ "title": "striped and animated variants (Tier 4, Night Shift 2026-08-30)"
183
+ },
184
+ {
185
+ "sha": "9112a926",
186
+ "date": "2026-08-30",
187
+ "scope": "Textarea",
188
+ "title": "add size prop — sm / default / lg / xl via CVA (#404)"
189
+ },
190
+ {
191
+ "sha": "938f194a",
192
+ "date": "2026-08-29",
193
+ "scope": "Input",
194
+ "title": "add ghost and filled variant props (#411)"
195
+ },
196
+ {
197
+ "sha": "4f0e1b1e",
198
+ "date": "2026-08-29",
199
+ "scope": null,
200
+ "title": "add Table striped/bordered/compact variants (#409) [Night Shift]"
201
+ },
202
+ {
203
+ "sha": "20f54a22",
204
+ "date": "2026-08-29",
205
+ "scope": "DataTable",
206
+ "title": "add stickyHeader prop + Table wrapperClassName/wrapperStyle (#405)"
207
+ },
208
+ {
209
+ "sha": "11e74884",
210
+ "date": "2026-08-28",
211
+ "scope": "RadioGroupItem",
212
+ "title": "add size prop — sm / default / lg via CVA (#406)"
213
+ },
214
+ {
215
+ "sha": "d277fc62",
216
+ "date": "2026-08-27",
217
+ "scope": "select",
218
+ "title": "add lg and xl size variants (#396)"
219
+ },
220
+ {
221
+ "sha": "ad927e12",
222
+ "date": "2026-08-27",
223
+ "scope": "search-input",
224
+ "title": "add SearchInput composition primitive (#397)"
225
+ },
226
+ {
227
+ "sha": "506ab78a",
228
+ "date": "2026-08-26",
229
+ "scope": "ethics",
230
+ "title": "apply 8 HIGH data-entry findings — registry anti-patterns + lint"
231
+ },
232
+ {
233
+ "sha": "b8a14b22",
234
+ "date": "2026-08-26",
235
+ "scope": "lint",
236
+ "title": "guard against analytics SDKs in @core; close stale PostHog findings"
237
+ },
238
+ {
239
+ "sha": "056731e7",
240
+ "date": "2026-08-26",
241
+ "scope": "skeleton-table",
242
+ "title": "add SkeletonTable sub-component [Night Shift] (#355)"
243
+ },
244
+ {
245
+ "sha": "d9e2c5f2",
246
+ "date": "2026-08-26",
247
+ "scope": "[Night Shift]",
248
+ "title": "feat([Night Shift]) Add Progress intent prop (#367)"
249
+ },
250
+ {
251
+ "sha": "86a364ac",
252
+ "date": "2026-08-26",
253
+ "scope": "[Night Shift]",
254
+ "title": "feat([Night Shift]) Add Checkbox size prop (#368)"
255
+ },
256
+ {
257
+ "sha": "a6aac73f",
258
+ "date": "2026-08-26",
259
+ "scope": "rename",
260
+ "title": "make a fresh fork's docs speak as the fork (#381)"
261
+ },
262
+ {
263
+ "sha": "0fd4f0d9",
264
+ "date": "2026-08-26",
265
+ "scope": null,
266
+ "title": "add ToggleTip component (#378) [Night Shift]"
267
+ }
268
+ ]
269
+ }
@@ -17,10 +17,16 @@ export function prefersReducedMotion(): boolean {
17
17
  );
18
18
  }
19
19
 
20
+ /**
21
+ * Reactive reduced-motion preference. Starts `false` (SSR and first client
22
+ * render agree), then tracks the media query. Guarded on `matchMedia` for
23
+ * environments that don't implement it, matching `prefersReducedMotion()`.
24
+ */
20
25
  export function useReducedMotion(): boolean {
21
26
  const [reduced, setReduced] = React.useState(false);
22
27
 
23
28
  React.useEffect(() => {
29
+ if (typeof window.matchMedia !== "function") return;
24
30
  const mql = window.matchMedia(QUERY);
25
31
  const update = () => setReduced(mql.matches);
26
32
  update();
@@ -112,6 +112,19 @@ export const Variant_Contained: Story = {
112
112
  </AccordionItem>
113
113
  </Accordion>
114
114
  ),
115
+ // The contained variant's card surface lives on Radix's own Root, which is
116
+ // why accordion.tsx carries a `lint-disable: card-bypass` there instead of
117
+ // composing Card. That escape is a claim, so this is the control group for
118
+ // it: if the surface ever stops being drawn, the reason for the escape is
119
+ // gone and this fails.
120
+ play: async ({ canvasElement }) => {
121
+ const root = canvasElement.querySelector('[data-slot="accordion"]');
122
+ await expect(root).not.toBeNull();
123
+ const cs = getComputedStyle(root as Element);
124
+ await expect(parseFloat(cs.borderTopWidth)).toBeGreaterThan(0);
125
+ await expect(cs.backgroundColor).not.toBe("rgba(0, 0, 0, 0)");
126
+ await expect(parseFloat(cs.borderTopLeftRadius)).toBeGreaterThan(0);
127
+ },
115
128
  };
116
129
 
117
130
  export const Variant_Separated: Story = {
@@ -142,6 +155,52 @@ export const Variant_Separated: Story = {
142
155
  </AccordionItem>
143
156
  </Accordion>
144
157
  ),
158
+ // Same control group as Variant_Contained, for the second card-bypass
159
+ // escape: here the surface is per item, not on the root.
160
+ play: async ({ canvasElement }) => {
161
+ const items = canvasElement.querySelectorAll('[data-slot="accordion-item"]');
162
+ await expect(items.length).toBe(3);
163
+ for (const item of items) {
164
+ const cs = getComputedStyle(item);
165
+ await expect(parseFloat(cs.borderTopWidth)).toBeGreaterThan(0);
166
+ await expect(cs.backgroundColor).not.toBe("rgba(0, 0, 0, 0)");
167
+ await expect(parseFloat(cs.borderTopLeftRadius)).toBeGreaterThan(0);
168
+ }
169
+ },
170
+ };
171
+
172
+ export const Size_Full: Story = {
173
+ parameters: { controls: { disable: true } },
174
+ render: () => (
175
+ <div className="w-full max-w-2xl">
176
+ <Accordion type="single" collapsible className="w-full">
177
+ <AccordionItem value="item-1">
178
+ <AccordionTrigger>Getting started</AccordionTrigger>
179
+ <AccordionContent className="text-muted-foreground">
180
+ Fork the repo, run <code>pnpm install</code>, then{" "}
181
+ <code>pnpm dev</code>. The preview app starts on localhost:3000 and
182
+ the Storybook on localhost:6006.
183
+ </AccordionContent>
184
+ </AccordionItem>
185
+ <AccordionItem value="item-2">
186
+ <AccordionTrigger>Token customization</AccordionTrigger>
187
+ <AccordionContent className="text-muted-foreground">
188
+ All visual decisions live in <code>tokens.json</code>. Edit the
189
+ file and run <code>pnpm build:tokens</code> — the generated CSS
190
+ updates both the preview app and the published package.
191
+ </AccordionContent>
192
+ </AccordionItem>
193
+ <AccordionItem value="item-3">
194
+ <AccordionTrigger>Contributing components</AccordionTrigger>
195
+ <AccordionContent className="text-muted-foreground">
196
+ Run the Component Readiness Audit before building anything new.
197
+ Every primitive needs an accessibility contract, a story matrix, and
198
+ a registry entry before it can ship.
199
+ </AccordionContent>
200
+ </AccordionItem>
201
+ </Accordion>
202
+ </div>
203
+ ),
145
204
  };
146
205
 
147
206
  export const Disabled: Story = {
@@ -5,7 +5,9 @@
5
5
  // left-accent language matches the Sonner toasts so alerts and notifications
6
6
  // read as one family. (Accent/border colors use arbitrary `border-[var(--token)]!`
7
7
  // because the named border-color utilities don't emit a rule in this Tailwind v4
8
- // setup.) Any change to alertVariants should re-snapshot here in Chromatic.
8
+ // setup — an override needs the same `!` importance, e.g. `border-l-transparent!`,
9
+ // see the recipe-note in alert.tsx.) Any change to alertVariants should re-snapshot
10
+ // here in Chromatic.
9
11
  // Dismissible + WithAction: onDismiss renders a top-right × button; action
10
12
  // renders a row below AlertDescription. Both are optional and compose freely.
11
13
  import type { Meta, StoryObj } from "@storybook/react";