@wix/design-system
Version:
@wix/design-system
39 lines (36 loc) • 1.28 kB
TypeScript
import * as React from 'react';
export interface FilePickerProps {
/** Applies a data-hook HTML attribute that can be used in tests. */
dataHook?: string;
/** Allows to insert overline text at the top left of a component. Can also be overridden with any other component, i.e. <Image/>. */
header?: string | React.ReactNode;
/** Defines a standard input onChange callback. */
onChange?: (file: File) => void;
/** Sets the main action label.
* @default 'Choose File'
*/
mainLabel?: string;
/** Adds a supportive message below the action title.
* @default 'No file chosen (Max size 5 MB)'
*/
subLabel?: string;
/** Defines which file types to accept (i.e. .jpeg, .gif, .png). Formats should be separated by a comma.
* @default '*'
*/
supportedFormats?: string;
/** Defines the maximum size of a file that can be uploaded.
* @default 5000000
*/
maxSize?: number;
/** Defines if an error should show or not. */
error?: boolean;
/** Sets an error message to display.
* @default ''
*/
errorMessage?: string;
/** Specifies a unique id for the element. */
id?: string | number;
/** Defines a name for inner input. */
name?: string;
}
export default class FilePicker extends React.PureComponent<FilePickerProps> {}