@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.
- 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 +119 -98
- package/src/components/ui/color-picker.tsx +318 -9
- 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 +186 -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
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import {
|
|
3
|
+
AlertDialog,
|
|
4
|
+
AlertDialogTrigger,
|
|
5
|
+
AlertDialogContent,
|
|
6
|
+
AlertDialogHeader,
|
|
7
|
+
AlertDialogTitle,
|
|
8
|
+
AlertDialogDescription,
|
|
9
|
+
AlertDialogFooter,
|
|
10
|
+
AlertDialogCancel,
|
|
11
|
+
AlertDialogAction,
|
|
12
|
+
} from "@behavioral-agentic-design-system/core/components/ui/alert-dialog";
|
|
13
|
+
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
14
|
+
import { buttonVariants } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
15
|
+
|
|
16
|
+
const meta: Meta<typeof AlertDialog> = {
|
|
17
|
+
title: "Components/AlertDialog",
|
|
18
|
+
component: AlertDialog,
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: "centered",
|
|
21
|
+
},
|
|
22
|
+
tags: ["autodocs"],
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default meta;
|
|
26
|
+
type Story = StoryObj<typeof meta>;
|
|
27
|
+
|
|
28
|
+
export const Default: Story = {
|
|
29
|
+
render: () => (
|
|
30
|
+
<AlertDialog>
|
|
31
|
+
<AlertDialogTrigger asChild>
|
|
32
|
+
<Button variant="outline">Delete project</Button>
|
|
33
|
+
</AlertDialogTrigger>
|
|
34
|
+
<AlertDialogContent>
|
|
35
|
+
<AlertDialogHeader>
|
|
36
|
+
<AlertDialogTitle>Delete this project?</AlertDialogTitle>
|
|
37
|
+
<AlertDialogDescription>
|
|
38
|
+
This will permanently delete the Meridian Brand Refresh project and
|
|
39
|
+
all its components. This action cannot be undone.
|
|
40
|
+
</AlertDialogDescription>
|
|
41
|
+
</AlertDialogHeader>
|
|
42
|
+
<AlertDialogFooter>
|
|
43
|
+
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
44
|
+
<AlertDialogAction className={buttonVariants({ variant: "destructive" })}>
|
|
45
|
+
Delete
|
|
46
|
+
</AlertDialogAction>
|
|
47
|
+
</AlertDialogFooter>
|
|
48
|
+
</AlertDialogContent>
|
|
49
|
+
</AlertDialog>
|
|
50
|
+
),
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const Variant_Destructive: Story = {
|
|
54
|
+
render: () => (
|
|
55
|
+
<AlertDialog>
|
|
56
|
+
<AlertDialogTrigger asChild>
|
|
57
|
+
<Button variant="destructive">Remove team member</Button>
|
|
58
|
+
</AlertDialogTrigger>
|
|
59
|
+
<AlertDialogContent>
|
|
60
|
+
<AlertDialogHeader>
|
|
61
|
+
<AlertDialogTitle>Remove Jordan Nakamura?</AlertDialogTitle>
|
|
62
|
+
<AlertDialogDescription>
|
|
63
|
+
Jordan will lose access to all projects and shared components
|
|
64
|
+
immediately. You can re-invite them from the team settings.
|
|
65
|
+
</AlertDialogDescription>
|
|
66
|
+
</AlertDialogHeader>
|
|
67
|
+
<AlertDialogFooter>
|
|
68
|
+
<AlertDialogCancel>Keep member</AlertDialogCancel>
|
|
69
|
+
<AlertDialogAction className={buttonVariants({ variant: "destructive" })}>
|
|
70
|
+
Remove
|
|
71
|
+
</AlertDialogAction>
|
|
72
|
+
</AlertDialogFooter>
|
|
73
|
+
</AlertDialogContent>
|
|
74
|
+
</AlertDialog>
|
|
75
|
+
),
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const Variant_Confirm: Story = {
|
|
79
|
+
render: () => (
|
|
80
|
+
<AlertDialog>
|
|
81
|
+
<AlertDialogTrigger asChild>
|
|
82
|
+
<Button>Publish design system</Button>
|
|
83
|
+
</AlertDialogTrigger>
|
|
84
|
+
<AlertDialogContent>
|
|
85
|
+
<AlertDialogHeader>
|
|
86
|
+
<AlertDialogTitle>Publish to production?</AlertDialogTitle>
|
|
87
|
+
<AlertDialogDescription>
|
|
88
|
+
The Clap v2.1.0 package will be published to npm and made available
|
|
89
|
+
to all client forks. Existing installs will not auto-update.
|
|
90
|
+
</AlertDialogDescription>
|
|
91
|
+
</AlertDialogHeader>
|
|
92
|
+
<AlertDialogFooter>
|
|
93
|
+
<AlertDialogCancel>Not yet</AlertDialogCancel>
|
|
94
|
+
<AlertDialogAction>Publish now</AlertDialogAction>
|
|
95
|
+
</AlertDialogFooter>
|
|
96
|
+
</AlertDialogContent>
|
|
97
|
+
</AlertDialog>
|
|
98
|
+
),
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export const RealisticUse: Story = {
|
|
102
|
+
render: () => (
|
|
103
|
+
<AlertDialog>
|
|
104
|
+
<AlertDialogTrigger asChild>
|
|
105
|
+
<Button variant="outline" size="sm">
|
|
106
|
+
Archive sprint
|
|
107
|
+
</Button>
|
|
108
|
+
</AlertDialogTrigger>
|
|
109
|
+
<AlertDialogContent>
|
|
110
|
+
<AlertDialogHeader>
|
|
111
|
+
<AlertDialogTitle>Archive Sprint 14?</AlertDialogTitle>
|
|
112
|
+
<AlertDialogDescription>
|
|
113
|
+
Archiving moves all incomplete tasks to the backlog and closes the
|
|
114
|
+
sprint report. Team members will no longer see Sprint 14 in their
|
|
115
|
+
active work view.
|
|
116
|
+
</AlertDialogDescription>
|
|
117
|
+
</AlertDialogHeader>
|
|
118
|
+
<AlertDialogFooter>
|
|
119
|
+
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
120
|
+
<AlertDialogAction>Archive sprint</AlertDialogAction>
|
|
121
|
+
</AlertDialogFooter>
|
|
122
|
+
</AlertDialogContent>
|
|
123
|
+
</AlertDialog>
|
|
124
|
+
),
|
|
125
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { AspectRatio } from "@behavioral-agentic-design-system/core/components/ui/aspect-ratio";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof AspectRatio> = {
|
|
5
|
+
title: "Components/AspectRatio",
|
|
6
|
+
component: AspectRatio,
|
|
7
|
+
parameters: { layout: "centered" },
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
|
|
14
|
+
const PlaceholderImage = ({
|
|
15
|
+
label,
|
|
16
|
+
className,
|
|
17
|
+
}: {
|
|
18
|
+
label?: string;
|
|
19
|
+
className?: string;
|
|
20
|
+
}) => (
|
|
21
|
+
<div
|
|
22
|
+
className={`flex h-full w-full items-center justify-center bg-muted text-sm text-muted-foreground ${className ?? ""}`}
|
|
23
|
+
aria-label={label ?? "Placeholder image"}
|
|
24
|
+
>
|
|
25
|
+
{label ?? "Image"}
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export const Default: Story = {
|
|
30
|
+
render: () => (
|
|
31
|
+
<div className="w-[400px]">
|
|
32
|
+
<AspectRatio ratio={16 / 9}>
|
|
33
|
+
<PlaceholderImage label="16 / 9" />
|
|
34
|
+
</AspectRatio>
|
|
35
|
+
</div>
|
|
36
|
+
),
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const Square: Story = {
|
|
40
|
+
render: () => (
|
|
41
|
+
<div className="w-[300px]">
|
|
42
|
+
<AspectRatio ratio={1}>
|
|
43
|
+
<PlaceholderImage label="1 / 1 (square)" />
|
|
44
|
+
</AspectRatio>
|
|
45
|
+
</div>
|
|
46
|
+
),
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const Portrait: Story = {
|
|
50
|
+
render: () => (
|
|
51
|
+
<div className="w-[200px]">
|
|
52
|
+
<AspectRatio ratio={2 / 3}>
|
|
53
|
+
<PlaceholderImage label="2 / 3 (portrait)" />
|
|
54
|
+
</AspectRatio>
|
|
55
|
+
</div>
|
|
56
|
+
),
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const RealisticUse: Story = {
|
|
60
|
+
render: () => (
|
|
61
|
+
<div className="grid w-[560px] grid-cols-3 gap-3">
|
|
62
|
+
{[
|
|
63
|
+
{ label: "Jordan Reeves — Lead designer", ratio: 1 },
|
|
64
|
+
{ label: "Seo-yun Park — Engineer", ratio: 1 },
|
|
65
|
+
{ label: "Marcus Lindqvist — Architect", ratio: 1 },
|
|
66
|
+
].map((item) => (
|
|
67
|
+
<div key={item.label} className="overflow-hidden rounded-md">
|
|
68
|
+
<AspectRatio ratio={item.ratio}>
|
|
69
|
+
<div className="flex h-full w-full flex-col items-center justify-center gap-1 bg-muted text-center">
|
|
70
|
+
<span className="text-xs font-medium text-foreground leading-tight px-2">
|
|
71
|
+
{item.label.split(" — ")[0]}
|
|
72
|
+
</span>
|
|
73
|
+
<span className="text-xs text-muted-foreground">
|
|
74
|
+
{item.label.split(" — ")[1]}
|
|
75
|
+
</span>
|
|
76
|
+
</div>
|
|
77
|
+
</AspectRatio>
|
|
78
|
+
</div>
|
|
79
|
+
))}
|
|
80
|
+
</div>
|
|
81
|
+
),
|
|
82
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Avatar, AvatarFallback, AvatarImage } from "@behavioral-agentic-design-system/core/components/ui/avatar";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Avatar> = {
|
|
5
|
+
title: "Components/Avatar",
|
|
6
|
+
component: Avatar,
|
|
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: () => (<div className="flex items-center gap-3">
|
|
16
|
+
<Avatar>
|
|
17
|
+
<AvatarImage src="/avatars/01.png" alt="Olivia Martin" />
|
|
18
|
+
<AvatarFallback>OM</AvatarFallback>
|
|
19
|
+
</Avatar>
|
|
20
|
+
<Avatar>
|
|
21
|
+
<AvatarFallback>MS</AvatarFallback>
|
|
22
|
+
</Avatar>
|
|
23
|
+
</div>),
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const RealisticUse: Story = {
|
|
27
|
+
render: () => (<div className="flex items-center gap-3">
|
|
28
|
+
<Avatar>
|
|
29
|
+
<AvatarImage src="/avatars/01.png" alt="Olivia Martin" />
|
|
30
|
+
<AvatarFallback>OM</AvatarFallback>
|
|
31
|
+
</Avatar>
|
|
32
|
+
<Avatar>
|
|
33
|
+
<AvatarFallback>MS</AvatarFallback>
|
|
34
|
+
</Avatar>
|
|
35
|
+
</div>),
|
|
36
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Badge } from "@behavioral-agentic-design-system/core/components/ui/badge";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Badge> = {
|
|
5
|
+
title: "Components/Badge",
|
|
6
|
+
component: Badge,
|
|
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: () => (<div className="flex items-center gap-2">
|
|
16
|
+
<Badge>Default</Badge>
|
|
17
|
+
<Badge variant="secondary">Secondary</Badge>
|
|
18
|
+
<Badge variant="destructive">Destructive</Badge>
|
|
19
|
+
<Badge variant="outline">Outline</Badge>
|
|
20
|
+
</div>),
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const Variant_Default: Story = {
|
|
24
|
+
render: () => <Badge variant="default">Default</Badge>,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const Variant_Secondary: Story = {
|
|
28
|
+
render: () => <Badge variant="secondary">Secondary</Badge>,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const Variant_Destructive: Story = {
|
|
32
|
+
render: () => <Badge variant="destructive">Destructive</Badge>,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const Variant_Outline: Story = {
|
|
36
|
+
render: () => <Badge variant="outline">Outline</Badge>,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const Variant_Ghost: Story = {
|
|
40
|
+
render: () => <Badge variant="ghost">Ghost</Badge>,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const Variant_Link: Story = {
|
|
44
|
+
render: () => <Badge variant="link">Link</Badge>,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const RealisticUse: Story = {
|
|
48
|
+
render: () => (<div className="flex items-center gap-2">
|
|
49
|
+
<Badge>Default</Badge>
|
|
50
|
+
<Badge variant="secondary">Secondary</Badge>
|
|
51
|
+
<Badge variant="destructive">Destructive</Badge>
|
|
52
|
+
<Badge variant="outline">Outline</Badge>
|
|
53
|
+
</div>),
|
|
54
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "@behavioral-agentic-design-system/core/components/ui/breadcrumb";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Breadcrumb> = {
|
|
5
|
+
title: "Components/Breadcrumb",
|
|
6
|
+
component: Breadcrumb,
|
|
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: () => (<Breadcrumb>
|
|
16
|
+
<BreadcrumbList>
|
|
17
|
+
<BreadcrumbItem><BreadcrumbLink href="#">Home</BreadcrumbLink></BreadcrumbItem>
|
|
18
|
+
<BreadcrumbSeparator />
|
|
19
|
+
<BreadcrumbItem><BreadcrumbLink href="#">Components</BreadcrumbLink></BreadcrumbItem>
|
|
20
|
+
<BreadcrumbSeparator />
|
|
21
|
+
<BreadcrumbItem><BreadcrumbPage>Breadcrumb</BreadcrumbPage></BreadcrumbItem>
|
|
22
|
+
</BreadcrumbList>
|
|
23
|
+
</Breadcrumb>),
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const RealisticUse: Story = {
|
|
27
|
+
render: () => (<Breadcrumb>
|
|
28
|
+
<BreadcrumbList>
|
|
29
|
+
<BreadcrumbItem><BreadcrumbLink href="#">Home</BreadcrumbLink></BreadcrumbItem>
|
|
30
|
+
<BreadcrumbSeparator />
|
|
31
|
+
<BreadcrumbItem><BreadcrumbLink href="#">Components</BreadcrumbLink></BreadcrumbItem>
|
|
32
|
+
<BreadcrumbSeparator />
|
|
33
|
+
<BreadcrumbItem><BreadcrumbPage>Breadcrumb</BreadcrumbPage></BreadcrumbItem>
|
|
34
|
+
</BreadcrumbList>
|
|
35
|
+
</Breadcrumb>),
|
|
36
|
+
};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button"
|
|
3
|
+
import { Heart } from "lucide-react"
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Button> = {
|
|
6
|
+
title: "Components/Button",
|
|
7
|
+
component: Button,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: "centered",
|
|
10
|
+
},
|
|
11
|
+
tags: ["autodocs"],
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
type Story = StoryObj<typeof meta>;
|
|
16
|
+
|
|
17
|
+
export const Default: Story = {
|
|
18
|
+
args: {
|
|
19
|
+
children: "Button",
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const Size_XS: Story = {
|
|
24
|
+
args: {
|
|
25
|
+
size: "xs",
|
|
26
|
+
children: "Extra Small",
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const Size_SM: Story = {
|
|
31
|
+
args: {
|
|
32
|
+
size: "sm",
|
|
33
|
+
children: "Small",
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const Size_LG: Story = {
|
|
38
|
+
args: {
|
|
39
|
+
size: "lg",
|
|
40
|
+
children: "Large",
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const Size_XL: Story = {
|
|
45
|
+
args: {
|
|
46
|
+
size: "xl",
|
|
47
|
+
children: "Extra Large",
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const Size_2XL: Story = {
|
|
52
|
+
args: {
|
|
53
|
+
size: "2xl",
|
|
54
|
+
children: "2X Large",
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const Variant_Outline: Story = {
|
|
59
|
+
args: {
|
|
60
|
+
variant: "outline",
|
|
61
|
+
children: "Outline",
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const Variant_Ghost: Story = {
|
|
66
|
+
args: {
|
|
67
|
+
variant: "ghost",
|
|
68
|
+
children: "Ghost",
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const Variant_Link: Story = {
|
|
73
|
+
args: {
|
|
74
|
+
variant: "link",
|
|
75
|
+
children: "Read the docs",
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const Disabled: Story = {
|
|
80
|
+
args: {
|
|
81
|
+
disabled: true,
|
|
82
|
+
children: "Disabled",
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const Icon_XS: Story = {
|
|
87
|
+
args: {
|
|
88
|
+
size: "icon-xs",
|
|
89
|
+
"aria-label": "Add to favorites",
|
|
90
|
+
children: <Heart className="h-3 w-3" />,
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export const Icon_SM: Story = {
|
|
95
|
+
args: {
|
|
96
|
+
size: "icon-sm",
|
|
97
|
+
"aria-label": "Add to favorites",
|
|
98
|
+
children: <Heart className="h-4 w-4" />,
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const Icon_LG: Story = {
|
|
103
|
+
args: {
|
|
104
|
+
size: "icon-lg",
|
|
105
|
+
"aria-label": "Add to favorites",
|
|
106
|
+
children: <Heart className="h-5 w-5" />,
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export const Icon_XL: Story = {
|
|
111
|
+
args: {
|
|
112
|
+
size: "icon-xl",
|
|
113
|
+
"aria-label": "Add to favorites",
|
|
114
|
+
children: <Heart className="h-5 w-5" />,
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export const RealisticUse: Story = {
|
|
119
|
+
args: {
|
|
120
|
+
children: "Save Changes",
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
// Every size — text and icon — shares one radius (rounded-md), set once on the
|
|
125
|
+
// base class. Default and the icon sizes used to fall through to rounded-full
|
|
126
|
+
// (pill / circle) while the rest were rounded-md; this row exists so that
|
|
127
|
+
// inconsistency can't silently come back.
|
|
128
|
+
export const AllSizes: Story = {
|
|
129
|
+
render: () => (
|
|
130
|
+
<div className="flex flex-wrap items-center gap-3">
|
|
131
|
+
<Button size="sm">Small</Button>
|
|
132
|
+
<Button>Default</Button>
|
|
133
|
+
<Button size="lg">Large</Button>
|
|
134
|
+
<Button size="xl">Extra Large</Button>
|
|
135
|
+
<Button size="icon" aria-label="Add to favorites">
|
|
136
|
+
<Heart className="h-4 w-4" />
|
|
137
|
+
</Button>
|
|
138
|
+
<Button size="icon-lg" aria-label="Add to favorites">
|
|
139
|
+
<Heart className="h-5 w-5" />
|
|
140
|
+
</Button>
|
|
141
|
+
</div>
|
|
142
|
+
),
|
|
143
|
+
};
|
|
144
|
+
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import * as React from "react"
|
|
3
|
+
import {
|
|
4
|
+
AlignLeftIcon,
|
|
5
|
+
AlignCenterIcon,
|
|
6
|
+
AlignRightIcon,
|
|
7
|
+
BoldIcon,
|
|
8
|
+
ItalicIcon,
|
|
9
|
+
ListIcon,
|
|
10
|
+
GridIcon,
|
|
11
|
+
ChevronLeftIcon,
|
|
12
|
+
ChevronRightIcon,
|
|
13
|
+
ThumbsUpIcon,
|
|
14
|
+
ThumbsDownIcon,
|
|
15
|
+
ShareIcon,
|
|
16
|
+
} from "lucide-react"
|
|
17
|
+
import { ButtonGroup } from "@behavioral-agentic-design-system/core/components/ui/button-group"
|
|
18
|
+
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button"
|
|
19
|
+
|
|
20
|
+
const meta: Meta<typeof ButtonGroup> = {
|
|
21
|
+
title: "Components/ButtonGroup",
|
|
22
|
+
component: ButtonGroup,
|
|
23
|
+
parameters: {
|
|
24
|
+
layout: "centered",
|
|
25
|
+
docs: {
|
|
26
|
+
description: {
|
|
27
|
+
component:
|
|
28
|
+
"Groups adjacent Button primitives with shared borders and no interior radii. Composes directly onto the existing Button primitive — no new dependencies.",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
tags: ["autodocs"],
|
|
33
|
+
}
|
|
34
|
+
export default meta
|
|
35
|
+
|
|
36
|
+
type Story = StoryObj<typeof ButtonGroup>
|
|
37
|
+
|
|
38
|
+
export const Default: Story = {
|
|
39
|
+
render: () => (
|
|
40
|
+
<ButtonGroup aria-label="Lane view controls">
|
|
41
|
+
<Button variant="outline">All lanes</Button>
|
|
42
|
+
<Button variant="outline">My lanes</Button>
|
|
43
|
+
<Button variant="outline">Open only</Button>
|
|
44
|
+
</ButtonGroup>
|
|
45
|
+
),
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const WithIcons: Story = {
|
|
49
|
+
render: () => (
|
|
50
|
+
<ButtonGroup aria-label="Text alignment">
|
|
51
|
+
<Button variant="outline" size="icon" aria-label="Align left">
|
|
52
|
+
<AlignLeftIcon strokeWidth={1.5} />
|
|
53
|
+
</Button>
|
|
54
|
+
<Button variant="outline" size="icon" aria-label="Align center">
|
|
55
|
+
<AlignCenterIcon strokeWidth={1.5} />
|
|
56
|
+
</Button>
|
|
57
|
+
<Button variant="outline" size="icon" aria-label="Align right">
|
|
58
|
+
<AlignRightIcon strokeWidth={1.5} />
|
|
59
|
+
</Button>
|
|
60
|
+
</ButtonGroup>
|
|
61
|
+
),
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export const Vertical: Story = {
|
|
65
|
+
render: () => (
|
|
66
|
+
<ButtonGroup orientation="vertical" aria-label="Stroke options">
|
|
67
|
+
<Button variant="outline">Freestyle</Button>
|
|
68
|
+
<Button variant="outline">Backstroke</Button>
|
|
69
|
+
<Button variant="outline">Breaststroke</Button>
|
|
70
|
+
<Button variant="outline">Butterfly</Button>
|
|
71
|
+
</ButtonGroup>
|
|
72
|
+
),
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const Variant_Default: Story = {
|
|
76
|
+
render: () => (
|
|
77
|
+
<ButtonGroup aria-label="Season phase">
|
|
78
|
+
<Button variant="default">Early season</Button>
|
|
79
|
+
<Button variant="default">Championship</Button>
|
|
80
|
+
<Button variant="default">Off season</Button>
|
|
81
|
+
</ButtonGroup>
|
|
82
|
+
),
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export const Variant_Secondary: Story = {
|
|
86
|
+
render: () => (
|
|
87
|
+
<ButtonGroup aria-label="Report period">
|
|
88
|
+
<Button variant="secondary">Weekly</Button>
|
|
89
|
+
<Button variant="secondary">Monthly</Button>
|
|
90
|
+
<Button variant="secondary">Yearly</Button>
|
|
91
|
+
</ButtonGroup>
|
|
92
|
+
),
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export const Size_Sm: Story = {
|
|
96
|
+
render: () => (
|
|
97
|
+
<ButtonGroup aria-label="Formatting">
|
|
98
|
+
<Button variant="outline" size="sm">
|
|
99
|
+
<BoldIcon strokeWidth={1.5} />
|
|
100
|
+
Bold
|
|
101
|
+
</Button>
|
|
102
|
+
<Button variant="outline" size="sm">
|
|
103
|
+
<ItalicIcon strokeWidth={1.5} />
|
|
104
|
+
Italic
|
|
105
|
+
</Button>
|
|
106
|
+
</ButtonGroup>
|
|
107
|
+
),
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export const Size_Lg: Story = {
|
|
111
|
+
render: () => (
|
|
112
|
+
<ButtonGroup aria-label="View toggle">
|
|
113
|
+
<Button variant="outline" size="lg">
|
|
114
|
+
<ListIcon strokeWidth={1.5} />
|
|
115
|
+
List
|
|
116
|
+
</Button>
|
|
117
|
+
<Button variant="outline" size="lg">
|
|
118
|
+
<GridIcon strokeWidth={1.5} />
|
|
119
|
+
Grid
|
|
120
|
+
</Button>
|
|
121
|
+
</ButtonGroup>
|
|
122
|
+
),
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export const Disabled: Story = {
|
|
126
|
+
render: () => (
|
|
127
|
+
<ButtonGroup aria-label="Disabled group">
|
|
128
|
+
<Button variant="outline" disabled>Previous</Button>
|
|
129
|
+
<Button variant="outline" disabled>Current</Button>
|
|
130
|
+
<Button variant="outline" disabled>Next</Button>
|
|
131
|
+
</ButtonGroup>
|
|
132
|
+
),
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export const RealisticUse: Story = {
|
|
136
|
+
render: () => (
|
|
137
|
+
<div className="space-y-6 w-80">
|
|
138
|
+
{/* Pagination */}
|
|
139
|
+
<div className="space-y-1.5">
|
|
140
|
+
<p className="text-xs font-medium text-muted-foreground">Pagination</p>
|
|
141
|
+
<div className="flex items-center gap-1">
|
|
142
|
+
<ButtonGroup aria-label="Pagination">
|
|
143
|
+
<Button variant="outline" size="icon" aria-label="Previous page">
|
|
144
|
+
<ChevronLeftIcon strokeWidth={1.5} />
|
|
145
|
+
</Button>
|
|
146
|
+
<Button variant="outline" size="icon" aria-label="Page 1">1</Button>
|
|
147
|
+
<Button variant="default" size="icon" aria-label="Page 2, current">2</Button>
|
|
148
|
+
<Button variant="outline" size="icon" aria-label="Page 3">3</Button>
|
|
149
|
+
<Button variant="outline" size="icon" aria-label="Next page">
|
|
150
|
+
<ChevronRightIcon strokeWidth={1.5} />
|
|
151
|
+
</Button>
|
|
152
|
+
</ButtonGroup>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
|
|
156
|
+
{/* Reaction row */}
|
|
157
|
+
<div className="space-y-1.5">
|
|
158
|
+
<p className="text-xs font-medium text-muted-foreground">Session reactions</p>
|
|
159
|
+
<ButtonGroup aria-label="Rate this practice session">
|
|
160
|
+
<Button variant="outline">
|
|
161
|
+
<ThumbsUpIcon strokeWidth={1.5} />
|
|
162
|
+
Helpful
|
|
163
|
+
</Button>
|
|
164
|
+
<Button variant="outline">
|
|
165
|
+
<ThumbsDownIcon strokeWidth={1.5} />
|
|
166
|
+
Too easy
|
|
167
|
+
</Button>
|
|
168
|
+
<Button variant="outline">
|
|
169
|
+
<ShareIcon strokeWidth={1.5} />
|
|
170
|
+
Share
|
|
171
|
+
</Button>
|
|
172
|
+
</ButtonGroup>
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
175
|
+
),
|
|
176
|
+
}
|