Migrate icon buttons to Button component and simplify size variants
All checks were successful
CI / check (push) Successful in 48s
CI / build-image (push) Successful in 18s

Replace raw <button> elements with Button variant="ghost" in stat-block
panel, toast, player modals. Add icon-sm size variant (h-6 w-6) for
compact contexts. Consolidate text button sizes into a single default
(h-8 px-3), removing the redundant sm variant. Add size prop to
ConfirmButton for consistent sizing.

Button now has three sizes: default (text), icon, icon-sm.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lukas
2026-03-13 17:14:44 +01:00
parent f9ef64bb00
commit 85acb5c185
10 changed files with 56 additions and 59 deletions

View File

@@ -8,6 +8,7 @@ import { useSwipeToDismiss } from "../hooks/use-swipe-to-dismiss.js";
import { BulkImportPrompt } from "./bulk-import-prompt.js";
import { SourceFetchPrompt } from "./source-fetch-prompt.js";
import { StatBlock } from "./stat-block.js";
import { Button } from "./ui/button.js";
interface StatBlockPanelProps {
creatureId: CreatureId | null;
@@ -81,36 +82,39 @@ function PanelHeader({
<div className="flex items-center justify-between border-b border-border px-4 py-2">
<div className="flex items-center gap-1">
{panelRole === "browse" && (
<button
type="button"
<Button
variant="ghost"
size="icon-sm"
onClick={onToggleFold}
className="text-muted-foreground hover:text-hover-neutral"
className="text-muted-foreground"
aria-label="Fold stat block panel"
>
<PanelRightClose className="h-4 w-4" />
</button>
</Button>
)}
</div>
<div className="flex items-center gap-1">
{panelRole === "browse" && showPinButton && (
<button
type="button"
<Button
variant="ghost"
size="icon-sm"
onClick={onPin}
className="text-muted-foreground hover:text-hover-neutral"
className="text-muted-foreground"
aria-label="Pin creature"
>
<Pin className="h-4 w-4" />
</button>
</Button>
)}
{panelRole === "pinned" && (
<button
type="button"
<Button
variant="ghost"
size="icon-sm"
onClick={onUnpin}
className="text-muted-foreground hover:text-hover-neutral"
className="text-muted-foreground"
aria-label="Unpin creature"
>
<PinOff className="h-4 w-4" />
</button>
</Button>
)}
</div>
</div>
@@ -195,14 +199,15 @@ function MobileDrawer({
{...handlers}
>
<div className="flex items-center justify-between border-b border-border px-4 py-2">
<button
type="button"
<Button
variant="ghost"
size="icon-sm"
onClick={onDismiss}
className="text-muted-foreground hover:text-hover-neutral"
className="text-muted-foreground"
aria-label="Fold stat block panel"
>
<PanelRightClose className="h-4 w-4" />
</button>
</Button>
</div>
<div className="h-[calc(100%-41px)] overflow-y-auto p-4">
{children}