UNPKG

@adyen/adyen-platform-experience-web

Version:

![Platform Experience header](https://github.com/Adyen/adyen-platform-experience-web/assets/7926613/18094965-9e01-450e-8dc9-ea84e6b22c2b)

33 lines (32 loc) 1.59 kB
import { jsx as e } from "../../../external/preact/jsx-runtime/dist/jsxRuntime.module.js"; import s from "classnames"; import { ButtonVariant as y } from "../Button/types.js"; import { TypographyVariant as a, TypographyElement as m } from "../Typography/types.js"; import p from "../Typography/Typography.js"; import { AlertIcon as f } from "./AlertIcon.js"; import { AlertVariantOption as t } from "./types.js"; /* empty css */ import u from "../Button/Button.js"; import { Icon as T } from "../Icon/Icon.js"; const P = ({ className: c, description: o, title: n, type: l, children: d, onClose: i, variant: r = t.DEFAULT }) => /* @__PURE__ */ e("div", { className: s("adyen-pe-alert", `adyen-pe-alert--${l}`, `adyen-pe-alert--${r}`, c), role: "alert", children: [ /* @__PURE__ */ e(f, { type: l, className: "adyen-pe-alert__icon" }), /* @__PURE__ */ e("div", { className: "adyen-pe-alert__content", children: [ n && r !== t.TIP && /* @__PURE__ */ e(p, { className: "adyen-pe-alert__title", el: m.DIV, variant: a.BODY, wide: !0, strongest: !0, children: n }), o && /* @__PURE__ */ e( p, { className: "adyen-pe-alert__description", el: m.DIV, variant: r !== t.TIP ? a.CAPTION : a.BODY, wide: !0, children: o } ), d ] }), i && r !== t.TIP && /* @__PURE__ */ e("div", { className: "adyen-pe-alert__close-button", children: /* @__PURE__ */ e(u, { iconButton: !0, variant: y.TERTIARY, onClick: i, children: /* @__PURE__ */ e(T, { name: "cross" }) }) }) ] }); export { P as Alert, P as default };