fix: address Storybook review findings
This commit is contained in:
parent
d95f064189
commit
17c9d24e31
8 changed files with 121 additions and 20 deletions
|
|
@ -1,6 +1,16 @@
|
|||
<script lang="ts">
|
||||
import type { HTMLButtonAttributes } from "svelte/elements";
|
||||
import IconGlyph from "./IconGlyph.svelte";
|
||||
|
||||
type ButtonProps = Omit<HTMLButtonAttributes, "type"> & {
|
||||
label: string;
|
||||
variant?: "primary" | "secondary" | "danger" | "ghost";
|
||||
size?: "default" | "compact";
|
||||
icon?: string;
|
||||
loading?: boolean;
|
||||
type?: "button" | "submit" | "reset";
|
||||
};
|
||||
|
||||
let {
|
||||
label,
|
||||
variant = "primary",
|
||||
|
|
@ -9,19 +19,14 @@
|
|||
disabled = false,
|
||||
loading = false,
|
||||
type = "button",
|
||||
}: {
|
||||
label: string;
|
||||
variant?: "primary" | "secondary" | "danger" | "ghost";
|
||||
size?: "default" | "compact";
|
||||
icon?: string;
|
||||
disabled?: boolean;
|
||||
loading?: boolean;
|
||||
type?: "button" | "submit" | "reset";
|
||||
} = $props();
|
||||
class: className = "",
|
||||
...buttonProps
|
||||
}: ButtonProps = $props();
|
||||
</script>
|
||||
|
||||
<button
|
||||
class="ui-button"
|
||||
{...buttonProps}
|
||||
class={className ? `ui-button ${className}` : "ui-button"}
|
||||
data-variant={variant}
|
||||
data-size={size}
|
||||
data-loading={loading}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue