import { forwardRef } from 'react';
import type { InputProps } from './Input';
import { Input } from './Input';

export type NumericInputProps = Omit<InputProps, 'type' | 'characterMask' | 'inputMode' | 'pattern'>;

/** Single-line field that accepts **digits only** (0–9). Uses `type="tel"` for sensible mobile keyboards. */
export const NumericInput = forwardRef<HTMLInputElement, NumericInputProps>(function NumericInput(props, ref) {
  return <Input ref={ref} type="tel" characterMask="digits" inputMode="numeric" pattern="[0-9]*" {...props} />;
});
