import React from "react"; import { type MarginProps } from "styled-system"; import { type ValidationProps } from "../../__internal__/validations"; import { type TagProps } from "../../__internal__/utils/helpers/tags"; import { type FileUploadStatusProps } from "./__internal__/file-upload-status"; export interface FileInputProps extends Pick, "id" | "name">, TagProps, MarginProps { /** * File type(s) used by the native file picker through the HTML input's * `accept` attribute. Consumers must validate dropped files. */ accept?: string; /** * Text displayed on the Select file button, which opens the native file * picker. Defaults to the localized "Select file", or "Select files" when * `multiple` is `true`. The default drag-and-drop instruction reuses this * text. */ buttonText?: string; /** * Indicates an error. A string is displayed as a validation message above the * drop zone; `true` shows the error border without a message. Either marks * the Select file button as invalid. */ error?: ValidationProps["error"]; /** * Supporting text displayed in the drop zone. Defaults to the localized * instruction to drag and drop files. */ dragAndDropText?: string; /** * Help content displayed beneath the label and announced with the Select * file button. */ inputHint?: React.ReactNode; /** * Controls the drop-zone layout. Defaults to `true`, which stacks its * contents vertically; set to `false` for a horizontal layout. */ isVertical?: boolean; /** * Visible label for the field. It also forms the Select file button's * accessible name. */ label?: string; /** * Maximum height of the drop zone, as a valid CSS value. In single-file mode, * it also applies to the status card that replaces the drop zone. In * multiple-file mode, status cards size to their content. */ maxHeight?: string; /** * Maximum width of the drop zone and status cards, as a valid CSS value. * When omitted, the component fills the available width of its container. */ maxWidth?: string; /** * Minimum height of the drop zone, as a valid CSS value. In single-file mode, * it also applies to the status card that replaces the drop zone. In * multiple-file mode, status cards size to their content. */ minHeight?: string; /** * Minimum width of the drop zone and status cards, as a valid CSS value, * capped at the width of the container. When omitted, the component may * shrink to fit its container. */ minWidth?: string; /** * Controls whether multiple files can be selected. Defaults to `false`, * which hides the drop zone while a status card is present; set to `true` * to keep the drop zone available alongside status cards. */ multiple?: boolean; /** Disables file selection and dropping files onto the drop zone. */ disabled?: boolean; /** Called when files are selected or dropped, with all received files. */ onChange: (files: FileList) => void; /** * Status card data for files that are uploading, completed, previously * uploaded, or in error. Each item renders a card showing the filename, its * state, and its actions. In single-file mode, a status card replaces the * drop zone; in multiple-file mode, status cards are displayed alongside it. */ uploadStatus?: FileUploadStatusProps | FileUploadStatusProps[]; /** * Marks the field as required with a visual indicator and an accessible * description on the Select file button. The hidden native input is not * marked `required`, so browser validation never blocks form submission; * validate on submit and supply `error` instead. */ required?: boolean; /** * @deprecated No replacement: validation is shown above the drop zone by * default, so omit this prop. `false`, which renders validation below the * drop zone, is retained for existing consumers and will be removed in a * future major release. */ validationMessagePositionTop?: boolean; } export declare const FileInput: React.ForwardRefExoticComponent>; export default FileInput;