"use client";
import { j as s } from "./index.esm38.js";
import T, { forwardRef as p } from "react";
import R from "./index.esm40.js";
import a from "./index.esm45.js";
import { DismissIcon as y } from "./index.esm46.js";
import { HashIcon as w } from "./index.esm47.js";
const b = p(function({ as: r, ...t }, e) {
  return T.createElement(r, { ...t, ref: e });
}), k = p(
  ({
    variant: o = "primary",
    size: r = "md",
    icon: t,
    iconPosition: e = "left",
    closeable: c = !1,
    onClose: m,
    hashtag: l = !1,
    children: d,
    className: h,
    href: n,
    ...g
  }, f) => {
    const u = (i) => {
      i.stopPropagation(), m == null || m(i);
    }, x = n ? { ...g, href: n, as: "a", "data-atme-ui": !0 } : { ...g, as: "span", "data-atme-ui": !0 }, j = l || !!t && e === "left", I = c || !!t && e === "right", N = R(
      a.tag,
      a[`tag--${o}`],
      a[`tag--${r}`],
      n && a["tag--link"],
      j && a["tag--hasLeadingIcon"],
      I && a["tag--hasTrailingIcon"],
      h
    );
    return /* @__PURE__ */ s.jsxs(b, { ref: f, className: N, ...x, children: [
      l && /* @__PURE__ */ s.jsx("span", { className: a.tagHashIcon, children: /* @__PURE__ */ s.jsx(w, { width: "0.85em", height: "0.85em" }) }),
      t && e === "left" && /* @__PURE__ */ s.jsx("span", { className: a.tagIcon, children: t }),
      /* @__PURE__ */ s.jsx("span", { className: a.tagContent, children: d }),
      t && e === "right" && /* @__PURE__ */ s.jsx("span", { className: a.tagIcon, children: t }),
      c && /* @__PURE__ */ s.jsx(
        "button",
        {
          type: "button",
          className: a.tagClose,
          onClick: u,
          "aria-label": "Close tag",
          children: /* @__PURE__ */ s.jsx(y, { width: "0.7em", height: "0.7em" })
        }
      )
    ] });
  }
);
k.displayName = "Tag";
export {
  k as Tag
};
//# sourceMappingURL=index.esm11.js.map
