import { ReactNode } from 'react'; interface ErrorProps { error?: string | boolean | undefined; } interface DisabledProps { disabled?: string | boolean | undefined; } export interface TextInputProps extends InputProps { label: string; } export interface CheckboxInputProps extends ErrorProps, DisabledProps { } export interface InputLabelProps extends ErrorProps, DisabledProps { } export interface InputProps { name: string; placeholder?: string; children?: ReactNode; tabIndex?: number | undefined; value?: string | undefined; /** * Input has an error * * @default false **/ error?: string | boolean | undefined; /** * HTML pattern for input * * @default false **/ pattern?: string | undefined; /** * HTML input type * * @default 'text' **/ type?: string; /** * Is input a required field * * @default false **/ required?: boolean | undefined; /** * Should input be autofocused * * @default false **/ autofocus?: boolean | undefined; /** * Should browser auto-complete field * * @default true **/ autocomplete?: boolean | undefined; /** * On change * * @default () => {} **/ onChange?: () => void; } export interface CheckboxProps { children?: any; value?: string; onChange?: () => void; onClick?: () => void; name?: string | undefined; error?: string | boolean | undefined; /** * The Input label to be displayed to user * * @default 'hello' **/ inputLabel?: string; /** * When interacted with, is the box ticked or not * * @default false **/ checked?: boolean | undefined; /** * When initially loaded, is the box ticked or not * * @default false **/ defaultChecked?: boolean | undefined; /** * Disabled * * @default false **/ disabled?: boolean | undefined; /** * Is checkbox interactable * * @default false **/ readOnly?: boolean | undefined; } export interface RadioProps { /** * Input label * **/ label: string; /** * Input "id" attribute, also used as label "for" * **/ id: string; /** * Input HTML name * **/ name: string; /** * Input HTML value * **/ value: string; /** * Is input invalid * * @default false **/ error?: string | boolean | undefined; /** * Required input ? * * @default false **/ required?: boolean; /** * Checked ? * * @default false **/ checked?: boolean; /** * Default Checked ? * * @default false **/ defaultChecked?: boolean; /** * Disabled ? * * @default false **/ disabled?: boolean; } export interface StyledInputProps { checked?: boolean; } export {};