@awsmbiz/inbis-ui 0.0.0-stage → 0.2.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/README.md +167 -2
- package/dist/index.d.ts +247 -0
- package/dist/index.js +1279 -0
- package/dist/index.js.map +1 -0
- package/package.json +77 -3
- package/styles/globals.css +214 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1279 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useId, useMemo } from "react";
|
|
3
|
+
import { cn, cn as cn$1 } from "cn";
|
|
4
|
+
import { Accordion as Accordion$1, AlertDialog as AlertDialog$1, Avatar as Avatar$1, Checkbox as Checkbox$1, Dialog as Dialog$1, DropdownMenu as DropdownMenu$1, Label as Label$1, Progress as Progress$1, RadioGroup as RadioGroup$1, Separator as Separator$1, Slot, Switch as Switch$1, Tabs as Tabs$1, Tooltip as Tooltip$1 } from "radix-ui";
|
|
5
|
+
import { CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, CircleCheckIcon, InfoIcon, Loader2Icon, MoreHorizontalIcon, OctagonXIcon, TriangleAlertIcon, XIcon } from "lucide-react";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { cva } from "class-variance-authority";
|
|
8
|
+
import { Toaster as Toaster$1, toast } from "sonner";
|
|
9
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
10
|
+
import { FormProvider, useController, useForm, useFormState } from "react-hook-form";
|
|
11
|
+
// src/components/accordion.tsx
|
|
12
|
+
function Accordion({ ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsx(Accordion$1.Root, {
|
|
14
|
+
"data-slot": "accordion",
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function AccordionItem({ className, ...props }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(Accordion$1.Item, {
|
|
20
|
+
"data-slot": "accordion-item",
|
|
21
|
+
className: cn$1("border-b border-border last:border-b-0", className),
|
|
22
|
+
...props
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function AccordionTrigger({ className, children, ...props }) {
|
|
26
|
+
return /* @__PURE__ */ jsx(Accordion$1.Header, {
|
|
27
|
+
className: "flex",
|
|
28
|
+
children: /* @__PURE__ */ jsxs(Accordion$1.Trigger, {
|
|
29
|
+
"data-slot": "accordion-trigger",
|
|
30
|
+
className: cn$1("flex flex-1 items-center justify-between gap-3 rounded-sm py-4 text-left text-[15px] leading-5 font-semibold text-foreground outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180", className),
|
|
31
|
+
...props,
|
|
32
|
+
children: [children, /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
33
|
+
"aria-hidden": "true",
|
|
34
|
+
className: "pointer-events-none size-4 shrink-0 text-muted-foreground transition-transform duration-150"
|
|
35
|
+
})]
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function AccordionContent({ className, children, ...props }) {
|
|
40
|
+
return /* @__PURE__ */ jsx(Accordion$1.Content, {
|
|
41
|
+
"data-slot": "accordion-content",
|
|
42
|
+
className: "overflow-hidden text-sm leading-[22px] text-muted-foreground data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
|
|
43
|
+
...props,
|
|
44
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
45
|
+
className: cn$1("pb-4", className),
|
|
46
|
+
children
|
|
47
|
+
})
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
// src/components/alert.tsx
|
|
51
|
+
const alertVariants = cva("group/alert relative grid w-full gap-0.5 rounded-md border px-4 py-3 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4", {
|
|
52
|
+
variants: { variant: {
|
|
53
|
+
default: "bg-card text-card-foreground",
|
|
54
|
+
success: "border-transparent bg-success-soft text-success-soft-foreground *:data-[slot=alert-description]:text-success-soft-foreground",
|
|
55
|
+
warning: "border-transparent bg-warning-soft text-warning-soft-foreground *:data-[slot=alert-description]:text-warning-soft-foreground",
|
|
56
|
+
info: "border-transparent bg-info-soft text-info-soft-foreground *:data-[slot=alert-description]:text-info-soft-foreground",
|
|
57
|
+
destructive: "border-transparent bg-destructive-soft text-destructive-soft-foreground *:data-[slot=alert-description]:text-destructive-soft-foreground"
|
|
58
|
+
} },
|
|
59
|
+
defaultVariants: { variant: "default" }
|
|
60
|
+
});
|
|
61
|
+
function Alert({ className, variant, ...props }) {
|
|
62
|
+
return /* @__PURE__ */ jsx("div", {
|
|
63
|
+
"data-slot": "alert",
|
|
64
|
+
role: "alert",
|
|
65
|
+
className: cn$1(alertVariants({ variant }), className),
|
|
66
|
+
...props
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function AlertTitle({ className, ...props }) {
|
|
70
|
+
return /* @__PURE__ */ jsx("div", {
|
|
71
|
+
"data-slot": "alert-title",
|
|
72
|
+
className: cn$1("font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground", className),
|
|
73
|
+
...props
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function AlertDescription({ className, ...props }) {
|
|
77
|
+
return /* @__PURE__ */ jsx("div", {
|
|
78
|
+
"data-slot": "alert-description",
|
|
79
|
+
className: cn$1("text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4", className),
|
|
80
|
+
...props
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function AlertAction({ className, ...props }) {
|
|
84
|
+
return /* @__PURE__ */ jsx("div", {
|
|
85
|
+
"data-slot": "alert-action",
|
|
86
|
+
className: cn$1("absolute top-2 right-2", className),
|
|
87
|
+
...props
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
// src/components/button.tsx
|
|
91
|
+
const buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-full border border-transparent bg-clip-padding text-sm font-semibold whitespace-nowrap transition-colors duration-150 outline-none select-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
92
|
+
variants: {
|
|
93
|
+
variant: {
|
|
94
|
+
default: "bg-primary text-primary-foreground hover:opacity-90",
|
|
95
|
+
outline: "border-input bg-transparent hover:bg-accent hover:text-accent-foreground aria-expanded:bg-accent aria-expanded:text-accent-foreground",
|
|
96
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
97
|
+
ghost: "hover:bg-accent hover:text-accent-foreground aria-expanded:bg-accent aria-expanded:text-accent-foreground",
|
|
98
|
+
destructive: "bg-destructive text-destructive-foreground hover:opacity-90",
|
|
99
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
100
|
+
},
|
|
101
|
+
size: {
|
|
102
|
+
default: "h-10 gap-1.5 px-[18px] has-data-[icon=inline-end]:pr-4 has-data-[icon=inline-start]:pl-4",
|
|
103
|
+
xs: "h-6 gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3",
|
|
104
|
+
sm: "h-[34px] gap-1 px-3.5 text-[13px] has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3 [&_svg:not([class*='size-'])]:size-3.5",
|
|
105
|
+
lg: "h-[46px] gap-2 px-[22px] text-[15px] has-data-[icon=inline-end]:pr-5 has-data-[icon=inline-start]:pl-5",
|
|
106
|
+
icon: "size-10",
|
|
107
|
+
"icon-xs": "size-6 [&_svg:not([class*='size-'])]:size-3",
|
|
108
|
+
"icon-sm": "size-[34px]",
|
|
109
|
+
"icon-lg": "size-[46px]"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
defaultVariants: {
|
|
113
|
+
variant: "default",
|
|
114
|
+
size: "default"
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
function Button({ className, variant = "default", size = "default", asChild = false, ...props }) {
|
|
118
|
+
const Comp = asChild ? Slot.Root : "button";
|
|
119
|
+
return /* @__PURE__ */ jsx(Comp, {
|
|
120
|
+
"data-slot": "button",
|
|
121
|
+
"data-variant": variant,
|
|
122
|
+
"data-size": size,
|
|
123
|
+
className: cn$1(buttonVariants({
|
|
124
|
+
variant,
|
|
125
|
+
size,
|
|
126
|
+
className
|
|
127
|
+
})),
|
|
128
|
+
...props
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
// src/components/alert-dialog.tsx
|
|
132
|
+
function AlertDialog({ ...props }) {
|
|
133
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Root, {
|
|
134
|
+
"data-slot": "alert-dialog",
|
|
135
|
+
...props
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
function AlertDialogTrigger({ ...props }) {
|
|
139
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Trigger, {
|
|
140
|
+
"data-slot": "alert-dialog-trigger",
|
|
141
|
+
...props
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
function AlertDialogPortal({ ...props }) {
|
|
145
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Portal, {
|
|
146
|
+
"data-slot": "alert-dialog-portal",
|
|
147
|
+
...props
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
function AlertDialogOverlay({ className, ...props }) {
|
|
151
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Overlay, {
|
|
152
|
+
"data-slot": "alert-dialog-overlay",
|
|
153
|
+
className: cn$1("fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className),
|
|
154
|
+
...props
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
function AlertDialogContent({ className, size = "default", ...props }) {
|
|
158
|
+
return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [/* @__PURE__ */ jsx(AlertDialogOverlay, {}), /* @__PURE__ */ jsx(AlertDialog$1.Content, {
|
|
159
|
+
"data-slot": "alert-dialog-content",
|
|
160
|
+
"data-size": size,
|
|
161
|
+
className: cn$1("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid max-h-[calc(100%-2rem)] w-full overflow-y-auto -translate-x-1/2 -translate-y-1/2 gap-5 rounded-xl border border-border bg-popover p-6 text-popover-foreground shadow-(--shadow-float) duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-[480px] data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
162
|
+
...props
|
|
163
|
+
})] });
|
|
164
|
+
}
|
|
165
|
+
function AlertDialogHeader({ className, ...props }) {
|
|
166
|
+
return /* @__PURE__ */ jsx("div", {
|
|
167
|
+
"data-slot": "alert-dialog-header",
|
|
168
|
+
className: cn$1("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]", className),
|
|
169
|
+
...props
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
function AlertDialogFooter({ className, ...props }) {
|
|
173
|
+
return /* @__PURE__ */ jsx("div", {
|
|
174
|
+
"data-slot": "alert-dialog-footer",
|
|
175
|
+
className: cn$1("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end", className),
|
|
176
|
+
...props
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
function AlertDialogMedia({ className, ...props }) {
|
|
180
|
+
return /* @__PURE__ */ jsx("div", {
|
|
181
|
+
"data-slot": "alert-dialog-media",
|
|
182
|
+
className: cn$1("mb-2 inline-flex size-10 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6", className),
|
|
183
|
+
...props
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
function AlertDialogTitle({ className, ...props }) {
|
|
187
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Title, {
|
|
188
|
+
"data-slot": "alert-dialog-title",
|
|
189
|
+
className: cn$1("font-heading text-xl leading-7 font-semibold tracking-[-0.015em] sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", className),
|
|
190
|
+
...props
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
function AlertDialogDescription({ className, ...props }) {
|
|
194
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Description, {
|
|
195
|
+
"data-slot": "alert-dialog-description",
|
|
196
|
+
className: cn$1("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className),
|
|
197
|
+
...props
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
function AlertDialogAction({ className, variant = "default", size = "default", ...props }) {
|
|
201
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
202
|
+
variant,
|
|
203
|
+
size,
|
|
204
|
+
asChild: true,
|
|
205
|
+
children: /* @__PURE__ */ jsx(AlertDialog$1.Action, {
|
|
206
|
+
"data-slot": "alert-dialog-action",
|
|
207
|
+
className: cn$1(className),
|
|
208
|
+
...props
|
|
209
|
+
})
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
function AlertDialogCancel({ className, variant = "outline", size = "default", ...props }) {
|
|
213
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
214
|
+
variant,
|
|
215
|
+
size,
|
|
216
|
+
asChild: true,
|
|
217
|
+
children: /* @__PURE__ */ jsx(AlertDialog$1.Cancel, {
|
|
218
|
+
"data-slot": "alert-dialog-cancel",
|
|
219
|
+
className: cn$1(className),
|
|
220
|
+
...props
|
|
221
|
+
})
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
// src/components/avatar.tsx
|
|
225
|
+
const SIZES = {
|
|
226
|
+
xs: "size-6 text-[10px]",
|
|
227
|
+
sm: "size-8 text-xs",
|
|
228
|
+
default: "size-10 text-sm",
|
|
229
|
+
lg: "size-12 text-base"
|
|
230
|
+
};
|
|
231
|
+
function Avatar({ className, size = "default", ...props }) {
|
|
232
|
+
return /* @__PURE__ */ jsx(Avatar$1.Root, {
|
|
233
|
+
"data-slot": "avatar",
|
|
234
|
+
"data-size": size,
|
|
235
|
+
className: cn$1("relative flex shrink-0 overflow-hidden rounded-full font-semibold select-none", SIZES[size], className),
|
|
236
|
+
...props
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
function AvatarImage({ className, ...props }) {
|
|
240
|
+
return /* @__PURE__ */ jsx(Avatar$1.Image, {
|
|
241
|
+
"data-slot": "avatar-image",
|
|
242
|
+
className: cn$1("aspect-square size-full object-cover", className),
|
|
243
|
+
...props
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
function AvatarFallback({ className, ...props }) {
|
|
247
|
+
return /* @__PURE__ */ jsx(Avatar$1.Fallback, {
|
|
248
|
+
"data-slot": "avatar-fallback",
|
|
249
|
+
className: cn$1("flex size-full items-center justify-center rounded-full bg-secondary text-foreground", className),
|
|
250
|
+
...props
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
function AvatarGroup({ className, children, max, size = "default", ...props }) {
|
|
254
|
+
const avatars = React.Children.toArray(children);
|
|
255
|
+
const shown = max === void 0 ? avatars : avatars.slice(0, max);
|
|
256
|
+
const overflow = avatars.length - shown.length;
|
|
257
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
258
|
+
role: "group",
|
|
259
|
+
"data-slot": "avatar-group",
|
|
260
|
+
className: cn$1("flex items-center -space-x-2.5 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-card", className),
|
|
261
|
+
...props,
|
|
262
|
+
children: [shown, overflow > 0 && /* @__PURE__ */ jsxs("span", {
|
|
263
|
+
"data-slot": "avatar",
|
|
264
|
+
className: cn$1("relative flex shrink-0 items-center justify-center rounded-full bg-primary font-semibold text-primary-foreground", SIZES[size]),
|
|
265
|
+
children: ["+", overflow]
|
|
266
|
+
})]
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
// src/components/badge.tsx
|
|
270
|
+
const badgeVariants = cva("group/badge inline-flex h-6 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2.5 text-xs font-semibold whitespace-nowrap transition-colors duration-150 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid focus-visible:outline-ring has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 aria-invalid:border-destructive [&>svg]:pointer-events-none [&>svg]:size-3!", {
|
|
271
|
+
variants: { variant: {
|
|
272
|
+
default: "bg-primary text-primary-foreground [a]:hover:opacity-90",
|
|
273
|
+
secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-accent",
|
|
274
|
+
success: "bg-success-soft text-success-soft-foreground",
|
|
275
|
+
warning: "bg-warning-soft text-warning-soft-foreground",
|
|
276
|
+
info: "bg-info-soft text-info-soft-foreground",
|
|
277
|
+
destructive: "bg-destructive-soft text-destructive-soft-foreground",
|
|
278
|
+
outline: "border-input text-foreground [a]:hover:bg-accent",
|
|
279
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
280
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
281
|
+
} },
|
|
282
|
+
defaultVariants: { variant: "default" }
|
|
283
|
+
});
|
|
284
|
+
function Badge({ className, variant = "default", asChild = false, ...props }) {
|
|
285
|
+
const Comp = asChild ? Slot.Root : "span";
|
|
286
|
+
return /* @__PURE__ */ jsx(Comp, {
|
|
287
|
+
"data-slot": "badge",
|
|
288
|
+
"data-variant": variant,
|
|
289
|
+
className: cn$1(badgeVariants({ variant }), className),
|
|
290
|
+
...props
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
// src/components/breadcrumb.tsx
|
|
294
|
+
function Breadcrumb({ "aria-label": label = "Breadcrumb", ...props }) {
|
|
295
|
+
return /* @__PURE__ */ jsx("nav", {
|
|
296
|
+
"aria-label": label,
|
|
297
|
+
"data-slot": "breadcrumb",
|
|
298
|
+
...props
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
function BreadcrumbList({ className, ...props }) {
|
|
302
|
+
return /* @__PURE__ */ jsx("ol", {
|
|
303
|
+
"data-slot": "breadcrumb-list",
|
|
304
|
+
className: cn$1("flex flex-wrap items-center gap-2 text-[13px] leading-[19px] break-words text-muted-foreground", className),
|
|
305
|
+
...props
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
function BreadcrumbItem({ className, ...props }) {
|
|
309
|
+
return /* @__PURE__ */ jsx("li", {
|
|
310
|
+
"data-slot": "breadcrumb-item",
|
|
311
|
+
className: cn$1("inline-flex items-center gap-2", className),
|
|
312
|
+
...props
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
function BreadcrumbLink({ asChild, className, ...props }) {
|
|
316
|
+
const Comp = asChild ? Slot.Root : "a";
|
|
317
|
+
return /* @__PURE__ */ jsx(Comp, {
|
|
318
|
+
"data-slot": "breadcrumb-link",
|
|
319
|
+
className: cn$1("rounded-sm underline-offset-4 transition-colors hover:text-foreground hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid focus-visible:outline-ring", className),
|
|
320
|
+
...props
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
function BreadcrumbPage({ className, ...props }) {
|
|
324
|
+
return /* @__PURE__ */ jsx("span", {
|
|
325
|
+
"data-slot": "breadcrumb-page",
|
|
326
|
+
"aria-current": "page",
|
|
327
|
+
className: cn$1("font-medium text-foreground", className),
|
|
328
|
+
...props
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
function BreadcrumbSeparator({ children, className, ...props }) {
|
|
332
|
+
return /* @__PURE__ */ jsx("li", {
|
|
333
|
+
"data-slot": "breadcrumb-separator",
|
|
334
|
+
role: "presentation",
|
|
335
|
+
"aria-hidden": "true",
|
|
336
|
+
className: cn$1("select-none", className),
|
|
337
|
+
...props,
|
|
338
|
+
children: children ?? "/"
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
function BreadcrumbEllipsis({ className, label = "More", ...props }) {
|
|
342
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
343
|
+
"data-slot": "breadcrumb-ellipsis",
|
|
344
|
+
className: cn$1("flex size-5 items-center justify-center", className),
|
|
345
|
+
...props,
|
|
346
|
+
children: [/* @__PURE__ */ jsx(MoreHorizontalIcon, {
|
|
347
|
+
"aria-hidden": "true",
|
|
348
|
+
className: "size-4"
|
|
349
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
350
|
+
className: "sr-only",
|
|
351
|
+
children: label
|
|
352
|
+
})]
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
// src/components/card.tsx
|
|
356
|
+
function Card({ className, size = "default", ...props }) {
|
|
357
|
+
return /* @__PURE__ */ jsx("div", {
|
|
358
|
+
"data-slot": "card",
|
|
359
|
+
"data-size": size,
|
|
360
|
+
className: cn$1("group/card flex flex-col gap-5 overflow-hidden rounded-2xl border border-border bg-card py-(--card-spacing) text-sm text-card-foreground shadow-(--shadow-card) [--card-spacing:--spacing(6)] data-[size=sm]:gap-3 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-2xl *:[img:last-child]:rounded-b-2xl", className),
|
|
361
|
+
...props
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
function CardHeader({ className, ...props }) {
|
|
365
|
+
return /* @__PURE__ */ jsx("div", {
|
|
366
|
+
"data-slot": "card-header",
|
|
367
|
+
className: cn$1("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-2xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)", className),
|
|
368
|
+
...props
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
function CardTitle({ className, ...props }) {
|
|
372
|
+
return /* @__PURE__ */ jsx("div", {
|
|
373
|
+
"data-slot": "card-title",
|
|
374
|
+
className: cn$1("font-heading text-[17px] leading-snug font-semibold tracking-[-0.01em] group-data-[size=sm]/card:text-[15px]", className),
|
|
375
|
+
...props
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
function CardDescription({ className, ...props }) {
|
|
379
|
+
return /* @__PURE__ */ jsx("div", {
|
|
380
|
+
"data-slot": "card-description",
|
|
381
|
+
className: cn$1("text-[13px] text-muted-foreground", className),
|
|
382
|
+
...props
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
function CardAction({ className, ...props }) {
|
|
386
|
+
return /* @__PURE__ */ jsx("div", {
|
|
387
|
+
"data-slot": "card-action",
|
|
388
|
+
className: cn$1("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className),
|
|
389
|
+
...props
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
function CardContent({ className, ...props }) {
|
|
393
|
+
return /* @__PURE__ */ jsx("div", {
|
|
394
|
+
"data-slot": "card-content",
|
|
395
|
+
className: cn$1("px-(--card-spacing)", className),
|
|
396
|
+
...props
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
function CardFooter({ className, ...props }) {
|
|
400
|
+
return /* @__PURE__ */ jsx("div", {
|
|
401
|
+
"data-slot": "card-footer",
|
|
402
|
+
className: cn$1("flex items-center rounded-b-2xl border-t bg-muted/50 p-(--card-spacing)", className),
|
|
403
|
+
...props
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
// src/components/checkbox.tsx
|
|
407
|
+
function Checkbox({ className, ...props }) {
|
|
408
|
+
return /* @__PURE__ */ jsx(Checkbox$1.Root, {
|
|
409
|
+
"data-slot": "checkbox",
|
|
410
|
+
className: cn$1("peer relative flex size-[18px] shrink-0 items-center justify-center rounded-[5px] border border-input bg-surface-raised transition-colors duration-150 outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid focus-visible:outline-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:aria-checked:border-primary data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary", className),
|
|
411
|
+
...props,
|
|
412
|
+
children: /* @__PURE__ */ jsx(Checkbox$1.Indicator, {
|
|
413
|
+
"data-slot": "checkbox-indicator",
|
|
414
|
+
className: "grid place-content-center text-current transition-none [&>svg]:size-3.5",
|
|
415
|
+
children: /* @__PURE__ */ jsx(CheckIcon, {})
|
|
416
|
+
})
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
// src/components/dialog.tsx
|
|
420
|
+
function Dialog({ ...props }) {
|
|
421
|
+
return /* @__PURE__ */ jsx(Dialog$1.Root, {
|
|
422
|
+
"data-slot": "dialog",
|
|
423
|
+
...props
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
function DialogTrigger({ ...props }) {
|
|
427
|
+
return /* @__PURE__ */ jsx(Dialog$1.Trigger, {
|
|
428
|
+
"data-slot": "dialog-trigger",
|
|
429
|
+
...props
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
function DialogPortal({ ...props }) {
|
|
433
|
+
return /* @__PURE__ */ jsx(Dialog$1.Portal, {
|
|
434
|
+
"data-slot": "dialog-portal",
|
|
435
|
+
...props
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
function DialogClose({ ...props }) {
|
|
439
|
+
return /* @__PURE__ */ jsx(Dialog$1.Close, {
|
|
440
|
+
"data-slot": "dialog-close",
|
|
441
|
+
...props
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
function DialogOverlay({ className, ...props }) {
|
|
445
|
+
return /* @__PURE__ */ jsx(Dialog$1.Overlay, {
|
|
446
|
+
"data-slot": "dialog-overlay",
|
|
447
|
+
className: cn$1("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className),
|
|
448
|
+
...props
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
function DialogContent({ className, children, showCloseButton = true, ...props }) {
|
|
452
|
+
return /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogOverlay, {}), /* @__PURE__ */ jsxs(Dialog$1.Content, {
|
|
453
|
+
"data-slot": "dialog-content",
|
|
454
|
+
className: cn$1("fixed top-1/2 left-1/2 z-50 grid max-h-[calc(100%-2rem)] w-full max-w-[calc(100%-2rem)] overflow-y-auto -translate-x-1/2 -translate-y-1/2 gap-5 rounded-xl border border-border bg-popover p-6 text-sm text-popover-foreground shadow-(--shadow-float) duration-100 outline-none sm:max-w-[480px] data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
455
|
+
...props,
|
|
456
|
+
children: [children, showCloseButton && /* @__PURE__ */ jsx(Dialog$1.Close, {
|
|
457
|
+
"data-slot": "dialog-close",
|
|
458
|
+
asChild: true,
|
|
459
|
+
children: /* @__PURE__ */ jsxs(Button, {
|
|
460
|
+
variant: "ghost",
|
|
461
|
+
className: "absolute top-4 right-4",
|
|
462
|
+
size: "icon-sm",
|
|
463
|
+
children: [/* @__PURE__ */ jsx(XIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
464
|
+
className: "sr-only",
|
|
465
|
+
children: "Close"
|
|
466
|
+
})]
|
|
467
|
+
})
|
|
468
|
+
})]
|
|
469
|
+
})] });
|
|
470
|
+
}
|
|
471
|
+
function DialogHeader({ className, ...props }) {
|
|
472
|
+
return /* @__PURE__ */ jsx("div", {
|
|
473
|
+
"data-slot": "dialog-header",
|
|
474
|
+
className: cn$1("flex flex-col gap-2", className),
|
|
475
|
+
...props
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
function DialogFooter({ className, showCloseButton = false, children, ...props }) {
|
|
479
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
480
|
+
"data-slot": "dialog-footer",
|
|
481
|
+
className: cn$1("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
|
|
482
|
+
...props,
|
|
483
|
+
children: [children, showCloseButton && /* @__PURE__ */ jsx(Dialog$1.Close, {
|
|
484
|
+
asChild: true,
|
|
485
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
486
|
+
variant: "outline",
|
|
487
|
+
children: "Close"
|
|
488
|
+
})
|
|
489
|
+
})]
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
function DialogTitle({ className, ...props }) {
|
|
493
|
+
return /* @__PURE__ */ jsx(Dialog$1.Title, {
|
|
494
|
+
"data-slot": "dialog-title",
|
|
495
|
+
className: cn$1("font-heading text-xl leading-7 font-semibold tracking-[-0.015em]", className),
|
|
496
|
+
...props
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
function DialogDescription({ className, ...props }) {
|
|
500
|
+
return /* @__PURE__ */ jsx(Dialog$1.Description, {
|
|
501
|
+
"data-slot": "dialog-description",
|
|
502
|
+
className: cn$1("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className),
|
|
503
|
+
...props
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
// src/components/dropdown-menu.tsx
|
|
507
|
+
function DropdownMenu({ modal = false, ...props }) {
|
|
508
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Root, {
|
|
509
|
+
"data-slot": "dropdown-menu",
|
|
510
|
+
modal,
|
|
511
|
+
...props
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
function DropdownMenuPortal({ ...props }) {
|
|
515
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Portal, {
|
|
516
|
+
"data-slot": "dropdown-menu-portal",
|
|
517
|
+
...props
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
function DropdownMenuTrigger({ ...props }) {
|
|
521
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Trigger, {
|
|
522
|
+
"data-slot": "dropdown-menu-trigger",
|
|
523
|
+
...props
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
function DropdownMenuContent({ className, align = "start", sideOffset = 4, ...props }) {
|
|
527
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Content, {
|
|
528
|
+
"data-slot": "dropdown-menu-content",
|
|
529
|
+
sideOffset,
|
|
530
|
+
align,
|
|
531
|
+
className: cn$1("z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-(--shadow-popover) duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
532
|
+
...props
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
function DropdownMenuGroup({ ...props }) {
|
|
536
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Group, {
|
|
537
|
+
"data-slot": "dropdown-menu-group",
|
|
538
|
+
...props
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
542
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Item, {
|
|
543
|
+
"data-slot": "dropdown-menu-item",
|
|
544
|
+
"data-inset": inset,
|
|
545
|
+
"data-variant": variant,
|
|
546
|
+
className: cn$1("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-sm px-2.5 py-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive-soft data-[variant=destructive]:focus:text-destructive-soft-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive", className),
|
|
547
|
+
...props
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }) {
|
|
551
|
+
return /* @__PURE__ */ jsxs(DropdownMenu$1.CheckboxItem, {
|
|
552
|
+
"data-slot": "dropdown-menu-checkbox-item",
|
|
553
|
+
"data-inset": inset,
|
|
554
|
+
className: cn$1("relative flex cursor-default items-center gap-1.5 rounded-sm py-2 pr-8 pl-2.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
555
|
+
checked,
|
|
556
|
+
...props,
|
|
557
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
558
|
+
className: "pointer-events-none absolute right-2 flex items-center justify-center",
|
|
559
|
+
"data-slot": "dropdown-menu-checkbox-item-indicator",
|
|
560
|
+
children: /* @__PURE__ */ jsx(DropdownMenu$1.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
|
|
561
|
+
}), children]
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
function DropdownMenuRadioGroup({ ...props }) {
|
|
565
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.RadioGroup, {
|
|
566
|
+
"data-slot": "dropdown-menu-radio-group",
|
|
567
|
+
...props
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
function DropdownMenuRadioItem({ className, children, inset, ...props }) {
|
|
571
|
+
return /* @__PURE__ */ jsxs(DropdownMenu$1.RadioItem, {
|
|
572
|
+
"data-slot": "dropdown-menu-radio-item",
|
|
573
|
+
"data-inset": inset,
|
|
574
|
+
className: cn$1("relative flex cursor-default items-center gap-1.5 rounded-sm py-2 pr-8 pl-2.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
575
|
+
...props,
|
|
576
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
577
|
+
className: "pointer-events-none absolute right-2 flex items-center justify-center",
|
|
578
|
+
"data-slot": "dropdown-menu-radio-item-indicator",
|
|
579
|
+
children: /* @__PURE__ */ jsx(DropdownMenu$1.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
|
|
580
|
+
}), children]
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
584
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Label, {
|
|
585
|
+
"data-slot": "dropdown-menu-label",
|
|
586
|
+
"data-inset": inset,
|
|
587
|
+
className: cn$1("px-2.5 py-1.5 text-xs font-medium text-muted-foreground data-inset:pl-7", className),
|
|
588
|
+
...props
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
function DropdownMenuSeparator({ className, ...props }) {
|
|
592
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Separator, {
|
|
593
|
+
"data-slot": "dropdown-menu-separator",
|
|
594
|
+
className: cn$1("-mx-1 my-1 h-px bg-border", className),
|
|
595
|
+
...props
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
function DropdownMenuShortcut({ className, ...props }) {
|
|
599
|
+
return /* @__PURE__ */ jsx("span", {
|
|
600
|
+
"data-slot": "dropdown-menu-shortcut",
|
|
601
|
+
className: cn$1("ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground", className),
|
|
602
|
+
...props
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
function DropdownMenuSub({ ...props }) {
|
|
606
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Sub, {
|
|
607
|
+
"data-slot": "dropdown-menu-sub",
|
|
608
|
+
...props
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
612
|
+
return /* @__PURE__ */ jsxs(DropdownMenu$1.SubTrigger, {
|
|
613
|
+
"data-slot": "dropdown-menu-sub-trigger",
|
|
614
|
+
"data-inset": inset,
|
|
615
|
+
className: cn$1("flex cursor-default items-center gap-1.5 rounded-sm px-2.5 py-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
616
|
+
...props,
|
|
617
|
+
children: [children, /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto" })]
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
function DropdownMenuSubContent({ className, ...props }) {
|
|
621
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.SubContent, {
|
|
622
|
+
"data-slot": "dropdown-menu-sub-content",
|
|
623
|
+
className: cn$1("z-50 min-w-[96px] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-(--shadow-popover) duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
624
|
+
...props
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
// src/components/label.tsx
|
|
628
|
+
function Label({ className, ...props }) {
|
|
629
|
+
return /* @__PURE__ */ jsx(Label$1.Root, {
|
|
630
|
+
"data-slot": "label",
|
|
631
|
+
className: cn$1("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className),
|
|
632
|
+
...props
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
// src/components/separator.tsx
|
|
636
|
+
function Separator({ className, orientation = "horizontal", decorative = true, ...props }) {
|
|
637
|
+
return /* @__PURE__ */ jsx(Separator$1.Root, {
|
|
638
|
+
"data-slot": "separator",
|
|
639
|
+
decorative,
|
|
640
|
+
orientation,
|
|
641
|
+
className: cn$1("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch", className),
|
|
642
|
+
...props
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
// src/components/field.tsx
|
|
646
|
+
function FieldSet({ className, ...props }) {
|
|
647
|
+
return /* @__PURE__ */ jsx("fieldset", {
|
|
648
|
+
"data-slot": "field-set",
|
|
649
|
+
className: cn$1("flex flex-col gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", className),
|
|
650
|
+
...props
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
function FieldLegend({ className, variant = "legend", ...props }) {
|
|
654
|
+
return /* @__PURE__ */ jsx("legend", {
|
|
655
|
+
"data-slot": "field-legend",
|
|
656
|
+
"data-variant": variant,
|
|
657
|
+
className: cn$1("mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base", className),
|
|
658
|
+
...props
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
function FieldGroup({ className, ...props }) {
|
|
662
|
+
return /* @__PURE__ */ jsx("div", {
|
|
663
|
+
"data-slot": "field-group",
|
|
664
|
+
className: cn$1("group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4", className),
|
|
665
|
+
...props
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
const fieldVariants = cva("group/field flex w-full gap-2 data-[invalid=true]:text-destructive", {
|
|
669
|
+
variants: { orientation: {
|
|
670
|
+
vertical: "flex-col *:w-full [&>.sr-only]:w-auto",
|
|
671
|
+
horizontal: "flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
672
|
+
responsive: "flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
673
|
+
} },
|
|
674
|
+
defaultVariants: { orientation: "vertical" }
|
|
675
|
+
});
|
|
676
|
+
function Field({ className, orientation = "vertical", ...props }) {
|
|
677
|
+
return /* @__PURE__ */ jsx("div", {
|
|
678
|
+
role: "group",
|
|
679
|
+
"data-slot": "field",
|
|
680
|
+
"data-orientation": orientation,
|
|
681
|
+
className: cn$1(fieldVariants({ orientation }), className),
|
|
682
|
+
...props
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
function FieldContent({ className, ...props }) {
|
|
686
|
+
return /* @__PURE__ */ jsx("div", {
|
|
687
|
+
"data-slot": "field-content",
|
|
688
|
+
className: cn$1("group/field-content flex flex-1 flex-col gap-0.5 leading-snug", className),
|
|
689
|
+
...props
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
function FieldLabel({ className, ...props }) {
|
|
693
|
+
return /* @__PURE__ */ jsx(Label, {
|
|
694
|
+
"data-slot": "field-label",
|
|
695
|
+
className: cn$1("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:outline-2 has-[>[data-slot=field]]:has-[:focus-visible]:outline-offset-2 has-[>[data-slot=field]]:has-[:focus-visible]:outline-solid has-[>[data-slot=field]]:has-[:focus-visible]:outline-ring *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col", className),
|
|
696
|
+
...props
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
function FieldTitle({ className, ...props }) {
|
|
700
|
+
return /* @__PURE__ */ jsx("div", {
|
|
701
|
+
"data-slot": "field-label",
|
|
702
|
+
className: cn$1("flex w-fit items-center gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50", className),
|
|
703
|
+
...props
|
|
704
|
+
});
|
|
705
|
+
}
|
|
706
|
+
function FieldDescription({ className, ...props }) {
|
|
707
|
+
return /* @__PURE__ */ jsx("p", {
|
|
708
|
+
"data-slot": "field-description",
|
|
709
|
+
className: cn$1("text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5", "last:mt-0 nth-last-2:-mt-1", "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className),
|
|
710
|
+
...props
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
function FieldSeparator({ children, className, ...props }) {
|
|
714
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
715
|
+
"data-slot": "field-separator",
|
|
716
|
+
"data-content": !!children,
|
|
717
|
+
className: cn$1("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className),
|
|
718
|
+
...props,
|
|
719
|
+
children: [/* @__PURE__ */ jsx(Separator, { className: "absolute inset-0 top-1/2" }), children && /* @__PURE__ */ jsx("span", {
|
|
720
|
+
className: "relative mx-auto block w-fit bg-background px-2 text-muted-foreground",
|
|
721
|
+
"data-slot": "field-separator-content",
|
|
722
|
+
children
|
|
723
|
+
})]
|
|
724
|
+
});
|
|
725
|
+
}
|
|
726
|
+
function FieldError({ className, children, errors, ...props }) {
|
|
727
|
+
const content = useMemo(() => {
|
|
728
|
+
if (children) return children;
|
|
729
|
+
if (!errors?.length) return null;
|
|
730
|
+
const uniqueErrors = [...new Map(errors.map((error) => [error?.message, error])).values()];
|
|
731
|
+
if (uniqueErrors.length == 1) return uniqueErrors[0]?.message;
|
|
732
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
733
|
+
className: "ml-4 flex list-disc flex-col gap-1",
|
|
734
|
+
children: uniqueErrors.map((error, index) => error?.message && /* @__PURE__ */ jsx("li", { children: error.message }, index))
|
|
735
|
+
});
|
|
736
|
+
}, [children, errors]);
|
|
737
|
+
if (!content) return null;
|
|
738
|
+
return /* @__PURE__ */ jsx("div", {
|
|
739
|
+
role: "alert",
|
|
740
|
+
"data-slot": "field-error",
|
|
741
|
+
className: cn$1("text-sm font-normal text-destructive", className),
|
|
742
|
+
...props,
|
|
743
|
+
children: content
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
// src/components/input.tsx
|
|
747
|
+
function Input({ className, type, ...props }) {
|
|
748
|
+
return /* @__PURE__ */ jsx("input", {
|
|
749
|
+
type,
|
|
750
|
+
"data-slot": "input",
|
|
751
|
+
className: cn$1("h-10 w-full min-w-0 rounded-md border border-input bg-surface-raised px-3.5 py-2 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid focus-visible:outline-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-muted disabled:opacity-50 aria-invalid:border-destructive md:text-sm", className),
|
|
752
|
+
...props
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
// src/components/pagination.tsx
|
|
756
|
+
function Pagination({ className, ...props }) {
|
|
757
|
+
return /* @__PURE__ */ jsx("nav", {
|
|
758
|
+
role: "navigation",
|
|
759
|
+
"aria-label": "Pagination",
|
|
760
|
+
"data-slot": "pagination",
|
|
761
|
+
className: cn$1("mx-auto flex w-full justify-center", className),
|
|
762
|
+
...props
|
|
763
|
+
});
|
|
764
|
+
}
|
|
765
|
+
function PaginationContent({ className, ...props }) {
|
|
766
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
767
|
+
"data-slot": "pagination-content",
|
|
768
|
+
className: cn$1("flex items-center gap-0.5", className),
|
|
769
|
+
...props
|
|
770
|
+
});
|
|
771
|
+
}
|
|
772
|
+
function PaginationItem({ ...props }) {
|
|
773
|
+
return /* @__PURE__ */ jsx("li", {
|
|
774
|
+
"data-slot": "pagination-item",
|
|
775
|
+
...props
|
|
776
|
+
});
|
|
777
|
+
}
|
|
778
|
+
function PaginationLink({ className, isActive, size = "icon", ...props }) {
|
|
779
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
780
|
+
asChild: true,
|
|
781
|
+
variant: isActive ? "outline" : "ghost",
|
|
782
|
+
size,
|
|
783
|
+
className: cn$1(className),
|
|
784
|
+
children: /* @__PURE__ */ jsx("a", {
|
|
785
|
+
"aria-current": isActive ? "page" : void 0,
|
|
786
|
+
"data-slot": "pagination-link",
|
|
787
|
+
"data-active": isActive,
|
|
788
|
+
...props
|
|
789
|
+
})
|
|
790
|
+
});
|
|
791
|
+
}
|
|
792
|
+
function PaginationPrevious({ className, text = "Previous", ...props }) {
|
|
793
|
+
return /* @__PURE__ */ jsxs(PaginationLink, {
|
|
794
|
+
"aria-label": "Previous page",
|
|
795
|
+
size: "default",
|
|
796
|
+
className: cn$1("pl-1.5!", className),
|
|
797
|
+
...props,
|
|
798
|
+
children: [/* @__PURE__ */ jsx(ChevronLeftIcon, { "data-icon": "inline-start" }), /* @__PURE__ */ jsx("span", {
|
|
799
|
+
className: "hidden sm:block",
|
|
800
|
+
children: text
|
|
801
|
+
})]
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
function PaginationNext({ className, text = "Next", ...props }) {
|
|
805
|
+
return /* @__PURE__ */ jsxs(PaginationLink, {
|
|
806
|
+
"aria-label": "Next page",
|
|
807
|
+
size: "default",
|
|
808
|
+
className: cn$1("pr-1.5!", className),
|
|
809
|
+
...props,
|
|
810
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
811
|
+
className: "hidden sm:block",
|
|
812
|
+
children: text
|
|
813
|
+
}), /* @__PURE__ */ jsx(ChevronRightIcon, { "data-icon": "inline-end" })]
|
|
814
|
+
});
|
|
815
|
+
}
|
|
816
|
+
function PaginationEllipsis({ className, ...props }) {
|
|
817
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
818
|
+
"aria-hidden": true,
|
|
819
|
+
"data-slot": "pagination-ellipsis",
|
|
820
|
+
className: cn$1("flex size-8 items-center justify-center [&_svg:not([class*='size-'])]:size-4", className),
|
|
821
|
+
...props,
|
|
822
|
+
children: [/* @__PURE__ */ jsx(MoreHorizontalIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
823
|
+
className: "sr-only",
|
|
824
|
+
children: "More pages"
|
|
825
|
+
})]
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
// src/components/native-select.tsx
|
|
829
|
+
function NativeSelect({ className, size = "default", ...props }) {
|
|
830
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
831
|
+
className: cn$1("group/native-select relative w-fit has-[select:disabled]:opacity-50", className),
|
|
832
|
+
"data-slot": "native-select-wrapper",
|
|
833
|
+
"data-size": size,
|
|
834
|
+
children: [/* @__PURE__ */ jsx("select", {
|
|
835
|
+
"data-slot": "native-select",
|
|
836
|
+
"data-size": size,
|
|
837
|
+
className: "h-10 w-full min-w-0 appearance-none rounded-md border border-input bg-surface-raised py-2 pr-9 pl-3.5 text-sm transition-colors outline-none select-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid focus-visible:outline-ring disabled:pointer-events-none disabled:cursor-not-allowed aria-invalid:border-destructive data-[size=sm]:h-[34px] data-[size=sm]:py-1",
|
|
838
|
+
...props
|
|
839
|
+
}), /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
840
|
+
className: "pointer-events-none absolute top-1/2 right-3 size-4 -translate-y-1/2 text-muted-foreground select-none",
|
|
841
|
+
"aria-hidden": "true",
|
|
842
|
+
"data-slot": "native-select-icon"
|
|
843
|
+
})]
|
|
844
|
+
});
|
|
845
|
+
}
|
|
846
|
+
function NativeSelectOption({ className, ...props }) {
|
|
847
|
+
return /* @__PURE__ */ jsx("option", {
|
|
848
|
+
"data-slot": "native-select-option",
|
|
849
|
+
className: cn$1("bg-[Canvas] text-[CanvasText]", className),
|
|
850
|
+
...props
|
|
851
|
+
});
|
|
852
|
+
}
|
|
853
|
+
function NativeSelectOptGroup({ className, ...props }) {
|
|
854
|
+
return /* @__PURE__ */ jsx("optgroup", {
|
|
855
|
+
"data-slot": "native-select-optgroup",
|
|
856
|
+
className: cn$1("bg-[Canvas] text-[CanvasText]", className),
|
|
857
|
+
...props
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
// src/components/progress.tsx
|
|
861
|
+
function Progress({ className, value, ...props }) {
|
|
862
|
+
return /* @__PURE__ */ jsx(Progress$1.Root, {
|
|
863
|
+
"data-slot": "progress",
|
|
864
|
+
value,
|
|
865
|
+
className: cn$1("relative h-2 w-full overflow-hidden rounded-full bg-muted", className),
|
|
866
|
+
...props,
|
|
867
|
+
children: /* @__PURE__ */ jsx(Progress$1.Indicator, {
|
|
868
|
+
"data-slot": "progress-indicator",
|
|
869
|
+
className: "h-full w-full flex-1 rounded-full bg-primary transition-transform duration-200",
|
|
870
|
+
style: { transform: `translateX(-${String(100 - (value ?? 0))}%)` }
|
|
871
|
+
})
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
// src/components/radio-group.tsx
|
|
875
|
+
function RadioGroup({ className, ...props }) {
|
|
876
|
+
return /* @__PURE__ */ jsx(RadioGroup$1.Root, {
|
|
877
|
+
"data-slot": "radio-group",
|
|
878
|
+
className: cn$1("grid w-full gap-3.5", className),
|
|
879
|
+
...props
|
|
880
|
+
});
|
|
881
|
+
}
|
|
882
|
+
function RadioGroupItem({ className, ...props }) {
|
|
883
|
+
return /* @__PURE__ */ jsx(RadioGroup$1.Item, {
|
|
884
|
+
"data-slot": "radio-group-item",
|
|
885
|
+
className: cn$1("peer relative flex aspect-square size-[18px] shrink-0 items-center justify-center rounded-full border border-input bg-surface-raised transition-colors duration-150 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid focus-visible:outline-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive data-[state=checked]:border-primary", className),
|
|
886
|
+
...props,
|
|
887
|
+
children: /* @__PURE__ */ jsx(RadioGroup$1.Indicator, {
|
|
888
|
+
"data-slot": "radio-group-indicator",
|
|
889
|
+
className: "flex items-center justify-center",
|
|
890
|
+
children: /* @__PURE__ */ jsx("span", { className: "size-2 rounded-full bg-primary" })
|
|
891
|
+
})
|
|
892
|
+
});
|
|
893
|
+
}
|
|
894
|
+
// src/components/sheet.tsx
|
|
895
|
+
function Sheet({ ...props }) {
|
|
896
|
+
return /* @__PURE__ */ jsx(Dialog$1.Root, {
|
|
897
|
+
"data-slot": "sheet",
|
|
898
|
+
...props
|
|
899
|
+
});
|
|
900
|
+
}
|
|
901
|
+
function SheetTrigger({ ...props }) {
|
|
902
|
+
return /* @__PURE__ */ jsx(Dialog$1.Trigger, {
|
|
903
|
+
"data-slot": "sheet-trigger",
|
|
904
|
+
...props
|
|
905
|
+
});
|
|
906
|
+
}
|
|
907
|
+
function SheetClose({ ...props }) {
|
|
908
|
+
return /* @__PURE__ */ jsx(Dialog$1.Close, {
|
|
909
|
+
"data-slot": "sheet-close",
|
|
910
|
+
...props
|
|
911
|
+
});
|
|
912
|
+
}
|
|
913
|
+
function SheetPortal({ ...props }) {
|
|
914
|
+
return /* @__PURE__ */ jsx(Dialog$1.Portal, {
|
|
915
|
+
"data-slot": "sheet-portal",
|
|
916
|
+
...props
|
|
917
|
+
});
|
|
918
|
+
}
|
|
919
|
+
function SheetOverlay({ className, ...props }) {
|
|
920
|
+
return /* @__PURE__ */ jsx(Dialog$1.Overlay, {
|
|
921
|
+
"data-slot": "sheet-overlay",
|
|
922
|
+
className: cn$1("fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className),
|
|
923
|
+
...props
|
|
924
|
+
});
|
|
925
|
+
}
|
|
926
|
+
function SheetContent({ className, children, side = "right", showCloseButton = true, ...props }) {
|
|
927
|
+
return /* @__PURE__ */ jsxs(SheetPortal, { children: [/* @__PURE__ */ jsx(SheetOverlay, {}), /* @__PURE__ */ jsxs(Dialog$1.Content, {
|
|
928
|
+
"data-slot": "sheet-content",
|
|
929
|
+
"data-side": side,
|
|
930
|
+
className: cn$1("fixed z-50 flex flex-col gap-4 overflow-y-auto bg-popover bg-clip-padding text-sm text-popover-foreground shadow-(--shadow-float) transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10", className),
|
|
931
|
+
...props,
|
|
932
|
+
children: [children, showCloseButton && /* @__PURE__ */ jsx(Dialog$1.Close, {
|
|
933
|
+
"data-slot": "sheet-close",
|
|
934
|
+
asChild: true,
|
|
935
|
+
children: /* @__PURE__ */ jsxs(Button, {
|
|
936
|
+
variant: "ghost",
|
|
937
|
+
className: "absolute top-3 right-3",
|
|
938
|
+
size: "icon-sm",
|
|
939
|
+
children: [/* @__PURE__ */ jsx(XIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
940
|
+
className: "sr-only",
|
|
941
|
+
children: "Close"
|
|
942
|
+
})]
|
|
943
|
+
})
|
|
944
|
+
})]
|
|
945
|
+
})] });
|
|
946
|
+
}
|
|
947
|
+
function SheetHeader({ className, ...props }) {
|
|
948
|
+
return /* @__PURE__ */ jsx("div", {
|
|
949
|
+
"data-slot": "sheet-header",
|
|
950
|
+
className: cn$1("flex flex-col gap-0.5 p-4", className),
|
|
951
|
+
...props
|
|
952
|
+
});
|
|
953
|
+
}
|
|
954
|
+
function SheetFooter({ className, ...props }) {
|
|
955
|
+
return /* @__PURE__ */ jsx("div", {
|
|
956
|
+
"data-slot": "sheet-footer",
|
|
957
|
+
className: cn$1("mt-auto flex flex-col gap-2 p-4", className),
|
|
958
|
+
...props
|
|
959
|
+
});
|
|
960
|
+
}
|
|
961
|
+
function SheetTitle({ className, ...props }) {
|
|
962
|
+
return /* @__PURE__ */ jsx(Dialog$1.Title, {
|
|
963
|
+
"data-slot": "sheet-title",
|
|
964
|
+
className: cn$1("font-heading text-xl leading-7 font-semibold tracking-[-0.015em] text-foreground", className),
|
|
965
|
+
...props
|
|
966
|
+
});
|
|
967
|
+
}
|
|
968
|
+
function SheetDescription({ className, ...props }) {
|
|
969
|
+
return /* @__PURE__ */ jsx(Dialog$1.Description, {
|
|
970
|
+
"data-slot": "sheet-description",
|
|
971
|
+
className: cn$1("text-sm text-muted-foreground", className),
|
|
972
|
+
...props
|
|
973
|
+
});
|
|
974
|
+
}
|
|
975
|
+
// src/components/skeleton.tsx
|
|
976
|
+
function Skeleton({ className, ...props }) {
|
|
977
|
+
return /* @__PURE__ */ jsx("div", {
|
|
978
|
+
"data-slot": "skeleton",
|
|
979
|
+
className: cn$1("animate-pulse rounded-md bg-muted", className),
|
|
980
|
+
...props
|
|
981
|
+
});
|
|
982
|
+
}
|
|
983
|
+
// src/components/sonner.tsx
|
|
984
|
+
const Toaster = ({ ...props }) => {
|
|
985
|
+
return /* @__PURE__ */ jsx(Toaster$1, {
|
|
986
|
+
theme: "system",
|
|
987
|
+
className: "toaster group",
|
|
988
|
+
position: "bottom-right",
|
|
989
|
+
icons: {
|
|
990
|
+
success: /* @__PURE__ */ jsx(CircleCheckIcon, { className: "size-4" }),
|
|
991
|
+
info: /* @__PURE__ */ jsx(InfoIcon, { className: "size-4" }),
|
|
992
|
+
warning: /* @__PURE__ */ jsx(TriangleAlertIcon, { className: "size-4" }),
|
|
993
|
+
error: /* @__PURE__ */ jsx(OctagonXIcon, { className: "size-4" }),
|
|
994
|
+
loading: /* @__PURE__ */ jsx(Loader2Icon, { className: "size-4 animate-spin" })
|
|
995
|
+
},
|
|
996
|
+
style: {
|
|
997
|
+
"--normal-bg": "var(--popover)",
|
|
998
|
+
"--normal-text": "var(--popover-foreground)",
|
|
999
|
+
"--normal-border": "var(--border)",
|
|
1000
|
+
"--border-radius": "calc(var(--radius) + 4px)"
|
|
1001
|
+
},
|
|
1002
|
+
toastOptions: { classNames: { toast: "cn-toast rounded-2xl border-border bg-popover shadow-(--shadow-popover)" } },
|
|
1003
|
+
...props
|
|
1004
|
+
});
|
|
1005
|
+
};
|
|
1006
|
+
// src/components/steps.tsx
|
|
1007
|
+
function Steps({ className, children, "aria-label": label = "Steps", ...props }) {
|
|
1008
|
+
return /* @__PURE__ */ jsx("nav", {
|
|
1009
|
+
"aria-label": label,
|
|
1010
|
+
"data-slot": "steps",
|
|
1011
|
+
...props,
|
|
1012
|
+
children: /* @__PURE__ */ jsx("ol", {
|
|
1013
|
+
className: cn$1("flex flex-wrap items-center gap-x-5 gap-y-3", className),
|
|
1014
|
+
children
|
|
1015
|
+
})
|
|
1016
|
+
});
|
|
1017
|
+
}
|
|
1018
|
+
function StepsItem({ className, children, step, status, completedLabel = "Completed", onClick, ...props }) {
|
|
1019
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1020
|
+
/* @__PURE__ */ jsx("span", {
|
|
1021
|
+
"aria-hidden": "true",
|
|
1022
|
+
className: cn$1("inline-flex size-7 shrink-0 items-center justify-center rounded-full border border-input text-[13px] font-semibold", status === "current" && "border-primary bg-primary text-primary-foreground", status === "complete" && "border-transparent bg-success-soft text-success-soft-foreground"),
|
|
1023
|
+
children: status === "complete" ? /* @__PURE__ */ jsx(CheckIcon, {
|
|
1024
|
+
className: "size-3.5",
|
|
1025
|
+
strokeWidth: 2.5
|
|
1026
|
+
}) : step
|
|
1027
|
+
}),
|
|
1028
|
+
status === "complete" && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("span", {
|
|
1029
|
+
className: "sr-only",
|
|
1030
|
+
children: [completedLabel, ":"]
|
|
1031
|
+
}), " "] }),
|
|
1032
|
+
children
|
|
1033
|
+
] });
|
|
1034
|
+
const classes = cn$1("flex items-center gap-2.5 rounded-sm text-sm font-medium", status === "upcoming" ? "text-muted-foreground" : "text-foreground", className);
|
|
1035
|
+
const current = status === "current" ? "step" : void 0;
|
|
1036
|
+
return /* @__PURE__ */ jsx("li", {
|
|
1037
|
+
"data-slot": "steps-item",
|
|
1038
|
+
"data-status": status,
|
|
1039
|
+
children: onClick === void 0 ? /* @__PURE__ */ jsx("span", {
|
|
1040
|
+
"aria-current": current,
|
|
1041
|
+
className: classes,
|
|
1042
|
+
children: content
|
|
1043
|
+
}) : /* @__PURE__ */ jsx("button", {
|
|
1044
|
+
type: "button",
|
|
1045
|
+
"aria-current": current,
|
|
1046
|
+
onClick,
|
|
1047
|
+
className: cn$1(classes, "cursor-pointer outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid focus-visible:outline-ring disabled:cursor-default"),
|
|
1048
|
+
...props,
|
|
1049
|
+
children: content
|
|
1050
|
+
})
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1053
|
+
// src/components/switch.tsx
|
|
1054
|
+
function Switch({ className, size = "default", ...props }) {
|
|
1055
|
+
return /* @__PURE__ */ jsx(Switch$1.Root, {
|
|
1056
|
+
"data-slot": "switch",
|
|
1057
|
+
"data-size": size,
|
|
1058
|
+
className: cn$1("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-input bg-secondary px-[3px] transition-colors duration-150 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid focus-visible:outline-ring aria-invalid:border-destructive data-[size=default]:h-6 data-[size=default]:w-10 data-[size=sm]:h-[18px] data-[size=sm]:w-[30px] data-checked:border-primary data-checked:bg-primary data-disabled:cursor-not-allowed data-disabled:opacity-50", className),
|
|
1059
|
+
...props,
|
|
1060
|
+
children: /* @__PURE__ */ jsx(Switch$1.Thumb, {
|
|
1061
|
+
"data-slot": "switch-thumb",
|
|
1062
|
+
className: "pointer-events-none block rounded-full bg-muted-foreground ring-0 transition-transform duration-150 group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-checked:bg-primary-foreground group-data-[size=default]/switch:data-checked:translate-x-4 group-data-[size=sm]/switch:data-checked:translate-x-[10px] data-unchecked:translate-x-0"
|
|
1063
|
+
})
|
|
1064
|
+
});
|
|
1065
|
+
}
|
|
1066
|
+
// src/components/table.tsx
|
|
1067
|
+
function Table({ className, ...props }) {
|
|
1068
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1069
|
+
"data-slot": "table-container",
|
|
1070
|
+
className: "relative w-full overflow-x-auto rounded-2xl border border-border bg-card",
|
|
1071
|
+
children: /* @__PURE__ */ jsx("table", {
|
|
1072
|
+
"data-slot": "table",
|
|
1073
|
+
className: cn$1("w-full caption-bottom text-sm", className),
|
|
1074
|
+
...props
|
|
1075
|
+
})
|
|
1076
|
+
});
|
|
1077
|
+
}
|
|
1078
|
+
function TableHeader({ className, ...props }) {
|
|
1079
|
+
return /* @__PURE__ */ jsx("thead", {
|
|
1080
|
+
"data-slot": "table-header",
|
|
1081
|
+
className: cn$1("bg-muted [&_tr]:border-b [&_tr]:hover:bg-muted", className),
|
|
1082
|
+
...props
|
|
1083
|
+
});
|
|
1084
|
+
}
|
|
1085
|
+
function TableBody({ className, ...props }) {
|
|
1086
|
+
return /* @__PURE__ */ jsx("tbody", {
|
|
1087
|
+
"data-slot": "table-body",
|
|
1088
|
+
className: cn$1("[&_tr:last-child]:border-0", className),
|
|
1089
|
+
...props
|
|
1090
|
+
});
|
|
1091
|
+
}
|
|
1092
|
+
function TableFooter({ className, ...props }) {
|
|
1093
|
+
return /* @__PURE__ */ jsx("tfoot", {
|
|
1094
|
+
"data-slot": "table-footer",
|
|
1095
|
+
className: cn$1("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className),
|
|
1096
|
+
...props
|
|
1097
|
+
});
|
|
1098
|
+
}
|
|
1099
|
+
function TableRow({ className, ...props }) {
|
|
1100
|
+
return /* @__PURE__ */ jsx("tr", {
|
|
1101
|
+
"data-slot": "table-row",
|
|
1102
|
+
className: cn$1("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted", className),
|
|
1103
|
+
...props
|
|
1104
|
+
});
|
|
1105
|
+
}
|
|
1106
|
+
function TableHead({ className, ...props }) {
|
|
1107
|
+
return /* @__PURE__ */ jsx("th", {
|
|
1108
|
+
"data-slot": "table-head",
|
|
1109
|
+
className: cn$1("h-11 px-4 text-left align-middle font-medium whitespace-nowrap text-muted-foreground [&:has([role=checkbox])]:pr-0", className),
|
|
1110
|
+
...props
|
|
1111
|
+
});
|
|
1112
|
+
}
|
|
1113
|
+
function TableCell({ className, ...props }) {
|
|
1114
|
+
return /* @__PURE__ */ jsx("td", {
|
|
1115
|
+
"data-slot": "table-cell",
|
|
1116
|
+
className: cn$1("px-4 py-3 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0", className),
|
|
1117
|
+
...props
|
|
1118
|
+
});
|
|
1119
|
+
}
|
|
1120
|
+
function TableCaption({ className, ...props }) {
|
|
1121
|
+
return /* @__PURE__ */ jsx("caption", {
|
|
1122
|
+
"data-slot": "table-caption",
|
|
1123
|
+
className: cn$1("mt-4 text-sm text-muted-foreground", className),
|
|
1124
|
+
...props
|
|
1125
|
+
});
|
|
1126
|
+
}
|
|
1127
|
+
// src/components/tabs.tsx
|
|
1128
|
+
function Tabs({ className, orientation = "horizontal", ...props }) {
|
|
1129
|
+
return /* @__PURE__ */ jsx(Tabs$1.Root, {
|
|
1130
|
+
"data-slot": "tabs",
|
|
1131
|
+
"data-orientation": orientation,
|
|
1132
|
+
className: cn$1("group/tabs flex gap-2 data-horizontal:flex-col", className),
|
|
1133
|
+
...props
|
|
1134
|
+
});
|
|
1135
|
+
}
|
|
1136
|
+
const tabsListVariants = cva("group/tabs-list inline-flex w-fit items-center justify-center rounded-full p-1 text-muted-foreground group-data-horizontal/tabs:h-auto group-data-vertical/tabs:rounded-2xl group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none", {
|
|
1137
|
+
variants: { variant: {
|
|
1138
|
+
default: "bg-secondary",
|
|
1139
|
+
line: "gap-1 bg-transparent"
|
|
1140
|
+
} },
|
|
1141
|
+
defaultVariants: { variant: "default" }
|
|
1142
|
+
});
|
|
1143
|
+
function TabsList({ className, variant = "default", ...props }) {
|
|
1144
|
+
return /* @__PURE__ */ jsx(Tabs$1.List, {
|
|
1145
|
+
"data-slot": "tabs-list",
|
|
1146
|
+
"data-variant": variant,
|
|
1147
|
+
className: cn$1(tabsListVariants({ variant }), className),
|
|
1148
|
+
...props
|
|
1149
|
+
});
|
|
1150
|
+
}
|
|
1151
|
+
function TabsTrigger({ className, ...props }) {
|
|
1152
|
+
return /* @__PURE__ */ jsx(Tabs$1.Trigger, {
|
|
1153
|
+
"data-slot": "tabs-trigger",
|
|
1154
|
+
className: cn$1("relative inline-flex h-8 flex-1 items-center justify-center gap-1.5 rounded-full border border-transparent px-3.5 text-sm font-medium whitespace-nowrap text-muted-foreground transition-colors duration-150 group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 group-data-[variant=default]/tabs-list:data-active:shadow-(--shadow-card) group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent", "data-active:bg-surface-raised data-active:text-foreground", "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100", className),
|
|
1155
|
+
...props
|
|
1156
|
+
});
|
|
1157
|
+
}
|
|
1158
|
+
function TabsContent({ className, ...props }) {
|
|
1159
|
+
return /* @__PURE__ */ jsx(Tabs$1.Content, {
|
|
1160
|
+
"data-slot": "tabs-content",
|
|
1161
|
+
className: cn$1("flex-1 rounded-md text-sm outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid focus-visible:outline-ring", className),
|
|
1162
|
+
...props
|
|
1163
|
+
});
|
|
1164
|
+
}
|
|
1165
|
+
// src/components/textarea.tsx
|
|
1166
|
+
function Textarea({ className, ...props }) {
|
|
1167
|
+
return /* @__PURE__ */ jsx("textarea", {
|
|
1168
|
+
"data-slot": "textarea",
|
|
1169
|
+
className: cn$1("flex field-sizing-content min-h-[88px] w-full min-w-0 resize-y rounded-md border border-input bg-surface-raised px-3.5 py-2.5 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid focus-visible:outline-ring disabled:cursor-not-allowed disabled:bg-muted disabled:opacity-50 aria-invalid:border-destructive md:text-sm", className),
|
|
1170
|
+
...props
|
|
1171
|
+
});
|
|
1172
|
+
}
|
|
1173
|
+
// src/components/tooltip.tsx
|
|
1174
|
+
function TooltipProvider({ delayDuration = 0, ...props }) {
|
|
1175
|
+
return /* @__PURE__ */ jsx(Tooltip$1.Provider, {
|
|
1176
|
+
"data-slot": "tooltip-provider",
|
|
1177
|
+
delayDuration,
|
|
1178
|
+
...props
|
|
1179
|
+
});
|
|
1180
|
+
}
|
|
1181
|
+
function Tooltip({ ...props }) {
|
|
1182
|
+
return /* @__PURE__ */ jsx(Tooltip$1.Root, {
|
|
1183
|
+
"data-slot": "tooltip",
|
|
1184
|
+
...props
|
|
1185
|
+
});
|
|
1186
|
+
}
|
|
1187
|
+
function TooltipTrigger({ ...props }) {
|
|
1188
|
+
return /* @__PURE__ */ jsx(Tooltip$1.Trigger, {
|
|
1189
|
+
"data-slot": "tooltip-trigger",
|
|
1190
|
+
...props
|
|
1191
|
+
});
|
|
1192
|
+
}
|
|
1193
|
+
function TooltipContent({ className, sideOffset = 0, children, ...props }) {
|
|
1194
|
+
return /* @__PURE__ */ jsxs(Tooltip$1.Content, {
|
|
1195
|
+
"data-slot": "tooltip-content",
|
|
1196
|
+
sideOffset,
|
|
1197
|
+
className: cn$1("z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-sm bg-primary px-2.5 py-1.5 text-xs font-medium text-primary-foreground has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
1198
|
+
...props,
|
|
1199
|
+
children: [children, /* @__PURE__ */ jsx(Tooltip$1.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-primary fill-primary" })]
|
|
1200
|
+
});
|
|
1201
|
+
}
|
|
1202
|
+
// src/form.tsx
|
|
1203
|
+
/** `useForm` with a Zod schema as the resolver: values are validated and parsed by the schema. */
|
|
1204
|
+
function useZodForm(schema, options) {
|
|
1205
|
+
return useForm({
|
|
1206
|
+
...options,
|
|
1207
|
+
resolver: zodResolver(schema),
|
|
1208
|
+
shouldFocusError: true
|
|
1209
|
+
});
|
|
1210
|
+
}
|
|
1211
|
+
/** A `<form>` bound to a react-hook-form instance; browser validation is off so errors are the form's own. */
|
|
1212
|
+
function Form({ form, onSubmit, children, ...props }) {
|
|
1213
|
+
return /* @__PURE__ */ jsx(FormProvider, {
|
|
1214
|
+
...form,
|
|
1215
|
+
children: /* @__PURE__ */ jsx("form", {
|
|
1216
|
+
noValidate: true,
|
|
1217
|
+
...props,
|
|
1218
|
+
onSubmit: (event) => void form.handleSubmit(onSubmit)(event),
|
|
1219
|
+
children
|
|
1220
|
+
})
|
|
1221
|
+
});
|
|
1222
|
+
}
|
|
1223
|
+
/** One labelled form control with its description and error message. */
|
|
1224
|
+
function FormField({ control, name, label, description, orientation = "vertical", className, render }) {
|
|
1225
|
+
const id = useId();
|
|
1226
|
+
const { field, fieldState } = useController({
|
|
1227
|
+
control,
|
|
1228
|
+
name
|
|
1229
|
+
});
|
|
1230
|
+
const invalid = fieldState.error !== void 0;
|
|
1231
|
+
const descriptionId = `${id}-description`;
|
|
1232
|
+
const errorId = `${id}-error`;
|
|
1233
|
+
const describedBy = [description === void 0 ? null : descriptionId, invalid ? errorId : null].filter((part) => part !== null);
|
|
1234
|
+
const controlProps = {
|
|
1235
|
+
id,
|
|
1236
|
+
"aria-invalid": invalid ? true : void 0,
|
|
1237
|
+
"aria-describedby": describedBy.length === 0 ? void 0 : describedBy.join(" ")
|
|
1238
|
+
};
|
|
1239
|
+
const labelled = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(FieldLabel, {
|
|
1240
|
+
htmlFor: id,
|
|
1241
|
+
children: label
|
|
1242
|
+
}), description === void 0 ? null : /* @__PURE__ */ jsx(FieldDescription, {
|
|
1243
|
+
id: descriptionId,
|
|
1244
|
+
children: description
|
|
1245
|
+
})] });
|
|
1246
|
+
const error = invalid ? /* @__PURE__ */ jsx(FieldError, {
|
|
1247
|
+
id: errorId,
|
|
1248
|
+
errors: [fieldState.error]
|
|
1249
|
+
}) : null;
|
|
1250
|
+
const rendered = render({
|
|
1251
|
+
field,
|
|
1252
|
+
fieldState,
|
|
1253
|
+
control: controlProps
|
|
1254
|
+
});
|
|
1255
|
+
return /* @__PURE__ */ jsx(Field, {
|
|
1256
|
+
orientation,
|
|
1257
|
+
"data-invalid": invalid ? true : void 0,
|
|
1258
|
+
className,
|
|
1259
|
+
children: orientation === "horizontal" ? /* @__PURE__ */ jsxs(Fragment, { children: [rendered, /* @__PURE__ */ jsxs(FieldContent, { children: [labelled, error] })] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1260
|
+
labelled,
|
|
1261
|
+
rendered,
|
|
1262
|
+
error
|
|
1263
|
+
] })
|
|
1264
|
+
});
|
|
1265
|
+
}
|
|
1266
|
+
/** The form-level error (`form.setError("root", …)`, e.g. a server rejection), announced when it appears. */
|
|
1267
|
+
function FormRootError({ className }) {
|
|
1268
|
+
const { errors } = useFormState();
|
|
1269
|
+
const message = errors.root?.message;
|
|
1270
|
+
if (message === void 0) return null;
|
|
1271
|
+
return /* @__PURE__ */ jsx(Alert, {
|
|
1272
|
+
variant: "destructive",
|
|
1273
|
+
className,
|
|
1274
|
+
children: /* @__PURE__ */ jsx(AlertDescription, { children: message })
|
|
1275
|
+
});
|
|
1276
|
+
}
|
|
1277
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, Avatar, AvatarFallback, AvatarGroup, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Form, FormField, FormRootError, Input, Label, NativeSelect, NativeSelectOptGroup, NativeSelectOption, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Progress, RadioGroup, RadioGroupItem, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Skeleton, Steps, StepsItem, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cn, tabsListVariants, toast, useZodForm };
|
|
1278
|
+
|
|
1279
|
+
//# sourceMappingURL=index.js.map
|