feat(ui): migrate the canonical action-button surface onto <Button>

Sweep the rounded-lg solid/ghost/outline action-button family onto the shared primitive:
ConfirmProvider, ErrorDialog, DownloadDialog, DownloadCenter, downloadModals, downloadAdmin,
ProfileEditor, PersonalViewsModal, SettingsPanel, WatchPage, DraftSaveBar. Deliberately left
on their own styles per the agreed scope: login/onboarding rounded-xl CTAs (Welcome/Onboarding/
Setup/KeyGate), glass Plex surfaces, segmented pills/toggles/switches/chips, dropdown triggers,
data-driven Banner/tone maps, text-xs dense buttons, and tiny inline p-1/p-1.5 icon controls —
none map 1:1 to a variant+size without a visual change, and the repo has no tailwind-merge.
This commit is contained in:
2026-08-28 03:12:29 +02:00
parent 4892c38466
commit 5280949667
11 changed files with 97 additions and 98 deletions
+10 -10
View File
@@ -1,6 +1,7 @@
import { createContext, useCallback, useContext, useState, type ReactNode } from "react";
import { useTranslation } from "react-i18next";
import Modal from "./Modal";
import { Button } from "./ui/Button";
// App-styled, promise-based replacement for window.confirm. Wrap the tree in
// <ConfirmProvider> once, then anywhere: const confirm = useConfirm();
@@ -100,26 +101,25 @@ export function ConfirmProvider({ children }: { children: ReactNode }) {
<div
className={multi ? "flex flex-col gap-2 mt-5" : "flex justify-end gap-2 mt-5 flex-wrap"}
>
<button
<Button
variant="outline"
autoFocus={anyDanger}
onClick={() => close(null)}
className={`px-4 py-2 rounded-lg text-sm border border-border text-muted hover:text-fg hover:bg-surface transition ${
multi ? "w-full order-last" : ""
}`}
fullWidth={multi}
className={multi ? "order-last" : ""}
>
{state.opts.cancelLabel ?? t("common.cancel")}
</button>
</Button>
{choices.map((c, i) => (
<button
<Button
key={c.id}
variant={c.danger ? "danger" : "primary"}
autoFocus={!anyDanger && i === choices.length - 1}
onClick={() => close(c.id)}
className={`px-4 py-2 rounded-lg text-sm font-semibold transition ${
multi ? "w-full" : ""
} ${c.danger ? "btn-danger" : "btn-primary"}`}
fullWidth={multi}
>
{c.label || t("common.confirm")}
</button>
</Button>
))}
</div>
</Modal>