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

var M=forwardRef(({className:t,...r},n)=>{let a=modal();return jsx(Overlay,{ref:n,className:cx(a.bgOverlay,t),...r})});M.displayName="ModalBackgroundOverlay";var C=forwardRef(({className:t,children:r,...n},a)=>{let l=modal();return jsx(Content,{ref:a,className:cx(customScrollbar(),l.content,t),...n,children:r})});C.displayName="ModalContent";var T=forwardRef(({children:t,open:r,onOpenChange:n,trigger:a$1,title:l,description:D,size:W="lg",hideTitle:c,hideDescription:k,hideCloseButton:N,...x},B)=>{let s=useRef(null),u=useRef(),e=modal();return useEffect(()=>{if(!s.current)return;s.current.getRootNode().nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(u.current=s.current.getRootNode());},[]),jsxs(Root,{open:r,onOpenChange:n,children:[jsx(Trigger,{ref:s,asChild:!0,children:a$1??jsx("div",{"aria-hidden":!0,className:e.hidden})}),jsx(Portal,{container:u.current,children:jsx(M,{onWheel:d=>d.stopPropagation(),onTouchMove:d=>d.stopPropagation(),children:jsx(C,{ref:B,...x,children:jsxs(a,{size:W,children:[!c||!N?jsxs("div",{className:e.header,children:[jsx(Title,{className:e.title,"data-hidden":c,children:l}),!N&&jsx(Close,{className:e.close,children:jsx(CloseIcon,{height:16,width:16})})]}):jsx(Title,{className:e.title,"data-hidden":c,children:l}),jsxs("div",{className:e.cardContent,children:[jsx(Description,{className:e.description,"data-hidden":k,children:D}),t]})]})})})})]})});T.displayName="Modal";var _={Root:Root,Trigger:Trigger,Portal:Portal,Close:Close,Overlay:M,Content:C,Title:Title,Description:Description};

export { T as a, _ as b };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=chunk-STMS6J6O.js.map