"use client";
import { j as a } from "./index.esm38.js";
import { forwardRef as f } from "react";
import d from "./index.esm40.js";
import t from "./index.esm42.js";
const x = f(
  ({
    variant: o = "primary",
    size: u = "md",
    startIcon: e,
    endIcon: n,
    fullWidth: m = !1,
    loading: s = !1,
    disabled: b,
    children: i,
    className: p,
    ...c
  }, l) => {
    const r = b || s;
    return /* @__PURE__ */ a.jsxs(
      "button",
      {
        ref: l,
        type: "button",
        "data-atme-ui": !0,
        className: d(
          t.button,
          t[`button--${o}`],
          t[`button--${u}`],
          e && !s && t["button--hasStartIcon"],
          n && !s && t["button--hasEndIcon"],
          m && t["button--fullWidth"],
          s && t["button--loading"],
          p
        ),
        disabled: r,
        "aria-busy": s,
        "aria-disabled": r,
        ...c,
        children: [
          s && /* @__PURE__ */ a.jsx("span", { className: t.buttonSpinner, "aria-hidden": "true" }),
          e && !s && /* @__PURE__ */ a.jsx("span", { className: t.buttonIcon, children: e }),
          /* @__PURE__ */ a.jsx("span", { className: t.buttonContent, children: i }),
          n && !s && /* @__PURE__ */ a.jsx("span", { className: t.buttonIcon, children: n })
        ]
      }
    );
  }
);
x.displayName = "Button";
export {
  x as Button
};
//# sourceMappingURL=index.esm13.js.map
