react-day-picker 8.0.4 → 8.0.5
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/dist/hooks/useDayRender/useDayRender.d.ts +1 -1
- package/dist/index.esm.js +3 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/react-day-picker.min.js +1 -0
- package/dist/style.css +11 -10
- package/dist/style.module.css +11 -10
- package/package.json +3 -3
- package/src/components/Navigation/Navigation.test.tsx +6 -6
- package/src/components/Navigation/Navigation.tsx +2 -2
- package/src/hooks/useDayRender/useDayRender.test.tsx +1 -1
- package/src/hooks/useDayRender/useDayRender.tsx +2 -2
- package/src/style.css +11 -10
package/dist/style.css
CHANGED
|
@@ -55,22 +55,23 @@
|
|
|
55
55
|
border: 2px solid transparent;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
.rdp-button[disabled] {
|
|
58
|
+
.rdp-button[aria-disabled='true'] {
|
|
59
59
|
opacity: 0.25;
|
|
60
|
+
pointer-events: none;
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
.rdp-button:not([disabled]) {
|
|
63
|
+
.rdp-button:not([aria-disabled='true']) {
|
|
63
64
|
cursor: pointer;
|
|
64
65
|
}
|
|
65
66
|
|
|
66
|
-
.rdp-button:focus
|
|
67
|
-
.rdp-button:active
|
|
67
|
+
.rdp-button:focus,
|
|
68
|
+
.rdp-button:active {
|
|
68
69
|
color: inherit;
|
|
69
70
|
border: var(--rdp-outline);
|
|
70
71
|
background-color: var(--rdp-background-color);
|
|
71
72
|
}
|
|
72
73
|
|
|
73
|
-
.rdp-button:hover:not([disabled]) {
|
|
74
|
+
.rdp-button:hover:not([aria-disabled='true']) {
|
|
74
75
|
background-color: var(--rdp-background-color);
|
|
75
76
|
}
|
|
76
77
|
|
|
@@ -269,15 +270,15 @@
|
|
|
269
270
|
font-weight: bold;
|
|
270
271
|
}
|
|
271
272
|
|
|
272
|
-
.rdp-day_selected:not([disabled]),
|
|
273
|
-
.rdp-day_selected:focus:not([disabled]),
|
|
274
|
-
.rdp-day_selected:active:not([disabled]),
|
|
275
|
-
.rdp-day_selected:hover:not([disabled]) {
|
|
273
|
+
.rdp-day_selected:not([aria-disabled='true']),
|
|
274
|
+
.rdp-day_selected:focus:not([aria-disabled='true']),
|
|
275
|
+
.rdp-day_selected:active:not([aria-disabled='true']),
|
|
276
|
+
.rdp-day_selected:hover:not([aria-disabled='true']) {
|
|
276
277
|
color: white;
|
|
277
278
|
background-color: var(--rdp-accent-color);
|
|
278
279
|
}
|
|
279
280
|
|
|
280
|
-
.rdp-day_selected:focus:not([disabled]) {
|
|
281
|
+
.rdp-day_selected:focus:not([aria-disabled='true']) {
|
|
281
282
|
border: var(--rdp-outline-selected);
|
|
282
283
|
}
|
|
283
284
|
|
package/dist/style.module.css
CHANGED
|
@@ -55,22 +55,23 @@
|
|
|
55
55
|
border: 2px solid transparent;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
.button[disabled] {
|
|
58
|
+
.button[aria-disabled='true'] {
|
|
59
59
|
opacity: 0.25;
|
|
60
|
+
pointer-events: none;
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
.button:not([disabled]) {
|
|
63
|
+
.button:not([aria-disabled='true']) {
|
|
63
64
|
cursor: pointer;
|
|
64
65
|
}
|
|
65
66
|
|
|
66
|
-
.button:focus
|
|
67
|
-
.button:active
|
|
67
|
+
.button:focus,
|
|
68
|
+
.button:active {
|
|
68
69
|
color: inherit;
|
|
69
70
|
border: var(--rdp-outline);
|
|
70
71
|
background-color: var(--rdp-background-color);
|
|
71
72
|
}
|
|
72
73
|
|
|
73
|
-
.button:hover:not([disabled]) {
|
|
74
|
+
.button:hover:not([aria-disabled='true']) {
|
|
74
75
|
background-color: var(--rdp-background-color);
|
|
75
76
|
}
|
|
76
77
|
|
|
@@ -269,15 +270,15 @@
|
|
|
269
270
|
font-weight: bold;
|
|
270
271
|
}
|
|
271
272
|
|
|
272
|
-
.day_selected:not([disabled]),
|
|
273
|
-
.day_selected:focus:not([disabled]),
|
|
274
|
-
.day_selected:active:not([disabled]),
|
|
275
|
-
.day_selected:hover:not([disabled]) {
|
|
273
|
+
.day_selected:not([aria-disabled='true']),
|
|
274
|
+
.day_selected:focus:not([aria-disabled='true']),
|
|
275
|
+
.day_selected:active:not([aria-disabled='true']),
|
|
276
|
+
.day_selected:hover:not([aria-disabled='true']) {
|
|
276
277
|
color: white;
|
|
277
278
|
background-color: var(--rdp-accent-color);
|
|
278
279
|
}
|
|
279
280
|
|
|
280
|
-
.day_selected:focus:not([disabled]) {
|
|
281
|
+
.day_selected:focus:not([aria-disabled='true']) {
|
|
281
282
|
border: var(--rdp-outline-selected);
|
|
282
283
|
}
|
|
283
284
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-day-picker",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.5",
|
|
4
4
|
"description": "Customizable Date Picker for React",
|
|
5
5
|
"author": "Giampaolo Bellavite <io@gpbl.dev>",
|
|
6
6
|
"homepage": "http://react-day-picker.js.org",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"tsconfig.json"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@reach/auto-id": "
|
|
36
|
+
"@reach/auto-id": "0.16.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@rollup/plugin-alias": "^3.1.9",
|
|
40
|
-
"@rollup/plugin-commonjs": "^21.0
|
|
40
|
+
"@rollup/plugin-commonjs": "^21.1.0",
|
|
41
41
|
"@rollup/plugin-typescript": "^8.3.1",
|
|
42
42
|
"@testing-library/jest-dom": "^5.16.4",
|
|
43
43
|
"@testing-library/react": "^12.1.4",
|
|
@@ -108,11 +108,11 @@ describe('when the previous month is undefined', () => {
|
|
|
108
108
|
beforeEach(() => {
|
|
109
109
|
setup({ ...props, previousMonth: undefined }, dayPickerProps);
|
|
110
110
|
});
|
|
111
|
-
test('the previous button should be disabled', () => {
|
|
112
|
-
expect(getPrevButton()).
|
|
111
|
+
test('the previous button should be aria-disabled', () => {
|
|
112
|
+
expect(getPrevButton()).toHaveAttribute('aria-disabled', 'true');
|
|
113
113
|
});
|
|
114
|
-
test('the next button should be
|
|
115
|
-
expect(getNextButton()).
|
|
114
|
+
test('the next button should not be aria-disabled', () => {
|
|
115
|
+
expect(getNextButton()).not.toHaveAttribute('aria-disabled', 'true');
|
|
116
116
|
});
|
|
117
117
|
});
|
|
118
118
|
|
|
@@ -121,9 +121,9 @@ describe('when the next month is undefined', () => {
|
|
|
121
121
|
setup({ ...props, nextMonth: undefined }, dayPickerProps);
|
|
122
122
|
});
|
|
123
123
|
test('the previous button should be enabled', () => {
|
|
124
|
-
expect(getPrevButton()).
|
|
124
|
+
expect(getPrevButton()).not.toHaveAttribute('aria-disabled', 'true');
|
|
125
125
|
});
|
|
126
126
|
test('the next button should be disabled', () => {
|
|
127
|
-
expect(getNextButton()).
|
|
127
|
+
expect(getNextButton()).toHaveAttribute('aria-disabled', 'true');
|
|
128
128
|
});
|
|
129
129
|
});
|
|
@@ -60,7 +60,7 @@ export function Navigation(props: NavigationProps): JSX.Element {
|
|
|
60
60
|
aria-label={previousLabel}
|
|
61
61
|
className={previousClassName}
|
|
62
62
|
style={styles.nav_button_previous}
|
|
63
|
-
disabled={!props.previousMonth}
|
|
63
|
+
aria-disabled={!props.previousMonth}
|
|
64
64
|
onClick={props.onPreviousClick}
|
|
65
65
|
>
|
|
66
66
|
{dir === 'rtl' ? (
|
|
@@ -81,7 +81,7 @@ export function Navigation(props: NavigationProps): JSX.Element {
|
|
|
81
81
|
aria-label={nextLabel}
|
|
82
82
|
className={nextClassName}
|
|
83
83
|
style={styles.nav_button_next}
|
|
84
|
-
disabled={!props.nextMonth}
|
|
84
|
+
aria-disabled={!props.nextMonth}
|
|
85
85
|
onClick={props.onNextClick}
|
|
86
86
|
>
|
|
87
87
|
{dir === 'rtl' ? (
|
|
@@ -286,7 +286,7 @@ describe('when the day is disabled', () => {
|
|
|
286
286
|
setup(date, date, dayPickerProps);
|
|
287
287
|
});
|
|
288
288
|
test('the button should be disabled', () => {
|
|
289
|
-
expect(result.current.buttonProps
|
|
289
|
+
expect(result.current.buttonProps['aria-disabled']).toBe(true);
|
|
290
290
|
});
|
|
291
291
|
});
|
|
292
292
|
|
|
@@ -27,7 +27,7 @@ export type DayRender = {
|
|
|
27
27
|
activeModifiers: ActiveModifiers;
|
|
28
28
|
/** The props to apply to the button element (when `isButton` is true). */
|
|
29
29
|
buttonProps: StyledComponent &
|
|
30
|
-
Pick<ButtonProps, 'disabled' | 'aria-pressed' | 'tabIndex'> &
|
|
30
|
+
Pick<ButtonProps, 'aria-disabled' | 'aria-pressed' | 'tabIndex'> &
|
|
31
31
|
DayEventHandlers;
|
|
32
32
|
/** The props to apply to the div element (when `isButton` is false). */
|
|
33
33
|
divProps: StyledComponent;
|
|
@@ -104,7 +104,7 @@ export function useDayRender(
|
|
|
104
104
|
);
|
|
105
105
|
const buttonProps = {
|
|
106
106
|
...divProps,
|
|
107
|
-
disabled: activeModifiers.disabled,
|
|
107
|
+
['aria-disabled']: activeModifiers.disabled,
|
|
108
108
|
['aria-pressed']: activeModifiers.selected,
|
|
109
109
|
tabIndex: isFocusTarget ? 0 : -1,
|
|
110
110
|
...eventHandlers
|
package/src/style.css
CHANGED
|
@@ -55,22 +55,23 @@
|
|
|
55
55
|
border: 2px solid transparent;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
.rdp-button[disabled] {
|
|
58
|
+
.rdp-button[aria-disabled='true'] {
|
|
59
59
|
opacity: 0.25;
|
|
60
|
+
pointer-events: none;
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
.rdp-button:not([disabled]) {
|
|
63
|
+
.rdp-button:not([aria-disabled='true']) {
|
|
63
64
|
cursor: pointer;
|
|
64
65
|
}
|
|
65
66
|
|
|
66
|
-
.rdp-button:focus
|
|
67
|
-
.rdp-button:active
|
|
67
|
+
.rdp-button:focus,
|
|
68
|
+
.rdp-button:active {
|
|
68
69
|
color: inherit;
|
|
69
70
|
border: var(--rdp-outline);
|
|
70
71
|
background-color: var(--rdp-background-color);
|
|
71
72
|
}
|
|
72
73
|
|
|
73
|
-
.rdp-button:hover:not([disabled]) {
|
|
74
|
+
.rdp-button:hover:not([aria-disabled='true']) {
|
|
74
75
|
background-color: var(--rdp-background-color);
|
|
75
76
|
}
|
|
76
77
|
|
|
@@ -269,15 +270,15 @@
|
|
|
269
270
|
font-weight: bold;
|
|
270
271
|
}
|
|
271
272
|
|
|
272
|
-
.rdp-day_selected:not([disabled]),
|
|
273
|
-
.rdp-day_selected:focus:not([disabled]),
|
|
274
|
-
.rdp-day_selected:active:not([disabled]),
|
|
275
|
-
.rdp-day_selected:hover:not([disabled]) {
|
|
273
|
+
.rdp-day_selected:not([aria-disabled='true']),
|
|
274
|
+
.rdp-day_selected:focus:not([aria-disabled='true']),
|
|
275
|
+
.rdp-day_selected:active:not([aria-disabled='true']),
|
|
276
|
+
.rdp-day_selected:hover:not([aria-disabled='true']) {
|
|
276
277
|
color: white;
|
|
277
278
|
background-color: var(--rdp-accent-color);
|
|
278
279
|
}
|
|
279
280
|
|
|
280
|
-
.rdp-day_selected:focus:not([disabled]) {
|
|
281
|
+
.rdp-day_selected:focus:not([aria-disabled='true']) {
|
|
281
282
|
border: var(--rdp-outline-selected);
|
|
282
283
|
}
|
|
283
284
|
|