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