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

63 lines
1.4 KiB
Svelte
Raw Normal View History

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