docs: update portal for WRNexusJS 0.4.0

This commit is contained in:
2026-07-27 13:29:36 +05:30
parent 9e8c8dd521
commit 4846b3684b
162 changed files with 4574 additions and 967 deletions
+34 -10
View File
@@ -10,21 +10,21 @@ page wrnexusui {
<header class="topbar">
<a class="brand" href="/"><span>W</span> WRNexusJS</a>
<nav aria-label="Primary"><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="/components">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.3.6</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.4.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
</header>
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="/components">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
<main class="portal-main docs-layout">
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/ui</span></nav><section class="doc-intro"><span class="eyebrow">Frontend · Package reference</span><h1>@wrnexus/ui</h1><p>Themeable server-rendered UI components and CSS.</p><div class="doc-meta"><span>v0.3.6</span><span>Private registry</span><span>Frontend</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/ui@0.3.6</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>First-party Wire UI component library — a set of themeable <code>.wrn</code> components plus a single tokenized stylesheet.</blockquote>
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/ui</span></nav><section class="doc-intro"><span class="eyebrow">Frontend · Package reference</span><h1>@wrnexus/ui</h1><p>Themeable server-rendered UI components and CSS.</p><div class="doc-meta"><span>v0.4.0</span><span>Private registry</span><span>Frontend</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/ui@0.4.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>First-party Wire UI component library — a set of themeable <code>.wrn</code> components plus a single tokenized stylesheet.</blockquote>
<p>Part of the <strong>WRNexusJS</strong> framework — an SSR-first, Bun-native full-stack web framework.</p>
<h3 id="overview">Overview</h3>
<p><code>@wrnexus/ui</code> ships a library of server-rendered <code>.wrn</code> components (layout, form controls, and feedback UI) together with one themeable stylesheet, <code>ui.css</code>. The components are <strong>auto-discovered</strong> by the framework router — you don't import them in code. Once the package's component directory is on the router's scan path, you mount any component in a page with <code>data-component=&quot;&lt;name&gt;&quot;</code>. Every visual is driven by <code>var(--wire-*)</code> theme tokens, so components restyle instantly when the theme changes. The tiny JS surface (<code>src/index.ts</code>) exists only so the toolchain (CLI build + dev server) can locate the component directory and stylesheet.</p>
<p>The complete PDF-aligned catalog currently contains <strong>891 components</strong>. The generated <code>COMPONENTS.md</code> and <code>component-reference.json</code> files document every mount name, prop, inferred type, default/required status, slot, event, category, and source file directly from the packaged <code>.wrn</code> source.</p>
<p>The complete PDF-aligned catalog currently contains <strong>85 components</strong>. The generated <code>COMPONENTS.md</code> and <code>component-reference.json</code> files document every mount name, prop, inferred type, default/required status, slot, event, category, and source file directly from the packaged <code>.wrn</code> source.</p>
<pre data-language="bash"><code>bun add @wrnexus/ui</code></pre>
<blockquote>Private package — the machine must be authenticated to the <code>wrnexus</code> npm org</blockquote>
<blockquote>(a read token in <code>~/.npmrc</code>). Requires <strong>Bun</strong> (Node is not supported).</blockquote>
<p>In practice you rarely install this directly: <code>@wrnexus/cli</code> and <code>@wrnexus/dev-server</code> already depend on it and wire it into the router for you (see [Auto-discovery](#auto-discovery)).</p>
<h3 id="components">Components</h3>
<p>Components live as <code>.wrn</code> files under <code>packages/ui/components/</code>. The mount name is the <strong>lowercase file basename</strong> (e.g. <code>button.wrn</code> <code>data-component=&quot;button&quot;</code>). Each accepts a <code>class</code> prop (appended to its root element) and most render their body from either a named prop or the default slot.</p>
<p>Components live as <code>.wrn</code> files under <code>packages/ui/components/</code>. The canonical mount name comes from the component declaration (for example, <code>component Button</code> mounts as <code>data-component=&quot;Button&quot;</code>). Component lookup is case-insensitive, so existing lowercase mounts continue to work. Each component accepts a <code>class</code> prop (appended to its root element), and most render their body from either a named prop or the default slot.</p>
<h4 id="layout">Layout</h4>
<div class="table-wrap"><table>
<thead><tr><th>Name</th><th>Purpose</th><th>Key props</th></tr></thead>
@@ -40,10 +40,10 @@ page wrnexusui {
<p>The authoritative, always-current list is <code>uiComponentNames()</code> (below), which reads the component directory at runtime.</p>
<p>For the full catalog, see [<code>COMPONENTS.md</code>](./COMPONENTS.md). The machine-readable equivalent is exported as <code>@wrnexus/ui/component-reference.json</code>.</p>
<h3 id="api">API</h3>
<p>The JS module (<code>@wrnexus/ui</code>) exposes four helpers used by the build tooling to locate the component assets. There is no component code to import — the components are <code>.wrn</code> files rendered server-side.</p>
<p>The JS module (<code>@wrnexus/ui</code>) exposes five helpers used by the build tooling to locate the component assets. There is no component code to import — the components are <code>.wrn</code> files rendered server-side.</p>
<div class="table-wrap"><table>
<thead><tr><th>Export</th><th>Signature</th><th>Returns</th></tr></thead>
<tbody><tr><td><code>uiComponentsDir</code></td><td><code>() =&gt; string</code></td><td>Absolute path to the <code>.wrn</code> component directory (feed to <code>buildRouter</code>'s <code>componentDirs</code>).</td></tr><tr><td><code>uiCssPath</code></td><td><code>() =&gt; string</code></td><td>Absolute path to <code>ui.css</code>.</td></tr><tr><td><code>uiCss</code></td><td><code>() =&gt; string</code></td><td>The <code>ui.css</code> file contents (all <code>.wire-*</code> classes, themed via tokens).</td></tr><tr><td><code>uiComponentNames</code></td><td><code>() =&gt; string[]</code></td><td>Sorted list of built-in component names (e.g. for <code>wrnexus eject</code> listing).</td></tr></tbody></table></div>
<tbody><tr><td><code>uiComponentsDir</code></td><td><code>() =&gt; string</code></td><td>Absolute path to the <code>.wrn</code> component directory (feed to <code>buildRouter</code>'s <code>componentDirs</code>).</td></tr><tr><td><code>uiCssPath</code></td><td><code>() =&gt; string</code></td><td>Absolute path to <code>ui.css</code>.</td></tr><tr><td><code>uiCss</code></td><td><code>() =&gt; string</code></td><td>The <code>ui.css</code> file contents (all <code>.wire-*</code> classes, themed via tokens).</td></tr><tr><td><code>uiComponentNames</code></td><td><code>() =&gt; string[]</code></td><td>Sorted list of declared built-in component names.</td></tr><tr><td><code>uiComponentPath</code></td><td><code>(name: string) =&gt; string</code></td><td>Absolute source path for a declared component name or case-insensitive alias.</td></tr></tbody></table></div>
<h4 id="ui-css-asset-export"><code>./ui.css</code> asset export</h4>
<p><code>package.json</code> also exposes the raw stylesheet as a subpath asset:</p>
<pre data-language="json"><code>&quot;exports&quot;: &#123;
@@ -96,7 +96,29 @@ const router = buildRouter(appDir, &#123; componentDirs: [uiComponentsDir()] &#1
<li>Depends on [<code>@wrnexus/core</code>](../core) (<code>dependencies</code>).</li>
<li><code>theme-toggle</code> relies on the framework's theme runtime, which binds the</li>
<p><code>data-wire-theme-toggle</code> attribute — no per-component JS is required.</p>
</ul></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>/**
</ul></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>interface UiComponentMetadata &#123;
name: string;
mount: string;
category?: string;
purpose?: string;
props?: Array&lt;&#123;
name: string;
default?: unknown;
&#125;&gt;;
events?: string[];
&#125;
interface UiComponentReference &#123;
count: number;
components: UiComponentMetadata[];
&#125;
declare function uiComponentReference(): UiComponentReference;
declare function findUiComponent(name: string): UiComponentMetadata | undefined;
declare function auditUiComponents(): Array&lt;&#123;
component: string;
issue: string;
&#125;&gt;;
/**
* @wrnexus/ui — the Wire UI component library.
*
* Components are `.wrn` files under `components/`, auto-discovered by the
@@ -117,10 +139,12 @@ declare function uiComponentsDir(): string;
declare function uiCssPath(): string;
/** The Wire UI stylesheet contents (all `.wire-*` classes, themed via tokens). */
declare function uiCss(): string;
/** Names of the built-in components (e.g. for `wrnexus eject` listing). */
/** Names declared by the bundled components, independent of filename casing. */
declare function uiComponentNames(): string[];
/** Absolute path to a bundled component by its declared component name. */
declare function uiComponentPath(name: string): string;
export &#123; uiComponentNames, uiComponentsDir, uiCss, uiCssPath &#125;;
export &#123; type UiComponentMetadata, type UiComponentReference, auditUiComponents, findUiComponent, uiComponentNames, uiComponentPath, uiComponentReference, uiComponentsDir, uiCss, uiCssPath &#125;;
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Auto-discovery</h3><pre data-language="ts"><code>import &#123; buildRouter &#125; from &quot;@wrnexus/router&quot;;
import &#123; uiComponentsDir &#125; from &quot;@wrnexus/ui&quot;;
@@ -131,7 +155,7 @@ const router = buildRouter(appDir, &#123; componentDirs: [uiComponentsDir()] &#1
&lt;/div&gt;</code></pre></article></div></section><section class="prose component-catalog-callout"><h2>Explore the component library</h2><p>The component reference now has a dedicated catalog with searchable cards and one complete page per component.</p><p><a class="primary" href="/components">Browse all 85 components →</a></p></section></article>
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#components">Components</a><a class="toc-level-4" href="#layout">Layout</a><a class="toc-level-4" href="#core-feedback">Core / feedback</a><a class="toc-level-4" href="#additional-controls-data-display">Additional controls &amp; data display</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#ui-css-asset-export">./ui.css asset export</a><a class="toc-level-4" href="#tailwind-and-motion">Tailwind and motion</a><a class="toc-level-4" href="#using-the-selected-theme-in-application-ui">Using the selected theme in application UI</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-4" href="#auto-discovery">Auto-discovery</a><a class="toc-level-4" href="#mounting-components-in-a-page">Mounting components in a page</a><a class="toc-level-3" href="#overrides">Overrides</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
</main>
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.3.6</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.4.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
<BackToTop />
</div>
}