@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.
- package/package.json +1 -1
- package/scripts/check-stories.mjs +12 -5
- package/scripts/fix-stories.mjs +6 -6
- package/scripts/generate-stories.cjs +7 -7
- package/src/app/preview/components/page.tsx +165 -50
- package/src/components/ui/code.tsx +55 -0
- package/src/components/ui/index.ts +0 -1
- package/src/components/ui/indicator.tsx +9 -7
- package/src/components/ui/native-select.tsx +68 -0
- package/src/components/ui/navigation-menu.tsx +23 -0
- package/src/components/ui/sheet.tsx +23 -6
- package/src/components/ui/spinner.tsx +14 -3
- package/src/components/ui/tags-input.tsx +210 -69
- package/src/stories/Accordion.stories.tsx +152 -0
- package/src/stories/Alert.stories.tsx +102 -0
- package/src/stories/AlertDialog.stories.tsx +125 -0
- package/src/stories/AspectRatio.stories.tsx +82 -0
- package/src/stories/Avatar.stories.tsx +36 -0
- package/src/stories/Badge.stories.tsx +54 -0
- package/src/stories/Breadcrumb.stories.tsx +36 -0
- package/src/stories/Button.stories.tsx +144 -0
- package/src/stories/ButtonGroup.stories.tsx +176 -0
- package/src/stories/Calendar.stories.tsx +67 -0
- package/src/stories/Card.stories.tsx +43 -0
- package/src/stories/Carousel.stories.tsx +233 -0
- package/src/stories/Chart.stories.tsx +174 -0
- package/src/stories/Checkbox.stories.tsx +32 -0
- package/src/stories/CircularProgress.stories.tsx +136 -0
- package/src/stories/Code.stories.tsx +131 -0
- package/src/stories/Collapsible.stories.tsx +27 -0
- package/src/stories/ColorPicker.stories.tsx +155 -0
- package/src/stories/Combobox.stories.tsx +168 -0
- package/src/stories/Command.stories.tsx +40 -0
- package/src/stories/ContextMenu.stories.tsx +293 -0
- package/src/stories/CopyButton.stories.tsx +111 -0
- package/src/stories/DatePicker.stories.tsx +176 -0
- package/src/stories/DateRangePicker.stories.tsx +95 -0
- package/src/stories/Dialog.stories.tsx +186 -0
- package/src/stories/DropdownMenu.stories.tsx +47 -0
- package/src/stories/EmptyState.stories.tsx +199 -0
- package/src/stories/Field.stories.tsx +155 -0
- package/src/stories/FileUpload.stories.tsx +134 -0
- package/src/stories/HoverCard.stories.tsx +149 -0
- package/src/stories/Indicator.stories.tsx +255 -0
- package/src/stories/Input.stories.tsx +69 -0
- package/src/stories/Kbd.stories.tsx +123 -0
- package/src/stories/Label.stories.tsx +27 -0
- package/src/stories/List.stories.tsx +159 -0
- package/src/stories/Menubar.stories.tsx +190 -0
- package/src/stories/MultiSelect.stories.tsx +107 -0
- package/src/stories/NativeSelect.stories.tsx +107 -0
- package/src/stories/NavigationMenu.stories.tsx +322 -0
- package/src/stories/NumberInput.stories.tsx +100 -0
- package/src/stories/Pagination.stories.tsx +201 -0
- package/src/stories/PasswordInput.stories.tsx +62 -0
- package/src/stories/PinInput.stories.tsx +136 -0
- package/src/stories/Popover.stories.tsx +37 -0
- package/src/stories/Progress.stories.tsx +64 -0
- package/src/stories/RadioGroup.stories.tsx +39 -0
- package/src/stories/RatingGroup.stories.tsx +102 -0
- package/src/stories/Resizable.stories.tsx +28 -0
- package/src/stories/Reveal.stories.tsx +63 -0
- package/src/stories/ScrollArea.stories.tsx +76 -0
- package/src/stories/SegmentedControl.stories.tsx +182 -0
- package/src/stories/Select.stories.tsx +62 -0
- package/src/stories/Separator.stories.tsx +28 -0
- package/src/stories/Sheet.stories.tsx +193 -0
- package/src/stories/Sidebar.stories.tsx +53 -0
- package/src/stories/Skeleton.stories.tsx +32 -0
- package/src/stories/Slider.stories.tsx +67 -0
- package/src/stories/Sonner.stories.tsx +146 -0
- package/src/stories/Spinner.stories.tsx +94 -0
- package/src/stories/Stepper.stories.tsx +228 -0
- package/src/stories/Switch.stories.tsx +58 -0
- package/src/stories/Table.stories.tsx +38 -0
- package/src/stories/Tabs.stories.tsx +128 -0
- package/src/stories/Tag.stories.tsx +51 -0
- package/src/stories/TagsInput.stories.tsx +154 -0
- package/src/stories/Textarea.stories.tsx +31 -0
- package/src/stories/TimePicker.stories.tsx +54 -0
- package/src/stories/Timeline.stories.tsx +263 -0
- package/src/stories/Toggle.stories.tsx +45 -0
- package/src/stories/ToggleGroup.stories.tsx +39 -0
- package/src/stories/Toolbar.stories.tsx +295 -0
- package/src/stories/Tooltip.stories.tsx +37 -0
- package/src/stories/TreeView.stories.tsx +293 -0
- package/src/components/ui/bottom-sheet.tsx +0 -133
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Input } from "@behavioral-agentic-design-system/core/components/ui/input";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Input> = {
|
|
5
|
+
title: "Components/Input",
|
|
6
|
+
component: Input,
|
|
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
|
+
args: {
|
|
18
|
+
placeholder: "Enter text...",
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const Size_SM: Story = {
|
|
23
|
+
args: {
|
|
24
|
+
size: "sm",
|
|
25
|
+
placeholder: "Small input",
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const Size_LG: Story = {
|
|
30
|
+
args: {
|
|
31
|
+
size: "lg",
|
|
32
|
+
placeholder: "Large input",
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const Size_XL: Story = {
|
|
37
|
+
args: {
|
|
38
|
+
size: "xl",
|
|
39
|
+
placeholder: "Extra large input",
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const Size_2XL: Story = {
|
|
44
|
+
args: {
|
|
45
|
+
size: "2xl",
|
|
46
|
+
placeholder: "2X large input",
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const Disabled: Story = {
|
|
51
|
+
args: {
|
|
52
|
+
placeholder: "Disabled input",
|
|
53
|
+
disabled: true,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const WithError: Story = {
|
|
58
|
+
args: {
|
|
59
|
+
placeholder: "Input with error",
|
|
60
|
+
"aria-invalid": true,
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const RealisticUse: Story = {
|
|
65
|
+
args: {
|
|
66
|
+
type: "email",
|
|
67
|
+
placeholder: "your@email.com",
|
|
68
|
+
},
|
|
69
|
+
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import { Kbd } from "@behavioral-agentic-design-system/core/components/ui/kbd";
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Kbd> = {
|
|
6
|
+
title: "Components/Kbd",
|
|
7
|
+
component: Kbd,
|
|
8
|
+
parameters: { layout: "centered" },
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
argTypes: {
|
|
11
|
+
variant: { control: "select", options: ["default", "outline"] },
|
|
12
|
+
size: { control: "select", options: ["sm", "default"] },
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default meta;
|
|
17
|
+
type Story = StoryObj<typeof meta>;
|
|
18
|
+
|
|
19
|
+
export const Default: Story = {
|
|
20
|
+
render: () => <Kbd>⌘K</Kbd>,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const Variant_Default: Story = {
|
|
24
|
+
render: () => (
|
|
25
|
+
<div className="flex items-center gap-2">
|
|
26
|
+
<Kbd variant="default">⌘</Kbd>
|
|
27
|
+
<Kbd variant="default">K</Kbd>
|
|
28
|
+
</div>
|
|
29
|
+
),
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const Variant_Outline: Story = {
|
|
33
|
+
render: () => (
|
|
34
|
+
<div className="flex items-center gap-2">
|
|
35
|
+
<Kbd variant="outline">⌘</Kbd>
|
|
36
|
+
<Kbd variant="outline">K</Kbd>
|
|
37
|
+
</div>
|
|
38
|
+
),
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const Size_Sm: Story = {
|
|
42
|
+
render: () => (
|
|
43
|
+
<div className="flex items-center gap-2">
|
|
44
|
+
<Kbd size="sm">⌘</Kbd>
|
|
45
|
+
<Kbd size="sm">Shift</Kbd>
|
|
46
|
+
<Kbd size="sm">K</Kbd>
|
|
47
|
+
</div>
|
|
48
|
+
),
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const Size_Default: Story = {
|
|
52
|
+
render: () => (
|
|
53
|
+
<div className="flex items-center gap-2">
|
|
54
|
+
<Kbd size="default">⌘</Kbd>
|
|
55
|
+
<Kbd size="default">Shift</Kbd>
|
|
56
|
+
<Kbd size="default">K</Kbd>
|
|
57
|
+
</div>
|
|
58
|
+
),
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const CommonShortcuts: Story = {
|
|
62
|
+
render: () => (
|
|
63
|
+
<div className="flex flex-col gap-3">
|
|
64
|
+
<div className="flex items-center gap-1.5">
|
|
65
|
+
<Kbd>⌘</Kbd>
|
|
66
|
+
<Kbd>K</Kbd>
|
|
67
|
+
<span className="ml-2 text-sm text-muted-foreground">Open command palette</span>
|
|
68
|
+
</div>
|
|
69
|
+
<div className="flex items-center gap-1.5">
|
|
70
|
+
<Kbd>⌘</Kbd>
|
|
71
|
+
<Kbd>Shift</Kbd>
|
|
72
|
+
<Kbd>P</Kbd>
|
|
73
|
+
<span className="ml-2 text-sm text-muted-foreground">Command menu</span>
|
|
74
|
+
</div>
|
|
75
|
+
<div className="flex items-center gap-1.5">
|
|
76
|
+
<Kbd>Ctrl</Kbd>
|
|
77
|
+
<Kbd>Z</Kbd>
|
|
78
|
+
<span className="ml-2 text-sm text-muted-foreground">Undo</span>
|
|
79
|
+
</div>
|
|
80
|
+
<div className="flex items-center gap-1.5">
|
|
81
|
+
<Kbd>Esc</Kbd>
|
|
82
|
+
<span className="ml-2 text-sm text-muted-foreground">Dismiss</span>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
),
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const RealisticUse: Story = {
|
|
89
|
+
decorators: [
|
|
90
|
+
(Story) => (
|
|
91
|
+
<div className="w-[360px] rounded-lg border bg-card p-5 shadow-sm">
|
|
92
|
+
<Story />
|
|
93
|
+
</div>
|
|
94
|
+
),
|
|
95
|
+
],
|
|
96
|
+
render: () => (
|
|
97
|
+
<div className="space-y-4">
|
|
98
|
+
<div>
|
|
99
|
+
<h3 className="text-sm font-semibold text-foreground">Keyboard shortcuts</h3>
|
|
100
|
+
<p className="mt-0.5 text-sm text-muted-foreground">Use these to navigate faster.</p>
|
|
101
|
+
</div>
|
|
102
|
+
<div className="space-y-2">
|
|
103
|
+
{[
|
|
104
|
+
{ keys: ["⌘", "K"], label: "Open command palette" },
|
|
105
|
+
{ keys: ["⌘", "Shift", "F"], label: "Search across files" },
|
|
106
|
+
{ keys: ["⌘", "B"], label: "Toggle sidebar" },
|
|
107
|
+
{ keys: ["⌘", "Z"], label: "Undo last action" },
|
|
108
|
+
{ keys: ["⌘", "Shift", "Z"], label: "Redo" },
|
|
109
|
+
{ keys: ["⌘", "/"], label: "Toggle comment" },
|
|
110
|
+
].map(({ keys, label }) => (
|
|
111
|
+
<div key={label} className="flex items-center justify-between">
|
|
112
|
+
<span className="text-sm text-foreground">{label}</span>
|
|
113
|
+
<div className="flex items-center gap-1">
|
|
114
|
+
{keys.map((key) => (
|
|
115
|
+
<Kbd key={key} size="sm">{key}</Kbd>
|
|
116
|
+
))}
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
))}
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
),
|
|
123
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Label } from "@behavioral-agentic-design-system/core/components/ui/label";
|
|
3
|
+
import { Input } from "@behavioral-agentic-design-system/core/components/ui/input";
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Label> = {
|
|
6
|
+
title: "Components/Label",
|
|
7
|
+
component: Label,
|
|
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: () => (<div className="flex flex-col gap-2 w-[280px]">
|
|
17
|
+
<Label htmlFor="email">Email</Label>
|
|
18
|
+
<Input id="email" type="email" placeholder="m@example.com" />
|
|
19
|
+
</div>),
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const RealisticUse: Story = {
|
|
23
|
+
render: () => (<div className="flex flex-col gap-2 w-[280px]">
|
|
24
|
+
<Label htmlFor="email">Email</Label>
|
|
25
|
+
<Input id="email" type="email" placeholder="m@example.com" />
|
|
26
|
+
</div>),
|
|
27
|
+
};
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import * as React from "react"
|
|
3
|
+
import {
|
|
4
|
+
CheckIcon,
|
|
5
|
+
CircleIcon,
|
|
6
|
+
FileTextIcon,
|
|
7
|
+
ShieldCheckIcon,
|
|
8
|
+
StarIcon,
|
|
9
|
+
XIcon,
|
|
10
|
+
ZapIcon,
|
|
11
|
+
} from "lucide-react"
|
|
12
|
+
import { List, ListItem } from "@behavioral-agentic-design-system/core/components/ui/list"
|
|
13
|
+
|
|
14
|
+
const meta: Meta<typeof List> = {
|
|
15
|
+
title: "Components/List",
|
|
16
|
+
component: List,
|
|
17
|
+
parameters: {
|
|
18
|
+
layout: "centered",
|
|
19
|
+
docs: {
|
|
20
|
+
description: {
|
|
21
|
+
component:
|
|
22
|
+
"Semantic ordered/unordered list primitive with optional icon slots, token-driven spacing, and composable sub-items.",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
tags: ["autodocs"],
|
|
27
|
+
}
|
|
28
|
+
export default meta
|
|
29
|
+
|
|
30
|
+
type Story = StoryObj<typeof List>
|
|
31
|
+
|
|
32
|
+
export const Default: Story = {
|
|
33
|
+
render: () => (
|
|
34
|
+
<List className="w-64">
|
|
35
|
+
<ListItem>Practice every Monday at 6 AM</ListItem>
|
|
36
|
+
<ListItem>Check the coach board for lane assignments</ListItem>
|
|
37
|
+
<ListItem>Bring your own cap and goggles</ListItem>
|
|
38
|
+
<ListItem>Sign in at the front desk before entering the pool</ListItem>
|
|
39
|
+
</List>
|
|
40
|
+
),
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const WithIcons: Story = {
|
|
44
|
+
render: () => (
|
|
45
|
+
<List className="w-64">
|
|
46
|
+
<ListItem icon={<CheckIcon />}>Pool access included</ListItem>
|
|
47
|
+
<ListItem icon={<CheckIcon />}>Video stroke analysis</ListItem>
|
|
48
|
+
<ListItem icon={<CheckIcon />}>Monthly progress report</ListItem>
|
|
49
|
+
<ListItem icon={<XIcon className="text-destructive" />}>
|
|
50
|
+
Open swim excluded
|
|
51
|
+
</ListItem>
|
|
52
|
+
</List>
|
|
53
|
+
),
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const Ordered: Story = {
|
|
57
|
+
render: () => (
|
|
58
|
+
<List type="ol" className="w-64">
|
|
59
|
+
<ListItem icon={<span className="font-mono text-xs text-muted-foreground select-none">01</span>}>
|
|
60
|
+
Register for the meet on SwimTopia
|
|
61
|
+
</ListItem>
|
|
62
|
+
<ListItem icon={<span className="font-mono text-xs text-muted-foreground select-none">02</span>}>
|
|
63
|
+
Submit event entries by Friday
|
|
64
|
+
</ListItem>
|
|
65
|
+
<ListItem icon={<span className="font-mono text-xs text-muted-foreground select-none">03</span>}>
|
|
66
|
+
Pick up your heat sheet at the tent
|
|
67
|
+
</ListItem>
|
|
68
|
+
<ListItem icon={<span className="font-mono text-xs text-muted-foreground select-none">04</span>}>
|
|
69
|
+
Report to the marshaling area 15 min before your event
|
|
70
|
+
</ListItem>
|
|
71
|
+
</List>
|
|
72
|
+
),
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const Spacing_Sm: Story = {
|
|
76
|
+
render: () => (
|
|
77
|
+
<List spacing="sm" className="w-64">
|
|
78
|
+
<ListItem icon={<ZapIcon />}>Fast warm-up</ListItem>
|
|
79
|
+
<ListItem icon={<ZapIcon />}>Drill set</ListItem>
|
|
80
|
+
<ListItem icon={<ZapIcon />}>Main set</ListItem>
|
|
81
|
+
<ListItem icon={<ZapIcon />}>Cool-down</ListItem>
|
|
82
|
+
</List>
|
|
83
|
+
),
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export const Spacing_Default: Story = {
|
|
87
|
+
render: () => (
|
|
88
|
+
<List spacing="default" className="w-64">
|
|
89
|
+
<ListItem icon={<CircleIcon />}>Default spacing</ListItem>
|
|
90
|
+
<ListItem icon={<CircleIcon />}>Between items</ListItem>
|
|
91
|
+
<ListItem icon={<CircleIcon />}>Gap 2 (8 px)</ListItem>
|
|
92
|
+
</List>
|
|
93
|
+
),
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export const Spacing_Lg: Story = {
|
|
97
|
+
render: () => (
|
|
98
|
+
<List spacing="lg" className="w-64">
|
|
99
|
+
<ListItem icon={<StarIcon />}>Generous spacing</ListItem>
|
|
100
|
+
<ListItem icon={<StarIcon />}>For content-heavy lists</ListItem>
|
|
101
|
+
<ListItem icon={<StarIcon />}>Gap 3 (12 px)</ListItem>
|
|
102
|
+
</List>
|
|
103
|
+
),
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export const Nested: Story = {
|
|
107
|
+
render: () => (
|
|
108
|
+
<List className="w-72">
|
|
109
|
+
<ListItem icon={<FileTextIcon />}>
|
|
110
|
+
<span className="font-medium">Season schedule</span>
|
|
111
|
+
<List spacing="sm" className="mt-2">
|
|
112
|
+
<ListItem icon={<CircleIcon className="size-2" />}>
|
|
113
|
+
Early season: Dec–Feb
|
|
114
|
+
</ListItem>
|
|
115
|
+
<ListItem icon={<CircleIcon className="size-2" />}>
|
|
116
|
+
Championship season: Mar–Apr
|
|
117
|
+
</ListItem>
|
|
118
|
+
</List>
|
|
119
|
+
</ListItem>
|
|
120
|
+
<ListItem icon={<FileTextIcon />}>
|
|
121
|
+
<span className="font-medium">Equipment list</span>
|
|
122
|
+
<List spacing="sm" className="mt-2">
|
|
123
|
+
<ListItem icon={<CircleIcon className="size-2" />}>Fins and paddles</ListItem>
|
|
124
|
+
<ListItem icon={<CircleIcon className="size-2" />}>Pull buoy</ListItem>
|
|
125
|
+
</List>
|
|
126
|
+
</ListItem>
|
|
127
|
+
</List>
|
|
128
|
+
),
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export const RealisticUse: Story = {
|
|
132
|
+
render: () => (
|
|
133
|
+
<div className="w-80 rounded-lg border border-border bg-card p-5 space-y-4">
|
|
134
|
+
<div>
|
|
135
|
+
<h3 className="text-sm font-semibold">Premier Membership includes</h3>
|
|
136
|
+
<p className="text-xs text-muted-foreground mt-0.5">
|
|
137
|
+
Everything in Standard, plus:
|
|
138
|
+
</p>
|
|
139
|
+
</div>
|
|
140
|
+
<List spacing="sm">
|
|
141
|
+
<ListItem icon={<ShieldCheckIcon className="text-primary" />}>
|
|
142
|
+
Unlimited pool access, all sessions
|
|
143
|
+
</ListItem>
|
|
144
|
+
<ListItem icon={<ShieldCheckIcon className="text-primary" />}>
|
|
145
|
+
Personal stroke video review (monthly)
|
|
146
|
+
</ListItem>
|
|
147
|
+
<ListItem icon={<ShieldCheckIcon className="text-primary" />}>
|
|
148
|
+
Priority meet registration
|
|
149
|
+
</ListItem>
|
|
150
|
+
<ListItem icon={<ShieldCheckIcon className="text-primary" />}>
|
|
151
|
+
Locker room + towel service
|
|
152
|
+
</ListItem>
|
|
153
|
+
<ListItem icon={<XIcon className="text-muted-foreground" />}>
|
|
154
|
+
<span className="text-muted-foreground">Guest passes not included</span>
|
|
155
|
+
</ListItem>
|
|
156
|
+
</List>
|
|
157
|
+
</div>
|
|
158
|
+
),
|
|
159
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import {
|
|
3
|
+
Menubar,
|
|
4
|
+
MenubarCheckboxItem,
|
|
5
|
+
MenubarContent,
|
|
6
|
+
MenubarGroup,
|
|
7
|
+
MenubarItem,
|
|
8
|
+
MenubarLabel,
|
|
9
|
+
MenubarMenu,
|
|
10
|
+
MenubarRadioGroup,
|
|
11
|
+
MenubarRadioItem,
|
|
12
|
+
MenubarSeparator,
|
|
13
|
+
MenubarShortcut,
|
|
14
|
+
MenubarSub,
|
|
15
|
+
MenubarSubContent,
|
|
16
|
+
MenubarSubTrigger,
|
|
17
|
+
MenubarTrigger,
|
|
18
|
+
} from "@behavioral-agentic-design-system/core/components/ui/menubar";
|
|
19
|
+
|
|
20
|
+
const meta: Meta<typeof Menubar> = {
|
|
21
|
+
title: "Components/Menubar",
|
|
22
|
+
component: Menubar,
|
|
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
|
+
<Menubar>
|
|
33
|
+
<MenubarMenu>
|
|
34
|
+
<MenubarTrigger>File</MenubarTrigger>
|
|
35
|
+
<MenubarContent>
|
|
36
|
+
<MenubarItem>
|
|
37
|
+
New file <MenubarShortcut>⌘N</MenubarShortcut>
|
|
38
|
+
</MenubarItem>
|
|
39
|
+
<MenubarItem>
|
|
40
|
+
Open… <MenubarShortcut>⌘O</MenubarShortcut>
|
|
41
|
+
</MenubarItem>
|
|
42
|
+
<MenubarSeparator />
|
|
43
|
+
<MenubarItem>
|
|
44
|
+
Save <MenubarShortcut>⌘S</MenubarShortcut>
|
|
45
|
+
</MenubarItem>
|
|
46
|
+
<MenubarItem>
|
|
47
|
+
Save as… <MenubarShortcut>⇧⌘S</MenubarShortcut>
|
|
48
|
+
</MenubarItem>
|
|
49
|
+
<MenubarSeparator />
|
|
50
|
+
<MenubarItem>
|
|
51
|
+
Export as PDF
|
|
52
|
+
</MenubarItem>
|
|
53
|
+
<MenubarSeparator />
|
|
54
|
+
<MenubarItem variant="destructive">
|
|
55
|
+
Close file <MenubarShortcut>⌘W</MenubarShortcut>
|
|
56
|
+
</MenubarItem>
|
|
57
|
+
</MenubarContent>
|
|
58
|
+
</MenubarMenu>
|
|
59
|
+
|
|
60
|
+
<MenubarMenu>
|
|
61
|
+
<MenubarTrigger>Edit</MenubarTrigger>
|
|
62
|
+
<MenubarContent>
|
|
63
|
+
<MenubarItem>
|
|
64
|
+
Undo <MenubarShortcut>⌘Z</MenubarShortcut>
|
|
65
|
+
</MenubarItem>
|
|
66
|
+
<MenubarItem>
|
|
67
|
+
Redo <MenubarShortcut>⇧⌘Z</MenubarShortcut>
|
|
68
|
+
</MenubarItem>
|
|
69
|
+
<MenubarSeparator />
|
|
70
|
+
<MenubarItem>
|
|
71
|
+
Cut <MenubarShortcut>⌘X</MenubarShortcut>
|
|
72
|
+
</MenubarItem>
|
|
73
|
+
<MenubarItem>
|
|
74
|
+
Copy <MenubarShortcut>⌘C</MenubarShortcut>
|
|
75
|
+
</MenubarItem>
|
|
76
|
+
<MenubarItem>
|
|
77
|
+
Paste <MenubarShortcut>⌘V</MenubarShortcut>
|
|
78
|
+
</MenubarItem>
|
|
79
|
+
<MenubarSeparator />
|
|
80
|
+
<MenubarItem>
|
|
81
|
+
Find and replace… <MenubarShortcut>⌘H</MenubarShortcut>
|
|
82
|
+
</MenubarItem>
|
|
83
|
+
</MenubarContent>
|
|
84
|
+
</MenubarMenu>
|
|
85
|
+
|
|
86
|
+
<MenubarMenu>
|
|
87
|
+
<MenubarTrigger>View</MenubarTrigger>
|
|
88
|
+
<MenubarContent>
|
|
89
|
+
<MenubarCheckboxItem checked>Show toolbar</MenubarCheckboxItem>
|
|
90
|
+
<MenubarCheckboxItem>Show status bar</MenubarCheckboxItem>
|
|
91
|
+
<MenubarSeparator />
|
|
92
|
+
<MenubarSub>
|
|
93
|
+
<MenubarSubTrigger>Zoom</MenubarSubTrigger>
|
|
94
|
+
<MenubarSubContent>
|
|
95
|
+
<MenubarItem>Zoom in</MenubarItem>
|
|
96
|
+
<MenubarItem>Zoom out</MenubarItem>
|
|
97
|
+
<MenubarSeparator />
|
|
98
|
+
<MenubarItem>Reset zoom</MenubarItem>
|
|
99
|
+
</MenubarSubContent>
|
|
100
|
+
</MenubarSub>
|
|
101
|
+
</MenubarContent>
|
|
102
|
+
</MenubarMenu>
|
|
103
|
+
</Menubar>
|
|
104
|
+
),
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export const WithRadioGroup: Story = {
|
|
108
|
+
render: () => (
|
|
109
|
+
<Menubar>
|
|
110
|
+
<MenubarMenu>
|
|
111
|
+
<MenubarTrigger>View</MenubarTrigger>
|
|
112
|
+
<MenubarContent>
|
|
113
|
+
<MenubarLabel>Layout</MenubarLabel>
|
|
114
|
+
<MenubarSeparator />
|
|
115
|
+
<MenubarRadioGroup value="grid">
|
|
116
|
+
<MenubarRadioItem value="list">List</MenubarRadioItem>
|
|
117
|
+
<MenubarRadioItem value="grid">Grid</MenubarRadioItem>
|
|
118
|
+
<MenubarRadioItem value="kanban">Kanban</MenubarRadioItem>
|
|
119
|
+
</MenubarRadioGroup>
|
|
120
|
+
<MenubarSeparator />
|
|
121
|
+
<MenubarLabel>Density</MenubarLabel>
|
|
122
|
+
<MenubarSeparator />
|
|
123
|
+
<MenubarRadioGroup value="default">
|
|
124
|
+
<MenubarRadioItem value="compact">Compact</MenubarRadioItem>
|
|
125
|
+
<MenubarRadioItem value="default">Default</MenubarRadioItem>
|
|
126
|
+
<MenubarRadioItem value="comfortable">Comfortable</MenubarRadioItem>
|
|
127
|
+
</MenubarRadioGroup>
|
|
128
|
+
</MenubarContent>
|
|
129
|
+
</MenubarMenu>
|
|
130
|
+
</Menubar>
|
|
131
|
+
),
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export const RealisticUse: Story = {
|
|
135
|
+
render: () => (
|
|
136
|
+
<div className="w-full max-w-2xl rounded-md border bg-card">
|
|
137
|
+
<div className="border-b px-2 py-1.5">
|
|
138
|
+
<Menubar className="border-none shadow-none bg-transparent h-auto p-0">
|
|
139
|
+
<MenubarMenu>
|
|
140
|
+
<MenubarTrigger>File</MenubarTrigger>
|
|
141
|
+
<MenubarContent>
|
|
142
|
+
<MenubarItem>New design token set</MenubarItem>
|
|
143
|
+
<MenubarItem>Import tokens…</MenubarItem>
|
|
144
|
+
<MenubarSeparator />
|
|
145
|
+
<MenubarItem>
|
|
146
|
+
Export CSS <MenubarShortcut>⌘E</MenubarShortcut>
|
|
147
|
+
</MenubarItem>
|
|
148
|
+
<MenubarItem>Export JSON</MenubarItem>
|
|
149
|
+
</MenubarContent>
|
|
150
|
+
</MenubarMenu>
|
|
151
|
+
<MenubarMenu>
|
|
152
|
+
<MenubarTrigger>Edit</MenubarTrigger>
|
|
153
|
+
<MenubarContent>
|
|
154
|
+
<MenubarItem>
|
|
155
|
+
Undo <MenubarShortcut>⌘Z</MenubarShortcut>
|
|
156
|
+
</MenubarItem>
|
|
157
|
+
<MenubarSeparator />
|
|
158
|
+
<MenubarGroup>
|
|
159
|
+
<MenubarLabel>Tokens</MenubarLabel>
|
|
160
|
+
<MenubarItem inset>Duplicate token</MenubarItem>
|
|
161
|
+
<MenubarItem inset variant="destructive">Delete token</MenubarItem>
|
|
162
|
+
</MenubarGroup>
|
|
163
|
+
</MenubarContent>
|
|
164
|
+
</MenubarMenu>
|
|
165
|
+
<MenubarMenu>
|
|
166
|
+
<MenubarTrigger>View</MenubarTrigger>
|
|
167
|
+
<MenubarContent>
|
|
168
|
+
<MenubarCheckboxItem checked>Group by category</MenubarCheckboxItem>
|
|
169
|
+
<MenubarCheckboxItem>Show deprecated</MenubarCheckboxItem>
|
|
170
|
+
<MenubarSeparator />
|
|
171
|
+
<MenubarSub>
|
|
172
|
+
<MenubarSubTrigger>Sort by</MenubarSubTrigger>
|
|
173
|
+
<MenubarSubContent>
|
|
174
|
+
<MenubarRadioGroup value="name">
|
|
175
|
+
<MenubarRadioItem value="name">Name</MenubarRadioItem>
|
|
176
|
+
<MenubarRadioItem value="value">Value</MenubarRadioItem>
|
|
177
|
+
<MenubarRadioItem value="usage">Usage count</MenubarRadioItem>
|
|
178
|
+
</MenubarRadioGroup>
|
|
179
|
+
</MenubarSubContent>
|
|
180
|
+
</MenubarSub>
|
|
181
|
+
</MenubarContent>
|
|
182
|
+
</MenubarMenu>
|
|
183
|
+
</Menubar>
|
|
184
|
+
</div>
|
|
185
|
+
<div className="p-4 text-sm text-muted-foreground">
|
|
186
|
+
Token editor canvas
|
|
187
|
+
</div>
|
|
188
|
+
</div>
|
|
189
|
+
),
|
|
190
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// Trigger text is font-medium (text-sm/16px) to satisfy the SADS-1 AAA
|
|
2
|
+
// weight floor — text below 18px must be font-medium or heavier.
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
4
|
+
import * as React from "react"
|
|
5
|
+
import { MultiSelect } from "@behavioral-agentic-design-system/core/components/ui/multi-select"
|
|
6
|
+
|
|
7
|
+
const FRAMEWORKS = [
|
|
8
|
+
{ value: "next", label: "Next.js" },
|
|
9
|
+
{ value: "sveltekit", label: "SvelteKit" },
|
|
10
|
+
{ value: "nuxt", label: "Nuxt.js" },
|
|
11
|
+
{ value: "remix", label: "Remix" },
|
|
12
|
+
{ value: "astro", label: "Astro" },
|
|
13
|
+
{ value: "solid", label: "SolidJS" },
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
const meta: Meta<typeof MultiSelect> = {
|
|
17
|
+
title: "Components/MultiSelect",
|
|
18
|
+
component: MultiSelect,
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: "centered",
|
|
21
|
+
docs: {
|
|
22
|
+
description: {
|
|
23
|
+
// Trigger is an absolutely-positioned transparent <button> (inset-0) inside a
|
|
24
|
+
// relative container div. aria-expanded / aria-controls from Radix land on the
|
|
25
|
+
// <button> (valid per ARIA). X-remove pill buttons live in a sibling z-10 span —
|
|
26
|
+
// not nested inside the trigger button — so axe nested-interactive never fires.
|
|
27
|
+
component: "Multi-value combobox. Transparent full-area trigger <button> ensures aria-expanded is ARIA-valid; pill X-remove buttons are siblings (not nested) so no axe nested-interactive violation. Pill badges use py-0 min-h-6 so the content area is exactly 24px; X buttons use h-6 w-6 to meet the 24×24 WCAG 2.2 SC 2.5.8 target-size minimum (self-stretch would only fill the inner content-box, which is 20px when py-0.5 is present).",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
}
|
|
32
|
+
export default meta
|
|
33
|
+
type Story = StoryObj<typeof MultiSelect>
|
|
34
|
+
|
|
35
|
+
export const Default: Story = {
|
|
36
|
+
render: () => {
|
|
37
|
+
const [val, setVal] = React.useState<string[]>([])
|
|
38
|
+
return (
|
|
39
|
+
<div className="w-72">
|
|
40
|
+
<MultiSelect options={FRAMEWORKS} value={val} onValueChange={setVal} />
|
|
41
|
+
</div>
|
|
42
|
+
)
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const WithPreselected: Story = {
|
|
47
|
+
render: () => {
|
|
48
|
+
const [val, setVal] = React.useState<string[]>(["next", "remix"])
|
|
49
|
+
return (
|
|
50
|
+
<div className="w-72">
|
|
51
|
+
<MultiSelect options={FRAMEWORKS} value={val} onValueChange={setVal} />
|
|
52
|
+
</div>
|
|
53
|
+
)
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const WithMaxCount: Story = {
|
|
58
|
+
render: () => {
|
|
59
|
+
const [val, setVal] = React.useState<string[]>(["next", "remix", "astro", "nuxt"])
|
|
60
|
+
return (
|
|
61
|
+
<div className="w-72">
|
|
62
|
+
<MultiSelect
|
|
63
|
+
options={FRAMEWORKS}
|
|
64
|
+
value={val}
|
|
65
|
+
onValueChange={setVal}
|
|
66
|
+
maxCount={2}
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
69
|
+
)
|
|
70
|
+
},
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export const Disabled: Story = {
|
|
74
|
+
render: () => (
|
|
75
|
+
<div className="w-72">
|
|
76
|
+
<MultiSelect options={FRAMEWORKS} value={["next"]} disabled />
|
|
77
|
+
</div>
|
|
78
|
+
),
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export const EmptyState: Story = {
|
|
82
|
+
render: () => (
|
|
83
|
+
<div className="w-72">
|
|
84
|
+
<MultiSelect options={[]} value={[]} emptyText="No frameworks found." />
|
|
85
|
+
</div>
|
|
86
|
+
),
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export const RealisticUse: Story = {
|
|
90
|
+
render: () => {
|
|
91
|
+
const [tags, setTags] = React.useState<string[]>(["next", "remix"])
|
|
92
|
+
return (
|
|
93
|
+
<div className="flex flex-col gap-2 w-80">
|
|
94
|
+
<label className="text-sm font-medium">Tech stack</label>
|
|
95
|
+
<MultiSelect
|
|
96
|
+
options={FRAMEWORKS}
|
|
97
|
+
value={tags}
|
|
98
|
+
onValueChange={setTags}
|
|
99
|
+
placeholder="Select frameworks..."
|
|
100
|
+
/>
|
|
101
|
+
{tags.length > 0 && (
|
|
102
|
+
<p className="text-sm text-muted-foreground">{tags.length} selected</p>
|
|
103
|
+
)}
|
|
104
|
+
</div>
|
|
105
|
+
)
|
|
106
|
+
},
|
|
107
|
+
}
|