Mercurial
comparison design_system/src/index.html @ 251:117c4d53c9a4
[ui] Add HTML-first Web Component system
Co-authored-by: Copilot <[email protected]>
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Tue, 04 Aug 2026 09:14:57 -0700 |
| parents | |
| children | 7a7581f040e8 |
comparison
equal
deleted
inserted
replaced
| 250:745fd127b2a1 | 251:117c4d53c9a4 |
|---|---|
| 1 <!doctype html> | |
| 2 <html lang="en"> | |
| 3 <head> | |
| 4 <meta charset="utf-8" /> | |
| 5 <meta name="viewport" content="width=device-width, initial-scale=1" /> | |
| 6 <meta name="color-scheme" content="light dark" /> | |
| 7 <title>Zenbu UI</title> | |
| 8 <link rel="stylesheet" href="/styles/tokens.css" /> | |
| 9 <link rel="stylesheet" href="/styles/components.css" /> | |
| 10 <link rel="stylesheet" href="/storybook.css" /> | |
| 11 <script type="module" src="/storybook.js"></script> | |
| 12 </head> | |
| 13 <body> | |
| 14 <div class="catalog-shell"> | |
| 15 <aside class="catalog-sidebar"> | |
| 16 <a class="catalog-brand" href="/" data-catalog-link> | |
| 17 <span class="catalog-mark" aria-hidden="true">全</span> | |
| 18 Zenbu UI | |
| 19 </a> | |
| 20 | |
| 21 <h2>Foundations</h2> | |
| 22 <nav class="catalog-nav" aria-label="Foundations"> | |
| 23 <a href="/" data-catalog-link>Overview</a> | |
| 24 <a href="/tokens" data-catalog-link>Tokens</a> | |
| 25 </nav> | |
| 26 | |
| 27 <h2>Components</h2> | |
| 28 <nav class="catalog-nav" aria-label="Components"> | |
| 29 <a href="/components/button" data-catalog-link>Button</a> | |
| 30 <a href="/components/card" data-catalog-link>Card</a> | |
| 31 <a href="/components/alert" data-catalog-link>Alert</a> | |
| 32 <a href="/components/field" data-catalog-link>Field</a> | |
| 33 <a href="/components/stack" data-catalog-link>Stack</a> | |
| 34 </nav> | |
| 35 | |
| 36 <button id="themeToggle" class="theme-toggle" type="button"> | |
| 37 Toggle theme | |
| 38 </button> | |
| 39 </aside> | |
| 40 | |
| 41 <main id="catalogMain" class="catalog-main" tabindex="-1"> | |
| 42 <section class="catalog-page" data-catalog-page="overview"> | |
| 43 <header class="page-heading"> | |
| 44 <p class="eyebrow">HTML first</p> | |
| 45 <h1>A small design system that stays close to the platform.</h1> | |
| 46 <p> | |
| 47 Zenbu UI uses light-DOM Web Components to organize styling and | |
| 48 behavior without hiding the native button, link, label, input, | |
| 49 article, and section elements that already work. | |
| 50 </p> | |
| 51 </header> | |
| 52 | |
| 53 <div class="principles"> | |
| 54 <article class="principle"> | |
| 55 <h2>Native underneath</h2> | |
| 56 <p>Interactive wrappers contain real HTML controls, preserving forms, links, keyboard behavior, and browser APIs.</p> | |
| 57 </article> | |
| 58 <article class="principle"> | |
| 59 <h2>Light DOM</h2> | |
| 60 <p>Application code can inspect, style, test, and progressively enhance every element without crossing a shadow boundary.</p> | |
| 61 </article> | |
| 62 <article class="principle"> | |
| 63 <h2>Portable tokens</h2> | |
| 64 <p>CSS custom properties provide the visual contract. Components remain dependency-free ES modules.</p> | |
| 65 </article> | |
| 66 </div> | |
| 67 | |
| 68 <h2>Components</h2> | |
| 69 <div class="component-grid"> | |
| 70 <a href="/components/button" data-catalog-link> | |
| 71 <zen-card interactive><article><h3>Button</h3><p>Native buttons and links with shared variants and loading state.</p></article></zen-card> | |
| 72 </a> | |
| 73 <a href="/components/card" data-catalog-link> | |
| 74 <zen-card interactive><article><h3>Card</h3><p>A visual container that leaves article semantics in your HTML.</p></article></zen-card> | |
| 75 </a> | |
| 76 <a href="/components/alert" data-catalog-link> | |
| 77 <zen-card interactive><article><h3>Alert</h3><p>Status and alert messages with optional dismissal.</p></article></zen-card> | |
| 78 </a> | |
| 79 <a href="/components/field" data-catalog-link> | |
| 80 <zen-card interactive><article><h3>Field</h3><p>Labels, controls, help text, and validity wiring.</p></article></zen-card> | |
| 81 </a> | |
| 82 <a href="/components/stack" data-catalog-link> | |
| 83 <zen-card interactive><article><h3>Stack</h3><p>A tiny layout primitive driven by HTML attributes.</p></article></zen-card> | |
| 84 </a> | |
| 85 </div> | |
| 86 </section> | |
| 87 | |
| 88 <section class="catalog-page" data-catalog-page="tokens" hidden> | |
| 89 <header class="page-heading"> | |
| 90 <p class="eyebrow">Foundations</p> | |
| 91 <h1>Design tokens</h1> | |
| 92 <p>Import one CSS file and override any <code>--zen-*</code> property at the application boundary.</p> | |
| 93 </header> | |
| 94 <div class="token-grid"> | |
| 95 <section class="token-group"> | |
| 96 <h2>Color</h2> | |
| 97 <dl class="swatch-list"> | |
| 98 <div><span class="swatch" style="--swatch: var(--zen-color-accent)"></span><div><dt>--zen-color-accent</dt><dd>Primary action</dd></div></div> | |
| 99 <div><span class="swatch" style="--swatch: var(--zen-color-info)"></span><div><dt>--zen-color-info</dt><dd>Informational state</dd></div></div> | |
| 100 <div><span class="swatch" style="--swatch: var(--zen-color-success)"></span><div><dt>--zen-color-success</dt><dd>Successful state</dd></div></div> | |
| 101 <div><span class="swatch" style="--swatch: var(--zen-color-danger)"></span><div><dt>--zen-color-danger</dt><dd>Dangerous state</dd></div></div> | |
| 102 </dl> | |
| 103 </section> | |
| 104 <section class="token-group"> | |
| 105 <h2>Spacing</h2> | |
| 106 <zen-stack gap="tight"> | |
| 107 <code>--zen-space-1: 0.25rem</code> | |
| 108 <code>--zen-space-2: 0.5rem</code> | |
| 109 <code>--zen-space-4: 1rem</code> | |
| 110 <code>--zen-space-6: 2rem</code> | |
| 111 </zen-stack> | |
| 112 </section> | |
| 113 <section class="token-group"> | |
| 114 <h2>Shape</h2> | |
| 115 <zen-stack gap="tight"> | |
| 116 <code>--zen-radius-sm</code> | |
| 117 <code>--zen-radius-md</code> | |
| 118 <code>--zen-radius-lg</code> | |
| 119 <code>--zen-shadow-sm / md</code> | |
| 120 </zen-stack> | |
| 121 </section> | |
| 122 </div> | |
| 123 </section> | |
| 124 | |
| 125 <section class="catalog-page" data-catalog-page="button" hidden> | |
| 126 <header class="page-heading"> | |
| 127 <p class="eyebrow">Component</p> | |
| 128 <h1>Button</h1> | |
| 129 <p>Wrap a native <code>button</code> or <code>a</code>. The browser keeps responsibility for forms and navigation.</p> | |
| 130 </header> | |
| 131 <zen-story name="Variants"> | |
| 132 <template> | |
| 133 <zen-stack direction="row"> | |
| 134 <zen-button><button type="button">Primary action</button></zen-button> | |
| 135 <zen-button variant="quiet"><button type="button">Quiet action</button></zen-button> | |
| 136 <zen-button variant="danger"><button type="button">Delete item</button></zen-button> | |
| 137 </zen-stack> | |
| 138 </template> | |
| 139 </zen-story> | |
| 140 <zen-story name="States"> | |
| 141 <template> | |
| 142 <zen-stack direction="row"> | |
| 143 <zen-button loading><button type="button">Saving</button></zen-button> | |
| 144 <zen-button disabled><button type="button">Unavailable</button></zen-button> | |
| 145 <zen-button variant="quiet"><a href="/tokens">Token link</a></zen-button> | |
| 146 </zen-stack> | |
| 147 </template> | |
| 148 </zen-story> | |
| 149 </section> | |
| 150 | |
| 151 <section class="catalog-page" data-catalog-page="card" hidden> | |
| 152 <header class="page-heading"> | |
| 153 <p class="eyebrow">Component</p> | |
| 154 <h1>Card</h1> | |
| 155 <p>The wrapper owns presentation. You choose the native sectioning element and heading level.</p> | |
| 156 </header> | |
| 157 <zen-story name="Article cards"> | |
| 158 <template> | |
| 159 <div class="demo-card-grid"> | |
| 160 <zen-card> | |
| 161 <article> | |
| 162 <h3>Repository health</h3> | |
| 163 <p>All worker queues are healthy and the last deployment passed.</p> | |
| 164 <zen-button variant="quiet"><a href="/components/alert">View status</a></zen-button> | |
| 165 </article> | |
| 166 </zen-card> | |
| 167 <zen-card interactive> | |
| 168 <article> | |
| 169 <h3>Interactive treatment</h3> | |
| 170 <p>Add the attribute when the whole card leads somewhere.</p> | |
| 171 </article> | |
| 172 </zen-card> | |
| 173 </div> | |
| 174 </template> | |
| 175 </zen-story> | |
| 176 </section> | |
| 177 | |
| 178 <section class="catalog-page" data-catalog-page="alert" hidden> | |
| 179 <header class="page-heading"> | |
| 180 <p class="eyebrow">Component</p> | |
| 181 <h1>Alert</h1> | |
| 182 <p>Tone selects status semantics and color. Add <code>dismissible</code> for a generated native close button.</p> | |
| 183 </header> | |
| 184 <zen-story name="Tones"> | |
| 185 <template> | |
| 186 <zen-stack> | |
| 187 <zen-alert><p><strong>Info:</strong> The new bundle is ready to inspect.</p></zen-alert> | |
| 188 <zen-alert tone="success"><p><strong>Success:</strong> All tests passed.</p></zen-alert> | |
| 189 <zen-alert tone="warning"><p><strong>Warning:</strong> One worker slot remains.</p></zen-alert> | |
| 190 <zen-alert tone="danger" dismissible><p><strong>Error:</strong> Deployment failed and was rolled back.</p></zen-alert> | |
| 191 </zen-stack> | |
| 192 </template> | |
| 193 </zen-story> | |
| 194 </section> | |
| 195 | |
| 196 <section class="catalog-page" data-catalog-page="field" hidden> | |
| 197 <header class="page-heading"> | |
| 198 <p class="eyebrow">Component</p> | |
| 199 <h1>Field</h1> | |
| 200 <p>Write a label and native control. The component supplies IDs, label association, help text, and invalid state.</p> | |
| 201 </header> | |
| 202 <zen-story name="Input and textarea"> | |
| 203 <template> | |
| 204 <zen-stack> | |
| 205 <zen-field> | |
| 206 <label>Email address</label> | |
| 207 <input type="email" required placeholder="[email protected]" /> | |
| 208 <small>Used only for build notifications.</small> | |
| 209 </zen-field> | |
| 210 <zen-field> | |
| 211 <label>Deployment note</label> | |
| 212 <textarea placeholder="What changed?"></textarea> | |
| 213 <small>Keep it short and useful.</small> | |
| 214 </zen-field> | |
| 215 </zen-stack> | |
| 216 </template> | |
| 217 </zen-story> | |
| 218 </section> | |
| 219 | |
| 220 <section class="catalog-page" data-catalog-page="stack" hidden> | |
| 221 <header class="page-heading"> | |
| 222 <p class="eyebrow">Component</p> | |
| 223 <h1>Stack</h1> | |
| 224 <p>A flex layout primitive with readable direction and gap attributes.</p> | |
| 225 </header> | |
| 226 <zen-story name="Vertical and horizontal"> | |
| 227 <template> | |
| 228 <zen-stack gap="loose"> | |
| 229 <zen-stack gap="tight"> | |
| 230 <strong>Vertical stack</strong> | |
| 231 <span>One item</span> | |
| 232 <span>Another item</span> | |
| 233 </zen-stack> | |
| 234 <zen-stack direction="row"> | |
| 235 <zen-button><button type="button">Accept</button></zen-button> | |
| 236 <zen-button variant="quiet"><button type="button">Cancel</button></zen-button> | |
| 237 </zen-stack> | |
| 238 </zen-stack> | |
| 239 </template> | |
| 240 </zen-story> | |
| 241 </section> | |
| 242 </main> | |
| 243 </div> | |
| 244 </body> | |
| 245 </html> |