import { jsx as e, jsxs as r } from "react/jsx-runtime";
import { forwardRef as A } from "react";
import { cx as i } from "../../utils/classNames.js";
import { useArrowTheme as y } from "../../hooks/useArrowTheme.js";
import { ALERT_VARIANTS as x } from "./NoticeBar.types.js";
function g(n) {
  return x.includes(n);
}
const w = A(
  ({
    body: n,
    title: d,
    variant: t = "announcement",
    linkLabel: c,
    href: a,
    isDismissable: o = !1,
    onDismiss: _,
    inverse: b,
    leadingIcon: l,
    leadingIconA11yLabel: C,
    closeIcon: N,
    focused: h = !1,
    className: u
  }, v) => {
    const f = y(), m = b ?? f.inverse, s = g(t), p = i("tdds-notice-bar__body", {
      "tdds-notice-bar__body--bold": !d || !s
    });
    return /* @__PURE__ */ e("div", { ref: v, className: i("tdds-notice-bar__container", u), children: /* @__PURE__ */ r(
      "div",
      {
        "data-inverse": String(m),
        className: i("tdds-notice-bar", `tdds-notice-bar--${t}`, {
          "tdds-notice-bar--grid": o
        }),
        role: s ? "alert" : void 0,
        children: [
          /* @__PURE__ */ e("div", { className: "tdds-notice-bar__wrapper", children: /* @__PURE__ */ r("div", { className: "tdds-notice-bar__content", children: [
            l ? /* @__PURE__ */ e("div", { className: "tdds-notice-bar__icon", children: l }) : null,
            /* @__PURE__ */ r("div", { children: [
              d && s ? /* @__PURE__ */ e("h2", { className: "tdds-notice-bar__title", children: d }) : null,
              /* @__PURE__ */ r("p", { className: p, children: [
                n,
                c && a ? /* @__PURE__ */ e(
                  "a",
                  {
                    className: "tdds-link tdds-link--inline",
                    href: a,
                    "data-inverse": String(m),
                    children: c
                  }
                ) : null
              ] })
            ] })
          ] }) }),
          o ? /* @__PURE__ */ e("div", { className: "tdds-notice-bar__close", children: /* @__PURE__ */ e(
            "button",
            {
              className: h ? "force-focus" : void 0,
              "aria-label": "Close notice",
              onClick: _,
              children: N
            }
          ) }) : null
        ]
      }
    ) });
  }
);
w.displayName = "NoticeBar";
export {
  w as NoticeBar
};
//# sourceMappingURL=NoticeBar.js.map
