'use strict';

var jsxRuntime = require('../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.cjs');
var index = require('../../node_modules/.pnpm/@radix-ui_react-tooltip@1.0.7_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-tooltip/dist/index.cjs');
var index$1 = require('../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
var text = require('../text/text.cjs');
var tooltip_module = require('./tooltip.module.css.cjs');

const tooltip = index$1.cva(tooltip_module.default.content, {
    variants: {
        side: {
            top: tooltip_module.default["side-top"],
            right: tooltip_module.default["side-right"],
            bottom: tooltip_module.default["side-bottom"],
            left: tooltip_module.default["side-left"],
            "top-left": tooltip_module.default["side-top-left"],
            "top-right": tooltip_module.default["side-top-right"],
            "bottom-left": tooltip_module.default["side-bottom-left"],
            "bottom-right": tooltip_module.default["side-bottom-right"],
        }
    },
    defaultVariants: {
        side: "top"
    }
});
const Tooltip = ({ children, message, disabled, side = "top", className, delayDuration = 200, skipDelayDuration = 200, 'aria-label': ariaLabel, asChild = true, }) => {
    return disabled ? (children) : (jsxRuntime.jsxRuntimeExports.jsx(index.Provider, { delayDuration: delayDuration, skipDelayDuration: skipDelayDuration, children: jsxRuntime.jsxRuntimeExports.jsxs(index.Root, { children: [jsxRuntime.jsxRuntimeExports.jsx(index.Trigger, { asChild: asChild, children: jsxRuntime.jsxRuntimeExports.jsx("div", { className: tooltip_module.default.trigger, "aria-describedby": "tooltip", children: children }) }), jsxRuntime.jsxRuntimeExports.jsx(index.Portal, { children: jsxRuntime.jsxRuntimeExports.jsxs(index.Content, { id: "tooltip", role: "tooltip", "aria-label": ariaLabel || (typeof message === 'string' ? message : undefined), side: side?.split('-')[0] || 'top', align: (side?.includes('-') ? (side.split('-')[1] === 'left' ? 'start' : 'end') : 'center'), sideOffset: 4, className: tooltip({ side, className }), children: [typeof message === "string" ? (jsxRuntime.jsxRuntimeExports.jsx(text.Text, { children: message })) : (message), jsxRuntime.jsxRuntimeExports.jsx(index.Arrow, { className: tooltip_module.default.arrow, width: 12, height: 6 })] }) })] }) }));
};
Tooltip.displayName = 'Tooltip';

exports.Tooltip = Tooltip;
//# sourceMappingURL=tooltip.cjs.map
