@json-render/shadcn 0.0.1

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.js ADDED
@@ -0,0 +1,2946 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ shadcnComponentDefinitions: () => shadcnComponentDefinitions,
34
+ shadcnComponents: () => shadcnComponents
35
+ });
36
+ module.exports = __toCommonJS(index_exports);
37
+
38
+ // src/components.tsx
39
+ var import_react = require("react");
40
+ var import_react2 = require("@json-render/react");
41
+
42
+ // src/ui/button.tsx
43
+ var import_class_variance_authority = require("class-variance-authority");
44
+ var import_radix_ui = require("radix-ui");
45
+
46
+ // src/lib/utils.ts
47
+ var import_clsx = require("clsx");
48
+ var import_tailwind_merge = require("tailwind-merge");
49
+ function cn(...inputs) {
50
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
51
+ }
52
+
53
+ // src/ui/button.tsx
54
+ var import_jsx_runtime = require("react/jsx-runtime");
55
+ var buttonVariants = (0, import_class_variance_authority.cva)(
56
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
57
+ {
58
+ variants: {
59
+ variant: {
60
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
61
+ destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
62
+ outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
63
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
64
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
65
+ link: "text-primary underline-offset-4 hover:underline"
66
+ },
67
+ size: {
68
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
69
+ xs: "h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
70
+ sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
71
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
72
+ icon: "size-9",
73
+ "icon-xs": "size-6 rounded-md [&_svg:not([class*='size-'])]:size-3",
74
+ "icon-sm": "size-8",
75
+ "icon-lg": "size-10"
76
+ }
77
+ },
78
+ defaultVariants: {
79
+ variant: "default",
80
+ size: "default"
81
+ }
82
+ }
83
+ );
84
+ function Button({
85
+ className,
86
+ variant = "default",
87
+ size = "default",
88
+ asChild = false,
89
+ ...props
90
+ }) {
91
+ const Comp = asChild ? import_radix_ui.Slot.Root : "button";
92
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
93
+ Comp,
94
+ {
95
+ "data-slot": "button",
96
+ "data-variant": variant,
97
+ "data-size": size,
98
+ className: cn(buttonVariants({ variant, size, className })),
99
+ ...props
100
+ }
101
+ );
102
+ }
103
+
104
+ // src/ui/card.tsx
105
+ var import_jsx_runtime2 = require("react/jsx-runtime");
106
+ function Card({ className, ...props }) {
107
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
108
+ "div",
109
+ {
110
+ "data-slot": "card",
111
+ className: cn(
112
+ "bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
113
+ className
114
+ ),
115
+ ...props
116
+ }
117
+ );
118
+ }
119
+ function CardHeader({ className, ...props }) {
120
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
121
+ "div",
122
+ {
123
+ "data-slot": "card-header",
124
+ className: cn(
125
+ "@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",
126
+ className
127
+ ),
128
+ ...props
129
+ }
130
+ );
131
+ }
132
+ function CardTitle({ className, ...props }) {
133
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
134
+ "div",
135
+ {
136
+ "data-slot": "card-title",
137
+ className: cn("leading-none font-semibold", className),
138
+ ...props
139
+ }
140
+ );
141
+ }
142
+ function CardDescription({ className, ...props }) {
143
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
144
+ "div",
145
+ {
146
+ "data-slot": "card-description",
147
+ className: cn("text-muted-foreground text-sm", className),
148
+ ...props
149
+ }
150
+ );
151
+ }
152
+ function CardContent({ className, ...props }) {
153
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
154
+ "div",
155
+ {
156
+ "data-slot": "card-content",
157
+ className: cn("px-6", className),
158
+ ...props
159
+ }
160
+ );
161
+ }
162
+
163
+ // src/ui/input.tsx
164
+ var import_jsx_runtime3 = require("react/jsx-runtime");
165
+ function Input({ className, type, ...props }) {
166
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
167
+ "input",
168
+ {
169
+ type,
170
+ "data-slot": "input",
171
+ className: cn(
172
+ "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input 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",
173
+ "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
174
+ "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
175
+ className
176
+ ),
177
+ ...props
178
+ }
179
+ );
180
+ }
181
+
182
+ // src/ui/label.tsx
183
+ var import_radix_ui2 = require("radix-ui");
184
+ var import_jsx_runtime4 = require("react/jsx-runtime");
185
+ function Label({
186
+ className,
187
+ ...props
188
+ }) {
189
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
190
+ import_radix_ui2.Label.Root,
191
+ {
192
+ "data-slot": "label",
193
+ className: cn(
194
+ "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",
195
+ className
196
+ ),
197
+ ...props
198
+ }
199
+ );
200
+ }
201
+
202
+ // src/ui/textarea.tsx
203
+ var import_jsx_runtime5 = require("react/jsx-runtime");
204
+ function Textarea({ className, ...props }) {
205
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
206
+ "textarea",
207
+ {
208
+ "data-slot": "textarea",
209
+ className: cn(
210
+ "border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 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",
211
+ className
212
+ ),
213
+ ...props
214
+ }
215
+ );
216
+ }
217
+
218
+ // src/ui/checkbox.tsx
219
+ var import_lucide_react = require("lucide-react");
220
+ var import_radix_ui3 = require("radix-ui");
221
+ var import_jsx_runtime6 = require("react/jsx-runtime");
222
+ function Checkbox({
223
+ className,
224
+ ...props
225
+ }) {
226
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
227
+ import_radix_ui3.Checkbox.Root,
228
+ {
229
+ "data-slot": "checkbox",
230
+ className: cn(
231
+ "peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
232
+ className
233
+ ),
234
+ ...props,
235
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
236
+ import_radix_ui3.Checkbox.Indicator,
237
+ {
238
+ "data-slot": "checkbox-indicator",
239
+ className: "grid place-content-center text-current transition-none",
240
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react.CheckIcon, { className: "size-3.5" })
241
+ }
242
+ )
243
+ }
244
+ );
245
+ }
246
+
247
+ // src/ui/switch.tsx
248
+ var import_radix_ui4 = require("radix-ui");
249
+ var import_jsx_runtime7 = require("react/jsx-runtime");
250
+ function Switch({
251
+ className,
252
+ size = "default",
253
+ ...props
254
+ }) {
255
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
256
+ import_radix_ui4.Switch.Root,
257
+ {
258
+ "data-slot": "switch",
259
+ "data-size": size,
260
+ className: cn(
261
+ "peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",
262
+ className
263
+ ),
264
+ ...props,
265
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
266
+ import_radix_ui4.Switch.Thumb,
267
+ {
268
+ "data-slot": "switch-thumb",
269
+ className: cn(
270
+ "bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"
271
+ )
272
+ }
273
+ )
274
+ }
275
+ );
276
+ }
277
+
278
+ // src/ui/progress.tsx
279
+ var import_radix_ui5 = require("radix-ui");
280
+ var import_jsx_runtime8 = require("react/jsx-runtime");
281
+ function Progress({
282
+ className,
283
+ value,
284
+ ...props
285
+ }) {
286
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
287
+ import_radix_ui5.Progress.Root,
288
+ {
289
+ "data-slot": "progress",
290
+ className: cn(
291
+ "bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",
292
+ className
293
+ ),
294
+ ...props,
295
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
296
+ import_radix_ui5.Progress.Indicator,
297
+ {
298
+ "data-slot": "progress-indicator",
299
+ className: "bg-primary h-full w-full flex-1 transition-all",
300
+ style: { transform: `translateX(-${100 - (value || 0)}%)` }
301
+ }
302
+ )
303
+ }
304
+ );
305
+ }
306
+
307
+ // src/ui/separator.tsx
308
+ var import_radix_ui6 = require("radix-ui");
309
+ var import_jsx_runtime9 = require("react/jsx-runtime");
310
+ function Separator({
311
+ className,
312
+ orientation = "horizontal",
313
+ decorative = true,
314
+ ...props
315
+ }) {
316
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
317
+ import_radix_ui6.Separator.Root,
318
+ {
319
+ "data-slot": "separator",
320
+ decorative,
321
+ orientation,
322
+ className: cn(
323
+ "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
324
+ className
325
+ ),
326
+ ...props
327
+ }
328
+ );
329
+ }
330
+
331
+ // src/ui/alert.tsx
332
+ var import_class_variance_authority2 = require("class-variance-authority");
333
+ var import_jsx_runtime10 = require("react/jsx-runtime");
334
+ var alertVariants = (0, import_class_variance_authority2.cva)(
335
+ "relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
336
+ {
337
+ variants: {
338
+ variant: {
339
+ default: "bg-card text-card-foreground",
340
+ destructive: "text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"
341
+ }
342
+ },
343
+ defaultVariants: {
344
+ variant: "default"
345
+ }
346
+ }
347
+ );
348
+ function Alert({
349
+ className,
350
+ variant,
351
+ ...props
352
+ }) {
353
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
354
+ "div",
355
+ {
356
+ "data-slot": "alert",
357
+ role: "alert",
358
+ className: cn(alertVariants({ variant }), className),
359
+ ...props
360
+ }
361
+ );
362
+ }
363
+ function AlertTitle({ className, ...props }) {
364
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
365
+ "div",
366
+ {
367
+ "data-slot": "alert-title",
368
+ className: cn(
369
+ "col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",
370
+ className
371
+ ),
372
+ ...props
373
+ }
374
+ );
375
+ }
376
+ function AlertDescription({
377
+ className,
378
+ ...props
379
+ }) {
380
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
381
+ "div",
382
+ {
383
+ "data-slot": "alert-description",
384
+ className: cn(
385
+ "text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
386
+ className
387
+ ),
388
+ ...props
389
+ }
390
+ );
391
+ }
392
+
393
+ // src/ui/dialog.tsx
394
+ var import_lucide_react2 = require("lucide-react");
395
+ var import_radix_ui7 = require("radix-ui");
396
+ var import_jsx_runtime11 = require("react/jsx-runtime");
397
+ function Dialog({
398
+ ...props
399
+ }) {
400
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_radix_ui7.Dialog.Root, { "data-slot": "dialog", ...props });
401
+ }
402
+ function DialogPortal({
403
+ ...props
404
+ }) {
405
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_radix_ui7.Dialog.Portal, { "data-slot": "dialog-portal", ...props });
406
+ }
407
+ function DialogOverlay({
408
+ className,
409
+ ...props
410
+ }) {
411
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
412
+ import_radix_ui7.Dialog.Overlay,
413
+ {
414
+ "data-slot": "dialog-overlay",
415
+ className: cn(
416
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
417
+ className
418
+ ),
419
+ ...props
420
+ }
421
+ );
422
+ }
423
+ function DialogContent({
424
+ className,
425
+ children,
426
+ showCloseButton = true,
427
+ ...props
428
+ }) {
429
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(DialogPortal, { "data-slot": "dialog-portal", children: [
430
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DialogOverlay, {}),
431
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
432
+ import_radix_ui7.Dialog.Content,
433
+ {
434
+ "data-slot": "dialog-content",
435
+ className: cn(
436
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 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 outline-none sm:max-w-lg",
437
+ className
438
+ ),
439
+ ...props,
440
+ children: [
441
+ children,
442
+ showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
443
+ import_radix_ui7.Dialog.Close,
444
+ {
445
+ "data-slot": "dialog-close",
446
+ 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",
447
+ children: [
448
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react2.XIcon, {}),
449
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "sr-only", children: "Close" })
450
+ ]
451
+ }
452
+ )
453
+ ]
454
+ }
455
+ )
456
+ ] });
457
+ }
458
+ function DialogHeader({ className, ...props }) {
459
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
460
+ "div",
461
+ {
462
+ "data-slot": "dialog-header",
463
+ className: cn("flex flex-col gap-2 text-center sm:text-left", className),
464
+ ...props
465
+ }
466
+ );
467
+ }
468
+ function DialogTitle({
469
+ className,
470
+ ...props
471
+ }) {
472
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
473
+ import_radix_ui7.Dialog.Title,
474
+ {
475
+ "data-slot": "dialog-title",
476
+ className: cn("text-lg leading-none font-semibold", className),
477
+ ...props
478
+ }
479
+ );
480
+ }
481
+ function DialogDescription({
482
+ className,
483
+ ...props
484
+ }) {
485
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
486
+ import_radix_ui7.Dialog.Description,
487
+ {
488
+ "data-slot": "dialog-description",
489
+ className: cn("text-muted-foreground text-sm", className),
490
+ ...props
491
+ }
492
+ );
493
+ }
494
+
495
+ // src/ui/accordion.tsx
496
+ var import_lucide_react3 = require("lucide-react");
497
+ var import_radix_ui8 = require("radix-ui");
498
+ var import_jsx_runtime12 = require("react/jsx-runtime");
499
+ function Accordion({
500
+ ...props
501
+ }) {
502
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_radix_ui8.Accordion.Root, { "data-slot": "accordion", ...props });
503
+ }
504
+ function AccordionItem({
505
+ className,
506
+ ...props
507
+ }) {
508
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
509
+ import_radix_ui8.Accordion.Item,
510
+ {
511
+ "data-slot": "accordion-item",
512
+ className: cn("border-b last:border-b-0", className),
513
+ ...props
514
+ }
515
+ );
516
+ }
517
+ function AccordionTrigger({
518
+ className,
519
+ children,
520
+ ...props
521
+ }) {
522
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_radix_ui8.Accordion.Header, { className: "flex", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
523
+ import_radix_ui8.Accordion.Trigger,
524
+ {
525
+ "data-slot": "accordion-trigger",
526
+ className: cn(
527
+ "focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
528
+ className
529
+ ),
530
+ ...props,
531
+ children: [
532
+ children,
533
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react3.ChevronDownIcon, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" })
534
+ ]
535
+ }
536
+ ) });
537
+ }
538
+ function AccordionContent({
539
+ className,
540
+ children,
541
+ ...props
542
+ }) {
543
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
544
+ import_radix_ui8.Accordion.Content,
545
+ {
546
+ "data-slot": "accordion-content",
547
+ className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",
548
+ ...props,
549
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: cn("pt-0 pb-4", className), children })
550
+ }
551
+ );
552
+ }
553
+
554
+ // src/ui/avatar.tsx
555
+ var import_radix_ui9 = require("radix-ui");
556
+ var import_jsx_runtime13 = require("react/jsx-runtime");
557
+ function Avatar({
558
+ className,
559
+ ...props
560
+ }) {
561
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
562
+ import_radix_ui9.Avatar.Root,
563
+ {
564
+ "data-slot": "avatar",
565
+ className: cn(
566
+ "relative flex size-10 shrink-0 overflow-hidden rounded-full",
567
+ className
568
+ ),
569
+ ...props
570
+ }
571
+ );
572
+ }
573
+ function AvatarImage({
574
+ className,
575
+ ...props
576
+ }) {
577
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
578
+ import_radix_ui9.Avatar.Image,
579
+ {
580
+ "data-slot": "avatar-image",
581
+ className: cn("aspect-square size-full", className),
582
+ ...props
583
+ }
584
+ );
585
+ }
586
+ function AvatarFallback({
587
+ className,
588
+ ...props
589
+ }) {
590
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
591
+ import_radix_ui9.Avatar.Fallback,
592
+ {
593
+ "data-slot": "avatar-fallback",
594
+ className: cn(
595
+ "bg-muted flex size-full items-center justify-center rounded-full",
596
+ className
597
+ ),
598
+ ...props
599
+ }
600
+ );
601
+ }
602
+
603
+ // src/ui/badge.tsx
604
+ var import_class_variance_authority3 = require("class-variance-authority");
605
+ var import_radix_ui10 = require("radix-ui");
606
+ var import_jsx_runtime14 = require("react/jsx-runtime");
607
+ var badgeVariants = (0, import_class_variance_authority3.cva)(
608
+ "inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
609
+ {
610
+ variants: {
611
+ variant: {
612
+ default: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
613
+ secondary: "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
614
+ destructive: "bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
615
+ outline: "border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
616
+ }
617
+ },
618
+ defaultVariants: {
619
+ variant: "default"
620
+ }
621
+ }
622
+ );
623
+ function Badge({
624
+ className,
625
+ variant = "default",
626
+ asChild = false,
627
+ ...props
628
+ }) {
629
+ const Comp = asChild ? import_radix_ui10.Slot.Root : "span";
630
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
631
+ Comp,
632
+ {
633
+ "data-slot": "badge",
634
+ "data-variant": variant,
635
+ className: cn(badgeVariants({ variant }), className),
636
+ ...props
637
+ }
638
+ );
639
+ }
640
+
641
+ // src/ui/radio-group.tsx
642
+ var import_lucide_react4 = require("lucide-react");
643
+ var import_radix_ui11 = require("radix-ui");
644
+ var import_jsx_runtime15 = require("react/jsx-runtime");
645
+ function RadioGroup({
646
+ className,
647
+ ...props
648
+ }) {
649
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
650
+ import_radix_ui11.RadioGroup.Root,
651
+ {
652
+ "data-slot": "radio-group",
653
+ className: cn("grid gap-3", className),
654
+ ...props
655
+ }
656
+ );
657
+ }
658
+ function RadioGroupItem({
659
+ className,
660
+ ...props
661
+ }) {
662
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
663
+ import_radix_ui11.RadioGroup.Item,
664
+ {
665
+ "data-slot": "radio-group-item",
666
+ className: cn(
667
+ "border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 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",
668
+ className
669
+ ),
670
+ ...props,
671
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
672
+ import_radix_ui11.RadioGroup.Indicator,
673
+ {
674
+ "data-slot": "radio-group-indicator",
675
+ className: "relative flex items-center justify-center",
676
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react4.CircleIcon, { className: "fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" })
677
+ }
678
+ )
679
+ }
680
+ );
681
+ }
682
+
683
+ // src/ui/select.tsx
684
+ var import_lucide_react5 = require("lucide-react");
685
+ var import_radix_ui12 = require("radix-ui");
686
+ var import_jsx_runtime16 = require("react/jsx-runtime");
687
+ function Select({
688
+ ...props
689
+ }) {
690
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_radix_ui12.Select.Root, { "data-slot": "select", ...props });
691
+ }
692
+ function SelectValue({
693
+ ...props
694
+ }) {
695
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_radix_ui12.Select.Value, { "data-slot": "select-value", ...props });
696
+ }
697
+ function SelectTrigger({
698
+ className,
699
+ size = "default",
700
+ children,
701
+ ...props
702
+ }) {
703
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
704
+ import_radix_ui12.Select.Trigger,
705
+ {
706
+ "data-slot": "select-trigger",
707
+ "data-size": size,
708
+ className: cn(
709
+ "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 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",
710
+ className
711
+ ),
712
+ ...props,
713
+ children: [
714
+ children,
715
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_radix_ui12.Select.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react5.ChevronDownIcon, { className: "size-4 opacity-50" }) })
716
+ ]
717
+ }
718
+ );
719
+ }
720
+ function SelectContent({
721
+ className,
722
+ children,
723
+ position = "item-aligned",
724
+ align = "center",
725
+ ...props
726
+ }) {
727
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_radix_ui12.Select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
728
+ import_radix_ui12.Select.Content,
729
+ {
730
+ "data-slot": "select-content",
731
+ className: cn(
732
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]: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 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",
733
+ 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",
734
+ className
735
+ ),
736
+ position,
737
+ align,
738
+ ...props,
739
+ children: [
740
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SelectScrollUpButton, {}),
741
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
742
+ import_radix_ui12.Select.Viewport,
743
+ {
744
+ className: cn(
745
+ "p-1",
746
+ position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
747
+ ),
748
+ children
749
+ }
750
+ ),
751
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SelectScrollDownButton, {})
752
+ ]
753
+ }
754
+ ) });
755
+ }
756
+ function SelectItem({
757
+ className,
758
+ children,
759
+ ...props
760
+ }) {
761
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
762
+ import_radix_ui12.Select.Item,
763
+ {
764
+ "data-slot": "select-item",
765
+ className: cn(
766
+ "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",
767
+ className
768
+ ),
769
+ ...props,
770
+ children: [
771
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
772
+ "span",
773
+ {
774
+ "data-slot": "select-item-indicator",
775
+ className: "absolute right-2 flex size-3.5 items-center justify-center",
776
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_radix_ui12.Select.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react5.CheckIcon, { className: "size-4" }) })
777
+ }
778
+ ),
779
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_radix_ui12.Select.ItemText, { children })
780
+ ]
781
+ }
782
+ );
783
+ }
784
+ function SelectScrollUpButton({
785
+ className,
786
+ ...props
787
+ }) {
788
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
789
+ import_radix_ui12.Select.ScrollUpButton,
790
+ {
791
+ "data-slot": "select-scroll-up-button",
792
+ className: cn(
793
+ "flex cursor-default items-center justify-center py-1",
794
+ className
795
+ ),
796
+ ...props,
797
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react5.ChevronUpIcon, { className: "size-4" })
798
+ }
799
+ );
800
+ }
801
+ function SelectScrollDownButton({
802
+ className,
803
+ ...props
804
+ }) {
805
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
806
+ import_radix_ui12.Select.ScrollDownButton,
807
+ {
808
+ "data-slot": "select-scroll-down-button",
809
+ className: cn(
810
+ "flex cursor-default items-center justify-center py-1",
811
+ className
812
+ ),
813
+ ...props,
814
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react5.ChevronDownIcon, { className: "size-4" })
815
+ }
816
+ );
817
+ }
818
+
819
+ // src/ui/carousel.tsx
820
+ var React = __toESM(require("react"));
821
+ var import_embla_carousel_react = __toESM(require("embla-carousel-react"));
822
+ var import_lucide_react6 = require("lucide-react");
823
+ var import_jsx_runtime17 = require("react/jsx-runtime");
824
+ var CarouselContext = React.createContext(null);
825
+ function useCarousel() {
826
+ const context = React.useContext(CarouselContext);
827
+ if (!context) {
828
+ throw new Error("useCarousel must be used within a <Carousel />");
829
+ }
830
+ return context;
831
+ }
832
+ function Carousel({
833
+ orientation = "horizontal",
834
+ opts,
835
+ setApi,
836
+ plugins,
837
+ className,
838
+ children,
839
+ ...props
840
+ }) {
841
+ const [carouselRef, api] = (0, import_embla_carousel_react.default)(
842
+ {
843
+ ...opts,
844
+ axis: orientation === "horizontal" ? "x" : "y"
845
+ },
846
+ plugins
847
+ );
848
+ const [canScrollPrev, setCanScrollPrev] = React.useState(false);
849
+ const [canScrollNext, setCanScrollNext] = React.useState(false);
850
+ const onSelect = React.useCallback((api2) => {
851
+ if (!api2) return;
852
+ setCanScrollPrev(api2.canScrollPrev());
853
+ setCanScrollNext(api2.canScrollNext());
854
+ }, []);
855
+ const scrollPrev = React.useCallback(() => {
856
+ api?.scrollPrev();
857
+ }, [api]);
858
+ const scrollNext = React.useCallback(() => {
859
+ api?.scrollNext();
860
+ }, [api]);
861
+ const handleKeyDown = React.useCallback(
862
+ (event) => {
863
+ if (event.key === "ArrowLeft") {
864
+ event.preventDefault();
865
+ scrollPrev();
866
+ } else if (event.key === "ArrowRight") {
867
+ event.preventDefault();
868
+ scrollNext();
869
+ }
870
+ },
871
+ [scrollPrev, scrollNext]
872
+ );
873
+ React.useEffect(() => {
874
+ if (!api || !setApi) return;
875
+ setApi(api);
876
+ }, [api, setApi]);
877
+ React.useEffect(() => {
878
+ if (!api) return;
879
+ onSelect(api);
880
+ api.on("reInit", onSelect);
881
+ api.on("select", onSelect);
882
+ return () => {
883
+ api?.off("select", onSelect);
884
+ };
885
+ }, [api, onSelect]);
886
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
887
+ CarouselContext.Provider,
888
+ {
889
+ value: {
890
+ carouselRef,
891
+ api,
892
+ opts,
893
+ orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
894
+ scrollPrev,
895
+ scrollNext,
896
+ canScrollPrev,
897
+ canScrollNext
898
+ },
899
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
900
+ "div",
901
+ {
902
+ onKeyDownCapture: handleKeyDown,
903
+ className: cn("relative", className),
904
+ role: "region",
905
+ "aria-roledescription": "carousel",
906
+ "data-slot": "carousel",
907
+ ...props,
908
+ children
909
+ }
910
+ )
911
+ }
912
+ );
913
+ }
914
+ function CarouselContent({ className, ...props }) {
915
+ const { carouselRef, orientation } = useCarousel();
916
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
917
+ "div",
918
+ {
919
+ ref: carouselRef,
920
+ className: "overflow-hidden",
921
+ "data-slot": "carousel-content",
922
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
923
+ "div",
924
+ {
925
+ className: cn(
926
+ "flex",
927
+ orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col",
928
+ className
929
+ ),
930
+ ...props
931
+ }
932
+ )
933
+ }
934
+ );
935
+ }
936
+ function CarouselItem({ className, ...props }) {
937
+ const { orientation } = useCarousel();
938
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
939
+ "div",
940
+ {
941
+ role: "group",
942
+ "aria-roledescription": "slide",
943
+ "data-slot": "carousel-item",
944
+ className: cn(
945
+ "min-w-0 shrink-0 grow-0 basis-full",
946
+ orientation === "horizontal" ? "pl-4" : "pt-4",
947
+ className
948
+ ),
949
+ ...props
950
+ }
951
+ );
952
+ }
953
+ function CarouselPrevious({
954
+ className,
955
+ variant = "outline",
956
+ size = "icon",
957
+ ...props
958
+ }) {
959
+ const { orientation, scrollPrev, canScrollPrev } = useCarousel();
960
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
961
+ Button,
962
+ {
963
+ "data-slot": "carousel-previous",
964
+ variant,
965
+ size,
966
+ className: cn(
967
+ "absolute size-8 rounded-full",
968
+ orientation === "horizontal" ? "top-1/2 -left-12 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
969
+ className
970
+ ),
971
+ disabled: !canScrollPrev,
972
+ onClick: scrollPrev,
973
+ ...props,
974
+ children: [
975
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react6.ArrowLeft, {}),
976
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "sr-only", children: "Previous slide" })
977
+ ]
978
+ }
979
+ );
980
+ }
981
+ function CarouselNext({
982
+ className,
983
+ variant = "outline",
984
+ size = "icon",
985
+ ...props
986
+ }) {
987
+ const { orientation, scrollNext, canScrollNext } = useCarousel();
988
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
989
+ Button,
990
+ {
991
+ "data-slot": "carousel-next",
992
+ variant,
993
+ size,
994
+ className: cn(
995
+ "absolute size-8 rounded-full",
996
+ orientation === "horizontal" ? "top-1/2 -right-12 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
997
+ className
998
+ ),
999
+ disabled: !canScrollNext,
1000
+ onClick: scrollNext,
1001
+ ...props,
1002
+ children: [
1003
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react6.ArrowRight, {}),
1004
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "sr-only", children: "Next slide" })
1005
+ ]
1006
+ }
1007
+ );
1008
+ }
1009
+
1010
+ // src/ui/collapsible.tsx
1011
+ var import_radix_ui13 = require("radix-ui");
1012
+ var import_jsx_runtime18 = require("react/jsx-runtime");
1013
+ function Collapsible({
1014
+ ...props
1015
+ }) {
1016
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_radix_ui13.Collapsible.Root, { "data-slot": "collapsible", ...props });
1017
+ }
1018
+ function CollapsibleTrigger({
1019
+ ...props
1020
+ }) {
1021
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1022
+ import_radix_ui13.Collapsible.CollapsibleTrigger,
1023
+ {
1024
+ "data-slot": "collapsible-trigger",
1025
+ ...props
1026
+ }
1027
+ );
1028
+ }
1029
+ function CollapsibleContent({
1030
+ ...props
1031
+ }) {
1032
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1033
+ import_radix_ui13.Collapsible.CollapsibleContent,
1034
+ {
1035
+ "data-slot": "collapsible-content",
1036
+ ...props
1037
+ }
1038
+ );
1039
+ }
1040
+
1041
+ // src/ui/table.tsx
1042
+ var import_jsx_runtime19 = require("react/jsx-runtime");
1043
+ function Table({ className, ...props }) {
1044
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1045
+ "div",
1046
+ {
1047
+ "data-slot": "table-container",
1048
+ className: "relative w-full overflow-x-auto",
1049
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1050
+ "table",
1051
+ {
1052
+ "data-slot": "table",
1053
+ className: cn("w-full caption-bottom text-sm", className),
1054
+ ...props
1055
+ }
1056
+ )
1057
+ }
1058
+ );
1059
+ }
1060
+ function TableHeader({ className, ...props }) {
1061
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1062
+ "thead",
1063
+ {
1064
+ "data-slot": "table-header",
1065
+ className: cn("[&_tr]:border-b", className),
1066
+ ...props
1067
+ }
1068
+ );
1069
+ }
1070
+ function TableBody({ className, ...props }) {
1071
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1072
+ "tbody",
1073
+ {
1074
+ "data-slot": "table-body",
1075
+ className: cn("[&_tr:last-child]:border-0", className),
1076
+ ...props
1077
+ }
1078
+ );
1079
+ }
1080
+ function TableRow({ className, ...props }) {
1081
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1082
+ "tr",
1083
+ {
1084
+ "data-slot": "table-row",
1085
+ className: cn(
1086
+ "hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",
1087
+ className
1088
+ ),
1089
+ ...props
1090
+ }
1091
+ );
1092
+ }
1093
+ function TableHead({ className, ...props }) {
1094
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1095
+ "th",
1096
+ {
1097
+ "data-slot": "table-head",
1098
+ className: cn(
1099
+ "text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
1100
+ className
1101
+ ),
1102
+ ...props
1103
+ }
1104
+ );
1105
+ }
1106
+ function TableCell({ className, ...props }) {
1107
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1108
+ "td",
1109
+ {
1110
+ "data-slot": "table-cell",
1111
+ className: cn(
1112
+ "p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
1113
+ className
1114
+ ),
1115
+ ...props
1116
+ }
1117
+ );
1118
+ }
1119
+ function TableCaption({
1120
+ className,
1121
+ ...props
1122
+ }) {
1123
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1124
+ "caption",
1125
+ {
1126
+ "data-slot": "table-caption",
1127
+ className: cn("text-muted-foreground mt-4 text-sm", className),
1128
+ ...props
1129
+ }
1130
+ );
1131
+ }
1132
+
1133
+ // src/ui/drawer.tsx
1134
+ var import_vaul = require("vaul");
1135
+ var import_jsx_runtime20 = require("react/jsx-runtime");
1136
+ function Drawer({
1137
+ ...props
1138
+ }) {
1139
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_vaul.Drawer.Root, { "data-slot": "drawer", ...props });
1140
+ }
1141
+ function DrawerPortal({
1142
+ ...props
1143
+ }) {
1144
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_vaul.Drawer.Portal, { "data-slot": "drawer-portal", ...props });
1145
+ }
1146
+ function DrawerOverlay({
1147
+ className,
1148
+ ...props
1149
+ }) {
1150
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1151
+ import_vaul.Drawer.Overlay,
1152
+ {
1153
+ "data-slot": "drawer-overlay",
1154
+ className: cn(
1155
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
1156
+ className
1157
+ ),
1158
+ ...props
1159
+ }
1160
+ );
1161
+ }
1162
+ function DrawerContent({
1163
+ className,
1164
+ children,
1165
+ ...props
1166
+ }) {
1167
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DrawerPortal, { "data-slot": "drawer-portal", children: [
1168
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DrawerOverlay, {}),
1169
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
1170
+ import_vaul.Drawer.Content,
1171
+ {
1172
+ "data-slot": "drawer-content",
1173
+ className: cn(
1174
+ "group/drawer-content bg-background fixed z-50 flex h-auto flex-col",
1175
+ "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b",
1176
+ "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t",
1177
+ "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm",
1178
+ "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",
1179
+ className
1180
+ ),
1181
+ ...props,
1182
+ children: [
1183
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }),
1184
+ children
1185
+ ]
1186
+ }
1187
+ )
1188
+ ] });
1189
+ }
1190
+ function DrawerHeader({ className, ...props }) {
1191
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1192
+ "div",
1193
+ {
1194
+ "data-slot": "drawer-header",
1195
+ className: cn(
1196
+ "flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left",
1197
+ className
1198
+ ),
1199
+ ...props
1200
+ }
1201
+ );
1202
+ }
1203
+ function DrawerTitle({
1204
+ className,
1205
+ ...props
1206
+ }) {
1207
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1208
+ import_vaul.Drawer.Title,
1209
+ {
1210
+ "data-slot": "drawer-title",
1211
+ className: cn("text-foreground font-semibold", className),
1212
+ ...props
1213
+ }
1214
+ );
1215
+ }
1216
+ function DrawerDescription({
1217
+ className,
1218
+ ...props
1219
+ }) {
1220
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1221
+ import_vaul.Drawer.Description,
1222
+ {
1223
+ "data-slot": "drawer-description",
1224
+ className: cn("text-muted-foreground text-sm", className),
1225
+ ...props
1226
+ }
1227
+ );
1228
+ }
1229
+
1230
+ // src/ui/dropdown-menu.tsx
1231
+ var import_lucide_react7 = require("lucide-react");
1232
+ var import_radix_ui14 = require("radix-ui");
1233
+ var import_jsx_runtime21 = require("react/jsx-runtime");
1234
+ function DropdownMenu({
1235
+ ...props
1236
+ }) {
1237
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_radix_ui14.DropdownMenu.Root, { "data-slot": "dropdown-menu", ...props });
1238
+ }
1239
+ function DropdownMenuTrigger({
1240
+ ...props
1241
+ }) {
1242
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1243
+ import_radix_ui14.DropdownMenu.Trigger,
1244
+ {
1245
+ "data-slot": "dropdown-menu-trigger",
1246
+ ...props
1247
+ }
1248
+ );
1249
+ }
1250
+ function DropdownMenuContent({
1251
+ className,
1252
+ sideOffset = 4,
1253
+ ...props
1254
+ }) {
1255
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_radix_ui14.DropdownMenu.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1256
+ import_radix_ui14.DropdownMenu.Content,
1257
+ {
1258
+ "data-slot": "dropdown-menu-content",
1259
+ sideOffset,
1260
+ className: cn(
1261
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]: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 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",
1262
+ className
1263
+ ),
1264
+ ...props
1265
+ }
1266
+ ) });
1267
+ }
1268
+ function DropdownMenuItem({
1269
+ className,
1270
+ inset,
1271
+ variant = "default",
1272
+ ...props
1273
+ }) {
1274
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1275
+ import_radix_ui14.DropdownMenu.Item,
1276
+ {
1277
+ "data-slot": "dropdown-menu-item",
1278
+ "data-inset": inset,
1279
+ "data-variant": variant,
1280
+ className: cn(
1281
+ "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground 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",
1282
+ className
1283
+ ),
1284
+ ...props
1285
+ }
1286
+ );
1287
+ }
1288
+
1289
+ // src/ui/pagination.tsx
1290
+ var import_lucide_react8 = require("lucide-react");
1291
+ var import_jsx_runtime22 = require("react/jsx-runtime");
1292
+ function Pagination({ className, ...props }) {
1293
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1294
+ "nav",
1295
+ {
1296
+ role: "navigation",
1297
+ "aria-label": "pagination",
1298
+ "data-slot": "pagination",
1299
+ className: cn("mx-auto flex w-full justify-center", className),
1300
+ ...props
1301
+ }
1302
+ );
1303
+ }
1304
+ function PaginationContent({
1305
+ className,
1306
+ ...props
1307
+ }) {
1308
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1309
+ "ul",
1310
+ {
1311
+ "data-slot": "pagination-content",
1312
+ className: cn("flex flex-row items-center gap-1", className),
1313
+ ...props
1314
+ }
1315
+ );
1316
+ }
1317
+ function PaginationItem({ ...props }) {
1318
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("li", { "data-slot": "pagination-item", ...props });
1319
+ }
1320
+ function PaginationLink({
1321
+ className,
1322
+ isActive,
1323
+ size = "icon",
1324
+ ...props
1325
+ }) {
1326
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1327
+ "a",
1328
+ {
1329
+ "aria-current": isActive ? "page" : void 0,
1330
+ "data-slot": "pagination-link",
1331
+ "data-active": isActive,
1332
+ className: cn(
1333
+ buttonVariants({
1334
+ variant: isActive ? "outline" : "ghost",
1335
+ size
1336
+ }),
1337
+ className
1338
+ ),
1339
+ ...props
1340
+ }
1341
+ );
1342
+ }
1343
+ function PaginationPrevious({
1344
+ className,
1345
+ ...props
1346
+ }) {
1347
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
1348
+ PaginationLink,
1349
+ {
1350
+ "aria-label": "Go to previous page",
1351
+ size: "default",
1352
+ className: cn("gap-1 px-2.5 sm:pl-2.5", className),
1353
+ ...props,
1354
+ children: [
1355
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react8.ChevronLeftIcon, {}),
1356
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "hidden sm:block", children: "Previous" })
1357
+ ]
1358
+ }
1359
+ );
1360
+ }
1361
+ function PaginationNext({
1362
+ className,
1363
+ ...props
1364
+ }) {
1365
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
1366
+ PaginationLink,
1367
+ {
1368
+ "aria-label": "Go to next page",
1369
+ size: "default",
1370
+ className: cn("gap-1 px-2.5 sm:pr-2.5", className),
1371
+ ...props,
1372
+ children: [
1373
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "hidden sm:block", children: "Next" }),
1374
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react8.ChevronRightIcon, {})
1375
+ ]
1376
+ }
1377
+ );
1378
+ }
1379
+ function PaginationEllipsis({
1380
+ className,
1381
+ ...props
1382
+ }) {
1383
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
1384
+ "span",
1385
+ {
1386
+ "aria-hidden": true,
1387
+ "data-slot": "pagination-ellipsis",
1388
+ className: cn("flex size-9 items-center justify-center", className),
1389
+ ...props,
1390
+ children: [
1391
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react8.MoreHorizontalIcon, { className: "size-4" }),
1392
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "sr-only", children: "More pages" })
1393
+ ]
1394
+ }
1395
+ );
1396
+ }
1397
+
1398
+ // src/ui/popover.tsx
1399
+ var import_radix_ui15 = require("radix-ui");
1400
+ var import_jsx_runtime23 = require("react/jsx-runtime");
1401
+ function Popover({
1402
+ ...props
1403
+ }) {
1404
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_radix_ui15.Popover.Root, { "data-slot": "popover", ...props });
1405
+ }
1406
+ function PopoverTrigger({
1407
+ ...props
1408
+ }) {
1409
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_radix_ui15.Popover.Trigger, { "data-slot": "popover-trigger", ...props });
1410
+ }
1411
+ function PopoverContent({
1412
+ className,
1413
+ align = "center",
1414
+ sideOffset = 4,
1415
+ ...props
1416
+ }) {
1417
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_radix_ui15.Popover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1418
+ import_radix_ui15.Popover.Content,
1419
+ {
1420
+ "data-slot": "popover-content",
1421
+ align,
1422
+ sideOffset,
1423
+ className: cn(
1424
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]: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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
1425
+ className
1426
+ ),
1427
+ ...props
1428
+ }
1429
+ ) });
1430
+ }
1431
+
1432
+ // src/ui/skeleton.tsx
1433
+ var import_jsx_runtime24 = require("react/jsx-runtime");
1434
+ function Skeleton({ className, ...props }) {
1435
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1436
+ "div",
1437
+ {
1438
+ "data-slot": "skeleton",
1439
+ className: cn("bg-accent animate-pulse rounded-md", className),
1440
+ ...props
1441
+ }
1442
+ );
1443
+ }
1444
+
1445
+ // src/ui/slider.tsx
1446
+ var React2 = __toESM(require("react"));
1447
+ var import_radix_ui16 = require("radix-ui");
1448
+ var import_jsx_runtime25 = require("react/jsx-runtime");
1449
+ function Slider({
1450
+ className,
1451
+ defaultValue,
1452
+ value,
1453
+ min = 0,
1454
+ max = 100,
1455
+ ...props
1456
+ }) {
1457
+ const _values = React2.useMemo(
1458
+ () => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
1459
+ [value, defaultValue, min, max]
1460
+ );
1461
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
1462
+ import_radix_ui16.Slider.Root,
1463
+ {
1464
+ "data-slot": "slider",
1465
+ defaultValue,
1466
+ value,
1467
+ min,
1468
+ max,
1469
+ className: cn(
1470
+ "relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
1471
+ className
1472
+ ),
1473
+ ...props,
1474
+ children: [
1475
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1476
+ import_radix_ui16.Slider.Track,
1477
+ {
1478
+ "data-slot": "slider-track",
1479
+ className: cn(
1480
+ "bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
1481
+ ),
1482
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1483
+ import_radix_ui16.Slider.Range,
1484
+ {
1485
+ "data-slot": "slider-range",
1486
+ className: cn(
1487
+ "bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
1488
+ )
1489
+ }
1490
+ )
1491
+ }
1492
+ ),
1493
+ Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1494
+ import_radix_ui16.Slider.Thumb,
1495
+ {
1496
+ "data-slot": "slider-thumb",
1497
+ className: "border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
1498
+ },
1499
+ index
1500
+ ))
1501
+ ]
1502
+ }
1503
+ );
1504
+ }
1505
+
1506
+ // src/ui/tabs.tsx
1507
+ var import_class_variance_authority4 = require("class-variance-authority");
1508
+ var import_radix_ui17 = require("radix-ui");
1509
+ var import_jsx_runtime26 = require("react/jsx-runtime");
1510
+ function Tabs({
1511
+ className,
1512
+ orientation = "horizontal",
1513
+ ...props
1514
+ }) {
1515
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1516
+ import_radix_ui17.Tabs.Root,
1517
+ {
1518
+ "data-slot": "tabs",
1519
+ "data-orientation": orientation,
1520
+ orientation,
1521
+ className: cn(
1522
+ "group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",
1523
+ className
1524
+ ),
1525
+ ...props
1526
+ }
1527
+ );
1528
+ }
1529
+ var tabsListVariants = (0, import_class_variance_authority4.cva)(
1530
+ "rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",
1531
+ {
1532
+ variants: {
1533
+ variant: {
1534
+ default: "bg-muted",
1535
+ line: "gap-1 bg-transparent"
1536
+ }
1537
+ },
1538
+ defaultVariants: {
1539
+ variant: "default"
1540
+ }
1541
+ }
1542
+ );
1543
+ function TabsList({
1544
+ className,
1545
+ variant = "default",
1546
+ ...props
1547
+ }) {
1548
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1549
+ import_radix_ui17.Tabs.List,
1550
+ {
1551
+ "data-slot": "tabs-list",
1552
+ "data-variant": variant,
1553
+ className: cn(tabsListVariants({ variant }), className),
1554
+ ...props
1555
+ }
1556
+ );
1557
+ }
1558
+ function TabsTrigger({
1559
+ className,
1560
+ ...props
1561
+ }) {
1562
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1563
+ import_radix_ui17.Tabs.Trigger,
1564
+ {
1565
+ "data-slot": "tabs-trigger",
1566
+ className: cn(
1567
+ "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative 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-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
1568
+ "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent",
1569
+ "data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground",
1570
+ "after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",
1571
+ className
1572
+ ),
1573
+ ...props
1574
+ }
1575
+ );
1576
+ }
1577
+
1578
+ // src/ui/toggle.tsx
1579
+ var import_class_variance_authority5 = require("class-variance-authority");
1580
+ var import_radix_ui18 = require("radix-ui");
1581
+ var import_jsx_runtime27 = require("react/jsx-runtime");
1582
+ var toggleVariants = (0, import_class_variance_authority5.cva)(
1583
+ "inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",
1584
+ {
1585
+ variants: {
1586
+ variant: {
1587
+ default: "bg-transparent",
1588
+ outline: "border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"
1589
+ },
1590
+ size: {
1591
+ default: "h-9 px-2 min-w-9",
1592
+ sm: "h-8 px-1.5 min-w-8",
1593
+ lg: "h-10 px-2.5 min-w-10"
1594
+ }
1595
+ },
1596
+ defaultVariants: {
1597
+ variant: "default",
1598
+ size: "default"
1599
+ }
1600
+ }
1601
+ );
1602
+ function Toggle({
1603
+ className,
1604
+ variant,
1605
+ size,
1606
+ ...props
1607
+ }) {
1608
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
1609
+ import_radix_ui18.Toggle.Root,
1610
+ {
1611
+ "data-slot": "toggle",
1612
+ className: cn(toggleVariants({ variant, size, className })),
1613
+ ...props
1614
+ }
1615
+ );
1616
+ }
1617
+
1618
+ // src/ui/toggle-group.tsx
1619
+ var React3 = __toESM(require("react"));
1620
+ var import_radix_ui19 = require("radix-ui");
1621
+ var import_jsx_runtime28 = require("react/jsx-runtime");
1622
+ var ToggleGroupContext = React3.createContext({
1623
+ size: "default",
1624
+ variant: "default",
1625
+ spacing: 0
1626
+ });
1627
+ function ToggleGroup({
1628
+ className,
1629
+ variant,
1630
+ size,
1631
+ spacing = 0,
1632
+ children,
1633
+ ...props
1634
+ }) {
1635
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1636
+ import_radix_ui19.ToggleGroup.Root,
1637
+ {
1638
+ "data-slot": "toggle-group",
1639
+ "data-variant": variant,
1640
+ "data-size": size,
1641
+ "data-spacing": spacing,
1642
+ style: { "--gap": spacing },
1643
+ className: cn(
1644
+ "group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",
1645
+ className
1646
+ ),
1647
+ ...props,
1648
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ToggleGroupContext.Provider, { value: { variant, size, spacing }, children })
1649
+ }
1650
+ );
1651
+ }
1652
+ function ToggleGroupItem({
1653
+ className,
1654
+ children,
1655
+ variant,
1656
+ size,
1657
+ ...props
1658
+ }) {
1659
+ const context = React3.useContext(ToggleGroupContext);
1660
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1661
+ import_radix_ui19.ToggleGroup.Item,
1662
+ {
1663
+ "data-slot": "toggle-group-item",
1664
+ "data-variant": context.variant || variant,
1665
+ "data-size": context.size || size,
1666
+ "data-spacing": context.spacing,
1667
+ className: cn(
1668
+ toggleVariants({
1669
+ variant: context.variant || variant,
1670
+ size: context.size || size
1671
+ }),
1672
+ "w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10",
1673
+ "data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",
1674
+ className
1675
+ ),
1676
+ ...props,
1677
+ children
1678
+ }
1679
+ );
1680
+ }
1681
+
1682
+ // src/ui/tooltip.tsx
1683
+ var import_radix_ui20 = require("radix-ui");
1684
+ var import_jsx_runtime29 = require("react/jsx-runtime");
1685
+ function TooltipProvider({
1686
+ delayDuration = 0,
1687
+ ...props
1688
+ }) {
1689
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
1690
+ import_radix_ui20.Tooltip.Provider,
1691
+ {
1692
+ "data-slot": "tooltip-provider",
1693
+ delayDuration,
1694
+ ...props
1695
+ }
1696
+ );
1697
+ }
1698
+ function Tooltip({
1699
+ ...props
1700
+ }) {
1701
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_radix_ui20.Tooltip.Root, { "data-slot": "tooltip", ...props });
1702
+ }
1703
+ function TooltipTrigger({
1704
+ ...props
1705
+ }) {
1706
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_radix_ui20.Tooltip.Trigger, { "data-slot": "tooltip-trigger", ...props });
1707
+ }
1708
+ function TooltipContent({
1709
+ className,
1710
+ sideOffset = 0,
1711
+ children,
1712
+ ...props
1713
+ }) {
1714
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_radix_ui20.Tooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
1715
+ import_radix_ui20.Tooltip.Content,
1716
+ {
1717
+ "data-slot": "tooltip-content",
1718
+ sideOffset,
1719
+ className: cn(
1720
+ "bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
1721
+ className
1722
+ ),
1723
+ ...props,
1724
+ children: [
1725
+ children,
1726
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_radix_ui20.Tooltip.Arrow, { className: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
1727
+ ]
1728
+ }
1729
+ ) });
1730
+ }
1731
+
1732
+ // src/components.tsx
1733
+ var import_jsx_runtime30 = require("react/jsx-runtime");
1734
+ function getPaginationRange(current, total) {
1735
+ if (total <= 7) {
1736
+ return Array.from({ length: total }, (_, i) => i + 1);
1737
+ }
1738
+ const pages = [];
1739
+ pages.push(1);
1740
+ if (current > 3) {
1741
+ pages.push("ellipsis");
1742
+ }
1743
+ const start = Math.max(2, current - 1);
1744
+ const end = Math.min(total - 1, current + 1);
1745
+ for (let i = start; i <= end; i++) {
1746
+ pages.push(i);
1747
+ }
1748
+ if (current < total - 2) {
1749
+ pages.push("ellipsis");
1750
+ }
1751
+ pages.push(total);
1752
+ return pages;
1753
+ }
1754
+ var shadcnComponents = {
1755
+ // ── Layout ────────────────────────────────────────────────────────────
1756
+ Card: ({ props, children }) => {
1757
+ const maxWidthClass = props.maxWidth === "sm" ? "max-w-xs sm:min-w-[280px]" : props.maxWidth === "md" ? "max-w-sm sm:min-w-[320px]" : props.maxWidth === "lg" ? "max-w-md sm:min-w-[360px]" : "w-full";
1758
+ const centeredClass = props.centered ? "mx-auto" : "";
1759
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Card, { className: cn(maxWidthClass, centeredClass), children: [
1760
+ (props.title || props.description) && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(CardHeader, { children: [
1761
+ props.title && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CardTitle, { children: props.title }),
1762
+ props.description && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CardDescription, { children: props.description })
1763
+ ] }),
1764
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CardContent, { className: "flex flex-col gap-3", children })
1765
+ ] });
1766
+ },
1767
+ Stack: ({ props, children }) => {
1768
+ const isHorizontal = props.direction === "horizontal";
1769
+ const gapMap = {
1770
+ none: "gap-0",
1771
+ sm: "gap-2",
1772
+ md: "gap-3",
1773
+ lg: "gap-4"
1774
+ };
1775
+ const alignMap = {
1776
+ start: "items-start",
1777
+ center: "items-center",
1778
+ end: "items-end",
1779
+ stretch: "items-stretch"
1780
+ };
1781
+ const justifyMap = {
1782
+ start: "",
1783
+ center: "justify-center",
1784
+ end: "justify-end",
1785
+ between: "justify-between",
1786
+ around: "justify-around"
1787
+ };
1788
+ const gapClass = gapMap[props.gap ?? "md"] ?? "gap-3";
1789
+ const alignClass = alignMap[props.align ?? "start"] ?? "items-start";
1790
+ const justifyClass = justifyMap[props.justify ?? ""] ?? "";
1791
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
1792
+ "div",
1793
+ {
1794
+ className: `flex ${isHorizontal ? "flex-row flex-wrap" : "flex-col"} ${gapClass} ${alignClass} ${justifyClass}`,
1795
+ children
1796
+ }
1797
+ );
1798
+ },
1799
+ Grid: ({ props, children }) => {
1800
+ const colsMap = {
1801
+ 1: "grid-cols-1",
1802
+ 2: "grid-cols-2",
1803
+ 3: "grid-cols-3",
1804
+ 4: "grid-cols-4",
1805
+ 5: "grid-cols-5",
1806
+ 6: "grid-cols-6"
1807
+ };
1808
+ const gridGapMap = {
1809
+ sm: "gap-2",
1810
+ md: "gap-3",
1811
+ lg: "gap-4"
1812
+ };
1813
+ const n = Math.max(1, Math.min(6, props.columns ?? 1));
1814
+ const cols = colsMap[n] ?? "grid-cols-1";
1815
+ const gridGap = gridGapMap[props.gap ?? "md"] ?? "gap-3";
1816
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: `grid ${cols} ${gridGap}`, children });
1817
+ },
1818
+ Separator: ({ props }) => {
1819
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
1820
+ Separator,
1821
+ {
1822
+ orientation: props.orientation ?? "horizontal",
1823
+ className: props.orientation === "vertical" ? "h-full mx-2" : "my-3"
1824
+ }
1825
+ );
1826
+ },
1827
+ Tabs: ({
1828
+ props,
1829
+ children,
1830
+ bindings,
1831
+ emit
1832
+ }) => {
1833
+ const tabs = props.tabs ?? [];
1834
+ const [boundValue, setBoundValue] = (0, import_react2.useBoundProp)(
1835
+ props.value,
1836
+ bindings?.value
1837
+ );
1838
+ const [localValue, setLocalValue] = (0, import_react.useState)(
1839
+ props.defaultValue ?? tabs[0]?.value ?? ""
1840
+ );
1841
+ const isBound = !!bindings?.value;
1842
+ const value = isBound ? boundValue ?? tabs[0]?.value ?? "" : localValue;
1843
+ const setValue = isBound ? setBoundValue : setLocalValue;
1844
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
1845
+ Tabs,
1846
+ {
1847
+ value,
1848
+ onValueChange: (v) => {
1849
+ setValue(v);
1850
+ emit("change");
1851
+ },
1852
+ children: [
1853
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TabsList, { children: tabs.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TabsTrigger, { value: tab.value, children: tab.label }, tab.value)) }),
1854
+ children
1855
+ ]
1856
+ }
1857
+ );
1858
+ },
1859
+ Accordion: ({ props }) => {
1860
+ const items = props.items ?? [];
1861
+ const isMultiple = props.type === "multiple";
1862
+ const itemElements = items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(AccordionItem, { value: `item-${i}`, children: [
1863
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AccordionTrigger, { children: item.title }),
1864
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AccordionContent, { children: item.content })
1865
+ ] }, i));
1866
+ if (isMultiple) {
1867
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Accordion, { type: "multiple", className: "w-full", children: itemElements });
1868
+ }
1869
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Accordion, { type: "single", collapsible: true, className: "w-full", children: itemElements });
1870
+ },
1871
+ Collapsible: ({
1872
+ props,
1873
+ children
1874
+ }) => {
1875
+ const [open, setOpen] = (0, import_react.useState)(props.defaultOpen ?? false);
1876
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Collapsible, { open, onOpenChange: setOpen, className: "w-full", children: [
1877
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("button", { className: "flex w-full items-center justify-between rounded-md border border-border px-4 py-2 text-sm font-medium hover:bg-muted transition-colors", children: [
1878
+ props.title,
1879
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
1880
+ "svg",
1881
+ {
1882
+ className: `h-4 w-4 transition-transform ${open ? "rotate-180" : ""}`,
1883
+ fill: "none",
1884
+ viewBox: "0 0 24 24",
1885
+ stroke: "currentColor",
1886
+ strokeWidth: 2,
1887
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
1888
+ "path",
1889
+ {
1890
+ strokeLinecap: "round",
1891
+ strokeLinejoin: "round",
1892
+ d: "M19 9l-7 7-7-7"
1893
+ }
1894
+ )
1895
+ }
1896
+ )
1897
+ ] }) }),
1898
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CollapsibleContent, { className: "pt-2", children })
1899
+ ] });
1900
+ },
1901
+ Dialog: ({ props, children }) => {
1902
+ const [open, setOpen] = (0, import_react2.useStateBinding)(props.openPath ?? "");
1903
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Dialog, { open: open ?? false, onOpenChange: (v) => setOpen(v), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(DialogContent, { children: [
1904
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(DialogHeader, { children: [
1905
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DialogTitle, { children: props.title }),
1906
+ props.description && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DialogDescription, { children: props.description })
1907
+ ] }),
1908
+ children
1909
+ ] }) });
1910
+ },
1911
+ Drawer: ({ props, children }) => {
1912
+ const [open, setOpen] = (0, import_react2.useStateBinding)(props.openPath ?? "");
1913
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Drawer, { open: open ?? false, onOpenChange: (v) => setOpen(v), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(DrawerContent, { children: [
1914
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(DrawerHeader, { children: [
1915
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DrawerTitle, { children: props.title }),
1916
+ props.description && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DrawerDescription, { children: props.description })
1917
+ ] }),
1918
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "p-4", children })
1919
+ ] }) });
1920
+ },
1921
+ Carousel: ({ props }) => {
1922
+ const items = props.items ?? [];
1923
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Carousel, { className: "w-full", children: [
1924
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CarouselContent, { children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
1925
+ CarouselItem,
1926
+ {
1927
+ className: "basis-3/4 md:basis-1/2 lg:basis-1/3",
1928
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "border border-border rounded-lg p-4 bg-card h-full", children: [
1929
+ item.title && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h4", { className: "font-semibold text-sm mb-1", children: item.title }),
1930
+ item.description && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-sm text-muted-foreground", children: item.description })
1931
+ ] })
1932
+ },
1933
+ i
1934
+ )) }),
1935
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CarouselPrevious, {}),
1936
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CarouselNext, {})
1937
+ ] });
1938
+ },
1939
+ // ── Data Display ──────────────────────────────────────────────────────
1940
+ Table: ({ props }) => {
1941
+ const columns = props.columns ?? [];
1942
+ const rows = (props.rows ?? []).map((row) => row.map(String));
1943
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "rounded-md border border-border overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Table, { children: [
1944
+ props.caption && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TableCaption, { children: props.caption }),
1945
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TableRow, { children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TableHead, { children: col }, col)) }) }),
1946
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TableBody, { children: rows.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TableRow, { children: row.map((cell, j) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TableCell, { children: cell }, j)) }, i)) })
1947
+ ] }) });
1948
+ },
1949
+ Heading: ({ props }) => {
1950
+ const level = props.level ?? "h2";
1951
+ const headingClass = level === "h1" ? "text-2xl font-bold" : level === "h3" ? "text-base font-semibold" : level === "h4" ? "text-sm font-semibold" : "text-lg font-semibold";
1952
+ if (level === "h1")
1953
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h1", { className: `${headingClass} text-left`, children: props.text });
1954
+ if (level === "h3")
1955
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h3", { className: `${headingClass} text-left`, children: props.text });
1956
+ if (level === "h4")
1957
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h4", { className: `${headingClass} text-left`, children: props.text });
1958
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h2", { className: `${headingClass} text-left`, children: props.text });
1959
+ },
1960
+ Text: ({ props }) => {
1961
+ const textClass = props.variant === "caption" ? "text-xs" : props.variant === "muted" ? "text-sm text-muted-foreground" : props.variant === "lead" ? "text-xl text-muted-foreground" : props.variant === "code" ? "font-mono text-sm bg-muted px-1.5 py-0.5 rounded" : "text-sm";
1962
+ if (props.variant === "code") {
1963
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("code", { className: `${textClass} text-left`, children: props.text });
1964
+ }
1965
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: `${textClass} text-left`, children: props.text });
1966
+ },
1967
+ Image: ({ props }) => {
1968
+ if (props.src) {
1969
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
1970
+ "img",
1971
+ {
1972
+ src: props.src,
1973
+ alt: props.alt ?? "",
1974
+ width: props.width ?? void 0,
1975
+ height: props.height ?? void 0,
1976
+ className: "rounded max-w-full"
1977
+ }
1978
+ );
1979
+ }
1980
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
1981
+ "div",
1982
+ {
1983
+ className: "bg-muted border border-border rounded flex items-center justify-center text-xs text-muted-foreground",
1984
+ style: { width: props.width ?? 80, height: props.height ?? 60 },
1985
+ children: props.alt || "img"
1986
+ }
1987
+ );
1988
+ },
1989
+ Avatar: ({ props }) => {
1990
+ const name = props.name || "?";
1991
+ const initials = name.split(" ").map((n) => n[0]).join("").slice(0, 2).toUpperCase();
1992
+ const sizeClass = props.size === "lg" ? "h-12 w-12" : props.size === "sm" ? "h-8 w-8" : "h-10 w-10";
1993
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Avatar, { className: sizeClass, children: [
1994
+ props.src && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AvatarImage, { src: props.src, alt: name }),
1995
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AvatarFallback, { children: initials })
1996
+ ] });
1997
+ },
1998
+ Badge: ({ props }) => {
1999
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Badge, { variant: props.variant ?? "default", children: props.text });
2000
+ },
2001
+ Alert: ({ props }) => {
2002
+ const variant = props.type === "error" ? "destructive" : "default";
2003
+ const customClass = props.type === "success" ? "border-green-200 bg-green-50 text-green-900 dark:border-green-800 dark:bg-green-950 dark:text-green-100" : props.type === "warning" ? "border-yellow-200 bg-yellow-50 text-yellow-900 dark:border-yellow-800 dark:bg-yellow-950 dark:text-yellow-100" : props.type === "info" ? "border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-100" : "";
2004
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Alert, { variant, className: customClass, children: [
2005
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AlertTitle, { children: props.title }),
2006
+ props.message && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AlertDescription, { children: props.message })
2007
+ ] });
2008
+ },
2009
+ Progress: ({ props }) => {
2010
+ const value = Math.min(100, Math.max(0, props.value || 0));
2011
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "space-y-2", children: [
2012
+ props.label && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Label, { className: "text-sm text-muted-foreground", children: props.label }),
2013
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Progress, { value })
2014
+ ] });
2015
+ },
2016
+ Skeleton: ({ props }) => {
2017
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2018
+ Skeleton,
2019
+ {
2020
+ className: props.rounded ? "rounded-full" : "rounded-md",
2021
+ style: {
2022
+ width: props.width ?? "100%",
2023
+ height: props.height ?? "1.25rem"
2024
+ }
2025
+ }
2026
+ );
2027
+ },
2028
+ Spinner: ({ props }) => {
2029
+ const sizeClass = props.size === "lg" ? "h-8 w-8" : props.size === "sm" ? "h-4 w-4" : "h-6 w-6";
2030
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center gap-2", children: [
2031
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
2032
+ "svg",
2033
+ {
2034
+ className: `${sizeClass} animate-spin text-muted-foreground`,
2035
+ viewBox: "0 0 24 24",
2036
+ fill: "none",
2037
+ children: [
2038
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2039
+ "circle",
2040
+ {
2041
+ className: "opacity-25",
2042
+ cx: "12",
2043
+ cy: "12",
2044
+ r: "10",
2045
+ stroke: "currentColor",
2046
+ strokeWidth: "4"
2047
+ }
2048
+ ),
2049
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2050
+ "path",
2051
+ {
2052
+ className: "opacity-75",
2053
+ fill: "currentColor",
2054
+ d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
2055
+ }
2056
+ )
2057
+ ]
2058
+ }
2059
+ ),
2060
+ props.label && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-sm text-muted-foreground", children: props.label })
2061
+ ] });
2062
+ },
2063
+ Tooltip: ({ props }) => {
2064
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Tooltip, { children: [
2065
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-sm underline decoration-dotted cursor-help", children: props.text }) }),
2066
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TooltipContent, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { children: props.content }) })
2067
+ ] }) });
2068
+ },
2069
+ Popover: ({ props }) => {
2070
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Popover, { children: [
2071
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Button, { variant: "outline", className: "text-sm", children: props.trigger }) }),
2072
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PopoverContent, { className: "w-64", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-sm", children: props.content }) })
2073
+ ] });
2074
+ },
2075
+ // ── Form Inputs ───────────────────────────────────────────────────────
2076
+ Input: ({
2077
+ props,
2078
+ bindings,
2079
+ emit
2080
+ }) => {
2081
+ const [boundValue, setBoundValue] = (0, import_react2.useBoundProp)(
2082
+ props.value,
2083
+ bindings?.value
2084
+ );
2085
+ const [localValue, setLocalValue] = (0, import_react.useState)("");
2086
+ const isBound = !!bindings?.value;
2087
+ const value = isBound ? boundValue ?? "" : localValue;
2088
+ const setValue = isBound ? setBoundValue : setLocalValue;
2089
+ const hasValidation = !!(bindings?.value && props.checks?.length);
2090
+ const { errors, validate } = (0, import_react2.useFieldValidation)(
2091
+ bindings?.value ?? "",
2092
+ hasValidation ? { checks: props.checks ?? [] } : void 0
2093
+ );
2094
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "space-y-2", children: [
2095
+ props.label && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Label, { htmlFor: props.name ?? void 0, children: props.label }),
2096
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2097
+ Input,
2098
+ {
2099
+ id: props.name ?? void 0,
2100
+ name: props.name ?? void 0,
2101
+ type: props.type ?? "text",
2102
+ placeholder: props.placeholder ?? "",
2103
+ value,
2104
+ onChange: (e) => setValue(e.target.value),
2105
+ onKeyDown: (e) => {
2106
+ if (e.key === "Enter") emit("submit");
2107
+ },
2108
+ onFocus: () => emit("focus"),
2109
+ onBlur: () => {
2110
+ if (hasValidation) validate();
2111
+ emit("blur");
2112
+ }
2113
+ }
2114
+ ),
2115
+ errors.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-sm text-destructive", children: errors[0] })
2116
+ ] });
2117
+ },
2118
+ Textarea: ({
2119
+ props,
2120
+ bindings
2121
+ }) => {
2122
+ const [boundValue, setBoundValue] = (0, import_react2.useBoundProp)(
2123
+ props.value,
2124
+ bindings?.value
2125
+ );
2126
+ const [localValue, setLocalValue] = (0, import_react.useState)("");
2127
+ const isBound = !!bindings?.value;
2128
+ const value = isBound ? boundValue ?? "" : localValue;
2129
+ const setValue = isBound ? setBoundValue : setLocalValue;
2130
+ const hasValidation = !!(bindings?.value && props.checks?.length);
2131
+ const { errors, validate } = (0, import_react2.useFieldValidation)(
2132
+ bindings?.value ?? "",
2133
+ hasValidation ? { checks: props.checks ?? [] } : void 0
2134
+ );
2135
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "space-y-2", children: [
2136
+ props.label && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Label, { htmlFor: props.name ?? void 0, children: props.label }),
2137
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2138
+ Textarea,
2139
+ {
2140
+ id: props.name ?? void 0,
2141
+ name: props.name ?? void 0,
2142
+ placeholder: props.placeholder ?? "",
2143
+ rows: props.rows ?? 3,
2144
+ value,
2145
+ onChange: (e) => setValue(e.target.value),
2146
+ onBlur: () => {
2147
+ if (hasValidation) validate();
2148
+ }
2149
+ }
2150
+ ),
2151
+ errors.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-sm text-destructive", children: errors[0] })
2152
+ ] });
2153
+ },
2154
+ Select: ({
2155
+ props,
2156
+ bindings,
2157
+ emit
2158
+ }) => {
2159
+ const [boundValue, setBoundValue] = (0, import_react2.useBoundProp)(
2160
+ props.value,
2161
+ bindings?.value
2162
+ );
2163
+ const [localValue, setLocalValue] = (0, import_react.useState)("");
2164
+ const isBound = !!bindings?.value;
2165
+ const value = isBound ? boundValue ?? "" : localValue;
2166
+ const setValue = isBound ? setBoundValue : setLocalValue;
2167
+ const rawOptions = props.options ?? [];
2168
+ const options = rawOptions.map(
2169
+ (opt) => typeof opt === "string" ? opt : String(opt ?? "")
2170
+ );
2171
+ const hasValidation = !!(bindings?.value && props.checks?.length);
2172
+ const { errors, validate } = (0, import_react2.useFieldValidation)(
2173
+ bindings?.value ?? "",
2174
+ hasValidation ? { checks: props.checks ?? [] } : void 0
2175
+ );
2176
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "space-y-2", children: [
2177
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Label, { children: props.label }),
2178
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
2179
+ Select,
2180
+ {
2181
+ value,
2182
+ onValueChange: (v) => {
2183
+ setValue(v);
2184
+ if (hasValidation) validate();
2185
+ emit("change");
2186
+ },
2187
+ children: [
2188
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SelectValue, { placeholder: props.placeholder ?? "Select..." }) }),
2189
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SelectContent, { children: options.map((opt, idx) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SelectItem, { value: opt || `option-${idx}`, children: opt }, `${idx}-${opt}`)) })
2190
+ ]
2191
+ }
2192
+ ),
2193
+ errors.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-sm text-destructive", children: errors[0] })
2194
+ ] });
2195
+ },
2196
+ Checkbox: ({
2197
+ props,
2198
+ bindings,
2199
+ emit
2200
+ }) => {
2201
+ const [boundChecked, setBoundChecked] = (0, import_react2.useBoundProp)(
2202
+ props.checked,
2203
+ bindings?.checked
2204
+ );
2205
+ const [localChecked, setLocalChecked] = (0, import_react.useState)(!!props.checked);
2206
+ const isBound = !!bindings?.checked;
2207
+ const checked = isBound ? boundChecked ?? false : localChecked;
2208
+ const setChecked = isBound ? setBoundChecked : setLocalChecked;
2209
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center space-x-2", children: [
2210
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2211
+ Checkbox,
2212
+ {
2213
+ id: props.name ?? void 0,
2214
+ checked,
2215
+ onCheckedChange: (c) => {
2216
+ setChecked(c === true);
2217
+ emit("change");
2218
+ }
2219
+ }
2220
+ ),
2221
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Label, { htmlFor: props.name ?? void 0, className: "cursor-pointer", children: props.label })
2222
+ ] });
2223
+ },
2224
+ Radio: ({
2225
+ props,
2226
+ bindings,
2227
+ emit
2228
+ }) => {
2229
+ const rawOptions = props.options ?? [];
2230
+ const options = rawOptions.map(
2231
+ (opt) => typeof opt === "string" ? opt : String(opt ?? "")
2232
+ );
2233
+ const [boundValue, setBoundValue] = (0, import_react2.useBoundProp)(
2234
+ props.value,
2235
+ bindings?.value
2236
+ );
2237
+ const [localValue, setLocalValue] = (0, import_react.useState)(options[0] ?? "");
2238
+ const isBound = !!bindings?.value;
2239
+ const value = isBound ? boundValue ?? "" : localValue;
2240
+ const setValue = isBound ? setBoundValue : setLocalValue;
2241
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "space-y-2", children: [
2242
+ props.label && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Label, { children: props.label }),
2243
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2244
+ RadioGroup,
2245
+ {
2246
+ value,
2247
+ onValueChange: (v) => {
2248
+ setValue(v);
2249
+ emit("change");
2250
+ },
2251
+ children: options.map((opt, idx) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center space-x-2", children: [
2252
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2253
+ RadioGroupItem,
2254
+ {
2255
+ value: opt || `option-${idx}`,
2256
+ id: `${props.name}-${idx}-${opt}`
2257
+ }
2258
+ ),
2259
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2260
+ Label,
2261
+ {
2262
+ htmlFor: `${props.name}-${idx}-${opt}`,
2263
+ className: "cursor-pointer",
2264
+ children: opt
2265
+ }
2266
+ )
2267
+ ] }, `${idx}-${opt}`))
2268
+ }
2269
+ )
2270
+ ] });
2271
+ },
2272
+ Switch: ({
2273
+ props,
2274
+ bindings,
2275
+ emit
2276
+ }) => {
2277
+ const [boundChecked, setBoundChecked] = (0, import_react2.useBoundProp)(
2278
+ props.checked,
2279
+ bindings?.checked
2280
+ );
2281
+ const [localChecked, setLocalChecked] = (0, import_react.useState)(!!props.checked);
2282
+ const isBound = !!bindings?.checked;
2283
+ const checked = isBound ? boundChecked ?? false : localChecked;
2284
+ const setChecked = isBound ? setBoundChecked : setLocalChecked;
2285
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center justify-between space-x-2", children: [
2286
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Label, { htmlFor: props.name ?? void 0, className: "cursor-pointer", children: props.label }),
2287
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2288
+ Switch,
2289
+ {
2290
+ id: props.name ?? void 0,
2291
+ checked,
2292
+ onCheckedChange: (c) => {
2293
+ setChecked(c);
2294
+ emit("change");
2295
+ }
2296
+ }
2297
+ )
2298
+ ] });
2299
+ },
2300
+ Slider: ({
2301
+ props,
2302
+ bindings,
2303
+ emit
2304
+ }) => {
2305
+ const [boundValue, setBoundValue] = (0, import_react2.useBoundProp)(
2306
+ props.value,
2307
+ bindings?.value
2308
+ );
2309
+ const [localValue, setLocalValue] = (0, import_react.useState)(props.min ?? 0);
2310
+ const isBound = !!bindings?.value;
2311
+ const value = isBound ? boundValue ?? props.min ?? 0 : localValue;
2312
+ const setValue = isBound ? setBoundValue : setLocalValue;
2313
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "space-y-2", children: [
2314
+ props.label && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex justify-between", children: [
2315
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Label, { className: "text-sm", children: props.label }),
2316
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-sm text-muted-foreground", children: value })
2317
+ ] }),
2318
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2319
+ Slider,
2320
+ {
2321
+ value: [value],
2322
+ min: props.min ?? 0,
2323
+ max: props.max ?? 100,
2324
+ step: props.step ?? 1,
2325
+ onValueChange: (v) => {
2326
+ setValue(v[0] ?? 0);
2327
+ emit("change");
2328
+ }
2329
+ }
2330
+ )
2331
+ ] });
2332
+ },
2333
+ // ── Actions ───────────────────────────────────────────────────────────
2334
+ Button: ({ props, emit }) => {
2335
+ const variant = props.variant === "danger" ? "destructive" : props.variant === "secondary" ? "secondary" : "default";
2336
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2337
+ Button,
2338
+ {
2339
+ variant,
2340
+ disabled: props.disabled ?? false,
2341
+ onClick: () => emit("press"),
2342
+ children: props.label
2343
+ }
2344
+ );
2345
+ },
2346
+ Link: ({ props, on }) => {
2347
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2348
+ "a",
2349
+ {
2350
+ href: props.href ?? "#",
2351
+ className: "text-primary underline-offset-4 hover:underline text-sm font-medium",
2352
+ onClick: (e) => {
2353
+ const press = on("press");
2354
+ if (press.shouldPreventDefault) e.preventDefault();
2355
+ press.emit();
2356
+ },
2357
+ children: props.label
2358
+ }
2359
+ );
2360
+ },
2361
+ DropdownMenu: ({
2362
+ props,
2363
+ bindings,
2364
+ emit
2365
+ }) => {
2366
+ const items = props.items ?? [];
2367
+ const [, setBoundValue] = (0, import_react2.useBoundProp)(
2368
+ props.value,
2369
+ bindings?.value
2370
+ );
2371
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(DropdownMenu, { children: [
2372
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Button, { variant: "outline", children: props.label }) }),
2373
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DropdownMenuContent, { children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2374
+ DropdownMenuItem,
2375
+ {
2376
+ onClick: () => {
2377
+ setBoundValue(item.value);
2378
+ emit("select");
2379
+ },
2380
+ children: item.label
2381
+ },
2382
+ item.value
2383
+ )) })
2384
+ ] });
2385
+ },
2386
+ Toggle: ({
2387
+ props,
2388
+ bindings,
2389
+ emit
2390
+ }) => {
2391
+ const [boundPressed, setBoundPressed] = (0, import_react2.useBoundProp)(
2392
+ props.pressed,
2393
+ bindings?.pressed
2394
+ );
2395
+ const [localPressed, setLocalPressed] = (0, import_react.useState)(props.pressed ?? false);
2396
+ const isBound = !!bindings?.pressed;
2397
+ const pressed = isBound ? boundPressed ?? false : localPressed;
2398
+ const setPressed = isBound ? setBoundPressed : setLocalPressed;
2399
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2400
+ Toggle,
2401
+ {
2402
+ variant: props.variant ?? "default",
2403
+ pressed,
2404
+ onPressedChange: (v) => {
2405
+ setPressed(v);
2406
+ emit("change");
2407
+ },
2408
+ children: props.label
2409
+ }
2410
+ );
2411
+ },
2412
+ ToggleGroup: ({
2413
+ props,
2414
+ bindings,
2415
+ emit
2416
+ }) => {
2417
+ const type = props.type ?? "single";
2418
+ const items = props.items ?? [];
2419
+ const [boundValue, setBoundValue] = (0, import_react2.useBoundProp)(
2420
+ props.value,
2421
+ bindings?.value
2422
+ );
2423
+ const [localValue, setLocalValue] = (0, import_react.useState)(items[0]?.value ?? "");
2424
+ const isBound = !!bindings?.value;
2425
+ const value = isBound ? boundValue ?? "" : localValue;
2426
+ const setValue = isBound ? setBoundValue : setLocalValue;
2427
+ if (type === "multiple") {
2428
+ const selected = value ? value.split(",").filter(Boolean) : [];
2429
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2430
+ ToggleGroup,
2431
+ {
2432
+ type: "multiple",
2433
+ value: selected,
2434
+ onValueChange: (v) => {
2435
+ setValue(v.join(","));
2436
+ emit("change");
2437
+ },
2438
+ children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ToggleGroupItem, { value: item.value, children: item.label }, item.value))
2439
+ }
2440
+ );
2441
+ }
2442
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2443
+ ToggleGroup,
2444
+ {
2445
+ type: "single",
2446
+ value,
2447
+ onValueChange: (v) => {
2448
+ if (v) {
2449
+ setValue(v);
2450
+ emit("change");
2451
+ }
2452
+ },
2453
+ children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ToggleGroupItem, { value: item.value, children: item.label }, item.value))
2454
+ }
2455
+ );
2456
+ },
2457
+ ButtonGroup: ({
2458
+ props,
2459
+ bindings,
2460
+ emit
2461
+ }) => {
2462
+ const buttons = props.buttons ?? [];
2463
+ const [boundSelected, setBoundSelected] = (0, import_react2.useBoundProp)(
2464
+ props.selected,
2465
+ bindings?.selected
2466
+ );
2467
+ const [localValue, setLocalValue] = (0, import_react.useState)(buttons[0]?.value ?? "");
2468
+ const isBound = !!bindings?.selected;
2469
+ const value = isBound ? boundSelected ?? "" : localValue;
2470
+ const setValue = isBound ? setBoundSelected : setLocalValue;
2471
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "inline-flex rounded-md border border-border", children: buttons.map((btn, i) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2472
+ "button",
2473
+ {
2474
+ className: `px-3 py-1.5 text-sm transition-colors ${value === btn.value ? "bg-primary text-primary-foreground" : "bg-background hover:bg-muted"} ${i > 0 ? "border-l border-border" : ""} ${i === 0 ? "rounded-l-md" : ""} ${i === buttons.length - 1 ? "rounded-r-md" : ""}`,
2475
+ onClick: () => {
2476
+ setValue(btn.value);
2477
+ emit("change");
2478
+ },
2479
+ children: btn.label
2480
+ },
2481
+ btn.value
2482
+ )) });
2483
+ },
2484
+ Pagination: ({
2485
+ props,
2486
+ bindings,
2487
+ emit
2488
+ }) => {
2489
+ const [boundPage, setBoundPage] = (0, import_react2.useBoundProp)(
2490
+ props.page,
2491
+ bindings?.page
2492
+ );
2493
+ const currentPage = boundPage ?? 1;
2494
+ const totalPages = props.totalPages ?? 1;
2495
+ const pages = getPaginationRange(currentPage, totalPages);
2496
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Pagination, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(PaginationContent, { children: [
2497
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2498
+ PaginationPrevious,
2499
+ {
2500
+ href: "#",
2501
+ onClick: (e) => {
2502
+ e.preventDefault();
2503
+ if (currentPage > 1) {
2504
+ setBoundPage(currentPage - 1);
2505
+ emit("change");
2506
+ }
2507
+ }
2508
+ }
2509
+ ) }),
2510
+ pages.map(
2511
+ (page, idx) => page === "ellipsis" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PaginationEllipsis, {}) }, `ellipsis-${idx}`) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2512
+ PaginationLink,
2513
+ {
2514
+ href: "#",
2515
+ isActive: page === currentPage,
2516
+ onClick: (e) => {
2517
+ e.preventDefault();
2518
+ setBoundPage(page);
2519
+ emit("change");
2520
+ },
2521
+ children: page
2522
+ }
2523
+ ) }, page)
2524
+ ),
2525
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2526
+ PaginationNext,
2527
+ {
2528
+ href: "#",
2529
+ onClick: (e) => {
2530
+ e.preventDefault();
2531
+ if (currentPage < totalPages) {
2532
+ setBoundPage(currentPage + 1);
2533
+ emit("change");
2534
+ }
2535
+ }
2536
+ }
2537
+ ) })
2538
+ ] }) });
2539
+ }
2540
+ };
2541
+
2542
+ // src/catalog.ts
2543
+ var import_zod = require("zod");
2544
+ var shadcnComponentDefinitions = {
2545
+ // ==========================================================================
2546
+ // Layout Components
2547
+ // ==========================================================================
2548
+ Card: {
2549
+ props: import_zod.z.object({
2550
+ title: import_zod.z.string().nullable(),
2551
+ description: import_zod.z.string().nullable(),
2552
+ maxWidth: import_zod.z.enum(["sm", "md", "lg", "full"]).nullable(),
2553
+ centered: import_zod.z.boolean().nullable()
2554
+ }),
2555
+ slots: ["default"],
2556
+ description: "Container card for content sections. Use for forms/content boxes, NOT for page headers.",
2557
+ example: { title: "Overview", description: "Your account summary" }
2558
+ },
2559
+ Stack: {
2560
+ props: import_zod.z.object({
2561
+ direction: import_zod.z.enum(["horizontal", "vertical"]).nullable(),
2562
+ gap: import_zod.z.enum(["none", "sm", "md", "lg"]).nullable(),
2563
+ align: import_zod.z.enum(["start", "center", "end", "stretch"]).nullable(),
2564
+ justify: import_zod.z.enum(["start", "center", "end", "between", "around"]).nullable()
2565
+ }),
2566
+ slots: ["default"],
2567
+ description: "Flex container for layouts",
2568
+ example: { direction: "vertical", gap: "md" }
2569
+ },
2570
+ Grid: {
2571
+ props: import_zod.z.object({
2572
+ columns: import_zod.z.number().nullable(),
2573
+ gap: import_zod.z.enum(["sm", "md", "lg"]).nullable()
2574
+ }),
2575
+ slots: ["default"],
2576
+ description: "Grid layout (1-6 columns)",
2577
+ example: { columns: 3, gap: "md" }
2578
+ },
2579
+ Separator: {
2580
+ props: import_zod.z.object({
2581
+ orientation: import_zod.z.enum(["horizontal", "vertical"]).nullable()
2582
+ }),
2583
+ description: "Visual separator line"
2584
+ },
2585
+ Tabs: {
2586
+ props: import_zod.z.object({
2587
+ tabs: import_zod.z.array(
2588
+ import_zod.z.object({
2589
+ label: import_zod.z.string(),
2590
+ value: import_zod.z.string()
2591
+ })
2592
+ ),
2593
+ defaultValue: import_zod.z.string().nullable(),
2594
+ value: import_zod.z.string().nullable()
2595
+ }),
2596
+ slots: ["default"],
2597
+ events: ["change"],
2598
+ description: "Tab navigation. Use { $bindState } on value for active tab binding."
2599
+ },
2600
+ Accordion: {
2601
+ props: import_zod.z.object({
2602
+ items: import_zod.z.array(
2603
+ import_zod.z.object({
2604
+ title: import_zod.z.string(),
2605
+ content: import_zod.z.string()
2606
+ })
2607
+ ),
2608
+ type: import_zod.z.enum(["single", "multiple"]).nullable()
2609
+ }),
2610
+ description: "Collapsible sections. Items as [{title, content}]. Type 'single' (default) or 'multiple'."
2611
+ },
2612
+ Collapsible: {
2613
+ props: import_zod.z.object({
2614
+ title: import_zod.z.string(),
2615
+ defaultOpen: import_zod.z.boolean().nullable()
2616
+ }),
2617
+ slots: ["default"],
2618
+ description: "Collapsible section with trigger. Children render inside."
2619
+ },
2620
+ Dialog: {
2621
+ props: import_zod.z.object({
2622
+ title: import_zod.z.string(),
2623
+ description: import_zod.z.string().nullable(),
2624
+ openPath: import_zod.z.string()
2625
+ }),
2626
+ slots: ["default"],
2627
+ description: "Modal dialog. Set openPath to a boolean state path. Use setState to toggle."
2628
+ },
2629
+ Drawer: {
2630
+ props: import_zod.z.object({
2631
+ title: import_zod.z.string(),
2632
+ description: import_zod.z.string().nullable(),
2633
+ openPath: import_zod.z.string()
2634
+ }),
2635
+ slots: ["default"],
2636
+ description: "Bottom sheet drawer. Set openPath to a boolean state path. Use setState to toggle."
2637
+ },
2638
+ Carousel: {
2639
+ props: import_zod.z.object({
2640
+ items: import_zod.z.array(
2641
+ import_zod.z.object({
2642
+ title: import_zod.z.string().nullable(),
2643
+ description: import_zod.z.string().nullable()
2644
+ })
2645
+ )
2646
+ }),
2647
+ description: "Horizontally scrollable carousel of cards."
2648
+ },
2649
+ // ==========================================================================
2650
+ // Data Display Components
2651
+ // ==========================================================================
2652
+ Table: {
2653
+ props: import_zod.z.object({
2654
+ columns: import_zod.z.array(import_zod.z.string()),
2655
+ rows: import_zod.z.array(import_zod.z.array(import_zod.z.string())),
2656
+ caption: import_zod.z.string().nullable()
2657
+ }),
2658
+ description: 'Data table. columns: header labels. rows: 2D array of cell strings, e.g. [["Alice","admin"],["Bob","user"]].',
2659
+ example: {
2660
+ columns: ["Name", "Role"],
2661
+ rows: [
2662
+ ["Alice", "Admin"],
2663
+ ["Bob", "User"]
2664
+ ]
2665
+ }
2666
+ },
2667
+ Heading: {
2668
+ props: import_zod.z.object({
2669
+ text: import_zod.z.string(),
2670
+ level: import_zod.z.enum(["h1", "h2", "h3", "h4"]).nullable()
2671
+ }),
2672
+ description: "Heading text (h1-h4)",
2673
+ example: { text: "Welcome", level: "h1" }
2674
+ },
2675
+ Text: {
2676
+ props: import_zod.z.object({
2677
+ text: import_zod.z.string(),
2678
+ variant: import_zod.z.enum(["body", "caption", "muted", "lead", "code"]).nullable()
2679
+ }),
2680
+ description: "Paragraph text",
2681
+ example: { text: "Hello, world!" }
2682
+ },
2683
+ Image: {
2684
+ props: import_zod.z.object({
2685
+ src: import_zod.z.string().nullable(),
2686
+ alt: import_zod.z.string(),
2687
+ width: import_zod.z.number().nullable(),
2688
+ height: import_zod.z.number().nullable()
2689
+ }),
2690
+ description: "Image component. Renders an img tag when src is provided, otherwise a placeholder."
2691
+ },
2692
+ Avatar: {
2693
+ props: import_zod.z.object({
2694
+ src: import_zod.z.string().nullable(),
2695
+ name: import_zod.z.string(),
2696
+ size: import_zod.z.enum(["sm", "md", "lg"]).nullable()
2697
+ }),
2698
+ description: "User avatar with fallback initials",
2699
+ example: { name: "Jane Doe", size: "md" }
2700
+ },
2701
+ Badge: {
2702
+ props: import_zod.z.object({
2703
+ text: import_zod.z.string(),
2704
+ variant: import_zod.z.enum(["default", "secondary", "destructive", "outline"]).nullable()
2705
+ }),
2706
+ description: "Status badge",
2707
+ example: { text: "Active", variant: "default" }
2708
+ },
2709
+ Alert: {
2710
+ props: import_zod.z.object({
2711
+ title: import_zod.z.string(),
2712
+ message: import_zod.z.string().nullable(),
2713
+ type: import_zod.z.enum(["info", "success", "warning", "error"]).nullable()
2714
+ }),
2715
+ description: "Alert banner",
2716
+ example: {
2717
+ title: "Note",
2718
+ message: "Your changes have been saved.",
2719
+ type: "success"
2720
+ }
2721
+ },
2722
+ Progress: {
2723
+ props: import_zod.z.object({
2724
+ value: import_zod.z.number(),
2725
+ max: import_zod.z.number().nullable(),
2726
+ label: import_zod.z.string().nullable()
2727
+ }),
2728
+ description: "Progress bar (value 0-100)",
2729
+ example: { value: 65, max: 100, label: "Upload progress" }
2730
+ },
2731
+ Skeleton: {
2732
+ props: import_zod.z.object({
2733
+ width: import_zod.z.string().nullable(),
2734
+ height: import_zod.z.string().nullable(),
2735
+ rounded: import_zod.z.boolean().nullable()
2736
+ }),
2737
+ description: "Loading placeholder skeleton"
2738
+ },
2739
+ Spinner: {
2740
+ props: import_zod.z.object({
2741
+ size: import_zod.z.enum(["sm", "md", "lg"]).nullable(),
2742
+ label: import_zod.z.string().nullable()
2743
+ }),
2744
+ description: "Loading spinner indicator"
2745
+ },
2746
+ Tooltip: {
2747
+ props: import_zod.z.object({
2748
+ content: import_zod.z.string(),
2749
+ text: import_zod.z.string()
2750
+ }),
2751
+ description: "Hover tooltip. Shows content on hover over text."
2752
+ },
2753
+ Popover: {
2754
+ props: import_zod.z.object({
2755
+ trigger: import_zod.z.string(),
2756
+ content: import_zod.z.string()
2757
+ }),
2758
+ description: "Popover that appears on click of trigger."
2759
+ },
2760
+ // ==========================================================================
2761
+ // Form Input Components
2762
+ // ==========================================================================
2763
+ Input: {
2764
+ props: import_zod.z.object({
2765
+ label: import_zod.z.string(),
2766
+ name: import_zod.z.string(),
2767
+ type: import_zod.z.enum(["text", "email", "password", "number"]).nullable(),
2768
+ placeholder: import_zod.z.string().nullable(),
2769
+ value: import_zod.z.string().nullable(),
2770
+ checks: import_zod.z.array(
2771
+ import_zod.z.object({
2772
+ type: import_zod.z.string(),
2773
+ message: import_zod.z.string(),
2774
+ args: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional()
2775
+ })
2776
+ ).nullable()
2777
+ }),
2778
+ events: ["submit", "focus", "blur"],
2779
+ description: "Text input field. Use { $bindState } on value for two-way binding. Use checks for validation (e.g. required, email, minLength).",
2780
+ example: {
2781
+ label: "Email",
2782
+ name: "email",
2783
+ type: "email",
2784
+ placeholder: "you@example.com"
2785
+ }
2786
+ },
2787
+ Textarea: {
2788
+ props: import_zod.z.object({
2789
+ label: import_zod.z.string(),
2790
+ name: import_zod.z.string(),
2791
+ placeholder: import_zod.z.string().nullable(),
2792
+ rows: import_zod.z.number().nullable(),
2793
+ value: import_zod.z.string().nullable(),
2794
+ checks: import_zod.z.array(
2795
+ import_zod.z.object({
2796
+ type: import_zod.z.string(),
2797
+ message: import_zod.z.string(),
2798
+ args: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional()
2799
+ })
2800
+ ).nullable()
2801
+ }),
2802
+ description: "Multi-line text input. Use { $bindState } on value for binding. Use checks for validation."
2803
+ },
2804
+ Select: {
2805
+ props: import_zod.z.object({
2806
+ label: import_zod.z.string(),
2807
+ name: import_zod.z.string(),
2808
+ options: import_zod.z.array(import_zod.z.string()),
2809
+ placeholder: import_zod.z.string().nullable(),
2810
+ value: import_zod.z.string().nullable(),
2811
+ checks: import_zod.z.array(
2812
+ import_zod.z.object({
2813
+ type: import_zod.z.string(),
2814
+ message: import_zod.z.string(),
2815
+ args: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional()
2816
+ })
2817
+ ).nullable()
2818
+ }),
2819
+ events: ["change"],
2820
+ description: "Dropdown select input. Use { $bindState } on value for binding. Use checks for validation."
2821
+ },
2822
+ Checkbox: {
2823
+ props: import_zod.z.object({
2824
+ label: import_zod.z.string(),
2825
+ name: import_zod.z.string(),
2826
+ checked: import_zod.z.boolean().nullable()
2827
+ }),
2828
+ events: ["change"],
2829
+ description: "Checkbox input. Use { $bindState } on checked for binding."
2830
+ },
2831
+ Radio: {
2832
+ props: import_zod.z.object({
2833
+ label: import_zod.z.string(),
2834
+ name: import_zod.z.string(),
2835
+ options: import_zod.z.array(import_zod.z.string()),
2836
+ value: import_zod.z.string().nullable()
2837
+ }),
2838
+ events: ["change"],
2839
+ description: "Radio button group. Use { $bindState } on value for binding."
2840
+ },
2841
+ Switch: {
2842
+ props: import_zod.z.object({
2843
+ label: import_zod.z.string(),
2844
+ name: import_zod.z.string(),
2845
+ checked: import_zod.z.boolean().nullable()
2846
+ }),
2847
+ events: ["change"],
2848
+ description: "Toggle switch. Use { $bindState } on checked for binding."
2849
+ },
2850
+ Slider: {
2851
+ props: import_zod.z.object({
2852
+ label: import_zod.z.string().nullable(),
2853
+ min: import_zod.z.number().nullable(),
2854
+ max: import_zod.z.number().nullable(),
2855
+ step: import_zod.z.number().nullable(),
2856
+ value: import_zod.z.number().nullable()
2857
+ }),
2858
+ events: ["change"],
2859
+ description: "Range slider input. Use { $bindState } on value for binding."
2860
+ },
2861
+ // ==========================================================================
2862
+ // Action Components
2863
+ // ==========================================================================
2864
+ Button: {
2865
+ props: import_zod.z.object({
2866
+ label: import_zod.z.string(),
2867
+ variant: import_zod.z.enum(["primary", "secondary", "danger"]).nullable(),
2868
+ disabled: import_zod.z.boolean().nullable()
2869
+ }),
2870
+ events: ["press"],
2871
+ description: "Clickable button. Bind on.press for handler.",
2872
+ example: { label: "Submit", variant: "primary" }
2873
+ },
2874
+ Link: {
2875
+ props: import_zod.z.object({
2876
+ label: import_zod.z.string(),
2877
+ href: import_zod.z.string()
2878
+ }),
2879
+ events: ["press"],
2880
+ description: "Anchor link. Bind on.press for click handler."
2881
+ },
2882
+ DropdownMenu: {
2883
+ props: import_zod.z.object({
2884
+ label: import_zod.z.string(),
2885
+ items: import_zod.z.array(
2886
+ import_zod.z.object({
2887
+ label: import_zod.z.string(),
2888
+ value: import_zod.z.string()
2889
+ })
2890
+ ),
2891
+ value: import_zod.z.string().nullable()
2892
+ }),
2893
+ events: ["select"],
2894
+ description: "Dropdown menu with trigger button and selectable items. Use { $bindState } on value for selected item binding."
2895
+ },
2896
+ Toggle: {
2897
+ props: import_zod.z.object({
2898
+ label: import_zod.z.string(),
2899
+ pressed: import_zod.z.boolean().nullable(),
2900
+ variant: import_zod.z.enum(["default", "outline"]).nullable()
2901
+ }),
2902
+ events: ["change"],
2903
+ description: "Toggle button. Use { $bindState } on pressed for state binding."
2904
+ },
2905
+ ToggleGroup: {
2906
+ props: import_zod.z.object({
2907
+ items: import_zod.z.array(
2908
+ import_zod.z.object({
2909
+ label: import_zod.z.string(),
2910
+ value: import_zod.z.string()
2911
+ })
2912
+ ),
2913
+ type: import_zod.z.enum(["single", "multiple"]).nullable(),
2914
+ value: import_zod.z.string().nullable()
2915
+ }),
2916
+ events: ["change"],
2917
+ description: "Group of toggle buttons. Type 'single' (default) or 'multiple'. Use { $bindState } on value."
2918
+ },
2919
+ ButtonGroup: {
2920
+ props: import_zod.z.object({
2921
+ buttons: import_zod.z.array(
2922
+ import_zod.z.object({
2923
+ label: import_zod.z.string(),
2924
+ value: import_zod.z.string()
2925
+ })
2926
+ ),
2927
+ selected: import_zod.z.string().nullable()
2928
+ }),
2929
+ events: ["change"],
2930
+ description: "Segmented button group. Use { $bindState } on selected for selected value."
2931
+ },
2932
+ Pagination: {
2933
+ props: import_zod.z.object({
2934
+ totalPages: import_zod.z.number(),
2935
+ page: import_zod.z.number().nullable()
2936
+ }),
2937
+ events: ["change"],
2938
+ description: "Page navigation. Use { $bindState } on page for current page number."
2939
+ }
2940
+ };
2941
+ // Annotate the CommonJS export names for ESM import in node:
2942
+ 0 && (module.exports = {
2943
+ shadcnComponentDefinitions,
2944
+ shadcnComponents
2945
+ });
2946
+ //# sourceMappingURL=index.js.map