| 1 | import * as React from 'react' |
| 2 | import * as PopoverPrimitive from '@radix-ui/react-popover' |
| 3 | import { cn } from '@renderer/lib/utils' |
| 4 | |
| 5 | export const Popover = PopoverPrimitive.Root |
| 6 | export const PopoverTrigger = PopoverPrimitive.Trigger |
| 7 | export const PopoverAnchor = PopoverPrimitive.Anchor |
| 8 | |
| 9 | export const PopoverContent = React.forwardRef< |
| 10 | React.ElementRef<typeof PopoverPrimitive.Content>, |
| 11 | React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> |
| 12 | >(({ className, align = 'center', sideOffset = 4, ...props }, ref) => ( |
| 13 | <PopoverPrimitive.Portal> |
| 14 | <PopoverPrimitive.Content |
| 15 | ref={ref} |
| 16 | align={align} |
| 17 | sideOffset={sideOffset} |
| 18 | className={cn( |
| 19 | 'z-50 rounded-lg border border-black/10 bg-transparent shadow-[0_20px_50px_-12px_rgba(0,0,0,0.3)] outline-none', |
| 20 | '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', |
| 21 | className |
| 22 | )} |
| 23 | {...props} |
| 24 | /> |
| 25 | </PopoverPrimitive.Portal> |
| 26 | )) |
| 27 | PopoverContent.displayName = PopoverPrimitive.Content.displayName |
| 28 |