@fluid-app/ui-primitives 0.1.5 → 0.1.7

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/index.mjs ADDED
@@ -0,0 +1,1576 @@
1
+ import { clsx } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+ import { zodResolver } from "@hookform/resolvers/zod";
4
+ import { Controller, FormProvider, useForm, useFormContext, useFormState } from "react-hook-form";
5
+ import * as React from "react";
6
+ import { createContext, useContext } from "react";
7
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ import * as AccordionPrimitive from "@radix-ui/react-accordion";
9
+ import { CalendarIcon, Check, CheckIcon, ChevronDown, ChevronDownIcon, ChevronLeft, ChevronLeftIcon, ChevronRight, ChevronRightIcon, ChevronUpIcon, Circle, CircleCheckIcon, CircleIcon, InfoIcon, Loader2Icon, LoaderIcon, MoreHorizontalIcon, OctagonXIcon, TriangleAlertIcon, X } from "lucide-react";
10
+ import { cva } from "class-variance-authority";
11
+ import { AlertDialog as AlertDialog$1, Avatar as Avatar$1, RadioGroup as RadioGroup$1, Slot } from "radix-ui";
12
+ import { Slot as Slot$1 } from "@radix-ui/react-slot";
13
+ import { DayPicker } from "react-day-picker";
14
+ import * as RechartsPrimitive from "recharts";
15
+ import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
16
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
17
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
18
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
19
+ import * as LabelPrimitive from "@radix-ui/react-label";
20
+ import * as TogglePrimitive from "@radix-ui/react-toggle";
21
+ import * as SelectPrimitive from "@radix-ui/react-select";
22
+ import * as SeparatorPrimitive from "@radix-ui/react-separator";
23
+ import * as SliderPrimitive from "@radix-ui/react-slider";
24
+ import { Toaster as Toaster$1 } from "sonner";
25
+ import * as SwitchPrimitive from "@radix-ui/react-switch";
26
+ import * as TabsPrimitive from "@radix-ui/react-tabs";
27
+ import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
28
+ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
29
+ //#region src/lib/utils.ts
30
+ function cn(...inputs) {
31
+ return twMerge(clsx(inputs));
32
+ }
33
+ //#endregion
34
+ //#region src/hooks/use-zod-form.ts
35
+ /**
36
+ * A typed wrapper around useForm that uses zodResolver.
37
+ * Breaks the TypeScript inference chain that causes TS2589
38
+ * "Type instantiation is excessively deep" errors with complex Zod schemas.
39
+ */
40
+ function useZodForm(schema, options) {
41
+ "use no memo";
42
+ const resolver = zodResolver(schema);
43
+ return useForm({
44
+ ...options,
45
+ resolver
46
+ });
47
+ }
48
+ //#endregion
49
+ //#region src/contexts/PortalContainerContext.tsx
50
+ const PortalContainerContext = createContext(void 0);
51
+ /**
52
+ * Provides a custom container element for Radix UI portals.
53
+ * When set, portal-using components (Popover, Select, DropdownMenu, etc.)
54
+ * will render into this container instead of document.body,
55
+ * preserving CSS theme variable inheritance.
56
+ */
57
+ function PortalContainerProvider({ children, container }) {
58
+ return /* @__PURE__ */ jsx(PortalContainerContext.Provider, {
59
+ value: container ?? void 0,
60
+ children
61
+ });
62
+ }
63
+ function usePortalContainer() {
64
+ return useContext(PortalContainerContext);
65
+ }
66
+ //#endregion
67
+ //#region src/components/Accordion.tsx
68
+ function Accordion({ className, ...props }) {
69
+ return /* @__PURE__ */ jsx(AccordionPrimitive.Root, {
70
+ "data-slot": "accordion",
71
+ className: cn("cn-accordion flex w-full flex-col", className),
72
+ ...props
73
+ });
74
+ }
75
+ function AccordionItem({ className, ...props }) {
76
+ return /* @__PURE__ */ jsx(AccordionPrimitive.Item, {
77
+ "data-slot": "accordion-item",
78
+ className: cn("cn-accordion-item", className),
79
+ ...props
80
+ });
81
+ }
82
+ function AccordionTrigger({ className, children, ...props }) {
83
+ return /* @__PURE__ */ jsx(AccordionPrimitive.Header, {
84
+ className: "flex",
85
+ children: /* @__PURE__ */ jsxs(AccordionPrimitive.Trigger, {
86
+ "data-slot": "accordion-trigger",
87
+ className: cn("cn-accordion-trigger group/accordion-trigger relative flex flex-1 items-start justify-between border border-transparent transition-all outline-none disabled:pointer-events-none disabled:opacity-50", className),
88
+ ...props,
89
+ children: [children, /* @__PURE__ */ jsx(ChevronDown, { className: "cn-accordion-trigger-icon pointer-events-none shrink-0 transition-transform duration-200 group-aria-expanded/accordion-trigger:rotate-180" })]
90
+ })
91
+ });
92
+ }
93
+ function AccordionContent({ className, children, ...props }) {
94
+ return /* @__PURE__ */ jsx(AccordionPrimitive.Content, {
95
+ "data-slot": "accordion-content",
96
+ className: "cn-accordion-content overflow-hidden",
97
+ ...props,
98
+ children: /* @__PURE__ */ jsx("div", {
99
+ className: cn("cn-accordion-content-inner [&_a]:hover:text-foreground h-(--radix-accordion-content-height) [&_a]:underline [&_a]:underline-offset-3 [&_p:not(:last-child)]:mb-4", className),
100
+ children
101
+ })
102
+ });
103
+ }
104
+ //#endregion
105
+ //#region src/components/Alert.tsx
106
+ const alertVariants = cva("relative grid h-full w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current", {
107
+ variants: { variant: {
108
+ default: "bg-card text-card-foreground",
109
+ destructive: "bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"
110
+ } },
111
+ defaultVariants: { variant: "default" }
112
+ });
113
+ function Alert({ className, variant, ...props }) {
114
+ return /* @__PURE__ */ jsx("div", {
115
+ "data-slot": "alert",
116
+ role: "alert",
117
+ className: cn(alertVariants({ variant }), className),
118
+ ...props
119
+ });
120
+ }
121
+ function AlertTitle({ className, ...props }) {
122
+ return /* @__PURE__ */ jsx("div", {
123
+ "data-slot": "alert-title",
124
+ className: cn("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight", className),
125
+ ...props
126
+ });
127
+ }
128
+ function AlertDescription({ className, ...props }) {
129
+ return /* @__PURE__ */ jsx("div", {
130
+ "data-slot": "alert-description",
131
+ className: cn("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed", className),
132
+ ...props
133
+ });
134
+ }
135
+ //#endregion
136
+ //#region src/components/Button.tsx
137
+ const buttonVariants = cva("focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
138
+ variants: {
139
+ variant: {
140
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
141
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
142
+ outline: "bg-background hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50 border shadow-xs",
143
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
144
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
145
+ link: "text-primary underline-offset-4 hover:underline"
146
+ },
147
+ size: {
148
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
149
+ sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
150
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
151
+ xl: "h-11 rounded-md px-8 has-[>svg]:px-5",
152
+ icon: "size-9",
153
+ "icon-xs": "size-6",
154
+ "icon-sm": "size-8",
155
+ "icon-lg": "size-10"
156
+ }
157
+ },
158
+ defaultVariants: {
159
+ variant: "default",
160
+ size: "default"
161
+ }
162
+ });
163
+ function Button({ className, variant, size, asChild = false, ...props }) {
164
+ return /* @__PURE__ */ jsx(asChild ? Slot$1 : "button", {
165
+ "data-slot": "button",
166
+ className: cn(buttonVariants({
167
+ variant,
168
+ size,
169
+ className
170
+ })),
171
+ ...props
172
+ });
173
+ }
174
+ //#endregion
175
+ //#region src/components/AlertDialog.tsx
176
+ function AlertDialog({ ...props }) {
177
+ return /* @__PURE__ */ jsx(AlertDialog$1.Root, {
178
+ "data-slot": "alert-dialog",
179
+ ...props
180
+ });
181
+ }
182
+ function AlertDialogTrigger({ ...props }) {
183
+ return /* @__PURE__ */ jsx(AlertDialog$1.Trigger, {
184
+ "data-slot": "alert-dialog-trigger",
185
+ ...props
186
+ });
187
+ }
188
+ function AlertDialogPortal({ ...props }) {
189
+ const portalContainer = usePortalContainer();
190
+ return /* @__PURE__ */ jsx(AlertDialog$1.Portal, {
191
+ "data-slot": "alert-dialog-portal",
192
+ container: portalContainer,
193
+ ...props
194
+ });
195
+ }
196
+ function AlertDialogOverlay({ className, ...props }) {
197
+ return /* @__PURE__ */ jsx(AlertDialog$1.Overlay, {
198
+ "data-slot": "alert-dialog-overlay",
199
+ className: cn("data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", className),
200
+ ...props
201
+ });
202
+ }
203
+ function AlertDialogContent({ className, size = "default", ...props }) {
204
+ return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [/* @__PURE__ */ jsx(AlertDialogOverlay, {}), /* @__PURE__ */ jsx(AlertDialog$1.Content, {
205
+ "data-slot": "alert-dialog-content",
206
+ "data-size": size,
207
+ className: cn("group/alert-dialog-content bg-background data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg", className),
208
+ ...props
209
+ })] });
210
+ }
211
+ function AlertDialogHeader({ className, ...props }) {
212
+ return /* @__PURE__ */ jsx("div", {
213
+ "data-slot": "alert-dialog-header",
214
+ className: cn("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-6 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),
215
+ ...props
216
+ });
217
+ }
218
+ function AlertDialogFooter({ className, ...props }) {
219
+ return /* @__PURE__ */ jsx("div", {
220
+ "data-slot": "alert-dialog-footer",
221
+ className: cn("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),
222
+ ...props
223
+ });
224
+ }
225
+ function AlertDialogTitle({ className, ...props }) {
226
+ return /* @__PURE__ */ jsx(AlertDialog$1.Title, {
227
+ "data-slot": "alert-dialog-title",
228
+ className: cn("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", className),
229
+ ...props
230
+ });
231
+ }
232
+ function AlertDialogDescription({ className, ...props }) {
233
+ return /* @__PURE__ */ jsx(AlertDialog$1.Description, {
234
+ "data-slot": "alert-dialog-description",
235
+ className: cn("text-muted-foreground text-sm", className),
236
+ ...props
237
+ });
238
+ }
239
+ function AlertDialogMedia({ className, ...props }) {
240
+ return /* @__PURE__ */ jsx("div", {
241
+ "data-slot": "alert-dialog-media",
242
+ className: cn("bg-muted mb-2 inline-flex size-16 items-center justify-center rounded-md sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8", className),
243
+ ...props
244
+ });
245
+ }
246
+ function AlertDialogAction({ className, variant = "default", size = "default", ...props }) {
247
+ return /* @__PURE__ */ jsx(Button, {
248
+ variant,
249
+ size,
250
+ asChild: true,
251
+ children: /* @__PURE__ */ jsx(AlertDialog$1.Action, {
252
+ "data-slot": "alert-dialog-action",
253
+ className: cn(className),
254
+ ...props
255
+ })
256
+ });
257
+ }
258
+ function AlertDialogCancel({ className, variant = "outline", size = "default", ...props }) {
259
+ return /* @__PURE__ */ jsx(Button, {
260
+ variant,
261
+ size,
262
+ asChild: true,
263
+ children: /* @__PURE__ */ jsx(AlertDialog$1.Cancel, {
264
+ "data-slot": "alert-dialog-cancel",
265
+ className: cn(className),
266
+ ...props
267
+ })
268
+ });
269
+ }
270
+ //#endregion
271
+ //#region src/components/Avatar.tsx
272
+ function Avatar({ className, size = "default", ...props }) {
273
+ return /* @__PURE__ */ jsx(Avatar$1.Root, {
274
+ "data-slot": "avatar",
275
+ "data-size": size,
276
+ className: cn("group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6", className),
277
+ ...props
278
+ });
279
+ }
280
+ function AvatarImage({ className, ...props }) {
281
+ return /* @__PURE__ */ jsx(Avatar$1.Image, {
282
+ "data-slot": "avatar-image",
283
+ className: cn("aspect-square size-full", className),
284
+ ...props
285
+ });
286
+ }
287
+ function AvatarFallback({ className, ...props }) {
288
+ return /* @__PURE__ */ jsx(Avatar$1.Fallback, {
289
+ "data-slot": "avatar-fallback",
290
+ className: cn("bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs", className),
291
+ ...props
292
+ });
293
+ }
294
+ function AvatarBadge({ className, ...props }) {
295
+ return /* @__PURE__ */ jsx("span", {
296
+ "data-slot": "avatar-badge",
297
+ className: cn("bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full ring-2 select-none", "group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden", "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2", "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2", className),
298
+ ...props
299
+ });
300
+ }
301
+ function AvatarGroup({ className, ...props }) {
302
+ return /* @__PURE__ */ jsx("div", {
303
+ "data-slot": "avatar-group",
304
+ className: cn("group/avatar-group *:data-[slot=avatar]:ring-background flex -space-x-2 *:data-[slot=avatar]:ring-2", className),
305
+ ...props
306
+ });
307
+ }
308
+ function AvatarGroupCount({ className, ...props }) {
309
+ return /* @__PURE__ */ jsx("div", {
310
+ "data-slot": "avatar-group-count",
311
+ className: cn("bg-muted text-muted-foreground ring-background relative flex size-8 shrink-0 items-center justify-center rounded-full text-sm ring-2 group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3", className),
312
+ ...props
313
+ });
314
+ }
315
+ //#endregion
316
+ //#region src/components/Badge.tsx
317
+ const badgeVariants = cva("focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] [&>svg]:pointer-events-none [&>svg]:size-3", {
318
+ variants: { variant: {
319
+ default: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
320
+ secondary: "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
321
+ destructive: "bg-destructive focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90 text-white",
322
+ outline: "border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
323
+ ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
324
+ link: "text-primary underline-offset-4 [a&]:hover:underline"
325
+ } },
326
+ defaultVariants: { variant: "default" }
327
+ });
328
+ function Badge({ className, variant = "default", asChild = false, ...props }) {
329
+ return /* @__PURE__ */ jsx(asChild ? Slot.Root : "span", {
330
+ "data-slot": "badge",
331
+ "data-variant": variant,
332
+ className: cn(badgeVariants({ variant }), className),
333
+ ...props
334
+ });
335
+ }
336
+ //#endregion
337
+ //#region src/components/Calendar.tsx
338
+ const Calendar = Object.assign(function CalendarComponent({ className, classNames, showOutsideDays = true, ...props }) {
339
+ return /* @__PURE__ */ jsx(DayPicker, {
340
+ showOutsideDays,
341
+ className: cn("p-3", className),
342
+ classNames: {
343
+ months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
344
+ month: "space-y-4",
345
+ caption: "flex justify-center pt-1 relative items-center",
346
+ caption_label: "text-sm font-medium",
347
+ nav: "space-x-1 flex items-center",
348
+ nav_button: cn(buttonVariants({ variant: "ghost" }), "h-7 w-7 justify-center bg-transparent p-0 opacity-50 hover:opacity-100"),
349
+ nav_button_previous: "absolute left-1",
350
+ nav_button_next: "absolute right-1",
351
+ table: "w-full border-collapse space-y-1",
352
+ head_row: "flex",
353
+ head_cell: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
354
+ row: "flex w-full mt-2",
355
+ cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
356
+ day: cn(buttonVariants({ variant: "ghost" }), "h-9 w-9 justify-center p-0 font-normal aria-selected:opacity-100"),
357
+ day_range_end: "day-range-end",
358
+ day_selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
359
+ day_today: "bg-accent text-accent-foreground",
360
+ day_outside: "day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",
361
+ day_disabled: "text-muted-foreground opacity-50",
362
+ day_range_middle: "aria-selected:bg-accent aria-selected:text-accent-foreground",
363
+ day_hidden: "invisible",
364
+ ...classNames
365
+ },
366
+ components: {
367
+ IconLeft: ({ className: iconClassName, ...iconProps }) => /* @__PURE__ */ jsx(ChevronLeft, {
368
+ className: cn("h-4 w-4", iconClassName),
369
+ ...iconProps
370
+ }),
371
+ IconRight: ({ className: iconClassName, ...iconProps }) => /* @__PURE__ */ jsx(ChevronRight, {
372
+ className: cn("h-4 w-4", iconClassName),
373
+ ...iconProps
374
+ })
375
+ },
376
+ ...props
377
+ });
378
+ }, { displayName: "Calendar" });
379
+ //#endregion
380
+ //#region src/components/Card.tsx
381
+ function Card({ className, ...props }) {
382
+ return /* @__PURE__ */ jsx("div", {
383
+ "data-slot": "card",
384
+ className: cn("bg-card text-card-foreground flex h-full flex-col gap-6 rounded-xl border py-6 shadow-sm", className),
385
+ ...props
386
+ });
387
+ }
388
+ function CardHeader({ className, ...props }) {
389
+ return /* @__PURE__ */ jsx("div", {
390
+ "data-slot": "card-header",
391
+ className: cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", className),
392
+ ...props
393
+ });
394
+ }
395
+ function CardTitle({ className, ...props }) {
396
+ return /* @__PURE__ */ jsx("div", {
397
+ "data-slot": "card-title",
398
+ className: cn("leading-none font-semibold", className),
399
+ ...props
400
+ });
401
+ }
402
+ function CardDescription({ className, ...props }) {
403
+ return /* @__PURE__ */ jsx("div", {
404
+ "data-slot": "card-description",
405
+ className: cn("text-muted-foreground text-sm", className),
406
+ ...props
407
+ });
408
+ }
409
+ function CardAction({ className, ...props }) {
410
+ return /* @__PURE__ */ jsx("div", {
411
+ "data-slot": "card-action",
412
+ className: cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className),
413
+ ...props
414
+ });
415
+ }
416
+ function CardContent({ className, ...props }) {
417
+ return /* @__PURE__ */ jsx("div", {
418
+ "data-slot": "card-content",
419
+ className: cn("px-6", className),
420
+ ...props
421
+ });
422
+ }
423
+ function CardFooter({ className, ...props }) {
424
+ return /* @__PURE__ */ jsx("div", {
425
+ "data-slot": "card-footer",
426
+ className: cn("flex items-center px-6 [.border-t]:pt-6", className),
427
+ ...props
428
+ });
429
+ }
430
+ //#endregion
431
+ //#region src/components/Chart.tsx
432
+ const THEMES = {
433
+ light: "",
434
+ dark: ".dark"
435
+ };
436
+ const ChartContext = React.createContext(null);
437
+ function useChart() {
438
+ const context = React.useContext(ChartContext);
439
+ if (!context) throw new Error("useChart must be used within a <ChartContainer />");
440
+ return context;
441
+ }
442
+ function ChartContainer({ id, className, children, config, ...props }) {
443
+ const uniqueId = React.useId();
444
+ const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
445
+ return /* @__PURE__ */ jsx(ChartContext.Provider, {
446
+ value: { config },
447
+ children: /* @__PURE__ */ jsxs("div", {
448
+ "data-slot": "chart",
449
+ "data-chart": chartId,
450
+ className: cn("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", className),
451
+ ...props,
452
+ children: [/* @__PURE__ */ jsx(ChartStyle, {
453
+ id: chartId,
454
+ config
455
+ }), /* @__PURE__ */ jsx(RechartsPrimitive.ResponsiveContainer, { children })]
456
+ })
457
+ });
458
+ }
459
+ const ChartStyle = ({ id, config }) => {
460
+ const colorConfig = Object.entries(config).filter(([, cfg]) => cfg.theme || cfg.color);
461
+ if (!colorConfig.length) return null;
462
+ return /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: Object.entries(THEMES).map(([theme, prefix]) => `
463
+ ${prefix} [data-chart=${id}] {
464
+ ${colorConfig.map(([key, itemConfig]) => {
465
+ const color = itemConfig.theme?.[theme] || itemConfig.color;
466
+ return color ? ` --color-${key}: ${color};` : null;
467
+ }).join("\n")}
468
+ }
469
+ `).join("\n") } });
470
+ };
471
+ const ChartTooltip = RechartsPrimitive.Tooltip;
472
+ function ChartTooltipContent({ active, payload, className, indicator = "dot", hideLabel = false, hideIndicator = false, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey }) {
473
+ const { config } = useChart();
474
+ const tooltipLabel = React.useMemo(() => {
475
+ if (hideLabel || !payload?.length) return null;
476
+ const [item] = payload;
477
+ const itemConfig = getPayloadConfigFromPayload(config, item, `${labelKey || item?.dataKey || item?.name || "value"}`);
478
+ const value = !labelKey && typeof label === "string" ? config[label]?.label || label : itemConfig?.label;
479
+ if (labelFormatter) return /* @__PURE__ */ jsx("div", {
480
+ className: cn("font-medium", labelClassName),
481
+ children: labelFormatter(value, payload)
482
+ });
483
+ if (!value) return null;
484
+ return /* @__PURE__ */ jsx("div", {
485
+ className: cn("font-medium", labelClassName),
486
+ children: value
487
+ });
488
+ }, [
489
+ label,
490
+ labelFormatter,
491
+ payload,
492
+ hideLabel,
493
+ labelClassName,
494
+ config,
495
+ labelKey
496
+ ]);
497
+ if (!active || !payload?.length) return null;
498
+ const nestLabel = payload.length === 1 && indicator !== "dot";
499
+ return /* @__PURE__ */ jsxs("div", {
500
+ className: cn("border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl", className),
501
+ children: [!nestLabel ? tooltipLabel : null, /* @__PURE__ */ jsx("div", {
502
+ className: "grid gap-1.5",
503
+ children: payload.filter((item) => item.type !== "none").map((item, index) => {
504
+ const itemConfig = getPayloadConfigFromPayload(config, item, `${nameKey || item.name || item.dataKey || "value"}`);
505
+ const indicatorColor = color || item.payload.fill || item.color;
506
+ return /* @__PURE__ */ jsx("div", {
507
+ className: cn("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5", indicator === "dot" && "items-center"),
508
+ children: formatter && item?.value !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ jsxs(Fragment, { children: [itemConfig?.icon ? /* @__PURE__ */ jsx(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ jsx("div", {
509
+ className: cn("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)", {
510
+ "h-2.5 w-2.5": indicator === "dot",
511
+ "w-1": indicator === "line",
512
+ "w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
513
+ "my-0.5": nestLabel && indicator === "dashed"
514
+ }),
515
+ style: {
516
+ "--color-bg": indicatorColor,
517
+ "--color-border": indicatorColor
518
+ }
519
+ }), /* @__PURE__ */ jsxs("div", {
520
+ className: cn("flex flex-1 justify-between leading-none", nestLabel ? "items-end" : "items-center"),
521
+ children: [/* @__PURE__ */ jsxs("div", {
522
+ className: "grid gap-1.5",
523
+ children: [nestLabel ? tooltipLabel : null, /* @__PURE__ */ jsx("span", {
524
+ className: "text-muted-foreground",
525
+ children: itemConfig?.label || item.name
526
+ })]
527
+ }), item.value && /* @__PURE__ */ jsx("span", {
528
+ className: "text-foreground font-mono font-medium tabular-nums",
529
+ children: item.value.toLocaleString()
530
+ })]
531
+ })] })
532
+ }, item.dataKey);
533
+ })
534
+ })]
535
+ });
536
+ }
537
+ const ChartLegend = RechartsPrimitive.Legend;
538
+ function ChartLegendContent({ className, hideIcon = false, payload, verticalAlign = "bottom", nameKey }) {
539
+ const { config } = useChart();
540
+ if (!payload?.length) return null;
541
+ return /* @__PURE__ */ jsx("div", {
542
+ className: cn("flex items-center justify-center gap-4", verticalAlign === "top" ? "pb-3" : "pt-3", className),
543
+ children: payload.filter((item) => item.type !== "none").map((item) => {
544
+ const itemConfig = getPayloadConfigFromPayload(config, item, `${nameKey || item.dataKey || "value"}`);
545
+ return /* @__PURE__ */ jsxs("div", {
546
+ className: cn("[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"),
547
+ children: [itemConfig?.icon && !hideIcon ? /* @__PURE__ */ jsx(itemConfig.icon, {}) : /* @__PURE__ */ jsx("div", {
548
+ className: "h-2 w-2 shrink-0 rounded-[2px]",
549
+ style: { backgroundColor: item.color }
550
+ }), itemConfig?.label]
551
+ }, item.value);
552
+ })
553
+ });
554
+ }
555
+ function getPayloadConfigFromPayload(config, payload, key) {
556
+ if (typeof payload !== "object" || payload === null) return;
557
+ const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null ? payload.payload : void 0;
558
+ let configLabelKey = key;
559
+ if (key in payload && typeof payload[key] === "string") configLabelKey = payload[key];
560
+ else if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === "string") configLabelKey = payloadPayload[key];
561
+ return configLabelKey in config ? config[configLabelKey] : config[key];
562
+ }
563
+ //#endregion
564
+ //#region src/components/Collapsible.tsx
565
+ function Collapsible({ ...props }) {
566
+ return /* @__PURE__ */ jsx(CollapsiblePrimitive.Root, {
567
+ "data-slot": "collapsible",
568
+ ...props
569
+ });
570
+ }
571
+ function CollapsibleTrigger({ ...props }) {
572
+ return /* @__PURE__ */ jsx(CollapsiblePrimitive.CollapsibleTrigger, {
573
+ "data-slot": "collapsible-trigger",
574
+ ...props
575
+ });
576
+ }
577
+ function CollapsibleContent({ ...props }) {
578
+ return /* @__PURE__ */ jsx(CollapsiblePrimitive.CollapsibleContent, {
579
+ "data-slot": "collapsible-content",
580
+ ...props
581
+ });
582
+ }
583
+ //#endregion
584
+ //#region src/components/Popover.tsx
585
+ function Popover({ ...props }) {
586
+ return /* @__PURE__ */ jsx(PopoverPrimitive.Root, {
587
+ "data-slot": "popover",
588
+ ...props
589
+ });
590
+ }
591
+ function PopoverTrigger({ ...props }) {
592
+ return /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, {
593
+ "data-slot": "popover-trigger",
594
+ ...props
595
+ });
596
+ }
597
+ function PopoverContent({ className, align = "center", sideOffset = 4, ...props }) {
598
+ const portalContainer = usePortalContainer();
599
+ return /* @__PURE__ */ jsx(PopoverPrimitive.Portal, {
600
+ container: portalContainer,
601
+ children: /* @__PURE__ */ jsx(PopoverPrimitive.Content, {
602
+ "data-slot": "popover-content",
603
+ align,
604
+ sideOffset,
605
+ className: cn("cn-popover-content z-50 w-72 origin-(--radix-popover-content-transform-origin) outline-hidden", className),
606
+ ...props
607
+ })
608
+ });
609
+ }
610
+ function PopoverAnchor({ ...props }) {
611
+ return /* @__PURE__ */ jsx(PopoverPrimitive.Anchor, {
612
+ "data-slot": "popover-anchor",
613
+ ...props
614
+ });
615
+ }
616
+ function PopoverHeader({ className, ...props }) {
617
+ return /* @__PURE__ */ jsx("div", {
618
+ "data-slot": "popover-header",
619
+ className: cn("cn-popover-header", className),
620
+ ...props
621
+ });
622
+ }
623
+ function PopoverTitle({ className, ...props }) {
624
+ return /* @__PURE__ */ jsx("div", {
625
+ "data-slot": "popover-title",
626
+ className: cn("cn-popover-title", className),
627
+ ...props
628
+ });
629
+ }
630
+ function PopoverDescription({ className, ...props }) {
631
+ return /* @__PURE__ */ jsx("p", {
632
+ "data-slot": "popover-description",
633
+ className: cn("cn-popover-description", className),
634
+ ...props
635
+ });
636
+ }
637
+ //#endregion
638
+ //#region src/components/DatePicker.tsx
639
+ const defaultFormatDate = (date) => new Intl.DateTimeFormat(void 0, {
640
+ month: "long",
641
+ day: "numeric",
642
+ year: "numeric"
643
+ }).format(date);
644
+ function DatePicker({ value, onChange, placeholder = "Pick a date", formatDate = defaultFormatDate, disabled, className, calendarProps }) {
645
+ const [open, setOpen] = React.useState(false);
646
+ return /* @__PURE__ */ jsxs(Popover, {
647
+ open,
648
+ onOpenChange: setOpen,
649
+ children: [/* @__PURE__ */ jsx(PopoverTrigger, {
650
+ asChild: true,
651
+ children: /* @__PURE__ */ jsxs(Button, {
652
+ "data-slot": "date-picker",
653
+ variant: "outline",
654
+ disabled,
655
+ className: cn("w-full justify-start text-left font-normal", !value && "text-muted-foreground", className),
656
+ children: [/* @__PURE__ */ jsx(CalendarIcon, { className: "mr-2 size-4" }), value ? formatDate(value) : /* @__PURE__ */ jsx("span", { children: placeholder })]
657
+ })
658
+ }), /* @__PURE__ */ jsx(PopoverContent, {
659
+ className: "w-auto p-0",
660
+ align: "start",
661
+ children: /* @__PURE__ */ jsx(Calendar, {
662
+ mode: "single",
663
+ selected: value,
664
+ onSelect: (date) => {
665
+ onChange?.(date);
666
+ setOpen(false);
667
+ },
668
+ initialFocus: true,
669
+ ...calendarProps
670
+ })
671
+ })]
672
+ });
673
+ }
674
+ //#endregion
675
+ //#region src/components/Dialog.tsx
676
+ function Dialog({ ...props }) {
677
+ return /* @__PURE__ */ jsx(DialogPrimitive.Root, {
678
+ "data-slot": "dialog",
679
+ ...props
680
+ });
681
+ }
682
+ function DialogTrigger({ ...props }) {
683
+ return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, {
684
+ "data-slot": "dialog-trigger",
685
+ ...props
686
+ });
687
+ }
688
+ function DialogPortal({ ...props }) {
689
+ const portalContainer = usePortalContainer();
690
+ return /* @__PURE__ */ jsx(DialogPrimitive.Portal, {
691
+ "data-slot": "dialog-portal",
692
+ container: portalContainer,
693
+ ...props
694
+ });
695
+ }
696
+ function DialogClose({ ...props }) {
697
+ return /* @__PURE__ */ jsx(DialogPrimitive.Close, {
698
+ "data-slot": "dialog-close",
699
+ ...props
700
+ });
701
+ }
702
+ function DialogOverlay({ className, ...props }) {
703
+ return /* @__PURE__ */ jsx(DialogPrimitive.Overlay, {
704
+ "data-slot": "dialog-overlay",
705
+ className: cn("data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-gray-900/70 backdrop-blur-sm", className),
706
+ ...props
707
+ });
708
+ }
709
+ function DialogContent({ className, children, showCloseButton = true, overlayClassName, ...props }) {
710
+ return /* @__PURE__ */ jsxs(DialogPortal, {
711
+ "data-slot": "dialog-portal",
712
+ children: [/* @__PURE__ */ jsx(DialogOverlay, { className: overlayClassName }), /* @__PURE__ */ jsxs(DialogPrimitive.Content, {
713
+ "data-slot": "dialog-content",
714
+ className: cn("bg-background data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-6 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg", className),
715
+ ...props,
716
+ children: [children, showCloseButton && /* @__PURE__ */ jsxs(DialogPrimitive.Close, {
717
+ "data-slot": "dialog-close",
718
+ className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
719
+ children: [/* @__PURE__ */ jsx(X, {}), /* @__PURE__ */ jsx("span", {
720
+ className: "sr-only",
721
+ children: "Close"
722
+ })]
723
+ })]
724
+ })]
725
+ });
726
+ }
727
+ function DialogHeader({ className, ...props }) {
728
+ return /* @__PURE__ */ jsx("div", {
729
+ "data-slot": "dialog-header",
730
+ className: cn("flex flex-col gap-2 text-center sm:text-left", className),
731
+ ...props
732
+ });
733
+ }
734
+ function DialogFooter({ className, ...props }) {
735
+ return /* @__PURE__ */ jsx("div", {
736
+ "data-slot": "dialog-footer",
737
+ className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
738
+ ...props
739
+ });
740
+ }
741
+ function DialogTitle({ className, ...props }) {
742
+ return /* @__PURE__ */ jsx(DialogPrimitive.Title, {
743
+ "data-slot": "dialog-title",
744
+ className: cn("text-lg leading-none font-semibold", className),
745
+ ...props
746
+ });
747
+ }
748
+ function DialogDescription({ className, ...props }) {
749
+ return /* @__PURE__ */ jsx(DialogPrimitive.Description, {
750
+ "data-slot": "dialog-description",
751
+ className: cn("text-muted-foreground text-sm", className),
752
+ ...props
753
+ });
754
+ }
755
+ //#endregion
756
+ //#region src/components/DropdownMenu.tsx
757
+ function DropdownMenu({ ...props }) {
758
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Root, {
759
+ "data-slot": "dropdown-menu",
760
+ ...props
761
+ });
762
+ }
763
+ function DropdownMenuPortal({ ...props }) {
764
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, {
765
+ "data-slot": "dropdown-menu-portal",
766
+ ...props
767
+ });
768
+ }
769
+ function DropdownMenuTrigger({ ...props }) {
770
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Trigger, {
771
+ "data-slot": "dropdown-menu-trigger",
772
+ ...props
773
+ });
774
+ }
775
+ function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
776
+ const portalContainer = usePortalContainer();
777
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, {
778
+ container: portalContainer,
779
+ children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.Content, {
780
+ "data-slot": "dropdown-menu-content",
781
+ sideOffset,
782
+ className: cn("bg-popover text-popover-foreground 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]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md", className),
783
+ ...props
784
+ })
785
+ });
786
+ }
787
+ function DropdownMenuGroup({ ...props }) {
788
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Group, {
789
+ "data-slot": "dropdown-menu-group",
790
+ ...props
791
+ });
792
+ }
793
+ function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
794
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Item, {
795
+ "data-slot": "dropdown-menu-item",
796
+ "data-inset": inset,
797
+ "data-variant": variant,
798
+ className: cn("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
799
+ ...props
800
+ });
801
+ }
802
+ function DropdownMenuCheckboxItem({ className, children, ...props }) {
803
+ return /* @__PURE__ */ jsxs(DropdownMenuPrimitive.CheckboxItem, {
804
+ "data-slot": "dropdown-menu-checkbox-item",
805
+ className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
806
+ ...props,
807
+ children: [/* @__PURE__ */ jsx("span", {
808
+ className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",
809
+ children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "size-4" }) })
810
+ }), children]
811
+ });
812
+ }
813
+ function DropdownMenuRadioGroup({ ...props }) {
814
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.RadioGroup, {
815
+ "data-slot": "dropdown-menu-radio-group",
816
+ ...props
817
+ });
818
+ }
819
+ function DropdownMenuRadioItem({ className, children, ...props }) {
820
+ return /* @__PURE__ */ jsxs(DropdownMenuPrimitive.RadioItem, {
821
+ "data-slot": "dropdown-menu-radio-item",
822
+ className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
823
+ ...props,
824
+ children: [/* @__PURE__ */ jsx("span", {
825
+ className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",
826
+ children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Circle, { className: "size-2 fill-current" }) })
827
+ }), children]
828
+ });
829
+ }
830
+ function DropdownMenuLabel({ className, inset, ...props }) {
831
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Label, {
832
+ "data-slot": "dropdown-menu-label",
833
+ "data-inset": inset,
834
+ className: cn("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className),
835
+ ...props
836
+ });
837
+ }
838
+ function DropdownMenuSeparator({ className, ...props }) {
839
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Separator, {
840
+ "data-slot": "dropdown-menu-separator",
841
+ className: cn("bg-border -mx-1 my-1 h-px", className),
842
+ ...props
843
+ });
844
+ }
845
+ function DropdownMenuShortcut({ className, ...props }) {
846
+ return /* @__PURE__ */ jsx("span", {
847
+ "data-slot": "dropdown-menu-shortcut",
848
+ className: cn("text-muted-foreground ml-auto text-xs tracking-widest", className),
849
+ ...props
850
+ });
851
+ }
852
+ function DropdownMenuSub({ ...props }) {
853
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Sub, {
854
+ "data-slot": "dropdown-menu-sub",
855
+ ...props
856
+ });
857
+ }
858
+ function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
859
+ return /* @__PURE__ */ jsxs(DropdownMenuPrimitive.SubTrigger, {
860
+ "data-slot": "dropdown-menu-sub-trigger",
861
+ "data-inset": inset,
862
+ className: cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
863
+ ...props,
864
+ children: [children, /* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto size-4" })]
865
+ });
866
+ }
867
+ function DropdownMenuSubContent({ className, ...props }) {
868
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.SubContent, {
869
+ "data-slot": "dropdown-menu-sub-content",
870
+ className: cn("bg-popover text-popover-foreground 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]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg", className),
871
+ ...props
872
+ });
873
+ }
874
+ //#endregion
875
+ //#region src/components/Label.tsx
876
+ function Label({ className, ...props }) {
877
+ return /* @__PURE__ */ jsx(LabelPrimitive.Root, {
878
+ "data-slot": "label",
879
+ className: cn("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),
880
+ ...props
881
+ });
882
+ }
883
+ //#endregion
884
+ //#region src/components/Form.tsx
885
+ const Form = FormProvider;
886
+ const FormFieldContext = React.createContext({});
887
+ const FormField = ({ ...props }) => {
888
+ return /* @__PURE__ */ jsx(FormFieldContext.Provider, {
889
+ value: { name: props.name },
890
+ children: /* @__PURE__ */ jsx(Controller, { ...props })
891
+ });
892
+ };
893
+ const useFormField = () => {
894
+ const fieldContext = React.useContext(FormFieldContext);
895
+ const itemContext = React.useContext(FormItemContext);
896
+ const { getFieldState } = useFormContext();
897
+ const formState = useFormState({ name: fieldContext.name });
898
+ const fieldState = getFieldState(fieldContext.name, formState);
899
+ if (!fieldContext.name) throw new Error("useFormField should be used within <FormField>");
900
+ const { id } = itemContext;
901
+ if (!id) throw new Error("useFormField should be used within <FormItem>");
902
+ return {
903
+ id,
904
+ name: fieldContext.name,
905
+ formItemId: `${id}-form-item`,
906
+ formDescriptionId: `${id}-form-item-description`,
907
+ formMessageId: `${id}-form-item-message`,
908
+ invalid: fieldState.invalid,
909
+ isDirty: fieldState.isDirty,
910
+ isTouched: fieldState.isTouched,
911
+ isValidating: fieldState.isValidating,
912
+ error: fieldState.error
913
+ };
914
+ };
915
+ const FormItemContext = React.createContext({});
916
+ function FormItem({ className, ...props }) {
917
+ const id = React.useId();
918
+ return /* @__PURE__ */ jsx(FormItemContext.Provider, {
919
+ value: { id },
920
+ children: /* @__PURE__ */ jsx("div", {
921
+ "data-slot": "form-item",
922
+ className: cn("grid gap-2", className),
923
+ ...props
924
+ })
925
+ });
926
+ }
927
+ function FormLabel({ className, ...props }) {
928
+ const { error, formItemId } = useFormField();
929
+ return /* @__PURE__ */ jsx(Label, {
930
+ "data-slot": "form-label",
931
+ "data-error": !!error,
932
+ className: cn("data-[error=true]:text-destructive", className),
933
+ htmlFor: formItemId,
934
+ ...props
935
+ });
936
+ }
937
+ function FormControl({ ...props }) {
938
+ const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
939
+ return /* @__PURE__ */ jsx(Slot.Root, {
940
+ "data-slot": "form-control",
941
+ id: formItemId,
942
+ "aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
943
+ "aria-invalid": !!error,
944
+ ...props
945
+ });
946
+ }
947
+ function FormDescription({ className, ...props }) {
948
+ const { formDescriptionId } = useFormField();
949
+ return /* @__PURE__ */ jsx("p", {
950
+ "data-slot": "form-description",
951
+ id: formDescriptionId,
952
+ className: cn("text-muted-foreground text-sm", className),
953
+ ...props
954
+ });
955
+ }
956
+ function FormMessage({ className, ...props }) {
957
+ const { error, formMessageId } = useFormField();
958
+ const body = error ? String(error?.message ?? "") : props.children;
959
+ if (!body) return null;
960
+ return /* @__PURE__ */ jsx("p", {
961
+ "data-slot": "form-message",
962
+ id: formMessageId,
963
+ className: cn("text-destructive text-sm", className),
964
+ ...props,
965
+ children: body
966
+ });
967
+ }
968
+ //#endregion
969
+ //#region src/components/IconButton.tsx
970
+ function IconButton({ icon: Icon, className, variant = "ghost", size = "icon", isActive, ...props }) {
971
+ return /* @__PURE__ */ jsx(Button, {
972
+ variant,
973
+ size,
974
+ "data-active": isActive,
975
+ className: cn(isActive && "bg-accent text-accent-foreground", className),
976
+ ...props,
977
+ children: /* @__PURE__ */ jsx(Icon, {})
978
+ });
979
+ }
980
+ //#endregion
981
+ //#region src/components/Toggle.tsx
982
+ const toggleVariants = cva("focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
983
+ variants: {
984
+ variant: {
985
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
986
+ destructive: "bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 text-white",
987
+ outline: "bg-background hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50 border shadow-xs",
988
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
989
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
990
+ link: "text-primary underline-offset-4 hover:underline"
991
+ },
992
+ size: {
993
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
994
+ sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
995
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
996
+ icon: "size-9",
997
+ "icon-xs": "size-6",
998
+ "icon-sm": "size-8",
999
+ "icon-lg": "size-10"
1000
+ }
1001
+ },
1002
+ defaultVariants: {
1003
+ variant: "default",
1004
+ size: "default"
1005
+ }
1006
+ });
1007
+ function Toggle({ className, variant = "default", size = "default", ...props }) {
1008
+ return /* @__PURE__ */ jsx(TogglePrimitive.Root, {
1009
+ "data-slot": "toggle",
1010
+ className: cn(toggleVariants({
1011
+ variant,
1012
+ size,
1013
+ className
1014
+ })),
1015
+ ...props
1016
+ });
1017
+ }
1018
+ //#endregion
1019
+ //#region src/components/IconToggle.tsx
1020
+ function IconToggle({ icon: Icon, variant = "ghost", size = "icon", ...props }) {
1021
+ return /* @__PURE__ */ jsx(Toggle, {
1022
+ variant,
1023
+ size,
1024
+ ...props,
1025
+ children: /* @__PURE__ */ jsx(Icon, {})
1026
+ });
1027
+ }
1028
+ //#endregion
1029
+ //#region src/components/Input.tsx
1030
+ function Input({ className, type, ...props }) {
1031
+ return /* @__PURE__ */ jsx("input", {
1032
+ type,
1033
+ "data-slot": "input",
1034
+ className: cn("border-input selection:bg-primary selection:text-primary-foreground file:text-foreground placeholder:text-muted-foreground dark:bg-input/30 h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40", className),
1035
+ ...props
1036
+ });
1037
+ }
1038
+ //#endregion
1039
+ //#region src/components/Pagination.tsx
1040
+ function Pagination({ className, ...props }) {
1041
+ return /* @__PURE__ */ jsx("nav", {
1042
+ "aria-label": "pagination",
1043
+ "data-slot": "pagination",
1044
+ className: cn("mx-auto flex w-full justify-center", className),
1045
+ ...props
1046
+ });
1047
+ }
1048
+ function PaginationContent({ className, ...props }) {
1049
+ return /* @__PURE__ */ jsx("ul", {
1050
+ "data-slot": "pagination-content",
1051
+ className: cn("flex flex-row items-center gap-1", className),
1052
+ ...props
1053
+ });
1054
+ }
1055
+ function PaginationItem({ ...props }) {
1056
+ return /* @__PURE__ */ jsx("li", {
1057
+ "data-slot": "pagination-item",
1058
+ ...props
1059
+ });
1060
+ }
1061
+ function PaginationLink({ className, isActive, size = "icon", ...props }) {
1062
+ return /* @__PURE__ */ jsx("a", {
1063
+ "aria-current": isActive ? "page" : void 0,
1064
+ "data-slot": "pagination-link",
1065
+ "data-active": isActive,
1066
+ className: cn(buttonVariants({
1067
+ variant: isActive ? "outline" : "ghost",
1068
+ size
1069
+ }), className),
1070
+ ...props
1071
+ });
1072
+ }
1073
+ function PaginationPrevious({ className, ...props }) {
1074
+ return /* @__PURE__ */ jsxs(PaginationLink, {
1075
+ "aria-label": "Go to previous page",
1076
+ size: "default",
1077
+ className: cn("gap-1 px-2.5 sm:pl-2.5", className),
1078
+ ...props,
1079
+ children: [/* @__PURE__ */ jsx(ChevronLeftIcon, {}), /* @__PURE__ */ jsx("span", {
1080
+ className: "hidden sm:block",
1081
+ children: "Previous"
1082
+ })]
1083
+ });
1084
+ }
1085
+ function PaginationNext({ className, ...props }) {
1086
+ return /* @__PURE__ */ jsxs(PaginationLink, {
1087
+ "aria-label": "Go to next page",
1088
+ size: "default",
1089
+ className: cn("gap-1 px-2.5 sm:pr-2.5", className),
1090
+ ...props,
1091
+ children: [/* @__PURE__ */ jsx("span", {
1092
+ className: "hidden sm:block",
1093
+ children: "Next"
1094
+ }), /* @__PURE__ */ jsx(ChevronRightIcon, {})]
1095
+ });
1096
+ }
1097
+ function PaginationEllipsis({ className, ...props }) {
1098
+ return /* @__PURE__ */ jsxs("span", {
1099
+ "aria-hidden": true,
1100
+ "data-slot": "pagination-ellipsis",
1101
+ className: cn("flex size-9 items-center justify-center", className),
1102
+ ...props,
1103
+ children: [/* @__PURE__ */ jsx(MoreHorizontalIcon, { className: "size-4" }), /* @__PURE__ */ jsx("span", {
1104
+ className: "sr-only",
1105
+ children: "More pages"
1106
+ })]
1107
+ });
1108
+ }
1109
+ //#endregion
1110
+ //#region src/components/RadioGroup.tsx
1111
+ function RadioGroup({ className, ...props }) {
1112
+ return /* @__PURE__ */ jsx(RadioGroup$1.Root, {
1113
+ "data-slot": "radio-group",
1114
+ className: cn("grid gap-3", className),
1115
+ ...props
1116
+ });
1117
+ }
1118
+ function RadioGroupItem({ className, ...props }) {
1119
+ return /* @__PURE__ */ jsx(RadioGroup$1.Item, {
1120
+ "data-slot": "radio-group-item",
1121
+ className: cn("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", className),
1122
+ ...props,
1123
+ children: /* @__PURE__ */ jsx(RadioGroup$1.Indicator, {
1124
+ "data-slot": "radio-group-indicator",
1125
+ className: "relative flex items-center justify-center",
1126
+ children: /* @__PURE__ */ jsx(CircleIcon, { className: "fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" })
1127
+ })
1128
+ });
1129
+ }
1130
+ //#endregion
1131
+ //#region src/components/Select.tsx
1132
+ function Select({ ...props }) {
1133
+ return /* @__PURE__ */ jsx(SelectPrimitive.Root, {
1134
+ "data-slot": "select",
1135
+ ...props
1136
+ });
1137
+ }
1138
+ function SelectGroup({ ...props }) {
1139
+ return /* @__PURE__ */ jsx(SelectPrimitive.Group, {
1140
+ "data-slot": "select-group",
1141
+ ...props
1142
+ });
1143
+ }
1144
+ function SelectValue({ ...props }) {
1145
+ return /* @__PURE__ */ jsx(SelectPrimitive.Value, {
1146
+ "data-slot": "select-value",
1147
+ ...props
1148
+ });
1149
+ }
1150
+ function SelectTrigger({ className, size = "default", children, ...props }) {
1151
+ return /* @__PURE__ */ jsxs(SelectPrimitive.Trigger, {
1152
+ "data-slot": "select-trigger",
1153
+ "data-size": size,
1154
+ className: cn("border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='text-'])]:text-muted-foreground flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
1155
+ ...props,
1156
+ children: [children, /* @__PURE__ */ jsx(SelectPrimitive.Icon, {
1157
+ asChild: true,
1158
+ children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4 opacity-50" })
1159
+ })]
1160
+ });
1161
+ }
1162
+ function SelectContent({ className, children, position = "item-aligned", align = "center", ...props }) {
1163
+ const portalContainer = usePortalContainer();
1164
+ return /* @__PURE__ */ jsx(SelectPrimitive.Portal, {
1165
+ container: portalContainer,
1166
+ children: /* @__PURE__ */ jsxs(SelectPrimitive.Content, {
1167
+ "data-slot": "select-content",
1168
+ className: cn("bg-popover text-popover-foreground 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]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className),
1169
+ position,
1170
+ align,
1171
+ ...props,
1172
+ children: [
1173
+ /* @__PURE__ */ jsx(SelectScrollUpButton, {}),
1174
+ /* @__PURE__ */ jsx(SelectPrimitive.Viewport, {
1175
+ className: cn("p-1", position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),
1176
+ children
1177
+ }),
1178
+ /* @__PURE__ */ jsx(SelectScrollDownButton, {})
1179
+ ]
1180
+ })
1181
+ });
1182
+ }
1183
+ function SelectLabel({ className, ...props }) {
1184
+ return /* @__PURE__ */ jsx(SelectPrimitive.Label, {
1185
+ "data-slot": "select-label",
1186
+ className: cn("text-muted-foreground px-2 py-1.5 text-xs", className),
1187
+ ...props
1188
+ });
1189
+ }
1190
+ function SelectItem({ className, children, ...props }) {
1191
+ return /* @__PURE__ */ jsxs(SelectPrimitive.Item, {
1192
+ "data-slot": "select-item",
1193
+ className: cn("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
1194
+ ...props,
1195
+ children: [/* @__PURE__ */ jsx("span", {
1196
+ "data-slot": "select-item-indicator",
1197
+ className: "absolute right-2 flex size-3.5 items-center justify-center",
1198
+ children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) })
1199
+ }), /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })]
1200
+ });
1201
+ }
1202
+ function SelectSeparator({ className, ...props }) {
1203
+ return /* @__PURE__ */ jsx(SelectPrimitive.Separator, {
1204
+ "data-slot": "select-separator",
1205
+ className: cn("bg-border pointer-events-none -mx-1 my-1 h-px", className),
1206
+ ...props
1207
+ });
1208
+ }
1209
+ function SelectScrollUpButton({ className, ...props }) {
1210
+ return /* @__PURE__ */ jsx(SelectPrimitive.ScrollUpButton, {
1211
+ "data-slot": "select-scroll-up-button",
1212
+ className: cn("flex cursor-default items-center justify-center py-1", className),
1213
+ ...props,
1214
+ children: /* @__PURE__ */ jsx(ChevronUpIcon, { className: "size-4" })
1215
+ });
1216
+ }
1217
+ function SelectScrollDownButton({ className, ...props }) {
1218
+ return /* @__PURE__ */ jsx(SelectPrimitive.ScrollDownButton, {
1219
+ "data-slot": "select-scroll-down-button",
1220
+ className: cn("flex cursor-default items-center justify-center py-1", className),
1221
+ ...props,
1222
+ children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4" })
1223
+ });
1224
+ }
1225
+ //#endregion
1226
+ //#region src/components/Separator.tsx
1227
+ const Separator = React.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx(SeparatorPrimitive.Root, {
1228
+ ref,
1229
+ decorative,
1230
+ orientation,
1231
+ className: cn("shrink-0 bg-gray-200", orientation === "horizontal" ? "h-px w-full" : "h-full w-px", className),
1232
+ ...props
1233
+ }));
1234
+ Separator.displayName = SeparatorPrimitive.Root.displayName;
1235
+ //#endregion
1236
+ //#region src/components/Sheet.tsx
1237
+ const Sheet = DialogPrimitive.Root;
1238
+ const SheetTrigger = DialogPrimitive.Trigger;
1239
+ const SheetClose = DialogPrimitive.Close;
1240
+ function SheetPortal(props) {
1241
+ const portalContainer = usePortalContainer();
1242
+ return /* @__PURE__ */ jsx(DialogPrimitive.Portal, {
1243
+ container: portalContainer,
1244
+ ...props
1245
+ });
1246
+ }
1247
+ const SheetOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Overlay, {
1248
+ className: cn("data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 fixed inset-0 z-[1040] bg-black/80", className),
1249
+ ...props,
1250
+ ref
1251
+ }));
1252
+ SheetOverlay.displayName = DialogPrimitive.Overlay.displayName;
1253
+ const sheetVariants = cva("bg-background data-[state=closed]:animate-out data-[state=open]:animate-in fixed z-[1050] gap-4 p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500", {
1254
+ variants: { side: {
1255
+ top: "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 border-b",
1256
+ bottom: "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 border-t",
1257
+ left: "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-full border-r sm:max-w-sm",
1258
+ right: "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm"
1259
+ } },
1260
+ defaultVariants: { side: "right" }
1261
+ });
1262
+ const SheetContent = React.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ jsxs(SheetPortal, { children: [/* @__PURE__ */ jsx(SheetOverlay, {}), /* @__PURE__ */ jsxs(DialogPrimitive.Content, {
1263
+ ref,
1264
+ className: cn(sheetVariants({ side }), className),
1265
+ ...props,
1266
+ children: [/* @__PURE__ */ jsxs(DialogPrimitive.Close, {
1267
+ className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
1268
+ children: [/* @__PURE__ */ jsx(X, {}), /* @__PURE__ */ jsx("span", {
1269
+ className: "sr-only",
1270
+ children: "Close"
1271
+ })]
1272
+ }), children]
1273
+ })] }));
1274
+ SheetContent.displayName = DialogPrimitive.Content.displayName;
1275
+ function SheetHeader({ className, ...props }) {
1276
+ return /* @__PURE__ */ jsx("div", {
1277
+ className: cn("flex flex-col space-y-2 text-center sm:text-left", className),
1278
+ ...props
1279
+ });
1280
+ }
1281
+ function SheetFooter({ className, ...props }) {
1282
+ return /* @__PURE__ */ jsx("div", {
1283
+ className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className),
1284
+ ...props
1285
+ });
1286
+ }
1287
+ const SheetTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Title, {
1288
+ ref,
1289
+ className: cn("text-foreground text-lg font-semibold", className),
1290
+ ...props
1291
+ }));
1292
+ SheetTitle.displayName = DialogPrimitive.Title.displayName;
1293
+ const SheetDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Description, {
1294
+ ref,
1295
+ className: cn("text-muted-foreground text-sm", className),
1296
+ ...props
1297
+ }));
1298
+ SheetDescription.displayName = DialogPrimitive.Description.displayName;
1299
+ //#endregion
1300
+ //#region src/components/Skeleton.tsx
1301
+ function Skeleton({ className, ...props }) {
1302
+ return /* @__PURE__ */ jsx("div", {
1303
+ className: cn("bg-muted animate-pulse rounded-md", className),
1304
+ ...props
1305
+ });
1306
+ }
1307
+ //#endregion
1308
+ //#region src/components/Slider.tsx
1309
+ const Slider = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs(SliderPrimitive.Root, {
1310
+ ref,
1311
+ className: cn("relative flex w-full touch-none items-center select-none", className),
1312
+ ...props,
1313
+ children: [/* @__PURE__ */ jsx(SliderPrimitive.Track, {
1314
+ className: "relative h-2 w-full grow overflow-hidden rounded-full bg-gray-200",
1315
+ children: /* @__PURE__ */ jsx(SliderPrimitive.Range, { className: "bg-primary absolute h-full" })
1316
+ }), /* @__PURE__ */ jsx(SliderPrimitive.Thumb, { className: "border-primary bg-background ring-offset-background focus-visible:ring-ring block h-5 w-5 rounded-full border-2 transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50" })]
1317
+ }));
1318
+ Slider.displayName = SliderPrimitive.Root.displayName;
1319
+ //#endregion
1320
+ //#region src/components/Sonner.tsx
1321
+ function Toaster({ theme = "system", ...props }) {
1322
+ return /* @__PURE__ */ jsx(Toaster$1, {
1323
+ theme,
1324
+ className: "toaster group",
1325
+ icons: {
1326
+ success: /* @__PURE__ */ jsx(CircleCheckIcon, { className: "size-4" }),
1327
+ info: /* @__PURE__ */ jsx(InfoIcon, { className: "size-4" }),
1328
+ warning: /* @__PURE__ */ jsx(TriangleAlertIcon, { className: "size-4" }),
1329
+ error: /* @__PURE__ */ jsx(OctagonXIcon, { className: "size-4" }),
1330
+ loading: /* @__PURE__ */ jsx(Loader2Icon, { className: "size-4 animate-spin" })
1331
+ },
1332
+ style: {
1333
+ "--normal-bg": "var(--popover)",
1334
+ "--normal-text": "var(--popover-foreground)",
1335
+ "--normal-border": "var(--border)",
1336
+ "--success-bg": "var(--popover)",
1337
+ "--success-text": "var(--popover-foreground)",
1338
+ "--success-border": "var(--border)",
1339
+ "--error-bg": "var(--popover)",
1340
+ "--error-text": "var(--popover-foreground)",
1341
+ "--error-border": "var(--border)",
1342
+ "--warning-bg": "var(--popover)",
1343
+ "--warning-text": "var(--popover-foreground)",
1344
+ "--warning-border": "var(--border)",
1345
+ "--info-bg": "var(--popover)",
1346
+ "--info-text": "var(--popover-foreground)",
1347
+ "--info-border": "var(--border)",
1348
+ "--border-radius": "var(--radius)"
1349
+ },
1350
+ ...props
1351
+ });
1352
+ }
1353
+ //#endregion
1354
+ //#region src/components/Spinner.tsx
1355
+ function Spinner({ className, ...props }) {
1356
+ return /* @__PURE__ */ jsx(LoaderIcon, {
1357
+ "data-slot": "spinner",
1358
+ role: "status",
1359
+ "aria-label": "Loading",
1360
+ className: cn("size-4 animate-spin", className),
1361
+ ...props
1362
+ });
1363
+ }
1364
+ //#endregion
1365
+ //#region src/components/SpinnerWithText.tsx
1366
+ function SpinnerWithText({ text = "Loading...", variant = "inline", className }) {
1367
+ return /* @__PURE__ */ jsx("div", {
1368
+ className: cn("flex items-center justify-center self-stretch py-10", variant === "page" && "h-[60vh]", className),
1369
+ children: /* @__PURE__ */ jsxs("div", {
1370
+ className: "flex flex-col items-center justify-start gap-4",
1371
+ children: [/* @__PURE__ */ jsx("div", {
1372
+ className: "relative h-8 w-8",
1373
+ children: /* @__PURE__ */ jsxs("svg", {
1374
+ width: "32",
1375
+ height: "33",
1376
+ viewBox: "0 0 32 33",
1377
+ fill: "none",
1378
+ xmlns: "http://www.w3.org/2000/svg",
1379
+ className: "animate-spin",
1380
+ children: [/* @__PURE__ */ jsx("path", {
1381
+ d: "M30 16.5C30 18.3385 29.6379 20.159 28.9343 21.8576C28.2308 23.5561 27.1995 25.0995 25.8995 26.3995C24.5995 27.6995 23.0561 28.7307 21.3576 29.4343C19.659 30.1379 17.8385 30.5 16 30.5C14.1615 30.5 12.341 30.1379 10.6424 29.4343C8.94387 28.7307 7.40052 27.6995 6.1005 26.3995C4.80048 25.0995 3.76925 23.5561 3.06569 21.8576C2.36212 20.159 2 18.3385 2 16.5C2 14.6615 2.36212 12.841 3.06569 11.1424C3.76926 9.44387 4.80049 7.90052 6.10051 6.6005C7.40053 5.30048 8.94388 4.26925 10.6424 3.56568C12.341 2.86212 14.1615 2.5 16 2.5C17.8385 2.5 19.659 2.86212 21.3576 3.56569C23.0561 4.26925 24.5995 5.30049 25.8995 6.60051C27.1995 7.90053 28.2308 9.44388 28.9343 11.1424C29.6379 12.841 30 14.6615 30 16.5L30 16.5Z",
1382
+ stroke: "#F5F6F9",
1383
+ strokeWidth: "4",
1384
+ strokeLinecap: "round",
1385
+ strokeLinejoin: "round"
1386
+ }), /* @__PURE__ */ jsx("path", {
1387
+ d: "M16 2.5C17.8385 2.5 19.659 2.86212 21.3576 3.56569C23.0561 4.26925 24.5995 5.30049 25.8995 6.60051C27.1995 7.90053 28.2308 9.44388 28.9343 11.1424C29.6379 12.841 30 14.6615 30 16.5",
1388
+ stroke: "#155DFC",
1389
+ strokeWidth: "4",
1390
+ strokeLinecap: "round",
1391
+ strokeLinejoin: "round"
1392
+ })]
1393
+ })
1394
+ }), text && /* @__PURE__ */ jsx("div", {
1395
+ className: "text-center text-sm leading-tight font-medium text-slate-700",
1396
+ children: text
1397
+ })]
1398
+ })
1399
+ });
1400
+ }
1401
+ //#endregion
1402
+ //#region src/components/Switch.tsx
1403
+ const Switch = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(SwitchPrimitive.Root, {
1404
+ className: cn("peer focus-visible:ring-ring focus-visible:ring-offset-background data-[state=checked]:bg-primary relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50 data-[state=unchecked]:bg-gray-200", className),
1405
+ ...props,
1406
+ ref,
1407
+ children: /* @__PURE__ */ jsx(SwitchPrimitive.Thumb, { className: cn("pointer-events-none absolute left-0 block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform duration-200 data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0") })
1408
+ }));
1409
+ Switch.displayName = SwitchPrimitive.Root.displayName;
1410
+ //#endregion
1411
+ //#region src/components/Table.tsx
1412
+ function Table({ className, ...props }) {
1413
+ return /* @__PURE__ */ jsx("div", {
1414
+ "data-slot": "table-container",
1415
+ className: "relative w-full overflow-x-auto",
1416
+ children: /* @__PURE__ */ jsx("table", {
1417
+ "data-slot": "table",
1418
+ className: cn("w-full caption-bottom text-sm", className),
1419
+ ...props
1420
+ })
1421
+ });
1422
+ }
1423
+ function TableHeader({ className, ...props }) {
1424
+ return /* @__PURE__ */ jsx("thead", {
1425
+ "data-slot": "table-header",
1426
+ className: cn("[&_tr]:border-b", className),
1427
+ ...props
1428
+ });
1429
+ }
1430
+ function TableBody({ className, ...props }) {
1431
+ return /* @__PURE__ */ jsx("tbody", {
1432
+ "data-slot": "table-body",
1433
+ className: cn("[&_tr:last-child]:border-0", className),
1434
+ ...props
1435
+ });
1436
+ }
1437
+ function TableFooter({ className, ...props }) {
1438
+ return /* @__PURE__ */ jsx("tfoot", {
1439
+ "data-slot": "table-footer",
1440
+ className: cn("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0", className),
1441
+ ...props
1442
+ });
1443
+ }
1444
+ function TableRow({ className, ...props }) {
1445
+ return /* @__PURE__ */ jsx("tr", {
1446
+ "data-slot": "table-row",
1447
+ className: cn("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors", className),
1448
+ ...props
1449
+ });
1450
+ }
1451
+ function TableHead({ className, ...props }) {
1452
+ return /* @__PURE__ */ jsx("th", {
1453
+ "data-slot": "table-head",
1454
+ className: cn("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className),
1455
+ ...props
1456
+ });
1457
+ }
1458
+ function TableCell({ className, ...props }) {
1459
+ return /* @__PURE__ */ jsx("td", {
1460
+ "data-slot": "table-cell",
1461
+ className: cn("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className),
1462
+ ...props
1463
+ });
1464
+ }
1465
+ function TableCaption({ className, ...props }) {
1466
+ return /* @__PURE__ */ jsx("caption", {
1467
+ "data-slot": "table-caption",
1468
+ className: cn("text-muted-foreground mt-4 text-sm", className),
1469
+ ...props
1470
+ });
1471
+ }
1472
+ //#endregion
1473
+ //#region src/components/Tabs.tsx
1474
+ function Tabs({ className, ...props }) {
1475
+ return /* @__PURE__ */ jsx(TabsPrimitive.Root, {
1476
+ "data-slot": "tabs",
1477
+ className: cn("flex flex-col gap-2", className),
1478
+ ...props
1479
+ });
1480
+ }
1481
+ function TabsList({ className, ...props }) {
1482
+ return /* @__PURE__ */ jsx(TabsPrimitive.List, {
1483
+ "data-slot": "tabs-list",
1484
+ className: cn("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]", className),
1485
+ ...props
1486
+ });
1487
+ }
1488
+ function TabsTrigger({ className, ...props }) {
1489
+ return /* @__PURE__ */ jsx(TabsPrimitive.Trigger, {
1490
+ "data-slot": "tabs-trigger",
1491
+ className: cn("text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring data-[state=active]:bg-background dark:text-muted-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
1492
+ ...props
1493
+ });
1494
+ }
1495
+ function TabsContent({ className, ...props }) {
1496
+ return /* @__PURE__ */ jsx(TabsPrimitive.Content, {
1497
+ "data-slot": "tabs-content",
1498
+ className: cn("flex-1 outline-none", className),
1499
+ ...props
1500
+ });
1501
+ }
1502
+ //#endregion
1503
+ //#region src/components/Textarea.tsx
1504
+ function Textarea({ className, ...props }) {
1505
+ return /* @__PURE__ */ jsx("textarea", {
1506
+ "data-slot": "textarea",
1507
+ className: cn("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", className),
1508
+ ...props
1509
+ });
1510
+ }
1511
+ //#endregion
1512
+ //#region src/components/ToggleGroup.tsx
1513
+ const ToggleGroupContext = React.createContext({
1514
+ size: "default",
1515
+ variant: "default",
1516
+ spacing: 0,
1517
+ orientation: "horizontal"
1518
+ });
1519
+ function ToggleGroup({ className, variant, size, spacing = 0, orientation = "horizontal", children, ...props }) {
1520
+ return /* @__PURE__ */ jsx(ToggleGroupPrimitive.Root, {
1521
+ "data-slot": "toggle-group",
1522
+ "data-variant": variant,
1523
+ "data-size": size,
1524
+ "data-spacing": spacing,
1525
+ "data-orientation": orientation,
1526
+ style: { "--gap": spacing },
1527
+ className: cn("cn-toggle-group group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch", className),
1528
+ ...props,
1529
+ children: /* @__PURE__ */ jsx(ToggleGroupContext.Provider, {
1530
+ value: {
1531
+ variant,
1532
+ size,
1533
+ spacing,
1534
+ orientation
1535
+ },
1536
+ children
1537
+ })
1538
+ });
1539
+ }
1540
+ function ToggleGroupItem({ className, children, variant = "default", size = "default", ...props }) {
1541
+ const context = React.useContext(ToggleGroupContext);
1542
+ return /* @__PURE__ */ jsx(ToggleGroupPrimitive.Item, {
1543
+ "data-slot": "toggle-group-item",
1544
+ "data-variant": context.variant || variant,
1545
+ "data-size": context.size || size,
1546
+ "data-spacing": context.spacing,
1547
+ className: cn("cn-toggle-group-item shrink-0 focus:z-10 focus-visible:z-10 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t", toggleVariants({
1548
+ variant: context.variant || variant,
1549
+ size: context.size || size
1550
+ }), className),
1551
+ ...props,
1552
+ children
1553
+ });
1554
+ }
1555
+ //#endregion
1556
+ //#region src/components/Tooltip.tsx
1557
+ const TooltipProvider = TooltipPrimitive.Provider;
1558
+ function Tooltip(props) {
1559
+ return /* @__PURE__ */ jsx(TooltipPrimitive.Root, { ...props });
1560
+ }
1561
+ const TooltipTrigger = TooltipPrimitive.Trigger;
1562
+ function TooltipContent({ className, sideOffset = 4, ...props }) {
1563
+ const portalContainer = usePortalContainer();
1564
+ return /* @__PURE__ */ jsx(TooltipPrimitive.Portal, {
1565
+ container: portalContainer,
1566
+ children: /* @__PURE__ */ jsx(TooltipPrimitive.Content, {
1567
+ sideOffset,
1568
+ className: cn("animate-in bg-popover text-popover-foreground fade-in-0 zoom-in-95 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]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 z-50 overflow-hidden rounded-md border px-3 py-1.5 text-sm shadow-md", className),
1569
+ ...props
1570
+ })
1571
+ });
1572
+ }
1573
+ //#endregion
1574
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Button, Calendar, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Collapsible, CollapsibleContent, CollapsibleTrigger, DatePicker, 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, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, IconButton, IconToggle, Input, Label, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, PortalContainerProvider, RadioGroup, RadioGroupItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Slider, Spinner, SpinnerWithText, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cn, toggleVariants, useFormField, useZodForm };
1575
+
1576
+ //# sourceMappingURL=index.mjs.map