Label.vue 768 B

1234567891011121314151617181920212223242526
  1. <script setup lang="ts">
  2. import type { LabelProps } from "reka-ui"
  3. import type { HTMLAttributes } from "vue"
  4. import { reactiveOmit } from "@vueuse/core"
  5. import { Label } from "reka-ui"
  6. import { cn } from '@/Packages/Shadcn/Lib/utils'
  7. const props = defineProps<LabelProps & { class?: HTMLAttributes["class"] }>()
  8. const delegatedProps = reactiveOmit(props, "class")
  9. </script>
  10. <template>
  11. <Label
  12. data-slot="label"
  13. v-bind="delegatedProps"
  14. :class="
  15. cn(
  16. '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',
  17. props.class,
  18. )
  19. "
  20. >
  21. <slot />
  22. </Label>
  23. </template>