"use client";
import { j as n } from "./index.esm38.js";
import { forwardRef as f } from "react";
import b from "./index.esm40.js";
import a from "./index.esm70.js";
function c(r, t) {
  return t != null && typeof r == "number" && r > t ? `${t}+` : r;
}
const g = f(
  ({
    variant: r = "primary",
    size: t = "md",
    dot: e = !1,
    max: l,
    children: s,
    className: m,
    "aria-label": u,
    ...d
  }, p) => {
    const i = e ? null : c(s, l), o = u ?? (typeof s == "number" && !e ? `${s} items` : void 0);
    return /* @__PURE__ */ n.jsxs(
      "span",
      {
        ref: p,
        "data-atme-ui": !0,
        className: b(
          a.badge,
          a[`badge--${r}`],
          a[`badge--${t}`],
          e && a["badge--dot"],
          m
        ),
        role: e ? "status" : void 0,
        "aria-label": o,
        "aria-hidden": e && !o ? !0 : void 0,
        ...d,
        children: [
          e && /* @__PURE__ */ n.jsx("span", { className: a.badgeDot, "aria-hidden": "true" }),
          !e && i != null && /* @__PURE__ */ n.jsx("span", { className: a.badgeContent, children: i })
        ]
      }
    );
  }
);
g.displayName = "Badge";
export {
  g as Badge
};
//# sourceMappingURL=index.esm18.js.map
