2024-04-29 17:03:23 +02:00
|
|
|
<script lang="ts">
|
|
|
|
|
import { ContextMenu as ContextMenuPrimitive } from "bits-ui";
|
2025-06-08 16:32:41 +02:00
|
|
|
import { cn } from "$lib/utils.js";
|
2026-04-06 18:22:01 +02:00
|
|
|
import ContextMenuPortal from "./context-menu-portal.svelte";
|
|
|
|
|
import type { ComponentProps } from "svelte";
|
|
|
|
|
import type { WithoutChildrenOrChild } from "$lib/utils.js";
|
2024-04-29 17:03:23 +02:00
|
|
|
|
2025-06-08 16:32:41 +02:00
|
|
|
let {
|
|
|
|
|
ref = $bindable(null),
|
|
|
|
|
portalProps,
|
|
|
|
|
class: className,
|
|
|
|
|
...restProps
|
|
|
|
|
}: ContextMenuPrimitive.ContentProps & {
|
2026-04-06 18:22:01 +02:00
|
|
|
portalProps?: WithoutChildrenOrChild<ComponentProps<typeof ContextMenuPortal>>;
|
2025-06-08 16:32:41 +02:00
|
|
|
} = $props();
|
2024-04-29 17:03:23 +02:00
|
|
|
</script>
|
|
|
|
|
|
2026-04-06 18:22:01 +02:00
|
|
|
<ContextMenuPortal {...portalProps}>
|
2025-06-08 16:32:41 +02:00
|
|
|
<ContextMenuPrimitive.Content
|
|
|
|
|
bind:ref
|
2025-06-21 21:07:36 +02:00
|
|
|
data-slot="context-menu-content"
|
2025-06-08 16:32:41 +02:00
|
|
|
class={cn(
|
2026-04-06 18:22:01 +02:00
|
|
|
"data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-36 rounded-lg p-1 shadow-md ring-1 duration-100 z-50 overflow-x-hidden overflow-y-auto outline-none",
|
2025-06-08 16:32:41 +02:00
|
|
|
className
|
|
|
|
|
)}
|
|
|
|
|
{...restProps}
|
|
|
|
|
/>
|
2026-04-06 18:22:01 +02:00
|
|
|
</ContextMenuPortal>
|