UNPKG

@payfit/unity-components

Version:

25 lines (24 loc) • 946 B
import { DatePickerProps as CoreDatePickerProps } from '../../../../core/components/date-picker/DatePicker.js'; export type DatePickerProps = Omit<CoreDatePickerProps, 'defaultValue' | 'isInvalid'>; /** * `DatePicker` is a controlled date picker wired to the Form field context. * It is based on the Unity `DatePicker` component. * Pass `value` with `onChange` to convert a non-CalendarDate store value. * Without `value`, the component binds CalendarDate directly as before. * * Example: * ```tsx * function ExampleField() { * const form = useUnityForm<{ birthDate: CalendarDate | null }>({ validators: {} }) * return ( * <form> * <form.AppField name="birthDate"> * {() => <DatePicker />} * </form.AppField> * </form> * ) * } * ``` */ declare const DatePicker: import('react').ForwardRefExoticComponent<DatePickerProps & import('react').RefAttributes<HTMLDivElement>>; export { DatePicker };