2.4 KiB
2.4 KiB
Two-Factor Setup Pattern
- Status:
completed - Owner:
codex - Date:
2026-03-25
Goal
Add a new Storybook pattern for a two-factor setup flow that captures the structure of the reference UI while staying inside Cadence UI's lighter Material-tonal design direction and reusing the existing component set instead of introducing a new public package component.
Scope
- In scope:
- add a new docs pattern under
apps/docs/src/patterns/ - compose the scene with existing components such as
Badge,Button,Card,Field,Input, andInputGroup - document why this belongs in
Patternsinstead ofComponents
- add a new docs pattern under
- Out of scope:
- adding a new public
packages/uiexport - introducing a dedicated OTP primitive or authentication package
- wiring real QR generation, API calls, or clipboard guarantees
- adding a new public
Constraints
- Keep the visual direction aligned with
DESIGN.md: tonal, light, rounded, and calm. - Avoid introducing a black, neon, or high-contrast security-console aesthetic.
- Reuse existing components wherever practical and keep one-off styling local to the story.
- Do not disturb unrelated in-flight work in the dirty worktree.
Affected Surfaces
apps/docs/src/patternsdocs/exec-plans
Plan
- Add the execution plan and confirm this slice should live in
Patterns. - Implement a new
Patterns/TwoFactorSetupstory that composes existing UI primitives into a modal-ready 2FA setup scene. - Add anatomy and accessibility-oriented review stories so placement and usage are explicit.
- Run focused docs validation and record the result.
Validation
pnpm build:docs
Orchestration Task Sketch
T1: add the docs-only two-factor setup pattern storyT2 -> T1: run focused docs validation and record outcomes
Status Log
2026-03-25 22:10started the slice after confirming the reference is better treated as a composed auth pattern than as a new base component or dialog variant2026-03-25 22:18addedPatterns/TwoFactorSetupas a docs-only pattern story built from existing components with a lighter tonal treatment instead of the reference's dark security-console styling2026-03-25 22:20validated the new story withpnpm build:docs2026-03-25 19:02migrated the scene's split layout and accessibility review layout onto the sharedRow/Colgrid primitives so the pattern no longer depends on local fixed desktop column math