@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,128 @@
|
|
|
1
|
+
// scrollbar-none (Tailwind v4.3 utility) replaces old scrollbar-width/webkit-scrollbar workaround
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import {
|
|
5
|
+
Tabs,
|
|
6
|
+
TabsList,
|
|
7
|
+
TabsTrigger,
|
|
8
|
+
TabsContent,
|
|
9
|
+
TabsPanels,
|
|
10
|
+
TabsSelect,
|
|
11
|
+
} from "@behavioral-agentic-design-system/core/components/ui/tabs";
|
|
12
|
+
|
|
13
|
+
const SECTIONS = [
|
|
14
|
+
{ value: "account", label: "Account Information" },
|
|
15
|
+
{ value: "volunteer", label: "Volunteer History" },
|
|
16
|
+
{ value: "preferences", label: "Preferences" },
|
|
17
|
+
{ value: "billing", label: "Billing & Plan" },
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
const meta: Meta<typeof Tabs> = {
|
|
21
|
+
title: "Components/Tabs",
|
|
22
|
+
component: Tabs,
|
|
23
|
+
parameters: {
|
|
24
|
+
layout: "centered",
|
|
25
|
+
},
|
|
26
|
+
tags: ["autodocs"],
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default meta;
|
|
30
|
+
type Story = StoryObj<typeof meta>;
|
|
31
|
+
|
|
32
|
+
// Active-state contrast note: TabsTrigger renders the active tab as
|
|
33
|
+
// `bg-primary text-primary-foreground`. This uses the fork's brand color so the
|
|
34
|
+
// selected pill always reads as "brand, not neutral." Previous bg-accent broke
|
|
35
|
+
// forks where --accent is a dark color (e.g. plum), rendering the pill illegibly
|
|
36
|
+
// dark. Default and RealisticUse below exercise this state.
|
|
37
|
+
export const Default: Story = {
|
|
38
|
+
render: () => (
|
|
39
|
+
<Tabs defaultValue="overview" className="w-[480px]">
|
|
40
|
+
<TabsList>
|
|
41
|
+
<TabsTrigger value="overview">Overview</TabsTrigger>
|
|
42
|
+
<TabsTrigger value="usage">Usage</TabsTrigger>
|
|
43
|
+
<TabsTrigger value="billing">Billing</TabsTrigger>
|
|
44
|
+
</TabsList>
|
|
45
|
+
<TabsContent value="overview">Project overview goes here.</TabsContent>
|
|
46
|
+
<TabsContent value="usage">Usage statistics for this project.</TabsContent>
|
|
47
|
+
<TabsContent value="billing">Billing and plan settings.</TabsContent>
|
|
48
|
+
</Tabs>
|
|
49
|
+
),
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// New TabsPanels primitive — cross-fades between forceMount'd panels instead of
|
|
53
|
+
// unmount/remount. Use when switching tabs would cause a flash (iframes, charts,
|
|
54
|
+
// anything with expensive first render).
|
|
55
|
+
export const RealisticUse: Story = {
|
|
56
|
+
render: () => (
|
|
57
|
+
<Tabs defaultValue="cards" className="w-[600px] h-[200px]">
|
|
58
|
+
<TabsList>
|
|
59
|
+
<TabsTrigger value="cards">Cards</TabsTrigger>
|
|
60
|
+
<TabsTrigger value="dashboard">Dashboard</TabsTrigger>
|
|
61
|
+
</TabsList>
|
|
62
|
+
<div className="relative flex-1 mt-4 border rounded-lg overflow-hidden h-[140px]">
|
|
63
|
+
<TabsPanels>
|
|
64
|
+
<TabsContent value="cards" forceMount className="m-0 size-full p-4">
|
|
65
|
+
Cards panel — cross-fades in.
|
|
66
|
+
</TabsContent>
|
|
67
|
+
<TabsContent value="dashboard" forceMount className="m-0 size-full p-4">
|
|
68
|
+
Dashboard panel — cross-fades in.
|
|
69
|
+
</TabsContent>
|
|
70
|
+
</TabsPanels>
|
|
71
|
+
</div>
|
|
72
|
+
</Tabs>
|
|
73
|
+
),
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
// Scrollable TabsList — opt-in graceful overflow. Hides the scrollbar, keeps
|
|
77
|
+
// the active trigger in view, and fades the right edge while more is hidden,
|
|
78
|
+
// so a row too wide for its container stops clipping the active label.
|
|
79
|
+
export const Scrollable: Story = {
|
|
80
|
+
render: () => (
|
|
81
|
+
<Tabs defaultValue="account" className="w-[320px]">
|
|
82
|
+
<TabsList variant="line" scrollable className="w-full justify-start">
|
|
83
|
+
{SECTIONS.map((s) => (
|
|
84
|
+
<TabsTrigger key={s.value} value={s.value}>
|
|
85
|
+
{s.label}
|
|
86
|
+
</TabsTrigger>
|
|
87
|
+
))}
|
|
88
|
+
</TabsList>
|
|
89
|
+
{SECTIONS.map((s) => (
|
|
90
|
+
<TabsContent key={s.value} value={s.value} className="pt-4 text-sm">
|
|
91
|
+
{s.label} content.
|
|
92
|
+
</TabsContent>
|
|
93
|
+
))}
|
|
94
|
+
</Tabs>
|
|
95
|
+
),
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
// Responsive pattern: TabsSelect (dropdown) on narrow screens, TabsList
|
|
99
|
+
// (underline tabs) on wide ones — both drive the same controlled value.
|
|
100
|
+
function ResponsiveTabs() {
|
|
101
|
+
const [value, setValue] = useState("account");
|
|
102
|
+
return (
|
|
103
|
+
<Tabs value={value} onValueChange={setValue} className="w-[320px]">
|
|
104
|
+
<TabsSelect
|
|
105
|
+
items={SECTIONS}
|
|
106
|
+
value={value}
|
|
107
|
+
onValueChange={setValue}
|
|
108
|
+
className="sm:hidden"
|
|
109
|
+
/>
|
|
110
|
+
<TabsList variant="line" scrollable className="hidden sm:flex w-full justify-start">
|
|
111
|
+
{SECTIONS.map((s) => (
|
|
112
|
+
<TabsTrigger key={s.value} value={s.value}>
|
|
113
|
+
{s.label}
|
|
114
|
+
</TabsTrigger>
|
|
115
|
+
))}
|
|
116
|
+
</TabsList>
|
|
117
|
+
{SECTIONS.map((s) => (
|
|
118
|
+
<TabsContent key={s.value} value={s.value} className="pt-4 text-sm">
|
|
119
|
+
{s.label} content.
|
|
120
|
+
</TabsContent>
|
|
121
|
+
))}
|
|
122
|
+
</Tabs>
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export const ResponsiveDropdown: Story = {
|
|
127
|
+
render: () => <ResponsiveTabs />,
|
|
128
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Tag } from "@behavioral-agentic-design-system/core/components/ui/tag";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Tag> = {
|
|
5
|
+
title: "Components/Tag",
|
|
6
|
+
component: Tag,
|
|
7
|
+
parameters: { layout: "centered" },
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
|
|
14
|
+
// Tag takes its text via the `label` prop (it renders <span>{label}</span>),
|
|
15
|
+
// not via children. Passing children renders an empty pill — see the registry
|
|
16
|
+
// + Controls panel, label is the required prop.
|
|
17
|
+
export const Default: Story = {
|
|
18
|
+
render: () => (<div className="flex items-center gap-2 flex-wrap">
|
|
19
|
+
<Tag label="Design" />
|
|
20
|
+
<Tag label="Engineering" />
|
|
21
|
+
<Tag label="Product" />
|
|
22
|
+
</div>),
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const Variant_Default: Story = {
|
|
26
|
+
render: () => <Tag variant="default" label="Default" />,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const Variant_Success: Story = {
|
|
30
|
+
render: () => <Tag variant="success" label="Success" />,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const Variant_Warning: Story = {
|
|
34
|
+
render: () => <Tag variant="warning" label="Warning" />,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const Variant_Error: Story = {
|
|
38
|
+
render: () => <Tag variant="error" label="Error" />,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const Variant_Info: Story = {
|
|
42
|
+
render: () => <Tag variant="info" label="Info" />,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const RealisticUse: Story = {
|
|
46
|
+
render: () => (<div className="flex items-center gap-2 flex-wrap">
|
|
47
|
+
<Tag label="Design" onClose={() => {}} />
|
|
48
|
+
<Tag variant="success" label="Shipped" onClose={() => {}} />
|
|
49
|
+
<Tag variant="info" label="In review" onClose={() => {}} />
|
|
50
|
+
</div>),
|
|
51
|
+
};
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { TagsInput } from "@behavioral-agentic-design-system/core/components/ui/tags-input";
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof TagsInput> = {
|
|
6
|
+
title: "Components/TagsInput",
|
|
7
|
+
component: TagsInput,
|
|
8
|
+
parameters: { layout: "centered" },
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
argTypes: {
|
|
11
|
+
disabled: { control: "boolean" },
|
|
12
|
+
allowDuplicates: { control: "boolean" },
|
|
13
|
+
maxTags: { control: "number" },
|
|
14
|
+
placeholder: { control: "text" },
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default meta;
|
|
19
|
+
type Story = StoryObj<typeof TagsInput>;
|
|
20
|
+
|
|
21
|
+
function Controlled({
|
|
22
|
+
initialTags = [],
|
|
23
|
+
...props
|
|
24
|
+
}: Omit<React.ComponentProps<typeof TagsInput>, "value" | "onValueChange"> & {
|
|
25
|
+
initialTags?: string[];
|
|
26
|
+
}) {
|
|
27
|
+
const [tags, setTags] = React.useState<string[]>(initialTags);
|
|
28
|
+
return (
|
|
29
|
+
<div className="w-80">
|
|
30
|
+
<TagsInput value={tags} onValueChange={setTags} {...props} />
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const Default: Story = {
|
|
36
|
+
render: () => <Controlled placeholder="Add a tag…" />,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const WithInitialTags: Story = {
|
|
40
|
+
render: () => (
|
|
41
|
+
<Controlled
|
|
42
|
+
initialTags={["butterfly", "freestyle", "backstroke"]}
|
|
43
|
+
placeholder="Add stroke…"
|
|
44
|
+
/>
|
|
45
|
+
),
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// Disabled: muted token colors (bg-muted/text-muted-foreground) preserve AAA
|
|
49
|
+
// contrast — avoids the opacity-50 approach which blends text to ~3:1 (AA fail).
|
|
50
|
+
export const Disabled: Story = {
|
|
51
|
+
render: () => (
|
|
52
|
+
<Controlled
|
|
53
|
+
initialTags={["100m freestyle", "200m backstroke"]}
|
|
54
|
+
disabled
|
|
55
|
+
placeholder="Disabled"
|
|
56
|
+
/>
|
|
57
|
+
),
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const MaxTags: Story = {
|
|
61
|
+
render: () => (
|
|
62
|
+
<Controlled
|
|
63
|
+
initialTags={["warm-up", "main set"]}
|
|
64
|
+
maxTags={4}
|
|
65
|
+
placeholder="Add phase (max 4)…"
|
|
66
|
+
/>
|
|
67
|
+
),
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export const AllowDuplicates: Story = {
|
|
71
|
+
render: () => (
|
|
72
|
+
<Controlled
|
|
73
|
+
allowDuplicates
|
|
74
|
+
placeholder="Duplicates allowed…"
|
|
75
|
+
/>
|
|
76
|
+
),
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
// Autocomplete: a `suggestions` pool filters as you type. ArrowDown/Up navigate
|
|
80
|
+
// the listbox, Enter or click adds; already-added items show a check and drop
|
|
81
|
+
// out of the list. Full combobox ARIA (role=combobox + listbox/option).
|
|
82
|
+
export const WithSuggestions: Story = {
|
|
83
|
+
render: () => (
|
|
84
|
+
<div className="w-80 space-y-2">
|
|
85
|
+
<p className="text-xs text-muted-foreground">
|
|
86
|
+
Type to filter — try "fly" or "back"
|
|
87
|
+
</p>
|
|
88
|
+
<Controlled
|
|
89
|
+
placeholder="Add a stroke or event…"
|
|
90
|
+
suggestions={[
|
|
91
|
+
"Butterfly",
|
|
92
|
+
"Backstroke",
|
|
93
|
+
"Breaststroke",
|
|
94
|
+
"Freestyle",
|
|
95
|
+
"Individual Medley",
|
|
96
|
+
"50m Freestyle",
|
|
97
|
+
"100m Butterfly",
|
|
98
|
+
"200m Backstroke",
|
|
99
|
+
"400m IM",
|
|
100
|
+
"Medley Relay",
|
|
101
|
+
]}
|
|
102
|
+
/>
|
|
103
|
+
</div>
|
|
104
|
+
),
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export const CommaDelimiter: Story = {
|
|
108
|
+
render: () => (
|
|
109
|
+
<div className="w-80 space-y-2">
|
|
110
|
+
<p className="text-xs text-muted-foreground">Type and press Enter or comma to add</p>
|
|
111
|
+
<Controlled
|
|
112
|
+
delimiters={[","]}
|
|
113
|
+
placeholder="swimmer, coach, official…"
|
|
114
|
+
/>
|
|
115
|
+
</div>
|
|
116
|
+
),
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export const Empty: Story = {
|
|
120
|
+
render: () => <Controlled placeholder="Type and press Enter…" />,
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
// Realistic use: Breezy Hills Aquatic Club — event tag filter
|
|
124
|
+
export const RealisticUse: Story = {
|
|
125
|
+
render: () => {
|
|
126
|
+
const [tags, setTags] = React.useState<string[]>(["Junior A", "Summer Invitational"]);
|
|
127
|
+
return (
|
|
128
|
+
<div className="w-96 space-y-4">
|
|
129
|
+
<div>
|
|
130
|
+
<p className="text-xs text-muted-foreground mb-1">
|
|
131
|
+
Breezy Hills Aquatic Club · Filter sessions by tag
|
|
132
|
+
</p>
|
|
133
|
+
<label className="text-sm font-medium">Active filters</label>
|
|
134
|
+
<div className="mt-1.5">
|
|
135
|
+
<TagsInput
|
|
136
|
+
value={tags}
|
|
137
|
+
onValueChange={setTags}
|
|
138
|
+
placeholder="Add filter tag…"
|
|
139
|
+
maxTags={6}
|
|
140
|
+
/>
|
|
141
|
+
</div>
|
|
142
|
+
<p className="text-xs text-muted-foreground mt-1.5">
|
|
143
|
+
Press Enter or comma to add · Backspace to remove last
|
|
144
|
+
</p>
|
|
145
|
+
</div>
|
|
146
|
+
{tags.length > 0 && (
|
|
147
|
+
<p className="text-sm text-muted-foreground">
|
|
148
|
+
Filtering by: <span className="font-medium text-foreground">{tags.join(", ")}</span>
|
|
149
|
+
</p>
|
|
150
|
+
)}
|
|
151
|
+
</div>
|
|
152
|
+
);
|
|
153
|
+
},
|
|
154
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Textarea } from "@behavioral-agentic-design-system/core/components/ui/textarea";
|
|
3
|
+
import { Label } from "@behavioral-agentic-design-system/core/components/ui/label";
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Textarea> = {
|
|
6
|
+
title: "Components/Textarea",
|
|
7
|
+
component: Textarea,
|
|
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-[320px]">
|
|
17
|
+
<Label htmlFor="msg">Message</Label>
|
|
18
|
+
<Textarea id="msg" placeholder="Tell us what's on your mind." rows={4} />
|
|
19
|
+
</div>),
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const Disabled: Story = {
|
|
23
|
+
args: { disabled: true, "aria-label": "Message", placeholder: "Tell us what's on your mind." } as any,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const RealisticUse: Story = {
|
|
27
|
+
render: () => (<div className="flex flex-col gap-2 w-[320px]">
|
|
28
|
+
<Label htmlFor="msg">Message</Label>
|
|
29
|
+
<Textarea id="msg" placeholder="Tell us what's on your mind." rows={4} />
|
|
30
|
+
</div>),
|
|
31
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import * as React from "react"
|
|
3
|
+
import { TimePicker } from "@behavioral-agentic-design-system/core/components/ui/time-picker"
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof TimePicker> = {
|
|
6
|
+
title: "Components/TimePicker",
|
|
7
|
+
component: TimePicker,
|
|
8
|
+
parameters: { layout: "centered" },
|
|
9
|
+
}
|
|
10
|
+
export default meta
|
|
11
|
+
type Story = StoryObj<typeof TimePicker>
|
|
12
|
+
|
|
13
|
+
export const Default: Story = {
|
|
14
|
+
args: { value: "09:30", size: "default" },
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const TwelveHour: Story = {
|
|
18
|
+
args: { value: "14:45", hours12: true, size: "default" },
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const WithSeconds: Story = {
|
|
22
|
+
args: { value: "09:30:00", showSeconds: true, size: "default" },
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const Sizes: Story = {
|
|
26
|
+
render: () => (
|
|
27
|
+
<div className="flex flex-col gap-3 w-64">
|
|
28
|
+
<TimePicker value="08:00" size="sm" />
|
|
29
|
+
<TimePicker value="08:00" size="default" />
|
|
30
|
+
<TimePicker value="08:00" size="lg" />
|
|
31
|
+
</div>
|
|
32
|
+
),
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const Clearable: Story = {
|
|
36
|
+
args: { value: "14:30", clearable: true, size: "default" },
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const Disabled: Story = {
|
|
40
|
+
args: { value: "09:30", disabled: true, size: "default" },
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const RealisticUse: Story = {
|
|
44
|
+
render: () => {
|
|
45
|
+
const [time, setTime] = React.useState<string | undefined>("09:00")
|
|
46
|
+
return (
|
|
47
|
+
<div className="flex flex-col gap-2 w-64">
|
|
48
|
+
<label className="text-sm font-medium">Meeting start time</label>
|
|
49
|
+
<TimePicker value={time} onValueChange={setTime} clearable />
|
|
50
|
+
{time && <p className="text-xs text-muted-foreground">Selected: {time}</p>}
|
|
51
|
+
</div>
|
|
52
|
+
)
|
|
53
|
+
},
|
|
54
|
+
}
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
// title prop updated to ReactNode (Omit<HTMLAttributes,'title'> TS fix — no story matrix change)
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import {
|
|
5
|
+
UserCheckIcon,
|
|
6
|
+
CreditCardIcon,
|
|
7
|
+
TrophyIcon,
|
|
8
|
+
ClipboardCheckIcon,
|
|
9
|
+
CalendarIcon,
|
|
10
|
+
AlertCircleIcon,
|
|
11
|
+
FlameIcon,
|
|
12
|
+
} from "lucide-react";
|
|
13
|
+
import { Timeline, TimelineItem } from "@behavioral-agentic-design-system/core/components/ui/timeline";
|
|
14
|
+
|
|
15
|
+
const meta: Meta<typeof Timeline> = {
|
|
16
|
+
title: "Components/Timeline",
|
|
17
|
+
component: Timeline,
|
|
18
|
+
parameters: { layout: "centered" },
|
|
19
|
+
tags: ["autodocs"],
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default meta;
|
|
23
|
+
type Story = StoryObj<typeof Timeline>;
|
|
24
|
+
|
|
25
|
+
export const Default: Story = {
|
|
26
|
+
render: () => (
|
|
27
|
+
<div className="w-80">
|
|
28
|
+
<Timeline>
|
|
29
|
+
<TimelineItem status="complete" title="Application submitted" time="Jun 20, 9:00 AM" />
|
|
30
|
+
<TimelineItem status="complete" title="Documents verified" time="Jun 21, 2:30 PM" />
|
|
31
|
+
<TimelineItem status="active" title="Under review" time="Jun 25 (today)" />
|
|
32
|
+
<TimelineItem status="pending" title="Decision" time="Jun 28 (estimated)" />
|
|
33
|
+
</Timeline>
|
|
34
|
+
</div>
|
|
35
|
+
),
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const AllStatuses: Story = {
|
|
39
|
+
render: () => (
|
|
40
|
+
<div className="w-80">
|
|
41
|
+
<Timeline>
|
|
42
|
+
<TimelineItem
|
|
43
|
+
status="complete"
|
|
44
|
+
title="Complete"
|
|
45
|
+
description="This step is done."
|
|
46
|
+
time="Yesterday"
|
|
47
|
+
/>
|
|
48
|
+
<TimelineItem
|
|
49
|
+
status="active"
|
|
50
|
+
title="Active"
|
|
51
|
+
description="Currently in progress."
|
|
52
|
+
time="Today"
|
|
53
|
+
/>
|
|
54
|
+
<TimelineItem
|
|
55
|
+
status="default"
|
|
56
|
+
title="Default"
|
|
57
|
+
description="No semantic status."
|
|
58
|
+
time="Tomorrow"
|
|
59
|
+
/>
|
|
60
|
+
<TimelineItem
|
|
61
|
+
status="pending"
|
|
62
|
+
title="Pending"
|
|
63
|
+
description="Not yet started."
|
|
64
|
+
time="Next week"
|
|
65
|
+
/>
|
|
66
|
+
</Timeline>
|
|
67
|
+
</div>
|
|
68
|
+
),
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const WithIcons: Story = {
|
|
72
|
+
render: () => (
|
|
73
|
+
<div className="w-80">
|
|
74
|
+
<Timeline>
|
|
75
|
+
<TimelineItem
|
|
76
|
+
status="complete"
|
|
77
|
+
icon={<UserCheckIcon className="size-3" strokeWidth={1.5} aria-hidden />}
|
|
78
|
+
title="Registered"
|
|
79
|
+
description="Avery Castillo registered for Summer Invitational"
|
|
80
|
+
time="Jun 20"
|
|
81
|
+
/>
|
|
82
|
+
<TimelineItem
|
|
83
|
+
status="complete"
|
|
84
|
+
icon={<CreditCardIcon className="size-3" strokeWidth={1.5} aria-hidden />}
|
|
85
|
+
title="Payment received"
|
|
86
|
+
description="$85 entry fee processed"
|
|
87
|
+
time="Jun 21"
|
|
88
|
+
/>
|
|
89
|
+
<TimelineItem
|
|
90
|
+
status="active"
|
|
91
|
+
icon={<ClipboardCheckIcon className="size-3" strokeWidth={1.5} aria-hidden />}
|
|
92
|
+
title="Heat assignment"
|
|
93
|
+
description="200m freestyle — heat 3, lane 5"
|
|
94
|
+
time="Jun 25"
|
|
95
|
+
/>
|
|
96
|
+
<TimelineItem
|
|
97
|
+
status="pending"
|
|
98
|
+
icon={<TrophyIcon className="size-3" strokeWidth={1.5} aria-hidden />}
|
|
99
|
+
title="Meet day"
|
|
100
|
+
description="Breezy Hills Aquatic Center"
|
|
101
|
+
time="Jun 28"
|
|
102
|
+
/>
|
|
103
|
+
</Timeline>
|
|
104
|
+
</div>
|
|
105
|
+
),
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export const WithDescriptions: Story = {
|
|
109
|
+
render: () => (
|
|
110
|
+
<div className="w-96">
|
|
111
|
+
<Timeline>
|
|
112
|
+
<TimelineItem
|
|
113
|
+
status="complete"
|
|
114
|
+
title="Registration confirmed"
|
|
115
|
+
description="Avery Castillo has been registered for the Summer Invitational. Confirmation sent to parent."
|
|
116
|
+
time="Jun 20, 9:00 AM"
|
|
117
|
+
/>
|
|
118
|
+
<TimelineItem
|
|
119
|
+
status="complete"
|
|
120
|
+
title="Waiver signed"
|
|
121
|
+
description="Digital liability waiver completed by guardian."
|
|
122
|
+
time="Jun 21, 4:15 PM"
|
|
123
|
+
/>
|
|
124
|
+
<TimelineItem
|
|
125
|
+
status="active"
|
|
126
|
+
title="Seeding in progress"
|
|
127
|
+
description="Times being submitted to meet director. Final heat sheet expected Jun 26."
|
|
128
|
+
time="Jun 25"
|
|
129
|
+
/>
|
|
130
|
+
<TimelineItem
|
|
131
|
+
status="pending"
|
|
132
|
+
title="Check-in opens"
|
|
133
|
+
description="Athletes check in at the south entrance 90 minutes before first heat."
|
|
134
|
+
time="Jun 28, 7:30 AM"
|
|
135
|
+
/>
|
|
136
|
+
</Timeline>
|
|
137
|
+
</div>
|
|
138
|
+
),
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export const WithCustomContent: Story = {
|
|
142
|
+
render: () => (
|
|
143
|
+
<div className="w-80">
|
|
144
|
+
<Timeline>
|
|
145
|
+
<TimelineItem status="complete" title="Practice block added">
|
|
146
|
+
<div className="space-y-0.5">
|
|
147
|
+
<p className="text-sm text-muted-foreground">Tue/Thu 6:00–7:30 AM</p>
|
|
148
|
+
<p className="text-sm text-muted-foreground">Lane 3 · Coach Reeves</p>
|
|
149
|
+
</div>
|
|
150
|
+
</TimelineItem>
|
|
151
|
+
<TimelineItem status="active" title="Roster review">
|
|
152
|
+
<p className="text-sm text-muted-foreground">
|
|
153
|
+
14 of 16 athletes confirmed. 2 pending parent sign-off.
|
|
154
|
+
</p>
|
|
155
|
+
</TimelineItem>
|
|
156
|
+
<TimelineItem status="pending" title="Season kickoff">
|
|
157
|
+
<p className="text-sm text-muted-foreground">
|
|
158
|
+
All athletes + guardians invited. Pool reservation confirmed.
|
|
159
|
+
</p>
|
|
160
|
+
</TimelineItem>
|
|
161
|
+
</Timeline>
|
|
162
|
+
</div>
|
|
163
|
+
),
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export const SingleItem: Story = {
|
|
167
|
+
render: () => (
|
|
168
|
+
<div className="w-80">
|
|
169
|
+
<Timeline>
|
|
170
|
+
<TimelineItem
|
|
171
|
+
status="active"
|
|
172
|
+
title="Registration open"
|
|
173
|
+
description="Summer Invitational spots available. First come, first served."
|
|
174
|
+
time="Jun 25, 2026"
|
|
175
|
+
/>
|
|
176
|
+
</Timeline>
|
|
177
|
+
</div>
|
|
178
|
+
),
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
export const ActivityFeed: Story = {
|
|
182
|
+
render: () => (
|
|
183
|
+
<div className="w-80">
|
|
184
|
+
<Timeline>
|
|
185
|
+
<TimelineItem
|
|
186
|
+
status="complete"
|
|
187
|
+
icon={<FlameIcon className="size-3" strokeWidth={1.5} aria-hidden />}
|
|
188
|
+
title="Personal best — 100m freestyle"
|
|
189
|
+
description="Avery Castillo · 58.3s (prev: 59.1s)"
|
|
190
|
+
time="2 hours ago"
|
|
191
|
+
/>
|
|
192
|
+
<TimelineItem
|
|
193
|
+
status="complete"
|
|
194
|
+
icon={<CalendarIcon className="size-3" strokeWidth={1.5} aria-hidden />}
|
|
195
|
+
title="Practice session logged"
|
|
196
|
+
description="3,200m total · 8 swimmers"
|
|
197
|
+
time="Yesterday"
|
|
198
|
+
/>
|
|
199
|
+
<TimelineItem
|
|
200
|
+
status="complete"
|
|
201
|
+
icon={<AlertCircleIcon className="size-3" strokeWidth={1.5} aria-hidden />}
|
|
202
|
+
title="Absence reported"
|
|
203
|
+
description="Jordan Park — family conflict"
|
|
204
|
+
time="Jun 24"
|
|
205
|
+
/>
|
|
206
|
+
<TimelineItem
|
|
207
|
+
status="complete"
|
|
208
|
+
title="Season schedule published"
|
|
209
|
+
description="12 meets · 8 home, 4 away"
|
|
210
|
+
time="Jun 20"
|
|
211
|
+
/>
|
|
212
|
+
</Timeline>
|
|
213
|
+
</div>
|
|
214
|
+
),
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
// Realistic use: Breezy Hills Aquatic Club — athlete registration journey
|
|
218
|
+
export const RealisticUse: Story = {
|
|
219
|
+
render: () => (
|
|
220
|
+
<div className="w-96 rounded-lg border border-border bg-card p-5">
|
|
221
|
+
<div className="mb-4 space-y-1">
|
|
222
|
+
<p className="text-sm font-semibold">Avery Castillo · Summer Invitational</p>
|
|
223
|
+
<p className="text-xs text-muted-foreground">Breezy Hills Aquatic Club</p>
|
|
224
|
+
</div>
|
|
225
|
+
<Timeline>
|
|
226
|
+
<TimelineItem
|
|
227
|
+
status="complete"
|
|
228
|
+
icon={<UserCheckIcon className="size-3" strokeWidth={1.5} aria-hidden />}
|
|
229
|
+
title="Registration submitted"
|
|
230
|
+
description="200m freestyle · 400m IM"
|
|
231
|
+
time="Jun 20, 9:00 AM"
|
|
232
|
+
/>
|
|
233
|
+
<TimelineItem
|
|
234
|
+
status="complete"
|
|
235
|
+
icon={<CreditCardIcon className="size-3" strokeWidth={1.5} aria-hidden />}
|
|
236
|
+
title="Payment confirmed"
|
|
237
|
+
description="$85 — credit card ending 4821"
|
|
238
|
+
time="Jun 21, 11:30 AM"
|
|
239
|
+
/>
|
|
240
|
+
<TimelineItem
|
|
241
|
+
status="complete"
|
|
242
|
+
icon={<ClipboardCheckIcon className="size-3" strokeWidth={1.5} aria-hidden />}
|
|
243
|
+
title="Waiver signed"
|
|
244
|
+
description="Guardian: Morgan Castillo"
|
|
245
|
+
time="Jun 22, 3:15 PM"
|
|
246
|
+
/>
|
|
247
|
+
<TimelineItem
|
|
248
|
+
status="active"
|
|
249
|
+
title="Heat assignment pending"
|
|
250
|
+
description="Times submitted to meet director. Sheet expected Jun 26."
|
|
251
|
+
time="Jun 25 (today)"
|
|
252
|
+
/>
|
|
253
|
+
<TimelineItem
|
|
254
|
+
status="pending"
|
|
255
|
+
icon={<TrophyIcon className="size-3" strokeWidth={1.5} aria-hidden />}
|
|
256
|
+
title="Summer Invitational"
|
|
257
|
+
description="Breezy Hills Aquatic Center · Check-in 7:30 AM"
|
|
258
|
+
time="Jun 28, 2026"
|
|
259
|
+
/>
|
|
260
|
+
</Timeline>
|
|
261
|
+
</div>
|
|
262
|
+
),
|
|
263
|
+
};
|