Files
gpx.studio/website/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte

29 lines
786 B
Svelte
Raw Normal View History

2024-04-08 17:12:39 +02:00
<script lang="ts">
import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
2025-06-08 16:32:41 +02:00
import ChevronRight from "@lucide/svelte/icons/chevron-right";
2024-04-08 17:12:39 +02:00
import { cn } from "$lib/utils.js";
2025-06-08 16:32:41 +02:00
let {
ref = $bindable(null),
class: className,
inset,
children,
...restProps
}: DropdownMenuPrimitive.SubTriggerProps & {
2024-04-08 17:12:39 +02:00
inset?: boolean;
2025-06-08 16:32:41 +02:00
} = $props();
2024-04-08 17:12:39 +02:00
</script>
<DropdownMenuPrimitive.SubTrigger
2025-06-08 16:32:41 +02:00
bind:ref
2024-04-08 17:12:39 +02:00
class={cn(
2025-06-08 16:32:41 +02:00
"data-[highlighted]:bg-accent data-[state=open]:bg-accent flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
2024-04-08 17:12:39 +02:00
inset && "pl-8",
className
)}
2025-06-08 16:32:41 +02:00
{...restProps}
2024-04-08 17:12:39 +02:00
>
2025-06-08 16:32:41 +02:00
{@render children?.()}
<ChevronRight class="ml-auto" />
2024-04-08 17:12:39 +02:00
</DropdownMenuPrimitive.SubTrigger>