budibase/packages/builder/src/components/common/ActionButton.svelte

71 lines
1.1 KiB
Svelte
Raw Normal View History

2020-01-30 17:22:19 +01:00
<script>
2020-02-03 10:50:30 +01:00
export let disabled = false
export let hidden = false
export let secondary = false
2020-02-03 10:50:30 +01:00
export let primary = true
export let cancel = false
2020-02-03 10:50:30 +01:00
export let alert = false
export let warning = false
2020-01-30 17:22:19 +01:00
</script>
2020-02-03 10:50:30 +01:00
<button
on:click
class="button"
class:hidden
class:secondary
2020-02-03 10:50:30 +01:00
class:primary
class:alert
class:cancel
2020-02-03 10:50:30 +01:00
class:warning
{disabled}>
<slot />
</button>
2020-01-30 17:22:19 +01:00
<style>
2020-01-31 10:45:02 +01:00
.primary {
color: #ffffff;
background: var(--blue);
border: solid 1px var(--blue);
2020-01-31 10:45:02 +01:00
}
.alert {
color: white;
background: #E26D69;
border: solid 1px #E26D69;
2020-01-31 10:45:02 +01:00
}
.cancel {
color: var(--secondary40);
background: none;
}
.secondary {
color: var(--ink);
border: solid 1px var(--grey-dark);
background: none;
}
2020-01-31 10:45:02 +01:00
.button {
2020-02-24 16:00:48 +01:00
font-size: 14px;
font-weight: 500;
2020-01-30 17:22:19 +01:00
border-radius: 5px;
padding: 10px 20px;
height: 40px;
2020-01-30 17:22:19 +01:00
}
2020-01-31 10:45:02 +01:00
.button:hover {
2020-01-30 17:22:19 +01:00
cursor: pointer;
2020-05-07 11:53:34 +02:00
filter: saturate(90%);
2020-01-30 17:22:19 +01:00
}
2020-01-31 10:45:02 +01:00
.button:disabled {
2020-01-30 22:00:19 +01:00
color: rgba(22, 48, 87, 0.2);
2020-01-30 17:22:19 +01:00
cursor: default;
background: transparent;
}
2020-01-30 21:01:18 +01:00
.hidden {
visibility: hidden;
}
2020-01-30 17:22:19 +01:00
</style>