budibase/packages/standard-components/src/Container.svelte

63 lines
2.0 KiB
Svelte
Raw Normal View History

<script>
import { getContext } from "svelte"
const { styleable, transition } = getContext("sdk")
const component = getContext("component")
export let type = "div"
</script>
2020-02-25 16:21:23 +01:00
{#if type === 'div'}
<div in:transition={{type: $component.transition}} use:styleable={$component.styles}>
<slot />
</div>
2020-02-25 16:21:23 +01:00
{:else if type === 'header'}
<header in:transition={{type: $component.transition}} use:styleable={$component.styles}>
<slot />
</header>
2020-02-25 16:21:23 +01:00
{:else if type === 'main'}
<main in:transition={{type: $component.transition}} use:styleable={$component.styles}>
<slot />
</main>
2020-02-25 16:21:23 +01:00
{:else if type === 'footer'}
<footer in:transition={{type: $component.transition}} use:styleable={$component.styles}>
<slot />
</footer>
2020-02-25 16:21:23 +01:00
{:else if type === 'aside'}
<aside in:transition={{type: $component.transition}} use:styleable={$component.styles}>
<slot />
</aside>
2020-02-25 16:21:23 +01:00
{:else if type === 'summary'}
<summary in:transition={{type: $component.transition}} use:styleable={$component.styles}>
<slot />
</summary>
2020-02-25 16:21:23 +01:00
{:else if type === 'details'}
<details in:transition={{type: $component.transition}} use:styleable={$component.styles}>
<slot />
</details>
2020-02-25 16:21:23 +01:00
{:else if type === 'article'}
<article in:transition={{type: $component.transition}} use:styleable={$component.styles}>
<slot />
</article>
2020-02-25 16:21:23 +01:00
{:else if type === 'nav'}
<nav in:transition={{type: $component.transition}} use:styleable={$component.styles}>
<slot />
</nav>
2020-02-25 16:21:23 +01:00
{:else if type === 'mark'}
<mark in:transition={{type: $component.transition}} use:styleable={$component.styles}>
<slot />
</mark>
2020-02-25 16:21:23 +01:00
{:else if type === 'figure'}
<figure in:transition={{type: $component.transition}} use:styleable={$component.styles}>
<slot />
</figure>
2020-02-25 16:21:23 +01:00
{:else if type === 'figcaption'}
<figcaption in:transition={{type: $component.transition}} use:styleable={$component.styles}>
<slot />
</figcaption>
2020-02-25 16:21:23 +01:00
{:else if type === 'paragraph'}
<p in:transition={{type: $component.transition}} use:styleable={$component.styles}>
<slot />
</p>
{/if}