2021-03-31 11:59:07 +02:00
|
|
|
<script>
|
2021-04-08 17:04:27 +02:00
|
|
|
import "@spectrum-css/button/dist/index-vars.css"
|
|
|
|
|
|
|
|
export let disabled = false
|
2021-04-15 12:50:56 +02:00
|
|
|
export let size = "M"
|
2021-04-23 09:41:49 +02:00
|
|
|
export let cta = false
|
|
|
|
export let primary = false
|
|
|
|
export let secondary = false
|
2021-04-21 15:59:08 +02:00
|
|
|
export let warning = false
|
2021-04-23 09:41:49 +02:00
|
|
|
export let overBackground = false
|
2021-04-08 18:04:03 +02:00
|
|
|
export let quiet = false
|
2021-04-15 12:50:56 +02:00
|
|
|
export let icon = undefined
|
2021-04-20 13:31:08 +02:00
|
|
|
export let active = false
|
2021-04-15 12:50:56 +02:00
|
|
|
</script>
|
2021-04-08 17:04:27 +02:00
|
|
|
|
2021-04-09 15:21:51 +02: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}
|
2021-04-20 13:31:08 +02:00
|
|
|
class:active
|
2021-04-09 15:21:51 +02:00
|
|
|
class="spectrum-Button spectrum-Button--size{size.toUpperCase()}"
|
|
|
|
{disabled}
|
2021-05-04 12:04:42 +02:00
|
|
|
on:click|preventDefault
|
|
|
|
>
|
2021-04-09 15:21:51 +02:00
|
|
|
{#if icon}
|
2021-04-15 12:50:56 +02:00
|
|
|
<svg
|
|
|
|
class="spectrum-Icon spectrum-Icon--size{size.toUpperCase()}"
|
|
|
|
focusable="false"
|
|
|
|
aria-hidden="true"
|
2021-05-04 12:04:42 +02:00
|
|
|
aria-label={icon}
|
|
|
|
>
|
2021-04-09 15:21:51 +02:00
|
|
|
<use xlink:href="#spectrum-icon-18-{icon}" />
|
|
|
|
</svg>
|
|
|
|
{/if}
|
2021-04-15 12:50:56 +02:00
|
|
|
{#if $$slots}
|
2021-04-08 17:04:27 +02:00
|
|
|
<span class="spectrum-Button-label"><slot /></span>
|
2021-04-09 15:21:51 +02:00
|
|
|
{/if}
|
|
|
|
</button>
|
2021-03-31 11:59:07 +02:00
|
|
|
|
|
|
|
<style>
|
2021-04-16 18:12:22 +02:00
|
|
|
.spectrum-Button-label {
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
}
|
2021-04-26 17:02:03 +02:00
|
|
|
.active {
|
|
|
|
color: var(--spectrum-global-color-blue-600) !important;
|
|
|
|
}
|
2021-03-31 11:59:07 +02:00
|
|
|
</style>
|