@behavioral-agentic-design-system/core 0.23.0 → 0.26.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 +8 -4
- package/scripts/build-tokens.cjs +79 -5
- package/src/app/preview/components/page.tsx +4760 -213
- package/src/app/shell.tsx +18 -6
- package/src/components/customize/brand-mark-section.tsx +1 -1
- package/src/components/customize-tab.tsx +2 -2
- package/src/components/home-tab.tsx +2 -2
- package/src/components/ui/action-bar.tsx +142 -0
- package/src/components/ui/affix.tsx +109 -0
- package/src/components/ui/alert.tsx +37 -3
- package/src/components/ui/anchor.tsx +136 -0
- package/src/components/ui/angle-slider.tsx +265 -0
- package/src/components/ui/autocomplete.tsx +223 -0
- package/src/components/ui/avatar.tsx +8 -2
- package/src/components/ui/blockquote.tsx +112 -0
- package/src/components/ui/bottom-navigation.tsx +144 -0
- package/src/components/ui/burger.tsx +117 -0
- package/src/components/ui/button.tsx +101 -3
- package/src/components/ui/calendar.tsx +1 -1
- package/src/components/ui/card.tsx +43 -5
- package/src/components/ui/carousel.tsx +10 -5
- package/src/components/ui/cascader.tsx +253 -0
- package/src/components/ui/checkbox-card.tsx +176 -0
- package/src/components/ui/checkbox-group.tsx +231 -0
- package/src/components/ui/checkbox.tsx +14 -3
- package/src/components/ui/chip.tsx +143 -0
- package/src/components/ui/circular-progress.tsx +2 -2
- package/src/components/ui/color-swatch.tsx +73 -0
- package/src/components/ui/copy-button.tsx +21 -4
- package/src/components/ui/data-list.tsx +169 -0
- package/src/components/ui/date-picker.tsx +6 -3
- package/src/components/ui/date-range-picker.tsx +6 -3
- package/src/components/ui/fieldset.tsx +8 -2
- package/src/components/ui/float-label.tsx +114 -0
- package/src/components/ui/floating-panel.tsx +129 -0
- package/src/components/ui/format-number.tsx +122 -0
- package/src/components/ui/highlight.tsx +85 -0
- package/src/components/ui/image.tsx +195 -0
- package/src/components/ui/index.ts +52 -0
- package/src/components/ui/indicator.tsx +2 -2
- package/src/components/ui/input-group.tsx +11 -1
- package/src/components/ui/input.tsx +48 -4
- package/src/components/ui/kbd.tsx +1 -1
- package/src/components/ui/link.tsx +158 -0
- package/src/components/ui/listbox.tsx +426 -0
- package/src/components/ui/loading-overlay.tsx +80 -0
- package/src/components/ui/marquee.tsx +193 -0
- package/src/components/ui/masonry.tsx +164 -0
- package/src/components/ui/meter.tsx +186 -0
- package/src/components/ui/motion-toggle.tsx +170 -0
- package/src/components/ui/notification.tsx +175 -0
- package/src/components/ui/overlay.tsx +63 -0
- package/src/components/ui/progress.tsx +95 -4
- package/src/components/ui/qr-code.tsx +107 -0
- package/src/components/ui/rating-group.tsx +1 -0
- package/src/components/ui/separator.tsx +57 -1
- package/src/components/ui/sidebar.tsx +1 -1
- package/src/components/ui/signature-pad.tsx +381 -0
- package/src/components/ui/skeleton.tsx +59 -2
- package/src/components/ui/skip-link.tsx +117 -0
- package/src/components/ui/slider.tsx +86 -1
- package/src/components/ui/spoiler.tsx +131 -0
- package/src/components/ui/tabs.tsx +1 -1
- package/src/components/ui/text.tsx +135 -0
- package/src/components/ui/textarea.tsx +66 -2
- package/src/components/ui/timeline.tsx +71 -14
- package/src/components/ui/timer.tsx +183 -0
- package/src/components/ui/tour.tsx +332 -0
- package/src/components/ui/transfer-list.tsx +308 -0
- package/src/components/ui/visually-hidden.tsx +42 -0
- package/src/components/ui/watermark.tsx +0 -0
- package/src/data/docs-index.ts +10 -2
- package/src/stories/ActionBar.stories.tsx +201 -0
- package/src/stories/Affix.stories.tsx +165 -0
- package/src/stories/Alert.stories.tsx +58 -0
- package/src/stories/Anchor.stories.tsx +236 -0
- package/src/stories/AngleSlider.stories.tsx +128 -0
- package/src/stories/Autocomplete.stories.tsx +216 -0
- package/src/stories/Avatar.stories.tsx +73 -1
- package/src/stories/Blockquote.stories.tsx +148 -0
- package/src/stories/BottomNavigation.stories.tsx +195 -0
- package/src/stories/Burger.stories.tsx +79 -0
- package/src/stories/Button.stories.tsx +103 -2
- package/src/stories/Calendar.stories.tsx +4 -0
- package/src/stories/Card.stories.tsx +30 -0
- package/src/stories/Carousel.stories.tsx +2 -1
- package/src/stories/Cascader.stories.tsx +285 -0
- package/src/stories/Checkbox.stories.tsx +13 -0
- package/src/stories/CheckboxCard.stories.tsx +210 -0
- package/src/stories/CheckboxGroup.stories.tsx +186 -0
- package/src/stories/Chip.stories.tsx +173 -0
- package/src/stories/CircularProgress.stories.tsx +3 -0
- package/src/stories/ColorSwatch.stories.tsx +81 -0
- package/src/stories/CopyButton.stories.tsx +3 -3
- package/src/stories/DataList.stories.tsx +160 -0
- package/src/stories/DatePicker.stories.tsx +3 -0
- package/src/stories/DateRangePicker.stories.tsx +3 -0
- package/src/stories/Editable.stories.tsx +14 -0
- package/src/stories/Fieldset.stories.tsx +4 -0
- package/src/stories/FloatLabel.stories.tsx +148 -0
- package/src/stories/FloatingPanel.stories.tsx +176 -0
- package/src/stories/FormatNumber.stories.tsx +308 -0
- package/src/stories/Highlight.stories.tsx +140 -0
- package/src/stories/Image.stories.tsx +141 -0
- package/src/stories/Indicator.stories.tsx +3 -0
- package/src/stories/Input.stories.tsx +33 -0
- package/src/stories/InputGroup.stories.tsx +39 -41
- package/src/stories/Kbd.stories.tsx +3 -0
- package/src/stories/Link.stories.tsx +198 -0
- package/src/stories/Listbox.stories.tsx +240 -0
- package/src/stories/LoadingOverlay.stories.tsx +148 -0
- package/src/stories/Marquee.stories.tsx +170 -0
- package/src/stories/Masonry.stories.tsx +227 -0
- package/src/stories/Meter.stories.tsx +143 -0
- package/src/stories/MotionToggle.stories.tsx +85 -0
- package/src/stories/Notification.stories.tsx +264 -0
- package/src/stories/Overlay.stories.tsx +169 -0
- package/src/stories/PasswordInput.stories.tsx +4 -0
- package/src/stories/Progress.stories.tsx +70 -27
- package/src/stories/QrCode.stories.tsx +146 -0
- package/src/stories/RatingGroup.stories.tsx +5 -0
- package/src/stories/Separator.stories.tsx +41 -5
- package/src/stories/Sidebar.stories.tsx +2 -1
- package/src/stories/SignaturePad.stories.tsx +112 -0
- package/src/stories/Skeleton.stories.tsx +23 -4
- package/src/stories/SkipLink.stories.tsx +137 -0
- package/src/stories/Slider.stories.tsx +28 -0
- package/src/stories/Spoiler.stories.tsx +122 -0
- package/src/stories/Tabs.stories.tsx +2 -1
- package/src/stories/Text.stories.tsx +191 -0
- package/src/stories/Textarea.stories.tsx +58 -6
- package/src/stories/Timeline.stories.tsx +82 -0
- package/src/stories/Timer.stories.tsx +160 -0
- package/src/stories/Tour.stories.tsx +191 -0
- package/src/stories/TransferList.stories.tsx +169 -0
- package/src/stories/VisuallyHidden.stories.tsx +105 -0
- package/src/stories/Watermark.stories.tsx +212 -0
- package/src/styles.css +80 -6
- package/src/tokens.json +2 -2
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Autocomplete } from "@behavioral-agentic-design-system/core/components/ui/autocomplete";
|
|
4
|
+
import { Label } from "@behavioral-agentic-design-system/core/components/ui/label";
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof Autocomplete> = {
|
|
7
|
+
title: "Components/Autocomplete",
|
|
8
|
+
component: Autocomplete,
|
|
9
|
+
parameters: { layout: "centered" },
|
|
10
|
+
tags: ["autodocs"],
|
|
11
|
+
argTypes: {
|
|
12
|
+
disabled: { control: "boolean" },
|
|
13
|
+
placeholder: { control: "text" },
|
|
14
|
+
size: {
|
|
15
|
+
control: "select",
|
|
16
|
+
options: ["sm", "default", "lg", "xl", "2xl"],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default meta;
|
|
22
|
+
type Story = StoryObj<typeof Autocomplete>;
|
|
23
|
+
|
|
24
|
+
// Real content from content/personas/bads.json — the primary persona's
|
|
25
|
+
// jargon pool (docs-topic search is the canonical use).
|
|
26
|
+
const TOPICS = [
|
|
27
|
+
"design tokens",
|
|
28
|
+
"semantic layer",
|
|
29
|
+
"a11y contract",
|
|
30
|
+
"CVA variants",
|
|
31
|
+
"Radix primitive",
|
|
32
|
+
"anti-pattern",
|
|
33
|
+
"token drift",
|
|
34
|
+
"visual regression",
|
|
35
|
+
"forced colors",
|
|
36
|
+
"focus trap",
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
const TEAMMATES = [
|
|
40
|
+
"Jordan Reeves",
|
|
41
|
+
"Seo-yun Park",
|
|
42
|
+
"Marcus Lindqvist",
|
|
43
|
+
"Anika Patel",
|
|
44
|
+
"Tomás Herrera",
|
|
45
|
+
"Yuki Tanaka",
|
|
46
|
+
"Chloé Dubois-Martin",
|
|
47
|
+
"Kofi Asante",
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
function Controlled({
|
|
51
|
+
initialValue = "",
|
|
52
|
+
...props
|
|
53
|
+
}: Omit<
|
|
54
|
+
React.ComponentProps<typeof Autocomplete>,
|
|
55
|
+
"value" | "onValueChange"
|
|
56
|
+
> & {
|
|
57
|
+
initialValue?: string;
|
|
58
|
+
}) {
|
|
59
|
+
const [value, setValue] = React.useState(initialValue);
|
|
60
|
+
return (
|
|
61
|
+
<div className="w-80">
|
|
62
|
+
<Autocomplete
|
|
63
|
+
value={value}
|
|
64
|
+
onValueChange={setValue}
|
|
65
|
+
aria-label={props.placeholder ?? "Search"}
|
|
66
|
+
{...props}
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export const Default: Story = {
|
|
73
|
+
render: () => (
|
|
74
|
+
<Controlled options={TOPICS} placeholder="Search docs topics…" />
|
|
75
|
+
),
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const Size_Sm: Story = {
|
|
79
|
+
render: () => (
|
|
80
|
+
<Controlled size="sm" options={TOPICS} placeholder="Search docs topics…" />
|
|
81
|
+
),
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const Size_Lg: Story = {
|
|
85
|
+
render: () => (
|
|
86
|
+
<Controlled size="lg" options={TOPICS} placeholder="Search docs topics…" />
|
|
87
|
+
),
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export const Size_Xl: Story = {
|
|
91
|
+
render: () => (
|
|
92
|
+
<Controlled size="xl" options={TOPICS} placeholder="Search docs topics…" />
|
|
93
|
+
),
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export const Size_2xl: Story = {
|
|
97
|
+
render: () => (
|
|
98
|
+
<Controlled
|
|
99
|
+
size="2xl"
|
|
100
|
+
options={TOPICS}
|
|
101
|
+
placeholder="Search docs topics…"
|
|
102
|
+
/>
|
|
103
|
+
),
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
// Disabled: the list never opens; Input's disabled styles apply.
|
|
107
|
+
export const Disabled: Story = {
|
|
108
|
+
render: () => (
|
|
109
|
+
<Controlled
|
|
110
|
+
disabled
|
|
111
|
+
initialValue="design tokens"
|
|
112
|
+
options={TOPICS}
|
|
113
|
+
placeholder="Search docs topics…"
|
|
114
|
+
/>
|
|
115
|
+
),
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
// Free text + picked-from-list are distinguishable: onOptionSelect fires
|
|
119
|
+
// only when a suggestion is committed, never on plain typing.
|
|
120
|
+
export const WithOptionSelect: Story = {
|
|
121
|
+
render: function WithOptionSelectStory() {
|
|
122
|
+
const [value, setValue] = React.useState("");
|
|
123
|
+
const [picked, setPicked] = React.useState<string | null>(null);
|
|
124
|
+
return (
|
|
125
|
+
<div className="w-80 space-y-2">
|
|
126
|
+
<Autocomplete
|
|
127
|
+
value={value}
|
|
128
|
+
onValueChange={(v) => {
|
|
129
|
+
setValue(v);
|
|
130
|
+
setPicked(null);
|
|
131
|
+
}}
|
|
132
|
+
onOptionSelect={setPicked}
|
|
133
|
+
options={TEAMMATES}
|
|
134
|
+
placeholder="Reviewer name…"
|
|
135
|
+
aria-label="Reviewer name"
|
|
136
|
+
/>
|
|
137
|
+
<p className="text-xs text-muted-foreground">
|
|
138
|
+
{picked
|
|
139
|
+
? `Picked from list: ${picked}`
|
|
140
|
+
: value
|
|
141
|
+
? `Typed (free text): ${value}`
|
|
142
|
+
: "Type a name or pick a suggestion"}
|
|
143
|
+
</p>
|
|
144
|
+
</div>
|
|
145
|
+
);
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
// Long-label overflow contract: unbroken strings (emails) truncate with
|
|
150
|
+
// min-w-0 + truncate instead of bleeding out of a narrow container.
|
|
151
|
+
export const LongOptions: Story = {
|
|
152
|
+
render: function LongOptionsStory() {
|
|
153
|
+
const [value, setValue] = React.useState("");
|
|
154
|
+
return (
|
|
155
|
+
<div className="w-56 space-y-2">
|
|
156
|
+
<p className="text-xs text-muted-foreground">
|
|
157
|
+
224px container — type “.” to open
|
|
158
|
+
</p>
|
|
159
|
+
<Autocomplete
|
|
160
|
+
value={value}
|
|
161
|
+
onValueChange={setValue}
|
|
162
|
+
options={[
|
|
163
|
+
"seoyun.park@figma.com",
|
|
164
|
+
"chloe@dubois-martin.fr",
|
|
165
|
+
"tomas.herrera@vercel.com",
|
|
166
|
+
"marcus@lindqvist.dev",
|
|
167
|
+
"anika.patel@stripe.com",
|
|
168
|
+
]}
|
|
169
|
+
placeholder="Reviewer email…"
|
|
170
|
+
aria-label="Reviewer email"
|
|
171
|
+
/>
|
|
172
|
+
</div>
|
|
173
|
+
);
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
// Realistic use: assign a design review — pick a teammate or type any name.
|
|
178
|
+
export const RealisticUse: Story = {
|
|
179
|
+
render: function RealisticUseStory() {
|
|
180
|
+
const [value, setValue] = React.useState("");
|
|
181
|
+
const [picked, setPicked] = React.useState<string | null>(null);
|
|
182
|
+
const inputId = React.useId();
|
|
183
|
+
return (
|
|
184
|
+
<div className="w-96 space-y-4">
|
|
185
|
+
<div className="space-y-1.5">
|
|
186
|
+
<p className="text-xs text-muted-foreground">
|
|
187
|
+
Button · v2.4.0 release · Design review
|
|
188
|
+
</p>
|
|
189
|
+
<Label htmlFor={inputId}>Assign reviewer</Label>
|
|
190
|
+
<Autocomplete
|
|
191
|
+
id={inputId}
|
|
192
|
+
value={value}
|
|
193
|
+
onValueChange={(v) => {
|
|
194
|
+
setValue(v);
|
|
195
|
+
setPicked(null);
|
|
196
|
+
}}
|
|
197
|
+
onOptionSelect={setPicked}
|
|
198
|
+
options={TEAMMATES}
|
|
199
|
+
size="xl"
|
|
200
|
+
placeholder="Start typing a name…"
|
|
201
|
+
/>
|
|
202
|
+
<p className="text-xs text-muted-foreground">
|
|
203
|
+
Pick a teammate or type any name — free text is accepted.
|
|
204
|
+
</p>
|
|
205
|
+
</div>
|
|
206
|
+
{value && (
|
|
207
|
+
<p className="text-sm text-muted-foreground">
|
|
208
|
+
Review will be assigned to{" "}
|
|
209
|
+
<span className="font-medium text-foreground">{value}</span>
|
|
210
|
+
{picked === null && value.trim() !== "" ? " (external)" : ""}
|
|
211
|
+
</p>
|
|
212
|
+
)}
|
|
213
|
+
</div>
|
|
214
|
+
);
|
|
215
|
+
},
|
|
216
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Avatar, AvatarFallback, AvatarImage } from "@behavioral-agentic-design-system/core/components/ui/avatar";
|
|
2
|
+
import { Avatar, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage } from "@behavioral-agentic-design-system/core/components/ui/avatar";
|
|
3
3
|
|
|
4
4
|
const meta: Meta<typeof Avatar> = {
|
|
5
5
|
title: "Components/Avatar",
|
|
@@ -23,6 +23,78 @@ export const Default: Story = {
|
|
|
23
23
|
</div>),
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
+
export const Shape_Circle: Story = {
|
|
27
|
+
render: () => (
|
|
28
|
+
<div className="flex items-center gap-3">
|
|
29
|
+
<Avatar shape="circle" size="lg">
|
|
30
|
+
<AvatarImage src="/avatars/01.png" alt="Jordan Reeves" />
|
|
31
|
+
<AvatarFallback>JR</AvatarFallback>
|
|
32
|
+
</Avatar>
|
|
33
|
+
<Avatar shape="circle" size="lg">
|
|
34
|
+
<AvatarFallback>SP</AvatarFallback>
|
|
35
|
+
</Avatar>
|
|
36
|
+
</div>
|
|
37
|
+
),
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const Shape_Square: Story = {
|
|
41
|
+
render: () => (
|
|
42
|
+
<div className="flex items-center gap-3">
|
|
43
|
+
<Avatar shape="square" size="lg">
|
|
44
|
+
<AvatarImage src="/avatars/01.png" alt="Anika Patel" />
|
|
45
|
+
<AvatarFallback>AP</AvatarFallback>
|
|
46
|
+
</Avatar>
|
|
47
|
+
<Avatar shape="square" size="lg">
|
|
48
|
+
<AvatarFallback>KA</AvatarFallback>
|
|
49
|
+
</Avatar>
|
|
50
|
+
</div>
|
|
51
|
+
),
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const Group: Story = {
|
|
55
|
+
render: () => (
|
|
56
|
+
<AvatarGroup aria-label="Project contributors: Jordan Reeves, Seo-yun Park, Marcus Lindqvist, and 3 more">
|
|
57
|
+
<Avatar>
|
|
58
|
+
<AvatarImage src="/avatars/01.png" alt="Jordan Reeves" />
|
|
59
|
+
<AvatarFallback>JR</AvatarFallback>
|
|
60
|
+
</Avatar>
|
|
61
|
+
<Avatar>
|
|
62
|
+
<AvatarFallback>SP</AvatarFallback>
|
|
63
|
+
</Avatar>
|
|
64
|
+
<Avatar>
|
|
65
|
+
<AvatarFallback>ML</AvatarFallback>
|
|
66
|
+
</Avatar>
|
|
67
|
+
<AvatarGroupCount title="Anika Patel and 2 more">+3</AvatarGroupCount>
|
|
68
|
+
</AvatarGroup>
|
|
69
|
+
),
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const Group_Sizes: Story = {
|
|
73
|
+
render: () => (
|
|
74
|
+
<div className="flex flex-col items-start gap-4">
|
|
75
|
+
<AvatarGroup aria-label="Reviewers: Jordan Reeves, Seo-yun Park, and 2 more">
|
|
76
|
+
<Avatar size="sm">
|
|
77
|
+
<AvatarFallback>JR</AvatarFallback>
|
|
78
|
+
</Avatar>
|
|
79
|
+
<Avatar size="sm">
|
|
80
|
+
<AvatarFallback>SP</AvatarFallback>
|
|
81
|
+
</Avatar>
|
|
82
|
+
<AvatarGroupCount>+2</AvatarGroupCount>
|
|
83
|
+
</AvatarGroup>
|
|
84
|
+
<AvatarGroup aria-label="Workshop attendees: Marcus Lindqvist, Anika Patel, and 4 more">
|
|
85
|
+
<Avatar size="lg">
|
|
86
|
+
<AvatarImage src="/avatars/01.png" alt="Marcus Lindqvist" />
|
|
87
|
+
<AvatarFallback>ML</AvatarFallback>
|
|
88
|
+
</Avatar>
|
|
89
|
+
<Avatar size="lg">
|
|
90
|
+
<AvatarFallback>AP</AvatarFallback>
|
|
91
|
+
</Avatar>
|
|
92
|
+
<AvatarGroupCount>+4</AvatarGroupCount>
|
|
93
|
+
</AvatarGroup>
|
|
94
|
+
</div>
|
|
95
|
+
),
|
|
96
|
+
};
|
|
97
|
+
|
|
26
98
|
export const RealisticUse: Story = {
|
|
27
99
|
render: () => (<div className="flex items-center gap-3">
|
|
28
100
|
<Avatar>
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
3
|
+
import {
|
|
4
|
+
Blockquote,
|
|
5
|
+
BlockquoteContent,
|
|
6
|
+
BlockquoteAttribution,
|
|
7
|
+
} from "@behavioral-agentic-design-system/core/components/ui/blockquote"
|
|
8
|
+
import {
|
|
9
|
+
Card,
|
|
10
|
+
CardContent,
|
|
11
|
+
CardHeader,
|
|
12
|
+
CardTitle,
|
|
13
|
+
} from "@behavioral-agentic-design-system/core/components/ui/card"
|
|
14
|
+
|
|
15
|
+
const meta: Meta<typeof Blockquote> = {
|
|
16
|
+
title: "Components/Blockquote",
|
|
17
|
+
component: Blockquote,
|
|
18
|
+
parameters: { layout: "centered" },
|
|
19
|
+
tags: ["autodocs"],
|
|
20
|
+
argTypes: {
|
|
21
|
+
variant: { control: "select", options: ["default", "accent", "plain"] },
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default meta
|
|
26
|
+
type Story = StoryObj<typeof meta>
|
|
27
|
+
|
|
28
|
+
// Content pulled from content/personas/bads.json (real-content rule) —
|
|
29
|
+
// quotes are verbatim lines from the persona pool's long_form entries.
|
|
30
|
+
|
|
31
|
+
export const Default: Story = {
|
|
32
|
+
render: () => (
|
|
33
|
+
<div className="max-w-md">
|
|
34
|
+
<Blockquote>
|
|
35
|
+
<BlockquoteContent>
|
|
36
|
+
If a primitive needs a paragraph of explanation, the API is wrong.
|
|
37
|
+
</BlockquoteContent>
|
|
38
|
+
<BlockquoteAttribution>
|
|
39
|
+
— Seo-yun Park, Senior Design Engineer
|
|
40
|
+
</BlockquoteAttribution>
|
|
41
|
+
</Blockquote>
|
|
42
|
+
</div>
|
|
43
|
+
),
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const Variant_Accent: Story = {
|
|
47
|
+
render: () => (
|
|
48
|
+
<div className="max-w-md">
|
|
49
|
+
<Blockquote variant="accent">
|
|
50
|
+
<BlockquoteContent>
|
|
51
|
+
Jordan reads component source before adopting anything, and will
|
|
52
|
+
absolutely bounce a PR for a hardcoded hex value.
|
|
53
|
+
</BlockquoteContent>
|
|
54
|
+
<BlockquoteAttribution>
|
|
55
|
+
— Design Systems Team, Austin
|
|
56
|
+
</BlockquoteAttribution>
|
|
57
|
+
</Blockquote>
|
|
58
|
+
</div>
|
|
59
|
+
),
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export const Variant_Plain: Story = {
|
|
63
|
+
render: () => (
|
|
64
|
+
<div className="max-w-md space-y-3 text-sm leading-relaxed text-foreground">
|
|
65
|
+
<p>
|
|
66
|
+
The onboarding doc opens with the team’s working rule for every
|
|
67
|
+
new primitive:
|
|
68
|
+
</p>
|
|
69
|
+
<Blockquote variant="plain">
|
|
70
|
+
<BlockquoteContent className="text-sm">
|
|
71
|
+
Fork it, rename it, customize the brand colors, and start building.
|
|
72
|
+
</BlockquoteContent>
|
|
73
|
+
<BlockquoteAttribution>— BADS onboarding</BlockquoteAttribution>
|
|
74
|
+
</Blockquote>
|
|
75
|
+
</div>
|
|
76
|
+
),
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// The native cite attribute carries the machine-readable source URL;
|
|
80
|
+
// the visible <cite> element inside the attribution names the work.
|
|
81
|
+
export const WithCitation: Story = {
|
|
82
|
+
render: () => (
|
|
83
|
+
<div className="max-w-md">
|
|
84
|
+
<Blockquote>
|
|
85
|
+
<BlockquoteContent cite="https://design.bads.com/docs/getting-started">
|
|
86
|
+
BADS ships with tokens, components, and accessibility baked in.
|
|
87
|
+
</BlockquoteContent>
|
|
88
|
+
<BlockquoteAttribution>
|
|
89
|
+
— Jordan Reeves, <cite>Getting started guide</cite>
|
|
90
|
+
</BlockquoteAttribution>
|
|
91
|
+
</Blockquote>
|
|
92
|
+
</div>
|
|
93
|
+
),
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Long quote + long attribution in a narrow container — exercises the
|
|
97
|
+
// overflow contract (min-w-0 + overflow-wrap:anywhere): the unbroken
|
|
98
|
+
// long email wraps instead of bleeding out of the 320px box.
|
|
99
|
+
export const LongContent: Story = {
|
|
100
|
+
render: () => (
|
|
101
|
+
<div className="w-[320px]">
|
|
102
|
+
<Blockquote>
|
|
103
|
+
<BlockquoteContent>
|
|
104
|
+
This release adds three primitives to the registry, tightens the
|
|
105
|
+
focus-ring offset to 2px across every interactive component, and
|
|
106
|
+
regenerates both CSS files from tokens.json. Upgrading is a standard
|
|
107
|
+
package bump — no breaking API changes, but re-run pnpm build:tokens
|
|
108
|
+
if your fork overrides the motion durations.
|
|
109
|
+
</BlockquoteContent>
|
|
110
|
+
<BlockquoteAttribution>
|
|
111
|
+
— Wilhelmina-Constance Featherstonehaugh-Vance,
|
|
112
|
+
wilhelmina.featherstonehaugh-vance@subdomain.consulting.example.org
|
|
113
|
+
</BlockquoteAttribution>
|
|
114
|
+
</Blockquote>
|
|
115
|
+
</div>
|
|
116
|
+
),
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export const RealisticUse: Story = {
|
|
120
|
+
render: () => (
|
|
121
|
+
<Card className="w-96">
|
|
122
|
+
<CardHeader>
|
|
123
|
+
<CardTitle className="text-lg">What adopters say</CardTitle>
|
|
124
|
+
</CardHeader>
|
|
125
|
+
<CardContent className="space-y-6">
|
|
126
|
+
<Blockquote variant="accent">
|
|
127
|
+
<BlockquoteContent cite="https://design.bads.com/share/tokens-v2-proposal">
|
|
128
|
+
She wrote the team’s first token pipeline, wired Storybook
|
|
129
|
+
coverage into pre-commit, and now spends most weeks talking product
|
|
130
|
+
teams out of one-off components.
|
|
131
|
+
</BlockquoteContent>
|
|
132
|
+
<BlockquoteAttribution>
|
|
133
|
+
— Seo-yun Park, Senior Design Engineer
|
|
134
|
+
</BlockquoteAttribution>
|
|
135
|
+
</Blockquote>
|
|
136
|
+
<Blockquote>
|
|
137
|
+
<BlockquoteContent>
|
|
138
|
+
36 components, all passing AAA contrast. Last token change was 3
|
|
139
|
+
days ago. Your Storybook coverage is at 100%.
|
|
140
|
+
</BlockquoteContent>
|
|
141
|
+
<BlockquoteAttribution>
|
|
142
|
+
— Jordan Reeves, <cite>adoption review, 2026-05-26</cite>
|
|
143
|
+
</BlockquoteAttribution>
|
|
144
|
+
</Blockquote>
|
|
145
|
+
</CardContent>
|
|
146
|
+
</Card>
|
|
147
|
+
),
|
|
148
|
+
}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import {
|
|
4
|
+
HomeIcon,
|
|
5
|
+
SearchIcon,
|
|
6
|
+
LibraryIcon,
|
|
7
|
+
BellIcon,
|
|
8
|
+
UserIcon,
|
|
9
|
+
PaletteIcon,
|
|
10
|
+
BookOpenIcon,
|
|
11
|
+
} from "lucide-react";
|
|
12
|
+
import {
|
|
13
|
+
BottomNavigation,
|
|
14
|
+
BottomNavigationItem,
|
|
15
|
+
} from "@behavioral-agentic-design-system/core/components/ui/bottom-navigation";
|
|
16
|
+
import {
|
|
17
|
+
Card,
|
|
18
|
+
CardContent,
|
|
19
|
+
} from "@behavioral-agentic-design-system/core/components/ui/card";
|
|
20
|
+
import { Badge } from "@behavioral-agentic-design-system/core/components/ui/badge";
|
|
21
|
+
|
|
22
|
+
const meta: Meta<typeof BottomNavigation> = {
|
|
23
|
+
title: "Components/BottomNavigation",
|
|
24
|
+
component: BottomNavigation,
|
|
25
|
+
parameters: { layout: "centered" },
|
|
26
|
+
tags: ["autodocs"],
|
|
27
|
+
argTypes: {
|
|
28
|
+
fixed: { control: "boolean" },
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default meta;
|
|
33
|
+
type Story = StoryObj<typeof BottomNavigation>;
|
|
34
|
+
|
|
35
|
+
// Controlled wrapper for interactive stories. `fixed` stays off so the bar
|
|
36
|
+
// renders in-flow inside the Storybook canvas instead of escaping to the
|
|
37
|
+
// iframe viewport edge.
|
|
38
|
+
function Controlled({
|
|
39
|
+
defaultValue,
|
|
40
|
+
label,
|
|
41
|
+
children,
|
|
42
|
+
}: {
|
|
43
|
+
defaultValue: string;
|
|
44
|
+
label?: string;
|
|
45
|
+
children: React.ReactNode;
|
|
46
|
+
}) {
|
|
47
|
+
const [value, setValue] = React.useState(defaultValue);
|
|
48
|
+
return (
|
|
49
|
+
<div className="w-80 overflow-hidden rounded-lg border border-border">
|
|
50
|
+
<BottomNavigation value={value} onValueChange={setValue} label={label ?? "Demo"}>
|
|
51
|
+
{children}
|
|
52
|
+
</BottomNavigation>
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const Default: Story = {
|
|
58
|
+
render: () => (
|
|
59
|
+
<Controlled defaultValue="home" label="Primary">
|
|
60
|
+
<BottomNavigationItem
|
|
61
|
+
value="home"
|
|
62
|
+
icon={<HomeIcon strokeWidth={1.5} />}
|
|
63
|
+
label="Home"
|
|
64
|
+
/>
|
|
65
|
+
<BottomNavigationItem
|
|
66
|
+
value="search"
|
|
67
|
+
icon={<SearchIcon strokeWidth={1.5} />}
|
|
68
|
+
label="Search"
|
|
69
|
+
/>
|
|
70
|
+
<BottomNavigationItem
|
|
71
|
+
value="library"
|
|
72
|
+
icon={<LibraryIcon strokeWidth={1.5} />}
|
|
73
|
+
label="Library"
|
|
74
|
+
/>
|
|
75
|
+
</Controlled>
|
|
76
|
+
),
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const FiveItems: Story = {
|
|
80
|
+
render: () => (
|
|
81
|
+
<Controlled defaultValue="components" label="Design system">
|
|
82
|
+
<BottomNavigationItem
|
|
83
|
+
value="home"
|
|
84
|
+
icon={<HomeIcon strokeWidth={1.5} />}
|
|
85
|
+
label="Home"
|
|
86
|
+
/>
|
|
87
|
+
<BottomNavigationItem
|
|
88
|
+
value="components"
|
|
89
|
+
icon={<LibraryIcon strokeWidth={1.5} />}
|
|
90
|
+
label="Components"
|
|
91
|
+
/>
|
|
92
|
+
<BottomNavigationItem
|
|
93
|
+
value="tokens"
|
|
94
|
+
icon={<PaletteIcon strokeWidth={1.5} />}
|
|
95
|
+
label="Tokens"
|
|
96
|
+
/>
|
|
97
|
+
<BottomNavigationItem
|
|
98
|
+
value="docs"
|
|
99
|
+
icon={<BookOpenIcon strokeWidth={1.5} />}
|
|
100
|
+
label="Docs"
|
|
101
|
+
/>
|
|
102
|
+
<BottomNavigationItem
|
|
103
|
+
value="profile"
|
|
104
|
+
icon={<UserIcon strokeWidth={1.5} />}
|
|
105
|
+
label="Profile"
|
|
106
|
+
/>
|
|
107
|
+
</Controlled>
|
|
108
|
+
),
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export const Disabled: Story = {
|
|
112
|
+
render: () => (
|
|
113
|
+
<Controlled defaultValue="home" label="Primary">
|
|
114
|
+
<BottomNavigationItem
|
|
115
|
+
value="home"
|
|
116
|
+
icon={<HomeIcon strokeWidth={1.5} />}
|
|
117
|
+
label="Home"
|
|
118
|
+
/>
|
|
119
|
+
<BottomNavigationItem
|
|
120
|
+
value="alerts"
|
|
121
|
+
icon={<BellIcon strokeWidth={1.5} />}
|
|
122
|
+
label="Alerts"
|
|
123
|
+
disabled
|
|
124
|
+
/>
|
|
125
|
+
<BottomNavigationItem
|
|
126
|
+
value="profile"
|
|
127
|
+
icon={<UserIcon strokeWidth={1.5} />}
|
|
128
|
+
label="Profile"
|
|
129
|
+
/>
|
|
130
|
+
</Controlled>
|
|
131
|
+
),
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
// Realistic use: mobile frame of the BADS docs app — content region above,
|
|
135
|
+
// bottom navigation anchored to the frame's bottom edge. Content pulled from
|
|
136
|
+
// content/personas/bads.json (design-system practitioner audience).
|
|
137
|
+
export const RealisticUse: Story = {
|
|
138
|
+
render: () => {
|
|
139
|
+
const [section, setSection] = React.useState("components");
|
|
140
|
+
const screens: Record<string, { title: string; body: string }> = {
|
|
141
|
+
home: {
|
|
142
|
+
title: "Welcome back, Jordan",
|
|
143
|
+
body: "Story coverage is at 98.4%. Last token change was 3 days ago.",
|
|
144
|
+
},
|
|
145
|
+
components: {
|
|
146
|
+
title: "Component registry",
|
|
147
|
+
body: "88 registry components with a11y contracts. Newest: QRCode, DataList, FormatNumber.",
|
|
148
|
+
},
|
|
149
|
+
tokens: {
|
|
150
|
+
title: "Tokens",
|
|
151
|
+
body: "12,417 token references scanned in the last orphan-lint sweep. Zero orphans flagged.",
|
|
152
|
+
},
|
|
153
|
+
profile: {
|
|
154
|
+
title: "Jordan Reeves",
|
|
155
|
+
body: "Design Systems Lead · jordan@reeves.design · Austin, TX",
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
const screen = screens[section];
|
|
159
|
+
return (
|
|
160
|
+
<div className="flex h-[480px] w-72 flex-col overflow-hidden rounded-xl border border-border bg-background shadow-sm">
|
|
161
|
+
<div className="flex-1 space-y-3 overflow-y-auto p-4">
|
|
162
|
+
<Badge variant="secondary">design.bads.com</Badge>
|
|
163
|
+
<h2 className="text-lg font-semibold">{screen.title}</h2>
|
|
164
|
+
<Card>
|
|
165
|
+
<CardContent className="p-4">
|
|
166
|
+
<p className="text-sm text-muted-foreground">{screen.body}</p>
|
|
167
|
+
</CardContent>
|
|
168
|
+
</Card>
|
|
169
|
+
</div>
|
|
170
|
+
<BottomNavigation value={section} onValueChange={setSection} label="Primary">
|
|
171
|
+
<BottomNavigationItem
|
|
172
|
+
value="home"
|
|
173
|
+
icon={<HomeIcon strokeWidth={1.5} />}
|
|
174
|
+
label="Home"
|
|
175
|
+
/>
|
|
176
|
+
<BottomNavigationItem
|
|
177
|
+
value="components"
|
|
178
|
+
icon={<LibraryIcon strokeWidth={1.5} />}
|
|
179
|
+
label="Components"
|
|
180
|
+
/>
|
|
181
|
+
<BottomNavigationItem
|
|
182
|
+
value="tokens"
|
|
183
|
+
icon={<PaletteIcon strokeWidth={1.5} />}
|
|
184
|
+
label="Tokens"
|
|
185
|
+
/>
|
|
186
|
+
<BottomNavigationItem
|
|
187
|
+
value="profile"
|
|
188
|
+
icon={<UserIcon strokeWidth={1.5} />}
|
|
189
|
+
label="Profile"
|
|
190
|
+
/>
|
|
191
|
+
</BottomNavigation>
|
|
192
|
+
</div>
|
|
193
|
+
);
|
|
194
|
+
},
|
|
195
|
+
};
|