tailwind-ux-kit 1.0.74 → 1.0.76

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