import { OverrideProps } from '@mui/types'; import { ReactNode } from 'react'; import { DropzoneOptions, DropzoneState } from 'react-dropzone'; import { SxProps } from '../styles'; import { CreateSlotsAndSlotProps, SlotCommonProps, SlotProps } from '../types/slot'; export type FilePickerBlockSlot = 'root' | 'header' | 'dropzone' | 'description'; export interface FilePickerBlockSlots { /** * The component that renders the root. * @default 'div' */ root?: React.ElementType; /** * The component that renders the dropzone header. * @default 'div' */ header?: React.ElementType; /** * The component that renders the drop zone. * @default 'div' */ dropzone?: React.ElementType; /** * The component that renders the dropzone description. * @default 'div' */ description?: React.ElementType; } export type FilePickerBlockSlotsAndSlotProps = CreateSlotsAndSlotProps; header: SlotProps<'div', object, FilePickerBlockOwnerState>; dropzone: SlotProps<'div', object, FilePickerBlockOwnerState>; description: SlotProps<'div', object, FilePickerBlockOwnerState>; }>; export interface FilePickerBlockTypeMap

{ props: P & FilePickerBlockSlotsAndSlotProps & { /** * The object containing react-dropzone state and options. */ dropzoneApi?: DropzoneState & DropzoneOptions; /** * The header of the component. */ header?: ReactNode; /** * The label of the button to open the file dialog. * @default "Browse files" */ buttonLabel?: ReactNode; /** * The instruction of the drop zone. * @default "or drag and drop" */ dropzoneInstruction?: ReactNode; /** * The description text below the drop zone. */ description?: ReactNode; /** * If `true`, the dropzone is disabled. * @default false */ disabled?: boolean; /** * The system prop that allows defining system overrides as well as additional CSS styles. */ sx?: SxProps; }; defaultComponent: D; } export type FilePickerBlockProps = OverrideProps, D>; export interface FilePickerBlockOwnerState extends FilePickerBlockProps { isDragActive?: boolean; }