1
0
Fork 0
mirror of synced 2024-06-30 03:50:37 +12:00
budibase/packages/standard-components/src/Container.svelte

89 lines
2.1 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-26 04:21:23 +13:00
{#if type === 'div'}
2021-03-11 06:56:16 +13:00
<div
in:transition={{ type: $component.transition }}
use:styleable={$component.styles}>
<slot />
</div>
2020-02-26 04:21:23 +13:00
{:else if type === 'header'}
2021-03-11 06:56:16 +13:00
<header
in:transition={{ type: $component.transition }}
use:styleable={$component.styles}>
<slot />
</header>
2020-02-26 04:21:23 +13:00
{:else if type === 'main'}
2021-03-11 06:56:16 +13:00
<main
in:transition={{ type: $component.transition }}
use:styleable={$component.styles}>
<slot />
</main>
2020-02-26 04:21:23 +13:00
{:else if type === 'footer'}
2021-03-11 06:56:16 +13:00
<footer
in:transition={{ type: $component.transition }}
use:styleable={$component.styles}>
<slot />
</footer>
2020-02-26 04:21:23 +13:00
{:else if type === 'aside'}
2021-03-11 06:56:16 +13:00
<aside
in:transition={{ type: $component.transition }}
use:styleable={$component.styles}>
<slot />
</aside>
2020-02-26 04:21:23 +13:00
{:else if type === 'summary'}
2021-03-11 06:56:16 +13:00
<summary
in:transition={{ type: $component.transition }}
use:styleable={$component.styles}>
<slot />
</summary>
2020-02-26 04:21:23 +13:00
{:else if type === 'details'}
2021-03-11 06:56:16 +13:00
<details
in:transition={{ type: $component.transition }}
use:styleable={$component.styles}>
<slot />
</details>
2020-02-26 04:21:23 +13:00
{:else if type === 'article'}
2021-03-11 06:56:16 +13:00
<article
in:transition={{ type: $component.transition }}
use:styleable={$component.styles}>
<slot />
</article>
2020-02-26 04:21:23 +13:00
{:else if type === 'nav'}
2021-03-11 06:56:16 +13:00
<nav
in:transition={{ type: $component.transition }}
use:styleable={$component.styles}>
<slot />
</nav>
2020-02-26 04:21:23 +13:00
{:else if type === 'mark'}
2021-03-11 06:56:16 +13:00
<mark
in:transition={{ type: $component.transition }}
use:styleable={$component.styles}>
<slot />
</mark>
2020-02-26 04:21:23 +13:00
{:else if type === 'figure'}
2021-03-11 06:56:16 +13:00
<figure
in:transition={{ type: $component.transition }}
use:styleable={$component.styles}>
<slot />
</figure>
2020-02-26 04:21:23 +13:00
{:else if type === 'figcaption'}
2021-03-11 06:56:16 +13:00
<figcaption
in:transition={{ type: $component.transition }}
use:styleable={$component.styles}>
<slot />
</figcaption>
2020-02-26 04:21:23 +13:00
{:else if type === 'paragraph'}
2021-03-11 06:56:16 +13:00
<p
in:transition={{ type: $component.transition }}
use:styleable={$component.styles}>
<slot />
</p>
{/if}