import { OverrideProps } from '@mui/types'; import { ReactElement } from 'react'; import { FileWithPath } from 'react-dropzone'; import { BannerInlineProps } from '../BannerInline/BannerInline.types'; import { ListProps } from '../List'; import { SxProps } from '../styles'; import { CreateSlotsAndSlotProps, SlotCommonProps, SlotProps } from '../types/slot'; import { FileItemProps } from './FileItem/FileItem'; import { FileWithStatus } from './types'; export type FilePickerPanelSlot = 'root' | 'header' | 'list' | 'item'; export interface FilePickerPanelSlots { /** * 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 error alert. * @default BannerInline */ alert?: React.ElementType; /** * The component that renders the file list. * @default List */ list?: React.ElementType; /** * The component that renders each file item. * @default FileItem */ item?: React.ElementType; } export type FilePickerPanelSlotsAndSlotProps = CreateSlotsAndSlotProps; header: SlotProps<'div', object, FilePickerPanelOwnerState>; alert: SlotProps<'div', BannerInlineProps, FilePickerPanelOwnerState>; list: SlotProps<'ul', ListProps, FilePickerPanelOwnerState>; item: SlotProps<'div', FileItemProps, FilePickerPanelOwnerState>; }>; export interface FilePickerPanelTypeMap

{ props: P & FilePickerPanelSlotsAndSlotProps & { /** * Title of FilePickerPanel displayed above the list of uploaded files. * @default 'Uploaded Files' */ label?: string; /** * Accepted files that require uploading along with their upload status. * @default [] */ uploadingFiles?: ReadonlyArray; /** * Accepted files that selected from your local computer. This should be used when they do not require uploading. * @default [] */ acceptedFiles?: ReadonlyArray; /** * Array of error messages to display in the alert. * @default [] */ errors?: string[]; /** * Callback fired when the error alert close button is clicked. */ onClose?: () => void; /** * Callback fired when the delete button is clicked. */ onRemove?: (file: FileWithPath) => void; /** * Custom mapping of file extensions to icons * @default {} */ iconMapping?: { [extension: string]: ReactElement; }; /** * If `true`, the file list 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 FilePickerPanelProps = OverrideProps, D>; export interface FilePickerPanelOwnerState extends FilePickerPanelProps { }