| 1 | import * as React from 'react' |
| 2 | import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu' |
| 3 | import { cn } from '@renderer/lib/utils' |
| 4 | |
| 5 | export const DropdownMenu = DropdownMenuPrimitive.Root |
| 6 | export const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger |
| 7 | |
| 8 | export const DropdownMenuContent = React.forwardRef< |
| 9 | React.ElementRef<typeof DropdownMenuPrimitive.Content>, |
| 10 | React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content> |
| 11 | >(({ className, sideOffset = 6, ...props }, ref) => ( |
| 12 | <DropdownMenuPrimitive.Portal> |
| 13 | <DropdownMenuPrimitive.Content |
| 14 | ref={ref} |
| 15 | sideOffset={sideOffset} |
| 16 | className={cn( |
| 17 | 'z-50 min-w-[9rem] overflow-hidden rounded-lg border border-[#d8ccb5]/85 bg-[#fff9ef] p-1 text-foreground shadow-[0_12px_28px_rgba(88,72,54,0.18)]', |
| 18 | className |
| 19 | )} |
| 20 | {...props} |
| 21 | /> |
| 22 | </DropdownMenuPrimitive.Portal> |
| 23 | )) |
| 24 | DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName |
| 25 | |
| 26 | export const DropdownMenuItem = React.forwardRef< |
| 27 | React.ElementRef<typeof DropdownMenuPrimitive.Item>, |
| 28 | React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> |
| 29 | >(({ className, ...props }, ref) => ( |
| 30 | <DropdownMenuPrimitive.Item |
| 31 | ref={ref} |
| 32 | className={cn( |
| 33 | 'relative flex cursor-default select-none items-center gap-2 rounded-md px-2.5 py-2 text-sm outline-none transition-colors focus:bg-[#efe5d3]/75 data-[disabled]:pointer-events-none data-[disabled]:opacity-45', |
| 34 | className |
| 35 | )} |
| 36 | {...props} |
| 37 | /> |
| 38 | )) |
| 39 | DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName |
| 40 | |
| 41 | export const DropdownMenuSeparator = React.forwardRef< |
| 42 | React.ElementRef<typeof DropdownMenuPrimitive.Separator>, |
| 43 | React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator> |
| 44 | >(({ className, ...props }, ref) => ( |
| 45 | <DropdownMenuPrimitive.Separator |
| 46 | ref={ref} |
| 47 | className={cn('-mx-1 my-1 h-px bg-[#d8ccb5]/60', className)} |
| 48 | {...props} |
| 49 | /> |
| 50 | )) |
| 51 | DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName |
| 52 | |
| 53 |