@alpic-ai/ui 0.0.0 → 1.111.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/dist/components/alert.d.mts +1 -1
- package/dist/components/avatar.d.mts +1 -1
- package/dist/components/badge.d.mts +1 -1
- package/dist/components/button.d.mts +2 -2
- package/dist/components/combobox.mjs +1 -1
- package/dist/components/dialog.mjs +2 -2
- package/dist/components/form.d.mts +119 -0
- package/dist/components/form.mjs +192 -0
- package/dist/components/input.d.mts +2 -0
- package/dist/components/input.mjs +19 -10
- package/dist/components/select-trigger-variants.mjs +1 -0
- package/dist/components/select.d.mts +1 -9
- package/dist/components/select.mjs +8 -28
- package/dist/components/sidebar.d.mts +1 -1
- package/dist/components/sidebar.mjs +6 -6
- package/dist/components/spinner.d.mts +1 -1
- package/dist/components/status-dot.d.mts +1 -1
- package/dist/components/tabs.d.mts +1 -1
- package/dist/components/textarea.d.mts +2 -0
- package/dist/components/textarea.mjs +19 -10
- package/dist/components/toggle-group.d.mts +1 -1
- package/package.json +31 -40
- package/src/components/combobox.tsx +1 -1
- package/src/components/dialog.tsx +2 -2
- package/src/components/form.tsx +343 -0
- package/src/components/input.tsx +12 -0
- package/src/components/select-trigger-variants.ts +1 -0
- package/src/components/select.tsx +2 -35
- package/src/components/sidebar.tsx +8 -10
- package/src/components/textarea.tsx +12 -1
- package/src/stories/accordion-card.stories.tsx +53 -0
- package/src/stories/accordion.stories.tsx +65 -0
- package/src/stories/alert.stories.tsx +58 -0
- package/src/stories/attachment-tile.stories.tsx +37 -0
- package/src/stories/avatar.stories.tsx +54 -0
- package/src/stories/badge.stories.tsx +50 -0
- package/src/stories/breadcrumb.stories.tsx +107 -0
- package/src/stories/button.stories.tsx +342 -0
- package/src/stories/card.stories.tsx +89 -0
- package/src/stories/checkbox.stories.tsx +56 -0
- package/src/stories/collapsible.stories.tsx +69 -0
- package/src/stories/combobox.stories.tsx +214 -0
- package/src/stories/command.stories.tsx +95 -0
- package/src/stories/copyable.stories.tsx +29 -0
- package/src/stories/description-list.stories.tsx +71 -0
- package/src/stories/dialog.stories.tsx +135 -0
- package/src/stories/dropdown-menu.stories.tsx +191 -0
- package/src/stories/form.stories.tsx +91 -0
- package/src/stories/input-group.stories.tsx +63 -0
- package/src/stories/input.stories.tsx +72 -0
- package/src/stories/label.stories.tsx +26 -0
- package/src/stories/ladle.css +3 -0
- package/src/stories/pagination.stories.tsx +35 -0
- package/src/stories/popover.stories.tsx +34 -0
- package/src/stories/radio-group.stories.tsx +59 -0
- package/src/stories/scroll-area.stories.tsx +43 -0
- package/src/stories/select.stories.tsx +95 -0
- package/src/stories/separator.stories.tsx +36 -0
- package/src/stories/sheet.stories.tsx +76 -0
- package/src/stories/sidebar.stories.tsx +255 -0
- package/src/stories/skeleton.stories.tsx +47 -0
- package/src/stories/sonner.stories.tsx +91 -0
- package/src/stories/spinner.stories.tsx +66 -0
- package/src/stories/status-dot.stories.tsx +27 -0
- package/src/stories/switch.stories.tsx +46 -0
- package/src/stories/table.stories.tsx +242 -0
- package/src/stories/tabs.stories.tsx +169 -0
- package/src/stories/tag.stories.tsx +82 -0
- package/src/stories/textarea.stories.tsx +60 -0
- package/src/stories/toggle-group.stories.tsx +142 -0
- package/src/stories/tooltip-icon-button.stories.tsx +59 -0
- package/src/stories/tooltip.stories.tsx +54 -0
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import { Plus } from "lucide-react";
|
|
2
|
+
|
|
3
|
+
import { Button } from "../components/button";
|
|
4
|
+
|
|
5
|
+
// Simulated states via className — matches Figma page layout:
|
|
6
|
+
// variants stacked top-to-bottom, states left-to-right.
|
|
7
|
+
|
|
8
|
+
const VARIANT_LABEL = "type-text-xs text-muted-foreground w-20 shrink-0";
|
|
9
|
+
const STATE_HEADER = "type-text-xs text-muted-foreground font-medium w-32 text-center";
|
|
10
|
+
const SECTION_HEADER = "type-text-xs text-muted-foreground font-semibold uppercase tracking-wide pt-4";
|
|
11
|
+
const ROW = "flex items-center gap-2";
|
|
12
|
+
const CELL = "flex w-32 items-center justify-center";
|
|
13
|
+
const ICON_CELL = "flex w-16 items-center justify-center";
|
|
14
|
+
const ICON_STATE_HEADER = "type-text-xs text-muted-foreground font-medium w-16 text-center";
|
|
15
|
+
|
|
16
|
+
export const AllVariants = () => {
|
|
17
|
+
return (
|
|
18
|
+
<div className="flex flex-col gap-3 p-8">
|
|
19
|
+
{/* ── Text buttons ────────────────────────────────────────────────── */}
|
|
20
|
+
<span className={SECTION_HEADER}>Text</span>
|
|
21
|
+
|
|
22
|
+
<div className={ROW}>
|
|
23
|
+
<div className={VARIANT_LABEL} />
|
|
24
|
+
<div className={STATE_HEADER}>Default</div>
|
|
25
|
+
<div className={STATE_HEADER}>Disabled</div>
|
|
26
|
+
<div className={STATE_HEADER}>Loading</div>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
{/* Primary */}
|
|
30
|
+
<div className={ROW}>
|
|
31
|
+
<span className={VARIANT_LABEL}>Primary</span>
|
|
32
|
+
<div className={CELL}>
|
|
33
|
+
<Button variant="primary" icon={<Plus />}>
|
|
34
|
+
Button CTA
|
|
35
|
+
</Button>
|
|
36
|
+
</div>
|
|
37
|
+
<div className={CELL}>
|
|
38
|
+
<Button variant="primary" icon={<Plus />} disabled>
|
|
39
|
+
Button CTA
|
|
40
|
+
</Button>
|
|
41
|
+
</div>
|
|
42
|
+
<div className={CELL}>
|
|
43
|
+
<Button variant="primary" icon={<Plus />} loading>
|
|
44
|
+
Button CTA
|
|
45
|
+
</Button>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
{/* Secondary */}
|
|
50
|
+
<div className={ROW}>
|
|
51
|
+
<span className={VARIANT_LABEL}>Secondary</span>
|
|
52
|
+
<div className={CELL}>
|
|
53
|
+
<Button variant="secondary" icon={<Plus />}>
|
|
54
|
+
Button CTA
|
|
55
|
+
</Button>
|
|
56
|
+
</div>
|
|
57
|
+
<div className={CELL}>
|
|
58
|
+
<Button variant="secondary" icon={<Plus />} disabled>
|
|
59
|
+
Button CTA
|
|
60
|
+
</Button>
|
|
61
|
+
</div>
|
|
62
|
+
<div className={CELL}>
|
|
63
|
+
<Button variant="secondary" icon={<Plus />} loading>
|
|
64
|
+
Button CTA
|
|
65
|
+
</Button>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
{/* Tertiary */}
|
|
70
|
+
<div className={ROW}>
|
|
71
|
+
<span className={VARIANT_LABEL}>Tertiary</span>
|
|
72
|
+
<div className={CELL}>
|
|
73
|
+
<Button variant="tertiary" icon={<Plus />}>
|
|
74
|
+
Button CTA
|
|
75
|
+
</Button>
|
|
76
|
+
</div>
|
|
77
|
+
<div className={CELL}>
|
|
78
|
+
<Button variant="tertiary" icon={<Plus />} disabled>
|
|
79
|
+
Button CTA
|
|
80
|
+
</Button>
|
|
81
|
+
</div>
|
|
82
|
+
<div className={CELL}>
|
|
83
|
+
<Button variant="tertiary" icon={<Plus />} loading>
|
|
84
|
+
Button CTA
|
|
85
|
+
</Button>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
{/* Link color */}
|
|
90
|
+
<div className={ROW}>
|
|
91
|
+
<span className={VARIANT_LABEL}>Link</span>
|
|
92
|
+
<div className={CELL}>
|
|
93
|
+
<Button variant="link">Button CTA</Button>
|
|
94
|
+
</div>
|
|
95
|
+
<div className={CELL}>
|
|
96
|
+
<Button variant="link" disabled>
|
|
97
|
+
Button CTA
|
|
98
|
+
</Button>
|
|
99
|
+
</div>
|
|
100
|
+
<div className={CELL}>
|
|
101
|
+
<Button variant="link" loading>
|
|
102
|
+
Button CTA
|
|
103
|
+
</Button>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
{/* Link gray */}
|
|
108
|
+
<div className={ROW}>
|
|
109
|
+
<span className={VARIANT_LABEL}>Link muted</span>
|
|
110
|
+
<div className={CELL}>
|
|
111
|
+
<Button variant="link-muted">Button CTA</Button>
|
|
112
|
+
</div>
|
|
113
|
+
<div className={CELL}>
|
|
114
|
+
<Button variant="link-muted" disabled>
|
|
115
|
+
Button CTA
|
|
116
|
+
</Button>
|
|
117
|
+
</div>
|
|
118
|
+
<div className={CELL}>
|
|
119
|
+
<Button variant="link-muted" loading>
|
|
120
|
+
Button CTA
|
|
121
|
+
</Button>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
{/* Destructive */}
|
|
126
|
+
<div className={ROW}>
|
|
127
|
+
<span className={VARIANT_LABEL}>Destructive</span>
|
|
128
|
+
<div className={CELL}>
|
|
129
|
+
<Button variant="destructive" icon={<Plus />}>
|
|
130
|
+
Button CTA
|
|
131
|
+
</Button>
|
|
132
|
+
</div>
|
|
133
|
+
<div className={CELL}>
|
|
134
|
+
<Button variant="destructive" icon={<Plus />} disabled>
|
|
135
|
+
Button CTA
|
|
136
|
+
</Button>
|
|
137
|
+
</div>
|
|
138
|
+
<div className={CELL}>
|
|
139
|
+
<Button variant="destructive" icon={<Plus />} loading>
|
|
140
|
+
Button CTA
|
|
141
|
+
</Button>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
|
|
145
|
+
{/* ── Icon only ───────────────────────────────────────────────────── */}
|
|
146
|
+
<span className={SECTION_HEADER}>Icon only</span>
|
|
147
|
+
|
|
148
|
+
<div className={ROW}>
|
|
149
|
+
<div className={VARIANT_LABEL} />
|
|
150
|
+
<div className={ICON_STATE_HEADER}>Default</div>
|
|
151
|
+
<div className={ICON_STATE_HEADER}>Hover</div>
|
|
152
|
+
<div className={ICON_STATE_HEADER}>Disabled</div>
|
|
153
|
+
<div className={ICON_STATE_HEADER}>Loading</div>
|
|
154
|
+
</div>
|
|
155
|
+
|
|
156
|
+
<div className={ROW}>
|
|
157
|
+
<span className={VARIANT_LABEL}>Primary</span>
|
|
158
|
+
<div className={ICON_CELL}>
|
|
159
|
+
<Button size="icon" variant="primary" icon={<Plus />} aria-label="Add" />
|
|
160
|
+
</div>
|
|
161
|
+
<div className={ICON_CELL}>
|
|
162
|
+
<Button size="icon" variant="primary" icon={<Plus />} className="bg-primary-hover" aria-label="Add" />
|
|
163
|
+
</div>
|
|
164
|
+
<div className={ICON_CELL}>
|
|
165
|
+
<Button size="icon" variant="primary" icon={<Plus />} disabled aria-label="Add" />
|
|
166
|
+
</div>
|
|
167
|
+
<div className={ICON_CELL}>
|
|
168
|
+
<Button size="icon" variant="primary" icon={<Plus />} loading aria-label="Add" />
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
|
|
172
|
+
<div className={ROW}>
|
|
173
|
+
<span className={VARIANT_LABEL}>Secondary</span>
|
|
174
|
+
<div className={ICON_CELL}>
|
|
175
|
+
<Button size="icon" variant="secondary" icon={<Plus />} aria-label="Add" />
|
|
176
|
+
</div>
|
|
177
|
+
<div className={ICON_CELL}>
|
|
178
|
+
<Button
|
|
179
|
+
size="icon"
|
|
180
|
+
variant="secondary"
|
|
181
|
+
icon={<Plus />}
|
|
182
|
+
className="bg-background-hover text-muted-foreground-hover"
|
|
183
|
+
aria-label="Add"
|
|
184
|
+
/>
|
|
185
|
+
</div>
|
|
186
|
+
<div className={ICON_CELL}>
|
|
187
|
+
<Button size="icon" variant="secondary" icon={<Plus />} disabled aria-label="Add" />
|
|
188
|
+
</div>
|
|
189
|
+
<div className={ICON_CELL}>
|
|
190
|
+
<Button size="icon" variant="secondary" icon={<Plus />} loading aria-label="Add" />
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
|
|
194
|
+
<div className={ROW}>
|
|
195
|
+
<span className={VARIANT_LABEL}>Tertiary</span>
|
|
196
|
+
<div className={ICON_CELL}>
|
|
197
|
+
<Button size="icon" variant="tertiary" icon={<Plus />} aria-label="Add" />
|
|
198
|
+
</div>
|
|
199
|
+
<div className={ICON_CELL}>
|
|
200
|
+
<Button
|
|
201
|
+
size="icon"
|
|
202
|
+
variant="tertiary"
|
|
203
|
+
icon={<Plus />}
|
|
204
|
+
className="bg-background-hover text-muted-foreground-hover"
|
|
205
|
+
aria-label="Add"
|
|
206
|
+
/>
|
|
207
|
+
</div>
|
|
208
|
+
<div className={ICON_CELL}>
|
|
209
|
+
<Button size="icon" variant="tertiary" icon={<Plus />} disabled aria-label="Add" />
|
|
210
|
+
</div>
|
|
211
|
+
<div className={ICON_CELL}>
|
|
212
|
+
<Button size="icon" variant="tertiary" icon={<Plus />} loading aria-label="Add" />
|
|
213
|
+
</div>
|
|
214
|
+
</div>
|
|
215
|
+
|
|
216
|
+
{/* ── Icon rounded ────────────────────────────────────────────────── */}
|
|
217
|
+
<span className={SECTION_HEADER}>Icon rounded</span>
|
|
218
|
+
|
|
219
|
+
<div className={ROW}>
|
|
220
|
+
<div className={VARIANT_LABEL} />
|
|
221
|
+
<div className={ICON_STATE_HEADER}>Default</div>
|
|
222
|
+
<div className={ICON_STATE_HEADER}>Hover</div>
|
|
223
|
+
<div className={ICON_STATE_HEADER}>Disabled</div>
|
|
224
|
+
<div className={ICON_STATE_HEADER}>Loading</div>
|
|
225
|
+
</div>
|
|
226
|
+
|
|
227
|
+
<div className={ROW}>
|
|
228
|
+
<span className={VARIANT_LABEL}>Primary</span>
|
|
229
|
+
<div className={ICON_CELL}>
|
|
230
|
+
<Button size="icon-rounded" variant="primary" icon={<Plus />} aria-label="Add" />
|
|
231
|
+
</div>
|
|
232
|
+
<div className={ICON_CELL}>
|
|
233
|
+
<Button size="icon-rounded" variant="primary" icon={<Plus />} className="bg-primary-hover" aria-label="Add" />
|
|
234
|
+
</div>
|
|
235
|
+
<div className={ICON_CELL}>
|
|
236
|
+
<Button size="icon-rounded" variant="primary" icon={<Plus />} disabled aria-label="Add" />
|
|
237
|
+
</div>
|
|
238
|
+
<div className={ICON_CELL}>
|
|
239
|
+
<Button size="icon-rounded" variant="primary" icon={<Plus />} loading aria-label="Add" />
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
242
|
+
|
|
243
|
+
<div className={ROW}>
|
|
244
|
+
<span className={VARIANT_LABEL}>Secondary</span>
|
|
245
|
+
<div className={ICON_CELL}>
|
|
246
|
+
<Button size="icon-rounded" variant="secondary" icon={<Plus />} aria-label="Add" />
|
|
247
|
+
</div>
|
|
248
|
+
<div className={ICON_CELL}>
|
|
249
|
+
<Button
|
|
250
|
+
size="icon-rounded"
|
|
251
|
+
variant="secondary"
|
|
252
|
+
icon={<Plus />}
|
|
253
|
+
className="bg-background-hover text-muted-foreground-hover"
|
|
254
|
+
aria-label="Add"
|
|
255
|
+
/>
|
|
256
|
+
</div>
|
|
257
|
+
<div className={ICON_CELL}>
|
|
258
|
+
<Button size="icon-rounded" variant="secondary" icon={<Plus />} disabled aria-label="Add" />
|
|
259
|
+
</div>
|
|
260
|
+
<div className={ICON_CELL}>
|
|
261
|
+
<Button size="icon-rounded" variant="secondary" icon={<Plus />} loading aria-label="Add" />
|
|
262
|
+
</div>
|
|
263
|
+
</div>
|
|
264
|
+
|
|
265
|
+
<div className={ROW}>
|
|
266
|
+
<span className={VARIANT_LABEL}>Tertiary</span>
|
|
267
|
+
<div className={ICON_CELL}>
|
|
268
|
+
<Button size="icon-rounded" variant="tertiary" icon={<Plus />} aria-label="Add" />
|
|
269
|
+
</div>
|
|
270
|
+
<div className={ICON_CELL}>
|
|
271
|
+
<Button
|
|
272
|
+
size="icon-rounded"
|
|
273
|
+
variant="tertiary"
|
|
274
|
+
icon={<Plus />}
|
|
275
|
+
className="bg-background-hover text-muted-foreground-hover"
|
|
276
|
+
aria-label="Add"
|
|
277
|
+
/>
|
|
278
|
+
</div>
|
|
279
|
+
<div className={ICON_CELL}>
|
|
280
|
+
<Button size="icon-rounded" variant="tertiary" icon={<Plus />} disabled aria-label="Add" />
|
|
281
|
+
</div>
|
|
282
|
+
<div className={ICON_CELL}>
|
|
283
|
+
<Button size="icon-rounded" variant="tertiary" icon={<Plus />} loading aria-label="Add" />
|
|
284
|
+
</div>
|
|
285
|
+
</div>
|
|
286
|
+
|
|
287
|
+
{/* ── Pill ──────────────────────────────────────────────────────────── */}
|
|
288
|
+
<span className={SECTION_HEADER}>Pill</span>
|
|
289
|
+
|
|
290
|
+
<div className="flex items-center gap-3">
|
|
291
|
+
<Button size="pill" variant="primary">
|
|
292
|
+
Label
|
|
293
|
+
</Button>
|
|
294
|
+
<Button size="pill" variant="secondary">
|
|
295
|
+
Label
|
|
296
|
+
</Button>
|
|
297
|
+
<Button size="pill" variant="secondary" disabled>
|
|
298
|
+
Label
|
|
299
|
+
</Button>
|
|
300
|
+
<Button size="pill" variant="secondary" loading>
|
|
301
|
+
Label
|
|
302
|
+
</Button>
|
|
303
|
+
</div>
|
|
304
|
+
|
|
305
|
+
{/* ── With icon (leading) ──────────────────────────────────────────── */}
|
|
306
|
+
<span className={SECTION_HEADER}>With icon</span>
|
|
307
|
+
|
|
308
|
+
<div className="flex items-center gap-3">
|
|
309
|
+
<Button variant="primary" icon={<Plus />}>
|
|
310
|
+
Button CTA
|
|
311
|
+
</Button>
|
|
312
|
+
<Button variant="secondary" icon={<Plus />}>
|
|
313
|
+
Button CTA
|
|
314
|
+
</Button>
|
|
315
|
+
<Button variant="tertiary" icon={<Plus />}>
|
|
316
|
+
Button CTA
|
|
317
|
+
</Button>
|
|
318
|
+
<Button variant="link" icon={<Plus />}>
|
|
319
|
+
Button CTA
|
|
320
|
+
</Button>
|
|
321
|
+
<Button variant="link-muted" icon={<Plus />}>
|
|
322
|
+
Button CTA
|
|
323
|
+
</Button>
|
|
324
|
+
</div>
|
|
325
|
+
|
|
326
|
+
{/* ── asChild ─────────────────────────────────────────────────────── */}
|
|
327
|
+
<span className={SECTION_HEADER}>asChild</span>
|
|
328
|
+
|
|
329
|
+
<div className="flex items-center gap-3">
|
|
330
|
+
<Button asChild variant="primary">
|
|
331
|
+
<a href="/docs">Rendered as <a></a>
|
|
332
|
+
</Button>
|
|
333
|
+
<Button asChild variant="secondary">
|
|
334
|
+
<a href="/docs">Rendered as <a></a>
|
|
335
|
+
</Button>
|
|
336
|
+
<Button asChild variant="tertiary">
|
|
337
|
+
<a href="/docs">Rendered as <a></a>
|
|
338
|
+
</Button>
|
|
339
|
+
</div>
|
|
340
|
+
</div>
|
|
341
|
+
);
|
|
342
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { Story } from "@ladle/react";
|
|
2
|
+
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "../components/card";
|
|
3
|
+
|
|
4
|
+
export const AllVariants: Story = () => (
|
|
5
|
+
<div className="flex flex-col gap-6 max-w-md">
|
|
6
|
+
<div className="flex flex-col gap-1.5">
|
|
7
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Basic card</p>
|
|
8
|
+
<Card>
|
|
9
|
+
<CardHeader>
|
|
10
|
+
<CardTitle>Project Settings</CardTitle>
|
|
11
|
+
<CardDescription>Manage your project configuration and preferences.</CardDescription>
|
|
12
|
+
</CardHeader>
|
|
13
|
+
<CardContent>
|
|
14
|
+
<p className="type-text-sm text-muted-foreground">
|
|
15
|
+
Configure your project's name, description, and other settings.
|
|
16
|
+
</p>
|
|
17
|
+
</CardContent>
|
|
18
|
+
</Card>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<div className="flex flex-col gap-1.5">
|
|
22
|
+
<p className="type-text-xs font-medium text-subtle-foreground">With footer</p>
|
|
23
|
+
<Card>
|
|
24
|
+
<CardHeader>
|
|
25
|
+
<CardTitle>Danger Zone</CardTitle>
|
|
26
|
+
<CardDescription>Irreversible actions for this project.</CardDescription>
|
|
27
|
+
</CardHeader>
|
|
28
|
+
<CardContent>
|
|
29
|
+
<p className="type-text-sm text-muted-foreground">
|
|
30
|
+
Deleting a project removes all associated data permanently.
|
|
31
|
+
</p>
|
|
32
|
+
</CardContent>
|
|
33
|
+
<CardFooter className="justify-end gap-3">
|
|
34
|
+
<button type="button" className="type-text-sm font-medium text-muted-foreground">
|
|
35
|
+
Cancel
|
|
36
|
+
</button>
|
|
37
|
+
<button type="button" className="type-text-sm font-medium text-destructive">
|
|
38
|
+
Delete Project
|
|
39
|
+
</button>
|
|
40
|
+
</CardFooter>
|
|
41
|
+
</Card>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<div className="flex flex-col gap-1.5">
|
|
45
|
+
<p className="type-text-xs font-medium text-subtle-foreground">With action slot</p>
|
|
46
|
+
<Card>
|
|
47
|
+
<CardHeader>
|
|
48
|
+
<CardTitle>Environment Variables</CardTitle>
|
|
49
|
+
<CardDescription>Secrets and configuration for your deployment.</CardDescription>
|
|
50
|
+
<CardAction>
|
|
51
|
+
<button type="button" className="type-text-sm font-medium text-primary">
|
|
52
|
+
Edit
|
|
53
|
+
</button>
|
|
54
|
+
</CardAction>
|
|
55
|
+
</CardHeader>
|
|
56
|
+
<CardContent>
|
|
57
|
+
<p className="type-text-sm text-muted-foreground">3 variables configured</p>
|
|
58
|
+
</CardContent>
|
|
59
|
+
</Card>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<div className="flex flex-col gap-1.5">
|
|
63
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Content only (minimal)</p>
|
|
64
|
+
<Card>
|
|
65
|
+
<CardContent>
|
|
66
|
+
<p className="type-text-sm text-muted-foreground">A card with only content, no header or footer.</p>
|
|
67
|
+
</CardContent>
|
|
68
|
+
</Card>
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
<div className="flex flex-col gap-1.5">
|
|
72
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Header with border separator</p>
|
|
73
|
+
<Card>
|
|
74
|
+
<CardHeader className="border-b">
|
|
75
|
+
<CardTitle>API Keys</CardTitle>
|
|
76
|
+
<CardDescription>Manage access tokens for external integrations.</CardDescription>
|
|
77
|
+
</CardHeader>
|
|
78
|
+
<CardContent>
|
|
79
|
+
<p className="type-text-sm text-muted-foreground">No API keys configured yet.</p>
|
|
80
|
+
</CardContent>
|
|
81
|
+
<CardFooter className="border-t justify-end">
|
|
82
|
+
<button type="button" className="type-text-sm font-medium text-primary">
|
|
83
|
+
Create Key
|
|
84
|
+
</button>
|
|
85
|
+
</CardFooter>
|
|
86
|
+
</Card>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
);
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Story } from "@ladle/react";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { Checkbox } from "../components/checkbox";
|
|
4
|
+
import { Label } from "../components/label";
|
|
5
|
+
|
|
6
|
+
export const AllVariants: Story = () => {
|
|
7
|
+
const [indeterminate, setIndeterminate] = useState<boolean | "indeterminate">("indeterminate");
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<div className="flex flex-col gap-6">
|
|
11
|
+
<div className="flex flex-col gap-1.5">
|
|
12
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Unchecked</p>
|
|
13
|
+
<Checkbox />
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<div className="flex flex-col gap-1.5">
|
|
17
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Checked</p>
|
|
18
|
+
<Checkbox defaultChecked />
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<div className="flex flex-col gap-1.5">
|
|
22
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Indeterminate</p>
|
|
23
|
+
<Checkbox checked={indeterminate} onCheckedChange={setIndeterminate} />
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<div className="flex flex-col gap-1.5">
|
|
27
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Disabled (unchecked)</p>
|
|
28
|
+
<Checkbox disabled />
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<div className="flex flex-col gap-1.5">
|
|
32
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Disabled (checked)</p>
|
|
33
|
+
<Checkbox disabled defaultChecked />
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div className="flex flex-col gap-1.5">
|
|
37
|
+
<p className="type-text-xs font-medium text-subtle-foreground">With label</p>
|
|
38
|
+
<div className="flex items-center gap-2">
|
|
39
|
+
<Checkbox id="with-label" />
|
|
40
|
+
<Label htmlFor="with-label">Remember me</Label>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<div className="flex flex-col gap-1.5">
|
|
45
|
+
<p className="type-text-xs font-medium text-subtle-foreground">With label and description</p>
|
|
46
|
+
<div className="flex gap-2">
|
|
47
|
+
<Checkbox id="with-description" className="mt-0.5" />
|
|
48
|
+
<div className="flex flex-col">
|
|
49
|
+
<Label htmlFor="with-description">Remember me</Label>
|
|
50
|
+
<p className="type-text-sm text-subtle-foreground">Save my login details for next time.</p>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Story } from "@ladle/react";
|
|
2
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { Button } from "../components/button";
|
|
5
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../components/collapsible";
|
|
6
|
+
|
|
7
|
+
export const AllVariants: Story = () => {
|
|
8
|
+
const [defaultOpen, setDefaultOpen] = useState(true);
|
|
9
|
+
const [controlledOpen, setControlledOpen] = useState(false);
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<div className="flex flex-col gap-8 p-6">
|
|
13
|
+
<div className="flex flex-col gap-1.5">
|
|
14
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Default open</p>
|
|
15
|
+
<Collapsible open={defaultOpen} onOpenChange={setDefaultOpen}>
|
|
16
|
+
<CollapsibleTrigger asChild>
|
|
17
|
+
<Button variant="secondary" className="w-full justify-between">
|
|
18
|
+
Toggle section
|
|
19
|
+
<ChevronDownIcon
|
|
20
|
+
className={`size-4 transition-transform duration-200 ${defaultOpen ? "rotate-180" : ""}`}
|
|
21
|
+
/>
|
|
22
|
+
</Button>
|
|
23
|
+
</CollapsibleTrigger>
|
|
24
|
+
<CollapsibleContent className="pt-2">
|
|
25
|
+
<div className="rounded-md border border-border p-4 type-text-sm text-muted-foreground">
|
|
26
|
+
This content is visible by default and can be toggled.
|
|
27
|
+
</div>
|
|
28
|
+
</CollapsibleContent>
|
|
29
|
+
</Collapsible>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div className="flex flex-col gap-1.5">
|
|
33
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Collapsed by default</p>
|
|
34
|
+
<Collapsible open={controlledOpen} onOpenChange={setControlledOpen}>
|
|
35
|
+
<CollapsibleTrigger asChild>
|
|
36
|
+
<Button variant="secondary" className="w-full justify-between">
|
|
37
|
+
Show more details
|
|
38
|
+
<ChevronDownIcon
|
|
39
|
+
className={`size-4 transition-transform duration-200 ${controlledOpen ? "rotate-180" : ""}`}
|
|
40
|
+
/>
|
|
41
|
+
</Button>
|
|
42
|
+
</CollapsibleTrigger>
|
|
43
|
+
<CollapsibleContent className="pt-2">
|
|
44
|
+
<div className="rounded-md border border-border p-4 type-text-sm text-muted-foreground">
|
|
45
|
+
Hidden content revealed on click.
|
|
46
|
+
</div>
|
|
47
|
+
</CollapsibleContent>
|
|
48
|
+
</Collapsible>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<div className="flex flex-col gap-1.5">
|
|
52
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Disabled</p>
|
|
53
|
+
<Collapsible disabled>
|
|
54
|
+
<CollapsibleTrigger asChild>
|
|
55
|
+
<Button variant="secondary" className="w-full justify-between" disabled>
|
|
56
|
+
Cannot toggle
|
|
57
|
+
<ChevronDownIcon className="size-4" />
|
|
58
|
+
</Button>
|
|
59
|
+
</CollapsibleTrigger>
|
|
60
|
+
<CollapsibleContent className="pt-2">
|
|
61
|
+
<div className="rounded-md border border-border p-4 type-text-sm text-muted-foreground">
|
|
62
|
+
This content is not reachable.
|
|
63
|
+
</div>
|
|
64
|
+
</CollapsibleContent>
|
|
65
|
+
</Collapsible>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
};
|