@atlaskit/calendar 12.3.2 → 12.4.1
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 +16 -0
- package/dist/cjs/calendar.js +14 -14
- package/dist/cjs/internal/components/date.js +3 -3
- package/dist/cjs/internal/components/heading.js +11 -11
- package/dist/cjs/internal/components/week-days.js +5 -5
- package/dist/cjs/internal/components/week-header.js +5 -5
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/calendar.js +2 -2
- package/dist/es2019/internal/components/date.js +2 -2
- package/dist/es2019/internal/components/heading.js +1 -1
- package/dist/es2019/internal/components/week-days.js +1 -1
- package/dist/es2019/internal/components/week-header.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/calendar.js +2 -2
- package/dist/esm/internal/components/date.js +2 -2
- package/dist/esm/internal/components/heading.js +1 -1
- package/dist/esm/internal/components/week-days.js +1 -1
- package/dist/esm/internal/components/week-header.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/calendar.d.ts +1 -1
- package/dist/types/internal/styles/date.d.ts +1 -1
- package/dist/types-ts4.0/calendar.d.ts +13 -0
- package/dist/types-ts4.0/entry-points/types.d.ts +1 -0
- package/dist/types-ts4.0/index.d.ts +2 -0
- package/dist/types-ts4.0/internal/components/date.d.ts +19 -0
- package/dist/types-ts4.0/internal/components/heading.d.ts +14 -0
- package/dist/types-ts4.0/internal/components/week-days.d.ts +11 -0
- package/dist/types-ts4.0/internal/components/week-header.d.ts +8 -0
- package/dist/types-ts4.0/internal/constants.d.ts +5 -0
- package/dist/types-ts4.0/internal/hooks/use-calendar-ref.d.ts +5 -0
- package/dist/types-ts4.0/internal/hooks/use-controlled-date-state.d.ts +37 -0
- package/dist/types-ts4.0/internal/hooks/use-focusing.d.ts +8 -0
- package/dist/types-ts4.0/internal/hooks/use-get-weeks.d.ts +15 -0
- package/dist/types-ts4.0/internal/hooks/use-handle-date-change.d.ts +21 -0
- package/dist/types-ts4.0/internal/hooks/use-handle-date-select.d.ts +30 -0
- package/dist/types-ts4.0/internal/hooks/use-locale.d.ts +8 -0
- package/dist/types-ts4.0/internal/hooks/use-unique-id.d.ts +1 -0
- package/dist/types-ts4.0/internal/styles/date.d.ts +3 -0
- package/dist/types-ts4.0/internal/types.d.ts +26 -0
- package/dist/types-ts4.0/internal/utils/date-to-string.d.ts +6 -0
- package/dist/types-ts4.0/internal/utils/get-base-calendar.d.ts +10 -0
- package/dist/types-ts4.0/internal/utils/get-days-in-month.d.ts +1 -0
- package/dist/types-ts4.0/internal/utils/pad.d.ts +1 -0
- package/dist/types-ts4.0/types.d.ts +159 -0
- package/package.json +15 -8
- package/types/package.json +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/calendar
|
|
2
2
|
|
|
3
|
+
## 12.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
|
|
8
|
+
|
|
9
|
+
## 12.4.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`764726e020b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/764726e020b) - Updates `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behavior change.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 12.3.2
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/cjs/calendar.js
CHANGED
|
@@ -15,7 +15,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
15
15
|
|
|
16
16
|
var _react = require("react");
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _react2 = require("@emotion/react");
|
|
19
19
|
|
|
20
20
|
var _usePlatformLeafEventHandler = require("@atlaskit/analytics-next/usePlatformLeafEventHandler");
|
|
21
21
|
|
|
@@ -55,7 +55,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
55
55
|
|
|
56
56
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
57
57
|
|
|
58
|
-
var lightWrapperStyles = (0,
|
|
58
|
+
var lightWrapperStyles = (0, _react2.css)({
|
|
59
59
|
display: 'inline-block',
|
|
60
60
|
boxSizing: 'border-box',
|
|
61
61
|
padding: 16,
|
|
@@ -64,7 +64,7 @@ var lightWrapperStyles = (0, _core.css)({
|
|
|
64
64
|
outline: 'none',
|
|
65
65
|
userSelect: 'none'
|
|
66
66
|
});
|
|
67
|
-
var darkWrapperStyles = (0,
|
|
67
|
+
var darkWrapperStyles = (0, _react2.css)({
|
|
68
68
|
display: 'inline-block',
|
|
69
69
|
boxSizing: 'border-box',
|
|
70
70
|
padding: 16,
|
|
@@ -73,7 +73,7 @@ var darkWrapperStyles = (0, _core.css)({
|
|
|
73
73
|
outline: 'none',
|
|
74
74
|
userSelect: 'none'
|
|
75
75
|
});
|
|
76
|
-
var gridsContainerStyles = (0,
|
|
76
|
+
var gridsContainerStyles = (0, _react2.css)({
|
|
77
77
|
display: 'inline-block',
|
|
78
78
|
width: 289,
|
|
79
79
|
margin: 0,
|
|
@@ -83,7 +83,7 @@ var gridsContainerStyles = (0, _core.css)({
|
|
|
83
83
|
var analyticsAttributes = {
|
|
84
84
|
componentName: 'calendar',
|
|
85
85
|
packageName: "@atlaskit/calendar",
|
|
86
|
-
packageVersion: "12.
|
|
86
|
+
packageVersion: "12.4.1"
|
|
87
87
|
};
|
|
88
88
|
var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_ref, ref) {
|
|
89
89
|
var day = _ref.day,
|
|
@@ -229,7 +229,7 @@ var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_re
|
|
|
229
229
|
monthsLong = _useLocale.monthsLong,
|
|
230
230
|
daysShort = _useLocale.daysShort;
|
|
231
231
|
|
|
232
|
-
return (0,
|
|
232
|
+
return (0, _react2.jsx)("div", {
|
|
233
233
|
className: className,
|
|
234
234
|
style: style,
|
|
235
235
|
onBlur: handleContainerBlur,
|
|
@@ -238,17 +238,17 @@ var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_re
|
|
|
238
238
|
role: "presentation",
|
|
239
239
|
"data-testid": testId && "".concat(testId, "--container"),
|
|
240
240
|
ref: ref
|
|
241
|
-
}, (0,
|
|
241
|
+
}, (0, _react2.jsx)(_visuallyHidden.default, null, (0, _react2.jsx)("span", {
|
|
242
242
|
id: announceId,
|
|
243
243
|
"aria-live": "assertive",
|
|
244
244
|
"aria-relevant": "text"
|
|
245
|
-
}, announcerDate)), (0,
|
|
245
|
+
}, announcerDate)), (0, _react2.jsx)("div", {
|
|
246
246
|
css: !mode || mode === 'light' ? lightWrapperStyles : darkWrapperStyles,
|
|
247
247
|
"aria-describedby": announceId,
|
|
248
248
|
"aria-label": "calendar",
|
|
249
249
|
role: "grid",
|
|
250
250
|
tabIndex: tabIndex
|
|
251
|
-
}, (0,
|
|
251
|
+
}, (0, _react2.jsx)(_heading.default // The month number needs to be translated to index in the month
|
|
252
252
|
// name array e.g. 1 (January) -> 0
|
|
253
253
|
, {
|
|
254
254
|
monthLongTitle: monthsLong[monthValue - 1],
|
|
@@ -259,13 +259,13 @@ var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_re
|
|
|
259
259
|
handleClickPrev: handleClickPrev,
|
|
260
260
|
mode: mode,
|
|
261
261
|
testId: testId
|
|
262
|
-
}), (0,
|
|
262
|
+
}), (0, _react2.jsx)("div", {
|
|
263
263
|
css: gridsContainerStyles,
|
|
264
264
|
role: "presentation"
|
|
265
|
-
}, (0,
|
|
265
|
+
}, (0, _react2.jsx)(_weekHeader.default, {
|
|
266
266
|
daysShort: daysShort,
|
|
267
267
|
mode: mode
|
|
268
|
-
}), (0,
|
|
268
|
+
}), (0, _react2.jsx)(_weekDays.default, {
|
|
269
269
|
weeks: weeks,
|
|
270
270
|
handleClickDay: handleClickDay,
|
|
271
271
|
mode: mode,
|
|
@@ -283,9 +283,9 @@ var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_re
|
|
|
283
283
|
*/
|
|
284
284
|
|
|
285
285
|
var Calendar = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(function Calendar(props, ref) {
|
|
286
|
-
return (0,
|
|
286
|
+
return (0, _react2.jsx)(_components.default.Consumer, null, function (_ref2) {
|
|
287
287
|
var mode = _ref2.mode;
|
|
288
|
-
return (0,
|
|
288
|
+
return (0, _react2.jsx)(CalendarWithMode, (0, _extends2.default)({}, props, {
|
|
289
289
|
mode: mode,
|
|
290
290
|
ref: ref
|
|
291
291
|
}));
|
|
@@ -9,7 +9,7 @@ exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _react2 = require("@emotion/react");
|
|
13
13
|
|
|
14
14
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
15
15
|
|
|
@@ -66,9 +66,9 @@ var Date = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
|
66
66
|
}
|
|
67
67
|
}, [onClick]);
|
|
68
68
|
var dateCellStyles = (0, _react.useMemo)(function () {
|
|
69
|
-
return (0, _date.dateCellStyles)(mode);
|
|
69
|
+
return (0, _react2.css)((0, _date.dateCellStyles)(mode));
|
|
70
70
|
}, [mode]);
|
|
71
|
-
return (0,
|
|
71
|
+
return (0, _react2.jsx)("button", {
|
|
72
72
|
// eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
73
73
|
css: dateCellStyles,
|
|
74
74
|
"aria-selected": isSelected ? 'true' : 'false',
|
|
@@ -9,7 +9,7 @@ exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _react2 = require("@emotion/react");
|
|
13
13
|
|
|
14
14
|
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
15
15
|
|
|
@@ -24,7 +24,7 @@ var headingColor = {
|
|
|
24
24
|
light: "var(--ds-text, ".concat(_colors.N800, ")"),
|
|
25
25
|
dark: "var(--ds-text, ".concat(_colors.DN800, ")")
|
|
26
26
|
};
|
|
27
|
-
var headingStyles = (0,
|
|
27
|
+
var headingStyles = (0, _react2.css)({
|
|
28
28
|
display: 'flex',
|
|
29
29
|
padding: '0 0 13px 0',
|
|
30
30
|
color: "var(--ds-text, ".concat(_colors.N800, ")"),
|
|
@@ -33,17 +33,17 @@ var headingStyles = (0, _core.css)({
|
|
|
33
33
|
|
|
34
34
|
var getMonthAndYearStyles = function getMonthAndYearStyles() {
|
|
35
35
|
var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'light';
|
|
36
|
-
return (0,
|
|
36
|
+
return (0, _react2.css)({
|
|
37
37
|
flexBasis: '100%',
|
|
38
38
|
color: headingColor[mode],
|
|
39
39
|
textAlign: 'center'
|
|
40
40
|
});
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
var arrowLeftStyles = (0,
|
|
43
|
+
var arrowLeftStyles = (0, _react2.css)({
|
|
44
44
|
marginLeft: 8
|
|
45
45
|
});
|
|
46
|
-
var arrowRightStyles = (0,
|
|
46
|
+
var arrowRightStyles = (0, _react2.css)({
|
|
47
47
|
marginRight: 8
|
|
48
48
|
});
|
|
49
49
|
var Heading = /*#__PURE__*/(0, _react.memo)(function Heading(_ref) {
|
|
@@ -60,34 +60,34 @@ var Heading = /*#__PURE__*/(0, _react.memo)(function Heading(_ref) {
|
|
|
60
60
|
var monthAndYearStyles = (0, _react.useMemo)(function () {
|
|
61
61
|
return getMonthAndYearStyles(mode);
|
|
62
62
|
}, [mode]);
|
|
63
|
-
return (0,
|
|
63
|
+
return (0, _react2.jsx)("div", {
|
|
64
64
|
css: headingStyles,
|
|
65
65
|
"aria-hidden": "true"
|
|
66
|
-
}, (0,
|
|
66
|
+
}, (0, _react2.jsx)(_standardButton.default, {
|
|
67
67
|
css: arrowLeftStyles,
|
|
68
68
|
appearance: "subtle",
|
|
69
69
|
spacing: "none",
|
|
70
70
|
tabIndex: -1,
|
|
71
71
|
onClick: handleClickPrev,
|
|
72
72
|
testId: testId && "".concat(testId, "--previous-month"),
|
|
73
|
-
iconBefore: (0,
|
|
73
|
+
iconBefore: (0, _react2.jsx)(_chevronLeftLarge.default, {
|
|
74
74
|
label: previousMonthLabel,
|
|
75
75
|
size: "medium",
|
|
76
76
|
primaryColor: "var(--ds-text-subtlest, ".concat(_colors.N70, ")"),
|
|
77
77
|
testId: testId && "".concat(testId, "--previous-month-icon")
|
|
78
78
|
})
|
|
79
|
-
}), (0,
|
|
79
|
+
}), (0, _react2.jsx)("div", {
|
|
80
80
|
// eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
81
81
|
css: monthAndYearStyles,
|
|
82
82
|
"data-testid": testId && "".concat(testId, "--current-month-year")
|
|
83
|
-
}, "".concat(monthLongTitle, " ").concat(year)), (0,
|
|
83
|
+
}, "".concat(monthLongTitle, " ").concat(year)), (0, _react2.jsx)(_standardButton.default, {
|
|
84
84
|
css: arrowRightStyles,
|
|
85
85
|
appearance: "subtle",
|
|
86
86
|
spacing: "none",
|
|
87
87
|
tabIndex: -1,
|
|
88
88
|
onClick: handleClickNext,
|
|
89
89
|
testId: testId && "".concat(testId, "--next-month"),
|
|
90
|
-
iconBefore: (0,
|
|
90
|
+
iconBefore: (0, _react2.jsx)(_chevronRightLarge.default, {
|
|
91
91
|
label: nextMonthLabel,
|
|
92
92
|
size: "medium",
|
|
93
93
|
primaryColor: "var(--ds-text-subtlest, ".concat(_colors.N70, ")"),
|
|
@@ -9,12 +9,12 @@ exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _react2 = require("@emotion/react");
|
|
13
13
|
|
|
14
14
|
var _date = _interopRequireDefault(require("./date"));
|
|
15
15
|
|
|
16
16
|
/** @jsx jsx */
|
|
17
|
-
var daysGridStyles = (0,
|
|
17
|
+
var daysGridStyles = (0, _react2.css)({
|
|
18
18
|
display: 'grid',
|
|
19
19
|
gridTemplateColumns: 'repeat(7, 1fr)',
|
|
20
20
|
border: 0
|
|
@@ -24,16 +24,16 @@ var WeekDays = /*#__PURE__*/(0, _react.memo)(function WeekDays(_ref) {
|
|
|
24
24
|
handleClickDay = _ref.handleClickDay,
|
|
25
25
|
mode = _ref.mode,
|
|
26
26
|
testId = _ref.testId;
|
|
27
|
-
return (0,
|
|
27
|
+
return (0, _react2.jsx)("div", {
|
|
28
28
|
role: "grid",
|
|
29
29
|
"data-testid": testId && "".concat(testId, "--month")
|
|
30
30
|
}, weeks.map(function (week) {
|
|
31
|
-
return (0,
|
|
31
|
+
return (0, _react2.jsx)("div", {
|
|
32
32
|
role: "row",
|
|
33
33
|
key: week.id,
|
|
34
34
|
css: daysGridStyles
|
|
35
35
|
}, week.values.map(function (weekDay) {
|
|
36
|
-
return (0,
|
|
36
|
+
return (0, _react2.jsx)(_date.default, {
|
|
37
37
|
key: weekDay.id,
|
|
38
38
|
isDisabled: weekDay.isDisabled,
|
|
39
39
|
isFocused: weekDay.isFocused,
|
|
@@ -7,17 +7,17 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _react2 = require("@emotion/react");
|
|
11
11
|
|
|
12
12
|
var _colors = require("@atlaskit/theme/colors");
|
|
13
13
|
|
|
14
14
|
/** @jsx jsx */
|
|
15
|
-
var dayNameGridStyles = (0,
|
|
15
|
+
var dayNameGridStyles = (0, _react2.css)({
|
|
16
16
|
display: 'grid',
|
|
17
17
|
gridTemplateColumns: 'repeat(7, 1fr)',
|
|
18
18
|
border: 0
|
|
19
19
|
});
|
|
20
|
-
var dayNameCellStyles = (0,
|
|
20
|
+
var dayNameCellStyles = (0, _react2.css)({
|
|
21
21
|
boxSizing: 'border-box',
|
|
22
22
|
minWidth: 40,
|
|
23
23
|
padding: '8px 8px',
|
|
@@ -31,10 +31,10 @@ var dayNameCellStyles = (0, _core.css)({
|
|
|
31
31
|
});
|
|
32
32
|
var WeekHeader = /*#__PURE__*/(0, _react.memo)(function WeekHeader(_ref) {
|
|
33
33
|
var daysShort = _ref.daysShort;
|
|
34
|
-
return (0,
|
|
34
|
+
return (0, _react2.jsx)("div", {
|
|
35
35
|
css: dayNameGridStyles
|
|
36
36
|
}, daysShort.map(function (shortDay) {
|
|
37
|
-
return (0,
|
|
37
|
+
return (0, _react2.jsx)("span", {
|
|
38
38
|
css: dayNameCellStyles,
|
|
39
39
|
key: shortDay
|
|
40
40
|
}, shortDay);
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/calendar.js
CHANGED
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
4
|
import { forwardRef, memo, useMemo } from 'react';
|
|
5
|
-
import { css, jsx } from '@emotion/
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
6
6
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
|
|
7
7
|
import noop from '@atlaskit/ds-lib/noop';
|
|
8
8
|
import { DN600, N0, N700, N900 } from '@atlaskit/theme/colors';
|
|
@@ -48,7 +48,7 @@ const gridsContainerStyles = css({
|
|
|
48
48
|
const analyticsAttributes = {
|
|
49
49
|
componentName: 'calendar',
|
|
50
50
|
packageName: "@atlaskit/calendar",
|
|
51
|
-
packageVersion: "12.
|
|
51
|
+
packageVersion: "12.4.1"
|
|
52
52
|
};
|
|
53
53
|
const CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar({
|
|
54
54
|
day,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { forwardRef, memo, useCallback, useEffect, useMemo, useRef } from 'react';
|
|
3
|
-
import { jsx } from '@emotion/
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import noop from '@atlaskit/ds-lib/noop';
|
|
5
5
|
import { dateCellStyles as getDateCellStyles } from '../styles/date';
|
|
6
6
|
const Date = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Date({
|
|
@@ -47,7 +47,7 @@ const Date = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Date({
|
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
}, [onClick]);
|
|
50
|
-
const dateCellStyles = useMemo(() => getDateCellStyles(mode), [mode]);
|
|
50
|
+
const dateCellStyles = useMemo(() => css(getDateCellStyles(mode)), [mode]);
|
|
51
51
|
return jsx("button", {
|
|
52
52
|
// eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
53
53
|
css: dateCellStyles,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { memo, useMemo } from 'react';
|
|
3
|
-
import { css, jsx } from '@emotion/
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import Button from '@atlaskit/button/standard-button';
|
|
5
5
|
import ArrowleftIcon from '@atlaskit/icon/glyph/chevron-left-large';
|
|
6
6
|
import ArrowrightIcon from '@atlaskit/icon/glyph/chevron-right-large';
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/calendar.js
CHANGED
|
@@ -8,7 +8,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
8
8
|
|
|
9
9
|
/** @jsx jsx */
|
|
10
10
|
import { forwardRef, memo, useMemo } from 'react';
|
|
11
|
-
import { css, jsx } from '@emotion/
|
|
11
|
+
import { css, jsx } from '@emotion/react';
|
|
12
12
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
|
|
13
13
|
import noop from '@atlaskit/ds-lib/noop';
|
|
14
14
|
import { DN600, N0, N700, N900 } from '@atlaskit/theme/colors';
|
|
@@ -54,7 +54,7 @@ var gridsContainerStyles = css({
|
|
|
54
54
|
var analyticsAttributes = {
|
|
55
55
|
componentName: 'calendar',
|
|
56
56
|
packageName: "@atlaskit/calendar",
|
|
57
|
-
packageVersion: "12.
|
|
57
|
+
packageVersion: "12.4.1"
|
|
58
58
|
};
|
|
59
59
|
var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
|
|
60
60
|
var day = _ref.day,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { forwardRef, memo, useCallback, useEffect, useMemo, useRef } from 'react';
|
|
3
|
-
import { jsx } from '@emotion/
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import noop from '@atlaskit/ds-lib/noop';
|
|
5
5
|
import { dateCellStyles as getDateCellStyles } from '../styles/date';
|
|
6
6
|
var Date = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Date(_ref, ref) {
|
|
@@ -53,7 +53,7 @@ var Date = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Date(_ref, ref) {
|
|
|
53
53
|
}
|
|
54
54
|
}, [onClick]);
|
|
55
55
|
var dateCellStyles = useMemo(function () {
|
|
56
|
-
return getDateCellStyles(mode);
|
|
56
|
+
return css(getDateCellStyles(mode));
|
|
57
57
|
}, [mode]);
|
|
58
58
|
return jsx("button", {
|
|
59
59
|
// eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { memo, useMemo } from 'react';
|
|
3
|
-
import { css, jsx } from '@emotion/
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import Button from '@atlaskit/button/standard-button';
|
|
5
5
|
import ArrowleftIcon from '@atlaskit/icon/glyph/chevron-left-large';
|
|
6
6
|
import ArrowrightIcon from '@atlaskit/icon/glyph/chevron-right-large';
|
package/dist/esm/version.json
CHANGED
package/dist/types/calendar.d.ts
CHANGED
|
@@ -9,5 +9,5 @@ import type { CalendarProps } from './types';
|
|
|
9
9
|
* - [Code](https://atlassian.design/components/calendar/code)
|
|
10
10
|
* - [Usage](https://atlassian.design/components/calendar/usage)
|
|
11
11
|
*/
|
|
12
|
-
declare const Calendar: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Pick<CalendarProps, "
|
|
12
|
+
declare const Calendar: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Pick<CalendarProps, "year" | "previousMonthLabel" | "nextMonthLabel" | "mode" | "testId" | "style" | "className" | "tabIndex" | "onFocus" | "onBlur" | "onChange" | "onSelect" | "disabled" | "selected" | "analyticsContext" | "day" | "defaultDay" | "defaultMonth" | "defaultPreviouslySelected" | "defaultSelected" | "defaultYear" | "disabledDateFilter" | "maxDate" | "minDate" | "month" | "previouslySelected" | "today" | "locale" | "weekStartDay" | "calendarRef" | "createAnalyticsEvent"> & import("react").RefAttributes<HTMLDivElement>>>;
|
|
13
13
|
export default Calendar;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { CalendarProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* __Calendar__
|
|
5
|
+
*
|
|
6
|
+
* A calendar is used for date selection.
|
|
7
|
+
*
|
|
8
|
+
* - [Examples](https://atlassian.design/components/calendar/examples)
|
|
9
|
+
* - [Code](https://atlassian.design/components/calendar/code)
|
|
10
|
+
* - [Usage](https://atlassian.design/components/calendar/usage)
|
|
11
|
+
*/
|
|
12
|
+
declare const Calendar: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Pick<CalendarProps, "year" | "previousMonthLabel" | "nextMonthLabel" | "mode" | "testId" | "style" | "className" | "tabIndex" | "onFocus" | "onBlur" | "onChange" | "onSelect" | "disabled" | "selected" | "analyticsContext" | "day" | "defaultDay" | "defaultMonth" | "defaultPreviouslySelected" | "defaultSelected" | "defaultYear" | "disabledDateFilter" | "maxDate" | "minDate" | "month" | "previouslySelected" | "today" | "locale" | "weekStartDay" | "calendarRef" | "createAnalyticsEvent"> & import("react").RefAttributes<HTMLDivElement>>>;
|
|
13
|
+
export default Calendar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { CalendarProps, ChangeEvent, SelectEvent, CalendarRef, WeekDay, } from '../types';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ThemeModes } from '@atlaskit/theme/types';
|
|
3
|
+
import type { DateObj } from '../types';
|
|
4
|
+
interface DateProps {
|
|
5
|
+
children: number;
|
|
6
|
+
isDisabled?: boolean;
|
|
7
|
+
isFocused?: boolean;
|
|
8
|
+
isToday?: boolean;
|
|
9
|
+
month: number;
|
|
10
|
+
onClick?: ({ day, month, year }: DateObj) => void;
|
|
11
|
+
isPreviouslySelected?: boolean;
|
|
12
|
+
isSelected?: boolean;
|
|
13
|
+
isSibling?: boolean;
|
|
14
|
+
year: number;
|
|
15
|
+
mode?: ThemeModes;
|
|
16
|
+
testId?: string;
|
|
17
|
+
}
|
|
18
|
+
declare const Date: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<DateProps & import("react").RefAttributes<HTMLButtonElement>>>;
|
|
19
|
+
export default Date;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ThemeModes } from '@atlaskit/theme/types';
|
|
3
|
+
interface HeadingProps {
|
|
4
|
+
monthLongTitle: string;
|
|
5
|
+
year: number;
|
|
6
|
+
previousMonthLabel?: string;
|
|
7
|
+
nextMonthLabel?: string;
|
|
8
|
+
handleClickNext?: () => void;
|
|
9
|
+
handleClickPrev?: () => void;
|
|
10
|
+
mode?: ThemeModes;
|
|
11
|
+
testId?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const Heading: import("react").NamedExoticComponent<HeadingProps>;
|
|
14
|
+
export default Heading;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ThemeModes } from '@atlaskit/theme/types';
|
|
3
|
+
import { DateObj, Week } from '../types';
|
|
4
|
+
interface WeekDaysProps {
|
|
5
|
+
weeks: Week[];
|
|
6
|
+
handleClickDay: (date: DateObj) => void;
|
|
7
|
+
mode?: ThemeModes;
|
|
8
|
+
testId?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const WeekDays: import("react").NamedExoticComponent<WeekDaysProps>;
|
|
11
|
+
export default WeekDays;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ThemeModes } from '@atlaskit/theme/types';
|
|
3
|
+
interface WeekHeaderProps {
|
|
4
|
+
daysShort: string[];
|
|
5
|
+
mode?: ThemeModes;
|
|
6
|
+
}
|
|
7
|
+
declare const WeekHeader: import("react").NamedExoticComponent<WeekHeaderProps>;
|
|
8
|
+
export default WeekHeader;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export default function useControlledDateState({ day, defaultDay, month, defaultMonth, year, defaultYear, today, selected, defaultSelected, previouslySelected, defaultPreviouslySelected, }: {
|
|
2
|
+
day?: number;
|
|
3
|
+
defaultDay: number;
|
|
4
|
+
month?: number;
|
|
5
|
+
defaultMonth: number;
|
|
6
|
+
year?: number;
|
|
7
|
+
defaultYear: number;
|
|
8
|
+
today?: string;
|
|
9
|
+
selected?: Array<string>;
|
|
10
|
+
defaultSelected: Array<string>;
|
|
11
|
+
previouslySelected?: Array<string>;
|
|
12
|
+
defaultPreviouslySelected: Array<string>;
|
|
13
|
+
}): {
|
|
14
|
+
readonly day: readonly [
|
|
15
|
+
number,
|
|
16
|
+
(newValue: number) => void
|
|
17
|
+
];
|
|
18
|
+
readonly month: readonly [
|
|
19
|
+
number,
|
|
20
|
+
(newValue: number) => void
|
|
21
|
+
];
|
|
22
|
+
readonly year: readonly [
|
|
23
|
+
number,
|
|
24
|
+
(newValue: number) => void
|
|
25
|
+
];
|
|
26
|
+
readonly today: readonly [
|
|
27
|
+
string
|
|
28
|
+
];
|
|
29
|
+
readonly selected: readonly [
|
|
30
|
+
string[],
|
|
31
|
+
(newValue: string[]) => void
|
|
32
|
+
];
|
|
33
|
+
readonly previous: readonly [
|
|
34
|
+
string[],
|
|
35
|
+
(newValue: string[]) => void
|
|
36
|
+
];
|
|
37
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export default function useFocusing({ onBlur, onFocus, }: {
|
|
3
|
+
onBlur: React.FocusEventHandler;
|
|
4
|
+
onFocus: React.FocusEventHandler;
|
|
5
|
+
}): {
|
|
6
|
+
handleContainerBlur: (event: React.FocusEvent) => void;
|
|
7
|
+
handleContainerFocus: (event: React.FocusEvent) => void;
|
|
8
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { WeekDay } from '../../types';
|
|
2
|
+
import type { Week } from '../types';
|
|
3
|
+
export default function useGetWeeks({ day, month, year, today, disabled, disabledDateFilter, minDate: minDateString, maxDate: maxDateString, selected, previouslySelected, weekStartDay, }: {
|
|
4
|
+
day: number;
|
|
5
|
+
month: number;
|
|
6
|
+
year: number;
|
|
7
|
+
today: string;
|
|
8
|
+
disabled?: string[];
|
|
9
|
+
disabledDateFilter?: (date: string) => boolean;
|
|
10
|
+
minDate?: string;
|
|
11
|
+
maxDate?: string;
|
|
12
|
+
selected: string[];
|
|
13
|
+
previouslySelected: string[];
|
|
14
|
+
weekStartDay: WeekDay;
|
|
15
|
+
}): Week[];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ChangeEvent } from '../../types';
|
|
2
|
+
import type { ArrowKeys } from '../types';
|
|
3
|
+
export default function useHandleDateChange({ day: [dayValue, setDayValue], month: [monthValue, setMonthValue], year: [yearValue, setYearValue], onChange, }: {
|
|
4
|
+
day: readonly [
|
|
5
|
+
number,
|
|
6
|
+
(newValue: number) => void
|
|
7
|
+
];
|
|
8
|
+
month: readonly [
|
|
9
|
+
number,
|
|
10
|
+
(newValue: number) => void
|
|
11
|
+
];
|
|
12
|
+
year: readonly [
|
|
13
|
+
number,
|
|
14
|
+
(newValue: number) => void
|
|
15
|
+
];
|
|
16
|
+
onChange: (event: ChangeEvent) => void;
|
|
17
|
+
}): {
|
|
18
|
+
navigate: (type: ArrowKeys) => void;
|
|
19
|
+
handleClickNext: () => void;
|
|
20
|
+
handleClickPrev: () => void;
|
|
21
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SelectEvent } from '../../types';
|
|
3
|
+
import type { ArrowKeys, DateObj } from '../types';
|
|
4
|
+
export default function useHandleDateSelect({ day: [dayValue], month: [monthValue], year: [yearValue], selected: [selectedValue, setSelectedValue], previous: [, setPreviouslySelectedValue], onSelect, navigate, }: {
|
|
5
|
+
day: readonly [
|
|
6
|
+
number,
|
|
7
|
+
(newValue: number) => void
|
|
8
|
+
];
|
|
9
|
+
month: readonly [
|
|
10
|
+
number,
|
|
11
|
+
(newValue: number) => void
|
|
12
|
+
];
|
|
13
|
+
year: readonly [
|
|
14
|
+
number,
|
|
15
|
+
(newValue: number) => void
|
|
16
|
+
];
|
|
17
|
+
selected: [
|
|
18
|
+
string[],
|
|
19
|
+
(newValue: string[]) => void
|
|
20
|
+
];
|
|
21
|
+
previous: [
|
|
22
|
+
unknown,
|
|
23
|
+
(newValue: string[]) => void
|
|
24
|
+
];
|
|
25
|
+
onSelect: (event: SelectEvent) => void;
|
|
26
|
+
navigate: (type: ArrowKeys) => void;
|
|
27
|
+
}): {
|
|
28
|
+
handleClickDay: ({ year, month, day }: DateObj) => void;
|
|
29
|
+
handleContainerKeyDown: (e: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useUniqueId(prefix: string): string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { WeekDay } from '../types';
|
|
2
|
+
export declare type ArrowKeys = 'left' | 'up' | 'right' | 'down';
|
|
3
|
+
export declare type DateObj = {
|
|
4
|
+
day: number;
|
|
5
|
+
month: number;
|
|
6
|
+
year: number;
|
|
7
|
+
};
|
|
8
|
+
export interface WeekDayState {
|
|
9
|
+
isDisabled: boolean;
|
|
10
|
+
isFocused: boolean;
|
|
11
|
+
isToday: boolean;
|
|
12
|
+
isPreviouslySelected: boolean;
|
|
13
|
+
isSelected: boolean;
|
|
14
|
+
isSiblingMonth: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface Week {
|
|
17
|
+
id: string;
|
|
18
|
+
values: Array<{
|
|
19
|
+
id: string;
|
|
20
|
+
} & DateObj & WeekDayState>;
|
|
21
|
+
}
|
|
22
|
+
export interface CalendarDate extends DateObj {
|
|
23
|
+
weekDay?: WeekDay;
|
|
24
|
+
siblingMonth?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare type ISODate = string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logic taken from https://github.com/WesSouza/calendar-base which is not maintained for quite sometime.
|
|
3
|
+
* This will help us fixing any issue we might get or any new functionality we might want to support.
|
|
4
|
+
* Not changing much code below. Just removed those parts which we don't need.
|
|
5
|
+
*/
|
|
6
|
+
import type { WeekDay } from '../../types';
|
|
7
|
+
import type { CalendarDate } from '../types';
|
|
8
|
+
export default function getBaseCalendar(year: number, month: number, { weekStartDay, }?: {
|
|
9
|
+
weekStartDay?: WeekDay;
|
|
10
|
+
}): CalendarDate[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function getDaysInMonth(year: number, month: number): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function pad(num: number): string;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { UIAnalyticsEvent, WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
|
+
import { ThemeModes } from '@atlaskit/theme/types';
|
|
4
|
+
import type { ArrowKeys, DateObj, ISODate } from './internal/types';
|
|
5
|
+
export declare type WeekDay = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
6
|
+
export declare type ChangeEvent = {
|
|
7
|
+
iso: ISODate;
|
|
8
|
+
type: 'left' | 'up' | 'right' | 'down' | 'prev' | 'next';
|
|
9
|
+
} & DateObj;
|
|
10
|
+
export declare type SelectEvent = {
|
|
11
|
+
iso: ISODate;
|
|
12
|
+
} & DateObj;
|
|
13
|
+
export interface CalendarProps extends WithAnalyticsEventsProps {
|
|
14
|
+
/**
|
|
15
|
+
* The number of the day currently focused. Places border around the date. 0 highlights no date.
|
|
16
|
+
*/
|
|
17
|
+
day?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Default for `day`.
|
|
20
|
+
*/
|
|
21
|
+
defaultDay?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Default for `month`.
|
|
24
|
+
*/
|
|
25
|
+
defaultMonth?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Default for `previouslySelected`.
|
|
28
|
+
*/
|
|
29
|
+
defaultPreviouslySelected?: Array<string>;
|
|
30
|
+
/**
|
|
31
|
+
* Default for `selected`.
|
|
32
|
+
*/
|
|
33
|
+
defaultSelected?: Array<string>;
|
|
34
|
+
/**
|
|
35
|
+
* Default for `year`.
|
|
36
|
+
*/
|
|
37
|
+
defaultYear?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Takes an array of dates as string in the format 'YYYY-MM-DD'. All dates provided are greyed out.
|
|
40
|
+
* This does not prevent these dates being selected.
|
|
41
|
+
*/
|
|
42
|
+
disabled?: Array<string>;
|
|
43
|
+
/**
|
|
44
|
+
* A filter function that takes a date string in the format 'YYYY-MM-DD' and returns true if that date should be disabled.
|
|
45
|
+
*/
|
|
46
|
+
disabledDateFilter?: (date: string) => boolean;
|
|
47
|
+
/**
|
|
48
|
+
* The latest enabled date
|
|
49
|
+
*/
|
|
50
|
+
maxDate?: string;
|
|
51
|
+
/**
|
|
52
|
+
* The earliest enabled date
|
|
53
|
+
*/
|
|
54
|
+
minDate?: string;
|
|
55
|
+
/**
|
|
56
|
+
* The number of the month (from 1 to 12) which the calendar should be on.
|
|
57
|
+
*/
|
|
58
|
+
month?: number;
|
|
59
|
+
/**
|
|
60
|
+
* The aria-label attribute associated with the next-month arrow.
|
|
61
|
+
*/
|
|
62
|
+
nextMonthLabel?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Function which is called when the calendar is no longer focused.
|
|
65
|
+
*/
|
|
66
|
+
onBlur?: React.FocusEventHandler;
|
|
67
|
+
/**
|
|
68
|
+
* Called when the calendar is navigated. This can be triggered by the keyboard, or by clicking the navigational buttons.
|
|
69
|
+
* The 'interface' property indicates the the direction the calendar was navigated whereas the 'iso' property is a string of the format YYYY-MM-DD.
|
|
70
|
+
*/
|
|
71
|
+
onChange?: (event: ChangeEvent, analyticsEvent: UIAnalyticsEvent) => void;
|
|
72
|
+
/**
|
|
73
|
+
* Called when the calendar receives focus. This could be from a mouse event on the container by tabbing into it.
|
|
74
|
+
*/
|
|
75
|
+
onFocus?: React.FocusEventHandler;
|
|
76
|
+
/**
|
|
77
|
+
* Function called when a day is clicked on. Calls with an object that has
|
|
78
|
+
* a day, month and year property as numbers, representing the date just clicked.
|
|
79
|
+
* It also has an 'iso' property, which is a string of the selected date in the
|
|
80
|
+
* format YYYY-MM-DD.
|
|
81
|
+
*/
|
|
82
|
+
onSelect?: (event: SelectEvent, analyticsEvent: UIAnalyticsEvent) => void;
|
|
83
|
+
/**
|
|
84
|
+
* Takes an array of dates as string in the format 'YYYY-MM-DD'. All dates
|
|
85
|
+
* provided are given a background color.
|
|
86
|
+
*/
|
|
87
|
+
previouslySelected?: Array<string>;
|
|
88
|
+
/**
|
|
89
|
+
* The aria-label attribute associated with the previous-month arrow.
|
|
90
|
+
*/
|
|
91
|
+
previousMonthLabel?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Takes an array of dates as string in the format 'YYYY-MM-DD'. All dates
|
|
94
|
+
* provided are given a background color.
|
|
95
|
+
*/
|
|
96
|
+
selected?: Array<string>;
|
|
97
|
+
/**
|
|
98
|
+
* Value of current day, as a string in the format 'YYYY-MM-DD'.
|
|
99
|
+
*/
|
|
100
|
+
today?: string;
|
|
101
|
+
/**
|
|
102
|
+
* Year to display the calendar for.
|
|
103
|
+
*/
|
|
104
|
+
year?: number;
|
|
105
|
+
/**
|
|
106
|
+
* BCP 47 language tag (e.g. ja-JP) that ensures dates are in the official format for the locale.
|
|
107
|
+
*/
|
|
108
|
+
locale?: string;
|
|
109
|
+
/**
|
|
110
|
+
* Additional information to be included in the `context` of analytics events.
|
|
111
|
+
*/
|
|
112
|
+
analyticsContext?: Record<string, any>;
|
|
113
|
+
/**
|
|
114
|
+
* Start day of the week for the calendar.
|
|
115
|
+
* - `0` sunday (default value)
|
|
116
|
+
* - `1` monday
|
|
117
|
+
* - `2` tuesday
|
|
118
|
+
* - `3` wednesday
|
|
119
|
+
* - `4` thursday
|
|
120
|
+
* - `5` friday
|
|
121
|
+
* - `6` saturday
|
|
122
|
+
*/
|
|
123
|
+
weekStartDay?: WeekDay;
|
|
124
|
+
/**
|
|
125
|
+
* A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests
|
|
126
|
+
*
|
|
127
|
+
* testId--container - Outermost container containing everything inside calendar
|
|
128
|
+
* testId--month - Container containing all available days for the month
|
|
129
|
+
* testId--previous-month - Button to show next month
|
|
130
|
+
* testId--next-month - Button to show previous month
|
|
131
|
+
* testId--current-month-year - Text containing the current month and year
|
|
132
|
+
* testId--selected-day - The currently selected day (may be missing if a date isn’t selected)
|
|
133
|
+
*/
|
|
134
|
+
testId?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Class name to apply to the calendar
|
|
137
|
+
*/
|
|
138
|
+
className?: string;
|
|
139
|
+
/**
|
|
140
|
+
* Style customization to apply to the calendar
|
|
141
|
+
*/
|
|
142
|
+
style?: CSSProperties;
|
|
143
|
+
/**
|
|
144
|
+
* @internal An additional ref which exposes Calendar's internal api's. We kept this for
|
|
145
|
+
* backward compatibility. PLEASE DO NOT USE THIS.
|
|
146
|
+
*/
|
|
147
|
+
calendarRef?: React.Ref<CalendarRef>;
|
|
148
|
+
/**
|
|
149
|
+
* @internal Legacy theme mode, can be either 'light' or 'dark'
|
|
150
|
+
*/
|
|
151
|
+
mode?: ThemeModes;
|
|
152
|
+
/**
|
|
153
|
+
* Tab index indicates if the calendar can be focused by keyboard or only programmatically.
|
|
154
|
+
*/
|
|
155
|
+
tabIndex?: number;
|
|
156
|
+
}
|
|
157
|
+
export interface CalendarRef {
|
|
158
|
+
navigate: (type: ArrowKeys) => void;
|
|
159
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/calendar",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.4.1",
|
|
4
4
|
"description": "An interactive calendar for date selection experiences.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -12,6 +12,13 @@
|
|
|
12
12
|
"module": "dist/esm/index.js",
|
|
13
13
|
"module:es2019": "dist/es2019/index.js",
|
|
14
14
|
"types": "dist/types/index.d.ts",
|
|
15
|
+
"typesVersions": {
|
|
16
|
+
">=4.0 <4.5": {
|
|
17
|
+
"*": [
|
|
18
|
+
"dist/types-ts4.0/*"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
15
22
|
"sideEffects": false,
|
|
16
23
|
"atlaskit:src": "src/index.tsx",
|
|
17
24
|
"atlassian": {
|
|
@@ -28,11 +35,11 @@
|
|
|
28
35
|
"@atlaskit/ds-lib": "^2.1.0",
|
|
29
36
|
"@atlaskit/icon": "^21.10.0",
|
|
30
37
|
"@atlaskit/locale": "^2.3.0",
|
|
31
|
-
"@atlaskit/theme": "^12.
|
|
38
|
+
"@atlaskit/theme": "^12.2.0",
|
|
32
39
|
"@atlaskit/tokens": "^0.10.0",
|
|
33
|
-
"@atlaskit/visually-hidden": "^1.
|
|
40
|
+
"@atlaskit/visually-hidden": "^1.1.0",
|
|
34
41
|
"@babel/runtime": "^7.0.0",
|
|
35
|
-
"@emotion/
|
|
42
|
+
"@emotion/react": "^11.7.1",
|
|
36
43
|
"date-fns": "^2.17.0",
|
|
37
44
|
"react-uid": "^2.2.0"
|
|
38
45
|
},
|
|
@@ -41,19 +48,19 @@
|
|
|
41
48
|
},
|
|
42
49
|
"devDependencies": {
|
|
43
50
|
"@atlaskit/docs": "*",
|
|
44
|
-
"@atlaskit/select": "^15.
|
|
51
|
+
"@atlaskit/select": "^15.7.0",
|
|
45
52
|
"@atlaskit/ssr": "*",
|
|
46
53
|
"@atlaskit/visual-regression": "*",
|
|
47
54
|
"@atlaskit/webdriver-runner": "*",
|
|
48
55
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
49
|
-
"@testing-library/dom": "^
|
|
50
|
-
"@testing-library/react": "^
|
|
56
|
+
"@testing-library/dom": "^8.17.1",
|
|
57
|
+
"@testing-library/react": "^12.1.5",
|
|
51
58
|
"jest-in-case": "^1.0.2",
|
|
52
59
|
"jscodeshift": "^0.13.0",
|
|
53
60
|
"react-dom": "^16.8.0",
|
|
54
61
|
"react-test-renderer": "^16.8.0",
|
|
55
62
|
"storybook-addon-performance": "^0.16.0",
|
|
56
|
-
"typescript": "4.
|
|
63
|
+
"typescript": "4.5.5",
|
|
57
64
|
"wait-for-expect": "^1.2.0"
|
|
58
65
|
},
|
|
59
66
|
"techstack": {
|
package/types/package.json
CHANGED
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/types.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/types.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/types.d.ts"
|
|
7
|
+
"types": "../dist/types/entry-points/types.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/entry-points/types.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|