'use client';import { a } from './chunk-2PAFMHQ4.js';
import { Content, Root, Trigger, Anchor, Portal, Close, Arrow } from '@radix-ui/react-popover';
import { cx } from '@onbeam/styled-system/css';
import { forwardRef, useRef, useEffect } from 'react';
import { CloseIcon } from '@onbeam/icons';
import { popover, customScrollbar } from '@onbeam/styled-system/recipes';
import { jsx, jsxs } from 'react/jsx-runtime';

var f=forwardRef(({className:r,children:n,...s},p)=>{let e=popover();return jsx(Content,{ref:p,className:cx(customScrollbar(),e.content,r),...s,children:n})});f.displayName="PopoverContent";var h=forwardRef(({children:r,open:n,onOpenChange:s,trigger:p,anchor:e,title:a$1,size:g="md",align:E="start",side:y="bottom",...T},M)=>{let t=useRef(null),A=useRef(),i=popover();return useEffect(()=>{if(!t.current)return;t.current.getRootNode().nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(A.current=t.current.getRootNode());},[]),jsxs(Root,{open:n,onOpenChange:s,children:[jsx(Trigger,{ref:t,asChild:!0,children:p??jsx("div",{"aria-hidden":!0,className:i.hidden})}),e&&jsx(Anchor,{asChild:!0,children:e}),jsx(Portal,{children:jsx(f,{ref:M,sideOffset:8,align:E,side:y,...T,children:jsxs(a,{size:g,children:[a$1&&jsxs("div",{className:i.header,children:[jsx("span",{children:a$1}),jsx(Close,{className:i.close,children:jsx(CloseIcon,{height:16,width:16})})]}),r]})})})]})});h.displayName="Popover";var b={Portal:Portal,Root:Root,Trigger:Trigger,Content:f,Close:Close,Arrow:Arrow,Anchor:Anchor};

export { h as a, b };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=chunk-WYVVX2CG.js.map