import "./thumbnail_grid.css"; import type * as React from "react"; import { useRender } from "@base-ui/react/use-render"; import { type DisplayFile, type UploadStatus, type UploadStatusLabels } from "./file_thumbnail"; import { type DiffKind } from "./diff_mark"; import { type StyleProps } from "./style_props"; /** An in-flight upload — what the tile needs before the bytes land. */ export interface PendingUpload { id: string; filename: string; mimeType: string; previewUrl?: string; status: UploadStatus; staleFile?: boolean; } /** A live upload-queue entry: a just-completed file (in place) or an in-flight * upload. */ export type FileUpload = { status: "complete"; id: string; file: DisplayFile; } | PendingUpload; /** Per-instance overrides; both fall back to the active `LoticsLocale` * (`fileUpload`). */ export interface FileThumbnailGridLabels { /** Shown when any upload errored. */ retryAll?: string; upload?: UploadStatusLabels; } export interface FileThumbnailGridProps extends StyleProps { /** Files already stored — a record's saved attachments. */ files?: DisplayFile[]; /** The live add-queue, joining the SAME grid after `files`. */ uploads?: FileUpload[]; /** SLOTS THE PILE IS STILL OWED — that many ghost tiles after it, at the same * size, in the shortfall's own ink. `name` is what a tile announces, given HOW * MANY slots it stands for; the tile draws no caption. `onPress` fills one. */ ghosts?: { count: number; name: (slots: number) => string; onPress?: () => void; }; itemSize?: number; columns?: number; minItemWidth?: number; gap?: number; maxVisible?: number; singleRow?: boolean; onOverflowPress?: (hiddenCount: number) => void; overflowLabel?: (hiddenCount: number) => string; overflowTile?: boolean; partialRowAlign?: "start" | "end"; disablePress?: boolean; /** Selected file IDs — renders a selection overlay on those thumbnails, and * makes each pressable tile announce its state as `aria-pressed`. Pass it only * while a press TOGGLES the set. */ selectedIds?: ReadonlySet; /** What a proposal does to each file, keyed by id — a corner mark on the tile * and a fade on anything being removed. A grid says MEMBERSHIP well and * PAIRING badly, so a set where documents are being REPLACED wants * `FileRow`. */ diffs?: ReadonlyMap; /** When provided, pressing a tile toggles selection instead of `onFilePress`. */ onToggleSelect?: (id: string) => void; onFilePress?: (file: DisplayFile) => void; onRemove?: (id: string) => void; /** Cancels the upload. */ onUploadRemove?: (id: string) => void; onRetry?: (id: string) => void; /** A footer button, only while one has errored. */ onRetryAll?: () => void; labels?: FileThumbnailGridLabels; testID?: string; ref?: React.Ref; render?: useRender.RenderProp; } export declare function FileThumbnailGrid(props: FileThumbnailGridProps): React.JSX.Element;