UNPKG

@atlaskit/tooltip

Version:

A tooltip briefly describes an interactive element on mouse hover or keyboard focus.

21 lines (20 loc) • 810 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DefaultRoleContext = void 0; exports.useDefaultRole = useDefaultRole; var _react = require("react"); /** * Internal. Sets the role `TooltipPrimitive` uses when it gets no `role` prop. * * The top-layer tooltip puts `role="tooltip"` on the Popover host and provides * `'presentation'` here, so a custom `component` that does not forward `role` * does not add a second `role="tooltip"`. `TooltipPrimitive` resets this to * `undefined` around its own children, so a primitive inside tooltip content * keeps the normal default. */ var DefaultRoleContext = exports.DefaultRoleContext = /*#__PURE__*/(0, _react.createContext)(undefined); function useDefaultRole() { return (0, _react.useContext)(DefaultRoleContext); }