shadcn-packaged 2025.4.21 → 2025.6.16-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/README.md +30 -31
  2. package/index.css +112 -138
  3. package/package.json +37 -37
  4. package/ui/accordion.d.ts +4 -4
  5. package/ui/accordion.jsx +20 -15
  6. package/ui/alert-dialog.d.ts +11 -17
  7. package/ui/alert-dialog.jsx +36 -23
  8. package/ui/alert.d.ts +5 -4
  9. package/ui/alert.jsx +12 -9
  10. package/ui/aspect-ratio.d.ts +1 -1
  11. package/ui/aspect-ratio.jsx +3 -1
  12. package/ui/avatar.d.ts +3 -3
  13. package/ui/avatar.jsx +9 -6
  14. package/ui/badge.d.ts +3 -3
  15. package/ui/badge.jsx +9 -7
  16. package/ui/breadcrumb.d.ts +8 -16
  17. package/ui/breadcrumb.jsx +26 -21
  18. package/ui/button.d.ts +2 -3
  19. package/ui/button.jsx +13 -14
  20. package/ui/calendar.d.ts +7 -7
  21. package/ui/calendar.jsx +70 -30
  22. package/ui/card.d.ts +8 -7
  23. package/ui/card.jsx +22 -13
  24. package/ui/carousel.d.ts +6 -5
  25. package/ui/carousel.jsx +26 -34
  26. package/ui/chart.d.ts +6 -28
  27. package/ui/chart.jsx +37 -40
  28. package/ui/checkbox.d.ts +1 -1
  29. package/ui/checkbox.jsx +8 -7
  30. package/ui/collapsible.d.ts +3 -3
  31. package/ui/collapsible.jsx +9 -3
  32. package/ui/command.d.ts +16 -78
  33. package/ui/command.jsx +37 -27
  34. package/ui/context-menu.d.ts +19 -21
  35. package/ui/context-menu.jsx +65 -47
  36. package/ui/dialog.d.ts +13 -17
  37. package/ui/dialog.jsx +41 -27
  38. package/ui/drawer.d.ts +10 -19
  39. package/ui/drawer.jsx +36 -23
  40. package/ui/dropdown-menu.d.ts +20 -22
  41. package/ui/dropdown-menu.jsx +66 -50
  42. package/ui/form.d.ts +6 -5
  43. package/ui/form.jsx +19 -23
  44. package/ui/hover-card.d.ts +3 -3
  45. package/ui/hover-card.jsx +11 -4
  46. package/ui/input-otp.d.ts +7 -30
  47. package/ui/input-otp.jsx +17 -15
  48. package/ui/input.d.ts +1 -1
  49. package/ui/input.jsx +3 -4
  50. package/ui/label.d.ts +1 -2
  51. package/ui/label.jsx +3 -4
  52. package/ui/menubar.d.ts +17 -19
  53. package/ui/menubar.jsx +58 -49
  54. package/ui/navigation-menu.d.ts +11 -9
  55. package/ui/navigation-menu.jsx +37 -29
  56. package/ui/pagination.d.ts +10 -25
  57. package/ui/pagination.jsx +35 -28
  58. package/ui/popover.d.ts +5 -4
  59. package/ui/popover.jsx +15 -7
  60. package/ui/progress.d.ts +1 -1
  61. package/ui/progress.jsx +5 -4
  62. package/ui/radio-group.d.ts +2 -2
  63. package/ui/radio-group.jsx +9 -11
  64. package/ui/resizable.d.ts +5 -20
  65. package/ui/resizable.jsx +15 -8
  66. package/ui/scroll-area.d.ts +2 -2
  67. package/ui/scroll-area.jsx +16 -14
  68. package/ui/select.d.ts +13 -11
  69. package/ui/select.jsx +58 -47
  70. package/ui/separator.d.ts +1 -1
  71. package/ui/separator.jsx +3 -2
  72. package/ui/sheet.d.ts +11 -23
  73. package/ui/sheet.jsx +45 -41
  74. package/ui/sidebar.d.ts +38 -34
  75. package/ui/sidebar.jsx +109 -122
  76. package/ui/skeleton.d.ts +1 -1
  77. package/ui/skeleton.jsx +1 -1
  78. package/ui/slider.d.ts +1 -1
  79. package/ui/slider.jsx +13 -7
  80. package/ui/sonner.d.ts +1 -2
  81. package/ui/sonner.jsx +4 -7
  82. package/ui/switch.d.ts +2 -2
  83. package/ui/switch.jsx +6 -5
  84. package/ui/table.d.ts +8 -8
  85. package/ui/table.jsx +27 -18
  86. package/ui/tabs.d.ts +4 -4
  87. package/ui/tabs.jsx +12 -7
  88. package/ui/textarea.d.ts +1 -1
  89. package/ui/textarea.jsx +3 -4
  90. package/ui/toggle-group.d.ts +3 -8
  91. package/ui/toggle-group.jsx +11 -11
  92. package/ui/toggle.d.ts +1 -4
  93. package/ui/toggle.jsx +8 -7
  94. package/ui/tooltip.d.ts +4 -4
  95. package/ui/tooltip.jsx +19 -5
  96. package/tailwind.config.js +0 -89
  97. /package/hooks/{use-mobile.jsx → use-mobile.js} +0 -0
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, } from "react-hook-form";
4
+ import { Controller, FormProvider, useFormContext, useFormState, } from "react-hook-form";
5
5
  import { cn } from "../lib/utils";
6
6
  import { Label } from "../ui/label";
7
7
  const Form = FormProvider;
@@ -14,7 +14,8 @@ const FormField = ({ ...props }) => {
14
14
  const useFormField = () => {
15
15
  const fieldContext = React.useContext(FormFieldContext);
16
16
  const itemContext = React.useContext(FormItemContext);
17
- const { getFieldState, formState } = useFormContext();
17
+ const { getFieldState } = useFormContext();
18
+ const formState = useFormState({ name: fieldContext.name });
18
19
  const fieldState = getFieldState(fieldContext.name, formState);
19
20
  if (!fieldContext) {
20
21
  throw new Error("useFormField should be used within <FormField>");
@@ -30,39 +31,34 @@ const useFormField = () => {
30
31
  };
31
32
  };
32
33
  const FormItemContext = React.createContext({});
33
- const FormItem = React.forwardRef(({ className, ...props }, ref) => {
34
+ function FormItem({ className, ...props }) {
34
35
  const id = React.useId();
35
36
  return (<FormItemContext.Provider value={{ id }}>
36
- <div ref={ref} className={cn("space-y-2", className)} {...props}/>
37
+ <div data-slot="form-item" className={cn("grid gap-2", className)} {...props}/>
37
38
  </FormItemContext.Provider>);
38
- });
39
- FormItem.displayName = "FormItem";
40
- const FormLabel = React.forwardRef(({ className, ...props }, ref) => {
39
+ }
40
+ function FormLabel({ className, ...props }) {
41
41
  const { error, formItemId } = useFormField();
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) => {
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 }) {
46
45
  const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
47
- return (<Slot ref={ref} id={formItemId} aria-describedby={!error
46
+ return (<Slot data-slot="form-control" id={formItemId} aria-describedby={!error
48
47
  ? `${formDescriptionId}`
49
48
  : `${formDescriptionId} ${formMessageId}`} aria-invalid={!!error} {...props}/>);
50
- });
51
- FormControl.displayName = "FormControl";
52
- const FormDescription = React.forwardRef(({ className, ...props }, ref) => {
49
+ }
50
+ function FormDescription({ className, ...props }) {
53
51
  const { formDescriptionId } = useFormField();
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) => {
52
+ return (<p data-slot="form-description" id={formDescriptionId} className={cn("text-muted-foreground text-sm", className)} {...props}/>);
53
+ }
54
+ function FormMessage({ className, ...props }) {
58
55
  const { error, formMessageId } = useFormField();
59
- const body = error ? String(error?.message ?? "") : children;
56
+ const body = error ? String(error?.message ?? "") : props.children;
60
57
  if (!body) {
61
58
  return null;
62
59
  }
63
- return (<p ref={ref} id={formMessageId} className={cn("text-sm font-medium text-destructive", className)} {...props}>
60
+ return (<p data-slot="form-message" id={formMessageId} className={cn("text-destructive text-sm", className)} {...props}>
64
61
  {body}
65
62
  </p>);
66
- });
67
- FormMessage.displayName = "FormMessage";
63
+ }
68
64
  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 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>>;
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;
6
6
  export { HoverCard, HoverCardTrigger, HoverCardContent };
package/ui/hover-card.jsx CHANGED
@@ -2,8 +2,15 @@
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
- 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;
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
+ }
9
16
  export { HoverCard, HoverCardTrigger, HoverCardContent };
package/ui/input-otp.d.ts CHANGED
@@ -1,34 +1,11 @@
1
1
  import * as React from "react";
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;
2
+ import { OTPInput } from "input-otp";
3
+ declare function InputOTP({ className, containerClassName, ...props }: React.ComponentProps<typeof OTPInput> & {
10
4
  containerClassName?: string;
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"> & {
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"> & {
31
8
  index: number;
32
- } & React.RefAttributes<HTMLDivElement>>;
33
- declare const InputOTPSeparator: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
+ }): React.JSX.Element;
10
+ declare function InputOTPSeparator({ ...props }: React.ComponentProps<"div">): React.JSX.Element;
34
11
  export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };
package/ui/input-otp.jsx CHANGED
@@ -1,25 +1,27 @@
1
1
  "use client";
2
2
  import * as React from "react";
3
3
  import { OTPInput, OTPInputContext } from "input-otp";
4
- import { Dot } from "lucide-react";
4
+ import { MinusIcon } from "lucide-react";
5
5
  import { cn } from "../lib/utils";
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) => {
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 }) {
11
13
  const inputOTPContext = React.useContext(OTPInputContext);
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}>
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}>
14
16
  {char}
15
17
  {hasFakeCaret && (<div className="pointer-events-none absolute inset-0 flex items-center justify-center">
16
- <div className="h-4 w-px animate-caret-blink bg-foreground duration-1000"/>
18
+ <div className="animate-caret-blink bg-foreground h-4 w-px duration-1000"/>
17
19
  </div>)}
18
20
  </div>);
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";
21
+ }
22
+ function InputOTPSeparator({ ...props }) {
23
+ return (<div data-slot="input-otp-separator" role="separator" {...props}>
24
+ <MinusIcon />
25
+ </div>);
26
+ }
25
27
  export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };
package/ui/input.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import * as React from "react";
2
- declare const Input: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
2
+ declare function Input({ className, type, ...props }: React.ComponentProps<"input">): React.JSX.Element;
3
3
  export { Input };
package/ui/input.jsx CHANGED
@@ -1,7 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { cn } from "../lib/utils";
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";
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
+ }
7
6
  export { Input };
package/ui/label.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import * as React from "react";
2
2
  import * as LabelPrimitive from "@radix-ui/react-label";
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>>;
3
+ declare function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): React.JSX.Element;
5
4
  export { Label };
package/ui/label.jsx CHANGED
@@ -1,9 +1,8 @@
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";
5
4
  import { cn } from "../lib/utils";
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;
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
+ }
9
8
  export { Label };
package/ui/menubar.d.ts CHANGED
@@ -1,28 +1,26 @@
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;
3
4
  declare function MenubarMenu({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Menu>): React.JSX.Element;
4
5
  declare function MenubarGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Group>): React.JSX.Element;
5
6
  declare function MenubarPortal({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Portal>): React.JSX.Element;
6
7
  declare function MenubarRadioGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>): React.JSX.Element;
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"> & {
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> & {
11
11
  inset?: boolean;
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"> & {
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> & {
16
17
  inset?: boolean;
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"> & {
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> & {
21
23
  inset?: boolean;
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, };
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, };
package/ui/menubar.jsx CHANGED
@@ -1,64 +1,73 @@
1
1
  "use client";
2
2
  import * as React from "react";
3
3
  import * as MenubarPrimitive from "@radix-ui/react-menubar";
4
- import { Check, ChevronRight, Circle } from "lucide-react";
4
+ import { CheckIcon, ChevronRightIcon, CircleIcon } 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
+ }
6
9
  function MenubarMenu({ ...props }) {
7
- return <MenubarPrimitive.Menu {...props}/>;
10
+ return <MenubarPrimitive.Menu data-slot="menubar-menu" {...props}/>;
8
11
  }
9
12
  function MenubarGroup({ ...props }) {
10
- return <MenubarPrimitive.Group {...props}/>;
13
+ return <MenubarPrimitive.Group data-slot="menubar-group" {...props}/>;
11
14
  }
12
15
  function MenubarPortal({ ...props }) {
13
- return <MenubarPrimitive.Portal {...props}/>;
16
+ return <MenubarPrimitive.Portal data-slot="menubar-portal" {...props}/>;
14
17
  }
15
18
  function MenubarRadioGroup({ ...props }) {
16
- return <MenubarPrimitive.RadioGroup {...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}/>);
17
60
  }
18
61
  function MenubarSub({ ...props }) {
19
62
  return <MenubarPrimitive.Sub data-slot="menubar-sub" {...props}/>;
20
63
  }
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, };
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, };
@@ -1,12 +1,14 @@
1
1
  import * as React from "react";
2
2
  import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
3
- declare const NavigationMenu: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
4
- declare const NavigationMenuList: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuListProps & React.RefAttributes<HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
5
- declare const NavigationMenuItem: React.ForwardRefExoticComponent<NavigationMenuPrimitive.NavigationMenuItemProps & React.RefAttributes<HTMLLIElement>>;
3
+ declare function NavigationMenu({ className, children, viewport, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {
4
+ viewport?: boolean;
5
+ }): React.JSX.Element;
6
+ declare function NavigationMenuList({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.List>): React.JSX.Element;
7
+ declare function NavigationMenuItem({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Item>): React.JSX.Element;
6
8
  declare const navigationMenuTriggerStyle: (props?: import("class-variance-authority/dist/types").ClassProp) => string;
7
- declare const NavigationMenuTrigger: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
8
- declare const NavigationMenuContent: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
- declare const NavigationMenuLink: React.ForwardRefExoticComponent<NavigationMenuPrimitive.NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>>;
10
- declare const NavigationMenuViewport: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuViewportProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
11
- declare const NavigationMenuIndicator: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuIndicatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
- export { navigationMenuTriggerStyle, NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuContent, NavigationMenuTrigger, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, };
9
+ declare function NavigationMenuTrigger({ className, children, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>): React.JSX.Element;
10
+ declare function NavigationMenuContent({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Content>): React.JSX.Element;
11
+ declare function NavigationMenuViewport({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>): React.JSX.Element;
12
+ declare function NavigationMenuLink({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Link>): React.JSX.Element;
13
+ declare function NavigationMenuIndicator({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>): React.JSX.Element;
14
+ export { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuContent, NavigationMenuTrigger, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, navigationMenuTriggerStyle, };
@@ -1,33 +1,41 @@
1
1
  import * as React from "react";
2
2
  import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
3
3
  import { cva } from "class-variance-authority";
4
- import { ChevronDown } from "lucide-react";
4
+ import { ChevronDownIcon } from "lucide-react";
5
5
  import { cn } from "../lib/utils";
6
- const NavigationMenu = React.forwardRef(({ className, children, ...props }, ref) => (<NavigationMenuPrimitive.Root ref={ref} className={cn("relative z-10 flex max-w-max flex-1 items-center justify-center", className)} {...props}>
7
- {children}
8
- <NavigationMenuViewport />
9
- </NavigationMenuPrimitive.Root>));
10
- NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;
11
- const NavigationMenuList = React.forwardRef(({ className, ...props }, ref) => (<NavigationMenuPrimitive.List ref={ref} className={cn("group flex flex-1 list-none items-center justify-center space-x-1", className)} {...props}/>));
12
- NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;
13
- const NavigationMenuItem = NavigationMenuPrimitive.Item;
14
- const navigationMenuTriggerStyle = cva("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:text-accent-foreground data-[state=open]:bg-accent/50 data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent");
15
- const NavigationMenuTrigger = React.forwardRef(({ className, children, ...props }, ref) => (<NavigationMenuPrimitive.Trigger ref={ref} className={cn(navigationMenuTriggerStyle(), "group", className)} {...props}>
16
- {children}{" "}
17
- <ChevronDown className="relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180" aria-hidden="true"/>
18
- </NavigationMenuPrimitive.Trigger>));
19
- NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;
20
- const NavigationMenuContent = React.forwardRef(({ className, ...props }, ref) => (<NavigationMenuPrimitive.Content ref={ref} className={cn("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ", className)} {...props}/>));
21
- NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
22
- const NavigationMenuLink = NavigationMenuPrimitive.Link;
23
- const NavigationMenuViewport = React.forwardRef(({ className, ...props }, ref) => (<div className={cn("absolute left-0 top-full flex justify-center")}>
24
- <NavigationMenuPrimitive.Viewport className={cn("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]", className)} ref={ref} {...props}/>
25
- </div>));
26
- NavigationMenuViewport.displayName =
27
- NavigationMenuPrimitive.Viewport.displayName;
28
- const NavigationMenuIndicator = React.forwardRef(({ className, ...props }, ref) => (<NavigationMenuPrimitive.Indicator ref={ref} className={cn("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in", className)} {...props}>
29
- <div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"/>
30
- </NavigationMenuPrimitive.Indicator>));
31
- NavigationMenuIndicator.displayName =
32
- NavigationMenuPrimitive.Indicator.displayName;
33
- export { navigationMenuTriggerStyle, NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuContent, NavigationMenuTrigger, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, };
6
+ function NavigationMenu({ className, children, viewport = true, ...props }) {
7
+ return (<NavigationMenuPrimitive.Root data-slot="navigation-menu" data-viewport={viewport} className={cn("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center", className)} {...props}>
8
+ {children}
9
+ {viewport && <NavigationMenuViewport />}
10
+ </NavigationMenuPrimitive.Root>);
11
+ }
12
+ function NavigationMenuList({ className, ...props }) {
13
+ return (<NavigationMenuPrimitive.List data-slot="navigation-menu-list" className={cn("group flex flex-1 list-none items-center justify-center gap-1", className)} {...props}/>);
14
+ }
15
+ function NavigationMenuItem({ className, ...props }) {
16
+ return (<NavigationMenuPrimitive.Item data-slot="navigation-menu-item" className={cn("relative", className)} {...props}/>);
17
+ }
18
+ const navigationMenuTriggerStyle = cva("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1");
19
+ function NavigationMenuTrigger({ className, children, ...props }) {
20
+ return (<NavigationMenuPrimitive.Trigger data-slot="navigation-menu-trigger" className={cn(navigationMenuTriggerStyle(), "group", className)} {...props}>
21
+ {children}{" "}
22
+ <ChevronDownIcon className="relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180" aria-hidden="true"/>
23
+ </NavigationMenuPrimitive.Trigger>);
24
+ }
25
+ function NavigationMenuContent({ className, ...props }) {
26
+ return (<NavigationMenuPrimitive.Content data-slot="navigation-menu-content" className={cn("data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto", "group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none", className)} {...props}/>);
27
+ }
28
+ function NavigationMenuViewport({ className, ...props }) {
29
+ return (<div className={cn("absolute top-full left-0 isolate z-50 flex justify-center")}>
30
+ <NavigationMenuPrimitive.Viewport data-slot="navigation-menu-viewport" className={cn("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]", className)} {...props}/>
31
+ </div>);
32
+ }
33
+ function NavigationMenuLink({ className, ...props }) {
34
+ return (<NavigationMenuPrimitive.Link data-slot="navigation-menu-link" className={cn("data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4", className)} {...props}/>);
35
+ }
36
+ function NavigationMenuIndicator({ className, ...props }) {
37
+ return (<NavigationMenuPrimitive.Indicator data-slot="navigation-menu-indicator" className={cn("data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden", className)} {...props}>
38
+ <div className="bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md"/>
39
+ </NavigationMenuPrimitive.Indicator>);
40
+ }
41
+ export { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuContent, NavigationMenuTrigger, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, navigationMenuTriggerStyle, };
@@ -1,28 +1,13 @@
1
1
  import * as React from "react";
2
- import { ButtonProps } from "../ui/button";
3
- declare const Pagination: {
4
- ({ className, ...props }: React.ComponentProps<"nav">): React.JSX.Element;
5
- displayName: string;
6
- };
7
- declare const PaginationContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
8
- declare const PaginationItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
2
+ import { Button } from "../ui/button";
3
+ declare function Pagination({ className, ...props }: React.ComponentProps<"nav">): React.JSX.Element;
4
+ declare function PaginationContent({ className, ...props }: React.ComponentProps<"ul">): React.JSX.Element;
5
+ declare function PaginationItem({ ...props }: React.ComponentProps<"li">): React.JSX.Element;
9
6
  type PaginationLinkProps = {
10
7
  isActive?: boolean;
11
- } & Pick<ButtonProps, "size"> & React.ComponentProps<"a">;
12
- declare const PaginationLink: {
13
- ({ className, isActive, size, ...props }: PaginationLinkProps): React.JSX.Element;
14
- displayName: string;
15
- };
16
- declare const PaginationPrevious: {
17
- ({ className, ...props }: React.ComponentProps<typeof PaginationLink>): React.JSX.Element;
18
- displayName: string;
19
- };
20
- declare const PaginationNext: {
21
- ({ className, ...props }: React.ComponentProps<typeof PaginationLink>): React.JSX.Element;
22
- displayName: string;
23
- };
24
- declare const PaginationEllipsis: {
25
- ({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
26
- displayName: string;
27
- };
28
- export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, };
8
+ } & Pick<React.ComponentProps<typeof Button>, "size"> & React.ComponentProps<"a">;
9
+ declare function PaginationLink({ className, isActive, size, ...props }: PaginationLinkProps): React.JSX.Element;
10
+ declare function PaginationPrevious({ className, ...props }: React.ComponentProps<typeof PaginationLink>): React.JSX.Element;
11
+ declare function PaginationNext({ className, ...props }: React.ComponentProps<typeof PaginationLink>): React.JSX.Element;
12
+ declare function PaginationEllipsis({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
13
+ export { Pagination, PaginationContent, PaginationLink, PaginationItem, PaginationPrevious, PaginationNext, PaginationEllipsis, };