shadcn-packaged 2025.4.14 → 2025.6.16-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/README.md +30 -31
  2. package/index.css +112 -138
  3. package/package.json +38 -38
  4. package/ui/accordion.d.ts +4 -4
  5. package/ui/accordion.jsx +20 -15
  6. package/ui/alert-dialog.d.ts +11 -17
  7. package/ui/alert-dialog.jsx +36 -23
  8. package/ui/alert.d.ts +5 -4
  9. package/ui/alert.jsx +12 -9
  10. package/ui/aspect-ratio.d.ts +1 -1
  11. package/ui/aspect-ratio.jsx +3 -1
  12. package/ui/avatar.d.ts +3 -3
  13. package/ui/avatar.jsx +9 -6
  14. package/ui/badge.d.ts +3 -3
  15. package/ui/badge.jsx +9 -7
  16. package/ui/breadcrumb.d.ts +8 -16
  17. package/ui/breadcrumb.jsx +26 -21
  18. package/ui/button.d.ts +2 -3
  19. package/ui/button.jsx +13 -14
  20. package/ui/calendar.d.ts +7 -7
  21. package/ui/calendar.jsx +70 -30
  22. package/ui/card.d.ts +8 -7
  23. package/ui/card.jsx +22 -13
  24. package/ui/carousel.d.ts +6 -5
  25. package/ui/carousel.jsx +26 -34
  26. package/ui/chart.d.ts +6 -28
  27. package/ui/chart.jsx +37 -40
  28. package/ui/checkbox.d.ts +1 -1
  29. package/ui/checkbox.jsx +8 -7
  30. package/ui/collapsible.d.ts +3 -3
  31. package/ui/collapsible.jsx +9 -3
  32. package/ui/command.d.ts +16 -78
  33. package/ui/command.jsx +37 -27
  34. package/ui/context-menu.d.ts +19 -21
  35. package/ui/context-menu.jsx +65 -47
  36. package/ui/dialog.d.ts +13 -17
  37. package/ui/dialog.jsx +41 -27
  38. package/ui/drawer.d.ts +10 -19
  39. package/ui/drawer.jsx +36 -23
  40. package/ui/dropdown-menu.d.ts +20 -22
  41. package/ui/dropdown-menu.jsx +66 -50
  42. package/ui/form.d.ts +6 -5
  43. package/ui/form.jsx +19 -23
  44. package/ui/hover-card.d.ts +3 -3
  45. package/ui/hover-card.jsx +11 -4
  46. package/ui/input-otp.d.ts +7 -30
  47. package/ui/input-otp.jsx +17 -15
  48. package/ui/input.d.ts +1 -1
  49. package/ui/input.jsx +3 -4
  50. package/ui/label.d.ts +1 -2
  51. package/ui/label.jsx +3 -4
  52. package/ui/menubar.d.ts +17 -19
  53. package/ui/menubar.jsx +58 -49
  54. package/ui/navigation-menu.d.ts +11 -9
  55. package/ui/navigation-menu.jsx +37 -29
  56. package/ui/pagination.d.ts +10 -25
  57. package/ui/pagination.jsx +35 -28
  58. package/ui/popover.d.ts +5 -4
  59. package/ui/popover.jsx +15 -7
  60. package/ui/progress.d.ts +1 -1
  61. package/ui/progress.jsx +5 -4
  62. package/ui/radio-group.d.ts +2 -2
  63. package/ui/radio-group.jsx +9 -11
  64. package/ui/resizable.d.ts +5 -20
  65. package/ui/resizable.jsx +15 -8
  66. package/ui/scroll-area.d.ts +2 -2
  67. package/ui/scroll-area.jsx +16 -14
  68. package/ui/select.d.ts +13 -11
  69. package/ui/select.jsx +58 -47
  70. package/ui/separator.d.ts +1 -1
  71. package/ui/separator.jsx +3 -2
  72. package/ui/sheet.d.ts +11 -23
  73. package/ui/sheet.jsx +45 -41
  74. package/ui/sidebar.d.ts +38 -34
  75. package/ui/sidebar.jsx +109 -122
  76. package/ui/skeleton.d.ts +1 -1
  77. package/ui/skeleton.jsx +1 -1
  78. package/ui/slider.d.ts +1 -1
  79. package/ui/slider.jsx +13 -7
  80. package/ui/sonner.d.ts +1 -2
  81. package/ui/sonner.jsx +4 -7
  82. package/ui/switch.d.ts +2 -2
  83. package/ui/switch.jsx +6 -5
  84. package/ui/table.d.ts +8 -8
  85. package/ui/table.jsx +27 -18
  86. package/ui/tabs.d.ts +4 -4
  87. package/ui/tabs.jsx +12 -7
  88. package/ui/textarea.d.ts +1 -1
  89. package/ui/textarea.jsx +3 -4
  90. package/ui/toggle-group.d.ts +3 -8
  91. package/ui/toggle-group.jsx +11 -11
  92. package/ui/toggle.d.ts +1 -4
  93. package/ui/toggle.jsx +8 -7
  94. package/ui/tooltip.d.ts +4 -4
  95. package/ui/tooltip.jsx +19 -5
  96. package/tailwind.config.js +0 -89
  97. /package/hooks/{use-mobile.jsx → use-mobile.js} +0 -0
@@ -1,52 +1,70 @@
1
1
  "use client";
2
2
  import * as React from "react";
3
3
  import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
4
- import { Check, ChevronRight, Circle } from "lucide-react";
4
+ import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
5
5
  import { cn } from "../lib/utils";
6
- const ContextMenu = ContextMenuPrimitive.Root;
7
- const ContextMenuTrigger = ContextMenuPrimitive.Trigger;
8
- const ContextMenuGroup = ContextMenuPrimitive.Group;
9
- const ContextMenuPortal = ContextMenuPrimitive.Portal;
10
- const ContextMenuSub = ContextMenuPrimitive.Sub;
11
- const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
12
- const ContextMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (<ContextMenuPrimitive.SubTrigger ref={ref} className={cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground", inset && "pl-8", className)} {...props}>
13
- {children}
14
- <ChevronRight className="ml-auto h-4 w-4"/>
15
- </ContextMenuPrimitive.SubTrigger>));
16
- ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
17
- const ContextMenuSubContent = React.forwardRef(({ className, ...props }, ref) => (<ContextMenuPrimitive.SubContent ref={ref} className={cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 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-context-menu-content-transform-origin]", className)} {...props}/>));
18
- ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
19
- const ContextMenuContent = React.forwardRef(({ className, ...props }, ref) => (<ContextMenuPrimitive.Portal>
20
- <ContextMenuPrimitive.Content ref={ref} className={cn("z-50 max-h-[--radix-context-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 animate-in fade-in-80 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-context-menu-content-transform-origin]", className)} {...props}/>
21
- </ContextMenuPrimitive.Portal>));
22
- ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
23
- const ContextMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => (<ContextMenuPrimitive.Item ref={ref} className={cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", inset && "pl-8", className)} {...props}/>));
24
- ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
25
- const ContextMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (<ContextMenuPrimitive.CheckboxItem ref={ref} className={cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className)} checked={checked} {...props}>
26
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
27
- <ContextMenuPrimitive.ItemIndicator>
28
- <Check className="h-4 w-4"/>
29
- </ContextMenuPrimitive.ItemIndicator>
30
- </span>
31
- {children}
32
- </ContextMenuPrimitive.CheckboxItem>));
33
- ContextMenuCheckboxItem.displayName =
34
- ContextMenuPrimitive.CheckboxItem.displayName;
35
- const ContextMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => (<ContextMenuPrimitive.RadioItem ref={ref} className={cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className)} {...props}>
36
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
37
- <ContextMenuPrimitive.ItemIndicator>
38
- <Circle className="h-2 w-2 fill-current"/>
39
- </ContextMenuPrimitive.ItemIndicator>
40
- </span>
41
- {children}
42
- </ContextMenuPrimitive.RadioItem>));
43
- ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
44
- const ContextMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => (<ContextMenuPrimitive.Label ref={ref} className={cn("px-2 py-1.5 text-sm font-semibold text-foreground", inset && "pl-8", className)} {...props}/>));
45
- ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
46
- const ContextMenuSeparator = React.forwardRef(({ className, ...props }, ref) => (<ContextMenuPrimitive.Separator ref={ref} className={cn("-mx-1 my-1 h-px bg-border", className)} {...props}/>));
47
- ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
48
- const ContextMenuShortcut = ({ className, ...props }) => {
49
- return (<span className={cn("ml-auto text-xs tracking-widest text-muted-foreground", className)} {...props}/>);
50
- };
51
- ContextMenuShortcut.displayName = "ContextMenuShortcut";
6
+ function ContextMenu({ ...props }) {
7
+ return <ContextMenuPrimitive.Root data-slot="context-menu" {...props}/>;
8
+ }
9
+ function ContextMenuTrigger({ ...props }) {
10
+ return (<ContextMenuPrimitive.Trigger data-slot="context-menu-trigger" {...props}/>);
11
+ }
12
+ function ContextMenuGroup({ ...props }) {
13
+ return (<ContextMenuPrimitive.Group data-slot="context-menu-group" {...props}/>);
14
+ }
15
+ function ContextMenuPortal({ ...props }) {
16
+ return (<ContextMenuPrimitive.Portal data-slot="context-menu-portal" {...props}/>);
17
+ }
18
+ function ContextMenuSub({ ...props }) {
19
+ return <ContextMenuPrimitive.Sub data-slot="context-menu-sub" {...props}/>;
20
+ }
21
+ function ContextMenuRadioGroup({ ...props }) {
22
+ return (<ContextMenuPrimitive.RadioGroup data-slot="context-menu-radio-group" {...props}/>);
23
+ }
24
+ function ContextMenuSubTrigger({ className, inset, children, ...props }) {
25
+ return (<ContextMenuPrimitive.SubTrigger data-slot="context-menu-sub-trigger" data-inset={inset} className={cn("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-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className)} {...props}>
26
+ {children}
27
+ <ChevronRightIcon className="ml-auto"/>
28
+ </ContextMenuPrimitive.SubTrigger>);
29
+ }
30
+ function ContextMenuSubContent({ className, ...props }) {
31
+ return (<ContextMenuPrimitive.SubContent data-slot="context-menu-sub-content" className={cn("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-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg", className)} {...props}/>);
32
+ }
33
+ function ContextMenuContent({ className, ...props }) {
34
+ return (<ContextMenuPrimitive.Portal>
35
+ <ContextMenuPrimitive.Content data-slot="context-menu-content" className={cn("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-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md", className)} {...props}/>
36
+ </ContextMenuPrimitive.Portal>);
37
+ }
38
+ function ContextMenuItem({ className, inset, variant = "default", ...props }) {
39
+ return (<ContextMenuPrimitive.Item data-slot="context-menu-item" data-inset={inset} data-variant={variant} className={cn("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", className)} {...props}/>);
40
+ }
41
+ function ContextMenuCheckboxItem({ className, children, checked, ...props }) {
42
+ return (<ContextMenuPrimitive.CheckboxItem data-slot="context-menu-checkbox-item" className={cn("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", className)} checked={checked} {...props}>
43
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
44
+ <ContextMenuPrimitive.ItemIndicator>
45
+ <CheckIcon className="size-4"/>
46
+ </ContextMenuPrimitive.ItemIndicator>
47
+ </span>
48
+ {children}
49
+ </ContextMenuPrimitive.CheckboxItem>);
50
+ }
51
+ function ContextMenuRadioItem({ className, children, ...props }) {
52
+ return (<ContextMenuPrimitive.RadioItem data-slot="context-menu-radio-item" className={cn("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", className)} {...props}>
53
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
54
+ <ContextMenuPrimitive.ItemIndicator>
55
+ <CircleIcon className="size-2 fill-current"/>
56
+ </ContextMenuPrimitive.ItemIndicator>
57
+ </span>
58
+ {children}
59
+ </ContextMenuPrimitive.RadioItem>);
60
+ }
61
+ function ContextMenuLabel({ className, inset, ...props }) {
62
+ return (<ContextMenuPrimitive.Label data-slot="context-menu-label" data-inset={inset} className={cn("text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className)} {...props}/>);
63
+ }
64
+ function ContextMenuSeparator({ className, ...props }) {
65
+ return (<ContextMenuPrimitive.Separator data-slot="context-menu-separator" className={cn("bg-border -mx-1 my-1 h-px", className)} {...props}/>);
66
+ }
67
+ function ContextMenuShortcut({ className, ...props }) {
68
+ return (<span data-slot="context-menu-shortcut" className={cn("text-muted-foreground ml-auto text-xs tracking-widest", className)} {...props}/>);
69
+ }
52
70
  export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, };
package/ui/dialog.d.ts CHANGED
@@ -1,19 +1,15 @@
1
1
  import * as React from "react";
2
2
  import * as DialogPrimitive from "@radix-ui/react-dialog";
3
- declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
4
- declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
- declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
6
- declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
7
- declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
- declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
- declare const DialogHeader: {
10
- ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
11
- displayName: string;
12
- };
13
- declare const DialogFooter: {
14
- ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
15
- displayName: string;
16
- };
17
- declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
18
- declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
19
- export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
3
+ declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element;
4
+ declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element;
5
+ declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
6
+ declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): React.JSX.Element;
7
+ declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.JSX.Element;
8
+ declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
9
+ showCloseButton?: boolean;
10
+ }): React.JSX.Element;
11
+ declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
12
+ declare function DialogFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
13
+ declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element;
14
+ declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): React.JSX.Element;
15
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
package/ui/dialog.jsx CHANGED
@@ -1,31 +1,45 @@
1
1
  "use client";
2
2
  import * as React from "react";
3
3
  import * as DialogPrimitive from "@radix-ui/react-dialog";
4
- import { X } from "lucide-react";
4
+ import { XIcon } from "lucide-react";
5
5
  import { cn } from "../lib/utils";
6
- const Dialog = DialogPrimitive.Root;
7
- const DialogTrigger = DialogPrimitive.Trigger;
8
- const DialogPortal = DialogPrimitive.Portal;
9
- const DialogClose = DialogPrimitive.Close;
10
- const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => (<DialogPrimitive.Overlay ref={ref} className={cn("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", className)} {...props}/>));
11
- DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
12
- const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => (<DialogPortal>
13
- <DialogOverlay />
14
- <DialogPrimitive.Content ref={ref} className={cn("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", className)} {...props}>
15
- {children}
16
- <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
17
- <X className="h-4 w-4"/>
18
- <span className="sr-only">Close</span>
19
- </DialogPrimitive.Close>
20
- </DialogPrimitive.Content>
21
- </DialogPortal>));
22
- DialogContent.displayName = DialogPrimitive.Content.displayName;
23
- const DialogHeader = ({ className, ...props }) => (<div className={cn("flex flex-col space-y-1.5 text-center sm:text-left", className)} {...props}/>);
24
- DialogHeader.displayName = "DialogHeader";
25
- const DialogFooter = ({ className, ...props }) => (<div className={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)} {...props}/>);
26
- DialogFooter.displayName = "DialogFooter";
27
- const DialogTitle = React.forwardRef(({ className, ...props }, ref) => (<DialogPrimitive.Title ref={ref} className={cn("text-lg font-semibold leading-none tracking-tight", className)} {...props}/>));
28
- DialogTitle.displayName = DialogPrimitive.Title.displayName;
29
- const DialogDescription = React.forwardRef(({ className, ...props }, ref) => (<DialogPrimitive.Description ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props}/>));
30
- DialogDescription.displayName = DialogPrimitive.Description.displayName;
31
- export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
6
+ function Dialog({ ...props }) {
7
+ return <DialogPrimitive.Root data-slot="dialog" {...props}/>;
8
+ }
9
+ function DialogTrigger({ ...props }) {
10
+ return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props}/>;
11
+ }
12
+ function DialogPortal({ ...props }) {
13
+ return <DialogPrimitive.Portal data-slot="dialog-portal" {...props}/>;
14
+ }
15
+ function DialogClose({ ...props }) {
16
+ return <DialogPrimitive.Close data-slot="dialog-close" {...props}/>;
17
+ }
18
+ function DialogOverlay({ className, ...props }) {
19
+ return (<DialogPrimitive.Overlay data-slot="dialog-overlay" className={cn("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", className)} {...props}/>);
20
+ }
21
+ function DialogContent({ className, children, showCloseButton = true, ...props }) {
22
+ return (<DialogPortal data-slot="dialog-portal">
23
+ <DialogOverlay />
24
+ <DialogPrimitive.Content data-slot="dialog-content" className={cn("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg", className)} {...props}>
25
+ {children}
26
+ {showCloseButton && (<DialogPrimitive.Close data-slot="dialog-close" className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4">
27
+ <XIcon />
28
+ <span className="sr-only">Close</span>
29
+ </DialogPrimitive.Close>)}
30
+ </DialogPrimitive.Content>
31
+ </DialogPortal>);
32
+ }
33
+ function DialogHeader({ className, ...props }) {
34
+ return (<div data-slot="dialog-header" className={cn("flex flex-col gap-2 text-center sm:text-left", className)} {...props}/>);
35
+ }
36
+ function DialogFooter({ className, ...props }) {
37
+ return (<div data-slot="dialog-footer" className={cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className)} {...props}/>);
38
+ }
39
+ function DialogTitle({ className, ...props }) {
40
+ return (<DialogPrimitive.Title data-slot="dialog-title" className={cn("text-lg leading-none font-semibold", className)} {...props}/>);
41
+ }
42
+ function DialogDescription({ className, ...props }) {
43
+ return (<DialogPrimitive.Description data-slot="dialog-description" className={cn("text-muted-foreground text-sm", className)} {...props}/>);
44
+ }
45
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
package/ui/drawer.d.ts CHANGED
@@ -1,22 +1,13 @@
1
1
  import * as React from "react";
2
2
  import { Drawer as DrawerPrimitive } from "vaul";
3
- declare const Drawer: {
4
- ({ shouldScaleBackground, ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>): React.JSX.Element;
5
- displayName: string;
6
- };
7
- declare const DrawerTrigger: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
8
- declare const DrawerPortal: typeof import("vaul").Portal;
9
- declare const DrawerClose: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
10
- declare const DrawerOverlay: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dialog").DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
11
- declare const DrawerContent: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dialog").DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
- declare const DrawerHeader: {
13
- ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
14
- displayName: string;
15
- };
16
- declare const DrawerFooter: {
17
- ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
18
- displayName: string;
19
- };
20
- declare const DrawerTitle: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
21
- declare const DrawerDescription: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
3
+ declare function Drawer({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>): React.JSX.Element;
4
+ declare function DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>): React.JSX.Element;
5
+ declare function DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>): React.JSX.Element;
6
+ declare function DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>): React.JSX.Element;
7
+ declare function DrawerOverlay({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Overlay>): React.JSX.Element;
8
+ declare function DrawerContent({ className, children, ...props }: React.ComponentProps<typeof DrawerPrimitive.Content>): React.JSX.Element;
9
+ declare function DrawerHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
10
+ declare function DrawerFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
11
+ declare function DrawerTitle({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Title>): React.JSX.Element;
12
+ declare function DrawerDescription({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Description>): React.JSX.Element;
22
13
  export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
package/ui/drawer.jsx CHANGED
@@ -2,27 +2,40 @@
2
2
  import * as React from "react";
3
3
  import { Drawer as DrawerPrimitive } from "vaul";
4
4
  import { cn } from "../lib/utils";
5
- const Drawer = ({ shouldScaleBackground = true, ...props }) => (<DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props}/>);
6
- Drawer.displayName = "Drawer";
7
- const DrawerTrigger = DrawerPrimitive.Trigger;
8
- const DrawerPortal = DrawerPrimitive.Portal;
9
- const DrawerClose = DrawerPrimitive.Close;
10
- const DrawerOverlay = React.forwardRef(({ className, ...props }, ref) => (<DrawerPrimitive.Overlay ref={ref} className={cn("fixed inset-0 z-50 bg-black/80", className)} {...props}/>));
11
- DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
12
- const DrawerContent = React.forwardRef(({ className, children, ...props }, ref) => (<DrawerPortal>
13
- <DrawerOverlay />
14
- <DrawerPrimitive.Content ref={ref} className={cn("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background", className)} {...props}>
15
- <div className="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"/>
16
- {children}
17
- </DrawerPrimitive.Content>
18
- </DrawerPortal>));
19
- DrawerContent.displayName = "DrawerContent";
20
- const DrawerHeader = ({ className, ...props }) => (<div className={cn("grid gap-1.5 p-4 text-center sm:text-left", className)} {...props}/>);
21
- DrawerHeader.displayName = "DrawerHeader";
22
- const DrawerFooter = ({ className, ...props }) => (<div className={cn("mt-auto flex flex-col gap-2 p-4", className)} {...props}/>);
23
- DrawerFooter.displayName = "DrawerFooter";
24
- const DrawerTitle = React.forwardRef(({ className, ...props }, ref) => (<DrawerPrimitive.Title ref={ref} className={cn("text-lg font-semibold leading-none tracking-tight", className)} {...props}/>));
25
- DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
26
- const DrawerDescription = React.forwardRef(({ className, ...props }, ref) => (<DrawerPrimitive.Description ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props}/>));
27
- DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
5
+ function Drawer({ ...props }) {
6
+ return <DrawerPrimitive.Root data-slot="drawer" {...props}/>;
7
+ }
8
+ function DrawerTrigger({ ...props }) {
9
+ return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props}/>;
10
+ }
11
+ function DrawerPortal({ ...props }) {
12
+ return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props}/>;
13
+ }
14
+ function DrawerClose({ ...props }) {
15
+ return <DrawerPrimitive.Close data-slot="drawer-close" {...props}/>;
16
+ }
17
+ function DrawerOverlay({ className, ...props }) {
18
+ return (<DrawerPrimitive.Overlay data-slot="drawer-overlay" className={cn("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", className)} {...props}/>);
19
+ }
20
+ function DrawerContent({ className, children, ...props }) {
21
+ return (<DrawerPortal data-slot="drawer-portal">
22
+ <DrawerOverlay />
23
+ <DrawerPrimitive.Content data-slot="drawer-content" className={cn("group/drawer-content bg-background fixed z-50 flex h-auto flex-col", "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", "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", "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", "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", className)} {...props}>
24
+ <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"/>
25
+ {children}
26
+ </DrawerPrimitive.Content>
27
+ </DrawerPortal>);
28
+ }
29
+ function DrawerHeader({ className, ...props }) {
30
+ return (<div data-slot="drawer-header" className={cn("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left", className)} {...props}/>);
31
+ }
32
+ function DrawerFooter({ className, ...props }) {
33
+ return (<div data-slot="drawer-footer" className={cn("mt-auto flex flex-col gap-2 p-4", className)} {...props}/>);
34
+ }
35
+ function DrawerTitle({ className, ...props }) {
36
+ return (<DrawerPrimitive.Title data-slot="drawer-title" className={cn("text-foreground font-semibold", className)} {...props}/>);
37
+ }
38
+ function DrawerDescription({ className, ...props }) {
39
+ return (<DrawerPrimitive.Description data-slot="drawer-description" className={cn("text-muted-foreground text-sm", className)} {...props}/>);
40
+ }
28
41
  export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
@@ -1,27 +1,25 @@
1
1
  import * as React from "react";
2
2
  import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
3
- declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
4
- declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
- declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
6
- declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
7
- declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
8
- declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
9
- declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
3
+ declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): React.JSX.Element;
4
+ declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): React.JSX.Element;
5
+ declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): React.JSX.Element;
6
+ declare function DropdownMenuContent({ className, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): React.JSX.Element;
7
+ declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): React.JSX.Element;
8
+ declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
10
9
  inset?: boolean;
11
- } & React.RefAttributes<HTMLDivElement>>;
12
- declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
- declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
14
- declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
10
+ variant?: "default" | "destructive";
11
+ }): React.JSX.Element;
12
+ declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): React.JSX.Element;
13
+ declare function DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): React.JSX.Element;
14
+ declare function DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): React.JSX.Element;
15
+ declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
15
16
  inset?: boolean;
16
- } & React.RefAttributes<HTMLDivElement>>;
17
- declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
18
- declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
19
- declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
17
+ }): React.JSX.Element;
18
+ declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): React.JSX.Element;
19
+ declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
20
+ declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): React.JSX.Element;
21
+ declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
20
22
  inset?: boolean;
21
- } & React.RefAttributes<HTMLDivElement>>;
22
- declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
23
- declare const DropdownMenuShortcut: {
24
- ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;
25
- displayName: string;
26
- };
27
- export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
23
+ }): React.JSX.Element;
24
+ declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): React.JSX.Element;
25
+ export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
@@ -1,54 +1,70 @@
1
1
  "use client";
2
2
  import * as React from "react";
3
3
  import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
4
- import { Check, ChevronRight, Circle } from "lucide-react";
4
+ import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
5
5
  import { cn } from "../lib/utils";
6
- const DropdownMenu = DropdownMenuPrimitive.Root;
7
- const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
8
- const DropdownMenuGroup = DropdownMenuPrimitive.Group;
9
- const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
10
- const DropdownMenuSub = DropdownMenuPrimitive.Sub;
11
- const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
12
- const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (<DropdownMenuPrimitive.SubTrigger ref={ref} className={cn("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", inset && "pl-8", className)} {...props}>
13
- {children}
14
- <ChevronRight className="ml-auto"/>
15
- </DropdownMenuPrimitive.SubTrigger>));
16
- DropdownMenuSubTrigger.displayName =
17
- DropdownMenuPrimitive.SubTrigger.displayName;
18
- const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => (<DropdownMenuPrimitive.SubContent ref={ref} className={cn("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]", className)} {...props}/>));
19
- DropdownMenuSubContent.displayName =
20
- DropdownMenuPrimitive.SubContent.displayName;
21
- const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => (<DropdownMenuPrimitive.Portal>
22
- <DropdownMenuPrimitive.Content ref={ref} sideOffset={sideOffset} className={cn("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 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]", className)} {...props}/>
23
- </DropdownMenuPrimitive.Portal>));
24
- DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
25
- const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => (<DropdownMenuPrimitive.Item ref={ref} className={cn("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", inset && "pl-8", className)} {...props}/>));
26
- DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
27
- const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (<DropdownMenuPrimitive.CheckboxItem ref={ref} className={cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className)} checked={checked} {...props}>
28
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
29
- <DropdownMenuPrimitive.ItemIndicator>
30
- <Check className="h-4 w-4"/>
31
- </DropdownMenuPrimitive.ItemIndicator>
32
- </span>
33
- {children}
34
- </DropdownMenuPrimitive.CheckboxItem>));
35
- DropdownMenuCheckboxItem.displayName =
36
- DropdownMenuPrimitive.CheckboxItem.displayName;
37
- const DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => (<DropdownMenuPrimitive.RadioItem ref={ref} className={cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className)} {...props}>
38
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
39
- <DropdownMenuPrimitive.ItemIndicator>
40
- <Circle className="h-2 w-2 fill-current"/>
41
- </DropdownMenuPrimitive.ItemIndicator>
42
- </span>
43
- {children}
44
- </DropdownMenuPrimitive.RadioItem>));
45
- DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
46
- const DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => (<DropdownMenuPrimitive.Label ref={ref} className={cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className)} {...props}/>));
47
- DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
48
- const DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => (<DropdownMenuPrimitive.Separator ref={ref} className={cn("-mx-1 my-1 h-px bg-muted", className)} {...props}/>));
49
- DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
50
- const DropdownMenuShortcut = ({ className, ...props }) => {
51
- return (<span className={cn("ml-auto text-xs tracking-widest opacity-60", className)} {...props}/>);
52
- };
53
- DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
54
- export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
6
+ function DropdownMenu({ ...props }) {
7
+ return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props}/>;
8
+ }
9
+ function DropdownMenuPortal({ ...props }) {
10
+ return (<DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props}/>);
11
+ }
12
+ function DropdownMenuTrigger({ ...props }) {
13
+ return (<DropdownMenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props}/>);
14
+ }
15
+ function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
16
+ return (<DropdownMenuPrimitive.Portal>
17
+ <DropdownMenuPrimitive.Content data-slot="dropdown-menu-content" sideOffset={sideOffset} className={cn("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-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md", className)} {...props}/>
18
+ </DropdownMenuPrimitive.Portal>);
19
+ }
20
+ function DropdownMenuGroup({ ...props }) {
21
+ return (<DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props}/>);
22
+ }
23
+ function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
24
+ return (<DropdownMenuPrimitive.Item data-slot="dropdown-menu-item" data-inset={inset} data-variant={variant} className={cn("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", className)} {...props}/>);
25
+ }
26
+ function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
27
+ return (<DropdownMenuPrimitive.CheckboxItem data-slot="dropdown-menu-checkbox-item" className={cn("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", className)} checked={checked} {...props}>
28
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
29
+ <DropdownMenuPrimitive.ItemIndicator>
30
+ <CheckIcon className="size-4"/>
31
+ </DropdownMenuPrimitive.ItemIndicator>
32
+ </span>
33
+ {children}
34
+ </DropdownMenuPrimitive.CheckboxItem>);
35
+ }
36
+ function DropdownMenuRadioGroup({ ...props }) {
37
+ return (<DropdownMenuPrimitive.RadioGroup data-slot="dropdown-menu-radio-group" {...props}/>);
38
+ }
39
+ function DropdownMenuRadioItem({ className, children, ...props }) {
40
+ return (<DropdownMenuPrimitive.RadioItem data-slot="dropdown-menu-radio-item" className={cn("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", className)} {...props}>
41
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
42
+ <DropdownMenuPrimitive.ItemIndicator>
43
+ <CircleIcon className="size-2 fill-current"/>
44
+ </DropdownMenuPrimitive.ItemIndicator>
45
+ </span>
46
+ {children}
47
+ </DropdownMenuPrimitive.RadioItem>);
48
+ }
49
+ function DropdownMenuLabel({ className, inset, ...props }) {
50
+ return (<DropdownMenuPrimitive.Label data-slot="dropdown-menu-label" data-inset={inset} className={cn("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className)} {...props}/>);
51
+ }
52
+ function DropdownMenuSeparator({ className, ...props }) {
53
+ return (<DropdownMenuPrimitive.Separator data-slot="dropdown-menu-separator" className={cn("bg-border -mx-1 my-1 h-px", className)} {...props}/>);
54
+ }
55
+ function DropdownMenuShortcut({ className, ...props }) {
56
+ return (<span data-slot="dropdown-menu-shortcut" className={cn("text-muted-foreground ml-auto text-xs tracking-widest", className)} {...props}/>);
57
+ }
58
+ function DropdownMenuSub({ ...props }) {
59
+ return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props}/>;
60
+ }
61
+ function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
62
+ return (<DropdownMenuPrimitive.SubTrigger data-slot="dropdown-menu-sub-trigger" data-inset={inset} className={cn("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-hidden select-none data-[inset]:pl-8", className)} {...props}>
63
+ {children}
64
+ <ChevronRightIcon className="ml-auto size-4"/>
65
+ </DropdownMenuPrimitive.SubTrigger>);
66
+ }
67
+ function DropdownMenuSubContent({ className, ...props }) {
68
+ return (<DropdownMenuPrimitive.SubContent data-slot="dropdown-menu-sub-content" className={cn("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-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg", className)} {...props}/>);
69
+ }
70
+ export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
package/ui/form.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as React from "react";
2
2
  import * as LabelPrimitive from "@radix-ui/react-label";
3
+ import { Slot } from "@radix-ui/react-slot";
3
4
  import { type ControllerProps, type FieldPath, type FieldValues } from "react-hook-form";
4
5
  declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
5
6
  declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => React.JSX.Element;
@@ -15,9 +16,9 @@ declare const useFormField: () => {
15
16
  formDescriptionId: string;
16
17
  formMessageId: string;
17
18
  };
18
- declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
19
- declare const FormLabel: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
20
- declare const FormControl: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-slot").SlotProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
21
- declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
22
- declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
19
+ declare function FormItem({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
20
+ declare function FormLabel({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): React.JSX.Element;
21
+ declare function FormControl({ ...props }: React.ComponentProps<typeof Slot>): React.JSX.Element;
22
+ declare function FormDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
23
+ declare function FormMessage({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
23
24
  export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };