|
|
@@ -1,7 +1,7 @@
|
|
|
import * as React from "react"
|
|
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
|
|
|
import { PortalProps } from "@radix-ui/react-portal"
|
|
|
-import { CheckIcon, ChevronRightIcon, DotFilledIcon } from "@radix-ui/react-icons"
|
|
|
+import { CheckIcon, DotFilledIcon } from "@radix-ui/react-icons"
|
|
|
|
|
|
import { cn } from "@/lib/utils"
|
|
|
|
|
|
@@ -13,45 +13,8 @@ const DropdownMenuGroup = DropdownMenuPrimitive.Group
|
|
|
|
|
|
const DropdownMenuPortal = DropdownMenuPrimitive.Portal
|
|
|
|
|
|
-const DropdownMenuSub = DropdownMenuPrimitive.Sub
|
|
|
-
|
|
|
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup
|
|
|
|
|
|
-const DropdownMenuSubTrigger = React.forwardRef<
|
|
|
- React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
|
|
|
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
|
- inset?: boolean
|
|
|
- }
|
|
|
->(({ className, inset, children, ...props }, ref) => (
|
|
|
- <DropdownMenuPrimitive.SubTrigger
|
|
|
- ref={ref}
|
|
|
- className={cn(
|
|
|
- "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",
|
|
|
- inset && "pl-8",
|
|
|
- className,
|
|
|
- )}
|
|
|
- {...props}>
|
|
|
- {children}
|
|
|
- <ChevronRightIcon className="ml-auto" />
|
|
|
- </DropdownMenuPrimitive.SubTrigger>
|
|
|
-))
|
|
|
-DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName
|
|
|
-
|
|
|
-const DropdownMenuSubContent = React.forwardRef<
|
|
|
- React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
|
|
|
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
|
|
|
->(({ 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",
|
|
|
- className,
|
|
|
- )}
|
|
|
- {...props}
|
|
|
- />
|
|
|
-))
|
|
|
-DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName
|
|
|
-
|
|
|
const DropdownMenuContent = React.forwardRef<
|
|
|
React.ElementRef<typeof DropdownMenuPrimitive.Content>,
|
|
|
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content> & Pick<PortalProps, "container">
|
|
|
@@ -61,8 +24,11 @@ const DropdownMenuContent = React.forwardRef<
|
|
|
ref={ref}
|
|
|
sideOffset={sideOffset}
|
|
|
className={cn(
|
|
|
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
|
|
|
+ "z-50 min-w-[8rem] overflow-hidden rounded-xs p-1 shadow-xs",
|
|
|
"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",
|
|
|
+ "border border-vscode-focusBorder",
|
|
|
+ "bg-vscode-dropdown-background",
|
|
|
+ "text-vscode-dropdown-foreground",
|
|
|
className,
|
|
|
)}
|
|
|
{...props}
|
|
|
@@ -80,7 +46,8 @@ const DropdownMenuItem = React.forwardRef<
|
|
|
<DropdownMenuPrimitive.Item
|
|
|
ref={ref}
|
|
|
className={cn(
|
|
|
- "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",
|
|
|
+ "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",
|
|
|
+ "focus:bg-vscode-list-activeSelectionBackground focus:text-vscode-list-activeSelectionForeground",
|
|
|
inset && "pl-8",
|
|
|
className,
|
|
|
)}
|
|
|
@@ -96,7 +63,8 @@ const DropdownMenuCheckboxItem = React.forwardRef<
|
|
|
<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-vscode-list-activeSelectionBackground focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
|
+ "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",
|
|
|
+ "focus:bg-vscode-list-activeSelectionBackground focus:text-vscode-list-activeSelectionForeground",
|
|
|
className,
|
|
|
)}
|
|
|
checked={checked}
|
|
|
@@ -152,7 +120,7 @@ const DropdownMenuSeparator = React.forwardRef<
|
|
|
>(({ className, ...props }, ref) => (
|
|
|
<DropdownMenuPrimitive.Separator
|
|
|
ref={ref}
|
|
|
- className={cn("-mx-1 my-1 h-px bg-vscode-input-border", className)}
|
|
|
+ className={cn("-mx-1 my-1 h-px bg-vscode-dropdown-foreground/10", className)}
|
|
|
{...props}
|
|
|
/>
|
|
|
))
|
|
|
@@ -175,8 +143,5 @@ export {
|
|
|
DropdownMenuShortcut,
|
|
|
DropdownMenuGroup,
|
|
|
DropdownMenuPortal,
|
|
|
- DropdownMenuSub,
|
|
|
- DropdownMenuSubContent,
|
|
|
- DropdownMenuSubTrigger,
|
|
|
DropdownMenuRadioGroup,
|
|
|
}
|