UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

2 lines (1 loc) 973 B
import{jsx as r,jsxs as t}from"react/jsx-runtime";import"./Alert.scss";import i from"classnames";const u=({children:c,position:s,variant:e="info",inline:n=!1,showIcon:o=!0,size:d="md",closable:f=!1,title:l,closeLabel:a,onClose:p})=>{const m=()=>{switch(e){case"error":return"icon-close-solid";case"success":return"icon-checkmark-solid";case"warning":return"icon-warning-solid";default:return"icon-info-solid"}};return t("div",{className:i("efp-alert",`efp-alert--${e} efp-alert--${d}`,{"efp-alert--inline":n,[`efp-alert--${s}`]:s}),role:e==="error"||e==="warning"?"alert":"status","aria-live":e==="error"||e==="warning"?"assertive":"polite",children:[o&&r("div",{className:"efp-alert__icon",children:r("i",{className:i(m()),"aria-hidden":"true"})}),t("div",{className:"efp-alert__content",children:[l&&r("div",{className:"efp-alert__title",children:l}),c]}),f&&r("button",{type:"button",className:"efp-alert__close",onClick:p,"aria-label":a,title:a})]})};export default u;