2021-03-31 22:59:07 +13:00
|
|
|
<script>
|
2021-04-09 03:04:27 +12:00
|
|
|
import "@spectrum-css/button/dist/index-vars.css"
|
|
|
|
|
|
|
|
export let disabled = false
|
|
|
|
|
|
|
|
/** @type {('S', 'M', 'L', 'XL')} Size of button */
|
|
|
|
export let size = "M";
|
2021-04-10 01:21:51 +12:00
|
|
|
|
|
|
|
// Types
|
|
|
|
export let cta, primary, secondary, warning, overBackground;
|
2021-04-09 04:04:03 +12:00
|
|
|
|
|
|
|
export let quiet = false
|
2021-04-09 03:04:27 +12:00
|
|
|
|
|
|
|
export let icon = undefined;
|
2021-03-31 22:59:07 +13:00
|
|
|
</script>
|
|
|
|
|
2021-04-09 03:04:27 +12:00
|
|
|
|
2021-04-10 01:21:51 +12:00
|
|
|
<button
|
|
|
|
class:spectrum-Button--cta={cta}
|
|
|
|
class:spectrum-Button--primary={primary}
|
|
|
|
class:spectrum-Button--secondary={secondary}
|
|
|
|
class:spectrum-Button--warning={warning}
|
|
|
|
class:spectrum-Button--overBackground={overBackground}
|
|
|
|
class:spectrum-Button--quiet={quiet}
|
|
|
|
class="spectrum-Button spectrum-Button--size{size.toUpperCase()}"
|
|
|
|
{disabled}
|
|
|
|
on:click|preventDefault>
|
|
|
|
{#if icon}
|
|
|
|
<svg class="spectrum-Icon spectrum-Icon--size{size.toUpperCase()}" focusable="false" aria-hidden="true" aria-label="{icon}">
|
|
|
|
<use xlink:href="#spectrum-icon-18-{icon}" />
|
|
|
|
</svg>
|
|
|
|
{/if}
|
|
|
|
{#if $$slots}
|
2021-04-09 03:04:27 +12:00
|
|
|
<span class="spectrum-Button-label"><slot /></span>
|
2021-04-10 01:21:51 +12:00
|
|
|
{/if}
|
|
|
|
</button>
|
2021-03-31 22:59:07 +13:00
|
|
|
|
|
|
|
<style>
|
|
|
|
|
|
|
|
</style>
|