@aristobyte-ui/utils 2.15.2 → 2.16.2
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/README.md +2 -0
- package/es/.tsbuildinfo +1 -1
- package/es/helpers/Portal.d.ts +1 -1
- package/es/helpers/Portal.js +5 -4
- package/es/helpers/ripple.js +2 -1
- package/lib/.tsbuildinfo +1 -1
- package/lib/helpers/Portal.d.ts +1 -1
- package/lib/helpers/Portal.js +3 -2
- package/lib/helpers/ripple.js +2 -1
- package/package.json +1 -1
package/es/helpers/Portal.d.ts
CHANGED
package/es/helpers/Portal.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
var __read = (this && this.__read) || function (o, n) {
|
|
3
3
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
4
|
if (!m) return o;
|
|
@@ -15,15 +15,16 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
15
15
|
}
|
|
16
16
|
return ar;
|
|
17
17
|
};
|
|
18
|
-
import * as React from
|
|
19
|
-
import { createPortal } from
|
|
18
|
+
import * as React from 'react';
|
|
19
|
+
import { createPortal } from 'react-dom';
|
|
20
20
|
export var Portal = function (_a) {
|
|
21
21
|
var children = _a.children;
|
|
22
22
|
var _b = __read(React.useState(false), 2), mounted = _b[0], setMounted = _b[1];
|
|
23
23
|
React.useEffect(function () {
|
|
24
24
|
setMounted(true);
|
|
25
25
|
}, []);
|
|
26
|
-
if (!mounted || typeof window ===
|
|
26
|
+
if (!mounted || typeof window === 'undefined') {
|
|
27
27
|
return null;
|
|
28
|
+
}
|
|
28
29
|
return createPortal(children, document.body);
|
|
29
30
|
};
|
package/es/helpers/ripple.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export var renderRipple = function (_a) {
|
|
2
2
|
var ref = _a.ref, clientX = _a.clientX, clientY = _a.clientY;
|
|
3
3
|
var button = ref.current;
|
|
4
|
-
if (!button)
|
|
4
|
+
if (!button) {
|
|
5
5
|
return;
|
|
6
|
+
}
|
|
6
7
|
var circle = document.createElement('span');
|
|
7
8
|
var diameter = Math.max(button.clientWidth, button.clientHeight);
|
|
8
9
|
var radius = diameter / 2;
|