import { jsxs as x, jsx as y } from "react/jsx-runtime";
import { forwardRef as f } from "react";
import { a as g } from "./spinner-DRQN6YdK.mjs";
import { c as T } from "./bind-CU-R61T-.mjs";
const E = {
  PRIMARY: "primary",
  SECONDARY: "secondary",
  EXPRESSIVE: "expressive"
}, R = {
  LG: "lg"
}, $ = {
  "purpur-button": "_purpur-button_10jh0_1",
  "purpur-button--xs": "_purpur-button--xs_10jh0_22",
  "purpur-button--icon-only": "_purpur-button--icon-only_10jh0_25",
  "purpur-button--sm": "_purpur-button--sm_10jh0_28",
  "purpur-button--md": "_purpur-button--md_10jh0_34",
  "purpur-button--lg": "_purpur-button--lg_10jh0_40",
  "purpur-button--full-width": "_purpur-button--full-width_10jh0_46",
  "purpur-button--primary": "_purpur-button--primary_10jh0_64",
  "purpur-button--disabled": "_purpur-button--disabled_10jh0_68",
  "purpur-button--primary-negative": "_purpur-button--primary-negative_10jh0_74",
  "purpur-button--secondary": "_purpur-button--secondary_10jh0_86",
  "purpur-button--secondary-negative": "_purpur-button--secondary-negative_10jh0_97",
  "purpur-button--expressive": "_purpur-button--expressive_10jh0_108",
  "purpur-button--expressive-negative": "_purpur-button--expressive-negative_10jh0_118",
  "purpur-button--negative": "_purpur-button--negative_10jh0_130",
  "purpur-button--destructive": "_purpur-button--destructive_10jh0_137",
  "purpur-button--destructive-negative": "_purpur-button--destructive-negative_10jh0_147",
  "purpur-button--tertiary-purple": "_purpur-button--tertiary-purple_10jh0_157",
  "purpur-button--tertiary-purple-negative": "_purpur-button--tertiary-purple-negative_10jh0_170",
  "purpur-button--text-negative": "_purpur-button--text-negative_10jh0_185",
  "purpur-button--text": "_purpur-button--text_10jh0_185",
  "purpur-button__spinner": "_purpur-button__spinner_10jh0_235"
}, N = {
  ...E,
  DESTRUCTIVE: "destructive",
  TERTIARY_PURPLE: "tertiary-purple",
  TEXT: "text"
}, V = Object.values(N), b = T.bind($), t = "purpur-button", w = ["button", "submit", "reset"], A = f(
  ({
    children: l,
    className: c,
    disabled: r = !1,
    fullWidth: d = !1,
    iconOnly: n,
    loading: u = !1,
    negative: p = !1,
    onClick: o,
    size: _ = "md",
    variant: e,
    type: h = "button",
    ...s
  }, j) => {
    if (n && e === "destructive")
      return null;
    const v = b(
      [
        t,
        `${t}--${p ? `${e}-negative` : e}`,
        `${t}--${_}`
      ],
      {
        [`${t}--icon-only`]: n,
        [`${t}--negative`]: p,
        [`${t}--full-width`]: d,
        [`${t}--disabled`]: r || u
      },
      c
    ), m = (a) => {
      r || u ? a.preventDefault() : o && o(a);
    }, i = !!s["aria-disabled"] || r || u;
    return /* @__PURE__ */ x(
      "button",
      {
        className: v,
        type: h,
        ref: j,
        "aria-disabled": i,
        onClick: m,
        ...s,
        children: [
          u && /* @__PURE__ */ y(
            g,
            {
              size: _ === R.LG ? "xs" : "xxs",
              negative: p,
              disabled: i,
              className: b(`${t}__spinner`)
            }
          ),
          " ",
          l
        ]
      }
    );
  }
);
A.displayName = "Button";
export {
  N as B,
  w as a,
  V as b,
  A as c
};
//# sourceMappingURL=button-DBX_tvfJ.mjs.map
