@cerberus-design/react
Version:
The Cerberus Design React component library.
19 lines (16 loc) • 714 B
JavaScript
import { jsxs, jsx } from 'react/jsx-runtime';
import { TooltipParts } from './parts.js';
function Tooltip(props) {
const { content, children, ...rootProps } = props;
const position = {
placement: props.positioning || "top"
};
return /* @__PURE__ */ jsxs(TooltipParts.Root, { openDelay: 400, positioning: position, ...rootProps, children: [
/* @__PURE__ */ jsx(TooltipParts.Trigger, { asChild: true, children }),
/* @__PURE__ */ jsx(TooltipParts.Positioner, { children: /* @__PURE__ */ jsxs(TooltipParts.Content, { children: [
/* @__PURE__ */ jsx(TooltipParts.Arrow, { children: /* @__PURE__ */ jsx(TooltipParts.ArrowTip, {}) }),
content
] }) })
] });
}
export { Tooltip };