import*as e from"react";import{InfoIcon as r,WarningIcon as t,CheckIcon as s}from"./icons.js";import{omitThemingProps as o}from"../../../system/dist/esm/system.utils.js";import{createContext as a}from"../../../react-utils/dist/esm/context.js";import{forwardRef as n}from"../../../system/dist/esm/forward-ref.js";import{useMultiStyleConfig as c}from"../../../system/dist/esm/use-style-config.js";import{StylesProvider as i,useStyles as l}from"../../../system/dist/esm/providers.js";import{chakra as m}from"../../../system/dist/esm/system.js";import{cx as f}from"../../../utils/dist/esm/dom.js";function u(){return(u=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e}).apply(this,arguments)}var d={info:{icon:r,colorScheme:"blue"},warning:{icon:t,colorScheme:"orange"},success:{icon:s,colorScheme:"green"},error:{icon:t,colorScheme:"red"}},[p,h]=a({name:"AlertContext",errorMessage:"useAlertContext: `context` is undefined. Seems you forgot to wrap alert components in `<Alert />`"}),v=n(((r,t)=>{var s,a=o(r),{status:n="info"}=a,l=function(e,r){if(null==e)return{};var t,s,o={},a=Object.keys(e);for(s=0;s<a.length;s++)t=a[s],r.indexOf(t)>=0||(o[t]=e[t]);return o}(a,["status"]),h=null!=(s=r.colorScheme)?s:d[n].colorScheme,v=c("Alert",u({},r,{colorScheme:h})),y=u({width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden"},v.container);return e.createElement(p,{value:{status:n}},e.createElement(i,{value:v},e.createElement(m.div,u({role:"alert",ref:t},l,{className:f("chakra-alert",r.className),__css:y}))))})),y=n(((r,t)=>{var s=l();return e.createElement(m.div,u({ref:t},r,{className:f("chakra-alert__title",r.className),__css:s.title}))})),_=n(((r,t)=>{var s=u({display:"inline"},l().description);return e.createElement(m.div,u({ref:t},r,{className:f("chakra-alert__desc",r.className),__css:s}))})),j=r=>{var{status:t}=h(),{icon:s}=d[t],o=l();return e.createElement(m.span,u({display:"inherit"},r,{className:f("chakra-alert__icon",r.className),__css:o.icon}),e.createElement(s,{w:"100%",h:"100%"}))};export{v as Alert,_ as AlertDescription,j as AlertIcon,y as AlertTitle};
//# sourceMappingURL=alert.js.map
