DropdownMenuLabel.vue 782 B

1234567891011121314151617181920212223
  1. <script setup lang="ts">
  2. import type { DropdownMenuLabelProps } from "reka-ui"
  3. import type { HTMLAttributes } from "vue"
  4. import { reactiveOmit } from "@vueuse/core"
  5. import { DropdownMenuLabel, useForwardProps } from "reka-ui"
  6. import { cn } from '@/Packages/Shadcn/Lib/utils'
  7. const props = defineProps<DropdownMenuLabelProps & { class?: HTMLAttributes["class"], inset?: boolean }>()
  8. const delegatedProps = reactiveOmit(props, "class", "inset")
  9. const forwardedProps = useForwardProps(delegatedProps)
  10. </script>
  11. <template>
  12. <DropdownMenuLabel
  13. data-slot="dropdown-menu-label"
  14. :data-inset="inset ? '' : undefined"
  15. v-bind="forwardedProps"
  16. :class="cn('px-2 py-1.5 text-sm font-medium data-[inset]:pl-8', props.class)"
  17. >
  18. <slot />
  19. </DropdownMenuLabel>
  20. </template>