import { ElementType, ReactNode, Ref, ChangeEvent, KeyboardEvent, FocusEvent, ComponentPropsWithoutRef } from 'react'; import { Color } from '../types.js'; import { SurfaceCutOwnProps } from './SurfaceCut.js'; export type InputSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl'; interface InputOwnProps { /** Polymorphic **wrapper** element. Defaults to `'div'`. (For the inner input, see `inputComponent`.) */ as?: C; /** Native ``. Default `'text'`. */ type?: string; /** Controlled value. */ value?: string | number; /** * Custom node displayed in place of the raw `value` while the input is `readOnly` or unfocused. * * Useful for formatted display (e.g. show "1,234.56" while the underlying value is `1234.56`) - the real value re-appears on focus for editing. */ displayValue?: ReactNode; /** Native `placeholder` shown when the input is empty. */ placeholder?: string; /** Native `name` attribute, used for form submission. */ name?: string; /** Native `required` attribute. Default `false`. */ required?: boolean; /** Visually dim the input and disable interaction. Default `false`. */ disabled?: boolean; /** Make the input non-editable but still focusable for value display/copying. */ readOnly?: boolean; /** `id` for the inner ``. Used to wire an external `