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
@@ -1,70 +1,54 @@
1
1
  "use client";
2
2
  import * as React from "react";
3
3
  import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-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 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, };
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, };
package/ui/form.d.ts CHANGED
@@ -1,6 +1,5 @@
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";
4
3
  import { type ControllerProps, type FieldPath, type FieldValues } from "react-hook-form";
5
4
  declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
6
5
  declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => React.JSX.Element;
@@ -16,9 +15,9 @@ declare const useFormField: () => {
16
15
  formDescriptionId: string;
17
16
  formMessageId: string;
18
17
  };
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;
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>>;
24
23
  export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
package/ui/form.jsx CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import * as React from "react";
3
3
  import { Slot } from "@radix-ui/react-slot";
4
- import { Controller, FormProvider, useFormContext, useFormState, } from "react-hook-form";
4
+ import { Controller, FormProvider, useFormContext, } from "react-hook-form";
5
5
  import { cn } from "../lib/utils";
6
6
  import { Label } from "../ui/label";
7
7
  const Form = FormProvider;
@@ -14,8 +14,7 @@ const FormField = ({ ...props }) => {
14
14
  const useFormField = () => {
15
15
  const fieldContext = React.useContext(FormFieldContext);
16
16
  const itemContext = React.useContext(FormItemContext);
17
- const { getFieldState } = useFormContext();
18
- const formState = useFormState({ name: fieldContext.name });
17
+ const { getFieldState, formState } = useFormContext();
19
18
  const fieldState = getFieldState(fieldContext.name, formState);
20
19
  if (!fieldContext) {
21
20
  throw new Error("useFormField should be used within <FormField>");
@@ -31,34 +30,39 @@ const useFormField = () => {
31
30
  };
32
31
  };
33
32
  const FormItemContext = React.createContext({});
34
- function FormItem({ className, ...props }) {
33
+ const FormItem = React.forwardRef(({ className, ...props }, ref) => {
35
34
  const id = React.useId();
36
35
  return (<FormItemContext.Provider value={{ id }}>
37
- <div data-slot="form-item" className={cn("grid gap-2", className)} {...props}/>
36
+ <div ref={ref} className={cn("space-y-2", className)} {...props}/>
38
37
  </FormItemContext.Provider>);
39
- }
40
- function FormLabel({ className, ...props }) {
38
+ });
39
+ FormItem.displayName = "FormItem";
40
+ const FormLabel = React.forwardRef(({ className, ...props }, ref) => {
41
41
  const { error, formItemId } = useFormField();
42
- return (<Label data-slot="form-label" data-error={!!error} className={cn("data-[error=true]:text-destructive", className)} htmlFor={formItemId} {...props}/>);
43
- }
44
- function FormControl({ ...props }) {
42
+ return (<Label ref={ref} className={cn(error && "text-destructive", className)} htmlFor={formItemId} {...props}/>);
43
+ });
44
+ FormLabel.displayName = "FormLabel";
45
+ const FormControl = React.forwardRef(({ ...props }, ref) => {
45
46
  const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
46
- return (<Slot data-slot="form-control" id={formItemId} aria-describedby={!error
47
+ return (<Slot ref={ref} id={formItemId} aria-describedby={!error
47
48
  ? `${formDescriptionId}`
48
49
  : `${formDescriptionId} ${formMessageId}`} aria-invalid={!!error} {...props}/>);
49
- }
50
- function FormDescription({ className, ...props }) {
50
+ });
51
+ FormControl.displayName = "FormControl";
52
+ const FormDescription = React.forwardRef(({ className, ...props }, ref) => {
51
53
  const { formDescriptionId } = useFormField();
52
- return (<p data-slot="form-description" id={formDescriptionId} className={cn("text-muted-foreground text-sm", className)} {...props}/>);
53
- }
54
- function FormMessage({ className, ...props }) {
54
+ return (<p ref={ref} id={formDescriptionId} className={cn("text-sm text-muted-foreground", className)} {...props}/>);
55
+ });
56
+ FormDescription.displayName = "FormDescription";
57
+ const FormMessage = React.forwardRef(({ className, children, ...props }, ref) => {
55
58
  const { error, formMessageId } = useFormField();
56
- const body = error ? String(error?.message ?? "") : props.children;
59
+ const body = error ? String(error?.message ?? "") : children;
57
60
  if (!body) {
58
61
  return null;
59
62
  }
60
- return (<p data-slot="form-message" id={formMessageId} className={cn("text-destructive text-sm", className)} {...props}>
63
+ return (<p ref={ref} id={formMessageId} className={cn("text-sm font-medium text-destructive", className)} {...props}>
61
64
  {body}
62
65
  </p>);
63
- }
66
+ });
67
+ FormMessage.displayName = "FormMessage";
64
68
  export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
3
- declare function HoverCard({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Root>): React.JSX.Element;
4
- declare function HoverCardTrigger({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Trigger>): React.JSX.Element;
5
- declare function HoverCardContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof HoverCardPrimitive.Content>): React.JSX.Element;
3
+ declare const HoverCard: React.FC<HoverCardPrimitive.HoverCardProps>;
4
+ declare const HoverCardTrigger: React.ForwardRefExoticComponent<HoverCardPrimitive.HoverCardTriggerProps & React.RefAttributes<HTMLAnchorElement>>;
5
+ declare const HoverCardContent: React.ForwardRefExoticComponent<Omit<HoverCardPrimitive.HoverCardContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
6
6
  export { HoverCard, HoverCardTrigger, HoverCardContent };
package/ui/hover-card.jsx CHANGED
@@ -2,15 +2,8 @@
2
2
  import * as React from "react";
3
3
  import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
4
4
  import { cn } from "../lib/utils";
5
- function HoverCard({ ...props }) {
6
- return <HoverCardPrimitive.Root data-slot="hover-card" {...props}/>;
7
- }
8
- function HoverCardTrigger({ ...props }) {
9
- return (<HoverCardPrimitive.Trigger data-slot="hover-card-trigger" {...props}/>);
10
- }
11
- function HoverCardContent({ className, align = "center", sideOffset = 4, ...props }) {
12
- return (<HoverCardPrimitive.Portal data-slot="hover-card-portal">
13
- <HoverCardPrimitive.Content data-slot="hover-card-content" align={align} 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 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden", className)} {...props}/>
14
- </HoverCardPrimitive.Portal>);
15
- }
5
+ const HoverCard = HoverCardPrimitive.Root;
6
+ const HoverCardTrigger = HoverCardPrimitive.Trigger;
7
+ const HoverCardContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => (<HoverCardPrimitive.Content ref={ref} align={align} sideOffset={sideOffset} className={cn("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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-hover-card-content-transform-origin]", className)} {...props}/>));
8
+ HoverCardContent.displayName = HoverCardPrimitive.Content.displayName;
16
9
  export { HoverCard, HoverCardTrigger, HoverCardContent };
package/ui/input-otp.d.ts CHANGED
@@ -1,11 +1,34 @@
1
1
  import * as React from "react";
2
- import { OTPInput } from "input-otp";
3
- declare function InputOTP({ className, containerClassName, ...props }: React.ComponentProps<typeof OTPInput> & {
2
+ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "textAlign" | "value" | "onChange" | "maxLength" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
3
+ value?: string;
4
+ onChange?: (newValue: string) => unknown;
5
+ maxLength: number;
6
+ textAlign?: "left" | "center" | "right";
7
+ onComplete?: (...args: any[]) => unknown;
8
+ pushPasswordManagerStrategy?: "increase-width" | "none";
9
+ pasteTransformer?: (pasted: string) => string;
4
10
  containerClassName?: string;
5
- }): React.JSX.Element;
6
- declare function InputOTPGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
7
- declare function InputOTPSlot({ index, className, ...props }: React.ComponentProps<"div"> & {
11
+ noScriptCSSFallback?: string | null;
12
+ } & {
13
+ render: (props: import("input-otp").RenderProps) => React.ReactNode;
14
+ children?: never;
15
+ } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "textAlign" | "value" | "onChange" | "maxLength" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
16
+ value?: string;
17
+ onChange?: (newValue: string) => unknown;
18
+ maxLength: number;
19
+ textAlign?: "left" | "center" | "right";
20
+ onComplete?: (...args: any[]) => unknown;
21
+ pushPasswordManagerStrategy?: "increase-width" | "none";
22
+ pasteTransformer?: (pasted: string) => string;
23
+ containerClassName?: string;
24
+ noScriptCSSFallback?: string | null;
25
+ } & {
26
+ render?: never;
27
+ children: React.ReactNode;
28
+ } & React.RefAttributes<HTMLInputElement>, "ref">) & React.RefAttributes<HTMLInputElement>>;
29
+ declare const InputOTPGroup: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
30
+ declare const InputOTPSlot: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
8
31
  index: number;
9
- }): React.JSX.Element;
10
- declare function InputOTPSeparator({ ...props }: React.ComponentProps<"div">): React.JSX.Element;
32
+ } & React.RefAttributes<HTMLDivElement>>;
33
+ declare const InputOTPSeparator: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
11
34
  export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };
package/ui/input-otp.jsx CHANGED
@@ -1,27 +1,25 @@
1
1
  "use client";
2
2
  import * as React from "react";
3
3
  import { OTPInput, OTPInputContext } from "input-otp";
4
- import { MinusIcon } from "lucide-react";
4
+ import { Dot } from "lucide-react";
5
5
  import { cn } from "../lib/utils";
6
- function InputOTP({ className, containerClassName, ...props }) {
7
- return (<OTPInput data-slot="input-otp" containerClassName={cn("flex items-center gap-2 has-disabled:opacity-50", containerClassName)} className={cn("disabled:cursor-not-allowed", className)} {...props}/>);
8
- }
9
- function InputOTPGroup({ className, ...props }) {
10
- return (<div data-slot="input-otp-group" className={cn("flex items-center", className)} {...props}/>);
11
- }
12
- function InputOTPSlot({ index, className, ...props }) {
6
+ const InputOTP = React.forwardRef(({ className, containerClassName, ...props }, ref) => (<OTPInput ref={ref} containerClassName={cn("flex items-center gap-2 has-[:disabled]:opacity-50", containerClassName)} className={cn("disabled:cursor-not-allowed", className)} {...props}/>));
7
+ InputOTP.displayName = "InputOTP";
8
+ const InputOTPGroup = React.forwardRef(({ className, ...props }, ref) => (<div ref={ref} className={cn("flex items-center", className)} {...props}/>));
9
+ InputOTPGroup.displayName = "InputOTPGroup";
10
+ const InputOTPSlot = React.forwardRef(({ index, className, ...props }, ref) => {
13
11
  const inputOTPContext = React.useContext(OTPInputContext);
14
- const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
15
- return (<div data-slot="input-otp-slot" data-active={isActive} className={cn("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]", className)} {...props}>
12
+ const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
13
+ return (<div ref={ref} className={cn("relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md", isActive && "z-10 ring-2 ring-ring ring-offset-background", className)} {...props}>
16
14
  {char}
17
15
  {hasFakeCaret && (<div className="pointer-events-none absolute inset-0 flex items-center justify-center">
18
- <div className="animate-caret-blink bg-foreground h-4 w-px duration-1000"/>
16
+ <div className="h-4 w-px animate-caret-blink bg-foreground duration-1000"/>
19
17
  </div>)}
20
18
  </div>);
21
- }
22
- function InputOTPSeparator({ ...props }) {
23
- return (<div data-slot="input-otp-separator" role="separator" {...props}>
24
- <MinusIcon />
25
- </div>);
26
- }
19
+ });
20
+ InputOTPSlot.displayName = "InputOTPSlot";
21
+ const InputOTPSeparator = React.forwardRef(({ ...props }, ref) => (<div ref={ref} role="separator" {...props}>
22
+ <Dot />
23
+ </div>));
24
+ InputOTPSeparator.displayName = "InputOTPSeparator";
27
25
  export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };
package/ui/input.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import * as React from "react";
2
- declare function Input({ className, type, ...props }: React.ComponentProps<"input">): React.JSX.Element;
2
+ declare const Input: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
3
3
  export { Input };
package/ui/input.jsx CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { cn } from "../lib/utils";
3
- function Input({ className, type, ...props }) {
4
- return (<input type={type} data-slot="input" className={cn("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", className)} {...props}/>);
5
- }
3
+ const Input = React.forwardRef(({ className, type, ...props }, ref) => {
4
+ return (<input type={type} className={cn("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", className)} ref={ref} {...props}/>);
5
+ });
6
+ Input.displayName = "Input";
6
7
  export { Input };
package/ui/label.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as React from "react";
2
2
  import * as LabelPrimitive from "@radix-ui/react-label";
3
- declare function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): React.JSX.Element;
3
+ import { type VariantProps } from "class-variance-authority";
4
+ declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: import("class-variance-authority/dist/types").ClassProp) => string> & React.RefAttributes<HTMLLabelElement>>;
4
5
  export { Label };
package/ui/label.jsx CHANGED
@@ -1,8 +1,9 @@
1
1
  "use client";
2
2
  import * as React from "react";
3
3
  import * as LabelPrimitive from "@radix-ui/react-label";
4
+ import { cva } from "class-variance-authority";
4
5
  import { cn } from "../lib/utils";
5
- function Label({ className, ...props }) {
6
- return (<LabelPrimitive.Root data-slot="label" className={cn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className)} {...props}/>);
7
- }
6
+ const labelVariants = cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
7
+ const Label = React.forwardRef(({ className, ...props }, ref) => (<LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props}/>));
8
+ Label.displayName = LabelPrimitive.Root.displayName;
8
9
  export { Label };
package/ui/menubar.d.ts CHANGED
@@ -1,26 +1,28 @@
1
1
  import * as React from "react";
2
2
  import * as MenubarPrimitive from "@radix-ui/react-menubar";
3
- declare function Menubar({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Root>): React.JSX.Element;
4
3
  declare function MenubarMenu({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Menu>): React.JSX.Element;
5
4
  declare function MenubarGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Group>): React.JSX.Element;
6
5
  declare function MenubarPortal({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Portal>): React.JSX.Element;
7
6
  declare function MenubarRadioGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>): React.JSX.Element;
8
- declare function MenubarTrigger({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Trigger>): React.JSX.Element;
9
- declare function MenubarContent({ className, align, alignOffset, sideOffset, ...props }: React.ComponentProps<typeof MenubarPrimitive.Content>): React.JSX.Element;
10
- declare function MenubarItem({ className, inset, variant, ...props }: React.ComponentProps<typeof MenubarPrimitive.Item> & {
7
+ declare function MenubarSub({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Sub>): React.JSX.Element;
8
+ declare const Menubar: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
+ declare const MenubarTrigger: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
10
+ declare const MenubarSubTrigger: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
11
11
  inset?: boolean;
12
- variant?: "default" | "destructive";
13
- }): React.JSX.Element;
14
- declare function MenubarCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof MenubarPrimitive.CheckboxItem>): React.JSX.Element;
15
- declare function MenubarRadioItem({ className, children, ...props }: React.ComponentProps<typeof MenubarPrimitive.RadioItem>): React.JSX.Element;
16
- declare function MenubarLabel({ className, inset, ...props }: React.ComponentProps<typeof MenubarPrimitive.Label> & {
12
+ } & React.RefAttributes<HTMLDivElement>>;
13
+ declare const MenubarSubContent: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
14
+ declare const MenubarContent: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
15
+ declare const MenubarItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
17
16
  inset?: boolean;
18
- }): React.JSX.Element;
19
- declare function MenubarSeparator({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Separator>): React.JSX.Element;
20
- declare function MenubarShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
21
- declare function MenubarSub({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Sub>): React.JSX.Element;
22
- declare function MenubarSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof MenubarPrimitive.SubTrigger> & {
17
+ } & React.RefAttributes<HTMLDivElement>>;
18
+ declare const MenubarCheckboxItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
19
+ declare const MenubarRadioItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
20
+ declare const MenubarLabel: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
23
21
  inset?: boolean;
24
- }): React.JSX.Element;
25
- declare function MenubarSubContent({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.SubContent>): React.JSX.Element;
26
- export { Menubar, MenubarPortal, MenubarMenu, MenubarTrigger, MenubarContent, MenubarGroup, MenubarSeparator, MenubarLabel, MenubarItem, MenubarShortcut, MenubarCheckboxItem, MenubarRadioGroup, MenubarRadioItem, MenubarSub, MenubarSubTrigger, MenubarSubContent, };
22
+ } & React.RefAttributes<HTMLDivElement>>;
23
+ declare const MenubarSeparator: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
24
+ declare const MenubarShortcut: {
25
+ ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;
26
+ displayname: string;
27
+ };
28
+ export { Menubar, MenubarMenu, MenubarTrigger, MenubarContent, MenubarItem, MenubarSeparator, MenubarLabel, MenubarCheckboxItem, MenubarRadioGroup, MenubarRadioItem, MenubarPortal, MenubarSubContent, MenubarSubTrigger, MenubarGroup, MenubarSub, MenubarShortcut, };
package/ui/menubar.jsx CHANGED
@@ -1,73 +1,64 @@
1
1
  "use client";
2
2
  import * as React from "react";
3
3
  import * as MenubarPrimitive from "@radix-ui/react-menubar";
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 Menubar({ className, ...props }) {
7
- return (<MenubarPrimitive.Root data-slot="menubar" className={cn("bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs", className)} {...props}/>);
8
- }
9
6
  function MenubarMenu({ ...props }) {
10
- return <MenubarPrimitive.Menu data-slot="menubar-menu" {...props}/>;
7
+ return <MenubarPrimitive.Menu {...props}/>;
11
8
  }
12
9
  function MenubarGroup({ ...props }) {
13
- return <MenubarPrimitive.Group data-slot="menubar-group" {...props}/>;
10
+ return <MenubarPrimitive.Group {...props}/>;
14
11
  }
15
12
  function MenubarPortal({ ...props }) {
16
- return <MenubarPrimitive.Portal data-slot="menubar-portal" {...props}/>;
13
+ return <MenubarPrimitive.Portal {...props}/>;
17
14
  }
18
15
  function MenubarRadioGroup({ ...props }) {
19
- return (<MenubarPrimitive.RadioGroup data-slot="menubar-radio-group" {...props}/>);
20
- }
21
- function MenubarTrigger({ className, ...props }) {
22
- return (<MenubarPrimitive.Trigger data-slot="menubar-trigger" className={cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none", className)} {...props}/>);
23
- }
24
- function MenubarContent({ className, align = "start", alignOffset = -4, sideOffset = 8, ...props }) {
25
- return (<MenubarPortal>
26
- <MenubarPrimitive.Content data-slot="menubar-content" align={align} alignOffset={alignOffset} sideOffset={sideOffset} className={cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md", className)} {...props}/>
27
- </MenubarPortal>);
28
- }
29
- function MenubarItem({ className, inset, variant = "default", ...props }) {
30
- return (<MenubarPrimitive.Item data-slot="menubar-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}/>);
31
- }
32
- function MenubarCheckboxItem({ className, children, checked, ...props }) {
33
- return (<MenubarPrimitive.CheckboxItem data-slot="menubar-checkbox-item" className={cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className)} checked={checked} {...props}>
34
- <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
35
- <MenubarPrimitive.ItemIndicator>
36
- <CheckIcon className="size-4"/>
37
- </MenubarPrimitive.ItemIndicator>
38
- </span>
39
- {children}
40
- </MenubarPrimitive.CheckboxItem>);
41
- }
42
- function MenubarRadioItem({ className, children, ...props }) {
43
- return (<MenubarPrimitive.RadioItem data-slot="menubar-radio-item" className={cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className)} {...props}>
44
- <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
45
- <MenubarPrimitive.ItemIndicator>
46
- <CircleIcon className="size-2 fill-current"/>
47
- </MenubarPrimitive.ItemIndicator>
48
- </span>
49
- {children}
50
- </MenubarPrimitive.RadioItem>);
51
- }
52
- function MenubarLabel({ className, inset, ...props }) {
53
- return (<MenubarPrimitive.Label data-slot="menubar-label" data-inset={inset} className={cn("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className)} {...props}/>);
54
- }
55
- function MenubarSeparator({ className, ...props }) {
56
- return (<MenubarPrimitive.Separator data-slot="menubar-separator" className={cn("bg-border -mx-1 my-1 h-px", className)} {...props}/>);
57
- }
58
- function MenubarShortcut({ className, ...props }) {
59
- return (<span data-slot="menubar-shortcut" className={cn("text-muted-foreground ml-auto text-xs tracking-widest", className)} {...props}/>);
16
+ return <MenubarPrimitive.RadioGroup {...props}/>;
60
17
  }
61
18
  function MenubarSub({ ...props }) {
62
19
  return <MenubarPrimitive.Sub data-slot="menubar-sub" {...props}/>;
63
20
  }
64
- function MenubarSubTrigger({ className, inset, children, ...props }) {
65
- return (<MenubarPrimitive.SubTrigger data-slot="menubar-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-none select-none data-[inset]:pl-8", className)} {...props}>
66
- {children}
67
- <ChevronRightIcon className="ml-auto h-4 w-4"/>
68
- </MenubarPrimitive.SubTrigger>);
69
- }
70
- function MenubarSubContent({ className, ...props }) {
71
- return (<MenubarPrimitive.SubContent data-slot="menubar-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-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg", className)} {...props}/>);
72
- }
73
- export { Menubar, MenubarPortal, MenubarMenu, MenubarTrigger, MenubarContent, MenubarGroup, MenubarSeparator, MenubarLabel, MenubarItem, MenubarShortcut, MenubarCheckboxItem, MenubarRadioGroup, MenubarRadioItem, MenubarSub, MenubarSubTrigger, MenubarSubContent, };
21
+ const Menubar = React.forwardRef(({ className, ...props }, ref) => (<MenubarPrimitive.Root ref={ref} className={cn("flex h-10 items-center space-x-1 rounded-md border bg-background p-1", className)} {...props}/>));
22
+ Menubar.displayName = MenubarPrimitive.Root.displayName;
23
+ const MenubarTrigger = React.forwardRef(({ className, ...props }, ref) => (<MenubarPrimitive.Trigger ref={ref} className={cn("flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground", className)} {...props}/>));
24
+ MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;
25
+ const MenubarSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (<MenubarPrimitive.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}>
26
+ {children}
27
+ <ChevronRight className="ml-auto h-4 w-4"/>
28
+ </MenubarPrimitive.SubTrigger>));
29
+ MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;
30
+ const MenubarSubContent = React.forwardRef(({ className, ...props }, ref) => (<MenubarPrimitive.SubContent ref={ref} className={cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 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 origin-[--radix-menubar-content-transform-origin]", className)} {...props}/>));
31
+ MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;
32
+ const MenubarContent = React.forwardRef(({ className, align = "start", alignOffset = -4, sideOffset = 8, ...props }, ref) => (<MenubarPrimitive.Portal>
33
+ <MenubarPrimitive.Content ref={ref} align={align} alignOffset={alignOffset} sideOffset={sideOffset} className={cn("z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-menubar-content-transform-origin]", className)} {...props}/>
34
+ </MenubarPrimitive.Portal>));
35
+ MenubarContent.displayName = MenubarPrimitive.Content.displayName;
36
+ const MenubarItem = React.forwardRef(({ className, inset, ...props }, ref) => (<MenubarPrimitive.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}/>));
37
+ MenubarItem.displayName = MenubarPrimitive.Item.displayName;
38
+ const MenubarCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (<MenubarPrimitive.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}>
39
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
40
+ <MenubarPrimitive.ItemIndicator>
41
+ <Check className="h-4 w-4"/>
42
+ </MenubarPrimitive.ItemIndicator>
43
+ </span>
44
+ {children}
45
+ </MenubarPrimitive.CheckboxItem>));
46
+ MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;
47
+ const MenubarRadioItem = React.forwardRef(({ className, children, ...props }, ref) => (<MenubarPrimitive.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}>
48
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
49
+ <MenubarPrimitive.ItemIndicator>
50
+ <Circle className="h-2 w-2 fill-current"/>
51
+ </MenubarPrimitive.ItemIndicator>
52
+ </span>
53
+ {children}
54
+ </MenubarPrimitive.RadioItem>));
55
+ MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;
56
+ const MenubarLabel = React.forwardRef(({ className, inset, ...props }, ref) => (<MenubarPrimitive.Label ref={ref} className={cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className)} {...props}/>));
57
+ MenubarLabel.displayName = MenubarPrimitive.Label.displayName;
58
+ const MenubarSeparator = React.forwardRef(({ className, ...props }, ref) => (<MenubarPrimitive.Separator ref={ref} className={cn("-mx-1 my-1 h-px bg-muted", className)} {...props}/>));
59
+ MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;
60
+ const MenubarShortcut = ({ className, ...props }) => {
61
+ return (<span className={cn("ml-auto text-xs tracking-widest text-muted-foreground", className)} {...props}/>);
62
+ };
63
+ MenubarShortcut.displayname = "MenubarShortcut";
64
+ export { Menubar, MenubarMenu, MenubarTrigger, MenubarContent, MenubarItem, MenubarSeparator, MenubarLabel, MenubarCheckboxItem, MenubarRadioGroup, MenubarRadioItem, MenubarPortal, MenubarSubContent, MenubarSubTrigger, MenubarGroup, MenubarSub, MenubarShortcut, };