Knowledge

← All knowledge

0001 — Component contracts: props, scope and the open product questions

docs/decisions/0001-component-contracts.md

  • Status: accepted — not yet applied to the components
  • Date: 2026-10-08 (dev review), 2026-10-09 (designer answers)
  • Decided by: Kanut / Bam (dev review), Wunwan (designer answers)
  • Migrated from: Claude memory, platform-ui-v2-conventions

Context

The dev reviewed the component library on 2026-10-08. These are the contracts the component rebuild has to meet. They are decided but not built yet; the components in src/lib/components/ may still differ.

Decision

Library scope. src/lib/components holds basic, product-agnostic components only — they may be exported to other products. AppShell, SidebarNav and PageHeader are likely to move to src/components.

Props carry data and actions, never free-form ReactNode. Slots such as the Modal footer or the PageHeader call to action become discriminated unions. Prop types derive from the business resource, use strict unions, and take no style HTML props (the dev's props guideline).

  • Button: children is a string plus an icon prop; supports the native type.
  • TextInput: native type; keeps the DOM-event onChange (a form library may come later).
  • Stepper: onStepSelect(index).

Designer answers to the review's product questions (2026-10-09):

QuestionAnswer
Button loading stateNo.
Button "wide" (162px min-width)Not intended — drop it.
Modal sizeComes in different sizes: a size union, not a fixed 950×873.
Modal footerMore than one option; the exact set is undecided.
PageHeaderNo actions — text only.
PanelA titled, bordered section box ("Model and environment", "Command line"). It can itself be pressable: a whole panel can open a link or a dialog.
Stepper failed stateYes, but the designer will design a new stepper.
SidebarWorkspace/account switchers are display-only for now; nav items become real links.

Panel press (confirmed 2026-10-12). An optional press prop — { kind: "link"; href } | { kind: "dialog"; onOpen } — makes the whole panel clickable, only for panels with no inputs inside. The Command line's Copy stays a separate copyText prop.

Open

  • The Modal size set and footer options.
  • The Panel's remaining purpose and actions beyond press.