@behavioral-agentic-design-system/core 0.39.1 → 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 (69) hide show
  1. package/package.json +8 -3
  2. package/scripts/a11y-lint.cjs +47 -6
  3. package/scripts/bads-components.mjs +118 -0
  4. package/scripts/build-tokens.cjs +133 -12
  5. package/scripts/check-stories.mjs +1 -1
  6. package/scripts/lint-component-source.mjs +100 -0
  7. package/scripts/lint-microanimation.mjs +267 -0
  8. package/scripts/size-audit.cjs +79 -0
  9. package/scripts/source-of-truth.cjs +58 -0
  10. package/scripts/ux-smoke.mjs +438 -0
  11. package/scripts/wcag-audit.cjs +49 -1
  12. package/src/api/layers/file.ts +1 -0
  13. package/src/app/preview/components/page.tsx +968 -0
  14. package/src/app/shell.tsx +11 -13
  15. package/src/components/customize/brand-mark-section.tsx +4 -2
  16. package/src/components/customize/design-controls.tsx +1 -1
  17. package/src/components/customize/discipline-section.tsx +3 -6
  18. package/src/components/customize/font-pickers.tsx +1 -1
  19. package/src/components/customize/letter-spacing.tsx +1 -1
  20. package/src/components/customize/save-bar.tsx +2 -2
  21. package/src/components/customize/theme-io.tsx +7 -7
  22. package/src/components/customize/type-scale.tsx +1 -1
  23. package/src/components/customize-tab.tsx +7 -4
  24. package/src/components/home-tab.tsx +3 -0
  25. package/src/components/ui/accordion.tsx +7 -0
  26. package/src/components/ui/alert.tsx +1 -0
  27. package/src/components/ui/announcement-bar.tsx +256 -0
  28. package/src/components/ui/badge.tsx +1 -0
  29. package/src/components/ui/callout.tsx +218 -0
  30. package/src/components/ui/chart.tsx +2 -14
  31. package/src/components/ui/color-picker.tsx +1 -1
  32. package/src/components/ui/format-relative-time.tsx +139 -0
  33. package/src/components/ui/grid.tsx +255 -0
  34. package/src/components/ui/icon.tsx +108 -0
  35. package/src/components/ui/index.ts +8 -0
  36. package/src/components/ui/page-header.tsx +63 -0
  37. package/src/components/ui/portal.tsx +111 -0
  38. package/src/components/ui/presence.tsx +172 -0
  39. package/src/components/ui/progress-stack.tsx +258 -0
  40. package/src/components/ui/select.tsx +89 -4
  41. package/src/components/ui/separator.tsx +1 -0
  42. package/src/components/ui/slider.tsx +83 -3
  43. package/src/components/ui/sparkline.tsx +2 -14
  44. package/src/components/ui/textarea.tsx +28 -1
  45. package/src/data/docs-index.ts +1 -0
  46. package/src/hooks/use-reduced-motion.ts +6 -0
  47. package/src/stories/Accordion.stories.tsx +59 -0
  48. package/src/stories/Alert.stories.tsx +3 -1
  49. package/src/stories/AnnouncementBar.stories.tsx +261 -0
  50. package/src/stories/Badge.stories.tsx +3 -0
  51. package/src/stories/Calendar.stories.tsx +1 -1
  52. package/src/stories/Callout.stories.tsx +219 -0
  53. package/src/stories/Chart.stories.tsx +4 -0
  54. package/src/stories/ColorPicker.stories.tsx +23 -0
  55. package/src/stories/FormatRelativeTime.stories.tsx +116 -0
  56. package/src/stories/Grid.stories.tsx +197 -0
  57. package/src/stories/Icon.stories.tsx +175 -0
  58. package/src/stories/MultiSelect.stories.tsx +1 -1
  59. package/src/stories/PageHeader.stories.tsx +102 -0
  60. package/src/stories/Portal.stories.tsx +189 -0
  61. package/src/stories/Presence.stories.tsx +228 -0
  62. package/src/stories/ProgressStack.stories.tsx +287 -0
  63. package/src/stories/Select.stories.tsx +25 -0
  64. package/src/stories/Separator.stories.tsx +3 -0
  65. package/src/stories/Slider.stories.tsx +54 -5
  66. package/src/stories/Sparkline.stories.tsx +3 -0
  67. package/src/stories/Textarea.stories.tsx +18 -0
  68. package/src/stories/story-groups.json +14 -5
  69. package/src/styles.css +133 -12
@@ -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";
@@ -0,0 +1,261 @@
1
+ import * as React from "react";
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ import { AnnouncementBar } from "@behavioral-agentic-design-system/core/components/ui/announcement-bar";
4
+
5
+ /**
6
+ * AnnouncementBar is a full-width persistent strip for page-level or
7
+ * site-level messages: maintenance windows, feature launches, free-tier
8
+ * limits, service disruptions, cookie/consent notices.
9
+ *
10
+ * How it differs from the rest of the feedback family:
11
+ * - Alert: inline, role="alert", nested inside content
12
+ * - Notification: persisted feed item, inside an inbox/drawer
13
+ * - Sonner: ephemeral auto-dismissing toast overlay
14
+ * - Callout: editorial annotation inside prose
15
+ * - AnnouncementBar: full-width strip intended to sit ABOVE the main shell.
16
+ * It persists until explicitly dismissed or until the triggering condition
17
+ * clears. It is NOT ephemeral, and it is not inline.
18
+ *
19
+ * Five variants — default / info / success / warning / destructive — share
20
+ * the same intent family as Alert and Notification but with a full-bleed
21
+ * `role="region"` and no action row or inline placement constraints.
22
+ */
23
+ const meta: Meta<typeof AnnouncementBar> = {
24
+ title: "Components/Feedback/AnnouncementBar",
25
+ component: AnnouncementBar,
26
+ parameters: { layout: "fullscreen" },
27
+ tags: ["autodocs"],
28
+ argTypes: {
29
+ variant: {
30
+ control: "select",
31
+ options: ["default", "info", "success", "warning", "destructive"],
32
+ },
33
+ },
34
+ };
35
+
36
+ export default meta;
37
+ type Story = StoryObj<typeof meta>;
38
+
39
+ // ─── Helpers ──────────────────────────────────────────────────────────────────
40
+
41
+ function DismissWrapper({ children }: { children: (onDismiss: () => void, dismissed: boolean) => React.ReactNode }) {
42
+ const [dismissed, setDismissed] = React.useState(false);
43
+ return (
44
+ <div>
45
+ {children(() => setDismissed(true), dismissed)}
46
+ {dismissed && (
47
+ <div className="flex items-center justify-center py-8 text-sm text-muted-foreground">
48
+ Bar dismissed — refresh to restore
49
+ </div>
50
+ )}
51
+ </div>
52
+ );
53
+ }
54
+
55
+ // ─── Stories ──────────────────────────────────────────────────────────────────
56
+
57
+ export const Default: Story = {
58
+ args: {
59
+ variant: "default",
60
+ "aria-label": "Announcement",
61
+ },
62
+ render: (args) => (
63
+ <AnnouncementBar {...args}>
64
+ BADS v2.4 is now available with 12 new components and a refreshed color
65
+ token surface.
66
+ </AnnouncementBar>
67
+ ),
68
+ };
69
+
70
+ export const Variant_Default: Story = {
71
+ parameters: { controls: { disable: true } }, render: () => (
72
+ <AnnouncementBar variant="default">
73
+ BADS v2.4 is now available — the{" "}
74
+ <span className="font-semibold">ProgressStack</span>,{" "}
75
+ <span className="font-semibold">Callout</span>, and{" "}
76
+ <span className="font-semibold">AnnouncementBar</span> primitives ship in
77
+ this release.
78
+ </AnnouncementBar>
79
+ ),
80
+ };
81
+
82
+ export const Variant_Info: Story = {
83
+ parameters: { controls: { disable: true } }, render: () => (
84
+ <AnnouncementBar variant="info" aria-label="Maintenance notice">
85
+ Scheduled maintenance on Sunday 2026-09-21 from 02:00–04:00 CDT. The
86
+ design token API will be read-only during that window.
87
+ </AnnouncementBar>
88
+ ),
89
+ };
90
+
91
+ export const Variant_Success: Story = {
92
+ parameters: { controls: { disable: true } }, render: () => (
93
+ <AnnouncementBar variant="success" aria-label="Incident resolved">
94
+ Incident resolved — the BADS npm registry is fully operational. Build
95
+ times are back to baseline.
96
+ </AnnouncementBar>
97
+ ),
98
+ };
99
+
100
+ export const Variant_Warning: Story = {
101
+ parameters: { controls: { disable: true } }, render: () => (
102
+ <AnnouncementBar variant="warning" aria-label="Deprecation notice">
103
+ <span className="font-semibold">Deprecation:</span> The{" "}
104
+ <code className="rounded bg-black/10 px-1 py-px font-mono text-xs dark:bg-white/10">
105
+ impactLevel
106
+ </code>{" "}
107
+ prop on Notification is removed in v3. Migrate to{" "}
108
+ <code className="rounded bg-black/10 px-1 py-px font-mono text-xs dark:bg-white/10">
109
+ variant
110
+ </code>{" "}
111
+ before upgrading.
112
+ </AnnouncementBar>
113
+ ),
114
+ };
115
+
116
+ export const Variant_Destructive: Story = {
117
+ parameters: { controls: { disable: true } }, render: () => (
118
+ <AnnouncementBar variant="destructive" aria-label="Active incident">
119
+ Partial outage affecting the Night Shift pipeline — automated component
120
+ builds are paused. Manual PRs are unaffected.
121
+ </AnnouncementBar>
122
+ ),
123
+ };
124
+
125
+ export const AllVariants: Story = {
126
+ parameters: { controls: { disable: true } }, render: () => (
127
+ <div className="flex flex-col">
128
+ <AnnouncementBar variant="default">
129
+ BADS v2.4 — ProgressStack, Callout, and AnnouncementBar now available.
130
+ </AnnouncementBar>
131
+ <AnnouncementBar variant="info">
132
+ Scheduled maintenance Sunday 2026-09-21 02:00–04:00 CDT.
133
+ </AnnouncementBar>
134
+ <AnnouncementBar variant="success">
135
+ Incident resolved — build pipeline fully operational.
136
+ </AnnouncementBar>
137
+ <AnnouncementBar variant="warning">
138
+ Deprecation: <code className="font-mono text-xs">impactLevel</code> is
139
+ removed in v3. Migrate to{" "}
140
+ <code className="font-mono text-xs">variant</code>.
141
+ </AnnouncementBar>
142
+ <AnnouncementBar variant="destructive">
143
+ Partial outage — Night Shift component builds paused.
144
+ </AnnouncementBar>
145
+ </div>
146
+ ),
147
+ };
148
+
149
+ export const WithAction: Story = {
150
+ parameters: { controls: { disable: true } }, render: () => (
151
+ <AnnouncementBar
152
+ variant="default"
153
+ action={
154
+ <a
155
+ href="#changelog"
156
+ className="rounded-sm font-semibold underline underline-offset-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-current focus-visible:ring-offset-1"
157
+ >
158
+ View changelog
159
+ </a>
160
+ }
161
+ >
162
+ BADS v2.4 ships 12 new components, including ProgressStack and Callout.
163
+ </AnnouncementBar>
164
+ ),
165
+ };
166
+
167
+ export const Dismissible: Story = {
168
+ parameters: { controls: { disable: true } }, render: () => (
169
+ <DismissWrapper>
170
+ {(onDismiss, dismissed) =>
171
+ !dismissed ? (
172
+ <AnnouncementBar
173
+ variant="info"
174
+ aria-label="Free plan limit notice"
175
+ onDismiss={onDismiss}
176
+ >
177
+ You're on the free plan. Fork limit: 3 active engagements.
178
+ </AnnouncementBar>
179
+ ) : null
180
+ }
181
+ </DismissWrapper>
182
+ ),
183
+ };
184
+
185
+ export const DismissibleWithAction: Story = {
186
+ parameters: { controls: { disable: true } }, render: () => (
187
+ <DismissWrapper>
188
+ {(onDismiss, dismissed) =>
189
+ !dismissed ? (
190
+ <AnnouncementBar
191
+ variant="warning"
192
+ aria-label="Deprecation warning"
193
+ onDismiss={onDismiss}
194
+ action={
195
+ <a
196
+ href="#migration"
197
+ className="rounded-sm font-semibold underline underline-offset-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-current focus-visible:ring-offset-1"
198
+ >
199
+ Migration guide
200
+ </a>
201
+ }
202
+ >
203
+ <span className="font-semibold">Breaking change in v3:</span> The{" "}
204
+ <code className="rounded bg-black/10 px-1 py-px font-mono text-xs dark:bg-white/10">
205
+ size
206
+ </code>{" "}
207
+ prop on Button is renamed to{" "}
208
+ <code className="rounded bg-black/10 px-1 py-px font-mono text-xs dark:bg-white/10">
209
+ buttonSize
210
+ </code>
211
+ .
212
+ </AnnouncementBar>
213
+ ) : null
214
+ }
215
+ </DismissWrapper>
216
+ ),
217
+ };
218
+
219
+ export const NoIcon: Story = {
220
+ parameters: { controls: { disable: true } }, render: () => (
221
+ <AnnouncementBar variant="info" icon={null} aria-label="Feature notice">
222
+ Pass{" "}
223
+ <code className="rounded bg-black/10 px-1 py-px font-mono text-xs dark:bg-white/10">
224
+ icon={"{null}"}
225
+ </code>{" "}
226
+ to suppress the default icon and let the background tint carry the variant
227
+ signal.
228
+ </AnnouncementBar>
229
+ ),
230
+ };
231
+
232
+ export const RealisticUse: Story = {
233
+ parameters: { controls: { disable: true } }, render: () => (
234
+ <div className="min-h-[300px] bg-background">
235
+ {/* The bar sits above the shell */}
236
+ <AnnouncementBar
237
+ variant="default"
238
+ aria-label="Release announcement"
239
+ action={
240
+ <a
241
+ href="#changelog"
242
+ className="rounded-sm font-semibold underline underline-offset-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-current focus-visible:ring-offset-1"
243
+ >
244
+ What's new →
245
+ </a>
246
+ }
247
+ >
248
+ BADS v2.4 — ProgressStack, Callout &amp; AnnouncementBar are live.
249
+ </AnnouncementBar>
250
+
251
+ {/* Mock shell below the bar */}
252
+ <div className="border-b px-6 py-3 flex items-center gap-3">
253
+ <span className="font-semibold text-sm">BADS</span>
254
+ <span className="text-xs text-muted-foreground">Design System</span>
255
+ </div>
256
+ <div className="px-6 py-8 text-sm text-muted-foreground">
257
+ Main content area — the bar sits above, outside the layout shell.
258
+ </div>
259
+ </div>
260
+ ),
261
+ };
@@ -14,6 +14,9 @@ import { Badge } from "@behavioral-agentic-design-system/core/components/ui/badg
14
14
  * Size ladder (peer parity: Mantine size, MUI Chip size, Chakra size):
15
15
  * sm = dense inline labels, default = unchanged, lg = prominent surfaces.
16
16
  * BADS text-xs = 14px and text-sm = 16px — both meet the AAA 14px floor.
17
+ *
18
+ * Status variant borders are `!`-forced (see the recipe-note in badge.tsx)
19
+ * — an override needs the same importance, e.g. `border-transparent!`.
17
20
  */
18
21
  const meta: Meta<typeof Badge> = {
19
22
  title: "Components/Badges and avatars/Badge",
@@ -1,6 +1,6 @@
1
1
  // Note: calendar day cells use the shadcn default font-normal weight (see the
2
2
  // `allow-font-normal-small` escape hatch in calendar.tsx). A font-medium bump to
3
- // satisfy the SADS-1 weight floor is a deferred design decision on this shared
3
+ // satisfy the BADS-WEIGHT floor is a deferred design decision on this shared
4
4
  // primitive, not a mechanical fix.
5
5
  //
6
6
  // react-day-picker v10: the grid element's classNames key is `month_grid`
@@ -0,0 +1,219 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { SparklesIcon } from "lucide-react";
3
+ import { Callout } from "@behavioral-agentic-design-system/core/components/ui/callout";
4
+ import { Code } from "@behavioral-agentic-design-system/core/components/ui/code";
5
+
6
+ /**
7
+ * Callout is the documentation/editorial aside that highlights contextual
8
+ * information inside prose — not system feedback.
9
+ *
10
+ * Use it for the note-about-a-gotcha, the tip-about-a-shortcut, the
11
+ * warning-before-a-destructive-migration. Five variants (note / tip /
12
+ * warning / danger / info) share the same intent family as Alert and
13
+ * Notification but with an `<aside>` semantic and no dismiss or action row.
14
+ *
15
+ * Body content is a rich slot — headings, lists, inline code, and multiple
16
+ * paragraphs all render correctly inside the body.
17
+ */
18
+ const meta: Meta<typeof Callout> = {
19
+ title: "Components/Feedback/Callout",
20
+ component: Callout,
21
+ parameters: { layout: "centered" },
22
+ tags: ["autodocs"],
23
+ argTypes: {
24
+ variant: {
25
+ control: "select",
26
+ options: ["note", "tip", "warning", "danger", "info"],
27
+ },
28
+ },
29
+ };
30
+
31
+ export default meta;
32
+ type Story = StoryObj<typeof meta>;
33
+
34
+ // ─── Stories ──────────────────────────────────────────────────────────────────
35
+
36
+ export const Default: Story = {
37
+ args: {
38
+ variant: "note",
39
+ title: "Note",
40
+ },
41
+ render: (args) => (
42
+ <div className="w-[480px]">
43
+ <Callout {...args}>
44
+ The component registry is the single source of truth. Never hardcode
45
+ values that live in <Code>tokens.json</Code> — changes propagate via{" "}
46
+ <Code>pnpm build:tokens</Code>.
47
+ </Callout>
48
+ </div>
49
+ ),
50
+ };
51
+
52
+ export const Variant_Note: Story = {
53
+ parameters: { controls: { disable: true } }, render: () => (
54
+ <div className="w-[480px]">
55
+ <Callout variant="note" title="Note">
56
+ Run <Code>pnpm wcag:audit</Code> before any PR that touches color
57
+ tokens to catch contrast regressions against the AAA floor.
58
+ </Callout>
59
+ </div>
60
+ ),
61
+ };
62
+
63
+ export const Variant_Tip: Story = {
64
+ parameters: { controls: { disable: true } }, render: () => (
65
+ <div className="w-[480px]">
66
+ <Callout variant="tip" title="Tip">
67
+ Set <Code>forceMount</Code> on inactive <Code>TabsContent</Code> panels
68
+ and wrap them in <Code>TabsPanels</Code> to avoid iframe cold-load on
69
+ every tab switch.
70
+ </Callout>
71
+ </div>
72
+ ),
73
+ };
74
+
75
+ export const Variant_Warning: Story = {
76
+ parameters: { controls: { disable: true } }, render: () => (
77
+ <div className="w-[480px]">
78
+ <Callout variant="warning" title="Warning">
79
+ The <Code>duration-fast</Code> and <Code>duration-base</Code> Tailwind
80
+ utilities compile to nothing in v4 — use inline{" "}
81
+ <Code>{`style={{ transitionDuration: "var(--duration-fast)" }}`}</Code>{" "}
82
+ instead.
83
+ </Callout>
84
+ </div>
85
+ ),
86
+ };
87
+
88
+ export const Variant_Danger: Story = {
89
+ parameters: { controls: { disable: true } }, render: () => (
90
+ <div className="w-[480px]">
91
+ <Callout variant="danger" title="Breaking change in v3">
92
+ The <Code>size</Code> prop on Button was renamed to{" "}
93
+ <Code>buttonSize</Code>. Update every call site before upgrading.
94
+ </Callout>
95
+ </div>
96
+ ),
97
+ };
98
+
99
+ export const Variant_Info: Story = {
100
+ parameters: { controls: { disable: true } }, render: () => (
101
+ <div className="w-[480px]">
102
+ <Callout variant="info" title="WCAG 3.0 status">
103
+ The March 2026 Working Draft renamed "outcomes" to "requirements". No
104
+ conformance action is required until the Candidate Recommendation
105
+ (expected Q4 2027). BADS's current AAA floor maps cleanly to the
106
+ Gold tier.
107
+ </Callout>
108
+ </div>
109
+ ),
110
+ };
111
+
112
+ export const AllVariants: Story = {
113
+ parameters: { controls: { disable: true } }, render: () => (
114
+ <div className="flex w-[480px] flex-col gap-4">
115
+ <Callout variant="note" title="Note">
116
+ General information or contextual aside.
117
+ </Callout>
118
+ <Callout variant="tip" title="Tip">
119
+ A helpful shortcut or recommended practice.
120
+ </Callout>
121
+ <Callout variant="warning" title="Warning">
122
+ Caution: a risk or potential issue to be aware of.
123
+ </Callout>
124
+ <Callout variant="danger" title="Danger">
125
+ Stop: this path leads to data loss or a breaking change.
126
+ </Callout>
127
+ <Callout variant="info" title="Info">
128
+ Neutral reference that is neither an error nor a tip.
129
+ </Callout>
130
+ </div>
131
+ ),
132
+ };
133
+
134
+ export const NoTitle: Story = {
135
+ parameters: { controls: { disable: true } }, render: () => (
136
+ <div className="flex w-[480px] flex-col gap-4">
137
+ <Callout variant="note">
138
+ Icon alone signals the variant when the title is omitted.
139
+ </Callout>
140
+ <Callout variant="warning">
141
+ Passing a custom icon? Set <Code>strokeWidth={"{1.5}"}</Code> to stay
142
+ on-system.
143
+ </Callout>
144
+ </div>
145
+ ),
146
+ };
147
+
148
+ export const NoIcon: Story = {
149
+ parameters: { controls: { disable: true } }, render: () => (
150
+ <div className="w-[480px]">
151
+ <Callout variant="tip" icon={null} title="Styling tip">
152
+ Pass <Code>icon={"{null}"}</Code> to suppress the default icon and let
153
+ the title and background tint carry the variant signal.
154
+ </Callout>
155
+ </div>
156
+ ),
157
+ };
158
+
159
+ export const CustomIcon: Story = {
160
+ parameters: { controls: { disable: true } }, render: () => (
161
+ <div className="w-[480px]">
162
+ <Callout
163
+ variant="tip"
164
+ icon={<SparklesIcon strokeWidth={1.5} aria-hidden />}
165
+ title="Night Shift"
166
+ >
167
+ Night Shift runs daily at 06:00 CDT, audits the full system, and opens
168
+ draft PRs for low-risk mechanical fixes. See{" "}
169
+ <Code>CIRCADIAN.md</Code> for the full spec.
170
+ </Callout>
171
+ </div>
172
+ ),
173
+ };
174
+
175
+ export const RichContent: Story = {
176
+ parameters: { controls: { disable: true } }, render: () => (
177
+ <div className="w-[480px]">
178
+ <Callout variant="danger" title="Microanimation patterns to avoid">
179
+ <p>These patterns compile to nothing in Tailwind v4 and produce silent failures:</p>
180
+ <ul className="mt-2 list-disc pl-4 space-y-1 text-muted-foreground">
181
+ <li><Code>duration-fast</Code>, <Code>duration-base</Code>, <Code>duration-slow</Code></li>
182
+ <li><Code>duration-[var(--duration-fast)]</Code> (arbitrary-value form)</li>
183
+ <li>Inline <Code>transitionDuration: "200ms"</Code> (literal value bypasses tokens)</li>
184
+ </ul>
185
+ <p className="mt-2">
186
+ Use inline <Code>{`style={{ transitionDuration: "var(--duration-fast)" }}`}</Code>{" "}
187
+ instead.
188
+ </p>
189
+ </Callout>
190
+ </div>
191
+ ),
192
+ };
193
+
194
+ export const RealisticUse: Story = {
195
+ parameters: { controls: { disable: true } }, render: () => (
196
+ <div className="w-[560px] flex flex-col gap-5">
197
+ <h2 className="text-lg font-semibold">Rename a client fork</h2>
198
+ <p className="text-sm text-muted-foreground">
199
+ A fork is unrenamed if <Code>.client-identity.json</Code> does not
200
+ exist and <Code>brand.config.ts</Code> still reads{" "}
201
+ <Code>name: &quot;BADS&quot;</Code>.
202
+ </p>
203
+ <Callout variant="tip" title="Fast path">
204
+ Run <Code>pnpm rename &quot;Clap Design&quot; clap</Code> — the script
205
+ updates every reference in a single pass, then commit with{" "}
206
+ <Code>git add -A && git commit -m &quot;chore: rename to Clap Design&quot;</Code>.
207
+ </Callout>
208
+ <Callout variant="warning" title="After renaming">
209
+ Re-run <Code>pnpm install && pnpm build:tokens</Code> so the generated
210
+ CSS carries the new package namespace. Skipping this causes a silent
211
+ FOUC on first load.
212
+ </Callout>
213
+ <Callout variant="danger">
214
+ Never run <Code>pnpm rename</Code> on an already-renamed repo — it will
215
+ do nothing harmful but wastes time and produces a confusing diff.
216
+ </Callout>
217
+ </div>
218
+ ),
219
+ };
@@ -145,6 +145,10 @@ export const Variant_WithReferenceDot: Story = {
145
145
  ),
146
146
  };
147
147
 
148
+ // `animate={false}` freezes the chart at its final frame on demand. It is the
149
+ // same output reduced-motion users get automatically: ChartContainer reads the
150
+ // shared `useReducedMotion` hook (hooks/use-reduced-motion) and drops the
151
+ // entrance for them regardless of this prop.
148
152
  export const Variant_NoAnimation: Story = {
149
153
  render: () => (
150
154
  <ChartContainer config={twoSeriesConfig} className="h-56 w-[520px]" animate={false}>
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import type { Meta, StoryObj } from "@storybook/react";
3
+ import { userEvent, within, expect } from "storybook/test";
3
4
  import { ColorPicker } from "@behavioral-agentic-design-system/core/components/ui/color-picker";
4
5
  import { Card, CardContent, CardHeader, CardTitle } from "@behavioral-agentic-design-system/core/components/ui/card";
5
6
  import { Label } from "@behavioral-agentic-design-system/core/components/ui/label";
@@ -77,6 +78,28 @@ export const AddViaWheel: Story = {
77
78
  </div>
78
79
  );
79
80
  },
81
+ // "Add color" is the wheel popover's committing action and it is full-width,
82
+ // which is the shape BADS-2b flags: a w-full Button is the primary action of
83
+ // its container, and at the default size that is a 36px target under SC
84
+ // 2.5.5's 44px floor. The class fix is invisible until something renders it,
85
+ // so measure the rendered height rather than trusting the className.
86
+ // Two traps here, both worth keeping in the comment because both cost a
87
+ // round to find:
88
+ //
89
+ // 1. The wheel opens in a Radix portal at <body>, OUTSIDE canvasElement, so
90
+ // the query has to run against the document.
91
+ // 2. Assert the COMPUTED min-height, not getBoundingClientRect(). The popover
92
+ // enters with zoom-in-95, so the rect reads the animated box: 41.8px on
93
+ // one run and 43.4px on the next, against a design value of 44. That is
94
+ // corrections #023's "a reading taken mid-animation is not a design value"
95
+ // in miniature, and a gate that reports a different number each run
96
+ // teaches people to re-run it until it is green.
97
+ play: async ({ canvasElement }) => {
98
+ const canvas = within(canvasElement);
99
+ await userEvent.click(canvas.getByRole("button", { name: /add a custom color/i }));
100
+ const add = await within(document.body).findByRole("button", { name: /^add color$/i });
101
+ await expect(parseFloat(getComputedStyle(add).minHeight)).toBeGreaterThanOrEqual(44);
102
+ },
80
103
  };
81
104
 
82
105
  export const AddOnlyWheel: Story = {