import React from 'react'; import { DatePickerDropdown } from '@xo-union/tk-component-datepicker'; import { ClassesProp } from '@xo-union/react-css-modules'; type DatePickerDropdownProps = React.ComponentProps; type DatePickerProps = Omit & { /** * Name used for input element */ name: string; /** * The input's label string. If not provided, it is assumed from the name. */ label?: string; /** * Disable the input */ disabled?: boolean; /** * Visual state. This has no effect when validations are enabled. */ state?: 'neutral' | 'valid' | 'invalid'; /** * Subtext message used to provide the user with extra information. The subText will appear just below the field. * * * When validations are enabled, this value is used for the `neutral` and the `valid` state (if `subTextOnValid` is not specified). The given validators will determine what subText will render on `invalid`, unless otherwise specified by the `subTextOnInvalid` prop. */ subText?: React.ReactNode; /** * The input's id. If not provided, it is assumed from the name. */ id?: string; /** * Classes dependencies */ classes?: ClassesProp<'container' | 'input' | 'is-valid' | 'is-invalid' | 'label' | 'sub-text'>; /** * Validations to apply. See [Input Component](/packages/@xo-union/ui-form-validations#input). */ validations?: unknown; /** * This is only used when validations are enabled. * * What subText to render when state is `invalid`. When a function is provided, the function will receive the errors generated by the validators. The return value should be a React.Node type. */ subTextOnInvalid?: React.ReactNode | ((data: { errors: any[]; }) => React.ReactNode); /** * This is only used when validations are enabled. * * What subText to render when state is `valid`. This is only used when validations are enabled. */ subTextOnValid?: React.ReactNode | ((data: { errors: any[]; }) => React.ReactNode); /** * Selected date. * See [tk-component-datepicker props](/packages/@xo-union/tk-component-datepicker#props) */ value?: DatePickerDropdownProps['value']; /** * Dates to disable See [tk-component-datepicker props](/packages/@xo-union/tk-component-datepicker#props) */ disabledDates?: DatePickerDropdownProps['disabled']; /** * Called when selected date changes * See [tk-component-datepicker props](/packages/@xo-union/tk-component-datepicker#props) */ onChange: DatePickerDropdownProps['onChange']; /** * Date format to use when rendering in field. See [tk-component-datepicker props](/packages/@xo-union/tk-component-datepicker#props) */ dateFormat?: DatePickerDropdownProps['dateFormat']; /** * See [tk-component-datepicker props](/packages/@xo-union/tk-component-datepicker#props) */ locale?: DatePickerDropdownProps['dateFormat']; /** * Allows the datepicker component to be open upon component render. */ isOpenDefaultValue?: boolean; }; declare const DatePickerField: ({ id, name, subText, state, label, validations, onChange, classes, subTextOnInvalid, subTextOnValid, disabled, disabledDates, value, isOpenDefaultValue, ...props }: DatePickerProps) => JSX.Element; export default DatePickerField;