UNPKG

@pagopa/mui-italia

Version:

[Material-UI](https://mui.com/core/) theme inspired by [Bootstrap Italia](https://italia.github.io/bootstrap-italia/).

43 lines (42 loc) 1.7 kB
/// <reference types="react" /> export type SingleFileInputProps = { /** The file to be displayed. */ value: File | null; /** The label of the input */ label?: string; /** Sets the error status. */ error?: boolean; /** The MIME types that the input should accept. */ accept?: Array<string>; /** Sets the loading status */ loading?: boolean; /** If enabled, sets the icon and the dropzone label alligned vertically. */ vertical?: boolean; /** Callback called when the file is selected. */ onFileSelected: (file: File) => void; /** Callback called when the file is removed. */ onFileRemoved?: (file: File) => void; /** Callback called when the file is rejected. */ onFileRejected?: (file: File) => void; /** The label to be displayed in the dropzone. */ dropzoneLabel: string; /** The label to be displayed for the upload button in the dropzone. */ dropzoneButton: string; /** The label to be displayed above the spinner on loading state. */ loadingLabel?: string; /** * The label to be displayed when the file is rejected. * * If the label is not provided, the rejected state (on rejected file) will not be displayed. * */ rejectedLabel?: string; }; export declare enum UploadStatus { IDLE = "IDLE", LOADING = "LOADING", REJECTED = "REJECTED", ERROR = "ERROR", SELECTED = "SELECTED" } export declare const SingleFileInput: ({ value, label, error, accept, loading, vertical, onFileSelected, onFileRemoved, onFileRejected, dropzoneLabel, dropzoneButton, loadingLabel, rejectedLabel, }: SingleFileInputProps) => JSX.Element; export default SingleFileInput;