Organism · stable · v1.0.0 · owner: Site system lead · contract 19 of 20 points (open: figma)
Do and don't
Do: On Govern
Rendered by cloth-diagram.tsOpen example: A system, seen as cloth · Do: On Govern Use the full-page example to follow page links.
Do: Frayed edges with the legend
Rendered by cloth-diagram.tsOpen example: A system, seen as cloth · Do: Frayed edges with the legend Use the full-page example to follow page links.
Don't: Without the sample tag
Rendered by cloth-diagram.tsOpen example: A system, seen as cloth · Don't: Without the sample tag Use the full-page example to follow page links.
Don't: Section colours in cells
Rendered by cloth-diagram.tsOpen example: A system, seen as cloth · Don't: Section colours in cells Use the full-page example to follow page links.
Rules
| Rule | Why | Check |
|---|---|---|
| The a system, seen as cloth is drawn from the sample cloth data (apps/showcase/site/visuals/cloth-data.ts) at build time. | A figure read from the real records cannot drift from them. | Automated: npm run site:build (reads the data; fails if it is missing) |
| The legend names every band colour used. | Colour alone never carries meaning. | Automated: tests/unit/site-system.test.ts |
API
| Prop | Type | Required | Default | What it does |
|---|---|---|---|---|
variant | plain | fray | No | "plain" | Plain uses one knot pulse (2412 ms); fray adds one frayed-edge cycle (3204 ms). Both retain the same sample data and selection controls. |
lang | en | ja | No | "en" | The selected cloth sample text remains English in either page locale; its root is explicitly lang=en. No native Japanese translation is claimed. |
Contract details
The full contract: identity, anatomy, variants, states, tokens, layout, motion, accessibility, content, tests
Identity
| Aspect | Value |
|---|---|
| Id | cloth-diagram |
| Layer | Organisms |
| Category | figure |
| Owner | Site system lead |
| Status | stable |
| Version | 1.0.0 |
| Source | apps/showcase/site/system/organisms/cloth-diagram.ts (private repository; the contract and the render function are this one module) |
| Version | Date | Change |
|---|---|---|
| 1.0.0 | 2026-10-26 | A system, seen as cloth, drawn at build time from the sample cloth data (apps/showcase/site/visuals/cloth-data.ts). |
Use when
- Govern and Organisations, where the page explains health across products. Why: One picture shows where a system is loose across products.
Do not use when
- As a real client's health map. Why: It is sample data, tagged as such.
Anatomy
| Part | What it is |
|---|---|
| root | figure.visual (cloth) |
| map | table.cloth with one cell per family and product |
| legend | Band legend with words |
| side | Thread card for the selected cell |
Made of: figure-frame, band-word, table, tag, caption.
Used in: pages directly.
Variants
| Variant | When | Why |
|---|---|---|
| plain | Default sample health map. | Static weave density and text retain the health meaning; plain adds one knot pulse (2412 ms). |
| fray | The existing frayed-edge illustration is requested. | It adds one authored edge cycle (3204 ms) while the managed root is visible; reduced motion, interruption and fallback remain still. |
States
| State | Rendered or not applicable |
|---|---|
| default | Complete cloth |
| hover | A cell outlines. |
| focus-visible | Marked cells are buttons with the --focus ring. |
| active | Every native cell button updates aria-pressed and its selected explanatory card. |
| disabled | Not applicable: All authored cells are selectable; no disabled variant is provided. |
| loading | The build-time sample map/card/list stays readable while its managed native chunk loads. |
| empty | Not applicable: Always data. |
| error | Caught chunk or native initialization failure restores the original sample map/card/list; the host records failure and remount may retry. |
| current | The selected cell, shown in the thread card. |
| visited | Not applicable: Not links. |
| expanded | The thread card shows the picked cell. |
Tokens
| Part | Token |
|---|---|
| cell.colour | the band colour of the cell's own health (a mark with its word in the legend) |
| legend.font | --type-small |
| --cloth-diagram-gap-space-9 | var(--space-9) |
| --cloth-diagram-gap-space-10 | var(--space-10) |
| --cloth-diagram-padding-bottom-space-3 | var(--space-3) |
| --cloth-diagram-font-type-label | var(--type-label) |
| --cloth-diagram-padding-space-1 | var(--space-1) |
| --cloth-diagram-padding-space-2 | var(--space-2) |
| --cloth-diagram-font-type-small-strong | var(--type-small-strong) |
| --cloth-diagram-padding-right-space-4 | var(--space-4) |
| --cloth-diagram-font-size-fs-label | var(--fs-label) |
| --cloth-diagram-border-radius-radius | var(--radius) |
| --cloth-diagram-outline-focus | var(--focus) |
| --cloth-diagram-outline-ink | var(--ink) |
| --cloth-diagram-right-space-2 | var(--space-2) |
| --cloth-diagram-top-space-2 | var(--space-2) |
| --cloth-diagram-background-surface | var(--surface) |
| --cloth-diagram-box-shadow-ink | var(--ink) |
| --cloth-diagram-animation-dur-weave | var(--dur-weave) |
| --cloth-diagram-animation-ease-standard | var(--ease-standard) |
| --cloth-diagram-gap-space-4 | var(--space-4) |
| --cloth-diagram-gap-space-7 | var(--space-7) |
| --cloth-diagram-margin-top-space-6 | var(--space-6) |
| --cloth-diagram-font-size-fs-small | var(--fs-small) |
| --cloth-diagram-margin-top-space-7 | var(--space-7) |
| --cloth-diagram-gap-space-5 | var(--space-5) |
| --cloth-diagram-padding-space-4 | var(--space-4) |
| --cloth-diagram-border-top-line | var(--line) |
| --cloth-diagram-margin-top-space-2 | var(--space-2) |
| --cloth-diagram-background-madder | var(--madder) |
| --cloth-diagram-background-saffron | var(--saffron) |
| --cloth-diagram-text-decoration-color-line | var(--line) |
| --cloth-diagram-transition-dur-weave | var(--dur-weave) |
| --cloth-diagram-transition-ease-standard | var(--ease-standard) |
| --cloth-diagram-transition-delay-dur-fast | var(--dur-fast) |
| --cloth-diagram-transition-delay-dur-moderate | var(--dur-moderate) |
| --cloth-diagram-transition-delay-dur-slow | var(--dur-slow) |
| --cloth-diagram-background-cotton | var(--cotton) |
| --cloth-diagram-padding-space-7 | var(--space-7) |
| --cloth-diagram-border-top-madder | var(--madder) |
| --cloth-diagram-border-top-color-saffron | var(--saffron) |
| --cloth-diagram-border-top-color-teal | var(--teal) |
| --cloth-diagram-border-top-color-indigo | var(--indigo) |
| --cloth-diagram-font-size-fs-body | var(--fs-body) |
| --cloth-diagram-margin-space-3 | var(--space-3) |
| --cloth-diagram-margin-space-5 | var(--space-5) |
| --cloth-diagram-color-ink-2 | var(--ink-2) |
| --cloth-diagram-margin-top-space-5 | var(--space-5) |
Layout
| Aspect | Value |
|---|---|
| breakpoints | Required review at 390, 768, 1024 and 1440 px; execution is not implied by this declaration; the figure reflows to one column under 768 px. |
| wrapping | Labels wrap; drawings scale to the column. |
| textExpansion | Japanese labels are 20 to 40% longer and wrap inside their cells. |
Spacing and rhythm
| Aspect | Value |
|---|---|
| internal | Inside the Figure frame's --space-7 padding. |
| external | --space-9 above and below in prose. |
| rhythm | After the text whose claim it proves. |
Motion
| Aspect | Value |
|---|---|
| moves | Rows weave in once on first view; loose markers pulse once (2412 ms), and fray adds one edge cycle (3204 ms). Both cycles finish at their original static pose. |
| trigger | Scrolled into view. |
| duration | --dur-weave per row |
| easing | --ease-standard |
| interruptible | Hidden/offscreen/live reduced preference settles the entrance and consumes ambient motion, with no automatic restart. Disposal restores still fallback. |
| reduced | Shown complete. |
| why | Weaving in shows the metaphor: health is how tightly the cloth holds. |
Runtime and reuse
stylesheet: /css/site.css. Built Site tokens, core and registered element CSS; preserve modes, focus and responsive rules.
stylesheet: /css/demos.css. Existing legacy demo styles where the rendered specimen uses them.
font: /fonts/. Self-hosted files referenced by Site @font-face, with licences; Japanese locale overrides remain applicable.
Static fallback: Original build-time specimen remains readable before loading and after chunk/initialization failure; enhancement controls retain authored hidden state.
Configured initializer: apps/showcase/site/visuals/cloth.ts#init. The host owns transactional static-markup restoration and runtime state.
Consumer module (imports relative to the configured source root): import { createRuntimeHost } from "./src/workflows/runtime-host"; import { SITE_RUNTIMES } from "./apps/showcase/site/runtime-registry"; const definition = SITE_RUNTIMES.find(entry => entry.binding.id === "cloth"); if (!definition || definition.binding.lifecycle.kind !== "managed") throw new Error("Managed runtime binding unavailable"); const host = createRuntimeHost([definition]); export function mountRuntime(container: ParentNode) { return host.mountAll(container); }After inserting the rendered markup, call mountRuntime(container) for the container holding [data-visual="cloth"]. Retain the returned disposal function and call it before removing, replacing or remounting, including every Storybook args render. The configured host restores captured static markup/attributes on disposal or caught load/initialization failure; retry starts a fresh managed remount.
Accessibility passport
| Aspect | Value |
|---|---|
| role | figure, named by its caption |
| name | The caption, and a text alternative for any drawing |
| keyboard | Not interactive unless stated. |
| focus | Links inside are in reading order. |
| screenReader | Reads the figure's text and caption; drawings have role=img with a description. |
| contrast | Ink on surface 14:1; dyes used only as marks with their words. |
| target | Not a target. |
Content
| Slot | Length | Voice |
|---|---|---|
| caption | 2 sentences | What rows, columns and weave mean |
Good: “Each row is a component family and each column a product. Colour and weave show health.”
Bad: “Your system”
Japanese: Sample chart, cell descriptions and repair details retain the source English and are marked lang=en; Japanese coverage remains open.
Icons and illustrations
None: this element uses no icon or illustration of its own.
Decisions and exceptions
Usage
24 uses across the built pages (measured by npm run site:system).
Tests
| Aspect | Value |
|---|---|
| unit | tests/unit/site-system.test.ts: renders every do and don't example through the registry and checks the classes it owns |
| visual | Not yet: there are no screenshot baselines; the Library page is checked for sideways scroll at 1440 px by tests/site/system.spec.ts |
| a11y | tests/site/system.spec.ts: axe (0 serious or critical) on the element's Library page in light and dark |
| parity | scripts/site/system/check.ts: Library examples are rendered by the same render function the site imports |
Figma
not-yet: The Loom Site Figma library is the last stage of the plan; this element is not mapped yet.