UNPKG

@helpwave/hightide

Version:

helpwave's component and theming library

78 lines (75 loc) 3.04 kB
import * as react_jsx_runtime from 'react/jsx-runtime'; import react__default, { InputHTMLAttributes } from 'react'; import { UseDelayOptionsResolved } from '../../hooks/useDelay.js'; import { LabelProps } from './Label.js'; type EditCompleteOptionsResolved = { onBlur: boolean; afterDelay: boolean; } & Omit<UseDelayOptionsResolved, 'disabled'>; type EditCompleteOptions = Partial<EditCompleteOptionsResolved>; type InputProps = { /** * used for the label's `for` attribute */ label?: Omit<LabelProps, 'id'>; /** * Callback for when the input's value changes * This is pretty much required but made optional for the rare cases where it actually isn't need such as when used with disabled * That could be enforced through a union type but that seems a bit overkill * @default noop */ onChangeText?: (text: string) => void; className?: string; onEditCompleted?: (text: string) => void; allowEnterComplete?: boolean; expanded?: boolean; containerClassName?: string; editCompleteOptions?: EditCompleteOptions; } & Omit<InputHTMLAttributes<HTMLInputElement>, 'label'>; /** * A Component for inputting text or other information * * Its state is managed must be managed by the parent */ declare const Input: react__default.ForwardRefExoticComponent<{ /** * used for the label's `for` attribute */ label?: Omit<LabelProps, "id">; /** * Callback for when the input's value changes * This is pretty much required but made optional for the rare cases where it actually isn't need such as when used with disabled * That could be enforced through a union type but that seems a bit overkill * @default noop */ onChangeText?: (text: string) => void; className?: string; onEditCompleted?: (text: string) => void; allowEnterComplete?: boolean; expanded?: boolean; containerClassName?: string; editCompleteOptions?: EditCompleteOptions; } & Omit<react__default.InputHTMLAttributes<HTMLInputElement>, "label"> & react__default.RefAttributes<HTMLInputElement>>; /** * A Component for inputting text or other information * * Its state is managed by the component itself */ declare const InputUncontrolled: ({ value, onChangeText, ...props }: InputProps) => react_jsx_runtime.JSX.Element; type FormInputProps = InputHTMLAttributes<HTMLInputElement> & { id: string; labelText?: string; errorText?: string; labelClassName?: string; errorClassName?: string; containerClassName?: string; }; declare const FormInput: react__default.ForwardRefExoticComponent<react__default.InputHTMLAttributes<HTMLInputElement> & { id: string; labelText?: string; errorText?: string; labelClassName?: string; errorClassName?: string; containerClassName?: string; } & react__default.RefAttributes<HTMLInputElement>>; export { type EditCompleteOptions, type EditCompleteOptionsResolved, FormInput, type FormInputProps, Input, type InputProps, InputUncontrolled };