import "./inline_files.css"; import type * as React from "react"; import { useRender } from "@base-ui/react/use-render"; import { type DisplayFile } from "./file_thumbnail"; import type { GalleryLabels } from "./file_preview"; import { type StyleProps } from "./style_props"; export interface InlineFilesProps extends StyleProps { /** What is attached now. */ files: DisplayFile[]; /** * The user picked these. The HOST uploads them and persists the result, so * `files` only changes when the host says so, and **`multiple` decides what the * host must DO with them**. * * Return a promise and the CTA stays busy until it settles, which is the whole * of this component's loading state. Omit for a read-only field — the same * list, no CTA. */ onAdd?: (picked: File[]) => void | Promise; /** Adds a (confirmed) Remove to each row's ⋯ menu. Omit for add-only. */ onRemove?: (file: DisplayFile) => void; /** Open outside the app — a new tab on the frontend, `openExternal` in a * sandboxed app. Omit and the row still previews in place. */ onOpenExternal?: (file: DisplayFile) => void; /** Override the download (the host frontend sends `credentials`). */ onDownload?: (file: DisplayFile) => void; /** * **The FIELD's cardinality, not the picker's convenience.** Default `true`. * * `true` — a set: the picker takes several at once and the CTA reads * `addMoreLabel` once something is attached. * * `false` — exactly one: the picker takes one and the CTA reads `replaceLabel`. * **The host must then SET rather than append in `onAdd`** — the component does * not own the data, and the failure is silent. */ multiple?: boolean; /** CTA words for the three states — nothing attached, adding to a set, * replacing the one. Each falls back to the one before it. */ addLabel?: string; addMoreLabel?: string; replaceLabel?: string; /** Replaces the CTA's words while `onAdd` is in flight. Omit and the CTA keeps * its words and simply disables — no invented English in a localized app. */ busyLabel?: string; /** Renders this sentence INSTEAD of the CTA — for a field with nothing to attach * TO yet. Not a disabled button: a sentence states the act that unblocks it. */ blockedReason?: string; /** Shown when nothing is attached AND there is no CTA. Default "—". */ emptyLabel?: string; /** Native accept filter, e.g. `"application/pdf,image/*"`. */ accept?: string; /** What pressing a row does — forwarded to `FileRows`. A field holding * documents (a contract, a recording) wants `"open"`; a field holding scans * wants the default preview. */ press?: "preview" | "open"; /** Translated gallery/menu chrome, forwarded to `FileRows`. */ labels?: Partial; /** Credentials mode for the preview fetches — `"include"` for auth-gated * proxy URLs, omitted for an app's presigned URLs. */ credentials?: RequestCredentials; onError?: (error: unknown, meta: { fileId: string; mimeType: string; }) => void; testID?: string; ref?: React.Ref; render?: useRender.RenderProp; } /** * The FILES member of the `Inline*` family — a record's attachments, editable in * the value column of a `DetailRow`. It sits on the inline grid's VERTICAL beat * but takes NO horizontal inset, because its children are boxes rather than text. * * A LIST, not a grid, and not switchable: documents are identified by NAME. * Lean on purpose — no selection mode, no bulk bar, no upload queue. */ export declare function InlineFiles(props: InlineFilesProps): React.ReactElement>;