@behavioral-agentic-design-system/core 0.17.0 → 0.18.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 (77) 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/stories/Accordion.stories.tsx +152 -0
  6. package/src/stories/Alert.stories.tsx +102 -0
  7. package/src/stories/AlertDialog.stories.tsx +125 -0
  8. package/src/stories/AspectRatio.stories.tsx +82 -0
  9. package/src/stories/Avatar.stories.tsx +36 -0
  10. package/src/stories/Badge.stories.tsx +54 -0
  11. package/src/stories/Breadcrumb.stories.tsx +36 -0
  12. package/src/stories/Button.stories.tsx +144 -0
  13. package/src/stories/ButtonGroup.stories.tsx +176 -0
  14. package/src/stories/Calendar.stories.tsx +67 -0
  15. package/src/stories/Card.stories.tsx +43 -0
  16. package/src/stories/Carousel.stories.tsx +233 -0
  17. package/src/stories/Chart.stories.tsx +174 -0
  18. package/src/stories/Checkbox.stories.tsx +32 -0
  19. package/src/stories/CircularProgress.stories.tsx +136 -0
  20. package/src/stories/Code.stories.tsx +131 -0
  21. package/src/stories/Collapsible.stories.tsx +27 -0
  22. package/src/stories/ColorPicker.stories.tsx +155 -0
  23. package/src/stories/Combobox.stories.tsx +168 -0
  24. package/src/stories/Command.stories.tsx +40 -0
  25. package/src/stories/ContextMenu.stories.tsx +293 -0
  26. package/src/stories/CopyButton.stories.tsx +111 -0
  27. package/src/stories/DatePicker.stories.tsx +176 -0
  28. package/src/stories/DateRangePicker.stories.tsx +95 -0
  29. package/src/stories/Dialog.stories.tsx +186 -0
  30. package/src/stories/DropdownMenu.stories.tsx +47 -0
  31. package/src/stories/EmptyState.stories.tsx +199 -0
  32. package/src/stories/Field.stories.tsx +155 -0
  33. package/src/stories/FileUpload.stories.tsx +134 -0
  34. package/src/stories/HoverCard.stories.tsx +149 -0
  35. package/src/stories/Indicator.stories.tsx +255 -0
  36. package/src/stories/Input.stories.tsx +69 -0
  37. package/src/stories/Kbd.stories.tsx +123 -0
  38. package/src/stories/Label.stories.tsx +27 -0
  39. package/src/stories/List.stories.tsx +159 -0
  40. package/src/stories/Menubar.stories.tsx +190 -0
  41. package/src/stories/MultiSelect.stories.tsx +107 -0
  42. package/src/stories/NativeSelect.stories.tsx +107 -0
  43. package/src/stories/NavigationMenu.stories.tsx +322 -0
  44. package/src/stories/NumberInput.stories.tsx +100 -0
  45. package/src/stories/Pagination.stories.tsx +201 -0
  46. package/src/stories/PasswordInput.stories.tsx +62 -0
  47. package/src/stories/PinInput.stories.tsx +136 -0
  48. package/src/stories/Popover.stories.tsx +37 -0
  49. package/src/stories/Progress.stories.tsx +64 -0
  50. package/src/stories/RadioGroup.stories.tsx +39 -0
  51. package/src/stories/RatingGroup.stories.tsx +102 -0
  52. package/src/stories/Resizable.stories.tsx +28 -0
  53. package/src/stories/Reveal.stories.tsx +63 -0
  54. package/src/stories/ScrollArea.stories.tsx +76 -0
  55. package/src/stories/SegmentedControl.stories.tsx +182 -0
  56. package/src/stories/Select.stories.tsx +62 -0
  57. package/src/stories/Separator.stories.tsx +28 -0
  58. package/src/stories/Sheet.stories.tsx +193 -0
  59. package/src/stories/Sidebar.stories.tsx +53 -0
  60. package/src/stories/Skeleton.stories.tsx +32 -0
  61. package/src/stories/Slider.stories.tsx +67 -0
  62. package/src/stories/Sonner.stories.tsx +146 -0
  63. package/src/stories/Spinner.stories.tsx +94 -0
  64. package/src/stories/Stepper.stories.tsx +228 -0
  65. package/src/stories/Switch.stories.tsx +58 -0
  66. package/src/stories/Table.stories.tsx +38 -0
  67. package/src/stories/Tabs.stories.tsx +128 -0
  68. package/src/stories/Tag.stories.tsx +51 -0
  69. package/src/stories/TagsInput.stories.tsx +154 -0
  70. package/src/stories/Textarea.stories.tsx +31 -0
  71. package/src/stories/TimePicker.stories.tsx +54 -0
  72. package/src/stories/Timeline.stories.tsx +263 -0
  73. package/src/stories/Toggle.stories.tsx +45 -0
  74. package/src/stories/ToggleGroup.stories.tsx +39 -0
  75. package/src/stories/Toolbar.stories.tsx +295 -0
  76. package/src/stories/Tooltip.stories.tsx +37 -0
  77. package/src/stories/TreeView.stories.tsx +293 -0
@@ -0,0 +1,201 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import {
3
+ Pagination,
4
+ PaginationContent,
5
+ PaginationEllipsis,
6
+ PaginationItem,
7
+ PaginationLink,
8
+ PaginationNext,
9
+ PaginationPrevious,
10
+ } from "@behavioral-agentic-design-system/core/components/ui/pagination";
11
+ import {
12
+ Table,
13
+ TableBody,
14
+ TableCell,
15
+ TableHead,
16
+ TableHeader,
17
+ TableRow,
18
+ } from "@behavioral-agentic-design-system/core/components/ui/table";
19
+
20
+ const meta: Meta<typeof Pagination> = {
21
+ title: "Components/Pagination",
22
+ component: Pagination,
23
+ parameters: { layout: "centered" },
24
+ tags: ["autodocs"],
25
+ };
26
+
27
+ export default meta;
28
+ type Story = StoryObj<typeof meta>;
29
+
30
+ export const Default: Story = {
31
+ render: () => (
32
+ <Pagination className="w-[500px]">
33
+ <PaginationContent>
34
+ <PaginationItem>
35
+ <PaginationPrevious href="#" />
36
+ </PaginationItem>
37
+ <PaginationItem>
38
+ <PaginationLink href="#">1</PaginationLink>
39
+ </PaginationItem>
40
+ <PaginationItem>
41
+ <PaginationLink href="#">2</PaginationLink>
42
+ </PaginationItem>
43
+ <PaginationItem>
44
+ <PaginationLink href="#" isActive>
45
+ 3
46
+ </PaginationLink>
47
+ </PaginationItem>
48
+ <PaginationItem>
49
+ <PaginationEllipsis />
50
+ </PaginationItem>
51
+ <PaginationItem>
52
+ <PaginationLink href="#">10</PaginationLink>
53
+ </PaginationItem>
54
+ <PaginationItem>
55
+ <PaginationNext href="#" />
56
+ </PaginationItem>
57
+ </PaginationContent>
58
+ </Pagination>
59
+ ),
60
+ };
61
+
62
+ export const Variant_Compact: Story = {
63
+ render: () => (
64
+ <Pagination className="w-[360px]">
65
+ <PaginationContent>
66
+ <PaginationItem>
67
+ <PaginationPrevious href="#" />
68
+ </PaginationItem>
69
+ <PaginationItem>
70
+ <PaginationLink href="#" isActive>
71
+ 1
72
+ </PaginationLink>
73
+ </PaginationItem>
74
+ <PaginationItem>
75
+ <PaginationLink href="#">2</PaginationLink>
76
+ </PaginationItem>
77
+ <PaginationItem>
78
+ <PaginationLink href="#">3</PaginationLink>
79
+ </PaginationItem>
80
+ <PaginationItem>
81
+ <PaginationNext href="#" />
82
+ </PaginationItem>
83
+ </PaginationContent>
84
+ </Pagination>
85
+ ),
86
+ };
87
+
88
+ export const Variant_SimpleArrows: Story = {
89
+ render: () => (
90
+ <Pagination className="w-[260px]">
91
+ <PaginationContent>
92
+ <PaginationItem>
93
+ <PaginationPrevious href="#" />
94
+ </PaginationItem>
95
+ <PaginationItem>
96
+ <PaginationLink href="#" isActive className="w-auto px-4 font-medium text-sm">
97
+ Page 4 of 12
98
+ </PaginationLink>
99
+ </PaginationItem>
100
+ <PaginationItem>
101
+ <PaginationNext href="#" />
102
+ </PaginationItem>
103
+ </PaginationContent>
104
+ </Pagination>
105
+ ),
106
+ };
107
+
108
+ export const Disabled: Story = {
109
+ render: () => (
110
+ <Pagination className="w-[500px]">
111
+ <PaginationContent>
112
+ <PaginationItem>
113
+ <PaginationPrevious disabled aria-label="Previous page (disabled)" />
114
+ </PaginationItem>
115
+ <PaginationItem>
116
+ <PaginationLink href="#" isActive>
117
+ 1
118
+ </PaginationLink>
119
+ </PaginationItem>
120
+ <PaginationItem>
121
+ <PaginationLink href="#">2</PaginationLink>
122
+ </PaginationItem>
123
+ <PaginationItem>
124
+ <PaginationLink href="#">3</PaginationLink>
125
+ </PaginationItem>
126
+ <PaginationItem>
127
+ <PaginationEllipsis />
128
+ </PaginationItem>
129
+ <PaginationItem>
130
+ <PaginationLink href="#">10</PaginationLink>
131
+ </PaginationItem>
132
+ <PaginationItem>
133
+ <PaginationNext href="#" />
134
+ </PaginationItem>
135
+ </PaginationContent>
136
+ </Pagination>
137
+ ),
138
+ };
139
+
140
+ const MEMBERS = [
141
+ { name: "Jordan Ellis", plan: "Annual", joined: "Jan 12, 2024", status: "Active" },
142
+ { name: "Maya Okafor", plan: "Monthly", joined: "Mar 3, 2024", status: "Active" },
143
+ { name: "Sam Rivera", plan: "Annual", joined: "Feb 28, 2024", status: "Active" },
144
+ { name: "Priya Nair", plan: "Day Pass", joined: "Jun 1, 2024", status: "Expired" },
145
+ { name: "Teo Marchetti", plan: "Annual", joined: "Nov 5, 2023", status: "Active" },
146
+ ];
147
+
148
+ export const RealisticUse: Story = {
149
+ render: () => (
150
+ <div className="w-[640px] space-y-4">
151
+ <p className="text-sm text-muted-foreground">47 members · Page 2 of 10</p>
152
+ <Table>
153
+ <TableHeader>
154
+ <TableRow>
155
+ <TableHead>Name</TableHead>
156
+ <TableHead>Plan</TableHead>
157
+ <TableHead>Joined</TableHead>
158
+ <TableHead>Status</TableHead>
159
+ </TableRow>
160
+ </TableHeader>
161
+ <TableBody>
162
+ {MEMBERS.map((m) => (
163
+ <TableRow key={m.name}>
164
+ <TableCell className="font-medium">{m.name}</TableCell>
165
+ <TableCell>{m.plan}</TableCell>
166
+ <TableCell>{m.joined}</TableCell>
167
+ <TableCell>{m.status}</TableCell>
168
+ </TableRow>
169
+ ))}
170
+ </TableBody>
171
+ </Table>
172
+ <Pagination>
173
+ <PaginationContent>
174
+ <PaginationItem>
175
+ <PaginationPrevious href="#" />
176
+ </PaginationItem>
177
+ <PaginationItem>
178
+ <PaginationLink href="#">1</PaginationLink>
179
+ </PaginationItem>
180
+ <PaginationItem>
181
+ <PaginationLink href="#" isActive>
182
+ 2
183
+ </PaginationLink>
184
+ </PaginationItem>
185
+ <PaginationItem>
186
+ <PaginationLink href="#">3</PaginationLink>
187
+ </PaginationItem>
188
+ <PaginationItem>
189
+ <PaginationEllipsis />
190
+ </PaginationItem>
191
+ <PaginationItem>
192
+ <PaginationLink href="#">10</PaginationLink>
193
+ </PaginationItem>
194
+ <PaginationItem>
195
+ <PaginationNext href="#" />
196
+ </PaginationItem>
197
+ </PaginationContent>
198
+ </Pagination>
199
+ </div>
200
+ ),
201
+ };
@@ -0,0 +1,62 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { PasswordInput } from "@behavioral-agentic-design-system/core/components/ui/password-input";
3
+ import { Label } from "@behavioral-agentic-design-system/core/components/ui/label";
4
+
5
+ const meta: Meta<typeof PasswordInput> = {
6
+ title: "Components/PasswordInput",
7
+ component: PasswordInput,
8
+ parameters: { layout: "centered" },
9
+ args: { placeholder: "Enter password" },
10
+ };
11
+
12
+ export default meta;
13
+ type Story = StoryObj<typeof PasswordInput>;
14
+
15
+ export const Default: Story = {};
16
+
17
+ export const Size_Sm: Story = {
18
+ args: { size: "sm" },
19
+ };
20
+
21
+ export const Size_Default: Story = {
22
+ args: { size: "default" },
23
+ };
24
+
25
+ export const Size_Lg: Story = {
26
+ args: { size: "lg" },
27
+ };
28
+
29
+ export const Size_Xl: Story = {
30
+ args: { size: "xl" },
31
+ };
32
+
33
+ export const Visible: Story = {
34
+ args: { defaultVisible: true, placeholder: "Visible by default" },
35
+ };
36
+
37
+ export const Disabled: Story = {
38
+ args: { disabled: true, placeholder: "Disabled" },
39
+ };
40
+
41
+ export const AriaInvalid: Story = {
42
+ args: { "aria-invalid": true, placeholder: "Invalid password" },
43
+ };
44
+
45
+ export const RealisticUse: Story = {
46
+ render: () => (
47
+ <div className="w-80 space-y-4">
48
+ <div className="space-y-1.5">
49
+ <Label htmlFor="login-password">Password</Label>
50
+ <PasswordInput
51
+ id="login-password"
52
+ autoComplete="current-password"
53
+ placeholder="Enter your password"
54
+ size="xl"
55
+ />
56
+ <p className="text-xs text-muted-foreground">
57
+ Must be at least 8 characters.
58
+ </p>
59
+ </div>
60
+ </div>
61
+ ),
62
+ };
@@ -0,0 +1,136 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import * as React from "react";
3
+ import { PinInput } from "@behavioral-agentic-design-system/core/components/ui/pin-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 PinInput> = {
8
+ title: "Components/PinInput",
9
+ component: PinInput,
10
+ parameters: { layout: "centered" },
11
+ tags: ["autodocs"],
12
+ };
13
+ export default meta;
14
+ type Story = StoryObj<typeof PinInput>;
15
+
16
+ // ─── Controlled wrapper ────────────────────────────────────────────────────────
17
+ function Controlled(props: Omit<React.ComponentProps<typeof PinInput>, "value" | "onChange">) {
18
+ const [value, setValue] = React.useState("");
19
+ return <PinInput {...props} value={value} onChange={setValue} />;
20
+ }
21
+
22
+ // ─── Default ─────────────────────────────────────────────────────────────────
23
+ export const Default: Story = {
24
+ render: () => <Controlled length={6} />,
25
+ };
26
+
27
+ // ─── Size variants ────────────────────────────────────────────────────────────
28
+ export const Size_Sm: Story = {
29
+ render: () => <Controlled length={6} size="sm" />,
30
+ };
31
+
32
+ export const Size_Default: Story = {
33
+ render: () => <Controlled length={6} size="default" />,
34
+ };
35
+
36
+ export const Size_Lg: Story = {
37
+ render: () => <Controlled length={6} size="lg" />,
38
+ };
39
+
40
+ // ─── Length variant ───────────────────────────────────────────────────────────
41
+ export const Length_4: Story = {
42
+ render: () => <Controlled length={4} />,
43
+ name: "4-digit PIN",
44
+ };
45
+
46
+ // ─── Disabled ─────────────────────────────────────────────────────────────────
47
+ export const Disabled: Story = {
48
+ render: () => <PinInput length={6} value="4" disabled />,
49
+ };
50
+
51
+ // ─── Invalid ──────────────────────────────────────────────────────────────────
52
+ export const Invalid: Story = {
53
+ render: () => <PinInput length={6} value="123456" aria-invalid={true} />,
54
+ };
55
+
56
+ // ─── Password type ────────────────────────────────────────────────────────────
57
+ export const Type_Password: Story = {
58
+ render: () => <Controlled length={4} type="password" aria-label="Enter 4-digit PIN" />,
59
+ name: "Password (PIN)",
60
+ };
61
+
62
+ // ─── Realistic use ────────────────────────────────────────────────────────────
63
+ // Real scenario: email verification code from content/personas/bads.json
64
+ // (notifications[0] references a verification code flow)
65
+ function VerifyEmail() {
66
+ const [code, setCode] = React.useState("");
67
+ const [status, setStatus] = React.useState<"idle" | "success" | "error">("idle");
68
+
69
+ const handleComplete = (val: string) => {
70
+ // Simulate verify — bads.json microcopy uses "483-291" as a sample code
71
+ setStatus(val === "483291" ? "success" : "error");
72
+ };
73
+
74
+ const handleReset = () => {
75
+ setCode("");
76
+ setStatus("idle");
77
+ };
78
+
79
+ return (
80
+ <div className="w-80 space-y-4">
81
+ <div className="space-y-1">
82
+ <h2 className="text-base font-semibold text-foreground">
83
+ Verify your email
84
+ </h2>
85
+ <p className="text-sm text-muted-foreground">
86
+ We sent a 6-digit code to maya.chen@studio.co. Enter it below.
87
+ </p>
88
+ </div>
89
+
90
+ <div className="space-y-2">
91
+ <Label htmlFor="otp-group">Verification code</Label>
92
+ <PinInput
93
+ aria-label="Verification code"
94
+ length={6}
95
+ value={code}
96
+ onChange={setCode}
97
+ onComplete={handleComplete}
98
+ aria-invalid={status === "error"}
99
+ />
100
+ {status === "error" && (
101
+ <p className="text-xs text-destructive" role="alert">
102
+ That code doesn&apos;t match. Try again or request a new one.
103
+ </p>
104
+ )}
105
+ {status === "success" && (
106
+ <p className="text-xs text-foreground" role="status">
107
+ Email verified.
108
+ </p>
109
+ )}
110
+ </div>
111
+
112
+ <div className="flex gap-2">
113
+ <Button
114
+ size="sm"
115
+ variant="outline"
116
+ onClick={handleReset}
117
+ className="flex-1"
118
+ >
119
+ Resend code
120
+ </Button>
121
+ <Button
122
+ size="sm"
123
+ disabled={code.length !== 6}
124
+ onClick={() => handleComplete(code)}
125
+ className="flex-1"
126
+ >
127
+ Verify
128
+ </Button>
129
+ </div>
130
+ </div>
131
+ );
132
+ }
133
+
134
+ export const RealisticUse: Story = {
135
+ render: () => <VerifyEmail />,
136
+ };
@@ -0,0 +1,37 @@
1
+ // NOTE: this primitive now respects PortalThemeProvider — when a parent\
2
+ // mounts <PortalThemeProvider scope="...">, the portal'd content auto-\
3
+ // applies the scope class so theme-scoped CSS variables resolve inside\
4
+ // the portal. See components/Sheet.stories.tsx → WithPortalTheme for the\
5
+ // canonical demonstration. Mechanism is identical here; no separate\
6
+ // story added because the demo would duplicate Sheet's.
7
+ import type { Meta, StoryObj } from "@storybook/react";
8
+ import { Popover, PopoverContent, PopoverTrigger } from "@behavioral-agentic-design-system/core/components/ui/popover";
9
+ import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
10
+
11
+ const meta: Meta<typeof Popover> = {
12
+ title: "Components/Popover",
13
+ component: Popover,
14
+ parameters: { layout: "centered" },
15
+ tags: ["autodocs"],
16
+ };
17
+
18
+ export default meta;
19
+ type Story = StoryObj<typeof meta>;
20
+
21
+ export const Default: Story = {
22
+ render: () => (<Popover>
23
+ <PopoverTrigger asChild><Button variant="outline">Open popover</Button></PopoverTrigger>
24
+ <PopoverContent className="w-64">
25
+ <p className="text-sm">Place anything inside the popover — settings, filters, a small form.</p>
26
+ </PopoverContent>
27
+ </Popover>),
28
+ };
29
+
30
+ export const RealisticUse: Story = {
31
+ render: () => (<Popover>
32
+ <PopoverTrigger asChild><Button variant="outline">Open popover</Button></PopoverTrigger>
33
+ <PopoverContent className="w-64">
34
+ <p className="text-sm">Place anything inside the popover — settings, filters, a small form.</p>
35
+ </PopoverContent>
36
+ </Popover>),
37
+ };
@@ -0,0 +1,64 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import { Progress } from "@behavioral-agentic-design-system/core/components/ui/progress";
3
+
4
+ /**
5
+ * Progress is a non-CVA primitive — only `Default` + `RealisticUse` per
6
+ * the storybook rule. Track surface uses `bg-primary/30 dark:bg-primary/60`,
7
+ * an asymmetric alpha that lands at typical-progress-track contrast in light
8
+ * mode and AAA-passing 6.79:1 in dark mode (documented exception in CLAUDE.md
9
+ * → Known AAA exceptions).
10
+ */
11
+ const meta: Meta<typeof Progress> = {
12
+ title: "Components/Progress",
13
+ component: Progress,
14
+ parameters: {
15
+ layout: "centered",
16
+ },
17
+ tags: ["autodocs"],
18
+ argTypes: {
19
+ value: { control: { type: "range", min: 0, max: 100, step: 1 } },
20
+ },
21
+ };
22
+
23
+ export default meta;
24
+ type Story = StoryObj<typeof meta>;
25
+
26
+ export const Default: Story = {
27
+ args: { value: 60, "aria-label": "Loading progress" },
28
+ // Progress is w-full with no intrinsic width. In the centered layout a
29
+ // bare w-full child collapses to 0 width and reads as an empty bar, so the
30
+ // story gives it a fixed-width wrapper (RealisticUse already had one).
31
+ render: (args) => (
32
+ <div className="w-72">
33
+ <Progress {...args} />
34
+ </div>
35
+ ),
36
+ };
37
+
38
+ export const RealisticUse: Story = {
39
+ render: () => (
40
+ <div className="w-72 space-y-6">
41
+ <div className="space-y-2">
42
+ <div className="flex justify-between text-sm">
43
+ <span id="progress-uploading" className="text-foreground">Uploading…</span>
44
+ <span className="text-muted-foreground tabular-nums">28%</span>
45
+ </div>
46
+ <Progress value={28} aria-labelledby="progress-uploading" />
47
+ </div>
48
+ <div className="space-y-2">
49
+ <div className="flex justify-between text-sm">
50
+ <span id="progress-processing" className="text-foreground">Processing</span>
51
+ <span className="text-muted-foreground tabular-nums">72%</span>
52
+ </div>
53
+ <Progress value={72} aria-labelledby="progress-processing" />
54
+ </div>
55
+ <div className="space-y-2">
56
+ <div className="flex justify-between text-sm">
57
+ <span id="progress-done" className="text-foreground">Done</span>
58
+ <span className="text-muted-foreground tabular-nums">100%</span>
59
+ </div>
60
+ <Progress value={100} aria-labelledby="progress-done" />
61
+ </div>
62
+ </div>
63
+ ),
64
+ };
@@ -0,0 +1,39 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { RadioGroup, RadioGroupItem } from "@behavioral-agentic-design-system/core/components/ui/radio-group";
3
+ import { Label } from "@behavioral-agentic-design-system/core/components/ui/label";
4
+
5
+ const meta: Meta<typeof RadioGroup> = {
6
+ title: "Components/RadioGroup",
7
+ component: RadioGroup,
8
+ parameters: { layout: "centered" },
9
+ tags: ["autodocs"],
10
+ };
11
+
12
+ export default meta;
13
+ type Story = StoryObj<typeof meta>;
14
+
15
+ export const Default: Story = {
16
+ render: () => (<RadioGroup defaultValue="comfortable" className="flex flex-col gap-2 w-[280px]">
17
+ <div className="flex items-center gap-2"><RadioGroupItem value="default" id="r1" /><Label htmlFor="r1">Default</Label></div>
18
+ <div className="flex items-center gap-2"><RadioGroupItem value="comfortable" id="r2" /><Label htmlFor="r2">Comfortable</Label></div>
19
+ <div className="flex items-center gap-2"><RadioGroupItem value="compact" id="r3" /><Label htmlFor="r3">Compact</Label></div>
20
+ </RadioGroup>),
21
+ };
22
+
23
+ export const Disabled: Story = {
24
+ render: () => (
25
+ <RadioGroup defaultValue="comfortable" disabled className="flex flex-col gap-2 w-[280px]">
26
+ <div className="flex items-center gap-2"><RadioGroupItem value="default" id="rd1" /><Label htmlFor="rd1">Default</Label></div>
27
+ <div className="flex items-center gap-2"><RadioGroupItem value="comfortable" id="rd2" /><Label htmlFor="rd2">Comfortable</Label></div>
28
+ <div className="flex items-center gap-2"><RadioGroupItem value="compact" id="rd3" /><Label htmlFor="rd3">Compact</Label></div>
29
+ </RadioGroup>
30
+ ),
31
+ };
32
+
33
+ export const RealisticUse: Story = {
34
+ render: () => (<RadioGroup defaultValue="comfortable" className="flex flex-col gap-2 w-[280px]">
35
+ <div className="flex items-center gap-2"><RadioGroupItem value="default" id="r1" /><Label htmlFor="r1">Default</Label></div>
36
+ <div className="flex items-center gap-2"><RadioGroupItem value="comfortable" id="r2" /><Label htmlFor="r2">Comfortable</Label></div>
37
+ <div className="flex items-center gap-2"><RadioGroupItem value="compact" id="r3" /><Label htmlFor="r3">Compact</Label></div>
38
+ </RadioGroup>),
39
+ };
@@ -0,0 +1,102 @@
1
+ import * as React from "react";
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ import { RatingGroup } from "@behavioral-agentic-design-system/core/components/ui/rating-group";
4
+
5
+ const meta: Meta<typeof RatingGroup> = {
6
+ title: "Components/RatingGroup",
7
+ component: RatingGroup,
8
+ parameters: { layout: "centered" },
9
+ tags: ["autodocs"],
10
+ };
11
+
12
+ export default meta;
13
+ type Story = StoryObj<typeof meta>;
14
+
15
+ export const Default: Story = {
16
+ render: () => {
17
+ const [value, setValue] = React.useState(0);
18
+ return <RatingGroup value={value} onValueChange={setValue} label="Rate this session" />;
19
+ },
20
+ };
21
+
22
+ export const Size_Small: Story = {
23
+ render: () => {
24
+ const [value, setValue] = React.useState(3);
25
+ return (
26
+ <div className="flex flex-col items-center gap-2">
27
+ <RatingGroup size="sm" value={value} onValueChange={setValue} label="Rating" />
28
+ <p className="text-xs text-muted-foreground">sm — 16px stars</p>
29
+ </div>
30
+ );
31
+ },
32
+ };
33
+
34
+ export const Size_Default: Story = {
35
+ render: () => {
36
+ const [value, setValue] = React.useState(3);
37
+ return <RatingGroup size="default" value={value} onValueChange={setValue} label="Rating" />;
38
+ },
39
+ };
40
+
41
+ export const Size_Large: Story = {
42
+ render: () => {
43
+ const [value, setValue] = React.useState(3);
44
+ return <RatingGroup size="lg" value={value} onValueChange={setValue} label="Rating" />;
45
+ },
46
+ };
47
+
48
+ export const Variant_ReadOnly: Story = {
49
+ render: () => (
50
+ <RatingGroup value={4} readOnly label="Average rating" />
51
+ ),
52
+ };
53
+
54
+ export const Variant_CustomMax: Story = {
55
+ render: () => {
56
+ const [value, setValue] = React.useState(0);
57
+ return <RatingGroup value={value} onValueChange={setValue} max={10} label="Rate out of 10" />;
58
+ },
59
+ };
60
+
61
+ export const Disabled: Story = {
62
+ render: () => <RatingGroup value={2} disabled label="Rating" />,
63
+ };
64
+
65
+ export const RealisticUse: Story = {
66
+ render: () => {
67
+ const [value, setValue] = React.useState(0);
68
+ const [submitted, setSubmitted] = React.useState(false);
69
+ const labels = ["", "Needs work", "Below average", "Average", "Good", "Excellent"];
70
+ return (
71
+ <div className="w-72 rounded-lg border border-border bg-card p-4 space-y-4">
72
+ <div className="space-y-1">
73
+ <p className="text-sm font-semibold">Rate your practice session</p>
74
+ <p className="text-xs text-muted-foreground">Breezy Hills Aquatic Club — Tuesday AM</p>
75
+ </div>
76
+ {submitted ? (
77
+ <div className="space-y-2">
78
+ <RatingGroup value={value} readOnly label="Your rating" />
79
+ <p className="text-sm text-muted-foreground">Thanks for your feedback!</p>
80
+ </div>
81
+ ) : (
82
+ <div className="space-y-3">
83
+ <div className="space-y-1.5">
84
+ <RatingGroup value={value} onValueChange={setValue} label="Session rating" />
85
+ {value > 0 && (
86
+ <p className="text-xs text-muted-foreground">{labels[value]}</p>
87
+ )}
88
+ </div>
89
+ <button
90
+ type="button"
91
+ disabled={value === 0}
92
+ onClick={() => setSubmitted(true)}
93
+ className="w-full rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground min-h-11 disabled:opacity-40 disabled:cursor-not-allowed transition-opacity"
94
+ >
95
+ Submit rating
96
+ </button>
97
+ </div>
98
+ )}
99
+ </div>
100
+ );
101
+ },
102
+ };
@@ -0,0 +1,28 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from "@behavioral-agentic-design-system/core/components/ui/resizable";
3
+
4
+ const meta: Meta<typeof ResizablePanelGroup> = {
5
+ title: "Components/Resizable",
6
+ component: ResizablePanelGroup,
7
+ parameters: { layout: "centered" },
8
+ tags: ["autodocs"],
9
+ };
10
+
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+
14
+ export const Default: Story = {
15
+ render: () => (<ResizablePanelGroup direction="horizontal" className="h-40 w-[420px] rounded-md border">
16
+ <ResizablePanel defaultSize={40}><div className="p-3 text-sm">Left</div></ResizablePanel>
17
+ <ResizableHandle />
18
+ <ResizablePanel defaultSize={60}><div className="p-3 text-sm">Right</div></ResizablePanel>
19
+ </ResizablePanelGroup>),
20
+ };
21
+
22
+ export const RealisticUse: Story = {
23
+ render: () => (<ResizablePanelGroup direction="horizontal" className="h-40 w-[420px] rounded-md border">
24
+ <ResizablePanel defaultSize={40}><div className="p-3 text-sm">Left</div></ResizablePanel>
25
+ <ResizableHandle />
26
+ <ResizablePanel defaultSize={60}><div className="p-3 text-sm">Right</div></ResizablePanel>
27
+ </ResizablePanelGroup>),
28
+ };