fix: address Storybook review findings
This commit is contained in:
parent
d95f064189
commit
17c9d24e31
8 changed files with 121 additions and 20 deletions
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue