@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,134 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { FileUpload } from "@behavioral-agentic-design-system/core/components/ui/file-upload";
|
|
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 FileUpload> = {
|
|
8
|
+
title: "Components/FileUpload",
|
|
9
|
+
component: FileUpload,
|
|
10
|
+
parameters: { layout: "padded" },
|
|
11
|
+
tags: ["autodocs"],
|
|
12
|
+
};
|
|
13
|
+
export default meta;
|
|
14
|
+
type Story = StoryObj<typeof FileUpload>;
|
|
15
|
+
|
|
16
|
+
// ─── Default ─────────────────────────────────────────────────────────────────
|
|
17
|
+
export const Default: Story = {
|
|
18
|
+
render: () => <FileUpload aria-label="Upload file" />,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// ─── Size variants ────────────────────────────────────────────────────────────
|
|
22
|
+
export const Size_Sm: Story = {
|
|
23
|
+
render: () => <FileUpload size="sm" aria-label="Upload file" />,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const Size_Default: Story = {
|
|
27
|
+
render: () => <FileUpload size="default" aria-label="Upload file" />,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const Size_Lg: Story = {
|
|
31
|
+
render: () => <FileUpload size="lg" aria-label="Upload file" />,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// ─── With accept constraint ───────────────────────────────────────────────────
|
|
35
|
+
export const AcceptImages: Story = {
|
|
36
|
+
render: () => (
|
|
37
|
+
<FileUpload
|
|
38
|
+
accept="image/png,image/jpeg,image/webp"
|
|
39
|
+
aria-label="Upload image"
|
|
40
|
+
/>
|
|
41
|
+
),
|
|
42
|
+
name: "Accept images only",
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// ─── With max size ────────────────────────────────────────────────────────────
|
|
46
|
+
export const MaxSize: Story = {
|
|
47
|
+
render: () => (
|
|
48
|
+
<FileUpload
|
|
49
|
+
maxSize={5 * 1024 * 1024}
|
|
50
|
+
aria-label="Upload file (5 MB max)"
|
|
51
|
+
/>
|
|
52
|
+
),
|
|
53
|
+
name: "Max 5 MB",
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// ─── Multiple ─────────────────────────────────────────────────────────────────
|
|
57
|
+
export const Multiple: Story = {
|
|
58
|
+
render: () => (
|
|
59
|
+
<FileUpload
|
|
60
|
+
multiple
|
|
61
|
+
aria-label="Upload files"
|
|
62
|
+
/>
|
|
63
|
+
),
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// ─── Disabled ─────────────────────────────────────────────────────────────────
|
|
67
|
+
export const Disabled: Story = {
|
|
68
|
+
render: () => <FileUpload disabled aria-label="Upload file" />,
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// ─── Realistic use: project brief upload ─────────────────────────────────────
|
|
72
|
+
// Content from bads.json personas: studio.co onboarding flow
|
|
73
|
+
function ProjectBriefUpload() {
|
|
74
|
+
const [files, setFiles] = React.useState<File[]>([]);
|
|
75
|
+
const [submitted, setSubmitted] = React.useState(false);
|
|
76
|
+
|
|
77
|
+
const handleSubmit = () => {
|
|
78
|
+
if (files.length > 0) setSubmitted(true);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
if (submitted) {
|
|
82
|
+
return (
|
|
83
|
+
<div className="w-96 rounded-lg border border-border bg-card p-6 text-center">
|
|
84
|
+
<p className="text-sm font-medium text-foreground">Brief submitted</p>
|
|
85
|
+
<p className="mt-1 text-xs text-muted-foreground">
|
|
86
|
+
{files.length} {files.length === 1 ? "file" : "files"} uploaded to studio.co workspace
|
|
87
|
+
</p>
|
|
88
|
+
<Button
|
|
89
|
+
size="sm"
|
|
90
|
+
variant="outline"
|
|
91
|
+
className="mt-4"
|
|
92
|
+
onClick={() => { setFiles([]); setSubmitted(false); }}
|
|
93
|
+
>
|
|
94
|
+
Upload another
|
|
95
|
+
</Button>
|
|
96
|
+
</div>
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<div className="w-96 space-y-4">
|
|
102
|
+
<div className="space-y-1">
|
|
103
|
+
<h2 className="text-base font-semibold text-foreground">Upload project brief</h2>
|
|
104
|
+
<p className="text-sm text-muted-foreground">
|
|
105
|
+
Share your creative brief with maya.chen@studio.co. PDF, DOCX, or images up to 10 MB.
|
|
106
|
+
</p>
|
|
107
|
+
</div>
|
|
108
|
+
|
|
109
|
+
<div className="space-y-1.5">
|
|
110
|
+
<Label>Brief files</Label>
|
|
111
|
+
<FileUpload
|
|
112
|
+
accept=".pdf,.docx,image/png,image/jpeg"
|
|
113
|
+
maxSize={10 * 1024 * 1024}
|
|
114
|
+
multiple
|
|
115
|
+
value={files}
|
|
116
|
+
onChange={setFiles}
|
|
117
|
+
aria-label="Upload project brief files"
|
|
118
|
+
/>
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
<Button
|
|
122
|
+
className="w-full"
|
|
123
|
+
disabled={files.length === 0}
|
|
124
|
+
onClick={handleSubmit}
|
|
125
|
+
>
|
|
126
|
+
Send brief
|
|
127
|
+
</Button>
|
|
128
|
+
</div>
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export const RealisticUse: Story = {
|
|
133
|
+
render: () => <ProjectBriefUpload />,
|
|
134
|
+
};
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { CalendarIcon, LinkIcon, BuildingIcon } from "lucide-react";
|
|
3
|
+
import {
|
|
4
|
+
HoverCard,
|
|
5
|
+
HoverCardContent,
|
|
6
|
+
HoverCardHeader,
|
|
7
|
+
HoverCardTitle,
|
|
8
|
+
HoverCardDescription,
|
|
9
|
+
HoverCardTrigger,
|
|
10
|
+
} from "@behavioral-agentic-design-system/core/components/ui/hover-card";
|
|
11
|
+
import { Avatar, AvatarFallback, AvatarImage } from "@behavioral-agentic-design-system/core/components/ui/avatar";
|
|
12
|
+
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
13
|
+
import { Separator } from "@behavioral-agentic-design-system/core/components/ui/separator";
|
|
14
|
+
|
|
15
|
+
const meta: Meta<typeof HoverCard> = {
|
|
16
|
+
title: "Components/HoverCard",
|
|
17
|
+
component: HoverCard,
|
|
18
|
+
parameters: { layout: "centered" },
|
|
19
|
+
tags: ["autodocs"],
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default meta;
|
|
23
|
+
type Story = StoryObj<typeof meta>;
|
|
24
|
+
|
|
25
|
+
export const Default: Story = {
|
|
26
|
+
render: () => (
|
|
27
|
+
<HoverCard>
|
|
28
|
+
<HoverCardTrigger asChild>
|
|
29
|
+
<Button variant="link" className="text-sm font-medium">
|
|
30
|
+
@jordan_reeves
|
|
31
|
+
</Button>
|
|
32
|
+
</HoverCardTrigger>
|
|
33
|
+
<HoverCardContent className="w-72">
|
|
34
|
+
<HoverCardHeader>
|
|
35
|
+
<div className="flex items-center gap-3">
|
|
36
|
+
<Avatar className="size-10">
|
|
37
|
+
<AvatarImage src="" alt="Jordan Reeves" />
|
|
38
|
+
<AvatarFallback>JR</AvatarFallback>
|
|
39
|
+
</Avatar>
|
|
40
|
+
<div className="min-w-0 flex-1">
|
|
41
|
+
<HoverCardTitle className="truncate">Jordan Reeves</HoverCardTitle>
|
|
42
|
+
<HoverCardDescription className="truncate">@jordan_reeves</HoverCardDescription>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
<p className="mt-2 text-sm leading-relaxed text-foreground">
|
|
46
|
+
Design systems lead at Lakeview Health. Building accessible,
|
|
47
|
+
scalable UI infrastructure for clinical teams.
|
|
48
|
+
</p>
|
|
49
|
+
</HoverCardHeader>
|
|
50
|
+
<Separator className="my-3" />
|
|
51
|
+
<div className="flex flex-col gap-2 text-xs text-muted-foreground">
|
|
52
|
+
<span className="flex items-center gap-1.5 whitespace-nowrap">
|
|
53
|
+
<CalendarIcon className="size-3.5 shrink-0" strokeWidth={1.5} />
|
|
54
|
+
Joined March 2021
|
|
55
|
+
</span>
|
|
56
|
+
<span className="flex items-center gap-1.5 whitespace-nowrap">
|
|
57
|
+
<BuildingIcon className="size-3.5 shrink-0" strokeWidth={1.5} />
|
|
58
|
+
Lakeview Health
|
|
59
|
+
</span>
|
|
60
|
+
</div>
|
|
61
|
+
</HoverCardContent>
|
|
62
|
+
</HoverCard>
|
|
63
|
+
),
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const LinkPreview: Story = {
|
|
67
|
+
render: () => (
|
|
68
|
+
<HoverCard>
|
|
69
|
+
<HoverCardTrigger asChild>
|
|
70
|
+
<a
|
|
71
|
+
href="#"
|
|
72
|
+
className="inline-flex items-center gap-1.5 text-sm font-medium text-primary underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-sm"
|
|
73
|
+
onClick={(e) => e.preventDefault()}
|
|
74
|
+
>
|
|
75
|
+
<LinkIcon className="size-3.5" strokeWidth={1.5} />
|
|
76
|
+
BADS Component Spec
|
|
77
|
+
</a>
|
|
78
|
+
</HoverCardTrigger>
|
|
79
|
+
<HoverCardContent align="start" className="w-72">
|
|
80
|
+
<HoverCardHeader>
|
|
81
|
+
<HoverCardTitle>Component Build Spec</HoverCardTitle>
|
|
82
|
+
<HoverCardDescription className="mt-1 leading-relaxed">
|
|
83
|
+
The 14-section authoritative walkthrough every new component must
|
|
84
|
+
satisfy — file placement, API design, token discipline, motion, and
|
|
85
|
+
more.
|
|
86
|
+
</HoverCardDescription>
|
|
87
|
+
</HoverCardHeader>
|
|
88
|
+
<p className="mt-2 text-xs text-muted-foreground">
|
|
89
|
+
docs/component-build-spec.md
|
|
90
|
+
</p>
|
|
91
|
+
</HoverCardContent>
|
|
92
|
+
</HoverCard>
|
|
93
|
+
),
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export const AlignStart: Story = {
|
|
97
|
+
render: () => (
|
|
98
|
+
<HoverCard>
|
|
99
|
+
<HoverCardTrigger asChild>
|
|
100
|
+
<Button variant="outline" size="sm">
|
|
101
|
+
Hover me (align start)
|
|
102
|
+
</Button>
|
|
103
|
+
</HoverCardTrigger>
|
|
104
|
+
<HoverCardContent align="start" className="w-64">
|
|
105
|
+
<HoverCardHeader>
|
|
106
|
+
<HoverCardTitle>Design Tokens</HoverCardTitle>
|
|
107
|
+
<HoverCardDescription className="mt-1">
|
|
108
|
+
All colors, spacing, motion, and typography values derive from
|
|
109
|
+
tokens.json — the single source of truth.
|
|
110
|
+
</HoverCardDescription>
|
|
111
|
+
</HoverCardHeader>
|
|
112
|
+
</HoverCardContent>
|
|
113
|
+
</HoverCard>
|
|
114
|
+
),
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export const RealisticUse: Story = {
|
|
118
|
+
render: () => (
|
|
119
|
+
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
|
120
|
+
<span>Reviewed by</span>
|
|
121
|
+
<HoverCard>
|
|
122
|
+
<HoverCardTrigger asChild>
|
|
123
|
+
<button className="font-medium text-foreground underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 rounded-sm">
|
|
124
|
+
Maya Chen
|
|
125
|
+
</button>
|
|
126
|
+
</HoverCardTrigger>
|
|
127
|
+
<HoverCardContent align="start" className="w-72">
|
|
128
|
+
<HoverCardHeader>
|
|
129
|
+
<div className="flex items-center gap-3">
|
|
130
|
+
<Avatar className="size-9">
|
|
131
|
+
<AvatarImage src="" alt="Maya Chen" />
|
|
132
|
+
<AvatarFallback>MC</AvatarFallback>
|
|
133
|
+
</Avatar>
|
|
134
|
+
<div className="min-w-0">
|
|
135
|
+
<HoverCardTitle className="truncate">Maya Chen</HoverCardTitle>
|
|
136
|
+
<HoverCardDescription>Senior Designer · BADS</HoverCardDescription>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
<p className="mt-2 text-sm leading-relaxed text-foreground">
|
|
140
|
+
Leads accessibility strategy and design-token governance for the
|
|
141
|
+
Behavioral Agentic Design System.
|
|
142
|
+
</p>
|
|
143
|
+
</HoverCardHeader>
|
|
144
|
+
</HoverCardContent>
|
|
145
|
+
</HoverCard>
|
|
146
|
+
<span>on Jun 22, 2026</span>
|
|
147
|
+
</div>
|
|
148
|
+
),
|
|
149
|
+
};
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import * as React from "react"
|
|
3
|
+
import { BellIcon, UserIcon, ShoppingCartIcon, MessageSquareIcon } from "lucide-react"
|
|
4
|
+
import { Indicator } from "@behavioral-agentic-design-system/core/components/ui/indicator"
|
|
5
|
+
import { Avatar, AvatarFallback } from "@behavioral-agentic-design-system/core/components/ui/avatar"
|
|
6
|
+
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button"
|
|
7
|
+
|
|
8
|
+
const meta: Meta<typeof Indicator> = {
|
|
9
|
+
title: "Components/Indicator",
|
|
10
|
+
component: Indicator,
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: "centered",
|
|
13
|
+
docs: {
|
|
14
|
+
description: {
|
|
15
|
+
component:
|
|
16
|
+
"Overlay dot or badge pinned to a corner of a child element. Supports plain dot (no label), count badge (label), and live-signal mode (processing). Six position options. Variants and sizes match design-system color tokens. In count mode the circle scales with size (default/lg) while the count text stays pinned at the 14px AAA floor, so digits read with breathing room. No new dependencies.",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
}
|
|
21
|
+
export default meta
|
|
22
|
+
type Story = StoryObj<typeof Indicator>
|
|
23
|
+
|
|
24
|
+
export const Default: Story = {
|
|
25
|
+
render: () => (
|
|
26
|
+
<Indicator>
|
|
27
|
+
<Avatar>
|
|
28
|
+
<AvatarFallback>JD</AvatarFallback>
|
|
29
|
+
</Avatar>
|
|
30
|
+
</Indicator>
|
|
31
|
+
),
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const WithLabel: Story = {
|
|
35
|
+
render: () => (
|
|
36
|
+
<Indicator label={5}>
|
|
37
|
+
<Button variant="outline" size="icon" aria-label="Notifications">
|
|
38
|
+
<BellIcon strokeWidth={1.5} />
|
|
39
|
+
</Button>
|
|
40
|
+
</Indicator>
|
|
41
|
+
),
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const LargeCount: Story = {
|
|
45
|
+
render: () => (
|
|
46
|
+
<Indicator label={142} size="lg">
|
|
47
|
+
<Button variant="outline" size="icon" aria-label="Messages">
|
|
48
|
+
<MessageSquareIcon strokeWidth={1.5} />
|
|
49
|
+
</Button>
|
|
50
|
+
</Indicator>
|
|
51
|
+
),
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const Variant_Destructive: Story = {
|
|
55
|
+
render: () => (
|
|
56
|
+
<Indicator variant="destructive" label={3}>
|
|
57
|
+
<Button variant="outline" size="icon" aria-label="Cart">
|
|
58
|
+
<ShoppingCartIcon strokeWidth={1.5} />
|
|
59
|
+
</Button>
|
|
60
|
+
</Indicator>
|
|
61
|
+
),
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export const Variant_Success: Story = {
|
|
65
|
+
render: () => (
|
|
66
|
+
<Indicator variant="success">
|
|
67
|
+
<Avatar>
|
|
68
|
+
<AvatarFallback>MK</AvatarFallback>
|
|
69
|
+
</Avatar>
|
|
70
|
+
</Indicator>
|
|
71
|
+
),
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export const Variant_Warning: Story = {
|
|
75
|
+
render: () => (
|
|
76
|
+
<Indicator variant="warning" label="!">
|
|
77
|
+
<Avatar>
|
|
78
|
+
<AvatarFallback>RB</AvatarFallback>
|
|
79
|
+
</Avatar>
|
|
80
|
+
</Indicator>
|
|
81
|
+
),
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export const Variant_Secondary: Story = {
|
|
85
|
+
render: () => (
|
|
86
|
+
<Indicator variant="secondary" label={2}>
|
|
87
|
+
<Avatar>
|
|
88
|
+
<AvatarFallback>TA</AvatarFallback>
|
|
89
|
+
</Avatar>
|
|
90
|
+
</Indicator>
|
|
91
|
+
),
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export const Size_Sm: Story = {
|
|
95
|
+
render: () => (
|
|
96
|
+
<Indicator size="sm">
|
|
97
|
+
<Avatar>
|
|
98
|
+
<AvatarFallback>SZ</AvatarFallback>
|
|
99
|
+
</Avatar>
|
|
100
|
+
</Indicator>
|
|
101
|
+
),
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export const Size_Default: Story = {
|
|
105
|
+
render: () => (
|
|
106
|
+
<Indicator size="default" label={4}>
|
|
107
|
+
<Avatar>
|
|
108
|
+
<AvatarFallback>DZ</AvatarFallback>
|
|
109
|
+
</Avatar>
|
|
110
|
+
</Indicator>
|
|
111
|
+
),
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export const Size_Lg: Story = {
|
|
115
|
+
render: () => (
|
|
116
|
+
<Indicator size="lg" label={12}>
|
|
117
|
+
<Avatar>
|
|
118
|
+
<AvatarFallback>LZ</AvatarFallback>
|
|
119
|
+
</Avatar>
|
|
120
|
+
</Indicator>
|
|
121
|
+
),
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export const Position_TopLeft: Story = {
|
|
125
|
+
render: () => (
|
|
126
|
+
<Indicator position="top-left" label={2}>
|
|
127
|
+
<Avatar>
|
|
128
|
+
<AvatarFallback>TL</AvatarFallback>
|
|
129
|
+
</Avatar>
|
|
130
|
+
</Indicator>
|
|
131
|
+
),
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export const Position_BottomRight: Story = {
|
|
135
|
+
render: () => (
|
|
136
|
+
<Indicator position="bottom-right" variant="success">
|
|
137
|
+
<Avatar>
|
|
138
|
+
<AvatarFallback>BR</AvatarFallback>
|
|
139
|
+
</Avatar>
|
|
140
|
+
</Indicator>
|
|
141
|
+
),
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export const Position_BottomLeft: Story = {
|
|
145
|
+
render: () => (
|
|
146
|
+
<Indicator position="bottom-left">
|
|
147
|
+
<Avatar>
|
|
148
|
+
<AvatarFallback>BL</AvatarFallback>
|
|
149
|
+
</Avatar>
|
|
150
|
+
</Indicator>
|
|
151
|
+
),
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export const WithBorder: Story = {
|
|
155
|
+
render: () => (
|
|
156
|
+
<div className="flex gap-4 bg-muted p-4 rounded-lg">
|
|
157
|
+
<Indicator withBorder>
|
|
158
|
+
<Avatar>
|
|
159
|
+
<AvatarFallback>WB</AvatarFallback>
|
|
160
|
+
</Avatar>
|
|
161
|
+
</Indicator>
|
|
162
|
+
<Indicator withBorder label={5} variant="destructive">
|
|
163
|
+
<Avatar>
|
|
164
|
+
<AvatarFallback>WB</AvatarFallback>
|
|
165
|
+
</Avatar>
|
|
166
|
+
</Indicator>
|
|
167
|
+
</div>
|
|
168
|
+
),
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export const Processing: Story = {
|
|
172
|
+
render: () => (
|
|
173
|
+
<Indicator processing variant="success">
|
|
174
|
+
<Avatar>
|
|
175
|
+
<AvatarFallback>PR</AvatarFallback>
|
|
176
|
+
</Avatar>
|
|
177
|
+
</Indicator>
|
|
178
|
+
),
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export const Disabled: Story = {
|
|
182
|
+
render: () => (
|
|
183
|
+
<Indicator disabled label={5}>
|
|
184
|
+
<Avatar>
|
|
185
|
+
<AvatarFallback>DI</AvatarFallback>
|
|
186
|
+
</Avatar>
|
|
187
|
+
</Indicator>
|
|
188
|
+
),
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export const AllPositions: Story = {
|
|
192
|
+
render: () => (
|
|
193
|
+
<div className="grid grid-cols-3 gap-8 p-4">
|
|
194
|
+
{(["top-left", "top-right", "middle-left", "middle-right", "bottom-left", "bottom-right"] as const).map((pos) => (
|
|
195
|
+
<div key={pos} className="flex flex-col items-center gap-2">
|
|
196
|
+
<Indicator position={pos} variant="default" size="default">
|
|
197
|
+
<div className="size-10 rounded-md border bg-muted" />
|
|
198
|
+
</Indicator>
|
|
199
|
+
<span className="text-xs text-muted-foreground">{pos}</span>
|
|
200
|
+
</div>
|
|
201
|
+
))}
|
|
202
|
+
</div>
|
|
203
|
+
),
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export const RealisticUse: Story = {
|
|
207
|
+
render: () => (
|
|
208
|
+
<div className="flex items-center gap-6 p-4">
|
|
209
|
+
{/* Online status on avatar */}
|
|
210
|
+
<Indicator position="bottom-right" variant="success" withBorder>
|
|
211
|
+
<Avatar>
|
|
212
|
+
<AvatarFallback>JL</AvatarFallback>
|
|
213
|
+
</Avatar>
|
|
214
|
+
</Indicator>
|
|
215
|
+
|
|
216
|
+
{/* Notification bell with count */}
|
|
217
|
+
<Indicator label={12} variant="destructive">
|
|
218
|
+
<Button variant="ghost" size="icon" aria-label="Notifications (12 unread)">
|
|
219
|
+
<BellIcon strokeWidth={1.5} />
|
|
220
|
+
</Button>
|
|
221
|
+
</Indicator>
|
|
222
|
+
|
|
223
|
+
{/* Cart with item count */}
|
|
224
|
+
<Indicator label={3} variant="default" size="sm">
|
|
225
|
+
<Button variant="ghost" size="icon" aria-label="Cart (3 items)">
|
|
226
|
+
<ShoppingCartIcon strokeWidth={1.5} />
|
|
227
|
+
</Button>
|
|
228
|
+
</Indicator>
|
|
229
|
+
|
|
230
|
+
{/* Live indicator */}
|
|
231
|
+
<Indicator processing variant="success" withBorder>
|
|
232
|
+
<Avatar>
|
|
233
|
+
<AvatarFallback>AK</AvatarFallback>
|
|
234
|
+
</Avatar>
|
|
235
|
+
</Indicator>
|
|
236
|
+
</div>
|
|
237
|
+
),
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export const AllVariants: Story = {
|
|
241
|
+
render: () => (
|
|
242
|
+
<div className="flex flex-wrap items-center gap-6">
|
|
243
|
+
{(["default", "secondary", "destructive", "success", "warning"] as const).map((v) => (
|
|
244
|
+
<div key={v} className="flex flex-col items-center gap-2">
|
|
245
|
+
<Indicator variant={v} label={v === "destructive" ? 3 : undefined}>
|
|
246
|
+
<Avatar>
|
|
247
|
+
<AvatarFallback>{v[0].toUpperCase()}</AvatarFallback>
|
|
248
|
+
</Avatar>
|
|
249
|
+
</Indicator>
|
|
250
|
+
<span className="text-xs text-muted-foreground">{v}</span>
|
|
251
|
+
</div>
|
|
252
|
+
))}
|
|
253
|
+
</div>
|
|
254
|
+
),
|
|
255
|
+
}
|
|
@@ -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
|
+
};
|