flotilla/src/lib/components/Dialog.svelte

21 lines
595 B
Svelte
Raw Normal View History

2024-10-15 22:52:30 +00:00
<script lang="ts">
2024-10-17 23:03:50 +00:00
import {noop} from "@welshman/lib"
2024-10-15 22:52:30 +00:00
import {fade, fly} from "@lib/transition"
export let onClose: any = noop
2024-10-17 22:02:03 +00:00
export let fullscreen = false
2024-10-17 23:03:50 +00:00
$: extraClass =
!fullscreen && "card2 bg-alt max-h-[90vh] w-[90vw] overflow-auto text-base-content sm:w-[520px]"
2024-10-15 22:52:30 +00:00
</script>
<div class="center fixed inset-0 z-modal">
<button
2024-10-17 22:02:03 +00:00
class="absolute inset-0 cursor-pointer bg-black opacity-75"
transition:fade={{duration: 300}}
2024-10-15 22:52:30 +00:00
on:click={onClose} />
2024-10-17 23:03:50 +00:00
<div class="scroll-container relative {extraClass}" transition:fly={{duration: 300}}>
2024-10-15 22:52:30 +00:00
<slot />
</div>
</div>