frontend/app/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue

36 lines
1.1 KiB
Vue
Raw Normal View History

<script setup lang="ts">
import { reactiveOmit } from "@vueuse/core";
import { ChevronRight } from "lucide-vue-next";
import {
DropdownMenuSubTrigger,
type DropdownMenuSubTriggerProps,
useForwardProps,
} from "reka-ui";
import type { HTMLAttributes } from "vue";
2025-06-26 22:39:02 +02:00
import { cn } from "@/lib/utils";
const props = defineProps<
DropdownMenuSubTriggerProps & {
class?: HTMLAttributes["class"];
inset?: boolean;
}
>();
const delegatedProps = reactiveOmit(props, "class", "inset");
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
2025-12-09 22:32:22 +01:00
<DropdownMenuSubTrigger
data-slot="dropdown-menu-sub-trigger"
v-bind="forwardedProps"
:class="cn(
'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',
props.class,
)"
2025-12-09 22:32:22 +01:00
>
2026-01-09 21:47:12 +01:00
<slot />
<ChevronRight class="ml-auto size-4" />
2025-12-09 22:32:22 +01:00
</DropdownMenuSubTrigger>
</template>