2024-07-15 13:19:56 +02:00
|
|
|
<script lang="ts">
|
2025-06-21 21:07:36 +02:00
|
|
|
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
2026-04-06 18:22:01 +02:00
|
|
|
import AlertDialogPortal from "./alert-dialog-portal.svelte";
|
2025-06-08 16:32:41 +02:00
|
|
|
import AlertDialogOverlay from "./alert-dialog-overlay.svelte";
|
2025-06-21 21:07:36 +02:00
|
|
|
import { cn, type WithoutChild, type WithoutChildrenOrChild } from "$lib/utils.js";
|
2026-04-06 18:22:01 +02:00
|
|
|
import type { ComponentProps } from "svelte";
|
2024-07-15 13:19:56 +02:00
|
|
|
|
2025-06-08 16:32:41 +02:00
|
|
|
let {
|
|
|
|
|
ref = $bindable(null),
|
|
|
|
|
class: className,
|
2026-04-06 18:22:01 +02:00
|
|
|
size = "default",
|
2025-06-08 16:32:41 +02:00
|
|
|
portalProps,
|
|
|
|
|
...restProps
|
|
|
|
|
}: WithoutChild<AlertDialogPrimitive.ContentProps> & {
|
2026-04-06 18:22:01 +02:00
|
|
|
size?: "default" | "sm";
|
|
|
|
|
portalProps?: WithoutChildrenOrChild<ComponentProps<typeof AlertDialogPortal>>;
|
2025-06-08 16:32:41 +02:00
|
|
|
} = $props();
|
2024-07-15 13:19:56 +02:00
|
|
|
</script>
|
|
|
|
|
|
2026-04-06 18:22:01 +02:00
|
|
|
<AlertDialogPortal {...portalProps}>
|
2025-06-08 16:32:41 +02:00
|
|
|
<AlertDialogOverlay />
|
2024-07-15 13:19:56 +02:00
|
|
|
<AlertDialogPrimitive.Content
|
2025-06-08 16:32:41 +02:00
|
|
|
bind:ref
|
2025-06-21 21:07:36 +02:00
|
|
|
data-slot="alert-dialog-content"
|
2026-04-06 18:22:01 +02:00
|
|
|
data-size={size}
|
2024-07-15 13:19:56 +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 bg-popover text-popover-foreground ring-foreground/10 gap-4 rounded-xl p-4 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none",
|
2024-07-15 13:19:56 +02:00
|
|
|
className
|
|
|
|
|
)}
|
2025-06-08 16:32:41 +02:00
|
|
|
{...restProps}
|
|
|
|
|
/>
|
2026-04-06 18:22:01 +02:00
|
|
|
</AlertDialogPortal>
|