@trellixio/roaster-coffee
Version:
Beans' product component library
41 lines • 1.85 kB
TypeScript
import * as React from 'react';
export interface FileFieldProps {
/** The HTML ID attribute to be applied to the file upload field input element (optional). */
id?: string;
/** The name attribute to be applied to the file upload field input element (optional). */
name?: string;
/**
* The accept attribute to be applied to the file upload field input element (optional).
* Specifies the types of accepted files.
*/
accept?: string;
/**
* The size of the file upload field (optional).
* - 'small': render a smaller file upload field
* - 'medium': render a larger file upload field
*/
size?: 'small' | 'medium';
/** Whether the file upload field should be disabled (optional). */
disabled?: boolean;
/** The default value of the file upload field input (used to display a preview image when type is image). */
defaultValue?: string | null;
/**
* A function to be called when the value of the file upload field changes (optional).
* The function receives the new file value of the input as a `File` object, or `null` if no file is selected.
*/
onChange?(value: File | null): void;
/** The label to be displayed above the file upload field (optional). */
label?: React.ReactNode;
/**
* The type of file to be uploaded (optional).
* - 'image': upload an image file
* - 'file': upload any file type
*/
type?: 'image' | 'file';
/** Help text to be displayed below the file upload field (optional). */
helpText?: React.ReactNode;
/** CSS class names to be applied to the file upload field input element (optional). */
inputClassName?: string;
}
export declare const FileField: React.ForwardRefExoticComponent<FileFieldProps & React.RefAttributes<HTMLInputElement>>;
//# sourceMappingURL=FileField.d.ts.map