import * as PopoverPrimitive from "@radix-ui/react-popover"; import * as React from "react"; import { cn } from "../utils.js"; const Popover = PopoverPrimitive.Root; const PopoverTrigger = PopoverPrimitive.Trigger; const PopoverAnchor = PopoverPrimitive.Anchor; const PopoverContent = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef & { // When false, renders inline without a portal — useful inside overflow-hidden // containers where a portalled overlay would escape the clip boundary. portalled?: boolean; container?: React.ComponentPropsWithoutRef< typeof PopoverPrimitive.Portal >["container"]; } >( ( { className, align = "center", sideOffset = 4, portalled = true, container, ...props }, ref, ) => { const content = ( ); if (!portalled) return content; return ( {content} ); }, ); PopoverContent.displayName = PopoverPrimitive.Content.displayName; export { Popover, PopoverTrigger, PopoverAnchor, PopoverContent };