UNPKG

@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) 966 B
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("notistack"),a=require("@mui/material/Alert"),i=require("@mui/material/AlertTitle");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(a),n=l(i);const o="NexusSnackbarAlert",c=t.forwardRef(((t,a)=>{const{id:i,message:l,variant:c="info",title:d,description:u,icon:f,action:m,enableClose:x,alertProps:p,alertTitleProps:v,sx:b}=t;return e.jsx(r.SnackbarContent,{ref:a,role:"alert",className:`${o}-root`,children:e.jsxs(s.default,{sx:[{width:"100%"},...Array.isArray(b)?b:[b]],elevation:6,variant:"filled",icon:f,severity:c,action:m,onClose:x?(e,t)=>{"clickaway"!==t&&r.closeSnackbar(i)}:void 0,className:`${o}-${c}`,"data-testid":`${o}-${c}`,...p,children:[d&&("string"==typeof d?e.jsx(n.default,{className:`${o}-title`,"data-testid":`${o}-title`,...v,children:d}):d),u||l]})},i)}));exports.SnackbarAlert=c;