import "./field_surface.css"; import type * as React from "react"; import { type ReactNode } from "react"; import { useRender } from "@base-ui/react/use-render"; import type { CommitControls } from "./commit_mode"; import { type StyleProps } from "./style_props"; /** The kit's standard control height (TextInput, NumberInput, Select, …). The * field surface is set to it, so a row mixing an editor with a reading is one * band and nothing shifts when a value is typed into. */ export declare const CONTROL_HEIGHT = 40; export interface FieldSurfaceProps extends StyleProps { /** The CONTROL — the value in both states, since the surface renders none of its * own. On the trigger arm (see `onPress`) it is a read-only NODE instead. */ children: ReactNode; /** * Verbs that live ON the field's surface, for an act that is ABOUT THE VALUE. * They are SIBLINGS of the control: a button may not contain a button. * * Pass it UNCONDITIONALLY and `disabled` the verb when it has nothing to act * on, or the slot's arrival is a layout shift. WITH VERBS THE SURFACE PAINTS * THE BOX and the control inside surrenders its own. */ actions?: ReactNode; /** "blur" (default): no exit controls. "buttons": ✓/✕ beside the field. */ controls?: CommitControls; /** A draft is OPEN — what the ✓/✕ act on, and what they may not claim at rest. */ editing?: boolean; onCommit?: () => void; onCancel?: () => void; /** A write is in flight: the spinner floats inside the control's right edge. */ saving?: boolean; /** A refused save, stated AT the field and announced. The draft is kept. */ error?: string | null; disabled?: boolean; /** Wear the read-only surface — flat, borderless, no hover, no trailing * adornment — while staying pressable: a value nothing can CHANGE but anything * can still OPEN. */ inert?: boolean; /** True while the field's popover is open: wears the active ring so a * mouse-opened trigger reads like a focused input. Under `role="combobox"` it * is also what the field ANNOUNCES as `aria-expanded`. */ active?: boolean; /** How many lines the BOX THIS SURFACE PAINTS reserves, so a value does not * reflow the row. Default 1, and inert where the control keeps its own box. */ numberOfLines?: number; /** Right-aligned adornment on the TRIGGER arm. DECORATION only: it renders * inside the press target, so it may never hold a control, and it is * suppressed while `disabled` or `inert`. */ trailing?: ReactNode; /** A handle on the FIELD's outer box, for a caller that anchors an overlay to * it: with `actions` the control inside is narrower than the field. */ anchorRef?: React.Ref; testID?: string; ref?: React.Ref; render?: useRender.RenderProp; /** THE TRIGGER ARM. Pass it and the surface itself becomes the focusable * control, with `children` as the read-only node it shows; leave it unset and * the slot holds a control that owns its own focus. */ onPress?: (event: React.MouseEvent) => void; /** The APG pattern the trigger implements. Default "button"; **"combobox"** * when pressing the field opens a LIST that holds its value — `active` then * becomes `aria-expanded` and the element renders a `
`, whose content * model does not forbid interactive descendants. */ role?: "button" | "combobox"; /** Accessible name for the trigger when no enclosing label gives one. */ accessibilityLabel?: string; /** Raw focus on the trigger, any modality. */ onFocus?: () => void; /** The FOCUSABLE element on the trigger arm: Base UI identifies its trigger by * comparing the pressed element against the one this ref carries. */ controlRef?: React.Ref; } /** * THE FIELD AROUND A CONTROL — the verbs on its surface, the spinner while a * write is in flight, the ✓/✕ that own an explicit exit, and the refused save * stated under it. It draws NO value: the control is the value in both states. * * The box is the CONTROL's own except with `actions`, where the surface takes the * border and the control goes seamless — one box, one owner, either way. */ export declare function FieldSurface(props: FieldSurfaceProps): React.ReactElement>;