@behavioral-agentic-design-system/core 0.17.0 → 0.19.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 (79) hide show
  1. package/package.json +1 -1
  2. package/scripts/check-stories.mjs +12 -5
  3. package/scripts/fix-stories.mjs +6 -6
  4. package/scripts/generate-stories.cjs +7 -7
  5. package/src/app/preview/components/page.tsx +119 -98
  6. package/src/components/ui/color-picker.tsx +318 -9
  7. package/src/stories/Accordion.stories.tsx +152 -0
  8. package/src/stories/Alert.stories.tsx +102 -0
  9. package/src/stories/AlertDialog.stories.tsx +125 -0
  10. package/src/stories/AspectRatio.stories.tsx +82 -0
  11. package/src/stories/Avatar.stories.tsx +36 -0
  12. package/src/stories/Badge.stories.tsx +54 -0
  13. package/src/stories/Breadcrumb.stories.tsx +36 -0
  14. package/src/stories/Button.stories.tsx +144 -0
  15. package/src/stories/ButtonGroup.stories.tsx +176 -0
  16. package/src/stories/Calendar.stories.tsx +67 -0
  17. package/src/stories/Card.stories.tsx +43 -0
  18. package/src/stories/Carousel.stories.tsx +233 -0
  19. package/src/stories/Chart.stories.tsx +174 -0
  20. package/src/stories/Checkbox.stories.tsx +32 -0
  21. package/src/stories/CircularProgress.stories.tsx +136 -0
  22. package/src/stories/Code.stories.tsx +131 -0
  23. package/src/stories/Collapsible.stories.tsx +27 -0
  24. package/src/stories/ColorPicker.stories.tsx +186 -0
  25. package/src/stories/Combobox.stories.tsx +168 -0
  26. package/src/stories/Command.stories.tsx +40 -0
  27. package/src/stories/ContextMenu.stories.tsx +293 -0
  28. package/src/stories/CopyButton.stories.tsx +111 -0
  29. package/src/stories/DatePicker.stories.tsx +176 -0
  30. package/src/stories/DateRangePicker.stories.tsx +95 -0
  31. package/src/stories/Dialog.stories.tsx +186 -0
  32. package/src/stories/DropdownMenu.stories.tsx +47 -0
  33. package/src/stories/EmptyState.stories.tsx +199 -0
  34. package/src/stories/Field.stories.tsx +155 -0
  35. package/src/stories/FileUpload.stories.tsx +134 -0
  36. package/src/stories/HoverCard.stories.tsx +149 -0
  37. package/src/stories/Indicator.stories.tsx +255 -0
  38. package/src/stories/Input.stories.tsx +69 -0
  39. package/src/stories/Kbd.stories.tsx +123 -0
  40. package/src/stories/Label.stories.tsx +27 -0
  41. package/src/stories/List.stories.tsx +159 -0
  42. package/src/stories/Menubar.stories.tsx +190 -0
  43. package/src/stories/MultiSelect.stories.tsx +107 -0
  44. package/src/stories/NativeSelect.stories.tsx +107 -0
  45. package/src/stories/NavigationMenu.stories.tsx +322 -0
  46. package/src/stories/NumberInput.stories.tsx +100 -0
  47. package/src/stories/Pagination.stories.tsx +201 -0
  48. package/src/stories/PasswordInput.stories.tsx +62 -0
  49. package/src/stories/PinInput.stories.tsx +136 -0
  50. package/src/stories/Popover.stories.tsx +37 -0
  51. package/src/stories/Progress.stories.tsx +64 -0
  52. package/src/stories/RadioGroup.stories.tsx +39 -0
  53. package/src/stories/RatingGroup.stories.tsx +102 -0
  54. package/src/stories/Resizable.stories.tsx +28 -0
  55. package/src/stories/Reveal.stories.tsx +63 -0
  56. package/src/stories/ScrollArea.stories.tsx +76 -0
  57. package/src/stories/SegmentedControl.stories.tsx +182 -0
  58. package/src/stories/Select.stories.tsx +62 -0
  59. package/src/stories/Separator.stories.tsx +28 -0
  60. package/src/stories/Sheet.stories.tsx +193 -0
  61. package/src/stories/Sidebar.stories.tsx +53 -0
  62. package/src/stories/Skeleton.stories.tsx +32 -0
  63. package/src/stories/Slider.stories.tsx +67 -0
  64. package/src/stories/Sonner.stories.tsx +146 -0
  65. package/src/stories/Spinner.stories.tsx +94 -0
  66. package/src/stories/Stepper.stories.tsx +228 -0
  67. package/src/stories/Switch.stories.tsx +58 -0
  68. package/src/stories/Table.stories.tsx +38 -0
  69. package/src/stories/Tabs.stories.tsx +128 -0
  70. package/src/stories/Tag.stories.tsx +51 -0
  71. package/src/stories/TagsInput.stories.tsx +154 -0
  72. package/src/stories/Textarea.stories.tsx +31 -0
  73. package/src/stories/TimePicker.stories.tsx +54 -0
  74. package/src/stories/Timeline.stories.tsx +263 -0
  75. package/src/stories/Toggle.stories.tsx +45 -0
  76. package/src/stories/ToggleGroup.stories.tsx +39 -0
  77. package/src/stories/Toolbar.stories.tsx +295 -0
  78. package/src/stories/Tooltip.stories.tsx +37 -0
  79. package/src/stories/TreeView.stories.tsx +293 -0
@@ -0,0 +1,107 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import { NativeSelect } from "@behavioral-agentic-design-system/core/components/ui/native-select";
3
+
4
+ const meta: Meta<typeof NativeSelect> = {
5
+ title: "Components/NativeSelect",
6
+ component: NativeSelect,
7
+ parameters: {
8
+ layout: "centered",
9
+ },
10
+ tags: ["autodocs"],
11
+ };
12
+
13
+ export default meta;
14
+ type Story = StoryObj<typeof meta>;
15
+
16
+ export const Default: Story = {
17
+ render: (args) => (
18
+ <NativeSelect aria-label="Design area" {...args}>
19
+ <option value="">Choose an option</option>
20
+ <option value="design-tokens">Design Tokens</option>
21
+ <option value="components">Components</option>
22
+ <option value="patterns">Patterns</option>
23
+ <option value="documentation">Documentation</option>
24
+ </NativeSelect>
25
+ ),
26
+ };
27
+
28
+ export const Size_Sm: Story = {
29
+ render: (args) => (
30
+ <NativeSelect size="sm" aria-label="Design area (small)" {...args}>
31
+ <option value="">Small select</option>
32
+ <option value="design-tokens">Design Tokens</option>
33
+ <option value="components">Components</option>
34
+ </NativeSelect>
35
+ ),
36
+ };
37
+
38
+ export const Size_Default: Story = {
39
+ render: (args) => (
40
+ <NativeSelect size="default" aria-label="Design area (default)" {...args}>
41
+ <option value="">Default size</option>
42
+ <option value="design-tokens">Design Tokens</option>
43
+ <option value="components">Components</option>
44
+ </NativeSelect>
45
+ ),
46
+ };
47
+
48
+ export const Size_Lg: Story = {
49
+ render: (args) => (
50
+ <NativeSelect size="lg" aria-label="Design area (large)" {...args}>
51
+ <option value="">Large select</option>
52
+ <option value="design-tokens">Design Tokens</option>
53
+ <option value="components">Components</option>
54
+ </NativeSelect>
55
+ ),
56
+ };
57
+
58
+ export const Size_Xl: Story = {
59
+ render: (args) => (
60
+ <NativeSelect size="xl" aria-label="Design area (extra large)" {...args}>
61
+ <option value="">Extra large</option>
62
+ <option value="design-tokens">Design Tokens</option>
63
+ <option value="components">Components</option>
64
+ </NativeSelect>
65
+ ),
66
+ };
67
+
68
+ export const Disabled: Story = {
69
+ render: (args) => (
70
+ <NativeSelect disabled aria-label="Design area (disabled)" {...args}>
71
+ <option value="">Disabled select</option>
72
+ <option value="design-tokens">Design Tokens</option>
73
+ </NativeSelect>
74
+ ),
75
+ };
76
+
77
+ export const WithError: Story = {
78
+ render: (args) => (
79
+ <NativeSelect aria-invalid aria-label="Category" {...args}>
80
+ <option value="">Select a category</option>
81
+ <option value="design-tokens">Design Tokens</option>
82
+ <option value="components">Components</option>
83
+ </NativeSelect>
84
+ ),
85
+ };
86
+
87
+ export const RealisticUse: Story = {
88
+ render: () => (
89
+ <div className="flex flex-col gap-3 w-64">
90
+ <label htmlFor="focus-area" className="text-sm font-medium text-foreground">
91
+ Design Focus Area
92
+ </label>
93
+ <NativeSelect id="focus-area" defaultValue="components">
94
+ <option value="">Choose a focus area</option>
95
+ <option value="tokens">Design Tokens</option>
96
+ <option value="components">Components</option>
97
+ <option value="patterns">Patterns</option>
98
+ <option value="a11y">Accessibility</option>
99
+ <option value="motion">Motion &amp; Animation</option>
100
+ <option value="documentation">Documentation</option>
101
+ </NativeSelect>
102
+ <p className="text-sm text-muted-foreground">
103
+ Used by Jordan Reeves · 36 components shipped
104
+ </p>
105
+ </div>
106
+ ),
107
+ };
@@ -0,0 +1,322 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import {
3
+ NavigationMenu,
4
+ NavigationMenuContent,
5
+ NavigationMenuItem,
6
+ NavigationMenuLink,
7
+ NavigationMenuList,
8
+ NavigationMenuTrigger,
9
+ NavigationMenuIndicator,
10
+ NavigationMenuViewport,
11
+ } from "@behavioral-agentic-design-system/core/components/ui/navigation-menu";
12
+ import { cn } from "@behavioral-agentic-design-system/core/lib/utils";
13
+
14
+ const meta: Meta<typeof NavigationMenu> = {
15
+ title: "Components/NavigationMenu",
16
+ component: NavigationMenu,
17
+ parameters: {
18
+ layout: "centered",
19
+ docs: {
20
+ description: {
21
+ component:
22
+ "Top-level site navigation with hover-opened flyout panels. The trigger swallows the click that lands right after a hover-open, so a 'hover then click' gesture keeps the panel open instead of flickering it closed; a deliberate later click (or keyboard Enter) still toggles it.",
23
+ },
24
+ },
25
+ },
26
+ tags: ["autodocs"],
27
+ decorators: [
28
+ (Story) => (
29
+ <div className="flex min-h-[200px] items-start justify-center pt-8">
30
+ <Story />
31
+ </div>
32
+ ),
33
+ ],
34
+ };
35
+
36
+ export default meta;
37
+ type Story = StoryObj<typeof meta>;
38
+
39
+ const ListItem = ({
40
+ className,
41
+ title,
42
+ children,
43
+ href = "#",
44
+ ...props
45
+ }: React.ComponentPropsWithoutRef<"a"> & { title: string }) => (
46
+ <li>
47
+ <NavigationMenuLink asChild>
48
+ <a
49
+ href={href}
50
+ className={cn(
51
+ "block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-hidden transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",
52
+ className
53
+ )}
54
+ {...props}
55
+ >
56
+ <div className="text-sm font-medium leading-none">{title}</div>
57
+ <p className="line-clamp-2 text-sm leading-snug text-muted-foreground">
58
+ {children}
59
+ </p>
60
+ </a>
61
+ </NavigationMenuLink>
62
+ </li>
63
+ );
64
+
65
+ export const Default: Story = {
66
+ render: () => (
67
+ <NavigationMenu>
68
+ <NavigationMenuList>
69
+ <NavigationMenuItem>
70
+ <NavigationMenuTrigger>Getting started</NavigationMenuTrigger>
71
+ <NavigationMenuContent>
72
+ <ul className="grid gap-3 p-4 md:w-[400px] lg:w-[500px] lg:grid-cols-[.75fr_1fr]">
73
+ <li className="row-span-3">
74
+ <NavigationMenuLink asChild>
75
+ <a
76
+ className="flex h-full w-full select-none flex-col justify-end rounded-md bg-gradient-to-b from-muted/50 to-muted p-6 no-underline outline-hidden focus:shadow-md"
77
+ href="#"
78
+ >
79
+ <div className="mb-2 mt-4 text-lg font-medium">BADS</div>
80
+ <p className="text-sm leading-tight text-muted-foreground">
81
+ Behavioral Agentic Design System — a portable, accessible
82
+ component library and token system.
83
+ </p>
84
+ </a>
85
+ </NavigationMenuLink>
86
+ </li>
87
+ <ListItem title="Introduction" href="#">
88
+ Re-usable primitives built with Radix UI and Tailwind CSS.
89
+ </ListItem>
90
+ <ListItem title="Installation" href="#">
91
+ How to install dependencies and set up your project.
92
+ </ListItem>
93
+ <ListItem title="Typography" href="#">
94
+ Styles for headings, paragraphs, lists, and more.
95
+ </ListItem>
96
+ </ul>
97
+ </NavigationMenuContent>
98
+ </NavigationMenuItem>
99
+ <NavigationMenuItem>
100
+ <NavigationMenuTrigger>Components</NavigationMenuTrigger>
101
+ <NavigationMenuContent>
102
+ <ul className="grid w-[400px] gap-3 p-4 md:w-[500px] md:grid-cols-2 lg:w-[600px]">
103
+ {[
104
+ { title: "Button", description: "Triggers actions and events." },
105
+ { title: "Dialog", description: "Modal overlay for critical tasks." },
106
+ { title: "DropdownMenu", description: "Triggered contextual menu." },
107
+ { title: "Popover", description: "Floating anchor-relative panel." },
108
+ { title: "Select", description: "Accessible single-value picker." },
109
+ { title: "Tabs", description: "Layered content panels." },
110
+ ].map((item) => (
111
+ <ListItem key={item.title} title={item.title} href="#">
112
+ {item.description}
113
+ </ListItem>
114
+ ))}
115
+ </ul>
116
+ </NavigationMenuContent>
117
+ </NavigationMenuItem>
118
+ <NavigationMenuItem>
119
+ <NavigationMenuLink
120
+ href="#"
121
+ className="inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-hidden disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50"
122
+ >
123
+ Documentation
124
+ </NavigationMenuLink>
125
+ </NavigationMenuItem>
126
+ </NavigationMenuList>
127
+ </NavigationMenu>
128
+ ),
129
+ };
130
+
131
+ export const SimpleLinks: Story = {
132
+ render: () => (
133
+ <NavigationMenu>
134
+ <NavigationMenuList>
135
+ <NavigationMenuItem>
136
+ <NavigationMenuLink
137
+ href="#"
138
+ className="inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:outline-hidden"
139
+ >
140
+ Home
141
+ </NavigationMenuLink>
142
+ </NavigationMenuItem>
143
+ <NavigationMenuItem>
144
+ <NavigationMenuLink
145
+ href="#"
146
+ className="inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:outline-hidden"
147
+ >
148
+ About
149
+ </NavigationMenuLink>
150
+ </NavigationMenuItem>
151
+ <NavigationMenuItem>
152
+ <NavigationMenuLink
153
+ href="#"
154
+ className="inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:outline-hidden"
155
+ >
156
+ Blog
157
+ </NavigationMenuLink>
158
+ </NavigationMenuItem>
159
+ <NavigationMenuItem>
160
+ <NavigationMenuLink
161
+ href="#"
162
+ className="inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:outline-hidden"
163
+ >
164
+ Contact
165
+ </NavigationMenuLink>
166
+ </NavigationMenuItem>
167
+ </NavigationMenuList>
168
+ </NavigationMenu>
169
+ ),
170
+ };
171
+
172
+ export const WithTriggerAndLinks: Story = {
173
+ render: () => (
174
+ <NavigationMenu>
175
+ <NavigationMenuList>
176
+ <NavigationMenuItem>
177
+ <NavigationMenuTrigger>Products</NavigationMenuTrigger>
178
+ <NavigationMenuContent>
179
+ <ul className="grid w-[300px] gap-1 p-2">
180
+ <ListItem title="Design Tokens" href="#">
181
+ Semantic color, spacing, and typography tokens.
182
+ </ListItem>
183
+ <ListItem title="Component Library" href="#">
184
+ 47 accessible, WCAG AAA primitives.
185
+ </ListItem>
186
+ <ListItem title="Agent Interface" href="#">
187
+ Claude-readable rules, manifests, and skills.
188
+ </ListItem>
189
+ </ul>
190
+ </NavigationMenuContent>
191
+ </NavigationMenuItem>
192
+ <NavigationMenuItem>
193
+ <NavigationMenuLink
194
+ href="#"
195
+ className="inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:outline-hidden"
196
+ >
197
+ Pricing
198
+ </NavigationMenuLink>
199
+ </NavigationMenuItem>
200
+ <NavigationMenuItem>
201
+ <NavigationMenuLink
202
+ href="#"
203
+ className="inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:outline-hidden"
204
+ >
205
+ Docs
206
+ </NavigationMenuLink>
207
+ </NavigationMenuItem>
208
+ </NavigationMenuList>
209
+ </NavigationMenu>
210
+ ),
211
+ };
212
+
213
+ export const WithIndicator: Story = {
214
+ render: () => (
215
+ <NavigationMenu>
216
+ <NavigationMenuList>
217
+ <NavigationMenuItem>
218
+ <NavigationMenuTrigger>Overview</NavigationMenuTrigger>
219
+ <NavigationMenuContent>
220
+ <ul className="grid gap-3 p-4 md:w-[400px] md:grid-cols-2">
221
+ <ListItem title="Introduction" href="#">
222
+ Core concepts and system overview.
223
+ </ListItem>
224
+ <ListItem title="Quick start" href="#">
225
+ Get up and running in minutes.
226
+ </ListItem>
227
+ <ListItem title="Migration guide" href="#">
228
+ Upgrading from a previous version.
229
+ </ListItem>
230
+ <ListItem title="Changelog" href="#">
231
+ Latest releases and updates.
232
+ </ListItem>
233
+ </ul>
234
+ </NavigationMenuContent>
235
+ </NavigationMenuItem>
236
+ <NavigationMenuItem>
237
+ <NavigationMenuTrigger>Guides</NavigationMenuTrigger>
238
+ <NavigationMenuContent>
239
+ <ul className="grid gap-3 p-4 md:w-[300px]">
240
+ <ListItem title="Tokens" href="#">
241
+ Using and customising design tokens.
242
+ </ListItem>
243
+ <ListItem title="Dark mode" href="#">
244
+ Theming with light and dark CSS vars.
245
+ </ListItem>
246
+ <ListItem title="Accessibility" href="#">
247
+ WCAG 2.2 AAA compliance guide.
248
+ </ListItem>
249
+ </ul>
250
+ </NavigationMenuContent>
251
+ </NavigationMenuItem>
252
+ <NavigationMenuIndicator />
253
+ </NavigationMenuList>
254
+ <NavigationMenuViewport />
255
+ </NavigationMenu>
256
+ ),
257
+ };
258
+
259
+ export const RealisticUse: Story = {
260
+ render: () => (
261
+ <div className="w-full max-w-4xl rounded-md border bg-background p-3">
262
+ <div className="flex items-center justify-between">
263
+ <div className="flex items-center gap-2">
264
+ <div className="flex size-7 items-center justify-center rounded-md bg-primary text-primary-foreground text-xs font-bold">
265
+ B
266
+ </div>
267
+ <span className="text-sm font-semibold">BADS Studio</span>
268
+ </div>
269
+ <NavigationMenu>
270
+ <NavigationMenuList>
271
+ <NavigationMenuItem>
272
+ <NavigationMenuTrigger>System</NavigationMenuTrigger>
273
+ <NavigationMenuContent>
274
+ <ul className="grid gap-2 p-4 md:w-[420px] md:grid-cols-2">
275
+ <ListItem title="Design Tokens" href="#">
276
+ Color, spacing, type, and motion primitives.
277
+ </ListItem>
278
+ <ListItem title="Components" href="#">
279
+ 47 WCAG AAA accessible UI components.
280
+ </ListItem>
281
+ <ListItem title="Brand Layer" href="#">
282
+ Voice, tone, and visual identity docs.
283
+ </ListItem>
284
+ <ListItem title="Patterns" href="#">
285
+ Loading, empty, feedback, and confirmation.
286
+ </ListItem>
287
+ </ul>
288
+ </NavigationMenuContent>
289
+ </NavigationMenuItem>
290
+ <NavigationMenuItem>
291
+ <NavigationMenuTrigger>Prototypes</NavigationMenuTrigger>
292
+ <NavigationMenuContent>
293
+ <ul className="grid gap-2 p-4 md:w-[300px]">
294
+ <ListItem title="Active builds" href="#">
295
+ Currently in-progress client prototypes.
296
+ </ListItem>
297
+ <ListItem title="Approved" href="#">
298
+ Signed-off and ready for promotion.
299
+ </ListItem>
300
+ <ListItem title="Archive" href="#">
301
+ Past explorations and reference builds.
302
+ </ListItem>
303
+ </ul>
304
+ </NavigationMenuContent>
305
+ </NavigationMenuItem>
306
+ <NavigationMenuItem>
307
+ <NavigationMenuLink
308
+ href="#"
309
+ className="inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:outline-hidden"
310
+ >
311
+ Docs
312
+ </NavigationMenuLink>
313
+ </NavigationMenuItem>
314
+ </NavigationMenuList>
315
+ </NavigationMenu>
316
+ <div className="flex items-center gap-2">
317
+ <span className="text-xs text-muted-foreground">maya.chen@studio.co</span>
318
+ </div>
319
+ </div>
320
+ </div>
321
+ ),
322
+ };
@@ -0,0 +1,100 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import * as React from "react";
3
+ import { NumberInput } from "@behavioral-agentic-design-system/core/components/ui/number-input";
4
+ import { Label } from "@behavioral-agentic-design-system/core/components/ui/label";
5
+ import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
6
+
7
+ const meta: Meta<typeof NumberInput> = {
8
+ title: "Components/NumberInput",
9
+ component: NumberInput,
10
+ parameters: { layout: "centered" },
11
+ tags: ["autodocs"],
12
+ };
13
+ export default meta;
14
+ type Story = StoryObj<typeof NumberInput>;
15
+
16
+ // ─── Controlled wrapper ────────────────────────────────────────────────────────
17
+ function Controlled(props: Omit<React.ComponentProps<typeof NumberInput>, "value" | "onChange">) {
18
+ const [value, setValue] = React.useState(props.defaultValue ?? 0);
19
+ return <NumberInput {...props} value={value} onChange={setValue} />;
20
+ }
21
+
22
+ // ─── Default ─────────────────────────────────────────────────────────────────
23
+ export const Default: Story = {
24
+ render: () => <Controlled aria-label="Quantity" />,
25
+ };
26
+
27
+ // ─── Size variants ────────────────────────────────────────────────────────────
28
+ export const Size_Sm: Story = {
29
+ render: () => <Controlled size="sm" aria-label="Quantity" />,
30
+ };
31
+
32
+ export const Size_Default: Story = {
33
+ render: () => <Controlled size="default" aria-label="Quantity" />,
34
+ };
35
+
36
+ export const Size_Lg: Story = {
37
+ render: () => <Controlled size="lg" aria-label="Quantity" />,
38
+ };
39
+
40
+ // ─── With min / max ──────────────────────────────────────────────────────────
41
+ export const MinMax: Story = {
42
+ render: () => <Controlled min={0} max={10} defaultValue={5} aria-label="Rating (0–10)" />,
43
+ name: "Min / Max (0–10)",
44
+ };
45
+
46
+ // ─── With step ───────────────────────────────────────────────────────────────
47
+ export const Step: Story = {
48
+ render: () => <Controlled step={5} defaultValue={0} aria-label="Amount ($)" />,
49
+ name: "Step of 5",
50
+ };
51
+
52
+ // ─── Disabled ─────────────────────────────────────────────────────────────────
53
+ export const Disabled: Story = {
54
+ render: () => <NumberInput value={42} disabled aria-label="Quantity" />,
55
+ };
56
+
57
+ // ─── Realistic use: ticket quantity picker ───────────────────────────────────
58
+ // Content from content/personas/bads.json — studio seat booking
59
+ function TicketPicker() {
60
+ const [qty, setQty] = React.useState(1);
61
+ const price = 85;
62
+
63
+ return (
64
+ <div className="w-72 space-y-4 rounded-lg border border-border bg-card p-5">
65
+ <div className="space-y-0.5">
66
+ <p className="text-base font-semibold text-foreground">Studio Pass — Monthly</p>
67
+ <p className="text-sm text-muted-foreground">Unlimited access · maya.chen@studio.co</p>
68
+ </div>
69
+
70
+ <div className="space-y-1.5">
71
+ <Label htmlFor="ticket-qty">Seats</Label>
72
+ <NumberInput
73
+ aria-label="Number of seats"
74
+ value={qty}
75
+ onChange={setQty}
76
+ min={1}
77
+ max={20}
78
+ step={1}
79
+ defaultValue={1}
80
+ />
81
+ <p className="text-xs text-muted-foreground">Max 20 seats per order</p>
82
+ </div>
83
+
84
+ <div className="flex items-center justify-between border-t border-border pt-3">
85
+ <span className="text-sm text-muted-foreground">Total</span>
86
+ <span className="text-base font-semibold text-foreground">
87
+ ${(qty * price).toLocaleString()}
88
+ </span>
89
+ </div>
90
+
91
+ <Button className="w-full" disabled={qty < 1}>
92
+ Confirm {qty} {qty === 1 ? "seat" : "seats"}
93
+ </Button>
94
+ </div>
95
+ );
96
+ }
97
+
98
+ export const RealisticUse: Story = {
99
+ render: () => <TicketPicker />,
100
+ };