import { toRef, createVNode } from "vue";
import "./styles/tag-group.scss";
import { makePaperProps, usePaper } from "../../composables/paper/index.mjs";
import { makeGroupProps, useGroup } from "../../composables/group/index.mjs";
import { provideDefaults } from "../../composables/defaults/index.mjs";
import { defineComponent } from "../../utils/define-component.mjs";
import { deepEqual } from "../../utils/dist/index.mjs";
const TagGroupKey = Symbol.for("veno-ui:chip-group");
const TagGroup = defineComponent({
  name: "VeTagGroup",
  props: {
    column: Boolean,
    valueComparator: {
      type: Function,
      default: deepEqual
    },
    ...makeGroupProps({
      selectedClass: "ve-tag--active"
    }),
    ...makePaperProps({
      variant: "contained-text"
    })
  },
  emits: {
    "update:modelValue": (_modelValue) => true
  },
  setup(props, {
    slots
  }) {
    const {
      paperClasses,
      paperStyles
    } = usePaper(props);
    const {
      isSelected,
      select,
      next,
      prev,
      selected
    } = useGroup(props, TagGroupKey);
    provideDefaults({
      VeTag: {
        color: toRef(props, "color"),
        size: toRef(props, "size"),
        variant: toRef(props, "variant")
      }
    });
    return () => createVNode(props.tag, {
      "class": ["ve-tag-group", {
        "ve-tag-group--column": props.column
      }, paperClasses.value],
      "style": paperStyles.value
    }, {
      default: () => {
        var _a;
        return [(_a = slots.default) == null ? void 0 : _a.call(slots, {
          isSelected,
          select,
          next,
          prev,
          selected: selected.value
        })];
      }
    });
  }
});
export {
  TagGroup,
  TagGroupKey
};
//# sourceMappingURL=tag-group.mjs.map
