2020-02-14 12:51:45 +01:00
|
|
|
<script>
|
2020-11-18 20:18:18 +01:00
|
|
|
import { getContext } from "svelte"
|
|
|
|
|
2021-03-01 16:53:37 +01:00
|
|
|
const { styleable, transition } = getContext("sdk")
|
2020-11-24 12:02:10 +01:00
|
|
|
const component = getContext("component")
|
2020-11-17 13:08:24 +01:00
|
|
|
|
2020-03-04 16:20:53 +01:00
|
|
|
export let type = "div"
|
2020-02-14 12:51:45 +01:00
|
|
|
</script>
|
|
|
|
|
2020-02-25 16:21:23 +01:00
|
|
|
{#if type === 'div'}
|
2021-03-01 16:53:37 +01:00
|
|
|
<div in:transition={{type: $component.transition}} use:styleable={$component.styles}>
|
2020-11-13 16:42:32 +01:00
|
|
|
<slot />
|
|
|
|
</div>
|
2020-02-25 16:21:23 +01:00
|
|
|
{:else if type === 'header'}
|
2021-03-01 16:53:37 +01:00
|
|
|
<header in:transition={{type: $component.transition}} use:styleable={$component.styles}>
|
2020-11-13 16:42:32 +01:00
|
|
|
<slot />
|
|
|
|
</header>
|
2020-02-25 16:21:23 +01:00
|
|
|
{:else if type === 'main'}
|
2021-03-01 16:53:37 +01:00
|
|
|
<main in:transition={{type: $component.transition}} use:styleable={$component.styles}>
|
2020-11-13 16:42:32 +01:00
|
|
|
<slot />
|
|
|
|
</main>
|
2020-02-25 16:21:23 +01:00
|
|
|
{:else if type === 'footer'}
|
2021-03-01 16:53:37 +01:00
|
|
|
<footer in:transition={{type: $component.transition}} use:styleable={$component.styles}>
|
2020-11-13 16:42:32 +01:00
|
|
|
<slot />
|
|
|
|
</footer>
|
2020-02-25 16:21:23 +01:00
|
|
|
{:else if type === 'aside'}
|
2021-03-01 16:53:37 +01:00
|
|
|
<aside in:transition={{type: $component.transition}} use:styleable={$component.styles}>
|
2020-11-13 16:42:32 +01:00
|
|
|
<slot />
|
|
|
|
</aside>
|
2020-02-25 16:21:23 +01:00
|
|
|
{:else if type === 'summary'}
|
2021-03-01 16:53:37 +01:00
|
|
|
<summary in:transition={{type: $component.transition}} use:styleable={$component.styles}>
|
2020-11-13 16:42:32 +01:00
|
|
|
<slot />
|
|
|
|
</summary>
|
2020-02-25 16:21:23 +01:00
|
|
|
{:else if type === 'details'}
|
2021-03-01 16:53:37 +01:00
|
|
|
<details in:transition={{type: $component.transition}} use:styleable={$component.styles}>
|
2020-11-13 16:42:32 +01:00
|
|
|
<slot />
|
|
|
|
</details>
|
2020-02-25 16:21:23 +01:00
|
|
|
{:else if type === 'article'}
|
2021-03-01 16:53:37 +01:00
|
|
|
<article in:transition={{type: $component.transition}} use:styleable={$component.styles}>
|
2020-11-13 16:42:32 +01:00
|
|
|
<slot />
|
|
|
|
</article>
|
2020-02-25 16:21:23 +01:00
|
|
|
{:else if type === 'nav'}
|
2021-03-01 16:53:37 +01:00
|
|
|
<nav in:transition={{type: $component.transition}} use:styleable={$component.styles}>
|
2020-11-13 16:42:32 +01:00
|
|
|
<slot />
|
|
|
|
</nav>
|
2020-02-25 16:21:23 +01:00
|
|
|
{:else if type === 'mark'}
|
2021-03-01 16:53:37 +01:00
|
|
|
<mark in:transition={{type: $component.transition}} use:styleable={$component.styles}>
|
2020-11-17 13:08:24 +01:00
|
|
|
<slot />
|
|
|
|
</mark>
|
2020-02-25 16:21:23 +01:00
|
|
|
{:else if type === 'figure'}
|
2021-03-01 16:53:37 +01:00
|
|
|
<figure in:transition={{type: $component.transition}} use:styleable={$component.styles}>
|
2020-11-13 16:42:32 +01:00
|
|
|
<slot />
|
|
|
|
</figure>
|
2020-02-25 16:21:23 +01:00
|
|
|
{:else if type === 'figcaption'}
|
2021-03-01 16:53:37 +01:00
|
|
|
<figcaption in:transition={{type: $component.transition}} use:styleable={$component.styles}>
|
2020-11-13 16:42:32 +01:00
|
|
|
<slot />
|
|
|
|
</figcaption>
|
2020-02-25 16:21:23 +01:00
|
|
|
{:else if type === 'paragraph'}
|
2021-03-01 16:53:37 +01:00
|
|
|
<p in:transition={{type: $component.transition}} use:styleable={$component.styles}>
|
2020-11-13 16:42:32 +01:00
|
|
|
<slot />
|
|
|
|
</p>
|
2020-02-14 12:51:45 +01:00
|
|
|
{/if}
|