import * as React from 'react'; import { DayPickerProps as ReactDayPickerProps } from 'react-day-picker'; import 'react-day-picker/lib/style.css'; import { TextFieldProps } from '../TextField'; import { GetClasses } from '../../typeUtils'; export declare const DayPickerStylesKey = "ChromaDayPicker"; export declare type DayPickerClasses = GetClasses; declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"dayPicker" | "root" | "dayPickerBottomLeft" | "dayPickerBottomRight" | "dayPickerTopLeft" | "dayPickerTopRight" | "navBar" | "chevronButtonContainer" | "textFieldNoManualInput">; export declare type DayPickerAnchorPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'; export declare type DayPickerProps = Omit & { /** * The currently selected day. */ value?: Date; /** * A background color to use for the currently selected month. * * Default is 'primary'. */ pickerColor?: 'primary' | 'secondary'; /** * Where to anchor the calender pop-up. Default is 'bottom-left'. */ anchorPosition?: DayPickerAnchorPosition; /** * A minimum date to allow. This will prevent manual input or day * selection of any day before this date. */ minDate?: Date; /** * A maximum date to allow. This will prevent manual input or day * selection of any day after this date. */ maxDate?: Date; /** * Overrides for internal aria-labels. Useful for localizing * the labels. */ ariaLabelOverrides?: { monthHeader?: string; leftChevron?: string; rightChevron?: string; }; /** * Props to spread into the internal day picker. * * IMPORTANT: Props provided via this object take priority over internally * specified props. Defining some values may cause the component to behave * unusually. */ calendarProps?: Partial; /** * Called when a day is selected in the calendar UI or a valid * date string is entered manually. */ onDayChange?: (day: Date) => void; /** * Called when a day is selected in the calendar UI or the input * text is changed manually. * * Will only be called when `parseDate` is provided. */ onTextChange?: (text: string) => void; /** * A predicate for identifying days to disable selecting. * * Also will prevent manually entering dates matching this * predicate (when using `parseDate`). */ disableDay?: (day: Date) => boolean; /** * Used for formatting the date into the text field. */ formatDate?: (day: Date) => string; /** * Used for parsing manual text input to a date. * * IMPORTANT: this function should _never_ throw. Invalid string * should return `undefined`. */ parseDate?: (text: string) => Date | undefined; /** * Used for formatting the month title header. * * Useful for overriding to a localized month + year. */ formatMonthTitle?: (day: Date) => string; /** * Used for formatting the weekday column headers. * * Useful for overriding to a localized abbreviation. */ formatWeekdayShort?: (weekday: number) => string; /** * Use to customize rendering of individual days in the grid. */ renderDay?: (day: Date) => React.ReactNode; }; export declare const testIds: { calendar: string; }; /** * An input component for selecting a day. * * ### Other Props * * `DayPicker` inherits (and forwards) most of its props on to the internal `TextField`. See * the documentation on `TextField` for more detailed descriptions of those props. * * ### Links * * - [Component Source](https://github.com/lifeomic/chroma-react/blob/master/src/components/DayPicker/DayPicker.tsx) * - [Story Source](https://github.com/lifeomic/chroma-react/blob/master/stories/components/DayPicker/DayPicker.stories.tsx) */ export declare const DayPicker: React.ForwardRefExoticComponent & { /** * The currently selected day. */ value?: Date | undefined; /** * A background color to use for the currently selected month. * * Default is 'primary'. */ pickerColor?: "primary" | "secondary" | undefined; /** * Where to anchor the calender pop-up. Default is 'bottom-left'. */ anchorPosition?: DayPickerAnchorPosition | undefined; /** * A minimum date to allow. This will prevent manual input or day * selection of any day before this date. */ minDate?: Date | undefined; /** * A maximum date to allow. This will prevent manual input or day * selection of any day after this date. */ maxDate?: Date | undefined; /** * Overrides for internal aria-labels. Useful for localizing * the labels. */ ariaLabelOverrides?: { monthHeader?: string | undefined; leftChevron?: string | undefined; rightChevron?: string | undefined; } | undefined; /** * Props to spread into the internal day picker. * * IMPORTANT: Props provided via this object take priority over internally * specified props. Defining some values may cause the component to behave * unusually. */ calendarProps?: Partial | undefined; /** * Called when a day is selected in the calendar UI or a valid * date string is entered manually. */ onDayChange?: ((day: Date) => void) | undefined; /** * Called when a day is selected in the calendar UI or the input * text is changed manually. * * Will only be called when `parseDate` is provided. */ onTextChange?: ((text: string) => void) | undefined; /** * A predicate for identifying days to disable selecting. * * Also will prevent manually entering dates matching this * predicate (when using `parseDate`). */ disableDay?: ((day: Date) => boolean) | undefined; /** * Used for formatting the date into the text field. */ formatDate?: ((day: Date) => string) | undefined; /** * Used for parsing manual text input to a date. * * IMPORTANT: this function should _never_ throw. Invalid string * should return `undefined`. */ parseDate?: ((text: string) => Date | undefined) | undefined; /** * Used for formatting the month title header. * * Useful for overriding to a localized month + year. */ formatMonthTitle?: ((day: Date) => string) | undefined; /** * Used for formatting the weekday column headers. * * Useful for overriding to a localized abbreviation. */ formatWeekdayShort?: ((weekday: number) => string) | undefined; /** * Use to customize rendering of individual days in the grid. */ renderDay?: ((day: Date) => React.ReactNode) | undefined; } & React.RefAttributes>; export {};