mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-10-06 09:49:04 +02:00
30 lines
1017 B
Svelte
30 lines
1017 B
Svelte
<script lang="ts">
|
|
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
import ChevronRightIcon from '@lucide/svelte/icons/chevron-right';
|
|
import { cn } from '#lib/utils/style.js';
|
|
|
|
let {
|
|
ref = $bindable(null),
|
|
class: className,
|
|
inset,
|
|
children,
|
|
...restProps
|
|
}: DropdownMenuPrimitive.SubTriggerProps & {
|
|
inset?: boolean;
|
|
} = $props();
|
|
</script>
|
|
|
|
<DropdownMenuPrimitive.SubTrigger
|
|
bind:ref
|
|
data-slot="dropdown-menu-sub-trigger"
|
|
data-inset={inset}
|
|
class={cn(
|
|
"focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground flex cursor-default items-center gap-2 rounded-2xl px-3 py-1.5 text-sm font-medium outline-hidden select-none data-inset:pl-9.5 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
className
|
|
)}
|
|
{...restProps}
|
|
>
|
|
{@render children?.()}
|
|
<ChevronRightIcon class="ml-auto" />
|
|
</DropdownMenuPrimitive.SubTrigger>
|