import t from "classnames";
import a from "react";
import { Loader as p } from "react-feather";
const i = ({ loadingText: e, className: r }) => /* @__PURE__ */ a.createElement("div", { className: t("inlineLoader", r) }, /* @__PURE__ */ a.createElement("div", { className: "iconContainer" }, /* @__PURE__ */ a.createElement(p, { size: "1em", className: "icon" })), e && /* @__PURE__ */ a.createElement("div", { className: "loaderText ml-2" }, e));
const I = {
  inline: "inline",
  blue: "blue"
}, b = (e) => /* @__PURE__ */ a.createElement("div", { className: t(e.className, "spinner") }, /* @__PURE__ */ a.createElement("svg", { height: "100%", width: "100%" }, /* @__PURE__ */ a.createElement(
  "circle",
  {
    stroke: "white",
    fill: "transparent",
    strokeWidth: "4",
    strokeDasharray: "calc(2 * 22 / 7 * (50% - 2px)/ 6)",
    style: { strokeDashoffset: 0 },
    r: "calc(50% - 2px)",
    cx: "50%",
    cy: "50%"
  }
)));
var A = /* @__PURE__ */ ((e) => (e.FLAT = "flat", e.OUTLINED = "outlined", e.TEXT = "text", e.PLAIN = "plain", e))(A || {}), R = /* @__PURE__ */ ((e) => (e.EXTRA_SMALL = "extraSmall", e.SMALL = "small", e.MEDIUM = "medium", e.LARGE = "large", e.EXTRA_LARGE = "extraLarge", e))(R || {}), f = /* @__PURE__ */ ((e) => (e.PRIMARY = "primary", e.SECONDARY = "secondary", e.PRIMARY_WHITE = "primaryWhite", e.WHITE = "white", e.DARK = "dark", e.TEXT = "text", e.NONE = "", e))(f || {});
const v = (e, r, s) => `${e} ${s ?? ""} ${r}`, x = (e) => {
  switch (e) {
    case "INLINE":
      return /* @__PURE__ */ a.createElement(i, null);
    case "SPINNER":
      return /* @__PURE__ */ a.createElement(b, { className: t(I.inline, "mr-3") });
    default:
      return /* @__PURE__ */ a.createElement(i, null);
  }
}, M = (e) => {
  const {
    children: r,
    isFullWidth: s,
    hasOutline: c = !0,
    buttonType: m = "flat",
    buttonFontSize: d,
    buttonStyle: o = "primary",
    className: E,
    isLoading: n,
    loadingIndicator: N,
    disabled: u,
    dataQa: L,
    ...h
  } = e, l = u || n;
  return /* @__PURE__ */ a.createElement(
    "button",
    {
      className: t("button", E, v(m, o, d), {
        hasOutline: c,
        fullWidth: s,
        disabled: l
      }),
      "data-qa-id": L,
      disabled: l,
      ...h
    },
    n && x(N),
    r
  );
};
export {
  M as B,
  b as S,
  I as a,
  A as b,
  f as c,
  R as d
};
