feat(theme): implement accessible Technical-Light 1.0 contracts
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
# UI Theme — normalized target spec
|
||||
|
||||
Status: **Draft**. The single design the sister projects converge on. Derived from the
|
||||
three code-verified current-state docs (`../current-state/`). Goal is *path to shared
|
||||
code* (`../shared-contract/ZB.MOM.WW.Theme.md`), so each normalized section maps to a
|
||||
shared library seam.
|
||||
Status: **Implemented shared system; 1.0.0 accessible candidate in validation**.
|
||||
Current published version remains 0.5.3 until the release gate closes. Original
|
||||
current-state documents retain historical evidence. Actual source pins, version policy
|
||||
and rollout state are in [release decision](../RELEASE-DECISION.md) and the execution ledger.
|
||||
|
||||
## 0. Scope
|
||||
|
||||
@@ -14,8 +14,7 @@ common controls); delivery via the `ZB.MOM.WW.Theme` RCL.
|
||||
**Explicitly NOT normalized** (domain-specific — keep per project): each app's `site.css`
|
||||
residual page layout, route/page content, and app-specific scoped `.razor.css` files.
|
||||
The kit owns the *chrome and tokens*, not the app's domain screens. Authorization logic
|
||||
and interactive nav-state persistence (e.g. OtOpcUa's cookie-persisted rail sections)
|
||||
are also per-project.
|
||||
remain per-project. Shared nav-section persistence belongs to `ThemeScripts`/`nav-state.js`.
|
||||
|
||||
---
|
||||
|
||||
@@ -26,9 +25,9 @@ declared on `:root` in `theme.css`. Components carry **no hardcoded hex values**
|
||||
everything references these tokens. Bootstrap 5 `--bs-*` variables are overridden to
|
||||
align Bootstrap's defaults with the Technical-Light palette.
|
||||
|
||||
The **one per-app override** allowed is `--accent` on the `ThemeShell` root element
|
||||
(passed via the `Accent` parameter), giving each app a distinct primary color while
|
||||
sharing all other tokens.
|
||||
Per-app accents use `Accent`, `AccentDeep`, `AccentTint`, `AccentBorder` and
|
||||
`AccentFocus` on the shell subtree. Semantic status and informational colors stay
|
||||
shared. Supported dark schemes require separately verified readable aliases.
|
||||
|
||||
See [`DESIGN-TOKENS.md`](DESIGN-TOKENS.md) for the full enumeration.
|
||||
|
||||
@@ -36,8 +35,8 @@ See [`DESIGN-TOKENS.md`](DESIGN-TOKENS.md) for the full enumeration.
|
||||
- **Surface** — `--paper`, `--card`
|
||||
- **Ink (text)** — `--ink`, `--ink-soft`, `--ink-faint`
|
||||
- **Structure** — `--rule`, `--rule-strong`
|
||||
- **Accent** — `--accent`, `--accent-deep`
|
||||
- **Status** — `--ok`, `--warn`, `--bad`, `--idle` (+ `-bg` variants)
|
||||
- **Accent** — `--accent`, `--accent-deep`, `--accent-tint`, `--accent-border`, `--accent-focus`, `--on-accent`
|
||||
- **Status** — signal `--ok`/`--warn`/`--bad`/`--idle`, matching `-ink` text and `-bg` surfaces; independent `--info-ink`/`--info-bg`
|
||||
- **Typography** — `--sans` (IBM Plex Sans), `--mono` (IBM Plex Mono)
|
||||
- **Bootstrap overrides** — `--bs-body-bg`, `--bs-body-color`, `--bs-body-font-family`,
|
||||
`--bs-body-font-size`, `--bs-primary`, `--bs-border-color`, `--bs-emphasis-color`
|
||||
@@ -109,7 +108,7 @@ no inline colors. One `@using ZB.MOM.WW.Theme` covers every component and enum.
|
||||
|
||||
| Component / Type | Key parameters | Notes |
|
||||
|---|---|---|
|
||||
| `ThemeShell` | `Product`*, `Accent`, `Logo`, `Nav`, `RailFooter`, `ChildContent` | Canonical side-rail chassis. Not a `LayoutComponentBase` — delegated to from `MainLayout`. `Accent` overrides `--accent` for the shell subtree. |
|
||||
| `ThemeShell` | `Product`*, `Accent`, `AccentDeep`, `AccentTint`, `AccentBorder`, `AccentFocus`, `ScrollNav`, `Logo`, `Nav`, `RailFooter`, `ChildContent` | Canonical side-rail chassis. Not a `LayoutComponentBase` — delegated to from `MainLayout`. `Accent` overrides `--accent` for the shell subtree. |
|
||||
| `BrandBar` | `Product`*, `Logo` | Brand glyph + product name; rendered in the rail header inside `ThemeShell`. |
|
||||
| `NavRailItem` | `Href`*, `Text`*, `Icon`, `Match` | Wraps `<NavLink class="rail-link">`. Active state via Blazor `NavLink`. |
|
||||
| `NavRailSection` | `Title`*, `Expanded` (default `true`), `ChildContent` | CSS-only `<details>` collapsible group; no JS, works in static SSR. |
|
||||
@@ -137,20 +136,21 @@ no inline colors. One `@using ZB.MOM.WW.Theme` covers every component and enum.
|
||||
|---|---|---|
|
||||
| `StatusPill` | `State`* (`StatusState`), `ChildContent` | Inline chip. `StatusState` enum: `Ok`, `Warn`, `Bad`, `Idle`, `Info`. Maps state → token class (`chip-ok`, …). |
|
||||
| `LoginCard` | `Product`*, `Action` (default `/auth/login`), `ReturnUrl`, `Error`, `ChildContent` | Static form-POST sign-in card. `ChildContent` for `<AntiforgeryToken/>`. Validate `ReturnUrl` server-side (open-redirect risk). |
|
||||
| `TechButton` | `Variant` (`ButtonVariant`), `Type`, `Busy`, `ChildContent`, splatted attrs | `ButtonVariant` enum: `Primary`, `Secondary`, `Danger`, `Ghost`. `Busy` disables + shows spinner. |
|
||||
| `TechButton` | `Variant` (`ButtonVariant`), `Size`, `Class`, `Type`, `Busy`, `BusyText`, `ChildContent`, splatted attrs | `ButtonVariant` enum: `Primary`, `Secondary`, `Danger`, `Ghost`. `Busy` disables + shows a decorative spinner and optional BusyText; exposes aria-busy. Caller owns the outcome region. |
|
||||
| `TechCard` | `Title`, `Header`, `ChildContent`, `Footer`, `Class` | Panel with optional head/body/footer slots. |
|
||||
| `TechField` | `Label`*, `Hint`, `Error`, `ChildContent` | Labeled input wrapper with hint text and inline error. |
|
||||
| `TechField` | `Label`*, `For`, `Hint`, `HintId`, `Error`, `ErrorId`, `ChildContent` | Label/hint/error association wrapper. Caller owns input id, aria-describedby and aria-invalid. |
|
||||
|
||||
\* `EditorRequired` parameter.
|
||||
|
||||
**Deliberately NOT included** (YAGNI / stays per-project): data grids, tree views,
|
||||
multi-select dropdowns, modals, toasts, audit components, page-specific layouts.
|
||||
**Deliberately NOT included** (YAGNI / stays per-project): domain grids/tree data, multi-select dropdowns, modals, toasts, audit components and
|
||||
page-specific layouts. The existing stateless TreeTable renders caller-owned rows; it
|
||||
does not own data loading/filtering. Shared interaction recipes apply without a speculative modal API.
|
||||
|
||||
---
|
||||
|
||||
## 5. Delivery
|
||||
|
||||
The RCL ships as the single NuGet package `ZB.MOM.WW.Theme` (`.NET 10`, `Version 0.1.0`).
|
||||
The RCL ships as the single NuGet package `ZB.MOM.WW.Theme` (`.NET 10`). Published version is 0.5.3; the 1.0.0 candidate waits for package and browser acceptance.
|
||||
|
||||
**Static assets** are served at `_content/ZB.MOM.WW.Theme/…` by ASP.NET's static-web-asset
|
||||
pipeline:
|
||||
|
||||
Reference in New Issue
Block a user