@jobber/components 6.100.0 → 6.100.1-prevent-ra-8430a42.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/dist/Menu-cjs.js +10 -3
- package/dist/Menu-es.js +10 -3
- package/package.json +2 -2
package/dist/Menu-cjs.js
CHANGED
|
@@ -317,9 +317,7 @@ function MenuContentComposable({ children, UNSAFE_style, UNSAFE_className, }) {
|
|
|
317
317
|
},
|
|
318
318
|
visible: { opacity: 1, y: 0 },
|
|
319
319
|
};
|
|
320
|
-
return (React.createElement(MotionMenu, { key: `menu-content
|
|
321
|
-
// placement is null on first render cycle, so we need to wait for it to be defined
|
|
322
|
-
animate: placement ? animation : false, transition: Object.assign({}, MENU_ANIMATION_CONFIG), onAnimationComplete: animationState => {
|
|
320
|
+
return (React.createElement(MotionMenu, { key: `motion-menu-content`, className: classnames(styles.menu, styles.ariaMenu, UNSAFE_className), style: UNSAFE_style, variants: variants, initial: "hidden", animate: getAnimateValue(animation, placement), transition: Object.assign({}, MENU_ANIMATION_CONFIG), onAnimationComplete: animationState => {
|
|
323
321
|
setState(prev => animationState === "hidden" && prev === "hidden"
|
|
324
322
|
? "unmounted"
|
|
325
323
|
: prev);
|
|
@@ -327,6 +325,15 @@ function MenuContentComposable({ children, UNSAFE_style, UNSAFE_className, }) {
|
|
|
327
325
|
}),
|
|
328
326
|
isMobile && React.createElement(MenuMobileUnderlay, { animation: animation })));
|
|
329
327
|
}
|
|
328
|
+
function getAnimateValue(animation, placement) {
|
|
329
|
+
// placement is null on first render cycle, so we need to wait for it to be defined
|
|
330
|
+
// However, during exit animation, we should always animate to prevent race conditions in certain environments
|
|
331
|
+
if (placement)
|
|
332
|
+
return animation;
|
|
333
|
+
if (animation === "hidden")
|
|
334
|
+
return "hidden";
|
|
335
|
+
return false;
|
|
336
|
+
}
|
|
330
337
|
function MenuMobileUnderlay({ animation }) {
|
|
331
338
|
if (animation === "unmounted")
|
|
332
339
|
return null;
|
package/dist/Menu-es.js
CHANGED
|
@@ -315,9 +315,7 @@ function MenuContentComposable({ children, UNSAFE_style, UNSAFE_className, }) {
|
|
|
315
315
|
},
|
|
316
316
|
visible: { opacity: 1, y: 0 },
|
|
317
317
|
};
|
|
318
|
-
return (React__default.createElement(MotionMenu, { key: `menu-content
|
|
319
|
-
// placement is null on first render cycle, so we need to wait for it to be defined
|
|
320
|
-
animate: placement ? animation : false, transition: Object.assign({}, MENU_ANIMATION_CONFIG), onAnimationComplete: animationState => {
|
|
318
|
+
return (React__default.createElement(MotionMenu, { key: `motion-menu-content`, className: classnames(styles.menu, styles.ariaMenu, UNSAFE_className), style: UNSAFE_style, variants: variants, initial: "hidden", animate: getAnimateValue(animation, placement), transition: Object.assign({}, MENU_ANIMATION_CONFIG), onAnimationComplete: animationState => {
|
|
321
319
|
setState(prev => animationState === "hidden" && prev === "hidden"
|
|
322
320
|
? "unmounted"
|
|
323
321
|
: prev);
|
|
@@ -325,6 +323,15 @@ function MenuContentComposable({ children, UNSAFE_style, UNSAFE_className, }) {
|
|
|
325
323
|
}),
|
|
326
324
|
isMobile && React__default.createElement(MenuMobileUnderlay, { animation: animation })));
|
|
327
325
|
}
|
|
326
|
+
function getAnimateValue(animation, placement) {
|
|
327
|
+
// placement is null on first render cycle, so we need to wait for it to be defined
|
|
328
|
+
// However, during exit animation, we should always animate to prevent race conditions in certain environments
|
|
329
|
+
if (placement)
|
|
330
|
+
return animation;
|
|
331
|
+
if (animation === "hidden")
|
|
332
|
+
return "hidden";
|
|
333
|
+
return false;
|
|
334
|
+
}
|
|
328
335
|
function MenuMobileUnderlay({ animation }) {
|
|
329
336
|
if (animation === "unmounted")
|
|
330
337
|
return null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "6.100.
|
|
3
|
+
"version": "6.100.1-prevent-ra-8430a42.2+8430a42c1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -541,5 +541,5 @@
|
|
|
541
541
|
"> 1%",
|
|
542
542
|
"IE 10"
|
|
543
543
|
],
|
|
544
|
-
"gitHead": "
|
|
544
|
+
"gitHead": "8430a42c1017fccd43f11eb9572798558691afaa"
|
|
545
545
|
}
|