import Tippy from "@tippyjs/react";
import React from "react";
import "tippy.js/dist/tippy.css";
import "tippy.js/themes/light-border.css";
import "tippy.js/animations/shift-away-subtle.css";
const Tooltip = (props) => {
    if (!props.text && !props.richContent) {
        return props.children;
    }
    const tooltipContent = props.richContent ? (props.richContent) : (React.createElement("span", null, props.text));
    const isRich = Boolean(props.richContent);
    const themeProps = isRich
        ? { theme: "light-border" }
        : {};
    const animationProps = isRich
        ? { animation: "shift-away-subtle" }
        : {};
    return (React.createElement(Tippy, Object.assign({ key: Math.random(), content: tooltipContent, interactive: isRich, trigger: "mouseenter focus", hideOnClick: false, maxWidth: isRich ? 380 : 350, delay: isRich ? [120, 80] : [0, 0], duration: [200, 150], placement: isRich ? "top" : "top" }, themeProps, animationProps, { aria: {
            content: "describedby",
            expanded: "auto",
        } }), props.children));
};
export default Tooltip;
//# sourceMappingURL=Tooltip.js.map