/** File extensions FileUpload accepts via `acceptTypes`; each must have a mapping in `mimeMap`. */ export type MimeExtension = '.jpg' | '.jpeg' | '.png' | '.gif' | '.webp' | '.svg' | '.pdf' | '.doc' | '.docx' | '.xls' | '.xlsx' | '.ppt' | '.pptx' | '.txt' | '.csv' | '.mp4' | '.mov' | '.mp3' | '.wav' | '.zip' | '.rar' | '.7z'; /** Extension-to-MIME-type lookup consumed by react-dropzone's `accept` option; see `mimeMap` in constants.ts. */ export type MimeMap = Record; /** Props for FileUpload, a controlled drop zone; the caller owns `uploadedFiles` state. */ export type FileUploaderProps = { /** Receives only the newly accepted files, not the full list; append them to `uploadedFiles` yourself. */ onFilesUploaded: (files: File[]) => void; /** Files listed below the drop zone; also counted against `maxFiles`. */ uploadedFiles: File[]; /** Shows a remove button per file when set; the caller must drop it from `uploadedFiles`. */ onRemoveFile?: (file: File) => void; /** Allowed extensions; defaults to `[".jpg", ".png"]`. Rejected files get an inline message. */ acceptTypes?: MimeExtension[]; /** Max size per file in KB (not MB); defaults to 5120 (5 MB). */ maxSizeKB?: number; /** Cap on total files including already-uploaded ones; a drop that exceeds it is rejected whole. */ maxFiles?: number; /** `sm` is a compact single-row drop zone; defaults to `md`. */ size?: 'sm' | 'md'; /** Upload percent (0-100) keyed by `file.name`; a bar shows only for listed keys. */ progress?: Record; /** Names the drop zone when there is no `label`; its visible text is appended, so the name always holds it. */ inputAriaLabel?: string; /** Id for the file input; auto-generated when omitted. */ id?: string; /** Visible label above the drop zone; also names it for screen readers, ahead of the zone's own text. */ label?: string; /** Shows the required asterisk on `label`. */ isRequired?: boolean; /** Blocks click, drop and keyboard activation, and greys the drop zone. */ isDisabled?: boolean; /** Paints the drop zone's border in the error colour and shows `errorMessage`. */ error?: boolean; /** Shown under the drop zone while `error` is true. */ errorMessage?: string; /** Shown under the drop zone when there is no error. */ helperText?: string; };