Design system
The design system is the shared visual and interaction foundation for the Temps console and related web surfaces. It joins the publishable @temps-sdk/ds operator library, the reusable @temps-sdk/ui web primitives, the standalone showcase app, and checks that keep visual rules, behavior, accessibility, and responsive layouts aligned. It sits below the console experience and supplies the shared surface used by the web console application.
Shared package boundary
The web UI foundation has two package roles. @temps-sdk/ds provides the operator language for console screens. @temps-sdk/ui provides the common OSS web controls through one reuse boundary. Together they prevent product surfaces from creating separate copies of the same controls.
Operator design language
@temps-sdk/ds gives console screens shared page shapes, status language, data views, forms, actions, charts, agent blocks, long-form content, and URL view state. Consumers use stable public module names and apply the scoped .tds theme to the subtree that opts in. Portalled content must receive the same theme because dialogs, toasts, and command palettes render outside the main root.
References: web/…/RULES.md• L5-13 web/…/design-system-handoff.md• L3-15 web/…/index.ts• L6-91
Shared web primitives
@temps-sdk/ui re-exports the shared web controls and helpers instead of maintaining a second component set. The layer covers page shells, data summaries, search and time filters, settings sections, tabs, charts, code blocks, copy actions, empty states, responsive navigation, forms, provider identity, and environment import. These primitives give product pages common content width, responsive behavior, accessible labels, and action patterns. Responsive navigation can keep a full sidebar, a compact desktop form, or a mobile sheet while preserving the same menu structure.
References: web/…/package.json• L1-13 web/…/index.ts• L1-53 web/…/globals.css• L1-4 web/…/PageContainer.tsx• L4-10 web/…/sidebar-components.tsx• L40-227
Shared interaction foundations
The controls keep repeated actions predictable across pages. Searchable selects support grouped options and fuzzy or exact search. Number fields preserve an empty editing state for the owning form to validate. Masked environment values remain protected until an explicit reveal, while confirmation dialogs keep irreversible actions behind a clear decision.
The foundation also makes dense content usable. A scroll container becomes keyboard reachable only when it really overflows. Tables and code blocks therefore remain out of the tab order when short but can be reached when wide. Combobox triggers open from ArrowUp or ArrowDown when closed, while non-combobox popover triggers keep their normal behavior. Comboboxes and icon-only controls expose names that include the visible value when needed. Mobile label checks, ARIA source checks, and contrast checks prevent a responsive or theme change from hiding meaning. Restricted write controls explain the missing administrator access instead of leaving users with an unexplained disabled button. Read failures distinguish unavailable data from an empty result and offer retry only when replay is safe.
The sidebar foundation coordinates desktop collapse, a compact icon mode, and mobile open state. It keeps the user's desktop preference across sessions, offers a keyboard toggle, and exposes labels or tooltips when navigation is reduced to icons.
References: web/…/searchable-select.tsx• L24-60 web/…/searchable-select.tsx• L95-180 web/…/number-input.tsx• L19-35 web/…/env-variables-display.tsx• L21-27 web/…/confirm-dialog.tsx• L18-23 web/…/confirm-delete-dialog.tsx• L21-67 web/…/admin-only-note.tsx• L6-35 web/…/read-failure.tsx• L15-21 web/…/masked-value.tsx• L14-36 web/…/accessible-name.ts• L12-99 web/…/scrollable-region.ts• L6-14 web/…/table.tsx• L9-30 web/…/popover.tsx• L9-64 web/…/sidebar-components.tsx• L40-169 web/…/sidebar-components.tsx• L279-304 web/…/sidebar-components.tsx• L567-623 web/…/responsive-label-names.test.ts• L8-19
Visual language
The visual foundation helps an operator see system state and decide what to do next. It uses a restrained paper-and-ink base, dense information layout, and status color only when color carries operational meaning.
Tokens and themes
Scoped semantic tokens style an opted-in root without taking control of the host application's theme. The token model and generated CSS cover surfaces, status, charts, typography, spacing, radius, and shadows for light and dark modes. The web theme applies the same meaning to focus, motion, code, and responsive shells.
Code blocks use matching light and dark syntax colors. They load only the language grammars they need, retain readable plain text while highlighting loads, and adjust dark comments when the source theme does not meet contrast needs.
References: web/…/RULES.md• L30-41 web/…/tokens.json• L1-3 web/…/tokens.css• L4-12 web/…/globals.css• L15-95 web/…/code-block-theme.ts• L4-27 web/…/code-block.tsx• L53-137
Status vocabulary
The public Status primitive is the shared meaning layer for pages, records, charts, and notifications. Its ok, warn, error, idle, and running tones pair a glyph with a word, so color is not the only signal. The vocabulary also lets a shell summarize the most urgent state without inventing a new signal for each page.
References: web/…/status.tsx• L15-28 web/…/status-shared.ts• L7-67 web/…/status-components.tsx• L63-74
Agent interaction language
The agent surface presents assisted work as an operator ledger rather than unscoped chat. Tool calls have a kind and a state. Generated content keeps its source call, proposed writes wait for an explicit decision, and denied or failed results remain visible. This lets the reader separate completed work from suggestions and pending actions.
References: web/…/agent-shared.ts• L28-39 web/…/agent-shared.ts• L108-187 web/…/agent-components.tsx• L408-465
Console composition
The component library turns operational data into a small set of recognizable page forms. A screen starts with the reader's task and the shape of its data, then uses the matching template.
Page templates
The core templates cover the main operator tasks:
| Template | Purpose |
|---|---|
Ledger | Browse many records with filtering, sorting, paging, and keyboard movement. |
Detail | Read one record with status, facts, events, and optional facets. |
Settings | Change configuration through sections and one save flow. |
Article | Read long-form content from top to bottom. |
DataTable is shared by full-page ledgers and embedded tables. It owns table structure and loading rows, while the caller owns empty, failed, and retry states. Detail can be standalone or embedded in a parent shell. Inspector keeps a selected detail view beside its list.
References: web/…/templates.ts• L4-26 web/…/data-table.tsx• L20-49 web/…/ledger.tsx• L27-37 web/…/detail.tsx• L13-83 web/…/inspector.tsx• L11-58
Operational data views
The primitives show status, numbers, dates, secrets, forms, copy actions, rankings, trends, uptime, activity, funnels, traces, errors, logs, stages, distributions, and geographic summaries. They favor compact comparison while keeping a readout or table view for readers who cannot use hover or a visual plot. PageState gives loading, empty, unconfigured, and failed resources a visible path forward.
References: web/…/index.ts• L21-91 web/…/viz-components.tsx• L53-215 web/…/viz-ink-components.tsx• L110-176 web/…/page-state.tsx• L11-29
Resource navigation
Resource details use a real identity-column link through RecordLink. The row stays independent so selection, expansion, copy, menus, edit, and delete actions retain their own behavior. Provider marks use only confirmed provider IDs and a neutral fallback for unknown or custom identities; a mark does not claim that a credential is valid.
References: web/…/RULES.md• L245-338 web/…/record-link.tsx• L7-19 web/…/credential-provider-mark.tsx• L8-59
Time and URL state
Time controls make dates, ranges, durations, and schedules readable before a form is saved. Charts share a data contract for series, thresholds, bands, markers, readouts, and table views. The URL stores filters, tabs, sort order, page, time range, selected row, scope, and rendering choices so reloads and copied links rebuild the same view.
References: web/…/datetime-shared.ts• L6-37 web/…/datetime-components.tsx• L324-471 web/…/time-chart-components.tsx• L201-388 web/…/url-state.ts• L111-320 design-system/…/state.spec.ts• L7-19
Showcase site
The standalone design-system app is the browsable reference for the shared system. It renders real operator primitives and composed console surfaces without a backend, authentication, or live console data.
Reference navigation
Documentation routes explain rules beside live examples. Product-like routes render complete console, landing, article, status, and agent surfaces without the documentation shell. The shell provides filtering, theme switching, guide navigation, and an on-page contents rail. The operator gallery collects reusable primitives and their states as a visual reference.
References: design-system/README.md• L28-54 design-system/…/App.tsx• L19-49 design-system/…/Layout.tsx• L169-303 design-system/…/Guide.tsx• L47-69 design-system/…/OpComponents.tsx• L96-110
Package sharing
The showcase aliases @temps-sdk/ds and its skin stylesheet to workspace source. This makes package changes visible without a package build and keeps the gallery aligned with the console package. The documentation shell has its own general UI copies, so shared web-control changes need a check of both shell routes and operator surfaces.
References: design-system/README.md• L56-69 design-system/vite.config.ts• L9-31 design-system/…/index.ts• L5-14
Validation foundation
Validation protects the design system at several levels. Type checks catch contract errors, token and record audits protect shared sources, focused checks protect behavior and accessibility, and browser tests check rendered behavior.
Static checks
The package lint flow checks types, tokens, and record structure. The shared web layer adds render and source checks for accessible names, valid ARIA placement, keyboard access to overflowing regions, contrast, mobile labels, code fallback, dialog layering, select reset behavior, number editing, provider identity, resource links, tabs, forms, and environment selection. These checks catch silent drift before a surface reaches browser review.
The newer checks also keep destructive actions behind a named confirmation, verify that combobox keyboard behavior is valid in both closed and open states, and protect labels that voice users can see. They verify that masked values expose an explicit show or hide state. They also cover popover opening keys, sort state and target size, tab shrinking and panel references, and the distinction between access denial and other read failures.
References: web/…/package.json• L19-24 design-system/…/audit-records.mjs• L141-189 web/…/tokens.mjs• L140-179 web/…/a11y-source-scan.test.ts• L80-411 web/…/combobox-axe.test.tsx• L14-64 web/…/confirm-delete-guard.test.ts• L6-19 web/…/confirm-delete-dialog.test.tsx• L33-195 web/…/icon-button-names.test.ts• L8-172 web/…/label-in-name.test.ts• L8-42 web/…/masked-value.test.tsx• L12-24 web/…/popover.test.tsx• L27-59 web/…/sortable-table-head.test.tsx• L28-61 web/…/tabs.test.tsx• L12-25 web/…/accessible-name.test.tsx• L46-77 web/…/confirm-dialog.test.tsx• L21-60 web/…/scrollable-region.test.tsx• L32-98 web/…/select.test.tsx• L30-126 web/…/code-block.test.tsx• L14-71
Browser validation
The Playwright suite checks accessibility in both themes, keyboard focus and commands, narrow-screen overflow, interactive drop behavior, URL state after reload, and visual baselines. Coverage separates isolated blocks from composed records, so a primitive change and a template change can be reviewed at the right level.
References: design-system/…/a11y.spec.ts• L8-23 design-system/…/keyboard.spec.ts• L7-14 design-system/…/state.spec.ts• L7-19 design-system/…/visual.spec.ts• L7-25 design-system/…/visual.spec.ts• L111-185
Change checklist
When these files or sections are changed, remember to consider these:
- Keep every new operator capability reachable through its stable public barrel, gallery, visual block contract, and changelog.
- Keep tokens.json, generated token CSS, and web/…/globals.css aligned in names, values, modes, and order. Keep
.tdsout of:root. - Apply the package theme to every new portalled surface and check both the package consumer and showcase shell.
- Keep view controls in the URL state contract, including row links and copied links.
- Choose
Ledgeror embeddedDataTabledeliberately. Keep empty, failed, and retry behavior with the owning request. - Use
RecordLinkfor confirmed detail routes and keep row actions independent. - Preserve tab panel semantics, keyboard navigation, known zero counts, and narrow-screen scrolling.
- Keep provider IDs, local asset provenance, labels, fallbacks, and render checks in one contract.
- Give each data figure an equivalent readout and table meaning. Keep agent states, approval outcomes, provenance, and generated blocks consistent.
- Add new code languages to the language map and lazy grammar set. Preserve the plain-text fallback and theme parity with documentation.
- Keep
undefinedas untouched environment selection and[]as an intentional empty choice. Preserve entered import data and disabled reasons for retry. - Keep settings deep-link IDs and invalid-field reveal behavior stable.
- Name icon-only controls and comboboxes. Make scroll containers focusable only when they overflow, with ARIA labels on valid roles.
- Preserve destructive-dialog layer order, resource names, typed-name confirmation, and the distinction between an empty number draft and a real number.
- Keep access-denied read states distinct from empty states, and do not let retry controls submit an enclosing form.
- Preserve
aria-controlsonly when a tab panel exists. Keep tab roots shrinkable so narrow screens can scroll the tab strip. - Keep sort controls aligned with
aria-sort, the next action name, and a full-cell click target. - Keep sidebar desktop preference, mobile open state, compact-mode labels, and tooltip visibility aligned when navigation behavior changes.
- Keep closed combobox ArrowUp and ArrowDown behavior in the shared popover trigger so all picker consumers receive the same keyboard contract.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A consumer omits the scoped package theme or a portalled surface omits it. | Components or overlays render outside the shared skin. | Apply the package scope to the owning subtree and portalled content; follow web/…/RULES.md• L5-13. |
| A public capability is exported only from an internal split module. | Consumers cannot reach the complete supported contract. | Re-export the capability through its barrel and web/…/index.ts• L4-91. |
| A table uses row-click navigation instead of an identity link. | Browser link behavior and row actions compete. | Use RecordLink in the identity column. |
| View state stays only in local state. | Reloads and copied links reopen a different view. | Use typed URL helpers and the reload checks in design-system/…/state.spec.ts• L61-89. |
| Token data and generated CSS drift. | Light and dark skins show different semantic values. | Run the token comparison against package and application styles. |
| A new gallery block is absent from the visual block list. | Visual coverage can disappear without a failing snapshot. | Keep the BLOCKS list and DOM equality assertion in design-system/…/visual.spec.ts• L80-119. |
| A figure has no table or keyboard readout. | Readers cannot inspect values without hover or a plot. | Use the shared figure and chart readout contracts. |
| An icon control, combobox, or mobile action has no accessible name. | Assistive technology and voice input cannot identify the control. | Use accessible-name helpers and source/render checks. |
| A scrolling region never becomes focusable when content overflows. | Keyboard users cannot inspect wide content. | Use useScrollableRegion and its overflow tests. |
| A code grammar fails or dark comments remain low contrast. | Code becomes blank or fails contrast review. | Retain plain text and apply the readable dark-comment theme. |
| A confirmation opened from a sheet has a lower layer than the sheet. | The decision cannot receive the user's click. | Keep the confirmation portal above the opener and retain its layering test. |
| A destructive call bypasses the shared confirmation or does not name its target. | Users can remove a resource without a clear final decision. | Route the action through ConfirmDeleteDialog and keep its guard and focused tests passing. |
| An empty number draft is coerced to zero or a default. | Backspacing and retyping produce the wrong value. | Preserve undefined and let the owning form validate empty input. |
| A select emits an empty transient reset value. | Controlled form state is cleared and the trigger becomes blank. | Ignore empty transient values in web/…/select.tsx• L17-27. |
| A masked value uses a generic or missing toggle name. | Users cannot tell whether the secret is hidden or exposed. | Keep the show or hide name paired with aria-pressed. |
| A combobox popover ignores ArrowUp or ArrowDown while closed. | Keyboard users cannot open the picker through the expected pattern. | Keep the shared popover trigger behavior and its axe and key tests. |
| A sidebar changes its desktop and mobile state as one mode. | A compact desktop choice or mobile navigation state is lost or applied in the wrong viewport. | Keep desktop minimal state, mobile open state, and the shared sidebar context separate. |
| A tab trigger points to a panel that is not rendered. | Accessibility tooling reports an invalid ARIA reference. | Remove aria-controls when no matching panel exists. |
| A tab root cannot shrink inside a flex row. | The tab strip runs outside the viewport instead of scrolling. | Keep the root shrinkable and the strip horizontally scrollable. |
| A sort header reports stale direction or has only a small click target. | Users receive the wrong action or miss the table control. | Keep aria-sort, next-direction naming, and full-cell button sizing together. |
Key files
| File | Why to read it |
|---|---|
| web/…/RULES.md | Binding page, state, color, navigation, tab, and provider rules. |
| web/…/index.ts | Public capability map for the operator design system. |
| web/…/tokens.json | Semantic token model for light and dark operator surfaces. |
| web/…/templates.ts | Public page-template entry point. |
| web/…/status.tsx | Shared status vocabulary. |
| web/…/url-state.ts | URL contract for rebuildable views. |
| web/…/index.ts | Re-export surface for shared OSS controls. |
| web/…/globals.css | Shared web theme, status, chart, motion, and code colors. |
| web/…/accessible-name.ts | Accessible names for icon controls and value fields. |
| web/…/a11y-source-scan.test.ts | Repository-wide source checks for ARIA, keyboard reachability, and contrast patterns. |
| web/…/code-block.tsx | Code display, lazy highlighting, copy, and overflow behavior. |
| web/…/confirm-delete-dialog.tsx | Named confirmation flow for irreversible actions. |
| web/…/confirm-delete-guard.test.ts | Guard that keeps destructive calls behind the shared confirmation. |
| web/…/admin-only-note.tsx | Explanation pattern for role-restricted write controls. |
| web/…/masked-value.tsx | Explicit reveal and hide behavior for sensitive values. |
| web/…/number-input.tsx | Empty-editing behavior for numeric settings. |
| web/…/popover.tsx | Shared combobox keyboard opening behavior and layered content. |
| web/…/sidebar-components.tsx | Responsive sidebar state, collapse modes, navigation labels, and tooltips. |
| web/…/read-failure.tsx | Distinction between denied, failed, cached, and retryable reads. |
| web/…/scrollable-region.ts | Conditional keyboard access for overflow. |
| web/…/searchable-select.tsx | Grouped search and combobox naming. |
| web/…/select.tsx | Select reset protection and fallback naming. |
| web/…/sortable-table-head.tsx | Accessible sort state and full-cell table header actions. |
| web/…/table.tsx | Table structure and keyboard access to wide tables. |
| web/…/tabs.tsx | Shared tabs, counts, panel semantics, and narrow-screen scrolling. |
| design-system/README.md | Showcase purpose, routes, and test scope. |
| design-system/…/App.tsx | Showcase route map. |
| design-system/…/Layout.tsx | Documentation shell and navigation. |
| design-system/…/OpComponents.tsx | Live component gallery. |
| design-system/…/visual.spec.ts | Visual coverage contract. |
| design-system/…/state.spec.ts | URL reload and deep-link contract. |
| design-system/…/a11y.spec.ts | Accessibility coverage across themes. |