2.2 KiB
2.2 KiB
Value Field Component
- Status:
in_progress - Owner:
codex - Date:
2026-03-25
Goal
Add a reusable ValueField base component for single-line, read-only value presentation so product
flows do not have to misuse Input for non-editable display values such as backup codes, reference
ids, tokens, or generated labels.
Scope
- In scope:
- add a new public
ValueFieldcomponent topackages/ui - support a minimal composable surface for value display plus optional prefix/suffix content
- integrate with
Fieldcontext for state and description wiring - document the component in Storybook
- cover key behavior with unit tests
- use the new component in the docs-only two-factor setup pattern
- add a new public
- Out of scope:
- multiline or rich-text display values
- formatted masking, async copy state, or built-in clipboard APIs
- replacing every read-only input in the repo
Constraints
- Keep the component token-first and aligned with the existing input/card/panel visual language.
- Do not create a second form-field system parallel to
Field. - Keep the public API small and composable.
- Prefer stable slot names and
data-*state exposure over one-off booleans.
Affected Surfaces
packages/ui/src/componentspackages/ui/src/index.tspackages/ui/src/lib/contracts.tsapps/docs/src/componentsapps/docs/src/patternsdocs/exec-plans
Plan
- Add the execution plan and confirm the API should be a small read-only display primitive rather than a typography helper.
- Implement
ValueFieldinpackages/uiwith stable slots for root/value/prefix/suffix and Field-context aware ids and state attributes. - Add Storybook stories and update the two-factor setup pattern to use
ValueFieldfor the manual backup code. - Add unit coverage and run targeted validation for component and docs surfaces.
Validation
pnpm build:docs- targeted component test run for
ValueField
Orchestration Task Sketch
T1: implement theValueFieldcomponent and exportsT2 -> T1: add docs stories, update the two-factor pattern, and validate
Status Log
2026-03-25 23:40started after confirming the repo exposes read-only input styling but no dedicated single-line value display component