'use client';import { Content, Provider, Root, Trigger, Portal } from '@radix-ui/react-tooltip';
import { cx } from '@onbeam/styled-system/css';
import { forwardRef, useRef, useEffect } from 'react';
import { TooltipIcon } from '@onbeam/icons';
import { tooltip, customScrollbar } from '@onbeam/styled-system/recipes';
import { jsx, jsxs } from 'react/jsx-runtime';

var s=forwardRef(({className:r,...n},i)=>{let p=tooltip();return jsx(Content,{ref:i,className:cx(p.tooltip,r),...n})});s.displayName=Content.displayName;var h=forwardRef(({label:r,width:n,children:i,disabled:p},N)=>{let t=useRef(null),l=useRef(),R=tooltip();return useEffect(()=>{if(!t.current)return;t.current.getRootNode().nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(l.current=t.current.getRootNode());},[]),jsx(Provider,{delayDuration:250,children:jsxs(Root,{open:p?!1:void 0,children:[jsx(Trigger,{ref:t,asChild:!0,children:i??jsx("button",{type:"button",className:R.icon,children:jsx(TooltipIcon,{height:16,width:16})})}),jsx(Portal,{container:l.current,children:jsx(s,{onWheel:e=>e.stopPropagation(),onTouchMove:e=>e.stopPropagation(),ref:N,style:{width:n},className:customScrollbar(),side:"bottom",sideOffset:4,children:r})})]})})});h.displayName="Tooltip";var O={Root:Root,Trigger:Trigger,Content:s,Provider:Provider};

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