visits-style 1.4.15 → 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
|
|
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.
|
|
5
|
+
"version": "1.4.17",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.cjs.js",
|
|
8
8
|
"module": "./dist/index.es.js",
|
|
@@ -18,17 +18,13 @@
|
|
|
18
18
|
"files": [
|
|
19
19
|
"dist"
|
|
20
20
|
],
|
|
21
|
-
"engines": {
|
|
22
|
-
"node": ">=18"
|
|
23
|
-
},
|
|
24
21
|
"peerDependencies": {
|
|
25
22
|
"react": ">=18.2.0",
|
|
26
23
|
"react-dom": ">=18.2.0",
|
|
27
24
|
"styled-components": ">=6.0.5"
|
|
28
25
|
},
|
|
29
26
|
"dependencies": {
|
|
30
|
-
"@floating-ui/react": "^0.
|
|
31
|
-
"eslint-config-react-app": "^7.0.1",
|
|
27
|
+
"@floating-ui/react": "^0.27.8",
|
|
32
28
|
"polished": "^4.3.1"
|
|
33
29
|
}
|
|
34
30
|
}
|