UNPKG

@financial-times/o3-tooltip

Version:

Provides a viewport-aware tooltip for annotating or or highlighting other aspects of a product's UI

35 lines (32 loc) 765 B
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _jsxruntime = require('react/jsx-runtime'); var _react = require('react'); function TooltipOnboarding({ id, targetId, placement = "top", content, title, contentId, onClose }) { const ref = _react.useRef.call(void 0, null); _react.useEffect.call(void 0, () => { if (!ref.current) return; ref.current.onClose = onClose; }, [onClose]); return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "o3-tooltip-onboarding", { id, ref, role: "tooltip", placement, "target-id": targetId, class: "o3-tooltip", content, title, "content-id": contentId } ); } exports.TooltipOnboarding = TooltipOnboarding;