UNPKG

@rws-aoa/react-library

Version:

RWS AOA Design System

35 lines 1.7 kB
import { PropsWithChildren } from 'react'; import { AoaButtonProps } from '../../atoms/button/Button'; export interface AoaUploadButtonProps<TData> extends Omit<AoaButtonProps, 'disabled' | 'startIcon' | 'type'> { /** * The files that should be checked, required if {@link AoaUploadButtonProps.noFilesAllowed} is `false` */ readonly files?: TData[]; /** * Whether the button should be disabled */ readonly isDisabled?: boolean; /** * Whether the button should never be disabled. * - If `true` the button never goes into a `disabled` state, regardless of other conditions * - If `false` the button will be disabled if there are no files provided * (through {@link AoaUploadButtonProps.files | `files`}), or the upload progress is running */ readonly isNeverDisabled?: boolean; /** * Whether the upload process is running. This controls whether a spinner is shown and the button is disabled */ readonly isUploading: boolean; /** * The action to change {@link AoaUploadButtonProps.isUploading | `isUploading`} to `true` * * @param newState - The new state of the `isUploading` flag */ setIsUploading(this: void, newState: boolean): void; /** * The type of the button. This _cannot_ be a `text` style button like the base {@link AoaButton} */ readonly type?: 'primary' | 'secondary'; } export declare function AoaUploadButton<TData>({ isUploading, isDisabled, children, sx, isNeverDisabled, type, files, setIsUploading, onClick, ...props }: PropsWithChildren<AoaUploadButtonProps<TData>>): import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=UploadButton.d.ts.map