shadcn-packaged 2025.8.18 → 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 +4 -4
  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/select.d.ts CHANGED
@@ -1,15 +1,13 @@
1
1
  import * as React from "react";
2
2
  import * as SelectPrimitive from "@radix-ui/react-select";
3
- declare function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): React.JSX.Element;
4
- declare function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): React.JSX.Element;
5
- declare function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): React.JSX.Element;
6
- declare function SelectTrigger({ className, size, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
7
- size?: "sm" | "default";
8
- }): React.JSX.Element;
9
- declare function SelectContent({ className, children, position, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): React.JSX.Element;
10
- declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): React.JSX.Element;
11
- declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): React.JSX.Element;
12
- declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): React.JSX.Element;
13
- declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): React.JSX.Element;
14
- declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): React.JSX.Element;
15
- export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
3
+ declare const Select: React.FC<SelectPrimitive.SelectProps>;
4
+ declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
5
+ declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
6
+ declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
7
+ declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
+ declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
+ declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
10
+ declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
11
+ declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
+ declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
+ export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, };
package/ui/select.jsx CHANGED
@@ -1,62 +1,51 @@
1
1
  "use client";
2
2
  import * as React from "react";
3
3
  import * as SelectPrimitive from "@radix-ui/react-select";
4
- import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
4
+ import { Check, ChevronDown, ChevronUp } from "lucide-react";
5
5
  import { cn } from "../lib/utils";
6
- function Select({ ...props }) {
7
- return <SelectPrimitive.Root data-slot="select" {...props}/>;
8
- }
9
- function SelectGroup({ ...props }) {
10
- return <SelectPrimitive.Group data-slot="select-group" {...props}/>;
11
- }
12
- function SelectValue({ ...props }) {
13
- return <SelectPrimitive.Value data-slot="select-value" {...props}/>;
14
- }
15
- function SelectTrigger({ className, size = "default", children, ...props }) {
16
- return (<SelectPrimitive.Trigger data-slot="select-trigger" data-size={size} className={cn("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className)} {...props}>
17
- {children}
18
- <SelectPrimitive.Icon asChild>
19
- <ChevronDownIcon className="size-4 opacity-50"/>
20
- </SelectPrimitive.Icon>
21
- </SelectPrimitive.Trigger>);
22
- }
23
- function SelectContent({ className, children, position = "popper", ...props }) {
24
- return (<SelectPrimitive.Portal>
25
- <SelectPrimitive.Content data-slot="select-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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md", position === "popper" &&
26
- "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className)} position={position} {...props}>
27
- <SelectScrollUpButton />
28
- <SelectPrimitive.Viewport className={cn("p-1", position === "popper" &&
29
- "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1")}>
30
- {children}
31
- </SelectPrimitive.Viewport>
32
- <SelectScrollDownButton />
33
- </SelectPrimitive.Content>
34
- </SelectPrimitive.Portal>);
35
- }
36
- function SelectLabel({ className, ...props }) {
37
- return (<SelectPrimitive.Label data-slot="select-label" className={cn("text-muted-foreground px-2 py-1.5 text-xs", className)} {...props}/>);
38
- }
39
- function SelectItem({ className, children, ...props }) {
40
- return (<SelectPrimitive.Item data-slot="select-item" className={cn("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 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 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className)} {...props}>
41
- <span className="absolute right-2 flex size-3.5 items-center justify-center">
42
- <SelectPrimitive.ItemIndicator>
43
- <CheckIcon className="size-4"/>
44
- </SelectPrimitive.ItemIndicator>
45
- </span>
46
- <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
47
- </SelectPrimitive.Item>);
48
- }
49
- function SelectSeparator({ className, ...props }) {
50
- return (<SelectPrimitive.Separator data-slot="select-separator" className={cn("bg-border pointer-events-none -mx-1 my-1 h-px", className)} {...props}/>);
51
- }
52
- function SelectScrollUpButton({ className, ...props }) {
53
- return (<SelectPrimitive.ScrollUpButton data-slot="select-scroll-up-button" className={cn("flex cursor-default items-center justify-center py-1", className)} {...props}>
54
- <ChevronUpIcon className="size-4"/>
55
- </SelectPrimitive.ScrollUpButton>);
56
- }
57
- function SelectScrollDownButton({ className, ...props }) {
58
- return (<SelectPrimitive.ScrollDownButton data-slot="select-scroll-down-button" className={cn("flex cursor-default items-center justify-center py-1", className)} {...props}>
59
- <ChevronDownIcon className="size-4"/>
60
- </SelectPrimitive.ScrollDownButton>);
61
- }
62
- export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
6
+ const Select = SelectPrimitive.Root;
7
+ const SelectGroup = SelectPrimitive.Group;
8
+ const SelectValue = SelectPrimitive.Value;
9
+ const SelectTrigger = React.forwardRef(({ className, children, ...props }, ref) => (<SelectPrimitive.Trigger ref={ref} className={cn("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", className)} {...props}>
10
+ {children}
11
+ <SelectPrimitive.Icon asChild>
12
+ <ChevronDown className="h-4 w-4 opacity-50"/>
13
+ </SelectPrimitive.Icon>
14
+ </SelectPrimitive.Trigger>));
15
+ SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
16
+ const SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) => (<SelectPrimitive.ScrollUpButton ref={ref} className={cn("flex cursor-default items-center justify-center py-1", className)} {...props}>
17
+ <ChevronUp className="h-4 w-4"/>
18
+ </SelectPrimitive.ScrollUpButton>));
19
+ SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
20
+ const SelectScrollDownButton = React.forwardRef(({ className, ...props }, ref) => (<SelectPrimitive.ScrollDownButton ref={ref} className={cn("flex cursor-default items-center justify-center py-1", className)} {...props}>
21
+ <ChevronDown className="h-4 w-4"/>
22
+ </SelectPrimitive.ScrollDownButton>));
23
+ SelectScrollDownButton.displayName =
24
+ SelectPrimitive.ScrollDownButton.displayName;
25
+ const SelectContent = React.forwardRef(({ className, children, position = "popper", ...props }, ref) => (<SelectPrimitive.Portal>
26
+ <SelectPrimitive.Content ref={ref} className={cn("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]", position === "popper" &&
27
+ "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className)} position={position} {...props}>
28
+ <SelectScrollUpButton />
29
+ <SelectPrimitive.Viewport className={cn("p-1", position === "popper" &&
30
+ "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]")}>
31
+ {children}
32
+ </SelectPrimitive.Viewport>
33
+ <SelectScrollDownButton />
34
+ </SelectPrimitive.Content>
35
+ </SelectPrimitive.Portal>));
36
+ SelectContent.displayName = SelectPrimitive.Content.displayName;
37
+ const SelectLabel = React.forwardRef(({ className, ...props }, ref) => (<SelectPrimitive.Label ref={ref} className={cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className)} {...props}/>));
38
+ SelectLabel.displayName = SelectPrimitive.Label.displayName;
39
+ const SelectItem = React.forwardRef(({ className, children, ...props }, ref) => (<SelectPrimitive.Item ref={ref} className={cn("relative flex w-full 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}>
40
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
41
+ <SelectPrimitive.ItemIndicator>
42
+ <Check className="h-4 w-4"/>
43
+ </SelectPrimitive.ItemIndicator>
44
+ </span>
45
+
46
+ <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
47
+ </SelectPrimitive.Item>));
48
+ SelectItem.displayName = SelectPrimitive.Item.displayName;
49
+ const SelectSeparator = React.forwardRef(({ className, ...props }, ref) => (<SelectPrimitive.Separator ref={ref} className={cn("-mx-1 my-1 h-px bg-muted", className)} {...props}/>));
50
+ SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
51
+ export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, };
package/ui/separator.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import * as React from "react";
2
2
  import * as SeparatorPrimitive from "@radix-ui/react-separator";
3
- declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>): React.JSX.Element;
3
+ declare const Separator: React.ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
4
  export { Separator };
package/ui/separator.jsx CHANGED
@@ -2,7 +2,6 @@
2
2
  import * as React from "react";
3
3
  import * as SeparatorPrimitive from "@radix-ui/react-separator";
4
4
  import { cn } from "../lib/utils";
5
- function Separator({ className, orientation = "horizontal", decorative = true, ...props }) {
6
- return (<SeparatorPrimitive.Root data-slot="separator" decorative={decorative} orientation={orientation} className={cn("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px", className)} {...props}/>);
7
- }
5
+ const Separator = React.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => (<SeparatorPrimitive.Root ref={ref} decorative={decorative} orientation={orientation} className={cn("shrink-0 bg-border", orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]", className)} {...props}/>));
6
+ Separator.displayName = SeparatorPrimitive.Root.displayName;
8
7
  export { Separator };
package/ui/sheet.d.ts CHANGED
@@ -1,13 +1,25 @@
1
1
  import * as React from "react";
2
2
  import * as SheetPrimitive from "@radix-ui/react-dialog";
3
- declare function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>): React.JSX.Element;
4
- declare function SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>): React.JSX.Element;
5
- declare function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>): React.JSX.Element;
6
- declare function SheetContent({ className, children, side, ...props }: React.ComponentProps<typeof SheetPrimitive.Content> & {
7
- side?: "top" | "right" | "bottom" | "left";
8
- }): React.JSX.Element;
9
- declare function SheetHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
10
- declare function SheetFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
11
- declare function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>): React.JSX.Element;
12
- declare function SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>): React.JSX.Element;
13
- export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
3
+ import { type VariantProps } from "class-variance-authority";
4
+ declare const Sheet: React.FC<SheetPrimitive.DialogProps>;
5
+ declare const SheetTrigger: React.ForwardRefExoticComponent<SheetPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
6
+ declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
7
+ declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
8
+ declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
+ declare const sheetVariants: (props?: {
10
+ side?: "left" | "top" | "bottom" | "right";
11
+ } & import("class-variance-authority/dist/types").ClassProp) => string;
12
+ interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
13
+ }
14
+ declare const SheetContent: React.ForwardRefExoticComponent<SheetContentProps & React.RefAttributes<HTMLDivElement>>;
15
+ declare const SheetHeader: {
16
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
17
+ displayName: string;
18
+ };
19
+ declare const SheetFooter: {
20
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
21
+ displayName: string;
22
+ };
23
+ declare const SheetTitle: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
24
+ declare const SheetDescription: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
25
+ export { Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
package/ui/sheet.jsx CHANGED
@@ -1,49 +1,45 @@
1
1
  "use client";
2
2
  import * as React from "react";
3
3
  import * as SheetPrimitive from "@radix-ui/react-dialog";
4
- import { XIcon } from "lucide-react";
4
+ import { cva } from "class-variance-authority";
5
+ import { X } from "lucide-react";
5
6
  import { cn } from "../lib/utils";
6
- function Sheet({ ...props }) {
7
- return <SheetPrimitive.Root data-slot="sheet" {...props}/>;
8
- }
9
- function SheetTrigger({ ...props }) {
10
- return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props}/>;
11
- }
12
- function SheetClose({ ...props }) {
13
- return <SheetPrimitive.Close data-slot="sheet-close" {...props}/>;
14
- }
15
- function SheetPortal({ ...props }) {
16
- return <SheetPrimitive.Portal data-slot="sheet-portal" {...props}/>;
17
- }
18
- function SheetOverlay({ className, ...props }) {
19
- return (<SheetPrimitive.Overlay data-slot="sheet-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 SheetContent({ className, children, side = "right", ...props }) {
22
- return (<SheetPortal>
23
- <SheetOverlay />
24
- <SheetPrimitive.Content data-slot="sheet-content" className={cn("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500", side === "right" &&
25
- "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm", side === "left" &&
26
- "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm", side === "top" &&
27
- "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b", side === "bottom" &&
28
- "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t", className)} {...props}>
29
- {children}
30
- <SheetPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-secondary 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">
31
- <XIcon className="size-4"/>
32
- <span className="sr-only">Close</span>
33
- </SheetPrimitive.Close>
34
- </SheetPrimitive.Content>
35
- </SheetPortal>);
36
- }
37
- function SheetHeader({ className, ...props }) {
38
- return (<div data-slot="sheet-header" className={cn("flex flex-col gap-1.5 p-4", className)} {...props}/>);
39
- }
40
- function SheetFooter({ className, ...props }) {
41
- return (<div data-slot="sheet-footer" className={cn("mt-auto flex flex-col gap-2 p-4", className)} {...props}/>);
42
- }
43
- function SheetTitle({ className, ...props }) {
44
- return (<SheetPrimitive.Title data-slot="sheet-title" className={cn("text-foreground font-semibold", className)} {...props}/>);
45
- }
46
- function SheetDescription({ className, ...props }) {
47
- return (<SheetPrimitive.Description data-slot="sheet-description" className={cn("text-muted-foreground text-sm", className)} {...props}/>);
48
- }
49
- export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
7
+ const Sheet = SheetPrimitive.Root;
8
+ const SheetTrigger = SheetPrimitive.Trigger;
9
+ const SheetClose = SheetPrimitive.Close;
10
+ const SheetPortal = SheetPrimitive.Portal;
11
+ const SheetOverlay = React.forwardRef(({ className, ...props }, ref) => (<SheetPrimitive.Overlay 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} ref={ref}/>));
12
+ SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
13
+ const sheetVariants = cva("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500", {
14
+ variants: {
15
+ side: {
16
+ top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
17
+ bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
18
+ left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
19
+ right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
20
+ },
21
+ },
22
+ defaultVariants: {
23
+ side: "right",
24
+ },
25
+ });
26
+ const SheetContent = React.forwardRef(({ side = "right", className, children, ...props }, ref) => (<SheetPortal>
27
+ <SheetOverlay />
28
+ <SheetPrimitive.Content ref={ref} className={cn(sheetVariants({ side }), className)} {...props}>
29
+ {children}
30
+ <SheetPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary">
31
+ <X className="h-4 w-4"/>
32
+ <span className="sr-only">Close</span>
33
+ </SheetPrimitive.Close>
34
+ </SheetPrimitive.Content>
35
+ </SheetPortal>));
36
+ SheetContent.displayName = SheetPrimitive.Content.displayName;
37
+ const SheetHeader = ({ className, ...props }) => (<div className={cn("flex flex-col space-y-2 text-center sm:text-left", className)} {...props}/>);
38
+ SheetHeader.displayName = "SheetHeader";
39
+ const SheetFooter = ({ className, ...props }) => (<div className={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)} {...props}/>);
40
+ SheetFooter.displayName = "SheetFooter";
41
+ const SheetTitle = React.forwardRef(({ className, ...props }, ref) => (<SheetPrimitive.Title ref={ref} className={cn("text-lg font-semibold text-foreground", className)} {...props}/>));
42
+ SheetTitle.displayName = SheetPrimitive.Title.displayName;
43
+ const SheetDescription = React.forwardRef(({ className, ...props }, ref) => (<SheetPrimitive.Description ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props}/>));
44
+ SheetDescription.displayName = SheetPrimitive.Description.displayName;
45
+ export { Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
package/ui/sidebar.d.ts CHANGED
@@ -1,8 +1,5 @@
1
1
  import * as React from "react";
2
2
  import { VariantProps } from "class-variance-authority";
3
- import { Button } from "../ui/button";
4
- import { Input } from "../ui/input";
5
- import { Separator } from "../ui/separator";
6
3
  import { TooltipContent } from "../ui/tooltip";
7
4
  type SidebarContextProps = {
8
5
  state: "expanded" | "collapsed";
@@ -14,56 +11,55 @@ type SidebarContextProps = {
14
11
  toggleSidebar: () => void;
15
12
  };
16
13
  declare function useSidebar(): SidebarContextProps;
17
- declare function SidebarProvider({ defaultOpen, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }: React.ComponentProps<"div"> & {
14
+ declare const SidebarProvider: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
18
15
  defaultOpen?: boolean;
19
16
  open?: boolean;
20
17
  onOpenChange?: (open: boolean) => void;
21
- }): React.JSX.Element;
22
- declare function Sidebar({ side, variant, collapsible, className, children, ...props }: React.ComponentProps<"div"> & {
18
+ }, "ref"> & React.RefAttributes<HTMLDivElement>>;
19
+ declare const Sidebar: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
23
20
  side?: "left" | "right";
24
21
  variant?: "sidebar" | "floating" | "inset";
25
22
  collapsible?: "offcanvas" | "icon" | "none";
26
- }): React.JSX.Element;
27
- declare function SidebarTrigger({ className, onClick, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
28
- declare function SidebarRail({ className, ...props }: React.ComponentProps<"button">): React.JSX.Element;
29
- declare function SidebarInset({ className, ...props }: React.ComponentProps<"main">): React.JSX.Element;
30
- declare function SidebarInput({ className, ...props }: React.ComponentProps<typeof Input>): React.JSX.Element;
31
- declare function SidebarHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
32
- declare function SidebarFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
33
- declare function SidebarSeparator({ className, ...props }: React.ComponentProps<typeof Separator>): React.JSX.Element;
34
- declare function SidebarContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
35
- declare function SidebarGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
36
- declare function SidebarGroupLabel({ className, asChild, ...props }: React.ComponentProps<"div"> & {
23
+ }, "ref"> & React.RefAttributes<HTMLDivElement>>;
24
+ declare const SidebarTrigger: React.ForwardRefExoticComponent<Omit<import("../ui/button").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
25
+ declare const SidebarRail: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
26
+ declare const SidebarInset: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
27
+ declare const SidebarInput: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
28
+ declare const SidebarHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
29
+ declare const SidebarFooter: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
30
+ declare const SidebarSeparator: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-separator").SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
31
+ declare const SidebarContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
32
+ declare const SidebarGroup: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
33
+ declare const SidebarGroupLabel: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
37
34
  asChild?: boolean;
38
- }): React.JSX.Element;
39
- declare function SidebarGroupAction({ className, asChild, ...props }: React.ComponentProps<"button"> & {
35
+ }, "ref"> & React.RefAttributes<HTMLDivElement>>;
36
+ declare const SidebarGroupAction: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
40
37
  asChild?: boolean;
41
- }): React.JSX.Element;
42
- declare function SidebarGroupContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
43
- declare function SidebarMenu({ className, ...props }: React.ComponentProps<"ul">): React.JSX.Element;
44
- declare function SidebarMenuItem({ className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
45
- declare const sidebarMenuButtonVariants: (props?: {
46
- variant?: "default" | "outline";
47
- size?: "default" | "sm" | "lg";
48
- } & import("class-variance-authority/dist/types").ClassProp) => string;
49
- declare function SidebarMenuButton({ asChild, isActive, variant, size, tooltip, className, ...props }: React.ComponentProps<"button"> & {
38
+ }, "ref"> & React.RefAttributes<HTMLButtonElement>>;
39
+ declare const SidebarGroupContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
40
+ declare const SidebarMenu: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
41
+ declare const SidebarMenuItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
42
+ declare const SidebarMenuButton: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
50
43
  asChild?: boolean;
51
44
  isActive?: boolean;
52
45
  tooltip?: string | React.ComponentProps<typeof TooltipContent>;
53
- } & VariantProps<typeof sidebarMenuButtonVariants>): React.JSX.Element;
54
- declare function SidebarMenuAction({ className, asChild, showOnHover, ...props }: React.ComponentProps<"button"> & {
46
+ } & VariantProps<(props?: {
47
+ variant?: "default" | "outline";
48
+ size?: "default" | "sm" | "lg";
49
+ } & import("class-variance-authority/dist/types").ClassProp) => string>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
50
+ declare const SidebarMenuAction: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
55
51
  asChild?: boolean;
56
52
  showOnHover?: boolean;
57
- }): React.JSX.Element;
58
- declare function SidebarMenuBadge({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
59
- declare function SidebarMenuSkeleton({ className, showIcon, ...props }: React.ComponentProps<"div"> & {
53
+ }, "ref"> & React.RefAttributes<HTMLButtonElement>>;
54
+ declare const SidebarMenuBadge: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
55
+ declare const SidebarMenuSkeleton: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
60
56
  showIcon?: boolean;
61
- }): React.JSX.Element;
62
- declare function SidebarMenuSub({ className, ...props }: React.ComponentProps<"ul">): React.JSX.Element;
63
- declare function SidebarMenuSubItem({ className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
64
- declare function SidebarMenuSubButton({ asChild, size, isActive, className, ...props }: React.ComponentProps<"a"> & {
57
+ }, "ref"> & React.RefAttributes<HTMLDivElement>>;
58
+ declare const SidebarMenuSub: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
59
+ declare const SidebarMenuSubItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
60
+ declare const SidebarMenuSubButton: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLAnchorElement> & React.AnchorHTMLAttributes<HTMLAnchorElement> & {
65
61
  asChild?: boolean;
66
62
  size?: "sm" | "md";
67
63
  isActive?: boolean;
68
- }): React.JSX.Element;
64
+ }, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
69
65
  export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, };