import "./column_map.css"; import type * as React from "react"; import { useRender } from "@base-ui/react/use-render"; import { type StyleProps } from "./style_props"; /** One place an incoming column can land. */ export interface ColumnMapTarget { value: string; label: string; } /** One column that ARRIVED, and where it is going. */ export interface ColumnMapColumn { /** The name the source spelled it — never re-worded, because the reader is matching against the file. */ name: string; /** What the first line under it says: the one fact a reader decides the pairing by. */ sample?: string; /** Where it lands, or `null` for one the reader is leaving out. */ target: string | null; /** NOBODY CHOSE THIS YET — something guessed it, and it is drawn as a guess until the reader touches it. */ suggested?: boolean; } export interface ColumnMapLabels { /** The named row that means "leave this column out". */ ignore?: string; /** The word a guessed pairing wears. */ suggested?: string; /** The line naming the destinations nothing reached. */ unreached?: (names: string[]) => string; } export interface ColumnMapProps extends StyleProps { columns: readonly ColumnMapColumn[]; targets: readonly ColumnMapTarget[]; /** The reader re-pointed one column — `null` is the explicit "leave it out". */ onChange: (name: string, target: string | null) => void; labels?: ColumnMapLabels; disabled?: boolean; testID?: string; ref?: React.Ref; render?: useRender.RenderProp; } /** * INCOMING COLUMNS, EACH ASSIGNED TO ONE OF A KNOWN SET — the step between a * file somebody else wrote and the fields it has to land in. * * Three laws, and they are the reason this is a component rather than a row of * selects: * * · **A guess is drawn as a guess.** A pairing nothing confirmed wears * `suggested` until the reader touches it, so a match made on a name is * accepted rather than assumed. * · **One destination, once.** A field another column already reaches is not * offered — two columns writing one field is a mapping whose second value * silently wins. * · **What nothing reached is NAMED.** The destinations left empty close the * list, because a mapping is read for what is missing from it and an absence * that draws nothing is invisible. * * Leaving a column out is a VALUE the reader picks, never a blank: the list * carries a named row for it. */ export declare function ColumnMap(props: ColumnMapProps): React.ReactElement>;