From 85acb5c1851685f70340ee5435d7f560f408d8fc Mon Sep 17 00:00:00 2001 From: Lukas Date: Fri, 13 Mar 2026 17:14:44 +0100 Subject: [PATCH] Migrate icon buttons to Button component and simplify size variants Replace raw + )} {showRollAllInitiative && onRollAllInitiative && ( + ); } @@ -42,9 +40,7 @@ export function BulkImportPrompt({ Loaded {importState.completed}/{importState.total} sources ( {importState.failed} failed) - + ); } @@ -103,11 +99,7 @@ export function BulkImportPrompt({ /> - diff --git a/apps/web/src/components/create-player-modal.tsx b/apps/web/src/components/create-player-modal.tsx index 84f56e0..74a691f 100644 --- a/apps/web/src/components/create-player-modal.tsx +++ b/apps/web/src/components/create-player-modal.tsx @@ -100,13 +100,14 @@ export function CreatePlayerModal({

{isEdit ? "Edit Player" : "Create Player"}

- +
diff --git a/apps/web/src/components/player-management.tsx b/apps/web/src/components/player-management.tsx index c9bc3be..4489538 100644 --- a/apps/web/src/components/player-management.tsx +++ b/apps/web/src/components/player-management.tsx @@ -52,19 +52,20 @@ export function PlayerManagement({

Player Characters

- + {characters.length === 0 ? (

No player characters yet

- @@ -92,25 +93,27 @@ export function PlayerManagement({ HP {pc.maxHp} - + } label="Delete player character" onConfirm={() => onDelete(pc.id)} - className="h-6 w-6 text-muted-foreground" + size="icon-sm" + className="text-muted-foreground" />
); })}
- diff --git a/apps/web/src/components/source-fetch-prompt.tsx b/apps/web/src/components/source-fetch-prompt.tsx index cbe9f76..eb17340 100644 --- a/apps/web/src/components/source-fetch-prompt.tsx +++ b/apps/web/src/components/source-fetch-prompt.tsx @@ -88,11 +88,7 @@ export function SourceFetchPrompt({
- + )}
{panelRole === "browse" && showPinButton && ( - + )} {panelRole === "pinned" && ( - + )}
@@ -195,14 +199,15 @@ function MobileDrawer({ {...handlers} >
- +
{children} diff --git a/apps/web/src/components/toast.tsx b/apps/web/src/components/toast.tsx index 35db801..dd248fd 100644 --- a/apps/web/src/components/toast.tsx +++ b/apps/web/src/components/toast.tsx @@ -1,6 +1,7 @@ import { X } from "lucide-react"; import { useEffect } from "react"; import { createPortal } from "react-dom"; +import { Button } from "./ui/button.js"; interface ToastProps { message: string; @@ -33,13 +34,14 @@ export function Toast({ />
)} - + , document.body, diff --git a/apps/web/src/components/ui/button.tsx b/apps/web/src/components/ui/button.tsx index 219eed7..e63fd18 100644 --- a/apps/web/src/components/ui/button.tsx +++ b/apps/web/src/components/ui/button.tsx @@ -13,9 +13,9 @@ const buttonVariants = cva( ghost: "hover:bg-hover-neutral-bg hover:text-hover-neutral", }, size: { - default: "h-9 px-4 py-2", - sm: "h-8 px-3 text-xs", + default: "h-8 px-3 text-xs", icon: "h-8 w-8", + "icon-sm": "h-6 w-6", }, }, defaultVariants: { diff --git a/apps/web/src/components/ui/confirm-button.tsx b/apps/web/src/components/ui/confirm-button.tsx index 446adef..b5f6750 100644 --- a/apps/web/src/components/ui/confirm-button.tsx +++ b/apps/web/src/components/ui/confirm-button.tsx @@ -13,6 +13,7 @@ interface ConfirmButtonProps { readonly onConfirm: () => void; readonly icon: ReactElement; readonly label: string; + readonly size?: "icon" | "icon-sm"; readonly className?: string; readonly disabled?: boolean; } @@ -23,6 +24,7 @@ export function ConfirmButton({ onConfirm, icon, label, + size = "icon", className, disabled, }: ConfirmButtonProps) { @@ -94,7 +96,7 @@ export function ConfirmButton({