@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,191 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import { Search, Bell, Palette } from "lucide-react";
|
|
4
|
+
|
|
5
|
+
import { Tour, type TourStep } from "@behavioral-agentic-design-system/core/components/ui/tour";
|
|
6
|
+
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
7
|
+
import {
|
|
8
|
+
Card,
|
|
9
|
+
CardContent,
|
|
10
|
+
CardHeader,
|
|
11
|
+
CardTitle,
|
|
12
|
+
} from "@behavioral-agentic-design-system/core/components/ui/card";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Tour is a guided product walkthrough built on Radix Dialog: focus trap,
|
|
16
|
+
* Escape-to-close, and focus-return come from the dialog base; the tour adds
|
|
17
|
+
* selector-anchored positioning, a primary-ring target highlight, text
|
|
18
|
+
* progress ("Step N of M"), and ArrowLeft/ArrowRight step navigation.
|
|
19
|
+
* Steps whose `target` is null (or matches nothing) render centered.
|
|
20
|
+
*/
|
|
21
|
+
const meta: Meta<typeof Tour> = {
|
|
22
|
+
title: "Components/Tour",
|
|
23
|
+
component: Tour,
|
|
24
|
+
parameters: { layout: "centered" },
|
|
25
|
+
tags: ["autodocs"],
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default meta;
|
|
29
|
+
type Story = StoryObj<typeof meta>;
|
|
30
|
+
|
|
31
|
+
function DemoChrome({ idPrefix }: { idPrefix: string }) {
|
|
32
|
+
return (
|
|
33
|
+
<Card className="w-96">
|
|
34
|
+
<CardHeader>
|
|
35
|
+
<CardTitle className="text-sm">Your design system at a glance</CardTitle>
|
|
36
|
+
</CardHeader>
|
|
37
|
+
<CardContent className="flex items-center gap-3">
|
|
38
|
+
<Button id={`${idPrefix}-search`} variant="outline" size="xl" className="px-4">
|
|
39
|
+
<Search strokeWidth={1.5} className="size-4" aria-hidden="true" />
|
|
40
|
+
Search
|
|
41
|
+
</Button>
|
|
42
|
+
<Button id={`${idPrefix}-alerts`} variant="outline" size="xl" className="px-4">
|
|
43
|
+
<Bell strokeWidth={1.5} className="size-4" aria-hidden="true" />
|
|
44
|
+
Alerts
|
|
45
|
+
</Button>
|
|
46
|
+
<Button id={`${idPrefix}-customize`} size="xl" className="px-4">
|
|
47
|
+
<Palette strokeWidth={1.5} className="size-4" aria-hidden="true" />
|
|
48
|
+
Customize
|
|
49
|
+
</Button>
|
|
50
|
+
</CardContent>
|
|
51
|
+
</Card>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function TourDemo({
|
|
56
|
+
steps,
|
|
57
|
+
idPrefix,
|
|
58
|
+
startLabel = "Start tour",
|
|
59
|
+
}: {
|
|
60
|
+
steps: TourStep[];
|
|
61
|
+
idPrefix: string;
|
|
62
|
+
startLabel?: string;
|
|
63
|
+
}) {
|
|
64
|
+
const [open, setOpen] = React.useState(false);
|
|
65
|
+
return (
|
|
66
|
+
<div className="flex flex-col items-start gap-4">
|
|
67
|
+
<Button size="xl" onClick={() => setOpen(true)}>
|
|
68
|
+
{startLabel}
|
|
69
|
+
</Button>
|
|
70
|
+
<DemoChrome idPrefix={idPrefix} />
|
|
71
|
+
<Tour steps={steps} open={open} onOpenChange={setOpen} />
|
|
72
|
+
</div>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export const Default: Story = {
|
|
77
|
+
render: () => (
|
|
78
|
+
<TourDemo
|
|
79
|
+
idPrefix="tour-default"
|
|
80
|
+
steps={[
|
|
81
|
+
{
|
|
82
|
+
title: "Search the registry",
|
|
83
|
+
description: "Find any primitive, token, or pattern by name.",
|
|
84
|
+
target: "#tour-default-search",
|
|
85
|
+
placement: "bottom",
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
title: "Watch for token changes",
|
|
89
|
+
description: "Alerts fire when a token change affects components you own.",
|
|
90
|
+
target: "#tour-default-alerts",
|
|
91
|
+
placement: "bottom",
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
title: "Customize your tokens",
|
|
95
|
+
description: "Brand color overrides live here, with AAA contrast warnings built in.",
|
|
96
|
+
target: "#tour-default-customize",
|
|
97
|
+
placement: "bottom",
|
|
98
|
+
},
|
|
99
|
+
]}
|
|
100
|
+
/>
|
|
101
|
+
),
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export const Placement_TopAndLeft: Story = {
|
|
105
|
+
render: () => (
|
|
106
|
+
<TourDemo
|
|
107
|
+
idPrefix="tour-placement"
|
|
108
|
+
startLabel="Start tour (top / left)"
|
|
109
|
+
steps={[
|
|
110
|
+
{
|
|
111
|
+
title: "Panel above the target",
|
|
112
|
+
description: "This step uses placement 'top'.",
|
|
113
|
+
target: "#tour-placement-search",
|
|
114
|
+
placement: "top",
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
title: "Panel beside the target",
|
|
118
|
+
description: "This step uses placement 'left'. Positions clamp to the viewport.",
|
|
119
|
+
target: "#tour-placement-customize",
|
|
120
|
+
placement: "left",
|
|
121
|
+
},
|
|
122
|
+
]}
|
|
123
|
+
/>
|
|
124
|
+
),
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export const Centered_WelcomeStep: Story = {
|
|
128
|
+
render: () => (
|
|
129
|
+
<TourDemo
|
|
130
|
+
idPrefix="tour-centered"
|
|
131
|
+
startLabel="Start tour (welcome step)"
|
|
132
|
+
steps={[
|
|
133
|
+
{
|
|
134
|
+
title: "Set up your design system in five minutes",
|
|
135
|
+
description:
|
|
136
|
+
"BADS ships with tokens, components, and accessibility baked in. This short tour shows the three surfaces you'll use most.",
|
|
137
|
+
target: null,
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
title: "Search the registry",
|
|
141
|
+
description: "Find any primitive, token, or pattern by name.",
|
|
142
|
+
target: "#tour-centered-search",
|
|
143
|
+
},
|
|
144
|
+
]}
|
|
145
|
+
/>
|
|
146
|
+
),
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export const RealisticUse: Story = {
|
|
150
|
+
render: function RealisticUseStory() {
|
|
151
|
+
const [open, setOpen] = React.useState(false);
|
|
152
|
+
const [completed, setCompleted] = React.useState(false);
|
|
153
|
+
return (
|
|
154
|
+
<div className="flex flex-col items-start gap-4">
|
|
155
|
+
<Button size="xl" onClick={() => setOpen(true)}>
|
|
156
|
+
Show me around
|
|
157
|
+
</Button>
|
|
158
|
+
{completed && (
|
|
159
|
+
<p className="text-sm text-muted-foreground">
|
|
160
|
+
Tour finished. Run it again any time from Settings.
|
|
161
|
+
</p>
|
|
162
|
+
)}
|
|
163
|
+
<DemoChrome idPrefix="tour-realistic" />
|
|
164
|
+
<Tour
|
|
165
|
+
open={open}
|
|
166
|
+
onOpenChange={setOpen}
|
|
167
|
+
onComplete={() => setCompleted(true)}
|
|
168
|
+
steps={[
|
|
169
|
+
{
|
|
170
|
+
title: "Welcome, Jordan",
|
|
171
|
+
description:
|
|
172
|
+
"36 components, all passing AAA contrast. Here's where everything lives.",
|
|
173
|
+
target: null,
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
title: "Search the registry",
|
|
177
|
+
description: "Find any primitive, token, or pattern by name.",
|
|
178
|
+
target: "#tour-realistic-search",
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
title: "Customize your tokens",
|
|
182
|
+
description:
|
|
183
|
+
"Brand color overrides live here. Changes stay in your browser until you commit them to tokens.json.",
|
|
184
|
+
target: "#tour-realistic-customize",
|
|
185
|
+
},
|
|
186
|
+
]}
|
|
187
|
+
/>
|
|
188
|
+
</div>
|
|
189
|
+
);
|
|
190
|
+
},
|
|
191
|
+
};
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import * as React from "react"
|
|
3
|
+
import { TransferList } from "@behavioral-agentic-design-system/core/components/ui/transfer-list"
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof TransferList> = {
|
|
6
|
+
title: "Components/TransferList",
|
|
7
|
+
component: TransferList,
|
|
8
|
+
parameters: { layout: "centered" },
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
argTypes: {
|
|
11
|
+
searchable: { control: "boolean" },
|
|
12
|
+
availableLabel: { control: "text" },
|
|
13
|
+
selectedLabel: { control: "text" },
|
|
14
|
+
},
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default meta
|
|
18
|
+
type Story = StoryObj<typeof TransferList>
|
|
19
|
+
|
|
20
|
+
// ────────────────────────────────────────────────────────────────────────────
|
|
21
|
+
// Controlled wrapper
|
|
22
|
+
// ────────────────────────────────────────────────────────────────────────────
|
|
23
|
+
|
|
24
|
+
function ControlledTransferList(
|
|
25
|
+
props: Omit<
|
|
26
|
+
React.ComponentProps<typeof TransferList>,
|
|
27
|
+
"available" | "selected" | "onAvailableChange" | "onSelectedChange"
|
|
28
|
+
> & {
|
|
29
|
+
initialAvailable?: string[]
|
|
30
|
+
initialSelected?: string[]
|
|
31
|
+
}
|
|
32
|
+
) {
|
|
33
|
+
const {
|
|
34
|
+
initialAvailable = ["Alpha", "Bravo", "Charlie"],
|
|
35
|
+
initialSelected = [],
|
|
36
|
+
...rest
|
|
37
|
+
} = props
|
|
38
|
+
const [available, setAvailable] = React.useState<string[]>(initialAvailable)
|
|
39
|
+
const [selected, setSelected] = React.useState<string[]>(initialSelected)
|
|
40
|
+
return (
|
|
41
|
+
<TransferList
|
|
42
|
+
available={available}
|
|
43
|
+
selected={selected}
|
|
44
|
+
onAvailableChange={setAvailable}
|
|
45
|
+
onSelectedChange={setSelected}
|
|
46
|
+
{...rest}
|
|
47
|
+
/>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// ────────────────────────────────────────────────────────────────────────────
|
|
52
|
+
// Stories
|
|
53
|
+
// ────────────────────────────────────────────────────────────────────────────
|
|
54
|
+
|
|
55
|
+
export const Default: Story = {
|
|
56
|
+
render: () => (
|
|
57
|
+
<ControlledTransferList
|
|
58
|
+
searchable={false}
|
|
59
|
+
initialAvailable={["Alpha", "Bravo", "Charlie", "Delta", "Echo", "Foxtrot"]}
|
|
60
|
+
/>
|
|
61
|
+
),
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export const WithSearch: Story = {
|
|
65
|
+
render: () => (
|
|
66
|
+
<ControlledTransferList
|
|
67
|
+
searchable
|
|
68
|
+
initialAvailable={[
|
|
69
|
+
"Accordion",
|
|
70
|
+
"Alert",
|
|
71
|
+
"Badge",
|
|
72
|
+
"Button",
|
|
73
|
+
"Calendar",
|
|
74
|
+
"Checkbox",
|
|
75
|
+
"Combobox",
|
|
76
|
+
"DataList",
|
|
77
|
+
"Dialog",
|
|
78
|
+
"Dropdown",
|
|
79
|
+
"Input",
|
|
80
|
+
"Label",
|
|
81
|
+
"Pagination",
|
|
82
|
+
"Progress",
|
|
83
|
+
"Select",
|
|
84
|
+
"Slider",
|
|
85
|
+
"Switch",
|
|
86
|
+
"Table",
|
|
87
|
+
"Tabs",
|
|
88
|
+
"Textarea",
|
|
89
|
+
"Toast",
|
|
90
|
+
"Tooltip",
|
|
91
|
+
]}
|
|
92
|
+
initialSelected={["Accordion", "Button", "Input"]}
|
|
93
|
+
/>
|
|
94
|
+
),
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Demonstrates wiring up to external controlled state (e.g., a form).
|
|
98
|
+
export const Controlled: Story = {
|
|
99
|
+
render: function ControlledStory() {
|
|
100
|
+
const [available, setAvailable] = React.useState([
|
|
101
|
+
"Read",
|
|
102
|
+
"Write",
|
|
103
|
+
"Delete",
|
|
104
|
+
"Admin",
|
|
105
|
+
])
|
|
106
|
+
const [selected, setSelected] = React.useState(["Read"])
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<div className="space-y-4">
|
|
110
|
+
<TransferList
|
|
111
|
+
available={available}
|
|
112
|
+
selected={selected}
|
|
113
|
+
onAvailableChange={setAvailable}
|
|
114
|
+
onSelectedChange={setSelected}
|
|
115
|
+
availableLabel="Permissions"
|
|
116
|
+
selectedLabel="Granted"
|
|
117
|
+
/>
|
|
118
|
+
<p className="text-sm text-muted-foreground">
|
|
119
|
+
Granted:{" "}
|
|
120
|
+
<span className="font-medium text-foreground">
|
|
121
|
+
{selected.length === 0 ? "none" : selected.join(", ")}
|
|
122
|
+
</span>
|
|
123
|
+
</p>
|
|
124
|
+
</div>
|
|
125
|
+
)
|
|
126
|
+
},
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Real-world usage: assigning team members to a project.
|
|
130
|
+
export const RealisticUse: Story = {
|
|
131
|
+
render: function RealisticUseStory() {
|
|
132
|
+
const allMembers = [
|
|
133
|
+
"Seo-yun Park",
|
|
134
|
+
"Jordan Reeves",
|
|
135
|
+
"Amara Osei",
|
|
136
|
+
"Takeshi Nakamura",
|
|
137
|
+
"Priya Mehta",
|
|
138
|
+
"Caleb Torres",
|
|
139
|
+
]
|
|
140
|
+
const [available, setAvailable] = React.useState(allMembers.slice(3))
|
|
141
|
+
const [selected, setSelected] = React.useState(allMembers.slice(0, 3))
|
|
142
|
+
|
|
143
|
+
return (
|
|
144
|
+
<div className="space-y-4 w-full">
|
|
145
|
+
<div>
|
|
146
|
+
<p className="text-sm font-medium text-foreground">
|
|
147
|
+
Assign team members to project
|
|
148
|
+
</p>
|
|
149
|
+
<p className="text-sm text-muted-foreground">
|
|
150
|
+
Select members from the available list, then move them to the
|
|
151
|
+
assigned column.
|
|
152
|
+
</p>
|
|
153
|
+
</div>
|
|
154
|
+
<TransferList
|
|
155
|
+
available={available}
|
|
156
|
+
selected={selected}
|
|
157
|
+
onAvailableChange={setAvailable}
|
|
158
|
+
onSelectedChange={setSelected}
|
|
159
|
+
availableLabel="Team members"
|
|
160
|
+
selectedLabel="Assigned"
|
|
161
|
+
searchable
|
|
162
|
+
/>
|
|
163
|
+
<p className="text-sm text-muted-foreground">
|
|
164
|
+
{selected.length} member{selected.length !== 1 ? "s" : ""} assigned
|
|
165
|
+
</p>
|
|
166
|
+
</div>
|
|
167
|
+
)
|
|
168
|
+
},
|
|
169
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { BellIcon, DownloadIcon, XIcon } from "lucide-react";
|
|
4
|
+
import { VisuallyHidden } from "@behavioral-agentic-design-system/core/components/ui/visually-hidden";
|
|
5
|
+
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
6
|
+
import {
|
|
7
|
+
Card,
|
|
8
|
+
CardContent,
|
|
9
|
+
} from "@behavioral-agentic-design-system/core/components/ui/card";
|
|
10
|
+
import { Badge } from "@behavioral-agentic-design-system/core/components/ui/badge";
|
|
11
|
+
|
|
12
|
+
const meta: Meta<typeof VisuallyHidden> = {
|
|
13
|
+
title: "Components/VisuallyHidden",
|
|
14
|
+
component: VisuallyHidden,
|
|
15
|
+
parameters: { layout: "centered" },
|
|
16
|
+
tags: ["autodocs"],
|
|
17
|
+
argTypes: {
|
|
18
|
+
asChild: { control: "boolean" },
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default meta;
|
|
23
|
+
type Story = StoryObj<typeof VisuallyHidden>;
|
|
24
|
+
|
|
25
|
+
// The primitive is invisible by design — every story pairs it with visible
|
|
26
|
+
// context so the canvas shows WHERE the hidden text sits. Inspect the DOM
|
|
27
|
+
// (or run a screen reader) to confirm the hidden content is present.
|
|
28
|
+
|
|
29
|
+
export const Default: Story = {
|
|
30
|
+
render: () => (
|
|
31
|
+
<div className="max-w-sm space-y-2">
|
|
32
|
+
<p className="text-sm text-foreground">
|
|
33
|
+
Token changes saved.
|
|
34
|
+
<VisuallyHidden>
|
|
35
|
+
Run pnpm build:tokens to regenerate CSS.
|
|
36
|
+
</VisuallyHidden>
|
|
37
|
+
</p>
|
|
38
|
+
<p className="text-xs text-muted-foreground">
|
|
39
|
+
The follow-up instruction is wrapped in VisuallyHidden — screen
|
|
40
|
+
readers announce it after the visible sentence; sighted users see
|
|
41
|
+
only the confirmation. Inspect the DOM to find the hidden span
|
|
42
|
+
(data-slot="visually-hidden").
|
|
43
|
+
</p>
|
|
44
|
+
</div>
|
|
45
|
+
),
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const WithAsChild: Story = {
|
|
49
|
+
render: () => (
|
|
50
|
+
<div className="max-w-sm space-y-2">
|
|
51
|
+
<p className="text-sm text-foreground">
|
|
52
|
+
Reviewed by Jordan Reeves
|
|
53
|
+
<VisuallyHidden asChild>
|
|
54
|
+
<span> (jordan@reeves.design)</span>
|
|
55
|
+
</VisuallyHidden>
|
|
56
|
+
</p>
|
|
57
|
+
<p className="text-xs text-muted-foreground">
|
|
58
|
+
asChild merges the sr-only behavior onto the consumer’s own
|
|
59
|
+
span instead of rendering a wrapper — the child keeps its element
|
|
60
|
+
type and props.
|
|
61
|
+
</p>
|
|
62
|
+
</div>
|
|
63
|
+
),
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const RealisticUse: Story = {
|
|
67
|
+
render: () => (
|
|
68
|
+
<Card className="w-80">
|
|
69
|
+
<CardContent className="space-y-4 p-4">
|
|
70
|
+
<div className="flex items-start justify-between gap-3">
|
|
71
|
+
<div className="min-w-0 space-y-1">
|
|
72
|
+
<p className="truncate text-sm font-semibold">
|
|
73
|
+
tokens-v2-proposal
|
|
74
|
+
</p>
|
|
75
|
+
<p className="text-xs text-muted-foreground">
|
|
76
|
+
Shared by Jordan Reeves
|
|
77
|
+
</p>
|
|
78
|
+
</div>
|
|
79
|
+
<Badge variant="secondary">Draft</Badge>
|
|
80
|
+
</div>
|
|
81
|
+
<div className="flex items-center gap-2">
|
|
82
|
+
<Button variant="outline" size="icon-xl">
|
|
83
|
+
<DownloadIcon strokeWidth={1.5} />
|
|
84
|
+
<VisuallyHidden>Download tokens-v2-proposal</VisuallyHidden>
|
|
85
|
+
</Button>
|
|
86
|
+
<Button variant="outline" size="icon-xl">
|
|
87
|
+
<BellIcon strokeWidth={1.5} />
|
|
88
|
+
<VisuallyHidden>
|
|
89
|
+
Notify me when tokens-v2-proposal changes
|
|
90
|
+
</VisuallyHidden>
|
|
91
|
+
</Button>
|
|
92
|
+
<Button variant="ghost" size="icon-xl">
|
|
93
|
+
<XIcon strokeWidth={1.5} />
|
|
94
|
+
<VisuallyHidden>Dismiss</VisuallyHidden>
|
|
95
|
+
</Button>
|
|
96
|
+
</div>
|
|
97
|
+
<p className="text-xs text-muted-foreground">
|
|
98
|
+
Each icon-only button gets its accessible name from a
|
|
99
|
+
VisuallyHidden label — announced by screen readers, invisible on
|
|
100
|
+
screen.
|
|
101
|
+
</p>
|
|
102
|
+
</CardContent>
|
|
103
|
+
</Card>
|
|
104
|
+
),
|
|
105
|
+
};
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
3
|
+
import { Watermark } from "@behavioral-agentic-design-system/core/components/ui/watermark"
|
|
4
|
+
import {
|
|
5
|
+
Card,
|
|
6
|
+
CardContent,
|
|
7
|
+
CardDescription,
|
|
8
|
+
CardHeader,
|
|
9
|
+
CardTitle,
|
|
10
|
+
} from "@behavioral-agentic-design-system/core/components/ui/card"
|
|
11
|
+
import { Badge } from "@behavioral-agentic-design-system/core/components/ui/badge"
|
|
12
|
+
import {
|
|
13
|
+
DataList,
|
|
14
|
+
DataListItem,
|
|
15
|
+
DataListLabel,
|
|
16
|
+
DataListValue,
|
|
17
|
+
} from "@behavioral-agentic-design-system/core/components/ui/data-list"
|
|
18
|
+
|
|
19
|
+
const meta: Meta<typeof Watermark> = {
|
|
20
|
+
title: "Components/Watermark",
|
|
21
|
+
component: Watermark,
|
|
22
|
+
parameters: { layout: "centered" },
|
|
23
|
+
tags: ["autodocs"],
|
|
24
|
+
argTypes: {
|
|
25
|
+
content: { control: "text" },
|
|
26
|
+
rotate: { control: { type: "range", min: -90, max: 90, step: 5 } },
|
|
27
|
+
opacity: { control: { type: "range", min: 0, max: 1, step: 0.05 } },
|
|
28
|
+
},
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default meta
|
|
32
|
+
type Story = StoryObj<typeof meta>
|
|
33
|
+
|
|
34
|
+
// Content pulled from content/personas/bads.json (primary persona pool).
|
|
35
|
+
|
|
36
|
+
// Simple diagonal-mark SVG as a data URI — same-origin, so the canvas
|
|
37
|
+
// export never taints. Named color (gray) on purpose: the tile is drawn
|
|
38
|
+
// once and the overlay's opacity keeps it quiet in both themes.
|
|
39
|
+
const MARK_SVG =
|
|
40
|
+
"data:image/svg+xml," +
|
|
41
|
+
encodeURIComponent(
|
|
42
|
+
`<svg xmlns='http://www.w3.org/2000/svg' width='96' height='40' viewBox='0 0 96 40'><text x='0' y='28' font-family='sans-serif' font-size='24' font-weight='600' fill='gray'>BADS</text></svg>`,
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
export const Default: Story = {
|
|
46
|
+
render: () => (
|
|
47
|
+
<Watermark content="Internal review — do not distribute">
|
|
48
|
+
<Card className="w-[28rem]">
|
|
49
|
+
<CardHeader>
|
|
50
|
+
<CardTitle>Tokens v2 proposal</CardTitle>
|
|
51
|
+
<CardDescription>
|
|
52
|
+
Shared by Anika Patel · design.bads.com/share/tokens-v2-proposal
|
|
53
|
+
</CardDescription>
|
|
54
|
+
</CardHeader>
|
|
55
|
+
<CardContent className="space-y-3 text-sm leading-relaxed text-foreground">
|
|
56
|
+
<p>
|
|
57
|
+
The semantic layer gets three new aliases so chart surfaces stop
|
|
58
|
+
borrowing from the sidebar palette. Every pair was audited at 7:1
|
|
59
|
+
before this draft went out.
|
|
60
|
+
</p>
|
|
61
|
+
<p className="text-muted-foreground">
|
|
62
|
+
36 components, all passing AAA contrast. Last token change was 3
|
|
63
|
+
days ago.
|
|
64
|
+
</p>
|
|
65
|
+
</CardContent>
|
|
66
|
+
</Card>
|
|
67
|
+
</Watermark>
|
|
68
|
+
),
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const Size_Sm: Story = {
|
|
72
|
+
render: () => (
|
|
73
|
+
<Watermark
|
|
74
|
+
content="seoyun_park · 2026-05-26"
|
|
75
|
+
font={{ fontSize: 12 }}
|
|
76
|
+
gap={[64, 64]}
|
|
77
|
+
opacity={0.12}
|
|
78
|
+
>
|
|
79
|
+
<Card className="w-[28rem]">
|
|
80
|
+
<CardHeader>
|
|
81
|
+
<CardTitle>Exported audit snapshot</CardTitle>
|
|
82
|
+
<CardDescription>
|
|
83
|
+
Dense provenance mark — small type, tight gap, low opacity.
|
|
84
|
+
</CardDescription>
|
|
85
|
+
</CardHeader>
|
|
86
|
+
<CardContent className="text-sm leading-relaxed text-muted-foreground">
|
|
87
|
+
Screenshot exports carry the exporting account and date as a
|
|
88
|
+
repeating mark so shared images stay attributable.
|
|
89
|
+
</CardContent>
|
|
90
|
+
</Card>
|
|
91
|
+
</Watermark>
|
|
92
|
+
),
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export const Size_Lg: Story = {
|
|
96
|
+
render: () => (
|
|
97
|
+
<Watermark
|
|
98
|
+
content="DRAFT"
|
|
99
|
+
font={{ fontSize: 48, fontWeight: "semibold" }}
|
|
100
|
+
gap={[140, 120]}
|
|
101
|
+
opacity={0.08}
|
|
102
|
+
>
|
|
103
|
+
<Card className="w-[28rem]">
|
|
104
|
+
<CardHeader>
|
|
105
|
+
<CardTitle>Set up your design system in five minutes</CardTitle>
|
|
106
|
+
<CardDescription>
|
|
107
|
+
Loud status mark — large type, wide gap, extra-low opacity so the
|
|
108
|
+
body copy stays readable.
|
|
109
|
+
</CardDescription>
|
|
110
|
+
</CardHeader>
|
|
111
|
+
<CardContent className="space-y-3 text-sm leading-relaxed text-foreground">
|
|
112
|
+
<p>
|
|
113
|
+
Fork it, rename it, customize the brand colors, and start
|
|
114
|
+
building. Token changes saved — run pnpm build:tokens to
|
|
115
|
+
regenerate CSS.
|
|
116
|
+
</p>
|
|
117
|
+
<p>
|
|
118
|
+
This walkthrough is unpublished; the DRAFT mark comes off when
|
|
119
|
+
docs review signs it.
|
|
120
|
+
</p>
|
|
121
|
+
</CardContent>
|
|
122
|
+
</Card>
|
|
123
|
+
</Watermark>
|
|
124
|
+
),
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export const WithImage: Story = {
|
|
128
|
+
render: () => (
|
|
129
|
+
<Watermark image={MARK_SVG} gap={[110, 90]} opacity={0.1}>
|
|
130
|
+
<Card className="w-[28rem]">
|
|
131
|
+
<CardHeader>
|
|
132
|
+
<CardTitle>Brand-marked preview</CardTitle>
|
|
133
|
+
<CardDescription>
|
|
134
|
+
Image mode: an SVG wordmark tiles instead of text. Data-URI
|
|
135
|
+
images never taint the canvas; cross-origin URLs load with
|
|
136
|
+
crossOrigin="anonymous" and fail silent.
|
|
137
|
+
</CardDescription>
|
|
138
|
+
</CardHeader>
|
|
139
|
+
<CardContent className="text-sm leading-relaxed text-muted-foreground">
|
|
140
|
+
Use image mode for logo provenance on exported charts and shared
|
|
141
|
+
board previews.
|
|
142
|
+
</CardContent>
|
|
143
|
+
</Card>
|
|
144
|
+
</Watermark>
|
|
145
|
+
),
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export const MultiLine: Story = {
|
|
149
|
+
render: () => (
|
|
150
|
+
<Watermark
|
|
151
|
+
content={["Confidential", "anika.patel@stripe.com"]}
|
|
152
|
+
gap={[90, 80]}
|
|
153
|
+
>
|
|
154
|
+
<Card className="w-[28rem]">
|
|
155
|
+
<CardHeader>
|
|
156
|
+
<CardTitle>Per-viewer mark</CardTitle>
|
|
157
|
+
<CardDescription>
|
|
158
|
+
Array content renders stacked lines — the classic
|
|
159
|
+
classification-plus-identity pair.
|
|
160
|
+
</CardDescription>
|
|
161
|
+
</CardHeader>
|
|
162
|
+
<CardContent className="text-sm leading-relaxed text-muted-foreground">
|
|
163
|
+
Remember: the overlay is a visual cue, not a security control. The
|
|
164
|
+
DOM node is deletable and the content stays copyable by design.
|
|
165
|
+
</CardContent>
|
|
166
|
+
</Card>
|
|
167
|
+
</Watermark>
|
|
168
|
+
),
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export const RealisticUse: Story = {
|
|
172
|
+
render: () => (
|
|
173
|
+
<Watermark content="CONFIDENTIAL — internal pricing" rotate={-30}>
|
|
174
|
+
<Card className="w-[30rem]">
|
|
175
|
+
<CardHeader className="flex-row items-start justify-between space-y-0">
|
|
176
|
+
<div className="space-y-1">
|
|
177
|
+
<CardTitle>Invoice #2047</CardTitle>
|
|
178
|
+
<CardDescription>Issued 2026-05-26 · due 2026-06-25</CardDescription>
|
|
179
|
+
</div>
|
|
180
|
+
<Badge variant="secondary">Unpaid</Badge>
|
|
181
|
+
</CardHeader>
|
|
182
|
+
<CardContent className="space-y-4">
|
|
183
|
+
<DataList>
|
|
184
|
+
<DataListItem>
|
|
185
|
+
<DataListLabel>Billed to</DataListLabel>
|
|
186
|
+
<DataListValue>Jordan Reeves — jordan@reeves.design</DataListValue>
|
|
187
|
+
</DataListItem>
|
|
188
|
+
<DataListItem>
|
|
189
|
+
<DataListLabel>Line item</DataListLabel>
|
|
190
|
+
<DataListValue>Pro tier, annual (per seat)</DataListValue>
|
|
191
|
+
</DataListItem>
|
|
192
|
+
<DataListItem>
|
|
193
|
+
<DataListLabel>Amount</DataListLabel>
|
|
194
|
+
<DataListValue>$249.00</DataListValue>
|
|
195
|
+
</DataListItem>
|
|
196
|
+
<DataListItem>
|
|
197
|
+
<DataListLabel>Remit to</DataListLabel>
|
|
198
|
+
<DataListValue>
|
|
199
|
+
1401 South Congress Ave, Suite 200, Austin, TX 78704
|
|
200
|
+
</DataListValue>
|
|
201
|
+
</DataListItem>
|
|
202
|
+
</DataList>
|
|
203
|
+
<p className="text-xs leading-relaxed text-muted-foreground">
|
|
204
|
+
Pricing terms on this invoice are pre-announcement. The watermark
|
|
205
|
+
overlay is aria-hidden and pointer-events-none, so screen readers
|
|
206
|
+
and text selection behave exactly as they would without it.
|
|
207
|
+
</p>
|
|
208
|
+
</CardContent>
|
|
209
|
+
</Card>
|
|
210
|
+
</Watermark>
|
|
211
|
+
),
|
|
212
|
+
}
|