|
|
|
@ -1,34 +1,25 @@ |
|
|
|
|
"use client" |
|
|
|
|
'use client'; |
|
|
|
|
|
|
|
|
|
import * as React from "react" |
|
|
|
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu" |
|
|
|
|
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react" |
|
|
|
|
import * as React from 'react'; |
|
|
|
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'; |
|
|
|
|
import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react'; |
|
|
|
|
|
|
|
|
|
import { cn } from "@/lib/utils" |
|
|
|
|
import { cn } from '@/lib/utils'; |
|
|
|
|
|
|
|
|
|
function DropdownMenu({ |
|
|
|
|
...props |
|
|
|
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) { |
|
|
|
|
return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} /> |
|
|
|
|
function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) { |
|
|
|
|
return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function DropdownMenuPortal({ |
|
|
|
|
...props |
|
|
|
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) { |
|
|
|
|
return ( |
|
|
|
|
<DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} /> |
|
|
|
|
) |
|
|
|
|
return <DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function DropdownMenuTrigger({ |
|
|
|
|
...props |
|
|
|
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) { |
|
|
|
|
return ( |
|
|
|
|
<DropdownMenuPrimitive.Trigger |
|
|
|
|
data-slot="dropdown-menu-trigger" |
|
|
|
|
{...props} |
|
|
|
|
/> |
|
|
|
|
) |
|
|
|
|
return <DropdownMenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props} />; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function DropdownMenuContent({ |
|
|
|
@ -42,31 +33,27 @@ function DropdownMenuContent({ |
|
|
|
|
data-slot="dropdown-menu-content" |
|
|
|
|
sideOffset={sideOffset} |
|
|
|
|
className={cn( |
|
|
|
|
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md", |
|
|
|
|
className |
|
|
|
|
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md', |
|
|
|
|
className, |
|
|
|
|
)} |
|
|
|
|
{...props} |
|
|
|
|
/> |
|
|
|
|
</DropdownMenuPrimitive.Portal> |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function DropdownMenuGroup({ |
|
|
|
|
...props |
|
|
|
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) { |
|
|
|
|
return ( |
|
|
|
|
<DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} /> |
|
|
|
|
) |
|
|
|
|
function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) { |
|
|
|
|
return <DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function DropdownMenuItem({ |
|
|
|
|
className, |
|
|
|
|
inset, |
|
|
|
|
variant = "default", |
|
|
|
|
variant = 'default', |
|
|
|
|
...props |
|
|
|
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & { |
|
|
|
|
inset?: boolean |
|
|
|
|
variant?: "default" | "destructive" |
|
|
|
|
inset?: boolean; |
|
|
|
|
variant?: 'default' | 'destructive'; |
|
|
|
|
}) { |
|
|
|
|
return ( |
|
|
|
|
<DropdownMenuPrimitive.Item |
|
|
|
@ -75,11 +62,11 @@ function DropdownMenuItem({ |
|
|
|
|
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 |
|
|
|
|
className, |
|
|
|
|
)} |
|
|
|
|
{...props} |
|
|
|
|
/> |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function DropdownMenuCheckboxItem({ |
|
|
|
@ -93,7 +80,7 @@ function DropdownMenuCheckboxItem({ |
|
|
|
|
data-slot="dropdown-menu-checkbox-item" |
|
|
|
|
className={cn( |
|
|
|
|
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", |
|
|
|
|
className |
|
|
|
|
className, |
|
|
|
|
)} |
|
|
|
|
checked={checked} |
|
|
|
|
{...props} |
|
|
|
@ -105,18 +92,13 @@ function DropdownMenuCheckboxItem({ |
|
|
|
|
</span> |
|
|
|
|
{children} |
|
|
|
|
</DropdownMenuPrimitive.CheckboxItem> |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function DropdownMenuRadioGroup({ |
|
|
|
|
...props |
|
|
|
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) { |
|
|
|
|
return ( |
|
|
|
|
<DropdownMenuPrimitive.RadioGroup |
|
|
|
|
data-slot="dropdown-menu-radio-group" |
|
|
|
|
{...props} |
|
|
|
|
/> |
|
|
|
|
) |
|
|
|
|
return <DropdownMenuPrimitive.RadioGroup data-slot="dropdown-menu-radio-group" {...props} />; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function DropdownMenuRadioItem({ |
|
|
|
@ -129,7 +111,7 @@ function DropdownMenuRadioItem({ |
|
|
|
|
data-slot="dropdown-menu-radio-item" |
|
|
|
|
className={cn( |
|
|
|
|
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", |
|
|
|
|
className |
|
|
|
|
className, |
|
|
|
|
)} |
|
|
|
|
{...props} |
|
|
|
|
> |
|
|
|
@ -140,7 +122,7 @@ function DropdownMenuRadioItem({ |
|
|
|
|
</span> |
|
|
|
|
{children} |
|
|
|
|
</DropdownMenuPrimitive.RadioItem> |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function DropdownMenuLabel({ |
|
|
|
@ -148,19 +130,16 @@ function DropdownMenuLabel({ |
|
|
|
|
inset, |
|
|
|
|
...props |
|
|
|
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & { |
|
|
|
|
inset?: boolean |
|
|
|
|
inset?: boolean; |
|
|
|
|
}) { |
|
|
|
|
return ( |
|
|
|
|
<DropdownMenuPrimitive.Label |
|
|
|
|
data-slot="dropdown-menu-label" |
|
|
|
|
data-inset={inset} |
|
|
|
|
className={cn( |
|
|
|
|
"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", |
|
|
|
|
className |
|
|
|
|
)} |
|
|
|
|
className={cn('px-2 py-1.5 text-sm font-medium data-[inset]:pl-8', className)} |
|
|
|
|
{...props} |
|
|
|
|
/> |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function DropdownMenuSeparator({ |
|
|
|
@ -170,32 +149,24 @@ function DropdownMenuSeparator({ |
|
|
|
|
return ( |
|
|
|
|
<DropdownMenuPrimitive.Separator |
|
|
|
|
data-slot="dropdown-menu-separator" |
|
|
|
|
className={cn("bg-border -mx-1 my-1 h-px", className)} |
|
|
|
|
className={cn('bg-border -mx-1 my-1 h-px', className)} |
|
|
|
|
{...props} |
|
|
|
|
/> |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function DropdownMenuShortcut({ |
|
|
|
|
className, |
|
|
|
|
...props |
|
|
|
|
}: React.ComponentProps<"span">) { |
|
|
|
|
function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) { |
|
|
|
|
return ( |
|
|
|
|
<span |
|
|
|
|
data-slot="dropdown-menu-shortcut" |
|
|
|
|
className={cn( |
|
|
|
|
"text-muted-foreground ml-auto text-xs tracking-widest", |
|
|
|
|
className |
|
|
|
|
)} |
|
|
|
|
className={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)} |
|
|
|
|
{...props} |
|
|
|
|
/> |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function DropdownMenuSub({ |
|
|
|
|
...props |
|
|
|
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) { |
|
|
|
|
return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} /> |
|
|
|
|
function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) { |
|
|
|
|
return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function DropdownMenuSubTrigger({ |
|
|
|
@ -204,22 +175,22 @@ function DropdownMenuSubTrigger({ |
|
|
|
|
children, |
|
|
|
|
...props |
|
|
|
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & { |
|
|
|
|
inset?: boolean |
|
|
|
|
inset?: boolean; |
|
|
|
|
}) { |
|
|
|
|
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 |
|
|
|
|
'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} |
|
|
|
|
> |
|
|
|
|
{children} |
|
|
|
|
<ChevronRightIcon className="ml-auto size-4" /> |
|
|
|
|
</DropdownMenuPrimitive.SubTrigger> |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function DropdownMenuSubContent({ |
|
|
|
@ -230,12 +201,12 @@ function DropdownMenuSubContent({ |
|
|
|
|
<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 |
|
|
|
|
'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} |
|
|
|
|
/> |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export { |
|
|
|
@ -254,4 +225,4 @@ export { |
|
|
|
|
DropdownMenuSub, |
|
|
|
|
DropdownMenuSubTrigger, |
|
|
|
|
DropdownMenuSubContent, |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|