UNPKG

@pantheon-systems/design-toolkit-react

Version:
37 lines (34 loc) 939 B
import Tippy from '@tippyjs/react'; import PropTypes from 'prop-types'; import { DTIcon } from '../lib/customPropTypes.js'; import { jsx } from 'react/jsx-runtime'; var Tooltip = function Tooltip(_ref) { var children = _ref.children, label = _ref.label; return /*#__PURE__*/jsx(Tippy, { animation: "fade", arrow: true, content: label, interactive: true, placement: "bottom", children: /*#__PURE__*/jsx("span", { className: "inline-block text-gray-4 focus:text-gray-6 hover:text-gray-6", "data-testid": "tooltip-span", tabIndex: "0", children: children }) }); }; Tooltip.propTypes = { /** * Tooltip trigger. Icon to hover or focus on to show tooltip. */ children: DTIcon.isRequired, /** * Text within tooltip. */ label: PropTypes.string.isRequired }; var Tooltip$1 = Tooltip; export { Tooltip$1 as default }; //# sourceMappingURL=Tooltip_DEPRECATED.js.map