UNPKG

@snowball-tech/fractal

Version:

Fractal's (Snowball's design system) React component library based on RadixUI and PandaCSS

50 lines (46 loc) 1.79 kB
import * as react from 'react'; import { HTMLAttributes, FocusEvent, ChangeEvent, KeyboardEvent } from 'react'; type DateFormat = { day?: number | ''; month?: number | ''; year?: number | ''; }; type Placeholders = { day?: string; month?: string; year?: string; }; type Descriptions = { day?: string; month?: string; year?: string; }; type CombinedRefs = { day: HTMLInputElement | null; month: HTMLInputElement | null; year: HTMLInputElement | null; }; interface InputDateProps extends Omit<HTMLAttributes<HTMLDivElement>, 'defaultValue' | 'onBlur' | 'onChange' | 'onFocus' | 'onKeyDown' | 'onKeyUp' | 'placeholder'> { autoFocus?: boolean; defaultValue?: DateFormat; descriptions?: Descriptions; disabled?: boolean; error?: string; id?: string; label?: string; maxYear?: number; name?: string; placeholders?: Placeholders; readOnly?: boolean; required?: boolean; success?: string; value?: DateFormat; onBlur?: (event: FocusEvent<HTMLInputElement>, type: keyof DateFormat) => void; onChange?: (event: ChangeEvent<HTMLInputElement>, newDate: DateFormat) => void; onFieldChange?: (event: ChangeEvent<HTMLInputElement>, type: keyof DateFormat, newValue: number) => void; onFocus?: (event: FocusEvent<HTMLInputElement>, type: keyof DateFormat) => void; onKeyDown?: (event: KeyboardEvent<HTMLInputElement>, type: keyof DateFormat) => void; onKeyUp?: (event: KeyboardEvent<HTMLInputElement>, type: keyof DateFormat) => void; } declare const InputDate: react.ForwardRefExoticComponent<InputDateProps & react.RefAttributes<CombinedRefs>>; export { type DateFormat, type Descriptions, InputDate, type InputDateProps, type CombinedRefs as InputDateRefs, type Placeholders };