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:
childrenis a string plus aniconprop; supports the nativetype. - TextInput: native
type; keeps the DOM-eventonChange(a form library may come later). - Stepper:
onStepSelect(index).
Designer answers to the review's product questions (2026-10-09):
| Question | Answer |
|---|---|
| Button loading state | No. |
| Button "wide" (162px min-width) | Not intended — drop it. |
| Modal size | Comes in different sizes: a size union, not a fixed 950×873. |
| Modal footer | More than one option; the exact set is undecided. |
| PageHeader | No actions — text only. |
| Panel | A 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 state | Yes, but the designer will design a new stepper. |
| Sidebar | Workspace/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.