@mezzanine-ui/react 0.13.2 → 0.13.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.
package/Modal/Modal.js
CHANGED
|
@@ -11,13 +11,13 @@ import cx from 'clsx';
|
|
|
11
11
|
* The react component for `mezzanine` modal.
|
|
12
12
|
*/
|
|
13
13
|
const Modal = forwardRef(function Modal(props, ref) {
|
|
14
|
-
const { children, className, container, disableCloseOnBackdropClick = false, disableCloseOnEscapeKeyDown = false, disablePortal = false, fullScreen = false, hideBackdrop = false, hideCloseIcon = false, invisibleBackdrop = false, loading = false, onBackdropClick, onClose, open, severity = 'info', size = 'medium', ...rest } = props;
|
|
14
|
+
const { children, className, container, direction = 'down', disableCloseOnBackdropClick = false, disableCloseOnEscapeKeyDown = false, disablePortal = false, fullScreen = false, hideBackdrop = false, hideCloseIcon = false, invisibleBackdrop = false, loading = false, onBackdropClick, onClose, open, severity = 'info', size = 'medium', ...rest } = props;
|
|
15
15
|
const modalControl = useMemo(() => ({
|
|
16
16
|
loading,
|
|
17
17
|
severity,
|
|
18
18
|
}), [loading, severity]);
|
|
19
19
|
const { Container: ModalContainer } = useModalContainer();
|
|
20
|
-
return (jsx(ModalControlContext.Provider, { value: modalControl, children: jsx(ModalContainer, { className: modalClasses.overlay, container: container, direction:
|
|
20
|
+
return (jsx(ModalControlContext.Provider, { value: modalControl, children: jsx(ModalContainer, { className: modalClasses.overlay, container: container, direction: direction, disableCloseOnBackdropClick: disableCloseOnBackdropClick, disableCloseOnEscapeKeyDown: disableCloseOnEscapeKeyDown, disablePortal: disablePortal, hideBackdrop: hideBackdrop, invisibleBackdrop: invisibleBackdrop, onBackdropClick: onBackdropClick, onClose: onClose, open: open, ref: ref, children: jsxs("div", { ...rest, className: cx(modalClasses.host, modalClasses.severity(severity), modalClasses.size(size), {
|
|
21
21
|
[modalClasses.fullScreen]: fullScreen,
|
|
22
22
|
[modalClasses.withCloseIcon]: !hideCloseIcon,
|
|
23
23
|
}, className), role: "dialog", children: [children, !hideCloseIcon && (jsx(Icon, { className: modalClasses.closeIcon, icon: TimesIcon, onClick: onClose }))] }) }) }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { overlayWithSlideFadeClasses } from '@mezzanine-ui/core/_internal/overlay-with-slide-fade';
|
|
3
|
-
import { forwardRef, useState,
|
|
3
|
+
import { forwardRef, useState, useEffect } from 'react';
|
|
4
4
|
import { useDocumentEscapeKeyDown } from '../../hooks/useDocumentEscapeKeyDown.js';
|
|
5
5
|
import { lockBodyScroll, allowBodyScroll } from '../../utils/scroll-lock.js';
|
|
6
6
|
import useTopStack from './useTopStack.js';
|
|
@@ -35,7 +35,7 @@ const SlideFadeOverlay = forwardRef(function SlideFadeOverlay(props, ref) {
|
|
|
35
35
|
onClose,
|
|
36
36
|
]);
|
|
37
37
|
/** lock body scroll */
|
|
38
|
-
|
|
38
|
+
useEffect(() => {
|
|
39
39
|
if (open) {
|
|
40
40
|
lockBodyScroll();
|
|
41
41
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mezzanine-ui/react",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.4",
|
|
4
4
|
"description": "React components for mezzanine-ui",
|
|
5
5
|
"author": "Mezzanine",
|
|
6
6
|
"repository": {
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"react-dom": "^18.2.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@mezzanine-ui/core": "^0.13.
|
|
35
|
-
"@mezzanine-ui/icons": "^0.13.
|
|
36
|
-
"@mezzanine-ui/system": "^0.13.
|
|
34
|
+
"@mezzanine-ui/core": "^0.13.4",
|
|
35
|
+
"@mezzanine-ui/icons": "^0.13.4",
|
|
36
|
+
"@mezzanine-ui/system": "^0.13.4",
|
|
37
37
|
"@popperjs/core": "^2.11.6",
|
|
38
38
|
"@types/react-transition-group": "^4.4.5",
|
|
39
39
|
"clsx": "^1.2.1",
|
|
@@ -44,7 +44,17 @@
|
|
|
44
44
|
"tslib": "^2.4.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
+
"@babel/core": "^7.20.2",
|
|
48
|
+
"@react-theming/storybook-addon": "^1.1.10",
|
|
49
|
+
"@storybook/addon-actions": "^6.5.13",
|
|
50
|
+
"@storybook/addon-essentials": "^6.5.13",
|
|
51
|
+
"@storybook/addon-links": "^6.5.13",
|
|
52
|
+
"@storybook/addon-storysource": "^6.5.13",
|
|
53
|
+
"@storybook/builder-webpack5": "^6.5.13",
|
|
54
|
+
"@storybook/cli": "^6.5.13",
|
|
55
|
+
"@storybook/manager-webpack5": "^6.5.13",
|
|
47
56
|
"@storybook/react": "^6.5.13",
|
|
57
|
+
"@storybook/storybook-deployer": "^2.8.16",
|
|
48
58
|
"@testing-library/react": "^13.4.0",
|
|
49
59
|
"@testing-library/react-hooks": "^8.0.1",
|
|
50
60
|
"@types/lodash": "^4.14.188",
|
|
@@ -56,9 +66,11 @@
|
|
|
56
66
|
"chromatic": "^6.11.4",
|
|
57
67
|
"dayjs": "^1.11.6",
|
|
58
68
|
"lodash": "^4.17.21",
|
|
69
|
+
"luxon": "^3.4.3",
|
|
59
70
|
"moment": "^2.29.4",
|
|
60
71
|
"react": "^18.2.0",
|
|
61
72
|
"react-dom": "^18.2.0",
|
|
62
|
-
"react-test-renderer": "^18.2.0"
|
|
73
|
+
"react-test-renderer": "^18.2.0",
|
|
74
|
+
"storybook-addon-sass-postcss": "^0.1.3"
|
|
63
75
|
}
|
|
64
76
|
}
|