sa2kit 1.6.31 → 1.6.33

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.
Files changed (49) hide show
  1. package/dist/AliyunOSSProvider-4W47OFEK.mjs +6 -0
  2. package/dist/{AliyunOSSProvider-P6TOVKMM.mjs.map → AliyunOSSProvider-4W47OFEK.mjs.map} +1 -1
  3. package/dist/AliyunOSSProvider-HCNGDJL7.js +15 -0
  4. package/dist/{AliyunOSSProvider-Z5BRBCG6.js.map → AliyunOSSProvider-HCNGDJL7.js.map} +1 -1
  5. package/dist/calendar/index.js +8 -8
  6. package/dist/calendar/index.mjs +1 -1
  7. package/dist/chunk-EI27JKND.mjs +1988 -0
  8. package/dist/chunk-EI27JKND.mjs.map +1 -0
  9. package/dist/{chunk-77M5AQG3.mjs → chunk-HDMIOOZY.mjs} +3 -33
  10. package/dist/chunk-HDMIOOZY.mjs.map +1 -0
  11. package/dist/{chunk-X3UU7JHT.js → chunk-HJ6MH7J7.js} +3 -33
  12. package/dist/chunk-HJ6MH7J7.js.map +1 -0
  13. package/dist/chunk-KO73EBUT.js +80 -0
  14. package/dist/chunk-KO73EBUT.js.map +1 -0
  15. package/dist/{chunk-C54W2CMK.js → chunk-L47ZOYHL.js} +6 -80
  16. package/dist/chunk-L47ZOYHL.js.map +1 -0
  17. package/dist/{chunk-TVROG2Q4.mjs → chunk-UKT3PLON.mjs} +4 -76
  18. package/dist/chunk-UKT3PLON.mjs.map +1 -0
  19. package/dist/chunk-VVWQTO4Y.mjs +77 -0
  20. package/dist/chunk-VVWQTO4Y.mjs.map +1 -0
  21. package/dist/chunk-XGBE4SUV.js +2093 -0
  22. package/dist/chunk-XGBE4SUV.js.map +1 -0
  23. package/dist/index.d.mts +185 -100
  24. package/dist/index.d.ts +185 -100
  25. package/dist/index.js +119 -118
  26. package/dist/index.js.map +1 -1
  27. package/dist/index.mjs +4 -3
  28. package/dist/index.mjs.map +1 -1
  29. package/dist/mikuFusionGame/index.d.mts +112 -0
  30. package/dist/mikuFusionGame/index.d.ts +112 -0
  31. package/dist/mikuFusionGame/index.js +680 -0
  32. package/dist/mikuFusionGame/index.js.map +1 -0
  33. package/dist/mikuFusionGame/index.mjs +667 -0
  34. package/dist/mikuFusionGame/index.mjs.map +1 -0
  35. package/dist/storage/index.js +13 -12
  36. package/dist/storage/index.mjs +2 -1
  37. package/dist/universalFile/server/index.js +3 -3
  38. package/dist/universalFile/server/index.mjs +2 -2
  39. package/package.json +25 -31
  40. package/dist/AliyunOSSProvider-P6TOVKMM.mjs +0 -6
  41. package/dist/AliyunOSSProvider-Z5BRBCG6.js +0 -15
  42. package/dist/chunk-5A7ERLKK.js +0 -1726
  43. package/dist/chunk-5A7ERLKK.js.map +0 -1
  44. package/dist/chunk-77M5AQG3.mjs.map +0 -1
  45. package/dist/chunk-C54W2CMK.js.map +0 -1
  46. package/dist/chunk-KIP2CERU.mjs +0 -1596
  47. package/dist/chunk-KIP2CERU.mjs.map +0 -1
  48. package/dist/chunk-TVROG2Q4.mjs.map +0 -1
  49. package/dist/chunk-X3UU7JHT.js.map +0 -1
@@ -1,1596 +0,0 @@
1
- import { cn } from './chunk-3NHAT7D4.mjs';
2
- import * as React23 from 'react';
3
- import React23__default, { useRef, useState, useEffect, useCallback } from 'react';
4
- import { Slot } from '@radix-ui/react-slot';
5
- import { cva } from 'class-variance-authority';
6
- import * as LabelPrimitive from '@radix-ui/react-label';
7
- import * as TabsPrimitive from '@radix-ui/react-tabs';
8
- import * as DialogPrimitive from '@radix-ui/react-dialog';
9
- import { X, ChevronRight, Check, Circle, ChevronDown, ChevronUp, RotateCcw, Save, AlertCircle, GripVertical } from 'lucide-react';
10
- import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
11
- import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
12
- import * as PopoverPrimitive from '@radix-ui/react-popover';
13
- import * as ProgressPrimitive from '@radix-ui/react-progress';
14
- import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
15
- import * as SelectPrimitive from '@radix-ui/react-select';
16
- import * as SeparatorPrimitive from '@radix-ui/react-separator';
17
- import * as TooltipPrimitive from '@radix-ui/react-tooltip';
18
- import * as AvatarPrimitive from '@radix-ui/react-avatar';
19
- import { clsx } from 'clsx';
20
- import { useRouter } from 'next/navigation';
21
-
22
- var buttonVariants = cva(
23
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
24
- {
25
- variants: {
26
- variant: {
27
- default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
28
- destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
29
- outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
30
- secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
31
- ghost: "hover:bg-accent hover:text-accent-foreground",
32
- link: "text-primary underline-offset-4 hover:underline"
33
- },
34
- size: {
35
- default: "h-9 px-4 py-2",
36
- sm: "h-8 rounded-md px-3 text-xs",
37
- lg: "h-10 rounded-md px-8",
38
- icon: "h-9 w-9"
39
- }
40
- },
41
- defaultVariants: {
42
- variant: "default",
43
- size: "default"
44
- }
45
- }
46
- );
47
- var Button = React23.forwardRef(
48
- ({ className, variant = "default", size = "default", asChild = false, ...props }, ref) => {
49
- const Comp = asChild ? Slot : "button";
50
- return /* @__PURE__ */ React23.createElement(
51
- Comp,
52
- {
53
- className: cn(buttonVariants({ variant, size, className })),
54
- ref,
55
- ...props
56
- }
57
- );
58
- }
59
- );
60
- Button.displayName = "Button";
61
- var Card = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
62
- "div",
63
- {
64
- ref,
65
- className: cn(
66
- "rounded-xl border bg-card text-card-foreground shadow",
67
- className
68
- ),
69
- ...props
70
- }
71
- ));
72
- Card.displayName = "Card";
73
- var CardHeader = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
74
- "div",
75
- {
76
- ref,
77
- className: cn("flex flex-col space-y-1.5 p-6", className),
78
- ...props
79
- }
80
- ));
81
- CardHeader.displayName = "CardHeader";
82
- var CardTitle = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
83
- "div",
84
- {
85
- ref,
86
- className: cn("font-semibold leading-none tracking-tight", className),
87
- ...props
88
- }
89
- ));
90
- CardTitle.displayName = "CardTitle";
91
- var CardDescription = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
92
- "div",
93
- {
94
- ref,
95
- className: cn("text-sm text-muted-foreground", className),
96
- ...props
97
- }
98
- ));
99
- CardDescription.displayName = "CardDescription";
100
- var CardContent = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement("div", { ref, className: cn("p-6 pt-0", className), ...props }));
101
- CardContent.displayName = "CardContent";
102
- var CardFooter = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
103
- "div",
104
- {
105
- ref,
106
- className: cn("flex items-center p-6 pt-0", className),
107
- ...props
108
- }
109
- ));
110
- CardFooter.displayName = "CardFooter";
111
- var badgeVariants = cva(
112
- "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
113
- {
114
- variants: {
115
- variant: {
116
- default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
117
- secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
118
- destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
119
- outline: "text-foreground"
120
- }
121
- },
122
- defaultVariants: {
123
- variant: "default"
124
- }
125
- }
126
- );
127
- function Badge({ className, variant, ...props }) {
128
- return /* @__PURE__ */ React23.createElement("div", { className: cn(badgeVariants({ variant }), className), ...props });
129
- }
130
- var Input = React23.forwardRef(
131
- ({ className, type, ...props }, ref) => {
132
- return /* @__PURE__ */ React23.createElement(
133
- "input",
134
- {
135
- type,
136
- className: cn(
137
- "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
138
- className
139
- ),
140
- ref,
141
- ...props
142
- }
143
- );
144
- }
145
- );
146
- Input.displayName = "Input";
147
- var labelVariants = cva(
148
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
149
- );
150
- var Label = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
151
- LabelPrimitive.Root,
152
- {
153
- ref,
154
- className: cn(labelVariants(), className),
155
- ...props
156
- }
157
- ));
158
- Label.displayName = LabelPrimitive.Root.displayName;
159
- var Tabs = TabsPrimitive.Root;
160
- var TabsList = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
161
- TabsPrimitive.List,
162
- {
163
- ref,
164
- className: cn(
165
- "inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
166
- className
167
- ),
168
- ...props
169
- }
170
- ));
171
- TabsList.displayName = TabsPrimitive.List.displayName;
172
- var TabsTrigger = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
173
- TabsPrimitive.Trigger,
174
- {
175
- ref,
176
- className: cn(
177
- "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",
178
- className
179
- ),
180
- ...props
181
- }
182
- ));
183
- TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
184
- var TabsContent = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
185
- TabsPrimitive.Content,
186
- {
187
- ref,
188
- className: cn(
189
- "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
190
- className
191
- ),
192
- ...props
193
- }
194
- ));
195
- TabsContent.displayName = TabsPrimitive.Content.displayName;
196
- var Dialog = DialogPrimitive.Root;
197
- var DialogTrigger = DialogPrimitive.Trigger;
198
- var DialogPortal = DialogPrimitive.Portal;
199
- var DialogClose = DialogPrimitive.Close;
200
- var DialogOverlay = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
201
- DialogPrimitive.Overlay,
202
- {
203
- ref,
204
- className: cn(
205
- "fixed inset-0 z-[9999] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
206
- className
207
- ),
208
- ...props
209
- }
210
- ));
211
- DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
212
- var DialogContent = React23.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React23.createElement(DialogPortal, null, /* @__PURE__ */ React23.createElement(DialogOverlay, null), /* @__PURE__ */ React23.createElement(
213
- DialogPrimitive.Content,
214
- {
215
- ref,
216
- className: cn(
217
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
218
- className
219
- ),
220
- ...props
221
- },
222
- children,
223
- /* @__PURE__ */ React23.createElement(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground" }, /* @__PURE__ */ React23.createElement(X, { className: "h-4 w-4" }), /* @__PURE__ */ React23.createElement("span", { className: "sr-only" }, "Close"))
224
- )));
225
- DialogContent.displayName = DialogPrimitive.Content.displayName;
226
- var DialogHeader = ({
227
- className,
228
- ...props
229
- }) => /* @__PURE__ */ React23.createElement(
230
- "div",
231
- {
232
- className: cn(
233
- "flex flex-col space-y-1.5 text-center sm:text-left",
234
- className
235
- ),
236
- ...props
237
- }
238
- );
239
- DialogHeader.displayName = "DialogHeader";
240
- var DialogFooter = ({
241
- className,
242
- ...props
243
- }) => /* @__PURE__ */ React23.createElement(
244
- "div",
245
- {
246
- className: cn(
247
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
248
- className
249
- ),
250
- ...props
251
- }
252
- );
253
- DialogFooter.displayName = "DialogFooter";
254
- var DialogTitle = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
255
- DialogPrimitive.Title,
256
- {
257
- ref,
258
- className: cn(
259
- "text-lg font-semibold leading-none tracking-tight",
260
- className
261
- ),
262
- ...props
263
- }
264
- ));
265
- DialogTitle.displayName = DialogPrimitive.Title.displayName;
266
- var DialogDescription = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
267
- DialogPrimitive.Description,
268
- {
269
- ref,
270
- className: cn("text-sm text-muted-foreground", className),
271
- ...props
272
- }
273
- ));
274
- DialogDescription.displayName = DialogPrimitive.Description.displayName;
275
- var AlertDialog = AlertDialogPrimitive.Root;
276
- var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
277
- var AlertDialogPortal = AlertDialogPrimitive.Portal;
278
- var AlertDialogOverlay = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
279
- AlertDialogPrimitive.Overlay,
280
- {
281
- className: cn(
282
- "fixed inset-0 z-[50] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
283
- className
284
- ),
285
- ...props,
286
- ref
287
- }
288
- ));
289
- AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
290
- var AlertDialogContent = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(AlertDialogPortal, null, /* @__PURE__ */ React23.createElement(AlertDialogOverlay, null), /* @__PURE__ */ React23.createElement(
291
- AlertDialogPrimitive.Content,
292
- {
293
- ref,
294
- className: cn(
295
- "fixed left-[50%] top-[50%] z-[9999] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
296
- className
297
- ),
298
- ...props
299
- }
300
- )));
301
- AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
302
- var AlertDialogHeader = ({
303
- className,
304
- ...props
305
- }) => /* @__PURE__ */ React23.createElement(
306
- "div",
307
- {
308
- className: cn(
309
- "flex flex-col space-y-2 text-center sm:text-left",
310
- className
311
- ),
312
- ...props
313
- }
314
- );
315
- AlertDialogHeader.displayName = "AlertDialogHeader";
316
- var AlertDialogFooter = ({
317
- className,
318
- ...props
319
- }) => /* @__PURE__ */ React23.createElement(
320
- "div",
321
- {
322
- className: cn(
323
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
324
- className
325
- ),
326
- ...props
327
- }
328
- );
329
- AlertDialogFooter.displayName = "AlertDialogFooter";
330
- var AlertDialogTitle = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
331
- AlertDialogPrimitive.Title,
332
- {
333
- ref,
334
- className: cn("text-lg font-semibold", className),
335
- ...props
336
- }
337
- ));
338
- AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
339
- var AlertDialogDescription = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
340
- AlertDialogPrimitive.Description,
341
- {
342
- ref,
343
- className: cn("text-sm text-muted-foreground", className),
344
- ...props
345
- }
346
- ));
347
- AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
348
- var AlertDialogAction = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
349
- AlertDialogPrimitive.Action,
350
- {
351
- ref,
352
- className: cn(buttonVariants(), className),
353
- ...props
354
- }
355
- ));
356
- AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
357
- var AlertDialogCancel = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
358
- AlertDialogPrimitive.Cancel,
359
- {
360
- ref,
361
- className: cn(
362
- buttonVariants({ variant: "outline" }),
363
- "mt-2 sm:mt-0",
364
- className
365
- ),
366
- ...props
367
- }
368
- ));
369
- AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
370
- var DropdownMenu = DropdownMenuPrimitive.Root;
371
- var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
372
- var DropdownMenuGroup = DropdownMenuPrimitive.Group;
373
- var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
374
- var DropdownMenuSub = DropdownMenuPrimitive.Sub;
375
- var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
376
- var DropdownMenuSubTrigger = React23.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ React23.createElement(
377
- DropdownMenuPrimitive.SubTrigger,
378
- {
379
- ref,
380
- className: cn(
381
- "flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
382
- inset && "pl-8",
383
- className
384
- ),
385
- ...props
386
- },
387
- children,
388
- /* @__PURE__ */ React23.createElement(ChevronRight, { className: "ml-auto" })
389
- ));
390
- DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
391
- var DropdownMenuSubContent = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
392
- DropdownMenuPrimitive.SubContent,
393
- {
394
- ref,
395
- className: cn(
396
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",
397
- className
398
- ),
399
- ...props
400
- }
401
- ));
402
- DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
403
- var DropdownMenuContent = React23.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React23.createElement(DropdownMenuPrimitive.Portal, null, /* @__PURE__ */ React23.createElement(
404
- DropdownMenuPrimitive.Content,
405
- {
406
- ref,
407
- sideOffset,
408
- className: cn(
409
- "z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
410
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",
411
- className
412
- ),
413
- ...props
414
- }
415
- )));
416
- DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
417
- var DropdownMenuItem = React23.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ React23.createElement(
418
- DropdownMenuPrimitive.Item,
419
- {
420
- ref,
421
- className: cn(
422
- "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",
423
- inset && "pl-8",
424
- className
425
- ),
426
- ...props
427
- }
428
- ));
429
- DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
430
- var DropdownMenuCheckboxItem = React23.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ React23.createElement(
431
- DropdownMenuPrimitive.CheckboxItem,
432
- {
433
- ref,
434
- className: cn(
435
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
436
- className
437
- ),
438
- checked,
439
- ...props
440
- },
441
- /* @__PURE__ */ React23.createElement("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center" }, /* @__PURE__ */ React23.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React23.createElement(Check, { className: "h-4 w-4" }))),
442
- children
443
- ));
444
- DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
445
- var DropdownMenuRadioItem = React23.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React23.createElement(
446
- DropdownMenuPrimitive.RadioItem,
447
- {
448
- ref,
449
- className: cn(
450
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
451
- className
452
- ),
453
- ...props
454
- },
455
- /* @__PURE__ */ React23.createElement("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center" }, /* @__PURE__ */ React23.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React23.createElement(Circle, { className: "h-2 w-2 fill-current" }))),
456
- children
457
- ));
458
- DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
459
- var DropdownMenuLabel = React23.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ React23.createElement(
460
- DropdownMenuPrimitive.Label,
461
- {
462
- ref,
463
- className: cn(
464
- "px-2 py-1.5 text-sm font-semibold",
465
- inset && "pl-8",
466
- className
467
- ),
468
- ...props
469
- }
470
- ));
471
- DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
472
- var DropdownMenuSeparator = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
473
- DropdownMenuPrimitive.Separator,
474
- {
475
- ref,
476
- className: cn("-mx-1 my-1 h-px bg-muted", className),
477
- ...props
478
- }
479
- ));
480
- DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
481
- var DropdownMenuShortcut = ({
482
- className,
483
- ...props
484
- }) => {
485
- return /* @__PURE__ */ React23.createElement(
486
- "span",
487
- {
488
- className: cn("ml-auto text-xs tracking-widest opacity-60", className),
489
- ...props
490
- }
491
- );
492
- };
493
- DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
494
- var Popover = PopoverPrimitive.Root;
495
- var PopoverTrigger = PopoverPrimitive.Trigger;
496
- var PopoverAnchor = PopoverPrimitive.Anchor;
497
- var PopoverContent = React23.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React23.createElement(PopoverPrimitive.Portal, null, /* @__PURE__ */ React23.createElement(
498
- PopoverPrimitive.Content,
499
- {
500
- ref,
501
- align,
502
- sideOffset,
503
- className: cn(
504
- "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",
505
- className
506
- ),
507
- ...props
508
- }
509
- )));
510
- PopoverContent.displayName = PopoverPrimitive.Content.displayName;
511
- var Progress = React23.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ React23.createElement(
512
- ProgressPrimitive.Root,
513
- {
514
- ref,
515
- className: cn(
516
- "relative h-2 w-full overflow-hidden rounded-full bg-primary/20",
517
- className
518
- ),
519
- ...props
520
- },
521
- /* @__PURE__ */ React23.createElement(
522
- ProgressPrimitive.Indicator,
523
- {
524
- className: "h-full w-full flex-1 bg-primary transition-all",
525
- style: { transform: "translateX(-" + (100 - (value || 0)) + "%)" }
526
- }
527
- )
528
- ));
529
- Progress.displayName = ProgressPrimitive.Root.displayName;
530
- var ScrollArea = React23.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React23.createElement(
531
- ScrollAreaPrimitive.Root,
532
- {
533
- ref,
534
- className: cn("relative overflow-hidden", className),
535
- ...props
536
- },
537
- /* @__PURE__ */ React23.createElement(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]" }, children),
538
- /* @__PURE__ */ React23.createElement(ScrollBar, null),
539
- /* @__PURE__ */ React23.createElement(ScrollAreaPrimitive.Corner, null)
540
- ));
541
- ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
542
- var ScrollBar = React23.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ React23.createElement(
543
- ScrollAreaPrimitive.ScrollAreaScrollbar,
544
- {
545
- ref,
546
- orientation,
547
- className: cn(
548
- "flex touch-none select-none transition-colors",
549
- orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
550
- orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
551
- className
552
- ),
553
- ...props
554
- },
555
- /* @__PURE__ */ React23.createElement(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
556
- ));
557
- ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
558
- var Select = SelectPrimitive.Root;
559
- var SelectGroup = SelectPrimitive.Group;
560
- var SelectValue = SelectPrimitive.Value;
561
- var SelectTrigger = React23.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React23.createElement(
562
- SelectPrimitive.Trigger,
563
- {
564
- ref,
565
- className: cn(
566
- "flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
567
- className
568
- ),
569
- ...props
570
- },
571
- children,
572
- /* @__PURE__ */ React23.createElement(SelectPrimitive.Icon, { asChild: true }, /* @__PURE__ */ React23.createElement(ChevronDown, { className: "h-4 w-4 opacity-50" }))
573
- ));
574
- SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
575
- var SelectScrollUpButton = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
576
- SelectPrimitive.ScrollUpButton,
577
- {
578
- ref,
579
- className: cn(
580
- "flex cursor-default items-center justify-center py-1",
581
- className
582
- ),
583
- ...props
584
- },
585
- /* @__PURE__ */ React23.createElement(ChevronUp, { className: "h-4 w-4" })
586
- ));
587
- SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
588
- var SelectScrollDownButton = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
589
- SelectPrimitive.ScrollDownButton,
590
- {
591
- ref,
592
- className: cn(
593
- "flex cursor-default items-center justify-center py-1",
594
- className
595
- ),
596
- ...props
597
- },
598
- /* @__PURE__ */ React23.createElement(ChevronDown, { className: "h-4 w-4" })
599
- ));
600
- SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
601
- var SelectContent = React23.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ React23.createElement(SelectPrimitive.Portal, null, /* @__PURE__ */ React23.createElement(
602
- SelectPrimitive.Content,
603
- {
604
- ref,
605
- className: cn(
606
- "relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",
607
- position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
608
- className
609
- ),
610
- position,
611
- ...props
612
- },
613
- /* @__PURE__ */ React23.createElement(SelectScrollUpButton, null),
614
- /* @__PURE__ */ React23.createElement(
615
- SelectPrimitive.Viewport,
616
- {
617
- className: cn(
618
- "p-1",
619
- position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
620
- )
621
- },
622
- children
623
- ),
624
- /* @__PURE__ */ React23.createElement(SelectScrollDownButton, null)
625
- )));
626
- SelectContent.displayName = SelectPrimitive.Content.displayName;
627
- var SelectLabel = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
628
- SelectPrimitive.Label,
629
- {
630
- ref,
631
- className: cn("px-2 py-1.5 text-sm font-semibold", className),
632
- ...props
633
- }
634
- ));
635
- SelectLabel.displayName = SelectPrimitive.Label.displayName;
636
- var SelectItem = React23.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React23.createElement(
637
- SelectPrimitive.Item,
638
- {
639
- ref,
640
- className: cn(
641
- "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
642
- className
643
- ),
644
- ...props
645
- },
646
- /* @__PURE__ */ React23.createElement("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center" }, /* @__PURE__ */ React23.createElement(SelectPrimitive.ItemIndicator, null, /* @__PURE__ */ React23.createElement(Check, { className: "h-4 w-4" }))),
647
- /* @__PURE__ */ React23.createElement(SelectPrimitive.ItemText, null, children)
648
- ));
649
- SelectItem.displayName = SelectPrimitive.Item.displayName;
650
- var SelectSeparator = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
651
- SelectPrimitive.Separator,
652
- {
653
- ref,
654
- className: cn("-mx-1 my-1 h-px bg-muted", className),
655
- ...props
656
- }
657
- ));
658
- SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
659
- var Separator3 = React23.forwardRef(
660
- ({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ React23.createElement(
661
- SeparatorPrimitive.Root,
662
- {
663
- ref,
664
- decorative,
665
- orientation,
666
- className: cn(
667
- "shrink-0 bg-border",
668
- orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
669
- className
670
- ),
671
- ...props
672
- }
673
- )
674
- );
675
- Separator3.displayName = SeparatorPrimitive.Root.displayName;
676
- var Sheet = DialogPrimitive.Root;
677
- var SheetTrigger = DialogPrimitive.Trigger;
678
- var SheetClose = DialogPrimitive.Close;
679
- var SheetPortal = DialogPrimitive.Portal;
680
- var SheetOverlay = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
681
- DialogPrimitive.Overlay,
682
- {
683
- className: cn(
684
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
685
- className
686
- ),
687
- ...props,
688
- ref
689
- }
690
- ));
691
- SheetOverlay.displayName = DialogPrimitive.Overlay.displayName;
692
- var sheetVariants = cva(
693
- "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",
694
- {
695
- variants: {
696
- side: {
697
- top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
698
- bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
699
- left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
700
- right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
701
- }
702
- },
703
- defaultVariants: {
704
- side: "right"
705
- }
706
- }
707
- );
708
- var SheetContent = React23.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ React23.createElement(SheetPortal, null, /* @__PURE__ */ React23.createElement(SheetOverlay, null), /* @__PURE__ */ React23.createElement(
709
- DialogPrimitive.Content,
710
- {
711
- ref,
712
- className: cn(sheetVariants({ side }), className),
713
- ...props
714
- },
715
- /* @__PURE__ */ React23.createElement(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary" }, /* @__PURE__ */ React23.createElement(X, { className: "h-4 w-4" }), /* @__PURE__ */ React23.createElement("span", { className: "sr-only" }, "Close")),
716
- children
717
- )));
718
- SheetContent.displayName = DialogPrimitive.Content.displayName;
719
- var SheetHeader = ({
720
- className,
721
- ...props
722
- }) => /* @__PURE__ */ React23.createElement(
723
- "div",
724
- {
725
- className: cn(
726
- "flex flex-col space-y-2 text-center sm:text-left",
727
- className
728
- ),
729
- ...props
730
- }
731
- );
732
- SheetHeader.displayName = "SheetHeader";
733
- var SheetFooter = ({
734
- className,
735
- ...props
736
- }) => /* @__PURE__ */ React23.createElement(
737
- "div",
738
- {
739
- className: cn(
740
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
741
- className
742
- ),
743
- ...props
744
- }
745
- );
746
- SheetFooter.displayName = "SheetFooter";
747
- var SheetTitle = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
748
- DialogPrimitive.Title,
749
- {
750
- ref,
751
- className: cn("text-lg font-semibold text-foreground", className),
752
- ...props
753
- }
754
- ));
755
- SheetTitle.displayName = DialogPrimitive.Title.displayName;
756
- var SheetDescription = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
757
- DialogPrimitive.Description,
758
- {
759
- ref,
760
- className: cn("text-sm text-muted-foreground", className),
761
- ...props
762
- }
763
- ));
764
- SheetDescription.displayName = DialogPrimitive.Description.displayName;
765
- var Textarea = React23.forwardRef(({ className, ...props }, ref) => {
766
- return /* @__PURE__ */ React23.createElement(
767
- "textarea",
768
- {
769
- className: cn(
770
- "flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
771
- className
772
- ),
773
- ref,
774
- ...props
775
- }
776
- );
777
- });
778
- Textarea.displayName = "Textarea";
779
- var TooltipProvider = TooltipPrimitive.Provider;
780
- var Tooltip = TooltipPrimitive.Root;
781
- var TooltipTrigger = TooltipPrimitive.Trigger;
782
- var TooltipContent = React23.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React23.createElement(TooltipPrimitive.Portal, null, /* @__PURE__ */ React23.createElement(
783
- TooltipPrimitive.Content,
784
- {
785
- ref,
786
- sideOffset,
787
- className: cn(
788
- "z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",
789
- className
790
- ),
791
- ...props
792
- }
793
- )));
794
- TooltipContent.displayName = TooltipPrimitive.Content.displayName;
795
- var Avatar = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
796
- AvatarPrimitive.Root,
797
- {
798
- ref,
799
- className: cn(
800
- "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
801
- className
802
- ),
803
- ...props
804
- }
805
- ));
806
- Avatar.displayName = AvatarPrimitive.Root.displayName;
807
- var AvatarImage = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
808
- AvatarPrimitive.Image,
809
- {
810
- ref,
811
- className: cn("aspect-square h-full w-full", className),
812
- ...props
813
- }
814
- ));
815
- AvatarImage.displayName = AvatarPrimitive.Image.displayName;
816
- var AvatarFallback = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(
817
- AvatarPrimitive.Fallback,
818
- {
819
- ref,
820
- className: cn(
821
- "flex h-full w-full items-center justify-center rounded-full bg-muted",
822
- className
823
- ),
824
- ...props
825
- }
826
- ));
827
- AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
828
- function buildGridColsClasses(columns) {
829
- return [
830
- "grid-cols-1",
831
- // 默认单列
832
- columns.sm ? "sm:grid-cols-" + columns.sm : "",
833
- columns.md ? "md:grid-cols-" + columns.md : "md:grid-cols-2",
834
- columns.lg ? "lg:grid-cols-" + columns.lg : "lg:grid-cols-3",
835
- columns.xl ? "xl:grid-cols-" + columns.xl : ""
836
- ].filter(Boolean).join(" ");
837
- }
838
- function getGapClassName(gap) {
839
- const gapClasses = {
840
- sm: "gap-3",
841
- md: "gap-6",
842
- lg: "gap-8",
843
- xl: "gap-10"
844
- };
845
- return gapClasses[gap];
846
- }
847
- function Grid({
848
- items,
849
- renderItem,
850
- columns = { md: 2, lg: 3 },
851
- gap = "md",
852
- className = "",
853
- style
854
- }) {
855
- const gridColsClasses = buildGridColsClasses(columns);
856
- const gapClass = getGapClassName(gap);
857
- return /* @__PURE__ */ React23__default.createElement(
858
- "div",
859
- {
860
- className: clsx("grid", gridColsClasses, gapClass, className),
861
- style
862
- },
863
- items.map((item, index) => /* @__PURE__ */ React23__default.createElement("div", { key: item.id }, renderItem(item, index)))
864
- );
865
- }
866
- var SearchBox = ({
867
- searchQuery,
868
- onSearchChange,
869
- placeholder = "\u641C\u7D22\u5B9E\u9A8C\u9879\u76EE\u7684\u6807\u9898\u3001\u63CF\u8FF0\u6216\u6807\u7B7E...",
870
- size = "large"
871
- }) => {
872
- const getSizeStyles = () => {
873
- switch (size) {
874
- case "small":
875
- return {
876
- container: "h-10",
877
- input: "pl-10 pr-10 text-sm",
878
- icon: "w-4 h-4",
879
- iconPosition: "left-3",
880
- clearButton: "right-2 w-6 h-6",
881
- clearIcon: "w-3 h-3"
882
- };
883
- case "medium":
884
- return {
885
- container: "h-12",
886
- input: "pl-12 pr-12 text-base",
887
- icon: "w-5 h-5",
888
- iconPosition: "left-3",
889
- clearButton: "right-3 w-7 h-7",
890
- clearIcon: "w-4 h-4"
891
- };
892
- case "large":
893
- default:
894
- return {
895
- container: "h-16",
896
- input: "pl-6 pr-16 text-lg",
897
- icon: "w-6 h-6",
898
- iconPosition: "left-6",
899
- clearButton: "right-4 w-8 h-8",
900
- clearIcon: "w-4 h-4"
901
- };
902
- }
903
- };
904
- const styles = getSizeStyles();
905
- const isLarge = size === "large";
906
- return /* @__PURE__ */ React23__default.createElement("div", { className: "relative group w-full" }, /* @__PURE__ */ React23__default.createElement(
907
- "input",
908
- {
909
- type: "text",
910
- placeholder,
911
- value: searchQuery,
912
- onChange: (e) => onSearchChange(e.target.value),
913
- className: clsx(
914
- "w-full",
915
- styles.container,
916
- styles.input,
917
- isLarge ? "border-2 border-gray-200 rounded-2xl shadow-lg" : "border border-gray-300 rounded-lg shadow-sm",
918
- "bg-white focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 hover:border-gray-400",
919
- isLarge ? "hover:shadow-xl" : "hover:shadow-md",
920
- "transition-all duration-300 ease-out text-gray-800 placeholder-gray-500",
921
- isLarge ? "font-medium" : "font-normal"
922
- )
923
- }
924
- ), searchQuery && /* @__PURE__ */ React23__default.createElement(
925
- "button",
926
- {
927
- onClick: () => onSearchChange(""),
928
- className: clsx(
929
- "absolute top-1/2",
930
- styles.clearButton,
931
- "transform -translate-y-1/2 z-10 group/clear"
932
- )
933
- },
934
- /* @__PURE__ */ React23__default.createElement("div", { className: clsx(
935
- styles.clearButton,
936
- "flex items-center justify-center rounded-full bg-gray-100 hover:bg-gray-200 transition-all duration-200 group-hover/clear:scale-105"
937
- ) }, /* @__PURE__ */ React23__default.createElement(
938
- "svg",
939
- {
940
- className: clsx(styles.clearIcon, "text-gray-500 group-hover/clear:text-gray-700"),
941
- fill: "none",
942
- stroke: "currentColor",
943
- viewBox: "0 0 24 24"
944
- },
945
- /* @__PURE__ */ React23__default.createElement(
946
- "path",
947
- {
948
- strokeLinecap: "round",
949
- strokeLinejoin: "round",
950
- strokeWidth: 2,
951
- d: "M6 18L18 6M6 6l12 12"
952
- }
953
- )
954
- ))
955
- ));
956
- };
957
- var Timeline = ({ items = [] }) => {
958
- if (!items || items.length === 0) {
959
- return null;
960
- }
961
- return /* @__PURE__ */ React23__default.createElement("div", { className: "relative" }, /* @__PURE__ */ React23__default.createElement("div", { className: "absolute left-4 top-0 bottom-0 w-0.5 bg-gray-200" }), items.map((item, index) => /* @__PURE__ */ React23__default.createElement("div", { key: index, className: "relative pl-12 pb-8" }, /* @__PURE__ */ React23__default.createElement("div", { className: "absolute left-0 w-8 h-8 rounded-full bg-blue-500 border-4 border-white shadow-md flex items-center justify-center" }, /* @__PURE__ */ React23__default.createElement("div", { className: "w-2 h-2 rounded-full bg-white" })), /* @__PURE__ */ React23__default.createElement("div", { className: "bg-white rounded-lg p-4 shadow-md" }, /* @__PURE__ */ React23__default.createElement("div", { className: "text-sm text-gray-500 mb-2" }, item.date), /* @__PURE__ */ React23__default.createElement("h4", { className: "text-lg font-semibold mb-2" }, item.title), /* @__PURE__ */ React23__default.createElement("p", { className: "text-gray-600" }, item.description)))));
962
- };
963
- var CollisionBalls = ({
964
- collisionBallsConfig: {
965
- balls,
966
- width,
967
- height
968
- }
969
- }) => {
970
- const canvasRef = useRef(null);
971
- const containerRef = useRef(null);
972
- const ballsRef = useRef([]);
973
- const [isShaking, setIsShaking] = useState(false);
974
- const [draggedBall, setDraggedBall] = useState(null);
975
- const [mousePos, setMousePos] = useState({ x: 0, y: 0 });
976
- const animationRef = useRef(null);
977
- const updateCanvasSize = () => {
978
- const container = containerRef.current;
979
- const canvas = canvasRef.current;
980
- if (!container || !canvas) {
981
- console.error("Container or canvas not found");
982
- return;
983
- }
984
- const containerWidth = container.clientWidth;
985
- const containerHeight = container.clientHeight;
986
- console.log("Container size:", { containerWidth, containerHeight });
987
- canvas.width = containerWidth;
988
- canvas.height = containerHeight;
989
- canvas.style.width = containerWidth + "px";
990
- canvas.style.height = containerHeight + "px";
991
- console.log("Canvas size updated:", {
992
- width: canvas.width,
993
- height: canvas.height,
994
- containerWidth,
995
- containerHeight
996
- });
997
- };
998
- const initBalls = () => {
999
- const canvas = canvasRef.current;
1000
- if (!canvas) {
1001
- console.error("Canvas not found during ball initialization");
1002
- return [];
1003
- }
1004
- console.log("Initializing balls with canvas size:", {
1005
- width: canvas.width,
1006
- height: canvas.height
1007
- });
1008
- return balls.map((ballConfig) => ({
1009
- x: Math.random() * (canvas.width - 100) + 50,
1010
- y: Math.random() * (canvas.height - 100) + 50,
1011
- vx: (Math.random() - 0.5) * 4,
1012
- vy: (Math.random() - 0.5) * 4,
1013
- radius: ballConfig.size,
1014
- color: ballConfig.color,
1015
- text: ballConfig.label,
1016
- isDragging: false
1017
- }));
1018
- };
1019
- useEffect(() => {
1020
- const handleResize = () => {
1021
- console.log("Window resized");
1022
- updateCanvasSize();
1023
- };
1024
- if (typeof window !== "undefined") {
1025
- window.addEventListener("resize", handleResize);
1026
- updateCanvasSize();
1027
- }
1028
- return () => {
1029
- if (typeof window !== "undefined") {
1030
- window.removeEventListener("resize", handleResize);
1031
- }
1032
- };
1033
- }, []);
1034
- useEffect(() => {
1035
- const canvas = canvasRef.current;
1036
- if (!canvas) {
1037
- console.error("Canvas element not found");
1038
- return;
1039
- }
1040
- const ctx = canvas.getContext("2d");
1041
- if (!ctx) {
1042
- console.error("Failed to get canvas context");
1043
- return;
1044
- }
1045
- console.log("Starting animation setup...");
1046
- updateCanvasSize();
1047
- ballsRef.current = initBalls();
1048
- console.log("Balls initialized:", ballsRef.current);
1049
- let lastTime = performance.now();
1050
- let frameCount = 0;
1051
- const animate = (currentTime) => {
1052
- try {
1053
- frameCount++;
1054
- if (currentTime - lastTime >= 1e3) {
1055
- console.log("FPS: " + frameCount);
1056
- frameCount = 0;
1057
- lastTime = currentTime;
1058
- }
1059
- ctx.clearRect(0, 0, canvas.width, canvas.height);
1060
- ballsRef.current.forEach((ball) => {
1061
- if (!ball.isDragging) {
1062
- updatePosition(ball, canvas.width, canvas.height);
1063
- }
1064
- for (let i = 0; i < ballsRef.current.length; i++) {
1065
- for (let j = i + 1; j < ballsRef.current.length; j++) {
1066
- const ball1 = ballsRef.current[i];
1067
- const ball2 = ballsRef.current[j];
1068
- if (ball1 && ball2) {
1069
- checkCollision(ball1, ball2);
1070
- }
1071
- }
1072
- }
1073
- draw(ctx, ball);
1074
- });
1075
- animationRef.current = requestAnimationFrame(animate);
1076
- } catch (error) {
1077
- console.error("Animation error:", error);
1078
- }
1079
- };
1080
- console.log("Starting animation loop...");
1081
- animationRef.current = requestAnimationFrame(animate);
1082
- return () => {
1083
- console.log("Cleaning up animation...");
1084
- if (animationRef.current) {
1085
- cancelAnimationFrame(animationRef.current);
1086
- animationRef.current = null;
1087
- }
1088
- };
1089
- }, []);
1090
- const shake = () => {
1091
- setIsShaking(true);
1092
- ballsRef.current.forEach((ball) => {
1093
- ball.vx = (Math.random() - 0.5) * 10;
1094
- ball.vy = (Math.random() - 0.5) * 10;
1095
- });
1096
- setTimeout(() => setIsShaking(false), 200);
1097
- };
1098
- const slowdown = () => {
1099
- setIsShaking(true);
1100
- ballsRef.current.forEach((ball) => {
1101
- ball.vx = ball.vx * 0.5;
1102
- ball.vy = ball.vy * 0.5;
1103
- });
1104
- setTimeout(() => setIsShaking(false), 200);
1105
- };
1106
- const checkCollision = (ball1, ball2) => {
1107
- const dx = ball2.x - ball1.x;
1108
- const dy = ball2.y - ball1.y;
1109
- const distance = Math.sqrt(dx * dx + dy * dy);
1110
- if (distance < ball1.radius + ball2.radius) {
1111
- const angle = Math.atan2(dy, dx);
1112
- const overlap = (ball1.radius + ball2.radius - distance) / 2;
1113
- if (ball1.isDragging || ball2.isDragging) {
1114
- const draggedBall2 = ball1.isDragging ? ball1 : ball2;
1115
- const otherBall = ball1.isDragging ? ball2 : ball1;
1116
- otherBall.x += (draggedBall2 === ball1 ? 1 : -1) * overlap * Math.cos(angle);
1117
- otherBall.y += (draggedBall2 === ball1 ? 1 : -1) * overlap * Math.sin(angle);
1118
- const pushForce = 2;
1119
- otherBall.vx = (draggedBall2 === ball1 ? -1 : 1) * Math.cos(angle) * pushForce;
1120
- otherBall.vy = (draggedBall2 === ball1 ? -1 : 1) * Math.sin(angle) * pushForce;
1121
- return;
1122
- }
1123
- const sin = Math.sin(angle);
1124
- const cos = Math.cos(angle);
1125
- const vx1 = ball1.vx * cos + ball1.vy * sin;
1126
- const vy1 = ball1.vy * cos - ball1.vx * sin;
1127
- const vx2 = ball2.vx * cos + ball2.vy * sin;
1128
- const vy2 = ball2.vy * cos - ball2.vx * sin;
1129
- const newVx1 = vx2;
1130
- const newVx2 = vx1;
1131
- ball1.vx = newVx1 * cos - vy1 * sin;
1132
- ball1.vy = vy1 * cos + newVx1 * sin;
1133
- ball2.vx = newVx2 * cos - vy2 * sin;
1134
- ball2.vy = vy2 * cos + newVx2 * sin;
1135
- ball1.x -= overlap * Math.cos(angle);
1136
- ball1.y -= overlap * Math.sin(angle);
1137
- ball2.x += overlap * Math.cos(angle);
1138
- ball2.y += overlap * Math.sin(angle);
1139
- }
1140
- };
1141
- const updatePosition = (ball, width2, height2) => {
1142
- const handleBoundaryCollision = (velocity, position, boundary, radius) => {
1143
- let newVelocity = velocity;
1144
- let newPosition = position;
1145
- if (position - radius < 0) {
1146
- newPosition = radius;
1147
- newVelocity = Math.abs(velocity);
1148
- } else if (position + radius > boundary) {
1149
- newPosition = boundary - radius;
1150
- newVelocity = -Math.abs(velocity);
1151
- }
1152
- return [newVelocity, newPosition];
1153
- };
1154
- const [newVx, newX] = handleBoundaryCollision(
1155
- ball.vx,
1156
- ball.x,
1157
- width2,
1158
- ball.radius
1159
- );
1160
- const [newVy, newY] = handleBoundaryCollision(
1161
- ball.vy,
1162
- ball.y,
1163
- height2,
1164
- ball.radius
1165
- );
1166
- ball.vx = newVx;
1167
- ball.vy = newVy;
1168
- ball.x = newX;
1169
- ball.y = newY;
1170
- };
1171
- const draw = (ctx, ball) => {
1172
- ctx.beginPath();
1173
- ctx.arc(ball.x, ball.y, ball.radius, 0, Math.PI * 2);
1174
- ctx.fillStyle = ball.color;
1175
- ctx.fill();
1176
- ctx.closePath();
1177
- if (ball.text) {
1178
- ctx.font = "14px Arial";
1179
- ctx.fillStyle = "#fff";
1180
- ctx.textAlign = "center";
1181
- ctx.textBaseline = "middle";
1182
- ctx.fillText(ball.text, ball.x, ball.y);
1183
- }
1184
- };
1185
- const handleMouseDown = (event) => {
1186
- const mousePos2 = getMousePos(event);
1187
- const ball = ballsRef.current.find((b) => {
1188
- const dx = b.x - mousePos2.x;
1189
- const dy = b.y - mousePos2.y;
1190
- return Math.sqrt(dx * dx + dy * dy) < b.radius;
1191
- });
1192
- if (ball) {
1193
- ball.isDragging = true;
1194
- setDraggedBall(ball);
1195
- }
1196
- };
1197
- const handleMouseMove = (event) => {
1198
- const mousePos2 = getMousePos(event);
1199
- setMousePos(mousePos2);
1200
- if (draggedBall) {
1201
- draggedBall.x = mousePos2.x;
1202
- draggedBall.y = mousePos2.y;
1203
- draggedBall.vx = 0;
1204
- draggedBall.vy = 0;
1205
- }
1206
- };
1207
- const handleMouseUp = () => {
1208
- if (draggedBall) {
1209
- draggedBall.isDragging = false;
1210
- setDraggedBall(null);
1211
- }
1212
- };
1213
- const getMousePos = (event) => {
1214
- const canvas = canvasRef.current;
1215
- if (!canvas) return { x: 0, y: 0 };
1216
- const rect = canvas.getBoundingClientRect();
1217
- const scaleX = canvas.width / rect.width;
1218
- const scaleY = canvas.height / rect.height;
1219
- return {
1220
- x: (event.clientX - rect.left) * scaleX,
1221
- y: (event.clientY - rect.top) * scaleY
1222
- };
1223
- };
1224
- return /* @__PURE__ */ React23__default.createElement("div", { style: { width: "100%", height: "100%", position: "relative", backgroundColor: "#f9fafb", borderRadius: "0.5rem" } }, /* @__PURE__ */ React23__default.createElement("div", { ref: containerRef, style: { width: "100%", height: "100%", position: "absolute", top: 0, left: 0 } }, /* @__PURE__ */ React23__default.createElement(
1225
- "canvas",
1226
- {
1227
- ref: canvasRef,
1228
- style: {
1229
- width: "100%",
1230
- height: "100%",
1231
- display: "block"
1232
- // 确保canvas正确显示
1233
- },
1234
- onMouseDown: handleMouseDown,
1235
- onMouseMove: handleMouseMove,
1236
- onMouseUp: handleMouseUp,
1237
- onMouseLeave: handleMouseUp
1238
- }
1239
- )), /* @__PURE__ */ React23__default.createElement("div", { className: "absolute bottom-4 right-4 flex gap-2" }, /* @__PURE__ */ React23__default.createElement(
1240
- "button",
1241
- {
1242
- onClick: shake,
1243
- className: clsx("px-4 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 transition-colors", isShaking ? "animate-pulse" : "")
1244
- },
1245
- "\u6447\u4E00\u6447"
1246
- ), /* @__PURE__ */ React23__default.createElement(
1247
- "button",
1248
- {
1249
- onClick: slowdown,
1250
- className: clsx("px-4 py-2 bg-green-500 text-white rounded-lg hover:bg-green-600 transition-colors", isShaking ? "animate-pulse" : "")
1251
- },
1252
- "\u51CF\u901F"
1253
- )));
1254
- };
1255
- function GenericOrderManager({
1256
- operations,
1257
- renderItem,
1258
- className = "",
1259
- title = "\u987A\u5E8F\u7BA1\u7406",
1260
- description = "\u62D6\u62FD\u6216\u4F7F\u7528\u6309\u94AE\u8C03\u6574\u663E\u793A\u987A\u5E8F",
1261
- onOrderChanged,
1262
- emptyMessage = "\u6682\u65E0\u6570\u636E",
1263
- loadingMessage = "\u52A0\u8F7D\u6570\u636E..."
1264
- }) {
1265
- const [items, setItems] = useState([]);
1266
- const [originalOrder, setOriginalOrder] = useState([]);
1267
- const [loading, setLoading] = useState(true);
1268
- const [saving, setSaving] = useState(false);
1269
- const [error, setError] = useState(null);
1270
- const [hasChanges, setHasChanges] = useState(false);
1271
- const [draggedItem, setDraggedItem] = useState(null);
1272
- const loadItems = useCallback(async () => {
1273
- try {
1274
- setLoading(true);
1275
- setError(null);
1276
- const data = await operations.loadItems();
1277
- setItems(data);
1278
- setOriginalOrder([...data]);
1279
- setHasChanges(false);
1280
- } catch (err) {
1281
- console.error("\u274C [\u901A\u7528\u6392\u5E8F] \u52A0\u8F7D\u6570\u636E\u9519\u8BEF:", err);
1282
- setError(err instanceof Error ? err.message : "\u52A0\u8F7D\u6570\u636E\u5931\u8D25");
1283
- } finally {
1284
- setLoading(false);
1285
- }
1286
- }, [operations]);
1287
- useEffect(() => {
1288
- loadItems();
1289
- }, [loadItems]);
1290
- useEffect(() => {
1291
- const hasOrderChanged = items.some(
1292
- (item, index) => originalOrder[index]?.id !== item.id
1293
- );
1294
- setHasChanges(hasOrderChanged);
1295
- }, [items, originalOrder]);
1296
- const handleMoveUp = async (itemId) => {
1297
- try {
1298
- setError(null);
1299
- const currentIndex = items.findIndex((item) => item.id === itemId);
1300
- if (currentIndex === -1) {
1301
- setError("\u9879\u76EE\u4E0D\u5B58\u5728");
1302
- return;
1303
- }
1304
- if (currentIndex === 0) {
1305
- setError("\u9879\u76EE\u5DF2\u7ECF\u5728\u6700\u524D\u9762\uFF0C\u65E0\u6CD5\u4E0A\u79FB");
1306
- return;
1307
- }
1308
- await operations.moveItemUp(itemId);
1309
- await loadItems();
1310
- onOrderChanged?.();
1311
- } catch (err) {
1312
- console.error("\u274C [\u901A\u7528\u6392\u5E8F] \u4E0A\u79FB\u9879\u76EE\u9519\u8BEF:", err);
1313
- setError(err instanceof Error ? err.message : "\u4E0A\u79FB\u5931\u8D25");
1314
- }
1315
- };
1316
- const handleMoveDown = async (itemId) => {
1317
- try {
1318
- setError(null);
1319
- const currentIndex = items.findIndex((item) => item.id === itemId);
1320
- if (currentIndex === -1) {
1321
- setError("\u9879\u76EE\u4E0D\u5B58\u5728");
1322
- return;
1323
- }
1324
- if (currentIndex === items.length - 1) {
1325
- setError("\u9879\u76EE\u5DF2\u7ECF\u5728\u6700\u540E\u9762\uFF0C\u65E0\u6CD5\u4E0B\u79FB");
1326
- return;
1327
- }
1328
- await operations.moveItemDown(itemId);
1329
- await loadItems();
1330
- onOrderChanged?.();
1331
- } catch (err) {
1332
- console.error("\u274C [\u901A\u7528\u6392\u5E8F] \u4E0B\u79FB\u9879\u76EE\u9519\u8BEF:", err);
1333
- setError(err instanceof Error ? err.message : "\u4E0B\u79FB\u5931\u8D25");
1334
- }
1335
- };
1336
- const handleDragStart = (e, index) => {
1337
- setDraggedItem(index);
1338
- e.dataTransfer.effectAllowed = "move";
1339
- };
1340
- const handleDragOver = (e, _index) => {
1341
- e.preventDefault();
1342
- e.dataTransfer.dropEffect = "move";
1343
- };
1344
- const handleDrop = async (e, dropIndex) => {
1345
- e.preventDefault();
1346
- if (draggedItem === null || draggedItem === dropIndex) {
1347
- setDraggedItem(null);
1348
- return;
1349
- }
1350
- try {
1351
- setError(null);
1352
- const newItems = [...items];
1353
- const draggedItemData = newItems[draggedItem];
1354
- if (!draggedItemData) return;
1355
- newItems.splice(draggedItem, 1);
1356
- newItems.splice(dropIndex, 0, draggedItemData);
1357
- const itemOrders = newItems.map((item, index) => ({
1358
- id: item.id,
1359
- order: index
1360
- }));
1361
- await operations.updateItemOrder(itemOrders);
1362
- await loadItems();
1363
- onOrderChanged?.();
1364
- } catch (err) {
1365
- console.error("\u274C [\u901A\u7528\u6392\u5E8F] \u62D6\u62FD\u6392\u5E8F\u9519\u8BEF:", err);
1366
- setError(err instanceof Error ? err.message : "\u6392\u5E8F\u5931\u8D25");
1367
- } finally {
1368
- setDraggedItem(null);
1369
- }
1370
- };
1371
- const handleSaveOrder = async () => {
1372
- try {
1373
- setSaving(true);
1374
- setError(null);
1375
- const itemOrders = items.map((item, index) => ({
1376
- id: item.id,
1377
- order: index
1378
- }));
1379
- await operations.updateItemOrder(itemOrders);
1380
- setOriginalOrder([...items]);
1381
- setHasChanges(false);
1382
- onOrderChanged?.();
1383
- } catch (err) {
1384
- console.error("\u274C [\u901A\u7528\u6392\u5E8F] \u4FDD\u5B58\u987A\u5E8F\u9519\u8BEF:", err);
1385
- setError(err instanceof Error ? err.message : "\u4FDD\u5B58\u5931\u8D25");
1386
- await loadItems();
1387
- } finally {
1388
- setSaving(false);
1389
- }
1390
- };
1391
- const handleResetOrder = () => {
1392
- setItems([...originalOrder]);
1393
- };
1394
- if (loading) {
1395
- return /* @__PURE__ */ React23__default.createElement("div", { className: cn("flex flex-col items-center justify-center p-12 text-gray-500", className) }, /* @__PURE__ */ React23__default.createElement("div", { className: "w-6 h-6 border-2 border-gray-200 border-t-blue-500 rounded-full animate-spin mb-2" }), /* @__PURE__ */ React23__default.createElement("span", null, loadingMessage));
1396
- }
1397
- return /* @__PURE__ */ React23__default.createElement("div", { className: cn("bg-white rounded-xl p-6 shadow-md border-2 border-gray-100", className) }, /* @__PURE__ */ React23__default.createElement("div", { className: "flex items-center justify-between mb-4 pb-3 border-b border-gray-100 sm:flex-row flex-col sm:items-center items-start gap-4" }, /* @__PURE__ */ React23__default.createElement("h3", { className: "m-0 text-gray-900 text-lg font-semibold" }, title), /* @__PURE__ */ React23__default.createElement("div", { className: "flex gap-3 w-full sm:w-auto" }, hasChanges && /* @__PURE__ */ React23__default.createElement(React23__default.Fragment, null, /* @__PURE__ */ React23__default.createElement(
1398
- "button",
1399
- {
1400
- onClick: handleResetOrder,
1401
- className: "flex items-center gap-2 bg-amber-500 hover:bg-amber-600 text-white px-4 py-2 rounded-lg font-medium transition-colors",
1402
- title: "\u91CD\u7F6E\u4E3A\u539F\u59CB\u987A\u5E8F"
1403
- },
1404
- /* @__PURE__ */ React23__default.createElement(RotateCcw, { size: 16 }),
1405
- "\u91CD\u7F6E"
1406
- ), /* @__PURE__ */ React23__default.createElement(
1407
- "button",
1408
- {
1409
- onClick: handleSaveOrder,
1410
- disabled: saving,
1411
- className: "flex items-center gap-2 bg-blue-500 hover:bg-blue-600 disabled:opacity-50 disabled:cursor-not-allowed text-white px-4 py-2 rounded-lg font-medium transition-colors",
1412
- title: "\u4FDD\u5B58\u65B0\u987A\u5E8F"
1413
- },
1414
- /* @__PURE__ */ React23__default.createElement(Save, { size: 16 }),
1415
- saving ? "\u4FDD\u5B58\u4E2D..." : "\u4FDD\u5B58\u987A\u5E8F"
1416
- )))), error && /* @__PURE__ */ React23__default.createElement("div", { className: "flex items-center gap-2 bg-red-50 text-red-600 p-3 rounded-lg mb-4 border border-red-200" }, /* @__PURE__ */ React23__default.createElement(AlertCircle, { size: 16 }), /* @__PURE__ */ React23__default.createElement("span", null, error)), /* @__PURE__ */ React23__default.createElement("div", { className: "bg-slate-50 border border-slate-200 rounded-lg p-4 mb-6" }, /* @__PURE__ */ React23__default.createElement("p", { className: "m-0 mb-2 color-slate-500 text-sm" }, description), /* @__PURE__ */ React23__default.createElement("ul", { className: "m-0 pl-6 color-slate-500 text-sm list-disc" }, /* @__PURE__ */ React23__default.createElement("li", { className: "mb-1" }, "\u4F7F\u7528\u62D6\u62FD\uFF1A\u70B9\u51FB\u5E76\u62D6\u52A8 ", /* @__PURE__ */ React23__default.createElement(GripVertical, { size: 14, className: "inline-block align-middle text-gray-500" }), " \u56FE\u6807"), /* @__PURE__ */ React23__default.createElement("li", { className: "mb-1" }, "\u4F7F\u7528\u6309\u94AE\uFF1A\u70B9\u51FB ", /* @__PURE__ */ React23__default.createElement(ChevronUp, { size: 14, className: "inline-block align-middle text-gray-500" }), " \u6216 ", /* @__PURE__ */ React23__default.createElement(ChevronDown, { size: 14, className: "inline-block align-middle text-gray-500" }), " \u6309\u94AE"), /* @__PURE__ */ React23__default.createElement("li", null, '\u5B8C\u6210\u8C03\u6574\u540E\uFF0C\u70B9\u51FB"\u4FDD\u5B58\u987A\u5E8F"\u6309\u94AE\u4FDD\u5B58\u66F4\u6539'))), /* @__PURE__ */ React23__default.createElement("div", { className: "flex flex-col gap-3" }, items.map((item, index) => /* @__PURE__ */ React23__default.createElement(
1417
- "div",
1418
- {
1419
- key: item.id,
1420
- className: cn(
1421
- "flex items-center gap-3 p-4 bg-gray-50 border-2 border-gray-200 rounded-lg transition-all hover:border-gray-300 hover:shadow-sm",
1422
- draggedItem === index && "opacity-50 rotate-2 border-blue-500"
1423
- ),
1424
- draggable: true,
1425
- onDragStart: (e) => handleDragStart(e, index),
1426
- onDragOver: (e) => handleDragOver(e),
1427
- onDrop: (e) => handleDrop(e, index)
1428
- },
1429
- /* @__PURE__ */ React23__default.createElement("div", { className: "flex items-center cursor-grab active:cursor-grabbing text-gray-400 p-1 rounded hover:text-gray-500 hover:bg-gray-100 transition-colors" }, /* @__PURE__ */ React23__default.createElement(GripVertical, { size: 20 })),
1430
- /* @__PURE__ */ React23__default.createElement("div", { className: "flex-1 min-w-0" }, renderItem(item, index, index === 0, index === items.length - 1)),
1431
- /* @__PURE__ */ React23__default.createElement("div", { className: "flex items-center mx-3" }, /* @__PURE__ */ React23__default.createElement("span", { className: "flex items-center justify-center w-8 h-8 bg-blue-500 text-white text-sm font-semibold rounded-full sm:w-8 sm:h-8 w-7 h-7 sm:text-sm text-xs" }, "#", index + 1)),
1432
- /* @__PURE__ */ React23__default.createElement("div", { className: "flex flex-col gap-1 sm:flex-col flex-row" }, /* @__PURE__ */ React23__default.createElement(
1433
- "button",
1434
- {
1435
- onClick: () => handleMoveUp(item.id),
1436
- disabled: index === 0,
1437
- className: "flex items-center justify-center w-8 h-8 p-0 border border-gray-300 bg-white text-gray-500 rounded cursor-pointer transition-all hover:bg-gray-100 hover:border-gray-400 hover:text-gray-700 disabled:opacity-40 disabled:cursor-not-allowed disabled:bg-gray-50 sm:w-8 sm:h-8 w-7 h-7",
1438
- title: "\u4E0A\u79FB"
1439
- },
1440
- /* @__PURE__ */ React23__default.createElement(ChevronUp, { size: 18 })
1441
- ), /* @__PURE__ */ React23__default.createElement(
1442
- "button",
1443
- {
1444
- onClick: () => handleMoveDown(item.id),
1445
- disabled: index === items.length - 1,
1446
- className: "flex items-center justify-center w-8 h-8 p-0 border border-gray-300 bg-white text-gray-500 rounded cursor-pointer transition-all hover:bg-gray-100 hover:border-gray-400 hover:text-gray-700 disabled:opacity-40 disabled:cursor-not-allowed disabled:bg-gray-50 sm:w-8 sm:h-8 w-7 h-7",
1447
- title: "\u4E0B\u79FB"
1448
- },
1449
- /* @__PURE__ */ React23__default.createElement(ChevronDown, { size: 18 })
1450
- ))
1451
- ))), items.length === 0 && /* @__PURE__ */ React23__default.createElement("div", { className: "text-center p-12 text-gray-400 italic" }, /* @__PURE__ */ React23__default.createElement("p", { className: "m-0" }, emptyMessage)));
1452
- }
1453
- var BackButton = ({ href, className = "" }) => {
1454
- const router = useRouter();
1455
- const handleClick = () => {
1456
- if (href) {
1457
- router.push(href);
1458
- } else {
1459
- router.back();
1460
- }
1461
- };
1462
- return /* @__PURE__ */ React23__default.createElement(
1463
- "button",
1464
- {
1465
- onClick: handleClick,
1466
- className: cn(
1467
- "inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-colors",
1468
- className
1469
- )
1470
- },
1471
- /* @__PURE__ */ React23__default.createElement(
1472
- "svg",
1473
- {
1474
- className: "w-5 h-5 mr-2",
1475
- fill: "none",
1476
- stroke: "currentColor",
1477
- viewBox: "0 0 24 24"
1478
- },
1479
- /* @__PURE__ */ React23__default.createElement(
1480
- "path",
1481
- {
1482
- strokeLinecap: "round",
1483
- strokeLinejoin: "round",
1484
- strokeWidth: 2,
1485
- d: "M10 19l-7-7m0 0l7-7m-7 7h18"
1486
- }
1487
- )
1488
- ),
1489
- "\u8FD4\u56DE"
1490
- );
1491
- };
1492
- function getColorValue(bgClass) {
1493
- const colorMap = {
1494
- "bg-blue-500": "#3b82f6",
1495
- "bg-green-500": "#10b981",
1496
- "bg-red-500": "#ef4444",
1497
- "bg-purple-500": "#8b5cf6",
1498
- "bg-slate-500": "#64748b",
1499
- "bg-emerald-500": "#10b981",
1500
- "bg-orange-500": "#f97316"
1501
- };
1502
- return colorMap[bgClass] || "#3b82f6";
1503
- }
1504
- function FilterButtonGroup({
1505
- label,
1506
- value,
1507
- options,
1508
- onChange,
1509
- className
1510
- }) {
1511
- return /* @__PURE__ */ React23__default.createElement("div", { className: cn("space-y-4", className) }, /* @__PURE__ */ React23__default.createElement("h3", { className: "text-lg font-semibold text-gray-800" }, label), /* @__PURE__ */ React23__default.createElement("div", { className: "flex gap-3" }, options.map((option) => {
1512
- const isActive = value === option.value;
1513
- return /* @__PURE__ */ React23__default.createElement(
1514
- "button",
1515
- {
1516
- key: option.value,
1517
- onClick: () => onChange(option.value),
1518
- style: isActive ? { backgroundColor: getColorValue(option.activeColor.bg) } : void 0,
1519
- className: cn(
1520
- "flex-1 h-12 rounded-lg font-medium text-sm transition-all duration-200 ease-out focus:outline-none focus:ring-2 focus:ring-opacity-50 border",
1521
- isActive ? "text-white border-transparent shadow-md focus:ring-white" : "bg-white text-gray-700 border-gray-200 shadow-sm hover:bg-gray-50 hover:border-gray-300 hover:shadow focus:ring-blue-300"
1522
- )
1523
- },
1524
- /* @__PURE__ */ React23__default.createElement("div", { className: "flex items-center justify-center space-x-2" }, /* @__PURE__ */ React23__default.createElement("span", { className: "text-lg" }, option.icon), /* @__PURE__ */ React23__default.createElement("span", null, option.label), option.showCount && option.count !== void 0 && /* @__PURE__ */ React23__default.createElement("span", { className: cn(
1525
- "text-xs font-semibold px-2 py-0.5 rounded-full min-w-[1.25rem] text-center",
1526
- isActive ? "bg-white/20 text-white" : "bg-gray-100 text-gray-600"
1527
- ) }, option.count))
1528
- );
1529
- })));
1530
- }
1531
- function SearchResultHint({ searchQuery, resultCount, className }) {
1532
- if (!searchQuery) return null;
1533
- return /* @__PURE__ */ React23__default.createElement("div", { className: cn("mb-6 p-4 bg-blue-50 border border-blue-200 rounded-lg", className) }, /* @__PURE__ */ React23__default.createElement("p", { className: "text-sm text-blue-700" }, '\u641C\u7D22 "', /* @__PURE__ */ React23__default.createElement("span", { className: "font-medium" }, searchQuery), '" \u627E\u5230 ', resultCount, " \u4E2A\u7ED3\u679C"));
1534
- }
1535
- var Modal = ({
1536
- isOpen,
1537
- onClose,
1538
- title,
1539
- width,
1540
- className,
1541
- maskClosable = true,
1542
- children,
1543
- zIndex = 50
1544
- }) => {
1545
- return /* @__PURE__ */ React23__default.createElement(Dialog, { open: isOpen, onOpenChange: (open) => {
1546
- if (!open) {
1547
- if (maskClosable) {
1548
- onClose();
1549
- }
1550
- }
1551
- } }, /* @__PURE__ */ React23__default.createElement(
1552
- DialogContent,
1553
- {
1554
- className: cn("sm:max-w-[425px]", className) + " z-[" + zIndex + "]",
1555
- onPointerDownOutside: (e) => {
1556
- if (!maskClosable) e.preventDefault();
1557
- },
1558
- onEscapeKeyDown: (e) => {
1559
- if (!maskClosable) e.preventDefault();
1560
- },
1561
- style: width ? { maxWidth: typeof width === "number" ? width + "px" : width } : void 0
1562
- },
1563
- title ? /* @__PURE__ */ React23__default.createElement(DialogHeader, null, /* @__PURE__ */ React23__default.createElement(DialogTitle, null, title)) : (
1564
- // 无障碍性:始终需要 DialogTitle,使用 sr-only 对视觉隐藏但对屏幕阅读器可见
1565
- /* @__PURE__ */ React23__default.createElement(DialogTitle, { className: "sr-only" }, "\u5F39\u7A97")
1566
- ),
1567
- /* @__PURE__ */ React23__default.createElement("div", { className: "py-4" }, children)
1568
- ));
1569
- };
1570
- var ConfirmModal = ({
1571
- isOpen,
1572
- onClose,
1573
- onConfirm,
1574
- title = "\u786E\u8BA4\u64CD\u4F5C",
1575
- message,
1576
- confirmText = "\u786E\u8BA4",
1577
- cancelText = "\u53D6\u6D88",
1578
- isLoading = false
1579
- }) => {
1580
- return /* @__PURE__ */ React23__default.createElement(AlertDialog, { open: isOpen, onOpenChange: (open) => !open && onClose() }, /* @__PURE__ */ React23__default.createElement(AlertDialogContent, null, /* @__PURE__ */ React23__default.createElement(AlertDialogHeader, null, /* @__PURE__ */ React23__default.createElement(AlertDialogTitle, null, title), /* @__PURE__ */ React23__default.createElement(AlertDialogDescription, null, message)), /* @__PURE__ */ React23__default.createElement(AlertDialogFooter, null, /* @__PURE__ */ React23__default.createElement(AlertDialogCancel, { disabled: isLoading }, cancelText), /* @__PURE__ */ React23__default.createElement(
1581
- AlertDialogAction,
1582
- {
1583
- onClick: (e) => {
1584
- e.preventDefault();
1585
- onConfirm();
1586
- },
1587
- disabled: isLoading,
1588
- className: "bg-destructive text-destructive-foreground hover:bg-destructive/90"
1589
- },
1590
- isLoading ? "\u5904\u7406\u4E2D..." : confirmText
1591
- ))));
1592
- };
1593
-
1594
- export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, BackButton, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CollisionBalls, ConfirmModal, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FilterButtonGroup, GenericOrderManager, Grid, Input, Label, Modal, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, ScrollArea, ScrollBar, SearchBox, SearchResultHint, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator3 as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Timeline, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants };
1595
- //# sourceMappingURL=chunk-KIP2CERU.mjs.map
1596
- //# sourceMappingURL=chunk-KIP2CERU.mjs.map