UNPKG

@atlaskit/tooltip

Version:

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

46 lines (45 loc) 1.53 kB
/* tooltip-primitive.tsx generated by @compiled/babel-plugin v3.0.2 */ import "./tooltip-primitive.compiled.css"; import * as React from 'react'; import { ax, ix } from "@compiled/react/runtime"; import { forwardRef } from 'react'; import { TooltipShortcut } from './tooltip-shortcut'; const primitiveStyles = null; /** * The lower level component for rendering a tooltip. */ const TooltipPrimitive = /*#__PURE__*/forwardRef(function TooltipPrimitive({ style, className, children, placement, testId, onMouseOut, onMouseOver, id, shortcut, role = 'tooltip' }, ref) { return /*#__PURE__*/React.createElement("div", { ref: ref, style: style, "data-testid": testId ? `${testId}--wrapper` : undefined }, /*#__PURE__*/React.createElement("div", { role: role // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766 , className: ax(["_80om73ad", className]) // Because the tooltip should not be focusable, there is no reason to have key events. /* eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events */, onMouseOut: onMouseOut /* eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events */, onMouseOver: onMouseOver, "data-placement": placement, "data-testid": testId, id: id }, children, shortcut && /*#__PURE__*/React.createElement(TooltipShortcut, { shortcut: shortcut }))); }); TooltipPrimitive.displayName = 'TooltipPrimitive'; export default TooltipPrimitive;