@blinkdotnew/ui 0.1.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.mjs ADDED
@@ -0,0 +1,3763 @@
1
+ import React14, { createContext, useState, useId, useContext, useEffect, useRef, useCallback } from 'react';
2
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
+ import { clsx } from 'clsx';
4
+ import { twMerge } from 'tailwind-merge';
5
+ import { Slot } from '@radix-ui/react-slot';
6
+ import { cva } from 'class-variance-authority';
7
+ import * as SelectPrimitive from '@radix-ui/react-select';
8
+ import { ChevronDown, ChevronUp, Check, Circle, X, ChevronRight, ChevronLeft, EyeOff, Eye, Search, Upload, Calendar, Plus, ArrowUp, ArrowDown, ArrowUpDown, TrendingUp, TrendingDown, ArrowRight, Loader2, LayoutDashboard, FolderOpen, Users, Settings, BarChart2, CreditCard, HelpCircle, Bell, Pencil, User, LogOut, Send, Info, XCircle, AlertTriangle, CheckCircle2, FileText, Archive, Film, FileCode, Image, File, MoreHorizontal, Download, Trash2 } from 'lucide-react';
9
+ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
10
+ import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
11
+ import * as SwitchPrimitive from '@radix-ui/react-switch';
12
+ import * as SliderPrimitive from '@radix-ui/react-slider';
13
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
14
+ import * as PopoverPrimitive from '@radix-ui/react-popover';
15
+ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
16
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
17
+ import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
18
+ import * as AvatarPrimitive from '@radix-ui/react-avatar';
19
+ import * as SeparatorPrimitive from '@radix-ui/react-separator';
20
+ import * as ProgressPrimitive from '@radix-ui/react-progress';
21
+ import * as TabsPrimitive from '@radix-ui/react-tabs';
22
+ import { Controller, useFormContext, useForm } from 'react-hook-form';
23
+ export { FormProvider as Form } from 'react-hook-form';
24
+ import { zodResolver } from '@hookform/resolvers/zod';
25
+ import * as z from 'zod';
26
+ import { useReactTable, getFilteredRowModel, getSortedRowModel, getPaginationRowModel, getCoreRowModel, flexRender } from '@tanstack/react-table';
27
+ import { Toaster as Toaster$1 } from 'sonner';
28
+ export { toast } from 'sonner';
29
+ import { useSensors, useSensor, PointerSensor, DndContext, DragOverlay } from '@dnd-kit/core';
30
+ import { useSortable, SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable';
31
+ import { CSS } from '@dnd-kit/utilities';
32
+ import { ResponsiveContainer, AreaChart as AreaChart$1, CartesianGrid, XAxis, YAxis, Tooltip as Tooltip$1, Legend, Area, BarChart as BarChart$1, Bar, LineChart as LineChart$1, Line } from 'recharts';
33
+
34
+ // src/provider/blink-ui-provider.tsx
35
+ var BlinkUIContext = createContext(null);
36
+ function useBlinkUI() {
37
+ const ctx = useContext(BlinkUIContext);
38
+ if (!ctx)
39
+ throw new Error("useBlinkUI must be used within <BlinkUIProvider>");
40
+ return ctx;
41
+ }
42
+ function BlinkUIProvider({
43
+ children,
44
+ theme: initialTheme = "linear",
45
+ darkMode: initialDarkMode = "system"
46
+ }) {
47
+ const [theme, setTheme] = useState(initialTheme);
48
+ const [darkMode, setDarkMode] = useState(initialDarkMode);
49
+ const [resolvedDark, setResolvedDark] = useState(false);
50
+ useEffect(() => {
51
+ const update = () => {
52
+ const isDark = darkMode === "dark" || darkMode === "system" && window.matchMedia("(prefers-color-scheme: dark)").matches;
53
+ setResolvedDark(isDark);
54
+ };
55
+ update();
56
+ const mq = window.matchMedia("(prefers-color-scheme: dark)");
57
+ mq.addEventListener("change", update);
58
+ return () => mq.removeEventListener("change", update);
59
+ }, [darkMode]);
60
+ useEffect(() => {
61
+ const root = document.documentElement;
62
+ root.classList.remove("theme-linear", "theme-glass", "theme-midnight", "theme-minimal");
63
+ root.classList.remove("dark", "light");
64
+ root.classList.add(`theme-${theme}`);
65
+ root.classList.add(resolvedDark ? "dark" : "light");
66
+ }, [theme, resolvedDark]);
67
+ return /* @__PURE__ */ jsx(BlinkUIContext.Provider, { value: { theme, darkMode, resolvedDark, setTheme, setDarkMode }, children });
68
+ }
69
+ function cn(...inputs) {
70
+ return twMerge(clsx(inputs));
71
+ }
72
+ var buttonVariants = cva(
73
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-[var(--radius)] text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--ring))] focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
74
+ {
75
+ variants: {
76
+ variant: {
77
+ default: "bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))] hover:bg-[hsl(var(--primary)/0.9)]",
78
+ secondary: "bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))] hover:bg-[hsl(var(--secondary)/0.8)]",
79
+ outline: "border border-[hsl(var(--border))] bg-transparent hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))]",
80
+ ghost: "hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))]",
81
+ destructive: "bg-[hsl(var(--destructive))] text-[hsl(var(--destructive-foreground))] hover:bg-[hsl(var(--destructive)/0.9)]",
82
+ link: "text-[hsl(var(--primary))] underline-offset-4 hover:underline"
83
+ },
84
+ size: {
85
+ sm: "h-8 px-3 text-xs",
86
+ default: "h-9 px-4 py-2",
87
+ lg: "h-11 px-6 text-base",
88
+ icon: "h-9 w-9"
89
+ }
90
+ },
91
+ defaultVariants: { variant: "default", size: "default" }
92
+ }
93
+ );
94
+ var Button = React14.forwardRef(
95
+ ({ className, variant, size, asChild = false, ...props }, ref) => {
96
+ const Comp = asChild ? Slot : "button";
97
+ return /* @__PURE__ */ jsx(Comp, { className: cn(buttonVariants({ variant, size }), className), ref, ...props });
98
+ }
99
+ );
100
+ Button.displayName = "Button";
101
+ var Input = React14.forwardRef(
102
+ ({ className, type, ...props }, ref) => /* @__PURE__ */ jsx(
103
+ "input",
104
+ {
105
+ type,
106
+ className: cn(
107
+ "flex h-9 w-full rounded-[var(--radius)] border border-[hsl(var(--input))] bg-transparent px-3 py-1 text-sm shadow-sm transition-colors",
108
+ "placeholder:text-[hsl(var(--muted-foreground))]",
109
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--ring))]",
110
+ "disabled:cursor-not-allowed disabled:opacity-50",
111
+ "file:border-0 file:bg-transparent file:text-sm file:font-medium",
112
+ className
113
+ ),
114
+ ref,
115
+ ...props
116
+ }
117
+ )
118
+ );
119
+ Input.displayName = "Input";
120
+ var Textarea = React14.forwardRef(
121
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
122
+ "textarea",
123
+ {
124
+ className: cn(
125
+ "flex min-h-[80px] w-full rounded-[var(--radius)] border border-[hsl(var(--input))] bg-transparent px-3 py-2 text-sm shadow-sm",
126
+ "placeholder:text-[hsl(var(--muted-foreground))]",
127
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--ring))]",
128
+ "disabled:cursor-not-allowed disabled:opacity-50",
129
+ "resize-none",
130
+ className
131
+ ),
132
+ ref,
133
+ ...props
134
+ }
135
+ )
136
+ );
137
+ Textarea.displayName = "Textarea";
138
+ var Select = SelectPrimitive.Root;
139
+ var SelectGroup = SelectPrimitive.Group;
140
+ var SelectValue = SelectPrimitive.Value;
141
+ var SelectTrigger = React14.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
142
+ SelectPrimitive.Trigger,
143
+ {
144
+ ref,
145
+ className: cn(
146
+ "flex h-9 w-full items-center justify-between rounded-[var(--radius)] border border-[hsl(var(--input))] bg-transparent px-3 py-2 text-sm shadow-sm",
147
+ "placeholder:text-[hsl(var(--muted-foreground))]",
148
+ "focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]",
149
+ "disabled:cursor-not-allowed disabled:opacity-50",
150
+ "[&>span]:truncate",
151
+ className
152
+ ),
153
+ ...props,
154
+ children: [
155
+ children,
156
+ /* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 opacity-50 shrink-0" }) })
157
+ ]
158
+ }
159
+ ));
160
+ SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
161
+ var SelectScrollUpButton = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
162
+ SelectPrimitive.ScrollUpButton,
163
+ {
164
+ ref,
165
+ className: cn("flex cursor-default items-center justify-center py-1", className),
166
+ ...props,
167
+ children: /* @__PURE__ */ jsx(ChevronUp, { className: "h-4 w-4" })
168
+ }
169
+ ));
170
+ SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
171
+ var SelectScrollDownButton = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
172
+ SelectPrimitive.ScrollDownButton,
173
+ {
174
+ ref,
175
+ className: cn("flex cursor-default items-center justify-center py-1", className),
176
+ ...props,
177
+ children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" })
178
+ }
179
+ ));
180
+ SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
181
+ var SelectContent = React14.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
182
+ SelectPrimitive.Content,
183
+ {
184
+ ref,
185
+ className: cn(
186
+ "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-[var(--radius)] border border-[hsl(var(--border))] bg-[hsl(var(--popover))] text-[hsl(var(--popover-foreground))] shadow-md",
187
+ "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
188
+ "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
189
+ position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1",
190
+ className
191
+ ),
192
+ position,
193
+ ...props,
194
+ children: [
195
+ /* @__PURE__ */ jsx(SelectScrollUpButton, {}),
196
+ /* @__PURE__ */ jsx(
197
+ SelectPrimitive.Viewport,
198
+ {
199
+ className: cn("p-1", position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),
200
+ children
201
+ }
202
+ ),
203
+ /* @__PURE__ */ jsx(SelectScrollDownButton, {})
204
+ ]
205
+ }
206
+ ) }));
207
+ SelectContent.displayName = SelectPrimitive.Content.displayName;
208
+ var SelectLabel = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
209
+ SelectPrimitive.Label,
210
+ {
211
+ ref,
212
+ className: cn("px-2 py-1.5 text-xs font-semibold text-[hsl(var(--muted-foreground))]", className),
213
+ ...props
214
+ }
215
+ ));
216
+ SelectLabel.displayName = SelectPrimitive.Label.displayName;
217
+ var SelectItem = React14.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
218
+ SelectPrimitive.Item,
219
+ {
220
+ ref,
221
+ className: cn(
222
+ "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none",
223
+ "focus:bg-[hsl(var(--accent))] focus:text-[hsl(var(--accent-foreground))]",
224
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
225
+ className
226
+ ),
227
+ ...props,
228
+ children: [
229
+ /* @__PURE__ */ jsx("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }) }),
230
+ /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
231
+ ]
232
+ }
233
+ ));
234
+ SelectItem.displayName = SelectPrimitive.Item.displayName;
235
+ var SelectSeparator = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
236
+ SelectPrimitive.Separator,
237
+ {
238
+ ref,
239
+ className: cn("-mx-1 my-1 h-px bg-[hsl(var(--muted))]", className),
240
+ ...props
241
+ }
242
+ ));
243
+ SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
244
+ var Checkbox = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
245
+ CheckboxPrimitive.Root,
246
+ {
247
+ ref,
248
+ className: cn(
249
+ "peer h-4 w-4 shrink-0 rounded-sm border border-[hsl(var(--primary))] shadow",
250
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--ring))]",
251
+ "disabled:cursor-not-allowed disabled:opacity-50",
252
+ "data-[state=checked]:bg-[hsl(var(--primary))] data-[state=checked]:text-[hsl(var(--primary-foreground))]",
253
+ className
254
+ ),
255
+ ...props,
256
+ children: /* @__PURE__ */ jsx(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current", children: /* @__PURE__ */ jsx(Check, { className: "h-3.5 w-3.5" }) })
257
+ }
258
+ ));
259
+ Checkbox.displayName = CheckboxPrimitive.Root.displayName;
260
+ var RadioGroup = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(RadioGroupPrimitive.Root, { className: cn("grid gap-2", className), ref, ...props }));
261
+ RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
262
+ var RadioGroupItem = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
263
+ RadioGroupPrimitive.Item,
264
+ {
265
+ ref,
266
+ className: cn(
267
+ "aspect-square h-4 w-4 rounded-full border border-[hsl(var(--primary))] text-[hsl(var(--primary))] shadow",
268
+ "focus:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--ring))]",
269
+ "disabled:cursor-not-allowed disabled:opacity-50",
270
+ className
271
+ ),
272
+ ...props,
273
+ children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(Circle, { className: "h-2.5 w-2.5 fill-current" }) })
274
+ }
275
+ ));
276
+ RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
277
+ var Switch = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
278
+ SwitchPrimitive.Root,
279
+ {
280
+ ref,
281
+ className: cn(
282
+ "peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors",
283
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--ring))] focus-visible:ring-offset-2 focus-visible:ring-offset-[hsl(var(--background))]",
284
+ "disabled:cursor-not-allowed disabled:opacity-50",
285
+ "data-[state=unchecked]:bg-[hsl(var(--input))]",
286
+ "data-[state=checked]:bg-[hsl(var(--primary))]",
287
+ className
288
+ ),
289
+ ...props,
290
+ children: /* @__PURE__ */ jsx(
291
+ SwitchPrimitive.Thumb,
292
+ {
293
+ className: cn(
294
+ "pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform",
295
+ "data-[state=unchecked]:translate-x-0",
296
+ "data-[state=checked]:translate-x-4"
297
+ )
298
+ }
299
+ )
300
+ }
301
+ ));
302
+ Switch.displayName = SwitchPrimitive.Root.displayName;
303
+ var Slider = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs(
304
+ SliderPrimitive.Root,
305
+ {
306
+ ref,
307
+ className: cn("relative flex w-full touch-none select-none items-center", className),
308
+ ...props,
309
+ children: [
310
+ /* @__PURE__ */ jsx(SliderPrimitive.Track, { className: "relative h-1.5 w-full grow overflow-hidden rounded-full bg-[hsl(var(--secondary))]", children: /* @__PURE__ */ jsx(SliderPrimitive.Range, { className: "absolute h-full bg-[hsl(var(--primary))]" }) }),
311
+ /* @__PURE__ */ jsx(SliderPrimitive.Thumb, { className: "block h-4 w-4 rounded-full border border-[hsl(var(--primary)/0.5)] bg-[hsl(var(--background))] shadow transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--ring))] disabled:pointer-events-none disabled:opacity-50" })
312
+ ]
313
+ }
314
+ ));
315
+ Slider.displayName = SliderPrimitive.Root.displayName;
316
+ var Dialog = DialogPrimitive.Root;
317
+ var DialogTrigger = DialogPrimitive.Trigger;
318
+ var DialogPortal = DialogPrimitive.Portal;
319
+ var DialogClose = DialogPrimitive.Close;
320
+ var DialogOverlay = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
321
+ DialogPrimitive.Overlay,
322
+ {
323
+ ref,
324
+ className: cn(
325
+ "fixed inset-0 z-50 bg-black/80",
326
+ "data-[state=open]:animate-in data-[state=open]:fade-in-0",
327
+ "data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
328
+ className
329
+ ),
330
+ ...props
331
+ }
332
+ ));
333
+ DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
334
+ var DialogContent = React14.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
335
+ /* @__PURE__ */ jsx(DialogOverlay, {}),
336
+ /* @__PURE__ */ jsxs(
337
+ DialogPrimitive.Content,
338
+ {
339
+ ref,
340
+ className: cn(
341
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4",
342
+ "bg-[hsl(var(--background))] p-6 shadow-lg duration-200 rounded-[var(--radius)]",
343
+ "border border-[hsl(var(--border))]",
344
+ "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",
345
+ "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]",
346
+ className
347
+ ),
348
+ ...props,
349
+ children: [
350
+ children,
351
+ /* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-[hsl(var(--background))] transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))] focus:ring-offset-2 disabled:pointer-events-none", children: [
352
+ /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
353
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
354
+ ] })
355
+ ]
356
+ }
357
+ )
358
+ ] }));
359
+ DialogContent.displayName = DialogPrimitive.Content.displayName;
360
+ var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props });
361
+ DialogHeader.displayName = "DialogHeader";
362
+ var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className), ...props });
363
+ DialogFooter.displayName = "DialogFooter";
364
+ var DialogTitle = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
365
+ DialogPrimitive.Title,
366
+ {
367
+ ref,
368
+ className: cn("text-lg font-semibold leading-none tracking-tight", className),
369
+ ...props
370
+ }
371
+ ));
372
+ DialogTitle.displayName = DialogPrimitive.Title.displayName;
373
+ var DialogDescription = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
374
+ DialogPrimitive.Description,
375
+ {
376
+ ref,
377
+ className: cn("text-sm text-[hsl(var(--muted-foreground))]", className),
378
+ ...props
379
+ }
380
+ ));
381
+ DialogDescription.displayName = DialogPrimitive.Description.displayName;
382
+ var Sheet = DialogPrimitive.Root;
383
+ var SheetTrigger = DialogPrimitive.Trigger;
384
+ var SheetClose = DialogPrimitive.Close;
385
+ var SheetPortal = DialogPrimitive.Portal;
386
+ var SheetOverlay = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
387
+ DialogPrimitive.Overlay,
388
+ {
389
+ ref,
390
+ className: cn(
391
+ "fixed inset-0 z-50 bg-black/80",
392
+ "data-[state=open]:animate-in data-[state=open]:fade-in-0",
393
+ "data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
394
+ className
395
+ ),
396
+ ...props
397
+ }
398
+ ));
399
+ SheetOverlay.displayName = DialogPrimitive.Overlay.displayName;
400
+ var sheetVariants = cva(
401
+ "fixed z-50 gap-4 bg-[hsl(var(--background))] p-6 shadow-lg transition ease-in-out border-[hsl(var(--border))]",
402
+ {
403
+ variants: {
404
+ side: {
405
+ top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
406
+ bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
407
+ 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",
408
+ 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"
409
+ }
410
+ },
411
+ defaultVariants: { side: "right" }
412
+ }
413
+ );
414
+ var SheetContent = React14.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ jsxs(SheetPortal, { children: [
415
+ /* @__PURE__ */ jsx(SheetOverlay, {}),
416
+ /* @__PURE__ */ jsxs(DialogPrimitive.Content, { ref, className: cn(sheetVariants({ side }), className), ...props, children: [
417
+ /* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]", children: [
418
+ /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
419
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
420
+ ] }),
421
+ children
422
+ ] })
423
+ ] }));
424
+ SheetContent.displayName = DialogPrimitive.Content.displayName;
425
+ var SheetHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("flex flex-col space-y-2 text-center sm:text-left", className), ...props });
426
+ var SheetFooter = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className), ...props });
427
+ var SheetTitle = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Title, { ref, className: cn("text-lg font-semibold", className), ...props }));
428
+ SheetTitle.displayName = DialogPrimitive.Title.displayName;
429
+ var SheetDescription = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Description, { ref, className: cn("text-sm text-[hsl(var(--muted-foreground))]", className), ...props }));
430
+ SheetDescription.displayName = DialogPrimitive.Description.displayName;
431
+ var Popover = PopoverPrimitive.Root;
432
+ var PopoverTrigger = PopoverPrimitive.Trigger;
433
+ var PopoverAnchor = PopoverPrimitive.Anchor;
434
+ var PopoverContent = React14.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
435
+ PopoverPrimitive.Content,
436
+ {
437
+ ref,
438
+ align,
439
+ sideOffset,
440
+ className: cn(
441
+ "z-50 w-72 rounded-[var(--radius)] border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-4 text-[hsl(var(--popover-foreground))] shadow-md outline-none",
442
+ "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
443
+ "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
444
+ "data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",
445
+ className
446
+ ),
447
+ ...props
448
+ }
449
+ ) }));
450
+ PopoverContent.displayName = PopoverPrimitive.Content.displayName;
451
+ var TooltipProvider = TooltipPrimitive.Provider;
452
+ var Tooltip = TooltipPrimitive.Root;
453
+ var TooltipTrigger = TooltipPrimitive.Trigger;
454
+ var TooltipContent = React14.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx(
455
+ TooltipPrimitive.Content,
456
+ {
457
+ ref,
458
+ sideOffset,
459
+ className: cn(
460
+ "z-50 overflow-hidden rounded-[var(--radius)] bg-[hsl(var(--primary))] px-3 py-1.5 text-xs text-[hsl(var(--primary-foreground))] shadow-md",
461
+ "animate-in fade-in-0 zoom-in-95",
462
+ "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
463
+ "data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",
464
+ className
465
+ ),
466
+ ...props
467
+ }
468
+ ) }));
469
+ TooltipContent.displayName = TooltipPrimitive.Content.displayName;
470
+ var DropdownMenu = DropdownMenuPrimitive.Root;
471
+ var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
472
+ var DropdownMenuGroup = DropdownMenuPrimitive.Group;
473
+ var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
474
+ var DropdownMenuSub = DropdownMenuPrimitive.Sub;
475
+ var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
476
+ var contentStyle = cn(
477
+ "z-50 min-w-[8rem] overflow-hidden rounded-[var(--radius)] border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1 text-[hsl(var(--popover-foreground))] shadow-md",
478
+ "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
479
+ "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"
480
+ );
481
+ var itemStyle = cn(
482
+ "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors",
483
+ "focus:bg-[hsl(var(--accent))] focus:text-[hsl(var(--accent-foreground))]",
484
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50"
485
+ );
486
+ var DropdownMenuContent = React14.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.Content, { ref, sideOffset, className: cn(contentStyle, className), ...props }) }));
487
+ DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
488
+ var DropdownMenuItem = React14.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Item, { ref, className: cn(itemStyle, inset && "pl-8", className), ...props }));
489
+ DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
490
+ var DropdownMenuCheckboxItem = React14.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(DropdownMenuPrimitive.CheckboxItem, { ref, className: cn(itemStyle, "pl-8", className), checked, ...props, children: [
491
+ /* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }) }),
492
+ children
493
+ ] }));
494
+ DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
495
+ var DropdownMenuRadioItem = React14.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DropdownMenuPrimitive.RadioItem, { ref, className: cn(itemStyle, "pl-8", className), ...props, children: [
496
+ /* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Circle, { className: "h-2 w-2 fill-current" }) }) }),
497
+ children
498
+ ] }));
499
+ DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
500
+ var DropdownMenuLabel = React14.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Label, { ref, className: cn("px-2 py-1.5 text-xs font-semibold text-[hsl(var(--muted-foreground))]", inset && "pl-8", className), ...props }));
501
+ DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
502
+ var DropdownMenuSeparator = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Separator, { ref, className: cn("-mx-1 my-1 h-px bg-[hsl(var(--muted))]", className), ...props }));
503
+ DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
504
+ var DropdownMenuSubTrigger = React14.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(DropdownMenuPrimitive.SubTrigger, { ref, className: cn(itemStyle, inset && "pl-8", "data-[state=open]:bg-[hsl(var(--accent))]", className), ...props, children: [
505
+ children,
506
+ /* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto h-4 w-4" })
507
+ ] }));
508
+ DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
509
+ var DropdownMenuSubContent = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.SubContent, { ref, className: cn(contentStyle, className), ...props }));
510
+ DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
511
+ var DropdownMenuShortcut = ({ className, ...props }) => /* @__PURE__ */ jsx("span", { className: cn("ml-auto text-xs tracking-widest opacity-60", className), ...props });
512
+ DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
513
+ var ContextMenu = ContextMenuPrimitive.Root;
514
+ var ContextMenuTrigger = ContextMenuPrimitive.Trigger;
515
+ var ContextMenuGroup = ContextMenuPrimitive.Group;
516
+ var ContextMenuPortal = ContextMenuPrimitive.Portal;
517
+ var ContextMenuSub = ContextMenuPrimitive.Sub;
518
+ var ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
519
+ var contentStyle2 = "z-50 min-w-[8rem] overflow-hidden rounded-[var(--radius)] border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-80";
520
+ var itemStyle2 = "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-[hsl(var(--accent))] focus:text-[hsl(var(--accent-foreground))] data-[disabled]:pointer-events-none data-[disabled]:opacity-50";
521
+ var ContextMenuContent = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(ContextMenuPrimitive.Content, { ref, className: cn(contentStyle2, className), ...props }) }));
522
+ ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
523
+ var ContextMenuItem = React14.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Item, { ref, className: cn(itemStyle2, inset && "pl-8", className), ...props }));
524
+ ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
525
+ var ContextMenuCheckboxItem = React14.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(ContextMenuPrimitive.CheckboxItem, { ref, className: cn(itemStyle2, "pl-8", className), checked, ...props, children: [
526
+ /* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }) }),
527
+ children
528
+ ] }));
529
+ ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
530
+ var ContextMenuRadioItem = React14.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(ContextMenuPrimitive.RadioItem, { ref, className: cn(itemStyle2, "pl-8", className), ...props, children: [
531
+ /* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Circle, { className: "h-2 w-2 fill-current" }) }) }),
532
+ children
533
+ ] }));
534
+ ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
535
+ var ContextMenuLabel = React14.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Label, { ref, className: cn("px-2 py-1.5 text-xs font-semibold text-[hsl(var(--muted-foreground))]", inset && "pl-8", className), ...props }));
536
+ ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
537
+ var ContextMenuSeparator = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Separator, { ref, className: cn("-mx-1 my-1 h-px bg-[hsl(var(--muted))]", className), ...props }));
538
+ ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
539
+ var ContextMenuSubTrigger = React14.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(ContextMenuPrimitive.SubTrigger, { ref, className: cn(itemStyle2, inset && "pl-8", className), ...props, children: [
540
+ children,
541
+ /* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto h-4 w-4" })
542
+ ] }));
543
+ ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
544
+ var ContextMenuSubContent = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.SubContent, { ref, className: cn(contentStyle2, className), ...props }));
545
+ ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
546
+ var ContextMenuShortcut = ({ className, ...props }) => /* @__PURE__ */ jsx("span", { className: cn("ml-auto text-xs tracking-widest opacity-60", className), ...props });
547
+ var Card = React14.forwardRef(
548
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
549
+ "div",
550
+ {
551
+ ref,
552
+ className: cn("rounded-[var(--radius)] border border-[hsl(var(--border))] bg-[hsl(var(--card))] text-[hsl(var(--card-foreground))] shadow-sm", className),
553
+ ...props
554
+ }
555
+ )
556
+ );
557
+ Card.displayName = "Card";
558
+ var CardHeader = React14.forwardRef(
559
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("flex flex-col space-y-1.5 p-6", className), ...props })
560
+ );
561
+ CardHeader.displayName = "CardHeader";
562
+ var CardTitle = React14.forwardRef(
563
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("font-semibold leading-none tracking-tight", className), ...props })
564
+ );
565
+ CardTitle.displayName = "CardTitle";
566
+ var CardDescription = React14.forwardRef(
567
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("text-sm text-[hsl(var(--muted-foreground))]", className), ...props })
568
+ );
569
+ CardDescription.displayName = "CardDescription";
570
+ var CardContent = React14.forwardRef(
571
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("p-6 pt-0", className), ...props })
572
+ );
573
+ CardContent.displayName = "CardContent";
574
+ var CardFooter = React14.forwardRef(
575
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("flex items-center p-6 pt-0", className), ...props })
576
+ );
577
+ CardFooter.displayName = "CardFooter";
578
+ var badgeVariants = cva(
579
+ "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))] focus:ring-offset-2",
580
+ {
581
+ variants: {
582
+ variant: {
583
+ default: "border-transparent bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))] hover:bg-[hsl(var(--primary)/0.8)]",
584
+ secondary: "border-transparent bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))] hover:bg-[hsl(var(--secondary)/0.8)]",
585
+ destructive: "border-transparent bg-[hsl(var(--destructive))] text-[hsl(var(--destructive-foreground))] hover:bg-[hsl(var(--destructive)/0.8)]",
586
+ outline: "text-[hsl(var(--foreground))]"
587
+ }
588
+ },
589
+ defaultVariants: { variant: "default" }
590
+ }
591
+ );
592
+ function Badge({ className, variant, ...props }) {
593
+ return /* @__PURE__ */ jsx("div", { className: cn(badgeVariants({ variant }), className), ...props });
594
+ }
595
+ var Avatar = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
596
+ AvatarPrimitive.Root,
597
+ {
598
+ ref,
599
+ className: cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className),
600
+ ...props
601
+ }
602
+ ));
603
+ Avatar.displayName = AvatarPrimitive.Root.displayName;
604
+ var AvatarImage = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(AvatarPrimitive.Image, { ref, className: cn("aspect-square h-full w-full object-cover", className), ...props }));
605
+ AvatarImage.displayName = AvatarPrimitive.Image.displayName;
606
+ var AvatarFallback = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
607
+ AvatarPrimitive.Fallback,
608
+ {
609
+ ref,
610
+ className: cn("flex h-full w-full items-center justify-center rounded-full bg-[hsl(var(--muted))] text-sm font-medium text-[hsl(var(--muted-foreground))]", className),
611
+ ...props
612
+ }
613
+ ));
614
+ AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
615
+ var Separator4 = React14.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx(
616
+ SeparatorPrimitive.Root,
617
+ {
618
+ ref,
619
+ decorative,
620
+ orientation,
621
+ className: cn(
622
+ "shrink-0 bg-[hsl(var(--border))]",
623
+ orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
624
+ className
625
+ ),
626
+ ...props
627
+ }
628
+ ));
629
+ Separator4.displayName = SeparatorPrimitive.Root.displayName;
630
+ function Skeleton({ className, ...props }) {
631
+ return /* @__PURE__ */ jsx(
632
+ "div",
633
+ {
634
+ className: cn("animate-pulse rounded-[var(--radius)] bg-[hsl(var(--muted))]", className),
635
+ ...props
636
+ }
637
+ );
638
+ }
639
+ var Progress = React14.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ jsx(
640
+ ProgressPrimitive.Root,
641
+ {
642
+ ref,
643
+ className: cn("relative h-2 w-full overflow-hidden rounded-full bg-[hsl(var(--secondary))]", className),
644
+ ...props,
645
+ children: /* @__PURE__ */ jsx(
646
+ ProgressPrimitive.Indicator,
647
+ {
648
+ className: "h-full w-full flex-1 bg-[hsl(var(--primary))] transition-all",
649
+ style: { transform: `translateX(-${100 - (value ?? 0)}%)` }
650
+ }
651
+ )
652
+ }
653
+ ));
654
+ Progress.displayName = ProgressPrimitive.Root.displayName;
655
+ var Tabs = TabsPrimitive.Root;
656
+ var TabsList = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
657
+ TabsPrimitive.List,
658
+ {
659
+ ref,
660
+ className: cn(
661
+ "inline-flex h-9 items-center justify-center rounded-lg bg-[hsl(var(--muted))] p-1 text-[hsl(var(--muted-foreground))]",
662
+ className
663
+ ),
664
+ ...props
665
+ }
666
+ ));
667
+ TabsList.displayName = TabsPrimitive.List.displayName;
668
+ var TabsTrigger = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
669
+ TabsPrimitive.Trigger,
670
+ {
671
+ ref,
672
+ className: cn(
673
+ "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-[hsl(var(--background))] transition-all",
674
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--ring))] focus-visible:ring-offset-2",
675
+ "disabled:pointer-events-none disabled:opacity-50",
676
+ "data-[state=active]:bg-[hsl(var(--background))] data-[state=active]:text-[hsl(var(--foreground))] data-[state=active]:shadow",
677
+ className
678
+ ),
679
+ ...props
680
+ }
681
+ ));
682
+ TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
683
+ var TabsContent = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
684
+ TabsPrimitive.Content,
685
+ {
686
+ ref,
687
+ className: cn(
688
+ "mt-2 ring-offset-[hsl(var(--background))] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--ring))] focus-visible:ring-offset-2",
689
+ className
690
+ ),
691
+ ...props
692
+ }
693
+ ));
694
+ TabsContent.displayName = TabsPrimitive.Content.displayName;
695
+ var dirMap = {
696
+ row: "flex-row",
697
+ col: "flex-col",
698
+ "row-reverse": "flex-row-reverse",
699
+ "col-reverse": "flex-col-reverse"
700
+ };
701
+ var alignMap = {
702
+ start: "items-start",
703
+ center: "items-center",
704
+ end: "items-end",
705
+ stretch: "items-stretch",
706
+ baseline: "items-baseline"
707
+ };
708
+ var justifyMap = {
709
+ start: "justify-start",
710
+ center: "justify-center",
711
+ end: "justify-end",
712
+ between: "justify-between",
713
+ around: "justify-around",
714
+ evenly: "justify-evenly"
715
+ };
716
+ var Stack = React14.forwardRef(
717
+ ({ className, gap, direction = "col", align, justify, wrap, style, ...props }, ref) => /* @__PURE__ */ jsx(
718
+ "div",
719
+ {
720
+ ref,
721
+ className: cn(
722
+ "flex",
723
+ dirMap[direction],
724
+ align && alignMap[align],
725
+ justify && justifyMap[justify],
726
+ wrap && "flex-wrap",
727
+ className
728
+ ),
729
+ style: { ...gap !== void 0 ? { gap: `${gap * 4}px` } : {}, ...style },
730
+ ...props
731
+ }
732
+ )
733
+ );
734
+ Stack.displayName = "Stack";
735
+ var HStack = React14.forwardRef(
736
+ (props, ref) => /* @__PURE__ */ jsx(Stack, { ref, direction: "row", ...props })
737
+ );
738
+ HStack.displayName = "HStack";
739
+ var VStack = React14.forwardRef(
740
+ (props, ref) => /* @__PURE__ */ jsx(Stack, { ref, direction: "col", ...props })
741
+ );
742
+ VStack.displayName = "VStack";
743
+ var sizeMap = {
744
+ sm: "max-w-screen-sm",
745
+ md: "max-w-screen-md",
746
+ lg: "max-w-screen-lg",
747
+ xl: "max-w-screen-xl",
748
+ full: "max-w-full"
749
+ };
750
+ var Container = React14.forwardRef(
751
+ ({ className, size = "lg", noPadding = false, ...props }, ref) => /* @__PURE__ */ jsx(
752
+ "div",
753
+ {
754
+ ref,
755
+ className: cn(
756
+ "mx-auto w-full",
757
+ sizeMap[size],
758
+ !noPadding && "px-4 sm:px-6 lg:px-8",
759
+ className
760
+ ),
761
+ ...props
762
+ }
763
+ )
764
+ );
765
+ Container.displayName = "Container";
766
+ var Page = React14.forwardRef(
767
+ ({ className, maxWidth, style, ...props }, ref) => /* @__PURE__ */ jsx(
768
+ "div",
769
+ {
770
+ ref,
771
+ className: cn("flex flex-col min-h-full w-full", className),
772
+ style: { maxWidth, ...style },
773
+ ...props
774
+ }
775
+ )
776
+ );
777
+ Page.displayName = "Page";
778
+ var PageHeader = React14.forwardRef(
779
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
780
+ "div",
781
+ {
782
+ ref,
783
+ className: cn("flex items-start justify-between gap-4 px-6 py-4 border-b border-[hsl(var(--border))]", className),
784
+ ...props
785
+ }
786
+ )
787
+ );
788
+ PageHeader.displayName = "PageHeader";
789
+ var PageTitle = React14.forwardRef(
790
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
791
+ "h1",
792
+ {
793
+ ref,
794
+ className: cn("text-2xl font-semibold tracking-tight text-[hsl(var(--foreground))]", className),
795
+ ...props
796
+ }
797
+ )
798
+ );
799
+ PageTitle.displayName = "PageTitle";
800
+ var PageDescription = React14.forwardRef(
801
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx("p", { ref, className: cn("text-sm text-[hsl(var(--muted-foreground))] mt-1", className), ...props })
802
+ );
803
+ PageDescription.displayName = "PageDescription";
804
+ var PageActions = React14.forwardRef(
805
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("flex items-center gap-2 shrink-0", className), ...props })
806
+ );
807
+ PageActions.displayName = "PageActions";
808
+ var PageBody = React14.forwardRef(
809
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("flex-1 p-6", className), ...props })
810
+ );
811
+ PageBody.displayName = "PageBody";
812
+ var SidebarCtx = React14.createContext({ collapsed: false });
813
+ var useSidebarCtx = () => React14.useContext(SidebarCtx);
814
+ var makeSlot = (name, cls) => {
815
+ const C = React14.forwardRef(
816
+ ({ className, ...p }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn(cls, className), ...p })
817
+ );
818
+ C.displayName = name;
819
+ return C;
820
+ };
821
+ var Sidebar = React14.forwardRef(
822
+ ({ className, collapsed = false, onCollapse, width = "240px", style, children, ...props }, ref) => /* @__PURE__ */ jsx(SidebarCtx.Provider, { value: { collapsed }, children: /* @__PURE__ */ jsxs(
823
+ "div",
824
+ {
825
+ ref,
826
+ className: cn("flex flex-col h-full bg-[hsl(var(--card))] border-r border-[hsl(var(--border))] transition-all duration-200 overflow-hidden", className),
827
+ style: { width: collapsed ? "48px" : width, ...style },
828
+ ...props,
829
+ children: [
830
+ /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto overflow-x-hidden", children }),
831
+ onCollapse && /* @__PURE__ */ jsx(
832
+ "button",
833
+ {
834
+ onClick: onCollapse,
835
+ className: "flex items-center justify-center h-10 w-full border-t border-[hsl(var(--border))] hover:bg-[hsl(var(--accent))] text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] transition-colors shrink-0",
836
+ children: collapsed ? /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" })
837
+ }
838
+ )
839
+ ]
840
+ }
841
+ ) })
842
+ );
843
+ Sidebar.displayName = "Sidebar";
844
+ var SidebarHeader = makeSlot("SidebarHeader", "px-3 py-4 border-b border-[hsl(var(--border))] shrink-0");
845
+ var SidebarContent = makeSlot("SidebarContent", "flex-1 overflow-y-auto py-2");
846
+ var SidebarFooter = makeSlot("SidebarFooter", "px-3 py-3 border-t border-[hsl(var(--border))] shrink-0");
847
+ var SidebarGroup = makeSlot("SidebarGroup", "mb-2");
848
+ var SidebarSeparator = makeSlot("SidebarSeparator", "h-px bg-[hsl(var(--border))] mx-3 my-2");
849
+ var SidebarGroupLabel = React14.forwardRef(
850
+ ({ className, ...props }, ref) => {
851
+ const { collapsed } = useSidebarCtx();
852
+ return /* @__PURE__ */ jsx(
853
+ "div",
854
+ {
855
+ ref,
856
+ className: cn("px-3 py-1 text-xs font-semibold text-[hsl(var(--muted-foreground))] uppercase tracking-wider", collapsed && "sr-only", className),
857
+ ...props
858
+ }
859
+ );
860
+ }
861
+ );
862
+ SidebarGroupLabel.displayName = "SidebarGroupLabel";
863
+ var SidebarItem = React14.forwardRef(
864
+ ({ className, icon, label, active, href, badge, onClick, ...props }, ref) => {
865
+ const { collapsed } = useSidebarCtx();
866
+ const cls = cn(
867
+ "flex items-center gap-2.5 px-3 py-2 rounded-md cursor-pointer transition-colors mx-1 text-sm",
868
+ active ? "bg-[hsl(var(--accent))] text-[hsl(var(--foreground))] font-medium" : "text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--foreground))]",
869
+ collapsed && "justify-center px-0 mx-2",
870
+ className
871
+ );
872
+ const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
873
+ icon && /* @__PURE__ */ jsx("span", { className: "shrink-0 flex items-center justify-center w-4 h-4", children: icon }),
874
+ !collapsed && /* @__PURE__ */ jsx("span", { className: "flex-1 min-w-0 truncate", children: label }),
875
+ !collapsed && badge !== void 0 && /* @__PURE__ */ jsx("span", { className: "text-[10px] px-1.5 py-0.5 rounded-full bg-[hsl(var(--primary))] bg-opacity-10 text-[hsl(var(--primary))] shrink-0 font-medium", children: badge })
876
+ ] });
877
+ if (href)
878
+ return /* @__PURE__ */ jsx("a", { href, className: cls, onClick, children: inner });
879
+ return /* @__PURE__ */ jsx("div", { ref, role: "button", tabIndex: 0, className: cls, onClick, ...props, children: inner });
880
+ }
881
+ );
882
+ SidebarItem.displayName = "SidebarItem";
883
+ var Navbar = React14.forwardRef(
884
+ ({ className, sticky = false, border = true, ...props }, ref) => /* @__PURE__ */ jsx(
885
+ "nav",
886
+ {
887
+ ref,
888
+ className: cn(
889
+ "z-40 w-full h-14 flex items-center bg-[hsl(var(--background))]",
890
+ sticky && "sticky top-0",
891
+ border && "border-b border-[hsl(var(--border))]",
892
+ className
893
+ ),
894
+ ...props
895
+ }
896
+ )
897
+ );
898
+ Navbar.displayName = "Navbar";
899
+ var NavbarBrand = React14.forwardRef(
900
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("flex items-center gap-2 px-4 shrink-0", className), ...props })
901
+ );
902
+ NavbarBrand.displayName = "NavbarBrand";
903
+ var alignMap2 = {
904
+ start: "justify-start",
905
+ center: "justify-center flex-1",
906
+ end: "justify-end ml-auto"
907
+ };
908
+ var NavbarContent = React14.forwardRef(
909
+ ({ className, align = "start", ...props }, ref) => /* @__PURE__ */ jsx(
910
+ "div",
911
+ {
912
+ ref,
913
+ className: cn("flex items-center gap-1 px-2", alignMap2[align], className),
914
+ ...props
915
+ }
916
+ )
917
+ );
918
+ NavbarContent.displayName = "NavbarContent";
919
+ var NavbarItem = React14.forwardRef(
920
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("flex items-center", className), ...props })
921
+ );
922
+ NavbarItem.displayName = "NavbarItem";
923
+ var AppShellCtx = React14.createContext({
924
+ collapsed: false,
925
+ setCollapsed: () => {
926
+ }
927
+ });
928
+ var useAppShell = () => React14.useContext(AppShellCtx);
929
+ var AppShell = React14.forwardRef(
930
+ ({ className, defaultCollapsed = false, children, ...props }, ref) => {
931
+ const [collapsed, setCollapsed] = React14.useState(defaultCollapsed);
932
+ return /* @__PURE__ */ jsx(AppShellCtx.Provider, { value: { collapsed, setCollapsed }, children: /* @__PURE__ */ jsx(
933
+ "div",
934
+ {
935
+ ref,
936
+ className: cn("flex h-screen w-full overflow-hidden bg-[hsl(var(--background))]", className),
937
+ ...props,
938
+ children
939
+ }
940
+ ) });
941
+ }
942
+ );
943
+ AppShell.displayName = "AppShell";
944
+ var AppShellSidebar = React14.forwardRef(
945
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("shrink-0 h-full", className), ...props })
946
+ );
947
+ AppShellSidebar.displayName = "AppShellSidebar";
948
+ var AppShellMain = React14.forwardRef(
949
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("flex-1 min-w-0 flex flex-col overflow-auto", className), ...props })
950
+ );
951
+ AppShellMain.displayName = "AppShellMain";
952
+ var SplitPage = React14.forwardRef(
953
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("flex h-full w-full overflow-hidden", className), ...props })
954
+ );
955
+ SplitPage.displayName = "SplitPage";
956
+ var SplitPageList = React14.forwardRef(
957
+ ({ className, width = "320px", style, ...props }, ref) => /* @__PURE__ */ jsx(
958
+ "div",
959
+ {
960
+ ref,
961
+ className: cn("shrink-0 h-full overflow-auto border-r border-[hsl(var(--border))]", className),
962
+ style: { width, ...style },
963
+ ...props
964
+ }
965
+ )
966
+ );
967
+ SplitPageList.displayName = "SplitPageList";
968
+ var SplitPageDetail = React14.forwardRef(
969
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("flex-1 min-w-0 h-full overflow-auto", className), ...props })
970
+ );
971
+ SplitPageDetail.displayName = "SplitPageDetail";
972
+ var ResizeBox = React14.forwardRef(
973
+ ({ className, resize = "both", minWidth = 100, minHeight = 100, style, ...props }, ref) => /* @__PURE__ */ jsx(
974
+ "div",
975
+ {
976
+ ref,
977
+ className: cn("overflow-auto relative", className),
978
+ style: { resize, minWidth, minHeight, ...style },
979
+ ...props
980
+ }
981
+ )
982
+ );
983
+ ResizeBox.displayName = "ResizeBox";
984
+ var HandleIcon = () => /* @__PURE__ */ jsxs("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", "aria-hidden": true, children: [
985
+ /* @__PURE__ */ jsx("path", { d: "M8 2L2 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }),
986
+ /* @__PURE__ */ jsx("path", { d: "M8 5L5 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }),
987
+ /* @__PURE__ */ jsx("path", { d: "M8 8L8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
988
+ ] });
989
+ var ResizeHandle = React14.forwardRef(
990
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
991
+ "div",
992
+ {
993
+ ref,
994
+ className: cn(
995
+ "absolute bottom-0 right-0 w-5 h-5 flex items-center justify-center",
996
+ "cursor-se-resize text-[hsl(var(--muted-foreground))] opacity-50 hover:opacity-100 transition-opacity",
997
+ className
998
+ ),
999
+ ...props,
1000
+ children: /* @__PURE__ */ jsx(HandleIcon, {})
1001
+ }
1002
+ )
1003
+ );
1004
+ ResizeHandle.displayName = "ResizeHandle";
1005
+ function Field({ label, description, error, required, children, className }) {
1006
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-1.5", className), children: [
1007
+ label && /* @__PURE__ */ jsx(FieldLabel, { required, children: label }),
1008
+ children,
1009
+ description && !error && /* @__PURE__ */ jsx(FieldDescription, { children: description }),
1010
+ error && /* @__PURE__ */ jsx(FieldError, { children: error })
1011
+ ] });
1012
+ }
1013
+ var FieldLabel = React14.forwardRef(
1014
+ ({ className, required, children, ...props }, ref) => /* @__PURE__ */ jsxs(
1015
+ "label",
1016
+ {
1017
+ ref,
1018
+ className: cn("text-sm font-medium leading-none text-[hsl(var(--foreground))]", className),
1019
+ ...props,
1020
+ children: [
1021
+ children,
1022
+ required && /* @__PURE__ */ jsx("span", { className: "ml-1 text-[hsl(var(--destructive))]", children: "*" })
1023
+ ]
1024
+ }
1025
+ )
1026
+ );
1027
+ FieldLabel.displayName = "FieldLabel";
1028
+ var FieldDescription = React14.forwardRef(
1029
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1030
+ "p",
1031
+ {
1032
+ ref,
1033
+ className: cn("text-xs text-[hsl(var(--muted-foreground))]", className),
1034
+ ...props
1035
+ }
1036
+ )
1037
+ );
1038
+ FieldDescription.displayName = "FieldDescription";
1039
+ var FieldError = React14.forwardRef(
1040
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1041
+ "p",
1042
+ {
1043
+ ref,
1044
+ className: cn("text-xs text-[hsl(var(--destructive))]", className),
1045
+ ...props
1046
+ }
1047
+ )
1048
+ );
1049
+ FieldError.displayName = "FieldError";
1050
+ function getStrength(value) {
1051
+ const has = (re) => re.test(value);
1052
+ const score = [value.length >= 8, has(/[A-Z]/), has(/[0-9]/), has(/[^A-Za-z0-9]/)].filter(Boolean).length;
1053
+ if (score <= 1)
1054
+ return { level: "weak", width: "w-1/3", color: "bg-[hsl(var(--destructive))]" };
1055
+ if (score <= 3)
1056
+ return { level: "medium", width: "w-2/3", color: "bg-yellow-500" };
1057
+ return { level: "strong", width: "w-full", color: "bg-green-500" };
1058
+ }
1059
+ var PasswordInput = React14.forwardRef(
1060
+ ({ className, strength, ...props }, ref) => {
1061
+ const [show, setShow] = useState(false);
1062
+ const value = String(props.value ?? "");
1063
+ const str = getStrength(value);
1064
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
1065
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
1066
+ /* @__PURE__ */ jsx(
1067
+ Input,
1068
+ {
1069
+ ref,
1070
+ type: show ? "text" : "password",
1071
+ className: cn("pr-9", className),
1072
+ ...props
1073
+ }
1074
+ ),
1075
+ /* @__PURE__ */ jsx(
1076
+ "button",
1077
+ {
1078
+ type: "button",
1079
+ onClick: () => setShow((s) => !s),
1080
+ className: "absolute right-2.5 top-1/2 -translate-y-1/2 text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] transition-colors",
1081
+ tabIndex: -1,
1082
+ children: show ? /* @__PURE__ */ jsx(EyeOff, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Eye, { className: "h-4 w-4" })
1083
+ }
1084
+ )
1085
+ ] }),
1086
+ strength && value.length > 0 && /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
1087
+ /* @__PURE__ */ jsx("div", { className: "h-1 w-full rounded-full bg-[hsl(var(--muted))]", children: /* @__PURE__ */ jsx("div", { className: cn("h-full rounded-full transition-all", str.width, str.color) }) }),
1088
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-[hsl(var(--muted-foreground))] capitalize", children: str.level })
1089
+ ] })
1090
+ ] });
1091
+ }
1092
+ );
1093
+ PasswordInput.displayName = "PasswordInput";
1094
+ var SearchInput = React14.forwardRef(
1095
+ ({ className, shortcut, onClear, onChange, value: valueProp, defaultValue, ...props }, ref) => {
1096
+ const [internalValue, setInternalValue] = useState(defaultValue ?? "");
1097
+ const isControlled = valueProp !== void 0;
1098
+ const value = isControlled ? String(valueProp) : String(internalValue);
1099
+ function handleChange(e) {
1100
+ if (!isControlled)
1101
+ setInternalValue(e.target.value);
1102
+ onChange?.(e.target.value);
1103
+ }
1104
+ function handleClear() {
1105
+ if (!isControlled)
1106
+ setInternalValue("");
1107
+ onChange?.("");
1108
+ onClear?.();
1109
+ }
1110
+ return /* @__PURE__ */ jsxs("div", { className: "relative flex items-center", children: [
1111
+ /* @__PURE__ */ jsx(Search, { className: "pointer-events-none absolute left-2.5 h-4 w-4 text-[hsl(var(--muted-foreground))]" }),
1112
+ /* @__PURE__ */ jsx(
1113
+ "input",
1114
+ {
1115
+ ref,
1116
+ value,
1117
+ onChange: handleChange,
1118
+ className: cn(
1119
+ "flex h-9 w-full rounded-[var(--radius)] border border-[hsl(var(--input))] bg-transparent pl-8 pr-8 text-sm shadow-sm transition-colors",
1120
+ "placeholder:text-[hsl(var(--muted-foreground))]",
1121
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--ring))]",
1122
+ "disabled:cursor-not-allowed disabled:opacity-50",
1123
+ className
1124
+ ),
1125
+ ...props
1126
+ }
1127
+ ),
1128
+ /* @__PURE__ */ jsx("div", { className: "absolute right-2.5 flex items-center", children: value ? /* @__PURE__ */ jsx(
1129
+ "button",
1130
+ {
1131
+ type: "button",
1132
+ onClick: handleClear,
1133
+ className: "text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] transition-colors",
1134
+ children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
1135
+ }
1136
+ ) : shortcut ? /* @__PURE__ */ jsx("kbd", { className: "pointer-events-none rounded border border-[hsl(var(--border))] px-1.5 py-0.5 text-[10px] text-[hsl(var(--muted-foreground))]", children: shortcut }) : null })
1137
+ ] });
1138
+ }
1139
+ );
1140
+ SearchInput.displayName = "SearchInput";
1141
+ function formatBytes(bytes) {
1142
+ if (bytes < 1024)
1143
+ return `${bytes} B`;
1144
+ if (bytes < 1024 * 1024)
1145
+ return `${(bytes / 1024).toFixed(1)} KB`;
1146
+ return `${(bytes / 1024 / 1024).toFixed(1)} MB`;
1147
+ }
1148
+ function filterBySize(files, maxSize) {
1149
+ return maxSize ? files.filter((f) => f.size <= maxSize) : files;
1150
+ }
1151
+ function FileUpload({ accept, multiple, maxSize, onFiles, className, disabled }) {
1152
+ const inputRef = useRef(null);
1153
+ const [dragging, setDragging] = useState(false);
1154
+ function handleFiles(raw) {
1155
+ if (!raw)
1156
+ return;
1157
+ const files = filterBySize(Array.from(raw), maxSize);
1158
+ onFiles?.(files);
1159
+ }
1160
+ function handleDrop(e) {
1161
+ e.preventDefault();
1162
+ setDragging(false);
1163
+ if (!disabled)
1164
+ handleFiles(e.dataTransfer.files);
1165
+ }
1166
+ return /* @__PURE__ */ jsxs(
1167
+ "div",
1168
+ {
1169
+ role: "button",
1170
+ tabIndex: disabled ? -1 : 0,
1171
+ onClick: () => !disabled && inputRef.current?.click(),
1172
+ onKeyDown: (e) => e.key === "Enter" && !disabled && inputRef.current?.click(),
1173
+ onDragOver: (e) => {
1174
+ e.preventDefault();
1175
+ if (!disabled)
1176
+ setDragging(true);
1177
+ },
1178
+ onDragLeave: () => setDragging(false),
1179
+ onDrop: handleDrop,
1180
+ className: cn(
1181
+ "flex flex-col items-center justify-center gap-2 rounded-[var(--radius)] border-2 border-dashed border-[hsl(var(--border))] p-8 text-center transition-colors cursor-pointer",
1182
+ dragging && "border-[hsl(var(--primary))] bg-[hsl(var(--accent))]",
1183
+ disabled && "cursor-not-allowed opacity-50",
1184
+ className
1185
+ ),
1186
+ children: [
1187
+ /* @__PURE__ */ jsx(Upload, { className: "h-8 w-8 text-[hsl(var(--muted-foreground))]" }),
1188
+ /* @__PURE__ */ jsxs("div", { children: [
1189
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: "Drag files here or click to upload" }),
1190
+ maxSize && /* @__PURE__ */ jsxs("p", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: [
1191
+ "Max size: ",
1192
+ formatBytes(maxSize)
1193
+ ] })
1194
+ ] }),
1195
+ /* @__PURE__ */ jsx(
1196
+ "input",
1197
+ {
1198
+ ref: inputRef,
1199
+ type: "file",
1200
+ accept,
1201
+ multiple,
1202
+ className: "hidden",
1203
+ onChange: (e) => handleFiles(e.target.files),
1204
+ disabled
1205
+ }
1206
+ )
1207
+ ]
1208
+ }
1209
+ );
1210
+ }
1211
+ function FileUploadPreview({ files, onRemove, className }) {
1212
+ if (!files.length)
1213
+ return null;
1214
+ return /* @__PURE__ */ jsx("ul", { className: cn("flex flex-col gap-1", className), children: files.map((file, i) => /* @__PURE__ */ jsxs("li", { className: "flex items-center justify-between rounded-[var(--radius)] border border-[hsl(var(--border))] px-3 py-2 text-sm", children: [
1215
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate text-[hsl(var(--foreground))]", children: file.name }),
1216
+ /* @__PURE__ */ jsxs("div", { className: "ml-2 flex shrink-0 items-center gap-2", children: [
1217
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: formatBytes(file.size) }),
1218
+ /* @__PURE__ */ jsx(
1219
+ "button",
1220
+ {
1221
+ type: "button",
1222
+ onClick: () => onRemove(i),
1223
+ className: "text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--destructive))] transition-colors",
1224
+ children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
1225
+ }
1226
+ )
1227
+ ] })
1228
+ ] }, i)) });
1229
+ }
1230
+ var DAYS = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
1231
+ var MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
1232
+ function isSameDay(a, b) {
1233
+ return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
1234
+ }
1235
+ function getDaysInMonth(year, month) {
1236
+ return new Date(year, month + 1, 0).getDate();
1237
+ }
1238
+ function getFirstDayOfWeek(year, month) {
1239
+ return new Date(year, month, 1).getDay();
1240
+ }
1241
+ function CalendarGrid({ year, month, selected, onSelect }) {
1242
+ const today = /* @__PURE__ */ new Date();
1243
+ const daysInMonth = getDaysInMonth(year, month);
1244
+ const firstDay = getFirstDayOfWeek(year, month);
1245
+ const cells = Array.from({ length: firstDay + daysInMonth }, (_, i) => i < firstDay ? null : i - firstDay + 1);
1246
+ return /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-7 gap-0.5", children: [
1247
+ DAYS.map((d) => /* @__PURE__ */ jsx("div", { className: "py-1 text-center text-xs font-medium text-[hsl(var(--muted-foreground))]", children: d }, d)),
1248
+ cells.map((day, i) => {
1249
+ if (!day)
1250
+ return /* @__PURE__ */ jsx("div", {}, i);
1251
+ const date = new Date(year, month, day);
1252
+ const isToday = isSameDay(date, today);
1253
+ const isSelected = selected && isSameDay(date, selected);
1254
+ return /* @__PURE__ */ jsx(
1255
+ "button",
1256
+ {
1257
+ type: "button",
1258
+ onClick: () => onSelect(date),
1259
+ className: cn(
1260
+ "flex h-8 w-8 items-center justify-center rounded-[var(--radius)] text-sm transition-colors",
1261
+ isSelected && "bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]",
1262
+ !isSelected && isToday && "border border-[hsl(var(--primary))] text-[hsl(var(--primary))]",
1263
+ !isSelected && !isToday && "hover:bg-[hsl(var(--accent))]"
1264
+ ),
1265
+ children: day
1266
+ },
1267
+ i
1268
+ );
1269
+ })
1270
+ ] });
1271
+ }
1272
+ function DatePicker({ value, onChange, placeholder = "Pick a date", disabled, className }) {
1273
+ const [open, setOpen] = useState(false);
1274
+ const now = value ?? /* @__PURE__ */ new Date();
1275
+ const [view, setView] = useState({ year: now.getFullYear(), month: now.getMonth() });
1276
+ function navigate(delta) {
1277
+ setView((v) => {
1278
+ const date = new Date(v.year, v.month + delta);
1279
+ return { year: date.getFullYear(), month: date.getMonth() };
1280
+ });
1281
+ }
1282
+ function handleSelect(date) {
1283
+ onChange?.(date);
1284
+ setOpen(false);
1285
+ }
1286
+ return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
1287
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
1288
+ Button,
1289
+ {
1290
+ variant: "outline",
1291
+ disabled,
1292
+ className: cn("w-full justify-start font-normal", !value && "text-[hsl(var(--muted-foreground))]", className),
1293
+ children: [
1294
+ /* @__PURE__ */ jsx(Calendar, { className: "mr-2 h-4 w-4 shrink-0" }),
1295
+ value ? value.toLocaleDateString() : placeholder
1296
+ ]
1297
+ }
1298
+ ) }),
1299
+ /* @__PURE__ */ jsxs(PopoverContent, { className: "w-auto p-3", align: "start", children: [
1300
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
1301
+ /* @__PURE__ */ jsx("button", { type: "button", onClick: () => navigate(-1), className: "rounded p-1 hover:bg-[hsl(var(--accent))]", children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" }) }),
1302
+ /* @__PURE__ */ jsxs("span", { className: "text-sm font-medium", children: [
1303
+ MONTHS[view.month],
1304
+ " ",
1305
+ view.year
1306
+ ] }),
1307
+ /* @__PURE__ */ jsx("button", { type: "button", onClick: () => navigate(1), className: "rounded p-1 hover:bg-[hsl(var(--accent))]", children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" }) })
1308
+ ] }),
1309
+ /* @__PURE__ */ jsx(CalendarGrid, { year: view.year, month: view.month, selected: value, onSelect: handleSelect })
1310
+ ] })
1311
+ ] });
1312
+ }
1313
+ function FormField(props) {
1314
+ return /* @__PURE__ */ jsx(Controller, { ...props });
1315
+ }
1316
+ function FormItem({ className, ...props }) {
1317
+ return /* @__PURE__ */ jsx("div", { className: cn("flex flex-col gap-1.5", className), ...props });
1318
+ }
1319
+ var FormLabel = React14.forwardRef(
1320
+ ({ className, error, ...props }, ref) => /* @__PURE__ */ jsx(
1321
+ "label",
1322
+ {
1323
+ ref,
1324
+ className: cn(
1325
+ "text-sm font-medium leading-none",
1326
+ error ? "text-[hsl(var(--destructive))]" : "text-[hsl(var(--foreground))]",
1327
+ className
1328
+ ),
1329
+ ...props
1330
+ }
1331
+ )
1332
+ );
1333
+ FormLabel.displayName = "FormLabel";
1334
+ var FormControl = React14.forwardRef(
1335
+ ({ ...props }, ref) => {
1336
+ const id = useId();
1337
+ return /* @__PURE__ */ jsx("div", { ref, id, ...props });
1338
+ }
1339
+ );
1340
+ FormControl.displayName = "FormControl";
1341
+ function FormDescription({ className, ...props }) {
1342
+ return /* @__PURE__ */ jsx("p", { className: cn("text-xs text-[hsl(var(--muted-foreground))]", className), ...props });
1343
+ }
1344
+ function FormMessage({ className, children, name }) {
1345
+ const { formState } = useFormContext();
1346
+ const error = name ? formState.errors[name] : void 0;
1347
+ const message = error?.message ? String(error.message) : children;
1348
+ if (!message)
1349
+ return null;
1350
+ return /* @__PURE__ */ jsx("p", { className: cn("text-xs text-[hsl(var(--destructive))]", className), children: message });
1351
+ }
1352
+ var StepFormContext = createContext(null);
1353
+ function useStepForm() {
1354
+ const ctx = useContext(StepFormContext);
1355
+ if (!ctx)
1356
+ throw new Error("useStepForm must be used within StepForm");
1357
+ return ctx;
1358
+ }
1359
+ function StepForm({ steps, onSubmit, children, className }) {
1360
+ const [currentStep, setCurrentStep] = useState(0);
1361
+ const totalSteps = steps.length;
1362
+ const ctx = {
1363
+ currentStep,
1364
+ totalSteps,
1365
+ steps,
1366
+ next: () => setCurrentStep((s) => Math.min(s + 1, totalSteps - 1)),
1367
+ prev: () => setCurrentStep((s) => Math.max(s - 1, 0)),
1368
+ isFirst: currentStep === 0,
1369
+ isLast: currentStep === totalSteps - 1
1370
+ };
1371
+ const childArray = React14.Children.toArray(children);
1372
+ const currentChild = childArray[currentStep];
1373
+ return /* @__PURE__ */ jsx(StepFormContext.Provider, { value: ctx, children: /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-6", className), children: [
1374
+ /* @__PURE__ */ jsx(StepIndicator, { steps, currentStep }),
1375
+ /* @__PURE__ */ jsx("div", { children: currentChild }),
1376
+ /* @__PURE__ */ jsx(StepFormNavigation, { onSubmit })
1377
+ ] }) });
1378
+ }
1379
+ function StepIndicator({ steps, currentStep }) {
1380
+ return /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: steps.map((label, i) => /* @__PURE__ */ jsxs(React14.Fragment, { children: [
1381
+ i > 0 && /* @__PURE__ */ jsx("div", { className: cn("h-px flex-1 bg-[hsl(var(--border))]", i <= currentStep && "bg-[hsl(var(--primary))]") }),
1382
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-1", children: [
1383
+ /* @__PURE__ */ jsx("div", { className: cn(
1384
+ "flex h-7 w-7 items-center justify-center rounded-full text-xs font-medium border transition-colors",
1385
+ i < currentStep && "bg-[hsl(var(--primary))] border-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]",
1386
+ i === currentStep && "border-[hsl(var(--primary))] text-[hsl(var(--primary))]",
1387
+ i > currentStep && "border-[hsl(var(--border))] text-[hsl(var(--muted-foreground))]"
1388
+ ), children: i + 1 }),
1389
+ /* @__PURE__ */ jsx("span", { className: "hidden text-[10px] text-[hsl(var(--muted-foreground))] sm:block", children: label })
1390
+ ] })
1391
+ ] }, i)) });
1392
+ }
1393
+ function StepFormStep({ title, description, children }) {
1394
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
1395
+ /* @__PURE__ */ jsxs("div", { children: [
1396
+ /* @__PURE__ */ jsx("h3", { className: "text-base font-semibold text-[hsl(var(--foreground))]", children: title }),
1397
+ description && /* @__PURE__ */ jsx("p", { className: "text-sm text-[hsl(var(--muted-foreground))]", children: description })
1398
+ ] }),
1399
+ children
1400
+ ] });
1401
+ }
1402
+ function StepFormNavigation({ onSubmit, submitLabel = "Submit" }) {
1403
+ const { prev, next, isFirst, isLast } = useStepForm();
1404
+ return /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
1405
+ /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: prev, disabled: isFirst, children: "Previous" }),
1406
+ isLast ? /* @__PURE__ */ jsx(Button, { type: "button", onClick: onSubmit, children: submitLabel }) : /* @__PURE__ */ jsx(Button, { type: "button", onClick: next, children: "Next" })
1407
+ ] });
1408
+ }
1409
+ function ArrayField({
1410
+ value,
1411
+ onChange,
1412
+ renderItem,
1413
+ addLabel = "Add item",
1414
+ maxItems,
1415
+ defaultItem,
1416
+ className
1417
+ }) {
1418
+ function add() {
1419
+ if (maxItems && value.length >= maxItems)
1420
+ return;
1421
+ onChange([...value, defaultItem]);
1422
+ }
1423
+ function remove(index) {
1424
+ onChange(value.filter((_, i) => i !== index));
1425
+ }
1426
+ const atMax = maxItems !== void 0 && value.length >= maxItems;
1427
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-2", className), children: [
1428
+ value.map((item, i) => /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2", children: [
1429
+ /* @__PURE__ */ jsx("div", { className: "flex-1 min-w-0", children: renderItem(item, i, () => remove(i)) }),
1430
+ /* @__PURE__ */ jsx(
1431
+ "button",
1432
+ {
1433
+ type: "button",
1434
+ onClick: () => remove(i),
1435
+ className: "mt-2 shrink-0 text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--destructive))] transition-colors",
1436
+ children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
1437
+ }
1438
+ )
1439
+ ] }, i)),
1440
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
1441
+ /* @__PURE__ */ jsxs(Button, { type: "button", variant: "outline", size: "sm", onClick: add, disabled: atMax, children: [
1442
+ /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4" }),
1443
+ addLabel
1444
+ ] }),
1445
+ maxItems && /* @__PURE__ */ jsxs("span", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: [
1446
+ value.length,
1447
+ "/",
1448
+ maxItems
1449
+ ] })
1450
+ ] })
1451
+ ] });
1452
+ }
1453
+ function ObjectField({
1454
+ title,
1455
+ description,
1456
+ collapsible = false,
1457
+ defaultOpen = true,
1458
+ children,
1459
+ className
1460
+ }) {
1461
+ const [open, setOpen] = useState(defaultOpen);
1462
+ return /* @__PURE__ */ jsxs("div", { className: cn("rounded-[var(--radius)] border border-[hsl(var(--border))] overflow-hidden", className), children: [
1463
+ /* @__PURE__ */ jsxs(
1464
+ "div",
1465
+ {
1466
+ className: cn(
1467
+ "flex items-center justify-between px-4 py-3 bg-[hsl(var(--muted)/0.4)]",
1468
+ collapsible && "cursor-pointer hover:bg-[hsl(var(--accent))] transition-colors"
1469
+ ),
1470
+ onClick: () => collapsible && setOpen((o) => !o),
1471
+ role: collapsible ? "button" : void 0,
1472
+ tabIndex: collapsible ? 0 : void 0,
1473
+ onKeyDown: (e) => collapsible && e.key === "Enter" && setOpen((o) => !o),
1474
+ children: [
1475
+ /* @__PURE__ */ jsxs("div", { children: [
1476
+ /* @__PURE__ */ jsx("h4", { className: "text-sm font-semibold text-[hsl(var(--foreground))]", children: title }),
1477
+ description && /* @__PURE__ */ jsx("p", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: description })
1478
+ ] }),
1479
+ collapsible && (open ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 text-[hsl(var(--muted-foreground))]" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4 text-[hsl(var(--muted-foreground))]" }))
1480
+ ]
1481
+ }
1482
+ ),
1483
+ (!collapsible || open) && /* @__PURE__ */ jsx("div", { className: "p-4 flex flex-col gap-4", children })
1484
+ ] });
1485
+ }
1486
+ function toLabel(key) {
1487
+ return key.replace(/([A-Z])/g, " $1").replace(/^./, (s) => s.toUpperCase());
1488
+ }
1489
+ function getInputType(field) {
1490
+ if (field instanceof z.ZodEmail)
1491
+ return "email";
1492
+ if (field instanceof z.ZodURL)
1493
+ return "url";
1494
+ return "text";
1495
+ }
1496
+ function unwrapOptional(field) {
1497
+ if (field instanceof z.ZodOptional || field instanceof z.ZodNullable) {
1498
+ return unwrapOptional(field.unwrap());
1499
+ }
1500
+ return field;
1501
+ }
1502
+ function FieldRenderer({ name, field, register, setValue, watch, error }) {
1503
+ const inner = unwrapOptional(field);
1504
+ const label = toLabel(name);
1505
+ const isOptional = field instanceof z.ZodOptional;
1506
+ if (inner instanceof z.ZodBoolean) {
1507
+ const checked = Boolean(watch(name));
1508
+ return /* @__PURE__ */ jsx(Field, { label, error, children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1509
+ /* @__PURE__ */ jsx(
1510
+ Checkbox,
1511
+ {
1512
+ id: name,
1513
+ checked,
1514
+ onCheckedChange: (v) => setValue(name, v)
1515
+ }
1516
+ ),
1517
+ /* @__PURE__ */ jsx("label", { htmlFor: name, className: "text-sm text-[hsl(var(--foreground))]", children: label })
1518
+ ] }) });
1519
+ }
1520
+ if (inner instanceof z.ZodEnum) {
1521
+ const options = inner.options ?? [];
1522
+ const value = watch(name);
1523
+ return /* @__PURE__ */ jsx(Field, { label, required: !isOptional, error, children: /* @__PURE__ */ jsxs(Select, { value, onValueChange: (v) => setValue(name, v), children: [
1524
+ /* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, { placeholder: `Select ${label.toLowerCase()}` }) }),
1525
+ /* @__PURE__ */ jsx(SelectContent, { children: options.map((opt) => /* @__PURE__ */ jsx(SelectItem, { value: opt, children: opt }, opt)) })
1526
+ ] }) });
1527
+ }
1528
+ if (inner instanceof z.ZodDate) {
1529
+ const value = watch(name);
1530
+ return /* @__PURE__ */ jsx(Field, { label, required: !isOptional, error, children: /* @__PURE__ */ jsx(DatePicker, { value, onChange: (d) => setValue(name, d), placeholder: `Select ${label.toLowerCase()}` }) });
1531
+ }
1532
+ if (inner instanceof z.ZodNumber) {
1533
+ return /* @__PURE__ */ jsx(Field, { label, required: !isOptional, error, children: /* @__PURE__ */ jsx(Input, { type: "number", ...register(name, { valueAsNumber: true }) }) });
1534
+ }
1535
+ const inputType = getInputType(inner);
1536
+ return /* @__PURE__ */ jsx(Field, { label, required: !isOptional, error, children: /* @__PURE__ */ jsx(Input, { type: inputType, ...register(name) }) });
1537
+ }
1538
+ function AutoForm({ schema, onSubmit, defaultValues, submitLabel = "Submit" }) {
1539
+ const { register, handleSubmit, setValue, watch, formState } = useForm({
1540
+ resolver: zodResolver(schema),
1541
+ defaultValues
1542
+ });
1543
+ const shape = schema.shape;
1544
+ return /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit((d) => onSubmit(d)), className: "flex flex-col gap-4", children: [
1545
+ Object.entries(shape).map(([name, field]) => /* @__PURE__ */ jsx(
1546
+ FieldRenderer,
1547
+ {
1548
+ name,
1549
+ field,
1550
+ register,
1551
+ setValue,
1552
+ watch,
1553
+ error: formState.errors[name]?.message
1554
+ },
1555
+ name
1556
+ )),
1557
+ /* @__PURE__ */ jsx(Button, { type: "submit", children: submitLabel })
1558
+ ] });
1559
+ }
1560
+ function DataTableColumnHeader({ column, title }) {
1561
+ if (!column.getCanSort())
1562
+ return /* @__PURE__ */ jsx("span", { children: title });
1563
+ const sorted = column.getIsSorted();
1564
+ return /* @__PURE__ */ jsxs(
1565
+ "button",
1566
+ {
1567
+ onClick: () => column.toggleSorting(sorted === "asc"),
1568
+ className: "flex items-center gap-1 hover:text-[hsl(var(--foreground))]",
1569
+ children: [
1570
+ title,
1571
+ sorted === "asc" ? /* @__PURE__ */ jsx(ArrowUp, { className: "h-3 w-3" }) : sorted === "desc" ? /* @__PURE__ */ jsx(ArrowDown, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx(ArrowUpDown, { className: "h-3 w-3 opacity-50" })
1572
+ ]
1573
+ }
1574
+ );
1575
+ }
1576
+ function DataTablePagination({ table }) {
1577
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-2 py-3", children: [
1578
+ /* @__PURE__ */ jsxs("span", { className: "text-sm text-[hsl(var(--muted-foreground))]", children: [
1579
+ "Page ",
1580
+ table.getState().pagination.pageIndex + 1,
1581
+ " of ",
1582
+ table.getPageCount()
1583
+ ] }),
1584
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1585
+ /* @__PURE__ */ jsxs(
1586
+ Select,
1587
+ {
1588
+ value: String(table.getState().pagination.pageSize),
1589
+ onValueChange: (v) => table.setPageSize(Number(v)),
1590
+ children: [
1591
+ /* @__PURE__ */ jsx(SelectTrigger, { className: "h-8 w-[70px]", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
1592
+ /* @__PURE__ */ jsx(SelectContent, { children: [10, 20, 50].map((n) => /* @__PURE__ */ jsx(SelectItem, { value: String(n), children: n }, n)) })
1593
+ ]
1594
+ }
1595
+ ),
1596
+ /* @__PURE__ */ jsx(Button, { variant: "outline", size: "icon", className: "h-8 w-8", onClick: () => table.previousPage(), disabled: !table.getCanPreviousPage(), children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" }) }),
1597
+ /* @__PURE__ */ jsx(Button, { variant: "outline", size: "icon", className: "h-8 w-8", onClick: () => table.nextPage(), disabled: !table.getCanNextPage(), children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" }) })
1598
+ ] })
1599
+ ] });
1600
+ }
1601
+ function DataTableToolbar({ table, searchColumn }) {
1602
+ if (!searchColumn)
1603
+ return null;
1604
+ return /* @__PURE__ */ jsx("div", { className: "py-3", children: /* @__PURE__ */ jsx(
1605
+ Input,
1606
+ {
1607
+ placeholder: "Search...",
1608
+ value: table.getColumn(searchColumn)?.getFilterValue() ?? "",
1609
+ onChange: (e) => table.getColumn(searchColumn)?.setFilterValue(e.target.value),
1610
+ className: "max-w-sm h-8"
1611
+ }
1612
+ ) });
1613
+ }
1614
+ function DataTable({ columns, data, pageSize = 10, searchable, searchColumn, loading }) {
1615
+ const [sorting, setSorting] = React14.useState([]);
1616
+ const table = useReactTable({
1617
+ data,
1618
+ columns,
1619
+ getCoreRowModel: getCoreRowModel(),
1620
+ getPaginationRowModel: getPaginationRowModel(),
1621
+ getSortedRowModel: getSortedRowModel(),
1622
+ getFilteredRowModel: getFilteredRowModel(),
1623
+ onSortingChange: setSorting,
1624
+ initialState: { pagination: { pageSize } },
1625
+ state: { sorting }
1626
+ });
1627
+ if (loading)
1628
+ return /* @__PURE__ */ jsx("div", { className: "space-y-2", children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" }, i)) });
1629
+ return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
1630
+ searchable && /* @__PURE__ */ jsx(DataTableToolbar, { table, searchColumn }),
1631
+ /* @__PURE__ */ jsx("div", { className: "rounded-[var(--radius)] border border-[hsl(var(--border))] overflow-hidden", children: /* @__PURE__ */ jsxs("table", { className: "w-full text-sm", children: [
1632
+ /* @__PURE__ */ jsx("thead", { className: "bg-[hsl(var(--muted)/0.4)]", children: table.getHeaderGroups().map((hg) => /* @__PURE__ */ jsx("tr", { children: hg.headers.map((h) => /* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left font-medium text-[hsl(var(--muted-foreground))]", children: h.isPlaceholder ? null : flexRender(h.column.columnDef.header, h.getContext()) }, h.id)) }, hg.id)) }),
1633
+ /* @__PURE__ */ jsxs("tbody", { children: [
1634
+ table.getRowModel().rows.map((row, i) => /* @__PURE__ */ jsx("tr", { className: cn("border-t border-[hsl(var(--border))] hover:bg-[hsl(var(--muted)/0.3)] transition-colors", i % 2 === 0 ? "" : "bg-[hsl(var(--muted)/0.1)]"), children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx("td", { className: "px-4 py-3", children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)),
1635
+ table.getRowModel().rows.length === 0 && /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: columns.length, className: "px-4 py-8 text-center text-[hsl(var(--muted-foreground))]", children: "No results." }) })
1636
+ ] })
1637
+ ] }) }),
1638
+ /* @__PURE__ */ jsx(DataTablePagination, { table })
1639
+ ] });
1640
+ }
1641
+ function EditableCell({ value: initial, onSave }) {
1642
+ const [editing, setEditing] = React14.useState(false);
1643
+ const [val, setVal] = React14.useState(String(initial ?? ""));
1644
+ const commit = () => {
1645
+ onSave(val);
1646
+ setEditing(false);
1647
+ };
1648
+ if (editing) {
1649
+ return /* @__PURE__ */ jsx(
1650
+ "input",
1651
+ {
1652
+ autoFocus: true,
1653
+ className: "w-full bg-transparent outline outline-1 outline-[hsl(var(--ring))] rounded px-1 text-sm",
1654
+ value: val,
1655
+ onChange: (e) => setVal(e.target.value),
1656
+ onBlur: commit,
1657
+ onKeyDown: (e) => {
1658
+ if (e.key === "Enter")
1659
+ commit();
1660
+ if (e.key === "Escape")
1661
+ setEditing(false);
1662
+ }
1663
+ }
1664
+ );
1665
+ }
1666
+ return /* @__PURE__ */ jsx("span", { className: "cursor-pointer w-full block", onDoubleClick: () => setEditing(true), children: String(initial ?? "") });
1667
+ }
1668
+ var selectionCol = () => ({
1669
+ id: "_select",
1670
+ header: ({ table }) => /* @__PURE__ */ jsx(Checkbox, { checked: table.getIsAllRowsSelected(), onCheckedChange: (v) => table.toggleAllRowsSelected(!!v) }),
1671
+ cell: ({ row }) => /* @__PURE__ */ jsx(Checkbox, { checked: row.getIsSelected(), onCheckedChange: (v) => row.toggleSelected(!!v) }),
1672
+ size: 40,
1673
+ enableResizing: false
1674
+ });
1675
+ function DataGrid({ columns, data: initialData, onDataChange, editable, className }) {
1676
+ const [data, setData] = React14.useState(initialData);
1677
+ const [rowSelection, setRowSelection] = React14.useState({});
1678
+ const columnResizeMode = "onChange";
1679
+ const editableColumns = React14.useMemo(() => {
1680
+ if (!editable)
1681
+ return columns;
1682
+ return columns.map((col) => ({
1683
+ ...col,
1684
+ cell: (info) => /* @__PURE__ */ jsx(
1685
+ EditableCell,
1686
+ {
1687
+ value: info.getValue(),
1688
+ onSave: (v) => {
1689
+ const updated = data.map(
1690
+ (row, i) => i === info.row.index ? { ...row, [info.column.id]: v } : row
1691
+ );
1692
+ setData(updated);
1693
+ onDataChange?.(updated);
1694
+ }
1695
+ }
1696
+ )
1697
+ }));
1698
+ }, [columns, data, editable, onDataChange]);
1699
+ const allColumns = React14.useMemo(() => [selectionCol(), ...editableColumns], [editableColumns]);
1700
+ const table = useReactTable({
1701
+ data,
1702
+ columns: allColumns,
1703
+ columnResizeMode,
1704
+ getCoreRowModel: getCoreRowModel(),
1705
+ onRowSelectionChange: setRowSelection,
1706
+ state: { rowSelection },
1707
+ enableColumnResizing: true
1708
+ });
1709
+ return /* @__PURE__ */ jsx("div", { className: cn("overflow-auto rounded-[var(--radius)] border border-[hsl(var(--border))]", className), children: /* @__PURE__ */ jsxs("table", { className: "w-full text-sm", style: { width: table.getCenterTotalSize() }, children: [
1710
+ /* @__PURE__ */ jsx("thead", { className: "bg-[hsl(var(--muted)/0.4)]", children: table.getHeaderGroups().map((hg) => /* @__PURE__ */ jsx("tr", { children: hg.headers.map((h) => /* @__PURE__ */ jsxs("th", { style: { width: h.getSize() }, className: "relative px-3 py-2 text-left font-medium text-[hsl(var(--muted-foreground))] border-r border-[hsl(var(--border))] last:border-r-0", children: [
1711
+ h.isPlaceholder ? null : flexRender(h.column.columnDef.header, h.getContext()),
1712
+ h.column.getCanResize() && /* @__PURE__ */ jsx("div", { onMouseDown: h.getResizeHandler(), className: "absolute right-0 top-0 h-full w-1 cursor-col-resize hover:bg-[hsl(var(--primary)/0.4)]" })
1713
+ ] }, h.id)) }, hg.id)) }),
1714
+ /* @__PURE__ */ jsx("tbody", { children: table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx("tr", { className: cn("border-t border-[hsl(var(--border))] hover:bg-[hsl(var(--muted)/0.3)] transition-colors", row.getIsSelected() && "bg-[hsl(var(--primary)/0.06)]"), children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx("td", { style: { width: cell.column.getSize() }, className: "px-3 py-2 border-r border-[hsl(var(--border))] last:border-r-0", children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) })
1715
+ ] }) });
1716
+ }
1717
+ var EmptyStateIcon = React14.forwardRef(
1718
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("flex h-12 w-12 items-center justify-center rounded-full bg-[hsl(var(--muted))] text-[hsl(var(--muted-foreground))]", className), ...props })
1719
+ );
1720
+ EmptyStateIcon.displayName = "EmptyStateIcon";
1721
+ function EmptyState({ icon, title, description, action, className }) {
1722
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col items-center justify-center gap-3 py-12 text-center", className), children: [
1723
+ icon && /* @__PURE__ */ jsx(EmptyStateIcon, { children: icon }),
1724
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
1725
+ /* @__PURE__ */ jsx("h3", { className: "font-semibold text-[hsl(var(--foreground))]", children: title }),
1726
+ description && /* @__PURE__ */ jsx("p", { className: "text-sm text-[hsl(var(--muted-foreground))]", children: description })
1727
+ ] }),
1728
+ action && /* @__PURE__ */ jsx(Button, { onClick: action.onClick, className: "mt-1", children: action.label })
1729
+ ] });
1730
+ }
1731
+ var PropertyList = React14.forwardRef(
1732
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx("dl", { ref, className: cn("divide-y divide-[hsl(var(--border))]", className), ...props })
1733
+ );
1734
+ PropertyList.displayName = "PropertyList";
1735
+ function PropertyItem({ label, value, orientation = "horizontal", className }) {
1736
+ return /* @__PURE__ */ jsxs("div", { className: cn("py-3", orientation === "horizontal" ? "flex gap-4" : "space-y-1", className), children: [
1737
+ /* @__PURE__ */ jsx("dt", { className: cn("text-sm font-medium text-[hsl(var(--muted-foreground))] shrink-0", orientation === "horizontal" && "w-[40%]"), children: label }),
1738
+ /* @__PURE__ */ jsx("dd", { className: "text-sm text-[hsl(var(--foreground))] min-w-0", children: value })
1739
+ ] });
1740
+ }
1741
+ var dotColors = {
1742
+ default: "bg-[hsl(var(--primary))]",
1743
+ success: "bg-green-500",
1744
+ error: "bg-red-500",
1745
+ warning: "bg-yellow-500"
1746
+ };
1747
+ var TimelineContent = React14.forwardRef(
1748
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("pb-1", className), ...props })
1749
+ );
1750
+ TimelineContent.displayName = "TimelineContent";
1751
+ function TimelineConnector({ className }) {
1752
+ return /* @__PURE__ */ jsx("div", { className: cn("absolute left-[7px] top-5 bottom-0 w-0.5 bg-[hsl(var(--border))]", className) });
1753
+ }
1754
+ function TimelineItem({ icon, title, description, timestamp, variant = "default", isLast, className }) {
1755
+ return /* @__PURE__ */ jsxs("div", { className: cn("relative flex gap-4", !isLast && "pb-6", className), children: [
1756
+ /* @__PURE__ */ jsxs("div", { className: "relative flex-none", children: [
1757
+ /* @__PURE__ */ jsx("div", { className: cn("h-4 w-4 rounded-full border-2 border-[hsl(var(--background))] flex items-center justify-center mt-0.5", dotColors[variant]), children: icon && /* @__PURE__ */ jsx("span", { className: "text-white text-[8px]", children: icon }) }),
1758
+ !isLast && /* @__PURE__ */ jsx(TimelineConnector, {})
1759
+ ] }),
1760
+ /* @__PURE__ */ jsxs(TimelineContent, { children: [
1761
+ /* @__PURE__ */ jsxs("div", { className: "flex items-baseline justify-between gap-2", children: [
1762
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-[hsl(var(--foreground))]", children: title }),
1763
+ timestamp && /* @__PURE__ */ jsx("span", { className: "text-xs text-[hsl(var(--muted-foreground))] shrink-0", children: timestamp })
1764
+ ] }),
1765
+ description && /* @__PURE__ */ jsx("p", { className: "text-sm text-[hsl(var(--muted-foreground))] mt-0.5", children: description })
1766
+ ] })
1767
+ ] });
1768
+ }
1769
+ function Timeline({ children, className }) {
1770
+ const items = React14.Children.toArray(children);
1771
+ return /* @__PURE__ */ jsx("div", { className: cn("", className), children: items.map(
1772
+ (child, i) => React14.isValidElement(child) ? React14.cloneElement(child, { isLast: i === items.length - 1 }) : child
1773
+ ) });
1774
+ }
1775
+ function Stat({ label, value, trend, trendLabel, icon, description, className }) {
1776
+ const isPositive = trend !== void 0 && trend >= 0;
1777
+ return /* @__PURE__ */ jsx(Card, { className: cn("", className), children: /* @__PURE__ */ jsxs(CardContent, { className: "p-5", children: [
1778
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between", children: [
1779
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1 min-w-0", children: [
1780
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-[hsl(var(--muted-foreground))] truncate", children: label }),
1781
+ /* @__PURE__ */ jsx("p", { className: "text-2xl font-bold text-[hsl(var(--foreground))]", children: value })
1782
+ ] }),
1783
+ icon && /* @__PURE__ */ jsx("div", { className: "text-[hsl(var(--muted-foreground))] shrink-0 ml-2", children: icon })
1784
+ ] }),
1785
+ (trend !== void 0 || description) && /* @__PURE__ */ jsxs("div", { className: "mt-2 flex items-center gap-1", children: [
1786
+ trend !== void 0 && /* @__PURE__ */ jsxs("span", { className: cn("flex items-center gap-0.5 text-xs font-medium", isPositive ? "text-green-600" : "text-red-600"), children: [
1787
+ isPositive ? /* @__PURE__ */ jsx(TrendingUp, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx(TrendingDown, { className: "h-3 w-3" }),
1788
+ Math.abs(trend),
1789
+ "%"
1790
+ ] }),
1791
+ trendLabel && /* @__PURE__ */ jsx("span", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: trendLabel }),
1792
+ description && !trendLabel && /* @__PURE__ */ jsx("span", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: description })
1793
+ ] })
1794
+ ] }) });
1795
+ }
1796
+ function StatGroup({ className, ...props }) {
1797
+ return /* @__PURE__ */ jsx("div", { className: cn("grid gap-4", className), style: { gridTemplateColumns: "repeat(auto-fill, minmax(min(100%, 200px), 1fr))" }, ...props });
1798
+ }
1799
+ var sizeMap2 = {
1800
+ sm: { avatar: "h-7 w-7", name: "text-sm", subtitle: "text-xs" },
1801
+ md: { avatar: "h-9 w-9", name: "text-sm font-medium", subtitle: "text-xs" },
1802
+ lg: { avatar: "h-12 w-12", name: "text-base font-medium", subtitle: "text-sm" }
1803
+ };
1804
+ function Persona({ name, subtitle, src, size = "md", badge, className }) {
1805
+ const s = sizeMap2[size];
1806
+ const initials = name.split(" ").map((w) => w[0]).slice(0, 2).join("").toUpperCase();
1807
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-2.5", className), children: [
1808
+ /* @__PURE__ */ jsxs("div", { className: "relative shrink-0", children: [
1809
+ /* @__PURE__ */ jsxs(Avatar, { className: s.avatar, children: [
1810
+ src && /* @__PURE__ */ jsx(AvatarImage, { src, alt: name }),
1811
+ /* @__PURE__ */ jsx(AvatarFallback, { className: "text-xs", children: initials })
1812
+ ] }),
1813
+ badge && /* @__PURE__ */ jsx("div", { className: "absolute -bottom-0.5 -right-0.5", children: badge })
1814
+ ] }),
1815
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
1816
+ /* @__PURE__ */ jsx("p", { className: cn("truncate text-[hsl(var(--foreground))]", s.name), children: name }),
1817
+ subtitle && /* @__PURE__ */ jsx("p", { className: cn("truncate text-[hsl(var(--muted-foreground))]", s.subtitle), children: subtitle })
1818
+ ] })
1819
+ ] });
1820
+ }
1821
+ var colorMap = {
1822
+ default: "bg-[hsl(var(--muted))] text-[hsl(var(--muted-foreground))]",
1823
+ primary: "bg-[hsl(var(--primary)/0.12)] text-[hsl(var(--primary))]",
1824
+ success: "bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",
1825
+ warning: "bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400",
1826
+ error: "bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",
1827
+ purple: "bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400"
1828
+ };
1829
+ var sizeMap3 = {
1830
+ sm: "h-7 w-7 [&>*]:h-3.5 [&>*]:w-3.5",
1831
+ md: "h-10 w-10 [&>*]:h-5 [&>*]:w-5",
1832
+ lg: "h-14 w-14 [&>*]:h-7 [&>*]:w-7"
1833
+ };
1834
+ function IconBadge({ icon, color = "default", size = "md", className }) {
1835
+ return /* @__PURE__ */ jsx("div", { className: cn("inline-flex items-center justify-center rounded-full shrink-0", colorMap[color], sizeMap3[size], className), children: icon });
1836
+ }
1837
+ function StructuredListSection({ title, children, className }) {
1838
+ return /* @__PURE__ */ jsxs("div", { className: cn("", className), children: [
1839
+ title && /* @__PURE__ */ jsx("p", { className: "px-4 pb-1 pt-4 text-xs font-semibold uppercase tracking-wider text-[hsl(var(--muted-foreground))]", children: title }),
1840
+ /* @__PURE__ */ jsx("div", { className: "rounded-[var(--radius)] border border-[hsl(var(--border))] overflow-hidden divide-y divide-[hsl(var(--border))]", children })
1841
+ ] });
1842
+ }
1843
+ function StructuredListItem({ left, title, description, right, onClick, className }) {
1844
+ return /* @__PURE__ */ jsxs(
1845
+ "div",
1846
+ {
1847
+ onClick,
1848
+ className: cn("flex items-center gap-3 px-4 py-3 bg-[hsl(var(--card))]", onClick && "cursor-pointer hover:bg-[hsl(var(--muted)/0.5)] transition-colors", className),
1849
+ children: [
1850
+ left && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: left }),
1851
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
1852
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-[hsl(var(--foreground))] truncate", children: title }),
1853
+ description && /* @__PURE__ */ jsx("p", { className: "text-xs text-[hsl(var(--muted-foreground))] truncate", children: description })
1854
+ ] }),
1855
+ right && /* @__PURE__ */ jsx("div", { className: "shrink-0 text-[hsl(var(--muted-foreground))]", children: right })
1856
+ ]
1857
+ }
1858
+ );
1859
+ }
1860
+ var StructuredList = React14.forwardRef(
1861
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("space-y-4", className), ...props })
1862
+ );
1863
+ StructuredList.displayName = "StructuredList";
1864
+ function CommandItem({ icon, label, description, shortcut, active, onClick, className }) {
1865
+ return /* @__PURE__ */ jsxs(
1866
+ "div",
1867
+ {
1868
+ onClick,
1869
+ className: cn(
1870
+ "flex items-center gap-3 rounded-[var(--radius)] px-3 py-2 cursor-pointer transition-colors",
1871
+ active ? "bg-[hsl(var(--accent))] text-[hsl(var(--accent-foreground))]" : "hover:bg-[hsl(var(--accent)/0.6)]",
1872
+ className
1873
+ ),
1874
+ children: [
1875
+ icon && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-[hsl(var(--muted-foreground))] h-4 w-4 flex items-center justify-center", children: icon }),
1876
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
1877
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium truncate", children: label }),
1878
+ description && /* @__PURE__ */ jsx("p", { className: "text-xs text-[hsl(var(--muted-foreground))] truncate", children: description })
1879
+ ] }),
1880
+ shortcut && /* @__PURE__ */ jsx("kbd", { className: "shrink-0 pointer-events-none inline-flex h-5 items-center gap-1 rounded border border-[hsl(var(--border))] bg-[hsl(var(--muted))] px-1.5 text-[10px] font-medium text-[hsl(var(--muted-foreground))]", children: shortcut })
1881
+ ]
1882
+ }
1883
+ );
1884
+ }
1885
+ var bannerVariants = cva(
1886
+ "relative flex items-start gap-3 rounded-lg border px-4 py-3.5 text-sm transition-all",
1887
+ {
1888
+ variants: {
1889
+ variant: {
1890
+ info: "border-blue-200/80 bg-blue-50/60 dark:border-blue-800/60 dark:bg-blue-950/30",
1891
+ success: "border-green-200/80 bg-green-50/60 dark:border-green-800/60 dark:bg-green-950/30",
1892
+ warning: "border-yellow-200/80 bg-yellow-50/60 dark:border-yellow-800/60 dark:bg-yellow-950/30",
1893
+ error: "border-red-200/80 bg-red-50/60 dark:border-red-800/60 dark:bg-red-950/30",
1894
+ neutral: "border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.5)]"
1895
+ }
1896
+ },
1897
+ defaultVariants: { variant: "info" }
1898
+ }
1899
+ );
1900
+ var accentVariants = cva("absolute left-0 top-[12%] bottom-[12%] w-[3px] rounded-full", {
1901
+ variants: {
1902
+ variant: {
1903
+ info: "bg-blue-500",
1904
+ success: "bg-green-500",
1905
+ warning: "bg-yellow-500",
1906
+ error: "bg-red-500",
1907
+ neutral: "bg-[hsl(var(--foreground)/0.3)]"
1908
+ }
1909
+ },
1910
+ defaultVariants: { variant: "info" }
1911
+ });
1912
+ var iconVariants = cva("mt-0.5 h-4 w-4 shrink-0", {
1913
+ variants: {
1914
+ variant: {
1915
+ info: "text-blue-500 dark:text-blue-400",
1916
+ success: "text-green-500 dark:text-green-400",
1917
+ warning: "text-yellow-500 dark:text-yellow-400",
1918
+ error: "text-red-500 dark:text-red-400",
1919
+ neutral: "text-[hsl(var(--muted-foreground))]"
1920
+ }
1921
+ },
1922
+ defaultVariants: { variant: "info" }
1923
+ });
1924
+ var titleVariants = cva("font-semibold leading-snug", {
1925
+ variants: {
1926
+ variant: {
1927
+ info: "text-blue-900 dark:text-blue-100",
1928
+ success: "text-green-900 dark:text-green-100",
1929
+ warning: "text-yellow-900 dark:text-yellow-100",
1930
+ error: "text-red-900 dark:text-red-100",
1931
+ neutral: "text-[hsl(var(--foreground))]"
1932
+ }
1933
+ },
1934
+ defaultVariants: { variant: "info" }
1935
+ });
1936
+ var descriptionVariants = cva("mt-0.5 leading-snug opacity-80", {
1937
+ variants: {
1938
+ variant: {
1939
+ info: "text-blue-800 dark:text-blue-200",
1940
+ success: "text-green-800 dark:text-green-200",
1941
+ warning: "text-yellow-800 dark:text-yellow-200",
1942
+ error: "text-red-800 dark:text-red-200",
1943
+ neutral: "text-[hsl(var(--muted-foreground))]"
1944
+ }
1945
+ },
1946
+ defaultVariants: { variant: "info" }
1947
+ });
1948
+ var actionVariants = cva(
1949
+ "inline-flex items-center gap-1 text-xs font-medium underline-offset-2 hover:underline transition-opacity hover:opacity-80",
1950
+ {
1951
+ variants: {
1952
+ variant: {
1953
+ info: "text-blue-700 dark:text-blue-300",
1954
+ success: "text-green-700 dark:text-green-300",
1955
+ warning: "text-yellow-700 dark:text-yellow-300",
1956
+ error: "text-red-700 dark:text-red-300",
1957
+ neutral: "text-[hsl(var(--foreground))]"
1958
+ }
1959
+ },
1960
+ defaultVariants: { variant: "info" }
1961
+ }
1962
+ );
1963
+ var ICONS = {
1964
+ info: /* @__PURE__ */ jsx(Info, { className: "h-4 w-4" }),
1965
+ success: /* @__PURE__ */ jsx(CheckCircle2, { className: "h-4 w-4" }),
1966
+ warning: /* @__PURE__ */ jsx(AlertTriangle, { className: "h-4 w-4" }),
1967
+ error: /* @__PURE__ */ jsx(XCircle, { className: "h-4 w-4" }),
1968
+ neutral: /* @__PURE__ */ jsx(Info, { className: "h-4 w-4" })
1969
+ };
1970
+ function Banner({
1971
+ variant = "info",
1972
+ title,
1973
+ description,
1974
+ dismissible,
1975
+ onDismiss,
1976
+ action,
1977
+ icon = true,
1978
+ className,
1979
+ children
1980
+ }) {
1981
+ const [dismissed, setDismissed] = React14.useState(false);
1982
+ const [exiting, setExiting] = React14.useState(false);
1983
+ const handleDismiss = () => {
1984
+ setExiting(true);
1985
+ setTimeout(() => {
1986
+ setDismissed(true);
1987
+ onDismiss?.();
1988
+ }, 200);
1989
+ };
1990
+ if (dismissed)
1991
+ return null;
1992
+ return /* @__PURE__ */ jsxs(
1993
+ "div",
1994
+ {
1995
+ className: cn(
1996
+ bannerVariants({ variant }),
1997
+ "pl-[18px]",
1998
+ exiting && "opacity-0 translate-x-1 scale-[0.98]",
1999
+ "transition-all duration-200",
2000
+ className
2001
+ ),
2002
+ children: [
2003
+ /* @__PURE__ */ jsx("span", { className: accentVariants({ variant }), "aria-hidden": true }),
2004
+ icon && /* @__PURE__ */ jsx("span", { className: iconVariants({ variant }), children: ICONS[variant] }),
2005
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1 space-y-1", children: [
2006
+ title && /* @__PURE__ */ jsx("p", { className: cn(titleVariants({ variant }), "text-sm"), children: title }),
2007
+ description && /* @__PURE__ */ jsx("p", { className: cn(descriptionVariants({ variant }), "text-sm"), children: description }),
2008
+ children && /* @__PURE__ */ jsx("div", { className: cn(descriptionVariants({ variant }), "text-sm"), children }),
2009
+ action && /* @__PURE__ */ jsxs(
2010
+ "button",
2011
+ {
2012
+ onClick: action.onClick,
2013
+ className: cn(actionVariants({ variant }), "mt-1.5"),
2014
+ children: [
2015
+ action.label,
2016
+ action.icon !== false && /* @__PURE__ */ jsx(ArrowRight, { className: "h-3 w-3" })
2017
+ ]
2018
+ }
2019
+ )
2020
+ ] }),
2021
+ dismissible && /* @__PURE__ */ jsx(
2022
+ "button",
2023
+ {
2024
+ onClick: handleDismiss,
2025
+ "aria-label": "Dismiss",
2026
+ className: "shrink-0 rounded-md p-0.5 text-[hsl(var(--muted-foreground))] opacity-60 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--ring))]",
2027
+ children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
2028
+ }
2029
+ )
2030
+ ]
2031
+ }
2032
+ );
2033
+ }
2034
+ function Toaster(props) {
2035
+ const ctx = useBlinkUI?.();
2036
+ const dark = ctx?.darkMode === "dark";
2037
+ return /* @__PURE__ */ jsx(
2038
+ Toaster$1,
2039
+ {
2040
+ theme: dark ? "dark" : "light",
2041
+ position: "bottom-right",
2042
+ toastOptions: {
2043
+ classNames: {
2044
+ toast: [
2045
+ "group flex items-start gap-3 rounded-lg border px-4 py-3.5 text-sm shadow-md",
2046
+ "border-[hsl(var(--border))] bg-[hsl(var(--card))] text-[hsl(var(--card-foreground))]"
2047
+ ].join(" "),
2048
+ title: "font-semibold text-sm leading-snug",
2049
+ description: "text-xs text-[hsl(var(--muted-foreground))] mt-0.5 leading-snug",
2050
+ actionButton: [
2051
+ "mt-2 inline-flex items-center gap-1 text-xs font-medium",
2052
+ "text-[hsl(var(--primary))] underline-offset-2 hover:underline"
2053
+ ].join(" "),
2054
+ cancelButton: "mt-2 text-xs text-[hsl(var(--muted-foreground))] hover:opacity-80",
2055
+ closeButton: "text-[hsl(var(--muted-foreground))] opacity-60 hover:opacity-100 transition-opacity",
2056
+ error: "border-red-200/80 bg-red-50/60 dark:border-red-800/60 dark:bg-red-950/30",
2057
+ success: "border-green-200/80 bg-green-50/60 dark:border-green-800/60 dark:bg-green-950/30",
2058
+ warning: "border-yellow-200/80 bg-yellow-50/60 dark:border-yellow-800/60 dark:bg-yellow-950/30",
2059
+ info: "border-blue-200/80 bg-blue-50/60 dark:border-blue-800/60 dark:bg-blue-950/30"
2060
+ }
2061
+ },
2062
+ ...props
2063
+ }
2064
+ );
2065
+ }
2066
+ function LoadingOverlay({ loading, text, fullPage, children, className }) {
2067
+ if (fullPage) {
2068
+ return loading ? /* @__PURE__ */ jsx("div", { className: cn("fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm", className), children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-2", children: [
2069
+ /* @__PURE__ */ jsx(Loader2, { className: "h-8 w-8 animate-spin text-[hsl(var(--primary))]" }),
2070
+ text && /* @__PURE__ */ jsx("p", { className: "text-sm text-[hsl(var(--muted-foreground))]", children: text })
2071
+ ] }) }) : null;
2072
+ }
2073
+ return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
2074
+ children,
2075
+ loading && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 z-10 flex items-center justify-center rounded-[var(--radius)] bg-[hsl(var(--background)/0.8)] backdrop-blur-[2px]", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-2", children: [
2076
+ /* @__PURE__ */ jsx(Loader2, { className: "h-6 w-6 animate-spin text-[hsl(var(--primary))]" }),
2077
+ text && /* @__PURE__ */ jsx("p", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: text })
2078
+ ] }) })
2079
+ ] });
2080
+ }
2081
+ function StepperStep({ index, current, total, title, description }) {
2082
+ const done = index < current;
2083
+ const active = index === current;
2084
+ const isLast = index === total - 1;
2085
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3 flex-1 min-w-0", children: [
2086
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center shrink-0", children: [
2087
+ /* @__PURE__ */ jsx("div", { className: cn(
2088
+ "h-8 w-8 rounded-full flex items-center justify-center border-2 text-sm font-semibold transition-colors",
2089
+ done && "bg-[hsl(var(--primary))] border-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]",
2090
+ active && "border-[hsl(var(--primary))] text-[hsl(var(--primary))] bg-transparent",
2091
+ !done && !active && "border-[hsl(var(--muted-foreground)/0.4)] text-[hsl(var(--muted-foreground))] bg-transparent"
2092
+ ), children: done ? /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) : index + 1 }),
2093
+ !isLast && /* @__PURE__ */ jsx("div", { className: cn("w-0.5 flex-1 min-h-[16px] mt-1", done ? "bg-[hsl(var(--primary))]" : "bg-[hsl(var(--border))]") })
2094
+ ] }),
2095
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 pb-4", children: [
2096
+ /* @__PURE__ */ jsx("p", { className: cn("text-sm font-medium", active ? "text-[hsl(var(--foreground))]" : "text-[hsl(var(--muted-foreground))]"), children: title }),
2097
+ description && /* @__PURE__ */ jsx("p", { className: "text-xs text-[hsl(var(--muted-foreground))] mt-0.5", children: description })
2098
+ ] })
2099
+ ] });
2100
+ }
2101
+ function Stepper({ currentStep, steps, className }) {
2102
+ return /* @__PURE__ */ jsx("div", { className: cn("flex gap-0", className), children: steps.map((step, i) => /* @__PURE__ */ jsxs("div", { className: cn("flex items-start", i < steps.length - 1 && "flex-1"), children: [
2103
+ /* @__PURE__ */ jsx(StepperStep, { ...step, index: i, current: currentStep, total: steps.length }),
2104
+ i < steps.length - 1 && /* @__PURE__ */ jsx("div", { className: cn("flex-1 h-0.5 mt-4 mx-2", i < currentStep ? "bg-[hsl(var(--primary))]" : "bg-[hsl(var(--border))]") })
2105
+ ] }, i)) });
2106
+ }
2107
+ function BreadcrumbItem({ href, label, active, className }) {
2108
+ return /* @__PURE__ */ jsx("li", { className: cn("flex items-center", className), children: href && !active ? /* @__PURE__ */ jsx("a", { href, className: "text-sm text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] transition-colors", children: label }) : /* @__PURE__ */ jsx("span", { className: "text-sm text-[hsl(var(--foreground))] font-medium", children: label }) });
2109
+ }
2110
+ function BreadcrumbPage({ children, className }) {
2111
+ return /* @__PURE__ */ jsx("li", { "aria-current": "page", className: cn("flex items-center text-sm font-medium text-[hsl(var(--foreground))]", className), children });
2112
+ }
2113
+ function BreadcrumbSeparator({ className }) {
2114
+ return /* @__PURE__ */ jsx("li", { role: "presentation", "aria-hidden": "true", className: cn("flex items-center text-[hsl(var(--muted-foreground))]", className), children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-3.5 w-3.5" }) });
2115
+ }
2116
+ function Breadcrumb({ children, className }) {
2117
+ const items = React14.Children.toArray(children);
2118
+ const withSeparators = [];
2119
+ items.forEach((item, i) => {
2120
+ withSeparators.push(item);
2121
+ if (i < items.length - 1)
2122
+ withSeparators.push(/* @__PURE__ */ jsx(BreadcrumbSeparator, {}, `sep-${i}`));
2123
+ });
2124
+ return /* @__PURE__ */ jsx("nav", { "aria-label": "breadcrumb", children: /* @__PURE__ */ jsx("ol", { className: cn("flex flex-wrap items-center gap-1", className), children: withSeparators }) });
2125
+ }
2126
+ function HotkeyBadge({ children, className }) {
2127
+ return /* @__PURE__ */ jsx("kbd", { className: cn(
2128
+ "inline-flex items-center justify-center rounded border border-[hsl(var(--border))] bg-[hsl(var(--muted))] px-1.5 py-0.5 text-[11px] font-medium text-[hsl(var(--muted-foreground))] shadow-[0_1px_0_rgba(0,0,0,0.1)] min-w-[20px] h-5",
2129
+ className
2130
+ ), children });
2131
+ }
2132
+ function Hotkeys({ keys, className }) {
2133
+ return /* @__PURE__ */ jsx("span", { className: cn("inline-flex items-center gap-0.5", className), children: keys.map((key, i) => /* @__PURE__ */ jsx(HotkeyBadge, { children: key }, i)) });
2134
+ }
2135
+ var textOps = ["contains", "equals", "starts with"];
2136
+ var numOps = ["=", ">", "<", ">=", "<="];
2137
+ function AddFilterPopover({ filters, onAdd }) {
2138
+ const [open, setOpen] = React14.useState(false);
2139
+ const [key, setKey] = React14.useState("");
2140
+ const [op, setOp] = React14.useState("");
2141
+ const [val, setVal] = React14.useState("");
2142
+ const def = filters.find((f) => f.key === key);
2143
+ const ops = def?.type === "number" ? numOps : textOps;
2144
+ const handleAdd = () => {
2145
+ if (!key || !val)
2146
+ return;
2147
+ onAdd({ key, operator: op || ops[0], value: val });
2148
+ setKey("");
2149
+ setOp("");
2150
+ setVal("");
2151
+ setOpen(false);
2152
+ };
2153
+ return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
2154
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", className: "h-7 gap-1 text-xs", children: [
2155
+ /* @__PURE__ */ jsx(Plus, { className: "h-3.5 w-3.5" }),
2156
+ "Add Filter"
2157
+ ] }) }),
2158
+ /* @__PURE__ */ jsxs(PopoverContent, { className: "w-72 p-3 space-y-2", children: [
2159
+ /* @__PURE__ */ jsxs(Select, { value: key, onValueChange: setKey, children: [
2160
+ /* @__PURE__ */ jsx(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Field" }) }),
2161
+ /* @__PURE__ */ jsx(SelectContent, { children: filters.map((f) => /* @__PURE__ */ jsx(SelectItem, { value: f.key, children: f.label }, f.key)) })
2162
+ ] }),
2163
+ key && /* @__PURE__ */ jsxs(Select, { value: op || ops[0], onValueChange: setOp, children: [
2164
+ /* @__PURE__ */ jsx(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
2165
+ /* @__PURE__ */ jsx(SelectContent, { children: ops.map((o) => /* @__PURE__ */ jsx(SelectItem, { value: o, children: o }, o)) })
2166
+ ] }),
2167
+ key && def?.type === "select" ? /* @__PURE__ */ jsxs(Select, { value: val, onValueChange: setVal, children: [
2168
+ /* @__PURE__ */ jsx(SelectTrigger, { className: "h-8 text-xs", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Value" }) }),
2169
+ /* @__PURE__ */ jsx(SelectContent, { children: def.options?.map((o) => /* @__PURE__ */ jsx(SelectItem, { value: o.value, children: o.label }, o.value)) })
2170
+ ] }) : key && /* @__PURE__ */ jsx(Input, { type: def?.type === "number" ? "number" : def?.type === "date" ? "date" : "text", className: "h-8 text-xs", value: val, onChange: (e) => setVal(e.target.value), placeholder: "Value" }),
2171
+ /* @__PURE__ */ jsx(Button, { size: "sm", className: "w-full h-7 text-xs", onClick: handleAdd, disabled: !key || !val, children: "Apply" })
2172
+ ] })
2173
+ ] });
2174
+ }
2175
+ function FilterBadge({ filter, def, onRemove }) {
2176
+ return /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--muted))] px-2.5 py-0.5 text-xs font-medium text-[hsl(var(--foreground))]", children: [
2177
+ /* @__PURE__ */ jsx("span", { className: "text-[hsl(var(--muted-foreground))]", children: def?.label ?? filter.key }),
2178
+ /* @__PURE__ */ jsx("span", { children: filter.operator }),
2179
+ /* @__PURE__ */ jsx("span", { className: "font-semibold", children: filter.value }),
2180
+ /* @__PURE__ */ jsx("button", { onClick: onRemove, className: "ml-0.5 rounded-full hover:text-[hsl(var(--destructive))]", children: /* @__PURE__ */ jsx(X, { className: "h-3 w-3" }) })
2181
+ ] });
2182
+ }
2183
+ function Filters({ filters, value, onChange, className }) {
2184
+ const remove = (i) => onChange(value.filter((_, idx) => idx !== i));
2185
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-wrap items-center gap-2", className), children: [
2186
+ value.map((fv, i) => /* @__PURE__ */ jsx(FilterBadge, { filter: fv, def: filters.find((f) => f.key === fv.key), onRemove: () => remove(i) }, i)),
2187
+ /* @__PURE__ */ jsx(AddFilterPopover, { filters, onAdd: (fv) => onChange([...value, fv]) })
2188
+ ] });
2189
+ }
2190
+ function BulkActions({ count, actions, onClear, className }) {
2191
+ if (count === 0)
2192
+ return null;
2193
+ return /* @__PURE__ */ jsxs("div", { className: cn("fixed bottom-6 left-1/2 -translate-x-1/2 z-50 flex items-center gap-2 rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--card))] px-4 py-2 shadow-lg", className), children: [
2194
+ /* @__PURE__ */ jsxs("span", { className: "text-sm font-medium text-[hsl(var(--foreground))] pr-2 border-r border-[hsl(var(--border))]", children: [
2195
+ count,
2196
+ " selected"
2197
+ ] }),
2198
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", children: actions.map((action, i) => /* @__PURE__ */ jsxs(
2199
+ Button,
2200
+ {
2201
+ variant: action.variant === "destructive" ? "destructive" : "ghost",
2202
+ size: "sm",
2203
+ className: "h-7 gap-1.5 text-xs rounded-full px-3",
2204
+ onClick: action.onClick,
2205
+ children: [
2206
+ action.icon,
2207
+ action.label
2208
+ ]
2209
+ },
2210
+ i
2211
+ )) }),
2212
+ /* @__PURE__ */ jsx("button", { onClick: onClear, className: "ml-1 rounded-full p-0.5 text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] transition-colors", children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }) })
2213
+ ] });
2214
+ }
2215
+ function ToggleButton({ pressed, onClick, disabled, children, className }) {
2216
+ return /* @__PURE__ */ jsx(
2217
+ "button",
2218
+ {
2219
+ type: "button",
2220
+ "aria-pressed": pressed,
2221
+ disabled,
2222
+ onClick,
2223
+ className: cn(
2224
+ "inline-flex items-center justify-center gap-1.5 rounded-[var(--radius)] px-3 py-1.5 text-sm font-medium transition-colors border",
2225
+ "disabled:pointer-events-none disabled:opacity-50",
2226
+ pressed ? "bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))] border-[hsl(var(--primary))]" : "bg-transparent text-[hsl(var(--foreground))] border-[hsl(var(--border))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))]",
2227
+ className
2228
+ ),
2229
+ children
2230
+ }
2231
+ );
2232
+ }
2233
+ function ToggleButtonGroup(props) {
2234
+ const { children, className } = props;
2235
+ const isPressed = (val) => props.type === "multiple" ? props.value.includes(val) : props.value === val;
2236
+ const handleClick = (val) => {
2237
+ if (props.type === "multiple") {
2238
+ const current = props.value;
2239
+ props.onChange(current.includes(val) ? current.filter((v) => v !== val) : [...current, val]);
2240
+ } else {
2241
+ props.onChange(val);
2242
+ }
2243
+ };
2244
+ return /* @__PURE__ */ jsx("div", { className: cn("inline-flex items-center gap-1 rounded-[var(--radius)] border border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.4)] p-0.5", className), children: React14.Children.map(children, (child) => {
2245
+ if (!React14.isValidElement(child))
2246
+ return child;
2247
+ const tb = child;
2248
+ return React14.cloneElement(tb, {
2249
+ pressed: isPressed(tb.props.value),
2250
+ onClick: () => handleClick(tb.props.value)
2251
+ });
2252
+ }) });
2253
+ }
2254
+ function useCommandBar() {
2255
+ const [open, setOpen] = React14.useState(false);
2256
+ React14.useEffect(() => {
2257
+ const handler = (e) => {
2258
+ if ((e.metaKey || e.ctrlKey) && e.key === "k") {
2259
+ e.preventDefault();
2260
+ setOpen((o) => !o);
2261
+ }
2262
+ };
2263
+ window.addEventListener("keydown", handler);
2264
+ return () => window.removeEventListener("keydown", handler);
2265
+ }, []);
2266
+ return { open, setOpen };
2267
+ }
2268
+ function CommandBarEmpty({ children = "No results found." }) {
2269
+ return /* @__PURE__ */ jsx("div", { className: "py-6 text-center text-sm text-[hsl(var(--muted-foreground))]", children });
2270
+ }
2271
+ function CommandBarGroup({ heading, children }) {
2272
+ return /* @__PURE__ */ jsxs("div", { className: "px-2 py-1", children: [
2273
+ /* @__PURE__ */ jsx("p", { className: "mb-1 px-2 text-xs font-semibold text-[hsl(var(--muted-foreground))]", children: heading }),
2274
+ children
2275
+ ] });
2276
+ }
2277
+ function CommandBarItem({ icon, label, shortcut, onSelect, active, className }) {
2278
+ return /* @__PURE__ */ jsxs(
2279
+ "button",
2280
+ {
2281
+ onClick: onSelect,
2282
+ className: cn(
2283
+ "flex w-full items-center gap-2.5 rounded-[var(--radius)] px-3 py-2 text-sm transition-colors",
2284
+ active ? "bg-[hsl(var(--accent))] text-[hsl(var(--accent-foreground))]" : "hover:bg-[hsl(var(--accent)/0.6)]",
2285
+ className
2286
+ ),
2287
+ children: [
2288
+ icon && /* @__PURE__ */ jsx("span", { className: "h-4 w-4 shrink-0 text-[hsl(var(--muted-foreground))]", children: icon }),
2289
+ /* @__PURE__ */ jsx("span", { className: "flex-1 text-left truncate", children: label }),
2290
+ shortcut && /* @__PURE__ */ jsx("kbd", { className: "pointer-events-none shrink-0 inline-flex h-5 items-center rounded border border-[hsl(var(--border))] bg-[hsl(var(--muted))] px-1.5 text-[10px] font-medium text-[hsl(var(--muted-foreground))]", children: shortcut })
2291
+ ]
2292
+ }
2293
+ );
2294
+ }
2295
+ function CommandBar({ open, onOpenChange, children, placeholder = "Search commands...", onSearch }) {
2296
+ const [query, setQuery] = React14.useState("");
2297
+ const handleSearch = (v) => {
2298
+ setQuery(v);
2299
+ onSearch?.(v);
2300
+ };
2301
+ const items = React14.useRef(null);
2302
+ const handleKeyDown = (e) => {
2303
+ if (e.key === "Escape") {
2304
+ onOpenChange(false);
2305
+ return;
2306
+ }
2307
+ const focusable = items.current?.querySelectorAll("button");
2308
+ if (!focusable?.length)
2309
+ return;
2310
+ const arr = Array.from(focusable);
2311
+ const idx = arr.indexOf(document.activeElement);
2312
+ if (e.key === "ArrowDown") {
2313
+ e.preventDefault();
2314
+ arr[(idx + 1) % arr.length]?.focus();
2315
+ }
2316
+ if (e.key === "ArrowUp") {
2317
+ e.preventDefault();
2318
+ arr[(idx - 1 + arr.length) % arr.length]?.focus();
2319
+ }
2320
+ };
2321
+ return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs(DialogContent, { className: "p-0 gap-0 max-w-lg overflow-hidden", onKeyDown: handleKeyDown, children: [
2322
+ /* @__PURE__ */ jsx(DialogTitle, { className: "sr-only", children: "Command Bar" }),
2323
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 border-b border-[hsl(var(--border))] px-4 py-3", children: [
2324
+ /* @__PURE__ */ jsx(Search, { className: "h-4 w-4 shrink-0 text-[hsl(var(--muted-foreground))]" }),
2325
+ /* @__PURE__ */ jsx(
2326
+ "input",
2327
+ {
2328
+ autoFocus: true,
2329
+ className: "flex-1 bg-transparent text-sm outline-none placeholder:text-[hsl(var(--muted-foreground))]",
2330
+ placeholder,
2331
+ value: query,
2332
+ onChange: (e) => handleSearch(e.target.value)
2333
+ }
2334
+ ),
2335
+ query && /* @__PURE__ */ jsx("button", { onClick: () => handleSearch(""), className: "text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))]", children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }) })
2336
+ ] }),
2337
+ /* @__PURE__ */ jsx("div", { ref: items, className: "max-h-80 overflow-y-auto py-2", children })
2338
+ ] }) });
2339
+ }
2340
+ function KanbanCard({ card, isDragging }) {
2341
+ const { attributes, listeners, setNodeRef, transform, transition } = useSortable({ id: card.id });
2342
+ const style = { transform: CSS.Transform.toString(transform), transition };
2343
+ return /* @__PURE__ */ jsxs(
2344
+ "div",
2345
+ {
2346
+ ref: setNodeRef,
2347
+ style,
2348
+ ...attributes,
2349
+ ...listeners,
2350
+ className: cn("rounded-[var(--radius)] border border-[hsl(var(--border))] bg-[hsl(var(--card))] p-3 cursor-grab active:cursor-grabbing select-none", isDragging && "shadow-lg opacity-80"),
2351
+ children: [
2352
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
2353
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-[hsl(var(--foreground))] leading-tight", children: card.title }),
2354
+ card.badge && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-[10px] px-1.5 py-0.5 rounded-full bg-[hsl(var(--primary)/0.1)] text-[hsl(var(--primary))] font-medium", children: card.badge })
2355
+ ] }),
2356
+ card.description && /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-[hsl(var(--muted-foreground))] line-clamp-2", children: card.description })
2357
+ ]
2358
+ }
2359
+ );
2360
+ }
2361
+ function KanbanColumn({ column, isOver }) {
2362
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex w-64 shrink-0 flex-col gap-2 rounded-[var(--radius)] bg-[hsl(var(--muted)/0.4)] p-3 transition-colors", isOver && "bg-[hsl(var(--muted)/0.7)]"), children: [
2363
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
2364
+ /* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-[hsl(var(--foreground))]", children: column.title }),
2365
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-[hsl(var(--muted-foreground))] bg-[hsl(var(--muted))] rounded-full px-2 py-0.5", children: column.cards.length })
2366
+ ] }),
2367
+ /* @__PURE__ */ jsx(SortableContext, { items: column.cards.map((c) => c.id), strategy: verticalListSortingStrategy, children: /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2 min-h-[60px]", children: column.cards.map((card) => /* @__PURE__ */ jsx(KanbanCard, { card }, card.id)) }) })
2368
+ ] });
2369
+ }
2370
+ function Kanban({ columns: initialColumns, onMoveCard, className }) {
2371
+ const [cols, setCols] = React14.useState(initialColumns);
2372
+ const [activeCard, setActiveCard] = React14.useState(null);
2373
+ const [overColId, setOverColId] = React14.useState(null);
2374
+ const sensors = useSensors(useSensor(PointerSensor, { activationConstraint: { distance: 5 } }));
2375
+ const findColByCard = (cardId) => cols.find((c) => c.cards.some((card) => card.id === cardId));
2376
+ const onDragStart = ({ active }) => {
2377
+ const col = findColByCard(active.id);
2378
+ setActiveCard(col?.cards.find((c) => c.id === active.id) ?? null);
2379
+ };
2380
+ const onDragOver = ({ over }) => {
2381
+ if (!over) {
2382
+ setOverColId(null);
2383
+ return;
2384
+ }
2385
+ const colId = cols.find((c) => c.id === over.id)?.id ?? findColByCard(over.id)?.id ?? null;
2386
+ setOverColId(colId);
2387
+ };
2388
+ const onDragEnd = ({ active, over }) => {
2389
+ setActiveCard(null);
2390
+ setOverColId(null);
2391
+ if (!over || active.id === over.id)
2392
+ return;
2393
+ const fromCol = findColByCard(active.id);
2394
+ const toCol = cols.find((c) => c.id === over.id) ?? findColByCard(over.id);
2395
+ if (!fromCol || !toCol || fromCol.id === toCol.id)
2396
+ return;
2397
+ const card = fromCol.cards.find((c) => c.id === active.id);
2398
+ setCols((prev) => prev.map((c) => {
2399
+ if (c.id === fromCol.id)
2400
+ return { ...c, cards: c.cards.filter((card2) => card2.id !== active.id) };
2401
+ if (c.id === toCol.id)
2402
+ return { ...c, cards: [...c.cards, card] };
2403
+ return c;
2404
+ }));
2405
+ onMoveCard?.(active.id, fromCol.id, toCol.id);
2406
+ };
2407
+ return /* @__PURE__ */ jsxs(DndContext, { sensors, onDragStart, onDragOver, onDragEnd, children: [
2408
+ /* @__PURE__ */ jsx("div", { className: cn("flex gap-4 overflow-x-auto pb-4", className), children: cols.map((col) => /* @__PURE__ */ jsx(KanbanColumn, { column: col, isOver: overColId === col.id }, col.id)) }),
2409
+ /* @__PURE__ */ jsx(DragOverlay, { children: activeCard && /* @__PURE__ */ jsx(KanbanCard, { card: activeCard, isDragging: true }) })
2410
+ ] });
2411
+ }
2412
+ var DEFAULT_COLORS = [
2413
+ "hsl(var(--primary))",
2414
+ "hsl(217 91% 60%)",
2415
+ "hsl(142 71% 45%)",
2416
+ "hsl(38 92% 50%)",
2417
+ "hsl(280 65% 60%)"
2418
+ ];
2419
+ function AreaChart({
2420
+ data,
2421
+ dataKey,
2422
+ xAxisKey = "name",
2423
+ height = 300,
2424
+ colors = DEFAULT_COLORS,
2425
+ showGrid = true,
2426
+ showTooltip = true,
2427
+ showLegend = false,
2428
+ curved = true,
2429
+ className
2430
+ }) {
2431
+ const keys = Array.isArray(dataKey) ? dataKey : [dataKey];
2432
+ const curve = curved ? "monotone" : "linear";
2433
+ return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxs(AreaChart$1, { data, margin: { top: 4, right: 4, left: -20, bottom: 0 }, children: [
2434
+ showGrid && /* @__PURE__ */ jsx(CartesianGrid, { strokeDasharray: "3 3", stroke: "hsl(var(--border))" }),
2435
+ /* @__PURE__ */ jsx(XAxis, { dataKey: xAxisKey, tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false }),
2436
+ /* @__PURE__ */ jsx(YAxis, { tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false }),
2437
+ showTooltip && /* @__PURE__ */ jsx(
2438
+ Tooltip$1,
2439
+ {
2440
+ contentStyle: {
2441
+ background: "hsl(var(--card))",
2442
+ border: "1px solid hsl(var(--border))",
2443
+ borderRadius: "var(--radius)",
2444
+ fontSize: 12
2445
+ }
2446
+ }
2447
+ ),
2448
+ showLegend && /* @__PURE__ */ jsx(Legend, { wrapperStyle: { fontSize: 12 } }),
2449
+ keys.map((key, i) => /* @__PURE__ */ jsx(
2450
+ Area,
2451
+ {
2452
+ type: curve,
2453
+ dataKey: key,
2454
+ stroke: colors[i % colors.length],
2455
+ fill: colors[i % colors.length],
2456
+ fillOpacity: 0.15,
2457
+ strokeWidth: 2
2458
+ },
2459
+ key
2460
+ ))
2461
+ ] }) }) });
2462
+ }
2463
+ var DEFAULT_COLORS2 = [
2464
+ "hsl(var(--primary))",
2465
+ "hsl(217 91% 60%)",
2466
+ "hsl(142 71% 45%)",
2467
+ "hsl(38 92% 50%)",
2468
+ "hsl(280 65% 60%)"
2469
+ ];
2470
+ function BarChart({
2471
+ data,
2472
+ dataKey,
2473
+ xAxisKey = "name",
2474
+ height = 300,
2475
+ colors = DEFAULT_COLORS2,
2476
+ showGrid = true,
2477
+ showTooltip = true,
2478
+ showLegend = false,
2479
+ layout = "horizontal",
2480
+ stacked = false,
2481
+ className
2482
+ }) {
2483
+ const keys = Array.isArray(dataKey) ? dataKey : [dataKey];
2484
+ const isVertical = layout === "vertical";
2485
+ return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxs(BarChart$1, { data, layout, margin: { top: 4, right: 4, left: -20, bottom: 0 }, children: [
2486
+ showGrid && /* @__PURE__ */ jsx(CartesianGrid, { strokeDasharray: "3 3", stroke: "hsl(var(--border))" }),
2487
+ isVertical ? /* @__PURE__ */ jsxs(Fragment, { children: [
2488
+ /* @__PURE__ */ jsx(XAxis, { type: "number", tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false }),
2489
+ /* @__PURE__ */ jsx(YAxis, { type: "category", dataKey: xAxisKey, tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false })
2490
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
2491
+ /* @__PURE__ */ jsx(XAxis, { dataKey: xAxisKey, tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false }),
2492
+ /* @__PURE__ */ jsx(YAxis, { tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false })
2493
+ ] }),
2494
+ showTooltip && /* @__PURE__ */ jsx(
2495
+ Tooltip$1,
2496
+ {
2497
+ contentStyle: {
2498
+ background: "hsl(var(--card))",
2499
+ border: "1px solid hsl(var(--border))",
2500
+ borderRadius: "var(--radius)",
2501
+ fontSize: 12
2502
+ }
2503
+ }
2504
+ ),
2505
+ showLegend && /* @__PURE__ */ jsx(Legend, { wrapperStyle: { fontSize: 12 } }),
2506
+ keys.map((key, i) => /* @__PURE__ */ jsx(
2507
+ Bar,
2508
+ {
2509
+ dataKey: key,
2510
+ fill: colors[i % colors.length],
2511
+ radius: isVertical ? [0, 4, 4, 0] : [4, 4, 0, 0],
2512
+ stackId: stacked ? "stack" : void 0
2513
+ },
2514
+ key
2515
+ ))
2516
+ ] }) }) });
2517
+ }
2518
+ var DEFAULT_COLORS3 = [
2519
+ "hsl(var(--primary))",
2520
+ "hsl(217 91% 60%)",
2521
+ "hsl(142 71% 45%)",
2522
+ "hsl(38 92% 50%)",
2523
+ "hsl(280 65% 60%)"
2524
+ ];
2525
+ function LineChart({
2526
+ data,
2527
+ dataKey,
2528
+ xAxisKey = "name",
2529
+ height = 300,
2530
+ colors = DEFAULT_COLORS3,
2531
+ showGrid = true,
2532
+ showTooltip = true,
2533
+ showLegend = false,
2534
+ curved = true,
2535
+ dotted = false,
2536
+ strokeWidth = 2,
2537
+ className
2538
+ }) {
2539
+ const keys = Array.isArray(dataKey) ? dataKey : [dataKey];
2540
+ const curve = curved ? "monotone" : "linear";
2541
+ const dash = dotted ? "4 4" : void 0;
2542
+ return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxs(LineChart$1, { data, margin: { top: 4, right: 4, left: -20, bottom: 0 }, children: [
2543
+ showGrid && /* @__PURE__ */ jsx(CartesianGrid, { strokeDasharray: "3 3", stroke: "hsl(var(--border))" }),
2544
+ /* @__PURE__ */ jsx(XAxis, { dataKey: xAxisKey, tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false }),
2545
+ /* @__PURE__ */ jsx(YAxis, { tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false }),
2546
+ showTooltip && /* @__PURE__ */ jsx(
2547
+ Tooltip$1,
2548
+ {
2549
+ contentStyle: {
2550
+ background: "hsl(var(--card))",
2551
+ border: "1px solid hsl(var(--border))",
2552
+ borderRadius: "var(--radius)",
2553
+ fontSize: 12
2554
+ }
2555
+ }
2556
+ ),
2557
+ showLegend && /* @__PURE__ */ jsx(Legend, { wrapperStyle: { fontSize: 12 } }),
2558
+ keys.map((key, i) => /* @__PURE__ */ jsx(
2559
+ Line,
2560
+ {
2561
+ type: curve,
2562
+ dataKey: key,
2563
+ stroke: colors[i % colors.length],
2564
+ strokeWidth,
2565
+ strokeDasharray: dash,
2566
+ dot: false,
2567
+ activeDot: { r: 4 }
2568
+ },
2569
+ key
2570
+ ))
2571
+ ] }) }) });
2572
+ }
2573
+ function buildPath(data, w, h) {
2574
+ if (data.length < 2)
2575
+ return "";
2576
+ const min = Math.min(...data);
2577
+ const max = Math.max(...data);
2578
+ const range = max - min || 1;
2579
+ const pad = 2;
2580
+ const points = data.map((v, i) => {
2581
+ const x = pad + i / (data.length - 1) * (w - pad * 2);
2582
+ const y = pad + (1 - (v - min) / range) * (h - pad * 2);
2583
+ return `${x},${y}`;
2584
+ });
2585
+ return `M ${points.join(" L ")}`;
2586
+ }
2587
+ function Sparkline({
2588
+ data,
2589
+ type = "line",
2590
+ color = "hsl(var(--primary))",
2591
+ height = 32,
2592
+ width = 100,
2593
+ className
2594
+ }) {
2595
+ const path = buildPath(data, width, height);
2596
+ if (!path)
2597
+ return null;
2598
+ const min = Math.min(...data);
2599
+ const max = Math.max(...data);
2600
+ const range = max - min || 1;
2601
+ const pad = 2;
2602
+ const lastY = pad + (1 - (data[data.length - 1] - min) / range) * (height - pad * 2);
2603
+ const areaPath = type === "area" ? `${path} L ${width - pad},${height - pad} L ${pad},${height - pad} Z` : void 0;
2604
+ return /* @__PURE__ */ jsxs(
2605
+ "svg",
2606
+ {
2607
+ width,
2608
+ height,
2609
+ viewBox: `0 0 ${width} ${height}`,
2610
+ className,
2611
+ style: { display: "inline-block", verticalAlign: "middle" },
2612
+ children: [
2613
+ type === "area" && areaPath && /* @__PURE__ */ jsx("path", { d: areaPath, fill: color, fillOpacity: 0.15, stroke: "none" }),
2614
+ /* @__PURE__ */ jsx("path", { d: path, fill: "none", stroke: color, strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }),
2615
+ /* @__PURE__ */ jsx("circle", { cx: width - pad, cy: lastY, r: 2, fill: color })
2616
+ ]
2617
+ }
2618
+ );
2619
+ }
2620
+ var colorMap2 = {
2621
+ primary: "bg-[hsl(var(--primary))]",
2622
+ success: "bg-green-500",
2623
+ warning: "bg-yellow-500",
2624
+ error: "bg-red-500"
2625
+ };
2626
+ var sizeMap4 = {
2627
+ sm: "h-1.5 w-1.5",
2628
+ md: "h-2.5 w-2.5",
2629
+ lg: "h-3.5 w-3.5"
2630
+ };
2631
+ function BeaconDot({ color = "primary", size = "md" }) {
2632
+ return /* @__PURE__ */ jsxs("span", { className: "relative flex", children: [
2633
+ /* @__PURE__ */ jsx("span", { className: cn("animate-ping absolute inline-flex h-full w-full rounded-full opacity-75", colorMap2[color]) }),
2634
+ /* @__PURE__ */ jsx("span", { className: cn("relative inline-flex rounded-full", sizeMap4[size], colorMap2[color]) })
2635
+ ] });
2636
+ }
2637
+ function Beacon({ color = "primary", size = "md", children, className }) {
2638
+ if (!children) {
2639
+ return /* @__PURE__ */ jsx("span", { className: cn("inline-flex", className), children: /* @__PURE__ */ jsx(BeaconDot, { color, size }) });
2640
+ }
2641
+ return /* @__PURE__ */ jsxs("span", { className: cn("relative inline-flex", className), children: [
2642
+ children,
2643
+ /* @__PURE__ */ jsx("span", { className: "absolute -top-1 -right-1 flex", children: /* @__PURE__ */ jsx(BeaconDot, { color, size }) })
2644
+ ] });
2645
+ }
2646
+ var TourContext = createContext(null);
2647
+ function useTour() {
2648
+ const ctx = useContext(TourContext);
2649
+ if (!ctx)
2650
+ throw new Error("useTour must be used within <Tour>");
2651
+ return ctx;
2652
+ }
2653
+ function Tour({ totalSteps, children }) {
2654
+ const [currentStep, setCurrentStep] = useState(0);
2655
+ const [isActive, setIsActive] = useState(false);
2656
+ const stop = useCallback(() => setIsActive(false), []);
2657
+ const start = useCallback(() => {
2658
+ setCurrentStep(0);
2659
+ setIsActive(true);
2660
+ }, []);
2661
+ const next = useCallback(() => setCurrentStep((s) => Math.min(s + 1, totalSteps - 1)), [totalSteps]);
2662
+ const prev = useCallback(() => setCurrentStep((s) => Math.max(s - 1, 0)), []);
2663
+ const goTo = useCallback((step) => setCurrentStep(Math.max(0, Math.min(step, totalSteps - 1))), [totalSteps]);
2664
+ useEffect(() => {
2665
+ if (!isActive)
2666
+ return;
2667
+ const onKey = (e) => {
2668
+ if (e.key === "Escape")
2669
+ stop();
2670
+ if (e.key === "ArrowRight")
2671
+ next();
2672
+ if (e.key === "ArrowLeft")
2673
+ prev();
2674
+ };
2675
+ window.addEventListener("keydown", onKey);
2676
+ return () => window.removeEventListener("keydown", onKey);
2677
+ }, [isActive, stop, next, prev]);
2678
+ return /* @__PURE__ */ jsx(TourContext.Provider, { value: { currentStep, totalSteps, isActive, start, stop, next, prev, goTo }, children });
2679
+ }
2680
+ var placementClasses = {
2681
+ top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
2682
+ bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
2683
+ left: "right-full top-1/2 -translate-y-1/2 mr-2",
2684
+ right: "left-full top-1/2 -translate-y-1/2 ml-2"
2685
+ };
2686
+ function TourStep({ step, title, description, placement = "bottom", children }) {
2687
+ const { currentStep, isActive, stop, next, prev, totalSteps } = useTour();
2688
+ const active = isActive && currentStep === step;
2689
+ const isLast = step === totalSteps - 1;
2690
+ return /* @__PURE__ */ jsxs("span", { className: "relative inline-block", children: [
2691
+ active && /* @__PURE__ */ jsx(
2692
+ "span",
2693
+ {
2694
+ className: "fixed inset-0 z-40 pointer-events-none",
2695
+ style: { boxShadow: "0 0 0 9999px rgba(0,0,0,0.5)" }
2696
+ }
2697
+ ),
2698
+ /* @__PURE__ */ jsx("span", { className: cn("relative", active && "z-50 ring-2 ring-[hsl(var(--primary))] ring-offset-2 rounded-[var(--radius)]"), children }),
2699
+ active && /* @__PURE__ */ jsxs("div", { className: cn("absolute z-50 w-64 rounded-[var(--radius)] border border-[hsl(var(--border))] bg-[hsl(var(--card))] p-4 shadow-lg", placementClasses[placement]), children: [
2700
+ /* @__PURE__ */ jsx("p", { className: "font-semibold text-sm mb-1", children: title }),
2701
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-[hsl(var(--muted-foreground))] mb-3", children: description }),
2702
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
2703
+ /* @__PURE__ */ jsxs("span", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: [
2704
+ step + 1,
2705
+ " / ",
2706
+ totalSteps
2707
+ ] }),
2708
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-1.5", children: [
2709
+ step > 0 && /* @__PURE__ */ jsx(Button, { size: "sm", variant: "outline", onClick: prev, children: "Back" }),
2710
+ isLast ? /* @__PURE__ */ jsx(Button, { size: "sm", onClick: stop, children: "Done" }) : /* @__PURE__ */ jsx(Button, { size: "sm", onClick: next, children: "Next" })
2711
+ ] })
2712
+ ] })
2713
+ ] })
2714
+ ] });
2715
+ }
2716
+ var NAV_ITEMS = [
2717
+ { icon: LayoutDashboard, label: "Dashboard", active: true },
2718
+ { icon: FolderOpen, label: "Projects" },
2719
+ { icon: Users, label: "Team" },
2720
+ { icon: Settings, label: "Settings" }
2721
+ ];
2722
+ function NavItem({ icon: Icon2, label, active }) {
2723
+ return /* @__PURE__ */ jsxs("button", { className: cn(
2724
+ "flex w-full items-center gap-3 rounded-md px-3 py-2 text-sm transition-colors",
2725
+ active ? "bg-[hsl(var(--accent))] text-[hsl(var(--accent-foreground))] font-medium" : "text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))]"
2726
+ ), children: [
2727
+ /* @__PURE__ */ jsx(Icon2, { className: "h-4 w-4 shrink-0" }),
2728
+ label
2729
+ ] });
2730
+ }
2731
+ function SidebarLayoutMinimal({
2732
+ brandName = "Acme Inc",
2733
+ pageTitle = "Dashboard",
2734
+ children,
2735
+ className
2736
+ }) {
2737
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex h-[600px] overflow-hidden rounded-[var(--radius)] border border-[hsl(var(--border))] bg-[hsl(var(--background))]", className), children: [
2738
+ /* @__PURE__ */ jsxs("aside", { className: "flex w-60 flex-col border-r border-[hsl(var(--border))] bg-[hsl(var(--card))]", children: [
2739
+ /* @__PURE__ */ jsx("div", { className: "flex h-14 items-center px-4 font-semibold text-sm", children: brandName }),
2740
+ /* @__PURE__ */ jsx(Separator4, {}),
2741
+ /* @__PURE__ */ jsx("nav", { className: "flex-1 space-y-0.5 p-2", children: NAV_ITEMS.map((item) => /* @__PURE__ */ jsx(NavItem, { ...item }, item.label)) }),
2742
+ /* @__PURE__ */ jsx(Separator4, {}),
2743
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 p-4", children: [
2744
+ /* @__PURE__ */ jsx(Avatar, { className: "h-8 w-8", children: /* @__PURE__ */ jsx(AvatarFallback, { className: "text-xs", children: "JD" }) }),
2745
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
2746
+ /* @__PURE__ */ jsx("p", { className: "truncate text-sm font-medium", children: "Jane Doe" }),
2747
+ /* @__PURE__ */ jsx("p", { className: "truncate text-xs text-[hsl(var(--muted-foreground))]", children: "jane@acme.com" })
2748
+ ] })
2749
+ ] })
2750
+ ] }),
2751
+ /* @__PURE__ */ jsxs("main", { className: "flex flex-1 flex-col overflow-auto", children: [
2752
+ /* @__PURE__ */ jsx("header", { className: "flex h-14 items-center border-b border-[hsl(var(--border))] px-6", children: /* @__PURE__ */ jsx("h1", { className: "text-sm font-semibold", children: pageTitle }) }),
2753
+ /* @__PURE__ */ jsx("div", { className: "flex-1 p-6 text-sm text-[hsl(var(--muted-foreground))]", children: children ?? "Page content goes here." })
2754
+ ] })
2755
+ ] });
2756
+ }
2757
+ var NAV_GROUPS = [
2758
+ {
2759
+ label: "Main",
2760
+ items: [{ icon: LayoutDashboard, label: "Dashboard", active: true }, { icon: BarChart2, label: "Analytics" }]
2761
+ },
2762
+ {
2763
+ label: "Management",
2764
+ items: [{ icon: FolderOpen, label: "Projects" }, { icon: Users, label: "Team" }, { icon: CreditCard, label: "Billing" }]
2765
+ },
2766
+ {
2767
+ label: "Account",
2768
+ items: [{ icon: Settings, label: "Settings" }, { icon: HelpCircle, label: "Help" }]
2769
+ }
2770
+ ];
2771
+ function NavItem2({ icon: Icon2, label, active }) {
2772
+ return /* @__PURE__ */ jsxs("button", { className: cn(
2773
+ "flex w-full items-center gap-3 rounded-md px-3 py-2 text-sm transition-colors",
2774
+ active ? "bg-[hsl(var(--accent))] text-[hsl(var(--accent-foreground))] font-medium" : "text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))]"
2775
+ ), children: [
2776
+ /* @__PURE__ */ jsx(Icon2, { className: "h-4 w-4 shrink-0" }),
2777
+ label
2778
+ ] });
2779
+ }
2780
+ function SidebarLayoutGroups({
2781
+ brandName = "Acme Inc",
2782
+ pageTitle = "Dashboard",
2783
+ children,
2784
+ className
2785
+ }) {
2786
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex h-[600px] overflow-hidden rounded-[var(--radius)] border border-[hsl(var(--border))] bg-[hsl(var(--background))]", className), children: [
2787
+ /* @__PURE__ */ jsxs("aside", { className: "flex w-60 flex-col border-r border-[hsl(var(--border))] bg-[hsl(var(--card))]", children: [
2788
+ /* @__PURE__ */ jsx("div", { className: "flex h-14 items-center px-4 font-semibold text-sm", children: brandName }),
2789
+ /* @__PURE__ */ jsx(Separator4, {}),
2790
+ /* @__PURE__ */ jsx("nav", { className: "flex-1 overflow-auto p-2 space-y-4", children: NAV_GROUPS.map((group) => /* @__PURE__ */ jsxs("div", { children: [
2791
+ /* @__PURE__ */ jsx("p", { className: "mb-1 px-3 text-[10px] font-semibold uppercase tracking-wider text-[hsl(var(--muted-foreground))]", children: group.label }),
2792
+ /* @__PURE__ */ jsx("div", { className: "space-y-0.5", children: group.items.map((item) => /* @__PURE__ */ jsx(NavItem2, { ...item }, item.label)) })
2793
+ ] }, group.label)) })
2794
+ ] }),
2795
+ /* @__PURE__ */ jsxs("main", { className: "flex flex-1 flex-col overflow-auto", children: [
2796
+ /* @__PURE__ */ jsx("header", { className: "flex h-14 items-center border-b border-[hsl(var(--border))] px-6", children: /* @__PURE__ */ jsx("h1", { className: "text-sm font-semibold", children: pageTitle }) }),
2797
+ /* @__PURE__ */ jsx("div", { className: "flex-1 p-6 text-sm text-[hsl(var(--muted-foreground))]", children: children ?? "Page content goes here." })
2798
+ ] })
2799
+ ] });
2800
+ }
2801
+ var NAV_ITEMS2 = [
2802
+ { icon: LayoutDashboard, label: "Dashboard", active: true },
2803
+ { icon: FolderOpen, label: "Projects" },
2804
+ { icon: Users, label: "Team" },
2805
+ { icon: Bell, label: "Notifications", badge: "3" },
2806
+ { icon: Settings, label: "Settings" }
2807
+ ];
2808
+ function NavItem3({ icon: Icon2, label, active, badge }) {
2809
+ return /* @__PURE__ */ jsxs("button", { className: cn(
2810
+ "flex w-full items-center gap-3 rounded-md px-3 py-2 text-sm transition-colors",
2811
+ active ? "bg-[hsl(var(--accent))] text-[hsl(var(--accent-foreground))] font-medium" : "text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))]"
2812
+ ), children: [
2813
+ /* @__PURE__ */ jsx(Icon2, { className: "h-4 w-4 shrink-0" }),
2814
+ /* @__PURE__ */ jsx("span", { className: "flex-1 text-left", children: label }),
2815
+ badge && /* @__PURE__ */ jsx(Badge, { className: "text-[10px] px-1.5 py-0.5 shrink-0", children: badge })
2816
+ ] });
2817
+ }
2818
+ function SidebarLayoutUser({
2819
+ userName = "Jane Doe",
2820
+ userEmail = "jane@acme.com",
2821
+ userRole = "Admin",
2822
+ pageTitle = "Dashboard",
2823
+ children,
2824
+ className
2825
+ }) {
2826
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex h-[600px] overflow-hidden rounded-[var(--radius)] border border-[hsl(var(--border))] bg-[hsl(var(--background))]", className), children: [
2827
+ /* @__PURE__ */ jsxs("aside", { className: "flex w-60 flex-col border-r border-[hsl(var(--border))] bg-[hsl(var(--card))]", children: [
2828
+ /* @__PURE__ */ jsx("div", { className: "p-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 rounded-[var(--radius)] bg-[hsl(var(--accent))] p-3", children: [
2829
+ /* @__PURE__ */ jsx(Avatar, { className: "h-9 w-9", children: /* @__PURE__ */ jsx(AvatarFallback, { className: "text-xs", children: userName.slice(0, 2).toUpperCase() }) }),
2830
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
2831
+ /* @__PURE__ */ jsx("p", { className: "truncate text-sm font-semibold", children: userName }),
2832
+ /* @__PURE__ */ jsx("p", { className: "truncate text-xs text-[hsl(var(--muted-foreground))]", children: userRole })
2833
+ ] })
2834
+ ] }) }),
2835
+ /* @__PURE__ */ jsx(Separator4, {}),
2836
+ /* @__PURE__ */ jsx("nav", { className: "flex-1 space-y-0.5 p-2", children: NAV_ITEMS2.map((item) => /* @__PURE__ */ jsx(NavItem3, { ...item }, item.label)) }),
2837
+ /* @__PURE__ */ jsx(Separator4, {}),
2838
+ /* @__PURE__ */ jsx("p", { className: "p-4 text-xs text-[hsl(var(--muted-foreground))] truncate", children: userEmail })
2839
+ ] }),
2840
+ /* @__PURE__ */ jsxs("main", { className: "flex flex-1 flex-col overflow-auto", children: [
2841
+ /* @__PURE__ */ jsx("header", { className: "flex h-14 items-center border-b border-[hsl(var(--border))] px-6", children: /* @__PURE__ */ jsx("h1", { className: "text-sm font-semibold", children: pageTitle }) }),
2842
+ /* @__PURE__ */ jsx("div", { className: "flex-1 p-6 text-sm text-[hsl(var(--muted-foreground))]", children: children ?? "Page content goes here." })
2843
+ ] })
2844
+ ] });
2845
+ }
2846
+ var ALL_ITEMS = [
2847
+ { icon: LayoutDashboard, label: "Dashboard", active: true },
2848
+ { icon: BarChart2, label: "Analytics" },
2849
+ { icon: FolderOpen, label: "Projects" },
2850
+ { icon: Users, label: "Team" },
2851
+ { icon: Bell, label: "Notifications" },
2852
+ { icon: Settings, label: "Settings" }
2853
+ ];
2854
+ function NavItem4({ icon: Icon2, label, active }) {
2855
+ return /* @__PURE__ */ jsxs("button", { className: cn(
2856
+ "flex w-full items-center gap-3 rounded-md px-3 py-2 text-sm transition-colors",
2857
+ active ? "bg-[hsl(var(--accent))] text-[hsl(var(--accent-foreground))] font-medium" : "text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))]"
2858
+ ), children: [
2859
+ /* @__PURE__ */ jsx(Icon2, { className: "h-4 w-4 shrink-0" }),
2860
+ label
2861
+ ] });
2862
+ }
2863
+ function SidebarLayoutSearch({
2864
+ brandName = "Acme Inc",
2865
+ pageTitle = "Dashboard",
2866
+ children,
2867
+ className
2868
+ }) {
2869
+ const [query, setQuery] = useState("");
2870
+ const filtered = ALL_ITEMS.filter((i) => i.label.toLowerCase().includes(query.toLowerCase()));
2871
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex h-[600px] overflow-hidden rounded-[var(--radius)] border border-[hsl(var(--border))] bg-[hsl(var(--background))]", className), children: [
2872
+ /* @__PURE__ */ jsxs("aside", { className: "flex w-60 flex-col border-r border-[hsl(var(--border))] bg-[hsl(var(--card))]", children: [
2873
+ /* @__PURE__ */ jsx("div", { className: "flex h-14 items-center px-4 font-semibold text-sm", children: brandName }),
2874
+ /* @__PURE__ */ jsx(Separator4, {}),
2875
+ /* @__PURE__ */ jsx("div", { className: "p-2", children: /* @__PURE__ */ jsx(
2876
+ Input,
2877
+ {
2878
+ placeholder: "Search...",
2879
+ value: query,
2880
+ onChange: (e) => setQuery(e.target.value),
2881
+ className: "h-8 text-sm"
2882
+ }
2883
+ ) }),
2884
+ /* @__PURE__ */ jsx("nav", { className: "flex-1 space-y-0.5 overflow-auto p-2", children: filtered.length > 0 ? filtered.map((item) => /* @__PURE__ */ jsx(NavItem4, { ...item }, item.label)) : /* @__PURE__ */ jsx("p", { className: "px-3 py-2 text-xs text-[hsl(var(--muted-foreground))]", children: "No results" }) })
2885
+ ] }),
2886
+ /* @__PURE__ */ jsxs("main", { className: "flex flex-1 flex-col overflow-auto", children: [
2887
+ /* @__PURE__ */ jsx("header", { className: "flex h-14 items-center border-b border-[hsl(var(--border))] px-6", children: /* @__PURE__ */ jsx("h1", { className: "text-sm font-semibold", children: pageTitle }) }),
2888
+ /* @__PURE__ */ jsx("div", { className: "flex-1 p-6 text-sm text-[hsl(var(--muted-foreground))]", children: children ?? "Page content goes here." })
2889
+ ] })
2890
+ ] });
2891
+ }
2892
+ var NAV_ITEMS3 = [
2893
+ { icon: LayoutDashboard, label: "Dashboard", active: true },
2894
+ { icon: FolderOpen, label: "Projects" },
2895
+ { icon: Users, label: "Team" },
2896
+ { icon: Settings, label: "Settings" }
2897
+ ];
2898
+ var KPIS = [
2899
+ { label: "Total Revenue", value: "$48,295", change: "+12.5%" },
2900
+ { label: "Active Users", value: "2,847", change: "+8.3%" },
2901
+ { label: "New Orders", value: "384", change: "+3.1%" },
2902
+ { label: "Conversion", value: "3.24%", change: "-0.4%" }
2903
+ ];
2904
+ var TABLE_ROWS = [
2905
+ { name: "Alpha Project", status: "Active", team: "Design", progress: 72 },
2906
+ { name: "Beta Launch", status: "Review", team: "Engineering", progress: 45 },
2907
+ { name: "Gamma Research", status: "Active", team: "Product", progress: 89 }
2908
+ ];
2909
+ function NavItem5({ icon: Icon2, label, active }) {
2910
+ return /* @__PURE__ */ jsxs("button", { className: cn(
2911
+ "flex w-full items-center gap-3 rounded-md px-3 py-2 text-sm transition-colors",
2912
+ active ? "bg-[hsl(var(--accent))] font-medium" : "text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))]"
2913
+ ), children: [
2914
+ /* @__PURE__ */ jsx(Icon2, { className: "h-4 w-4 shrink-0" }),
2915
+ label
2916
+ ] });
2917
+ }
2918
+ function SidebarLayoutDashboard({ className }) {
2919
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex h-[600px] overflow-hidden rounded-[var(--radius)] border border-[hsl(var(--border))] bg-[hsl(var(--background))]", className), children: [
2920
+ /* @__PURE__ */ jsxs("aside", { className: "flex w-56 flex-col border-r border-[hsl(var(--border))] bg-[hsl(var(--card))]", children: [
2921
+ /* @__PURE__ */ jsx("div", { className: "flex h-12 items-center px-4 font-semibold text-sm", children: "Acme Inc" }),
2922
+ /* @__PURE__ */ jsx(Separator4, {}),
2923
+ /* @__PURE__ */ jsx("nav", { className: "flex-1 space-y-0.5 p-2", children: NAV_ITEMS3.map((i) => /* @__PURE__ */ jsx(NavItem5, { ...i }, i.label)) }),
2924
+ /* @__PURE__ */ jsx(Separator4, {}),
2925
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 p-3", children: [
2926
+ /* @__PURE__ */ jsx(Avatar, { className: "h-7 w-7", children: /* @__PURE__ */ jsx(AvatarFallback, { className: "text-xs", children: "JD" }) }),
2927
+ /* @__PURE__ */ jsx("span", { className: "truncate text-xs font-medium", children: "Jane Doe" })
2928
+ ] })
2929
+ ] }),
2930
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
2931
+ /* @__PURE__ */ jsxs("header", { className: "flex h-12 items-center justify-between border-b border-[hsl(var(--border))] px-4", children: [
2932
+ /* @__PURE__ */ jsx("h1", { className: "text-sm font-semibold", children: "Dashboard" }),
2933
+ /* @__PURE__ */ jsxs("button", { className: "relative", children: [
2934
+ /* @__PURE__ */ jsx(Bell, { className: "h-4 w-4" }),
2935
+ /* @__PURE__ */ jsx("span", { className: "absolute -top-1 -right-1 h-2 w-2 rounded-full bg-[hsl(var(--primary))]" })
2936
+ ] })
2937
+ ] }),
2938
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-auto p-4 space-y-4", children: [
2939
+ /* @__PURE__ */ jsx("div", { className: "grid gap-3", style: { gridTemplateColumns: "repeat(auto-fill, minmax(min(100%,130px),1fr))" }, children: KPIS.map((k) => /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(CardContent, { className: "p-3", children: [
2940
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: k.label }),
2941
+ /* @__PURE__ */ jsx("p", { className: "text-lg font-bold mt-0.5", children: k.value }),
2942
+ /* @__PURE__ */ jsxs("p", { className: cn("text-xs flex items-center gap-0.5 mt-0.5", k.change.startsWith("+") ? "text-green-600" : "text-red-500"), children: [
2943
+ /* @__PURE__ */ jsx(TrendingUp, { className: "h-3 w-3" }),
2944
+ k.change
2945
+ ] })
2946
+ ] }) }, k.label)) }),
2947
+ /* @__PURE__ */ jsx("div", { className: "rounded-[var(--radius)] border border-[hsl(var(--border))]", children: /* @__PURE__ */ jsxs("table", { className: "w-full text-xs", children: [
2948
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { className: "border-b border-[hsl(var(--border))]", children: ["Project", "Status", "Team", "Progress"].map((h) => /* @__PURE__ */ jsx("th", { className: "px-3 py-2 text-left font-medium text-[hsl(var(--muted-foreground))]", children: h }, h)) }) }),
2949
+ /* @__PURE__ */ jsx("tbody", { children: TABLE_ROWS.map((r) => /* @__PURE__ */ jsxs("tr", { className: "border-b border-[hsl(var(--border))] last:border-0", children: [
2950
+ /* @__PURE__ */ jsx("td", { className: "px-3 py-2 font-medium", children: r.name }),
2951
+ /* @__PURE__ */ jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "text-[10px]", children: r.status }) }),
2952
+ /* @__PURE__ */ jsx("td", { className: "px-3 py-2 text-[hsl(var(--muted-foreground))]", children: r.team }),
2953
+ /* @__PURE__ */ jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsx("div", { className: "h-1.5 w-20 rounded-full bg-[hsl(var(--muted))]", children: /* @__PURE__ */ jsx("div", { className: "h-full rounded-full bg-[hsl(var(--primary))]", style: { width: `${r.progress}%` } }) }) })
2954
+ ] }, r.name)) })
2955
+ ] }) })
2956
+ ] })
2957
+ ] })
2958
+ ] });
2959
+ }
2960
+ var NAV_LINKS = ["Home", "Projects", "Analytics", "Team"];
2961
+ var TABS = ["Overview", "Activity", "Settings", "Billing"];
2962
+ function StackedLayoutTabs({
2963
+ brandName = "Acme Inc",
2964
+ children,
2965
+ className
2966
+ }) {
2967
+ const [activeTab, setActiveTab] = useState(0);
2968
+ const [activeNav, setActiveNav] = useState(0);
2969
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex h-[600px] flex-col overflow-hidden rounded-[var(--radius)] border border-[hsl(var(--border))] bg-[hsl(var(--background))]", className), children: [
2970
+ /* @__PURE__ */ jsxs("nav", { className: "flex h-14 items-center gap-6 border-b border-[hsl(var(--border))] bg-[hsl(var(--card))] px-4", children: [
2971
+ /* @__PURE__ */ jsx("span", { className: "font-semibold text-sm shrink-0", children: brandName }),
2972
+ /* @__PURE__ */ jsx("div", { className: "flex flex-1 items-center gap-1", children: NAV_LINKS.map((link, i) => /* @__PURE__ */ jsx(
2973
+ "button",
2974
+ {
2975
+ onClick: () => setActiveNav(i),
2976
+ className: cn(
2977
+ "px-3 py-1.5 text-sm rounded-md transition-colors",
2978
+ i === activeNav ? "bg-[hsl(var(--accent))] font-medium" : "text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))]"
2979
+ ),
2980
+ children: link
2981
+ },
2982
+ link
2983
+ )) }),
2984
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
2985
+ /* @__PURE__ */ jsx(Bell, { className: "h-4 w-4 text-[hsl(var(--muted-foreground))]" }),
2986
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 cursor-pointer", children: [
2987
+ /* @__PURE__ */ jsx(Avatar, { className: "h-7 w-7", children: /* @__PURE__ */ jsx(AvatarFallback, { className: "text-xs", children: "JD" }) }),
2988
+ /* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3 text-[hsl(var(--muted-foreground))]" })
2989
+ ] })
2990
+ ] })
2991
+ ] }),
2992
+ /* @__PURE__ */ jsx("div", { className: "border-b border-[hsl(var(--border))] bg-[hsl(var(--card))] px-4", children: /* @__PURE__ */ jsx("div", { className: "flex gap-4", children: TABS.map((tab, i) => /* @__PURE__ */ jsx(
2993
+ "button",
2994
+ {
2995
+ onClick: () => setActiveTab(i),
2996
+ className: cn(
2997
+ "py-3 text-sm transition-colors border-b-2",
2998
+ i === activeTab ? "border-[hsl(var(--primary))] font-medium" : "border-transparent text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))]"
2999
+ ),
3000
+ children: tab
3001
+ },
3002
+ tab
3003
+ )) }) }),
3004
+ /* @__PURE__ */ jsx("main", { className: "flex-1 overflow-auto p-6", children: children ?? /* @__PURE__ */ jsxs("div", { className: "text-sm text-[hsl(var(--muted-foreground))]", children: [
3005
+ "Content for ",
3006
+ /* @__PURE__ */ jsx("strong", { children: TABS[activeTab] }),
3007
+ " tab"
3008
+ ] }) })
3009
+ ] });
3010
+ }
3011
+ var NAV_LINKS2 = ["Features", "Pricing", "Docs", "Blog"];
3012
+ function StackedLayoutBranded({
3013
+ brandName = "Acme",
3014
+ children,
3015
+ className
3016
+ }) {
3017
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex h-[600px] flex-col overflow-hidden rounded-[var(--radius)] border border-[hsl(var(--border))] bg-[hsl(var(--background))]", className), children: [
3018
+ /* @__PURE__ */ jsxs("nav", { className: "flex h-14 items-center gap-6 bg-[hsl(var(--primary))] px-6", children: [
3019
+ /* @__PURE__ */ jsx("span", { className: "font-bold text-sm text-[hsl(var(--primary-foreground))] shrink-0", children: brandName }),
3020
+ /* @__PURE__ */ jsx("div", { className: "flex flex-1 items-center gap-1", children: NAV_LINKS2.map((link) => /* @__PURE__ */ jsx("button", { className: "px-3 py-1.5 text-sm text-[hsl(var(--primary-foreground)/0.8)] hover:text-[hsl(var(--primary-foreground))] transition-colors rounded-md hover:bg-white/10", children: link }, link)) }),
3021
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
3022
+ /* @__PURE__ */ jsx(Bell, { className: "h-4 w-4 text-[hsl(var(--primary-foreground)/0.8)]" }),
3023
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 cursor-pointer", children: [
3024
+ /* @__PURE__ */ jsx(Avatar, { className: "h-7 w-7 ring-2 ring-white/30", children: /* @__PURE__ */ jsx(AvatarFallback, { className: "bg-white/20 text-[hsl(var(--primary-foreground))] text-xs", children: "JD" }) }),
3025
+ /* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3 text-[hsl(var(--primary-foreground)/0.8)]" })
3026
+ ] })
3027
+ ] })
3028
+ ] }),
3029
+ /* @__PURE__ */ jsx("main", { className: "flex-1 overflow-auto", children: children ?? /* @__PURE__ */ jsxs("div", { className: "p-6 space-y-6", children: [
3030
+ /* @__PURE__ */ jsxs("div", { children: [
3031
+ /* @__PURE__ */ jsx("h1", { className: "text-xl font-bold", children: "Welcome back, Jane" }),
3032
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-[hsl(var(--muted-foreground))] mt-1", children: "Here's what's happening today." })
3033
+ ] }),
3034
+ /* @__PURE__ */ jsx("div", { className: "grid gap-4", style: { gridTemplateColumns: "repeat(auto-fill, minmax(min(100%,200px),1fr))" }, children: ["Get Started", "View Analytics", "Manage Team"].map((action) => /* @__PURE__ */ jsx(Card, { className: "cursor-pointer hover:shadow-md transition-shadow", children: /* @__PURE__ */ jsxs(CardContent, { className: "p-4 flex items-center justify-between", children: [
3035
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: action }),
3036
+ /* @__PURE__ */ jsx(ArrowRight, { className: "h-4 w-4 text-[hsl(var(--muted-foreground))]" })
3037
+ ] }) }, action)) })
3038
+ ] }) })
3039
+ ] });
3040
+ }
3041
+ var NOTIFICATIONS = [
3042
+ { id: "comments", label: "Comments", description: "Get notified when someone comments on your post", default: true },
3043
+ { id: "mentions", label: "Mentions", description: "Get notified when you are mentioned", default: true },
3044
+ { id: "followers", label: "New followers", description: "Get notified when someone follows you", default: false },
3045
+ { id: "updates", label: "Product updates", description: "Receive emails about new features and improvements", default: true },
3046
+ { id: "digest", label: "Weekly digest", description: "A summary of activity from the past week", default: false },
3047
+ { id: "security", label: "Security alerts", description: "Important alerts about your account security", default: true }
3048
+ ];
3049
+ function NotifRow({ label, description, checked, onChange }) {
3050
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4 py-4", children: [
3051
+ /* @__PURE__ */ jsxs("div", { children: [
3052
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: label }),
3053
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-[hsl(var(--muted-foreground))] mt-0.5", children: description })
3054
+ ] }),
3055
+ /* @__PURE__ */ jsx(Switch, { checked, onCheckedChange: onChange })
3056
+ ] });
3057
+ }
3058
+ function NotificationSettings({ className }) {
3059
+ const [states, setStates] = useState(
3060
+ Object.fromEntries(NOTIFICATIONS.map((n) => [n.id, n.default]))
3061
+ );
3062
+ return /* @__PURE__ */ jsxs("div", { className: cn("rounded-[var(--radius)] border border-[hsl(var(--border))] bg-[hsl(var(--card))] p-6", className), children: [
3063
+ /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
3064
+ /* @__PURE__ */ jsx("h2", { className: "text-base font-semibold", children: "Email Notifications" }),
3065
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-[hsl(var(--muted-foreground))] mt-0.5", children: "Choose what you want to be notified about." })
3066
+ ] }),
3067
+ /* @__PURE__ */ jsx(Separator4, {}),
3068
+ /* @__PURE__ */ jsx("div", { className: "divide-y divide-[hsl(var(--border))]", children: NOTIFICATIONS.map((n) => /* @__PURE__ */ jsx(
3069
+ NotifRow,
3070
+ {
3071
+ ...n,
3072
+ checked: states[n.id],
3073
+ onChange: (val) => setStates((s) => ({ ...s, [n.id]: val }))
3074
+ },
3075
+ n.id
3076
+ )) })
3077
+ ] });
3078
+ }
3079
+ var MEMBERS = [
3080
+ { id: "1", name: "Jane Doe", email: "jane@acme.com", role: "Owner", initials: "JD" },
3081
+ { id: "2", name: "Bob Smith", email: "bob@acme.com", role: "Admin", initials: "BS" },
3082
+ { id: "3", name: "Alice Chen", email: "alice@acme.com", role: "Member", initials: "AC" },
3083
+ { id: "4", name: "Tom Ray", email: "tom@acme.com", role: "Member", initials: "TR" },
3084
+ { id: "5", name: "Sara Kim", email: "sara@acme.com", role: "Viewer", initials: "SK" }
3085
+ ];
3086
+ var roleVariant = (role) => role === "Owner" ? "default" : role === "Admin" ? "secondary" : "outline";
3087
+ function WorkspaceMembers({ className }) {
3088
+ const [query, setQuery] = useState("");
3089
+ const [members, setMembers] = useState(MEMBERS);
3090
+ const filtered = members.filter(
3091
+ (m) => m.name.toLowerCase().includes(query.toLowerCase()) || m.email.toLowerCase().includes(query.toLowerCase())
3092
+ );
3093
+ return /* @__PURE__ */ jsxs("div", { className: cn("rounded-[var(--radius)] border border-[hsl(var(--border))] bg-[hsl(var(--card))]", className), children: [
3094
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between p-4 border-b border-[hsl(var(--border))]", children: [
3095
+ /* @__PURE__ */ jsxs("div", { children: [
3096
+ /* @__PURE__ */ jsx("h2", { className: "text-sm font-semibold", children: "Members" }),
3097
+ /* @__PURE__ */ jsxs("p", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: [
3098
+ members.length,
3099
+ " members"
3100
+ ] })
3101
+ ] }),
3102
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
3103
+ /* @__PURE__ */ jsx(Search, { className: "absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-[hsl(var(--muted-foreground))]" }),
3104
+ /* @__PURE__ */ jsx(Input, { className: "h-8 pl-8 text-xs w-48", placeholder: "Search members...", value: query, onChange: (e) => setQuery(e.target.value) })
3105
+ ] })
3106
+ ] }),
3107
+ /* @__PURE__ */ jsx("div", { className: "divide-y divide-[hsl(var(--border))]", children: filtered.map((m) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 px-4 py-3", children: [
3108
+ /* @__PURE__ */ jsx(Avatar, { className: "h-8 w-8", children: /* @__PURE__ */ jsx(AvatarFallback, { className: "text-xs", children: m.initials }) }),
3109
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
3110
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium truncate", children: m.name }),
3111
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-[hsl(var(--muted-foreground))] truncate", children: m.email })
3112
+ ] }),
3113
+ /* @__PURE__ */ jsx(Badge, { variant: roleVariant(m.role), className: "text-[10px] px-1.5 py-0.5 shrink-0", children: m.role }),
3114
+ m.role !== "Owner" && /* @__PURE__ */ jsx(Button, { size: "icon", variant: "ghost", className: "h-7 w-7 shrink-0", onClick: () => setMembers((ms) => ms.filter((x) => x.id !== m.id)), children: /* @__PURE__ */ jsx(X, { className: "h-3.5 w-3.5" }) })
3115
+ ] }, m.id)) })
3116
+ ] });
3117
+ }
3118
+ function IntegrationCard({
3119
+ icon,
3120
+ name = "Slack",
3121
+ description = "Send notifications and updates to your Slack workspace.",
3122
+ connected = false,
3123
+ className
3124
+ }) {
3125
+ const [isConnected, setIsConnected] = useState(connected);
3126
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-4 rounded-[var(--radius)] border border-[hsl(var(--border))] bg-[hsl(var(--card))] p-4", className), children: [
3127
+ /* @__PURE__ */ jsx("div", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-[var(--radius)] bg-[hsl(var(--muted))] text-[hsl(var(--muted-foreground))]", children: icon ?? /* @__PURE__ */ jsx("span", { className: "text-base font-bold", children: name[0] }) }),
3128
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
3129
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
3130
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-semibold", children: name }),
3131
+ /* @__PURE__ */ jsx(
3132
+ Badge,
3133
+ {
3134
+ variant: isConnected ? "default" : "outline",
3135
+ className: "text-[10px] px-1.5 py-0.5 shrink-0",
3136
+ children: isConnected ? "Connected" : "Not connected"
3137
+ }
3138
+ )
3139
+ ] }),
3140
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-[hsl(var(--muted-foreground))] mt-0.5 truncate", children: description })
3141
+ ] }),
3142
+ /* @__PURE__ */ jsx(
3143
+ Button,
3144
+ {
3145
+ size: "sm",
3146
+ variant: isConnected ? "outline" : "default",
3147
+ className: "shrink-0",
3148
+ onClick: () => setIsConnected((v) => !v),
3149
+ children: isConnected ? "Disconnect" : "Connect"
3150
+ }
3151
+ )
3152
+ ] });
3153
+ }
3154
+ var REACTIONS = ["\u{1F60A}", "\u{1F610}", "\u{1F615}", "\u{1F621}", "\u{1F929}"];
3155
+ function FeedbackModal({ onSubmit, className }) {
3156
+ const [reaction, setReaction] = useState("");
3157
+ const [text, setText] = useState("");
3158
+ const [submitted, setSubmitted] = useState(false);
3159
+ const handleSubmit = () => {
3160
+ onSubmit?.({ reaction, text });
3161
+ setSubmitted(true);
3162
+ };
3163
+ if (submitted) {
3164
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col items-center gap-3 py-8 px-6 text-center", className), children: [
3165
+ /* @__PURE__ */ jsx("span", { className: "text-4xl", children: "\u{1F389}" }),
3166
+ /* @__PURE__ */ jsx("p", { className: "font-semibold", children: "Thanks for your feedback!" }),
3167
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-[hsl(var(--muted-foreground))]", children: "We'll use it to improve your experience." })
3168
+ ] });
3169
+ }
3170
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-4 p-6", className), children: [
3171
+ /* @__PURE__ */ jsxs("div", { children: [
3172
+ /* @__PURE__ */ jsx("h2", { className: "text-base font-semibold", children: "Send Feedback" }),
3173
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-[hsl(var(--muted-foreground))] mt-0.5", children: "How are you feeling about the product?" })
3174
+ ] }),
3175
+ /* @__PURE__ */ jsx("div", { className: "flex gap-2", children: REACTIONS.map((r) => /* @__PURE__ */ jsx(
3176
+ "button",
3177
+ {
3178
+ onClick: () => setReaction(r),
3179
+ className: cn(
3180
+ "flex h-10 w-10 items-center justify-center rounded-[var(--radius)] border text-xl transition-colors",
3181
+ reaction === r ? "border-[hsl(var(--primary))] bg-[hsl(var(--primary)/0.1)]" : "border-[hsl(var(--border))] hover:bg-[hsl(var(--accent))]"
3182
+ ),
3183
+ children: r
3184
+ },
3185
+ r
3186
+ )) }),
3187
+ /* @__PURE__ */ jsx(
3188
+ Textarea,
3189
+ {
3190
+ placeholder: "Tell us more (optional)...",
3191
+ value: text,
3192
+ onChange: (e) => setText(e.target.value),
3193
+ className: "resize-none",
3194
+ rows: 4
3195
+ }
3196
+ ),
3197
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
3198
+ /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", children: "Cancel" }),
3199
+ /* @__PURE__ */ jsx(Button, { size: "sm", onClick: handleSubmit, disabled: !reaction, children: "Submit" })
3200
+ ] })
3201
+ ] });
3202
+ }
3203
+ var PENDING = [
3204
+ { email: "alex@startup.io", role: "Member" },
3205
+ { email: "sam@startup.io", role: "Viewer" }
3206
+ ];
3207
+ function InviteModal({ className }) {
3208
+ const [email, setEmail] = useState("");
3209
+ const [role, setRole] = useState("Member");
3210
+ const [pending, setPending] = useState(PENDING);
3211
+ const invite = () => {
3212
+ if (!email.trim())
3213
+ return;
3214
+ setPending((p) => [...p, { email: email.trim(), role }]);
3215
+ setEmail("");
3216
+ };
3217
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-4 p-6", className), children: [
3218
+ /* @__PURE__ */ jsxs("div", { children: [
3219
+ /* @__PURE__ */ jsx("h2", { className: "text-base font-semibold", children: "Invite People" }),
3220
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-[hsl(var(--muted-foreground))] mt-0.5", children: "Invite team members to collaborate." })
3221
+ ] }),
3222
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
3223
+ /* @__PURE__ */ jsx(
3224
+ Input,
3225
+ {
3226
+ className: "flex-1 h-9 text-sm",
3227
+ placeholder: "colleague@company.com",
3228
+ value: email,
3229
+ onChange: (e) => setEmail(e.target.value),
3230
+ onKeyDown: (e) => e.key === "Enter" && invite()
3231
+ }
3232
+ ),
3233
+ /* @__PURE__ */ jsxs(Select, { value: role, onValueChange: setRole, children: [
3234
+ /* @__PURE__ */ jsx(SelectTrigger, { className: "h-9 w-28 text-sm", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
3235
+ /* @__PURE__ */ jsx(SelectContent, { children: ["Admin", "Member", "Viewer"].map((r) => /* @__PURE__ */ jsx(SelectItem, { value: r, children: r }, r)) })
3236
+ ] }),
3237
+ /* @__PURE__ */ jsx(Button, { size: "sm", className: "h-9", onClick: invite, children: "Send" })
3238
+ ] }),
3239
+ pending.length > 0 && /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
3240
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-[hsl(var(--muted-foreground))]", children: "Pending invites" }),
3241
+ /* @__PURE__ */ jsx("div", { className: "divide-y divide-[hsl(var(--border))] rounded-[var(--radius)] border border-[hsl(var(--border))]", children: pending.map((p, i) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-3 py-2", children: [
3242
+ /* @__PURE__ */ jsx(Avatar, { className: "h-6 w-6", children: /* @__PURE__ */ jsx(AvatarFallback, { className: "text-[10px]", children: p.email[0].toUpperCase() }) }),
3243
+ /* @__PURE__ */ jsx("span", { className: "flex-1 text-sm truncate", children: p.email }),
3244
+ /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "text-[10px] px-1.5 py-0.5 shrink-0", children: p.role }),
3245
+ /* @__PURE__ */ jsx("button", { onClick: () => setPending((ps) => ps.filter((_, j) => j !== i)), children: /* @__PURE__ */ jsx(X, { className: "h-3.5 w-3.5 text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))]" }) })
3246
+ ] }, i)) })
3247
+ ] })
3248
+ ] });
3249
+ }
3250
+ var COLORS = ["bg-blue-500", "bg-green-500", "bg-yellow-500", "bg-purple-500", "bg-red-500", "bg-pink-500"];
3251
+ var INITIAL_TAGS = [
3252
+ { id: "1", name: "Design", color: "bg-blue-500" },
3253
+ { id: "2", name: "Engineering", color: "bg-green-500" },
3254
+ { id: "3", name: "Marketing", color: "bg-yellow-500" },
3255
+ { id: "4", name: "Research", color: "bg-purple-500" }
3256
+ ];
3257
+ function ManageTagsModal({ className }) {
3258
+ const [tags, setTags] = useState(INITIAL_TAGS);
3259
+ const [newTag, setNewTag] = useState("");
3260
+ const [colorIdx, setColorIdx] = useState(0);
3261
+ const addTag = () => {
3262
+ if (!newTag.trim())
3263
+ return;
3264
+ const id = `tag-${Date.now()}`;
3265
+ setTags((t) => [...t, { id, name: newTag.trim(), color: COLORS[colorIdx % COLORS.length] }]);
3266
+ setNewTag("");
3267
+ setColorIdx((i) => i + 1);
3268
+ };
3269
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-4 p-6", className), children: [
3270
+ /* @__PURE__ */ jsxs("div", { children: [
3271
+ /* @__PURE__ */ jsx("h2", { className: "text-base font-semibold", children: "Manage Tags" }),
3272
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-[hsl(var(--muted-foreground))] mt-0.5", children: "Create and organize your tags." })
3273
+ ] }),
3274
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
3275
+ /* @__PURE__ */ jsx(
3276
+ "div",
3277
+ {
3278
+ className: cn("h-9 w-9 shrink-0 rounded-md cursor-pointer transition-opacity", COLORS[colorIdx % COLORS.length]),
3279
+ onClick: () => setColorIdx((i) => i + 1),
3280
+ title: "Click to change color"
3281
+ }
3282
+ ),
3283
+ /* @__PURE__ */ jsx(
3284
+ Input,
3285
+ {
3286
+ className: "flex-1 h-9 text-sm",
3287
+ placeholder: "New tag name...",
3288
+ value: newTag,
3289
+ onChange: (e) => setNewTag(e.target.value),
3290
+ onKeyDown: (e) => e.key === "Enter" && addTag()
3291
+ }
3292
+ ),
3293
+ /* @__PURE__ */ jsx(Button, { size: "sm", className: "h-9", onClick: addTag, children: "Add" })
3294
+ ] }),
3295
+ /* @__PURE__ */ jsx("div", { className: "space-y-1.5", children: tags.map((tag) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 rounded-[var(--radius)] border border-[hsl(var(--border))] px-3 py-2", children: [
3296
+ /* @__PURE__ */ jsx("span", { className: cn("h-3 w-3 rounded-full shrink-0", tag.color) }),
3297
+ /* @__PURE__ */ jsx("span", { className: "flex-1 text-sm", children: tag.name }),
3298
+ /* @__PURE__ */ jsx("button", { className: "text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] transition-colors", children: /* @__PURE__ */ jsx(Pencil, { className: "h-3.5 w-3.5" }) }),
3299
+ /* @__PURE__ */ jsx(
3300
+ "button",
3301
+ {
3302
+ onClick: () => setTags((ts) => ts.filter((t) => t.id !== tag.id)),
3303
+ className: "text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] transition-colors",
3304
+ children: /* @__PURE__ */ jsx(X, { className: "h-3.5 w-3.5" })
3305
+ }
3306
+ )
3307
+ ] }, tag.id)) })
3308
+ ] });
3309
+ }
3310
+ var USERS = [
3311
+ { id: "1", name: "Jane Doe", email: "jane@acme.com", initials: "JD" },
3312
+ { id: "2", name: "Bob Smith", email: "bob@acme.com", initials: "BS" },
3313
+ { id: "3", name: "Alice Chen", email: "alice@acme.com", initials: "AC" },
3314
+ { id: "4", name: "Tom Ray", email: "tom@acme.com", initials: "TR" },
3315
+ { id: "5", name: "Sara Kim", email: "sara@acme.com", initials: "SK" },
3316
+ { id: "6", name: "Mike Liu", email: "mike@acme.com", initials: "ML" }
3317
+ ];
3318
+ function SelectUsersModal({ onConfirm, className }) {
3319
+ const [query, setQuery] = useState("");
3320
+ const [selected, setSelected] = useState(/* @__PURE__ */ new Set());
3321
+ const filtered = USERS.filter(
3322
+ (u) => u.name.toLowerCase().includes(query.toLowerCase()) || u.email.toLowerCase().includes(query.toLowerCase())
3323
+ );
3324
+ const toggle = (id) => setSelected((s) => {
3325
+ const n = new Set(s);
3326
+ n.has(id) ? n.delete(id) : n.add(id);
3327
+ return n;
3328
+ });
3329
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col", className), children: [
3330
+ /* @__PURE__ */ jsxs("div", { className: "p-4 border-b border-[hsl(var(--border))]", children: [
3331
+ /* @__PURE__ */ jsx("h2", { className: "text-sm font-semibold mb-3", children: "Select Users" }),
3332
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
3333
+ /* @__PURE__ */ jsx(Search, { className: "absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-[hsl(var(--muted-foreground))]" }),
3334
+ /* @__PURE__ */ jsx(Input, { className: "pl-8 h-8 text-sm", placeholder: "Search users...", value: query, onChange: (e) => setQuery(e.target.value) })
3335
+ ] })
3336
+ ] }),
3337
+ /* @__PURE__ */ jsx("div", { className: "overflow-auto max-h-64 divide-y divide-[hsl(var(--border))]", children: filtered.map((u) => /* @__PURE__ */ jsxs("label", { className: "flex cursor-pointer items-center gap-3 px-4 py-3 hover:bg-[hsl(var(--accent))] transition-colors", children: [
3338
+ /* @__PURE__ */ jsx(Checkbox, { checked: selected.has(u.id), onCheckedChange: () => toggle(u.id) }),
3339
+ /* @__PURE__ */ jsx(Avatar, { className: "h-7 w-7", children: /* @__PURE__ */ jsx(AvatarFallback, { className: "text-xs", children: u.initials }) }),
3340
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
3341
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium truncate", children: u.name }),
3342
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-[hsl(var(--muted-foreground))] truncate", children: u.email })
3343
+ ] })
3344
+ ] }, u.id)) }),
3345
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between p-4 border-t border-[hsl(var(--border))]", children: [
3346
+ /* @__PURE__ */ jsxs("span", { className: "text-sm text-[hsl(var(--muted-foreground))]", children: [
3347
+ selected.size,
3348
+ " selected"
3349
+ ] }),
3350
+ /* @__PURE__ */ jsx(Button, { size: "sm", disabled: selected.size === 0, onClick: () => onConfirm?.(Array.from(selected)), children: "Confirm" })
3351
+ ] })
3352
+ ] });
3353
+ }
3354
+ function UserMenu({
3355
+ name = "Jane Doe",
3356
+ email = "jane@acme.com",
3357
+ initials = "JD",
3358
+ onProfile,
3359
+ onSettings,
3360
+ onBilling,
3361
+ onSignOut,
3362
+ className
3363
+ }) {
3364
+ return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
3365
+ /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs("button", { className: cn("flex items-center gap-2 rounded-[var(--radius)] px-2 py-1.5 text-sm transition-colors hover:bg-[hsl(var(--accent))] focus:outline-none", className), children: [
3366
+ /* @__PURE__ */ jsx(Avatar, { className: "h-7 w-7", children: /* @__PURE__ */ jsx(AvatarFallback, { className: "text-xs", children: initials }) }),
3367
+ /* @__PURE__ */ jsx("span", { className: "font-medium max-w-[120px] truncate", children: name }),
3368
+ /* @__PURE__ */ jsx(ChevronDown, { className: "h-3.5 w-3.5 text-[hsl(var(--muted-foreground))]" })
3369
+ ] }) }),
3370
+ /* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", className: "w-52", children: [
3371
+ /* @__PURE__ */ jsxs(DropdownMenuLabel, { className: "font-normal", children: [
3372
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: name }),
3373
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: email })
3374
+ ] }),
3375
+ /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
3376
+ /* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: onProfile, children: [
3377
+ /* @__PURE__ */ jsx(User, { className: "h-4 w-4" }),
3378
+ "Profile"
3379
+ ] }),
3380
+ /* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: onSettings, children: [
3381
+ /* @__PURE__ */ jsx(Settings, { className: "h-4 w-4" }),
3382
+ "Account Settings"
3383
+ ] }),
3384
+ /* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: onBilling, children: [
3385
+ /* @__PURE__ */ jsx(CreditCard, { className: "h-4 w-4" }),
3386
+ "Billing"
3387
+ ] }),
3388
+ /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
3389
+ /* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: onSignOut, className: "text-[hsl(var(--destructive))] focus:text-[hsl(var(--destructive))]", children: [
3390
+ /* @__PURE__ */ jsx(LogOut, { className: "h-4 w-4" }),
3391
+ "Sign out"
3392
+ ] })
3393
+ ] })
3394
+ ] });
3395
+ }
3396
+ var ORGS = [
3397
+ { id: "1", name: "Acme Corp", slug: "acme", plan: "Pro" },
3398
+ { id: "2", name: "Beta Labs", slug: "beta-labs", plan: "Starter" },
3399
+ { id: "3", name: "Gamma Inc", slug: "gamma", plan: "Free" }
3400
+ ];
3401
+ function OrgMenu({
3402
+ currentOrgId = "1",
3403
+ onSwitch,
3404
+ onCreateOrg,
3405
+ className
3406
+ }) {
3407
+ const current = ORGS.find((o) => o.id === currentOrgId) ?? ORGS[0];
3408
+ return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
3409
+ /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs("button", { className: cn("flex items-center gap-2 rounded-[var(--radius)] px-2 py-1.5 text-sm transition-colors hover:bg-[hsl(var(--accent))] focus:outline-none", className), children: [
3410
+ /* @__PURE__ */ jsx("div", { className: "flex h-6 w-6 items-center justify-center rounded bg-[hsl(var(--primary))] text-[10px] font-bold text-[hsl(var(--primary-foreground))]", children: current.name[0] }),
3411
+ /* @__PURE__ */ jsx("span", { className: "font-medium max-w-[120px] truncate", children: current.name }),
3412
+ /* @__PURE__ */ jsx(ChevronDown, { className: "h-3.5 w-3.5 text-[hsl(var(--muted-foreground))]" })
3413
+ ] }) }),
3414
+ /* @__PURE__ */ jsxs(DropdownMenuContent, { align: "start", className: "w-52", children: [
3415
+ /* @__PURE__ */ jsx(DropdownMenuLabel, { children: "Organizations" }),
3416
+ /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
3417
+ ORGS.map((org) => /* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: () => onSwitch?.(org.id), className: "justify-between", children: [
3418
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
3419
+ /* @__PURE__ */ jsx("div", { className: "flex h-5 w-5 items-center justify-center rounded bg-[hsl(var(--muted))] text-[10px] font-bold", children: org.name[0] }),
3420
+ /* @__PURE__ */ jsx("span", { children: org.name })
3421
+ ] }),
3422
+ org.id === currentOrgId && /* @__PURE__ */ jsx(Check, { className: "h-3.5 w-3.5 text-[hsl(var(--primary))]" })
3423
+ ] }, org.id)),
3424
+ /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
3425
+ /* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: onCreateOrg, children: [
3426
+ /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4" }),
3427
+ "Create organization"
3428
+ ] })
3429
+ ] })
3430
+ ] });
3431
+ }
3432
+ var ROLES = [
3433
+ { value: "owner", label: "Owner", description: "Full control over the workspace" },
3434
+ { value: "admin", label: "Admin", description: "Manage members and settings" },
3435
+ { value: "member", label: "Member", description: "Can create and edit content" },
3436
+ { value: "viewer", label: "Viewer", description: "Read-only access" }
3437
+ ];
3438
+ function RolesMenu({ value = "member", onChange, className }) {
3439
+ const [role, setRole] = useState(value);
3440
+ const current = ROLES.find((r) => r.value === role) ?? ROLES[2];
3441
+ const handleChange = (v) => {
3442
+ setRole(v);
3443
+ onChange?.(v);
3444
+ };
3445
+ return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
3446
+ /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", className: cn("gap-1.5", className), children: [
3447
+ current.label,
3448
+ /* @__PURE__ */ jsx(ChevronDown, { className: "h-3.5 w-3.5 opacity-60" })
3449
+ ] }) }),
3450
+ /* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", className: "w-56", children: [
3451
+ /* @__PURE__ */ jsx(DropdownMenuLabel, { children: "Change role" }),
3452
+ /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
3453
+ /* @__PURE__ */ jsx(DropdownMenuRadioGroup, { value: role, onValueChange: handleChange, children: ROLES.map((r) => /* @__PURE__ */ jsx(DropdownMenuRadioItem, { value: r.value, className: "items-start py-2.5", children: /* @__PURE__ */ jsxs("div", { className: "ml-1", children: [
3454
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium leading-none", children: r.label }),
3455
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-[hsl(var(--muted-foreground))] mt-0.5", children: r.description })
3456
+ ] }) }, r.value)) })
3457
+ ] })
3458
+ ] });
3459
+ }
3460
+ function MetricCard({ label = "Total Revenue", value = "$48,295", change = "+12.5%", trend = "up", className }) {
3461
+ const TrendIcon = trend === "up" ? TrendingUp : TrendingDown;
3462
+ const trendColor = trend === "up" ? "text-green-600" : "text-red-500";
3463
+ return /* @__PURE__ */ jsx(Card, { className: cn("", className), children: /* @__PURE__ */ jsxs(CardContent, { className: "p-4", children: [
3464
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-[hsl(var(--muted-foreground))]", children: label }),
3465
+ /* @__PURE__ */ jsx("p", { className: "text-2xl font-bold mt-1", children: value }),
3466
+ /* @__PURE__ */ jsxs("p", { className: cn("flex items-center gap-1 text-sm mt-1", trendColor), children: [
3467
+ /* @__PURE__ */ jsx(TrendIcon, { className: "h-4 w-4" }),
3468
+ change,
3469
+ " from last month"
3470
+ ] })
3471
+ ] }) });
3472
+ }
3473
+ function MetricCardWithIcon({ icon, iconColor = "bg-[hsl(var(--primary)/0.1)] text-[hsl(var(--primary))]", ...props }) {
3474
+ const TrendIcon = (props.trend ?? "up") === "up" ? TrendingUp : TrendingDown;
3475
+ const trendColor = (props.trend ?? "up") === "up" ? "text-green-600" : "text-red-500";
3476
+ return /* @__PURE__ */ jsx(Card, { className: cn("", props.className), children: /* @__PURE__ */ jsx(CardContent, { className: "p-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between", children: [
3477
+ /* @__PURE__ */ jsxs("div", { children: [
3478
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-[hsl(var(--muted-foreground))]", children: props.label ?? "Total Revenue" }),
3479
+ /* @__PURE__ */ jsx("p", { className: "text-2xl font-bold mt-1", children: props.value ?? "$48,295" }),
3480
+ /* @__PURE__ */ jsxs("p", { className: cn("flex items-center gap-1 text-sm mt-1", trendColor), children: [
3481
+ /* @__PURE__ */ jsx(TrendIcon, { className: "h-4 w-4" }),
3482
+ props.change ?? "+12.5%"
3483
+ ] })
3484
+ ] }),
3485
+ /* @__PURE__ */ jsx("div", { className: cn("flex h-10 w-10 items-center justify-center rounded-[var(--radius)]", iconColor), children: icon ?? /* @__PURE__ */ jsx(TrendingUp, { className: "h-5 w-5" }) })
3486
+ ] }) }) });
3487
+ }
3488
+ function MetricCardWithButton({ actionLabel = "View details", onAction, ...props }) {
3489
+ const TrendIcon = (props.trend ?? "up") === "up" ? TrendingUp : TrendingDown;
3490
+ const trendColor = (props.trend ?? "up") === "up" ? "text-green-600" : "text-red-500";
3491
+ return /* @__PURE__ */ jsx(Card, { className: cn("", props.className), children: /* @__PURE__ */ jsxs(CardContent, { className: "p-4", children: [
3492
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-[hsl(var(--muted-foreground))]", children: props.label ?? "Total Revenue" }),
3493
+ /* @__PURE__ */ jsx("p", { className: "text-2xl font-bold mt-1", children: props.value ?? "$48,295" }),
3494
+ /* @__PURE__ */ jsxs("p", { className: cn("flex items-center gap-1 text-sm mt-1 mb-3", trendColor), children: [
3495
+ /* @__PURE__ */ jsx(TrendIcon, { className: "h-4 w-4" }),
3496
+ props.change ?? "+12.5%"
3497
+ ] }),
3498
+ /* @__PURE__ */ jsx(Button, { size: "sm", variant: "outline", className: "w-full", onClick: onAction, children: actionLabel })
3499
+ ] }) });
3500
+ }
3501
+ var INITIAL_MESSAGES = [
3502
+ { id: "1", author: "Alice Chen", initials: "AC", text: "Hey team, just pushed the new design files to Figma.", time: "9:41 AM" },
3503
+ { id: "2", author: "Bob Smith", initials: "BS", text: "Awesome! I'll take a look and share feedback by EOD.", time: "9:43 AM" },
3504
+ { id: "3", author: "You", initials: "JD", text: "Looks great, the new color palette really pops!", time: "9:45 AM", self: true },
3505
+ { id: "4", author: "Alice Chen", initials: "AC", text: "Thanks! Let's sync tomorrow to go through the comments.", time: "9:47 AM" }
3506
+ ];
3507
+ function ChatBubble({ msg }) {
3508
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex gap-2.5", msg.self && "flex-row-reverse"), children: [
3509
+ /* @__PURE__ */ jsx(Avatar, { className: "h-7 w-7 shrink-0 mt-0.5", children: /* @__PURE__ */ jsx(AvatarFallback, { className: "text-xs", children: msg.initials }) }),
3510
+ /* @__PURE__ */ jsxs("div", { className: cn("max-w-[70%]", msg.self && "items-end flex flex-col"), children: [
3511
+ /* @__PURE__ */ jsxs("div", { className: "flex items-baseline gap-2 mb-0.5", children: [
3512
+ /* @__PURE__ */ jsx("span", { className: "text-xs font-medium", children: msg.author }),
3513
+ /* @__PURE__ */ jsx("span", { className: "text-[10px] text-[hsl(var(--muted-foreground))]", children: msg.time })
3514
+ ] }),
3515
+ /* @__PURE__ */ jsx("div", { className: cn(
3516
+ "rounded-[var(--radius)] px-3 py-2 text-sm",
3517
+ msg.self ? "bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]" : "bg-[hsl(var(--muted))]"
3518
+ ), children: msg.text })
3519
+ ] })
3520
+ ] });
3521
+ }
3522
+ function ChatDetail({ className }) {
3523
+ const [messages, setMessages] = useState(INITIAL_MESSAGES);
3524
+ const [input, setInput] = useState("");
3525
+ const send = () => {
3526
+ if (!input.trim())
3527
+ return;
3528
+ const now = (/* @__PURE__ */ new Date()).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
3529
+ setMessages((m) => [...m, { id: `${Date.now()}`, author: "You", initials: "JD", text: input.trim(), time: now, self: true }]);
3530
+ setInput("");
3531
+ };
3532
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex h-[480px] flex-col overflow-hidden rounded-[var(--radius)] border border-[hsl(var(--border))] bg-[hsl(var(--card))]", className), children: [
3533
+ /* @__PURE__ */ jsxs("header", { className: "flex items-center gap-3 border-b border-[hsl(var(--border))] px-4 py-3", children: [
3534
+ /* @__PURE__ */ jsx(Avatar, { className: "h-8 w-8", children: /* @__PURE__ */ jsx(AvatarFallback, { className: "text-xs", children: "AC" }) }),
3535
+ /* @__PURE__ */ jsxs("div", { children: [
3536
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-semibold", children: "Design Team" }),
3537
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: "4 members" })
3538
+ ] })
3539
+ ] }),
3540
+ /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-auto p-4 space-y-4", children: messages.map((m) => /* @__PURE__ */ jsx(ChatBubble, { msg: m }, m.id)) }),
3541
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 border-t border-[hsl(var(--border))] p-3", children: [
3542
+ /* @__PURE__ */ jsx(
3543
+ Input,
3544
+ {
3545
+ className: "flex-1 h-9 text-sm",
3546
+ placeholder: "Type a message...",
3547
+ value: input,
3548
+ onChange: (e) => setInput(e.target.value),
3549
+ onKeyDown: (e) => e.key === "Enter" && send()
3550
+ }
3551
+ ),
3552
+ /* @__PURE__ */ jsx(Button, { size: "icon", className: "h-9 w-9 shrink-0", onClick: send, children: /* @__PURE__ */ jsx(Send, { className: "h-4 w-4" }) })
3553
+ ] })
3554
+ ] });
3555
+ }
3556
+ var MESSAGES = [
3557
+ { id: "1", name: "Alice Chen", initials: "AC", preview: "Just pushed the new design files to Figma.", time: "9:41 AM", unread: true },
3558
+ { id: "2", name: "Bob Smith", initials: "BS", preview: "I'll take a look and share feedback by EOD.", time: "9:43 AM", unread: true },
3559
+ { id: "3", name: "Tom Ray", initials: "TR", preview: "Can we reschedule the standup to 10am?", time: "Yesterday" },
3560
+ { id: "4", name: "Sara Kim", initials: "SK", preview: "Shipped the new auth flow. Ready for QA.", time: "Yesterday" },
3561
+ { id: "5", name: "Mike Liu", initials: "ML", preview: "The latest metrics look promising \u{1F4C8}", time: "Mon" }
3562
+ ];
3563
+ function MessageRow({ msg }) {
3564
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 px-4 py-3 hover:bg-[hsl(var(--accent))] cursor-pointer transition-colors", children: [
3565
+ /* @__PURE__ */ jsxs("div", { className: "relative shrink-0", children: [
3566
+ /* @__PURE__ */ jsx(Avatar, { className: "h-9 w-9", children: /* @__PURE__ */ jsx(AvatarFallback, { className: "text-xs", children: msg.initials }) }),
3567
+ msg.unread && /* @__PURE__ */ jsx("span", { className: "absolute -top-0.5 -right-0.5 h-2.5 w-2.5 rounded-full bg-[hsl(var(--primary))] ring-2 ring-[hsl(var(--card))]" })
3568
+ ] }),
3569
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
3570
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
3571
+ /* @__PURE__ */ jsx("p", { className: cn("text-sm truncate", msg.unread ? "font-semibold" : "font-medium"), children: msg.name }),
3572
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-[hsl(var(--muted-foreground))] shrink-0", children: msg.time })
3573
+ ] }),
3574
+ /* @__PURE__ */ jsx("p", { className: cn("text-xs mt-0.5 truncate", msg.unread ? "text-[hsl(var(--foreground))]" : "text-[hsl(var(--muted-foreground))]"), children: msg.preview })
3575
+ ] })
3576
+ ] });
3577
+ }
3578
+ function MessagesCard({ className }) {
3579
+ return /* @__PURE__ */ jsxs(Card, { className: cn("overflow-hidden", className), children: [
3580
+ /* @__PURE__ */ jsx(CardHeader, { className: "px-4 py-3 border-b border-[hsl(var(--border))]", children: /* @__PURE__ */ jsxs(CardTitle, { className: "text-sm font-semibold flex items-center justify-between", children: [
3581
+ "Messages",
3582
+ /* @__PURE__ */ jsx("span", { className: "text-[10px] px-1.5 py-0.5 rounded-full bg-[hsl(var(--primary)/0.1)] text-[hsl(var(--primary))] font-medium", children: "2 new" })
3583
+ ] }) }),
3584
+ /* @__PURE__ */ jsx("div", { className: "divide-y divide-[hsl(var(--border))]", children: MESSAGES.map((m) => /* @__PURE__ */ jsx(MessageRow, { msg: m }, m.id)) })
3585
+ ] });
3586
+ }
3587
+ var FILES = [
3588
+ { id: "1", name: "design-system.fig", type: "figma", size: "14.2 MB", modified: "Mar 12" },
3589
+ { id: "2", name: "hero-banner.png", type: "image", size: "3.8 MB", modified: "Mar 11" },
3590
+ { id: "3", name: "api-spec.yaml", type: "code", size: "42 KB", modified: "Mar 10" },
3591
+ { id: "4", name: "demo-video.mp4", type: "video", size: "128 MB", modified: "Mar 9" },
3592
+ { id: "5", name: "assets.zip", type: "archive", size: "56 MB", modified: "Mar 8" },
3593
+ { id: "6", name: "meeting-notes.pdf", type: "pdf", size: "1.1 MB", modified: "Mar 7" }
3594
+ ];
3595
+ var TYPE_ICON = {
3596
+ figma: FileText,
3597
+ image: Image,
3598
+ code: FileCode,
3599
+ video: Film,
3600
+ archive: Archive,
3601
+ pdf: FileText
3602
+ };
3603
+ var TYPE_COLOR = {
3604
+ figma: "text-purple-500",
3605
+ image: "text-green-500",
3606
+ code: "text-blue-500",
3607
+ video: "text-red-500",
3608
+ archive: "text-yellow-500",
3609
+ pdf: "text-orange-500"
3610
+ };
3611
+ function FileCard({ file }) {
3612
+ const Icon2 = TYPE_ICON[file.type] ?? File;
3613
+ return /* @__PURE__ */ jsx(Card, { className: "cursor-pointer hover:shadow-md transition-shadow", children: /* @__PURE__ */ jsxs(CardContent, { className: "p-4", children: [
3614
+ /* @__PURE__ */ jsx("div", { className: cn("flex h-10 w-10 items-center justify-center rounded-[var(--radius)] bg-[hsl(var(--muted))] mb-3", TYPE_COLOR[file.type]), children: /* @__PURE__ */ jsx(Icon2, { className: "h-5 w-5" }) }),
3615
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium truncate", children: file.name }),
3616
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mt-1", children: [
3617
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: file.size }),
3618
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: file.modified })
3619
+ ] })
3620
+ ] }) });
3621
+ }
3622
+ function FileCards({ files = FILES, className }) {
3623
+ return /* @__PURE__ */ jsx("div", { className: cn("grid gap-3", className), style: { gridTemplateColumns: "repeat(auto-fill, minmax(min(100%,160px),1fr))" }, children: files.map((f) => /* @__PURE__ */ jsx(FileCard, { file: f }, f.id)) });
3624
+ }
3625
+ var FILES2 = [
3626
+ { id: "1", name: "design-system.fig", type: "Figma", size: "14.2 MB", modified: "Mar 12, 2024" },
3627
+ { id: "2", name: "hero-banner.png", type: "PNG Image", size: "3.8 MB", modified: "Mar 11, 2024" },
3628
+ { id: "3", name: "api-spec.yaml", type: "YAML", size: "42 KB", modified: "Mar 10, 2024" },
3629
+ { id: "4", name: "demo-video.mp4", type: "MP4 Video", size: "128 MB", modified: "Mar 9, 2024" },
3630
+ { id: "5", name: "assets.zip", type: "ZIP Archive", size: "56 MB", modified: "Mar 8, 2024" }
3631
+ ];
3632
+ var TYPE_ICON2 = {
3633
+ Figma: FileText,
3634
+ "PNG Image": Image,
3635
+ YAML: FileCode,
3636
+ "MP4 Video": Film,
3637
+ "ZIP Archive": Archive
3638
+ };
3639
+ function FileRow({ file, onDelete }) {
3640
+ const Icon2 = TYPE_ICON2[file.type] ?? FileText;
3641
+ return /* @__PURE__ */ jsxs("tr", { className: "border-b border-[hsl(var(--border))] last:border-0 hover:bg-[hsl(var(--accent)/0.5)] transition-colors", children: [
3642
+ /* @__PURE__ */ jsx("td", { className: "px-4 py-3", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2.5", children: [
3643
+ /* @__PURE__ */ jsx(Icon2, { className: "h-4 w-4 shrink-0 text-[hsl(var(--muted-foreground))]" }),
3644
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: file.name })
3645
+ ] }) }),
3646
+ /* @__PURE__ */ jsx("td", { className: "px-4 py-3 text-sm text-[hsl(var(--muted-foreground))]", children: file.type }),
3647
+ /* @__PURE__ */ jsx("td", { className: "px-4 py-3 text-sm text-[hsl(var(--muted-foreground))]", children: file.size }),
3648
+ /* @__PURE__ */ jsx("td", { className: "px-4 py-3 text-sm text-[hsl(var(--muted-foreground))]", children: file.modified }),
3649
+ /* @__PURE__ */ jsx("td", { className: "px-4 py-3 text-right", children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [
3650
+ /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "icon", variant: "ghost", className: "h-7 w-7", children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }) }) }),
3651
+ /* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", children: [
3652
+ /* @__PURE__ */ jsxs(DropdownMenuItem, { children: [
3653
+ /* @__PURE__ */ jsx(Download, { className: "h-4 w-4" }),
3654
+ "Download"
3655
+ ] }),
3656
+ /* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: onDelete, className: "text-[hsl(var(--destructive))]", children: [
3657
+ /* @__PURE__ */ jsx(Trash2, { className: "h-4 w-4" }),
3658
+ "Delete"
3659
+ ] })
3660
+ ] })
3661
+ ] }) })
3662
+ ] });
3663
+ }
3664
+ function FilesList({ className }) {
3665
+ const [files, setFiles] = React14.useState(FILES2);
3666
+ return /* @__PURE__ */ jsx("div", { className: cn("rounded-[var(--radius)] border border-[hsl(var(--border))] overflow-hidden", className), children: /* @__PURE__ */ jsxs("table", { className: "w-full", children: [
3667
+ /* @__PURE__ */ jsx("thead", { className: "bg-[hsl(var(--muted)/0.5)]", children: /* @__PURE__ */ jsx("tr", { children: ["Name", "Type", "Size", "Modified", ""].map((h) => /* @__PURE__ */ jsx("th", { className: "px-4 py-2.5 text-left text-xs font-medium text-[hsl(var(--muted-foreground))]", children: h }, h)) }) }),
3668
+ /* @__PURE__ */ jsx("tbody", { children: files.map((f) => /* @__PURE__ */ jsx(FileRow, { file: f, onDelete: () => setFiles((fs) => fs.filter((x) => x.id !== f.id)) }, f.id)) })
3669
+ ] }) });
3670
+ }
3671
+ var PRIORITY_COLOR = {
3672
+ High: "bg-red-500/10 text-red-600 border-red-200",
3673
+ Medium: "bg-yellow-500/10 text-yellow-600 border-yellow-200",
3674
+ Low: "bg-green-500/10 text-green-600 border-green-200"
3675
+ };
3676
+ function TaskCard({
3677
+ title = "Redesign onboarding flow",
3678
+ description = "Update the user onboarding experience with the new design language.",
3679
+ assigneeInitials = "AC",
3680
+ dueDate = "Mar 20",
3681
+ priority = "High",
3682
+ className
3683
+ }) {
3684
+ return /* @__PURE__ */ jsx(Card, { className: cn("cursor-pointer hover:shadow-md transition-shadow", className), children: /* @__PURE__ */ jsxs(CardContent, { className: "p-4 space-y-3", children: [
3685
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
3686
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-semibold leading-tight", children: title }),
3687
+ /* @__PURE__ */ jsx("span", { className: cn("text-[10px] px-1.5 py-0.5 rounded-full border font-medium shrink-0", PRIORITY_COLOR[priority]), children: priority })
3688
+ ] }),
3689
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-[hsl(var(--muted-foreground))] leading-relaxed line-clamp-2", children: description }),
3690
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
3691
+ /* @__PURE__ */ jsx(Avatar, { className: "h-6 w-6", children: /* @__PURE__ */ jsx(AvatarFallback, { className: "text-[10px]", children: assigneeInitials }) }),
3692
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-xs text-[hsl(var(--muted-foreground))]", children: [
3693
+ /* @__PURE__ */ jsx(Calendar, { className: "h-3 w-3" }),
3694
+ dueDate
3695
+ ] })
3696
+ ] })
3697
+ ] }) });
3698
+ }
3699
+ var LABEL_COLORS = ["bg-blue-100 text-blue-700", "bg-purple-100 text-purple-700", "bg-green-100 text-green-700"];
3700
+ function TaskCardWithLabels({
3701
+ labels = ["Design", "Frontend"],
3702
+ ...props
3703
+ }) {
3704
+ return /* @__PURE__ */ jsx(Card, { className: cn("cursor-pointer hover:shadow-md transition-shadow", props.className), children: /* @__PURE__ */ jsxs(CardContent, { className: "p-4 space-y-3", children: [
3705
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
3706
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-semibold leading-tight", children: props.title ?? "Redesign onboarding flow" }),
3707
+ /* @__PURE__ */ jsx("span", { className: cn("text-[10px] px-1.5 py-0.5 rounded-full border font-medium shrink-0", PRIORITY_COLOR[props.priority ?? "High"]), children: props.priority ?? "High" })
3708
+ ] }),
3709
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-[hsl(var(--muted-foreground))] leading-relaxed line-clamp-2", children: props.description ?? "Update the user onboarding experience with the new design language." }),
3710
+ /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: labels.map((l, i) => /* @__PURE__ */ jsx("span", { className: cn("text-[10px] px-1.5 py-0.5 rounded-full font-medium", LABEL_COLORS[i % LABEL_COLORS.length]), children: l }, l)) }),
3711
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
3712
+ /* @__PURE__ */ jsx(Avatar, { className: "h-6 w-6", children: /* @__PURE__ */ jsx(AvatarFallback, { className: "text-[10px]", children: props.assigneeInitials ?? "AC" }) }),
3713
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-xs text-[hsl(var(--muted-foreground))]", children: [
3714
+ /* @__PURE__ */ jsx(Calendar, { className: "h-3 w-3" }),
3715
+ props.dueDate ?? "Mar 20"
3716
+ ] })
3717
+ ] })
3718
+ ] }) });
3719
+ }
3720
+ var TASKS = [
3721
+ { id: "1", title: "Redesign onboarding flow", assignee: "AC", priority: "High", status: "In Progress", done: false },
3722
+ { id: "2", title: "Fix authentication bug", assignee: "BS", priority: "High", status: "In Progress", done: false },
3723
+ { id: "3", title: "Write API documentation", assignee: "JD", priority: "Medium", status: "Todo", done: false },
3724
+ { id: "4", title: "Add dark mode support", assignee: "TR", priority: "Low", status: "Todo", done: false },
3725
+ { id: "5", title: "Setup CI/CD pipeline", assignee: "SK", priority: "Medium", status: "Done", done: true },
3726
+ { id: "6", title: "Deploy to staging", assignee: "ML", priority: "Low", status: "Done", done: true }
3727
+ ];
3728
+ var PRIORITY_DOT = {
3729
+ High: "bg-red-500",
3730
+ Medium: "bg-yellow-500",
3731
+ Low: "bg-green-500"
3732
+ };
3733
+ var SECTIONS = ["In Progress", "Todo", "Done"];
3734
+ function TaskRow({ task, onToggle }) {
3735
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 px-3 py-2.5 hover:bg-[hsl(var(--accent)/0.5)] rounded-md transition-colors", children: [
3736
+ /* @__PURE__ */ jsx(Checkbox, { checked: task.done, onCheckedChange: onToggle }),
3737
+ /* @__PURE__ */ jsx("span", { className: cn("flex-1 text-sm", task.done && "line-through text-[hsl(var(--muted-foreground))]"), children: task.title }),
3738
+ /* @__PURE__ */ jsx("span", { className: cn("h-2 w-2 rounded-full shrink-0", PRIORITY_DOT[task.priority]), title: task.priority }),
3739
+ /* @__PURE__ */ jsx(Avatar, { className: "h-6 w-6 shrink-0", children: /* @__PURE__ */ jsx(AvatarFallback, { className: "text-[10px]", children: task.assignee }) })
3740
+ ] });
3741
+ }
3742
+ function SortableTaskList({ className }) {
3743
+ const [tasks, setTasks] = useState(TASKS);
3744
+ const toggle = (id) => setTasks((ts) => ts.map((t) => t.id === id ? { ...t, done: !t.done } : t));
3745
+ return /* @__PURE__ */ jsx("div", { className: cn("rounded-[var(--radius)] border border-[hsl(var(--border))] bg-[hsl(var(--card))] p-4 space-y-4", className), children: SECTIONS.map((section) => {
3746
+ const items = tasks.filter((t) => t.status === section);
3747
+ return /* @__PURE__ */ jsxs("div", { children: [
3748
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-1.5", children: [
3749
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-semibold text-[hsl(var(--muted-foreground))] uppercase tracking-wide", children: section }),
3750
+ /* @__PURE__ */ jsxs("span", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: [
3751
+ "(",
3752
+ items.length,
3753
+ ")"
3754
+ ] })
3755
+ ] }),
3756
+ /* @__PURE__ */ jsx("div", { className: "space-y-0.5", children: items.map((task) => /* @__PURE__ */ jsx(TaskRow, { task, onToggle: () => toggle(task.id) }, task.id)) })
3757
+ ] }, section);
3758
+ }) });
3759
+ }
3760
+
3761
+ export { AppShell, AppShellMain, AppShellSidebar, AreaChart, ArrayField, AutoForm, Avatar, AvatarFallback, AvatarImage, Badge, Banner, BarChart, Beacon, BlinkUIProvider, Breadcrumb, BreadcrumbItem, BreadcrumbPage, BreadcrumbSeparator, BulkActions, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChatDetail, Checkbox, CommandBar, CommandBarEmpty, CommandBarGroup, CommandBarItem, CommandItem, Container, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DataGrid, DataTable, DataTableColumnHeader, DataTablePagination, DataTableToolbar, DatePicker, 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, EmptyState, EmptyStateIcon, FeedbackModal, Field, FieldDescription, FieldError, FieldLabel, FileCards, FileUpload, FileUploadPreview, FilesList, FilterBadge, Filters, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HStack, HotkeyBadge, Hotkeys, IconBadge, Input, IntegrationCard, InviteModal, Kanban, KanbanCard, KanbanColumn, LineChart, LoadingOverlay, ManageTagsModal, MessagesCard, MetricCard, MetricCardWithButton, MetricCardWithIcon, Navbar, NavbarBrand, NavbarContent, NavbarItem, NotificationSettings, ObjectField, OrgMenu, Page, PageActions, PageBody, PageDescription, PageHeader, PageTitle, PasswordInput, Persona, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, PropertyItem, PropertyList, RadioGroup, RadioGroupItem, ResizeBox, ResizeHandle, RolesMenu, SearchInput, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectUsersModal, SelectValue, Separator4 as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupLabel, SidebarHeader, SidebarItem, SidebarLayoutDashboard, SidebarLayoutGroups, SidebarLayoutMinimal, SidebarLayoutSearch, SidebarLayoutUser, SidebarSeparator, Skeleton, Slider, SortableTaskList, Sparkline, SplitPage, SplitPageDetail, SplitPageList, Stack, StackedLayoutBranded, StackedLayoutTabs, Stat, StatGroup, StepForm, StepFormNavigation, StepFormStep, Stepper, StructuredList, StructuredListItem, StructuredListSection, Switch, Tabs, TabsContent, TabsList, TabsTrigger, TaskCard, TaskCardWithLabels, Textarea, Timeline, TimelineConnector, TimelineContent, TimelineItem, Toaster, ToggleButton, ToggleButtonGroup, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Tour, TourStep, UserMenu, VStack, WorkspaceMembers, badgeVariants, buttonVariants, cn, useAppShell, useBlinkUI, useCommandBar, useTour };
3762
+ //# sourceMappingURL=out.js.map
3763
+ //# sourceMappingURL=index.mjs.map