@behavioral-agentic-design-system/core 0.37.0 → 0.39.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/a11y-lint.cjs +8 -2
- package/scripts/a11y-ratchet.mjs +172 -0
- package/scripts/accent-as-text.mjs +274 -0
- package/scripts/bads-doctor.mjs +2 -1
- package/scripts/check-stories.mjs +265 -52
- package/scripts/contrast.mjs +44 -0
- package/scripts/health-report.mjs +211 -122
- package/scripts/lint-slop.mjs +44 -2
- package/scripts/oklch-to-hex.cjs +7 -1
- package/scripts/ratchet.mjs +326 -0
- package/scripts/slop-rules.mjs +156 -0
- package/scripts/token-nearest.mjs +333 -0
- package/scripts/wcag-audit.cjs +59 -8
- package/src/app/preview/components/page.tsx +363 -0
- package/src/components/Foundations/Typography.stories.tsx +82 -21
- package/src/components/ui/accordion.tsx +67 -5
- package/src/components/ui/alert.tsx +20 -7
- package/src/components/ui/avatar.tsx +18 -4
- package/src/components/ui/breadcrumb.tsx +47 -0
- package/src/components/ui/checkbox-card.tsx +48 -8
- package/src/components/ui/checkbox.tsx +17 -8
- package/src/components/ui/format-date.tsx +107 -0
- package/src/components/ui/progress.tsx +6 -5
- package/src/components/ui/sparkline.tsx +198 -0
- package/src/components/ui/tag.tsx +17 -1
- package/src/components/ui/tags-input.tsx +84 -11
- package/src/components/ui/toggle-group.tsx +13 -0
- package/src/components/ui/week-picker.tsx +463 -0
- package/src/data/docs-index.ts +12 -0
- package/src/lib/theme-editor.ts +7 -1
- package/src/stories/Accordion.stories.tsx +59 -1
- package/src/stories/ActionBar.stories.tsx +1 -1
- package/src/stories/Affix.stories.tsx +1 -1
- package/src/stories/AiBadge.stories.tsx +1 -1
- package/src/stories/Alert.stories.tsx +36 -1
- package/src/stories/AlertDialog.stories.tsx +1 -1
- package/src/stories/Anchor.stories.tsx +1 -1
- package/src/stories/AngleSlider.stories.tsx +1 -1
- package/src/stories/AspectRatio.stories.tsx +1 -1
- package/src/stories/Autocomplete.stories.tsx +1 -1
- package/src/stories/Avatar.stories.tsx +41 -1
- package/src/stories/Badge.stories.tsx +1 -1
- package/src/stories/Blockquote.stories.tsx +1 -1
- package/src/stories/BottomNavigation.stories.tsx +1 -1
- package/src/stories/Breadcrumb.stories.tsx +38 -5
- package/src/stories/Burger.stories.tsx +1 -1
- package/src/stories/Button.stories.tsx +9 -1
- package/src/stories/ButtonGroup.stories.tsx +1 -1
- package/src/stories/Calendar.stories.tsx +1 -1
- package/src/stories/Card.stories.tsx +1 -1
- package/src/stories/Carousel.stories.tsx +1 -1
- package/src/stories/Cascader.stories.tsx +1 -1
- package/src/stories/Chart.stories.tsx +1 -1
- package/src/stories/ChatBubble.stories.tsx +1 -1
- package/src/stories/ChatMarker.stories.tsx +1 -1
- package/src/stories/Checkbox.stories.tsx +36 -5
- package/src/stories/CheckboxCard.stories.tsx +37 -2
- package/src/stories/CheckboxGroup.stories.tsx +1 -1
- package/src/stories/Chip.stories.tsx +1 -1
- package/src/stories/CircularProgress.stories.tsx +17 -1
- package/src/stories/Clipboard.stories.tsx +1 -1
- package/src/stories/CloseButton.stories.tsx +1 -1
- package/src/stories/Code.stories.tsx +1 -1
- package/src/stories/Collapsible.stories.tsx +1 -1
- package/src/stories/ColorPicker.stories.tsx +1 -1
- package/src/stories/ColorSwatch.stories.tsx +1 -1
- package/src/stories/Combobox.stories.tsx +1 -1
- package/src/stories/Command.stories.tsx +1 -1
- package/src/stories/Container.stories.tsx +1 -1
- package/src/stories/ContextMenu.stories.tsx +1 -1
- package/src/stories/CopyButton.stories.tsx +9 -1
- package/src/stories/DataList.stories.tsx +1 -1
- package/src/stories/DataTable.stories.tsx +1 -1
- package/src/stories/DateField.stories.tsx +1 -1
- package/src/stories/DatePicker.stories.tsx +1 -1
- package/src/stories/DateRangePicker.stories.tsx +1 -1
- package/src/stories/Dialog.stories.tsx +1 -1
- package/src/stories/Drawer.stories.tsx +1 -1
- package/src/stories/DropdownMenu.stories.tsx +1 -1
- package/src/stories/Editable.stories.tsx +1 -1
- package/src/stories/EmptyState.stories.tsx +1 -1
- package/src/stories/Field.stories.tsx +1 -1
- package/src/stories/Fieldset.stories.tsx +1 -1
- package/src/stories/FileButton.stories.tsx +1 -1
- package/src/stories/FileUpload.stories.tsx +1 -1
- package/src/stories/FloatLabel.stories.tsx +1 -1
- package/src/stories/FloatingActionButton.stories.tsx +1 -1
- package/src/stories/FloatingIndicator.stories.tsx +1 -1
- package/src/stories/FloatingPanel.stories.tsx +9 -1
- package/src/stories/FocusTrap.stories.tsx +1 -1
- package/src/stories/FormatByte.stories.tsx +1 -1
- package/src/stories/FormatDate.stories.tsx +174 -0
- package/src/stories/FormatNumber.stories.tsx +1 -1
- package/src/stories/Highlight.stories.tsx +1 -1
- package/src/stories/HoverCard.stories.tsx +1 -1
- package/src/stories/Image.stories.tsx +1 -1
- package/src/stories/Indicator.stories.tsx +17 -1
- package/src/stories/Input.stories.tsx +1 -1
- package/src/stories/InputClearButton.stories.tsx +1 -1
- package/src/stories/InputGroup.stories.tsx +1 -1
- package/src/stories/Kbd.stories.tsx +1 -1
- package/src/stories/KeyboardShortcut.stories.tsx +1 -1
- package/src/stories/Label.stories.tsx +1 -1
- package/src/stories/Link.stories.tsx +1 -1
- package/src/stories/List.stories.tsx +1 -1
- package/src/stories/Listbox.stories.tsx +1 -1
- package/src/stories/LoadingDots.stories.tsx +1 -1
- package/src/stories/LoadingOverlay.stories.tsx +1 -1
- package/src/stories/Mark.stories.tsx +1 -1
- package/src/stories/Marquee.stories.tsx +1 -1
- package/src/stories/Masonry.stories.tsx +1 -1
- package/src/stories/Menubar.stories.tsx +1 -1
- package/src/stories/Meter.stories.tsx +1 -1
- package/src/stories/MonthPicker.stories.tsx +1 -1
- package/src/stories/MotionToggle.stories.tsx +1 -1
- package/src/stories/MultiSelect.stories.tsx +1 -1
- package/src/stories/NativeSelect.stories.tsx +1 -1
- package/src/stories/NavLink.stories.tsx +1 -1
- package/src/stories/NavigationMenu.stories.tsx +1 -1
- package/src/stories/NavigationRail.stories.tsx +9 -1
- package/src/stories/Notification.stories.tsx +1 -1
- package/src/stories/NumberInput.stories.tsx +1 -1
- package/src/stories/Overlay.stories.tsx +1 -1
- package/src/stories/Pagination.stories.tsx +1 -1
- package/src/stories/PasswordInput.stories.tsx +1 -1
- package/src/stories/PinInput.stories.tsx +1 -1
- package/src/stories/Popover.stories.tsx +1 -1
- package/src/stories/Progress.stories.tsx +11 -1
- package/src/stories/Prose.stories.tsx +1 -1
- package/src/stories/QrCode.stories.tsx +1 -1
- package/src/stories/Questionnaire.stories.tsx +1 -1
- package/src/stories/RadioGroup.stories.tsx +1 -1
- package/src/stories/RatingGroup.stories.tsx +1 -1
- package/src/stories/Resizable.stories.tsx +1 -1
- package/src/stories/Result.stories.tsx +1 -1
- package/src/stories/Reveal.stories.tsx +1 -1
- package/src/stories/RollingNumber.stories.tsx +1 -1
- package/src/stories/ScrollArea.stories.tsx +1 -1
- package/src/stories/SearchInput.stories.tsx +1 -1
- package/src/stories/SegmentedControl.stories.tsx +1 -1
- package/src/stories/Select.stories.tsx +1 -1
- package/src/stories/Separator.stories.tsx +1 -1
- package/src/stories/Sheet.stories.tsx +1 -1
- package/src/stories/Sidebar.stories.tsx +1 -1
- package/src/stories/SignaturePad.stories.tsx +1 -1
- package/src/stories/SimpleGrid.stories.tsx +1 -1
- package/src/stories/Skeleton.stories.tsx +1 -1
- package/src/stories/SkeletonTable.stories.tsx +1 -1
- package/src/stories/SkipLink.stories.tsx +1 -1
- package/src/stories/Slider.stories.tsx +1 -1
- package/src/stories/Sonner.stories.tsx +1 -1
- package/src/stories/Sparkline.stories.tsx +208 -0
- package/src/stories/Spinner.stories.tsx +9 -1
- package/src/stories/Spoiler.stories.tsx +1 -1
- package/src/stories/Squircle.stories.tsx +1 -1
- package/src/stories/Stack.stories.tsx +1 -1
- package/src/stories/StatusBadge.stories.tsx +1 -1
- package/src/stories/Stepper.stories.tsx +1 -1
- package/src/stories/Switch.stories.tsx +1 -1
- package/src/stories/Table.stories.tsx +1 -1
- package/src/stories/Tabs.stories.tsx +1 -1
- package/src/stories/Tag.stories.tsx +23 -1
- package/src/stories/TagsInput.stories.tsx +46 -1
- package/src/stories/Text.stories.tsx +1 -1
- package/src/stories/Textarea.stories.tsx +1 -1
- package/src/stories/ThemeIcon.stories.tsx +1 -1
- package/src/stories/TimePicker.stories.tsx +1 -1
- package/src/stories/Timeline.stories.tsx +9 -1
- package/src/stories/Timer.stories.tsx +1 -1
- package/src/stories/Toggle.stories.tsx +1 -1
- package/src/stories/ToggleGroup.stories.tsx +21 -1
- package/src/stories/ToggleTip.stories.tsx +1 -1
- package/src/stories/Toolbar.stories.tsx +1 -1
- package/src/stories/Tooltip.stories.tsx +1 -1
- package/src/stories/Tour.stories.tsx +1 -1
- package/src/stories/TransferList.stories.tsx +1 -1
- package/src/stories/TreeSelect.stories.tsx +1 -1
- package/src/stories/TreeView.stories.tsx +1 -1
- package/src/stories/TypingIndicator.stories.tsx +1 -1
- package/src/stories/VisuallyHidden.stories.tsx +1 -1
- package/src/stories/Watermark.stories.tsx +1 -1
- package/src/stories/WeekPicker.stories.tsx +90 -0
- package/src/stories/WordRotate.stories.tsx +1 -1
- package/src/stories/YearPicker.stories.tsx +1 -1
- package/src/stories/story-groups.json +199 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
3
|
+
import { Sparkline } from "@behavioral-agentic-design-system/core/components/ui/sparkline"
|
|
4
|
+
import {
|
|
5
|
+
Card,
|
|
6
|
+
CardContent,
|
|
7
|
+
CardHeader,
|
|
8
|
+
CardTitle,
|
|
9
|
+
CardDescription,
|
|
10
|
+
} from "@behavioral-agentic-design-system/core/components/ui/card"
|
|
11
|
+
import { FormatNumber } from "@behavioral-agentic-design-system/core/components/ui/format-number"
|
|
12
|
+
|
|
13
|
+
const meta: Meta<typeof Sparkline> = {
|
|
14
|
+
title: "Components/Content and data/Sparkline",
|
|
15
|
+
component: Sparkline,
|
|
16
|
+
parameters: { layout: "centered" },
|
|
17
|
+
tags: ["autodocs"],
|
|
18
|
+
argTypes: {
|
|
19
|
+
type: { control: "select", options: ["area", "line"] },
|
|
20
|
+
curveType: { control: "select", options: ["linear", "monotone", "step"] },
|
|
21
|
+
height: { control: "number" },
|
|
22
|
+
withDot: { control: "boolean" },
|
|
23
|
+
},
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default meta
|
|
27
|
+
type Story = StoryObj<typeof meta>
|
|
28
|
+
|
|
29
|
+
// Revenue figures from content/personas/bads.json → primary.metrics.monthly
|
|
30
|
+
const REVENUE_DATA = [24000, 27500, 25800, 31200, 29400, 34100, 32600, 36200]
|
|
31
|
+
// User signups (positive trend)
|
|
32
|
+
const USER_DATA = [82, 95, 104, 98, 117, 131, 128, 142]
|
|
33
|
+
// Churn rate (declining = good; slightly bumpy)
|
|
34
|
+
const CHURN_DATA = [8.2, 7.9, 8.5, 7.4, 7.1, 6.8, 6.3, 6.0]
|
|
35
|
+
// Negative / mixed dataset
|
|
36
|
+
const NEGATIVE_DATA = [-12, 4, -8, 15, -3, 22, 8, -5]
|
|
37
|
+
|
|
38
|
+
export const Default: Story = {
|
|
39
|
+
render: () => (
|
|
40
|
+
<div className="flex flex-col gap-2">
|
|
41
|
+
<Sparkline
|
|
42
|
+
data={REVENUE_DATA}
|
|
43
|
+
className="w-32"
|
|
44
|
+
aria-label="Monthly revenue trend"
|
|
45
|
+
/>
|
|
46
|
+
<p className="text-xs text-muted-foreground">
|
|
47
|
+
Area chart (default) — 40px height, monotone curve
|
|
48
|
+
</p>
|
|
49
|
+
</div>
|
|
50
|
+
),
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const WithLine: Story = {
|
|
54
|
+
render: () => (
|
|
55
|
+
<div className="flex flex-col gap-2">
|
|
56
|
+
<Sparkline
|
|
57
|
+
data={USER_DATA}
|
|
58
|
+
type="line"
|
|
59
|
+
className="w-32"
|
|
60
|
+
aria-label="User signup trend"
|
|
61
|
+
/>
|
|
62
|
+
<p className="text-xs text-muted-foreground">
|
|
63
|
+
Line chart variant — no fill, same stroke weight
|
|
64
|
+
</p>
|
|
65
|
+
</div>
|
|
66
|
+
),
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export const WithDot: Story = {
|
|
70
|
+
render: () => (
|
|
71
|
+
<div className="flex flex-col gap-2">
|
|
72
|
+
<Sparkline
|
|
73
|
+
data={REVENUE_DATA}
|
|
74
|
+
withDot
|
|
75
|
+
className="w-32"
|
|
76
|
+
aria-label="Monthly revenue with current value dot"
|
|
77
|
+
/>
|
|
78
|
+
<p className="text-xs text-muted-foreground">
|
|
79
|
+
withDot — marks the last data point as the current value
|
|
80
|
+
</p>
|
|
81
|
+
</div>
|
|
82
|
+
),
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export const Negative: Story = {
|
|
86
|
+
render: () => (
|
|
87
|
+
<div className="flex flex-col gap-4">
|
|
88
|
+
<div className="flex flex-col gap-1">
|
|
89
|
+
<Sparkline
|
|
90
|
+
data={NEGATIVE_DATA}
|
|
91
|
+
type="area"
|
|
92
|
+
className="w-32"
|
|
93
|
+
aria-label="Mixed positive and negative trend"
|
|
94
|
+
/>
|
|
95
|
+
<p className="text-xs text-muted-foreground">Area — mixed sign data</p>
|
|
96
|
+
</div>
|
|
97
|
+
<div className="flex flex-col gap-1">
|
|
98
|
+
<Sparkline
|
|
99
|
+
data={NEGATIVE_DATA}
|
|
100
|
+
type="line"
|
|
101
|
+
color="var(--color-destructive)"
|
|
102
|
+
className="w-32"
|
|
103
|
+
aria-label="Mixed trend line in destructive color"
|
|
104
|
+
/>
|
|
105
|
+
<p className="text-xs text-muted-foreground">
|
|
106
|
+
Line — destructive color, negative-first dataset
|
|
107
|
+
</p>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
),
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export const RealisticUse: Story = {
|
|
114
|
+
render: () => {
|
|
115
|
+
const stats = [
|
|
116
|
+
{
|
|
117
|
+
label: "Revenue",
|
|
118
|
+
value: 36200,
|
|
119
|
+
format: "currency",
|
|
120
|
+
data: REVENUE_DATA,
|
|
121
|
+
trend: "+6.4%",
|
|
122
|
+
trendUp: true,
|
|
123
|
+
ariaLabel: "Monthly revenue trend",
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
label: "Active users",
|
|
127
|
+
value: 142,
|
|
128
|
+
format: "number",
|
|
129
|
+
data: USER_DATA,
|
|
130
|
+
trend: "+10.9%",
|
|
131
|
+
trendUp: true,
|
|
132
|
+
ariaLabel: "Monthly active users trend",
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
label: "Churn rate",
|
|
136
|
+
value: 6.0,
|
|
137
|
+
format: "percent",
|
|
138
|
+
data: CHURN_DATA,
|
|
139
|
+
trend: "−0.3pp",
|
|
140
|
+
trendUp: false,
|
|
141
|
+
ariaLabel: "Monthly churn rate trend",
|
|
142
|
+
},
|
|
143
|
+
]
|
|
144
|
+
|
|
145
|
+
return (
|
|
146
|
+
<Card className="w-[480px]">
|
|
147
|
+
<CardHeader>
|
|
148
|
+
<CardTitle>Engagement health</CardTitle>
|
|
149
|
+
<CardDescription>
|
|
150
|
+
BADS — Austin design systems team, last 8 months
|
|
151
|
+
</CardDescription>
|
|
152
|
+
</CardHeader>
|
|
153
|
+
<CardContent>
|
|
154
|
+
<div className="grid grid-cols-3 gap-4">
|
|
155
|
+
{stats.map((stat) => (
|
|
156
|
+
<div key={stat.label} className="flex flex-col gap-2">
|
|
157
|
+
<p className="text-xs font-medium text-muted-foreground">
|
|
158
|
+
{stat.label}
|
|
159
|
+
</p>
|
|
160
|
+
<p className="text-lg font-semibold tabular-nums text-foreground">
|
|
161
|
+
{stat.format === "currency" ? (
|
|
162
|
+
<FormatNumber
|
|
163
|
+
value={stat.value}
|
|
164
|
+
style="currency"
|
|
165
|
+
currency="USD"
|
|
166
|
+
notation="compact"
|
|
167
|
+
/>
|
|
168
|
+
) : stat.format === "percent" ? (
|
|
169
|
+
<FormatNumber
|
|
170
|
+
value={stat.value / 100}
|
|
171
|
+
style="percent"
|
|
172
|
+
maximumFractionDigits={1}
|
|
173
|
+
/>
|
|
174
|
+
) : (
|
|
175
|
+
<FormatNumber value={stat.value} />
|
|
176
|
+
)}
|
|
177
|
+
</p>
|
|
178
|
+
<Sparkline
|
|
179
|
+
data={stat.data}
|
|
180
|
+
withDot
|
|
181
|
+
height={36}
|
|
182
|
+
className="w-full"
|
|
183
|
+
color={
|
|
184
|
+
stat.label === "Churn rate"
|
|
185
|
+
? "var(--color-destructive)"
|
|
186
|
+
: "var(--color-primary)"
|
|
187
|
+
}
|
|
188
|
+
aria-label={stat.ariaLabel}
|
|
189
|
+
/>
|
|
190
|
+
<p
|
|
191
|
+
className="text-xs font-medium"
|
|
192
|
+
style={{
|
|
193
|
+
color:
|
|
194
|
+
stat.label === "Churn rate"
|
|
195
|
+
? "var(--color-destructive)"
|
|
196
|
+
: "var(--color-primary)",
|
|
197
|
+
}}
|
|
198
|
+
>
|
|
199
|
+
{stat.trend}
|
|
200
|
+
</p>
|
|
201
|
+
</div>
|
|
202
|
+
))}
|
|
203
|
+
</div>
|
|
204
|
+
</CardContent>
|
|
205
|
+
</Card>
|
|
206
|
+
)
|
|
207
|
+
},
|
|
208
|
+
}
|
|
@@ -3,7 +3,7 @@ import { Spinner } from "@behavioral-agentic-design-system/core/components/ui/sp
|
|
|
3
3
|
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Spinner> = {
|
|
6
|
-
title: "Components/Spinner",
|
|
6
|
+
title: "Components/Feedback/Spinner",
|
|
7
7
|
component: Spinner,
|
|
8
8
|
parameters: {
|
|
9
9
|
layout: "centered",
|
|
@@ -56,7 +56,15 @@ export const Size_Lg: Story = {
|
|
|
56
56
|
render: () => <Spinner size="lg" />,
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
+
/**
|
|
60
|
+
* Every option at once, for a person comparing them side by side.
|
|
61
|
+
*
|
|
62
|
+
* Tagged out of the machine-readable manifest: an assistant reading this as an
|
|
63
|
+
* example learns to render a gallery of variants where a screen was asked for.
|
|
64
|
+
* It stays visible in the sidebar, where a human reads it as the reference it is.
|
|
65
|
+
*/
|
|
59
66
|
export const AllSizes: Story = {
|
|
67
|
+
tags: ["!manifest"],
|
|
60
68
|
render: () => (
|
|
61
69
|
<div className="flex items-center gap-4">
|
|
62
70
|
<Spinner size="xs" />
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "@behavioral-agentic-design-system/core/components/ui/card"
|
|
11
11
|
|
|
12
12
|
const meta: Meta<typeof Spoiler> = {
|
|
13
|
-
title: "Components/Spoiler",
|
|
13
|
+
title: "Components/Layout/Spoiler",
|
|
14
14
|
component: Spoiler,
|
|
15
15
|
parameters: { layout: "centered" },
|
|
16
16
|
tags: ["autodocs"],
|
|
@@ -3,7 +3,7 @@ import { Squircle } from "@behavioral-agentic-design-system/core/components/ui/s
|
|
|
3
3
|
import { Card } from "@behavioral-agentic-design-system/core/components/ui/card";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Squircle> = {
|
|
6
|
-
title: "Components/Squircle",
|
|
6
|
+
title: "Components/Layout/Squircle",
|
|
7
7
|
component: Squircle,
|
|
8
8
|
parameters: { layout: "centered" },
|
|
9
9
|
tags: ["autodocs"],
|
|
@@ -5,7 +5,7 @@ import { Badge } from "@behavioral-agentic-design-system/core/components/ui/badg
|
|
|
5
5
|
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
6
6
|
|
|
7
7
|
const meta: Meta = {
|
|
8
|
-
title: "Components/Stack",
|
|
8
|
+
title: "Components/Layout/Stack",
|
|
9
9
|
parameters: { layout: "centered" },
|
|
10
10
|
tags: ["autodocs"],
|
|
11
11
|
};
|
|
@@ -13,7 +13,7 @@ import { StatusBadge } from "@behavioral-agentic-design-system/core/components/u
|
|
|
13
13
|
* prefers-reduced-motion rule stills it automatically.
|
|
14
14
|
*/
|
|
15
15
|
const meta: Meta<typeof StatusBadge> = {
|
|
16
|
-
title: "Components/StatusBadge",
|
|
16
|
+
title: "Components/Feedback/StatusBadge",
|
|
17
17
|
component: StatusBadge,
|
|
18
18
|
parameters: { layout: "centered" },
|
|
19
19
|
tags: ["autodocs"],
|
|
@@ -11,7 +11,7 @@ import { Button } from "@behavioral-agentic-design-system/core/components/ui/but
|
|
|
11
11
|
import * as React from "react";
|
|
12
12
|
|
|
13
13
|
const meta: Meta<typeof Stepper> = {
|
|
14
|
-
title: "Components/Stepper",
|
|
14
|
+
title: "Components/Navigation/Stepper",
|
|
15
15
|
component: Stepper,
|
|
16
16
|
parameters: {
|
|
17
17
|
layout: "centered",
|
|
@@ -3,7 +3,7 @@ import { Switch } from "@behavioral-agentic-design-system/core/components/ui/swi
|
|
|
3
3
|
import { Label } from "@behavioral-agentic-design-system/core/components/ui/label";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Switch> = {
|
|
6
|
-
title: "Components/Switch",
|
|
6
|
+
title: "Components/Selection/Switch",
|
|
7
7
|
component: Switch,
|
|
8
8
|
parameters: { layout: "centered" },
|
|
9
9
|
tags: ["autodocs"],
|
|
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react";
|
|
|
2
2
|
import { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow } from "@behavioral-agentic-design-system/core/components/ui/table";
|
|
3
3
|
|
|
4
4
|
const meta: Meta<typeof Table> = {
|
|
5
|
-
title: "Components/Table",
|
|
5
|
+
title: "Components/Content and data/Table",
|
|
6
6
|
component: Table,
|
|
7
7
|
parameters: { layout: "centered" },
|
|
8
8
|
tags: ["autodocs"],
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import { Tag } from "@behavioral-agentic-design-system/core/components/ui/tag";
|
|
3
|
+
import { Check, AlertTriangle, Info, Zap } from "lucide-react";
|
|
3
4
|
|
|
4
5
|
const meta: Meta<typeof Tag> = {
|
|
5
|
-
title: "Components/Tag",
|
|
6
|
+
title: "Components/Badges and avatars/Tag",
|
|
6
7
|
component: Tag,
|
|
7
8
|
parameters: { layout: "centered" },
|
|
8
9
|
tags: ["autodocs"],
|
|
@@ -73,6 +74,27 @@ export const Size_LG: Story = {
|
|
|
73
74
|
</div>),
|
|
74
75
|
};
|
|
75
76
|
|
|
77
|
+
export const Variant_WithIcon: Story = {
|
|
78
|
+
render: () => (
|
|
79
|
+
<div className="flex items-center gap-2 flex-wrap">
|
|
80
|
+
<Tag variant="success" label="Verified" icon={<Check strokeWidth={1.5} />} />
|
|
81
|
+
<Tag variant="warning" label="Needs review" icon={<AlertTriangle strokeWidth={1.5} />} />
|
|
82
|
+
<Tag variant="info" label="Tip" icon={<Info strokeWidth={1.5} />} />
|
|
83
|
+
<Tag variant="default" label="New feature" icon={<Zap strokeWidth={1.5} />} />
|
|
84
|
+
</div>
|
|
85
|
+
),
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const Variant_IconAndDismiss: Story = {
|
|
89
|
+
render: () => (
|
|
90
|
+
<div className="flex items-center gap-2 flex-wrap">
|
|
91
|
+
<Tag label="design-tokens" icon={<Zap strokeWidth={1.5} />} onClose={() => {}} />
|
|
92
|
+
<Tag variant="success" size="sm" label="shipped" icon={<Check strokeWidth={1.5} />} onClose={() => {}} />
|
|
93
|
+
<Tag variant="info" size="lg" label="in review" icon={<Info strokeWidth={1.5} />} onClose={() => {}} />
|
|
94
|
+
</div>
|
|
95
|
+
),
|
|
96
|
+
};
|
|
97
|
+
|
|
76
98
|
export const RealisticUse: Story = {
|
|
77
99
|
render: () => (<div className="flex items-center gap-2 flex-wrap">
|
|
78
100
|
<Tag label="Design" onClose={() => {}} />
|
|
@@ -3,11 +3,12 @@ import * as React from "react";
|
|
|
3
3
|
import { TagsInput } from "@behavioral-agentic-design-system/core/components/ui/tags-input";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof TagsInput> = {
|
|
6
|
-
title: "Components/TagsInput",
|
|
6
|
+
title: "Components/Forms/TagsInput",
|
|
7
7
|
component: TagsInput,
|
|
8
8
|
parameters: { layout: "centered" },
|
|
9
9
|
tags: ["autodocs"],
|
|
10
10
|
argTypes: {
|
|
11
|
+
size: { control: "select", options: ["sm", "default", "lg", "xl"] },
|
|
11
12
|
disabled: { control: "boolean" },
|
|
12
13
|
allowDuplicates: { control: "boolean" },
|
|
13
14
|
maxTags: { control: "number" },
|
|
@@ -45,6 +46,50 @@ export const WithInitialTags: Story = {
|
|
|
45
46
|
),
|
|
46
47
|
};
|
|
47
48
|
|
|
49
|
+
// Sizes: the wrapper is min-h-* (tags wrap), never h-*. `default` is the
|
|
50
|
+
// pre-size rendering (min-h-11, 44px SC 2.5.5 floor) so the prop is additive;
|
|
51
|
+
// sm=36px matches Input's default for dense form chrome; lg=48px, xl=56px.
|
|
52
|
+
// Chips, the × icon, and the inner text field scale with the container.
|
|
53
|
+
export const Size_Sm: Story = {
|
|
54
|
+
render: () => (
|
|
55
|
+
<Controlled
|
|
56
|
+
size="sm"
|
|
57
|
+
initialTags={["accessibility", "tokens"]}
|
|
58
|
+
placeholder="Add a topic…"
|
|
59
|
+
/>
|
|
60
|
+
),
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const Size_Default: Story = {
|
|
64
|
+
render: () => (
|
|
65
|
+
<Controlled
|
|
66
|
+
size="default"
|
|
67
|
+
initialTags={["accessibility", "tokens"]}
|
|
68
|
+
placeholder="Add a topic…"
|
|
69
|
+
/>
|
|
70
|
+
),
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const Size_Lg: Story = {
|
|
74
|
+
render: () => (
|
|
75
|
+
<Controlled
|
|
76
|
+
size="lg"
|
|
77
|
+
initialTags={["accessibility", "tokens"]}
|
|
78
|
+
placeholder="Add a topic…"
|
|
79
|
+
/>
|
|
80
|
+
),
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export const Size_Xl: Story = {
|
|
84
|
+
render: () => (
|
|
85
|
+
<Controlled
|
|
86
|
+
size="xl"
|
|
87
|
+
initialTags={["accessibility", "tokens"]}
|
|
88
|
+
placeholder="Add a topic…"
|
|
89
|
+
/>
|
|
90
|
+
),
|
|
91
|
+
};
|
|
92
|
+
|
|
48
93
|
// Disabled: muted token colors (bg-muted/text-muted-foreground) preserve AAA
|
|
49
94
|
// contrast — avoids the opacity-50 approach which blends text to ~3:1 (AA fail).
|
|
50
95
|
export const Disabled: Story = {
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import { Separator } from "@behavioral-agentic-design-system/core/components/ui/separator"
|
|
14
14
|
|
|
15
15
|
const meta: Meta<typeof Text> = {
|
|
16
|
-
title: "Components/Text",
|
|
16
|
+
title: "Components/Content and data/Text",
|
|
17
17
|
component: Text,
|
|
18
18
|
parameters: { layout: "centered" },
|
|
19
19
|
tags: ["autodocs"],
|
|
@@ -5,7 +5,7 @@ import { Textarea } from "@behavioral-agentic-design-system/core/components/ui/t
|
|
|
5
5
|
import { Label } from "@behavioral-agentic-design-system/core/components/ui/label";
|
|
6
6
|
|
|
7
7
|
const meta: Meta<typeof Textarea> = {
|
|
8
|
-
title: "Components/Textarea",
|
|
8
|
+
title: "Components/Forms/Textarea",
|
|
9
9
|
component: Textarea,
|
|
10
10
|
parameters: { layout: "centered" },
|
|
11
11
|
tags: ["autodocs"],
|
|
@@ -5,7 +5,7 @@ import { ThemeIcon } from "@behavioral-agentic-design-system/core/components/ui/
|
|
|
5
5
|
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
6
6
|
|
|
7
7
|
const meta: Meta<typeof ThemeIcon> = {
|
|
8
|
-
title: "Components/ThemeIcon",
|
|
8
|
+
title: "Components/Badges and avatars/ThemeIcon",
|
|
9
9
|
component: ThemeIcon,
|
|
10
10
|
parameters: {
|
|
11
11
|
layout: "centered",
|
|
@@ -3,7 +3,7 @@ import * as React from "react"
|
|
|
3
3
|
import { TimePicker } from "@behavioral-agentic-design-system/core/components/ui/time-picker"
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof TimePicker> = {
|
|
6
|
-
title: "Components/TimePicker",
|
|
6
|
+
title: "Components/Dates and time/TimePicker",
|
|
7
7
|
component: TimePicker,
|
|
8
8
|
parameters: { layout: "centered" },
|
|
9
9
|
}
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import { Timeline, TimelineItem } from "@behavioral-agentic-design-system/core/components/ui/timeline";
|
|
14
14
|
|
|
15
15
|
const meta: Meta<typeof Timeline> = {
|
|
16
|
-
title: "Components/Timeline",
|
|
16
|
+
title: "Components/Content and data/Timeline",
|
|
17
17
|
component: Timeline,
|
|
18
18
|
parameters: { layout: "centered" },
|
|
19
19
|
tags: ["autodocs"],
|
|
@@ -35,7 +35,15 @@ export const Default: Story = {
|
|
|
35
35
|
),
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Every option at once, for a person comparing them side by side.
|
|
40
|
+
*
|
|
41
|
+
* Tagged out of the machine-readable manifest: an assistant reading this as an
|
|
42
|
+
* example learns to render a gallery of variants where a screen was asked for.
|
|
43
|
+
* It stays visible in the sidebar, where a human reads it as the reference it is.
|
|
44
|
+
*/
|
|
38
45
|
export const AllStatuses: Story = {
|
|
46
|
+
tags: ["!manifest"],
|
|
39
47
|
render: () => (
|
|
40
48
|
<div className="w-80">
|
|
41
49
|
<Timeline>
|
|
@@ -3,7 +3,7 @@ import { Toggle } from "@behavioral-agentic-design-system/core/components/ui/tog
|
|
|
3
3
|
import { Bold } from "lucide-react";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Toggle> = {
|
|
6
|
-
title: "Components/Toggle",
|
|
6
|
+
title: "Components/Actions/Toggle",
|
|
7
7
|
component: Toggle,
|
|
8
8
|
parameters: { layout: "centered" },
|
|
9
9
|
tags: ["autodocs"],
|
|
@@ -3,7 +3,7 @@ import { ToggleGroup, ToggleGroupItem } from "@behavioral-agentic-design-system/
|
|
|
3
3
|
import { Bold, Italic, Underline } from "lucide-react";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof ToggleGroup> = {
|
|
6
|
-
title: "Components/ToggleGroup",
|
|
6
|
+
title: "Components/Actions/ToggleGroup",
|
|
7
7
|
component: ToggleGroup,
|
|
8
8
|
parameters: { layout: "centered" },
|
|
9
9
|
tags: ["autodocs"],
|
|
@@ -20,6 +20,26 @@ export const Default: Story = {
|
|
|
20
20
|
</ToggleGroup>),
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
+
export const Orientation_Vertical: Story = {
|
|
24
|
+
render: () => (
|
|
25
|
+
<ToggleGroup type="single" orientation="vertical" variant="outline">
|
|
26
|
+
<ToggleGroupItem value="bold" aria-label="Bold"><Bold className="h-4 w-4" /></ToggleGroupItem>
|
|
27
|
+
<ToggleGroupItem value="italic" aria-label="Italic"><Italic className="h-4 w-4" /></ToggleGroupItem>
|
|
28
|
+
<ToggleGroupItem value="underline" aria-label="Underline"><Underline className="h-4 w-4" /></ToggleGroupItem>
|
|
29
|
+
</ToggleGroup>
|
|
30
|
+
),
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const Orientation_Vertical_Spaced: Story = {
|
|
34
|
+
render: () => (
|
|
35
|
+
<ToggleGroup type="single" orientation="vertical" spacing={1}>
|
|
36
|
+
<ToggleGroupItem value="bold" aria-label="Bold"><Bold className="h-4 w-4" /></ToggleGroupItem>
|
|
37
|
+
<ToggleGroupItem value="italic" aria-label="Italic"><Italic className="h-4 w-4" /></ToggleGroupItem>
|
|
38
|
+
<ToggleGroupItem value="underline" aria-label="Underline"><Underline className="h-4 w-4" /></ToggleGroupItem>
|
|
39
|
+
</ToggleGroup>
|
|
40
|
+
),
|
|
41
|
+
};
|
|
42
|
+
|
|
23
43
|
export const Disabled: Story = {
|
|
24
44
|
render: () => (
|
|
25
45
|
<ToggleGroup type="multiple" disabled>
|
|
@@ -7,7 +7,7 @@ import { Input } from "@behavioral-agentic-design-system/core/components/ui/inpu
|
|
|
7
7
|
import { Label } from "@behavioral-agentic-design-system/core/components/ui/label";
|
|
8
8
|
|
|
9
9
|
const meta: Meta<typeof ToggleTip> = {
|
|
10
|
-
title: "Components/ToggleTip",
|
|
10
|
+
title: "Components/Feedback/ToggleTip",
|
|
11
11
|
component: ToggleTip,
|
|
12
12
|
parameters: { layout: "centered" },
|
|
13
13
|
tags: ["autodocs"],
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
} from "@behavioral-agentic-design-system/core/components/ui/toolbar";
|
|
24
24
|
|
|
25
25
|
const meta: Meta<typeof Toolbar> = {
|
|
26
|
-
title: "Components/Toolbar",
|
|
26
|
+
title: "Components/Navigation/Toolbar",
|
|
27
27
|
component: Toolbar,
|
|
28
28
|
parameters: { layout: "centered" },
|
|
29
29
|
tags: ["autodocs"],
|
|
@@ -9,7 +9,7 @@ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@behav
|
|
|
9
9
|
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
10
10
|
|
|
11
11
|
const meta: Meta<typeof Tooltip> = {
|
|
12
|
-
title: "Components/Tooltip",
|
|
12
|
+
title: "Components/Overlays/Tooltip",
|
|
13
13
|
component: Tooltip,
|
|
14
14
|
parameters: { layout: "centered" },
|
|
15
15
|
tags: ["autodocs"],
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
* Steps whose `target` is null (or matches nothing) render centered.
|
|
20
20
|
*/
|
|
21
21
|
const meta: Meta<typeof Tour> = {
|
|
22
|
-
title: "Components/Tour",
|
|
22
|
+
title: "Components/Navigation/Tour",
|
|
23
23
|
component: Tour,
|
|
24
24
|
parameters: { layout: "centered" },
|
|
25
25
|
tags: ["autodocs"],
|
|
@@ -3,7 +3,7 @@ import * as React from "react"
|
|
|
3
3
|
import { TransferList } from "@behavioral-agentic-design-system/core/components/ui/transfer-list"
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof TransferList> = {
|
|
6
|
-
title: "Components/TransferList",
|
|
6
|
+
title: "Components/Selection/TransferList",
|
|
7
7
|
component: TransferList,
|
|
8
8
|
parameters: { layout: "centered" },
|
|
9
9
|
tags: ["autodocs"],
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "@behavioral-agentic-design-system/core/components/ui/tree-select";
|
|
7
7
|
|
|
8
8
|
const meta: Meta<typeof TreeSelect> = {
|
|
9
|
-
title: "Components/TreeSelect",
|
|
9
|
+
title: "Components/Selection/TreeSelect",
|
|
10
10
|
component: TreeSelect,
|
|
11
11
|
parameters: { layout: "centered" },
|
|
12
12
|
tags: ["autodocs"],
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
} from "@behavioral-agentic-design-system/core/components/ui/tree-view";
|
|
19
19
|
|
|
20
20
|
const meta: Meta<typeof Tree> = {
|
|
21
|
-
title: "Components/TreeView",
|
|
21
|
+
title: "Components/Navigation/TreeView",
|
|
22
22
|
component: Tree,
|
|
23
23
|
parameters: { layout: "centered" },
|
|
24
24
|
};
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "@behavioral-agentic-design-system/core/components/ui/card";
|
|
13
13
|
|
|
14
14
|
const meta: Meta<typeof TypingIndicator> = {
|
|
15
|
-
title: "Components/TypingIndicator",
|
|
15
|
+
title: "Components/Feedback/TypingIndicator",
|
|
16
16
|
component: TypingIndicator,
|
|
17
17
|
parameters: {
|
|
18
18
|
layout: "centered",
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import { Badge } from "@behavioral-agentic-design-system/core/components/ui/badge";
|
|
11
11
|
|
|
12
12
|
const meta: Meta<typeof VisuallyHidden> = {
|
|
13
|
-
title: "Components/VisuallyHidden",
|
|
13
|
+
title: "Components/Layout/VisuallyHidden",
|
|
14
14
|
component: VisuallyHidden,
|
|
15
15
|
parameters: { layout: "centered" },
|
|
16
16
|
tags: ["autodocs"],
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "@behavioral-agentic-design-system/core/components/ui/data-list"
|
|
18
18
|
|
|
19
19
|
const meta: Meta<typeof Watermark> = {
|
|
20
|
-
title: "Components/Watermark",
|
|
20
|
+
title: "Components/Content and data/Watermark",
|
|
21
21
|
component: Watermark,
|
|
22
22
|
parameters: { layout: "centered" },
|
|
23
23
|
tags: ["autodocs"],
|