refactor: consistent component props

This commit is contained in:
2026-02-04 12:35:31 +05:00
parent aa5c55f95f
commit 2797fea079
13 changed files with 123 additions and 143 deletions
+13 -11
View File
@@ -3,6 +3,18 @@
type ButtonSize = "sm" | "md" | "lg";
type ButtonType = "button" | "submit" | "reset";
interface Props {
variant?: ButtonVariant;
size?: ButtonSize;
disabled?: boolean;
type?: ButtonType;
fullWidth?: boolean;
loading?: boolean;
class?: string;
children?: any;
[key: string]: any;
}
let {
variant = "primary",
size = "md",
@@ -13,17 +25,7 @@
class: className = "",
children,
...restProps
}: {
variant?: ButtonVariant;
size?: ButtonSize;
disabled?: boolean;
type?: ButtonType;
fullWidth?: boolean;
loading?: boolean;
class?: string;
children?: any;
[key: string]: any;
} = $props();
}: Props = $props();
</script>
<button
+11 -9
View File
@@ -2,6 +2,16 @@
type IconButtonVariant = "primary" | "secondary" | "danger";
type IconButtonSize = "sm" | "md" | "lg";
interface Props {
variant?: IconButtonVariant;
size?: IconButtonSize;
disabled?: boolean;
ariaLabel?: string;
class?: string;
children?: any;
[key: string]: any;
}
let {
variant = "secondary",
size = "md",
@@ -10,15 +20,7 @@
class: className = "",
children,
...restProps
}: {
variant?: IconButtonVariant;
size?: IconButtonSize;
disabled?: boolean;
ariaLabel?: string;
class?: string;
children?: any;
[key: string]: any;
} = $props();
}: Props = $props();
</script>
<button