@syscore/ui-library 1.0.5 → 1.0.7
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/ui/index.cjs.js +1 -1
- package/dist/ui/index.d.ts +47 -677
- package/dist/ui/index.es.js +390 -266
- package/package.json +1 -1
package/dist/ui/index.es.js
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
4
|
-
import { ChevronDown, GripVertical, PanelLeft, Check, Circle, Dot, ChevronUp, ChevronRight, ChevronLeft, MoreHorizontal,
|
|
5
|
-
import {
|
|
4
|
+
import { ChevronDown, GripVertical, X, PanelLeft, Check, Circle, Dot, ChevronUp, ChevronRight, ChevronLeft, MoreHorizontal, ArrowLeft, ArrowRight, Search } from "lucide-react";
|
|
5
|
+
import { clsx } from "clsx";
|
|
6
|
+
import { twMerge } from "tailwind-merge";
|
|
6
7
|
import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
|
|
7
8
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
8
9
|
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
9
10
|
import * as ResizablePrimitive from "react-resizable-panels";
|
|
10
11
|
import { Slot } from "@radix-ui/react-slot";
|
|
11
12
|
import { cva } from "class-variance-authority";
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { Input as Input$1 } from "@/components/ui/input";
|
|
15
|
-
import { Separator as Separator$1 } from "@/components/ui/separator";
|
|
16
|
-
import { Sheet as Sheet$1, SheetContent as SheetContent$1 } from "@/components/ui/sheet";
|
|
17
|
-
import { Skeleton as Skeleton$1 } from "@/components/ui/skeleton";
|
|
18
|
-
import { TooltipProvider as TooltipProvider$1, Tooltip as Tooltip$1, TooltipTrigger as TooltipTrigger$1, TooltipContent as TooltipContent$1 } from "@/components/ui/tooltip";
|
|
13
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
14
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
19
15
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
20
16
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
21
17
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
@@ -24,9 +20,7 @@ import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
|
24
20
|
import { OTPInput, OTPInputContext } from "input-otp";
|
|
25
21
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
26
22
|
import { useFormContext, FormProvider, Controller } from "react-hook-form";
|
|
27
|
-
import { Label as Label$1 } from "@/components/ui/label";
|
|
28
23
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
29
|
-
import { toggleVariants as toggleVariants$1 } from "@/components/ui/toggle";
|
|
30
24
|
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
31
25
|
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
32
26
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
@@ -36,20 +30,18 @@ import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
|
36
30
|
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
|
|
37
31
|
import * as MenubarPrimitive from "@radix-ui/react-menubar";
|
|
38
32
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
39
|
-
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
40
33
|
import { Drawer as Drawer$1 } from "vaul";
|
|
41
34
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
42
35
|
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
|
43
|
-
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
44
36
|
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
45
37
|
import useEmblaCarousel from "embla-carousel-react";
|
|
46
38
|
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
47
39
|
import { Command as Command$1 } from "cmdk";
|
|
48
|
-
import { Dialog as Dialog$1, DialogContent as DialogContent$1 } from "@/components/ui/dialog";
|
|
49
40
|
import * as ToastPrimitives from "@radix-ui/react-toast";
|
|
50
|
-
import { useToast } from "@/hooks/use-toast";
|
|
51
|
-
import { ToastProvider as ToastProvider$1, Toast as Toast$1, ToastTitle as ToastTitle$1, ToastDescription as ToastDescription$1, ToastClose as ToastClose$1, ToastViewport as ToastViewport$1 } from "@/components/ui/toast";
|
|
52
41
|
import * as RechartsPrimitive from "recharts";
|
|
42
|
+
function cn(...inputs) {
|
|
43
|
+
return twMerge(clsx(inputs));
|
|
44
|
+
}
|
|
53
45
|
const Accordion = AccordionPrimitive.Root;
|
|
54
46
|
const AccordionItem = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
55
47
|
AccordionPrimitive.Item,
|
|
@@ -290,6 +282,203 @@ const ResizableHandle = ({
|
|
|
290
282
|
children: withHandle && /* @__PURE__ */ jsx("div", { className: "z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border", children: /* @__PURE__ */ jsx(GripVertical, { className: "h-2.5 w-2.5" }) })
|
|
291
283
|
}
|
|
292
284
|
);
|
|
285
|
+
const MOBILE_BREAKPOINT = 768;
|
|
286
|
+
function useIsMobile() {
|
|
287
|
+
const [isMobile, setIsMobile] = React.useState(
|
|
288
|
+
void 0
|
|
289
|
+
);
|
|
290
|
+
React.useEffect(() => {
|
|
291
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
292
|
+
const onChange = () => {
|
|
293
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
294
|
+
};
|
|
295
|
+
mql.addEventListener("change", onChange);
|
|
296
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
297
|
+
return () => mql.removeEventListener("change", onChange);
|
|
298
|
+
}, []);
|
|
299
|
+
return !!isMobile;
|
|
300
|
+
}
|
|
301
|
+
const buttonVariants = cva(
|
|
302
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
303
|
+
{
|
|
304
|
+
variants: {
|
|
305
|
+
variant: {
|
|
306
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
307
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
308
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
309
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
310
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
311
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
312
|
+
},
|
|
313
|
+
size: {
|
|
314
|
+
default: "h-10 px-4 py-2",
|
|
315
|
+
sm: "h-9 rounded-md px-3",
|
|
316
|
+
lg: "h-11 rounded-md px-8",
|
|
317
|
+
icon: "h-10 w-10"
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
defaultVariants: {
|
|
321
|
+
variant: "default",
|
|
322
|
+
size: "default"
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
);
|
|
326
|
+
const Button = React.forwardRef(
|
|
327
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
328
|
+
const Comp = asChild ? Slot : "button";
|
|
329
|
+
return /* @__PURE__ */ jsx(
|
|
330
|
+
Comp,
|
|
331
|
+
{
|
|
332
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
333
|
+
ref,
|
|
334
|
+
...props
|
|
335
|
+
}
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
);
|
|
339
|
+
Button.displayName = "Button";
|
|
340
|
+
const Input = React.forwardRef(
|
|
341
|
+
({ className, type, ...props }, ref) => {
|
|
342
|
+
return /* @__PURE__ */ jsx(
|
|
343
|
+
"input",
|
|
344
|
+
{
|
|
345
|
+
type,
|
|
346
|
+
className: cn(
|
|
347
|
+
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background 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-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
348
|
+
className
|
|
349
|
+
),
|
|
350
|
+
ref,
|
|
351
|
+
...props
|
|
352
|
+
}
|
|
353
|
+
);
|
|
354
|
+
}
|
|
355
|
+
);
|
|
356
|
+
Input.displayName = "Input";
|
|
357
|
+
const Sheet = SheetPrimitive.Root;
|
|
358
|
+
const SheetTrigger = SheetPrimitive.Trigger;
|
|
359
|
+
const SheetClose = SheetPrimitive.Close;
|
|
360
|
+
const SheetPortal = SheetPrimitive.Portal;
|
|
361
|
+
const SheetOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
362
|
+
SheetPrimitive.Overlay,
|
|
363
|
+
{
|
|
364
|
+
className: cn(
|
|
365
|
+
"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",
|
|
366
|
+
className
|
|
367
|
+
),
|
|
368
|
+
...props,
|
|
369
|
+
ref
|
|
370
|
+
}
|
|
371
|
+
));
|
|
372
|
+
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
|
|
373
|
+
const sheetVariants = cva(
|
|
374
|
+
"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
375
|
+
{
|
|
376
|
+
variants: {
|
|
377
|
+
side: {
|
|
378
|
+
top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
379
|
+
bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
380
|
+
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",
|
|
381
|
+
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"
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
defaultVariants: {
|
|
385
|
+
side: "right"
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
);
|
|
389
|
+
const SheetContent = React.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ jsxs(SheetPortal, { children: [
|
|
390
|
+
/* @__PURE__ */ jsx(SheetOverlay, {}),
|
|
391
|
+
/* @__PURE__ */ jsxs(
|
|
392
|
+
SheetPrimitive.Content,
|
|
393
|
+
{
|
|
394
|
+
ref,
|
|
395
|
+
className: cn(sheetVariants({ side }), className),
|
|
396
|
+
...props,
|
|
397
|
+
children: [
|
|
398
|
+
children,
|
|
399
|
+
/* @__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: [
|
|
400
|
+
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
401
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
402
|
+
] })
|
|
403
|
+
]
|
|
404
|
+
}
|
|
405
|
+
)
|
|
406
|
+
] }));
|
|
407
|
+
SheetContent.displayName = SheetPrimitive.Content.displayName;
|
|
408
|
+
const SheetHeader = ({
|
|
409
|
+
className,
|
|
410
|
+
...props
|
|
411
|
+
}) => /* @__PURE__ */ jsx(
|
|
412
|
+
"div",
|
|
413
|
+
{
|
|
414
|
+
className: cn(
|
|
415
|
+
"flex flex-col space-y-2 text-center sm:text-left",
|
|
416
|
+
className
|
|
417
|
+
),
|
|
418
|
+
...props
|
|
419
|
+
}
|
|
420
|
+
);
|
|
421
|
+
SheetHeader.displayName = "SheetHeader";
|
|
422
|
+
const SheetFooter = ({
|
|
423
|
+
className,
|
|
424
|
+
...props
|
|
425
|
+
}) => /* @__PURE__ */ jsx(
|
|
426
|
+
"div",
|
|
427
|
+
{
|
|
428
|
+
className: cn(
|
|
429
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
430
|
+
className
|
|
431
|
+
),
|
|
432
|
+
...props
|
|
433
|
+
}
|
|
434
|
+
);
|
|
435
|
+
SheetFooter.displayName = "SheetFooter";
|
|
436
|
+
const SheetTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
437
|
+
SheetPrimitive.Title,
|
|
438
|
+
{
|
|
439
|
+
ref,
|
|
440
|
+
className: cn("text-lg font-semibold text-foreground", className),
|
|
441
|
+
...props
|
|
442
|
+
}
|
|
443
|
+
));
|
|
444
|
+
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
445
|
+
const SheetDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
446
|
+
SheetPrimitive.Description,
|
|
447
|
+
{
|
|
448
|
+
ref,
|
|
449
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
450
|
+
...props
|
|
451
|
+
}
|
|
452
|
+
));
|
|
453
|
+
SheetDescription.displayName = SheetPrimitive.Description.displayName;
|
|
454
|
+
function Skeleton({
|
|
455
|
+
className,
|
|
456
|
+
...props
|
|
457
|
+
}) {
|
|
458
|
+
return /* @__PURE__ */ jsx(
|
|
459
|
+
"div",
|
|
460
|
+
{
|
|
461
|
+
className: cn("animate-pulse rounded-md bg-muted", className),
|
|
462
|
+
...props
|
|
463
|
+
}
|
|
464
|
+
);
|
|
465
|
+
}
|
|
466
|
+
const TooltipProvider = TooltipPrimitive.Provider;
|
|
467
|
+
const Tooltip = TooltipPrimitive.Root;
|
|
468
|
+
const TooltipTrigger = TooltipPrimitive.Trigger;
|
|
469
|
+
const TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
470
|
+
TooltipPrimitive.Content,
|
|
471
|
+
{
|
|
472
|
+
ref,
|
|
473
|
+
sideOffset,
|
|
474
|
+
className: cn(
|
|
475
|
+
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md 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",
|
|
476
|
+
className
|
|
477
|
+
),
|
|
478
|
+
...props
|
|
479
|
+
}
|
|
480
|
+
));
|
|
481
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
293
482
|
const SIDEBAR_COOKIE_NAME = "sidebar:state";
|
|
294
483
|
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
295
484
|
const SIDEBAR_WIDTH = "16rem";
|
|
@@ -364,7 +553,7 @@ const SidebarProvider = React.forwardRef(
|
|
|
364
553
|
toggleSidebar
|
|
365
554
|
]
|
|
366
555
|
);
|
|
367
|
-
return /* @__PURE__ */ jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(TooltipProvider
|
|
556
|
+
return /* @__PURE__ */ jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx(
|
|
368
557
|
"div",
|
|
369
558
|
{
|
|
370
559
|
style: {
|
|
@@ -409,8 +598,8 @@ const Sidebar = React.forwardRef(
|
|
|
409
598
|
);
|
|
410
599
|
}
|
|
411
600
|
if (isMobile) {
|
|
412
|
-
return /* @__PURE__ */ jsx(Sheet
|
|
413
|
-
SheetContent
|
|
601
|
+
return /* @__PURE__ */ jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsx(
|
|
602
|
+
SheetContent,
|
|
414
603
|
{
|
|
415
604
|
"data-sidebar": "sidebar",
|
|
416
605
|
"data-mobile": "true",
|
|
@@ -474,7 +663,7 @@ Sidebar.displayName = "Sidebar";
|
|
|
474
663
|
const SidebarTrigger = React.forwardRef(({ className, onClick, ...props }, ref) => {
|
|
475
664
|
const { toggleSidebar } = useSidebar();
|
|
476
665
|
return /* @__PURE__ */ jsxs(
|
|
477
|
-
Button
|
|
666
|
+
Button,
|
|
478
667
|
{
|
|
479
668
|
ref,
|
|
480
669
|
"data-sidebar": "trigger",
|
|
@@ -536,7 +725,7 @@ const SidebarInset = React.forwardRef(({ className, ...props }, ref) => {
|
|
|
536
725
|
SidebarInset.displayName = "SidebarInset";
|
|
537
726
|
const SidebarInput = React.forwardRef(({ className, ...props }, ref) => {
|
|
538
727
|
return /* @__PURE__ */ jsx(
|
|
539
|
-
Input
|
|
728
|
+
Input,
|
|
540
729
|
{
|
|
541
730
|
ref,
|
|
542
731
|
"data-sidebar": "input",
|
|
@@ -575,7 +764,7 @@ const SidebarFooter = React.forwardRef(({ className, ...props }, ref) => {
|
|
|
575
764
|
SidebarFooter.displayName = "SidebarFooter";
|
|
576
765
|
const SidebarSeparator = React.forwardRef(({ className, ...props }, ref) => {
|
|
577
766
|
return /* @__PURE__ */ jsx(
|
|
578
|
-
Separator
|
|
767
|
+
Separator,
|
|
579
768
|
{
|
|
580
769
|
ref,
|
|
581
770
|
"data-sidebar": "separator",
|
|
@@ -729,10 +918,10 @@ const SidebarMenuButton = React.forwardRef(
|
|
|
729
918
|
children: tooltip
|
|
730
919
|
};
|
|
731
920
|
}
|
|
732
|
-
return /* @__PURE__ */ jsxs(Tooltip
|
|
733
|
-
/* @__PURE__ */ jsx(TooltipTrigger
|
|
921
|
+
return /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
922
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: button }),
|
|
734
923
|
/* @__PURE__ */ jsx(
|
|
735
|
-
TooltipContent
|
|
924
|
+
TooltipContent,
|
|
736
925
|
{
|
|
737
926
|
side: "right",
|
|
738
927
|
align: "center",
|
|
@@ -798,14 +987,14 @@ const SidebarMenuSkeleton = React.forwardRef(({ className, showIcon = false, ...
|
|
|
798
987
|
...props,
|
|
799
988
|
children: [
|
|
800
989
|
showIcon && /* @__PURE__ */ jsx(
|
|
801
|
-
Skeleton
|
|
990
|
+
Skeleton,
|
|
802
991
|
{
|
|
803
992
|
className: "size-4 rounded-md",
|
|
804
993
|
"data-sidebar": "menu-skeleton-icon"
|
|
805
994
|
}
|
|
806
995
|
),
|
|
807
996
|
/* @__PURE__ */ jsx(
|
|
808
|
-
Skeleton
|
|
997
|
+
Skeleton,
|
|
809
998
|
{
|
|
810
999
|
className: "h-4 flex-1 max-w-[--skeleton-width]",
|
|
811
1000
|
"data-sidebar": "menu-skeleton-text",
|
|
@@ -857,62 +1046,6 @@ const SidebarMenuSubButton = React.forwardRef(({ asChild = false, size = "md", i
|
|
|
857
1046
|
);
|
|
858
1047
|
});
|
|
859
1048
|
SidebarMenuSubButton.displayName = "SidebarMenuSubButton";
|
|
860
|
-
const Input = React.forwardRef(
|
|
861
|
-
({ className, type, ...props }, ref) => {
|
|
862
|
-
return /* @__PURE__ */ jsx(
|
|
863
|
-
"input",
|
|
864
|
-
{
|
|
865
|
-
type,
|
|
866
|
-
className: cn(
|
|
867
|
-
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background 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-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
868
|
-
className
|
|
869
|
-
),
|
|
870
|
-
ref,
|
|
871
|
-
...props
|
|
872
|
-
}
|
|
873
|
-
);
|
|
874
|
-
}
|
|
875
|
-
);
|
|
876
|
-
Input.displayName = "Input";
|
|
877
|
-
const buttonVariants = cva(
|
|
878
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
879
|
-
{
|
|
880
|
-
variants: {
|
|
881
|
-
variant: {
|
|
882
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
883
|
-
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
884
|
-
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
885
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
886
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
887
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
888
|
-
},
|
|
889
|
-
size: {
|
|
890
|
-
default: "h-10 px-4 py-2",
|
|
891
|
-
sm: "h-9 rounded-md px-3",
|
|
892
|
-
lg: "h-11 rounded-md px-8",
|
|
893
|
-
icon: "h-10 w-10"
|
|
894
|
-
}
|
|
895
|
-
},
|
|
896
|
-
defaultVariants: {
|
|
897
|
-
variant: "default",
|
|
898
|
-
size: "default"
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
);
|
|
902
|
-
const Button = React.forwardRef(
|
|
903
|
-
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
904
|
-
const Comp = asChild ? Slot : "button";
|
|
905
|
-
return /* @__PURE__ */ jsx(
|
|
906
|
-
Comp,
|
|
907
|
-
{
|
|
908
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
909
|
-
ref,
|
|
910
|
-
...props
|
|
911
|
-
}
|
|
912
|
-
);
|
|
913
|
-
}
|
|
914
|
-
);
|
|
915
|
-
Button.displayName = "Button";
|
|
916
1049
|
const labelVariants = cva(
|
|
917
1050
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
918
1051
|
);
|
|
@@ -1205,7 +1338,7 @@ FormItem.displayName = "FormItem";
|
|
|
1205
1338
|
const FormLabel = React.forwardRef(({ className, ...props }, ref) => {
|
|
1206
1339
|
const { error, formItemId } = useFormField();
|
|
1207
1340
|
return /* @__PURE__ */ jsx(
|
|
1208
|
-
Label
|
|
1341
|
+
Label,
|
|
1209
1342
|
{
|
|
1210
1343
|
ref,
|
|
1211
1344
|
className: cn(error && "text-destructive", className),
|
|
@@ -1260,6 +1393,35 @@ const FormMessage = React.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
1260
1393
|
);
|
|
1261
1394
|
});
|
|
1262
1395
|
FormMessage.displayName = "FormMessage";
|
|
1396
|
+
const toggleVariants = cva(
|
|
1397
|
+
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
|
|
1398
|
+
{
|
|
1399
|
+
variants: {
|
|
1400
|
+
variant: {
|
|
1401
|
+
default: "bg-transparent",
|
|
1402
|
+
outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"
|
|
1403
|
+
},
|
|
1404
|
+
size: {
|
|
1405
|
+
default: "h-10 px-3",
|
|
1406
|
+
sm: "h-9 px-2.5",
|
|
1407
|
+
lg: "h-11 px-5"
|
|
1408
|
+
}
|
|
1409
|
+
},
|
|
1410
|
+
defaultVariants: {
|
|
1411
|
+
variant: "default",
|
|
1412
|
+
size: "default"
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
);
|
|
1416
|
+
const Toggle = React.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1417
|
+
TogglePrimitive.Root,
|
|
1418
|
+
{
|
|
1419
|
+
ref,
|
|
1420
|
+
className: cn(toggleVariants({ variant, size, className })),
|
|
1421
|
+
...props
|
|
1422
|
+
}
|
|
1423
|
+
));
|
|
1424
|
+
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
1263
1425
|
const ToggleGroupContext = React.createContext({
|
|
1264
1426
|
size: "default",
|
|
1265
1427
|
variant: "default"
|
|
@@ -1281,7 +1443,7 @@ const ToggleGroupItem = React.forwardRef(({ className, children, variant, size,
|
|
|
1281
1443
|
{
|
|
1282
1444
|
ref,
|
|
1283
1445
|
className: cn(
|
|
1284
|
-
toggleVariants
|
|
1446
|
+
toggleVariants({
|
|
1285
1447
|
variant: context.variant || variant,
|
|
1286
1448
|
size: context.size || size
|
|
1287
1449
|
}),
|
|
@@ -1293,35 +1455,6 @@ const ToggleGroupItem = React.forwardRef(({ className, children, variant, size,
|
|
|
1293
1455
|
);
|
|
1294
1456
|
});
|
|
1295
1457
|
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
1296
|
-
const toggleVariants = cva(
|
|
1297
|
-
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
|
|
1298
|
-
{
|
|
1299
|
-
variants: {
|
|
1300
|
-
variant: {
|
|
1301
|
-
default: "bg-transparent",
|
|
1302
|
-
outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"
|
|
1303
|
-
},
|
|
1304
|
-
size: {
|
|
1305
|
-
default: "h-10 px-3",
|
|
1306
|
-
sm: "h-9 px-2.5",
|
|
1307
|
-
lg: "h-11 px-5"
|
|
1308
|
-
}
|
|
1309
|
-
},
|
|
1310
|
-
defaultVariants: {
|
|
1311
|
-
variant: "default",
|
|
1312
|
-
size: "default"
|
|
1313
|
-
}
|
|
1314
|
-
}
|
|
1315
|
-
);
|
|
1316
|
-
const Toggle = React.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1317
|
-
TogglePrimitive.Root,
|
|
1318
|
-
{
|
|
1319
|
-
ref,
|
|
1320
|
-
className: cn(toggleVariants({ variant, size, className })),
|
|
1321
|
-
...props
|
|
1322
|
-
}
|
|
1323
|
-
));
|
|
1324
|
-
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
1325
1458
|
const badgeVariants = cva(
|
|
1326
1459
|
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
1327
1460
|
{
|
|
@@ -1463,7 +1596,7 @@ const AlertDialogAction = React.forwardRef(({ className, ...props }, ref) => /*
|
|
|
1463
1596
|
AlertDialogPrimitive.Action,
|
|
1464
1597
|
{
|
|
1465
1598
|
ref,
|
|
1466
|
-
className: cn(buttonVariants
|
|
1599
|
+
className: cn(buttonVariants(), className),
|
|
1467
1600
|
...props
|
|
1468
1601
|
}
|
|
1469
1602
|
));
|
|
@@ -1473,7 +1606,7 @@ const AlertDialogCancel = React.forwardRef(({ className, ...props }, ref) => /*
|
|
|
1473
1606
|
{
|
|
1474
1607
|
ref,
|
|
1475
1608
|
className: cn(
|
|
1476
|
-
buttonVariants
|
|
1609
|
+
buttonVariants({ variant: "outline" }),
|
|
1477
1610
|
"mt-2 sm:mt-0",
|
|
1478
1611
|
className
|
|
1479
1612
|
),
|
|
@@ -1595,18 +1728,6 @@ const Progress = React.forwardRef(({ className, value, ...props }, ref) => /* @_
|
|
|
1595
1728
|
}
|
|
1596
1729
|
));
|
|
1597
1730
|
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
1598
|
-
function Skeleton({
|
|
1599
|
-
className,
|
|
1600
|
-
...props
|
|
1601
|
-
}) {
|
|
1602
|
-
return /* @__PURE__ */ jsx(
|
|
1603
|
-
"div",
|
|
1604
|
-
{
|
|
1605
|
-
className: cn("animate-pulse rounded-md bg-muted", className),
|
|
1606
|
-
...props
|
|
1607
|
-
}
|
|
1608
|
-
);
|
|
1609
|
-
}
|
|
1610
1731
|
function Calendar({
|
|
1611
1732
|
className,
|
|
1612
1733
|
classNames,
|
|
@@ -1625,7 +1746,7 @@ function Calendar({
|
|
|
1625
1746
|
caption_label: "text-sm font-medium",
|
|
1626
1747
|
nav: "space-x-1 flex items-center",
|
|
1627
1748
|
nav_button: cn(
|
|
1628
|
-
buttonVariants
|
|
1749
|
+
buttonVariants({ variant: "outline" }),
|
|
1629
1750
|
"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
|
|
1630
1751
|
),
|
|
1631
1752
|
nav_button_previous: "absolute left-1",
|
|
@@ -1636,7 +1757,7 @@ function Calendar({
|
|
|
1636
1757
|
row: "flex w-full mt-2",
|
|
1637
1758
|
cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
|
|
1638
1759
|
day: cn(
|
|
1639
|
-
buttonVariants
|
|
1760
|
+
buttonVariants({ variant: "ghost" }),
|
|
1640
1761
|
"h-9 w-9 p-0 font-normal aria-selected:opacity-100"
|
|
1641
1762
|
),
|
|
1642
1763
|
day_range_end: "day-range-end",
|
|
@@ -1729,7 +1850,7 @@ const PaginationLink = ({
|
|
|
1729
1850
|
{
|
|
1730
1851
|
"aria-current": isActive ? "page" : void 0,
|
|
1731
1852
|
className: cn(
|
|
1732
|
-
buttonVariants
|
|
1853
|
+
buttonVariants({
|
|
1733
1854
|
variant: isActive ? "outline" : "ghost",
|
|
1734
1855
|
size
|
|
1735
1856
|
}),
|
|
@@ -2165,12 +2286,12 @@ const DropdownMenuShortcut = ({
|
|
|
2165
2286
|
);
|
|
2166
2287
|
};
|
|
2167
2288
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
2168
|
-
const Dialog =
|
|
2169
|
-
const DialogTrigger =
|
|
2170
|
-
const DialogPortal =
|
|
2171
|
-
const DialogClose =
|
|
2289
|
+
const Dialog = SheetPrimitive.Root;
|
|
2290
|
+
const DialogTrigger = SheetPrimitive.Trigger;
|
|
2291
|
+
const DialogPortal = SheetPrimitive.Portal;
|
|
2292
|
+
const DialogClose = SheetPrimitive.Close;
|
|
2172
2293
|
const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2173
|
-
|
|
2294
|
+
SheetPrimitive.Overlay,
|
|
2174
2295
|
{
|
|
2175
2296
|
ref,
|
|
2176
2297
|
className: cn(
|
|
@@ -2180,11 +2301,11 @@ const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
2180
2301
|
...props
|
|
2181
2302
|
}
|
|
2182
2303
|
));
|
|
2183
|
-
DialogOverlay.displayName =
|
|
2304
|
+
DialogOverlay.displayName = SheetPrimitive.Overlay.displayName;
|
|
2184
2305
|
const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
2185
2306
|
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
2186
2307
|
/* @__PURE__ */ jsxs(
|
|
2187
|
-
|
|
2308
|
+
SheetPrimitive.Content,
|
|
2188
2309
|
{
|
|
2189
2310
|
ref,
|
|
2190
2311
|
className: cn(
|
|
@@ -2194,7 +2315,7 @@ const DialogContent = React.forwardRef(({ className, children, ...props }, ref)
|
|
|
2194
2315
|
...props,
|
|
2195
2316
|
children: [
|
|
2196
2317
|
children,
|
|
2197
|
-
/* @__PURE__ */ jsxs(
|
|
2318
|
+
/* @__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: [
|
|
2198
2319
|
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
2199
2320
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
2200
2321
|
] })
|
|
@@ -2202,7 +2323,7 @@ const DialogContent = React.forwardRef(({ className, children, ...props }, ref)
|
|
|
2202
2323
|
}
|
|
2203
2324
|
)
|
|
2204
2325
|
] }));
|
|
2205
|
-
DialogContent.displayName =
|
|
2326
|
+
DialogContent.displayName = SheetPrimitive.Content.displayName;
|
|
2206
2327
|
const DialogHeader = ({
|
|
2207
2328
|
className,
|
|
2208
2329
|
...props
|
|
@@ -2232,7 +2353,7 @@ const DialogFooter = ({
|
|
|
2232
2353
|
);
|
|
2233
2354
|
DialogFooter.displayName = "DialogFooter";
|
|
2234
2355
|
const DialogTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2235
|
-
|
|
2356
|
+
SheetPrimitive.Title,
|
|
2236
2357
|
{
|
|
2237
2358
|
ref,
|
|
2238
2359
|
className: cn(
|
|
@@ -2242,113 +2363,16 @@ const DialogTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
2242
2363
|
...props
|
|
2243
2364
|
}
|
|
2244
2365
|
));
|
|
2245
|
-
DialogTitle.displayName =
|
|
2366
|
+
DialogTitle.displayName = SheetPrimitive.Title.displayName;
|
|
2246
2367
|
const DialogDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2247
|
-
|
|
2248
|
-
{
|
|
2249
|
-
ref,
|
|
2250
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
2251
|
-
...props
|
|
2252
|
-
}
|
|
2253
|
-
));
|
|
2254
|
-
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
2255
|
-
const Sheet = DialogPrimitive.Root;
|
|
2256
|
-
const SheetTrigger = DialogPrimitive.Trigger;
|
|
2257
|
-
const SheetClose = DialogPrimitive.Close;
|
|
2258
|
-
const SheetPortal = DialogPrimitive.Portal;
|
|
2259
|
-
const SheetOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2260
|
-
DialogPrimitive.Overlay,
|
|
2261
|
-
{
|
|
2262
|
-
className: cn(
|
|
2263
|
-
"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",
|
|
2264
|
-
className
|
|
2265
|
-
),
|
|
2266
|
-
...props,
|
|
2267
|
-
ref
|
|
2268
|
-
}
|
|
2269
|
-
));
|
|
2270
|
-
SheetOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
2271
|
-
const sheetVariants = cva(
|
|
2272
|
-
"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
2273
|
-
{
|
|
2274
|
-
variants: {
|
|
2275
|
-
side: {
|
|
2276
|
-
top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
2277
|
-
bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
2278
|
-
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",
|
|
2279
|
-
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"
|
|
2280
|
-
}
|
|
2281
|
-
},
|
|
2282
|
-
defaultVariants: {
|
|
2283
|
-
side: "right"
|
|
2284
|
-
}
|
|
2285
|
-
}
|
|
2286
|
-
);
|
|
2287
|
-
const SheetContent = React.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ jsxs(SheetPortal, { children: [
|
|
2288
|
-
/* @__PURE__ */ jsx(SheetOverlay, {}),
|
|
2289
|
-
/* @__PURE__ */ jsxs(
|
|
2290
|
-
DialogPrimitive.Content,
|
|
2291
|
-
{
|
|
2292
|
-
ref,
|
|
2293
|
-
className: cn(sheetVariants({ side }), className),
|
|
2294
|
-
...props,
|
|
2295
|
-
children: [
|
|
2296
|
-
children,
|
|
2297
|
-
/* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
|
|
2298
|
-
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
2299
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
2300
|
-
] })
|
|
2301
|
-
]
|
|
2302
|
-
}
|
|
2303
|
-
)
|
|
2304
|
-
] }));
|
|
2305
|
-
SheetContent.displayName = DialogPrimitive.Content.displayName;
|
|
2306
|
-
const SheetHeader = ({
|
|
2307
|
-
className,
|
|
2308
|
-
...props
|
|
2309
|
-
}) => /* @__PURE__ */ jsx(
|
|
2310
|
-
"div",
|
|
2311
|
-
{
|
|
2312
|
-
className: cn(
|
|
2313
|
-
"flex flex-col space-y-2 text-center sm:text-left",
|
|
2314
|
-
className
|
|
2315
|
-
),
|
|
2316
|
-
...props
|
|
2317
|
-
}
|
|
2318
|
-
);
|
|
2319
|
-
SheetHeader.displayName = "SheetHeader";
|
|
2320
|
-
const SheetFooter = ({
|
|
2321
|
-
className,
|
|
2322
|
-
...props
|
|
2323
|
-
}) => /* @__PURE__ */ jsx(
|
|
2324
|
-
"div",
|
|
2325
|
-
{
|
|
2326
|
-
className: cn(
|
|
2327
|
-
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
2328
|
-
className
|
|
2329
|
-
),
|
|
2330
|
-
...props
|
|
2331
|
-
}
|
|
2332
|
-
);
|
|
2333
|
-
SheetFooter.displayName = "SheetFooter";
|
|
2334
|
-
const SheetTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2335
|
-
DialogPrimitive.Title,
|
|
2336
|
-
{
|
|
2337
|
-
ref,
|
|
2338
|
-
className: cn("text-lg font-semibold text-foreground", className),
|
|
2339
|
-
...props
|
|
2340
|
-
}
|
|
2341
|
-
));
|
|
2342
|
-
SheetTitle.displayName = DialogPrimitive.Title.displayName;
|
|
2343
|
-
const SheetDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2344
|
-
DialogPrimitive.Description,
|
|
2368
|
+
SheetPrimitive.Description,
|
|
2345
2369
|
{
|
|
2346
2370
|
ref,
|
|
2347
2371
|
className: cn("text-sm text-muted-foreground", className),
|
|
2348
2372
|
...props
|
|
2349
2373
|
}
|
|
2350
2374
|
));
|
|
2351
|
-
|
|
2375
|
+
DialogDescription.displayName = SheetPrimitive.Description.displayName;
|
|
2352
2376
|
const Drawer = ({
|
|
2353
2377
|
shouldScaleBackground = true,
|
|
2354
2378
|
...props
|
|
@@ -2466,22 +2490,6 @@ const HoverCardContent = React.forwardRef(({ className, align = "center", sideOf
|
|
|
2466
2490
|
}
|
|
2467
2491
|
));
|
|
2468
2492
|
HoverCardContent.displayName = HoverCardPrimitive.Content.displayName;
|
|
2469
|
-
const TooltipProvider = TooltipPrimitive.Provider;
|
|
2470
|
-
const Tooltip = TooltipPrimitive.Root;
|
|
2471
|
-
const TooltipTrigger = TooltipPrimitive.Trigger;
|
|
2472
|
-
const TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2473
|
-
TooltipPrimitive.Content,
|
|
2474
|
-
{
|
|
2475
|
-
ref,
|
|
2476
|
-
sideOffset,
|
|
2477
|
-
className: cn(
|
|
2478
|
-
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md 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",
|
|
2479
|
-
className
|
|
2480
|
-
),
|
|
2481
|
-
...props
|
|
2482
|
-
}
|
|
2483
|
-
));
|
|
2484
|
-
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
2485
2493
|
const ContextMenu = ContextMenuPrimitive.Root;
|
|
2486
2494
|
const ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
2487
2495
|
const ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
@@ -2749,7 +2757,7 @@ CarouselItem.displayName = "CarouselItem";
|
|
|
2749
2757
|
const CarouselPrevious = React.forwardRef(({ className, variant = "outline", size = "icon", ...props }, ref) => {
|
|
2750
2758
|
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
2751
2759
|
return /* @__PURE__ */ jsxs(
|
|
2752
|
-
Button
|
|
2760
|
+
Button,
|
|
2753
2761
|
{
|
|
2754
2762
|
ref,
|
|
2755
2763
|
variant,
|
|
@@ -2773,7 +2781,7 @@ CarouselPrevious.displayName = "CarouselPrevious";
|
|
|
2773
2781
|
const CarouselNext = React.forwardRef(({ className, variant = "outline", size = "icon", ...props }, ref) => {
|
|
2774
2782
|
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
2775
2783
|
return /* @__PURE__ */ jsxs(
|
|
2776
|
-
Button
|
|
2784
|
+
Button,
|
|
2777
2785
|
{
|
|
2778
2786
|
ref,
|
|
2779
2787
|
variant,
|
|
@@ -2810,7 +2818,7 @@ const Command = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
2810
2818
|
));
|
|
2811
2819
|
Command.displayName = Command$1.displayName;
|
|
2812
2820
|
const CommandDialog = ({ children, ...props }) => {
|
|
2813
|
-
return /* @__PURE__ */ jsx(Dialog
|
|
2821
|
+
return /* @__PURE__ */ jsx(Dialog, { ...props, children: /* @__PURE__ */ jsx(DialogContent, { className: "overflow-hidden p-0 shadow-lg", children: /* @__PURE__ */ jsx(Command, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children }) }) });
|
|
2814
2822
|
};
|
|
2815
2823
|
const CommandInput = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
2816
2824
|
/* @__PURE__ */ jsx(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
@@ -2976,20 +2984,136 @@ const ToastDescription = React.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
2976
2984
|
}
|
|
2977
2985
|
));
|
|
2978
2986
|
ToastDescription.displayName = ToastPrimitives.Description.displayName;
|
|
2987
|
+
const TOAST_LIMIT = 1;
|
|
2988
|
+
const TOAST_REMOVE_DELAY = 1e6;
|
|
2989
|
+
let count = 0;
|
|
2990
|
+
function genId() {
|
|
2991
|
+
count = (count + 1) % Number.MAX_SAFE_INTEGER;
|
|
2992
|
+
return count.toString();
|
|
2993
|
+
}
|
|
2994
|
+
const toastTimeouts = /* @__PURE__ */ new Map();
|
|
2995
|
+
const addToRemoveQueue = (toastId) => {
|
|
2996
|
+
if (toastTimeouts.has(toastId)) {
|
|
2997
|
+
return;
|
|
2998
|
+
}
|
|
2999
|
+
const timeout = setTimeout(() => {
|
|
3000
|
+
toastTimeouts.delete(toastId);
|
|
3001
|
+
dispatch({
|
|
3002
|
+
type: "REMOVE_TOAST",
|
|
3003
|
+
toastId
|
|
3004
|
+
});
|
|
3005
|
+
}, TOAST_REMOVE_DELAY);
|
|
3006
|
+
toastTimeouts.set(toastId, timeout);
|
|
3007
|
+
};
|
|
3008
|
+
const reducer = (state, action) => {
|
|
3009
|
+
switch (action.type) {
|
|
3010
|
+
case "ADD_TOAST":
|
|
3011
|
+
return {
|
|
3012
|
+
...state,
|
|
3013
|
+
toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT)
|
|
3014
|
+
};
|
|
3015
|
+
case "UPDATE_TOAST":
|
|
3016
|
+
return {
|
|
3017
|
+
...state,
|
|
3018
|
+
toasts: state.toasts.map(
|
|
3019
|
+
(t) => t.id === action.toast.id ? { ...t, ...action.toast } : t
|
|
3020
|
+
)
|
|
3021
|
+
};
|
|
3022
|
+
case "DISMISS_TOAST": {
|
|
3023
|
+
const { toastId } = action;
|
|
3024
|
+
if (toastId) {
|
|
3025
|
+
addToRemoveQueue(toastId);
|
|
3026
|
+
} else {
|
|
3027
|
+
state.toasts.forEach((toast2) => {
|
|
3028
|
+
addToRemoveQueue(toast2.id);
|
|
3029
|
+
});
|
|
3030
|
+
}
|
|
3031
|
+
return {
|
|
3032
|
+
...state,
|
|
3033
|
+
toasts: state.toasts.map(
|
|
3034
|
+
(t) => t.id === toastId || toastId === void 0 ? {
|
|
3035
|
+
...t,
|
|
3036
|
+
open: false
|
|
3037
|
+
} : t
|
|
3038
|
+
)
|
|
3039
|
+
};
|
|
3040
|
+
}
|
|
3041
|
+
case "REMOVE_TOAST":
|
|
3042
|
+
if (action.toastId === void 0) {
|
|
3043
|
+
return {
|
|
3044
|
+
...state,
|
|
3045
|
+
toasts: []
|
|
3046
|
+
};
|
|
3047
|
+
}
|
|
3048
|
+
return {
|
|
3049
|
+
...state,
|
|
3050
|
+
toasts: state.toasts.filter((t) => t.id !== action.toastId)
|
|
3051
|
+
};
|
|
3052
|
+
}
|
|
3053
|
+
};
|
|
3054
|
+
const listeners = [];
|
|
3055
|
+
let memoryState = { toasts: [] };
|
|
3056
|
+
function dispatch(action) {
|
|
3057
|
+
memoryState = reducer(memoryState, action);
|
|
3058
|
+
listeners.forEach((listener) => {
|
|
3059
|
+
listener(memoryState);
|
|
3060
|
+
});
|
|
3061
|
+
}
|
|
3062
|
+
function toast({ ...props }) {
|
|
3063
|
+
const id = genId();
|
|
3064
|
+
const update = (props2) => dispatch({
|
|
3065
|
+
type: "UPDATE_TOAST",
|
|
3066
|
+
toast: { ...props2, id }
|
|
3067
|
+
});
|
|
3068
|
+
const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id });
|
|
3069
|
+
dispatch({
|
|
3070
|
+
type: "ADD_TOAST",
|
|
3071
|
+
toast: {
|
|
3072
|
+
...props,
|
|
3073
|
+
id,
|
|
3074
|
+
open: true,
|
|
3075
|
+
onOpenChange: (open) => {
|
|
3076
|
+
if (!open) dismiss();
|
|
3077
|
+
}
|
|
3078
|
+
}
|
|
3079
|
+
});
|
|
3080
|
+
return {
|
|
3081
|
+
id,
|
|
3082
|
+
dismiss,
|
|
3083
|
+
update
|
|
3084
|
+
};
|
|
3085
|
+
}
|
|
3086
|
+
function useToast() {
|
|
3087
|
+
const [state, setState] = React.useState(memoryState);
|
|
3088
|
+
React.useEffect(() => {
|
|
3089
|
+
listeners.push(setState);
|
|
3090
|
+
return () => {
|
|
3091
|
+
const index = listeners.indexOf(setState);
|
|
3092
|
+
if (index > -1) {
|
|
3093
|
+
listeners.splice(index, 1);
|
|
3094
|
+
}
|
|
3095
|
+
};
|
|
3096
|
+
}, [state]);
|
|
3097
|
+
return {
|
|
3098
|
+
...state,
|
|
3099
|
+
toast,
|
|
3100
|
+
dismiss: (toastId) => dispatch({ type: "DISMISS_TOAST", toastId })
|
|
3101
|
+
};
|
|
3102
|
+
}
|
|
2979
3103
|
function Toaster() {
|
|
2980
3104
|
const { toasts } = useToast();
|
|
2981
|
-
return /* @__PURE__ */ jsxs(ToastProvider
|
|
3105
|
+
return /* @__PURE__ */ jsxs(ToastProvider, { children: [
|
|
2982
3106
|
toasts.map(function({ id, title, description, action, ...props }) {
|
|
2983
|
-
return /* @__PURE__ */ jsxs(Toast
|
|
3107
|
+
return /* @__PURE__ */ jsxs(Toast, { ...props, children: [
|
|
2984
3108
|
/* @__PURE__ */ jsxs("div", { className: "grid gap-1", children: [
|
|
2985
|
-
title && /* @__PURE__ */ jsx(ToastTitle
|
|
2986
|
-
description && /* @__PURE__ */ jsx(ToastDescription
|
|
3109
|
+
title && /* @__PURE__ */ jsx(ToastTitle, { children: title }),
|
|
3110
|
+
description && /* @__PURE__ */ jsx(ToastDescription, { children: description })
|
|
2987
3111
|
] }),
|
|
2988
3112
|
action,
|
|
2989
|
-
/* @__PURE__ */ jsx(ToastClose
|
|
3113
|
+
/* @__PURE__ */ jsx(ToastClose, {})
|
|
2990
3114
|
] }, id);
|
|
2991
3115
|
}),
|
|
2992
|
-
/* @__PURE__ */ jsx(ToastViewport
|
|
3116
|
+
/* @__PURE__ */ jsx(ToastViewport, {})
|
|
2993
3117
|
] });
|
|
2994
3118
|
}
|
|
2995
3119
|
const THEMES = { light: "", dark: ".dark" };
|