Target Location: app/onboarding/kyc/page.tsx
Component: KycDocumentUpload.tsx
interface KycDocumentUploadProps {
/** Optional callback when all required documents are uploaded and verified */
onAllVerified?: () => void;
}type DocumentSlot = {
id: string; // e.g., "government-id"
name: string; // Display name
required: boolean;
file?: File; // Currently selected file
status: 'not-started' | 'uploaded' | 'in-review' | 'verified' | 'rejected';
rejectionReason?: string;
};Refer to the design token statusChip defined in docs/ux/design-tokens.md. Example usage:
<StatusChip status={doc.status} icon="heroicons:document-upload" />- Upload – User selects a file → widget validates format/size → status becomes
uploaded. - Submit for Review – Automatically triggers backend KYC verification (not in scope).
- In Review – Chip shows “In review” with subtle spinner.
- Verified – Chip changes to green with check‑circle icon.
- Rejected – Chip turns red, shows reason, and displays “Update Document” button to replace the file.
- Wrap each document row in a
<section aria-labelledby="doc‑{id}-label">. - Use an ARIA live region (
role="status" aria-live="polite") inside the status chip component. - Ensure the Update Document button is focusable and announces its purpose via
aria-label.
- Follow glass‑morphism for the drag‑and‑drop container (see
docs/ux/visual-direction.md). - Use the status‑chip color palette from
docs/ux/design-tokens.md(primary, success, warning, error). - Include subtle motion‑fade transitions (150 ms) on status changes.
- Unit tests for component state transitions using React Testing Library.
- Visual regression tests at 375 px and 1280 px.
- Accessibility audit using axe‑core (expect no violations on keyboard navigation, ARIA labels, and color contrast).
Prepared for branch uiux/kyc-document-upload-spec.