Add remove group, format

This commit is contained in:
Jon Staab
2024-08-16 10:50:38 -07:00
parent 437cfa7bc4
commit bd8fcd3264
51 changed files with 800 additions and 435 deletions
+28
View File
@@ -0,0 +1,28 @@
<script lang="ts">
import {fly} from "@lib/transition"
export let onClose
export let hideOnClick = false
const onMouseUp = (e: any) => {
if (hideOnClick || !element.contains(e.target)) {
setTimeout(onClose)
}
}
const onKeyDown = (e: any) => {
if (e.key === "Escape") {
setTimeout(onClose)
}
}
let element: HTMLElement
</script>
<svelte:window on:mouseup={onMouseUp} on:keydown={onKeyDown} />
<div class="relative w-full" bind:this={element}>
<div transition:fly|local class="absolute z-popover w-full">
<slot />
</div>
</div>