tailwind-ux-kit 1.0.106 → 1.0.109
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.
- package/lib/components/Toggler/Toggler.d.ts +29 -24
- package/lib/tailwind-ux-kit.es.js +534 -500
- package/lib/tailwind-ux-kit.umd.js +23 -23
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import K, { forwardRef as
|
|
4
|
-
import { createPortal as
|
|
2
|
+
import { jsxs as P, jsx as d, Fragment as be } from "react/jsx-runtime";
|
|
3
|
+
import K, { forwardRef as ae, useState as I, useMemo as B, useId as he, useRef as F, useCallback as T, useEffect as R, memo as le, useLayoutEffect as ye, createContext as V, useContext as ee } from "react";
|
|
4
|
+
import { createPortal as xe } from "react-dom";
|
|
5
5
|
const ne = {
|
|
6
6
|
xs: "text-xs px-2 py-1",
|
|
7
7
|
sm: "text-sm px-3 py-1.5",
|
|
@@ -11,15 +11,15 @@ const ne = {
|
|
|
11
11
|
flat: "rounded-none",
|
|
12
12
|
rounded: "rounded-sm",
|
|
13
13
|
pill: "rounded-full"
|
|
14
|
-
},
|
|
14
|
+
}, we = {
|
|
15
15
|
filled: "rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",
|
|
16
16
|
outlined: "rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",
|
|
17
17
|
standard: "px-0 py-2.5 bg-transparent border-0 border-b-2"
|
|
18
|
-
},
|
|
18
|
+
}, ve = {
|
|
19
19
|
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",
|
|
20
20
|
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",
|
|
21
21
|
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"
|
|
22
|
-
},
|
|
22
|
+
}, Ce = (e, n, t) => {
|
|
23
23
|
if (t)
|
|
24
24
|
return "border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:ring-red-500 focus:border-red-500";
|
|
25
25
|
if (n)
|
|
@@ -34,96 +34,96 @@ const ne = {
|
|
|
34
34
|
default:
|
|
35
35
|
return "border-gray-300 focus:ring-blue-500";
|
|
36
36
|
}
|
|
37
|
-
},
|
|
37
|
+
}, $e = ae((e, n) => {
|
|
38
38
|
const {
|
|
39
39
|
label: t,
|
|
40
40
|
id: r,
|
|
41
41
|
inputSize: o = "md",
|
|
42
|
-
shape:
|
|
43
|
-
validate:
|
|
42
|
+
shape: i = "rounded",
|
|
43
|
+
validate: f,
|
|
44
44
|
onValidatedChange: c,
|
|
45
|
-
className:
|
|
45
|
+
className: u = "",
|
|
46
46
|
icon: a,
|
|
47
47
|
iconPosition: s = "left",
|
|
48
48
|
floatingLabelStyle: l,
|
|
49
|
-
onChange:
|
|
50
|
-
isValid:
|
|
51
|
-
isInvalid:
|
|
52
|
-
feedback:
|
|
53
|
-
iconClasses:
|
|
54
|
-
feedbackType:
|
|
55
|
-
labelClasses:
|
|
56
|
-
inputType:
|
|
57
|
-
inputPattern:
|
|
58
|
-
...
|
|
59
|
-
} = e, [w, N] =
|
|
60
|
-
(
|
|
61
|
-
const
|
|
62
|
-
N(Y), c == null || c(
|
|
49
|
+
onChange: p,
|
|
50
|
+
isValid: x,
|
|
51
|
+
isInvalid: g,
|
|
52
|
+
feedback: m,
|
|
53
|
+
iconClasses: C,
|
|
54
|
+
feedbackType: v = "invalid",
|
|
55
|
+
labelClasses: L = "",
|
|
56
|
+
inputType: S = "",
|
|
57
|
+
inputPattern: b,
|
|
58
|
+
...y
|
|
59
|
+
} = e, [w, N] = I("default"), $ = K.useCallback(
|
|
60
|
+
(z) => {
|
|
61
|
+
const j = z.target.value, Y = (f == null ? void 0 : f(j)) ?? "default";
|
|
62
|
+
N(Y), c == null || c(z, Y), p == null || p(z);
|
|
63
63
|
},
|
|
64
|
-
[
|
|
65
|
-
),
|
|
66
|
-
() =>
|
|
67
|
-
[w,
|
|
68
|
-
),
|
|
64
|
+
[f, c, p]
|
|
65
|
+
), O = B(() => r || (typeof t == "string" ? `input-${t.toLowerCase().replace(/\s+/g, "-")}` : `input-${Math.random().toString(36).slice(2)}`), [r, t]), A = !!l, h = ne[o] || ne.md, E = re[i] || re.flat, D = B(
|
|
66
|
+
() => Ce(w, x, g),
|
|
67
|
+
[w, x, g]
|
|
68
|
+
), k = B(() => s === "start" || s === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", [s]), M = B(() => a ? s === "start" || s === "left" ? "ps-10" : "pe-10" : "", [a, s]), _ = (z) => {
|
|
69
69
|
var Z;
|
|
70
|
-
const
|
|
71
|
-
!(
|
|
72
|
-
const W = /^\d$/,
|
|
73
|
-
switch (
|
|
70
|
+
const j = z.key;
|
|
71
|
+
!(z.ctrlKey || z.metaKey || j.length !== 1 || ["Backspace", "ArrowLeft", "ArrowRight", "Delete", "Tab"].includes(j)) && (() => {
|
|
72
|
+
const W = /^\d$/, q = /^[a-zA-Z]$/;
|
|
73
|
+
switch (S) {
|
|
74
74
|
case "numeric":
|
|
75
75
|
case "number":
|
|
76
76
|
case "integer":
|
|
77
|
-
return !W.test(
|
|
77
|
+
return !W.test(j);
|
|
78
78
|
case "decimal":
|
|
79
|
-
return !W.test(
|
|
79
|
+
return !W.test(j) && j !== "." && j !== "Backspace" && j !== "Tab";
|
|
80
80
|
case "alphabetic":
|
|
81
|
-
return !
|
|
81
|
+
return !q.test(j);
|
|
82
82
|
case "custom":
|
|
83
|
-
return
|
|
83
|
+
return b ? !b.test(j) : !1;
|
|
84
84
|
default:
|
|
85
85
|
return !1;
|
|
86
86
|
}
|
|
87
|
-
})() &&
|
|
88
|
-
}, H = (
|
|
89
|
-
var
|
|
90
|
-
const
|
|
87
|
+
})() && z.preventDefault(), (Z = y.onKeyDown) == null || Z.call(y, z);
|
|
88
|
+
}, H = (z) => {
|
|
89
|
+
var X;
|
|
90
|
+
const j = z.clipboardData.getData("Text");
|
|
91
91
|
(() => {
|
|
92
|
-
const Z = /^\d+$/, W = /^\d*\.?\d*$/,
|
|
93
|
-
switch (
|
|
92
|
+
const Z = /^\d+$/, W = /^\d*\.?\d*$/, q = /^[a-zA-Z]+$/;
|
|
93
|
+
switch (S) {
|
|
94
94
|
case "numeric":
|
|
95
95
|
case "number":
|
|
96
96
|
case "integer":
|
|
97
|
-
return !Z.test(
|
|
97
|
+
return !Z.test(j);
|
|
98
98
|
case "decimal":
|
|
99
|
-
return !W.test(
|
|
99
|
+
return !W.test(j);
|
|
100
100
|
case "alphabetic":
|
|
101
|
-
return !
|
|
101
|
+
return !q.test(j);
|
|
102
102
|
case "custom":
|
|
103
|
-
return
|
|
103
|
+
return b ? !b.test(j) : !1;
|
|
104
104
|
default:
|
|
105
105
|
return !1;
|
|
106
106
|
}
|
|
107
|
-
})() &&
|
|
107
|
+
})() && z.preventDefault(), (X = y.onPaste) == null || X.call(y, z);
|
|
108
108
|
};
|
|
109
|
-
return /* @__PURE__ */
|
|
109
|
+
return /* @__PURE__ */ P(
|
|
110
110
|
"div",
|
|
111
111
|
{
|
|
112
|
-
className: `w-full relative ${
|
|
112
|
+
className: `w-full relative ${A ? "z-0" : ""} tailwind-ux-input`,
|
|
113
113
|
children: [
|
|
114
|
-
!
|
|
114
|
+
!A && t && /* @__PURE__ */ d(
|
|
115
115
|
"label",
|
|
116
116
|
{
|
|
117
|
-
htmlFor:
|
|
118
|
-
className: `block mb-1 text-sm ${
|
|
117
|
+
htmlFor: O,
|
|
118
|
+
className: `block mb-1 text-sm ${x ? "text-green-700 dark:text-green-500" : g ? "text-red-700 dark:text-red-500" : "text-gray-700"} ${L}`,
|
|
119
119
|
children: t
|
|
120
120
|
}
|
|
121
121
|
),
|
|
122
|
-
/* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ P("div", { className: "relative w-full", children: [
|
|
123
123
|
a && /* @__PURE__ */ d(
|
|
124
124
|
"div",
|
|
125
125
|
{
|
|
126
|
-
className: `absolute inset-y-0 flex items-center ${
|
|
126
|
+
className: `absolute inset-y-0 flex items-center ${k} ${C}`,
|
|
127
127
|
"aria-hidden": "true",
|
|
128
128
|
children: a
|
|
129
129
|
}
|
|
@@ -131,59 +131,59 @@ const ne = {
|
|
|
131
131
|
/* @__PURE__ */ d(
|
|
132
132
|
"input",
|
|
133
133
|
{
|
|
134
|
-
...
|
|
135
|
-
id:
|
|
134
|
+
...y,
|
|
135
|
+
id: O,
|
|
136
136
|
ref: n,
|
|
137
|
-
placeholder:
|
|
138
|
-
onChange:
|
|
139
|
-
onKeyDown:
|
|
137
|
+
placeholder: A ? " " : y.placeholder,
|
|
138
|
+
onChange: $,
|
|
139
|
+
onKeyDown: _,
|
|
140
140
|
onPaste: H,
|
|
141
141
|
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
|
|
142
|
-
${
|
|
143
|
-
${
|
|
144
|
-
${
|
|
142
|
+
${h}
|
|
143
|
+
${A && l && we[l]}
|
|
144
|
+
${M} ${E} ${D} ${u}`
|
|
145
145
|
}
|
|
146
146
|
),
|
|
147
|
-
|
|
147
|
+
A && t && l && /* @__PURE__ */ d(
|
|
148
148
|
"label",
|
|
149
149
|
{
|
|
150
|
-
htmlFor:
|
|
151
|
-
className: `ms-1 ${
|
|
150
|
+
htmlFor: O,
|
|
151
|
+
className: `ms-1 ${ve[l]} ${u}`,
|
|
152
152
|
children: t
|
|
153
153
|
}
|
|
154
154
|
)
|
|
155
155
|
] }),
|
|
156
|
-
|
|
156
|
+
m && /* @__PURE__ */ d(
|
|
157
157
|
"p",
|
|
158
158
|
{
|
|
159
|
-
className: `mt-1 text-xs ${
|
|
160
|
-
role:
|
|
161
|
-
children:
|
|
159
|
+
className: `mt-1 text-xs ${v === "invalid" ? "text-red-600 dark:text-red-500" : "text-green-600 dark:text-green-500"}`,
|
|
160
|
+
role: v === "invalid" ? "alert" : void 0,
|
|
161
|
+
children: m
|
|
162
162
|
}
|
|
163
163
|
)
|
|
164
164
|
]
|
|
165
165
|
}
|
|
166
166
|
);
|
|
167
167
|
});
|
|
168
|
-
|
|
169
|
-
const
|
|
168
|
+
$e.displayName = "Input";
|
|
169
|
+
const ke = {
|
|
170
170
|
xs: "text-xs px-2 py-1",
|
|
171
171
|
sm: "text-sm px-3 py-1.5",
|
|
172
172
|
md: "text-sm px-3 py-3",
|
|
173
173
|
lg: "text-lg px-5 py-3"
|
|
174
|
-
},
|
|
174
|
+
}, Se = {
|
|
175
175
|
flat: "rounded-none",
|
|
176
176
|
rounded: "rounded-sm",
|
|
177
177
|
pill: "rounded-full"
|
|
178
|
-
},
|
|
178
|
+
}, Ne = {
|
|
179
179
|
filled: "rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",
|
|
180
180
|
outlined: "rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",
|
|
181
181
|
standard: "px-0 py-2.5 bg-transparent border-0 border-b-2"
|
|
182
|
-
},
|
|
182
|
+
}, Le = {
|
|
183
183
|
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",
|
|
184
184
|
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",
|
|
185
185
|
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"
|
|
186
|
-
},
|
|
186
|
+
}, Ee = (e, n, t) => {
|
|
187
187
|
if (t)
|
|
188
188
|
return "border-red-500 bg-red-50 text-red-900 focus:ring-red-500 focus:border-red-500";
|
|
189
189
|
if (n)
|
|
@@ -199,39 +199,39 @@ const $e = {
|
|
|
199
199
|
default:
|
|
200
200
|
return "border-gray-300 focus:ring-blue-500";
|
|
201
201
|
}
|
|
202
|
-
},
|
|
202
|
+
}, Pe = ae((e, n) => {
|
|
203
203
|
const {
|
|
204
204
|
label: t,
|
|
205
205
|
id: r,
|
|
206
206
|
inputSize: o = "md",
|
|
207
|
-
shape:
|
|
208
|
-
validate:
|
|
207
|
+
shape: i = "rounded",
|
|
208
|
+
validate: f,
|
|
209
209
|
onValidatedChange: c,
|
|
210
|
-
className:
|
|
210
|
+
className: u = "",
|
|
211
211
|
icon: a,
|
|
212
212
|
iconPosition: s = "left",
|
|
213
213
|
floatingLabelStyle: l,
|
|
214
|
-
onChange:
|
|
215
|
-
isValid:
|
|
216
|
-
isInvalid:
|
|
217
|
-
feedback:
|
|
218
|
-
feedbackType:
|
|
219
|
-
children:
|
|
220
|
-
...
|
|
221
|
-
} = e, [
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
},
|
|
225
|
-
return /* @__PURE__ */
|
|
226
|
-
|
|
214
|
+
onChange: p,
|
|
215
|
+
isValid: x,
|
|
216
|
+
isInvalid: g,
|
|
217
|
+
feedback: m,
|
|
218
|
+
feedbackType: C = "invalid",
|
|
219
|
+
children: v,
|
|
220
|
+
...L
|
|
221
|
+
} = e, [S, b] = I("default"), y = he(), w = B(() => r || (typeof t == "string" ? `select-${t.toLowerCase().replace(/\s+/g, "-")}` : y), [r, t, y]), N = (k) => {
|
|
222
|
+
const M = k.target.value, _ = (f == null ? void 0 : f(M)) ?? "default";
|
|
223
|
+
b(_), c == null || c(k, _), p == null || p(k);
|
|
224
|
+
}, $ = !!l, O = ke[o], A = Se[i], h = Ee(S, x, g);
|
|
225
|
+
return /* @__PURE__ */ P("div", { className: `w-full relative ${$ ? "z-0" : ""}`, children: [
|
|
226
|
+
!$ && t && /* @__PURE__ */ d(
|
|
227
227
|
"label",
|
|
228
228
|
{
|
|
229
229
|
htmlFor: w,
|
|
230
|
-
className: `block mb-1 text-sm ${
|
|
230
|
+
className: `block mb-1 text-sm ${x ? "text-green-700" : g ? "text-red-700" : "text-gray-700"}`,
|
|
231
231
|
children: t
|
|
232
232
|
}
|
|
233
233
|
),
|
|
234
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ P("div", { className: "relative w-full", children: [
|
|
235
235
|
a && /* @__PURE__ */ d(
|
|
236
236
|
"div",
|
|
237
237
|
{
|
|
@@ -242,37 +242,37 @@ const $e = {
|
|
|
242
242
|
/* @__PURE__ */ d(
|
|
243
243
|
"select",
|
|
244
244
|
{
|
|
245
|
-
...
|
|
245
|
+
...L,
|
|
246
246
|
id: w,
|
|
247
247
|
ref: n,
|
|
248
248
|
onChange: N,
|
|
249
249
|
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
|
|
250
|
-
${
|
|
251
|
-
${
|
|
252
|
-
${
|
|
253
|
-
children:
|
|
250
|
+
${O} ${a && (s === "start" || s === "left") ? "ps-10" : a ? "pe-10" : ""}
|
|
251
|
+
${$ && l && Ne[l]}
|
|
252
|
+
${A} ${h} ${u}`,
|
|
253
|
+
children: v
|
|
254
254
|
}
|
|
255
255
|
),
|
|
256
|
-
|
|
256
|
+
$ && t && l && /* @__PURE__ */ d(
|
|
257
257
|
"label",
|
|
258
258
|
{
|
|
259
259
|
htmlFor: w,
|
|
260
|
-
className: `ms-1 ${
|
|
260
|
+
className: `ms-1 ${Le[l]} ${u}`,
|
|
261
261
|
children: t
|
|
262
262
|
}
|
|
263
263
|
)
|
|
264
264
|
] }),
|
|
265
|
-
|
|
265
|
+
m && /* @__PURE__ */ d(
|
|
266
266
|
"p",
|
|
267
267
|
{
|
|
268
|
-
className: `mt-1 text-xs ${
|
|
269
|
-
children:
|
|
268
|
+
className: `mt-1 text-xs ${C === "invalid" ? "text-red-600" : "text-green-600"}`,
|
|
269
|
+
children: m
|
|
270
270
|
}
|
|
271
271
|
)
|
|
272
272
|
] });
|
|
273
273
|
});
|
|
274
|
-
|
|
275
|
-
const
|
|
274
|
+
Pe.displayName = "Select";
|
|
275
|
+
const Oe = {
|
|
276
276
|
primary: "btn-primary",
|
|
277
277
|
secondary: "btn-secondary",
|
|
278
278
|
success: "btn-success",
|
|
@@ -298,39 +298,39 @@ const Pe = {
|
|
|
298
298
|
"soft-info": "btn-soft-info",
|
|
299
299
|
"soft-dark": "btn-soft-dark",
|
|
300
300
|
"soft-light": "btn-soft-light"
|
|
301
|
-
},
|
|
301
|
+
}, De = {
|
|
302
302
|
xs: "px-3 py-2 text-xs",
|
|
303
303
|
sm: "px-3 py-2 text-sm",
|
|
304
304
|
md: "px-5 py-2.5 text-sm",
|
|
305
305
|
lg: "px-5 py-3 text-base",
|
|
306
306
|
xl: "px-6 py-3.5 text-base"
|
|
307
|
-
},
|
|
307
|
+
}, Te = {
|
|
308
308
|
flat: "shadow-none",
|
|
309
309
|
rounded: "rounded-sm",
|
|
310
310
|
pill: "rounded-full",
|
|
311
311
|
circle: "rounded-full w-10 h-10 p-0 flex items-center justify-center"
|
|
312
|
-
},
|
|
312
|
+
}, it = ({
|
|
313
313
|
children: e,
|
|
314
314
|
variant: n = "primary",
|
|
315
315
|
size: t = "md",
|
|
316
316
|
type: r = "button",
|
|
317
317
|
shape: o = "rounded",
|
|
318
|
-
className:
|
|
319
|
-
isLoading:
|
|
318
|
+
className: i = "",
|
|
319
|
+
isLoading: f = !1,
|
|
320
320
|
disabled: c = !1,
|
|
321
|
-
...
|
|
321
|
+
...u
|
|
322
322
|
}) => {
|
|
323
|
-
const a = c ||
|
|
323
|
+
const a = c || f, s = [
|
|
324
324
|
"inline-flex items-center justify-center font-normal transition duration-150",
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
325
|
+
Oe[n],
|
|
326
|
+
De[t],
|
|
327
|
+
Te[o],
|
|
328
328
|
o === "flat" ? "shadow-none" : "shadow-sm",
|
|
329
329
|
a ? "opacity-50 cursor-not-allowed" : "cursor-pointer",
|
|
330
|
-
|
|
330
|
+
i
|
|
331
331
|
].filter(Boolean).join(" ");
|
|
332
|
-
return /* @__PURE__ */
|
|
333
|
-
|
|
332
|
+
return /* @__PURE__ */ P("button", { type: r, className: s, disabled: a, ...u, children: [
|
|
333
|
+
f && /* @__PURE__ */ P(
|
|
334
334
|
"svg",
|
|
335
335
|
{
|
|
336
336
|
"aria-hidden": "true",
|
|
@@ -360,24 +360,24 @@ const Pe = {
|
|
|
360
360
|
e
|
|
361
361
|
] });
|
|
362
362
|
};
|
|
363
|
-
var
|
|
363
|
+
var ie = {
|
|
364
364
|
color: void 0,
|
|
365
365
|
size: void 0,
|
|
366
366
|
className: void 0,
|
|
367
367
|
style: void 0,
|
|
368
368
|
attr: void 0
|
|
369
|
-
}, oe = K.createContext && /* @__PURE__ */ K.createContext(
|
|
370
|
-
function
|
|
369
|
+
}, oe = K.createContext && /* @__PURE__ */ K.createContext(ie), je = ["attr", "size", "title"];
|
|
370
|
+
function Ae(e, n) {
|
|
371
371
|
if (e == null) return {};
|
|
372
|
-
var t =
|
|
372
|
+
var t = Be(e, n), r, o;
|
|
373
373
|
if (Object.getOwnPropertySymbols) {
|
|
374
|
-
var
|
|
375
|
-
for (o = 0; o <
|
|
376
|
-
r =
|
|
374
|
+
var i = Object.getOwnPropertySymbols(e);
|
|
375
|
+
for (o = 0; o < i.length; o++)
|
|
376
|
+
r = i[o], !(n.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (t[r] = e[r]);
|
|
377
377
|
}
|
|
378
378
|
return t;
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function Be(e, n) {
|
|
381
381
|
if (e == null) return {};
|
|
382
382
|
var t = {};
|
|
383
383
|
for (var r in e)
|
|
@@ -411,21 +411,21 @@ function U(e) {
|
|
|
411
411
|
for (var n = 1; n < arguments.length; n++) {
|
|
412
412
|
var t = arguments[n] != null ? arguments[n] : {};
|
|
413
413
|
n % 2 ? se(Object(t), !0).forEach(function(r) {
|
|
414
|
-
|
|
414
|
+
Ie(e, r, t[r]);
|
|
415
415
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : se(Object(t)).forEach(function(r) {
|
|
416
416
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
417
417
|
});
|
|
418
418
|
}
|
|
419
419
|
return e;
|
|
420
420
|
}
|
|
421
|
-
function
|
|
422
|
-
return n =
|
|
421
|
+
function Ie(e, n, t) {
|
|
422
|
+
return n = ze(n), n in e ? Object.defineProperty(e, n, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[n] = t, e;
|
|
423
423
|
}
|
|
424
|
-
function
|
|
425
|
-
var n =
|
|
424
|
+
function ze(e) {
|
|
425
|
+
var n = Me(e, "string");
|
|
426
426
|
return typeof n == "symbol" ? n : n + "";
|
|
427
427
|
}
|
|
428
|
-
function
|
|
428
|
+
function Me(e, n) {
|
|
429
429
|
if (typeof e != "object" || !e) return e;
|
|
430
430
|
var t = e[Symbol.toPrimitive];
|
|
431
431
|
if (t !== void 0) {
|
|
@@ -435,52 +435,52 @@ function Be(e, n) {
|
|
|
435
435
|
}
|
|
436
436
|
return (n === "string" ? String : Number)(e);
|
|
437
437
|
}
|
|
438
|
-
function
|
|
438
|
+
function ce(e) {
|
|
439
439
|
return e && e.map((n, t) => /* @__PURE__ */ K.createElement(n.tag, U({
|
|
440
440
|
key: t
|
|
441
|
-
}, n.attr),
|
|
441
|
+
}, n.attr), ce(n.child)));
|
|
442
442
|
}
|
|
443
443
|
function te(e) {
|
|
444
|
-
return (n) => /* @__PURE__ */ K.createElement(
|
|
444
|
+
return (n) => /* @__PURE__ */ K.createElement(Re, G({
|
|
445
445
|
attr: U({}, e.attr)
|
|
446
|
-
}, n),
|
|
446
|
+
}, n), ce(e.child));
|
|
447
447
|
}
|
|
448
|
-
function
|
|
448
|
+
function Re(e) {
|
|
449
449
|
var n = (t) => {
|
|
450
450
|
var {
|
|
451
451
|
attr: r,
|
|
452
452
|
size: o,
|
|
453
|
-
title:
|
|
454
|
-
} = e,
|
|
455
|
-
return t.className && (
|
|
453
|
+
title: i
|
|
454
|
+
} = e, f = Ae(e, je), c = o || t.size || "1em", u;
|
|
455
|
+
return t.className && (u = t.className), e.className && (u = (u ? u + " " : "") + e.className), /* @__PURE__ */ K.createElement("svg", G({
|
|
456
456
|
stroke: "currentColor",
|
|
457
457
|
fill: "currentColor",
|
|
458
458
|
strokeWidth: "0"
|
|
459
|
-
}, t.attr, r,
|
|
460
|
-
className:
|
|
459
|
+
}, t.attr, r, f, {
|
|
460
|
+
className: u,
|
|
461
461
|
style: U(U({
|
|
462
462
|
color: e.color || t.color
|
|
463
463
|
}, t.style), e.style),
|
|
464
464
|
height: c,
|
|
465
465
|
width: c,
|
|
466
466
|
xmlns: "http://www.w3.org/2000/svg"
|
|
467
|
-
}),
|
|
467
|
+
}), i && /* @__PURE__ */ K.createElement("title", null, i), e.children);
|
|
468
468
|
};
|
|
469
|
-
return oe !== void 0 ? /* @__PURE__ */ K.createElement(oe.Consumer, null, (t) => n(t)) : n(
|
|
469
|
+
return oe !== void 0 ? /* @__PURE__ */ K.createElement(oe.Consumer, null, (t) => n(t)) : n(ie);
|
|
470
470
|
}
|
|
471
|
-
function
|
|
471
|
+
function _e(e) {
|
|
472
472
|
return te({ 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);
|
|
473
473
|
}
|
|
474
|
-
const
|
|
474
|
+
const Fe = {
|
|
475
475
|
xs: "w-3 h-3 text-[10px]",
|
|
476
476
|
sm: "w-4 h-4 text-xs",
|
|
477
477
|
md: "w-5 h-5 text-sm",
|
|
478
478
|
lg: "w-6 h-6 text-base"
|
|
479
|
-
},
|
|
479
|
+
}, Ke = {
|
|
480
480
|
flat: "rounded-none",
|
|
481
481
|
rounded: "rounded-sm",
|
|
482
482
|
pill: "rounded-full"
|
|
483
|
-
},
|
|
483
|
+
}, He = {
|
|
484
484
|
primary: "primary",
|
|
485
485
|
secondary: "secondary",
|
|
486
486
|
success: "success",
|
|
@@ -506,34 +506,34 @@ const _e = {
|
|
|
506
506
|
"soft-info": "soft-info",
|
|
507
507
|
"soft-dark": "soft-dark",
|
|
508
508
|
"soft-light": "soft-light"
|
|
509
|
-
},
|
|
509
|
+
}, Ye = K.forwardRef(
|
|
510
510
|
({
|
|
511
511
|
label: e,
|
|
512
512
|
boxSize: n = "md",
|
|
513
513
|
shape: t = "rounded",
|
|
514
514
|
variant: r = "success",
|
|
515
515
|
onSelectionChange: o,
|
|
516
|
-
disabled:
|
|
517
|
-
className:
|
|
516
|
+
disabled: i = !1,
|
|
517
|
+
className: f = "",
|
|
518
518
|
id: c,
|
|
519
|
-
value:
|
|
519
|
+
value: u,
|
|
520
520
|
icon: a,
|
|
521
521
|
children: s,
|
|
522
522
|
checked: l,
|
|
523
|
-
...
|
|
524
|
-
},
|
|
525
|
-
const
|
|
526
|
-
!
|
|
527
|
-
},
|
|
523
|
+
...p
|
|
524
|
+
}, x) => {
|
|
525
|
+
const g = (O) => {
|
|
526
|
+
!i && o && o(O.target.checked), p.onChange && p.onChange(O);
|
|
527
|
+
}, m = "mr-2 border flex items-center justify-center transition-all", C = Fe[n], v = Ke[t], L = He[r] ?? "", S = r.startsWith("outline"), b = r.startsWith("soft"), N = `${m} ${C} ${v} ${L} ${l && (S || b || r === "link") ? "peer-checked:bg-current peer-checked:text-white" : l ? "peer-checked:bg-current" : ""}`, $ = {
|
|
528
528
|
xs: "w-2 h-2",
|
|
529
529
|
sm: "w-2.5 h-2.5",
|
|
530
530
|
md: "w-3 h-3",
|
|
531
531
|
lg: "w-3.5 h-3.5"
|
|
532
532
|
};
|
|
533
|
-
return /* @__PURE__ */
|
|
533
|
+
return /* @__PURE__ */ P(
|
|
534
534
|
"label",
|
|
535
535
|
{
|
|
536
|
-
className: `flex items-center ${
|
|
536
|
+
className: `flex items-center ${i ? "opacity-50 cursor-not-allowed" : "cursor-pointer"} me-4 ${f}`,
|
|
537
537
|
children: [
|
|
538
538
|
/* @__PURE__ */ d(
|
|
539
539
|
"input",
|
|
@@ -541,133 +541,133 @@ const _e = {
|
|
|
541
541
|
type: "checkbox",
|
|
542
542
|
className: "peer hidden",
|
|
543
543
|
checked: l,
|
|
544
|
-
onChange:
|
|
545
|
-
disabled:
|
|
544
|
+
onChange: g,
|
|
545
|
+
disabled: i,
|
|
546
546
|
id: c,
|
|
547
|
-
value:
|
|
548
|
-
ref:
|
|
549
|
-
...
|
|
547
|
+
value: u,
|
|
548
|
+
ref: x,
|
|
549
|
+
...p
|
|
550
550
|
}
|
|
551
551
|
),
|
|
552
|
-
/* @__PURE__ */ d("span", { className: N.trim(), children: (l ||
|
|
552
|
+
/* @__PURE__ */ d("span", { className: N.trim(), children: (l || p.defaultChecked) && (a ?? /* @__PURE__ */ d(_e, { className: `${$[n]}` })) }),
|
|
553
553
|
e || s ? /* @__PURE__ */ d("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-300", children: e ?? s }) : null
|
|
554
554
|
]
|
|
555
555
|
}
|
|
556
556
|
);
|
|
557
557
|
}
|
|
558
558
|
);
|
|
559
|
-
|
|
560
|
-
const
|
|
559
|
+
Ye.displayName = "Checkbox";
|
|
560
|
+
const ct = ({
|
|
561
561
|
label: e,
|
|
562
562
|
header: n,
|
|
563
563
|
items: t = [],
|
|
564
564
|
onSelect: r,
|
|
565
565
|
renderItem: o,
|
|
566
|
-
position:
|
|
567
|
-
className:
|
|
566
|
+
position: i = "right",
|
|
567
|
+
className: f = "",
|
|
568
568
|
menuClassName: c = "",
|
|
569
|
-
width:
|
|
569
|
+
width: u = "w-48",
|
|
570
570
|
closeOnSelect: a = !1,
|
|
571
571
|
transition: s = !0,
|
|
572
572
|
ariaLabel: l = "Dropdown menu",
|
|
573
|
-
forceCloseDropdown:
|
|
574
|
-
...
|
|
573
|
+
forceCloseDropdown: p,
|
|
574
|
+
...x
|
|
575
575
|
}) => {
|
|
576
|
-
const [
|
|
576
|
+
const [g, m] = I(!1), [C, v] = I(!1), L = F(null), S = F(null), b = B(() => ({
|
|
577
577
|
left: "left-0",
|
|
578
578
|
center: "left-1/2 transform -translate-x-1/2",
|
|
579
579
|
right: "right-0"
|
|
580
|
-
})[
|
|
581
|
-
const
|
|
582
|
-
if (!
|
|
583
|
-
const { top: D, bottom:
|
|
584
|
-
|
|
585
|
-
}, []), w =
|
|
586
|
-
var
|
|
587
|
-
!((
|
|
588
|
-
}, []), N =
|
|
589
|
-
|
|
590
|
-
if (
|
|
591
|
-
return
|
|
592
|
-
window.removeEventListener("resize",
|
|
580
|
+
})[i], [i]), y = T(() => {
|
|
581
|
+
const h = S.current, E = L.current;
|
|
582
|
+
if (!h || !E) return;
|
|
583
|
+
const { top: D, bottom: k } = h.getBoundingClientRect(), M = E.offsetHeight, _ = window.innerHeight - k, H = D;
|
|
584
|
+
v(_ < M && H > M);
|
|
585
|
+
}, []), w = T((h) => {
|
|
586
|
+
var E, D;
|
|
587
|
+
!((E = L.current) != null && E.contains(h.target)) && !((D = S.current) != null && D.contains(h.target)) && m(!1);
|
|
588
|
+
}, []), N = T(() => m((h) => !h), []), $ = T(() => m(!1), []);
|
|
589
|
+
R(() => {
|
|
590
|
+
if (g)
|
|
591
|
+
return y(), window.addEventListener("resize", y), window.addEventListener("scroll", y, !0), () => {
|
|
592
|
+
window.removeEventListener("resize", y), window.removeEventListener("scroll", y, !0);
|
|
593
593
|
};
|
|
594
|
-
}, [
|
|
595
|
-
const
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
}, [
|
|
599
|
-
const
|
|
594
|
+
}, [g, y]);
|
|
595
|
+
const O = F(g);
|
|
596
|
+
R(() => {
|
|
597
|
+
O.current = g;
|
|
598
|
+
}, [g]), R(() => {
|
|
599
|
+
const h = (E) => {
|
|
600
600
|
var D;
|
|
601
|
-
|
|
601
|
+
E.key === "Escape" && O.current && (m(!1), (D = S.current) == null || D.focus());
|
|
602
602
|
};
|
|
603
|
-
return document.addEventListener("keydown",
|
|
604
|
-
document.removeEventListener("keydown",
|
|
603
|
+
return document.addEventListener("keydown", h), () => {
|
|
604
|
+
document.removeEventListener("keydown", h);
|
|
605
605
|
};
|
|
606
|
-
}, []),
|
|
607
|
-
const
|
|
606
|
+
}, []), R(() => (document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w)), [w]);
|
|
607
|
+
const A = B(
|
|
608
608
|
() => [
|
|
609
609
|
"absolute z-50 bg-white rounded shadow-lg overflow-hidden w-auto",
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
610
|
+
C ? "bottom-full mb-2" : "top-full mt-2",
|
|
611
|
+
b,
|
|
612
|
+
u,
|
|
613
613
|
s && "transition-all duration-200 ease-out",
|
|
614
614
|
c
|
|
615
615
|
].filter(Boolean).join(" "),
|
|
616
|
-
[
|
|
616
|
+
[C, b, u, s, c]
|
|
617
617
|
);
|
|
618
|
-
return /* @__PURE__ */
|
|
618
|
+
return /* @__PURE__ */ P("div", { className: `relative inline-block ${f}`, ...x, children: [
|
|
619
619
|
/* @__PURE__ */ d(
|
|
620
620
|
"button",
|
|
621
621
|
{
|
|
622
622
|
type: "button",
|
|
623
|
-
ref:
|
|
623
|
+
ref: S,
|
|
624
624
|
onClick: N,
|
|
625
|
-
"aria-expanded":
|
|
625
|
+
"aria-expanded": g,
|
|
626
626
|
"aria-label": l,
|
|
627
627
|
className: "focus:outline-none",
|
|
628
628
|
children: e
|
|
629
629
|
}
|
|
630
630
|
),
|
|
631
|
-
|
|
631
|
+
g && /* @__PURE__ */ P("div", { ref: L, role: "menu", className: A, children: [
|
|
632
632
|
n && n,
|
|
633
|
-
t.map((
|
|
633
|
+
t.map((h, E) => {
|
|
634
634
|
const D = () => {
|
|
635
|
-
r && r(
|
|
635
|
+
r && r(h), a && $();
|
|
636
636
|
};
|
|
637
|
-
return /* @__PURE__ */ d("div", { children: o ? o(
|
|
637
|
+
return /* @__PURE__ */ d("div", { children: o ? o(h, D) : /* @__PURE__ */ d(
|
|
638
638
|
"div",
|
|
639
639
|
{
|
|
640
640
|
onClick: D,
|
|
641
641
|
className: "px-4 py-2 text-sm text-gray-800 hover:bg-gray-100 cursor-pointer",
|
|
642
642
|
role: "menuitem",
|
|
643
|
-
children:
|
|
643
|
+
children: h.label
|
|
644
644
|
}
|
|
645
|
-
) },
|
|
645
|
+
) }, E);
|
|
646
646
|
})
|
|
647
647
|
] })
|
|
648
648
|
] });
|
|
649
|
-
},
|
|
649
|
+
}, dt = ({
|
|
650
650
|
children: e,
|
|
651
651
|
content: n,
|
|
652
652
|
position: t = "top",
|
|
653
653
|
className: r = "",
|
|
654
654
|
tooltipClass: o = "",
|
|
655
|
-
tooltipStyle:
|
|
655
|
+
tooltipStyle: i = {}
|
|
656
656
|
}) => {
|
|
657
|
-
const
|
|
658
|
-
|
|
659
|
-
const a =
|
|
657
|
+
const f = F(null), c = F(null);
|
|
658
|
+
R(() => {
|
|
659
|
+
const a = f.current, s = c.current;
|
|
660
660
|
if (!a || !s) return;
|
|
661
661
|
const l = () => {
|
|
662
662
|
s.style.opacity = "1", s.style.visibility = "visible";
|
|
663
|
-
},
|
|
663
|
+
}, p = () => {
|
|
664
664
|
s.style.opacity = "0", s.style.visibility = "hidden";
|
|
665
665
|
};
|
|
666
|
-
return a.addEventListener("mouseenter", l), a.addEventListener("mouseleave",
|
|
667
|
-
a.removeEventListener("mouseenter", l), a.removeEventListener("mouseleave",
|
|
666
|
+
return a.addEventListener("mouseenter", l), a.addEventListener("mouseleave", p), () => {
|
|
667
|
+
a.removeEventListener("mouseenter", l), a.removeEventListener("mouseleave", p);
|
|
668
668
|
};
|
|
669
669
|
}, []);
|
|
670
|
-
const
|
|
670
|
+
const u = (a) => {
|
|
671
671
|
const s = {
|
|
672
672
|
position: "absolute",
|
|
673
673
|
opacity: 0,
|
|
@@ -722,7 +722,7 @@ const ot = ({
|
|
|
722
722
|
return s;
|
|
723
723
|
}
|
|
724
724
|
};
|
|
725
|
-
return /* @__PURE__ */
|
|
725
|
+
return /* @__PURE__ */ P("div", { ref: f, className: `relative inline-block ${r}`, children: [
|
|
726
726
|
e,
|
|
727
727
|
/* @__PURE__ */ d(
|
|
728
728
|
"div",
|
|
@@ -731,14 +731,14 @@ const ot = ({
|
|
|
731
731
|
role: "tooltip",
|
|
732
732
|
className: o,
|
|
733
733
|
style: {
|
|
734
|
-
...
|
|
735
|
-
...
|
|
734
|
+
...u(t),
|
|
735
|
+
...i
|
|
736
736
|
},
|
|
737
737
|
children: n
|
|
738
738
|
}
|
|
739
739
|
)
|
|
740
740
|
] });
|
|
741
|
-
},
|
|
741
|
+
}, Ze = {
|
|
742
742
|
primary: "bg-blue-500 text-white",
|
|
743
743
|
secondary: "bg-gray-500 text-white",
|
|
744
744
|
success: "bg-green-500 text-white",
|
|
@@ -756,280 +756,314 @@ const ot = ({
|
|
|
756
756
|
"outline-info": "border border-cyan-500 text-cyan-500 bg-transparent",
|
|
757
757
|
"outline-dark": "border border-black text-black bg-transparent",
|
|
758
758
|
"outline-light": "border border-gray-100 text-gray-800 bg-transparent"
|
|
759
|
-
},
|
|
759
|
+
}, We = {
|
|
760
760
|
xs: "text-xs px-2 py-0.5",
|
|
761
761
|
sm: "text-sm px-2.5 py-0.5",
|
|
762
762
|
md: "text-base px-3 py-1",
|
|
763
763
|
lg: "text-lg px-3.5 py-1.5",
|
|
764
764
|
xl: "text-xl px-4 py-2"
|
|
765
|
-
},
|
|
765
|
+
}, Ge = {
|
|
766
766
|
flat: "rounded-none",
|
|
767
767
|
rounded: "rounded-sm",
|
|
768
768
|
pill: "rounded-full",
|
|
769
769
|
circle: "rounded-full p-2 w-8 h-8 justify-center"
|
|
770
|
-
},
|
|
770
|
+
}, ut = ({
|
|
771
771
|
label: e,
|
|
772
772
|
variant: n = "primary",
|
|
773
773
|
size: t = "sm",
|
|
774
774
|
shape: r = "rounded",
|
|
775
775
|
icon: o,
|
|
776
|
-
dismissible:
|
|
777
|
-
onDismiss:
|
|
776
|
+
dismissible: i,
|
|
777
|
+
onDismiss: f,
|
|
778
778
|
className: c = "",
|
|
779
|
-
...
|
|
779
|
+
...u
|
|
780
780
|
}) => {
|
|
781
|
-
const a = !e && !!o, s = `inline-flex items-center font-medium ${
|
|
782
|
-
return /* @__PURE__ */
|
|
781
|
+
const a = !e && !!o, s = `inline-flex items-center font-medium ${Ze[n] || ""} ${We[t] || ""} ${Ge[r] || ""} ${a ? "justify-center p-2 w-8 h-8" : ""} ` + c;
|
|
782
|
+
return /* @__PURE__ */ P("span", { className: s.trim(), ...u, children: [
|
|
783
783
|
o && /* @__PURE__ */ d("span", { className: e ? "mr-1" : "", children: o }),
|
|
784
784
|
e,
|
|
785
|
-
|
|
785
|
+
i && /* @__PURE__ */ d(
|
|
786
786
|
"button",
|
|
787
787
|
{
|
|
788
788
|
type: "button",
|
|
789
|
-
onClick:
|
|
789
|
+
onClick: f,
|
|
790
790
|
className: "ml-2 text-xs font-bold leading-none focus:outline-none",
|
|
791
791
|
children: "×"
|
|
792
792
|
}
|
|
793
793
|
)
|
|
794
794
|
] });
|
|
795
|
-
},
|
|
795
|
+
}, Ue = {
|
|
796
796
|
rounded: "rounded-md",
|
|
797
797
|
pill: "rounded-full",
|
|
798
798
|
flat: "rounded-none"
|
|
799
|
-
},
|
|
800
|
-
xs:
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
},
|
|
806
|
-
md: {
|
|
807
|
-
button: "px-4 py-2 text-sm"
|
|
808
|
-
},
|
|
809
|
-
lg: {
|
|
810
|
-
button: "px-5 py-3 text-base"
|
|
811
|
-
},
|
|
812
|
-
xl: {
|
|
813
|
-
button: "px-6 py-4 text-lg"
|
|
814
|
-
}
|
|
799
|
+
}, Xe = {
|
|
800
|
+
xs: "px-2 py-1 text-xs",
|
|
801
|
+
sm: "px-3 py-1.5 text-sm",
|
|
802
|
+
md: "px-4 py-2 text-sm",
|
|
803
|
+
lg: "px-5 py-3 text-base",
|
|
804
|
+
xl: "px-6 py-4 text-lg"
|
|
815
805
|
};
|
|
816
|
-
function
|
|
806
|
+
function qe({
|
|
807
|
+
option: e,
|
|
808
|
+
selected: n,
|
|
809
|
+
disabled: t,
|
|
810
|
+
variant: r,
|
|
811
|
+
sizeClass: o,
|
|
812
|
+
classNames: i,
|
|
813
|
+
onSelect: f,
|
|
814
|
+
renderOption: c,
|
|
815
|
+
buttonRef: u
|
|
816
|
+
}) {
|
|
817
|
+
const a = T(() => {
|
|
818
|
+
t || f(e.value);
|
|
819
|
+
}, [t, f, e.value]), s = T(
|
|
820
|
+
(l) => {
|
|
821
|
+
(l.key === "Enter" || l.key === " ") && !t && (l.preventDefault(), f(e.value));
|
|
822
|
+
},
|
|
823
|
+
[t, f, e.value]
|
|
824
|
+
);
|
|
825
|
+
return /* @__PURE__ */ d(
|
|
826
|
+
"button",
|
|
827
|
+
{
|
|
828
|
+
ref: u,
|
|
829
|
+
type: "button",
|
|
830
|
+
role: "radio",
|
|
831
|
+
"aria-checked": n,
|
|
832
|
+
disabled: t,
|
|
833
|
+
onClick: a,
|
|
834
|
+
onKeyDown: s,
|
|
835
|
+
className: `relative z-10 transition-colors duration-200 focus:outline-none w-full ${o}
|
|
836
|
+
${n ? `text-white toggler-${r}` : "text-gray-700 hover:bg-gray-200"}
|
|
837
|
+
${i.option ?? ""}
|
|
838
|
+
${n ? i.selectedOption ?? "" : ""}
|
|
839
|
+
`,
|
|
840
|
+
children: c ? c(e, n) : e.label
|
|
841
|
+
}
|
|
842
|
+
);
|
|
843
|
+
}
|
|
844
|
+
const Je = le(
|
|
845
|
+
qe
|
|
846
|
+
);
|
|
847
|
+
function de({
|
|
817
848
|
options: e,
|
|
818
849
|
selected: n,
|
|
819
850
|
onChange: t,
|
|
820
851
|
label: r,
|
|
821
852
|
disabled: o = !1,
|
|
822
|
-
shape:
|
|
823
|
-
variant:
|
|
853
|
+
shape: i = "rounded",
|
|
854
|
+
variant: f = "primary",
|
|
824
855
|
size: c = "md",
|
|
825
|
-
className:
|
|
856
|
+
className: u = "",
|
|
826
857
|
classNames: a = {},
|
|
827
858
|
id: s,
|
|
828
859
|
name: l,
|
|
829
|
-
renderOption:
|
|
860
|
+
renderOption: p
|
|
830
861
|
}) {
|
|
831
|
-
const
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
862
|
+
const x = F([]), [g, m] = I({}), C = B(() => Ue[i], [i]), v = B(() => Xe[c], [c]), L = B(
|
|
863
|
+
() => e.findIndex((b) => b.value === n),
|
|
864
|
+
[e, n]
|
|
865
|
+
);
|
|
866
|
+
ye(() => {
|
|
867
|
+
if (L < 0)
|
|
868
|
+
return;
|
|
869
|
+
const b = x.current[L];
|
|
870
|
+
if (!b)
|
|
871
|
+
return;
|
|
872
|
+
const y = {
|
|
873
|
+
transform: `translateX(${b.offsetLeft}px)`,
|
|
874
|
+
width: b.offsetWidth,
|
|
875
|
+
height: b.offsetHeight
|
|
876
|
+
};
|
|
877
|
+
m((w) => w.transform === y.transform && w.width === y.width && w.height === y.height ? w : y);
|
|
878
|
+
}, [L, e]);
|
|
879
|
+
const S = T(
|
|
880
|
+
(b) => {
|
|
881
|
+
b !== n && t(b);
|
|
882
|
+
},
|
|
883
|
+
[t, n]
|
|
884
|
+
);
|
|
885
|
+
return /* @__PURE__ */ P(
|
|
848
886
|
"div",
|
|
849
887
|
{
|
|
850
|
-
className: `flex flex-col gap-2 w-fit ${f} ${a.root ?? ""}`,
|
|
851
888
|
id: s,
|
|
889
|
+
className: `flex w-fit flex-col gap-2 ${u} ${a.root ?? ""}`,
|
|
852
890
|
children: [
|
|
853
|
-
r
|
|
891
|
+
r ? /* @__PURE__ */ d(
|
|
854
892
|
"span",
|
|
855
893
|
{
|
|
856
|
-
className: `text-sm font-medium
|
|
894
|
+
className: `select-none text-sm font-medium ${a.label ?? ""}`,
|
|
857
895
|
children: r
|
|
858
896
|
}
|
|
859
|
-
),
|
|
860
|
-
/* @__PURE__ */
|
|
897
|
+
) : null,
|
|
898
|
+
/* @__PURE__ */ P(
|
|
861
899
|
"div",
|
|
862
900
|
{
|
|
863
|
-
ref: b,
|
|
864
901
|
role: "radiogroup",
|
|
865
902
|
"aria-disabled": o,
|
|
866
|
-
|
|
903
|
+
"aria-label": typeof r == "string" ? r : void 0,
|
|
904
|
+
className: `relative inline-flex overflow-hidden border border-gray-300 bg-gray-100 ${C}
|
|
905
|
+
${o ? "cursor-not-allowed opacity-50" : ""}
|
|
906
|
+
${a.group ?? ""}
|
|
907
|
+
`,
|
|
867
908
|
children: [
|
|
868
909
|
/* @__PURE__ */ d(
|
|
869
910
|
"div",
|
|
870
911
|
{
|
|
871
|
-
|
|
872
|
-
style:
|
|
873
|
-
|
|
874
|
-
zIndex: 0
|
|
875
|
-
},
|
|
876
|
-
"aria-hidden": "true"
|
|
912
|
+
"aria-hidden": "true",
|
|
913
|
+
style: g,
|
|
914
|
+
className: `absolute left-0 top-0 z-0 transition-all duration-300 ease-in-out toggler-${f}`
|
|
877
915
|
}
|
|
878
916
|
),
|
|
879
|
-
e.map((
|
|
880
|
-
const
|
|
917
|
+
e.map((b, y) => {
|
|
918
|
+
const w = n === b.value, N = o || !!b.disabled;
|
|
881
919
|
return /* @__PURE__ */ d(
|
|
882
|
-
|
|
920
|
+
Je,
|
|
883
921
|
{
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
${p.button}
|
|
896
|
-
${v ? `text-white toggler-text-${g}` : "text-gray-700 hover:bg-gray-200"}
|
|
897
|
-
${a.option ?? ""}
|
|
898
|
-
${v ? a.selectedOption ?? "" : ""}
|
|
899
|
-
`,
|
|
900
|
-
children: i ? i(x, v) : x.label
|
|
922
|
+
option: b,
|
|
923
|
+
selected: w,
|
|
924
|
+
disabled: N,
|
|
925
|
+
variant: f,
|
|
926
|
+
sizeClass: v,
|
|
927
|
+
classNames: a,
|
|
928
|
+
onSelect: S,
|
|
929
|
+
renderOption: p,
|
|
930
|
+
buttonRef: ($) => {
|
|
931
|
+
x.current[y] = $;
|
|
932
|
+
}
|
|
901
933
|
},
|
|
902
|
-
String(
|
|
934
|
+
String(b.value)
|
|
903
935
|
);
|
|
904
936
|
})
|
|
905
937
|
]
|
|
906
938
|
}
|
|
907
|
-
)
|
|
939
|
+
),
|
|
940
|
+
l ? /* @__PURE__ */ d("input", { type: "hidden", name: l, value: String(n) }) : null
|
|
908
941
|
]
|
|
909
942
|
}
|
|
910
943
|
);
|
|
911
944
|
}
|
|
912
|
-
|
|
945
|
+
de.displayName = "Toggler";
|
|
946
|
+
const ft = le(de), ue = V(
|
|
913
947
|
null
|
|
914
948
|
);
|
|
915
|
-
function
|
|
949
|
+
function pt({
|
|
916
950
|
children: e
|
|
917
951
|
}) {
|
|
918
|
-
const [n, t] =
|
|
919
|
-
t((
|
|
920
|
-
}, []), o =
|
|
921
|
-
t((
|
|
922
|
-
}, []),
|
|
952
|
+
const [n, t] = I([]), r = T((c) => {
|
|
953
|
+
t((u) => u.includes(c) ? u : [...u, c]);
|
|
954
|
+
}, []), o = T((c) => {
|
|
955
|
+
t((u) => u.filter((a) => a !== c));
|
|
956
|
+
}, []), i = T(() => {
|
|
923
957
|
t([]);
|
|
924
|
-
}, []),
|
|
958
|
+
}, []), f = B(
|
|
925
959
|
() => ({
|
|
926
960
|
showBottomSheet: r,
|
|
927
961
|
closeBottomSheet: o,
|
|
928
|
-
closeAllBottomSheet:
|
|
962
|
+
closeAllBottomSheet: i,
|
|
929
963
|
activeSheets: n
|
|
930
964
|
}),
|
|
931
|
-
[r, o,
|
|
965
|
+
[r, o, i, n]
|
|
932
966
|
);
|
|
933
|
-
return /* @__PURE__ */ d(ue.Provider, { value:
|
|
967
|
+
return /* @__PURE__ */ d(ue.Provider, { value: f, children: e });
|
|
934
968
|
}
|
|
935
|
-
function
|
|
969
|
+
function Qe() {
|
|
936
970
|
const e = ee(ue);
|
|
937
971
|
if (!e)
|
|
938
972
|
throw new Error("useBottomSheet must be used inside BottomSheetProvider");
|
|
939
973
|
return e;
|
|
940
974
|
}
|
|
941
|
-
function
|
|
975
|
+
function gt({
|
|
942
976
|
id: e,
|
|
943
977
|
children: n,
|
|
944
978
|
initialSnap: t = "half",
|
|
945
979
|
snapPoints: r,
|
|
946
980
|
className: o = "",
|
|
947
|
-
overlayClassName:
|
|
948
|
-
closeOnBackdrop:
|
|
981
|
+
overlayClassName: i = "",
|
|
982
|
+
closeOnBackdrop: f = !0,
|
|
949
983
|
lockScroll: c = !0,
|
|
950
|
-
zIndex:
|
|
984
|
+
zIndex: u = 1e3
|
|
951
985
|
}) {
|
|
952
|
-
const { activeSheets: a, closeBottomSheet: s } =
|
|
953
|
-
(
|
|
954
|
-
if (
|
|
955
|
-
switch (
|
|
986
|
+
const { activeSheets: a, closeBottomSheet: s } = Qe(), l = a.includes(e), p = !!r, [x, g] = I(!1), [m, C] = I(100), [v, L] = I(!1), S = F(0), b = F(0), y = F(null), w = typeof window < "u" ? window.innerHeight : 0, N = r ? (1 - r.full) * 100 : 0, $ = r ? (1 - r.half) * 100 : 0, O = T(
|
|
987
|
+
(k) => {
|
|
988
|
+
if (p)
|
|
989
|
+
switch (k) {
|
|
956
990
|
case "full":
|
|
957
|
-
|
|
991
|
+
C(N);
|
|
958
992
|
break;
|
|
959
993
|
case "half":
|
|
960
|
-
$
|
|
994
|
+
C($);
|
|
961
995
|
break;
|
|
962
996
|
default:
|
|
963
|
-
|
|
997
|
+
C(100);
|
|
964
998
|
}
|
|
965
999
|
},
|
|
966
|
-
[N,
|
|
1000
|
+
[N, $, p]
|
|
967
1001
|
);
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
}, []),
|
|
1002
|
+
R(() => {
|
|
1003
|
+
g(!0);
|
|
1004
|
+
}, []), R(() => {
|
|
971
1005
|
if (!l) {
|
|
972
|
-
|
|
1006
|
+
C(100);
|
|
973
1007
|
return;
|
|
974
1008
|
}
|
|
975
|
-
|
|
976
|
-
}, [l, t,
|
|
1009
|
+
p ? O(t) : C(0);
|
|
1010
|
+
}, [l, t, O, p]), R(() => {
|
|
977
1011
|
if (c)
|
|
978
1012
|
return l ? (document.body.style.overflow = "hidden", document.body.style.touchAction = "none") : (document.body.style.overflow = "", document.body.style.touchAction = ""), () => {
|
|
979
1013
|
document.body.style.overflow = "", document.body.style.touchAction = "";
|
|
980
1014
|
};
|
|
981
|
-
}, [l, c]),
|
|
1015
|
+
}, [l, c]), R(() => {
|
|
982
1016
|
if (!l) return;
|
|
983
|
-
const
|
|
984
|
-
|
|
1017
|
+
const k = (M) => {
|
|
1018
|
+
M.key === "Escape" && s(e);
|
|
985
1019
|
};
|
|
986
|
-
return window.addEventListener("keydown",
|
|
987
|
-
window.removeEventListener("keydown",
|
|
1020
|
+
return window.addEventListener("keydown", k), () => {
|
|
1021
|
+
window.removeEventListener("keydown", k);
|
|
988
1022
|
};
|
|
989
1023
|
}, [s, e, l]);
|
|
990
|
-
const
|
|
991
|
-
var
|
|
992
|
-
|
|
993
|
-
},
|
|
994
|
-
if (!
|
|
995
|
-
const
|
|
996
|
-
|
|
997
|
-
},
|
|
998
|
-
if (!
|
|
999
|
-
if (
|
|
1024
|
+
const A = (k) => {
|
|
1025
|
+
var M, _;
|
|
1026
|
+
p && (L(!0), S.current = k.clientY, b.current = m, (_ = (M = k.target).setPointerCapture) == null || _.call(M, k.pointerId));
|
|
1027
|
+
}, h = (k) => {
|
|
1028
|
+
if (!v || !p) return;
|
|
1029
|
+
const _ = (k.clientY - S.current) / w * 100, H = b.current + _;
|
|
1030
|
+
C(Math.min(Math.max(H, N), 100));
|
|
1031
|
+
}, E = () => {
|
|
1032
|
+
if (!p) return;
|
|
1033
|
+
if (L(!1), m > 75) {
|
|
1000
1034
|
s(e);
|
|
1001
1035
|
return;
|
|
1002
1036
|
}
|
|
1003
|
-
const
|
|
1004
|
-
|
|
1037
|
+
const k = ($ + N) / 2;
|
|
1038
|
+
m <= k ? O("full") : O("half");
|
|
1005
1039
|
};
|
|
1006
|
-
if (!
|
|
1040
|
+
if (!x) return null;
|
|
1007
1041
|
const D = {
|
|
1008
|
-
transform: `translate3d(0, ${
|
|
1009
|
-
transition:
|
|
1042
|
+
transform: `translate3d(0, ${m}%, 0)`,
|
|
1043
|
+
transition: v ? "none" : "transform 240ms cubic-bezier(0.22, 1, 0.36, 1)",
|
|
1010
1044
|
willChange: "transform",
|
|
1011
|
-
zIndex:
|
|
1045
|
+
zIndex: u,
|
|
1012
1046
|
// height: hasSnapPoints ? "92dvh" : `${contentHeight}px`,
|
|
1013
1047
|
maxHeight: "100dvh"
|
|
1014
1048
|
};
|
|
1015
|
-
return
|
|
1016
|
-
/* @__PURE__ */
|
|
1049
|
+
return xe(
|
|
1050
|
+
/* @__PURE__ */ P(be, { children: [
|
|
1017
1051
|
/* @__PURE__ */ d(
|
|
1018
1052
|
"button",
|
|
1019
1053
|
{
|
|
1020
1054
|
type: "button",
|
|
1021
1055
|
"aria-label": "Close bottom sheet",
|
|
1022
1056
|
onClick: () => {
|
|
1023
|
-
|
|
1057
|
+
f && s(e);
|
|
1024
1058
|
},
|
|
1025
|
-
className: `fixed inset-0 bg-black/45 backdrop-blur-[2px] transition-opacity duration-200 ${l ? "opacity-100" : "pointer-events-none opacity-0"} ${
|
|
1026
|
-
style: { zIndex:
|
|
1059
|
+
className: `fixed inset-0 bg-black/45 backdrop-blur-[2px] transition-opacity duration-200 ${l ? "opacity-100" : "pointer-events-none opacity-0"} ${i}`,
|
|
1060
|
+
style: { zIndex: u }
|
|
1027
1061
|
}
|
|
1028
1062
|
),
|
|
1029
|
-
/* @__PURE__ */
|
|
1063
|
+
/* @__PURE__ */ P(
|
|
1030
1064
|
"div",
|
|
1031
1065
|
{
|
|
1032
|
-
ref:
|
|
1066
|
+
ref: y,
|
|
1033
1067
|
style: D,
|
|
1034
1068
|
className: `
|
|
1035
1069
|
fixed inset-x-0 bottom-0
|
|
@@ -1048,12 +1082,12 @@ function ct({
|
|
|
1048
1082
|
/* @__PURE__ */ d(
|
|
1049
1083
|
"div",
|
|
1050
1084
|
{
|
|
1051
|
-
onPointerDown:
|
|
1052
|
-
onPointerMove:
|
|
1053
|
-
onPointerUp:
|
|
1085
|
+
onPointerDown: A,
|
|
1086
|
+
onPointerMove: h,
|
|
1087
|
+
onPointerUp: E,
|
|
1054
1088
|
className: `
|
|
1055
1089
|
flex justify-center py-2.5
|
|
1056
|
-
${
|
|
1090
|
+
${p ? "cursor-grab active:cursor-grabbing" : ""}
|
|
1057
1091
|
select-none touch-none bg-gray-50
|
|
1058
1092
|
`,
|
|
1059
1093
|
children: /* @__PURE__ */ d("div", { className: "h-1 w-14 rounded-full bg-gray-500" })
|
|
@@ -1067,27 +1101,27 @@ function ct({
|
|
|
1067
1101
|
document.body
|
|
1068
1102
|
);
|
|
1069
1103
|
}
|
|
1070
|
-
function
|
|
1104
|
+
function Ve(e) {
|
|
1071
1105
|
return te({ 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);
|
|
1072
1106
|
}
|
|
1073
|
-
const
|
|
1107
|
+
const mt = ({
|
|
1074
1108
|
items: e,
|
|
1075
1109
|
allowMultipleOpen: n = !1,
|
|
1076
1110
|
className: t = "",
|
|
1077
1111
|
tileClasses: r = "",
|
|
1078
1112
|
open: o,
|
|
1079
|
-
onChange:
|
|
1080
|
-
renderTitle:
|
|
1113
|
+
onChange: i,
|
|
1114
|
+
renderTitle: f,
|
|
1081
1115
|
renderContent: c,
|
|
1082
|
-
showArrowIcon:
|
|
1116
|
+
showArrowIcon: u = !0,
|
|
1083
1117
|
panelClasses: a = ""
|
|
1084
1118
|
}) => {
|
|
1085
|
-
const [s, l] =
|
|
1086
|
-
(
|
|
1087
|
-
const
|
|
1088
|
-
|
|
1119
|
+
const [s, l] = I(/* @__PURE__ */ new Set()), p = B(() => o ? new Set(o) : s, [o, s]), x = T(
|
|
1120
|
+
(g) => {
|
|
1121
|
+
const m = new Set(p);
|
|
1122
|
+
m.has(g) ? m.delete(g) : (n || m.clear(), m.add(g)), o && i ? i(Array.from(m)) : l(m);
|
|
1089
1123
|
},
|
|
1090
|
-
[
|
|
1124
|
+
[p, o, i, n]
|
|
1091
1125
|
);
|
|
1092
1126
|
return /* @__PURE__ */ d(
|
|
1093
1127
|
"div",
|
|
@@ -1095,42 +1129,42 @@ const dt = ({
|
|
|
1095
1129
|
className: "accordion",
|
|
1096
1130
|
role: "region",
|
|
1097
1131
|
"aria-multiselectable": n,
|
|
1098
|
-
children: e.map((
|
|
1099
|
-
const
|
|
1100
|
-
return /* @__PURE__ */
|
|
1132
|
+
children: e.map((g) => {
|
|
1133
|
+
const m = p.has(g.id), C = `accordion-heading-${g.id}`, v = `accordion-panel-${g.id}`;
|
|
1134
|
+
return /* @__PURE__ */ P(
|
|
1101
1135
|
"div",
|
|
1102
1136
|
{
|
|
1103
1137
|
className: `accordion-item border rounded border-gray-300 dark:border-gray-700 ${t}`,
|
|
1104
1138
|
children: [
|
|
1105
|
-
/* @__PURE__ */
|
|
1139
|
+
/* @__PURE__ */ P(
|
|
1106
1140
|
"button",
|
|
1107
1141
|
{
|
|
1108
|
-
id:
|
|
1142
|
+
id: C,
|
|
1109
1143
|
type: "button",
|
|
1110
|
-
"aria-expanded":
|
|
1111
|
-
"aria-controls":
|
|
1112
|
-
onClick: () =>
|
|
1144
|
+
"aria-expanded": m,
|
|
1145
|
+
"aria-controls": v,
|
|
1146
|
+
onClick: () => x(g.id),
|
|
1113
1147
|
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}`,
|
|
1114
1148
|
children: [
|
|
1115
|
-
|
|
1116
|
-
|
|
1149
|
+
f ? f(g, m) : g.title,
|
|
1150
|
+
u ? /* @__PURE__ */ d(Ve, {}) : null
|
|
1117
1151
|
]
|
|
1118
1152
|
}
|
|
1119
1153
|
),
|
|
1120
1154
|
/* @__PURE__ */ d(
|
|
1121
1155
|
"div",
|
|
1122
1156
|
{
|
|
1123
|
-
id:
|
|
1157
|
+
id: v,
|
|
1124
1158
|
role: "region",
|
|
1125
|
-
"aria-labelledby":
|
|
1126
|
-
hidden: !
|
|
1159
|
+
"aria-labelledby": C,
|
|
1160
|
+
hidden: !m,
|
|
1127
1161
|
className: `p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 ${a}`,
|
|
1128
|
-
children: c ? c(
|
|
1162
|
+
children: c ? c(g, m) : g.content
|
|
1129
1163
|
}
|
|
1130
1164
|
)
|
|
1131
1165
|
]
|
|
1132
1166
|
},
|
|
1133
|
-
|
|
1167
|
+
g.id
|
|
1134
1168
|
);
|
|
1135
1169
|
})
|
|
1136
1170
|
}
|
|
@@ -1142,42 +1176,42 @@ const dt = ({
|
|
|
1142
1176
|
"useModalActions must be used within a ModalActionProvider"
|
|
1143
1177
|
);
|
|
1144
1178
|
return e;
|
|
1145
|
-
}, ge = V(null),
|
|
1146
|
-
function
|
|
1179
|
+
}, ge = V(null), me = () => ee(ge);
|
|
1180
|
+
function bt({
|
|
1147
1181
|
id: e,
|
|
1148
1182
|
variant: n = "center",
|
|
1149
1183
|
title: t,
|
|
1150
1184
|
children: r,
|
|
1151
1185
|
standalone: o = !1,
|
|
1152
|
-
showFloatingClose:
|
|
1153
|
-
containerClasses:
|
|
1186
|
+
showFloatingClose: i = !1,
|
|
1187
|
+
containerClasses: f = "",
|
|
1154
1188
|
headerClasses: c = "",
|
|
1155
|
-
bodyClasses:
|
|
1189
|
+
bodyClasses: u = "",
|
|
1156
1190
|
onClose: a,
|
|
1157
1191
|
disableEscapeClose: s = !1,
|
|
1158
1192
|
closeBtnStyle: l
|
|
1159
1193
|
}) {
|
|
1160
|
-
const
|
|
1161
|
-
|
|
1162
|
-
}, [
|
|
1163
|
-
return
|
|
1164
|
-
if (!
|
|
1194
|
+
const p = me(), x = pe(), g = !o && !!p && !!x, [m, C] = I(!1), v = g ? p.isOpen(e) : m, L = g ? p.getModalData(e) : null, S = n === "bottom-sheet", b = T(() => {
|
|
1195
|
+
g ? x.closeModal(e) : C(!1), a == null || a();
|
|
1196
|
+
}, [g, x, e, a]), y = F(null);
|
|
1197
|
+
return R(() => {
|
|
1198
|
+
if (!v) return;
|
|
1165
1199
|
const w = window.scrollY, N = {
|
|
1166
1200
|
position: document.body.style.position,
|
|
1167
1201
|
top: document.body.style.top,
|
|
1168
1202
|
width: document.body.style.width
|
|
1169
1203
|
};
|
|
1170
1204
|
document.body.style.position = "fixed", document.body.style.top = `-${w}px`, document.body.style.width = "100%";
|
|
1171
|
-
const
|
|
1172
|
-
|
|
1205
|
+
const $ = (O) => {
|
|
1206
|
+
O.preventDefault();
|
|
1173
1207
|
};
|
|
1174
|
-
return document.addEventListener("touchmove",
|
|
1208
|
+
return document.addEventListener("touchmove", $, {
|
|
1175
1209
|
passive: !1
|
|
1176
1210
|
}), () => {
|
|
1177
|
-
document.body.style.position = N.position, document.body.style.top = N.top, document.body.style.width = N.width, document.removeEventListener("touchmove",
|
|
1211
|
+
document.body.style.position = N.position, document.body.style.top = N.top, document.body.style.width = N.width, document.removeEventListener("touchmove", $), window.scrollTo(0, w);
|
|
1178
1212
|
};
|
|
1179
|
-
}, [
|
|
1180
|
-
|
|
1213
|
+
}, [v]), R(() => {
|
|
1214
|
+
v && (y.current = document.activeElement);
|
|
1181
1215
|
const w = document.getElementById(e), N = [
|
|
1182
1216
|
"a[href]",
|
|
1183
1217
|
"button:not([disabled])",
|
|
@@ -1185,29 +1219,29 @@ function ut({
|
|
|
1185
1219
|
"input:not([disabled])",
|
|
1186
1220
|
"select:not([disabled])",
|
|
1187
1221
|
'[tabindex]:not([tabindex="-1"])'
|
|
1188
|
-
],
|
|
1222
|
+
], $ = () => {
|
|
1189
1223
|
if (!w) return [];
|
|
1190
|
-
const
|
|
1224
|
+
const h = w.querySelectorAll(
|
|
1191
1225
|
N.join(",")
|
|
1192
1226
|
);
|
|
1193
|
-
return Array.from(
|
|
1194
|
-
},
|
|
1195
|
-
if (
|
|
1196
|
-
const
|
|
1197
|
-
if (!
|
|
1198
|
-
const D =
|
|
1199
|
-
|
|
1200
|
-
},
|
|
1201
|
-
|
|
1227
|
+
return Array.from(h).filter((E) => E.offsetParent !== null);
|
|
1228
|
+
}, O = (h) => {
|
|
1229
|
+
if (h.key !== "Tab") return;
|
|
1230
|
+
const E = $();
|
|
1231
|
+
if (!E.length) return;
|
|
1232
|
+
const D = E[0], k = E[E.length - 1];
|
|
1233
|
+
h.shiftKey ? document.activeElement === D && (h.preventDefault(), k.focus()) : document.activeElement === k && (h.preventDefault(), D.focus());
|
|
1234
|
+
}, A = (h) => {
|
|
1235
|
+
h.key === "Escape" && !s && b(), O(h);
|
|
1202
1236
|
};
|
|
1203
|
-
return
|
|
1204
|
-
const
|
|
1205
|
-
|
|
1237
|
+
return v && (window.addEventListener("keydown", A), setTimeout(() => {
|
|
1238
|
+
const h = $();
|
|
1239
|
+
h.length && h[0].focus();
|
|
1206
1240
|
}, 0)), () => {
|
|
1207
|
-
var
|
|
1208
|
-
window.removeEventListener("keydown",
|
|
1241
|
+
var h;
|
|
1242
|
+
window.removeEventListener("keydown", A), (h = y.current) == null || h.focus();
|
|
1209
1243
|
};
|
|
1210
|
-
}, [
|
|
1244
|
+
}, [v, b, s, e]), v ? /* @__PURE__ */ d(
|
|
1211
1245
|
"div",
|
|
1212
1246
|
{
|
|
1213
1247
|
id: e,
|
|
@@ -1215,16 +1249,16 @@ function ut({
|
|
|
1215
1249
|
fixed inset-0 z-50
|
|
1216
1250
|
bg-black/60 backdrop-blur-[2px]
|
|
1217
1251
|
flex
|
|
1218
|
-
${
|
|
1252
|
+
${S ? "items-end justify-center" : "items-center justify-center"}
|
|
1219
1253
|
`,
|
|
1220
|
-
children: /* @__PURE__ */
|
|
1254
|
+
children: /* @__PURE__ */ P(
|
|
1221
1255
|
"div",
|
|
1222
1256
|
{
|
|
1223
1257
|
className: `
|
|
1224
1258
|
bg-white shadow-lg
|
|
1225
1259
|
transform transition-all duration-300
|
|
1226
1260
|
|
|
1227
|
-
${
|
|
1261
|
+
${S ? `
|
|
1228
1262
|
w-full
|
|
1229
1263
|
rounded-t-3xl
|
|
1230
1264
|
max-h-[92dvh]
|
|
@@ -1237,10 +1271,10 @@ function ut({
|
|
|
1237
1271
|
p-4
|
|
1238
1272
|
`}
|
|
1239
1273
|
|
|
1240
|
-
${
|
|
1274
|
+
${f}
|
|
1241
1275
|
`,
|
|
1242
1276
|
children: [
|
|
1243
|
-
/* @__PURE__ */
|
|
1277
|
+
/* @__PURE__ */ P(
|
|
1244
1278
|
"div",
|
|
1245
1279
|
{
|
|
1246
1280
|
className: `
|
|
@@ -1250,10 +1284,10 @@ function ut({
|
|
|
1250
1284
|
`,
|
|
1251
1285
|
children: [
|
|
1252
1286
|
t && /* @__PURE__ */ d("h2", { className: "text-lg font-semibold", children: t }),
|
|
1253
|
-
|
|
1287
|
+
i && /* @__PURE__ */ d(
|
|
1254
1288
|
"button",
|
|
1255
1289
|
{
|
|
1256
|
-
onClick:
|
|
1290
|
+
onClick: b,
|
|
1257
1291
|
"aria-label": "Close modal",
|
|
1258
1292
|
className: `
|
|
1259
1293
|
text-gray-500 hover:text-black
|
|
@@ -1270,96 +1304,96 @@ function ut({
|
|
|
1270
1304
|
]
|
|
1271
1305
|
}
|
|
1272
1306
|
),
|
|
1273
|
-
/* @__PURE__ */ d("div", { className:
|
|
1307
|
+
/* @__PURE__ */ d("div", { className: u, children: typeof r == "function" ? r({ modalData: L }) : r })
|
|
1274
1308
|
]
|
|
1275
1309
|
}
|
|
1276
1310
|
)
|
|
1277
1311
|
}
|
|
1278
1312
|
) : null;
|
|
1279
1313
|
}
|
|
1280
|
-
function
|
|
1314
|
+
function ht({
|
|
1281
1315
|
children: e
|
|
1282
1316
|
}) {
|
|
1283
|
-
const [n, t] =
|
|
1284
|
-
t((
|
|
1285
|
-
}, []),
|
|
1286
|
-
t((
|
|
1287
|
-
const
|
|
1288
|
-
return delete
|
|
1317
|
+
const [n, t] = I({}), [r, o] = I({}), i = T((l, p) => {
|
|
1318
|
+
t((x) => ({ ...x, [l]: !0 })), p && o((x) => ({ ...x, [l]: p }));
|
|
1319
|
+
}, []), f = T((l) => {
|
|
1320
|
+
t((p) => ({ ...p, [l]: !1 })), o((p) => {
|
|
1321
|
+
const x = { ...p };
|
|
1322
|
+
return delete x[l], x;
|
|
1289
1323
|
});
|
|
1290
|
-
}, []), c =
|
|
1324
|
+
}, []), c = T((l) => !!n[l], [n]), u = T(
|
|
1291
1325
|
(l) => r[l],
|
|
1292
1326
|
[r]
|
|
1293
|
-
), a =
|
|
1294
|
-
() => ({ openModal:
|
|
1295
|
-
[
|
|
1296
|
-
), s =
|
|
1297
|
-
() => ({ isOpen: c, getModalData:
|
|
1298
|
-
[c,
|
|
1327
|
+
), a = B(
|
|
1328
|
+
() => ({ openModal: i, closeModal: f }),
|
|
1329
|
+
[i, f]
|
|
1330
|
+
), s = B(
|
|
1331
|
+
() => ({ isOpen: c, getModalData: u }),
|
|
1332
|
+
[c, u]
|
|
1299
1333
|
);
|
|
1300
1334
|
return /* @__PURE__ */ d(fe.Provider, { value: a, children: /* @__PURE__ */ d(ge.Provider, { value: s, children: e }) });
|
|
1301
1335
|
}
|
|
1302
|
-
function
|
|
1303
|
-
const { openModal: n, closeModal: t } = pe(), { isOpen: r, getModalData: o } =
|
|
1336
|
+
function yt(e) {
|
|
1337
|
+
const { openModal: n, closeModal: t } = pe(), { isOpen: r, getModalData: o } = me();
|
|
1304
1338
|
return {
|
|
1305
|
-
open: (
|
|
1339
|
+
open: (i) => n(e, i),
|
|
1306
1340
|
close: () => t(e),
|
|
1307
1341
|
isOpen: r(e),
|
|
1308
1342
|
data: o(e)
|
|
1309
1343
|
};
|
|
1310
1344
|
}
|
|
1311
1345
|
let J = null, Q = {};
|
|
1312
|
-
function
|
|
1346
|
+
function et(e) {
|
|
1313
1347
|
J = e;
|
|
1314
1348
|
}
|
|
1315
|
-
function
|
|
1349
|
+
function xt(e) {
|
|
1316
1350
|
Q = { ...Q, ...e };
|
|
1317
1351
|
}
|
|
1318
|
-
function
|
|
1352
|
+
function tt() {
|
|
1319
1353
|
return Q;
|
|
1320
1354
|
}
|
|
1321
|
-
function
|
|
1355
|
+
function wt(e, n, t = 3e3, r) {
|
|
1322
1356
|
J ? J(e, n, t, r) : console.warn("Toast system is not mounted");
|
|
1323
1357
|
}
|
|
1324
|
-
function
|
|
1358
|
+
function nt(e) {
|
|
1325
1359
|
return te({ 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);
|
|
1326
1360
|
}
|
|
1327
|
-
const
|
|
1361
|
+
const rt = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
1328
1362
|
const n = Math.random() * 16 | 0;
|
|
1329
1363
|
return (e === "x" ? n : n & 3 | 8).toString(16);
|
|
1330
|
-
}),
|
|
1331
|
-
const [n, t] =
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
const
|
|
1335
|
-
t((a) => [...a, { id:
|
|
1336
|
-
t((a) => a.filter((s) => s.id !==
|
|
1337
|
-
},
|
|
1364
|
+
}), vt = ({ containerStyle: e = "" }) => {
|
|
1365
|
+
const [n, t] = I([]);
|
|
1366
|
+
R(() => {
|
|
1367
|
+
et((o, i, f, c) => {
|
|
1368
|
+
const u = rt();
|
|
1369
|
+
t((a) => [...a, { id: u, type: o, message: i, config: c }]), setTimeout(() => {
|
|
1370
|
+
t((a) => a.filter((s) => s.id !== u));
|
|
1371
|
+
}, f);
|
|
1338
1372
|
});
|
|
1339
1373
|
}, []);
|
|
1340
|
-
const r =
|
|
1374
|
+
const r = tt();
|
|
1341
1375
|
return /* @__PURE__ */ d(
|
|
1342
1376
|
"div",
|
|
1343
1377
|
{
|
|
1344
1378
|
className: `fixed top-5 right-5 z-9999 flex flex-col gap-2 ${e}`,
|
|
1345
1379
|
children: n.map((o) => {
|
|
1346
|
-
var a, s, l,
|
|
1347
|
-
const
|
|
1348
|
-
return /* @__PURE__ */
|
|
1380
|
+
var a, s, l, p, x, g, m, C, v, L, S, b, y, w;
|
|
1381
|
+
const i = ((a = o.config) == null ? void 0 : a.icon) || ((s = r.icons) == null ? void 0 : s[o.type]) || ot(o.type), f = ((l = o.config) == null ? void 0 : l.bgColor) || ((x = (p = r.colors) == null ? void 0 : p[o.type]) == null ? void 0 : x.bg) || "bg-white dark:bg-gray-800", c = ((g = o.config) == null ? void 0 : g.textColor) || ((C = (m = r.colors) == null ? void 0 : m[o.type]) == null ? void 0 : C.text) || "text-gray-700 dark:text-gray-300", u = `w-8 h-8 mr-3 text-xl flex items-center justify-center ${(v = o.config) == null ? void 0 : v.iconContainerClass}`;
|
|
1382
|
+
return /* @__PURE__ */ P(
|
|
1349
1383
|
"div",
|
|
1350
1384
|
{
|
|
1351
|
-
className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${
|
|
1385
|
+
className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${f} ${c} ${(L = o.config) == null ? void 0 : L.containerBody}`,
|
|
1352
1386
|
children: [
|
|
1353
|
-
|
|
1354
|
-
/* @__PURE__ */
|
|
1355
|
-
((
|
|
1387
|
+
i && /* @__PURE__ */ d("div", { className: u, children: i }),
|
|
1388
|
+
/* @__PURE__ */ P("div", { className: "flex-1", children: [
|
|
1389
|
+
((S = o.config) == null ? void 0 : S.title) && /* @__PURE__ */ d(
|
|
1356
1390
|
"div",
|
|
1357
1391
|
{
|
|
1358
|
-
className: `font-semibold text-black ${(
|
|
1392
|
+
className: `font-semibold text-black ${(b = o.config) == null ? void 0 : b.titleClass}`,
|
|
1359
1393
|
children: o.config.title
|
|
1360
1394
|
}
|
|
1361
1395
|
),
|
|
1362
|
-
((
|
|
1396
|
+
((y = o.config) == null ? void 0 : y.description) && /* @__PURE__ */ d(
|
|
1363
1397
|
"div",
|
|
1364
1398
|
{
|
|
1365
1399
|
className: `text-sm text-gray-500 ${(w = o.config) == null ? void 0 : w.subTitleClass}`,
|
|
@@ -1370,10 +1404,10 @@ const Qe = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, functio
|
|
|
1370
1404
|
/* @__PURE__ */ d(
|
|
1371
1405
|
"button",
|
|
1372
1406
|
{
|
|
1373
|
-
onClick: () => t((N) => N.filter((
|
|
1407
|
+
onClick: () => t((N) => N.filter(($) => $.id !== o.id)),
|
|
1374
1408
|
className: "ml-auto text-gray-400 hover:text-gray-700 dark:text-gray-500 dark:hover:text-white",
|
|
1375
1409
|
"aria-label": "Close",
|
|
1376
|
-
children: /* @__PURE__ */ d(
|
|
1410
|
+
children: /* @__PURE__ */ d(nt, { size: 18 })
|
|
1377
1411
|
}
|
|
1378
1412
|
)
|
|
1379
1413
|
]
|
|
@@ -1384,7 +1418,7 @@ const Qe = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, functio
|
|
|
1384
1418
|
}
|
|
1385
1419
|
);
|
|
1386
1420
|
};
|
|
1387
|
-
function
|
|
1421
|
+
function ot(e) {
|
|
1388
1422
|
switch (e) {
|
|
1389
1423
|
case "success":
|
|
1390
1424
|
return "✅";
|
|
@@ -1397,24 +1431,24 @@ function Ve(e) {
|
|
|
1397
1431
|
}
|
|
1398
1432
|
}
|
|
1399
1433
|
export {
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1434
|
+
mt as Accordion,
|
|
1435
|
+
ut as Badge,
|
|
1436
|
+
gt as BottomSheet,
|
|
1437
|
+
pt as BottomSheetProvider,
|
|
1438
|
+
it as Button,
|
|
1439
|
+
Ye as Checkbox,
|
|
1440
|
+
ct as Dropdown,
|
|
1441
|
+
$e as Input,
|
|
1442
|
+
bt as Modal,
|
|
1443
|
+
ht as ModalProvider,
|
|
1444
|
+
Pe as Select,
|
|
1445
|
+
vt as Toast,
|
|
1446
|
+
ft as Toggler,
|
|
1447
|
+
dt as Tooltip,
|
|
1448
|
+
xt as setToastDefaults,
|
|
1449
|
+
wt as showToast,
|
|
1450
|
+
Qe as useBottomSheet,
|
|
1417
1451
|
pe as useModalActions,
|
|
1418
|
-
|
|
1419
|
-
|
|
1452
|
+
yt as useModalInstance,
|
|
1453
|
+
me as useModalState
|
|
1420
1454
|
};
|