@ndlib/component-library 0.0.44 → 0.0.45
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.
|
@@ -23,7 +23,7 @@ import { useMediaQuery } from '../../providers/media';
|
|
|
23
23
|
import { useComponentConfig } from '../../providers/componentConfig';
|
|
24
24
|
const ReactModal = importedDefaultComponentShim(_ReactModal);
|
|
25
25
|
export const Modal = (_a) => {
|
|
26
|
-
var { children, heading, hideHeading, isOpen, footer, actions, wrapWithTheme, close } = _a, props = __rest(_a, ["children", "heading", "hideHeading", "isOpen", "footer", "actions", "wrapWithTheme", "close"]);
|
|
26
|
+
var { children, heading, hideHeading, isOpen, footer, actions, wrapWithTheme, close, zIndex } = _a, props = __rest(_a, ["children", "heading", "hideHeading", "isOpen", "footer", "actions", "wrapWithTheme", "close", "zIndex"]);
|
|
27
27
|
const { breakpoint } = useMediaQuery();
|
|
28
28
|
const { modal } = useComponentConfig();
|
|
29
29
|
const theme = useTheme();
|
|
@@ -37,8 +37,6 @@ export const Modal = (_a) => {
|
|
|
37
37
|
e.stopPropagation();
|
|
38
38
|
close(e);
|
|
39
39
|
} }, { children: "Close" }))] }))), _jsx(Row, Object.assign({ sx: { p: 3 } }, { children: children })), shouldShowFooter && (_jsxs(Row, Object.assign({ sx: { borderTop: 'solid 1px', borderColor: COLOR.LIGHT_GRAY, p: 3 } }, { children: [footer, actions !== undefined && (_jsx(Row, Object.assign({ sx: { width: '100%', justifyContent: 'flex-end' } }, { children: actions.map((action, index) => (_jsx(Button, Object.assign({ type: action.isPrimary ? BUTTON_TYPE.DEFAULT : BUTTON_TYPE.OUTLINE, onClick: (e) => {
|
|
40
|
-
e.preventDefault();
|
|
41
|
-
e.stopPropagation();
|
|
42
40
|
action.onClick(e);
|
|
43
41
|
}, sx: {
|
|
44
42
|
mr: index < actions.length - 1 ? 1 : 0,
|
|
@@ -50,7 +48,7 @@ export const Modal = (_a) => {
|
|
|
50
48
|
} }, props, { style: {
|
|
51
49
|
overlay: {
|
|
52
50
|
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
53
|
-
zIndex: theme.zIndex.MODAL,
|
|
51
|
+
zIndex: zIndex || theme.zIndex.MODAL,
|
|
54
52
|
},
|
|
55
53
|
content: {
|
|
56
54
|
padding: 0,
|