tailwind-ux-kit 1.0.81 → 1.0.83

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,6 +1,6 @@
1
1
  "use client";
2
- import { jsxs as N, jsx as i } from "react/jsx-runtime";
3
- import D, { forwardRef as re, useState as A, useMemo as I, useId as pe, useRef as W, useCallback as z, useEffect as _, createContext as se, useContext as oe } from "react";
2
+ import { jsxs as S, jsx as i } from "react/jsx-runtime";
3
+ import A, { forwardRef as oe, useState as D, useMemo as j, useId as be, useRef as F, useCallback as z, useEffect as R, createContext as ae, useContext as le } from "react";
4
4
  const V = {
5
5
  xs: "text-xs px-2 py-1",
6
6
  sm: "text-sm px-3 py-1.5",
@@ -10,15 +10,15 @@ const V = {
10
10
  flat: "rounded-none",
11
11
  rounded: "rounded-sm",
12
12
  pill: "rounded-full"
13
- }, ge = {
13
+ }, me = {
14
14
  filled: "rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",
15
15
  outlined: "rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",
16
16
  standard: "px-0 py-2.5 bg-transparent border-0 border-b-2"
17
- }, be = {
17
+ }, xe = {
18
18
  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",
19
19
  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",
20
20
  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"
21
- }, me = (e, r, n) => {
21
+ }, he = (e, r, n) => {
22
22
  if (n)
23
23
  return "border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:ring-red-500 focus:border-red-500";
24
24
  if (r)
@@ -33,79 +33,79 @@ const V = {
33
33
  default:
34
34
  return "border-gray-300 focus:ring-blue-500";
35
35
  }
36
- }, xe = re((e, r) => {
36
+ }, ye = oe((e, r) => {
37
37
  const {
38
38
  label: n,
39
39
  id: t,
40
- inputSize: o = "md",
41
- shape: c = "rounded",
42
- validate: d,
40
+ inputSize: s = "md",
41
+ shape: d = "rounded",
42
+ validate: p,
43
43
  onValidatedChange: u,
44
- className: f = "",
45
- icon: l,
46
- iconPosition: s = "left",
47
- floatingLabelStyle: a,
48
- onChange: p,
49
- isValid: b,
50
- isInvalid: g,
51
- feedback: m,
44
+ className: c = "",
45
+ icon: a,
46
+ iconPosition: o = "left",
47
+ floatingLabelStyle: l,
48
+ onChange: f,
49
+ isValid: g,
50
+ isInvalid: b,
51
+ feedback: x,
52
52
  iconClasses: k,
53
- feedbackType: v = "invalid",
54
- labelClasses: S = "",
55
- inputType: L = "",
53
+ feedbackType: $ = "invalid",
54
+ labelClasses: N = "",
55
+ inputType: w = "",
56
56
  inputPattern: h,
57
57
  ...y
58
- } = e, [O, w] = A("default"), $ = D.useCallback(
58
+ } = e, [v, I] = D("default"), E = A.useCallback(
59
59
  (P) => {
60
- const E = P.target.value, K = (d == null ? void 0 : d(E)) ?? "default";
61
- w(K), u == null || u(P, K), p == null || p(P);
60
+ const L = P.target.value, Z = (p == null ? void 0 : p(L)) ?? "default";
61
+ I(Z), u == null || u(P, Z), f == null || f(P);
62
62
  },
63
- [d, u, p]
64
- ), x = I(() => t || (typeof n == "string" ? `input-${n.toLowerCase().replace(/\s+/g, "-")}` : `input-${Math.random().toString(36).slice(2)}`), [t, n]), C = !!a, j = V[o] || V.md, B = ee[c] || ee.flat, T = I(
65
- () => me(O, b, g),
66
- [O, b, g]
67
- ), M = I(() => s === "start" || s === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", [s]), R = I(() => l ? s === "start" || s === "left" ? "ps-10" : "pe-10" : "", [l, s]), F = (P) => {
68
- var Z;
69
- const E = P.key;
70
- !(P.ctrlKey || P.metaKey || E.length !== 1) && (() => {
71
- const H = /^\d$/, X = /^[a-zA-Z]$/;
72
- switch (L) {
63
+ [p, u, f]
64
+ ), m = j(() => t || (typeof n == "string" ? `input-${n.toLowerCase().replace(/\s+/g, "-")}` : `input-${Math.random().toString(36).slice(2)}`), [t, n]), C = !!l, O = V[s] || V.md, M = ee[d] || ee.flat, B = j(
65
+ () => he(v, g, b),
66
+ [v, g, b]
67
+ ), T = j(() => o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", [o]), _ = j(() => a ? o === "start" || o === "left" ? "ps-10" : "pe-10" : "", [a, o]), K = (P) => {
68
+ var H;
69
+ const L = P.key;
70
+ !(P.ctrlKey || P.metaKey || L.length !== 1) && (() => {
71
+ const W = /^\d$/, X = /^[a-zA-Z]$/;
72
+ switch (w) {
73
73
  case "numeric":
74
74
  case "number":
75
75
  case "integer":
76
- return !H.test(E);
76
+ return !W.test(L);
77
77
  case "decimal":
78
- return !H.test(E) && E !== "." && E !== "Backspace" && E !== "Tab";
78
+ return !W.test(L) && L !== "." && L !== "Backspace" && L !== "Tab";
79
79
  case "alphabetic":
80
- return !X.test(E);
80
+ return !X.test(L);
81
81
  case "custom":
82
- return h ? !h.test(E) : !1;
82
+ return h ? !h.test(L) : !1;
83
83
  default:
84
84
  return !1;
85
85
  }
86
- })() && P.preventDefault(), (Z = y.onKeyDown) == null || Z.call(y, P);
87
- }, fe = (P) => {
88
- var q;
89
- const E = P.clipboardData.getData("Text");
86
+ })() && P.preventDefault(), (H = y.onKeyDown) == null || H.call(y, P);
87
+ }, ge = (P) => {
88
+ var U;
89
+ const L = P.clipboardData.getData("Text");
90
90
  (() => {
91
- const Z = /^\d+$/, H = /^\d*\.?\d*$/, X = /^[a-zA-Z]+$/;
92
- switch (L) {
91
+ const H = /^\d+$/, W = /^\d*\.?\d*$/, X = /^[a-zA-Z]+$/;
92
+ switch (w) {
93
93
  case "numeric":
94
94
  case "number":
95
95
  case "integer":
96
- return !Z.test(E);
96
+ return !H.test(L);
97
97
  case "decimal":
98
- return !H.test(E);
98
+ return !W.test(L);
99
99
  case "alphabetic":
100
- return !X.test(E);
100
+ return !X.test(L);
101
101
  case "custom":
102
- return h ? !h.test(E) : !1;
102
+ return h ? !h.test(L) : !1;
103
103
  default:
104
104
  return !1;
105
105
  }
106
- })() && P.preventDefault(), (q = y.onPaste) == null || q.call(y, P);
106
+ })() && P.preventDefault(), (U = y.onPaste) == null || U.call(y, P);
107
107
  };
108
- return /* @__PURE__ */ N(
108
+ return /* @__PURE__ */ S(
109
109
  "div",
110
110
  {
111
111
  className: `w-full relative ${C ? "z-0" : ""} tailwind-ux-input`,
@@ -113,76 +113,76 @@ const V = {
113
113
  !C && n && /* @__PURE__ */ i(
114
114
  "label",
115
115
  {
116
- htmlFor: x,
117
- 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"} ${S}`,
116
+ htmlFor: m,
117
+ className: `block mb-1 text-sm ${g ? "text-green-700 dark:text-green-500" : b ? "text-red-700 dark:text-red-500" : "text-gray-700"} ${N}`,
118
118
  children: n
119
119
  }
120
120
  ),
121
- /* @__PURE__ */ N("div", { className: "relative w-full", children: [
122
- l && /* @__PURE__ */ i(
121
+ /* @__PURE__ */ S("div", { className: "relative w-full", children: [
122
+ a && /* @__PURE__ */ i(
123
123
  "div",
124
124
  {
125
- className: `absolute inset-y-0 flex items-center ${M} ${k}`,
125
+ className: `absolute inset-y-0 flex items-center ${T} ${k}`,
126
126
  "aria-hidden": "true",
127
- children: l
127
+ children: a
128
128
  }
129
129
  ),
130
130
  /* @__PURE__ */ i(
131
131
  "input",
132
132
  {
133
133
  ...y,
134
- id: x,
134
+ id: m,
135
135
  ref: r,
136
136
  placeholder: C ? " " : y.placeholder,
137
- onChange: $,
138
- onKeyDown: F,
139
- onPaste: fe,
137
+ onChange: E,
138
+ onKeyDown: K,
139
+ onPaste: ge,
140
140
  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
141
- ${j}
142
- ${C && a && ge[a]}
143
- ${R} ${B} ${T} ${f}`
141
+ ${O}
142
+ ${C && l && me[l]}
143
+ ${_} ${M} ${B} ${c}`
144
144
  }
145
145
  ),
146
- C && n && a && /* @__PURE__ */ i(
146
+ C && n && l && /* @__PURE__ */ i(
147
147
  "label",
148
148
  {
149
- htmlFor: x,
150
- className: `ms-1 ${be[a]} ${f}`,
149
+ htmlFor: m,
150
+ className: `ms-1 ${xe[l]} ${c}`,
151
151
  children: n
152
152
  }
153
153
  )
154
154
  ] }),
155
- m && /* @__PURE__ */ i(
155
+ x && /* @__PURE__ */ i(
156
156
  "p",
157
157
  {
158
- className: `mt-1 text-xs ${v === "invalid" ? "text-red-600 dark:text-red-500" : "text-green-600 dark:text-green-500"}`,
159
- role: v === "invalid" ? "alert" : void 0,
160
- children: m
158
+ className: `mt-1 text-xs ${$ === "invalid" ? "text-red-600 dark:text-red-500" : "text-green-600 dark:text-green-500"}`,
159
+ role: $ === "invalid" ? "alert" : void 0,
160
+ children: x
161
161
  }
162
162
  )
163
163
  ]
164
164
  }
165
165
  );
166
166
  });
167
- xe.displayName = "Input";
168
- const he = {
167
+ ye.displayName = "Input";
168
+ const we = {
169
169
  xs: "text-xs px-2 py-1",
170
170
  sm: "text-sm px-3 py-1.5",
171
171
  md: "text-sm px-3 py-3",
172
172
  lg: "text-lg px-5 py-3"
173
- }, ye = {
173
+ }, ve = {
174
174
  flat: "rounded-none",
175
175
  rounded: "rounded-sm",
176
176
  pill: "rounded-full"
177
- }, we = {
177
+ }, Ce = {
178
178
  filled: "rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",
179
179
  outlined: "rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",
180
180
  standard: "px-0 py-2.5 bg-transparent border-0 border-b-2"
181
- }, ve = {
181
+ }, $e = {
182
182
  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",
183
183
  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",
184
184
  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"
185
- }, Ce = (e, r, n) => {
185
+ }, ke = (e, r, n) => {
186
186
  if (n)
187
187
  return "border-red-500 bg-red-50 text-red-900 focus:ring-red-500 focus:border-red-500";
188
188
  if (r)
@@ -198,80 +198,80 @@ const he = {
198
198
  default:
199
199
  return "border-gray-300 focus:ring-blue-500";
200
200
  }
201
- }, ke = re((e, r) => {
201
+ }, Se = oe((e, r) => {
202
202
  const {
203
203
  label: n,
204
204
  id: t,
205
- inputSize: o = "md",
206
- shape: c = "rounded",
207
- validate: d,
205
+ inputSize: s = "md",
206
+ shape: d = "rounded",
207
+ validate: p,
208
208
  onValidatedChange: u,
209
- className: f = "",
210
- icon: l,
211
- iconPosition: s = "left",
212
- floatingLabelStyle: a,
213
- onChange: p,
214
- isValid: b,
215
- isInvalid: g,
216
- feedback: m,
209
+ className: c = "",
210
+ icon: a,
211
+ iconPosition: o = "left",
212
+ floatingLabelStyle: l,
213
+ onChange: f,
214
+ isValid: g,
215
+ isInvalid: b,
216
+ feedback: x,
217
217
  feedbackType: k = "invalid",
218
- children: v,
219
- ...S
220
- } = e, [L, h] = A("default"), y = pe(), O = I(() => t || (typeof n == "string" ? `select-${n.toLowerCase().replace(/\s+/g, "-")}` : y), [t, n, y]), w = (M) => {
221
- const R = M.target.value, F = (d == null ? void 0 : d(R)) ?? "default";
222
- h(F), u == null || u(M, F), p == null || p(M);
223
- }, $ = !!a, x = he[o], C = ye[c], j = Ce(L, b, g);
224
- return /* @__PURE__ */ N("div", { className: `w-full relative ${$ ? "z-0" : ""}`, children: [
225
- !$ && n && /* @__PURE__ */ i(
218
+ children: $,
219
+ ...N
220
+ } = e, [w, h] = D("default"), y = be(), v = j(() => t || (typeof n == "string" ? `select-${n.toLowerCase().replace(/\s+/g, "-")}` : y), [t, n, y]), I = (T) => {
221
+ const _ = T.target.value, K = (p == null ? void 0 : p(_)) ?? "default";
222
+ h(K), u == null || u(T, K), f == null || f(T);
223
+ }, E = !!l, m = we[s], C = ve[d], O = ke(w, g, b);
224
+ return /* @__PURE__ */ S("div", { className: `w-full relative ${E ? "z-0" : ""}`, children: [
225
+ !E && n && /* @__PURE__ */ i(
226
226
  "label",
227
227
  {
228
- htmlFor: O,
229
- className: `block mb-1 text-sm ${b ? "text-green-700" : g ? "text-red-700" : "text-gray-700"}`,
228
+ htmlFor: v,
229
+ className: `block mb-1 text-sm ${g ? "text-green-700" : b ? "text-red-700" : "text-gray-700"}`,
230
230
  children: n
231
231
  }
232
232
  ),
233
- /* @__PURE__ */ N("div", { className: "relative w-full", children: [
234
- l && /* @__PURE__ */ i(
233
+ /* @__PURE__ */ S("div", { className: "relative w-full", children: [
234
+ a && /* @__PURE__ */ i(
235
235
  "div",
236
236
  {
237
- className: `absolute inset-y-0 flex items-center ${s === "start" || s === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5"}`,
238
- children: /* @__PURE__ */ i("span", { className: "text-gray-500", children: l })
237
+ className: `absolute inset-y-0 flex items-center ${o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5"}`,
238
+ children: /* @__PURE__ */ i("span", { className: "text-gray-500", children: a })
239
239
  }
240
240
  ),
241
241
  /* @__PURE__ */ i(
242
242
  "select",
243
243
  {
244
- ...S,
245
- id: O,
244
+ ...N,
245
+ id: v,
246
246
  ref: r,
247
- onChange: w,
247
+ onChange: I,
248
248
  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
249
- ${x} ${l && (s === "start" || s === "left") ? "ps-10" : l ? "pe-10" : ""}
250
- ${$ && a && we[a]}
251
- ${C} ${j} ${f}`,
252
- children: v
249
+ ${m} ${a && (o === "start" || o === "left") ? "ps-10" : a ? "pe-10" : ""}
250
+ ${E && l && Ce[l]}
251
+ ${C} ${O} ${c}`,
252
+ children: $
253
253
  }
254
254
  ),
255
- $ && n && a && /* @__PURE__ */ i(
255
+ E && n && l && /* @__PURE__ */ i(
256
256
  "label",
257
257
  {
258
- htmlFor: O,
259
- className: `ms-1 ${ve[a]} ${f}`,
258
+ htmlFor: v,
259
+ className: `ms-1 ${$e[l]} ${c}`,
260
260
  children: n
261
261
  }
262
262
  )
263
263
  ] }),
264
- m && /* @__PURE__ */ i(
264
+ x && /* @__PURE__ */ i(
265
265
  "p",
266
266
  {
267
267
  className: `mt-1 text-xs ${k === "invalid" ? "text-red-600" : "text-green-600"}`,
268
- children: m
268
+ children: x
269
269
  }
270
270
  )
271
271
  ] });
272
272
  });
273
- ke.displayName = "Select";
274
- const $e = {
273
+ Se.displayName = "Select";
274
+ const Ne = {
275
275
  primary: "btn-primary",
276
276
  secondary: "btn-secondary",
277
277
  success: "btn-success",
@@ -297,39 +297,39 @@ const $e = {
297
297
  "soft-info": "btn-soft-info",
298
298
  "soft-dark": "btn-soft-dark",
299
299
  "soft-light": "btn-soft-light"
300
- }, Ne = {
300
+ }, Ee = {
301
301
  xs: "px-3 py-2 text-xs",
302
302
  sm: "px-3 py-2 text-sm",
303
303
  md: "px-5 py-2.5 text-sm",
304
304
  lg: "px-5 py-3 text-base",
305
305
  xl: "px-6 py-3.5 text-base"
306
- }, Se = {
306
+ }, Le = {
307
307
  flat: "shadow-none",
308
308
  rounded: "rounded-sm",
309
309
  pill: "rounded-full",
310
310
  circle: "rounded-full w-10 h-10 p-0 flex items-center justify-center"
311
- }, Ye = ({
311
+ }, Qe = ({
312
312
  children: e,
313
313
  variant: r = "primary",
314
314
  size: n = "md",
315
315
  type: t = "button",
316
- shape: o = "rounded",
317
- className: c = "",
318
- isLoading: d = !1,
316
+ shape: s = "rounded",
317
+ className: d = "",
318
+ isLoading: p = !1,
319
319
  disabled: u = !1,
320
- ...f
320
+ ...c
321
321
  }) => {
322
- const l = u || d, s = [
322
+ const a = u || p, o = [
323
323
  "inline-flex items-center justify-center font-normal transition duration-150",
324
- $e[r],
325
- Ne[n],
326
- Se[o],
327
- o === "flat" ? "shadow-none" : "shadow-sm",
328
- l ? "opacity-50 cursor-not-allowed" : "cursor-pointer",
329
- c
324
+ Ne[r],
325
+ Ee[n],
326
+ Le[s],
327
+ s === "flat" ? "shadow-none" : "shadow-sm",
328
+ a ? "opacity-50 cursor-not-allowed" : "cursor-pointer",
329
+ d
330
330
  ].filter(Boolean).join(" ");
331
- return /* @__PURE__ */ N("button", { type: t, className: s, disabled: l, ...f, children: [
332
- d && /* @__PURE__ */ N(
331
+ return /* @__PURE__ */ S("button", { type: t, className: o, disabled: a, ...c, children: [
332
+ p && /* @__PURE__ */ S(
333
333
  "svg",
334
334
  {
335
335
  "aria-hidden": "true",
@@ -359,24 +359,24 @@ const $e = {
359
359
  e
360
360
  ] });
361
361
  };
362
- var ae = {
362
+ var ie = {
363
363
  color: void 0,
364
364
  size: void 0,
365
365
  className: void 0,
366
366
  style: void 0,
367
367
  attr: void 0
368
- }, te = D.createContext && /* @__PURE__ */ D.createContext(ae), Ee = ["attr", "size", "title"];
369
- function Le(e, r) {
368
+ }, te = A.createContext && /* @__PURE__ */ A.createContext(ie), Oe = ["attr", "size", "title"];
369
+ function Pe(e, r) {
370
370
  if (e == null) return {};
371
- var n = Oe(e, r), t, o;
371
+ var n = Ie(e, r), t, s;
372
372
  if (Object.getOwnPropertySymbols) {
373
- var c = Object.getOwnPropertySymbols(e);
374
- for (o = 0; o < c.length; o++)
375
- t = c[o], !(r.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(e, t) && (n[t] = e[t]);
373
+ var d = Object.getOwnPropertySymbols(e);
374
+ for (s = 0; s < d.length; s++)
375
+ t = d[s], !(r.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(e, t) && (n[t] = e[t]);
376
376
  }
377
377
  return n;
378
378
  }
379
- function Oe(e, r) {
379
+ function Ie(e, r) {
380
380
  if (e == null) return {};
381
381
  var n = {};
382
382
  for (var t in e)
@@ -400,31 +400,31 @@ function ne(e, r) {
400
400
  var n = Object.keys(e);
401
401
  if (Object.getOwnPropertySymbols) {
402
402
  var t = Object.getOwnPropertySymbols(e);
403
- r && (t = t.filter(function(o) {
404
- return Object.getOwnPropertyDescriptor(e, o).enumerable;
403
+ r && (t = t.filter(function(s) {
404
+ return Object.getOwnPropertyDescriptor(e, s).enumerable;
405
405
  })), n.push.apply(n, t);
406
406
  }
407
407
  return n;
408
408
  }
409
- function U(e) {
409
+ function q(e) {
410
410
  for (var r = 1; r < arguments.length; r++) {
411
411
  var n = arguments[r] != null ? arguments[r] : {};
412
412
  r % 2 ? ne(Object(n), !0).forEach(function(t) {
413
- Pe(e, t, n[t]);
413
+ je(e, t, n[t]);
414
414
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ne(Object(n)).forEach(function(t) {
415
415
  Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
416
416
  });
417
417
  }
418
418
  return e;
419
419
  }
420
- function Pe(e, r, n) {
421
- return r = je(r), r in e ? Object.defineProperty(e, r, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = n, e;
420
+ function je(e, r, n) {
421
+ return r = ze(r), r in e ? Object.defineProperty(e, r, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = n, e;
422
422
  }
423
- function je(e) {
424
- var r = Ie(e, "string");
423
+ function ze(e) {
424
+ var r = De(e, "string");
425
425
  return typeof r == "symbol" ? r : r + "";
426
426
  }
427
- function Ie(e, r) {
427
+ function De(e, r) {
428
428
  if (typeof e != "object" || !e) return e;
429
429
  var n = e[Symbol.toPrimitive];
430
430
  if (n !== void 0) {
@@ -434,52 +434,52 @@ function Ie(e, r) {
434
434
  }
435
435
  return (r === "string" ? String : Number)(e);
436
436
  }
437
- function le(e) {
438
- return e && e.map((r, n) => /* @__PURE__ */ D.createElement(r.tag, U({
437
+ function ce(e) {
438
+ return e && e.map((r, n) => /* @__PURE__ */ A.createElement(r.tag, q({
439
439
  key: n
440
- }, r.attr), le(r.child)));
440
+ }, r.attr), ce(r.child)));
441
441
  }
442
442
  function Q(e) {
443
- return (r) => /* @__PURE__ */ D.createElement(ze, G({
444
- attr: U({}, e.attr)
445
- }, r), le(e.child));
443
+ return (r) => /* @__PURE__ */ A.createElement(Ae, G({
444
+ attr: q({}, e.attr)
445
+ }, r), ce(e.child));
446
446
  }
447
- function ze(e) {
447
+ function Ae(e) {
448
448
  var r = (n) => {
449
449
  var {
450
450
  attr: t,
451
- size: o,
452
- title: c
453
- } = e, d = Le(e, Ee), u = o || n.size || "1em", f;
454
- return n.className && (f = n.className), e.className && (f = (f ? f + " " : "") + e.className), /* @__PURE__ */ D.createElement("svg", G({
451
+ size: s,
452
+ title: d
453
+ } = e, p = Pe(e, Oe), u = s || n.size || "1em", c;
454
+ return n.className && (c = n.className), e.className && (c = (c ? c + " " : "") + e.className), /* @__PURE__ */ A.createElement("svg", G({
455
455
  stroke: "currentColor",
456
456
  fill: "currentColor",
457
457
  strokeWidth: "0"
458
- }, n.attr, t, d, {
459
- className: f,
460
- style: U(U({
458
+ }, n.attr, t, p, {
459
+ className: c,
460
+ style: q(q({
461
461
  color: e.color || n.color
462
462
  }, n.style), e.style),
463
463
  height: u,
464
464
  width: u,
465
465
  xmlns: "http://www.w3.org/2000/svg"
466
- }), c && /* @__PURE__ */ D.createElement("title", null, c), e.children);
466
+ }), d && /* @__PURE__ */ A.createElement("title", null, d), e.children);
467
467
  };
468
- return te !== void 0 ? /* @__PURE__ */ D.createElement(te.Consumer, null, (n) => r(n)) : r(ae);
468
+ return te !== void 0 ? /* @__PURE__ */ A.createElement(te.Consumer, null, (n) => r(n)) : r(ie);
469
469
  }
470
- function De(e) {
470
+ function Me(e) {
471
471
  return Q({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z" }, child: [] }] })(e);
472
472
  }
473
- const Ae = {
473
+ const Te = {
474
474
  xs: "w-3 h-3 text-[10px]",
475
475
  sm: "w-4 h-4 text-xs",
476
476
  md: "w-5 h-5 text-sm",
477
477
  lg: "w-6 h-6 text-base"
478
- }, Me = {
478
+ }, Re = {
479
479
  flat: "rounded-none",
480
480
  rounded: "rounded-sm",
481
481
  pill: "rounded-full"
482
- }, Te = {
482
+ }, Be = {
483
483
  primary: "primary",
484
484
  secondary: "secondary",
485
485
  success: "success",
@@ -505,156 +505,156 @@ const Ae = {
505
505
  "soft-info": "soft-info",
506
506
  "soft-dark": "soft-dark",
507
507
  "soft-light": "soft-light"
508
- }, Re = D.forwardRef(
508
+ }, _e = A.forwardRef(
509
509
  ({
510
510
  label: e,
511
511
  boxSize: r = "md",
512
512
  shape: n = "rounded",
513
513
  variant: t = "success",
514
- onSelectionChange: o,
515
- disabled: c = !1,
516
- className: d = "",
514
+ onSelectionChange: s,
515
+ disabled: d = !1,
516
+ className: p = "",
517
517
  id: u,
518
- value: f,
519
- icon: l,
520
- children: s,
521
- checked: a,
522
- ...p
523
- }, b) => {
524
- const g = (x) => {
525
- !c && o && o(x.target.checked), p.onChange && p.onChange(x);
526
- }, m = "mr-2 border flex items-center justify-center transition-all", k = Ae[r], v = Me[n], S = Te[t] ?? "", L = t.startsWith("outline"), h = t.startsWith("soft"), w = `${m} ${k} ${v} ${S} ${a && (L || h || t === "link") ? "peer-checked:bg-current peer-checked:text-white" : a ? "peer-checked:bg-current" : ""}`, $ = {
518
+ value: c,
519
+ icon: a,
520
+ children: o,
521
+ checked: l,
522
+ ...f
523
+ }, g) => {
524
+ const b = (m) => {
525
+ !d && s && s(m.target.checked), f.onChange && f.onChange(m);
526
+ }, x = "mr-2 border flex items-center justify-center transition-all", k = Te[r], $ = Re[n], N = Be[t] ?? "", w = t.startsWith("outline"), h = t.startsWith("soft"), I = `${x} ${k} ${$} ${N} ${l && (w || h || t === "link") ? "peer-checked:bg-current peer-checked:text-white" : l ? "peer-checked:bg-current" : ""}`, E = {
527
527
  xs: "w-2 h-2",
528
528
  sm: "w-2.5 h-2.5",
529
529
  md: "w-3 h-3",
530
530
  lg: "w-3.5 h-3.5"
531
531
  };
532
- return /* @__PURE__ */ N(
532
+ return /* @__PURE__ */ S(
533
533
  "label",
534
534
  {
535
- className: `flex items-center ${c ? "opacity-50 cursor-not-allowed" : "cursor-pointer"} me-4 ${d}`,
535
+ className: `flex items-center ${d ? "opacity-50 cursor-not-allowed" : "cursor-pointer"} me-4 ${p}`,
536
536
  children: [
537
537
  /* @__PURE__ */ i(
538
538
  "input",
539
539
  {
540
540
  type: "checkbox",
541
541
  className: "peer hidden",
542
- checked: a,
543
- onChange: g,
544
- disabled: c,
542
+ checked: l,
543
+ onChange: b,
544
+ disabled: d,
545
545
  id: u,
546
- value: f,
547
- ref: b,
548
- ...p
546
+ value: c,
547
+ ref: g,
548
+ ...f
549
549
  }
550
550
  ),
551
- /* @__PURE__ */ i("span", { className: w.trim(), children: (a || p.defaultChecked) && (l ?? /* @__PURE__ */ i(De, { className: `${$[r]}` })) }),
552
- e || s ? /* @__PURE__ */ i("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-300", children: e ?? s }) : null
551
+ /* @__PURE__ */ i("span", { className: I.trim(), children: (l || f.defaultChecked) && (a ?? /* @__PURE__ */ i(Me, { className: `${E[r]}` })) }),
552
+ e || o ? /* @__PURE__ */ i("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-300", children: e ?? o }) : null
553
553
  ]
554
554
  }
555
555
  );
556
556
  }
557
557
  );
558
- Re.displayName = "Checkbox";
559
- const Je = ({
558
+ _e.displayName = "Checkbox";
559
+ const Ve = ({
560
560
  label: e,
561
561
  header: r,
562
562
  items: n = [],
563
563
  onSelect: t,
564
- renderItem: o,
565
- position: c = "right",
566
- className: d = "",
564
+ renderItem: s,
565
+ position: d = "right",
566
+ className: p = "",
567
567
  menuClassName: u = "",
568
- width: f = "w-48",
569
- closeOnSelect: l = !1,
570
- transition: s = !0,
571
- ariaLabel: a = "Dropdown menu",
572
- ...p
568
+ width: c = "w-48",
569
+ closeOnSelect: a = !1,
570
+ transition: o = !0,
571
+ ariaLabel: l = "Dropdown menu",
572
+ ...f
573
573
  }) => {
574
- const [b, g] = A(!1), [m, k] = A(!1), v = W(null), S = W(null), L = I(() => ({
574
+ const [g, b] = D(!1), [x, k] = D(!1), $ = F(null), N = F(null), w = j(() => ({
575
575
  left: "left-0",
576
576
  center: "left-1/2 transform -translate-x-1/2",
577
577
  right: "right-0"
578
- })[c], [c]), h = z(() => {
579
- const x = S.current, C = v.current;
580
- if (!x || !C) return;
581
- const { top: j, bottom: B } = x.getBoundingClientRect(), T = C.offsetHeight, M = window.innerHeight - B, R = j;
582
- k(M < T && R > T);
583
- }, []), y = z((x) => {
584
- var C, j;
585
- !((C = v.current) != null && C.contains(x.target)) && !((j = S.current) != null && j.contains(x.target)) && g(!1);
586
- }, []), O = z(() => g((x) => !x), []), w = z(() => g(!1), []);
587
- _(() => {
588
- if (b)
578
+ })[d], [d]), h = z(() => {
579
+ const m = N.current, C = $.current;
580
+ if (!m || !C) return;
581
+ const { top: O, bottom: M } = m.getBoundingClientRect(), B = C.offsetHeight, T = window.innerHeight - M, _ = O;
582
+ k(T < B && _ > B);
583
+ }, []), y = z((m) => {
584
+ var C, O;
585
+ !((C = $.current) != null && C.contains(m.target)) && !((O = N.current) != null && O.contains(m.target)) && b(!1);
586
+ }, []), v = z(() => b((m) => !m), []), I = z(() => b(!1), []);
587
+ R(() => {
588
+ if (g)
589
589
  return h(), window.addEventListener("resize", h), window.addEventListener("scroll", h, !0), () => {
590
590
  window.removeEventListener("resize", h), window.removeEventListener("scroll", h, !0);
591
591
  };
592
- }, [b, h]), _(() => (document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y)), [y]);
593
- const $ = I(
592
+ }, [g, h]), R(() => (document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y)), [y]);
593
+ const E = j(
594
594
  () => [
595
595
  "absolute z-50 bg-white rounded shadow-lg overflow-hidden w-auto",
596
- m ? "bottom-full mb-2" : "top-full mt-2",
597
- L,
598
- f,
599
- s && "transition-all duration-200 ease-out",
596
+ x ? "bottom-full mb-2" : "top-full mt-2",
597
+ w,
598
+ c,
599
+ o && "transition-all duration-200 ease-out",
600
600
  u
601
601
  ].filter(Boolean).join(" "),
602
- [m, L, f, s, u]
602
+ [x, w, c, o, u]
603
603
  );
604
- return /* @__PURE__ */ N("div", { className: `relative inline-block ${d}`, ...p, children: [
604
+ return /* @__PURE__ */ S("div", { className: `relative inline-block ${p}`, ...f, children: [
605
605
  /* @__PURE__ */ i(
606
606
  "button",
607
607
  {
608
608
  type: "button",
609
- ref: S,
610
- onClick: O,
611
- "aria-expanded": b,
612
- "aria-label": a,
609
+ ref: N,
610
+ onClick: v,
611
+ "aria-expanded": g,
612
+ "aria-label": l,
613
613
  className: "focus:outline-none",
614
614
  children: e
615
615
  }
616
616
  ),
617
- b && /* @__PURE__ */ N("div", { ref: v, role: "menu", className: $, children: [
617
+ g && /* @__PURE__ */ S("div", { ref: $, role: "menu", className: E, children: [
618
618
  r && r,
619
- n.map((x, C) => {
620
- const j = () => {
621
- t && t(x), l && w();
619
+ n.map((m, C) => {
620
+ const O = () => {
621
+ t && t(m), a && I();
622
622
  };
623
- return /* @__PURE__ */ i("div", { children: o ? o(x, j) : /* @__PURE__ */ i(
623
+ return /* @__PURE__ */ i("div", { children: s ? s(m, O) : /* @__PURE__ */ i(
624
624
  "div",
625
625
  {
626
- onClick: j,
626
+ onClick: O,
627
627
  className: "px-4 py-2 text-sm text-gray-800 hover:bg-gray-100 cursor-pointer",
628
628
  role: "menuitem",
629
- children: x.label
629
+ children: m.label
630
630
  }
631
631
  ) }, C);
632
632
  })
633
633
  ] })
634
634
  ] });
635
- }, Qe = ({
635
+ }, et = ({
636
636
  children: e,
637
637
  content: r,
638
638
  position: n = "top",
639
639
  className: t = "",
640
- tooltipClass: o = "",
641
- tooltipStyle: c = {}
640
+ tooltipClass: s = "",
641
+ tooltipStyle: d = {}
642
642
  }) => {
643
- const d = W(null), u = W(null);
644
- _(() => {
645
- const l = d.current, s = u.current;
646
- if (!l || !s) return;
647
- const a = () => {
648
- s.style.opacity = "1", s.style.visibility = "visible";
649
- }, p = () => {
650
- s.style.opacity = "0", s.style.visibility = "hidden";
643
+ const p = F(null), u = F(null);
644
+ R(() => {
645
+ const a = p.current, o = u.current;
646
+ if (!a || !o) return;
647
+ const l = () => {
648
+ o.style.opacity = "1", o.style.visibility = "visible";
649
+ }, f = () => {
650
+ o.style.opacity = "0", o.style.visibility = "hidden";
651
651
  };
652
- return l.addEventListener("mouseenter", a), l.addEventListener("mouseleave", p), () => {
653
- l.removeEventListener("mouseenter", a), l.removeEventListener("mouseleave", p);
652
+ return a.addEventListener("mouseenter", l), a.addEventListener("mouseleave", f), () => {
653
+ a.removeEventListener("mouseenter", l), a.removeEventListener("mouseleave", f);
654
654
  };
655
655
  }, []);
656
- const f = (l) => {
657
- const s = {
656
+ const c = (a) => {
657
+ const o = {
658
658
  position: "absolute",
659
659
  opacity: 0,
660
660
  visibility: "hidden",
@@ -671,10 +671,10 @@ const Je = ({
671
671
  zIndex: 9999,
672
672
  width: "max-content"
673
673
  };
674
- switch (l) {
674
+ switch (a) {
675
675
  case "top":
676
676
  return {
677
- ...s,
677
+ ...o,
678
678
  bottom: "100%",
679
679
  left: "50%",
680
680
  transform: "translateX(-50%)",
@@ -682,7 +682,7 @@ const Je = ({
682
682
  };
683
683
  case "bottom":
684
684
  return {
685
- ...s,
685
+ ...o,
686
686
  top: "100%",
687
687
  left: "50%",
688
688
  transform: "translateX(-50%)",
@@ -690,7 +690,7 @@ const Je = ({
690
690
  };
691
691
  case "left":
692
692
  return {
693
- ...s,
693
+ ...o,
694
694
  right: "100%",
695
695
  top: "50%",
696
696
  transform: "translateY(-50%)",
@@ -698,33 +698,33 @@ const Je = ({
698
698
  };
699
699
  case "right":
700
700
  return {
701
- ...s,
701
+ ...o,
702
702
  left: "100%",
703
703
  top: "50%",
704
704
  transform: "translateY(-50%)",
705
705
  marginLeft: "8px"
706
706
  };
707
707
  default:
708
- return s;
708
+ return o;
709
709
  }
710
710
  };
711
- return /* @__PURE__ */ N("div", { ref: d, className: `relative inline-block ${t}`, children: [
711
+ return /* @__PURE__ */ S("div", { ref: p, className: `relative inline-block ${t}`, children: [
712
712
  e,
713
713
  /* @__PURE__ */ i(
714
714
  "div",
715
715
  {
716
716
  ref: u,
717
717
  role: "tooltip",
718
- className: o,
718
+ className: s,
719
719
  style: {
720
- ...f(n),
721
- ...c
720
+ ...c(n),
721
+ ...d
722
722
  },
723
723
  children: r
724
724
  }
725
725
  )
726
726
  ] });
727
- }, _e = {
727
+ }, Fe = {
728
728
  primary: "bg-blue-500 text-white",
729
729
  secondary: "bg-gray-500 text-white",
730
730
  success: "bg-green-500 text-white",
@@ -742,64 +742,180 @@ const Je = ({
742
742
  "outline-info": "border border-cyan-500 text-cyan-500 bg-transparent",
743
743
  "outline-dark": "border border-black text-black bg-transparent",
744
744
  "outline-light": "border border-gray-100 text-gray-800 bg-transparent"
745
- }, Be = {
745
+ }, Ke = {
746
746
  xs: "text-xs px-2 py-0.5",
747
747
  sm: "text-sm px-2.5 py-0.5",
748
748
  md: "text-base px-3 py-1",
749
749
  lg: "text-lg px-3.5 py-1.5",
750
750
  xl: "text-xl px-4 py-2"
751
- }, Fe = {
751
+ }, Ze = {
752
752
  flat: "rounded-none",
753
753
  rounded: "rounded-sm",
754
754
  pill: "rounded-full",
755
755
  circle: "rounded-full p-2 w-8 h-8 justify-center"
756
- }, Ve = ({
756
+ }, tt = ({
757
757
  label: e,
758
758
  variant: r = "primary",
759
759
  size: n = "sm",
760
760
  shape: t = "rounded",
761
- icon: o,
762
- dismissible: c,
763
- onDismiss: d,
761
+ icon: s,
762
+ dismissible: d,
763
+ onDismiss: p,
764
764
  className: u = "",
765
- ...f
765
+ ...c
766
766
  }) => {
767
- const l = !e && !!o, s = `inline-flex items-center font-medium ${_e[r] || ""} ${Be[n] || ""} ${Fe[t] || ""} ${l ? "justify-center p-2 w-8 h-8" : ""} ` + u;
768
- return /* @__PURE__ */ N("span", { className: s.trim(), ...f, children: [
769
- o && /* @__PURE__ */ i("span", { className: e ? "mr-1" : "", children: o }),
767
+ const a = !e && !!s, o = `inline-flex items-center font-medium ${Fe[r] || ""} ${Ke[n] || ""} ${Ze[t] || ""} ${a ? "justify-center p-2 w-8 h-8" : ""} ` + u;
768
+ return /* @__PURE__ */ S("span", { className: o.trim(), ...c, children: [
769
+ s && /* @__PURE__ */ i("span", { className: e ? "mr-1" : "", children: s }),
770
770
  e,
771
- c && /* @__PURE__ */ i(
771
+ d && /* @__PURE__ */ i(
772
772
  "button",
773
773
  {
774
774
  type: "button",
775
- onClick: d,
775
+ onClick: p,
776
776
  className: "ml-2 text-xs font-bold leading-none focus:outline-none",
777
777
  children: "×"
778
778
  }
779
779
  )
780
780
  ] });
781
+ }, re = {
782
+ rounded: "rounded-md",
783
+ pill: "rounded-full",
784
+ flat: "rounded-none"
785
+ }, se = {
786
+ xs: {
787
+ button: "px-2 py-1 text-xs"
788
+ },
789
+ sm: {
790
+ button: "px-3 py-1.5 text-sm"
791
+ },
792
+ md: {
793
+ button: "px-4 py-2 text-sm"
794
+ },
795
+ lg: {
796
+ button: "px-5 py-3 text-base"
797
+ },
798
+ xl: {
799
+ button: "px-6 py-4 text-lg"
800
+ }
781
801
  };
782
- function Ke(e) {
802
+ function nt({
803
+ options: e,
804
+ selected: r,
805
+ onChange: n,
806
+ label: t,
807
+ disabled: s = !1,
808
+ shape: d = "rounded",
809
+ variant: p = "primary",
810
+ size: u = "md",
811
+ className: c = "",
812
+ classNames: a = {},
813
+ id: o,
814
+ name: l,
815
+ renderOption: f
816
+ }) {
817
+ const g = re[d] || re.rounded, b = se[u] || se.md, x = F(null), [k, $] = D({});
818
+ R(() => {
819
+ if (!x.current) return;
820
+ const w = e.findIndex((v) => v.value === r);
821
+ if (w === -1) return;
822
+ const y = x.current.querySelectorAll("button")[w];
823
+ if (y) {
824
+ const { offsetLeft: v, offsetWidth: I, offsetHeight: E } = y;
825
+ $({
826
+ transform: `translateX(${v}px)`,
827
+ width: I,
828
+ height: E
829
+ });
830
+ }
831
+ }, [r, e, u]);
832
+ const N = `toggler-${p}`;
833
+ return /* @__PURE__ */ S(
834
+ "div",
835
+ {
836
+ className: `flex flex-col gap-2 w-fit ${c} ${a.root ?? ""}`,
837
+ id: o,
838
+ children: [
839
+ t && /* @__PURE__ */ i(
840
+ "span",
841
+ {
842
+ className: `text-sm font-medium select-none ${a.label ?? ""}`,
843
+ children: t
844
+ }
845
+ ),
846
+ /* @__PURE__ */ S(
847
+ "div",
848
+ {
849
+ ref: x,
850
+ role: "radiogroup",
851
+ "aria-disabled": s,
852
+ className: `relative inline-flex overflow-hidden border border-gray-300 bg-gray-100 ${g} ${s ? "opacity-50 cursor-not-allowed" : ""} ${a.group ?? ""}`,
853
+ children: [
854
+ /* @__PURE__ */ i(
855
+ "div",
856
+ {
857
+ className: `absolute top-0 left-0 transition-transform duration-300 ease-in-out ${g} ${N}`,
858
+ style: {
859
+ ...k,
860
+ zIndex: 0
861
+ },
862
+ "aria-hidden": "true"
863
+ }
864
+ ),
865
+ e.map((w) => {
866
+ const h = r === w.value, y = s || w.disabled;
867
+ return /* @__PURE__ */ i(
868
+ "button",
869
+ {
870
+ role: "radio",
871
+ name: l,
872
+ "aria-checked": h,
873
+ disabled: y,
874
+ onClick: () => !y && n(w.value),
875
+ onKeyDown: (v) => {
876
+ (v.key === "Enter" || v.key === " ") && !y && (v.preventDefault(), n(w.value));
877
+ },
878
+ className: `
879
+ relative z-10
880
+ transition-colors duration-200 focus:outline-none
881
+ ${b.button}
882
+ ${h ? `text-white toggler-text-${p}` : "text-gray-700 hover:bg-gray-200"}
883
+ ${a.option ?? ""}
884
+ ${h ? a.selectedOption ?? "" : ""}
885
+ `,
886
+ children: f ? f(w, h) : w.label
887
+ },
888
+ String(w.value)
889
+ );
890
+ })
891
+ ]
892
+ }
893
+ )
894
+ ]
895
+ }
896
+ );
897
+ }
898
+ function He(e) {
783
899
  return Q({ 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);
784
900
  }
785
- const et = ({
901
+ const rt = ({
786
902
  items: e,
787
903
  allowMultipleOpen: r = !1,
788
904
  className: n = "",
789
905
  tileClasses: t = "",
790
- open: o,
791
- onChange: c,
792
- renderTitle: d,
906
+ open: s,
907
+ onChange: d,
908
+ renderTitle: p,
793
909
  renderContent: u,
794
- showArrowIcon: f = !0,
795
- panelClasses: l = ""
910
+ showArrowIcon: c = !0,
911
+ panelClasses: a = ""
796
912
  }) => {
797
- const [s, a] = A(/* @__PURE__ */ new Set()), p = I(() => o ? new Set(o) : s, [o, s]), b = z(
798
- (g) => {
799
- const m = new Set(p);
800
- m.has(g) ? m.delete(g) : (r || m.clear(), m.add(g)), o && c ? c(Array.from(m)) : a(m);
913
+ const [o, l] = D(/* @__PURE__ */ new Set()), f = j(() => s ? new Set(s) : o, [s, o]), g = z(
914
+ (b) => {
915
+ const x = new Set(f);
916
+ x.has(b) ? x.delete(b) : (r || x.clear(), x.add(b)), s && d ? d(Array.from(x)) : l(x);
801
917
  },
802
- [p, o, c, r]
918
+ [f, s, d, r]
803
919
  );
804
920
  return /* @__PURE__ */ i(
805
921
  "div",
@@ -807,209 +923,217 @@ const et = ({
807
923
  className: "accordion",
808
924
  role: "region",
809
925
  "aria-multiselectable": r,
810
- children: e.map((g) => {
811
- const m = p.has(g.id), k = `accordion-heading-${g.id}`, v = `accordion-panel-${g.id}`;
812
- return /* @__PURE__ */ N(
926
+ children: e.map((b) => {
927
+ const x = f.has(b.id), k = `accordion-heading-${b.id}`, $ = `accordion-panel-${b.id}`;
928
+ return /* @__PURE__ */ S(
813
929
  "div",
814
930
  {
815
931
  className: `accordion-item border rounded border-gray-300 dark:border-gray-700 ${n}`,
816
932
  children: [
817
- /* @__PURE__ */ N(
933
+ /* @__PURE__ */ S(
818
934
  "button",
819
935
  {
820
936
  id: k,
821
937
  type: "button",
822
- "aria-expanded": m,
823
- "aria-controls": v,
824
- onClick: () => b(g.id),
938
+ "aria-expanded": x,
939
+ "aria-controls": $,
940
+ onClick: () => g(b.id),
825
941
  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 ${t}`,
826
942
  children: [
827
- d ? d(g, m) : g.title,
828
- f ? /* @__PURE__ */ i(Ke, {}) : null
943
+ p ? p(b, x) : b.title,
944
+ c ? /* @__PURE__ */ i(He, {}) : null
829
945
  ]
830
946
  }
831
947
  ),
832
948
  /* @__PURE__ */ i(
833
949
  "div",
834
950
  {
835
- id: v,
951
+ id: $,
836
952
  role: "region",
837
953
  "aria-labelledby": k,
838
- hidden: !m,
839
- className: `p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 ${l}`,
840
- children: u ? u(g, m) : g.content
954
+ hidden: !x,
955
+ className: `p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 ${a}`,
956
+ children: u ? u(b, x) : b.content
841
957
  }
842
958
  )
843
959
  ]
844
960
  },
845
- g.id
961
+ b.id
846
962
  );
847
963
  })
848
964
  }
849
965
  );
850
- }, ie = se(null), ce = () => {
851
- const e = oe(ie);
966
+ }, de = ae(null), ue = () => {
967
+ const e = le(de);
852
968
  if (!e)
853
969
  throw new Error(
854
970
  "useModalActions must be used within a ModalActionProvider"
855
971
  );
856
972
  return e;
857
- }, de = se(null), ue = () => oe(de);
858
- function tt({
973
+ }, fe = ae(null), pe = () => le(fe);
974
+ function st({
859
975
  id: e,
860
976
  title: r,
861
977
  children: n,
862
978
  standalone: t = !1,
863
- showFloatingClose: o = !1,
864
- containerClasses: c = "",
865
- onClose: d,
866
- disableEscapeClose: u = !1,
867
- closeBtnStyle: f
979
+ showFloatingClose: s = !1,
980
+ containerClasses: d = "",
981
+ headerClasses: p = "",
982
+ bodyClasses: u = "",
983
+ onClose: c,
984
+ disableEscapeClose: a = !1,
985
+ closeBtnStyle: o
868
986
  }) {
869
- const l = ue(), s = ce(), a = !t && !!l && !!s, [p, b] = A(!1), g = a ? l.isOpen(e) : p, m = a ? l.getModalData(e) : null, k = z(() => {
870
- a ? s.closeModal(e) : b(!1), d == null || d();
871
- }, [a, s, e, d]);
872
- return _(() => {
873
- const v = document.activeElement, S = document.getElementById(e), L = [
987
+ const l = pe(), f = ue(), g = !t && !!l && !!f, [b, x] = D(!1), k = g ? l.isOpen(e) : b, $ = g ? l.getModalData(e) : null, N = z(() => {
988
+ g ? f.closeModal(e) : x(!1), c == null || c();
989
+ }, [g, f, e, c]);
990
+ return R(() => {
991
+ const w = document.activeElement, h = document.getElementById(e), y = [
874
992
  "a[href]",
875
993
  "button:not([disabled])",
876
994
  "textarea:not([disabled])",
877
995
  "input:not([disabled])",
878
996
  "select:not([disabled])",
879
997
  '[tabindex]:not([tabindex="-1"])'
880
- ], h = () => {
881
- if (!S) return [];
882
- const w = S.querySelectorAll(
883
- L.join(",")
998
+ ], v = () => {
999
+ if (!h) return [];
1000
+ const m = h.querySelectorAll(
1001
+ y.join(",")
884
1002
  );
885
- return Array.from(w).filter(($) => $.offsetParent !== null);
886
- }, y = (w) => {
887
- if (w.key === "Tab") {
888
- const $ = h();
889
- if ($.length === 0) return;
890
- const x = $[0], C = $[$.length - 1];
891
- w.shiftKey ? document.activeElement === x && (w.preventDefault(), C.focus()) : document.activeElement === C && (w.preventDefault(), x.focus());
1003
+ return Array.from(m).filter((C) => C.offsetParent !== null);
1004
+ }, I = (m) => {
1005
+ if (m.key === "Tab") {
1006
+ const C = v();
1007
+ if (C.length === 0) return;
1008
+ const O = C[0], M = C[C.length - 1];
1009
+ m.shiftKey ? document.activeElement === O && (m.preventDefault(), M.focus()) : document.activeElement === M && (m.preventDefault(), O.focus());
892
1010
  }
893
- }, O = (w) => {
894
- w.key === "Escape" && !u && k(), y(w);
1011
+ }, E = (m) => {
1012
+ m.key === "Escape" && !a && N(), I(m);
895
1013
  };
896
- return g && (document.body.style.overflow = "hidden", setTimeout(() => {
897
- const w = h();
898
- w.length && w[0].focus();
899
- }, 0), window.addEventListener("keydown", O)), () => {
900
- document.body.style.overflow = "", v && v.focus(), window.removeEventListener("keydown", O);
1014
+ return k && (document.body.style.overflow = "hidden", setTimeout(() => {
1015
+ const m = v();
1016
+ m.length && m[0].focus();
1017
+ }, 0), window.addEventListener("keydown", E)), () => {
1018
+ document.body.style.overflow = "", w && w.focus(), window.removeEventListener("keydown", E);
901
1019
  };
902
- }, [g, u, k, e]), g ? /* @__PURE__ */ i(
1020
+ }, [k, a, N, e]), k ? /* @__PURE__ */ i(
903
1021
  "div",
904
1022
  {
905
1023
  className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-[2px]",
906
1024
  id: e,
907
- children: /* @__PURE__ */ N(
1025
+ children: /* @__PURE__ */ S(
908
1026
  "div",
909
1027
  {
910
- className: `bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${c}`,
1028
+ className: `bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${d}`,
911
1029
  children: [
912
- /* @__PURE__ */ N("div", { className: "flex justify-between items-center relative", children: [
913
- r && /* @__PURE__ */ i("h2", { className: "text-lg font-semibold", children: r }),
914
- o && /* @__PURE__ */ i(
915
- "button",
916
- {
917
- onClick: k,
918
- className: `text-gray-500 hover:text-black absolute top-0 right-3 hover:bg-gray-200 rounded-full aspect-square w-8 ${f}`,
919
- "aria-label": "Close modal",
920
- children: "✕"
921
- }
922
- )
923
- ] }),
924
- /* @__PURE__ */ i("div", { children: typeof n == "function" ? n({ modalData: m }) : n })
1030
+ /* @__PURE__ */ S(
1031
+ "div",
1032
+ {
1033
+ className: `flex justify-between items-center relative ${p}`,
1034
+ children: [
1035
+ r && /* @__PURE__ */ i("h2", { className: "text-lg font-semibold", children: r }),
1036
+ s && /* @__PURE__ */ i(
1037
+ "button",
1038
+ {
1039
+ onClick: N,
1040
+ className: `text-gray-500 hover:text-black absolute top-0 right-3 hover:bg-gray-200 rounded-full aspect-square w-8 ${o}`,
1041
+ "aria-label": "Close modal",
1042
+ children: ""
1043
+ }
1044
+ )
1045
+ ]
1046
+ }
1047
+ ),
1048
+ /* @__PURE__ */ i("div", { className: u, children: typeof n == "function" ? n({ modalData: $ }) : n })
925
1049
  ]
926
1050
  }
927
1051
  )
928
1052
  }
929
1053
  ) : null;
930
1054
  }
931
- function nt({
1055
+ function ot({
932
1056
  children: e
933
1057
  }) {
934
- const [r, n] = A({}), [t, o] = A({}), c = z((a, p) => {
935
- n((b) => ({ ...b, [a]: !0 })), p && o((b) => ({ ...b, [a]: p }));
936
- }, []), d = z((a) => {
937
- n((p) => ({ ...p, [a]: !1 })), o((p) => {
938
- const b = { ...p };
939
- return delete b[a], b;
1058
+ const [r, n] = D({}), [t, s] = D({}), d = z((l, f) => {
1059
+ n((g) => ({ ...g, [l]: !0 })), f && s((g) => ({ ...g, [l]: f }));
1060
+ }, []), p = z((l) => {
1061
+ n((f) => ({ ...f, [l]: !1 })), s((f) => {
1062
+ const g = { ...f };
1063
+ return delete g[l], g;
940
1064
  });
941
- }, []), u = z((a) => !!r[a], [r]), f = z(
942
- (a) => t[a],
1065
+ }, []), u = z((l) => !!r[l], [r]), c = z(
1066
+ (l) => t[l],
943
1067
  [t]
944
- ), l = I(
945
- () => ({ openModal: c, closeModal: d }),
946
- [c, d]
947
- ), s = I(
948
- () => ({ isOpen: u, getModalData: f }),
949
- [u, f]
1068
+ ), a = j(
1069
+ () => ({ openModal: d, closeModal: p }),
1070
+ [d, p]
1071
+ ), o = j(
1072
+ () => ({ isOpen: u, getModalData: c }),
1073
+ [u, c]
950
1074
  );
951
- return /* @__PURE__ */ i(ie.Provider, { value: l, children: /* @__PURE__ */ i(de.Provider, { value: s, children: e }) });
1075
+ return /* @__PURE__ */ i(de.Provider, { value: a, children: /* @__PURE__ */ i(fe.Provider, { value: o, children: e }) });
952
1076
  }
953
- function rt(e) {
954
- const { openModal: r, closeModal: n } = ce(), { isOpen: t, getModalData: o } = ue();
1077
+ function at(e) {
1078
+ const { openModal: r, closeModal: n } = ue(), { isOpen: t, getModalData: s } = pe();
955
1079
  return {
956
- open: (c) => r(e, c),
1080
+ open: (d) => r(e, d),
957
1081
  close: () => n(e),
958
1082
  isOpen: t(e),
959
- data: o(e)
1083
+ data: s(e)
960
1084
  };
961
1085
  }
962
1086
  let Y = null, J = {};
963
- function Ze(e) {
1087
+ function We(e) {
964
1088
  Y = e;
965
1089
  }
966
- function st(e) {
1090
+ function lt(e) {
967
1091
  J = { ...J, ...e };
968
1092
  }
969
- function He() {
1093
+ function Ge() {
970
1094
  return J;
971
1095
  }
972
- function ot(e, r, n = 3e3, t) {
1096
+ function it(e, r, n = 3e3, t) {
973
1097
  Y ? Y(e, r, n, t) : console.warn("Toast system is not mounted");
974
1098
  }
975
- function We(e) {
1099
+ function qe(e) {
976
1100
  return Q({ 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);
977
1101
  }
978
- const Ge = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
1102
+ const Ue = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
979
1103
  const r = Math.random() * 16 | 0;
980
1104
  return (e === "x" ? r : r & 3 | 8).toString(16);
981
- }), at = () => {
982
- const [e, r] = A([]);
983
- _(() => {
984
- Ze((t, o, c, d) => {
985
- const u = Ge();
986
- r((f) => [...f, { id: u, type: t, message: o, config: d }]), setTimeout(() => {
987
- r((f) => f.filter((l) => l.id !== u));
988
- }, c);
1105
+ }), ct = () => {
1106
+ const [e, r] = D([]);
1107
+ R(() => {
1108
+ We((t, s, d, p) => {
1109
+ const u = Ue();
1110
+ r((c) => [...c, { id: u, type: t, message: s, config: p }]), setTimeout(() => {
1111
+ r((c) => c.filter((a) => a.id !== u));
1112
+ }, d);
989
1113
  });
990
1114
  }, []);
991
- const n = He();
1115
+ const n = Ge();
992
1116
  return /* @__PURE__ */ i("div", { className: "fixed top-5 right-5 z-[9999] flex flex-col gap-2", children: e.map((t) => {
993
- var f, l, s, a, p, b, g, m, k, v, S, L, h;
994
- const o = ((f = t.config) == null ? void 0 : f.icon) || ((l = n.icons) == null ? void 0 : l[t.type]) || Ue(t.type), c = ((s = t.config) == null ? void 0 : s.bgColor) || ((p = (a = n.colors) == null ? void 0 : a[t.type]) == null ? void 0 : p.bg) || "bg-white dark:bg-gray-800", d = ((b = t.config) == null ? void 0 : b.textColor) || ((m = (g = n.colors) == null ? void 0 : g[t.type]) == null ? void 0 : m.text) || "text-gray-700 dark:text-gray-300", u = ((k = t.config) == null ? void 0 : k.iconContainerClass) || "w-8 h-8 mr-3 text-xl flex items-center justify-center";
995
- return /* @__PURE__ */ N(
1117
+ var c, a, o, l, f, g, b, x, k, $, N, w, h;
1118
+ const s = ((c = t.config) == null ? void 0 : c.icon) || ((a = n.icons) == null ? void 0 : a[t.type]) || Xe(t.type), d = ((o = t.config) == null ? void 0 : o.bgColor) || ((f = (l = n.colors) == null ? void 0 : l[t.type]) == null ? void 0 : f.bg) || "bg-white dark:bg-gray-800", p = ((g = t.config) == null ? void 0 : g.textColor) || ((x = (b = n.colors) == null ? void 0 : b[t.type]) == null ? void 0 : x.text) || "text-gray-700 dark:text-gray-300", u = ((k = t.config) == null ? void 0 : k.iconContainerClass) || "w-8 h-8 mr-3 text-xl flex items-center justify-center";
1119
+ return /* @__PURE__ */ S(
996
1120
  "div",
997
1121
  {
998
- className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${c} ${d}`,
1122
+ className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${d} ${p}`,
999
1123
  children: [
1000
- /* @__PURE__ */ i("div", { className: u, children: o }),
1001
- /* @__PURE__ */ N("div", { className: "flex-1 me-3", children: [
1002
- ((v = t.config) == null ? void 0 : v.title) && /* @__PURE__ */ i("div", { className: "font-semibold text-black", children: t.config.title }),
1003
- ((S = t.config) == null ? void 0 : S.description) && /* @__PURE__ */ i("div", { className: "text-sm text-gray-500", children: t.config.description }),
1004
- !((L = t.config) != null && L.title) && !((h = t.config) != null && h.description) && /* @__PURE__ */ i("div", { className: "text-sm", children: t.message })
1124
+ /* @__PURE__ */ i("div", { className: u, children: s }),
1125
+ /* @__PURE__ */ S("div", { className: "flex-1 me-3", children: [
1126
+ (($ = t.config) == null ? void 0 : $.title) && /* @__PURE__ */ i("div", { className: "font-semibold text-black", children: t.config.title }),
1127
+ ((N = t.config) == null ? void 0 : N.description) && /* @__PURE__ */ i("div", { className: "text-sm text-gray-500", children: t.config.description }),
1128
+ !((w = t.config) != null && w.title) && !((h = t.config) != null && h.description) && /* @__PURE__ */ i("div", { className: "text-sm", children: t.message })
1005
1129
  ] }),
1006
1130
  /* @__PURE__ */ i(
1007
1131
  "button",
1008
1132
  {
1009
- onClick: () => r((y) => y.filter((O) => O.id !== t.id)),
1133
+ onClick: () => r((y) => y.filter((v) => v.id !== t.id)),
1010
1134
  className: "ml-auto text-gray-400 hover:text-gray-700 dark:text-gray-500 dark:hover:text-white",
1011
1135
  "aria-label": "Close",
1012
- children: /* @__PURE__ */ i(We, { size: 18 })
1136
+ children: /* @__PURE__ */ i(qe, { size: 18 })
1013
1137
  }
1014
1138
  )
1015
1139
  ]
@@ -1018,7 +1142,7 @@ const Ge = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, functio
1018
1142
  );
1019
1143
  }) });
1020
1144
  };
1021
- function Ue(e) {
1145
+ function Xe(e) {
1022
1146
  switch (e) {
1023
1147
  case "success":
1024
1148
  return "✅";
@@ -1031,20 +1155,21 @@ function Ue(e) {
1031
1155
  }
1032
1156
  }
1033
1157
  export {
1034
- et as Accordion,
1035
- Ve as Badge,
1036
- Ye as Button,
1037
- Re as Checkbox,
1038
- Je as Dropdown,
1039
- xe as Input,
1040
- tt as Modal,
1041
- nt as ModalProvider,
1042
- ke as Select,
1043
- at as Toast,
1044
- Qe as Tooltip,
1045
- st as setToastDefaults,
1046
- ot as showToast,
1047
- ce as useModalActions,
1048
- rt as useModalInstance,
1049
- ue as useModalState
1158
+ rt as Accordion,
1159
+ tt as Badge,
1160
+ Qe as Button,
1161
+ _e as Checkbox,
1162
+ Ve as Dropdown,
1163
+ ye as Input,
1164
+ st as Modal,
1165
+ ot as ModalProvider,
1166
+ Se as Select,
1167
+ ct as Toast,
1168
+ nt as Toggler,
1169
+ et as Tooltip,
1170
+ lt as setToastDefaults,
1171
+ it as showToast,
1172
+ ue as useModalActions,
1173
+ at as useModalInstance,
1174
+ pe as useModalState
1050
1175
  };