tailwind-ux-kit 1.0.42 → 1.0.43

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.
@@ -5,7 +5,7 @@ type Status = "default" | "error" | "warning" | "success";
5
5
  type FloatingLabelStyle = "filled" | "outlined" | "standard";
6
6
  type IconPosition = "start" | "end" | "left" | "right";
7
7
  interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "size"> {
8
- label?: string;
8
+ label?: string | React.ReactNode;
9
9
  id?: string;
10
10
  inputSize?: InputSize;
11
11
  shape?: Shape;
@@ -1,132 +1,140 @@
1
1
  "use client";
2
- import { jsxs as h, jsx as g } from "react/jsx-runtime";
3
- import I, { forwardRef as J, useState as O, useRef as _, useMemo as R, useCallback as L, useEffect as D, createContext as Q, useContext as V } from "react";
4
- const le = J((e, n) => {
2
+ import { jsxs as h, jsx as f } from "react/jsx-runtime";
3
+ import O, { forwardRef as Q, useState as E, useMemo as $, useRef as _, useCallback as k, useEffect as z, createContext as V, useContext as ee } from "react";
4
+ const q = {
5
+ xs: "text-xs px-2 py-1",
6
+ sm: "text-sm px-3 py-1.5",
7
+ md: "text-sm px-3 py-3",
8
+ lg: "text-lg px-5 py-3"
9
+ }, X = {
10
+ flat: "rounded-none",
11
+ rounded: "rounded-sm",
12
+ pill: "rounded-full"
13
+ }, ce = {
14
+ filled: "rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",
15
+ outlined: "rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",
16
+ standard: "px-0 py-2.5 bg-transparent border-0 border-b-2"
17
+ }, de = {
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
+ 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
+ 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
+ }, ue = (e, n, t) => {
22
+ if (t)
23
+ return "border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:ring-red-500 focus:border-red-500";
24
+ if (n)
25
+ return "border-green-500 bg-green-50 text-green-900 placeholder-green-700 focus:ring-green-500 focus:border-green-500";
26
+ switch (e) {
27
+ case "error":
28
+ return "border-red-500 bg-red-50 focus:ring-red-500";
29
+ case "warning":
30
+ return "border-yellow-500 bg-yellow-50 focus:ring-yellow-500";
31
+ case "success":
32
+ return "border-green-500 bg-green-50 focus:ring-green-500";
33
+ default:
34
+ return "border-gray-300 focus:ring-blue-500";
35
+ }
36
+ }, ge = Q((e, n) => {
5
37
  const {
6
38
  label: t,
7
39
  id: r,
8
40
  inputSize: s = "md",
9
- shape: f = "rounded",
10
- validate: p,
11
- onValidatedChange: d,
41
+ shape: p = "rounded",
42
+ validate: g,
43
+ onValidatedChange: c,
12
44
  className: a = "",
13
45
  icon: u,
14
46
  iconPosition: o = "left",
15
- floatingLabelStyle: l,
16
- onChange: i,
17
- isValid: c,
47
+ floatingLabelStyle: d,
48
+ onChange: l,
49
+ isValid: i,
18
50
  isInvalid: x,
19
51
  feedback: m,
20
52
  feedbackType: y = "invalid",
21
53
  ...w
22
- } = e, [$, S] = O("default"), P = (C) => {
23
- const E = C.target.value, j = (p == null ? void 0 : p(E)) ?? "default";
24
- S(j), d == null || d(C, j), i == null || i(C);
25
- }, N = {
26
- xs: "text-xs px-2 py-1",
27
- sm: "text-sm px-3 py-1.5",
28
- md: "text-sm px-3 py-3",
29
- lg: "text-lg px-5 py-3"
30
- }, b = {
31
- flat: "rounded-none",
32
- rounded: "rounded-sm",
33
- pill: "rounded-full"
34
- }, v = {
35
- filled: "rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",
36
- outlined: "rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",
37
- standard: "px-0 py-2.5 bg-transparent border-0 border-b-2"
38
- }, A = {
39
- 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",
40
- 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",
41
- 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"
42
- }, z = (C, E, j) => {
43
- if (j)
44
- return "border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:ring-red-500 focus:border-red-500";
45
- if (E)
46
- return "border-green-500 bg-green-50 text-green-900 placeholder-green-700 focus:ring-green-500 focus:border-green-500";
47
- switch (C) {
48
- case "error":
49
- return "border-red-500 bg-red-50 focus:ring-red-500";
50
- case "warning":
51
- return "border-yellow-500 bg-yellow-50 focus:ring-yellow-500";
52
- case "success":
53
- return "border-green-500 bg-green-50 focus:ring-green-500";
54
- default:
55
- return "border-gray-300 focus:ring-blue-500";
56
- }
57
- }, Z = N[s] || N.md, G = b[f] || b.flat, H = z($, c, x), W = o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", K = u && (o === "start" || o === "left") ? "ps-10" : u ? "pe-10" : "", M = r ?? `input-${(t == null ? void 0 : t.toLowerCase().replace(/\s+/g, "-")) || Math.random().toString(36).slice(2)}`, k = !!l;
58
- return /* @__PURE__ */ h("div", { className: `w-full relative ${k ? "z-0" : ""}`, children: [
59
- !k && t && /* @__PURE__ */ g(
54
+ } = e, [S, N] = E("default"), L = O.useCallback(
55
+ (I) => {
56
+ const G = I.target.value, M = (g == null ? void 0 : g(G)) ?? "default";
57
+ N(M), c == null || c(I, M), l == null || l(I);
58
+ },
59
+ [g, c, l]
60
+ ), C = $(() => r || (typeof t == "string" ? `input-${t.toLowerCase().replace(/\s+/g, "-")}` : `input-${Math.random().toString(36).slice(2)}`), [r, t]), b = !!d, v = q[s] || q.md, P = X[p] || X.flat, j = $(
61
+ () => ue(S, i, x),
62
+ [S, i, x]
63
+ ), F = $(() => o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", [o]), Z = $(() => u ? o === "start" || o === "left" ? "ps-10" : "pe-10" : "", [u, o]);
64
+ return /* @__PURE__ */ h("div", { className: `w-full relative ${b ? "z-0" : ""}`, children: [
65
+ !b && t && /* @__PURE__ */ f(
60
66
  "label",
61
67
  {
62
- htmlFor: M,
63
- className: `block mb-1 text-sm ${c ? "text-green-700 dark:text-green-500" : x ? "text-red-700 dark:text-red-500" : "text-gray-700"}`,
68
+ htmlFor: C,
69
+ className: `block mb-1 text-sm ${i ? "text-green-700 dark:text-green-500" : x ? "text-red-700 dark:text-red-500" : "text-gray-700"}`,
64
70
  children: t
65
71
  }
66
72
  ),
67
73
  /* @__PURE__ */ h("div", { className: "relative w-full", children: [
68
- u && /* @__PURE__ */ g(
74
+ u && /* @__PURE__ */ f(
69
75
  "div",
70
76
  {
71
- className: `absolute inset-y-0 flex items-center ${W}`,
72
- children: /* @__PURE__ */ g("span", { className: "text-gray-500", children: u })
77
+ className: `absolute inset-y-0 flex items-center ${F}`,
78
+ "aria-hidden": "true",
79
+ children: /* @__PURE__ */ f("span", { className: "text-gray-500", children: u })
73
80
  }
74
81
  ),
75
- /* @__PURE__ */ g(
82
+ /* @__PURE__ */ f(
76
83
  "input",
77
84
  {
78
85
  ...w,
79
- id: M,
86
+ id: C,
80
87
  ref: n,
81
- placeholder: k ? " " : w.placeholder,
82
- onChange: P,
88
+ placeholder: b ? " " : w.placeholder,
89
+ onChange: L,
83
90
  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
84
- ${Z}
85
- ${k && l && v[l]}
86
- ${K} ${G} ${H} ${a}`
91
+ ${v}
92
+ ${b && d && ce[d]}
93
+ ${Z} ${P} ${j} ${a}`
87
94
  }
88
95
  ),
89
- k && t && l && /* @__PURE__ */ g(
96
+ b && t && d && /* @__PURE__ */ f(
90
97
  "label",
91
98
  {
92
- htmlFor: M,
93
- className: `ms-1 ${A[l]} ${a}`,
99
+ htmlFor: C,
100
+ className: `ms-1 ${de[d]} ${a}`,
94
101
  children: t
95
102
  }
96
103
  )
97
104
  ] }),
98
- m && /* @__PURE__ */ g(
105
+ m && /* @__PURE__ */ f(
99
106
  "p",
100
107
  {
101
108
  className: `mt-1 text-xs ${y === "invalid" ? "text-red-600 dark:text-red-500" : "text-green-600 dark:text-green-500"}`,
109
+ role: y === "invalid" ? "alert" : void 0,
102
110
  children: m
103
111
  }
104
112
  )
105
113
  ] });
106
114
  });
107
- le.displayName = "Input";
108
- const ie = J((e, n) => {
115
+ ge.displayName = "Input";
116
+ const fe = Q((e, n) => {
109
117
  const {
110
118
  label: t,
111
119
  id: r,
112
120
  inputSize: s = "md",
113
- shape: f = "rounded",
114
- validate: p,
115
- onValidatedChange: d,
121
+ shape: p = "rounded",
122
+ validate: g,
123
+ onValidatedChange: c,
116
124
  className: a = "",
117
125
  icon: u,
118
126
  iconPosition: o = "left",
119
- floatingLabelStyle: l,
120
- onChange: i,
121
- isValid: c,
127
+ floatingLabelStyle: d,
128
+ onChange: l,
129
+ isValid: i,
122
130
  isInvalid: x,
123
131
  feedback: m,
124
132
  feedbackType: y = "invalid",
125
133
  children: w,
126
- ...$
127
- } = e, [S, P] = O("default"), N = (E) => {
128
- const j = E.target.value, T = (p == null ? void 0 : p(j)) ?? "default";
129
- P(T), d == null || d(E, T), i == null || i(E);
134
+ ...S
135
+ } = e, [N, L] = E("default"), C = (A) => {
136
+ const W = A.target.value, T = (g == null ? void 0 : g(W)) ?? "default";
137
+ L(T), c == null || c(A, T), l == null || l(A);
130
138
  }, b = {
131
139
  xs: "text-xs px-2 py-1",
132
140
  sm: "text-sm px-3 py-1.5",
@@ -136,20 +144,20 @@ const ie = J((e, n) => {
136
144
  flat: "rounded-none",
137
145
  rounded: "rounded-sm",
138
146
  pill: "rounded-full"
139
- }, A = {
147
+ }, P = {
140
148
  filled: "rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",
141
149
  outlined: "rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",
142
150
  standard: "px-0 py-2.5 bg-transparent border-0 border-b-2"
143
- }, z = {
151
+ }, j = {
144
152
  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",
145
153
  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",
146
154
  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"
147
- }, Z = (E, j, T) => {
155
+ }, F = (A, W, T) => {
148
156
  if (T)
149
157
  return "border-red-500 bg-red-50 text-red-900 focus:ring-red-500 focus:border-red-500";
150
- if (j)
158
+ if (W)
151
159
  return "border-green-500 bg-green-50 text-green-900 focus:ring-green-500 focus:border-green-500";
152
- switch (E) {
160
+ switch (A) {
153
161
  case "error":
154
162
  return "border-red-500 bg-red-50 focus:ring-red-500";
155
163
  case "warning":
@@ -159,48 +167,48 @@ const ie = J((e, n) => {
159
167
  default:
160
168
  return "border-gray-300 focus:ring-blue-500";
161
169
  }
162
- }, G = b[s] || b.md, H = v[f] || v.flat, W = Z(S, c, x), K = o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", M = u && (o === "start" || o === "left") ? "ps-10" : u ? "pe-10" : "", k = r ?? `select-${(t == null ? void 0 : t.toLowerCase().replace(/\s+/g, "-")) || Math.random().toString(36).slice(2)}`, C = !!l;
163
- return /* @__PURE__ */ h("div", { className: `w-full relative ${C ? "z-0" : ""}`, children: [
164
- !C && t && /* @__PURE__ */ g(
170
+ }, Z = b[s] || b.md, I = v[p] || v.flat, G = F(N, i, x), M = o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", ie = u && (o === "start" || o === "left") ? "ps-10" : u ? "pe-10" : "", H = r ?? `select-${(t == null ? void 0 : t.toLowerCase().replace(/\s+/g, "-")) || Math.random().toString(36).slice(2)}`, D = !!d;
171
+ return /* @__PURE__ */ h("div", { className: `w-full relative ${D ? "z-0" : ""}`, children: [
172
+ !D && t && /* @__PURE__ */ f(
165
173
  "label",
166
174
  {
167
- htmlFor: k,
168
- className: `block mb-1 text-sm ${c ? "text-green-700" : x ? "text-red-700" : "text-gray-700"}`,
175
+ htmlFor: H,
176
+ className: `block mb-1 text-sm ${i ? "text-green-700" : x ? "text-red-700" : "text-gray-700"}`,
169
177
  children: t
170
178
  }
171
179
  ),
172
180
  /* @__PURE__ */ h("div", { className: "relative w-full", children: [
173
- u && /* @__PURE__ */ g(
181
+ u && /* @__PURE__ */ f(
174
182
  "div",
175
183
  {
176
- className: `absolute inset-y-0 flex items-center ${K}`,
177
- children: /* @__PURE__ */ g("span", { className: "text-gray-500", children: u })
184
+ className: `absolute inset-y-0 flex items-center ${M}`,
185
+ children: /* @__PURE__ */ f("span", { className: "text-gray-500", children: u })
178
186
  }
179
187
  ),
180
- /* @__PURE__ */ g(
188
+ /* @__PURE__ */ f(
181
189
  "select",
182
190
  {
183
- ...$,
184
- id: k,
191
+ ...S,
192
+ id: H,
185
193
  ref: n,
186
- onChange: N,
194
+ onChange: C,
187
195
  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
188
- ${G}
189
- ${C && l && A[l]}
190
- ${M} ${H} ${W} ${a}`,
196
+ ${Z}
197
+ ${D && d && P[d]}
198
+ ${ie} ${I} ${G} ${a}`,
191
199
  children: w
192
200
  }
193
201
  ),
194
- C && t && l && /* @__PURE__ */ g(
202
+ D && t && d && /* @__PURE__ */ f(
195
203
  "label",
196
204
  {
197
- htmlFor: k,
198
- className: `ms-1 ${z[l]} ${a}`,
205
+ htmlFor: H,
206
+ className: `ms-1 ${j[d]} ${a}`,
199
207
  children: t
200
208
  }
201
209
  )
202
210
  ] }),
203
- m && /* @__PURE__ */ g(
211
+ m && /* @__PURE__ */ f(
204
212
  "p",
205
213
  {
206
214
  className: `mt-1 text-xs ${y === "invalid" ? "text-red-600" : "text-green-600"}`,
@@ -209,8 +217,8 @@ const ie = J((e, n) => {
209
217
  )
210
218
  ] });
211
219
  });
212
- ie.displayName = "Select";
213
- const ce = {
220
+ fe.displayName = "Select";
221
+ const pe = {
214
222
  primary: "bg-blue-600 text-white hover:bg-blue-700",
215
223
  secondary: "bg-gray-600 text-white hover:bg-gray-700",
216
224
  success: "bg-green-600 text-white hover:bg-green-700",
@@ -228,39 +236,39 @@ const ce = {
228
236
  "outline-info": "border border-cyan-600 text-cyan-600 hover:bg-cyan-50",
229
237
  "outline-dark": "border border-gray-900 text-gray-900 hover:bg-gray-100",
230
238
  "outline-light": "border border-gray-100 text-gray-500 hover:bg-gray-200"
231
- }, de = {
239
+ }, be = {
232
240
  xs: "px-3 py-2 text-xs",
233
241
  sm: "px-3 py-2 text-sm",
234
242
  md: "px-5 py-2.5 text-sm",
235
243
  lg: "px-5 py-3 text-base",
236
244
  xl: "px-6 py-3.5 text-base"
237
- }, ue = {
245
+ }, xe = {
238
246
  flat: "shadow-none",
239
247
  rounded: "rounded-sm",
240
248
  pill: "rounded-full",
241
249
  circle: "rounded-full w-10 h-10 p-0 flex items-center justify-center"
242
- }, Pe = ({
250
+ }, Me = ({
243
251
  children: e,
244
252
  variant: n = "primary",
245
253
  size: t = "md",
246
254
  type: r = "button",
247
255
  shape: s = "rounded",
248
- className: f = "",
249
- isLoading: p = !1,
250
- disabled: d = !1,
256
+ className: p = "",
257
+ isLoading: g = !1,
258
+ disabled: c = !1,
251
259
  ...a
252
260
  }) => {
253
- const u = d || p, o = [
261
+ const u = c || g, o = [
254
262
  "inline-flex items-center justify-center font-normal transition duration-150 cursor-pointer",
255
- ce[n],
256
- de[t],
257
- ue[s],
263
+ pe[n],
264
+ be[t],
265
+ xe[s],
258
266
  s === "flat" ? "shadow-none" : "shadow-sm",
259
267
  u ? "opacity-50 cursor-not-allowed pointer-events-none" : "",
260
- f
268
+ p
261
269
  ].filter(Boolean).join(" ");
262
270
  return /* @__PURE__ */ h("button", { type: r, className: o, disabled: u, ...a, children: [
263
- p && /* @__PURE__ */ h(
271
+ g && /* @__PURE__ */ h(
264
272
  "svg",
265
273
  {
266
274
  "aria-hidden": "true",
@@ -270,14 +278,14 @@ const ce = {
270
278
  fill: "none",
271
279
  xmlns: "http://www.w3.org/2000/svg",
272
280
  children: [
273
- /* @__PURE__ */ g(
281
+ /* @__PURE__ */ f(
274
282
  "path",
275
283
  {
276
284
  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",
277
285
  fill: "currentColor"
278
286
  }
279
287
  ),
280
- /* @__PURE__ */ g(
288
+ /* @__PURE__ */ f(
281
289
  "path",
282
290
  {
283
291
  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",
@@ -289,12 +297,12 @@ const ce = {
289
297
  ),
290
298
  e
291
299
  ] });
292
- }, je = ({
300
+ }, De = ({
293
301
  label: e,
294
302
  children: n,
295
303
  position: t = "right"
296
304
  }) => {
297
- const [r, s] = O(!1), [f, p] = O(!1), d = _(null), a = _(null), u = R(() => {
305
+ const [r, s] = E(!1), [p, g] = E(!1), c = _(null), a = _(null), u = $(() => {
298
306
  switch (t) {
299
307
  case "left":
300
308
  return "left-0";
@@ -304,55 +312,55 @@ const ce = {
304
312
  default:
305
313
  return "right-0";
306
314
  }
307
- }, [t]), o = L((c) => {
308
- const x = c.target;
309
- d.current && !d.current.contains(x) && a.current && !a.current.contains(x) && s(!1);
310
- }, []), l = L(() => {
311
- if (!a.current || !d.current) return;
312
- const c = a.current.getBoundingClientRect(), x = d.current.getBoundingClientRect(), m = window.innerHeight - c.bottom, y = c.top;
313
- p(
315
+ }, [t]), o = k((i) => {
316
+ const x = i.target;
317
+ c.current && !c.current.contains(x) && a.current && !a.current.contains(x) && s(!1);
318
+ }, []), d = k(() => {
319
+ if (!a.current || !c.current) return;
320
+ const i = a.current.getBoundingClientRect(), x = c.current.getBoundingClientRect(), m = window.innerHeight - i.bottom, y = i.top;
321
+ g(
314
322
  m < x.height && y > x.height
315
323
  );
316
324
  }, []);
317
- D(() => {
325
+ z(() => {
318
326
  if (r)
319
- return l(), window.addEventListener("resize", l), window.addEventListener("scroll", l, !0), () => {
320
- window.removeEventListener("resize", l), window.removeEventListener("scroll", l, !0);
327
+ return d(), window.addEventListener("resize", d), window.addEventListener("scroll", d, !0), () => {
328
+ window.removeEventListener("resize", d), window.removeEventListener("scroll", d, !0);
321
329
  };
322
- }, [r, l]), D(() => (document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o)), [o]);
323
- const i = L(() => s((c) => !c), []);
330
+ }, [r, d]), z(() => (document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o)), [o]);
331
+ const l = k(() => s((i) => !i), []);
324
332
  return /* @__PURE__ */ h("div", { className: "relative flex items-center", children: [
325
- /* @__PURE__ */ g("button", { ref: a, onClick: i, children: e }),
326
- r && /* @__PURE__ */ g(
333
+ /* @__PURE__ */ f("button", { ref: a, onClick: l, children: e }),
334
+ r && /* @__PURE__ */ f(
327
335
  "div",
328
336
  {
329
- ref: d,
337
+ ref: c,
330
338
  className: `absolute z-10 bg-white rounded-sm shadow-md overflow-hidden
331
- ${f ? "bottom-full mb-2" : "top-full mt-2"}
339
+ ${p ? "bottom-full mb-2" : "top-full mt-2"}
332
340
  ${u}`,
333
341
  children: n
334
342
  }
335
343
  )
336
344
  ] });
337
- }, Ie = ({
345
+ }, Te = ({
338
346
  children: e,
339
347
  content: n,
340
348
  position: t = "top",
341
349
  className: r = "",
342
350
  tooltipClass: s = "",
343
- tooltipStyle: f = {}
351
+ tooltipStyle: p = {}
344
352
  }) => {
345
- const p = _(null), d = _(null);
346
- D(() => {
347
- const u = p.current, o = d.current;
353
+ const g = _(null), c = _(null);
354
+ z(() => {
355
+ const u = g.current, o = c.current;
348
356
  if (!u || !o) return;
349
- const l = () => {
357
+ const d = () => {
350
358
  o.style.opacity = "1", o.style.visibility = "visible";
351
- }, i = () => {
359
+ }, l = () => {
352
360
  o.style.opacity = "0", o.style.visibility = "hidden";
353
361
  };
354
- return u.addEventListener("mouseenter", l), u.addEventListener("mouseleave", i), () => {
355
- u.removeEventListener("mouseenter", l), u.removeEventListener("mouseleave", i);
362
+ return u.addEventListener("mouseenter", d), u.addEventListener("mouseleave", l), () => {
363
+ u.removeEventListener("mouseenter", d), u.removeEventListener("mouseleave", l);
356
364
  };
357
365
  }, []);
358
366
  const a = (u) => {
@@ -410,23 +418,23 @@ const ce = {
410
418
  return o;
411
419
  }
412
420
  };
413
- return /* @__PURE__ */ h("div", { ref: p, className: `relative inline-block ${r}`, children: [
421
+ return /* @__PURE__ */ h("div", { ref: g, className: `relative inline-block ${r}`, children: [
414
422
  e,
415
- /* @__PURE__ */ g(
423
+ /* @__PURE__ */ f(
416
424
  "div",
417
425
  {
418
- ref: d,
426
+ ref: c,
419
427
  role: "tooltip",
420
428
  className: s,
421
429
  style: {
422
430
  ...a(t),
423
- ...f
431
+ ...p
424
432
  },
425
433
  children: n
426
434
  }
427
435
  )
428
436
  ] });
429
- }, ge = {
437
+ }, me = {
430
438
  primary: "bg-blue-500 text-white",
431
439
  secondary: "bg-gray-500 text-white",
432
440
  success: "bg-green-500 text-white",
@@ -444,61 +452,61 @@ const ce = {
444
452
  "outline-info": "border border-cyan-500 text-cyan-500 bg-transparent",
445
453
  "outline-dark": "border border-black text-black bg-transparent",
446
454
  "outline-light": "border border-gray-100 text-gray-800 bg-transparent"
447
- }, pe = {
455
+ }, he = {
448
456
  xs: "text-xs px-2 py-0.5",
449
457
  sm: "text-sm px-2.5 py-0.5",
450
458
  md: "text-base px-3 py-1",
451
459
  lg: "text-lg px-3.5 py-1.5",
452
460
  xl: "text-xl px-4 py-2"
453
- }, fe = {
461
+ }, ye = {
454
462
  flat: "rounded-none",
455
463
  rounded: "rounded-sm",
456
464
  pill: "rounded-full",
457
465
  circle: "rounded-full p-2 w-8 h-8 justify-center"
458
- }, Ae = ({
466
+ }, _e = ({
459
467
  label: e,
460
468
  variant: n = "primary",
461
469
  size: t = "sm",
462
470
  shape: r = "rounded",
463
471
  icon: s,
464
- dismissible: f,
465
- onDismiss: p,
466
- className: d = "",
472
+ dismissible: p,
473
+ onDismiss: g,
474
+ className: c = "",
467
475
  ...a
468
476
  }) => {
469
- const u = !e && !!s, o = `inline-flex items-center font-medium ${ge[n] || ""} ${pe[t] || ""} ${fe[r] || ""} ${u ? "justify-center p-2 w-8 h-8" : ""} ` + d;
477
+ const u = !e && !!s, o = `inline-flex items-center font-medium ${me[n] || ""} ${he[t] || ""} ${ye[r] || ""} ${u ? "justify-center p-2 w-8 h-8" : ""} ` + c;
470
478
  return /* @__PURE__ */ h("span", { className: o.trim(), ...a, children: [
471
- s && /* @__PURE__ */ g("span", { className: e ? "mr-1" : "", children: s }),
479
+ s && /* @__PURE__ */ f("span", { className: e ? "mr-1" : "", children: s }),
472
480
  e,
473
- f && /* @__PURE__ */ g(
481
+ p && /* @__PURE__ */ f(
474
482
  "button",
475
483
  {
476
484
  type: "button",
477
- onClick: p,
485
+ onClick: g,
478
486
  className: "ml-2 text-xs font-bold leading-none focus:outline-none",
479
487
  children: "×"
480
488
  }
481
489
  )
482
490
  ] });
483
491
  };
484
- var ee = {
492
+ var te = {
485
493
  color: void 0,
486
494
  size: void 0,
487
495
  className: void 0,
488
496
  style: void 0,
489
497
  attr: void 0
490
- }, X = I.createContext && /* @__PURE__ */ I.createContext(ee), be = ["attr", "size", "title"];
491
- function xe(e, n) {
498
+ }, Y = O.createContext && /* @__PURE__ */ O.createContext(te), we = ["attr", "size", "title"];
499
+ function ve(e, n) {
492
500
  if (e == null) return {};
493
- var t = me(e, n), r, s;
501
+ var t = Ce(e, n), r, s;
494
502
  if (Object.getOwnPropertySymbols) {
495
- var f = Object.getOwnPropertySymbols(e);
496
- for (s = 0; s < f.length; s++)
497
- r = f[s], !(n.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (t[r] = e[r]);
503
+ var p = Object.getOwnPropertySymbols(e);
504
+ for (s = 0; s < p.length; s++)
505
+ r = p[s], !(n.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (t[r] = e[r]);
498
506
  }
499
507
  return t;
500
508
  }
501
- function me(e, n) {
509
+ function Ce(e, n) {
502
510
  if (e == null) return {};
503
511
  var t = {};
504
512
  for (var r in e)
@@ -508,17 +516,17 @@ function me(e, n) {
508
516
  }
509
517
  return t;
510
518
  }
511
- function B() {
512
- return B = Object.assign ? Object.assign.bind() : function(e) {
519
+ function R() {
520
+ return R = Object.assign ? Object.assign.bind() : function(e) {
513
521
  for (var n = 1; n < arguments.length; n++) {
514
522
  var t = arguments[n];
515
523
  for (var r in t)
516
524
  Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
517
525
  }
518
526
  return e;
519
- }, B.apply(this, arguments);
527
+ }, R.apply(this, arguments);
520
528
  }
521
- function Y(e, n) {
529
+ function J(e, n) {
522
530
  var t = Object.keys(e);
523
531
  if (Object.getOwnPropertySymbols) {
524
532
  var r = Object.getOwnPropertySymbols(e);
@@ -528,25 +536,25 @@ function Y(e, n) {
528
536
  }
529
537
  return t;
530
538
  }
531
- function F(e) {
539
+ function B(e) {
532
540
  for (var n = 1; n < arguments.length; n++) {
533
541
  var t = arguments[n] != null ? arguments[n] : {};
534
- n % 2 ? Y(Object(t), !0).forEach(function(r) {
535
- he(e, r, t[r]);
536
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Y(Object(t)).forEach(function(r) {
542
+ n % 2 ? J(Object(t), !0).forEach(function(r) {
543
+ Se(e, r, t[r]);
544
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : J(Object(t)).forEach(function(r) {
537
545
  Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
538
546
  });
539
547
  }
540
548
  return e;
541
549
  }
542
- function he(e, n, t) {
543
- return n = ye(n), n in e ? Object.defineProperty(e, n, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[n] = t, e;
550
+ function Se(e, n, t) {
551
+ return n = Ne(n), n in e ? Object.defineProperty(e, n, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[n] = t, e;
544
552
  }
545
- function ye(e) {
546
- var n = we(e, "string");
553
+ function Ne(e) {
554
+ var n = ke(e, "string");
547
555
  return typeof n == "symbol" ? n : n + "";
548
556
  }
549
- function we(e, n) {
557
+ function ke(e, n) {
550
558
  if (typeof e != "object" || !e) return e;
551
559
  var t = e[Symbol.toPrimitive];
552
560
  if (t !== void 0) {
@@ -556,67 +564,67 @@ function we(e, n) {
556
564
  }
557
565
  return (n === "string" ? String : Number)(e);
558
566
  }
559
- function te(e) {
560
- return e && e.map((n, t) => /* @__PURE__ */ I.createElement(n.tag, F({
567
+ function re(e) {
568
+ return e && e.map((n, t) => /* @__PURE__ */ O.createElement(n.tag, B({
561
569
  key: t
562
- }, n.attr), te(n.child)));
570
+ }, n.attr), re(n.child)));
563
571
  }
564
- function re(e) {
565
- return (n) => /* @__PURE__ */ I.createElement(ve, B({
566
- attr: F({}, e.attr)
567
- }, n), te(e.child));
572
+ function ne(e) {
573
+ return (n) => /* @__PURE__ */ O.createElement(Ee, R({
574
+ attr: B({}, e.attr)
575
+ }, n), re(e.child));
568
576
  }
569
- function ve(e) {
577
+ function Ee(e) {
570
578
  var n = (t) => {
571
579
  var {
572
580
  attr: r,
573
581
  size: s,
574
- title: f
575
- } = e, p = xe(e, be), d = s || t.size || "1em", a;
576
- return t.className && (a = t.className), e.className && (a = (a ? a + " " : "") + e.className), /* @__PURE__ */ I.createElement("svg", B({
582
+ title: p
583
+ } = e, g = ve(e, we), c = s || t.size || "1em", a;
584
+ return t.className && (a = t.className), e.className && (a = (a ? a + " " : "") + e.className), /* @__PURE__ */ O.createElement("svg", R({
577
585
  stroke: "currentColor",
578
586
  fill: "currentColor",
579
587
  strokeWidth: "0"
580
- }, t.attr, r, p, {
588
+ }, t.attr, r, g, {
581
589
  className: a,
582
- style: F(F({
590
+ style: B(B({
583
591
  color: e.color || t.color
584
592
  }, t.style), e.style),
585
- height: d,
586
- width: d,
593
+ height: c,
594
+ width: c,
587
595
  xmlns: "http://www.w3.org/2000/svg"
588
- }), f && /* @__PURE__ */ I.createElement("title", null, f), e.children);
596
+ }), p && /* @__PURE__ */ O.createElement("title", null, p), e.children);
589
597
  };
590
- return X !== void 0 ? /* @__PURE__ */ I.createElement(X.Consumer, null, (t) => n(t)) : n(ee);
598
+ return Y !== void 0 ? /* @__PURE__ */ O.createElement(Y.Consumer, null, (t) => n(t)) : n(te);
591
599
  }
592
- function Ce(e) {
593
- return re({ 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);
600
+ function Le(e) {
601
+ return ne({ 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);
594
602
  }
595
- const ze = ({
603
+ const Re = ({
596
604
  items: e,
597
605
  allowMultipleOpen: n = !1,
598
606
  className: t = "",
599
607
  tileClasses: r = "",
600
608
  open: s,
601
- onChange: f,
602
- renderTitle: p,
603
- renderContent: d
609
+ onChange: p,
610
+ renderTitle: g,
611
+ renderContent: c
604
612
  }) => {
605
- const [a, u] = O(/* @__PURE__ */ new Set()), o = R(() => s ? new Set(s) : a, [s, a]), l = L(
606
- (i) => {
607
- const c = new Set(o);
608
- c.has(i) ? c.delete(i) : (n || c.clear(), c.add(i)), s && f ? f(Array.from(c)) : u(c);
613
+ const [a, u] = E(/* @__PURE__ */ new Set()), o = $(() => s ? new Set(s) : a, [s, a]), d = k(
614
+ (l) => {
615
+ const i = new Set(o);
616
+ i.has(l) ? i.delete(l) : (n || i.clear(), i.add(l)), s && p ? p(Array.from(i)) : u(i);
609
617
  },
610
- [o, s, f, n]
618
+ [o, s, p, n]
611
619
  );
612
- return /* @__PURE__ */ g(
620
+ return /* @__PURE__ */ f(
613
621
  "div",
614
622
  {
615
623
  className: "accordion",
616
624
  role: "region",
617
625
  "aria-multiselectable": n,
618
- children: e.map((i) => {
619
- const c = o.has(i.id), x = `accordion-heading-${i.id}`, m = `accordion-panel-${i.id}`;
626
+ children: e.map((l) => {
627
+ const i = o.has(l.id), x = `accordion-heading-${l.id}`, m = `accordion-panel-${l.id}`;
620
628
  return /* @__PURE__ */ h(
621
629
  "div",
622
630
  {
@@ -627,90 +635,90 @@ const ze = ({
627
635
  {
628
636
  id: x,
629
637
  type: "button",
630
- "aria-expanded": c,
638
+ "aria-expanded": i,
631
639
  "aria-controls": m,
632
- onClick: () => l(i.id),
640
+ onClick: () => d(l.id),
633
641
  className: `flex justify-between items-center w-full p-1.5 text-left text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none gap-3 ${r}`,
634
642
  children: [
635
- p ? p(i, c) : i.title,
636
- /* @__PURE__ */ g(Ce, {})
643
+ g ? g(l, i) : l.title,
644
+ /* @__PURE__ */ f(Le, {})
637
645
  ]
638
646
  }
639
647
  ),
640
- /* @__PURE__ */ g(
648
+ /* @__PURE__ */ f(
641
649
  "div",
642
650
  {
643
651
  id: m,
644
652
  role: "region",
645
653
  "aria-labelledby": x,
646
- hidden: !c,
654
+ hidden: !i,
647
655
  className: "p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400",
648
- children: d ? d(i, c) : i.content
656
+ children: c ? c(l, i) : l.content
649
657
  }
650
658
  )
651
659
  ]
652
660
  },
653
- i.id
661
+ l.id
654
662
  );
655
663
  })
656
664
  }
657
665
  );
658
- }, ne = Q(null), oe = () => {
659
- const e = V(ne);
666
+ }, oe = V(null), se = () => {
667
+ const e = ee(oe);
660
668
  if (!e)
661
669
  throw new Error(
662
670
  "useModalActions must be used within a ModalActionProvider"
663
671
  );
664
672
  return e;
665
- }, se = Q(null), ae = () => V(se);
666
- function Me({
673
+ }, ae = V(null), le = () => ee(ae);
674
+ function Be({
667
675
  id: e,
668
676
  title: n,
669
677
  children: t,
670
678
  standalone: r = !1,
671
679
  showFloatingClose: s = !1,
672
- containerClasses: f = "",
673
- onClose: p,
674
- disableEscapeClose: d = !1
680
+ containerClasses: p = "",
681
+ onClose: g,
682
+ disableEscapeClose: c = !1
675
683
  }) {
676
- const a = ae(), u = oe(), o = !r && !!a && !!u, [l, i] = O(!1), c = o ? a.isOpen(e) : l, x = o ? a.getModalData(e) : null, m = L(() => {
677
- o ? u.closeModal(e) : i(!1), p == null || p();
678
- }, [o, u, e, p]);
679
- return D(() => {
684
+ const a = le(), u = se(), o = !r && !!a && !!u, [d, l] = E(!1), i = o ? a.isOpen(e) : d, x = o ? a.getModalData(e) : null, m = k(() => {
685
+ o ? u.closeModal(e) : l(!1), g == null || g();
686
+ }, [o, u, e, g]);
687
+ return z(() => {
680
688
  const y = document.activeElement;
681
689
  console.log(e);
682
690
  const w = document.getElementById(e);
683
691
  console.log("modalEl=", w);
684
- const $ = [
692
+ const S = [
685
693
  "a[href]",
686
694
  "button:not([disabled])",
687
695
  "textarea:not([disabled])",
688
696
  "input:not([disabled])",
689
697
  "select:not([disabled])",
690
698
  '[tabindex]:not([tabindex="-1"])'
691
- ], S = () => {
699
+ ], N = () => {
692
700
  if (!w) return [];
693
701
  const b = w.querySelectorAll(
694
- $.join(",")
702
+ S.join(",")
695
703
  );
696
704
  return Array.from(b).filter((v) => v.offsetParent !== null);
697
- }, P = (b) => {
705
+ }, L = (b) => {
698
706
  if (b.key === "Tab") {
699
- const v = S();
707
+ const v = N();
700
708
  if (v.length === 0) return;
701
- const A = v[0], z = v[v.length - 1];
702
- b.shiftKey ? document.activeElement === A && (b.preventDefault(), z.focus()) : document.activeElement === z && (b.preventDefault(), A.focus());
709
+ const P = v[0], j = v[v.length - 1];
710
+ b.shiftKey ? document.activeElement === P && (b.preventDefault(), j.focus()) : document.activeElement === j && (b.preventDefault(), P.focus());
703
711
  }
704
- }, N = (b) => {
705
- b.key === "Escape" && !d && m(), P(b);
712
+ }, C = (b) => {
713
+ b.key === "Escape" && !c && m(), L(b);
706
714
  };
707
- return c && (document.body.style.overflow = "hidden", setTimeout(() => {
708
- const b = S();
715
+ return i && (document.body.style.overflow = "hidden", setTimeout(() => {
716
+ const b = N();
709
717
  b.length && b[0].focus();
710
- }, 0), window.addEventListener("keydown", N)), () => {
711
- document.body.style.overflow = "", y && y.focus(), window.removeEventListener("keydown", N);
718
+ }, 0), window.addEventListener("keydown", C)), () => {
719
+ document.body.style.overflow = "", y && y.focus(), window.removeEventListener("keydown", C);
712
720
  };
713
- }, [c, d, m, e]), c ? /* @__PURE__ */ g(
721
+ }, [i, c, m, e]), i ? /* @__PURE__ */ f(
714
722
  "div",
715
723
  {
716
724
  className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-[2px]",
@@ -718,11 +726,11 @@ function Me({
718
726
  children: /* @__PURE__ */ h(
719
727
  "div",
720
728
  {
721
- className: `bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${f}`,
729
+ className: `bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${p}`,
722
730
  children: [
723
731
  /* @__PURE__ */ h("div", { className: "flex justify-between items-center relative", children: [
724
- n && /* @__PURE__ */ g("h2", { className: "text-lg font-semibold", children: n }),
725
- s && /* @__PURE__ */ g(
732
+ n && /* @__PURE__ */ f("h2", { className: "text-lg font-semibold", children: n }),
733
+ s && /* @__PURE__ */ f(
726
734
  "button",
727
735
  {
728
736
  onClick: m,
@@ -732,95 +740,95 @@ function Me({
732
740
  }
733
741
  )
734
742
  ] }),
735
- /* @__PURE__ */ g("div", { className: "mt-3 text-sm text-gray-700", children: typeof t == "function" ? t({ modalData: x }) : t })
743
+ /* @__PURE__ */ f("div", { className: "mt-3 text-sm text-gray-700", children: typeof t == "function" ? t({ modalData: x }) : t })
736
744
  ]
737
745
  }
738
746
  )
739
747
  }
740
748
  ) : null;
741
749
  }
742
- function De({
750
+ function Fe({
743
751
  children: e
744
752
  }) {
745
- const [n, t] = O({}), [r, s] = O({}), f = L((l, i) => {
746
- t((c) => ({ ...c, [l]: !0 })), i && s((c) => ({ ...c, [l]: i }));
747
- }, []), p = L((l) => {
748
- t((i) => ({ ...i, [l]: !1 })), s((i) => {
749
- const c = { ...i };
750
- return delete c[l], c;
753
+ const [n, t] = E({}), [r, s] = E({}), p = k((d, l) => {
754
+ t((i) => ({ ...i, [d]: !0 })), l && s((i) => ({ ...i, [d]: l }));
755
+ }, []), g = k((d) => {
756
+ t((l) => ({ ...l, [d]: !1 })), s((l) => {
757
+ const i = { ...l };
758
+ return delete i[d], i;
751
759
  });
752
- }, []), d = L((l) => !!n[l], [n]), a = L(
753
- (l) => r[l],
760
+ }, []), c = k((d) => !!n[d], [n]), a = k(
761
+ (d) => r[d],
754
762
  [r]
755
- ), u = R(
756
- () => ({ openModal: f, closeModal: p }),
757
- [f, p]
758
- ), o = R(
759
- () => ({ isOpen: d, getModalData: a }),
760
- [d, a]
763
+ ), u = $(
764
+ () => ({ openModal: p, closeModal: g }),
765
+ [p, g]
766
+ ), o = $(
767
+ () => ({ isOpen: c, getModalData: a }),
768
+ [c, a]
761
769
  );
762
- return /* @__PURE__ */ g(ne.Provider, { value: u, children: /* @__PURE__ */ g(se.Provider, { value: o, children: e }) });
770
+ return /* @__PURE__ */ f(oe.Provider, { value: u, children: /* @__PURE__ */ f(ae.Provider, { value: o, children: e }) });
763
771
  }
764
- function Te(e) {
765
- const { openModal: n, closeModal: t } = oe(), { isOpen: r, getModalData: s } = ae();
772
+ function Ze(e) {
773
+ const { openModal: n, closeModal: t } = se(), { isOpen: r, getModalData: s } = le();
766
774
  return {
767
- open: (f) => n(e, f),
775
+ open: (p) => n(e, p),
768
776
  close: () => t(e),
769
777
  isOpen: r(e),
770
778
  data: s(e)
771
779
  };
772
780
  }
773
- let U = null, q = {};
774
- function Se(e) {
775
- U = e;
781
+ let K = null, U = {};
782
+ function $e(e) {
783
+ K = e;
776
784
  }
777
- function _e(e) {
778
- q = { ...q, ...e };
785
+ function Ge(e) {
786
+ U = { ...U, ...e };
779
787
  }
780
- function Ne() {
781
- return q;
788
+ function Oe() {
789
+ return U;
782
790
  }
783
- function Re(e, n, t = 3e3, r) {
784
- U ? U(e, n, t, r) : console.warn("Toast system is not mounted");
791
+ function He(e, n, t = 3e3, r) {
792
+ K ? K(e, n, t, r) : console.warn("Toast system is not mounted");
785
793
  }
786
- function ke(e) {
787
- return re({ 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);
794
+ function Pe(e) {
795
+ return ne({ 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);
788
796
  }
789
- const Ee = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
797
+ const je = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
790
798
  const n = Math.random() * 16 | 0;
791
799
  return (e === "x" ? n : n & 3 | 8).toString(16);
792
- }), Be = () => {
793
- const [e, n] = O([]);
794
- D(() => {
795
- Se((r, s, f, p) => {
796
- const d = Ee();
797
- n((a) => [...a, { id: d, type: r, message: s, config: p }]), setTimeout(() => {
798
- n((a) => a.filter((u) => u.id !== d));
799
- }, f);
800
+ }), We = () => {
801
+ const [e, n] = E([]);
802
+ z(() => {
803
+ $e((r, s, p, g) => {
804
+ const c = je();
805
+ n((a) => [...a, { id: c, type: r, message: s, config: g }]), setTimeout(() => {
806
+ n((a) => a.filter((u) => u.id !== c));
807
+ }, p);
800
808
  });
801
809
  }, []);
802
- const t = Ne();
803
- return /* @__PURE__ */ g("div", { className: "fixed top-5 right-5 z-[9999] flex flex-col gap-2", children: e.map((r) => {
804
- var a, u, o, l, i, c, x, m, y, w, $, S, P;
805
- const s = ((a = r.config) == null ? void 0 : a.icon) || ((u = t.icons) == null ? void 0 : u[r.type]) || Le(r.type), f = ((o = r.config) == null ? void 0 : o.bgColor) || ((i = (l = t.colors) == null ? void 0 : l[r.type]) == null ? void 0 : i.bg) || "bg-white dark:bg-gray-800", p = ((c = r.config) == null ? void 0 : c.textColor) || ((m = (x = t.colors) == null ? void 0 : x[r.type]) == null ? void 0 : m.text) || "text-gray-700 dark:text-gray-300", d = ((y = r.config) == null ? void 0 : y.iconContainerClass) || "w-8 h-8 mr-3 text-xl flex items-center justify-center";
810
+ const t = Oe();
811
+ return /* @__PURE__ */ f("div", { className: "fixed top-5 right-5 z-[9999] flex flex-col gap-2", children: e.map((r) => {
812
+ var a, u, o, d, l, i, x, m, y, w, S, N, L;
813
+ const s = ((a = r.config) == null ? void 0 : a.icon) || ((u = t.icons) == null ? void 0 : u[r.type]) || Ie(r.type), p = ((o = r.config) == null ? void 0 : o.bgColor) || ((l = (d = t.colors) == null ? void 0 : d[r.type]) == null ? void 0 : l.bg) || "bg-white dark:bg-gray-800", g = ((i = r.config) == null ? void 0 : i.textColor) || ((m = (x = t.colors) == null ? void 0 : x[r.type]) == null ? void 0 : m.text) || "text-gray-700 dark:text-gray-300", c = ((y = r.config) == null ? void 0 : y.iconContainerClass) || "w-8 h-8 mr-3 text-xl flex items-center justify-center";
806
814
  return /* @__PURE__ */ h(
807
815
  "div",
808
816
  {
809
- className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${f} ${p}`,
817
+ className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${p} ${g}`,
810
818
  children: [
811
- /* @__PURE__ */ g("div", { className: d, children: s }),
819
+ /* @__PURE__ */ f("div", { className: c, children: s }),
812
820
  /* @__PURE__ */ h("div", { className: "flex-1 me-3", children: [
813
- ((w = r.config) == null ? void 0 : w.title) && /* @__PURE__ */ g("div", { className: "font-semibold text-black", children: r.config.title }),
814
- (($ = r.config) == null ? void 0 : $.description) && /* @__PURE__ */ g("div", { className: "text-sm text-gray-500", children: r.config.description }),
815
- !((S = r.config) != null && S.title) && !((P = r.config) != null && P.description) && /* @__PURE__ */ g("div", { className: "text-sm", children: r.message })
821
+ ((w = r.config) == null ? void 0 : w.title) && /* @__PURE__ */ f("div", { className: "font-semibold text-black", children: r.config.title }),
822
+ ((S = r.config) == null ? void 0 : S.description) && /* @__PURE__ */ f("div", { className: "text-sm text-gray-500", children: r.config.description }),
823
+ !((N = r.config) != null && N.title) && !((L = r.config) != null && L.description) && /* @__PURE__ */ f("div", { className: "text-sm", children: r.message })
816
824
  ] }),
817
- /* @__PURE__ */ g(
825
+ /* @__PURE__ */ f(
818
826
  "button",
819
827
  {
820
- onClick: () => n((N) => N.filter((b) => b.id !== r.id)),
828
+ onClick: () => n((C) => C.filter((b) => b.id !== r.id)),
821
829
  className: "ml-auto text-gray-400 hover:text-gray-700 dark:text-gray-500 dark:hover:text-white",
822
830
  "aria-label": "Close",
823
- children: /* @__PURE__ */ g(ke, { size: 18 })
831
+ children: /* @__PURE__ */ f(Pe, { size: 18 })
824
832
  }
825
833
  )
826
834
  ]
@@ -829,7 +837,7 @@ const Ee = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, functio
829
837
  );
830
838
  }) });
831
839
  };
832
- function Le(e) {
840
+ function Ie(e) {
833
841
  switch (e) {
834
842
  case "success":
835
843
  return "✅";
@@ -842,19 +850,19 @@ function Le(e) {
842
850
  }
843
851
  }
844
852
  export {
845
- ze as Accordion,
846
- Ae as Badge,
847
- Pe as Button,
848
- je as Dropdown,
849
- le as Input,
850
- Me as Modal,
851
- De as ModalProvider,
852
- ie as Select,
853
- Be as Toast,
854
- Ie as Tooltip,
855
- _e as setToastDefaults,
856
- Re as showToast,
857
- oe as useModalActions,
858
- Te as useModalInstance,
859
- ae as useModalState
853
+ Re as Accordion,
854
+ _e as Badge,
855
+ Me as Button,
856
+ De as Dropdown,
857
+ ge as Input,
858
+ Be as Modal,
859
+ Fe as ModalProvider,
860
+ fe as Select,
861
+ We as Toast,
862
+ Te as Tooltip,
863
+ Ge as setToastDefaults,
864
+ He as showToast,
865
+ se as useModalActions,
866
+ Ze as useModalInstance,
867
+ le as useModalState
860
868
  };
@@ -1,9 +1,9 @@
1
- (function(x,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],o):(x=typeof globalThis<"u"?globalThis:x||self,o(x.TailwindUiKit={},x.jsxRuntime,x.React))})(this,function(x,o,s){"use strict";"use client";const U=s.forwardRef((e,n)=>{const{label:t,id:r,inputSize:l="md",shape:b="rounded",validate:p,onValidatedChange:f,className:i="",icon:g,iconPosition:a="left",floatingLabelStyle:c,onChange:d,isValid:u,isInvalid:y,feedback:m,feedbackType:w="invalid",...v}=e,[O,N]=s.useState("default"),$=S=>{const L=S.target.value,P=(p==null?void 0:p(L))??"default";N(P),f==null||f(S,P),d==null||d(S)},k={xs:"text-xs px-2 py-1",sm:"text-sm px-3 py-1.5",md:"text-sm px-3 py-3",lg:"text-lg px-5 py-3"},h={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full"},C={filled:"rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",outlined:"rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",standard:"px-0 py-2.5 bg-transparent border-0 border-b-2"},j={filled:"absolute duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",outlined:"absolute duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-white px-2 peer-placeholder-shown:scale-100 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",standard:"absolute duration-300 transform -translate-y-6 scale-75 top-3 origin-[0] peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 peer-focus:text-blue-600"},M=(S,L,P)=>{if(P)return"border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:ring-red-500 focus:border-red-500";if(L)return"border-green-500 bg-green-50 text-green-900 placeholder-green-700 focus:ring-green-500 focus:border-green-500";switch(S){case"error":return"border-red-500 bg-red-50 focus:ring-red-500";case"warning":return"border-yellow-500 bg-yellow-50 focus:ring-yellow-500";case"success":return"border-green-500 bg-green-50 focus:ring-green-500";default:return"border-gray-300 focus:ring-blue-500"}},Z=k[l]||k.md,G=h[b]||h.flat,q=M(O,u,y),H=a==="start"||a==="left"?"left-0 ps-3.5":"right-0 pe-3.5",K=g&&(a==="start"||a==="left")?"ps-10":g?"pe-10":"",I=r??`input-${(t==null?void 0:t.toLowerCase().replace(/\s+/g,"-"))||Math.random().toString(36).slice(2)}`,E=!!c;return o.jsxs("div",{className:`w-full relative ${E?"z-0":""}`,children:[!E&&t&&o.jsx("label",{htmlFor:I,className:`block mb-1 text-sm ${u?"text-green-700 dark:text-green-500":y?"text-red-700 dark:text-red-500":"text-gray-700"}`,children:t}),o.jsxs("div",{className:"relative w-full",children:[g&&o.jsx("div",{className:`absolute inset-y-0 flex items-center ${H}`,children:o.jsx("span",{className:"text-gray-500",children:g})}),o.jsx("input",{...v,id:I,ref:n,placeholder:E?" ":v.placeholder,onChange:$,className:`border peer w-full block font-normal appearance-none focus:outline-none focus:ring-0 transition text-gray-900 placeholder-gray-600 border-gray-400
2
- ${Z}
3
- ${E&&c&&C[c]}
4
- ${K} ${G} ${q} ${i}`}),E&&t&&c&&o.jsx("label",{htmlFor:I,className:`ms-1 ${j[c]} ${i}`,children:t})]}),m&&o.jsx("p",{className:`mt-1 text-xs ${w==="invalid"?"text-red-600 dark:text-red-500":"text-green-600 dark:text-green-500"}`,children:m})]})});U.displayName="Input";const W=s.forwardRef((e,n)=>{const{label:t,id:r,inputSize:l="md",shape:b="rounded",validate:p,onValidatedChange:f,className:i="",icon:g,iconPosition:a="left",floatingLabelStyle:c,onChange:d,isValid:u,isInvalid:y,feedback:m,feedbackType:w="invalid",children:v,...O}=e,[N,$]=s.useState("default"),k=L=>{const P=L.target.value,z=(p==null?void 0:p(P))??"default";$(z),f==null||f(L,z),d==null||d(L)},h={xs:"text-xs px-2 py-1",sm:"text-sm px-3 py-1.5",md:"text-sm px-3 py-3",lg:"text-lg px-5 py-3"},C={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full"},j={filled:"rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",outlined:"rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",standard:"px-0 py-2.5 bg-transparent border-0 border-b-2"},M={filled:"absolute duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",outlined:"absolute duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-white px-2 peer-placeholder-shown:scale-100 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",standard:"absolute duration-300 transform -translate-y-6 scale-75 top-3 origin-[0] peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 peer-focus:text-blue-600"},Z=(L,P,z)=>{if(z)return"border-red-500 bg-red-50 text-red-900 focus:ring-red-500 focus:border-red-500";if(P)return"border-green-500 bg-green-50 text-green-900 focus:ring-green-500 focus:border-green-500";switch(L){case"error":return"border-red-500 bg-red-50 focus:ring-red-500";case"warning":return"border-yellow-500 bg-yellow-50 focus:ring-yellow-500";case"success":return"border-green-500 bg-green-50 focus:ring-green-500";default:return"border-gray-300 focus:ring-blue-500"}},G=h[l]||h.md,q=C[b]||C.flat,H=Z(N,u,y),K=a==="start"||a==="left"?"left-0 ps-3.5":"right-0 pe-3.5",I=g&&(a==="start"||a==="left")?"ps-10":g?"pe-10":"",E=r??`select-${(t==null?void 0:t.toLowerCase().replace(/\s+/g,"-"))||Math.random().toString(36).slice(2)}`,S=!!c;return o.jsxs("div",{className:`w-full relative ${S?"z-0":""}`,children:[!S&&t&&o.jsx("label",{htmlFor:E,className:`block mb-1 text-sm ${u?"text-green-700":y?"text-red-700":"text-gray-700"}`,children:t}),o.jsxs("div",{className:"relative w-full",children:[g&&o.jsx("div",{className:`absolute inset-y-0 flex items-center ${K}`,children:o.jsx("span",{className:"text-gray-500",children:g})}),o.jsx("select",{...O,id:E,ref:n,onChange:k,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
5
- ${G}
6
- ${S&&c&&j[c]}
7
- ${I} ${q} ${H} ${i}`,children:v}),S&&t&&c&&o.jsx("label",{htmlFor:E,className:`ms-1 ${M[c]} ${i}`,children:t})]}),m&&o.jsx("p",{className:`mt-1 text-xs ${w==="invalid"?"text-red-600":"text-green-600"}`,children:m})]})});W.displayName="Select";const te={primary:"bg-blue-600 text-white hover:bg-blue-700",secondary:"bg-gray-600 text-white hover:bg-gray-700",success:"bg-green-600 text-white hover:bg-green-700",danger:"bg-red-600 text-white hover:bg-red-700",warning:"bg-yellow-500 text-white hover:bg-yellow-600",info:"bg-cyan-600 text-white hover:bg-cyan-700",dark:"bg-gray-900 text-white hover:bg-black",light:"bg-gray-100 text-black hover:bg-gray-200",link:"bg-transparent text-blue-600 hover:underline [&&]:p-0 [&&]:shadow-none","outline-primary":"border border-blue-600 text-blue-600 hover:bg-blue-50","outline-secondary":"border border-gray-600 text-gray-600 hover:bg-gray-50","outline-success":"border border-green-600 text-green-600 hover:bg-green-50","outline-danger":"border border-red-600 text-red-600 hover:bg-red-50","outline-warning":"border border-yellow-500 text-yellow-600 hover:bg-yellow-50","outline-info":"border border-cyan-600 text-cyan-600 hover:bg-cyan-50","outline-dark":"border border-gray-900 text-gray-900 hover:bg-gray-100","outline-light":"border border-gray-100 text-gray-500 hover:bg-gray-200"},re={xs:"px-3 py-2 text-xs",sm:"px-3 py-2 text-sm",md:"px-5 py-2.5 text-sm",lg:"px-5 py-3 text-base",xl:"px-6 py-3.5 text-base"},ne={flat:"shadow-none",rounded:"rounded-sm",pill:"rounded-full",circle:"rounded-full w-10 h-10 p-0 flex items-center justify-center"},oe=({children:e,variant:n="primary",size:t="md",type:r="button",shape:l="rounded",className:b="",isLoading:p=!1,disabled:f=!1,...i})=>{const g=f||p,a=["inline-flex items-center justify-center font-normal transition duration-150 cursor-pointer",te[n],re[t],ne[l],l==="flat"?"shadow-none":"shadow-sm",g?"opacity-50 cursor-not-allowed pointer-events-none":"",b].filter(Boolean).join(" ");return o.jsxs("button",{type:r,className:a,disabled:g,...i,children:[p&&o.jsxs("svg",{"aria-hidden":"true",role:"status",className:"inline w-4 h-4 me-3 text-gray-200 animate-spin dark:text-gray-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),o.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"#1C64F2"})]}),e]})},se=({label:e,children:n,position:t="right"})=>{const[r,l]=s.useState(!1),[b,p]=s.useState(!1),f=s.useRef(null),i=s.useRef(null),g=s.useMemo(()=>{switch(t){case"left":return"left-0";case"center":return"left-1/2 transform -translate-x-1/2";case"right":default:return"right-0"}},[t]),a=s.useCallback(u=>{const y=u.target;f.current&&!f.current.contains(y)&&i.current&&!i.current.contains(y)&&l(!1)},[]),c=s.useCallback(()=>{if(!i.current||!f.current)return;const u=i.current.getBoundingClientRect(),y=f.current.getBoundingClientRect(),m=window.innerHeight-u.bottom,w=u.top;p(m<y.height&&w>y.height)},[]);s.useEffect(()=>{if(r)return c(),window.addEventListener("resize",c),window.addEventListener("scroll",c,!0),()=>{window.removeEventListener("resize",c),window.removeEventListener("scroll",c,!0)}},[r,c]),s.useEffect(()=>(document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)),[a]);const d=s.useCallback(()=>l(u=>!u),[]);return o.jsxs("div",{className:"relative flex items-center",children:[o.jsx("button",{ref:i,onClick:d,children:e}),r&&o.jsx("div",{ref:f,className:`absolute z-10 bg-white rounded-sm shadow-md overflow-hidden
1
+ (function(h,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],o):(h=typeof globalThis<"u"?globalThis:h||self,o(h.TailwindUiKit={},h.jsxRuntime,h.React))})(this,function(h,o,s){"use strict";"use client";const K={xs:"text-xs px-2 py-1",sm:"text-sm px-3 py-1.5",md:"text-sm px-3 py-3",lg:"text-lg px-5 py-3"},U={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full"},re={filled:"rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",outlined:"rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",standard:"px-0 py-2.5 bg-transparent border-0 border-b-2"},ne={filled:"absolute duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",outlined:"absolute duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-white px-2 peer-placeholder-shown:scale-100 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",standard:"absolute duration-300 transform -translate-y-6 scale-75 top-3 origin-[0] peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 peer-focus:text-blue-600"},oe=(e,n,t)=>{if(t)return"border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:ring-red-500 focus:border-red-500";if(n)return"border-green-500 bg-green-50 text-green-900 placeholder-green-700 focus:ring-green-500 focus:border-green-500";switch(e){case"error":return"border-red-500 bg-red-50 focus:ring-red-500";case"warning":return"border-yellow-500 bg-yellow-50 focus:ring-yellow-500";case"success":return"border-green-500 bg-green-50 focus:ring-green-500";default:return"border-gray-300 focus:ring-blue-500"}},W=s.forwardRef((e,n)=>{const{label:t,id:r,inputSize:a="md",shape:b="rounded",validate:p,onValidatedChange:u,className:i="",icon:g,iconPosition:l="left",floatingLabelStyle:f,onChange:c,isValid:d,isInvalid:y,feedback:m,feedbackType:w="invalid",...v}=e,[N,k]=s.useState("default"),E=s.useCallback($=>{const G=$.target.value,I=(p==null?void 0:p(G))??"default";k(I),u==null||u($,I),c==null||c($)},[p,u,c]),S=s.useMemo(()=>r||(typeof t=="string"?`input-${t.toLowerCase().replace(/\s+/g,"-")}`:`input-${Math.random().toString(36).slice(2)}`),[r,t]),x=!!f,C=K[a]||K.md,L=U[b]||U.flat,O=s.useMemo(()=>oe(N,d,y),[N,d,y]),F=s.useMemo(()=>l==="start"||l==="left"?"left-0 ps-3.5":"right-0 pe-3.5",[l]),Z=s.useMemo(()=>g?l==="start"||l==="left"?"ps-10":"pe-10":"",[g,l]);return o.jsxs("div",{className:`w-full relative ${x?"z-0":""}`,children:[!x&&t&&o.jsx("label",{htmlFor:S,className:`block mb-1 text-sm ${d?"text-green-700 dark:text-green-500":y?"text-red-700 dark:text-red-500":"text-gray-700"}`,children:t}),o.jsxs("div",{className:"relative w-full",children:[g&&o.jsx("div",{className:`absolute inset-y-0 flex items-center ${F}`,"aria-hidden":"true",children:o.jsx("span",{className:"text-gray-500",children:g})}),o.jsx("input",{...v,id:S,ref:n,placeholder:x?" ":v.placeholder,onChange:E,className:`border peer w-full block font-normal appearance-none focus:outline-none focus:ring-0 transition text-gray-900 placeholder-gray-600 border-gray-400
2
+ ${C}
3
+ ${x&&f&&re[f]}
4
+ ${Z} ${L} ${O} ${i}`}),x&&t&&f&&o.jsx("label",{htmlFor:S,className:`ms-1 ${ne[f]} ${i}`,children:t})]}),m&&o.jsx("p",{className:`mt-1 text-xs ${w==="invalid"?"text-red-600 dark:text-red-500":"text-green-600 dark:text-green-500"}`,role:w==="invalid"?"alert":void 0,children:m})]})});W.displayName="Input";const X=s.forwardRef((e,n)=>{const{label:t,id:r,inputSize:a="md",shape:b="rounded",validate:p,onValidatedChange:u,className:i="",icon:g,iconPosition:l="left",floatingLabelStyle:f,onChange:c,isValid:d,isInvalid:y,feedback:m,feedbackType:w="invalid",children:v,...N}=e,[k,E]=s.useState("default"),S=M=>{const H=M.target.value,T=(p==null?void 0:p(H))??"default";E(T),u==null||u(M,T),c==null||c(M)},x={xs:"text-xs px-2 py-1",sm:"text-sm px-3 py-1.5",md:"text-sm px-3 py-3",lg:"text-lg px-5 py-3"},C={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full"},L={filled:"rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",outlined:"rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",standard:"px-0 py-2.5 bg-transparent border-0 border-b-2"},O={filled:"absolute duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",outlined:"absolute duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-white px-2 peer-placeholder-shown:scale-100 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",standard:"absolute duration-300 transform -translate-y-6 scale-75 top-3 origin-[0] peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 peer-focus:text-blue-600"},F=(M,H,T)=>{if(T)return"border-red-500 bg-red-50 text-red-900 focus:ring-red-500 focus:border-red-500";if(H)return"border-green-500 bg-green-50 text-green-900 focus:ring-green-500 focus:border-green-500";switch(M){case"error":return"border-red-500 bg-red-50 focus:ring-red-500";case"warning":return"border-yellow-500 bg-yellow-50 focus:ring-yellow-500";case"success":return"border-green-500 bg-green-50 focus:ring-green-500";default:return"border-gray-300 focus:ring-blue-500"}},Z=x[a]||x.md,$=C[b]||C.flat,G=F(k,d,y),I=l==="start"||l==="left"?"left-0 ps-3.5":"right-0 pe-3.5",Te=g&&(l==="start"||l==="left")?"ps-10":g?"pe-10":"",q=r??`select-${(t==null?void 0:t.toLowerCase().replace(/\s+/g,"-"))||Math.random().toString(36).slice(2)}`,A=!!f;return o.jsxs("div",{className:`w-full relative ${A?"z-0":""}`,children:[!A&&t&&o.jsx("label",{htmlFor:q,className:`block mb-1 text-sm ${d?"text-green-700":y?"text-red-700":"text-gray-700"}`,children:t}),o.jsxs("div",{className:"relative w-full",children:[g&&o.jsx("div",{className:`absolute inset-y-0 flex items-center ${I}`,children:o.jsx("span",{className:"text-gray-500",children:g})}),o.jsx("select",{...N,id:q,ref:n,onChange:S,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
5
+ ${Z}
6
+ ${A&&f&&L[f]}
7
+ ${Te} ${$} ${G} ${i}`,children:v}),A&&t&&f&&o.jsx("label",{htmlFor:q,className:`ms-1 ${O[f]} ${i}`,children:t})]}),m&&o.jsx("p",{className:`mt-1 text-xs ${w==="invalid"?"text-red-600":"text-green-600"}`,children:m})]})});X.displayName="Select";const se={primary:"bg-blue-600 text-white hover:bg-blue-700",secondary:"bg-gray-600 text-white hover:bg-gray-700",success:"bg-green-600 text-white hover:bg-green-700",danger:"bg-red-600 text-white hover:bg-red-700",warning:"bg-yellow-500 text-white hover:bg-yellow-600",info:"bg-cyan-600 text-white hover:bg-cyan-700",dark:"bg-gray-900 text-white hover:bg-black",light:"bg-gray-100 text-black hover:bg-gray-200",link:"bg-transparent text-blue-600 hover:underline [&&]:p-0 [&&]:shadow-none","outline-primary":"border border-blue-600 text-blue-600 hover:bg-blue-50","outline-secondary":"border border-gray-600 text-gray-600 hover:bg-gray-50","outline-success":"border border-green-600 text-green-600 hover:bg-green-50","outline-danger":"border border-red-600 text-red-600 hover:bg-red-50","outline-warning":"border border-yellow-500 text-yellow-600 hover:bg-yellow-50","outline-info":"border border-cyan-600 text-cyan-600 hover:bg-cyan-50","outline-dark":"border border-gray-900 text-gray-900 hover:bg-gray-100","outline-light":"border border-gray-100 text-gray-500 hover:bg-gray-200"},le={xs:"px-3 py-2 text-xs",sm:"px-3 py-2 text-sm",md:"px-5 py-2.5 text-sm",lg:"px-5 py-3 text-base",xl:"px-6 py-3.5 text-base"},ae={flat:"shadow-none",rounded:"rounded-sm",pill:"rounded-full",circle:"rounded-full w-10 h-10 p-0 flex items-center justify-center"},ie=({children:e,variant:n="primary",size:t="md",type:r="button",shape:a="rounded",className:b="",isLoading:p=!1,disabled:u=!1,...i})=>{const g=u||p,l=["inline-flex items-center justify-center font-normal transition duration-150 cursor-pointer",se[n],le[t],ae[a],a==="flat"?"shadow-none":"shadow-sm",g?"opacity-50 cursor-not-allowed pointer-events-none":"",b].filter(Boolean).join(" ");return o.jsxs("button",{type:r,className:l,disabled:g,...i,children:[p&&o.jsxs("svg",{"aria-hidden":"true",role:"status",className:"inline w-4 h-4 me-3 text-gray-200 animate-spin dark:text-gray-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),o.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"#1C64F2"})]}),e]})},ce=({label:e,children:n,position:t="right"})=>{const[r,a]=s.useState(!1),[b,p]=s.useState(!1),u=s.useRef(null),i=s.useRef(null),g=s.useMemo(()=>{switch(t){case"left":return"left-0";case"center":return"left-1/2 transform -translate-x-1/2";case"right":default:return"right-0"}},[t]),l=s.useCallback(d=>{const y=d.target;u.current&&!u.current.contains(y)&&i.current&&!i.current.contains(y)&&a(!1)},[]),f=s.useCallback(()=>{if(!i.current||!u.current)return;const d=i.current.getBoundingClientRect(),y=u.current.getBoundingClientRect(),m=window.innerHeight-d.bottom,w=d.top;p(m<y.height&&w>y.height)},[]);s.useEffect(()=>{if(r)return f(),window.addEventListener("resize",f),window.addEventListener("scroll",f,!0),()=>{window.removeEventListener("resize",f),window.removeEventListener("scroll",f,!0)}},[r,f]),s.useEffect(()=>(document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)),[l]);const c=s.useCallback(()=>a(d=>!d),[]);return o.jsxs("div",{className:"relative flex items-center",children:[o.jsx("button",{ref:i,onClick:c,children:e}),r&&o.jsx("div",{ref:u,className:`absolute z-10 bg-white rounded-sm shadow-md overflow-hidden
8
8
  ${b?"bottom-full mb-2":"top-full mt-2"}
9
- ${g}`,children:n})]})},ae=({children:e,content:n,position:t="top",className:r="",tooltipClass:l="",tooltipStyle:b={}})=>{const p=s.useRef(null),f=s.useRef(null);s.useEffect(()=>{const g=p.current,a=f.current;if(!g||!a)return;const c=()=>{a.style.opacity="1",a.style.visibility="visible"},d=()=>{a.style.opacity="0",a.style.visibility="hidden"};return g.addEventListener("mouseenter",c),g.addEventListener("mouseleave",d),()=>{g.removeEventListener("mouseenter",c),g.removeEventListener("mouseleave",d)}},[]);const i=g=>{const a={position:"absolute",opacity:0,visibility:"hidden",transition:"opacity 0.2s ease",maxWidth:"240px",whiteSpace:"normal",wordBreak:"break-word",padding:"8px 12px",fontSize:"0.875rem",backgroundColor:"black",color:"white",borderRadius:"4px",boxShadow:"0px 4px 12px rgba(0, 0, 0, 0.15)",zIndex:9999,width:"max-content"};switch(g){case"top":return{...a,bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:"8px"};case"bottom":return{...a,top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"8px"};case"left":return{...a,right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:"8px"};case"right":return{...a,left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"};default:return a}};return o.jsxs("div",{ref:p,className:`relative inline-block ${r}`,children:[e,o.jsx("div",{ref:f,role:"tooltip",className:l,style:{...i(t),...b},children:n})]})},le={primary:"bg-blue-500 text-white",secondary:"bg-gray-500 text-white",success:"bg-green-500 text-white",danger:"bg-red-500 text-white",warning:"bg-yellow-400 text-black",info:"bg-cyan-500 text-white",dark:"bg-black text-white",light:"bg-gray-100 text-gray-800",link:"bg-transparent text-blue-500 underline","outline-primary":"border border-blue-500 text-blue-500 bg-transparent","outline-secondary":"border border-gray-500 text-gray-500 bg-transparent","outline-success":"border border-green-500 text-green-500 bg-transparent","outline-danger":"border border-red-500 text-red-500 bg-transparent","outline-warning":"border border-yellow-400 text-yellow-500 bg-transparent","outline-info":"border border-cyan-500 text-cyan-500 bg-transparent","outline-dark":"border border-black text-black bg-transparent","outline-light":"border border-gray-100 text-gray-800 bg-transparent"},ie={xs:"text-xs px-2 py-0.5",sm:"text-sm px-2.5 py-0.5",md:"text-base px-3 py-1",lg:"text-lg px-3.5 py-1.5",xl:"text-xl px-4 py-2"},ce={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full",circle:"rounded-full p-2 w-8 h-8 justify-center"},de=({label:e,variant:n="primary",size:t="sm",shape:r="rounded",icon:l,dismissible:b,onDismiss:p,className:f="",...i})=>{const g=!e&&!!l,a=`inline-flex items-center font-medium ${le[n]||""} ${ie[t]||""} ${ce[r]||""} ${g?"justify-center p-2 w-8 h-8":""} `+f;return o.jsxs("span",{className:a.trim(),...i,children:[l&&o.jsx("span",{className:e?"mr-1":"",children:l}),e,b&&o.jsx("button",{type:"button",onClick:p,className:"ml-2 text-xs font-bold leading-none focus:outline-none",children:"×"})]})};var X={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Y=s.createContext&&s.createContext(X),ue=["attr","size","title"];function fe(e,n){if(e==null)return{};var t=ge(e,n),r,l;if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(e);for(l=0;l<b.length;l++)r=b[l],!(n.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(t[r]=e[r])}return t}function ge(e,n){if(e==null)return{};var t={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(n.indexOf(r)>=0)continue;t[r]=e[r]}return t}function A(){return A=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},A.apply(this,arguments)}function J(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,r)}return t}function T(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?J(Object(t),!0).forEach(function(r){pe(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):J(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function pe(e,n,t){return n=be(n),n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function be(e){var n=xe(e,"string");return typeof n=="symbol"?n:n+""}function xe(e,n){if(typeof e!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var r=t.call(e,n);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Q(e){return e&&e.map((n,t)=>s.createElement(n.tag,T({key:t},n.attr),Q(n.child)))}function V(e){return n=>s.createElement(he,A({attr:T({},e.attr)},n),Q(e.child))}function he(e){var n=t=>{var{attr:r,size:l,title:b}=e,p=fe(e,ue),f=l||t.size||"1em",i;return t.className&&(i=t.className),e.className&&(i=(i?i+" ":"")+e.className),s.createElement("svg",A({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,r,p,{className:i,style:T(T({color:e.color||t.color},t.style),e.style),height:f,width:f,xmlns:"http://www.w3.org/2000/svg"}),b&&s.createElement("title",null,b),e.children)};return Y!==void 0?s.createElement(Y.Consumer,null,t=>n(t)):n(X)}function ye(e){return V({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z"},child:[]}]})(e)}const me=({items:e,allowMultipleOpen:n=!1,className:t="",tileClasses:r="",open:l,onChange:b,renderTitle:p,renderContent:f})=>{const[i,g]=s.useState(new Set),a=s.useMemo(()=>l?new Set(l):i,[l,i]),c=s.useCallback(d=>{const u=new Set(a);u.has(d)?u.delete(d):(n||u.clear(),u.add(d)),l&&b?b(Array.from(u)):g(u)},[a,l,b,n]);return o.jsx("div",{className:"accordion",role:"region","aria-multiselectable":n,children:e.map(d=>{const u=a.has(d.id),y=`accordion-heading-${d.id}`,m=`accordion-panel-${d.id}`;return o.jsxs("div",{className:`accordion-item border rounded border-gray-300 dark:border-gray-700 ${t}`,children:[o.jsxs("button",{id:y,type:"button","aria-expanded":u,"aria-controls":m,onClick:()=>c(d.id),className:`flex justify-between items-center w-full p-1.5 text-left text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none gap-3 ${r}`,children:[p?p(d,u):d.title,o.jsx(ye,{})]}),o.jsx("div",{id:m,role:"region","aria-labelledby":y,hidden:!u,className:"p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400",children:f?f(d,u):d.content})]},d.id)})})},R=s.createContext(null),D=()=>{const e=s.useContext(R);if(!e)throw new Error("useModalActions must be used within a ModalActionProvider");return e},ee=s.createContext(null),_=()=>s.useContext(ee);function we({id:e,title:n,children:t,standalone:r=!1,showFloatingClose:l=!1,containerClasses:b="",onClose:p,disableEscapeClose:f=!1}){const i=_(),g=D(),a=!r&&!!i&&!!g,[c,d]=s.useState(!1),u=a?i.isOpen(e):c,y=a?i.getModalData(e):null,m=s.useCallback(()=>{a?g.closeModal(e):d(!1),p==null||p()},[a,g,e,p]);return s.useEffect(()=>{const w=document.activeElement;console.log(e);const v=document.getElementById(e);console.log("modalEl=",v);const O=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'],N=()=>{if(!v)return[];const h=v.querySelectorAll(O.join(","));return Array.from(h).filter(C=>C.offsetParent!==null)},$=h=>{if(h.key==="Tab"){const C=N();if(C.length===0)return;const j=C[0],M=C[C.length-1];h.shiftKey?document.activeElement===j&&(h.preventDefault(),M.focus()):document.activeElement===M&&(h.preventDefault(),j.focus())}},k=h=>{h.key==="Escape"&&!f&&m(),$(h)};return u&&(document.body.style.overflow="hidden",setTimeout(()=>{const h=N();h.length&&h[0].focus()},0),window.addEventListener("keydown",k)),()=>{document.body.style.overflow="",w&&w.focus(),window.removeEventListener("keydown",k)}},[u,f,m,e]),u?o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-[2px]",id:e,children:o.jsxs("div",{className:`bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${b}`,children:[o.jsxs("div",{className:"flex justify-between items-center relative",children:[n&&o.jsx("h2",{className:"text-lg font-semibold",children:n}),l&&o.jsx("button",{onClick:m,className:"text-gray-500 hover:text-black absolute top-2 right-3 hover:bg-gray-200 rounded-full aspect-square w-8","aria-label":"Close modal",children:"✕"})]}),o.jsx("div",{className:"mt-3 text-sm text-gray-700",children:typeof t=="function"?t({modalData:y}):t})]})}):null}function ve({children:e}){const[n,t]=s.useState({}),[r,l]=s.useState({}),b=s.useCallback((c,d)=>{t(u=>({...u,[c]:!0})),d&&l(u=>({...u,[c]:d}))},[]),p=s.useCallback(c=>{t(d=>({...d,[c]:!1})),l(d=>{const u={...d};return delete u[c],u})},[]),f=s.useCallback(c=>!!n[c],[n]),i=s.useCallback(c=>r[c],[r]),g=s.useMemo(()=>({openModal:b,closeModal:p}),[b,p]),a=s.useMemo(()=>({isOpen:f,getModalData:i}),[f,i]);return o.jsx(R.Provider,{value:g,children:o.jsx(ee.Provider,{value:a,children:e})})}function Ce(e){const{openModal:n,closeModal:t}=D(),{isOpen:r,getModalData:l}=_();return{open:b=>n(e,b),close:()=>t(e),isOpen:r(e),data:l(e)}}let B=null,F={};function Se(e){B=e}function Ne(e){F={...F,...e}}function ke(){return F}function Ee(e,n,t=3e3,r){B?B(e,n,t,r):console.warn("Toast system is not mounted")}function Le(e){return V({attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor"},child:[]}]})(e)}const Oe=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const n=Math.random()*16|0;return(e==="x"?n:n&3|8).toString(16)}),$e=()=>{const[e,n]=s.useState([]);s.useEffect(()=>{Se((r,l,b,p)=>{const f=Oe();n(i=>[...i,{id:f,type:r,message:l,config:p}]),setTimeout(()=>{n(i=>i.filter(g=>g.id!==f))},b)})},[]);const t=ke();return o.jsx("div",{className:"fixed top-5 right-5 z-[9999] flex flex-col gap-2",children:e.map(r=>{var i,g,a,c,d,u,y,m,w,v,O,N,$;const l=((i=r.config)==null?void 0:i.icon)||((g=t.icons)==null?void 0:g[r.type])||Pe(r.type),b=((a=r.config)==null?void 0:a.bgColor)||((d=(c=t.colors)==null?void 0:c[r.type])==null?void 0:d.bg)||"bg-white dark:bg-gray-800",p=((u=r.config)==null?void 0:u.textColor)||((m=(y=t.colors)==null?void 0:y[r.type])==null?void 0:m.text)||"text-gray-700 dark:text-gray-300",f=((w=r.config)==null?void 0:w.iconContainerClass)||"w-8 h-8 mr-3 text-xl flex items-center justify-center";return o.jsxs("div",{className:`flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${b} ${p}`,children:[o.jsx("div",{className:f,children:l}),o.jsxs("div",{className:"flex-1 me-3",children:[((v=r.config)==null?void 0:v.title)&&o.jsx("div",{className:"font-semibold text-black",children:r.config.title}),((O=r.config)==null?void 0:O.description)&&o.jsx("div",{className:"text-sm text-gray-500",children:r.config.description}),!((N=r.config)!=null&&N.title)&&!(($=r.config)!=null&&$.description)&&o.jsx("div",{className:"text-sm",children:r.message})]}),o.jsx("button",{onClick:()=>n(k=>k.filter(h=>h.id!==r.id)),className:"ml-auto text-gray-400 hover:text-gray-700 dark:text-gray-500 dark:hover:text-white","aria-label":"Close",children:o.jsx(Le,{size:18})})]},r.id)})})};function Pe(e){switch(e){case"success":return"✅";case"error":return"❌";case"warning":return"⚠️";case"info":return"ℹ️"}}x.Accordion=me,x.Badge=de,x.Button=oe,x.Dropdown=se,x.Input=U,x.Modal=we,x.ModalProvider=ve,x.Select=W,x.Toast=$e,x.Tooltip=ae,x.setToastDefaults=Ne,x.showToast=Ee,x.useModalActions=D,x.useModalInstance=Ce,x.useModalState=_,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
9
+ ${g}`,children:n})]})},de=({children:e,content:n,position:t="top",className:r="",tooltipClass:a="",tooltipStyle:b={}})=>{const p=s.useRef(null),u=s.useRef(null);s.useEffect(()=>{const g=p.current,l=u.current;if(!g||!l)return;const f=()=>{l.style.opacity="1",l.style.visibility="visible"},c=()=>{l.style.opacity="0",l.style.visibility="hidden"};return g.addEventListener("mouseenter",f),g.addEventListener("mouseleave",c),()=>{g.removeEventListener("mouseenter",f),g.removeEventListener("mouseleave",c)}},[]);const i=g=>{const l={position:"absolute",opacity:0,visibility:"hidden",transition:"opacity 0.2s ease",maxWidth:"240px",whiteSpace:"normal",wordBreak:"break-word",padding:"8px 12px",fontSize:"0.875rem",backgroundColor:"black",color:"white",borderRadius:"4px",boxShadow:"0px 4px 12px rgba(0, 0, 0, 0.15)",zIndex:9999,width:"max-content"};switch(g){case"top":return{...l,bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:"8px"};case"bottom":return{...l,top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"8px"};case"left":return{...l,right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:"8px"};case"right":return{...l,left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"};default:return l}};return o.jsxs("div",{ref:p,className:`relative inline-block ${r}`,children:[e,o.jsx("div",{ref:u,role:"tooltip",className:a,style:{...i(t),...b},children:n})]})},ue={primary:"bg-blue-500 text-white",secondary:"bg-gray-500 text-white",success:"bg-green-500 text-white",danger:"bg-red-500 text-white",warning:"bg-yellow-400 text-black",info:"bg-cyan-500 text-white",dark:"bg-black text-white",light:"bg-gray-100 text-gray-800",link:"bg-transparent text-blue-500 underline","outline-primary":"border border-blue-500 text-blue-500 bg-transparent","outline-secondary":"border border-gray-500 text-gray-500 bg-transparent","outline-success":"border border-green-500 text-green-500 bg-transparent","outline-danger":"border border-red-500 text-red-500 bg-transparent","outline-warning":"border border-yellow-400 text-yellow-500 bg-transparent","outline-info":"border border-cyan-500 text-cyan-500 bg-transparent","outline-dark":"border border-black text-black bg-transparent","outline-light":"border border-gray-100 text-gray-800 bg-transparent"},fe={xs:"text-xs px-2 py-0.5",sm:"text-sm px-2.5 py-0.5",md:"text-base px-3 py-1",lg:"text-lg px-3.5 py-1.5",xl:"text-xl px-4 py-2"},ge={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full",circle:"rounded-full p-2 w-8 h-8 justify-center"},pe=({label:e,variant:n="primary",size:t="sm",shape:r="rounded",icon:a,dismissible:b,onDismiss:p,className:u="",...i})=>{const g=!e&&!!a,l=`inline-flex items-center font-medium ${ue[n]||""} ${fe[t]||""} ${ge[r]||""} ${g?"justify-center p-2 w-8 h-8":""} `+u;return o.jsxs("span",{className:l.trim(),...i,children:[a&&o.jsx("span",{className:e?"mr-1":"",children:a}),e,b&&o.jsx("button",{type:"button",onClick:p,className:"ml-2 text-xs font-bold leading-none focus:outline-none",children:"×"})]})};var Y={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},J=s.createContext&&s.createContext(Y),be=["attr","size","title"];function xe(e,n){if(e==null)return{};var t=he(e,n),r,a;if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(e);for(a=0;a<b.length;a++)r=b[a],!(n.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(t[r]=e[r])}return t}function he(e,n){if(e==null)return{};var t={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(n.indexOf(r)>=0)continue;t[r]=e[r]}return t}function P(){return P=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},P.apply(this,arguments)}function Q(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,r)}return t}function j(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?Q(Object(t),!0).forEach(function(r){ye(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Q(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function ye(e,n,t){return n=me(n),n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function me(e){var n=we(e,"string");return typeof n=="symbol"?n:n+""}function we(e,n){if(typeof e!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var r=t.call(e,n);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function V(e){return e&&e.map((n,t)=>s.createElement(n.tag,j({key:t},n.attr),V(n.child)))}function R(e){return n=>s.createElement(ve,P({attr:j({},e.attr)},n),V(e.child))}function ve(e){var n=t=>{var{attr:r,size:a,title:b}=e,p=xe(e,be),u=a||t.size||"1em",i;return t.className&&(i=t.className),e.className&&(i=(i?i+" ":"")+e.className),s.createElement("svg",P({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,r,p,{className:i,style:j(j({color:e.color||t.color},t.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),b&&s.createElement("title",null,b),e.children)};return J!==void 0?s.createElement(J.Consumer,null,t=>n(t)):n(Y)}function Ce(e){return R({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z"},child:[]}]})(e)}const Se=({items:e,allowMultipleOpen:n=!1,className:t="",tileClasses:r="",open:a,onChange:b,renderTitle:p,renderContent:u})=>{const[i,g]=s.useState(new Set),l=s.useMemo(()=>a?new Set(a):i,[a,i]),f=s.useCallback(c=>{const d=new Set(l);d.has(c)?d.delete(c):(n||d.clear(),d.add(c)),a&&b?b(Array.from(d)):g(d)},[l,a,b,n]);return o.jsx("div",{className:"accordion",role:"region","aria-multiselectable":n,children:e.map(c=>{const d=l.has(c.id),y=`accordion-heading-${c.id}`,m=`accordion-panel-${c.id}`;return o.jsxs("div",{className:`accordion-item border rounded border-gray-300 dark:border-gray-700 ${t}`,children:[o.jsxs("button",{id:y,type:"button","aria-expanded":d,"aria-controls":m,onClick:()=>f(c.id),className:`flex justify-between items-center w-full p-1.5 text-left text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none gap-3 ${r}`,children:[p?p(c,d):c.title,o.jsx(Ce,{})]}),o.jsx("div",{id:m,role:"region","aria-labelledby":y,hidden:!d,className:"p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400",children:u?u(c,d):c.content})]},c.id)})})},ee=s.createContext(null),z=()=>{const e=s.useContext(ee);if(!e)throw new Error("useModalActions must be used within a ModalActionProvider");return e},te=s.createContext(null),D=()=>s.useContext(te);function Ne({id:e,title:n,children:t,standalone:r=!1,showFloatingClose:a=!1,containerClasses:b="",onClose:p,disableEscapeClose:u=!1}){const i=D(),g=z(),l=!r&&!!i&&!!g,[f,c]=s.useState(!1),d=l?i.isOpen(e):f,y=l?i.getModalData(e):null,m=s.useCallback(()=>{l?g.closeModal(e):c(!1),p==null||p()},[l,g,e,p]);return s.useEffect(()=>{const w=document.activeElement;console.log(e);const v=document.getElementById(e);console.log("modalEl=",v);const N=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'],k=()=>{if(!v)return[];const x=v.querySelectorAll(N.join(","));return Array.from(x).filter(C=>C.offsetParent!==null)},E=x=>{if(x.key==="Tab"){const C=k();if(C.length===0)return;const L=C[0],O=C[C.length-1];x.shiftKey?document.activeElement===L&&(x.preventDefault(),O.focus()):document.activeElement===O&&(x.preventDefault(),L.focus())}},S=x=>{x.key==="Escape"&&!u&&m(),E(x)};return d&&(document.body.style.overflow="hidden",setTimeout(()=>{const x=k();x.length&&x[0].focus()},0),window.addEventListener("keydown",S)),()=>{document.body.style.overflow="",w&&w.focus(),window.removeEventListener("keydown",S)}},[d,u,m,e]),d?o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-[2px]",id:e,children:o.jsxs("div",{className:`bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${b}`,children:[o.jsxs("div",{className:"flex justify-between items-center relative",children:[n&&o.jsx("h2",{className:"text-lg font-semibold",children:n}),a&&o.jsx("button",{onClick:m,className:"text-gray-500 hover:text-black absolute top-2 right-3 hover:bg-gray-200 rounded-full aspect-square w-8","aria-label":"Close modal",children:"✕"})]}),o.jsx("div",{className:"mt-3 text-sm text-gray-700",children:typeof t=="function"?t({modalData:y}):t})]})}):null}function ke({children:e}){const[n,t]=s.useState({}),[r,a]=s.useState({}),b=s.useCallback((f,c)=>{t(d=>({...d,[f]:!0})),c&&a(d=>({...d,[f]:c}))},[]),p=s.useCallback(f=>{t(c=>({...c,[f]:!1})),a(c=>{const d={...c};return delete d[f],d})},[]),u=s.useCallback(f=>!!n[f],[n]),i=s.useCallback(f=>r[f],[r]),g=s.useMemo(()=>({openModal:b,closeModal:p}),[b,p]),l=s.useMemo(()=>({isOpen:u,getModalData:i}),[u,i]);return o.jsx(ee.Provider,{value:g,children:o.jsx(te.Provider,{value:l,children:e})})}function Ee(e){const{openModal:n,closeModal:t}=z(),{isOpen:r,getModalData:a}=D();return{open:b=>n(e,b),close:()=>t(e),isOpen:r(e),data:a(e)}}let _=null,B={};function Le(e){_=e}function Oe(e){B={...B,...e}}function $e(){return B}function Me(e,n,t=3e3,r){_?_(e,n,t,r):console.warn("Toast system is not mounted")}function Pe(e){return R({attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor"},child:[]}]})(e)}const je=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const n=Math.random()*16|0;return(e==="x"?n:n&3|8).toString(16)}),Ie=()=>{const[e,n]=s.useState([]);s.useEffect(()=>{Le((r,a,b,p)=>{const u=je();n(i=>[...i,{id:u,type:r,message:a,config:p}]),setTimeout(()=>{n(i=>i.filter(g=>g.id!==u))},b)})},[]);const t=$e();return o.jsx("div",{className:"fixed top-5 right-5 z-[9999] flex flex-col gap-2",children:e.map(r=>{var i,g,l,f,c,d,y,m,w,v,N,k,E;const a=((i=r.config)==null?void 0:i.icon)||((g=t.icons)==null?void 0:g[r.type])||Ae(r.type),b=((l=r.config)==null?void 0:l.bgColor)||((c=(f=t.colors)==null?void 0:f[r.type])==null?void 0:c.bg)||"bg-white dark:bg-gray-800",p=((d=r.config)==null?void 0:d.textColor)||((m=(y=t.colors)==null?void 0:y[r.type])==null?void 0:m.text)||"text-gray-700 dark:text-gray-300",u=((w=r.config)==null?void 0:w.iconContainerClass)||"w-8 h-8 mr-3 text-xl flex items-center justify-center";return o.jsxs("div",{className:`flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${b} ${p}`,children:[o.jsx("div",{className:u,children:a}),o.jsxs("div",{className:"flex-1 me-3",children:[((v=r.config)==null?void 0:v.title)&&o.jsx("div",{className:"font-semibold text-black",children:r.config.title}),((N=r.config)==null?void 0:N.description)&&o.jsx("div",{className:"text-sm text-gray-500",children:r.config.description}),!((k=r.config)!=null&&k.title)&&!((E=r.config)!=null&&E.description)&&o.jsx("div",{className:"text-sm",children:r.message})]}),o.jsx("button",{onClick:()=>n(S=>S.filter(x=>x.id!==r.id)),className:"ml-auto text-gray-400 hover:text-gray-700 dark:text-gray-500 dark:hover:text-white","aria-label":"Close",children:o.jsx(Pe,{size:18})})]},r.id)})})};function Ae(e){switch(e){case"success":return"✅";case"error":return"❌";case"warning":return"⚠️";case"info":return"ℹ️"}}h.Accordion=Se,h.Badge=pe,h.Button=ie,h.Dropdown=ce,h.Input=W,h.Modal=Ne,h.ModalProvider=ke,h.Select=X,h.Toast=Ie,h.Tooltip=de,h.setToastDefaults=Oe,h.showToast=Me,h.useModalActions=z,h.useModalInstance=Ee,h.useModalState=D,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwind-ux-kit",
3
- "version": "1.0.42",
3
+ "version": "1.0.43",
4
4
  "main": "lib/tailwind-ux-kit.es.js",
5
5
  "module": "lib/tailwind-ux-kit.umd.js",
6
6
  "types": "lib/tailwind-ux-kit.es.d.ts",