You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
1.0 KiB
28 lines
1.0 KiB
<script setup lang="ts">
|
|
import type { TabsTriggerProps } from 'reka-ui'
|
|
import type { HTMLAttributes } from 'vue'
|
|
import { TabsTrigger, useForwardProps } from 'reka-ui'
|
|
import { cn } from '~/lib/utils'
|
|
|
|
interface Props extends TabsTriggerProps {
|
|
class?: HTMLAttributes['class']
|
|
}
|
|
|
|
const props = defineProps<Props>()
|
|
|
|
const delegatedProps = computed(() => {
|
|
const { class: _, ...delegated } = props
|
|
return delegated
|
|
})
|
|
|
|
const forwarded = useForwardProps(delegatedProps)
|
|
</script>
|
|
|
|
<template>
|
|
<TabsTrigger v-bind="forwarded" :class="cn(
|
|
'inline-flex items-center justify-center whitespace-nowrap rounded-[25px] px-4 py-[10px] text-lg font-medium ring-offset-transparent transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-0 disabled:pointer-events-none disabled:opacity-50 text-white/70 hover:text-white data-[state=active]:bg-accent data-[state=active]:text-white data-[state=active]:shadow-md leading-[1.7em]',
|
|
props.class
|
|
)">
|
|
<slot />
|
|
</TabsTrigger>
|
|
</template>
|
|
|