UNPKG

@coconut-software/ui

Version:

React components for faster and easier web development.

41 lines (40 loc) 1.76 kB
import type { Ref } from 'react'; import type { ChangeEvent } from '../DatePicker/DatePicker'; import type { TextInputSize, TextInputVariant } from '../TextInput/styles'; type DatePickerInputProps = { clearRef?: Ref<HTMLButtonElement>; condensed?: boolean; disabled?: boolean; error?: boolean; helperText?: string; initialDate?: [Date, Date] | Date | null; inputRef?: Ref<HTMLInputElement>; label: string; name?: string; onChange?: (event: ChangeEvent) => void; size?: TextInputSize; variant?: TextInputVariant; }; export type DayPickerInputProps = { onChange?: (event: SingleDateChangeEvent) => void; } & Omit<DatePickerInputProps, 'onChange'>; type MultiDateChangeEvent = { target: { value: Date[]; }; }; type RangePickerInputProps = { onChange?: (event: MultiDateChangeEvent) => void; } & Omit<DatePickerInputProps, 'onChange'>; type SingleDateChangeEvent = { target: { value: Date; }; }; type WeekPickerInputProps = { onChange?: (event: MultiDateChangeEvent) => void; } & Omit<DatePickerInputProps, 'onChange'>; declare function DayPickerInput({ clearRef, condensed, disabled, error, helperText, initialDate, inputRef, label, name, onChange, size, variant, }: DayPickerInputProps): JSX.Element; declare function RangePickerInput({ clearRef, condensed, disabled, error, helperText, initialDate, inputRef, label, name, onChange, size, variant, }: RangePickerInputProps): JSX.Element; declare function WeekPickerInput({ clearRef, condensed, disabled, error, helperText, initialDate, inputRef, label, name, onChange, size, variant, }: WeekPickerInputProps): JSX.Element; export { DayPickerInput, RangePickerInput, WeekPickerInput };