← designauthority.seanyong.xyz

Triage

Triage is the app-agnostic, paper-and-ink UI design authority: one token source of truth, one component runtime, one enforceable lint gate. Square corners, hairline rules, ink-on-paper surfaces, two themes (light/dark), two densities, a 35-component contract matrix, and a binding interaction standard. Dependency-free: plain CSS tokens, a small behaviour layer that degrades without JS, and generated artifacts.

pack triagev0.14.1The app-agnostic paper-and-ink design authority behind triage.seanyong.xyz.87 artifacts · 20 rules · 6 prohibitions · 4 fallbacks · 17 recipesgolden 75/75Gallery

Ask this authority

Golden set

75 / 75 cases pass
askexpectedgotresolved to
passa primary buttonRESOLVEDRESOLVEDcomponent/btn
passan icon-only buttonRESOLVEDRESOLVEDcomponent/iconbtn
passa switchRESOLVEDRESOLVEDcomponent/px-sw
passa menu itemRESOLVEDRESOLVEDcomponent/menu-item
passa nav itemRESOLVEDRESOLVEDcomponent/nav-item
passa chipRESOLVEDRESOLVEDcomponent/chip
passa data tableRESOLVEDRESOLVEDcomponent/tbl
passa version timelineRESOLVEDRESOLVEDcomponent/tl
passa bulk action barRESOLVEDRESOLVEDcomponent/bulkbar
passa save barRESOLVEDRESOLVEDcomponent/savebar
passa flash messageRESOLVEDRESOLVEDcomponent/msg
passa bannerRESOLVEDRESOLVEDcomponent/msg
passa tint bannerRESOLVEDRESOLVEDcomponent/msg
passa solid bannerRESOLVEDRESOLVEDcomponent/msg
passan informational bannerRESOLVEDRESOLVEDcomponent/msg
passthe design philosophyRESOLVEDRESOLVEDguideline/philosophy
passthe logo and brand markRESOLVEDRESOLVEDguideline/brand
passdark modeRESOLVEDRESOLVEDguideline/platform
passthe icon setRESOLVEDRESOLVEDguideline/icons
passaccessibilityRESOLVEDRESOLVEDguideline/accessibility
passthe voice and copy rulesRESOLVEDRESOLVEDguideline/voice
passlocalisation and i18nRESOLVEDRESOLVEDguideline/localisation
passa checkboxRESOLVEDRESOLVEDcomponent/check
passa progress barRESOLVEDRESOLVEDcomponent/progress
passa chat bubbleRESOLVEDRESOLVEDcomponent/bubble
passa proposal cardRESOLVEDRESOLVEDcomponent/proposal
passa keycapRESOLVEDRESOLVEDcomponent/kbd
passa toast notificationRESOLVEDRESOLVEDcomponent/toast2
passa status badgeRESOLVEDRESOLVEDcomponent/badge
passan empty stateRESOLVEDRESOLVEDcomponent/empty
passa dialogRESOLVEDRESOLVEDcomponent/dlg
passa tooltipRESOLVEDRESOLVEDcomponent/tip
passa loading spinnerRESOLVEDRESOLVEDcomponent/spinner
passtabsRESOLVEDRESOLVEDcomponent/tabs
passbreadcrumbsRESOLVEDRESOLVEDcomponent/crumbs
passa radio groupRESOLVEDRESOLVEDcomponent/radio
passa range sliderRESOLVEDRESOLVEDcomponent/slider
passan autocompleteRESOLVEDRESOLVEDcomponent/cb
passa date pickerRESOLVEDRESOLVEDcomponent/dp
passan accordionRESOLVEDRESOLVEDcomponent/acc
passa user avatarRESOLVEDRESOLVEDcomponent/avatar-sq
passa file dropzoneRESOLVEDRESOLVEDcomponent/drop
passa notifications panelRESOLVEDRESOLVEDcomponent/notif
passa command paletteRESOLVEDRESOLVEDcomponent/cmd
passnumbered paginationRESOLVEDRESOLVEDcomponent/pager-num
passa diff viewRESOLVEDRESOLVEDcomponent/diff
passa bottom sheetRESOLVEDRESOLVEDcomponent/sheet-end
pass404 pageRESOLVEDRESOLVEDcomponent/page-state
passnot found pageRESOLVEDRESOLVEDcomponent/page-state
passa dashboard pageRESOLVEDRESOLVEDpattern/dashboard
passa settings pageRESOLVEDRESOLVEDpattern/settings
passthe colour tokensRESOLVEDRESOLVEDtoken-set/colour
passthe color tokensRESOLVEDRESOLVEDtoken-set/colour
passa dialogueRESOLVEDRESOLVEDcomponent/dlg
passthe spacing scaleRESOLVEDRESOLVEDtoken-set/spacing
passrounded corners on the cardsCONFLICTCONFLICTprohibit/off-radius
passmake all the buttons roundedCONFLICTCONFLICTprohibit/off-radius
passa carouselUNDEFINEDUNDEFINED
passshow the result of a form submitCOMPOSECOMPOSErecipe/feedback-redirect
passannounce an action without navigationCOMPOSECOMPOSErecipe/feedback-inplace
passdelete a record safelyCOMPOSECOMPOSErecipe/entity-delete-armed
passconfirm account removalCOMPOSECOMPOSErecipe/high-stakes-confirm
passenable or disable an entityCOMPOSECOMPOSErecipe/entity-toggle
passshow the state of an itemCOMPOSECOMPOSErecipe/status-with-text
passnothing to show yetCOMPOSECOMPOSErecipe/empty-with-cta
passselect rows and act on themCOMPOSECOMPOSErecipe/bulk-actions
passsave an editor documentCOMPOSECOMPOSErecipe/editor-savebar
passper-row actionsCOMPOSECOMPOSErecipe/row-actions
passscreen header for a viewCOMPOSECOMPOSErecipe/page-head
passa dialog for a small taskCOMPOSECOMPOSErecipe/dialog-task
passa long list with pagesCOMPOSECOMPOSErecipe/paginated-list
passcopy a value to the clipboardCOMPOSECOMPOSErecipe/copy-value
passfilter a tableCOMPOSECOMPOSErecipe/filter-row
passassign a reviewerCOMPOSECOMPOSErecipe/assign-picker
passtrack a long running jobCOMPOSECOMPOSErecipe/job-progress

Artifacts

token-setColour — paper, ink, one accent, status trio token-set/colour

Ink-on-paper colour through tokens only: surfaces, text tiers, tints and line roles, one accent, a status trio (ok/warn/err) with tint and solid variants. Every token ships light and dark; compact density lives in token extensions. Raw colour values are lint errors (TDS002).

token-setTypography — system stack, one base, a rem ladder token-set/typography

Typography is tokenised: family tokens, a single base-size (16) that the rem ladder divides by, and an fs-* design scale. Font stacks derive from family tokens; off-system fonts are lint errors (TDS008).

token-setSpacing — preferred scale plus semantic roles token-set/spacing

Spacing has a curated preferred scale (2/4/8/12/16/24/32/48) and semantic roles (page/card/field/control) emitted as --space-*; primitives consume roles by intent. Off-scale spacing is a lint warning (TDS005); fixed chrome widths live in misc.layout.

token-setMotion — durations and easing, reduced-motion aware token-set/motion

Motion is tokenised (dur-*/ease-*); off-token durations are flagged (TDS006). The system ships prefers-reduced-motion handling (spinner slows, reveal transitions collapse) instead of ignoring the user setting.

token-setElevation — reserved for floating layers token-set/elevation

Elevation is reserved for layers that float (menus, dialogs, sheets, toasts); in-flow surfaces use hairline lines and paper tints instead of shadows. Tokenised shadow values only.

token-setData visualisation — Okabe–Ito derived series token-set/dataviz

A categorical series palette derived from Okabe–Ito and contrast-adjusted, with pairwise colour-vision-deficiency separation checked. Charts consume series tokens like everything else.

token-setBreakpoints — phone through wide, incl. phone-mode chrome token-set/breakpoints

Media queries in source use {bp-*} placeholders resolved from the misc.breakpoint tokens (phone/desk/wide; phone-up variants). Phone mode also swaps chrome (drawer nav, sticky bars).

guidelineInteraction standard (binding) guideline/interaction-standard

The interaction standard is binding for every screen: armed two-step deletes, confirm() only for one-way actions, show-the-reverse for reversible mutations, the three-channel feedback standard (banner/toast/empty state), save bars for editors, copy rules, and an exceptions register for deliberate deviations.

guidelineConsumption paths — global and scoped guideline/consumption

Two sanctioned ways to adopt: the global path (four lines: tokens.css, base.css, optional patterns.css, components.js) styles the whole page; the scoped path wraps a region in .triage and loads scoped.css so host content is never restyled. Pair the scoped bundle with reset.css for parity; without it the host owns root sizing.

componentButton component/btn

Button — from base.css. Documented states: default, hover, active, focus-visible, disabled, busy (guardApply). A11y: Use a real <button> or <a>; never a clickable div.

class .btn

· default

· hover

· active

· focus-visible

· disabled

· busy (guardApply)

componentIcon button component/iconbtn

Icon button — from base.css. Documented states: default, hover, active, focus-visible. A11y: aria-label is mandatory (the glyph is aria-hidden).

class .iconbtn

· default

· hover

· active

· focus-visible

componentSwitch component/px-sw

Switch — from base.css. Documented states: checked, unchecked, disabled, focus-visible. A11y: The visible label wraps a real checkbox; hidden twin carries the off value.

class .px-sw

· checked

· unchecked

· disabled

· focus-visible

componentMenu item component/menu-item

Menu item — from base.css. Documented states: default, hover, danger, armed, focus-visible. A11y: Destructive items use .arm-del with data-arm-label naming the object.

class .menu-item

· default

· hover

· danger

· armed

· focus-visible

componentNav item component/nav-item

Nav item — from base.css. Documented states: default, hover, active(selected), focus-visible. A11y: aria-current="page" on the active item.

class .nav-item

· default

· hover

· active(selected)

· focus-visible

componentChip component/chip

Chip — from base.css. Documented states: default, hover, active(selected), focus-visible. A11y: Counts live in .n; the whole chip is the target (not just the label).

class .chip

· default

· hover

· active(selected)

· focus-visible

componentIndex row component/index-row

Index row — from patterns.css. Documented states: default, hover, active, focus-visible. A11y: 54px minimum height; one row = one destination.

class .index-row

· default

· hover

· active

· focus-visible

componentTable component/tbl

Table — from base.css. Documented states: default, row hover, selected, reflowed (mcards). A11y: th scope where the header is meaningful; row checkbox needs aria-label.

class .tbl

· default

· row hover

· selected

· reflowed (mcards)

componentBulk bar component/bulkbar

Bulk bar — from base.css. Documented states: hidden, shown with selection. A11y: role=region with aria-label; count is text, not colour.

class .bulkbar

· hidden

· shown with selection

componentSave bar component/savebar

Save bar — from base.css. Documented states: sticky, keyboard-lifted (JS transform). A11y: Lifts above the mobile keyboard via keyboard-fit.js (transform), not a class toggle.

class .savebar

· sticky

· keyboard-lifted (JS transform)

componentFlash message component/msg

Flash message — from base.css. Documented states: ok, warn, err. A11y: role=status (or role=alert for errors) on the rendered banner. Documented variants: paper (default) and ink surfaces; tint and solid styles; informational, success, warning and error kinds.

class .msg

· ok

· warn

· err

componentToast component/toast2

Toast — from base.css. Documented states: ok, warn, err, auto-dismiss. A11y: #toasts is aria-live=polite; one toast at a time.

class .toast2

· ok

· warn

· err

· auto-dismiss

componentBadge component/badge

Badge — from base.css. Documented states: neutral, ok, warn, err, acc, solid. A11y: Uppercase micro-label; never the only signal — pair with text that says the same thing.

class .badge

· neutral

· ok

· warn

· err

· acc

· solid

componentEmpty state component/empty

Empty state — from base.css. Documented states: default. A11y: h4 + one-line reason + at most one action; never a bare blank area.

class .empty

· default

componentDialog (native) component/dlg

Dialog (native) — from base.css. Documented states: open (showModal), backdrop, wide variant. A11y: Native <dialog> + showModal(): top layer, inert background, Escape, focus restore — do not hand-roll a focus trap.

class .dlg

· open (showModal)

· backdrop

· wide variant

componentTooltip component/tip

Tooltip — from base.css. Documented states: hover, focus-visible. A11y: Decorative tips only; essential text must be in the DOM. Pair with aria-describedby for screen readers.

class .tip

· hover

· focus-visible

componentSpinner component/spinner

Spinner — from base.css. Documented states: spinning, reduced-motion (slowed). A11y: Indeterminate progress: keep the action label honest ('Queued…'), and slow to 1s under prefers-reduced-motion.

class .spinner

· spinning

· reduced-motion (slowed)

componentField error component/field-err

Field error — from base.css. Documented states: message, aria-invalid input. A11y: Focusable summary at the top + inline message per field, linked with aria-describedby; aria-invalid=true on the control (W3C ARIA21).

class .field-err

· message

· aria-invalid input

componentTabs component/tabs

Tabs — from base.css. Documented states: selected, hover, focus-visible, overflow-scroll. A11y: tablist/tab/tabpanel roles wired by components.js with roving tabindex and Arrow/Home/End.

class .tabs

· selected

· hover

· focus-visible

· overflow-scroll

componentBreadcrumbs component/crumbs

Breadcrumbs — from base.css. Documented states: default, current. A11y: nav[aria-label=Breadcrumb] wraps an ordered list; plain text + separators.

class .crumbs

· default

· current

componentRadio component/radio

Radio — from base.css. Documented states: checked, unchecked, focus-visible, disabled. A11y: Native input inside the label; group with fieldset/radiogroup and a shared name.

class .radio

· checked

· unchecked

· focus-visible

· disabled

componentSlider component/slider

Slider — from base.css. Documented states: default, focus-visible, disabled. A11y: aria-label on the range; the readout mirrors the value; keyboard steps come from the native input.

class .slider

· default

· focus-visible

· disabled

componentCombobox component/cb

Combobox — from base.css. Documented states: closed, open, filtered, selected, multi-chips. A11y: aria-activedescendant listbox: focus stays in the input; options are filtered in place.

class .cb

· closed

· open

· filtered

· selected

· multi-chips

componentDate picker component/dp

Date picker — from base.css. Documented states: open, today, selected, out-of-month, disabled-day, roving-focus (one tabbable cell). A11y: ISO value on the input; month/weekday names and full-date day labels via Intl (locale-aware).

class .dp

· open

· today

· selected

· out-of-month

· disabled-day

· roving-focus (one tabbable cell)

componentAccordion component/acc

Accordion — from base.css. Documented states: closed, open, focus-visible. A11y: Native details/summary — keyboard and find-in-page work for free; group with the details name attribute for exclusivity.

class .acc

· closed

· open

· focus-visible

componentAvatar component/avatar-sq

Avatar — from base.css. Documented states: initials, image, ink, group. A11y: Decorative avatars are aria-hidden; meaningful ones need alt/label. Groups carry an aria-label with the count.

class .avatar-sq

· initials

· image

· ink

· group

componentImage component/img

Image — from base.css. Documented states: 16:9, 4:3, 1:1, contain, caption. A11y: alt is mandatory (TDS014); the frame reserves space so loading never shifts layout.

class .img

· 16:9

· 4:3

· 1:1

· contain

· caption

componentUpload / dropzone component/drop

Upload / dropzone — from base.css. Documented states: idle, dragover, focus-visible, file-list. A11y: role=button + Enter/Space; announces files with name and size; removal is a labelled button.

class .drop

· idle

· dragover

· focus-visible

· file-list

componentNotifications component/notif

Notifications — from base.css. Documented states: unread, read, empty, mark-all. A11y: The summary's accessible name carries the unread count; unread uses background + a dot, never colour alone.

class .notif

· unread

· read

· empty

· mark-all

componentCommand palette component/cmd

Command palette — from base.css. Documented states: closed, open, filtered, active-item, empty. A11y: Native dialog; Arrow/Enter/Escape inside, cmd/ctrl+K opens; items are buttons with listbox roles.

class .cmd

· closed

· open

· filtered

· active-item

· empty

componentFull-page state component/page-state

Full-page state — from base.css. Documented states: 404, 500, 403, offline, maintenance. A11y: One h2 per page state; the code is secondary; actions are the only focusable elements.

class .page-state

· 404

· 500

· 403

· offline

· maintenance

componentNumbered pagination component/pager-num

Numbered pagination — from base.css. Documented states: first, middle, current, gap, disabled. A11y: aria-current marks the active page; range labels on prev/next; page-size select is labelled.

class .pager-num

· first

· middle

· current

· gap

· disabled

componentTimeline component/tl

Timeline — from base.css. Documented states: default, status-dots. A11y: Ordered list; dots are decorative (the text carries the meaning).

class .tl

· default

· status-dots

componentDiff component/diff

Diff — from base.css. Documented states: context, added, removed, empty. A11y: role=table with labelled columns; +/- expressed as background tints plus repeated line numbers.

class .diff

· context

· added

· removed

· empty

componentSheet dialog component/sheet-end

Sheet dialog — from base.css. Documented states: side, bottom. A11y: Same native-dialog contract as .dlg (top layer, Escape, focus restore); data-dlg-static still blocks backdrop close.

class .sheet-end

· side

· bottom

componentProvenance record component/prov

Provenance record — from base.css. Documented states: default, explanation folded/expanded (<details>). A11y: The eight required fields stay visible without expanding the transcript.

class .prov

· default

· explanation folded/expanded (<details>)

componentSelect (native) component/select

Select (native) — from base.css. Documented states: default, focus, disabled. A11y: Native single-select for small fixed option sets; the .select class is for explicit citation and is styled identically to the bare element.

class .select

· default

· focus

· disabled

patternDashboard pattern/dashboard

Status first, attention second: system strip, hero metrics, stacked feed, filings and activity.

patternDetail page pattern/viewer

Two-column detail: plain/HTML body and queue controls left, sticky metadata and audit right.

patternSettings pattern/settings

Task sections with a sticky side nav, scoped setting-row forms and per-card save bars.

patternFlow canvas pattern/flows

The rule/flow builder: nodes, connectors with insert points, smart condition rows and live summary.

patternDry-run report pattern/simulator

Dry-run report: draft controls, per-stage decision trail, proposed actions and a plain-English verdict.

patternStepper & folds pattern/learning

The learning loop: step rail, evidence folds, model cards and promotion prerequisites.

patternIndex & eval pattern/misc

Two small page patterns: the phone overflow index and blind-label review.

guidelineVerification levels (traceable conformance) guideline/verification-levels

Four levels of conformance — static (shipped), behavioural (partial), rendered and product (proposed) — with the traceability contract: every conformance claim cites its rule id, implementation location and evidence; a lint score is a gate, never evidence. Coverage is declared per component.

guidelineDesign philosophy (paper and ink) guideline/philosophy

Triage is a paper-and-ink interface language for tools that do real work on real data: one light paper (#fafafa), one ink layer, one accent, square geometry, and every machine action auditable. Depth is not faked with blur or gradient; only things that genuinely float cast shadows. Black ink is a material, not a theme; colour always means meaning, never decoration. Enforced by tokens and the spec, not just words.

guidelineBrand & theming guideline/brand

One source of truth: Triage themes from tokens/tokens.json (W3C DTCG) and the core stylesheets carry no :root, so a re-theme is one JSON edit plus a rebuild. Two token tiers (semantic aliases over the raw palette — products prefer the alias column). The mark is a 24x24 ink square with an accent chip on the leading edge; lockups, favicon and templates ship in brand/. Never theme by overriding components.

guidelinePlatform & themes guideline/platform

One token file, four platform modes: dark theme, Windows High Contrast (forced-colors), RTL and print - all handled from the token layer and logical properties, no second stylesheet, no per-component overrides. In the dark theme surfaces rise instead of casting shadows.

guidelineIconography guideline/icons

A transferable icon system - 174 glyphs, one spec. The registry is the Lucide set (ISC licence) normalised to the Triage drawing spec: 24x24 grid, fill:none, stroke:currentColor, stroke-width 1.7, round caps and joins. Ship it as a sprite (icons/sprite.svg), individual SVGs (icons/svg/*.svg), or a registry (icons/icons.json); original mail-triage names survive as aliases.

guidelineAccessibility (WCAG 2.2) guideline/accessibility

WCAG 2.2 scorecard against the source audit: focus visible, focus not obscured, non-text contrast, target size, contrast, animation, forced colours, resize and reflow pass; focus appearance partial. The ring is global - :focus-visible is never removed anywhere; inputs add a border and ring. Reduced motion is honoured.

guidelineVoice & copy guideline/voice

Sentence case for buttons, links and menu items (uppercase micro-labels are CSS). Verbs are Enable/Disable for entity state. Announce every mutation in past tense, naming the object. Three flash kinds only - ok, warn, err; info is retired. Name the object in destructive labels. Empty states: title + one-line reason + at most one action. One-way actions keep a native confirm().

guidelineLocalisation & i18n guideline/localisation

RTL is mechanics; i18n is content. The system ships the mechanics - logical properties (TDS013), auto-mirroring chips/drawers/tooltips and core/i18n.js for locale, messages and formats. Content rules: whole-message placeholders (never concatenate sentences), counts through plural(), store ISO and display via Intl, room for extra width (German ~35%), bidi hygiene with <bdi> for embedded identifiers.

componentCheckbox component/check

A real checkbox wrapped in label.check; forms post a hidden twin (value 0) so a missing key cannot silently mean off. Grouped checkboxes live in a fieldset with a legend.

class .check

componentStatus dot component/dot

A 7px square status dot; neutral by default, with ok / warn / err variants paired with text (never colour alone).

class .dot

componentKeycap component/kbd

A monospace keycap with a 2px base edge, for keyboard hints such as shortcuts.

class .kbd

componentStat tile component/stat

An ink panel carrying one number and its label - the dashboard hero metric.

class .stat

componentKey-value rows component/kv

A two-column metadata grid (label -> value) for detail panes and sidebars.

class .kv

componentProgress component/progress

A 6px progress bar with an inline variant (.progress-inline) for rows and tasks; pair with text so state never relies on the bar alone.

class .progress

componentSkeleton component/skeleton

An animated shimmer placeholder shown while content loads.

class .skeleton

componentLog panel component/logpanel

An ink terminal panel for logs and streamed output; rows colour by kind (green / amber / red / dim / time).

class .logpanel

componentAudit rows component/audit-row

Audit trail rows - the flat list of machine and human actions with time, actor and detail columns; the provenance surface for accountable actions.

class .audit-list

componentChat bubble component/bubble

A chat message turn (max-width 75%); user and model turns differ by surface, not by colour alone.

class .bubble

componentComposer component/composer

The message input card at the foot of a chat: input, send, and any attachments.

class .composer

componentProposal card component/proposal

The one visual contract for every AI action that needs review: proposal text, evidence and review actions.

class .proposal

componentOverflow menu component/menu-pop

The absolute popover anchored to a trigger; shadows mark it as floating.

class .menu-pop

componentScrim component/scrim

The fixed backdrop behind drawers, sheets and dialogs.

class .scrim

componentBottom navigation component/bottom-nav

The persistent phone tab bar, with view transitions between tabs.

class .bottom-nav

componentDock component/dock

The slim fixed side panel (46px) for persistent auxiliary tools; opens on demand.

class .dock

componentApp topbar component/topbar

The tablet and phone chrome header (menu, title, theme and density toggles, status); hidden on desktop where the sidebar carries the brand.

class .topbar

componentPage header component/page-head

The title row at the top of a page: title, description and actions.

class .page-head

componentSegmented control component/seg

The inline segmented selector for mutually exclusive views.

class .seg

componentArmed delete component/arm-del

The two-step, in-place destructive control: the first click arms, the second confirms. No dialog; native confirm() stays reserved for irreversible actions.

class .arm-del

componentApp shell component/shell

The page skeleton: sidebar, main column and content frame (.app / .side / .main), with the shell contract on /components/navigation.

class .app

guidelineArmed two-step delete guideline/armed-delete

Deleting an entity listed in the UI is a two-step, in-place action with auto-disarm; no confirm() dialogs for these.

guidelineHigh-stakes confirmations guideline/high-stakes-confirm

Irreversible, security-relevant, or multi-item actions keep a native confirm() whose sentence names the object and consequence.

guidelineColour is never the only signal guideline/colour-not-alone

Status and meaning are carried by text or icon as well as colour; charts must survive greyscale and colour-blindness.

guidelinePage hierarchy guideline/page-hierarchy

One element, one token and one job per level: page title → section heading → card heading → body → meta. Don't skip levels.

guidelineCopy helper owns the clipboard guideline/copy-helper

Use the shared cp() helper / .copy element; the helper owns fallback and confirmation labelling.

Rules

ruleTDS001 · deprecated-name error

Uses a pre-Triage (mail-triage era) class, id or global instead of the renamed vocabulary.

fix: Rename via /RENAME-MAP.md (or run: python3 tools/assemble_from_pack.py --apply-map <files>).

ruleTDS002 · raw-colour warning

A colour literal appears where a token exists (palette match = error) or that is not in the palette (off-system colour = warning).

fix: Use var(--token) (prefer semantic aliases: --surface-*, --text-*, --status-*) or add the colour to tokens.json.

ruleTDS003 · non-zero-radius error

A non-zero border-radius (CSS property or JS style key).

fix: Remove the radius, or fork the system deliberately by changing the token and deleting the global rule.

ruleTDS004 · focus-removed error

outline:none / outline:0 without a visible focus replacement in the same rule.

fix: Keep the global ring, or provide :focus-visible with a 2px+ ring or a compensating box-shadow/border change.

ruleTDS005 · off-scale-spacing warning

Margin/padding/gap/inset px values outside the normalised spacing scale.

fix: Snap to the nearest scale value or extend the scale in tokens.json deliberately.

ruleTDS006 · off-token-motion info

Transition/animation duration not in the motion token set.

fix: Use a motion duration token value (100/120/150/180/200/240/250/280/400ms).

ruleTDS007 · off-ladder-zindex info

z-index outside the documented ladder.

fix: Use a ladder value or extend misc.zindex in tokens.json.

ruleTDS008 · off-system-font error

font-family declaration not using Geist / Geist Mono (or inherit).

fix: Use the system stacks (or var(--mono)), or change the token in tokens.json for a deliberate rebrand.

ruleTDS009 · token-override error

A project stylesheet redefines a Triage custom property (--bg, --acc, --surface-* …).

fix: Edit tokens/tokens.json and regenerate, or use a distinct non-system variable name for local values.

ruleTDS010 · unknown-class info

A class used in markup that core.css / patterns.css do not define (opt-in, may be a project class).

fix: Use a system class, or allowlist the project class in .triagerc.json.

ruleTDS011 · contrast error

A defined token pair fails WCAG contrast (4.5:1 text / 3:1 non-text).

fix: Adjust the token value(s) so the pair meets the threshold, or extend .triagerc.json contrastPairs for intentional exceptions.

ruleTDS012 · primitive-use warning

A product stylesheet consumes a primitive token directly where a semantic alias exists.

fix: Use the alias (e.g. var(--surface-card) instead of var(--card)). Definitions inside tokens.css are exempt.

ruleTDS013 · physical-direction warning

Physical direction property (margin-left, left:, text-align:left …) instead of logical properties.

fix: Use margin-inline-start/end, padding-inline-*, border-inline-*, inset-inline-*, text-align:start/end.

ruleTDS014 · image-alt error

<img> without an alt attribute.

fix: Add alt with a description, or alt="" when the image is decorative.

ruleTDS015 · accessible-name error

Interactive element with no accessible name (empty button/link, no aria-label), or a positive tabindex.

fix: Add text or aria-label; never use tabindex > 0.

ruleTDS016 · label-tier info

Label-role class (.badge, .nav-label, .cmd-group) set below the comfortable label target (13px at the 16px root).

fix: Use the system token (--fs-badge / --fs-nav-label) or set the label role to 13px+ (0.8125rem+).

ruleINT001 · armed-two-step-delete error

Item deletes are armed and two-step: the control arms first (label names the object), the second activation deletes; Escape and outside click disarm.

fix: Use .arm-del with data-arm-label; disarm on Escape/outside click/details close.

ruleINT002 · one-way-confirm warning

One-way / high-stakes actions use confirm() naming the object; reversible mutations instead show their reverse ('Shown as deleted · Undo').

fix: confirm() for irreversible; a visible reverse action for reversible mutations.

ruleINT003 · three-channel-feedback warning

Feedback uses the three sanctioned channels only: banner (persistent page/section state), toast (transient confirmation), empty state (structural absence) — plus in-flight treatments for long actions.

fix: Map each message to banner / toast / empty state; use the in-flight pattern for queued work.

ruleINT004 · editor-save-bars warning

Editors and settings keep a sticky save bar with explicit unsaved-changes state; save bars apply per card in settings patterns.

fix: Add .savebar with its unsaved/dirty state; scope per card where sections save independently.

Prohibitions

prohibit/raw-colour

Raw colour literals (hex/rgb/hsl) outside the token layer — colour arrives only via tokens (lint TDS002).

signals: hex colour, raw hex, rgb(, hsl(, hard-coded colour

prohibit/focus-removal

Removing focus outlines without replacement — :focus-visible affordances are mandatory (lint TDS004).

signals: outline none, remove focus ring, focus removed

prohibit/token-override

Overriding token values downstream (the token layer is the only place values change; lint TDS009).

signals: override token, redefine variable, patch css variable

prohibit/token-fonts

Fonts outside the system stack — family tokens own typefaces (lint TDS008).

signals: custom font, webfont, google font, font import

prohibit/off-radius

Non-zero corner radius — the system is squarely squared; radius stays 0 (lint TDS003).

signals: rounded, rounded corners, rounded card, corner radius, border radius, border-radius, pill shape

prohibit/label-less-controls

Interactive controls without accessible names — icon-only means aria-label, never a bare glyph (lint TDS015).

signals: unlabeled, icon only, no aria label, mystery icon

Fallbacks

Behaviour without JavaScript

Every component degrades to its plain markup; the behaviour layer (components.js) is additive. Without JS, interactive widgets show their static forms (tabs stack, menus remain details/summary, file inputs remain native).

scope: javascript, no-js, degradation

Scoped embedding into a host page

Drop Triage into an existing product without restyling it: wrap the region in .triage and load core/scoped.css (rules live in @scope(.triage) under @layer triage.components). Font-faces and keyframes stay global. Without core/reset.css the host owns root sizing and typography.

scope: integration, scoped, adoption, host page

Reduced-motion handling

The system honours prefers-reduced-motion: spinners slow to the slow duration and reveal transitions collapse. Motion tokens stay the single source for durations either way.

scope: motion, accessibility, reduced motion

Native confirm() for one-way actions

Actions that are irreversible, security-relevant, or affect more than the clicked item keep a native confirm() whose sentence names the object and the consequence (INTERACTION.md, one-way set). Arming cannot carry the consequence; this is the sanctioned stop, and never a substitute for the armed pattern on ordinary entity deletes.

scope: danger, high stakes, confirm, one-way, irreversible

Recipes

Redirect feedback is a banner recipe/feedback-redirect

After a server round-trip / redirect, announce the outcome with a .msg banner at the top of the content.

· redirect flows only; in-place actions use the toast host

· kinds exactly ok|warn|err

· past tense and name the object

In-place feedback is a toast recipe/feedback-inplace

JS/fetch actions announce via toast() from the shared host; one toast at a time.

· host it once per page (toasts aria-live)

· no page-local toast markup, no query-param toasts

Entity delete is armed, two-step, in place recipe/entity-delete-armed

Deleting a listed entity (rule, flow, classifier, template, chat, record) is a two-step armed action; never a confirm() dialog.

· first activation arms, second deletes

· auto-disarm 4s / Escape / outside click

· announce the result afterwards

High-stakes actions keep a native confirm() recipe/high-stakes-confirm

Irreversible, security-relevant, or multi-item actions confirm with a sentence naming the object and consequence.

· native confirm() on the form; sentence names object + consequence

· the listed set plus reason-bearing reject/decline decisions

· when the rationale must be recorded, pair the confirm with a required, labelled textarea (native control); the reason surfaces in the history (component/tl)

Entity on/off is the switch, not a button recipe/entity-toggle

Every boolean enable/disable of an entity uses .px-sw; verbs are Enable/Disable; the route announces the new state.

· verbs Enable / Disable only (never Pause/Resume or On/Off)

· auto-submit announces

Status is never colour-only recipe/status-with-text

State of an item is shown with a compact label/cell plus text (or icon); colour alone is prohibited.

· pair colour with text or an icon

· one status treatment per row cell

Empty areas use the empty anatomy recipe/empty-with-cta

Any list or card with nothing to show gets title + one line of reason + at most one CTA.

· never a bare blank area or a bare 'failed'

· specific reason + one recovery action

Bulk actions live in the selection bar recipe/bulk-actions

Batch operations on selected rows appear in .bulkbar only with a selection; triggers in .tactions.

· appears only with a selection

· announce the count/result afterwards

Editors end in a save bar recipe/editor-savebar

Editors (forms that configure something) end in .savebar with primary Save plus Cancel; Cancel is the way out.

· Server-side validation renders at the top of the form and receives focus

· settings cards keep scoped partial saves

Row actions: inline + menu variants recipe/row-actions

Record actions appear on hover/focus with .ra-inline for the key few and a details.menu for the rest; touch shows the menu.

· sentence case; destructive item is menu-item danger arm-del

· every .rowacts ships both variants

Pages open with a page head recipe/page-head

Page title + one-line description + actions; hierarchy levels are not skipped.

· don't shrink a page title to fit a long subject; let it wrap

· section headings and card headings mark different scopes

Modal tasks use the native dialog recipe/dialog-task

Popups/modals are built on the native dialog element (.dlg), with static-backdrop when closing must be deliberate.

· autofocus the first meaningful control

· Esc/backdrop behavior deliberate

Long lists paginate with numbered pager recipe/paginated-list

Long result sets page with the numbered pager plus page-size control; phone view trims chrome.

·

Copy affordances use the shared helper recipe/copy-value

Copy-to-clipboard goes through cp()/.copy so fallback and labelling stay consistent.

· never call navigator.clipboard from page code

Filtering a list is a chip row over the table recipe/filter-row

Narrow a list with a row of chips above the table; chips are selection tokens, not status badges.

· chips mark selection, badges mark status — do not conflate

· active filters stay visible with a clear affordance

Assign one person to a small fixed set recipe/assign-picker

A labelled single-select (native select) beside one assign action; the outcome announces the new assignee by name.

· native select for small fixed sets; component/cb only when the set is large or needs filtering

· the control is always labelled and the submit announces the new value by name

· if the assign is handled in place (fetch), the outcome uses recipe/feedback-inplace instead of the redirect banner

· degrades without JS

Long-running background work shows determinate progress recipe/job-progress

Compose the progress bar with a state badge, a scanned/total readout and text for queued/running/stalled/failed/done; failures name the reason and offer retry; updates arrive by JSON polling.

· state is always text + colour (recipe/status-with-text)

· queued and done are labelled states too (same text+colour treatment; a completed bar is not left unlabelled)

· stalled is detected by the count not advancing and shown as a text label

· failed names the reason and offers a retry action

· aria-valuenow updates on the bar; state changes are announced via an aria-live region on the status line (or the shared toast host)

· poll JSON; no page reloads

Implement with this authority — agent prompt

A ready-to-send brief for coding agents building on this pack. Source: authorities/triage/AGENT-PROMPT.md

# Implementing with the Triage authority — a prompt for coding agents

You are building an interface with the **Triage design authority** (`packs/triage`,
v0.13.0-rc1) — the app-agnostic, paper-and-ink UI system with one token source, one
component runtime, and one enforceable lint gate. This prompt is for *consuming*
the authority in a product build. (Working *inside* the triage repository itself
is governed by its own `AGENTS.md`.)

Paste everything below into the agent's context before it writes UI.

---

## The brief

Build the requested screens using the Triage design authority at `packs/triage`.
Do not invent visual decisions the authority already records, and do not silently
skip ones it does not.

## How to work (the consumption protocol)

1. **Resolve before you design.** For every element you need, ask the authority
   first and follow its answer:

   ```
   python3 tools/da.py --pack packs/triage resolve "a primary button" --json
   python3 tools/da.py --pack packs/triage resolve "a settings page" --json
   ```

   Outcomes:
   - `RESOLVED` → build exactly what the cited record defines (states, class,
     a11y notes included).
   - `CONFLICT` (e.g. asking for rounded corners) → do **not** build it as asked;
     use the sanctioned alternative the answer names.
   - `FALLBACK` → build the documented fallback variant.
   - `UNDEFINED` → build in the system's character, then follow step 3.

2. **Load the system the sanctioned way** (global path):

   ```html
   <link rel="stylesheet" href="tokens/tokens.css">
   <link rel="stylesheet" href="core/base.css">
   <link rel="stylesheet" href="core/patterns.css">   <!-- if you use page patterns -->
   <script src="core/components.js" defer></script>
   ```

   Or the scoped path (`.triage` wrapper + `core/scoped.css` + `core/reset.css`)
   when embedding into a host page — see `guideline/consumption`.

3. **Mark what is not covered.** When the authority is silent (`UNDEFINED`),
   build the closest in-character thing, mark the spot in the DOM, and file a
   gap record. Never present improvisation as canon.

4. **Verify before you claim done.** Render the result and check it: the
   verifier inspects the artifact, not your summary. Run the pack's golden set
   and any project verification before reporting.

## House rules that must survive your build

- **Tokens only.** No raw hex/rgb/hsl, no off-scale spacing, no ad-hoc
  durations. Values change in `tokens/tokens.json` and nowhere else
  (TDS002 / TDS005 / TDS006 / TDS009).
- **Squarely squared.** Corner radius stays 0; any rounded request is a
  `CONFLICT` (TDS003 / `prohibit/off-radius`).
- **Focus always visible.** Never remove focus outlines; `:focus-visible`
  affordances are mandatory (TDS004).
- **System fonts only** (TDS008) and **every control has an accessible name** —
  icon-only means `aria-label` (TDS015, TDS014 for images).
- **Destructive actions are never one-click.** Armed two-step delete, or
  `confirm()` for one-way actions (INT001 / INT002).
- **Feedback uses the three sanctioned channels** — banner / toast / empty
  state — nothing ad hoc (INT003).
- **Editors keep a save bar** with explicit unsaved state (INT004).
- **Degrade without JS.** Every component must work as plain markup; the
  behaviour layer is additive (`fallback/no-js`).

## What good output looks like

- Components instantiated with their documented classes and states (check each
  `component/*` record for the exact `class`, `states`, `verify` selectors and
  `a11y` notes).
- Layouts composed from the sanctioned patterns (`pattern/dashboard`,
  `pattern/viewer`, `pattern/settings`, …) rather than invented shells.
- A short build note listing: every ask you resolved (with outcome), every
  improvisation you marked, every gap you filed.

## Quick reference (most-used records)

| Need | Resolves to |
|---|---|
| button / cta | `component/btn` |
| switch / toggle | `component/px-sw` |
| table | `component/tbl` |
| dialog / modal | `component/dlg` (native dialog) |
| toast / flash | `component/toast2` / `component/msg` |
| empty state | `component/empty` |
| date picker / combobox | `component/dp` / `component/cb` |
| command palette | `component/cmd` |
| dashboard / settings / detail page | `pattern/*` |
| colour / spacing / type tokens | `token-set/*` |

The full catalogue: `packs/triage/artifacts.json` (51 records), the enforceable
rules: `packs/triage/rules.json` (TDS001–TDS015 + INT001–INT004), the
conformance questions: `packs/triage/golden.json` (36 cases, all passing).