Dunlin is a lightweight, self-hosted CDN for personal projects.
at master 30 lines 1.0 kB view raw
1<script setup lang="ts"> 2import type { HTMLAttributes } from 'vue' 3import { reactiveOmit } from '@vueuse/core' 4import { ChevronRight } from 'lucide-vue-next' 5import { 6 DropdownMenuSubTrigger, 7 type DropdownMenuSubTriggerProps, 8 useForwardProps, 9} from 'reka-ui' 10import { cn } from '@/lib/utils' 11 12const props = defineProps<DropdownMenuSubTriggerProps & { class?: HTMLAttributes['class'], inset?: boolean }>() 13 14const delegatedProps = reactiveOmit(props, 'class', 'inset') 15const forwardedProps = useForwardProps(delegatedProps) 16</script> 17 18<template> 19 <DropdownMenuSubTrigger 20 data-slot="dropdown-menu-sub-trigger" 21 v-bind="forwardedProps" 22 :class="cn( 23 'focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8', 24 props.class, 25 )" 26 > 27 <slot /> 28 <ChevronRight class="ml-auto size-4" /> 29 </DropdownMenuSubTrigger> 30</template>