mui-component
Version:
some custom mui components
81 lines (80 loc) • 3.44 kB
TypeScript
import React from 'react';
import { Theme } from '@mui/material/styles';
import { PickersDayProps } from '@mui/x-date-pickers/PickersDay';
import { SxProps } from '@mui/material';
export interface DateRangePickerDayClasses {
/** Styles applied to the root element. */
root: string;
/** Styles applied to the root element if `isHighlighting=true` and `outsideCurrentMonth=false`. */
rangeIntervalDayHighlight: string;
/** Styles applied to the root element if `isStartOfHighlighting=true` or `day` is the start of the month. */
rangeIntervalDayHighlightStart: string;
/** Styles applied to the root element if `isEndOfHighlighting=true` or `day` is the end of the month. */
rangeIntervalDayHighlightEnd: string;
/** Styles applied to the preview element. */
rangeIntervalPreview: string;
/** Styles applied to the root element if `isPreviewing=true` and `outsideCurrentMonth=false`. */
rangeIntervalDayPreview: string;
/** Styles applied to the root element if `isStartOfPreviewing=true` or `day` is the start of the month. */
rangeIntervalDayPreviewStart: string;
/** Styles applied to the root element if `isEndOfPreviewing=true` or `day` is the end of the month. */
rangeIntervalDayPreviewEnd: string;
/** Styles applied to the day element. */
day: string;
/** Styles applied to the day element if `isHighlighting=false`. */
dayOutsideRangeInterval: string;
/** Styles applied to the day element if `selected=false` and `isHighlighting=true`. */
dayInsideRangeInterval: string;
/** Styles applied to the day element if `selected=false`. */
notSelectedDate: string;
}
export type DateRangePickerDayClassKey = keyof DateRangePickerDayClasses;
export declare function getDateRangePickerDayUtilityClass(slot: string): string;
export declare const dateRangePickerDayClasses: DateRangePickerDayClasses;
export interface DateRangePickerDayProps<TDate> extends Omit<PickersDayProps<TDate>, 'classes' | 'onBlur' | 'onFocus' | 'onKeyDown'> {
/**
* Set to `true` if the `day` is in a highlighted date range.
*/
isHighlighting: boolean;
/**
* Set to `true` if the `day` is the end of a highlighted date range.
*/
isEndOfHighlighting: boolean;
/**
* Set to `true` if the `day` is the start of a highlighted date range.
*/
isStartOfHighlighting: boolean;
/**
* Set to `true` if the `day` is in a preview date range.
*/
isPreviewing: boolean;
/**
* Set to `true` if the `day` is the start of a highlighted date range.
*/
isEndOfPreviewing: boolean;
/**
* Set to `true` if the `day` is the end of a highlighted date range.
*/
isStartOfPreviewing: boolean;
/**
* Override or extend the styles applied to the component.
*/
classes?: Partial<DateRangePickerDayClasses>;
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme>;
}
type DateRangePickerDayComponent = <TDate>(props: DateRangePickerDayProps<TDate> & React.RefAttributes<HTMLButtonElement>) => JSX.Element;
/**
*
* Demos:
*
* - [Date Range Picker](https://mui.com/x/react-date-pickers/date-range-picker/)
*
* API:
*
* - [DateRangePickerDay API](https://mui.com/x/api/date-pickers/date-range-picker-day/)
*/
export declare const DateRangePickerDay: DateRangePickerDayComponent;
export {};