@caqophony/ui 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,4605 @@
1
+ 'use client';
2
+ import {
3
+ MarkdownRenderer,
4
+ cn
5
+ } from "./chunk-K3SEIIA3.js";
6
+
7
+ // src/button.tsx
8
+ import { Slot } from "@radix-ui/react-slot";
9
+ import { cva } from "class-variance-authority";
10
+ import { Loader2 } from "lucide-react";
11
+ import * as React from "react";
12
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
13
+ var buttonVariants = cva(
14
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
15
+ {
16
+ variants: {
17
+ variant: {
18
+ default: "bg-primary dark:bg-primary text-primary-foreground dark:text-primary-foreground shadow hover:bg-primary/90 dark:hover:bg-primary/90",
19
+ destructive: "bg-intent-error dark:bg-intent-error text-intent-error-foreground dark:text-intent-error-foreground shadow-sm hover:bg-intent-error/90 dark:hover:bg-intent-error/90",
20
+ outline: "border border-border dark:border-border bg-background dark:bg-background shadow-sm hover:bg-muted dark:hover:bg-muted hover:text-foreground dark:hover:text-foreground",
21
+ secondary: "bg-muted dark:bg-muted text-muted-foreground dark:text-muted-foreground shadow-sm hover:bg-muted/80 dark:hover:bg-muted/80",
22
+ ghost: "hover:bg-muted dark:hover:bg-muted hover:text-foreground dark:hover:text-foreground",
23
+ link: "text-primary dark:text-primary underline-offset-4 hover:underline"
24
+ },
25
+ size: {
26
+ default: "h-10 px-4 py-2",
27
+ sm: "h-9 rounded-md px-3",
28
+ lg: "h-11 rounded-md px-8",
29
+ icon: "size-10"
30
+ }
31
+ },
32
+ defaultVariants: {
33
+ variant: "default",
34
+ size: "default"
35
+ }
36
+ }
37
+ );
38
+ var Button = React.forwardRef(
39
+ ({
40
+ className,
41
+ variant,
42
+ size,
43
+ asChild = false,
44
+ loading = false,
45
+ loadingText,
46
+ children,
47
+ disabled,
48
+ ...props
49
+ }, ref) => {
50
+ const Comp = asChild && !loading ? Slot : "button";
51
+ const isDisabled = disabled || loading;
52
+ return /* @__PURE__ */ jsx(
53
+ Comp,
54
+ {
55
+ className: cn(buttonVariants({ variant, size, className })),
56
+ ref,
57
+ disabled: isDisabled,
58
+ "aria-busy": loading,
59
+ ...props,
60
+ children: loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
61
+ /* @__PURE__ */ jsx(Loader2, { className: "size-4 animate-spin", "aria-hidden": "true" }),
62
+ /* @__PURE__ */ jsx("span", { children: loadingText || children })
63
+ ] }) : children
64
+ }
65
+ );
66
+ }
67
+ );
68
+ Button.displayName = "Button";
69
+
70
+ // src/input.tsx
71
+ import * as React2 from "react";
72
+ import { jsx as jsx2 } from "react/jsx-runtime";
73
+ var Input = React2.forwardRef(
74
+ ({ className, type, error, errorMessageId, ...props }, ref) => {
75
+ return /* @__PURE__ */ jsx2(
76
+ "input",
77
+ {
78
+ type,
79
+ "aria-invalid": error || void 0,
80
+ "aria-describedby": error && errorMessageId ? errorMessageId : void 0,
81
+ className: cn(
82
+ "flex h-11 w-full rounded-md border bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
83
+ error ? "border-intent-error focus-visible:ring-intent-error dark:border-intent-error" : "border-input focus-visible:ring-ring",
84
+ className
85
+ ),
86
+ ref,
87
+ ...props
88
+ }
89
+ );
90
+ }
91
+ );
92
+ Input.displayName = "Input";
93
+
94
+ // src/card.tsx
95
+ import * as React3 from "react";
96
+ import { jsx as jsx3 } from "react/jsx-runtime";
97
+ var Card = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
98
+ "div",
99
+ {
100
+ ref,
101
+ className: cn(
102
+ "rounded-lg border bg-card text-card-foreground shadow-sm",
103
+ className
104
+ ),
105
+ ...props
106
+ }
107
+ ));
108
+ Card.displayName = "Card";
109
+ var CardHeader = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
110
+ "div",
111
+ {
112
+ ref,
113
+ className: cn("flex flex-col space-y-1.5 p-6", className),
114
+ ...props
115
+ }
116
+ ));
117
+ CardHeader.displayName = "CardHeader";
118
+ var CardTitle = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
119
+ "h3",
120
+ {
121
+ ref,
122
+ className: cn(
123
+ "text-2xl font-semibold leading-none tracking-tight",
124
+ className
125
+ ),
126
+ ...props
127
+ }
128
+ ));
129
+ CardTitle.displayName = "CardTitle";
130
+ var CardDescription = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
131
+ "p",
132
+ {
133
+ ref,
134
+ className: cn("text-sm text-muted-foreground", className),
135
+ ...props
136
+ }
137
+ ));
138
+ CardDescription.displayName = "CardDescription";
139
+ var CardContent = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3("div", { ref, className: cn("p-6 pt-0", className), ...props }));
140
+ CardContent.displayName = "CardContent";
141
+ var CardFooter = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
142
+ "div",
143
+ {
144
+ ref,
145
+ className: cn("flex items-center p-6 pt-0", className),
146
+ ...props
147
+ }
148
+ ));
149
+ CardFooter.displayName = "CardFooter";
150
+
151
+ // src/switch.tsx
152
+ import * as SwitchPrimitives from "@radix-ui/react-switch";
153
+ import * as React4 from "react";
154
+ import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
155
+ var Switch = React4.forwardRef(({ className, label, description, id, ...props }, ref) => {
156
+ const generatedId = React4.useId();
157
+ const switchId = id || generatedId;
158
+ const switchElement = /* @__PURE__ */ jsx4(
159
+ SwitchPrimitives.Root,
160
+ {
161
+ className: cn(
162
+ "peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors",
163
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
164
+ "disabled:cursor-not-allowed disabled:opacity-50",
165
+ "data-[state=checked]:bg-primary dark:data-[state=checked]:bg-primary",
166
+ "data-[state=unchecked]:bg-muted dark:data-[state=unchecked]:bg-muted",
167
+ className
168
+ ),
169
+ id: switchId,
170
+ ref,
171
+ ...props,
172
+ children: /* @__PURE__ */ jsx4(
173
+ SwitchPrimitives.Thumb,
174
+ {
175
+ className: cn(
176
+ "pointer-events-none block size-5 rounded-full shadow-lg ring-0 transition-transform",
177
+ "bg-background dark:bg-background",
178
+ "data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
179
+ )
180
+ }
181
+ )
182
+ }
183
+ );
184
+ if (!label) {
185
+ return switchElement;
186
+ }
187
+ return /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-3", children: [
188
+ switchElement,
189
+ /* @__PURE__ */ jsxs2("div", { className: "flex flex-col", children: [
190
+ /* @__PURE__ */ jsx4(
191
+ "label",
192
+ {
193
+ htmlFor: switchId,
194
+ className: "cursor-pointer text-sm font-medium text-foreground dark:text-foreground",
195
+ children: label
196
+ }
197
+ ),
198
+ description && /* @__PURE__ */ jsx4("span", { className: "text-xs text-muted-foreground dark:text-muted-foreground", children: description })
199
+ ] })
200
+ ] });
201
+ });
202
+ Switch.displayName = "Switch";
203
+
204
+ // src/tooltip.tsx
205
+ import * as React5 from "react";
206
+ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
207
+ import { jsx as jsx5 } from "react/jsx-runtime";
208
+ var TooltipProvider = TooltipPrimitive.Provider;
209
+ var Tooltip = TooltipPrimitive.Root;
210
+ var TooltipTrigger = TooltipPrimitive.Trigger;
211
+ var TooltipContent = React5.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx5(
212
+ TooltipPrimitive.Content,
213
+ {
214
+ ref,
215
+ sideOffset,
216
+ className: cn(
217
+ "z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md 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",
218
+ className
219
+ ),
220
+ ...props
221
+ }
222
+ ));
223
+ TooltipContent.displayName = TooltipPrimitive.Content.displayName;
224
+
225
+ // src/form-field.tsx
226
+ import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
227
+ function FormField({
228
+ label,
229
+ name,
230
+ error,
231
+ description,
232
+ required = false,
233
+ disabled = false,
234
+ children,
235
+ className
236
+ }) {
237
+ const hasError = Boolean(error);
238
+ return /* @__PURE__ */ jsxs3(
239
+ "div",
240
+ {
241
+ "aria-disabled": disabled || void 0,
242
+ className: cn(
243
+ "space-y-1.5",
244
+ disabled && "pointer-events-none opacity-50",
245
+ className
246
+ ),
247
+ children: [
248
+ /* @__PURE__ */ jsxs3(
249
+ "label",
250
+ {
251
+ htmlFor: name,
252
+ className: cn(
253
+ "block text-sm font-medium",
254
+ hasError ? "text-intent-error dark:text-intent-error" : "text-foreground dark:text-foreground"
255
+ ),
256
+ children: [
257
+ label,
258
+ required && /* @__PURE__ */ jsx6("span", { className: "text-intent-error ml-1", "aria-hidden": "true", children: "*" })
259
+ ]
260
+ }
261
+ ),
262
+ description && !hasError && /* @__PURE__ */ jsx6("p", { className: "text-xs text-muted-foreground dark:text-muted-foreground", children: description }),
263
+ /* @__PURE__ */ jsx6(
264
+ "div",
265
+ {
266
+ className: cn(
267
+ "relative",
268
+ hasError && "[&>input]:border-intent-error [&>input]:focus-visible:ring-intent-error",
269
+ hasError && "[&>select]:border-intent-error [&>select]:focus-visible:ring-intent-error",
270
+ hasError && "[&>textarea]:border-intent-error [&>textarea]:focus-visible:ring-intent-error"
271
+ ),
272
+ children
273
+ }
274
+ ),
275
+ hasError && /* @__PURE__ */ jsxs3(
276
+ "p",
277
+ {
278
+ className: "text-intent-error dark:text-intent-error flex items-center gap-1 text-sm",
279
+ role: "alert",
280
+ "aria-live": "polite",
281
+ children: [
282
+ /* @__PURE__ */ jsx6(ErrorIcon, { className: "size-4 shrink-0" }),
283
+ /* @__PURE__ */ jsx6("span", { children: error })
284
+ ]
285
+ }
286
+ )
287
+ ]
288
+ }
289
+ );
290
+ }
291
+ function ErrorIcon({ className }) {
292
+ return /* @__PURE__ */ jsx6(
293
+ "svg",
294
+ {
295
+ className,
296
+ fill: "none",
297
+ viewBox: "0 0 24 24",
298
+ stroke: "currentColor",
299
+ strokeWidth: 2,
300
+ children: /* @__PURE__ */ jsx6(
301
+ "path",
302
+ {
303
+ strokeLinecap: "round",
304
+ strokeLinejoin: "round",
305
+ d: "M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
306
+ }
307
+ )
308
+ }
309
+ );
310
+ }
311
+ function FormFieldGroup({ children, className }) {
312
+ return /* @__PURE__ */ jsx6("div", { className: cn("grid gap-4", "grid-cols-1 sm:grid-cols-2", className), children });
313
+ }
314
+ function FormSection({
315
+ title,
316
+ description,
317
+ children,
318
+ className
319
+ }) {
320
+ return /* @__PURE__ */ jsxs3("fieldset", { className: cn("space-y-4", className), children: [
321
+ (title || description) && /* @__PURE__ */ jsxs3("div", { className: "space-y-1", children: [
322
+ title && /* @__PURE__ */ jsx6("legend", { className: "text-base font-medium text-foreground dark:text-foreground", children: title }),
323
+ description && /* @__PURE__ */ jsx6("p", { className: "text-sm text-muted-foreground dark:text-muted-foreground", children: description })
324
+ ] }),
325
+ /* @__PURE__ */ jsx6("div", { className: "space-y-4", children })
326
+ ] });
327
+ }
328
+ function FormError({ error, className }) {
329
+ if (!error) return null;
330
+ return /* @__PURE__ */ jsx6(
331
+ "div",
332
+ {
333
+ className: cn(
334
+ "border-intent-error/20 bg-intent-error/10 rounded-lg border p-4",
335
+ "dark:border-intent-error/20 dark:bg-intent-error/10",
336
+ className
337
+ ),
338
+ role: "alert",
339
+ children: /* @__PURE__ */ jsxs3("div", { className: "flex gap-3", children: [
340
+ /* @__PURE__ */ jsx6(ErrorIcon, { className: "text-intent-error dark:text-intent-error size-5 shrink-0" }),
341
+ /* @__PURE__ */ jsx6("p", { className: "text-intent-error dark:text-intent-error text-sm", children: error })
342
+ ] })
343
+ }
344
+ );
345
+ }
346
+ function FormSuccess({ message, className }) {
347
+ if (!message) return null;
348
+ return /* @__PURE__ */ jsx6(
349
+ "div",
350
+ {
351
+ className: cn(
352
+ "border-intent-success/20 bg-intent-success/10 rounded-lg border p-4",
353
+ "dark:border-intent-success/20 dark:bg-intent-success/10",
354
+ className
355
+ ),
356
+ role: "status",
357
+ children: /* @__PURE__ */ jsxs3("div", { className: "flex gap-3", children: [
358
+ /* @__PURE__ */ jsx6(SuccessIcon, { className: "text-intent-success dark:text-intent-success size-5 shrink-0" }),
359
+ /* @__PURE__ */ jsx6("p", { className: "text-intent-success dark:text-intent-success text-sm", children: message })
360
+ ] })
361
+ }
362
+ );
363
+ }
364
+ function SuccessIcon({ className }) {
365
+ return /* @__PURE__ */ jsx6(
366
+ "svg",
367
+ {
368
+ className,
369
+ fill: "none",
370
+ viewBox: "0 0 24 24",
371
+ stroke: "currentColor",
372
+ strokeWidth: 2,
373
+ children: /* @__PURE__ */ jsx6(
374
+ "path",
375
+ {
376
+ strokeLinecap: "round",
377
+ strokeLinejoin: "round",
378
+ d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"
379
+ }
380
+ )
381
+ }
382
+ );
383
+ }
384
+
385
+ // src/global-error-content.tsx
386
+ import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
387
+ function GlobalErrorContent({
388
+ error,
389
+ reset,
390
+ appName,
391
+ supportEmail,
392
+ customActions
393
+ }) {
394
+ const handleRetry = () => {
395
+ reset();
396
+ };
397
+ const handleGoHome = () => {
398
+ if (typeof window !== "undefined") {
399
+ window.location.href = "/";
400
+ }
401
+ };
402
+ return /* @__PURE__ */ jsx7(
403
+ "div",
404
+ {
405
+ style: {
406
+ display: "flex",
407
+ minHeight: "100vh",
408
+ flexDirection: "column",
409
+ alignItems: "center",
410
+ justifyContent: "center",
411
+ padding: "1rem",
412
+ backgroundColor: "#f9fafb",
413
+ // gossamer-ignore
414
+ fontFamily: "system-ui, sans-serif"
415
+ },
416
+ children: /* @__PURE__ */ jsxs4(
417
+ "div",
418
+ {
419
+ style: {
420
+ width: "100%",
421
+ maxWidth: "28rem",
422
+ textAlign: "center"
423
+ },
424
+ children: [
425
+ /* @__PURE__ */ jsx7(
426
+ "div",
427
+ {
428
+ style: {
429
+ width: "4rem",
430
+ height: "4rem",
431
+ margin: "0 auto 1.5rem",
432
+ borderRadius: "50%",
433
+ backgroundColor: "#fee2e2",
434
+ // gossamer-ignore
435
+ display: "flex",
436
+ alignItems: "center",
437
+ justifyContent: "center"
438
+ },
439
+ children: /* @__PURE__ */ jsxs4(
440
+ "svg",
441
+ {
442
+ width: "32",
443
+ height: "32",
444
+ viewBox: "0 0 24 24",
445
+ fill: "none",
446
+ stroke: "#dc2626",
447
+ strokeWidth: "2",
448
+ strokeLinecap: "round",
449
+ strokeLinejoin: "round",
450
+ children: [
451
+ /* @__PURE__ */ jsx7("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
452
+ /* @__PURE__ */ jsx7("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
453
+ /* @__PURE__ */ jsx7("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
454
+ ]
455
+ }
456
+ )
457
+ }
458
+ ),
459
+ /* @__PURE__ */ jsx7(
460
+ "h1",
461
+ {
462
+ style: {
463
+ fontSize: "1.5rem",
464
+ fontWeight: "bold",
465
+ color: "#111827",
466
+ // gossamer-ignore
467
+ marginBottom: "0.5rem"
468
+ },
469
+ children: "Critical Application Error"
470
+ }
471
+ ),
472
+ /* @__PURE__ */ jsxs4(
473
+ "p",
474
+ {
475
+ style: {
476
+ color: "#6b7280",
477
+ // gossamer-ignore
478
+ marginBottom: "1.5rem",
479
+ lineHeight: 1.5
480
+ },
481
+ children: [
482
+ appName ? `${appName} encountered a critical error that prevented the page from loading.` : "We encountered a critical error that prevented the page from loading.",
483
+ " ",
484
+ "Our team has been automatically notified."
485
+ ]
486
+ }
487
+ ),
488
+ error.digest && /* @__PURE__ */ jsxs4(
489
+ "div",
490
+ {
491
+ style: {
492
+ backgroundColor: "#f3f4f6",
493
+ // gossamer-ignore
494
+ padding: "0.75rem",
495
+ borderRadius: "0.5rem",
496
+ marginBottom: "1.5rem"
497
+ },
498
+ children: [
499
+ /* @__PURE__ */ jsx7(
500
+ "p",
501
+ {
502
+ style: {
503
+ fontSize: "0.75rem",
504
+ color: "#9ca3af",
505
+ // gossamer-ignore
506
+ marginBottom: "0.25rem"
507
+ },
508
+ children: "Error Reference"
509
+ }
510
+ ),
511
+ /* @__PURE__ */ jsx7(
512
+ "code",
513
+ {
514
+ style: {
515
+ fontFamily: "monospace",
516
+ fontSize: "0.875rem",
517
+ color: "#374151"
518
+ // gossamer-ignore
519
+ },
520
+ children: error.digest
521
+ }
522
+ )
523
+ ]
524
+ }
525
+ ),
526
+ customActions ?? /* @__PURE__ */ jsxs4(
527
+ "div",
528
+ {
529
+ style: {
530
+ display: "flex",
531
+ flexDirection: "column",
532
+ gap: "0.75rem"
533
+ },
534
+ children: [
535
+ /* @__PURE__ */ jsxs4(
536
+ "button",
537
+ {
538
+ onClick: handleRetry,
539
+ style: {
540
+ width: "100%",
541
+ padding: "0.75rem 1rem",
542
+ backgroundColor: "#2563eb",
543
+ // gossamer-ignore
544
+ color: "white",
545
+ border: "none",
546
+ borderRadius: "0.5rem",
547
+ fontSize: "0.875rem",
548
+ fontWeight: 500,
549
+ cursor: "pointer",
550
+ display: "flex",
551
+ alignItems: "center",
552
+ justifyContent: "center",
553
+ gap: "0.5rem"
554
+ },
555
+ children: [
556
+ /* @__PURE__ */ jsx7(
557
+ "svg",
558
+ {
559
+ width: "16",
560
+ height: "16",
561
+ viewBox: "0 0 24 24",
562
+ fill: "none",
563
+ stroke: "currentColor",
564
+ strokeWidth: "2",
565
+ children: /* @__PURE__ */ jsx7("path", { d: "M23 4v6h-6M1 20v-6h6M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15" })
566
+ }
567
+ ),
568
+ "Try Again"
569
+ ]
570
+ }
571
+ ),
572
+ /* @__PURE__ */ jsxs4(
573
+ "button",
574
+ {
575
+ onClick: handleGoHome,
576
+ style: {
577
+ width: "100%",
578
+ padding: "0.75rem 1rem",
579
+ backgroundColor: "white",
580
+ color: "#374151",
581
+ // gossamer-ignore
582
+ border: "1px solid #d1d5db",
583
+ // gossamer-ignore
584
+ borderRadius: "0.5rem",
585
+ fontSize: "0.875rem",
586
+ fontWeight: 500,
587
+ cursor: "pointer",
588
+ display: "flex",
589
+ alignItems: "center",
590
+ justifyContent: "center",
591
+ gap: "0.5rem"
592
+ },
593
+ children: [
594
+ /* @__PURE__ */ jsxs4(
595
+ "svg",
596
+ {
597
+ width: "16",
598
+ height: "16",
599
+ viewBox: "0 0 24 24",
600
+ fill: "none",
601
+ stroke: "currentColor",
602
+ strokeWidth: "2",
603
+ children: [
604
+ /* @__PURE__ */ jsx7("path", { d: "M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2V9z" }),
605
+ /* @__PURE__ */ jsx7("polyline", { points: "9,22 9,12 15,12 15,22" })
606
+ ]
607
+ }
608
+ ),
609
+ "Go to Homepage"
610
+ ]
611
+ }
612
+ )
613
+ ]
614
+ }
615
+ ),
616
+ /* @__PURE__ */ jsxs4(
617
+ "p",
618
+ {
619
+ style: {
620
+ marginTop: "1.5rem",
621
+ fontSize: "0.75rem",
622
+ color: "#9ca3af"
623
+ // gossamer-ignore
624
+ },
625
+ children: [
626
+ "If this problem persists, please",
627
+ " ",
628
+ supportEmail ? /* @__PURE__ */ jsx7(
629
+ "a",
630
+ {
631
+ href: `mailto:${supportEmail}`,
632
+ style: { color: "#2563eb", textDecoration: "underline" },
633
+ children: "contact support"
634
+ }
635
+ ) : "contact support",
636
+ "."
637
+ ]
638
+ }
639
+ )
640
+ ]
641
+ }
642
+ )
643
+ }
644
+ );
645
+ }
646
+
647
+ // src/collapsible-sidebar.tsx
648
+ import {
649
+ useState,
650
+ useEffect,
651
+ useCallback,
652
+ createContext,
653
+ useContext
654
+ } from "react";
655
+ import { ChevronLeft, ChevronRight } from "lucide-react";
656
+ import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
657
+ var SidebarContext = createContext(null);
658
+ function useSidebar() {
659
+ const context = useContext(SidebarContext);
660
+ if (!context) {
661
+ throw new Error("useSidebar must be used within a CollapsibleSidebar");
662
+ }
663
+ return context;
664
+ }
665
+ var COLLAPSED_WIDTH = 64;
666
+ var EXPANDED_WIDTH = 256;
667
+ var DefaultLink = ({
668
+ href,
669
+ className,
670
+ children
671
+ }) => /* @__PURE__ */ jsx8("a", { href: String(href), className, children });
672
+ function CollapsibleSidebar({
673
+ storageKey = "sidebar-collapsed",
674
+ defaultCollapsed = false,
675
+ header,
676
+ collapsedHeader,
677
+ items,
678
+ isActive,
679
+ linkComponent: LinkComponent = DefaultLink,
680
+ footer,
681
+ collapsedFooter,
682
+ className,
683
+ collapsedWidth = COLLAPSED_WIDTH,
684
+ expandedWidth = EXPANDED_WIDTH
685
+ }) {
686
+ const [isCollapsed, setIsCollapsed] = useState(defaultCollapsed);
687
+ const [mounted, setMounted] = useState(false);
688
+ useEffect(() => {
689
+ setMounted(true);
690
+ const stored = localStorage.getItem(storageKey);
691
+ if (stored !== null) {
692
+ setIsCollapsed(stored === "true");
693
+ }
694
+ }, [storageKey]);
695
+ const toggle = useCallback(() => {
696
+ setIsCollapsed((prev) => {
697
+ const newValue = !prev;
698
+ localStorage.setItem(storageKey, String(newValue));
699
+ return newValue;
700
+ });
701
+ }, [storageKey]);
702
+ if (!mounted) {
703
+ return /* @__PURE__ */ jsx8(
704
+ "nav",
705
+ {
706
+ className: cn(
707
+ "hidden min-h-screen flex-col border-r bg-card lg:flex",
708
+ className
709
+ ),
710
+ style: { width: defaultCollapsed ? collapsedWidth : expandedWidth }
711
+ }
712
+ );
713
+ }
714
+ return /* @__PURE__ */ jsx8(SidebarContext.Provider, { value: { isCollapsed, toggle }, children: /* @__PURE__ */ jsx8(TooltipProvider, { delayDuration: 100, children: /* @__PURE__ */ jsxs5(
715
+ "nav",
716
+ {
717
+ className: cn(
718
+ "relative hidden min-h-screen flex-col border-r bg-card transition-all duration-300 ease-in-out lg:flex",
719
+ className
720
+ ),
721
+ style: { width: isCollapsed ? collapsedWidth : expandedWidth },
722
+ children: [
723
+ /* @__PURE__ */ jsx8(
724
+ "button",
725
+ {
726
+ onClick: toggle,
727
+ className: cn(
728
+ "absolute -right-3 top-6 z-10 flex size-6 items-center justify-center rounded-full border bg-card shadow-sm transition-colors hover:bg-muted"
729
+ ),
730
+ "aria-label": isCollapsed ? "Expand sidebar" : "Collapse sidebar",
731
+ children: isCollapsed ? /* @__PURE__ */ jsx8(ChevronRight, { className: "size-4" }) : /* @__PURE__ */ jsx8(ChevronLeft, { className: "size-4" })
732
+ }
733
+ ),
734
+ (header || collapsedHeader) && /* @__PURE__ */ jsx8(
735
+ "div",
736
+ {
737
+ className: cn(
738
+ "border-b p-4 transition-all duration-300",
739
+ isCollapsed ? "px-2" : "px-4"
740
+ ),
741
+ children: isCollapsed ? collapsedHeader || null : header
742
+ }
743
+ ),
744
+ /* @__PURE__ */ jsx8("div", { className: "flex-1 space-y-1 overflow-y-auto p-2", children: items.map((item) => {
745
+ const Icon = item.icon;
746
+ const active = isActive?.(item.href) ?? false;
747
+ const linkContent = /* @__PURE__ */ jsxs5(
748
+ LinkComponent,
749
+ {
750
+ href: item.href,
751
+ className: cn(
752
+ "flex items-center gap-3 rounded-lg px-3 py-2 transition-colors",
753
+ isCollapsed && "justify-center px-2",
754
+ active ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-muted hover:text-foreground"
755
+ ),
756
+ children: [
757
+ /* @__PURE__ */ jsx8(
758
+ Icon,
759
+ {
760
+ className: cn("size-5 shrink-0", isCollapsed && "size-5")
761
+ }
762
+ ),
763
+ !isCollapsed && /* @__PURE__ */ jsxs5("div", { className: "min-w-0 flex-1 overflow-hidden", children: [
764
+ /* @__PURE__ */ jsx8("div", { className: "truncate text-sm font-medium", children: item.name }),
765
+ item.description && /* @__PURE__ */ jsx8(
766
+ "div",
767
+ {
768
+ className: cn(
769
+ "truncate text-xs",
770
+ active ? "text-primary-foreground/80" : "text-muted-foreground"
771
+ ),
772
+ children: item.description
773
+ }
774
+ )
775
+ ] })
776
+ ]
777
+ }
778
+ );
779
+ if (isCollapsed) {
780
+ return /* @__PURE__ */ jsxs5(Tooltip, { children: [
781
+ /* @__PURE__ */ jsx8(TooltipTrigger, { asChild: true, children: linkContent }),
782
+ /* @__PURE__ */ jsxs5(TooltipContent, { side: "right", className: "flex flex-col", children: [
783
+ /* @__PURE__ */ jsx8("span", { className: "font-medium", children: item.name }),
784
+ item.description && /* @__PURE__ */ jsx8("span", { className: "text-xs text-muted-foreground", children: item.description })
785
+ ] })
786
+ ] }, item.href);
787
+ }
788
+ return /* @__PURE__ */ jsx8("div", { children: linkContent }, item.href);
789
+ }) }),
790
+ (footer || collapsedFooter) && /* @__PURE__ */ jsx8("div", { className: "mt-auto border-t p-2", children: isCollapsed ? collapsedFooter || null : footer })
791
+ ]
792
+ }
793
+ ) }) });
794
+ }
795
+
796
+ // src/accordion.tsx
797
+ import { createContext as createContext2, useContext as useContext2, useState as useState2, useCallback as useCallback2, useId as useId2 } from "react";
798
+ import { ChevronDown } from "lucide-react";
799
+ import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
800
+ var AccordionContext = createContext2(null);
801
+ var AccordionItemContext = createContext2(
802
+ null
803
+ );
804
+ function useAccordion() {
805
+ const context = useContext2(AccordionContext);
806
+ if (!context) {
807
+ throw new Error("Accordion components must be used within an Accordion");
808
+ }
809
+ return context;
810
+ }
811
+ function useAccordionItem() {
812
+ const context = useContext2(AccordionItemContext);
813
+ if (!context) {
814
+ throw new Error(
815
+ "AccordionTrigger/Content must be used within an AccordionItem"
816
+ );
817
+ }
818
+ return context;
819
+ }
820
+ function AccordionSingle({
821
+ value: controlledValue,
822
+ defaultValue = "",
823
+ onValueChange,
824
+ collapsible = true,
825
+ children,
826
+ className
827
+ }) {
828
+ const [uncontrolledValue, setUncontrolledValue] = useState2(defaultValue);
829
+ const isControlled = controlledValue !== void 0;
830
+ const value = isControlled ? controlledValue : uncontrolledValue;
831
+ const handleValueChange = useCallback2(
832
+ (itemValue) => {
833
+ const newValue = value === itemValue && collapsible ? "" : itemValue;
834
+ if (!isControlled) {
835
+ setUncontrolledValue(newValue);
836
+ }
837
+ onValueChange?.(newValue);
838
+ },
839
+ [value, collapsible, isControlled, onValueChange]
840
+ );
841
+ return /* @__PURE__ */ jsx9(
842
+ AccordionContext.Provider,
843
+ {
844
+ value: {
845
+ type: "single",
846
+ value,
847
+ onValueChange: handleValueChange
848
+ },
849
+ children: /* @__PURE__ */ jsx9("div", { className: cn("space-y-2", className), "data-accordion-root": "", children })
850
+ }
851
+ );
852
+ }
853
+ function AccordionMultiple({
854
+ value: controlledValue,
855
+ defaultValue = [],
856
+ onValueChange,
857
+ children,
858
+ className
859
+ }) {
860
+ const [uncontrolledValue, setUncontrolledValue] = useState2(defaultValue);
861
+ const isControlled = controlledValue !== void 0;
862
+ const value = isControlled ? controlledValue : uncontrolledValue;
863
+ const handleValueChange = useCallback2(
864
+ (itemValue) => {
865
+ const newValue = value.includes(itemValue) ? value.filter((v) => v !== itemValue) : [...value, itemValue];
866
+ if (!isControlled) {
867
+ setUncontrolledValue(newValue);
868
+ }
869
+ onValueChange?.(newValue);
870
+ },
871
+ [value, isControlled, onValueChange]
872
+ );
873
+ return /* @__PURE__ */ jsx9(
874
+ AccordionContext.Provider,
875
+ {
876
+ value: {
877
+ type: "multiple",
878
+ value,
879
+ onValueChange: handleValueChange
880
+ },
881
+ children: /* @__PURE__ */ jsx9("div", { className: cn("space-y-2", className), "data-accordion-root": "", children })
882
+ }
883
+ );
884
+ }
885
+ function Accordion(props) {
886
+ if (props.type === "multiple") {
887
+ return /* @__PURE__ */ jsx9(AccordionMultiple, { ...props });
888
+ }
889
+ return /* @__PURE__ */ jsx9(AccordionSingle, { ...props });
890
+ }
891
+ function AccordionItem({
892
+ value,
893
+ children,
894
+ className,
895
+ disabled = false,
896
+ testId
897
+ }) {
898
+ const { value: accordionValue, type } = useAccordion();
899
+ const uniqueId = useId2();
900
+ const triggerId = `accordion-trigger-${uniqueId}`;
901
+ const contentId = `accordion-content-${uniqueId}`;
902
+ const isOpen = type === "single" ? accordionValue === value : accordionValue.includes(value);
903
+ return /* @__PURE__ */ jsx9(
904
+ AccordionItemContext.Provider,
905
+ {
906
+ value: { value, isOpen, triggerId, contentId },
907
+ children: /* @__PURE__ */ jsx9(
908
+ "div",
909
+ {
910
+ className: cn(
911
+ "rounded-lg border border-border bg-card transition-colors dark:border-border dark:bg-card",
912
+ disabled && "pointer-events-none opacity-50",
913
+ className
914
+ ),
915
+ "data-state": isOpen ? "open" : "closed",
916
+ "data-disabled": disabled || void 0,
917
+ "data-testid": testId,
918
+ children
919
+ }
920
+ )
921
+ }
922
+ );
923
+ }
924
+ function AccordionTrigger({
925
+ children,
926
+ className,
927
+ icon,
928
+ rightContent,
929
+ testId
930
+ }) {
931
+ const { onValueChange } = useAccordion();
932
+ const { value, isOpen, triggerId, contentId } = useAccordionItem();
933
+ return /* @__PURE__ */ jsxs6(
934
+ "button",
935
+ {
936
+ id: triggerId,
937
+ type: "button",
938
+ onClick: () => onValueChange(value),
939
+ className: cn(
940
+ "flex w-full items-center justify-between gap-3 p-4 text-left font-medium",
941
+ "text-foreground transition-colors hover:bg-muted/50 dark:text-foreground dark:hover:bg-muted/50",
942
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
943
+ "rounded-lg",
944
+ className
945
+ ),
946
+ "aria-expanded": isOpen,
947
+ "aria-controls": contentId,
948
+ "data-state": isOpen ? "open" : "closed",
949
+ "data-testid": testId,
950
+ children: [
951
+ /* @__PURE__ */ jsxs6("span", { className: "flex items-center gap-3", children: [
952
+ icon && /* @__PURE__ */ jsx9("span", { className: "shrink-0", children: icon }),
953
+ /* @__PURE__ */ jsx9("span", { children })
954
+ ] }),
955
+ /* @__PURE__ */ jsxs6("span", { className: "flex items-center gap-2", children: [
956
+ rightContent,
957
+ /* @__PURE__ */ jsx9(
958
+ ChevronDown,
959
+ {
960
+ className: cn(
961
+ "size-5 shrink-0 text-muted-foreground transition-transform duration-300 [transition-timing-function:cubic-bezier(0.32,0.72,0,1)]",
962
+ isOpen && "rotate-180"
963
+ ),
964
+ "aria-hidden": "true"
965
+ }
966
+ )
967
+ ] })
968
+ ]
969
+ }
970
+ );
971
+ }
972
+ function AccordionContent({
973
+ children,
974
+ className,
975
+ testId
976
+ }) {
977
+ const { isOpen, contentId, triggerId } = useAccordionItem();
978
+ return /* @__PURE__ */ jsx9(
979
+ "div",
980
+ {
981
+ id: contentId,
982
+ role: "region",
983
+ "aria-labelledby": triggerId,
984
+ "data-state": isOpen ? "open" : "closed",
985
+ "data-testid": testId,
986
+ className: cn(
987
+ // CSS Grid trick for smooth height animation
988
+ // Premium easing: cubic-bezier(0.32, 0.72, 0, 1) - Apple-style smoothness
989
+ "grid transition-all duration-300 [transition-timing-function:cubic-bezier(0.32,0.72,0,1)]",
990
+ isOpen ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"
991
+ ),
992
+ children: /* @__PURE__ */ jsx9("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx9("div", { className: cn("px-4 pb-4", className), children }) })
993
+ }
994
+ );
995
+ }
996
+ function SimpleAccordion({
997
+ title,
998
+ icon,
999
+ rightContent,
1000
+ defaultOpen = false,
1001
+ open: controlledOpen,
1002
+ onOpenChange,
1003
+ children,
1004
+ className,
1005
+ triggerClassName,
1006
+ contentClassName,
1007
+ triggerTestId,
1008
+ contentTestId
1009
+ }) {
1010
+ const [uncontrolledOpen, setUncontrolledOpen] = useState2(defaultOpen);
1011
+ const isControlled = controlledOpen !== void 0;
1012
+ const isOpen = isControlled ? controlledOpen : uncontrolledOpen;
1013
+ const uniqueId = useId2();
1014
+ const triggerId = `simple-accordion-trigger-${uniqueId}`;
1015
+ const contentId = `simple-accordion-content-${uniqueId}`;
1016
+ const toggle = useCallback2(() => {
1017
+ const newValue = !isOpen;
1018
+ if (!isControlled) {
1019
+ setUncontrolledOpen(newValue);
1020
+ }
1021
+ onOpenChange?.(newValue);
1022
+ }, [isOpen, isControlled, onOpenChange]);
1023
+ return /* @__PURE__ */ jsxs6(
1024
+ "div",
1025
+ {
1026
+ className: cn(
1027
+ "rounded-lg border border-border bg-card dark:border-border dark:bg-card",
1028
+ className
1029
+ ),
1030
+ "data-state": isOpen ? "open" : "closed",
1031
+ children: [
1032
+ /* @__PURE__ */ jsxs6(
1033
+ "button",
1034
+ {
1035
+ id: triggerId,
1036
+ type: "button",
1037
+ onClick: toggle,
1038
+ className: cn(
1039
+ "flex w-full items-center justify-between gap-3 p-4 text-left font-medium",
1040
+ "text-foreground transition-colors hover:bg-muted/50 dark:text-foreground dark:hover:bg-muted/50",
1041
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
1042
+ "rounded-lg",
1043
+ triggerClassName
1044
+ ),
1045
+ "aria-expanded": isOpen,
1046
+ "aria-controls": contentId,
1047
+ "data-state": isOpen ? "open" : "closed",
1048
+ "data-testid": triggerTestId,
1049
+ children: [
1050
+ /* @__PURE__ */ jsxs6("span", { className: "flex items-center gap-3", children: [
1051
+ icon && /* @__PURE__ */ jsx9("span", { className: "shrink-0", children: icon }),
1052
+ /* @__PURE__ */ jsx9("span", { children: title })
1053
+ ] }),
1054
+ /* @__PURE__ */ jsxs6("span", { className: "flex items-center gap-2", children: [
1055
+ rightContent,
1056
+ /* @__PURE__ */ jsx9(
1057
+ ChevronDown,
1058
+ {
1059
+ className: cn(
1060
+ "size-5 shrink-0 text-muted-foreground transition-transform duration-300 [transition-timing-function:cubic-bezier(0.32,0.72,0,1)]",
1061
+ isOpen && "rotate-180"
1062
+ ),
1063
+ "aria-hidden": "true"
1064
+ }
1065
+ )
1066
+ ] })
1067
+ ]
1068
+ }
1069
+ ),
1070
+ /* @__PURE__ */ jsx9(
1071
+ "div",
1072
+ {
1073
+ id: contentId,
1074
+ role: "region",
1075
+ "aria-labelledby": triggerId,
1076
+ "data-state": isOpen ? "open" : "closed",
1077
+ "data-testid": contentTestId,
1078
+ className: cn(
1079
+ // Premium easing: cubic-bezier(0.32, 0.72, 0, 1) - Apple-style smoothness
1080
+ "grid transition-all duration-300 [transition-timing-function:cubic-bezier(0.32,0.72,0,1)]",
1081
+ isOpen ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"
1082
+ ),
1083
+ children: /* @__PURE__ */ jsx9("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx9("div", { className: cn("px-4 pb-4", contentClassName), children }) })
1084
+ }
1085
+ )
1086
+ ]
1087
+ }
1088
+ );
1089
+ }
1090
+
1091
+ // src/confirm-dialog.tsx
1092
+ import * as React6 from "react";
1093
+ import { Loader2 as Loader22 } from "lucide-react";
1094
+ import { Fragment as Fragment2, jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
1095
+ function ConfirmDialog({
1096
+ title,
1097
+ message,
1098
+ confirmLabel,
1099
+ onConfirm,
1100
+ onCancel,
1101
+ isLoading = false,
1102
+ confirmTestId,
1103
+ cancelTestId,
1104
+ dialogTestId,
1105
+ cancelLabel = "Cancel",
1106
+ confirmVariant = "default",
1107
+ className
1108
+ }) {
1109
+ React6.useEffect(() => {
1110
+ function handleKeyDown(e) {
1111
+ if (e.key === "Escape" && !isLoading) {
1112
+ onCancel();
1113
+ }
1114
+ }
1115
+ document.addEventListener("keydown", handleKeyDown);
1116
+ return () => document.removeEventListener("keydown", handleKeyDown);
1117
+ }, [onCancel, isLoading]);
1118
+ return /* @__PURE__ */ jsx10(
1119
+ "div",
1120
+ {
1121
+ className: "fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm dark:bg-background/80",
1122
+ role: "dialog",
1123
+ "aria-modal": "true",
1124
+ "aria-labelledby": "confirm-dialog-title",
1125
+ "aria-describedby": "confirm-dialog-description",
1126
+ "data-testid": dialogTestId,
1127
+ children: /* @__PURE__ */ jsxs7(
1128
+ "div",
1129
+ {
1130
+ className: cn(
1131
+ "mx-4 w-full max-w-md rounded-lg border border-border bg-card p-6 shadow-lg dark:border-border dark:bg-card",
1132
+ "duration-200 animate-in fade-in-0 zoom-in-95",
1133
+ className
1134
+ ),
1135
+ children: [
1136
+ /* @__PURE__ */ jsx10(
1137
+ "h3",
1138
+ {
1139
+ id: "confirm-dialog-title",
1140
+ className: "text-lg font-semibold text-foreground dark:text-foreground",
1141
+ children: title
1142
+ }
1143
+ ),
1144
+ /* @__PURE__ */ jsx10(
1145
+ "p",
1146
+ {
1147
+ id: "confirm-dialog-description",
1148
+ className: "mt-2 text-muted-foreground dark:text-muted-foreground",
1149
+ children: message
1150
+ }
1151
+ ),
1152
+ /* @__PURE__ */ jsxs7("div", { className: "mt-6 flex justify-end gap-3", children: [
1153
+ /* @__PURE__ */ jsx10(
1154
+ Button,
1155
+ {
1156
+ variant: "ghost",
1157
+ onClick: onCancel,
1158
+ disabled: isLoading,
1159
+ "data-testid": cancelTestId,
1160
+ children: cancelLabel
1161
+ }
1162
+ ),
1163
+ /* @__PURE__ */ jsx10(
1164
+ Button,
1165
+ {
1166
+ variant: confirmVariant,
1167
+ onClick: onConfirm,
1168
+ disabled: isLoading,
1169
+ "data-testid": confirmTestId,
1170
+ children: isLoading ? /* @__PURE__ */ jsxs7(Fragment2, { children: [
1171
+ /* @__PURE__ */ jsx10(Loader22, { className: "mr-2 size-4 animate-spin" }),
1172
+ confirmLabel,
1173
+ "..."
1174
+ ] }) : confirmLabel
1175
+ }
1176
+ )
1177
+ ] })
1178
+ ]
1179
+ }
1180
+ )
1181
+ }
1182
+ );
1183
+ }
1184
+
1185
+ // src/dicebear-avatar.tsx
1186
+ import * as React7 from "react";
1187
+ import { cva as cva2 } from "class-variance-authority";
1188
+ import { jsx as jsx11 } from "react/jsx-runtime";
1189
+ var avatarVariants = cva2(
1190
+ "relative inline-flex shrink-0 overflow-hidden rounded-full bg-muted dark:bg-muted",
1191
+ {
1192
+ variants: {
1193
+ size: {
1194
+ xs: "h-6 w-6",
1195
+ sm: "h-8 w-8",
1196
+ md: "h-10 w-10",
1197
+ lg: "h-12 w-12",
1198
+ xl: "h-16 w-16",
1199
+ "2xl": "h-20 w-20"
1200
+ }
1201
+ },
1202
+ defaultVariants: {
1203
+ size: "md"
1204
+ }
1205
+ }
1206
+ );
1207
+ var DICEBEAR_BASE_URL = "https://api.dicebear.com/9.x";
1208
+ function buildDiceBearUrl(seed, style = "adventurer-neutral") {
1209
+ const encodedSeed = encodeURIComponent(seed);
1210
+ return `${DICEBEAR_BASE_URL}/${style}/svg?seed=${encodedSeed}`;
1211
+ }
1212
+ var DiceBearAvatar = React7.forwardRef(
1213
+ ({
1214
+ seed,
1215
+ avatarStyle = "adventurer-neutral",
1216
+ size,
1217
+ alt = "Avatar",
1218
+ fallback,
1219
+ className,
1220
+ ...props
1221
+ }, ref) => {
1222
+ const [hasError, setHasError] = React7.useState(false);
1223
+ const url = buildDiceBearUrl(seed, avatarStyle);
1224
+ React7.useEffect(() => {
1225
+ setHasError(false);
1226
+ }, [seed, avatarStyle]);
1227
+ return /* @__PURE__ */ jsx11(
1228
+ "div",
1229
+ {
1230
+ ref,
1231
+ className: cn(avatarVariants({ size }), className),
1232
+ ...props,
1233
+ children: hasError ? fallback ? /* @__PURE__ */ jsx11("div", { className: "flex h-full w-full items-center justify-center text-xs font-medium text-muted-foreground dark:text-muted-foreground", children: fallback }) : /* @__PURE__ */ jsx11("div", { className: "flex h-full w-full items-center justify-center bg-primary/10 text-xs font-medium text-primary dark:bg-primary/10 dark:text-primary", children: seed.charAt(0).toUpperCase() }) : /* @__PURE__ */ jsx11(
1234
+ "img",
1235
+ {
1236
+ src: url,
1237
+ alt,
1238
+ className: "h-full w-full object-cover",
1239
+ onError: () => setHasError(true)
1240
+ }
1241
+ )
1242
+ }
1243
+ );
1244
+ }
1245
+ );
1246
+ DiceBearAvatar.displayName = "DiceBearAvatar";
1247
+
1248
+ // src/intent-icon.tsx
1249
+ import { Check, AlertTriangle, X, Info } from "lucide-react";
1250
+ import { jsx as jsx12 } from "react/jsx-runtime";
1251
+ var intentConfig = {
1252
+ success: {
1253
+ outerBg: "bg-[rgba(33,196,93,0.10)] dark:bg-[rgba(33,196,93,0.10)]",
1254
+ innerBg: "bg-[rgba(33,196,93,0.20)] dark:bg-[rgba(33,196,93,0.20)]",
1255
+ iconColor: "text-[#21c45d] dark:text-[#21c45d]",
1256
+ Icon: Check
1257
+ },
1258
+ warning: {
1259
+ outerBg: "bg-[rgba(245,159,10,0.10)] dark:bg-[rgba(245,159,10,0.10)]",
1260
+ innerBg: "bg-[rgba(245,159,10,0.20)] dark:bg-[rgba(245,159,10,0.20)]",
1261
+ iconColor: "text-[#f59f0a] dark:text-[#f59f0a]",
1262
+ Icon: AlertTriangle
1263
+ },
1264
+ error: {
1265
+ outerBg: "bg-[rgba(239,67,67,0.10)] dark:bg-[rgba(239,67,67,0.10)]",
1266
+ innerBg: "bg-[rgba(239,67,67,0.20)] dark:bg-[rgba(239,67,67,0.20)]",
1267
+ iconColor: "text-[#ef4343] dark:text-[#ef4343]",
1268
+ Icon: X
1269
+ },
1270
+ info: {
1271
+ outerBg: "bg-[rgba(60,131,246,0.10)] dark:bg-[rgba(60,131,246,0.10)]",
1272
+ innerBg: "bg-[rgba(60,131,246,0.20)] dark:bg-[rgba(60,131,246,0.20)]",
1273
+ iconColor: "text-[#3c83f6] dark:text-[#3c83f6]",
1274
+ Icon: Info
1275
+ }
1276
+ };
1277
+ var sizeConfig = {
1278
+ md: {
1279
+ outer: "w-[80px] h-[80px] rounded-[40px]",
1280
+ inner: "w-[48px] h-[48px] rounded-[24px]",
1281
+ iconSize: 24
1282
+ },
1283
+ sm: {
1284
+ outer: "w-[48px] h-[48px] rounded-[24px]",
1285
+ inner: "w-[28px] h-[28px] rounded-[14px]",
1286
+ iconSize: 14
1287
+ }
1288
+ };
1289
+ function IntentIcon({
1290
+ intent = "success",
1291
+ size = "md"
1292
+ }) {
1293
+ const { outerBg, innerBg, iconColor, Icon } = intentConfig[intent];
1294
+ const { outer, inner, iconSize } = sizeConfig[size];
1295
+ return /* @__PURE__ */ jsx12(
1296
+ "div",
1297
+ {
1298
+ "data-testid": "intent-icon",
1299
+ className: `${outer} ${outerBg} flex items-center justify-center`,
1300
+ children: /* @__PURE__ */ jsx12("div", { className: `${inner} ${innerBg} flex items-center justify-center`, children: /* @__PURE__ */ jsx12(Icon, { className: iconColor, size: iconSize }) })
1301
+ }
1302
+ );
1303
+ }
1304
+
1305
+ // src/section-heading.tsx
1306
+ import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
1307
+ var sizeConfig2 = {
1308
+ display: {
1309
+ className: "text-4xl font-bold leading-10",
1310
+ tag: "p"
1311
+ },
1312
+ h1: {
1313
+ className: "text-[28px] font-bold leading-[34px]",
1314
+ tag: "h1"
1315
+ },
1316
+ h2: {
1317
+ className: "text-2xl font-semibold leading-[30px]",
1318
+ tag: "h2"
1319
+ },
1320
+ h3: {
1321
+ className: "text-xl font-bold leading-[26px]",
1322
+ tag: "h3"
1323
+ }
1324
+ };
1325
+ function SectionHeading({
1326
+ title,
1327
+ description,
1328
+ align = "center",
1329
+ size = "h1"
1330
+ }) {
1331
+ const { className: sizeClass, tag: Tag } = sizeConfig2[size];
1332
+ return /* @__PURE__ */ jsxs8(
1333
+ "div",
1334
+ {
1335
+ "data-testid": "section-heading",
1336
+ className: cn(
1337
+ "flex max-w-[480px] flex-col gap-2",
1338
+ align === "center" && "items-center text-center",
1339
+ align === "left" && "items-start text-left"
1340
+ ),
1341
+ children: [
1342
+ /* @__PURE__ */ jsx13(Tag, { className: cn("text-foreground dark:text-foreground", sizeClass), children: title }),
1343
+ description && /* @__PURE__ */ jsx13("p", { className: "text-sm font-normal leading-[21px] text-muted-foreground dark:text-muted-foreground", children: description })
1344
+ ]
1345
+ }
1346
+ );
1347
+ }
1348
+
1349
+ // src/filter-chip.tsx
1350
+ import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
1351
+ function FilterChip({
1352
+ label,
1353
+ active = false,
1354
+ count,
1355
+ size = "md",
1356
+ onClick
1357
+ }) {
1358
+ return /* @__PURE__ */ jsxs9(
1359
+ "button",
1360
+ {
1361
+ type: "button",
1362
+ "data-testid": "filter-chip",
1363
+ "data-active": active ? "true" : "false",
1364
+ onClick,
1365
+ className: cn(
1366
+ // Base
1367
+ "inline-flex cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap border font-medium transition-colors",
1368
+ // Size
1369
+ size === "md" && "h-8 rounded-md px-3 text-[13px]",
1370
+ size === "sm" && "h-7 rounded-md px-2.5 text-xs",
1371
+ // State — inactive
1372
+ !active && "border-border bg-background text-muted-foreground dark:border-border dark:bg-background dark:text-muted-foreground",
1373
+ // State — active
1374
+ active && "border-foreground bg-foreground text-background dark:border-foreground dark:bg-foreground dark:text-background",
1375
+ // Hover
1376
+ !active && "hover:bg-muted dark:hover:bg-muted",
1377
+ active && "hover:bg-foreground/90 dark:hover:bg-foreground/90"
1378
+ ),
1379
+ children: [
1380
+ label,
1381
+ count != null && /* @__PURE__ */ jsx14(
1382
+ "span",
1383
+ {
1384
+ className: cn(
1385
+ "inline-flex items-center justify-center rounded-full px-[5px] text-[11px] font-semibold",
1386
+ "h-[18px] min-w-[18px]",
1387
+ !active && "bg-muted text-muted-foreground dark:bg-muted dark:text-muted-foreground",
1388
+ active && "bg-background/30 text-background dark:bg-background/30 dark:text-background"
1389
+ ),
1390
+ children: count
1391
+ }
1392
+ )
1393
+ ]
1394
+ }
1395
+ );
1396
+ }
1397
+
1398
+ // src/distribution-chip.tsx
1399
+ import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
1400
+ function DistributionChip({
1401
+ count,
1402
+ label,
1403
+ dotClass,
1404
+ testId
1405
+ }) {
1406
+ return /* @__PURE__ */ jsxs10(
1407
+ "span",
1408
+ {
1409
+ "data-testid": testId,
1410
+ className: "inline-flex items-center gap-1.5 rounded-full border border-border bg-card px-3 py-1 text-sm font-medium text-foreground",
1411
+ children: [
1412
+ /* @__PURE__ */ jsx15("span", { className: `size-2 rounded-full ${dotClass}` }),
1413
+ /* @__PURE__ */ jsx15("span", { className: "tabular-nums", children: count }),
1414
+ /* @__PURE__ */ jsx15("span", { className: "text-muted-foreground", children: label })
1415
+ ]
1416
+ }
1417
+ );
1418
+ }
1419
+
1420
+ // src/skeleton-bar.tsx
1421
+ import { jsx as jsx16 } from "react/jsx-runtime";
1422
+ function SkeletonBar({
1423
+ width = "full",
1424
+ height = 14,
1425
+ className = ""
1426
+ }) {
1427
+ return /* @__PURE__ */ jsx16(
1428
+ "div",
1429
+ {
1430
+ "data-testid": "skeleton-bar",
1431
+ className: cn(
1432
+ "animate-pulse rounded-full bg-muted dark:bg-muted",
1433
+ width === "full" ? "w-full" : "",
1434
+ className
1435
+ ),
1436
+ style: {
1437
+ height: `${height}px`,
1438
+ ...width !== "full" ? { width: `${width}px` } : {}
1439
+ }
1440
+ }
1441
+ );
1442
+ }
1443
+
1444
+ // src/skeleton-card.tsx
1445
+ import { jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
1446
+ function SkeletonCard({ className = "" }) {
1447
+ return /* @__PURE__ */ jsxs11(
1448
+ "div",
1449
+ {
1450
+ "data-testid": "skeleton-card",
1451
+ className: cn(
1452
+ "flex w-full flex-col gap-2.5 rounded-xl border border-border bg-card p-5 dark:border-border dark:bg-card",
1453
+ className
1454
+ ),
1455
+ children: [
1456
+ /* @__PURE__ */ jsx17(SkeletonBar, { width: 80, height: 10 }),
1457
+ /* @__PURE__ */ jsx17(SkeletonBar, { width: 60, height: 24 }),
1458
+ /* @__PURE__ */ jsx17(SkeletonBar, { width: 100, height: 10 })
1459
+ ]
1460
+ }
1461
+ );
1462
+ }
1463
+
1464
+ // src/skeleton-row.tsx
1465
+ import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
1466
+ function SkeletonRow({ className = "" }) {
1467
+ return /* @__PURE__ */ jsxs12(
1468
+ "div",
1469
+ {
1470
+ "data-testid": "skeleton-row",
1471
+ className: cn(
1472
+ "flex w-full items-center gap-3.5 rounded-[10px] border border-border bg-card px-[18px] py-[14px] dark:border-border dark:bg-card",
1473
+ className
1474
+ ),
1475
+ children: [
1476
+ /* @__PURE__ */ jsx18("div", { className: "h-9 w-9 flex-shrink-0 animate-pulse rounded-full bg-muted dark:bg-muted" }),
1477
+ /* @__PURE__ */ jsxs12("div", { className: "flex flex-1 flex-col gap-1.5", children: [
1478
+ /* @__PURE__ */ jsx18(SkeletonBar, { width: 200, height: 12 }),
1479
+ /* @__PURE__ */ jsx18(SkeletonBar, { width: 140, height: 10 })
1480
+ ] })
1481
+ ]
1482
+ }
1483
+ );
1484
+ }
1485
+
1486
+ // src/stacked-list.tsx
1487
+ import * as React8 from "react";
1488
+ import { jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
1489
+ var StackedList = React8.forwardRef(
1490
+ ({ className, divided = true, density = "default", ...props }, ref) => /* @__PURE__ */ jsx19(
1491
+ "ul",
1492
+ {
1493
+ ref,
1494
+ role: "list",
1495
+ className: cn("w-full", divided && "divide-y divide-border", className),
1496
+ "data-density": density,
1497
+ ...props
1498
+ }
1499
+ )
1500
+ );
1501
+ StackedList.displayName = "StackedList";
1502
+ var StackedListItem = React8.forwardRef(
1503
+ ({
1504
+ className,
1505
+ avatar,
1506
+ title,
1507
+ description,
1508
+ meta,
1509
+ action,
1510
+ density = "default",
1511
+ ...props
1512
+ }, ref) => /* @__PURE__ */ jsxs13(
1513
+ "li",
1514
+ {
1515
+ ref,
1516
+ className: cn(
1517
+ "flex items-center gap-4",
1518
+ density === "compact" ? "px-3 py-2" : "px-4 py-4",
1519
+ className
1520
+ ),
1521
+ ...props,
1522
+ children: [
1523
+ avatar && /* @__PURE__ */ jsx19("div", { className: "flex-shrink-0", children: avatar }),
1524
+ /* @__PURE__ */ jsxs13("div", { className: "min-w-0 flex-1", children: [
1525
+ /* @__PURE__ */ jsx19(
1526
+ "p",
1527
+ {
1528
+ className: cn(
1529
+ "truncate font-medium text-foreground",
1530
+ density === "compact" ? "text-sm" : "text-base"
1531
+ ),
1532
+ children: title
1533
+ }
1534
+ ),
1535
+ description && /* @__PURE__ */ jsx19(
1536
+ "p",
1537
+ {
1538
+ className: cn(
1539
+ "truncate text-muted-foreground",
1540
+ density === "compact" ? "text-xs" : "text-sm"
1541
+ ),
1542
+ children: description
1543
+ }
1544
+ )
1545
+ ] }),
1546
+ meta && /* @__PURE__ */ jsx19("span", { className: "flex-shrink-0 text-sm text-muted-foreground", children: meta }),
1547
+ action && /* @__PURE__ */ jsx19("div", { className: "flex-shrink-0", children: action })
1548
+ ]
1549
+ }
1550
+ )
1551
+ );
1552
+ StackedListItem.displayName = "StackedListItem";
1553
+
1554
+ // src/grid-list.tsx
1555
+ import * as React9 from "react";
1556
+ import { jsx as jsx20 } from "react/jsx-runtime";
1557
+ var COLUMN_CLASSES = {
1558
+ 2: "grid-cols-1 sm:grid-cols-2",
1559
+ 3: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",
1560
+ 4: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4"
1561
+ };
1562
+ var GAP_CLASSES = {
1563
+ sm: "gap-3",
1564
+ md: "gap-4",
1565
+ lg: "gap-6"
1566
+ };
1567
+ var GridList = React9.forwardRef(
1568
+ ({ className, columns = 3, gap = "md", ...props }, ref) => /* @__PURE__ */ jsx20(
1569
+ "div",
1570
+ {
1571
+ ref,
1572
+ className: cn(
1573
+ "grid",
1574
+ COLUMN_CLASSES[columns],
1575
+ GAP_CLASSES[gap],
1576
+ className
1577
+ ),
1578
+ ...props
1579
+ }
1580
+ )
1581
+ );
1582
+ GridList.displayName = "GridList";
1583
+ var GridListItem = React9.forwardRef(
1584
+ ({ className, hoverable = false, ...props }, ref) => /* @__PURE__ */ jsx20(
1585
+ "div",
1586
+ {
1587
+ ref,
1588
+ className: cn(
1589
+ "rounded-lg border bg-card p-4 text-card-foreground shadow-sm",
1590
+ hoverable && "duration-fast cursor-pointer transition-shadow hover:shadow-md",
1591
+ className
1592
+ ),
1593
+ ...props
1594
+ }
1595
+ )
1596
+ );
1597
+ GridListItem.displayName = "GridListItem";
1598
+
1599
+ // src/pagination.tsx
1600
+ import * as React10 from "react";
1601
+ import { jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
1602
+ function getPageRange(current, total, siblings) {
1603
+ const range = [];
1604
+ const left = Math.max(2, current - siblings);
1605
+ const right = Math.min(total - 1, current + siblings);
1606
+ range.push(1);
1607
+ if (left > 2) range.push("ellipsis");
1608
+ for (let i = left; i <= right; i++) range.push(i);
1609
+ if (right < total - 1) range.push("ellipsis");
1610
+ if (total > 1) range.push(total);
1611
+ return range;
1612
+ }
1613
+ var PaginationButton = React10.forwardRef(({ className, active, disabled, ...props }, ref) => /* @__PURE__ */ jsx21(
1614
+ "button",
1615
+ {
1616
+ ref,
1617
+ type: "button",
1618
+ disabled,
1619
+ className: cn(
1620
+ "inline-flex h-9 min-w-9 items-center justify-center rounded-md px-3 text-sm font-medium transition-colors",
1621
+ active ? "bg-primary text-primary-foreground" : "bg-background text-foreground hover:bg-muted",
1622
+ disabled && "opacity-disabled pointer-events-none",
1623
+ "border border-input",
1624
+ className
1625
+ ),
1626
+ ...props
1627
+ }
1628
+ ));
1629
+ PaginationButton.displayName = "PaginationButton";
1630
+ var Pagination = React10.forwardRef(
1631
+ ({
1632
+ className,
1633
+ currentPage,
1634
+ totalPages,
1635
+ onPageChange,
1636
+ variant = "numbered",
1637
+ siblingCount = 1,
1638
+ ...props
1639
+ }, ref) => {
1640
+ const handleChange = (page) => {
1641
+ if (page >= 1 && page <= totalPages && onPageChange) {
1642
+ onPageChange(page);
1643
+ }
1644
+ };
1645
+ if (variant === "simple") {
1646
+ return /* @__PURE__ */ jsxs14(
1647
+ "nav",
1648
+ {
1649
+ ref,
1650
+ "aria-label": "Pagination",
1651
+ className: cn("flex items-center justify-between", className),
1652
+ ...props,
1653
+ children: [
1654
+ /* @__PURE__ */ jsx21(
1655
+ PaginationButton,
1656
+ {
1657
+ onClick: () => handleChange(currentPage - 1),
1658
+ disabled: currentPage <= 1,
1659
+ children: "Previous"
1660
+ }
1661
+ ),
1662
+ /* @__PURE__ */ jsxs14("span", { className: "text-sm text-muted-foreground", children: [
1663
+ "Page ",
1664
+ currentPage,
1665
+ " of ",
1666
+ totalPages
1667
+ ] }),
1668
+ /* @__PURE__ */ jsx21(
1669
+ PaginationButton,
1670
+ {
1671
+ onClick: () => handleChange(currentPage + 1),
1672
+ disabled: currentPage >= totalPages,
1673
+ children: "Next"
1674
+ }
1675
+ )
1676
+ ]
1677
+ }
1678
+ );
1679
+ }
1680
+ const pages = getPageRange(currentPage, totalPages, siblingCount);
1681
+ return /* @__PURE__ */ jsxs14(
1682
+ "nav",
1683
+ {
1684
+ ref,
1685
+ "aria-label": "Pagination",
1686
+ className: cn(
1687
+ "flex items-center gap-1",
1688
+ variant === "centered" && "justify-center",
1689
+ className
1690
+ ),
1691
+ ...props,
1692
+ children: [
1693
+ /* @__PURE__ */ jsx21(
1694
+ PaginationButton,
1695
+ {
1696
+ onClick: () => handleChange(currentPage - 1),
1697
+ disabled: currentPage <= 1,
1698
+ children: "Previous"
1699
+ }
1700
+ ),
1701
+ pages.map(
1702
+ (page, i) => page === "ellipsis" ? /* @__PURE__ */ jsx21(
1703
+ "span",
1704
+ {
1705
+ className: "inline-flex h-9 min-w-9 items-center justify-center text-sm text-muted-foreground",
1706
+ children: "..."
1707
+ },
1708
+ `ellipsis-${i}`
1709
+ ) : /* @__PURE__ */ jsx21(
1710
+ PaginationButton,
1711
+ {
1712
+ active: page === currentPage,
1713
+ onClick: () => handleChange(page),
1714
+ children: page
1715
+ },
1716
+ page
1717
+ )
1718
+ ),
1719
+ /* @__PURE__ */ jsx21(
1720
+ PaginationButton,
1721
+ {
1722
+ onClick: () => handleChange(currentPage + 1),
1723
+ disabled: currentPage >= totalPages,
1724
+ children: "Next"
1725
+ }
1726
+ )
1727
+ ]
1728
+ }
1729
+ );
1730
+ }
1731
+ );
1732
+ Pagination.displayName = "Pagination";
1733
+
1734
+ // src/stepper.tsx
1735
+ import * as React11 from "react";
1736
+ import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
1737
+ var StepContext = React11.createContext({
1738
+ index: 0,
1739
+ activeStep: 0,
1740
+ isLast: false,
1741
+ variant: "horizontal",
1742
+ size: "md"
1743
+ });
1744
+ var INDICATOR_SIZE = {
1745
+ sm: "h-6 w-6 text-xs",
1746
+ md: "h-8 w-8 text-sm",
1747
+ lg: "h-10 w-10 text-base"
1748
+ };
1749
+ var LABEL_SIZE = {
1750
+ sm: "text-xs",
1751
+ md: "text-sm",
1752
+ lg: "text-base"
1753
+ };
1754
+ var StepperStep = React11.forwardRef(
1755
+ ({
1756
+ className,
1757
+ label,
1758
+ description,
1759
+ icon,
1760
+ error,
1761
+ disabled,
1762
+ completed,
1763
+ href,
1764
+ ...props
1765
+ }, ref) => {
1766
+ const { index, activeStep, isLast, variant, size } = React11.useContext(StepContext);
1767
+ const status = error ? "error" : disabled ? "disabled" : index < activeStep || completed ? "complete" : index === activeStep ? "current" : "upcoming";
1768
+ const isCurrent = index === activeStep && !error && !disabled;
1769
+ const indicator = /* @__PURE__ */ jsx22(
1770
+ "div",
1771
+ {
1772
+ className: cn(
1773
+ "flex items-center justify-center rounded-full font-medium",
1774
+ INDICATOR_SIZE[size],
1775
+ status === "complete" && "bg-primary text-primary-foreground",
1776
+ status === "current" && "border-2 border-primary bg-background text-primary",
1777
+ status === "upcoming" && "border-2 border-border bg-background text-muted-foreground dark:border-border dark:bg-background dark:text-muted-foreground",
1778
+ status === "error" && "border-intent-error bg-intent-error/10 text-intent-error dark:border-intent-error dark:text-intent-error border-2",
1779
+ status === "disabled" && "border-2 border-muted bg-muted text-muted-foreground opacity-50"
1780
+ ),
1781
+ children: icon ?? (status === "complete" ? "\u2713" : status === "error" ? "!" : index + 1)
1782
+ }
1783
+ );
1784
+ if (variant === "vertical") {
1785
+ return /* @__PURE__ */ jsxs15(
1786
+ "div",
1787
+ {
1788
+ ref,
1789
+ role: "listitem",
1790
+ "aria-current": isCurrent ? "step" : void 0,
1791
+ "aria-disabled": disabled || void 0,
1792
+ className: cn("flex gap-3", disabled && "opacity-50", className),
1793
+ ...props,
1794
+ children: [
1795
+ /* @__PURE__ */ jsxs15("div", { className: "flex flex-col items-center", children: [
1796
+ indicator,
1797
+ !isLast && /* @__PURE__ */ jsx22(
1798
+ "div",
1799
+ {
1800
+ className: cn(
1801
+ "mt-1 w-0.5 flex-1",
1802
+ status === "complete" ? "bg-primary" : "bg-muted"
1803
+ )
1804
+ }
1805
+ )
1806
+ ] }),
1807
+ /* @__PURE__ */ jsxs15("div", { className: "pb-6", children: [
1808
+ /* @__PURE__ */ jsx22(
1809
+ "p",
1810
+ {
1811
+ className: cn(
1812
+ "font-medium",
1813
+ LABEL_SIZE[size],
1814
+ status === "error" ? "text-intent-error dark:text-intent-error" : status === "upcoming" || status === "disabled" ? "text-muted-foreground" : "text-foreground"
1815
+ ),
1816
+ children: label
1817
+ }
1818
+ ),
1819
+ description && /* @__PURE__ */ jsx22("p", { className: "mt-0.5 text-xs text-muted-foreground", children: description })
1820
+ ] })
1821
+ ]
1822
+ }
1823
+ );
1824
+ }
1825
+ const stepContent = /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
1826
+ indicator,
1827
+ /* @__PURE__ */ jsx22(
1828
+ "span",
1829
+ {
1830
+ className: cn(
1831
+ "whitespace-nowrap font-medium",
1832
+ LABEL_SIZE[size],
1833
+ status === "error" ? "text-intent-error dark:text-intent-error" : status === "upcoming" || status === "disabled" ? "text-muted-foreground dark:text-muted-foreground" : "text-foreground dark:text-foreground"
1834
+ ),
1835
+ children: label
1836
+ }
1837
+ )
1838
+ ] });
1839
+ return /* @__PURE__ */ jsxs15(
1840
+ "div",
1841
+ {
1842
+ ref,
1843
+ role: "listitem",
1844
+ "aria-current": isCurrent ? "step" : void 0,
1845
+ "aria-disabled": disabled || void 0,
1846
+ className: cn("flex items-center", className),
1847
+ ...props,
1848
+ children: [
1849
+ href && !disabled ? /* @__PURE__ */ jsx22(
1850
+ "a",
1851
+ {
1852
+ href,
1853
+ className: "flex items-center gap-2 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1854
+ "aria-label": label,
1855
+ children: stepContent
1856
+ }
1857
+ ) : stepContent,
1858
+ !isLast && /* @__PURE__ */ jsx22(
1859
+ "div",
1860
+ {
1861
+ className: cn(
1862
+ "mx-3 h-px min-w-[16px] flex-1",
1863
+ index < activeStep ? "bg-primary" : "bg-border dark:bg-border"
1864
+ )
1865
+ }
1866
+ )
1867
+ ]
1868
+ }
1869
+ );
1870
+ }
1871
+ );
1872
+ StepperStep.displayName = "StepperStep";
1873
+ var Stepper = React11.forwardRef(
1874
+ ({
1875
+ className,
1876
+ variant = "horizontal",
1877
+ activeStep,
1878
+ size = "md",
1879
+ children,
1880
+ ...props
1881
+ }, ref) => {
1882
+ const steps = React11.Children.toArray(children);
1883
+ return /* @__PURE__ */ jsx22(
1884
+ "div",
1885
+ {
1886
+ ref,
1887
+ role: "list",
1888
+ className: cn(
1889
+ variant === "horizontal" ? "flex items-center" : "flex flex-col",
1890
+ className
1891
+ ),
1892
+ ...props,
1893
+ children: steps.map((child, i) => /* @__PURE__ */ jsx22(
1894
+ StepContext.Provider,
1895
+ {
1896
+ value: {
1897
+ index: i,
1898
+ activeStep,
1899
+ isLast: i === steps.length - 1,
1900
+ variant,
1901
+ size
1902
+ },
1903
+ children: child
1904
+ },
1905
+ i
1906
+ ))
1907
+ }
1908
+ );
1909
+ }
1910
+ );
1911
+ Stepper.displayName = "Stepper";
1912
+
1913
+ // src/command-palette.tsx
1914
+ import * as React12 from "react";
1915
+ import { Fragment as Fragment3, jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
1916
+ var SIZE_CLASSES = {
1917
+ sm: "max-w-sm",
1918
+ md: "max-w-lg",
1919
+ lg: "max-w-2xl"
1920
+ };
1921
+ var CommandPalette = React12.forwardRef(
1922
+ ({
1923
+ className,
1924
+ open,
1925
+ onClose,
1926
+ results = [],
1927
+ placeholder = "Search commands...",
1928
+ onSearch,
1929
+ size = "md",
1930
+ ...props
1931
+ }, ref) => {
1932
+ const [query, setQuery] = React12.useState("");
1933
+ const [activeIndex, setActiveIndex] = React12.useState(0);
1934
+ React12.useEffect(() => {
1935
+ if (!open) return;
1936
+ const handler = (e) => {
1937
+ if (e.key === "Escape") onClose?.();
1938
+ if (e.key === "ArrowDown") {
1939
+ e.preventDefault();
1940
+ setActiveIndex((i) => Math.min(i + 1, results.length - 1));
1941
+ }
1942
+ if (e.key === "ArrowUp") {
1943
+ e.preventDefault();
1944
+ setActiveIndex((i) => Math.max(i - 1, 0));
1945
+ }
1946
+ if (e.key === "Enter" && results[activeIndex]) {
1947
+ results[activeIndex].onSelect?.();
1948
+ onClose?.();
1949
+ }
1950
+ };
1951
+ document.addEventListener("keydown", handler);
1952
+ return () => document.removeEventListener("keydown", handler);
1953
+ }, [open, onClose, results, activeIndex]);
1954
+ React12.useEffect(() => {
1955
+ setActiveIndex(0);
1956
+ }, [query]);
1957
+ if (!open) return null;
1958
+ const grouped = results.reduce(
1959
+ (acc, r) => {
1960
+ const group = r.group || "Results";
1961
+ if (!acc[group]) acc[group] = [];
1962
+ acc[group].push(r);
1963
+ return acc;
1964
+ },
1965
+ {}
1966
+ );
1967
+ return /* @__PURE__ */ jsxs16(Fragment3, { children: [
1968
+ /* @__PURE__ */ jsx23(
1969
+ "div",
1970
+ {
1971
+ className: "z-modal fixed inset-0 bg-foreground/60",
1972
+ onClick: onClose
1973
+ }
1974
+ ),
1975
+ /* @__PURE__ */ jsx23("div", { className: "z-modal fixed inset-0 flex items-start justify-center pt-[15vh]", children: /* @__PURE__ */ jsxs16(
1976
+ "div",
1977
+ {
1978
+ ref,
1979
+ className: cn(
1980
+ "w-full overflow-hidden rounded-xl border border-border bg-card shadow-lg",
1981
+ SIZE_CLASSES[size],
1982
+ className
1983
+ ),
1984
+ ...props,
1985
+ children: [
1986
+ /* @__PURE__ */ jsxs16("div", { className: "flex items-center border-b border-border px-4", children: [
1987
+ /* @__PURE__ */ jsx23("span", { className: "mr-2 text-muted-foreground", children: "\u2318" }),
1988
+ /* @__PURE__ */ jsx23(
1989
+ "input",
1990
+ {
1991
+ type: "text",
1992
+ className: "h-12 flex-1 bg-transparent text-sm text-foreground outline-none placeholder:text-muted-foreground",
1993
+ placeholder,
1994
+ value: query,
1995
+ onChange: (e) => {
1996
+ setQuery(e.target.value);
1997
+ onSearch?.(e.target.value);
1998
+ },
1999
+ autoFocus: true
2000
+ }
2001
+ ),
2002
+ /* @__PURE__ */ jsx23("kbd", { className: "rounded border border-border px-1.5 py-0.5 text-xs text-muted-foreground", children: "Esc" })
2003
+ ] }),
2004
+ /* @__PURE__ */ jsx23("div", { className: "max-h-80 overflow-y-auto p-2", children: Object.entries(grouped).length === 0 ? /* @__PURE__ */ jsx23("p", { className: "py-6 text-center text-sm text-muted-foreground", children: "No results found" }) : Object.entries(grouped).map(([group, items]) => /* @__PURE__ */ jsxs16("div", { children: [
2005
+ /* @__PURE__ */ jsx23("p", { className: "px-2 py-1.5 text-xs font-medium text-muted-foreground", children: group }),
2006
+ items.map((item) => {
2007
+ const idx = results.indexOf(item);
2008
+ return /* @__PURE__ */ jsxs16(
2009
+ "button",
2010
+ {
2011
+ type: "button",
2012
+ className: cn(
2013
+ "flex w-full items-center gap-2 rounded-md px-2 py-2 text-left text-sm",
2014
+ idx === activeIndex ? "bg-muted text-foreground" : "text-foreground hover:bg-muted/50"
2015
+ ),
2016
+ onClick: () => {
2017
+ item.onSelect?.();
2018
+ onClose?.();
2019
+ },
2020
+ onMouseEnter: () => setActiveIndex(idx),
2021
+ children: [
2022
+ item.icon && /* @__PURE__ */ jsx23("span", { className: "flex-shrink-0 text-muted-foreground", children: item.icon }),
2023
+ /* @__PURE__ */ jsx23("span", { className: "flex-1", children: item.label }),
2024
+ item.shortcut && /* @__PURE__ */ jsx23("kbd", { className: "rounded border border-border px-1.5 py-0.5 text-xs text-muted-foreground", children: item.shortcut })
2025
+ ]
2026
+ },
2027
+ item.id
2028
+ );
2029
+ })
2030
+ ] }, group)) })
2031
+ ]
2032
+ }
2033
+ ) })
2034
+ ] });
2035
+ }
2036
+ );
2037
+ CommandPalette.displayName = "CommandPalette";
2038
+
2039
+ // src/app-shell.tsx
2040
+ import * as React13 from "react";
2041
+ import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
2042
+ var AppShell = React13.forwardRef(
2043
+ ({
2044
+ className,
2045
+ variant = "stacked",
2046
+ sidebarPosition = "left",
2047
+ sidebarCollapsed = false,
2048
+ header,
2049
+ sidebar,
2050
+ detailPanel,
2051
+ children,
2052
+ ...props
2053
+ }, ref) => {
2054
+ if (variant === "stacked") {
2055
+ return /* @__PURE__ */ jsxs17(
2056
+ "div",
2057
+ {
2058
+ ref,
2059
+ className: cn("flex min-h-screen flex-col bg-background", className),
2060
+ ...props,
2061
+ children: [
2062
+ header,
2063
+ /* @__PURE__ */ jsx24("main", { className: "flex-1", children })
2064
+ ]
2065
+ }
2066
+ );
2067
+ }
2068
+ if (variant === "multi-column") {
2069
+ return /* @__PURE__ */ jsxs17(
2070
+ "div",
2071
+ {
2072
+ ref,
2073
+ className: cn("flex min-h-screen bg-background", className),
2074
+ ...props,
2075
+ children: [
2076
+ sidebar && /* @__PURE__ */ jsx24(
2077
+ "aside",
2078
+ {
2079
+ className: cn(
2080
+ "flex-shrink-0 border-r border-border bg-card",
2081
+ sidebarCollapsed ? "w-16" : "w-60"
2082
+ ),
2083
+ children: sidebar
2084
+ }
2085
+ ),
2086
+ /* @__PURE__ */ jsxs17("div", { className: "flex flex-1 flex-col", children: [
2087
+ header,
2088
+ /* @__PURE__ */ jsxs17("div", { className: "flex flex-1", children: [
2089
+ /* @__PURE__ */ jsx24("main", { className: "flex-1 overflow-y-auto", children }),
2090
+ detailPanel && /* @__PURE__ */ jsx24("aside", { className: "w-80 flex-shrink-0 border-l border-border bg-card", children: detailPanel })
2091
+ ] })
2092
+ ] })
2093
+ ]
2094
+ }
2095
+ );
2096
+ }
2097
+ return /* @__PURE__ */ jsxs17(
2098
+ "div",
2099
+ {
2100
+ ref,
2101
+ className: cn("flex min-h-screen bg-background", className),
2102
+ ...props,
2103
+ children: [
2104
+ sidebarPosition === "left" && sidebar && /* @__PURE__ */ jsx24(
2105
+ "aside",
2106
+ {
2107
+ className: cn(
2108
+ "flex-shrink-0 border-r border-border bg-card transition-all",
2109
+ sidebarCollapsed ? "w-16" : "w-60"
2110
+ ),
2111
+ children: sidebar
2112
+ }
2113
+ ),
2114
+ /* @__PURE__ */ jsxs17("div", { className: "flex flex-1 flex-col", children: [
2115
+ header,
2116
+ /* @__PURE__ */ jsx24("main", { className: "flex-1 overflow-y-auto", children })
2117
+ ] }),
2118
+ sidebarPosition === "right" && sidebar && /* @__PURE__ */ jsx24(
2119
+ "aside",
2120
+ {
2121
+ className: cn(
2122
+ "flex-shrink-0 border-l border-border bg-card transition-all",
2123
+ sidebarCollapsed ? "w-16" : "w-60"
2124
+ ),
2125
+ children: sidebar
2126
+ }
2127
+ )
2128
+ ]
2129
+ }
2130
+ );
2131
+ }
2132
+ );
2133
+ AppShell.displayName = "AppShell";
2134
+
2135
+ // src/popover.tsx
2136
+ import * as React14 from "react";
2137
+ import { Fragment as Fragment4, jsx as jsx25, jsxs as jsxs18 } from "react/jsx-runtime";
2138
+ var SIDE_CLASSES = {
2139
+ top: "bottom-full mb-2",
2140
+ bottom: "top-full mt-2",
2141
+ left: "right-full mr-2",
2142
+ right: "left-full ml-2"
2143
+ };
2144
+ var ALIGN_CLASSES = {
2145
+ start: "left-0",
2146
+ center: "left-1/2 -translate-x-1/2",
2147
+ end: "right-0"
2148
+ };
2149
+ var Popover = React14.forwardRef(
2150
+ ({
2151
+ className,
2152
+ open,
2153
+ onOpenChange,
2154
+ trigger,
2155
+ side = "bottom",
2156
+ align = "start",
2157
+ children,
2158
+ ...props
2159
+ }, ref) => {
2160
+ const [internalOpen, setInternalOpen] = React14.useState(false);
2161
+ const isOpen = open ?? internalOpen;
2162
+ const setOpen = onOpenChange ?? setInternalOpen;
2163
+ React14.useEffect(() => {
2164
+ if (!isOpen) return;
2165
+ const handler = (e) => {
2166
+ if (e.key === "Escape") setOpen(false);
2167
+ };
2168
+ document.addEventListener("keydown", handler);
2169
+ return () => document.removeEventListener("keydown", handler);
2170
+ }, [isOpen, setOpen]);
2171
+ return /* @__PURE__ */ jsxs18(
2172
+ "div",
2173
+ {
2174
+ ref,
2175
+ className: cn("relative inline-block", className),
2176
+ ...props,
2177
+ children: [
2178
+ /* @__PURE__ */ jsx25("div", { onClick: () => setOpen(!isOpen), children: trigger }),
2179
+ isOpen && /* @__PURE__ */ jsxs18(Fragment4, { children: [
2180
+ /* @__PURE__ */ jsx25(
2181
+ "div",
2182
+ {
2183
+ className: "z-popover fixed inset-0",
2184
+ onClick: () => setOpen(false)
2185
+ }
2186
+ ),
2187
+ /* @__PURE__ */ jsx25(
2188
+ "div",
2189
+ {
2190
+ className: cn(
2191
+ "z-popover absolute w-72 rounded-lg border border-border bg-card p-4 shadow-lg",
2192
+ SIDE_CLASSES[side],
2193
+ (side === "top" || side === "bottom") && ALIGN_CLASSES[align]
2194
+ ),
2195
+ children
2196
+ }
2197
+ )
2198
+ ] })
2199
+ ]
2200
+ }
2201
+ );
2202
+ }
2203
+ );
2204
+ Popover.displayName = "Popover";
2205
+ var HoverCard = React14.forwardRef(
2206
+ ({
2207
+ className,
2208
+ trigger,
2209
+ side = "bottom",
2210
+ align = "start",
2211
+ delay = 200,
2212
+ children,
2213
+ ...props
2214
+ }, ref) => {
2215
+ const [open, setOpen] = React14.useState(false);
2216
+ const timeoutRef = React14.useRef();
2217
+ const handleEnter = () => {
2218
+ clearTimeout(timeoutRef.current);
2219
+ timeoutRef.current = setTimeout(() => setOpen(true), delay);
2220
+ };
2221
+ const handleLeave = () => {
2222
+ clearTimeout(timeoutRef.current);
2223
+ timeoutRef.current = setTimeout(() => setOpen(false), 150);
2224
+ };
2225
+ React14.useEffect(() => {
2226
+ return () => clearTimeout(timeoutRef.current);
2227
+ }, []);
2228
+ return /* @__PURE__ */ jsxs18(
2229
+ "div",
2230
+ {
2231
+ ref,
2232
+ className: cn("relative inline-block", className),
2233
+ onMouseEnter: handleEnter,
2234
+ onMouseLeave: handleLeave,
2235
+ ...props,
2236
+ children: [
2237
+ trigger,
2238
+ open && /* @__PURE__ */ jsx25(
2239
+ "div",
2240
+ {
2241
+ className: cn(
2242
+ "z-popover absolute w-80 rounded-lg border border-border bg-card p-4 shadow-lg",
2243
+ SIDE_CLASSES[side],
2244
+ ALIGN_CLASSES[align]
2245
+ ),
2246
+ onMouseEnter: handleEnter,
2247
+ onMouseLeave: handleLeave,
2248
+ children
2249
+ }
2250
+ )
2251
+ ]
2252
+ }
2253
+ );
2254
+ }
2255
+ );
2256
+ HoverCard.displayName = "HoverCard";
2257
+
2258
+ // src/calendar.tsx
2259
+ import * as React15 from "react";
2260
+ import { Fragment as Fragment5, jsx as jsx26, jsxs as jsxs19 } from "react/jsx-runtime";
2261
+ function getDaysInMonth(year, month) {
2262
+ return new Date(year, month + 1, 0).getDate();
2263
+ }
2264
+ function getStartDayOfWeek(year, month) {
2265
+ return new Date(year, month, 1).getDay();
2266
+ }
2267
+ function isSameDay(a, b) {
2268
+ return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
2269
+ }
2270
+ function isDateInRange(date, start, end) {
2271
+ const d = date.getTime();
2272
+ return d >= start.getTime() && d <= end.getTime();
2273
+ }
2274
+ function formatMonth(year, month) {
2275
+ return new Date(year, month, 1).toLocaleDateString("en-US", {
2276
+ month: "long",
2277
+ year: "numeric"
2278
+ });
2279
+ }
2280
+ function formatDateForInput(date) {
2281
+ return date.toLocaleDateString("en-US", {
2282
+ month: "short",
2283
+ day: "numeric",
2284
+ year: "numeric"
2285
+ });
2286
+ }
2287
+ var WEEKDAYS = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
2288
+ var SIZE_CONFIG = {
2289
+ sm: { cell: "h-7 w-7 text-xs", gap: "gap-0.5", pad: "p-2", dot: "h-1 w-1" },
2290
+ md: { cell: "h-9 w-9 text-sm", gap: "gap-1", pad: "p-3", dot: "h-1.5 w-1.5" },
2291
+ lg: {
2292
+ cell: "h-11 w-11 text-base",
2293
+ gap: "gap-1",
2294
+ pad: "p-4",
2295
+ dot: "h-1.5 w-1.5"
2296
+ }
2297
+ };
2298
+ var Calendar = React15.forwardRef(
2299
+ ({
2300
+ className,
2301
+ value,
2302
+ onChange,
2303
+ selectionMode = "single",
2304
+ rangeStart,
2305
+ rangeEnd,
2306
+ onRangeChange,
2307
+ minDate: minDateProp,
2308
+ maxDate: maxDateProp,
2309
+ events,
2310
+ today: todayProp,
2311
+ size = "md",
2312
+ ...props
2313
+ }, ref) => {
2314
+ const today = React15.useMemo(() => {
2315
+ if (todayProp) return todayProp;
2316
+ const now = Date.now();
2317
+ const d = new Date(now);
2318
+ return new Date(d.getFullYear(), d.getMonth(), d.getDate());
2319
+ }, [todayProp]);
2320
+ const initialDate = value ?? rangeStart ?? today;
2321
+ const [viewYear, setViewYear] = React15.useState(initialDate.getFullYear());
2322
+ const [viewMonth, setViewMonth] = React15.useState(initialDate.getMonth());
2323
+ const [focusedDay, setFocusedDay] = React15.useState(null);
2324
+ const daysInMonth = getDaysInMonth(viewYear, viewMonth);
2325
+ const startDay = getStartDayOfWeek(viewYear, viewMonth);
2326
+ const config = SIZE_CONFIG[size];
2327
+ const prevMonth = () => {
2328
+ if (viewMonth === 0) {
2329
+ setViewYear((y) => y - 1);
2330
+ setViewMonth(11);
2331
+ } else {
2332
+ setViewMonth((m) => m - 1);
2333
+ }
2334
+ };
2335
+ const nextMonth = () => {
2336
+ if (viewMonth === 11) {
2337
+ setViewYear((y) => y + 1);
2338
+ setViewMonth(0);
2339
+ } else {
2340
+ setViewMonth((m) => m + 1);
2341
+ }
2342
+ };
2343
+ const isDisabled = (day) => {
2344
+ const date = new Date(viewYear, viewMonth, day);
2345
+ if (minDateProp && date < new Date(
2346
+ minDateProp.getFullYear(),
2347
+ minDateProp.getMonth(),
2348
+ minDateProp.getDate()
2349
+ )) {
2350
+ return true;
2351
+ }
2352
+ if (maxDateProp && date > new Date(
2353
+ maxDateProp.getFullYear(),
2354
+ maxDateProp.getMonth(),
2355
+ maxDateProp.getDate()
2356
+ )) {
2357
+ return true;
2358
+ }
2359
+ return false;
2360
+ };
2361
+ const handleDayClick = (day) => {
2362
+ const date = new Date(viewYear, viewMonth, day);
2363
+ if (selectionMode === "single") {
2364
+ onChange?.(date);
2365
+ } else {
2366
+ if (!rangeStart || rangeStart && rangeEnd) {
2367
+ onRangeChange?.(date, null);
2368
+ } else {
2369
+ const [start, end] = date >= rangeStart ? [rangeStart, date] : [date, rangeStart];
2370
+ onRangeChange?.(start, end);
2371
+ }
2372
+ }
2373
+ };
2374
+ const hasEvent = (day) => {
2375
+ if (!events?.length) return false;
2376
+ const date = new Date(viewYear, viewMonth, day);
2377
+ return events.some((e) => isSameDay(e.date, date));
2378
+ };
2379
+ const handleKeyDown = (e) => {
2380
+ const current = focusedDay ?? (value?.getMonth() === viewMonth ? value.getDate() : 1);
2381
+ switch (e.key) {
2382
+ case "ArrowRight": {
2383
+ e.preventDefault();
2384
+ const next = current + 1;
2385
+ if (next > daysInMonth) {
2386
+ nextMonth();
2387
+ setFocusedDay(1);
2388
+ } else {
2389
+ setFocusedDay(next);
2390
+ }
2391
+ break;
2392
+ }
2393
+ case "ArrowLeft": {
2394
+ e.preventDefault();
2395
+ const prev = current - 1;
2396
+ if (prev < 1) {
2397
+ prevMonth();
2398
+ const prevDays = getDaysInMonth(
2399
+ viewMonth === 0 ? viewYear - 1 : viewYear,
2400
+ viewMonth === 0 ? 11 : viewMonth - 1
2401
+ );
2402
+ setFocusedDay(prevDays);
2403
+ } else {
2404
+ setFocusedDay(prev);
2405
+ }
2406
+ break;
2407
+ }
2408
+ case "ArrowDown": {
2409
+ e.preventDefault();
2410
+ const next = current + 7;
2411
+ if (next > daysInMonth) {
2412
+ nextMonth();
2413
+ setFocusedDay(next - daysInMonth);
2414
+ } else {
2415
+ setFocusedDay(next);
2416
+ }
2417
+ break;
2418
+ }
2419
+ case "ArrowUp": {
2420
+ e.preventDefault();
2421
+ const prev = current - 7;
2422
+ if (prev < 1) {
2423
+ const prevDays = getDaysInMonth(
2424
+ viewMonth === 0 ? viewYear - 1 : viewYear,
2425
+ viewMonth === 0 ? 11 : viewMonth - 1
2426
+ );
2427
+ prevMonth();
2428
+ setFocusedDay(prevDays + prev);
2429
+ } else {
2430
+ setFocusedDay(prev);
2431
+ }
2432
+ break;
2433
+ }
2434
+ case "Enter":
2435
+ case " ": {
2436
+ e.preventDefault();
2437
+ if (current >= 1 && current <= daysInMonth && !isDisabled(current)) {
2438
+ handleDayClick(current);
2439
+ }
2440
+ break;
2441
+ }
2442
+ case "Home": {
2443
+ e.preventDefault();
2444
+ setFocusedDay(1);
2445
+ break;
2446
+ }
2447
+ case "End": {
2448
+ e.preventDefault();
2449
+ setFocusedDay(daysInMonth);
2450
+ break;
2451
+ }
2452
+ }
2453
+ };
2454
+ const cells = [];
2455
+ for (let i = 0; i < startDay; i++) cells.push(null);
2456
+ for (let d = 1; d <= daysInMonth; d++) cells.push(d);
2457
+ return /* @__PURE__ */ jsxs19(
2458
+ "div",
2459
+ {
2460
+ ref,
2461
+ role: "grid",
2462
+ "aria-label": formatMonth(viewYear, viewMonth),
2463
+ tabIndex: 0,
2464
+ onKeyDown: handleKeyDown,
2465
+ className: cn(
2466
+ "w-fit rounded-lg border border-border bg-card shadow-sm outline-none focus:ring-2 focus:ring-ring",
2467
+ config.pad,
2468
+ className
2469
+ ),
2470
+ ...props,
2471
+ children: [
2472
+ /* @__PURE__ */ jsxs19("div", { className: "mb-2 flex items-center justify-between", children: [
2473
+ /* @__PURE__ */ jsx26(
2474
+ "button",
2475
+ {
2476
+ type: "button",
2477
+ onClick: prevMonth,
2478
+ tabIndex: -1,
2479
+ className: "inline-flex h-7 w-7 items-center justify-center rounded-md text-foreground hover:bg-muted",
2480
+ "aria-label": "Previous month",
2481
+ children: "\u2039"
2482
+ }
2483
+ ),
2484
+ /* @__PURE__ */ jsx26(
2485
+ "span",
2486
+ {
2487
+ className: "text-sm font-medium text-foreground",
2488
+ "aria-live": "polite",
2489
+ children: formatMonth(viewYear, viewMonth)
2490
+ }
2491
+ ),
2492
+ /* @__PURE__ */ jsx26(
2493
+ "button",
2494
+ {
2495
+ type: "button",
2496
+ onClick: nextMonth,
2497
+ tabIndex: -1,
2498
+ className: "inline-flex h-7 w-7 items-center justify-center rounded-md text-foreground hover:bg-muted",
2499
+ "aria-label": "Next month",
2500
+ children: "\u203A"
2501
+ }
2502
+ )
2503
+ ] }),
2504
+ /* @__PURE__ */ jsx26("div", { role: "row", className: cn("grid grid-cols-7", config.gap), children: WEEKDAYS.map((day) => /* @__PURE__ */ jsx26(
2505
+ "div",
2506
+ {
2507
+ role: "columnheader",
2508
+ className: cn(
2509
+ "flex items-center justify-center font-medium text-muted-foreground",
2510
+ config.cell
2511
+ ),
2512
+ children: day
2513
+ },
2514
+ day
2515
+ )) }),
2516
+ /* @__PURE__ */ jsx26("div", { className: cn("grid grid-cols-7", config.gap), children: cells.map((day, i) => {
2517
+ if (day === null) {
2518
+ return /* @__PURE__ */ jsx26("div", { className: config.cell }, `empty-${i}`);
2519
+ }
2520
+ const date = new Date(viewYear, viewMonth, day);
2521
+ const disabled = isDisabled(day);
2522
+ const isFocused = focusedDay === day;
2523
+ let isSelected = false;
2524
+ let isRangeEndpoint = false;
2525
+ let isInRange = false;
2526
+ if (selectionMode === "single") {
2527
+ isSelected = value ? isSameDay(date, value) : false;
2528
+ } else {
2529
+ if (rangeStart && isSameDay(date, rangeStart)) {
2530
+ isRangeEndpoint = true;
2531
+ }
2532
+ if (rangeEnd && isSameDay(date, rangeEnd)) {
2533
+ isRangeEndpoint = true;
2534
+ }
2535
+ if (rangeStart && rangeEnd) {
2536
+ isInRange = isDateInRange(date, rangeStart, rangeEnd);
2537
+ }
2538
+ }
2539
+ const isToday = isSameDay(date, today);
2540
+ const eventDot = hasEvent(day);
2541
+ return /* @__PURE__ */ jsxs19(
2542
+ "button",
2543
+ {
2544
+ type: "button",
2545
+ role: "gridcell",
2546
+ "aria-selected": isSelected || isRangeEndpoint,
2547
+ "aria-current": isToday ? "date" : void 0,
2548
+ disabled,
2549
+ tabIndex: -1,
2550
+ onClick: () => handleDayClick(day),
2551
+ className: cn(
2552
+ "relative inline-flex flex-col items-center justify-center rounded-md transition-colors",
2553
+ config.cell,
2554
+ disabled && "pointer-events-none opacity-50",
2555
+ isFocused && "ring-2 ring-ring",
2556
+ isSelected || isRangeEndpoint ? "bg-primary font-semibold text-primary-foreground" : isInRange ? "bg-primary/10 font-medium text-foreground" : isToday ? "bg-muted font-semibold text-foreground" : "text-foreground hover:bg-muted"
2557
+ ),
2558
+ children: [
2559
+ day,
2560
+ eventDot && /* @__PURE__ */ jsx26(
2561
+ "span",
2562
+ {
2563
+ className: cn(
2564
+ "bg-intent-info absolute bottom-0.5 rounded-full",
2565
+ config.dot
2566
+ )
2567
+ }
2568
+ )
2569
+ ]
2570
+ },
2571
+ day
2572
+ );
2573
+ }) })
2574
+ ]
2575
+ }
2576
+ );
2577
+ }
2578
+ );
2579
+ Calendar.displayName = "Calendar";
2580
+ var DatePicker = React15.forwardRef(
2581
+ ({
2582
+ className,
2583
+ variant = "single",
2584
+ value,
2585
+ onChange,
2586
+ rangeStart,
2587
+ rangeEnd,
2588
+ onRangeChange,
2589
+ placeholder,
2590
+ minDate: minDateProp,
2591
+ maxDate: maxDateProp,
2592
+ events,
2593
+ open: controlledOpen,
2594
+ onOpenChange,
2595
+ calendarSize = "md",
2596
+ disabled,
2597
+ ...props
2598
+ }, ref) => {
2599
+ const [internalOpen, setInternalOpen] = React15.useState(false);
2600
+ const isOpen = controlledOpen ?? internalOpen;
2601
+ const setOpen = onOpenChange ?? setInternalOpen;
2602
+ const defaultPlaceholder = variant === "range" ? "Pick a date range" : "Pick a date";
2603
+ const handleSingleSelect = (date) => {
2604
+ onChange?.(date);
2605
+ setOpen(false);
2606
+ };
2607
+ const handleRangeChange = (start, end) => {
2608
+ onRangeChange?.(start, end);
2609
+ if (start && end) setOpen(false);
2610
+ };
2611
+ const handleKeyDown = (e) => {
2612
+ if (e.key === "Escape" && isOpen) {
2613
+ e.preventDefault();
2614
+ setOpen(false);
2615
+ }
2616
+ };
2617
+ let displayText = null;
2618
+ if (variant === "single" && value) {
2619
+ displayText = formatDateForInput(value);
2620
+ } else if (variant === "range" && rangeStart) {
2621
+ displayText = rangeEnd ? `${formatDateForInput(rangeStart)} \u2013 ${formatDateForInput(rangeEnd)}` : formatDateForInput(rangeStart);
2622
+ }
2623
+ return /* @__PURE__ */ jsxs19(
2624
+ "div",
2625
+ {
2626
+ ref,
2627
+ className: cn("relative inline-block", className),
2628
+ onKeyDown: handleKeyDown,
2629
+ ...props,
2630
+ children: [
2631
+ /* @__PURE__ */ jsxs19(
2632
+ "button",
2633
+ {
2634
+ type: "button",
2635
+ disabled,
2636
+ onClick: () => setOpen(!isOpen),
2637
+ className: cn(
2638
+ "inline-flex h-10 min-w-[200px] items-center gap-2 rounded-md border border-border bg-card px-3 text-sm transition-colors",
2639
+ "hover:bg-muted focus:outline-none focus:ring-2 focus:ring-ring",
2640
+ disabled && "pointer-events-none opacity-50",
2641
+ displayText ? "text-foreground" : "text-muted-foreground"
2642
+ ),
2643
+ children: [
2644
+ /* @__PURE__ */ jsx26("span", { className: "text-muted-foreground", "aria-hidden": "true", children: "\u{1F4C5}" }),
2645
+ /* @__PURE__ */ jsx26("span", { className: "flex-1 text-left", children: displayText ?? placeholder ?? defaultPlaceholder }),
2646
+ /* @__PURE__ */ jsx26("span", { className: "text-muted-foreground", "aria-hidden": "true", children: "\u25BE" })
2647
+ ]
2648
+ }
2649
+ ),
2650
+ isOpen && /* @__PURE__ */ jsxs19(Fragment5, { children: [
2651
+ /* @__PURE__ */ jsx26(
2652
+ "div",
2653
+ {
2654
+ className: "z-popover fixed inset-0",
2655
+ onClick: () => setOpen(false)
2656
+ }
2657
+ ),
2658
+ /* @__PURE__ */ jsx26("div", { className: "z-popover absolute left-0 top-full mt-1", children: /* @__PURE__ */ jsx26(
2659
+ Calendar,
2660
+ {
2661
+ selectionMode: variant,
2662
+ value: variant === "single" ? value : void 0,
2663
+ onChange: variant === "single" ? handleSingleSelect : void 0,
2664
+ rangeStart: variant === "range" ? rangeStart : void 0,
2665
+ rangeEnd: variant === "range" ? rangeEnd : void 0,
2666
+ onRangeChange: variant === "range" ? handleRangeChange : void 0,
2667
+ minDate: minDateProp,
2668
+ maxDate: maxDateProp,
2669
+ events,
2670
+ size: calendarSize
2671
+ }
2672
+ ) })
2673
+ ] })
2674
+ ]
2675
+ }
2676
+ );
2677
+ }
2678
+ );
2679
+ DatePicker.displayName = "DatePicker";
2680
+
2681
+ // src/navbar.tsx
2682
+ import * as React16 from "react";
2683
+ import { jsx as jsx27, jsxs as jsxs20 } from "react/jsx-runtime";
2684
+ var Navbar = React16.forwardRef(
2685
+ ({
2686
+ className,
2687
+ variant = "simple",
2688
+ transparent,
2689
+ logo,
2690
+ actions,
2691
+ search,
2692
+ secondaryNav,
2693
+ children,
2694
+ ...props
2695
+ }, ref) => /* @__PURE__ */ jsxs20(
2696
+ "header",
2697
+ {
2698
+ ref,
2699
+ className: cn(
2700
+ "border-b border-border",
2701
+ transparent ? "bg-transparent" : "bg-card",
2702
+ className
2703
+ ),
2704
+ ...props,
2705
+ children: [
2706
+ /* @__PURE__ */ jsxs20("div", { className: "mx-auto flex h-14 max-w-content-xl items-center gap-4 px-4 sm:px-6", children: [
2707
+ logo && /* @__PURE__ */ jsx27("div", { className: "flex-shrink-0", children: logo }),
2708
+ /* @__PURE__ */ jsx27(
2709
+ "nav",
2710
+ {
2711
+ className: cn(
2712
+ "flex items-center gap-4",
2713
+ variant === "centered" && "flex-1 justify-center"
2714
+ ),
2715
+ children
2716
+ }
2717
+ ),
2718
+ variant === "withSearch" && search && /* @__PURE__ */ jsx27("div", { className: "flex-1 px-4", children: search }),
2719
+ variant !== "centered" && variant !== "withSearch" && /* @__PURE__ */ jsx27("div", { className: "flex-1" }),
2720
+ actions && /* @__PURE__ */ jsx27("div", { className: "flex items-center gap-2", children: actions })
2721
+ ] }),
2722
+ variant === "twoLevel" && secondaryNav && /* @__PURE__ */ jsx27("div", { className: "border-t border-border", children: /* @__PURE__ */ jsx27("div", { className: "mx-auto flex max-w-content-xl items-center gap-4 px-4 py-2 sm:px-6", children: secondaryNav }) })
2723
+ ]
2724
+ }
2725
+ )
2726
+ );
2727
+ Navbar.displayName = "Navbar";
2728
+ var NavbarLink = React16.forwardRef(
2729
+ ({ className, active, ...props }, ref) => /* @__PURE__ */ jsx27(
2730
+ "a",
2731
+ {
2732
+ ref,
2733
+ className: cn(
2734
+ "text-sm font-medium transition-colors",
2735
+ active ? "text-foreground" : "text-muted-foreground hover:text-foreground",
2736
+ className
2737
+ ),
2738
+ ...props
2739
+ }
2740
+ )
2741
+ );
2742
+ NavbarLink.displayName = "NavbarLink";
2743
+
2744
+ // src/card-variants.tsx
2745
+ import * as React17 from "react";
2746
+ import { jsx as jsx28, jsxs as jsxs21 } from "react/jsx-runtime";
2747
+ var HorizontalCard = React17.forwardRef(
2748
+ ({ className, media, hoverable, children, ...props }, ref) => /* @__PURE__ */ jsxs21(
2749
+ "div",
2750
+ {
2751
+ ref,
2752
+ className: cn(
2753
+ "flex overflow-hidden rounded-lg border border-border bg-card shadow-sm",
2754
+ hoverable && "cursor-pointer transition-shadow hover:shadow-md",
2755
+ className
2756
+ ),
2757
+ ...props,
2758
+ children: [
2759
+ media && /* @__PURE__ */ jsx28("div", { className: "flex-shrink-0", children: media }),
2760
+ /* @__PURE__ */ jsx28("div", { className: "flex-1 p-4", children })
2761
+ ]
2762
+ }
2763
+ )
2764
+ );
2765
+ HorizontalCard.displayName = "HorizontalCard";
2766
+ var ImageCard = React17.forwardRef(
2767
+ ({ className, imageSrc, imageAlt, hoverable, children, ...props }, ref) => /* @__PURE__ */ jsxs21(
2768
+ "div",
2769
+ {
2770
+ ref,
2771
+ className: cn(
2772
+ "overflow-hidden rounded-lg border border-border bg-card shadow-sm",
2773
+ hoverable && "cursor-pointer transition-shadow hover:shadow-md",
2774
+ className
2775
+ ),
2776
+ ...props,
2777
+ children: [
2778
+ imageSrc && /* @__PURE__ */ jsx28("div", { className: "aspect-video w-full bg-muted", children: /* @__PURE__ */ jsx28(
2779
+ "img",
2780
+ {
2781
+ src: imageSrc,
2782
+ alt: imageAlt || "",
2783
+ className: "h-full w-full object-cover"
2784
+ }
2785
+ ) }),
2786
+ /* @__PURE__ */ jsx28("div", { className: "p-4", children })
2787
+ ]
2788
+ }
2789
+ )
2790
+ );
2791
+ ImageCard.displayName = "ImageCard";
2792
+ var StatCardExtended = React17.forwardRef(({ className, label, value, trend, icon, ...props }, ref) => /* @__PURE__ */ jsxs21(
2793
+ "div",
2794
+ {
2795
+ ref,
2796
+ className: cn(
2797
+ "rounded-lg border border-border bg-card p-6 shadow-sm",
2798
+ className
2799
+ ),
2800
+ ...props,
2801
+ children: [
2802
+ /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
2803
+ /* @__PURE__ */ jsx28("span", { className: "text-sm text-muted-foreground", children: label }),
2804
+ icon && /* @__PURE__ */ jsx28("div", { className: "text-muted-foreground", children: icon })
2805
+ ] }),
2806
+ /* @__PURE__ */ jsx28("p", { className: "mt-2 text-3xl font-bold text-foreground", children: value }),
2807
+ trend && /* @__PURE__ */ jsxs21(
2808
+ "p",
2809
+ {
2810
+ className: cn(
2811
+ "mt-1 text-sm font-medium",
2812
+ trend.direction === "up" && "text-intent-success",
2813
+ trend.direction === "down" && "text-intent-error",
2814
+ trend.direction === "neutral" && "text-muted-foreground"
2815
+ ),
2816
+ children: [
2817
+ trend.direction === "up" ? "\u2191" : trend.direction === "down" ? "\u2193" : "\u2192",
2818
+ " ",
2819
+ trend.text
2820
+ ]
2821
+ }
2822
+ )
2823
+ ]
2824
+ }
2825
+ ));
2826
+ StatCardExtended.displayName = "StatCardExtended";
2827
+ var ActionCard = React17.forwardRef(
2828
+ ({ className, title, description, actions, children, ...props }, ref) => /* @__PURE__ */ jsxs21(
2829
+ "div",
2830
+ {
2831
+ ref,
2832
+ className: cn(
2833
+ "rounded-lg border border-border bg-card shadow-sm",
2834
+ className
2835
+ ),
2836
+ ...props,
2837
+ children: [
2838
+ /* @__PURE__ */ jsxs21("div", { className: "p-6", children: [
2839
+ /* @__PURE__ */ jsx28("h3", { className: "font-semibold text-foreground", children: title }),
2840
+ description && /* @__PURE__ */ jsx28("p", { className: "mt-1 text-sm text-muted-foreground", children: description }),
2841
+ children
2842
+ ] }),
2843
+ actions && /* @__PURE__ */ jsx28("div", { className: "flex items-center gap-2 border-t border-border px-6 py-4", children: actions })
2844
+ ]
2845
+ }
2846
+ )
2847
+ );
2848
+ ActionCard.displayName = "ActionCard";
2849
+
2850
+ // src/modal-dialog.tsx
2851
+ import * as React18 from "react";
2852
+ import { createPortal } from "react-dom";
2853
+ import { Fragment as Fragment6, jsx as jsx29, jsxs as jsxs22 } from "react/jsx-runtime";
2854
+ var SIZE_CLASSES2 = {
2855
+ sm: "max-w-sm",
2856
+ md: "max-w-md",
2857
+ lg: "max-w-lg",
2858
+ xl: "max-w-xl",
2859
+ fullscreen: "max-w-full mx-4 my-4 h-[calc(100vh-2rem)]"
2860
+ };
2861
+ var ModalDialog = React18.forwardRef(
2862
+ ({ className, open, onClose, size = "md", children, ...props }, ref) => {
2863
+ React18.useEffect(() => {
2864
+ if (!open) return;
2865
+ const handler = (e) => {
2866
+ if (e.key === "Escape") onClose?.();
2867
+ };
2868
+ document.addEventListener("keydown", handler);
2869
+ return () => document.removeEventListener("keydown", handler);
2870
+ }, [open, onClose]);
2871
+ if (!open) return null;
2872
+ return createPortal(
2873
+ /* @__PURE__ */ jsxs22(Fragment6, { children: [
2874
+ /* @__PURE__ */ jsx29(
2875
+ "div",
2876
+ {
2877
+ className: "z-overlay fixed inset-0 bg-foreground/60 transition-opacity",
2878
+ onClick: onClose,
2879
+ "aria-hidden": "true"
2880
+ }
2881
+ ),
2882
+ /* @__PURE__ */ jsx29("div", { className: "z-modal fixed inset-0 flex items-center justify-center p-4", children: /* @__PURE__ */ jsx29(
2883
+ "div",
2884
+ {
2885
+ ref,
2886
+ role: "dialog",
2887
+ "aria-modal": "true",
2888
+ className: cn(
2889
+ "relative w-full rounded-lg border border-border bg-card shadow-lg",
2890
+ "animate-in fade-in-0 zoom-in-95",
2891
+ SIZE_CLASSES2[size],
2892
+ className
2893
+ ),
2894
+ ...props,
2895
+ children
2896
+ }
2897
+ ) })
2898
+ ] }),
2899
+ document.body
2900
+ );
2901
+ }
2902
+ );
2903
+ ModalDialog.displayName = "ModalDialog";
2904
+ var ModalHeader = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx29(
2905
+ "div",
2906
+ {
2907
+ ref,
2908
+ className: cn("border-b border-border px-6 py-4", className),
2909
+ ...props
2910
+ }
2911
+ ));
2912
+ ModalHeader.displayName = "ModalHeader";
2913
+ var ModalBody = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx29("div", { ref, className: cn("px-6 py-4", className), ...props }));
2914
+ ModalBody.displayName = "ModalBody";
2915
+ var ModalFooter = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx29(
2916
+ "div",
2917
+ {
2918
+ ref,
2919
+ className: cn(
2920
+ "flex items-center justify-end gap-2 border-t border-border px-6 py-4",
2921
+ className
2922
+ ),
2923
+ ...props
2924
+ }
2925
+ ));
2926
+ ModalFooter.displayName = "ModalFooter";
2927
+
2928
+ // src/drawer.tsx
2929
+ import * as React19 from "react";
2930
+ import { createPortal as createPortal2 } from "react-dom";
2931
+ import { Fragment as Fragment7, jsx as jsx30, jsxs as jsxs23 } from "react/jsx-runtime";
2932
+ var SIZE_CLASSES3 = {
2933
+ left: { sm: "w-64", md: "w-80", lg: "w-96" },
2934
+ right: { sm: "w-64", md: "w-80", lg: "w-96" },
2935
+ bottom: { sm: "h-1/3", md: "h-1/2", lg: "h-2/3" }
2936
+ };
2937
+ var POSITION_CLASSES = {
2938
+ left: "inset-y-0 left-0",
2939
+ right: "inset-y-0 right-0",
2940
+ bottom: "inset-x-0 bottom-0"
2941
+ };
2942
+ var Drawer = React19.forwardRef(
2943
+ ({
2944
+ className,
2945
+ open,
2946
+ onClose,
2947
+ side = "right",
2948
+ size = "md",
2949
+ children,
2950
+ ...props
2951
+ }, ref) => {
2952
+ React19.useEffect(() => {
2953
+ if (!open) return;
2954
+ const handler = (e) => {
2955
+ if (e.key === "Escape") onClose?.();
2956
+ };
2957
+ document.addEventListener("keydown", handler);
2958
+ return () => document.removeEventListener("keydown", handler);
2959
+ }, [open, onClose]);
2960
+ if (!open) return null;
2961
+ return createPortal2(
2962
+ /* @__PURE__ */ jsxs23(Fragment7, { children: [
2963
+ /* @__PURE__ */ jsx30(
2964
+ "div",
2965
+ {
2966
+ className: "z-overlay fixed inset-0 bg-foreground/60 transition-opacity",
2967
+ onClick: onClose,
2968
+ "aria-hidden": "true"
2969
+ }
2970
+ ),
2971
+ /* @__PURE__ */ jsx30(
2972
+ "div",
2973
+ {
2974
+ ref,
2975
+ role: "dialog",
2976
+ "aria-modal": "true",
2977
+ className: cn(
2978
+ "z-modal duration-drawer fixed border-border bg-card shadow-lg transition-transform",
2979
+ POSITION_CLASSES[side],
2980
+ SIZE_CLASSES3[side][size],
2981
+ side === "left" && "border-r",
2982
+ side === "right" && "border-l",
2983
+ side === "bottom" && "w-full border-t",
2984
+ className
2985
+ ),
2986
+ ...props,
2987
+ children
2988
+ }
2989
+ )
2990
+ ] }),
2991
+ document.body
2992
+ );
2993
+ }
2994
+ );
2995
+ Drawer.displayName = "Drawer";
2996
+ var DrawerHeader = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx30(
2997
+ "div",
2998
+ {
2999
+ ref,
3000
+ className: cn("border-b border-border px-6 py-4", className),
3001
+ ...props
3002
+ }
3003
+ ));
3004
+ DrawerHeader.displayName = "DrawerHeader";
3005
+ var DrawerBody = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx30(
3006
+ "div",
3007
+ {
3008
+ ref,
3009
+ className: cn("flex-1 overflow-y-auto px-6 py-4", className),
3010
+ ...props
3011
+ }
3012
+ ));
3013
+ DrawerBody.displayName = "DrawerBody";
3014
+ var DrawerFooter = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx30(
3015
+ "div",
3016
+ {
3017
+ ref,
3018
+ className: cn(
3019
+ "flex items-center justify-end gap-2 border-t border-border px-6 py-4",
3020
+ className
3021
+ ),
3022
+ ...props
3023
+ }
3024
+ ));
3025
+ DrawerFooter.displayName = "DrawerFooter";
3026
+
3027
+ // src/form-layout.tsx
3028
+ import * as React20 from "react";
3029
+ import { jsx as jsx31, jsxs as jsxs24 } from "react/jsx-runtime";
3030
+ var FormLayout = React20.forwardRef(
3031
+ ({ className, layout = "stacked", ...props }, ref) => /* @__PURE__ */ jsx31(
3032
+ "form",
3033
+ {
3034
+ ref,
3035
+ className: cn(
3036
+ layout === "stacked" && "space-y-6",
3037
+ layout === "inline" && "flex flex-wrap items-end gap-4",
3038
+ layout === "two-column" && "grid grid-cols-1 gap-6 lg:grid-cols-2",
3039
+ className
3040
+ ),
3041
+ ...props
3042
+ }
3043
+ )
3044
+ );
3045
+ FormLayout.displayName = "FormLayout";
3046
+ var FormLayoutSection = React20.forwardRef(({ className, title, description, children, ...props }, ref) => /* @__PURE__ */ jsxs24(
3047
+ "div",
3048
+ {
3049
+ ref,
3050
+ className: cn("border-b border-border pb-6", className),
3051
+ ...props,
3052
+ children: [
3053
+ (title || description) && /* @__PURE__ */ jsxs24("div", { className: "mb-4", children: [
3054
+ title && /* @__PURE__ */ jsx31("h3", { className: "text-base font-semibold text-foreground", children: title }),
3055
+ description && /* @__PURE__ */ jsx31("p", { className: "mt-1 text-sm text-muted-foreground", children: description })
3056
+ ] }),
3057
+ /* @__PURE__ */ jsx31("div", { className: "space-y-4", children })
3058
+ ]
3059
+ }
3060
+ ));
3061
+ FormLayoutSection.displayName = "FormLayoutSection";
3062
+
3063
+ // src/input-group.tsx
3064
+ import * as React21 from "react";
3065
+ import { jsx as jsx32, jsxs as jsxs25 } from "react/jsx-runtime";
3066
+ var InputGroup = React21.forwardRef(
3067
+ ({
3068
+ className,
3069
+ addon = "prefix",
3070
+ addonContent,
3071
+ suffixContent,
3072
+ children,
3073
+ ...props
3074
+ }, ref) => /* @__PURE__ */ jsxs25(
3075
+ "div",
3076
+ {
3077
+ ref,
3078
+ className: cn("flex rounded-md shadow-sm", className),
3079
+ ...props,
3080
+ children: [
3081
+ (addon === "prefix" || addon === "both") && addonContent && /* @__PURE__ */ jsx32("span", { className: "inline-flex items-center rounded-l-md border border-r-0 border-input bg-muted px-3 text-sm text-muted-foreground", children: addonContent }),
3082
+ /* @__PURE__ */ jsx32(
3083
+ "div",
3084
+ {
3085
+ className: cn(
3086
+ "flex-1 [&>input]:w-full [&>input]:border [&>input]:border-input [&>input]:px-3 [&>input]:py-2 [&>input]:text-sm [&>input]:outline-none [&>input]:focus:ring-2 [&>input]:focus:ring-ring",
3087
+ addon === "prefix" || addon === "both" ? "[&>input]:rounded-l-none [&>input]:rounded-r-md" : addon === "suffix" ? "[&>input]:rounded-l-md [&>input]:rounded-r-none" : "[&>input]:rounded-md"
3088
+ ),
3089
+ children
3090
+ }
3091
+ ),
3092
+ (addon === "suffix" || addon === "both") && (suffixContent || addonContent) && /* @__PURE__ */ jsx32("span", { className: "inline-flex items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-sm text-muted-foreground", children: suffixContent || addonContent })
3093
+ ]
3094
+ }
3095
+ )
3096
+ );
3097
+ InputGroup.displayName = "InputGroup";
3098
+
3099
+ // src/radio-group.tsx
3100
+ import * as React22 from "react";
3101
+ import { jsx as jsx33, jsxs as jsxs26 } from "react/jsx-runtime";
3102
+ var RadioGroup = React22.forwardRef(
3103
+ ({
3104
+ className,
3105
+ options,
3106
+ value,
3107
+ onChange,
3108
+ variant = "simple",
3109
+ name,
3110
+ label,
3111
+ ...props
3112
+ }, ref) => /* @__PURE__ */ jsxs26("fieldset", { ref, className: cn("space-y-2", className), ...props, children: [
3113
+ label && /* @__PURE__ */ jsx33("legend", { className: "mb-2 text-sm font-medium text-foreground", children: label }),
3114
+ /* @__PURE__ */ jsx33(
3115
+ "div",
3116
+ {
3117
+ className: cn(
3118
+ variant === "card" && "grid gap-3 sm:grid-cols-2",
3119
+ variant === "stacked" && "space-y-2",
3120
+ variant === "simple" && "space-y-2"
3121
+ ),
3122
+ children: options.map((option) => {
3123
+ const isSelected = value === option.value;
3124
+ if (variant === "card") {
3125
+ return /* @__PURE__ */ jsxs26(
3126
+ "label",
3127
+ {
3128
+ className: cn(
3129
+ "flex cursor-pointer items-start gap-3 rounded-lg border p-4 transition-colors",
3130
+ isSelected ? "border-primary bg-primary/5" : "border-border bg-card hover:bg-muted/50"
3131
+ ),
3132
+ children: [
3133
+ /* @__PURE__ */ jsx33(
3134
+ "input",
3135
+ {
3136
+ type: "radio",
3137
+ name,
3138
+ value: option.value,
3139
+ checked: isSelected,
3140
+ onChange: () => onChange?.(option.value),
3141
+ className: "mt-0.5 h-4 w-4 accent-primary"
3142
+ }
3143
+ ),
3144
+ /* @__PURE__ */ jsxs26("div", { children: [
3145
+ /* @__PURE__ */ jsx33("span", { className: "text-sm font-medium text-foreground", children: option.label }),
3146
+ option.description && /* @__PURE__ */ jsx33("p", { className: "mt-0.5 text-xs text-muted-foreground", children: option.description })
3147
+ ] })
3148
+ ]
3149
+ },
3150
+ option.value
3151
+ );
3152
+ }
3153
+ return /* @__PURE__ */ jsxs26(
3154
+ "label",
3155
+ {
3156
+ className: cn(
3157
+ "flex cursor-pointer items-center gap-2",
3158
+ variant === "stacked" && "rounded-lg border border-border p-3",
3159
+ variant === "stacked" && isSelected && "border-primary bg-primary/5"
3160
+ ),
3161
+ children: [
3162
+ /* @__PURE__ */ jsx33(
3163
+ "input",
3164
+ {
3165
+ type: "radio",
3166
+ name,
3167
+ value: option.value,
3168
+ checked: isSelected,
3169
+ onChange: () => onChange?.(option.value),
3170
+ className: "h-4 w-4 accent-primary"
3171
+ }
3172
+ ),
3173
+ /* @__PURE__ */ jsx33("span", { className: "text-sm text-foreground", children: option.label }),
3174
+ option.description && variant === "stacked" && /* @__PURE__ */ jsx33("span", { className: "ml-auto text-xs text-muted-foreground", children: option.description })
3175
+ ]
3176
+ },
3177
+ option.value
3178
+ );
3179
+ })
3180
+ }
3181
+ )
3182
+ ] })
3183
+ );
3184
+ RadioGroup.displayName = "RadioGroup";
3185
+
3186
+ // src/combobox.tsx
3187
+ import * as React23 from "react";
3188
+ import { jsx as jsx34, jsxs as jsxs27 } from "react/jsx-runtime";
3189
+ var Combobox = React23.forwardRef(
3190
+ ({
3191
+ className,
3192
+ options,
3193
+ value,
3194
+ onChange,
3195
+ placeholder = "Select...",
3196
+ multi = false,
3197
+ filterable = true,
3198
+ ...props
3199
+ }, ref) => {
3200
+ const [open, setOpen] = React23.useState(false);
3201
+ const [search, setSearch] = React23.useState("");
3202
+ const selected = multi ? Array.isArray(value) ? value : [] : typeof value === "string" ? value : "";
3203
+ const filtered = filterable ? options.filter(
3204
+ (o) => o.label.toLowerCase().includes(search.toLowerCase())
3205
+ ) : options;
3206
+ const handleSelect = (optValue) => {
3207
+ if (!onChange) return;
3208
+ if (multi) {
3209
+ const arr = Array.isArray(selected) ? selected : [];
3210
+ onChange(
3211
+ arr.includes(optValue) ? arr.filter((v) => v !== optValue) : [...arr, optValue]
3212
+ );
3213
+ } else {
3214
+ onChange(optValue);
3215
+ setOpen(false);
3216
+ setSearch("");
3217
+ }
3218
+ };
3219
+ const displayValue = multi ? null : options.find((o) => o.value === selected)?.label;
3220
+ return /* @__PURE__ */ jsxs27("div", { ref, className: cn("relative", className), ...props, children: [
3221
+ /* @__PURE__ */ jsxs27(
3222
+ "div",
3223
+ {
3224
+ className: "flex min-h-9 cursor-pointer items-center gap-1 rounded-md border border-input bg-background px-3 py-1.5",
3225
+ onClick: () => setOpen(!open),
3226
+ children: [
3227
+ multi && Array.isArray(selected) && selected.length > 0 ? /* @__PURE__ */ jsx34("div", { className: "flex flex-wrap gap-1", children: selected.map((v) => /* @__PURE__ */ jsxs27(
3228
+ "span",
3229
+ {
3230
+ className: "inline-flex items-center gap-1 rounded bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",
3231
+ children: [
3232
+ options.find((o) => o.value === v)?.label,
3233
+ /* @__PURE__ */ jsx34(
3234
+ "button",
3235
+ {
3236
+ type: "button",
3237
+ onClick: (e) => {
3238
+ e.stopPropagation();
3239
+ handleSelect(v);
3240
+ },
3241
+ className: "text-primary/60 hover:text-primary",
3242
+ children: "\u2715"
3243
+ }
3244
+ )
3245
+ ]
3246
+ },
3247
+ v
3248
+ )) }) : /* @__PURE__ */ jsx34(
3249
+ "span",
3250
+ {
3251
+ className: cn(
3252
+ "text-sm",
3253
+ displayValue ? "text-foreground" : "text-muted-foreground"
3254
+ ),
3255
+ children: displayValue || placeholder
3256
+ }
3257
+ ),
3258
+ /* @__PURE__ */ jsx34("span", { className: "ml-auto text-muted-foreground", children: "\u25BE" })
3259
+ ]
3260
+ }
3261
+ ),
3262
+ open && /* @__PURE__ */ jsxs27("div", { className: "z-dropdown absolute mt-1 w-full rounded-md border border-border bg-card shadow-lg", children: [
3263
+ filterable && /* @__PURE__ */ jsx34("div", { className: "border-b border-border p-2", children: /* @__PURE__ */ jsx34(
3264
+ "input",
3265
+ {
3266
+ type: "text",
3267
+ className: "w-full rounded border-0 bg-transparent px-2 py-1 text-sm text-foreground outline-none placeholder:text-muted-foreground",
3268
+ placeholder: "Search...",
3269
+ value: search,
3270
+ onChange: (e) => setSearch(e.target.value),
3271
+ autoFocus: true
3272
+ }
3273
+ ) }),
3274
+ /* @__PURE__ */ jsx34("div", { className: "max-h-60 overflow-y-auto p-1", children: filtered.length === 0 ? /* @__PURE__ */ jsx34("div", { className: "px-3 py-2 text-sm text-muted-foreground", children: "No results" }) : filtered.map((option) => {
3275
+ const isSelected = multi ? Array.isArray(selected) && selected.includes(option.value) : selected === option.value;
3276
+ return /* @__PURE__ */ jsxs27(
3277
+ "button",
3278
+ {
3279
+ type: "button",
3280
+ className: cn(
3281
+ "flex w-full items-center rounded-sm px-3 py-2 text-left text-sm transition-colors",
3282
+ isSelected ? "bg-primary/10 font-medium text-primary" : "text-foreground hover:bg-muted"
3283
+ ),
3284
+ onClick: () => handleSelect(option.value),
3285
+ children: [
3286
+ multi && /* @__PURE__ */ jsx34("span", { className: "mr-2", children: isSelected ? "\u2611" : "\u2610" }),
3287
+ option.label,
3288
+ !multi && isSelected && /* @__PURE__ */ jsx34("span", { className: "ml-auto text-primary", children: "\u2713" })
3289
+ ]
3290
+ },
3291
+ option.value
3292
+ );
3293
+ }) })
3294
+ ] })
3295
+ ] });
3296
+ }
3297
+ );
3298
+ Combobox.displayName = "Combobox";
3299
+
3300
+ // src/notification-banner.tsx
3301
+ import * as React24 from "react";
3302
+ import { jsx as jsx35, jsxs as jsxs28 } from "react/jsx-runtime";
3303
+ var INTENT_STYLES = {
3304
+ success: {
3305
+ subtle: "bg-intent-success/10 text-intent-success-foreground border-intent-success/20",
3306
+ solid: "bg-intent-success text-primary-foreground",
3307
+ accent: "border-l-4 border-l-intent-success bg-intent-success/5 text-intent-success-foreground"
3308
+ },
3309
+ warning: {
3310
+ subtle: "bg-intent-warning/10 text-intent-warning-foreground border-intent-warning/20",
3311
+ solid: "bg-intent-warning text-primary-foreground",
3312
+ accent: "border-l-4 border-l-intent-warning bg-intent-warning/5 text-intent-warning-foreground"
3313
+ },
3314
+ error: {
3315
+ subtle: "bg-intent-error/10 text-intent-error-foreground border-intent-error/20",
3316
+ solid: "bg-intent-error text-primary-foreground",
3317
+ accent: "border-l-4 border-l-intent-error bg-intent-error/5 text-intent-error-foreground"
3318
+ },
3319
+ info: {
3320
+ subtle: "bg-intent-info/10 text-intent-info-foreground border-intent-info/20",
3321
+ solid: "bg-intent-info text-primary-foreground",
3322
+ accent: "border-l-4 border-l-intent-info bg-intent-info/5 text-intent-info-foreground"
3323
+ }
3324
+ };
3325
+ var ICON_MAP = {
3326
+ success: "\u2713",
3327
+ warning: "\u26A0",
3328
+ error: "\u2715",
3329
+ info: "\u2139"
3330
+ };
3331
+ var NotificationBanner = React24.forwardRef(
3332
+ ({
3333
+ className,
3334
+ intent = "info",
3335
+ variant = "subtle",
3336
+ title,
3337
+ dismissible,
3338
+ onDismiss,
3339
+ action,
3340
+ children,
3341
+ ...props
3342
+ }, ref) => {
3343
+ const [dismissed, setDismissed] = React24.useState(false);
3344
+ if (dismissed) return null;
3345
+ const handleDismiss = () => {
3346
+ setDismissed(true);
3347
+ onDismiss?.();
3348
+ };
3349
+ return /* @__PURE__ */ jsxs28(
3350
+ "div",
3351
+ {
3352
+ ref,
3353
+ role: "status",
3354
+ className: cn(
3355
+ "flex items-start gap-3 rounded-lg border p-4",
3356
+ INTENT_STYLES[intent][variant],
3357
+ className
3358
+ ),
3359
+ ...props,
3360
+ children: [
3361
+ /* @__PURE__ */ jsx35("span", { className: "flex-shrink-0 text-lg", "aria-hidden": "true", children: ICON_MAP[intent] }),
3362
+ /* @__PURE__ */ jsxs28("div", { className: "min-w-0 flex-1", children: [
3363
+ title && /* @__PURE__ */ jsx35("p", { className: "font-semibold", children: title }),
3364
+ children && /* @__PURE__ */ jsx35("div", { className: cn(title && "mt-1", "text-sm"), children })
3365
+ ] }),
3366
+ action && /* @__PURE__ */ jsx35("div", { className: "flex-shrink-0", children: action }),
3367
+ dismissible && /* @__PURE__ */ jsx35(
3368
+ "button",
3369
+ {
3370
+ type: "button",
3371
+ onClick: handleDismiss,
3372
+ className: "flex-shrink-0 text-current opacity-60 transition-opacity hover:opacity-100",
3373
+ "aria-label": "Dismiss",
3374
+ children: "\u2715"
3375
+ }
3376
+ )
3377
+ ]
3378
+ }
3379
+ );
3380
+ }
3381
+ );
3382
+ NotificationBanner.displayName = "NotificationBanner";
3383
+
3384
+ // src/notification-panel.tsx
3385
+ import * as React25 from "react";
3386
+ import { jsx as jsx36, jsxs as jsxs29 } from "react/jsx-runtime";
3387
+ var NotificationPanel = React25.forwardRef(({ className, unreadCount = 0, onMarkAllRead, children, ...props }, ref) => /* @__PURE__ */ jsxs29(
3388
+ "div",
3389
+ {
3390
+ ref,
3391
+ className: cn(
3392
+ "w-80 rounded-lg border border-border bg-card shadow-lg",
3393
+ className
3394
+ ),
3395
+ ...props,
3396
+ children: [
3397
+ /* @__PURE__ */ jsxs29("div", { className: "flex items-center justify-between border-b border-border px-4 py-3", children: [
3398
+ /* @__PURE__ */ jsxs29("h3", { className: "text-sm font-semibold text-foreground", children: [
3399
+ "Notifications",
3400
+ unreadCount > 0 && /* @__PURE__ */ jsx36("span", { className: "ml-2 inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-primary px-1.5 text-xs text-primary-foreground", children: unreadCount })
3401
+ ] }),
3402
+ onMarkAllRead && unreadCount > 0 && /* @__PURE__ */ jsx36(
3403
+ "button",
3404
+ {
3405
+ type: "button",
3406
+ onClick: onMarkAllRead,
3407
+ className: "text-xs text-primary hover:underline",
3408
+ children: "Mark all read"
3409
+ }
3410
+ )
3411
+ ] }),
3412
+ /* @__PURE__ */ jsx36("div", { className: "max-h-80 divide-y divide-border overflow-y-auto", children })
3413
+ ]
3414
+ }
3415
+ ));
3416
+ NotificationPanel.displayName = "NotificationPanel";
3417
+ var NotificationPanelItem = React25.forwardRef(({ className, title, description, time, unread, icon, ...props }, ref) => /* @__PURE__ */ jsxs29(
3418
+ "div",
3419
+ {
3420
+ ref,
3421
+ className: cn(
3422
+ "flex gap-3 px-4 py-3 transition-colors hover:bg-muted/50",
3423
+ unread && "bg-primary/5",
3424
+ className
3425
+ ),
3426
+ ...props,
3427
+ children: [
3428
+ icon && /* @__PURE__ */ jsx36("div", { className: "flex-shrink-0 pt-0.5", children: icon }),
3429
+ /* @__PURE__ */ jsxs29("div", { className: "min-w-0 flex-1", children: [
3430
+ /* @__PURE__ */ jsx36(
3431
+ "p",
3432
+ {
3433
+ className: cn(
3434
+ "text-sm",
3435
+ unread ? "font-semibold text-foreground" : "text-foreground"
3436
+ ),
3437
+ children: title
3438
+ }
3439
+ ),
3440
+ description && /* @__PURE__ */ jsx36("p", { className: "mt-0.5 text-xs text-muted-foreground", children: description }),
3441
+ time && /* @__PURE__ */ jsx36("p", { className: "mt-1 text-xs text-muted-foreground", children: time })
3442
+ ] }),
3443
+ unread && /* @__PURE__ */ jsx36("div", { className: "flex-shrink-0 pt-1.5", children: /* @__PURE__ */ jsx36("div", { className: "h-2 w-2 rounded-full bg-primary" }) })
3444
+ ]
3445
+ }
3446
+ ));
3447
+ NotificationPanelItem.displayName = "NotificationPanelItem";
3448
+
3449
+ // src/skeleton-patterns.tsx
3450
+ import { jsx as jsx37, jsxs as jsxs30 } from "react/jsx-runtime";
3451
+ function SkeletonBar2({
3452
+ className,
3453
+ ...props
3454
+ }) {
3455
+ return /* @__PURE__ */ jsx37(
3456
+ "div",
3457
+ {
3458
+ className: cn("animate-pulse rounded-md bg-muted", className),
3459
+ ...props
3460
+ }
3461
+ );
3462
+ }
3463
+ function SkeletonTable({
3464
+ className,
3465
+ rows = 5,
3466
+ columns = 4,
3467
+ ...props
3468
+ }) {
3469
+ return /* @__PURE__ */ jsxs30(
3470
+ "div",
3471
+ {
3472
+ className: cn(
3473
+ "w-full overflow-hidden rounded-lg border border-border",
3474
+ className
3475
+ ),
3476
+ ...props,
3477
+ children: [
3478
+ /* @__PURE__ */ jsx37("div", { className: "flex gap-4 border-b border-border bg-muted/50 px-4 py-3", children: Array.from({ length: columns }).map((_, i) => /* @__PURE__ */ jsx37(SkeletonBar2, { className: "h-4 flex-1" }, `h-${i}`)) }),
3479
+ Array.from({ length: rows }).map((_, row) => /* @__PURE__ */ jsx37(
3480
+ "div",
3481
+ {
3482
+ className: cn(
3483
+ "flex gap-4 px-4 py-3",
3484
+ row < rows - 1 && "border-b border-border"
3485
+ ),
3486
+ children: Array.from({ length: columns }).map((_2, col) => /* @__PURE__ */ jsx37(
3487
+ SkeletonBar2,
3488
+ {
3489
+ className: cn("h-4 flex-1", col === 0 && "max-w-[140px]")
3490
+ },
3491
+ `c-${row}-${col}`
3492
+ ))
3493
+ },
3494
+ `r-${row}`
3495
+ ))
3496
+ ]
3497
+ }
3498
+ );
3499
+ }
3500
+ SkeletonTable.displayName = "SkeletonTable";
3501
+ function SkeletonCardGrid({
3502
+ className,
3503
+ cards = 6,
3504
+ columns = 3,
3505
+ ...props
3506
+ }) {
3507
+ const colClass = columns === 2 ? "grid-cols-1 sm:grid-cols-2" : "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3";
3508
+ return /* @__PURE__ */ jsx37("div", { className: cn("grid gap-4", colClass, className), ...props, children: Array.from({ length: cards }).map((_, i) => /* @__PURE__ */ jsxs30(
3509
+ "div",
3510
+ {
3511
+ className: "space-y-3 rounded-lg border border-border p-4",
3512
+ children: [
3513
+ /* @__PURE__ */ jsx37(SkeletonBar2, { className: "h-4 w-3/4" }),
3514
+ /* @__PURE__ */ jsx37(SkeletonBar2, { className: "h-3 w-full" }),
3515
+ /* @__PURE__ */ jsx37(SkeletonBar2, { className: "h-3 w-5/6" }),
3516
+ /* @__PURE__ */ jsxs30("div", { className: "flex gap-2 pt-2", children: [
3517
+ /* @__PURE__ */ jsx37(SkeletonBar2, { className: "h-6 w-6 rounded-full" }),
3518
+ /* @__PURE__ */ jsx37(SkeletonBar2, { className: "h-4 w-20" })
3519
+ ] })
3520
+ ]
3521
+ },
3522
+ `card-${i}`
3523
+ )) });
3524
+ }
3525
+ SkeletonCardGrid.displayName = "SkeletonCardGrid";
3526
+ function SkeletonDetail({ className, ...props }) {
3527
+ return /* @__PURE__ */ jsxs30("div", { className: cn("space-y-6", className), ...props, children: [
3528
+ /* @__PURE__ */ jsxs30("div", { className: "space-y-2", children: [
3529
+ /* @__PURE__ */ jsx37(SkeletonBar2, { className: "h-8 w-1/3" }),
3530
+ /* @__PURE__ */ jsx37(SkeletonBar2, { className: "h-4 w-2/3" })
3531
+ ] }),
3532
+ /* @__PURE__ */ jsx37("div", { className: "space-y-4", children: Array.from({ length: 4 }).map((_, i) => /* @__PURE__ */ jsxs30("div", { className: "flex justify-between", children: [
3533
+ /* @__PURE__ */ jsx37(SkeletonBar2, { className: "h-4 w-24" }),
3534
+ /* @__PURE__ */ jsx37(SkeletonBar2, { className: "h-4 w-40" })
3535
+ ] }, `dl-${i}`)) }),
3536
+ /* @__PURE__ */ jsxs30("div", { className: "space-y-2", children: [
3537
+ /* @__PURE__ */ jsx37(SkeletonBar2, { className: "h-4 w-full" }),
3538
+ /* @__PURE__ */ jsx37(SkeletonBar2, { className: "h-4 w-full" }),
3539
+ /* @__PURE__ */ jsx37(SkeletonBar2, { className: "h-4 w-3/4" })
3540
+ ] })
3541
+ ] });
3542
+ }
3543
+ SkeletonDetail.displayName = "SkeletonDetail";
3544
+
3545
+ // src/toggle.tsx
3546
+ import * as React26 from "react";
3547
+ import { jsx as jsx38 } from "react/jsx-runtime";
3548
+ var SIZE_CLASSES4 = {
3549
+ sm: "h-8 px-2 text-xs",
3550
+ md: "h-9 px-3 text-sm",
3551
+ lg: "h-10 px-4 text-base"
3552
+ };
3553
+ var Toggle = React26.forwardRef(
3554
+ ({ className, pressed, variant = "default", size = "md", ...props }, ref) => /* @__PURE__ */ jsx38(
3555
+ "button",
3556
+ {
3557
+ ref,
3558
+ type: "button",
3559
+ "aria-pressed": pressed,
3560
+ "data-state": pressed ? "on" : "off",
3561
+ className: cn(
3562
+ "inline-flex items-center justify-center rounded-md font-medium transition-colors",
3563
+ SIZE_CLASSES4[size],
3564
+ variant === "outline" && "border border-input",
3565
+ pressed ? "bg-muted text-foreground" : "bg-transparent text-muted-foreground hover:bg-muted/50 hover:text-foreground",
3566
+ className
3567
+ ),
3568
+ ...props
3569
+ }
3570
+ )
3571
+ );
3572
+ Toggle.displayName = "Toggle";
3573
+ var ToggleGroup = React26.forwardRef(
3574
+ ({
3575
+ className,
3576
+ type = "single",
3577
+ value,
3578
+ onValueChange,
3579
+ variant = "default",
3580
+ size = "md",
3581
+ children,
3582
+ ...props
3583
+ }, ref) => {
3584
+ const isPressed = (itemValue) => {
3585
+ if (!value) return false;
3586
+ if (type === "single") return value === itemValue;
3587
+ return Array.isArray(value) && value.includes(itemValue);
3588
+ };
3589
+ const handleToggle = (itemValue) => {
3590
+ if (!onValueChange) return;
3591
+ if (type === "single") {
3592
+ onValueChange(value === itemValue ? "" : itemValue);
3593
+ } else {
3594
+ const arr = Array.isArray(value) ? value : [];
3595
+ onValueChange(
3596
+ arr.includes(itemValue) ? arr.filter((v) => v !== itemValue) : [...arr, itemValue]
3597
+ );
3598
+ }
3599
+ };
3600
+ return /* @__PURE__ */ jsx38(
3601
+ "div",
3602
+ {
3603
+ ref,
3604
+ role: "group",
3605
+ className: cn("inline-flex items-center gap-1", className),
3606
+ ...props,
3607
+ children: React26.Children.map(children, (child) => {
3608
+ if (!React26.isValidElement(child)) return child;
3609
+ const childProps = child.props;
3610
+ const itemValue = childProps.value ?? "";
3611
+ return React26.cloneElement(child, {
3612
+ pressed: isPressed(itemValue),
3613
+ variant,
3614
+ size,
3615
+ onClick: (e) => {
3616
+ childProps.onClick?.(e);
3617
+ handleToggle(itemValue);
3618
+ }
3619
+ });
3620
+ })
3621
+ }
3622
+ );
3623
+ }
3624
+ );
3625
+ ToggleGroup.displayName = "ToggleGroup";
3626
+
3627
+ // src/avatar-group.tsx
3628
+ import * as React27 from "react";
3629
+ import { jsx as jsx39, jsxs as jsxs31 } from "react/jsx-runtime";
3630
+ var SIZE_MAP = {
3631
+ xs: { avatar: "h-6 w-6", ring: "ring-1", text: "text-[10px]" },
3632
+ sm: { avatar: "h-8 w-8", ring: "ring-2", text: "text-xs" },
3633
+ md: { avatar: "h-10 w-10", ring: "ring-2", text: "text-sm" },
3634
+ lg: { avatar: "h-12 w-12", ring: "ring-2", text: "text-base" }
3635
+ };
3636
+ var OVERLAP_MAP = {
3637
+ xs: "-ml-2",
3638
+ sm: "-ml-2",
3639
+ md: "-ml-3",
3640
+ lg: "-ml-3"
3641
+ };
3642
+ var AvatarGroup = React27.forwardRef(
3643
+ ({ className, max = 5, size = "md", children, ...props }, ref) => {
3644
+ const items = React27.Children.toArray(children);
3645
+ const visible = items.slice(0, max);
3646
+ const overflow = items.length - max;
3647
+ const sizeConfig3 = SIZE_MAP[size];
3648
+ return /* @__PURE__ */ jsxs31("div", { ref, className: cn("flex items-center", className), ...props, children: [
3649
+ visible.map((child, i) => /* @__PURE__ */ jsx39(
3650
+ "div",
3651
+ {
3652
+ className: cn(
3653
+ "relative inline-block rounded-full ring ring-background",
3654
+ sizeConfig3.ring,
3655
+ i > 0 && OVERLAP_MAP[size]
3656
+ ),
3657
+ children: child
3658
+ },
3659
+ i
3660
+ )),
3661
+ overflow > 0 && /* @__PURE__ */ jsx39(
3662
+ "div",
3663
+ {
3664
+ className: cn(
3665
+ "relative inline-flex items-center justify-center rounded-full bg-muted ring ring-background",
3666
+ sizeConfig3.avatar,
3667
+ sizeConfig3.ring,
3668
+ OVERLAP_MAP[size]
3669
+ ),
3670
+ children: /* @__PURE__ */ jsxs31(
3671
+ "span",
3672
+ {
3673
+ className: cn(
3674
+ "font-medium text-muted-foreground",
3675
+ sizeConfig3.text
3676
+ ),
3677
+ children: [
3678
+ "+",
3679
+ overflow
3680
+ ]
3681
+ }
3682
+ )
3683
+ }
3684
+ )
3685
+ ] });
3686
+ }
3687
+ );
3688
+ AvatarGroup.displayName = "AvatarGroup";
3689
+ var AvatarGroupItem = React27.forwardRef(({ className, fallback, size = "md", alt, src, ...props }, ref) => {
3690
+ const sizeConfig3 = SIZE_MAP[size];
3691
+ if (!src && fallback) {
3692
+ return /* @__PURE__ */ jsx39(
3693
+ "div",
3694
+ {
3695
+ className: cn(
3696
+ "flex items-center justify-center rounded-full bg-primary text-primary-foreground",
3697
+ sizeConfig3.avatar,
3698
+ sizeConfig3.text,
3699
+ "font-medium",
3700
+ className
3701
+ ),
3702
+ children: fallback
3703
+ }
3704
+ );
3705
+ }
3706
+ return /* @__PURE__ */ jsx39(
3707
+ "img",
3708
+ {
3709
+ ref,
3710
+ src,
3711
+ alt,
3712
+ className: cn("rounded-full object-cover", sizeConfig3.avatar, className),
3713
+ ...props
3714
+ }
3715
+ );
3716
+ });
3717
+ AvatarGroupItem.displayName = "AvatarGroupItem";
3718
+
3719
+ // src/tab-bar.tsx
3720
+ import * as React28 from "react";
3721
+ import { jsx as jsx40 } from "react/jsx-runtime";
3722
+ var TabBar = React28.forwardRef(
3723
+ ({ className, variant = "underline", children, ...props }, ref) => /* @__PURE__ */ jsx40(
3724
+ "div",
3725
+ {
3726
+ ref,
3727
+ role: "tablist",
3728
+ className: cn(
3729
+ "flex",
3730
+ variant === "underline" && "gap-4 border-b border-border",
3731
+ variant === "pills" && "gap-1 rounded-lg bg-muted p-1",
3732
+ variant === "enclosed" && "border-b border-border",
3733
+ className
3734
+ ),
3735
+ "data-variant": variant,
3736
+ ...props,
3737
+ children: React28.Children.map(children, (child) => {
3738
+ if (!React28.isValidElement(child)) return child;
3739
+ return React28.cloneElement(
3740
+ child,
3741
+ { _variant: variant }
3742
+ );
3743
+ })
3744
+ }
3745
+ )
3746
+ );
3747
+ TabBar.displayName = "TabBar";
3748
+ var TabBarItem = React28.forwardRef(
3749
+ ({ className, active, disabled, _variant: variant = "underline", ...props }, ref) => /* @__PURE__ */ jsx40(
3750
+ "button",
3751
+ {
3752
+ ref,
3753
+ type: "button",
3754
+ role: "tab",
3755
+ "aria-selected": active,
3756
+ "aria-disabled": disabled || void 0,
3757
+ disabled,
3758
+ className: cn(
3759
+ "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-colors",
3760
+ disabled && "pointer-events-none opacity-50",
3761
+ // Underline
3762
+ variant === "underline" && [
3763
+ "border-b-2 px-1 pb-3",
3764
+ active ? "border-primary text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
3765
+ ],
3766
+ // Pills
3767
+ variant === "pills" && [
3768
+ "rounded-md px-3 py-1.5",
3769
+ active ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
3770
+ ],
3771
+ // Enclosed
3772
+ variant === "enclosed" && [
3773
+ "-mb-px rounded-t-md border border-b-0 px-4 py-2",
3774
+ active ? "border-border bg-background text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
3775
+ ],
3776
+ className
3777
+ ),
3778
+ ...props
3779
+ }
3780
+ )
3781
+ );
3782
+ TabBarItem.displayName = "TabBarItem";
3783
+
3784
+ // src/sticky-action-bar.tsx
3785
+ import { jsx as jsx41, jsxs as jsxs32 } from "react/jsx-runtime";
3786
+ function StickyActionBar({
3787
+ context,
3788
+ actions,
3789
+ topClassName = "top-16",
3790
+ className,
3791
+ testId = "sticky-action-bar"
3792
+ }) {
3793
+ return /* @__PURE__ */ jsx41(
3794
+ "div",
3795
+ {
3796
+ "data-testid": testId,
3797
+ className: cn(
3798
+ // z-30: above page content, below the app header (z-40) and below any
3799
+ // Drawer/modal overlay (z-overlay 60 / z-modal 70).
3800
+ "sticky z-30 -mx-4 mb-6 border-b border-border bg-background/85 px-4 py-3 backdrop-blur-sm sm:-mx-6 sm:px-6",
3801
+ topClassName,
3802
+ className
3803
+ ),
3804
+ children: /* @__PURE__ */ jsxs32("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
3805
+ context != null ? /* @__PURE__ */ jsx41("div", { className: "flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1.5", children: context }) : /* @__PURE__ */ jsx41("span", {}),
3806
+ /* @__PURE__ */ jsx41("div", { className: "flex shrink-0 items-center gap-2", children: actions })
3807
+ ] })
3808
+ }
3809
+ );
3810
+ }
3811
+
3812
+ // src/button-group.tsx
3813
+ import * as React29 from "react";
3814
+ import { jsx as jsx42 } from "react/jsx-runtime";
3815
+ var SIZE_CLASSES5 = {
3816
+ sm: "h-8 px-3 text-xs",
3817
+ md: "h-9 px-4 text-sm",
3818
+ lg: "h-10 px-5 text-base"
3819
+ };
3820
+ var ButtonGroup = React29.forwardRef(
3821
+ ({ className, variant = "default", size = "md", children, ...props }, ref) => /* @__PURE__ */ jsx42(
3822
+ "div",
3823
+ {
3824
+ ref,
3825
+ role: "group",
3826
+ className: cn(
3827
+ "inline-flex",
3828
+ variant === "segmented" && "rounded-md border border-input bg-muted p-0.5",
3829
+ className
3830
+ ),
3831
+ "data-variant": variant,
3832
+ "data-size": size,
3833
+ ...props,
3834
+ children: React29.Children.map(children, (child) => {
3835
+ if (!React29.isValidElement(child)) return child;
3836
+ return React29.cloneElement(
3837
+ child,
3838
+ { _variant: variant, _size: size }
3839
+ );
3840
+ })
3841
+ }
3842
+ )
3843
+ );
3844
+ ButtonGroup.displayName = "ButtonGroup";
3845
+ var ButtonGroupItem = React29.forwardRef(
3846
+ ({
3847
+ className,
3848
+ active,
3849
+ _variant: variant = "default",
3850
+ _size: size = "md",
3851
+ ...props
3852
+ }, ref) => /* @__PURE__ */ jsx42(
3853
+ "button",
3854
+ {
3855
+ ref,
3856
+ type: "button",
3857
+ className: cn(
3858
+ "inline-flex items-center justify-center font-medium transition-colors",
3859
+ SIZE_CLASSES5[size],
3860
+ // Default: connected bordered buttons
3861
+ variant === "default" && [
3862
+ "border border-input bg-background text-foreground hover:bg-muted",
3863
+ "-ml-px first:ml-0 first:rounded-l-md last:rounded-r-md",
3864
+ active && "bg-muted font-semibold"
3865
+ ],
3866
+ // Outlined: like default but no fill
3867
+ variant === "outlined" && [
3868
+ "border border-input bg-transparent text-foreground hover:bg-muted",
3869
+ "-ml-px first:ml-0 first:rounded-l-md last:rounded-r-md",
3870
+ active && "bg-muted font-semibold"
3871
+ ],
3872
+ // Segmented: pill-style inside a container
3873
+ variant === "segmented" && [
3874
+ "rounded-sm text-muted-foreground",
3875
+ active && "bg-background font-semibold text-foreground shadow-sm"
3876
+ ],
3877
+ className
3878
+ ),
3879
+ "aria-pressed": active,
3880
+ ...props
3881
+ }
3882
+ )
3883
+ );
3884
+ ButtonGroupItem.displayName = "ButtonGroupItem";
3885
+
3886
+ // src/data-table.tsx
3887
+ import * as React30 from "react";
3888
+ import { jsx as jsx43, jsxs as jsxs33 } from "react/jsx-runtime";
3889
+ var DataTable = React30.forwardRef(
3890
+ ({
3891
+ className,
3892
+ density = "default",
3893
+ striped = false,
3894
+ bordered = false,
3895
+ ...props
3896
+ }, ref) => /* @__PURE__ */ jsx43("div", { className: "w-full overflow-x-auto", children: /* @__PURE__ */ jsx43(
3897
+ "table",
3898
+ {
3899
+ ref,
3900
+ className: cn(
3901
+ "w-full caption-bottom text-sm",
3902
+ bordered && "border border-border",
3903
+ className
3904
+ ),
3905
+ "data-density": density,
3906
+ "data-striped": striped,
3907
+ ...props
3908
+ }
3909
+ ) })
3910
+ );
3911
+ DataTable.displayName = "DataTable";
3912
+ var TableHeader = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx43(
3913
+ "thead",
3914
+ {
3915
+ ref,
3916
+ className: cn("border-b border-border bg-muted/50", className),
3917
+ ...props
3918
+ }
3919
+ ));
3920
+ TableHeader.displayName = "TableHeader";
3921
+ var TableBody = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx43(
3922
+ "tbody",
3923
+ {
3924
+ ref,
3925
+ className: cn("[&_tr:last-child]:border-0", className),
3926
+ ...props
3927
+ }
3928
+ ));
3929
+ TableBody.displayName = "TableBody";
3930
+ var TableRow = React30.forwardRef(
3931
+ ({ className, selected, ...props }, ref) => /* @__PURE__ */ jsx43(
3932
+ "tr",
3933
+ {
3934
+ ref,
3935
+ className: cn(
3936
+ "border-b border-border transition-colors",
3937
+ "hover:bg-muted/50",
3938
+ selected && "bg-primary/5",
3939
+ // Striped rows via parent data attribute
3940
+ '[table[data-striped="true"]_&:nth-child(even)]:bg-muted/30',
3941
+ className
3942
+ ),
3943
+ "data-selected": selected,
3944
+ ...props
3945
+ }
3946
+ )
3947
+ );
3948
+ TableRow.displayName = "TableRow";
3949
+ var DENSITY_CELL = {
3950
+ compact: "px-3 py-1",
3951
+ default: "px-4 py-2",
3952
+ relaxed: "px-4 py-3"
3953
+ };
3954
+ var TableCell = React30.forwardRef(
3955
+ ({ className, header, sortDirection, onSort, children, ...props }, ref) => {
3956
+ const Tag = header ? "th" : "td";
3957
+ const sortIndicator = sortDirection === "asc" ? " \u2191" : sortDirection === "desc" ? " \u2193" : "";
3958
+ return /* @__PURE__ */ jsxs33(
3959
+ Tag,
3960
+ {
3961
+ ref,
3962
+ className: cn(
3963
+ DENSITY_CELL.default,
3964
+ "text-left align-middle",
3965
+ header ? "font-medium text-muted-foreground" : "text-foreground",
3966
+ onSort && "cursor-pointer select-none hover:text-foreground",
3967
+ className
3968
+ ),
3969
+ onClick: onSort,
3970
+ ...props,
3971
+ children: [
3972
+ children,
3973
+ header && sortIndicator && /* @__PURE__ */ jsx43("span", { className: "ml-1 text-primary", children: sortIndicator })
3974
+ ]
3975
+ }
3976
+ );
3977
+ }
3978
+ );
3979
+ TableCell.displayName = "TableCell";
3980
+ var TableCaption = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx43(
3981
+ "caption",
3982
+ {
3983
+ ref,
3984
+ className: cn("mt-4 text-sm text-muted-foreground", className),
3985
+ ...props
3986
+ }
3987
+ ));
3988
+ TableCaption.displayName = "TableCaption";
3989
+
3990
+ // src/stat-group.tsx
3991
+ import * as React31 from "react";
3992
+ import { jsx as jsx44 } from "react/jsx-runtime";
3993
+ var COL_CLASSES = {
3994
+ 2: "grid-cols-1 sm:grid-cols-2",
3995
+ 3: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",
3996
+ 4: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"
3997
+ };
3998
+ var StatGroup = React31.forwardRef(
3999
+ ({ className, columns = 3, variant = "card", children, ...props }, ref) => /* @__PURE__ */ jsx44(
4000
+ "div",
4001
+ {
4002
+ ref,
4003
+ className: cn(
4004
+ "grid gap-4",
4005
+ COL_CLASSES[columns],
4006
+ variant === "inline" && "divide-y divide-border sm:divide-x sm:divide-y-0",
4007
+ className
4008
+ ),
4009
+ ...props,
4010
+ children
4011
+ }
4012
+ )
4013
+ );
4014
+ StatGroup.displayName = "StatGroup";
4015
+
4016
+ // src/description-list.tsx
4017
+ import * as React32 from "react";
4018
+ import { jsx as jsx45, jsxs as jsxs34 } from "react/jsx-runtime";
4019
+ var DescriptionList = React32.forwardRef(({ className, layout = "stacked", ...props }, ref) => /* @__PURE__ */ jsx45(
4020
+ "dl",
4021
+ {
4022
+ ref,
4023
+ className: cn(
4024
+ layout === "grid" && "grid grid-cols-1 gap-4 sm:grid-cols-2",
4025
+ layout === "side-by-side" && "divide-y divide-border",
4026
+ layout === "stacked" && "space-y-4",
4027
+ className
4028
+ ),
4029
+ ...props
4030
+ }
4031
+ ));
4032
+ DescriptionList.displayName = "DescriptionList";
4033
+ var DescriptionItem = React32.forwardRef(
4034
+ ({ className, label, value, layout = "stacked", ...props }, ref) => /* @__PURE__ */ jsxs34(
4035
+ "div",
4036
+ {
4037
+ ref,
4038
+ className: cn(
4039
+ layout === "side-by-side" && "flex justify-between py-3 sm:gap-4",
4040
+ layout === "stacked" && "",
4041
+ layout === "grid" && "",
4042
+ className
4043
+ ),
4044
+ ...props,
4045
+ children: [
4046
+ /* @__PURE__ */ jsx45(
4047
+ "dt",
4048
+ {
4049
+ className: cn(
4050
+ "text-sm font-medium text-muted-foreground",
4051
+ layout === "side-by-side" && "flex-shrink-0"
4052
+ ),
4053
+ children: label
4054
+ }
4055
+ ),
4056
+ /* @__PURE__ */ jsx45(
4057
+ "dd",
4058
+ {
4059
+ className: cn(
4060
+ "text-sm text-foreground",
4061
+ layout === "stacked" && "mt-1",
4062
+ layout === "side-by-side" && "text-right"
4063
+ ),
4064
+ children: value
4065
+ }
4066
+ )
4067
+ ]
4068
+ }
4069
+ )
4070
+ );
4071
+ DescriptionItem.displayName = "DescriptionItem";
4072
+
4073
+ // src/activity-feed.tsx
4074
+ import * as React33 from "react";
4075
+ import { jsx as jsx46, jsxs as jsxs35 } from "react/jsx-runtime";
4076
+ var ActivityFeed = React33.forwardRef(
4077
+ ({ className, variant = "simple", ...props }, ref) => /* @__PURE__ */ jsx46(
4078
+ "div",
4079
+ {
4080
+ ref,
4081
+ className: cn("relative", className),
4082
+ "data-variant": variant,
4083
+ ...props
4084
+ }
4085
+ )
4086
+ );
4087
+ ActivityFeed.displayName = "ActivityFeed";
4088
+ var ActivityFeedItem = React33.forwardRef(
4089
+ ({ className, avatar, eventDescription, timestamp, isLast, ...props }, ref) => /* @__PURE__ */ jsxs35(
4090
+ "div",
4091
+ {
4092
+ ref,
4093
+ className: cn("relative flex gap-3 pb-6", className),
4094
+ ...props,
4095
+ children: [
4096
+ !isLast && /* @__PURE__ */ jsx46("div", { className: "absolute left-5 top-10 -ml-px h-full w-0.5 bg-muted" }),
4097
+ /* @__PURE__ */ jsx46("div", { className: "relative flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted", children: avatar }),
4098
+ /* @__PURE__ */ jsxs35("div", { className: "min-w-0 flex-1 pt-1", children: [
4099
+ /* @__PURE__ */ jsx46("div", { className: "text-sm text-foreground", children: eventDescription }),
4100
+ timestamp && /* @__PURE__ */ jsx46("p", { className: "mt-0.5 text-xs text-muted-foreground", children: timestamp })
4101
+ ] })
4102
+ ]
4103
+ }
4104
+ )
4105
+ );
4106
+ ActivityFeedItem.displayName = "ActivityFeedItem";
4107
+
4108
+ // src/alert.tsx
4109
+ import * as React34 from "react";
4110
+ import { jsx as jsx47, jsxs as jsxs36 } from "react/jsx-runtime";
4111
+ var SUBTLE_STYLES = {
4112
+ success: "bg-intent-success/10 text-intent-success-foreground border-intent-success/20",
4113
+ warning: "bg-intent-warning/10 text-intent-warning-foreground border-intent-warning/20",
4114
+ error: "bg-intent-error/10 text-intent-error-foreground border-intent-error/20",
4115
+ info: "bg-intent-info/10 text-intent-info-foreground border-intent-info/20"
4116
+ };
4117
+ var SOLID_STYLES = {
4118
+ success: "bg-intent-success text-primary-foreground",
4119
+ warning: "bg-intent-warning text-primary-foreground",
4120
+ error: "bg-intent-error text-primary-foreground",
4121
+ info: "bg-intent-info text-primary-foreground"
4122
+ };
4123
+ var OUTLINE_STYLES = {
4124
+ success: "border-intent-success-border text-intent-success-foreground bg-background",
4125
+ warning: "border-intent-warning-border text-intent-warning-foreground bg-background",
4126
+ error: "border-intent-error-border text-intent-error-foreground bg-background",
4127
+ info: "border-intent-info-border text-intent-info-foreground bg-background"
4128
+ };
4129
+ var ICON_MAP2 = {
4130
+ success: "\u2713",
4131
+ warning: "\u26A0",
4132
+ error: "\u2715",
4133
+ info: "\u2139"
4134
+ };
4135
+ var Alert = React34.forwardRef(
4136
+ ({
4137
+ className,
4138
+ intent = "info",
4139
+ variant = "subtle",
4140
+ title,
4141
+ dismissible,
4142
+ onDismiss,
4143
+ children,
4144
+ ...props
4145
+ }, ref) => {
4146
+ const styles = variant === "solid" ? SOLID_STYLES[intent] : variant === "outline" ? OUTLINE_STYLES[intent] : SUBTLE_STYLES[intent];
4147
+ return /* @__PURE__ */ jsxs36(
4148
+ "div",
4149
+ {
4150
+ ref,
4151
+ role: "alert",
4152
+ className: cn("flex gap-3 rounded-lg border p-4", styles, className),
4153
+ ...props,
4154
+ children: [
4155
+ /* @__PURE__ */ jsx47("span", { className: "flex-shrink-0 text-lg", "aria-hidden": "true", children: ICON_MAP2[intent] }),
4156
+ /* @__PURE__ */ jsxs36("div", { className: "min-w-0 flex-1", children: [
4157
+ title && /* @__PURE__ */ jsx47("p", { className: "font-semibold", children: title }),
4158
+ children && /* @__PURE__ */ jsx47("div", { className: cn(title && "mt-1", "text-sm"), children })
4159
+ ] }),
4160
+ dismissible && /* @__PURE__ */ jsx47(
4161
+ "button",
4162
+ {
4163
+ type: "button",
4164
+ onClick: onDismiss,
4165
+ className: "opacity-hover flex-shrink-0 hover:opacity-100",
4166
+ "aria-label": "Dismiss",
4167
+ children: "\u2715"
4168
+ }
4169
+ )
4170
+ ]
4171
+ }
4172
+ );
4173
+ }
4174
+ );
4175
+ Alert.displayName = "Alert";
4176
+
4177
+ // src/empty-state.tsx
4178
+ import { jsx as jsx48, jsxs as jsxs37 } from "react/jsx-runtime";
4179
+ function EmptyState({
4180
+ icon: Icon,
4181
+ title,
4182
+ description,
4183
+ action,
4184
+ size = "default",
4185
+ testId = "empty-state",
4186
+ className
4187
+ }) {
4188
+ const compact = size === "compact";
4189
+ return /* @__PURE__ */ jsxs37(
4190
+ "div",
4191
+ {
4192
+ "data-testid": testId,
4193
+ className: cn(
4194
+ "flex flex-col items-center justify-center rounded-lg border border-dashed border-border bg-card/50 text-center",
4195
+ compact ? "px-4 py-8" : "px-6 py-16",
4196
+ className
4197
+ ),
4198
+ children: [
4199
+ Icon && /* @__PURE__ */ jsx48(
4200
+ "div",
4201
+ {
4202
+ "aria-hidden": "true",
4203
+ className: cn(
4204
+ "flex items-center justify-center rounded-full bg-primary/10 text-primary",
4205
+ compact ? "mb-3 size-12" : "mb-5 size-16"
4206
+ ),
4207
+ children: /* @__PURE__ */ jsx48(Icon, { className: compact ? "size-6" : "size-8" })
4208
+ }
4209
+ ),
4210
+ /* @__PURE__ */ jsx48(
4211
+ "h2",
4212
+ {
4213
+ className: cn(
4214
+ "font-semibold text-foreground",
4215
+ compact ? "text-base" : "text-lg"
4216
+ ),
4217
+ children: title
4218
+ }
4219
+ ),
4220
+ description && /* @__PURE__ */ jsx48(
4221
+ "p",
4222
+ {
4223
+ className: cn(
4224
+ "mt-1.5 max-w-md text-muted-foreground",
4225
+ compact ? "text-xs" : "text-sm"
4226
+ ),
4227
+ children: description
4228
+ }
4229
+ ),
4230
+ action && /* @__PURE__ */ jsx48("div", { className: compact ? "mt-4" : "mt-6", children: action })
4231
+ ]
4232
+ }
4233
+ );
4234
+ }
4235
+
4236
+ // src/action-panel.tsx
4237
+ import * as React35 from "react";
4238
+ import { Fragment as Fragment8, jsx as jsx49, jsxs as jsxs38 } from "react/jsx-runtime";
4239
+ var BORDER_INTENT = {
4240
+ default: "border-l-primary",
4241
+ warning: "border-l-intent-warning",
4242
+ destructive: "border-l-intent-error"
4243
+ };
4244
+ var ActionPanel = React35.forwardRef(
4245
+ ({
4246
+ className,
4247
+ title,
4248
+ description,
4249
+ action,
4250
+ variant = "simple",
4251
+ intent = "default",
4252
+ ...props
4253
+ }, ref) => /* @__PURE__ */ jsx49(
4254
+ "div",
4255
+ {
4256
+ ref,
4257
+ className: cn(
4258
+ "rounded-lg border border-border bg-card p-6",
4259
+ variant === "withBorder" && `border-l-4 ${BORDER_INTENT[intent]}`,
4260
+ variant === "split" ? "flex items-center justify-between gap-4" : "",
4261
+ className
4262
+ ),
4263
+ ...props,
4264
+ children: variant === "split" ? /* @__PURE__ */ jsxs38(Fragment8, { children: [
4265
+ /* @__PURE__ */ jsxs38("div", { className: "min-w-0", children: [
4266
+ /* @__PURE__ */ jsx49("h3", { className: "font-semibold text-foreground", children: title }),
4267
+ description && /* @__PURE__ */ jsx49("p", { className: "mt-1 text-sm text-muted-foreground", children: description })
4268
+ ] }),
4269
+ action && /* @__PURE__ */ jsx49("div", { className: "flex-shrink-0", children: action })
4270
+ ] }) : /* @__PURE__ */ jsxs38(Fragment8, { children: [
4271
+ /* @__PURE__ */ jsx49("h3", { className: "font-semibold text-foreground", children: title }),
4272
+ description && /* @__PURE__ */ jsx49("p", { className: "mt-1 text-sm text-muted-foreground", children: description }),
4273
+ action && /* @__PURE__ */ jsx49("div", { className: "mt-4", children: action })
4274
+ ] })
4275
+ }
4276
+ )
4277
+ );
4278
+ ActionPanel.displayName = "ActionPanel";
4279
+
4280
+ // src/divider.tsx
4281
+ import * as React36 from "react";
4282
+ import { jsx as jsx50, jsxs as jsxs39 } from "react/jsx-runtime";
4283
+ var VARIANT_CLASSES = {
4284
+ solid: "border-solid",
4285
+ dashed: "border-dashed",
4286
+ dotted: "border-dotted"
4287
+ };
4288
+ var Divider = React36.forwardRef(
4289
+ ({
4290
+ className,
4291
+ label,
4292
+ labelPosition = "center",
4293
+ variant = "solid",
4294
+ orientation = "horizontal",
4295
+ ...props
4296
+ }, ref) => {
4297
+ if (orientation === "vertical") {
4298
+ return /* @__PURE__ */ jsx50(
4299
+ "div",
4300
+ {
4301
+ ref,
4302
+ className: cn(
4303
+ "border-l border-border",
4304
+ VARIANT_CLASSES[variant],
4305
+ "self-stretch",
4306
+ className
4307
+ ),
4308
+ role: "separator",
4309
+ "aria-orientation": "vertical",
4310
+ ...props
4311
+ }
4312
+ );
4313
+ }
4314
+ if (!label) {
4315
+ return /* @__PURE__ */ jsx50(
4316
+ "div",
4317
+ {
4318
+ ref,
4319
+ className: cn(
4320
+ "border-t border-border",
4321
+ VARIANT_CLASSES[variant],
4322
+ className
4323
+ ),
4324
+ role: "separator",
4325
+ ...props
4326
+ }
4327
+ );
4328
+ }
4329
+ return /* @__PURE__ */ jsxs39(
4330
+ "div",
4331
+ {
4332
+ ref,
4333
+ className: cn("flex items-center", className),
4334
+ role: "separator",
4335
+ ...props,
4336
+ children: [
4337
+ labelPosition !== "left" && /* @__PURE__ */ jsx50(
4338
+ "div",
4339
+ {
4340
+ className: cn(
4341
+ "flex-1 border-t border-border",
4342
+ VARIANT_CLASSES[variant]
4343
+ )
4344
+ }
4345
+ ),
4346
+ /* @__PURE__ */ jsx50(
4347
+ "span",
4348
+ {
4349
+ className: cn(
4350
+ "text-sm text-muted-foreground",
4351
+ labelPosition === "left" ? "pr-3" : "px-3"
4352
+ ),
4353
+ children: label
4354
+ }
4355
+ ),
4356
+ labelPosition !== "right" && /* @__PURE__ */ jsx50(
4357
+ "div",
4358
+ {
4359
+ className: cn(
4360
+ "flex-1 border-t border-border",
4361
+ VARIANT_CLASSES[variant]
4362
+ )
4363
+ }
4364
+ )
4365
+ ]
4366
+ }
4367
+ );
4368
+ }
4369
+ );
4370
+ Divider.displayName = "Divider";
4371
+
4372
+ // src/container.tsx
4373
+ import * as React37 from "react";
4374
+ import { jsx as jsx51 } from "react/jsx-runtime";
4375
+ var SIZE_CLASSES6 = {
4376
+ sm: "max-w-content-sm",
4377
+ md: "max-w-content-md",
4378
+ lg: "max-w-content-lg",
4379
+ xl: "max-w-content-xl",
4380
+ full: "max-w-full"
4381
+ };
4382
+ var Container = React37.forwardRef(
4383
+ ({ className, size = "xl", padded = true, ...props }, ref) => /* @__PURE__ */ jsx51(
4384
+ "div",
4385
+ {
4386
+ ref,
4387
+ className: cn(
4388
+ "mx-auto w-full",
4389
+ SIZE_CLASSES6[size],
4390
+ padded && "px-4 sm:px-6 lg:px-8",
4391
+ className
4392
+ ),
4393
+ ...props
4394
+ }
4395
+ )
4396
+ );
4397
+ Container.displayName = "Container";
4398
+
4399
+ // src/page-content.tsx
4400
+ import * as React38 from "react";
4401
+ import { jsx as jsx52 } from "react/jsx-runtime";
4402
+ var GAP_CLASSES2 = {
4403
+ sm: "space-y-4",
4404
+ md: "space-y-6",
4405
+ lg: "space-y-8",
4406
+ none: ""
4407
+ };
4408
+ var PageContent = React38.forwardRef(
4409
+ ({ className, gap = "md", padded = true, children, ...props }, ref) => /* @__PURE__ */ jsx52(
4410
+ "div",
4411
+ {
4412
+ ref,
4413
+ className: cn(GAP_CLASSES2[gap], padded && "p-4 sm:p-6", className),
4414
+ ...props,
4415
+ children
4416
+ }
4417
+ )
4418
+ );
4419
+ PageContent.displayName = "PageContent";
4420
+
4421
+ // src/media-object.tsx
4422
+ import * as React39 from "react";
4423
+ import { jsx as jsx53, jsxs as jsxs40 } from "react/jsx-runtime";
4424
+ var MEDIA_SIZE = {
4425
+ sm: "h-8 w-8",
4426
+ md: "h-10 w-10",
4427
+ lg: "h-12 w-12"
4428
+ };
4429
+ var MediaObject = React39.forwardRef(
4430
+ ({
4431
+ className,
4432
+ media,
4433
+ title,
4434
+ description,
4435
+ action,
4436
+ align = "top",
4437
+ mediaSize = "md",
4438
+ stacked = false,
4439
+ ...props
4440
+ }, ref) => {
4441
+ if (stacked) {
4442
+ return /* @__PURE__ */ jsxs40(
4443
+ "div",
4444
+ {
4445
+ ref,
4446
+ className: cn(
4447
+ "flex flex-col items-center gap-3 text-center",
4448
+ className
4449
+ ),
4450
+ ...props,
4451
+ children: [
4452
+ /* @__PURE__ */ jsx53("div", { className: cn("flex-shrink-0", MEDIA_SIZE[mediaSize]), children: media }),
4453
+ /* @__PURE__ */ jsxs40("div", { className: "min-w-0", children: [
4454
+ title && /* @__PURE__ */ jsx53("p", { className: "font-medium text-foreground", children: title }),
4455
+ description && /* @__PURE__ */ jsx53("p", { className: "text-sm text-muted-foreground", children: description })
4456
+ ] }),
4457
+ action && /* @__PURE__ */ jsx53("div", { children: action })
4458
+ ]
4459
+ }
4460
+ );
4461
+ }
4462
+ return /* @__PURE__ */ jsxs40(
4463
+ "div",
4464
+ {
4465
+ ref,
4466
+ className: cn(
4467
+ "flex gap-3",
4468
+ align === "center" ? "items-center" : "items-start",
4469
+ className
4470
+ ),
4471
+ ...props,
4472
+ children: [
4473
+ /* @__PURE__ */ jsx53("div", { className: cn("flex-shrink-0", MEDIA_SIZE[mediaSize]), children: media }),
4474
+ /* @__PURE__ */ jsxs40("div", { className: "min-w-0 flex-1", children: [
4475
+ title && /* @__PURE__ */ jsx53("p", { className: "font-medium text-foreground", children: title }),
4476
+ description && /* @__PURE__ */ jsx53("p", { className: "text-sm text-muted-foreground", children: description })
4477
+ ] }),
4478
+ action && /* @__PURE__ */ jsx53("div", { className: "flex-shrink-0", children: action })
4479
+ ]
4480
+ }
4481
+ );
4482
+ }
4483
+ );
4484
+ MediaObject.displayName = "MediaObject";
4485
+
4486
+ // src/hooks/use-debounce.ts
4487
+ import { useEffect as useEffect8, useState as useState9 } from "react";
4488
+ function useDebounce(value, ms) {
4489
+ const [debounced, setDebounced] = useState9(value);
4490
+ useEffect8(() => {
4491
+ const handle = setTimeout(() => setDebounced(value), ms);
4492
+ return () => clearTimeout(handle);
4493
+ }, [value, ms]);
4494
+ return debounced;
4495
+ }
4496
+ export {
4497
+ Accordion,
4498
+ AccordionContent,
4499
+ AccordionItem,
4500
+ AccordionTrigger,
4501
+ ActionCard,
4502
+ ActionPanel,
4503
+ ActivityFeed,
4504
+ ActivityFeedItem,
4505
+ Alert,
4506
+ AppShell,
4507
+ AvatarGroup,
4508
+ AvatarGroupItem,
4509
+ Button,
4510
+ ButtonGroup,
4511
+ ButtonGroupItem,
4512
+ Calendar,
4513
+ Card,
4514
+ CardContent,
4515
+ CardDescription,
4516
+ CardFooter,
4517
+ CardHeader,
4518
+ CardTitle,
4519
+ CollapsibleSidebar,
4520
+ Combobox,
4521
+ CommandPalette,
4522
+ ConfirmDialog,
4523
+ Container,
4524
+ DataTable,
4525
+ DatePicker,
4526
+ DescriptionItem,
4527
+ DescriptionList,
4528
+ DiceBearAvatar,
4529
+ DistributionChip,
4530
+ Divider,
4531
+ Drawer,
4532
+ DrawerBody,
4533
+ DrawerFooter,
4534
+ DrawerHeader,
4535
+ EmptyState,
4536
+ FilterChip,
4537
+ FormError,
4538
+ FormField,
4539
+ FormFieldGroup,
4540
+ FormLayout,
4541
+ FormLayoutSection,
4542
+ FormSection,
4543
+ FormSuccess,
4544
+ GlobalErrorContent,
4545
+ GridList,
4546
+ GridListItem,
4547
+ HorizontalCard,
4548
+ HoverCard,
4549
+ ImageCard,
4550
+ Input,
4551
+ InputGroup,
4552
+ IntentIcon,
4553
+ MarkdownRenderer,
4554
+ MediaObject,
4555
+ ModalBody,
4556
+ ModalDialog,
4557
+ ModalFooter,
4558
+ ModalHeader,
4559
+ Navbar,
4560
+ NavbarLink,
4561
+ NotificationBanner,
4562
+ NotificationPanel,
4563
+ NotificationPanelItem,
4564
+ PageContent,
4565
+ Pagination,
4566
+ PaginationButton,
4567
+ Popover,
4568
+ RadioGroup,
4569
+ SectionHeading,
4570
+ SimpleAccordion,
4571
+ SkeletonBar,
4572
+ SkeletonCard,
4573
+ SkeletonCardGrid,
4574
+ SkeletonDetail,
4575
+ SkeletonRow,
4576
+ SkeletonTable,
4577
+ StackedList,
4578
+ StackedListItem,
4579
+ StatCardExtended,
4580
+ StatGroup,
4581
+ Stepper,
4582
+ StepperStep,
4583
+ StickyActionBar,
4584
+ Switch,
4585
+ TabBar,
4586
+ TabBarItem,
4587
+ TableBody,
4588
+ TableCaption,
4589
+ TableCell,
4590
+ TableHeader,
4591
+ TableRow,
4592
+ Toggle,
4593
+ ToggleGroup,
4594
+ Tooltip,
4595
+ TooltipContent,
4596
+ TooltipProvider,
4597
+ TooltipTrigger,
4598
+ avatarVariants,
4599
+ buildDiceBearUrl,
4600
+ buttonVariants,
4601
+ cn,
4602
+ getPageRange,
4603
+ useDebounce,
4604
+ useSidebar
4605
+ };