gemini-uis 0.6.1 → 0.7.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 +168 -0
- package/dist/index.js +757 -373
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cloneElement, forwardRef, isValidElement, startTransition, useCallback, useEffect, useMemo, useState } from "react";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
const getVariantStyles = (
|
|
4
|
-
let
|
|
3
|
+
const getVariantStyles = (r) => {
|
|
4
|
+
let i = {
|
|
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 = (e) => {
|
|
|
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 i[r] || i.primary;
|
|
14
|
+
}, getSizeStyles = (r) => {
|
|
15
|
+
let i = {
|
|
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 i[r] || i.md;
|
|
23
|
+
}, getRoundedStyles$2 = (r) => r ? "rounded-lg" : "rounded-none", getButtonStyles = (r = "primary", i = "md", a = !1, o = !1, s = !1, c) => [
|
|
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(r),
|
|
26
|
+
getSizeStyles(i),
|
|
27
|
+
getRoundedStyles$2(a),
|
|
28
|
+
o ? "opacity-50 cursor-not-allowed" : "",
|
|
29
|
+
s ? "cursor-wait" : "",
|
|
30
|
+
c
|
|
31
31
|
].filter(Boolean).join(" ").replace(/\s+/g, " ").trim();
|
|
32
|
-
function cn(...
|
|
33
|
-
return
|
|
32
|
+
function cn(...r) {
|
|
33
|
+
return r.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: r = 16, height: i = 16, className: a = "animate-spin", ...o }) => /* @__PURE__ */ jsxs("svg", {
|
|
36
|
+
width: r,
|
|
37
|
+
height: i,
|
|
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: a,
|
|
42
|
+
...o,
|
|
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: e = 16, height: b = 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: r = 6, height: i = 6, fill: a = "none", strokeWidth: o = 2, stroke: s = "currentColor", ...c }) => /* @__PURE__ */ jsx("svg", {
|
|
56
|
+
width: r,
|
|
57
|
+
height: i,
|
|
58
|
+
fill: a,
|
|
59
|
+
stroke: s,
|
|
60
60
|
viewBox: "0 0 24 24",
|
|
61
|
-
...
|
|
61
|
+
...c,
|
|
62
62
|
children: /* @__PURE__ */ jsx("path", {
|
|
63
63
|
strokeLinecap: "round",
|
|
64
64
|
strokeLinejoin: "round",
|
|
65
|
-
strokeWidth:
|
|
65
|
+
strokeWidth: o,
|
|
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: r = "0 0 24 24", fill: i = "none", stroke: a = "currentColor", ...o }) => /* @__PURE__ */ jsx("svg", {
|
|
69
|
+
fill: i,
|
|
70
|
+
stroke: a,
|
|
71
|
+
viewBox: r,
|
|
72
|
+
...o,
|
|
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: r = "0 0 24 24", fill: i = "none", stroke: a = "currentColor", strokeWidth: o = "1.5", ...s }) => /* @__PURE__ */ jsxs("svg", {
|
|
80
|
+
viewBox: r,
|
|
81
|
+
fill: i,
|
|
82
|
+
stroke: a,
|
|
83
|
+
strokeWidth: o,
|
|
84
|
+
...s,
|
|
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: r = "0 0 24 24", fill: i = "none", stroke: a = "currentColor", strokeWidth: o = "1.5", ...s }) => /* @__PURE__ */ jsx("svg", {
|
|
91
|
+
viewBox: r,
|
|
92
|
+
fill: i,
|
|
93
|
+
stroke: a,
|
|
94
|
+
strokeWidth: o,
|
|
95
|
+
...s,
|
|
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: r = "0 0 24 24", fill: i = "none", stroke: a = "currentColor", strokeWidth: o = "1.5", ...s }) => /* @__PURE__ */ jsxs("svg", {
|
|
98
|
+
viewBox: r,
|
|
99
|
+
fill: i,
|
|
100
|
+
stroke: a,
|
|
101
|
+
strokeWidth: o,
|
|
102
|
+
...s,
|
|
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: e = 16, height: b = 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: r = "0 0 24 24", fill: i = "none", stroke: a = "currentColor", strokeWidth: o = "1.5", ...s }) => /* @__PURE__ */ jsxs("svg", {
|
|
121
|
+
viewBox: r,
|
|
122
|
+
fill: i,
|
|
123
|
+
stroke: a,
|
|
124
|
+
strokeWidth: o,
|
|
125
|
+
...s,
|
|
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: e = 16, height: b = 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: r = "0 0 24 24", fill: i = "none", stroke: a = "currentColor", strokeWidth: o = "1.5", ...s }) => /* @__PURE__ */ jsxs("svg", {
|
|
137
|
+
viewBox: r,
|
|
138
|
+
fill: i,
|
|
139
|
+
stroke: a,
|
|
140
|
+
strokeWidth: o,
|
|
141
|
+
...s,
|
|
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: r = "0 0 24 24", fill: i = "none", stroke: a = "currentColor", strokeWidth: o = "1.5", ...s }) => /* @__PURE__ */ jsxs("svg", {
|
|
148
|
+
viewBox: r,
|
|
149
|
+
fill: i,
|
|
150
|
+
stroke: a,
|
|
151
|
+
strokeWidth: o,
|
|
152
|
+
...s,
|
|
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: r = "0 0 24 24", fill: i = "none", stroke: a = "currentColor", strokeWidth: o = "1.5", ...s }) => /* @__PURE__ */ jsxs("svg", {
|
|
159
|
+
viewBox: r,
|
|
160
|
+
fill: i,
|
|
161
|
+
stroke: a,
|
|
162
|
+
strokeWidth: o,
|
|
163
|
+
...s,
|
|
164
164
|
children: [
|
|
165
165
|
/* @__PURE__ */ jsx("circle", {
|
|
166
166
|
cx: "12",
|
|
@@ -180,33 +180,142 @@ var cn_default = cn, LoadingIcon_default = ({ width: e = 16, height: b = 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: r = "0 0 24 24", fill: i = "none", stroke: a = "currentColor", strokeWidth: o = "1.5", ...s }) => /* @__PURE__ */ jsxs("svg", {
|
|
184
|
+
viewBox: r,
|
|
185
|
+
fill: i,
|
|
186
|
+
stroke: a,
|
|
187
|
+
strokeWidth: o,
|
|
188
|
+
...s,
|
|
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
|
-
}),
|
|
191
|
-
|
|
190
|
+
}), ErrorIcon_default = ({ viewBox: r = "0 0 24 24", fill: i = "none", stroke: a = "currentColor", strokeWidth: o = "1.5", ...s }) => /* @__PURE__ */ jsxs("svg", {
|
|
191
|
+
viewBox: r,
|
|
192
|
+
fill: i,
|
|
193
|
+
stroke: a,
|
|
194
|
+
strokeWidth: o,
|
|
195
|
+
...s,
|
|
196
|
+
children: [
|
|
197
|
+
/* @__PURE__ */ jsx("circle", {
|
|
198
|
+
cx: "12",
|
|
199
|
+
cy: "12",
|
|
200
|
+
r: "10"
|
|
201
|
+
}),
|
|
202
|
+
/* @__PURE__ */ jsx("line", {
|
|
203
|
+
x1: "15",
|
|
204
|
+
y1: "9",
|
|
205
|
+
x2: "9",
|
|
206
|
+
y2: "15"
|
|
207
|
+
}),
|
|
208
|
+
/* @__PURE__ */ jsx("line", {
|
|
209
|
+
x1: "9",
|
|
210
|
+
y1: "9",
|
|
211
|
+
x2: "15",
|
|
212
|
+
y2: "15"
|
|
213
|
+
})
|
|
214
|
+
]
|
|
215
|
+
}), PrevIcon_default = ({ width: r = 12, height: i = 12, viewBox: a = "0 0 12 12", fill: o = "currentColor", ...s }) => /* @__PURE__ */ jsx("svg", {
|
|
216
|
+
width: r,
|
|
217
|
+
height: i,
|
|
218
|
+
viewBox: a,
|
|
219
|
+
fill: o,
|
|
220
|
+
...s,
|
|
221
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
222
|
+
d: "M7.5 9L4.5 6L7.5 3",
|
|
223
|
+
stroke: "currentColor",
|
|
224
|
+
strokeWidth: "1.5",
|
|
225
|
+
strokeLinecap: "round",
|
|
226
|
+
strokeLinejoin: "round",
|
|
227
|
+
fill: "none"
|
|
228
|
+
})
|
|
229
|
+
}), NextIcon_default = ({ width: r = 12, height: i = 12, viewBox: a = "0 0 12 12", fill: o = "currentColor", ...s }) => /* @__PURE__ */ jsx("svg", {
|
|
230
|
+
width: r,
|
|
231
|
+
height: i,
|
|
232
|
+
viewBox: a,
|
|
233
|
+
fill: o,
|
|
234
|
+
...s,
|
|
235
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
236
|
+
d: "M4.5 3L7.5 6L4.5 9",
|
|
237
|
+
stroke: "currentColor",
|
|
238
|
+
strokeWidth: "1.5",
|
|
239
|
+
strokeLinecap: "round",
|
|
240
|
+
strokeLinejoin: "round",
|
|
241
|
+
fill: "none"
|
|
242
|
+
})
|
|
243
|
+
}), FirstIcon_default = ({ viewBox: r = "0 0 12 12", fill: i = "currentColor", width: a = 12, height: o = 12, ...s }) => /* @__PURE__ */ jsx("svg", {
|
|
244
|
+
width: a,
|
|
245
|
+
height: o,
|
|
246
|
+
viewBox: r,
|
|
247
|
+
fill: i,
|
|
248
|
+
...s,
|
|
249
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
250
|
+
d: "M3 3L3 9M6 3L6 9M9 3L9 9",
|
|
251
|
+
stroke: "currentColor",
|
|
252
|
+
strokeWidth: "1.5",
|
|
253
|
+
strokeLinecap: "round",
|
|
254
|
+
strokeLinejoin: "round",
|
|
255
|
+
fill: "none"
|
|
256
|
+
})
|
|
257
|
+
}), LastIcon_default = ({ viewBox: r = "0 0 12 12", fill: i = "currentColor", width: a = 12, height: o = 12, ...s }) => /* @__PURE__ */ jsx("svg", {
|
|
258
|
+
width: a,
|
|
259
|
+
height: o,
|
|
260
|
+
viewBox: r,
|
|
261
|
+
fill: i,
|
|
262
|
+
...s,
|
|
263
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
264
|
+
d: "M3 3L3 9M6 3L6 9M9 3L9 9",
|
|
265
|
+
stroke: "currentColor",
|
|
266
|
+
strokeWidth: "1.5",
|
|
267
|
+
strokeLinecap: "round",
|
|
268
|
+
strokeLinejoin: "round",
|
|
269
|
+
fill: "none"
|
|
270
|
+
})
|
|
271
|
+
}), JumpPrevIcon_default = ({ viewBox: r = "0 0 12 12", fill: i = "currentColor", width: a = 12, height: o = 12, ...s }) => /* @__PURE__ */ jsx("svg", {
|
|
272
|
+
width: a,
|
|
273
|
+
height: o,
|
|
274
|
+
viewBox: r,
|
|
275
|
+
fill: i,
|
|
276
|
+
...s,
|
|
277
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
278
|
+
d: "M3 3L3 9M6 3L6 9M9 3L9 9",
|
|
279
|
+
stroke: "currentColor",
|
|
280
|
+
strokeWidth: "1.5",
|
|
281
|
+
strokeLinecap: "round",
|
|
282
|
+
strokeLinejoin: "round",
|
|
283
|
+
fill: "none"
|
|
284
|
+
})
|
|
285
|
+
}), JumpNextIcon_default = ({ viewBox: r = "0 0 12 12", fill: i = "currentColor", width: a = 12, height: o = 12, ...s }) => /* @__PURE__ */ jsx("svg", {
|
|
286
|
+
width: a,
|
|
287
|
+
height: o,
|
|
288
|
+
viewBox: r,
|
|
289
|
+
fill: i,
|
|
290
|
+
...s,
|
|
291
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
292
|
+
d: "M3 3L3 9M6 3L6 9M9 3L9 9",
|
|
293
|
+
stroke: "currentColor",
|
|
294
|
+
strokeWidth: "1.5",
|
|
295
|
+
strokeLinecap: "round",
|
|
296
|
+
strokeLinejoin: "round",
|
|
297
|
+
fill: "none"
|
|
298
|
+
})
|
|
299
|
+
}), Button_default = forwardRef(({ type: r = "primary", size: i = "md", rounded: a = !1, disabled: o = !1, loading: s = !1, className: c, children: l, htmlType: u = "button", onClick: d, ...p }, m) => {
|
|
300
|
+
let h = o || s;
|
|
192
301
|
return /* @__PURE__ */ jsxs("button", {
|
|
193
|
-
ref:
|
|
194
|
-
type:
|
|
195
|
-
disabled:
|
|
196
|
-
onClick: (
|
|
197
|
-
if (
|
|
198
|
-
|
|
302
|
+
ref: m,
|
|
303
|
+
type: u,
|
|
304
|
+
disabled: h,
|
|
305
|
+
onClick: (r) => {
|
|
306
|
+
if (h) {
|
|
307
|
+
r.preventDefault();
|
|
199
308
|
return;
|
|
200
309
|
}
|
|
201
|
-
|
|
310
|
+
d?.(r);
|
|
202
311
|
},
|
|
203
|
-
className: cn_default(getButtonStyles(
|
|
204
|
-
...
|
|
205
|
-
children: [
|
|
312
|
+
className: cn_default(getButtonStyles(r, i, a, h, s, c)),
|
|
313
|
+
...p,
|
|
314
|
+
children: [s && /* @__PURE__ */ jsx(LoadingIcon_default, { className: "animate-spin" }), l]
|
|
206
315
|
});
|
|
207
316
|
});
|
|
208
|
-
const getShadowStyles = (
|
|
209
|
-
let
|
|
317
|
+
const getShadowStyles = (r) => {
|
|
318
|
+
let i = {
|
|
210
319
|
none: "",
|
|
211
320
|
sm: "shadow-sm",
|
|
212
321
|
md: "shadow-md",
|
|
@@ -214,9 +323,9 @@ const getShadowStyles = (e) => {
|
|
|
214
323
|
xl: "shadow-xl",
|
|
215
324
|
"2xl": "shadow-2xl"
|
|
216
325
|
};
|
|
217
|
-
return
|
|
218
|
-
}, getBorderStyles = (
|
|
219
|
-
let
|
|
326
|
+
return i[r] || i.none;
|
|
327
|
+
}, getBorderStyles = (r) => {
|
|
328
|
+
let i = {
|
|
220
329
|
none: "",
|
|
221
330
|
sm: "border border-gray-200",
|
|
222
331
|
md: "border-2 border-gray-200",
|
|
@@ -224,380 +333,354 @@ const getShadowStyles = (e) => {
|
|
|
224
333
|
xl: "border-8 border-gray-200",
|
|
225
334
|
"2xl": "border-16 border-gray-200"
|
|
226
335
|
};
|
|
227
|
-
return
|
|
228
|
-
}, getRoundedStyles$1 = (
|
|
229
|
-
let
|
|
336
|
+
return i[r] || i.none;
|
|
337
|
+
}, getRoundedStyles$1 = (r) => r ? "rounded-lg" : "rounded-none", getHoverStyles = (r = !1) => r ? "" : "hover:shadow-xl hover:scale-101 hover:-translate-y-1 hover:translate-x-1 origin-bottom-left", getCardStyles = (r = "none", i = "none", a = !1, o = !1, s) => {
|
|
338
|
+
let c = getShadowStyles(r), l = getBorderStyles(i), u = getRoundedStyles$1(a), d = getHoverStyles(o);
|
|
230
339
|
return [
|
|
231
340
|
"block p-4 bg-white transition-all duration-300 ease-in-out cursor-pointer",
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
341
|
+
s && /\bw-\w+/.test(s) ? "" : "w-full",
|
|
342
|
+
c,
|
|
343
|
+
l,
|
|
344
|
+
u,
|
|
345
|
+
d,
|
|
346
|
+
s
|
|
238
347
|
].filter(Boolean).join(" ").replace(/\s+/g, " ").trim();
|
|
239
348
|
};
|
|
240
|
-
var Card_default = forwardRef(({ shadow:
|
|
241
|
-
ref:
|
|
242
|
-
className: cn_default(getCardStyles(
|
|
243
|
-
...
|
|
244
|
-
children:
|
|
349
|
+
var Card_default = forwardRef(({ shadow: r = "md", border: i = "sm", rounded: a = !1, disabledHover: o = !1, className: s, children: c, ...l }, u) => /* @__PURE__ */ jsx("div", {
|
|
350
|
+
ref: u,
|
|
351
|
+
className: cn_default(getCardStyles(r, i, a, o, s)),
|
|
352
|
+
...l,
|
|
353
|
+
children: c
|
|
245
354
|
}));
|
|
246
|
-
const getCollapseSizeStyles = (
|
|
247
|
-
let
|
|
355
|
+
const getCollapseSizeStyles = (r) => {
|
|
356
|
+
let i = {
|
|
248
357
|
sm: "text-sm",
|
|
249
358
|
md: "text-base",
|
|
250
359
|
lg: "text-lg"
|
|
251
360
|
};
|
|
252
|
-
return
|
|
253
|
-
}, getCollapseVariantStyles = (
|
|
361
|
+
return i[r] || i.md;
|
|
362
|
+
}, getCollapseVariantStyles = (r, i, a) => a ? "bg-transparent" : i || r === "bordered" ? "border border-gray-200 rounded-lg overflow-hidden" : "bg-white rounded-lg", getCollapseStyles = (r = "md", i = "default", a = !1, o = !1, s) => [
|
|
254
363
|
"w-full",
|
|
255
|
-
getCollapseSizeStyles(
|
|
256
|
-
getCollapseVariantStyles(
|
|
257
|
-
|
|
364
|
+
getCollapseSizeStyles(r),
|
|
365
|
+
getCollapseVariantStyles(i, a, o),
|
|
366
|
+
s
|
|
258
367
|
].filter(Boolean).join(" ").replace(/\s+/g, " ").trim();
|
|
259
|
-
var DefaultArrowIcon = ({ isActive:
|
|
260
|
-
let [
|
|
261
|
-
let
|
|
262
|
-
return Array.isArray(
|
|
263
|
-
}),
|
|
264
|
-
if (
|
|
265
|
-
let
|
|
266
|
-
|
|
368
|
+
var DefaultArrowIcon = ({ isActive: r, disabled: i }) => /* @__PURE__ */ jsx(ArrowIcon_default, { className: cn_default("shrink-0 size-4 transition-transform duration-200 ease-in-out", r ? "rotate-180" : "rotate-0", i ? "opacity-50" : "") }), CollapseCore = forwardRef(({ activeKey: i, defaultActiveKey: o, collapsible: c = "header", accordion: d = !1, bordered: f = !1, ghost: p = !1, size: m = "md", variant: h = "default", className: g, children: _, onChange: y, onExpand: b, onCollapse: x, ...S }, C) => {
|
|
369
|
+
let [w, T] = useState(() => {
|
|
370
|
+
let r = i || o;
|
|
371
|
+
return Array.isArray(r) ? r : r ? [r] : [];
|
|
372
|
+
}), E = useMemo(() => i === void 0 ? w : Array.isArray(i) ? i : [i], [i, w]), D = useCallback((r) => {
|
|
373
|
+
if (c === "disabled") return;
|
|
374
|
+
let a;
|
|
375
|
+
a = d ? E.includes(r) ? [] : [r] : E.includes(r) ? E.filter((i) => i !== r) : [...E, r], i === void 0 && T(a), y?.(d ? a[0] || "" : a), a.includes(r) ? b?.(r) : x?.(r);
|
|
267
376
|
}, [
|
|
377
|
+
i,
|
|
378
|
+
E,
|
|
379
|
+
d,
|
|
380
|
+
c,
|
|
381
|
+
y,
|
|
268
382
|
b,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
return cloneElement(b, {
|
|
279
|
-
...C,
|
|
280
|
-
isActive: E,
|
|
281
|
-
onToggle: () => U(T),
|
|
282
|
-
collapsible: w
|
|
383
|
+
x
|
|
384
|
+
]), O = getCollapseStyles(m, h, f, p, g), k = useMemo(() => _ ? Array.isArray(_) ? _.map((i, o) => {
|
|
385
|
+
if (!isValidElement(i)) return i;
|
|
386
|
+
let { ...s } = i.props, l = i.key || String(o), u = E.includes(l);
|
|
387
|
+
return cloneElement(i, {
|
|
388
|
+
...s,
|
|
389
|
+
isActive: u,
|
|
390
|
+
onToggle: () => D(l),
|
|
391
|
+
collapsible: c
|
|
283
392
|
});
|
|
284
|
-
}) : isValidElement(
|
|
285
|
-
...
|
|
286
|
-
isActive:
|
|
287
|
-
onToggle: () =>
|
|
288
|
-
collapsible:
|
|
289
|
-
}) :
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
393
|
+
}) : isValidElement(_) ? cloneElement(_, {
|
|
394
|
+
..._.props,
|
|
395
|
+
isActive: E.includes(_.key || "filter"),
|
|
396
|
+
onToggle: () => D(_.key || "filter"),
|
|
397
|
+
collapsible: c
|
|
398
|
+
}) : _ : null, [
|
|
399
|
+
_,
|
|
400
|
+
E,
|
|
401
|
+
D,
|
|
402
|
+
c
|
|
294
403
|
]);
|
|
295
404
|
return /* @__PURE__ */ jsx("div", {
|
|
296
|
-
ref:
|
|
297
|
-
className: cn_default(
|
|
298
|
-
...
|
|
299
|
-
children:
|
|
405
|
+
ref: C,
|
|
406
|
+
className: cn_default(O),
|
|
407
|
+
...S,
|
|
408
|
+
children: k
|
|
300
409
|
});
|
|
301
|
-
}), CollapsePanel = forwardRef(({ key:
|
|
302
|
-
let
|
|
303
|
-
|
|
304
|
-
},
|
|
305
|
-
|
|
306
|
-
},
|
|
307
|
-
className: cn_default("shrink-0 transition-transform duration-200 ease-in-out",
|
|
308
|
-
onClick:
|
|
309
|
-
children:
|
|
410
|
+
}), CollapsePanel = forwardRef(({ key: r, header: i, children: a, disabled: o = !1, showArrow: s = !0, arrow: c, className: l, headerContainerClassName: u, headerContentClassName: d, contentClassName: p, onHeaderClick: m, isActive: h = !1, onToggle: g, collapsible: _ = "header", ...y }, b) => {
|
|
411
|
+
let x = () => {
|
|
412
|
+
o || _ === "disabled" || (m?.(r), g?.());
|
|
413
|
+
}, S = (r) => {
|
|
414
|
+
_ !== "header" && (r.stopPropagation(), o || g?.());
|
|
415
|
+
}, C = () => s ? c ? /* @__PURE__ */ jsx("span", {
|
|
416
|
+
className: cn_default("shrink-0 transition-transform duration-200 ease-in-out", h ? "rotate-180" : "rotate-0", o ? "opacity-50" : "", _ === "icon" ? "cursor-pointer" : ""),
|
|
417
|
+
onClick: S,
|
|
418
|
+
children: c
|
|
310
419
|
}) : /* @__PURE__ */ jsx(DefaultArrowIcon, {
|
|
311
|
-
isActive:
|
|
312
|
-
disabled:
|
|
420
|
+
isActive: h,
|
|
421
|
+
disabled: o
|
|
313
422
|
}) : null;
|
|
314
423
|
return /* @__PURE__ */ jsxs("div", {
|
|
315
|
-
ref:
|
|
316
|
-
className: cn_default("border-b border-gray-200 last:border-b-0",
|
|
317
|
-
...
|
|
424
|
+
ref: b,
|
|
425
|
+
className: cn_default("border-b border-gray-200 last:border-b-0", l),
|
|
426
|
+
...y,
|
|
318
427
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
319
|
-
className: cn_default("flex items-center justify-between w-full text-left font-medium transition-colors duration-200", "px-4 py-3",
|
|
320
|
-
onClick:
|
|
321
|
-
tabIndex:
|
|
428
|
+
className: cn_default("flex items-center justify-between w-full text-left font-medium transition-colors duration-200", "px-4 py-3", o ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:bg-gray-50", "focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-inset", u),
|
|
429
|
+
onClick: x,
|
|
430
|
+
tabIndex: o ? -1 : 0,
|
|
322
431
|
role: "button",
|
|
323
|
-
"aria-expanded":
|
|
324
|
-
"aria-disabled":
|
|
432
|
+
"aria-expanded": h,
|
|
433
|
+
"aria-disabled": o,
|
|
325
434
|
children: [/* @__PURE__ */ jsx("div", {
|
|
326
|
-
className: cn_default("flex-1 pr-2",
|
|
327
|
-
children:
|
|
328
|
-
}),
|
|
435
|
+
className: cn_default("flex-1 pr-2", d),
|
|
436
|
+
children: i
|
|
437
|
+
}), C()]
|
|
329
438
|
}), /* @__PURE__ */ jsx("div", {
|
|
330
|
-
className: cn_default("overflow-hidden transition-all duration-300 ease-in-out",
|
|
439
|
+
className: cn_default("overflow-hidden transition-all duration-300 ease-in-out", h ? "max-h-none opacity-100" : "max-h-0 opacity-0"),
|
|
331
440
|
children: /* @__PURE__ */ jsx("div", {
|
|
332
|
-
className: cn_default("px-4 pb-4 text-gray-700",
|
|
333
|
-
children:
|
|
441
|
+
className: cn_default("px-4 pb-4 text-gray-700", p),
|
|
442
|
+
children: a
|
|
334
443
|
})
|
|
335
444
|
})]
|
|
336
445
|
});
|
|
337
446
|
});
|
|
338
447
|
CollapsePanel.displayName = "CollapsePanel";
|
|
339
448
|
var Collapse_default = Object.assign(CollapseCore, { Panel: CollapsePanel });
|
|
340
|
-
const getOrientationStyles = (
|
|
449
|
+
const getOrientationStyles = (r) => ({
|
|
341
450
|
horizontal: "w-full h-0",
|
|
342
451
|
vertical: "h-full w-0"
|
|
343
|
-
})[
|
|
344
|
-
thin:
|
|
345
|
-
medium:
|
|
346
|
-
thick:
|
|
347
|
-
"extra-thick":
|
|
348
|
-
})[
|
|
349
|
-
|
|
350
|
-
getOrientationStyles(
|
|
351
|
-
getThicknessStyles(
|
|
352
|
-
getRoundedStyles(
|
|
353
|
-
getColorStyles(
|
|
354
|
-
getDashedStyles(
|
|
355
|
-
getLengthStyles(
|
|
452
|
+
})[r], getThicknessStyles = (r, i) => ({
|
|
453
|
+
thin: i === "horizontal" ? "h-px" : "w-px",
|
|
454
|
+
medium: i === "horizontal" ? "h-0.5" : "w-0.5",
|
|
455
|
+
thick: i === "horizontal" ? "h-1" : "w-1",
|
|
456
|
+
"extra-thick": i === "horizontal" ? "h-1.5" : "w-1.5"
|
|
457
|
+
})[r], getRoundedStyles = (r) => r ? "rounded-full" : "rounded-none", getColorStyles = (r) => r ? `bg-[${r}]` : "bg-gray-200", getDashedStyles = (r) => r ? "border-dashed" : "border-solid", getLengthStyles = (r, i = "horizontal") => r && i === "horizontal" ? `w-[${r}%]` : "", getDividerStyles = (r = "horizontal", i = "medium", a = !1, o, s = !1, c, l) => l ? ["block", l].filter(Boolean).join(" ").trim() : [
|
|
458
|
+
r === "vertical" ? "bg-gray-200" : "border-0",
|
|
459
|
+
getOrientationStyles(r),
|
|
460
|
+
getThicknessStyles(i, r),
|
|
461
|
+
getRoundedStyles(a),
|
|
462
|
+
getColorStyles(o),
|
|
463
|
+
getDashedStyles(s),
|
|
464
|
+
getLengthStyles(c, r)
|
|
356
465
|
].filter(Boolean).join(" ").replace(/\s+/g, " ").trim();
|
|
357
|
-
var Divider_default = forwardRef(({ orientation:
|
|
358
|
-
ref:
|
|
359
|
-
className: cn_default(getDividerStyles(
|
|
360
|
-
...
|
|
466
|
+
var Divider_default = forwardRef(({ orientation: r = "horizontal", thickness: i = "medium", rounded: a = !1, color: o, dashed: s = !1, length: c, className: l, ...u }, d) => /* @__PURE__ */ jsx("div", {
|
|
467
|
+
ref: d,
|
|
468
|
+
className: cn_default(getDividerStyles(r, i, a ?? !1, o, s, c, l), l),
|
|
469
|
+
...u
|
|
361
470
|
}));
|
|
362
|
-
const getDrawerPlacementStyles = (
|
|
363
|
-
let
|
|
471
|
+
const getDrawerPlacementStyles = (r) => {
|
|
472
|
+
let i = {
|
|
364
473
|
top: "top-0 left-0 right-0",
|
|
365
474
|
right: "top-0 right-0 bottom-0",
|
|
366
475
|
bottom: "bottom-0 left-0 right-0",
|
|
367
476
|
left: "top-0 left-0 bottom-0"
|
|
368
477
|
};
|
|
369
|
-
return
|
|
370
|
-
}, getDrawerSizeStyles = (
|
|
371
|
-
let
|
|
372
|
-
if (
|
|
373
|
-
let
|
|
374
|
-
sm:
|
|
375
|
-
md:
|
|
376
|
-
lg:
|
|
478
|
+
return i[r] || i.right;
|
|
479
|
+
}, getDrawerSizeStyles = (r, i) => {
|
|
480
|
+
let a = i === "left" || i === "right";
|
|
481
|
+
if (r === "full") return "w-screen h-screen";
|
|
482
|
+
let o = {
|
|
483
|
+
sm: a ? "w-64" : "h-64",
|
|
484
|
+
md: a ? "w-96" : "h-96",
|
|
485
|
+
lg: a ? "w-[46rem]" : "h-[46rem]"
|
|
377
486
|
};
|
|
378
|
-
return
|
|
379
|
-
}, getDrawerTransformStyles = (
|
|
380
|
-
if (
|
|
381
|
-
let
|
|
487
|
+
return o[r] || o.md;
|
|
488
|
+
}, getDrawerTransformStyles = (r, i) => {
|
|
489
|
+
if (i) return "translate-x-0 translate-y-0";
|
|
490
|
+
let a = {
|
|
382
491
|
top: "-translate-y-full",
|
|
383
492
|
right: "translate-x-full",
|
|
384
493
|
bottom: "translate-y-full",
|
|
385
494
|
left: "-translate-x-full"
|
|
386
495
|
};
|
|
387
|
-
return
|
|
388
|
-
}, getDrawerStyles = (
|
|
496
|
+
return a[r] || a.right;
|
|
497
|
+
}, getDrawerStyles = (r, i, a, o) => [
|
|
389
498
|
"fixed bg-white shadow-xl transition-transform duration-300 ease-out z-50 flex flex-col will-change-transform",
|
|
390
|
-
getDrawerPlacementStyles(
|
|
391
|
-
getDrawerSizeStyles(
|
|
392
|
-
getDrawerTransformStyles(
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
].filter(Boolean).join(" ").replace(/\s+/g, " ").trim(), getMaskStyles = (
|
|
499
|
+
getDrawerPlacementStyles(r),
|
|
500
|
+
getDrawerSizeStyles(i, r),
|
|
501
|
+
getDrawerTransformStyles(r, a),
|
|
502
|
+
a ? "pointer-events-auto" : "pointer-events-none",
|
|
503
|
+
o
|
|
504
|
+
].filter(Boolean).join(" ").replace(/\s+/g, " ").trim(), getMaskStyles = (r, i) => [
|
|
396
505
|
"fixed inset-0 h-screen bg-black/50 transition-opacity duration-300 ease-out z-40",
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
].filter(Boolean).join(" ").replace(/\s+/g, " ").trim(), getHeaderStyles = (
|
|
401
|
-
var DefaultCloseIcon = () => /* @__PURE__ */ jsx(CloseIcon_default, { className: "w-5 h-5" }), Drawer_default = forwardRef(({ open:
|
|
402
|
-
let [
|
|
506
|
+
r ? "opacity-100" : "opacity-0",
|
|
507
|
+
r ? "pointer-events-auto" : "pointer-events-none",
|
|
508
|
+
i
|
|
509
|
+
].filter(Boolean).join(" ").replace(/\s+/g, " ").trim(), getHeaderStyles = (r) => ["flex items-center justify-between px-6 py-4 border-b border-gray-200 flex-shrink-0", r].filter(Boolean).join(" ").replace(/\s+/g, " ").trim(), getBodyStyles = (r) => ["min-h-0 flex-1 overflow-y-auto", r].filter(Boolean).join(" ").replace(/\s+/g, " ").trim(), getFooterStyles = (r) => ["flex items-center justify-end px-6 py-4 border-t border-gray-200 flex-shrink-0 gap-2", r].filter(Boolean).join(" ").replace(/\s+/g, " ").trim();
|
|
510
|
+
var DefaultCloseIcon = () => /* @__PURE__ */ jsx(CloseIcon_default, { className: "w-5 h-5" }), Drawer_default = forwardRef(({ open: r = !1, title: i, placement: a = "right", size: l = "md", mask: p = !0, maskClosable: m = !0, closable: h = !0, closeIcon: g, destroyOnClose: _ = !1, className: y, maskClassName: b, bodyClassName: x, headerClassName: S, footerClassName: C, children: w, footer: T, extra: E, onClose: D, afterOpenChange: O, zIndex: k = 1e3, ...A }, j) => {
|
|
511
|
+
let [M, N] = useState(r), [P, F] = useState(!1);
|
|
403
512
|
useEffect(() => {
|
|
404
|
-
if (
|
|
405
|
-
|
|
513
|
+
if (r) startTransition(() => {
|
|
514
|
+
N(!0);
|
|
406
515
|
}), requestAnimationFrame(() => {
|
|
407
516
|
requestAnimationFrame(() => {
|
|
408
|
-
|
|
517
|
+
F(!0);
|
|
409
518
|
});
|
|
410
519
|
});
|
|
411
520
|
else {
|
|
412
521
|
startTransition(() => {
|
|
413
|
-
|
|
522
|
+
F(!1);
|
|
414
523
|
});
|
|
415
|
-
let
|
|
416
|
-
|
|
524
|
+
let r = setTimeout(() => {
|
|
525
|
+
N(!1);
|
|
417
526
|
}, 300);
|
|
418
|
-
return () => clearTimeout(
|
|
527
|
+
return () => clearTimeout(r);
|
|
419
528
|
}
|
|
420
|
-
}, [
|
|
421
|
-
if (!
|
|
422
|
-
let
|
|
423
|
-
|
|
529
|
+
}, [r]), useEffect(() => {
|
|
530
|
+
if (!r) return;
|
|
531
|
+
let i = (r) => {
|
|
532
|
+
r.key === "Escape" && D && D();
|
|
424
533
|
};
|
|
425
|
-
return document.addEventListener("keydown",
|
|
426
|
-
}, [
|
|
427
|
-
let
|
|
428
|
-
|
|
429
|
-
}, [
|
|
430
|
-
|
|
431
|
-
}, [
|
|
534
|
+
return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
|
|
535
|
+
}, [r, D]);
|
|
536
|
+
let I = useCallback(() => {
|
|
537
|
+
m && D && D();
|
|
538
|
+
}, [m, D]), L = useCallback(() => {
|
|
539
|
+
D && D();
|
|
540
|
+
}, [D]);
|
|
432
541
|
return useEffect(() => {
|
|
433
|
-
|
|
434
|
-
}, [
|
|
435
|
-
if (!
|
|
436
|
-
let
|
|
437
|
-
|
|
438
|
-
let
|
|
439
|
-
return window.addEventListener("touchmove",
|
|
440
|
-
window.removeEventListener("touchmove",
|
|
542
|
+
O && O(r);
|
|
543
|
+
}, [r, O]), useEffect(() => {
|
|
544
|
+
if (!r) return;
|
|
545
|
+
let i = window.scrollY || 0, { style: a } = document.body, { style: o } = document.documentElement;
|
|
546
|
+
a.position = "fixed", a.top = `-${i}px`, a.left = "0", a.right = "0", a.width = "100%", a.overflow = "hidden", o.overflow = "hidden", o.overscrollBehavior = "none";
|
|
547
|
+
let s = (r) => r.preventDefault();
|
|
548
|
+
return window.addEventListener("touchmove", s, { passive: !1 }), window.addEventListener("wheel", s, { passive: !1 }), () => {
|
|
549
|
+
window.removeEventListener("touchmove", s), window.removeEventListener("wheel", s), a.position = "", a.top = "", a.left = "", a.right = "", a.width = "", a.overflow = "", o.overflow = "", o.overscrollBehavior = "", window.scrollTo(0, i);
|
|
441
550
|
};
|
|
442
|
-
}, [
|
|
443
|
-
className: cn_default(getMaskStyles(
|
|
444
|
-
style: { zIndex:
|
|
445
|
-
onClick:
|
|
551
|
+
}, [r]), !M && _ || !M ? null : /* @__PURE__ */ jsxs(Fragment, { children: [p && /* @__PURE__ */ jsx("div", {
|
|
552
|
+
className: cn_default(getMaskStyles(P, b)),
|
|
553
|
+
style: { zIndex: k - 1 },
|
|
554
|
+
onClick: I,
|
|
446
555
|
"aria-hidden": "true"
|
|
447
556
|
}), /* @__PURE__ */ jsxs("div", {
|
|
448
|
-
ref:
|
|
449
|
-
className: cn_default(getDrawerStyles(
|
|
557
|
+
ref: j,
|
|
558
|
+
className: cn_default(getDrawerStyles(a, l, P, y)),
|
|
450
559
|
style: {
|
|
451
|
-
zIndex:
|
|
452
|
-
height:
|
|
560
|
+
zIndex: k,
|
|
561
|
+
height: l === "full" && (a === "left" || a === "right") ? "100vh" : void 0
|
|
453
562
|
},
|
|
454
563
|
role: "dialog",
|
|
455
564
|
"aria-modal": "true",
|
|
456
|
-
"aria-labelledby":
|
|
457
|
-
...
|
|
565
|
+
"aria-labelledby": i ? "drawer-title" : void 0,
|
|
566
|
+
...A,
|
|
458
567
|
children: [
|
|
459
|
-
(
|
|
460
|
-
className: cn_default(getHeaderStyles(
|
|
568
|
+
(i || h || E) && /* @__PURE__ */ jsxs("div", {
|
|
569
|
+
className: cn_default(getHeaderStyles(S)),
|
|
461
570
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
462
571
|
className: "flex items-center gap-4 flex-1",
|
|
463
|
-
children: [
|
|
572
|
+
children: [i && /* @__PURE__ */ jsx("h2", {
|
|
464
573
|
id: "drawer-title",
|
|
465
574
|
className: "text-lg font-semibold text-gray-900 flex-1",
|
|
466
|
-
children:
|
|
467
|
-
}),
|
|
575
|
+
children: i
|
|
576
|
+
}), E && /* @__PURE__ */ jsx("div", {
|
|
468
577
|
className: "flex items-center gap-2",
|
|
469
|
-
children:
|
|
578
|
+
children: E
|
|
470
579
|
})]
|
|
471
|
-
}),
|
|
580
|
+
}), h && /* @__PURE__ */ jsx("button", {
|
|
472
581
|
type: "button",
|
|
473
|
-
onClick:
|
|
582
|
+
onClick: L,
|
|
474
583
|
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",
|
|
475
584
|
"aria-label": "关闭抽屉",
|
|
476
|
-
children:
|
|
585
|
+
children: g || /* @__PURE__ */ jsx(DefaultCloseIcon, {})
|
|
477
586
|
})]
|
|
478
587
|
}),
|
|
479
588
|
/* @__PURE__ */ jsx("div", {
|
|
480
|
-
className: cn_default(getBodyStyles(
|
|
589
|
+
className: cn_default(getBodyStyles(x), "min-h-0 flex-1 overflow-y-auto"),
|
|
481
590
|
style: { overscrollBehavior: "contain" },
|
|
482
|
-
onWheel: (
|
|
483
|
-
|
|
591
|
+
onWheel: (r) => {
|
|
592
|
+
r.stopPropagation();
|
|
484
593
|
},
|
|
485
|
-
onTouchMove: (
|
|
486
|
-
|
|
594
|
+
onTouchMove: (r) => {
|
|
595
|
+
r.stopPropagation();
|
|
487
596
|
},
|
|
488
|
-
children:
|
|
597
|
+
children: w
|
|
489
598
|
}),
|
|
490
|
-
|
|
491
|
-
className: cn_default(getFooterStyles(
|
|
492
|
-
children:
|
|
599
|
+
T && /* @__PURE__ */ jsx("div", {
|
|
600
|
+
className: cn_default(getFooterStyles(C)),
|
|
601
|
+
children: T
|
|
493
602
|
})
|
|
494
603
|
]
|
|
495
604
|
})] });
|
|
496
605
|
});
|
|
497
|
-
function getEmptyStateStyles(
|
|
606
|
+
function getEmptyStateStyles(r = "md", i = "default", a) {
|
|
498
607
|
return cn_default("flex flex-col items-center justify-center text-center", {
|
|
499
608
|
sm: "py-8 px-4",
|
|
500
609
|
md: "py-12 px-6",
|
|
501
610
|
lg: "py-16 px-8"
|
|
502
|
-
}[
|
|
611
|
+
}[r], {
|
|
503
612
|
default: "bg-gray-50 rounded-lg",
|
|
504
613
|
minimal: "bg-transparent",
|
|
505
614
|
card: "bg-white border border-gray-200 rounded-lg shadow-sm"
|
|
506
|
-
}[
|
|
615
|
+
}[i], a);
|
|
507
616
|
}
|
|
508
|
-
function getIconContainerStyles(
|
|
617
|
+
function getIconContainerStyles(r = "md") {
|
|
509
618
|
return cn_default("flex items-center justify-center text-gray-400", {
|
|
510
619
|
sm: "w-12 h-12 mb-3",
|
|
511
620
|
md: "w-16 h-16 mb-4",
|
|
512
621
|
lg: "w-20 h-20 mb-6"
|
|
513
|
-
}[
|
|
622
|
+
}[r]);
|
|
514
623
|
}
|
|
515
|
-
function getTitleStyles(
|
|
624
|
+
function getTitleStyles(r = "md") {
|
|
516
625
|
return cn_default("text-gray-900 mb-2", {
|
|
517
626
|
sm: "text-lg font-semibold",
|
|
518
627
|
md: "text-xl font-semibold",
|
|
519
628
|
lg: "text-2xl font-semibold"
|
|
520
|
-
}[
|
|
629
|
+
}[r]);
|
|
521
630
|
}
|
|
522
|
-
function getDescriptionStyles(
|
|
631
|
+
function getDescriptionStyles(r = "md") {
|
|
523
632
|
return cn_default("text-gray-600 mb-4 max-w-md", {
|
|
524
633
|
sm: "text-sm",
|
|
525
634
|
md: "text-base",
|
|
526
635
|
lg: "text-lg"
|
|
527
|
-
}[
|
|
636
|
+
}[r]);
|
|
528
637
|
}
|
|
529
638
|
function getActionStyles() {
|
|
530
639
|
return "mt-2";
|
|
531
640
|
}
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
/* @__PURE__ */ jsx(
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
}),
|
|
544
|
-
/* @__PURE__ */ jsx("line", {
|
|
545
|
-
x1: "15",
|
|
546
|
-
y1: "9",
|
|
547
|
-
x2: "9",
|
|
548
|
-
y2: "15"
|
|
549
|
-
}),
|
|
550
|
-
/* @__PURE__ */ jsx("line", {
|
|
551
|
-
x1: "9",
|
|
552
|
-
y1: "9",
|
|
553
|
-
x2: "15",
|
|
554
|
-
y2: "15"
|
|
555
|
-
})
|
|
556
|
-
]
|
|
557
|
-
});
|
|
558
|
-
function EmptyStateIcon({ type: e, className: b }) {
|
|
559
|
-
let x = {
|
|
560
|
-
search: /* @__PURE__ */ jsx(SearchIcon_default, { className: b }),
|
|
561
|
-
folder: /* @__PURE__ */ jsx(FolderIcon_default, { className: b }),
|
|
562
|
-
document: /* @__PURE__ */ jsx(DocumentIcon_default, { className: b }),
|
|
563
|
-
users: /* @__PURE__ */ jsx(UsersIcon_default, { className: b }),
|
|
564
|
-
settings: /* @__PURE__ */ jsx(SettingsIcon_default, { className: b }),
|
|
565
|
-
warning: /* @__PURE__ */ jsx(WarningIcon_default, { className: b }),
|
|
566
|
-
info: /* @__PURE__ */ jsx(InfoIcon_default, { className: b }),
|
|
567
|
-
success: /* @__PURE__ */ jsx(SuccessIcon_default, { className: b }),
|
|
568
|
-
error: /* @__PURE__ */ jsx(ErrorIcon_default, { className: b })
|
|
641
|
+
function EmptyStateIcon({ type: r, className: i }) {
|
|
642
|
+
let a = {
|
|
643
|
+
search: /* @__PURE__ */ jsx(SearchIcon_default, { className: i }),
|
|
644
|
+
folder: /* @__PURE__ */ jsx(FolderIcon_default, { className: i }),
|
|
645
|
+
document: /* @__PURE__ */ jsx(DocumentIcon_default, { className: i }),
|
|
646
|
+
users: /* @__PURE__ */ jsx(UsersIcon_default, { className: i }),
|
|
647
|
+
settings: /* @__PURE__ */ jsx(SettingsIcon_default, { className: i }),
|
|
648
|
+
warning: /* @__PURE__ */ jsx(WarningIcon_default, { className: i }),
|
|
649
|
+
info: /* @__PURE__ */ jsx(InfoIcon_default, { className: i }),
|
|
650
|
+
success: /* @__PURE__ */ jsx(SuccessIcon_default, { className: i }),
|
|
651
|
+
error: /* @__PURE__ */ jsx(ErrorIcon_default, { className: i })
|
|
569
652
|
};
|
|
570
|
-
return
|
|
653
|
+
return a[r] || a.search;
|
|
571
654
|
}
|
|
572
|
-
var EmptyState_default = forwardRef(({ icon:
|
|
573
|
-
let
|
|
574
|
-
className:
|
|
655
|
+
var EmptyState_default = forwardRef(({ icon: r = "search", title: i, description: a, action: o, size: s = "md", variant: c = "default", className: l, showIcon: u = !0, style: d, ...p }, m) => {
|
|
656
|
+
let h = getEmptyStateStyles(s, c, l), g = getIconContainerStyles(s), _ = getTitleStyles(s), v = getDescriptionStyles(s), y = getActionStyles(), b = () => u ? typeof r == "string" ? /* @__PURE__ */ jsx("div", {
|
|
657
|
+
className: g,
|
|
575
658
|
children: /* @__PURE__ */ jsx(EmptyStateIcon, {
|
|
576
|
-
type:
|
|
659
|
+
type: r,
|
|
577
660
|
className: "w-full h-full"
|
|
578
661
|
})
|
|
579
662
|
}) : /* @__PURE__ */ jsx("div", {
|
|
580
|
-
className:
|
|
581
|
-
children:
|
|
663
|
+
className: g,
|
|
664
|
+
children: r
|
|
582
665
|
}) : null;
|
|
583
666
|
return /* @__PURE__ */ jsxs("div", {
|
|
584
|
-
ref:
|
|
585
|
-
className:
|
|
586
|
-
style:
|
|
587
|
-
...
|
|
667
|
+
ref: m,
|
|
668
|
+
className: h,
|
|
669
|
+
style: d,
|
|
670
|
+
...p,
|
|
588
671
|
children: [
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
className:
|
|
592
|
-
children:
|
|
672
|
+
b(),
|
|
673
|
+
i && /* @__PURE__ */ jsx("h3", {
|
|
674
|
+
className: _,
|
|
675
|
+
children: i
|
|
593
676
|
}),
|
|
594
|
-
|
|
595
|
-
className:
|
|
596
|
-
children:
|
|
677
|
+
a && /* @__PURE__ */ jsx("p", {
|
|
678
|
+
className: v,
|
|
679
|
+
children: a
|
|
597
680
|
}),
|
|
598
|
-
|
|
599
|
-
className:
|
|
600
|
-
children:
|
|
681
|
+
o && /* @__PURE__ */ jsx("div", {
|
|
682
|
+
className: y,
|
|
683
|
+
children: o
|
|
601
684
|
})
|
|
602
685
|
]
|
|
603
686
|
});
|
|
@@ -615,29 +698,29 @@ const SIZE_MAP = {
|
|
|
615
698
|
lg: "text-lg",
|
|
616
699
|
xl: "text-xl"
|
|
617
700
|
};
|
|
618
|
-
function getLoaderSize(
|
|
619
|
-
return SIZE_MAP[
|
|
701
|
+
function getLoaderSize(r) {
|
|
702
|
+
return SIZE_MAP[r];
|
|
620
703
|
}
|
|
621
|
-
function getTextSize(
|
|
622
|
-
return TEXT_SIZE_MAP[
|
|
704
|
+
function getTextSize(r) {
|
|
705
|
+
return TEXT_SIZE_MAP[r];
|
|
623
706
|
}
|
|
624
|
-
var Loading_default = ({ size:
|
|
707
|
+
var Loading_default = ({ size: r = "md", variant: i = "spinner", text: a, showText: o = !1, fullscreen: s = !1, className: l }) => {
|
|
625
708
|
useEffect(() => {
|
|
626
|
-
if (!
|
|
627
|
-
let
|
|
628
|
-
return document.body.style.overflow = "hidden",
|
|
629
|
-
document.body.style.overflow =
|
|
709
|
+
if (!s) return;
|
|
710
|
+
let r = document.body.style.overflow, i = document.body.style.paddingRight, a = window.innerWidth - document.documentElement.clientWidth;
|
|
711
|
+
return document.body.style.overflow = "hidden", a > 0 && (document.body.style.paddingRight = `${a}px`), () => {
|
|
712
|
+
document.body.style.overflow = r, document.body.style.paddingRight = i;
|
|
630
713
|
};
|
|
631
|
-
}, [
|
|
632
|
-
let
|
|
633
|
-
className: cn_default("flex flex-col items-center justify-center gap-4",
|
|
714
|
+
}, [s]);
|
|
715
|
+
let u = /* @__PURE__ */ jsxs("div", {
|
|
716
|
+
className: cn_default("flex flex-col items-center justify-center gap-4", s ? "min-h-screen" : "py-8", l),
|
|
634
717
|
children: [(() => {
|
|
635
|
-
let
|
|
636
|
-
switch (
|
|
718
|
+
let a = getLoaderSize(r);
|
|
719
|
+
switch (i) {
|
|
637
720
|
case "spinner": return /* @__PURE__ */ jsxs("div", {
|
|
638
721
|
className: "relative",
|
|
639
|
-
children: [/* @__PURE__ */ jsx("div", { className: cn_default("rounded-full border-4 border-gray-200",
|
|
640
|
-
className: cn_default("absolute inset-0 rounded-full border-4 border-transparent border-t-blue-600 animate-spin",
|
|
722
|
+
children: [/* @__PURE__ */ jsx("div", { className: cn_default("rounded-full border-4 border-gray-200", a) }), /* @__PURE__ */ jsx("div", {
|
|
723
|
+
className: cn_default("absolute inset-0 rounded-full border-4 border-transparent border-t-blue-600 animate-spin", a),
|
|
641
724
|
style: { animationDuration: "0.8s" }
|
|
642
725
|
})]
|
|
643
726
|
});
|
|
@@ -645,21 +728,21 @@ var Loading_default = ({ size: e = "md", variant: b = "spinner", text: x, showTe
|
|
|
645
728
|
className: "flex items-center gap-2",
|
|
646
729
|
children: [
|
|
647
730
|
/* @__PURE__ */ jsx("span", {
|
|
648
|
-
className: cn_default("rounded-full bg-blue-600 animate-bounce",
|
|
731
|
+
className: cn_default("rounded-full bg-blue-600 animate-bounce", a),
|
|
649
732
|
style: {
|
|
650
733
|
animationDelay: "0ms",
|
|
651
734
|
animationDuration: "1s"
|
|
652
735
|
}
|
|
653
736
|
}),
|
|
654
737
|
/* @__PURE__ */ jsx("span", {
|
|
655
|
-
className: cn_default("rounded-full bg-blue-600 animate-bounce",
|
|
738
|
+
className: cn_default("rounded-full bg-blue-600 animate-bounce", a),
|
|
656
739
|
style: {
|
|
657
740
|
animationDelay: "150ms",
|
|
658
741
|
animationDuration: "1s"
|
|
659
742
|
}
|
|
660
743
|
}),
|
|
661
744
|
/* @__PURE__ */ jsx("span", {
|
|
662
|
-
className: cn_default("rounded-full bg-blue-600 animate-bounce",
|
|
745
|
+
className: cn_default("rounded-full bg-blue-600 animate-bounce", a),
|
|
663
746
|
style: {
|
|
664
747
|
animationDelay: "300ms",
|
|
665
748
|
animationDuration: "1s"
|
|
@@ -667,7 +750,7 @@ var Loading_default = ({ size: e = "md", variant: b = "spinner", text: x, showTe
|
|
|
667
750
|
})
|
|
668
751
|
]
|
|
669
752
|
});
|
|
670
|
-
case "pulse": return /* @__PURE__ */ jsx("div", { className: cn_default("rounded-full bg-blue-600 animate-pulse",
|
|
753
|
+
case "pulse": return /* @__PURE__ */ jsx("div", { className: cn_default("rounded-full bg-blue-600 animate-pulse", a) });
|
|
671
754
|
case "skeleton": return /* @__PURE__ */ jsxs("div", {
|
|
672
755
|
className: "space-y-3 w-full",
|
|
673
756
|
children: [
|
|
@@ -678,14 +761,315 @@ var Loading_default = ({ size: e = "md", variant: b = "spinner", text: x, showTe
|
|
|
678
761
|
});
|
|
679
762
|
default: return null;
|
|
680
763
|
}
|
|
681
|
-
})(),
|
|
682
|
-
className: cn_default("text-gray-700 font-medium", getTextSize(
|
|
683
|
-
children:
|
|
764
|
+
})(), o && a && /* @__PURE__ */ jsx("p", {
|
|
765
|
+
className: cn_default("text-gray-700 font-medium", getTextSize(r)),
|
|
766
|
+
children: a
|
|
684
767
|
})]
|
|
685
768
|
});
|
|
686
|
-
return
|
|
769
|
+
return s ? /* @__PURE__ */ jsx("div", {
|
|
687
770
|
className: "fixed inset-0 bg-white/70 backdrop-blur-[2px] z-50 flex items-center justify-center transition-all duration-300",
|
|
688
|
-
children:
|
|
689
|
-
}) :
|
|
771
|
+
children: u
|
|
772
|
+
}) : u;
|
|
773
|
+
};
|
|
774
|
+
const paginationStyles = {
|
|
775
|
+
base: "flex items-center gap-1 text-sm",
|
|
776
|
+
sizes: {
|
|
777
|
+
small: "text-xs",
|
|
778
|
+
middle: "text-sm",
|
|
779
|
+
large: "text-base"
|
|
780
|
+
},
|
|
781
|
+
alignments: {
|
|
782
|
+
left: "justify-start",
|
|
783
|
+
center: "justify-center",
|
|
784
|
+
right: "justify-end"
|
|
785
|
+
},
|
|
786
|
+
item: {
|
|
787
|
+
base: "inline-flex items-center justify-center min-w-[32px] h-8 px-3 rounded-md border border-gray-300 text-gray-700 cursor-pointer transition-all duration-200 hover:border-blue-500 hover:text-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50",
|
|
788
|
+
active: "bg-blue-500 text-white border-blue-500 hover:bg-blue-600 hover:border-blue-600",
|
|
789
|
+
disabled: "opacity-50 cursor-not-allowed hover:border-gray-300 hover:text-gray-700 hover:bg-white",
|
|
790
|
+
ellipsis: "cursor-default hover:border-gray-300 hover:text-gray-700 hover:bg-white"
|
|
791
|
+
},
|
|
792
|
+
jump: {
|
|
793
|
+
base: "inline-flex items-center justify-center w-8 h-8 rounded-md border border-gray-300 bg-white text-gray-700 cursor-pointer transition-all duration-200 hover:border-blue-500 hover:text-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50",
|
|
794
|
+
disabled: "opacity-50 cursor-not-allowed hover:border-gray-300 hover:text-gray-700 hover:bg-white"
|
|
795
|
+
},
|
|
796
|
+
sizeChanger: {
|
|
797
|
+
base: "flex items-center gap-2 text-sm",
|
|
798
|
+
select: "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",
|
|
799
|
+
label: "text-gray-600"
|
|
800
|
+
},
|
|
801
|
+
quickJumper: {
|
|
802
|
+
base: "flex items-center gap-2 text-sm",
|
|
803
|
+
input: "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",
|
|
804
|
+
label: "text-gray-600"
|
|
805
|
+
},
|
|
806
|
+
total: { base: "text-sm text-gray-600 mr-4" },
|
|
807
|
+
simple: {
|
|
808
|
+
base: "flex items-center gap-2 text-sm",
|
|
809
|
+
input: "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",
|
|
810
|
+
separator: "text-gray-500"
|
|
811
|
+
}
|
|
812
|
+
};
|
|
813
|
+
function getPaginationStyles(r = "middle", i = "left", a) {
|
|
814
|
+
let o = [
|
|
815
|
+
paginationStyles.base,
|
|
816
|
+
paginationStyles.sizes[r],
|
|
817
|
+
paginationStyles.alignments[i]
|
|
818
|
+
].filter(Boolean).join(" ");
|
|
819
|
+
return a ? `${o} ${a}` : o;
|
|
820
|
+
}
|
|
821
|
+
function getPaginationItemStyles(r, i, a, o) {
|
|
822
|
+
let s = [
|
|
823
|
+
paginationStyles.item.base,
|
|
824
|
+
r && paginationStyles.item.active,
|
|
825
|
+
i && paginationStyles.item.disabled,
|
|
826
|
+
a && paginationStyles.item.ellipsis
|
|
827
|
+
].filter(Boolean).join(" ");
|
|
828
|
+
return o ? `${s} ${o}` : s;
|
|
829
|
+
}
|
|
830
|
+
function getPaginationJumpStyles(r, i) {
|
|
831
|
+
let a = [paginationStyles.jump.base, r && paginationStyles.jump.disabled].filter(Boolean).join(" ");
|
|
832
|
+
return i ? `${a} ${i}` : a;
|
|
833
|
+
}
|
|
834
|
+
function getPaginationSizeChangerStyles(r) {
|
|
835
|
+
return r ? `${paginationStyles.sizeChanger.base} ${r}` : paginationStyles.sizeChanger.base;
|
|
836
|
+
}
|
|
837
|
+
function getPaginationQuickJumperStyles(r) {
|
|
838
|
+
return r ? `${paginationStyles.quickJumper.base} ${r}` : paginationStyles.quickJumper.base;
|
|
839
|
+
}
|
|
840
|
+
function getPaginationTotalStyles(r) {
|
|
841
|
+
return r ? `${paginationStyles.total.base} ${r}` : paginationStyles.total.base;
|
|
842
|
+
}
|
|
843
|
+
function getPaginationSimpleStyles(r) {
|
|
844
|
+
return r ? `${paginationStyles.simple.base} ${r}` : paginationStyles.simple.base;
|
|
845
|
+
}
|
|
846
|
+
var PaginationItem = ({ page: r, active: i = !1, disabled: a = !1, onClick: o, className: s, ellipsis: c = !1, children: l }) => /* @__PURE__ */ jsx("button", {
|
|
847
|
+
className: getPaginationItemStyles(i, a, c, s),
|
|
848
|
+
onClick: () => {
|
|
849
|
+
!a && !c && o && o(r);
|
|
850
|
+
},
|
|
851
|
+
disabled: a,
|
|
852
|
+
type: "button",
|
|
853
|
+
children: l || r
|
|
854
|
+
}), PaginationJump = ({ onClick: r, disabled: i = !1, className: a, icon: o, title: s }) => /* @__PURE__ */ jsx("button", {
|
|
855
|
+
className: getPaginationJumpStyles(i, a),
|
|
856
|
+
onClick: () => {
|
|
857
|
+
!i && r && r();
|
|
858
|
+
},
|
|
859
|
+
disabled: i,
|
|
860
|
+
type: "button",
|
|
861
|
+
title: s,
|
|
862
|
+
children: o
|
|
863
|
+
}), PaginationSizeChanger = ({ current: r, pageSize: i, pageSizeOptions: a, onChange: o, disabled: s = !1, className: c, itemsPerPageText: l = "每页条数" }) => /* @__PURE__ */ jsxs("div", {
|
|
864
|
+
className: getPaginationSizeChangerStyles(c),
|
|
865
|
+
children: [
|
|
866
|
+
/* @__PURE__ */ jsx("span", {
|
|
867
|
+
className: "text-gray-600",
|
|
868
|
+
children: l
|
|
869
|
+
}),
|
|
870
|
+
/* @__PURE__ */ jsx("select", {
|
|
871
|
+
value: i,
|
|
872
|
+
onChange: (i) => {
|
|
873
|
+
o(r, parseInt(i.target.value));
|
|
874
|
+
},
|
|
875
|
+
disabled: s,
|
|
876
|
+
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: a.map((r) => /* @__PURE__ */ jsx("option", {
|
|
878
|
+
value: r,
|
|
879
|
+
children: r
|
|
880
|
+
}, r))
|
|
881
|
+
}),
|
|
882
|
+
/* @__PURE__ */ jsx("span", {
|
|
883
|
+
className: "text-gray-600",
|
|
884
|
+
children: l
|
|
885
|
+
})
|
|
886
|
+
]
|
|
887
|
+
}), PaginationQuickJumper = ({ totalPages: r, onJump: i, disabled: a = !1, className: o, jumpToText: s = "跳转到", pageText: c = "页" }) => {
|
|
888
|
+
let [l, d] = useState(""), p = () => {
|
|
889
|
+
let a = parseInt(l);
|
|
890
|
+
a >= 1 && a <= r && (i(a), d(""));
|
|
891
|
+
};
|
|
892
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
893
|
+
className: getPaginationQuickJumperStyles(o),
|
|
894
|
+
children: [
|
|
895
|
+
/* @__PURE__ */ jsx("span", {
|
|
896
|
+
className: "text-gray-600",
|
|
897
|
+
children: s
|
|
898
|
+
}),
|
|
899
|
+
/* @__PURE__ */ jsx("input", {
|
|
900
|
+
type: "number",
|
|
901
|
+
value: l,
|
|
902
|
+
onChange: (r) => d(r.target.value),
|
|
903
|
+
onKeyUp: (r) => {
|
|
904
|
+
r.key === "Enter" && p();
|
|
905
|
+
},
|
|
906
|
+
disabled: a,
|
|
907
|
+
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: c,
|
|
909
|
+
min: "1",
|
|
910
|
+
max: r
|
|
911
|
+
}),
|
|
912
|
+
/* @__PURE__ */ jsx("span", {
|
|
913
|
+
className: "text-gray-600",
|
|
914
|
+
children: c
|
|
915
|
+
})
|
|
916
|
+
]
|
|
917
|
+
});
|
|
918
|
+
}, Pagination_default = ({ current: r, defaultCurrent: i = 1, pageSize: a, defaultPageSize: s = 10, total: d = 0, onChange: p, onShowSizeChange: m, showQuickJumper: h = !1, showSizeChanger: g = !1, pageSizeOptions: _ = [
|
|
919
|
+
"10",
|
|
920
|
+
"20",
|
|
921
|
+
"50",
|
|
922
|
+
"100"
|
|
923
|
+
], showTotal: v = !1, showPrevNextJumpers: y = !0, showFirstLastJumpers: b = !1, disabled: x = !1, hideOnSinglePage: S = !1, size: C = "middle", align: w = "left", className: T, style: E, simple: D = !1, prevIcon: O, nextIcon: k, firstIcon: A, lastIcon: L, jumpPrevIcon: R, jumpNextIcon: z, texts: B = {} }) => {
|
|
924
|
+
let V = {
|
|
925
|
+
itemsPerPage: "每页条数",
|
|
926
|
+
items: "条",
|
|
927
|
+
jumpTo: "跳转到",
|
|
928
|
+
page: "页",
|
|
929
|
+
total: "共 {total} 条",
|
|
930
|
+
first: "首页",
|
|
931
|
+
previous: "上一页",
|
|
932
|
+
next: "下一页",
|
|
933
|
+
last: "末页",
|
|
934
|
+
jumpPrev: "向前5页",
|
|
935
|
+
jumpNext: "向后5页",
|
|
936
|
+
...B
|
|
937
|
+
}, [H, U] = useState(r ?? i), [W, G] = useState(a ?? s), K = useMemo(() => Math.ceil(d / W), [d, W]);
|
|
938
|
+
if (useEffect(() => {
|
|
939
|
+
r !== void 0 && startTransition(() => {
|
|
940
|
+
U(r);
|
|
941
|
+
});
|
|
942
|
+
}, [r]), useEffect(() => {
|
|
943
|
+
a !== void 0 && startTransition(() => {
|
|
944
|
+
G(a);
|
|
945
|
+
});
|
|
946
|
+
}, [a]), S && K <= 1) return null;
|
|
947
|
+
if (D) return /* @__PURE__ */ jsxs("div", {
|
|
948
|
+
className: getPaginationSimpleStyles(T),
|
|
949
|
+
style: E,
|
|
950
|
+
children: [
|
|
951
|
+
/* @__PURE__ */ jsx("input", {
|
|
952
|
+
type: "number",
|
|
953
|
+
value: H,
|
|
954
|
+
onChange: (r) => {
|
|
955
|
+
let i = parseInt(r.target.value);
|
|
956
|
+
i >= 1 && i <= K && (U(i), p?.(i, W));
|
|
957
|
+
},
|
|
958
|
+
disabled: x,
|
|
959
|
+
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
|
+
min: "1",
|
|
961
|
+
max: K
|
|
962
|
+
}),
|
|
963
|
+
/* @__PURE__ */ jsx("span", {
|
|
964
|
+
className: "text-gray-500",
|
|
965
|
+
children: "/"
|
|
966
|
+
}),
|
|
967
|
+
/* @__PURE__ */ jsx("span", {
|
|
968
|
+
className: "text-gray-600",
|
|
969
|
+
children: K
|
|
970
|
+
})
|
|
971
|
+
]
|
|
972
|
+
});
|
|
973
|
+
let q = () => {
|
|
974
|
+
let r = [], i = H > 4, a = H < K - 3;
|
|
975
|
+
i && (r.push(1), H > 5 && r.push("prev-ellipsis"));
|
|
976
|
+
let o = Math.max(1, H - 2), s = Math.min(K, H + 2);
|
|
977
|
+
for (let i = o; i <= s; i++) r.push(i);
|
|
978
|
+
return a && (H < K - 4 && r.push("next-ellipsis"), r.push(K)), r;
|
|
979
|
+
}, J = (r) => {
|
|
980
|
+
r !== H && r >= 1 && r <= K && (U(r), p?.(r, W));
|
|
981
|
+
}, Y = (r) => {
|
|
982
|
+
let i = Math.ceil(d / r), a = Math.min(H, i);
|
|
983
|
+
G(r), U(a), m?.(a, r), p?.(a, r);
|
|
984
|
+
}, X = () => {
|
|
985
|
+
J(Math.max(1, H - 5));
|
|
986
|
+
}, Z = () => {
|
|
987
|
+
J(Math.min(K, H + 5));
|
|
988
|
+
}, Q = (r) => {
|
|
989
|
+
J(r);
|
|
990
|
+
}, $ = q();
|
|
991
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
992
|
+
className: getPaginationStyles(C, w, T),
|
|
993
|
+
style: E,
|
|
994
|
+
children: [
|
|
995
|
+
v && /* @__PURE__ */ jsx("div", {
|
|
996
|
+
className: getPaginationTotalStyles(),
|
|
997
|
+
children: typeof v == "function" ? v(d, [(H - 1) * W + 1, Math.min(H * W, d)]) : V.total.replace("{total}", d.toString())
|
|
998
|
+
}),
|
|
999
|
+
b && H > 1 && /* @__PURE__ */ jsx("button", {
|
|
1000
|
+
className: getPaginationJumpStyles(x),
|
|
1001
|
+
onClick: () => J(1),
|
|
1002
|
+
disabled: x,
|
|
1003
|
+
type: "button",
|
|
1004
|
+
title: V.first,
|
|
1005
|
+
children: A || /* @__PURE__ */ jsx(FirstIcon_default, {})
|
|
1006
|
+
}),
|
|
1007
|
+
H > 1 && /* @__PURE__ */ jsx("button", {
|
|
1008
|
+
className: getPaginationJumpStyles(x),
|
|
1009
|
+
onClick: () => J(H - 1),
|
|
1010
|
+
disabled: x,
|
|
1011
|
+
type: "button",
|
|
1012
|
+
title: V.previous,
|
|
1013
|
+
children: O || /* @__PURE__ */ jsx(PrevIcon_default, {})
|
|
1014
|
+
}),
|
|
1015
|
+
y && H > 4 && /* @__PURE__ */ jsx(PaginationJump, {
|
|
1016
|
+
direction: "prev",
|
|
1017
|
+
onClick: X,
|
|
1018
|
+
disabled: x,
|
|
1019
|
+
icon: R || /* @__PURE__ */ jsx(JumpPrevIcon_default, {}),
|
|
1020
|
+
title: V.jumpPrev
|
|
1021
|
+
}),
|
|
1022
|
+
$.map((r, i) => typeof r == "string" ? /* @__PURE__ */ jsx(PaginationItem, {
|
|
1023
|
+
page: 0,
|
|
1024
|
+
ellipsis: !0,
|
|
1025
|
+
className: "cursor-default",
|
|
1026
|
+
children: "..."
|
|
1027
|
+
}, `${r}-${i}`) : /* @__PURE__ */ jsx(PaginationItem, {
|
|
1028
|
+
page: r,
|
|
1029
|
+
active: r === H,
|
|
1030
|
+
disabled: x,
|
|
1031
|
+
onClick: J
|
|
1032
|
+
}, r)),
|
|
1033
|
+
y && H < K - 3 && /* @__PURE__ */ jsx(PaginationJump, {
|
|
1034
|
+
direction: "next",
|
|
1035
|
+
onClick: Z,
|
|
1036
|
+
disabled: x,
|
|
1037
|
+
icon: z || /* @__PURE__ */ jsx(JumpNextIcon_default, {}),
|
|
1038
|
+
title: V.jumpNext
|
|
1039
|
+
}),
|
|
1040
|
+
H < K && /* @__PURE__ */ jsx("button", {
|
|
1041
|
+
className: getPaginationJumpStyles(x),
|
|
1042
|
+
onClick: () => J(H + 1),
|
|
1043
|
+
disabled: x,
|
|
1044
|
+
type: "button",
|
|
1045
|
+
title: V.next,
|
|
1046
|
+
children: k || /* @__PURE__ */ jsx(NextIcon_default, {})
|
|
1047
|
+
}),
|
|
1048
|
+
b && H < K && /* @__PURE__ */ jsx("button", {
|
|
1049
|
+
className: getPaginationJumpStyles(x),
|
|
1050
|
+
onClick: () => J(K),
|
|
1051
|
+
disabled: x,
|
|
1052
|
+
type: "button",
|
|
1053
|
+
title: V.last,
|
|
1054
|
+
children: L || /* @__PURE__ */ jsx(LastIcon_default, {})
|
|
1055
|
+
}),
|
|
1056
|
+
g && /* @__PURE__ */ jsx(PaginationSizeChanger, {
|
|
1057
|
+
current: H,
|
|
1058
|
+
pageSize: W,
|
|
1059
|
+
pageSizeOptions: _,
|
|
1060
|
+
onChange: Y,
|
|
1061
|
+
disabled: x,
|
|
1062
|
+
itemsPerPageText: V.itemsPerPage
|
|
1063
|
+
}),
|
|
1064
|
+
h && /* @__PURE__ */ jsx(PaginationQuickJumper, {
|
|
1065
|
+
current: H,
|
|
1066
|
+
totalPages: K,
|
|
1067
|
+
onJump: Q,
|
|
1068
|
+
disabled: x,
|
|
1069
|
+
jumpToText: V.jumpTo,
|
|
1070
|
+
pageText: V.page
|
|
1071
|
+
})
|
|
1072
|
+
]
|
|
1073
|
+
});
|
|
690
1074
|
};
|
|
691
|
-
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, FolderIcon_default as FolderIcon, InfoIcon_default as InfoIcon, Loading_default as Loading, LoadingIcon_default as LoadingIcon, SearchIcon_default as SearchIcon, SettingsIcon_default as SettingsIcon, SuccessIcon_default as SuccessIcon, UsersIcon_default as UsersIcon, WarningIcon_default as WarningIcon, cn_default as cn };
|
|
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 };
|