UNPKG

beta-parity-react

Version:

Beta Parity React Components

97 lines 3.06 kB
import React from 'react'; import { Instance } from 'flatpickr/dist/types/instance'; import { BaseOptions } from 'flatpickr/dist/types/options'; import { DateTimePickerProps } from 'react-flatpickr'; import './index.css'; import './variables.css'; import '../BaseInput/index.css'; import { InputProps, InputWrapperProps } from '../BaseInput'; export declare const DatePickerLocales: Record<string, any>; /** * Extended props for `DatePicker` * * Inheriting from `DateTimePickerProps`. */ export interface DatePickerPropsExtend extends DateTimePickerProps { /** * Floating label displayed inside the input field. * * @default undefined */ floatingLabel?: React.ReactNode; /** * Custom wrapper properties for styling the input container. * * @default undefined */ wrapperProps?: InputWrapperProps; /** * Theme color for the DatePicker. * - `'neutral'`: Uses a neutral color. * - `'accent'`: Uses an accent color. * * @default 'neutral' */ color?: 'neutral' | 'accent'; /** * Icon displayed inside the input field. * @default undefined */ icon?: React.ReactNode; /** * Position of the secondary icon inside the input. * - `'left'`: Displays on the left. * - `'right'`: Displays on the right. * * @default 'right' */ sideIcon?: 'left' | 'right'; /** * Locale for the DatePicker, based on `DatePickerLocales`. * * - `'de * * @default 'default' */ locale?: keyof typeof DatePickerLocales; /** * Custom component displayed at the top of the calendar. * @default undefined */ calenderHeader?: React.ReactNode; /** * Additional options for the Flatpickr component. * @default undefined * * @see {@link https://flatpickr.js.org/options/ Flatpickr options} */ options?: Partial<BaseOptions>; } /** * **Parity DatePicker**. * * @see {@link https://beta-parity-react.vercel.app/datepicker Parity DatePicker} * * @see {@link https://flatpickr.js.org/options/ Flatpickr options} */ export declare const DatePicker: React.ForwardRefExoticComponent<{ /** * Callback function triggered when the input gains focus. * @param e - Focus event. * @default undefined */ onFocus?: ((e: React.FocusEvent<HTMLInputElement>) => void) | undefined; /** * Callback function triggered when the input loses focus. * @param e - Blur event. * @default undefined */ onBlur?: ((e: React.FocusEvent<HTMLInputElement>) => void) | undefined; /** * Callback function triggered when the input change (allowInput =`true`). * @param e - Change event. * @default undefined */ onInputChange?: ((e: React.ChangeEvent<HTMLInputElement>, flatPickrInstance: Instance | null) => void) | undefined; } & DatePickerPropsExtend & Pick<InputProps, "isError" | "errorMessage" | "theme" | "inputSize"> & React.RefAttributes<HTMLInputElement>>; //# sourceMappingURL=index.d.ts.map