import{j as e}from"./iframe-p4aYZyoq.js";import{c as d}from"./index-Dx18ixSn.js";import{S as h}from"./information-CdWOuYio.js";import{a as f,S as p,b as _}from"./success-DH0eGKjE.js";import{S as v}from"./times-DeY5Bu0x.js";const s="1.125em",y=({children:n,level:i="info",heading:l,subtitle:o,onDismiss:m,noIcon:r,noShadow:c,className:u,...g})=>{let a=null;const t=l?"message--icon-align-center":"message--icon-align-top";return r||(a=e.jsx(h,{width:s,height:s,className:t}),i==="warning"?a=e.jsx(f,{width:s,height:s,className:t}):i==="failure"?a=e.jsx(p,{width:s,height:s,className:t}):i==="success"&&(a=e.jsx(_,{width:s,height:s,className:t}))),e.jsxs("div",{className:d(u,"message",`message--${i}`,{"message--no-shadow":c}),role:"status",...g,children:[e.jsx("div",{className:"message__side-border"}),a,l?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:d("message__title",{"message__title--no-icon":r}),children:l}),e.jsx("div",{className:"message__text",children:n})]}):e.jsx("div",{className:"message__title",children:n}),m&&e.jsx("button",{type:"button","aria-label":"dismiss",className:"message__dismiss",onClick:m,children:e.jsx(v,{width:"10",height:"10"})}),o&&e.jsx("div",{className:"message__subtitle",children:o})]})};try{message.displayName="message",message.__docgenInfo={description:"",displayName:"message",props:{level:{defaultValue:{value:"info"},description:"The message level: 'warning', 'failure', 'success', 'info' (default)",name:"level",required:!1,type:{name:"enum",value:[{value:'"warning"'},{value:'"failure"'},{value:'"success"'},{value:'"info"'}]}},heading:{defaultValue:null,description:"The title of the message",name:"heading",required:!1,type:{name:"ReactNode"}},subtitle:{defaultValue:null,description:"The content to appear underneath of the main message",name:"subtitle",required:!1,type:{name:"ReactNode"}},onDismiss:{defaultValue:null,description:"Whether the message can be closed or not",name:"onDismiss",required:!1,type:{name:"((event: MouseEvent<Element, MouseEvent>) => void)"}},noIcon:{defaultValue:null,description:"To hide the default message icon",name:"noIcon",required:!1,type:{name:"boolean"}},noShadow:{defaultValue:null,description:"To hide the default box shadow",name:"noShadow",required:!1,type:{name:"boolean"}}}}}catch{}export{y as M};
