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 surface is set to it, so a row mixing an editor and a reading is one band. */ export declare const CONTROL_HEIGHT = 40; export interface FieldSurfaceProps extends StyleProps { /** The value in both states; on the trigger arm a read-only node. */ children: ReactNode; /** * Verbs about the value, siblings of the control. Pass unconditionally and `disabled`, or the * slot's arrival shifts layout; a verb its own press makes needless may render nothing, and its slot * keeps the widest it drew, so the value never moves under it. With verbs the surface paints the box. */ actions?: ReactNode; /** "blur" (default): no exit controls. "buttons": ✓/✕. */ controls?: CommitControls; /** What the ✓/✕ act on. */ editing?: boolean; onCommit?: () => void; onCancel?: () => void; /** The spinner floats inside the control's right edge. */ saving?: boolean; /** Stated at the field and announced; the draft is kept. */ error?: string | null; disabled?: boolean; /** Read-only surface that stays pressable: nothing can change the value, anything can open it. */ inert?: boolean; /** The active ring while the popover is open; under `role="combobox"` also `aria-expanded`. */ active?: boolean; /** Default 1; inert where the control keeps its own box. */ numberOfLines?: number; /** Decoration only, inside the press target; suppressed while `disabled` or `inert`. */ trailing?: ReactNode; /** With `actions` the control is narrower than the field. */ anchorRef?: React.Ref; testID?: string; ref?: React.Ref; render?: useRender.RenderProp; /** * The surface becomes the focusable control, showing `children`; unset, the slot's control owns * focus. */ onPress?: (event: React.MouseEvent) => void; /** * Default "button"; "combobox" when pressing opens a list holding the value (then `active` is * `aria-expanded` and the element is a `
`). */ role?: "button" | "combobox"; accessibilityLabel?: string; onFocus?: () => void; /** Base UI identifies its trigger by this ref. */ controlRef?: React.Ref; } /** * THE FIELD AROUND A CONTROL: verbs, the saving spinner, the ✓/✕ exit, the refused save. It draws * no value. The box is the control's except with `actions`, where the surface takes it. */ export declare function FieldSurface(props: FieldSurfaceProps): React.ReactElement>;