UNPKG

koval-ui

Version:

React components collection with minimalistic design. Supports theming, layout, and input validation.

31 lines (30 loc) 857 B
"use client"; import { jsx as p } from "react/jsx-runtime"; import { forwardRef as l, useMemo as n } from "react"; import u from "classnames"; import { useLocalTheme as h } from "css-vars-hook"; import { useLinkRefs as w } from "../../internal/hooks/useLinkRefs.js"; import o from "./Tooltip.module.css.js"; const R = l(({ placement: m, left: t, top: e }, i) => { const r = m.split("-")[0], { LocalRoot: f, ref: a } = h(), c = n(() => { const s = {}; return e && (s.top = e), t && (s.left = t), s; }, [t, e]); return w(i, a), /* @__PURE__ */ p( f, { theme: c, className: u(o.arrow, { [o.bottom]: r === "bottom", [o.left]: r === "left", [o.top]: r === "top", [o.right]: r === "right" }) } ); }); R.displayName = "Arrow"; export { R as Arrow }; //# sourceMappingURL=Arrow.js.map