import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot, createCommentVNode } from "vue";
const _hoisted_1 = {
  key: 0,
  class: "button-icon"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "Button",
  props: {
    size: { default: void 0 },
    type: { default: void 0 },
    customStyle: { type: [Boolean, null, String, Object, Array], default: () => ({}) },
    loading: { type: Boolean, default: false },
    disabled: { type: Boolean, default: false },
    round: { type: Boolean, default: true },
    plain: { type: Boolean, default: false }
  },
  emits: ["click"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    function handleClick(event) {
      if (!props.disabled) {
        emit("click", event);
      }
    }
    const buttonClassList = computed(() => [
      "tui-button",
      `tui-button-${props.type}`,
      `tui-button-${props.size}`,
      { "tui-button-round": props.round },
      { "tui-button-loading": props.loading },
      { "tui-button-disabled": props.disabled },
      { "tui-button-plain": props.plain }
    ]);
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("button", {
        class: normalizeClass(buttonClassList.value),
        style: normalizeStyle(_ctx.customStyle),
        onClick: handleClick
      }, [
        _ctx.$slots.icon ? (openBlock(), createElementBlock("span", _hoisted_1, [
          renderSlot(_ctx.$slots, "icon", {}, void 0, true)
        ])) : createCommentVNode("", true),
        renderSlot(_ctx.$slots, "default", {}, void 0, true)
      ], 6);
    };
  }
});
export {
  _sfc_main as default
};
