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

59 lines
917 B
Svelte
Raw Normal View History

<script>
2020-02-25 16:21:23 +01:00
export let className = ""
export let type = "div"
2020-02-21 12:43:21 +01:00
$: console.log(type)
</script>
2020-02-25 16:21:23 +01:00
{#if type === 'div'}
<div>
<slot />
</div>
2020-02-25 16:21:23 +01:00
{:else if type === 'header'}
<header>
<slot />
</header>
2020-02-25 16:21:23 +01:00
{:else if type === 'main'}
<main>
<slot />
</main>
2020-02-25 16:21:23 +01:00
{:else if type === 'footer'}
<footer>
<slot />
</footer>
2020-02-25 16:21:23 +01:00
{:else if type === 'aside'}
<aside>
<slot />
</aside>
2020-02-25 16:21:23 +01:00
{:else if type === 'summary'}
<summary>
<slot />
</summary>
2020-02-25 16:21:23 +01:00
{:else if type === 'details'}
<details>
<slot />
</details>
2020-02-25 16:21:23 +01:00
{:else if type === 'article'}
<article>
<slot />
</article>
2020-02-25 16:21:23 +01:00
{:else if type === 'nav'}
<nav>
<slot />
</nav>
2020-02-25 16:21:23 +01:00
{:else if type === 'mark'}
<mark><slot /></mark>
2020-02-25 16:21:23 +01:00
{:else if type === 'figure'}
<figure>
<slot />
</figure>
2020-02-25 16:21:23 +01:00
{:else if type === 'figcaption'}
<figcaption>
<slot />
</figcaption>
2020-02-25 16:21:23 +01:00
{:else if type === 'paragraph'}
<p>
<slot />
</p>
{/if}