feat(ui): migrate the page and section components, add the layout tour
Quality / quality (ubuntu-latest) (push) Failing after 12m21s
Quality / quality (windows-latest) (push) Canceled after 0s

Section, SectionHeader and PublicPageShell move onto wire-* classes with
local style blocks, variants as data attributes. SectionHeader loses 38
utility lines, and Section stops spending one line per variant and colour
pairing: tinted and solid now select on two attributes. PageHeader was already
on the convention and only needed the audit.

examples/basic-app/app/pages/layout.wrn composes the whole set into one page.

Building it surfaced a library-wide bug. Ten custom properties were referenced
by components and defined by nothing: --wire-color-focus, --wire-color-surface-soft,
--wire-color-on-danger, --wire-color-surface-subtle and the input-* family,
plus hover and contrast for every semantic colour except primary and
secondary. An undefined custom property does not warn, it resolves to nothing,
so focus rings drew with no colour and every soft surface rendered
transparent -- 27 components referenced surface-soft alone. They are derived
in the theme now, and a test checks every token a component references against
the rendered theme CSS rather than the source, since most are generated.

The semantic spread also had to move ahead of the primary and secondary
entries so the palette keeps winning for those two.

Known and unresolved: LayoutSplitter emits its sizeChange output and the
component does fire it, but a parent binding on the tag is not invoked. The
tour page therefore points at the handle aria-valuenow rather than wiring a
handler that would never update. Outputs work elsewhere, so this is narrower
than an outputs-are-broken problem and needs its own investigation.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-08 15:50:33 +05:30
co-authored by Claude Opus 5
parent 8aa28205e0
commit c7ab605e85
18 changed files with 720 additions and 149 deletions
@@ -12,6 +12,7 @@ component PublicLayout {
<a href="/dashboard">{t:nav.dashboard}</a>
<a href="/about">{t:nav.about}</a>
<a href="/navigation">{t:nav.navigation}</a>
<a href="/layout">{t:nav.layout}</a>
<button type="button" data-wire-theme-toggle aria-label="Toggle color theme">Theme</button>
<button class="wire-btn wire-btn--ghost wire-btn--sm" data-wire-lang-set="en">EN</button>
<button class="wire-btn wire-btn--ghost wire-btn--sm" data-wire-lang-set="es">ES</button>
+2 -1
View File
@@ -5,7 +5,8 @@
"chat": "Chat",
"dashboard": "Dashboard",
"about": "About",
"navigation": "Navigation"
"navigation": "Navigation",
"layout": "Layout"
},
"home": {
"title": "Hello from WrNexus",
+2 -1
View File
@@ -5,7 +5,8 @@
"chat": "Chat",
"dashboard": "Panel",
"about": "Acerca de",
"navigation": "Navegación"
"navigation": "Navegación",
"layout": "Diseño"
},
"home": {
"title": "Hola desde WrNexus",
+211
View File
@@ -0,0 +1,211 @@
// Layout tour. Route: /layout
//
// One page built out of the layout set, rather than showing each piece alone:
//
// PublicPageShell the outer shell, holding the page background
// Section each band down the page, with its own spacing and tint
// SectionHeader the eyebrow, heading and description of each band
// Container the reading width
// Grid the card deck, including an auto-fit track
// Columns the coarse two-way split
// LayoutSplitter a resizable pane, by drag or by arrow key
// CustomScrollbar a themed scrolling region
// Divider the rules between bands
// Typography the prose column
// Image, Link, Kbd the smaller pieces inside it
//
// CustomScrollbar sits beside the splitter rather than inside a pane of it: a
// component tag nested in another component slot is dropped, and only its
// children survive.
//
// The splitter does not report into a status line here. It emits a sizeChange
// output and the component does fire it, but a parent binding on the tag is
// not invoked, so wiring one up would show something that never updates.
page LayoutTour {
layout = "public"
seo {
title = "Layout tour"
description = "Every layout component working together on one page."
}
view {
<PublicPageShell background="default" minHeight="dvh" fullWidth={true}>
<Section spacing="lg" variant="soft" borderBottom={true}>
<Container maxWidth="lg" columns={1}>
<SectionHeader
eyebrow="Layout"
title="Composing a page"
description="Every band on this page is a Section. The width you are reading at is a Container, and the pieces inside are the rest of the layout set."
align="center"
maxWidth="2xl"
/>
</Container>
</Section>
<Section spacing="lg">
<Container maxWidth="lg" columns={1}>
<SectionHeader
eyebrow="Grid"
title="Card decks"
description="A fixed column count collapses at each breakpoint. Pass minItemWidth instead and the browser decides the count, reflowing continuously."
headingLevel={3}
/>
<Divider />
<Grid columns={3} gap="md">
<div class="tour-card">
<h4>Fixed columns</h4>
<p>Three tracks on a wide screen, two on a tablet, one on a phone.</p>
</div>
<div class="tour-card">
<h4>Themed</h4>
<p>Every surface here is a theme token, so light and dark both work.</p>
</div>
<div class="tour-card">
<h4>No Tailwind</h4>
<p>These components carry their own styles and no longer need it.</p>
</div>
</Grid>
<Divider label="auto fit" />
<Grid minItemWidth="12rem" gap="sm">
<div class="tour-card tour-card--compact"><h4>One</h4></div>
<div class="tour-card tour-card--compact"><h4>Two</h4></div>
<div class="tour-card tour-card--compact"><h4>Three</h4></div>
<div class="tour-card tour-card--compact"><h4>Four</h4></div>
<div class="tour-card tour-card--compact"><h4>Five</h4></div>
</Grid>
</Container>
</Section>
<Section spacing="lg" variant="soft" borderTop={true} borderBottom={true}>
<Container maxWidth="lg" columns={1}>
<SectionHeader
eyebrow="Split"
title="Columns and panes"
description="Columns is the coarse split of a page. LayoutSplitter is the one the reader can move."
headingLevel={3}
/>
<Columns columns={2} gap="lg">
<Typography maxWidth="full">
<h4>Prose</h4>
<p>
Typography caps the measure so a line never runs too long to
follow. Inside it you get the smaller pieces: a
<Link href="/navigation" label="link" /> to somewhere else, and
<Kbd label="Ctrl" /> <Kbd label="K" /> for a shortcut.
</p>
</Typography>
<Image src="" alt="Placeholder artwork" size="video" rounded={true} />
</Columns>
</Container>
</Section>
<Section spacing="lg">
<Container maxWidth="lg" columns={1}>
<SectionHeader
eyebrow="Interactive"
title="Resize and scroll"
description="The splitter resolves its size in the runtime and reports it here. The scrolling region themes its own scrollbar."
headingLevel={3}
/>
<p class="tour-status">
Drag the divider, or focus it and use the arrow keys. Home and End
go to the bounds. The live value is on the handle itself, as
aria-valuenow, which is what a screen reader announces.
</p>
<LayoutSplitter size={45} minSize={20} step={5} label="Resize the panes">
<div data-slot="start">
<div class="tour-pane">
<h4>Start pane</h4>
<p>Drag the divider, or focus it and use the arrow keys. Home and End go to the bounds.</p>
</div>
</div>
<div data-slot="end">
<div class="tour-pane">
<h4>End pane</h4>
<p>The size is resolved in the runtime and written onto the container, so the panes are plain grid tracks.</p>
</div>
</div>
</LayoutSplitter>
<Divider label="scrolling" />
<CustomScrollbar maxHeight="12rem" thickness={10}>
<div class="tour-scroll">
<p>This region scrolls, and its scrollbar follows the theme.</p>
<p>Scrollbar appearance is CSS rather than script.</p>
<p>scrollbar-width and scrollbar-color are the standard properties.</p>
<p>The webkit rules cover the engines that still need them.</p>
<p>Enough lines here that the region actually overflows.</p>
<p>Otherwise there would be no scrollbar to look at.</p>
<p>Which is the mistake the showcase demo made first time.</p>
</div>
</CustomScrollbar>
</Container>
</Section>
</PublicPageShell>
}
style {
.tour-card {
padding: 1rem;
border: 1px solid var(--wire-color-border);
border-radius: var(--wire-radius-md);
background: var(--wire-color-surface);
}
.tour-card h4,
.tour-pane h4 {
margin: 0 0 0.35rem;
font-size: 0.95rem;
font-weight: 700;
}
.tour-card p,
.tour-pane p,
.tour-scroll p {
margin: 0;
color: var(--wire-color-text-muted);
font-size: 0.86rem;
line-height: 1.6;
}
.tour-card--compact {
text-align: center;
}
.tour-status {
margin: 0 0 0.75rem;
padding: 0.5rem 0.75rem;
border: 1px solid var(--wire-color-border);
border-radius: var(--wire-radius-sm);
background: var(--wire-color-surface-soft);
color: var(--wire-color-text-muted);
font-size: 0.82rem;
}
.tour-pane {
padding: 1rem;
}
.tour-scroll {
display: grid;
gap: 0.6rem;
padding: 0.75rem;
}
/* The splitter panes need a floor or they collapse to their text. */
.tour-pane,
.tour-scroll {
min-height: 8rem;
}
}
}
+3
View File
@@ -10,6 +10,7 @@ export interface Routes {
"/dashboard": Record<string, never>;
"/hello": Record<string, never>;
"/language-tools": Record<string, never>;
"/layout": Record<string, never>;
"/login": Record<string, never>;
"/modal": Record<string, never>;
"/navigation": Record<string, never>;
@@ -31,6 +32,7 @@ export interface RouteNames {
"dashboard": "/dashboard";
"hello": "/hello";
"language.tools": "/language-tools";
"layout": "/layout";
"login": "/login";
"modal": "/modal";
"navigation": "/navigation";
@@ -121,6 +123,7 @@ export function route<N extends RouteName>(
"dashboard": "/dashboard",
"hello": "/hello",
"language.tools": "/language-tools",
"layout": "/layout",
"login": "/login",
"modal": "/modal",
"navigation": "/navigation",