@alpic-ai/ui 0.0.0-dev.4a35dc7 → 0.0.0-dev.85c8341
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/accordion-card.d.mts +1 -1
- package/dist/components/accordion.d.mts +1 -1
- package/dist/components/alert.d.mts +1 -1
- package/dist/components/attachment-tile.mjs +1 -1
- package/dist/components/avatar.d.mts +1 -1
- package/dist/components/breadcrumb.d.mts +1 -1
- package/dist/components/button.d.mts +1 -1
- package/dist/components/card.d.mts +1 -1
- package/dist/components/checkbox.d.mts +1 -1
- package/dist/components/collapsible.d.mts +1 -1
- package/dist/components/combobox.d.mts +1 -1
- package/dist/components/combobox.mjs +1 -1
- package/dist/components/command.d.mts +1 -1
- package/dist/components/copyable.d.mts +1 -1
- package/dist/components/copyable.mjs +1 -1
- package/dist/components/description-list.d.mts +1 -1
- package/dist/components/dialog.d.mts +1 -1
- package/dist/components/dropdown-menu.d.mts +1 -1
- package/dist/components/form.d.mts +119 -0
- package/dist/components/form.mjs +192 -0
- package/dist/components/input-group.d.mts +1 -1
- package/dist/components/input.d.mts +3 -1
- package/dist/components/input.mjs +20 -11
- package/dist/components/label.d.mts +1 -1
- package/dist/components/pagination.d.mts +1 -1
- package/dist/components/popover.d.mts +1 -1
- package/dist/components/radio-group.d.mts +1 -1
- package/dist/components/scroll-area.d.mts +1 -1
- package/dist/components/select-trigger-variants.mjs +1 -0
- package/dist/components/select.d.mts +1 -1
- package/dist/components/separator.d.mts +1 -1
- package/dist/components/sheet.d.mts +1 -1
- package/dist/components/sidebar.d.mts +1 -1
- package/dist/components/sidebar.mjs +2 -2
- package/dist/components/sonner.d.mts +1 -1
- package/dist/components/switch.d.mts +1 -1
- package/dist/components/table.d.mts +1 -1
- package/dist/components/tabs.d.mts +1 -1
- package/dist/components/tabs.mjs +1 -1
- package/dist/components/textarea.d.mts +3 -1
- package/dist/components/textarea.mjs +20 -11
- package/dist/components/toggle-group.d.mts +1 -1
- package/dist/components/toggle-group.mjs +1 -1
- package/dist/components/tooltip-icon-button.mjs +1 -1
- package/dist/components/tooltip.d.mts +1 -1
- package/package.json +4 -5
- 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/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
- package/README.md +0 -33
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import type { Story } from "@ladle/react";
|
|
2
|
+
import { GitBranch, Globe, Plus } from "lucide-react";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import {
|
|
5
|
+
Combobox,
|
|
6
|
+
ComboboxContent,
|
|
7
|
+
ComboboxEmpty,
|
|
8
|
+
ComboboxGroup,
|
|
9
|
+
ComboboxItem,
|
|
10
|
+
ComboboxItemText,
|
|
11
|
+
ComboboxList,
|
|
12
|
+
ComboboxSearch,
|
|
13
|
+
ComboboxSeparator,
|
|
14
|
+
ComboboxTrigger,
|
|
15
|
+
} from "../components/combobox";
|
|
16
|
+
import { CommandItem } from "../components/command";
|
|
17
|
+
|
|
18
|
+
/* ── With search ──────────────────────────────────────────────────────────── */
|
|
19
|
+
|
|
20
|
+
const branches = ["main", "develop", "feature/auth", "feature/dashboard", "fix/login-bug", "release/v2.0"];
|
|
21
|
+
|
|
22
|
+
function SearchCombobox() {
|
|
23
|
+
const [value, setValue] = useState<string | null>("main");
|
|
24
|
+
return (
|
|
25
|
+
<Combobox value={value} onValueChange={setValue}>
|
|
26
|
+
<ComboboxTrigger size="md" placeholder="Select branch..." className="w-full">
|
|
27
|
+
<GitBranch className="size-4" />
|
|
28
|
+
{value}
|
|
29
|
+
</ComboboxTrigger>
|
|
30
|
+
<ComboboxContent>
|
|
31
|
+
<ComboboxSearch placeholder="Search branches..." />
|
|
32
|
+
<ComboboxList>
|
|
33
|
+
<ComboboxEmpty>No branches found.</ComboboxEmpty>
|
|
34
|
+
<ComboboxGroup>
|
|
35
|
+
{branches.map((branch) => (
|
|
36
|
+
<ComboboxItem key={branch} itemValue={branch}>
|
|
37
|
+
{branch}
|
|
38
|
+
</ComboboxItem>
|
|
39
|
+
))}
|
|
40
|
+
</ComboboxGroup>
|
|
41
|
+
</ComboboxList>
|
|
42
|
+
</ComboboxContent>
|
|
43
|
+
</Combobox>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* ── Custom trigger content (avatars + supporting text) ──────────────────── */
|
|
48
|
+
|
|
49
|
+
const people = [
|
|
50
|
+
{ id: "olivia", name: "Olivia Rhye", handle: "@olivia" },
|
|
51
|
+
{ id: "phoenix", name: "Phoenix Baker", handle: "@phoenix" },
|
|
52
|
+
{ id: "lana", name: "Lana Steiner", handle: "@lana" },
|
|
53
|
+
{ id: "demi", name: "Demi Wilkinson", handle: "@demi" },
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
function AvatarCombobox() {
|
|
57
|
+
const [value, setValue] = useState<string | null>("olivia");
|
|
58
|
+
const selected = people.find((person) => person.id === value);
|
|
59
|
+
return (
|
|
60
|
+
<Combobox value={value} onValueChange={setValue}>
|
|
61
|
+
<ComboboxTrigger size="md" placeholder="Select team member..." className="w-full">
|
|
62
|
+
{selected && (
|
|
63
|
+
<>
|
|
64
|
+
<div className="flex size-5 items-center justify-center rounded-full bg-primary text-primary-foreground type-text-xs font-semibold">
|
|
65
|
+
{selected.name.charAt(0)}
|
|
66
|
+
</div>
|
|
67
|
+
{selected.name}
|
|
68
|
+
<ComboboxItemText>{selected.handle}</ComboboxItemText>
|
|
69
|
+
</>
|
|
70
|
+
)}
|
|
71
|
+
</ComboboxTrigger>
|
|
72
|
+
<ComboboxContent>
|
|
73
|
+
<ComboboxSearch placeholder="Search people..." />
|
|
74
|
+
<ComboboxList>
|
|
75
|
+
<ComboboxEmpty>No one found.</ComboboxEmpty>
|
|
76
|
+
<ComboboxGroup>
|
|
77
|
+
{people.map((person) => (
|
|
78
|
+
<ComboboxItem key={person.id} itemValue={person.id}>
|
|
79
|
+
<div className="flex size-5 items-center justify-center rounded-full bg-primary text-primary-foreground type-text-xs font-semibold">
|
|
80
|
+
{person.name.charAt(0)}
|
|
81
|
+
</div>
|
|
82
|
+
{person.name}
|
|
83
|
+
<ComboboxItemText>{person.handle}</ComboboxItemText>
|
|
84
|
+
</ComboboxItem>
|
|
85
|
+
))}
|
|
86
|
+
</ComboboxGroup>
|
|
87
|
+
</ComboboxList>
|
|
88
|
+
</ComboboxContent>
|
|
89
|
+
</Combobox>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* ── With CommandItem action ─────────────────────────────────────────────── */
|
|
94
|
+
|
|
95
|
+
const namespaces = [
|
|
96
|
+
{ id: "acme", name: "acme-corp" },
|
|
97
|
+
{ id: "personal", name: "johndoe" },
|
|
98
|
+
];
|
|
99
|
+
|
|
100
|
+
function CommandActionCombobox() {
|
|
101
|
+
const [value, setValue] = useState<string | null>("acme");
|
|
102
|
+
const selected = namespaces.find((ns) => ns.id === value);
|
|
103
|
+
return (
|
|
104
|
+
<Combobox value={value} onValueChange={setValue}>
|
|
105
|
+
<ComboboxTrigger size="sm" placeholder="Select account..." className="w-full">
|
|
106
|
+
{selected?.name}
|
|
107
|
+
</ComboboxTrigger>
|
|
108
|
+
<ComboboxContent>
|
|
109
|
+
<ComboboxList>
|
|
110
|
+
<ComboboxGroup>
|
|
111
|
+
{namespaces.map((ns) => (
|
|
112
|
+
<ComboboxItem key={ns.id} itemValue={ns.id}>
|
|
113
|
+
{ns.name}
|
|
114
|
+
</ComboboxItem>
|
|
115
|
+
))}
|
|
116
|
+
</ComboboxGroup>
|
|
117
|
+
<ComboboxSeparator />
|
|
118
|
+
<ComboboxGroup>
|
|
119
|
+
<CommandItem onSelect={() => alert("Add account action triggered")}>
|
|
120
|
+
<Plus />
|
|
121
|
+
<span>Add Account</span>
|
|
122
|
+
</CommandItem>
|
|
123
|
+
</ComboboxGroup>
|
|
124
|
+
</ComboboxList>
|
|
125
|
+
</ComboboxContent>
|
|
126
|
+
</Combobox>
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* ── Grouped with headings ───────────────────────────────────────────────── */
|
|
131
|
+
|
|
132
|
+
function GroupedCombobox() {
|
|
133
|
+
const [value, setValue] = useState<string | null>(null);
|
|
134
|
+
return (
|
|
135
|
+
<Combobox value={value} onValueChange={setValue}>
|
|
136
|
+
<ComboboxTrigger size="md" placeholder="Select a region..." className="w-full">
|
|
137
|
+
<Globe className="size-4" />
|
|
138
|
+
{value}
|
|
139
|
+
</ComboboxTrigger>
|
|
140
|
+
<ComboboxContent>
|
|
141
|
+
<ComboboxList>
|
|
142
|
+
<ComboboxGroup heading="North America">
|
|
143
|
+
<ComboboxItem itemValue="us-east-1">US East (N. Virginia)</ComboboxItem>
|
|
144
|
+
<ComboboxItem itemValue="us-west-2">US West (Oregon)</ComboboxItem>
|
|
145
|
+
</ComboboxGroup>
|
|
146
|
+
<ComboboxSeparator />
|
|
147
|
+
<ComboboxGroup heading="Europe">
|
|
148
|
+
<ComboboxItem itemValue="eu-west-1">EU West (Ireland)</ComboboxItem>
|
|
149
|
+
<ComboboxItem itemValue="eu-central-1">EU Central (Frankfurt)</ComboboxItem>
|
|
150
|
+
</ComboboxGroup>
|
|
151
|
+
</ComboboxList>
|
|
152
|
+
</ComboboxContent>
|
|
153
|
+
</Combobox>
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* ── Multi-select with tags ───────────────────────────────────────────────── */
|
|
158
|
+
|
|
159
|
+
function MultiCombobox() {
|
|
160
|
+
const [values, setValues] = useState<string[]>(["phoenix", "olivia"]);
|
|
161
|
+
return (
|
|
162
|
+
<Combobox multiple value={values} onValueChange={setValues}>
|
|
163
|
+
<ComboboxTrigger size="md" placeholder="Select team members..." className="w-full" />
|
|
164
|
+
<ComboboxContent>
|
|
165
|
+
<ComboboxSearch placeholder="Search people..." />
|
|
166
|
+
<ComboboxList>
|
|
167
|
+
<ComboboxEmpty>No one found.</ComboboxEmpty>
|
|
168
|
+
<ComboboxGroup>
|
|
169
|
+
{people.map((person) => (
|
|
170
|
+
<ComboboxItem key={person.id} itemValue={person.id}>
|
|
171
|
+
<div className="flex size-5 items-center justify-center rounded-full bg-primary text-primary-foreground type-text-xs font-semibold">
|
|
172
|
+
{person.name.charAt(0)}
|
|
173
|
+
</div>
|
|
174
|
+
{person.name}
|
|
175
|
+
<ComboboxItemText>{person.handle}</ComboboxItemText>
|
|
176
|
+
</ComboboxItem>
|
|
177
|
+
))}
|
|
178
|
+
</ComboboxGroup>
|
|
179
|
+
</ComboboxList>
|
|
180
|
+
</ComboboxContent>
|
|
181
|
+
</Combobox>
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/* ── Story ────────────────────────────────────────────────────────────────── */
|
|
186
|
+
|
|
187
|
+
export const AllVariants: Story = () => (
|
|
188
|
+
<div className="grid grid-cols-1 gap-10 p-10 md:grid-cols-2">
|
|
189
|
+
<div className="flex flex-col gap-1.5">
|
|
190
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Search with filtering</p>
|
|
191
|
+
<SearchCombobox />
|
|
192
|
+
</div>
|
|
193
|
+
|
|
194
|
+
<div className="flex flex-col gap-1.5">
|
|
195
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Custom trigger (avatars + supporting text)</p>
|
|
196
|
+
<AvatarCombobox />
|
|
197
|
+
</div>
|
|
198
|
+
|
|
199
|
+
<div className="flex flex-col gap-1.5">
|
|
200
|
+
<p className="type-text-xs font-medium text-subtle-foreground">CommandItem action (Add Account)</p>
|
|
201
|
+
<CommandActionCombobox />
|
|
202
|
+
</div>
|
|
203
|
+
|
|
204
|
+
<div className="flex flex-col gap-1.5">
|
|
205
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Grouped with headings</p>
|
|
206
|
+
<GroupedCombobox />
|
|
207
|
+
</div>
|
|
208
|
+
|
|
209
|
+
<div className="flex flex-col gap-1.5 md:col-span-2">
|
|
210
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Multi-select with tags</p>
|
|
211
|
+
<MultiCombobox />
|
|
212
|
+
</div>
|
|
213
|
+
</div>
|
|
214
|
+
);
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { Story } from "@ladle/react";
|
|
2
|
+
import { Calculator, Calendar, CreditCard, Settings, Smile, User } from "lucide-react";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
Command,
|
|
6
|
+
CommandEmpty,
|
|
7
|
+
CommandGroup,
|
|
8
|
+
CommandInput,
|
|
9
|
+
CommandItem,
|
|
10
|
+
CommandList,
|
|
11
|
+
CommandSeparator,
|
|
12
|
+
CommandShortcut,
|
|
13
|
+
} from "../components/command";
|
|
14
|
+
|
|
15
|
+
export const AllVariants: Story = () => (
|
|
16
|
+
<div className="flex flex-col gap-8">
|
|
17
|
+
<div className="flex flex-col gap-1.5">
|
|
18
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Default with groups</p>
|
|
19
|
+
<Command className="max-w-[400px] rounded-lg border shadow-md">
|
|
20
|
+
<CommandInput placeholder="Type a command or search..." />
|
|
21
|
+
<CommandList>
|
|
22
|
+
<CommandEmpty>No results found.</CommandEmpty>
|
|
23
|
+
<CommandGroup heading="Suggestions">
|
|
24
|
+
<CommandItem>
|
|
25
|
+
<Calendar />
|
|
26
|
+
<span>Calendar</span>
|
|
27
|
+
</CommandItem>
|
|
28
|
+
<CommandItem>
|
|
29
|
+
<Smile />
|
|
30
|
+
<span>Search Emoji</span>
|
|
31
|
+
</CommandItem>
|
|
32
|
+
<CommandItem>
|
|
33
|
+
<Calculator />
|
|
34
|
+
<span>Calculator</span>
|
|
35
|
+
</CommandItem>
|
|
36
|
+
</CommandGroup>
|
|
37
|
+
<CommandSeparator />
|
|
38
|
+
<CommandGroup heading="Settings">
|
|
39
|
+
<CommandItem>
|
|
40
|
+
<User />
|
|
41
|
+
<span>Profile</span>
|
|
42
|
+
<CommandShortcut>⌘P</CommandShortcut>
|
|
43
|
+
</CommandItem>
|
|
44
|
+
<CommandItem>
|
|
45
|
+
<CreditCard />
|
|
46
|
+
<span>Billing</span>
|
|
47
|
+
<CommandShortcut>⌘B</CommandShortcut>
|
|
48
|
+
</CommandItem>
|
|
49
|
+
<CommandItem>
|
|
50
|
+
<Settings />
|
|
51
|
+
<span>Settings</span>
|
|
52
|
+
<CommandShortcut>⌘S</CommandShortcut>
|
|
53
|
+
</CommandItem>
|
|
54
|
+
</CommandGroup>
|
|
55
|
+
</CommandList>
|
|
56
|
+
</Command>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<div className="flex flex-col gap-1.5">
|
|
60
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Disabled items</p>
|
|
61
|
+
<Command className="max-w-[400px] rounded-lg border shadow-md">
|
|
62
|
+
<CommandInput placeholder="Search..." />
|
|
63
|
+
<CommandList>
|
|
64
|
+
<CommandEmpty>No results found.</CommandEmpty>
|
|
65
|
+
<CommandGroup heading="Actions">
|
|
66
|
+
<CommandItem>
|
|
67
|
+
<Calendar />
|
|
68
|
+
<span>Available action</span>
|
|
69
|
+
</CommandItem>
|
|
70
|
+
<CommandItem disabled>
|
|
71
|
+
<Settings />
|
|
72
|
+
<span>Disabled action</span>
|
|
73
|
+
</CommandItem>
|
|
74
|
+
</CommandGroup>
|
|
75
|
+
</CommandList>
|
|
76
|
+
</Command>
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
<div className="flex flex-col gap-1.5">
|
|
80
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Empty state</p>
|
|
81
|
+
<Command className="max-w-[400px] rounded-lg border shadow-md">
|
|
82
|
+
<CommandInput placeholder="Search..." value="zzzzz" />
|
|
83
|
+
<CommandList>
|
|
84
|
+
<CommandEmpty>No results found.</CommandEmpty>
|
|
85
|
+
<CommandGroup heading="Items">
|
|
86
|
+
<CommandItem>
|
|
87
|
+
<Calendar />
|
|
88
|
+
<span>Calendar</span>
|
|
89
|
+
</CommandItem>
|
|
90
|
+
</CommandGroup>
|
|
91
|
+
</CommandList>
|
|
92
|
+
</Command>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Story } from "@ladle/react";
|
|
2
|
+
import { Copyable, CopyableUrl } from "../components/copyable";
|
|
3
|
+
|
|
4
|
+
export const AllVariants: Story = () => (
|
|
5
|
+
<div className="flex flex-col gap-6">
|
|
6
|
+
<div className="flex flex-col gap-1.5">
|
|
7
|
+
<p className="type-text-xs font-medium text-subtle-foreground">With plain text</p>
|
|
8
|
+
<Copyable content="sk-1234-abcd-5678">
|
|
9
|
+
<span className="type-text-sm font-mono">sk-1234-abcd-5678</span>
|
|
10
|
+
</Copyable>
|
|
11
|
+
</div>
|
|
12
|
+
<div className="flex flex-col gap-1.5">
|
|
13
|
+
<p className="type-text-xs font-medium text-subtle-foreground">With URL</p>
|
|
14
|
+
<Copyable content="https://api.example.com/v1">
|
|
15
|
+
<span className="type-text-sm font-semibold">api.example.com</span>
|
|
16
|
+
</Copyable>
|
|
17
|
+
</div>
|
|
18
|
+
<div className="flex flex-col gap-1.5">
|
|
19
|
+
<p className="type-text-xs font-medium text-subtle-foreground">With styled content</p>
|
|
20
|
+
<Copyable content="npm install @alpic/sdk">
|
|
21
|
+
<code className="type-text-sm rounded-sm bg-muted px-1.5 py-0.5 font-mono">npm install @alpic/sdk</code>
|
|
22
|
+
</Copyable>
|
|
23
|
+
</div>
|
|
24
|
+
<div className="flex flex-col gap-1.5">
|
|
25
|
+
<p className="type-text-xs font-medium text-subtle-foreground">CopyableUrl</p>
|
|
26
|
+
<CopyableUrl url={new URL("https://api.example.com/v1/mcp")} />
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { Story } from "@ladle/react";
|
|
2
|
+
import { DescriptionItem, DescriptionList, DescriptionTitle, DescriptionValue } from "../components/description-list";
|
|
3
|
+
|
|
4
|
+
export const AllVariants: Story = () => (
|
|
5
|
+
<div className="flex flex-col gap-10">
|
|
6
|
+
<div className="flex flex-col gap-1.5">
|
|
7
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Default — 4 columns on xl</p>
|
|
8
|
+
<DescriptionList>
|
|
9
|
+
<DescriptionItem>
|
|
10
|
+
<DescriptionTitle>Status</DescriptionTitle>
|
|
11
|
+
<DescriptionValue>Deployed</DescriptionValue>
|
|
12
|
+
</DescriptionItem>
|
|
13
|
+
<DescriptionItem>
|
|
14
|
+
<DescriptionTitle>Duration</DescriptionTitle>
|
|
15
|
+
<DescriptionValue>2m 34s</DescriptionValue>
|
|
16
|
+
</DescriptionItem>
|
|
17
|
+
<DescriptionItem>
|
|
18
|
+
<DescriptionTitle>Branch</DescriptionTitle>
|
|
19
|
+
<DescriptionValue>main</DescriptionValue>
|
|
20
|
+
</DescriptionItem>
|
|
21
|
+
<DescriptionItem>
|
|
22
|
+
<DescriptionTitle>Created by</DescriptionTitle>
|
|
23
|
+
<DescriptionValue>val</DescriptionValue>
|
|
24
|
+
</DescriptionItem>
|
|
25
|
+
</DescriptionList>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div className="flex flex-col gap-1.5">
|
|
29
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Spanning columns</p>
|
|
30
|
+
<DescriptionList>
|
|
31
|
+
<DescriptionItem className="xl:col-span-2">
|
|
32
|
+
<DescriptionTitle>Name</DescriptionTitle>
|
|
33
|
+
<DescriptionValue>Production Environment</DescriptionValue>
|
|
34
|
+
</DescriptionItem>
|
|
35
|
+
<DescriptionItem className="xl:col-span-2">
|
|
36
|
+
<DescriptionTitle>Live URL</DescriptionTitle>
|
|
37
|
+
<DescriptionValue>https://my-server.alpic.dev/sse</DescriptionValue>
|
|
38
|
+
</DescriptionItem>
|
|
39
|
+
</DescriptionList>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<div className="flex flex-col gap-1.5">
|
|
43
|
+
<p className="type-text-xs font-medium text-subtle-foreground">With muted placeholder values</p>
|
|
44
|
+
<DescriptionList>
|
|
45
|
+
<DescriptionItem>
|
|
46
|
+
<DescriptionTitle>Branch</DescriptionTitle>
|
|
47
|
+
<DescriptionValue className="text-muted-foreground">No branch tracked</DescriptionValue>
|
|
48
|
+
</DescriptionItem>
|
|
49
|
+
<DescriptionItem>
|
|
50
|
+
<DescriptionTitle>Domain</DescriptionTitle>
|
|
51
|
+
<DescriptionValue className="text-muted-foreground">No domain configured</DescriptionValue>
|
|
52
|
+
</DescriptionItem>
|
|
53
|
+
</DescriptionList>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<div className="flex flex-col gap-1.5">
|
|
57
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Truncation on long values</p>
|
|
58
|
+
<div className="max-w-md">
|
|
59
|
+
<DescriptionList className="grid-cols-1">
|
|
60
|
+
<DescriptionItem>
|
|
61
|
+
<DescriptionTitle>Commit message</DescriptionTitle>
|
|
62
|
+
<DescriptionValue>
|
|
63
|
+
fix: resolve issue with authentication middleware causing session tokens to be stored incorrectly in
|
|
64
|
+
production environments
|
|
65
|
+
</DescriptionValue>
|
|
66
|
+
</DescriptionItem>
|
|
67
|
+
</DescriptionList>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
);
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import type { Story } from "@ladle/react";
|
|
2
|
+
import { Button } from "../components/button";
|
|
3
|
+
import {
|
|
4
|
+
Dialog,
|
|
5
|
+
DialogClose,
|
|
6
|
+
DialogContent,
|
|
7
|
+
DialogDescription,
|
|
8
|
+
DialogFooter,
|
|
9
|
+
DialogHeader,
|
|
10
|
+
DialogTitle,
|
|
11
|
+
DialogTrigger,
|
|
12
|
+
} from "../components/dialog";
|
|
13
|
+
|
|
14
|
+
export const AllVariants: Story = () => (
|
|
15
|
+
<div className="flex flex-col gap-6">
|
|
16
|
+
<div className="flex flex-col gap-1.5">
|
|
17
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Small — Horizontal Footer</p>
|
|
18
|
+
<Dialog>
|
|
19
|
+
<DialogTrigger asChild>
|
|
20
|
+
<Button variant="secondary">Open Small Dialog</Button>
|
|
21
|
+
</DialogTrigger>
|
|
22
|
+
<DialogContent size="sm">
|
|
23
|
+
<DialogHeader>
|
|
24
|
+
<DialogTitle>Blog post published</DialogTitle>
|
|
25
|
+
<DialogDescription>
|
|
26
|
+
This blog post has been published. Team members will be able to edit this post and republish changes.
|
|
27
|
+
</DialogDescription>
|
|
28
|
+
</DialogHeader>
|
|
29
|
+
<DialogFooter layout="horizontal">
|
|
30
|
+
<DialogClose />
|
|
31
|
+
<Button>Confirm</Button>
|
|
32
|
+
</DialogFooter>
|
|
33
|
+
</DialogContent>
|
|
34
|
+
</Dialog>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div className="flex flex-col gap-1.5">
|
|
38
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Large — Horizontal Footer</p>
|
|
39
|
+
<Dialog>
|
|
40
|
+
<DialogTrigger asChild>
|
|
41
|
+
<Button variant="secondary">Open Large Dialog</Button>
|
|
42
|
+
</DialogTrigger>
|
|
43
|
+
<DialogContent size="lg">
|
|
44
|
+
<DialogHeader>
|
|
45
|
+
<DialogTitle>Blog post published</DialogTitle>
|
|
46
|
+
<DialogDescription>
|
|
47
|
+
This blog post has been published. Team members will be able to edit this post and republish changes.
|
|
48
|
+
</DialogDescription>
|
|
49
|
+
</DialogHeader>
|
|
50
|
+
<DialogFooter layout="horizontal">
|
|
51
|
+
<DialogClose />
|
|
52
|
+
<Button>Confirm</Button>
|
|
53
|
+
</DialogFooter>
|
|
54
|
+
</DialogContent>
|
|
55
|
+
</Dialog>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<div className="flex flex-col gap-1.5">
|
|
59
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Small — Vertical Footer</p>
|
|
60
|
+
<Dialog>
|
|
61
|
+
<DialogTrigger asChild>
|
|
62
|
+
<Button variant="secondary">Open Vertical Dialog</Button>
|
|
63
|
+
</DialogTrigger>
|
|
64
|
+
<DialogContent size="sm">
|
|
65
|
+
<DialogHeader>
|
|
66
|
+
<DialogTitle>Confirm action</DialogTitle>
|
|
67
|
+
<DialogDescription>Are you sure you want to proceed? This action cannot be undone.</DialogDescription>
|
|
68
|
+
</DialogHeader>
|
|
69
|
+
<DialogFooter layout="vertical">
|
|
70
|
+
<Button>Confirm</Button>
|
|
71
|
+
<DialogClose />
|
|
72
|
+
</DialogFooter>
|
|
73
|
+
</DialogContent>
|
|
74
|
+
</Dialog>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<div className="flex flex-col gap-1.5">
|
|
78
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Custom Cancel Label</p>
|
|
79
|
+
<Dialog>
|
|
80
|
+
<DialogTrigger asChild>
|
|
81
|
+
<Button variant="secondary">Open Custom Cancel</Button>
|
|
82
|
+
</DialogTrigger>
|
|
83
|
+
<DialogContent size="sm">
|
|
84
|
+
<DialogHeader>
|
|
85
|
+
<DialogTitle>Cancel invitation</DialogTitle>
|
|
86
|
+
<DialogDescription>Are you sure you want to cancel this invitation?</DialogDescription>
|
|
87
|
+
</DialogHeader>
|
|
88
|
+
<DialogFooter layout="horizontal">
|
|
89
|
+
<DialogClose>Keep</DialogClose>
|
|
90
|
+
<Button variant="destructive">Cancel Invitation</Button>
|
|
91
|
+
</DialogFooter>
|
|
92
|
+
</DialogContent>
|
|
93
|
+
</Dialog>
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
<div className="flex flex-col gap-1.5">
|
|
97
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Single CTA (No Cancel)</p>
|
|
98
|
+
<Dialog>
|
|
99
|
+
<DialogTrigger asChild>
|
|
100
|
+
<Button variant="secondary">Open (Single CTA)</Button>
|
|
101
|
+
</DialogTrigger>
|
|
102
|
+
<DialogContent size="sm" showCloseButton={false}>
|
|
103
|
+
<DialogHeader>
|
|
104
|
+
<DialogTitle>Required action</DialogTitle>
|
|
105
|
+
<DialogDescription>You must complete this action before continuing.</DialogDescription>
|
|
106
|
+
</DialogHeader>
|
|
107
|
+
<DialogFooter layout="horizontal">
|
|
108
|
+
<Button>Continue</Button>
|
|
109
|
+
</DialogFooter>
|
|
110
|
+
</DialogContent>
|
|
111
|
+
</Dialog>
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
<div className="flex flex-col gap-1.5">
|
|
115
|
+
<p className="type-text-xs font-medium text-subtle-foreground">Destructive</p>
|
|
116
|
+
<Dialog>
|
|
117
|
+
<DialogTrigger asChild>
|
|
118
|
+
<Button variant="destructive">Delete Project</Button>
|
|
119
|
+
</DialogTrigger>
|
|
120
|
+
<DialogContent size="sm">
|
|
121
|
+
<DialogHeader>
|
|
122
|
+
<DialogTitle>Delete project</DialogTitle>
|
|
123
|
+
<DialogDescription>
|
|
124
|
+
This will permanently delete the project and all associated data. This action cannot be undone.
|
|
125
|
+
</DialogDescription>
|
|
126
|
+
</DialogHeader>
|
|
127
|
+
<DialogFooter layout="horizontal">
|
|
128
|
+
<DialogClose />
|
|
129
|
+
<Button variant="destructive">Delete</Button>
|
|
130
|
+
</DialogFooter>
|
|
131
|
+
</DialogContent>
|
|
132
|
+
</Dialog>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
);
|