2024-07-04 13:53:28 +00:00
|
|
|
<script lang="ts">
|
2024-07-06 04:37:29 +00:00
|
|
|
import { slide } from 'svelte/transition';
|
|
|
|
import { quintOut } from 'svelte/easing';
|
2024-07-04 13:53:28 +00:00
|
|
|
export let open = false;
|
2024-07-04 14:02:26 +00:00
|
|
|
export let className = '';
|
2024-07-04 13:53:28 +00:00
|
|
|
</script>
|
|
|
|
|
2024-07-04 14:02:26 +00:00
|
|
|
<div class={className}>
|
|
|
|
<button on:click={() => (open = !open)}>
|
2024-07-06 04:37:29 +00:00
|
|
|
<slot />
|
2024-07-04 14:02:26 +00:00
|
|
|
</button>
|
|
|
|
|
2024-07-06 04:37:29 +00:00
|
|
|
{#if open}
|
|
|
|
<div transition:slide={{ duration: 300, easing: quintOut, axis: 'y' }}>
|
|
|
|
<slot name="content" />
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
</div>
|