@behavioral-agentic-design-system/core 0.16.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 (87) 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 +165 -50
  6. package/src/components/ui/code.tsx +55 -0
  7. package/src/components/ui/index.ts +0 -1
  8. package/src/components/ui/indicator.tsx +9 -7
  9. package/src/components/ui/native-select.tsx +68 -0
  10. package/src/components/ui/navigation-menu.tsx +23 -0
  11. package/src/components/ui/sheet.tsx +23 -6
  12. package/src/components/ui/spinner.tsx +14 -3
  13. package/src/components/ui/tags-input.tsx +210 -69
  14. package/src/stories/Accordion.stories.tsx +152 -0
  15. package/src/stories/Alert.stories.tsx +102 -0
  16. package/src/stories/AlertDialog.stories.tsx +125 -0
  17. package/src/stories/AspectRatio.stories.tsx +82 -0
  18. package/src/stories/Avatar.stories.tsx +36 -0
  19. package/src/stories/Badge.stories.tsx +54 -0
  20. package/src/stories/Breadcrumb.stories.tsx +36 -0
  21. package/src/stories/Button.stories.tsx +144 -0
  22. package/src/stories/ButtonGroup.stories.tsx +176 -0
  23. package/src/stories/Calendar.stories.tsx +67 -0
  24. package/src/stories/Card.stories.tsx +43 -0
  25. package/src/stories/Carousel.stories.tsx +233 -0
  26. package/src/stories/Chart.stories.tsx +174 -0
  27. package/src/stories/Checkbox.stories.tsx +32 -0
  28. package/src/stories/CircularProgress.stories.tsx +136 -0
  29. package/src/stories/Code.stories.tsx +131 -0
  30. package/src/stories/Collapsible.stories.tsx +27 -0
  31. package/src/stories/ColorPicker.stories.tsx +155 -0
  32. package/src/stories/Combobox.stories.tsx +168 -0
  33. package/src/stories/Command.stories.tsx +40 -0
  34. package/src/stories/ContextMenu.stories.tsx +293 -0
  35. package/src/stories/CopyButton.stories.tsx +111 -0
  36. package/src/stories/DatePicker.stories.tsx +176 -0
  37. package/src/stories/DateRangePicker.stories.tsx +95 -0
  38. package/src/stories/Dialog.stories.tsx +186 -0
  39. package/src/stories/DropdownMenu.stories.tsx +47 -0
  40. package/src/stories/EmptyState.stories.tsx +199 -0
  41. package/src/stories/Field.stories.tsx +155 -0
  42. package/src/stories/FileUpload.stories.tsx +134 -0
  43. package/src/stories/HoverCard.stories.tsx +149 -0
  44. package/src/stories/Indicator.stories.tsx +255 -0
  45. package/src/stories/Input.stories.tsx +69 -0
  46. package/src/stories/Kbd.stories.tsx +123 -0
  47. package/src/stories/Label.stories.tsx +27 -0
  48. package/src/stories/List.stories.tsx +159 -0
  49. package/src/stories/Menubar.stories.tsx +190 -0
  50. package/src/stories/MultiSelect.stories.tsx +107 -0
  51. package/src/stories/NativeSelect.stories.tsx +107 -0
  52. package/src/stories/NavigationMenu.stories.tsx +322 -0
  53. package/src/stories/NumberInput.stories.tsx +100 -0
  54. package/src/stories/Pagination.stories.tsx +201 -0
  55. package/src/stories/PasswordInput.stories.tsx +62 -0
  56. package/src/stories/PinInput.stories.tsx +136 -0
  57. package/src/stories/Popover.stories.tsx +37 -0
  58. package/src/stories/Progress.stories.tsx +64 -0
  59. package/src/stories/RadioGroup.stories.tsx +39 -0
  60. package/src/stories/RatingGroup.stories.tsx +102 -0
  61. package/src/stories/Resizable.stories.tsx +28 -0
  62. package/src/stories/Reveal.stories.tsx +63 -0
  63. package/src/stories/ScrollArea.stories.tsx +76 -0
  64. package/src/stories/SegmentedControl.stories.tsx +182 -0
  65. package/src/stories/Select.stories.tsx +62 -0
  66. package/src/stories/Separator.stories.tsx +28 -0
  67. package/src/stories/Sheet.stories.tsx +193 -0
  68. package/src/stories/Sidebar.stories.tsx +53 -0
  69. package/src/stories/Skeleton.stories.tsx +32 -0
  70. package/src/stories/Slider.stories.tsx +67 -0
  71. package/src/stories/Sonner.stories.tsx +146 -0
  72. package/src/stories/Spinner.stories.tsx +94 -0
  73. package/src/stories/Stepper.stories.tsx +228 -0
  74. package/src/stories/Switch.stories.tsx +58 -0
  75. package/src/stories/Table.stories.tsx +38 -0
  76. package/src/stories/Tabs.stories.tsx +128 -0
  77. package/src/stories/Tag.stories.tsx +51 -0
  78. package/src/stories/TagsInput.stories.tsx +154 -0
  79. package/src/stories/Textarea.stories.tsx +31 -0
  80. package/src/stories/TimePicker.stories.tsx +54 -0
  81. package/src/stories/Timeline.stories.tsx +263 -0
  82. package/src/stories/Toggle.stories.tsx +45 -0
  83. package/src/stories/ToggleGroup.stories.tsx +39 -0
  84. package/src/stories/Toolbar.stories.tsx +295 -0
  85. package/src/stories/Tooltip.stories.tsx +37 -0
  86. package/src/stories/TreeView.stories.tsx +293 -0
  87. package/src/components/ui/bottom-sheet.tsx +0 -133
@@ -0,0 +1,176 @@
1
+ import * as React from "react";
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ import { DatePicker } from "@behavioral-agentic-design-system/core/components/ui/date-picker";
4
+
5
+ const meta: Meta<typeof DatePicker> = {
6
+ title: "Components/DatePicker",
7
+ component: DatePicker,
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 [date, setDate] = React.useState<Date | undefined>(undefined);
18
+ return (
19
+ <div className="w-[280px]">
20
+ <DatePicker
21
+ value={date}
22
+ onValueChange={setDate}
23
+ placeholder="Pick a date"
24
+ />
25
+ </div>
26
+ );
27
+ },
28
+ };
29
+
30
+ export const Size_Small: Story = {
31
+ render: () => {
32
+ const [date, setDate] = React.useState<Date | undefined>(undefined);
33
+ return (
34
+ <div className="w-[240px]">
35
+ <DatePicker size="sm" value={date} onValueChange={setDate} />
36
+ </div>
37
+ );
38
+ },
39
+ };
40
+
41
+ export const Size_Default: Story = {
42
+ render: () => {
43
+ const [date, setDate] = React.useState<Date | undefined>(undefined);
44
+ return (
45
+ <div className="w-[280px]">
46
+ <DatePicker size="default" value={date} onValueChange={setDate} />
47
+ </div>
48
+ );
49
+ },
50
+ };
51
+
52
+ export const Size_Large: Story = {
53
+ render: () => {
54
+ const [date, setDate] = React.useState<Date | undefined>(undefined);
55
+ return (
56
+ <div className="w-[300px]">
57
+ <DatePicker size="lg" value={date} onValueChange={setDate} />
58
+ </div>
59
+ );
60
+ },
61
+ };
62
+
63
+ export const Variant_Clearable: Story = {
64
+ render: () => {
65
+ const [date, setDate] = React.useState<Date | undefined>(
66
+ new Date("2026-08-15")
67
+ );
68
+ return (
69
+ <div className="w-[280px]">
70
+ <DatePicker
71
+ value={date}
72
+ onValueChange={setDate}
73
+ clearable
74
+ placeholder="Choose date"
75
+ />
76
+ </div>
77
+ );
78
+ },
79
+ };
80
+
81
+ export const Variant_Clearable_Empty: Story = {
82
+ render: () => {
83
+ const [date, setDate] = React.useState<Date | undefined>(undefined);
84
+ return (
85
+ <div className="w-[280px] space-y-1.5">
86
+ <p className="text-xs text-muted-foreground">No date selected — clear button not shown</p>
87
+ <DatePicker
88
+ value={date}
89
+ onValueChange={setDate}
90
+ clearable
91
+ placeholder="Choose date"
92
+ />
93
+ </div>
94
+ );
95
+ },
96
+ };
97
+
98
+ export const Variant_WithBounds: Story = {
99
+ render: () => {
100
+ const [date, setDate] = React.useState<Date | undefined>(undefined);
101
+ const today = new Date();
102
+ const nextMonth = new Date(today.getFullYear(), today.getMonth() + 1, today.getDate());
103
+ return (
104
+ <div className="w-[280px] space-y-2">
105
+ <p className="text-sm text-muted-foreground">From today, next 30 days only</p>
106
+ <DatePicker
107
+ value={date}
108
+ onValueChange={setDate}
109
+ fromDate={today}
110
+ toDate={nextMonth}
111
+ placeholder="Select a date"
112
+ />
113
+ </div>
114
+ );
115
+ },
116
+ };
117
+
118
+ export const Disabled: Story = {
119
+ render: () => (
120
+ <div className="w-[280px]">
121
+ <DatePicker
122
+ disabled
123
+ value={new Date("2026-06-15")}
124
+ placeholder="Pick a date"
125
+ />
126
+ </div>
127
+ ),
128
+ };
129
+
130
+ export const RealisticUse: Story = {
131
+ render: () => {
132
+ const [startDate, setStartDate] = React.useState<Date | undefined>(undefined);
133
+ const [endDate, setEndDate] = React.useState<Date | undefined>(undefined);
134
+ return (
135
+ <div className="w-[320px] space-y-4 rounded-lg border border-border bg-card p-4">
136
+ <div className="space-y-1">
137
+ <p className="text-sm font-semibold">Schedule practice</p>
138
+ <p className="text-xs text-muted-foreground">
139
+ Choose start and end dates for the practice block
140
+ </p>
141
+ </div>
142
+ <div className="space-y-3">
143
+ <div className="space-y-1.5">
144
+ <label className="text-sm font-medium">Start date</label>
145
+ <DatePicker
146
+ value={startDate}
147
+ onValueChange={setStartDate}
148
+ placeholder="Pick start date"
149
+ clearable
150
+ toDate={endDate}
151
+ />
152
+ </div>
153
+ <div className="space-y-1.5">
154
+ <label className="text-sm font-medium">End date</label>
155
+ <DatePicker
156
+ value={endDate}
157
+ onValueChange={setEndDate}
158
+ placeholder="Pick end date"
159
+ clearable
160
+ fromDate={startDate}
161
+ />
162
+ </div>
163
+ </div>
164
+ <div className="flex justify-end">
165
+ <button
166
+ type="button"
167
+ className="rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground min-h-11 px-4"
168
+ onClick={() => {}}
169
+ >
170
+ Schedule
171
+ </button>
172
+ </div>
173
+ </div>
174
+ );
175
+ },
176
+ };
@@ -0,0 +1,95 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import * as React from "react"
3
+ import {
4
+ DateRangePicker,
5
+ DateRangeValue,
6
+ } from "@behavioral-agentic-design-system/core/components/ui/date-range-picker"
7
+
8
+ const meta: Meta<typeof DateRangePicker> = {
9
+ title: "Components/DateRangePicker",
10
+ component: DateRangePicker,
11
+ parameters: { layout: "centered" },
12
+ }
13
+ export default meta
14
+ type Story = StoryObj<typeof DateRangePicker>
15
+
16
+ export const Default: Story = {
17
+ args: {
18
+ value: {
19
+ from: new Date(2026, 5, 1),
20
+ to: new Date(2026, 5, 15),
21
+ },
22
+ size: "default",
23
+ },
24
+ render: (args) => (
25
+ <div className="w-96">
26
+ <DateRangePicker {...args} />
27
+ </div>
28
+ ),
29
+ }
30
+
31
+ export const Clearable: Story = {
32
+ render: () => {
33
+ const [range, setRange] = React.useState<DateRangeValue | undefined>({
34
+ from: new Date(2026, 5, 10),
35
+ to: new Date(2026, 5, 20),
36
+ })
37
+ return (
38
+ <div className="w-96">
39
+ <DateRangePicker value={range} onValueChange={setRange} clearable />
40
+ </div>
41
+ )
42
+ },
43
+ }
44
+
45
+ export const Sizes: Story = {
46
+ render: () => {
47
+ const range = { from: new Date(2026, 5, 1), to: new Date(2026, 5, 15) }
48
+ return (
49
+ <div className="flex flex-col gap-3 w-96">
50
+ <DateRangePicker value={range} size="sm" />
51
+ <DateRangePicker value={range} size="default" />
52
+ <DateRangePicker value={range} size="lg" />
53
+ </div>
54
+ )
55
+ },
56
+ }
57
+
58
+ export const Empty: Story = {
59
+ render: () => (
60
+ <div className="w-96">
61
+ <DateRangePicker size="default" />
62
+ </div>
63
+ ),
64
+ }
65
+
66
+ export const Disabled: Story = {
67
+ render: () => (
68
+ <div className="w-96">
69
+ <DateRangePicker
70
+ value={{ from: new Date(2026, 5, 1), to: new Date(2026, 5, 15) }}
71
+ disabled
72
+ />
73
+ </div>
74
+ ),
75
+ }
76
+
77
+ export const RealisticUse: Story = {
78
+ render: () => {
79
+ const [range, setRange] = React.useState<DateRangeValue | undefined>()
80
+ return (
81
+ <div className="flex flex-col gap-2 w-96">
82
+ <label className="text-sm font-medium">Trip dates</label>
83
+ <DateRangePicker value={range} onValueChange={setRange} clearable />
84
+ {range?.from && range?.to && (
85
+ <p className="text-xs text-muted-foreground">
86
+ {Math.round(
87
+ (range.to.getTime() - range.from.getTime()) / 86400000
88
+ )}{" "}
89
+ nights selected
90
+ </p>
91
+ )}
92
+ </div>
93
+ )
94
+ },
95
+ }
@@ -0,0 +1,186 @@
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 { Meta, StoryObj } from "@storybook/react";
8
+ import {
9
+ Dialog,
10
+ DialogTrigger,
11
+ DialogContent,
12
+ DialogHeader,
13
+ DialogTitle,
14
+ DialogDescription,
15
+ DialogFooter,
16
+ DialogClose,
17
+ } from "@behavioral-agentic-design-system/core/components/ui/dialog";
18
+ import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
19
+
20
+ const meta: Meta<typeof Dialog> = {
21
+ title: "Components/Dialog",
22
+ component: Dialog,
23
+ parameters: {
24
+ layout: "centered",
25
+ },
26
+ tags: ["autodocs"],
27
+ };
28
+
29
+ export default meta;
30
+ type Story = StoryObj<typeof meta>;
31
+
32
+ export const Default: Story = {
33
+ render: () => (
34
+ <Dialog>
35
+ <DialogTrigger asChild>
36
+ <Button>Open Dialog</Button>
37
+ </DialogTrigger>
38
+ <DialogContent>
39
+ <DialogHeader>
40
+ <DialogTitle>Dialog Title</DialogTitle>
41
+ <DialogDescription>This is a default-sized dialog.</DialogDescription>
42
+ </DialogHeader>
43
+ <div className="py-4">Dialog content goes here.</div>
44
+ <DialogFooter>
45
+ <DialogClose asChild>
46
+ <Button>Close</Button>
47
+ </DialogClose>
48
+ </DialogFooter>
49
+ </DialogContent>
50
+ </Dialog>
51
+ ),
52
+ };
53
+
54
+ export const Size_SM: Story = {
55
+ render: () => (
56
+ <Dialog>
57
+ <DialogTrigger asChild>
58
+ <Button>Open Small Dialog</Button>
59
+ </DialogTrigger>
60
+ <DialogContent size="sm">
61
+ <DialogHeader>
62
+ <DialogTitle>Small Dialog</DialogTitle>
63
+ <DialogDescription>A small dialog window.</DialogDescription>
64
+ </DialogHeader>
65
+ <div className="py-4">Small dialog content.</div>
66
+ <DialogFooter>
67
+ <DialogClose asChild>
68
+ <Button>Close</Button>
69
+ </DialogClose>
70
+ </DialogFooter>
71
+ </DialogContent>
72
+ </Dialog>
73
+ ),
74
+ };
75
+
76
+ export const Size_LG: Story = {
77
+ render: () => (
78
+ <Dialog>
79
+ <DialogTrigger asChild>
80
+ <Button>Open Large Dialog</Button>
81
+ </DialogTrigger>
82
+ <DialogContent size="lg">
83
+ <DialogHeader>
84
+ <DialogTitle>Large Dialog</DialogTitle>
85
+ <DialogDescription>A large dialog window for more content.</DialogDescription>
86
+ </DialogHeader>
87
+ <div className="py-4">Large dialog content with more room.</div>
88
+ <DialogFooter>
89
+ <DialogClose asChild>
90
+ <Button>Close</Button>
91
+ </DialogClose>
92
+ </DialogFooter>
93
+ </DialogContent>
94
+ </Dialog>
95
+ ),
96
+ };
97
+
98
+ export const Size_XL: Story = {
99
+ render: () => (
100
+ <Dialog>
101
+ <DialogTrigger asChild>
102
+ <Button>Open XL Dialog</Button>
103
+ </DialogTrigger>
104
+ <DialogContent size="xl">
105
+ <DialogHeader>
106
+ <DialogTitle>Extra Large Dialog</DialogTitle>
107
+ <DialogDescription>An extra large dialog for complex layouts.</DialogDescription>
108
+ </DialogHeader>
109
+ <div className="py-4">XL dialog content with lots of space.</div>
110
+ <DialogFooter>
111
+ <DialogClose asChild>
112
+ <Button>Close</Button>
113
+ </DialogClose>
114
+ </DialogFooter>
115
+ </DialogContent>
116
+ </Dialog>
117
+ ),
118
+ };
119
+
120
+ export const Size_2XL: Story = {
121
+ render: () => (
122
+ <Dialog>
123
+ <DialogTrigger asChild>
124
+ <Button>Open 2XL Dialog</Button>
125
+ </DialogTrigger>
126
+ <DialogContent size="2xl">
127
+ <DialogHeader>
128
+ <DialogTitle>2X Large Dialog</DialogTitle>
129
+ <DialogDescription>A 2X large dialog for maximum content area.</DialogDescription>
130
+ </DialogHeader>
131
+ <div className="py-4">2XL dialog content with expansive space.</div>
132
+ <DialogFooter>
133
+ <DialogClose asChild>
134
+ <Button>Close</Button>
135
+ </DialogClose>
136
+ </DialogFooter>
137
+ </DialogContent>
138
+ </Dialog>
139
+ ),
140
+ };
141
+
142
+ export const Size_Full: Story = {
143
+ render: () => (
144
+ <Dialog>
145
+ <DialogTrigger asChild>
146
+ <Button>Open Full Dialog</Button>
147
+ </DialogTrigger>
148
+ <DialogContent size="full">
149
+ <DialogHeader>
150
+ <DialogTitle>Full-Width Dialog</DialogTitle>
151
+ <DialogDescription>A dialog that takes up almost the full viewport.</DialogDescription>
152
+ </DialogHeader>
153
+ <div className="py-4">Full-width dialog content.</div>
154
+ <DialogFooter>
155
+ <DialogClose asChild>
156
+ <Button>Close</Button>
157
+ </DialogClose>
158
+ </DialogFooter>
159
+ </DialogContent>
160
+ </Dialog>
161
+ ),
162
+ };
163
+
164
+ export const RealisticUse: Story = {
165
+ render: () => (
166
+ <Dialog>
167
+ <DialogTrigger asChild>
168
+ <Button>Confirm Action</Button>
169
+ </DialogTrigger>
170
+ <DialogContent size="sm">
171
+ <DialogHeader>
172
+ <DialogTitle>Confirm Deletion</DialogTitle>
173
+ <DialogDescription>This action cannot be undone.</DialogDescription>
174
+ </DialogHeader>
175
+ <div className="py-4">Are you sure you want to delete this item?</div>
176
+ <DialogFooter>
177
+ <DialogClose asChild>
178
+ <Button variant="outline">Cancel</Button>
179
+ </DialogClose>
180
+ <Button variant="destructive">Delete</Button>
181
+ </DialogFooter>
182
+ </DialogContent>
183
+ </Dialog>
184
+ ),
185
+ };
186
+
@@ -0,0 +1,47 @@
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 { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "@behavioral-agentic-design-system/core/components/ui/dropdown-menu";
9
+ import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
10
+
11
+ const meta: Meta<typeof DropdownMenu> = {
12
+ title: "Components/DropdownMenu",
13
+ component: DropdownMenu,
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: () => (<DropdownMenu>
23
+ <DropdownMenuTrigger asChild><Button variant="outline">Open menu</Button></DropdownMenuTrigger>
24
+ <DropdownMenuContent>
25
+ <DropdownMenuLabel>Account</DropdownMenuLabel>
26
+ <DropdownMenuSeparator />
27
+ <DropdownMenuItem>Profile</DropdownMenuItem>
28
+ <DropdownMenuItem>Settings</DropdownMenuItem>
29
+ <DropdownMenuSeparator />
30
+ <DropdownMenuItem>Log out</DropdownMenuItem>
31
+ </DropdownMenuContent>
32
+ </DropdownMenu>),
33
+ };
34
+
35
+ export const RealisticUse: Story = {
36
+ render: () => (<DropdownMenu>
37
+ <DropdownMenuTrigger asChild><Button variant="outline">Open menu</Button></DropdownMenuTrigger>
38
+ <DropdownMenuContent>
39
+ <DropdownMenuLabel>Account</DropdownMenuLabel>
40
+ <DropdownMenuSeparator />
41
+ <DropdownMenuItem>Profile</DropdownMenuItem>
42
+ <DropdownMenuItem>Settings</DropdownMenuItem>
43
+ <DropdownMenuSeparator />
44
+ <DropdownMenuItem>Log out</DropdownMenuItem>
45
+ </DropdownMenuContent>
46
+ </DropdownMenu>),
47
+ };
@@ -0,0 +1,199 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import * as React from "react"
3
+ import {
4
+ InboxIcon,
5
+ SearchIcon,
6
+ CalendarIcon,
7
+ UsersIcon,
8
+ WifiOffIcon,
9
+ ClipboardListIcon,
10
+ TrophyIcon,
11
+ PlusIcon,
12
+ } from "lucide-react"
13
+ import {
14
+ EmptyState,
15
+ EmptyStateIcon,
16
+ EmptyStateTitle,
17
+ EmptyStateDescription,
18
+ EmptyStateAction,
19
+ } from "@behavioral-agentic-design-system/core/components/ui/empty-state"
20
+ import { Button } from "@behavioral-agentic-design-system/core/components/ui/button"
21
+
22
+ const meta: Meta<typeof EmptyState> = {
23
+ title: "Components/EmptyState",
24
+ component: EmptyState,
25
+ parameters: {
26
+ layout: "centered",
27
+ docs: {
28
+ description: {
29
+ component:
30
+ "Composable empty-state primitive: icon container, title, description, and optional action slot. Three size variants (sm/default/lg) for inline card contexts through full-page zero-data screens.",
31
+ },
32
+ },
33
+ },
34
+ tags: ["autodocs"],
35
+ }
36
+ export default meta
37
+
38
+ type Story = StoryObj<typeof EmptyState>
39
+
40
+ export const Default: Story = {
41
+ render: () => (
42
+ <EmptyState className="w-80">
43
+ <EmptyStateIcon>
44
+ <InboxIcon />
45
+ </EmptyStateIcon>
46
+ <EmptyStateTitle>No messages yet</EmptyStateTitle>
47
+ <EmptyStateDescription>
48
+ Messages from your coach will appear here after your first session.
49
+ </EmptyStateDescription>
50
+ </EmptyState>
51
+ ),
52
+ }
53
+
54
+ export const WithAction: Story = {
55
+ render: () => (
56
+ <EmptyState className="w-80">
57
+ <EmptyStateIcon>
58
+ <CalendarIcon />
59
+ </EmptyStateIcon>
60
+ <EmptyStateTitle>No practices scheduled</EmptyStateTitle>
61
+ <EmptyStateDescription>
62
+ Add your first practice block to start tracking attendance and yardage.
63
+ </EmptyStateDescription>
64
+ <EmptyStateAction>
65
+ <Button>
66
+ <PlusIcon strokeWidth={1.5} />
67
+ Schedule practice
68
+ </Button>
69
+ </EmptyStateAction>
70
+ </EmptyState>
71
+ ),
72
+ }
73
+
74
+ export const WithDualActions: Story = {
75
+ render: () => (
76
+ <EmptyState className="w-80">
77
+ <EmptyStateIcon>
78
+ <UsersIcon />
79
+ </EmptyStateIcon>
80
+ <EmptyStateTitle>No swimmers in this group</EmptyStateTitle>
81
+ <EmptyStateDescription>
82
+ Add swimmers individually or import a roster from SwimTopia.
83
+ </EmptyStateDescription>
84
+ <EmptyStateAction>
85
+ <Button>
86
+ <PlusIcon strokeWidth={1.5} />
87
+ Add swimmer
88
+ </Button>
89
+ <Button variant="outline">Import roster</Button>
90
+ </EmptyStateAction>
91
+ </EmptyState>
92
+ ),
93
+ }
94
+
95
+ export const SearchEmpty: Story = {
96
+ render: () => (
97
+ <EmptyState className="w-80">
98
+ <EmptyStateIcon>
99
+ <SearchIcon />
100
+ </EmptyStateIcon>
101
+ <EmptyStateTitle>No results for "butterfly relay"</EmptyStateTitle>
102
+ <EmptyStateDescription>
103
+ Try different keywords or check the event name spelling.
104
+ </EmptyStateDescription>
105
+ <EmptyStateAction>
106
+ <Button variant="outline">Clear search</Button>
107
+ </EmptyStateAction>
108
+ </EmptyState>
109
+ ),
110
+ }
111
+
112
+ export const ErrorState: Story = {
113
+ render: () => (
114
+ <EmptyState className="w-80">
115
+ <EmptyStateIcon className="bg-destructive/10 text-destructive">
116
+ <WifiOffIcon />
117
+ </EmptyStateIcon>
118
+ <EmptyStateTitle>Couldn&apos;t load roster</EmptyStateTitle>
119
+ <EmptyStateDescription>
120
+ Check your connection and try again. Your data is safe.
121
+ </EmptyStateDescription>
122
+ <EmptyStateAction>
123
+ <Button variant="outline">Retry</Button>
124
+ </EmptyStateAction>
125
+ </EmptyState>
126
+ ),
127
+ }
128
+
129
+ export const Size_Sm: Story = {
130
+ render: () => (
131
+ <EmptyState size="sm" className="w-64 border border-border rounded-lg">
132
+ <EmptyStateIcon className="size-9 [&>svg]:size-5">
133
+ <ClipboardListIcon />
134
+ </EmptyStateIcon>
135
+ <EmptyStateTitle>No notes</EmptyStateTitle>
136
+ <EmptyStateDescription>Add a note to this set.</EmptyStateDescription>
137
+ </EmptyState>
138
+ ),
139
+ }
140
+
141
+ export const Size_Default: Story = {
142
+ render: () => (
143
+ <EmptyState size="default" className="w-80">
144
+ <EmptyStateIcon>
145
+ <InboxIcon />
146
+ </EmptyStateIcon>
147
+ <EmptyStateTitle>Default size</EmptyStateTitle>
148
+ <EmptyStateDescription>
149
+ Standard spacing for most card and panel contexts.
150
+ </EmptyStateDescription>
151
+ </EmptyState>
152
+ ),
153
+ }
154
+
155
+ export const Size_Lg: Story = {
156
+ render: () => (
157
+ <EmptyState size="lg" className="w-96">
158
+ <EmptyStateIcon className="size-16 [&>svg]:size-8">
159
+ <TrophyIcon />
160
+ </EmptyStateIcon>
161
+ <EmptyStateTitle>Season results are not in yet</EmptyStateTitle>
162
+ <EmptyStateDescription>
163
+ Championship results will appear here once the meet director submits scores.
164
+ </EmptyStateDescription>
165
+ </EmptyState>
166
+ ),
167
+ }
168
+
169
+ export const RealisticUse: Story = {
170
+ render: () => (
171
+ <div className="w-[400px] rounded-xl border border-border bg-card overflow-hidden">
172
+ {/* Card header */}
173
+ <div className="px-5 py-4 border-b border-border flex items-center justify-between">
174
+ <div>
175
+ <p className="text-sm font-semibold">Upcoming meets</p>
176
+ <p className="text-xs text-muted-foreground mt-0.5">Breezy Hills Aquatic Club</p>
177
+ </div>
178
+ <Button variant="outline" size="sm">
179
+ <PlusIcon strokeWidth={1.5} />
180
+ Add meet
181
+ </Button>
182
+ </div>
183
+ {/* Empty state body */}
184
+ <EmptyState size="default">
185
+ <EmptyStateIcon>
186
+ <CalendarIcon />
187
+ </EmptyStateIcon>
188
+ <EmptyStateTitle>No meets registered yet</EmptyStateTitle>
189
+ <EmptyStateDescription>
190
+ Register for your first meet on SwimTopia, then sync it here.
191
+ </EmptyStateDescription>
192
+ <EmptyStateAction>
193
+ <Button size="sm">Register on SwimTopia</Button>
194
+ <Button variant="ghost" size="sm">Learn more</Button>
195
+ </EmptyStateAction>
196
+ </EmptyState>
197
+ </div>
198
+ ),
199
+ }