@atlaskit/calendar 14.2.1 → 14.3.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 +793 -780
- package/README.md +2 -1
- package/__perf__/examples.tsx +53 -70
- package/codemods/11.0.0-lite-mode.tsx +2 -2
- package/codemods/__tests__/11.0.0-lite-mode.tsx +21 -21
- package/codemods/__tests__/flatten-certain-inner-props-as-prop.tsx +29 -31
- package/codemods/__tests__/remove-inner-props.tsx +28 -28
- package/codemods/migrations/flatten-certain-inner-props-as-prop.tsx +3 -3
- package/codemods/utils.tsx +150 -174
- package/dist/cjs/calendar.js +8 -3
- package/dist/cjs/internal/components/date.js +7 -0
- package/dist/cjs/internal/components/header.js +5 -0
- package/dist/cjs/internal/components/week-day-grid.js +5 -0
- package/dist/cjs/internal/components/week-days.js +5 -0
- package/dist/cjs/internal/components/week-header.js +5 -0
- package/dist/cjs/internal/styles/date.js +2 -0
- package/dist/es2019/calendar.js +10 -2
- package/dist/es2019/internal/components/date.js +7 -0
- package/dist/es2019/internal/components/header.js +5 -0
- package/dist/es2019/internal/components/week-day-grid.js +4 -0
- package/dist/es2019/internal/components/week-days.js +5 -0
- package/dist/es2019/internal/components/week-header.js +5 -0
- package/dist/es2019/internal/styles/date.js +2 -0
- package/dist/esm/calendar.js +10 -2
- package/dist/esm/internal/components/date.js +7 -0
- package/dist/esm/internal/components/header.js +5 -0
- package/dist/esm/internal/components/week-day-grid.js +4 -0
- package/dist/esm/internal/components/week-days.js +5 -0
- package/dist/esm/internal/components/week-header.js +5 -0
- package/dist/esm/internal/styles/date.js +2 -0
- package/dist/types/internal/components/header.d.ts +1 -1
- package/dist/types/internal/components/week-day-grid.d.ts +4 -1
- package/dist/types/internal/components/week-days.d.ts +1 -1
- package/dist/types/internal/hooks/use-calendar-ref.d.ts +1 -1
- package/dist/types/internal/hooks/use-focusing.d.ts +1 -1
- package/dist/types/internal/hooks/use-handle-date-select.d.ts +1 -1
- package/dist/types/internal/styles/date.d.ts +1 -1
- package/dist/types/types.d.ts +2 -2
- package/dist/types-ts4.5/internal/components/header.d.ts +1 -1
- package/dist/types-ts4.5/internal/components/week-day-grid.d.ts +4 -1
- package/dist/types-ts4.5/internal/components/week-days.d.ts +1 -1
- package/dist/types-ts4.5/internal/hooks/use-calendar-ref.d.ts +1 -1
- package/dist/types-ts4.5/internal/hooks/use-focusing.d.ts +1 -1
- package/dist/types-ts4.5/internal/hooks/use-handle-date-select.d.ts +1 -1
- package/dist/types-ts4.5/internal/styles/date.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +2 -2
- package/package.json +98 -100
- package/report.api.md +77 -76
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
/**
|
|
3
|
+
* @jsxRuntime classic
|
|
4
|
+
*/
|
|
2
5
|
/** @jsx jsx */
|
|
3
6
|
import { memo, useState } from 'react';
|
|
7
|
+
|
|
8
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
4
9
|
import { jsx } from '@emotion/react';
|
|
5
10
|
import { IconButton } from '@atlaskit/button/new';
|
|
6
11
|
import Heading from '@atlaskit/heading';
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
*/
|
|
1
4
|
/** @jsx jsx */
|
|
2
5
|
import { memo } from 'react';
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
8
|
import { jsx } from '@emotion/react';
|
|
4
9
|
import Box from '@atlaskit/primitives/box';
|
|
5
10
|
import DateComponent from './date';
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
*/
|
|
1
4
|
/** @jsx jsx */
|
|
2
5
|
import { memo } from 'react';
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
8
|
import { jsx } from '@emotion/react';
|
|
4
9
|
import { Box, Text, xcss } from '@atlaskit/primitives';
|
|
5
10
|
import WeekDayGrid from './week-day-grid';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import { type default as React } from 'react';
|
|
2
2
|
import type { SelectEvent } from '../../types';
|
|
3
3
|
import type { ArrowKeys, DateObj } from '../types';
|
|
4
4
|
export default function useHandleDateSelect({ day: [dayValue], month: [monthValue], year: [yearValue], selected: [selectedValue, setSelectedValue], previous: [, setPreviouslySelectedValue], onSelect, navigate, }: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CSSObject } from '@emotion/react';
|
|
1
|
+
import { type CSSObject } from '@emotion/react';
|
|
2
2
|
export declare const dateCellStyles: () => CSSObject;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
2
|
-
import { UIAnalyticsEvent, WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
1
|
+
import { type CSSProperties } from 'react';
|
|
2
|
+
import { type UIAnalyticsEvent, type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
3
|
import type { ArrowKeys, DateObj, ISODate } from './internal/types';
|
|
4
4
|
export type WeekDay = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
5
5
|
export type TabIndex = -1 | 0;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import { type default as React } from 'react';
|
|
2
2
|
import type { SelectEvent } from '../../types';
|
|
3
3
|
import type { ArrowKeys, DateObj } from '../types';
|
|
4
4
|
export default function useHandleDateSelect({ day: [dayValue], month: [monthValue], year: [yearValue], selected: [selectedValue, setSelectedValue], previous: [, setPreviouslySelectedValue], onSelect, navigate, }: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CSSObject } from '@emotion/react';
|
|
1
|
+
import { type CSSObject } from '@emotion/react';
|
|
2
2
|
export declare const dateCellStyles: () => CSSObject;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
2
|
-
import { UIAnalyticsEvent, WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
1
|
+
import { type CSSProperties } from 'react';
|
|
2
|
+
import { type UIAnalyticsEvent, type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
3
|
import type { ArrowKeys, DateObj, ISODate } from './internal/types';
|
|
4
4
|
export type WeekDay = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
5
5
|
export type TabIndex = -1 | 0;
|
package/package.json
CHANGED
|
@@ -1,101 +1,99 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
101
|
-
}
|
|
2
|
+
"name": "@atlaskit/calendar",
|
|
3
|
+
"version": "14.3.0",
|
|
4
|
+
"description": "An interactive calendar for date selection experiences.",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"registry": "https://registry.npmjs.org/"
|
|
7
|
+
},
|
|
8
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
9
|
+
"author": "Atlassian Pty Ltd",
|
|
10
|
+
"license": "Apache-2.0",
|
|
11
|
+
"main": "dist/cjs/index.js",
|
|
12
|
+
"module": "dist/esm/index.js",
|
|
13
|
+
"module:es2019": "dist/es2019/index.js",
|
|
14
|
+
"types": "dist/types/index.d.ts",
|
|
15
|
+
"sideEffects": false,
|
|
16
|
+
"atlaskit:src": "src/index.tsx",
|
|
17
|
+
"atlassian": {
|
|
18
|
+
"team": "Design System Team",
|
|
19
|
+
"releaseModel": "continuous",
|
|
20
|
+
"productPushConsumption": [
|
|
21
|
+
"jira"
|
|
22
|
+
],
|
|
23
|
+
"website": {
|
|
24
|
+
"name": "Calendar",
|
|
25
|
+
"category": "Components"
|
|
26
|
+
},
|
|
27
|
+
"runReact18": true
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@atlaskit/analytics-next": "^9.3.0",
|
|
31
|
+
"@atlaskit/button": "^17.19.0",
|
|
32
|
+
"@atlaskit/ds-lib": "^2.3.0",
|
|
33
|
+
"@atlaskit/heading": "^2.4.0",
|
|
34
|
+
"@atlaskit/icon": "^22.4.0",
|
|
35
|
+
"@atlaskit/locale": "^2.7.0",
|
|
36
|
+
"@atlaskit/primitives": "^7.4.0",
|
|
37
|
+
"@atlaskit/theme": "^12.10.0",
|
|
38
|
+
"@atlaskit/tokens": "^1.51.0",
|
|
39
|
+
"@babel/runtime": "^7.0.0",
|
|
40
|
+
"@emotion/react": "^11.7.1",
|
|
41
|
+
"date-fns": "^2.17.0",
|
|
42
|
+
"react-uid": "^2.2.0"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"react": "^16.8.0 || ^17.0.0 || ~18.2.0"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@af/accessibility-testing": "*",
|
|
49
|
+
"@af/integration-testing": "*",
|
|
50
|
+
"@af/visual-regression": "*",
|
|
51
|
+
"@atlaskit/ssr": "*",
|
|
52
|
+
"@atlaskit/visual-regression": "*",
|
|
53
|
+
"@testing-library/dom": "^8.17.1",
|
|
54
|
+
"@testing-library/react": "^12.1.5",
|
|
55
|
+
"jest-in-case": "^1.0.2",
|
|
56
|
+
"jscodeshift": "^0.13.0",
|
|
57
|
+
"react-dom": "^16.8.0",
|
|
58
|
+
"react-test-renderer": "^16.8.0",
|
|
59
|
+
"storybook-addon-performance": "^0.16.0",
|
|
60
|
+
"typescript": "~5.4.2",
|
|
61
|
+
"wait-for-expect": "^1.2.0"
|
|
62
|
+
},
|
|
63
|
+
"techstack": {
|
|
64
|
+
"@atlassian/frontend": {
|
|
65
|
+
"import-structure": "atlassian-conventions"
|
|
66
|
+
},
|
|
67
|
+
"@repo/internal": {
|
|
68
|
+
"dom-events": "use-bind-event-listener",
|
|
69
|
+
"design-system": "v1",
|
|
70
|
+
"ui-components": [
|
|
71
|
+
"primitives",
|
|
72
|
+
"lite-mode"
|
|
73
|
+
],
|
|
74
|
+
"analytics": "analytics-next",
|
|
75
|
+
"design-tokens": [
|
|
76
|
+
"color",
|
|
77
|
+
"spacing"
|
|
78
|
+
],
|
|
79
|
+
"deprecation": "no-deprecated-imports",
|
|
80
|
+
"styling": [
|
|
81
|
+
"static",
|
|
82
|
+
"emotion"
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"typesVersions": {
|
|
87
|
+
">=4.5 <4.9": {
|
|
88
|
+
"*": [
|
|
89
|
+
"dist/types-ts4.5/*",
|
|
90
|
+
"dist/types-ts4.5/index.d.ts"
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"af:exports": {
|
|
95
|
+
"./types": "./src/entry-points/types.tsx",
|
|
96
|
+
".": "./src/index.tsx"
|
|
97
|
+
},
|
|
98
|
+
"homepage": "https://atlassian.design/components/calendar/"
|
|
99
|
+
}
|
package/report.api.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## API Report File for "@atlaskit/calendar"
|
|
4
4
|
|
|
5
|
-
> Do not edit this file. This report is auto-generated using
|
|
5
|
+
> Do not edit this file. This report is auto-generated using
|
|
6
|
+
> [API Extractor](https://api-extractor.com/).
|
|
6
7
|
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
8
|
|
|
8
9
|
### Table of contents
|
|
@@ -29,96 +30,96 @@ type ArrowKeys = 'down' | 'left' | 'right' | 'up';
|
|
|
29
30
|
|
|
30
31
|
// @public
|
|
31
32
|
const Calendar: MemoExoticComponent<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
33
|
+
ForwardRefExoticComponent<
|
|
34
|
+
Pick<
|
|
35
|
+
CalendarProps,
|
|
36
|
+
| 'analyticsContext'
|
|
37
|
+
| 'calendarRef'
|
|
38
|
+
| 'className'
|
|
39
|
+
| 'createAnalyticsEvent'
|
|
40
|
+
| 'day'
|
|
41
|
+
| 'defaultDay'
|
|
42
|
+
| 'defaultMonth'
|
|
43
|
+
| 'defaultPreviouslySelected'
|
|
44
|
+
| 'defaultSelected'
|
|
45
|
+
| 'defaultYear'
|
|
46
|
+
| 'disabled'
|
|
47
|
+
| 'disabledDateFilter'
|
|
48
|
+
| 'locale'
|
|
49
|
+
| 'maxDate'
|
|
50
|
+
| 'minDate'
|
|
51
|
+
| 'month'
|
|
52
|
+
| 'nextMonthLabel'
|
|
53
|
+
| 'onBlur'
|
|
54
|
+
| 'onChange'
|
|
55
|
+
| 'onFocus'
|
|
56
|
+
| 'onSelect'
|
|
57
|
+
| 'previousMonthLabel'
|
|
58
|
+
| 'previouslySelected'
|
|
59
|
+
| 'selected'
|
|
60
|
+
| 'style'
|
|
61
|
+
| 'tabIndex'
|
|
62
|
+
| 'testId'
|
|
63
|
+
| 'today'
|
|
64
|
+
| 'weekStartDay'
|
|
65
|
+
| 'year'
|
|
66
|
+
> &
|
|
67
|
+
RefAttributes<HTMLDivElement>
|
|
68
|
+
>
|
|
68
69
|
>;
|
|
69
70
|
export default Calendar;
|
|
70
71
|
|
|
71
72
|
// @public (undocumented)
|
|
72
73
|
export interface CalendarProps extends WithAnalyticsEventsProps {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
74
|
+
analyticsContext?: Record<string, any>;
|
|
75
|
+
// @internal
|
|
76
|
+
calendarRef?: React.Ref<CalendarRef>;
|
|
77
|
+
className?: string;
|
|
78
|
+
day?: number;
|
|
79
|
+
defaultDay?: number;
|
|
80
|
+
defaultMonth?: number;
|
|
81
|
+
defaultPreviouslySelected?: Array<string>;
|
|
82
|
+
defaultSelected?: Array<string>;
|
|
83
|
+
defaultYear?: number;
|
|
84
|
+
disabled?: Array<string>;
|
|
85
|
+
disabledDateFilter?: (date: string) => boolean;
|
|
86
|
+
locale?: string;
|
|
87
|
+
maxDate?: string;
|
|
88
|
+
minDate?: string;
|
|
89
|
+
month?: number;
|
|
90
|
+
nextMonthLabel?: string;
|
|
91
|
+
onBlur?: React.FocusEventHandler;
|
|
92
|
+
onChange?: (event: ChangeEvent, analyticsEvent: UIAnalyticsEvent) => void;
|
|
93
|
+
onFocus?: React.FocusEventHandler;
|
|
94
|
+
onSelect?: (event: SelectEvent, analyticsEvent: UIAnalyticsEvent) => void;
|
|
95
|
+
previouslySelected?: Array<string>;
|
|
96
|
+
previousMonthLabel?: string;
|
|
97
|
+
selected?: Array<string>;
|
|
98
|
+
style?: CSSProperties;
|
|
99
|
+
tabIndex?: TabIndex;
|
|
100
|
+
testId?: string;
|
|
101
|
+
today?: string;
|
|
102
|
+
weekStartDay?: WeekDay;
|
|
103
|
+
year?: number;
|
|
103
104
|
}
|
|
104
105
|
|
|
105
106
|
// @public (undocumented)
|
|
106
107
|
export interface CalendarRef {
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
// (undocumented)
|
|
109
|
+
navigate: (type: ArrowKeys) => void;
|
|
109
110
|
}
|
|
110
111
|
|
|
111
112
|
// @public (undocumented)
|
|
112
113
|
export type ChangeEvent = {
|
|
113
|
-
|
|
114
|
-
|
|
114
|
+
iso: ISODate;
|
|
115
|
+
type: 'down' | 'left' | 'next' | 'prev' | 'right' | 'up';
|
|
115
116
|
} & DateObj;
|
|
116
117
|
|
|
117
118
|
// @public (undocumented)
|
|
118
119
|
type DateObj = {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
day: number;
|
|
121
|
+
month: number;
|
|
122
|
+
year: number;
|
|
122
123
|
};
|
|
123
124
|
|
|
124
125
|
// @public (undocumented)
|
|
@@ -126,7 +127,7 @@ type ISODate = string;
|
|
|
126
127
|
|
|
127
128
|
// @public (undocumented)
|
|
128
129
|
export type SelectEvent = {
|
|
129
|
-
|
|
130
|
+
iso: ISODate;
|
|
130
131
|
} & DateObj;
|
|
131
132
|
|
|
132
133
|
// @public (undocumented)
|
|
@@ -146,7 +147,7 @@ type WeekDay = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
|
146
147
|
|
|
147
148
|
```json
|
|
148
149
|
{
|
|
149
|
-
|
|
150
|
+
"react": "^16.8.0"
|
|
150
151
|
}
|
|
151
152
|
```
|
|
152
153
|
|