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