import type { Snippet } from 'svelte';
import type { InputProps } from '../../primitives/Input/index.js';
import type { NumberInputSlots } from './numberinput.variants.js';
/**
* @summary A number field with bounds, steppers and arrow-key stepping.
* @description Generic numeric input with min/max/step bounds, stepper buttons,
* and Arrow-key / mouse-wheel increment. Built on {@link Input}, so it inherits
* labels, validation, sizes and variants. Values are plain numbers (not minor
* units) — {@link CurrencyInput} is the domain-specific specialization for money.
*
* The field accepts a leading `-`, a single decimal separator (`.` or `,`), and
* clamps to `[min, max]` on blur; the stepper and Arrow keys clamp immediately.
* Set {@link precision} to fix the number of decimal places.
*
* @tag form
* @related Input
* @related CurrencyInput
* @related Slider
* @stability beta
*
* @example
* ```svelte
*
*
* ```
*
* @example Decimal step with fixed precision
* ```svelte
*
* ```
*/
export interface NumberInputProps extends Omit {
/** Current numeric value. `null` when the field is empty. Supports `bind:value`. */
value?: number | null;
/**
* Micro-interaction preset forwarded to the inner Input. Redeclared from
* InputProps so the inheritance is a documented contract rather than an
* accident of the Omit list.
* @default 'none'
*/
mint?: InputProps['mint'];
/**
* Apply a named preset registered via ``.
* Resolved against the **`NumberInput`** key, not `Input`: a preset written for
* the number field would otherwise style every text field under the provider.
* `defaults.Input` still applies — the resolved preset reaches Input as
* instance `slotClasses`, so it wins over the provider's input-wide defaults
* and loses to `slotClasses` / `class` written on this component.
* A preset's `overrides` rules are matched against what you wrote here plus
* Input's own variant defaults; an axis Input derives or coerces for itself
* (`tier`, `messageType`, `error`, `hasRightIcon`, `iconPosition`) can match
* the wrong state — #360.
*/
preset?: string;
/** Minimum allowed value. Clamped on step / Arrow / blur. */
min?: number;
/** Maximum allowed value. Clamped on step / Arrow / blur. */
max?: number;
/** Increment applied by the stepper buttons, Arrow keys, and wheel. @default 1 */
step?: number;
/**
* Fixed number of decimal places for display and rounding. When unset, the
* value is shown as typed and the step's own decimals drive rounding.
* @summary Fixed number of decimal places. Unset shows the value as typed.
*/
precision?: number;
/** Hide the up/down stepper buttons (Arrow keys + wheel still work). @default false */
hideStepper?: boolean;
/** Shared `name` for a hidden input for native form submission. */
name?: string;
/** Fires after the value changes (typing, stepper, Arrow, wheel, or clamp). */
onValueChange?: (value: number | null) => void;
/** A custom right-side adornment. Overrides the stepper — pair with `hideStepper` or provide your own controls. */
rightIcon?: Snippet;
/**
* Per-slot class overrides. Carries NumberInput's own two slots — `stepper`
* (the button column) and `stepperButton` — on top of every {@link InputProps}
* slot. One record reaches both: the stepper is painted here and the rest
* travels on to the inner field. From ``, everything under
* `NumberInput` reaches both halves; `defaults.Input` reaches the field only.
*/
slotClasses?: Partial, string>>;
}
export { default as NumberInput } from './NumberInput.svelte';