@nexusui/components
Version:
These are custom components specially-developed for NexusUI applications. They will make your life easier by giving you out-of-the-box implementations for various high-level UI elements that you can drop directly into your application.
2 lines (1 loc) • 1.41 kB
JavaScript
;Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("@mui/material/Dialog"),i=require("@mui/material/DialogTitle"),s=require("@mui/material/DialogContent"),a=require("@mui/material/DialogActions"),o=require("./Dialog.styles.js"),l=require("../common/ActionsBar/ActionsBar.container.js");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=n(r),u=n(i),d=n(s),x=n(a);const m="NexusDialog";exports.DialogComponent=r=>{const{title:i,footer:s,children:a,DialogActionsProps:n={},DialogContentProps:g={},DialogTitleProps:p={},PaperProps:f={},sx:A,dividers:h=!1,onClose:D,leftActions:j=[],rightActions:y=[],maxWidth:q="sm",...P}=r,$=t.useMemo((()=>{const t=j.length+y.length;return!s&&t<1?null:e.jsx(x.default,{"data-testid":`${m}-actions`,className:`${m}-actions`,sx:[...Array.isArray(n.sx)?n.sx:[n.sx]],...n,children:s||e.jsx(l.ActionsBar,{actions:{left:j,right:y}})})}),[n,s,j,y]);return e.jsxs(c.default,{"data-testid":`${m}-root`,className:`${m}-root`,onClose:D,sx:[o.default[".NexusDialog-root"],...Array.isArray(A)?A:[A]],PaperProps:{...f,className:`${m}-paper`,sx:[...Array.isArray(f.sx)?f.sx:[f.sx]]},maxWidth:q,...P,children:[i?e.jsx(u.default,{"data-testid":`${m}-title`,...p,children:i}):null,e.jsx(d.default,{"data-testid":`${m}-content`,className:`${m}-content`,dividers:h,...g,children:a}),$]})};