tailwind-ux-kit 1.0.54 → 1.0.56

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.
@@ -1,8 +1,20 @@
1
- import { default as React, ReactNode } from 'react';
2
- type DropdownProps = {
1
+ import { ReactNode, HTMLAttributes } from 'react';
2
+ type DropdownItem<T = any> = {
3
3
  label: ReactNode;
4
- children: ReactNode;
5
- position?: "left" | "center" | "right";
4
+ value: T;
6
5
  };
7
- declare const Dropdown: React.FC<DropdownProps>;
6
+ type DropdownProps<T = any> = {
7
+ label: ReactNode;
8
+ items?: DropdownItem<T>[];
9
+ onSelect?: (value: T) => void;
10
+ renderItem?: (item: DropdownItem<T>, handleSelect: () => void) => ReactNode;
11
+ position?: "left" | "center" | "right";
12
+ className?: string;
13
+ menuClassName?: string;
14
+ width?: string;
15
+ closeOnSelect?: boolean;
16
+ transition?: boolean;
17
+ ariaLabel?: string;
18
+ } & HTMLAttributes<HTMLDivElement>;
19
+ declare const Dropdown: <T>({ label, items, onSelect, renderItem, position, className, menuClassName, width, closeOnSelect, transition, ariaLabel, ...rest }: DropdownProps<T>) => import("react/jsx-runtime").JSX.Element;
8
20
  export default Dropdown;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
- import { jsxs as y, jsx as u } from "react/jsx-runtime";
3
- import P, { forwardRef as q, useState as L, useMemo as $, useId as se, useRef as M, useCallback as E, useEffect as A, createContext as X, useContext as Y } from "react";
4
- const H = {
2
+ import { jsxs as C, jsx as l } from "react/jsx-runtime";
3
+ import A, { forwardRef as q, useState as j, useMemo as O, useId as se, useRef as _, useCallback as P, useEffect as D, createContext as X, useContext as Y } from "react";
4
+ const G = {
5
5
  xs: "text-xs px-2 py-1",
6
6
  sm: "text-sm px-3 py-1.5",
7
7
  md: "text-sm px-3 py-3",
@@ -39,78 +39,78 @@ const H = {
39
39
  id: r,
40
40
  inputSize: s = "md",
41
41
  shape: f = "rounded",
42
- validate: d,
43
- onValidatedChange: l,
44
- className: a = "",
45
- icon: c,
42
+ validate: i,
43
+ onValidatedChange: c,
44
+ className: d = "",
45
+ icon: a,
46
46
  iconPosition: o = "left",
47
- floatingLabelStyle: i,
48
- onChange: g,
47
+ floatingLabelStyle: u,
48
+ onChange: p,
49
49
  isValid: b,
50
- isInvalid: p,
50
+ isInvalid: g,
51
51
  feedback: m,
52
- feedbackType: h = "invalid",
53
- ...w
54
- } = e, [S, N] = L("default"), O = P.useCallback(
52
+ feedbackType: w = "invalid",
53
+ ...y
54
+ } = e, [k, v] = j("default"), $ = A.useCallback(
55
55
  (z) => {
56
- const Z = z.target.value, I = (d == null ? void 0 : d(Z)) ?? "default";
57
- N(I), l == null || l(z, I), g == null || g(z);
56
+ const T = z.target.value, I = (i == null ? void 0 : i(T)) ?? "default";
57
+ v(I), c == null || c(z, I), p == null || p(z);
58
58
  },
59
- [d, l, g]
60
- ), v = $(() => r || (typeof t == "string" ? `input-${t.toLowerCase().replace(/\s+/g, "-")}` : `input-${Math.random().toString(36).slice(2)}`), [r, t]), x = !!i, C = H[s] || H.md, k = W[f] || W.flat, j = $(
61
- () => ie(S, b, p),
62
- [S, b, p]
63
- ), _ = $(() => o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", [o]), B = $(() => c ? o === "start" || o === "left" ? "ps-10" : "pe-10" : "", [c, o]);
64
- return /* @__PURE__ */ y(
59
+ [i, c, p]
60
+ ), N = O(() => r || (typeof t == "string" ? `input-${t.toLowerCase().replace(/\s+/g, "-")}` : `input-${Math.random().toString(36).slice(2)}`), [r, t]), x = !!u, E = G[s] || G.md, h = W[f] || W.flat, S = O(
61
+ () => ie(k, b, g),
62
+ [k, b, g]
63
+ ), L = O(() => o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", [o]), M = O(() => a ? o === "start" || o === "left" ? "ps-10" : "pe-10" : "", [a, o]);
64
+ return /* @__PURE__ */ C(
65
65
  "div",
66
66
  {
67
67
  className: `w-full relative ${x ? "z-0" : ""} tailwind-ux-input`,
68
68
  children: [
69
- !x && t && /* @__PURE__ */ u(
69
+ !x && t && /* @__PURE__ */ l(
70
70
  "label",
71
71
  {
72
- htmlFor: v,
73
- className: `block mb-1 text-sm ${b ? "text-green-700 dark:text-green-500" : p ? "text-red-700 dark:text-red-500" : "text-gray-700"}`,
72
+ htmlFor: N,
73
+ className: `block mb-1 text-sm ${b ? "text-green-700 dark:text-green-500" : g ? "text-red-700 dark:text-red-500" : "text-gray-700"}`,
74
74
  children: t
75
75
  }
76
76
  ),
77
- /* @__PURE__ */ y("div", { className: "relative w-full", children: [
78
- c && /* @__PURE__ */ u(
77
+ /* @__PURE__ */ C("div", { className: "relative w-full", children: [
78
+ a && /* @__PURE__ */ l(
79
79
  "div",
80
80
  {
81
- className: `absolute inset-y-0 flex items-center ${_}`,
81
+ className: `absolute inset-y-0 flex items-center ${L}`,
82
82
  "aria-hidden": "true",
83
- children: /* @__PURE__ */ u("span", { className: "text-gray-500", children: c })
83
+ children: /* @__PURE__ */ l("span", { className: "text-gray-500", children: a })
84
84
  }
85
85
  ),
86
- /* @__PURE__ */ u(
86
+ /* @__PURE__ */ l(
87
87
  "input",
88
88
  {
89
- ...w,
90
- id: v,
89
+ ...y,
90
+ id: N,
91
91
  ref: n,
92
- placeholder: x ? " " : w.placeholder,
93
- onChange: O,
92
+ placeholder: x ? " " : y.placeholder,
93
+ onChange: $,
94
94
  className: `border peer w-full block font-normal appearance-none focus:outline-none focus:ring-0 transition text-gray-900 placeholder-gray-600 border-gray-400
95
- ${C}
96
- ${x && i && ae[i]}
97
- ${B} ${k} ${j} ${a}`
95
+ ${E}
96
+ ${x && u && ae[u]}
97
+ ${M} ${h} ${S} ${d}`
98
98
  }
99
99
  ),
100
- x && t && i && /* @__PURE__ */ u(
100
+ x && t && u && /* @__PURE__ */ l(
101
101
  "label",
102
102
  {
103
- htmlFor: v,
104
- className: `ms-1 ${le[i]} ${a}`,
103
+ htmlFor: N,
104
+ className: `ms-1 ${le[u]} ${d}`,
105
105
  children: t
106
106
  }
107
107
  )
108
108
  ] }),
109
- m && /* @__PURE__ */ u(
109
+ m && /* @__PURE__ */ l(
110
110
  "p",
111
111
  {
112
- className: `mt-1 text-xs ${h === "invalid" ? "text-red-600 dark:text-red-500" : "text-green-600 dark:text-green-500"}`,
113
- role: h === "invalid" ? "alert" : void 0,
112
+ className: `mt-1 text-xs ${w === "invalid" ? "text-red-600 dark:text-red-500" : "text-green-600 dark:text-green-500"}`,
113
+ role: w === "invalid" ? "alert" : void 0,
114
114
  children: m
115
115
  }
116
116
  )
@@ -158,67 +158,67 @@ const de = {
158
158
  id: r,
159
159
  inputSize: s = "md",
160
160
  shape: f = "rounded",
161
- validate: d,
162
- onValidatedChange: l,
163
- className: a = "",
164
- icon: c,
161
+ validate: i,
162
+ onValidatedChange: c,
163
+ className: d = "",
164
+ icon: a,
165
165
  iconPosition: o = "left",
166
- floatingLabelStyle: i,
167
- onChange: g,
166
+ floatingLabelStyle: u,
167
+ onChange: p,
168
168
  isValid: b,
169
- isInvalid: p,
169
+ isInvalid: g,
170
170
  feedback: m,
171
- feedbackType: h = "invalid",
172
- children: w,
173
- ...S
174
- } = e, [N, O] = L("default"), v = se(), x = $(() => r || (typeof t == "string" ? `select-${t.toLowerCase().replace(/\s+/g, "-")}` : v), [r, t, v]), C = (I) => {
175
- const oe = I.target.value, G = (d == null ? void 0 : d(oe)) ?? "default";
176
- O(G), l == null || l(I, G), g == null || g(I);
177
- }, k = !!i, j = de[s], _ = ue[f], B = ge(N, b, p);
178
- return /* @__PURE__ */ y("div", { className: `w-full relative ${k ? "z-0" : ""}`, children: [
179
- !k && t && /* @__PURE__ */ u(
171
+ feedbackType: w = "invalid",
172
+ children: y,
173
+ ...k
174
+ } = e, [v, $] = j("default"), N = se(), x = O(() => r || (typeof t == "string" ? `select-${t.toLowerCase().replace(/\s+/g, "-")}` : N), [r, t, N]), E = (I) => {
175
+ const oe = I.target.value, Z = (i == null ? void 0 : i(oe)) ?? "default";
176
+ $(Z), c == null || c(I, Z), p == null || p(I);
177
+ }, h = !!u, S = de[s], L = ue[f], M = ge(v, b, g);
178
+ return /* @__PURE__ */ C("div", { className: `w-full relative ${h ? "z-0" : ""}`, children: [
179
+ !h && t && /* @__PURE__ */ l(
180
180
  "label",
181
181
  {
182
182
  htmlFor: x,
183
- className: `block mb-1 text-sm ${b ? "text-green-700" : p ? "text-red-700" : "text-gray-700"}`,
183
+ className: `block mb-1 text-sm ${b ? "text-green-700" : g ? "text-red-700" : "text-gray-700"}`,
184
184
  children: t
185
185
  }
186
186
  ),
187
- /* @__PURE__ */ y("div", { className: "relative w-full", children: [
188
- c && /* @__PURE__ */ u(
187
+ /* @__PURE__ */ C("div", { className: "relative w-full", children: [
188
+ a && /* @__PURE__ */ l(
189
189
  "div",
190
190
  {
191
191
  className: `absolute inset-y-0 flex items-center ${o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5"}`,
192
- children: /* @__PURE__ */ u("span", { className: "text-gray-500", children: c })
192
+ children: /* @__PURE__ */ l("span", { className: "text-gray-500", children: a })
193
193
  }
194
194
  ),
195
- /* @__PURE__ */ u(
195
+ /* @__PURE__ */ l(
196
196
  "select",
197
197
  {
198
- ...S,
198
+ ...k,
199
199
  id: x,
200
200
  ref: n,
201
- onChange: C,
201
+ onChange: E,
202
202
  className: `border peer w-full block font-normal appearance-none focus:outline-none focus:ring-0 transition text-gray-600 placeholder-[#798ba5] border-gray-400
203
- ${j} ${c && (o === "start" || o === "left") ? "ps-10" : c ? "pe-10" : ""}
204
- ${k && i && fe[i]}
205
- ${_} ${B} ${a}`,
206
- children: w
203
+ ${S} ${a && (o === "start" || o === "left") ? "ps-10" : a ? "pe-10" : ""}
204
+ ${h && u && fe[u]}
205
+ ${L} ${M} ${d}`,
206
+ children: y
207
207
  }
208
208
  ),
209
- k && t && i && /* @__PURE__ */ u(
209
+ h && t && u && /* @__PURE__ */ l(
210
210
  "label",
211
211
  {
212
212
  htmlFor: x,
213
- className: `ms-1 ${pe[i]} ${a}`,
213
+ className: `ms-1 ${pe[u]} ${d}`,
214
214
  children: t
215
215
  }
216
216
  )
217
217
  ] }),
218
- m && /* @__PURE__ */ u(
218
+ m && /* @__PURE__ */ l(
219
219
  "p",
220
220
  {
221
- className: `mt-1 text-xs ${h === "invalid" ? "text-red-600" : "text-green-600"}`,
221
+ className: `mt-1 text-xs ${w === "invalid" ? "text-red-600" : "text-green-600"}`,
222
222
  children: m
223
223
  }
224
224
  )
@@ -269,21 +269,21 @@ const me = {
269
269
  type: r = "button",
270
270
  shape: s = "rounded",
271
271
  className: f = "",
272
- isLoading: d = !1,
273
- disabled: l = !1,
274
- ...a
272
+ isLoading: i = !1,
273
+ disabled: c = !1,
274
+ ...d
275
275
  }) => {
276
- const c = l || d, o = [
276
+ const a = c || i, o = [
277
277
  "inline-flex items-center justify-center font-normal transition duration-150",
278
278
  me[n],
279
279
  xe[t],
280
280
  he[s],
281
281
  s === "flat" ? "shadow-none" : "shadow-sm",
282
- c ? "opacity-50 cursor-not-allowed" : "cursor-pointer",
282
+ a ? "opacity-50 cursor-not-allowed" : "cursor-pointer",
283
283
  f
284
284
  ].filter(Boolean).join(" ");
285
- return /* @__PURE__ */ y("button", { type: r, className: o, disabled: c, ...a, children: [
286
- d && /* @__PURE__ */ y(
285
+ return /* @__PURE__ */ C("button", { type: r, className: o, disabled: a, ...d, children: [
286
+ i && /* @__PURE__ */ C(
287
287
  "svg",
288
288
  {
289
289
  "aria-hidden": "true",
@@ -293,14 +293,14 @@ const me = {
293
293
  fill: "none",
294
294
  xmlns: "http://www.w3.org/2000/svg",
295
295
  children: [
296
- /* @__PURE__ */ u(
296
+ /* @__PURE__ */ l(
297
297
  "path",
298
298
  {
299
299
  d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",
300
300
  fill: "currentColor"
301
301
  }
302
302
  ),
303
- /* @__PURE__ */ u(
303
+ /* @__PURE__ */ l(
304
304
  "path",
305
305
  {
306
306
  d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",
@@ -314,48 +314,75 @@ const me = {
314
314
  ] });
315
315
  }, _e = ({
316
316
  label: e,
317
- children: n,
318
- position: t = "right"
317
+ items: n = [],
318
+ onSelect: t,
319
+ renderItem: r,
320
+ position: s = "right",
321
+ className: f = "",
322
+ menuClassName: i = "",
323
+ width: c = "w-48",
324
+ closeOnSelect: d = !1,
325
+ transition: a = !0,
326
+ ariaLabel: o = "Dropdown menu",
327
+ ...u
319
328
  }) => {
320
- const [r, s] = L(!1), [f, d] = L(!1), l = M(null), a = M(null), c = $(() => {
321
- switch (t) {
322
- case "left":
323
- return "left-0";
324
- case "center":
325
- return "left-1/2 transform -translate-x-1/2";
326
- case "right":
327
- default:
328
- return "right-0";
329
- }
330
- }, [t]), o = E((b) => {
331
- const p = b.target;
332
- l.current && !l.current.contains(p) && a.current && !a.current.contains(p) && s(!1);
333
- }, []), i = E(() => {
334
- if (!a.current || !l.current) return;
335
- const b = a.current.getBoundingClientRect(), p = l.current.getBoundingClientRect(), m = window.innerHeight - b.bottom, h = b.top;
336
- d(
337
- m < p.height && h > p.height
338
- );
339
- }, []);
340
- A(() => {
341
- if (r)
342
- return i(), window.addEventListener("resize", i), window.addEventListener("scroll", i, !0), () => {
343
- window.removeEventListener("resize", i), window.removeEventListener("scroll", i, !0);
329
+ const [p, b] = j(!1), [g, m] = j(!1), w = _(null), y = _(null), k = O(() => ({
330
+ left: "left-0",
331
+ center: "left-1/2 transform -translate-x-1/2",
332
+ right: "right-0"
333
+ })[s], [s]), v = P(() => {
334
+ const h = y.current, S = w.current;
335
+ if (!h || !S) return;
336
+ const { top: L, bottom: M } = h.getBoundingClientRect(), z = S.offsetHeight, T = window.innerHeight - M, I = L;
337
+ m(T < z && I > z);
338
+ }, []), $ = P((h) => {
339
+ var S, L;
340
+ !((S = w.current) != null && S.contains(h.target)) && !((L = y.current) != null && L.contains(h.target)) && b(!1);
341
+ }, []), N = P(() => b((h) => !h), []), x = P(() => b(!1), []);
342
+ D(() => {
343
+ if (p)
344
+ return v(), window.addEventListener("resize", v), window.addEventListener("scroll", v, !0), () => {
345
+ window.removeEventListener("resize", v), window.removeEventListener("scroll", v, !0);
344
346
  };
345
- }, [r, i]), A(() => (document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o)), [o]);
346
- const g = E(() => s((b) => !b), []);
347
- return /* @__PURE__ */ y("div", { className: "relative flex items-center", children: [
348
- /* @__PURE__ */ u("button", { ref: a, onClick: g, children: e }),
349
- r && /* @__PURE__ */ u(
350
- "div",
347
+ }, [p, v]), D(() => (document.addEventListener("mousedown", $), () => document.removeEventListener("mousedown", $)), [$]);
348
+ const E = O(
349
+ () => [
350
+ "absolute z-50 bg-white rounded shadow-lg overflow-hidden",
351
+ g ? "bottom-full mb-2" : "top-full mt-2",
352
+ k,
353
+ c,
354
+ a && "transition-all duration-200 ease-out",
355
+ i
356
+ ].filter(Boolean).join(" "),
357
+ [g, k, c, a, i]
358
+ );
359
+ return /* @__PURE__ */ C("div", { className: `relative inline-block ${f}`, ...u, children: [
360
+ /* @__PURE__ */ l(
361
+ "button",
351
362
  {
352
- ref: l,
353
- className: `absolute z-10 bg-white rounded-sm shadow-md overflow-hidden
354
- ${f ? "bottom-full mb-2" : "top-full mt-2"}
355
- ${c}`,
356
- children: n
363
+ ref: y,
364
+ onClick: N,
365
+ "aria-haspopup": "true",
366
+ "aria-expanded": p,
367
+ "aria-label": o,
368
+ className: "focus:outline-none",
369
+ children: e
357
370
  }
358
- )
371
+ ),
372
+ p && /* @__PURE__ */ l("div", { ref: w, role: "menu", className: E, children: n.map((h, S) => {
373
+ const L = () => {
374
+ t && t(h.value), d && x();
375
+ };
376
+ return /* @__PURE__ */ l("div", { children: r ? r(h, L) : /* @__PURE__ */ l(
377
+ "div",
378
+ {
379
+ onClick: L,
380
+ className: "px-4 py-2 text-sm text-gray-800 hover:bg-gray-100 cursor-pointer",
381
+ role: "menuitem",
382
+ children: h.label
383
+ }
384
+ ) }, S);
385
+ }) })
359
386
  ] });
360
387
  }, Be = ({
361
388
  children: e,
@@ -365,20 +392,20 @@ const me = {
365
392
  tooltipClass: s = "",
366
393
  tooltipStyle: f = {}
367
394
  }) => {
368
- const d = M(null), l = M(null);
369
- A(() => {
370
- const c = d.current, o = l.current;
371
- if (!c || !o) return;
372
- const i = () => {
395
+ const i = _(null), c = _(null);
396
+ D(() => {
397
+ const a = i.current, o = c.current;
398
+ if (!a || !o) return;
399
+ const u = () => {
373
400
  o.style.opacity = "1", o.style.visibility = "visible";
374
- }, g = () => {
401
+ }, p = () => {
375
402
  o.style.opacity = "0", o.style.visibility = "hidden";
376
403
  };
377
- return c.addEventListener("mouseenter", i), c.addEventListener("mouseleave", g), () => {
378
- c.removeEventListener("mouseenter", i), c.removeEventListener("mouseleave", g);
404
+ return a.addEventListener("mouseenter", u), a.addEventListener("mouseleave", p), () => {
405
+ a.removeEventListener("mouseenter", u), a.removeEventListener("mouseleave", p);
379
406
  };
380
407
  }, []);
381
- const a = (c) => {
408
+ const d = (a) => {
382
409
  const o = {
383
410
  position: "absolute",
384
411
  opacity: 0,
@@ -396,7 +423,7 @@ const me = {
396
423
  zIndex: 9999,
397
424
  width: "max-content"
398
425
  };
399
- switch (c) {
426
+ switch (a) {
400
427
  case "top":
401
428
  return {
402
429
  ...o,
@@ -433,16 +460,16 @@ const me = {
433
460
  return o;
434
461
  }
435
462
  };
436
- return /* @__PURE__ */ y("div", { ref: d, className: `relative inline-block ${r}`, children: [
463
+ return /* @__PURE__ */ C("div", { ref: i, className: `relative inline-block ${r}`, children: [
437
464
  e,
438
- /* @__PURE__ */ u(
465
+ /* @__PURE__ */ l(
439
466
  "div",
440
467
  {
441
- ref: l,
468
+ ref: c,
442
469
  role: "tooltip",
443
470
  className: s,
444
471
  style: {
445
- ...a(t),
472
+ ...d(t),
446
473
  ...f
447
474
  },
448
475
  children: n
@@ -478,26 +505,26 @@ const me = {
478
505
  rounded: "rounded-sm",
479
506
  pill: "rounded-full",
480
507
  circle: "rounded-full p-2 w-8 h-8 justify-center"
481
- }, Re = ({
508
+ }, Fe = ({
482
509
  label: e,
483
510
  variant: n = "primary",
484
511
  size: t = "sm",
485
512
  shape: r = "rounded",
486
513
  icon: s,
487
514
  dismissible: f,
488
- onDismiss: d,
489
- className: l = "",
490
- ...a
515
+ onDismiss: i,
516
+ className: c = "",
517
+ ...d
491
518
  }) => {
492
- const c = !e && !!s, o = `inline-flex items-center font-medium ${ye[n] || ""} ${we[t] || ""} ${ve[r] || ""} ${c ? "justify-center p-2 w-8 h-8" : ""} ` + l;
493
- return /* @__PURE__ */ y("span", { className: o.trim(), ...a, children: [
494
- s && /* @__PURE__ */ u("span", { className: e ? "mr-1" : "", children: s }),
519
+ const a = !e && !!s, o = `inline-flex items-center font-medium ${ye[n] || ""} ${we[t] || ""} ${ve[r] || ""} ${a ? "justify-center p-2 w-8 h-8" : ""} ` + c;
520
+ return /* @__PURE__ */ C("span", { className: o.trim(), ...d, children: [
521
+ s && /* @__PURE__ */ l("span", { className: e ? "mr-1" : "", children: s }),
495
522
  e,
496
- f && /* @__PURE__ */ u(
523
+ f && /* @__PURE__ */ l(
497
524
  "button",
498
525
  {
499
526
  type: "button",
500
- onClick: d,
527
+ onClick: i,
501
528
  className: "ml-2 text-xs font-bold leading-none focus:outline-none",
502
529
  children: "×"
503
530
  }
@@ -510,7 +537,7 @@ var J = {
510
537
  className: void 0,
511
538
  style: void 0,
512
539
  attr: void 0
513
- }, K = P.createContext && /* @__PURE__ */ P.createContext(J), Ce = ["attr", "size", "title"];
540
+ }, K = A.createContext && /* @__PURE__ */ A.createContext(J), Ce = ["attr", "size", "title"];
514
541
  function Se(e, n) {
515
542
  if (e == null) return {};
516
543
  var t = Ne(e, n), r, s;
@@ -531,15 +558,15 @@ function Ne(e, n) {
531
558
  }
532
559
  return t;
533
560
  }
534
- function D() {
535
- return D = Object.assign ? Object.assign.bind() : function(e) {
561
+ function B() {
562
+ return B = Object.assign ? Object.assign.bind() : function(e) {
536
563
  for (var n = 1; n < arguments.length; n++) {
537
564
  var t = arguments[n];
538
565
  for (var r in t)
539
566
  Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
540
567
  }
541
568
  return e;
542
- }, D.apply(this, arguments);
569
+ }, B.apply(this, arguments);
543
570
  }
544
571
  function U(e, n) {
545
572
  var t = Object.keys(e);
@@ -551,7 +578,7 @@ function U(e, n) {
551
578
  }
552
579
  return t;
553
580
  }
554
- function T(e) {
581
+ function F(e) {
555
582
  for (var n = 1; n < arguments.length; n++) {
556
583
  var t = arguments[n] != null ? arguments[n] : {};
557
584
  n % 2 ? U(Object(t), !0).forEach(function(r) {
@@ -580,13 +607,13 @@ function Ee(e, n) {
580
607
  return (n === "string" ? String : Number)(e);
581
608
  }
582
609
  function Q(e) {
583
- return e && e.map((n, t) => /* @__PURE__ */ P.createElement(n.tag, T({
610
+ return e && e.map((n, t) => /* @__PURE__ */ A.createElement(n.tag, F({
584
611
  key: t
585
612
  }, n.attr), Q(n.child)));
586
613
  }
587
614
  function V(e) {
588
- return (n) => /* @__PURE__ */ P.createElement(Le, D({
589
- attr: T({}, e.attr)
615
+ return (n) => /* @__PURE__ */ A.createElement(Le, B({
616
+ attr: F({}, e.attr)
590
617
  }, n), Q(e.child));
591
618
  }
592
619
  function Le(e) {
@@ -595,87 +622,87 @@ function Le(e) {
595
622
  attr: r,
596
623
  size: s,
597
624
  title: f
598
- } = e, d = Se(e, Ce), l = s || t.size || "1em", a;
599
- return t.className && (a = t.className), e.className && (a = (a ? a + " " : "") + e.className), /* @__PURE__ */ P.createElement("svg", D({
625
+ } = e, i = Se(e, Ce), c = s || t.size || "1em", d;
626
+ return t.className && (d = t.className), e.className && (d = (d ? d + " " : "") + e.className), /* @__PURE__ */ A.createElement("svg", B({
600
627
  stroke: "currentColor",
601
628
  fill: "currentColor",
602
629
  strokeWidth: "0"
603
- }, t.attr, r, d, {
604
- className: a,
605
- style: T(T({
630
+ }, t.attr, r, i, {
631
+ className: d,
632
+ style: F(F({
606
633
  color: e.color || t.color
607
634
  }, t.style), e.style),
608
- height: l,
609
- width: l,
635
+ height: c,
636
+ width: c,
610
637
  xmlns: "http://www.w3.org/2000/svg"
611
- }), f && /* @__PURE__ */ P.createElement("title", null, f), e.children);
638
+ }), f && /* @__PURE__ */ A.createElement("title", null, f), e.children);
612
639
  };
613
- return K !== void 0 ? /* @__PURE__ */ P.createElement(K.Consumer, null, (t) => n(t)) : n(J);
640
+ return K !== void 0 ? /* @__PURE__ */ A.createElement(K.Consumer, null, (t) => n(t)) : n(J);
614
641
  }
615
642
  function Oe(e) {
616
643
  return V({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z" }, child: [] }] })(e);
617
644
  }
618
- const Fe = ({
645
+ const Re = ({
619
646
  items: e,
620
647
  allowMultipleOpen: n = !1,
621
648
  className: t = "",
622
649
  tileClasses: r = "",
623
650
  open: s,
624
651
  onChange: f,
625
- renderTitle: d,
626
- renderContent: l,
627
- showArrowIcon: a = !0,
628
- panelClasses: c = ""
652
+ renderTitle: i,
653
+ renderContent: c,
654
+ showArrowIcon: d = !0,
655
+ panelClasses: a = ""
629
656
  }) => {
630
- const [o, i] = L(/* @__PURE__ */ new Set()), g = $(() => s ? new Set(s) : o, [s, o]), b = E(
631
- (p) => {
632
- const m = new Set(g);
633
- m.has(p) ? m.delete(p) : (n || m.clear(), m.add(p)), s && f ? f(Array.from(m)) : i(m);
657
+ const [o, u] = j(/* @__PURE__ */ new Set()), p = O(() => s ? new Set(s) : o, [s, o]), b = P(
658
+ (g) => {
659
+ const m = new Set(p);
660
+ m.has(g) ? m.delete(g) : (n || m.clear(), m.add(g)), s && f ? f(Array.from(m)) : u(m);
634
661
  },
635
- [g, s, f, n]
662
+ [p, s, f, n]
636
663
  );
637
- return /* @__PURE__ */ u(
664
+ return /* @__PURE__ */ l(
638
665
  "div",
639
666
  {
640
667
  className: "accordion",
641
668
  role: "region",
642
669
  "aria-multiselectable": n,
643
- children: e.map((p) => {
644
- const m = g.has(p.id), h = `accordion-heading-${p.id}`, w = `accordion-panel-${p.id}`;
645
- return /* @__PURE__ */ y(
670
+ children: e.map((g) => {
671
+ const m = p.has(g.id), w = `accordion-heading-${g.id}`, y = `accordion-panel-${g.id}`;
672
+ return /* @__PURE__ */ C(
646
673
  "div",
647
674
  {
648
675
  className: `accordion-item border rounded border-gray-300 dark:border-gray-700 ${t}`,
649
676
  children: [
650
- /* @__PURE__ */ y(
677
+ /* @__PURE__ */ C(
651
678
  "button",
652
679
  {
653
- id: h,
680
+ id: w,
654
681
  type: "button",
655
682
  "aria-expanded": m,
656
- "aria-controls": w,
657
- onClick: () => b(p.id),
683
+ "aria-controls": y,
684
+ onClick: () => b(g.id),
658
685
  className: `flex justify-between items-center w-full p-1.5 text-left text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none gap-3 ${r}`,
659
686
  children: [
660
- d ? d(p, m) : p.title,
661
- a ? /* @__PURE__ */ u(Oe, {}) : null
687
+ i ? i(g, m) : g.title,
688
+ d ? /* @__PURE__ */ l(Oe, {}) : null
662
689
  ]
663
690
  }
664
691
  ),
665
- /* @__PURE__ */ u(
692
+ /* @__PURE__ */ l(
666
693
  "div",
667
694
  {
668
- id: w,
695
+ id: y,
669
696
  role: "region",
670
- "aria-labelledby": h,
697
+ "aria-labelledby": w,
671
698
  hidden: !m,
672
- className: `p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 ${c}`,
673
- children: l ? l(p, m) : p.content
699
+ className: `p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 ${a}`,
700
+ children: c ? c(g, m) : g.content
674
701
  }
675
702
  )
676
703
  ]
677
704
  },
678
- p.id
705
+ g.id
679
706
  );
680
707
  })
681
708
  }
@@ -688,66 +715,66 @@ const Fe = ({
688
715
  );
689
716
  return e;
690
717
  }, re = X(null), ne = () => Y(re);
691
- function Ze({
718
+ function He({
692
719
  id: e,
693
720
  title: n,
694
721
  children: t,
695
722
  standalone: r = !1,
696
723
  showFloatingClose: s = !1,
697
724
  containerClasses: f = "",
698
- onClose: d,
699
- disableEscapeClose: l = !1
725
+ onClose: i,
726
+ disableEscapeClose: c = !1
700
727
  }) {
701
- const a = ne(), c = te(), o = !r && !!a && !!c, [i, g] = L(!1), b = o ? a.isOpen(e) : i, p = o ? a.getModalData(e) : null, m = E(() => {
702
- o ? c.closeModal(e) : g(!1), d == null || d();
703
- }, [o, c, e, d]);
704
- return A(() => {
705
- const h = document.activeElement;
728
+ const d = ne(), a = te(), o = !r && !!d && !!a, [u, p] = j(!1), b = o ? d.isOpen(e) : u, g = o ? d.getModalData(e) : null, m = P(() => {
729
+ o ? a.closeModal(e) : p(!1), i == null || i();
730
+ }, [o, a, e, i]);
731
+ return D(() => {
732
+ const w = document.activeElement;
706
733
  console.log(e);
707
- const w = document.getElementById(e);
708
- console.log("modalEl=", w);
709
- const S = [
734
+ const y = document.getElementById(e);
735
+ console.log("modalEl=", y);
736
+ const k = [
710
737
  "a[href]",
711
738
  "button:not([disabled])",
712
739
  "textarea:not([disabled])",
713
740
  "input:not([disabled])",
714
741
  "select:not([disabled])",
715
742
  '[tabindex]:not([tabindex="-1"])'
716
- ], N = () => {
717
- if (!w) return [];
718
- const x = w.querySelectorAll(
719
- S.join(",")
743
+ ], v = () => {
744
+ if (!y) return [];
745
+ const x = y.querySelectorAll(
746
+ k.join(",")
720
747
  );
721
- return Array.from(x).filter((C) => C.offsetParent !== null);
722
- }, O = (x) => {
748
+ return Array.from(x).filter((E) => E.offsetParent !== null);
749
+ }, $ = (x) => {
723
750
  if (x.key === "Tab") {
724
- const C = N();
725
- if (C.length === 0) return;
726
- const k = C[0], j = C[C.length - 1];
727
- x.shiftKey ? document.activeElement === k && (x.preventDefault(), j.focus()) : document.activeElement === j && (x.preventDefault(), k.focus());
751
+ const E = v();
752
+ if (E.length === 0) return;
753
+ const h = E[0], S = E[E.length - 1];
754
+ x.shiftKey ? document.activeElement === h && (x.preventDefault(), S.focus()) : document.activeElement === S && (x.preventDefault(), h.focus());
728
755
  }
729
- }, v = (x) => {
730
- x.key === "Escape" && !l && m(), O(x);
756
+ }, N = (x) => {
757
+ x.key === "Escape" && !c && m(), $(x);
731
758
  };
732
759
  return b && (document.body.style.overflow = "hidden", setTimeout(() => {
733
- const x = N();
760
+ const x = v();
734
761
  x.length && x[0].focus();
735
- }, 0), window.addEventListener("keydown", v)), () => {
736
- document.body.style.overflow = "", h && h.focus(), window.removeEventListener("keydown", v);
762
+ }, 0), window.addEventListener("keydown", N)), () => {
763
+ document.body.style.overflow = "", w && w.focus(), window.removeEventListener("keydown", N);
737
764
  };
738
- }, [b, l, m, e]), b ? /* @__PURE__ */ u(
765
+ }, [b, c, m, e]), b ? /* @__PURE__ */ l(
739
766
  "div",
740
767
  {
741
768
  className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-[2px]",
742
769
  id: e,
743
- children: /* @__PURE__ */ y(
770
+ children: /* @__PURE__ */ C(
744
771
  "div",
745
772
  {
746
773
  className: `bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${f}`,
747
774
  children: [
748
- /* @__PURE__ */ y("div", { className: "flex justify-between items-center relative", children: [
749
- n && /* @__PURE__ */ u("h2", { className: "text-lg font-semibold", children: n }),
750
- s && /* @__PURE__ */ u(
775
+ /* @__PURE__ */ C("div", { className: "flex justify-between items-center relative", children: [
776
+ n && /* @__PURE__ */ l("h2", { className: "text-lg font-semibold", children: n }),
777
+ s && /* @__PURE__ */ l(
751
778
  "button",
752
779
  {
753
780
  onClick: m,
@@ -757,36 +784,36 @@ function Ze({
757
784
  }
758
785
  )
759
786
  ] }),
760
- /* @__PURE__ */ u("div", { className: "mt-3 text-sm text-gray-700", children: typeof t == "function" ? t({ modalData: p }) : t })
787
+ /* @__PURE__ */ l("div", { className: "mt-3 text-sm text-gray-700", children: typeof t == "function" ? t({ modalData: g }) : t })
761
788
  ]
762
789
  }
763
790
  )
764
791
  }
765
792
  ) : null;
766
793
  }
767
- function Ge({
794
+ function Ze({
768
795
  children: e
769
796
  }) {
770
- const [n, t] = L({}), [r, s] = L({}), f = E((i, g) => {
771
- t((b) => ({ ...b, [i]: !0 })), g && s((b) => ({ ...b, [i]: g }));
772
- }, []), d = E((i) => {
773
- t((g) => ({ ...g, [i]: !1 })), s((g) => {
774
- const b = { ...g };
775
- return delete b[i], b;
797
+ const [n, t] = j({}), [r, s] = j({}), f = P((u, p) => {
798
+ t((b) => ({ ...b, [u]: !0 })), p && s((b) => ({ ...b, [u]: p }));
799
+ }, []), i = P((u) => {
800
+ t((p) => ({ ...p, [u]: !1 })), s((p) => {
801
+ const b = { ...p };
802
+ return delete b[u], b;
776
803
  });
777
- }, []), l = E((i) => !!n[i], [n]), a = E(
778
- (i) => r[i],
804
+ }, []), c = P((u) => !!n[u], [n]), d = P(
805
+ (u) => r[u],
779
806
  [r]
780
- ), c = $(
781
- () => ({ openModal: f, closeModal: d }),
782
- [f, d]
783
- ), o = $(
784
- () => ({ isOpen: l, getModalData: a }),
785
- [l, a]
807
+ ), a = O(
808
+ () => ({ openModal: f, closeModal: i }),
809
+ [f, i]
810
+ ), o = O(
811
+ () => ({ isOpen: c, getModalData: d }),
812
+ [c, d]
786
813
  );
787
- return /* @__PURE__ */ u(ee.Provider, { value: c, children: /* @__PURE__ */ u(re.Provider, { value: o, children: e }) });
814
+ return /* @__PURE__ */ l(ee.Provider, { value: a, children: /* @__PURE__ */ l(re.Provider, { value: o, children: e }) });
788
815
  }
789
- function He(e) {
816
+ function Ge(e) {
790
817
  const { openModal: n, closeModal: t } = te(), { isOpen: r, getModalData: s } = ne();
791
818
  return {
792
819
  open: (f) => n(e, f),
@@ -795,15 +822,15 @@ function He(e) {
795
822
  data: s(e)
796
823
  };
797
824
  }
798
- let R = null, F = {};
825
+ let R = null, H = {};
799
826
  function Pe(e) {
800
827
  R = e;
801
828
  }
802
829
  function We(e) {
803
- F = { ...F, ...e };
830
+ H = { ...H, ...e };
804
831
  }
805
832
  function je() {
806
- return F;
833
+ return H;
807
834
  }
808
835
  function Ke(e, n, t = 3e3, r) {
809
836
  R ? R(e, n, t, r) : console.warn("Toast system is not mounted");
@@ -815,37 +842,37 @@ const Ae = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, functio
815
842
  const n = Math.random() * 16 | 0;
816
843
  return (e === "x" ? n : n & 3 | 8).toString(16);
817
844
  }), Ue = () => {
818
- const [e, n] = L([]);
819
- A(() => {
820
- Pe((r, s, f, d) => {
821
- const l = Ae();
822
- n((a) => [...a, { id: l, type: r, message: s, config: d }]), setTimeout(() => {
823
- n((a) => a.filter((c) => c.id !== l));
845
+ const [e, n] = j([]);
846
+ D(() => {
847
+ Pe((r, s, f, i) => {
848
+ const c = Ae();
849
+ n((d) => [...d, { id: c, type: r, message: s, config: i }]), setTimeout(() => {
850
+ n((d) => d.filter((a) => a.id !== c));
824
851
  }, f);
825
852
  });
826
853
  }, []);
827
854
  const t = je();
828
- return /* @__PURE__ */ u("div", { className: "fixed top-5 right-5 z-[9999] flex flex-col gap-2", children: e.map((r) => {
829
- var a, c, o, i, g, b, p, m, h, w, S, N, O;
830
- const s = ((a = r.config) == null ? void 0 : a.icon) || ((c = t.icons) == null ? void 0 : c[r.type]) || ze(r.type), f = ((o = r.config) == null ? void 0 : o.bgColor) || ((g = (i = t.colors) == null ? void 0 : i[r.type]) == null ? void 0 : g.bg) || "bg-white dark:bg-gray-800", d = ((b = r.config) == null ? void 0 : b.textColor) || ((m = (p = t.colors) == null ? void 0 : p[r.type]) == null ? void 0 : m.text) || "text-gray-700 dark:text-gray-300", l = ((h = r.config) == null ? void 0 : h.iconContainerClass) || "w-8 h-8 mr-3 text-xl flex items-center justify-center";
831
- return /* @__PURE__ */ y(
855
+ return /* @__PURE__ */ l("div", { className: "fixed top-5 right-5 z-[9999] flex flex-col gap-2", children: e.map((r) => {
856
+ var d, a, o, u, p, b, g, m, w, y, k, v, $;
857
+ const s = ((d = r.config) == null ? void 0 : d.icon) || ((a = t.icons) == null ? void 0 : a[r.type]) || ze(r.type), f = ((o = r.config) == null ? void 0 : o.bgColor) || ((p = (u = t.colors) == null ? void 0 : u[r.type]) == null ? void 0 : p.bg) || "bg-white dark:bg-gray-800", i = ((b = r.config) == null ? void 0 : b.textColor) || ((m = (g = t.colors) == null ? void 0 : g[r.type]) == null ? void 0 : m.text) || "text-gray-700 dark:text-gray-300", c = ((w = r.config) == null ? void 0 : w.iconContainerClass) || "w-8 h-8 mr-3 text-xl flex items-center justify-center";
858
+ return /* @__PURE__ */ C(
832
859
  "div",
833
860
  {
834
- className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${f} ${d}`,
861
+ className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${f} ${i}`,
835
862
  children: [
836
- /* @__PURE__ */ u("div", { className: l, children: s }),
837
- /* @__PURE__ */ y("div", { className: "flex-1 me-3", children: [
838
- ((w = r.config) == null ? void 0 : w.title) && /* @__PURE__ */ u("div", { className: "font-semibold text-black", children: r.config.title }),
839
- ((S = r.config) == null ? void 0 : S.description) && /* @__PURE__ */ u("div", { className: "text-sm text-gray-500", children: r.config.description }),
840
- !((N = r.config) != null && N.title) && !((O = r.config) != null && O.description) && /* @__PURE__ */ u("div", { className: "text-sm", children: r.message })
863
+ /* @__PURE__ */ l("div", { className: c, children: s }),
864
+ /* @__PURE__ */ C("div", { className: "flex-1 me-3", children: [
865
+ ((y = r.config) == null ? void 0 : y.title) && /* @__PURE__ */ l("div", { className: "font-semibold text-black", children: r.config.title }),
866
+ ((k = r.config) == null ? void 0 : k.description) && /* @__PURE__ */ l("div", { className: "text-sm text-gray-500", children: r.config.description }),
867
+ !((v = r.config) != null && v.title) && !(($ = r.config) != null && $.description) && /* @__PURE__ */ l("div", { className: "text-sm", children: r.message })
841
868
  ] }),
842
- /* @__PURE__ */ u(
869
+ /* @__PURE__ */ l(
843
870
  "button",
844
871
  {
845
- onClick: () => n((v) => v.filter((x) => x.id !== r.id)),
872
+ onClick: () => n((N) => N.filter((x) => x.id !== r.id)),
846
873
  className: "ml-auto text-gray-400 hover:text-gray-700 dark:text-gray-500 dark:hover:text-white",
847
874
  "aria-label": "Close",
848
- children: /* @__PURE__ */ u(Ie, { size: 18 })
875
+ children: /* @__PURE__ */ l(Ie, { size: 18 })
849
876
  }
850
877
  )
851
878
  ]
@@ -867,19 +894,19 @@ function ze(e) {
867
894
  }
868
895
  }
869
896
  export {
870
- Fe as Accordion,
871
- Re as Badge,
897
+ Re as Accordion,
898
+ Fe as Badge,
872
899
  Te as Button,
873
900
  _e as Dropdown,
874
901
  ce as Input,
875
- Ze as Modal,
876
- Ge as ModalProvider,
902
+ He as Modal,
903
+ Ze as ModalProvider,
877
904
  be as Select,
878
905
  Ue as Toast,
879
906
  Be as Tooltip,
880
907
  We as setToastDefaults,
881
908
  Ke as showToast,
882
909
  te as useModalActions,
883
- He as useModalInstance,
910
+ Ge as useModalInstance,
884
911
  ne as useModalState
885
912
  };
@@ -1,10 +1,8 @@
1
1
  (function(w,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],n):(w=typeof globalThis<"u"?globalThis:w||self,n(w.TailwindUiKit={},w.jsxRuntime,w.React))})(this,function(w,n,l){"use strict";"use client";var F=document.createElement("style");F.textContent=`/*! tailwindcss v4.1.10 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}.btn-primary{background-color:var(--color-blue-600,oklch(54.6% .245 262.881));color:var(--color-white,#fff)}@media (hover:hover){.btn-primary:hover{background-color:var(--color-blue-700,oklch(48.8% .243 264.376))}}.btn-outline-primary{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-blue-600,oklch(54.6% .245 262.881));color:var(--color-blue-600,oklch(54.6% .245 262.881))}@media (hover:hover){.btn-outline-primary:hover{background-color:var(--color-blue-50,oklch(97% .014 254.604))}}.btn-soft-primary{background-color:var(--color-blue-100,oklch(93.2% .032 255.585));color:var(--color-blue-700,oklch(48.8% .243 264.376))}@media (hover:hover){.btn-soft-primary:hover{background-color:var(--color-blue-200,oklch(88.2% .059 254.128))}}.btn-secondary{background-color:var(--color-gray-600,oklch(44.6% .03 256.802));color:var(--color-white,#fff)}@media (hover:hover){.btn-secondary:hover{background-color:var(--color-gray-700,oklch(37.3% .034 259.733))}}.btn-outline-secondary{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-gray-600,oklch(44.6% .03 256.802));color:var(--color-gray-600,oklch(44.6% .03 256.802))}@media (hover:hover){.btn-outline-secondary:hover{background-color:var(--color-gray-50,oklch(98.5% .002 247.839))}}.btn-soft-secondary{background-color:var(--color-gray-100,oklch(96.7% .003 264.542));color:var(--color-gray-700,oklch(37.3% .034 259.733))}@media (hover:hover){.btn-soft-secondary:hover{background-color:var(--color-gray-200,oklch(92.8% .006 264.531))}}.btn-success{background-color:var(--color-green-600,oklch(62.7% .194 149.214));color:var(--color-white,#fff)}@media (hover:hover){.btn-success:hover{background-color:var(--color-green-700,oklch(52.7% .154 150.069))}}.btn-outline-success{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-green-600,oklch(62.7% .194 149.214));color:var(--color-green-600,oklch(62.7% .194 149.214))}@media (hover:hover){.btn-outline-success:hover{background-color:var(--color-green-50,oklch(98.2% .018 155.826))}}.btn-soft-success{background-color:var(--color-green-100,oklch(96.2% .044 156.743));color:var(--color-green-700,oklch(52.7% .154 150.069))}@media (hover:hover){.btn-soft-success:hover{background-color:var(--color-green-200,oklch(92.5% .084 155.995))}}.btn-danger{background-color:var(--color-red-600,oklch(57.7% .245 27.325));color:var(--color-white,#fff)}@media (hover:hover){.btn-danger:hover{background-color:var(--color-red-700,oklch(50.5% .213 27.518))}}.btn-outline-danger{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-red-600,oklch(57.7% .245 27.325));color:var(--color-red-600,oklch(57.7% .245 27.325))}@media (hover:hover){.btn-outline-danger:hover{background-color:var(--color-red-50,oklch(97.1% .013 17.38))}}.btn-soft-danger{background-color:var(--color-red-100,oklch(93.6% .032 17.717));color:var(--color-red-700,oklch(50.5% .213 27.518))}@media (hover:hover){.btn-soft-danger:hover{background-color:var(--color-red-200,oklch(88.5% .062 18.334))}}.btn-warning{background-color:var(--color-yellow-500,oklch(79.5% .184 86.047));color:var(--color-white,#fff)}@media (hover:hover){.btn-warning:hover{background-color:var(--color-yellow-600,oklch(68.1% .162 75.834))}}.btn-outline-warning{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-yellow-500,oklch(79.5% .184 86.047));color:var(--color-yellow-600,oklch(68.1% .162 75.834))}@media (hover:hover){.btn-outline-warning:hover{background-color:var(--color-yellow-50,oklch(98.7% .026 102.212))}}.btn-soft-warning{background-color:var(--color-yellow-100,oklch(97.3% .071 103.193));color:var(--color-yellow-700,oklch(55.4% .135 66.442))}@media (hover:hover){.btn-soft-warning:hover{background-color:var(--color-yellow-200,oklch(94.5% .129 101.54))}}.btn-info{background-color:var(--color-cyan-600,oklch(60.9% .126 221.723));color:var(--color-white,#fff)}@media (hover:hover){.btn-info:hover{background-color:var(--color-cyan-700,oklch(52% .105 223.128))}}.btn-outline-info{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-cyan-600,oklch(60.9% .126 221.723));color:var(--color-cyan-600,oklch(60.9% .126 221.723))}@media (hover:hover){.btn-outline-info:hover{background-color:var(--color-cyan-50,oklch(98.4% .019 200.873))}}.btn-soft-info{background-color:var(--color-cyan-100,oklch(95.6% .045 203.388));color:var(--color-cyan-700,oklch(52% .105 223.128))}@media (hover:hover){.btn-soft-info:hover{background-color:var(--color-cyan-200,oklch(91.7% .08 205.041))}}.btn-dark{background-color:var(--color-gray-900,oklch(21% .034 264.665));color:var(--color-white,#fff)}@media (hover:hover){.btn-dark:hover{background-color:var(--color-black,#000)}}.btn-outline-dark{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-gray-900,oklch(21% .034 264.665));color:var(--color-gray-900,oklch(21% .034 264.665))}@media (hover:hover){.btn-outline-dark:hover{background-color:var(--color-gray-100,oklch(96.7% .003 264.542))}}.btn-soft-dark{background-color:var(--color-gray-200,oklch(92.8% .006 264.531));color:var(--color-gray-900,oklch(21% .034 264.665))}@media (hover:hover){.btn-soft-dark:hover{background-color:var(--color-gray-300,oklch(87.2% .01 258.338))}}.btn-light{background-color:var(--color-gray-100,oklch(96.7% .003 264.542));color:var(--color-gray-800,oklch(27.8% .033 256.848))}@media (hover:hover){.btn-light:hover{background-color:var(--color-gray-200,oklch(92.8% .006 264.531))}}.btn-outline-light{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-gray-100,oklch(96.7% .003 264.542));color:var(--color-gray-600,oklch(44.6% .03 256.802))}@media (hover:hover){.btn-outline-light:hover{background-color:var(--color-gray-50,oklch(98.5% .002 247.839))}}.btn-soft-light{background-color:var(--color-gray-50,oklch(98.5% .002 247.839));color:var(--color-gray-700,oklch(37.3% .034 259.733))}@media (hover:hover){.btn-soft-light:hover{background-color:var(--color-gray-100,oklch(96.7% .003 264.542))}}.btn-link{padding:calc(var(--spacing,.25rem)*0);color:var(--color-blue-600,oklch(54.6% .245 262.881));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:#0000}@media (hover:hover){.btn-link:hover{text-decoration-line:underline}}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}
2
- /*$vite$:1*/`,document.head.appendChild(F);const Z={xs:"text-xs px-2 py-1",sm:"text-sm px-3 py-1.5",md:"text-sm px-3 py-3",lg:"text-lg px-5 py-3"},G={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full"},R={filled:"rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",outlined:"rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",standard:"px-0 py-2.5 bg-transparent border-0 border-b-2"},ee={filled:"absolute duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",outlined:"absolute duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-white px-2 peer-placeholder-shown:scale-100 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",standard:"absolute duration-300 transform -translate-y-6 scale-75 top-3 origin-[0] peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 peer-focus:text-blue-600"},re=(e,t,r)=>{if(r)return"border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:ring-red-500 focus:border-red-500";if(t)return"border-green-500 bg-green-50 text-green-900 placeholder-green-700 focus:ring-green-500 focus:border-green-500";switch(e){case"error":return"border-red-500 bg-red-50 focus:ring-red-500";case"warning":return"border-yellow-500 bg-yellow-50 focus:ring-yellow-500";case"success":return"border-green-500 bg-green-50 focus:ring-green-500";default:return"border-gray-300 focus:ring-blue-500"}},q=l.forwardRef((e,t)=>{const{label:r,id:o,inputSize:s="md",shape:b="rounded",validate:f,onValidatedChange:i,className:c="",icon:u,iconPosition:a="left",floatingLabelStyle:d,onChange:g,isValid:p,isInvalid:h,feedback:v,feedbackType:m="invalid",...x}=e,[S,N]=l.useState("default"),E=l.useCallback(M=>{const B=M.target.value,O=(f==null?void 0:f(B))??"default";N(O),i==null||i(M,O),g==null||g(M)},[f,i,g]),k=l.useMemo(()=>o||(typeof r=="string"?`input-${r.toLowerCase().replace(/\s+/g,"-")}`:`input-${Math.random().toString(36).slice(2)}`),[o,r]),y=!!d,C=Z[s]||Z.md,$=G[b]||G.flat,L=l.useMemo(()=>re(S,p,h),[S,p,h]),_=l.useMemo(()=>a==="start"||a==="left"?"left-0 ps-3.5":"right-0 pe-3.5",[a]),D=l.useMemo(()=>u?a==="start"||a==="left"?"ps-10":"pe-10":"",[u,a]);return n.jsxs("div",{className:`w-full relative ${y?"z-0":""} tailwind-ux-input`,children:[!y&&r&&n.jsx("label",{htmlFor:k,className:`block mb-1 text-sm ${p?"text-green-700 dark:text-green-500":h?"text-red-700 dark:text-red-500":"text-gray-700"}`,children:r}),n.jsxs("div",{className:"relative w-full",children:[u&&n.jsx("div",{className:`absolute inset-y-0 flex items-center ${_}`,"aria-hidden":"true",children:n.jsx("span",{className:"text-gray-500",children:u})}),n.jsx("input",{...x,id:k,ref:t,placeholder:y?" ":x.placeholder,onChange:E,className:`border peer w-full block font-normal appearance-none focus:outline-none focus:ring-0 transition text-gray-900 placeholder-gray-600 border-gray-400
3
- ${C}
4
- ${y&&d&&R[d]}
5
- ${D} ${$} ${L} ${c}`}),y&&r&&d&&n.jsx("label",{htmlFor:k,className:`ms-1 ${ee[d]} ${c}`,children:r})]}),v&&n.jsx("p",{className:`mt-1 text-xs ${m==="invalid"?"text-red-600 dark:text-red-500":"text-green-600 dark:text-green-500"}`,role:m==="invalid"?"alert":void 0,children:v})]})});q.displayName="Input";const oe={xs:"text-xs px-2 py-1",sm:"text-sm px-3 py-1.5",md:"text-sm px-3 py-3",lg:"text-lg px-5 py-3"},te={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full"},ne={filled:"rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",outlined:"rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",standard:"px-0 py-2.5 bg-transparent border-0 border-b-2"},le={filled:"absolute duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",outlined:"absolute duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-white px-2 peer-placeholder-shown:scale-100 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",standard:"absolute duration-300 transform -translate-y-6 scale-75 top-3 origin-[0] peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 peer-focus:text-blue-600"},ae=(e,t,r)=>{if(r)return"border-red-500 bg-red-50 text-red-900 focus:ring-red-500 focus:border-red-500";if(t)return"border-green-500 bg-green-50 text-green-900 focus:ring-green-500 focus:border-green-500";const o="focus:ring focus:border";switch(e){case"error":return`${o}-red-500 border-red-500 bg-red-50`;case"warning":return`${o}-yellow-500 border-yellow-500 bg-yellow-50`;case"success":return`${o}-green-500 border-green-500 bg-green-50`;default:return"border-gray-300 focus:ring-blue-500"}},H=l.forwardRef((e,t)=>{const{label:r,id:o,inputSize:s="md",shape:b="rounded",validate:f,onValidatedChange:i,className:c="",icon:u,iconPosition:a="left",floatingLabelStyle:d,onChange:g,isValid:p,isInvalid:h,feedback:v,feedbackType:m="invalid",children:x,...S}=e,[N,E]=l.useState("default"),k=l.useId(),y=l.useMemo(()=>o||(typeof r=="string"?`select-${r.toLowerCase().replace(/\s+/g,"-")}`:k),[o,r,k]),C=O=>{const _e=O.target.value,V=(f==null?void 0:f(_e))??"default";E(V),i==null||i(O,V),g==null||g(O)},$=!!d,L=oe[s],_=te[b],D=ae(N,p,h),M=u&&(a==="start"||a==="left")?"ps-10":u?"pe-10":"",B=a==="start"||a==="left"?"left-0 ps-3.5":"right-0 pe-3.5";return n.jsxs("div",{className:`w-full relative ${$?"z-0":""}`,children:[!$&&r&&n.jsx("label",{htmlFor:y,className:`block mb-1 text-sm ${p?"text-green-700":h?"text-red-700":"text-gray-700"}`,children:r}),n.jsxs("div",{className:"relative w-full",children:[u&&n.jsx("div",{className:`absolute inset-y-0 flex items-center ${B}`,children:n.jsx("span",{className:"text-gray-500",children:u})}),n.jsx("select",{...S,id:y,ref:t,onChange:C,className:`border peer w-full block font-normal appearance-none focus:outline-none focus:ring-0 transition text-gray-600 placeholder-[#798ba5] border-gray-400
6
- ${L} ${M}
7
- ${$&&d&&ne[d]}
8
- ${_} ${D} ${c}`,children:x}),$&&r&&d&&n.jsx("label",{htmlFor:y,className:`ms-1 ${le[d]} ${c}`,children:r})]}),v&&n.jsx("p",{className:`mt-1 text-xs ${m==="invalid"?"text-red-600":"text-green-600"}`,children:v})]})});H.displayName="Select";const se={primary:"btn-primary",secondary:"btn-secondary",success:"btn-success",danger:"btn-danger",warning:"btn-warning",info:"btn-info",dark:"btn-dark",light:"btn-light",link:"btn-link","outline-primary":"btn-outline-primary","outline-secondary":"btn-outline-secondary","outline-success":"btn-outline-success","outline-danger":"btn-outline-danger","outline-warning":"btn-outline-warning","outline-info":"btn-outline-info","outline-dark":"btn-outline-dark","outline-light":"btn-outline-light","soft-primary":"btn-soft-primary","soft-secondary":"btn-soft-secondary","soft-success":"btn-soft-success","soft-danger":"btn-soft-danger","soft-warning":"btn-soft-warning","soft-info":"btn-soft-info","soft-dark":"btn-soft-dark","soft-light":"btn-soft-light"},ce={xs:"px-3 py-2 text-xs",sm:"px-3 py-2 text-sm",md:"px-5 py-2.5 text-sm",lg:"px-5 py-3 text-base",xl:"px-6 py-3.5 text-base"},ie={flat:"shadow-none",rounded:"rounded-sm",pill:"rounded-full",circle:"rounded-full w-10 h-10 p-0 flex items-center justify-center"},de=({children:e,variant:t="primary",size:r="md",type:o="button",shape:s="rounded",className:b="",isLoading:f=!1,disabled:i=!1,...c})=>{const u=i||f,a=["inline-flex items-center justify-center font-normal transition duration-150",se[t],ce[r],ie[s],s==="flat"?"shadow-none":"shadow-sm",u?"opacity-50 cursor-not-allowed":"cursor-pointer",b].filter(Boolean).join(" ");return n.jsxs("button",{type:o,className:a,disabled:u,...c,children:[f&&n.jsxs("svg",{"aria-hidden":"true",role:"status",className:"inline w-4 h-4 me-3 text-gray-200 animate-spin dark:text-gray-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),n.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"#1C64F2"})]}),e]})},ue=({label:e,children:t,position:r="right"})=>{const[o,s]=l.useState(!1),[b,f]=l.useState(!1),i=l.useRef(null),c=l.useRef(null),u=l.useMemo(()=>{switch(r){case"left":return"left-0";case"center":return"left-1/2 transform -translate-x-1/2";case"right":default:return"right-0"}},[r]),a=l.useCallback(p=>{const h=p.target;i.current&&!i.current.contains(h)&&c.current&&!c.current.contains(h)&&s(!1)},[]),d=l.useCallback(()=>{if(!c.current||!i.current)return;const p=c.current.getBoundingClientRect(),h=i.current.getBoundingClientRect(),v=window.innerHeight-p.bottom,m=p.top;f(v<h.height&&m>h.height)},[]);l.useEffect(()=>{if(o)return d(),window.addEventListener("resize",d),window.addEventListener("scroll",d,!0),()=>{window.removeEventListener("resize",d),window.removeEventListener("scroll",d,!0)}},[o,d]),l.useEffect(()=>(document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)),[a]);const g=l.useCallback(()=>s(p=>!p),[]);return n.jsxs("div",{className:"relative flex items-center",children:[n.jsx("button",{ref:c,onClick:g,children:e}),o&&n.jsx("div",{ref:i,className:`absolute z-10 bg-white rounded-sm shadow-md overflow-hidden
9
- ${b?"bottom-full mb-2":"top-full mt-2"}
10
- ${u}`,children:t})]})},fe=({children:e,content:t,position:r="top",className:o="",tooltipClass:s="",tooltipStyle:b={}})=>{const f=l.useRef(null),i=l.useRef(null);l.useEffect(()=>{const u=f.current,a=i.current;if(!u||!a)return;const d=()=>{a.style.opacity="1",a.style.visibility="visible"},g=()=>{a.style.opacity="0",a.style.visibility="hidden"};return u.addEventListener("mouseenter",d),u.addEventListener("mouseleave",g),()=>{u.removeEventListener("mouseenter",d),u.removeEventListener("mouseleave",g)}},[]);const c=u=>{const a={position:"absolute",opacity:0,visibility:"hidden",transition:"opacity 0.2s ease",maxWidth:"240px",whiteSpace:"normal",wordBreak:"break-word",padding:"8px 12px",fontSize:"0.875rem",backgroundColor:"black",color:"white",borderRadius:"4px",boxShadow:"0px 4px 12px rgba(0, 0, 0, 0.15)",zIndex:9999,width:"max-content"};switch(u){case"top":return{...a,bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:"8px"};case"bottom":return{...a,top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"8px"};case"left":return{...a,right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:"8px"};case"right":return{...a,left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"};default:return a}};return n.jsxs("div",{ref:f,className:`relative inline-block ${o}`,children:[e,n.jsx("div",{ref:i,role:"tooltip",className:s,style:{...c(r),...b},children:t})]})},be={primary:"bg-blue-500 text-white",secondary:"bg-gray-500 text-white",success:"bg-green-500 text-white",danger:"bg-red-500 text-white",warning:"bg-yellow-400 text-black",info:"bg-cyan-500 text-white",dark:"bg-black text-white",light:"bg-gray-100 text-gray-800",link:"bg-transparent text-blue-500 underline","outline-primary":"border border-blue-500 text-blue-500 bg-transparent","outline-secondary":"border border-gray-500 text-gray-500 bg-transparent","outline-success":"border border-green-500 text-green-500 bg-transparent","outline-danger":"border border-red-500 text-red-500 bg-transparent","outline-warning":"border border-yellow-400 text-yellow-500 bg-transparent","outline-info":"border border-cyan-500 text-cyan-500 bg-transparent","outline-dark":"border border-black text-black bg-transparent","outline-light":"border border-gray-100 text-gray-800 bg-transparent"},he={xs:"text-xs px-2 py-0.5",sm:"text-sm px-2.5 py-0.5",md:"text-base px-3 py-1",lg:"text-lg px-3.5 py-1.5",xl:"text-xl px-4 py-2"},ge={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full",circle:"rounded-full p-2 w-8 h-8 justify-center"},pe=({label:e,variant:t="primary",size:r="sm",shape:o="rounded",icon:s,dismissible:b,onDismiss:f,className:i="",...c})=>{const u=!e&&!!s,a=`inline-flex items-center font-medium ${be[t]||""} ${he[r]||""} ${ge[o]||""} ${u?"justify-center p-2 w-8 h-8":""} `+i;return n.jsxs("span",{className:a.trim(),...c,children:[s&&n.jsx("span",{className:e?"mr-1":"",children:s}),e,b&&n.jsx("button",{type:"button",onClick:f,className:"ml-2 text-xs font-bold leading-none focus:outline-none",children:"×"})]})};var K={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},U=l.createContext&&l.createContext(K),ve=["attr","size","title"];function ye(e,t){if(e==null)return{};var r=we(e,t),o,s;if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(e);for(s=0;s<b.length;s++)o=b[s],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}function we(e,t){if(e==null)return{};var r={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(t.indexOf(o)>=0)continue;r[o]=e[o]}return r}function P(){return P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},P.apply(this,arguments)}function W(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,o)}return r}function j(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?W(Object(r),!0).forEach(function(o){me(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):W(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}function me(e,t,r){return t=xe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xe(e){var t=ke(e,"string");return typeof t=="symbol"?t:t+""}function ke(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,t);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function X(e){return e&&e.map((t,r)=>l.createElement(t.tag,j({key:r},t.attr),X(t.child)))}function Y(e){return t=>l.createElement(Ce,P({attr:j({},e.attr)},t),X(e.child))}function Ce(e){var t=r=>{var{attr:o,size:s,title:b}=e,f=ye(e,ve),i=s||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),l.createElement("svg",P({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,o,f,{className:c,style:j(j({color:e.color||r.color},r.style),e.style),height:i,width:i,xmlns:"http://www.w3.org/2000/svg"}),b&&l.createElement("title",null,b),e.children)};return U!==void 0?l.createElement(U.Consumer,null,r=>t(r)):t(K)}function Se(e){return Y({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z"},child:[]}]})(e)}const Ne=({items:e,allowMultipleOpen:t=!1,className:r="",tileClasses:o="",open:s,onChange:b,renderTitle:f,renderContent:i,showArrowIcon:c=!0,panelClasses:u=""})=>{const[a,d]=l.useState(new Set),g=l.useMemo(()=>s?new Set(s):a,[s,a]),p=l.useCallback(h=>{const v=new Set(g);v.has(h)?v.delete(h):(t||v.clear(),v.add(h)),s&&b?b(Array.from(v)):d(v)},[g,s,b,t]);return n.jsx("div",{className:"accordion",role:"region","aria-multiselectable":t,children:e.map(h=>{const v=g.has(h.id),m=`accordion-heading-${h.id}`,x=`accordion-panel-${h.id}`;return n.jsxs("div",{className:`accordion-item border rounded border-gray-300 dark:border-gray-700 ${r}`,children:[n.jsxs("button",{id:m,type:"button","aria-expanded":v,"aria-controls":x,onClick:()=>p(h.id),className:`flex justify-between items-center w-full p-1.5 text-left text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none gap-3 ${o}`,children:[f?f(h,v):h.title,c?n.jsx(Se,{}):null]}),n.jsx("div",{id:x,role:"region","aria-labelledby":m,hidden:!v,className:`p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 ${u}`,children:i?i(h,v):h.content})]},h.id)})})},J=l.createContext(null),I=()=>{const e=l.useContext(J);if(!e)throw new Error("useModalActions must be used within a ModalActionProvider");return e},Q=l.createContext(null),T=()=>l.useContext(Q);function $e({id:e,title:t,children:r,standalone:o=!1,showFloatingClose:s=!1,containerClasses:b="",onClose:f,disableEscapeClose:i=!1}){const c=T(),u=I(),a=!o&&!!c&&!!u,[d,g]=l.useState(!1),p=a?c.isOpen(e):d,h=a?c.getModalData(e):null,v=l.useCallback(()=>{a?u.closeModal(e):g(!1),f==null||f()},[a,u,e,f]);return l.useEffect(()=>{const m=document.activeElement;console.log(e);const x=document.getElementById(e);console.log("modalEl=",x);const S=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'],N=()=>{if(!x)return[];const y=x.querySelectorAll(S.join(","));return Array.from(y).filter(C=>C.offsetParent!==null)},E=y=>{if(y.key==="Tab"){const C=N();if(C.length===0)return;const $=C[0],L=C[C.length-1];y.shiftKey?document.activeElement===$&&(y.preventDefault(),L.focus()):document.activeElement===L&&(y.preventDefault(),$.focus())}},k=y=>{y.key==="Escape"&&!i&&v(),E(y)};return p&&(document.body.style.overflow="hidden",setTimeout(()=>{const y=N();y.length&&y[0].focus()},0),window.addEventListener("keydown",k)),()=>{document.body.style.overflow="",m&&m.focus(),window.removeEventListener("keydown",k)}},[p,i,v,e]),p?n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-[2px]",id:e,children:n.jsxs("div",{className:`bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${b}`,children:[n.jsxs("div",{className:"flex justify-between items-center relative",children:[t&&n.jsx("h2",{className:"text-lg font-semibold",children:t}),s&&n.jsx("button",{onClick:v,className:"text-gray-500 hover:text-black absolute top-2 right-3 hover:bg-gray-200 rounded-full aspect-square w-8","aria-label":"Close modal",children:"✕"})]}),n.jsx("div",{className:"mt-3 text-sm text-gray-700",children:typeof r=="function"?r({modalData:h}):r})]})}):null}function Ee({children:e}){const[t,r]=l.useState({}),[o,s]=l.useState({}),b=l.useCallback((d,g)=>{r(p=>({...p,[d]:!0})),g&&s(p=>({...p,[d]:g}))},[]),f=l.useCallback(d=>{r(g=>({...g,[d]:!1})),s(g=>{const p={...g};return delete p[d],p})},[]),i=l.useCallback(d=>!!t[d],[t]),c=l.useCallback(d=>o[d],[o]),u=l.useMemo(()=>({openModal:b,closeModal:f}),[b,f]),a=l.useMemo(()=>({isOpen:i,getModalData:c}),[i,c]);return n.jsx(J.Provider,{value:u,children:n.jsx(Q.Provider,{value:a,children:e})})}function Le(e){const{openModal:t,closeModal:r}=I(),{isOpen:o,getModalData:s}=T();return{open:b=>t(e,b),close:()=>r(e),isOpen:o(e),data:s(e)}}let A=null,z={};function Oe(e){A=e}function Me(e){z={...z,...e}}function Pe(){return z}function je(e,t,r=3e3,o){A?A(e,t,r,o):console.warn("Toast system is not mounted")}function Ie(e){return Y({attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor"},child:[]}]})(e)}const Te=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Ae=()=>{const[e,t]=l.useState([]);l.useEffect(()=>{Oe((o,s,b,f)=>{const i=Te();t(c=>[...c,{id:i,type:o,message:s,config:f}]),setTimeout(()=>{t(c=>c.filter(u=>u.id!==i))},b)})},[]);const r=Pe();return n.jsx("div",{className:"fixed top-5 right-5 z-[9999] flex flex-col gap-2",children:e.map(o=>{var c,u,a,d,g,p,h,v,m,x,S,N,E;const s=((c=o.config)==null?void 0:c.icon)||((u=r.icons)==null?void 0:u[o.type])||ze(o.type),b=((a=o.config)==null?void 0:a.bgColor)||((g=(d=r.colors)==null?void 0:d[o.type])==null?void 0:g.bg)||"bg-white dark:bg-gray-800",f=((p=o.config)==null?void 0:p.textColor)||((v=(h=r.colors)==null?void 0:h[o.type])==null?void 0:v.text)||"text-gray-700 dark:text-gray-300",i=((m=o.config)==null?void 0:m.iconContainerClass)||"w-8 h-8 mr-3 text-xl flex items-center justify-center";return n.jsxs("div",{className:`flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${b} ${f}`,children:[n.jsx("div",{className:i,children:s}),n.jsxs("div",{className:"flex-1 me-3",children:[((x=o.config)==null?void 0:x.title)&&n.jsx("div",{className:"font-semibold text-black",children:o.config.title}),((S=o.config)==null?void 0:S.description)&&n.jsx("div",{className:"text-sm text-gray-500",children:o.config.description}),!((N=o.config)!=null&&N.title)&&!((E=o.config)!=null&&E.description)&&n.jsx("div",{className:"text-sm",children:o.message})]}),n.jsx("button",{onClick:()=>t(k=>k.filter(y=>y.id!==o.id)),className:"ml-auto text-gray-400 hover:text-gray-700 dark:text-gray-500 dark:hover:text-white","aria-label":"Close",children:n.jsx(Ie,{size:18})})]},o.id)})})};function ze(e){switch(e){case"success":return"✅";case"error":return"❌";case"warning":return"⚠️";case"info":return"ℹ️"}}w.Accordion=Ne,w.Badge=pe,w.Button=de,w.Dropdown=ue,w.Input=q,w.Modal=$e,w.ModalProvider=Ee,w.Select=H,w.Toast=Ae,w.Tooltip=fe,w.setToastDefaults=Me,w.showToast=je,w.useModalActions=I,w.useModalInstance=Le,w.useModalState=T,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
2
+ /*$vite$:1*/`,document.head.appendChild(F);const H={xs:"text-xs px-2 py-1",sm:"text-sm px-3 py-1.5",md:"text-sm px-3 py-3",lg:"text-lg px-5 py-3"},Z={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full"},R={filled:"rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",outlined:"rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",standard:"px-0 py-2.5 bg-transparent border-0 border-b-2"},ee={filled:"absolute duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",outlined:"absolute duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-white px-2 peer-placeholder-shown:scale-100 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",standard:"absolute duration-300 transform -translate-y-6 scale-75 top-3 origin-[0] peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 peer-focus:text-blue-600"},re=(e,t,r)=>{if(r)return"border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:ring-red-500 focus:border-red-500";if(t)return"border-green-500 bg-green-50 text-green-900 placeholder-green-700 focus:ring-green-500 focus:border-green-500";switch(e){case"error":return"border-red-500 bg-red-50 focus:ring-red-500";case"warning":return"border-yellow-500 bg-yellow-50 focus:ring-yellow-500";case"success":return"border-green-500 bg-green-50 focus:ring-green-500";default:return"border-gray-300 focus:ring-blue-500"}},G=l.forwardRef((e,t)=>{const{label:r,id:o,inputSize:s="md",shape:b="rounded",validate:i,onValidatedChange:d,className:u="",icon:c,iconPosition:a="left",floatingLabelStyle:f,onChange:h,isValid:p,isInvalid:g,feedback:v,feedbackType:k="invalid",...m}=e,[E,C]=l.useState("default"),$=l.useCallback(M=>{const I=M.target.value,j=(i==null?void 0:i(I))??"default";C(j),d==null||d(M,j),h==null||h(M)},[i,d,h]),N=l.useMemo(()=>o||(typeof r=="string"?`input-${r.toLowerCase().replace(/\s+/g,"-")}`:`input-${Math.random().toString(36).slice(2)}`),[o,r]),y=!!f,L=H[s]||H.md,x=Z[b]||Z.flat,S=l.useMemo(()=>re(E,p,g),[E,p,g]),O=l.useMemo(()=>a==="start"||a==="left"?"left-0 ps-3.5":"right-0 pe-3.5",[a]),P=l.useMemo(()=>c?a==="start"||a==="left"?"ps-10":"pe-10":"",[c,a]);return n.jsxs("div",{className:`w-full relative ${y?"z-0":""} tailwind-ux-input`,children:[!y&&r&&n.jsx("label",{htmlFor:N,className:`block mb-1 text-sm ${p?"text-green-700 dark:text-green-500":g?"text-red-700 dark:text-red-500":"text-gray-700"}`,children:r}),n.jsxs("div",{className:"relative w-full",children:[c&&n.jsx("div",{className:`absolute inset-y-0 flex items-center ${O}`,"aria-hidden":"true",children:n.jsx("span",{className:"text-gray-500",children:c})}),n.jsx("input",{...m,id:N,ref:t,placeholder:y?" ":m.placeholder,onChange:$,className:`border peer w-full block font-normal appearance-none focus:outline-none focus:ring-0 transition text-gray-900 placeholder-gray-600 border-gray-400
3
+ ${L}
4
+ ${y&&f&&R[f]}
5
+ ${P} ${x} ${S} ${u}`}),y&&r&&f&&n.jsx("label",{htmlFor:N,className:`ms-1 ${ee[f]} ${u}`,children:r})]}),v&&n.jsx("p",{className:`mt-1 text-xs ${k==="invalid"?"text-red-600 dark:text-red-500":"text-green-600 dark:text-green-500"}`,role:k==="invalid"?"alert":void 0,children:v})]})});G.displayName="Input";const oe={xs:"text-xs px-2 py-1",sm:"text-sm px-3 py-1.5",md:"text-sm px-3 py-3",lg:"text-lg px-5 py-3"},te={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full"},ne={filled:"rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",outlined:"rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",standard:"px-0 py-2.5 bg-transparent border-0 border-b-2"},le={filled:"absolute duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",outlined:"absolute duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-white px-2 peer-placeholder-shown:scale-100 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",standard:"absolute duration-300 transform -translate-y-6 scale-75 top-3 origin-[0] peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 peer-focus:text-blue-600"},ae=(e,t,r)=>{if(r)return"border-red-500 bg-red-50 text-red-900 focus:ring-red-500 focus:border-red-500";if(t)return"border-green-500 bg-green-50 text-green-900 focus:ring-green-500 focus:border-green-500";const o="focus:ring focus:border";switch(e){case"error":return`${o}-red-500 border-red-500 bg-red-50`;case"warning":return`${o}-yellow-500 border-yellow-500 bg-yellow-50`;case"success":return`${o}-green-500 border-green-500 bg-green-50`;default:return"border-gray-300 focus:ring-blue-500"}},q=l.forwardRef((e,t)=>{const{label:r,id:o,inputSize:s="md",shape:b="rounded",validate:i,onValidatedChange:d,className:u="",icon:c,iconPosition:a="left",floatingLabelStyle:f,onChange:h,isValid:p,isInvalid:g,feedback:v,feedbackType:k="invalid",children:m,...E}=e,[C,$]=l.useState("default"),N=l.useId(),y=l.useMemo(()=>o||(typeof r=="string"?`select-${r.toLowerCase().replace(/\s+/g,"-")}`:N),[o,r,N]),L=j=>{const De=j.target.value,V=(i==null?void 0:i(De))??"default";$(V),d==null||d(j,V),h==null||h(j)},x=!!f,S=oe[s],O=te[b],P=ae(C,p,g),M=c&&(a==="start"||a==="left")?"ps-10":c?"pe-10":"",I=a==="start"||a==="left"?"left-0 ps-3.5":"right-0 pe-3.5";return n.jsxs("div",{className:`w-full relative ${x?"z-0":""}`,children:[!x&&r&&n.jsx("label",{htmlFor:y,className:`block mb-1 text-sm ${p?"text-green-700":g?"text-red-700":"text-gray-700"}`,children:r}),n.jsxs("div",{className:"relative w-full",children:[c&&n.jsx("div",{className:`absolute inset-y-0 flex items-center ${I}`,children:n.jsx("span",{className:"text-gray-500",children:c})}),n.jsx("select",{...E,id:y,ref:t,onChange:L,className:`border peer w-full block font-normal appearance-none focus:outline-none focus:ring-0 transition text-gray-600 placeholder-[#798ba5] border-gray-400
6
+ ${S} ${M}
7
+ ${x&&f&&ne[f]}
8
+ ${O} ${P} ${u}`,children:m}),x&&r&&f&&n.jsx("label",{htmlFor:y,className:`ms-1 ${le[f]} ${u}`,children:r})]}),v&&n.jsx("p",{className:`mt-1 text-xs ${k==="invalid"?"text-red-600":"text-green-600"}`,children:v})]})});q.displayName="Select";const se={primary:"btn-primary",secondary:"btn-secondary",success:"btn-success",danger:"btn-danger",warning:"btn-warning",info:"btn-info",dark:"btn-dark",light:"btn-light",link:"btn-link","outline-primary":"btn-outline-primary","outline-secondary":"btn-outline-secondary","outline-success":"btn-outline-success","outline-danger":"btn-outline-danger","outline-warning":"btn-outline-warning","outline-info":"btn-outline-info","outline-dark":"btn-outline-dark","outline-light":"btn-outline-light","soft-primary":"btn-soft-primary","soft-secondary":"btn-soft-secondary","soft-success":"btn-soft-success","soft-danger":"btn-soft-danger","soft-warning":"btn-soft-warning","soft-info":"btn-soft-info","soft-dark":"btn-soft-dark","soft-light":"btn-soft-light"},ce={xs:"px-3 py-2 text-xs",sm:"px-3 py-2 text-sm",md:"px-5 py-2.5 text-sm",lg:"px-5 py-3 text-base",xl:"px-6 py-3.5 text-base"},ie={flat:"shadow-none",rounded:"rounded-sm",pill:"rounded-full",circle:"rounded-full w-10 h-10 p-0 flex items-center justify-center"},de=({children:e,variant:t="primary",size:r="md",type:o="button",shape:s="rounded",className:b="",isLoading:i=!1,disabled:d=!1,...u})=>{const c=d||i,a=["inline-flex items-center justify-center font-normal transition duration-150",se[t],ce[r],ie[s],s==="flat"?"shadow-none":"shadow-sm",c?"opacity-50 cursor-not-allowed":"cursor-pointer",b].filter(Boolean).join(" ");return n.jsxs("button",{type:o,className:a,disabled:c,...u,children:[i&&n.jsxs("svg",{"aria-hidden":"true",role:"status",className:"inline w-4 h-4 me-3 text-gray-200 animate-spin dark:text-gray-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),n.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"#1C64F2"})]}),e]})},ue=({label:e,items:t=[],onSelect:r,renderItem:o,position:s="right",className:b="",menuClassName:i="",width:d="w-48",closeOnSelect:u=!1,transition:c=!0,ariaLabel:a="Dropdown menu",...f})=>{const[h,p]=l.useState(!1),[g,v]=l.useState(!1),k=l.useRef(null),m=l.useRef(null),E=l.useMemo(()=>({left:"left-0",center:"left-1/2 transform -translate-x-1/2",right:"right-0"})[s],[s]),C=l.useCallback(()=>{const x=m.current,S=k.current;if(!x||!S)return;const{top:O,bottom:P}=x.getBoundingClientRect(),M=S.offsetHeight,I=window.innerHeight-P,j=O;v(I<M&&j>M)},[]),$=l.useCallback(x=>{var S,O;!((S=k.current)!=null&&S.contains(x.target))&&!((O=m.current)!=null&&O.contains(x.target))&&p(!1)},[]),N=l.useCallback(()=>p(x=>!x),[]),y=l.useCallback(()=>p(!1),[]);l.useEffect(()=>{if(h)return C(),window.addEventListener("resize",C),window.addEventListener("scroll",C,!0),()=>{window.removeEventListener("resize",C),window.removeEventListener("scroll",C,!0)}},[h,C]),l.useEffect(()=>(document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)),[$]);const L=l.useMemo(()=>["absolute z-50 bg-white rounded shadow-lg overflow-hidden",g?"bottom-full mb-2":"top-full mt-2",E,d,c&&"transition-all duration-200 ease-out",i].filter(Boolean).join(" "),[g,E,d,c,i]);return n.jsxs("div",{className:`relative inline-block ${b}`,...f,children:[n.jsx("button",{ref:m,onClick:N,"aria-haspopup":"true","aria-expanded":h,"aria-label":a,className:"focus:outline-none",children:e}),h&&n.jsx("div",{ref:k,role:"menu",className:L,children:t.map((x,S)=>{const O=()=>{r&&r(x.value),u&&y()};return n.jsx("div",{children:o?o(x,O):n.jsx("div",{onClick:O,className:"px-4 py-2 text-sm text-gray-800 hover:bg-gray-100 cursor-pointer",role:"menuitem",children:x.label})},S)})})]})},fe=({children:e,content:t,position:r="top",className:o="",tooltipClass:s="",tooltipStyle:b={}})=>{const i=l.useRef(null),d=l.useRef(null);l.useEffect(()=>{const c=i.current,a=d.current;if(!c||!a)return;const f=()=>{a.style.opacity="1",a.style.visibility="visible"},h=()=>{a.style.opacity="0",a.style.visibility="hidden"};return c.addEventListener("mouseenter",f),c.addEventListener("mouseleave",h),()=>{c.removeEventListener("mouseenter",f),c.removeEventListener("mouseleave",h)}},[]);const u=c=>{const a={position:"absolute",opacity:0,visibility:"hidden",transition:"opacity 0.2s ease",maxWidth:"240px",whiteSpace:"normal",wordBreak:"break-word",padding:"8px 12px",fontSize:"0.875rem",backgroundColor:"black",color:"white",borderRadius:"4px",boxShadow:"0px 4px 12px rgba(0, 0, 0, 0.15)",zIndex:9999,width:"max-content"};switch(c){case"top":return{...a,bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:"8px"};case"bottom":return{...a,top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"8px"};case"left":return{...a,right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:"8px"};case"right":return{...a,left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"};default:return a}};return n.jsxs("div",{ref:i,className:`relative inline-block ${o}`,children:[e,n.jsx("div",{ref:d,role:"tooltip",className:s,style:{...u(r),...b},children:t})]})},be={primary:"bg-blue-500 text-white",secondary:"bg-gray-500 text-white",success:"bg-green-500 text-white",danger:"bg-red-500 text-white",warning:"bg-yellow-400 text-black",info:"bg-cyan-500 text-white",dark:"bg-black text-white",light:"bg-gray-100 text-gray-800",link:"bg-transparent text-blue-500 underline","outline-primary":"border border-blue-500 text-blue-500 bg-transparent","outline-secondary":"border border-gray-500 text-gray-500 bg-transparent","outline-success":"border border-green-500 text-green-500 bg-transparent","outline-danger":"border border-red-500 text-red-500 bg-transparent","outline-warning":"border border-yellow-400 text-yellow-500 bg-transparent","outline-info":"border border-cyan-500 text-cyan-500 bg-transparent","outline-dark":"border border-black text-black bg-transparent","outline-light":"border border-gray-100 text-gray-800 bg-transparent"},he={xs:"text-xs px-2 py-0.5",sm:"text-sm px-2.5 py-0.5",md:"text-base px-3 py-1",lg:"text-lg px-3.5 py-1.5",xl:"text-xl px-4 py-2"},ge={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full",circle:"rounded-full p-2 w-8 h-8 justify-center"},pe=({label:e,variant:t="primary",size:r="sm",shape:o="rounded",icon:s,dismissible:b,onDismiss:i,className:d="",...u})=>{const c=!e&&!!s,a=`inline-flex items-center font-medium ${be[t]||""} ${he[r]||""} ${ge[o]||""} ${c?"justify-center p-2 w-8 h-8":""} `+d;return n.jsxs("span",{className:a.trim(),...u,children:[s&&n.jsx("span",{className:e?"mr-1":"",children:s}),e,b&&n.jsx("button",{type:"button",onClick:i,className:"ml-2 text-xs font-bold leading-none focus:outline-none",children:"×"})]})};var K={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},U=l.createContext&&l.createContext(K),ve=["attr","size","title"];function ye(e,t){if(e==null)return{};var r=we(e,t),o,s;if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(e);for(s=0;s<b.length;s++)o=b[s],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}function we(e,t){if(e==null)return{};var r={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(t.indexOf(o)>=0)continue;r[o]=e[o]}return r}function T(){return T=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},T.apply(this,arguments)}function W(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,o)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?W(Object(r),!0).forEach(function(o){xe(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):W(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}function xe(e,t,r){return t=me(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function me(e){var t=ke(e,"string");return typeof t=="symbol"?t:t+""}function ke(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,t);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function X(e){return e&&e.map((t,r)=>l.createElement(t.tag,A({key:r},t.attr),X(t.child)))}function Y(e){return t=>l.createElement(Ce,T({attr:A({},e.attr)},t),X(e.child))}function Ce(e){var t=r=>{var{attr:o,size:s,title:b}=e,i=ye(e,ve),d=s||r.size||"1em",u;return r.className&&(u=r.className),e.className&&(u=(u?u+" ":"")+e.className),l.createElement("svg",T({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,o,i,{className:u,style:A(A({color:e.color||r.color},r.style),e.style),height:d,width:d,xmlns:"http://www.w3.org/2000/svg"}),b&&l.createElement("title",null,b),e.children)};return U!==void 0?l.createElement(U.Consumer,null,r=>t(r)):t(K)}function Se(e){return Y({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z"},child:[]}]})(e)}const Ne=({items:e,allowMultipleOpen:t=!1,className:r="",tileClasses:o="",open:s,onChange:b,renderTitle:i,renderContent:d,showArrowIcon:u=!0,panelClasses:c=""})=>{const[a,f]=l.useState(new Set),h=l.useMemo(()=>s?new Set(s):a,[s,a]),p=l.useCallback(g=>{const v=new Set(h);v.has(g)?v.delete(g):(t||v.clear(),v.add(g)),s&&b?b(Array.from(v)):f(v)},[h,s,b,t]);return n.jsx("div",{className:"accordion",role:"region","aria-multiselectable":t,children:e.map(g=>{const v=h.has(g.id),k=`accordion-heading-${g.id}`,m=`accordion-panel-${g.id}`;return n.jsxs("div",{className:`accordion-item border rounded border-gray-300 dark:border-gray-700 ${r}`,children:[n.jsxs("button",{id:k,type:"button","aria-expanded":v,"aria-controls":m,onClick:()=>p(g.id),className:`flex justify-between items-center w-full p-1.5 text-left text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none gap-3 ${o}`,children:[i?i(g,v):g.title,u?n.jsx(Se,{}):null]}),n.jsx("div",{id:m,role:"region","aria-labelledby":k,hidden:!v,className:`p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 ${c}`,children:d?d(g,v):g.content})]},g.id)})})},J=l.createContext(null),z=()=>{const e=l.useContext(J);if(!e)throw new Error("useModalActions must be used within a ModalActionProvider");return e},Q=l.createContext(null),D=()=>l.useContext(Q);function Ee({id:e,title:t,children:r,standalone:o=!1,showFloatingClose:s=!1,containerClasses:b="",onClose:i,disableEscapeClose:d=!1}){const u=D(),c=z(),a=!o&&!!u&&!!c,[f,h]=l.useState(!1),p=a?u.isOpen(e):f,g=a?u.getModalData(e):null,v=l.useCallback(()=>{a?c.closeModal(e):h(!1),i==null||i()},[a,c,e,i]);return l.useEffect(()=>{const k=document.activeElement;console.log(e);const m=document.getElementById(e);console.log("modalEl=",m);const E=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'],C=()=>{if(!m)return[];const y=m.querySelectorAll(E.join(","));return Array.from(y).filter(L=>L.offsetParent!==null)},$=y=>{if(y.key==="Tab"){const L=C();if(L.length===0)return;const x=L[0],S=L[L.length-1];y.shiftKey?document.activeElement===x&&(y.preventDefault(),S.focus()):document.activeElement===S&&(y.preventDefault(),x.focus())}},N=y=>{y.key==="Escape"&&!d&&v(),$(y)};return p&&(document.body.style.overflow="hidden",setTimeout(()=>{const y=C();y.length&&y[0].focus()},0),window.addEventListener("keydown",N)),()=>{document.body.style.overflow="",k&&k.focus(),window.removeEventListener("keydown",N)}},[p,d,v,e]),p?n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-[2px]",id:e,children:n.jsxs("div",{className:`bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${b}`,children:[n.jsxs("div",{className:"flex justify-between items-center relative",children:[t&&n.jsx("h2",{className:"text-lg font-semibold",children:t}),s&&n.jsx("button",{onClick:v,className:"text-gray-500 hover:text-black absolute top-2 right-3 hover:bg-gray-200 rounded-full aspect-square w-8","aria-label":"Close modal",children:"✕"})]}),n.jsx("div",{className:"mt-3 text-sm text-gray-700",children:typeof r=="function"?r({modalData:g}):r})]})}):null}function $e({children:e}){const[t,r]=l.useState({}),[o,s]=l.useState({}),b=l.useCallback((f,h)=>{r(p=>({...p,[f]:!0})),h&&s(p=>({...p,[f]:h}))},[]),i=l.useCallback(f=>{r(h=>({...h,[f]:!1})),s(h=>{const p={...h};return delete p[f],p})},[]),d=l.useCallback(f=>!!t[f],[t]),u=l.useCallback(f=>o[f],[o]),c=l.useMemo(()=>({openModal:b,closeModal:i}),[b,i]),a=l.useMemo(()=>({isOpen:d,getModalData:u}),[d,u]);return n.jsx(J.Provider,{value:c,children:n.jsx(Q.Provider,{value:a,children:e})})}function Le(e){const{openModal:t,closeModal:r}=z(),{isOpen:o,getModalData:s}=D();return{open:b=>t(e,b),close:()=>r(e),isOpen:o(e),data:s(e)}}let _=null,B={};function Oe(e){_=e}function Me(e){B={...B,...e}}function je(){return B}function Pe(e,t,r=3e3,o){_?_(e,t,r,o):console.warn("Toast system is not mounted")}function Ie(e){return Y({attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor"},child:[]}]})(e)}const Te=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Ae=()=>{const[e,t]=l.useState([]);l.useEffect(()=>{Oe((o,s,b,i)=>{const d=Te();t(u=>[...u,{id:d,type:o,message:s,config:i}]),setTimeout(()=>{t(u=>u.filter(c=>c.id!==d))},b)})},[]);const r=je();return n.jsx("div",{className:"fixed top-5 right-5 z-[9999] flex flex-col gap-2",children:e.map(o=>{var u,c,a,f,h,p,g,v,k,m,E,C,$;const s=((u=o.config)==null?void 0:u.icon)||((c=r.icons)==null?void 0:c[o.type])||ze(o.type),b=((a=o.config)==null?void 0:a.bgColor)||((h=(f=r.colors)==null?void 0:f[o.type])==null?void 0:h.bg)||"bg-white dark:bg-gray-800",i=((p=o.config)==null?void 0:p.textColor)||((v=(g=r.colors)==null?void 0:g[o.type])==null?void 0:v.text)||"text-gray-700 dark:text-gray-300",d=((k=o.config)==null?void 0:k.iconContainerClass)||"w-8 h-8 mr-3 text-xl flex items-center justify-center";return n.jsxs("div",{className:`flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${b} ${i}`,children:[n.jsx("div",{className:d,children:s}),n.jsxs("div",{className:"flex-1 me-3",children:[((m=o.config)==null?void 0:m.title)&&n.jsx("div",{className:"font-semibold text-black",children:o.config.title}),((E=o.config)==null?void 0:E.description)&&n.jsx("div",{className:"text-sm text-gray-500",children:o.config.description}),!((C=o.config)!=null&&C.title)&&!(($=o.config)!=null&&$.description)&&n.jsx("div",{className:"text-sm",children:o.message})]}),n.jsx("button",{onClick:()=>t(N=>N.filter(y=>y.id!==o.id)),className:"ml-auto text-gray-400 hover:text-gray-700 dark:text-gray-500 dark:hover:text-white","aria-label":"Close",children:n.jsx(Ie,{size:18})})]},o.id)})})};function ze(e){switch(e){case"success":return"✅";case"error":return"❌";case"warning":return"⚠️";case"info":return"ℹ️"}}w.Accordion=Ne,w.Badge=pe,w.Button=de,w.Dropdown=ue,w.Input=G,w.Modal=Ee,w.ModalProvider=$e,w.Select=q,w.Toast=Ae,w.Tooltip=fe,w.setToastDefaults=Me,w.showToast=Pe,w.useModalActions=z,w.useModalInstance=Le,w.useModalState=D,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwind-ux-kit",
3
- "version": "1.0.54",
3
+ "version": "1.0.56",
4
4
  "main": "lib/tailwind-ux-kit.es.js",
5
5
  "module": "lib/tailwind-ux-kit.umd.js",
6
6
  "types": "lib/tailwind-ux-kit.es.d.ts",