react-day-picker 8.0.5 → 8.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ $ yarn add react-day-picker date-fns # using yarn
|
|
|
23
23
|
- ☀️ Select days, ranges or whatever
|
|
24
24
|
- 🌎 Localizable into any language
|
|
25
25
|
- ➡️ Keyboard navigation
|
|
26
|
-
- ♿️ [
|
|
26
|
+
- ♿️ [WAI-ARIA](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) support
|
|
27
27
|
- 🤖 Native TypeScript support
|
|
28
28
|
- 🧘♀️ using [date-fns](http://date-fns.org) as date library
|
|
29
29
|
- 🗓 Create multiple calendars
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DayPickerBase } from '../../types/DayPickerBase';
|
|
3
|
-
import {
|
|
3
|
+
import { DayPickerSingleProps } from '../../types/DayPickerSingle';
|
|
4
4
|
/** The props to attach to the input field when using [[useInput]]. */
|
|
5
5
|
export declare type InputHTMLAttributes = Pick<React.InputHTMLAttributes<HTMLInputElement>, 'onBlur' | 'onChange' | 'onFocus' | 'value' | 'placeholder'>;
|
|
6
6
|
/** The props to attach to the DayPicker component when using [[useInput]]. */
|
|
7
|
-
export declare type InputDayPickerProps = Pick<
|
|
7
|
+
export declare type InputDayPickerProps = Pick<DayPickerSingleProps, 'fromDate' | 'toDate' | 'locale' | 'month' | 'onDayClick' | 'onMonthChange' | 'selected' | 'today'>;
|
|
8
8
|
export interface UseInputOptions extends Pick<DayPickerBase, 'locale' | 'fromDate' | 'toDate' | 'fromMonth' | 'toMonth' | 'fromYear' | 'toYear' | 'today'> {
|
|
9
9
|
/** The initially selected date */
|
|
10
10
|
defaultSelected?: Date;
|
package/dist/types/Styles.d.ts
CHANGED
|
@@ -84,10 +84,16 @@ export declare type StyledElement<T = string | React.CSSProperties> = {
|
|
|
84
84
|
/** The day when today. */
|
|
85
85
|
readonly day_today: T;
|
|
86
86
|
};
|
|
87
|
+
/** These elements must not be in the `styles` or `classNames` records as they are styled via the `modifiersStyles` or `modifiersClassNames` pop */
|
|
88
|
+
export declare type InternalModifiersElement = 'day_outside' | 'day_selected' | 'day_disabled' | 'day_hidden' | 'day_range_start' | 'day_range_end' | 'day_range_middle' | 'day_today';
|
|
87
89
|
/** The class names of each element. */
|
|
88
90
|
export declare type ClassNames = Partial<StyledElement<string>>;
|
|
89
|
-
/**
|
|
90
|
-
|
|
91
|
+
/**
|
|
92
|
+
* The inline-styles of each styled element, to use with the `styles` prop. Day
|
|
93
|
+
* modifiers, such as `today` or `hidden`, should be styled using the
|
|
94
|
+
* `modifiersStyles` prop.
|
|
95
|
+
*/
|
|
96
|
+
export declare type Styles = Partial<Omit<StyledElement<React.CSSProperties>, InternalModifiersElement>>;
|
|
91
97
|
/** Props of a component that can be styled via classNames or inline-styles. */
|
|
92
98
|
export declare type StyledComponent = {
|
|
93
99
|
className?: string;
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ import parse from 'date-fns/parse';
|
|
|
7
7
|
|
|
8
8
|
import { parseFromToProps } from 'contexts/DayPicker/utils';
|
|
9
9
|
import { DayPickerBase } from 'types/DayPickerBase';
|
|
10
|
-
import {
|
|
10
|
+
import { DayPickerSingleProps } from 'types/DayPickerSingle';
|
|
11
11
|
import {
|
|
12
12
|
DayClickEventHandler,
|
|
13
13
|
MonthChangeEventHandler
|
|
@@ -23,7 +23,7 @@ export type InputHTMLAttributes = Pick<
|
|
|
23
23
|
|
|
24
24
|
/** The props to attach to the DayPicker component when using [[useInput]]. */
|
|
25
25
|
export type InputDayPickerProps = Pick<
|
|
26
|
-
|
|
26
|
+
DayPickerSingleProps,
|
|
27
27
|
| 'fromDate'
|
|
28
28
|
| 'toDate'
|
|
29
29
|
| 'locale'
|
package/src/types/Styles.ts
CHANGED
|
@@ -94,11 +94,28 @@ export type StyledElement<T = string | React.CSSProperties> = {
|
|
|
94
94
|
readonly day_today: T;
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
+
/** These elements must not be in the `styles` or `classNames` records as they are styled via the `modifiersStyles` or `modifiersClassNames` pop */
|
|
98
|
+
export type InternalModifiersElement =
|
|
99
|
+
| 'day_outside'
|
|
100
|
+
| 'day_selected'
|
|
101
|
+
| 'day_disabled'
|
|
102
|
+
| 'day_hidden'
|
|
103
|
+
| 'day_range_start'
|
|
104
|
+
| 'day_range_end'
|
|
105
|
+
| 'day_range_middle'
|
|
106
|
+
| 'day_today';
|
|
107
|
+
|
|
97
108
|
/** The class names of each element. */
|
|
98
109
|
export type ClassNames = Partial<StyledElement<string>>;
|
|
99
110
|
|
|
100
|
-
/**
|
|
101
|
-
|
|
111
|
+
/**
|
|
112
|
+
* The inline-styles of each styled element, to use with the `styles` prop. Day
|
|
113
|
+
* modifiers, such as `today` or `hidden`, should be styled using the
|
|
114
|
+
* `modifiersStyles` prop.
|
|
115
|
+
*/
|
|
116
|
+
export type Styles = Partial<
|
|
117
|
+
Omit<StyledElement<React.CSSProperties>, InternalModifiersElement>
|
|
118
|
+
>;
|
|
102
119
|
|
|
103
120
|
/** Props of a component that can be styled via classNames or inline-styles. */
|
|
104
121
|
export type StyledComponent = {
|