UNPKG

@mskcc/carbon-react

Version:

Carbon react components for the MSKCC DSM

137 lines (136 loc) 4.48 kB
/** * MSKCC DSM 2021, 2023 */ /// <reference types="react" /> import PropTypes from 'prop-types'; import { ReactAttr } from '../../types/common'; export interface FileUploaderDropContainerProps extends Omit<ReactAttr<HTMLButtonElement>, 'tabIndex'> { /** * Specify the types of files that this input should be able to receive */ accept?: string[]; /** * Provide a custom className to be applied to the container node */ className?: string; /** * Specify whether file input is disabled */ disabled?: boolean; /** * Provide a unique id for the underlying `<input>` node */ id?: string; /** * Provide the label text to be read by screen readers when interacting with * this control */ labelText: string; /** * Specify if the component should accept multiple files to upload */ multiple?: boolean; /** * Provide a name for the underlying `<input>` node */ name?: string; /** * Event handler that is called after files are added to the uploader * The event handler signature looks like `onAddFiles(evt, { addedFiles })` */ onAddFiles?: () => void; /** * Provide an optional function to be called when the button element * is clicked */ onClick?: () => void; /** * Provide a custom regex pattern for the acceptedTypes */ pattern?: string; /** * @deprecated The `role` prop for `FileUploaderButton` has been deprecated since it now renders a button element by default, and has an implicit role of button. */ role?: string; /** * @deprecated The `tabIndex` prop for `FileUploaderButton` has been deprecated since it now renders a button element by default. */ tabIndex?: number | string; } declare function FileUploaderDropContainer({ accept, className, id, disabled, labelText, multiple, name, onAddFiles, onClick, pattern, innerRef, ...rest }: { [x: string]: any; accept: any; className: any; id: any; disabled: any; labelText: any; multiple: any; name: any; onAddFiles: any; onClick: any; pattern: any; innerRef: any; }): JSX.Element; declare namespace FileUploaderDropContainer { var propTypes: { /** * Specify the types of files that this input should be able to receive */ accept: PropTypes.Requireable<(string | null | undefined)[]>; /** * Provide a custom className to be applied to the container node */ className: PropTypes.Requireable<string>; /** * Specify whether file input is disabled */ disabled: PropTypes.Requireable<boolean>; /** * Provide a unique id for the underlying `<input>` node */ id: PropTypes.Requireable<string>; /** * Provide the label text to be read by screen readers when interacting with * this control */ labelText: PropTypes.Validator<string>; /** * Specify if the component should accept multiple files to upload */ multiple: PropTypes.Requireable<boolean>; /** * Provide a name for the underlying `<input>` node */ name: PropTypes.Requireable<string>; /** * Event handler that is called after files are added to the uploader * The event handler signature looks like `onAddFiles(evt, { addedFiles })` */ onAddFiles: PropTypes.Requireable<(...args: any[]) => any>; /** * Provide an optional function to be called when the button element * is clicked */ onClick: PropTypes.Requireable<(...args: any[]) => any>; /** * Provide a custom regex pattern for the acceptedTypes */ pattern: PropTypes.Requireable<string>; /** * Provide an accessibility role for the `<FileUploaderButton>` */ role: (props: any, propName: any, componentName: any, ...rest: any[]) => any; /** * Provide a custom tabIndex value for the `<FileUploaderButton>` */ tabIndex: (props: any, propName: any, componentName: any, ...rest: any[]) => any; }; var defaultProps: { labelText: string; multiple: boolean; onAddFiles: () => void; accept: never[]; pattern: string; }; } export default FileUploaderDropContainer;