@behavioral-agentic-design-system/core 0.28.0 → 0.30.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 (106) hide show
  1. package/package.json +2 -2
  2. package/scripts/a11y-lint.cjs +78 -9
  3. package/scripts/build-tokens.cjs +273 -15
  4. package/scripts/wcag-audit.cjs +67 -11
  5. package/src/api/layers/file.ts +1 -0
  6. package/src/app/font-ready.tsx +6 -5
  7. package/src/app/layout.tsx +54 -3
  8. package/src/app/preview/components/page.tsx +5679 -3073
  9. package/src/app/preview/health/page.tsx +201 -0
  10. package/src/app/preview/layout.tsx +4 -1
  11. package/src/app/preview/showcase-filter.tsx +66 -0
  12. package/src/app/preview/tab-replay.tsx +63 -0
  13. package/src/app/shell.tsx +74 -18
  14. package/src/components/customize/save-bar.tsx +19 -6
  15. package/src/components/docs-tab.tsx +36 -24
  16. package/src/components/layers-tab.tsx +37 -5
  17. package/src/components/ui/alert.tsx +12 -0
  18. package/src/components/ui/badge.tsx +19 -0
  19. package/src/components/ui/button.tsx +10 -0
  20. package/src/components/ui/chat-marker.tsx +120 -0
  21. package/src/components/ui/checkbox.tsx +9 -1
  22. package/src/components/ui/close-button.tsx +71 -0
  23. package/src/components/ui/combobox.tsx +62 -3
  24. package/src/components/ui/container.tsx +65 -0
  25. package/src/components/ui/date-field.tsx +368 -0
  26. package/src/components/ui/drawer.tsx +334 -0
  27. package/src/components/ui/file-button.tsx +145 -0
  28. package/src/components/ui/floating-indicator.tsx +217 -0
  29. package/src/components/ui/format-byte.tsx +113 -0
  30. package/src/components/ui/index.ts +21 -0
  31. package/src/components/ui/input-clear-button.tsx +52 -0
  32. package/src/components/ui/input.tsx +39 -20
  33. package/src/components/ui/keyboard-shortcut.tsx +146 -0
  34. package/src/components/ui/loading-dots.tsx +99 -0
  35. package/src/components/ui/month-picker.tsx +296 -0
  36. package/src/components/ui/multi-select.tsx +35 -19
  37. package/src/components/ui/nav-link.tsx +200 -0
  38. package/src/components/ui/navigation-rail.tsx +256 -0
  39. package/src/components/ui/notification.tsx +20 -0
  40. package/src/components/ui/password-input.tsx +34 -1
  41. package/src/components/ui/progress.tsx +15 -1
  42. package/src/components/ui/prose.tsx +62 -0
  43. package/src/components/ui/questionnaire.tsx +334 -0
  44. package/src/components/ui/result.tsx +151 -0
  45. package/src/components/ui/rolling-number.tsx +1 -0
  46. package/src/components/ui/sidebar.tsx +5 -0
  47. package/src/components/ui/simple-grid.tsx +110 -0
  48. package/src/components/ui/skeleton.tsx +52 -3
  49. package/src/components/ui/squircle.tsx +274 -0
  50. package/src/components/ui/stack.tsx +105 -0
  51. package/src/components/ui/status-badge.tsx +93 -0
  52. package/src/components/ui/tabs.tsx +34 -7
  53. package/src/components/ui/tag.tsx +46 -5
  54. package/src/components/ui/textarea.tsx +5 -0
  55. package/src/components/ui/theme-icon.tsx +138 -0
  56. package/src/components/ui/timeline.tsx +27 -10
  57. package/src/components/ui/tooltip.tsx +12 -1
  58. package/src/components/ui/tree-select.tsx +386 -0
  59. package/src/components/ui/year-picker.tsx +307 -0
  60. package/src/data/docs-index.ts +12 -0
  61. package/src/hooks/use-global-primary-color.ts +57 -6
  62. package/src/lib/get-icon-color.ts +66 -0
  63. package/src/stories/Alert.stories.tsx +31 -1
  64. package/src/stories/Badge.stories.tsx +63 -6
  65. package/src/stories/Button.stories.tsx +3 -0
  66. package/src/stories/ChatMarker.stories.tsx +59 -0
  67. package/src/stories/Checkbox.stories.tsx +5 -0
  68. package/src/stories/CloseButton.stories.tsx +65 -0
  69. package/src/stories/Combobox.stories.tsx +74 -3
  70. package/src/stories/Container.stories.tsx +134 -0
  71. package/src/stories/DateField.stories.tsx +114 -0
  72. package/src/stories/Drawer.stories.tsx +211 -0
  73. package/src/stories/FileButton.stories.tsx +117 -0
  74. package/src/stories/FloatingIndicator.stories.tsx +343 -0
  75. package/src/stories/FormatByte.stories.tsx +142 -0
  76. package/src/stories/Input.stories.tsx +94 -0
  77. package/src/stories/InputClearButton.stories.tsx +53 -0
  78. package/src/stories/KeyboardShortcut.stories.tsx +87 -0
  79. package/src/stories/LoadingDots.stories.tsx +73 -0
  80. package/src/stories/MonthPicker.stories.tsx +99 -0
  81. package/src/stories/MultiSelect.stories.tsx +7 -1
  82. package/src/stories/NavLink.stories.tsx +213 -0
  83. package/src/stories/NavigationRail.stories.tsx +413 -0
  84. package/src/stories/Notification.stories.tsx +53 -0
  85. package/src/stories/PasswordInput.stories.tsx +21 -0
  86. package/src/stories/Progress.stories.tsx +38 -0
  87. package/src/stories/Prose.stories.tsx +232 -0
  88. package/src/stories/Questionnaire.stories.tsx +287 -0
  89. package/src/stories/Result.stories.tsx +145 -0
  90. package/src/stories/RollingNumber.stories.tsx +1 -1
  91. package/src/stories/Sidebar.stories.tsx +2 -0
  92. package/src/stories/SimpleGrid.stories.tsx +130 -0
  93. package/src/stories/Skeleton.stories.tsx +62 -1
  94. package/src/stories/Squircle.stories.tsx +127 -0
  95. package/src/stories/Stack.stories.tsx +140 -0
  96. package/src/stories/StatusBadge.stories.tsx +125 -0
  97. package/src/stories/Tabs.stories.tsx +56 -1
  98. package/src/stories/Tag.stories.tsx +31 -0
  99. package/src/stories/Textarea.stories.tsx +2 -0
  100. package/src/stories/ThemeIcon.stories.tsx +97 -0
  101. package/src/stories/Timeline.stories.tsx +69 -0
  102. package/src/stories/Tooltip.stories.tsx +18 -0
  103. package/src/stories/TreeSelect.stories.tsx +222 -0
  104. package/src/stories/YearPicker.stories.tsx +100 -0
  105. package/src/styles.css +289 -15
  106. package/src/tokens.json +96 -1
@@ -0,0 +1,232 @@
1
+ import * as React from "react"
2
+ import type { Meta, StoryObj } from "@storybook/react"
3
+ import { Prose } from "@behavioral-agentic-design-system/core/components/ui/prose"
4
+ import {
5
+ Card,
6
+ CardContent,
7
+ } from "@behavioral-agentic-design-system/core/components/ui/card"
8
+
9
+ const meta: Meta<typeof Prose> = {
10
+ title: "Components/Prose",
11
+ component: Prose,
12
+ parameters: { layout: "centered" },
13
+ tags: ["autodocs"],
14
+ argTypes: {
15
+ asChild: { control: "boolean" },
16
+ },
17
+ }
18
+
19
+ export default meta
20
+ type Story = StoryObj<typeof meta>
21
+
22
+ // Content pulled from content/personas/bads.json (real-content rule) —
23
+ // names, metrics, and jargon come from the persona pool; the article copy
24
+ // is the BADS stack described in its own voice. Never Lorem, never Acme.
25
+
26
+ export const Default: Story = {
27
+ render: () => (
28
+ <Prose className="max-w-prose">
29
+ <h2>Why design tokens</h2>
30
+ <p>
31
+ A token is a named value — color, spacing, font size — that can change
32
+ without editing component code. When a brand color moves, one edit to{" "}
33
+ <code>tokens.json</code> propagates to every surface that references{" "}
34
+ <code>--primary</code>.
35
+ </p>
36
+ <p>
37
+ The alternative is token drift: forty-one hardcoded hex values across
38
+ three repos, each one a slightly different navy. Jordan Reeves reads
39
+ component source before adopting anything, and will absolutely bounce
40
+ a PR for a hardcoded hex value.
41
+ </p>
42
+ </Prose>
43
+ ),
44
+ }
45
+
46
+ export const WithHeadings: Story = {
47
+ render: () => (
48
+ <Prose className="max-w-prose">
49
+ <h1>Getting started with BADS</h1>
50
+ <p>
51
+ Fork it, rename it, customize the brand colors, and start building.
52
+ The stack is ten layers, all shipped.
53
+ </p>
54
+ <h2>The semantic layer</h2>
55
+ <p>
56
+ Semantic tokens are named for purpose — <code>--destructive</code>,
57
+ not a hex value — so intent survives a rebrand.
58
+ </p>
59
+ <h3>Primitives underneath</h3>
60
+ <p>
61
+ Every semantic token aliases a primitive scale entry, and the build
62
+ script resolves the chain at generation time.
63
+ </p>
64
+ <h4>What that buys you</h4>
65
+ <p>
66
+ Designers update one place; every component, story, and fork follows.
67
+ </p>
68
+ </Prose>
69
+ ),
70
+ }
71
+
72
+ export const WithCode: Story = {
73
+ render: () => (
74
+ <Prose className="max-w-prose">
75
+ <p>
76
+ Regenerate both CSS files after any token edit — the generated files
77
+ carry a banner header and are never edited by hand:
78
+ </p>
79
+ <pre>
80
+ <code>{`pnpm build:tokens
81
+ # ✓ wrote packages/core/src/styles.css
82
+ # ✓ wrote styles/globals.css`}</code>
83
+ </pre>
84
+ <p>
85
+ Components reference motion through the token surface, e.g.{" "}
86
+ <code>var(--duration-fast)</code> with <code>var(--ease-out)</code> —
87
+ a <code>180ms transition</code> is a token decision, not a component
88
+ one.
89
+ </p>
90
+ </Prose>
91
+ ),
92
+ }
93
+
94
+ export const WithLists: Story = {
95
+ render: () => (
96
+ <Prose className="max-w-prose">
97
+ <p>Every registry entry ships with an a11y contract covering:</p>
98
+ <ul>
99
+ <li>Contrast — 7:1 normal text, the AAA floor</li>
100
+ <li>Type — 14px minimum, no exceptions</li>
101
+ <li>Touch targets — 44×44px on every flow-changing control</li>
102
+ <li>
103
+ Focus — visible ring, 2px offset, never removed
104
+ <ul>
105
+ <li>Nested detail: the ring token is luminance-tuned per surface</li>
106
+ </ul>
107
+ </li>
108
+ </ul>
109
+ <p>Adopting a fork takes three steps:</p>
110
+ <ol>
111
+ <li>Run the rename script with your display name and slug</li>
112
+ <li>Point the brand config at your palette</li>
113
+ <li>Regenerate tokens and commit</li>
114
+ </ol>
115
+ </Prose>
116
+ ),
117
+ }
118
+
119
+ export const WithBlockquote: Story = {
120
+ render: () => (
121
+ <Prose className="max-w-prose">
122
+ <p>
123
+ Seo-yun Park wrote the team&rsquo;s first token pipeline, and her
124
+ review note became the working rule for every new primitive:
125
+ </p>
126
+ <blockquote>
127
+ <p>
128
+ If a primitive needs a paragraph of explanation, the API is wrong.
129
+ </p>
130
+ </blockquote>
131
+ <p>
132
+ The registry enforces the spirit of that rule: at most four
133
+ non-passthrough props before a component must split.
134
+ </p>
135
+ </Prose>
136
+ ),
137
+ }
138
+
139
+ export const WithTable: Story = {
140
+ render: () => (
141
+ <Prose className="max-w-prose">
142
+ <p>The ROI report reads these costs straight from the registry:</p>
143
+ <table>
144
+ <thead>
145
+ <tr>
146
+ <th>Complexity</th>
147
+ <th>Build hours</th>
148
+ <th>Maintenance / yr</th>
149
+ </tr>
150
+ </thead>
151
+ <tbody>
152
+ <tr>
153
+ <td>Primitive</td>
154
+ <td>8</td>
155
+ <td>3</td>
156
+ </tr>
157
+ <tr>
158
+ <td>Composite</td>
159
+ <td>32</td>
160
+ <td>10</td>
161
+ </tr>
162
+ <tr>
163
+ <td>Pattern</td>
164
+ <td>80</td>
165
+ <td>16</td>
166
+ </tr>
167
+ </tbody>
168
+ </table>
169
+ <p>
170
+ Client savings to date: $182,450 across active forks, with 1,432
171
+ build hours avoided.
172
+ </p>
173
+ </Prose>
174
+ ),
175
+ }
176
+
177
+ // asChild swaps the wrapper <div> for the child element, so the landmark
178
+ // is the consumer's choice — here a semantic <article>.
179
+ export const AsChild_Usage: Story = {
180
+ render: () => (
181
+ <Prose asChild className="max-w-prose">
182
+ <article aria-label="Release notes">
183
+ <h2>Release notes — 2026-05-26</h2>
184
+ <p>
185
+ This release adds three primitives to the registry and tightens the
186
+ focus-ring offset to 2px across every interactive component.
187
+ </p>
188
+ </article>
189
+ </Prose>
190
+ ),
191
+ }
192
+
193
+ export const RealisticUse: Story = {
194
+ render: () => (
195
+ <Card className="w-[560px]">
196
+ <CardContent className="pt-6">
197
+ <Prose>
198
+ <h2>Adoption review, 2026-05-26</h2>
199
+ <p>
200
+ 36 components, all passing AAA contrast. Last token change was 3
201
+ days ago. Story coverage is at 98.4%. Read the full audit at{" "}
202
+ <a href="https://design.bads.com/share/tokens-v2-proposal">
203
+ design.bads.com/share/tokens-v2-proposal
204
+ </a>
205
+ .
206
+ </p>
207
+ <h3>What changed</h3>
208
+ <ul>
209
+ <li>
210
+ Visual regression now runs on every push — Chromatic baselines
211
+ refreshed
212
+ </li>
213
+ <li>
214
+ The orphan-token sweep scanned 12,417 references and flagged
215
+ zero unused entries
216
+ </li>
217
+ </ul>
218
+ <blockquote>
219
+ <p>
220
+ Jordan reads component source before adopting anything, and
221
+ will absolutely bounce a PR for a hardcoded hex value.
222
+ </p>
223
+ </blockquote>
224
+ <p>
225
+ Next check-in lands after the <code>tokens-v2</code> proposal
226
+ review with the Austin design systems team.
227
+ </p>
228
+ </Prose>
229
+ </CardContent>
230
+ </Card>
231
+ ),
232
+ }
@@ -0,0 +1,287 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import * as React from "react"
3
+ import {
4
+ Questionnaire,
5
+ type QuestionnaireQuestion,
6
+ } from "@behavioral-agentic-design-system/core/components/ui/questionnaire"
7
+
8
+ const meta: Meta<typeof Questionnaire> = {
9
+ title: "Components/Questionnaire",
10
+ component: Questionnaire,
11
+ parameters: {
12
+ layout: "centered",
13
+ docs: {
14
+ description: {
15
+ component:
16
+ "One-question-at-a-time form primitive for agentic clarification prompts, onboarding flows, intake forms, and configuration wizards. Supports single-choice (radio), multiple-choice (checkboxes), freeform (textarea), and skippable questions. Questions animate in from the travel direction on each step change. Completion announces via role=status + aria-live=polite.",
17
+ },
18
+ },
19
+ },
20
+ }
21
+ export default meta
22
+ type Story = StoryObj<typeof Questionnaire>
23
+
24
+ // ─── Single question ──────────────────────────────────────────────────────────
25
+
26
+ export const Default: Story = {
27
+ render: () => (
28
+ <div className="w-96">
29
+ <Questionnaire
30
+ questions={[
31
+ {
32
+ id: "role",
33
+ prompt: "What best describes your current role?",
34
+ type: "single",
35
+ options: [
36
+ { value: "designer", label: "Designer" },
37
+ { value: "engineer", label: "Engineer" },
38
+ { value: "product", label: "Product manager" },
39
+ { value: "founder", label: "Founder or executive" },
40
+ ],
41
+ },
42
+ ]}
43
+ onComplete={(answers) => console.log("Done", answers)}
44
+ />
45
+ </div>
46
+ ),
47
+ }
48
+
49
+ // ─── Variant: single choice multi-step ───────────────────────────────────────
50
+
51
+ const ONBOARDING_SINGLE: QuestionnaireQuestion[] = [
52
+ {
53
+ id: "team-size",
54
+ prompt: "How large is your design team?",
55
+ type: "single",
56
+ options: [
57
+ { value: "solo", label: "Just me" },
58
+ { value: "small", label: "2 – 5 people" },
59
+ { value: "medium", label: "6 – 20 people" },
60
+ { value: "large", label: "20+ people" },
61
+ ],
62
+ },
63
+ {
64
+ id: "ship-cadence",
65
+ prompt: "How often does your team ship design-system updates?",
66
+ type: "single",
67
+ options: [
68
+ { value: "daily", label: "Daily or continuously" },
69
+ { value: "weekly", label: "Weekly" },
70
+ { value: "monthly", label: "Monthly" },
71
+ { value: "quarterly", label: "Quarterly or less" },
72
+ ],
73
+ },
74
+ {
75
+ id: "priority",
76
+ prompt: "What's your top design-system priority right now?",
77
+ type: "single",
78
+ options: [
79
+ { value: "tokens", label: "Token governance" },
80
+ { value: "a11y", label: "Accessibility compliance" },
81
+ { value: "onboarding", label: "Engineer onboarding speed" },
82
+ { value: "coverage", label: "Component coverage" },
83
+ ],
84
+ },
85
+ ]
86
+
87
+ export const Variant_Single: Story = {
88
+ render: () => {
89
+ const [answers, setAnswers] = React.useState<Record<string, string | string[] | null> | null>(null)
90
+ return (
91
+ <div className="w-96 space-y-4">
92
+ {answers ? (
93
+ <pre className="rounded-md bg-muted p-3 text-xs">{JSON.stringify(answers, null, 2)}</pre>
94
+ ) : (
95
+ <Questionnaire questions={ONBOARDING_SINGLE} onComplete={(a) => setAnswers(a)} />
96
+ )}
97
+ </div>
98
+ )
99
+ },
100
+ }
101
+
102
+ // ─── Variant: multiple choice ─────────────────────────────────────────────────
103
+
104
+ export const Variant_Multiple: Story = {
105
+ render: () => (
106
+ <div className="w-96">
107
+ <Questionnaire
108
+ questions={[
109
+ {
110
+ id: "frameworks",
111
+ prompt: "Which frameworks does your team use? Select all that apply.",
112
+ type: "multiple",
113
+ options: [
114
+ { value: "react", label: "React" },
115
+ { value: "vue", label: "Vue" },
116
+ { value: "svelte", label: "Svelte" },
117
+ { value: "angular", label: "Angular" },
118
+ { value: "other", label: "Other" },
119
+ ],
120
+ },
121
+ ]}
122
+ onComplete={(answers) => console.log("Done", answers)}
123
+ />
124
+ </div>
125
+ ),
126
+ }
127
+
128
+ // ─── Variant: freeform ────────────────────────────────────────────────────────
129
+
130
+ export const Variant_Freeform: Story = {
131
+ render: () => (
132
+ <div className="w-96">
133
+ <Questionnaire
134
+ questions={[
135
+ {
136
+ id: "challenge",
137
+ prompt: "What's your biggest design-system challenge right now?",
138
+ type: "freeform",
139
+ },
140
+ ]}
141
+ onComplete={(answers) => console.log("Done", answers)}
142
+ />
143
+ </div>
144
+ ),
145
+ }
146
+
147
+ // ─── Variant: skippable ───────────────────────────────────────────────────────
148
+
149
+ export const Variant_Skippable: Story = {
150
+ render: () => (
151
+ <div className="w-96">
152
+ <Questionnaire
153
+ questions={[
154
+ {
155
+ id: "role",
156
+ prompt: "What best describes your current role?",
157
+ type: "single",
158
+ options: [
159
+ { value: "designer", label: "Designer" },
160
+ { value: "engineer", label: "Engineer" },
161
+ { value: "product", label: "Product manager" },
162
+ { value: "founder", label: "Founder or executive" },
163
+ ],
164
+ },
165
+ {
166
+ id: "company",
167
+ prompt: "Which company are you at? (optional)",
168
+ type: "freeform",
169
+ skippable: true,
170
+ skipLabel: "Prefer not to say",
171
+ },
172
+ ]}
173
+ onComplete={(answers) => console.log("Done", answers)}
174
+ onSkip={(id) => console.log("Skipped", id)}
175
+ />
176
+ </div>
177
+ ),
178
+ }
179
+
180
+ // ─── Variant: mixed types ─────────────────────────────────────────────────────
181
+
182
+ const MIXED_QUESTIONS: QuestionnaireQuestion[] = [
183
+ {
184
+ id: "role",
185
+ prompt: "What best describes your current role?",
186
+ type: "single",
187
+ options: [
188
+ { value: "designer", label: "Designer" },
189
+ { value: "engineer", label: "Engineer" },
190
+ { value: "product", label: "Product manager" },
191
+ { value: "founder", label: "Founder or executive" },
192
+ ],
193
+ },
194
+ {
195
+ id: "tools",
196
+ prompt: "Which design tools does your team use? Select all that apply.",
197
+ type: "multiple",
198
+ options: [
199
+ { value: "figma", label: "Figma" },
200
+ { value: "sketch", label: "Sketch" },
201
+ { value: "framer", label: "Framer" },
202
+ { value: "storybook", label: "Storybook" },
203
+ ],
204
+ },
205
+ {
206
+ id: "goal",
207
+ prompt: "What would make BADS most useful for your team?",
208
+ type: "freeform",
209
+ skippable: true,
210
+ },
211
+ ]
212
+
213
+ export const Variant_Mixed: Story = {
214
+ render: () => {
215
+ const [answers, setAnswers] = React.useState<Record<string, string | string[] | null> | null>(null)
216
+ return (
217
+ <div className="w-96 space-y-4">
218
+ {answers ? (
219
+ <pre className="rounded-md bg-muted p-3 text-xs">{JSON.stringify(answers, null, 2)}</pre>
220
+ ) : (
221
+ <Questionnaire questions={MIXED_QUESTIONS} onComplete={(a) => setAnswers(a)} />
222
+ )}
223
+ </div>
224
+ )
225
+ },
226
+ }
227
+
228
+ // ─── RealisticUse: agent clarification prompt ─────────────────────────────────
229
+
230
+ const AGENT_QUESTIONS: QuestionnaireQuestion[] = [
231
+ {
232
+ id: "intent",
233
+ prompt: "What would you like to do with the tokens v2 proposal?",
234
+ type: "single",
235
+ options: [
236
+ { value: "review", label: "Schedule a review with the full team" },
237
+ { value: "approve", label: "Approve it as-is and move to implementation" },
238
+ { value: "revise", label: "Request revisions before moving forward" },
239
+ { value: "defer", label: "Defer until Q4 planning" },
240
+ ],
241
+ },
242
+ {
243
+ id: "stakeholders",
244
+ prompt: "Who else needs to be in the loop?",
245
+ type: "multiple",
246
+ options: [
247
+ { value: "riley", label: "Riley Okafor — brand lead" },
248
+ { value: "jordan", label: "Jordan Reeves — design systems" },
249
+ { value: "avery", label: "Avery Nakamura — engineering" },
250
+ { value: "morgan", label: "Morgan Castellano — product" },
251
+ ],
252
+ },
253
+ {
254
+ id: "notes",
255
+ prompt: "Any context you'd like added to the calendar invite? (optional)",
256
+ type: "freeform",
257
+ skippable: true,
258
+ skipLabel: "No context needed",
259
+ },
260
+ ]
261
+
262
+ export const RealisticUse: Story = {
263
+ render: () => {
264
+ const [answers, setAnswers] = React.useState<Record<string, string | string[] | null> | null>(null)
265
+ return (
266
+ <div className="w-[420px] rounded-xl border border-border bg-card p-6 shadow-sm">
267
+ <p className="mb-1 text-xs font-medium text-muted-foreground uppercase tracking-wide">
268
+ Agent · Clarify intent
269
+ </p>
270
+ {answers ? (
271
+ <div className="space-y-3">
272
+ <p className="text-sm font-medium text-foreground">
273
+ Got it. Scheduling the review with the selected stakeholders.
274
+ </p>
275
+ <pre className="rounded-md bg-muted p-3 text-xs">{JSON.stringify(answers, null, 2)}</pre>
276
+ </div>
277
+ ) : (
278
+ <Questionnaire
279
+ questions={AGENT_QUESTIONS}
280
+ onComplete={(a) => setAnswers(a)}
281
+ onSkip={(id) => console.log("Skipped", id)}
282
+ />
283
+ )}
284
+ </div>
285
+ )
286
+ },
287
+ }
@@ -0,0 +1,145 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { PartyPopper } from "lucide-react"
3
+
4
+ import { Result } from "@behavioral-agentic-design-system/core/components/ui/result"
5
+ import { Button } from "@behavioral-agentic-design-system/core/components/ui/button"
6
+
7
+ const meta: Meta<typeof Result> = {
8
+ title: "Components/Result",
9
+ component: Result,
10
+ parameters: {
11
+ layout: "centered",
12
+ docs: {
13
+ description: {
14
+ component:
15
+ "Feedback primitive for the outcome of a concluded operation — status icon, title, optional subtitle, optional extra content. Four semantic statuses (success / error / warning / info) drive the default Lucide icon (48px, strokeWidth 1.5) and its token color. Distinct from EmptyState (no data yet) and Sonner (transient toasts). Icon entrance animates via animate-in fade-in zoom-in-50 on var(--duration-base) + var(--ease-spring); reduced-motion safe via the base layer.",
16
+ },
17
+ },
18
+ },
19
+ argTypes: {
20
+ status: {
21
+ control: "select",
22
+ options: ["success", "error", "warning", "info"],
23
+ },
24
+ size: {
25
+ control: "select",
26
+ options: ["default", "sm"],
27
+ },
28
+ },
29
+ }
30
+ export default meta
31
+ type Story = StoryObj<typeof Result>
32
+
33
+ export const Default: Story = {
34
+ args: {
35
+ status: "success",
36
+ title: "Tokens published",
37
+ subtitle:
38
+ "tokens-v2-proposal is live at design.bads.com — every fork picks it up on the next @core bump.",
39
+ },
40
+ }
41
+
42
+ export const Variant_Success: Story = {
43
+ args: {
44
+ status: "success",
45
+ title: "Payment received",
46
+ subtitle: "We charged $249.00 to the card ending 4187. A receipt is on its way to jordan@reeves.design.",
47
+ },
48
+ }
49
+
50
+ export const Variant_Error: Story = {
51
+ args: {
52
+ status: "error",
53
+ title: "Token sync failed",
54
+ subtitle:
55
+ "The build could not reach design.bads.com. Your local tokens.json is unchanged — nothing was overwritten.",
56
+ },
57
+ }
58
+
59
+ export const Variant_Warning: Story = {
60
+ args: {
61
+ status: "warning",
62
+ title: "Contrast below AAA",
63
+ subtitle:
64
+ "3 of 78 token pairs landed under the 7:1 contrast floor. The system published anyway — review before shipping to clients.",
65
+ },
66
+ }
67
+
68
+ export const Variant_Info: Story = {
69
+ args: {
70
+ status: "info",
71
+ title: "Review pending",
72
+ subtitle:
73
+ "Seo-yun Park was asked to approve the tokens-v2 proposal. You'll be notified when the review lands.",
74
+ },
75
+ }
76
+
77
+ export const Size_SM: Story = {
78
+ args: {
79
+ status: "success",
80
+ size: "sm",
81
+ title: "Story coverage complete",
82
+ subtitle: "36 components audited — 98.4% story coverage.",
83
+ },
84
+ }
85
+
86
+ export const WithSubtitle: Story = {
87
+ args: {
88
+ status: "info",
89
+ title: "Export queued",
90
+ subtitle:
91
+ "The ROI report for Q3 is being generated. Large registries can take up to a minute — we'll email marcus@lindqvist.dev when it's ready.",
92
+ },
93
+ }
94
+
95
+ export const WithExtra: Story = {
96
+ render: () => (
97
+ <Result
98
+ status="success"
99
+ title="Fork renamed"
100
+ subtitle="This design system is now Clap Design System. Tokens rebuilt and both CSS files regenerated."
101
+ extra={
102
+ <>
103
+ <Button size="xl">Open the showcase</Button>
104
+ <Button size="xl" variant="outline">
105
+ View commit
106
+ </Button>
107
+ </>
108
+ }
109
+ />
110
+ ),
111
+ }
112
+
113
+ export const WithCustomIcon: Story = {
114
+ render: () => (
115
+ <Result
116
+ status="success"
117
+ icon={<PartyPopper strokeWidth={1.5} aria-hidden />}
118
+ title="Onboarding complete"
119
+ subtitle="Anika Patel finished all 9 setup steps. The brand layer, tokens, and voice calibration are ready for the first prototype."
120
+ extra={<Button size="xl">Start the first screen</Button>}
121
+ />
122
+ ),
123
+ }
124
+
125
+ export const RealisticUse: Story = {
126
+ render: () => (
127
+ // Post-checkout confirmation surface — the shape this primitive ships in
128
+ // most often: full-card outcome after an async operation concludes.
129
+ <div className="w-[28rem] max-w-full rounded-lg border border-border bg-card">
130
+ <Result
131
+ status="success"
132
+ title="You're on the Studio plan"
133
+ subtitle="We charged $249.00 to the card ending 4187. Your invoice and a getting-started guide were sent to seoyun.park@figma.com."
134
+ extra={
135
+ <>
136
+ <Button size="xl">Go to dashboard</Button>
137
+ <Button size="xl" variant="ghost">
138
+ Download invoice
139
+ </Button>
140
+ </>
141
+ }
142
+ />
143
+ </div>
144
+ ),
145
+ }
@@ -18,7 +18,7 @@ const meta: Meta<typeof RollingNumber> = {
18
18
  docs: {
19
19
  description: {
20
20
  component:
21
- "Animated digit counter — each digit independently scrolls (odometer/slot-machine style) when the value prop changes. Distinct from FormatNumber (static), Stat (layout), and Timer (live interval). Use for KPI milestones, revenue counters, real-time stats. Token-driven motion: var(--duration-base) + var(--ease-spring). aria-label carries the formatted value; aria-live='polite' announces changes to screen readers. Reduced-motion users see an instant value swap.",
21
+ "Animated digit counter — each digit independently scrolls (odometer/slot-machine style) when the value prop changes. Distinct from FormatNumber (static), Stat (layout), and Timer (live interval). Use for KPI milestones, revenue counters, real-time stats. Token-driven motion: var(--duration-base) + var(--ease-spring). role='status' + aria-label carries the formatted value; role=status implies aria-live='polite' so changes are announced to screen readers. Reduced-motion users see an instant value swap.",
22
22
  },
23
23
  },
24
24
  },
@@ -1,3 +1,5 @@
1
+ // Sidebar is a client component — it builds a React context and drives its
2
+ // open/collapsed state through hooks, none of which exist on the server.
1
3
  // Motion: rail hover narrowed transition-all → transition-colors (only the after-bg animates; explicit-properties rule).
2
4
  // Sidebar sticky container gained `h-svh` so the bg always spans the
3
5
  // viewport even when the menu is shorter than the screen. No new variants