2019-08-20 08:18:23 +12:00
|
|
|
<script>
|
2020-02-03 22:50:30 +13:00
|
|
|
export let className = "default"
|
|
|
|
export let disabled = false
|
2020-05-09 07:29:15 +12:00
|
|
|
export let text
|
2020-02-03 22:50:30 +13:00
|
|
|
export let onClick
|
|
|
|
|
|
|
|
export let _bb
|
|
|
|
let theButton
|
|
|
|
|
2020-02-26 04:21:23 +13:00
|
|
|
$: if (_bb.props._children && _bb.props._children.length > 0)
|
2020-02-19 01:29:38 +13:00
|
|
|
theButton && _bb.attachChildren(theButton)
|
2020-02-03 22:50:30 +13:00
|
|
|
|
|
|
|
const clickHandler = () => {
|
|
|
|
_bb.call(onClick)
|
|
|
|
}
|
2019-08-20 08:18:23 +12:00
|
|
|
</script>
|
|
|
|
|
2020-02-03 22:50:30 +13:00
|
|
|
<button
|
|
|
|
bind:this={theButton}
|
2020-06-04 09:49:55 +12:00
|
|
|
class="default"
|
2020-02-03 22:50:30 +13:00
|
|
|
disabled={disabled || false}
|
2020-05-20 04:00:53 +12:00
|
|
|
on:click={clickHandler}>
|
2020-05-22 01:28:32 +12:00
|
|
|
{#if !_bb.props._children || _bb.props._children.length === 0}{text}{/if}
|
2019-08-27 18:32:56 +12:00
|
|
|
</button>
|
|
|
|
|
|
|
|
<style>
|
2020-02-03 22:50:30 +13:00
|
|
|
.default {
|
2020-06-04 09:49:55 +12:00
|
|
|
align-items: center;
|
|
|
|
font-size: 16px;
|
|
|
|
padding: 0px 16px;
|
2020-02-03 22:50:30 +13:00
|
|
|
box-sizing: border-box;
|
2020-06-04 09:49:55 +12:00
|
|
|
border-radius: 4px;
|
2020-02-03 22:50:30 +13:00
|
|
|
outline: none;
|
2020-06-04 09:49:55 +12:00
|
|
|
height: 40px;
|
|
|
|
cursor: pointer;
|
|
|
|
transition: all 0.2s ease 0s;
|
|
|
|
overflow: hidden;
|
|
|
|
outline: none;
|
|
|
|
user-select: none;
|
|
|
|
white-space: nowrap;
|
|
|
|
text-align: center;
|
2020-02-03 22:50:30 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
.border {
|
|
|
|
border: var(--border);
|
|
|
|
}
|
|
|
|
|
|
|
|
.color {
|
|
|
|
color: var(--color);
|
|
|
|
}
|
|
|
|
|
|
|
|
.background {
|
|
|
|
background: var(--background);
|
|
|
|
}
|
|
|
|
|
|
|
|
.hoverBorder:hover {
|
|
|
|
border: var(--hoverBorder);
|
|
|
|
}
|
|
|
|
|
|
|
|
.hoverColor:hover {
|
|
|
|
color: var(--hoverColor);
|
|
|
|
}
|
|
|
|
|
|
|
|
.hoverBack:hover {
|
|
|
|
background: var(--hoverBackground);
|
|
|
|
}
|
|
|
|
</style>
|