shekel-fe-shared-lib 1.0.8 → 1.0.10
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/dist/index.cjs +31 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1199 -580
- package/dist/index.mjs.map +1 -1
- package/dist/types/components/Badge.d.ts +7 -2
- package/dist/types/components/Button.d.ts +9 -2
- package/dist/types/components/Card.d.ts +5 -2
- package/dist/types/components/Checkbox.d.ts +6 -2
- package/dist/types/components/Dropdown.d.ts +7 -1
- package/dist/types/components/Modal.d.ts +8 -0
- package/dist/types/components/Progress.d.ts +6 -1
- package/dist/types/components/SearchInput.d.ts +10 -2
- package/dist/types/components/Select.d.ts +10 -2
- package/dist/types/components/SelectedItemsList.d.ts +10 -1
- package/dist/types/components/StatCard.d.ts +12 -1
- package/dist/types/components/Steps.d.ts +8 -2
- package/dist/types/components/Table.d.ts +10 -2
- package/dist/types/components/TableTop.d.ts +9 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,28 +1,45 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
const
|
|
1
|
+
import { jsxs as C, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as R, useRef as U, useEffect as V } from "react";
|
|
3
|
+
const ee = ({
|
|
4
4
|
variant: s = "primary",
|
|
5
5
|
size: a = "md",
|
|
6
|
-
fullWidth:
|
|
6
|
+
fullWidth: n = !1,
|
|
7
7
|
icon: t,
|
|
8
|
-
iconPosition:
|
|
9
|
-
loading:
|
|
10
|
-
hoverColor:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
iconPosition: i = "left",
|
|
9
|
+
loading: u = !1,
|
|
10
|
+
hoverColor: $,
|
|
11
|
+
bgColor: d,
|
|
12
|
+
textColor: l,
|
|
13
|
+
borderColor: m,
|
|
14
|
+
hoverBgColor: g,
|
|
15
|
+
hoverTextColor: x,
|
|
16
|
+
rounded: b = "lg",
|
|
17
|
+
style: h,
|
|
18
|
+
className: r = "",
|
|
19
|
+
children: w,
|
|
20
|
+
disabled: c,
|
|
21
|
+
...y
|
|
15
22
|
}) => {
|
|
16
|
-
const
|
|
23
|
+
const o = "inline-flex items-center justify-center font-normal transition-all duration-300 ease-out focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed active:scale-95", f = {
|
|
17
24
|
primary: "bg-[#EC615B] hover:bg-[#D4554F] text-white focus:ring-[#EC615B] shadow-sm hover:shadow-md",
|
|
18
25
|
outlined: "border border-gray-300 bg-white hover:bg-gray-50 text-[#181918] focus:ring-gray-300",
|
|
19
26
|
ghost: "bg-gray-100 hover:bg-gray-200 text-[#181918] focus:ring-gray-300",
|
|
20
27
|
text: "text-[#181918] hover:bg-gray-100 focus:ring-gray-300"
|
|
21
|
-
},
|
|
28
|
+
}, N = {
|
|
22
29
|
sm: "px-3 py-1.5 text-sm gap-1.5",
|
|
23
30
|
md: "px-4 py-2 text-base gap-2",
|
|
24
|
-
lg: "px-6 py-3 text-lg gap-2.5"
|
|
25
|
-
|
|
31
|
+
lg: "px-6 py-3 text-lg gap-2.5",
|
|
32
|
+
responsive: "px-2 py-1 text-xs sm:px-3 sm:py-1.5 sm:text-sm md:px-4 md:py-2 md:text-base lg:px-6 lg:py-3 lg:text-lg gap-1 sm:gap-1.5 md:gap-2 lg:gap-2.5"
|
|
33
|
+
}, p = {
|
|
34
|
+
none: "rounded-none",
|
|
35
|
+
sm: "rounded-sm",
|
|
36
|
+
md: "rounded-md",
|
|
37
|
+
lg: "rounded-lg",
|
|
38
|
+
full: "rounded-full"
|
|
39
|
+
}, B = n ? "w-full" : "";
|
|
40
|
+
let k = f[s];
|
|
41
|
+
(d || l || m) && (k = "");
|
|
42
|
+
const T = `${o} ${k} ${N[a]} ${p[b]} ${B} ${r}`, P = () => u ? /* @__PURE__ */ C(
|
|
26
43
|
"svg",
|
|
27
44
|
{
|
|
28
45
|
className: "animate-spin h-4 w-4",
|
|
@@ -51,65 +68,169 @@ const D = ({
|
|
|
51
68
|
)
|
|
52
69
|
]
|
|
53
70
|
}
|
|
54
|
-
) : t
|
|
55
|
-
|
|
71
|
+
) : t, L = {
|
|
72
|
+
...h
|
|
73
|
+
};
|
|
74
|
+
return d && (L.backgroundColor = d), l && (L.color = l), m && (L.borderColor = m), /* @__PURE__ */ C(
|
|
56
75
|
"button",
|
|
57
76
|
{
|
|
58
|
-
className:
|
|
59
|
-
disabled:
|
|
60
|
-
style:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
onMouseEnter: (N) => {
|
|
64
|
-
i && !m && !d && (N.currentTarget.style.backgroundColor = i);
|
|
77
|
+
className: T,
|
|
78
|
+
disabled: c || u,
|
|
79
|
+
style: L,
|
|
80
|
+
onMouseEnter: (M) => {
|
|
81
|
+
!c && !u && (g ? M.currentTarget.style.backgroundColor = g : $ && (M.currentTarget.style.backgroundColor = $), x && (M.currentTarget.style.color = x));
|
|
65
82
|
},
|
|
66
|
-
onMouseLeave: (
|
|
67
|
-
|
|
83
|
+
onMouseLeave: (M) => {
|
|
84
|
+
!c && !u && ((d || g || $) && (M.currentTarget.style.backgroundColor = d || ""), (l || x) && (M.currentTarget.style.color = l || ""));
|
|
68
85
|
},
|
|
69
|
-
...
|
|
86
|
+
...y,
|
|
70
87
|
children: [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
88
|
+
i === "left" && P(),
|
|
89
|
+
w,
|
|
90
|
+
i === "right" && P()
|
|
74
91
|
]
|
|
75
92
|
}
|
|
76
93
|
);
|
|
77
|
-
},
|
|
94
|
+
}, te = ({
|
|
78
95
|
label: s,
|
|
79
96
|
value: a,
|
|
80
|
-
selected:
|
|
97
|
+
selected: n = !1,
|
|
81
98
|
onClick: t,
|
|
82
|
-
className:
|
|
99
|
+
className: i = "",
|
|
100
|
+
size: u = "responsive",
|
|
101
|
+
rounded: $ = "md",
|
|
102
|
+
bgColor: d,
|
|
103
|
+
borderColor: l,
|
|
104
|
+
labelColor: m,
|
|
105
|
+
valueColor: g,
|
|
106
|
+
selectedBgColor: x,
|
|
107
|
+
selectedBorderColor: b,
|
|
108
|
+
selectedLabelColor: h,
|
|
109
|
+
selectedValueColor: r,
|
|
110
|
+
style: w
|
|
83
111
|
}) => {
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
112
|
+
const c = () => {
|
|
113
|
+
switch (u) {
|
|
114
|
+
case "sm":
|
|
115
|
+
return "p-2 sm:p-3";
|
|
116
|
+
case "md":
|
|
117
|
+
return "p-3 sm:p-4";
|
|
118
|
+
case "lg":
|
|
119
|
+
return "p-4 sm:p-6";
|
|
120
|
+
case "responsive":
|
|
121
|
+
return "p-3 sm:p-4 md:p-5 lg:p-6";
|
|
122
|
+
default:
|
|
123
|
+
return "p-4";
|
|
124
|
+
}
|
|
125
|
+
}, y = () => {
|
|
126
|
+
switch ($) {
|
|
127
|
+
case "none":
|
|
128
|
+
return "rounded-none";
|
|
129
|
+
case "sm":
|
|
130
|
+
return "rounded-sm";
|
|
131
|
+
case "md":
|
|
132
|
+
return "rounded-md";
|
|
133
|
+
case "lg":
|
|
134
|
+
return "rounded-lg";
|
|
135
|
+
case "xl":
|
|
136
|
+
return "rounded-xl";
|
|
137
|
+
case "full":
|
|
138
|
+
return "rounded-full";
|
|
139
|
+
default:
|
|
140
|
+
return "rounded-md";
|
|
141
|
+
}
|
|
142
|
+
}, o = () => {
|
|
143
|
+
switch (u) {
|
|
144
|
+
case "sm":
|
|
145
|
+
return "text-xs sm:text-xs";
|
|
146
|
+
case "md":
|
|
147
|
+
return "text-sm sm:text-base";
|
|
148
|
+
case "lg":
|
|
149
|
+
return "text-base sm:text-lg";
|
|
150
|
+
case "responsive":
|
|
151
|
+
return "text-xs sm:text-sm md:text-base lg:text-lg";
|
|
152
|
+
default:
|
|
153
|
+
return "text-xs sm:text-sm md:text-base";
|
|
154
|
+
}
|
|
155
|
+
}, f = () => {
|
|
156
|
+
switch (u) {
|
|
157
|
+
case "sm":
|
|
158
|
+
return "text-lg sm:text-xl";
|
|
159
|
+
case "md":
|
|
160
|
+
return "text-2xl sm:text-3xl";
|
|
161
|
+
case "lg":
|
|
162
|
+
return "text-4xl sm:text-5xl";
|
|
163
|
+
case "responsive":
|
|
164
|
+
return "text-2xl sm:text-3xl md:text-4xl lg:text-5xl";
|
|
165
|
+
default:
|
|
166
|
+
return "text-3xl";
|
|
167
|
+
}
|
|
168
|
+
}, P = `${`stat-card relative flex flex-col ${c()} ${y()} border transition-all duration-500 ease-in-out cursor-pointer overflow-hidden`} ${n ? "border-[#181918] bg-[#F4F4F4] shadow-sm scale-[1.02]" : `${l ? "" : "border-gray-200"} ${d ? "" : "bg-white"} ${!d && !l ? "hover:border-gray-300 hover:shadow-sm" : ""}`} ${i}`, L = {
|
|
169
|
+
...w
|
|
170
|
+
};
|
|
171
|
+
return n && x ? L.backgroundColor = x : !n && d && (L.backgroundColor = d), n && b ? L.borderColor = b : !n && l && (L.borderColor = l), /* @__PURE__ */ C("div", { className: P, onClick: t, style: L, children: [
|
|
172
|
+
n && /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-gradient-to-r from-transparent via-[#EC615B]/5 to-transparent animate-slide-in pointer-events-none" }),
|
|
173
|
+
/* @__PURE__ */ C("div", { className: "relative z-10 transition-transform duration-300 ease-out hover:scale-[0.98] active:scale-[0.96]", children: [
|
|
174
|
+
/* @__PURE__ */ e(
|
|
175
|
+
"span",
|
|
176
|
+
{
|
|
177
|
+
className: `${o()} font-normal mb-2 block transition-colors duration-500 ${n ? "text-gray-700" : "text-gray-600"}`,
|
|
178
|
+
style: n && h ? { color: h } : !n && m ? { color: m } : void 0,
|
|
179
|
+
children: s
|
|
180
|
+
}
|
|
181
|
+
),
|
|
182
|
+
/* @__PURE__ */ e(
|
|
183
|
+
"span",
|
|
184
|
+
{
|
|
185
|
+
className: `${f()} font-semibold stat-value block transition-all duration-500 ${n ? "text-[#181918] scale-105" : "text-[#181918]"}`,
|
|
186
|
+
style: n && r ? { color: r } : !n && g ? { color: g } : void 0,
|
|
187
|
+
children: a
|
|
188
|
+
}
|
|
189
|
+
)
|
|
90
190
|
] })
|
|
91
191
|
] });
|
|
92
|
-
},
|
|
192
|
+
}, se = ({
|
|
93
193
|
icon: s,
|
|
94
194
|
iconPosition: a = "left",
|
|
95
|
-
size:
|
|
195
|
+
size: n = "md",
|
|
96
196
|
fullWidth: t = !1,
|
|
97
|
-
className:
|
|
98
|
-
onIconClick:
|
|
99
|
-
|
|
197
|
+
className: i = "",
|
|
198
|
+
onIconClick: u,
|
|
199
|
+
bgColor: $,
|
|
200
|
+
borderColor: d,
|
|
201
|
+
focusBorderColor: l,
|
|
202
|
+
iconColor: m,
|
|
203
|
+
textColor: g,
|
|
204
|
+
placeholderColor: x,
|
|
205
|
+
rounded: b = "md",
|
|
206
|
+
style: h,
|
|
207
|
+
...r
|
|
100
208
|
}) => {
|
|
101
|
-
const
|
|
209
|
+
const w = "relative inline-flex items-center", c = "border focus:outline-none focus:ring-1 transition-all duration-200 ease-in-out", y = {
|
|
102
210
|
sm: "px-3 py-1.5 text-sm",
|
|
103
211
|
md: "px-4 py-2 text-base",
|
|
104
|
-
lg: "px-5 py-3 text-lg"
|
|
105
|
-
|
|
212
|
+
lg: "px-5 py-3 text-lg",
|
|
213
|
+
responsive: "px-3 sm:px-4 md:px-5 py-1.5 sm:py-2 md:py-3 text-sm sm:text-base md:text-lg"
|
|
214
|
+
}, o = {
|
|
106
215
|
sm: "w-4 h-4",
|
|
107
216
|
md: "w-5 h-5",
|
|
108
|
-
lg: "w-6 h-6"
|
|
109
|
-
|
|
217
|
+
lg: "w-6 h-6",
|
|
218
|
+
responsive: "w-4 sm:w-5 md:w-6 h-4 sm:h-5 md:h-6"
|
|
219
|
+
}, f = {
|
|
220
|
+
none: "rounded-none",
|
|
221
|
+
sm: "rounded-sm",
|
|
222
|
+
md: "rounded-lg",
|
|
223
|
+
lg: "rounded-xl",
|
|
224
|
+
full: "rounded-full"
|
|
225
|
+
}, N = a === "left" ? n === "sm" ? "pl-9" : n === "md" ? "pl-10" : n === "lg" ? "pl-12" : "pl-9 sm:pl-10 md:pl-12" : n === "sm" ? "pr-9" : n === "md" ? "pr-10" : n === "lg" ? "pr-12" : "pr-9 sm:pr-10 md:pr-12", p = t ? "w-full" : "", B = {
|
|
226
|
+
backgroundColor: $,
|
|
227
|
+
borderColor: d || "#D1D5DB",
|
|
228
|
+
color: g,
|
|
229
|
+
...h
|
|
230
|
+
}, k = x ? "" : "placeholder:text-gray-400", T = d ? "" : "border-gray-300", P = g ? "" : "text-gray-900", L = l ? "" : "focus:ring-[#EC615B] focus:border-[#EC615B]", M = `${c} ${!i.includes("px-") && !i.includes("py-") ? y[n] : ""} ${s ? N : ""} ${p} ${i.includes("rounded") ? "" : f[b]} ${i.includes("border-") ? "" : T} ${P} ${L} ${k} ${i}`, F = a === "left" ? "left-3" : "right-3", j = m || "text-gray-400", S = m ? "" : "hover:text-gray-600", E = /* @__PURE__ */ e(
|
|
110
231
|
"svg",
|
|
111
232
|
{
|
|
112
|
-
className:
|
|
233
|
+
className: `${o[n]} ${j}`,
|
|
113
234
|
xmlns: "http://www.w3.org/2000/svg",
|
|
114
235
|
fill: "none",
|
|
115
236
|
viewBox: "0 0 24 24",
|
|
@@ -125,337 +246,545 @@ const D = ({
|
|
|
125
246
|
)
|
|
126
247
|
}
|
|
127
248
|
);
|
|
128
|
-
return /* @__PURE__ */
|
|
249
|
+
return /* @__PURE__ */ C("div", { className: `${w} ${p}`, children: [
|
|
129
250
|
s && /* @__PURE__ */ e(
|
|
130
251
|
"div",
|
|
131
252
|
{
|
|
132
|
-
className: `absolute ${
|
|
133
|
-
onClick:
|
|
134
|
-
children: s === !0 ?
|
|
253
|
+
className: `absolute ${F} ${j} ${u ? "cursor-pointer" : ""} ${S}`,
|
|
254
|
+
onClick: u,
|
|
255
|
+
children: s === !0 ? E : s
|
|
135
256
|
}
|
|
136
257
|
),
|
|
137
|
-
/* @__PURE__ */ e(
|
|
258
|
+
/* @__PURE__ */ e(
|
|
259
|
+
"input",
|
|
260
|
+
{
|
|
261
|
+
type: "text",
|
|
262
|
+
className: M,
|
|
263
|
+
style: {
|
|
264
|
+
...B,
|
|
265
|
+
...l && {
|
|
266
|
+
"--focus-border-color": l
|
|
267
|
+
},
|
|
268
|
+
...x && {
|
|
269
|
+
"--placeholder-color": x
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
...r
|
|
273
|
+
}
|
|
274
|
+
)
|
|
138
275
|
] });
|
|
139
|
-
},
|
|
276
|
+
}, re = ({
|
|
140
277
|
padding: s = "md",
|
|
141
278
|
shadow: a = "sm",
|
|
142
|
-
hover:
|
|
279
|
+
hover: n = !1,
|
|
143
280
|
bordered: t = !0,
|
|
144
|
-
rounded:
|
|
145
|
-
className:
|
|
146
|
-
|
|
281
|
+
rounded: i = "lg",
|
|
282
|
+
className: u = "",
|
|
283
|
+
bgColor: $,
|
|
284
|
+
borderColor: d,
|
|
285
|
+
style: l,
|
|
286
|
+
children: m,
|
|
147
287
|
...g
|
|
148
288
|
}) => {
|
|
149
|
-
const
|
|
289
|
+
const x = "card transition-all duration-300 ease-out", b = {
|
|
150
290
|
none: "p-0",
|
|
151
291
|
sm: "p-3",
|
|
152
292
|
md: "p-4",
|
|
153
|
-
lg: "p-6"
|
|
154
|
-
|
|
293
|
+
lg: "p-6",
|
|
294
|
+
responsive: "p-2 sm:p-3 md:p-4 lg:p-6"
|
|
295
|
+
}, h = {
|
|
155
296
|
none: "",
|
|
156
297
|
sm: "shadow-sm",
|
|
157
298
|
md: "shadow-md",
|
|
158
299
|
lg: "shadow-lg"
|
|
159
|
-
},
|
|
300
|
+
}, r = {
|
|
160
301
|
none: "rounded-none",
|
|
161
302
|
sm: "rounded-sm",
|
|
162
303
|
md: "rounded-md",
|
|
163
304
|
lg: "rounded-lg",
|
|
164
305
|
xl: "rounded-xl"
|
|
165
|
-
},
|
|
166
|
-
|
|
167
|
-
|
|
306
|
+
}, w = t ? `border ${d || "border-gray-200"}` : "", c = n ? "cursor-pointer" : "", o = `${x} ${$ ? "" : "bg-white"} ${b[s]} ${h[a]} ${r[i]} ${w} ${c} ${u}`, f = {
|
|
307
|
+
...$ && { backgroundColor: $ },
|
|
308
|
+
...l
|
|
309
|
+
};
|
|
310
|
+
return /* @__PURE__ */ e("div", { className: o, style: f, ...g, children: /* @__PURE__ */ e("div", { className: n ? "transition-transform duration-300 ease-out hover:scale-[0.98] active:scale-[0.96]" : "", children: m }) });
|
|
311
|
+
}, ne = ({
|
|
168
312
|
items: s,
|
|
169
313
|
trigger: a = "click",
|
|
170
|
-
placement:
|
|
314
|
+
placement: n = "bottomLeft",
|
|
171
315
|
children: t,
|
|
172
|
-
className:
|
|
173
|
-
overlayClassName:
|
|
174
|
-
disabled:
|
|
316
|
+
className: i = "",
|
|
317
|
+
overlayClassName: u = "",
|
|
318
|
+
disabled: $ = !1,
|
|
319
|
+
size: d = "md",
|
|
320
|
+
menuBgColor: l,
|
|
321
|
+
menuItemHoverColor: m,
|
|
322
|
+
dangerColor: g,
|
|
323
|
+
borderColor: x,
|
|
324
|
+
style: b
|
|
175
325
|
}) => {
|
|
176
|
-
const [
|
|
177
|
-
|
|
178
|
-
const
|
|
179
|
-
|
|
326
|
+
const [h, r] = R(!1), w = U(null);
|
|
327
|
+
V(() => {
|
|
328
|
+
const z = (I) => {
|
|
329
|
+
w.current && !w.current.contains(I.target) && r(!1);
|
|
180
330
|
};
|
|
181
|
-
return
|
|
182
|
-
document.removeEventListener("mousedown",
|
|
331
|
+
return h && document.addEventListener("mousedown", z), () => {
|
|
332
|
+
document.removeEventListener("mousedown", z);
|
|
183
333
|
};
|
|
184
|
-
}, [
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
},
|
|
188
|
-
|
|
189
|
-
},
|
|
190
|
-
|
|
191
|
-
},
|
|
192
|
-
!
|
|
193
|
-
},
|
|
334
|
+
}, [h]);
|
|
335
|
+
const c = () => {
|
|
336
|
+
!$ && a === "click" && r(!h);
|
|
337
|
+
}, y = () => {
|
|
338
|
+
!$ && a === "hover" && r(!0);
|
|
339
|
+
}, o = () => {
|
|
340
|
+
!$ && a === "hover" && r(!1);
|
|
341
|
+
}, f = (z) => {
|
|
342
|
+
!z.disabled && z.onClick && z.onClick(), r(!1);
|
|
343
|
+
}, N = {
|
|
194
344
|
bottomLeft: "top-full left-0 mt-1",
|
|
195
345
|
bottomRight: "top-full right-0 mt-1",
|
|
196
346
|
topLeft: "bottom-full left-0 mb-1",
|
|
197
347
|
topRight: "bottom-full right-0 mb-1"
|
|
198
|
-
},
|
|
199
|
-
|
|
348
|
+
}, p = n.startsWith("bottom") ? "dropdown-slide-down" : "dropdown-slide-up", B = {
|
|
349
|
+
sm: "min-w-[120px] text-xs",
|
|
350
|
+
md: "min-w-[160px] text-sm",
|
|
351
|
+
lg: "min-w-[220px] text-base",
|
|
352
|
+
responsive: "min-w-[120px] sm:min-w-[160px] md:min-w-[200px] lg:min-w-[240px] text-xs sm:text-sm md:text-base"
|
|
353
|
+
}, k = {
|
|
354
|
+
sm: "px-3 py-1.5 text-xs gap-1.5",
|
|
355
|
+
md: "px-4 py-2 text-sm gap-2",
|
|
356
|
+
lg: "px-5 py-3 text-base gap-2.5",
|
|
357
|
+
responsive: "px-3 sm:px-4 md:px-5 py-1.5 sm:py-2 md:py-3 text-xs sm:text-sm md:text-base gap-1.5 sm:gap-2 md:gap-2.5"
|
|
358
|
+
}, T = "hover:bg-gray-50", P = "border-gray-200", L = "text-red-600", M = m ? { backgroundColor: m } : {}, F = m ? "" : T, j = g ? { color: g } : {}, S = g ? { backgroundColor: g + "15" } : {}, E = x || P;
|
|
359
|
+
return /* @__PURE__ */ C(
|
|
200
360
|
"div",
|
|
201
361
|
{
|
|
202
|
-
ref:
|
|
203
|
-
className: `relative inline-block ${
|
|
204
|
-
onMouseEnter:
|
|
205
|
-
onMouseLeave:
|
|
362
|
+
ref: w,
|
|
363
|
+
className: `relative inline-block ${i}`,
|
|
364
|
+
onMouseEnter: y,
|
|
365
|
+
onMouseLeave: o,
|
|
366
|
+
style: b,
|
|
206
367
|
children: [
|
|
207
368
|
/* @__PURE__ */ e(
|
|
208
369
|
"div",
|
|
209
370
|
{
|
|
210
|
-
onClick:
|
|
211
|
-
className: `inline-flex ${
|
|
371
|
+
onClick: c,
|
|
372
|
+
className: `inline-flex ${$ ? "cursor-not-allowed opacity-50" : "cursor-pointer"}`,
|
|
212
373
|
children: t
|
|
213
374
|
}
|
|
214
375
|
),
|
|
215
|
-
|
|
376
|
+
h && !$ && /* @__PURE__ */ e(
|
|
216
377
|
"div",
|
|
217
378
|
{
|
|
218
|
-
className: `absolute ${
|
|
219
|
-
children: /* @__PURE__ */ e(
|
|
379
|
+
className: `absolute ${N[n]} ${p} z-50 ${B[d]} ${u}`,
|
|
380
|
+
children: /* @__PURE__ */ e(
|
|
220
381
|
"div",
|
|
221
382
|
{
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
383
|
+
className: `dropdown-menu rounded-lg shadow-lg border py-1 overflow-hidden ${E}`,
|
|
384
|
+
style: { backgroundColor: l || "#ffffff" },
|
|
385
|
+
children: s.map((z) => {
|
|
386
|
+
let I = {};
|
|
387
|
+
return z.disabled || (z.danger ? I = {
|
|
388
|
+
...j,
|
|
389
|
+
...S
|
|
390
|
+
} : m && (I = M)), /* @__PURE__ */ C(
|
|
391
|
+
"div",
|
|
392
|
+
{
|
|
393
|
+
onClick: () => f(z),
|
|
394
|
+
className: `
|
|
395
|
+
dropdown-menu-item
|
|
396
|
+
flex items-center cursor-pointer transition-all duration-200 ease-out
|
|
397
|
+
${!u.includes("px-") && !u.includes("py-") ? k[d] : ""}
|
|
398
|
+
${z.disabled ? "opacity-50 cursor-not-allowed" : F}
|
|
399
|
+
${z.danger ? g ? "" : L : "text-gray-700"}
|
|
400
|
+
`,
|
|
401
|
+
style: I,
|
|
402
|
+
children: [
|
|
403
|
+
z.icon && /* @__PURE__ */ e("span", { className: "flex-shrink-0", children: z.icon }),
|
|
404
|
+
/* @__PURE__ */ e("span", { children: z.label })
|
|
405
|
+
]
|
|
406
|
+
},
|
|
407
|
+
z.key
|
|
408
|
+
);
|
|
409
|
+
})
|
|
410
|
+
}
|
|
411
|
+
)
|
|
236
412
|
}
|
|
237
413
|
)
|
|
238
414
|
]
|
|
239
415
|
}
|
|
240
416
|
);
|
|
241
|
-
},
|
|
417
|
+
}, G = ({
|
|
242
418
|
options: s,
|
|
243
419
|
value: a,
|
|
244
|
-
defaultValue:
|
|
420
|
+
defaultValue: n,
|
|
245
421
|
placeholder: t = "Select an option",
|
|
246
|
-
onChange:
|
|
247
|
-
disabled:
|
|
248
|
-
size:
|
|
249
|
-
fullWidth:
|
|
250
|
-
className:
|
|
422
|
+
onChange: i,
|
|
423
|
+
disabled: u = !1,
|
|
424
|
+
size: $ = "md",
|
|
425
|
+
fullWidth: d = !1,
|
|
426
|
+
className: l = "",
|
|
251
427
|
allowClear: m = !1,
|
|
252
|
-
showSearch:
|
|
253
|
-
searchPlaceholder:
|
|
428
|
+
showSearch: g = !1,
|
|
429
|
+
searchPlaceholder: x = "Search...",
|
|
430
|
+
bgColor: b,
|
|
431
|
+
borderColor: h,
|
|
432
|
+
focusBorderColor: r = "#EC615B",
|
|
433
|
+
selectedBgColor: w,
|
|
434
|
+
selectedTextColor: c,
|
|
435
|
+
hoverBgColor: y,
|
|
436
|
+
rounded: o = "lg",
|
|
437
|
+
style: f
|
|
254
438
|
}) => {
|
|
255
|
-
const [
|
|
256
|
-
|
|
257
|
-
), [
|
|
258
|
-
|
|
259
|
-
const
|
|
260
|
-
|
|
439
|
+
const [N, p] = R(!1), [B, k] = R(
|
|
440
|
+
n
|
|
441
|
+
), [T, P] = R(""), L = U(null), M = U(null), F = a !== void 0 ? a : B;
|
|
442
|
+
V(() => {
|
|
443
|
+
const v = (O) => {
|
|
444
|
+
L.current && !L.current.contains(O.target) && (p(!1), P(""));
|
|
261
445
|
};
|
|
262
|
-
return
|
|
263
|
-
document.removeEventListener("mousedown",
|
|
446
|
+
return N && (document.addEventListener("mousedown", v), g && M.current && M.current.focus()), () => {
|
|
447
|
+
document.removeEventListener("mousedown", v);
|
|
264
448
|
};
|
|
265
|
-
}, [
|
|
266
|
-
const
|
|
267
|
-
a === void 0 &&
|
|
268
|
-
},
|
|
269
|
-
|
|
270
|
-
},
|
|
271
|
-
(
|
|
272
|
-
) : s,
|
|
449
|
+
}, [N, g]);
|
|
450
|
+
const j = (v) => {
|
|
451
|
+
a === void 0 && k(v), i == null || i(v), p(!1), P("");
|
|
452
|
+
}, S = (v) => {
|
|
453
|
+
v.stopPropagation(), a === void 0 && k(void 0), i == null || i("");
|
|
454
|
+
}, E = s.find((v) => v.value === F), z = g ? s.filter(
|
|
455
|
+
(v) => v.label.toLowerCase().includes(T.toLowerCase())
|
|
456
|
+
) : s, I = {
|
|
273
457
|
sm: "px-3 py-1.5 text-sm",
|
|
274
458
|
md: "px-4 py-2 text-base",
|
|
275
|
-
lg: "px-5 py-3 text-lg"
|
|
276
|
-
|
|
459
|
+
lg: "px-5 py-3 text-lg",
|
|
460
|
+
responsive: "px-3 sm:px-4 md:px-5 py-1.5 sm:py-2 md:py-3 text-sm sm:text-base md:text-lg"
|
|
461
|
+
}, A = {
|
|
462
|
+
none: "rounded-none",
|
|
463
|
+
sm: "rounded-sm",
|
|
464
|
+
md: "rounded-md",
|
|
465
|
+
lg: "rounded-lg",
|
|
466
|
+
full: "rounded-full"
|
|
467
|
+
}, W = d ? "w-full" : "min-w-[200px]", D = () => {
|
|
468
|
+
const v = {};
|
|
469
|
+
return b && (v.backgroundColor = b), h && (v.borderColor = h), v;
|
|
470
|
+
}, H = () => {
|
|
471
|
+
const v = {};
|
|
472
|
+
return w && (v.backgroundColor = w), c && (v.color = c), v;
|
|
473
|
+
}, Q = /* @__PURE__ */ e(
|
|
277
474
|
"svg",
|
|
278
475
|
{
|
|
279
|
-
className: `w-4 h-4 transition-transform duration-200 ease-out ${
|
|
476
|
+
className: `w-4 h-4 transition-transform duration-200 ease-out ${N ? "rotate-180" : ""}`,
|
|
280
477
|
fill: "none",
|
|
281
478
|
stroke: "currentColor",
|
|
282
479
|
viewBox: "0 0 24 24",
|
|
283
480
|
children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" })
|
|
284
481
|
}
|
|
285
|
-
),
|
|
286
|
-
return /* @__PURE__ */
|
|
287
|
-
/* @__PURE__ */
|
|
482
|
+
), q = /* @__PURE__ */ e("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) });
|
|
483
|
+
return /* @__PURE__ */ C("div", { ref: L, className: `relative inline-block ${W}`, style: f, children: [
|
|
484
|
+
/* @__PURE__ */ C(
|
|
288
485
|
"div",
|
|
289
486
|
{
|
|
290
|
-
onClick: () => !
|
|
487
|
+
onClick: () => !u && p(!N),
|
|
291
488
|
className: `
|
|
292
489
|
select-trigger
|
|
293
490
|
flex items-center justify-between gap-2
|
|
294
|
-
border
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
${
|
|
298
|
-
${
|
|
299
|
-
${l
|
|
491
|
+
border transition-all duration-200 ease-out
|
|
492
|
+
${!l.includes("px-") && !l.includes("py-") && !l.includes("h-") ? I[$] : ""}
|
|
493
|
+
${l.includes("rounded") ? "" : A[o]}
|
|
494
|
+
${u ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}
|
|
495
|
+
${N ? "ring-2 ring-opacity-20" : ""}
|
|
496
|
+
${l}
|
|
300
497
|
`,
|
|
498
|
+
style: {
|
|
499
|
+
...D(),
|
|
500
|
+
backgroundColor: b || D().backgroundColor || "#FFFFFF",
|
|
501
|
+
borderColor: h || D().borderColor || "#D1D5DB",
|
|
502
|
+
...N && {
|
|
503
|
+
borderColor: r,
|
|
504
|
+
boxShadow: `0 0 0 2px ${r}20`
|
|
505
|
+
},
|
|
506
|
+
...!u && !N && y && {
|
|
507
|
+
cursor: "pointer"
|
|
508
|
+
}
|
|
509
|
+
},
|
|
510
|
+
onMouseEnter: (v) => {
|
|
511
|
+
!u && y && (v.currentTarget.style.backgroundColor = y);
|
|
512
|
+
},
|
|
513
|
+
onMouseLeave: (v) => {
|
|
514
|
+
b ? v.currentTarget.style.backgroundColor = b : v.currentTarget.style.backgroundColor = "#FFFFFF";
|
|
515
|
+
},
|
|
301
516
|
children: [
|
|
302
|
-
/* @__PURE__ */ e("span", { className:
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
m &&
|
|
517
|
+
/* @__PURE__ */ e("span", { className: E ? "text-gray-900" : "text-gray-400", children: E ? E.label : t }),
|
|
518
|
+
/* @__PURE__ */ C("div", { className: "flex items-center gap-1", children: [
|
|
519
|
+
m && F && !u && /* @__PURE__ */ e(
|
|
305
520
|
"span",
|
|
306
521
|
{
|
|
307
|
-
onClick:
|
|
522
|
+
onClick: S,
|
|
308
523
|
className: "text-gray-400 hover:text-gray-600 transition-colors duration-200 ease-out",
|
|
309
|
-
children:
|
|
524
|
+
children: q
|
|
310
525
|
}
|
|
311
526
|
),
|
|
312
|
-
/* @__PURE__ */ e("span", { className: "text-gray-400", children:
|
|
527
|
+
/* @__PURE__ */ e("span", { className: "text-gray-400", children: Q })
|
|
313
528
|
] })
|
|
314
529
|
]
|
|
315
530
|
}
|
|
316
531
|
),
|
|
317
|
-
|
|
318
|
-
|
|
532
|
+
N && !u && /* @__PURE__ */ e("div", { className: "absolute top-full left-0 right-0 mt-1 z-50 dropdown-slide-down", children: /* @__PURE__ */ C("div", { className: `select-dropdown bg-white shadow-lg border border-gray-200 py-1 max-h-[300px] overflow-auto ${A[o]}`, children: [
|
|
533
|
+
g && /* @__PURE__ */ e("div", { className: "px-2 py-2 border-b border-gray-200", children: /* @__PURE__ */ e(
|
|
319
534
|
"input",
|
|
320
535
|
{
|
|
321
|
-
ref:
|
|
536
|
+
ref: M,
|
|
322
537
|
type: "text",
|
|
323
|
-
value:
|
|
324
|
-
onChange: (
|
|
325
|
-
placeholder:
|
|
326
|
-
className: "w-full px-3 py-1.5 text-sm border border-gray-300 rounded focus:outline-none focus:ring-2
|
|
327
|
-
|
|
538
|
+
value: T,
|
|
539
|
+
onChange: (v) => P(v.target.value),
|
|
540
|
+
placeholder: x,
|
|
541
|
+
className: "w-full px-3 py-1.5 text-sm border border-gray-300 rounded focus:outline-none focus:ring-2 transition-all duration-200 ease-out",
|
|
542
|
+
style: {
|
|
543
|
+
borderColor: h,
|
|
544
|
+
boxShadow: `0 0 0 2px ${r}20`
|
|
545
|
+
},
|
|
546
|
+
onClick: (v) => v.stopPropagation()
|
|
328
547
|
}
|
|
329
548
|
) }),
|
|
330
|
-
|
|
549
|
+
z.length === 0 ? /* @__PURE__ */ e("div", { className: "px-4 py-3 text-sm text-gray-500 text-center", children: "No results found" }) : z.map((v) => /* @__PURE__ */ e(
|
|
331
550
|
"div",
|
|
332
551
|
{
|
|
333
|
-
onClick: () => !
|
|
552
|
+
onClick: () => !v.disabled && j(v.value),
|
|
334
553
|
className: `
|
|
335
554
|
select-option
|
|
336
|
-
px-4 py-2 text-sm
|
|
337
|
-
${
|
|
338
|
-
${y.value === C ? "bg-[#FCEAE9] text-[#EC615B] font-medium" : "text-[#181918]"}
|
|
555
|
+
px-4 py-2 text-sm transition-all duration-200 ease-out
|
|
556
|
+
${v.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}
|
|
339
557
|
`,
|
|
340
|
-
|
|
558
|
+
style: {
|
|
559
|
+
...v.value === F ? H() : {},
|
|
560
|
+
backgroundColor: v.value === F ? w || "#FCEAE9" : void 0,
|
|
561
|
+
color: v.value === F ? c || "#EC615B" : "#181918",
|
|
562
|
+
fontWeight: v.value === F ? "medium" : void 0
|
|
563
|
+
},
|
|
564
|
+
onMouseEnter: (O) => {
|
|
565
|
+
!v.disabled && v.value !== F && (O.currentTarget.style.backgroundColor = y || "#F3F4F6");
|
|
566
|
+
},
|
|
567
|
+
onMouseLeave: (O) => {
|
|
568
|
+
v.value !== F && (O.currentTarget.style.backgroundColor = "transparent");
|
|
569
|
+
},
|
|
570
|
+
children: v.label
|
|
341
571
|
},
|
|
342
|
-
|
|
572
|
+
v.value
|
|
343
573
|
))
|
|
344
574
|
] }) })
|
|
345
575
|
] });
|
|
346
|
-
},
|
|
576
|
+
}, le = ({
|
|
347
577
|
columns: s,
|
|
348
578
|
dataSource: a,
|
|
349
|
-
rowKey:
|
|
579
|
+
rowKey: n = "id",
|
|
350
580
|
pagination: t,
|
|
351
|
-
loading:
|
|
352
|
-
onRow:
|
|
353
|
-
className:
|
|
354
|
-
bordered:
|
|
355
|
-
striped:
|
|
581
|
+
loading: i = !1,
|
|
582
|
+
onRow: u,
|
|
583
|
+
className: $ = "",
|
|
584
|
+
bordered: d = !1,
|
|
585
|
+
striped: l = !1,
|
|
586
|
+
size: m = "md",
|
|
587
|
+
headerBgColor: g,
|
|
588
|
+
headerTextColor: x,
|
|
589
|
+
rowHoverColor: b,
|
|
590
|
+
borderColor: h,
|
|
591
|
+
stripedRowColor: r,
|
|
592
|
+
rounded: w = "md",
|
|
593
|
+
style: c
|
|
356
594
|
}) => {
|
|
357
|
-
const [
|
|
595
|
+
const [y, o] = R(
|
|
358
596
|
t && typeof t == "object" && t.current || 1
|
|
359
|
-
), [
|
|
597
|
+
), [f, N] = R(
|
|
360
598
|
t && typeof t == "object" && t.pageSize || 10
|
|
361
|
-
),
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
599
|
+
), p = {
|
|
600
|
+
sm: {
|
|
601
|
+
headerPadding: "px-3 py-2",
|
|
602
|
+
headerFontSize: "text-xs",
|
|
603
|
+
rowPadding: "px-3 py-2",
|
|
604
|
+
rowFontSize: "text-xs",
|
|
605
|
+
containerRounded: "rounded-md"
|
|
606
|
+
},
|
|
607
|
+
md: {
|
|
608
|
+
headerPadding: "px-4 py-3",
|
|
609
|
+
headerFontSize: "text-xs",
|
|
610
|
+
rowPadding: "px-4 py-3",
|
|
611
|
+
rowFontSize: "text-sm",
|
|
612
|
+
containerRounded: "rounded-lg"
|
|
613
|
+
},
|
|
614
|
+
lg: {
|
|
615
|
+
headerPadding: "px-6 py-4",
|
|
616
|
+
headerFontSize: "text-sm",
|
|
617
|
+
rowPadding: "px-6 py-4",
|
|
618
|
+
rowFontSize: "text-base",
|
|
619
|
+
containerRounded: "rounded-xl"
|
|
620
|
+
},
|
|
621
|
+
responsive: {
|
|
622
|
+
headerPadding: "px-2 sm:px-3 md:px-4 py-2 sm:py-2.5 md:py-3",
|
|
623
|
+
headerFontSize: "text-xs sm:text-xs md:text-sm",
|
|
624
|
+
rowPadding: "px-2 sm:px-3 md:px-4 py-2 sm:py-2.5 md:py-3",
|
|
625
|
+
rowFontSize: "text-xs sm:text-xs md:text-sm",
|
|
626
|
+
containerRounded: "rounded-md sm:rounded-lg md:rounded-lg"
|
|
627
|
+
}
|
|
628
|
+
}, B = {
|
|
629
|
+
none: "",
|
|
630
|
+
sm: "rounded-sm",
|
|
631
|
+
md: "rounded-md",
|
|
632
|
+
lg: "rounded-lg",
|
|
633
|
+
xl: "rounded-xl",
|
|
634
|
+
"2xl": "rounded-2xl"
|
|
635
|
+
}, k = p[m], T = B[w], P = (S, E) => typeof n == "function" ? n(S) : S[n] || String(E), L = (S, E) => E ? E.split(".").reduce((z, I) => z == null ? void 0 : z[I], S) : S, M = t === !1 ? a : a.slice((y - 1) * f, y * f), F = (S) => {
|
|
636
|
+
o(S), t && typeof t == "object" && t.onChange && t.onChange(S, f);
|
|
637
|
+
}, j = (S) => {
|
|
638
|
+
N(S), o(1), t && typeof t == "object" && t.onChange && t.onChange(1, S);
|
|
365
639
|
};
|
|
366
|
-
return /* @__PURE__ */
|
|
367
|
-
/* @__PURE__ */ e(
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
{
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
383
|
-
fill: "none",
|
|
384
|
-
viewBox: "0 0 24 24",
|
|
385
|
-
children: [
|
|
386
|
-
/* @__PURE__ */ e(
|
|
387
|
-
"circle",
|
|
640
|
+
return /* @__PURE__ */ C("div", { className: "w-full", style: c, children: [
|
|
641
|
+
/* @__PURE__ */ e(
|
|
642
|
+
"div",
|
|
643
|
+
{
|
|
644
|
+
className: `overflow-x-auto ${T || "rounded-2xl"} border`,
|
|
645
|
+
style: { borderColor: h || "#EEEEEE" },
|
|
646
|
+
children: /* @__PURE__ */ C("table", { className: `w-full ${d ? "border-collapse" : ""} ${$}`, children: [
|
|
647
|
+
/* @__PURE__ */ e(
|
|
648
|
+
"thead",
|
|
649
|
+
{
|
|
650
|
+
style: {
|
|
651
|
+
backgroundColor: g || "#F5F6F7",
|
|
652
|
+
color: x || "#333333"
|
|
653
|
+
},
|
|
654
|
+
children: /* @__PURE__ */ e("tr", { children: s.map((S, E) => /* @__PURE__ */ e(
|
|
655
|
+
"th",
|
|
388
656
|
{
|
|
389
|
-
className: "
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
657
|
+
className: `${k.headerPadding} text-left ${k.headerFontSize} font-medium uppercase tracking-wider ${d && E !== s.length - 1 ? "border-r" : ""} ${S.align === "center" ? "text-center" : S.align === "right" ? "text-right" : ""}`,
|
|
658
|
+
style: {
|
|
659
|
+
width: S.width,
|
|
660
|
+
borderColor: h || "#EEEEEE",
|
|
661
|
+
color: x || "#333333"
|
|
662
|
+
},
|
|
663
|
+
children: S.title
|
|
664
|
+
},
|
|
665
|
+
S.key
|
|
666
|
+
)) })
|
|
667
|
+
}
|
|
668
|
+
),
|
|
669
|
+
/* @__PURE__ */ e(
|
|
670
|
+
"tbody",
|
|
671
|
+
{
|
|
672
|
+
className: "bg-white divide-y",
|
|
673
|
+
style: { borderColor: h || "#e5e5e5" },
|
|
674
|
+
children: i ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
|
|
675
|
+
"td",
|
|
399
676
|
{
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
677
|
+
colSpan: s.length,
|
|
678
|
+
className: `${k.rowPadding} py-8 text-center`,
|
|
679
|
+
style: { color: "#333333" },
|
|
680
|
+
children: /* @__PURE__ */ C("div", { className: "flex justify-center items-center", children: [
|
|
681
|
+
/* @__PURE__ */ C(
|
|
682
|
+
"svg",
|
|
683
|
+
{
|
|
684
|
+
className: "animate-spin h-5 w-5 mr-2",
|
|
685
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
686
|
+
fill: "none",
|
|
687
|
+
viewBox: "0 0 24 24",
|
|
688
|
+
children: [
|
|
689
|
+
/* @__PURE__ */ e(
|
|
690
|
+
"circle",
|
|
691
|
+
{
|
|
692
|
+
className: "opacity-25",
|
|
693
|
+
cx: "12",
|
|
694
|
+
cy: "12",
|
|
695
|
+
r: "10",
|
|
696
|
+
stroke: "currentColor",
|
|
697
|
+
strokeWidth: "4"
|
|
698
|
+
}
|
|
699
|
+
),
|
|
700
|
+
/* @__PURE__ */ e(
|
|
701
|
+
"path",
|
|
702
|
+
{
|
|
703
|
+
className: "opacity-75",
|
|
704
|
+
fill: "currentColor",
|
|
705
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
706
|
+
}
|
|
707
|
+
)
|
|
708
|
+
]
|
|
709
|
+
}
|
|
710
|
+
),
|
|
711
|
+
"Loading..."
|
|
712
|
+
] })
|
|
403
713
|
}
|
|
404
|
-
)
|
|
405
|
-
]
|
|
406
|
-
}
|
|
407
|
-
),
|
|
408
|
-
"Loading..."
|
|
409
|
-
] }) }) }) : b.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: s.length, className: "px-4 py-8 text-center text-[#333333]", children: "No data" }) }) : b.map((x, w) => {
|
|
410
|
-
const C = d ? d(x, w) : {};
|
|
411
|
-
return /* @__PURE__ */ e(
|
|
412
|
-
"tr",
|
|
413
|
-
{
|
|
414
|
-
className: `${h && w % 2 === 1 ? "bg-[#F5F6F7]" : ""} hover:bg-gray-50 transition-colors duration-200 ease-out`,
|
|
415
|
-
...C,
|
|
416
|
-
children: s.map(($, E) => {
|
|
417
|
-
const L = r(x, $.dataIndex), B = $.render ? $.render(L, x, w) : L;
|
|
418
|
-
return /* @__PURE__ */ e(
|
|
714
|
+
) }) : M.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
|
|
419
715
|
"td",
|
|
420
716
|
{
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
717
|
+
colSpan: s.length,
|
|
718
|
+
className: `${k.rowPadding} py-8 text-center`,
|
|
719
|
+
style: { color: "#333333" },
|
|
720
|
+
children: "No data"
|
|
721
|
+
}
|
|
722
|
+
) }) : M.map((S, E) => {
|
|
723
|
+
const z = u ? u(S, E) : {}, I = l && E % 2 === 1 ? r || "#F5F6F7" : "transparent", A = b || "#f3f4f6";
|
|
724
|
+
return /* @__PURE__ */ e(
|
|
725
|
+
"tr",
|
|
726
|
+
{
|
|
727
|
+
className: "transition-colors duration-200 ease-out",
|
|
728
|
+
style: {
|
|
729
|
+
backgroundColor: I
|
|
730
|
+
},
|
|
731
|
+
onMouseEnter: (W) => {
|
|
732
|
+
(b || !l || E % 2 === 0) && (W.currentTarget.style.backgroundColor = A);
|
|
733
|
+
},
|
|
734
|
+
onMouseLeave: (W) => {
|
|
735
|
+
W.currentTarget.style.backgroundColor = I;
|
|
736
|
+
},
|
|
737
|
+
...z,
|
|
738
|
+
children: s.map((W, D) => {
|
|
739
|
+
const H = L(S, W.dataIndex), Q = W.render ? W.render(H, S, E) : H;
|
|
740
|
+
return /* @__PURE__ */ e(
|
|
741
|
+
"td",
|
|
742
|
+
{
|
|
743
|
+
className: `${k.rowPadding} ${k.rowFontSize} text-gray-900 ${d && D !== s.length - 1 ? "border-r" : ""} ${W.align === "center" ? "text-center" : W.align === "right" ? "text-right" : ""}`,
|
|
744
|
+
style: {
|
|
745
|
+
borderColor: h || "#EEEEEE"
|
|
746
|
+
},
|
|
747
|
+
children: Q
|
|
748
|
+
},
|
|
749
|
+
W.key
|
|
750
|
+
);
|
|
751
|
+
})
|
|
752
|
+
},
|
|
753
|
+
P(S, E)
|
|
754
|
+
);
|
|
755
|
+
})
|
|
756
|
+
}
|
|
757
|
+
)
|
|
758
|
+
] })
|
|
759
|
+
}
|
|
760
|
+
),
|
|
432
761
|
t !== !1 && /* @__PURE__ */ e(
|
|
433
|
-
|
|
762
|
+
J,
|
|
434
763
|
{
|
|
435
|
-
current:
|
|
436
|
-
pageSize:
|
|
764
|
+
current: y,
|
|
765
|
+
pageSize: f,
|
|
437
766
|
total: a.length,
|
|
438
|
-
onChange:
|
|
439
|
-
onPageSizeChange:
|
|
767
|
+
onChange: F,
|
|
768
|
+
onPageSizeChange: j,
|
|
440
769
|
showSizeChanger: t && typeof t == "object" ? t.showSizeChanger : !0,
|
|
441
770
|
pageSizeOptions: t && typeof t == "object" ? t.pageSizeOptions : [10, 20, 50, 100],
|
|
442
771
|
showTotal: t && typeof t == "object" ? t.showTotal : !0,
|
|
443
|
-
size: t && typeof t == "object" ? t.size : "md"
|
|
772
|
+
size: t && typeof t == "object" && t.size ? t.size : m === "responsive" ? "md" : m
|
|
444
773
|
}
|
|
445
774
|
)
|
|
446
775
|
] });
|
|
447
|
-
},
|
|
776
|
+
}, J = ({
|
|
448
777
|
current: s,
|
|
449
778
|
pageSize: a,
|
|
450
|
-
total:
|
|
779
|
+
total: n,
|
|
451
780
|
onChange: t,
|
|
452
|
-
onPageSizeChange:
|
|
453
|
-
showSizeChanger:
|
|
454
|
-
pageSizeOptions:
|
|
455
|
-
showTotal:
|
|
456
|
-
size:
|
|
781
|
+
onPageSizeChange: i,
|
|
782
|
+
showSizeChanger: u = !0,
|
|
783
|
+
pageSizeOptions: $ = [10, 20, 50, 100],
|
|
784
|
+
showTotal: d = !0,
|
|
785
|
+
size: l = "md"
|
|
457
786
|
}) => {
|
|
458
|
-
const m = Math.ceil(
|
|
787
|
+
const m = Math.ceil(n / a), g = (s - 1) * a + 1, x = Math.min(s * a, n), b = {
|
|
459
788
|
sm: {
|
|
460
789
|
button: "px-2.5 py-1 text-xs",
|
|
461
790
|
icon: "h-3.5 w-3.5",
|
|
@@ -471,40 +800,40 @@ const D = ({
|
|
|
471
800
|
icon: "h-6 w-6",
|
|
472
801
|
nav: "px-3 py-3"
|
|
473
802
|
}
|
|
474
|
-
},
|
|
803
|
+
}, h = () => {
|
|
475
804
|
const r = [];
|
|
476
805
|
if (m <= 7)
|
|
477
|
-
for (let
|
|
478
|
-
r.push(
|
|
806
|
+
for (let c = 1; c <= m; c++)
|
|
807
|
+
r.push(c);
|
|
479
808
|
else if (s <= 3) {
|
|
480
|
-
for (let
|
|
809
|
+
for (let c = 1; c <= 5; c++) r.push(c);
|
|
481
810
|
r.push("..."), r.push(m);
|
|
482
811
|
} else if (s >= m - 2) {
|
|
483
812
|
r.push(1), r.push("...");
|
|
484
|
-
for (let
|
|
813
|
+
for (let c = m - 4; c <= m; c++) r.push(c);
|
|
485
814
|
} else {
|
|
486
815
|
r.push(1), r.push("...");
|
|
487
|
-
for (let
|
|
816
|
+
for (let c = s - 1; c <= s + 1; c++) r.push(c);
|
|
488
817
|
r.push("..."), r.push(m);
|
|
489
818
|
}
|
|
490
819
|
return r;
|
|
491
820
|
};
|
|
492
|
-
return /* @__PURE__ */
|
|
493
|
-
|
|
494
|
-
|
|
821
|
+
return /* @__PURE__ */ C("div", { className: "flex items-center justify-between px-4 py-3 border-t border-[#EEEEEE] sm:px-6 mt-4", children: [
|
|
822
|
+
d && /* @__PURE__ */ C("div", { className: "text-sm text-[#181918]", children: [
|
|
823
|
+
g,
|
|
495
824
|
"-",
|
|
496
|
-
|
|
825
|
+
x,
|
|
497
826
|
" of ",
|
|
498
|
-
|
|
827
|
+
n,
|
|
499
828
|
" items"
|
|
500
829
|
] }),
|
|
501
|
-
/* @__PURE__ */
|
|
502
|
-
|
|
503
|
-
|
|
830
|
+
/* @__PURE__ */ C("div", { className: "flex items-center gap-2", children: [
|
|
831
|
+
u && /* @__PURE__ */ e(
|
|
832
|
+
G,
|
|
504
833
|
{
|
|
505
834
|
value: a.toString(),
|
|
506
|
-
onChange: (r) =>
|
|
507
|
-
options:
|
|
835
|
+
onChange: (r) => i(Number(r)),
|
|
836
|
+
options: $.map((r) => ({
|
|
508
837
|
value: r.toString(),
|
|
509
838
|
label: `${r} / page`
|
|
510
839
|
})),
|
|
@@ -512,14 +841,14 @@ const D = ({
|
|
|
512
841
|
className: "w-32"
|
|
513
842
|
}
|
|
514
843
|
),
|
|
515
|
-
/* @__PURE__ */
|
|
844
|
+
/* @__PURE__ */ C("nav", { className: "inline-flex gap-1 items-center", "aria-label": "Pagination", children: [
|
|
516
845
|
/* @__PURE__ */ e(
|
|
517
846
|
"button",
|
|
518
847
|
{
|
|
519
848
|
onClick: () => t(s - 1),
|
|
520
849
|
disabled: s === 1,
|
|
521
|
-
className: `relative inline-flex items-center justify-center rounded-md ${l
|
|
522
|
-
children: /* @__PURE__ */ e("svg", { className: l
|
|
850
|
+
className: `relative inline-flex items-center justify-center rounded-md ${b[l].nav} text-[#181918] hover:bg-gray-100 focus:z-20 disabled:opacity-30 disabled:cursor-not-allowed disabled:hover:bg-transparent transition-all duration-300 ease-out hover:scale-110 active:scale-95`,
|
|
851
|
+
children: /* @__PURE__ */ e("svg", { className: b[l].icon, viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
523
852
|
"path",
|
|
524
853
|
{
|
|
525
854
|
strokeLinecap: "round",
|
|
@@ -530,18 +859,18 @@ const D = ({
|
|
|
530
859
|
) })
|
|
531
860
|
}
|
|
532
861
|
),
|
|
533
|
-
|
|
862
|
+
h().map((r, w) => r === "..." ? /* @__PURE__ */ e(
|
|
534
863
|
"span",
|
|
535
864
|
{
|
|
536
|
-
className: `relative inline-flex items-center justify-center ${l
|
|
865
|
+
className: `relative inline-flex items-center justify-center ${b[l].button} font-normal text-[#181918]`,
|
|
537
866
|
children: "..."
|
|
538
867
|
},
|
|
539
|
-
`ellipsis-${
|
|
868
|
+
`ellipsis-${w}`
|
|
540
869
|
) : /* @__PURE__ */ e(
|
|
541
870
|
"button",
|
|
542
871
|
{
|
|
543
872
|
onClick: () => t(r),
|
|
544
|
-
className: `relative inline-flex items-center justify-center rounded-md ${l
|
|
873
|
+
className: `relative inline-flex items-center justify-center rounded-md ${b[l].button} font-medium transition-all duration-300 ease-out focus:z-20 hover:scale-105 active:scale-95 ${s === r ? "bg-[#EC615B] text-white shadow-sm" : "text-[#181918] hover:bg-gray-100"}`,
|
|
545
874
|
children: r
|
|
546
875
|
},
|
|
547
876
|
r
|
|
@@ -551,8 +880,8 @@ const D = ({
|
|
|
551
880
|
{
|
|
552
881
|
onClick: () => t(s + 1),
|
|
553
882
|
disabled: s === m,
|
|
554
|
-
className: `relative inline-flex items-center justify-center rounded-md ${l
|
|
555
|
-
children: /* @__PURE__ */ e("svg", { className: l
|
|
883
|
+
className: `relative inline-flex items-center justify-center rounded-md ${b[l].nav} text-[#181918] hover:bg-gray-100 focus:z-20 disabled:opacity-30 disabled:cursor-not-allowed disabled:hover:bg-transparent transition-all duration-300 ease-out hover:scale-110 active:scale-95`,
|
|
884
|
+
children: /* @__PURE__ */ e("svg", { className: b[l].icon, viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
556
885
|
"path",
|
|
557
886
|
{
|
|
558
887
|
strokeLinecap: "round",
|
|
@@ -566,158 +895,297 @@ const D = ({
|
|
|
566
895
|
] })
|
|
567
896
|
] })
|
|
568
897
|
] });
|
|
569
|
-
},
|
|
898
|
+
}, oe = ({
|
|
570
899
|
title: s,
|
|
571
900
|
description: a,
|
|
572
|
-
searchPlaceholder:
|
|
901
|
+
searchPlaceholder: n = "Search...",
|
|
573
902
|
onSearch: t,
|
|
574
|
-
actions:
|
|
575
|
-
filters:
|
|
576
|
-
className:
|
|
903
|
+
actions: i,
|
|
904
|
+
filters: u,
|
|
905
|
+
className: $ = "",
|
|
906
|
+
size: d = "responsive",
|
|
907
|
+
titleColor: l,
|
|
908
|
+
descriptionColor: m,
|
|
909
|
+
searchBgColor: g = "white",
|
|
910
|
+
searchBorderColor: x = "#d1d5db",
|
|
911
|
+
searchFocusBorderColor: b = "#3b82f6",
|
|
912
|
+
rounded: h = "md",
|
|
913
|
+
style: r
|
|
577
914
|
}) => {
|
|
578
|
-
const
|
|
579
|
-
t == null || t(
|
|
915
|
+
const w = (p) => {
|
|
916
|
+
t == null || t(p.target.value);
|
|
917
|
+
}, y = {
|
|
918
|
+
sm: {
|
|
919
|
+
titleSize: "text-lg",
|
|
920
|
+
titleWeight: "font-semibold",
|
|
921
|
+
descriptionSize: "text-xs",
|
|
922
|
+
searchInputSize: "text-xs",
|
|
923
|
+
searchInputPy: "py-1.5",
|
|
924
|
+
searchPaddingLeft: "pl-8",
|
|
925
|
+
iconSize: "h-4 w-4",
|
|
926
|
+
spacing: "space-y-2",
|
|
927
|
+
gap: "gap-2",
|
|
928
|
+
maxWidth: "max-w-sm",
|
|
929
|
+
descriptionMargin: "mt-0.5"
|
|
930
|
+
},
|
|
931
|
+
md: {
|
|
932
|
+
titleSize: "text-xl",
|
|
933
|
+
titleWeight: "font-semibold",
|
|
934
|
+
descriptionSize: "text-sm",
|
|
935
|
+
searchInputSize: "text-sm",
|
|
936
|
+
searchInputPy: "py-2",
|
|
937
|
+
searchPaddingLeft: "pl-10",
|
|
938
|
+
iconSize: "h-5 w-5",
|
|
939
|
+
spacing: "space-y-3",
|
|
940
|
+
gap: "gap-3",
|
|
941
|
+
maxWidth: "max-w-md",
|
|
942
|
+
descriptionMargin: "mt-1"
|
|
943
|
+
},
|
|
944
|
+
lg: {
|
|
945
|
+
titleSize: "text-2xl",
|
|
946
|
+
titleWeight: "font-bold",
|
|
947
|
+
descriptionSize: "text-base",
|
|
948
|
+
searchInputSize: "text-base",
|
|
949
|
+
searchInputPy: "py-2.5",
|
|
950
|
+
searchPaddingLeft: "pl-12",
|
|
951
|
+
iconSize: "h-6 w-6",
|
|
952
|
+
spacing: "space-y-4",
|
|
953
|
+
gap: "gap-4",
|
|
954
|
+
maxWidth: "max-w-lg",
|
|
955
|
+
descriptionMargin: "mt-2"
|
|
956
|
+
},
|
|
957
|
+
responsive: {
|
|
958
|
+
titleSize: "text-lg sm:text-xl md:text-2xl",
|
|
959
|
+
titleWeight: "font-semibold md:font-bold",
|
|
960
|
+
descriptionSize: "text-xs sm:text-sm md:text-base",
|
|
961
|
+
searchInputSize: "text-xs sm:text-sm md:text-base",
|
|
962
|
+
searchInputPy: "py-1.5 sm:py-2 md:py-2.5",
|
|
963
|
+
searchPaddingLeft: "pl-8 sm:pl-10 md:pl-12",
|
|
964
|
+
iconSize: "h-4 w-4 sm:h-5 sm:w-5 md:h-6 md:w-6",
|
|
965
|
+
spacing: "space-y-2 sm:space-y-3 md:space-y-4",
|
|
966
|
+
gap: "gap-2 sm:gap-3 md:gap-4",
|
|
967
|
+
maxWidth: "max-w-sm md:max-w-md lg:max-w-lg",
|
|
968
|
+
descriptionMargin: "mt-0.5 sm:mt-1 md:mt-2"
|
|
969
|
+
}
|
|
970
|
+
}[d], f = {
|
|
971
|
+
none: "rounded-none",
|
|
972
|
+
sm: "rounded-sm",
|
|
973
|
+
md: "rounded-md",
|
|
974
|
+
lg: "rounded-lg",
|
|
975
|
+
full: "rounded-full"
|
|
976
|
+
}[h], N = {
|
|
977
|
+
backgroundColor: g,
|
|
978
|
+
borderColor: x
|
|
580
979
|
};
|
|
581
|
-
return /* @__PURE__ */
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
980
|
+
return /* @__PURE__ */ C(
|
|
981
|
+
"div",
|
|
982
|
+
{
|
|
983
|
+
className: `${y.spacing} mb-4 ${$}`,
|
|
984
|
+
style: r,
|
|
985
|
+
children: [
|
|
986
|
+
(s || a) && /* @__PURE__ */ C("div", { children: [
|
|
987
|
+
s && /* @__PURE__ */ e(
|
|
988
|
+
"h2",
|
|
989
|
+
{
|
|
990
|
+
className: `${y.titleSize} ${y.titleWeight}`,
|
|
991
|
+
style: { color: l || "#111827" },
|
|
992
|
+
children: s
|
|
993
|
+
}
|
|
994
|
+
),
|
|
995
|
+
a && /* @__PURE__ */ e(
|
|
996
|
+
"p",
|
|
997
|
+
{
|
|
998
|
+
className: `${y.descriptionSize} ${y.descriptionMargin}`,
|
|
999
|
+
style: { color: m || "#6b7280" },
|
|
1000
|
+
children: a
|
|
1001
|
+
}
|
|
1002
|
+
)
|
|
1003
|
+
] }),
|
|
1004
|
+
/* @__PURE__ */ C("div", { className: `flex flex-col sm:flex-row items-stretch sm:items-center justify-between ${y.gap}`, children: [
|
|
1005
|
+
t && /* @__PURE__ */ e("div", { className: `flex-1 ${y.maxWidth}`, children: /* @__PURE__ */ C("div", { className: "relative", children: [
|
|
1006
|
+
/* @__PURE__ */ e("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none", children: /* @__PURE__ */ e(
|
|
1007
|
+
"svg",
|
|
597
1008
|
{
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
1009
|
+
className: `${y.iconSize} text-gray-400`,
|
|
1010
|
+
fill: "none",
|
|
1011
|
+
stroke: "currentColor",
|
|
1012
|
+
viewBox: "0 0 24 24",
|
|
1013
|
+
children: /* @__PURE__ */ e(
|
|
1014
|
+
"path",
|
|
1015
|
+
{
|
|
1016
|
+
strokeLinecap: "round",
|
|
1017
|
+
strokeLinejoin: "round",
|
|
1018
|
+
strokeWidth: 2,
|
|
1019
|
+
d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
|
|
1020
|
+
}
|
|
1021
|
+
)
|
|
1022
|
+
}
|
|
1023
|
+
) }),
|
|
1024
|
+
/* @__PURE__ */ e(
|
|
1025
|
+
"input",
|
|
1026
|
+
{
|
|
1027
|
+
type: "text",
|
|
1028
|
+
placeholder: n,
|
|
1029
|
+
onChange: w,
|
|
1030
|
+
className: `block w-full ${y.searchPaddingLeft} pr-3 ${y.searchInputPy} border ${f} focus:outline-none focus:ring-2 focus:ring-opacity-50 ${y.searchInputSize} transition-colors duration-200`,
|
|
1031
|
+
style: N,
|
|
1032
|
+
onFocus: (p) => {
|
|
1033
|
+
p.currentTarget.style.borderColor = b, p.currentTarget.style.boxShadow = "0 0 0 2px rgba(59, 130, 246, 0.1)";
|
|
1034
|
+
},
|
|
1035
|
+
onBlur: (p) => {
|
|
1036
|
+
p.currentTarget.style.borderColor = x, p.currentTarget.style.boxShadow = "none";
|
|
1037
|
+
}
|
|
602
1038
|
}
|
|
603
1039
|
)
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
] });
|
|
620
|
-
}, J = ({
|
|
1040
|
+
] }) }),
|
|
1041
|
+
i && /* @__PURE__ */ e("div", { className: "flex items-center gap-2 w-full sm:w-auto", children: i })
|
|
1042
|
+
] }),
|
|
1043
|
+
u && /* @__PURE__ */ e("div", { className: `flex flex-wrap items-center ${y.gap}`, children: u })
|
|
1044
|
+
]
|
|
1045
|
+
}
|
|
1046
|
+
);
|
|
1047
|
+
}, X = {
|
|
1048
|
+
sm: "384px",
|
|
1049
|
+
md: "448px",
|
|
1050
|
+
lg: "512px",
|
|
1051
|
+
xl: "600px",
|
|
1052
|
+
full: "100%",
|
|
1053
|
+
responsive: "90vw"
|
|
1054
|
+
}, ae = ({
|
|
621
1055
|
open: s,
|
|
622
1056
|
onClose: a,
|
|
623
|
-
title:
|
|
1057
|
+
title: n,
|
|
624
1058
|
children: t,
|
|
625
|
-
footer:
|
|
626
|
-
width:
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
1059
|
+
footer: i,
|
|
1060
|
+
width: u,
|
|
1061
|
+
size: $ = "md",
|
|
1062
|
+
closable: d = !0,
|
|
1063
|
+
maskClosable: l = !0,
|
|
1064
|
+
centered: m = !0,
|
|
1065
|
+
className: g = "",
|
|
1066
|
+
bgColor: x = "#ffffff",
|
|
1067
|
+
headerBgColor: b = "#ffffff",
|
|
1068
|
+
overlayColor: h = "rgba(0, 0, 0, 0.5)",
|
|
1069
|
+
bodyClassName: r = "",
|
|
1070
|
+
headerClassName: w = "",
|
|
1071
|
+
maxHeight: c = "70vh"
|
|
631
1072
|
}) => {
|
|
632
|
-
const [
|
|
633
|
-
|
|
1073
|
+
const [y, o] = R(!1), [f, N] = R(!1), p = u || X[$], k = {
|
|
1074
|
+
width: typeof p == "number" ? `${p}px` : p,
|
|
1075
|
+
maxWidth: "90vw",
|
|
1076
|
+
backgroundColor: x
|
|
1077
|
+
}, T = {
|
|
1078
|
+
backgroundColor: b
|
|
1079
|
+
}, P = {
|
|
1080
|
+
backgroundColor: h
|
|
1081
|
+
};
|
|
1082
|
+
if (V(() => {
|
|
634
1083
|
if (s)
|
|
635
|
-
|
|
1084
|
+
o(!0), setTimeout(() => N(!0), 10), document.body.style.overflow = "hidden";
|
|
636
1085
|
else {
|
|
637
|
-
|
|
638
|
-
const
|
|
639
|
-
|
|
1086
|
+
N(!1);
|
|
1087
|
+
const F = setTimeout(() => {
|
|
1088
|
+
o(!1);
|
|
640
1089
|
}, 200);
|
|
641
|
-
return document.body.style.overflow = "unset", () => clearTimeout(
|
|
1090
|
+
return document.body.style.overflow = "unset", () => clearTimeout(F);
|
|
642
1091
|
}
|
|
643
|
-
}, [s]),
|
|
644
|
-
const
|
|
645
|
-
|
|
1092
|
+
}, [s]), V(() => {
|
|
1093
|
+
const F = (j) => {
|
|
1094
|
+
j.key === "Escape" && d && s && a();
|
|
646
1095
|
};
|
|
647
|
-
return s && document.addEventListener("keydown",
|
|
648
|
-
document.removeEventListener("keydown",
|
|
1096
|
+
return s && document.addEventListener("keydown", F), () => {
|
|
1097
|
+
document.removeEventListener("keydown", F);
|
|
649
1098
|
};
|
|
650
|
-
}, [s, a,
|
|
651
|
-
const
|
|
652
|
-
|
|
653
|
-
},
|
|
654
|
-
|
|
1099
|
+
}, [s, a, d]), !y) return null;
|
|
1100
|
+
const L = () => {
|
|
1101
|
+
l && a();
|
|
1102
|
+
}, M = (F) => {
|
|
1103
|
+
F.stopPropagation();
|
|
655
1104
|
};
|
|
656
|
-
return /* @__PURE__ */
|
|
1105
|
+
return /* @__PURE__ */ C(
|
|
657
1106
|
"div",
|
|
658
1107
|
{
|
|
659
1108
|
className: "fixed inset-0 z-50 overflow-y-auto",
|
|
660
|
-
onClick:
|
|
1109
|
+
onClick: L,
|
|
661
1110
|
children: [
|
|
662
1111
|
/* @__PURE__ */ e(
|
|
663
1112
|
"div",
|
|
664
1113
|
{
|
|
665
|
-
className: `fixed inset-0
|
|
1114
|
+
className: `fixed inset-0 transition-opacity duration-200 ease-out ${f ? "opacity-100" : "opacity-0"}`,
|
|
1115
|
+
style: P
|
|
666
1116
|
}
|
|
667
1117
|
),
|
|
668
|
-
/* @__PURE__ */ e("div", { className: `flex min-h-full items-center justify-center p-4 ${
|
|
1118
|
+
/* @__PURE__ */ e("div", { className: `flex min-h-full items-center justify-center p-4 ${m ? "items-center" : "items-start pt-20"}`, children: /* @__PURE__ */ C(
|
|
669
1119
|
"div",
|
|
670
1120
|
{
|
|
671
|
-
className: `relative
|
|
672
|
-
style: {
|
|
673
|
-
onClick:
|
|
1121
|
+
className: `relative rounded-lg shadow-xl transition-all duration-200 ease-out overflow-y-auto ${f ? "opacity-100 scale-100 translate-y-0" : "opacity-0 scale-95 -translate-y-4"} ${g}`,
|
|
1122
|
+
style: { ...k, maxHeight: typeof c == "number" ? `${c}px` : c },
|
|
1123
|
+
onClick: M,
|
|
674
1124
|
children: [
|
|
675
|
-
(
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
className: "text-
|
|
682
|
-
|
|
683
|
-
"
|
|
1125
|
+
(n || d) && /* @__PURE__ */ C(
|
|
1126
|
+
"div",
|
|
1127
|
+
{
|
|
1128
|
+
className: `flex items-center justify-between px-6 py-4 border-b border-gray-200 ${w}`,
|
|
1129
|
+
style: T,
|
|
1130
|
+
children: [
|
|
1131
|
+
n && /* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-gray-900", children: n }),
|
|
1132
|
+
d && /* @__PURE__ */ e(
|
|
1133
|
+
"button",
|
|
684
1134
|
{
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
stroke: "currentColor",
|
|
688
|
-
viewBox: "0 0 24 24",
|
|
1135
|
+
onClick: a,
|
|
1136
|
+
className: "text-gray-400 hover:text-gray-600 transition-colors duration-200 ease-out",
|
|
689
1137
|
children: /* @__PURE__ */ e(
|
|
690
|
-
"
|
|
1138
|
+
"svg",
|
|
691
1139
|
{
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
1140
|
+
className: "w-5 h-5",
|
|
1141
|
+
fill: "none",
|
|
1142
|
+
stroke: "currentColor",
|
|
1143
|
+
viewBox: "0 0 24 24",
|
|
1144
|
+
children: /* @__PURE__ */ e(
|
|
1145
|
+
"path",
|
|
1146
|
+
{
|
|
1147
|
+
strokeLinecap: "round",
|
|
1148
|
+
strokeLinejoin: "round",
|
|
1149
|
+
strokeWidth: 2,
|
|
1150
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
1151
|
+
}
|
|
1152
|
+
)
|
|
696
1153
|
}
|
|
697
1154
|
)
|
|
698
1155
|
}
|
|
699
1156
|
)
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
/* @__PURE__ */ e(
|
|
704
|
-
|
|
1157
|
+
]
|
|
1158
|
+
}
|
|
1159
|
+
),
|
|
1160
|
+
/* @__PURE__ */ e(
|
|
1161
|
+
"div",
|
|
1162
|
+
{
|
|
1163
|
+
className: `px-6 py-4 ${r}`,
|
|
1164
|
+
children: t
|
|
1165
|
+
}
|
|
1166
|
+
),
|
|
1167
|
+
i && /* @__PURE__ */ e("div", { className: "px-6 py-4 border-t border-gray-200 flex justify-end gap-2", children: i })
|
|
705
1168
|
]
|
|
706
1169
|
}
|
|
707
1170
|
) })
|
|
708
1171
|
]
|
|
709
1172
|
}
|
|
710
1173
|
);
|
|
711
|
-
},
|
|
1174
|
+
}, ie = ({
|
|
712
1175
|
children: s,
|
|
713
1176
|
variant: a = "default",
|
|
714
|
-
size:
|
|
1177
|
+
size: n = "md",
|
|
715
1178
|
dot: t = !1,
|
|
716
|
-
icon:
|
|
717
|
-
iconPosition:
|
|
718
|
-
className:
|
|
1179
|
+
icon: i,
|
|
1180
|
+
iconPosition: u = "left",
|
|
1181
|
+
className: $ = "",
|
|
1182
|
+
bgColor: d,
|
|
1183
|
+
textColor: l,
|
|
1184
|
+
borderColor: m,
|
|
1185
|
+
rounded: g = "full",
|
|
1186
|
+
style: x
|
|
719
1187
|
}) => {
|
|
720
|
-
const
|
|
1188
|
+
const b = {
|
|
721
1189
|
default: "bg-gray-100 text-[#181918]",
|
|
722
1190
|
primary: "bg-[#FCEAE9] text-[#EC615B]",
|
|
723
1191
|
success: "bg-green-100 text-green-800",
|
|
@@ -727,205 +1195,248 @@ const D = ({
|
|
|
727
1195
|
}, h = {
|
|
728
1196
|
sm: "px-2 py-0.5 text-xs",
|
|
729
1197
|
md: "px-2.5 py-1 text-sm",
|
|
730
|
-
lg: "px-3 py-1.5 text-base"
|
|
731
|
-
|
|
1198
|
+
lg: "px-3 py-1.5 text-base",
|
|
1199
|
+
responsive: "px-1.5 py-0.5 text-[10px] sm:px-2 sm:py-0.5 sm:text-xs md:px-2.5 md:py-1 md:text-sm lg:px-3 lg:py-1.5 lg:text-base"
|
|
1200
|
+
}, r = {
|
|
732
1201
|
sm: "w-1.5 h-1.5",
|
|
733
1202
|
md: "w-2 h-2",
|
|
734
|
-
lg: "w-2.5 h-2.5"
|
|
735
|
-
|
|
1203
|
+
lg: "w-2.5 h-2.5",
|
|
1204
|
+
responsive: "w-1 h-1 sm:w-1.5 sm:h-1.5 md:w-2 md:h-2 lg:w-2.5 lg:h-2.5"
|
|
1205
|
+
}, w = {
|
|
736
1206
|
default: "bg-gray-600",
|
|
737
1207
|
primary: "bg-[#EC615B]",
|
|
738
1208
|
success: "bg-green-600",
|
|
739
1209
|
warning: "bg-yellow-600",
|
|
740
1210
|
danger: "bg-red-600",
|
|
741
1211
|
info: "bg-cyan-600"
|
|
742
|
-
},
|
|
1212
|
+
}, c = {
|
|
743
1213
|
sm: "w-3 h-3",
|
|
744
1214
|
md: "w-3.5 h-3.5",
|
|
745
|
-
lg: "w-4 h-4"
|
|
1215
|
+
lg: "w-4 h-4",
|
|
1216
|
+
responsive: "w-2.5 h-2.5 sm:w-3 sm:h-3 md:w-3.5 md:h-3.5 lg:w-4 lg:h-4"
|
|
1217
|
+
}, y = {
|
|
1218
|
+
none: "rounded-none",
|
|
1219
|
+
sm: "rounded-sm",
|
|
1220
|
+
md: "rounded-md",
|
|
1221
|
+
lg: "rounded-lg",
|
|
1222
|
+
full: "rounded-full"
|
|
1223
|
+
}, o = {
|
|
1224
|
+
...d && { backgroundColor: d },
|
|
1225
|
+
...l && { color: l },
|
|
1226
|
+
...m && { borderColor: m, borderWidth: "1px", borderStyle: "solid" },
|
|
1227
|
+
...x
|
|
746
1228
|
};
|
|
747
|
-
return /* @__PURE__ */
|
|
1229
|
+
return /* @__PURE__ */ C(
|
|
748
1230
|
"span",
|
|
749
1231
|
{
|
|
750
|
-
className: `inline-flex items-center gap-1.5 font-medium
|
|
1232
|
+
className: `inline-flex items-center gap-1.5 font-medium transition-all duration-200 ${d ? "" : b[a]} ${h[n]} ${y[g]} ${$}`,
|
|
1233
|
+
style: o,
|
|
751
1234
|
children: [
|
|
752
|
-
t && /* @__PURE__ */ e("span", { className: `rounded-full ${
|
|
753
|
-
|
|
1235
|
+
t && /* @__PURE__ */ e("span", { className: `rounded-full ${r[n]} ${w[a]}` }),
|
|
1236
|
+
i && u === "left" && /* @__PURE__ */ e("span", { className: `inline-flex items-center ${c[n]}`, children: i }),
|
|
754
1237
|
s,
|
|
755
|
-
|
|
1238
|
+
i && u === "right" && /* @__PURE__ */ e("span", { className: `inline-flex items-center ${c[n]}`, children: i })
|
|
756
1239
|
]
|
|
757
1240
|
}
|
|
758
1241
|
);
|
|
759
|
-
},
|
|
1242
|
+
}, de = ({
|
|
760
1243
|
items: s,
|
|
761
1244
|
current: a = 0,
|
|
762
|
-
direction:
|
|
1245
|
+
direction: n = "vertical",
|
|
763
1246
|
size: t = "md",
|
|
764
|
-
variant:
|
|
765
|
-
className:
|
|
1247
|
+
variant: i = "default",
|
|
1248
|
+
className: u = "",
|
|
1249
|
+
style: $,
|
|
1250
|
+
finishColor: d,
|
|
1251
|
+
processColor: l,
|
|
1252
|
+
waitColor: m,
|
|
1253
|
+
errorColor: g,
|
|
1254
|
+
lineColor: x
|
|
766
1255
|
}) => {
|
|
767
|
-
const
|
|
1256
|
+
const b = (o, f) => f.status ? f.status : o < a ? "finish" : o === a ? "process" : "wait", h = {
|
|
768
1257
|
sm: "w-6 h-6",
|
|
769
1258
|
md: "w-8 h-8",
|
|
770
|
-
lg: "w-10 h-10"
|
|
771
|
-
|
|
1259
|
+
lg: "w-10 h-10",
|
|
1260
|
+
responsive: "w-6 h-6 sm:w-7 sm:h-7 md:w-8 md:h-8 lg:w-10 lg:h-10"
|
|
1261
|
+
}, r = {
|
|
772
1262
|
sm: "text-sm",
|
|
773
1263
|
md: "text-base",
|
|
774
|
-
lg: "text-lg"
|
|
775
|
-
|
|
1264
|
+
lg: "text-lg",
|
|
1265
|
+
responsive: "text-xs sm:text-sm md:text-base lg:text-lg"
|
|
1266
|
+
}, w = {
|
|
776
1267
|
sm: "text-xs",
|
|
777
1268
|
md: "text-sm",
|
|
778
|
-
lg: "text-base"
|
|
779
|
-
|
|
1269
|
+
lg: "text-base",
|
|
1270
|
+
responsive: "text-xs sm:text-xs md:text-sm lg:text-base"
|
|
1271
|
+
}, c = (o, f) => f || (o === "finish" ? /* @__PURE__ */ e("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e(
|
|
780
1272
|
"path",
|
|
781
1273
|
{
|
|
782
1274
|
fillRule: "evenodd",
|
|
783
1275
|
d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
|
|
784
1276
|
clipRule: "evenodd"
|
|
785
1277
|
}
|
|
786
|
-
) }) :
|
|
1278
|
+
) }) : o === "error" ? /* @__PURE__ */ e("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e(
|
|
787
1279
|
"path",
|
|
788
1280
|
{
|
|
789
1281
|
fillRule: "evenodd",
|
|
790
1282
|
d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
|
|
791
1283
|
clipRule: "evenodd"
|
|
792
1284
|
}
|
|
793
|
-
) }) : null),
|
|
794
|
-
const
|
|
795
|
-
switch (
|
|
1285
|
+
) }) : null), y = (o) => {
|
|
1286
|
+
const f = i === "outline";
|
|
1287
|
+
switch (o) {
|
|
796
1288
|
case "finish":
|
|
797
1289
|
return {
|
|
798
|
-
icon:
|
|
1290
|
+
icon: f ? `bg-white text-white border ${d ? `border-[${d}]` : "border-green-500"}` : `${d ? `bg-[${d}]` : "bg-green-500"} text-white ${d ? `border-[${d}]` : "border-green-500"}`,
|
|
799
1291
|
title: "text-[#181918]",
|
|
800
1292
|
description: "text-gray-600",
|
|
801
|
-
line: "bg-green-500"
|
|
1293
|
+
line: x ? `bg-[${x}]` : "bg-green-500",
|
|
1294
|
+
iconColor: d
|
|
802
1295
|
};
|
|
803
1296
|
case "process":
|
|
804
1297
|
return {
|
|
805
|
-
icon:
|
|
1298
|
+
icon: f ? `bg-white text-white border ${l ? `border-[${l}]` : "border-[#EC615B]"}` : `${l ? `bg-[${l}]` : "bg-[#EC615B]"} text-white ${l ? `border-[${l}]` : "border-[#EC615B]"}`,
|
|
806
1299
|
title: "text-[#181918] font-semibold",
|
|
807
1300
|
description: "text-gray-700",
|
|
808
|
-
line: "bg-gray-300"
|
|
1301
|
+
line: x ? `bg-[${x}]` : "bg-gray-300",
|
|
1302
|
+
iconColor: l
|
|
809
1303
|
};
|
|
810
1304
|
case "error":
|
|
811
1305
|
return {
|
|
812
|
-
icon:
|
|
1306
|
+
icon: f ? `bg-white text-white border ${g ? `border-[${g}]` : "border-red-500"}` : `${g ? `bg-[${g}]` : "bg-red-500"} text-white ${g ? `border-[${g}]` : "border-red-500"}`,
|
|
813
1307
|
title: "text-red-600",
|
|
814
1308
|
description: "text-red-500",
|
|
815
|
-
line: "bg-gray-300"
|
|
1309
|
+
line: x ? `bg-[${x}]` : "bg-gray-300",
|
|
1310
|
+
iconColor: g
|
|
816
1311
|
};
|
|
817
1312
|
default:
|
|
818
1313
|
return {
|
|
819
1314
|
icon: "bg-white text-gray-400 border-gray-300",
|
|
820
1315
|
title: "text-gray-500",
|
|
821
1316
|
description: "text-gray-400",
|
|
822
|
-
line: "bg-gray-300"
|
|
1317
|
+
line: x ? `bg-[${x}]` : "bg-gray-300",
|
|
1318
|
+
iconColor: m
|
|
823
1319
|
};
|
|
824
1320
|
}
|
|
825
1321
|
};
|
|
826
|
-
return
|
|
827
|
-
const
|
|
828
|
-
return /* @__PURE__ */
|
|
829
|
-
/* @__PURE__ */
|
|
1322
|
+
return n === "horizontal" ? /* @__PURE__ */ e("div", { className: `flex items-start ${u}`, style: $, children: s.map((o, f) => {
|
|
1323
|
+
const N = b(f, o), p = y(N), B = f === s.length - 1, k = {};
|
|
1324
|
+
return p.iconColor && (k.color = p.iconColor), /* @__PURE__ */ C("div", { className: "flex flex-1 items-start", children: [
|
|
1325
|
+
/* @__PURE__ */ C("div", { className: "flex flex-col items-center", children: [
|
|
830
1326
|
/* @__PURE__ */ e(
|
|
831
1327
|
"div",
|
|
832
1328
|
{
|
|
833
|
-
className: `flex items-center justify-center ${
|
|
834
|
-
|
|
1329
|
+
className: `flex items-center justify-center ${h[t]} rounded-full border transition-all duration-300 ${p.icon}`,
|
|
1330
|
+
style: k,
|
|
1331
|
+
children: c(N, o.icon)
|
|
835
1332
|
}
|
|
836
1333
|
),
|
|
837
|
-
/* @__PURE__ */
|
|
1334
|
+
/* @__PURE__ */ C("div", { className: "mt-2 text-center", children: [
|
|
838
1335
|
/* @__PURE__ */ e(
|
|
839
1336
|
"div",
|
|
840
1337
|
{
|
|
841
|
-
className: `${
|
|
842
|
-
children:
|
|
1338
|
+
className: `${r[t]} ${p.title} transition-colors duration-300`,
|
|
1339
|
+
children: o.title
|
|
843
1340
|
}
|
|
844
1341
|
),
|
|
845
|
-
|
|
1342
|
+
o.description && /* @__PURE__ */ e(
|
|
846
1343
|
"div",
|
|
847
1344
|
{
|
|
848
|
-
className: `${
|
|
849
|
-
children:
|
|
1345
|
+
className: `${w[t]} ${p.description} mt-1 transition-colors duration-300`,
|
|
1346
|
+
children: o.description
|
|
850
1347
|
}
|
|
851
1348
|
)
|
|
852
1349
|
] })
|
|
853
1350
|
] }),
|
|
854
|
-
!
|
|
1351
|
+
!B && /* @__PURE__ */ e(
|
|
855
1352
|
"div",
|
|
856
1353
|
{
|
|
857
|
-
className: `flex-1 h-0.5 mt-4 mx-2 ${
|
|
1354
|
+
className: `flex-1 h-0.5 mt-4 mx-2 ${p.line} transition-colors duration-300`
|
|
858
1355
|
}
|
|
859
1356
|
)
|
|
860
|
-
] },
|
|
861
|
-
}) }) : /* @__PURE__ */ e("div", { className: `flex flex-col ${
|
|
862
|
-
const
|
|
863
|
-
return /* @__PURE__ */
|
|
864
|
-
/* @__PURE__ */
|
|
1357
|
+
] }, f);
|
|
1358
|
+
}) }) : /* @__PURE__ */ e("div", { className: `flex flex-col ${u}`, style: $, children: s.map((o, f) => {
|
|
1359
|
+
const N = b(f, o), p = y(N), B = f === s.length - 1, k = {};
|
|
1360
|
+
return p.iconColor && (k.color = p.iconColor), /* @__PURE__ */ C("div", { className: "flex", children: [
|
|
1361
|
+
/* @__PURE__ */ C("div", { className: "flex flex-col items-center mr-4", children: [
|
|
865
1362
|
/* @__PURE__ */ e(
|
|
866
1363
|
"div",
|
|
867
1364
|
{
|
|
868
|
-
className: `flex items-center justify-center ${
|
|
869
|
-
|
|
1365
|
+
className: `flex items-center justify-center ${h[t]} rounded-full border transition-all duration-300 ${p.icon}`,
|
|
1366
|
+
style: k,
|
|
1367
|
+
children: c(N, o.icon)
|
|
870
1368
|
}
|
|
871
1369
|
),
|
|
872
|
-
!
|
|
1370
|
+
!B && /* @__PURE__ */ e(
|
|
873
1371
|
"div",
|
|
874
1372
|
{
|
|
875
|
-
className: `w-0.5 flex-1 my-1 ${
|
|
1373
|
+
className: `w-0.5 flex-1 my-1 ${p.line} transition-colors duration-300`,
|
|
876
1374
|
style: { minHeight: "20px" }
|
|
877
1375
|
}
|
|
878
1376
|
)
|
|
879
1377
|
] }),
|
|
880
|
-
/* @__PURE__ */
|
|
1378
|
+
/* @__PURE__ */ C("div", { className: "flex-1 pb-6", children: [
|
|
881
1379
|
/* @__PURE__ */ e(
|
|
882
1380
|
"div",
|
|
883
1381
|
{
|
|
884
|
-
className: `${
|
|
885
|
-
children:
|
|
1382
|
+
className: `${r[t]} ${p.title} transition-colors duration-300`,
|
|
1383
|
+
children: o.title
|
|
886
1384
|
}
|
|
887
1385
|
),
|
|
888
|
-
|
|
1386
|
+
o.description && /* @__PURE__ */ e(
|
|
889
1387
|
"div",
|
|
890
1388
|
{
|
|
891
|
-
className: `${
|
|
892
|
-
children:
|
|
1389
|
+
className: `${w[t]} ${p.description} mt-1 transition-colors duration-300`,
|
|
1390
|
+
children: o.description
|
|
893
1391
|
}
|
|
894
1392
|
)
|
|
895
1393
|
] })
|
|
896
|
-
] },
|
|
1394
|
+
] }, f);
|
|
897
1395
|
}) });
|
|
898
|
-
},
|
|
1396
|
+
}, ce = ({
|
|
899
1397
|
percent: s = 0,
|
|
900
1398
|
status: a = "normal",
|
|
901
|
-
showInfo:
|
|
1399
|
+
showInfo: n = !0,
|
|
902
1400
|
strokeColor: t,
|
|
903
|
-
strokeWidth:
|
|
904
|
-
size:
|
|
905
|
-
className:
|
|
906
|
-
format:
|
|
1401
|
+
strokeWidth: i,
|
|
1402
|
+
size: u = "md",
|
|
1403
|
+
className: $ = "",
|
|
1404
|
+
format: d,
|
|
1405
|
+
bgColor: l,
|
|
1406
|
+
successColor: m,
|
|
1407
|
+
exceptionColor: g,
|
|
1408
|
+
trackColor: x,
|
|
1409
|
+
rounded: b = "full"
|
|
907
1410
|
}) => {
|
|
908
|
-
const h = Math.min(100, Math.max(0, s)),
|
|
1411
|
+
const h = Math.min(100, Math.max(0, s)), r = {
|
|
909
1412
|
sm: "h-1.5",
|
|
910
1413
|
md: "h-2",
|
|
911
|
-
lg: "h-3"
|
|
912
|
-
|
|
1414
|
+
lg: "h-3",
|
|
1415
|
+
responsive: "h-1.5 sm:h-2 md:h-3 lg:h-4"
|
|
1416
|
+
}, w = {
|
|
913
1417
|
sm: "text-xs",
|
|
914
1418
|
md: "text-sm",
|
|
915
|
-
lg: "text-base"
|
|
916
|
-
|
|
1419
|
+
lg: "text-base",
|
|
1420
|
+
responsive: "text-xs sm:text-sm md:text-base lg:text-lg"
|
|
1421
|
+
}, c = {
|
|
1422
|
+
none: "rounded-none",
|
|
1423
|
+
sm: "rounded-sm",
|
|
1424
|
+
md: "rounded-md",
|
|
1425
|
+
lg: "rounded-lg",
|
|
1426
|
+
full: "rounded-full"
|
|
1427
|
+
}, y = () => {
|
|
917
1428
|
if (t) return t;
|
|
918
1429
|
switch (a) {
|
|
919
1430
|
case "success":
|
|
920
|
-
return "bg-green-500";
|
|
1431
|
+
return m || "bg-green-500";
|
|
921
1432
|
case "exception":
|
|
922
|
-
return "bg-red-500";
|
|
1433
|
+
return g || "bg-red-500";
|
|
923
1434
|
case "active":
|
|
924
|
-
return "bg-[#EC615B]";
|
|
1435
|
+
return l || "bg-[#EC615B]";
|
|
925
1436
|
default:
|
|
926
|
-
return h === 100 ? "bg-green-500" : "bg-[#EC615B]";
|
|
1437
|
+
return h === 100 ? m || "bg-green-500" : l || "bg-[#EC615B]";
|
|
927
1438
|
}
|
|
928
|
-
},
|
|
1439
|
+
}, o = () => x || "bg-gray-200", f = () => a === "success" || h === 100 ? /* @__PURE__ */ e("svg", { className: "w-4 h-4 text-green-500", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e(
|
|
929
1440
|
"path",
|
|
930
1441
|
{
|
|
931
1442
|
fillRule: "evenodd",
|
|
@@ -939,99 +1450,117 @@ const D = ({
|
|
|
939
1450
|
d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",
|
|
940
1451
|
clipRule: "evenodd"
|
|
941
1452
|
}
|
|
942
|
-
) }) : null,
|
|
943
|
-
return /* @__PURE__ */
|
|
1453
|
+
) }) : null, N = () => d ? d(h) : `${Math.round(h)}%`, p = i ? `${i}px` : void 0;
|
|
1454
|
+
return /* @__PURE__ */ C("div", { className: `flex items-center gap-2 ${$}`, children: [
|
|
944
1455
|
/* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ e(
|
|
945
1456
|
"div",
|
|
946
1457
|
{
|
|
947
|
-
className: `w-full
|
|
948
|
-
style: { height:
|
|
1458
|
+
className: `w-full overflow-hidden ${r[u]} ${c[b]} ${o()}`,
|
|
1459
|
+
style: { height: p },
|
|
949
1460
|
children: /* @__PURE__ */ e(
|
|
950
1461
|
"div",
|
|
951
1462
|
{
|
|
952
|
-
className: `${
|
|
1463
|
+
className: `${y()} ${r[u]} ${c[b]} transition-all duration-300 ease-out ${a === "active" ? "progress-active" : ""}`,
|
|
953
1464
|
style: {
|
|
954
1465
|
width: `${h}%`,
|
|
955
|
-
height:
|
|
1466
|
+
height: p
|
|
956
1467
|
}
|
|
957
1468
|
}
|
|
958
1469
|
)
|
|
959
1470
|
}
|
|
960
1471
|
) }),
|
|
961
|
-
|
|
1472
|
+
n && /* @__PURE__ */ e("div", { className: `flex items-center gap-1 ${w[u]} text-gray-600 font-normal`, children: f() || N() })
|
|
962
1473
|
] });
|
|
963
|
-
},
|
|
1474
|
+
}, ue = ({
|
|
964
1475
|
checked: s,
|
|
965
1476
|
defaultChecked: a = !1,
|
|
966
|
-
onChange:
|
|
1477
|
+
onChange: n,
|
|
967
1478
|
disabled: t = !1,
|
|
968
|
-
indeterminate:
|
|
969
|
-
size:
|
|
970
|
-
variant:
|
|
971
|
-
className:
|
|
972
|
-
id:
|
|
1479
|
+
indeterminate: i = !1,
|
|
1480
|
+
size: u = "md",
|
|
1481
|
+
variant: $ = "filled",
|
|
1482
|
+
className: d = "",
|
|
1483
|
+
id: l,
|
|
973
1484
|
name: m,
|
|
974
|
-
value:
|
|
1485
|
+
value: g,
|
|
1486
|
+
checkedColor: x = "#EC615B",
|
|
1487
|
+
uncheckedColor: b = "#ffffff",
|
|
1488
|
+
checkedBorderColor: h = "#EC615B",
|
|
1489
|
+
style: r
|
|
975
1490
|
}) => {
|
|
976
|
-
const [
|
|
1491
|
+
const [w, c] = R(a), y = s !== void 0, o = y ? s : w, f = (L) => {
|
|
977
1492
|
if (t) return;
|
|
978
|
-
const
|
|
979
|
-
|
|
980
|
-
},
|
|
1493
|
+
const M = L.target.checked;
|
|
1494
|
+
y || c(M), n == null || n(M);
|
|
1495
|
+
}, N = {
|
|
981
1496
|
sm: "w-4 h-4",
|
|
982
1497
|
md: "w-5 h-5",
|
|
983
|
-
lg: "w-6 h-6"
|
|
984
|
-
|
|
1498
|
+
lg: "w-6 h-6",
|
|
1499
|
+
responsive: "w-4 h-4 sm:w-5 sm:h-5 lg:w-6 lg:h-6"
|
|
1500
|
+
}, p = {
|
|
985
1501
|
sm: "w-3 h-3",
|
|
986
1502
|
md: "w-3.5 h-3.5",
|
|
987
|
-
lg: "w-4 h-4"
|
|
988
|
-
|
|
989
|
-
|
|
1503
|
+
lg: "w-4 h-4",
|
|
1504
|
+
responsive: "w-2.5 h-2.5 sm:w-3.5 sm:h-3.5 lg:w-4 lg:h-4"
|
|
1505
|
+
}, B = $ === "filled", k = () => t ? "cursor-not-allowed opacity-50 border-gray-300 bg-gray-100" : !o && !i ? "border-gray-300 bg-white hover:border-gray-400" : "", T = () => {
|
|
1506
|
+
if (!t && !(!o && !i))
|
|
1507
|
+
return B ? {
|
|
1508
|
+
borderColor: h,
|
|
1509
|
+
backgroundColor: x
|
|
1510
|
+
} : {
|
|
1511
|
+
borderColor: h,
|
|
1512
|
+
backgroundColor: b
|
|
1513
|
+
};
|
|
1514
|
+
}, P = () => B && (o || i) ? "text-white" : "";
|
|
1515
|
+
return /* @__PURE__ */ C("div", { className: "inline-flex items-center", style: r, children: [
|
|
990
1516
|
/* @__PURE__ */ e(
|
|
991
1517
|
"input",
|
|
992
1518
|
{
|
|
993
1519
|
type: "checkbox",
|
|
994
|
-
id:
|
|
1520
|
+
id: l,
|
|
995
1521
|
name: m,
|
|
996
|
-
value:
|
|
997
|
-
checked:
|
|
998
|
-
onChange:
|
|
1522
|
+
value: g,
|
|
1523
|
+
checked: o,
|
|
1524
|
+
onChange: f,
|
|
999
1525
|
disabled: t,
|
|
1000
1526
|
className: "sr-only"
|
|
1001
1527
|
}
|
|
1002
1528
|
),
|
|
1003
|
-
/* @__PURE__ */
|
|
1529
|
+
/* @__PURE__ */ C(
|
|
1004
1530
|
"label",
|
|
1005
1531
|
{
|
|
1006
|
-
htmlFor:
|
|
1532
|
+
htmlFor: l,
|
|
1007
1533
|
className: `
|
|
1008
1534
|
relative flex items-center justify-center
|
|
1009
|
-
${
|
|
1010
|
-
${
|
|
1535
|
+
${N[u]}
|
|
1536
|
+
${$ === "outline" ? "border" : "border-2"}
|
|
1011
1537
|
rounded
|
|
1012
1538
|
transition-all duration-200 ease-out
|
|
1013
1539
|
cursor-pointer
|
|
1014
|
-
${
|
|
1015
|
-
${
|
|
1540
|
+
${k()}
|
|
1541
|
+
${d}
|
|
1016
1542
|
`,
|
|
1543
|
+
style: T(),
|
|
1017
1544
|
children: [
|
|
1018
|
-
|
|
1545
|
+
o && !i && /* @__PURE__ */ e(
|
|
1019
1546
|
"svg",
|
|
1020
1547
|
{
|
|
1021
|
-
className: `${
|
|
1548
|
+
className: `${p[u]} ${P()}`,
|
|
1022
1549
|
fill: "none",
|
|
1023
1550
|
stroke: "currentColor",
|
|
1024
1551
|
viewBox: "0 0 24 24",
|
|
1025
1552
|
strokeWidth: 3,
|
|
1553
|
+
style: !B && (o || i) ? { color: x } : void 0,
|
|
1026
1554
|
children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" })
|
|
1027
1555
|
}
|
|
1028
1556
|
),
|
|
1029
|
-
|
|
1557
|
+
i && /* @__PURE__ */ e(
|
|
1030
1558
|
"svg",
|
|
1031
1559
|
{
|
|
1032
|
-
className: `${
|
|
1560
|
+
className: `${p[u]} ${P()}`,
|
|
1033
1561
|
fill: "currentColor",
|
|
1034
1562
|
viewBox: "0 0 24 24",
|
|
1563
|
+
style: !B && (o || i) ? { color: x } : void 0,
|
|
1035
1564
|
children: /* @__PURE__ */ e("rect", { x: "4", y: "11", width: "16", height: "2", rx: "1" })
|
|
1036
1565
|
}
|
|
1037
1566
|
)
|
|
@@ -1039,92 +1568,182 @@ const D = ({
|
|
|
1039
1568
|
}
|
|
1040
1569
|
)
|
|
1041
1570
|
] });
|
|
1042
|
-
},
|
|
1571
|
+
}, Y = (s = "md") => ({
|
|
1572
|
+
sm: {
|
|
1573
|
+
container: "space-y-1",
|
|
1574
|
+
item: "px-2 py-1.5",
|
|
1575
|
+
label: "text-xs",
|
|
1576
|
+
sublabel: "text-[10px]",
|
|
1577
|
+
button: "w-5 h-5",
|
|
1578
|
+
icon: "w-3 h-3"
|
|
1579
|
+
},
|
|
1580
|
+
md: {
|
|
1581
|
+
container: "space-y-2",
|
|
1582
|
+
item: "px-4 py-3",
|
|
1583
|
+
label: "text-sm",
|
|
1584
|
+
sublabel: "text-xs",
|
|
1585
|
+
button: "w-6 h-6",
|
|
1586
|
+
icon: "w-4 h-4"
|
|
1587
|
+
},
|
|
1588
|
+
lg: {
|
|
1589
|
+
container: "space-y-3",
|
|
1590
|
+
item: "px-5 py-4",
|
|
1591
|
+
label: "text-base",
|
|
1592
|
+
sublabel: "text-sm",
|
|
1593
|
+
button: "w-7 h-7",
|
|
1594
|
+
icon: "w-5 h-5"
|
|
1595
|
+
},
|
|
1596
|
+
responsive: {
|
|
1597
|
+
container: "space-y-1 sm:space-y-2 md:space-y-3",
|
|
1598
|
+
item: "px-2 py-1.5 sm:px-3 sm:py-2 md:px-4 md:py-3 lg:px-5 lg:py-4",
|
|
1599
|
+
label: "text-xs sm:text-sm md:text-base",
|
|
1600
|
+
sublabel: "text-[10px] sm:text-xs md:text-sm",
|
|
1601
|
+
button: "w-5 h-5 sm:w-5 sm:h-5 md:w-6 md:h-6 lg:w-7 lg:h-7",
|
|
1602
|
+
icon: "w-3 h-3 sm:w-3 sm:h-3 md:w-4 md:h-4 lg:w-5 lg:h-5"
|
|
1603
|
+
}
|
|
1604
|
+
})[s], Z = (s = "md") => ({
|
|
1605
|
+
none: "rounded-none",
|
|
1606
|
+
sm: "rounded-sm",
|
|
1607
|
+
md: "rounded-lg",
|
|
1608
|
+
lg: "rounded-xl",
|
|
1609
|
+
full: "rounded-full"
|
|
1610
|
+
})[s], me = ({
|
|
1043
1611
|
items: s,
|
|
1044
1612
|
onRemove: a,
|
|
1045
|
-
emptyMessage:
|
|
1613
|
+
emptyMessage: n = "No items selected",
|
|
1046
1614
|
className: t = "",
|
|
1047
|
-
itemClassName:
|
|
1048
|
-
maxHeight:
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1615
|
+
itemClassName: i = "",
|
|
1616
|
+
maxHeight: u = "300px",
|
|
1617
|
+
size: $ = "md",
|
|
1618
|
+
bgColor: d,
|
|
1619
|
+
hoverBgColor: l,
|
|
1620
|
+
textColor: m,
|
|
1621
|
+
sublabelColor: g,
|
|
1622
|
+
removeButtonColor: x,
|
|
1623
|
+
removeButtonHoverColor: b,
|
|
1624
|
+
rounded: h = "md",
|
|
1625
|
+
style: r
|
|
1626
|
+
}) => {
|
|
1627
|
+
const w = Y($), c = Z(h), y = "#F4F4F4", o = "#EBEBEB", f = "#181918", N = "#999999", p = "#9CA3AF", B = "#EC615B", k = d || y, T = l || o, P = m || f, L = g || N, M = x || p, F = b || B;
|
|
1628
|
+
return s.length === 0 ? /* @__PURE__ */ e(
|
|
1629
|
+
"div",
|
|
1630
|
+
{
|
|
1631
|
+
className: `text-center py-8 text-gray-500 text-sm ${t}`,
|
|
1632
|
+
style: {
|
|
1633
|
+
color: L,
|
|
1634
|
+
...r
|
|
1635
|
+
},
|
|
1636
|
+
children: n
|
|
1637
|
+
}
|
|
1638
|
+
) : /* @__PURE__ */ e(
|
|
1639
|
+
"div",
|
|
1640
|
+
{
|
|
1641
|
+
className: `overflow-y-auto ${w.container} ${t}`,
|
|
1642
|
+
style: { maxHeight: u, ...r },
|
|
1643
|
+
children: s.map((j, S) => /* @__PURE__ */ C(
|
|
1644
|
+
"div",
|
|
1645
|
+
{
|
|
1646
|
+
className: `
|
|
1058
1647
|
group flex items-center justify-between
|
|
1059
|
-
|
|
1648
|
+
${c}
|
|
1060
1649
|
transition-all duration-300 ease-out
|
|
1061
|
-
hover:
|
|
1650
|
+
hover:shadow-sm
|
|
1062
1651
|
animate-slide-in-item
|
|
1063
|
-
${
|
|
1652
|
+
${i}
|
|
1064
1653
|
`,
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1654
|
+
style: {
|
|
1655
|
+
backgroundColor: k,
|
|
1656
|
+
animationDelay: `${S * 50}ms`
|
|
1657
|
+
},
|
|
1658
|
+
onMouseEnter: (E) => {
|
|
1659
|
+
E.currentTarget.style.backgroundColor = T;
|
|
1660
|
+
},
|
|
1661
|
+
onMouseLeave: (E) => {
|
|
1662
|
+
E.currentTarget.style.backgroundColor = k;
|
|
1663
|
+
},
|
|
1664
|
+
children: [
|
|
1665
|
+
/* @__PURE__ */ C("div", { className: `flex-1 min-w-0 ${w.item}`, children: [
|
|
1666
|
+
j.sublabel && /* @__PURE__ */ e(
|
|
1667
|
+
"div",
|
|
1668
|
+
{
|
|
1669
|
+
className: `font-normal mb-0.5 ${w.sublabel}`,
|
|
1670
|
+
style: { color: L },
|
|
1671
|
+
children: j.sublabel
|
|
1672
|
+
}
|
|
1673
|
+
),
|
|
1674
|
+
/* @__PURE__ */ e(
|
|
1675
|
+
"div",
|
|
1676
|
+
{
|
|
1677
|
+
className: `font-medium truncate ${w.label}`,
|
|
1678
|
+
style: { color: P },
|
|
1679
|
+
children: j.label
|
|
1680
|
+
}
|
|
1681
|
+
)
|
|
1682
|
+
] }),
|
|
1683
|
+
/* @__PURE__ */ e(
|
|
1684
|
+
"button",
|
|
1685
|
+
{
|
|
1686
|
+
onClick: () => a(j.id),
|
|
1687
|
+
className: `
|
|
1688
|
+
ml-3 flex-shrink-0 rounded-full
|
|
1080
1689
|
flex items-center justify-center
|
|
1081
|
-
text-gray-400
|
|
1082
1690
|
transition-all duration-200 ease-out
|
|
1083
|
-
hover:
|
|
1691
|
+
hover:scale-110
|
|
1084
1692
|
active:scale-95
|
|
1085
|
-
focus:outline-none focus:ring-2 focus:ring-
|
|
1693
|
+
focus:outline-none focus:ring-2 focus:ring-opacity-50
|
|
1694
|
+
${w.button}
|
|
1086
1695
|
`,
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
{
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1696
|
+
style: {
|
|
1697
|
+
color: M
|
|
1698
|
+
},
|
|
1699
|
+
onMouseEnter: (E) => {
|
|
1700
|
+
E.currentTarget.style.backgroundColor = "white", E.currentTarget.style.color = F;
|
|
1701
|
+
},
|
|
1702
|
+
onMouseLeave: (E) => {
|
|
1703
|
+
E.currentTarget.style.backgroundColor = "transparent", E.currentTarget.style.color = M;
|
|
1704
|
+
},
|
|
1705
|
+
"aria-label": `Remove ${j.label}`,
|
|
1706
|
+
children: /* @__PURE__ */ e(
|
|
1707
|
+
"svg",
|
|
1708
|
+
{
|
|
1709
|
+
className: w.icon,
|
|
1710
|
+
fill: "none",
|
|
1711
|
+
stroke: "currentColor",
|
|
1712
|
+
viewBox: "0 0 24 24",
|
|
1713
|
+
children: /* @__PURE__ */ e(
|
|
1714
|
+
"path",
|
|
1715
|
+
{
|
|
1716
|
+
strokeLinecap: "round",
|
|
1717
|
+
strokeLinejoin: "round",
|
|
1718
|
+
strokeWidth: 2,
|
|
1719
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
1720
|
+
}
|
|
1721
|
+
)
|
|
1722
|
+
}
|
|
1723
|
+
)
|
|
1724
|
+
}
|
|
1725
|
+
)
|
|
1726
|
+
]
|
|
1727
|
+
},
|
|
1728
|
+
j.id
|
|
1729
|
+
))
|
|
1730
|
+
}
|
|
1731
|
+
);
|
|
1732
|
+
};
|
|
1114
1733
|
export {
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1734
|
+
ie as Badge,
|
|
1735
|
+
ee as Button,
|
|
1736
|
+
re as Card,
|
|
1737
|
+
ue as Checkbox,
|
|
1738
|
+
ne as Dropdown,
|
|
1739
|
+
ae as Modal,
|
|
1740
|
+
ce as Progress,
|
|
1741
|
+
se as SearchInput,
|
|
1742
|
+
G as Select,
|
|
1743
|
+
me as SelectedItemsList,
|
|
1744
|
+
te as StatCard,
|
|
1745
|
+
de as Steps,
|
|
1746
|
+
le as Table,
|
|
1747
|
+
oe as TableTop
|
|
1129
1748
|
};
|
|
1130
1749
|
//# sourceMappingURL=index.mjs.map
|