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.
31 lines
658 B
31 lines
658 B
<script setup lang="ts">
|
|
import { type HTMLAttributes, computed } from 'vue'
|
|
import { Label as LabelPrimitive } from 'reka-ui'
|
|
import { cn } from '@/lib/utils'
|
|
|
|
interface LabelProps {
|
|
for?: string
|
|
class?: HTMLAttributes['class']
|
|
}
|
|
|
|
const props = defineProps<LabelProps>()
|
|
|
|
const delegatedProps = computed(() => {
|
|
const { class: _, ...delegated } = props
|
|
return delegated
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<LabelPrimitive
|
|
v-bind="delegatedProps"
|
|
:class="
|
|
cn(
|
|
'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70',
|
|
props.class
|
|
)
|
|
"
|
|
>
|
|
<slot />
|
|
</LabelPrimitive>
|
|
</template>
|
|
|