Goal
Make the shared Input and Select labels programmatically associated with their controls.
Acceptance criteria
- Generate a stable ID with
useId when neither an explicit ID nor suitable name is provided.
- Each
label.htmlFor matches its control ID.
- Explicit IDs and existing name behavior remain supported.
- Adjacent controls receive unique IDs.
- Add focused render tests for both components.
Files
src/components/ui/Input.tsx
src/components/ui/Select.tsx
- New
src/components/ui/FormControls.test.tsx
Verification
npm test -- src/components/ui/FormControls.test.tsx
npm run typecheck
Goal
Make the shared
InputandSelectlabels programmatically associated with their controls.Acceptance criteria
useIdwhen neither an explicit ID nor suitable name is provided.label.htmlFormatches its control ID.Files
src/components/ui/Input.tsxsrc/components/ui/Select.tsxsrc/components/ui/FormControls.test.tsxVerification
npm test -- src/components/ui/FormControls.test.tsxnpm run typecheck