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.
- package/index.css +20 -0
- package/package.json +3 -3
- package/ui/accordion.d.ts +4 -4
- package/ui/accordion.jsx +15 -20
- package/ui/alert-dialog.d.ts +17 -11
- package/ui/alert-dialog.jsx +23 -36
- package/ui/alert.d.ts +4 -5
- package/ui/alert.jsx +9 -12
- package/ui/aspect-ratio.d.ts +1 -1
- package/ui/aspect-ratio.jsx +1 -3
- package/ui/avatar.d.ts +3 -3
- package/ui/avatar.jsx +6 -9
- package/ui/badge.d.ts +3 -3
- package/ui/badge.jsx +7 -9
- package/ui/breadcrumb.d.ts +16 -8
- package/ui/breadcrumb.jsx +21 -26
- package/ui/button.d.ts +3 -2
- package/ui/button.jsx +14 -13
- package/ui/calendar.jsx +20 -20
- package/ui/card.d.ts +7 -8
- package/ui/card.jsx +13 -22
- package/ui/carousel.d.ts +5 -6
- package/ui/carousel.jsx +34 -26
- package/ui/chart.d.ts +28 -6
- package/ui/chart.jsx +40 -37
- package/ui/checkbox.d.ts +1 -1
- package/ui/checkbox.jsx +7 -8
- package/ui/collapsible.d.ts +3 -3
- package/ui/collapsible.jsx +3 -9
- package/ui/command.d.ts +78 -16
- package/ui/command.jsx +27 -37
- package/ui/context-menu.d.ts +21 -19
- package/ui/context-menu.jsx +47 -65
- package/ui/dialog.d.ts +17 -13
- package/ui/dialog.jsx +27 -41
- package/ui/drawer.d.ts +19 -10
- package/ui/drawer.jsx +23 -36
- package/ui/dropdown-menu.d.ts +22 -20
- package/ui/dropdown-menu.jsx +50 -66
- package/ui/form.d.ts +5 -6
- package/ui/form.jsx +23 -19
- package/ui/hover-card.d.ts +3 -3
- package/ui/hover-card.jsx +4 -11
- package/ui/input-otp.d.ts +30 -7
- package/ui/input-otp.jsx +15 -17
- package/ui/input.d.ts +1 -1
- package/ui/input.jsx +4 -3
- package/ui/label.d.ts +2 -1
- package/ui/label.jsx +4 -3
- package/ui/menubar.d.ts +19 -17
- package/ui/menubar.jsx +49 -58
- package/ui/navigation-menu.d.ts +9 -11
- package/ui/navigation-menu.jsx +29 -37
- package/ui/pagination.d.ts +25 -10
- package/ui/pagination.jsx +28 -35
- package/ui/popover.d.ts +4 -5
- package/ui/popover.jsx +7 -15
- package/ui/progress.d.ts +1 -1
- package/ui/progress.jsx +4 -5
- package/ui/radio-group.d.ts +2 -2
- package/ui/radio-group.jsx +11 -9
- package/ui/resizable.d.ts +20 -5
- package/ui/resizable.jsx +8 -15
- package/ui/scroll-area.d.ts +2 -2
- package/ui/scroll-area.jsx +14 -16
- package/ui/select.d.ts +11 -13
- package/ui/select.jsx +47 -58
- package/ui/separator.d.ts +1 -1
- package/ui/separator.jsx +2 -3
- package/ui/sheet.d.ts +23 -11
- package/ui/sheet.jsx +41 -45
- package/ui/sidebar.d.ts +34 -38
- package/ui/sidebar.jsx +122 -109
- package/ui/skeleton.d.ts +1 -1
- package/ui/skeleton.jsx +1 -1
- package/ui/slider.d.ts +1 -1
- package/ui/slider.jsx +7 -13
- package/ui/sonner.d.ts +2 -1
- package/ui/sonner.jsx +7 -4
- package/ui/switch.d.ts +2 -2
- package/ui/switch.jsx +5 -6
- package/ui/table.d.ts +8 -8
- package/ui/table.jsx +18 -27
- package/ui/tabs.d.ts +4 -4
- package/ui/tabs.jsx +7 -12
- package/ui/textarea.d.ts +1 -1
- package/ui/textarea.jsx +4 -3
- package/ui/toggle-group.d.ts +8 -3
- package/ui/toggle-group.jsx +11 -11
- package/ui/toggle.d.ts +4 -1
- package/ui/toggle.jsx +7 -8
- package/ui/tooltip.d.ts +4 -4
- package/ui/tooltip.jsx +5 -19
package/ui/dropdown-menu.jsx
CHANGED
@@ -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 {
|
4
|
+
import { Check, ChevronRight, Circle } from "lucide-react";
|
5
5
|
import { cn } from "../lib/utils";
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
}
|
23
|
-
|
24
|
-
|
25
|
-
}
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
}
|
49
|
-
|
50
|
-
|
51
|
-
}
|
52
|
-
|
53
|
-
|
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
|
20
|
-
declare
|
21
|
-
declare
|
22
|
-
declare
|
23
|
-
declare
|
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,
|
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
|
-
|
33
|
+
const FormItem = React.forwardRef(({ className, ...props }, ref) => {
|
35
34
|
const id = React.useId();
|
36
35
|
return (<FormItemContext.Provider value={{ id }}>
|
37
|
-
<div
|
36
|
+
<div ref={ref} className={cn("space-y-2", className)} {...props}/>
|
38
37
|
</FormItemContext.Provider>);
|
39
|
-
}
|
40
|
-
|
38
|
+
});
|
39
|
+
FormItem.displayName = "FormItem";
|
40
|
+
const FormLabel = React.forwardRef(({ className, ...props }, ref) => {
|
41
41
|
const { error, formItemId } = useFormField();
|
42
|
-
return (<Label
|
43
|
-
}
|
44
|
-
|
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
|
47
|
+
return (<Slot ref={ref} id={formItemId} aria-describedby={!error
|
47
48
|
? `${formDescriptionId}`
|
48
49
|
: `${formDescriptionId} ${formMessageId}`} aria-invalid={!!error} {...props}/>);
|
49
|
-
}
|
50
|
-
|
50
|
+
});
|
51
|
+
FormControl.displayName = "FormControl";
|
52
|
+
const FormDescription = React.forwardRef(({ className, ...props }, ref) => {
|
51
53
|
const { formDescriptionId } = useFormField();
|
52
|
-
return (<p
|
53
|
-
}
|
54
|
-
|
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 ?? "") :
|
59
|
+
const body = error ? String(error?.message ?? "") : children;
|
57
60
|
if (!body) {
|
58
61
|
return null;
|
59
62
|
}
|
60
|
-
return (<p
|
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, };
|
package/ui/hover-card.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
3
|
-
declare
|
4
|
-
declare
|
5
|
-
declare
|
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
|
-
|
6
|
-
|
7
|
-
}
|
8
|
-
|
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
|
-
|
3
|
-
|
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
|
-
|
6
|
-
|
7
|
-
|
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
|
-
}
|
10
|
-
declare
|
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 {
|
4
|
+
import { Dot } from "lucide-react";
|
5
5
|
import { cn } from "../lib/utils";
|
6
|
-
|
7
|
-
|
8
|
-
}
|
9
|
-
|
10
|
-
|
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
|
15
|
-
return (<div
|
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
|
16
|
+
<div className="h-4 w-px animate-caret-blink bg-foreground duration-1000"/>
|
19
17
|
</div>)}
|
20
18
|
</div>);
|
21
|
-
}
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
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
|
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
|
-
|
4
|
-
return (<input type={type}
|
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
|
-
|
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
|
-
|
6
|
-
|
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
|
9
|
-
declare
|
10
|
-
declare
|
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
|
-
|
13
|
-
|
14
|
-
declare
|
15
|
-
declare
|
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
|
-
}
|
19
|
-
declare
|
20
|
-
declare
|
21
|
-
declare
|
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
|
-
}
|
25
|
-
declare
|
26
|
-
|
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 {
|
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
|
7
|
+
return <MenubarPrimitive.Menu {...props}/>;
|
11
8
|
}
|
12
9
|
function MenubarGroup({ ...props }) {
|
13
|
-
return <MenubarPrimitive.Group
|
10
|
+
return <MenubarPrimitive.Group {...props}/>;
|
14
11
|
}
|
15
12
|
function MenubarPortal({ ...props }) {
|
16
|
-
return <MenubarPrimitive.Portal
|
13
|
+
return <MenubarPrimitive.Portal {...props}/>;
|
17
14
|
}
|
18
15
|
function MenubarRadioGroup({ ...props }) {
|
19
|
-
return
|
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
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
}
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
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, };
|