fix: address Storybook review findings

This commit is contained in:
vince 2026-06-18 19:01:53 +02:00
parent d95f064189
commit 17c9d24e31
8 changed files with 121 additions and 20 deletions

View file

@ -1,20 +1,33 @@
<script lang="ts">
import type { HTMLButtonAttributes } from "svelte/elements";
import IconGlyph from "./IconGlyph.svelte";
type IconButtonProps = Omit<HTMLButtonAttributes, "type"> & {
icon: string;
label: string;
active?: boolean;
type?: "button" | "submit" | "reset";
};
let {
icon,
label,
active = false,
disabled = false,
}: {
icon: string;
label: string;
active?: boolean;
disabled?: boolean;
} = $props();
type = "button",
class: className = "",
...buttonProps
}: IconButtonProps = $props();
</script>
<button class="icon-button" aria-label={label} data-active={active} {disabled}>
<button
{...buttonProps}
class={className ? `icon-button ${className}` : "icon-button"}
aria-label={label}
data-active={active}
{disabled}
{type}
>
<IconGlyph name={icon} size="sm" />
</button>