import * as PopoverPrimitive from '@radix-ui/react-popover' import type * as React from 'react' import { cn } from '../../utils' import { typographyVariants } from '../Typography' const Popover = PopoverPrimitive.Root Popover.displayName = 'Popover' const PopoverTrigger = PopoverPrimitive.Trigger export const popoverContentClassName = cn( 'z-50 max-w-[254px] origin-[--radix-tooltip-content-transform-origin] overflow-hidden rounded-lg bg-popover px-4 py-2', typographyVariants({ variant: 'body-xs', color: 'popover-muted', }), ) type PopoverContentProps = React.ComponentPropsWithoutRef< typeof PopoverPrimitive.Content > & { ref?: React.Ref> } const PopoverContent = ({ className, sideOffset = 4, ref, ...props }: PopoverContentProps) => ( ) type PopoverArrowProps = React.ComponentPropsWithoutRef< typeof PopoverPrimitive.Arrow > & { ref?: React.Ref> } const PopoverArrow = ({ className, ref, ...props }: PopoverArrowProps) => ( ) PopoverArrow.displayName = PopoverPrimitive.Arrow.displayName PopoverContent.displayName = PopoverPrimitive.Content.displayName function PopoverAnchor({ ...props }: React.ComponentProps) { return } export { Popover, PopoverTrigger, PopoverContent, PopoverArrow, PopoverAnchor }