import * as React from 'react'; import { View } from 'react-native'; import type { ZestUIComponentProps } from '../../types'; import type { ZestChangeEventDetails } from '../../utils/createChangeEventDetails'; import type { REASONS } from '../../utils/reasons'; /** * Groups all parts of the number field. * Renders a ``. * * **Not ported from upstream.** `name`/`form`/`required`/`inputRef` (the hidden * input and form submission — see the standing decision in CLAUDE.md); * `allowWheelScrub` (no mouse wheel); and `smallStep`/`largeStep`, which upstream * steps by while the alt/shift key is held — a touch keyboard has neither, the * same reason `Slider` drops `largeStep`. Arrow-key stepping and the * `input-paste` reason go with them: React Native's `TextInput` reports edits * through `onChangeText`, which cannot tell a paste from typing. */ export declare function NumberFieldRoot(componentProps: NumberFieldRoot.Props): React.JSX.Element; export interface NumberFieldRootState { /** * Whether the component should ignore user interaction. */ disabled: boolean; /** * Whether the user should be unable to change the field value. */ readOnly: boolean; /** * Whether the user must enter a value. */ required: boolean; /** * Whether the value is being changed by dragging the scrub area. */ scrubbing: boolean; /** * The raw numeric value of the field. */ value: number | null; /** * The text currently shown in the input. */ inputValue: string; /** * The minimum value of the field. */ min: number | undefined; /** * The maximum value of the field. */ max: number | undefined; } export interface NumberFieldRootProps extends Omit, 'id'> { /** * The raw numeric value of the field. */ value?: number | null | undefined; /** * The uncontrolled value of the field when it's initially rendered. * * To render a controlled number field, use the `value` prop instead. */ defaultValue?: number | undefined; /** * The id of the input element. */ id?: string | undefined; /** * The minimum value of the field. */ min?: number | undefined; /** * The maximum value of the field. */ max?: number | undefined; /** * Amount to increment and decrement with the buttons, or to scrub with a drag * in the scrub area. * * Specify `step="any"` to disable step validation; stepping then uses 1. * @default 1 */ step?: number | 'any' | undefined; /** * Whether the value should snap to the nearest step when incrementing or * decrementing. * @default false */ snapOnStep?: boolean | undefined; /** * When true, typed text may fall outside the `min`/`max` range without * clamping. Step-based interactions (buttons, scrub) still clamp. * @default false */ allowOutOfRange?: boolean | undefined; /** * Whether the component should ignore user interaction. * @default false */ disabled?: boolean | undefined; /** * Whether the user should be unable to change the field value. * @default false */ readOnly?: boolean | undefined; /** * Options to format the input value. */ format?: Intl.NumberFormatOptions | undefined; /** * The locale of the input element. * Defaults to the user's runtime locale. */ locale?: Intl.LocalesArgument | undefined; /** * Callback fired when the number value changes. */ onValueChange?: ((value: number | null, eventDetails: NumberFieldRoot.ChangeEventDetails) => void) | undefined; /** * Callback fired when the value is committed: when the input is blurred after * typing, or the press is released after scrubbing or stepping. */ onValueCommitted?: ((value: number | null, eventDetails: NumberFieldRoot.ChangeEventDetails) => void) | undefined; } export type NumberFieldRootChangeEventReason = typeof REASONS.inputChange | typeof REASONS.inputClear | typeof REASONS.inputBlur | typeof REASONS.incrementPress | typeof REASONS.decrementPress | typeof REASONS.scrub | typeof REASONS.none; export type NumberFieldRootChangeEventDetails = ZestChangeEventDetails; export declare namespace NumberFieldRoot { type State = NumberFieldRootState; type Props = NumberFieldRootProps; type ChangeEventReason = NumberFieldRootChangeEventReason; type ChangeEventDetails = NumberFieldRootChangeEventDetails; } //# sourceMappingURL=NumberFieldRoot.d.ts.map