visits-style 1.4.16 → 1.4.17

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.
@@ -1,4 +1,5 @@
1
- import React, { MutableRefObject } from 'react';
1
+ import React from 'react';
2
+ import type { MutableRefObject } from 'react';
2
3
  import type { Placement, ReferenceElement } from '@floating-ui/core';
3
4
  import { ColorType } from '../../types';
4
5
  export interface TooltipRef {
package/dist/index.cjs.js CHANGED
@@ -719,6 +719,11 @@ const Tooltip$1 = React.forwardRef(({
719
719
  open: () => setOpen(true),
720
720
  close: () => setOpen(false)
721
721
  }));
722
+ React.useEffect(() => {
723
+ if (!disabled)
724
+ return;
725
+ setOpen(false);
726
+ }, [disabled]);
722
727
  const child = typeof children === "string" ? /* @__PURE__ */ jsxRuntime.jsx("span", { children }) : children;
723
728
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
724
729
  React.cloneElement(React.Children.only(child), {
package/dist/index.es.js CHANGED
@@ -711,6 +711,11 @@ const Tooltip$1 = forwardRef(({
711
711
  open: () => setOpen(true),
712
712
  close: () => setOpen(false)
713
713
  }));
714
+ useEffect(() => {
715
+ if (!disabled)
716
+ return;
717
+ setOpen(false);
718
+ }, [disabled]);
714
719
  const child = typeof children === "string" ? /* @__PURE__ */ jsx("span", { children }) : children;
715
720
  return /* @__PURE__ */ jsxs(Fragment, { children: [
716
721
  cloneElement(Children.only(child), {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "visits-style",
3
3
  "repository": "https://github.com/visits-works/visits-style",
4
4
  "homepage": "https://github.com/visits-works/visits-style",
5
- "version": "1.4.16",
5
+ "version": "1.4.17",
6
6
  "type": "module",
7
7
  "main": "./dist/index.cjs.js",
8
8
  "module": "./dist/index.es.js",
@@ -24,7 +24,7 @@
24
24
  "styled-components": ">=6.0.5"
25
25
  },
26
26
  "dependencies": {
27
- "@floating-ui/react": "^0.27.3",
27
+ "@floating-ui/react": "^0.27.8",
28
28
  "polished": "^4.3.1"
29
29
  }
30
30
  }