'use client';'use strict';

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

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