'use client';'use strict';

var chunkQL4GOF3V_cjs = require('./chunk-QL4GOF3V.cjs');
var reactPopover = require('@radix-ui/react-popover');
var css = require('@onbeam/styled-system/css');
var react = require('react');
var icons = require('@onbeam/icons');
var recipes = require('@onbeam/styled-system/recipes');
var jsxRuntime = require('react/jsx-runtime');

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

exports.a = h;
exports.b = b;
//# sourceMappingURL=out.js.map
//# sourceMappingURL=chunk-URABYHLT.cjs.map