feat: support skeleton prop

This commit is contained in:
Eric Liu 2020-07-24 17:14:12 -07:00
commit bd6bd15c79
5 changed files with 136 additions and 88 deletions

View file

@ -1,17 +1,29 @@
<script>
export let noTrailingSlash = false;
export let skeleton = false;
import BreadcrumbSkeleton from "./Breadcrumb.Skeleton.svelte";
</script>
<nav
aria-label="Breadcrumb"
{...$$restProps}
on:click
on:mouseover
on:mouseenter
on:mouseleave>
<ol
class:bx--breadcrumb={true}
class:bx--breadcrumb--no-trailing-slash={noTrailingSlash}>
<slot />
</ol>
</nav>
{#if skeleton}
<BreadcrumbSkeleton
{...$$restProps}
on:click
on:mouseover
on:mouseenter
on:mouseleave />
{:else}
<nav
aria-label="Breadcrumb"
{...$$restProps}
on:click
on:mouseover
on:mouseenter
on:mouseleave>
<ol
class:bx--breadcrumb={true}
class:bx--breadcrumb--no-trailing-slash={noTrailingSlash}>
<slot />
</ol>
</nav>
{/if}