@dimasbaguspm/versaur 0.0.45 → 0.0.46

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.
Files changed (39) hide show
  1. package/dist/js/forms/index.js +18 -20
  2. package/dist/js/image-rectangle-B4nXH4Q5.js +2581 -0
  3. package/dist/js/index.js +72 -77
  4. package/dist/js/layouts/index.js +1 -1
  5. package/dist/js/navigation/index.js +1 -1
  6. package/dist/js/overlays/index.js +5 -6
  7. package/dist/js/primitive/index.js +28 -30
  8. package/dist/js/{tabs-D5aWU0pC.js → tabs-BAzThVka.js} +1 -1
  9. package/dist/js/{bottom-sheet-input-CxLwoZLr.js → time-picker-input-DrZ4dyEB.js} +875 -800
  10. package/dist/js/tooltip-D6fUigp2.js +691 -0
  11. package/dist/js/{top-bar-vvLnMBwo.js → top-bar-Dx0JVXms.js} +1 -1
  12. package/dist/types/forms/index.d.ts +7 -9
  13. package/dist/types/forms/pin-field/index.d.ts +2 -0
  14. package/dist/types/forms/pin-field/pin-field.d.ts +9 -0
  15. package/dist/types/forms/pin-field/types.d.ts +86 -0
  16. package/dist/types/primitive/index.d.ts +0 -2
  17. package/dist/utils/enforce-subpath-import.js +1 -5
  18. package/package.json +1 -1
  19. package/dist/js/bottom-sheet-QdQ5L8Wo.js +0 -615
  20. package/dist/js/image-rectangle-BijhERaV.js +0 -2884
  21. package/dist/js/tooltip-D80OXyWL.js +0 -81
  22. package/dist/types/forms/bottom-sheet-input/bottom-sheet-input.d.ts +0 -7
  23. package/dist/types/forms/bottom-sheet-input/index.d.ts +0 -2
  24. package/dist/types/forms/bottom-sheet-input/types.d.ts +0 -17
  25. package/dist/types/forms/drawer-input/drawer-input.d.ts +0 -6
  26. package/dist/types/forms/drawer-input/index.d.ts +0 -2
  27. package/dist/types/forms/drawer-input/types.d.ts +0 -18
  28. package/dist/types/forms/modal-input/index.d.ts +0 -2
  29. package/dist/types/forms/modal-input/modal-input.d.ts +0 -6
  30. package/dist/types/forms/modal-input/types.d.ts +0 -18
  31. package/dist/types/primitive/button-float/button-float.d.ts +0 -8
  32. package/dist/types/primitive/button-float/index.d.ts +0 -2
  33. package/dist/types/primitive/button-float/types.d.ts +0 -31
  34. package/dist/types/primitive/button-float/use-floating-position.d.ts +0 -12
  35. package/dist/types/primitive/calculator/calculator.atoms.d.ts +0 -2
  36. package/dist/types/primitive/calculator/calculator.d.ts +0 -2
  37. package/dist/types/primitive/calculator/index.d.ts +0 -2
  38. package/dist/types/primitive/calculator/types.d.ts +0 -29
  39. package/dist/types/primitive/calculator/use-calculator.d.ts +0 -11
@@ -1,2884 +0,0 @@
1
- import { c as cva, j as jsxRuntimeExports, a as cn } from "./index-DOdDlCoL.js";
2
- import * as React from "react";
3
- import React__default, { createContext, useContext, forwardRef, useState, useEffect, useCallback, useRef, useId, cloneElement } from "react";
4
- import { ChevronDown, ChevronRight, CheckIcon, EllipsisVerticalIcon, X, XIcon, ImageOff } from "lucide-react";
5
- import ReactDOM from "react-dom";
6
- import { S as Skeleton } from "./skeleton-BNZyaRjo.js";
7
- const AccordionContext = createContext(
8
- null
9
- ), useAccordionContext = () => {
10
- const e = useContext(AccordionContext);
11
- if (!e)
12
- throw new Error(
13
- "Accordion compound components must be used within Accordion"
14
- );
15
- return e;
16
- }, accordionVariants = cva(
17
- "border-b border-border bg-background overflow-hidden",
18
- {
19
- variants: {
20
- disabled: {
21
- true: "opacity-50 cursor-not-allowed",
22
- false: ""
23
- }
24
- },
25
- defaultVariants: {
26
- disabled: !1
27
- }
28
- }
29
- ), accordionHeaderVariants = cva(
30
- "flex items-center justify-between w-full p-4 text-left transition-colors duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-light focus-visible:ring-inset",
31
- {
32
- variants: {
33
- disabled: {
34
- true: "cursor-not-allowed",
35
- false: "cursor-pointer hover:bg-neutral-soft"
36
- },
37
- isOpen: {
38
- true: "",
39
- false: "bg-background"
40
- }
41
- },
42
- defaultVariants: {
43
- disabled: !1,
44
- isOpen: !1
45
- }
46
- }
47
- ), accordionContentVariants = cva(
48
- "overflow-hidden transition-all duration-300",
49
- {
50
- variants: {
51
- isOpen: {
52
- true: "max-h-screen opacity-100",
53
- false: "max-h-0 opacity-0"
54
- }
55
- },
56
- defaultVariants: {
57
- isOpen: !1
58
- }
59
- }
60
- ), accordionContentInnerVariants = cva("p-4 pt-0"), accordionIconVariants = cva("transition-transform duration-200", {
61
- variants: {
62
- isOpen: {
63
- true: "rotate-180",
64
- false: "rotate-0"
65
- }
66
- },
67
- defaultVariants: {
68
- isOpen: !1
69
- }
70
- }), headingVariants = cva("", {
71
- variants: {
72
- color: {
73
- primary: "text-primary",
74
- secondary: "text-secondary",
75
- tertiary: "text-tertiary",
76
- ghost: "text-ghost",
77
- neutral: "text-ghost",
78
- success: "text-success",
79
- info: "text-info",
80
- warning: "text-warning",
81
- danger: "text-danger",
82
- inherit: "",
83
- gray: "text-gray-500",
84
- black: "text-black",
85
- white: "text-white"
86
- },
87
- hasUnderline: {
88
- true: "underline",
89
- false: ""
90
- },
91
- isCapitalize: {
92
- true: "capitalize",
93
- false: ""
94
- },
95
- hasMargin: {
96
- true: "mb-4",
97
- false: ""
98
- },
99
- align: {
100
- left: "text-left",
101
- center: "text-center",
102
- right: "text-right",
103
- justify: "text-justify"
104
- },
105
- italic: {
106
- true: "italic",
107
- false: ""
108
- },
109
- clamp: {
110
- 1: "line-clamp-1",
111
- 2: "line-clamp-2",
112
- 3: "line-clamp-3",
113
- 4: "line-clamp-4",
114
- 5: "line-clamp-5",
115
- none: ""
116
- },
117
- ellipsis: {
118
- true: "truncate",
119
- false: ""
120
- },
121
- level: {
122
- 1: "font-bold text-2xl leading-loose",
123
- 2: "font-semibold text-xl leading-relaxed",
124
- 3: "font-medium text-base leading-relaxed",
125
- 4: "font-bold text-sm leading-normal",
126
- 5: "font-semibold text-sm leading-normal",
127
- 6: "font-medium text-xs leading-normal"
128
- }
129
- },
130
- defaultVariants: {
131
- color: "ghost",
132
- hasUnderline: !1,
133
- isCapitalize: !1,
134
- hasMargin: !1,
135
- align: "left",
136
- italic: !1,
137
- clamp: "none",
138
- ellipsis: !1,
139
- level: 1
140
- }
141
- }), Heading = forwardRef(
142
- ({
143
- level: e = 3,
144
- color: t = "ghost",
145
- hasUnderline: r = !1,
146
- isCapitalize: i = !1,
147
- hasMargin: s = !1,
148
- align: n = "left",
149
- italic: o = !1,
150
- clamp: l = "none",
151
- ellipsis: u = !1,
152
- className: c,
153
- children: f,
154
- ...a
155
- }, d) => {
156
- const h = `h${e}`;
157
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
158
- h,
159
- {
160
- ref: d,
161
- className: cn(
162
- headingVariants({
163
- color: t,
164
- hasUnderline: r,
165
- isCapitalize: i,
166
- hasMargin: s,
167
- align: n,
168
- italic: o,
169
- clamp: l,
170
- ellipsis: u,
171
- level: e
172
- }),
173
- c
174
- ),
175
- ...a,
176
- children: f
177
- }
178
- );
179
- }
180
- );
181
- Heading.displayName = "Heading";
182
- const iconVariants = cva("inline-flex items-center justify-center", {
183
- variants: {
184
- size: {
185
- xs: "w-3 h-3",
186
- sm: "w-4 h-4",
187
- md: "w-5 h-5",
188
- lg: "w-6 h-6",
189
- xl: "w-8 h-8",
190
- inherit: "w-auto h-auto"
191
- },
192
- color: {
193
- primary: "text-primary",
194
- secondary: "text-secondary",
195
- tertiary: "text-tertiary",
196
- ghost: "text-ghost",
197
- neutral: "text-neutral",
198
- success: "text-success",
199
- info: "text-info",
200
- warning: "text-warning",
201
- danger: "text-danger",
202
- gray: "text-gray-500",
203
- black: "text-black",
204
- white: "text-white",
205
- inherit: ""
206
- }
207
- },
208
- defaultVariants: {
209
- size: "md",
210
- color: "primary"
211
- }
212
- }), Icon = React__default.forwardRef(function({ as: t, color: r = "primary", size: i = "md", className: s, ...n }, o) {
213
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
214
- t,
215
- {
216
- ref: o,
217
- className: iconVariants({ color: r, size: i, className: s }),
218
- ...n
219
- }
220
- );
221
- }), AccordionTitle = forwardRef(function({ className: t, children: r, ...i }, s) {
222
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
223
- Heading,
224
- {
225
- ref: s,
226
- level: 4,
227
- className: cn("font-medium", t),
228
- ...i,
229
- color: "black",
230
- children: r
231
- }
232
- );
233
- }), AccordionContent = forwardRef(function({ className: t, children: r, ...i }, s) {
234
- const { isOpen: n } = useAccordionContext();
235
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
236
- "div",
237
- {
238
- ref: s,
239
- className: cn(accordionContentVariants({ isOpen: n }), t),
240
- ...i,
241
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: accordionContentInnerVariants(), children: r })
242
- }
243
- );
244
- }), AccordionIcon = forwardRef(function({ as: t, ...r }, i) {
245
- const { isOpen: s } = useAccordionContext();
246
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
247
- Icon,
248
- {
249
- ref: i,
250
- as: t,
251
- color: "ghost",
252
- size: "sm",
253
- className: accordionIconVariants({ isOpen: s }),
254
- ...r
255
- }
256
- );
257
- }), AccordionRoot = forwardRef(
258
- function({
259
- title: t,
260
- subtitle: r,
261
- isDefaultOpen: i = !1,
262
- disabled: s = !1,
263
- hasMargin: n,
264
- className: o,
265
- children: l,
266
- ...u
267
- }, c) {
268
- const [f, a] = useState(i), d = () => {
269
- s || a((x) => !x);
270
- }, h = {
271
- isOpen: f,
272
- toggle: d,
273
- disabled: s
274
- };
275
- return /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionContext.Provider, { value: h, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
276
- "div",
277
- {
278
- ref: c,
279
- className: cn(
280
- accordionVariants({ disabled: s }),
281
- o,
282
- n && "mb-4"
283
- ),
284
- ...u,
285
- children: [
286
- /* @__PURE__ */ jsxRuntimeExports.jsx(
287
- "div",
288
- {
289
- role: "button",
290
- className: accordionHeaderVariants({ disabled: s, isOpen: f }),
291
- onClick: d,
292
- "aria-disabled": s,
293
- "aria-expanded": f,
294
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between w-full gap-2", children: [
295
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3 flex-grow", children: [
296
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1", children: t }),
297
- r && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-shrink-0", children: r })
298
- ] }),
299
- /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionIcon, { as: ChevronDown })
300
- ] })
301
- }
302
- ),
303
- /* @__PURE__ */ jsxRuntimeExports.jsx(
304
- "div",
305
- {
306
- className: cn(
307
- "overflow-hidden transition-all duration-300",
308
- f ? "max-h-screen opacity-100" : "max-h-0 opacity-0"
309
- ),
310
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 pt-2", children: l })
311
- }
312
- )
313
- ]
314
- }
315
- ) });
316
- }
317
- ), Accordion = Object.assign(AccordionRoot, {
318
- Title: AccordionTitle,
319
- Content: AccordionContent,
320
- Icon: AccordionIcon
321
- }), actionCardVariants = cva(
322
- "group flex items-center justify-between transition-all duration-200 w-full",
323
- {
324
- variants: {
325
- size: {
326
- sm: "p-3",
327
- md: "p-4",
328
- lg: "p-5"
329
- },
330
- as: {
331
- button: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-light hover:bg-gray-50 cursor-pointer",
332
- div: ""
333
- }
334
- },
335
- defaultVariants: {
336
- size: "md",
337
- as: "button"
338
- }
339
- }
340
- ), iconContainerVariants = cva(
341
- "bg-gradient-to-br from-gray-100 to-gray-200 rounded-xl flex items-center justify-center group-hover:from-primary-soft group-hover:to-primary-light duration-200",
342
- {
343
- variants: {
344
- size: {
345
- sm: "w-8 h-8",
346
- md: "w-10 h-10",
347
- lg: "w-12 h-12"
348
- }
349
- },
350
- defaultVariants: {
351
- size: "md"
352
- }
353
- }
354
- ), arrowVariants = cva(
355
- "inline-flex items-center justify-center text-ghost-bold transition-colors duration-200",
356
- {
357
- variants: {
358
- size: {
359
- sm: "w-3 h-3",
360
- md: "w-4 h-4",
361
- lg: "w-5 h-5"
362
- }
363
- },
364
- defaultVariants: {
365
- size: "md"
366
- }
367
- }
368
- ), textVariants = cva("", {
369
- variants: {
370
- color: {
371
- primary: "text-primary",
372
- secondary: "text-secondary",
373
- tertiary: "text-tertiary",
374
- ghost: "text-ghost",
375
- neutral: "text-ghost",
376
- success: "text-success",
377
- info: "text-info",
378
- warning: "text-warning",
379
- danger: "text-danger",
380
- inherit: "",
381
- gray: "text-gray-500",
382
- black: "text-black",
383
- white: "text-white"
384
- },
385
- hasUnderline: {
386
- true: "underline",
387
- false: ""
388
- },
389
- isCapitalize: {
390
- true: "capitalize",
391
- false: ""
392
- },
393
- align: {
394
- left: "text-left",
395
- center: "text-center",
396
- right: "text-right",
397
- justify: "text-justify"
398
- },
399
- italic: {
400
- true: "italic",
401
- false: ""
402
- },
403
- clamp: {
404
- 1: "line-clamp-1",
405
- 2: "line-clamp-2",
406
- 3: "line-clamp-3",
407
- 4: "line-clamp-4",
408
- 5: "line-clamp-5",
409
- none: ""
410
- },
411
- ellipsis: {
412
- true: "truncate",
413
- false: ""
414
- },
415
- as: {
416
- h1: "font-bold text-4xl leading-loose",
417
- h2: "font-semibold text-3xl leading-relaxed",
418
- h3: "font-medium text-2xl leading-relaxed",
419
- h4: "font-bold text-xl leading-normal",
420
- h5: "font-semibold text-lg leading-normal",
421
- h6: "font-medium text-base leading-normal",
422
- p: "font-normal text-base leading-normal",
423
- span: "font-normal text-base leading-normal",
424
- label: "font-normal text-xs leading-normal"
425
- }
426
- },
427
- defaultVariants: {
428
- color: "neutral",
429
- hasUnderline: !1,
430
- isCapitalize: !1,
431
- align: "left",
432
- italic: !1,
433
- clamp: "none",
434
- ellipsis: !1,
435
- as: "span"
436
- }
437
- }), Text = forwardRef(
438
- ({
439
- as: e = "span",
440
- color: t = "ghost",
441
- hasUnderline: r = !1,
442
- isCapitalize: i = !1,
443
- align: s = "left",
444
- italic: n = !1,
445
- clamp: o = "none",
446
- ellipsis: l = !1,
447
- fontSize: u,
448
- fontWeight: c,
449
- className: f,
450
- children: a,
451
- ...d
452
- }, h) => {
453
- const y = [
454
- "h1",
455
- "h2",
456
- "h3",
457
- "h4",
458
- "h5",
459
- "h6",
460
- "p",
461
- "span",
462
- "label"
463
- ].includes(e) ? e : "span", w = u ? `text-${u}` : "", j = c ? `font-${c}` : "";
464
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
465
- e,
466
- {
467
- ref: h,
468
- className: cn(
469
- textVariants({
470
- color: t,
471
- hasUnderline: r,
472
- isCapitalize: i,
473
- align: s,
474
- italic: n,
475
- clamp: o,
476
- ellipsis: l,
477
- // @ts-expect-error - `as` is not a valid variant
478
- as: y
479
- }),
480
- w,
481
- j,
482
- f
483
- ),
484
- ...d,
485
- children: a
486
- }
487
- );
488
- }
489
- ), ActionCardGroup = forwardRef(
490
- ({ children: e, className: t }, r) => /* @__PURE__ */ jsxRuntimeExports.jsx(
491
- "div",
492
- {
493
- ref: r,
494
- className: cn(
495
- "bg-background border border-border rounded-lg overflow-hidden",
496
- "divide-y divide-border",
497
- t
498
- ),
499
- role: "group",
500
- children: e
501
- }
502
- )
503
- ), ActionCardRoot = forwardRef(
504
- ({
505
- size: e = "md",
506
- icon: t,
507
- title: r,
508
- subtitle: i,
509
- badge: s,
510
- showArrow: n = !0,
511
- as: o = "button",
512
- className: l,
513
- ...u
514
- }, c) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
515
- o,
516
- {
517
- ref: c,
518
- className: cn(actionCardVariants({ size: e, as: o }), l),
519
- ...u,
520
- children: [
521
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-4 flex-1", children: [
522
- t && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cn(iconContainerVariants({ size: e })), children: t }),
523
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
524
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3 mb-1", children: [
525
- /* @__PURE__ */ jsxRuntimeExports.jsx(
526
- Text,
527
- {
528
- as: "span",
529
- fontSize: e === "sm" ? "sm" : "base",
530
- fontWeight: "semibold",
531
- color: "ghost",
532
- className: "text-left leading-normal",
533
- children: r
534
- }
535
- ),
536
- s && /* @__PURE__ */ jsxRuntimeExports.jsx(
537
- "div",
538
- {
539
- className: "flex flex-wrap items-center flex-row justify-start gap-3",
540
- role: "group",
541
- children: s
542
- }
543
- )
544
- ] }),
545
- i && /* @__PURE__ */ jsxRuntimeExports.jsx(
546
- Text,
547
- {
548
- as: "p",
549
- fontSize: "sm",
550
- color: "gray",
551
- className: "text-left leading-normal",
552
- children: i
553
- }
554
- )
555
- ] })
556
- ] }),
557
- n && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
558
- Icon,
559
- {
560
- as: ChevronRight,
561
- className: cn(arrowVariants({ size: e })),
562
- color: "ghost",
563
- "aria-hidden": "true"
564
- }
565
- ) })
566
- ]
567
- }
568
- )
569
- ), ActionCard = Object.assign(ActionCardRoot, {
570
- Group: ActionCardGroup
571
- }), alertVariants = cva(
572
- "relative flex items-center gap-2 rounded-md p-2 text-sm transition-all duration-200",
573
- {
574
- variants: {
575
- variant: {
576
- default: "",
577
- outline: "border"
578
- },
579
- color: {
580
- // Core colors
581
- primary: "",
582
- secondary: "",
583
- tertiary: "",
584
- ghost: "",
585
- neutral: "",
586
- // Semantic colors
587
- success: "",
588
- info: "",
589
- warning: "",
590
- danger: ""
591
- }
592
- },
593
- compoundVariants: [
594
- // Default variant styles (soft backgrounds)
595
- {
596
- variant: "default",
597
- color: "primary",
598
- class: "bg-primary-soft text-primary border border-primary"
599
- },
600
- {
601
- variant: "default",
602
- color: "secondary",
603
- class: "bg-secondary-soft text-secondary border border-secondary"
604
- },
605
- {
606
- variant: "default",
607
- color: "tertiary",
608
- class: "bg-tertiary-soft text-tertiary border border-tertiary"
609
- },
610
- {
611
- variant: "default",
612
- color: "ghost",
613
- class: "bg-ghost-soft text-ghost border border-ghost"
614
- },
615
- {
616
- variant: "default",
617
- color: "neutral",
618
- class: "bg-border/50 text-foreground border border-border"
619
- },
620
- {
621
- variant: "default",
622
- color: "success",
623
- class: "bg-success-soft text-success border border-success"
624
- },
625
- {
626
- variant: "default",
627
- color: "info",
628
- class: "bg-info-soft text-info border border-info"
629
- },
630
- {
631
- variant: "default",
632
- color: "warning",
633
- class: "bg-warning-soft text-warning border border-warning"
634
- },
635
- {
636
- variant: "default",
637
- color: "danger",
638
- class: "bg-danger-soft text-danger border border-danger"
639
- },
640
- // Outline variant styles
641
- {
642
- variant: "outline",
643
- color: "primary",
644
- class: "bg-transparent text-primary border-primary"
645
- },
646
- {
647
- variant: "outline",
648
- color: "secondary",
649
- class: "bg-transparent text-secondary border-secondary"
650
- },
651
- {
652
- variant: "outline",
653
- color: "tertiary",
654
- class: "bg-transparent text-tertiary border-tertiary"
655
- },
656
- {
657
- variant: "outline",
658
- color: "ghost",
659
- class: "bg-transparent text-ghost border-ghost"
660
- },
661
- {
662
- variant: "outline",
663
- color: "neutral",
664
- class: "bg-transparent text-foreground border-border"
665
- },
666
- {
667
- variant: "outline",
668
- color: "success",
669
- class: "bg-transparent text-success border-success"
670
- },
671
- {
672
- variant: "outline",
673
- color: "info",
674
- class: "bg-transparent text-info border-info"
675
- },
676
- {
677
- variant: "outline",
678
- color: "warning",
679
- class: "bg-transparent text-warning border-warning"
680
- },
681
- {
682
- variant: "outline",
683
- color: "danger",
684
- class: "bg-transparent text-danger border-danger"
685
- }
686
- ],
687
- defaultVariants: {
688
- variant: "default",
689
- color: "neutral"
690
- }
691
- }
692
- ), alertIconVariants = cva(
693
- "flex-shrink-0 flex justify-center items-center ",
694
- {
695
- variants: {
696
- size: {
697
- sm: "w-4 h-4",
698
- md: "w-5 h-5",
699
- lg: "w-6 h-6"
700
- }
701
- },
702
- defaultVariants: {
703
- size: "md"
704
- }
705
- }
706
- ), AlertIcon = forwardRef(
707
- ({ className: e, children: t, ...r }, i) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: i, className: cn(alertIconVariants(), e), ...r, children: t })
708
- ), AlertRoot = forwardRef(
709
- ({
710
- variant: e = "default",
711
- color: t = "neutral",
712
- icon: r,
713
- className: i,
714
- children: s,
715
- ...n
716
- }, o) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
717
- "div",
718
- {
719
- ref: o,
720
- role: "alert",
721
- className: cn(alertVariants({ variant: e, color: t }), i),
722
- ...n,
723
- children: [
724
- r && /* @__PURE__ */ jsxRuntimeExports.jsx(AlertIcon, { children: r }),
725
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1", children: s })
726
- ]
727
- }
728
- )
729
- ), Alert = Object.assign(AlertRoot, {
730
- Icon: AlertIcon
731
- }), anchorVariants = cva(
732
- [
733
- "inline-flex items-center transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
734
- // pseudo selectors for anchor
735
- "hover:no-underline"
736
- ],
737
- {
738
- variants: {
739
- color: {
740
- primary: "text-primary",
741
- secondary: "text-secondary",
742
- ghost: "text-ghost",
743
- danger: "text-danger",
744
- neutral: "text-neutral"
745
- },
746
- fontSize: {
747
- xs: "text-xs",
748
- sm: "text-sm",
749
- base: "text-base",
750
- lg: "text-lg",
751
- xl: "text-xl",
752
- "2xl": "text-2xl",
753
- "3xl": "text-3xl",
754
- "4xl": "text-4xl",
755
- "5xl": "text-5xl",
756
- "6xl": "text-6xl",
757
- "7xl": "text-7xl",
758
- "8xl": "text-8xl",
759
- "9xl": "text-9xl",
760
- inherit: "",
761
- undefined: ""
762
- },
763
- fontWeight: {
764
- thin: "font-thin",
765
- extralight: "font-extralight",
766
- light: "font-light",
767
- normal: "font-normal",
768
- medium: "font-medium",
769
- semibold: "font-semibold",
770
- bold: "font-bold",
771
- extrabold: "font-extrabold",
772
- black: "font-black",
773
- inherit: "",
774
- undefined: ""
775
- },
776
- quiet: {
777
- true: "",
778
- false: "underline underline-offset-2"
779
- }
780
- },
781
- defaultVariants: {
782
- color: "primary",
783
- fontSize: "base",
784
- fontWeight: "medium",
785
- quiet: !1
786
- }
787
- }
788
- ), Anchor = forwardRef(
789
- ({
790
- children: e,
791
- className: t,
792
- color: r = "primary",
793
- fontSize: i = "base",
794
- fontWeight: s = "medium",
795
- quiet: n = !1,
796
- ...o
797
- }, l) => /* @__PURE__ */ jsxRuntimeExports.jsx(
798
- "a",
799
- {
800
- ref: l,
801
- className: cn(
802
- anchorVariants({ color: r, fontSize: i, fontWeight: s, quiet: n }),
803
- t
804
- ),
805
- ...o,
806
- children: e
807
- }
808
- )
809
- ), Attribute = forwardRef(
810
- function({ title: t, children: r, className: i, hasMargin: s, ...n }, o) {
811
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(
812
- "div",
813
- {
814
- ref: o,
815
- className: cn("space-y-1", i, s && "mb-4"),
816
- ...n,
817
- children: [
818
- /* @__PURE__ */ jsxRuntimeExports.jsx(
819
- Text,
820
- {
821
- as: "h4",
822
- fontSize: "sm",
823
- fontWeight: "normal",
824
- color: "gray",
825
- className: "leading-none",
826
- children: t
827
- }
828
- ),
829
- /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "p", fontSize: "base", fontWeight: "normal", children: r })
830
- ]
831
- }
832
- );
833
- }
834
- );
835
- function getColSpan(e = 1) {
836
- switch (e) {
837
- case 1:
838
- return "col-span-1";
839
- case 2:
840
- return "col-span-2";
841
- case 3:
842
- return "col-span-3";
843
- case 4:
844
- return "col-span-4";
845
- case 5:
846
- return "col-span-5";
847
- case 6:
848
- return "col-span-6";
849
- case 7:
850
- return "col-span-7";
851
- case 8:
852
- return "col-span-8";
853
- case 9:
854
- return "col-span-9";
855
- case 10:
856
- return "col-span-10";
857
- case 11:
858
- return "col-span-11";
859
- case 12:
860
- return "col-span-12";
861
- default:
862
- return "col-span-1";
863
- }
864
- }
865
- function getGridCols(e = 4) {
866
- switch (e) {
867
- case 1:
868
- return "grid-cols-1";
869
- case 2:
870
- return "grid-cols-2";
871
- case 3:
872
- return "grid-cols-3";
873
- case 4:
874
- return "grid-cols-4";
875
- case 5:
876
- return "grid-cols-5";
877
- case 6:
878
- return "grid-cols-6";
879
- case 7:
880
- return "grid-cols-7";
881
- case 8:
882
- return "grid-cols-8";
883
- case 9:
884
- return "grid-cols-9";
885
- case 10:
886
- return "grid-cols-10";
887
- case 11:
888
- return "grid-cols-11";
889
- case 12:
890
- return "grid-cols-12";
891
- default:
892
- return "grid-cols-4";
893
- }
894
- }
895
- const AttributeListItem = forwardRef(function({ children: t, className: r, span: i = 1, title: s, ...n }, o) {
896
- const l = getColSpan(i);
897
- return /* @__PURE__ */ jsxRuntimeExports.jsx("li", { ref: o, className: cn(l, r), ...n, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Attribute, { title: s, children: t }) });
898
- }), AttributeListRoot = forwardRef(
899
- function({ children: t, className: r, columns: i = 4, ...s }, n) {
900
- const o = getGridCols(i);
901
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
902
- "ul",
903
- {
904
- ref: n,
905
- className: cn("grid gap-4", o, r),
906
- ...s,
907
- children: t
908
- }
909
- );
910
- }
911
- ), AttributeList = Object.assign(AttributeListRoot, {
912
- Item: AttributeListItem
913
- }), avatarVariants = cva(
914
- "inline-flex items-center justify-center font-medium text-white overflow-hidden transition-all duration-200 select-none relative",
915
- {
916
- variants: {
917
- variant: {
918
- // Core variants using Versaur color system
919
- primary: "bg-primary-light text-primary",
920
- secondary: "bg-secondary-light text-secondary",
921
- tertiary: "bg-tertiary-light text-tertiary",
922
- ghost: "bg-ghost-light text-ghost",
923
- neutral: "bg-neutral-light text-foreground border border-border",
924
- // Accent variants
925
- accent_1: "bg-accent-1-light text-accent-1",
926
- accent_2: "bg-accent-2-light text-accent-2",
927
- accent_3: "bg-accent-3-light text-accent-3",
928
- // Semantic variants
929
- success: "bg-success-light text-success",
930
- info: "bg-info-light text-info",
931
- warning: "bg-warning-light text-warning",
932
- danger: "bg-danger-light text-danger"
933
- },
934
- size: {
935
- xs: "h-6 w-6 text-xs",
936
- sm: "h-7 w-7 text-xs",
937
- md: "h-9 w-9 text-sm",
938
- lg: "h-10 w-10 text-base",
939
- xl: "h-12 w-12 text-xl"
940
- },
941
- shape: {
942
- circle: "rounded-full",
943
- square: "rounded-none",
944
- rounded: "rounded-md"
945
- }
946
- },
947
- defaultVariants: {
948
- variant: "primary",
949
- size: "md",
950
- shape: "circle"
951
- }
952
- }
953
- ), avatarImageVariants = cva(
954
- "absolute inset-0 h-full w-full object-cover"
955
- ), Avatar$1 = forwardRef(
956
- ({
957
- variant: e = "primary",
958
- size: t = "md",
959
- shape: r = "circle",
960
- className: i,
961
- children: s,
962
- ...n
963
- }, o) => /* @__PURE__ */ jsxRuntimeExports.jsx(
964
- "div",
965
- {
966
- ref: o,
967
- className: cn(avatarVariants({ variant: e, size: t, shape: r }), i),
968
- ...n,
969
- children: s
970
- }
971
- )
972
- ), AvatarImage = forwardRef(
973
- ({ src: e, alt: t, className: r, onError: i, ...s }, n) => {
974
- const [o, l] = useState(!1);
975
- useEffect(() => {
976
- l(!1);
977
- }, [e]);
978
- const u = useCallback(
979
- (c) => {
980
- l(!0), i?.(c);
981
- },
982
- [i]
983
- );
984
- return o ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
985
- "img",
986
- {
987
- ref: n,
988
- src: e,
989
- alt: t,
990
- className: cn(avatarImageVariants(), r),
991
- onError: u,
992
- ...s
993
- }
994
- );
995
- }
996
- ), Avatar = Object.assign(Avatar$1, {
997
- /**
998
- * AvatarImage sub-component for displaying images with fallback behavior
999
- */
1000
- Image: AvatarImage
1001
- }), badgeVariants = cva(
1002
- "inline-flex items-center justify-center font-medium transition-all duration-200 select-none gap-1 min-h-[1.25rem]",
1003
- {
1004
- variants: {
1005
- variant: {
1006
- default: "",
1007
- outline: "border bg-background"
1008
- },
1009
- color: {
1010
- // Core colors
1011
- primary: "",
1012
- secondary: "",
1013
- tertiary: "",
1014
- ghost: "",
1015
- neutral: "",
1016
- // Accent colors
1017
- accent_1: "",
1018
- accent_2: "",
1019
- accent_3: "",
1020
- // Semantic colors
1021
- success: "",
1022
- info: "",
1023
- warning: "",
1024
- danger: ""
1025
- },
1026
- shape: {
1027
- rounded: "rounded-full",
1028
- square: "rounded-xs"
1029
- },
1030
- size: {
1031
- sm: "text-xs px-1 py-0.25 h-3",
1032
- md: "text-xs px-1.5 py-0.5 h-4",
1033
- lg: "text-sm px-2 py-1 h-6"
1034
- },
1035
- iconOnly: {
1036
- true: "",
1037
- false: ""
1038
- }
1039
- },
1040
- compoundVariants: [
1041
- // Default variant color combinations - using light/soft backgrounds
1042
- {
1043
- variant: "default",
1044
- color: "primary",
1045
- className: "bg-primary-light text-primary-bold"
1046
- },
1047
- {
1048
- variant: "default",
1049
- color: "secondary",
1050
- className: "bg-secondary-light text-secondary-bold"
1051
- },
1052
- {
1053
- variant: "default",
1054
- color: "tertiary",
1055
- className: "bg-tertiary-light text-tertiary-bold"
1056
- },
1057
- {
1058
- variant: "default",
1059
- color: "ghost",
1060
- className: "bg-ghost/05 text-ghost"
1061
- },
1062
- {
1063
- variant: "default",
1064
- color: "neutral",
1065
- className: "bg-neutral-light text-foreground"
1066
- },
1067
- {
1068
- variant: "default",
1069
- color: "success",
1070
- className: "bg-success-light/50 text-success-bold"
1071
- },
1072
- {
1073
- variant: "default",
1074
- color: "info",
1075
- className: "bg-info-light/50 text-info-bold"
1076
- },
1077
- {
1078
- variant: "default",
1079
- color: "warning",
1080
- className: "bg-warning-light/50 text-warning-bold"
1081
- },
1082
- {
1083
- variant: "default",
1084
- color: "danger",
1085
- className: "bg-danger-light/40 text-danger-bold"
1086
- },
1087
- {
1088
- variant: "default",
1089
- color: "accent_1",
1090
- className: "bg-accent-1-light text-accent-1-bold"
1091
- },
1092
- {
1093
- variant: "default",
1094
- color: "accent_2",
1095
- className: "bg-accent-2-light text-accent-2-bold"
1096
- },
1097
- {
1098
- variant: "default",
1099
- color: "accent_3",
1100
- className: "bg-accent-3-light text-accent-3-bold"
1101
- },
1102
- // Outline variant color combinations
1103
- {
1104
- variant: "outline",
1105
- color: "primary",
1106
- className: "border-primary text-primary"
1107
- },
1108
- {
1109
- variant: "outline",
1110
- color: "secondary",
1111
- className: "border-secondary text-secondary"
1112
- },
1113
- {
1114
- variant: "outline",
1115
- color: "tertiary",
1116
- className: "border-tertiary text-tertiary"
1117
- },
1118
- {
1119
- variant: "outline",
1120
- color: "ghost",
1121
- className: "border-ghost text-ghost"
1122
- },
1123
- {
1124
- variant: "outline",
1125
- color: "neutral",
1126
- className: "border-neutral text-foreground"
1127
- },
1128
- {
1129
- variant: "outline",
1130
- color: "success",
1131
- className: "border-success text-success"
1132
- },
1133
- {
1134
- variant: "outline",
1135
- color: "info",
1136
- className: "border-info text-info"
1137
- },
1138
- {
1139
- variant: "outline",
1140
- color: "warning",
1141
- className: "border-warning text-warning"
1142
- },
1143
- {
1144
- variant: "outline",
1145
- color: "danger",
1146
- className: "border-danger text-danger"
1147
- },
1148
- {
1149
- variant: "outline",
1150
- color: "accent_1",
1151
- className: "border-accent-1 text-accent-1"
1152
- },
1153
- {
1154
- variant: "outline",
1155
- color: "accent_2",
1156
- className: "border-accent-2 text-accent-2"
1157
- },
1158
- {
1159
- variant: "outline",
1160
- color: "accent_3",
1161
- className: "border-accent-3 text-accent-3"
1162
- },
1163
- // Icon-only size adjustments
1164
- {
1165
- iconOnly: !0,
1166
- size: "sm",
1167
- className: "px-1 py-1 w-5 h-5"
1168
- },
1169
- {
1170
- iconOnly: !0,
1171
- size: "md",
1172
- className: "px-1.5 py-1.5 w-6 h-6"
1173
- },
1174
- {
1175
- iconOnly: !0,
1176
- size: "lg",
1177
- className: "px-2 py-2 w-7 h-7"
1178
- }
1179
- ],
1180
- defaultVariants: {
1181
- variant: "default",
1182
- color: "primary",
1183
- shape: "square",
1184
- size: "md",
1185
- iconOnly: !1
1186
- }
1187
- }
1188
- ), Badge = forwardRef(
1189
- ({
1190
- variant: e = "default",
1191
- shape: t = "square",
1192
- color: r = "primary",
1193
- size: i = "md",
1194
- iconLeft: s,
1195
- iconRight: n,
1196
- className: o,
1197
- children: l,
1198
- ...u
1199
- }, c) => {
1200
- const d = !(l != null && l !== "") && !!(s || n);
1201
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
1202
- "span",
1203
- {
1204
- ref: c,
1205
- className: cn(
1206
- badgeVariants({
1207
- variant: e,
1208
- color: r,
1209
- shape: t,
1210
- size: i,
1211
- iconOnly: d
1212
- }),
1213
- o
1214
- ),
1215
- ...u,
1216
- children: d ? (
1217
- // Icon-only mode: display only the icon
1218
- s || n
1219
- ) : (
1220
- // Normal mode: display icon(s) and text
1221
- /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
1222
- s,
1223
- l,
1224
- n
1225
- ] })
1226
- )
1227
- }
1228
- );
1229
- }
1230
- ), SvgSpenicleSquare = (e) => /* @__PURE__ */ React.createElement("svg", { width: 32, height: 32, viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ React.createElement("title", null, "Spenicle"), /* @__PURE__ */ React.createElement("rect", { width: 32, height: 32, fill: "#e07a5f" }), /* @__PURE__ */ React.createElement("g", { transform: "translate(16, 16) scale(0.625) translate(-12, -12)" }, /* @__PURE__ */ React.createElement("path", { d: "M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z", fill: "white" }))), SvgSpenicleRounded = (e) => /* @__PURE__ */ React.createElement("svg", { width: 32, height: 32, viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ React.createElement("title", null, "Spenicle"), /* @__PURE__ */ React.createElement("rect", { width: 32, height: 32, rx: 8, fill: "#e07a5f" }), /* @__PURE__ */ React.createElement("g", { transform: "translate(16, 16) scale(0.625) translate(-12, -12)" }, /* @__PURE__ */ React.createElement("path", { d: "M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z", fill: "white" }))), SvgSpenicleCircle = (e) => /* @__PURE__ */ React.createElement("svg", { width: 32, height: 32, viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ React.createElement("title", null, "Spenicle"), /* @__PURE__ */ React.createElement("circle", { cx: 16, cy: 16, r: 16, fill: "#e07a5f" }), /* @__PURE__ */ React.createElement("g", { transform: "translate(16, 16) scale(0.625) translate(-12, -12)" }, /* @__PURE__ */ React.createElement("path", { d: "M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z", fill: "white" }))), SvgHubSquare = (e) => /* @__PURE__ */ React.createElement("svg", { width: 32, height: 32, viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ React.createElement("title", null, "Hub (Square)"), /* @__PURE__ */ React.createElement("rect", { x: 0, y: 0, width: 32, height: 32, rx: 0, fill: "#e07a5f" }), /* @__PURE__ */ React.createElement("g", { transform: "translate(16, 16) scale(0.625) translate(-12, -12)" }, /* @__PURE__ */ React.createElement("path", { d: "M20.341 6.484A10 10 0 0 1 10.266 21.85", stroke: "white", strokeWidth: 2, fill: "none" }), /* @__PURE__ */ React.createElement("path", { d: "M3.659 17.516A10 10 0 0 1 13.74 2.152", stroke: "white", strokeWidth: 2, fill: "none" }), /* @__PURE__ */ React.createElement("circle", { cx: 12, cy: 12, r: 3, fill: "white" }), /* @__PURE__ */ React.createElement("circle", { cx: 19, cy: 5, r: 2, fill: "white" }), /* @__PURE__ */ React.createElement("circle", { cx: 5, cy: 19, r: 2, fill: "white" }))), SvgHubRounded = (e) => /* @__PURE__ */ React.createElement("svg", { width: 32, height: 32, viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ React.createElement("title", null, "Hub (Rounded)"), /* @__PURE__ */ React.createElement("rect", { x: 0, y: 0, width: 32, height: 32, rx: 8, fill: "#e07a5f" }), /* @__PURE__ */ React.createElement("g", { transform: "translate(16, 16) scale(0.625) translate(-12, -12)" }, /* @__PURE__ */ React.createElement("path", { d: "M20.341 6.484A10 10 0 0 1 10.266 21.85", stroke: "white", strokeWidth: 2, fill: "none" }), /* @__PURE__ */ React.createElement("path", { d: "M3.659 17.516A10 10 0 0 1 13.74 2.152", stroke: "white", strokeWidth: 2, fill: "none" }), /* @__PURE__ */ React.createElement("circle", { cx: 12, cy: 12, r: 3, fill: "white" }), /* @__PURE__ */ React.createElement("circle", { cx: 19, cy: 5, r: 2, fill: "white" }), /* @__PURE__ */ React.createElement("circle", { cx: 5, cy: 19, r: 2, fill: "white" }))), SvgHubCircle = (e) => /* @__PURE__ */ React.createElement("svg", { width: 32, height: 32, viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ React.createElement("title", null, "Hub (Circle)"), /* @__PURE__ */ React.createElement("circle", { cx: 16, cy: 16, r: 16, fill: "#e07a5f" }), /* @__PURE__ */ React.createElement("g", { transform: "translate(16, 16) scale(0.625) translate(-12, -12)" }, /* @__PURE__ */ React.createElement("path", { d: "M20.341 6.484A10 10 0 0 1 10.266 21.85", stroke: "white", strokeWidth: 2, fill: "none" }), /* @__PURE__ */ React.createElement("path", { d: "M3.659 17.516A10 10 0 0 1 13.74 2.152", stroke: "white", strokeWidth: 2, fill: "none" }), /* @__PURE__ */ React.createElement("circle", { cx: 12, cy: 12, r: 3, fill: "white" }), /* @__PURE__ */ React.createElement("circle", { cx: 19, cy: 5, r: 2, fill: "white" }), /* @__PURE__ */ React.createElement("circle", { cx: 5, cy: 19, r: 2, fill: "white" }))), SvgNotunicSquare = (e) => /* @__PURE__ */ React.createElement("svg", { width: 32, height: 32, viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ React.createElement("title", null, "Notunic"), /* @__PURE__ */ React.createElement("rect", { width: 32, height: 32, fill: "#e07a5f" }), /* @__PURE__ */ React.createElement("g", { transform: "translate(16, 16) scale(0.625) translate(-12, -12)" }, /* @__PURE__ */ React.createElement("path", { d: "M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4", fill: "none", stroke: "white", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React.createElement("path", { d: "M2 6h4", fill: "none", stroke: "white", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React.createElement("path", { d: "M2 10h4", fill: "none", stroke: "white", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React.createElement("path", { d: "M2 14h4", fill: "none", stroke: "white", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React.createElement("path", { d: "M2 18h4", fill: "none", stroke: "white", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React.createElement("path", { d: "M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z", fill: "white" }))), SvgNotunicRounded = (e) => /* @__PURE__ */ React.createElement("svg", { width: 32, height: 32, viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ React.createElement("title", null, "Notunic"), /* @__PURE__ */ React.createElement("rect", { width: 32, height: 32, rx: 8, fill: "#e07a5f" }), /* @__PURE__ */ React.createElement("g", { transform: "translate(16, 16) scale(0.625) translate(-12, -12)" }, /* @__PURE__ */ React.createElement("path", { d: "M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4", fill: "none", stroke: "white", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React.createElement("path", { d: "M2 6h4", fill: "none", stroke: "white", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React.createElement("path", { d: "M2 10h4", fill: "none", stroke: "white", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React.createElement("path", { d: "M2 14h4", fill: "none", stroke: "white", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React.createElement("path", { d: "M2 18h4", fill: "none", stroke: "white", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React.createElement("path", { d: "M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z", fill: "white" }))), SvgNotunicCircle = (e) => /* @__PURE__ */ React.createElement("svg", { width: 32, height: 32, viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ React.createElement("title", null, "Notunic"), /* @__PURE__ */ React.createElement("circle", { cx: 16, cy: 16, r: 16, fill: "#e07a5f" }), /* @__PURE__ */ React.createElement("g", { transform: "translate(16, 16) scale(0.625) translate(-12, -12)" }, /* @__PURE__ */ React.createElement("path", { d: "M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4", fill: "none", stroke: "white", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React.createElement("path", { d: "M2 6h4", fill: "none", stroke: "white", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React.createElement("path", { d: "M2 10h4", fill: "none", stroke: "white", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React.createElement("path", { d: "M2 14h4", fill: "none", stroke: "white", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React.createElement("path", { d: "M2 18h4", fill: "none", stroke: "white", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React.createElement("path", { d: "M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z", fill: "white" }))), brandSizeClass = cva("", {
1231
- variants: {
1232
- size: {
1233
- xs: "h-6 w-6",
1234
- sm: "h-7 w-7",
1235
- md: "h-9 w-9",
1236
- lg: "h-10 w-10",
1237
- xl: "h-12 w-12"
1238
- }
1239
- },
1240
- defaultVariants: {
1241
- size: "md"
1242
- }
1243
- }), BrandLogo = forwardRef(
1244
- ({ shape: e = "square", size: t, name: r = "spenicle", ...i }, s) => {
1245
- const n = {
1246
- spenicle: {
1247
- square: SvgSpenicleSquare,
1248
- rounded: SvgSpenicleRounded,
1249
- circle: SvgSpenicleCircle
1250
- },
1251
- hub: {
1252
- square: SvgHubSquare,
1253
- rounded: SvgHubRounded,
1254
- circle: SvgHubCircle
1255
- },
1256
- notunic: {
1257
- square: SvgNotunicSquare,
1258
- rounded: SvgNotunicRounded,
1259
- circle: SvgNotunicCircle
1260
- }
1261
- }, l = (n[r] || n.spenicle)[e || "square"] || SvgSpenicleSquare;
1262
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
1263
- l,
1264
- {
1265
- ref: s,
1266
- ...i,
1267
- className: cn("inline-block", brandSizeClass({ size: t }))
1268
- }
1269
- );
1270
- }
1271
- ), Brand = forwardRef(
1272
- ({ name: e = "spenicle", size: t = "md", shape: r, ...i }, s) => /* @__PURE__ */ jsxRuntimeExports.jsx(
1273
- "span",
1274
- {
1275
- ref: s,
1276
- className: cn("inline-flex items-center gap-2"),
1277
- ...i,
1278
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(BrandLogo, { name: e, shape: r, size: t, "aria-hidden": "true" })
1279
- }
1280
- )
1281
- ), buttonVariants = cva(
1282
- "inline-flex items-center justify-center gap-2 rounded-md font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none active:scale-[0.98] select-none cursor-pointer",
1283
- {
1284
- variants: {
1285
- variant: {
1286
- // Core variants using Versaur color system
1287
- primary: "bg-primary text-white hover:bg-primary/90 focus-visible:ring-primary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
1288
- secondary: "bg-secondary text-white hover:bg-secondary/90 focus-visible:ring-secondary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
1289
- tertiary: "bg-tertiary text-white hover:bg-tertiary/90 focus-visible:ring-tertiary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
1290
- accent_1: "bg-accent-1 text-white hover:bg-accent-1/90 focus-visible:ring-accent-1-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
1291
- accent_2: "bg-accent-2 text-white hover:bg-accent-2/90 focus-visible:ring-accent-2-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
1292
- accent_3: "bg-accent-3 text-white hover:bg-accent-3/90 focus-visible:ring-accent-3-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
1293
- ghost: "bg-white text-foreground hover:bg-ghost-soft focus-visible:ring-ghost-light focus-visible:ring-offset-white",
1294
- neutral: "bg-neutral text-foreground border border-border hover:bg-neutral/80 focus-visible:ring-foreground-light focus-visible:ring-offset-white shadow-sm",
1295
- // Outline variants
1296
- "primary-outline": "border border-primary text-primary bg-white hover:bg-primary hover:text-white focus-visible:ring-primary-light focus-visible:ring-offset-white transition-all",
1297
- "secondary-outline": "border border-secondary text-secondary bg-white hover:bg-secondary hover:text-white focus-visible:ring-secondary-light focus-visible:ring-offset-white transition-all",
1298
- "tertiary-outline": "border border-tertiary text-tertiary bg-white hover:bg-tertiary hover:text-white focus-visible:ring-tertiary-light focus-visible:ring-offset-white transition-all",
1299
- "accent_1-outline": "border border-accent-1 text-accent-1 bg-white hover:bg-accent-1 hover:text-white focus-visible:ring-accent-1-light focus-visible:ring-offset-white transition-all",
1300
- "accent_2-outline": "border border-accent-2 text-accent-2 bg-white hover:bg-accent-2 hover:text-white focus-visible:ring-accent-2-light focus-visible:ring-offset-white transition-all",
1301
- "accent_3-outline": "border border-accent-3 text-accent-3 bg-white hover:bg-accent-3 hover:text-white focus-visible:ring-accent-3-light focus-visible:ring-offset-white transition-all",
1302
- "ghost-outline": "border border-ghost text-ghost bg-white hover:bg-ghost hover:text-white focus-visible:ring-ghost-light focus-visible:ring-offset-white transition-all",
1303
- "neutral-outline": "border border-border text-foreground bg-white hover:bg-neutral hover:text-foreground focus-visible:ring-foreground-light focus-visible:ring-offset-white transition-all",
1304
- // Ghost variants (subtle)
1305
- "primary-ghost": "text-primary bg-white hover:bg-primary/20 focus-visible:ring-primary focus-visible:ring-offset-white",
1306
- "secondary-ghost": "text-secondary bg-white hover:bg-secondary/20 focus-visible:ring-secondary focus-visible:ring-offset-white",
1307
- "tertiary-ghost": "text-tertiary bg-white hover:bg-tertiary/20 focus-visible:ring-tertiary focus-visible:ring-offset-white",
1308
- "neutral-ghost": "text-foreground bg-white hover:bg-neutral/50 focus-visible:ring-foreground focus-visible:ring-offset-white",
1309
- "accent_1-ghost": "text-accent-1 bg-white hover:bg-accent-1/20 focus-visible:ring-accent-1 focus-visible:ring-offset-white",
1310
- "accent_2-ghost": "text-accent-2 bg-white hover:bg-accent-2/20 focus-visible:ring-accent-2 focus-visible:ring-offset-white",
1311
- "accent_3-ghost": "text-accent-3 bg-white hover:bg-accent-3/20 focus-visible:ring-accent-3 focus-visible:ring-offset-white",
1312
- // Semantic variants
1313
- success: "bg-success text-white hover:bg-success/90 focus-visible:ring-success-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
1314
- "success-outline": "border border-success text-success bg-white hover:bg-success hover:text-white focus-visible:ring-success-light focus-visible:ring-offset-white transition-all",
1315
- "success-ghost": "text-success bg-white hover:bg-success/20 focus-visible:ring-success-light focus-visible:ring-offset-white",
1316
- info: "bg-info text-white hover:bg-info/90 focus-visible:ring-info-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
1317
- "info-outline": "border border-info text-info bg-white hover:bg-info hover:text-white focus-visible:ring-info-light focus-visible:ring-offset-white transition-all",
1318
- "info-ghost": "text-info bg-white hover:bg-info/20 focus-visible:ring-info-light focus-visible:ring-offset-white",
1319
- warning: "bg-warning text-white hover:bg-warning/90 focus-visible:ring-warning-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
1320
- "warning-outline": "border border-warning text-warning bg-white hover:bg-warning hover:text-white focus-visible:ring-warning-light focus-visible:ring-offset-white transition-all",
1321
- "warning-ghost": "text-warning bg-white hover:bg-warning/20 focus-visible:ring-warning-light focus-visible:ring-offset-white",
1322
- danger: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
1323
- "danger-outline": "border border-danger text-danger bg-white hover:bg-danger hover:text-white focus-visible:ring-danger-light focus-visible:ring-offset-white transition-all",
1324
- "danger-ghost": "text-danger bg-white hover:bg-danger/20 focus-visible:ring-danger-light focus-visible:ring-offset-white",
1325
- // Utility variants
1326
- outline: "border border-border text-foreground bg-white hover:bg-accent-soft focus-visible:ring-accent-soft focus-visible:ring-offset-white transition-all",
1327
- destructive: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md"
1328
- },
1329
- size: {
1330
- sm: "h-7 px-3 text-sm min-w-[2.25rem]",
1331
- md: "h-9 px-4 text-sm min-w-[2.5rem]",
1332
- lg: "h-10 px-8 text-lg min-w-[2.75rem]"
1333
- }
1334
- },
1335
- defaultVariants: {
1336
- variant: "primary",
1337
- size: "md"
1338
- }
1339
- }
1340
- ), Button = React__default.forwardRef(
1341
- function({
1342
- className: t,
1343
- variant: r = "primary",
1344
- size: i = "md",
1345
- disabled: s = !1,
1346
- type: n = "button",
1347
- children: o,
1348
- ...l
1349
- }, u) {
1350
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
1351
- "button",
1352
- {
1353
- ref: u,
1354
- type: n,
1355
- className: cn(buttonVariants({ variant: r, size: i }), t),
1356
- disabled: s,
1357
- "aria-disabled": s,
1358
- inert: s ? !0 : void 0,
1359
- ...l,
1360
- children: o
1361
- }
1362
- );
1363
- }
1364
- ), OverlayPortal = ({
1365
- container: e,
1366
- children: t
1367
- }) => {
1368
- if (typeof window > "u" || typeof document > "u")
1369
- return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: t });
1370
- const r = e ?? document.body;
1371
- return r ? ReactDOM.createPortal(t, r) : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: t });
1372
- }, menuVariants = cva(
1373
- "z-70 min-w-40 bg-background rounded-lg border border-border transition-all duration-200 ease-out will-change-transform shadow-lg",
1374
- {
1375
- variants: {
1376
- size: {
1377
- sm: "py-1.5 px-1",
1378
- md: "py-2 px-1"
1379
- },
1380
- open: {
1381
- true: "opacity-100 scale-100",
1382
- false: "opacity-0 pointer-events-none scale-95"
1383
- }
1384
- },
1385
- defaultVariants: {
1386
- size: "md",
1387
- open: !1
1388
- }
1389
- }
1390
- );
1391
- function useMenuOutsideClick(e, t, r, i) {
1392
- useEffect(() => {
1393
- if (!e) return;
1394
- function s(n) {
1395
- !t.current?.contains(n.target) && !r.current?.contains(n.target) && i();
1396
- }
1397
- return document.addEventListener("mousedown", s), () => document.removeEventListener("mousedown", s);
1398
- }, [e, i, t, r]);
1399
- }
1400
- function getScrollableAncestors(e) {
1401
- const t = [];
1402
- let r = e.parentElement;
1403
- for (; r && r !== document.documentElement; ) {
1404
- const i = getComputedStyle(r);
1405
- (i.overflow === "auto" || i.overflow === "scroll" || i.overflowY === "auto" || i.overflowY === "scroll" || i.overflowX === "auto" || i.overflowX === "scroll") && t.push(r), r = r.parentElement;
1406
- }
1407
- return t.push(document.documentElement), t;
1408
- }
1409
- function isTriggerVisible(e, t) {
1410
- const r = e.getBoundingClientRect();
1411
- if (r.bottom < 0 || r.top > window.innerHeight || r.right < 0 || r.left > window.innerWidth)
1412
- return !1;
1413
- for (const i of t) {
1414
- if (i === document.documentElement) continue;
1415
- const s = i.getBoundingClientRect();
1416
- if (r.bottom < s.top || r.top > s.bottom || r.right < s.left || r.left > s.right)
1417
- return !1;
1418
- }
1419
- return !0;
1420
- }
1421
- function useMenuPosition(e, t, r, i = "bottom-start", s) {
1422
- const [n, o] = useState({ isReady: !1 }), l = useCallback(() => {
1423
- if (!e || !t.current) {
1424
- o({ isReady: !1 });
1425
- return;
1426
- }
1427
- if (!r.current) {
1428
- const v = setTimeout(() => {
1429
- o({ isReady: !1 });
1430
- }, 0);
1431
- return () => clearTimeout(v);
1432
- }
1433
- const u = t.current, c = r.current, f = getScrollableAncestors(u);
1434
- if (!isTriggerVisible(u, f)) {
1435
- o({ isReady: !1 });
1436
- return;
1437
- }
1438
- const a = u.getBoundingClientRect(), d = window.innerWidth, h = window.innerHeight;
1439
- let x = null;
1440
- s && ("getBoundingClientRect" in s ? x = s : "current" in s && (x = s.current));
1441
- const y = x || document.documentElement, w = y === document.documentElement ? { top: 0, bottom: h, left: 0, right: d } : y.getBoundingClientRect(), j = c.style.visibility, E = c.style.position, C = c.style.opacity;
1442
- c.style.visibility = "hidden", c.style.position = "absolute", c.style.opacity = "0";
1443
- const m = c.getBoundingClientRect();
1444
- c.style.visibility = j, c.style.position = E, c.style.opacity = C;
1445
- const k = w.bottom - a.bottom - 8, N = a.top - w.top - 8, I = w.right - a.left - 8, V = a.right - w.left - 8;
1446
- let p = i;
1447
- if (i === "auto") {
1448
- const b = [
1449
- {
1450
- name: "bottom-start",
1451
- fits: k >= m.height && I >= m.width,
1452
- spaceUsed: k,
1453
- priority: 1
1454
- // Prefer bottom-start as default
1455
- },
1456
- {
1457
- name: "bottom-end",
1458
- fits: k >= m.height && V >= m.width,
1459
- spaceUsed: k,
1460
- priority: 2
1461
- },
1462
- {
1463
- name: "top-start",
1464
- fits: N >= m.height && I >= m.width,
1465
- spaceUsed: N,
1466
- priority: 3
1467
- },
1468
- {
1469
- name: "top-end",
1470
- fits: N >= m.height && V >= m.width,
1471
- spaceUsed: N,
1472
- priority: 4
1473
- }
1474
- ].filter((R) => R.fits);
1475
- b.length > 0 ? p = b.sort(
1476
- (R, S) => R.priority - S.priority
1477
- )[0].name : k >= N ? p = I >= V ? "bottom-start" : "bottom-end" : p = I >= V ? "top-start" : "top-end";
1478
- }
1479
- const g = {};
1480
- if (s)
1481
- switch (g.position = "fixed", p) {
1482
- case "bottom-start":
1483
- g.top = a.bottom + 4, g.left = a.left;
1484
- break;
1485
- case "bottom-end":
1486
- g.top = a.bottom + 4, g.right = window.innerWidth - a.right;
1487
- break;
1488
- case "top-start":
1489
- g.bottom = window.innerHeight - a.top + 4, g.left = a.left;
1490
- break;
1491
- case "top-end":
1492
- g.bottom = window.innerHeight - a.top + 4, g.right = window.innerWidth - a.right;
1493
- break;
1494
- }
1495
- else
1496
- switch (g.position = "absolute", p) {
1497
- case "bottom-start":
1498
- g.top = a.height + 4, g.left = 0;
1499
- break;
1500
- case "bottom-end":
1501
- g.top = a.height + 4, g.right = 0;
1502
- break;
1503
- case "top-start":
1504
- g.bottom = a.height + 4, g.left = 0;
1505
- break;
1506
- case "top-end":
1507
- g.bottom = a.height + 4, g.right = 0;
1508
- break;
1509
- }
1510
- if (s) {
1511
- const v = {
1512
- top: p.startsWith("bottom") ? a.bottom + 4 : a.top - m.height - 4,
1513
- left: p.endsWith("start") ? a.left : a.right - m.width,
1514
- width: m.width,
1515
- height: m.height
1516
- };
1517
- if (v.left < w.left + 8) {
1518
- const b = w.left + 8 - v.left;
1519
- p.endsWith("start") ? g.left = (g.left || 0) + b : g.right = (g.right || 0) - b;
1520
- } else if (v.left + v.width > w.right - 8) {
1521
- const b = v.left + v.width - (w.right - 8);
1522
- p.endsWith("start") ? g.left = (g.left || 0) - b : g.right = (g.right || 0) + b;
1523
- }
1524
- if (p.startsWith("bottom")) {
1525
- const b = Math.max(
1526
- 50,
1527
- w.bottom - a.bottom - 16
1528
- );
1529
- m.height > b && (g.maxHeight = b);
1530
- } else {
1531
- const b = Math.max(
1532
- 50,
1533
- a.top - w.top - 16
1534
- );
1535
- m.height > b && (g.maxHeight = b);
1536
- }
1537
- } else {
1538
- const v = {
1539
- top: p.startsWith("bottom") ? a.height + 4 : -m.height - 4,
1540
- left: p.endsWith("start") ? 0 : -m.width,
1541
- width: m.width,
1542
- height: m.height
1543
- }, b = {
1544
- left: a.left,
1545
- right: a.right,
1546
- top: a.top,
1547
- bottom: a.bottom
1548
- };
1549
- if (b.left + v.left < 8) {
1550
- const R = 8 - (b.left + v.left);
1551
- p.endsWith("start") ? g.left = (g.left || 0) + R : g.right = (g.right || 0) - R;
1552
- } else if (b.left + v.left + v.width > d - 8) {
1553
- const R = b.left + v.left + v.width - (d - 8);
1554
- p.endsWith("start") ? g.left = (g.left || 0) - R : g.right = (g.right || 0) + R;
1555
- }
1556
- }
1557
- g.isReady = !0, o(g);
1558
- }, [e, i, t, r, s]);
1559
- return useEffect(() => {
1560
- l();
1561
- }, [l]), useEffect(() => {
1562
- if (!e || !t.current) return;
1563
- const u = t.current, c = getScrollableAncestors(u);
1564
- let f = !1;
1565
- const a = () => {
1566
- f || (requestAnimationFrame(() => {
1567
- l(), f = !1;
1568
- }), f = !0);
1569
- };
1570
- return c.forEach((d) => {
1571
- d === document.documentElement ? (window.addEventListener("scroll", a, { passive: !0 }), window.addEventListener("resize", a, { passive: !0 })) : d.addEventListener("scroll", a, { passive: !0 });
1572
- }), () => {
1573
- c.forEach((d) => {
1574
- d === document.documentElement ? (window.removeEventListener("scroll", a), window.removeEventListener("resize", a)) : d.removeEventListener("scroll", a);
1575
- });
1576
- };
1577
- }, [e, l, t]), n;
1578
- }
1579
- const MenuContext = createContext(void 0), MenuProvider = MenuContext.Provider, useMenuProvider = () => {
1580
- const e = useContext(MenuContext);
1581
- if (!e)
1582
- throw new Error("useMenuProvider must be used within a MenuProvider");
1583
- return e;
1584
- }, MenuContent = forwardRef(
1585
- ({ children: e }, t) => /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { ref: t, className: "flex flex-col gap-1", children: e })
1586
- ), MenuItem = forwardRef(
1587
- ({ children: e, disabled: t, onClick: r, active: i, ...s }, n) => {
1588
- const { preserve: o, onClose: l } = useMenuProvider(), u = (c) => {
1589
- r?.(c), o || l();
1590
- };
1591
- return /* @__PURE__ */ jsxRuntimeExports.jsx("li", { ref: n, ...s, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
1592
- Button,
1593
- {
1594
- variant: "ghost",
1595
- className: cn("justify-start w-full gap-2"),
1596
- disabled: t,
1597
- onClick: u,
1598
- children: [
1599
- e,
1600
- i && /* @__PURE__ */ jsxRuntimeExports.jsx(
1601
- Icon,
1602
- {
1603
- as: CheckIcon,
1604
- color: "inherit",
1605
- className: "ml-auto",
1606
- size: "sm"
1607
- }
1608
- )
1609
- ]
1610
- }
1611
- ) });
1612
- }
1613
- ), MenuRoot = ({
1614
- isOpen: e,
1615
- onOutsideClick: t,
1616
- size: r = "md",
1617
- content: i,
1618
- children: s,
1619
- placement: n = "auto",
1620
- container: o,
1621
- preserve: l
1622
- }) => {
1623
- const u = useRef(null), c = useRef(null), f = useId();
1624
- useMenuOutsideClick(e, c, u, t);
1625
- const a = useMenuPosition(
1626
- e,
1627
- u,
1628
- c,
1629
- n,
1630
- o || null
1631
- ), d = {
1632
- ...a,
1633
- position: a.position || "absolute",
1634
- overflowY: a.maxHeight ? "auto" : void 0,
1635
- overflowX: a.maxWidth ? "auto" : void 0
1636
- }, h = e && a.isReady, x = /* @__PURE__ */ jsxRuntimeExports.jsx(
1637
- "div",
1638
- {
1639
- id: f,
1640
- ref: c,
1641
- className: cn(menuVariants({ size: r, open: h })),
1642
- style: d,
1643
- role: "menu",
1644
- "aria-hidden": !h,
1645
- children: i
1646
- }
1647
- );
1648
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
1649
- MenuProvider,
1650
- {
1651
- value: { onClose: t, preserve: !!l },
1652
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative w-fit", children: [
1653
- cloneElement(s, {
1654
- // @ts-expect-error: ref is valid for button or forwardRef components
1655
- ref: u,
1656
- "aria-haspopup": "menu",
1657
- "aria-expanded": e,
1658
- "aria-controls": f
1659
- }),
1660
- e && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
1661
- !a.isReady && /* @__PURE__ */ jsxRuntimeExports.jsx(
1662
- "div",
1663
- {
1664
- ref: c,
1665
- className: cn(menuVariants({ size: r, open: !1 })),
1666
- style: {
1667
- position: "absolute",
1668
- visibility: "hidden",
1669
- opacity: 0,
1670
- pointerEvents: "none"
1671
- },
1672
- role: "menu",
1673
- "aria-hidden": !0,
1674
- children: i
1675
- }
1676
- ),
1677
- a.isReady && /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: a.position === "fixed" ? /* @__PURE__ */ jsxRuntimeExports.jsx(OverlayPortal, { children: x }) : x })
1678
- ] })
1679
- ] })
1680
- }
1681
- );
1682
- }, Menu = Object.assign(MenuRoot, {
1683
- Content: MenuContent,
1684
- Item: MenuItem
1685
- }), ButtonMenuRoot = forwardRef(
1686
- (e, t) => {
1687
- const {
1688
- children: r,
1689
- onOpenChange: i,
1690
- onClick: s,
1691
- placement: n,
1692
- container: o,
1693
- preserve: l,
1694
- label: u,
1695
- ...c
1696
- } = e ?? {}, [f, a] = useState(!1);
1697
- useEffect(() => {
1698
- i?.(f);
1699
- }, [f, i]);
1700
- const d = () => {
1701
- a(!1);
1702
- }, h = (x) => {
1703
- a((y) => !y), s?.(x);
1704
- };
1705
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
1706
- Menu,
1707
- {
1708
- isOpen: f,
1709
- onOutsideClick: d,
1710
- placement: n,
1711
- container: o,
1712
- preserve: l,
1713
- content: /* @__PURE__ */ jsxRuntimeExports.jsx(Menu.Content, { children: r }),
1714
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { ref: t, onClick: h, ...c, children: u })
1715
- }
1716
- );
1717
- }
1718
- ), ButtonMenu = Object.assign(ButtonMenuRoot, {
1719
- Item: Menu.Item
1720
- });
1721
- function getIconColorFromVariant(e = "primary") {
1722
- const t = e.split("-");
1723
- if (t.length === 1)
1724
- switch (t[0]) {
1725
- case "ghost":
1726
- case "neutral":
1727
- case "outline":
1728
- return "ghost";
1729
- default:
1730
- return "white";
1731
- }
1732
- if (t?.[1] === "outline") return "inherit";
1733
- switch (t[0]) {
1734
- case "primary":
1735
- return "primary";
1736
- case "secondary":
1737
- return "secondary";
1738
- case "tertiary":
1739
- return "tertiary";
1740
- case "ghost":
1741
- return "ghost";
1742
- case "neutral":
1743
- return "ghost";
1744
- case "success":
1745
- return "success";
1746
- case "info":
1747
- return "info";
1748
- case "warning":
1749
- return "warning";
1750
- case "danger":
1751
- return "danger";
1752
- default:
1753
- return "neutral";
1754
- }
1755
- }
1756
- const buttonIconVariants = cva(
1757
- "inline-flex items-center justify-center font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none active:scale-[0.98] select-none cursor-pointer",
1758
- {
1759
- variants: {
1760
- variant: {
1761
- primary: "bg-primary text-white hover:bg-primary/90 focus-visible:ring-primary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
1762
- secondary: "bg-secondary text-white hover:bg-secondary/90 focus-visible:ring-secondary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
1763
- tertiary: "bg-tertiary text-white hover:bg-tertiary/90 focus-visible:ring-tertiary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
1764
- ghost: "bg-white text-foreground hover:bg-ghost-soft focus-visible:ring-ghost-light focus-visible:ring-offset-white",
1765
- neutral: "bg-neutral text-foreground border border-border hover:bg-neutral/80 focus-visible:ring-foreground-light focus-visible:ring-offset-white shadow-sm",
1766
- "primary-outline": "border border-border text-primary bg-white hover:bg-primary hover:text-white focus-visible:ring-primary-light focus-visible:ring-offset-white transition-all",
1767
- "secondary-outline": "border border-border text-secondary bg-white hover:bg-secondary hover:text-white focus-visible:ring-secondary-light focus-visible:ring-offset-white transition-all",
1768
- "tertiary-outline": "border border-border text-tertiary bg-white hover:bg-tertiary hover:text-white focus-visible:ring-tertiary-light focus-visible:ring-offset-white transition-all",
1769
- "ghost-outline": "border border-border text-ghost bg-white hover:bg-ghost hover:text-white focus-visible:ring-ghost-light focus-visible:ring-offset-white transition-all",
1770
- "neutral-outline": "border border-border text-foreground bg-white hover:bg-neutral hover:text-foreground focus-visible:ring-foreground-light focus-visible:ring-offset-white transition-all",
1771
- "primary-ghost": "text-primary bg-white hover:bg-primary/20 focus-visible:ring-primary focus-visible:ring-offset-white",
1772
- "secondary-ghost": "text-secondary bg-white hover:bg-secondary/20 focus-visible:ring-secondary focus-visible:ring-offset-white",
1773
- "tertiary-ghost": "text-tertiary bg-white hover:bg-tertiary/20 focus-visible:ring-tertiary focus-visible:ring-offset-white",
1774
- "neutral-ghost": "text-foreground bg-white hover:bg-neutral/50 focus-visible:ring-foreground focus-visible:ring-offset-white",
1775
- success: "bg-success text-white hover:bg-success/90 focus-visible:ring-success-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
1776
- "success-outline": "border border-border text-success bg-white hover:bg-success hover:text-white focus-visible:ring-success-light focus-visible:ring-offset-white transition-all",
1777
- "success-ghost": "text-success bg-white hover:bg-success/20 focus-visible:ring-success-light focus-visible:ring-offset-white",
1778
- info: "bg-info text-white hover:bg-info/90 focus-visible:ring-info-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
1779
- "info-outline": "border border-border text-info bg-white hover:bg-info hover:text-white focus-visible:ring-info-light focus-visible:ring-offset-white transition-all",
1780
- "info-ghost": "text-info bg-white hover:bg-info/20 focus-visible:ring-info-light focus-visible:ring-offset-white",
1781
- warning: "bg-warning text-white hover:bg-warning/90 focus-visible:ring-warning-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
1782
- "warning-outline": "border border-border text-warning bg-white hover:bg-warning hover:text-white focus-visible:ring-warning-light focus-visible:ring-offset-white transition-all",
1783
- "warning-ghost": "text-warning bg-white hover:bg-warning/20 focus-visible:ring-warning-light focus-visible:ring-offset-white",
1784
- danger: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
1785
- "danger-outline": "border border-border text-danger bg-white hover:bg-danger hover:text-white focus-visible:ring-danger-light focus-visible:ring-offset-white transition-all",
1786
- "danger-ghost": "text-danger bg-white hover:bg-danger/20 focus-visible:ring-danger-light focus-visible:ring-offset-white",
1787
- outline: "border border-border text-foreground bg-white hover:bg-accent-soft focus-visible:ring-accent-soft focus-visible:ring-offset-white transition-all",
1788
- destructive: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md"
1789
- },
1790
- size: {
1791
- xs: "h-6 w-6",
1792
- sm: "h-7 w-7",
1793
- md: "h-9 w-9",
1794
- lg: "h-10 w-10",
1795
- xl: "h-12 w-12"
1796
- },
1797
- shape: {
1798
- rounded: "rounded-md",
1799
- square: "rounded-sm",
1800
- circle: "rounded-full"
1801
- }
1802
- },
1803
- defaultVariants: {
1804
- variant: "primary",
1805
- size: "md",
1806
- shape: "rounded"
1807
- }
1808
- }
1809
- ), ButtonIcon = React__default.forwardRef(
1810
- function({
1811
- className: t,
1812
- variant: r = "primary",
1813
- size: i = "md",
1814
- shape: s = "rounded",
1815
- disabled: n = !1,
1816
- as: o,
1817
- "aria-label": l,
1818
- ...u
1819
- }, c) {
1820
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
1821
- "button",
1822
- {
1823
- ref: c,
1824
- type: "button",
1825
- className: cn(
1826
- buttonIconVariants({
1827
- variant: r,
1828
- size: i,
1829
- shape: s
1830
- }),
1831
- t
1832
- ),
1833
- disabled: n,
1834
- "aria-disabled": n,
1835
- "aria-label": l,
1836
- inert: n ? !0 : void 0,
1837
- ...u,
1838
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1839
- Icon,
1840
- {
1841
- as: o,
1842
- size: "sm",
1843
- color: getIconColorFromVariant(r)
1844
- }
1845
- )
1846
- }
1847
- );
1848
- }
1849
- ), ButtonMenuIconRoot = forwardRef(
1850
- (e, t) => {
1851
- const {
1852
- as: r = EllipsisVerticalIcon,
1853
- children: i,
1854
- onOpenChange: s,
1855
- onClick: n,
1856
- placement: o,
1857
- container: l,
1858
- preserve: u,
1859
- ...c
1860
- } = e ?? {}, [f, a] = useState(!1);
1861
- useEffect(() => {
1862
- s?.(f);
1863
- }, [f, s]);
1864
- const d = () => {
1865
- a(!1);
1866
- }, h = (x) => {
1867
- a((y) => !y), n?.(x);
1868
- };
1869
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
1870
- Menu,
1871
- {
1872
- isOpen: f,
1873
- onOutsideClick: d,
1874
- placement: o,
1875
- container: l,
1876
- preserve: u,
1877
- content: /* @__PURE__ */ jsxRuntimeExports.jsx(Menu.Content, { children: i }),
1878
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonIcon, { ref: t, as: r, onClick: h, ...c })
1879
- }
1880
- );
1881
- }
1882
- ), ButtonMenuIcon = Object.assign(ButtonMenuIconRoot, {
1883
- Item: Menu.Item
1884
- }), buttonFloatVariants = cva(
1885
- [
1886
- "inline-flex items-center justify-center gap-2",
1887
- "rounded-lg",
1888
- "font-medium",
1889
- "transition-all",
1890
- "duration-200",
1891
- "focus-visible:outline-none",
1892
- "focus-visible:ring-2",
1893
- "focus-visible:ring-offset-2",
1894
- "disabled:opacity-50",
1895
- "disabled:pointer-events-none",
1896
- "select-none",
1897
- "shadow-lg",
1898
- "transition-transform",
1899
- "transition-shadow",
1900
- "will-change-transform,opacity,box-shadow",
1901
- "hover:scale-105",
1902
- "active:scale-95",
1903
- "focus-visible:shadow-xl",
1904
- "hover:shadow-xl",
1905
- "active:shadow-md"
1906
- ].join(" "),
1907
- {
1908
- variants: {
1909
- variant: {
1910
- primary: "bg-primary text-white hover:bg-primary/90 focus-visible:ring-primary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
1911
- secondary: "bg-secondary text-white hover:bg-secondary/90 focus-visible:ring-secondary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
1912
- tertiary: "bg-tertiary text-white hover:bg-tertiary/90 focus-visible:ring-tertiary-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
1913
- ghost: "bg-white text-foreground hover:bg-ghost-soft focus-visible:ring-ghost-light focus-visible:ring-offset-white",
1914
- neutral: "bg-neutral text-foreground border border-border hover:bg-neutral/80 focus-visible:ring-foreground-light focus-visible:ring-offset-white shadow-sm",
1915
- "primary-outline": "border border-primary text-primary bg-white hover:bg-primary hover:text-white focus-visible:ring-primary-light focus-visible:ring-offset-white transition-all",
1916
- "secondary-outline": "border border-secondary text-secondary bg-white hover:bg-secondary hover:text-white focus-visible:ring-secondary-light focus-visible:ring-offset-white transition-all",
1917
- "tertiary-outline": "border border-tertiary text-tertiary bg-white hover:bg-tertiary hover:text-white focus-visible:ring-tertiary-light focus-visible:ring-offset-white transition-all",
1918
- "ghost-outline": "border border-ghost text-ghost bg-white hover:bg-ghost hover:text-white focus-visible:ring-ghost-light focus-visible:ring-offset-white transition-all",
1919
- "neutral-outline": "border border-border text-foreground bg-white hover:bg-neutral hover:text-foreground focus-visible:ring-foreground-light focus-visible:ring-offset-white transition-all",
1920
- "primary-ghost": "text-primary bg-white hover:bg-primary/20 focus-visible:ring-primary focus-visible:ring-offset-white",
1921
- "secondary-ghost": "text-secondary bg-white hover:bg-secondary/20 focus-visible:ring-secondary focus-visible:ring-offset-white",
1922
- "tertiary-ghost": "text-tertiary bg-white hover:bg-tertiary/20 focus-visible:ring-tertiary focus-visible:ring-offset-white",
1923
- "neutral-ghost": "text-foreground bg-white hover:bg-neutral/50 focus-visible:ring-foreground focus-visible:ring-offset-white",
1924
- success: "bg-success text-white hover:bg-success/90 focus-visible:ring-success-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
1925
- "success-outline": "border border-success text-success bg-white hover:bg-success hover:text-white focus-visible:ring-success-light focus-visible:ring-offset-white transition-all",
1926
- "success-ghost": "text-success bg-white hover:bg-success/20 focus-visible:ring-success-light focus-visible:ring-offset-white",
1927
- info: "bg-info text-white hover:bg-info/90 focus-visible:ring-info-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
1928
- "info-outline": "border border-info text-info bg-white hover:bg-info hover:text-white focus-visible:ring-info-light focus-visible:ring-offset-white transition-all",
1929
- "info-ghost": "text-info bg-white hover:bg-info/20 focus-visible:ring-info-light focus-visible:ring-offset-white",
1930
- warning: "bg-warning text-white hover:bg-warning/90 focus-visible:ring-warning-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
1931
- "warning-outline": "border border-warning text-warning bg-white hover:bg-warning hover:text-white focus-visible:ring-warning-light focus-visible:ring-offset-white transition-all",
1932
- "warning-ghost": "text-warning bg-white hover:bg-warning/20 focus-visible:ring-warning-light focus-visible:ring-offset-white",
1933
- danger: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-light focus-visible:ring-offset-white shadow-sm hover:shadow-md",
1934
- "danger-outline": "border border-danger text-danger bg-white hover:bg-danger hover:text-white focus-visible:ring-danger-light focus-visible:ring-offset-white transition-all",
1935
- "danger-ghost": "text-danger bg-white hover:bg-danger/20 focus-visible:ring-danger-light focus-visible:ring-offset-white",
1936
- outline: "border border-border text-foreground bg-white hover:bg-accent-soft focus-visible:ring-accent-soft focus-visible:ring-offset-white transition-all",
1937
- destructive: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md"
1938
- },
1939
- size: {
1940
- sm: "h-12 w-12 min-w-12 min-h-12 text-base",
1941
- md: "h-14 w-14 min-w-14 min-h-14 text-lg",
1942
- lg: "h-16 w-16 min-w-16 min-h-16 text-xl"
1943
- }
1944
- },
1945
- defaultVariants: {
1946
- variant: "primary",
1947
- size: "md"
1948
- }
1949
- }
1950
- );
1951
- function useFloatingPosition(e, t = "1rem") {
1952
- const r = useRef(null), [i, s] = useState({}), [n, o] = useState("fixed bottom-4 right-4"), l = useCallback(() => {
1953
- const c = r.current;
1954
- if (!c) return;
1955
- const a = c.getBoundingClientRect().height > window.innerHeight;
1956
- let d = {}, h = "";
1957
- a ? (d = {
1958
- position: "fixed",
1959
- bottom: t,
1960
- zIndex: 50,
1961
- transform: `translateY(${c.scrollTop}px)`
1962
- }, h = `fixed bottom-4 ${e}-4`) : (d = {
1963
- position: "fixed",
1964
- bottom: t,
1965
- zIndex: 50
1966
- }, h = `fixed bottom-4 ${e}-4`), s(d), o(h);
1967
- }, [e, t]);
1968
- return useEffect(() => {
1969
- l();
1970
- const c = r.current;
1971
- return c && c.addEventListener("scroll", l), window.addEventListener("resize", l), () => {
1972
- c && c.removeEventListener("scroll", l), window.removeEventListener("resize", l);
1973
- };
1974
- }, [l]), useEffect(() => {
1975
- r.current && l();
1976
- }, [e, t, l]), [useCallback(
1977
- (c) => {
1978
- r.current = c, c && l();
1979
- },
1980
- [l]
1981
- ), i, n];
1982
- }
1983
- const ButtonFloat = forwardRef(
1984
- function({
1985
- className: t,
1986
- variant: r = "primary",
1987
- size: i = "md",
1988
- side: s = "right",
1989
- offset: n = "1rem",
1990
- ...o
1991
- }, l) {
1992
- const [u, c, f] = useFloatingPosition(
1993
- s,
1994
- n
1995
- ), [a, d] = useState(!1);
1996
- return useEffect(() => {
1997
- d(!0);
1998
- }, []), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: u, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1999
- "button",
2000
- {
2001
- ref: l,
2002
- type: o.type || "button",
2003
- className: cn(
2004
- buttonFloatVariants({ variant: r, size: i }),
2005
- f,
2006
- a && "animate-fab-in",
2007
- t
2008
- ),
2009
- style: c,
2010
- ...o
2011
- }
2012
- ) });
2013
- }
2014
- ), calculatorRootVariants = cva(
2015
- "flex flex-col w-full max-w-xs rounded-lg bg-background",
2016
- {
2017
- variants: {
2018
- disabled: {
2019
- true: "opacity-60 pointer-events-none",
2020
- false: ""
2021
- }
2022
- },
2023
- defaultVariants: {
2024
- disabled: !1
2025
- }
2026
- }
2027
- ), calculatorButtonVariants = cva(
2028
- "flex-1 min-w-0 h-12 m-0.5 rounded text-lg font-medium transition-colors select-none",
2029
- {
2030
- variants: {
2031
- variant: {
2032
- default: "bg-neutral text-foreground hover:bg-neutral-soft hover:text-neutral",
2033
- action: "bg-primary text-white hover:bg-primary-soft hover:text-primary",
2034
- operator: "bg-secondary text-white hover:bg-secondary-soft hover:text-secondary",
2035
- danger: "bg-danger text-white hover:bg-danger-soft hover:text-danger"
2036
- },
2037
- disabled: {
2038
- true: "opacity-50 pointer-events-none",
2039
- false: ""
2040
- }
2041
- },
2042
- defaultVariants: {
2043
- variant: "default",
2044
- disabled: !1
2045
- }
2046
- }
2047
- ), CalculatorButton = forwardRef(({ variant: e = "default", className: t, ...r }, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(
2048
- "button",
2049
- {
2050
- ref: i,
2051
- type: "button",
2052
- className: cn(
2053
- calculatorButtonVariants({ variant: e, disabled: r.disabled }),
2054
- t
2055
- ),
2056
- ...r
2057
- }
2058
- ));
2059
- function useCalculator({
2060
- initialValue = "",
2061
- disabled,
2062
- onChange
2063
- }) {
2064
- const [input, setInput] = useState(String(initialValue)), inputRef = useRef(null);
2065
- useEffect(() => {
2066
- setInput(String(initialValue));
2067
- }, [initialValue]);
2068
- const evaluate = useCallback((expr) => {
2069
- try {
2070
- if (!/^[-+*/.\d\s]+$/.test(expr)) return "";
2071
- const result = eval(expr);
2072
- return result?.toString() ?? "";
2073
- } catch {
2074
- return "";
2075
- }
2076
- }, []), handleButton = useCallback(
2077
- (e) => {
2078
- if (!disabled)
2079
- if (e === "C")
2080
- setInput("");
2081
- else if (e === "⌫")
2082
- setInput((t) => t.slice(0, -1));
2083
- else if (e === "=") {
2084
- const t = evaluate(input);
2085
- setInput(t);
2086
- } else
2087
- setInput((t) => t + e);
2088
- },
2089
- [disabled, input, evaluate]
2090
- );
2091
- useEffect(() => {
2092
- if (onChange) {
2093
- const e = evaluate(input);
2094
- onChange(e);
2095
- }
2096
- }, [evaluate, input, onChange]), useEffect(() => {
2097
- if (disabled) return;
2098
- const e = (t) => {
2099
- if (document.activeElement !== inputRef.current && document.activeElement?.tagName !== "BODY")
2100
- return;
2101
- const r = t.key;
2102
- r === "Enter" || r === "=" ? (handleButton("="), t.preventDefault()) : r === "Backspace" ? (handleButton("⌫"), t.preventDefault()) : r === "Escape" || r === "C" || r === "c" ? (handleButton("C"), t.preventDefault()) : (/^[0-9]$/.test(r) || ["/", "*", "-", "+", "."].includes(r)) && (handleButton(r), t.preventDefault());
2103
- };
2104
- return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
2105
- }, [handleButton, disabled]), useEffect(() => {
2106
- disabled || inputRef.current?.focus();
2107
- }, [disabled]);
2108
- const handleInput = (e) => {
2109
- const t = e.target.value.replace(/[^\d+\-*/.]/g, "");
2110
- setInput(t);
2111
- };
2112
- return {
2113
- input,
2114
- inputRef,
2115
- handleButton,
2116
- handleInput
2117
- };
2118
- }
2119
- const BUTTONS = [
2120
- ["7", "8", "9", "/"],
2121
- ["4", "5", "6", "*"],
2122
- ["1", "2", "3", "-"],
2123
- ["0", ".", "=", "+"]
2124
- ], Calculator = forwardRef(
2125
- ({
2126
- initialValue: e = "",
2127
- onChange: t,
2128
- disabled: r,
2129
- className: i,
2130
- "aria-label": s
2131
- }, n) => {
2132
- const { input: o, inputRef: l, handleButton: u, handleInput: c } = useCalculator({
2133
- initialValue: e,
2134
- disabled: r,
2135
- onChange: t
2136
- });
2137
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(
2138
- "div",
2139
- {
2140
- ref: n,
2141
- className: cn(calculatorRootVariants({ disabled: r }), i),
2142
- "aria-label": s || "Calculator",
2143
- role: "region",
2144
- children: [
2145
- /* @__PURE__ */ jsxRuntimeExports.jsx(
2146
- "input",
2147
- {
2148
- ref: l,
2149
- className: "w-full mb-3 px-3 py-2 rounded border border-[var(--color-neutral)] bg-[var(--color-neutral-soft)] text-right text-xl font-mono focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)]",
2150
- value: o,
2151
- onChange: c,
2152
- disabled: r,
2153
- inputMode: "decimal",
2154
- "aria-label": "Calculator input"
2155
- }
2156
- ),
2157
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1 mb-3", children: BUTTONS.map((f, a) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex w-full", children: f.map((d) => d === "⌫" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
2158
- ButtonIcon,
2159
- {
2160
- as: X,
2161
- variant: "danger-ghost",
2162
- "aria-label": "Backspace",
2163
- size: "md",
2164
- onClick: () => u("⌫"),
2165
- disabled: r
2166
- },
2167
- "backspace"
2168
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
2169
- CalculatorButton,
2170
- {
2171
- variant: d === "=" ? "action" : d === "C" ? "danger" : ["/", "*", "-", "+", "/"].includes(d) ? "operator" : "default",
2172
- onClick: () => u(d),
2173
- disabled: r,
2174
- "aria-label": d,
2175
- children: d
2176
- },
2177
- d
2178
- )) }, a)) })
2179
- ]
2180
- }
2181
- );
2182
- }
2183
- );
2184
- Calculator.displayName = "Calculator";
2185
- const cardVariants = cva(
2186
- "flex justify-between transition-colors duration-200 w-full",
2187
- {
2188
- variants: {
2189
- size: {
2190
- none: "p-0",
2191
- xs: "p-2 sm:p-2",
2192
- sm: "p-2 sm:p-3",
2193
- md: "p-3 sm:p-4",
2194
- lg: "p-4 sm:p-6",
2195
- xl: "p-6 sm:p-8"
2196
- },
2197
- shape: {
2198
- rounded: "rounded-lg",
2199
- square: "rounded-none"
2200
- },
2201
- bordered: {
2202
- true: "border border-border",
2203
- false: ""
2204
- },
2205
- as: {
2206
- button: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-light hover:bg-gray-50 cursor-pointer",
2207
- div: ""
2208
- }
2209
- },
2210
- defaultVariants: {
2211
- size: "md",
2212
- shape: "rounded",
2213
- bordered: !1,
2214
- as: "button"
2215
- }
2216
- }
2217
- ), CardList = forwardRef(
2218
- ({ children: e }, t) => /* @__PURE__ */ jsxRuntimeExports.jsx(
2219
- "ul",
2220
- {
2221
- ref: t,
2222
- className: "flex flex-wrap items-center min-w-0 overflow-hidden w-full gap-x-0",
2223
- children: e
2224
- }
2225
- )
2226
- ), CardListItem = forwardRef(
2227
- ({ children: e }, t) => /* @__PURE__ */ jsxRuntimeExports.jsx(
2228
- "li",
2229
- {
2230
- ref: t,
2231
- className: "flex items-center min-w-0 flex-shrink-0 after:content-[''] after:inline-block after:mx-1.5 @sm/card:after:mx-2 after:w-1 after:h-1 after:rounded-full after:bg-ghost last:after:hidden after:flex-shrink-0",
2232
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "sm", color: "gray", ellipsis: !0, clamp: 1, children: e })
2233
- }
2234
- )
2235
- ), CardRoot = forwardRef(
2236
- ({
2237
- size: e = "md",
2238
- shape: t = "rounded",
2239
- avatar: r,
2240
- title: i,
2241
- subtitle: s,
2242
- badge: n,
2243
- supplementaryInfo: o,
2244
- bordered: l = !1,
2245
- as: u = "button",
2246
- className: c,
2247
- ...f
2248
- }, a) => /* @__PURE__ */ jsxRuntimeExports.jsx(
2249
- u,
2250
- {
2251
- ref: a,
2252
- className: cn(
2253
- cardVariants({ size: e, shape: t, bordered: l, as: u }),
2254
- c,
2255
- "@container/card"
2256
- ),
2257
- ...f,
2258
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-3 @sm/card:gap-4 w-full", children: [
2259
- r && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-shrink-0", children: r }),
2260
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full min-w-0", children: [
2261
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-start justify-between gap-2", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 min-w-0", children: [
2262
- /* @__PURE__ */ jsxRuntimeExports.jsx(
2263
- Text,
2264
- {
2265
- as: "h3",
2266
- fontSize: "base",
2267
- fontWeight: "semibold",
2268
- className: "break-words leading-tight",
2269
- children: i
2270
- }
2271
- ),
2272
- s && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1", children: typeof s == "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "p", fontSize: "sm", color: "gray", children: s }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-w-0 overflow-hidden", children: s }) })
2273
- ] }) }) }),
2274
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-2 @sm/card:flex-row @sm/card:justify-between @sm/card:items-center", children: [
2275
- n && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "order-1 @sm/card:order-none overflow-hidden", children: n }),
2276
- o && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-shrink-0 order-2 @sm/card:order-none @sm/card:ml-auto", children: typeof o == "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
2277
- Text,
2278
- {
2279
- as: "p",
2280
- fontSize: "sm",
2281
- color: "gray",
2282
- className: "truncate",
2283
- align: "right",
2284
- children: o
2285
- }
2286
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "overflow-hidden", children: o }) })
2287
- ] })
2288
- ] })
2289
- ] })
2290
- }
2291
- )
2292
- ), Card = Object.assign(CardRoot, {
2293
- List: CardList,
2294
- ListItem: CardListItem
2295
- }), filterChipVariants = cva(
2296
- "inline-flex items-center gap-1.5 rounded-full font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none select-none cursor-pointer text-sm leading-none",
2297
- {
2298
- variants: {
2299
- variant: {
2300
- // Core variants using Versaur color system
2301
- primary: "bg-primary-light text-primary hover:bg-primary-soft focus-visible:ring-primary-light focus-visible:ring-offset-white",
2302
- secondary: "bg-secondary-light text-secondary hover:bg-secondary-soft focus-visible:ring-secondary-light focus-visible:ring-offset-white",
2303
- tertiary: "bg-tertiary-light text-tertiary hover:bg-tertiary-soft focus-visible:ring-tertiary-light focus-visible:ring-offset-white",
2304
- ghost: "bg-white text-foreground hover:bg-ghost-soft focus-visible:ring-ghost-light focus-visible:ring-offset-white",
2305
- neutral: "bg-neutral text-foreground hover:bg-neutral/80 focus-visible:ring-foreground-light focus-visible:ring-offset-white",
2306
- // Outline variants
2307
- "primary-outline": "border border-primary text-primary bg-white hover:bg-primary-soft focus-visible:ring-primary-light focus-visible:ring-offset-white",
2308
- "secondary-outline": "border border-secondary text-secondary bg-white hover:bg-secondary-soft focus-visible:ring-secondary-light focus-visible:ring-offset-white",
2309
- "tertiary-outline": "border border-tertiary text-tertiary bg-white hover:bg-tertiary-soft focus-visible:ring-tertiary-light focus-visible:ring-offset-white",
2310
- "ghost-outline": "border border-ghost text-ghost bg-white hover:bg-ghost-soft focus-visible:ring-ghost-light focus-visible:ring-offset-white",
2311
- "neutral-outline": "border border-border text-foreground bg-white hover:bg-neutral focus-visible:ring-foreground-light focus-visible:ring-offset-white",
2312
- // Semantic variants
2313
- success: "bg-success text-white hover:bg-success/90 focus-visible:ring-success-light focus-visible:ring-offset-white",
2314
- "success-outline": "border border-success text-success bg-white hover:bg-success-soft focus-visible:ring-success-light focus-visible:ring-offset-white",
2315
- info: "bg-info text-white hover:bg-info/90 focus-visible:ring-info-light focus-visible:ring-offset-white",
2316
- "info-outline": "border border-info text-info bg-white hover:bg-info-soft focus-visible:ring-info-light focus-visible:ring-offset-white",
2317
- warning: "bg-warning text-white hover:bg-warning/90 focus-visible:ring-warning-light focus-visible:ring-offset-white",
2318
- "warning-outline": "border border-warning text-warning bg-white hover:bg-warning-soft focus-visible:ring-warning-light focus-visible:ring-offset-white",
2319
- danger: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-light focus-visible:ring-offset-white",
2320
- "danger-outline": "border border-danger text-danger bg-white hover:bg-danger-soft focus-visible:ring-danger-light focus-visible:ring-offset-white"
2321
- },
2322
- size: {
2323
- sm: "h-7 px-3 text-xs",
2324
- md: "h-8 px-4 text-sm",
2325
- lg: "h-9 px-5 text-sm"
2326
- }
2327
- },
2328
- defaultVariants: {
2329
- variant: "neutral-outline",
2330
- size: "md"
2331
- }
2332
- }
2333
- ), FilterChip = React__default.forwardRef(
2334
- function e({
2335
- className: t,
2336
- variant: r = "neutral-outline",
2337
- size: i = "md",
2338
- disabled: s = !1,
2339
- children: n,
2340
- ...o
2341
- }, l) {
2342
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(
2343
- "button",
2344
- {
2345
- ref: l,
2346
- type: "button",
2347
- className: cn(filterChipVariants({ variant: r, size: i }), t),
2348
- disabled: s,
2349
- "aria-disabled": s,
2350
- "aria-label": `${n}, removable`,
2351
- inert: s ? !0 : void 0,
2352
- ...o,
2353
- children: [
2354
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex-shrink-0", children: n }),
2355
- /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { as: XIcon, color: "inherit", size: i === "lg" ? "md" : "sm" })
2356
- ]
2357
- }
2358
- );
2359
- }
2360
- ), hrVariants = cva("h-px w-full bg-border border-0", {
2361
- variants: {
2362
- hasMargin: {
2363
- true: "mb-4",
2364
- false: ""
2365
- }
2366
- },
2367
- defaultVariants: {
2368
- hasMargin: !1
2369
- }
2370
- }), Hr = forwardRef(
2371
- ({ hasMargin: e = !1, className: t, ...r }, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(
2372
- "hr",
2373
- {
2374
- ref: i,
2375
- className: cn(hrVariants({ hasMargin: e }), t),
2376
- ...r
2377
- }
2378
- )
2379
- ), noResultsVariants = cva(
2380
- "flex flex-col items-center justify-center text-center border border-border rounded-lg bg-background",
2381
- {
2382
- variants: {
2383
- spacing: {
2384
- sm: "py-8 px-4",
2385
- md: "py-12 px-6",
2386
- lg: "py-16 px-8"
2387
- },
2388
- hasGrayBackground: {
2389
- true: "bg-neutral-soft",
2390
- false: ""
2391
- }
2392
- },
2393
- defaultVariants: {
2394
- spacing: "md",
2395
- hasGrayBackground: !1
2396
- }
2397
- }
2398
- ), noResultsHeaderVariants = cva(
2399
- "flex flex-row items-center gap-3 mb-2"
2400
- ), NoResults = React__default.forwardRef(
2401
- function e({ icon: t, title: r, subtitle: i, action: s, className: n, hasGrayBackground: o, ...l }, u) {
2402
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(
2403
- "section",
2404
- {
2405
- ref: u,
2406
- className: cn(noResultsVariants({ hasGrayBackground: o }), n),
2407
- role: "status",
2408
- "aria-label": "No results found",
2409
- ...l,
2410
- children: [
2411
- /* @__PURE__ */ jsxRuntimeExports.jsxs("header", { className: noResultsHeaderVariants(), children: [
2412
- /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { as: t, size: "lg", color: "ghost", "aria-hidden": "true" }),
2413
- /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "h2", fontSize: "lg", children: r })
2414
- ] }),
2415
- i && /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "p", align: "center", color: "gray", className: "mb-4", children: i }),
2416
- s && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { role: "group", "aria-label": "Available actions", children: s })
2417
- ]
2418
- }
2419
- );
2420
- }
2421
- ), TableContext = createContext(null), TableProvider = TableContext.Provider;
2422
- function useTableContext() {
2423
- const e = useContext(TableContext);
2424
- if (!e)
2425
- throw new Error("Table compound components must be used within <Table>");
2426
- return e;
2427
- }
2428
- const getTableColumnClass = (e) => {
2429
- if (e < 1 || e > 12)
2430
- throw new Error("Column span must be between 1 and 12");
2431
- switch (e) {
2432
- case 1:
2433
- return "grid-cols-1";
2434
- case 2:
2435
- return "grid-cols-2";
2436
- case 3:
2437
- return "grid-cols-3";
2438
- case 4:
2439
- return "grid-cols-4";
2440
- case 5:
2441
- return "grid-cols-5";
2442
- case 6:
2443
- return "grid-cols-6";
2444
- case 7:
2445
- return "grid-cols-7";
2446
- case 8:
2447
- return "grid-cols-8";
2448
- case 9:
2449
- return "grid-cols-9";
2450
- case 10:
2451
- return "grid-cols-10";
2452
- case 11:
2453
- return "grid-cols-11";
2454
- case 12:
2455
- return "grid-cols-12";
2456
- default:
2457
- return "grid-cols-2";
2458
- }
2459
- }, getRowSpanClass = (e) => {
2460
- if (e < 1 || e > 12)
2461
- throw new Error("Column span must be between 1 and 12");
2462
- switch (e) {
2463
- case 1:
2464
- return "col-span-1";
2465
- case 2:
2466
- return "col-span-2";
2467
- case 3:
2468
- return "col-span-3";
2469
- case 4:
2470
- return "col-span-4";
2471
- case 5:
2472
- return "col-span-5";
2473
- case 6:
2474
- return "col-span-6";
2475
- case 7:
2476
- return "col-span-7";
2477
- case 8:
2478
- return "col-span-8";
2479
- case 9:
2480
- return "col-span-9";
2481
- case 10:
2482
- return "col-span-10";
2483
- case 11:
2484
- return "col-span-11";
2485
- case 12:
2486
- return "col-span-12";
2487
- default:
2488
- return "col-span-2";
2489
- }
2490
- }, TableHeader = forwardRef(
2491
- ({ children: e, className: t, ...r }, i) => {
2492
- const { columns: s } = useTableContext();
2493
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
2494
- "div",
2495
- {
2496
- role: "rowgroup",
2497
- className: cn("bg-neutral-soft", t),
2498
- ...r,
2499
- ref: i,
2500
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
2501
- "div",
2502
- {
2503
- role: "row",
2504
- className: cn("grid gap-4", getTableColumnClass(s)),
2505
- children: e
2506
- }
2507
- )
2508
- }
2509
- );
2510
- }
2511
- ), TableBody = forwardRef(
2512
- ({ children: e, className: t, ...r }, i) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { role: "rowgroup", ref: i, className: cn(t), ...r, children: e })
2513
- ), TableFooter = forwardRef(
2514
- ({ children: e, className: t, ...r }, i) => {
2515
- const { columns: s } = useTableContext();
2516
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
2517
- "div",
2518
- {
2519
- role: "rowgroup",
2520
- className: cn("bg-neutral-soft", t),
2521
- ...r,
2522
- ref: i,
2523
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
2524
- "div",
2525
- {
2526
- role: "row",
2527
- className: cn("grid gap-4", getTableColumnClass(s)),
2528
- children: e
2529
- }
2530
- )
2531
- }
2532
- );
2533
- }
2534
- ), TableRow = forwardRef(
2535
- ({ children: e, className: t, ...r }, i) => {
2536
- const { columns: s } = useTableContext();
2537
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
2538
- "div",
2539
- {
2540
- role: "row",
2541
- className: cn(
2542
- "grid gap-4",
2543
- getTableColumnClass(s),
2544
- "border-b border-border last:border-0",
2545
- t
2546
- ),
2547
- ref: i,
2548
- ...r,
2549
- children: e
2550
- }
2551
- );
2552
- }
2553
- ), TableColumn = forwardRef(
2554
- ({ as: e = "td", span: t, align: r = "left", children: i, className: s, ...n }, o) => {
2555
- const l = e === "th" ? "columnheader" : "cell";
2556
- let u = "text-left";
2557
- return r === "center" ? u = "text-center" : r === "right" && (u = "text-right"), /* @__PURE__ */ jsxRuntimeExports.jsx(
2558
- "div",
2559
- {
2560
- ref: o,
2561
- role: l,
2562
- className: cn(
2563
- "px-4 py-2",
2564
- "[&:not(:last-child)]:border-r [&:not(:last-child)]:border-border",
2565
- getRowSpanClass(t),
2566
- u,
2567
- "truncate overflow-hidden whitespace-nowrap",
2568
- s
2569
- ),
2570
- ...n,
2571
- children: i
2572
- }
2573
- );
2574
- }
2575
- ), TableRowItem = forwardRef(
2576
- (e, t) => /* @__PURE__ */ jsxRuntimeExports.jsx(
2577
- TableColumn,
2578
- {
2579
- ...e,
2580
- as: "td",
2581
- ref: t,
2582
- className: cn(
2583
- "truncate overflow-hidden whitespace-nowrap",
2584
- e.className
2585
- )
2586
- }
2587
- )
2588
- ), TableHeaderItem = forwardRef(
2589
- (e, t) => /* @__PURE__ */ jsxRuntimeExports.jsx(
2590
- TableColumn,
2591
- {
2592
- ...e,
2593
- as: "th",
2594
- ref: t,
2595
- className: cn(
2596
- "truncate overflow-hidden whitespace-nowrap",
2597
- e.className
2598
- )
2599
- }
2600
- )
2601
- ), TableRoot = forwardRef(
2602
- ({ children: e, className: t, columns: r = 12, ...i }, s) => /* @__PURE__ */ jsxRuntimeExports.jsx(TableProvider, { value: { columns: r }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
2603
- "div",
2604
- {
2605
- ref: s,
2606
- role: "table",
2607
- className: cn(
2608
- // Versaur design system: border, background, shadow, rounded, spacing
2609
- "w-full overflow-x-auto border border-border bg-background rounded-lg ",
2610
- "text-foreground",
2611
- "sm:rounded-xl",
2612
- "transition-colors",
2613
- t
2614
- ),
2615
- ...i,
2616
- children: e
2617
- }
2618
- ) })
2619
- ), Table = Object.assign(TableRoot, {
2620
- Header: TableHeader,
2621
- HeaderItem: TableHeaderItem,
2622
- Body: TableBody,
2623
- Footer: TableFooter,
2624
- Row: TableRow,
2625
- RowItem: TableRowItem
2626
- }), tileVariants = cva(
2627
- // Base classes
2628
- "block transition-colors duration-200",
2629
- {
2630
- variants: {
2631
- variant: {
2632
- white: "bg-white border border-border",
2633
- neutral: "bg-neutral border border-gray-200",
2634
- primary: "bg-primary-soft border border-primary",
2635
- secondary: "bg-secondary-soft border border-secondary",
2636
- tertiary: "bg-tertiary-soft border border-tertiary",
2637
- ghost: "bg-transparent border border-ghost",
2638
- success: "bg-success-soft border border-success",
2639
- info: "bg-info-soft border border-info",
2640
- warning: "bg-warning-soft border border-warning",
2641
- danger: "bg-danger-soft border border-danger"
2642
- },
2643
- size: {
2644
- xs: "p-2",
2645
- sm: "p-3",
2646
- md: "p-4",
2647
- lg: "p-6",
2648
- xl: "p-8"
2649
- },
2650
- shape: {
2651
- rounded: "rounded-lg",
2652
- square: "rounded-none"
2653
- }
2654
- },
2655
- defaultVariants: {
2656
- variant: "white",
2657
- size: "md",
2658
- shape: "rounded"
2659
- }
2660
- }
2661
- ), Tile = forwardRef(
2662
- ({ variant: e = "white", size: t = "md", shape: r = "rounded", className: i, ...s }, n) => /* @__PURE__ */ jsxRuntimeExports.jsx(
2663
- "div",
2664
- {
2665
- ref: n,
2666
- className: cn(tileVariants({ variant: e, size: t, shape: r }), i),
2667
- ...s
2668
- }
2669
- )
2670
- );
2671
- function useImage({ src: e }) {
2672
- const [t, r] = useState(!1), [i, s] = useState(!1), n = useRef(!1), o = () => {
2673
- r(!0);
2674
- }, l = () => {
2675
- s(!0);
2676
- };
2677
- return useEffect(() => {
2678
- if (!e) return;
2679
- const u = new Image();
2680
- return u.src = e, u.onload = () => {
2681
- n.current || r(!0);
2682
- }, u.onerror = () => {
2683
- n.current || s(!0);
2684
- }, () => {
2685
- n.current = !0;
2686
- };
2687
- }, [e]), {
2688
- loaded: t,
2689
- errored: i,
2690
- handleLoad: o,
2691
- handleError: l
2692
- };
2693
- }
2694
- const imageVariants = cva("block object-cover", {
2695
- variants: {
2696
- position: {
2697
- cover: "object-cover",
2698
- contain: "object-contain",
2699
- center: "object-center",
2700
- top: "object-top",
2701
- bottom: "object-bottom",
2702
- left: "object-left",
2703
- right: "object-right",
2704
- none: ""
2705
- },
2706
- size: {
2707
- sm: "w-16 h-16",
2708
- md: "w-32 h-32",
2709
- lg: "w-48 h-48",
2710
- full: "w-full h-full",
2711
- auto: ""
2712
- },
2713
- shape: {
2714
- rectangle: "rounded",
2715
- square: "aspect-square rounded",
2716
- circle: "rounded-full aspect-square"
2717
- }
2718
- },
2719
- defaultVariants: {
2720
- position: "cover",
2721
- size: "auto",
2722
- shape: "rectangle"
2723
- }
2724
- }), imageAtomVariants = cva(
2725
- "flex items-center justify-center bg-neutral-soft text-ghost border border-border",
2726
- {
2727
- variants: {
2728
- shape: {
2729
- rectangle: "rounded",
2730
- square: "aspect-square rounded",
2731
- circle: "rounded-full aspect-square"
2732
- },
2733
- size: {
2734
- sm: "w-16 h-16",
2735
- md: "w-32 h-32",
2736
- lg: "w-48 h-48",
2737
- full: "w-full h-full",
2738
- auto: "w-full h-full"
2739
- }
2740
- },
2741
- defaultVariants: {
2742
- shape: "rectangle",
2743
- size: "auto"
2744
- }
2745
- }
2746
- );
2747
- function BaseImageSkeleton({
2748
- className: e,
2749
- shape: t,
2750
- size: r,
2751
- height: i,
2752
- width: s
2753
- }) {
2754
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
2755
- Skeleton,
2756
- {
2757
- className: cn(imageAtomVariants({ shape: t, size: r }), e),
2758
- style: { height: i, width: s }
2759
- }
2760
- );
2761
- }
2762
- function BaseImageFallback({
2763
- alt: e,
2764
- width: t,
2765
- height: r,
2766
- className: i,
2767
- style: s,
2768
- shape: n,
2769
- size: o
2770
- }) {
2771
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(
2772
- "div",
2773
- {
2774
- className: imageAtomVariants({ shape: n, size: o, className: i }),
2775
- style: { width: t, height: r, ...s },
2776
- "aria-label": e,
2777
- role: "img",
2778
- children: [
2779
- /* @__PURE__ */ jsxRuntimeExports.jsx(
2780
- ImageOff,
2781
- {
2782
- size: 32,
2783
- style: { opacity: 0.5, marginRight: 4 },
2784
- "aria-hidden": "true"
2785
- }
2786
- ),
2787
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { opacity: 0.7 }, children: e })
2788
- ]
2789
- }
2790
- );
2791
- }
2792
- const BaseImage = forwardRef(
2793
- ({
2794
- src: e,
2795
- alt: t,
2796
- onLoad: r,
2797
- onError: i,
2798
- width: s,
2799
- height: n,
2800
- loading: o = "lazy",
2801
- position: l = "cover",
2802
- size: u = "auto",
2803
- shape: c,
2804
- className: f,
2805
- ...a
2806
- }, d) => {
2807
- const { loaded: h, errored: x, handleLoad: y, handleError: w } = useImage({
2808
- src: e
2809
- }), j = typeof s == "number" ? s : Number(s), E = typeof n == "number" ? n : Number(n);
2810
- return !h && !x ? /* @__PURE__ */ jsxRuntimeExports.jsx(
2811
- BaseImageSkeleton,
2812
- {
2813
- shape: c,
2814
- width: j,
2815
- height: E
2816
- }
2817
- ) : x ? /* @__PURE__ */ jsxRuntimeExports.jsx(
2818
- BaseImageFallback,
2819
- {
2820
- shape: c,
2821
- alt: t,
2822
- width: j,
2823
- height: E
2824
- }
2825
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
2826
- "img",
2827
- {
2828
- ref: d,
2829
- src: e,
2830
- alt: t,
2831
- width: j,
2832
- height: E,
2833
- loading: o,
2834
- className: cn(
2835
- imageVariants({
2836
- position: l,
2837
- size: u,
2838
- shape: c
2839
- }),
2840
- f
2841
- ),
2842
- onLoad: (C) => {
2843
- y(), r?.(C);
2844
- },
2845
- onError: (C) => {
2846
- w(), i?.(C);
2847
- },
2848
- ...a
2849
- }
2850
- );
2851
- }
2852
- ), ImageCircle = forwardRef((e, t) => /* @__PURE__ */ jsxRuntimeExports.jsx(BaseImage, { ref: t, ...e, shape: "circle" })), ImageSquare = forwardRef((e, t) => /* @__PURE__ */ jsxRuntimeExports.jsx(BaseImage, { ref: t, ...e, shape: "square" })), ImageRectangle = forwardRef((e, t) => /* @__PURE__ */ jsxRuntimeExports.jsx(BaseImage, { ref: t, ...e, shape: "rectangle" }));
2853
- export {
2854
- Accordion as A,
2855
- Badge as B,
2856
- Calculator as C,
2857
- FilterChip as F,
2858
- Heading as H,
2859
- Icon as I,
2860
- Menu as M,
2861
- NoResults as N,
2862
- OverlayPortal as O,
2863
- Table as T,
2864
- ActionCard as a,
2865
- Alert as b,
2866
- Anchor as c,
2867
- Attribute as d,
2868
- AttributeList as e,
2869
- Avatar as f,
2870
- Brand as g,
2871
- Button as h,
2872
- ButtonMenu as i,
2873
- ButtonMenuIcon as j,
2874
- ButtonFloat as k,
2875
- ButtonIcon as l,
2876
- Card as m,
2877
- Hr as n,
2878
- Text as o,
2879
- Tile as p,
2880
- ImageCircle as q,
2881
- ImageSquare as r,
2882
- ImageRectangle as s,
2883
- BaseImage as t
2884
- };