chore: lift components folder

This commit is contained in:
Eric Liu 2020-07-19 09:06:08 -07:00
commit 2200b29b92
301 changed files with 57 additions and 76 deletions

47
src/Tag/Tag.svelte Normal file
View file

@ -0,0 +1,47 @@
<script>
export let type = undefined; // "red" | "magenta" | "purple" | "blue" | "cyan" | "teal" | "green" | "gray" | "cool-gray" | "warm-gray" | "high-contrast"
export let filter = false;
export let disabled = false;
export let title = "Clear filter";
export let id = "ccs-" + Math.random().toString(36);
import Close16 from "carbon-icons-svelte/lib/Close16";
</script>
{#if filter}
<div
aria-label={title}
class:bx--tag={true}
class:bx--tag--disabled={disabled}
class:bx--tag--filter={filter}
class="bx--tag--{type}"
{id}
{...$$restProps}>
<slot props={{ class: 'bx--tag__label' }}>
<span class:bx--tag__label={true}>{type}</span>
</slot>
<button
aria-labelledby={id}
class:bx--tag__close-icon={true}
{disabled}
{title}
on:click|stopPropagation
on:mouseover
on:mouseenter
on:mouseleave>
<Close16 />
</button>
</div>
{:else}
<span
class:bx--tag={true}
class:bx--tag--disabled={disabled}
class="bx--tag--{type}"
{...$$restProps}
on:click
on:mouseover
on:mouseenter
on:mouseleave>
<slot />
</span>
{/if}