'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 utils = require('@onbeam/utils');
var jsxRuntime = require('react/jsx-runtime');

var i=react.forwardRef(({className:r,...n},p)=>{let s=recipes.tooltip();return jsxRuntime.jsx(reactTooltip.Content,{ref:p,className:css.cx(s.tooltip,r),...n})});i.displayName=reactTooltip.Content.displayName;var D=react.forwardRef(({label:r,width:n,children:p,disabled:s},C)=>{let l=utils.useHasTouch(),e=react.useRef(null),f=react.useRef(),[g,a]=react.useState(!1),h=recipes.tooltip();return react.useEffect(()=>{if(!e.current)return;e.current.getRootNode().nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(f.current=e.current.getRootNode());},[]),jsxRuntime.jsx(reactTooltip.Provider,{delayDuration:l?0:250,children:jsxRuntime.jsxs(reactTooltip.Root,{open:s?!1:g,onOpenChange:a,children:[jsxRuntime.jsx(reactTooltip.Trigger,{ref:e,asChild:!0,onClick:t=>{l&&(t.preventDefault(),a(!0));},children:p??jsxRuntime.jsx("button",{type:"button",className:h.icon,children:jsxRuntime.jsx(icons.TooltipIcon,{height:16,width:16})})}),jsxRuntime.jsx(reactTooltip.Portal,{container:f.current,children:jsxRuntime.jsx(i,{onWheel:t=>t.stopPropagation(),onTouchMove:t=>t.stopPropagation(),ref:C,style:{width:n},className:recipes.customScrollbar(),side:"bottom",sideOffset:4,children:r})})]})})});D.displayName="Tooltip";var A={Root:reactTooltip.Root,Trigger:reactTooltip.Trigger,Content:i,Provider:reactTooltip.Provider};

exports.a = D;
exports.b = A;
//# sourceMappingURL=out.js.map
//# sourceMappingURL=chunk-QDQKSSCJ.cjs.map