blob: 9e935e40e96af7be6a23cdd360ee0703d5d06140 (
plain) (
tree)
|
|
<script lang="ts">
import { clickOutside } from '$lib/Actions';
import { fadeFast } from '$lib/Transitions';
import { fade } from 'svelte/transition';
export let visible: boolean;
export let parent: HTMLElement;
</script>
{#if visible}
<div
class="absolute z-[1] mt-1 w-max rounded bg-slate-700 p-1 shadow-sm shadow-slate-900"
transition:fade={fadeFast}
use:clickOutside={{ handler: () => (visible = false), ignore: parent }}
>
<slot />
</div>
{/if}
|