mirror of
https://github.com/bartvdbraak/hellob.art.git
synced 2025-04-26 09:01:21 +00:00
32 lines
947 B
Svelte
32 lines
947 B
Svelte
<script lang="ts">
|
|
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
import { cn } from '$lib/utils';
|
|
import { ChevronRight } from 'lucide-svelte';
|
|
|
|
type $$Props = DropdownMenuPrimitive.SubTriggerProps & {
|
|
inset?: boolean;
|
|
};
|
|
type $$Events = DropdownMenuPrimitive.SubTriggerEvents;
|
|
|
|
let className: $$Props['class'] = undefined;
|
|
export let inset: $$Props['inset'] = undefined;
|
|
export { className as class };
|
|
</script>
|
|
|
|
<DropdownMenuPrimitive.SubTrigger
|
|
class={cn(
|
|
'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[highlighted]:bg-accent data-[state=open]:bg-accent data-[highlighted]:text-accent-foreground data-[state=open]:text-accent-foreground',
|
|
inset && 'pl-8',
|
|
className
|
|
)}
|
|
{...$$restProps}
|
|
on:click
|
|
on:keydown
|
|
on:focusin
|
|
on:focusout
|
|
on:pointerleave
|
|
on:pointermove
|
|
>
|
|
<slot />
|
|
<ChevronRight class="ml-auto h-4 w-4" />
|
|
</DropdownMenuPrimitive.SubTrigger>
|