feat(ui): add DataTable and Toaster, drop the legacy Table, fix overlay dialogs
Quality / quality (ubuntu-latest) (push) Failing after 13m40s
Quality / quality (windows-latest) (push) Canceled after 0s

DataTable replaces the 20-line Table scaffold entirely: columns, sorting,
filtering, pagination, selection, bulk actions, comparison layout, sticky
first column, custom HTML cells, and a remote source driven by a `request`
output rather than a function prop (props travel as HTML attributes, so a
function arrives as its own source text).

Toaster replaces the hand-rolled status div: tone icons, actions, hover
pause/resume and a progress bar.

Overlays audit -- Modal and Drawer declared aria-modal="true" but nothing
ever moved focus into the panel, so the @keydown handler on their root
never ran and closeOnEscape did nothing. Focus, focus restore, a Tab trap
and a body scroll lock now live in the reactive runtime, shared by both.

ContextMenu placed pointer menus by subtracting a guessed 340x420 from the
viewport, which pushed every menu that was not that size away from the
pointer; it now positions at the pointer and lets the anchored clamp pull
it back once it can be measured.

The reactive runtime size budget moves 150k -> 175k to cover anchored
overlays, dialog behaviour, the toaster and the DataTable client half.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-07 14:59:58 +05:30
co-authored by Claude Opus 5
parent 296728d51d
commit 949cf78636
151 changed files with 14350 additions and 9189 deletions
@@ -37,7 +37,7 @@ page LegendIndicatorDetail {
title="Legend Indicator example"
description="A polished default legend indicator for a modern application."
items='[
&#123;
<span>&#123;</span>
"id": "legend-indicator-0-1",
"key": "legend-indicator-0-1",
"value": "primary",
@@ -66,31 +66,31 @@ page LegendIndicatorDetail {
"target": "_self",
"ariaLabel": "Open primary workflow 1",
"items": [
&#123;
<span>&#123;</span>
"label": "Nested option A",
"value": "nested-a"
&#125;,
&#123;
<span>&#125;</span>,
<span>&#123;</span>
"label": "Nested option B",
"value": "nested-b"
&#125;
<span>&#125;</span>
],
"links": [
&#123;
<span>&#123;</span>
"label": "Documentation",
"href": "#documentation"
&#125;,
&#123;
<span>&#125;</span>,
<span>&#123;</span>
"label": "API reference",
"href": "#api-reference"
&#125;
<span>&#125;</span>
],
"values": [
"Included",
"Standard"
]
&#125;,
&#123;
<span>&#125;</span>,
<span>&#123;</span>
"id": "legend-indicator-0-2",
"key": "legend-indicator-0-2",
"value": "secondary",
@@ -119,30 +119,30 @@ page LegendIndicatorDetail {
"target": "_self",
"ariaLabel": "Open primary workflow 2",
"items": [
&#123;
<span>&#123;</span>
"label": "Nested option A",
"value": "nested-a"
&#125;,
&#123;
<span>&#125;</span>,
<span>&#123;</span>
"label": "Nested option B",
"value": "nested-b"
&#125;
<span>&#125;</span>
],
"links": [
&#123;
<span>&#123;</span>
"label": "Documentation",
"href": "#documentation"
&#125;,
&#123;
<span>&#125;</span>,
<span>&#123;</span>
"label": "API reference",
"href": "#api-reference"
&#125;
<span>&#125;</span>
],
"values": [
"Included",
"Standard"
]
&#125;
<span>&#125;</span>
]'
/&gt;</code></pre>
</section>
@@ -282,7 +282,7 @@ page LegendIndicatorDetail {
title="Legend Indicator example"
description="A polished default legend indicator for a modern application."
items='[
&#123;
<span>&#123;</span>
"id": "legend-indicator-0-1",
"key": "legend-indicator-0-1",
"value": "primary",
@@ -311,31 +311,31 @@ page LegendIndicatorDetail {
"target": "_self",
"ariaLabel": "Open primary workflow 1",
"items": [
&#123;
<span>&#123;</span>
"label": "Nested option A",
"value": "nested-a"
&#125;,
&#123;
<span>&#125;</span>,
<span>&#123;</span>
"label": "Nested option B",
"value": "nested-b"
&#125;
<span>&#125;</span>
],
"links": [
&#123;
<span>&#123;</span>
"label": "Documentation",
"href": "#documentation"
&#125;,
&#123;
<span>&#125;</span>,
<span>&#123;</span>
"label": "API reference",
"href": "#api-reference"
&#125;
<span>&#125;</span>
],
"values": [
"Included",
"Standard"
]
&#125;,
&#123;
<span>&#125;</span>,
<span>&#123;</span>
"id": "legend-indicator-0-2",
"key": "legend-indicator-0-2",
"value": "secondary",
@@ -364,30 +364,30 @@ page LegendIndicatorDetail {
"target": "_self",
"ariaLabel": "Open primary workflow 2",
"items": [
&#123;
<span>&#123;</span>
"label": "Nested option A",
"value": "nested-a"
&#125;,
&#123;
<span>&#125;</span>,
<span>&#123;</span>
"label": "Nested option B",
"value": "nested-b"
&#125;
<span>&#125;</span>
],
"links": [
&#123;
<span>&#123;</span>
"label": "Documentation",
"href": "#documentation"
&#125;,
&#123;
<span>&#125;</span>,
<span>&#123;</span>
"label": "API reference",
"href": "#api-reference"
&#125;
<span>&#125;</span>
],
"values": [
"Included",
"Standard"
]
&#125;
<span>&#125;</span>
]'
/&gt;</code></pre>
</section>
@@ -411,7 +411,7 @@ page LegendIndicatorDetail {
title="Compact Legend Indicator"
description="A compact configuration for dashboards and dense product surfaces."
items='[
&#123;
<span>&#123;</span>
"id": "legend-indicator-1-1",
"key": "legend-indicator-1-1",
"value": "primary",
@@ -440,31 +440,31 @@ page LegendIndicatorDetail {
"target": "_self",
"ariaLabel": "Open secondary workflow 1",
"items": [
&#123;
<span>&#123;</span>
"label": "Nested option A",
"value": "nested-a"
&#125;,
&#123;
<span>&#125;</span>,
<span>&#123;</span>
"label": "Nested option B",
"value": "nested-b"
&#125;
<span>&#125;</span>
],
"links": [
&#123;
<span>&#123;</span>
"label": "Documentation",
"href": "#documentation"
&#125;,
&#123;
<span>&#125;</span>,
<span>&#123;</span>
"label": "API reference",
"href": "#api-reference"
&#125;
<span>&#125;</span>
],
"values": [
"Included",
"Standard"
]
&#125;,
&#123;
<span>&#125;</span>,
<span>&#123;</span>
"id": "legend-indicator-1-2",
"key": "legend-indicator-1-2",
"value": "secondary",
@@ -493,30 +493,30 @@ page LegendIndicatorDetail {
"target": "_self",
"ariaLabel": "Open secondary workflow 2",
"items": [
&#123;
<span>&#123;</span>
"label": "Nested option A",
"value": "nested-a"
&#125;,
&#123;
<span>&#125;</span>,
<span>&#123;</span>
"label": "Nested option B",
"value": "nested-b"
&#125;
<span>&#125;</span>
],
"links": [
&#123;
<span>&#123;</span>
"label": "Documentation",
"href": "#documentation"
&#125;,
&#123;
<span>&#125;</span>,
<span>&#123;</span>
"label": "API reference",
"href": "#api-reference"
&#125;
<span>&#125;</span>
],
"values": [
"Included",
"Standard"
]
&#125;
<span>&#125;</span>
]'
variant="secondary"
/&gt;</code></pre>
@@ -541,7 +541,7 @@ page LegendIndicatorDetail {
title="Advanced Legend Indicator"
description="A richer configuration demonstrating additional content and hierarchy."
items='[
&#123;
<span>&#123;</span>
"id": "legend-indicator-2-1",
"key": "legend-indicator-2-1",
"value": "primary",
@@ -570,31 +570,31 @@ page LegendIndicatorDetail {
"target": "_self",
"ariaLabel": "Open advanced workflow 1",
"items": [
&#123;
<span>&#123;</span>
"label": "Nested option A",
"value": "nested-a"
&#125;,
&#123;
<span>&#125;</span>,
<span>&#123;</span>
"label": "Nested option B",
"value": "nested-b"
&#125;
<span>&#125;</span>
],
"links": [
&#123;
<span>&#123;</span>
"label": "Documentation",
"href": "#documentation"
&#125;,
&#123;
<span>&#125;</span>,
<span>&#123;</span>
"label": "API reference",
"href": "#api-reference"
&#125;
<span>&#125;</span>
],
"values": [
"Included",
"Unlimited"
]
&#125;,
&#123;
<span>&#125;</span>,
<span>&#123;</span>
"id": "legend-indicator-2-2",
"key": "legend-indicator-2-2",
"value": "secondary",
@@ -623,30 +623,30 @@ page LegendIndicatorDetail {
"target": "_self",
"ariaLabel": "Open advanced workflow 2",
"items": [
&#123;
<span>&#123;</span>
"label": "Nested option A",
"value": "nested-a"
&#125;,
&#123;
<span>&#125;</span>,
<span>&#123;</span>
"label": "Nested option B",
"value": "nested-b"
&#125;
<span>&#125;</span>
],
"links": [
&#123;
<span>&#123;</span>
"label": "Documentation",
"href": "#documentation"
&#125;,
&#123;
<span>&#125;</span>,
<span>&#123;</span>
"label": "API reference",
"href": "#api-reference"
&#125;
<span>&#125;</span>
],
"values": [
"Included",
"Unlimited"
]
&#125;
<span>&#125;</span>
]'
variant="success"
/&gt;</code></pre>
@@ -656,17 +656,17 @@ page LegendIndicatorDetail {
<section id="events" class="detail-section"><div class="detail-section-heading"><span>Component outputs</span><h2>Receive every typed component output</h2><p>Use declarative output handlers in <code>.wrn</code> files or register a direct output handler from JavaScript. The canonical API exposes <code>payload</code> and does not require <code>event.detail</code>.</p></div><div class="detail-events-grid"><div class="detail-events-list"><div><code>@toggle</code><span>Fires when the component changes between open and closed or on and off states.</span></div><div><code>@select</code><span>Fires when an item, option, card, or result is selected.</span></div></div><div class="detail-event-examples"><section class="demo-code"><header><span><span class="icon-[lucide--braces] size-4" aria-hidden="true"></span>Declarative handlers</span><small>.wrn</small></header><pre><code>&lt;LegendIndicator
@toggle='console.log(payload)'
@select='console.log(payload)'
/&gt;</code></pre></section><section class="demo-code"><header><span><span class="icon-[lucide--radio] size-4" aria-hidden="true"></span>Direct output handlers</span><small>.js</small></header><pre><code>import &#123; registerOutputHandler &#125; from "@wrnexus/csr/outputs"
/&gt;</code></pre></section><section class="demo-code"><header><span><span class="icon-[lucide--radio] size-4" aria-hidden="true"></span>Direct output handlers</span><small>.js</small></header><pre><code>import <span>&#123;</span> registerOutputHandler <span>&#125;</span> from "@wrnexus/csr/outputs"
const component = document.querySelector("[data-ui-component=\"LegendIndicator\"], [data-component=\"LegendIndicator\"]")
if (component) registerOutputHandler(component, "toggle", (payload) =&gt; &#123;
if (component) registerOutputHandler(component, "toggle", (payload) =&gt; <span>&#123;</span>
console.log("toggle", payload)
&#125;)
<span>&#125;</span>)
if (component) registerOutputHandler(component, "select", (payload) =&gt; &#123;
if (component) registerOutputHandler(component, "select", (payload) =&gt; <span>&#123;</span>
console.log("select", payload)
&#125;)</code></pre></section></div></div></section>
<span>&#125;</span>)</code></pre></section></div></div></section>
<section id="api" class="detail-section"><div class="detail-section-heading"><span>Component API</span><h2>Props and configuration</h2><p>All content and behavior shown above is supplied through these props and slots.</p></div><div class="docs-table-wrap"><table class="docs-table"><thead><tr><th>Prop</th><th>Type</th><th>Default</th><th>Required</th></tr></thead><tbody><tr><td><code>size</code></td><td>string</td><td><code>"default"</code></td><td>No</td></tr><tr><td><code>color</code></td><td>string</td><td><code>"primary"</code></td><td>No</td></tr><tr><td><code>title</code></td><td>string</td><td><code>"Legend Indicator"</code></td><td>No</td></tr><tr><td><code>description</code></td><td>string</td><td><code>""</code></td><td>No</td></tr><tr><td><code>items</code></td><td>unknown[]</td><td><code>[]</code></td><td>No</td></tr><tr><td><code>variant</code></td><td>string</td><td><code>"default"</code></td><td>No</td></tr><tr><td><code>class</code></td><td>string</td><td><code>""</code></td><td>No</td></tr></tbody></table></div></section>
</main>
<aside class="detail-aside">