dashboard: action buttons use the swarm UI's button, with its danger tone and touch height
Button.css moves to @hive/shared, a rename from swarm-ui/src/ui/button/Button.css to shared/src/button/Button.css; the swarm UI's Button imports it from there and the dashboard imports it too. The dashboard's own .btn rules and its eleven per-action colour modifiers are gone: the bulk action buttons, the per-row purge and the selection bar's clear are ui-button, destroy and purge are ui-button-danger, and all of them have the 2.75em height the dashboard buttons were under. The form() and addBulkButton helpers take a tone (danger or default) in place of a btn-* class. The danger variant is the one the confirmations PR adds, identical, so the two merge in either order.
This commit is contained in:
parent
94dd24fa99
commit
16a5bff2b1
2 changed files with 26 additions and 140 deletions
|
|
@ -1,45 +0,0 @@
|
|||
/* <Button> — same touch-target floor as `.ui-form-control`
|
||||
(../form-field/FormField.css: 2.75em ≈ 44px at the default root font,
|
||||
WCAG 2.5.5) so a button never reads as a smaller tap target than the
|
||||
input sitting next to it. Colours are the shared base16-derived vars
|
||||
(../../theme.css). */
|
||||
.ui-button {
|
||||
border-radius: 0.3em;
|
||||
padding: 0.5em 1.2em;
|
||||
font: inherit;
|
||||
cursor: pointer;
|
||||
min-height: 2.75em;
|
||||
}
|
||||
.ui-button-primary {
|
||||
background: var(--purple-dim);
|
||||
color: var(--fg);
|
||||
border: none;
|
||||
}
|
||||
.ui-button-danger {
|
||||
background: color-mix(in srgb, var(--red) 14%, var(--bg-elev));
|
||||
color: var(--red);
|
||||
border: 1px solid var(--red);
|
||||
}
|
||||
.ui-button-default {
|
||||
background: var(--bg-elev);
|
||||
color: var(--fg);
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
.ui-button:disabled {
|
||||
opacity: 0.6;
|
||||
cursor: default;
|
||||
}
|
||||
.ui-button {
|
||||
position: relative;
|
||||
}
|
||||
/* Busy: the label keeps its space, hidden, and the spinner sits over it. */
|
||||
.ui-button-busy .ui-button-label {
|
||||
visibility: hidden;
|
||||
}
|
||||
.ui-button-spinner {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
// taken back: destroy, delete, a removal that cuts access).
|
||||
import type { ComponentChildren } from "preact";
|
||||
import { Spinner } from "../spinner/Spinner.js";
|
||||
import "./Button.css";
|
||||
import "@hive/shared/button.css";
|
||||
|
||||
export type ButtonVariant = "primary" | "default" | "danger";
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue