@atlaskit/calendar 13.1.17 → 13.2.0
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/CHANGELOG.md +6 -0
- package/dist/cjs/calendar.js +46 -12
- package/dist/cjs/internal/components/date.js +50 -22
- package/dist/cjs/internal/components/header.js +26 -11
- package/dist/cjs/internal/components/week-days.js +7 -0
- package/dist/cjs/internal/components/week-header.js +14 -16
- package/dist/cjs/internal/hooks/use-get-weeks.js +6 -2
- package/dist/cjs/internal/hooks/use-handle-date-change.js +6 -1
- package/dist/cjs/internal/hooks/use-locale.js +5 -1
- package/dist/cjs/internal/styles/date.js +25 -27
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/calendar.js +45 -14
- package/dist/es2019/internal/components/date.js +50 -22
- package/dist/es2019/internal/components/header.js +26 -11
- package/dist/es2019/internal/components/week-days.js +7 -0
- package/dist/es2019/internal/components/week-header.js +5 -6
- package/dist/es2019/internal/hooks/use-get-weeks.js +6 -2
- package/dist/es2019/internal/hooks/use-handle-date-change.js +4 -1
- package/dist/es2019/internal/hooks/use-locale.js +3 -1
- package/dist/es2019/internal/styles/date.js +3 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/calendar.js +47 -13
- package/dist/esm/internal/components/date.js +50 -22
- package/dist/esm/internal/components/header.js +26 -11
- package/dist/esm/internal/components/week-days.js +7 -0
- package/dist/esm/internal/components/week-header.js +14 -16
- package/dist/esm/internal/hooks/use-get-weeks.js +6 -2
- package/dist/esm/internal/hooks/use-handle-date-change.js +6 -1
- package/dist/esm/internal/hooks/use-locale.js +5 -1
- package/dist/esm/internal/styles/date.js +24 -27
- package/dist/esm/version.json +1 -1
- package/dist/types/calendar.d.ts +1 -1
- package/dist/types/internal/components/date.d.ts +5 -0
- package/dist/types/internal/components/header.d.ts +5 -0
- package/dist/types/internal/components/week-days.d.ts +4 -0
- package/dist/types/internal/hooks/use-get-weeks.d.ts +2 -1
- package/dist/types/internal/hooks/use-handle-date-change.d.ts +2 -1
- package/dist/types/internal/hooks/use-locale.d.ts +1 -0
- package/dist/types/internal/types.d.ts +1 -0
- package/dist/types/types.d.ts +4 -2
- package/dist/types-ts4.5/calendar.d.ts +1 -1
- package/dist/types-ts4.5/internal/components/date.d.ts +5 -0
- package/dist/types-ts4.5/internal/components/header.d.ts +5 -0
- package/dist/types-ts4.5/internal/components/week-days.d.ts +4 -0
- package/dist/types-ts4.5/internal/hooks/use-get-weeks.d.ts +2 -1
- package/dist/types-ts4.5/internal/hooks/use-handle-date-change.d.ts +5 -1
- package/dist/types-ts4.5/internal/hooks/use-locale.d.ts +1 -0
- package/dist/types-ts4.5/internal/types.d.ts +1 -0
- package/dist/types-ts4.5/types.d.ts +4 -2
- package/package.json +11 -4
- package/report.api.md +4 -1
- package/tmp/api-report-tmp.d.ts +4 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ChangeEvent } from '../../types';
|
|
2
2
|
import type { ArrowKeys } from '../types';
|
|
3
|
-
export default function useHandleDateChange({ day: [dayValue, setDayValue], month: [monthValue, setMonthValue], year: [yearValue, setYearValue], onChange, }: {
|
|
3
|
+
export default function useHandleDateChange({ day: [dayValue, setDayValue], month: [monthValue, setMonthValue], year: [yearValue, setYearValue], shouldSetFocus: [shouldSetFocus, setShouldSetFocus], onChange, }: {
|
|
4
4
|
day: readonly [
|
|
5
5
|
number,
|
|
6
6
|
(newValue: number) => void
|
|
@@ -13,6 +13,10 @@ export default function useHandleDateChange({ day: [dayValue, setDayValue], mont
|
|
|
13
13
|
number,
|
|
14
14
|
(newValue: number) => void
|
|
15
15
|
];
|
|
16
|
+
shouldSetFocus: readonly [
|
|
17
|
+
boolean,
|
|
18
|
+
(newValue: boolean) => void
|
|
19
|
+
];
|
|
16
20
|
onChange: (event: ChangeEvent) => void;
|
|
17
21
|
}): {
|
|
18
22
|
navigate: (type: ArrowKeys) => void;
|
|
@@ -3,6 +3,7 @@ import { UIAnalyticsEvent, WithAnalyticsEventsProps } from '@atlaskit/analytics-
|
|
|
3
3
|
import { ThemeModes } from '@atlaskit/theme/types';
|
|
4
4
|
import type { ArrowKeys, DateObj, ISODate } from './internal/types';
|
|
5
5
|
export type WeekDay = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
6
|
+
export type TabIndex = -1 | 0;
|
|
6
7
|
export type ChangeEvent = {
|
|
7
8
|
iso: ISODate;
|
|
8
9
|
type: 'left' | 'up' | 'right' | 'down' | 'prev' | 'next';
|
|
@@ -150,9 +151,10 @@ export interface CalendarProps extends WithAnalyticsEventsProps {
|
|
|
150
151
|
*/
|
|
151
152
|
mode?: ThemeModes;
|
|
152
153
|
/**
|
|
153
|
-
*
|
|
154
|
+
* Indicates if the calendar can be focused by keyboard or only
|
|
155
|
+
* programmatically. Defaults to "0".
|
|
154
156
|
*/
|
|
155
|
-
tabIndex?:
|
|
157
|
+
tabIndex?: TabIndex;
|
|
156
158
|
}
|
|
157
159
|
export interface CalendarRef {
|
|
158
160
|
navigate: (type: ArrowKeys) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/calendar",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.2.0",
|
|
4
4
|
"description": "An interactive calendar for date selection experiences.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -32,15 +32,16 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
35
|
-
"@atlaskit/button": "^16.
|
|
35
|
+
"@atlaskit/button": "^16.9.0",
|
|
36
36
|
"@atlaskit/ds-explorations": "^2.2.0",
|
|
37
37
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
38
38
|
"@atlaskit/heading": "^1.3.0",
|
|
39
39
|
"@atlaskit/icon": "^21.12.0",
|
|
40
40
|
"@atlaskit/locale": "^2.5.0",
|
|
41
|
-
"@atlaskit/
|
|
41
|
+
"@atlaskit/platform-feature-flags": "*",
|
|
42
|
+
"@atlaskit/primitives": "^1.2.0",
|
|
42
43
|
"@atlaskit/theme": "^12.5.0",
|
|
43
|
-
"@atlaskit/tokens": "^1.
|
|
44
|
+
"@atlaskit/tokens": "^1.14.0",
|
|
44
45
|
"@atlaskit/visually-hidden": "^1.2.0",
|
|
45
46
|
"@babel/runtime": "^7.0.0",
|
|
46
47
|
"@emotion/react": "^11.7.1",
|
|
@@ -55,6 +56,7 @@
|
|
|
55
56
|
"@atlaskit/visual-regression": "*",
|
|
56
57
|
"@atlaskit/webdriver-runner": "*",
|
|
57
58
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
59
|
+
"@atlassian/feature-flags-test-utils": "*",
|
|
58
60
|
"@testing-library/dom": "^8.17.1",
|
|
59
61
|
"@testing-library/react": "^12.1.5",
|
|
60
62
|
"jest-in-case": "^1.0.2",
|
|
@@ -88,6 +90,11 @@
|
|
|
88
90
|
]
|
|
89
91
|
}
|
|
90
92
|
},
|
|
93
|
+
"platform-feature-flags": {
|
|
94
|
+
"platform.design-system-team.calendar-keyboard-accessibility_967h1": {
|
|
95
|
+
"type": "boolean"
|
|
96
|
+
}
|
|
97
|
+
},
|
|
91
98
|
"af:exports": {
|
|
92
99
|
"./types": "./src/entry-points/types.tsx",
|
|
93
100
|
".": "./src/index.tsx"
|
package/report.api.md
CHANGED
|
@@ -99,7 +99,7 @@ export interface CalendarProps extends WithAnalyticsEventsProps {
|
|
|
99
99
|
previousMonthLabel?: string;
|
|
100
100
|
selected?: Array<string>;
|
|
101
101
|
style?: CSSProperties;
|
|
102
|
-
tabIndex?:
|
|
102
|
+
tabIndex?: TabIndex;
|
|
103
103
|
testId?: string;
|
|
104
104
|
today?: string;
|
|
105
105
|
weekStartDay?: WeekDay;
|
|
@@ -133,6 +133,9 @@ export type SelectEvent = {
|
|
|
133
133
|
iso: ISODate;
|
|
134
134
|
} & DateObj;
|
|
135
135
|
|
|
136
|
+
// @public (undocumented)
|
|
137
|
+
type TabIndex = -1 | 0;
|
|
138
|
+
|
|
136
139
|
// @public (undocumented)
|
|
137
140
|
type WeekDay = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
138
141
|
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export interface CalendarProps extends WithAnalyticsEventsProps {
|
|
|
50
50
|
previousMonthLabel?: string;
|
|
51
51
|
selected?: Array<string>;
|
|
52
52
|
style?: CSSProperties;
|
|
53
|
-
tabIndex?:
|
|
53
|
+
tabIndex?: TabIndex;
|
|
54
54
|
testId?: string;
|
|
55
55
|
today?: string;
|
|
56
56
|
weekStartDay?: WeekDay;
|
|
@@ -84,6 +84,9 @@ export type SelectEvent = {
|
|
|
84
84
|
iso: ISODate;
|
|
85
85
|
} & DateObj;
|
|
86
86
|
|
|
87
|
+
// @public (undocumented)
|
|
88
|
+
type TabIndex = -1 | 0;
|
|
89
|
+
|
|
87
90
|
// @public (undocumented)
|
|
88
91
|
type WeekDay = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
89
92
|
|