<script setup lang="ts">
import type { ListboxRootEmits, ListboxRootProps } from 'reka-ui';
import type { HTMLAttributes } from 'vue';
import { ListboxRoot, useForwardPropsEmits } from 'reka-ui';
import { computed } from 'vue';
import { cn, omitClass } from '@/lib/utils';

const props = defineProps<
  ListboxRootProps & { class?: HTMLAttributes['class'] }
>();
const emits = defineEmits<ListboxRootEmits>();

const delegatedProps = computed(() => omitClass(props));

const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>

<template>
  <ListboxRoot
    data-slot="listbox"
    :class="cn('flex flex-col', props.class)"
    v-bind="forwarded"
  >
    <slot />
  </ListboxRoot>
</template>
