import { defineComponent as d, useCssModule as f, computed as a, openBlock as s, createBlock as u, resolveDynamicComponent as _, mergeProps as p, unref as r, withCtx as y, renderSlot as m } from "vue";
import h from "./Icon.js";
import { _ as v } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const g = /* @__PURE__ */ d({
  name: "ll-button",
  __name: "Button",
  props: {
    secondary: { type: Boolean, default: !1 },
    icon: { type: Boolean, default: !1 },
    iconLabel: { type: Boolean, default: !1 },
    tertiary: { type: Boolean, default: !1 },
    inline: { type: Boolean, default: !1 },
    color: { default: void 0 },
    to: { default: void 0 },
    href: { default: "" },
    isLoading: { type: Boolean, default: !1 },
    disabled: { type: Boolean, default: void 0 }
  },
  setup(i) {
    const t = i, e = f();
    let n;
    ((o) => {
      o.Icon = "icon", o.IconLabel = "iconLabel", o.Secondary = "secondary", o.Tertiary = "tertiary", o.Inline = "inline", o.Primary = "primary";
    })(n || (n = {}));
    const l = a(() => {
      for (const o of Object.values(n))
        if (t[o])
          return o;
      return "primary";
    }), b = a(() => t.to ? "router-link" : t.href ? "a" : "button"), c = a(() => t.to ? {
      to: t.to
    } : t.href ? {
      href: t.href
    } : {});
    return (o, I) => (s(), u(_(b.value), p({
      disabled: t.isLoading || t.disabled ? !0 : void 0
    }, c.value, {
      class: ["stash-button", [
        r(e).button,
        `stash-button--${l.value}`,
        r(e)[`button--${l.value}`],
        {
          [`stash-button--${t.color}`]: t.color,
          [r(e)[`button--${t.color}`]]: t.color,
          "stash-button--is-loading": t.isLoading
        }
      ]],
      "data-test": "ll-button"
    }), {
      default: y(() => [
        t.isLoading ? (s(), u(h, {
          key: 0,
          name: "loading-empty",
          class: "animate-spin"
        })) : m(o.$slots, "default", { key: 1 })
      ]),
      _: 3
    }, 16, ["disabled", "class"]));
  }
}), L = "_button_Lq-t4", k = {
  button: L,
  "button--solid": "_button--solid_E-Ihv",
  "button--ghost": "_button--ghost_QwKnV",
  "button--primary": "_button--primary_DvKX- _button--solid_E-Ihv",
  "button--secondary": "_button--secondary_ecuzN _button--ghost_QwKnV",
  "button--tertiary": "_button--tertiary_kLoor _button--ghost_QwKnV",
  "button--icon": "_button--icon_pfE7I",
  "button--iconLabel": "_button--iconLabel_JdPWN",
  "button--inline": "_button--inline_SkGun",
  "button--blue": "_button--blue_v0KWT",
  "button--red": "_button--red_F3eow"
}, B = {
  $style: k
}, C = /* @__PURE__ */ v(g, [["__cssModules", B]]);
export {
  C as default
};
//# sourceMappingURL=Button.js.map
