budibase/packages/standard-components/src/Button.svelte

35 lines
747 B
Svelte
Raw Normal View History

2019-08-19 22:18:23 +02:00
<script>
import { getContext } from "svelte"
2021-08-13 13:22:35 +02:00
import "@spectrum-css/button/dist/index-vars.css"
const { styleable } = getContext("sdk")
const component = getContext("component")
2020-02-03 10:50:30 +01:00
export let disabled = false
export let text = ""
export let onClick
export let size = "M"
export let type = "primary"
2021-07-05 11:19:27 +02:00
export let quiet = false
2019-08-19 22:18:23 +02:00
</script>
<button
class={`spectrum-Button spectrum-Button--size${size} spectrum-Button--${type}`}
2021-07-05 11:19:27 +02:00
class:spectrum-Button--quiet={quiet}
disabled={disabled || false}
use:styleable={$component.styles}
on:click={onClick}
>
{text || ""}
</button>
<style>
button {
width: fit-content;
width: -moz-fit-content;
}
2021-08-13 13:22:35 +02:00
.spectrum-Button--overBackground:hover {
color: #555;
}
</style>