'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
require('../../../utils/index.cjs');
require('../../../theme/index.cjs');
var useConfigInject = require('../../config-provider/src/hooks/useConfigInject.cjs');
var props = require('./props.cjs');
var context = require('./context.cjs');
var internal = require('../../../theme/token/internal.cjs');
var log = require('../../../utils/log.cjs');
var props$1 = require('../../../utils/vue/props.cjs');

var AButtonGroup = /* @__PURE__ */ vue.defineComponent({
  compatConfig: {
    MODE: 3
  },
  name: "AButtonGroup",
  props: props.buttonGroupProps(),
  setup(props, {
    slots
  }) {
    const {
      prefixCls,
      direction
    } = useConfigInject.default("btn-group", props);
    const [, , hashId] = internal.useToken();
    context.GroupSizeContext.useProvide(vue.reactive({
      size: vue.computed(() => props.size)
    }));
    const classes = vue.computed(() => {
      const {
        size
      } = props;
      let sizeCls = "";
      switch (size) {
        case "large":
          sizeCls = "lg";
          break;
        case "small":
          sizeCls = "sm";
          break;
        case "middle":
        case void 0:
          break;
        default:
          log.devWarning(!size, "Button.Group", "Invalid prop `size`.");
      }
      return {
        [`${prefixCls.value}`]: true,
        [`${prefixCls.value}-${sizeCls}`]: sizeCls,
        [`${prefixCls.value}-rtl`]: direction.value === "rtl",
        [hashId.value]: true
      };
    });
    return () => {
      var _a;
      return vue.createVNode("div", {
        "class": classes.value
      }, [props$1.flattenChildren((_a = slots.default) == null ? void 0 : _a.call(slots))]);
    };
  }
});

exports.default = AButtonGroup;
//# sourceMappingURL=ButtonGroup.cjs.map
