@loomhq/lens 10.32.3 → 10.32.4
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.
|
@@ -15,7 +15,6 @@ import ReactDOM from 'react-dom';
|
|
|
15
15
|
import styled from '@emotion/styled';
|
|
16
16
|
import { unit } from '../../variables';
|
|
17
17
|
import { useTransition } from 'transition-hook';
|
|
18
|
-
const duration = 200;
|
|
19
18
|
const placements = {
|
|
20
19
|
topLeft: 'top-start',
|
|
21
20
|
topCenter: 'top',
|
|
@@ -41,7 +40,7 @@ const Popover = (_a) => {
|
|
|
41
40
|
const unitOffset = offset * unit;
|
|
42
41
|
const unitBoundaryOffset = boundaryOffset * unit;
|
|
43
42
|
const [bodyElement, setBodyElement] = useState(null);
|
|
44
|
-
const { stage
|
|
43
|
+
const { stage } = useTransition(isOpen, transitionDuration);
|
|
45
44
|
useEffect(() => {
|
|
46
45
|
setBodyElement(document === null || document === void 0 ? void 0 : document.querySelector('body'));
|
|
47
46
|
}, []);
|
|
@@ -104,7 +103,7 @@ const Popover = (_a) => {
|
|
|
104
103
|
};
|
|
105
104
|
return (React.createElement(Wrapper, Object.assign({ ref: reference }, props),
|
|
106
105
|
children,
|
|
107
|
-
|
|
106
|
+
isOpen && (React.createElement(React.Fragment, null,
|
|
108
107
|
!rootNode && (React.createElement(ContentWrapper, Object.assign({}, contentProps), content)),
|
|
109
108
|
rootNode &&
|
|
110
109
|
ReactDOM.createPortal(React.createElement(ContentWrapper, Object.assign({}, contentProps), content), rootNode)))));
|