2024-12-25 20:46:14 +01:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { cn } from "@/lib/utils";
|
2025-03-28 01:16:24 +01:00
|
|
|
import type { ListboxContentProps } from "reka-ui";
|
|
|
|
|
import { ListboxContent, useForwardProps } from "reka-ui";
|
2024-12-25 20:46:14 +01:00
|
|
|
import { type HTMLAttributes, computed } from "vue";
|
|
|
|
|
|
2025-03-28 01:16:24 +01:00
|
|
|
const props = defineProps<
|
|
|
|
|
ListboxContentProps & { class?: HTMLAttributes["class"] }
|
|
|
|
|
>();
|
2024-12-25 20:46:14 +01:00
|
|
|
|
|
|
|
|
const delegatedProps = computed(() => {
|
|
|
|
|
const { class: _, ...delegated } = props;
|
|
|
|
|
|
|
|
|
|
return delegated;
|
|
|
|
|
});
|
|
|
|
|
|
2025-03-28 01:16:24 +01:00
|
|
|
const forwarded = useForwardProps(delegatedProps);
|
2024-12-25 20:46:14 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
2025-04-10 13:55:56 +02:00
|
|
|
<ListboxContent
|
|
|
|
|
data-slot="command-list"
|
|
|
|
|
v-bind="forwarded"
|
|
|
|
|
:class="cn('max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto', props.class)"
|
|
|
|
|
>
|
2024-12-25 20:46:14 +01:00
|
|
|
<div role="presentation">
|
|
|
|
|
<slot />
|
|
|
|
|
</div>
|
2025-03-28 01:16:24 +01:00
|
|
|
</ListboxContent>
|
2024-12-25 20:46:14 +01:00
|
|
|
</template>
|