import "./number_input.css"; import type * as React from "react"; import { NumberField } from "@base-ui/react/number-field"; import type { Commit } from "./commit_mode"; import { type StyleProps } from "./style_props"; export interface NumberInputBase extends StyleProps { /** The ± discs, for a small bounded quantity the reader NUDGES. Off (the * default) is the bare box, for a figure that is TYPED. */ stepper?: boolean; min?: number; max?: number; /** What ↑/↓ and the stepper's discs move the figure by. Default 1. */ step?: number; /** A money column takes "right", so a typed figure shares the edge of the * derived one beside it. */ align?: "left" | "right"; onFocus?: () => void; onBlur?: () => void; onKeyDown?: (e: React.KeyboardEvent) => void; autoFocus?: boolean; disabled?: boolean; testID?: string; /** Announced name, and the phrase each stepper disc is named with — the pack * wraps it, so the discs read off the field's label. */ accessibilityLabel?: string; /** Hint text shown while the field is empty — a unit, a shape, an example * ("0,00", "kg"). */ placeholder?: string; /** * How the figure is RENDERED whenever the field is not being typed in and — * the same statement — what the field will TAKE BACK: the parser derives the * symbols it accepts from these very options. Default {@link FIGURE_FORMAT}. * * ONE statement, because two is how a field prints a figure it cannot read: a * unit `Intl` cannot express belongs BESIDE the field, not inside the value. */ format?: Intl.NumberFormatOptions; ref?: React.Ref; render?: React.ComponentProps["render"]; } /** * THE FIGURE AS THE READER'S LOCALE WRITES ONE, every digit kept — what the * field prints at rest AND what it will accept from the keyboard, because the * symbols the parser takes are derived from these same options. * * `maximumFractionDigits` is the one thing said over the locale's own default, at * Intl's ceiling: a figure is ENTERED here, so no digit the person typed is * rounded away between the keystroke and the blur. * * Exported because a figure drawn beside this field has to read as the field * prints it. */ export declare const FIGURE_FORMAT: Intl.NumberFormatOptions; /** * A numeric field, in the kit's two commit modes: a FORM holds the value and * commits in its footer (`onValueChange`), or the FIELD holds the draft and * writes it itself (`onSave`). For a wide continuous quantity use `Slider`. * * A styled Base UI `NumberField`, so ↑/↓ step the value. It is a TEXTBOX carrying * `aria-roledescription`, not a `spinbutton`, and on first focus it puts the * caret at the END of the value — a test that replaces the value has to select * before it types. * * The discs are POINTER affordances: the keyboard steps from the field itself, so * they stay out of the tab order, and their wording comes from the locale pack. */ export type NumberInputProps = NumberInputBase & Commit; export declare function NumberInput(props: NumberInputProps): React.JSX.Element;