@cypress-design/react-tooltip 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -30341,7 +30341,7 @@ var ROTATE_MAP = {
30341
30341
  };
30342
30342
  var Tooltip = function (_a) {
30343
30343
  var _b;
30344
- var placement = _a.placement, _c = _a.color, color = _c === void 0 ? 'light' : _c, className = _a.className, children = _a.children, popper = _a.popper, rest = __rest(_a, ["placement", "color", "className", "children", "popper"]);
30344
+ var placement = _a.placement, _c = _a.color, color = _c === void 0 ? 'light' : _c, className = _a.className, children = _a.children, popper = _a.popper, disabled = _a.disabled, rest = __rest(_a, ["placement", "color", "className", "children", "popper", "disabled"]);
30345
30345
  var arrowRef = React__namespace.useRef(null);
30346
30346
  var _d = React__namespace.useState(false), open = _d[0], setOpen = _d[1];
30347
30347
  var container = React__namespace.useState(function () {
@@ -30364,9 +30364,12 @@ var Tooltip = function (_a) {
30364
30364
  }), x = _e.x, y = _e.y, reference = _e.reference, floating = _e.floating, strategy = _e.strategy, calculatedPlacement = _e.placement, context = _e.context, _f = _e.middlewareData.arrow, _g = _f === void 0 ? {} : _f, arrowX = _g.x, arrowY = _g.y;
30365
30365
  var _h = useInteractions([
30366
30366
  useHover(context, {
30367
- handleClose: safePolygon()
30367
+ handleClose: safePolygon(),
30368
+ enabled: !disabled
30369
+ }),
30370
+ useFocus(context, {
30371
+ enabled: !disabled
30368
30372
  }),
30369
- useFocus(context),
30370
30373
  useRole(context, { role: 'tooltip' }),
30371
30374
  useDismiss(context),
30372
30375
  ]), getReferenceProps = _h.getReferenceProps, getFloatingProps = _h.getFloatingProps;
@@ -30387,7 +30390,7 @@ var Tooltip = function (_a) {
30387
30390
  }
30388
30391
  return (React__namespace.createElement(React__namespace.Fragment, null,
30389
30392
  React__namespace.createElement("div", __assign({}, getReferenceProps(), { ref: reference, className: className }, rest), children),
30390
- React__namespace.createElement(FloatingPortal, null, open && (React__namespace.createElement("div", __assign({}, getFloatingProps({
30393
+ React__namespace.createElement(FloatingPortal, null, open && !disabled && (React__namespace.createElement("div", __assign({}, getFloatingProps({
30391
30394
  ref: floating,
30392
30395
  style: {
30393
30396
  position: strategy,
@@ -30420,4 +30423,6 @@ var Tooltip = function (_a) {
30420
30423
  };
30421
30424
 
30422
30425
  module.exports = Tooltip;
30426
+ /* <windicss-keep class="container absolute stroke-gray-800 fill-gray-900 stroke-gray-100 fill-white rounded shadow border p-8px text-16px leading-24px min-w-160px text-center bg-gray-900 shadow-gray-800 border-gray-800 bg-white shadow-gray-100 border-gray-100 invisible"> */
30427
+
30423
30428
  //# sourceMappingURL=index.umd.js.map