import { InputSizeV2, InputStateV2 } from '../inputV2.types'; import { NumberInputV2TokensType } from './numberInputV2.tokens'; import { NumberInputV2Direction } from './numberInputV2.types'; /** Max length for `unit` after trim; longer values are invalid (error + unit hidden). */ export declare const NUMBER_INPUT_V2_UNIT_MAX_LENGTH = 7; /** When non-empty `unit` exceeds the max length, returns a footer error message. */ export declare const getNumberInputV2UnitLengthErrorMessage: (unit: string | undefined) => string | undefined; export declare const sanitizeNumberInput: (inputValue: string, allowNegative?: boolean) => string; export declare const clampToBoundary: (value: number, min?: number, max?: number) => number; export declare const getEffectiveNumericValue: (rawNumericValue: number | null, preventNegative: boolean, min?: number, max?: number) => number | null; export declare const incrementValue: (currentValue: number | null, step?: number, min?: number, max?: number, preventNegative?: boolean) => number; export declare const decrementValue: (currentValue: number | null, step?: number, min?: number, max?: number, preventNegative?: boolean) => number; export declare const clampValueOnBlur: (inputValue: string, allowNegative?: boolean, min?: number, max?: number) => string; export declare const isValueOutsideRange: (value: number, min?: number, max?: number) => boolean; export declare const getRangeErrorMessage: (min?: number, max?: number) => string; /** Stepping base: raw controlled number with only `preventNegative` applied (min/max handled in increment/decrement). */ export declare const getSteppingBaseValue: (rawNumericValue: number | null, preventNegative: boolean) => number | null; export declare const getNumberInputDisplayValue: (isFocused: boolean, internalValue: string, value: number | null, effectiveNumericValue: number | null) => string; export declare const getInputFocusedOrWithValue: (isFocused: boolean, displayValue: string) => boolean; export declare const isSmallScreenWithLargeSize: (isSmallScreen: boolean, size: InputSizeV2) => boolean; export declare const getRangeErrorMessageIfOutside: (rawNumericValue: number | null, numericMin: number | undefined, numericMax: number | undefined) => string | undefined; export declare const getNumberInputHasError: (errorShow: boolean | undefined, errorMessage: string | undefined, rangeErrorMessage: string | undefined) => boolean; export declare const getNumberInputDisplayErrorMessage: (errorShow: boolean | undefined, errorMessage: string | undefined, rangeErrorMessage: string | undefined) => string | undefined; export declare const buildNumberInputAriaDescribedBy: (hintText: string | undefined, hasError: boolean, hintId: string, errorId: string, displayErrorMessage: string | undefined) => string | undefined; export declare const getNumberInputLabelState: (disabled: boolean | undefined, hasError: boolean, isFocused: boolean) => InputStateV2; /** Visual state for the unit strip (borders/color); includes hover so it matches `PrimitiveInput` `_hover` chrome. */ export declare const getNumberInputUnitState: (disabled: boolean | undefined, hasError: boolean, isFocused: boolean, isHovered: boolean) => InputStateV2; export declare const computeIsUpButtonDisabled: (numericMax: number | undefined, steppingBaseValue: number | null, numericMin: number | undefined, stepValue: number) => boolean; export declare const computeIsDownButtonDisabled: (steppingBaseValue: number | null, preventNegative: boolean, numericMin: number | undefined, stepValue: number) => boolean; /** Parsed numeric string for controlled onChange, or empty string when incomplete/invalid. */ export declare const sanitizedToCommittedValueString: (sanitized: string) => string; export declare const rawNumericToComparableString: (rawNumericValue: number | null) => string; export declare const shouldSkipControlledChange: (valueString: string, currentValueString: string) => boolean; export declare const shouldEmitBlurChange: (clamped: string, eventValue: string, clampedNumValue: number | null, rawNumericValue: number | null) => boolean; type NumberInputV2InputContainerTokens = NumberInputV2TokensType['inputContainer']; /** Subscribes to `element` width changes; calls `setWidth` with `offsetWidth`. Returns unsubscribe. */ export declare const subscribeElementOffsetWidth: (element: HTMLElement, setWidth: (width: number) => void) => (() => void); /** * Horizontal padding so input text clears absolutely positioned adornments on the **left**: * - **Unit left**: unit width + left-slot margin + left-slot width + `paddingLeft` token. * - **Unit right**: left-slot margin + left-slot width + `paddingLeft` only (unit and right * adornments do not affect left inset). */ export declare const getNumberInputV2PaddingLeft: (inputContainerTokens: NumberInputV2InputContainerTokens, size: InputSizeV2, showUnit: boolean, unitDirection: NumberInputV2Direction, measuredUnitWidth: number, measuredLeftSlotWidth: number, measuredRightSlotWidth: number) => string; /** * Horizontal padding so input text clears absolutely positioned adornments on the **right**: * - **Unit right**: unit width + `paddingRight` + right-slot width (matches slot `marginRight` * layout: unit + padding strip, then the right slot). * - **Unit left**: right-slot margin + right-slot width + `paddingRight` only. */ export declare const getNumberInputV2PaddingRight: (inputContainerTokens: NumberInputV2InputContainerTokens, size: InputSizeV2, showUnit: boolean, unitDirection: NumberInputV2Direction, measuredUnitWidth: number, measuredLeftSlotWidth: number, measuredRightSlotWidth: number) => string; export {};