@behavioral-agentic-design-system/core 0.27.0 → 0.29.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 +5 -5
- package/scripts/a11y-lint.cjs +78 -9
- package/scripts/build-tokens.cjs +273 -15
- package/scripts/wcag-audit.cjs +37 -7
- package/src/api/layers/file.ts +1 -0
- package/src/app/font-ready.tsx +6 -5
- package/src/app/layout.tsx +54 -3
- package/src/app/preview/components/page.tsx +5735 -2500
- package/src/app/preview/layout.tsx +4 -1
- package/src/app/preview/showcase-filter.tsx +66 -0
- package/src/app/preview/tab-replay.tsx +63 -0
- package/src/app/shell.tsx +91 -18
- package/src/components/customize/save-bar.tsx +19 -6
- package/src/components/docs-tab.tsx +36 -24
- package/src/components/layers-tab.tsx +37 -5
- package/src/components/ui/ai-badge.tsx +74 -0
- package/src/components/ui/alert.tsx +12 -0
- package/src/components/ui/badge.tsx +19 -0
- package/src/components/ui/chat-bubble.tsx +298 -0
- package/src/components/ui/chat-marker.tsx +120 -0
- package/src/components/ui/checkbox.tsx +9 -1
- package/src/components/ui/clipboard.tsx +291 -0
- package/src/components/ui/close-button.tsx +71 -0
- package/src/components/ui/combobox.tsx +62 -3
- package/src/components/ui/container.tsx +65 -0
- package/src/components/ui/copy-button.tsx +5 -1
- package/src/components/ui/data-table.tsx +388 -0
- package/src/components/ui/date-field.tsx +368 -0
- package/src/components/ui/drawer.tsx +334 -0
- package/src/components/ui/file-button.tsx +145 -0
- package/src/components/ui/floating-indicator.tsx +217 -0
- package/src/components/ui/focus-trap.tsx +184 -0
- package/src/components/ui/format-byte.tsx +113 -0
- package/src/components/ui/index.ts +28 -0
- package/src/components/ui/input.tsx +38 -3
- package/src/components/ui/keyboard-shortcut.tsx +146 -0
- package/src/components/ui/loading-dots.tsx +99 -0
- package/src/components/ui/mark.tsx +69 -0
- package/src/components/ui/month-picker.tsx +296 -0
- package/src/components/ui/multi-select.tsx +15 -13
- package/src/components/ui/nav-link.tsx +200 -0
- package/src/components/ui/navigation-rail.tsx +256 -0
- package/src/components/ui/notification.tsx +20 -0
- package/src/components/ui/password-input.tsx +34 -1
- package/src/components/ui/progress.tsx +15 -1
- package/src/components/ui/prose.tsx +62 -0
- package/src/components/ui/result.tsx +151 -0
- package/src/components/ui/rolling-number.tsx +201 -0
- package/src/components/ui/simple-grid.tsx +110 -0
- package/src/components/ui/skeleton.tsx +52 -3
- package/src/components/ui/squircle.tsx +274 -0
- package/src/components/ui/stack.tsx +105 -0
- package/src/components/ui/status-badge.tsx +93 -0
- package/src/components/ui/tabs.tsx +34 -7
- package/src/components/ui/tag.tsx +46 -5
- package/src/components/ui/theme-icon.tsx +138 -0
- package/src/components/ui/timeline.tsx +27 -10
- package/src/components/ui/tooltip.tsx +12 -1
- package/src/components/ui/tree-select.tsx +386 -0
- package/src/components/ui/typing-indicator.tsx +2 -2
- package/src/components/ui/word-rotate.tsx +6 -1
- package/src/components/ui/year-picker.tsx +307 -0
- package/src/data/docs-index.ts +10 -0
- package/src/hooks/use-global-primary-color.ts +57 -6
- package/src/stories/AiBadge.stories.tsx +67 -0
- package/src/stories/Alert.stories.tsx +31 -1
- package/src/stories/Badge.stories.tsx +63 -6
- package/src/stories/ChatBubble.stories.tsx +222 -0
- package/src/stories/ChatMarker.stories.tsx +59 -0
- package/src/stories/Checkbox.stories.tsx +5 -0
- package/src/stories/Clipboard.stories.tsx +136 -0
- package/src/stories/CloseButton.stories.tsx +65 -0
- package/src/stories/Combobox.stories.tsx +74 -3
- package/src/stories/Container.stories.tsx +134 -0
- package/src/stories/CopyButton.stories.tsx +2 -0
- package/src/stories/DataTable.stories.tsx +271 -0
- package/src/stories/DateField.stories.tsx +114 -0
- package/src/stories/Drawer.stories.tsx +211 -0
- package/src/stories/FileButton.stories.tsx +117 -0
- package/src/stories/FloatingIndicator.stories.tsx +343 -0
- package/src/stories/FocusTrap.stories.tsx +218 -0
- package/src/stories/FormatByte.stories.tsx +142 -0
- package/src/stories/Input.stories.tsx +91 -0
- package/src/stories/KeyboardShortcut.stories.tsx +87 -0
- package/src/stories/LoadingDots.stories.tsx +73 -0
- package/src/stories/Mark.stories.tsx +84 -0
- package/src/stories/MonthPicker.stories.tsx +99 -0
- package/src/stories/MultiSelect.stories.tsx +3 -1
- package/src/stories/NavLink.stories.tsx +213 -0
- package/src/stories/NavigationRail.stories.tsx +413 -0
- package/src/stories/Notification.stories.tsx +53 -0
- package/src/stories/PasswordInput.stories.tsx +21 -0
- package/src/stories/Progress.stories.tsx +38 -0
- package/src/stories/Prose.stories.tsx +232 -0
- package/src/stories/Result.stories.tsx +145 -0
- package/src/stories/RollingNumber.stories.tsx +226 -0
- package/src/stories/SimpleGrid.stories.tsx +130 -0
- package/src/stories/Skeleton.stories.tsx +62 -1
- package/src/stories/Squircle.stories.tsx +127 -0
- package/src/stories/Stack.stories.tsx +139 -0
- package/src/stories/StatusBadge.stories.tsx +125 -0
- package/src/stories/Tabs.stories.tsx +56 -1
- package/src/stories/Tag.stories.tsx +31 -0
- package/src/stories/ThemeIcon.stories.tsx +97 -0
- package/src/stories/Timeline.stories.tsx +69 -0
- package/src/stories/Tooltip.stories.tsx +18 -0
- package/src/stories/TreeSelect.stories.tsx +222 -0
- package/src/stories/TypingIndicator.stories.tsx +1 -0
- package/src/stories/WordRotate.stories.tsx +1 -0
- package/src/stories/YearPicker.stories.tsx +100 -0
- package/src/styles.css +289 -15
- package/src/tokens.json +96 -1
- package/LICENSE +0 -21
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Reply, SmilePlus } from "lucide-react";
|
|
4
|
+
import {
|
|
5
|
+
ChatBubble,
|
|
6
|
+
ChatBubbleAction,
|
|
7
|
+
ChatBubbleActions,
|
|
8
|
+
ChatBubbleAvatar,
|
|
9
|
+
ChatBubbleMessage,
|
|
10
|
+
ChatBubbleReadReceipt,
|
|
11
|
+
ChatBubbleTimestamp,
|
|
12
|
+
} from "@behavioral-agentic-design-system/core/components/ui/chat-bubble";
|
|
13
|
+
|
|
14
|
+
const meta: Meta<typeof ChatBubble> = {
|
|
15
|
+
title: "Components/ChatBubble",
|
|
16
|
+
component: ChatBubble,
|
|
17
|
+
parameters: { layout: "padded" },
|
|
18
|
+
tags: ["autodocs"],
|
|
19
|
+
argTypes: {
|
|
20
|
+
position: { control: "radio", options: ["sent", "received"] },
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default meta;
|
|
25
|
+
type Story = StoryObj<typeof ChatBubble>;
|
|
26
|
+
|
|
27
|
+
// Real content from content/personas/bads.json — primary persona names
|
|
28
|
+
// (Jordan Reeves, Seo-yun Park) and design-system chatter built from the
|
|
29
|
+
// jargon / body_copy / notifications / urls pools. No placeholder content.
|
|
30
|
+
const THREAD = [
|
|
31
|
+
{
|
|
32
|
+
id: 1,
|
|
33
|
+
from: "Seo-yun Park",
|
|
34
|
+
initials: "SP",
|
|
35
|
+
position: "received" as const,
|
|
36
|
+
text: "Just pushed the tokens v2 proposal — can you look before standup? design.bads.com/share/tokens-v2-proposal",
|
|
37
|
+
time: "10:38 AM",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: 2,
|
|
41
|
+
from: "Jordan Reeves",
|
|
42
|
+
initials: "JR",
|
|
43
|
+
position: "sent" as const,
|
|
44
|
+
text: "On it. Did the semantic layer change touch --muted-foreground?",
|
|
45
|
+
time: "10:40 AM",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 3,
|
|
49
|
+
from: "Seo-yun Park",
|
|
50
|
+
initials: "SP",
|
|
51
|
+
position: "received" as const,
|
|
52
|
+
text: "Yes — nudged it for the 7:1 floor. All 36 components still pass AAA contrast, wcag:audit is green.",
|
|
53
|
+
time: "10:41 AM",
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: 4,
|
|
57
|
+
from: "Jordan Reeves",
|
|
58
|
+
initials: "JR",
|
|
59
|
+
position: "sent" as const,
|
|
60
|
+
text: "Token changes saved. Running pnpm build:tokens now — both CSS files regenerate.",
|
|
61
|
+
time: "10:42 AM",
|
|
62
|
+
},
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
export const Default: Story = {
|
|
66
|
+
render: () => (
|
|
67
|
+
<div className="w-full max-w-md">
|
|
68
|
+
<ChatBubble position="received">
|
|
69
|
+
<ChatBubbleMessage>
|
|
70
|
+
Just pushed the tokens v2 proposal — can you look before standup?
|
|
71
|
+
</ChatBubbleMessage>
|
|
72
|
+
</ChatBubble>
|
|
73
|
+
</div>
|
|
74
|
+
),
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const Variant_Sent: Story = {
|
|
78
|
+
render: () => (
|
|
79
|
+
<div className="w-full max-w-md">
|
|
80
|
+
<ChatBubble position="sent">
|
|
81
|
+
<ChatBubbleMessage>
|
|
82
|
+
On it. Did the semantic layer change touch --muted-foreground?
|
|
83
|
+
</ChatBubbleMessage>
|
|
84
|
+
</ChatBubble>
|
|
85
|
+
</div>
|
|
86
|
+
),
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const Variant_Received: Story = {
|
|
90
|
+
render: () => (
|
|
91
|
+
<div className="w-full max-w-md">
|
|
92
|
+
<ChatBubble position="received">
|
|
93
|
+
<ChatBubbleMessage variant="received">
|
|
94
|
+
Yes — nudged it for the 7:1 floor. All 36 components still pass AAA
|
|
95
|
+
contrast.
|
|
96
|
+
</ChatBubbleMessage>
|
|
97
|
+
</ChatBubble>
|
|
98
|
+
</div>
|
|
99
|
+
),
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const Variant_Typing: Story = {
|
|
103
|
+
parameters: {
|
|
104
|
+
docs: {
|
|
105
|
+
description: {
|
|
106
|
+
story:
|
|
107
|
+
"Typing indicator — the bubble carries role=status + aria-live=polite + an accessible name (\"Typing…\") because it has no visible text. Only render it while a real participant is actually typing; a fake typing indicator is a dark pattern (see registry antiPatterns).",
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
render: () => (
|
|
112
|
+
<div className="w-full max-w-md">
|
|
113
|
+
<ChatBubble position="received">
|
|
114
|
+
<ChatBubbleAvatar fallback="SP" />
|
|
115
|
+
<ChatBubbleMessage variant="typing" />
|
|
116
|
+
</ChatBubble>
|
|
117
|
+
</div>
|
|
118
|
+
),
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export const WithAvatar: Story = {
|
|
122
|
+
render: () => (
|
|
123
|
+
<div className="w-full max-w-md">
|
|
124
|
+
<ChatBubble position="received">
|
|
125
|
+
<ChatBubbleAvatar fallback="SP" />
|
|
126
|
+
<ChatBubbleMessage>
|
|
127
|
+
Storybook coverage check passed — all components have matching
|
|
128
|
+
stories.
|
|
129
|
+
</ChatBubbleMessage>
|
|
130
|
+
</ChatBubble>
|
|
131
|
+
</div>
|
|
132
|
+
),
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export const WithReadReceipt: Story = {
|
|
136
|
+
render: () => (
|
|
137
|
+
<div className="w-full max-w-md space-y-3">
|
|
138
|
+
{(["sent", "delivered", "read"] as const).map((status) => (
|
|
139
|
+
<ChatBubble key={status} position="sent">
|
|
140
|
+
<div className="flex min-w-0 flex-col items-end gap-1">
|
|
141
|
+
<ChatBubbleMessage>
|
|
142
|
+
Token changes saved. Run pnpm build:tokens to regenerate CSS.
|
|
143
|
+
</ChatBubbleMessage>
|
|
144
|
+
<span className="flex items-center gap-1">
|
|
145
|
+
<ChatBubbleTimestamp timestamp="10:42 AM" />
|
|
146
|
+
<ChatBubbleReadReceipt status={status} />
|
|
147
|
+
</span>
|
|
148
|
+
</div>
|
|
149
|
+
</ChatBubble>
|
|
150
|
+
))}
|
|
151
|
+
</div>
|
|
152
|
+
),
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export const WithActions: Story = {
|
|
156
|
+
parameters: {
|
|
157
|
+
docs: {
|
|
158
|
+
description: {
|
|
159
|
+
story:
|
|
160
|
+
"Action row is hidden until the row is hovered — or until any action button receives keyboard focus (focus-within), so keyboard users are never locked out of a hover-only affordance. Each action is a 44×44 ghost Button with a required aria-label.",
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
render: () => (
|
|
165
|
+
<div className="w-full max-w-md">
|
|
166
|
+
<ChatBubble position="received">
|
|
167
|
+
<ChatBubbleAvatar fallback="SP" />
|
|
168
|
+
<ChatBubbleMessage>
|
|
169
|
+
The token pipeline paid for itself in a week. One tokens.json change,
|
|
170
|
+
both CSS files regenerate, every fork picks it up.
|
|
171
|
+
</ChatBubbleMessage>
|
|
172
|
+
<ChatBubbleActions>
|
|
173
|
+
<ChatBubbleAction
|
|
174
|
+
icon={<SmilePlus strokeWidth={1.5} className="size-5" />}
|
|
175
|
+
label="React to message"
|
|
176
|
+
/>
|
|
177
|
+
<ChatBubbleAction
|
|
178
|
+
icon={<Reply strokeWidth={1.5} className="size-5" />}
|
|
179
|
+
label="Reply to message"
|
|
180
|
+
/>
|
|
181
|
+
</ChatBubbleActions>
|
|
182
|
+
</ChatBubble>
|
|
183
|
+
</div>
|
|
184
|
+
),
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
export const RealisticUse: Story = {
|
|
188
|
+
render: () => (
|
|
189
|
+
<div
|
|
190
|
+
role="log"
|
|
191
|
+
aria-label="Conversation with Seo-yun Park"
|
|
192
|
+
className="flex w-full max-w-md flex-col gap-3 overflow-y-auto rounded-lg border bg-background p-4"
|
|
193
|
+
>
|
|
194
|
+
{THREAD.map((msg) => (
|
|
195
|
+
<ChatBubble key={msg.id} position={msg.position}>
|
|
196
|
+
{msg.position === "received" ? (
|
|
197
|
+
<ChatBubbleAvatar fallback={msg.initials} />
|
|
198
|
+
) : null}
|
|
199
|
+
<div
|
|
200
|
+
className={
|
|
201
|
+
msg.position === "sent"
|
|
202
|
+
? "flex min-w-0 flex-col items-end gap-1"
|
|
203
|
+
: "flex min-w-0 flex-col items-start gap-1"
|
|
204
|
+
}
|
|
205
|
+
>
|
|
206
|
+
<ChatBubbleMessage>{msg.text}</ChatBubbleMessage>
|
|
207
|
+
<span className="flex items-center gap-1">
|
|
208
|
+
<ChatBubbleTimestamp timestamp={msg.time} />
|
|
209
|
+
{msg.position === "sent" ? (
|
|
210
|
+
<ChatBubbleReadReceipt status={msg.id === 4 ? "delivered" : "read"} />
|
|
211
|
+
) : null}
|
|
212
|
+
</span>
|
|
213
|
+
</div>
|
|
214
|
+
</ChatBubble>
|
|
215
|
+
))}
|
|
216
|
+
<ChatBubble position="received">
|
|
217
|
+
<ChatBubbleAvatar fallback="SP" />
|
|
218
|
+
<ChatBubbleMessage variant="typing" />
|
|
219
|
+
</ChatBubble>
|
|
220
|
+
</div>
|
|
221
|
+
),
|
|
222
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
|
|
3
|
+
import { ChatMarker } from "../components/ui/chat-marker"
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof ChatMarker> = {
|
|
6
|
+
title: "UI/ChatMarker",
|
|
7
|
+
component: ChatMarker,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: "padded",
|
|
11
|
+
},
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default meta
|
|
15
|
+
type Story = StoryObj<typeof ChatMarker>
|
|
16
|
+
|
|
17
|
+
export const Default: Story = {
|
|
18
|
+
args: {
|
|
19
|
+
label: "Today",
|
|
20
|
+
},
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const Variant_Yesterday: Story = {
|
|
24
|
+
args: {
|
|
25
|
+
label: "Yesterday",
|
|
26
|
+
},
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const Variant_Status: Story = {
|
|
30
|
+
args: {
|
|
31
|
+
variant: "status",
|
|
32
|
+
label: "Seen 2:14 PM",
|
|
33
|
+
},
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const Variant_Divider: Story = {
|
|
37
|
+
args: {
|
|
38
|
+
variant: "divider",
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const RealisticUse: Story = {
|
|
43
|
+
render: () => (
|
|
44
|
+
<div className="flex w-72 flex-col gap-1 rounded-lg border bg-card p-4">
|
|
45
|
+
<div className="rounded-lg bg-muted px-3 py-2 text-sm">
|
|
46
|
+
Hey, you around?
|
|
47
|
+
</div>
|
|
48
|
+
<ChatMarker label="Yesterday" />
|
|
49
|
+
<div className="self-end rounded-lg bg-primary px-3 py-2 text-sm text-primary-foreground">
|
|
50
|
+
Yeah! What's up?
|
|
51
|
+
</div>
|
|
52
|
+
<ChatMarker label="Today" />
|
|
53
|
+
<div className="rounded-lg bg-muted px-3 py-2 text-sm">
|
|
54
|
+
Can we jump on a call?
|
|
55
|
+
</div>
|
|
56
|
+
<ChatMarker variant="status" label="Seen 9:41 AM" />
|
|
57
|
+
</div>
|
|
58
|
+
),
|
|
59
|
+
}
|
|
@@ -12,6 +12,11 @@ const meta: Meta<typeof Checkbox> = {
|
|
|
12
12
|
export default meta;
|
|
13
13
|
type Story = StoryObj<typeof meta>;
|
|
14
14
|
|
|
15
|
+
// The visible box is 32px but the pointer target is 44px (WCAG 2.2 SC 2.5.5
|
|
16
|
+
// Enhanced / AAA), delivered by a centered transparent ::before overlay on the
|
|
17
|
+
// Root — see checkbox.tsx. It's invisible and layout-neutral, so it can't be
|
|
18
|
+
// verified by eye here; this note is the regression guard. Do not remove the
|
|
19
|
+
// `before:*` hit-area utilities without a replacement that keeps the target 44px.
|
|
15
20
|
export const Default: Story = {
|
|
16
21
|
render: () => (<div className="flex items-center gap-2">
|
|
17
22
|
<Checkbox id="terms" defaultChecked />
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// Motion: input copied-tint + focus ring on transition-[color,box-shadow,border-color]
|
|
2
|
+
// with inline var(--duration-fast) + var(--ease-out); trigger swap is CopyButton's.
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
4
|
+
import * as React from "react"
|
|
5
|
+
import {
|
|
6
|
+
Clipboard,
|
|
7
|
+
ClipboardControl,
|
|
8
|
+
ClipboardInput,
|
|
9
|
+
ClipboardLabel,
|
|
10
|
+
ClipboardTrigger,
|
|
11
|
+
} from "@behavioral-agentic-design-system/core/components/ui/clipboard"
|
|
12
|
+
import {
|
|
13
|
+
Card,
|
|
14
|
+
CardContent,
|
|
15
|
+
CardDescription,
|
|
16
|
+
CardHeader,
|
|
17
|
+
CardTitle,
|
|
18
|
+
} from "@behavioral-agentic-design-system/core/components/ui/card"
|
|
19
|
+
|
|
20
|
+
const meta: Meta<typeof Clipboard> = {
|
|
21
|
+
title: "Components/Clipboard",
|
|
22
|
+
component: Clipboard,
|
|
23
|
+
parameters: {
|
|
24
|
+
layout: "centered",
|
|
25
|
+
docs: {
|
|
26
|
+
description: {
|
|
27
|
+
component:
|
|
28
|
+
"Compound clipboard widget: renders the copyable value inline as a read-only, select-on-focus input alongside a copy trigger. The trigger composes CopyButton (clipboard write, Copy→Check success animation, aria-live 'Copied to clipboard'). The input truncates long values (min-w-0 + truncate) and preserves the full string in title; its border tints to the ring token during the copied window. Label associates via htmlFor; without a ClipboardLabel the input falls back to aria-label='Copyable value'. Trigger defaults to size='xl' (44px CTA floor). Distinct from CopyButton, which copies without displaying the value.",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
}
|
|
33
|
+
export default meta
|
|
34
|
+
type Story = StoryObj<typeof Clipboard>
|
|
35
|
+
|
|
36
|
+
export const Default: Story = {
|
|
37
|
+
render: () => (
|
|
38
|
+
<div className="w-96">
|
|
39
|
+
<Clipboard value="pk_live_5K8mN2qR7tLwYjAb4cDeFgHi">
|
|
40
|
+
<ClipboardControl>
|
|
41
|
+
<ClipboardInput />
|
|
42
|
+
<ClipboardTrigger />
|
|
43
|
+
</ClipboardControl>
|
|
44
|
+
</Clipboard>
|
|
45
|
+
</div>
|
|
46
|
+
),
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const WithLabel: Story = {
|
|
50
|
+
render: () => (
|
|
51
|
+
<div className="w-96">
|
|
52
|
+
<Clipboard value="https://design.bads.com/share/tokens-v2-proposal">
|
|
53
|
+
<ClipboardLabel>Share link</ClipboardLabel>
|
|
54
|
+
<ClipboardControl>
|
|
55
|
+
<ClipboardInput />
|
|
56
|
+
<ClipboardTrigger>Copy link</ClipboardTrigger>
|
|
57
|
+
</ClipboardControl>
|
|
58
|
+
</Clipboard>
|
|
59
|
+
</div>
|
|
60
|
+
),
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export const LongValue: Story = {
|
|
64
|
+
render: () => (
|
|
65
|
+
<div className="w-80">
|
|
66
|
+
<Clipboard value="https://design.bads.com/docs/getting-started?utm_source=onboarding&utm_campaign=client-fork-2026&session=jordan.reeves">
|
|
67
|
+
<ClipboardLabel>Onboarding link</ClipboardLabel>
|
|
68
|
+
<ClipboardControl>
|
|
69
|
+
<ClipboardInput />
|
|
70
|
+
<ClipboardTrigger />
|
|
71
|
+
</ClipboardControl>
|
|
72
|
+
</Clipboard>
|
|
73
|
+
</div>
|
|
74
|
+
),
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export const IconTrigger: Story = {
|
|
78
|
+
render: () => (
|
|
79
|
+
<div className="w-96">
|
|
80
|
+
<Clipboard value="npm install @behavioral-agentic-design-system/core">
|
|
81
|
+
<ClipboardLabel>Install command</ClipboardLabel>
|
|
82
|
+
<ClipboardControl>
|
|
83
|
+
<ClipboardInput />
|
|
84
|
+
<ClipboardTrigger size="icon-xl" aria-label="Copy install command" />
|
|
85
|
+
</ClipboardControl>
|
|
86
|
+
</Clipboard>
|
|
87
|
+
</div>
|
|
88
|
+
),
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export const Disabled: Story = {
|
|
92
|
+
render: () => (
|
|
93
|
+
<div className="w-96">
|
|
94
|
+
<Clipboard value="pk_live_5K8mN2qR7tLwYjAb4cDeFgHi" disabled>
|
|
95
|
+
<ClipboardLabel>API key</ClipboardLabel>
|
|
96
|
+
<ClipboardControl>
|
|
97
|
+
<ClipboardInput />
|
|
98
|
+
<ClipboardTrigger />
|
|
99
|
+
</ClipboardControl>
|
|
100
|
+
</Clipboard>
|
|
101
|
+
</div>
|
|
102
|
+
),
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export const RealisticUse: Story = {
|
|
106
|
+
render: () => {
|
|
107
|
+
const secretKey = "sk-proj-Xk9mNpQ2vR7tLwYjAb4cDeFgHiJkLmNo" // gitleaks:allow
|
|
108
|
+
return (
|
|
109
|
+
<Card className="w-[26rem]">
|
|
110
|
+
<CardHeader>
|
|
111
|
+
<CardTitle>API keys</CardTitle>
|
|
112
|
+
<CardDescription>
|
|
113
|
+
Authenticate requests from jordan@reeves.design's workspace. Keep
|
|
114
|
+
the secret key server-side.
|
|
115
|
+
</CardDescription>
|
|
116
|
+
</CardHeader>
|
|
117
|
+
<CardContent className="flex flex-col gap-6">
|
|
118
|
+
<Clipboard value="pk_live_5K8mN2qR7tLwYjAb4cDeFgHi">
|
|
119
|
+
<ClipboardLabel>Publishable key</ClipboardLabel>
|
|
120
|
+
<ClipboardControl>
|
|
121
|
+
<ClipboardInput />
|
|
122
|
+
<ClipboardTrigger />
|
|
123
|
+
</ClipboardControl>
|
|
124
|
+
</Clipboard>
|
|
125
|
+
<Clipboard value={secretKey}>
|
|
126
|
+
<ClipboardLabel>Secret key</ClipboardLabel>
|
|
127
|
+
<ClipboardControl>
|
|
128
|
+
<ClipboardInput />
|
|
129
|
+
<ClipboardTrigger />
|
|
130
|
+
</ClipboardControl>
|
|
131
|
+
</Clipboard>
|
|
132
|
+
</CardContent>
|
|
133
|
+
</Card>
|
|
134
|
+
)
|
|
135
|
+
},
|
|
136
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { CloseButton } from "@behavioral-agentic-design-system/core/components/ui/close-button";
|
|
4
|
+
import { Tag } from "@behavioral-agentic-design-system/core/components/ui/tag";
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof CloseButton> = {
|
|
7
|
+
title: "Components/CloseButton",
|
|
8
|
+
component: CloseButton,
|
|
9
|
+
parameters: { layout: "centered" },
|
|
10
|
+
tags: ["autodocs"],
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default meta;
|
|
14
|
+
|
|
15
|
+
export const Default: StoryObj = {
|
|
16
|
+
render: () => <CloseButton />,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const Sizes: StoryObj = {
|
|
20
|
+
render: () => (
|
|
21
|
+
<div className="flex items-center gap-3">
|
|
22
|
+
{(["icon-xs", "icon-sm", "icon", "icon-lg", "icon-xl"] as const).map(
|
|
23
|
+
(size) => (
|
|
24
|
+
<div key={size} className="flex flex-col items-center gap-1">
|
|
25
|
+
<CloseButton size={size} aria-label={`Close (${size})`} />
|
|
26
|
+
<span className="text-xs text-muted-foreground">{size}</span>
|
|
27
|
+
</div>
|
|
28
|
+
)
|
|
29
|
+
)}
|
|
30
|
+
</div>
|
|
31
|
+
),
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const Variant_Outline: StoryObj = {
|
|
35
|
+
render: () => <CloseButton variant="outline" />,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const Variant_Secondary: StoryObj = {
|
|
39
|
+
render: () => <CloseButton variant="secondary" />,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const Disabled: StoryObj = {
|
|
43
|
+
render: () => <CloseButton disabled />,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const RealisticUse: StoryObj = {
|
|
47
|
+
render: () => (
|
|
48
|
+
<div className="flex w-96 items-start justify-between gap-3 rounded-lg border border-border bg-card p-4">
|
|
49
|
+
<div className="min-w-0">
|
|
50
|
+
<p className="text-sm font-medium text-foreground">
|
|
51
|
+
Tokens v2 proposal shared
|
|
52
|
+
</p>
|
|
53
|
+
<p className="mt-1 text-sm text-muted-foreground">
|
|
54
|
+
Jordan Reeves shared tokens-v2-proposal.pdf with the review group.
|
|
55
|
+
Review is scheduled for May 26, 2026.
|
|
56
|
+
</p>
|
|
57
|
+
<div className="mt-2 flex flex-wrap gap-1.5">
|
|
58
|
+
<Tag label="design-review" />
|
|
59
|
+
<Tag label="tokens" />
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
<CloseButton aria-label="Dismiss notification" />
|
|
63
|
+
</div>
|
|
64
|
+
),
|
|
65
|
+
};
|
|
@@ -96,10 +96,52 @@ export const WithDisabledOptions: Story = {
|
|
|
96
96
|
},
|
|
97
97
|
};
|
|
98
98
|
|
|
99
|
+
export const Variant_Creatable: Story = {
|
|
100
|
+
name: "Variant — Creatable",
|
|
101
|
+
render: () => {
|
|
102
|
+
const [value, setValue] = React.useState("");
|
|
103
|
+
const [options, setOptions] = React.useState([
|
|
104
|
+
{ value: "design", label: "Design" },
|
|
105
|
+
{ value: "engineering", label: "Engineering" },
|
|
106
|
+
{ value: "product", label: "Product" },
|
|
107
|
+
{ value: "marketing", label: "Marketing" },
|
|
108
|
+
{ value: "research", label: "Research" },
|
|
109
|
+
]);
|
|
110
|
+
|
|
111
|
+
function handleCreate(newLabel: string) {
|
|
112
|
+
const newOption = { value: newLabel.toLowerCase().replace(/\s+/g, "-"), label: newLabel };
|
|
113
|
+
setOptions((prev) => [...prev, newOption]);
|
|
114
|
+
setValue(newOption.value);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
<div className="space-y-2">
|
|
119
|
+
<p className="text-sm text-muted-foreground">
|
|
120
|
+
Type a department name not in the list to create it.
|
|
121
|
+
</p>
|
|
122
|
+
<Combobox
|
|
123
|
+
options={options}
|
|
124
|
+
value={value}
|
|
125
|
+
onValueChange={setValue}
|
|
126
|
+
placeholder="Select or create department..."
|
|
127
|
+
searchPlaceholder="Search or type new..."
|
|
128
|
+
creatable
|
|
129
|
+
onCreateOption={handleCreate}
|
|
130
|
+
/>
|
|
131
|
+
{value && (
|
|
132
|
+
<p className="text-xs text-muted-foreground">
|
|
133
|
+
Selected: <span className="font-medium text-foreground">{value}</span>
|
|
134
|
+
</p>
|
|
135
|
+
)}
|
|
136
|
+
</div>
|
|
137
|
+
);
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
|
|
99
141
|
export const RealisticUse: Story = {
|
|
100
142
|
decorators: [
|
|
101
143
|
(Story) => (
|
|
102
|
-
<div className="flex min-h-[
|
|
144
|
+
<div className="flex min-h-[520px] w-[380px] items-start justify-center pt-8">
|
|
103
145
|
<div className="w-full rounded-lg border bg-card p-6 shadow-sm">
|
|
104
146
|
<Story />
|
|
105
147
|
</div>
|
|
@@ -109,6 +151,14 @@ export const RealisticUse: Story = {
|
|
|
109
151
|
render: () => {
|
|
110
152
|
const [country, setCountry] = React.useState("");
|
|
111
153
|
const [timezone, setTimezone] = React.useState("");
|
|
154
|
+
const [skillValue, setSkillValue] = React.useState("");
|
|
155
|
+
const [skillOptions, setSkillOptions] = React.useState([
|
|
156
|
+
{ value: "accessibility", label: "Accessibility" },
|
|
157
|
+
{ value: "data-viz", label: "Data Visualization" },
|
|
158
|
+
{ value: "design-systems", label: "Design Systems" },
|
|
159
|
+
{ value: "motion-design", label: "Motion Design" },
|
|
160
|
+
{ value: "user-research", label: "User Research" },
|
|
161
|
+
]);
|
|
112
162
|
|
|
113
163
|
const countries = [
|
|
114
164
|
{ value: "us", label: "United States" },
|
|
@@ -132,11 +182,19 @@ export const RealisticUse: Story = {
|
|
|
132
182
|
{ value: "utc+9", label: "Japan Standard Time (UTC+9)" },
|
|
133
183
|
];
|
|
134
184
|
|
|
185
|
+
function handleCreateSkill(newLabel: string) {
|
|
186
|
+
const newOption = { value: newLabel.toLowerCase().replace(/\s+/g, "-"), label: newLabel };
|
|
187
|
+
setSkillOptions((prev) => [...prev, newOption]);
|
|
188
|
+
setSkillValue(newOption.value);
|
|
189
|
+
}
|
|
190
|
+
|
|
135
191
|
return (
|
|
136
192
|
<div className="space-y-5">
|
|
137
193
|
<div>
|
|
138
|
-
<h3 className="text-sm font-semibold text-foreground">
|
|
139
|
-
<p className="mt-0.5 text-sm text-muted-foreground">
|
|
194
|
+
<h3 className="text-sm font-semibold text-foreground">Profile settings</h3>
|
|
195
|
+
<p className="mt-0.5 text-sm text-muted-foreground">
|
|
196
|
+
Set your location and add a primary skill. Type a skill name to create one if it's not listed.
|
|
197
|
+
</p>
|
|
140
198
|
</div>
|
|
141
199
|
<div className="space-y-3">
|
|
142
200
|
<div className="space-y-1.5">
|
|
@@ -161,6 +219,19 @@ export const RealisticUse: Story = {
|
|
|
161
219
|
emptyText="Timezone not found."
|
|
162
220
|
/>
|
|
163
221
|
</div>
|
|
222
|
+
<div className="space-y-1.5">
|
|
223
|
+
<Label htmlFor="skill">Primary skill</Label>
|
|
224
|
+
<Combobox
|
|
225
|
+
options={skillOptions}
|
|
226
|
+
value={skillValue}
|
|
227
|
+
onValueChange={setSkillValue}
|
|
228
|
+
placeholder="Select or create skill..."
|
|
229
|
+
searchPlaceholder="Search or type new..."
|
|
230
|
+
emptyText="No skill found."
|
|
231
|
+
creatable
|
|
232
|
+
onCreateOption={handleCreateSkill}
|
|
233
|
+
/>
|
|
234
|
+
</div>
|
|
164
235
|
</div>
|
|
165
236
|
</div>
|
|
166
237
|
);
|