@team-monolith/cds 0.18.1 → 0.18.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.
|
@@ -33,10 +33,13 @@ import shadows from "../../foundation/shadows";
|
|
|
33
33
|
import styled from "@emotion/styled";
|
|
34
34
|
import { MOBILE } from "../../foundation/breakpoints";
|
|
35
35
|
import AlertDialogContext from "./AlertDialogContext";
|
|
36
|
+
import { ZINDEX } from "../../utils/zIndex";
|
|
36
37
|
export var AlertDialog = React.forwardRef(function AlertDialog(props, ref) {
|
|
37
38
|
var className = props.className, _a = props.component, Component = _a === void 0 ? "div" : _a, open = props.open, onClose = props.onClose, children = props.children, icon = props.icon, other = __rest(props, ["className", "component", "open", "onClose", "children", "icon"]);
|
|
38
39
|
var theme = useTheme();
|
|
39
|
-
return (_jsx(MuiModal, __assign({ open: open, onClose: onClose, ref: ref
|
|
40
|
+
return (_jsx(MuiModal, __assign({ open: open, onClose: onClose, ref: ref, sx: {
|
|
41
|
+
zIndex: ZINDEX.ALERT,
|
|
42
|
+
} }, other, { children: _jsxs(Component, __assign({ className: className, css: css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: 480px;\n background: ", ";\n box-shadow: ", ";\n border-radius: 16px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n padding: 24px;\n box-sizing: border-box;\n\n display: grid;\n ", "\n\n gap: 8px 16px;\n\n ", "\n "], ["\n width: 480px;\n background: ", ";\n box-shadow: ", ";\n border-radius: 16px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n padding: 24px;\n box-sizing: border-box;\n\n display: grid;\n ", "\n\n gap: 8px 16px;\n\n ", "\n "])), theme.color.background.neutralBase, shadows.shadow04, icon
|
|
40
43
|
? css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n grid-template-columns: 32px 1fr;\n grid-template-areas:\n \"icon title\"\n \"iconPadding content\"\n \"actions actions\";\n "], ["\n grid-template-columns: 32px 1fr;\n grid-template-areas:\n \"icon title\"\n \"iconPadding content\"\n \"actions actions\";\n "]))) : css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n grid-template-areas:\n \"title\"\n \"content\"\n \"actions\";\n "], ["\n grid-template-areas:\n \"title\"\n \"content\"\n \"actions\";\n "]))), MOBILE(css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: calc(100% - 24px);\n grid-template-columns: auto;\n grid-template-areas:\n \"title\"\n \"content\"\n \"actions\";\n "], ["\n width: calc(100% - 24px);\n grid-template-columns: auto;\n grid-template-areas:\n \"title\"\n \"content\"\n \"actions\";\n "]))))) }, { children: [icon && _jsx(IconDiv, { children: icon }), _jsx(AlertDialogContext.Provider, __assign({ value: { icon: icon } }, { children: children }))] })) })));
|
|
41
44
|
});
|
|
42
45
|
var IconDiv = styled.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n grid-area: icon;\n ", "\n svg {\n width: 32px;\n height: 32px;\n }\n\n ", "\n"], ["\n display: flex;\n justify-content: center;\n align-items: center;\n grid-area: icon;\n ", "\n svg {\n width: 32px;\n height: 32px;\n }\n\n ", "\n"])), function (_a) {
|