@hai3/uikit 0.1.0-alpha.5 → 0.1.0-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js DELETED
@@ -1,2975 +0,0 @@
1
- import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
2
- import { jsx, jsxs } from 'react/jsx-runtime';
3
- import * as React18 from 'react';
4
- import React18__default from 'react';
5
- import * as AvatarPrimitive from '@radix-ui/react-avatar';
6
- import { clsx } from 'clsx';
7
- import { twMerge } from 'tailwind-merge';
8
- import { Slot } from '@radix-ui/react-slot';
9
- import { cva } from 'class-variance-authority';
10
- import { ButtonSize, ButtonVariant, IconButtonSize } from '@hai3/uikit-contracts';
11
- export { ButtonSize, ButtonVariant, IconButtonSize } from '@hai3/uikit-contracts';
12
- import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
13
- import * as SwitchPrimitives from '@radix-ui/react-switch';
14
- import { Loader2, ChevronDown, X, ArrowLeft, ArrowRight, ChevronUp, Check, ChevronRight, MoreHorizontal, GripVertical, User, Bot, Paperclip, Send, Plus, Search } from 'lucide-react';
15
- import { trim, toUpper } from 'lodash';
16
- import * as SliderPrimitive from '@radix-ui/react-slider';
17
- import * as ProgressPrimitive from '@radix-ui/react-progress';
18
- import * as TooltipPrimitive from '@radix-ui/react-tooltip';
19
- import * as PopoverPrimitive from '@radix-ui/react-popover';
20
- import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
21
- import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
22
- import * as MenubarPrimitive from '@radix-ui/react-menubar';
23
- import * as TabsPrimitive from '@radix-ui/react-tabs';
24
- import * as SheetPrimitive from '@radix-ui/react-dialog';
25
- import { Drawer as Drawer$1 } from 'vaul';
26
- import * as ResizablePrimitive from 'react-resizable-panels';
27
- import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
28
- import * as SeparatorPrimitive from '@radix-ui/react-separator';
29
- import * as AccordionPrimitive from '@radix-ui/react-accordion';
30
- import useEmblaCarousel from 'embla-carousel-react';
31
- import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
32
- export { Area, AreaChart, Bar, BarChart, Brush, CartesianGrid, Cell, Legend as ChartLegend, Tooltip as ChartTooltip, ComposedChart, Cross, Curve, Customized, Dot, ErrorBar, Funnel, FunnelChart, Label, LabelList, Line, LineChart, Pie, PieChart, PolarAngleAxis, PolarGrid, PolarRadiusAxis, Polygon, Radar, RadarChart, RadialBar, RadialBarChart, Rectangle, ReferenceArea, ReferenceDot, ReferenceLine, ResponsiveContainer, Sankey, Scatter, ScatterChart, Sector, Text, Treemap, XAxis, YAxis, ZAxis } from 'recharts';
33
- import * as SelectPrimitive from '@radix-ui/react-select';
34
- import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
35
- import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
36
-
37
- // src/base/aspect-ratio.tsx
38
- function AspectRatio({
39
- ...props
40
- }) {
41
- return /* @__PURE__ */ jsx(AspectRatioPrimitive.Root, { "data-slot": "aspect-ratio", ...props });
42
- }
43
- function cn(...inputs) {
44
- return twMerge(clsx(inputs));
45
- }
46
- var Avatar = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
47
- AvatarPrimitive.Root,
48
- {
49
- ref,
50
- className: cn(
51
- "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
52
- className
53
- ),
54
- ...props
55
- }
56
- ));
57
- Avatar.displayName = AvatarPrimitive.Root.displayName;
58
- var AvatarImage = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
59
- AvatarPrimitive.Image,
60
- {
61
- ref,
62
- className: cn("aspect-square h-full w-full", className),
63
- ...props
64
- }
65
- ));
66
- AvatarImage.displayName = AvatarPrimitive.Image.displayName;
67
- var AvatarFallback = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
68
- AvatarPrimitive.Fallback,
69
- {
70
- ref,
71
- className: cn(
72
- "flex h-full w-full items-center justify-center rounded-full bg-muted",
73
- className
74
- ),
75
- ...props
76
- }
77
- ));
78
- AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
79
- var buttonVariants = cva(
80
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
81
- {
82
- variants: {
83
- variant: {
84
- [ButtonVariant.Default]: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
85
- [ButtonVariant.Destructive]: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
86
- [ButtonVariant.Outline]: "border border-input bg-background shadow-sm hover:bg-accent data-[state=open]:bg-accent",
87
- [ButtonVariant.Secondary]: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
88
- [ButtonVariant.Ghost]: "hover:bg-accent data-[state=open]:bg-accent",
89
- [ButtonVariant.Link]: "text-primary underline-offset-4 hover:underline"
90
- },
91
- size: {
92
- [ButtonSize.Default]: "h-9 px-4 py-2",
93
- [ButtonSize.Sm]: "h-8 rounded-md px-3 text-xs",
94
- [ButtonSize.Lg]: "h-10 rounded-md px-8",
95
- [ButtonSize.Icon]: "h-9 w-9"
96
- }
97
- },
98
- defaultVariants: {
99
- variant: ButtonVariant.Default,
100
- size: ButtonSize.Default
101
- }
102
- }
103
- );
104
- var Button = React18.forwardRef(
105
- ({ className, variant, size, asChild = false, ...props }, ref) => {
106
- const Comp = asChild ? Slot : "button";
107
- return /* @__PURE__ */ jsx(
108
- Comp,
109
- {
110
- className: cn(buttonVariants({ variant, size, className })),
111
- ref,
112
- ...props
113
- }
114
- );
115
- }
116
- );
117
- Button.displayName = "Button";
118
- var badgeVariants = cva(
119
- "inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
120
- {
121
- variants: {
122
- variant: {
123
- default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
124
- secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
125
- destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
126
- outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
127
- }
128
- },
129
- defaultVariants: {
130
- variant: "default"
131
- }
132
- }
133
- );
134
- function Badge({
135
- className,
136
- variant,
137
- asChild = false,
138
- ...props
139
- }) {
140
- const Comp = asChild ? Slot : "span";
141
- return /* @__PURE__ */ jsx(
142
- Comp,
143
- {
144
- className: cn(badgeVariants({ variant }), className),
145
- ...props
146
- }
147
- );
148
- }
149
- var CheckIcon = ({ className = "" }) => {
150
- return /* @__PURE__ */ jsx(
151
- "svg",
152
- {
153
- className,
154
- width: "16",
155
- height: "16",
156
- viewBox: "0 0 24 24",
157
- fill: "none",
158
- stroke: "currentColor",
159
- strokeWidth: "2",
160
- strokeLinecap: "round",
161
- strokeLinejoin: "round",
162
- children: /* @__PURE__ */ jsx("path", { d: "M20 6 9 17l-5-5" })
163
- }
164
- );
165
- };
166
- function Checkbox({
167
- className,
168
- ...props
169
- }) {
170
- return /* @__PURE__ */ jsx(
171
- CheckboxPrimitive.Root,
172
- {
173
- "data-slot": "checkbox",
174
- className: cn(
175
- "peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
176
- className
177
- ),
178
- ...props,
179
- children: /* @__PURE__ */ jsx(
180
- CheckboxPrimitive.Indicator,
181
- {
182
- "data-slot": "checkbox-indicator",
183
- className: "grid place-content-center text-current transition-none",
184
- children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-3.5" })
185
- }
186
- )
187
- }
188
- );
189
- }
190
- var Input = React18.forwardRef(
191
- ({ className, type, ...props }, ref) => {
192
- return /* @__PURE__ */ jsx(
193
- "input",
194
- {
195
- type,
196
- className: cn(
197
- "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
198
- className
199
- ),
200
- ref,
201
- ...props
202
- }
203
- );
204
- }
205
- );
206
- Input.displayName = "Input";
207
- var Textarea = React18.forwardRef(
208
- ({ className, autoResize = false, minHeight = 50, maxHeight = 350, size = "default", onChange, ...props }, ref) => {
209
- const internalRef = React18.useRef(null);
210
- React18.useImperativeHandle(ref, () => internalRef.current);
211
- const sizeClasses = {
212
- sm: "min-h-11 h-11",
213
- // 44px / 2.75rem - exact height
214
- default: "min-h-[60px]",
215
- // 60px / 3.75rem
216
- lg: "min-h-20"
217
- // 80px / 5rem
218
- };
219
- const paddingClasses = {
220
- sm: "py-3",
221
- // 12px top + 12px bottom + 20px line-height = 44px
222
- default: "py-2",
223
- // 8px top + 8px bottom (default)
224
- lg: "py-2"
225
- // 8px top + 8px bottom (default)
226
- };
227
- const handleResize = React18.useCallback(() => {
228
- if (autoResize && size !== "sm" && internalRef.current) {
229
- const textarea = internalRef.current;
230
- textarea.style.height = "auto";
231
- const scrollHeight = textarea.scrollHeight;
232
- textarea.style.height = `${Math.min(Math.max(scrollHeight, minHeight), maxHeight)}px`;
233
- }
234
- }, [autoResize, size, minHeight, maxHeight]);
235
- React18.useEffect(() => {
236
- handleResize();
237
- }, [handleResize, props.value]);
238
- const handleChange = React18.useCallback(
239
- (e) => {
240
- handleResize();
241
- onChange?.(e);
242
- },
243
- [onChange, handleResize]
244
- );
245
- return /* @__PURE__ */ jsx(
246
- "textarea",
247
- {
248
- className: cn(
249
- "flex w-full rounded-md border border-input bg-transparent px-3 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
250
- sizeClasses[size],
251
- paddingClasses[size],
252
- className
253
- ),
254
- ref: internalRef,
255
- onChange: handleChange,
256
- ...props
257
- }
258
- );
259
- }
260
- );
261
- Textarea.displayName = "Textarea";
262
- var Switch = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
263
- SwitchPrimitives.Root,
264
- {
265
- className: cn(
266
- "peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
267
- className
268
- ),
269
- ...props,
270
- ref,
271
- children: /* @__PURE__ */ jsx(
272
- SwitchPrimitives.Thumb,
273
- {
274
- className: cn(
275
- "pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform",
276
- "data-[state=checked]:ltr:translate-x-4 data-[state=checked]:rtl:-translate-x-4",
277
- "data-[state=unchecked]:translate-x-0"
278
- )
279
- }
280
- )
281
- }
282
- ));
283
- Switch.displayName = SwitchPrimitives.Root.displayName;
284
- function Skeleton({
285
- className,
286
- inheritColor = false,
287
- ...props
288
- }) {
289
- return /* @__PURE__ */ jsx(
290
- "div",
291
- {
292
- className: cn(
293
- "animate-pulse rounded-md",
294
- inheritColor ? "bg-current opacity-20" : "bg-muted",
295
- className
296
- ),
297
- ...props
298
- }
299
- );
300
- }
301
- var Spinner = React18.forwardRef(
302
- ({ className, icon: Icon2 = Loader2, size = "size-4", ...props }, ref) => {
303
- const textColorClasses = className?.match(/\btext-\S+/g)?.join(" ") || "";
304
- const wrapperClasses = trim(className?.replace(/\btext-\S+/g, "") || "");
305
- return /* @__PURE__ */ jsx(
306
- "div",
307
- {
308
- ref,
309
- className: cn("inline-flex items-center justify-center", wrapperClasses),
310
- ...props,
311
- children: /* @__PURE__ */ jsx(Icon2, { className: cn("animate-spin", size, textColorClasses) })
312
- }
313
- );
314
- }
315
- );
316
- Spinner.displayName = "Spinner";
317
- var Slider = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
318
- SliderPrimitive.Root,
319
- {
320
- ref,
321
- className: cn(
322
- "relative flex w-full touch-none select-none items-center",
323
- className
324
- ),
325
- ...props
326
- }
327
- ));
328
- Slider.displayName = SliderPrimitive.Root.displayName;
329
- var SliderTrack = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
330
- SliderPrimitive.Track,
331
- {
332
- ref,
333
- className: cn(
334
- "relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",
335
- className
336
- ),
337
- ...props
338
- }
339
- ));
340
- SliderTrack.displayName = SliderPrimitive.Track.displayName;
341
- var SliderRange = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
342
- SliderPrimitive.Range,
343
- {
344
- ref,
345
- className: cn("absolute h-full bg-primary", className),
346
- ...props
347
- }
348
- ));
349
- SliderRange.displayName = SliderPrimitive.Range.displayName;
350
- var SliderThumb = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
351
- SliderPrimitive.Thumb,
352
- {
353
- ref,
354
- className: cn(
355
- "block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
356
- className
357
- ),
358
- ...props
359
- }
360
- ));
361
- SliderThumb.displayName = SliderPrimitive.Thumb.displayName;
362
- var Progress = React18.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ jsx(
363
- ProgressPrimitive.Root,
364
- {
365
- ref,
366
- className: cn(
367
- "relative h-2 w-full overflow-hidden rounded-full bg-primary/20",
368
- className
369
- ),
370
- ...props,
371
- children: /* @__PURE__ */ jsx(
372
- ProgressPrimitive.Indicator,
373
- {
374
- className: "h-full w-full flex-1 bg-primary transition-all",
375
- style: { transform: `translateX(-${100 - (value || 0)}%)` }
376
- }
377
- )
378
- }
379
- ));
380
- Progress.displayName = ProgressPrimitive.Root.displayName;
381
- var TooltipProvider = ({
382
- delayDuration = 0,
383
- ...props
384
- }) => /* @__PURE__ */ jsx(
385
- TooltipPrimitive.Provider,
386
- {
387
- delayDuration,
388
- ...props
389
- }
390
- );
391
- TooltipProvider.displayName = TooltipPrimitive.Provider.displayName;
392
- var Tooltip = ({
393
- ...props
394
- }) => /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(TooltipPrimitive.Root, { ...props }) });
395
- Tooltip.displayName = TooltipPrimitive.Root.displayName;
396
- var TooltipTrigger = React18.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { ref, ...props }));
397
- TooltipTrigger.displayName = TooltipPrimitive.Trigger.displayName;
398
- var TooltipContent = React18.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx(
399
- TooltipPrimitive.Content,
400
- {
401
- ref,
402
- sideOffset,
403
- className: cn(
404
- "z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
405
- className
406
- ),
407
- ...props
408
- }
409
- ) }));
410
- TooltipContent.displayName = TooltipPrimitive.Content.displayName;
411
- var Popover = PopoverPrimitive.Root;
412
- Popover.displayName = "Popover";
413
- var PopoverTrigger = React18.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx(
414
- PopoverPrimitive.Trigger,
415
- {
416
- ref,
417
- "data-slot": "popover-trigger",
418
- ...props
419
- }
420
- ));
421
- PopoverTrigger.displayName = "PopoverTrigger";
422
- var PopoverContent = React18.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
423
- PopoverPrimitive.Content,
424
- {
425
- ref,
426
- "data-slot": "popover-content",
427
- align,
428
- sideOffset,
429
- className: cn(
430
- "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
431
- className
432
- ),
433
- ...props
434
- }
435
- ) }));
436
- PopoverContent.displayName = "PopoverContent";
437
- var PopoverAnchor = React18.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx(
438
- PopoverPrimitive.Anchor,
439
- {
440
- ref,
441
- "data-slot": "popover-anchor",
442
- ...props
443
- }
444
- ));
445
- PopoverAnchor.displayName = "PopoverAnchor";
446
- var HoverCard = HoverCardPrimitive.Root;
447
- HoverCard.displayName = "HoverCard";
448
- var HoverCardTrigger = React18.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx(
449
- HoverCardPrimitive.Trigger,
450
- {
451
- ref,
452
- "data-slot": "hover-card-trigger",
453
- ...props
454
- }
455
- ));
456
- HoverCardTrigger.displayName = "HoverCardTrigger";
457
- var HoverCardContent = React18.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(HoverCardPrimitive.Portal, { "data-slot": "hover-card-portal", children: /* @__PURE__ */ jsx(
458
- HoverCardPrimitive.Content,
459
- {
460
- ref,
461
- "data-slot": "hover-card-content",
462
- align,
463
- sideOffset,
464
- className: cn(
465
- "z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
466
- className
467
- ),
468
- ...props
469
- }
470
- ) }));
471
- HoverCardContent.displayName = "HoverCardContent";
472
- var Card = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
473
- "div",
474
- {
475
- ref,
476
- className: cn(
477
- "rounded-xl border bg-card text-card-foreground shadow",
478
- className
479
- ),
480
- ...props
481
- }
482
- ));
483
- Card.displayName = "Card";
484
- var CardHeader = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
485
- "div",
486
- {
487
- ref,
488
- className: cn("flex flex-col space-y-1.5 p-6", className),
489
- ...props
490
- }
491
- ));
492
- CardHeader.displayName = "CardHeader";
493
- var CardTitle = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
494
- "div",
495
- {
496
- ref,
497
- className: cn("font-semibold leading-none tracking-tight", className),
498
- ...props
499
- }
500
- ));
501
- CardTitle.displayName = "CardTitle";
502
- var CardDescription = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
503
- "div",
504
- {
505
- ref,
506
- className: cn("text-sm text-muted-foreground", className),
507
- ...props
508
- }
509
- ));
510
- CardDescription.displayName = "CardDescription";
511
- var CardContent = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("p-6 pt-0", className), ...props }));
512
- CardContent.displayName = "CardContent";
513
- var CardFooter = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
514
- "div",
515
- {
516
- ref,
517
- className: cn("flex items-center p-6 pt-0", className),
518
- ...props
519
- }
520
- ));
521
- CardFooter.displayName = "CardFooter";
522
- var Header = React18__default.forwardRef(
523
- ({ children, className }, ref) => {
524
- return /* @__PURE__ */ jsx(
525
- "header",
526
- {
527
- ref,
528
- className: cn(
529
- "flex items-center justify-end px-6 py-4 bg-background border-b border-border h-16 w-full",
530
- className
531
- ),
532
- children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-4", children })
533
- }
534
- );
535
- }
536
- );
537
- Header.displayName = "Header";
538
- var NavigationMenu = React18.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
539
- NavigationMenuPrimitive.Root,
540
- {
541
- ref,
542
- className: cn(
543
- "relative z-10 flex max-w-max flex-1 items-center justify-center",
544
- className
545
- ),
546
- ...props,
547
- children: [
548
- children,
549
- /* @__PURE__ */ jsx(NavigationMenuViewport, {})
550
- ]
551
- }
552
- ));
553
- NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;
554
- var NavigationMenuList = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
555
- NavigationMenuPrimitive.List,
556
- {
557
- ref,
558
- className: cn(
559
- "group flex flex-1 list-none items-center justify-center space-x-1",
560
- className
561
- ),
562
- ...props
563
- }
564
- ));
565
- NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;
566
- var NavigationMenuItem = NavigationMenuPrimitive.Item;
567
- var navigationMenuTriggerStyle = cva(
568
- "group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:text-accent-foreground data-[state=open]:bg-accent/50 data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent"
569
- );
570
- var NavigationMenuTrigger = React18.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
571
- NavigationMenuPrimitive.Trigger,
572
- {
573
- ref,
574
- className: cn(navigationMenuTriggerStyle(), "group", className),
575
- ...props,
576
- children: [
577
- children,
578
- " ",
579
- /* @__PURE__ */ jsx(
580
- ChevronDown,
581
- {
582
- className: "relative top-[1px] ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180",
583
- "aria-hidden": "true"
584
- }
585
- )
586
- ]
587
- }
588
- ));
589
- NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;
590
- var NavigationMenuContent = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
591
- NavigationMenuPrimitive.Content,
592
- {
593
- ref,
594
- className: cn(
595
- "left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",
596
- className
597
- ),
598
- ...props
599
- }
600
- ));
601
- NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
602
- var NavigationMenuLink = NavigationMenuPrimitive.Link;
603
- var NavigationMenuViewport = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: cn("absolute left-0 top-full flex justify-center"), children: /* @__PURE__ */ jsx(
604
- NavigationMenuPrimitive.Viewport,
605
- {
606
- className: cn(
607
- "origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
608
- className
609
- ),
610
- ref,
611
- ...props
612
- }
613
- ) }));
614
- NavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;
615
- var NavigationMenuIndicator = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
616
- NavigationMenuPrimitive.Indicator,
617
- {
618
- ref,
619
- className: cn(
620
- "top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",
621
- className
622
- ),
623
- ...props,
624
- children: /* @__PURE__ */ jsx("div", { className: "relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" })
625
- }
626
- ));
627
- NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;
628
- function Breadcrumb({ ...props }) {
629
- return /* @__PURE__ */ jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
630
- }
631
- function BreadcrumbList({ className, ...props }) {
632
- return /* @__PURE__ */ jsx(
633
- "ol",
634
- {
635
- "data-slot": "breadcrumb-list",
636
- className: cn(
637
- "text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",
638
- className
639
- ),
640
- ...props
641
- }
642
- );
643
- }
644
- function BreadcrumbItem({ className, ...props }) {
645
- return /* @__PURE__ */ jsx(
646
- "li",
647
- {
648
- "data-slot": "breadcrumb-item",
649
- className: cn("inline-flex items-center gap-1.5", className),
650
- ...props
651
- }
652
- );
653
- }
654
- function BreadcrumbLink({
655
- asChild,
656
- className,
657
- ...props
658
- }) {
659
- const Comp = asChild ? Slot : "a";
660
- return /* @__PURE__ */ jsx(
661
- Comp,
662
- {
663
- "data-slot": "breadcrumb-link",
664
- className: cn("hover:text-foreground transition-colors", className),
665
- ...props
666
- }
667
- );
668
- }
669
- function BreadcrumbPage({ className, ...props }) {
670
- return /* @__PURE__ */ jsx(
671
- "span",
672
- {
673
- "data-slot": "breadcrumb-page",
674
- role: "link",
675
- "aria-disabled": "true",
676
- "aria-current": "page",
677
- className: cn("text-foreground font-normal", className),
678
- ...props
679
- }
680
- );
681
- }
682
- function BreadcrumbSeparator({
683
- children,
684
- className,
685
- ...props
686
- }) {
687
- return /* @__PURE__ */ jsx(
688
- "li",
689
- {
690
- "data-slot": "breadcrumb-separator",
691
- role: "presentation",
692
- "aria-hidden": "true",
693
- className: cn("[&>svg]:size-3.5", className),
694
- ...props,
695
- children: children ?? /* @__PURE__ */ jsx(ChevronRight, {})
696
- }
697
- );
698
- }
699
- function BreadcrumbEllipsis({
700
- className,
701
- ...props
702
- }) {
703
- return /* @__PURE__ */ jsxs(
704
- "span",
705
- {
706
- "data-slot": "breadcrumb-ellipsis",
707
- role: "presentation",
708
- "aria-hidden": "true",
709
- className: cn("flex size-9 items-center justify-center", className),
710
- ...props,
711
- children: [
712
- /* @__PURE__ */ jsx(MoreHorizontal, { className: "size-4" }),
713
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "More" })
714
- ]
715
- }
716
- );
717
- }
718
- var ChevronRightIcon = ({ className = "" }) => {
719
- return /* @__PURE__ */ jsx(
720
- "svg",
721
- {
722
- className,
723
- width: "16",
724
- height: "16",
725
- viewBox: "0 0 24 24",
726
- fill: "none",
727
- stroke: "currentColor",
728
- strokeWidth: "2",
729
- strokeLinecap: "round",
730
- strokeLinejoin: "round",
731
- children: /* @__PURE__ */ jsx("path", { d: "m9 18 6-6-6-6" })
732
- }
733
- );
734
- };
735
- var CircleIcon = ({ className = "" }) => {
736
- return /* @__PURE__ */ jsx(
737
- "svg",
738
- {
739
- className,
740
- width: "16",
741
- height: "16",
742
- viewBox: "0 0 24 24",
743
- fill: "none",
744
- stroke: "currentColor",
745
- strokeWidth: "2",
746
- strokeLinecap: "round",
747
- strokeLinejoin: "round",
748
- children: /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" })
749
- }
750
- );
751
- };
752
- function Menubar({
753
- className,
754
- ...props
755
- }) {
756
- return /* @__PURE__ */ jsx(
757
- MenubarPrimitive.Root,
758
- {
759
- "data-slot": "menubar",
760
- className: cn(
761
- "bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs",
762
- className
763
- ),
764
- ...props
765
- }
766
- );
767
- }
768
- function MenubarMenu({
769
- ...props
770
- }) {
771
- return /* @__PURE__ */ jsx(MenubarPrimitive.Menu, { "data-slot": "menubar-menu", ...props });
772
- }
773
- function MenubarGroup({
774
- ...props
775
- }) {
776
- return /* @__PURE__ */ jsx(MenubarPrimitive.Group, { "data-slot": "menubar-group", ...props });
777
- }
778
- function MenubarPortal({
779
- ...props
780
- }) {
781
- return /* @__PURE__ */ jsx(MenubarPrimitive.Portal, { "data-slot": "menubar-portal", ...props });
782
- }
783
- function MenubarRadioGroup({
784
- ...props
785
- }) {
786
- return /* @__PURE__ */ jsx(MenubarPrimitive.RadioGroup, { "data-slot": "menubar-radio-group", ...props });
787
- }
788
- function MenubarTrigger({
789
- className,
790
- ...props
791
- }) {
792
- return /* @__PURE__ */ jsx(
793
- MenubarPrimitive.Trigger,
794
- {
795
- "data-slot": "menubar-trigger",
796
- className: cn(
797
- "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none",
798
- className
799
- ),
800
- ...props
801
- }
802
- );
803
- }
804
- function MenubarContent({
805
- className,
806
- align = "start",
807
- alignOffset = -4,
808
- sideOffset = 8,
809
- ...props
810
- }) {
811
- return /* @__PURE__ */ jsx(MenubarPortal, { children: /* @__PURE__ */ jsx(
812
- MenubarPrimitive.Content,
813
- {
814
- "data-slot": "menubar-content",
815
- align,
816
- alignOffset,
817
- sideOffset,
818
- className: cn(
819
- "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md",
820
- className
821
- ),
822
- ...props
823
- }
824
- ) });
825
- }
826
- function MenubarItem({
827
- className,
828
- inset,
829
- variant = "default",
830
- ...props
831
- }) {
832
- return /* @__PURE__ */ jsx(
833
- MenubarPrimitive.Item,
834
- {
835
- "data-slot": "menubar-item",
836
- "data-inset": inset,
837
- "data-variant": variant,
838
- className: cn(
839
- "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
840
- className
841
- ),
842
- ...props
843
- }
844
- );
845
- }
846
- function MenubarCheckboxItem({
847
- className,
848
- children,
849
- checked,
850
- ...props
851
- }) {
852
- return /* @__PURE__ */ jsxs(
853
- MenubarPrimitive.CheckboxItem,
854
- {
855
- "data-slot": "menubar-checkbox-item",
856
- className: cn(
857
- "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
858
- className
859
- ),
860
- checked,
861
- ...props,
862
- children: [
863
- /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(MenubarPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
864
- children
865
- ]
866
- }
867
- );
868
- }
869
- function MenubarRadioItem({
870
- className,
871
- children,
872
- ...props
873
- }) {
874
- return /* @__PURE__ */ jsxs(
875
- MenubarPrimitive.RadioItem,
876
- {
877
- "data-slot": "menubar-radio-item",
878
- className: cn(
879
- "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
880
- className
881
- ),
882
- ...props,
883
- children: [
884
- /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(MenubarPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CircleIcon, { className: "size-2 fill-current" }) }) }),
885
- children
886
- ]
887
- }
888
- );
889
- }
890
- function MenubarLabel({
891
- className,
892
- inset,
893
- ...props
894
- }) {
895
- return /* @__PURE__ */ jsx(
896
- MenubarPrimitive.Label,
897
- {
898
- "data-slot": "menubar-label",
899
- "data-inset": inset,
900
- className: cn(
901
- "px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
902
- className
903
- ),
904
- ...props
905
- }
906
- );
907
- }
908
- function MenubarSeparator({
909
- className,
910
- ...props
911
- }) {
912
- return /* @__PURE__ */ jsx(
913
- MenubarPrimitive.Separator,
914
- {
915
- "data-slot": "menubar-separator",
916
- className: cn("bg-border -mx-1 my-1 h-px", className),
917
- ...props
918
- }
919
- );
920
- }
921
- function MenubarShortcut({
922
- className,
923
- ...props
924
- }) {
925
- return /* @__PURE__ */ jsx(
926
- "span",
927
- {
928
- "data-slot": "menubar-shortcut",
929
- className: cn(
930
- "text-muted-foreground ml-auto text-xs tracking-widest",
931
- className
932
- ),
933
- ...props
934
- }
935
- );
936
- }
937
- function MenubarSub({
938
- ...props
939
- }) {
940
- return /* @__PURE__ */ jsx(MenubarPrimitive.Sub, { "data-slot": "menubar-sub", ...props });
941
- }
942
- function MenubarSubTrigger({
943
- className,
944
- inset,
945
- children,
946
- ...props
947
- }) {
948
- return /* @__PURE__ */ jsxs(
949
- MenubarPrimitive.SubTrigger,
950
- {
951
- "data-slot": "menubar-sub-trigger",
952
- "data-inset": inset,
953
- className: cn(
954
- "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[inset]:pl-8",
955
- className
956
- ),
957
- ...props,
958
- children: [
959
- children,
960
- /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto h-4 w-4" })
961
- ]
962
- }
963
- );
964
- }
965
- function MenubarSubContent({
966
- className,
967
- ...props
968
- }) {
969
- return /* @__PURE__ */ jsx(
970
- MenubarPrimitive.SubContent,
971
- {
972
- "data-slot": "menubar-sub-content",
973
- className: cn(
974
- "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
975
- className
976
- ),
977
- ...props
978
- }
979
- );
980
- }
981
- var ChevronLeftIcon = ({ className = "" }) => {
982
- return /* @__PURE__ */ jsx(
983
- "svg",
984
- {
985
- className,
986
- width: "16",
987
- height: "16",
988
- viewBox: "0 0 24 24",
989
- fill: "none",
990
- stroke: "currentColor",
991
- strokeWidth: "2",
992
- strokeLinecap: "round",
993
- strokeLinejoin: "round",
994
- children: /* @__PURE__ */ jsx("path", { d: "m15 18-6-6 6-6" })
995
- }
996
- );
997
- };
998
- var MoreHorizontalIcon = ({ className = "" }) => {
999
- return /* @__PURE__ */ jsxs(
1000
- "svg",
1001
- {
1002
- className,
1003
- width: "16",
1004
- height: "16",
1005
- viewBox: "0 0 24 24",
1006
- fill: "none",
1007
- stroke: "currentColor",
1008
- strokeWidth: "2",
1009
- strokeLinecap: "round",
1010
- strokeLinejoin: "round",
1011
- children: [
1012
- /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "1" }),
1013
- /* @__PURE__ */ jsx("circle", { cx: "19", cy: "12", r: "1" }),
1014
- /* @__PURE__ */ jsx("circle", { cx: "5", cy: "12", r: "1" })
1015
- ]
1016
- }
1017
- );
1018
- };
1019
- function Pagination({ className, ...props }) {
1020
- return /* @__PURE__ */ jsx(
1021
- "nav",
1022
- {
1023
- role: "navigation",
1024
- "aria-label": "pagination",
1025
- "data-slot": "pagination",
1026
- className: cn("mx-auto flex w-full justify-center", className),
1027
- ...props
1028
- }
1029
- );
1030
- }
1031
- function PaginationContent({
1032
- className,
1033
- ...props
1034
- }) {
1035
- return /* @__PURE__ */ jsx(
1036
- "ul",
1037
- {
1038
- "data-slot": "pagination-content",
1039
- className: cn("flex flex-row items-center gap-1", className),
1040
- ...props
1041
- }
1042
- );
1043
- }
1044
- function PaginationItem({ ...props }) {
1045
- return /* @__PURE__ */ jsx("li", { "data-slot": "pagination-item", ...props });
1046
- }
1047
- function PaginationLink({
1048
- className,
1049
- isActive,
1050
- size = ButtonSize.Icon,
1051
- asChild,
1052
- ...props
1053
- }) {
1054
- const Comp = asChild ? Slot : "a";
1055
- return /* @__PURE__ */ jsx(
1056
- Comp,
1057
- {
1058
- "aria-current": isActive ? "page" : void 0,
1059
- "data-slot": "pagination-link",
1060
- "data-active": isActive,
1061
- className: cn(
1062
- buttonVariants({
1063
- variant: isActive ? ButtonVariant.Outline : ButtonVariant.Ghost,
1064
- size
1065
- }),
1066
- className
1067
- ),
1068
- ...props
1069
- }
1070
- );
1071
- }
1072
- function PaginationPrevious({
1073
- className,
1074
- children,
1075
- ...props
1076
- }) {
1077
- return /* @__PURE__ */ jsxs(
1078
- PaginationLink,
1079
- {
1080
- "aria-label": "Go to previous page",
1081
- size: ButtonSize.Default,
1082
- className: cn("gap-1 px-2.5 sm:pl-2.5", className),
1083
- ...props,
1084
- children: [
1085
- /* @__PURE__ */ jsx(ChevronLeftIcon, { className: "h-4 w-4" }),
1086
- /* @__PURE__ */ jsx("span", { className: "hidden sm:block", children: children ?? "Previous" })
1087
- ]
1088
- }
1089
- );
1090
- }
1091
- function PaginationNext({
1092
- className,
1093
- children,
1094
- ...props
1095
- }) {
1096
- return /* @__PURE__ */ jsxs(
1097
- PaginationLink,
1098
- {
1099
- "aria-label": "Go to next page",
1100
- size: ButtonSize.Default,
1101
- className: cn("gap-1 px-2.5 sm:pr-2.5", className),
1102
- ...props,
1103
- children: [
1104
- /* @__PURE__ */ jsx("span", { className: "hidden sm:block", children: children ?? "Next" }),
1105
- /* @__PURE__ */ jsx(ChevronRightIcon, { className: "h-4 w-4" })
1106
- ]
1107
- }
1108
- );
1109
- }
1110
- function PaginationEllipsis({
1111
- className,
1112
- ...props
1113
- }) {
1114
- return /* @__PURE__ */ jsxs(
1115
- "span",
1116
- {
1117
- "aria-hidden": true,
1118
- "data-slot": "pagination-ellipsis",
1119
- className: cn("flex size-9 items-center justify-center", className),
1120
- ...props,
1121
- children: [
1122
- /* @__PURE__ */ jsx(MoreHorizontalIcon, { className: "h-4 w-4" }),
1123
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "More pages" })
1124
- ]
1125
- }
1126
- );
1127
- }
1128
- function Tabs({
1129
- className,
1130
- ...props
1131
- }) {
1132
- return /* @__PURE__ */ jsx(
1133
- TabsPrimitive.Root,
1134
- {
1135
- "data-slot": "tabs",
1136
- className: cn("flex flex-col gap-2", className),
1137
- ...props
1138
- }
1139
- );
1140
- }
1141
- function TabsList({
1142
- className,
1143
- ...props
1144
- }) {
1145
- return /* @__PURE__ */ jsx(
1146
- TabsPrimitive.List,
1147
- {
1148
- "data-slot": "tabs-list",
1149
- className: cn(
1150
- "bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",
1151
- className
1152
- ),
1153
- ...props
1154
- }
1155
- );
1156
- }
1157
- function TabsTrigger({
1158
- className,
1159
- ...props
1160
- }) {
1161
- return /* @__PURE__ */ jsx(
1162
- TabsPrimitive.Trigger,
1163
- {
1164
- "data-slot": "tabs-trigger",
1165
- className: cn(
1166
- "data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
1167
- className
1168
- ),
1169
- ...props
1170
- }
1171
- );
1172
- }
1173
- function TabsContent({
1174
- className,
1175
- ...props
1176
- }) {
1177
- return /* @__PURE__ */ jsx(
1178
- TabsPrimitive.Content,
1179
- {
1180
- "data-slot": "tabs-content",
1181
- className: cn("flex-1 outline-none", className),
1182
- ...props
1183
- }
1184
- );
1185
- }
1186
- var Sheet = SheetPrimitive.Root;
1187
- var SheetTrigger = SheetPrimitive.Trigger;
1188
- var SheetClose = SheetPrimitive.Close;
1189
- var SheetPortal = SheetPrimitive.Portal;
1190
- var SheetOverlay = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1191
- SheetPrimitive.Overlay,
1192
- {
1193
- className: cn(
1194
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
1195
- className
1196
- ),
1197
- ...props,
1198
- ref
1199
- }
1200
- ));
1201
- SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
1202
- var sheetVariants = cva(
1203
- "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",
1204
- {
1205
- variants: {
1206
- side: {
1207
- top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
1208
- bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
1209
- 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",
1210
- 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"
1211
- }
1212
- },
1213
- defaultVariants: {
1214
- side: "right"
1215
- }
1216
- }
1217
- );
1218
- var SheetContent = React18.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ jsxs(SheetPortal, { children: [
1219
- /* @__PURE__ */ jsx(SheetOverlay, {}),
1220
- /* @__PURE__ */ jsxs(
1221
- SheetPrimitive.Content,
1222
- {
1223
- ref,
1224
- className: cn(sheetVariants({ side }), className),
1225
- ...props,
1226
- children: [
1227
- /* @__PURE__ */ jsxs(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
1228
- /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
1229
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
1230
- ] }),
1231
- children
1232
- ]
1233
- }
1234
- )
1235
- ] }));
1236
- SheetContent.displayName = SheetPrimitive.Content.displayName;
1237
- var SheetHeader = ({
1238
- className,
1239
- ...props
1240
- }) => /* @__PURE__ */ jsx(
1241
- "div",
1242
- {
1243
- className: cn(
1244
- "flex flex-col space-y-2 text-center sm:text-left",
1245
- className
1246
- ),
1247
- ...props
1248
- }
1249
- );
1250
- SheetHeader.displayName = "SheetHeader";
1251
- var SheetFooter = ({
1252
- className,
1253
- ...props
1254
- }) => /* @__PURE__ */ jsx(
1255
- "div",
1256
- {
1257
- className: cn(
1258
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
1259
- className
1260
- ),
1261
- ...props
1262
- }
1263
- );
1264
- SheetFooter.displayName = "SheetFooter";
1265
- var SheetTitle = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1266
- SheetPrimitive.Title,
1267
- {
1268
- ref,
1269
- className: cn("text-lg font-semibold text-foreground", className),
1270
- ...props
1271
- }
1272
- ));
1273
- SheetTitle.displayName = SheetPrimitive.Title.displayName;
1274
- var SheetDescription = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1275
- SheetPrimitive.Description,
1276
- {
1277
- ref,
1278
- className: cn("text-sm text-muted-foreground", className),
1279
- ...props
1280
- }
1281
- ));
1282
- SheetDescription.displayName = SheetPrimitive.Description.displayName;
1283
- var Dialog = SheetPrimitive.Root;
1284
- var DialogTrigger = SheetPrimitive.Trigger;
1285
- var DialogPortal = SheetPrimitive.Portal;
1286
- var DialogClose = SheetPrimitive.Close;
1287
- var DialogOverlay = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1288
- SheetPrimitive.Overlay,
1289
- {
1290
- ref,
1291
- className: cn(
1292
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
1293
- className
1294
- ),
1295
- ...props
1296
- }
1297
- ));
1298
- DialogOverlay.displayName = SheetPrimitive.Overlay.displayName;
1299
- var DialogContent = React18.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
1300
- /* @__PURE__ */ jsx(DialogOverlay, {}),
1301
- /* @__PURE__ */ jsxs(
1302
- SheetPrimitive.Content,
1303
- {
1304
- ref,
1305
- className: cn(
1306
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
1307
- className
1308
- ),
1309
- ...props,
1310
- children: [
1311
- children,
1312
- /* @__PURE__ */ jsxs(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
1313
- /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
1314
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
1315
- ] })
1316
- ]
1317
- }
1318
- )
1319
- ] }));
1320
- DialogContent.displayName = SheetPrimitive.Content.displayName;
1321
- var DialogHeader = ({
1322
- className,
1323
- ...props
1324
- }) => /* @__PURE__ */ jsx(
1325
- "div",
1326
- {
1327
- className: cn(
1328
- "flex flex-col space-y-1.5 text-center sm:text-left",
1329
- className
1330
- ),
1331
- ...props
1332
- }
1333
- );
1334
- DialogHeader.displayName = "DialogHeader";
1335
- var DialogFooter = ({
1336
- className,
1337
- ...props
1338
- }) => /* @__PURE__ */ jsx(
1339
- "div",
1340
- {
1341
- className: cn(
1342
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
1343
- className
1344
- ),
1345
- ...props
1346
- }
1347
- );
1348
- DialogFooter.displayName = "DialogFooter";
1349
- var DialogTitle = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1350
- SheetPrimitive.Title,
1351
- {
1352
- ref,
1353
- className: cn(
1354
- "text-lg font-semibold leading-none tracking-tight",
1355
- className
1356
- ),
1357
- ...props
1358
- }
1359
- ));
1360
- DialogTitle.displayName = SheetPrimitive.Title.displayName;
1361
- var DialogDescription = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1362
- SheetPrimitive.Description,
1363
- {
1364
- ref,
1365
- className: cn("text-sm text-muted-foreground", className),
1366
- ...props
1367
- }
1368
- ));
1369
- DialogDescription.displayName = SheetPrimitive.Description.displayName;
1370
- function Drawer({
1371
- ...props
1372
- }) {
1373
- return /* @__PURE__ */ jsx(Drawer$1.Root, { "data-slot": "drawer", ...props });
1374
- }
1375
- function DrawerTrigger({
1376
- ...props
1377
- }) {
1378
- return /* @__PURE__ */ jsx(Drawer$1.Trigger, { "data-slot": "drawer-trigger", ...props });
1379
- }
1380
- function DrawerPortal({
1381
- ...props
1382
- }) {
1383
- return /* @__PURE__ */ jsx(Drawer$1.Portal, { "data-slot": "drawer-portal", ...props });
1384
- }
1385
- function DrawerClose({
1386
- ...props
1387
- }) {
1388
- return /* @__PURE__ */ jsx(Drawer$1.Close, { "data-slot": "drawer-close", ...props });
1389
- }
1390
- function DrawerOverlay({
1391
- className,
1392
- ...props
1393
- }) {
1394
- return /* @__PURE__ */ jsx(
1395
- Drawer$1.Overlay,
1396
- {
1397
- "data-slot": "drawer-overlay",
1398
- className: cn(
1399
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
1400
- className
1401
- ),
1402
- ...props
1403
- }
1404
- );
1405
- }
1406
- function DrawerContent({
1407
- className,
1408
- children,
1409
- ...props
1410
- }) {
1411
- return /* @__PURE__ */ jsxs(DrawerPortal, { "data-slot": "drawer-portal", children: [
1412
- /* @__PURE__ */ jsx(DrawerOverlay, {}),
1413
- /* @__PURE__ */ jsxs(
1414
- Drawer$1.Content,
1415
- {
1416
- "data-slot": "drawer-content",
1417
- className: cn(
1418
- "group/drawer-content bg-background fixed z-50 flex h-auto flex-col",
1419
- "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b",
1420
- "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t",
1421
- "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm",
1422
- "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",
1423
- className
1424
- ),
1425
- ...props,
1426
- children: [
1427
- /* @__PURE__ */ jsx("div", { className: "bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }),
1428
- children
1429
- ]
1430
- }
1431
- )
1432
- ] });
1433
- }
1434
- function DrawerHeader({ className, ...props }) {
1435
- return /* @__PURE__ */ jsx(
1436
- "div",
1437
- {
1438
- "data-slot": "drawer-header",
1439
- className: cn(
1440
- "flex flex-col gap-1.5 p-4 text-center sm:text-left",
1441
- className
1442
- ),
1443
- ...props
1444
- }
1445
- );
1446
- }
1447
- function DrawerFooter({ className, ...props }) {
1448
- return /* @__PURE__ */ jsx(
1449
- "div",
1450
- {
1451
- "data-slot": "drawer-footer",
1452
- className: cn("mt-auto flex flex-col gap-2 p-4", className),
1453
- ...props
1454
- }
1455
- );
1456
- }
1457
- function DrawerTitle({
1458
- className,
1459
- ...props
1460
- }) {
1461
- return /* @__PURE__ */ jsx(
1462
- Drawer$1.Title,
1463
- {
1464
- "data-slot": "drawer-title",
1465
- className: cn("text-lg font-semibold text-foreground", className),
1466
- ...props
1467
- }
1468
- );
1469
- }
1470
- function DrawerDescription({
1471
- className,
1472
- ...props
1473
- }) {
1474
- return /* @__PURE__ */ jsx(
1475
- Drawer$1.Description,
1476
- {
1477
- "data-slot": "drawer-description",
1478
- className: cn("text-sm text-muted-foreground", className),
1479
- ...props
1480
- }
1481
- );
1482
- }
1483
- function ResizablePanelGroup({
1484
- className,
1485
- ...props
1486
- }) {
1487
- return /* @__PURE__ */ jsx(
1488
- ResizablePrimitive.PanelGroup,
1489
- {
1490
- "data-slot": "resizable-panel-group",
1491
- className: cn(
1492
- "flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
1493
- className
1494
- ),
1495
- ...props
1496
- }
1497
- );
1498
- }
1499
- function ResizablePanel({
1500
- ...props
1501
- }) {
1502
- return /* @__PURE__ */ jsx(ResizablePrimitive.Panel, { "data-slot": "resizable-panel", ...props });
1503
- }
1504
- function ResizableHandle({
1505
- withHandle,
1506
- className,
1507
- ...props
1508
- }) {
1509
- return /* @__PURE__ */ jsx(
1510
- ResizablePrimitive.PanelResizeHandle,
1511
- {
1512
- "data-slot": "resizable-handle",
1513
- className: cn(
1514
- "bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",
1515
- className
1516
- ),
1517
- ...props,
1518
- children: withHandle && /* @__PURE__ */ jsx("div", { className: "bg-border z-10 flex h-4 w-3 items-center justify-center rounded-sm border", children: /* @__PURE__ */ jsx(GripVertical, { className: "size-2.5" }) })
1519
- }
1520
- );
1521
- }
1522
- function ScrollArea({
1523
- className,
1524
- children,
1525
- ...props
1526
- }) {
1527
- return /* @__PURE__ */ jsxs(
1528
- ScrollAreaPrimitive.Root,
1529
- {
1530
- "data-slot": "scroll-area",
1531
- className: cn("relative", className),
1532
- ...props,
1533
- children: [
1534
- /* @__PURE__ */ jsx(
1535
- ScrollAreaPrimitive.Viewport,
1536
- {
1537
- "data-slot": "scroll-area-viewport",
1538
- className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",
1539
- children
1540
- }
1541
- ),
1542
- /* @__PURE__ */ jsx(ScrollBar, {}),
1543
- /* @__PURE__ */ jsx(ScrollAreaPrimitive.Corner, {})
1544
- ]
1545
- }
1546
- );
1547
- }
1548
- function ScrollBar({
1549
- className,
1550
- orientation = "vertical",
1551
- ...props
1552
- }) {
1553
- return /* @__PURE__ */ jsx(
1554
- ScrollAreaPrimitive.ScrollAreaScrollbar,
1555
- {
1556
- "data-slot": "scroll-area-scrollbar",
1557
- orientation,
1558
- className: cn(
1559
- "flex touch-none p-px transition-colors select-none",
1560
- orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent",
1561
- orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
1562
- className
1563
- ),
1564
- ...props,
1565
- children: /* @__PURE__ */ jsx(
1566
- ScrollAreaPrimitive.ScrollAreaThumb,
1567
- {
1568
- "data-slot": "scroll-area-thumb",
1569
- className: "bg-border relative flex-1 rounded-full"
1570
- }
1571
- )
1572
- }
1573
- );
1574
- }
1575
- function Separator2({
1576
- className,
1577
- orientation = "horizontal",
1578
- decorative = true,
1579
- ...props
1580
- }) {
1581
- return /* @__PURE__ */ jsx(
1582
- SeparatorPrimitive.Root,
1583
- {
1584
- "data-slot": "separator",
1585
- decorative,
1586
- orientation,
1587
- className: cn(
1588
- "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
1589
- className
1590
- ),
1591
- ...props
1592
- }
1593
- );
1594
- }
1595
- var Accordion = React18.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx(
1596
- AccordionPrimitive.Root,
1597
- {
1598
- ref,
1599
- "data-slot": "accordion",
1600
- ...props
1601
- }
1602
- ));
1603
- Accordion.displayName = "Accordion";
1604
- var AccordionItem = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1605
- AccordionPrimitive.Item,
1606
- {
1607
- ref,
1608
- "data-slot": "accordion-item",
1609
- className: cn("border-b last:border-b-0", className),
1610
- ...props
1611
- }
1612
- ));
1613
- AccordionItem.displayName = "AccordionItem";
1614
- var AccordionTrigger = React18.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
1615
- AccordionPrimitive.Trigger,
1616
- {
1617
- ref,
1618
- "data-slot": "accordion-trigger",
1619
- className: cn(
1620
- "flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] focus-visible:border-ring focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
1621
- className
1622
- ),
1623
- ...props,
1624
- children: [
1625
- children,
1626
- /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200" })
1627
- ]
1628
- }
1629
- ) }));
1630
- AccordionTrigger.displayName = "AccordionTrigger";
1631
- var AccordionContent = React18.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
1632
- AccordionPrimitive.Content,
1633
- {
1634
- ref,
1635
- "data-slot": "accordion-content",
1636
- className: "overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
1637
- ...props,
1638
- children: /* @__PURE__ */ jsx("div", { className: cn("pt-0 pb-4", className), children })
1639
- }
1640
- ));
1641
- AccordionContent.displayName = "AccordionContent";
1642
- var CarouselContext = React18.createContext(null);
1643
- function useCarousel() {
1644
- const context = React18.useContext(CarouselContext);
1645
- if (!context) {
1646
- throw new Error("useCarousel must be used within a <Carousel />");
1647
- }
1648
- return context;
1649
- }
1650
- var Carousel = React18.forwardRef(
1651
- ({
1652
- orientation = "horizontal",
1653
- opts,
1654
- setApi,
1655
- plugins,
1656
- className,
1657
- children,
1658
- ...props
1659
- }, ref) => {
1660
- const [carouselRef, api] = useEmblaCarousel(
1661
- {
1662
- ...opts,
1663
- axis: orientation === "horizontal" ? "x" : "y"
1664
- },
1665
- plugins
1666
- );
1667
- const [canScrollPrev, setCanScrollPrev] = React18.useState(false);
1668
- const [canScrollNext, setCanScrollNext] = React18.useState(false);
1669
- const onSelect = React18.useCallback((api2) => {
1670
- if (!api2) return;
1671
- setCanScrollPrev(api2.canScrollPrev());
1672
- setCanScrollNext(api2.canScrollNext());
1673
- }, []);
1674
- const scrollPrev = React18.useCallback(() => {
1675
- api?.scrollPrev();
1676
- }, [api]);
1677
- const scrollNext = React18.useCallback(() => {
1678
- api?.scrollNext();
1679
- }, [api]);
1680
- const handleKeyDown = React18.useCallback(
1681
- (event) => {
1682
- if (event.key === "ArrowLeft") {
1683
- event.preventDefault();
1684
- scrollPrev();
1685
- } else if (event.key === "ArrowRight") {
1686
- event.preventDefault();
1687
- scrollNext();
1688
- }
1689
- },
1690
- [scrollPrev, scrollNext]
1691
- );
1692
- React18.useEffect(() => {
1693
- if (!api || !setApi) return;
1694
- setApi(api);
1695
- }, [api, setApi]);
1696
- React18.useEffect(() => {
1697
- if (!api) return;
1698
- onSelect(api);
1699
- api.on("reInit", onSelect);
1700
- api.on("select", onSelect);
1701
- return () => {
1702
- api?.off("select", onSelect);
1703
- };
1704
- }, [api, onSelect]);
1705
- return /* @__PURE__ */ jsx(
1706
- CarouselContext.Provider,
1707
- {
1708
- value: {
1709
- carouselRef,
1710
- api,
1711
- opts,
1712
- orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
1713
- scrollPrev,
1714
- scrollNext,
1715
- canScrollPrev,
1716
- canScrollNext
1717
- },
1718
- children: /* @__PURE__ */ jsx(
1719
- "div",
1720
- {
1721
- ref,
1722
- onKeyDownCapture: handleKeyDown,
1723
- className: cn("relative", className),
1724
- role: "region",
1725
- "aria-roledescription": "carousel",
1726
- "data-slot": "carousel",
1727
- ...props,
1728
- children
1729
- }
1730
- )
1731
- }
1732
- );
1733
- }
1734
- );
1735
- Carousel.displayName = "Carousel";
1736
- var CarouselContent = React18.forwardRef(({ className, ...props }, ref) => {
1737
- const { carouselRef, orientation } = useCarousel();
1738
- return /* @__PURE__ */ jsx(
1739
- "div",
1740
- {
1741
- ref: carouselRef,
1742
- className: "overflow-hidden",
1743
- "data-slot": "carousel-content",
1744
- children: /* @__PURE__ */ jsx(
1745
- "div",
1746
- {
1747
- ref,
1748
- className: cn(
1749
- "flex",
1750
- orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col",
1751
- className
1752
- ),
1753
- ...props
1754
- }
1755
- )
1756
- }
1757
- );
1758
- });
1759
- CarouselContent.displayName = "CarouselContent";
1760
- var CarouselItem = React18.forwardRef(({ className, ...props }, ref) => {
1761
- const { orientation } = useCarousel();
1762
- return /* @__PURE__ */ jsx(
1763
- "div",
1764
- {
1765
- ref,
1766
- role: "group",
1767
- "aria-roledescription": "slide",
1768
- "data-slot": "carousel-item",
1769
- className: cn(
1770
- "min-w-0 shrink-0 grow-0 basis-full",
1771
- orientation === "horizontal" ? "pl-4" : "pt-4",
1772
- className
1773
- ),
1774
- ...props
1775
- }
1776
- );
1777
- });
1778
- CarouselItem.displayName = "CarouselItem";
1779
- var CarouselPrevious = React18.forwardRef(({ className, variant = ButtonVariant.Outline, size = ButtonSize.Icon, ...props }, ref) => {
1780
- const { orientation, scrollPrev, canScrollPrev } = useCarousel();
1781
- return /* @__PURE__ */ jsxs(
1782
- Button,
1783
- {
1784
- ref,
1785
- "data-slot": "carousel-previous",
1786
- variant,
1787
- size,
1788
- className: cn(
1789
- "absolute h-8 w-8 rounded-full",
1790
- orientation === "horizontal" ? "top-1/2 -left-12 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
1791
- className
1792
- ),
1793
- disabled: !canScrollPrev,
1794
- onClick: scrollPrev,
1795
- ...props,
1796
- children: [
1797
- /* @__PURE__ */ jsx(ArrowLeft, { className: "h-4 w-4" }),
1798
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Previous slide" })
1799
- ]
1800
- }
1801
- );
1802
- });
1803
- CarouselPrevious.displayName = "CarouselPrevious";
1804
- var CarouselNext = React18.forwardRef(({ className, variant = ButtonVariant.Outline, size = ButtonSize.Icon, ...props }, ref) => {
1805
- const { orientation, scrollNext, canScrollNext } = useCarousel();
1806
- return /* @__PURE__ */ jsxs(
1807
- Button,
1808
- {
1809
- ref,
1810
- "data-slot": "carousel-next",
1811
- variant,
1812
- size,
1813
- className: cn(
1814
- "absolute h-8 w-8 rounded-full",
1815
- orientation === "horizontal" ? "top-1/2 -right-12 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
1816
- className
1817
- ),
1818
- disabled: !canScrollNext,
1819
- onClick: scrollNext,
1820
- ...props,
1821
- children: [
1822
- /* @__PURE__ */ jsx(ArrowRight, { className: "h-4 w-4" }),
1823
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Next slide" })
1824
- ]
1825
- }
1826
- );
1827
- });
1828
- CarouselNext.displayName = "CarouselNext";
1829
- var Collapsible = React18.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx(
1830
- CollapsiblePrimitive.Root,
1831
- {
1832
- ref,
1833
- "data-slot": "collapsible",
1834
- ...props
1835
- }
1836
- ));
1837
- Collapsible.displayName = "Collapsible";
1838
- var CollapsibleTrigger2 = React18.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx(
1839
- CollapsiblePrimitive.CollapsibleTrigger,
1840
- {
1841
- ref,
1842
- "data-slot": "collapsible-trigger",
1843
- ...props
1844
- }
1845
- ));
1846
- CollapsibleTrigger2.displayName = "CollapsibleTrigger";
1847
- var CollapsibleContent2 = React18.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx(
1848
- CollapsiblePrimitive.CollapsibleContent,
1849
- {
1850
- ref,
1851
- "data-slot": "collapsible-content",
1852
- ...props
1853
- }
1854
- ));
1855
- CollapsibleContent2.displayName = "CollapsibleContent";
1856
- function ChartContainer({
1857
- className,
1858
- children,
1859
- width = "100%",
1860
- height = 350
1861
- }) {
1862
- return /* @__PURE__ */ jsx(
1863
- "div",
1864
- {
1865
- "data-slot": "chart-container",
1866
- className: cn("w-full", className),
1867
- style: { width, height: typeof height === "number" ? `${height}px` : height },
1868
- children
1869
- }
1870
- );
1871
- }
1872
- function ChartTooltipContent({
1873
- className,
1874
- label,
1875
- payload,
1876
- active
1877
- }) {
1878
- if (!active || !payload || payload.length === 0) {
1879
- return null;
1880
- }
1881
- return /* @__PURE__ */ jsxs(
1882
- "div",
1883
- {
1884
- "data-slot": "chart-tooltip-content",
1885
- className: cn(
1886
- "bg-background border-border text-foreground rounded-lg border p-2 shadow-md",
1887
- className
1888
- ),
1889
- children: [
1890
- label && /* @__PURE__ */ jsx("div", { className: "mb-1 text-xs font-medium text-muted-foreground", children: label }),
1891
- /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-1", children: payload.map((item, index) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs", children: [
1892
- /* @__PURE__ */ jsx(
1893
- "div",
1894
- {
1895
- className: "h-2 w-2 rounded-full",
1896
- style: { backgroundColor: item.color }
1897
- }
1898
- ),
1899
- /* @__PURE__ */ jsxs("span", { className: "font-medium", children: [
1900
- item.name,
1901
- ":"
1902
- ] }),
1903
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: item.value })
1904
- ] }, index)) })
1905
- ]
1906
- }
1907
- );
1908
- }
1909
- function ChartLegendContent({
1910
- className,
1911
- payload
1912
- }) {
1913
- if (!payload || payload.length === 0) {
1914
- return null;
1915
- }
1916
- return /* @__PURE__ */ jsx(
1917
- "div",
1918
- {
1919
- "data-slot": "chart-legend-content",
1920
- className: cn("flex items-center justify-center gap-4 text-sm pt-4", className),
1921
- children: payload.map((item, index) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1922
- /* @__PURE__ */ jsx(
1923
- "div",
1924
- {
1925
- className: "h-3 w-3 rounded-sm",
1926
- style: { backgroundColor: item.color }
1927
- }
1928
- ),
1929
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: item.value })
1930
- ] }, index))
1931
- }
1932
- );
1933
- }
1934
- var Select = SelectPrimitive.Root;
1935
- var SelectGroup = SelectPrimitive.Group;
1936
- var SelectValue = SelectPrimitive.Value;
1937
- var SelectTrigger = React18.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
1938
- SelectPrimitive.Trigger,
1939
- {
1940
- ref,
1941
- className: cn(
1942
- // HAI3 customization: bg-background and hover states for consistency with Button Outline
1943
- "flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm ring-offset-background hover:bg-accent hover:text-bg-accent-foreground data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
1944
- className
1945
- ),
1946
- ...props,
1947
- children: [
1948
- children,
1949
- /* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 opacity-50" }) })
1950
- ]
1951
- }
1952
- ));
1953
- SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
1954
- var SelectScrollUpButton = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1955
- SelectPrimitive.ScrollUpButton,
1956
- {
1957
- ref,
1958
- className: cn(
1959
- "flex cursor-default items-center justify-center py-1",
1960
- className
1961
- ),
1962
- ...props,
1963
- children: /* @__PURE__ */ jsx(ChevronUp, { className: "h-4 w-4" })
1964
- }
1965
- ));
1966
- SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
1967
- var SelectScrollDownButton = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1968
- SelectPrimitive.ScrollDownButton,
1969
- {
1970
- ref,
1971
- className: cn(
1972
- "flex cursor-default items-center justify-center py-1",
1973
- className
1974
- ),
1975
- ...props,
1976
- children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" })
1977
- }
1978
- ));
1979
- SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
1980
- var SelectContent = React18.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
1981
- SelectPrimitive.Content,
1982
- {
1983
- ref,
1984
- className: cn(
1985
- "relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",
1986
- position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
1987
- className
1988
- ),
1989
- position,
1990
- ...props,
1991
- children: [
1992
- /* @__PURE__ */ jsx(SelectScrollUpButton, {}),
1993
- /* @__PURE__ */ jsx(
1994
- SelectPrimitive.Viewport,
1995
- {
1996
- className: cn(
1997
- "p-1",
1998
- position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
1999
- ),
2000
- children
2001
- }
2002
- ),
2003
- /* @__PURE__ */ jsx(SelectScrollDownButton, {})
2004
- ]
2005
- }
2006
- ) }));
2007
- SelectContent.displayName = SelectPrimitive.Content.displayName;
2008
- var SelectLabel = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2009
- SelectPrimitive.Label,
2010
- {
2011
- ref,
2012
- className: cn("px-2 py-1.5 text-sm font-semibold", className),
2013
- ...props
2014
- }
2015
- ));
2016
- SelectLabel.displayName = SelectPrimitive.Label.displayName;
2017
- var SelectItem = React18.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
2018
- SelectPrimitive.Item,
2019
- {
2020
- ref,
2021
- className: cn(
2022
- "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-bg-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
2023
- className
2024
- ),
2025
- ...props,
2026
- children: [
2027
- /* @__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" }) }) }),
2028
- /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
2029
- ]
2030
- }
2031
- ));
2032
- SelectItem.displayName = SelectPrimitive.Item.displayName;
2033
- var SelectSeparator = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2034
- SelectPrimitive.Separator,
2035
- {
2036
- ref,
2037
- className: cn("-mx-1 my-1 h-px bg-muted", className),
2038
- ...props
2039
- }
2040
- ));
2041
- SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
2042
- var DropdownMenu = ({ dir, ...props }) => /* @__PURE__ */ jsx(
2043
- DropdownMenuPrimitive.Root,
2044
- {
2045
- ...props,
2046
- dir
2047
- }
2048
- );
2049
- DropdownMenu.displayName = "DropdownMenu";
2050
- var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
2051
- var DropdownMenuGroup = DropdownMenuPrimitive.Group;
2052
- var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
2053
- var DropdownMenuSub = DropdownMenuPrimitive.Sub;
2054
- var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
2055
- var DropdownMenuSubTrigger = React18.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
2056
- DropdownMenuPrimitive.SubTrigger,
2057
- {
2058
- ref,
2059
- className: cn(
2060
- "flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
2061
- inset && "pl-8",
2062
- className
2063
- ),
2064
- ...props,
2065
- children: [
2066
- children,
2067
- /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ms-auto rtl:rotate-180" })
2068
- ]
2069
- }
2070
- ));
2071
- DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
2072
- var DropdownMenuSubContent = React18.forwardRef(({ className, container, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { container: container ?? void 0, children: /* @__PURE__ */ jsx(
2073
- DropdownMenuPrimitive.SubContent,
2074
- {
2075
- ref,
2076
- className: cn(
2077
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",
2078
- className
2079
- ),
2080
- ...props
2081
- }
2082
- ) }));
2083
- DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
2084
- var DropdownMenuContent = React18.forwardRef(({ className, sideOffset = 4, container, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { container: container ?? void 0, children: /* @__PURE__ */ jsx(
2085
- DropdownMenuPrimitive.Content,
2086
- {
2087
- ref,
2088
- sideOffset,
2089
- className: cn(
2090
- "z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
2091
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",
2092
- className
2093
- ),
2094
- ...props
2095
- }
2096
- ) }));
2097
- DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
2098
- var DropdownMenuItem = React18.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
2099
- DropdownMenuPrimitive.Item,
2100
- {
2101
- ref,
2102
- className: cn(
2103
- "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",
2104
- inset && "pl-8",
2105
- className
2106
- ),
2107
- ...props
2108
- }
2109
- ));
2110
- DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
2111
- var DropdownMenuCheckboxItem = React18.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
2112
- DropdownMenuPrimitive.CheckboxItem,
2113
- {
2114
- ref,
2115
- className: cn(
2116
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
2117
- className
2118
- ),
2119
- checked,
2120
- ...props,
2121
- children: [
2122
- /* @__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(CheckIcon, { className: "h-4 w-4" }) }) }),
2123
- children
2124
- ]
2125
- }
2126
- ));
2127
- DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
2128
- var DropdownMenuRadioItem = React18.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
2129
- DropdownMenuPrimitive.RadioItem,
2130
- {
2131
- ref,
2132
- className: cn(
2133
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
2134
- className
2135
- ),
2136
- ...props,
2137
- children: [
2138
- /* @__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(CircleIcon, { className: "h-2 w-2 fill-current" }) }) }),
2139
- children
2140
- ]
2141
- }
2142
- ));
2143
- DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
2144
- var DropdownMenuLabel = React18.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
2145
- DropdownMenuPrimitive.Label,
2146
- {
2147
- ref,
2148
- className: cn(
2149
- "px-2 py-1.5 text-sm font-semibold",
2150
- inset && "pl-8",
2151
- className
2152
- ),
2153
- ...props
2154
- }
2155
- ));
2156
- DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
2157
- var DropdownMenuSeparator = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2158
- DropdownMenuPrimitive.Separator,
2159
- {
2160
- ref,
2161
- className: cn("-mx-1 my-1 h-px bg-muted", className),
2162
- ...props
2163
- }
2164
- ));
2165
- DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
2166
- var DropdownMenuShortcut = ({
2167
- className,
2168
- ...props
2169
- }) => {
2170
- return /* @__PURE__ */ jsx(
2171
- "span",
2172
- {
2173
- className: cn("ml-auto text-xs tracking-widest opacity-60", className),
2174
- ...props
2175
- }
2176
- );
2177
- };
2178
- DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
2179
- function ContextMenu({
2180
- ...props
2181
- }) {
2182
- return /* @__PURE__ */ jsx(ContextMenuPrimitive.Root, { "data-slot": "context-menu", ...props });
2183
- }
2184
- function ContextMenuTrigger({
2185
- ...props
2186
- }) {
2187
- return /* @__PURE__ */ jsx(ContextMenuPrimitive.Trigger, { "data-slot": "context-menu-trigger", ...props });
2188
- }
2189
- function ContextMenuGroup({
2190
- ...props
2191
- }) {
2192
- return /* @__PURE__ */ jsx(ContextMenuPrimitive.Group, { "data-slot": "context-menu-group", ...props });
2193
- }
2194
- function ContextMenuPortal({
2195
- ...props
2196
- }) {
2197
- return /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { "data-slot": "context-menu-portal", ...props });
2198
- }
2199
- function ContextMenuSub({
2200
- ...props
2201
- }) {
2202
- return /* @__PURE__ */ jsx(ContextMenuPrimitive.Sub, { "data-slot": "context-menu-sub", ...props });
2203
- }
2204
- function ContextMenuRadioGroup({
2205
- ...props
2206
- }) {
2207
- return /* @__PURE__ */ jsx(
2208
- ContextMenuPrimitive.RadioGroup,
2209
- {
2210
- "data-slot": "context-menu-radio-group",
2211
- ...props
2212
- }
2213
- );
2214
- }
2215
- function ContextMenuSubTrigger({
2216
- className,
2217
- inset,
2218
- children,
2219
- ...props
2220
- }) {
2221
- return /* @__PURE__ */ jsxs(
2222
- ContextMenuPrimitive.SubTrigger,
2223
- {
2224
- "data-slot": "context-menu-sub-trigger",
2225
- "data-inset": inset,
2226
- className: cn(
2227
- "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
2228
- className
2229
- ),
2230
- ...props,
2231
- children: [
2232
- children,
2233
- /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto" })
2234
- ]
2235
- }
2236
- );
2237
- }
2238
- function ContextMenuSubContent({
2239
- className,
2240
- ...props
2241
- }) {
2242
- return /* @__PURE__ */ jsx(
2243
- ContextMenuPrimitive.SubContent,
2244
- {
2245
- "data-slot": "context-menu-sub-content",
2246
- className: cn(
2247
- "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-[var(--radix-context-menu-content-transform-origin)] overflow-hidden rounded-md border p-1 shadow-lg",
2248
- className
2249
- ),
2250
- ...props
2251
- }
2252
- );
2253
- }
2254
- function ContextMenuContent({
2255
- className,
2256
- ...props
2257
- }) {
2258
- return /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
2259
- ContextMenuPrimitive.Content,
2260
- {
2261
- "data-slot": "context-menu-content",
2262
- className: cn(
2263
- "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-[var(--radix-context-menu-content-available-height)] min-w-[8rem] origin-[var(--radix-context-menu-content-transform-origin)] overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
2264
- className
2265
- ),
2266
- ...props
2267
- }
2268
- ) });
2269
- }
2270
- function ContextMenuItem({
2271
- className,
2272
- inset,
2273
- variant = "default",
2274
- ...props
2275
- }) {
2276
- return /* @__PURE__ */ jsx(
2277
- ContextMenuPrimitive.Item,
2278
- {
2279
- "data-slot": "context-menu-item",
2280
- "data-inset": inset,
2281
- "data-variant": variant,
2282
- className: cn(
2283
- "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
2284
- className
2285
- ),
2286
- ...props
2287
- }
2288
- );
2289
- }
2290
- function ContextMenuCheckboxItem({
2291
- className,
2292
- children,
2293
- checked,
2294
- ...props
2295
- }) {
2296
- return /* @__PURE__ */ jsxs(
2297
- ContextMenuPrimitive.CheckboxItem,
2298
- {
2299
- "data-slot": "context-menu-checkbox-item",
2300
- className: cn(
2301
- "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
2302
- className
2303
- ),
2304
- checked,
2305
- ...props,
2306
- children: [
2307
- /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
2308
- children
2309
- ]
2310
- }
2311
- );
2312
- }
2313
- function ContextMenuRadioItem({
2314
- className,
2315
- children,
2316
- ...props
2317
- }) {
2318
- return /* @__PURE__ */ jsxs(
2319
- ContextMenuPrimitive.RadioItem,
2320
- {
2321
- "data-slot": "context-menu-radio-item",
2322
- className: cn(
2323
- "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
2324
- className
2325
- ),
2326
- ...props,
2327
- children: [
2328
- /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CircleIcon, { className: "size-2 fill-current" }) }) }),
2329
- children
2330
- ]
2331
- }
2332
- );
2333
- }
2334
- function ContextMenuLabel({
2335
- className,
2336
- inset,
2337
- ...props
2338
- }) {
2339
- return /* @__PURE__ */ jsx(
2340
- ContextMenuPrimitive.Label,
2341
- {
2342
- "data-slot": "context-menu-label",
2343
- "data-inset": inset,
2344
- className: cn(
2345
- "text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
2346
- className
2347
- ),
2348
- ...props
2349
- }
2350
- );
2351
- }
2352
- function ContextMenuSeparator({
2353
- className,
2354
- ...props
2355
- }) {
2356
- return /* @__PURE__ */ jsx(
2357
- ContextMenuPrimitive.Separator,
2358
- {
2359
- "data-slot": "context-menu-separator",
2360
- className: cn("bg-border -mx-1 my-1 h-px", className),
2361
- ...props
2362
- }
2363
- );
2364
- }
2365
- function ContextMenuShortcut({
2366
- className,
2367
- ...props
2368
- }) {
2369
- return /* @__PURE__ */ jsx(
2370
- "span",
2371
- {
2372
- "data-slot": "context-menu-shortcut",
2373
- className: cn(
2374
- "text-muted-foreground ml-auto text-xs tracking-widest",
2375
- className
2376
- ),
2377
- ...props
2378
- }
2379
- );
2380
- }
2381
- var IconButton = React18__default.forwardRef(
2382
- ({ variant = ButtonVariant.Ghost, size = IconButtonSize.Default, className, ...props }, ref) => {
2383
- const sizeStyles = {
2384
- [IconButtonSize.Small]: "h-8 w-8",
2385
- [IconButtonSize.Default]: "h-9 w-9",
2386
- [IconButtonSize.Large]: "h-11 w-11"
2387
- };
2388
- return /* @__PURE__ */ jsx(
2389
- Button,
2390
- {
2391
- ref,
2392
- variant,
2393
- size: ButtonSize.Icon,
2394
- className: cn(sizeStyles[size], className),
2395
- ...props
2396
- }
2397
- );
2398
- }
2399
- );
2400
- IconButton.displayName = "IconButton";
2401
- var DropdownButton = React18__default.forwardRef(({ children, variant = ButtonVariant.Outline, className, ...props }, ref) => {
2402
- return /* @__PURE__ */ jsxs(
2403
- Button,
2404
- {
2405
- ref,
2406
- variant,
2407
- className: cn("min-w-40 justify-between rtl:flex-row-reverse", className),
2408
- ...props,
2409
- children: [
2410
- /* @__PURE__ */ jsx("span", { children }),
2411
- /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" })
2412
- ]
2413
- }
2414
- );
2415
- });
2416
- DropdownButton.displayName = "DropdownButton";
2417
- var Sidebar = React18.forwardRef(({ collapsed = false, className, children, ...props }, ref) => {
2418
- return /* @__PURE__ */ jsx(
2419
- "aside",
2420
- {
2421
- ref,
2422
- "data-state": collapsed ? "collapsed" : "expanded",
2423
- "data-collapsible": collapsed ? "icon" : "",
2424
- className: cn(
2425
- "group flex flex-col border-r border-mainMenu-border transition-[width] duration-200 ease-linear",
2426
- "bg-mainMenu text-mainMenu-foreground",
2427
- collapsed ? "w-14" : "w-64",
2428
- className
2429
- ),
2430
- ...props,
2431
- children
2432
- }
2433
- );
2434
- });
2435
- Sidebar.displayName = "Sidebar";
2436
- var SidebarContent = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2437
- "div",
2438
- {
2439
- ref,
2440
- "data-sidebar": "content",
2441
- className: cn(
2442
- // HAI3 customization: gap and padding use rem-based spacing for theme scaling
2443
- "flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden p-2",
2444
- className
2445
- ),
2446
- ...props
2447
- }
2448
- ));
2449
- SidebarContent.displayName = "SidebarContent";
2450
- var SidebarMenu = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2451
- "ul",
2452
- {
2453
- ref,
2454
- "data-sidebar": "menu",
2455
- className: cn("flex w-full min-w-0 flex-col gap-1", className),
2456
- ...props
2457
- }
2458
- ));
2459
- SidebarMenu.displayName = "SidebarMenu";
2460
- var SidebarMenuItem = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2461
- "li",
2462
- {
2463
- ref,
2464
- "data-sidebar": "menu-item",
2465
- className: cn("group/menu-item relative", className),
2466
- ...props
2467
- }
2468
- ));
2469
- SidebarMenuItem.displayName = "SidebarMenuItem";
2470
- var sidebarMenuButtonVariants = cva(
2471
- // HAI3 customization: All sizing uses rem-based Tailwind classes for theme responsiveness
2472
- "peer/menu-button flex w-full items-center gap-2 rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>span:last-child]:overflow-hidden [&>svg]:size-5 [&>svg]:shrink-0 text-mainMenu-foreground hover:bg-mainMenu-hover data-[active=true]:bg-mainMenu-selected data-[active=true]:text-white data-[active=true]:font-medium",
2473
- {
2474
- variants: {
2475
- variant: {
2476
- default: "",
2477
- outline: "bg-background shadow-[0_0_0_1px_hsl(var(--border))] hover:bg-mainMenu-hover"
2478
- },
2479
- size: {
2480
- // HAI3 customization: All heights use rem-based Tailwind classes (h-10=2.5rem, h-7=1.75rem, h-12=3rem)
2481
- default: "h-10 text-sm",
2482
- sm: "h-7 text-xs",
2483
- lg: "h-12 text-sm group-data-[collapsible=icon]:!p-0"
2484
- }
2485
- },
2486
- defaultVariants: {
2487
- variant: "default",
2488
- size: "default"
2489
- }
2490
- }
2491
- );
2492
- var SidebarMenuButton = React18.forwardRef(
2493
- ({
2494
- asChild = false,
2495
- isActive = false,
2496
- variant = "default",
2497
- size = "default",
2498
- tooltip,
2499
- className,
2500
- ...props
2501
- }, ref) => {
2502
- const Comp = asChild ? Slot : "button";
2503
- return /* @__PURE__ */ jsx(
2504
- Comp,
2505
- {
2506
- ref,
2507
- "data-sidebar": "menu-button",
2508
- "data-size": size,
2509
- "data-active": isActive,
2510
- title: tooltip,
2511
- className: cn(sidebarMenuButtonVariants({ variant, size }), className),
2512
- ...props
2513
- }
2514
- );
2515
- }
2516
- );
2517
- SidebarMenuButton.displayName = "SidebarMenuButton";
2518
- var SidebarMenuIcon = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2519
- "span",
2520
- {
2521
- ref,
2522
- className: cn("size-5 min-w-[1.5rem] flex-shrink-0 [&>svg]:w-full [&>svg]:h-full", className),
2523
- ...props
2524
- }
2525
- ));
2526
- SidebarMenuIcon.displayName = "SidebarMenuIcon";
2527
- var SidebarMenuLabel = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2528
- "span",
2529
- {
2530
- ref,
2531
- className: cn(className),
2532
- ...props
2533
- }
2534
- ));
2535
- SidebarMenuLabel.displayName = "SidebarMenuLabel";
2536
- var SidebarHeader = React18.forwardRef(
2537
- ({ logo, logoText, collapsed = false, onClick, className, ...props }, ref) => {
2538
- return /* @__PURE__ */ jsxs(
2539
- "div",
2540
- {
2541
- ref,
2542
- className: cn(
2543
- "flex flex-col h-16",
2544
- className
2545
- ),
2546
- ...props,
2547
- children: [
2548
- /* @__PURE__ */ jsx("div", { className: "flex items-center flex-1 px-2", children: /* @__PURE__ */ jsxs(SidebarMenuButton, { onClick, tooltip: collapsed ? "Expand menu" : "Collapse menu", children: [
2549
- logo && /* @__PURE__ */ jsx(SidebarMenuIcon, { children: logo }),
2550
- logoText && /* @__PURE__ */ jsx(SidebarMenuLabel, { className: "[&>svg]:h-5 [&>svg]:w-auto", children: logoText })
2551
- ] }) }),
2552
- /* @__PURE__ */ jsx("div", { className: "border-b border-mainMenu-border mx-4" })
2553
- ]
2554
- }
2555
- );
2556
- }
2557
- );
2558
- SidebarHeader.displayName = "SidebarHeader";
2559
- var UserInfo = React18__default.forwardRef(
2560
- ({ displayName, email, avatarUrl, className, loading }, ref) => {
2561
- const getInitials = () => {
2562
- if (!displayName) return toUpper(email?.[0] || "") || "?";
2563
- const parts = trim(displayName).split(/\s+/);
2564
- if (parts.length >= 2) {
2565
- return toUpper(`${parts[0][0]}${parts[parts.length - 1][0]}`);
2566
- }
2567
- return toUpper(displayName.slice(0, 2));
2568
- };
2569
- const initials = getInitials();
2570
- const displayText = displayName || email || "User";
2571
- if (loading) {
2572
- return /* @__PURE__ */ jsxs("div", { ref, className: cn("flex items-center gap-2 text-sm", className), children: [
2573
- /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-8 rounded-full" }),
2574
- /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-24" })
2575
- ] });
2576
- }
2577
- return /* @__PURE__ */ jsxs(
2578
- "div",
2579
- {
2580
- ref,
2581
- className: cn(
2582
- "flex items-center gap-2 text-sm text-muted-foreground",
2583
- className
2584
- ),
2585
- children: [
2586
- /* @__PURE__ */ jsxs(Avatar, { className: "h-8 w-8", children: [
2587
- avatarUrl && /* @__PURE__ */ jsx(AvatarImage, { src: avatarUrl, alt: displayText }),
2588
- /* @__PURE__ */ jsx(AvatarFallback, { children: initials })
2589
- ] }),
2590
- /* @__PURE__ */ jsx("span", { children: displayText })
2591
- ]
2592
- }
2593
- );
2594
- }
2595
- );
2596
- UserInfo.displayName = "UserInfo";
2597
- var MessageType = /* @__PURE__ */ ((MessageType2) => {
2598
- MessageType2["User"] = "user";
2599
- MessageType2["Assistant"] = "assistant";
2600
- return MessageType2;
2601
- })(MessageType || {});
2602
- var MessageBubble = ({
2603
- type,
2604
- content,
2605
- className = "",
2606
- onCopy,
2607
- onEdit,
2608
- onDelete
2609
- }) => {
2610
- const isUser = type === "user" /* User */;
2611
- return /* @__PURE__ */ jsxs("div", { className: `flex gap-4 group ${className}`, children: [
2612
- /* @__PURE__ */ jsx(Avatar, { className: "h-8 w-8 flex-shrink-0", children: /* @__PURE__ */ jsx(
2613
- AvatarFallback,
2614
- {
2615
- className: isUser ? "bg-blue-500 text-white" : "bg-green-500 text-white",
2616
- children: isUser ? /* @__PURE__ */ jsx(User, { size: 16 }) : /* @__PURE__ */ jsx(Bot, { size: 16 })
2617
- }
2618
- ) }),
2619
- /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
2620
- /* @__PURE__ */ jsx("div", { className: "prose prose-sm max-w-none", children: /* @__PURE__ */ jsx("div", { className: "leading-relaxed whitespace-pre-wrap", children: content }) }),
2621
- (onCopy || onEdit || onDelete) && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 mt-2 opacity-0 group-hover:opacity-100 transition-opacity", children: [
2622
- onCopy && /* @__PURE__ */ jsx(
2623
- "button",
2624
- {
2625
- onClick: onCopy,
2626
- className: "p-1.5 hover:bg-muted rounded-lg transition-colors text-muted-foreground hover:text-foreground",
2627
- title: "Copy message",
2628
- children: /* @__PURE__ */ jsxs(
2629
- "svg",
2630
- {
2631
- width: "14",
2632
- height: "14",
2633
- viewBox: "0 0 24 24",
2634
- fill: "none",
2635
- stroke: "currentColor",
2636
- strokeWidth: "2",
2637
- strokeLinecap: "round",
2638
- strokeLinejoin: "round",
2639
- children: [
2640
- /* @__PURE__ */ jsx("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }),
2641
- /* @__PURE__ */ jsx("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
2642
- ]
2643
- }
2644
- )
2645
- }
2646
- ),
2647
- onEdit && /* @__PURE__ */ jsx(
2648
- "button",
2649
- {
2650
- onClick: onEdit,
2651
- className: "p-1.5 hover:bg-muted rounded-lg transition-colors text-muted-foreground hover:text-foreground",
2652
- title: "Edit message",
2653
- children: /* @__PURE__ */ jsxs(
2654
- "svg",
2655
- {
2656
- width: "14",
2657
- height: "14",
2658
- viewBox: "0 0 24 24",
2659
- fill: "none",
2660
- stroke: "currentColor",
2661
- strokeWidth: "2",
2662
- strokeLinecap: "round",
2663
- strokeLinejoin: "round",
2664
- children: [
2665
- /* @__PURE__ */ jsx("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }),
2666
- /* @__PURE__ */ jsx("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })
2667
- ]
2668
- }
2669
- )
2670
- }
2671
- ),
2672
- onDelete && /* @__PURE__ */ jsx(
2673
- "button",
2674
- {
2675
- onClick: onDelete,
2676
- className: "p-1.5 hover:bg-destructive/10 rounded-lg transition-colors text-muted-foreground hover:text-destructive",
2677
- title: "Delete message",
2678
- children: /* @__PURE__ */ jsxs(
2679
- "svg",
2680
- {
2681
- width: "14",
2682
- height: "14",
2683
- viewBox: "0 0 24 24",
2684
- fill: "none",
2685
- stroke: "currentColor",
2686
- strokeWidth: "2",
2687
- strokeLinecap: "round",
2688
- strokeLinejoin: "round",
2689
- children: [
2690
- /* @__PURE__ */ jsx("polyline", { points: "3 6 5 6 21 6" }),
2691
- /* @__PURE__ */ jsx("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
2692
- ]
2693
- }
2694
- )
2695
- }
2696
- )
2697
- ] })
2698
- ] })
2699
- ] });
2700
- };
2701
- var ChatInput = ({
2702
- value,
2703
- onChange,
2704
- onSend,
2705
- onAttachFile,
2706
- placeholder = "Type a message...",
2707
- disabled = false,
2708
- maxRows = 14,
2709
- className = ""
2710
- }) => {
2711
- const handleKeyDown = (e) => {
2712
- if (e.key === "Enter" && !e.shiftKey) {
2713
- e.preventDefault();
2714
- if (!disabled && trim(value)) {
2715
- onSend();
2716
- }
2717
- }
2718
- };
2719
- const rows = Math.min(
2720
- Math.max(value.split("\n").length, 1),
2721
- maxRows
2722
- );
2723
- return /* @__PURE__ */ jsxs("div", { className: `flex items-end gap-2 ${className}`, children: [
2724
- onAttachFile && /* @__PURE__ */ jsx(
2725
- Button,
2726
- {
2727
- variant: ButtonVariant.Ghost,
2728
- size: ButtonSize.Icon,
2729
- onClick: onAttachFile,
2730
- disabled,
2731
- className: "flex-shrink-0",
2732
- "aria-label": "Attach file",
2733
- children: /* @__PURE__ */ jsx(Paperclip, { size: 20 })
2734
- }
2735
- ),
2736
- /* @__PURE__ */ jsx(
2737
- "textarea",
2738
- {
2739
- value,
2740
- onChange: (e) => onChange(e.target.value),
2741
- onKeyDown: handleKeyDown,
2742
- placeholder,
2743
- disabled,
2744
- rows,
2745
- className: "flex-1 resize-none rounded-lg border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"
2746
- }
2747
- ),
2748
- /* @__PURE__ */ jsx(
2749
- Button,
2750
- {
2751
- onClick: onSend,
2752
- disabled: disabled || !trim(value),
2753
- className: "flex-shrink-0",
2754
- "aria-label": "Send message",
2755
- children: /* @__PURE__ */ jsx(Send, { size: 20 })
2756
- }
2757
- )
2758
- ] });
2759
- };
2760
- var ThreadList = ({
2761
- threads,
2762
- selectedThreadId,
2763
- onThreadSelect,
2764
- onNewThread,
2765
- onDeleteThread,
2766
- searchQuery = "",
2767
- onSearchChange,
2768
- loading = false,
2769
- className = ""
2770
- }) => {
2771
- if (loading) {
2772
- return /* @__PURE__ */ jsxs("div", { className: `flex flex-col h-full ${className}`, children: [
2773
- /* @__PURE__ */ jsxs("div", { className: "p-4 border-b", children: [
2774
- /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-full mb-3" }),
2775
- /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" })
2776
- ] }),
2777
- /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto p-2", children: [1, 2, 3, 4, 5].map((i) => /* @__PURE__ */ jsx(Skeleton, { className: "h-16 w-full mb-2" }, i)) })
2778
- ] });
2779
- }
2780
- return /* @__PURE__ */ jsxs("div", { className: `flex flex-col h-full ${className}`, children: [
2781
- /* @__PURE__ */ jsxs("div", { className: "p-4 border-b", children: [
2782
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-3", children: [
2783
- /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold", children: "Recent Chats" }),
2784
- /* @__PURE__ */ jsx(
2785
- Button,
2786
- {
2787
- variant: ButtonVariant.Ghost,
2788
- size: ButtonSize.Icon,
2789
- onClick: onNewThread,
2790
- "aria-label": "New chat",
2791
- children: /* @__PURE__ */ jsx(Plus, { size: 16 })
2792
- }
2793
- )
2794
- ] }),
2795
- onSearchChange && /* @__PURE__ */ jsxs("div", { className: "relative", children: [
2796
- /* @__PURE__ */ jsx(
2797
- Search,
2798
- {
2799
- size: 16,
2800
- className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground"
2801
- }
2802
- ),
2803
- /* @__PURE__ */ jsx(
2804
- "input",
2805
- {
2806
- type: "text",
2807
- placeholder: "Search chats...",
2808
- value: searchQuery,
2809
- onChange: (e) => onSearchChange(e.target.value),
2810
- className: "w-full pl-9 pr-3 py-2 border border-input rounded-lg text-sm bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
2811
- }
2812
- )
2813
- ] })
2814
- ] }),
2815
- /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto", children: threads.length === 0 ? /* @__PURE__ */ jsx("div", { className: "p-4 text-center text-muted-foreground text-sm", children: "No chats yet. Start a new conversation!" }) : threads.map((thread) => /* @__PURE__ */ jsx(
2816
- "div",
2817
- {
2818
- onClick: () => onThreadSelect(thread.id),
2819
- className: `p-3 border-b cursor-pointer transition-colors hover:bg-muted/50 ${selectedThreadId === thread.id ? "bg-muted" : ""}`,
2820
- children: /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
2821
- /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
2822
- /* @__PURE__ */ jsxs("h3", { className: "font-medium text-sm truncate mb-1", children: [
2823
- thread.title,
2824
- thread.isTemporary && /* @__PURE__ */ jsx("span", { className: "ml-2 text-xs text-muted-foreground", children: "(Temporary)" })
2825
- ] }),
2826
- /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground truncate", children: thread.preview })
2827
- ] }),
2828
- onDeleteThread && /* @__PURE__ */ jsx(
2829
- "button",
2830
- {
2831
- onClick: (e) => {
2832
- e.stopPropagation();
2833
- onDeleteThread(thread.id);
2834
- },
2835
- className: "p-1 opacity-0 group-hover:opacity-100 hover:bg-destructive/10 rounded transition-opacity text-muted-foreground hover:text-destructive",
2836
- "aria-label": "Delete thread",
2837
- children: /* @__PURE__ */ jsxs(
2838
- "svg",
2839
- {
2840
- width: "14",
2841
- height: "14",
2842
- viewBox: "0 0 24 24",
2843
- fill: "none",
2844
- stroke: "currentColor",
2845
- strokeWidth: "2",
2846
- strokeLinecap: "round",
2847
- strokeLinejoin: "round",
2848
- children: [
2849
- /* @__PURE__ */ jsx("polyline", { points: "3 6 5 6 21 6" }),
2850
- /* @__PURE__ */ jsx("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
2851
- ]
2852
- }
2853
- )
2854
- }
2855
- )
2856
- ] })
2857
- },
2858
- thread.id
2859
- )) })
2860
- ] });
2861
- };
2862
- var MENU_ICON_ID = "menu";
2863
- var MenuIcon = ({ className = "" }) => {
2864
- return /* @__PURE__ */ jsxs(
2865
- "svg",
2866
- {
2867
- className,
2868
- width: "20",
2869
- height: "20",
2870
- viewBox: "0 0 24 24",
2871
- fill: "none",
2872
- stroke: "currentColor",
2873
- strokeWidth: "2",
2874
- strokeLinecap: "round",
2875
- strokeLinejoin: "round",
2876
- children: [
2877
- /* @__PURE__ */ jsx("line", { x1: "3", y1: "12", x2: "21", y2: "12" }),
2878
- /* @__PURE__ */ jsx("line", { x1: "3", y1: "6", x2: "21", y2: "6" }),
2879
- /* @__PURE__ */ jsx("line", { x1: "3", y1: "18", x2: "21", y2: "18" })
2880
- ]
2881
- }
2882
- );
2883
- };
2884
- var CLOSE_ICON_ID = "close";
2885
- var CloseIcon = ({ className = "" }) => {
2886
- return /* @__PURE__ */ jsxs(
2887
- "svg",
2888
- {
2889
- className,
2890
- width: "20",
2891
- height: "20",
2892
- viewBox: "0 0 24 24",
2893
- fill: "none",
2894
- stroke: "currentColor",
2895
- strokeWidth: "2",
2896
- strokeLinecap: "round",
2897
- strokeLinejoin: "round",
2898
- children: [
2899
- /* @__PURE__ */ jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
2900
- /* @__PURE__ */ jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
2901
- ]
2902
- }
2903
- );
2904
- };
2905
-
2906
- // src/styles/applyTheme.ts
2907
- var hslToVar = (color) => {
2908
- if (color === "transparent") {
2909
- return "transparent";
2910
- }
2911
- if (color.startsWith("hsl(")) {
2912
- return color.replace("hsl(", "").replace(")", "");
2913
- }
2914
- return color;
2915
- };
2916
- var applyTheme = (theme, themeName) => {
2917
- const root = document.documentElement;
2918
- if (themeName) {
2919
- root.setAttribute("data-theme", themeName);
2920
- }
2921
- root.style.setProperty("--background", hslToVar(theme.colors.background));
2922
- root.style.setProperty("--foreground", hslToVar(theme.colors.foreground));
2923
- root.style.setProperty("--card", hslToVar(theme.colors.background));
2924
- root.style.setProperty("--card-foreground", hslToVar(theme.colors.foreground));
2925
- root.style.setProperty("--popover", hslToVar(theme.colors.background));
2926
- root.style.setProperty("--popover-foreground", hslToVar(theme.colors.foreground));
2927
- root.style.setProperty("--primary", hslToVar(theme.colors.primary));
2928
- root.style.setProperty("--primary-foreground", hslToVar(theme.colors.background));
2929
- root.style.setProperty("--secondary", hslToVar(theme.colors.secondary));
2930
- root.style.setProperty("--secondary-foreground", hslToVar(theme.colors.foreground));
2931
- root.style.setProperty("--muted", hslToVar(theme.colors.muted));
2932
- root.style.setProperty("--muted-foreground", hslToVar(theme.colors.foreground));
2933
- root.style.setProperty("--accent", hslToVar(theme.colors.accent));
2934
- root.style.setProperty("--accent-foreground", hslToVar(theme.colors.background));
2935
- root.style.setProperty("--destructive", hslToVar(theme.colors.error));
2936
- root.style.setProperty("--destructive-foreground", hslToVar(theme.colors.foreground));
2937
- root.style.setProperty("--border", hslToVar(theme.colors.border));
2938
- root.style.setProperty("--input", hslToVar(theme.colors.border));
2939
- root.style.setProperty("--ring", hslToVar(theme.colors.primary));
2940
- root.style.setProperty("--error", hslToVar(theme.colors.error));
2941
- root.style.setProperty("--warning", hslToVar(theme.colors.warning));
2942
- root.style.setProperty("--success", hslToVar(theme.colors.success));
2943
- root.style.setProperty("--info", hslToVar(theme.colors.info));
2944
- root.style.setProperty("--chart-1", theme.colors.chart[1]);
2945
- root.style.setProperty("--chart-2", theme.colors.chart[2]);
2946
- root.style.setProperty("--chart-3", theme.colors.chart[3]);
2947
- root.style.setProperty("--chart-4", theme.colors.chart[4]);
2948
- root.style.setProperty("--chart-5", theme.colors.chart[5]);
2949
- root.style.setProperty("--left-menu", hslToVar(theme.colors.mainMenu.DEFAULT));
2950
- root.style.setProperty("--left-menu-foreground", hslToVar(theme.colors.mainMenu.foreground));
2951
- root.style.setProperty("--left-menu-hover", hslToVar(theme.colors.mainMenu.hover));
2952
- root.style.setProperty("--left-menu-selected", hslToVar(theme.colors.mainMenu.selected));
2953
- root.style.setProperty("--left-menu-border", hslToVar(theme.colors.mainMenu.border));
2954
- Object.entries(theme.spacing).forEach(([key, value]) => {
2955
- root.style.setProperty(`--spacing-${key}`, value);
2956
- });
2957
- Object.entries(theme.borderRadius).forEach(([key, value]) => {
2958
- root.style.setProperty(`--radius-${key}`, value);
2959
- });
2960
- Object.entries(theme.shadows).forEach(([key, value]) => {
2961
- root.style.setProperty(`--shadow-${key}`, value);
2962
- });
2963
- Object.entries(theme.transitions).forEach(([key, value]) => {
2964
- root.style.setProperty(`--transition-${key}`, value);
2965
- });
2966
- if (themeName?.endsWith("-large")) {
2967
- root.style.fontSize = "125%";
2968
- } else {
2969
- root.style.fontSize = "";
2970
- }
2971
- };
2972
-
2973
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, CLOSE_ICON_ID, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, ChartLegendContent, ChartTooltipContent, ChatInput, Checkbox, CloseIcon, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownButton, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Header, HoverCard, HoverCardContent, HoverCardTrigger, IconButton, Input, MENU_ICON_ID, MenuIcon, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MessageBubble, MessageType, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator2 as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuIcon, SidebarMenuItem, SidebarMenuLabel, Skeleton, Slider, SliderRange, SliderThumb, SliderTrack, Spinner, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThreadList, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UserInfo, applyTheme, badgeVariants };
2974
- //# sourceMappingURL=index.js.map
2975
- //# sourceMappingURL=index.js.map