swarm-ui: one subdirectory per ui/ component
Per mara's PR review request: Panel/StatusChip/Table each move into their own subdir (ui/panel/, ui/status-chip/, ui/table/) colocating the component with its stylesheet, matching shell/ (Shell.tsx + Shell.css already lived this way). Import paths in App.tsx and swarm-ui.css updated to match; no behavior change. npm run build + typecheck both clean.
This commit is contained in:
parent
67eb0c660d
commit
55f9e6c15f
8 changed files with 4 additions and 4 deletions
15
frontend/packages/swarm-ui/src/ui/panel/Panel.css
Normal file
15
frontend/packages/swarm-ui/src/ui/panel/Panel.css
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
.ui-panel {
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 0.5em;
|
||||
background: var(--bg-elev);
|
||||
}
|
||||
.ui-panel-title {
|
||||
margin: 0;
|
||||
padding: 0.75em 1em;
|
||||
font-size: 1em;
|
||||
font-weight: 600;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.ui-panel-body {
|
||||
padding: 1em;
|
||||
}
|
||||
14
frontend/packages/swarm-ui/src/ui/panel/Panel.tsx
Normal file
14
frontend/packages/swarm-ui/src/ui/panel/Panel.tsx
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// <Panel> — the one generic container primitive every route needs: a
|
||||
// bordered surface with an optional title, no other opinions. Not a
|
||||
// card-with-actions/footer/whatever kit — those get added the first
|
||||
// time a real page actually needs one, not speculatively ahead of it.
|
||||
import type { ComponentChildren } from 'preact';
|
||||
|
||||
export function Panel({ title, children }: { title?: string; children: ComponentChildren }) {
|
||||
return (
|
||||
<section class="ui-panel">
|
||||
{title ? <h2 class="ui-panel-title">{title}</h2> : null}
|
||||
<div class="ui-panel-body">{children}</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue