2023-04-16 04:13:09 +02:00
|
|
|
<script lang="ts">
|
2023-12-15 01:46:01 +01:00
|
|
|
import { createEventDispatcher } from "svelte"
|
|
|
|
import { XCircleIcon } from "@rgossiaux/svelte-heroicons/solid"
|
|
|
|
import { trapFocus } from "trap-focus-svelte"
|
2023-04-16 04:13:09 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The slotted element will be shown on the right side
|
|
|
|
*/
|
2023-12-15 01:46:01 +01:00
|
|
|
const dispatch = createEventDispatcher<{ close }>()
|
2023-04-16 04:13:09 +02:00
|
|
|
</script>
|
|
|
|
|
2023-06-14 20:39:36 +02:00
|
|
|
<div
|
2023-12-19 23:02:02 +01:00
|
|
|
aria-modal="true"
|
2023-12-15 01:46:01 +01:00
|
|
|
autofocus
|
2023-12-21 01:46:18 +01:00
|
|
|
class="normal-background absolute top-0 right-0 flex h-screen w-full flex-col overflow-y-auto drop-shadow-2xl md:w-6/12 lg:w-5/12 xl:w-4/12"
|
2023-12-15 01:46:01 +01:00
|
|
|
role="dialog"
|
2023-06-14 20:39:36 +02:00
|
|
|
style="max-width: 100vw; max-height: 100vh"
|
2023-12-19 23:02:02 +01:00
|
|
|
tabindex="-1"
|
2023-12-15 01:46:01 +01:00
|
|
|
use:trapFocus
|
2023-06-14 20:39:36 +02:00
|
|
|
>
|
2023-12-15 01:46:01 +01:00
|
|
|
<slot name="close-button">
|
|
|
|
<button
|
2023-12-20 02:50:08 +01:00
|
|
|
class="absolute right-10 top-10 h-8 w-8 cursor-pointer rounded-full"
|
2023-12-15 01:46:01 +01:00
|
|
|
on:click={() => dispatch("close")}
|
|
|
|
>
|
|
|
|
<XCircleIcon />
|
|
|
|
</button>
|
|
|
|
</slot>
|
2023-12-19 23:02:02 +01:00
|
|
|
<div role="document">
|
2023-06-14 20:39:36 +02:00
|
|
|
<slot />
|
2023-04-16 04:13:09 +02:00
|
|
|
</div>
|
|
|
|
</div>
|