2024-04-08 17:12:39 +02:00
|
|
|
<script lang="ts">
|
|
|
|
|
import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
|
2026-04-06 18:22:01 +02:00
|
|
|
import ChevronRightIcon 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
|
2025-06-21 21:07:36 +02:00
|
|
|
data-slot="dropdown-menu-sub-trigger"
|
|
|
|
|
data-inset={inset}
|
2024-04-08 17:12:39 +02:00
|
|
|
class={cn(
|
2026-04-06 18:22:01 +02:00
|
|
|
"focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md px-1.5 py-1 text-sm data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
2024-04-08 17:12:39 +02:00
|
|
|
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?.()}
|
2026-04-06 18:22:01 +02:00
|
|
|
<ChevronRightIcon class="ml-auto" />
|
2024-04-08 17:12:39 +02:00
|
|
|
</DropdownMenuPrimitive.SubTrigger>
|