@nextlyhq/ui 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.mjs ADDED
@@ -0,0 +1,2230 @@
1
+ import { Slot } from '@radix-ui/react-slot';
2
+ import { cva } from 'class-variance-authority';
3
+ import * as React5 from 'react';
4
+ import { forwardRef, createContext, useContext } from 'react';
5
+ import { clsx } from 'clsx';
6
+ import { twMerge } from 'tailwind-merge';
7
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
+ import { Root as Root$3 } from '@radix-ui/react-label';
9
+ import * as SeparatorPrimitive from '@radix-ui/react-separator';
10
+ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
11
+ import { Minus, Check, ChevronDown, X, ChevronRight, Circle, Search, Loader2, ChevronUp, XCircle, AlertTriangle, AlertCircle, CheckCircle2, FileQuestion, ChevronsLeft, ChevronLeft, ChevronsRight } from 'lucide-react';
12
+ import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
13
+ import { Root as Root$4, Thumb } from '@radix-ui/react-switch';
14
+ import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
15
+ import * as AccordionPrimitive from '@radix-ui/react-accordion';
16
+ import { Root, Image, Fallback } from '@radix-ui/react-avatar';
17
+ import { List, Trigger, Content, Root as Root$1 } from '@radix-ui/react-tabs';
18
+ import { Content as Content$1, Root as Root$2, Provider, Trigger as Trigger$1 } from '@radix-ui/react-tooltip';
19
+ import * as PopoverPrimitive from '@radix-ui/react-popover';
20
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
21
+ import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
22
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
23
+ import * as SelectPrimitive from '@radix-ui/react-select';
24
+ import { Command as Command$1 } from 'cmdk';
25
+ import { Toaster as Toaster$1 } from 'sonner';
26
+ export { toast } from 'sonner';
27
+
28
+ // src/components/button.tsx
29
+ function cn(...inputs) {
30
+ return twMerge(clsx(inputs));
31
+ }
32
+ var buttonVariants = cva(
33
+ "inline-flex items-center justify-center whitespace-nowrap rounded-none text-sm font-medium cursor-pointer transition-all duration-150 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed active:scale-[0.98] [&_svg]:text-current",
34
+ {
35
+ variants: {
36
+ variant: {
37
+ default: "bg-primary text-primary-foreground border border-transparent hover:opacity-90",
38
+ primary: "bg-primary text-primary-foreground border border-transparent hover:opacity-90",
39
+ destructive: "bg-destructive text-destructive-foreground border border-transparent hover:opacity-90",
40
+ outline: "border border-primary/10 text-foreground hover-unified bg-background",
41
+ secondary: "bg-background border border-primary/10 text-foreground hover:bg-primary/5",
42
+ ghost: "text-foreground border border-transparent hover-unified",
43
+ link: "text-primary border border-transparent underline-offset-4 hover:underline"
44
+ },
45
+ size: {
46
+ default: "h-10 px-6 py-2",
47
+ sm: "h-9 px-4 text-[13px]",
48
+ md: "h-10 px-6 text-sm",
49
+ lg: "h-11 px-8 text-base",
50
+ icon: "h-10 w-10 p-0",
51
+ "icon-sm": "h-9 w-9 p-0",
52
+ "icon-lg": "h-11 w-11 p-0"
53
+ }
54
+ },
55
+ defaultVariants: {
56
+ variant: "default",
57
+ size: "md"
58
+ }
59
+ }
60
+ );
61
+ var Button = forwardRef(
62
+ ({
63
+ className,
64
+ variant = "default",
65
+ size = "md",
66
+ asChild = false,
67
+ children,
68
+ ...props
69
+ }, ref) => {
70
+ const Comp = asChild ? Slot : "button";
71
+ const hasMultipleChildren = React5.Children.count(children) > 1;
72
+ return /* @__PURE__ */ jsx(
73
+ Comp,
74
+ {
75
+ "data-slot": `button.${variant}`,
76
+ className: cn(
77
+ buttonVariants({ variant, size, className }),
78
+ hasMultipleChildren && "gap-1.5"
79
+ ),
80
+ ref,
81
+ ...props,
82
+ children
83
+ }
84
+ );
85
+ }
86
+ );
87
+ Button.displayName = "Button";
88
+ var inputVariants = cva(
89
+ "file:text-foreground placeholder:text-muted-foreground placeholder:opacity-50 selection:bg-primary selection:text-primary-foreground w-full min-w-0 rounded-none border border-input bg-background text-sm transition-all duration-150 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 focus:ring-0 focus:ring-offset-0 focus:outline-none focus:!border-primary focus-visible:!border-primary aria-invalid:border-destructive aria-invalid:focus:!border-destructive data-[invalid=true]:border-destructive data-[invalid=true]:focus:!border-destructive",
90
+ {
91
+ variants: {
92
+ size: {
93
+ sm: "h-8 px-2.5 py-2 text-sm",
94
+ default: "h-10 px-3 py-2.5 text-sm",
95
+ lg: "h-11 px-4 py-3 text-base"
96
+ }
97
+ },
98
+ defaultVariants: {
99
+ size: "default"
100
+ }
101
+ }
102
+ );
103
+ var Input = forwardRef(
104
+ ({ className, type, size, ...props }, ref) => {
105
+ return /* @__PURE__ */ jsx(
106
+ "input",
107
+ {
108
+ type,
109
+ "data-slot": "input",
110
+ className: cn(inputVariants({ size, className })),
111
+ ref,
112
+ ...props
113
+ }
114
+ );
115
+ }
116
+ );
117
+ Input.displayName = "Input";
118
+ var Textarea = forwardRef(({ className, ...props }, ref) => {
119
+ return /* @__PURE__ */ jsx(
120
+ "textarea",
121
+ {
122
+ "data-slot": "textarea",
123
+ className: cn(
124
+ "flex min-h-[80px] w-full rounded-none border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground placeholder:opacity-50 transition-all duration-200 focus:!border-primary focus-visible:!border-primary focus:outline-none hover:border-primary/30 disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-primary/5 resize-y",
125
+ "aria-invalid:border-destructive aria-invalid:focus:!border-destructive",
126
+ className
127
+ ),
128
+ ref,
129
+ ...props
130
+ }
131
+ );
132
+ });
133
+ Textarea.displayName = "Textarea";
134
+ function Label({ className, ...props }) {
135
+ return /* @__PURE__ */ jsx(
136
+ Root$3,
137
+ {
138
+ "data-slot": "label",
139
+ className: cn(
140
+ "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",
141
+ className
142
+ ),
143
+ ...props
144
+ }
145
+ );
146
+ }
147
+ var badgeVariants = cva(
148
+ "inline-flex items-center rounded-none px-2.5 py-0.5 h-[22px] text-xs font-medium transition-colors",
149
+ {
150
+ variants: {
151
+ variant: {
152
+ default: "bg-primary/5 text-slate-900 dark:bg-slate-800 dark:text-slate-100",
153
+ primary: "bg-primary/5 text-primary dark:bg-primary/20 dark:text-primary-foreground/90",
154
+ success: "bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-100",
155
+ warning: "bg-amber-100 text-amber-700 dark:bg-amber-900 dark:text-amber-100",
156
+ destructive: "bg-red-100 text-red-700 dark:bg-red-900 dark:text-red-100",
157
+ outline: "border !border-primary/5 bg-transparent text-slate-700 dark:text-slate-300 dark:!border-primary/5"
158
+ }
159
+ },
160
+ defaultVariants: {
161
+ variant: "default"
162
+ }
163
+ }
164
+ );
165
+ function Badge({ className, variant = "default", ...props }) {
166
+ return /* @__PURE__ */ jsx(
167
+ "div",
168
+ {
169
+ "data-slot": `badge.${variant}`,
170
+ className: cn(badgeVariants({ variant }), className),
171
+ ...props
172
+ }
173
+ );
174
+ }
175
+ var cardVariants = cva(
176
+ "bg-card text-foreground rounded-none border border-primary/5 transition-all duration-200",
177
+ {
178
+ variants: {
179
+ variant: {
180
+ default: "",
181
+ interactive: "cursor-pointer hover:border-primary active:scale-[0.99]",
182
+ elevated: "shadow-md"
183
+ }
184
+ },
185
+ defaultVariants: {
186
+ variant: "default"
187
+ }
188
+ }
189
+ );
190
+ var Card = forwardRef(
191
+ ({ className, variant, ...props }, ref) => {
192
+ return /* @__PURE__ */ jsx(
193
+ "div",
194
+ {
195
+ ref,
196
+ "data-slot": `card.${variant || "default"}`,
197
+ className: cn(cardVariants({ variant }), className),
198
+ ...props
199
+ }
200
+ );
201
+ }
202
+ );
203
+ Card.displayName = "Card";
204
+ var CardHeader = forwardRef(
205
+ ({ className, noBorder = false, ...props }, ref) => {
206
+ return /* @__PURE__ */ jsx(
207
+ "div",
208
+ {
209
+ ref,
210
+ "data-slot": "card-header",
211
+ className: cn(
212
+ "flex flex-col p-4",
213
+ !noBorder && "border-b border-primary/5",
214
+ className
215
+ ),
216
+ ...props
217
+ }
218
+ );
219
+ }
220
+ );
221
+ CardHeader.displayName = "CardHeader";
222
+ var CardTitle = forwardRef(
223
+ ({ className, ...props }, ref) => {
224
+ return /* @__PURE__ */ jsx(
225
+ "h3",
226
+ {
227
+ ref,
228
+ "data-slot": "card-title",
229
+ className: cn("text-xl font-semibold leading-none", className),
230
+ ...props
231
+ }
232
+ );
233
+ }
234
+ );
235
+ CardTitle.displayName = "CardTitle";
236
+ var CardDescription = forwardRef(
237
+ ({ className, ...props }, ref) => {
238
+ return /* @__PURE__ */ jsx(
239
+ "p",
240
+ {
241
+ ref,
242
+ "data-slot": "card-description",
243
+ className: cn("text-sm text-muted-foreground", className),
244
+ ...props
245
+ }
246
+ );
247
+ }
248
+ );
249
+ CardDescription.displayName = "CardDescription";
250
+ var CardAction = forwardRef(
251
+ ({ className, ...props }, ref) => {
252
+ return /* @__PURE__ */ jsx(
253
+ "div",
254
+ {
255
+ ref,
256
+ "data-slot": "card-action",
257
+ className: cn("flex items-center justify-end", className),
258
+ ...props
259
+ }
260
+ );
261
+ }
262
+ );
263
+ CardAction.displayName = "CardAction";
264
+ var CardContent = forwardRef(
265
+ ({ className, ...props }, ref) => {
266
+ return /* @__PURE__ */ jsx(
267
+ "div",
268
+ {
269
+ ref,
270
+ "data-slot": "card-content",
271
+ className: cn("p-6", className),
272
+ ...props
273
+ }
274
+ );
275
+ }
276
+ );
277
+ CardContent.displayName = "CardContent";
278
+ var CardFooter = forwardRef(
279
+ ({ className, ...props }, ref) => {
280
+ return /* @__PURE__ */ jsx(
281
+ "div",
282
+ {
283
+ ref,
284
+ "data-slot": "card-footer",
285
+ className: cn(
286
+ "flex items-center px-6 py-4 border-t border-primary/5 bg-primary/5",
287
+ className
288
+ ),
289
+ ...props
290
+ }
291
+ );
292
+ }
293
+ );
294
+ CardFooter.displayName = "CardFooter";
295
+ var alertVariants = cva(
296
+ "relative flex items-start gap-3 rounded-none border border-primary/5 p-4 text-sm transition-colors duration-150",
297
+ {
298
+ variants: {
299
+ variant: {
300
+ info: "border-primary/5 bg-primary/5 text-primary dark:border-primary/30 dark:bg-primary/5 dark:text-primary-foreground/90",
301
+ success: "border-green-200 bg-green-50 text-green-900 dark:border-green-900 dark:bg-green-950 dark:text-green-100",
302
+ warning: "border-amber-200 bg-amber-50 text-amber-900 dark:border-amber-900 dark:bg-amber-950 dark:text-amber-100",
303
+ destructive: "border-red-200 bg-red-50 text-red-900 dark:border-red-900 dark:bg-red-950 dark:text-red-100"
304
+ }
305
+ },
306
+ defaultVariants: {
307
+ variant: "info"
308
+ }
309
+ }
310
+ );
311
+ var Alert = forwardRef(
312
+ ({ className, variant = "info", role = "alert", ...props }, ref) => {
313
+ return /* @__PURE__ */ jsx(
314
+ "div",
315
+ {
316
+ ref,
317
+ role,
318
+ "data-slot": `alert.${variant}`,
319
+ className: cn(alertVariants({ variant }), className),
320
+ ...props
321
+ }
322
+ );
323
+ }
324
+ );
325
+ Alert.displayName = "Alert";
326
+ var AlertTitle = forwardRef(
327
+ ({ className, ...props }, ref) => {
328
+ return /* @__PURE__ */ jsx(
329
+ "h5",
330
+ {
331
+ ref,
332
+ "data-slot": "alert-title",
333
+ className: cn(
334
+ "mb-1 text-sm font-semibold leading-tight tracking-tight",
335
+ className
336
+ ),
337
+ ...props
338
+ }
339
+ );
340
+ }
341
+ );
342
+ AlertTitle.displayName = "AlertTitle";
343
+ var AlertDescription = forwardRef(
344
+ ({ className, ...props }, ref) => {
345
+ return /* @__PURE__ */ jsx(
346
+ "div",
347
+ {
348
+ ref,
349
+ "data-slot": "alert-description",
350
+ className: cn("text-sm leading-relaxed", className),
351
+ ...props
352
+ }
353
+ );
354
+ }
355
+ );
356
+ AlertDescription.displayName = "AlertDescription";
357
+ function Separator({
358
+ className,
359
+ orientation = "horizontal",
360
+ decorative = true,
361
+ ...props
362
+ }) {
363
+ return /* @__PURE__ */ jsx(
364
+ SeparatorPrimitive.Root,
365
+ {
366
+ "data-slot": "separator",
367
+ decorative,
368
+ orientation,
369
+ className: cn(
370
+ "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
371
+ className
372
+ ),
373
+ ...props
374
+ }
375
+ );
376
+ }
377
+ var Skeleton = React5.forwardRef(
378
+ ({ className, ...props }, ref) => {
379
+ return /* @__PURE__ */ jsx(
380
+ "div",
381
+ {
382
+ ref,
383
+ "data-slot": "skeleton",
384
+ "aria-hidden": "true",
385
+ className: cn(
386
+ "bg-primary/5 animate-pulse rounded-none motion-reduce:animate-none",
387
+ className
388
+ ),
389
+ ...props
390
+ }
391
+ );
392
+ }
393
+ );
394
+ Skeleton.displayName = "Skeleton";
395
+ var progressVariants = cva("h-full rounded-none transition-all", {
396
+ variants: {
397
+ variant: {
398
+ default: "bg-primary-500",
399
+ success: "bg-green-500",
400
+ error: "bg-destructive"
401
+ }
402
+ },
403
+ defaultVariants: {
404
+ variant: "default"
405
+ }
406
+ });
407
+ var Progress = React5.forwardRef(
408
+ ({
409
+ value,
410
+ max = 100,
411
+ variant = "default",
412
+ className,
413
+ "aria-label": ariaLabel,
414
+ ...props
415
+ }, ref) => {
416
+ const clampedValue = Math.min(Math.max(0, value), max);
417
+ const percentage = clampedValue / max * 100;
418
+ return /* @__PURE__ */ jsx(
419
+ "div",
420
+ {
421
+ ref,
422
+ role: "progressbar",
423
+ "aria-valuenow": clampedValue,
424
+ "aria-valuemin": 0,
425
+ "aria-valuemax": max,
426
+ "aria-label": ariaLabel || `Progress: ${Math.round(percentage)}%`,
427
+ className: cn(
428
+ "relative h-2 w-full overflow-hidden rounded-none bg-accent",
429
+ className
430
+ ),
431
+ ...props,
432
+ children: /* @__PURE__ */ jsx(
433
+ "div",
434
+ {
435
+ className: cn(progressVariants({ variant })),
436
+ style: {
437
+ width: `${percentage}%`,
438
+ transition: "width 300ms linear"
439
+ }
440
+ }
441
+ )
442
+ }
443
+ );
444
+ }
445
+ );
446
+ Progress.displayName = "Progress";
447
+ var Checkbox = forwardRef(({ className, indeterminate, ...props }, ref) => /* @__PURE__ */ jsx(
448
+ CheckboxPrimitive.Root,
449
+ {
450
+ ref,
451
+ "data-slot": "checkbox",
452
+ className: cn(
453
+ "peer h-4 w-4 shrink-0 rounded-none border border-primary/5 ring-offset-background focus:!border-primary focus-visible:!border-primary focus:outline-none focus-visible:outline-none aria-invalid:border-destructive aria-invalid:focus:!border-destructive aria-invalid:focus-visible:!border-destructive disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary transition-all duration-200",
454
+ className
455
+ ),
456
+ ...props,
457
+ children: /* @__PURE__ */ jsx(
458
+ CheckboxPrimitive.Indicator,
459
+ {
460
+ className: cn("flex items-center justify-center text-current"),
461
+ children: indeterminate ? /* @__PURE__ */ jsx(Minus, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx(Check, { className: "h-3 w-3" })
462
+ }
463
+ )
464
+ }
465
+ ));
466
+ Checkbox.displayName = "Checkbox";
467
+ var RadioGroup = forwardRef(({ className, ...props }, ref) => {
468
+ return /* @__PURE__ */ jsx(
469
+ RadioGroupPrimitive.Root,
470
+ {
471
+ className: cn("grid gap-2", className),
472
+ ...props,
473
+ ref,
474
+ "data-slot": "radio-group"
475
+ }
476
+ );
477
+ });
478
+ RadioGroup.displayName = "RadioGroup";
479
+ var RadioGroupItem = forwardRef(({ className, ...props }, ref) => {
480
+ return /* @__PURE__ */ jsx(
481
+ RadioGroupPrimitive.Item,
482
+ {
483
+ ref,
484
+ "data-slot": "radio-group-item",
485
+ className: cn(
486
+ "peer h-4 w-4 shrink-0 rounded-none border border-primary/5 bg-background cursor-pointer transition-all duration-150 focus:!border-primary focus-visible:!border-primary focus:outline-none focus-visible:outline-none aria-invalid:border-destructive aria-invalid:focus:!border-destructive aria-invalid:focus-visible:!border-destructive disabled:cursor-not-allowed disabled:opacity-50 hover:border-primary/30 data-[state=checked]:border-primary data-[state=checked]:border-[5px]",
487
+ className
488
+ ),
489
+ ...props,
490
+ children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, {})
491
+ }
492
+ );
493
+ });
494
+ RadioGroupItem.displayName = "RadioGroupItem";
495
+ function Switch({ className, ...props }) {
496
+ return /* @__PURE__ */ jsx(
497
+ Root$4,
498
+ {
499
+ "data-slot": "switch",
500
+ className: cn(
501
+ "peer inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-none border border-primary/5 transition-all outline-none focus-visible:border-primary aria-invalid:border-destructive aria-invalid:focus-visible:!border-destructive disabled:cursor-not-allowed disabled:opacity-50",
502
+ "data-[state=checked]:bg-primary data-[state=checked]:!border-primary",
503
+ "data-[state=unchecked]:bg-input data-[state=unchecked]:border-primary/5 dark:data-[state=unchecked]:bg-input/80",
504
+ className
505
+ ),
506
+ ...props,
507
+ children: /* @__PURE__ */ jsx(
508
+ Thumb,
509
+ {
510
+ "data-slot": "switch-thumb",
511
+ className: cn(
512
+ "bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-none ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"
513
+ )
514
+ }
515
+ )
516
+ }
517
+ );
518
+ }
519
+ var Collapsible = CollapsiblePrimitive.Root;
520
+ var CollapsibleTrigger2 = CollapsiblePrimitive.CollapsibleTrigger;
521
+ var CollapsibleContent2 = CollapsiblePrimitive.CollapsibleContent;
522
+ var Accordion = AccordionPrimitive.Root;
523
+ var AccordionItem = forwardRef(
524
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
525
+ AccordionPrimitive.Item,
526
+ {
527
+ ref,
528
+ "data-slot": "accordion-item",
529
+ className: cn("border-b", className),
530
+ ...props
531
+ }
532
+ )
533
+ );
534
+ AccordionItem.displayName = "AccordionItem";
535
+ var AccordionTrigger = forwardRef(
536
+ ({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "flex", "data-slot": "accordion-header", children: /* @__PURE__ */ jsxs(
537
+ AccordionPrimitive.Trigger,
538
+ {
539
+ ref,
540
+ "data-slot": "accordion-trigger",
541
+ className: cn(
542
+ "flex flex-1 items-center justify-between py-4 font-medium transition-all duration-150 hover:underline [&[data-state=open]>svg]:rotate-180",
543
+ className
544
+ ),
545
+ ...props,
546
+ children: [
547
+ children,
548
+ /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 shrink-0 transition-transform duration-150" })
549
+ ]
550
+ }
551
+ ) })
552
+ );
553
+ AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
554
+ var AccordionContent = forwardRef(
555
+ ({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
556
+ AccordionPrimitive.Content,
557
+ {
558
+ ref,
559
+ "data-slot": "accordion-content",
560
+ className: "overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
561
+ ...props,
562
+ children: /* @__PURE__ */ jsx("div", { className: cn("pb-4 pt-0", className), children })
563
+ }
564
+ )
565
+ );
566
+ AccordionContent.displayName = AccordionPrimitive.Content.displayName;
567
+ var avatarVariants = cva(
568
+ "relative inline-flex shrink-0 overflow-hidden rounded-none items-center justify-center bg-primary/5 text-muted-foreground",
569
+ {
570
+ variants: {
571
+ size: {
572
+ sm: "h-8 w-8",
573
+ md: "h-10 w-10",
574
+ lg: "h-12 w-12",
575
+ xl: "h-16 w-16",
576
+ "2xl": "h-20 w-20"
577
+ }
578
+ },
579
+ defaultVariants: {
580
+ size: "md"
581
+ }
582
+ }
583
+ );
584
+ var fallbackTextSizeMap = {
585
+ sm: "text-xs",
586
+ // 12px for 32px avatar
587
+ md: "text-sm",
588
+ // 14px for 40px avatar
589
+ lg: "text-base",
590
+ // 16px for 48px avatar
591
+ xl: "text-lg",
592
+ // 18px for 64px avatar
593
+ "2xl": "text-2xl"
594
+ // 24px for 80px avatar
595
+ };
596
+ var AvatarSizeContext = createContext("md");
597
+ var Avatar = forwardRef(
598
+ ({ className, size = "md", ...props }, ref) => {
599
+ return /* @__PURE__ */ jsx(AvatarSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsx(
600
+ Root,
601
+ {
602
+ ref,
603
+ "data-slot": "avatar",
604
+ className: cn(avatarVariants({ size }), className),
605
+ ...props
606
+ }
607
+ ) });
608
+ }
609
+ );
610
+ Avatar.displayName = "Avatar";
611
+ var AvatarImage = forwardRef(
612
+ ({ className, ...props }, ref) => {
613
+ return /* @__PURE__ */ jsx(
614
+ Image,
615
+ {
616
+ ref,
617
+ "data-slot": "avatar-image",
618
+ className: cn("aspect-square size-full", className),
619
+ ...props
620
+ }
621
+ );
622
+ }
623
+ );
624
+ AvatarImage.displayName = "AvatarImage";
625
+ var AvatarFallback = forwardRef(
626
+ ({ className, children, ...props }, ref) => {
627
+ const size = useContext(AvatarSizeContext) || "md";
628
+ const textSize = fallbackTextSizeMap[size];
629
+ return /* @__PURE__ */ jsx(
630
+ Fallback,
631
+ {
632
+ ref,
633
+ "data-slot": "avatar-fallback",
634
+ className: cn(
635
+ "bg-primary/5 text-muted-foreground flex size-full items-center justify-center rounded-none font-medium",
636
+ textSize,
637
+ className
638
+ ),
639
+ ...props,
640
+ children
641
+ }
642
+ );
643
+ }
644
+ );
645
+ AvatarFallback.displayName = "AvatarFallback";
646
+ var Tabs = Root$1;
647
+ var TabsList = forwardRef(
648
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
649
+ List,
650
+ {
651
+ ref,
652
+ "data-slot": "tabs-list",
653
+ className: cn(
654
+ "inline-flex h-10 items-center justify-center gap-1 rounded-none p-0 text-muted-foreground",
655
+ className
656
+ ),
657
+ ...props
658
+ }
659
+ )
660
+ );
661
+ TabsList.displayName = List.displayName;
662
+ var TabsTrigger = forwardRef(
663
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
664
+ Trigger,
665
+ {
666
+ ref,
667
+ "data-slot": "tabs-trigger",
668
+ className: cn(
669
+ "inline-flex items-center justify-center whitespace-nowrap rounded-none bg-transparent px-4 py-2 text-sm font-medium cursor-pointer transition-all duration-200 border-b-2 relative -mb-0.5 data-[state=active]:!border-b-primary data-[state=active]:text-primary data-[state=inactive]:border-transparent data-[state=inactive]:text-muted-foreground hover:text-primary hover:border-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed",
670
+ className
671
+ ),
672
+ ...props
673
+ }
674
+ )
675
+ );
676
+ TabsTrigger.displayName = Trigger.displayName;
677
+ var TabsContent = forwardRef(
678
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
679
+ Content,
680
+ {
681
+ ref,
682
+ "data-slot": "tabs-content",
683
+ className: cn(
684
+ "mt-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20 focus-visible:ring-offset-2",
685
+ className
686
+ ),
687
+ ...props
688
+ }
689
+ )
690
+ );
691
+ TabsContent.displayName = Content.displayName;
692
+ var TooltipProvider = Provider;
693
+ var Tooltip = Root$2;
694
+ var TooltipTrigger = Trigger$1;
695
+ var TooltipContent = forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(
696
+ Content$1,
697
+ {
698
+ ref,
699
+ sideOffset,
700
+ "data-slot": "tooltip-content",
701
+ className: cn(
702
+ "z-50 overflow-hidden rounded-none px-3 py-1.5 text-xs shadow-lg border border-primary/5 bg-popover text-popover-foreground 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",
703
+ className
704
+ ),
705
+ ...props
706
+ }
707
+ ));
708
+ TooltipContent.displayName = Content$1.displayName;
709
+ var PortalContext = createContext({ container: null });
710
+ function PortalProvider({ container, children }) {
711
+ return /* @__PURE__ */ jsx(PortalContext.Provider, { value: { container }, children });
712
+ }
713
+ function usePortalContainer() {
714
+ const { container } = useContext(PortalContext);
715
+ return container ?? void 0;
716
+ }
717
+ var Popover = PopoverPrimitive.Root;
718
+ var PopoverTrigger = PopoverPrimitive.Trigger;
719
+ var PopoverAnchor = PopoverPrimitive.Anchor;
720
+ var PopoverContent = React5.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => {
721
+ const portalContainer = usePortalContainer();
722
+ return /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
723
+ PopoverPrimitive.Content,
724
+ {
725
+ ref,
726
+ align,
727
+ sideOffset,
728
+ "data-slot": "popover-content",
729
+ className: cn(
730
+ "z-[100] w-72 rounded-none border border-primary/5 bg-popover p-4 text-popover-foreground shadow-md outline-none 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 origin-[--radix-popover-content-transform-origin]",
731
+ className
732
+ ),
733
+ ...props
734
+ }
735
+ ) });
736
+ });
737
+ PopoverContent.displayName = PopoverPrimitive.Content.displayName;
738
+ var Dialog = DialogPrimitive.Root;
739
+ var DialogTrigger = DialogPrimitive.Trigger;
740
+ var DialogPortal = DialogPrimitive.Portal;
741
+ var DialogClose = DialogPrimitive.Close;
742
+ var DialogOverlay = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
743
+ DialogPrimitive.Overlay,
744
+ {
745
+ ref,
746
+ "data-slot": "dialog-overlay",
747
+ className: cn(
748
+ "fixed inset-0 z-50 bg-black/80 backdrop-blur-sm transition-opacity duration-150 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
749
+ className
750
+ ),
751
+ ...props
752
+ }
753
+ ));
754
+ DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
755
+ var dialogContentVariants = cva("", {
756
+ variants: {
757
+ size: {
758
+ sm: "max-w-sm",
759
+ md: "max-w-lg",
760
+ lg: "max-w-2xl",
761
+ xl: "max-w-4xl",
762
+ full: "max-w-[calc(100vw-2rem)] sm:max-w-[calc(100vw-4rem)]"
763
+ }
764
+ },
765
+ defaultVariants: {
766
+ size: "md"
767
+ }
768
+ });
769
+ var DialogContent = forwardRef(({ className, children, size, ...props }, ref) => {
770
+ const portalContainer = usePortalContainer();
771
+ return /* @__PURE__ */ jsxs(DialogPortal, { container: portalContainer, children: [
772
+ /* @__PURE__ */ jsx(DialogOverlay, {}),
773
+ /* @__PURE__ */ jsxs(
774
+ DialogPrimitive.Content,
775
+ {
776
+ ref,
777
+ "data-slot": "dialog-content",
778
+ className: cn(
779
+ "fixed left-[50%] top-[50%] z-[51] grid w-full translate-x-[-50%] translate-y-[-50%] gap-4 border border-primary/5 bg-background p-6 shadow-xl rounded-none duration-150 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",
780
+ dialogContentVariants({ size }),
781
+ className
782
+ ),
783
+ ...props,
784
+ children: [
785
+ children,
786
+ /* @__PURE__ */ jsxs(
787
+ DialogPrimitive.Close,
788
+ {
789
+ "data-slot": "dialog-close",
790
+ className: "absolute right-4 top-4 rounded-none p-1 text-muted-foreground cursor-pointer transition-colors duration-150 hover-unified focus:outline-none focus:ring-2 focus:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed",
791
+ children: [
792
+ /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
793
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
794
+ ]
795
+ }
796
+ )
797
+ ]
798
+ }
799
+ )
800
+ ] });
801
+ });
802
+ DialogContent.displayName = DialogPrimitive.Content.displayName;
803
+ var DialogHeader = forwardRef(
804
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
805
+ "div",
806
+ {
807
+ ref,
808
+ className: cn(
809
+ "flex flex-col space-y-1.5 text-center sm:text-left",
810
+ className
811
+ ),
812
+ ...props
813
+ }
814
+ )
815
+ );
816
+ DialogHeader.displayName = "DialogHeader";
817
+ var DialogFooter = forwardRef(
818
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
819
+ "div",
820
+ {
821
+ ref,
822
+ className: cn(
823
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
824
+ className
825
+ ),
826
+ ...props
827
+ }
828
+ )
829
+ );
830
+ DialogFooter.displayName = "DialogFooter";
831
+ var DialogTitle = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
832
+ DialogPrimitive.Title,
833
+ {
834
+ ref,
835
+ className: cn(
836
+ "text-lg font-semibold leading-none tracking-tight text-foreground",
837
+ className
838
+ ),
839
+ ...props
840
+ }
841
+ ));
842
+ DialogTitle.displayName = DialogPrimitive.Title.displayName;
843
+ var DialogDescription = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
844
+ DialogPrimitive.Description,
845
+ {
846
+ ref,
847
+ className: cn("text-sm text-muted-foreground", className),
848
+ ...props
849
+ }
850
+ ));
851
+ DialogDescription.displayName = DialogPrimitive.Description.displayName;
852
+ var AlertDialog = AlertDialogPrimitive.Root;
853
+ var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
854
+ var AlertDialogPortal = AlertDialogPrimitive.Portal;
855
+ var AlertDialogOverlay = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
856
+ AlertDialogPrimitive.Overlay,
857
+ {
858
+ ref,
859
+ className: cn(
860
+ "fixed inset-0 z-50 bg-black/80 backdrop-blur-sm transition-opacity duration-150 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
861
+ className
862
+ ),
863
+ ...props
864
+ }
865
+ ));
866
+ AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
867
+ var AlertDialogContent = forwardRef(({ className, ...props }, ref) => {
868
+ const portalContainer = usePortalContainer();
869
+ return /* @__PURE__ */ jsxs(AlertDialogPortal, { container: portalContainer, children: [
870
+ /* @__PURE__ */ jsx(AlertDialogOverlay, {}),
871
+ /* @__PURE__ */ jsx(
872
+ AlertDialogPrimitive.Content,
873
+ {
874
+ ref,
875
+ className: cn(
876
+ "fixed left-[50%] top-[50%] z-[51] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-primary/5 bg-background p-6 shadow-xl rounded-none duration-150 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",
877
+ className
878
+ ),
879
+ ...props
880
+ }
881
+ )
882
+ ] });
883
+ });
884
+ AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
885
+ var AlertDialogHeader = forwardRef(
886
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
887
+ "div",
888
+ {
889
+ ref,
890
+ className: cn(
891
+ "flex flex-col space-y-2 text-center sm:text-left",
892
+ className
893
+ ),
894
+ ...props
895
+ }
896
+ )
897
+ );
898
+ AlertDialogHeader.displayName = "AlertDialogHeader";
899
+ var AlertDialogFooter = forwardRef(
900
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
901
+ "div",
902
+ {
903
+ ref,
904
+ className: cn(
905
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
906
+ className
907
+ ),
908
+ ...props
909
+ }
910
+ )
911
+ );
912
+ AlertDialogFooter.displayName = "AlertDialogFooter";
913
+ var AlertDialogTitle = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
914
+ AlertDialogPrimitive.Title,
915
+ {
916
+ ref,
917
+ className: cn(
918
+ "text-lg font-semibold leading-none tracking-tight text-foreground",
919
+ className
920
+ ),
921
+ ...props
922
+ }
923
+ ));
924
+ AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
925
+ var AlertDialogDescription = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
926
+ AlertDialogPrimitive.Description,
927
+ {
928
+ ref,
929
+ className: cn("text-sm text-muted-foreground", className),
930
+ ...props
931
+ }
932
+ ));
933
+ AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
934
+ var AlertDialogAction = forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
935
+ AlertDialogPrimitive.Action,
936
+ {
937
+ ref,
938
+ className: cn(buttonVariants({ variant: "destructive" }), className),
939
+ ...props,
940
+ children
941
+ }
942
+ ));
943
+ AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
944
+ var AlertDialogCancel = forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
945
+ AlertDialogPrimitive.Cancel,
946
+ {
947
+ ref,
948
+ className: cn(
949
+ buttonVariants({ variant: "outline" }),
950
+ "mt-2 sm:mt-0",
951
+ className
952
+ ),
953
+ ...props,
954
+ children
955
+ }
956
+ ));
957
+ AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
958
+ var DropdownMenu = DropdownMenuPrimitive.Root;
959
+ var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
960
+ var DropdownMenuGroup = DropdownMenuPrimitive.Group;
961
+ var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
962
+ var DropdownMenuSub = DropdownMenuPrimitive.Sub;
963
+ var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
964
+ var DropdownMenuSubTrigger = React5.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
965
+ DropdownMenuPrimitive.SubTrigger,
966
+ {
967
+ ref,
968
+ className: cn(
969
+ "flex cursor-default select-none items-center gap-2 rounded-none px-2 py-1.5 text-sm outline-none hover-unified focus:bg-primary/5 focus:text-primary data-[state=open]:bg-primary/5 data-[state=open]:text-primary [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
970
+ inset && "pl-8",
971
+ className
972
+ ),
973
+ ...props,
974
+ children: [
975
+ children,
976
+ /* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto" })
977
+ ]
978
+ }
979
+ ));
980
+ DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
981
+ var DropdownMenuSubContent = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
982
+ DropdownMenuPrimitive.SubContent,
983
+ {
984
+ ref,
985
+ className: cn(
986
+ "z-50 min-w-[8rem] overflow-hidden rounded-none border border-primary/5 bg-popover p-1 text-popover-foreground shadow-lg 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 origin-[--radix-dropdown-menu-content-transform-origin]",
987
+ className
988
+ ),
989
+ ...props
990
+ }
991
+ ));
992
+ DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
993
+ var DropdownMenuContent = React5.forwardRef(({ className, sideOffset = 4, ...props }, ref) => {
994
+ const portalContainer = usePortalContainer();
995
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
996
+ DropdownMenuPrimitive.Content,
997
+ {
998
+ ref,
999
+ sideOffset,
1000
+ className: cn(
1001
+ "z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-none border border-primary/5 bg-popover p-1 text-popover-foreground shadow-md 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 origin-[--radix-dropdown-menu-content-transform-origin]",
1002
+ className
1003
+ ),
1004
+ ...props
1005
+ }
1006
+ ) });
1007
+ });
1008
+ DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
1009
+ var DropdownMenuItem = React5.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
1010
+ DropdownMenuPrimitive.Item,
1011
+ {
1012
+ ref,
1013
+ className: cn(
1014
+ "relative flex cursor-pointer select-none items-center gap-2 rounded-none px-2 py-1.5 text-sm outline-none transition-colors hover-unified focus:bg-primary/5 focus:text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
1015
+ inset && "pl-8",
1016
+ className
1017
+ ),
1018
+ ...props
1019
+ }
1020
+ ));
1021
+ DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
1022
+ var DropdownMenuCheckboxItem = React5.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
1023
+ DropdownMenuPrimitive.CheckboxItem,
1024
+ {
1025
+ ref,
1026
+ className: cn(
1027
+ "relative flex cursor-default select-none items-center rounded-none py-1.5 pl-8 pr-2 text-sm outline-none transition-colors hover-primary-light focus:bg-primary/5 focus:text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1028
+ className
1029
+ ),
1030
+ checked,
1031
+ ...props,
1032
+ children: [
1033
+ /* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }) }),
1034
+ children
1035
+ ]
1036
+ }
1037
+ ));
1038
+ DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
1039
+ var DropdownMenuRadioItem = React5.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
1040
+ DropdownMenuPrimitive.RadioItem,
1041
+ {
1042
+ ref,
1043
+ className: cn(
1044
+ "relative flex cursor-default select-none items-center rounded-none py-1.5 pl-8 pr-2 text-sm outline-none transition-colors hover-primary-light focus:bg-primary/5 focus:text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1045
+ className
1046
+ ),
1047
+ ...props,
1048
+ children: [
1049
+ /* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Circle, { className: "h-2 w-2 fill-current" }) }) }),
1050
+ children
1051
+ ]
1052
+ }
1053
+ ));
1054
+ DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
1055
+ var DropdownMenuLabel = React5.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
1056
+ DropdownMenuPrimitive.Label,
1057
+ {
1058
+ ref,
1059
+ className: cn(
1060
+ "px-2 py-1.5 text-sm font-semibold",
1061
+ inset && "pl-8",
1062
+ className
1063
+ ),
1064
+ ...props
1065
+ }
1066
+ ));
1067
+ DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
1068
+ var DropdownMenuSeparator = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1069
+ DropdownMenuPrimitive.Separator,
1070
+ {
1071
+ ref,
1072
+ className: cn("-mx-1 my-1 h-px bg-primary/5", className),
1073
+ ...props
1074
+ }
1075
+ ));
1076
+ DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
1077
+ var DropdownMenuShortcut = React5.forwardRef(({ className, ...props }, ref) => {
1078
+ return /* @__PURE__ */ jsx(
1079
+ "span",
1080
+ {
1081
+ ref,
1082
+ className: cn("ml-auto text-xs tracking-widest opacity-60", className),
1083
+ ...props
1084
+ }
1085
+ );
1086
+ });
1087
+ DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
1088
+ function Select({ ...props }) {
1089
+ return /* @__PURE__ */ jsx(SelectPrimitive.Root, { "data-slot": "select", ...props });
1090
+ }
1091
+ function SelectGroup({
1092
+ ...props
1093
+ }) {
1094
+ return /* @__PURE__ */ jsx(SelectPrimitive.Group, { "data-slot": "select-group", ...props });
1095
+ }
1096
+ function SelectValue({
1097
+ ...props
1098
+ }) {
1099
+ return /* @__PURE__ */ jsx(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
1100
+ }
1101
+ var selectTriggerVariants = cva(
1102
+ "flex w-full items-center justify-between gap-2 rounded-none border border-input bg-background px-3 text-sm text-foreground cursor-pointer transition-all duration-150 focus:!border-primary focus-visible:!border-primary focus:outline-none hover:border-primary/30 disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-primary/5 data-[placeholder]:text-muted-foreground aria-[invalid=true]:border-destructive aria-[invalid=true]:focus:!border-destructive [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4",
1103
+ {
1104
+ variants: {
1105
+ size: {
1106
+ sm: "h-8 text-sm",
1107
+ default: "h-10 text-sm",
1108
+ lg: "h-11 text-base"
1109
+ }
1110
+ },
1111
+ defaultVariants: {
1112
+ size: "default"
1113
+ }
1114
+ }
1115
+ );
1116
+ var SelectTrigger = forwardRef(({ className, size, children, ...props }, ref) => {
1117
+ return /* @__PURE__ */ jsxs(
1118
+ SelectPrimitive.Trigger,
1119
+ {
1120
+ ref,
1121
+ "data-slot": "select-trigger",
1122
+ className: cn(selectTriggerVariants({ size, className })),
1123
+ ...props,
1124
+ children: [
1125
+ children,
1126
+ /* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(ChevronDown, { className: "size-4 opacity-50" }) })
1127
+ ]
1128
+ }
1129
+ );
1130
+ });
1131
+ SelectTrigger.displayName = "SelectTrigger";
1132
+ function SelectContent({
1133
+ className,
1134
+ children,
1135
+ position = "popper",
1136
+ ...props
1137
+ }) {
1138
+ const portalContainer = usePortalContainer();
1139
+ return /* @__PURE__ */ jsx(SelectPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxs(
1140
+ SelectPrimitive.Content,
1141
+ {
1142
+ "data-slot": "select-content",
1143
+ className: cn(
1144
+ "bg-popover text-popover-foreground border border-primary/5 shadow-none rounded-none z-9999 max-h-(--radix-select-content-available-height) min-w-32 overflow-hidden data-[state=open]:animate-zoom-in-95 data-[state=closed]:animate-zoom-out-95 data-[side=bottom]:animate-slide-in-from-top-2 data-[side=left]:animate-slide-in-from-right-2 data-[side=right]:animate-slide-in-from-left-2 data-[side=top]:animate-slide-in-from-bottom-2",
1145
+ 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",
1146
+ className
1147
+ ),
1148
+ position,
1149
+ ...props,
1150
+ children: [
1151
+ /* @__PURE__ */ jsx(SelectScrollUpButton, {}),
1152
+ /* @__PURE__ */ jsx(
1153
+ SelectPrimitive.Viewport,
1154
+ {
1155
+ className: cn(
1156
+ "p-1",
1157
+ position === "popper" && "h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width) scroll-my-1"
1158
+ ),
1159
+ children
1160
+ }
1161
+ ),
1162
+ /* @__PURE__ */ jsx(SelectScrollDownButton, {})
1163
+ ]
1164
+ }
1165
+ ) });
1166
+ }
1167
+ function SelectLabel({
1168
+ className,
1169
+ ...props
1170
+ }) {
1171
+ return /* @__PURE__ */ jsx(
1172
+ SelectPrimitive.Label,
1173
+ {
1174
+ "data-slot": "select-label",
1175
+ className: cn("text-muted-foreground px-2 py-1.5 text-xs", className),
1176
+ ...props
1177
+ }
1178
+ );
1179
+ }
1180
+ function SelectItem({
1181
+ className,
1182
+ children,
1183
+ ...props
1184
+ }) {
1185
+ return /* @__PURE__ */ jsxs(
1186
+ SelectPrimitive.Item,
1187
+ {
1188
+ "data-slot": "select-item",
1189
+ className: cn(
1190
+ "relative flex w-full cursor-pointer items-center gap-2 rounded-none py-2 pr-8 pl-2 text-sm text-foreground outline-none select-none transition-colors hover-unified focus:bg-primary/5 focus:text-primary data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4",
1191
+ className
1192
+ ),
1193
+ ...props,
1194
+ children: [
1195
+ /* @__PURE__ */ jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "size-4" }) }) }),
1196
+ /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
1197
+ ]
1198
+ }
1199
+ );
1200
+ }
1201
+ function SelectSeparator({
1202
+ className,
1203
+ ...props
1204
+ }) {
1205
+ return /* @__PURE__ */ jsx(
1206
+ SelectPrimitive.Separator,
1207
+ {
1208
+ "data-slot": "select-separator",
1209
+ className: cn("bg-border pointer-events-none -mx-1 my-1 h-px", className),
1210
+ ...props
1211
+ }
1212
+ );
1213
+ }
1214
+ function SelectScrollUpButton({
1215
+ className,
1216
+ ...props
1217
+ }) {
1218
+ return /* @__PURE__ */ jsx(
1219
+ SelectPrimitive.ScrollUpButton,
1220
+ {
1221
+ "data-slot": "select-scroll-up-button",
1222
+ className: cn(
1223
+ "flex cursor-default items-center justify-center py-1",
1224
+ className
1225
+ ),
1226
+ ...props,
1227
+ children: /* @__PURE__ */ jsx(ChevronUp, { className: "size-4" })
1228
+ }
1229
+ );
1230
+ }
1231
+ function SelectScrollDownButton({
1232
+ className,
1233
+ ...props
1234
+ }) {
1235
+ return /* @__PURE__ */ jsx(
1236
+ SelectPrimitive.ScrollDownButton,
1237
+ {
1238
+ "data-slot": "select-scroll-down-button",
1239
+ className: cn(
1240
+ "flex cursor-default items-center justify-center py-1",
1241
+ className
1242
+ ),
1243
+ ...props,
1244
+ children: /* @__PURE__ */ jsx(ChevronDown, { className: "size-4" })
1245
+ }
1246
+ );
1247
+ }
1248
+ var Sheet = DialogPrimitive.Root;
1249
+ var SheetTrigger = DialogPrimitive.Trigger;
1250
+ var SheetClose = DialogPrimitive.Close;
1251
+ var SheetPortal = DialogPrimitive.Portal;
1252
+ var SheetOverlay = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1253
+ DialogPrimitive.Overlay,
1254
+ {
1255
+ className: cn(
1256
+ "fixed inset-0 z-50 bg-black/50 backdrop-blur-sm",
1257
+ "data-[state=open]:animate-in data-[state=closed]:animate-out",
1258
+ "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
1259
+ className
1260
+ ),
1261
+ ...props,
1262
+ ref
1263
+ }
1264
+ ));
1265
+ SheetOverlay.displayName = DialogPrimitive.Overlay.displayName;
1266
+ var sheetVariants = cva(
1267
+ "fixed z-50 gap-4 bg-background p-6 shadow-lg will-change-transform transition ease-in-out data-[state=closed]:duration-150 data-[state=open]:duration-150 data-[state=open]:animate-in data-[state=closed]:animate-out",
1268
+ {
1269
+ variants: {
1270
+ side: {
1271
+ top: "inset-x-0 top-0 border-b border-primary/5 data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
1272
+ bottom: "inset-x-0 bottom-0 border-t border-primary/5 data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
1273
+ left: "inset-y-0 left-0 h-full w-3/4 border-r border-primary/5 data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
1274
+ right: "inset-y-0 right-0 h-full w-3/4 border-l border-primary/5 data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
1275
+ }
1276
+ },
1277
+ defaultVariants: {
1278
+ side: "right"
1279
+ }
1280
+ }
1281
+ );
1282
+ var SheetContent = React5.forwardRef(({ side = "right", className, children, ...props }, ref) => {
1283
+ const portalContainer = usePortalContainer();
1284
+ return /* @__PURE__ */ jsxs(SheetPortal, { container: portalContainer, children: [
1285
+ /* @__PURE__ */ jsx(SheetOverlay, {}),
1286
+ /* @__PURE__ */ jsx(
1287
+ DialogPrimitive.Content,
1288
+ {
1289
+ ref,
1290
+ "data-slot": "sheet-content",
1291
+ className: cn(sheetVariants({ side }), className),
1292
+ ...props,
1293
+ children
1294
+ }
1295
+ )
1296
+ ] });
1297
+ });
1298
+ SheetContent.displayName = DialogPrimitive.Content.displayName;
1299
+ var SheetHeader = ({
1300
+ className,
1301
+ ...props
1302
+ }) => /* @__PURE__ */ jsx(
1303
+ "div",
1304
+ {
1305
+ className: cn(
1306
+ "flex flex-col space-y-2 text-center sm:text-left",
1307
+ className
1308
+ ),
1309
+ ...props
1310
+ }
1311
+ );
1312
+ SheetHeader.displayName = "SheetHeader";
1313
+ var SheetFooter = ({
1314
+ className,
1315
+ ...props
1316
+ }) => /* @__PURE__ */ jsx(
1317
+ "div",
1318
+ {
1319
+ className: cn(
1320
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
1321
+ className
1322
+ ),
1323
+ ...props
1324
+ }
1325
+ );
1326
+ SheetFooter.displayName = "SheetFooter";
1327
+ var SheetTitle = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1328
+ DialogPrimitive.Title,
1329
+ {
1330
+ ref,
1331
+ className: cn("text-lg font-semibold text-foreground", className),
1332
+ ...props
1333
+ }
1334
+ ));
1335
+ SheetTitle.displayName = DialogPrimitive.Title.displayName;
1336
+ var SheetDescription = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1337
+ DialogPrimitive.Description,
1338
+ {
1339
+ ref,
1340
+ className: cn("text-sm text-muted-foreground", className),
1341
+ ...props
1342
+ }
1343
+ ));
1344
+ SheetDescription.displayName = DialogPrimitive.Description.displayName;
1345
+ var Command = forwardRef(
1346
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1347
+ Command$1,
1348
+ {
1349
+ ref,
1350
+ className: cn(
1351
+ "flex h-full w-full flex-col overflow-hidden rounded-none bg-background text-foreground",
1352
+ className
1353
+ ),
1354
+ ...props
1355
+ }
1356
+ )
1357
+ );
1358
+ Command.displayName = "Command";
1359
+ var CommandDialogOverlay = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1360
+ DialogPrimitive.Overlay,
1361
+ {
1362
+ ref,
1363
+ className: cn(
1364
+ "fixed inset-0 z-[99] bg-black/80 backdrop-blur-sm",
1365
+ "data-[state=open]:animate-in data-[state=closed]:animate-out",
1366
+ "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
1367
+ "transition-opacity duration-200",
1368
+ className
1369
+ ),
1370
+ ...props
1371
+ }
1372
+ ));
1373
+ CommandDialogOverlay.displayName = "CommandDialogOverlay";
1374
+ var CommandDialog = ({ children, ...props }) => {
1375
+ const portalContainer = usePortalContainer();
1376
+ return /* @__PURE__ */ jsx(DialogPrimitive.Root, { ...props, children: /* @__PURE__ */ jsxs(DialogPrimitive.Portal, { container: portalContainer, children: [
1377
+ /* @__PURE__ */ jsx(CommandDialogOverlay, {}),
1378
+ /* @__PURE__ */ jsx(
1379
+ DialogPrimitive.Content,
1380
+ {
1381
+ "data-slot": "command-content",
1382
+ className: cn(
1383
+ // Position
1384
+ "fixed left-[50%] top-[50%] z-[100] translate-x-[-50%] translate-y-[-50%]",
1385
+ // Size - responsive
1386
+ "w-full max-w-lg",
1387
+ "max-h-[85vh]",
1388
+ // Slightly shorter than design spec to ensure safe area
1389
+ // Mobile adjustments
1390
+ "sm:max-w-lg",
1391
+ // 512px on desktop
1392
+ "max-w-full",
1393
+ // Full width on mobile
1394
+ // Spacing
1395
+ "m-4 sm:m-0",
1396
+ // 16px margin on mobile, no margin on desktop
1397
+ // Visual
1398
+ "overflow-hidden rounded-none border border-primary/5 bg-background shadow-xl",
1399
+ // Animation
1400
+ "duration-200",
1401
+ "data-[state=open]:animate-in data-[state=closed]:animate-out",
1402
+ "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
1403
+ "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
1404
+ "data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%]"
1405
+ ),
1406
+ children: /* @__PURE__ */ jsx(Command, { className: "[&_[cmdk-group-heading]]:px-3 [&_[cmdk-group-heading]]:py-2 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-semibold [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wide [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:mb-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-3 [&_[cmdk-item]]:py-2 [&_[cmdk-item]_svg]:h-4 [&_[cmdk-item]_svg]:w-4", children })
1407
+ }
1408
+ )
1409
+ ] }) });
1410
+ };
1411
+ var CommandInput = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs(
1412
+ "div",
1413
+ {
1414
+ className: "flex items-center border-b border-primary/5 px-4",
1415
+ "cmdk-input-wrapper": "",
1416
+ children: [
1417
+ /* @__PURE__ */ jsx(Search, { className: "mr-3 h-5 w-5 shrink-0 text-muted-foreground" }),
1418
+ /* @__PURE__ */ jsx(
1419
+ Command$1.Input,
1420
+ {
1421
+ ref,
1422
+ className: cn(
1423
+ // Size
1424
+ "flex h-12 w-full",
1425
+ // Visual
1426
+ "bg-transparent text-base",
1427
+ "outline-none",
1428
+ // Typography
1429
+ "placeholder:text-muted-foreground",
1430
+ // States
1431
+ "disabled:cursor-not-allowed disabled:opacity-50",
1432
+ // Prevent iOS zoom on focus
1433
+ "text-base md:text-sm",
1434
+ className
1435
+ ),
1436
+ ...props
1437
+ }
1438
+ )
1439
+ ]
1440
+ }
1441
+ ));
1442
+ CommandInput.displayName = "CommandInput";
1443
+ var CommandList = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1444
+ Command$1.List,
1445
+ {
1446
+ ref,
1447
+ className: cn(
1448
+ // Scroll
1449
+ "max-h-[400px] overflow-y-auto overflow-x-hidden",
1450
+ // Spacing
1451
+ "p-2",
1452
+ className
1453
+ ),
1454
+ ...props
1455
+ }
1456
+ ));
1457
+ CommandList.displayName = "CommandList";
1458
+ var CommandEmpty = forwardRef((props, ref) => /* @__PURE__ */ jsx(
1459
+ Command$1.Empty,
1460
+ {
1461
+ ref,
1462
+ className: "py-8 px-4 text-center text-sm text-muted-foreground",
1463
+ ...props
1464
+ }
1465
+ ));
1466
+ CommandEmpty.displayName = "CommandEmpty";
1467
+ var CommandGroup = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1468
+ Command$1.Group,
1469
+ {
1470
+ ref,
1471
+ className: cn(
1472
+ // Spacing
1473
+ "space-y-1 mb-2",
1474
+ // Heading styling applied via parent Command className
1475
+ "[&_[cmdk-group-heading]]:px-3 [&_[cmdk-group-heading]]:py-2 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-semibold [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wide",
1476
+ className
1477
+ ),
1478
+ ...props
1479
+ }
1480
+ ));
1481
+ CommandGroup.displayName = "CommandGroup";
1482
+ var CommandSeparator = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1483
+ Command$1.Separator,
1484
+ {
1485
+ ref,
1486
+ className: cn("h-px bg-border my-2", className),
1487
+ ...props
1488
+ }
1489
+ ));
1490
+ CommandSeparator.displayName = "CommandSeparator";
1491
+ var CommandItem = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1492
+ Command$1.Item,
1493
+ {
1494
+ ref,
1495
+ className: cn(
1496
+ // Layout
1497
+ "relative flex cursor-pointer select-none items-center gap-3",
1498
+ // Size
1499
+ "min-h-[44px] sm:min-h-[36px]",
1500
+ // Flexible height with minimal touch targets
1501
+ // Spacing
1502
+ "px-3 py-2.5",
1503
+ // Visual
1504
+ "rounded-none text-base sm:text-sm outline-none",
1505
+ // Transitions
1506
+ "transition-all duration-200 ease-(--ease-premium)",
1507
+ // Hover state - shared dashboard hover treatment
1508
+ "hover-unified",
1509
+ // Selected/focused state (keyboard navigation)
1510
+ "aria-selected:bg-primary/5 aria-selected:text-primary",
1511
+ "data-[selected=true]:bg-primary/5 data-[selected=true]:text-primary",
1512
+ // Disabled state
1513
+ "data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50",
1514
+ className
1515
+ ),
1516
+ ...props
1517
+ }
1518
+ ));
1519
+ CommandItem.displayName = "CommandItem";
1520
+ var CommandShortcut = forwardRef(
1521
+ ({ className, ...props }, ref) => {
1522
+ return /* @__PURE__ */ jsx(
1523
+ "span",
1524
+ {
1525
+ ref,
1526
+ className: cn(
1527
+ // Position
1528
+ "ml-auto",
1529
+ // Typography
1530
+ "text-xs font-mono",
1531
+ // Visual
1532
+ "text-muted-foreground bg-primary/5",
1533
+ "border border-primary/5 rounded-none",
1534
+ // Spacing
1535
+ "px-1.5 py-0.5",
1536
+ className
1537
+ ),
1538
+ ...props
1539
+ }
1540
+ );
1541
+ }
1542
+ );
1543
+ CommandShortcut.displayName = "CommandShortcut";
1544
+ var spinnerVariants = cva("animate-spin motion-reduce:animate-none", {
1545
+ variants: {
1546
+ size: {
1547
+ sm: "h-4 w-4",
1548
+ md: "h-5 w-5",
1549
+ lg: "h-6 w-6"
1550
+ }
1551
+ },
1552
+ defaultVariants: {
1553
+ size: "md"
1554
+ }
1555
+ });
1556
+ var Spinner = forwardRef(
1557
+ ({ size = "md", className, "aria-label": ariaLabel = "Loading", ...props }, ref) => {
1558
+ return /* @__PURE__ */ jsx(
1559
+ Loader2,
1560
+ {
1561
+ ref,
1562
+ role: "status",
1563
+ "aria-label": ariaLabel,
1564
+ className: cn(spinnerVariants({ size }), className),
1565
+ ...props
1566
+ }
1567
+ );
1568
+ }
1569
+ );
1570
+ Spinner.displayName = "Spinner";
1571
+ function Toaster({ theme = "system", ...props }) {
1572
+ return /* @__PURE__ */ jsx(
1573
+ Toaster$1,
1574
+ {
1575
+ theme,
1576
+ className: "toaster group !bg-transparent !overflow-visible !z-[9999]",
1577
+ "data-slot": "toaster",
1578
+ toastOptions: {
1579
+ classNames: {
1580
+ description: "text-muted-foreground"
1581
+ }
1582
+ },
1583
+ icons: {
1584
+ success: /* @__PURE__ */ jsx(CheckCircle2, { className: "h-4 w-4" }),
1585
+ info: /* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4" }),
1586
+ warning: /* @__PURE__ */ jsx(AlertTriangle, { className: "h-4 w-4" }),
1587
+ error: /* @__PURE__ */ jsx(XCircle, { className: "h-4 w-4" }),
1588
+ loading: /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" })
1589
+ },
1590
+ style: {
1591
+ "--normal-bg": "hsl(var(--popover, 0 0% 100%))",
1592
+ "--normal-text": "hsl(var(--popover-foreground, 222.2 84% 4.9%))",
1593
+ "--normal-border": "hsl(var(--border, 214.3 31.8% 91.4%))",
1594
+ "--border-radius": "0px"
1595
+ },
1596
+ ...props
1597
+ }
1598
+ );
1599
+ }
1600
+ var Table = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx(
1601
+ "table",
1602
+ {
1603
+ ref,
1604
+ className: cn("w-full caption-bottom text-sm", className),
1605
+ ...props
1606
+ }
1607
+ ) }));
1608
+ Table.displayName = "Table";
1609
+ var TableHeader = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className: cn("[&_tr] :border-b border-primary/5", className), ...props }));
1610
+ TableHeader.displayName = "TableHeader";
1611
+ var TableBody = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1612
+ "tbody",
1613
+ {
1614
+ ref,
1615
+ className: cn("[&_tr:last-child]:border-0", className),
1616
+ ...props
1617
+ }
1618
+ ));
1619
+ TableBody.displayName = "TableBody";
1620
+ var TableFooter = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1621
+ "tfoot",
1622
+ {
1623
+ ref,
1624
+ className: cn("border-t border-primary/5 font-medium [&>tr]:last:border-b-0", className),
1625
+ ...props
1626
+ }
1627
+ ));
1628
+ TableFooter.displayName = "TableFooter";
1629
+ var TableRow = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1630
+ "tr",
1631
+ {
1632
+ ref,
1633
+ className: cn(
1634
+ "border-b border-primary/5 transition-colors data-[state=selected]:bg-primary/5",
1635
+ className
1636
+ ),
1637
+ ...props
1638
+ }
1639
+ ));
1640
+ TableRow.displayName = "TableRow";
1641
+ var TableHead = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1642
+ "th",
1643
+ {
1644
+ ref,
1645
+ className: cn(
1646
+ "h-11 px-4 text-left align-middle font-semibold text-xs text-foreground uppercase tracking-wider [&:has([role=checkbox])]:pr-0",
1647
+ className
1648
+ ),
1649
+ ...props
1650
+ }
1651
+ ));
1652
+ TableHead.displayName = "TableHead";
1653
+ var TableCell = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1654
+ "td",
1655
+ {
1656
+ ref,
1657
+ className: cn(
1658
+ "px-4 py-3 align-middle [&:has([role=checkbox])]:pr-0",
1659
+ className
1660
+ ),
1661
+ ...props
1662
+ }
1663
+ ));
1664
+ TableCell.displayName = "TableCell";
1665
+ var TableCaption = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1666
+ "caption",
1667
+ {
1668
+ ref,
1669
+ className: cn("mt-4 text-sm text-muted-foreground", className),
1670
+ ...props
1671
+ }
1672
+ ));
1673
+ TableCaption.displayName = "TableCaption";
1674
+ function TableSearch({
1675
+ value,
1676
+ onChange,
1677
+ onClear,
1678
+ placeholder = "Filter records...",
1679
+ isLoading = false,
1680
+ inputRef
1681
+ }) {
1682
+ return /* @__PURE__ */ jsxs("div", { className: "relative w-full max-w-lg", children: [
1683
+ /* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" }),
1684
+ /* @__PURE__ */ jsx(
1685
+ "input",
1686
+ {
1687
+ ref: inputRef,
1688
+ type: "text",
1689
+ placeholder,
1690
+ value,
1691
+ onChange: (e) => onChange(e.target.value),
1692
+ "aria-busy": isLoading,
1693
+ className: "h-10 w-full rounded-none border border-primary/5 bg-background pl-10 pr-10 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 transition-all"
1694
+ }
1695
+ ),
1696
+ (value || isLoading) && /* @__PURE__ */ jsxs("div", { className: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-2", children: [
1697
+ isLoading && /* @__PURE__ */ jsx(Loader2, { className: "w-3.5 h-3.5 text-primary animate-spin" }),
1698
+ value && /* @__PURE__ */ jsx(
1699
+ "button",
1700
+ {
1701
+ type: "button",
1702
+ onClick: onClear,
1703
+ className: "text-muted-foreground/60 hover:text-foreground transition-colors p-0.5 rounded-none hover:bg-primary/5",
1704
+ "aria-label": "Clear search",
1705
+ children: /* @__PURE__ */ jsx(X, { className: "w-3.5 h-3.5" })
1706
+ }
1707
+ )
1708
+ ] })
1709
+ ] });
1710
+ }
1711
+ function TableError({
1712
+ message = "An error occurred. Please try again."
1713
+ }) {
1714
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1715
+ /* @__PURE__ */ jsx(AlertCircle, { className: "w-4 h-4 shrink-0" }),
1716
+ /* @__PURE__ */ jsx("span", { children: message })
1717
+ ] });
1718
+ }
1719
+ function TableLoading() {
1720
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center gap-4 p-12 text-muted-foreground", children: [
1721
+ /* @__PURE__ */ jsx(Loader2, { className: "w-8 h-8 animate-spin text-primary/80" }),
1722
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: "Loading data..." })
1723
+ ] });
1724
+ }
1725
+ function TableEmpty({ message = "No records found" }) {
1726
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center gap-4 p-16 text-center text-muted-foreground", children: [
1727
+ /* @__PURE__ */ jsx("div", { className: "flex h-12 w-12 items-center justify-center rounded-none bg-primary/5", children: /* @__PURE__ */ jsx(FileQuestion, { className: "h-6 w-6" }) }),
1728
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: message })
1729
+ ] });
1730
+ }
1731
+ function renderPageNumbers(currentPage, totalPages, maxVisiblePages, onPageChange) {
1732
+ const getBtnClass = (active) => `flex h-8 w-8 items-center justify-center border-y border-primary/5 border-r border-primary/5 text-xs z-10 -ml-px transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring ${active ? "!bg-primary !text-primary-foreground !border-primary z-20" : "!bg-background !border-primary/5 hover-muted disabled:opacity-50"}`;
1733
+ if (totalPages <= maxVisiblePages) {
1734
+ return Array.from({ length: totalPages }).map((_, i) => /* @__PURE__ */ jsx(
1735
+ "button",
1736
+ {
1737
+ onClick: () => onPageChange(i),
1738
+ "aria-label": `Go to page ${i + 1}`,
1739
+ "aria-current": currentPage === i ? "page" : void 0,
1740
+ className: getBtnClass(currentPage === i),
1741
+ children: i + 1
1742
+ },
1743
+ `page-${i}`
1744
+ ));
1745
+ }
1746
+ const pages = [];
1747
+ const startPage = Math.max(0, currentPage - Math.floor(maxVisiblePages / 2));
1748
+ const endPage = Math.min(totalPages - 1, startPage + maxVisiblePages - 1);
1749
+ if (startPage > 0) {
1750
+ pages.push(
1751
+ /* @__PURE__ */ jsx(
1752
+ "button",
1753
+ {
1754
+ onClick: () => onPageChange(0),
1755
+ "aria-label": "Go to page 1",
1756
+ className: getBtnClass(currentPage === 0),
1757
+ children: "1"
1758
+ },
1759
+ "page-0"
1760
+ )
1761
+ );
1762
+ if (startPage > 1) {
1763
+ pages.push(
1764
+ /* @__PURE__ */ jsx(
1765
+ "span",
1766
+ {
1767
+ className: "flex h-8 w-8 items-center justify-center border-y border-primary/5 border-r border-primary/5 !border-primary/5 !bg-background text-muted-foreground text-xs -ml-px",
1768
+ "aria-hidden": "true",
1769
+ children: "..."
1770
+ },
1771
+ "ellipsis-start"
1772
+ )
1773
+ );
1774
+ }
1775
+ }
1776
+ for (let i = startPage; i <= endPage; i++) {
1777
+ pages.push(
1778
+ /* @__PURE__ */ jsx(
1779
+ "button",
1780
+ {
1781
+ onClick: () => onPageChange(i),
1782
+ "aria-label": `Go to page ${i + 1}`,
1783
+ "aria-current": currentPage === i ? "page" : void 0,
1784
+ className: getBtnClass(currentPage === i),
1785
+ children: i + 1
1786
+ },
1787
+ i
1788
+ )
1789
+ );
1790
+ }
1791
+ if (endPage < totalPages - 1) {
1792
+ if (endPage < totalPages - 2) {
1793
+ pages.push(
1794
+ /* @__PURE__ */ jsx(
1795
+ "span",
1796
+ {
1797
+ className: "flex h-8 w-8 items-center justify-center border-y border-primary/5 border-r border-primary/5 !border-primary/5 !bg-background text-muted-foreground text-xs -ml-px",
1798
+ "aria-hidden": "true",
1799
+ children: "..."
1800
+ },
1801
+ "ellipsis-end"
1802
+ )
1803
+ );
1804
+ }
1805
+ pages.push(
1806
+ /* @__PURE__ */ jsx(
1807
+ "button",
1808
+ {
1809
+ onClick: () => onPageChange(totalPages - 1),
1810
+ "aria-label": `Go to page ${totalPages}`,
1811
+ className: getBtnClass(currentPage === totalPages - 1),
1812
+ children: totalPages
1813
+ },
1814
+ totalPages - 1
1815
+ )
1816
+ );
1817
+ }
1818
+ return pages;
1819
+ }
1820
+ function TablePagination({
1821
+ meta,
1822
+ onPageChange,
1823
+ onPageSizeChange,
1824
+ config,
1825
+ isLoading = false
1826
+ }) {
1827
+ const {
1828
+ showPageSizeSelector = true,
1829
+ pageSizeOptions = [10, 20, 30, 50],
1830
+ maxVisiblePages = 5
1831
+ } = config || {};
1832
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col sm:flex-row w-full items-center justify-between gap-4 text-xs sm:text-sm text-muted-foreground p-4 border-t border-primary/5", children: [
1833
+ /* @__PURE__ */ jsxs("div", { className: "whitespace-nowrap order-2 sm:order-1", children: [
1834
+ "Showing ",
1835
+ (meta.page - 1) * meta.limit + 1,
1836
+ "-",
1837
+ Math.min(meta.page * meta.limit, meta.total),
1838
+ " of ",
1839
+ meta.total,
1840
+ " entries"
1841
+ ] }),
1842
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-center gap-4 sm:gap-6 lg:gap-8 order-1 sm:order-2", children: [
1843
+ showPageSizeSelector && /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
1844
+ /* @__PURE__ */ jsx("span", { className: "whitespace-nowrap hidden sm:inline-block", children: "Rows per page" }),
1845
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
1846
+ /* @__PURE__ */ jsx(
1847
+ "select",
1848
+ {
1849
+ id: "pageSize",
1850
+ value: meta.limit,
1851
+ onChange: (e) => {
1852
+ const newPageSize = Number(e.target.value);
1853
+ onPageSizeChange(newPageSize);
1854
+ },
1855
+ className: "h-8 w-[70px] appearance-none rounded-none border border-primary/5 bg-background px-2 py-1 text-sm font-medium focus-visible:outline-none focus:ring-1 focus:ring-ring disabled:opacity-50 hover-muted cursor-pointer",
1856
+ disabled: isLoading,
1857
+ children: pageSizeOptions.map((size) => /* @__PURE__ */ jsx("option", { value: size, children: size }, size))
1858
+ }
1859
+ ),
1860
+ /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-muted-foreground", children: /* @__PURE__ */ jsx(
1861
+ "svg",
1862
+ {
1863
+ className: "h-3 w-3",
1864
+ fill: "none",
1865
+ viewBox: "0 0 24 24",
1866
+ stroke: "currentColor",
1867
+ children: /* @__PURE__ */ jsx(
1868
+ "path",
1869
+ {
1870
+ strokeLinecap: "round",
1871
+ strokeLinejoin: "round",
1872
+ strokeWidth: 2,
1873
+ d: "M19 9l-7 7-7-7"
1874
+ }
1875
+ )
1876
+ }
1877
+ ) })
1878
+ ] })
1879
+ ] }),
1880
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center -space-x-px", children: [
1881
+ /* @__PURE__ */ jsx(
1882
+ "button",
1883
+ {
1884
+ onClick: () => onPageChange(0),
1885
+ disabled: meta.page === 0 || isLoading,
1886
+ className: "hidden sm:flex h-8 w-8 items-center justify-center rounded-none border border-primary/5 bg-background hover-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring z-10",
1887
+ "aria-label": "First page",
1888
+ children: /* @__PURE__ */ jsx(ChevronsLeft, { className: "h-4 w-4" })
1889
+ }
1890
+ ),
1891
+ /* @__PURE__ */ jsx(
1892
+ "button",
1893
+ {
1894
+ onClick: () => onPageChange(meta.page - 1),
1895
+ disabled: meta.page === 0 || isLoading,
1896
+ className: "flex h-8 w-8 items-center justify-center rounded-none sm:rounded-none border border-primary/5 bg-background hover-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring z-10",
1897
+ "aria-label": "Previous page",
1898
+ children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" })
1899
+ }
1900
+ ),
1901
+ /* @__PURE__ */ jsx("div", { className: "flex", children: renderPageNumbers(
1902
+ meta.page,
1903
+ meta.totalPages,
1904
+ maxVisiblePages,
1905
+ onPageChange
1906
+ ) }),
1907
+ /* @__PURE__ */ jsx(
1908
+ "button",
1909
+ {
1910
+ onClick: () => onPageChange(meta.page + 1),
1911
+ disabled: meta.page >= meta.totalPages - 1 || isLoading,
1912
+ className: "flex h-8 w-8 items-center justify-center rounded-none sm:rounded-none border-y border-primary/5 border-x border-primary/5 sm :border-r border-primary/5 bg-background hover-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring z-10",
1913
+ "aria-label": "Next page",
1914
+ children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
1915
+ }
1916
+ ),
1917
+ /* @__PURE__ */ jsx(
1918
+ "button",
1919
+ {
1920
+ onClick: () => onPageChange(meta.totalPages - 1),
1921
+ disabled: meta.page >= meta.totalPages - 1 || isLoading,
1922
+ className: "hidden sm:flex h-8 w-8 items-center justify-center rounded-none border border-primary/5 bg-background hover-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring z-10",
1923
+ "aria-label": "Last page",
1924
+ children: /* @__PURE__ */ jsx(ChevronsRight, { className: "h-4 w-4" })
1925
+ }
1926
+ )
1927
+ ] }),
1928
+ /* @__PURE__ */ jsxs("div", { className: "whitespace-nowrap hidden sm:block", children: [
1929
+ "Page ",
1930
+ meta.page + 1,
1931
+ " of ",
1932
+ meta.totalPages
1933
+ ] })
1934
+ ] })
1935
+ ] });
1936
+ }
1937
+ var GrayBar = ({ className }) => /* @__PURE__ */ jsx(Skeleton, { className });
1938
+ var TableSkeleton = ({
1939
+ columns = 5,
1940
+ rowCount = 8,
1941
+ hideWrapper = false,
1942
+ hideFooter = false
1943
+ }) => {
1944
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
1945
+ /* @__PURE__ */ jsx("div", { className: "border-0 rounded-none shadow-none", children: /* @__PURE__ */ jsxs(Table, { children: [
1946
+ /* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsx(TableRow, { children: Array.from({ length: columns }).map((_, colIdx) => /* @__PURE__ */ jsx(TableHead, { className: "py-3", children: colIdx === 0 ? /* @__PURE__ */ jsx(GrayBar, { className: "h-4 w-4" }) : colIdx === columns - 1 ? /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-4 rounded-none" }) }) : colIdx === 1 ? /* @__PURE__ */ jsx(GrayBar, { className: "h-4 w-[70%] max-w-[180px]" }) : /* @__PURE__ */ jsx(GrayBar, { className: "h-4 w-[60%] max-w-[120px]" }) }, `skeleton-header-${colIdx}`)) }) }),
1947
+ /* @__PURE__ */ jsx(TableBody, { children: Array.from({ length: rowCount }).map((_, rowIdx) => /* @__PURE__ */ jsx(TableRow, { className: "border-b border-primary/5", children: Array.from({ length: columns }).map((_2, colIdx) => /* @__PURE__ */ jsx(TableCell, { className: "py-3", children: colIdx === 0 ? /* @__PURE__ */ jsx(GrayBar, { className: "h-4 w-4" }) : colIdx === columns - 1 ? /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-8 rounded-none" }) }) : colIdx === 1 ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
1948
+ /* @__PURE__ */ jsx(Skeleton, { className: "w-9 rounded-none shrink-0" }),
1949
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1.5 flex-1", children: [
1950
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-[120px]" }),
1951
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-[80px]" })
1952
+ ] })
1953
+ ] }) : /* @__PURE__ */ jsx(GrayBar, { className: "h-4 w-[60%] max-w-[120px]" }) }, colIdx)) }, rowIdx)) })
1954
+ ] }) }),
1955
+ !hideFooter && /* @__PURE__ */ jsx("div", { className: "table-footer border-t border-primary/5", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-2 py-4 p-4", children: [
1956
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 text-sm", children: /* @__PURE__ */ jsx(GrayBar, { className: "h-4 w-[120px]" }) }),
1957
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-6", children: [
1958
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1959
+ /* @__PURE__ */ jsx(GrayBar, { className: "h-4 w-20" }),
1960
+ /* @__PURE__ */ jsx(GrayBar, { className: "h-8 w-[70px]" })
1961
+ ] }),
1962
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
1963
+ /* @__PURE__ */ jsx(GrayBar, { className: "h-8 w-8" }),
1964
+ /* @__PURE__ */ jsx(GrayBar, { className: "h-8 w-8" }),
1965
+ /* @__PURE__ */ jsx(GrayBar, { className: "h-8 w-8" }),
1966
+ /* @__PURE__ */ jsx(GrayBar, { className: "h-8 w-8" }),
1967
+ /* @__PURE__ */ jsx(GrayBar, { className: "h-8 w-8" })
1968
+ ] }),
1969
+ /* @__PURE__ */ jsx(GrayBar, { className: "h-4 w-[120px]" })
1970
+ ] })
1971
+ ] }) })
1972
+ ] });
1973
+ if (hideWrapper) {
1974
+ return content;
1975
+ }
1976
+ return /* @__PURE__ */ jsx("div", { className: "table-wrapper rounded-none border border-primary/5 bg-card overflow-hidden", children: content });
1977
+ };
1978
+ TableSkeleton.displayName = "TableSkeleton";
1979
+ function ResponsiveTableInner({
1980
+ data,
1981
+ columns,
1982
+ onRowClick,
1983
+ renderMobileCard,
1984
+ className,
1985
+ emptyMessage = "No results found.",
1986
+ ariaLabel,
1987
+ tableWrapperClassName,
1988
+ footer
1989
+ }, ref) {
1990
+ const visibleMobileColumns = React5.useMemo(
1991
+ () => columns.filter((col) => !col.hideOnMobile),
1992
+ [columns]
1993
+ );
1994
+ const primaryColumn = React5.useMemo(() => {
1995
+ return visibleMobileColumns.find(
1996
+ (col) => col.key !== "select" && col.key !== "actions"
1997
+ ) || visibleMobileColumns[0];
1998
+ }, [visibleMobileColumns]);
1999
+ const secondaryColumns = React5.useMemo(
2000
+ () => visibleMobileColumns.filter((col) => col.key !== primaryColumn?.key),
2001
+ [visibleMobileColumns, primaryColumn]
2002
+ );
2003
+ React5.useEffect(() => {
2004
+ const isDev = typeof globalThis !== "undefined" && globalThis.process && globalThis.process.env?.NODE_ENV === "development";
2005
+ if (isDev && visibleMobileColumns.length === 0) {
2006
+ console.warn(
2007
+ "ResponsiveTable: All columns are hidden on mobile (hideOnMobile: true). Consider showing at least one column for better mobile UX. Users will see empty card borders on mobile devices."
2008
+ );
2009
+ }
2010
+ }, [visibleMobileColumns.length]);
2011
+ const handleItemClick = React5.useCallback(
2012
+ (item, e) => {
2013
+ if (!onRowClick) return;
2014
+ if (e) {
2015
+ const target = e.target;
2016
+ if (target.closest('[role="checkbox"]') || target.closest("button") || target.closest("a") || target.closest('[role^="menuitem"]') || target.closest("[data-actions]")) {
2017
+ return;
2018
+ }
2019
+ }
2020
+ onRowClick(item);
2021
+ },
2022
+ [onRowClick]
2023
+ );
2024
+ const handleCardKeyDown = React5.useCallback(
2025
+ (item) => (e) => {
2026
+ if (onRowClick && (e.key === "Enter" || e.key === " ")) {
2027
+ e.preventDefault();
2028
+ handleItemClick(item, e);
2029
+ }
2030
+ },
2031
+ [handleItemClick, onRowClick]
2032
+ );
2033
+ if (data.length === 0) {
2034
+ return /* @__PURE__ */ jsx(
2035
+ "div",
2036
+ {
2037
+ ref,
2038
+ className: cn(
2039
+ "p-8 text-center",
2040
+ className
2041
+ ),
2042
+ children: /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: emptyMessage })
2043
+ }
2044
+ );
2045
+ }
2046
+ return /* @__PURE__ */ jsxs("div", { ref, className: cn("w-full", className), children: [
2047
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-4 md:hidden", children: data.map((item) => {
2048
+ const primaryValue = primaryColumn ? String(item[primaryColumn.key]) : String(item.id);
2049
+ if (renderMobileCard) {
2050
+ return /* @__PURE__ */ jsx(
2051
+ "div",
2052
+ {
2053
+ onClick: (e) => handleItemClick(item, e),
2054
+ role: onRowClick ? "button" : void 0,
2055
+ tabIndex: onRowClick ? 0 : void 0,
2056
+ onKeyDown: onRowClick ? handleCardKeyDown(item) : void 0,
2057
+ className: onRowClick ? "cursor-pointer" : void 0,
2058
+ "aria-label": onRowClick ? `View details for ${primaryValue}` : void 0,
2059
+ children: renderMobileCard(item, visibleMobileColumns)
2060
+ },
2061
+ item.id
2062
+ );
2063
+ }
2064
+ return /* @__PURE__ */ jsxs(
2065
+ Card,
2066
+ {
2067
+ variant: onRowClick ? "interactive" : "default",
2068
+ className: cn(
2069
+ onRowClick && "cursor-pointer",
2070
+ "transition-all duration-150"
2071
+ ),
2072
+ onClick: (e) => handleItemClick(item, e),
2073
+ role: onRowClick ? "button" : void 0,
2074
+ tabIndex: onRowClick ? 0 : void 0,
2075
+ onKeyDown: onRowClick ? handleCardKeyDown(item) : void 0,
2076
+ "aria-label": onRowClick ? `View details for ${primaryValue}` : void 0,
2077
+ children: [
2078
+ primaryColumn ? /* @__PURE__ */ jsx(CardHeader, { className: "pb-3", children: /* @__PURE__ */ jsx(CardTitle, { className: "text-base", children: primaryColumn.render ? primaryColumn.render(item[primaryColumn.key], item) : String(item[primaryColumn.key]) }) }) : null,
2079
+ secondaryColumns.length > 0 && /* @__PURE__ */ jsx(CardContent, { className: "pb-3", children: /* @__PURE__ */ jsx("dl", { className: "flex flex-col gap-2", children: secondaryColumns.map((column) => /* @__PURE__ */ jsxs(
2080
+ "div",
2081
+ {
2082
+ className: "flex items-start justify-between gap-4 text-sm",
2083
+ children: [
2084
+ !column.hideLabelOnMobile && /* @__PURE__ */ jsxs("dt", { className: "text-muted-foreground min-w-[80px] shrink-0", children: [
2085
+ column.label,
2086
+ ":"
2087
+ ] }),
2088
+ /* @__PURE__ */ jsx(
2089
+ "dd",
2090
+ {
2091
+ className: cn(
2092
+ "font-medium flex-1",
2093
+ !column.hideLabelOnMobile ? "text-right" : "text-left"
2094
+ ),
2095
+ children: column.render ? column.render(item[column.key], item) : String(item[column.key])
2096
+ }
2097
+ )
2098
+ ]
2099
+ },
2100
+ String(column.key)
2101
+ )) }) })
2102
+ ]
2103
+ },
2104
+ item.id
2105
+ );
2106
+ }) }),
2107
+ /* @__PURE__ */ jsx(
2108
+ "div",
2109
+ {
2110
+ className: cn(
2111
+ "table-wrapper hidden md:block overflow-hidden rounded-none border border-primary/5",
2112
+ tableWrapperClassName
2113
+ ),
2114
+ children: /* @__PURE__ */ jsxs(Table, { "aria-label": ariaLabel || "Data table", children: [
2115
+ /* @__PURE__ */ jsx(TableHeader, { className: "bg-[hsl(var(--table-header-bg))]", children: /* @__PURE__ */ jsx(TableRow, { children: columns.map((column) => /* @__PURE__ */ jsx(
2116
+ TableHead,
2117
+ {
2118
+ className: column.headerClassName,
2119
+ children: column.label
2120
+ },
2121
+ String(column.key)
2122
+ )) }) }),
2123
+ /* @__PURE__ */ jsx(TableBody, { children: data.map((item) => {
2124
+ const primaryValue = primaryColumn ? String(item[primaryColumn.key]) : String(item.id);
2125
+ return /* @__PURE__ */ jsx(
2126
+ TableRow,
2127
+ {
2128
+ className: cn(
2129
+ "hover-unified-table-row",
2130
+ onRowClick && "cursor-pointer"
2131
+ ),
2132
+ onClick: (e) => handleItemClick(item, e),
2133
+ role: onRowClick ? "button" : void 0,
2134
+ tabIndex: onRowClick ? 0 : void 0,
2135
+ onKeyDown: onRowClick ? handleCardKeyDown(item) : void 0,
2136
+ "aria-label": onRowClick ? `View details for ${primaryValue}` : void 0,
2137
+ children: columns.map((column) => /* @__PURE__ */ jsx(
2138
+ TableCell,
2139
+ {
2140
+ className: column.cellClassName,
2141
+ children: column.render ? column.render(item[column.key], item) : String(item[column.key])
2142
+ },
2143
+ String(column.key)
2144
+ ))
2145
+ },
2146
+ item.id
2147
+ );
2148
+ }) })
2149
+ ] })
2150
+ }
2151
+ ),
2152
+ footer && /* @__PURE__ */ jsx("div", { className: "table-footer border-t border-primary/5 bg-[hsl(var(--table-header-bg))]", children: footer })
2153
+ ] });
2154
+ }
2155
+ var ResponsiveTable = React5.forwardRef(ResponsiveTableInner);
2156
+
2157
+ // src/tailwind-preset.ts
2158
+ var uiPreset = {
2159
+ theme: {
2160
+ extend: {
2161
+ colors: {
2162
+ border: "hsl(var(--border))",
2163
+ input: "hsl(var(--input))",
2164
+ ring: "hsl(var(--ring))",
2165
+ background: "hsl(var(--background))",
2166
+ foreground: "hsl(var(--foreground))",
2167
+ primary: {
2168
+ DEFAULT: "hsl(var(--primary))",
2169
+ foreground: "hsl(var(--primary-foreground))"
2170
+ },
2171
+ secondary: {
2172
+ DEFAULT: "hsl(var(--secondary))",
2173
+ foreground: "hsl(var(--secondary-foreground))"
2174
+ },
2175
+ destructive: {
2176
+ DEFAULT: "hsl(var(--destructive))",
2177
+ foreground: "hsl(var(--destructive-foreground))"
2178
+ },
2179
+ success: {
2180
+ DEFAULT: "hsl(var(--success))",
2181
+ foreground: "hsl(var(--success-foreground))"
2182
+ },
2183
+ warning: {
2184
+ DEFAULT: "hsl(var(--warning))",
2185
+ foreground: "hsl(var(--warning-foreground))"
2186
+ },
2187
+ muted: {
2188
+ DEFAULT: "hsl(var(--muted))",
2189
+ foreground: "hsl(var(--muted-foreground))"
2190
+ },
2191
+ accent: {
2192
+ DEFAULT: "hsl(var(--accent))",
2193
+ foreground: "hsl(var(--accent-foreground))"
2194
+ },
2195
+ popover: {
2196
+ DEFAULT: "hsl(var(--popover))",
2197
+ foreground: "hsl(var(--popover-foreground))"
2198
+ },
2199
+ card: {
2200
+ DEFAULT: "hsl(var(--card))",
2201
+ foreground: "hsl(var(--card-foreground))"
2202
+ }
2203
+ },
2204
+ borderRadius: {
2205
+ lg: "var(--radius)",
2206
+ md: "calc(var(--radius) - 2px)",
2207
+ sm: "calc(var(--radius) - 4px)"
2208
+ },
2209
+ keyframes: {
2210
+ "accordion-down": {
2211
+ from: { height: "0" },
2212
+ to: { height: "var(--radix-accordion-content-height)" }
2213
+ },
2214
+ "accordion-up": {
2215
+ from: { height: "var(--radix-accordion-content-height)" },
2216
+ to: { height: "0" }
2217
+ }
2218
+ },
2219
+ animation: {
2220
+ "accordion-down": "accordion-down 0.3s cubic-bezier(0.87, 0, 0.13, 1)",
2221
+ "accordion-up": "accordion-up 0.3s cubic-bezier(0.87, 0, 0.13, 1)"
2222
+ }
2223
+ }
2224
+ }
2225
+ };
2226
+ var tailwind_preset_default = uiPreset;
2227
+
2228
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, Avatar, AvatarFallback, AvatarImage, Badge, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Input, Label, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PortalProvider, Progress, RadioGroup, RadioGroupItem, ResponsiveTable, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Spinner, Switch, Table, TableBody, TableCaption, TableCell, TableEmpty, TableError, TableFooter, TableHead, TableHeader, TableLoading, TablePagination, TableRow, TableSearch, TableSkeleton, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, alertVariants, avatarVariants, badgeVariants, buttonVariants, cardVariants, cn, dialogContentVariants, inputVariants, progressVariants, selectTriggerVariants, sheetVariants, spinnerVariants, tailwind_preset_default as uiPreset, usePortalContainer };
2229
+ //# sourceMappingURL=index.mjs.map
2230
+ //# sourceMappingURL=index.mjs.map