@react-aria/calendar 3.0.1 → 3.0.3
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/main.js.map +1 -1
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +4 -4
- package/dist/types.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/index.ts +1 -1
- package/src/useCalendar.ts +2 -2
- package/src/useCalendarBase.ts +2 -2
- package/src/useRangeCalendar.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/calendar",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@babel/runtime": "^7.6.2",
|
|
21
21
|
"@internationalized/date": "^3.0.1",
|
|
22
|
-
"@react-aria/i18n": "^3.
|
|
23
|
-
"@react-aria/interactions": "^3.
|
|
22
|
+
"@react-aria/i18n": "^3.6.1",
|
|
23
|
+
"@react-aria/interactions": "^3.12.0",
|
|
24
24
|
"@react-aria/live-announcer": "^3.1.1",
|
|
25
|
-
"@react-aria/utils": "^3.
|
|
26
|
-
"@react-stately/calendar": "^3.0.
|
|
27
|
-
"@react-types/button": "^3.6.
|
|
28
|
-
"@react-types/calendar": "^3.0.
|
|
29
|
-
"@react-types/shared": "^3.
|
|
25
|
+
"@react-aria/utils": "^3.14.0",
|
|
26
|
+
"@react-stately/calendar": "^3.0.3",
|
|
27
|
+
"@react-types/button": "^3.6.2",
|
|
28
|
+
"@react-types/calendar": "^3.0.3",
|
|
29
|
+
"@react-types/shared": "^3.15.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "9202ef59e8c104dd06ffe33148445ef7932a5d1b"
|
|
39
39
|
}
|
package/src/index.ts
CHANGED
|
@@ -15,7 +15,7 @@ export {useRangeCalendar} from './useRangeCalendar';
|
|
|
15
15
|
export {useCalendarGrid} from './useCalendarGrid';
|
|
16
16
|
export {useCalendarCell} from './useCalendarCell';
|
|
17
17
|
|
|
18
|
-
export type {CalendarProps, RangeCalendarProps} from '@react-types/calendar';
|
|
18
|
+
export type {AriaCalendarProps, AriaRangeCalendarProps, CalendarProps, RangeCalendarProps} from '@react-types/calendar';
|
|
19
19
|
export type {CalendarAria} from './useCalendarBase';
|
|
20
20
|
export type {AriaCalendarGridProps, CalendarGridAria} from './useCalendarGrid';
|
|
21
21
|
export type {AriaCalendarCellProps, CalendarCellAria} from './useCalendarCell';
|
package/src/useCalendar.ts
CHANGED
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
import {AriaCalendarProps, DateValue} from '@react-types/calendar';
|
|
13
14
|
import {CalendarAria, useCalendarBase} from './useCalendarBase';
|
|
14
|
-
import {CalendarProps, DateValue} from '@react-types/calendar';
|
|
15
15
|
import {CalendarState} from '@react-stately/calendar';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Provides the behavior and accessibility implementation for a calendar component.
|
|
19
19
|
* A calendar displays one or more date grids and allows users to select a single date.
|
|
20
20
|
*/
|
|
21
|
-
export function useCalendar<T extends DateValue>(props:
|
|
21
|
+
export function useCalendar<T extends DateValue>(props: AriaCalendarProps<T>, state: CalendarState): CalendarAria {
|
|
22
22
|
return useCalendarBase(props, state);
|
|
23
23
|
}
|
package/src/useCalendarBase.ts
CHANGED
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
|
|
13
13
|
import {announce} from '@react-aria/live-announcer';
|
|
14
14
|
import {AriaButtonProps} from '@react-types/button';
|
|
15
|
+
import {AriaLabelingProps, DOMAttributes} from '@react-types/shared';
|
|
15
16
|
import {CalendarPropsBase} from '@react-types/calendar';
|
|
16
17
|
import {CalendarState, RangeCalendarState} from '@react-stately/calendar';
|
|
17
|
-
import {DOMAttributes} from '@react-types/shared';
|
|
18
18
|
import {DOMProps} from '@react-types/shared';
|
|
19
19
|
import {filterDOMProps, mergeProps, useLabels, useSlotId, useUpdateEffect} from '@react-aria/utils';
|
|
20
20
|
import {hookData, useSelectedDateDescription, useVisibleRangeDescription} from './utils';
|
|
@@ -36,7 +36,7 @@ export interface CalendarAria {
|
|
|
36
36
|
title: string
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
export function useCalendarBase(props: CalendarPropsBase & DOMProps, state: CalendarState | RangeCalendarState): CalendarAria {
|
|
39
|
+
export function useCalendarBase(props: CalendarPropsBase & DOMProps & AriaLabelingProps, state: CalendarState | RangeCalendarState): CalendarAria {
|
|
40
40
|
let stringFormatter = useLocalizedStringFormatter(intlMessages);
|
|
41
41
|
let domProps = filterDOMProps(props);
|
|
42
42
|
|
package/src/useRangeCalendar.ts
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
import {AriaRangeCalendarProps, DateValue} from '@react-types/calendar';
|
|
13
14
|
import {CalendarAria, useCalendarBase} from './useCalendarBase';
|
|
14
|
-
import {DateValue, RangeCalendarProps} from '@react-types/calendar';
|
|
15
15
|
import {FocusableElement} from '@react-types/shared';
|
|
16
16
|
import {RangeCalendarState} from '@react-stately/calendar';
|
|
17
17
|
import {RefObject, useRef} from 'react';
|
|
@@ -21,7 +21,7 @@ import {useEvent} from '@react-aria/utils';
|
|
|
21
21
|
* Provides the behavior and accessibility implementation for a range calendar component.
|
|
22
22
|
* A range calendar displays one or more date grids and allows users to select a contiguous range of dates.
|
|
23
23
|
*/
|
|
24
|
-
export function useRangeCalendar<T extends DateValue>(props:
|
|
24
|
+
export function useRangeCalendar<T extends DateValue>(props: AriaRangeCalendarProps<T>, state: RangeCalendarState, ref: RefObject<FocusableElement>): CalendarAria {
|
|
25
25
|
let res = useCalendarBase(props, state);
|
|
26
26
|
|
|
27
27
|
// We need to ignore virtual pointer events from VoiceOver due to these bugs.
|