UNPKG

@payfit/unity-components

Version:

31 lines (30 loc) 1.1 kB
import { Button as e } from "../button/Button.js"; import { forwardRef as t } from "react"; import { jsx as n, jsxs as r } from "react/jsx-runtime"; import { Button as i } from "react-aria-components/Button"; import { Tooltip as a, TooltipTrigger as o } from "react-aria-components/Tooltip"; //#region src/components/tooltip/Tooltip.tsx var s = (t) => t.type === e || t.type === i, c = { short: [100, 150], standard: [150, 200], long: [200, 300], "very-long": [300, 400] }, l = t(({ title: e, children: t, duration: i = "standard" }, l) => { let [u, d] = c[i]; return /* @__PURE__ */ r(o, { delay: u, closeDelay: d, children: [t, /* @__PURE__ */ n(a, { ref: l, "data-dd-privacy": "allow", offset: s(t) ? 6 : 8, className: "uy:inline-flex uy:rounded-50 uy:pl-100 uy:pr-100 uy:pt-50 uy:pb-50 uy:bg-grayscale-l12 uy:max-w-[300px] uy:shadow-100", children: /* @__PURE__ */ n("p", { className: "uy:typography-body-small uy:text-content-inverted uy:overflow-hidden uy:text-ellipsis uy:line-clamp-3", children: e }) })] }); }); //#endregion export { l as Tooltip };