import { j as jsxRuntimeExports } from '../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js';
import { Provider as $a093c7e1ec25a057$export$2881499e37b75b9a, Root as $a093c7e1ec25a057$export$be92b6f5f03c0fe9, Trigger as $a093c7e1ec25a057$export$41fb9f06171c75f4, Portal as $a093c7e1ec25a057$export$602eac185826482c, Content as $a093c7e1ec25a057$export$7c6e2c02157bb7d2, Arrow as $a093c7e1ec25a057$export$21b07c8f274aebd5 } from '../../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.js';
import { cva } from '../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js';
import { Text } from '../text/text.js';
import styles from './tooltip.module.css.js';

const tooltip = cva(styles.content, {
    variants: {
        side: {
            top: styles["side-top"],
            right: styles["side-right"],
            bottom: styles["side-bottom"],
            left: styles["side-left"],
            "top-left": styles["side-top-left"],
            "top-right": styles["side-top-right"],
            "bottom-left": styles["side-bottom-left"],
            "bottom-right": styles["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) : (jsxRuntimeExports.jsx($a093c7e1ec25a057$export$2881499e37b75b9a, { delayDuration: delayDuration, skipDelayDuration: skipDelayDuration, children: jsxRuntimeExports.jsxs($a093c7e1ec25a057$export$be92b6f5f03c0fe9, { children: [jsxRuntimeExports.jsx($a093c7e1ec25a057$export$41fb9f06171c75f4, { asChild: asChild, children: jsxRuntimeExports.jsx("div", { className: styles.trigger, "aria-describedby": "tooltip", children: children }) }), jsxRuntimeExports.jsx($a093c7e1ec25a057$export$602eac185826482c, { children: jsxRuntimeExports.jsxs($a093c7e1ec25a057$export$7c6e2c02157bb7d2, { 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" ? (jsxRuntimeExports.jsx(Text, { children: message })) : (message), jsxRuntimeExports.jsx($a093c7e1ec25a057$export$21b07c8f274aebd5, { className: styles.arrow, width: 12, height: 6 })] }) })] }) }));
};
Tooltip.displayName = 'Tooltip';

export { Tooltip };
//# sourceMappingURL=tooltip.js.map
