Add initial shared code packages
This commit is contained in:
commit
838a97d344
54 files changed
+6265
No files matched your search
@@ -0,0 +1,35 @@
|
||||
<script lang="ts">
|
||||
import type { Snippet } from 'svelte';
|
||||
|
||||
type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';
|
||||
type ButtonSize = 'sm' | 'md' | 'lg';
|
||||
|
||||
let {
|
||||
children,
|
||||
class: className = '',
|
||||
disabled = false,
|
||||
fullWidth = false,
|
||||
onclick,
|
||||
size = 'md',
|
||||
type = 'button',
|
||||
variant = 'primary'
|
||||
}: {
|
||||
children?: Snippet;
|
||||
class?: string;
|
||||
disabled?: boolean;
|
||||
fullWidth?: boolean;
|
||||
onclick?: (event: MouseEvent) => void;
|
||||
size?: ButtonSize;
|
||||
type?: 'button' | 'submit' | 'reset';
|
||||
variant?: ButtonVariant;
|
||||
} = $props();
|
||||
</script>
|
||||
|
||||
<button
|
||||
class={`sc-button sc-button-${variant} sc-button-${size}${fullWidth ? ' sc-button-full' : ''} ${className}`}
|
||||
{disabled}
|
||||
{onclick}
|
||||
{type}
|
||||
>
|
||||
{@render children?.()}
|
||||
</button>
|
||||
Reference in new issue
Block a user