synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
103 lines (102 loc) • 2.35 kB
JavaScript
import { jsxs as a, jsx as o } from "react/jsx-runtime";
import { spreadSx as B } from "../theme/spreadSx.js";
import f from "@mui/icons-material/Close";
import { Dialog as C, DialogContent as D, DialogActions as T, DialogTitle as w, Stack as E, Box as s, IconButton as P } from "@mui/material";
import { HelpPopover as S } from "./HelpPopover/HelpPopover.js";
const L = {}, O = "close", _ = { color: "grey.700" };
function k({
sx: t = _,
onClick: e
}) {
return /* @__PURE__ */ o(P, { sx: t, onClick: e, "aria-label": O, children: /* @__PURE__ */ o(f, {}) });
}
function v(t) {
const {
title: e,
titleHelpPopoverProps: r,
hasCloseButton: i = !0,
onCancel: n
} = t;
return /* @__PURE__ */ o(w, { children: /* @__PURE__ */ a(
E,
{
direction: "row",
sx: {
alignItems: "center",
gap: "5px"
},
children: [
e,
/* @__PURE__ */ o(
s,
{
component: "span",
sx: {
fontSize: "14px"
},
children: r && /* @__PURE__ */ o(S, { ...r })
}
),
/* @__PURE__ */ o(s, { sx: { flexGrow: 1 } }),
i && /* @__PURE__ */ o(k, { onClick: () => n() })
]
}
) });
}
const b = ({
open: t,
title: e,
content: r,
actions: i,
className: n,
onCancel: l,
hasCloseButton: c,
titleHelpPopoverProps: p,
maxWidth: m = "sm",
fullWidth: g = !0,
sx: d,
contentProps: x = L,
DialogProps: h
}) => /* @__PURE__ */ a(
C,
{
fullWidth: g,
maxWidth: m,
open: t,
className: n,
onClose: () => l(),
sx: B(d, (u) => ({
[u.breakpoints.down("sm")]: {
width: "100vw",
".MuiDialog-container > .MuiPaper-root": {
padding: "33px",
margin: 0,
width: "100%",
height: "100%",
maxHeight: "unset"
}
}
})),
...h,
children: [
/* @__PURE__ */ o(
v,
{
title: e,
titleHelpPopoverProps: p,
hasCloseButton: c,
onCancel: l
}
),
/* @__PURE__ */ o(D, { ...x, children: r }),
i && /* @__PURE__ */ o(T, { children: i })
]
}
);
export {
O as CLOSE_BUTTON_LABEL,
k as CloseButton,
b as DialogBase,
v as DialogBaseTitle
};
//# sourceMappingURL=DialogBase.js.map