forked from BRETT/BRETT
28 lines
797 B
Vue
28 lines
797 B
Vue
<script setup lang="ts">
|
|
import type { AccordionRootEmits, AccordionRootProps } from 'reka-ui'
|
|
import type { HTMLAttributes } from 'vue'
|
|
import { reactiveOmit } from '@vueuse/core'
|
|
import {
|
|
AccordionRoot,
|
|
useForwardPropsEmits,
|
|
} from 'reka-ui'
|
|
import { cn } from '@/lib/utils'
|
|
|
|
const props = defineProps<AccordionRootProps & { class?: HTMLAttributes['class'] }>()
|
|
const emits = defineEmits<AccordionRootEmits>()
|
|
|
|
const delegatedProps = reactiveOmit(props, 'class')
|
|
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
</script>
|
|
|
|
<template>
|
|
<AccordionRoot
|
|
v-slot="slotProps"
|
|
data-slot="accordion"
|
|
v-bind="forwarded"
|
|
:class="cn('overflow-hidden rounded-2xl border flex w-full flex-col', props.class)"
|
|
>
|
|
<slot v-bind="slotProps" />
|
|
</AccordionRoot>
|
|
</template>
|