refactor(ui): extract reusable component package

This commit is contained in:
vince 2026-06-20 05:27:09 +02:00
parent e68eb2efee
commit 78a4e28dd4
85 changed files with 4144 additions and 0 deletions

View file

@ -0,0 +1,33 @@
import type { ButtonHTMLAttributes } from "react";
import { IconGlyph } from "./IconGlyph";
export interface IconButtonProps
extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type"> {
icon: string;
label: string;
active?: boolean;
type?: "button" | "submit" | "reset";
}
export function IconButton({
icon,
label,
active = false,
disabled = false,
type = "button",
className = "",
...buttonProps
}: IconButtonProps) {
return (
<button
{...buttonProps}
className={className ? `icon-button ${className} ` : "icon-button "}
aria-label={label}
data-active={active}
disabled={disabled}
type={type}
>
<IconGlyph name={icon} size="sm" />
</button>
);
}