shadcn-packaged 2025.8.25 → 2025.9.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 (93) hide show
  1. package/index.css +20 -0
  2. package/package.json +3 -3
  3. package/ui/accordion.d.ts +4 -4
  4. package/ui/accordion.jsx +15 -20
  5. package/ui/alert-dialog.d.ts +17 -11
  6. package/ui/alert-dialog.jsx +23 -36
  7. package/ui/alert.d.ts +4 -5
  8. package/ui/alert.jsx +9 -12
  9. package/ui/aspect-ratio.d.ts +1 -1
  10. package/ui/aspect-ratio.jsx +1 -3
  11. package/ui/avatar.d.ts +3 -3
  12. package/ui/avatar.jsx +6 -9
  13. package/ui/badge.d.ts +3 -3
  14. package/ui/badge.jsx +7 -9
  15. package/ui/breadcrumb.d.ts +16 -8
  16. package/ui/breadcrumb.jsx +21 -26
  17. package/ui/button.d.ts +3 -2
  18. package/ui/button.jsx +14 -13
  19. package/ui/calendar.jsx +20 -20
  20. package/ui/card.d.ts +7 -8
  21. package/ui/card.jsx +13 -22
  22. package/ui/carousel.d.ts +5 -6
  23. package/ui/carousel.jsx +34 -26
  24. package/ui/chart.d.ts +28 -6
  25. package/ui/chart.jsx +40 -37
  26. package/ui/checkbox.d.ts +1 -1
  27. package/ui/checkbox.jsx +7 -8
  28. package/ui/collapsible.d.ts +3 -3
  29. package/ui/collapsible.jsx +3 -9
  30. package/ui/command.d.ts +78 -16
  31. package/ui/command.jsx +27 -37
  32. package/ui/context-menu.d.ts +21 -19
  33. package/ui/context-menu.jsx +47 -65
  34. package/ui/dialog.d.ts +17 -13
  35. package/ui/dialog.jsx +27 -41
  36. package/ui/drawer.d.ts +19 -10
  37. package/ui/drawer.jsx +23 -36
  38. package/ui/dropdown-menu.d.ts +22 -20
  39. package/ui/dropdown-menu.jsx +50 -66
  40. package/ui/form.d.ts +5 -6
  41. package/ui/form.jsx +23 -19
  42. package/ui/hover-card.d.ts +3 -3
  43. package/ui/hover-card.jsx +4 -11
  44. package/ui/input-otp.d.ts +30 -7
  45. package/ui/input-otp.jsx +15 -17
  46. package/ui/input.d.ts +1 -1
  47. package/ui/input.jsx +4 -3
  48. package/ui/label.d.ts +2 -1
  49. package/ui/label.jsx +4 -3
  50. package/ui/menubar.d.ts +19 -17
  51. package/ui/menubar.jsx +49 -58
  52. package/ui/navigation-menu.d.ts +9 -11
  53. package/ui/navigation-menu.jsx +29 -37
  54. package/ui/pagination.d.ts +25 -10
  55. package/ui/pagination.jsx +28 -35
  56. package/ui/popover.d.ts +4 -5
  57. package/ui/popover.jsx +7 -15
  58. package/ui/progress.d.ts +1 -1
  59. package/ui/progress.jsx +4 -5
  60. package/ui/radio-group.d.ts +2 -2
  61. package/ui/radio-group.jsx +11 -9
  62. package/ui/resizable.d.ts +20 -5
  63. package/ui/resizable.jsx +8 -15
  64. package/ui/scroll-area.d.ts +2 -2
  65. package/ui/scroll-area.jsx +14 -16
  66. package/ui/select.d.ts +11 -13
  67. package/ui/select.jsx +47 -58
  68. package/ui/separator.d.ts +1 -1
  69. package/ui/separator.jsx +2 -3
  70. package/ui/sheet.d.ts +23 -11
  71. package/ui/sheet.jsx +41 -45
  72. package/ui/sidebar.d.ts +34 -38
  73. package/ui/sidebar.jsx +122 -109
  74. package/ui/skeleton.d.ts +1 -1
  75. package/ui/skeleton.jsx +1 -1
  76. package/ui/slider.d.ts +1 -1
  77. package/ui/slider.jsx +7 -13
  78. package/ui/sonner.d.ts +2 -1
  79. package/ui/sonner.jsx +7 -4
  80. package/ui/switch.d.ts +2 -2
  81. package/ui/switch.jsx +5 -6
  82. package/ui/table.d.ts +8 -8
  83. package/ui/table.jsx +18 -27
  84. package/ui/tabs.d.ts +4 -4
  85. package/ui/tabs.jsx +7 -12
  86. package/ui/textarea.d.ts +1 -1
  87. package/ui/textarea.jsx +4 -3
  88. package/ui/toggle-group.d.ts +8 -3
  89. package/ui/toggle-group.jsx +11 -11
  90. package/ui/toggle.d.ts +4 -1
  91. package/ui/toggle.jsx +7 -8
  92. package/ui/tooltip.d.ts +4 -4
  93. package/ui/tooltip.jsx +5 -19
package/ui/command.jsx CHANGED
@@ -1,47 +1,37 @@
1
1
  "use client";
2
2
  import * as React from "react";
3
3
  import { Command as CommandPrimitive } from "cmdk";
4
- import { SearchIcon } from "lucide-react";
4
+ import { Search } from "lucide-react";
5
5
  import { cn } from "../lib/utils";
6
- import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from "../ui/dialog";
7
- function Command({ className, ...props }) {
8
- return (<CommandPrimitive data-slot="command" className={cn("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md", className)} {...props}/>);
9
- }
10
- function CommandDialog({ title = "Command Palette", description = "Search for a command to run...", children, className, showCloseButton = true, ...props }) {
6
+ import { Dialog, DialogContent } from "../ui/dialog";
7
+ const Command = React.forwardRef(({ className, ...props }, ref) => (<CommandPrimitive ref={ref} className={cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground", className)} {...props}/>));
8
+ Command.displayName = CommandPrimitive.displayName;
9
+ const CommandDialog = ({ children, ...props }) => {
11
10
  return (<Dialog {...props}>
12
- <DialogHeader className="sr-only">
13
- <DialogTitle>{title}</DialogTitle>
14
- <DialogDescription>{description}</DialogDescription>
15
- </DialogHeader>
16
- <DialogContent className={cn("overflow-hidden p-0", className)} showCloseButton={showCloseButton}>
17
- <Command className="[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[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">
11
+ <DialogContent className="overflow-hidden p-0 shadow-lg">
12
+ <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">
18
13
  {children}
19
14
  </Command>
20
15
  </DialogContent>
21
16
  </Dialog>);
22
- }
23
- function CommandInput({ className, ...props }) {
24
- return (<div data-slot="command-input-wrapper" className="flex h-9 items-center gap-2 border-b px-3">
25
- <SearchIcon className="size-4 shrink-0 opacity-50"/>
26
- <CommandPrimitive.Input data-slot="command-input" className={cn("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50", className)} {...props}/>
27
- </div>);
28
- }
29
- function CommandList({ className, ...props }) {
30
- return (<CommandPrimitive.List data-slot="command-list" className={cn("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto", className)} {...props}/>);
31
- }
32
- function CommandEmpty({ ...props }) {
33
- return (<CommandPrimitive.Empty data-slot="command-empty" className="py-6 text-center text-sm" {...props}/>);
34
- }
35
- function CommandGroup({ className, ...props }) {
36
- return (<CommandPrimitive.Group data-slot="command-group" className={cn("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium", className)} {...props}/>);
37
- }
38
- function CommandSeparator({ className, ...props }) {
39
- return (<CommandPrimitive.Separator data-slot="command-separator" className={cn("bg-border -mx-1 h-px", className)} {...props}/>);
40
- }
41
- function CommandItem({ className, ...props }) {
42
- return (<CommandPrimitive.Item data-slot="command-item" className={cn("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_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=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className)} {...props}/>);
43
- }
44
- function CommandShortcut({ className, ...props }) {
45
- return (<span data-slot="command-shortcut" className={cn("text-muted-foreground ml-auto text-xs tracking-widest", className)} {...props}/>);
46
- }
17
+ };
18
+ const CommandInput = React.forwardRef(({ className, ...props }, ref) => (<div className="flex items-center border-b px-3" cmdk-input-wrapper="">
19
+ <Search className="mr-2 h-4 w-4 shrink-0 opacity-50"/>
20
+ <CommandPrimitive.Input ref={ref} className={cn("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", className)} {...props}/>
21
+ </div>));
22
+ CommandInput.displayName = CommandPrimitive.Input.displayName;
23
+ const CommandList = React.forwardRef(({ className, ...props }, ref) => (<CommandPrimitive.List ref={ref} className={cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className)} {...props}/>));
24
+ CommandList.displayName = CommandPrimitive.List.displayName;
25
+ const CommandEmpty = React.forwardRef((props, ref) => (<CommandPrimitive.Empty ref={ref} className="py-6 text-center text-sm" {...props}/>));
26
+ CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
27
+ const CommandGroup = React.forwardRef(({ className, ...props }, ref) => (<CommandPrimitive.Group ref={ref} className={cn("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground", className)} {...props}/>));
28
+ CommandGroup.displayName = CommandPrimitive.Group.displayName;
29
+ const CommandSeparator = React.forwardRef(({ className, ...props }, ref) => (<CommandPrimitive.Separator ref={ref} className={cn("-mx-1 h-px bg-border", className)} {...props}/>));
30
+ CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
31
+ const CommandItem = React.forwardRef(({ className, ...props }, ref) => (<CommandPrimitive.Item ref={ref} className={cn("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", className)} {...props}/>));
32
+ CommandItem.displayName = CommandPrimitive.Item.displayName;
33
+ const CommandShortcut = ({ className, ...props }) => {
34
+ return (<span className={cn("ml-auto text-xs tracking-widest text-muted-foreground", className)} {...props}/>);
35
+ };
36
+ CommandShortcut.displayName = "CommandShortcut";
47
37
  export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
@@ -1,25 +1,27 @@
1
1
  import * as React from "react";
2
2
  import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
3
- declare function ContextMenu({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Root>): React.JSX.Element;
4
- declare function ContextMenuTrigger({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>): React.JSX.Element;
5
- declare function ContextMenuGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Group>): React.JSX.Element;
6
- declare function ContextMenuPortal({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>): React.JSX.Element;
7
- declare function ContextMenuSub({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Sub>): React.JSX.Element;
8
- declare function ContextMenuRadioGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>): React.JSX.Element;
9
- declare function ContextMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {
3
+ declare const ContextMenu: React.FC<ContextMenuPrimitive.ContextMenuProps>;
4
+ declare const ContextMenuTrigger: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuTriggerProps & React.RefAttributes<HTMLSpanElement>>;
5
+ declare const ContextMenuGroup: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
6
+ declare const ContextMenuPortal: React.FC<ContextMenuPrimitive.ContextMenuPortalProps>;
7
+ declare const ContextMenuSub: React.FC<ContextMenuPrimitive.ContextMenuSubProps>;
8
+ declare const ContextMenuRadioGroup: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
9
+ declare const ContextMenuSubTrigger: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
10
10
  inset?: boolean;
11
- }): React.JSX.Element;
12
- declare function ContextMenuSubContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>): React.JSX.Element;
13
- declare function ContextMenuContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Content>): React.JSX.Element;
14
- declare function ContextMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {
11
+ } & React.RefAttributes<HTMLDivElement>>;
12
+ declare const ContextMenuSubContent: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
+ declare const ContextMenuContent: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
14
+ declare const ContextMenuItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
15
15
  inset?: boolean;
16
- variant?: "default" | "destructive";
17
- }): React.JSX.Element;
18
- declare function ContextMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>): React.JSX.Element;
19
- declare function ContextMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem>): React.JSX.Element;
20
- declare function ContextMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {
16
+ } & React.RefAttributes<HTMLDivElement>>;
17
+ declare const ContextMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
18
+ declare const ContextMenuRadioItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
19
+ declare const ContextMenuLabel: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
21
20
  inset?: boolean;
22
- }): React.JSX.Element;
23
- declare function ContextMenuSeparator({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Separator>): React.JSX.Element;
24
- declare function ContextMenuShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
21
+ } & React.RefAttributes<HTMLDivElement>>;
22
+ declare const ContextMenuSeparator: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
23
+ declare const ContextMenuShortcut: {
24
+ ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;
25
+ displayName: string;
26
+ };
25
27
  export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, };
@@ -1,70 +1,52 @@
1
1
  "use client";
2
2
  import * as React from "react";
3
3
  import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
4
- import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
4
+ import { Check, ChevronRight, Circle } from "lucide-react";
5
5
  import { cn } from "../lib/utils";
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
- }
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";
70
52
  export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, };
package/ui/dialog.d.ts CHANGED
@@ -1,15 +1,19 @@
1
1
  import * as React from "react";
2
2
  import * as DialogPrimitive from "@radix-ui/react-dialog";
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, };
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, };
package/ui/dialog.jsx CHANGED
@@ -1,45 +1,31 @@
1
1
  "use client";
2
2
  import * as React from "react";
3
3
  import * as DialogPrimitive from "@radix-ui/react-dialog";
4
- import { XIcon } from "lucide-react";
4
+ import { X } from "lucide-react";
5
5
  import { cn } from "../lib/utils";
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, };
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, };
package/ui/drawer.d.ts CHANGED
@@ -1,13 +1,22 @@
1
1
  import * as React from "react";
2
2
  import { Drawer as DrawerPrimitive } from "vaul";
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;
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>>;
13
22
  export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
package/ui/drawer.jsx CHANGED
@@ -2,40 +2,27 @@
2
2
  import * as React from "react";
3
3
  import { Drawer as DrawerPrimitive } from "vaul";
4
4
  import { cn } from "../lib/utils";
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
- }
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;
41
28
  export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
@@ -1,25 +1,27 @@
1
1
  import * as React from "react";
2
2
  import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
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> & {
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"> & {
9
10
  inset?: boolean;
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> & {
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"> & {
16
15
  inset?: boolean;
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> & {
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"> & {
22
20
  inset?: boolean;
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, };
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, };