@dimasbaguspm/versaur 0.0.16 → 0.0.17

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 (58) hide show
  1. package/dist/js/bottom-sheet-CHRSxXRE.js +501 -0
  2. package/dist/js/{switch-input-Bx6_2zG9.js → email-input-CVyrFzqL.js} +592 -807
  3. package/dist/js/enforce-subpath-import.js +5 -2
  4. package/dist/js/feedbacks/index.js +1 -1
  5. package/dist/js/{form-layout-4ASWdXn8.js → form-layout-Dhlv-FZL.js} +1 -1
  6. package/dist/js/forms/index.js +17 -14
  7. package/dist/js/{index-DOdDlCoL.js → index-C1uJQB34.js} +2 -2
  8. package/dist/js/index.js +45 -43
  9. package/dist/js/layouts/index.js +1 -1
  10. package/dist/js/modal-FqewbVts.js +150 -0
  11. package/dist/js/navigation/index.js +1 -1
  12. package/dist/js/overlays/index.js +4 -4
  13. package/dist/js/primitive/index.js +14 -15
  14. package/dist/js/{skeleton-BNZyaRjo.js → skeleton-QEyPZAuF.js} +1 -1
  15. package/dist/js/{tabs-BbOkYchB.js → tabs-DYcTvVao.js} +1 -1
  16. package/dist/js/tile-B9bt2AY6.js +1776 -0
  17. package/dist/types/forms/chip-multiple-input/chip-multiple-input.atoms.d.ts +10 -0
  18. package/dist/types/forms/chip-multiple-input/chip-multiple-input.d.ts +5 -0
  19. package/dist/types/forms/chip-multiple-input/index.d.ts +2 -0
  20. package/dist/types/forms/{chip-input → chip-multiple-input}/types.d.ts +16 -4
  21. package/dist/types/forms/chip-single-input/chip-single-input.atoms.d.ts +10 -0
  22. package/dist/types/forms/chip-single-input/chip-single-input.d.ts +5 -0
  23. package/dist/types/forms/chip-single-input/index.d.ts +1 -0
  24. package/dist/types/forms/chip-single-input/types.d.ts +67 -0
  25. package/dist/types/forms/date-single-picker-input/date-single-picker-input.d.ts +1 -8
  26. package/dist/types/forms/date-single-picker-input/index.d.ts +1 -1
  27. package/dist/types/forms/date-single-picker-input/types.d.ts +12 -66
  28. package/dist/types/forms/email-input/email-input.d.ts +8 -0
  29. package/dist/types/forms/email-input/index.d.ts +2 -0
  30. package/dist/types/forms/email-input/types.d.ts +6 -0
  31. package/dist/types/forms/index.d.ts +5 -1
  32. package/dist/types/forms/price-input/index.d.ts +2 -0
  33. package/dist/types/forms/price-input/price-input.d.ts +6 -0
  34. package/dist/types/forms/price-input/types.d.ts +15 -0
  35. package/dist/types/forms/price-input/use-price-input.d.ts +6 -0
  36. package/dist/types/forms/search-input/index.d.ts +2 -0
  37. package/dist/types/forms/search-input/search-input.d.ts +8 -0
  38. package/dist/types/forms/search-input/types.d.ts +35 -0
  39. package/dist/types/forms/segment-multiple-input/types.d.ts +1 -5
  40. package/dist/types/forms/segment-single-input/types.d.ts +1 -5
  41. package/dist/types/overlays/modal/types.d.ts +1 -1
  42. package/dist/types/primitive/anchor/types.d.ts +8 -2
  43. package/package.json +1 -1
  44. package/dist/js/bottom-sheet-Difan0U1.js +0 -340
  45. package/dist/js/calendar-CUjVZ7Ap.js +0 -811
  46. package/dist/js/menu-Bm-yPIMN.js +0 -310
  47. package/dist/js/tile-BjhJ5Mvl.js +0 -939
  48. package/dist/types/forms/chip-input/chip-input.atoms.d.ts +0 -10
  49. package/dist/types/forms/chip-input/chip-input.d.ts +0 -5
  50. package/dist/types/forms/chip-input/index.d.ts +0 -2
  51. package/dist/types/forms/date-range-picker-input/date-range-picker-input.d.ts +0 -10
  52. package/dist/types/forms/date-range-picker-input/index.d.ts +0 -2
  53. package/dist/types/forms/date-range-picker-input/types.d.ts +0 -64
  54. package/dist/types/forms/date-range-picker-input/use-date-range-picker.d.ts +0 -13
  55. package/dist/types/forms/date-single-picker-input/date-single-picker-input.atoms.d.ts +0 -13
  56. package/dist/types/forms/date-single-picker-input/date-single-picker-input.docked.d.ts +0 -14
  57. package/dist/types/forms/date-single-picker-input/date-single-picker-input.modal.d.ts +0 -15
  58. package/dist/types/forms/date-single-picker-input/use-date-single-picker.d.ts +0 -10
@@ -0,0 +1,1776 @@
1
+ import { a as cva, j as jsxRuntimeExports, c as cn } from "./index-C1uJQB34.js";
2
+ import * as React from "react";
3
+ import React__default, { forwardRef, useState, useRef, useEffect, useCallback, createContext, useContext, useMemo } from "react";
4
+ import { X, ChevronLeft, ChevronRight } from "lucide-react";
5
+ const calculatorRootVariants = cva(
6
+ "flex flex-col w-full max-w-xs rounded-lg bg-background",
7
+ {
8
+ variants: {
9
+ disabled: {
10
+ true: "opacity-60 pointer-events-none",
11
+ false: ""
12
+ }
13
+ },
14
+ defaultVariants: {
15
+ disabled: !1
16
+ }
17
+ }
18
+ ), calculatorButtonVariants = cva(
19
+ "flex-1 min-w-0 h-12 m-0.5 rounded text-lg font-medium transition-colors select-none",
20
+ {
21
+ variants: {
22
+ variant: {
23
+ default: "bg-neutral text-foreground hover:bg-neutral-soft hover:text-neutral",
24
+ action: "bg-primary text-white hover:bg-primary-soft hover:text-primary",
25
+ operator: "bg-secondary text-white hover:bg-secondary-soft hover:text-secondary",
26
+ danger: "bg-danger text-white hover:bg-danger-soft hover:text-danger"
27
+ },
28
+ disabled: {
29
+ true: "opacity-50 pointer-events-none",
30
+ false: ""
31
+ }
32
+ },
33
+ defaultVariants: {
34
+ variant: "default",
35
+ disabled: !1
36
+ }
37
+ }
38
+ ), CalculatorButton = forwardRef(({ variant: e = "default", className: t, ...r }, s) => /* @__PURE__ */ jsxRuntimeExports.jsx(
39
+ "button",
40
+ {
41
+ ref: s,
42
+ type: "button",
43
+ className: cn(
44
+ calculatorButtonVariants({ variant: e, disabled: r.disabled }),
45
+ t
46
+ ),
47
+ ...r
48
+ }
49
+ ));
50
+ function getIconColorFromVariant(e = "primary") {
51
+ const t = e.split("-");
52
+ if (t.length === 1)
53
+ switch (t[0]) {
54
+ case "ghost":
55
+ case "neutral":
56
+ case "outline":
57
+ return "ghost";
58
+ default:
59
+ return "neutral";
60
+ }
61
+ if (t?.[1] === "outline") return "inherit";
62
+ switch (t[0]) {
63
+ case "primary":
64
+ return "primary";
65
+ case "secondary":
66
+ return "secondary";
67
+ case "tertiary":
68
+ return "tertiary";
69
+ case "ghost":
70
+ return "ghost";
71
+ case "neutral":
72
+ return "ghost";
73
+ case "success":
74
+ return "success";
75
+ case "info":
76
+ return "info";
77
+ case "warning":
78
+ return "warning";
79
+ case "danger":
80
+ return "danger";
81
+ default:
82
+ return "neutral";
83
+ }
84
+ }
85
+ const buttonIconVariants = cva(
86
+ "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",
87
+ {
88
+ variants: {
89
+ variant: {
90
+ // Core variants using Versaur color system
91
+ primary: "bg-primary text-white hover:bg-primary/90 focus-visible:ring-primary-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
92
+ secondary: "bg-secondary text-white hover:bg-secondary/90 focus-visible:ring-secondary-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
93
+ tertiary: "bg-tertiary text-white hover:bg-tertiary/90 focus-visible:ring-tertiary-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
94
+ ghost: "bg-white text-foreground hover:bg-ghost-soft focus-visible:ring-ghost-soft focus-visible:ring-offset-white",
95
+ neutral: "bg-neutral text-foreground border border-border hover:bg-neutral/80 focus-visible:ring-foreground-soft focus-visible:ring-offset-white shadow-sm",
96
+ // Outline variants
97
+ "primary-outline": "border border-primary text-primary bg-white hover:bg-primary hover:text-white focus-visible:ring-primary-soft focus-visible:ring-offset-white transition-all",
98
+ "secondary-outline": "border border-secondary text-secondary bg-white hover:bg-secondary hover:text-white focus-visible:ring-secondary-soft focus-visible:ring-offset-white transition-all",
99
+ "tertiary-outline": "border border-tertiary text-tertiary bg-white hover:bg-tertiary hover:text-white focus-visible:ring-tertiary-soft focus-visible:ring-offset-white transition-all",
100
+ "ghost-outline": "border border-ghost text-ghost bg-white hover:bg-ghost hover:text-white focus-visible:ring-ghost-soft focus-visible:ring-offset-white transition-all",
101
+ "neutral-outline": "border border-neutral text-foreground bg-white hover:bg-neutral hover:text-foreground focus-visible:ring-foreground-soft focus-visible:ring-offset-white transition-all",
102
+ // Ghost variants (subtle)
103
+ "primary-ghost": "text-primary bg-white hover:bg-primary-light focus-visible:ring-primary-light focus-visible:ring-offset-white",
104
+ "secondary-ghost": "text-secondary bg-white hover:bg-secondary-light focus-visible:ring-secondary-light focus-visible:ring-offset-white",
105
+ "tertiary-ghost": "text-tertiary bg-white hover:bg-tertiary-light focus-visible:ring-tertiary-light focus-visible:ring-offset-white",
106
+ "neutral-ghost": "text-foreground bg-white hover:bg-neutral-light focus-visible:ring-foreground-light focus-visible:ring-offset-white",
107
+ // Semantic variants
108
+ success: "bg-success text-white hover:bg-success/90 focus-visible:ring-success-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
109
+ "success-outline": "border border-success text-success bg-white hover:bg-success hover:text-white focus-visible:ring-success-soft focus-visible:ring-offset-white transition-all",
110
+ "success-ghost": "text-success bg-white hover:bg-success-light focus-visible:ring-success-light focus-visible:ring-offset-white",
111
+ info: "bg-info text-white hover:bg-info/90 focus-visible:ring-info-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
112
+ "info-outline": "border border-info text-info bg-white hover:bg-info hover:text-white focus-visible:ring-info-soft focus-visible:ring-offset-white transition-all",
113
+ "info-ghost": "text-info bg-white hover:bg-info-light focus-visible:ring-info-light focus-visible:ring-offset-white",
114
+ warning: "bg-warning text-white hover:bg-warning/90 focus-visible:ring-warning-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
115
+ "warning-outline": "border border-warning text-warning bg-white hover:bg-warning hover:text-white focus-visible:ring-warning-soft focus-visible:ring-offset-white transition-all",
116
+ "warning-ghost": "text-warning bg-white hover:bg-warning-light focus-visible:ring-warning-light focus-visible:ring-offset-white",
117
+ danger: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
118
+ "danger-outline": "border border-danger text-danger bg-white hover:bg-danger hover:text-white focus-visible:ring-danger-soft focus-visible:ring-offset-white transition-all",
119
+ "danger-ghost": "text-danger bg-white hover:bg-danger-light focus-visible:ring-danger-light focus-visible:ring-offset-white",
120
+ // Utility variants
121
+ outline: "border border-border text-foreground bg-white hover:bg-accent-soft focus-visible:ring-accent-soft focus-visible:ring-offset-white transition-all",
122
+ destructive: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md"
123
+ },
124
+ size: {
125
+ xs: "h-6 w-6",
126
+ sm: "h-8 w-8",
127
+ md: "h-10 w-10",
128
+ lg: "h-12 w-12",
129
+ xl: "h-14 w-14"
130
+ },
131
+ shape: {
132
+ rounded: "rounded-md",
133
+ square: "rounded-sm",
134
+ circle: "rounded-full"
135
+ }
136
+ },
137
+ defaultVariants: {
138
+ variant: "primary",
139
+ size: "md",
140
+ shape: "rounded"
141
+ }
142
+ }
143
+ ), iconVariants = cva("inline-flex items-center justify-center", {
144
+ variants: {
145
+ size: {
146
+ xs: "w-3 h-3",
147
+ sm: "w-4 h-4",
148
+ md: "w-5 h-5",
149
+ lg: "w-6 h-6",
150
+ xl: "w-8 h-8"
151
+ },
152
+ color: {
153
+ primary: "text-primary",
154
+ secondary: "text-secondary",
155
+ tertiary: "text-tertiary",
156
+ ghost: "text-ghost",
157
+ neutral: "text-neutral",
158
+ success: "text-success",
159
+ info: "text-info",
160
+ warning: "text-warning",
161
+ danger: "text-danger",
162
+ inherit: ""
163
+ }
164
+ },
165
+ defaultVariants: {
166
+ size: "md",
167
+ color: "primary"
168
+ }
169
+ }), Icon = React__default.forwardRef(function({ as: t, color: r = "primary", size: s = "md", className: o, ...n }, a) {
170
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
171
+ t,
172
+ {
173
+ ref: a,
174
+ className: iconVariants({ color: r, size: s, className: o }),
175
+ ...n
176
+ }
177
+ );
178
+ }), ButtonIcon = React__default.forwardRef(
179
+ function({
180
+ className: t,
181
+ variant: r = "primary",
182
+ size: s = "md",
183
+ shape: o = "rounded",
184
+ disabled: n = !1,
185
+ as: a,
186
+ "aria-label": i,
187
+ ...u
188
+ }, c) {
189
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
190
+ "button",
191
+ {
192
+ ref: c,
193
+ type: "button",
194
+ className: cn(
195
+ buttonIconVariants({
196
+ variant: r,
197
+ size: s,
198
+ shape: o
199
+ }),
200
+ t
201
+ ),
202
+ disabled: n,
203
+ "aria-disabled": n,
204
+ "aria-label": i,
205
+ inert: n ? !0 : void 0,
206
+ ...u,
207
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
208
+ Icon,
209
+ {
210
+ as: a,
211
+ size: s,
212
+ color: getIconColorFromVariant(r)
213
+ }
214
+ )
215
+ }
216
+ );
217
+ }
218
+ );
219
+ function useCalculator({
220
+ initialValue = "",
221
+ disabled,
222
+ onChange
223
+ }) {
224
+ const [input, setInput] = useState(String(initialValue)), inputRef = useRef(null);
225
+ useEffect(() => {
226
+ setInput(String(initialValue));
227
+ }, [initialValue]);
228
+ const evaluate = useCallback((expr) => {
229
+ try {
230
+ if (!/^[-+*/.\d\s]+$/.test(expr)) return "";
231
+ const result = eval(expr);
232
+ return result?.toString() ?? "";
233
+ } catch {
234
+ return "";
235
+ }
236
+ }, []), handleButton = useCallback(
237
+ (e) => {
238
+ if (!disabled)
239
+ if (e === "C")
240
+ setInput("");
241
+ else if (e === "⌫")
242
+ setInput((t) => t.slice(0, -1));
243
+ else if (e === "=") {
244
+ const t = evaluate(input);
245
+ setInput(t);
246
+ } else
247
+ setInput((t) => t + e);
248
+ },
249
+ [disabled, input, evaluate]
250
+ );
251
+ useEffect(() => {
252
+ if (onChange) {
253
+ const e = evaluate(input);
254
+ onChange(e);
255
+ }
256
+ }, [evaluate, input, onChange]), useEffect(() => {
257
+ if (disabled) return;
258
+ const e = (t) => {
259
+ if (document.activeElement !== inputRef.current && document.activeElement?.tagName !== "BODY")
260
+ return;
261
+ const r = t.key;
262
+ 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());
263
+ };
264
+ return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
265
+ }, [handleButton, disabled]), useEffect(() => {
266
+ disabled || inputRef.current?.focus();
267
+ }, [disabled]);
268
+ const handleInput = (e) => {
269
+ const t = e.target.value.replace(/[^\d+\-*/.]/g, "");
270
+ setInput(t);
271
+ };
272
+ return {
273
+ input,
274
+ inputRef,
275
+ handleButton,
276
+ handleInput
277
+ };
278
+ }
279
+ const BUTTONS = [
280
+ ["7", "8", "9", "/"],
281
+ ["4", "5", "6", "*"],
282
+ ["1", "2", "3", "-"],
283
+ ["0", ".", "=", "+"]
284
+ ], Calculator = forwardRef(
285
+ ({
286
+ initialValue: e = "",
287
+ onChange: t,
288
+ disabled: r,
289
+ className: s,
290
+ "aria-label": o
291
+ }, n) => {
292
+ const { input: a, inputRef: i, handleButton: u, handleInput: c } = useCalculator({
293
+ initialValue: e,
294
+ disabled: r,
295
+ onChange: t
296
+ });
297
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
298
+ "div",
299
+ {
300
+ ref: n,
301
+ className: cn(calculatorRootVariants({ disabled: r }), s),
302
+ "aria-label": o || "Calculator",
303
+ role: "region",
304
+ children: [
305
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
306
+ "input",
307
+ {
308
+ ref: i,
309
+ 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)]",
310
+ value: a,
311
+ onChange: c,
312
+ disabled: r,
313
+ inputMode: "decimal",
314
+ "aria-label": "Calculator input"
315
+ }
316
+ ),
317
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1 mb-3", children: BUTTONS.map((x, b) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex w-full", children: x.map((f) => f === "⌫" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
318
+ ButtonIcon,
319
+ {
320
+ as: X,
321
+ variant: "danger-ghost",
322
+ "aria-label": "Backspace",
323
+ size: "md",
324
+ onClick: () => u("⌫"),
325
+ disabled: r
326
+ },
327
+ "backspace"
328
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
329
+ CalculatorButton,
330
+ {
331
+ variant: f === "=" ? "action" : f === "C" ? "danger" : ["/", "*", "-", "+", "/"].includes(f) ? "operator" : "default",
332
+ onClick: () => u(f),
333
+ disabled: r,
334
+ "aria-label": f,
335
+ children: f
336
+ },
337
+ f
338
+ )) }, b)) })
339
+ ]
340
+ }
341
+ );
342
+ }
343
+ );
344
+ Calculator.displayName = "Calculator";
345
+ const buttonVariants = cva(
346
+ "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",
347
+ {
348
+ variants: {
349
+ variant: {
350
+ // Core variants using Versaur color system
351
+ primary: "bg-primary text-white hover:bg-primary/90 focus-visible:ring-primary-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
352
+ secondary: "bg-secondary text-white hover:bg-secondary/90 focus-visible:ring-secondary-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
353
+ tertiary: "bg-tertiary text-white hover:bg-tertiary/90 focus-visible:ring-tertiary-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
354
+ ghost: "bg-white text-foreground hover:bg-ghost-soft focus-visible:ring-ghost-soft focus-visible:ring-offset-white",
355
+ neutral: "bg-neutral text-foreground border border-border hover:bg-neutral/80 focus-visible:ring-foreground-soft focus-visible:ring-offset-white shadow-sm",
356
+ // Outline variants
357
+ "primary-outline": "border border-primary text-primary bg-white hover:bg-primary hover:text-white focus-visible:ring-primary-soft focus-visible:ring-offset-white transition-all",
358
+ "secondary-outline": "border border-secondary text-secondary bg-white hover:bg-secondary hover:text-white focus-visible:ring-secondary-soft focus-visible:ring-offset-white transition-all",
359
+ "tertiary-outline": "border border-tertiary text-tertiary bg-white hover:bg-tertiary hover:text-white focus-visible:ring-tertiary-soft focus-visible:ring-offset-white transition-all",
360
+ "ghost-outline": "border border-ghost text-ghost bg-white hover:bg-ghost hover:text-white focus-visible:ring-ghost-soft focus-visible:ring-offset-white transition-all",
361
+ "neutral-outline": "border border-neutral text-foreground bg-white hover:bg-neutral hover:text-foreground focus-visible:ring-foreground-soft focus-visible:ring-offset-white transition-all",
362
+ // Ghost variants (subtle)
363
+ "primary-ghost": "text-primary bg-white hover:bg-primary-light focus-visible:ring-primary-light focus-visible:ring-offset-white",
364
+ "secondary-ghost": "text-secondary bg-white hover:bg-secondary-light focus-visible:ring-secondary-light focus-visible:ring-offset-white",
365
+ "tertiary-ghost": "text-tertiary bg-white hover:bg-tertiary-light focus-visible:ring-tertiary-light focus-visible:ring-offset-white",
366
+ "neutral-ghost": "text-foreground bg-white hover:bg-neutral/70 focus-visible:ring-foreground-soft focus-visible:ring-offset-white",
367
+ // Semantic variants
368
+ success: "bg-success text-white hover:bg-success/90 focus-visible:ring-success-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
369
+ "success-outline": "border border-success text-success bg-white hover:bg-success hover:text-white focus-visible:ring-success-soft focus-visible:ring-offset-white transition-all",
370
+ "success-ghost": "text-success bg-white hover:bg-success-light focus-visible:ring-success-light focus-visible:ring-offset-white",
371
+ info: "bg-info text-white hover:bg-info/90 focus-visible:ring-info-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
372
+ "info-outline": "border border-info text-info bg-white hover:bg-info hover:text-white focus-visible:ring-info-soft focus-visible:ring-offset-white transition-all",
373
+ "info-ghost": "text-info bg-white hover:bg-info-light focus-visible:ring-info-light focus-visible:ring-offset-white",
374
+ warning: "bg-warning text-white hover:bg-warning/90 focus-visible:ring-warning-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
375
+ "warning-outline": "border border-warning text-warning bg-white hover:bg-warning hover:text-white focus-visible:ring-warning-soft focus-visible:ring-offset-white transition-all",
376
+ "warning-ghost": "text-warning bg-white hover:bg-warning-light focus-visible:ring-warning-light focus-visible:ring-offset-white",
377
+ danger: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
378
+ "danger-outline": "border border-danger text-danger bg-white hover:bg-danger hover:text-white focus-visible:ring-danger-soft focus-visible:ring-offset-white transition-all",
379
+ "danger-ghost": "text-danger bg-white hover:bg-danger-light focus-visible:ring-danger-light focus-visible:ring-offset-white",
380
+ // Utility variants
381
+ outline: "border border-border text-foreground bg-white hover:bg-accent-soft focus-visible:ring-accent-soft focus-visible:ring-offset-white transition-all",
382
+ destructive: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md"
383
+ },
384
+ size: {
385
+ sm: "h-8 px-3 text-sm min-w-[2.25rem]",
386
+ md: "h-10 px-4 text-sm min-w-[2.5rem]",
387
+ lg: "h-12 px-8 text-lg min-w-[2.75rem]"
388
+ }
389
+ },
390
+ defaultVariants: {
391
+ variant: "primary",
392
+ size: "md"
393
+ }
394
+ }
395
+ ), Button = React__default.forwardRef(
396
+ function e({
397
+ className: t,
398
+ variant: r = "primary",
399
+ size: s = "md",
400
+ disabled: o = !1,
401
+ type: n = "button",
402
+ children: a,
403
+ ...i
404
+ }, u) {
405
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
406
+ "button",
407
+ {
408
+ ref: u,
409
+ type: n,
410
+ className: cn(buttonVariants({ variant: r, size: s }), t),
411
+ disabled: o,
412
+ "aria-disabled": o,
413
+ inert: o ? !0 : void 0,
414
+ ...i,
415
+ children: a
416
+ }
417
+ );
418
+ }
419
+ ), alertVariants = cva(
420
+ "relative flex items-center gap-2 rounded-md p-2 text-sm transition-all duration-200",
421
+ {
422
+ variants: {
423
+ variant: {
424
+ default: "",
425
+ outline: "border"
426
+ },
427
+ color: {
428
+ // Core colors
429
+ primary: "",
430
+ secondary: "",
431
+ tertiary: "",
432
+ ghost: "",
433
+ neutral: "",
434
+ // Semantic colors
435
+ success: "",
436
+ info: "",
437
+ warning: "",
438
+ danger: ""
439
+ }
440
+ },
441
+ compoundVariants: [
442
+ // Default variant styles (soft backgrounds)
443
+ {
444
+ variant: "default",
445
+ color: "primary",
446
+ class: "bg-primary-soft text-primary border border-primary"
447
+ },
448
+ {
449
+ variant: "default",
450
+ color: "secondary",
451
+ class: "bg-secondary-soft text-secondary border border-secondary"
452
+ },
453
+ {
454
+ variant: "default",
455
+ color: "tertiary",
456
+ class: "bg-tertiary-soft text-tertiary border border-tertiary"
457
+ },
458
+ {
459
+ variant: "default",
460
+ color: "ghost",
461
+ class: "bg-ghost-soft text-ghost border border-ghost"
462
+ },
463
+ {
464
+ variant: "default",
465
+ color: "neutral",
466
+ class: "bg-border/50 text-foreground border border-border"
467
+ },
468
+ {
469
+ variant: "default",
470
+ color: "success",
471
+ class: "bg-success-soft text-success border border-success"
472
+ },
473
+ {
474
+ variant: "default",
475
+ color: "info",
476
+ class: "bg-info-soft text-info border border-info"
477
+ },
478
+ {
479
+ variant: "default",
480
+ color: "warning",
481
+ class: "bg-warning-soft text-warning border border-warning"
482
+ },
483
+ {
484
+ variant: "default",
485
+ color: "danger",
486
+ class: "bg-danger-soft text-danger border border-danger"
487
+ },
488
+ // Outline variant styles
489
+ {
490
+ variant: "outline",
491
+ color: "primary",
492
+ class: "bg-transparent text-primary border-primary"
493
+ },
494
+ {
495
+ variant: "outline",
496
+ color: "secondary",
497
+ class: "bg-transparent text-secondary border-secondary"
498
+ },
499
+ {
500
+ variant: "outline",
501
+ color: "tertiary",
502
+ class: "bg-transparent text-tertiary border-tertiary"
503
+ },
504
+ {
505
+ variant: "outline",
506
+ color: "ghost",
507
+ class: "bg-transparent text-ghost border-ghost"
508
+ },
509
+ {
510
+ variant: "outline",
511
+ color: "neutral",
512
+ class: "bg-transparent text-foreground border-border"
513
+ },
514
+ {
515
+ variant: "outline",
516
+ color: "success",
517
+ class: "bg-transparent text-success border-success"
518
+ },
519
+ {
520
+ variant: "outline",
521
+ color: "info",
522
+ class: "bg-transparent text-info border-info"
523
+ },
524
+ {
525
+ variant: "outline",
526
+ color: "warning",
527
+ class: "bg-transparent text-warning border-warning"
528
+ },
529
+ {
530
+ variant: "outline",
531
+ color: "danger",
532
+ class: "bg-transparent text-danger border-danger"
533
+ }
534
+ ],
535
+ defaultVariants: {
536
+ variant: "default",
537
+ color: "neutral"
538
+ }
539
+ }
540
+ ), alertIconVariants = cva(
541
+ "flex-shrink-0 flex justify-center items-center ",
542
+ {
543
+ variants: {
544
+ size: {
545
+ sm: "w-4 h-4",
546
+ md: "w-5 h-5",
547
+ lg: "w-6 h-6"
548
+ }
549
+ },
550
+ defaultVariants: {
551
+ size: "md"
552
+ }
553
+ }
554
+ ), AlertIcon = forwardRef(
555
+ ({ className: e, children: t, ...r }, s) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: s, className: cn(alertIconVariants(), e), ...r, children: t })
556
+ ), AlertRoot = forwardRef(
557
+ ({
558
+ variant: e = "default",
559
+ color: t = "neutral",
560
+ icon: r,
561
+ className: s,
562
+ children: o,
563
+ ...n
564
+ }, a) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
565
+ "div",
566
+ {
567
+ ref: a,
568
+ role: "alert",
569
+ className: cn(alertVariants({ variant: e, color: t }), s),
570
+ ...n,
571
+ children: [
572
+ r && /* @__PURE__ */ jsxRuntimeExports.jsx(AlertIcon, { children: r }),
573
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1", children: o })
574
+ ]
575
+ }
576
+ )
577
+ ), Alert = Object.assign(AlertRoot, {
578
+ Icon: AlertIcon
579
+ }), anchorVariants = cva(
580
+ [
581
+ "inline-flex items-center transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
582
+ // pseudo selectors for anchor
583
+ "hover:no-underline"
584
+ ],
585
+ {
586
+ variants: {
587
+ color: {
588
+ primary: "text-primary",
589
+ secondary: "text-secondary",
590
+ ghost: "text-ghost",
591
+ danger: "text-danger",
592
+ neutral: "text-neutral"
593
+ },
594
+ fontSize: {
595
+ xs: "text-xs",
596
+ sm: "text-sm",
597
+ base: "text-base",
598
+ lg: "text-lg",
599
+ xl: "text-xl",
600
+ "2xl": "text-2xl",
601
+ "3xl": "text-3xl",
602
+ "4xl": "text-4xl",
603
+ "5xl": "text-5xl",
604
+ "6xl": "text-6xl",
605
+ "7xl": "text-7xl",
606
+ "8xl": "text-8xl",
607
+ "9xl": "text-9xl",
608
+ inherit: "",
609
+ undefined: ""
610
+ },
611
+ fontWeight: {
612
+ thin: "font-thin",
613
+ extralight: "font-extralight",
614
+ light: "font-light",
615
+ normal: "font-normal",
616
+ medium: "font-medium",
617
+ semibold: "font-semibold",
618
+ bold: "font-bold",
619
+ extrabold: "font-extrabold",
620
+ black: "font-black",
621
+ inherit: "",
622
+ undefined: ""
623
+ },
624
+ quiet: {
625
+ true: "",
626
+ false: "underline underline-offset-2"
627
+ }
628
+ },
629
+ defaultVariants: {
630
+ color: "primary",
631
+ fontSize: "base",
632
+ fontWeight: "medium",
633
+ quiet: !1
634
+ }
635
+ }
636
+ ), Anchor = forwardRef(
637
+ ({
638
+ children: e,
639
+ className: t,
640
+ color: r = "primary",
641
+ fontSize: s = "base",
642
+ fontWeight: o = "medium",
643
+ quiet: n = !1,
644
+ ...a
645
+ }, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(
646
+ "a",
647
+ {
648
+ ref: i,
649
+ className: cn(
650
+ anchorVariants({ color: r, fontSize: s, fontWeight: o, quiet: n }),
651
+ t
652
+ ),
653
+ ...a,
654
+ children: e
655
+ }
656
+ )
657
+ ), avatarVariants = cva(
658
+ "inline-flex items-center justify-center font-medium text-white overflow-hidden transition-all duration-200 select-none relative",
659
+ {
660
+ variants: {
661
+ variant: {
662
+ // Core variants using Versaur color system
663
+ primary: "bg-primary-light text-primary",
664
+ secondary: "bg-secondary-light text-secondary",
665
+ tertiary: "bg-tertiary-light text-tertiary",
666
+ ghost: "bg-ghost-light text-ghost",
667
+ neutral: "bg-neutral-light text-foreground border border-border",
668
+ // Semantic variants
669
+ success: "bg-success-light text-success",
670
+ info: "bg-info-light text-info",
671
+ warning: "bg-warning-light text-warning",
672
+ danger: "bg-danger-light text-danger"
673
+ },
674
+ size: {
675
+ xs: "h-6 w-6 text-xs",
676
+ sm: "h-8 w-8 text-xs",
677
+ md: "h-10 w-10 text-sm",
678
+ lg: "h-12 w-12 text-base",
679
+ xl: "h-16 w-16 text-xl"
680
+ },
681
+ shape: {
682
+ circle: "rounded-full",
683
+ square: "rounded-none",
684
+ rounded: "rounded-md"
685
+ }
686
+ },
687
+ defaultVariants: {
688
+ variant: "primary",
689
+ size: "md",
690
+ shape: "circle"
691
+ }
692
+ }
693
+ ), avatarImageVariants = cva(
694
+ "absolute inset-0 h-full w-full object-cover"
695
+ ), Avatar$1 = forwardRef(
696
+ ({
697
+ variant: e = "primary",
698
+ size: t = "md",
699
+ shape: r = "circle",
700
+ className: s,
701
+ children: o,
702
+ ...n
703
+ }, a) => /* @__PURE__ */ jsxRuntimeExports.jsx(
704
+ "div",
705
+ {
706
+ ref: a,
707
+ className: cn(avatarVariants({ variant: e, size: t, shape: r }), s),
708
+ ...n,
709
+ children: o
710
+ }
711
+ )
712
+ ), AvatarImage = forwardRef(
713
+ ({ src: e, alt: t, className: r, onError: s, ...o }, n) => {
714
+ const [a, i] = useState(!1);
715
+ useEffect(() => {
716
+ i(!1);
717
+ }, [e]);
718
+ const u = useCallback(
719
+ (c) => {
720
+ i(!0), s?.(c);
721
+ },
722
+ [s]
723
+ );
724
+ return a ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
725
+ "img",
726
+ {
727
+ ref: n,
728
+ src: e,
729
+ alt: t,
730
+ className: cn(avatarImageVariants(), r),
731
+ onError: u,
732
+ ...o
733
+ }
734
+ );
735
+ }
736
+ ), Avatar = Object.assign(Avatar$1, {
737
+ /**
738
+ * AvatarImage sub-component for displaying images with fallback behavior
739
+ */
740
+ Image: AvatarImage
741
+ }), badgeVariants = cva(
742
+ "inline-flex items-center justify-center font-medium transition-all duration-200 select-none gap-1 min-h-[1.25rem]",
743
+ {
744
+ variants: {
745
+ variant: {
746
+ default: "",
747
+ outline: "border bg-background"
748
+ },
749
+ color: {
750
+ // Core colors
751
+ primary: "",
752
+ secondary: "",
753
+ tertiary: "",
754
+ ghost: "",
755
+ neutral: "",
756
+ // Semantic colors
757
+ success: "",
758
+ info: "",
759
+ warning: "",
760
+ danger: ""
761
+ },
762
+ shape: {
763
+ rounded: "rounded-full",
764
+ square: "rounded-md"
765
+ },
766
+ size: {
767
+ sm: "text-xs px-1 py-0.25 h-3",
768
+ md: "text-xs px-1.5 py-0.5 h-4",
769
+ lg: "text-sm px-2 py-1 h-6"
770
+ },
771
+ iconOnly: {
772
+ true: "",
773
+ false: ""
774
+ }
775
+ },
776
+ compoundVariants: [
777
+ // Default variant color combinations - using light/soft backgrounds
778
+ {
779
+ variant: "default",
780
+ color: "primary",
781
+ className: "bg-primary-light text-primary"
782
+ },
783
+ {
784
+ variant: "default",
785
+ color: "secondary",
786
+ className: "bg-secondary-light text-secondary"
787
+ },
788
+ {
789
+ variant: "default",
790
+ color: "tertiary",
791
+ className: "bg-tertiary-light text-tertiary"
792
+ },
793
+ {
794
+ variant: "default",
795
+ color: "ghost",
796
+ className: "bg-ghost-light text-ghost"
797
+ },
798
+ {
799
+ variant: "default",
800
+ color: "neutral",
801
+ className: "bg-neutral text-foreground"
802
+ },
803
+ {
804
+ variant: "default",
805
+ color: "success",
806
+ className: "bg-success-light text-success"
807
+ },
808
+ {
809
+ variant: "default",
810
+ color: "info",
811
+ className: "bg-info-light text-info"
812
+ },
813
+ {
814
+ variant: "default",
815
+ color: "warning",
816
+ className: "bg-warning-light text-warning"
817
+ },
818
+ {
819
+ variant: "default",
820
+ color: "danger",
821
+ className: "bg-danger-light text-danger"
822
+ },
823
+ // Outline variant color combinations
824
+ {
825
+ variant: "outline",
826
+ color: "primary",
827
+ className: "border-primary text-primary"
828
+ },
829
+ {
830
+ variant: "outline",
831
+ color: "secondary",
832
+ className: "border-secondary text-secondary"
833
+ },
834
+ {
835
+ variant: "outline",
836
+ color: "tertiary",
837
+ className: "border-tertiary text-tertiary"
838
+ },
839
+ {
840
+ variant: "outline",
841
+ color: "ghost",
842
+ className: "border-ghost text-ghost"
843
+ },
844
+ {
845
+ variant: "outline",
846
+ color: "neutral",
847
+ className: "border-neutral text-foreground"
848
+ },
849
+ {
850
+ variant: "outline",
851
+ color: "success",
852
+ className: "border-success text-success"
853
+ },
854
+ {
855
+ variant: "outline",
856
+ color: "info",
857
+ className: "border-info text-info"
858
+ },
859
+ {
860
+ variant: "outline",
861
+ color: "warning",
862
+ className: "border-warning text-warning"
863
+ },
864
+ {
865
+ variant: "outline",
866
+ color: "danger",
867
+ className: "border-danger text-danger"
868
+ },
869
+ // Icon-only size adjustments
870
+ {
871
+ iconOnly: !0,
872
+ size: "sm",
873
+ className: "px-1 py-1 w-5 h-5"
874
+ },
875
+ {
876
+ iconOnly: !0,
877
+ size: "md",
878
+ className: "px-1.5 py-1.5 w-6 h-6"
879
+ },
880
+ {
881
+ iconOnly: !0,
882
+ size: "lg",
883
+ className: "px-2 py-2 w-7 h-7"
884
+ }
885
+ ],
886
+ defaultVariants: {
887
+ variant: "default",
888
+ color: "primary",
889
+ shape: "square",
890
+ size: "md",
891
+ iconOnly: !1
892
+ }
893
+ }
894
+ ), Badge = forwardRef(
895
+ ({
896
+ variant: e = "default",
897
+ shape: t = "square",
898
+ color: r = "primary",
899
+ size: s = "md",
900
+ iconLeft: o,
901
+ iconRight: n,
902
+ className: a,
903
+ children: i,
904
+ ...u
905
+ }, c) => {
906
+ const f = !(i != null && i !== "") && !!(o || n);
907
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
908
+ "span",
909
+ {
910
+ ref: c,
911
+ className: cn(
912
+ badgeVariants({
913
+ variant: e,
914
+ color: r,
915
+ shape: t,
916
+ size: s,
917
+ iconOnly: f
918
+ }),
919
+ a
920
+ ),
921
+ ...u,
922
+ children: f ? (
923
+ // Icon-only mode: display only the icon
924
+ o || n
925
+ ) : (
926
+ // Normal mode: display icon(s) and text
927
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
928
+ o,
929
+ i,
930
+ n
931
+ ] })
932
+ )
933
+ }
934
+ );
935
+ }
936
+ );
937
+ Badge.displayName = "Badge";
938
+ const 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" }))), brandSizeClass = cva("", {
939
+ variants: {
940
+ size: {
941
+ xs: "h-6 w-6",
942
+ sm: "h-6 w-6",
943
+ md: "h-8 w-8",
944
+ lg: "h-10 w-10",
945
+ xl: "h-12 w-12"
946
+ }
947
+ },
948
+ defaultVariants: {
949
+ size: "md"
950
+ }
951
+ }), BrandLogo = forwardRef(
952
+ ({ shape: e = "square", size: t, ...r }, s) => {
953
+ const n = {
954
+ square: SvgSpenicleSquare,
955
+ rounded: SvgSpenicleRounded,
956
+ circle: SvgSpenicleCircle
957
+ }[e] || SvgSpenicleSquare;
958
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
959
+ n,
960
+ {
961
+ ref: s,
962
+ ...r,
963
+ className: cn("inline-block", brandSizeClass({ size: t }))
964
+ }
965
+ );
966
+ }
967
+ ), Brand = forwardRef(
968
+ ({ name: e = "spenicle", size: t = "md", shape: r, ...s }, o) => /* @__PURE__ */ jsxRuntimeExports.jsx(
969
+ "span",
970
+ {
971
+ ref: o,
972
+ className: cn("inline-flex items-center gap-2"),
973
+ ...s,
974
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(BrandLogo, { shape: r, size: t, "aria-hidden": "true" })
975
+ }
976
+ )
977
+ ), buttonFloatVariants = cva(
978
+ [
979
+ "inline-flex items-center justify-center gap-2",
980
+ "rounded-lg",
981
+ "font-medium",
982
+ "transition-all",
983
+ "duration-200",
984
+ "focus-visible:outline-none",
985
+ "focus-visible:ring-2",
986
+ "focus-visible:ring-offset-2",
987
+ "disabled:opacity-50",
988
+ "disabled:pointer-events-none",
989
+ "select-none",
990
+ "shadow-lg",
991
+ "transition-transform",
992
+ "transition-shadow",
993
+ "will-change-transform,opacity,box-shadow",
994
+ "hover:scale-105",
995
+ "active:scale-95",
996
+ "focus-visible:shadow-xl",
997
+ "hover:shadow-xl",
998
+ "active:shadow-md"
999
+ ].join(" "),
1000
+ {
1001
+ variants: {
1002
+ variant: {
1003
+ primary: "bg-primary text-white hover:bg-primary/90 focus-visible:ring-primary-soft focus-visible:ring-offset-white",
1004
+ secondary: "bg-secondary text-white hover:bg-secondary/90 focus-visible:ring-secondary-soft focus-visible:ring-offset-white",
1005
+ tertiary: "bg-tertiary text-white hover:bg-tertiary/90 focus-visible:ring-tertiary-soft focus-visible:ring-offset-white",
1006
+ ghost: "bg-white text-foreground hover:bg-ghost-soft focus-visible:ring-ghost-soft focus-visible:ring-offset-white",
1007
+ neutral: "bg-neutral text-foreground border border-border hover:bg-neutral/80 focus-visible:ring-foreground-soft focus-visible:ring-offset-white",
1008
+ "primary-outline": "border border-primary text-primary bg-white hover:bg-primary hover:text-white focus-visible:ring-primary-soft focus-visible:ring-offset-white",
1009
+ "secondary-outline": "border border-secondary text-secondary bg-white hover:bg-secondary hover:text-white focus-visible:ring-secondary-soft focus-visible:ring-offset-white",
1010
+ "tertiary-outline": "border border-tertiary text-tertiary bg-white hover:bg-tertiary hover:text-white focus-visible:ring-tertiary-soft focus-visible:ring-offset-white",
1011
+ "ghost-outline": "border border-ghost text-ghost bg-white hover:bg-ghost hover:text-white focus-visible:ring-ghost-soft focus-visible:ring-offset-white",
1012
+ "neutral-outline": "border border-neutral text-foreground bg-white hover:bg-neutral hover:text-foreground focus-visible:ring-foreground-soft focus-visible:ring-offset-white",
1013
+ "primary-ghost": "text-primary bg-white hover:bg-primary-soft focus-visible:ring-primary-soft focus-visible:ring-offset-white",
1014
+ "secondary-ghost": "text-secondary bg-white hover:bg-secondary-soft focus-visible:ring-secondary-soft focus-visible:ring-offset-white",
1015
+ "tertiary-ghost": "text-tertiary bg-white hover:bg-tertiary-soft focus-visible:ring-tertiary-soft focus-visible:ring-offset-white",
1016
+ "neutral-ghost": "text-foreground bg-white hover:bg-neutral/70 focus-visible:ring-foreground-soft focus-visible:ring-offset-white",
1017
+ success: "bg-success text-white hover:bg-success/90 focus-visible:ring-success-soft focus-visible:ring-offset-white",
1018
+ "success-outline": "border border-success text-success bg-white hover:bg-success hover:text-white focus-visible:ring-success-soft focus-visible:ring-offset-white",
1019
+ "success-ghost": "text-success bg-white hover:bg-success-soft focus-visible:ring-success-soft focus-visible:ring-offset-white",
1020
+ info: "bg-info text-white hover:bg-info/90 focus-visible:ring-info-soft focus-visible:ring-offset-white",
1021
+ "info-outline": "border border-info text-info bg-white hover:bg-info hover:text-white focus-visible:ring-info-soft focus-visible:ring-offset-white",
1022
+ "info-ghost": "text-info bg-white hover:bg-info-soft focus-visible:ring-info-soft focus-visible:ring-offset-white",
1023
+ warning: "bg-warning text-white hover:bg-warning/90 focus-visible:ring-warning-soft focus-visible:ring-offset-white",
1024
+ "warning-outline": "border border-warning text-warning bg-white hover:bg-warning hover:text-white focus-visible:ring-warning-soft focus-visible:ring-offset-white",
1025
+ "warning-ghost": "text-warning bg-white hover:bg-warning-soft focus-visible:ring-warning-soft focus-visible:ring-offset-white",
1026
+ danger: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-soft focus-visible:ring-offset-white",
1027
+ "danger-outline": "border border-danger text-danger bg-white hover:bg-danger hover:text-white focus-visible:ring-danger-soft focus-visible:ring-offset-white",
1028
+ "danger-ghost": "text-danger bg-white hover:bg-danger-soft focus-visible:ring-danger-soft focus-visible:ring-offset-white",
1029
+ outline: "border border-border text-foreground bg-white hover:bg-accent-soft focus-visible:ring-accent-soft focus-visible:ring-offset-white",
1030
+ destructive: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-soft focus-visible:ring-offset-white"
1031
+ },
1032
+ size: {
1033
+ sm: "h-12 w-12 min-w-12 min-h-12 text-base",
1034
+ md: "h-14 w-14 min-w-14 min-h-14 text-lg",
1035
+ lg: "h-16 w-16 min-w-16 min-h-16 text-xl"
1036
+ }
1037
+ },
1038
+ defaultVariants: {
1039
+ variant: "primary",
1040
+ size: "md"
1041
+ }
1042
+ }
1043
+ );
1044
+ function useFloatingPosition(e, t = "1rem") {
1045
+ const r = useRef(null), [s, o] = useState({}), [n, a] = useState("fixed bottom-4 right-4"), i = useCallback(() => {
1046
+ const c = r.current;
1047
+ if (!c) return;
1048
+ const b = c.getBoundingClientRect().height > window.innerHeight;
1049
+ let f = {}, w = "";
1050
+ b ? (f = {
1051
+ position: "fixed",
1052
+ bottom: t,
1053
+ zIndex: 50,
1054
+ transform: `translateY(${c.scrollTop}px)`
1055
+ }, w = `fixed bottom-4 ${e}-4`) : (f = {
1056
+ position: "fixed",
1057
+ bottom: t,
1058
+ zIndex: 50
1059
+ }, w = `fixed bottom-4 ${e}-4`), o(f), a(w);
1060
+ }, [e, t]);
1061
+ return useEffect(() => {
1062
+ i();
1063
+ const c = r.current;
1064
+ return c && c.addEventListener("scroll", i), window.addEventListener("resize", i), () => {
1065
+ c && c.removeEventListener("scroll", i), window.removeEventListener("resize", i);
1066
+ };
1067
+ }, [i]), useEffect(() => {
1068
+ r.current && i();
1069
+ }, [e, t, i]), [useCallback(
1070
+ (c) => {
1071
+ r.current = c, c && i();
1072
+ },
1073
+ [i]
1074
+ ), s, n];
1075
+ }
1076
+ const ButtonFloat = forwardRef(
1077
+ function e({
1078
+ className: t,
1079
+ variant: r = "primary",
1080
+ size: s = "md",
1081
+ side: o = "right",
1082
+ offset: n = "1rem",
1083
+ ...a
1084
+ }, i) {
1085
+ const [u, c, x] = useFloatingPosition(
1086
+ o,
1087
+ n
1088
+ ), [b, f] = useState(!1);
1089
+ return useEffect(() => {
1090
+ f(!0);
1091
+ }, []), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: u, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1092
+ "button",
1093
+ {
1094
+ ref: i,
1095
+ type: a.type || "button",
1096
+ className: cn(
1097
+ buttonFloatVariants({ variant: r, size: s }),
1098
+ x,
1099
+ b && "animate-fab-in",
1100
+ t
1101
+ ),
1102
+ style: c,
1103
+ ...a
1104
+ }
1105
+ ) });
1106
+ }
1107
+ ), textVariants = cva("", {
1108
+ variants: {
1109
+ color: {
1110
+ primary: "text-primary",
1111
+ secondary: "text-secondary",
1112
+ tertiary: "text-tertiary",
1113
+ ghost: "text-ghost",
1114
+ neutral: "text-ghost",
1115
+ success: "text-success",
1116
+ info: "text-info",
1117
+ warning: "text-warning",
1118
+ danger: "text-danger",
1119
+ inherit: "",
1120
+ gray: "text-gray-500",
1121
+ black: "text-black",
1122
+ white: "text-white"
1123
+ },
1124
+ hasUnderline: {
1125
+ true: "underline",
1126
+ false: ""
1127
+ },
1128
+ isCapitalize: {
1129
+ true: "capitalize",
1130
+ false: ""
1131
+ },
1132
+ align: {
1133
+ left: "text-left",
1134
+ center: "text-center",
1135
+ right: "text-right",
1136
+ justify: "text-justify"
1137
+ },
1138
+ italic: {
1139
+ true: "italic",
1140
+ false: ""
1141
+ },
1142
+ clamp: {
1143
+ 1: "line-clamp-1",
1144
+ 2: "line-clamp-2",
1145
+ 3: "line-clamp-3",
1146
+ 4: "line-clamp-4",
1147
+ 5: "line-clamp-5",
1148
+ none: ""
1149
+ },
1150
+ ellipsis: {
1151
+ true: "truncate",
1152
+ false: ""
1153
+ },
1154
+ as: {
1155
+ h1: "font-bold text-4xl leading-loose",
1156
+ h2: "font-semibold text-3xl leading-relaxed",
1157
+ h3: "font-medium text-2xl leading-relaxed",
1158
+ h4: "font-bold text-xl leading-normal",
1159
+ h5: "font-semibold text-lg leading-normal",
1160
+ h6: "font-medium text-base leading-normal",
1161
+ p: "font-normal text-base leading-normal",
1162
+ span: "font-normal text-base leading-normal",
1163
+ label: "font-normal text-xs leading-normal"
1164
+ }
1165
+ },
1166
+ defaultVariants: {
1167
+ color: "neutral",
1168
+ hasUnderline: !1,
1169
+ isCapitalize: !1,
1170
+ align: "left",
1171
+ italic: !1,
1172
+ clamp: "none",
1173
+ ellipsis: !1,
1174
+ as: "span"
1175
+ }
1176
+ }), Text = forwardRef(
1177
+ ({
1178
+ as: e = "span",
1179
+ color: t = "ghost",
1180
+ hasUnderline: r = !1,
1181
+ isCapitalize: s = !1,
1182
+ align: o = "left",
1183
+ italic: n = !1,
1184
+ clamp: a = "none",
1185
+ ellipsis: i = !1,
1186
+ fontSize: u,
1187
+ fontWeight: c,
1188
+ className: x,
1189
+ children: b,
1190
+ ...f
1191
+ }, w) => {
1192
+ const d = [
1193
+ "h1",
1194
+ "h2",
1195
+ "h3",
1196
+ "h4",
1197
+ "h5",
1198
+ "h6",
1199
+ "p",
1200
+ "span",
1201
+ "label"
1202
+ ].includes(e) ? e : "span", v = u ? `text-${u}` : "", p = c ? `font-${c}` : "";
1203
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
1204
+ e,
1205
+ {
1206
+ ref: w,
1207
+ className: cn(
1208
+ textVariants({
1209
+ color: t,
1210
+ hasUnderline: r,
1211
+ isCapitalize: s,
1212
+ align: o,
1213
+ italic: n,
1214
+ clamp: a,
1215
+ ellipsis: i,
1216
+ // @ts-expect-error - `as` is not a valid variant
1217
+ as: d
1218
+ }),
1219
+ v,
1220
+ p,
1221
+ x
1222
+ ),
1223
+ ...f,
1224
+ children: b
1225
+ }
1226
+ );
1227
+ }
1228
+ ), CalendarContext = createContext(null);
1229
+ function useCalendarContext() {
1230
+ const e = useContext(CalendarContext);
1231
+ if (!e)
1232
+ throw new Error(
1233
+ "useCalendarContext must be used within CalendarContext.Provider"
1234
+ );
1235
+ return e;
1236
+ }
1237
+ const CalendarHeader = () => {
1238
+ const { value: e, year: t, month: r, setMonth: s } = useCalendarContext();
1239
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between px-4 pt-4 pb-2", children: [
1240
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { fontSize: "base", fontWeight: "semibold", className: "ml-2", children: e ? e instanceof Date ? e.toLocaleDateString(void 0, {
1241
+ year: "numeric",
1242
+ month: "long"
1243
+ }) : Array.isArray(e) && e[0] ? e[0].toLocaleDateString(void 0, {
1244
+ year: "numeric",
1245
+ month: "long"
1246
+ }) : `${t} ${new Date(t, r).toLocaleString(void 0, { month: "long" })}` : `${t} ${new Date(t, r).toLocaleString(void 0, { month: "long" })}` }),
1247
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2", children: [
1248
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1249
+ ButtonIcon,
1250
+ {
1251
+ as: ChevronLeft,
1252
+ variant: "ghost",
1253
+ size: "sm",
1254
+ "aria-label": "Previous month",
1255
+ onClick: () => s(r === 0 ? 11 : r - 1)
1256
+ }
1257
+ ),
1258
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1259
+ ButtonIcon,
1260
+ {
1261
+ as: ChevronRight,
1262
+ variant: "ghost",
1263
+ size: "sm",
1264
+ "aria-label": "Next month",
1265
+ onClick: () => s(r === 11 ? 0 : r + 1)
1266
+ }
1267
+ )
1268
+ ] })
1269
+ ] });
1270
+ }, CalendarWeekdays = () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-7 px-4 text-ghost-500 mb-3", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((e) => /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { fontSize: "xs", color: "ghost", align: "center", children: e }, e)) }), CalendarDaysSingle = () => {
1271
+ const e = useCalendarContext(), { year: t, month: r, value: s, onChange: o, setMonth: n, setYear: a } = e, i = (g, m) => new Date(g, m + 1, 0).getDate(), c = ((g, m) => new Date(g, m, 1).getDay())(t, r), x = i(t, r), b = r - 1 < 0 ? 11 : r - 1, f = r === 0 ? t - 1 : t, w = i(t, b), y = r === 11 ? 0 : r + 1, d = r === 11 ? t + 1 : t, v = [];
1272
+ for (let g = 0; g < c; g++) {
1273
+ const m = w - c + g + 1;
1274
+ v.push(
1275
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1276
+ ButtonIcon,
1277
+ {
1278
+ as: () => /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "sm", color: "tertiary", children: m }),
1279
+ size: "sm",
1280
+ "aria-label": "Previous month day",
1281
+ variant: "ghost",
1282
+ onClick: () => {
1283
+ o?.(new Date(f, b, m)), n(b), a(f);
1284
+ }
1285
+ },
1286
+ "prev-" + g
1287
+ )
1288
+ );
1289
+ }
1290
+ for (let g = 1; g <= x; g++) {
1291
+ const m = s instanceof Date && s.getFullYear() === t && s.getMonth() === r && s.getDate() === g;
1292
+ v.push(
1293
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1294
+ ButtonIcon,
1295
+ {
1296
+ as: () => /* @__PURE__ */ jsxRuntimeExports.jsx(
1297
+ Text,
1298
+ {
1299
+ as: "span",
1300
+ fontSize: "sm",
1301
+ color: m ? "inherit" : "ghost",
1302
+ className: m ? "bg-primary text-white rounded-full" : "",
1303
+ children: g
1304
+ }
1305
+ ),
1306
+ variant: m ? "primary" : "ghost",
1307
+ size: "sm",
1308
+ "aria-label": `Select ${t}-${r + 1}-${g}`,
1309
+ "aria-current": m ? "date" : void 0,
1310
+ onClick: () => {
1311
+ o?.(new Date(t, r, g));
1312
+ }
1313
+ },
1314
+ g
1315
+ )
1316
+ );
1317
+ }
1318
+ const p = c + x;
1319
+ for (let g = 0; g < (p % 7 === 0 ? 0 : 7 - p % 7); g++)
1320
+ v.push(
1321
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1322
+ ButtonIcon,
1323
+ {
1324
+ as: () => /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "sm", color: "tertiary", children: g + 1 }),
1325
+ size: "sm",
1326
+ "aria-label": "Next month day",
1327
+ variant: "ghost",
1328
+ onClick: () => {
1329
+ o?.(new Date(d, y, g + 1)), n(y), a(d);
1330
+ }
1331
+ },
1332
+ "next-" + g
1333
+ )
1334
+ );
1335
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-7 gap-2 px-4 pb-4", children: v });
1336
+ }, CalendarDaysRange = () => {
1337
+ const { year: e, month: t, value: r, onChange: s, setMonth: o, setYear: n } = useCalendarContext(), a = (l, h) => new Date(l, h + 1, 0).getDate(), u = ((l, h) => new Date(l, h, 1).getDay())(e, t), c = a(e, t), x = t - 1 < 0 ? 11 : t - 1, b = t === 0 ? e - 1 : e, f = a(e, x), w = t === 11 ? 0 : t + 1, y = t === 11 ? e + 1 : e, d = [], v = () => {
1338
+ if (!Array.isArray(r)) return [null, null];
1339
+ const [l, h] = r;
1340
+ return !l && !h ? [null, null] : l && h ? l <= h ? [l, h] : [h, l] : [l, h];
1341
+ }, [p, g] = v(), m = (l) => {
1342
+ if (!p || !g) return !1;
1343
+ const h = new Date(e, t, l);
1344
+ return h >= p && h <= g;
1345
+ }, N = (l) => p ? p.getFullYear() === e && p.getMonth() === t && p.getDate() === l : !1, T = (l) => g ? g.getFullYear() === e && g.getMonth() === t && g.getDate() === l : !1;
1346
+ for (let l = 0; l < u; l++) {
1347
+ const h = f - u + l + 1;
1348
+ d.push(
1349
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1350
+ ButtonIcon,
1351
+ {
1352
+ as: () => /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "sm", color: "tertiary", children: h }),
1353
+ size: "sm",
1354
+ "aria-label": "Previous month day",
1355
+ variant: "ghost",
1356
+ onClick: () => {
1357
+ s?.([null, null]), o(x), n(b);
1358
+ }
1359
+ },
1360
+ "prev-" + l
1361
+ )
1362
+ );
1363
+ }
1364
+ for (let l = 1; l <= c; l++) {
1365
+ const h = m(l), C = N(l), E = T(l);
1366
+ d.push(
1367
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1368
+ ButtonIcon,
1369
+ {
1370
+ as: () => /* @__PURE__ */ jsxRuntimeExports.jsx(
1371
+ Text,
1372
+ {
1373
+ as: "span",
1374
+ fontSize: "sm",
1375
+ color: h || C || E ? "inherit" : "ghost",
1376
+ className: cn(
1377
+ h && " bg-primary text-white",
1378
+ C && "rounded-l-full bg-primary text-white",
1379
+ E && "rounded-r-full bg-primary text-white"
1380
+ ),
1381
+ children: l
1382
+ }
1383
+ ),
1384
+ variant: C || E || h ? "primary" : "ghost",
1385
+ size: "sm",
1386
+ "aria-label": `Select ${e}-${t + 1}-${l}`,
1387
+ "aria-current": C || E ? "date" : void 0,
1388
+ onClick: () => {
1389
+ if (!Array.isArray(r) || !r[0] || r[0] && r[1])
1390
+ s?.([new Date(e, t, l), null]);
1391
+ else if (r[0] && !r[1]) {
1392
+ const j = r[0], R = new Date(e, t, l);
1393
+ j.getTime() === R.getTime() ? s?.([j, R]) : s?.(j < R ? [j, R] : [R, j]);
1394
+ }
1395
+ }
1396
+ },
1397
+ l
1398
+ )
1399
+ );
1400
+ }
1401
+ const S = u + c;
1402
+ for (let l = 0; l < (S % 7 === 0 ? 0 : 7 - S % 7); l++)
1403
+ d.push(
1404
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1405
+ ButtonIcon,
1406
+ {
1407
+ as: () => /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "sm", color: "tertiary", children: l + 1 }),
1408
+ size: "sm",
1409
+ "aria-label": "Next month day",
1410
+ variant: "ghost",
1411
+ onClick: () => {
1412
+ s?.([null, null]), o(w), n(y);
1413
+ }
1414
+ },
1415
+ "next-" + l
1416
+ )
1417
+ );
1418
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-7 gap-2 px-4 pb-4", children: d });
1419
+ }, CalendarDays = () => {
1420
+ const { type: e } = useCalendarContext();
1421
+ return e === "range" ? /* @__PURE__ */ jsxRuntimeExports.jsx(CalendarDaysRange, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(CalendarDaysSingle, {});
1422
+ };
1423
+ function useCalendar({
1424
+ value: e,
1425
+ type: t,
1426
+ onChange: r,
1427
+ initialYear: s,
1428
+ initialMonth: o
1429
+ }) {
1430
+ const [n, a] = useState(o), [i, u] = useState(s), [c, x] = useState([
1431
+ null,
1432
+ null
1433
+ ]);
1434
+ let b = e;
1435
+ t === "range" && !e && (b = c);
1436
+ const f = useCallback(() => {
1437
+ const d = n === 0 ? 11 : n - 1, v = n === 0 ? i - 1 : i;
1438
+ a(d), u(v), t === "single" && r?.(new Date(v, d, 1));
1439
+ }, [n, i, t, r]), w = useCallback(() => {
1440
+ const d = n === 11 ? 0 : n + 1, v = n === 11 ? i + 1 : i;
1441
+ a(d), u(v), t === "single" && r?.(new Date(v, d, 1));
1442
+ }, [n, i, t, r]), y = useCallback(
1443
+ (d) => {
1444
+ t === "single" ? r?.(d) : t === "range" && (x(d), r?.(d));
1445
+ },
1446
+ [t, r]
1447
+ );
1448
+ return {
1449
+ year: i,
1450
+ month: n,
1451
+ value: b,
1452
+ setMonth: a,
1453
+ setYear: u,
1454
+ onChange: y,
1455
+ handlePrevMonth: f,
1456
+ handleNextMonth: w
1457
+ };
1458
+ }
1459
+ const CalendarRoot = ({
1460
+ value: e,
1461
+ onChange: t,
1462
+ className: r,
1463
+ type: s = "single",
1464
+ ...o
1465
+ }) => {
1466
+ const n = /* @__PURE__ */ new Date(), a = useCalendar({
1467
+ value: e,
1468
+ onChange: t,
1469
+ type: s,
1470
+ initialYear: n.getFullYear(),
1471
+ initialMonth: n.getMonth()
1472
+ });
1473
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
1474
+ CalendarContext.Provider,
1475
+ {
1476
+ value: {
1477
+ year: a.year,
1478
+ month: a.month,
1479
+ value: a.value,
1480
+ type: s,
1481
+ setMonth: a.setMonth,
1482
+ setYear: a.setYear,
1483
+ onChange: a.onChange
1484
+ },
1485
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("select-none", r), ...o, children: [
1486
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CalendarHeader, {}),
1487
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CalendarWeekdays, {}),
1488
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CalendarDays, {})
1489
+ ] })
1490
+ }
1491
+ );
1492
+ }, Calendar = Object.assign(CalendarRoot, {}), snackbarVariants = cva(
1493
+ "flex items-center gap-2 px-4 py-2 rounded-sm w-fit relative shadow-sm",
1494
+ {
1495
+ variants: {
1496
+ color: {
1497
+ success: "text-success-bold bg-success-soft border-l-4 border-success",
1498
+ info: "text-info-bold bg-info-soft border-l-4 border-info",
1499
+ warning: "text-warning-bold bg-warning-soft border-l-4 border-warning",
1500
+ danger: "text-danger-bold bg-danger-soft border-l-4 border-danger"
1501
+ }
1502
+ },
1503
+ defaultVariants: {
1504
+ color: "success"
1505
+ }
1506
+ }
1507
+ ), SnackbarText = ({
1508
+ children: e,
1509
+ ...t
1510
+ }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
1511
+ "span",
1512
+ {
1513
+ className: "flex-1 truncate text-sm",
1514
+ "data-testid": "snackbar-text",
1515
+ ...t,
1516
+ children: e
1517
+ }
1518
+ ), SnackbarAction = ({
1519
+ children: e,
1520
+ ...t
1521
+ }) => /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-2", "data-testid": "snackbar-action", ...t, children: e }), Snackbar = forwardRef(
1522
+ ({ children: e, action: t, color: r, className: s, ...o }, n) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
1523
+ "div",
1524
+ {
1525
+ ref: n,
1526
+ role: "status",
1527
+ "aria-live": "polite",
1528
+ className: cn(snackbarVariants({ color: r }), s),
1529
+ ...o,
1530
+ children: [
1531
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SnackbarText, { children: e }),
1532
+ t && /* @__PURE__ */ jsxRuntimeExports.jsx(SnackbarAction, { children: t })
1533
+ ]
1534
+ }
1535
+ )
1536
+ ), TableContext = createContext(null), TableProvider = TableContext.Provider;
1537
+ function useTableContext() {
1538
+ const e = useContext(TableContext);
1539
+ if (!e)
1540
+ throw new Error("Table compound components must be used within <Table>");
1541
+ return e;
1542
+ }
1543
+ const getTableColumnClass = (e) => {
1544
+ if (e < 1 || e > 12)
1545
+ throw new Error("Column span must be between 1 and 12");
1546
+ switch (e) {
1547
+ case 1:
1548
+ return "grid-cols-1";
1549
+ case 2:
1550
+ return "grid-cols-2";
1551
+ case 3:
1552
+ return "grid-cols-3";
1553
+ case 4:
1554
+ return "grid-cols-4";
1555
+ case 5:
1556
+ return "grid-cols-5";
1557
+ case 6:
1558
+ return "grid-cols-6";
1559
+ case 7:
1560
+ return "grid-cols-7";
1561
+ case 8:
1562
+ return "grid-cols-8";
1563
+ case 9:
1564
+ return "grid-cols-9";
1565
+ case 10:
1566
+ return "grid-cols-10";
1567
+ case 11:
1568
+ return "grid-cols-11";
1569
+ case 12:
1570
+ return "grid-cols-12";
1571
+ default:
1572
+ return "grid-cols-2";
1573
+ }
1574
+ }, getRowSpanClass = (e) => {
1575
+ if (e < 1 || e > 12)
1576
+ throw new Error("Column span must be between 1 and 12");
1577
+ switch (e) {
1578
+ case 1:
1579
+ return "col-span-1";
1580
+ case 2:
1581
+ return "col-span-2";
1582
+ case 3:
1583
+ return "col-span-3";
1584
+ case 4:
1585
+ return "col-span-4";
1586
+ case 5:
1587
+ return "col-span-5";
1588
+ case 6:
1589
+ return "col-span-6";
1590
+ case 7:
1591
+ return "col-span-7";
1592
+ case 8:
1593
+ return "col-span-8";
1594
+ case 9:
1595
+ return "col-span-9";
1596
+ case 10:
1597
+ return "col-span-10";
1598
+ case 11:
1599
+ return "col-span-11";
1600
+ case 12:
1601
+ return "col-span-12";
1602
+ default:
1603
+ return "col-span-2";
1604
+ }
1605
+ }, TableHeader = forwardRef(
1606
+ ({ children: e, className: t, ...r }, s) => {
1607
+ const { maxColumns: o } = useTableContext();
1608
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
1609
+ "div",
1610
+ {
1611
+ role: "rowgroup",
1612
+ className: cn("bg-neutral-soft", t),
1613
+ ...r,
1614
+ ref: s,
1615
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1616
+ "div",
1617
+ {
1618
+ role: "row",
1619
+ className: cn("grid gap-4", getTableColumnClass(o)),
1620
+ children: e
1621
+ }
1622
+ )
1623
+ }
1624
+ );
1625
+ }
1626
+ ), TableBody = forwardRef(
1627
+ ({ children: e, className: t, ...r }, s) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { role: "rowgroup", ref: s, className: cn(t), ...r, children: e })
1628
+ ), TableFooter = forwardRef(
1629
+ ({ children: e, className: t, ...r }, s) => {
1630
+ const { maxColumns: o } = useTableContext();
1631
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
1632
+ "div",
1633
+ {
1634
+ role: "rowgroup",
1635
+ className: cn("bg-neutral-soft", t),
1636
+ ...r,
1637
+ ref: s,
1638
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1639
+ "div",
1640
+ {
1641
+ role: "row",
1642
+ className: cn("grid gap-4", getTableColumnClass(o)),
1643
+ children: e
1644
+ }
1645
+ )
1646
+ }
1647
+ );
1648
+ }
1649
+ ), TableRow = forwardRef(
1650
+ ({ children: e, className: t, ...r }, s) => {
1651
+ const { maxColumns: o } = useTableContext();
1652
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
1653
+ "div",
1654
+ {
1655
+ role: "row",
1656
+ className: cn(
1657
+ "grid gap-4",
1658
+ getTableColumnClass(o),
1659
+ "border-b border-border last:border-0",
1660
+ t
1661
+ ),
1662
+ ref: s,
1663
+ ...r,
1664
+ children: e
1665
+ }
1666
+ );
1667
+ }
1668
+ ), TableColumn = forwardRef(
1669
+ ({ as: e = "td", span: t, align: r = "left", children: s, className: o, ...n }, a) => {
1670
+ const i = e === "th" ? "columnheader" : "cell";
1671
+ let u = "text-left";
1672
+ return r === "center" ? u = "text-center" : r === "right" && (u = "text-right"), /* @__PURE__ */ jsxRuntimeExports.jsx(
1673
+ "div",
1674
+ {
1675
+ ref: a,
1676
+ role: i,
1677
+ className: cn(
1678
+ "px-4 py-2",
1679
+ "[&:not(:last-child)]:border-r [&:not(:last-child)]:border-border",
1680
+ getRowSpanClass(t),
1681
+ u,
1682
+ o
1683
+ ),
1684
+ ...n,
1685
+ children: s
1686
+ }
1687
+ );
1688
+ }
1689
+ ), TableRoot = forwardRef(
1690
+ ({ children: e, className: t, maxColumns: r = 12, ...s }, o) => {
1691
+ const n = useMemo(
1692
+ () => ({ maxColumns: r }),
1693
+ [r]
1694
+ );
1695
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(TableProvider, { value: n, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1696
+ "div",
1697
+ {
1698
+ ref: o,
1699
+ role: "table",
1700
+ className: cn(
1701
+ "w-full overflow-x-auto rounded-lg border border-border",
1702
+ t
1703
+ ),
1704
+ ...s,
1705
+ children: e
1706
+ }
1707
+ ) });
1708
+ }
1709
+ ), Table = Object.assign(TableRoot, {
1710
+ Header: TableHeader,
1711
+ Body: TableBody,
1712
+ Footer: TableFooter,
1713
+ Row: TableRow,
1714
+ Column: TableColumn
1715
+ }), tileVariants = cva(
1716
+ // Base classes
1717
+ "block transition-colors duration-200",
1718
+ {
1719
+ variants: {
1720
+ variant: {
1721
+ white: "bg-white border border-border",
1722
+ neutral: "bg-neutral border border-gray-200",
1723
+ primary: "bg-primary-soft border border-primary",
1724
+ secondary: "bg-secondary-soft border border-secondary",
1725
+ tertiary: "bg-tertiary-soft border border-tertiary",
1726
+ ghost: "bg-transparent border border-ghost",
1727
+ success: "bg-success-soft border border-success",
1728
+ info: "bg-info-soft border border-info",
1729
+ warning: "bg-warning-soft border border-warning",
1730
+ danger: "bg-danger-soft border border-danger"
1731
+ },
1732
+ size: {
1733
+ xs: "p-2",
1734
+ sm: "p-3",
1735
+ md: "p-4",
1736
+ lg: "p-6",
1737
+ xl: "p-8"
1738
+ },
1739
+ shape: {
1740
+ rounded: "rounded-lg",
1741
+ square: "rounded-none"
1742
+ }
1743
+ },
1744
+ defaultVariants: {
1745
+ variant: "white",
1746
+ size: "md",
1747
+ shape: "rounded"
1748
+ }
1749
+ }
1750
+ ), Tile = forwardRef(
1751
+ ({ variant: e = "white", size: t = "md", shape: r = "rounded", className: s, ...o }, n) => /* @__PURE__ */ jsxRuntimeExports.jsx(
1752
+ "div",
1753
+ {
1754
+ ref: n,
1755
+ className: cn(tileVariants({ variant: e, size: t, shape: r }), s),
1756
+ ...o
1757
+ }
1758
+ )
1759
+ );
1760
+ export {
1761
+ Alert as A,
1762
+ Badge as B,
1763
+ Calculator as C,
1764
+ Icon as I,
1765
+ Snackbar as S,
1766
+ Table as T,
1767
+ Anchor as a,
1768
+ Avatar as b,
1769
+ Brand as c,
1770
+ Button as d,
1771
+ ButtonFloat as e,
1772
+ ButtonIcon as f,
1773
+ Calendar as g,
1774
+ Text as h,
1775
+ Tile as i
1776
+ };