swarm-ui: shared Hint, ActionRow, Toolbar, EmptyState, ExternalLink and ExpandableCard replace per-page copies
Hint, ActionRow, Toolbar, EmptyState and ExternalLink replace the muted text, button row, refresh bar, empty line and _blank anchor that each page restyled under its own class. ExpandableCard (with a loading twin) holds the builds and recent-runs cards, which had identical head and body CSS. The create form's raw checkbox becomes CheckboxField. The components page shows each new piece.
This commit is contained in:
parent
b74b5e77e4
commit
8a2e5203ad
2 changed files with 689 additions and 427 deletions
11
frontend/packages/swarm-ui/src/ui/toolbar/Toolbar.css
Normal file
11
frontend/packages/swarm-ui/src/ui/toolbar/Toolbar.css
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
.ui-toolbar {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 0.5em 0.75em;
|
||||
margin-block-end: 0.5em;
|
||||
}
|
||||
.ui-toolbar-start {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
24
frontend/packages/swarm-ui/src/ui/toolbar/Toolbar.tsx
Normal file
24
frontend/packages/swarm-ui/src/ui/toolbar/Toolbar.tsx
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
// <Toolbar> — the bar above a list or a card: filters, a count, the refresh
|
||||
// picker. Items sit on one line and wrap when narrow, aligned to the end by
|
||||
// default (where the refresh picker sits on every page that has one).
|
||||
import type { ComponentChildren } from "preact";
|
||||
import "./Toolbar.css";
|
||||
|
||||
export function Toolbar({
|
||||
justify = "end",
|
||||
class: extraClass,
|
||||
children,
|
||||
}: {
|
||||
justify?: "start" | "end";
|
||||
class?: string;
|
||||
children: ComponentChildren;
|
||||
}) {
|
||||
const classes = [
|
||||
"ui-toolbar",
|
||||
justify === "start" && "ui-toolbar-start",
|
||||
extraClass,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(" ");
|
||||
return <div class={classes}>{children}</div>;
|
||||
}
|
||||
Loading…
Reference in a new issue