import "./file_rows.css"; import type * as React from "react"; import { type ReactNode } from "react"; import { useRender } from "@base-ui/react/use-render"; import { type FileRowProps } from "./file_row"; import type { GalleryLabels } from "./file_preview"; import type { DisplayFile } from "./file_thumbnail"; import { type StyleProps } from "./style_props"; /** A file the list expects and does not hold yet — a paper not made, a slot not filled: its row the ghost of what * the list holds, named by what it will be, with no press or menu — the menu's seat kept, so its name never * re-wraps when the file lands. */ export interface ExpectedFile { id: string; name: string; expected: true; } export interface FileRowsProps extends StyleProps { /** The rows in their order: a file held, named by its `title` where it has one, else its filename; or one * expected. */ files: readonly (DisplayFile | ExpectedFile)[]; /** * Default none: pass what the name does not already say, since badge and extension state the * type — words, or a row's line of runs (`FileRow`'s `meta`). */ meta?: (entry: DisplayFile | ExpectedFile) => FileRowProps["meta"]; /** A tick (`Checkbox`) before each row's face, choosing the row, standing above the row's door. A row it * returns nothing for keeps the tick's slot empty, so the names keep one edge. */ leading?: (entry: DisplayFile | ExpectedFile) => ReactNode; /** Adds a confirmed Remove to every row, one expected too; the host drops it from its state. */ onRemove?: (entry: DisplayFile | ExpectedFile) => void; /** Adds Rename to every file held: the whole new name, its extension the file's own. A throw keeps the dialog * open, saying why. */ onRename?: (file: DisplayFile, filename: string) => void | Promise; /** Adds Replace to every file held: the file picked to stand in its place. */ onReplace?: (file: DisplayFile, picked: File) => void | Promise; /** Replace's picker filter. */ accept?: string; /** A new tab on the frontend, the SDK's `openExternal` in an app. */ onOpenExternal?: (file: DisplayFile) => void; /** Default fetch-and-save; the host passes one sending `credentials`. */ onDownload?: (file: DisplayFile) => void; onError?: (error: unknown, meta: { fileId: string; mimeType: string; }) => void; labels?: Partial; /** Default `"preview"`; `"open"` needs `onOpenExternal` and mounts no gallery. */ press?: "preview" | "open"; /** * Takes the press and the gallery with it, so no lightbox opens over the host's. `press="open"` * still wins. */ onFilePress?: (file: DisplayFile, files: readonly DisplayFile[]) => void; /** `"include"` for the host's proxy; omitted for presigned URLs. */ credentials?: RequestCredentials; testID?: string; ref?: React.Ref; render?: useRender.RenderProp; } /** * THE FILE LIST, the width of the value it stands in: each row a file by its face and its name — a picture its * thumbnail, a document its badge — or a file expected, every name on the widest face's edge. Press to preview * full-screen; every file held has its ⋯ — Open and Download always, Rename, Replace and Remove where the host * passes them. An upload surface or square tiles is `FileThumbnailGrid`. */ export declare function FileRows(props: FileRowsProps): React.JSX.Element | null;