11import * as React from "react"
22import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
33import { PortalProps } from "@radix-ui/react-portal"
4- import { CheckIcon , ChevronRightIcon , DotFilledIcon } from "@radix-ui/react-icons"
4+ import { CheckIcon , DotFilledIcon } from "@radix-ui/react-icons"
55
66import { cn } from "@/lib/utils"
77
@@ -13,45 +13,8 @@ const DropdownMenuGroup = DropdownMenuPrimitive.Group
1313
1414const DropdownMenuPortal = DropdownMenuPrimitive . Portal
1515
16- const DropdownMenuSub = DropdownMenuPrimitive . Sub
17-
1816const DropdownMenuRadioGroup = DropdownMenuPrimitive . RadioGroup
1917
20- const DropdownMenuSubTrigger = React . forwardRef <
21- React . ElementRef < typeof DropdownMenuPrimitive . SubTrigger > ,
22- React . ComponentPropsWithoutRef < typeof DropdownMenuPrimitive . SubTrigger > & {
23- inset ?: boolean
24- }
25- > ( ( { className, inset, children, ...props } , ref ) => (
26- < DropdownMenuPrimitive . SubTrigger
27- ref = { ref }
28- className = { cn (
29- "flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-vscode-list-activeSelectionBackground data-[state=open]:bg-vscode-list-activeSelectionBackground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0" ,
30- inset && "pl-8" ,
31- className ,
32- ) }
33- { ...props } >
34- { children }
35- < ChevronRightIcon className = "ml-auto" />
36- </ DropdownMenuPrimitive . SubTrigger >
37- ) )
38- DropdownMenuSubTrigger . displayName = DropdownMenuPrimitive . SubTrigger . displayName
39-
40- const DropdownMenuSubContent = React . forwardRef <
41- React . ElementRef < typeof DropdownMenuPrimitive . SubContent > ,
42- React . ComponentPropsWithoutRef < typeof DropdownMenuPrimitive . SubContent >
43- > ( ( { className, ...props } , ref ) => (
44- < DropdownMenuPrimitive . SubContent
45- ref = { ref }
46- className = { cn (
47- "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" ,
48- className ,
49- ) }
50- { ...props }
51- />
52- ) )
53- DropdownMenuSubContent . displayName = DropdownMenuPrimitive . SubContent . displayName
54-
5518const DropdownMenuContent = React . forwardRef <
5619 React . ElementRef < typeof DropdownMenuPrimitive . Content > ,
5720 React . ComponentPropsWithoutRef < typeof DropdownMenuPrimitive . Content > & Pick < PortalProps , "container" >
@@ -61,8 +24,11 @@ const DropdownMenuContent = React.forwardRef<
6124 ref = { ref }
6225 sideOffset = { sideOffset }
6326 className = { cn (
64- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md " ,
27+ "z-50 min-w-[8rem] overflow-hidden rounded-xs p-1 shadow-xs " ,
6528 "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" ,
29+ "border border-vscode-focusBorder" ,
30+ "bg-vscode-dropdown-background" ,
31+ "text-vscode-dropdown-foreground" ,
6632 className ,
6733 ) }
6834 { ...props }
@@ -80,7 +46,8 @@ const DropdownMenuItem = React.forwardRef<
8046 < DropdownMenuPrimitive . Item
8147 ref = { ref }
8248 className = { cn (
83- "relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-vscode-list-activeSelectionBackground focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0 active:opacity-90" ,
49+ "relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0 active:opacity-90" ,
50+ "focus:bg-vscode-list-activeSelectionBackground focus:text-vscode-list-activeSelectionForeground" ,
8451 inset && "pl-8" ,
8552 className ,
8653 ) }
@@ -96,7 +63,8 @@ const DropdownMenuCheckboxItem = React.forwardRef<
9663 < DropdownMenuPrimitive . CheckboxItem
9764 ref = { ref }
9865 className = { cn (
99- "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-vscode-list-activeSelectionBackground focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50" ,
66+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50" ,
67+ "focus:bg-vscode-list-activeSelectionBackground focus:text-vscode-list-activeSelectionForeground" ,
10068 className ,
10169 ) }
10270 checked = { checked }
@@ -152,7 +120,7 @@ const DropdownMenuSeparator = React.forwardRef<
152120> ( ( { className, ...props } , ref ) => (
153121 < DropdownMenuPrimitive . Separator
154122 ref = { ref }
155- className = { cn ( "-mx-1 my-1 h-px bg-vscode-input-border " , className ) }
123+ className = { cn ( "-mx-1 my-1 h-px bg-vscode-dropdown-foreground/10 " , className ) }
156124 { ...props }
157125 />
158126) )
@@ -175,8 +143,5 @@ export {
175143 DropdownMenuShortcut ,
176144 DropdownMenuGroup ,
177145 DropdownMenuPortal ,
178- DropdownMenuSub ,
179- DropdownMenuSubContent ,
180- DropdownMenuSubTrigger ,
181146 DropdownMenuRadioGroup ,
182147}
0 commit comments