refactor(web): ghost-muted icons follow the text; add ghost-destructive (#13033)
Co-authored-by: Claude Fable 5 <[email protected]>
This commit is contained in:
1 parent
f3d3fe4569
commit
18aa703673
11 files changed
+24
-51
No files matched your search
@@ -3038,7 +3038,6 @@ const SidebarProjectsContent = memo(function SidebarProjectsContent(
|
||||
variant="ghost-muted"
|
||||
aria-label="Add project"
|
||||
data-testid="sidebar-add-project-trigger"
|
||||
className="[--control-icon-color:currentColor] text-icon-muted"
|
||||
onClick={openAddProject}
|
||||
/>
|
||||
}
|
||||
|
||||
@@ -559,7 +559,7 @@ function RightPanelEmptyState(props: {
|
||||
render={
|
||||
<Button
|
||||
aria-label="Open browser in a profile"
|
||||
className="absolute top-1/2 right-8 -translate-y-1/2 [--control-icon-color:currentColor]"
|
||||
className="absolute top-1/2 right-8 -translate-y-1/2"
|
||||
size="icon-xs"
|
||||
variant="ghost-muted"
|
||||
/>
|
||||
|
||||
@@ -4517,7 +4517,7 @@ export default function Sidebar() {
|
||||
tabIndex={-1}
|
||||
aria-hidden="true"
|
||||
title={`Project settings for ${project.displayName}`}
|
||||
className="ml-auto [--control-icon-color:currentColor] text-icon-muted focus-visible:bg-accent focus-visible:text-foreground"
|
||||
className="ml-auto focus-visible:bg-accent focus-visible:text-foreground"
|
||||
onPointerDown={(event) => event.stopPropagation()}
|
||||
onClick={(event) => {
|
||||
void handleProjectSettings(event, project);
|
||||
|
||||
@@ -150,7 +150,7 @@ export function SnapShotContentsButton({
|
||||
aria-label={
|
||||
includesAccessibility ? "View accessibility data" : "No accessibility data"
|
||||
}
|
||||
className={cn("[--control-icon-color:currentColor]", className)}
|
||||
className={className}
|
||||
onClick={(event) => event.stopPropagation()}
|
||||
size="icon-micro"
|
||||
variant="ghost-muted"
|
||||
|
||||
@@ -500,14 +500,7 @@ export function PullRequestFiltersMenu({
|
||||
];
|
||||
return (
|
||||
<Menu onOpenChange={onOpenChange}>
|
||||
<MenuTrigger
|
||||
render={
|
||||
<Button
|
||||
className={filterCount > 0 ? "[--control-icon-color:currentColor]" : undefined}
|
||||
variant="outline"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<MenuTrigger render={<Button variant="outline" />}>
|
||||
<ListFilterIcon className="size-4" />
|
||||
<span>Filters</span>
|
||||
{filterCount > 0 ? (
|
||||
|
||||
@@ -300,10 +300,6 @@ function ProviderEnvironmentSection(props: {
|
||||
type="button"
|
||||
size="icon-micro"
|
||||
variant="ghost-muted"
|
||||
className={cn(
|
||||
"[--control-icon-color:currentColor]",
|
||||
variable.sensitive && "text-foreground",
|
||||
)}
|
||||
onClick={() => {
|
||||
const sensitive = !variable.sensitive;
|
||||
updateVariable(variable.id, {
|
||||
@@ -331,8 +327,7 @@ function ProviderEnvironmentSection(props: {
|
||||
<Button
|
||||
type="button"
|
||||
size="icon-micro"
|
||||
variant="ghost-muted"
|
||||
className="[--control-icon-color:currentColor] hover:text-destructive"
|
||||
variant="ghost-destructive"
|
||||
onClick={() => removeVariable(variable.id)}
|
||||
aria-label={`Remove environment variable ${variable.name || index + 1}`}
|
||||
>
|
||||
@@ -704,16 +699,12 @@ export function ProviderInstanceCard({
|
||||
<Button
|
||||
type="button"
|
||||
size="icon-xs"
|
||||
variant="ghost"
|
||||
className={cn(
|
||||
"[--control-icon-color:currentColor]",
|
||||
versionAdvisory.emphasis === "strong"
|
||||
? "text-warning hover:text-warning"
|
||||
: "text-muted-foreground hover:text-foreground",
|
||||
)}
|
||||
variant="ghost-muted"
|
||||
aria-label="Update available — view details"
|
||||
>
|
||||
<ArrowUpCircleIcon />
|
||||
<ArrowUpCircleIcon
|
||||
className={cn(versionAdvisory.emphasis === "strong" && "text-warning")}
|
||||
/>
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
@@ -793,9 +784,8 @@ export function ProviderInstanceCard({
|
||||
<Button
|
||||
type="button"
|
||||
size="icon-xs"
|
||||
variant="ghost-muted"
|
||||
variant="ghost-destructive"
|
||||
disabled={readOnly}
|
||||
className="[--control-icon-color:currentColor] hover:text-destructive"
|
||||
onClick={onDelete}
|
||||
aria-label={`Delete instance ${instanceId}`}
|
||||
>
|
||||
|
||||
@@ -312,13 +312,7 @@ export function ProviderModelsSection({
|
||||
render={
|
||||
<Button
|
||||
size="icon-micro"
|
||||
variant="ghost"
|
||||
className={cn(
|
||||
"[--control-icon-color:currentColor]",
|
||||
isFavorite
|
||||
? "text-yellow-500 hover:text-yellow-600"
|
||||
: "text-muted-foreground/40 hover:text-muted-foreground",
|
||||
)}
|
||||
variant="ghost-muted"
|
||||
onClick={() => handleToggleFavorite(model.slug)}
|
||||
aria-label={`${isFavorite ? "Remove" : "Add"} ${model.name} ${
|
||||
isFavorite ? "from" : "to"
|
||||
@@ -326,7 +320,7 @@ export function ProviderModelsSection({
|
||||
/>
|
||||
}
|
||||
>
|
||||
<StarIcon className={cn("size-3", isFavorite && "fill-current")} />
|
||||
<StarIcon className={cn("size-3", isFavorite && "fill-current text-warning")} />
|
||||
</TooltipTrigger>
|
||||
<TooltipPopup side="top">
|
||||
{isFavorite ? "Remove from favorites" : "Add to favorites"}
|
||||
|
||||
@@ -208,22 +208,18 @@ export function SettingInheritance({
|
||||
size="icon-micro"
|
||||
variant="ghost-muted"
|
||||
aria-label={`${overrideSummary}. Show where this value comes from`}
|
||||
className={cn(
|
||||
"[--control-icon-color:currentColor]",
|
||||
state === "overridden"
|
||||
? "text-primary hover:text-primary"
|
||||
: state === "mixed"
|
||||
? "text-warning hover:text-warning"
|
||||
: state === "environment"
|
||||
? "text-foreground/70 hover:text-foreground"
|
||||
: "text-muted-foreground/60 hover:text-foreground",
|
||||
)}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<LayersIcon className="size-3" />
|
||||
<LayersIcon
|
||||
className={cn(
|
||||
"size-3",
|
||||
state === "overridden" && "text-primary",
|
||||
state === "mixed" && "text-warning",
|
||||
)}
|
||||
/>
|
||||
</TooltipTrigger>
|
||||
<TooltipPopup side="top">{overrideSummary}</TooltipPopup>
|
||||
</Tooltip>
|
||||
|
||||
@@ -387,8 +387,7 @@ function ThemeLibraryCard({
|
||||
: `Remove ${theme.label}`
|
||||
}
|
||||
size="icon-xs"
|
||||
variant="ghost"
|
||||
className="text-muted-foreground hover:text-destructive"
|
||||
variant="ghost-destructive"
|
||||
onClick={(event) => {
|
||||
event.stopPropagation();
|
||||
onRemove();
|
||||
|
||||
@@ -49,7 +49,9 @@ const buttonVariants = cva(
|
||||
ghost:
|
||||
"[--control-icon-color:var(--contrast-muted-foreground)] border-transparent text-foreground data-pressed:bg-accent [:hover,[data-pressed]]:bg-accent",
|
||||
"ghost-muted":
|
||||
"[--control-icon-color:var(--contrast-muted-foreground)] border-transparent text-muted-foreground data-pressed:bg-accent [:hover,[data-pressed]]:bg-accent [:hover,[data-pressed]]:text-foreground",
|
||||
"[--control-icon-color:currentColor] border-transparent text-muted-foreground data-pressed:bg-accent [:hover,[data-pressed]]:bg-accent [:hover,[data-pressed]]:text-foreground",
|
||||
"ghost-destructive":
|
||||
"[--control-icon-color:currentColor] border-transparent text-muted-foreground data-pressed:bg-accent [:hover,[data-pressed]]:bg-accent [:hover,[data-pressed]]:text-destructive",
|
||||
glass:
|
||||
"surface-glass [--control-icon-color:var(--contrast-muted-foreground)] border-border/60 text-foreground shadow-sm [:hover,[data-pressed]]:border-border",
|
||||
link: "border-transparent underline-offset-4 [:hover,[data-pressed]]:underline",
|
||||
|
||||
@@ -8,7 +8,7 @@ import * as NodeURL from "node:url";
|
||||
// components/ui exports are migrated to variants (see vite.config.ts). This gate keeps the
|
||||
// count from growing: CI fails when findings exceed the ceiling. Lower the ceiling when you
|
||||
// migrate a file, and delete this script when the rule becomes an error.
|
||||
export const RESTYLE_CEILING = 899;
|
||||
export const RESTYLE_CEILING = 865;
|
||||
|
||||
const RULE = "shadcn(no-restyle)";
|
||||
|
||||
|
||||
Reference in new issue
Block a user