gemini-uis 0.5.3 → 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.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 = (e) => {
4
- let b = {
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 b[e] || b.primary;
14
- }, getSizeStyles = (e) => {
15
- let b = {
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 b[e] || b.md;
23
- }, getRoundedStyles$2 = (e) => e ? "rounded-lg" : "rounded-none", getButtonStyles = (e = "primary", b = "md", x = !1, S = !1, C = !1, w) => [
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(e),
26
- getSizeStyles(b),
27
- getRoundedStyles$2(x),
28
- S ? "opacity-50 cursor-not-allowed" : "",
29
- C ? "cursor-wait" : "",
30
- w
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(...e) {
33
- return e.filter(Boolean).join(" ");
32
+ function cn(...r) {
33
+ return r.filter(Boolean).join(" ");
34
34
  }
35
- var cn_default = cn, LoadingIcon_default = ({ width: e = 16, height: b = 16, className: x = "animate-spin", ...S }) => /* @__PURE__ */ jsxs("svg", {
36
- width: e,
37
- height: b,
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: x,
42
- ...S,
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: e = 6, height: b = 6, fill: x = "none", strokeWidth: S = 2, stroke: C = "currentColor", ...w }) => /* @__PURE__ */ jsx("svg", {
56
- width: e,
57
- height: b,
58
- fill: x,
59
- stroke: C,
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
- ...w,
61
+ ...c,
62
62
  children: /* @__PURE__ */ jsx("path", {
63
63
  strokeLinecap: "round",
64
64
  strokeLinejoin: "round",
65
- strokeWidth: S,
65
+ strokeWidth: o,
66
66
  d: "M6 18L18 6M6 6l12 12"
67
67
  })
68
- }), ArrowIcon_default = ({ viewBox: e = "0 0 24 24", fill: b = "none", stroke: x = "currentColor", ...S }) => /* @__PURE__ */ jsx("svg", {
69
- fill: b,
70
- stroke: x,
71
- viewBox: e,
72
- ...S,
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: e = "0 0 24 24", fill: b = "none", stroke: x = "currentColor", strokeWidth: S = "1.5", ...C }) => /* @__PURE__ */ jsxs("svg", {
80
- viewBox: e,
81
- fill: b,
82
- stroke: x,
83
- strokeWidth: S,
84
- ...C,
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: e = "0 0 24 24", fill: b = "none", stroke: x = "currentColor", strokeWidth: S = "1.5", ...C }) => /* @__PURE__ */ jsx("svg", {
91
- viewBox: e,
92
- fill: b,
93
- stroke: x,
94
- strokeWidth: S,
95
- ...C,
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: e = "0 0 24 24", fill: b = "none", stroke: x = "currentColor", strokeWidth: S = "1.5", ...C }) => /* @__PURE__ */ jsxs("svg", {
98
- viewBox: e,
99
- fill: b,
100
- stroke: x,
101
- strokeWidth: S,
102
- ...C,
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: e = "0 0 24 24", fill: b = "none", stroke: x = "currentColor", strokeWidth: S = "1.5", ...C }) => /* @__PURE__ */ jsxs("svg", {
121
- viewBox: e,
122
- fill: b,
123
- stroke: x,
124
- strokeWidth: S,
125
- ...C,
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: e = "0 0 24 24", fill: b = "none", stroke: x = "currentColor", strokeWidth: S = "1.5", ...C }) => /* @__PURE__ */ jsxs("svg", {
137
- viewBox: e,
138
- fill: b,
139
- stroke: x,
140
- strokeWidth: S,
141
- ...C,
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: e = "0 0 24 24", fill: b = "none", stroke: x = "currentColor", strokeWidth: S = "1.5", ...C }) => /* @__PURE__ */ jsxs("svg", {
148
- viewBox: e,
149
- fill: b,
150
- stroke: x,
151
- strokeWidth: S,
152
- ...C,
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: e = "0 0 24 24", fill: b = "none", stroke: x = "currentColor", strokeWidth: S = "1.5", ...C }) => /* @__PURE__ */ jsxs("svg", {
159
- viewBox: e,
160
- fill: b,
161
- stroke: x,
162
- strokeWidth: S,
163
- ...C,
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: e = "0 0 24 24", fill: b = "none", stroke: x = "currentColor", strokeWidth: S = "1.5", ...C }) => /* @__PURE__ */ jsxs("svg", {
184
- viewBox: e,
185
- fill: b,
186
- stroke: x,
187
- strokeWidth: S,
188
- ...C,
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
- }), Button_default = forwardRef(({ type: e = "primary", size: b = "md", rounded: x = !1, disabled: S = !1, loading: C = !1, className: w, children: T, htmlType: E = "button", onClick: D, ...k }, A) => {
191
- let j = S || C;
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: A,
194
- type: E,
195
- disabled: j,
196
- onClick: (e) => {
197
- if (j) {
198
- e.preventDefault();
302
+ ref: m,
303
+ type: u,
304
+ disabled: h,
305
+ onClick: (r) => {
306
+ if (h) {
307
+ r.preventDefault();
199
308
  return;
200
309
  }
201
- D?.(e);
310
+ d?.(r);
202
311
  },
203
- className: cn_default(getButtonStyles(e, b, x, j, C, w)),
204
- ...k,
205
- children: [C && /* @__PURE__ */ jsx(LoadingIcon_default, { className: "animate-spin" }), T]
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 = (e) => {
209
- let b = {
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 b[e] || b.none;
218
- }, getBorderStyles = (e) => {
219
- let b = {
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,384 +333,743 @@ const getShadowStyles = (e) => {
224
333
  xl: "border-8 border-gray-200",
225
334
  "2xl": "border-16 border-gray-200"
226
335
  };
227
- return b[e] || b.none;
228
- }, 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", b = "none", x = !1, S = !1, C) => {
229
- let w = getShadowStyles(e), T = getBorderStyles(b), E = getRoundedStyles$1(x), D = getHoverStyles(S);
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
- C && /\bw-\w+/.test(C) ? "" : "w-full",
233
- w,
234
- T,
235
- E,
236
- D,
237
- C
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: e = "md", border: b = "sm", rounded: x = !1, disabledHover: S = !1, className: C, children: w, ...T }, E) => /* @__PURE__ */ jsx("div", {
241
- ref: E,
242
- className: cn_default(getCardStyles(e, b, x, S, C)),
243
- ...T,
244
- children: w
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 = (e) => {
247
- let b = {
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 b[e] || b.md;
253
- }, getCollapseVariantStyles = (e, b, x) => x ? "bg-transparent" : b || e === "bordered" ? "border border-gray-200 rounded-lg overflow-hidden" : "bg-white rounded-lg", getCollapseStyles = (e = "md", b = "default", x = !1, S = !1, C) => [
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(e),
256
- getCollapseVariantStyles(b, x, S),
257
- C
364
+ getCollapseSizeStyles(r),
365
+ getCollapseVariantStyles(i, a, o),
366
+ s
258
367
  ].filter(Boolean).join(" ").replace(/\s+/g, " ").trim();
259
- var DefaultArrowIcon = ({ isActive: e, disabled: b }) => /* @__PURE__ */ jsx(ArrowIcon_default, { className: cn_default("shrink-0 size-4 transition-transform duration-200 ease-in-out", e ? "rotate-180" : "rotate-0", b ? "opacity-50" : "") }), CollapseCore = forwardRef(({ activeKey: b, defaultActiveKey: S, collapsible: w = "header", accordion: D = !1, bordered: O = !1, ghost: k = !1, size: A = "md", variant: j = "default", className: M, children: N, onChange: F, onExpand: I, onCollapse: L, ...R }, z) => {
260
- let [B, V] = useState(() => {
261
- let e = b || S;
262
- return Array.isArray(e) ? e : e ? [e] : [];
263
- }), H = useMemo(() => b === void 0 ? B : Array.isArray(b) ? b : [b], [b, B]), U = useCallback((e) => {
264
- if (w === "disabled") return;
265
- let x;
266
- x = D ? H.includes(e) ? [] : [e] : H.includes(e) ? H.filter((b) => b !== e) : [...H, e], b === void 0 && V(x), F?.(D ? x[0] || "" : x), x.includes(e) ? I?.(e) : L?.(e);
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
- H,
270
- D,
271
- w,
272
- F,
273
- I,
274
- L
275
- ]), W = getCollapseStyles(A, j, O, k, M), G = useMemo(() => N ? Array.isArray(N) ? N.map((b, S) => {
276
- if (!isValidElement(b)) return b;
277
- let { ...C } = b.props, T = b.key || String(S), E = H.includes(T);
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(N) ? cloneElement(N, {
285
- ...N.props,
286
- isActive: H.includes(N.key || "filter"),
287
- onToggle: () => U(N.key || "filter"),
288
- collapsible: w
289
- }) : N : null, [
290
- N,
291
- H,
292
- U,
293
- w
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: z,
297
- className: cn_default(W),
298
- ...R,
299
- children: G
405
+ ref: C,
406
+ className: cn_default(O),
407
+ ...S,
408
+ children: k
300
409
  });
301
- }), CollapsePanel = forwardRef(({ key: e, header: b, children: x, disabled: S = !1, showArrow: C = !0, arrow: w, className: T, headerContainerClassName: E, headerContentClassName: D, contentClassName: k, onHeaderClick: A, isActive: j = !1, onToggle: M, collapsible: N = "header", ...F }, I) => {
302
- let L = () => {
303
- S || N === "disabled" || (A?.(e), M?.());
304
- }, R = (e) => {
305
- N !== "header" && (e.stopPropagation(), S || M?.());
306
- }, z = () => C ? w ? /* @__PURE__ */ jsx("span", {
307
- className: cn_default("shrink-0 transition-transform duration-200 ease-in-out", j ? "rotate-180" : "rotate-0", S ? "opacity-50" : "", N === "icon" ? "cursor-pointer" : ""),
308
- onClick: R,
309
- children: w
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: j,
312
- disabled: S
420
+ isActive: h,
421
+ disabled: o
313
422
  }) : null;
314
423
  return /* @__PURE__ */ jsxs("div", {
315
- ref: I,
316
- className: cn_default("border-b border-gray-200 last:border-b-0", T),
317
- ...F,
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", S ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:bg-gray-50", "focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-inset", E),
320
- onClick: L,
321
- tabIndex: S ? -1 : 0,
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": j,
324
- "aria-disabled": S,
432
+ "aria-expanded": h,
433
+ "aria-disabled": o,
325
434
  children: [/* @__PURE__ */ jsx("div", {
326
- className: cn_default("flex-1 pr-2", D),
327
- children: b
328
- }), z()]
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", j ? "max-h-none opacity-100" : "max-h-0 opacity-0"),
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", k),
333
- children: x
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 = (e) => ({
449
+ const getOrientationStyles = (r) => ({
341
450
  horizontal: "w-full h-0",
342
451
  vertical: "h-full w-0"
343
- })[e], getThicknessStyles = (e, b) => ({
344
- thin: b === "horizontal" ? "h-px" : "w-px",
345
- medium: b === "horizontal" ? "h-0.5" : "w-0.5",
346
- thick: b === "horizontal" ? "h-1" : "w-1",
347
- "extra-thick": b === "horizontal" ? "h-1.5" : "w-1.5"
348
- })[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, b = "horizontal") => e && b === "horizontal" ? `w-[${e}%]` : "", getDividerStyles = (e = "horizontal", b = "medium", x = !1, S, C = !1, w, T) => T ? ["block", T].filter(Boolean).join(" ").trim() : [
349
- e === "vertical" ? "bg-gray-200" : "border-0",
350
- getOrientationStyles(e),
351
- getThicknessStyles(b, e),
352
- getRoundedStyles(x),
353
- getColorStyles(S),
354
- getDashedStyles(C),
355
- getLengthStyles(w, e)
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: e = "horizontal", thickness: b = "medium", rounded: x = !1, color: S, dashed: C = !1, length: w, className: T, ...E }, D) => /* @__PURE__ */ jsx("div", {
358
- ref: D,
359
- className: cn_default(getDividerStyles(e, b, x ?? !1, S, C, w, T), T),
360
- ...E
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 = (e) => {
363
- let b = {
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 b[e] || b.right;
370
- }, getDrawerSizeStyles = (e, b) => {
371
- let x = b === "left" || b === "right";
372
- if (e === "full") return "w-screen h-screen";
373
- let S = {
374
- sm: x ? "w-64" : "h-64",
375
- md: x ? "w-96" : "h-96",
376
- lg: x ? "w-[46rem]" : "h-[46rem]"
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 S[e] || S.md;
379
- }, getDrawerTransformStyles = (e, b) => {
380
- if (b) return "translate-x-0 translate-y-0";
381
- let x = {
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 x[e] || x.right;
388
- }, getDrawerStyles = (e, b, x, S) => [
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(e),
391
- getDrawerSizeStyles(b, e),
392
- getDrawerTransformStyles(e, x),
393
- x ? "pointer-events-auto" : "pointer-events-none",
394
- S
395
- ].filter(Boolean).join(" ").replace(/\s+/g, " ").trim(), getMaskStyles = (e, b) => [
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
- e ? "opacity-100" : "opacity-0",
398
- e ? "pointer-events-auto" : "pointer-events-none",
399
- b
400
- ].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();
401
- var DefaultCloseIcon = () => /* @__PURE__ */ jsx(CloseIcon_default, { className: "w-5 h-5" }), Drawer_default = forwardRef(({ open: e = !1, title: b, placement: x = "right", size: T = "md", mask: k = !0, maskClosable: A = !0, closable: j = !0, closeIcon: M, destroyOnClose: N = !1, className: F, maskClassName: I, bodyClassName: L, headerClassName: R, footerClassName: z, children: B, footer: V, extra: H, onClose: U, afterOpenChange: W, zIndex: G = 1e3, ...K }, q) => {
402
- let [J, Y] = useState(e), [X, Z] = useState(!1);
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 (e) startTransition(() => {
405
- Y(!0);
513
+ if (r) startTransition(() => {
514
+ N(!0);
406
515
  }), requestAnimationFrame(() => {
407
516
  requestAnimationFrame(() => {
408
- Z(!0);
517
+ F(!0);
409
518
  });
410
519
  });
411
520
  else {
412
521
  startTransition(() => {
413
- Z(!1);
522
+ F(!1);
414
523
  });
415
- let e = setTimeout(() => {
416
- Y(!1);
524
+ let r = setTimeout(() => {
525
+ N(!1);
417
526
  }, 300);
418
- return () => clearTimeout(e);
527
+ return () => clearTimeout(r);
419
528
  }
420
- }, [e]), useEffect(() => {
421
- if (!e) return;
422
- let b = (e) => {
423
- e.key === "Escape" && U && U();
529
+ }, [r]), useEffect(() => {
530
+ if (!r) return;
531
+ let i = (r) => {
532
+ r.key === "Escape" && D && D();
424
533
  };
425
- return document.addEventListener("keydown", b), () => document.removeEventListener("keydown", b);
426
- }, [e, U]);
427
- let Q = useCallback(() => {
428
- A && U && U();
429
- }, [A, U]), $ = useCallback(() => {
430
- U && U();
431
- }, [U]);
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
- W && W(e);
434
- }, [e, W]), useEffect(() => {
435
- if (!e) return;
436
- let b = window.scrollY || 0, { style: x } = document.body, { style: S } = document.documentElement;
437
- x.position = "fixed", x.top = `-${b}px`, x.left = "0", x.right = "0", x.width = "100%", x.overflow = "hidden", S.overflow = "hidden", S.overscrollBehavior = "none";
438
- let C = (e) => e.preventDefault();
439
- return window.addEventListener("touchmove", C, { passive: !1 }), window.addEventListener("wheel", C, { passive: !1 }), () => {
440
- window.removeEventListener("touchmove", C), window.removeEventListener("wheel", C), x.position = "", x.top = "", x.left = "", x.right = "", x.width = "", x.overflow = "", S.overflow = "", S.overscrollBehavior = "", window.scrollTo(0, b);
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
- }, [e]), !J && N || !J ? null : /* @__PURE__ */ jsxs(Fragment, { children: [k && /* @__PURE__ */ jsx("div", {
443
- className: cn_default(getMaskStyles(X, I)),
444
- style: { zIndex: G - 1 },
445
- onClick: Q,
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: q,
449
- className: cn_default(getDrawerStyles(x, T, X, F)),
557
+ ref: j,
558
+ className: cn_default(getDrawerStyles(a, l, P, y)),
450
559
  style: {
451
- zIndex: G,
452
- height: T === "full" && (x === "left" || x === "right") ? "100vh" : void 0
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": b ? "drawer-title" : void 0,
457
- ...K,
565
+ "aria-labelledby": i ? "drawer-title" : void 0,
566
+ ...A,
458
567
  children: [
459
- (b || j || H) && /* @__PURE__ */ jsxs("div", {
460
- className: cn_default(getHeaderStyles(R)),
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: [b && /* @__PURE__ */ jsx("h2", {
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: b
467
- }), H && /* @__PURE__ */ jsx("div", {
575
+ children: i
576
+ }), E && /* @__PURE__ */ jsx("div", {
468
577
  className: "flex items-center gap-2",
469
- children: H
578
+ children: E
470
579
  })]
471
- }), j && /* @__PURE__ */ jsx("button", {
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: M || /* @__PURE__ */ jsx(DefaultCloseIcon, {})
585
+ children: g || /* @__PURE__ */ jsx(DefaultCloseIcon, {})
477
586
  })]
478
587
  }),
479
588
  /* @__PURE__ */ jsx("div", {
480
- className: cn_default(getBodyStyles(L), "min-h-0 flex-1 overflow-y-auto"),
589
+ className: cn_default(getBodyStyles(x), "min-h-0 flex-1 overflow-y-auto"),
481
590
  style: { overscrollBehavior: "contain" },
482
- onWheel: (e) => {
483
- e.stopPropagation();
591
+ onWheel: (r) => {
592
+ r.stopPropagation();
484
593
  },
485
- onTouchMove: (e) => {
486
- e.stopPropagation();
594
+ onTouchMove: (r) => {
595
+ r.stopPropagation();
487
596
  },
488
- children: B
597
+ children: w
489
598
  }),
490
- V && /* @__PURE__ */ jsx("div", {
491
- className: cn_default(getFooterStyles(z)),
492
- children: V
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(e = "md", b = "default", x) {
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
- }[e], {
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
- }[b], x);
615
+ }[i], a);
507
616
  }
508
- function getIconContainerStyles(e = "md") {
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
- }[e]);
622
+ }[r]);
514
623
  }
515
- function getTitleStyles(e = "md") {
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
- }[e]);
629
+ }[r]);
521
630
  }
522
- function getDescriptionStyles(e = "md") {
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
- }[e]);
636
+ }[r]);
528
637
  }
529
638
  function getActionStyles() {
530
639
  return "mt-2";
531
640
  }
532
- var ErrorIcon_default = ({ viewBox: e = "0 0 24 24", fill: b = "none", stroke: x = "currentColor", strokeWidth: S = "1.5", ...C }) => /* @__PURE__ */ jsxs("svg", {
533
- viewBox: e,
534
- fill: b,
535
- stroke: x,
536
- strokeWidth: S,
537
- ...C,
538
- children: [
539
- /* @__PURE__ */ jsx("circle", {
540
- cx: "12",
541
- cy: "12",
542
- r: "10"
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 x[e] || x.search;
653
+ return a[r] || a.search;
571
654
  }
572
- const EmptyState = forwardRef(({ icon: e = "search", title: b, description: x, action: S, size: C = "md", variant: w = "default", className: T, showIcon: E = !0, style: D, ...k }, A) => {
573
- let j = getEmptyStateStyles(C, w, T), M = getIconContainerStyles(C), N = getTitleStyles(C), P = getDescriptionStyles(C), F = getActionStyles(), I = () => E ? typeof e == "string" ? /* @__PURE__ */ jsx("div", {
574
- className: M,
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: e,
659
+ type: r,
577
660
  className: "w-full h-full"
578
661
  })
579
662
  }) : /* @__PURE__ */ jsx("div", {
580
- className: M,
581
- children: e
663
+ className: g,
664
+ children: r
582
665
  }) : null;
583
666
  return /* @__PURE__ */ jsxs("div", {
584
- ref: A,
585
- className: j,
586
- style: D,
587
- ...k,
667
+ ref: m,
668
+ className: h,
669
+ style: d,
670
+ ...p,
588
671
  children: [
589
- I(),
590
- b && /* @__PURE__ */ jsx("h3", {
591
- className: N,
592
- children: b
672
+ b(),
673
+ i && /* @__PURE__ */ jsx("h3", {
674
+ className: _,
675
+ children: i
593
676
  }),
594
- x && /* @__PURE__ */ jsx("p", {
595
- className: P,
596
- children: x
677
+ a && /* @__PURE__ */ jsx("p", {
678
+ className: v,
679
+ children: a
597
680
  }),
598
- S && /* @__PURE__ */ jsx("div", {
599
- className: F,
600
- children: S
681
+ o && /* @__PURE__ */ jsx("div", {
682
+ className: y,
683
+ children: o
601
684
  })
602
685
  ]
603
686
  });
604
687
  });
605
- EmptyState.displayName = "EmptyState";
606
- var EmptyState_default = EmptyState;
607
- 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, 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 };
688
+ const SIZE_MAP = {
689
+ xs: "w-4 h-4",
690
+ sm: "w-6 h-6",
691
+ md: "w-8 h-8",
692
+ lg: "w-12 h-12",
693
+ xl: "w-16 h-16"
694
+ }, TEXT_SIZE_MAP = {
695
+ xs: "text-xs",
696
+ sm: "text-sm",
697
+ md: "text-base",
698
+ lg: "text-lg",
699
+ xl: "text-xl"
700
+ };
701
+ function getLoaderSize(r) {
702
+ return SIZE_MAP[r];
703
+ }
704
+ function getTextSize(r) {
705
+ return TEXT_SIZE_MAP[r];
706
+ }
707
+ var Loading_default = ({ size: r = "md", variant: i = "spinner", text: a, showText: o = !1, fullscreen: s = !1, className: l }) => {
708
+ useEffect(() => {
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;
713
+ };
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),
717
+ children: [(() => {
718
+ let a = getLoaderSize(r);
719
+ switch (i) {
720
+ case "spinner": return /* @__PURE__ */ jsxs("div", {
721
+ className: "relative",
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),
724
+ style: { animationDuration: "0.8s" }
725
+ })]
726
+ });
727
+ case "dots": return /* @__PURE__ */ jsxs("div", {
728
+ className: "flex items-center gap-2",
729
+ children: [
730
+ /* @__PURE__ */ jsx("span", {
731
+ className: cn_default("rounded-full bg-blue-600 animate-bounce", a),
732
+ style: {
733
+ animationDelay: "0ms",
734
+ animationDuration: "1s"
735
+ }
736
+ }),
737
+ /* @__PURE__ */ jsx("span", {
738
+ className: cn_default("rounded-full bg-blue-600 animate-bounce", a),
739
+ style: {
740
+ animationDelay: "150ms",
741
+ animationDuration: "1s"
742
+ }
743
+ }),
744
+ /* @__PURE__ */ jsx("span", {
745
+ className: cn_default("rounded-full bg-blue-600 animate-bounce", a),
746
+ style: {
747
+ animationDelay: "300ms",
748
+ animationDuration: "1s"
749
+ }
750
+ })
751
+ ]
752
+ });
753
+ case "pulse": return /* @__PURE__ */ jsx("div", { className: cn_default("rounded-full bg-blue-600 animate-pulse", a) });
754
+ case "skeleton": return /* @__PURE__ */ jsxs("div", {
755
+ className: "space-y-3 w-full",
756
+ children: [
757
+ /* @__PURE__ */ jsx("div", { className: "h-4 bg-gray-200 rounded animate-pulse w-3/4" }),
758
+ /* @__PURE__ */ jsx("div", { className: "h-4 bg-gray-200 rounded animate-pulse w-full" }),
759
+ /* @__PURE__ */ jsx("div", { className: "h-4 bg-gray-200 rounded animate-pulse w-5/6" })
760
+ ]
761
+ });
762
+ default: return null;
763
+ }
764
+ })(), o && a && /* @__PURE__ */ jsx("p", {
765
+ className: cn_default("text-gray-700 font-medium", getTextSize(r)),
766
+ children: a
767
+ })]
768
+ });
769
+ return s ? /* @__PURE__ */ jsx("div", {
770
+ className: "fixed inset-0 bg-white/70 backdrop-blur-[2px] z-50 flex items-center justify-center transition-all duration-300",
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
+ });
1074
+ };
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 };