2019-08-20 08:18:23 +12:00
|
|
|
<script>
|
2019-08-27 18:32:56 +12:00
|
|
|
export let className = "default";
|
2019-08-20 08:18:23 +12:00
|
|
|
export let disabled = false;
|
2019-08-27 18:32:56 +12:00
|
|
|
export let contentText;
|
|
|
|
export let contentComponent;
|
|
|
|
|
2019-08-20 08:18:23 +12:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<button class={className} {disabled} on:click>
|
2019-08-27 18:32:56 +12:00
|
|
|
{#if contentComponent && contentComponent._component}
|
|
|
|
{contentComponent}
|
|
|
|
{:else if contentText}
|
2019-08-20 08:18:23 +12:00
|
|
|
{contentText}
|
|
|
|
{:else}
|
2019-08-27 18:32:56 +12:00
|
|
|
<slot />
|
2019-08-20 08:18:23 +12:00
|
|
|
{/if}
|
2019-08-27 18:32:56 +12:00
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
|
|
|
.default {
|
|
|
|
font-family: inherit;
|
|
|
|
font-size: inherit;
|
|
|
|
padding: 0.4em;
|
|
|
|
margin: 0 0 0.5em 0;
|
|
|
|
box-sizing: border-box;
|
|
|
|
border: 1px solid #ccc;
|
|
|
|
border-radius: 2px;
|
|
|
|
color: #333;
|
|
|
|
background-color: #f4f4f4;
|
|
|
|
outline: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.default:active {
|
|
|
|
background-color: #ddd;
|
|
|
|
}
|
|
|
|
|
|
|
|
.default:focus {
|
|
|
|
border-color: #666;
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|