// Single-line text control. No `type="number"` convenience wrapper: numeric // input uses `inputmode` + a text type so locale decimal separators survive. import type { JSX } from 'solid-js'; import { ariaBool } from '../a11y'; import { cx } from '../cx'; import styles from './Input.module.scss'; import type { Size } from './variants'; export type InputType = | 'text' | 'email' | 'password' | 'search' | 'tel' | 'url' | 'date' | 'time' | 'datetime-local'; export interface InputProps { id?: string | undefined; name?: string | undefined; type?: InputType | undefined; value?: string | undefined; placeholder?: string | undefined; size?: Size | undefined; required?: boolean | undefined; disabled?: boolean | undefined; readonly?: boolean | undefined; autocomplete?: string | undefined; inputmode?: 'text' | 'numeric' | 'decimal' | 'tel' | 'email' | 'url' | 'search' | undefined; maxlength?: number | undefined; /** Non-interactive adornments; keep them icons or units, never controls. */ prefix?: JSX.Element | undefined; suffix?: JSX.Element | undefined; class?: string | undefined; 'aria-label'?: string | undefined; 'aria-describedby'?: string | undefined; 'aria-invalid'?: boolean | undefined; onInput?: JSX.EventHandlerUnion | undefined; onChange?: JSX.EventHandlerUnion | undefined; onBlur?: JSX.EventHandlerUnion | undefined; } export function Input(props: InputProps): JSX.Element { return ( {props.prefix === undefined ? null : ( )} {props.suffix === undefined ? null : ( )} ); }