<script setup>
import { reactiveOmit } from "@vueuse/core";
import { ToggleGroupRoot, useForwardPropsEmits } from "reka-ui";
import { provide } from "vue";
import { cn } from "../../../utils/cn";
import { toggleGroupContextKey } from ".";
defineOptions({ name: "UiToggleGroup" });
const props = defineProps({
  rovingFocus: { type: Boolean, required: false },
  disabled: { type: Boolean, required: false },
  orientation: { type: String, required: false },
  dir: { type: String, required: false },
  loop: { type: Boolean, required: false },
  asChild: { type: Boolean, required: false },
  as: { type: null, required: false },
  name: { type: String, required: false },
  required: { type: Boolean, required: false },
  type: { type: String, required: false },
  modelValue: { type: null, required: false },
  defaultValue: { type: null, required: false },
  class: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
  variant: { type: null, required: false, default: "default" },
  size: { type: null, required: false, default: "default" }
});
const emits = defineEmits(["update:modelValue"]);
provide(toggleGroupContextKey, { variant: props.variant, size: props.size });
const delegatedProps = reactiveOmit(props, "class", "size", "variant");
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>

<template>
  <ToggleGroupRoot
    data-slot="toggle-group"
    :data-variant="variant"
    :data-size="size"
    v-bind="forwarded"
    :class="cn('group/toggle-group flex w-fit items-center', props.class)"
  >
    <slot />
  </ToggleGroupRoot>
</template>
