rework Divider to use new API

This commit is contained in:
Keviin Åberg Kultalahti 2021-04-27 16:25:39 +02:00
parent 19052a66a5
commit c1542dc49e
3 changed files with 10 additions and 14 deletions

View File

@ -1,23 +1,19 @@
<script> <script>
import "@spectrum-css/divider/dist/index-vars.css" import "@spectrum-css/divider/dist/index-vars.css"
export let l = false export let size = "M"
export let m = false
export let s = false
export let vertical = false export let vertical = false
export let noMargin = false export let noMargin = false
export let noGrid = false export let noGrid = false
$: useDefault = ![l, m, s].includes(true)
</script> </script>
<hr <hr
class:noMargin class:noMargin
class:noGrid class:noGrid
class:spectrum-Divider--sizeL={l} class="spectrum-Divider spectrum-Divider--{vertical
class:spectrum-Divider--sizeM={m || useDefault} ? 'vertical'
class:spectrum-Divider--sizeS={s} : 'horizontal'} spectrum-Dialog-divider spectrum-Divider--size{size}"
class="spectrum-Divider spectrum-Divider--{vertical ? 'vertical' : 'horizontal'} spectrum-Dialog-divider" /> />
<style> <style>
hr.noMargin { hr.noMargin {

View File

@ -42,7 +42,7 @@
{title} {title}
</h1> </h1>
<Divider m /> <Divider size="M" />
<!-- TODO: Remove content-grid class once Layout components are in bbui --> <!-- TODO: Remove content-grid class once Layout components are in bbui -->
<section class="spectrum-Dialog-content content-grid"> <section class="spectrum-Dialog-content content-grid">
<slot /> <slot />

View File

@ -149,7 +149,7 @@
</li> </li>
{/each} {/each}
</ul> </ul>
<Divider s /> <Divider size="S" />
<div class="title"> <div class="title">
<Heading xs h3>Views</Heading> <Heading xs h3>Views</Heading>
</div> </div>
@ -162,7 +162,7 @@
</li> </li>
{/each} {/each}
</ul> </ul>
<Divider s /> <Divider size="S" />
<div class="title"> <div class="title">
<Heading xs h3>Relationships</Heading> <Heading xs h3>Relationships</Heading>
</div> </div>
@ -175,7 +175,7 @@
</li> </li>
{/each} {/each}
</ul> </ul>
<Divider s /> <Divider size="S" />
<div class="title"> <div class="title">
<Heading xs h3>Queries</Heading> <Heading xs h3>Queries</Heading>
</div> </div>
@ -190,7 +190,7 @@
</ul> </ul>
{#if otherSources?.length} {#if otherSources?.length}
<Divider s /> <Divider size="S" />
<div class="title"> <div class="title">
<Heading extraSmall>Other</Heading> <Heading extraSmall>Other</Heading>
</div> </div>