@behavioral-agentic-design-system/core 0.16.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/check-stories.mjs +12 -5
- package/scripts/fix-stories.mjs +6 -6
- package/scripts/generate-stories.cjs +7 -7
- package/src/app/preview/components/page.tsx +165 -50
- package/src/components/ui/code.tsx +55 -0
- package/src/components/ui/index.ts +0 -1
- package/src/components/ui/indicator.tsx +9 -7
- package/src/components/ui/native-select.tsx +68 -0
- package/src/components/ui/navigation-menu.tsx +23 -0
- package/src/components/ui/sheet.tsx +23 -6
- package/src/components/ui/spinner.tsx +14 -3
- package/src/components/ui/tags-input.tsx +210 -69
- package/src/stories/Accordion.stories.tsx +152 -0
- package/src/stories/Alert.stories.tsx +102 -0
- package/src/stories/AlertDialog.stories.tsx +125 -0
- package/src/stories/AspectRatio.stories.tsx +82 -0
- package/src/stories/Avatar.stories.tsx +36 -0
- package/src/stories/Badge.stories.tsx +54 -0
- package/src/stories/Breadcrumb.stories.tsx +36 -0
- package/src/stories/Button.stories.tsx +144 -0
- package/src/stories/ButtonGroup.stories.tsx +176 -0
- package/src/stories/Calendar.stories.tsx +67 -0
- package/src/stories/Card.stories.tsx +43 -0
- package/src/stories/Carousel.stories.tsx +233 -0
- package/src/stories/Chart.stories.tsx +174 -0
- package/src/stories/Checkbox.stories.tsx +32 -0
- package/src/stories/CircularProgress.stories.tsx +136 -0
- package/src/stories/Code.stories.tsx +131 -0
- package/src/stories/Collapsible.stories.tsx +27 -0
- package/src/stories/ColorPicker.stories.tsx +155 -0
- package/src/stories/Combobox.stories.tsx +168 -0
- package/src/stories/Command.stories.tsx +40 -0
- package/src/stories/ContextMenu.stories.tsx +293 -0
- package/src/stories/CopyButton.stories.tsx +111 -0
- package/src/stories/DatePicker.stories.tsx +176 -0
- package/src/stories/DateRangePicker.stories.tsx +95 -0
- package/src/stories/Dialog.stories.tsx +186 -0
- package/src/stories/DropdownMenu.stories.tsx +47 -0
- package/src/stories/EmptyState.stories.tsx +199 -0
- package/src/stories/Field.stories.tsx +155 -0
- package/src/stories/FileUpload.stories.tsx +134 -0
- package/src/stories/HoverCard.stories.tsx +149 -0
- package/src/stories/Indicator.stories.tsx +255 -0
- package/src/stories/Input.stories.tsx +69 -0
- package/src/stories/Kbd.stories.tsx +123 -0
- package/src/stories/Label.stories.tsx +27 -0
- package/src/stories/List.stories.tsx +159 -0
- package/src/stories/Menubar.stories.tsx +190 -0
- package/src/stories/MultiSelect.stories.tsx +107 -0
- package/src/stories/NativeSelect.stories.tsx +107 -0
- package/src/stories/NavigationMenu.stories.tsx +322 -0
- package/src/stories/NumberInput.stories.tsx +100 -0
- package/src/stories/Pagination.stories.tsx +201 -0
- package/src/stories/PasswordInput.stories.tsx +62 -0
- package/src/stories/PinInput.stories.tsx +136 -0
- package/src/stories/Popover.stories.tsx +37 -0
- package/src/stories/Progress.stories.tsx +64 -0
- package/src/stories/RadioGroup.stories.tsx +39 -0
- package/src/stories/RatingGroup.stories.tsx +102 -0
- package/src/stories/Resizable.stories.tsx +28 -0
- package/src/stories/Reveal.stories.tsx +63 -0
- package/src/stories/ScrollArea.stories.tsx +76 -0
- package/src/stories/SegmentedControl.stories.tsx +182 -0
- package/src/stories/Select.stories.tsx +62 -0
- package/src/stories/Separator.stories.tsx +28 -0
- package/src/stories/Sheet.stories.tsx +193 -0
- package/src/stories/Sidebar.stories.tsx +53 -0
- package/src/stories/Skeleton.stories.tsx +32 -0
- package/src/stories/Slider.stories.tsx +67 -0
- package/src/stories/Sonner.stories.tsx +146 -0
- package/src/stories/Spinner.stories.tsx +94 -0
- package/src/stories/Stepper.stories.tsx +228 -0
- package/src/stories/Switch.stories.tsx +58 -0
- package/src/stories/Table.stories.tsx +38 -0
- package/src/stories/Tabs.stories.tsx +128 -0
- package/src/stories/Tag.stories.tsx +51 -0
- package/src/stories/TagsInput.stories.tsx +154 -0
- package/src/stories/Textarea.stories.tsx +31 -0
- package/src/stories/TimePicker.stories.tsx +54 -0
- package/src/stories/Timeline.stories.tsx +263 -0
- package/src/stories/Toggle.stories.tsx +45 -0
- package/src/stories/ToggleGroup.stories.tsx +39 -0
- package/src/stories/Toolbar.stories.tsx +295 -0
- package/src/stories/Tooltip.stories.tsx +37 -0
- package/src/stories/TreeView.stories.tsx +293 -0
- package/src/components/ui/bottom-sheet.tsx +0 -133
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Toggle } from "@behavioral-agentic-design-system/core/components/ui/toggle";
|
|
3
|
+
import { Bold } from "lucide-react";
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Toggle> = {
|
|
6
|
+
title: "Components/Toggle",
|
|
7
|
+
component: Toggle,
|
|
8
|
+
parameters: { layout: "centered" },
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof meta>;
|
|
14
|
+
|
|
15
|
+
export const Default: Story = {
|
|
16
|
+
render: () => (<Toggle aria-label="Toggle bold"><Bold className="h-4 w-4" /></Toggle>),
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const Variant_Default: Story = {
|
|
20
|
+
render: () => <Toggle variant="default">Default</Toggle>,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const Variant_Outline: Story = {
|
|
24
|
+
render: () => <Toggle variant="outline">Outline</Toggle>,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const Size_Default: Story = {
|
|
28
|
+
render: () => <Toggle size="default">Default</Toggle>,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const Size_Sm: Story = {
|
|
32
|
+
render: () => <Toggle size="sm">Sm</Toggle>,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const Size_Lg: Story = {
|
|
36
|
+
render: () => <Toggle size="lg">Lg</Toggle>,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const Disabled: Story = {
|
|
40
|
+
args: { disabled: true, "aria-label": "Toggle bold" } as any,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const RealisticUse: Story = {
|
|
44
|
+
render: () => (<Toggle aria-label="Toggle bold"><Bold className="h-4 w-4" /></Toggle>),
|
|
45
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { ToggleGroup, ToggleGroupItem } from "@behavioral-agentic-design-system/core/components/ui/toggle-group";
|
|
3
|
+
import { Bold, Italic, Underline } from "lucide-react";
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof ToggleGroup> = {
|
|
6
|
+
title: "Components/ToggleGroup",
|
|
7
|
+
component: ToggleGroup,
|
|
8
|
+
parameters: { layout: "centered" },
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof meta>;
|
|
14
|
+
|
|
15
|
+
export const Default: Story = {
|
|
16
|
+
render: () => (<ToggleGroup type="multiple">
|
|
17
|
+
<ToggleGroupItem value="bold" aria-label="Bold"><Bold className="h-4 w-4" /></ToggleGroupItem>
|
|
18
|
+
<ToggleGroupItem value="italic" aria-label="Italic"><Italic className="h-4 w-4" /></ToggleGroupItem>
|
|
19
|
+
<ToggleGroupItem value="underline" aria-label="Underline"><Underline className="h-4 w-4" /></ToggleGroupItem>
|
|
20
|
+
</ToggleGroup>),
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const Disabled: Story = {
|
|
24
|
+
render: () => (
|
|
25
|
+
<ToggleGroup type="multiple" disabled>
|
|
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 RealisticUse: Story = {
|
|
34
|
+
render: () => (<ToggleGroup type="multiple">
|
|
35
|
+
<ToggleGroupItem value="bold" aria-label="Bold"><Bold className="h-4 w-4" /></ToggleGroupItem>
|
|
36
|
+
<ToggleGroupItem value="italic" aria-label="Italic"><Italic className="h-4 w-4" /></ToggleGroupItem>
|
|
37
|
+
<ToggleGroupItem value="underline" aria-label="Underline"><Underline className="h-4 w-4" /></ToggleGroupItem>
|
|
38
|
+
</ToggleGroup>),
|
|
39
|
+
};
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import {
|
|
4
|
+
AlignLeftIcon,
|
|
5
|
+
AlignCenterIcon,
|
|
6
|
+
AlignRightIcon,
|
|
7
|
+
BoldIcon,
|
|
8
|
+
ItalicIcon,
|
|
9
|
+
UnderlineIcon,
|
|
10
|
+
LinkIcon,
|
|
11
|
+
ImageIcon,
|
|
12
|
+
ListIcon,
|
|
13
|
+
ListOrderedIcon,
|
|
14
|
+
UndoIcon,
|
|
15
|
+
RedoIcon,
|
|
16
|
+
CodeIcon,
|
|
17
|
+
QuoteIcon,
|
|
18
|
+
} from "lucide-react";
|
|
19
|
+
import {
|
|
20
|
+
Toolbar,
|
|
21
|
+
ToolbarButton,
|
|
22
|
+
ToolbarSeparator,
|
|
23
|
+
} from "@behavioral-agentic-design-system/core/components/ui/toolbar";
|
|
24
|
+
|
|
25
|
+
const meta: Meta<typeof Toolbar> = {
|
|
26
|
+
title: "Components/Toolbar",
|
|
27
|
+
component: Toolbar,
|
|
28
|
+
parameters: { layout: "centered" },
|
|
29
|
+
tags: ["autodocs"],
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default meta;
|
|
33
|
+
type Story = StoryObj<typeof meta>;
|
|
34
|
+
|
|
35
|
+
export const Default: Story = {
|
|
36
|
+
render: () => (
|
|
37
|
+
<Toolbar aria-label="Text formatting">
|
|
38
|
+
<ToolbarButton aria-label="Bold">
|
|
39
|
+
<BoldIcon strokeWidth={1.5} className="size-4" />
|
|
40
|
+
</ToolbarButton>
|
|
41
|
+
<ToolbarButton aria-label="Italic">
|
|
42
|
+
<ItalicIcon strokeWidth={1.5} className="size-4" />
|
|
43
|
+
</ToolbarButton>
|
|
44
|
+
<ToolbarButton aria-label="Underline">
|
|
45
|
+
<UnderlineIcon strokeWidth={1.5} className="size-4" />
|
|
46
|
+
</ToolbarButton>
|
|
47
|
+
</Toolbar>
|
|
48
|
+
),
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const WithSeparator: Story = {
|
|
52
|
+
render: () => (
|
|
53
|
+
<Toolbar aria-label="Rich text editor toolbar">
|
|
54
|
+
<ToolbarButton aria-label="Bold">
|
|
55
|
+
<BoldIcon strokeWidth={1.5} className="size-4" />
|
|
56
|
+
</ToolbarButton>
|
|
57
|
+
<ToolbarButton aria-label="Italic">
|
|
58
|
+
<ItalicIcon strokeWidth={1.5} className="size-4" />
|
|
59
|
+
</ToolbarButton>
|
|
60
|
+
<ToolbarButton aria-label="Underline">
|
|
61
|
+
<UnderlineIcon strokeWidth={1.5} className="size-4" />
|
|
62
|
+
</ToolbarButton>
|
|
63
|
+
<ToolbarSeparator />
|
|
64
|
+
<ToolbarButton aria-label="Align left">
|
|
65
|
+
<AlignLeftIcon strokeWidth={1.5} className="size-4" />
|
|
66
|
+
</ToolbarButton>
|
|
67
|
+
<ToolbarButton aria-label="Align center">
|
|
68
|
+
<AlignCenterIcon strokeWidth={1.5} className="size-4" />
|
|
69
|
+
</ToolbarButton>
|
|
70
|
+
<ToolbarButton aria-label="Align right">
|
|
71
|
+
<AlignRightIcon strokeWidth={1.5} className="size-4" />
|
|
72
|
+
</ToolbarButton>
|
|
73
|
+
<ToolbarSeparator />
|
|
74
|
+
<ToolbarButton aria-label="Insert link">
|
|
75
|
+
<LinkIcon strokeWidth={1.5} className="size-4" />
|
|
76
|
+
</ToolbarButton>
|
|
77
|
+
<ToolbarButton aria-label="Insert image">
|
|
78
|
+
<ImageIcon strokeWidth={1.5} className="size-4" />
|
|
79
|
+
</ToolbarButton>
|
|
80
|
+
</Toolbar>
|
|
81
|
+
),
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const WithActiveState: Story = {
|
|
85
|
+
render: () => {
|
|
86
|
+
const [bold, setBold] = React.useState(true);
|
|
87
|
+
const [italic, setItalic] = React.useState(false);
|
|
88
|
+
const [underline, setUnderline] = React.useState(false);
|
|
89
|
+
const [align, setAlign] = React.useState<"left" | "center" | "right">("left");
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<Toolbar aria-label="Text formatting with active states">
|
|
93
|
+
<ToolbarButton
|
|
94
|
+
aria-label="Bold"
|
|
95
|
+
aria-pressed={bold}
|
|
96
|
+
onClick={() => setBold((v) => !v)}
|
|
97
|
+
>
|
|
98
|
+
<BoldIcon strokeWidth={1.5} className="size-4" />
|
|
99
|
+
</ToolbarButton>
|
|
100
|
+
<ToolbarButton
|
|
101
|
+
aria-label="Italic"
|
|
102
|
+
aria-pressed={italic}
|
|
103
|
+
onClick={() => setItalic((v) => !v)}
|
|
104
|
+
>
|
|
105
|
+
<ItalicIcon strokeWidth={1.5} className="size-4" />
|
|
106
|
+
</ToolbarButton>
|
|
107
|
+
<ToolbarButton
|
|
108
|
+
aria-label="Underline"
|
|
109
|
+
aria-pressed={underline}
|
|
110
|
+
onClick={() => setUnderline((v) => !v)}
|
|
111
|
+
>
|
|
112
|
+
<UnderlineIcon strokeWidth={1.5} className="size-4" />
|
|
113
|
+
</ToolbarButton>
|
|
114
|
+
<ToolbarSeparator />
|
|
115
|
+
<ToolbarButton
|
|
116
|
+
aria-label="Align left"
|
|
117
|
+
aria-pressed={align === "left"}
|
|
118
|
+
onClick={() => setAlign("left")}
|
|
119
|
+
>
|
|
120
|
+
<AlignLeftIcon strokeWidth={1.5} className="size-4" />
|
|
121
|
+
</ToolbarButton>
|
|
122
|
+
<ToolbarButton
|
|
123
|
+
aria-label="Align center"
|
|
124
|
+
aria-pressed={align === "center"}
|
|
125
|
+
onClick={() => setAlign("center")}
|
|
126
|
+
>
|
|
127
|
+
<AlignCenterIcon strokeWidth={1.5} className="size-4" />
|
|
128
|
+
</ToolbarButton>
|
|
129
|
+
<ToolbarButton
|
|
130
|
+
aria-label="Align right"
|
|
131
|
+
aria-pressed={align === "right"}
|
|
132
|
+
onClick={() => setAlign("right")}
|
|
133
|
+
>
|
|
134
|
+
<AlignRightIcon strokeWidth={1.5} className="size-4" />
|
|
135
|
+
</ToolbarButton>
|
|
136
|
+
</Toolbar>
|
|
137
|
+
);
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export const Vertical: Story = {
|
|
142
|
+
render: () => (
|
|
143
|
+
<Toolbar orientation="vertical" aria-label="Document actions">
|
|
144
|
+
<ToolbarButton aria-label="Undo">
|
|
145
|
+
<UndoIcon strokeWidth={1.5} className="size-4" />
|
|
146
|
+
</ToolbarButton>
|
|
147
|
+
<ToolbarButton aria-label="Redo">
|
|
148
|
+
<RedoIcon strokeWidth={1.5} className="size-4" />
|
|
149
|
+
</ToolbarButton>
|
|
150
|
+
<ToolbarSeparator className="h-px w-full" />
|
|
151
|
+
<ToolbarButton aria-label="Bulleted list">
|
|
152
|
+
<ListIcon strokeWidth={1.5} className="size-4" />
|
|
153
|
+
</ToolbarButton>
|
|
154
|
+
<ToolbarButton aria-label="Numbered list">
|
|
155
|
+
<ListOrderedIcon strokeWidth={1.5} className="size-4" />
|
|
156
|
+
</ToolbarButton>
|
|
157
|
+
</Toolbar>
|
|
158
|
+
),
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export const Disabled: Story = {
|
|
162
|
+
render: () => (
|
|
163
|
+
<Toolbar aria-label="Disabled toolbar">
|
|
164
|
+
<ToolbarButton aria-label="Bold" disabled>
|
|
165
|
+
<BoldIcon strokeWidth={1.5} className="size-4" />
|
|
166
|
+
</ToolbarButton>
|
|
167
|
+
<ToolbarButton aria-label="Italic" disabled>
|
|
168
|
+
<ItalicIcon strokeWidth={1.5} className="size-4" />
|
|
169
|
+
</ToolbarButton>
|
|
170
|
+
<ToolbarButton aria-label="Underline" disabled>
|
|
171
|
+
<UnderlineIcon strokeWidth={1.5} className="size-4" />
|
|
172
|
+
</ToolbarButton>
|
|
173
|
+
</Toolbar>
|
|
174
|
+
),
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export const RealisticUse: Story = {
|
|
178
|
+
decorators: [
|
|
179
|
+
(Story) => (
|
|
180
|
+
<div className="flex min-h-[400px] w-[680px] flex-col rounded-lg border bg-card shadow-sm">
|
|
181
|
+
<Story />
|
|
182
|
+
</div>
|
|
183
|
+
),
|
|
184
|
+
],
|
|
185
|
+
render: () => {
|
|
186
|
+
const [bold, setBold] = React.useState(false);
|
|
187
|
+
const [italic, setItalic] = React.useState(false);
|
|
188
|
+
const [underline, setUnderline] = React.useState(false);
|
|
189
|
+
const [code, setCode] = React.useState(false);
|
|
190
|
+
const [align, setAlign] = React.useState<"left" | "center" | "right">("left");
|
|
191
|
+
|
|
192
|
+
return (
|
|
193
|
+
<div className="flex flex-col">
|
|
194
|
+
<div className="border-b bg-muted/30 px-3 py-2">
|
|
195
|
+
<Toolbar aria-label="Document editor toolbar">
|
|
196
|
+
<ToolbarButton aria-label="Undo">
|
|
197
|
+
<UndoIcon strokeWidth={1.5} className="size-4" />
|
|
198
|
+
</ToolbarButton>
|
|
199
|
+
<ToolbarButton aria-label="Redo">
|
|
200
|
+
<RedoIcon strokeWidth={1.5} className="size-4" />
|
|
201
|
+
</ToolbarButton>
|
|
202
|
+
<ToolbarSeparator />
|
|
203
|
+
<ToolbarButton
|
|
204
|
+
aria-label="Bold"
|
|
205
|
+
aria-pressed={bold}
|
|
206
|
+
onClick={() => setBold((v) => !v)}
|
|
207
|
+
>
|
|
208
|
+
<BoldIcon strokeWidth={1.5} className="size-4" />
|
|
209
|
+
</ToolbarButton>
|
|
210
|
+
<ToolbarButton
|
|
211
|
+
aria-label="Italic"
|
|
212
|
+
aria-pressed={italic}
|
|
213
|
+
onClick={() => setItalic((v) => !v)}
|
|
214
|
+
>
|
|
215
|
+
<ItalicIcon strokeWidth={1.5} className="size-4" />
|
|
216
|
+
</ToolbarButton>
|
|
217
|
+
<ToolbarButton
|
|
218
|
+
aria-label="Underline"
|
|
219
|
+
aria-pressed={underline}
|
|
220
|
+
onClick={() => setUnderline((v) => !v)}
|
|
221
|
+
>
|
|
222
|
+
<UnderlineIcon strokeWidth={1.5} className="size-4" />
|
|
223
|
+
</ToolbarButton>
|
|
224
|
+
<ToolbarButton
|
|
225
|
+
aria-label="Code"
|
|
226
|
+
aria-pressed={code}
|
|
227
|
+
onClick={() => setCode((v) => !v)}
|
|
228
|
+
>
|
|
229
|
+
<CodeIcon strokeWidth={1.5} className="size-4" />
|
|
230
|
+
</ToolbarButton>
|
|
231
|
+
<ToolbarSeparator />
|
|
232
|
+
<ToolbarButton
|
|
233
|
+
aria-label="Align left"
|
|
234
|
+
aria-pressed={align === "left"}
|
|
235
|
+
onClick={() => setAlign("left")}
|
|
236
|
+
>
|
|
237
|
+
<AlignLeftIcon strokeWidth={1.5} className="size-4" />
|
|
238
|
+
</ToolbarButton>
|
|
239
|
+
<ToolbarButton
|
|
240
|
+
aria-label="Align center"
|
|
241
|
+
aria-pressed={align === "center"}
|
|
242
|
+
onClick={() => setAlign("center")}
|
|
243
|
+
>
|
|
244
|
+
<AlignCenterIcon strokeWidth={1.5} className="size-4" />
|
|
245
|
+
</ToolbarButton>
|
|
246
|
+
<ToolbarButton
|
|
247
|
+
aria-label="Align right"
|
|
248
|
+
aria-pressed={align === "right"}
|
|
249
|
+
onClick={() => setAlign("right")}
|
|
250
|
+
>
|
|
251
|
+
<AlignRightIcon strokeWidth={1.5} className="size-4" />
|
|
252
|
+
</ToolbarButton>
|
|
253
|
+
<ToolbarSeparator />
|
|
254
|
+
<ToolbarButton aria-label="Bulleted list">
|
|
255
|
+
<ListIcon strokeWidth={1.5} className="size-4" />
|
|
256
|
+
</ToolbarButton>
|
|
257
|
+
<ToolbarButton aria-label="Numbered list">
|
|
258
|
+
<ListOrderedIcon strokeWidth={1.5} className="size-4" />
|
|
259
|
+
</ToolbarButton>
|
|
260
|
+
<ToolbarSeparator />
|
|
261
|
+
<ToolbarButton aria-label="Blockquote">
|
|
262
|
+
<QuoteIcon strokeWidth={1.5} className="size-4" />
|
|
263
|
+
</ToolbarButton>
|
|
264
|
+
<ToolbarButton aria-label="Insert link">
|
|
265
|
+
<LinkIcon strokeWidth={1.5} className="size-4" />
|
|
266
|
+
</ToolbarButton>
|
|
267
|
+
<ToolbarButton aria-label="Insert image">
|
|
268
|
+
<ImageIcon strokeWidth={1.5} className="size-4" />
|
|
269
|
+
</ToolbarButton>
|
|
270
|
+
</Toolbar>
|
|
271
|
+
</div>
|
|
272
|
+
<div className="flex-1 p-6">
|
|
273
|
+
<p
|
|
274
|
+
className="text-sm leading-relaxed text-foreground"
|
|
275
|
+
style={{
|
|
276
|
+
fontWeight: bold ? 700 : 400,
|
|
277
|
+
fontStyle: italic ? "italic" : "normal",
|
|
278
|
+
textDecoration: underline ? "underline" : "none",
|
|
279
|
+
textAlign: align,
|
|
280
|
+
fontFamily: code ? "monospace" : undefined,
|
|
281
|
+
}}
|
|
282
|
+
>
|
|
283
|
+
This is a sample document body. Use the toolbar above to apply
|
|
284
|
+
formatting — bold, italic, underline, code, and text alignment
|
|
285
|
+
all reflect here. The toolbar uses{" "}
|
|
286
|
+
<code className="rounded bg-muted px-1 py-0.5 font-mono text-xs">
|
|
287
|
+
role="toolbar"
|
|
288
|
+
</code>{" "}
|
|
289
|
+
with arrow-key navigation between buttons.
|
|
290
|
+
</p>
|
|
291
|
+
</div>
|
|
292
|
+
</div>
|
|
293
|
+
);
|
|
294
|
+
},
|
|
295
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// NOTE: this primitive now respects PortalThemeProvider — when a parent\
|
|
2
|
+
// mounts <PortalThemeProvider scope="...">, the portal'd content auto-\
|
|
3
|
+
// applies the scope class so theme-scoped CSS variables resolve inside\
|
|
4
|
+
// the portal. See components/Sheet.stories.tsx → WithPortalTheme for the\
|
|
5
|
+
// canonical demonstration. Mechanism is identical here; no separate\
|
|
6
|
+
// story added because the demo would duplicate Sheet's.
|
|
7
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
8
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@behavioral-agentic-design-system/core/components/ui/tooltip";
|
|
9
|
+
import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
|
|
10
|
+
|
|
11
|
+
const meta: Meta<typeof Tooltip> = {
|
|
12
|
+
title: "Components/Tooltip",
|
|
13
|
+
component: Tooltip,
|
|
14
|
+
parameters: { layout: "centered" },
|
|
15
|
+
tags: ["autodocs"],
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default meta;
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
|
|
21
|
+
export const Default: Story = {
|
|
22
|
+
render: () => (<TooltipProvider>
|
|
23
|
+
<Tooltip>
|
|
24
|
+
<TooltipTrigger asChild><Button variant="outline">Hover me</Button></TooltipTrigger>
|
|
25
|
+
<TooltipContent>Helpful context</TooltipContent>
|
|
26
|
+
</Tooltip>
|
|
27
|
+
</TooltipProvider>),
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const RealisticUse: Story = {
|
|
31
|
+
render: () => (<TooltipProvider>
|
|
32
|
+
<Tooltip>
|
|
33
|
+
<TooltipTrigger asChild><Button variant="outline">Hover me</Button></TooltipTrigger>
|
|
34
|
+
<TooltipContent>Helpful context</TooltipContent>
|
|
35
|
+
</Tooltip>
|
|
36
|
+
</TooltipProvider>),
|
|
37
|
+
};
|