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
|
|
@ -0,0 +1,8 @@
|
|||
.ui-empty-state {
|
||||
margin: 0;
|
||||
color: var(--muted);
|
||||
}
|
||||
.ui-empty-state-centered {
|
||||
padding: 1.25em 0.75em;
|
||||
text-align: center;
|
||||
}
|
||||
19
frontend/packages/swarm-ui/src/ui/empty-state/EmptyState.tsx
Normal file
19
frontend/packages/swarm-ui/src/ui/empty-state/EmptyState.tsx
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// <EmptyState> — what a list or a section says when it holds nothing: "No runs
|
||||
// yet.", "none linked". Muted, with room around it. `Table`'s `emptyMessage`
|
||||
// and `FilterableView` use the same look through this component.
|
||||
import type { ComponentChildren } from "preact";
|
||||
import "./EmptyState.css";
|
||||
|
||||
export function EmptyState({
|
||||
centered = false,
|
||||
children,
|
||||
}: {
|
||||
centered?: boolean;
|
||||
children: ComponentChildren;
|
||||
}) {
|
||||
return (
|
||||
<p class={"ui-empty-state" + (centered ? " ui-empty-state-centered" : "")}>
|
||||
{children}
|
||||
</p>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue