Badge.vue 676 B

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