@adyen/adyen-platform-experience-web
Version:

33 lines (32 loc) • 1.59 kB
JavaScript
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
};