@uxuissk/design-system 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1972 @@
1
+ import { jsx as t, jsxs as a, Fragment as xe } from "react/jsx-runtime";
2
+ import Xe, { forwardRef as Z, createElement as me, useState as M, useCallback as J, useRef as G, useContext as Ze, createContext as Qe, useEffect as X, useMemo as ee } from "react";
3
+ /**
4
+ * @license lucide-react v0.487.0 - ISC
5
+ *
6
+ * This source code is licensed under the ISC license.
7
+ * See the LICENSE file in the root directory of this source tree.
8
+ */
9
+ const Pe = (r) => r.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Ve = (r) => r.replace(
10
+ /^([A-Z])|[\s-_]+(\w)/g,
11
+ (e, n, o) => o ? o.toUpperCase() : n.toLowerCase()
12
+ ), we = (r) => {
13
+ const e = Ve(r);
14
+ return e.charAt(0).toUpperCase() + e.slice(1);
15
+ }, ze = (...r) => r.filter((e, n, o) => !!e && e.trim() !== "" && o.indexOf(e) === n).join(" ").trim();
16
+ /**
17
+ * @license lucide-react v0.487.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */
22
+ var et = {
23
+ xmlns: "http://www.w3.org/2000/svg",
24
+ width: 24,
25
+ height: 24,
26
+ viewBox: "0 0 24 24",
27
+ fill: "none",
28
+ stroke: "currentColor",
29
+ strokeWidth: 2,
30
+ strokeLinecap: "round",
31
+ strokeLinejoin: "round"
32
+ };
33
+ /**
34
+ * @license lucide-react v0.487.0 - ISC
35
+ *
36
+ * This source code is licensed under the ISC license.
37
+ * See the LICENSE file in the root directory of this source tree.
38
+ */
39
+ const tt = Z(
40
+ ({
41
+ color: r = "currentColor",
42
+ size: e = 24,
43
+ strokeWidth: n = 2,
44
+ absoluteStrokeWidth: o,
45
+ className: s = "",
46
+ children: l,
47
+ iconNode: d,
48
+ ...f
49
+ }, c) => me(
50
+ "svg",
51
+ {
52
+ ref: c,
53
+ ...et,
54
+ width: e,
55
+ height: e,
56
+ stroke: r,
57
+ strokeWidth: o ? Number(n) * 24 / Number(e) : n,
58
+ className: ze("lucide", s),
59
+ ...f
60
+ },
61
+ [
62
+ ...d.map(([h, u]) => me(h, u)),
63
+ ...Array.isArray(l) ? l : [l]
64
+ ]
65
+ )
66
+ );
67
+ /**
68
+ * @license lucide-react v0.487.0 - ISC
69
+ *
70
+ * This source code is licensed under the ISC license.
71
+ * See the LICENSE file in the root directory of this source tree.
72
+ */
73
+ const j = (r, e) => {
74
+ const n = Z(
75
+ ({ className: o, ...s }, l) => me(tt, {
76
+ ref: l,
77
+ iconNode: e,
78
+ className: ze(
79
+ `lucide-${Pe(we(r))}`,
80
+ `lucide-${r}`,
81
+ o
82
+ ),
83
+ ...s
84
+ })
85
+ );
86
+ return n.displayName = we(r), n;
87
+ };
88
+ /**
89
+ * @license lucide-react v0.487.0 - ISC
90
+ *
91
+ * This source code is licensed under the ISC license.
92
+ * See the LICENSE file in the root directory of this source tree.
93
+ */
94
+ const rt = [
95
+ ["path", { d: "M8 2v4", key: "1cmpym" }],
96
+ ["path", { d: "M16 2v4", key: "4m81vk" }],
97
+ ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
98
+ ["path", { d: "M3 10h18", key: "8toen8" }]
99
+ ], nt = j("calendar", rt);
100
+ /**
101
+ * @license lucide-react v0.487.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */
106
+ const ot = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], st = j("check", ot);
107
+ /**
108
+ * @license lucide-react v0.487.0 - ISC
109
+ *
110
+ * This source code is licensed under the ISC license.
111
+ * See the LICENSE file in the root directory of this source tree.
112
+ */
113
+ const it = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], at = j("chevron-down", it);
114
+ /**
115
+ * @license lucide-react v0.487.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */
120
+ const lt = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], be = j("chevron-left", lt);
121
+ /**
122
+ * @license lucide-react v0.487.0 - ISC
123
+ *
124
+ * This source code is licensed under the ISC license.
125
+ * See the LICENSE file in the root directory of this source tree.
126
+ */
127
+ const ct = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], he = j("chevron-right", ct);
128
+ /**
129
+ * @license lucide-react v0.487.0 - ISC
130
+ *
131
+ * This source code is licensed under the ISC license.
132
+ * See the LICENSE file in the root directory of this source tree.
133
+ */
134
+ const dt = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]], ut = j("chevron-up", dt);
135
+ /**
136
+ * @license lucide-react v0.487.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */
141
+ const ft = [
142
+ ["path", { d: "m11 17-5-5 5-5", key: "13zhaf" }],
143
+ ["path", { d: "m18 17-5-5 5-5", key: "h8a8et" }]
144
+ ], Fe = j("chevrons-left", ft);
145
+ /**
146
+ * @license lucide-react v0.487.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */
151
+ const mt = [
152
+ ["path", { d: "m6 17 5-5-5-5", key: "xnjwq" }],
153
+ ["path", { d: "m13 17 5-5-5-5", key: "17xmmf" }]
154
+ ], We = j("chevrons-right", mt);
155
+ /**
156
+ * @license lucide-react v0.487.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */
161
+ const bt = [
162
+ ["path", { d: "m7 15 5 5 5-5", key: "1hf1tw" }],
163
+ ["path", { d: "m7 9 5-5 5 5", key: "sgt6xg" }]
164
+ ], ht = j("chevrons-up-down", bt);
165
+ /**
166
+ * @license lucide-react v0.487.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */
171
+ const pt = [
172
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
173
+ ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
174
+ ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
175
+ ], pe = j("circle-alert", pt);
176
+ /**
177
+ * @license lucide-react v0.487.0 - ISC
178
+ *
179
+ * This source code is licensed under the ISC license.
180
+ * See the LICENSE file in the root directory of this source tree.
181
+ */
182
+ const vt = [
183
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
184
+ ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
185
+ ], se = j("circle-check", vt);
186
+ /**
187
+ * @license lucide-react v0.487.0 - ISC
188
+ *
189
+ * This source code is licensed under the ISC license.
190
+ * See the LICENSE file in the root directory of this source tree.
191
+ */
192
+ const gt = [
193
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
194
+ ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
195
+ ["path", { d: "m9 9 6 6", key: "z0biqf" }]
196
+ ], yt = j("circle-x", gt);
197
+ /**
198
+ * @license lucide-react v0.487.0 - ISC
199
+ *
200
+ * This source code is licensed under the ISC license.
201
+ * See the LICENSE file in the root directory of this source tree.
202
+ */
203
+ const xt = [
204
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
205
+ ["polyline", { points: "12 6 12 12 16 14", key: "68esgv" }]
206
+ ], wt = j("clock", xt);
207
+ /**
208
+ * @license lucide-react v0.487.0 - ISC
209
+ *
210
+ * This source code is licensed under the ISC license.
211
+ * See the LICENSE file in the root directory of this source tree.
212
+ */
213
+ const Nt = [
214
+ ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
215
+ ["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
216
+ ["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
217
+ ], kt = j("ellipsis", Nt);
218
+ /**
219
+ * @license lucide-react v0.487.0 - ISC
220
+ *
221
+ * This source code is licensed under the ISC license.
222
+ * See the LICENSE file in the root directory of this source tree.
223
+ */
224
+ const $t = [
225
+ [
226
+ "path",
227
+ {
228
+ d: "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",
229
+ key: "ct8e1f"
230
+ }
231
+ ],
232
+ ["path", { d: "M14.084 14.158a3 3 0 0 1-4.242-4.242", key: "151rxh" }],
233
+ [
234
+ "path",
235
+ {
236
+ d: "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",
237
+ key: "13bj9a"
238
+ }
239
+ ],
240
+ ["path", { d: "m2 2 20 20", key: "1ooewy" }]
241
+ ], St = j("eye-off", $t);
242
+ /**
243
+ * @license lucide-react v0.487.0 - ISC
244
+ *
245
+ * This source code is licensed under the ISC license.
246
+ * See the LICENSE file in the root directory of this source tree.
247
+ */
248
+ const zt = [
249
+ [
250
+ "path",
251
+ {
252
+ d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",
253
+ key: "1nclc0"
254
+ }
255
+ ],
256
+ ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
257
+ ], Ft = j("eye", zt);
258
+ /**
259
+ * @license lucide-react v0.487.0 - ISC
260
+ *
261
+ * This source code is licensed under the ISC license.
262
+ * See the LICENSE file in the root directory of this source tree.
263
+ */
264
+ const Wt = [
265
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
266
+ ["path", { d: "M12 16v-4", key: "1dtifu" }],
267
+ ["path", { d: "M12 8h.01", key: "e9boi3" }]
268
+ ], Mt = j("info", Wt);
269
+ /**
270
+ * @license lucide-react v0.487.0 - ISC
271
+ *
272
+ * This source code is licensed under the ISC license.
273
+ * See the LICENSE file in the root directory of this source tree.
274
+ */
275
+ const Dt = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], ve = j("loader-circle", Dt);
276
+ /**
277
+ * @license lucide-react v0.487.0 - ISC
278
+ *
279
+ * This source code is licensed under the ISC license.
280
+ * See the LICENSE file in the root directory of this source tree.
281
+ */
282
+ const _t = [["path", { d: "M5 12h14", key: "1ays0h" }]], jt = j("minus", _t);
283
+ /**
284
+ * @license lucide-react v0.487.0 - ISC
285
+ *
286
+ * This source code is licensed under the ISC license.
287
+ * See the LICENSE file in the root directory of this source tree.
288
+ */
289
+ const Ct = [
290
+ ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
291
+ ["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
292
+ ], At = j("search", Ct);
293
+ /**
294
+ * @license lucide-react v0.487.0 - ISC
295
+ *
296
+ * This source code is licensed under the ISC license.
297
+ * See the LICENSE file in the root directory of this source tree.
298
+ */
299
+ const Yt = [
300
+ [
301
+ "path",
302
+ {
303
+ d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
304
+ key: "wmoenq"
305
+ }
306
+ ],
307
+ ["path", { d: "M12 9v4", key: "juzpu7" }],
308
+ ["path", { d: "M12 17h.01", key: "p32p05" }]
309
+ ], It = j("triangle-alert", Yt);
310
+ /**
311
+ * @license lucide-react v0.487.0 - ISC
312
+ *
313
+ * This source code is licensed under the ISC license.
314
+ * See the LICENSE file in the root directory of this source tree.
315
+ */
316
+ const Tt = [
317
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
318
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
319
+ ], Q = j("x", Tt), Et = {
320
+ sm: "h-8 px-3 gap-1.5",
321
+ md: "h-10 px-4 gap-2",
322
+ lg: "h-12 px-6 gap-2.5",
323
+ xl: "h-14 px-8 gap-3"
324
+ }, Lt = {
325
+ sm: { fontFamily: "var(--font-button)", fontSize: "calc(var(--text-button) * 0.9)", fontWeight: "var(--weight-button)" },
326
+ md: { fontFamily: "var(--font-button)", fontSize: "var(--text-button)", fontWeight: "var(--weight-button)" },
327
+ lg: { fontFamily: "var(--font-button)", fontSize: "calc(var(--text-button) * 1.1)", fontWeight: "var(--weight-button)" },
328
+ xl: { fontFamily: "var(--font-button)", fontSize: "calc(var(--text-button) * 1.2)", fontWeight: "var(--weight-button)" }
329
+ }, Me = {
330
+ sm: 14,
331
+ md: 16,
332
+ lg: 18,
333
+ xl: 20
334
+ }, De = {
335
+ primary: "bg-primary text-primary-foreground border border-primary hover:bg-primary/90 active:bg-primary/80 shadow-elevation-sm",
336
+ secondary: "bg-secondary text-secondary-foreground border border-secondary hover:bg-secondary/90 active:bg-secondary/80 shadow-elevation-sm",
337
+ outline: "bg-transparent text-foreground border border-border hover:bg-muted active:bg-muted/80",
338
+ ghost: "bg-transparent text-foreground border border-transparent hover:bg-muted active:bg-muted/80",
339
+ destructive: "bg-destructive text-destructive-foreground border border-destructive hover:bg-destructive/90 active:bg-destructive/80 shadow-elevation-sm",
340
+ link: "bg-transparent text-primary border border-transparent underline-offset-4 hover:underline px-0 h-auto"
341
+ }, Bt = Z(
342
+ ({
343
+ variant: r = "primary",
344
+ size: e = "md",
345
+ loading: n = !1,
346
+ loadingText: o,
347
+ leftIcon: s,
348
+ rightIcon: l,
349
+ fullWidth: d = !1,
350
+ active: f = !1,
351
+ disabled: c,
352
+ children: h,
353
+ className: u = "",
354
+ ...w
355
+ }, y) => {
356
+ const m = c || n;
357
+ return /* @__PURE__ */ t(
358
+ "button",
359
+ {
360
+ ref: y,
361
+ disabled: m,
362
+ className: `inline-flex items-center justify-center rounded-[var(--radius-md)] transition-all duration-150
363
+ ${Et[e]}
364
+ ${De[r]}
365
+ ${d ? "w-full" : ""}
366
+ ${f ? "ring-2 ring-ring/30" : ""}
367
+ ${m ? "opacity-50 cursor-not-allowed pointer-events-none" : "cursor-pointer active:scale-[0.98]"}
368
+ focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40
369
+ ${u}
370
+ `,
371
+ style: Lt[e],
372
+ ...w,
373
+ children: n ? /* @__PURE__ */ a(xe, { children: [
374
+ /* @__PURE__ */ t(ve, { size: Me[e], className: "animate-spin flex-shrink-0" }),
375
+ o && /* @__PURE__ */ t("span", { children: o })
376
+ ] }) : /* @__PURE__ */ a(xe, { children: [
377
+ s && /* @__PURE__ */ t("span", { className: "flex-shrink-0", children: s }),
378
+ h && /* @__PURE__ */ t("span", { children: h }),
379
+ l && /* @__PURE__ */ t("span", { className: "flex-shrink-0", children: l })
380
+ ] })
381
+ }
382
+ );
383
+ }
384
+ );
385
+ Bt.displayName = "DSButton";
386
+ const Ht = Z(
387
+ ({
388
+ variant: r = "ghost",
389
+ size: e = "md",
390
+ loading: n = !1,
391
+ icon: o,
392
+ disabled: s,
393
+ className: l = "",
394
+ ...d
395
+ }, f) => {
396
+ const c = s || n;
397
+ return /* @__PURE__ */ t(
398
+ "button",
399
+ {
400
+ ref: f,
401
+ disabled: c,
402
+ className: `inline-flex items-center justify-center rounded-[var(--radius-md)] transition-all duration-150
403
+ ${{
404
+ sm: "w-8 h-8",
405
+ md: "w-10 h-10",
406
+ lg: "w-12 h-12",
407
+ xl: "w-14 h-14"
408
+ }[e]}
409
+ ${De[r]}
410
+ ${c ? "opacity-50 cursor-not-allowed pointer-events-none" : "cursor-pointer active:scale-[0.98]"}
411
+ focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40
412
+ ${l}
413
+ `,
414
+ ...d,
415
+ children: n ? /* @__PURE__ */ t(ve, { size: Me[e], className: "animate-spin" }) : o
416
+ }
417
+ );
418
+ }
419
+ );
420
+ Ht.displayName = "IconButton";
421
+ function fr({
422
+ children: r,
423
+ className: e = ""
424
+ }) {
425
+ return /* @__PURE__ */ t(
426
+ "div",
427
+ {
428
+ className: `inline-flex [&>button]:rounded-none [&>button:first-child]:rounded-l-[var(--radius-md)] [&>button:last-child]:rounded-r-[var(--radius-md)] [&>button:not(:last-child)]:border-r-0 ${e}`,
429
+ children: r
430
+ }
431
+ );
432
+ }
433
+ const _e = {
434
+ sm: {
435
+ wrapper: "h-9 px-2.5 gap-1.5",
436
+ textStyle: { fontFamily: "var(--font-label)", fontSize: "var(--text-label)", fontWeight: "var(--weight-label)" },
437
+ icon: 14
438
+ },
439
+ md: {
440
+ wrapper: "h-11 px-3 gap-2",
441
+ textStyle: { fontFamily: "var(--font-caption)", fontSize: "var(--text-caption)", fontWeight: "var(--weight-caption)" },
442
+ icon: 16
443
+ },
444
+ lg: {
445
+ wrapper: "h-13 px-4 gap-2.5",
446
+ textStyle: { fontFamily: "var(--font-p)", fontSize: "var(--text-p)", fontWeight: "var(--weight-p)" },
447
+ icon: 18
448
+ }
449
+ }, je = {
450
+ default: {
451
+ base: "border border-border bg-input-background",
452
+ hover: "hover:border-foreground/30",
453
+ focus: "ring-2 ring-ring/20 border-ring"
454
+ },
455
+ outlined: {
456
+ base: "border-2 border-border bg-transparent",
457
+ hover: "hover:border-foreground/40",
458
+ focus: "ring-2 ring-ring/20 border-ring"
459
+ },
460
+ filled: {
461
+ base: "border border-transparent bg-muted",
462
+ hover: "hover:bg-muted/80",
463
+ focus: "ring-2 ring-ring/20 border-ring bg-input-background"
464
+ },
465
+ ghost: {
466
+ base: "border border-transparent bg-transparent",
467
+ hover: "hover:bg-muted/50",
468
+ focus: "ring-2 ring-ring/20 bg-input-background"
469
+ }
470
+ }, Ce = {
471
+ default: "",
472
+ error: "!border-destructive ring-destructive/20",
473
+ success: "!border-chart-2 ring-chart-2/20",
474
+ warning: "!border-chart-5 ring-chart-5/20"
475
+ }, oe = {
476
+ fontFamily: "var(--font-label)",
477
+ fontSize: "var(--text-label)",
478
+ fontWeight: "var(--weight-label)"
479
+ }, qt = Z(
480
+ ({
481
+ label: r,
482
+ helperText: e,
483
+ errorMessage: n,
484
+ successMessage: o,
485
+ inputSize: s = "md",
486
+ variant: l = "default",
487
+ state: d = "default",
488
+ leftIcon: f,
489
+ rightIcon: c,
490
+ prefix: h,
491
+ suffix: u,
492
+ clearable: w = !1,
493
+ showPasswordToggle: y = !1,
494
+ loading: m = !1,
495
+ fullWidth: D = !0,
496
+ required: _ = !1,
497
+ onClear: $,
498
+ disabled: S,
499
+ type: F = "text",
500
+ value: x,
501
+ defaultValue: b,
502
+ onChange: N,
503
+ className: z = "",
504
+ ...C
505
+ }, A) => {
506
+ const [p, g] = M(!1), [Y, T] = M(!1), [i, k] = M(b ?? ""), E = x !== void 0 ? x : i, I = _e[s], H = je[l], R = n ? "error" : d, K = F === "password", q = K && Y ? "text" : F, te = J(
507
+ (re) => {
508
+ k(re.target.value), N == null || N(re);
509
+ },
510
+ [N]
511
+ ), ie = J(() => {
512
+ k(""), $ == null || $();
513
+ }, [$]), ae = String(E).length > 0;
514
+ return /* @__PURE__ */ a("div", { className: `${D ? "w-full" : "inline-flex flex-col"} ${z}`, children: [
515
+ r && /* @__PURE__ */ a("label", { className: "block mb-1.5 text-foreground", children: [
516
+ r,
517
+ _ && /* @__PURE__ */ t("span", { className: "text-destructive ml-0.5", children: "*" })
518
+ ] }),
519
+ /* @__PURE__ */ a(
520
+ "div",
521
+ {
522
+ className: `flex items-center rounded-[var(--radius-md)] transition-all duration-150
523
+ ${I.wrapper}
524
+ ${H.base}
525
+ ${S ? "" : H.hover}
526
+ ${p && !S ? H.focus : ""}
527
+ ${S ? "opacity-50 cursor-not-allowed" : ""}
528
+ ${Ce[R]}
529
+ `,
530
+ children: [
531
+ f && /* @__PURE__ */ t("span", { className: "flex-shrink-0 text-muted-foreground", children: f }),
532
+ h && /* @__PURE__ */ t("span", { className: "flex-shrink-0 text-muted-foreground", style: oe, children: h }),
533
+ /* @__PURE__ */ t(
534
+ "input",
535
+ {
536
+ ref: A,
537
+ type: q,
538
+ disabled: S || m,
539
+ value: E,
540
+ onChange: te,
541
+ onFocus: () => g(!0),
542
+ onBlur: () => g(!1),
543
+ className: "flex-1 min-w-0 bg-transparent border-none outline-none text-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed",
544
+ style: I.textStyle,
545
+ ...C
546
+ }
547
+ ),
548
+ u && /* @__PURE__ */ t("span", { className: "flex-shrink-0 text-muted-foreground", style: oe, children: u }),
549
+ w && ae && !S && /* @__PURE__ */ t(
550
+ "button",
551
+ {
552
+ type: "button",
553
+ onClick: ie,
554
+ className: "flex-shrink-0 text-muted-foreground hover:text-foreground transition-colors cursor-pointer p-0.5",
555
+ children: /* @__PURE__ */ t(Q, { size: I.icon - 2 })
556
+ }
557
+ ),
558
+ K && y && /* @__PURE__ */ t(
559
+ "button",
560
+ {
561
+ type: "button",
562
+ onClick: () => T(!Y),
563
+ className: "flex-shrink-0 text-muted-foreground hover:text-foreground transition-colors cursor-pointer p-0.5",
564
+ children: Y ? /* @__PURE__ */ t(St, { size: I.icon }) : /* @__PURE__ */ t(Ft, { size: I.icon })
565
+ }
566
+ ),
567
+ c && !K && /* @__PURE__ */ t("span", { className: "flex-shrink-0 text-muted-foreground", children: c }),
568
+ m && /* @__PURE__ */ t("span", { className: "flex-shrink-0", children: /* @__PURE__ */ t("span", { className: "block w-4 h-4 border-2 border-muted-foreground border-t-transparent rounded-full animate-spin" }) })
569
+ ]
570
+ }
571
+ ),
572
+ (e || n || o) && /* @__PURE__ */ a("div", { className: "mt-1.5 flex items-center gap-1", children: [
573
+ R === "error" && /* @__PURE__ */ t(pe, { size: 12, className: "text-destructive flex-shrink-0" }),
574
+ R === "success" && /* @__PURE__ */ t(se, { size: 12, className: "text-chart-2 flex-shrink-0" }),
575
+ /* @__PURE__ */ t(
576
+ "span",
577
+ {
578
+ className: `${R === "error" ? "text-destructive" : R === "success" ? "text-chart-2" : "text-muted-foreground"}`,
579
+ style: oe,
580
+ children: n || o || e
581
+ }
582
+ )
583
+ ] })
584
+ ] });
585
+ }
586
+ );
587
+ qt.displayName = "DSInput";
588
+ const Rt = Z(
589
+ ({
590
+ label: r,
591
+ helperText: e,
592
+ errorMessage: n,
593
+ successMessage: o,
594
+ inputSize: s = "md",
595
+ variant: l = "default",
596
+ state: d = "default",
597
+ showCharCount: f = !1,
598
+ maxLength: c,
599
+ required: h = !1,
600
+ disabled: u,
601
+ value: w,
602
+ defaultValue: y,
603
+ onChange: m,
604
+ className: D = "",
605
+ ..._
606
+ }, $) => {
607
+ const [S, F] = M(!1), [x, b] = M(String(y ?? "").length), N = _e[s], z = je[l], C = n ? "error" : d, A = J(
608
+ (p) => {
609
+ b(p.target.value.length), m == null || m(p);
610
+ },
611
+ [m]
612
+ );
613
+ return /* @__PURE__ */ a("div", { className: `w-full ${D}`, children: [
614
+ r && /* @__PURE__ */ a("label", { className: "block mb-1.5 text-foreground", children: [
615
+ r,
616
+ h && /* @__PURE__ */ t("span", { className: "text-destructive ml-0.5", children: "*" })
617
+ ] }),
618
+ /* @__PURE__ */ a(
619
+ "div",
620
+ {
621
+ className: `transition-all duration-150 overflow-hidden rounded-[var(--radius-md)]
622
+ ${z.base}
623
+ ${u ? "" : z.hover}
624
+ ${S && !u ? z.focus : ""}
625
+ ${u ? "opacity-50 cursor-not-allowed" : ""}
626
+ ${Ce[C]}
627
+ `,
628
+ children: [
629
+ /* @__PURE__ */ t(
630
+ "textarea",
631
+ {
632
+ ref: $,
633
+ disabled: u,
634
+ value: w,
635
+ defaultValue: y,
636
+ maxLength: c,
637
+ onChange: A,
638
+ onFocus: () => F(!0),
639
+ onBlur: () => F(!1),
640
+ className: "w-full min-h-[100px] px-3 py-2.5 bg-transparent border-none outline-none text-foreground placeholder:text-muted-foreground resize-y disabled:cursor-not-allowed",
641
+ style: N.textStyle,
642
+ ..._
643
+ }
644
+ ),
645
+ f && /* @__PURE__ */ a(
646
+ "div",
647
+ {
648
+ className: "flex justify-end px-3 py-1.5 border-t border-border text-muted-foreground bg-muted/20",
649
+ style: { fontFamily: "var(--font-label)", fontSize: "calc(var(--text-label) * 0.85)", fontWeight: "var(--weight-label)" },
650
+ children: [
651
+ x,
652
+ c ? ` / ${c}` : "",
653
+ " chars"
654
+ ]
655
+ }
656
+ )
657
+ ]
658
+ }
659
+ ),
660
+ (e || n || o) && /* @__PURE__ */ a("div", { className: "mt-1.5 flex items-center gap-1", children: [
661
+ C === "error" && /* @__PURE__ */ t(pe, { size: 12, className: "text-destructive flex-shrink-0" }),
662
+ C === "success" && /* @__PURE__ */ t(se, { size: 12, className: "text-chart-2 flex-shrink-0" }),
663
+ /* @__PURE__ */ t(
664
+ "span",
665
+ {
666
+ className: `${C === "error" ? "text-destructive" : C === "success" ? "text-chart-2" : "text-muted-foreground"}`,
667
+ style: oe,
668
+ children: n || o || e
669
+ }
670
+ )
671
+ ] })
672
+ ] });
673
+ }
674
+ );
675
+ Rt.displayName = "DSTextarea";
676
+ const Kt = {
677
+ info: { bg: "bg-primary/5", border: "border-primary/30", text: "text-primary", icon: /* @__PURE__ */ t(Mt, { size: 18 }) },
678
+ success: { bg: "bg-chart-2/5", border: "border-chart-2/30", text: "text-chart-2", icon: /* @__PURE__ */ t(se, { size: 18 }) },
679
+ warning: { bg: "bg-chart-5/5", border: "border-chart-5/30", text: "text-chart-5", icon: /* @__PURE__ */ t(It, { size: 18 }) },
680
+ error: { bg: "bg-destructive/5", border: "border-destructive/30", text: "text-destructive", icon: /* @__PURE__ */ t(yt, { size: 18 }) }
681
+ };
682
+ function Gt({ variant: r = "info", title: e, children: n, dismissible: o = !1, onDismiss: s, action: l, icon: d, className: f = "" }) {
683
+ const [c, h] = M(!0), u = Kt[r];
684
+ if (!c) return null;
685
+ const w = () => {
686
+ h(!1), s == null || s();
687
+ };
688
+ return /* @__PURE__ */ a("div", { className: `flex gap-3 p-4 rounded-[var(--radius)] border ${u.bg} ${u.border} ${f}`, role: "alert", children: [
689
+ /* @__PURE__ */ t("span", { className: `flex-shrink-0 mt-0.5 ${u.text}`, children: d ?? u.icon }),
690
+ /* @__PURE__ */ a("div", { className: "flex-1 min-w-0", children: [
691
+ e && /* @__PURE__ */ t("span", { className: `block ${u.text}`, style: { fontFamily: "var(--font-label)", fontSize: "var(--text-label)", fontWeight: "var(--weight-button)" }, children: e }),
692
+ /* @__PURE__ */ t("span", { className: "text-foreground block", style: { fontFamily: "var(--font-label)", fontSize: "calc(var(--text-label) * 0.9)", fontWeight: "var(--weight-label)" }, children: n }),
693
+ l && /* @__PURE__ */ t("div", { className: "mt-2", children: l })
694
+ ] }),
695
+ o && /* @__PURE__ */ t("button", { onClick: w, className: "flex-shrink-0 text-muted-foreground hover:text-foreground transition-colors cursor-pointer", "aria-label": "Dismiss", children: /* @__PURE__ */ t(Q, { size: 16 }) })
696
+ ] });
697
+ }
698
+ let Ae = [], P = [];
699
+ function Ne() {
700
+ Ae.forEach((r) => r([...P]));
701
+ }
702
+ const U = {
703
+ show: (r) => {
704
+ const e = { ...r, id: `toast-${Date.now()}-${Math.random().toString(36).slice(2)}` };
705
+ P = [...P, e], Ne(), setTimeout(() => {
706
+ U.dismiss(e.id);
707
+ }, r.duration ?? 4e3);
708
+ },
709
+ info: (r, e) => U.show({ variant: "info", message: r, title: e }),
710
+ success: (r, e) => U.show({ variant: "success", message: r, title: e }),
711
+ warning: (r, e) => U.show({ variant: "warning", message: r, title: e }),
712
+ error: (r, e) => U.show({ variant: "error", message: r, title: e }),
713
+ dismiss: (r) => {
714
+ P = P.filter((e) => e.id !== r), Ne();
715
+ }
716
+ };
717
+ function mr() {
718
+ const [r, e] = M([]), n = G(!1);
719
+ return n.current || (n.current = !0, Ae.push(e)), r.length === 0 ? null : /* @__PURE__ */ t("div", { className: "fixed bottom-4 right-4 z-[200] flex flex-col gap-2 max-w-sm w-full pointer-events-none", children: r.map((o) => /* @__PURE__ */ t("div", { className: "pointer-events-auto animate-in slide-in-from-right fade-in duration-300", children: /* @__PURE__ */ t(Gt, { variant: o.variant, title: o.title, dismissible: !0, onDismiss: () => U.dismiss(o.id), children: o.message }) }, o.id)) });
720
+ }
721
+ const Ot = {
722
+ default: "bg-primary text-primary-foreground",
723
+ secondary: "bg-secondary/15 text-secondary",
724
+ outline: "bg-transparent border border-border text-foreground",
725
+ destructive: "bg-destructive/15 text-destructive",
726
+ success: "bg-chart-2/15 text-chart-2",
727
+ warning: "bg-chart-5/15 text-chart-5"
728
+ }, Ut = {
729
+ sm: {
730
+ className: "px-1.5 py-0.5 gap-1",
731
+ style: {
732
+ fontFamily: "var(--font-button)",
733
+ fontSize: "calc(var(--text-button) * 0.72)",
734
+ fontWeight: "var(--weight-button)"
735
+ },
736
+ iconSize: 10
737
+ },
738
+ md: {
739
+ className: "px-2.5 py-0.5 gap-1.5",
740
+ style: {
741
+ fontFamily: "var(--font-button)",
742
+ fontSize: "calc(var(--text-button) * 0.85)",
743
+ fontWeight: "var(--weight-button)"
744
+ },
745
+ iconSize: 12
746
+ },
747
+ lg: {
748
+ className: "px-3 py-1 gap-1.5",
749
+ style: {
750
+ fontFamily: "var(--font-button)",
751
+ fontSize: "var(--text-button)",
752
+ fontWeight: "var(--weight-button)"
753
+ },
754
+ iconSize: 14
755
+ }
756
+ }, Jt = {
757
+ default: "bg-primary-foreground",
758
+ secondary: "bg-secondary",
759
+ outline: "bg-foreground",
760
+ destructive: "bg-destructive",
761
+ success: "bg-chart-2",
762
+ warning: "bg-chart-5"
763
+ };
764
+ function br({
765
+ children: r,
766
+ variant: e = "default",
767
+ size: n = "md",
768
+ icon: o,
769
+ dot: s,
770
+ removable: l,
771
+ onRemove: d,
772
+ className: f = ""
773
+ }) {
774
+ const c = Ut[n];
775
+ return /* @__PURE__ */ a(
776
+ "span",
777
+ {
778
+ className: `inline-flex items-center rounded-full whitespace-nowrap ${Ot[e]} ${c.className} ${f}`,
779
+ style: { ...c.style, lineHeight: "1.2" },
780
+ children: [
781
+ s && /* @__PURE__ */ t(
782
+ "span",
783
+ {
784
+ className: `w-1.5 h-1.5 rounded-full flex-shrink-0 ${Jt[e]}`
785
+ }
786
+ ),
787
+ o && /* @__PURE__ */ t("span", { className: "flex-shrink-0", children: o }),
788
+ /* @__PURE__ */ t("span", { children: r }),
789
+ l && /* @__PURE__ */ t(
790
+ "button",
791
+ {
792
+ onClick: d,
793
+ className: "flex-shrink-0 hover:opacity-70 transition-opacity cursor-pointer rounded-full -mr-0.5",
794
+ "aria-label": "Remove",
795
+ children: /* @__PURE__ */ t(Q, { size: c.iconSize })
796
+ }
797
+ )
798
+ ]
799
+ }
800
+ );
801
+ }
802
+ const Xt = {
803
+ sm: {
804
+ box: "w-4 h-4",
805
+ icon: 10,
806
+ labelStyle: { fontFamily: "var(--font-label)", fontSize: "calc(var(--text-label) * 0.85)", fontWeight: "var(--weight-label)" },
807
+ descStyle: { fontFamily: "var(--font-label)", fontSize: "calc(var(--text-label) * 0.75)", fontWeight: "var(--weight-label)" }
808
+ },
809
+ md: {
810
+ box: "w-5 h-5",
811
+ icon: 12,
812
+ labelStyle: { fontFamily: "var(--font-label)", fontSize: "var(--text-label)", fontWeight: "var(--weight-label)" },
813
+ descStyle: { fontFamily: "var(--font-label)", fontSize: "calc(var(--text-label) * 0.85)", fontWeight: "var(--weight-label)" }
814
+ },
815
+ lg: {
816
+ box: "w-6 h-6",
817
+ icon: 14,
818
+ labelStyle: { fontFamily: "var(--font-label)", fontSize: "calc(var(--text-label) * 1.1)", fontWeight: "var(--weight-label)" },
819
+ descStyle: { fontFamily: "var(--font-label)", fontSize: "var(--text-label)", fontWeight: "var(--weight-label)" }
820
+ }
821
+ };
822
+ function hr({
823
+ checked: r,
824
+ indeterminate: e = !1,
825
+ defaultChecked: n = !1,
826
+ onChange: o,
827
+ label: s,
828
+ description: l,
829
+ size: d = "md",
830
+ disabled: f = !1,
831
+ error: c,
832
+ className: h = "",
833
+ id: u
834
+ }) {
835
+ const [w, y] = M(n), m = r ?? w, D = Xt[d], _ = u ?? `cb-${Xe.useId()}`, $ = () => {
836
+ if (f) return;
837
+ const F = !m;
838
+ r === void 0 && y(F), o == null || o(F);
839
+ }, S = m || e;
840
+ return /* @__PURE__ */ a("div", { className: `inline-flex items-start gap-2.5 ${f ? "opacity-50" : ""} ${h}`, children: [
841
+ /* @__PURE__ */ t(
842
+ "button",
843
+ {
844
+ id: _,
845
+ role: "checkbox",
846
+ "aria-checked": e ? "mixed" : m,
847
+ disabled: f,
848
+ onClick: $,
849
+ className: `${D.box} flex-shrink-0 rounded-[var(--radius-sm)] border-2 transition-all flex items-center justify-center cursor-pointer mt-0.5
850
+ ${S ? "bg-primary border-primary text-primary-foreground" : c ? "border-destructive bg-card" : "border-border bg-card hover:border-primary/50"}
851
+ ${f ? "!cursor-not-allowed" : ""}
852
+ focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 outline-none`,
853
+ children: e ? /* @__PURE__ */ t(jt, { size: D.icon, strokeWidth: 3 }) : m ? /* @__PURE__ */ t(st, { size: D.icon, strokeWidth: 3 }) : null
854
+ }
855
+ ),
856
+ (s || l) && /* @__PURE__ */ a("div", { className: "min-w-0", children: [
857
+ s && /* @__PURE__ */ t(
858
+ "label",
859
+ {
860
+ htmlFor: _,
861
+ className: `text-foreground block cursor-pointer ${f ? "!cursor-not-allowed" : ""}`,
862
+ style: D.labelStyle,
863
+ onClick: $,
864
+ children: s
865
+ }
866
+ ),
867
+ l && /* @__PURE__ */ t("span", { className: "text-muted-foreground block", style: D.descStyle, children: l }),
868
+ c && /* @__PURE__ */ t("span", { className: "text-destructive block mt-0.5", style: D.descStyle, children: c })
869
+ ] })
870
+ ] });
871
+ }
872
+ function pr({ label: r, children: e, direction: n = "vertical", className: o = "" }) {
873
+ return /* @__PURE__ */ a("fieldset", { className: `${o}`, children: [
874
+ r && /* @__PURE__ */ t("legend", { className: "text-foreground mb-2 block", style: { fontFamily: "var(--font-label)", fontSize: "var(--text-label)", fontWeight: "var(--weight-button)" }, children: r }),
875
+ /* @__PURE__ */ t("div", { className: `flex ${n === "vertical" ? "flex-col gap-3" : "flex-wrap gap-4"}`, children: e })
876
+ ] });
877
+ }
878
+ const Ye = Qe(null), Zt = {
879
+ sm: {
880
+ outer: "w-4 h-4",
881
+ inner: "w-1.5 h-1.5",
882
+ labelStyle: { fontFamily: "var(--font-label)", fontSize: "calc(var(--text-label) * 0.85)", fontWeight: "var(--weight-label)" },
883
+ descStyle: { fontFamily: "var(--font-label)", fontSize: "calc(var(--text-label) * 0.75)", fontWeight: "var(--weight-label)" }
884
+ },
885
+ md: {
886
+ outer: "w-5 h-5",
887
+ inner: "w-2 h-2",
888
+ labelStyle: { fontFamily: "var(--font-label)", fontSize: "var(--text-label)", fontWeight: "var(--weight-label)" },
889
+ descStyle: { fontFamily: "var(--font-label)", fontSize: "calc(var(--text-label) * 0.85)", fontWeight: "var(--weight-label)" }
890
+ },
891
+ lg: {
892
+ outer: "w-6 h-6",
893
+ inner: "w-2.5 h-2.5",
894
+ labelStyle: { fontFamily: "var(--font-label)", fontSize: "calc(var(--text-label) * 1.1)", fontWeight: "var(--weight-label)" },
895
+ descStyle: { fontFamily: "var(--font-label)", fontSize: "var(--text-label)", fontWeight: "var(--weight-label)" }
896
+ }
897
+ };
898
+ function vr({ value: r, label: e, description: n, disabled: o, size: s, className: l = "" }) {
899
+ const d = Ze(Ye), f = d ? d.value === r : !1, c = o ?? (d == null ? void 0 : d.disabled) ?? !1, h = s ?? (d == null ? void 0 : d.size) ?? "md", u = Zt[h], w = () => {
900
+ c || d == null || d.onChange(r);
901
+ };
902
+ return /* @__PURE__ */ a("div", { className: `inline-flex items-start gap-2.5 ${c ? "opacity-50" : ""} ${l}`, children: [
903
+ /* @__PURE__ */ t(
904
+ "button",
905
+ {
906
+ role: "radio",
907
+ "aria-checked": f,
908
+ disabled: c,
909
+ onClick: w,
910
+ className: `${u.outer} flex-shrink-0 rounded-full border-2 transition-all flex items-center justify-center cursor-pointer mt-0.5
911
+ ${f ? "border-primary" : "border-border hover:border-primary/50"}
912
+ ${c ? "!cursor-not-allowed" : ""}
913
+ focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 outline-none`,
914
+ children: f && /* @__PURE__ */ t("span", { className: `${u.inner} rounded-full bg-primary transition-transform scale-100` })
915
+ }
916
+ ),
917
+ (e || n) && /* @__PURE__ */ a("div", { className: "min-w-0", children: [
918
+ e && /* @__PURE__ */ t(
919
+ "span",
920
+ {
921
+ className: `text-foreground block cursor-pointer ${c ? "!cursor-not-allowed" : ""}`,
922
+ style: u.labelStyle,
923
+ onClick: w,
924
+ children: e
925
+ }
926
+ ),
927
+ n && /* @__PURE__ */ t("span", { className: "text-muted-foreground block", style: u.descStyle, children: n })
928
+ ] })
929
+ ] });
930
+ }
931
+ function gr({
932
+ name: r,
933
+ value: e,
934
+ defaultValue: n = "",
935
+ onChange: o,
936
+ label: s,
937
+ size: l = "md",
938
+ disabled: d = !1,
939
+ direction: f = "vertical",
940
+ children: c,
941
+ error: h,
942
+ className: u = ""
943
+ }) {
944
+ const [w, y] = M(n), m = e ?? w, D = (_) => {
945
+ e === void 0 && y(_), o == null || o(_);
946
+ };
947
+ return /* @__PURE__ */ t(Ye.Provider, { value: { value: m, onChange: D, size: l, disabled: d, name: r }, children: /* @__PURE__ */ a("fieldset", { className: u, role: "radiogroup", children: [
948
+ s && /* @__PURE__ */ t("legend", { className: "text-foreground mb-2 block", style: { fontFamily: "var(--font-label)", fontSize: "var(--text-label)", fontWeight: "var(--weight-button)" }, children: s }),
949
+ /* @__PURE__ */ t("div", { className: `flex ${f === "vertical" ? "flex-col gap-3" : "flex-wrap gap-4"}`, children: c }),
950
+ h && /* @__PURE__ */ t("span", { className: "text-destructive block mt-1.5", style: { fontFamily: "var(--font-label)", fontSize: "calc(var(--text-label) * 0.85)", fontWeight: "var(--weight-label)" }, children: h })
951
+ ] }) });
952
+ }
953
+ const Qt = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], fe = [
954
+ "January",
955
+ "February",
956
+ "March",
957
+ "April",
958
+ "May",
959
+ "June",
960
+ "July",
961
+ "August",
962
+ "September",
963
+ "October",
964
+ "November",
965
+ "December"
966
+ ];
967
+ function V(r, e) {
968
+ return r.getFullYear() === e.getFullYear() && r.getMonth() === e.getMonth() && r.getDate() === e.getDate();
969
+ }
970
+ function ke(r, e, n) {
971
+ if (!e || !n) return !1;
972
+ const o = r.getTime();
973
+ return o > e.getTime() && o < n.getTime();
974
+ }
975
+ function $e(r, e, n, o) {
976
+ return !!(e && r < new Date(e.getFullYear(), e.getMonth(), e.getDate()) || n && r > new Date(n.getFullYear(), n.getMonth(), n.getDate()) || o != null && o.some((s) => V(s, r)));
977
+ }
978
+ function Pt(r, e) {
979
+ return new Date(r, e + 1, 0).getDate();
980
+ }
981
+ function Se(r, e) {
982
+ const n = new Date(r, e, 1).getDay(), o = Pt(r, e), s = [];
983
+ for (let l = 0; l < n; l++) s.push(null);
984
+ for (let l = 1; l <= o; l++) s.push(new Date(r, e, l));
985
+ return s;
986
+ }
987
+ function ne(r, e) {
988
+ if (!r) return "";
989
+ const n = String(r.getDate()).padStart(2, "0"), o = String(r.getMonth() + 1).padStart(2, "0"), s = r.getFullYear();
990
+ let l = `${n}/${o}/${s}`;
991
+ if (e) {
992
+ const d = String(r.getHours()).padStart(2, "0"), f = String(r.getMinutes()).padStart(2, "0");
993
+ l += ` ${d}:${f}`;
994
+ }
995
+ return l;
996
+ }
997
+ const Vt = {
998
+ sm: {
999
+ trigger: "h-8 px-2.5",
1000
+ text: {
1001
+ fontFamily: "var(--font-label)",
1002
+ fontSize: "calc(var(--text-label) * 0.9)",
1003
+ fontWeight: "var(--weight-label)"
1004
+ },
1005
+ icon: 14,
1006
+ cell: "w-7 h-7"
1007
+ },
1008
+ md: {
1009
+ trigger: "h-10 px-3",
1010
+ text: {
1011
+ fontFamily: "var(--font-label)",
1012
+ fontSize: "var(--text-label)",
1013
+ fontWeight: "var(--weight-label)"
1014
+ },
1015
+ icon: 16,
1016
+ cell: "w-9 h-9"
1017
+ },
1018
+ lg: {
1019
+ trigger: "h-12 px-4",
1020
+ text: {
1021
+ fontFamily: "var(--font-label)",
1022
+ fontSize: "calc(var(--text-label) * 1.1)",
1023
+ fontWeight: "var(--weight-label)"
1024
+ },
1025
+ icon: 18,
1026
+ cell: "w-10 h-10"
1027
+ }
1028
+ }, er = {
1029
+ default: "bg-input-background border border-border",
1030
+ outlined: "bg-transparent border-2 border-border",
1031
+ filled: "bg-muted/30 border border-transparent",
1032
+ ghost: "bg-transparent border border-transparent"
1033
+ }, tr = {
1034
+ default: "focus-within:ring-2 focus-within:ring-ring/30 focus-within:border-primary",
1035
+ error: "ring-2 ring-destructive/30 border-destructive",
1036
+ success: "ring-2 ring-chart-2/30 border-chart-2"
1037
+ };
1038
+ function yr({
1039
+ value: r = null,
1040
+ rangeValue: e,
1041
+ onChange: n,
1042
+ onRangeChange: o,
1043
+ mode: s = "single",
1044
+ label: l,
1045
+ placeholder: d,
1046
+ helperText: f,
1047
+ errorMessage: c,
1048
+ successMessage: h,
1049
+ size: u = "md",
1050
+ variant: w = "default",
1051
+ state: y = "default",
1052
+ disabled: m = !1,
1053
+ required: D = !1,
1054
+ clearable: _ = !1,
1055
+ showTime: $ = !1,
1056
+ minDate: S,
1057
+ maxDate: F,
1058
+ disabledDates: x,
1059
+ showToday: b = !0,
1060
+ footer: N,
1061
+ fullWidth: z = !1
1062
+ }) {
1063
+ const [C, A] = M(!1), [p, g] = M(() => r ?? /* @__PURE__ */ new Date()), [Y, T] = M("days"), [i, k] = M(null), [E, I] = M(() => r ? r.getHours() : 0), [H, R] = M(() => r ? r.getMinutes() : 0), K = G(null), q = Vt[u];
1064
+ X(() => {
1065
+ function v(W) {
1066
+ K.current && !K.current.contains(W.target) && (A(!1), T("days"));
1067
+ }
1068
+ return C && document.addEventListener("mousedown", v), () => document.removeEventListener("mousedown", v);
1069
+ }, [C]), ee(
1070
+ () => Se(p.getFullYear(), p.getMonth()),
1071
+ [p]
1072
+ );
1073
+ const te = ee(() => /* @__PURE__ */ new Date(), []), ie = () => g(new Date(p.getFullYear(), p.getMonth() - 1, 1)), ae = () => g(new Date(p.getFullYear(), p.getMonth() + 1, 1)), re = () => g(new Date(p.getFullYear() - 1, p.getMonth(), 1)), Ie = () => g(new Date(p.getFullYear() + 1, p.getMonth(), 1)), Te = J(
1074
+ (v) => {
1075
+ if (!$e(v, S, F, x))
1076
+ if (s === "single") {
1077
+ let W = new Date(v);
1078
+ $ && W.setHours(E, H), n == null || n(W), $ || (A(!1), T("days"));
1079
+ } else {
1080
+ const W = e == null ? void 0 : e.start, de = e == null ? void 0 : e.end;
1081
+ !W || W && de ? o == null || o({ start: v, end: null }) : (v < W ? o == null || o({ start: v, end: W }) : o == null || o({ start: W, end: v }), A(!1), T("days"));
1082
+ }
1083
+ },
1084
+ [s, n, o, e, S, F, x, $, E, H]
1085
+ ), Ee = (v) => {
1086
+ v.stopPropagation(), s === "single" ? n == null || n(null) : o == null || o({ start: null, end: null });
1087
+ }, Le = () => {
1088
+ const v = /* @__PURE__ */ new Date();
1089
+ if (g(v), s === "single") {
1090
+ const W = new Date(v);
1091
+ $ && W.setHours(E, H), n == null || n(W), $ || (A(!1), T("days"));
1092
+ }
1093
+ }, Be = () => {
1094
+ if (r) {
1095
+ const v = new Date(r);
1096
+ v.setHours(E, H), n == null || n(v);
1097
+ }
1098
+ A(!1), T("days");
1099
+ }, He = ee(() => s === "single" ? ne(r, $) : e != null && e.start && (e != null && e.end) ? `${ne(e.start)} – ${ne(e.end)}` : e != null && e.start ? `${ne(e.start)} – ...` : "", [s, r, e, $]), le = s === "single" ? !!r : !!(e != null && e.start || e != null && e.end), qe = y === "error" ? /* @__PURE__ */ t(pe, { size: q.icon, className: "text-destructive flex-shrink-0" }) : y === "success" ? /* @__PURE__ */ t(se, { size: q.icon, className: "text-chart-2 flex-shrink-0" }) : null, ge = y === "error" ? c : y === "success" ? h : f, Re = y === "error" ? "text-destructive" : y === "success" ? "text-chart-2" : "text-muted-foreground", Ke = {
1100
+ fontFamily: "var(--font-label)",
1101
+ fontSize: "var(--text-label)",
1102
+ fontWeight: "var(--weight-label)"
1103
+ }, Ge = {
1104
+ fontFamily: "var(--font-caption)",
1105
+ fontSize: "calc(var(--text-caption) * 0.7)",
1106
+ fontWeight: "var(--weight-caption)"
1107
+ }, B = {
1108
+ fontFamily: "var(--font-button)",
1109
+ fontSize: "var(--text-button)",
1110
+ fontWeight: "var(--weight-button)"
1111
+ }, ce = Math.floor(p.getFullYear() / 12) * 12;
1112
+ return /* @__PURE__ */ a("div", { className: `relative ${z ? "w-full" : ""}`, ref: K, children: [
1113
+ l && /* @__PURE__ */ a("label", { className: "block text-foreground mb-1.5", style: Ke, children: [
1114
+ l,
1115
+ D && /* @__PURE__ */ t("span", { className: "text-destructive ml-0.5", children: "*" })
1116
+ ] }),
1117
+ /* @__PURE__ */ a(
1118
+ "button",
1119
+ {
1120
+ type: "button",
1121
+ onClick: () => !m && A(!C),
1122
+ disabled: m,
1123
+ className: `
1124
+ w-full flex items-center gap-2 rounded-[var(--radius-md)] transition-all cursor-pointer
1125
+ ${q.trigger}
1126
+ ${er[w]}
1127
+ ${tr[y]}
1128
+ ${m ? "opacity-50 cursor-not-allowed" : "hover:border-primary/50"}
1129
+ `,
1130
+ style: q.text,
1131
+ children: [
1132
+ /* @__PURE__ */ t(nt, { size: q.icon, className: "text-muted-foreground flex-shrink-0" }),
1133
+ /* @__PURE__ */ t("span", { className: `flex-1 text-left truncate ${le ? "text-foreground" : "text-muted-foreground"}`, children: le ? He : d || (s === "range" ? "Select date range…" : "Select date…") }),
1134
+ qe,
1135
+ _ && le && !m && /* @__PURE__ */ t(
1136
+ "span",
1137
+ {
1138
+ onClick: Ee,
1139
+ className: "text-muted-foreground hover:text-foreground cursor-pointer",
1140
+ children: /* @__PURE__ */ t(Q, { size: q.icon - 2 })
1141
+ }
1142
+ )
1143
+ ]
1144
+ }
1145
+ ),
1146
+ ge && /* @__PURE__ */ t("p", { className: `mt-1.5 ${Re}`, style: { fontFamily: "var(--font-label)", fontSize: "calc(var(--text-label) * 0.85)", fontWeight: "var(--weight-label)" }, children: ge }),
1147
+ C && /* @__PURE__ */ a(
1148
+ "div",
1149
+ {
1150
+ className: "absolute z-50 mt-1.5 bg-popover border border-border rounded-[var(--radius-lg)] shadow-elevation-sm overflow-hidden",
1151
+ style: { minWidth: s === "range" ? "560px" : "300px" },
1152
+ children: [
1153
+ /* @__PURE__ */ a("div", { className: "flex items-center justify-between px-4 py-3 border-b border-border bg-card", children: [
1154
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
1155
+ /* @__PURE__ */ t("button", { onClick: re, className: "p-1 rounded-[var(--radius-sm)] hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer", title: "Previous year", children: /* @__PURE__ */ t(Fe, { size: 16 }) }),
1156
+ /* @__PURE__ */ t("button", { onClick: ie, className: "p-1 rounded-[var(--radius-sm)] hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer", title: "Previous month", children: /* @__PURE__ */ t(be, { size: 16 }) })
1157
+ ] }),
1158
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
1159
+ /* @__PURE__ */ t(
1160
+ "button",
1161
+ {
1162
+ onClick: () => T(Y === "months" ? "days" : "months"),
1163
+ className: "px-2 py-1 rounded-[var(--radius-sm)] hover:bg-muted text-foreground transition-colors cursor-pointer",
1164
+ style: B,
1165
+ children: fe[p.getMonth()]
1166
+ }
1167
+ ),
1168
+ /* @__PURE__ */ t(
1169
+ "button",
1170
+ {
1171
+ onClick: () => T(Y === "years" ? "days" : "years"),
1172
+ className: "px-2 py-1 rounded-[var(--radius-sm)] hover:bg-muted text-foreground transition-colors cursor-pointer",
1173
+ style: B,
1174
+ children: p.getFullYear()
1175
+ }
1176
+ )
1177
+ ] }),
1178
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
1179
+ /* @__PURE__ */ t("button", { onClick: ae, className: "p-1 rounded-[var(--radius-sm)] hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer", title: "Next month", children: /* @__PURE__ */ t(he, { size: 16 }) }),
1180
+ /* @__PURE__ */ t("button", { onClick: Ie, className: "p-1 rounded-[var(--radius-sm)] hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer", title: "Next year", children: /* @__PURE__ */ t(We, { size: 16 }) })
1181
+ ] })
1182
+ ] }),
1183
+ Y === "days" && /* @__PURE__ */ t("div", { className: `p-3 ${s === "range" ? "flex gap-3" : ""}`, children: (s === "range" ? [0, 1] : [0]).map((v) => {
1184
+ const W = new Date(p.getFullYear(), p.getMonth() + v, 1), de = Se(W.getFullYear(), W.getMonth());
1185
+ return /* @__PURE__ */ a("div", { className: "flex-1", children: [
1186
+ v > 0 && /* @__PURE__ */ a("div", { className: "text-center mb-2 text-foreground", style: B, children: [
1187
+ fe[W.getMonth()],
1188
+ " ",
1189
+ W.getFullYear()
1190
+ ] }),
1191
+ /* @__PURE__ */ t("div", { className: "grid grid-cols-7 mb-1", children: Qt.map((L) => /* @__PURE__ */ t(
1192
+ "div",
1193
+ {
1194
+ className: "text-center text-muted-foreground py-1",
1195
+ style: Ge,
1196
+ children: L
1197
+ },
1198
+ `${v}-${L}`
1199
+ )) }),
1200
+ /* @__PURE__ */ t("div", { className: "grid grid-cols-7", children: de.map((L, Oe) => {
1201
+ if (!L) return /* @__PURE__ */ t("div", {}, `empty-${v}-${Oe}`);
1202
+ const ye = $e(L, S, F, x), Ue = V(L, te), ue = s === "single" ? r && V(L, r) : (e == null ? void 0 : e.start) && V(L, e.start) || (e == null ? void 0 : e.end) && V(L, e.end), Je = s === "range" && (ke(L, (e == null ? void 0 : e.start) ?? null, (e == null ? void 0 : e.end) ?? null) || (e == null ? void 0 : e.start) && !(e != null && e.end) && i && ke(
1203
+ L,
1204
+ e.start,
1205
+ i > e.start ? i : null
1206
+ ));
1207
+ return /* @__PURE__ */ t(
1208
+ "button",
1209
+ {
1210
+ onClick: () => Te(L),
1211
+ onMouseEnter: () => s === "range" && k(L),
1212
+ disabled: ye,
1213
+ className: `
1214
+ ${q.cell} flex items-center justify-center rounded-[var(--radius-sm)] transition-all cursor-pointer
1215
+ ${ye ? "opacity-30 cursor-not-allowed" : "hover:bg-muted"}
1216
+ ${ue ? "bg-primary text-primary-foreground hover:bg-primary/90" : ""}
1217
+ ${Je && !ue ? "bg-accent text-accent-foreground" : ""}
1218
+ ${Ue && !ue ? "border border-primary text-primary" : ""}
1219
+ `,
1220
+ style: B,
1221
+ children: L.getDate()
1222
+ },
1223
+ `${v}-${L.getTime()}`
1224
+ );
1225
+ }) })
1226
+ ] }, v);
1227
+ }) }),
1228
+ Y === "months" && /* @__PURE__ */ t("div", { className: "p-3 grid grid-cols-3 gap-2", children: fe.map((v, W) => /* @__PURE__ */ t(
1229
+ "button",
1230
+ {
1231
+ onClick: () => {
1232
+ g(new Date(p.getFullYear(), W, 1)), T("days");
1233
+ },
1234
+ className: `
1235
+ py-2.5 rounded-[var(--radius-md)] transition-all cursor-pointer
1236
+ ${p.getMonth() === W ? "bg-primary text-primary-foreground" : "text-foreground hover:bg-muted"}
1237
+ `,
1238
+ style: B,
1239
+ children: v.substring(0, 3)
1240
+ },
1241
+ v
1242
+ )) }),
1243
+ Y === "years" && /* @__PURE__ */ a("div", { className: "p-3", children: [
1244
+ /* @__PURE__ */ a("div", { className: "flex items-center justify-between mb-3", children: [
1245
+ /* @__PURE__ */ t(
1246
+ "button",
1247
+ {
1248
+ onClick: () => g(new Date(p.getFullYear() - 12, p.getMonth(), 1)),
1249
+ className: "p-1 rounded-[var(--radius-sm)] hover:bg-muted text-muted-foreground hover:text-foreground cursor-pointer",
1250
+ children: /* @__PURE__ */ t(be, { size: 16 })
1251
+ }
1252
+ ),
1253
+ /* @__PURE__ */ a("span", { className: "text-foreground", style: B, children: [
1254
+ ce,
1255
+ " – ",
1256
+ ce + 11
1257
+ ] }),
1258
+ /* @__PURE__ */ t(
1259
+ "button",
1260
+ {
1261
+ onClick: () => g(new Date(p.getFullYear() + 12, p.getMonth(), 1)),
1262
+ className: "p-1 rounded-[var(--radius-sm)] hover:bg-muted text-muted-foreground hover:text-foreground cursor-pointer",
1263
+ children: /* @__PURE__ */ t(he, { size: 16 })
1264
+ }
1265
+ )
1266
+ ] }),
1267
+ /* @__PURE__ */ t("div", { className: "grid grid-cols-4 gap-2", children: Array.from({ length: 12 }, (v, W) => ce + W).map((v) => /* @__PURE__ */ t(
1268
+ "button",
1269
+ {
1270
+ onClick: () => {
1271
+ g(new Date(v, p.getMonth(), 1)), T("months");
1272
+ },
1273
+ className: `
1274
+ py-2.5 rounded-[var(--radius-md)] transition-all cursor-pointer
1275
+ ${p.getFullYear() === v ? "bg-primary text-primary-foreground" : "text-foreground hover:bg-muted"}
1276
+ ${v === te.getFullYear() && p.getFullYear() !== v ? "border border-primary text-primary" : ""}
1277
+ `,
1278
+ style: B,
1279
+ children: v
1280
+ },
1281
+ v
1282
+ )) })
1283
+ ] }),
1284
+ $ && s === "single" && Y === "days" && /* @__PURE__ */ a("div", { className: "px-4 py-3 border-t border-border flex items-center gap-3", children: [
1285
+ /* @__PURE__ */ t(wt, { size: 14, className: "text-muted-foreground" }),
1286
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
1287
+ /* @__PURE__ */ t(
1288
+ "input",
1289
+ {
1290
+ type: "number",
1291
+ min: 0,
1292
+ max: 23,
1293
+ value: String(E).padStart(2, "0"),
1294
+ onChange: (v) => I(Math.max(0, Math.min(23, Number(v.target.value)))),
1295
+ className: "w-10 text-center bg-input-background border border-border rounded-[var(--radius-sm)] py-1 text-foreground focus:outline-none focus:ring-1 focus:ring-ring/30",
1296
+ style: B
1297
+ }
1298
+ ),
1299
+ /* @__PURE__ */ t("span", { className: "text-muted-foreground", style: B, children: ":" }),
1300
+ /* @__PURE__ */ t(
1301
+ "input",
1302
+ {
1303
+ type: "number",
1304
+ min: 0,
1305
+ max: 59,
1306
+ value: String(H).padStart(2, "0"),
1307
+ onChange: (v) => R(Math.max(0, Math.min(59, Number(v.target.value)))),
1308
+ className: "w-10 text-center bg-input-background border border-border rounded-[var(--radius-sm)] py-1 text-foreground focus:outline-none focus:ring-1 focus:ring-ring/30",
1309
+ style: B
1310
+ }
1311
+ )
1312
+ ] }),
1313
+ /* @__PURE__ */ t(
1314
+ "button",
1315
+ {
1316
+ onClick: Be,
1317
+ className: "ml-auto px-3 py-1 rounded-[var(--radius-md)] bg-primary text-primary-foreground hover:bg-primary/90 transition-colors cursor-pointer",
1318
+ style: B,
1319
+ children: "Apply"
1320
+ }
1321
+ )
1322
+ ] }),
1323
+ /* @__PURE__ */ a("div", { className: "px-4 py-2.5 border-t border-border bg-card flex items-center justify-between", children: [
1324
+ b ? /* @__PURE__ */ t(
1325
+ "button",
1326
+ {
1327
+ onClick: Le,
1328
+ className: "text-primary hover:underline cursor-pointer",
1329
+ style: B,
1330
+ children: "Today"
1331
+ }
1332
+ ) : /* @__PURE__ */ t("span", {}),
1333
+ N ?? /* @__PURE__ */ t(
1334
+ "button",
1335
+ {
1336
+ onClick: () => {
1337
+ A(!1), T("days");
1338
+ },
1339
+ className: "text-muted-foreground hover:text-foreground cursor-pointer",
1340
+ style: B,
1341
+ children: "Close"
1342
+ }
1343
+ )
1344
+ ] })
1345
+ ]
1346
+ }
1347
+ )
1348
+ ] });
1349
+ }
1350
+ const rr = {
1351
+ sm: "max-w-sm",
1352
+ md: "max-w-lg",
1353
+ lg: "max-w-2xl",
1354
+ xl: "max-w-4xl",
1355
+ full: "max-w-[calc(100vw-2rem)] max-h-[calc(100vh-2rem)]"
1356
+ };
1357
+ function nr({
1358
+ open: r,
1359
+ onClose: e,
1360
+ title: n,
1361
+ description: o,
1362
+ size: s = "md",
1363
+ children: l,
1364
+ footer: d,
1365
+ closeOnOverlay: f = !0,
1366
+ showCloseButton: c = !0,
1367
+ className: h = ""
1368
+ }) {
1369
+ const u = G(null);
1370
+ return X(() => {
1371
+ if (!r) return;
1372
+ const w = (y) => {
1373
+ y.key === "Escape" && e();
1374
+ };
1375
+ return document.addEventListener("keydown", w), document.body.style.overflow = "hidden", () => {
1376
+ document.removeEventListener("keydown", w), document.body.style.overflow = "";
1377
+ };
1378
+ }, [r, e]), X(() => {
1379
+ r && u.current && u.current.focus();
1380
+ }, [r]), r ? /* @__PURE__ */ a("div", { className: "fixed inset-0 z-[100] flex items-center justify-center p-4", children: [
1381
+ /* @__PURE__ */ t(
1382
+ "div",
1383
+ {
1384
+ className: "absolute inset-0 bg-foreground/40 backdrop-blur-sm animate-in fade-in duration-200",
1385
+ onClick: f ? e : void 0
1386
+ }
1387
+ ),
1388
+ /* @__PURE__ */ a(
1389
+ "div",
1390
+ {
1391
+ ref: u,
1392
+ tabIndex: -1,
1393
+ role: "dialog",
1394
+ "aria-modal": "true",
1395
+ "aria-labelledby": n ? "modal-title" : void 0,
1396
+ className: `relative w-full ${rr[s]} bg-card rounded-[var(--radius-lg)] shadow-lg border border-border animate-in zoom-in-95 fade-in duration-200 flex flex-col ${s === "full" ? "h-full" : "max-h-[85vh]"} ${h}`,
1397
+ children: [
1398
+ (n || c) && /* @__PURE__ */ a("div", { className: "flex items-start justify-between gap-4 px-6 pt-6 pb-2 flex-shrink-0", children: [
1399
+ /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
1400
+ n && /* @__PURE__ */ t("h4", { id: "modal-title", className: "text-foreground", children: n }),
1401
+ o && /* @__PURE__ */ t("span", { className: "text-muted-foreground block mt-0.5", style: { fontFamily: "var(--font-label)", fontSize: "var(--text-label)", fontWeight: "var(--weight-label)" }, children: o })
1402
+ ] }),
1403
+ c && /* @__PURE__ */ t(
1404
+ "button",
1405
+ {
1406
+ onClick: e,
1407
+ className: "flex-shrink-0 w-8 h-8 rounded-[var(--radius-sm)] flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer",
1408
+ "aria-label": "Close",
1409
+ children: /* @__PURE__ */ t(Q, { size: 16 })
1410
+ }
1411
+ )
1412
+ ] }),
1413
+ /* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto px-6 py-4", style: { fontFamily: "var(--font-label)", fontSize: "var(--text-label)", fontWeight: "var(--weight-label)" }, children: l }),
1414
+ d && /* @__PURE__ */ t("div", { className: "flex items-center justify-end gap-2 px-6 py-4 border-t border-border flex-shrink-0", children: d })
1415
+ ]
1416
+ }
1417
+ )
1418
+ ] }) : null;
1419
+ }
1420
+ function xr({
1421
+ open: r,
1422
+ onClose: e,
1423
+ onConfirm: n,
1424
+ title: o = "Are you sure?",
1425
+ description: s = "This action cannot be undone.",
1426
+ confirmLabel: l = "Confirm",
1427
+ cancelLabel: d = "Cancel",
1428
+ variant: f = "default"
1429
+ }) {
1430
+ const c = { fontFamily: "var(--font-button)", fontSize: "var(--text-button)", fontWeight: "var(--weight-button)" };
1431
+ return /* @__PURE__ */ t(nr, { open: r, onClose: e, title: o, description: s, size: "sm", children: /* @__PURE__ */ a("div", { className: "flex items-center justify-end gap-2 pt-4", children: [
1432
+ /* @__PURE__ */ t(
1433
+ "button",
1434
+ {
1435
+ onClick: e,
1436
+ className: "px-4 py-2 rounded-[var(--radius-md)] border border-border text-foreground hover:bg-muted transition-colors cursor-pointer",
1437
+ style: c,
1438
+ children: d
1439
+ }
1440
+ ),
1441
+ /* @__PURE__ */ t(
1442
+ "button",
1443
+ {
1444
+ onClick: () => {
1445
+ n(), e();
1446
+ },
1447
+ className: `px-4 py-2 rounded-[var(--radius-md)] text-primary-foreground transition-colors cursor-pointer ${f === "destructive" ? "bg-destructive hover:bg-destructive/90" : "bg-primary hover:bg-primary/90"}`,
1448
+ style: c,
1449
+ children: l
1450
+ }
1451
+ )
1452
+ ] }) });
1453
+ }
1454
+ const or = {
1455
+ sm: {
1456
+ btn: "min-w-[28px] h-7 px-1.5",
1457
+ icon: 14,
1458
+ text: {
1459
+ fontFamily: "var(--font-button)",
1460
+ fontSize: "calc(var(--text-button) * 0.9)",
1461
+ fontWeight: "var(--weight-button)"
1462
+ },
1463
+ gap: "gap-1"
1464
+ },
1465
+ md: {
1466
+ btn: "min-w-[34px] h-9 px-2",
1467
+ icon: 16,
1468
+ text: {
1469
+ fontFamily: "var(--font-button)",
1470
+ fontSize: "var(--text-button)",
1471
+ fontWeight: "var(--weight-button)"
1472
+ },
1473
+ gap: "gap-1.5"
1474
+ },
1475
+ lg: {
1476
+ btn: "min-w-[42px] h-11 px-3",
1477
+ icon: 18,
1478
+ text: {
1479
+ fontFamily: "var(--font-button)",
1480
+ fontSize: "calc(var(--text-button) * 1.1)",
1481
+ fontWeight: "var(--weight-button)"
1482
+ },
1483
+ gap: "gap-2"
1484
+ }
1485
+ }, sr = {
1486
+ default: {
1487
+ base: "bg-transparent text-foreground border border-transparent",
1488
+ active: "bg-primary text-primary-foreground border-primary shadow-elevation-sm",
1489
+ hover: "hover:bg-muted"
1490
+ },
1491
+ outlined: {
1492
+ base: "bg-transparent text-foreground border border-border",
1493
+ active: "bg-primary text-primary-foreground border-primary shadow-elevation-sm",
1494
+ hover: "hover:bg-muted hover:border-muted"
1495
+ },
1496
+ filled: {
1497
+ base: "bg-muted/50 text-foreground border border-transparent",
1498
+ active: "bg-primary text-primary-foreground border-primary shadow-elevation-sm",
1499
+ hover: "hover:bg-muted"
1500
+ },
1501
+ minimal: {
1502
+ base: "bg-transparent text-foreground border border-transparent",
1503
+ active: "bg-accent text-accent-foreground border-accent",
1504
+ hover: "hover:text-primary"
1505
+ }
1506
+ };
1507
+ function ir(r, e, n) {
1508
+ return ee(() => {
1509
+ if (n * 2 + 5 >= e)
1510
+ return Array.from({ length: e }, (h, u) => u + 1);
1511
+ const s = Math.max(r - n, 1), l = Math.min(r + n, e), d = s > 2, f = l < e - 1;
1512
+ if (!d && f) {
1513
+ const h = 3 + 2 * n;
1514
+ return [...Array.from({ length: h }, (w, y) => y + 1), "dots-right", e];
1515
+ }
1516
+ if (d && !f) {
1517
+ const h = 3 + 2 * n;
1518
+ return [1, "dots-left", ...Array.from(
1519
+ { length: h },
1520
+ (w, y) => e - h + y + 1
1521
+ )];
1522
+ }
1523
+ return [1, "dots-left", ...Array.from(
1524
+ { length: l - s + 1 },
1525
+ (h, u) => s + u
1526
+ ), "dots-right", e];
1527
+ }, [r, e, n]);
1528
+ }
1529
+ function wr({
1530
+ currentPage: r,
1531
+ totalPages: e,
1532
+ onPageChange: n,
1533
+ siblingCount: o = 1,
1534
+ showFirstLast: s = !1,
1535
+ showPrevNext: l = !0,
1536
+ showPageSize: d = !1,
1537
+ pageSizeOptions: f = [10, 20, 50, 100],
1538
+ pageSize: c = 10,
1539
+ onPageSizeChange: h,
1540
+ totalItems: u,
1541
+ size: w = "md",
1542
+ variant: y = "default",
1543
+ disabled: m = !1,
1544
+ showPageInfo: D = !1,
1545
+ showItemsInfo: _ = !1,
1546
+ prevLabel: $,
1547
+ nextLabel: S
1548
+ }) {
1549
+ const F = ir(r, e, o), x = or[w], b = sr[y], N = J(
1550
+ (g) => {
1551
+ !m && g >= 1 && g <= e && n(g);
1552
+ },
1553
+ [m, e, n]
1554
+ ), z = (g, Y) => `inline-flex items-center justify-center rounded-[var(--radius-md)] transition-all cursor-pointer select-none
1555
+ ${x.btn}
1556
+ ${Y ? "opacity-40 pointer-events-none cursor-default" : ""}
1557
+ ${g ? b.active : `${b.base} ${Y ? "" : b.hover}`}`, C = u ? (r - 1) * c + 1 : 0, A = u ? Math.min(r * c, u) : 0, p = {
1558
+ fontFamily: "var(--font-label)",
1559
+ fontSize: "var(--text-label)",
1560
+ fontWeight: "var(--weight-label)"
1561
+ };
1562
+ return /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center justify-between gap-4", children: [
1563
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-4", children: [
1564
+ _ && u !== void 0 && /* @__PURE__ */ a("span", { className: "text-muted-foreground", style: p, children: [
1565
+ C,
1566
+ "–",
1567
+ A,
1568
+ " of ",
1569
+ u
1570
+ ] }),
1571
+ d && /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
1572
+ /* @__PURE__ */ t("span", { className: "text-muted-foreground", style: p, children: "Rows per page:" }),
1573
+ /* @__PURE__ */ t(
1574
+ "select",
1575
+ {
1576
+ value: c,
1577
+ onChange: (g) => h == null ? void 0 : h(Number(g.target.value)),
1578
+ disabled: m,
1579
+ className: "bg-input-background text-foreground border border-border rounded-[var(--radius-md)] px-2 py-1 cursor-pointer focus:outline-none focus:ring-2 focus:ring-ring/30",
1580
+ style: {
1581
+ fontFamily: "var(--font-button)",
1582
+ fontSize: "var(--text-button)",
1583
+ fontWeight: "var(--weight-button)"
1584
+ },
1585
+ children: f.map((g) => /* @__PURE__ */ t("option", { value: g, children: g }, g))
1586
+ }
1587
+ )
1588
+ ] })
1589
+ ] }),
1590
+ /* @__PURE__ */ a(
1591
+ "nav",
1592
+ {
1593
+ className: `flex items-center ${x.gap}`,
1594
+ "aria-label": "Pagination",
1595
+ role: "navigation",
1596
+ children: [
1597
+ s && /* @__PURE__ */ t(
1598
+ "button",
1599
+ {
1600
+ onClick: () => N(1),
1601
+ disabled: m || r <= 1,
1602
+ className: z(!1, m || r <= 1),
1603
+ style: x.text,
1604
+ "aria-label": "First page",
1605
+ title: "First page",
1606
+ children: /* @__PURE__ */ t(Fe, { size: x.icon })
1607
+ }
1608
+ ),
1609
+ l && /* @__PURE__ */ t(
1610
+ "button",
1611
+ {
1612
+ onClick: () => N(r - 1),
1613
+ disabled: m || r <= 1,
1614
+ className: z(!1, m || r <= 1),
1615
+ style: x.text,
1616
+ "aria-label": "Previous page",
1617
+ children: $ ?? /* @__PURE__ */ t(be, { size: x.icon })
1618
+ }
1619
+ ),
1620
+ F.map((g, Y) => g === "dots-left" || g === "dots-right" ? /* @__PURE__ */ t(
1621
+ "span",
1622
+ {
1623
+ className: `inline-flex items-center justify-center text-muted-foreground ${x.btn}`,
1624
+ style: x.text,
1625
+ children: /* @__PURE__ */ t(kt, { size: x.icon })
1626
+ },
1627
+ g
1628
+ ) : /* @__PURE__ */ t(
1629
+ "button",
1630
+ {
1631
+ onClick: () => N(g),
1632
+ disabled: m,
1633
+ className: z(g === r, m),
1634
+ style: x.text,
1635
+ "aria-label": `Page ${g}`,
1636
+ "aria-current": g === r ? "page" : void 0,
1637
+ children: g
1638
+ },
1639
+ g
1640
+ )),
1641
+ l && /* @__PURE__ */ t(
1642
+ "button",
1643
+ {
1644
+ onClick: () => N(r + 1),
1645
+ disabled: m || r >= e,
1646
+ className: z(!1, m || r >= e),
1647
+ style: x.text,
1648
+ "aria-label": "Next page",
1649
+ children: S ?? /* @__PURE__ */ t(he, { size: x.icon })
1650
+ }
1651
+ ),
1652
+ s && /* @__PURE__ */ t(
1653
+ "button",
1654
+ {
1655
+ onClick: () => N(e),
1656
+ disabled: m || r >= e,
1657
+ className: z(!1, m || r >= e),
1658
+ style: x.text,
1659
+ "aria-label": "Last page",
1660
+ title: "Last page",
1661
+ children: /* @__PURE__ */ t(We, { size: x.icon })
1662
+ }
1663
+ )
1664
+ ]
1665
+ }
1666
+ ),
1667
+ D && /* @__PURE__ */ a("span", { className: "text-muted-foreground", style: p, children: [
1668
+ "Page ",
1669
+ r,
1670
+ " of ",
1671
+ e
1672
+ ] })
1673
+ ] });
1674
+ }
1675
+ const ar = {
1676
+ sm: { input: "h-8 px-8 text-sm", icon: 14, style: { fontFamily: "var(--font-label)", fontSize: "calc(var(--text-label) * 0.85)", fontWeight: "var(--weight-label)" } },
1677
+ md: { input: "h-10 px-9", icon: 16, style: { fontFamily: "var(--font-label)", fontSize: "var(--text-label)", fontWeight: "var(--weight-label)" } },
1678
+ lg: { input: "h-12 px-10", icon: 18, style: { fontFamily: "var(--font-label)", fontSize: "calc(var(--text-label) * 1.1)", fontWeight: "var(--weight-label)" } }
1679
+ }, lr = {
1680
+ default: "bg-card border border-border focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/20",
1681
+ outlined: "bg-transparent border-2 border-border focus-within:border-primary",
1682
+ filled: "bg-muted/50 border border-transparent focus-within:border-ring focus-within:bg-card"
1683
+ };
1684
+ function Nr({
1685
+ value: r,
1686
+ onChange: e,
1687
+ onSearch: n,
1688
+ placeholder: o = "Search...",
1689
+ size: s = "md",
1690
+ variant: l = "default",
1691
+ loading: d = !1,
1692
+ suggestions: f = [],
1693
+ onSuggestionSelect: c,
1694
+ clearable: h = !0,
1695
+ disabled: u = !1,
1696
+ autoFocus: w = !1,
1697
+ debounce: y = 0,
1698
+ className: m = ""
1699
+ }) {
1700
+ const [D, _] = M(""), [$, S] = M(!1), [F, x] = M(-1), b = r ?? D, N = G(null), z = G(null), C = G(), A = ar[s], p = J((i) => {
1701
+ r === void 0 && _(i), e == null || e(i), y > 0 && (clearTimeout(C.current), C.current = setTimeout(() => n == null ? void 0 : n(i), y));
1702
+ }, [r, e, n, y]), g = (i) => {
1703
+ i.key === "Enter" ? F >= 0 && f[F] ? (c == null || c(f[F]), S(!1)) : n == null || n(b) : i.key === "ArrowDown" ? (i.preventDefault(), x((k) => Math.min(k + 1, f.length - 1))) : i.key === "ArrowUp" ? (i.preventDefault(), x((k) => Math.max(k - 1, -1))) : i.key === "Escape" && S(!1);
1704
+ };
1705
+ X(() => {
1706
+ const i = (k) => {
1707
+ z.current && !z.current.contains(k.target) && S(!1);
1708
+ };
1709
+ return document.addEventListener("mousedown", i), () => document.removeEventListener("mousedown", i);
1710
+ }, []), X(() => {
1711
+ S(f.length > 0 && b.length > 0), x(-1);
1712
+ }, [f, b]);
1713
+ const Y = { fontFamily: "var(--font-label)", fontSize: "var(--text-label)", fontWeight: "var(--weight-label)" }, T = { fontFamily: "var(--font-label)", fontSize: "calc(var(--text-label) * 0.8)", fontWeight: "var(--weight-label)" };
1714
+ return /* @__PURE__ */ a("div", { ref: z, className: `relative ${m}`, children: [
1715
+ /* @__PURE__ */ a("div", { className: `relative rounded-[var(--radius-md)] transition-all ${lr[l]} ${u ? "opacity-50 pointer-events-none" : ""}`, children: [
1716
+ /* @__PURE__ */ t("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none", children: /* @__PURE__ */ t(At, { size: A.icon }) }),
1717
+ /* @__PURE__ */ t(
1718
+ "input",
1719
+ {
1720
+ ref: N,
1721
+ type: "text",
1722
+ value: b,
1723
+ onChange: (i) => p(i.target.value),
1724
+ onKeyDown: g,
1725
+ onFocus: () => f.length > 0 && b.length > 0 && S(!0),
1726
+ placeholder: o,
1727
+ disabled: u,
1728
+ autoFocus: w,
1729
+ className: `w-full ${A.input} rounded-[var(--radius-md)] bg-transparent outline-none text-foreground placeholder:text-muted-foreground`,
1730
+ style: A.style
1731
+ }
1732
+ ),
1733
+ /* @__PURE__ */ a("span", { className: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1", children: [
1734
+ d && /* @__PURE__ */ t(ve, { size: A.icon, className: "animate-spin text-muted-foreground" }),
1735
+ h && b && !d && /* @__PURE__ */ t(
1736
+ "button",
1737
+ {
1738
+ onClick: () => {
1739
+ var i;
1740
+ p(""), (i = N.current) == null || i.focus();
1741
+ },
1742
+ className: "text-muted-foreground hover:text-foreground transition-colors cursor-pointer",
1743
+ children: /* @__PURE__ */ t(Q, { size: A.icon })
1744
+ }
1745
+ )
1746
+ ] })
1747
+ ] }),
1748
+ $ && f.length > 0 && /* @__PURE__ */ t("div", { className: "absolute top-full left-0 right-0 mt-1 bg-popover border border-border rounded-[var(--radius-md)] shadow-lg z-50 overflow-hidden max-h-64 overflow-y-auto", style: { padding: "var(--Spacing--Spacing-sm)" }, children: f.map((i, k) => /* @__PURE__ */ a(
1749
+ "button",
1750
+ {
1751
+ onClick: () => {
1752
+ c == null || c(i), S(!1);
1753
+ },
1754
+ className: `w-full text-left flex items-center rounded-[var(--radius-sm)] transition-colors cursor-pointer ${k === F ? "bg-[var(--Colors--Background--bg-brand-secondary)]" : "hover:bg-[var(--Colors--Background--bg-primary_hover)]"}`,
1755
+ style: { padding: "var(--Spacing--Spacing-md) var(--Spacing--Spacing-2xl)", gap: "var(--Spacing--Spacing-lg)" },
1756
+ children: [
1757
+ i.icon && /* @__PURE__ */ t("span", { className: "text-muted-foreground flex-shrink-0", children: i.icon }),
1758
+ /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
1759
+ /* @__PURE__ */ t("span", { className: "text-foreground block truncate", style: Y, children: i.label }),
1760
+ i.description && /* @__PURE__ */ t("span", { className: "text-muted-foreground block truncate", style: { marginTop: "var(--Spacing--Spacing-xxs)", ...T }, children: i.description })
1761
+ ] })
1762
+ ]
1763
+ },
1764
+ i.id
1765
+ )) })
1766
+ ] });
1767
+ }
1768
+ const O = {
1769
+ sm: "px-3 py-2",
1770
+ md: "px-4 py-3",
1771
+ lg: "px-5 py-4"
1772
+ };
1773
+ function kr({
1774
+ columns: r,
1775
+ data: e,
1776
+ size: n = "md",
1777
+ striped: o = !1,
1778
+ hoverable: s = !0,
1779
+ bordered: l = !1,
1780
+ selectable: d = !1,
1781
+ selectedRows: f,
1782
+ onSelectionChange: c,
1783
+ loading: h = !1,
1784
+ emptyMessage: u = "No data available",
1785
+ stickyHeader: w = !1,
1786
+ className: y = ""
1787
+ }) {
1788
+ const [m, D] = M(null), [_, $] = M("asc"), [S, F] = M(/* @__PURE__ */ new Set()), x = f ?? S, b = (i) => {
1789
+ f || F(i), c == null || c(i);
1790
+ }, N = ee(() => m ? [...e].sort((i, k) => {
1791
+ const E = i[m], I = k[m];
1792
+ if (E == null) return 1;
1793
+ if (I == null) return -1;
1794
+ const H = typeof E == "string" ? E.localeCompare(I) : E - I;
1795
+ return _ === "asc" ? H : -H;
1796
+ }) : e, [e, m, _]), z = (i) => {
1797
+ m === i ? $((k) => k === "asc" ? "desc" : "asc") : (D(i), $("asc"));
1798
+ }, C = e.length > 0 && x.size === e.length, A = x.size > 0 && !C, p = () => {
1799
+ b(C ? /* @__PURE__ */ new Set() : new Set(e.map((i, k) => k)));
1800
+ }, g = (i) => {
1801
+ const k = new Set(x);
1802
+ k.has(i) ? k.delete(i) : k.add(i), b(k);
1803
+ }, Y = { fontFamily: "var(--font-label)", fontSize: "var(--text-label)", fontWeight: "var(--weight-label)" }, T = { fontFamily: "var(--font-button)", fontSize: "var(--text-button)", fontWeight: "var(--weight-button)" };
1804
+ return /* @__PURE__ */ t("div", { className: `rounded-[var(--radius-lg)] border border-border overflow-hidden ${y}`, children: /* @__PURE__ */ t("div", { className: "overflow-x-auto", children: /* @__PURE__ */ a("table", { className: "w-full border-collapse", children: [
1805
+ /* @__PURE__ */ t("thead", { className: w ? "sticky top-0 z-10" : "", children: /* @__PURE__ */ a("tr", { className: "bg-muted/50 border-b border-border", children: [
1806
+ d && /* @__PURE__ */ t("th", { className: `${O[n]} w-12`, children: /* @__PURE__ */ t(
1807
+ "input",
1808
+ {
1809
+ type: "checkbox",
1810
+ checked: C,
1811
+ ref: (i) => {
1812
+ i && (i.indeterminate = A);
1813
+ },
1814
+ onChange: p,
1815
+ className: "w-4 h-4 rounded-[var(--radius-sm)] border-border accent-primary cursor-pointer"
1816
+ }
1817
+ ) }),
1818
+ r.map((i) => /* @__PURE__ */ t(
1819
+ "th",
1820
+ {
1821
+ className: `${O[n]} text-${i.align ?? "left"} text-muted-foreground ${i.sortable ? "cursor-pointer select-none hover:text-foreground transition-colors" : ""} ${l ? "border-x border-border first:border-l-0 last:border-r-0" : ""}`,
1822
+ style: { ...T, width: i.width },
1823
+ onClick: () => i.sortable && z(i.key),
1824
+ children: /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1", children: [
1825
+ i.header,
1826
+ i.sortable && /* @__PURE__ */ t("span", { className: "text-muted-foreground/60", children: m === i.key ? _ === "asc" ? /* @__PURE__ */ t(ut, { size: 14 }) : /* @__PURE__ */ t(at, { size: 14 }) : /* @__PURE__ */ t(ht, { size: 12 }) })
1827
+ ] })
1828
+ },
1829
+ i.key
1830
+ ))
1831
+ ] }) }),
1832
+ /* @__PURE__ */ t("tbody", { children: h ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: r.length + (d ? 1 : 0), className: `${O[n]} text-center text-muted-foreground`, children: /* @__PURE__ */ a("div", { className: "flex items-center justify-center gap-2 py-8", children: [
1833
+ /* @__PURE__ */ t("div", { className: "w-5 h-5 border-2 border-primary border-t-transparent rounded-full animate-spin" }),
1834
+ /* @__PURE__ */ t("span", { style: Y, children: "Loading..." })
1835
+ ] }) }) }) : N.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: r.length + (d ? 1 : 0), className: `${O[n]} text-center text-muted-foreground py-12`, children: /* @__PURE__ */ t("span", { style: Y, children: u }) }) }) : N.map((i, k) => {
1836
+ const E = x.has(k);
1837
+ return /* @__PURE__ */ a(
1838
+ "tr",
1839
+ {
1840
+ className: `border-b border-border last:border-b-0 transition-colors ${E ? "bg-primary/5" : o && k % 2 === 1 ? "bg-muted/20" : "bg-card"} ${s ? "hover:bg-[var(--Colors--Background--bg-primary_hover)]" : ""}`,
1841
+ children: [
1842
+ d && /* @__PURE__ */ t("td", { className: `${O[n]} w-12`, children: /* @__PURE__ */ t(
1843
+ "input",
1844
+ {
1845
+ type: "checkbox",
1846
+ checked: E,
1847
+ onChange: () => g(k),
1848
+ className: "w-4 h-4 rounded-[var(--radius-sm)] border-border accent-primary cursor-pointer"
1849
+ }
1850
+ ) }),
1851
+ r.map((I) => /* @__PURE__ */ t(
1852
+ "td",
1853
+ {
1854
+ className: `${O[n]} text-${I.align ?? "left"} text-foreground ${l ? "border-x border-border first:border-l-0 last:border-r-0" : ""}`,
1855
+ style: Y,
1856
+ children: I.render ? I.render(i[I.key], i, k) : i[I.key]
1857
+ },
1858
+ I.key
1859
+ ))
1860
+ ]
1861
+ },
1862
+ k
1863
+ );
1864
+ }) })
1865
+ ] }) }) });
1866
+ }
1867
+ const cr = {
1868
+ sm: { fontFamily: "var(--font-button)", fontSize: "calc(var(--text-button) * 0.85)", fontWeight: "var(--weight-button)", padding: "6px 12px" },
1869
+ md: { fontFamily: "var(--font-button)", fontSize: "var(--text-button)", fontWeight: "var(--weight-button)", padding: "8px 16px" },
1870
+ lg: { fontFamily: "var(--font-button)", fontSize: "calc(var(--text-button) * 1.14)", fontWeight: "var(--weight-button)", padding: "10px 20px" }
1871
+ };
1872
+ function $r({ tabs: r, variant: e = "default", size: n = "md", defaultTab: o, activeTab: s, onChange: l, fullWidth: d = !1, className: f = "" }) {
1873
+ var F, x;
1874
+ const [c, h] = M(o ?? ((F = r[0]) == null ? void 0 : F.id) ?? ""), u = s ?? c, w = G(null), [y, m] = M({ left: 0, width: 0 }), D = (b) => {
1875
+ s || h(b), l == null || l(b);
1876
+ };
1877
+ X(() => {
1878
+ if (e !== "underline" && e !== "default") return;
1879
+ const b = w.current;
1880
+ if (!b) return;
1881
+ const N = b.querySelector(`[data-tab-id="${u}"]`);
1882
+ N && m({ left: N.offsetLeft, width: N.offsetWidth });
1883
+ }, [u, e]);
1884
+ const _ = (x = r.find((b) => b.id === u)) == null ? void 0 : x.content, $ = (() => {
1885
+ switch (e) {
1886
+ case "bordered":
1887
+ return "border border-border rounded-[var(--radius)] bg-muted/30 p-1 gap-1";
1888
+ case "pills":
1889
+ return "gap-1.5";
1890
+ case "underline":
1891
+ return "border-b border-border relative";
1892
+ default:
1893
+ return "border-b border-border relative";
1894
+ }
1895
+ })(), S = (b, N) => {
1896
+ const z = "relative flex items-center gap-1.5 transition-all cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring whitespace-nowrap";
1897
+ if (N) return `${z} opacity-40 !cursor-not-allowed`;
1898
+ switch (e) {
1899
+ case "bordered":
1900
+ return `${z} rounded-[var(--radius-sm)] ${b ? "bg-card text-foreground shadow-elevation-sm" : "text-muted-foreground hover:text-foreground hover:bg-card/50"}`;
1901
+ case "pills":
1902
+ return `${z} rounded-[var(--radius)] ${b ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:text-foreground hover:bg-muted"}`;
1903
+ case "underline":
1904
+ return `${z} ${b ? "text-primary" : "text-muted-foreground hover:text-foreground"}`;
1905
+ default:
1906
+ return `${z} ${b ? "text-primary" : "text-muted-foreground hover:text-foreground"}`;
1907
+ }
1908
+ };
1909
+ return /* @__PURE__ */ a("div", { className: f, children: [
1910
+ /* @__PURE__ */ a("div", { ref: w, className: `flex ${d ? "" : "inline-flex"} ${$}`, role: "tablist", children: [
1911
+ (e === "default" || e === "underline") && /* @__PURE__ */ t(
1912
+ "div",
1913
+ {
1914
+ className: "absolute bottom-0 h-0.5 bg-primary transition-all duration-200 rounded-full",
1915
+ style: { left: y.left, width: y.width }
1916
+ }
1917
+ ),
1918
+ r.map((b) => {
1919
+ const N = u === b.id;
1920
+ return /* @__PURE__ */ a(
1921
+ "button",
1922
+ {
1923
+ "data-tab-id": b.id,
1924
+ role: "tab",
1925
+ "aria-selected": N,
1926
+ disabled: b.disabled,
1927
+ onClick: () => !b.disabled && D(b.id),
1928
+ className: `${S(N, !!b.disabled)} ${d ? "flex-1 justify-center" : ""}`,
1929
+ style: cr[n],
1930
+ children: [
1931
+ b.icon && /* @__PURE__ */ t("span", { className: "flex-shrink-0", children: b.icon }),
1932
+ /* @__PURE__ */ t("span", { children: b.label }),
1933
+ b.badge !== void 0 && /* @__PURE__ */ t(
1934
+ "span",
1935
+ {
1936
+ className: `ml-1 px-1.5 py-0.5 rounded-full min-w-[18px] text-center ${N && e === "pills" ? "bg-primary-foreground/20 text-primary-foreground" : "bg-muted text-muted-foreground"}`,
1937
+ style: { fontFamily: "var(--font-button)", fontSize: "calc(var(--text-button) * 0.72)", fontWeight: "var(--weight-button)", lineHeight: "1" },
1938
+ children: b.badge
1939
+ }
1940
+ )
1941
+ ]
1942
+ },
1943
+ b.id
1944
+ );
1945
+ })
1946
+ ] }),
1947
+ _ && /* @__PURE__ */ t("div", { className: "pt-4", role: "tabpanel", children: _ })
1948
+ ] });
1949
+ }
1950
+ export {
1951
+ Gt as Alert,
1952
+ br as Badge,
1953
+ fr as ButtonGroup,
1954
+ pr as CheckboxGroup,
1955
+ xr as ConfirmDialog,
1956
+ Bt as DSButton,
1957
+ hr as DSCheckbox,
1958
+ qt as DSInput,
1959
+ vr as DSRadio,
1960
+ kr as DSTable,
1961
+ Rt as DSTextarea,
1962
+ yr as DatePicker,
1963
+ Ht as IconButton,
1964
+ nr as Modal,
1965
+ wr as Pagination,
1966
+ gr as RadioGroup,
1967
+ Nr as SearchField,
1968
+ $r as Tabs,
1969
+ mr as ToastContainer,
1970
+ U as toast
1971
+ };
1972
+ //# sourceMappingURL=sellsuki-ds.js.map