@start-base/react-form-elements
Version:
Simplify form elements and form management. Selection of user friendly inputs and wide customization abilities to match your design and functionality.
41 lines (37 loc) • 1.26 kB
TypeScript
import React from 'react';
import { DayPickerSingleProps } from 'react-day-picker';
import { FieldError } from 'react-hook-form';
interface CalendarRootSingleProps extends DayPickerSingleProps {
numberOfMonths?: number;
classNames?: Partial<Record<string, string>>;
calendarClassName?: string | null;
className?: string;
disabled?: boolean;
error?: boolean | string | {
message?: string;
} | null;
}
interface DatePickerProps extends CalendarRootSingleProps {
name: string;
onChange: (event: unknown) => void;
error?: boolean | string | {
message?: string;
} | null | undefined | FieldError;
label?: string;
placeholder?: string;
value?: string | number | Date | undefined;
locale?: any;
format?: string;
inputClassName?: string;
labelClassName?: string;
errorClassName?: string;
calendarClassName?: string;
prepend?: React.ReactNode;
prependClassName?: string;
append?: React.ReactNode;
appendClassName?: string;
disableShrink?: boolean;
disabled?: boolean;
}
declare const DatePicker: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<HTMLInputElement>>;
export { type DatePickerProps, DatePicker as default };