import { jsxs as _, jsx as s } from "react/jsx-runtime";
import { forwardRef as w } from "react";
import { cx as x } from "../../utils/classNames.js";
import { useArrowTheme as j } from "../../hooks/useArrowTheme.js";
const y = w(
  ({
    label: e,
    id: d,
    hasDecoration: l = !1,
    decorationIcon: c,
    leadingIconA11yLabel: C,
    isDismissable: o = !1,
    closeIcon: t,
    onDismiss: i,
    inverse: f,
    isVisible: b = !1,
    animationType: n,
    triggerAnimation: a = !1,
    dismissSnackbar: r = !1,
    isSnapshot: m = !1,
    focused: u = !1,
    className: k
  }, p) => {
    const v = j(), h = f ?? v.inverse;
    if (!e)
      return null;
    const N = x(
      "tdds-snackbar",
      {
        "tdds-snackbar--visible": (b || a) && !r,
        "tdds-snackbar--fade-out": r,
        "tdds-snackbar--animate-up": a && n === "up",
        "tdds-snackbar--animate-down": a && n === "down",
        "tdds:position-absolute": m
      },
      k
    );
    return /* @__PURE__ */ _(
      "div",
      {
        ref: p,
        className: N,
        id: d,
        "data-inverse": String(h),
        children: [
          l ? /* @__PURE__ */ s("div", { className: "tdds-snackbar__decoration", children: c }) : null,
          /* @__PURE__ */ s("span", { className: "tdds-snackbar__label", children: e }),
          o ? /* @__PURE__ */ s("div", { className: "tdds-snackbar__close", children: /* @__PURE__ */ s(
            "button",
            {
              type: "button",
              "aria-label": "close message",
              className: u ? "force-focus" : void 0,
              onClick: i,
              children: t
            }
          ) }) : null
        ]
      }
    );
  }
);
y.displayName = "Snackbar";
export {
  y as Snackbar
};
//# sourceMappingURL=Snackbar.js.map
