fix(ui): make Button.children optional in props type
svelte-check (strict) flagged ContactFormComponent for not passing children to <Button>. The component already renders label as fallback; typed children as optional Snippet so callers don't need to pass it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
type Variant = 'primary' | 'secondary' | 'ghost';
|
type Variant = 'primary' | 'secondary' | 'ghost';
|
||||||
type Size = 'sm' | 'md' | 'large';
|
type Size = 'sm' | 'md' | 'large';
|
||||||
|
|
||||||
|
import type { Snippet } from 'svelte';
|
||||||
|
|
||||||
let {
|
let {
|
||||||
variant = 'primary',
|
variant = 'primary',
|
||||||
size = 'md',
|
size = 'md',
|
||||||
@@ -9,7 +11,15 @@
|
|||||||
loading = false,
|
loading = false,
|
||||||
type = 'button' as 'button' | 'submit' | 'reset',
|
type = 'button' as 'button' | 'submit' | 'reset',
|
||||||
label = '',
|
label = '',
|
||||||
children,
|
children = undefined,
|
||||||
|
}: {
|
||||||
|
variant?: 'primary' | 'secondary' | 'ghost';
|
||||||
|
size?: 'sm' | 'md' | 'large';
|
||||||
|
disabled?: boolean;
|
||||||
|
loading?: boolean;
|
||||||
|
type?: 'button' | 'submit' | 'reset';
|
||||||
|
label?: string;
|
||||||
|
children?: Snippet;
|
||||||
} = $props();
|
} = $props();
|
||||||
|
|
||||||
const base =
|
const base =
|
||||||
|
|||||||
Reference in New Issue
Block a user