/** * @license * Copyright 2026 Aglyn LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { type SxProps, type Theme } from '@mui/material'; import { type ReactNode } from 'react'; /** * A place to drop files, which is also the button that opens the file * chooser (AGL-3656). Keyboard and screen reader reachable as one button; * the drag states are drawn from theme tokens, so it follows light and dark. * * It hands back the files and nothing else: what is accepted, how each one * is checked and where it goes are the caller's, which is what lets a font * installer, an importer and a media library share it. */ export interface FileDropZoneProps { /** Called with the files dropped or chosen, in order. */ onFiles: (files: File[]) => void; /** The file input's `accept`; dropped files are filtered by it too. */ accept?: string; multiple?: boolean; disabled?: boolean; /** The headline, e.g. "Drop font files here". */ label: ReactNode; /** One line under it, e.g. the formats and the size limit. */ hint?: ReactNode; /** An mdi path for the icon above the label; `null` draws none. */ icon?: string | null; /** The button's name, when the label is a picture rather than words. */ ariaLabel?: string; /** Called with the files `accept` refused, so the caller can say why. */ onRejected?: (files: File[]) => void; sx?: SxProps; } /** Whether a file matches an `accept` list of types, wildcards and extensions. */ export declare function fileMatchesAccept(file: Pick, accept: string | undefined): boolean; export declare function FileDropZone(props: FileDropZoneProps): import("react").JSX.Element; export default FileDropZone;