UNPKG

@cerberus-design/react

Version:

The Cerberus Design React component library.

23 lines (18 loc) 909 B
'use strict'; Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const jsxRuntime = require('react/jsx-runtime'); const parts = require('./parts.cjs'); function Tooltip(props) { const { content, children, ...rootProps } = props; const position = { placement: props.positioning || "top" }; return /* @__PURE__ */ jsxRuntime.jsxs(parts.TooltipParts.Root, { openDelay: 400, positioning: position, ...rootProps, children: [ /* @__PURE__ */ jsxRuntime.jsx(parts.TooltipParts.Trigger, { asChild: true, children }), /* @__PURE__ */ jsxRuntime.jsx(parts.TooltipParts.Positioner, { children: /* @__PURE__ */ jsxRuntime.jsxs(parts.TooltipParts.Content, { children: [ /* @__PURE__ */ jsxRuntime.jsx(parts.TooltipParts.Arrow, { children: /* @__PURE__ */ jsxRuntime.jsx(parts.TooltipParts.ArrowTip, {}) }), content ] }) }) ] }); } exports.Tooltip = Tooltip;