import{defineProperty as o}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as t,jsx as c}from"react/jsx-runtime";import{useMemo as e}from"react";import n from"classnames";import i from"../Icon/Icon.js";import a from"../IconButton/IconButton.js";import s from"../Icon/Icons/components/CloseSmall.js";import r from"../Icon/Icons/components/Alert.js";import{IconType as l}from"../Icon/IconConstants.js";import{backwardCompatibilityForProperties as m}from"../../helpers/backwardCompatibilityForProperties.js";import{AttentionBoxType as p}from"./AttentionBoxConstants.js";import"./AttentionBox.scss.js";import _ from"../Heading/Heading.js";import d from"../Flex/Flex.js";var u="l3-style-attention-box-component",f=function l(f){var j,y=f.className,v=f.componentClassName,I=f.withIconWithoutHeader,b=void 0!==I&&I,C=f.type,N=void 0===C?l.types.PRIMARY:C,g=f.icon,x=void 0===g?r:g,S=f.iconType,h=void 0===S?i.type.SVG:S,A=f.title,R=f.text,O=f.withoutIcon,T=void 0!==O&&O,w=f.onClose,H=f.compact,L=void 0!==H&&H,B=e((function(){return N===p.DANGER?"alert":N===p.SUCCESS?"success":"attention"}),[N]),F=m([y,v]),P="".concat(u,"--type-").concat(N);return t("aside",Object.assign({className:n(u,P,{compact:L,"with-close":w},F),role:"alert"},{children:[t(d,Object.assign({justify:d.justify.START,align:d.align.CENTER,className:n("".concat(u,"__title-container"),"".concat(P,"__title-container"))},{children:[A&&!T&&c(i,{iconType:h,ariaHidden:!0,clickable:!1,icon:x,className:n("".concat(u,"__title-container__icon"),"".concat(P,"__title-container__icon")),ignoreFocusStyle:!0,iconSize:"24",iconLabel:B}),A&&c(_,{value:A,type:_.types.h4,className:"".concat(u,"__title")})]})),t("div",Object.assign({className:n("".concat(u,"__text"),"".concat(P,"__text"),o({},"".concat(u,"_text--compact"),L))},{children:[!A&&L&&!T&&b&&c(i,{iconType:h,iconSize:18,ariaHidden:!0,clickable:!1,icon:x,className:n("".concat(u,"__title-container__icon"),"".concat(P,"__title-container__icon")),ignoreFocusStyle:!0,iconLabel:B}),R]})),w&&c(a,{size:null===(j=null==a?void 0:a.sizes)||void 0===j?void 0:j.SMALL,color:a.colors.ON_PRIMARY_COLOR,className:n("".concat(u,"__close-icon")),wrapperClassName:n("".concat(u,"__close-icon--wrapper"),o({},"".concat(u,"__close-icon--compact"),L)),ariaLabel:"Close",icon:s,onClick:w})]}))};Object.assign(f,{types:p,iconTypes:l});var j=f;export{j as default};
