2024-12-01 17:20:21 +01:00
|
|
|
<script setup lang="ts">
|
2025-03-28 01:16:24 +01:00
|
|
|
import { Label, type LabelProps } from "reka-ui";
|
2025-06-26 22:39:02 +02:00
|
|
|
import { computed, type HTMLAttributes } from "vue";
|
|
|
|
|
import { cn } from "@/lib/utils";
|
2024-12-01 17:20:21 +01:00
|
|
|
|
|
|
|
|
const props = defineProps<LabelProps & { class?: HTMLAttributes["class"] }>();
|
|
|
|
|
|
|
|
|
|
const delegatedProps = computed(() => {
|
|
|
|
|
const { class: _, ...delegated } = props;
|
|
|
|
|
|
|
|
|
|
return delegated;
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<Label
|
2025-04-10 13:55:56 +02:00
|
|
|
data-slot="label"
|
2024-12-01 17:20:21 +01:00
|
|
|
v-bind="delegatedProps"
|
|
|
|
|
:class="
|
|
|
|
|
cn(
|
2025-04-10 13:55:56 +02:00
|
|
|
'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',
|
2024-12-01 17:20:21 +01:00
|
|
|
props.class,
|
|
|
|
|
)
|
|
|
|
|
"
|
|
|
|
|
>
|
|
|
|
|
<slot />
|
|
|
|
|
</Label>
|
|
|
|
|
</template>
|