import { jsx as r, jsxs as l } from "react/jsx-runtime";
import { forwardRef as N } from "react";
import { c as $ } from "./button-DBX_tvfJ.mjs";
import { a as O } from "./heading-gqtQNo5n.mjs";
import { b as f } from "./icon.es-CZcKxTaM.mjs";
import { e as x } from "./error-filled.es-C0Amnd7Y.mjs";
import { a as R } from "./paragraph-DNtj7OLr.mjs";
import { c as S } from "./bind-CU-R61T-.mjs";
const A = {
  name: "alert-filled",
  svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Zm1.038-14.81-.247 6.875h-1.566l-.247-6.876a1.03 1.03 0 1 1 2.06 0Zm.212 8.916c0 .649-.585 1.234-1.25 1.234-.649 0-1.25-.585-1.25-1.234 0-.633.601-1.234 1.25-1.234.665 0 1.25.601 1.25 1.234Z" clip-rule="evenodd"/></svg>',
  keywords: ["alert-filled"],
  category: "status"
}, L = {
  name: "check-circle-filled",
  svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Zm4.712-12.491a.875.875 0 1 0-1.424-1.018l-4.4 6.16-2.27-2.27a.875.875 0 0 0-1.237 1.238l3 3a.875.875 0 0 0 1.331-.11l5-7Z" clip-rule="evenodd"/></svg>',
  keywords: ["check-circle-filled"],
  category: "status"
}, E = {
  name: "close",
  svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M4.864 4.864a.9.9 0 0 1 1.273 0L12 10.727l5.864-5.863a.9.9 0 0 1 1.272 1.272L13.273 12l5.863 5.864a.9.9 0 1 1-1.272 1.272L12 13.273l-5.863 5.863a.9.9 0 0 1-1.273-1.272L10.727 12 4.864 6.136a.9.9 0 0 1 0-1.272Z" clip-rule="evenodd"/></svg>',
  keywords: ["close"],
  category: "utility"
}, C = {
  name: "info-filled",
  svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10ZM10.9 7.786c0 .591.516 1.077 1.108 1.077.576 0 1.092-.486 1.092-1.077 0-.592-.516-1.078-1.092-1.078-.592 0-1.108.486-1.108 1.078Zm.167 9.74h1.866V9.94h-1.866v7.586Z" clip-rule="evenodd"/></svg>',
  keywords: ["info-filled"],
  category: "status"
}, I = {
  "purpur-notification": "_purpur-notification_53c05_1",
  "purpur-notification__top": "_purpur-notification__top_53c05_14",
  "purpur-notification__header": "_purpur-notification__header_53c05_20",
  "purpur-notification__close-button": "_purpur-notification__close-button_53c05_25",
  "purpur-notification__icon": "_purpur-notification__icon_53c05_30",
  "purpur-notification__body": "_purpur-notification__body_53c05_33",
  "purpur-notification__body--extra-padding": "_purpur-notification__body--extra-padding_53c05_36",
  "purpur-notification--success": "_purpur-notification--success_53c05_39",
  "purpur-notification__heading": "_purpur-notification__heading_53c05_42",
  "purpur-notification--warning": "_purpur-notification--warning_53c05_48",
  "purpur-notification--error": "_purpur-notification--error_53c05_57",
  "purpur-notification--info": "_purpur-notification--info_53c05_66",
  "purpur-notification--hidden": "_purpur-notification--hidden_53c05_75",
  "purpur-notification--has-close-button": "_purpur-notification--has-close-button_53c05_79"
}, a = S.bind(I), n = {
  SUCCESS: "success",
  WARNING: "warning",
  ERROR: "error",
  INFO: "info"
}, P = Object.values(n), Z = {
  POLITE: "polite",
  ASSERTIVE: "assertive"
}, T = Object.values(Z), k = {
  ALERT: "alert",
  DIALOG: "dialog",
  ALERTDIALOG: "alertdialog"
}, W = Object.values(k), o = "purpur-notification", j = (i) => {
  switch (i) {
    case n.INFO:
      return C;
    case n.SUCCESS:
      return L;
    case n.WARNING:
      return A;
    case n.ERROR:
      return x;
  }
}, B = N(
  ({
    ["data-testid"]: i,
    ["aria-live"]: v,
    children: e,
    className: g,
    closeButtonAriaLabel: m,
    headingTag: h = "h4",
    status: u = "info",
    heading: s,
    hidden: p,
    id: t,
    onClose: c,
    open: w = !0,
    hideIcon: _,
    ...b
  }, y) => {
    const d = !!s || !_;
    return /* @__PURE__ */ r("div", { "aria-live": v, children: w && /* @__PURE__ */ l(
      "div",
      {
        id: t,
        "aria-labelledby": t ? `${t}-heading` : void 0,
        "aria-describedby": t ? `${t}-body` : void 0,
        "aria-hidden": !!p,
        className: a(g, o, `${o}--${u}`, {
          [`${o}--hidden`]: p,
          [`${o}--has-close-button`]: !!c
        }),
        "data-testid": i,
        ref: y,
        ...b,
        children: [
          d && /* @__PURE__ */ r("div", { className: a(`${o}__top`), children: /* @__PURE__ */ l("div", { className: a(`${o}__header`), children: [
            !_ && /* @__PURE__ */ r(
              f,
              {
                "data-testid": i ? `${i}-icon` : void 0,
                className: a(`${o}__icon`),
                svg: j(u),
                size: "md"
              }
            ),
            !!s && /* @__PURE__ */ r(
              O,
              {
                "data-testid": i ? `${i}-heading` : void 0,
                variant: "subsection-100",
                tag: h,
                className: a(`${o}__heading`),
                children: /* @__PURE__ */ l("span", { id: t ? `${t}-heading` : void 0, children: [
                  " ",
                  s
                ] })
              }
            )
          ] }) }),
          c && /* @__PURE__ */ r(
            $,
            {
              "data-testid": i ? `${i}-close-button` : void 0,
              variant: "tertiary-purple",
              size: "sm",
              iconOnly: !0,
              "aria-label": m,
              onClick: c,
              className: a(`${o}__close-button`),
              children: /* @__PURE__ */ r(f, { svg: E, size: "sm" })
            }
          ),
          e && /* @__PURE__ */ r(
            "div",
            {
              "data-testid": i ? `${i}-body` : void 0,
              className: a(`${o}__body`, {
                [`${o}__body--extra-padding`]: !d && !!c
              }),
              id: t ? `${t}-body` : void 0,
              children: typeof e == "string" ? /* @__PURE__ */ r(
                R,
                {
                  "data-testid": i ? `${i}-paragraph` : void 0,
                  variant: "paragraph-100",
                  children: e
                }
              ) : e
            }
          )
        ]
      }
    ) });
  }
);
B.displayName = "Notification";
export {
  n as N,
  Z as a,
  T as b,
  k as c,
  W as d,
  B as e,
  P as n
};
//# sourceMappingURL=notification-C32wHljA.mjs.map
