@emanuelrista/primo-ui-kit 1.1.4

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,1633 @@
1
+ import se, { useEffect as W, useState as M, useRef as Q } from "react";
2
+ var G = { exports: {} }, F = {};
3
+ var ee;
4
+ function ne() {
5
+ if (ee) return F;
6
+ ee = 1;
7
+ var n = /* @__PURE__ */ Symbol.for("react.transitional.element"), l = /* @__PURE__ */ Symbol.for("react.fragment");
8
+ function t(o, s, a) {
9
+ var i = null;
10
+ if (a !== void 0 && (i = "" + a), s.key !== void 0 && (i = "" + s.key), "key" in s) {
11
+ a = {};
12
+ for (var d in s)
13
+ d !== "key" && (a[d] = s[d]);
14
+ } else a = s;
15
+ return s = a.ref, {
16
+ $$typeof: n,
17
+ type: o,
18
+ key: i,
19
+ ref: s !== void 0 ? s : null,
20
+ props: a
21
+ };
22
+ }
23
+ return F.Fragment = l, F.jsx = t, F.jsxs = t, F;
24
+ }
25
+ var U = {};
26
+ var re;
27
+ function le() {
28
+ return re || (re = 1, process.env.NODE_ENV !== "production" && (function() {
29
+ function n(r) {
30
+ if (r == null) return null;
31
+ if (typeof r == "function")
32
+ return r.$$typeof === S ? null : r.displayName || r.name || null;
33
+ if (typeof r == "string") return r;
34
+ switch (r) {
35
+ case v:
36
+ return "Fragment";
37
+ case R:
38
+ return "Profiler";
39
+ case C:
40
+ return "StrictMode";
41
+ case P:
42
+ return "Suspense";
43
+ case I:
44
+ return "SuspenseList";
45
+ case p:
46
+ return "Activity";
47
+ }
48
+ if (typeof r == "object")
49
+ switch (typeof r.tag == "number" && console.error(
50
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
51
+ ), r.$$typeof) {
52
+ case k:
53
+ return "Portal";
54
+ case T:
55
+ return r.displayName || "Context";
56
+ case E:
57
+ return (r._context.displayName || "Context") + ".Consumer";
58
+ case z:
59
+ var m = r.render;
60
+ return r = r.displayName, r || (r = m.displayName || m.name || "", r = r !== "" ? "ForwardRef(" + r + ")" : "ForwardRef"), r;
61
+ case B:
62
+ return m = r.displayName || null, m !== null ? m : n(r.type) || "Memo";
63
+ case L:
64
+ m = r._payload, r = r._init;
65
+ try {
66
+ return n(r(m));
67
+ } catch {
68
+ }
69
+ }
70
+ return null;
71
+ }
72
+ function l(r) {
73
+ return "" + r;
74
+ }
75
+ function t(r) {
76
+ try {
77
+ l(r);
78
+ var m = !1;
79
+ } catch {
80
+ m = !0;
81
+ }
82
+ if (m) {
83
+ m = console;
84
+ var y = m.error, w = typeof Symbol == "function" && Symbol.toStringTag && r[Symbol.toStringTag] || r.constructor.name || "Object";
85
+ return y.call(
86
+ m,
87
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
88
+ w
89
+ ), l(r);
90
+ }
91
+ }
92
+ function o(r) {
93
+ if (r === v) return "<>";
94
+ if (typeof r == "object" && r !== null && r.$$typeof === L)
95
+ return "<...>";
96
+ try {
97
+ var m = n(r);
98
+ return m ? "<" + m + ">" : "<...>";
99
+ } catch {
100
+ return "<...>";
101
+ }
102
+ }
103
+ function s() {
104
+ var r = A.A;
105
+ return r === null ? null : r.getOwner();
106
+ }
107
+ function a() {
108
+ return Error("react-stack-top-frame");
109
+ }
110
+ function i(r) {
111
+ if (O.call(r, "key")) {
112
+ var m = Object.getOwnPropertyDescriptor(r, "key").get;
113
+ if (m && m.isReactWarning) return !1;
114
+ }
115
+ return r.key !== void 0;
116
+ }
117
+ function d(r, m) {
118
+ function y() {
119
+ _ || (_ = !0, console.error(
120
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
121
+ m
122
+ ));
123
+ }
124
+ y.isReactWarning = !0, Object.defineProperty(r, "key", {
125
+ get: y,
126
+ configurable: !0
127
+ });
128
+ }
129
+ function c() {
130
+ var r = n(this.type);
131
+ return D[r] || (D[r] = !0, console.error(
132
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
133
+ )), r = this.props.ref, r !== void 0 ? r : null;
134
+ }
135
+ function u(r, m, y, w, J, H) {
136
+ var j = y.ref;
137
+ return r = {
138
+ $$typeof: N,
139
+ type: r,
140
+ key: m,
141
+ props: y,
142
+ _owner: w
143
+ }, (j !== void 0 ? j : null) !== null ? Object.defineProperty(r, "ref", {
144
+ enumerable: !1,
145
+ get: c
146
+ }) : Object.defineProperty(r, "ref", { enumerable: !1, value: null }), r._store = {}, Object.defineProperty(r._store, "validated", {
147
+ configurable: !1,
148
+ enumerable: !1,
149
+ writable: !0,
150
+ value: 0
151
+ }), Object.defineProperty(r, "_debugInfo", {
152
+ configurable: !1,
153
+ enumerable: !1,
154
+ writable: !0,
155
+ value: null
156
+ }), Object.defineProperty(r, "_debugStack", {
157
+ configurable: !1,
158
+ enumerable: !1,
159
+ writable: !0,
160
+ value: J
161
+ }), Object.defineProperty(r, "_debugTask", {
162
+ configurable: !1,
163
+ enumerable: !1,
164
+ writable: !0,
165
+ value: H
166
+ }), Object.freeze && (Object.freeze(r.props), Object.freeze(r)), r;
167
+ }
168
+ function b(r, m, y, w, J, H) {
169
+ var j = m.children;
170
+ if (j !== void 0)
171
+ if (w)
172
+ if (x(j)) {
173
+ for (w = 0; w < j.length; w++)
174
+ h(j[w]);
175
+ Object.freeze && Object.freeze(j);
176
+ } else
177
+ console.error(
178
+ "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
179
+ );
180
+ else h(j);
181
+ if (O.call(m, "key")) {
182
+ j = n(r);
183
+ var Y = Object.keys(m).filter(function(ae) {
184
+ return ae !== "key";
185
+ });
186
+ w = 0 < Y.length ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}", Z[j + w] || (Y = 0 < Y.length ? "{" + Y.join(": ..., ") + ": ...}" : "{}", console.error(
187
+ `A props object containing a "key" prop is being spread into JSX:
188
+ let props = %s;
189
+ <%s {...props} />
190
+ React keys must be passed directly to JSX without using spread:
191
+ let props = %s;
192
+ <%s key={someKey} {...props} />`,
193
+ w,
194
+ j,
195
+ Y,
196
+ j
197
+ ), Z[j + w] = !0);
198
+ }
199
+ if (j = null, y !== void 0 && (t(y), j = "" + y), i(m) && (t(m.key), j = "" + m.key), "key" in m) {
200
+ y = {};
201
+ for (var q in m)
202
+ q !== "key" && (y[q] = m[q]);
203
+ } else y = m;
204
+ return j && d(
205
+ y,
206
+ typeof r == "function" ? r.displayName || r.name || "Unknown" : r
207
+ ), u(
208
+ r,
209
+ j,
210
+ y,
211
+ s(),
212
+ J,
213
+ H
214
+ );
215
+ }
216
+ function h(r) {
217
+ g(r) ? r._store && (r._store.validated = 1) : typeof r == "object" && r !== null && r.$$typeof === L && (r._payload.status === "fulfilled" ? g(r._payload.value) && r._payload.value._store && (r._payload.value._store.validated = 1) : r._store && (r._store.validated = 1));
218
+ }
219
+ function g(r) {
220
+ return typeof r == "object" && r !== null && r.$$typeof === N;
221
+ }
222
+ var f = se, N = /* @__PURE__ */ Symbol.for("react.transitional.element"), k = /* @__PURE__ */ Symbol.for("react.portal"), v = /* @__PURE__ */ Symbol.for("react.fragment"), C = /* @__PURE__ */ Symbol.for("react.strict_mode"), R = /* @__PURE__ */ Symbol.for("react.profiler"), E = /* @__PURE__ */ Symbol.for("react.consumer"), T = /* @__PURE__ */ Symbol.for("react.context"), z = /* @__PURE__ */ Symbol.for("react.forward_ref"), P = /* @__PURE__ */ Symbol.for("react.suspense"), I = /* @__PURE__ */ Symbol.for("react.suspense_list"), B = /* @__PURE__ */ Symbol.for("react.memo"), L = /* @__PURE__ */ Symbol.for("react.lazy"), p = /* @__PURE__ */ Symbol.for("react.activity"), S = /* @__PURE__ */ Symbol.for("react.client.reference"), A = f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, O = Object.prototype.hasOwnProperty, x = Array.isArray, $ = console.createTask ? console.createTask : function() {
223
+ return null;
224
+ };
225
+ f = {
226
+ react_stack_bottom_frame: function(r) {
227
+ return r();
228
+ }
229
+ };
230
+ var _, D = {}, V = f.react_stack_bottom_frame.bind(
231
+ f,
232
+ a
233
+ )(), K = $(o(a)), Z = {};
234
+ U.Fragment = v, U.jsx = function(r, m, y) {
235
+ var w = 1e4 > A.recentlyCreatedOwnerStacks++;
236
+ return b(
237
+ r,
238
+ m,
239
+ y,
240
+ !1,
241
+ w ? Error("react-stack-top-frame") : V,
242
+ w ? $(o(r)) : K
243
+ );
244
+ }, U.jsxs = function(r, m, y) {
245
+ var w = 1e4 > A.recentlyCreatedOwnerStacks++;
246
+ return b(
247
+ r,
248
+ m,
249
+ y,
250
+ !0,
251
+ w ? Error("react-stack-top-frame") : V,
252
+ w ? $(o(r)) : K
253
+ );
254
+ };
255
+ })()), U;
256
+ }
257
+ var te;
258
+ function oe() {
259
+ return te || (te = 1, process.env.NODE_ENV === "production" ? G.exports = ne() : G.exports = le()), G.exports;
260
+ }
261
+ var e = oe();
262
+ const de = ({
263
+ children: n,
264
+ variant: l = "primary",
265
+ size: t = "md",
266
+ onClick: o,
267
+ disabled: s = !1,
268
+ fullWidth: a = !1,
269
+ className: i = "",
270
+ ...d
271
+ }) => {
272
+ const c = "rounded-btn transition-all duration-200 font-semibold inline-flex items-center justify-center disabled:opacity-50 disabled:cursor-not-allowed", u = {
273
+ primary: "bg-primary hover:bg-primary-hover text-white",
274
+ secondary: "bg-secondary hover:bg-secondary-hover text-white",
275
+ danger: "bg-danger hover:bg-danger-hover text-white",
276
+ success: "bg-success hover:brightness-110 text-white",
277
+ warning: "bg-warning hover:brightness-110 text-white",
278
+ info: "bg-info hover:brightness-110 text-white",
279
+ outline: "border-2 border-primary text-primary hover:bg-primary hover:text-white",
280
+ "outline-secondary": "border-2 border-secondary text-secondary hover:bg-secondary hover:text-white",
281
+ "outline-danger": "border-2 border-danger text-danger hover:bg-danger hover:text-white",
282
+ "outline-success": "border-2 border-success text-success hover:bg-success hover:text-white",
283
+ "outline-warning": "border-2 border-warning text-warning hover:bg-warning hover:text-white",
284
+ "outline-info": "border-2 border-info text-info hover:bg-info hover:text-white",
285
+ ghost: "text-primary hover:bg-primary-light"
286
+ }, b = {
287
+ xs: "px-3 py-1 text-xs",
288
+ sm: "px-4 py-2 text-sm",
289
+ md: "px-6 py-2.5 text-base",
290
+ lg: "px-8 py-3 text-lg"
291
+ }, h = a ? "w-full" : "", g = `${c} ${u[l]} ${b[t]} ${h} ${i}`;
292
+ return /* @__PURE__ */ e.jsx(
293
+ "button",
294
+ {
295
+ className: g,
296
+ onClick: o,
297
+ disabled: s,
298
+ ...d,
299
+ children: n
300
+ }
301
+ );
302
+ }, ue = ({
303
+ isOpen: n,
304
+ onClose: l,
305
+ title: t,
306
+ children: o,
307
+ size: s = "md",
308
+ showCloseButton: a = !0,
309
+ closeOnBackdropClick: i = !0,
310
+ footer: d = null,
311
+ icon: c = null,
312
+ // Optional icon element
313
+ subtitle: u = null
314
+ // Optional subtitle text below icon
315
+ }) => {
316
+ if (W(() => {
317
+ const g = (f) => {
318
+ f.key === "Escape" && n && l();
319
+ };
320
+ return n && (document.addEventListener("keydown", g), document.body.style.overflow = "hidden"), () => {
321
+ document.removeEventListener("keydown", g), document.body.style.overflow = "unset";
322
+ };
323
+ }, [n, l]), !n) return null;
324
+ const b = {
325
+ sm: "max-w-md",
326
+ md: "max-w-2xl",
327
+ lg: "max-w-4xl",
328
+ xl: "max-w-6xl",
329
+ full: "max-w-[95vw]"
330
+ }, h = () => {
331
+ i && l();
332
+ };
333
+ return /* @__PURE__ */ e.jsxs("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
334
+ /* @__PURE__ */ e.jsx(
335
+ "div",
336
+ {
337
+ className: "fixed inset-0 bg-black/40 backdrop-blur-sm",
338
+ onClick: h
339
+ }
340
+ ),
341
+ /* @__PURE__ */ e.jsxs(
342
+ "div",
343
+ {
344
+ className: `relative bg-white rounded-modal shadow-card w-full ${b[s]} max-h-[90vh] flex flex-col animate-fadeIn`,
345
+ onClick: (g) => g.stopPropagation(),
346
+ children: [
347
+ (t || a) && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between p-6 bg-primary", children: [
348
+ t && /* @__PURE__ */ e.jsx("h2", { className: "text-xl font-semibold text-white", children: t }),
349
+ a && /* @__PURE__ */ e.jsx(
350
+ "button",
351
+ {
352
+ onClick: l,
353
+ className: "ml-auto text-white hover:text-white/80 transition-colors p-1",
354
+ "aria-label": "Close modal",
355
+ children: /* @__PURE__ */ e.jsx(
356
+ "svg",
357
+ {
358
+ className: "w-6 h-6",
359
+ fill: "none",
360
+ stroke: "currentColor",
361
+ viewBox: "0 0 24 24",
362
+ children: /* @__PURE__ */ e.jsx(
363
+ "path",
364
+ {
365
+ strokeLinecap: "round",
366
+ strokeLinejoin: "round",
367
+ strokeWidth: 2,
368
+ d: "M6 18L18 6M6 6l12 12"
369
+ }
370
+ )
371
+ }
372
+ )
373
+ }
374
+ )
375
+ ] }),
376
+ c && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center py-6 px-6", children: [
377
+ /* @__PURE__ */ e.jsx("div", { className: "mb-4", children: c }),
378
+ u && /* @__PURE__ */ e.jsx("p", { className: "text-lg font-semibold text-dark", children: u })
379
+ ] }),
380
+ /* @__PURE__ */ e.jsx("div", { className: "p-6 overflow-y-auto flex-1", children: o }),
381
+ d && /* @__PURE__ */ e.jsx("div", { className: "p-6 border-t border-grey", children: d })
382
+ ]
383
+ }
384
+ )
385
+ ] });
386
+ }, me = ({
387
+ columns: n,
388
+ data: l,
389
+ renderRow: t,
390
+ striped: o = !1,
391
+ hoverable: s = !0,
392
+ bordered: a = !1,
393
+ unwrapped: i = !1,
394
+ className: d = ""
395
+ }) => /* @__PURE__ */ e.jsx("div", { className: `overflow-auto max-h-[80vh] ${d}`, children: /* @__PURE__ */ e.jsxs("table", { className: "w-full", children: [
396
+ /* @__PURE__ */ e.jsx("thead", { className: "bg-grey-lighter sticky top-0 z-20", children: /* @__PURE__ */ e.jsx("tr", { children: n.map((c, u) => /* @__PURE__ */ e.jsx(
397
+ "th",
398
+ {
399
+ className: `px-4 py-3 font-semibold text-dark ${c.align === "center" ? "text-center" : c.align === "right" ? "text-right" : "text-left"} ${a ? "border border-grey" : ""}`,
400
+ children: c.header
401
+ },
402
+ u
403
+ )) }) }),
404
+ /* @__PURE__ */ e.jsx("tbody", { children: l.length === 0 ? /* @__PURE__ */ e.jsx("tr", { children: /* @__PURE__ */ e.jsx(
405
+ "td",
406
+ {
407
+ colSpan: n.length,
408
+ className: "px-4 py-8 text-center text-grey-medium",
409
+ children: "No data available"
410
+ }
411
+ ) }) : i ? l.map((c, u) => t(c, u)) : l.map((c, u) => /* @__PURE__ */ e.jsx(
412
+ "tr",
413
+ {
414
+ className: `
415
+ ${a ? "border border-grey" : "border-b border-grey"}
416
+ ${s ? "hover:bg-grey-lightest" : ""}
417
+ ${o && u % 2 === 1 ? "bg-grey-lightest/50" : ""}
418
+ transition-colors
419
+ `,
420
+ children: t(c, u)
421
+ },
422
+ c.id || u
423
+ )) })
424
+ ] }) }), xe = ({
425
+ type: n = "text",
426
+ label: l,
427
+ placeholder: t,
428
+ value: o,
429
+ onChange: s,
430
+ error: a,
431
+ helperText: i,
432
+ disabled: d = !1,
433
+ required: c = !1,
434
+ fullWidth: u = !1,
435
+ size: b = "md",
436
+ className: h = "",
437
+ ...g
438
+ }) => {
439
+ const N = `
440
+ w-full rounded-sheet border transition-all duration-200
441
+ focus:outline-none focus:ring-2
442
+ disabled:bg-grey-lighter disabled:cursor-not-allowed
443
+ ${a ? "border-danger focus:ring-danger/30" : "border-grey focus:border-primary focus:ring-primary/30"}
444
+ ${{
445
+ sm: "px-3 py-1.5 text-sm",
446
+ md: "px-4 py-2 text-base",
447
+ lg: "px-5 py-3 text-lg"
448
+ }[b]}
449
+ ${h}
450
+ `;
451
+ return /* @__PURE__ */ e.jsxs("div", { className: `${u ? "w-full" : ""}`, children: [
452
+ l && /* @__PURE__ */ e.jsxs("label", { className: "block mb-2 font-semibold text-dark text-sm", children: [
453
+ l,
454
+ c && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", children: "*" })
455
+ ] }),
456
+ /* @__PURE__ */ e.jsx(
457
+ "input",
458
+ {
459
+ type: n,
460
+ value: o,
461
+ onChange: s,
462
+ placeholder: t,
463
+ disabled: d,
464
+ required: c,
465
+ className: N,
466
+ ...g
467
+ }
468
+ ),
469
+ (a || i) && /* @__PURE__ */ e.jsx("p", { className: `mt-1 text-sm ${a ? "text-danger" : "text-grey-medium"}`, children: a || i })
470
+ ] });
471
+ }, fe = ({
472
+ label: n,
473
+ options: l = [],
474
+ value: t,
475
+ onChange: o,
476
+ error: s,
477
+ helperText: a,
478
+ disabled: i = !1,
479
+ required: d = !1,
480
+ fullWidth: c = !1,
481
+ placeholder: u = "Select an option",
482
+ size: b = "md",
483
+ className: h = "",
484
+ variant: g = "default",
485
+ // 'default' or 'badge'
486
+ getBadgeColor: f,
487
+ // Function to get badge color based on value
488
+ ...N
489
+ }) => {
490
+ const [k, v] = M(!1), C = Q(null), R = {
491
+ sm: "px-3 py-1.5 text-sm",
492
+ md: "px-4 py-2 text-base",
493
+ lg: "px-5 py-3 text-lg"
494
+ };
495
+ W(() => {
496
+ const p = (S) => {
497
+ C.current && !C.current.contains(S.target) && v(!1);
498
+ };
499
+ return k && document.addEventListener("mousedown", p), () => {
500
+ document.removeEventListener("mousedown", p);
501
+ };
502
+ }, [k]);
503
+ const E = (p) => {
504
+ p.disabled || (o({ target: { value: p.value } }), v(!1));
505
+ }, T = l.find((p) => p.value === t), z = T?.label || u, P = (p) => ({
506
+ success: "bg-success text-white",
507
+ warning: "bg-warning text-white",
508
+ danger: "bg-danger text-white",
509
+ info: "bg-info text-white",
510
+ primary: "bg-primary text-white"
511
+ })[p] || "bg-grey-medium text-white", I = f ? f(t) : null, B = g === "badge", L = `
512
+ w-full rounded-sheet border transition-all duration-200
513
+ focus:outline-none focus:ring-2
514
+ disabled:bg-grey-lighter disabled:cursor-not-allowed
515
+ cursor-pointer
516
+ ${B && I ? P(I) : "bg-white text-dark"}
517
+ ${s ? "border-danger focus:ring-danger/30" : "border-grey focus:border-primary focus:ring-primary/30"}
518
+ ${R[b]}
519
+ ${h}
520
+ ${i ? "opacity-50 cursor-not-allowed" : ""}
521
+ `;
522
+ return /* @__PURE__ */ e.jsxs("div", { className: `${c ? "w-full" : ""} relative`, ref: C, children: [
523
+ n && /* @__PURE__ */ e.jsxs("label", { className: "block mb-2 font-semibold text-dark text-sm", children: [
524
+ n,
525
+ d && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", children: "*" })
526
+ ] }),
527
+ /* @__PURE__ */ e.jsx(
528
+ "div",
529
+ {
530
+ className: L,
531
+ onClick: () => !i && v(!k),
532
+ role: "button",
533
+ tabIndex: 0,
534
+ onKeyDown: (p) => {
535
+ (p.key === "Enter" || p.key === " ") && (p.preventDefault(), !i && v(!k));
536
+ },
537
+ children: /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-center", children: [
538
+ /* @__PURE__ */ e.jsx("span", { className: `font-semibold ${!T && "text-grey-medium"}`, children: z }),
539
+ /* @__PURE__ */ e.jsx(
540
+ "svg",
541
+ {
542
+ className: `w-5 h-5 transition-transform duration-200 ${k ? "rotate-180" : ""}`,
543
+ fill: "none",
544
+ stroke: "currentColor",
545
+ viewBox: "0 0 24 24",
546
+ children: /* @__PURE__ */ e.jsx(
547
+ "path",
548
+ {
549
+ strokeLinecap: "round",
550
+ strokeLinejoin: "round",
551
+ strokeWidth: 2,
552
+ d: "M19 9l-7 7-7-7"
553
+ }
554
+ )
555
+ }
556
+ )
557
+ ] })
558
+ }
559
+ ),
560
+ k && !i && /* @__PURE__ */ e.jsx(
561
+ "div",
562
+ {
563
+ className: "absolute z-[9999] mt-1 w-full bg-white border border-grey rounded-sheet shadow-card max-h-60 overflow-y-auto",
564
+ children: l.map((p, S) => {
565
+ const A = p.value === t, O = f ? f(p.value) : null;
566
+ return /* @__PURE__ */ e.jsx(
567
+ "div",
568
+ {
569
+ className: `
570
+ m-1 px-4 py-2 cursor-pointer transition-colors duration-150
571
+ ${p.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-grey-lighter"}
572
+ ${A ? "bg-primary/10" : ""}
573
+ ${B && O ? P(O) : ""}
574
+ `,
575
+ onClick: () => E(p),
576
+ children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: p.label }) })
577
+ },
578
+ p.value || S
579
+ );
580
+ })
581
+ }
582
+ ),
583
+ (s || a) && /* @__PURE__ */ e.jsx("p", { className: `mt-1 text-sm ${s ? "text-danger" : "text-grey-medium"}`, children: s || a })
584
+ ] });
585
+ }, be = ({
586
+ label: n,
587
+ options: l = [],
588
+ value: t,
589
+ onChange: o,
590
+ error: s,
591
+ helperText: a,
592
+ disabled: i = !1,
593
+ required: d = !1,
594
+ fullWidth: c = !1,
595
+ placeholder: u = "Search or select an option",
596
+ size: b = "md",
597
+ className: h = "",
598
+ searchPlaceholder: g = "Type to search...",
599
+ noResultsText: f = "No results found",
600
+ multiple: N = !1,
601
+ ...k
602
+ }) => {
603
+ const [v, C] = M(!1), [R, E] = M(""), T = Q(null), z = Q(null), P = {
604
+ sm: "px-3 py-1.5 text-sm",
605
+ md: "px-4 py-2 text-base",
606
+ lg: "px-5 py-3 text-lg"
607
+ };
608
+ W(() => {
609
+ const x = ($) => {
610
+ T.current && !T.current.contains($.target) && (C(!1), E(""));
611
+ };
612
+ return v && document.addEventListener("mousedown", x), () => {
613
+ document.removeEventListener("mousedown", x);
614
+ };
615
+ }, [v]), W(() => {
616
+ v && z.current && z.current.focus();
617
+ }, [v]);
618
+ const I = (x) => {
619
+ if (!x.disabled)
620
+ if (N) {
621
+ const $ = Array.isArray(t) ? t : [], D = $.includes(x.value) ? $.filter((V) => V !== x.value) : [...$, x.value];
622
+ o({ target: { value: D } });
623
+ } else
624
+ o({ target: { value: x.value } }), C(!1), E("");
625
+ }, B = (x, $) => {
626
+ if ($.stopPropagation(), N) {
627
+ const D = (Array.isArray(t) ? t : []).filter((V) => V !== x);
628
+ o({ target: { value: D } });
629
+ }
630
+ }, L = l.find((x) => x.value === t), p = N && Array.isArray(t) ? l.filter((x) => t.includes(x.value)) : [], S = N ? p.length > 0 ? `${p.length} selected` : u : L?.label || u, A = l.filter(
631
+ (x) => x.label.toLowerCase().includes(R.toLowerCase())
632
+ ), O = `
633
+ w-full rounded-sheet border transition-all duration-200
634
+ focus:outline-none focus:ring-2
635
+ disabled:bg-grey-lighter disabled:cursor-not-allowed
636
+ cursor-pointer
637
+ bg-white text-dark
638
+ ${s ? "border-danger focus:ring-danger/30" : "border-grey focus:border-primary focus:ring-primary/30"}
639
+ ${P[b]}
640
+ ${h}
641
+ ${i ? "opacity-50 cursor-not-allowed" : ""}
642
+ `;
643
+ return /* @__PURE__ */ e.jsxs("div", { className: `${c ? "w-full" : ""} relative`, ref: T, children: [
644
+ n && /* @__PURE__ */ e.jsxs("label", { className: "block mb-2 font-semibold text-dark text-sm", children: [
645
+ n,
646
+ d && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", children: "*" })
647
+ ] }),
648
+ /* @__PURE__ */ e.jsx(
649
+ "div",
650
+ {
651
+ className: O,
652
+ onClick: () => !i && C(!v),
653
+ role: "button",
654
+ tabIndex: 0,
655
+ onKeyDown: (x) => {
656
+ (x.key === "Enter" || x.key === " ") && (x.preventDefault(), !i && C(!v));
657
+ },
658
+ children: /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-center", children: [
659
+ N && p.length > 0 ? /* @__PURE__ */ e.jsx("div", { className: "flex flex-wrap gap-1 flex-1 mr-2", children: p.map((x) => /* @__PURE__ */ e.jsxs(
660
+ "span",
661
+ {
662
+ className: "inline-flex items-center gap-1 px-2 py-1 bg-primary/10 text-primary rounded text-sm font-semibold",
663
+ children: [
664
+ x.label,
665
+ /* @__PURE__ */ e.jsx(
666
+ "button",
667
+ {
668
+ onClick: ($) => B(x.value, $),
669
+ className: "hover:bg-primary/20 rounded-full p-0.5",
670
+ type: "button",
671
+ children: /* @__PURE__ */ e.jsx(
672
+ "svg",
673
+ {
674
+ className: "w-3 h-3",
675
+ fill: "none",
676
+ stroke: "currentColor",
677
+ viewBox: "0 0 24 24",
678
+ children: /* @__PURE__ */ e.jsx(
679
+ "path",
680
+ {
681
+ strokeLinecap: "round",
682
+ strokeLinejoin: "round",
683
+ strokeWidth: 2,
684
+ d: "M6 18L18 6M6 6l12 12"
685
+ }
686
+ )
687
+ }
688
+ )
689
+ }
690
+ )
691
+ ]
692
+ },
693
+ x.value
694
+ )) }) : /* @__PURE__ */ e.jsx("span", { className: `font-semibold ${!L && !p.length && "text-grey-medium"}`, children: S }),
695
+ /* @__PURE__ */ e.jsx(
696
+ "svg",
697
+ {
698
+ className: `w-5 h-5 transition-transform duration-200 flex-shrink-0 ${v ? "rotate-180" : ""}`,
699
+ fill: "none",
700
+ stroke: "currentColor",
701
+ viewBox: "0 0 24 24",
702
+ children: /* @__PURE__ */ e.jsx(
703
+ "path",
704
+ {
705
+ strokeLinecap: "round",
706
+ strokeLinejoin: "round",
707
+ strokeWidth: 2,
708
+ d: "M19 9l-7 7-7-7"
709
+ }
710
+ )
711
+ }
712
+ )
713
+ ] })
714
+ }
715
+ ),
716
+ v && !i && /* @__PURE__ */ e.jsxs(
717
+ "div",
718
+ {
719
+ className: "absolute z-[9999] mt-1 w-full bg-white border border-grey rounded-sheet shadow-card",
720
+ children: [
721
+ /* @__PURE__ */ e.jsx("div", { className: "p-2 border-b border-grey", children: /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
722
+ /* @__PURE__ */ e.jsx(
723
+ "svg",
724
+ {
725
+ className: "absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-grey-medium",
726
+ fill: "none",
727
+ stroke: "currentColor",
728
+ viewBox: "0 0 24 24",
729
+ children: /* @__PURE__ */ e.jsx(
730
+ "path",
731
+ {
732
+ strokeLinecap: "round",
733
+ strokeLinejoin: "round",
734
+ strokeWidth: 2,
735
+ d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
736
+ }
737
+ )
738
+ }
739
+ ),
740
+ /* @__PURE__ */ e.jsx(
741
+ "input",
742
+ {
743
+ ref: z,
744
+ type: "text",
745
+ className: "w-full pl-10 pr-4 py-2 border border-grey rounded-sheet focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary",
746
+ placeholder: g,
747
+ value: R,
748
+ onChange: (x) => E(x.target.value),
749
+ onClick: (x) => x.stopPropagation()
750
+ }
751
+ )
752
+ ] }) }),
753
+ /* @__PURE__ */ e.jsx("div", { className: "max-h-60 overflow-y-auto", children: A.length > 0 ? A.map((x, $) => {
754
+ const _ = N ? Array.isArray(t) && t.includes(x.value) : x.value === t;
755
+ return /* @__PURE__ */ e.jsx(
756
+ "div",
757
+ {
758
+ className: `
759
+ px-4 py-2 cursor-pointer transition-colors duration-150
760
+ ${x.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-grey-lighter"}
761
+ ${_ ? "bg-primary/10" : ""}
762
+ `,
763
+ onClick: () => I(x),
764
+ children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
765
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 flex-1", children: [
766
+ N && /* @__PURE__ */ e.jsx(
767
+ "div",
768
+ {
769
+ className: `w-5 h-5 rounded border-2 flex items-center justify-center transition-colors ${_ ? "bg-primary border-primary" : "border-grey"}`,
770
+ children: _ && /* @__PURE__ */ e.jsx(
771
+ "svg",
772
+ {
773
+ className: "w-3 h-3 text-white",
774
+ fill: "currentColor",
775
+ viewBox: "0 0 20 20",
776
+ children: /* @__PURE__ */ e.jsx(
777
+ "path",
778
+ {
779
+ fillRule: "evenodd",
780
+ d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
781
+ clipRule: "evenodd"
782
+ }
783
+ )
784
+ }
785
+ )
786
+ }
787
+ ),
788
+ /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: x.label })
789
+ ] }),
790
+ !N && _ && /* @__PURE__ */ e.jsx(
791
+ "svg",
792
+ {
793
+ className: "w-5 h-5 text-primary",
794
+ fill: "currentColor",
795
+ viewBox: "0 0 20 20",
796
+ children: /* @__PURE__ */ e.jsx(
797
+ "path",
798
+ {
799
+ fillRule: "evenodd",
800
+ d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
801
+ clipRule: "evenodd"
802
+ }
803
+ )
804
+ }
805
+ )
806
+ ] })
807
+ },
808
+ x.value || $
809
+ );
810
+ }) : /* @__PURE__ */ e.jsx("div", { className: "px-4 py-8 text-center text-grey-medium", children: f }) })
811
+ ]
812
+ }
813
+ ),
814
+ (s || a) && /* @__PURE__ */ e.jsx("p", { className: `mt-1 text-sm ${s ? "text-danger" : "text-grey-medium"}`, children: s || a })
815
+ ] });
816
+ }, ge = ({
817
+ label: n,
818
+ placeholder: l,
819
+ value: t,
820
+ onChange: o,
821
+ error: s,
822
+ helperText: a,
823
+ disabled: i = !1,
824
+ required: d = !1,
825
+ fullWidth: c = !1,
826
+ rows: u = 4,
827
+ resize: b = !0,
828
+ className: h = "",
829
+ ...g
830
+ }) => {
831
+ const f = `
832
+ w-full rounded-sheet border transition-all duration-200 px-4 py-2
833
+ focus:outline-none focus:ring-2
834
+ disabled:bg-grey-lighter disabled:cursor-not-allowed
835
+ ${s ? "border-danger focus:ring-danger/30" : "border-grey focus:border-primary focus:ring-primary/30"}
836
+ ${b ? "resize-y" : "resize-none"}
837
+ ${h}
838
+ `;
839
+ return /* @__PURE__ */ e.jsxs("div", { className: `${c ? "w-full" : ""}`, children: [
840
+ n && /* @__PURE__ */ e.jsxs("label", { className: "block mb-2 font-semibold text-dark text-sm", children: [
841
+ n,
842
+ d && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", children: "*" })
843
+ ] }),
844
+ /* @__PURE__ */ e.jsx(
845
+ "textarea",
846
+ {
847
+ value: t,
848
+ onChange: o,
849
+ placeholder: l,
850
+ disabled: i,
851
+ required: d,
852
+ rows: u,
853
+ className: f,
854
+ ...g
855
+ }
856
+ ),
857
+ (s || a) && /* @__PURE__ */ e.jsx("p", { className: `mt-1 text-sm ${s ? "text-danger" : "text-grey-medium"}`, children: s || a })
858
+ ] });
859
+ }, he = ({
860
+ children: n,
861
+ title: l,
862
+ subtitle: t,
863
+ footer: o,
864
+ hoverable: s = !1,
865
+ clickable: a = !1,
866
+ onClick: i,
867
+ className: d = "",
868
+ ...c
869
+ }) => {
870
+ const u = `
871
+ bg-white rounded-card shadow-card p-6
872
+ ${s ? "hover:shadow-lg transition-shadow duration-200" : ""}
873
+ ${a ? "cursor-pointer hover:shadow-lg transition-shadow duration-200" : ""}
874
+ ${d}
875
+ `;
876
+ return /* @__PURE__ */ e.jsxs(
877
+ "div",
878
+ {
879
+ className: u,
880
+ onClick: a ? i : void 0,
881
+ ...c,
882
+ children: [
883
+ (l || t) && /* @__PURE__ */ e.jsxs("div", { className: "mb-4", children: [
884
+ l && /* @__PURE__ */ e.jsx("h3", { className: "text-lg font-semibold text-dark mb-1", children: l }),
885
+ t && /* @__PURE__ */ e.jsx("p", { className: "text-sm text-grey-medium", children: t })
886
+ ] }),
887
+ /* @__PURE__ */ e.jsx("div", { children: n }),
888
+ o && /* @__PURE__ */ e.jsx("div", { className: "mt-4 pt-4 border-t border-grey", children: o })
889
+ ]
890
+ }
891
+ );
892
+ }, pe = ({
893
+ children: n,
894
+ variant: l = "primary",
895
+ size: t = "md",
896
+ rounded: o = !1,
897
+ className: s = ""
898
+ }) => {
899
+ const a = {
900
+ primary: "bg-primary-light text-primary",
901
+ secondary: "bg-secondary/20 text-secondary",
902
+ success: "bg-success/20 text-success",
903
+ danger: "bg-danger-bg text-danger",
904
+ warning: "bg-warning-bg text-warning",
905
+ info: "bg-info-bg text-info",
906
+ grey: "bg-grey text-grey-dark"
907
+ }, i = {
908
+ sm: "px-2 py-0.5 text-xs",
909
+ md: "px-3 py-1 text-sm",
910
+ lg: "px-4 py-1.5 text-base"
911
+ }, d = `
912
+ inline-flex items-center justify-center font-semibold
913
+ ${o ? "rounded-full" : "rounded"}
914
+ ${a[l]}
915
+ ${i[t]}
916
+ ${s}
917
+ `;
918
+ return /* @__PURE__ */ e.jsx("span", { className: d, children: n });
919
+ }, ve = ({
920
+ children: n,
921
+ variant: l = "info",
922
+ title: t,
923
+ onClose: o,
924
+ showIcon: s = !0,
925
+ className: a = ""
926
+ }) => {
927
+ const i = {
928
+ success: "bg-success/10 border-success text-success",
929
+ danger: "bg-danger-bg border-danger text-danger",
930
+ warning: "bg-warning-bg border-warning text-warning",
931
+ info: "bg-info-bg border-info text-info"
932
+ }, d = {
933
+ success: /* @__PURE__ */ e.jsx("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e.jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z", clipRule: "evenodd" }) }),
934
+ danger: /* @__PURE__ */ e.jsx("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e.jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z", clipRule: "evenodd" }) }),
935
+ warning: /* @__PURE__ */ e.jsx("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e.jsx("path", { fillRule: "evenodd", d: "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z", clipRule: "evenodd" }) }),
936
+ info: /* @__PURE__ */ e.jsx("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e.jsx("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z", clipRule: "evenodd" }) })
937
+ };
938
+ return /* @__PURE__ */ e.jsx(
939
+ "div",
940
+ {
941
+ className: `rounded border p-4 ${i[l]} ${a}`,
942
+ role: "alert",
943
+ children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-start", children: [
944
+ s && /* @__PURE__ */ e.jsx("div", { className: "flex-shrink-0", children: d[l] }),
945
+ /* @__PURE__ */ e.jsxs("div", { className: `flex-1 ${s ? "ml-3" : ""}`, children: [
946
+ t && /* @__PURE__ */ e.jsx("h3", { className: "font-semibold mb-1", children: t }),
947
+ /* @__PURE__ */ e.jsx("div", { className: t ? "text-sm" : "", children: n })
948
+ ] }),
949
+ o && /* @__PURE__ */ e.jsx(
950
+ "button",
951
+ {
952
+ onClick: o,
953
+ className: "ml-3 flex-shrink-0 hover:opacity-70 transition-opacity",
954
+ "aria-label": "Close alert",
955
+ children: /* @__PURE__ */ e.jsx("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e.jsx("path", { fillRule: "evenodd", d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z", clipRule: "evenodd" }) })
956
+ }
957
+ )
958
+ ] })
959
+ }
960
+ );
961
+ }, ye = ({
962
+ children: n,
963
+ variant: l = "info",
964
+ className: t = ""
965
+ }) => {
966
+ const o = {
967
+ info: "bg-info-bg border-info text-dark",
968
+ warning: "bg-warning-bg border-warning text-dark",
969
+ danger: "bg-danger-bg border-danger text-dark"
970
+ };
971
+ return /* @__PURE__ */ e.jsx(
972
+ "div",
973
+ {
974
+ className: `border rounded p-4 ${o[l]} ${t}`,
975
+ children: n
976
+ }
977
+ );
978
+ }, X = ({
979
+ size: n = "md",
980
+ color: l = "primary",
981
+ className: t = ""
982
+ }) => {
983
+ const o = {
984
+ sm: 20,
985
+ md: 32,
986
+ lg: 48,
987
+ xl: 64
988
+ }, s = {
989
+ primary: "var(--color-primary)",
990
+ secondary: "var(--color-secondary)",
991
+ success: "var(--color-success)",
992
+ danger: "var(--color-danger)",
993
+ warning: "var(--color-warning)",
994
+ info: "var(--color-info)",
995
+ white: "#ffffff"
996
+ }, a = o[n], i = s[l], d = Math.max(2, a / 10), c = (a - d) / 2, u = 2 * Math.PI * c;
997
+ return /* @__PURE__ */ e.jsx(
998
+ "div",
999
+ {
1000
+ className: `inline-block ${t}`,
1001
+ style: { width: a, height: a },
1002
+ role: "status",
1003
+ "aria-label": "Loading",
1004
+ children: /* @__PURE__ */ e.jsxs(
1005
+ "svg",
1006
+ {
1007
+ width: a,
1008
+ height: a,
1009
+ viewBox: `0 0 ${a} ${a}`,
1010
+ className: "animate-spin",
1011
+ children: [
1012
+ /* @__PURE__ */ e.jsx(
1013
+ "circle",
1014
+ {
1015
+ cx: a / 2,
1016
+ cy: a / 2,
1017
+ r: c,
1018
+ fill: "none",
1019
+ stroke: i,
1020
+ strokeWidth: d,
1021
+ strokeLinecap: "round",
1022
+ strokeDasharray: `${u * 0.25} ${u * 0.75}`,
1023
+ opacity: "0.3"
1024
+ }
1025
+ ),
1026
+ /* @__PURE__ */ e.jsx(
1027
+ "circle",
1028
+ {
1029
+ cx: a / 2,
1030
+ cy: a / 2,
1031
+ r: c,
1032
+ fill: "none",
1033
+ stroke: i,
1034
+ strokeWidth: d,
1035
+ strokeLinecap: "round",
1036
+ strokeDasharray: `${u * 0.25} ${u * 0.75}`,
1037
+ opacity: "0.6",
1038
+ transform: `rotate(120 ${a / 2} ${a / 2})`
1039
+ }
1040
+ ),
1041
+ /* @__PURE__ */ e.jsx(
1042
+ "circle",
1043
+ {
1044
+ cx: a / 2,
1045
+ cy: a / 2,
1046
+ r: c,
1047
+ fill: "none",
1048
+ stroke: i,
1049
+ strokeWidth: d,
1050
+ strokeLinecap: "round",
1051
+ strokeDasharray: `${u * 0.25} ${u * 0.75}`,
1052
+ opacity: "1",
1053
+ transform: `rotate(240 ${a / 2} ${a / 2})`
1054
+ }
1055
+ )
1056
+ ]
1057
+ }
1058
+ )
1059
+ }
1060
+ );
1061
+ }, ie = ({
1062
+ variant: n = "text",
1063
+ width: l,
1064
+ height: t,
1065
+ circle: o = !1,
1066
+ count: s = 1,
1067
+ className: a = ""
1068
+ }) => {
1069
+ const c = `
1070
+ bg-primary-light relative overflow-hidden
1071
+ ${o ? "rounded-full" : {
1072
+ text: "h-4 rounded",
1073
+ title: "h-6 rounded",
1074
+ button: "h-10 rounded-btn",
1075
+ card: "h-32 rounded-card",
1076
+ avatar: "w-10 h-10 rounded-full"
1077
+ }[n]}
1078
+ ${a}
1079
+ `, u = {
1080
+ width: l || (n === "text" || n === "title" ? "100%" : void 0),
1081
+ height: t
1082
+ }, b = {
1083
+ position: "absolute",
1084
+ top: 0,
1085
+ left: 0,
1086
+ right: 0,
1087
+ bottom: 0,
1088
+ background: "linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent)"
1089
+ }, h = () => /* @__PURE__ */ e.jsx("div", { className: c, style: u, children: /* @__PURE__ */ e.jsx("div", { className: "animate-shimmer", style: b }) });
1090
+ return s > 1 ? /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: Array.from({ length: s }).map((g, f) => /* @__PURE__ */ e.jsx("div", { children: h() }, f)) }) : h();
1091
+ }, we = ({
1092
+ type: n = "spinner",
1093
+ // 'spinner' | 'skeleton'
1094
+ variant: l = "inline",
1095
+ // 'inline' | 'overlay' | 'block'
1096
+ size: t = "md",
1097
+ color: o = "primary",
1098
+ text: s,
1099
+ skeletonProps: a = {},
1100
+ className: i = "",
1101
+ children: d
1102
+ }) => n === "spinner" ? l === "overlay" ? /* @__PURE__ */ e.jsx("div", { className: `absolute inset-0 flex items-center justify-center bg-white bg-opacity-75 z-10 ${i}`, children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center gap-2", children: [
1103
+ /* @__PURE__ */ e.jsx(X, { size: t, color: o }),
1104
+ s && /* @__PURE__ */ e.jsx("span", { className: "text-sm text-grey-medium", children: s })
1105
+ ] }) }) : l === "block" ? /* @__PURE__ */ e.jsx("div", { className: `flex items-center justify-center py-8 ${i}`, children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center gap-2", children: [
1106
+ /* @__PURE__ */ e.jsx(X, { size: t, color: o }),
1107
+ s && /* @__PURE__ */ e.jsx("span", { className: "text-sm text-grey-medium", children: s })
1108
+ ] }) }) : /* @__PURE__ */ e.jsxs("div", { className: `inline-flex items-center gap-2 ${i}`, children: [
1109
+ /* @__PURE__ */ e.jsx(X, { size: t, color: o }),
1110
+ s && /* @__PURE__ */ e.jsx("span", { className: "text-sm text-grey-medium", children: s })
1111
+ ] }) : n === "skeleton" ? /* @__PURE__ */ e.jsx(ie, { ...a, className: i }) : null, je = ({
1112
+ isOpen: n,
1113
+ onClose: l,
1114
+ onConfirm: t,
1115
+ title: o = "NOTE",
1116
+ message: s = "",
1117
+ children: a,
1118
+ variant: i = "primary",
1119
+ type: d = "alert",
1120
+ confirmText: c = "Conferma",
1121
+ cancelText: u = "Annulla",
1122
+ closeText: b = "OK",
1123
+ closeOnBackdropClick: h = !1,
1124
+ closeOnEscape: g = !1
1125
+ }) => {
1126
+ if (W(() => {
1127
+ const R = (E) => {
1128
+ E.key === "Escape" && n && g && l?.();
1129
+ };
1130
+ return n && (document.addEventListener("keydown", R), document.body.style.overflow = "hidden"), () => {
1131
+ document.removeEventListener("keydown", R), document.body.style.overflow = "unset";
1132
+ };
1133
+ }, [n, l, g]), !n) return null;
1134
+ const f = {
1135
+ primary: {
1136
+ header: "bg-primary",
1137
+ button: "bg-primary hover:bg-primary-hover text-white",
1138
+ buttonOutline: "border-2 border-primary text-primary hover:bg-primary-light"
1139
+ },
1140
+ warning: {
1141
+ header: "bg-warning",
1142
+ button: "bg-warning hover:bg-warning text-white",
1143
+ buttonOutline: "border-2 border-warning text-warning hover:bg-warning-light"
1144
+ },
1145
+ info: {
1146
+ header: "bg-info",
1147
+ button: "bg-info hover:bg-info text-white",
1148
+ buttonOutline: "border-2 border-info text-info hover:bg-blue-100"
1149
+ },
1150
+ danger: {
1151
+ header: "bg-danger",
1152
+ button: "bg-danger hover:bg-danger-hover text-white",
1153
+ buttonOutline: "border-2 border-danger text-danger hover:bg-danger-light/30"
1154
+ }
1155
+ }, N = () => {
1156
+ h && l?.();
1157
+ }, k = () => {
1158
+ t?.();
1159
+ }, v = () => {
1160
+ l?.();
1161
+ }, C = () => {
1162
+ if (d === "alert")
1163
+ return /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ e.jsx(
1164
+ "button",
1165
+ {
1166
+ onClick: v,
1167
+ className: `px-6 py-2 rounded-btn font-semibold transition-colors ${f[i].button}`,
1168
+ children: b
1169
+ }
1170
+ ) });
1171
+ if (d === "confirm" || d === "custom")
1172
+ return /* @__PURE__ */ e.jsxs("div", { className: "flex justify-end gap-3", children: [
1173
+ /* @__PURE__ */ e.jsx(
1174
+ "button",
1175
+ {
1176
+ onClick: v,
1177
+ className: `px-6 py-2 rounded-btn font-semibold transition-colors ${f[i].buttonOutline}`,
1178
+ children: u
1179
+ }
1180
+ ),
1181
+ /* @__PURE__ */ e.jsx(
1182
+ "button",
1183
+ {
1184
+ onClick: k,
1185
+ className: `px-6 py-2 rounded-btn font-semibold transition-colors ${f[i].button}`,
1186
+ children: c
1187
+ }
1188
+ )
1189
+ ] });
1190
+ };
1191
+ return /* @__PURE__ */ e.jsxs("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
1192
+ /* @__PURE__ */ e.jsx(
1193
+ "div",
1194
+ {
1195
+ className: "fixed inset-0 bg-black/40 backdrop-blur-sm",
1196
+ onClick: N
1197
+ }
1198
+ ),
1199
+ /* @__PURE__ */ e.jsxs(
1200
+ "div",
1201
+ {
1202
+ className: "relative bg-white rounded-modal shadow-card w-full max-w-md flex flex-col animate-fadeIn",
1203
+ onClick: (R) => R.stopPropagation(),
1204
+ children: [
1205
+ /* @__PURE__ */ e.jsx("div", { className: `flex items-center justify-center p-6 rounded-t-modal ${f[i].header}`, children: /* @__PURE__ */ e.jsx("h2", { className: "text-xl font-semibold text-white uppercase tracking-wide", children: o }) }),
1206
+ /* @__PURE__ */ e.jsx("div", { className: "p-6 flex-1", children: d === "custom" ? a : /* @__PURE__ */ e.jsx("p", { className: "text-dark text-base", children: s }) }),
1207
+ /* @__PURE__ */ e.jsx("div", { className: "p-6 border-t border-grey", children: C() })
1208
+ ]
1209
+ }
1210
+ )
1211
+ ] });
1212
+ }, Ne = ({
1213
+ children: n,
1214
+ content: l,
1215
+ variant: t = "primary",
1216
+ title: o,
1217
+ position: s = "top",
1218
+ className: a = ""
1219
+ }) => {
1220
+ const [i, d] = M(!1), c = {
1221
+ primary: "border-primary bg-white",
1222
+ warning: "border-warning bg-white",
1223
+ danger: "border-danger bg-white"
1224
+ }, u = {
1225
+ primary: "text-primary",
1226
+ warning: "text-warning",
1227
+ danger: "text-danger"
1228
+ }, b = {
1229
+ primary: "border-primary",
1230
+ warning: "border-warning",
1231
+ danger: "border-danger"
1232
+ }, h = {
1233
+ top: "bottom-full left-1/2 -translate-x-1/2 mb-3",
1234
+ bottom: "top-full left-1/2 -translate-x-1/2 mt-3",
1235
+ left: "right-full top-1/2 -translate-y-1/2 mr-3",
1236
+ right: "left-full top-1/2 -translate-y-1/2 ml-3"
1237
+ }, g = {
1238
+ top: "top-full left-1/2 -translate-x-1/2",
1239
+ bottom: "bottom-full left-1/2 -translate-x-1/2",
1240
+ left: "left-full top-1/2 -translate-y-1/2",
1241
+ right: "right-full top-1/2 -translate-y-1/2"
1242
+ }, f = {
1243
+ top: "border-l-[8px] border-r-[8px] border-t-[8px] border-l-transparent border-r-transparent",
1244
+ bottom: "border-l-[8px] border-r-[8px] border-b-[8px] border-l-transparent border-r-transparent",
1245
+ left: "border-t-[8px] border-b-[8px] border-l-[8px] border-t-transparent border-b-transparent",
1246
+ right: "border-t-[8px] border-b-[8px] border-r-[8px] border-t-transparent border-b-transparent"
1247
+ };
1248
+ return /* @__PURE__ */ e.jsxs(
1249
+ "div",
1250
+ {
1251
+ className: "relative inline-block",
1252
+ onMouseEnter: () => d(!0),
1253
+ onMouseLeave: () => d(!1),
1254
+ children: [
1255
+ n,
1256
+ i && /* @__PURE__ */ e.jsx(
1257
+ "div",
1258
+ {
1259
+ className: `absolute z-50 ${h[s]} pointer-events-none`,
1260
+ role: "tooltip",
1261
+ children: /* @__PURE__ */ e.jsxs(
1262
+ "div",
1263
+ {
1264
+ className: `rounded-sheet border-[3px] p-4 shadow-lg min-w-[200px] max-w-[300px] ${c[t]} ${a} relative`,
1265
+ children: [
1266
+ o && /* @__PURE__ */ e.jsx("h3", { className: `text-sm font-semibold mb-2 uppercase tracking-wider ${u[t]}`, children: o }),
1267
+ /* @__PURE__ */ e.jsx("div", { className: "text-sm text-grey-dark", children: l }),
1268
+ /* @__PURE__ */ e.jsx("div", { className: `absolute ${g[s]} w-0 h-0 ${f[s]} ${b[t]}` })
1269
+ ]
1270
+ }
1271
+ )
1272
+ }
1273
+ )
1274
+ ]
1275
+ }
1276
+ );
1277
+ }, ke = ({
1278
+ children: n,
1279
+ expandedContent: l,
1280
+ defaultExpanded: t = !1,
1281
+ asTableRow: o = !1,
1282
+ className: s = "",
1283
+ arrowClassName: a = "",
1284
+ contentClassName: i = "",
1285
+ onToggle: d
1286
+ }) => {
1287
+ const [c, u] = M(t), b = (g) => {
1288
+ g.stopPropagation();
1289
+ const f = !c;
1290
+ u(f), d && d(f);
1291
+ }, h = ({ className: g = "" }) => /* @__PURE__ */ e.jsx(
1292
+ "svg",
1293
+ {
1294
+ className: `w-5 h-5 transition-transform duration-200 ${c ? "rotate-90" : ""} ${g}`,
1295
+ fill: "currentColor",
1296
+ viewBox: "0 0 20 20",
1297
+ children: /* @__PURE__ */ e.jsx(
1298
+ "path",
1299
+ {
1300
+ fillRule: "evenodd",
1301
+ d: "M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",
1302
+ clipRule: "evenodd"
1303
+ }
1304
+ )
1305
+ }
1306
+ );
1307
+ return o ? /* @__PURE__ */ e.jsxs(se.Fragment, { children: [
1308
+ /* @__PURE__ */ e.jsxs("tr", { className: `border-b border-grey hover:bg-grey-lightest transition-colors ${s}`, children: [
1309
+ /* @__PURE__ */ e.jsx("td", { className: "px-4 py-3 w-12", children: /* @__PURE__ */ e.jsx(
1310
+ "button",
1311
+ {
1312
+ onClick: b,
1313
+ className: `text-primary hover:text-primary-hover transition-colors ${a}`,
1314
+ "aria-label": c ? "Collapse" : "Expand",
1315
+ children: /* @__PURE__ */ e.jsx(h, {})
1316
+ }
1317
+ ) }),
1318
+ n
1319
+ ] }),
1320
+ c && /* @__PURE__ */ e.jsx("tr", { className: "border-b border-grey bg-grey-lightest/50", children: /* @__PURE__ */ e.jsx("td", { colSpan: "100%", className: `px-4 py-4 ${i}`, children: l }) })
1321
+ ] }) : /* @__PURE__ */ e.jsxs("div", { className: `border border-grey rounded-card overflow-hidden ${s}`, children: [
1322
+ /* @__PURE__ */ e.jsxs(
1323
+ "div",
1324
+ {
1325
+ className: "flex items-center gap-3 p-4 bg-white hover:bg-grey-lightest transition-colors cursor-pointer",
1326
+ onClick: b,
1327
+ children: [
1328
+ /* @__PURE__ */ e.jsx(
1329
+ "button",
1330
+ {
1331
+ className: `text-primary hover:text-primary-hover transition-colors ${a}`,
1332
+ "aria-label": c ? "Collapse" : "Expand",
1333
+ children: /* @__PURE__ */ e.jsx(h, {})
1334
+ }
1335
+ ),
1336
+ /* @__PURE__ */ e.jsx("div", { className: "flex-1", children: n })
1337
+ ]
1338
+ }
1339
+ ),
1340
+ c && /* @__PURE__ */ e.jsx("div", { className: `p-4 bg-grey-lightest/50 border-t border-grey ${i}`, children: l })
1341
+ ] });
1342
+ }, $e = ({
1343
+ label: n,
1344
+ checked: l = !1,
1345
+ onChange: t,
1346
+ disabled: o = !1,
1347
+ error: s = !1,
1348
+ helperText: a,
1349
+ required: i = !1,
1350
+ className: d = "",
1351
+ ...c
1352
+ }) => {
1353
+ const u = (b) => {
1354
+ !o && t && t(b);
1355
+ };
1356
+ return /* @__PURE__ */ e.jsxs("div", { className: `${d}`, children: [
1357
+ /* @__PURE__ */ e.jsxs("label", { className: `flex items-center gap-3 cursor-pointer ${o ? "opacity-50 cursor-not-allowed" : ""}`, children: [
1358
+ /* @__PURE__ */ e.jsx(
1359
+ "div",
1360
+ {
1361
+ className: `w-6 h-6 rounded border flex items-center justify-center transition-colors flex-shrink-0 ${l ? "bg-primary border-primary" : s ? "border-danger" : "border-grey"} ${o ? "cursor-not-allowed" : "cursor-pointer"}`,
1362
+ onClick: (b) => {
1363
+ b.stopPropagation(), !o && t && t({ target: { checked: !l } });
1364
+ },
1365
+ children: l && /* @__PURE__ */ e.jsx(
1366
+ "svg",
1367
+ {
1368
+ className: "w-4 h-4 text-white",
1369
+ fill: "currentColor",
1370
+ viewBox: "0 0 20 20",
1371
+ children: /* @__PURE__ */ e.jsx(
1372
+ "path",
1373
+ {
1374
+ fillRule: "evenodd",
1375
+ d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
1376
+ clipRule: "evenodd"
1377
+ }
1378
+ )
1379
+ }
1380
+ )
1381
+ }
1382
+ ),
1383
+ /* @__PURE__ */ e.jsx(
1384
+ "input",
1385
+ {
1386
+ type: "checkbox",
1387
+ checked: l,
1388
+ onChange: u,
1389
+ disabled: o,
1390
+ className: "sr-only",
1391
+ ...c
1392
+ }
1393
+ ),
1394
+ n && /* @__PURE__ */ e.jsxs("span", { className: "font-semibold text-dark text-base", children: [
1395
+ n,
1396
+ i && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", children: "*" })
1397
+ ] })
1398
+ ] }),
1399
+ (s || a) && /* @__PURE__ */ e.jsx("p", { className: `mt-1 text-sm ml-9 ${s ? "text-danger" : "text-grey-medium"}`, children: s || a })
1400
+ ] });
1401
+ }, Ce = ({
1402
+ checked: n = !1,
1403
+ onChange: l,
1404
+ disabled: t = !1,
1405
+ label: o,
1406
+ error: s,
1407
+ helperText: a,
1408
+ required: i = !1,
1409
+ className: d = "",
1410
+ ...c
1411
+ }) => {
1412
+ const u = () => {
1413
+ !t && l && l(!n);
1414
+ };
1415
+ return /* @__PURE__ */ e.jsxs("div", { className: `inline-flex flex-col ${d}`, children: [
1416
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
1417
+ /* @__PURE__ */ e.jsx(
1418
+ "button",
1419
+ {
1420
+ type: "button",
1421
+ role: "switch",
1422
+ "aria-checked": n,
1423
+ disabled: t,
1424
+ onClick: u,
1425
+ className: `
1426
+ relative inline-flex h-8 w-14 items-center rounded-full
1427
+ transition-colors duration-200 ease-in-out
1428
+ focus:outline-none focus:ring-2 focus:ring-offset-2
1429
+ ${t ? "cursor-not-allowed opacity-50" : "cursor-pointer"}
1430
+ ${n ? "bg-primary focus:ring-primary" : "bg-grey-medium focus:ring-grey-medium"}
1431
+ ${s ? "ring-2 ring-danger" : ""}
1432
+ `,
1433
+ ...c,
1434
+ children: /* @__PURE__ */ e.jsx(
1435
+ "span",
1436
+ {
1437
+ className: `
1438
+ inline-block h-6 w-6 transform rounded-full bg-white
1439
+ transition-transform duration-200 ease-in-out
1440
+ shadow-md
1441
+ ${n ? "translate-x-7" : "translate-x-1"}
1442
+ `
1443
+ }
1444
+ )
1445
+ }
1446
+ ),
1447
+ o && /* @__PURE__ */ e.jsxs("label", { className: `ml-3 text-sm font-medium ${t ? "text-grey-400" : "text-grey-700"}`, children: [
1448
+ o,
1449
+ i && /* @__PURE__ */ e.jsx("span", { className: "ml-1 text-danger", children: "*" })
1450
+ ] })
1451
+ ] }),
1452
+ (a || s) && /* @__PURE__ */ e.jsx("p", { className: `mt-1 text-sm ${s ? "text-danger" : "text-grey-500"}`, children: s || a })
1453
+ ] });
1454
+ }, Re = ({
1455
+ label: n,
1456
+ value: l,
1457
+ onChange: t,
1458
+ error: o,
1459
+ helperText: s,
1460
+ disabled: a = !1,
1461
+ required: i = !1,
1462
+ fullWidth: d = !1,
1463
+ size: c = "md",
1464
+ showTime: u = !1,
1465
+ className: b = "",
1466
+ ...h
1467
+ }) => {
1468
+ const f = `
1469
+ w-full rounded-sheet border transition-all duration-200
1470
+ focus:outline-none focus:ring-2
1471
+ disabled:bg-grey-lighter disabled:cursor-not-allowed
1472
+ ${o ? "border-danger focus:ring-danger/30" : "border-grey focus:border-primary focus:ring-primary/30"}
1473
+ ${{
1474
+ sm: "px-3 py-1.5 text-sm",
1475
+ md: "px-4 py-2 text-base",
1476
+ lg: "px-5 py-3 text-lg"
1477
+ }[c]}
1478
+ ${b}
1479
+ `;
1480
+ return /* @__PURE__ */ e.jsxs("div", { className: `${d ? "w-full" : ""}`, children: [
1481
+ n && /* @__PURE__ */ e.jsxs("label", { className: "block mb-2 font-semibold text-dark text-sm", children: [
1482
+ n,
1483
+ i && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", children: "*" })
1484
+ ] }),
1485
+ /* @__PURE__ */ e.jsx(
1486
+ "input",
1487
+ {
1488
+ type: u ? "datetime-local" : "date",
1489
+ value: l,
1490
+ onChange: t,
1491
+ disabled: a,
1492
+ required: i,
1493
+ className: f,
1494
+ ...h
1495
+ }
1496
+ ),
1497
+ (o || s) && /* @__PURE__ */ e.jsx("p", { className: `mt-1 text-sm ${o ? "text-danger" : "text-grey-medium"}`, children: o || s })
1498
+ ] });
1499
+ }, Ee = ({
1500
+ children: n,
1501
+ variant: l = "info",
1502
+ title: t,
1503
+ onClose: o,
1504
+ showIcon: s = !0,
1505
+ className: a = "",
1506
+ duration: i = 5e3,
1507
+ position: d = "top-right",
1508
+ autoClose: c = !0
1509
+ }) => {
1510
+ const [u, b] = M(!0), [h, g] = M(!1);
1511
+ W(() => {
1512
+ if (c && i > 0) {
1513
+ const E = setTimeout(() => {
1514
+ f();
1515
+ }, i);
1516
+ return () => clearTimeout(E);
1517
+ }
1518
+ }, [c, i]);
1519
+ const f = () => {
1520
+ g(!0), setTimeout(() => {
1521
+ b(!1), o && o();
1522
+ }, 300);
1523
+ };
1524
+ if (!u)
1525
+ return null;
1526
+ const N = {
1527
+ success: "bg-success-bg border-success text-dark",
1528
+ danger: "bg-danger-bg border-danger text-dark",
1529
+ warning: "bg-warning-bg border-warning text-dark",
1530
+ info: "bg-info-bg border-info text-dark"
1531
+ }, k = {
1532
+ success: "text-success",
1533
+ danger: "text-danger",
1534
+ warning: "text-warning",
1535
+ info: "text-info"
1536
+ }, v = {
1537
+ success: /* @__PURE__ */ e.jsx("svg", { className: `w-5 h-5 ${k.success}`, fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e.jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z", clipRule: "evenodd" }) }),
1538
+ danger: /* @__PURE__ */ e.jsx("svg", { className: `w-5 h-5 ${k.danger}`, fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e.jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z", clipRule: "evenodd" }) }),
1539
+ warning: /* @__PURE__ */ e.jsx("svg", { className: `w-5 h-5 ${k.warning}`, fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e.jsx("path", { fillRule: "evenodd", d: "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z", clipRule: "evenodd" }) }),
1540
+ info: /* @__PURE__ */ e.jsx("svg", { className: `w-5 h-5 ${k.info}`, fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e.jsx("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z", clipRule: "evenodd" }) })
1541
+ }, C = {
1542
+ "top-right": "top-4 right-4",
1543
+ "top-left": "top-4 left-4",
1544
+ "bottom-right": "bottom-4 right-4",
1545
+ "bottom-left": "bottom-4 left-4",
1546
+ "top-center": "top-4 left-1/2 -translate-x-1/2",
1547
+ "bottom-center": "bottom-4 left-1/2 -translate-x-1/2"
1548
+ }, R = h ? "opacity-0 translate-x-4" : "opacity-100 translate-x-0";
1549
+ return /* @__PURE__ */ e.jsx(
1550
+ "div",
1551
+ {
1552
+ className: `fixed ${C[d]} z-50 transition-all duration-300 ease-in-out ${R}`,
1553
+ children: /* @__PURE__ */ e.jsx(
1554
+ "div",
1555
+ {
1556
+ className: `rounded border p-4 shadow-lg min-w-[300px] max-w-[500px] ${N[l]} ${a}`,
1557
+ role: "alert",
1558
+ children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-start", children: [
1559
+ s && /* @__PURE__ */ e.jsx("div", { className: "flex-shrink-0 mt-0.5", children: v[l] }),
1560
+ /* @__PURE__ */ e.jsxs("div", { className: `flex-1 ${s ? "ml-3" : ""}`, children: [
1561
+ t && /* @__PURE__ */ e.jsx("h3", { className: "font-semibold mb-1", children: t }),
1562
+ /* @__PURE__ */ e.jsx("div", { className: t ? "text-sm" : "", children: n })
1563
+ ] }),
1564
+ /* @__PURE__ */ e.jsx(
1565
+ "button",
1566
+ {
1567
+ onClick: f,
1568
+ className: "ml-3 flex-shrink-0 hover:opacity-70 transition-opacity",
1569
+ "aria-label": "Close toast",
1570
+ children: /* @__PURE__ */ e.jsx("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e.jsx("path", { fillRule: "evenodd", d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z", clipRule: "evenodd" }) })
1571
+ }
1572
+ )
1573
+ ] })
1574
+ }
1575
+ )
1576
+ }
1577
+ );
1578
+ }, _e = ({
1579
+ children: n,
1580
+ className: l = "",
1581
+ ...t
1582
+ }) => {
1583
+ const s = `flex items-center gap-6 border-b border-grey-medium bg-white ${l}`;
1584
+ return /* @__PURE__ */ e.jsx("nav", { className: s, ...t, children: n });
1585
+ }, Te = ({
1586
+ children: n,
1587
+ active: l = !1,
1588
+ onClick: t,
1589
+ href: o,
1590
+ className: s = "",
1591
+ ...a
1592
+ }) => {
1593
+ const c = `py-3 px-4 font-medium text-sm cursor-pointer transition-all duration-200 border-b-4 -mb-px ${l ? "text-dark border-secondary bg-grey-lightest" : "text-text-secondary border-transparent hover:text-dark hover:border-grey-medium hover:bg-grey-lightest"} ${s}`;
1594
+ return o ? /* @__PURE__ */ e.jsx("a", { href: o, className: c, ...a, children: n }) : /* @__PURE__ */ e.jsx(
1595
+ "div",
1596
+ {
1597
+ className: c,
1598
+ onClick: t,
1599
+ role: "button",
1600
+ tabIndex: 0,
1601
+ onKeyPress: (u) => {
1602
+ (u.key === "Enter" || u.key === " ") && t?.(u);
1603
+ },
1604
+ ...a,
1605
+ children: n
1606
+ }
1607
+ );
1608
+ };
1609
+ export {
1610
+ ke as Accordion,
1611
+ ve as Alert,
1612
+ pe as Badge,
1613
+ je as Bootbox,
1614
+ de as Button,
1615
+ he as Card,
1616
+ $e as Checkbox,
1617
+ Re as DateTimePicker,
1618
+ ye as InfoBox,
1619
+ xe as Input,
1620
+ we as Loader,
1621
+ ue as Modal,
1622
+ _e as Navbar,
1623
+ Te as NavbarItem,
1624
+ fe as Select,
1625
+ be as SelectSearchable,
1626
+ ie as Skeleton,
1627
+ X as Spinner,
1628
+ me as Table,
1629
+ ge as TextArea,
1630
+ Ee as Toast,
1631
+ Ce as Toggle,
1632
+ Ne as Tooltip
1633
+ };