import "./files_editor.css"; import type * as React from "react"; import { type ReactNode } from "react"; import { useRender } from "@base-ui/react/use-render"; import { type FileUpload } from "./thumbnail_grid"; import type { GalleryLabels } from "./file_preview"; import { type DisplayFile } from "./file_thumbnail"; import { type StyleProps } from "./style_props"; /** The words the shipped bar pieces say, resolving **prop → `LoticsLocale`**. A * HOST verb is a plain `Button` and names itself. */ export interface FilesEditorLabels { upload: string; select: string; selectAll: string; deselectAll: string; done: string; downloadAll: string; /** Download-selected, given the count. */ downloadSelected: (n: number) => string; /** The bar's destructive act — VERB AND NOUN, and the confirm's commit. */ remove: string; /** The confirm's QUESTION — BY NAME where there is one file, by count above. */ removeQuestion: (names: readonly string[]) => string; } /** What a HOST verb reads: the files the user picked, and how to stand down * afterwards. An action the kit has never heard of is a plain `Button` in the * bar that calls this. */ export declare function useFilesEditorSelection(): { /** The picked files, in the grid's order. Empty outside select mode. */ selected: DisplayFile[]; selectedIds: string[]; /** Every file on the surface, picked or not. */ files: DisplayFile[]; selectMode: boolean; /** Drop the selection, stay in select mode. */ clear: () => void; /** Drop the selection AND leave select mode. */ exit: () => void; }; export interface FilesEditorProps extends StyleProps { /** Completed/saved files. */ files: DisplayFile[]; /** The live add-queue (in-flight uploads). */ uploads?: FileUpload[]; /** Picked files → the host uploads and appends. Omit to hide the bar's * `upload`. */ onAdd?: (files: File[]) => void; /** Override the Upload action's picker with a native document picker. */ onUpload?: () => void; /** Omit to hide the bar's `remove` and the per-tile ✕. */ onRemove?: (id: string) => void; /** The per-tile ✕ during SELECT mode (default `true`); the non-select view never * shows one. `false` where a bar action is the sole delete path. */ selectTileRemove?: boolean; /** Cancel an in-flight upload (when using `uploads`). */ onUploadRemove?: (id: string) => void; onRetry?: (id: string) => void; onRetryAll?: () => void; /** Override the default download (`downloadFileFromUrl`). */ onDownload?: (file: DisplayFile) => void; accept?: string; itemSize?: number; minItemWidth?: number; columns?: number; /** Cap the grid's height (px) so it SCROLLS and the bar pins below it. Omit in * free-flow layouts, where the page scrolls. */ gridMaxHeight?: number; /** Overrides for the shipped bar pieces, falling back to the active * `LoticsLocale`. */ labels?: Partial; /** Credentials mode for the gallery's preview fetches — see * `FilePreviewProps`. */ credentials?: RequestCredentials; galleryLabels?: Partial; /** The bar BELOW the grid; omit it for a grid that only previews. */ children?: ReactNode; testID?: string; ref?: React.Ref; render?: useRender.RenderProp; } /** * The attachment surface: this root owns the batch selection, the full-screen * gallery and the Alert-confirmed remove, and renders the upload-aware grid. * What you can DO to the files is the bar's `verbs` list. * * ```tsx * * * * ``` */ export declare function FilesEditor(props: FilesEditorProps): React.JSX.Element; /** ONE of the acts an attachment surface offers. Each reads the editor's own * state and renders NOTHING where the act is unavailable, so a read-only surface * is the same list with the handlers withheld. `spacer` pushes right. */ export type FilesEditorVerb = "upload" | "select" | "select_all" | "spacer" | "download" | "remove"; export interface FilesEditorBarProps extends StyleProps { /** The bar, left to right. A string is one of the editor's own acts; an element * is a verb of the HOST's, reading the same state through * `useFilesEditorSelection()`. */ verbs: readonly (FilesEditorVerb | React.ReactElement)[]; ref?: React.Ref; render?: useRender.RenderProp; } /** The action row under the grid. */ export declare function FilesEditorBar(props: FilesEditorBarProps): React.ReactElement>;