e248e0073d
I had to downgrade Vite because the Storybook builder does not support v5 yet. Therefore this will be on a separate branch and updated as we move along with the codebase. Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
34 lines
717 B
Svelte
34 lines
717 B
Svelte
<script lang="ts">
|
|
import './button.css';
|
|
|
|
/**
|
|
* Is this the principal call to action on the page?
|
|
*/
|
|
export let primary = false;
|
|
|
|
/**
|
|
* What background color to use
|
|
*/
|
|
export let backgroundColor: string | undefined = undefined;
|
|
/**
|
|
* How large should the button be?
|
|
*/
|
|
export let size: 'small' | 'medium' | 'large' = 'medium';
|
|
/**
|
|
* Button contents
|
|
*/
|
|
export let label: string = '';
|
|
|
|
$: mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
|
|
|
|
$: style = backgroundColor ? `background-color: ${backgroundColor}` : '';
|
|
</script>
|
|
|
|
<button
|
|
type="button"
|
|
class={['storybook-button', `storybook-button--${size}`, mode].join(' ')}
|
|
{style}
|
|
on:click
|
|
>
|
|
{label}
|
|
</button>
|