gemini-uis 0.7.0 → 0.9.0
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.d.ts +107 -0
- package/dist/index.js +789 -547
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { cloneElement, forwardRef, isValidElement, startTransition, useCallback, useEffect, useMemo, useState } from "react";
|
|
1
|
+
import { cloneElement, forwardRef, isValidElement, startTransition, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
const getVariantStyles = (
|
|
4
|
-
let
|
|
3
|
+
const getVariantStyles = (e) => {
|
|
4
|
+
let t = {
|
|
5
5
|
primary: "bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500",
|
|
6
6
|
default: "bg-white text-gray-700 hover:bg-gray-50 focus:ring-gray-500 border border-gray-300",
|
|
7
7
|
secondary: "bg-gray-100 text-gray-900 hover:bg-gray-200 focus:ring-gray-500 border border-gray-300",
|
|
@@ -10,36 +10,36 @@ const getVariantStyles = (r) => {
|
|
|
10
10
|
text: "bg-transparent text-gray-700 focus:ring-gray-500",
|
|
11
11
|
danger: "bg-red-600 text-white hover:bg-red-700 focus:ring-red-500"
|
|
12
12
|
};
|
|
13
|
-
return
|
|
14
|
-
}, getSizeStyles = (
|
|
15
|
-
let
|
|
13
|
+
return t[e] || t.primary;
|
|
14
|
+
}, getSizeStyles = (e) => {
|
|
15
|
+
let t = {
|
|
16
16
|
xs: "px-2 py-1 text-xs min-h-[1.5rem]",
|
|
17
17
|
sm: "px-3 py-1.5 text-sm min-h-[2rem]",
|
|
18
18
|
md: "px-4 py-2 text-sm min-h-[2.5rem]",
|
|
19
19
|
lg: "px-6 py-3 text-base min-h-[3rem]",
|
|
20
20
|
xl: "px-8 py-4 text-lg min-h-[3.5rem]"
|
|
21
21
|
};
|
|
22
|
-
return
|
|
23
|
-
}, getRoundedStyles$2 = (
|
|
22
|
+
return t[e] || t.md;
|
|
23
|
+
}, getRoundedStyles$2 = (e) => e ? "rounded-lg" : "rounded-none", getButtonStyles = (e = "primary", t = "md", n = !1, r = !1, i = !1, a) => [
|
|
24
24
|
"inline-flex gap-1 items-center justify-center font-medium text-center transition-all duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",
|
|
25
|
-
getVariantStyles(
|
|
26
|
-
getSizeStyles(
|
|
27
|
-
getRoundedStyles$2(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
getVariantStyles(e),
|
|
26
|
+
getSizeStyles(t),
|
|
27
|
+
getRoundedStyles$2(n),
|
|
28
|
+
r ? "opacity-50 cursor-not-allowed" : "",
|
|
29
|
+
i ? "cursor-wait" : "",
|
|
30
|
+
a
|
|
31
31
|
].filter(Boolean).join(" ").replace(/\s+/g, " ").trim();
|
|
32
|
-
function cn(...
|
|
33
|
-
return
|
|
32
|
+
function cn(...e) {
|
|
33
|
+
return e.filter(Boolean).join(" ");
|
|
34
34
|
}
|
|
35
|
-
var cn_default = cn, LoadingIcon_default = ({ width:
|
|
36
|
-
width:
|
|
37
|
-
height:
|
|
35
|
+
var cn_default = cn, LoadingIcon_default = ({ width: e = 16, height: t = 16, className: n = "animate-spin", ...r }) => /* @__PURE__ */ jsxs("svg", {
|
|
36
|
+
width: e,
|
|
37
|
+
height: t,
|
|
38
38
|
xmlns: "http://www.w3.org/2000/svg",
|
|
39
39
|
fill: "none",
|
|
40
40
|
viewBox: "0 0 24 24",
|
|
41
|
-
className:
|
|
42
|
-
...
|
|
41
|
+
className: n,
|
|
42
|
+
...r,
|
|
43
43
|
children: [/* @__PURE__ */ jsx("circle", {
|
|
44
44
|
className: "opacity-25",
|
|
45
45
|
cx: "12",
|
|
@@ -52,54 +52,54 @@ var cn_default = cn, LoadingIcon_default = ({ width: r = 16, height: i = 16, cla
|
|
|
52
52
|
fill: "currentColor",
|
|
53
53
|
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"
|
|
54
54
|
})]
|
|
55
|
-
}), CloseIcon_default = ({ width:
|
|
56
|
-
width:
|
|
57
|
-
height:
|
|
58
|
-
fill:
|
|
59
|
-
stroke:
|
|
55
|
+
}), CloseIcon_default = ({ width: e = 6, height: t = 6, fill: n = "none", strokeWidth: r = 2, stroke: i = "currentColor", ...a }) => /* @__PURE__ */ jsx("svg", {
|
|
56
|
+
width: e,
|
|
57
|
+
height: t,
|
|
58
|
+
fill: n,
|
|
59
|
+
stroke: i,
|
|
60
60
|
viewBox: "0 0 24 24",
|
|
61
|
-
...
|
|
61
|
+
...a,
|
|
62
62
|
children: /* @__PURE__ */ jsx("path", {
|
|
63
63
|
strokeLinecap: "round",
|
|
64
64
|
strokeLinejoin: "round",
|
|
65
|
-
strokeWidth:
|
|
65
|
+
strokeWidth: r,
|
|
66
66
|
d: "M6 18L18 6M6 6l12 12"
|
|
67
67
|
})
|
|
68
|
-
}), ArrowIcon_default = ({ viewBox:
|
|
69
|
-
fill:
|
|
70
|
-
stroke:
|
|
71
|
-
viewBox:
|
|
72
|
-
...
|
|
68
|
+
}), ArrowIcon_default = ({ viewBox: e = "0 0 24 24", fill: t = "none", stroke: n = "currentColor", ...r }) => /* @__PURE__ */ jsx("svg", {
|
|
69
|
+
fill: t,
|
|
70
|
+
stroke: n,
|
|
71
|
+
viewBox: e,
|
|
72
|
+
...r,
|
|
73
73
|
children: /* @__PURE__ */ jsx("path", {
|
|
74
74
|
strokeLinecap: "round",
|
|
75
75
|
strokeLinejoin: "round",
|
|
76
76
|
strokeWidth: 2,
|
|
77
77
|
d: "M19 9l-7 7-7-7"
|
|
78
78
|
})
|
|
79
|
-
}), SearchIcon_default = ({ viewBox:
|
|
80
|
-
viewBox:
|
|
81
|
-
fill:
|
|
82
|
-
stroke:
|
|
83
|
-
strokeWidth:
|
|
84
|
-
...
|
|
79
|
+
}), SearchIcon_default = ({ viewBox: e = "0 0 24 24", fill: t = "none", stroke: n = "currentColor", strokeWidth: r = "1.5", ...i }) => /* @__PURE__ */ jsxs("svg", {
|
|
80
|
+
viewBox: e,
|
|
81
|
+
fill: t,
|
|
82
|
+
stroke: n,
|
|
83
|
+
strokeWidth: r,
|
|
84
|
+
...i,
|
|
85
85
|
children: [/* @__PURE__ */ jsx("circle", {
|
|
86
86
|
cx: "11",
|
|
87
87
|
cy: "11",
|
|
88
88
|
r: "8"
|
|
89
89
|
}), /* @__PURE__ */ jsx("path", { d: "m21 21-4.35-4.35" })]
|
|
90
|
-
}), FolderIcon_default = ({ viewBox:
|
|
91
|
-
viewBox:
|
|
92
|
-
fill:
|
|
93
|
-
stroke:
|
|
94
|
-
strokeWidth:
|
|
95
|
-
...
|
|
90
|
+
}), FolderIcon_default = ({ viewBox: e = "0 0 24 24", fill: t = "none", stroke: n = "currentColor", strokeWidth: r = "1.5", ...i }) => /* @__PURE__ */ jsx("svg", {
|
|
91
|
+
viewBox: e,
|
|
92
|
+
fill: t,
|
|
93
|
+
stroke: n,
|
|
94
|
+
strokeWidth: r,
|
|
95
|
+
...i,
|
|
96
96
|
children: /* @__PURE__ */ jsx("path", { d: "M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z" })
|
|
97
|
-
}), DocumentIcon_default = ({ viewBox:
|
|
98
|
-
viewBox:
|
|
99
|
-
fill:
|
|
100
|
-
stroke:
|
|
101
|
-
strokeWidth:
|
|
102
|
-
...
|
|
97
|
+
}), DocumentIcon_default = ({ viewBox: e = "0 0 24 24", fill: t = "none", stroke: n = "currentColor", strokeWidth: r = "1.5", ...i }) => /* @__PURE__ */ jsxs("svg", {
|
|
98
|
+
viewBox: e,
|
|
99
|
+
fill: t,
|
|
100
|
+
stroke: n,
|
|
101
|
+
strokeWidth: r,
|
|
102
|
+
...i,
|
|
103
103
|
children: [
|
|
104
104
|
/* @__PURE__ */ jsx("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
105
105
|
/* @__PURE__ */ jsx("polyline", { points: "14,2 14,8 20,8" }),
|
|
@@ -117,12 +117,12 @@ var cn_default = cn, LoadingIcon_default = ({ width: r = 16, height: i = 16, cla
|
|
|
117
117
|
}),
|
|
118
118
|
/* @__PURE__ */ jsx("polyline", { points: "10,9 9,9 8,9" })
|
|
119
119
|
]
|
|
120
|
-
}), UsersIcon_default = ({ viewBox:
|
|
121
|
-
viewBox:
|
|
122
|
-
fill:
|
|
123
|
-
stroke:
|
|
124
|
-
strokeWidth:
|
|
125
|
-
...
|
|
120
|
+
}), UsersIcon_default = ({ viewBox: e = "0 0 24 24", fill: t = "none", stroke: n = "currentColor", strokeWidth: r = "1.5", ...i }) => /* @__PURE__ */ jsxs("svg", {
|
|
121
|
+
viewBox: e,
|
|
122
|
+
fill: t,
|
|
123
|
+
stroke: n,
|
|
124
|
+
strokeWidth: r,
|
|
125
|
+
...i,
|
|
126
126
|
children: [
|
|
127
127
|
/* @__PURE__ */ jsx("path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }),
|
|
128
128
|
/* @__PURE__ */ jsx("circle", {
|
|
@@ -133,34 +133,34 @@ var cn_default = cn, LoadingIcon_default = ({ width: r = 16, height: i = 16, cla
|
|
|
133
133
|
/* @__PURE__ */ jsx("path", { d: "m22 21-2-2" }),
|
|
134
134
|
/* @__PURE__ */ jsx("path", { d: "m16 16 2 2" })
|
|
135
135
|
]
|
|
136
|
-
}), SettingsIcon_default = ({ viewBox:
|
|
137
|
-
viewBox:
|
|
138
|
-
fill:
|
|
139
|
-
stroke:
|
|
140
|
-
strokeWidth:
|
|
141
|
-
...
|
|
136
|
+
}), SettingsIcon_default = ({ viewBox: e = "0 0 24 24", fill: t = "none", stroke: n = "currentColor", strokeWidth: r = "1.5", ...i }) => /* @__PURE__ */ jsxs("svg", {
|
|
137
|
+
viewBox: e,
|
|
138
|
+
fill: t,
|
|
139
|
+
stroke: n,
|
|
140
|
+
strokeWidth: r,
|
|
141
|
+
...i,
|
|
142
142
|
children: [/* @__PURE__ */ jsx("circle", {
|
|
143
143
|
cx: "12",
|
|
144
144
|
cy: "12",
|
|
145
145
|
r: "3"
|
|
146
146
|
}), /* @__PURE__ */ jsx("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1 1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" })]
|
|
147
|
-
}), WarningIcon_default = ({ viewBox:
|
|
148
|
-
viewBox:
|
|
149
|
-
fill:
|
|
150
|
-
stroke:
|
|
151
|
-
strokeWidth:
|
|
152
|
-
...
|
|
147
|
+
}), WarningIcon_default = ({ viewBox: e = "0 0 24 24", fill: t = "none", stroke: n = "currentColor", strokeWidth: r = "1.5", ...i }) => /* @__PURE__ */ jsxs("svg", {
|
|
148
|
+
viewBox: e,
|
|
149
|
+
fill: t,
|
|
150
|
+
stroke: n,
|
|
151
|
+
strokeWidth: r,
|
|
152
|
+
...i,
|
|
153
153
|
children: [/* @__PURE__ */ jsx("circle", {
|
|
154
154
|
cx: "12",
|
|
155
155
|
cy: "12",
|
|
156
156
|
r: "3"
|
|
157
157
|
}), /* @__PURE__ */ jsx("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1 1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" })]
|
|
158
|
-
}), InfoIcon_default = ({ viewBox:
|
|
159
|
-
viewBox:
|
|
160
|
-
fill:
|
|
161
|
-
stroke:
|
|
162
|
-
strokeWidth:
|
|
163
|
-
...
|
|
158
|
+
}), InfoIcon_default = ({ viewBox: e = "0 0 24 24", fill: t = "none", stroke: n = "currentColor", strokeWidth: r = "1.5", ...i }) => /* @__PURE__ */ jsxs("svg", {
|
|
159
|
+
viewBox: e,
|
|
160
|
+
fill: t,
|
|
161
|
+
stroke: n,
|
|
162
|
+
strokeWidth: r,
|
|
163
|
+
...i,
|
|
164
164
|
children: [
|
|
165
165
|
/* @__PURE__ */ jsx("circle", {
|
|
166
166
|
cx: "12",
|
|
@@ -180,19 +180,19 @@ var cn_default = cn, LoadingIcon_default = ({ width: r = 16, height: i = 16, cla
|
|
|
180
180
|
y2: "8"
|
|
181
181
|
})
|
|
182
182
|
]
|
|
183
|
-
}), SuccessIcon_default = ({ viewBox:
|
|
184
|
-
viewBox:
|
|
185
|
-
fill:
|
|
186
|
-
stroke:
|
|
187
|
-
strokeWidth:
|
|
188
|
-
...
|
|
183
|
+
}), SuccessIcon_default = ({ viewBox: e = "0 0 24 24", fill: t = "none", stroke: n = "currentColor", strokeWidth: r = "1.5", ...i }) => /* @__PURE__ */ jsxs("svg", {
|
|
184
|
+
viewBox: e,
|
|
185
|
+
fill: t,
|
|
186
|
+
stroke: n,
|
|
187
|
+
strokeWidth: r,
|
|
188
|
+
...i,
|
|
189
189
|
children: [/* @__PURE__ */ jsx("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }), /* @__PURE__ */ jsx("polyline", { points: "22,4 12,14.01 9,11.01" })]
|
|
190
|
-
}), ErrorIcon_default = ({ viewBox:
|
|
191
|
-
viewBox:
|
|
192
|
-
fill:
|
|
193
|
-
stroke:
|
|
194
|
-
strokeWidth:
|
|
195
|
-
...
|
|
190
|
+
}), ErrorIcon_default = ({ viewBox: e = "0 0 24 24", fill: t = "none", stroke: n = "currentColor", strokeWidth: r = "1.5", ...i }) => /* @__PURE__ */ jsxs("svg", {
|
|
191
|
+
viewBox: e,
|
|
192
|
+
fill: t,
|
|
193
|
+
stroke: n,
|
|
194
|
+
strokeWidth: r,
|
|
195
|
+
...i,
|
|
196
196
|
children: [
|
|
197
197
|
/* @__PURE__ */ jsx("circle", {
|
|
198
198
|
cx: "12",
|
|
@@ -212,12 +212,12 @@ var cn_default = cn, LoadingIcon_default = ({ width: r = 16, height: i = 16, cla
|
|
|
212
212
|
y2: "15"
|
|
213
213
|
})
|
|
214
214
|
]
|
|
215
|
-
}), PrevIcon_default = ({ width:
|
|
216
|
-
width:
|
|
217
|
-
height:
|
|
218
|
-
viewBox:
|
|
219
|
-
fill:
|
|
220
|
-
...
|
|
215
|
+
}), PrevIcon_default = ({ width: e = 12, height: t = 12, viewBox: n = "0 0 12 12", fill: r = "currentColor", ...i }) => /* @__PURE__ */ jsx("svg", {
|
|
216
|
+
width: e,
|
|
217
|
+
height: t,
|
|
218
|
+
viewBox: n,
|
|
219
|
+
fill: r,
|
|
220
|
+
...i,
|
|
221
221
|
children: /* @__PURE__ */ jsx("path", {
|
|
222
222
|
d: "M7.5 9L4.5 6L7.5 3",
|
|
223
223
|
stroke: "currentColor",
|
|
@@ -226,12 +226,12 @@ var cn_default = cn, LoadingIcon_default = ({ width: r = 16, height: i = 16, cla
|
|
|
226
226
|
strokeLinejoin: "round",
|
|
227
227
|
fill: "none"
|
|
228
228
|
})
|
|
229
|
-
}), NextIcon_default = ({ width:
|
|
230
|
-
width:
|
|
231
|
-
height:
|
|
232
|
-
viewBox:
|
|
233
|
-
fill:
|
|
234
|
-
...
|
|
229
|
+
}), NextIcon_default = ({ width: e = 12, height: t = 12, viewBox: n = "0 0 12 12", fill: r = "currentColor", ...i }) => /* @__PURE__ */ jsx("svg", {
|
|
230
|
+
width: e,
|
|
231
|
+
height: t,
|
|
232
|
+
viewBox: n,
|
|
233
|
+
fill: r,
|
|
234
|
+
...i,
|
|
235
235
|
children: /* @__PURE__ */ jsx("path", {
|
|
236
236
|
d: "M4.5 3L7.5 6L4.5 9",
|
|
237
237
|
stroke: "currentColor",
|
|
@@ -240,12 +240,12 @@ var cn_default = cn, LoadingIcon_default = ({ width: r = 16, height: i = 16, cla
|
|
|
240
240
|
strokeLinejoin: "round",
|
|
241
241
|
fill: "none"
|
|
242
242
|
})
|
|
243
|
-
}), FirstIcon_default = ({ viewBox:
|
|
244
|
-
width:
|
|
245
|
-
height:
|
|
246
|
-
viewBox:
|
|
247
|
-
fill:
|
|
248
|
-
...
|
|
243
|
+
}), FirstIcon_default = ({ viewBox: e = "0 0 12 12", fill: t = "currentColor", width: n = 12, height: r = 12, ...i }) => /* @__PURE__ */ jsx("svg", {
|
|
244
|
+
width: n,
|
|
245
|
+
height: r,
|
|
246
|
+
viewBox: e,
|
|
247
|
+
fill: t,
|
|
248
|
+
...i,
|
|
249
249
|
children: /* @__PURE__ */ jsx("path", {
|
|
250
250
|
d: "M3 3L3 9M6 3L6 9M9 3L9 9",
|
|
251
251
|
stroke: "currentColor",
|
|
@@ -254,12 +254,12 @@ var cn_default = cn, LoadingIcon_default = ({ width: r = 16, height: i = 16, cla
|
|
|
254
254
|
strokeLinejoin: "round",
|
|
255
255
|
fill: "none"
|
|
256
256
|
})
|
|
257
|
-
}), LastIcon_default = ({ viewBox:
|
|
258
|
-
width:
|
|
259
|
-
height:
|
|
260
|
-
viewBox:
|
|
261
|
-
fill:
|
|
262
|
-
...
|
|
257
|
+
}), LastIcon_default = ({ viewBox: e = "0 0 12 12", fill: t = "currentColor", width: n = 12, height: r = 12, ...i }) => /* @__PURE__ */ jsx("svg", {
|
|
258
|
+
width: n,
|
|
259
|
+
height: r,
|
|
260
|
+
viewBox: e,
|
|
261
|
+
fill: t,
|
|
262
|
+
...i,
|
|
263
263
|
children: /* @__PURE__ */ jsx("path", {
|
|
264
264
|
d: "M3 3L3 9M6 3L6 9M9 3L9 9",
|
|
265
265
|
stroke: "currentColor",
|
|
@@ -268,12 +268,12 @@ var cn_default = cn, LoadingIcon_default = ({ width: r = 16, height: i = 16, cla
|
|
|
268
268
|
strokeLinejoin: "round",
|
|
269
269
|
fill: "none"
|
|
270
270
|
})
|
|
271
|
-
}), JumpPrevIcon_default = ({ viewBox:
|
|
272
|
-
width:
|
|
273
|
-
height:
|
|
274
|
-
viewBox:
|
|
275
|
-
fill:
|
|
276
|
-
...
|
|
271
|
+
}), JumpPrevIcon_default = ({ viewBox: e = "0 0 12 12", fill: t = "currentColor", width: n = 12, height: r = 12, ...i }) => /* @__PURE__ */ jsx("svg", {
|
|
272
|
+
width: n,
|
|
273
|
+
height: r,
|
|
274
|
+
viewBox: e,
|
|
275
|
+
fill: t,
|
|
276
|
+
...i,
|
|
277
277
|
children: /* @__PURE__ */ jsx("path", {
|
|
278
278
|
d: "M3 3L3 9M6 3L6 9M9 3L9 9",
|
|
279
279
|
stroke: "currentColor",
|
|
@@ -282,12 +282,12 @@ var cn_default = cn, LoadingIcon_default = ({ width: r = 16, height: i = 16, cla
|
|
|
282
282
|
strokeLinejoin: "round",
|
|
283
283
|
fill: "none"
|
|
284
284
|
})
|
|
285
|
-
}), JumpNextIcon_default = ({ viewBox:
|
|
286
|
-
width:
|
|
287
|
-
height:
|
|
288
|
-
viewBox:
|
|
289
|
-
fill:
|
|
290
|
-
...
|
|
285
|
+
}), JumpNextIcon_default = ({ viewBox: e = "0 0 12 12", fill: t = "currentColor", width: n = 12, height: r = 12, ...i }) => /* @__PURE__ */ jsx("svg", {
|
|
286
|
+
width: n,
|
|
287
|
+
height: r,
|
|
288
|
+
viewBox: e,
|
|
289
|
+
fill: t,
|
|
290
|
+
...i,
|
|
291
291
|
children: /* @__PURE__ */ jsx("path", {
|
|
292
292
|
d: "M3 3L3 9M6 3L6 9M9 3L9 9",
|
|
293
293
|
stroke: "currentColor",
|
|
@@ -296,26 +296,52 @@ var cn_default = cn, LoadingIcon_default = ({ width: r = 16, height: i = 16, cla
|
|
|
296
296
|
strokeLinejoin: "round",
|
|
297
297
|
fill: "none"
|
|
298
298
|
})
|
|
299
|
-
}),
|
|
300
|
-
|
|
299
|
+
}), ChevronLeftIcon_default = ({ width: e = 20, height: t = 20, viewBox: n = "0 0 24 24", fill: r = "none", stroke: i = "currentColor", ...a }) => /* @__PURE__ */ jsx("svg", {
|
|
300
|
+
width: e,
|
|
301
|
+
height: t,
|
|
302
|
+
fill: r,
|
|
303
|
+
stroke: i,
|
|
304
|
+
viewBox: n,
|
|
305
|
+
...a,
|
|
306
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
307
|
+
strokeLinecap: "round",
|
|
308
|
+
strokeLinejoin: "round",
|
|
309
|
+
strokeWidth: 2,
|
|
310
|
+
d: "M15 19l-7-7 7-7"
|
|
311
|
+
})
|
|
312
|
+
}), ChevronRightIcon_default = ({ width: e = 20, height: t = 20, viewBox: n = "0 0 24 24", fill: r = "none", stroke: i = "currentColor", ...a }) => /* @__PURE__ */ jsx("svg", {
|
|
313
|
+
width: e,
|
|
314
|
+
height: t,
|
|
315
|
+
fill: r,
|
|
316
|
+
stroke: i,
|
|
317
|
+
viewBox: n,
|
|
318
|
+
...a,
|
|
319
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
320
|
+
strokeLinecap: "round",
|
|
321
|
+
strokeLinejoin: "round",
|
|
322
|
+
strokeWidth: 2,
|
|
323
|
+
d: "M9 5l7 7-7 7"
|
|
324
|
+
})
|
|
325
|
+
}), Button_default = forwardRef(({ type: e = "primary", size: t = "md", rounded: n = !1, disabled: r = !1, loading: i = !1, className: a, children: o, htmlType: s = "button", onClick: c, ...l }, u) => {
|
|
326
|
+
let d = r || i;
|
|
301
327
|
return /* @__PURE__ */ jsxs("button", {
|
|
302
|
-
ref:
|
|
303
|
-
type:
|
|
304
|
-
disabled:
|
|
305
|
-
onClick: (
|
|
306
|
-
if (
|
|
307
|
-
|
|
328
|
+
ref: u,
|
|
329
|
+
type: s,
|
|
330
|
+
disabled: d,
|
|
331
|
+
onClick: (e) => {
|
|
332
|
+
if (d) {
|
|
333
|
+
e.preventDefault();
|
|
308
334
|
return;
|
|
309
335
|
}
|
|
310
|
-
|
|
336
|
+
c?.(e);
|
|
311
337
|
},
|
|
312
|
-
className: cn_default(getButtonStyles(
|
|
313
|
-
...
|
|
314
|
-
children: [
|
|
338
|
+
className: cn_default(getButtonStyles(e, t, n, d, i, a)),
|
|
339
|
+
...l,
|
|
340
|
+
children: [i && /* @__PURE__ */ jsx(LoadingIcon_default, { className: "animate-spin" }), o]
|
|
315
341
|
});
|
|
316
342
|
});
|
|
317
|
-
const getShadowStyles = (
|
|
318
|
-
let
|
|
343
|
+
const getShadowStyles = (e) => {
|
|
344
|
+
let t = {
|
|
319
345
|
none: "",
|
|
320
346
|
sm: "shadow-sm",
|
|
321
347
|
md: "shadow-md",
|
|
@@ -323,9 +349,9 @@ const getShadowStyles = (r) => {
|
|
|
323
349
|
xl: "shadow-xl",
|
|
324
350
|
"2xl": "shadow-2xl"
|
|
325
351
|
};
|
|
326
|
-
return
|
|
327
|
-
}, getBorderStyles = (
|
|
328
|
-
let
|
|
352
|
+
return t[e] || t.none;
|
|
353
|
+
}, getBorderStyles = (e) => {
|
|
354
|
+
let t = {
|
|
329
355
|
none: "",
|
|
330
356
|
sm: "border border-gray-200",
|
|
331
357
|
md: "border-2 border-gray-200",
|
|
@@ -333,354 +359,354 @@ const getShadowStyles = (r) => {
|
|
|
333
359
|
xl: "border-8 border-gray-200",
|
|
334
360
|
"2xl": "border-16 border-gray-200"
|
|
335
361
|
};
|
|
336
|
-
return
|
|
337
|
-
}, getRoundedStyles$1 = (
|
|
338
|
-
let
|
|
362
|
+
return t[e] || t.none;
|
|
363
|
+
}, getRoundedStyles$1 = (e) => e ? "rounded-lg" : "rounded-none", getHoverStyles = (e = !1) => e ? "" : "hover:shadow-xl hover:scale-101 hover:-translate-y-1 hover:translate-x-1 origin-bottom-left", getCardStyles = (e = "none", t = "none", n = !1, r = !1, i) => {
|
|
364
|
+
let a = getShadowStyles(e), o = getBorderStyles(t), s = getRoundedStyles$1(n), c = getHoverStyles(r);
|
|
339
365
|
return [
|
|
340
366
|
"block p-4 bg-white transition-all duration-300 ease-in-out cursor-pointer",
|
|
341
|
-
|
|
367
|
+
i && /\bw-\w+/.test(i) ? "" : "w-full",
|
|
368
|
+
a,
|
|
369
|
+
o,
|
|
370
|
+
s,
|
|
342
371
|
c,
|
|
343
|
-
|
|
344
|
-
u,
|
|
345
|
-
d,
|
|
346
|
-
s
|
|
372
|
+
i
|
|
347
373
|
].filter(Boolean).join(" ").replace(/\s+/g, " ").trim();
|
|
348
374
|
};
|
|
349
|
-
var Card_default = forwardRef(({ shadow:
|
|
350
|
-
ref:
|
|
351
|
-
className: cn_default(getCardStyles(
|
|
352
|
-
...
|
|
353
|
-
children:
|
|
375
|
+
var Card_default = forwardRef(({ shadow: e = "md", border: t = "sm", rounded: n = !1, disabledHover: r = !1, className: i, children: a, ...o }, s) => /* @__PURE__ */ jsx("div", {
|
|
376
|
+
ref: s,
|
|
377
|
+
className: cn_default(getCardStyles(e, t, n, r, i)),
|
|
378
|
+
...o,
|
|
379
|
+
children: a
|
|
354
380
|
}));
|
|
355
|
-
const getCollapseSizeStyles = (
|
|
356
|
-
let
|
|
381
|
+
const getCollapseSizeStyles = (e) => {
|
|
382
|
+
let t = {
|
|
357
383
|
sm: "text-sm",
|
|
358
384
|
md: "text-base",
|
|
359
385
|
lg: "text-lg"
|
|
360
386
|
};
|
|
361
|
-
return
|
|
362
|
-
}, getCollapseVariantStyles = (
|
|
387
|
+
return t[e] || t.md;
|
|
388
|
+
}, getCollapseVariantStyles = (e, t, n) => n ? "bg-transparent" : t || e === "bordered" ? "border border-gray-200 rounded-lg overflow-hidden" : "bg-white rounded-lg", getCollapseStyles = (e = "md", t = "default", n = !1, r = !1, i) => [
|
|
363
389
|
"w-full",
|
|
364
|
-
getCollapseSizeStyles(
|
|
365
|
-
getCollapseVariantStyles(
|
|
366
|
-
|
|
390
|
+
getCollapseSizeStyles(e),
|
|
391
|
+
getCollapseVariantStyles(t, n, r),
|
|
392
|
+
i
|
|
367
393
|
].filter(Boolean).join(" ").replace(/\s+/g, " ").trim();
|
|
368
|
-
var DefaultArrowIcon = ({ isActive:
|
|
369
|
-
let [
|
|
370
|
-
let
|
|
371
|
-
return Array.isArray(
|
|
372
|
-
}),
|
|
373
|
-
if (
|
|
374
|
-
let
|
|
375
|
-
|
|
394
|
+
var DefaultArrowIcon = ({ isActive: e, disabled: t }) => /* @__PURE__ */ jsx(ArrowIcon_default, { className: cn_default("shrink-0 size-4 transition-transform duration-200 ease-in-out", e ? "rotate-180" : "rotate-0", t ? "opacity-50" : "") }), CollapseCore = forwardRef(({ activeKey: t, defaultActiveKey: r, collapsible: a = "header", accordion: o = !1, bordered: c = !1, ghost: u = !1, size: Re = "md", variant: d = "default", className: f, children: p, onChange: m, onExpand: h, onCollapse: _, ...v }, y) => {
|
|
395
|
+
let [b, x] = useState(() => {
|
|
396
|
+
let e = t || r;
|
|
397
|
+
return Array.isArray(e) ? e : e ? [e] : [];
|
|
398
|
+
}), S = useMemo(() => t === void 0 ? b : Array.isArray(t) ? t : [t], [t, b]), C = useCallback((e) => {
|
|
399
|
+
if (a === "disabled") return;
|
|
400
|
+
let n;
|
|
401
|
+
n = o ? S.includes(e) ? [] : [e] : S.includes(e) ? S.filter((t) => t !== e) : [...S, e], t === void 0 && x(n), m?.(o ? n[0] || "" : n), n.includes(e) ? h?.(e) : _?.(e);
|
|
376
402
|
}, [
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
]),
|
|
385
|
-
if (!isValidElement(
|
|
386
|
-
let { ...
|
|
387
|
-
return cloneElement(
|
|
388
|
-
...
|
|
389
|
-
isActive:
|
|
390
|
-
onToggle: () =>
|
|
391
|
-
collapsible:
|
|
403
|
+
t,
|
|
404
|
+
S,
|
|
405
|
+
o,
|
|
406
|
+
a,
|
|
407
|
+
m,
|
|
408
|
+
h,
|
|
409
|
+
_
|
|
410
|
+
]), w = getCollapseStyles(Re, d, c, u, f), T = useMemo(() => p ? Array.isArray(p) ? p.map((t, r) => {
|
|
411
|
+
if (!isValidElement(t)) return t;
|
|
412
|
+
let { ...i } = t.props, o = t.key || String(r), s = S.includes(o);
|
|
413
|
+
return cloneElement(t, {
|
|
414
|
+
...i,
|
|
415
|
+
isActive: s,
|
|
416
|
+
onToggle: () => C(o),
|
|
417
|
+
collapsible: a
|
|
392
418
|
});
|
|
393
|
-
}) : isValidElement(
|
|
394
|
-
...
|
|
395
|
-
isActive:
|
|
396
|
-
onToggle: () =>
|
|
397
|
-
collapsible:
|
|
398
|
-
}) :
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
419
|
+
}) : isValidElement(p) ? cloneElement(p, {
|
|
420
|
+
...p.props,
|
|
421
|
+
isActive: S.includes(p.key || "filter"),
|
|
422
|
+
onToggle: () => C(p.key || "filter"),
|
|
423
|
+
collapsible: a
|
|
424
|
+
}) : p : null, [
|
|
425
|
+
p,
|
|
426
|
+
S,
|
|
427
|
+
C,
|
|
428
|
+
a
|
|
403
429
|
]);
|
|
404
430
|
return /* @__PURE__ */ jsx("div", {
|
|
405
|
-
ref:
|
|
406
|
-
className: cn_default(
|
|
407
|
-
...
|
|
408
|
-
children:
|
|
431
|
+
ref: y,
|
|
432
|
+
className: cn_default(w),
|
|
433
|
+
...v,
|
|
434
|
+
children: T
|
|
409
435
|
});
|
|
410
|
-
}), CollapsePanel = forwardRef(({ key:
|
|
411
|
-
let
|
|
412
|
-
|
|
413
|
-
},
|
|
414
|
-
|
|
415
|
-
},
|
|
416
|
-
className: cn_default("shrink-0 transition-transform duration-200 ease-in-out",
|
|
417
|
-
onClick:
|
|
418
|
-
children:
|
|
436
|
+
}), CollapsePanel = forwardRef(({ key: e, header: t, children: n, disabled: r = !1, showArrow: i = !0, arrow: a, className: o, headerContainerClassName: s, headerContentClassName: c, contentClassName: l, onHeaderClick: u, isActive: d = !1, onToggle: f, collapsible: p = "header", ...m }, h) => {
|
|
437
|
+
let _ = () => {
|
|
438
|
+
r || p === "disabled" || (u?.(e), f?.());
|
|
439
|
+
}, v = (e) => {
|
|
440
|
+
p !== "header" && (e.stopPropagation(), r || f?.());
|
|
441
|
+
}, y = () => i ? a ? /* @__PURE__ */ jsx("span", {
|
|
442
|
+
className: cn_default("shrink-0 transition-transform duration-200 ease-in-out", d ? "rotate-180" : "rotate-0", r ? "opacity-50" : "", p === "icon" ? "cursor-pointer" : ""),
|
|
443
|
+
onClick: v,
|
|
444
|
+
children: a
|
|
419
445
|
}) : /* @__PURE__ */ jsx(DefaultArrowIcon, {
|
|
420
|
-
isActive:
|
|
421
|
-
disabled:
|
|
446
|
+
isActive: d,
|
|
447
|
+
disabled: r
|
|
422
448
|
}) : null;
|
|
423
449
|
return /* @__PURE__ */ jsxs("div", {
|
|
424
|
-
ref:
|
|
425
|
-
className: cn_default("border-b border-gray-200 last:border-b-0",
|
|
426
|
-
...
|
|
450
|
+
ref: h,
|
|
451
|
+
className: cn_default("border-b border-gray-200 last:border-b-0", o),
|
|
452
|
+
...m,
|
|
427
453
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
428
|
-
className: cn_default("flex items-center justify-between w-full text-left font-medium transition-colors duration-200", "px-4 py-3",
|
|
429
|
-
onClick:
|
|
430
|
-
tabIndex:
|
|
454
|
+
className: cn_default("flex items-center justify-between w-full text-left font-medium transition-colors duration-200", "px-4 py-3", r ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:bg-gray-50", "focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-inset", s),
|
|
455
|
+
onClick: _,
|
|
456
|
+
tabIndex: r ? -1 : 0,
|
|
431
457
|
role: "button",
|
|
432
|
-
"aria-expanded":
|
|
433
|
-
"aria-disabled":
|
|
458
|
+
"aria-expanded": d,
|
|
459
|
+
"aria-disabled": r,
|
|
434
460
|
children: [/* @__PURE__ */ jsx("div", {
|
|
435
|
-
className: cn_default("flex-1 pr-2",
|
|
436
|
-
children:
|
|
437
|
-
}),
|
|
461
|
+
className: cn_default("flex-1 pr-2", c),
|
|
462
|
+
children: t
|
|
463
|
+
}), y()]
|
|
438
464
|
}), /* @__PURE__ */ jsx("div", {
|
|
439
|
-
className: cn_default("overflow-hidden transition-all duration-300 ease-in-out",
|
|
465
|
+
className: cn_default("overflow-hidden transition-all duration-300 ease-in-out", d ? "max-h-none opacity-100" : "max-h-0 opacity-0"),
|
|
440
466
|
children: /* @__PURE__ */ jsx("div", {
|
|
441
|
-
className: cn_default("px-4 pb-4 text-gray-700",
|
|
442
|
-
children:
|
|
467
|
+
className: cn_default("px-4 pb-4 text-gray-700", l),
|
|
468
|
+
children: n
|
|
443
469
|
})
|
|
444
470
|
})]
|
|
445
471
|
});
|
|
446
472
|
});
|
|
447
473
|
CollapsePanel.displayName = "CollapsePanel";
|
|
448
474
|
var Collapse_default = Object.assign(CollapseCore, { Panel: CollapsePanel });
|
|
449
|
-
const getOrientationStyles = (
|
|
475
|
+
const getOrientationStyles = (e) => ({
|
|
450
476
|
horizontal: "w-full h-0",
|
|
451
477
|
vertical: "h-full w-0"
|
|
452
|
-
})[
|
|
453
|
-
thin:
|
|
454
|
-
medium:
|
|
455
|
-
thick:
|
|
456
|
-
"extra-thick":
|
|
457
|
-
})[
|
|
458
|
-
|
|
459
|
-
getOrientationStyles(
|
|
460
|
-
getThicknessStyles(
|
|
461
|
-
getRoundedStyles(
|
|
462
|
-
getColorStyles(
|
|
463
|
-
getDashedStyles(
|
|
464
|
-
getLengthStyles(
|
|
478
|
+
})[e], getThicknessStyles = (e, t) => ({
|
|
479
|
+
thin: t === "horizontal" ? "h-px" : "w-px",
|
|
480
|
+
medium: t === "horizontal" ? "h-0.5" : "w-0.5",
|
|
481
|
+
thick: t === "horizontal" ? "h-1" : "w-1",
|
|
482
|
+
"extra-thick": t === "horizontal" ? "h-1.5" : "w-1.5"
|
|
483
|
+
})[e], getRoundedStyles = (e) => e ? "rounded-full" : "rounded-none", getColorStyles = (e) => e ? `bg-[${e}]` : "bg-gray-200", getDashedStyles = (e) => e ? "border-dashed" : "border-solid", getLengthStyles = (e, t = "horizontal") => e && t === "horizontal" ? `w-[${e}%]` : "", getDividerStyles = (e = "horizontal", t = "medium", n = !1, r, i = !1, a, o) => o ? ["block", o].filter(Boolean).join(" ").trim() : [
|
|
484
|
+
e === "vertical" ? "bg-gray-200" : "border-0",
|
|
485
|
+
getOrientationStyles(e),
|
|
486
|
+
getThicknessStyles(t, e),
|
|
487
|
+
getRoundedStyles(n),
|
|
488
|
+
getColorStyles(r),
|
|
489
|
+
getDashedStyles(i),
|
|
490
|
+
getLengthStyles(a, e)
|
|
465
491
|
].filter(Boolean).join(" ").replace(/\s+/g, " ").trim();
|
|
466
|
-
var Divider_default = forwardRef(({ orientation:
|
|
467
|
-
ref:
|
|
468
|
-
className: cn_default(getDividerStyles(
|
|
469
|
-
...
|
|
492
|
+
var Divider_default = forwardRef(({ orientation: e = "horizontal", thickness: t = "medium", rounded: n = !1, color: r, dashed: i = !1, length: a, className: o, ...s }, c) => /* @__PURE__ */ jsx("div", {
|
|
493
|
+
ref: c,
|
|
494
|
+
className: cn_default(getDividerStyles(e, t, n ?? !1, r, i, a, o), o),
|
|
495
|
+
...s
|
|
470
496
|
}));
|
|
471
|
-
const getDrawerPlacementStyles = (
|
|
472
|
-
let
|
|
497
|
+
const getDrawerPlacementStyles = (e) => {
|
|
498
|
+
let t = {
|
|
473
499
|
top: "top-0 left-0 right-0",
|
|
474
500
|
right: "top-0 right-0 bottom-0",
|
|
475
501
|
bottom: "bottom-0 left-0 right-0",
|
|
476
502
|
left: "top-0 left-0 bottom-0"
|
|
477
503
|
};
|
|
478
|
-
return
|
|
479
|
-
}, getDrawerSizeStyles = (
|
|
480
|
-
let
|
|
481
|
-
if (
|
|
482
|
-
let
|
|
483
|
-
sm:
|
|
484
|
-
md:
|
|
485
|
-
lg:
|
|
504
|
+
return t[e] || t.right;
|
|
505
|
+
}, getDrawerSizeStyles = (e, t) => {
|
|
506
|
+
let n = t === "left" || t === "right";
|
|
507
|
+
if (e === "full") return "w-screen h-screen";
|
|
508
|
+
let r = {
|
|
509
|
+
sm: n ? "w-64" : "h-64",
|
|
510
|
+
md: n ? "w-96" : "h-96",
|
|
511
|
+
lg: n ? "w-[46rem]" : "h-[46rem]"
|
|
486
512
|
};
|
|
487
|
-
return
|
|
488
|
-
}, getDrawerTransformStyles = (
|
|
489
|
-
if (
|
|
490
|
-
let
|
|
513
|
+
return r[e] || r.md;
|
|
514
|
+
}, getDrawerTransformStyles = (e, t) => {
|
|
515
|
+
if (t) return "translate-x-0 translate-y-0";
|
|
516
|
+
let n = {
|
|
491
517
|
top: "-translate-y-full",
|
|
492
518
|
right: "translate-x-full",
|
|
493
519
|
bottom: "translate-y-full",
|
|
494
520
|
left: "-translate-x-full"
|
|
495
521
|
};
|
|
496
|
-
return
|
|
497
|
-
}, getDrawerStyles = (
|
|
522
|
+
return n[e] || n.right;
|
|
523
|
+
}, getDrawerStyles = (e, t, n, r) => [
|
|
498
524
|
"fixed bg-white shadow-xl transition-transform duration-300 ease-out z-50 flex flex-col will-change-transform",
|
|
499
|
-
getDrawerPlacementStyles(
|
|
500
|
-
getDrawerSizeStyles(
|
|
501
|
-
getDrawerTransformStyles(
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
].filter(Boolean).join(" ").replace(/\s+/g, " ").trim(), getMaskStyles = (
|
|
525
|
+
getDrawerPlacementStyles(e),
|
|
526
|
+
getDrawerSizeStyles(t, e),
|
|
527
|
+
getDrawerTransformStyles(e, n),
|
|
528
|
+
n ? "pointer-events-auto" : "pointer-events-none",
|
|
529
|
+
r
|
|
530
|
+
].filter(Boolean).join(" ").replace(/\s+/g, " ").trim(), getMaskStyles = (e, t) => [
|
|
505
531
|
"fixed inset-0 h-screen bg-black/50 transition-opacity duration-300 ease-out z-40",
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
].filter(Boolean).join(" ").replace(/\s+/g, " ").trim(), getHeaderStyles = (
|
|
510
|
-
var DefaultCloseIcon = () => /* @__PURE__ */ jsx(CloseIcon_default, { className: "w-5 h-5" }), Drawer_default = forwardRef(({ open:
|
|
511
|
-
let [
|
|
532
|
+
e ? "opacity-100" : "opacity-0",
|
|
533
|
+
e ? "pointer-events-auto" : "pointer-events-none",
|
|
534
|
+
t
|
|
535
|
+
].filter(Boolean).join(" ").replace(/\s+/g, " ").trim(), getHeaderStyles = (e) => ["flex items-center justify-between px-6 py-4 border-b border-gray-200 flex-shrink-0", e].filter(Boolean).join(" ").replace(/\s+/g, " ").trim(), getBodyStyles = (e) => ["min-h-0 flex-1 overflow-y-auto", e].filter(Boolean).join(" ").replace(/\s+/g, " ").trim(), getFooterStyles = (e) => ["flex items-center justify-end px-6 py-4 border-t border-gray-200 flex-shrink-0 gap-2", e].filter(Boolean).join(" ").replace(/\s+/g, " ").trim();
|
|
536
|
+
var DefaultCloseIcon = () => /* @__PURE__ */ jsx(CloseIcon_default, { className: "w-5 h-5" }), Drawer_default = forwardRef(({ open: e = !1, title: t, placement: n = "right", size: o = "md", mask: s = !0, maskClosable: c = !0, closable: d = !0, closeIcon: f, destroyOnClose: p = !1, className: m, maskClassName: h, bodyClassName: _, headerClassName: v, footerClassName: y, children: b, footer: x, extra: S, onClose: C, afterOpenChange: w, zIndex: T = 1e3, ...E }, D) => {
|
|
537
|
+
let [O, k] = useState(e), [A, j] = useState(!1);
|
|
512
538
|
useEffect(() => {
|
|
513
|
-
if (
|
|
514
|
-
|
|
539
|
+
if (e) startTransition(() => {
|
|
540
|
+
k(!0);
|
|
515
541
|
}), requestAnimationFrame(() => {
|
|
516
542
|
requestAnimationFrame(() => {
|
|
517
|
-
|
|
543
|
+
j(!0);
|
|
518
544
|
});
|
|
519
545
|
});
|
|
520
546
|
else {
|
|
521
547
|
startTransition(() => {
|
|
522
|
-
|
|
548
|
+
j(!1);
|
|
523
549
|
});
|
|
524
|
-
let
|
|
525
|
-
|
|
550
|
+
let e = setTimeout(() => {
|
|
551
|
+
k(!1);
|
|
526
552
|
}, 300);
|
|
527
|
-
return () => clearTimeout(
|
|
553
|
+
return () => clearTimeout(e);
|
|
528
554
|
}
|
|
529
|
-
}, [
|
|
530
|
-
if (!
|
|
531
|
-
let
|
|
532
|
-
|
|
555
|
+
}, [e]), useEffect(() => {
|
|
556
|
+
if (!e) return;
|
|
557
|
+
let t = (e) => {
|
|
558
|
+
e.key === "Escape" && C && C();
|
|
533
559
|
};
|
|
534
|
-
return document.addEventListener("keydown",
|
|
535
|
-
}, [
|
|
536
|
-
let
|
|
537
|
-
|
|
538
|
-
}, [
|
|
539
|
-
|
|
540
|
-
}, [
|
|
560
|
+
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
561
|
+
}, [e, C]);
|
|
562
|
+
let M = useCallback(() => {
|
|
563
|
+
c && C && C();
|
|
564
|
+
}, [c, C]), N = useCallback(() => {
|
|
565
|
+
C && C();
|
|
566
|
+
}, [C]);
|
|
541
567
|
return useEffect(() => {
|
|
542
|
-
|
|
543
|
-
}, [
|
|
544
|
-
if (!
|
|
545
|
-
let
|
|
546
|
-
|
|
547
|
-
let
|
|
548
|
-
return window.addEventListener("touchmove",
|
|
549
|
-
window.removeEventListener("touchmove",
|
|
568
|
+
w && w(e);
|
|
569
|
+
}, [e, w]), useEffect(() => {
|
|
570
|
+
if (!e) return;
|
|
571
|
+
let t = window.scrollY || 0, { style: n } = document.body, { style: r } = document.documentElement;
|
|
572
|
+
n.position = "fixed", n.top = `-${t}px`, n.left = "0", n.right = "0", n.width = "100%", n.overflow = "hidden", r.overflow = "hidden", r.overscrollBehavior = "none";
|
|
573
|
+
let i = (e) => e.preventDefault();
|
|
574
|
+
return window.addEventListener("touchmove", i, { passive: !1 }), window.addEventListener("wheel", i, { passive: !1 }), () => {
|
|
575
|
+
window.removeEventListener("touchmove", i), window.removeEventListener("wheel", i), n.position = "", n.top = "", n.left = "", n.right = "", n.width = "", n.overflow = "", r.overflow = "", r.overscrollBehavior = "", window.scrollTo(0, t);
|
|
550
576
|
};
|
|
551
|
-
}, [
|
|
552
|
-
className: cn_default(getMaskStyles(
|
|
553
|
-
style: { zIndex:
|
|
554
|
-
onClick:
|
|
577
|
+
}, [e]), !O && p || !O ? null : /* @__PURE__ */ jsxs(Fragment, { children: [s && /* @__PURE__ */ jsx("div", {
|
|
578
|
+
className: cn_default(getMaskStyles(A, h)),
|
|
579
|
+
style: { zIndex: T - 1 },
|
|
580
|
+
onClick: M,
|
|
555
581
|
"aria-hidden": "true"
|
|
556
582
|
}), /* @__PURE__ */ jsxs("div", {
|
|
557
|
-
ref:
|
|
558
|
-
className: cn_default(getDrawerStyles(
|
|
583
|
+
ref: D,
|
|
584
|
+
className: cn_default(getDrawerStyles(n, o, A, m)),
|
|
559
585
|
style: {
|
|
560
|
-
zIndex:
|
|
561
|
-
height:
|
|
586
|
+
zIndex: T,
|
|
587
|
+
height: o === "full" && (n === "left" || n === "right") ? "100vh" : void 0
|
|
562
588
|
},
|
|
563
589
|
role: "dialog",
|
|
564
590
|
"aria-modal": "true",
|
|
565
|
-
"aria-labelledby":
|
|
566
|
-
...
|
|
591
|
+
"aria-labelledby": t ? "drawer-title" : void 0,
|
|
592
|
+
...E,
|
|
567
593
|
children: [
|
|
568
|
-
(
|
|
569
|
-
className: cn_default(getHeaderStyles(
|
|
594
|
+
(t || d || S) && /* @__PURE__ */ jsxs("div", {
|
|
595
|
+
className: cn_default(getHeaderStyles(v)),
|
|
570
596
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
571
597
|
className: "flex items-center gap-4 flex-1",
|
|
572
|
-
children: [
|
|
598
|
+
children: [t && /* @__PURE__ */ jsx("h2", {
|
|
573
599
|
id: "drawer-title",
|
|
574
600
|
className: "text-lg font-semibold text-gray-900 flex-1",
|
|
575
|
-
children:
|
|
576
|
-
}),
|
|
601
|
+
children: t
|
|
602
|
+
}), S && /* @__PURE__ */ jsx("div", {
|
|
577
603
|
className: "flex items-center gap-2",
|
|
578
|
-
children:
|
|
604
|
+
children: S
|
|
579
605
|
})]
|
|
580
|
-
}),
|
|
606
|
+
}), d && /* @__PURE__ */ jsx("button", {
|
|
581
607
|
type: "button",
|
|
582
|
-
onClick:
|
|
608
|
+
onClick: N,
|
|
583
609
|
className: "p-2 rounded-lg text-gray-500 hover:text-gray-700 hover:bg-gray-100 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2",
|
|
584
610
|
"aria-label": "关闭抽屉",
|
|
585
|
-
children:
|
|
611
|
+
children: f || /* @__PURE__ */ jsx(DefaultCloseIcon, {})
|
|
586
612
|
})]
|
|
587
613
|
}),
|
|
588
614
|
/* @__PURE__ */ jsx("div", {
|
|
589
|
-
className: cn_default(getBodyStyles(
|
|
615
|
+
className: cn_default(getBodyStyles(_), "min-h-0 flex-1 overflow-y-auto"),
|
|
590
616
|
style: { overscrollBehavior: "contain" },
|
|
591
|
-
onWheel: (
|
|
592
|
-
|
|
617
|
+
onWheel: (e) => {
|
|
618
|
+
e.stopPropagation();
|
|
593
619
|
},
|
|
594
|
-
onTouchMove: (
|
|
595
|
-
|
|
620
|
+
onTouchMove: (e) => {
|
|
621
|
+
e.stopPropagation();
|
|
596
622
|
},
|
|
597
|
-
children:
|
|
623
|
+
children: b
|
|
598
624
|
}),
|
|
599
|
-
|
|
600
|
-
className: cn_default(getFooterStyles(
|
|
601
|
-
children:
|
|
625
|
+
x && /* @__PURE__ */ jsx("div", {
|
|
626
|
+
className: cn_default(getFooterStyles(y)),
|
|
627
|
+
children: x
|
|
602
628
|
})
|
|
603
629
|
]
|
|
604
630
|
})] });
|
|
605
631
|
});
|
|
606
|
-
function getEmptyStateStyles(
|
|
632
|
+
function getEmptyStateStyles(e = "md", t = "default", n) {
|
|
607
633
|
return cn_default("flex flex-col items-center justify-center text-center", {
|
|
608
634
|
sm: "py-8 px-4",
|
|
609
635
|
md: "py-12 px-6",
|
|
610
636
|
lg: "py-16 px-8"
|
|
611
|
-
}[
|
|
637
|
+
}[e], {
|
|
612
638
|
default: "bg-gray-50 rounded-lg",
|
|
613
639
|
minimal: "bg-transparent",
|
|
614
640
|
card: "bg-white border border-gray-200 rounded-lg shadow-sm"
|
|
615
|
-
}[
|
|
641
|
+
}[t], n);
|
|
616
642
|
}
|
|
617
|
-
function getIconContainerStyles(
|
|
643
|
+
function getIconContainerStyles(e = "md") {
|
|
618
644
|
return cn_default("flex items-center justify-center text-gray-400", {
|
|
619
645
|
sm: "w-12 h-12 mb-3",
|
|
620
646
|
md: "w-16 h-16 mb-4",
|
|
621
647
|
lg: "w-20 h-20 mb-6"
|
|
622
|
-
}[
|
|
648
|
+
}[e]);
|
|
623
649
|
}
|
|
624
|
-
function getTitleStyles(
|
|
650
|
+
function getTitleStyles(e = "md") {
|
|
625
651
|
return cn_default("text-gray-900 mb-2", {
|
|
626
652
|
sm: "text-lg font-semibold",
|
|
627
653
|
md: "text-xl font-semibold",
|
|
628
654
|
lg: "text-2xl font-semibold"
|
|
629
|
-
}[
|
|
655
|
+
}[e]);
|
|
630
656
|
}
|
|
631
|
-
function getDescriptionStyles(
|
|
657
|
+
function getDescriptionStyles(e = "md") {
|
|
632
658
|
return cn_default("text-gray-600 mb-4 max-w-md", {
|
|
633
659
|
sm: "text-sm",
|
|
634
660
|
md: "text-base",
|
|
635
661
|
lg: "text-lg"
|
|
636
|
-
}[
|
|
662
|
+
}[e]);
|
|
637
663
|
}
|
|
638
664
|
function getActionStyles() {
|
|
639
665
|
return "mt-2";
|
|
640
666
|
}
|
|
641
|
-
function EmptyStateIcon({ type:
|
|
642
|
-
let
|
|
643
|
-
search: /* @__PURE__ */ jsx(SearchIcon_default, { className:
|
|
644
|
-
folder: /* @__PURE__ */ jsx(FolderIcon_default, { className:
|
|
645
|
-
document: /* @__PURE__ */ jsx(DocumentIcon_default, { className:
|
|
646
|
-
users: /* @__PURE__ */ jsx(UsersIcon_default, { className:
|
|
647
|
-
settings: /* @__PURE__ */ jsx(SettingsIcon_default, { className:
|
|
648
|
-
warning: /* @__PURE__ */ jsx(WarningIcon_default, { className:
|
|
649
|
-
info: /* @__PURE__ */ jsx(InfoIcon_default, { className:
|
|
650
|
-
success: /* @__PURE__ */ jsx(SuccessIcon_default, { className:
|
|
651
|
-
error: /* @__PURE__ */ jsx(ErrorIcon_default, { className:
|
|
667
|
+
function EmptyStateIcon({ type: e, className: t }) {
|
|
668
|
+
let n = {
|
|
669
|
+
search: /* @__PURE__ */ jsx(SearchIcon_default, { className: t }),
|
|
670
|
+
folder: /* @__PURE__ */ jsx(FolderIcon_default, { className: t }),
|
|
671
|
+
document: /* @__PURE__ */ jsx(DocumentIcon_default, { className: t }),
|
|
672
|
+
users: /* @__PURE__ */ jsx(UsersIcon_default, { className: t }),
|
|
673
|
+
settings: /* @__PURE__ */ jsx(SettingsIcon_default, { className: t }),
|
|
674
|
+
warning: /* @__PURE__ */ jsx(WarningIcon_default, { className: t }),
|
|
675
|
+
info: /* @__PURE__ */ jsx(InfoIcon_default, { className: t }),
|
|
676
|
+
success: /* @__PURE__ */ jsx(SuccessIcon_default, { className: t }),
|
|
677
|
+
error: /* @__PURE__ */ jsx(ErrorIcon_default, { className: t })
|
|
652
678
|
};
|
|
653
|
-
return
|
|
679
|
+
return n[e] || n.search;
|
|
654
680
|
}
|
|
655
|
-
var EmptyState_default = forwardRef(({ icon:
|
|
656
|
-
let
|
|
657
|
-
className:
|
|
681
|
+
var EmptyState_default = forwardRef(({ icon: e = "search", title: t, description: n, action: r, size: i = "md", variant: a = "default", className: o, showIcon: s = !0, style: c, ...l }, u) => {
|
|
682
|
+
let d = getEmptyStateStyles(i, a, o), f = getIconContainerStyles(i), p = getTitleStyles(i), m = getDescriptionStyles(i), h = getActionStyles(), g = () => s ? typeof e == "string" ? /* @__PURE__ */ jsx("div", {
|
|
683
|
+
className: f,
|
|
658
684
|
children: /* @__PURE__ */ jsx(EmptyStateIcon, {
|
|
659
|
-
type:
|
|
685
|
+
type: e,
|
|
660
686
|
className: "w-full h-full"
|
|
661
687
|
})
|
|
662
688
|
}) : /* @__PURE__ */ jsx("div", {
|
|
663
|
-
className:
|
|
664
|
-
children:
|
|
689
|
+
className: f,
|
|
690
|
+
children: e
|
|
665
691
|
}) : null;
|
|
666
692
|
return /* @__PURE__ */ jsxs("div", {
|
|
667
|
-
ref:
|
|
668
|
-
className:
|
|
669
|
-
style:
|
|
670
|
-
...
|
|
693
|
+
ref: u,
|
|
694
|
+
className: d,
|
|
695
|
+
style: c,
|
|
696
|
+
...l,
|
|
671
697
|
children: [
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
className:
|
|
675
|
-
children:
|
|
698
|
+
g(),
|
|
699
|
+
t && /* @__PURE__ */ jsx("h3", {
|
|
700
|
+
className: p,
|
|
701
|
+
children: t
|
|
676
702
|
}),
|
|
677
|
-
|
|
678
|
-
className:
|
|
679
|
-
children:
|
|
703
|
+
n && /* @__PURE__ */ jsx("p", {
|
|
704
|
+
className: m,
|
|
705
|
+
children: n
|
|
680
706
|
}),
|
|
681
|
-
|
|
682
|
-
className:
|
|
683
|
-
children:
|
|
707
|
+
r && /* @__PURE__ */ jsx("div", {
|
|
708
|
+
className: h,
|
|
709
|
+
children: r
|
|
684
710
|
})
|
|
685
711
|
]
|
|
686
712
|
});
|
|
@@ -698,29 +724,29 @@ const SIZE_MAP = {
|
|
|
698
724
|
lg: "text-lg",
|
|
699
725
|
xl: "text-xl"
|
|
700
726
|
};
|
|
701
|
-
function getLoaderSize(
|
|
702
|
-
return SIZE_MAP[
|
|
727
|
+
function getLoaderSize(e) {
|
|
728
|
+
return SIZE_MAP[e];
|
|
703
729
|
}
|
|
704
|
-
function getTextSize(
|
|
705
|
-
return TEXT_SIZE_MAP[
|
|
730
|
+
function getTextSize(e) {
|
|
731
|
+
return TEXT_SIZE_MAP[e];
|
|
706
732
|
}
|
|
707
|
-
var Loading_default = ({ size:
|
|
733
|
+
var Loading_default = ({ size: e = "md", variant: t = "spinner", text: n, showText: r = !1, fullscreen: i = !1, className: o }) => {
|
|
708
734
|
useEffect(() => {
|
|
709
|
-
if (!
|
|
710
|
-
let
|
|
711
|
-
return document.body.style.overflow = "hidden",
|
|
712
|
-
document.body.style.overflow =
|
|
735
|
+
if (!i) return;
|
|
736
|
+
let e = document.body.style.overflow, t = document.body.style.paddingRight, n = window.innerWidth - document.documentElement.clientWidth;
|
|
737
|
+
return document.body.style.overflow = "hidden", n > 0 && (document.body.style.paddingRight = `${n}px`), () => {
|
|
738
|
+
document.body.style.overflow = e, document.body.style.paddingRight = t;
|
|
713
739
|
};
|
|
714
|
-
}, [
|
|
715
|
-
let
|
|
716
|
-
className: cn_default("flex flex-col items-center justify-center gap-4",
|
|
740
|
+
}, [i]);
|
|
741
|
+
let s = /* @__PURE__ */ jsxs("div", {
|
|
742
|
+
className: cn_default("flex flex-col items-center justify-center gap-4", i ? "min-h-screen" : "py-8", o),
|
|
717
743
|
children: [(() => {
|
|
718
|
-
let
|
|
719
|
-
switch (
|
|
744
|
+
let n = getLoaderSize(e);
|
|
745
|
+
switch (t) {
|
|
720
746
|
case "spinner": return /* @__PURE__ */ jsxs("div", {
|
|
721
747
|
className: "relative",
|
|
722
|
-
children: [/* @__PURE__ */ jsx("div", { className: cn_default("rounded-full border-4 border-gray-200",
|
|
723
|
-
className: cn_default("absolute inset-0 rounded-full border-4 border-transparent border-t-blue-600 animate-spin",
|
|
748
|
+
children: [/* @__PURE__ */ jsx("div", { className: cn_default("rounded-full border-4 border-gray-200", n) }), /* @__PURE__ */ jsx("div", {
|
|
749
|
+
className: cn_default("absolute inset-0 rounded-full border-4 border-transparent border-t-blue-600 animate-spin", n),
|
|
724
750
|
style: { animationDuration: "0.8s" }
|
|
725
751
|
})]
|
|
726
752
|
});
|
|
@@ -728,21 +754,21 @@ var Loading_default = ({ size: r = "md", variant: i = "spinner", text: a, showTe
|
|
|
728
754
|
className: "flex items-center gap-2",
|
|
729
755
|
children: [
|
|
730
756
|
/* @__PURE__ */ jsx("span", {
|
|
731
|
-
className: cn_default("rounded-full bg-blue-600 animate-bounce",
|
|
757
|
+
className: cn_default("rounded-full bg-blue-600 animate-bounce", n),
|
|
732
758
|
style: {
|
|
733
759
|
animationDelay: "0ms",
|
|
734
760
|
animationDuration: "1s"
|
|
735
761
|
}
|
|
736
762
|
}),
|
|
737
763
|
/* @__PURE__ */ jsx("span", {
|
|
738
|
-
className: cn_default("rounded-full bg-blue-600 animate-bounce",
|
|
764
|
+
className: cn_default("rounded-full bg-blue-600 animate-bounce", n),
|
|
739
765
|
style: {
|
|
740
766
|
animationDelay: "150ms",
|
|
741
767
|
animationDuration: "1s"
|
|
742
768
|
}
|
|
743
769
|
}),
|
|
744
770
|
/* @__PURE__ */ jsx("span", {
|
|
745
|
-
className: cn_default("rounded-full bg-blue-600 animate-bounce",
|
|
771
|
+
className: cn_default("rounded-full bg-blue-600 animate-bounce", n),
|
|
746
772
|
style: {
|
|
747
773
|
animationDelay: "300ms",
|
|
748
774
|
animationDuration: "1s"
|
|
@@ -750,7 +776,7 @@ var Loading_default = ({ size: r = "md", variant: i = "spinner", text: a, showTe
|
|
|
750
776
|
})
|
|
751
777
|
]
|
|
752
778
|
});
|
|
753
|
-
case "pulse": return /* @__PURE__ */ jsx("div", { className: cn_default("rounded-full bg-blue-600 animate-pulse",
|
|
779
|
+
case "pulse": return /* @__PURE__ */ jsx("div", { className: cn_default("rounded-full bg-blue-600 animate-pulse", n) });
|
|
754
780
|
case "skeleton": return /* @__PURE__ */ jsxs("div", {
|
|
755
781
|
className: "space-y-3 w-full",
|
|
756
782
|
children: [
|
|
@@ -761,15 +787,15 @@ var Loading_default = ({ size: r = "md", variant: i = "spinner", text: a, showTe
|
|
|
761
787
|
});
|
|
762
788
|
default: return null;
|
|
763
789
|
}
|
|
764
|
-
})(),
|
|
765
|
-
className: cn_default("text-gray-700 font-medium", getTextSize(
|
|
766
|
-
children:
|
|
790
|
+
})(), r && n && /* @__PURE__ */ jsx("p", {
|
|
791
|
+
className: cn_default("text-gray-700 font-medium", getTextSize(e)),
|
|
792
|
+
children: n
|
|
767
793
|
})]
|
|
768
794
|
});
|
|
769
|
-
return
|
|
795
|
+
return i ? /* @__PURE__ */ jsx("div", {
|
|
770
796
|
className: "fixed inset-0 bg-white/70 backdrop-blur-[2px] z-50 flex items-center justify-center transition-all duration-300",
|
|
771
|
-
children:
|
|
772
|
-
}) :
|
|
797
|
+
children: s
|
|
798
|
+
}) : s;
|
|
773
799
|
};
|
|
774
800
|
const paginationStyles = {
|
|
775
801
|
base: "flex items-center gap-1 text-sm",
|
|
@@ -810,118 +836,118 @@ const paginationStyles = {
|
|
|
810
836
|
separator: "text-gray-500"
|
|
811
837
|
}
|
|
812
838
|
};
|
|
813
|
-
function getPaginationStyles(
|
|
814
|
-
let
|
|
839
|
+
function getPaginationStyles(e = "middle", t = "left", n) {
|
|
840
|
+
let r = [
|
|
815
841
|
paginationStyles.base,
|
|
816
|
-
paginationStyles.sizes[
|
|
817
|
-
paginationStyles.alignments[
|
|
842
|
+
paginationStyles.sizes[e],
|
|
843
|
+
paginationStyles.alignments[t]
|
|
818
844
|
].filter(Boolean).join(" ");
|
|
819
|
-
return
|
|
845
|
+
return n ? `${r} ${n}` : r;
|
|
820
846
|
}
|
|
821
|
-
function getPaginationItemStyles(
|
|
822
|
-
let
|
|
847
|
+
function getPaginationItemStyles(e, t, n, r) {
|
|
848
|
+
let i = [
|
|
823
849
|
paginationStyles.item.base,
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
850
|
+
e && paginationStyles.item.active,
|
|
851
|
+
t && paginationStyles.item.disabled,
|
|
852
|
+
n && paginationStyles.item.ellipsis
|
|
827
853
|
].filter(Boolean).join(" ");
|
|
828
|
-
return
|
|
854
|
+
return r ? `${i} ${r}` : i;
|
|
829
855
|
}
|
|
830
|
-
function getPaginationJumpStyles(
|
|
831
|
-
let
|
|
832
|
-
return
|
|
856
|
+
function getPaginationJumpStyles(e, t) {
|
|
857
|
+
let n = [paginationStyles.jump.base, e && paginationStyles.jump.disabled].filter(Boolean).join(" ");
|
|
858
|
+
return t ? `${n} ${t}` : n;
|
|
833
859
|
}
|
|
834
|
-
function getPaginationSizeChangerStyles(
|
|
835
|
-
return
|
|
860
|
+
function getPaginationSizeChangerStyles(e) {
|
|
861
|
+
return e ? `${paginationStyles.sizeChanger.base} ${e}` : paginationStyles.sizeChanger.base;
|
|
836
862
|
}
|
|
837
|
-
function getPaginationQuickJumperStyles(
|
|
838
|
-
return
|
|
863
|
+
function getPaginationQuickJumperStyles(e) {
|
|
864
|
+
return e ? `${paginationStyles.quickJumper.base} ${e}` : paginationStyles.quickJumper.base;
|
|
839
865
|
}
|
|
840
|
-
function getPaginationTotalStyles(
|
|
841
|
-
return
|
|
866
|
+
function getPaginationTotalStyles(e) {
|
|
867
|
+
return e ? `${paginationStyles.total.base} ${e}` : paginationStyles.total.base;
|
|
842
868
|
}
|
|
843
|
-
function getPaginationSimpleStyles(
|
|
844
|
-
return
|
|
869
|
+
function getPaginationSimpleStyles(e) {
|
|
870
|
+
return e ? `${paginationStyles.simple.base} ${e}` : paginationStyles.simple.base;
|
|
845
871
|
}
|
|
846
|
-
var PaginationItem = ({ page:
|
|
847
|
-
className: getPaginationItemStyles(
|
|
872
|
+
var PaginationItem = ({ page: e, active: t = !1, disabled: n = !1, onClick: r, className: i, ellipsis: a = !1, children: o }) => /* @__PURE__ */ jsx("button", {
|
|
873
|
+
className: getPaginationItemStyles(t, n, a, i),
|
|
848
874
|
onClick: () => {
|
|
849
|
-
!
|
|
875
|
+
!n && !a && r && r(e);
|
|
850
876
|
},
|
|
851
|
-
disabled:
|
|
877
|
+
disabled: n,
|
|
852
878
|
type: "button",
|
|
853
|
-
children:
|
|
854
|
-
}), PaginationJump = ({ onClick:
|
|
855
|
-
className: getPaginationJumpStyles(
|
|
879
|
+
children: o || e
|
|
880
|
+
}), PaginationJump = ({ onClick: e, disabled: t = !1, className: n, icon: r, title: i }) => /* @__PURE__ */ jsx("button", {
|
|
881
|
+
className: getPaginationJumpStyles(t, n),
|
|
856
882
|
onClick: () => {
|
|
857
|
-
!
|
|
883
|
+
!t && e && e();
|
|
858
884
|
},
|
|
859
|
-
disabled:
|
|
885
|
+
disabled: t,
|
|
860
886
|
type: "button",
|
|
861
|
-
title:
|
|
862
|
-
children:
|
|
863
|
-
}), PaginationSizeChanger = ({ current:
|
|
864
|
-
className: getPaginationSizeChangerStyles(
|
|
887
|
+
title: i,
|
|
888
|
+
children: r
|
|
889
|
+
}), PaginationSizeChanger = ({ current: e, pageSize: t, pageSizeOptions: n, onChange: r, disabled: i = !1, className: a, itemsPerPageText: o = "每页条数" }) => /* @__PURE__ */ jsxs("div", {
|
|
890
|
+
className: getPaginationSizeChangerStyles(a),
|
|
865
891
|
children: [
|
|
866
892
|
/* @__PURE__ */ jsx("span", {
|
|
867
893
|
className: "text-gray-600",
|
|
868
|
-
children:
|
|
894
|
+
children: o
|
|
869
895
|
}),
|
|
870
896
|
/* @__PURE__ */ jsx("select", {
|
|
871
|
-
value:
|
|
872
|
-
onChange: (
|
|
873
|
-
|
|
897
|
+
value: t,
|
|
898
|
+
onChange: (t) => {
|
|
899
|
+
r(e, parseInt(t.target.value));
|
|
874
900
|
},
|
|
875
|
-
disabled:
|
|
901
|
+
disabled: i,
|
|
876
902
|
className: "px-2 py-1 border border-gray-300 rounded-md bg-white text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50 focus:border-blue-500",
|
|
877
|
-
children:
|
|
878
|
-
value:
|
|
879
|
-
children:
|
|
880
|
-
},
|
|
903
|
+
children: n.map((e) => /* @__PURE__ */ jsx("option", {
|
|
904
|
+
value: e,
|
|
905
|
+
children: e
|
|
906
|
+
}, e))
|
|
881
907
|
}),
|
|
882
908
|
/* @__PURE__ */ jsx("span", {
|
|
883
909
|
className: "text-gray-600",
|
|
884
|
-
children:
|
|
910
|
+
children: o
|
|
885
911
|
})
|
|
886
912
|
]
|
|
887
|
-
}), PaginationQuickJumper = ({ totalPages:
|
|
888
|
-
let [
|
|
889
|
-
let
|
|
890
|
-
|
|
913
|
+
}), PaginationQuickJumper = ({ totalPages: e, onJump: t, disabled: n = !1, className: r, jumpToText: i = "跳转到", pageText: a = "页" }) => {
|
|
914
|
+
let [o, s] = useState(""), c = () => {
|
|
915
|
+
let n = parseInt(o);
|
|
916
|
+
n >= 1 && n <= e && (t(n), s(""));
|
|
891
917
|
};
|
|
892
918
|
return /* @__PURE__ */ jsxs("div", {
|
|
893
|
-
className: getPaginationQuickJumperStyles(
|
|
919
|
+
className: getPaginationQuickJumperStyles(r),
|
|
894
920
|
children: [
|
|
895
921
|
/* @__PURE__ */ jsx("span", {
|
|
896
922
|
className: "text-gray-600",
|
|
897
|
-
children:
|
|
923
|
+
children: i
|
|
898
924
|
}),
|
|
899
925
|
/* @__PURE__ */ jsx("input", {
|
|
900
926
|
type: "number",
|
|
901
|
-
value:
|
|
902
|
-
onChange: (
|
|
903
|
-
onKeyUp: (
|
|
904
|
-
|
|
927
|
+
value: o,
|
|
928
|
+
onChange: (e) => s(e.target.value),
|
|
929
|
+
onKeyUp: (e) => {
|
|
930
|
+
e.key === "Enter" && c();
|
|
905
931
|
},
|
|
906
|
-
disabled:
|
|
932
|
+
disabled: n,
|
|
907
933
|
className: "w-16 px-2 py-1 border border-gray-300 rounded-md bg-white text-gray-700 text-center focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50 focus:border-blue-500",
|
|
908
|
-
placeholder:
|
|
934
|
+
placeholder: a,
|
|
909
935
|
min: "1",
|
|
910
|
-
max:
|
|
936
|
+
max: e
|
|
911
937
|
}),
|
|
912
938
|
/* @__PURE__ */ jsx("span", {
|
|
913
939
|
className: "text-gray-600",
|
|
914
|
-
children:
|
|
940
|
+
children: a
|
|
915
941
|
})
|
|
916
942
|
]
|
|
917
943
|
});
|
|
918
|
-
}, Pagination_default = ({ current:
|
|
944
|
+
}, Pagination_default = ({ current: e, defaultCurrent: t = 1, pageSize: n, defaultPageSize: i = 10, total: o = 0, onChange: c, onShowSizeChange: u, showQuickJumper: d = !1, showSizeChanger: f = !1, pageSizeOptions: p = [
|
|
919
945
|
"10",
|
|
920
946
|
"20",
|
|
921
947
|
"50",
|
|
922
948
|
"100"
|
|
923
|
-
], showTotal:
|
|
924
|
-
let
|
|
949
|
+
], showTotal: m = !1, showPrevNextJumpers: h = !0, showFirstLastJumpers: g = !1, disabled: _ = !1, hideOnSinglePage: v = !1, size: y = "middle", align: b = "left", className: x, style: S, simple: C = !1, prevIcon: w, nextIcon: T, firstIcon: E, lastIcon: D, jumpPrevIcon: O, jumpNextIcon: ze, texts: Be = {} }) => {
|
|
950
|
+
let F = {
|
|
925
951
|
itemsPerPage: "每页条数",
|
|
926
952
|
items: "条",
|
|
927
953
|
jumpTo: "跳转到",
|
|
@@ -933,32 +959,32 @@ var PaginationItem = ({ page: r, active: i = !1, disabled: a = !1, onClick: o, c
|
|
|
933
959
|
last: "末页",
|
|
934
960
|
jumpPrev: "向前5页",
|
|
935
961
|
jumpNext: "向后5页",
|
|
936
|
-
...
|
|
937
|
-
}, [
|
|
962
|
+
...Be
|
|
963
|
+
}, [I, L] = useState(e ?? t), [R, z] = useState(n ?? i), B = useMemo(() => Math.ceil(o / R), [o, R]);
|
|
938
964
|
if (useEffect(() => {
|
|
939
|
-
|
|
940
|
-
|
|
965
|
+
e !== void 0 && startTransition(() => {
|
|
966
|
+
L(e);
|
|
941
967
|
});
|
|
942
|
-
}, [
|
|
943
|
-
|
|
944
|
-
|
|
968
|
+
}, [e]), useEffect(() => {
|
|
969
|
+
n !== void 0 && startTransition(() => {
|
|
970
|
+
z(n);
|
|
945
971
|
});
|
|
946
|
-
}, [
|
|
947
|
-
if (
|
|
948
|
-
className: getPaginationSimpleStyles(
|
|
949
|
-
style:
|
|
972
|
+
}, [n]), v && B <= 1) return null;
|
|
973
|
+
if (C) return /* @__PURE__ */ jsxs("div", {
|
|
974
|
+
className: getPaginationSimpleStyles(x),
|
|
975
|
+
style: S,
|
|
950
976
|
children: [
|
|
951
977
|
/* @__PURE__ */ jsx("input", {
|
|
952
978
|
type: "number",
|
|
953
|
-
value:
|
|
954
|
-
onChange: (
|
|
955
|
-
let
|
|
956
|
-
|
|
979
|
+
value: I,
|
|
980
|
+
onChange: (e) => {
|
|
981
|
+
let t = parseInt(e.target.value);
|
|
982
|
+
t >= 1 && t <= B && (L(t), c?.(t, R));
|
|
957
983
|
},
|
|
958
|
-
disabled:
|
|
984
|
+
disabled: _,
|
|
959
985
|
className: "w-12 px-2 py-1 border border-gray-300 rounded-md bg-white text-gray-700 text-center focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50 focus:border-blue-500",
|
|
960
986
|
min: "1",
|
|
961
|
-
max:
|
|
987
|
+
max: B
|
|
962
988
|
}),
|
|
963
989
|
/* @__PURE__ */ jsx("span", {
|
|
964
990
|
className: "text-gray-500",
|
|
@@ -966,110 +992,326 @@ var PaginationItem = ({ page: r, active: i = !1, disabled: a = !1, onClick: o, c
|
|
|
966
992
|
}),
|
|
967
993
|
/* @__PURE__ */ jsx("span", {
|
|
968
994
|
className: "text-gray-600",
|
|
969
|
-
children:
|
|
995
|
+
children: B
|
|
970
996
|
})
|
|
971
997
|
]
|
|
972
998
|
});
|
|
973
|
-
let
|
|
974
|
-
let
|
|
975
|
-
|
|
976
|
-
let
|
|
977
|
-
for (let
|
|
978
|
-
return
|
|
979
|
-
},
|
|
980
|
-
|
|
981
|
-
},
|
|
982
|
-
let
|
|
983
|
-
|
|
984
|
-
},
|
|
985
|
-
|
|
986
|
-
},
|
|
987
|
-
|
|
988
|
-
},
|
|
989
|
-
|
|
990
|
-
},
|
|
999
|
+
let V = () => {
|
|
1000
|
+
let e = [], t = I > 4, n = I < B - 3;
|
|
1001
|
+
t && (e.push(1), I > 5 && e.push("prev-ellipsis"));
|
|
1002
|
+
let r = Math.max(1, I - 2), i = Math.min(B, I + 2);
|
|
1003
|
+
for (let t = r; t <= i; t++) e.push(t);
|
|
1004
|
+
return n && (I < B - 4 && e.push("next-ellipsis"), e.push(B)), e;
|
|
1005
|
+
}, H = (e) => {
|
|
1006
|
+
e !== I && e >= 1 && e <= B && (L(e), c?.(e, R));
|
|
1007
|
+
}, U = (e) => {
|
|
1008
|
+
let t = Math.ceil(o / e), n = Math.min(I, t);
|
|
1009
|
+
z(e), L(n), u?.(n, e), c?.(n, e);
|
|
1010
|
+
}, W = () => {
|
|
1011
|
+
H(Math.max(1, I - 5));
|
|
1012
|
+
}, G = () => {
|
|
1013
|
+
H(Math.min(B, I + 5));
|
|
1014
|
+
}, K = (e) => {
|
|
1015
|
+
H(e);
|
|
1016
|
+
}, q = V();
|
|
991
1017
|
return /* @__PURE__ */ jsxs("div", {
|
|
992
|
-
className: getPaginationStyles(
|
|
993
|
-
style:
|
|
1018
|
+
className: getPaginationStyles(y, b, x),
|
|
1019
|
+
style: S,
|
|
994
1020
|
children: [
|
|
995
|
-
|
|
1021
|
+
m && /* @__PURE__ */ jsx("div", {
|
|
996
1022
|
className: getPaginationTotalStyles(),
|
|
997
|
-
children: typeof
|
|
1023
|
+
children: typeof m == "function" ? m(o, [(I - 1) * R + 1, Math.min(I * R, o)]) : F.total.replace("{total}", o.toString())
|
|
998
1024
|
}),
|
|
999
|
-
|
|
1000
|
-
className: getPaginationJumpStyles(
|
|
1001
|
-
onClick: () =>
|
|
1002
|
-
disabled:
|
|
1025
|
+
g && I > 1 && /* @__PURE__ */ jsx("button", {
|
|
1026
|
+
className: getPaginationJumpStyles(_),
|
|
1027
|
+
onClick: () => H(1),
|
|
1028
|
+
disabled: _,
|
|
1003
1029
|
type: "button",
|
|
1004
|
-
title:
|
|
1005
|
-
children:
|
|
1030
|
+
title: F.first,
|
|
1031
|
+
children: E || /* @__PURE__ */ jsx(FirstIcon_default, {})
|
|
1006
1032
|
}),
|
|
1007
|
-
|
|
1008
|
-
className: getPaginationJumpStyles(
|
|
1009
|
-
onClick: () =>
|
|
1010
|
-
disabled:
|
|
1033
|
+
I > 1 && /* @__PURE__ */ jsx("button", {
|
|
1034
|
+
className: getPaginationJumpStyles(_),
|
|
1035
|
+
onClick: () => H(I - 1),
|
|
1036
|
+
disabled: _,
|
|
1011
1037
|
type: "button",
|
|
1012
|
-
title:
|
|
1013
|
-
children:
|
|
1038
|
+
title: F.previous,
|
|
1039
|
+
children: w || /* @__PURE__ */ jsx(PrevIcon_default, {})
|
|
1014
1040
|
}),
|
|
1015
|
-
|
|
1041
|
+
h && I > 4 && /* @__PURE__ */ jsx(PaginationJump, {
|
|
1016
1042
|
direction: "prev",
|
|
1017
|
-
onClick:
|
|
1018
|
-
disabled:
|
|
1019
|
-
icon:
|
|
1020
|
-
title:
|
|
1043
|
+
onClick: W,
|
|
1044
|
+
disabled: _,
|
|
1045
|
+
icon: O || /* @__PURE__ */ jsx(JumpPrevIcon_default, {}),
|
|
1046
|
+
title: F.jumpPrev
|
|
1021
1047
|
}),
|
|
1022
|
-
|
|
1048
|
+
q.map((e, t) => typeof e == "string" ? /* @__PURE__ */ jsx(PaginationItem, {
|
|
1023
1049
|
page: 0,
|
|
1024
1050
|
ellipsis: !0,
|
|
1025
1051
|
className: "cursor-default",
|
|
1026
1052
|
children: "..."
|
|
1027
|
-
}, `${
|
|
1028
|
-
page:
|
|
1029
|
-
active:
|
|
1030
|
-
disabled:
|
|
1031
|
-
onClick:
|
|
1032
|
-
},
|
|
1033
|
-
|
|
1053
|
+
}, `${e}-${t}`) : /* @__PURE__ */ jsx(PaginationItem, {
|
|
1054
|
+
page: e,
|
|
1055
|
+
active: e === I,
|
|
1056
|
+
disabled: _,
|
|
1057
|
+
onClick: H
|
|
1058
|
+
}, e)),
|
|
1059
|
+
h && I < B - 3 && /* @__PURE__ */ jsx(PaginationJump, {
|
|
1034
1060
|
direction: "next",
|
|
1035
|
-
onClick:
|
|
1036
|
-
disabled:
|
|
1037
|
-
icon:
|
|
1038
|
-
title:
|
|
1061
|
+
onClick: G,
|
|
1062
|
+
disabled: _,
|
|
1063
|
+
icon: ze || /* @__PURE__ */ jsx(JumpNextIcon_default, {}),
|
|
1064
|
+
title: F.jumpNext
|
|
1039
1065
|
}),
|
|
1040
|
-
|
|
1041
|
-
className: getPaginationJumpStyles(
|
|
1042
|
-
onClick: () =>
|
|
1043
|
-
disabled:
|
|
1066
|
+
I < B && /* @__PURE__ */ jsx("button", {
|
|
1067
|
+
className: getPaginationJumpStyles(_),
|
|
1068
|
+
onClick: () => H(I + 1),
|
|
1069
|
+
disabled: _,
|
|
1044
1070
|
type: "button",
|
|
1045
|
-
title:
|
|
1046
|
-
children:
|
|
1071
|
+
title: F.next,
|
|
1072
|
+
children: T || /* @__PURE__ */ jsx(NextIcon_default, {})
|
|
1047
1073
|
}),
|
|
1048
|
-
|
|
1049
|
-
className: getPaginationJumpStyles(
|
|
1050
|
-
onClick: () =>
|
|
1051
|
-
disabled:
|
|
1074
|
+
g && I < B && /* @__PURE__ */ jsx("button", {
|
|
1075
|
+
className: getPaginationJumpStyles(_),
|
|
1076
|
+
onClick: () => H(B),
|
|
1077
|
+
disabled: _,
|
|
1052
1078
|
type: "button",
|
|
1053
|
-
title:
|
|
1054
|
-
children:
|
|
1079
|
+
title: F.last,
|
|
1080
|
+
children: D || /* @__PURE__ */ jsx(LastIcon_default, {})
|
|
1055
1081
|
}),
|
|
1056
|
-
|
|
1057
|
-
current:
|
|
1058
|
-
pageSize:
|
|
1059
|
-
pageSizeOptions:
|
|
1060
|
-
onChange:
|
|
1061
|
-
disabled:
|
|
1062
|
-
itemsPerPageText:
|
|
1082
|
+
f && /* @__PURE__ */ jsx(PaginationSizeChanger, {
|
|
1083
|
+
current: I,
|
|
1084
|
+
pageSize: R,
|
|
1085
|
+
pageSizeOptions: p,
|
|
1086
|
+
onChange: U,
|
|
1087
|
+
disabled: _,
|
|
1088
|
+
itemsPerPageText: F.itemsPerPage
|
|
1089
|
+
}),
|
|
1090
|
+
d && /* @__PURE__ */ jsx(PaginationQuickJumper, {
|
|
1091
|
+
current: I,
|
|
1092
|
+
totalPages: B,
|
|
1093
|
+
onJump: K,
|
|
1094
|
+
disabled: _,
|
|
1095
|
+
jumpToText: F.jumpTo,
|
|
1096
|
+
pageText: F.page
|
|
1097
|
+
})
|
|
1098
|
+
]
|
|
1099
|
+
});
|
|
1100
|
+
};
|
|
1101
|
+
const getSliderStyles = (e) => cn_default("relative w-full overflow-hidden", e), getSliderTrackStyles = (e) => cn_default("flex transition-transform duration-300 ease-in-out", e), getSliderItemStyles = (e) => cn_default("flex-shrink-0", e), getNavigationButtonStyles = (e, t = "default", n = !1, r) => cn_default(cn_default("absolute top-1/2 -translate-y-1/2 z-10", "w-10 h-10 rounded-full", "flex items-center justify-center", "transition-all duration-200", "focus:outline-none focus:ring-2 focus:ring-offset-2", n && "hidden", !n && "cursor-pointer hover:scale-110 active:scale-95"), e === "left" ? "left-4" : "right-4", {
|
|
1102
|
+
default: cn_default("bg-white text-gray-800 shadow-lg", "hover:bg-gray-50", "focus:ring-gray-300"),
|
|
1103
|
+
outline: cn_default("bg-transparent border-2 border-white text-white", "hover:bg-white hover:text-gray-800", "focus:ring-white"),
|
|
1104
|
+
ghost: cn_default("bg-transparent text-white", "hover:bg-white/20", "focus:ring-white")
|
|
1105
|
+
}[t], r), getIndicatorStyles = (e = "dot", t = !1, n) => cn_default(cn_default("transition-all duration-200 cursor-pointer", "focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-300"), {
|
|
1106
|
+
dot: cn_default("w-2 h-2 rounded-full", t ? "bg-white scale-125" : "bg-white/50 hover:bg-white/75"),
|
|
1107
|
+
number: cn_default("w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium", t ? "bg-white text-gray-800" : "bg-white/50 text-white hover:bg-white/75"),
|
|
1108
|
+
line: cn_default("h-1 rounded-full", t ? "bg-white" : "bg-white/50 hover:bg-white/75")
|
|
1109
|
+
}[e], n), getIndicatorContainerStyles = (e = "dot", t) => cn_default("flex items-center justify-center gap-2 mt-4", e === "line" && "w-full", t);
|
|
1110
|
+
var Slider_default = forwardRef(({ items: e, itemsPerPage: t, slidePerPage: n, draggable: r = !1, paddingLeft: s = 0, gap: d = 0, showNavigation: f = !0, leftArrowClassName: p, rightArrowClassName: m, showIndicators: h = !1, autoPlay: _ = !1, autoPlayInterval: v = 3e3, loop: y = !1, className: b, itemContainerClassName: x, style: S, onSlideChange: C, previousPageLabel: w = "Previous page", nextPageLabel: T = "Next page", goToPageLabel: E = "Go to page {page}", ...D }, O) => {
|
|
1111
|
+
let [k, A] = useState(0), [j, M] = useState(!1), [N, P] = useState(!1), [F, I] = useState(0), [L, R] = useState(!1), z = useRef(null), B = useRef(null), V = useRef(null), H = t ?? 4, U = n ?? 1, W = Math.ceil(e.length / U), G = Math.max(0, W - 1), K = H >= e.length, q = useCallback((e) => {
|
|
1112
|
+
if (j) return;
|
|
1113
|
+
let t = Math.max(0, Math.min(e, G));
|
|
1114
|
+
t !== k && (M(!0), A(t), C?.(t), setTimeout(() => {
|
|
1115
|
+
M(!1);
|
|
1116
|
+
}, 300));
|
|
1117
|
+
}, [
|
|
1118
|
+
k,
|
|
1119
|
+
G,
|
|
1120
|
+
j,
|
|
1121
|
+
C
|
|
1122
|
+
]), J = useCallback(() => {
|
|
1123
|
+
k < G ? q(k + 1) : y && q(0);
|
|
1124
|
+
}, [
|
|
1125
|
+
k,
|
|
1126
|
+
G,
|
|
1127
|
+
y,
|
|
1128
|
+
q
|
|
1129
|
+
]), Y = useCallback(() => {
|
|
1130
|
+
k > 0 ? q(k - 1) : y && q(G);
|
|
1131
|
+
}, [
|
|
1132
|
+
k,
|
|
1133
|
+
y,
|
|
1134
|
+
G,
|
|
1135
|
+
q
|
|
1136
|
+
]), X = useCallback(() => k, [k]), Z = useCallback(() => W, [W]);
|
|
1137
|
+
useImperativeHandle(O, () => ({
|
|
1138
|
+
slideTo: q,
|
|
1139
|
+
slideNext: J,
|
|
1140
|
+
slidePrev: Y,
|
|
1141
|
+
getCurrentIndex: X,
|
|
1142
|
+
getTotalPages: Z
|
|
1143
|
+
}), [
|
|
1144
|
+
q,
|
|
1145
|
+
J,
|
|
1146
|
+
Y,
|
|
1147
|
+
X,
|
|
1148
|
+
Z
|
|
1149
|
+
]), useEffect(() => {
|
|
1150
|
+
if (_ && W > 1) return z.current = setInterval(() => {
|
|
1151
|
+
J();
|
|
1152
|
+
}, v), () => {
|
|
1153
|
+
z.current && clearInterval(z.current);
|
|
1154
|
+
};
|
|
1155
|
+
}, [
|
|
1156
|
+
_,
|
|
1157
|
+
v,
|
|
1158
|
+
J,
|
|
1159
|
+
W
|
|
1160
|
+
]);
|
|
1161
|
+
let Ve = {
|
|
1162
|
+
transform: (() => `translateX(${-(k * U * (100 / H))}%)`)(),
|
|
1163
|
+
paddingLeft: `${s}px`,
|
|
1164
|
+
gap: `${d}px`,
|
|
1165
|
+
cursor: r ? N ? "grabbing" : "grab" : "default",
|
|
1166
|
+
userSelect: r ? "none" : "auto",
|
|
1167
|
+
...S
|
|
1168
|
+
}, He = {
|
|
1169
|
+
width: (() => d === 0 ? `${100 / H}%` : `calc((100% - ${d * (H - 1)}px) / ${H})`)(),
|
|
1170
|
+
flexShrink: 0
|
|
1171
|
+
}, Ue = (e) => {
|
|
1172
|
+
e === "left" ? Y() : J();
|
|
1173
|
+
}, We = (e) => {
|
|
1174
|
+
q(e);
|
|
1175
|
+
}, Ge = (e) => {
|
|
1176
|
+
r && (e.preventDefault(), P(!0), R(!1), I(e.clientX));
|
|
1177
|
+
}, Q = useCallback((e) => {
|
|
1178
|
+
if (!N || !r) return;
|
|
1179
|
+
P(!1);
|
|
1180
|
+
let t = e.clientX - F;
|
|
1181
|
+
Math.abs(t) > 50 && (t > 0 ? Y() : J(), R(!0)), setTimeout(() => {
|
|
1182
|
+
R(!1);
|
|
1183
|
+
}, 100);
|
|
1184
|
+
}, [
|
|
1185
|
+
N,
|
|
1186
|
+
r,
|
|
1187
|
+
F,
|
|
1188
|
+
Y,
|
|
1189
|
+
J
|
|
1190
|
+
]), Ke = (e) => {
|
|
1191
|
+
if (!r) return;
|
|
1192
|
+
let t = e.touches[0];
|
|
1193
|
+
P(!0), R(!1), I(t.clientX);
|
|
1194
|
+
}, $ = useCallback((e) => {
|
|
1195
|
+
if (!N || !r) return;
|
|
1196
|
+
P(!1);
|
|
1197
|
+
let t = e.changedTouches[0].clientX - F;
|
|
1198
|
+
Math.abs(t) > 50 && (t > 0 ? Y() : J(), R(!0)), setTimeout(() => {
|
|
1199
|
+
R(!1);
|
|
1200
|
+
}, 100);
|
|
1201
|
+
}, [
|
|
1202
|
+
N,
|
|
1203
|
+
r,
|
|
1204
|
+
F,
|
|
1205
|
+
Y,
|
|
1206
|
+
J
|
|
1207
|
+
]);
|
|
1208
|
+
useEffect(() => (N && (document.addEventListener("mouseup", Q), document.addEventListener("touchend", $)), () => {
|
|
1209
|
+
document.removeEventListener("mouseup", Q), document.removeEventListener("touchend", $);
|
|
1210
|
+
}), [
|
|
1211
|
+
N,
|
|
1212
|
+
Q,
|
|
1213
|
+
$
|
|
1214
|
+
]);
|
|
1215
|
+
let qe = (e) => {
|
|
1216
|
+
L && (e.preventDefault(), e.stopPropagation());
|
|
1217
|
+
}, Je = y || k > 0, Ye = y || k < G;
|
|
1218
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1219
|
+
ref: B,
|
|
1220
|
+
className: getSliderStyles(b),
|
|
1221
|
+
...D,
|
|
1222
|
+
children: [
|
|
1223
|
+
/* @__PURE__ */ jsx("div", {
|
|
1224
|
+
ref: V,
|
|
1225
|
+
className: getSliderTrackStyles(),
|
|
1226
|
+
style: Ve,
|
|
1227
|
+
onMouseDown: Ge,
|
|
1228
|
+
onTouchStart: Ke,
|
|
1229
|
+
onClick: qe,
|
|
1230
|
+
draggable: !1,
|
|
1231
|
+
children: e.map((e, t) => /* @__PURE__ */ jsx("div", {
|
|
1232
|
+
className: cn_default(getSliderItemStyles(), x),
|
|
1233
|
+
style: He,
|
|
1234
|
+
onClick: qe,
|
|
1235
|
+
draggable: !1,
|
|
1236
|
+
children: e
|
|
1237
|
+
}, t))
|
|
1063
1238
|
}),
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
disabled:
|
|
1069
|
-
|
|
1070
|
-
|
|
1239
|
+
f && W > 1 && !K && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("button", {
|
|
1240
|
+
type: "button",
|
|
1241
|
+
className: cn_default(getNavigationButtonStyles("left", "default", !Je), p),
|
|
1242
|
+
onClick: () => Ue("left"),
|
|
1243
|
+
disabled: !Je,
|
|
1244
|
+
"aria-label": w,
|
|
1245
|
+
children: /* @__PURE__ */ jsx(ChevronLeftIcon_default, { className: "w-5 h-5" })
|
|
1246
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
1247
|
+
type: "button",
|
|
1248
|
+
className: cn_default(getNavigationButtonStyles("right", "default", !Ye), m),
|
|
1249
|
+
onClick: () => Ue("right"),
|
|
1250
|
+
disabled: !Ye,
|
|
1251
|
+
"aria-label": T,
|
|
1252
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon_default, { className: "w-5 h-5" })
|
|
1253
|
+
})] }),
|
|
1254
|
+
h && W > 1 && /* @__PURE__ */ jsx("div", {
|
|
1255
|
+
className: getIndicatorContainerStyles(),
|
|
1256
|
+
children: Array.from({ length: W }, (e, t) => /* @__PURE__ */ jsx("button", {
|
|
1257
|
+
type: "button",
|
|
1258
|
+
className: getIndicatorStyles("dot", t === k),
|
|
1259
|
+
onClick: () => We(t),
|
|
1260
|
+
"aria-label": E.replace("{page}", (t + 1).toString())
|
|
1261
|
+
}, t))
|
|
1071
1262
|
})
|
|
1072
1263
|
]
|
|
1073
1264
|
});
|
|
1265
|
+
}), Tab_default = ({ items: e, defaultActiveKey: t, activeKey: n, onChange: r, className: i, tabBarClassName: a, tabContentClassName: o, size: s = "medium", type: c = "line" }) => {
|
|
1266
|
+
let [u, d] = useState(n || t || e[0]?.key || ""), f = n || u, p = (e, t) => {
|
|
1267
|
+
t || (n || d(e), r?.(e));
|
|
1268
|
+
}, m = e.find((e) => e.key === f), h = {
|
|
1269
|
+
small: {
|
|
1270
|
+
tabBar: "h-8",
|
|
1271
|
+
tab: "px-3 py-1 text-sm",
|
|
1272
|
+
content: "pt-3"
|
|
1273
|
+
},
|
|
1274
|
+
medium: {
|
|
1275
|
+
tabBar: "h-10",
|
|
1276
|
+
tab: "px-4 py-2 text-sm",
|
|
1277
|
+
content: "pt-4"
|
|
1278
|
+
},
|
|
1279
|
+
large: {
|
|
1280
|
+
tabBar: "h-12",
|
|
1281
|
+
tab: "px-6 py-3 text-base",
|
|
1282
|
+
content: "pt-6"
|
|
1283
|
+
}
|
|
1284
|
+
}, _ = {
|
|
1285
|
+
line: {
|
|
1286
|
+
tabBar: "border-b border-gray-200",
|
|
1287
|
+
tab: "border-b-2 border-transparent hover:text-blue-600 hover:border-blue-300",
|
|
1288
|
+
activeTab: "text-blue-600 border-blue-500",
|
|
1289
|
+
content: ""
|
|
1290
|
+
},
|
|
1291
|
+
card: {
|
|
1292
|
+
tabBar: "bg-gray-50 rounded-lg p-1",
|
|
1293
|
+
tab: "rounded-md hover:bg-white hover:text-blue-600",
|
|
1294
|
+
activeTab: "bg-white text-blue-600 shadow-sm",
|
|
1295
|
+
content: "bg-white rounded-lg border border-gray-200 mt-2"
|
|
1296
|
+
}
|
|
1297
|
+
};
|
|
1298
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1299
|
+
className: cn_default("w-full", i),
|
|
1300
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
1301
|
+
className: cn_default("flex items-center justify-end", h[s].tabBar, _[c].tabBar, a),
|
|
1302
|
+
children: e.map((e) => {
|
|
1303
|
+
let t = e.key === f, n = e.disabled;
|
|
1304
|
+
return /* @__PURE__ */ jsx("button", {
|
|
1305
|
+
onClick: () => p(e.key, n),
|
|
1306
|
+
disabled: n,
|
|
1307
|
+
className: cn_default("flex items-center justify-center font-medium transition-all duration-200 focus:outline-none cursor-pointer", h[s].tab, t ? _[c].activeTab : _[c].tab, n && "opacity-50 cursor-not-allowed hover:text-gray-500 hover:border-transparent"),
|
|
1308
|
+
children: e.label
|
|
1309
|
+
}, e.key);
|
|
1310
|
+
})
|
|
1311
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
1312
|
+
className: cn_default(h[s].content, _[c].content, o),
|
|
1313
|
+
children: m?.children
|
|
1314
|
+
})]
|
|
1315
|
+
});
|
|
1074
1316
|
};
|
|
1075
|
-
export { ArrowIcon_default as ArrowIcon, Button_default as Button, Card_default as Card, CloseIcon_default as CloseIcon, Collapse_default as Collapse, Divider_default as Divider, DocumentIcon_default as DocumentIcon, Drawer_default as Drawer, EmptyState_default as EmptyState, EmptyStateIcon, ErrorIcon_default as ErrorIcon, FirstIcon_default as FirstIcon, FolderIcon_default as FolderIcon, InfoIcon_default as InfoIcon, JumpNextIcon_default as JumpNextIcon, JumpPrevIcon_default as JumpPrevIcon, LastIcon_default as LastIcon, Loading_default as Loading, LoadingIcon_default as LoadingIcon, NextIcon_default as NextIcon, Pagination_default as Pagination, PrevIcon_default as PrevIcon, SearchIcon_default as SearchIcon, SettingsIcon_default as SettingsIcon, SuccessIcon_default as SuccessIcon, UsersIcon_default as UsersIcon, WarningIcon_default as WarningIcon, cn_default as cn };
|
|
1317
|
+
export { ArrowIcon_default as ArrowIcon, Button_default as Button, Card_default as Card, ChevronLeftIcon_default as ChevronLeftIcon, ChevronRightIcon_default as ChevronRightIcon, CloseIcon_default as CloseIcon, Collapse_default as Collapse, Divider_default as Divider, DocumentIcon_default as DocumentIcon, Drawer_default as Drawer, EmptyState_default as EmptyState, EmptyStateIcon, ErrorIcon_default as ErrorIcon, FirstIcon_default as FirstIcon, FolderIcon_default as FolderIcon, InfoIcon_default as InfoIcon, JumpNextIcon_default as JumpNextIcon, JumpPrevIcon_default as JumpPrevIcon, LastIcon_default as LastIcon, Loading_default as Loading, LoadingIcon_default as LoadingIcon, NextIcon_default as NextIcon, Pagination_default as Pagination, PrevIcon_default as PrevIcon, SearchIcon_default as SearchIcon, SettingsIcon_default as SettingsIcon, Slider_default as Slider, SuccessIcon_default as SuccessIcon, Tab_default as Tab, UsersIcon_default as UsersIcon, WarningIcon_default as WarningIcon, cn_default as cn };
|