@atlaskit/calendar 14.0.0 → 14.0.2
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 +12 -0
- package/dist/cjs/calendar.js +12 -11
- package/dist/cjs/internal/components/date.js +2 -4
- package/dist/cjs/internal/components/header.js +8 -11
- package/dist/cjs/internal/components/week-day-grid.js +2 -5
- package/dist/cjs/internal/components/week-days.js +3 -6
- package/dist/cjs/internal/components/week-header.js +9 -9
- package/dist/es2019/calendar.js +11 -11
- package/dist/es2019/internal/components/date.js +3 -4
- package/dist/es2019/internal/components/header.js +8 -10
- package/dist/es2019/internal/components/week-day-grid.js +2 -5
- package/dist/es2019/internal/components/week-days.js +3 -5
- package/dist/es2019/internal/components/week-header.js +9 -8
- package/dist/esm/calendar.js +11 -11
- package/dist/esm/internal/components/date.js +3 -4
- package/dist/esm/internal/components/header.js +8 -10
- package/dist/esm/internal/components/week-day-grid.js +2 -5
- package/dist/esm/internal/components/week-days.js +3 -5
- package/dist/esm/internal/components/week-header.js +9 -8
- package/package.json +6 -5
- package/tmp/api-report-tmp.d.ts +0 -92
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/calendar
|
|
2
2
|
|
|
3
|
+
## 14.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#58458](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58458) [`536478cdcf0b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/536478cdcf0b) - Made some tiny tweaks to the weekday header so its height is now an integer.
|
|
8
|
+
|
|
9
|
+
## 14.0.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 14.0.0
|
|
4
16
|
|
|
5
17
|
### Major Changes
|
package/dist/cjs/calendar.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* calendar.tsx generated by @compiled/babel-plugin v0.26.1 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -5,11 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
9
|
+
var _runtime = require("@compiled/react/runtime");
|
|
8
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
13
|
var _react = require("react");
|
|
12
|
-
var _react2 = require("@emotion/react");
|
|
13
14
|
var _usePlatformLeafEventHandler = require("@atlaskit/analytics-next/usePlatformLeafEventHandler");
|
|
14
15
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
15
16
|
var _primitives = require("@atlaskit/primitives");
|
|
@@ -26,7 +27,7 @@ var _useHandleDateSelect2 = _interopRequireDefault(require("./internal/hooks/use
|
|
|
26
27
|
var _useLocale2 = _interopRequireDefault(require("./internal/hooks/use-locale"));
|
|
27
28
|
var _useUniqueId = _interopRequireDefault(require("./internal/hooks/use-unique-id"));
|
|
28
29
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
29
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
30
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
30
31
|
var boxStyles = (0, _primitives.xcss)({
|
|
31
32
|
display: 'inline-block',
|
|
32
33
|
userSelect: 'none'
|
|
@@ -34,7 +35,7 @@ var boxStyles = (0, _primitives.xcss)({
|
|
|
34
35
|
var analyticsAttributes = {
|
|
35
36
|
componentName: 'calendar',
|
|
36
37
|
packageName: "@atlaskit/calendar",
|
|
37
|
-
packageVersion: "14.0.
|
|
38
|
+
packageVersion: "14.0.2"
|
|
38
39
|
};
|
|
39
40
|
var InnerCalendar = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_ref, ref) {
|
|
40
41
|
var day = _ref.day,
|
|
@@ -188,21 +189,21 @@ var InnerCalendar = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_ref,
|
|
|
188
189
|
return "".concat(monthsLong[previousMonth], " ").concat(showPreviousYear ? yearValue - 1 : yearValue);
|
|
189
190
|
};
|
|
190
191
|
var headerId = (0, _useUniqueId.default)('month-year-header');
|
|
191
|
-
return
|
|
192
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
192
193
|
className: className,
|
|
193
194
|
style: style,
|
|
194
195
|
onBlur: handleContainerBlur,
|
|
195
196
|
onFocus: handleContainerFocus,
|
|
196
197
|
"data-testid": testId && "".concat(testId, "--container"),
|
|
197
198
|
ref: ref
|
|
198
|
-
},
|
|
199
|
+
}, /*#__PURE__*/React.createElement(_primitives.Box, {
|
|
199
200
|
xcss: boxStyles,
|
|
200
201
|
padding: "space.200",
|
|
201
202
|
"aria-label": "calendar",
|
|
202
203
|
testId: testId && "".concat(testId, "--calendar")
|
|
203
|
-
},
|
|
204
|
+
}, /*#__PURE__*/React.createElement(_primitives.Stack, {
|
|
204
205
|
space: "space.150"
|
|
205
|
-
},
|
|
206
|
+
}, /*#__PURE__*/React.createElement(_header.default
|
|
206
207
|
// The month number needs to be translated to index in the month
|
|
207
208
|
// name array e.g. 1 (January) -> 0
|
|
208
209
|
, {
|
|
@@ -217,16 +218,16 @@ var InnerCalendar = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_ref,
|
|
|
217
218
|
headerId: headerId,
|
|
218
219
|
tabIndex: tabIndex,
|
|
219
220
|
testId: testId
|
|
220
|
-
}),
|
|
221
|
+
}), /*#__PURE__*/React.createElement(_primitives.Box, {
|
|
221
222
|
role: "grid",
|
|
222
223
|
tabIndex: tabIndex,
|
|
223
224
|
onKeyDown: handleContainerKeyDown,
|
|
224
225
|
"aria-labelledby": headerId,
|
|
225
226
|
testId: testId && "".concat(testId, "--calendar-dates")
|
|
226
|
-
},
|
|
227
|
+
}, /*#__PURE__*/React.createElement(_weekHeader.default, {
|
|
227
228
|
daysShort: daysShort,
|
|
228
229
|
testId: testId
|
|
229
|
-
}),
|
|
230
|
+
}), /*#__PURE__*/React.createElement(_weekDays.default, {
|
|
230
231
|
weeks: weeks,
|
|
231
232
|
handleClickDay: handleClickDay,
|
|
232
233
|
monthsLong: monthsLong,
|
|
@@ -246,7 +247,7 @@ var InnerCalendar = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_ref,
|
|
|
246
247
|
* - [Usage](https://atlassian.design/components/calendar/usage)
|
|
247
248
|
*/
|
|
248
249
|
var Calendar = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(function Calendar(props, ref) {
|
|
249
|
-
return
|
|
250
|
+
return /*#__PURE__*/React.createElement(InnerCalendar, (0, _extends2.default)({}, props, {
|
|
250
251
|
ref: ref
|
|
251
252
|
}));
|
|
252
253
|
}));
|
|
@@ -10,8 +10,6 @@ var _react2 = require("@emotion/react");
|
|
|
10
10
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
11
11
|
var _primitives = require("@atlaskit/primitives");
|
|
12
12
|
var _date = require("../styles/date");
|
|
13
|
-
/** @jsx jsx */
|
|
14
|
-
|
|
15
13
|
var Date = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(function Date(_ref2, _ref) {
|
|
16
14
|
var day = _ref2.children,
|
|
17
15
|
_ref2$isDisabled = _ref2.isDisabled,
|
|
@@ -70,10 +68,10 @@ var Date = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
|
70
68
|
}
|
|
71
69
|
}, [onClick]);
|
|
72
70
|
var dateCellStyles = (0, _react2.css)((0, _date.dateCellStyles)());
|
|
73
|
-
return
|
|
71
|
+
return /*#__PURE__*/React.createElement(_primitives.Grid, {
|
|
74
72
|
role: "gridcell",
|
|
75
73
|
alignItems: "center"
|
|
76
|
-
},
|
|
74
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
77
75
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
78
76
|
css: dateCellStyles,
|
|
79
77
|
"aria-current": isToday ? 'date' : undefined,
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _react = require("react");
|
|
10
|
-
var _react2 = require("@emotion/react");
|
|
11
10
|
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
12
11
|
var _heading = _interopRequireDefault(require("@atlaskit/heading"));
|
|
13
12
|
var _chevronLeftLarge = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-left-large"));
|
|
@@ -15,8 +14,6 @@ var _chevronRightLarge = _interopRequireDefault(require("@atlaskit/icon/glyph/ch
|
|
|
15
14
|
var _primitives = require("@atlaskit/primitives");
|
|
16
15
|
var _colors = require("@atlaskit/theme/colors");
|
|
17
16
|
var _useUniqueId = _interopRequireDefault(require("../../internal/hooks/use-unique-id"));
|
|
18
|
-
/** @jsx jsx */
|
|
19
|
-
|
|
20
17
|
var Header = /*#__PURE__*/(0, _react.memo)(function Header(_ref) {
|
|
21
18
|
var monthLongTitle = _ref.monthLongTitle,
|
|
22
19
|
year = _ref.year,
|
|
@@ -56,40 +53,40 @@ var Header = /*#__PURE__*/(0, _react.memo)(function Header(_ref) {
|
|
|
56
53
|
}
|
|
57
54
|
handleClickNext(e);
|
|
58
55
|
};
|
|
59
|
-
return
|
|
56
|
+
return /*#__PURE__*/React.createElement(_primitives.Box, {
|
|
60
57
|
paddingInline: "space.100"
|
|
61
|
-
},
|
|
58
|
+
}, /*#__PURE__*/React.createElement(_primitives.Inline, {
|
|
62
59
|
space: "space.0",
|
|
63
60
|
alignBlock: "center",
|
|
64
61
|
spread: "space-between"
|
|
65
|
-
},
|
|
62
|
+
}, /*#__PURE__*/React.createElement(_standardButton.default, {
|
|
66
63
|
appearance: "subtle",
|
|
67
64
|
spacing: "none",
|
|
68
65
|
tabIndex: tabIndex,
|
|
69
66
|
onClick: handlePrevMonthInteraction,
|
|
70
67
|
testId: testId && "".concat(testId, "--previous-month"),
|
|
71
|
-
iconBefore:
|
|
68
|
+
iconBefore: /*#__PURE__*/React.createElement(_chevronLeftLarge.default, {
|
|
72
69
|
label: "".concat(previousMonthLabel, ", ").concat(previousHeading),
|
|
73
70
|
size: "medium",
|
|
74
71
|
primaryColor: "var(--ds-icon, ".concat(_colors.N700, ")"),
|
|
75
72
|
testId: testId && "".concat(testId, "--previous-month-icon")
|
|
76
73
|
})
|
|
77
|
-
}),
|
|
74
|
+
}), /*#__PURE__*/React.createElement(_primitives.Box, {
|
|
78
75
|
"aria-live": hasInteractedWithMonth ? 'polite' : undefined,
|
|
79
76
|
id: announceId,
|
|
80
77
|
testId: testId && "".concat(testId, "--current-month-year--container")
|
|
81
|
-
},
|
|
78
|
+
}, /*#__PURE__*/React.createElement(_heading.default, {
|
|
82
79
|
level: "h400",
|
|
83
80
|
as: "h2",
|
|
84
81
|
id: headerId,
|
|
85
82
|
testId: testId && "".concat(testId, "--current-month-year")
|
|
86
|
-
}, "".concat(monthLongTitle, " ").concat(year))),
|
|
83
|
+
}, "".concat(monthLongTitle, " ").concat(year))), /*#__PURE__*/React.createElement(_standardButton.default, {
|
|
87
84
|
appearance: "subtle",
|
|
88
85
|
spacing: "none",
|
|
89
86
|
tabIndex: tabIndex,
|
|
90
87
|
onClick: handleNextMonthInteraction,
|
|
91
88
|
testId: testId && "".concat(testId, "--next-month"),
|
|
92
|
-
iconBefore:
|
|
89
|
+
iconBefore: /*#__PURE__*/React.createElement(_chevronRightLarge.default, {
|
|
93
90
|
label: "".concat(nextMonthLabel, ", ").concat(nextHeading),
|
|
94
91
|
size: "medium",
|
|
95
92
|
primaryColor: "var(--ds-icon, ".concat(_colors.N700, ")"),
|
|
@@ -4,10 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react = require("@emotion/react");
|
|
8
7
|
var _primitives = require("@atlaskit/primitives");
|
|
9
|
-
/** @jsx jsx */
|
|
10
|
-
|
|
11
8
|
/**
|
|
12
9
|
* __Week day grid__
|
|
13
10
|
*
|
|
@@ -18,12 +15,12 @@ var WeekDayGrid = function WeekDayGrid(_ref) {
|
|
|
18
15
|
var testId = _ref.testId,
|
|
19
16
|
children = _ref.children,
|
|
20
17
|
isHidden = _ref.isHidden;
|
|
21
|
-
var row =
|
|
18
|
+
var row = /*#__PURE__*/React.createElement(_primitives.Grid, {
|
|
22
19
|
testId: testId,
|
|
23
20
|
templateColumns: "repeat(7, minmax(max-content, 1fr))",
|
|
24
21
|
role: "row"
|
|
25
22
|
}, children);
|
|
26
|
-
return isHidden ?
|
|
23
|
+
return isHidden ? /*#__PURE__*/React.createElement("div", {
|
|
27
24
|
"aria-hidden": "true"
|
|
28
25
|
}, row) : row;
|
|
29
26
|
};
|
|
@@ -6,12 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
var _react2 = require("@emotion/react");
|
|
10
9
|
var _box = _interopRequireDefault(require("@atlaskit/primitives/box"));
|
|
11
10
|
var _date = _interopRequireDefault(require("./date"));
|
|
12
11
|
var _weekDayGrid = _interopRequireDefault(require("./week-day-grid"));
|
|
13
|
-
/** @jsx jsx */
|
|
14
|
-
|
|
15
12
|
var WeekDays = /*#__PURE__*/(0, _react.memo)(function WeekDays(_ref) {
|
|
16
13
|
var weeks = _ref.weeks,
|
|
17
14
|
handleClickDay = _ref.handleClickDay,
|
|
@@ -19,15 +16,15 @@ var WeekDays = /*#__PURE__*/(0, _react.memo)(function WeekDays(_ref) {
|
|
|
19
16
|
shouldSetFocus = _ref.shouldSetFocus,
|
|
20
17
|
tabIndex = _ref.tabIndex,
|
|
21
18
|
testId = _ref.testId;
|
|
22
|
-
return
|
|
19
|
+
return /*#__PURE__*/React.createElement(_box.default, {
|
|
23
20
|
role: "rowgroup",
|
|
24
21
|
testId: testId && "".concat(testId, "--month")
|
|
25
22
|
}, weeks.map(function (week, i) {
|
|
26
|
-
return
|
|
23
|
+
return /*#__PURE__*/React.createElement(_weekDayGrid.default, {
|
|
27
24
|
key: i,
|
|
28
25
|
testId: testId && "".concat(testId, "--week")
|
|
29
26
|
}, week.values.map(function (weekDay) {
|
|
30
|
-
return
|
|
27
|
+
return /*#__PURE__*/React.createElement(_date.default, {
|
|
31
28
|
key: "".concat(week.id, "-").concat(weekDay.id),
|
|
32
29
|
isDisabled: weekDay.isDisabled,
|
|
33
30
|
isFocused: weekDay.isFocused,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* week-header.tsx generated by @compiled/babel-plugin v0.26.1 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -5,13 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
9
|
+
var _runtime = require("@compiled/react/runtime");
|
|
8
10
|
var _react = require("react");
|
|
9
|
-
var _react2 = require("@emotion/react");
|
|
10
11
|
var _text = _interopRequireDefault(require("@atlaskit/ds-explorations/text"));
|
|
11
12
|
var _primitives = require("@atlaskit/primitives");
|
|
12
13
|
var _weekDayGrid = _interopRequireDefault(require("./week-day-grid"));
|
|
13
|
-
/** @jsx jsx */
|
|
14
|
-
|
|
15
14
|
var columnHeaderStyles = (0, _primitives.xcss)({
|
|
16
15
|
minWidth: 'size.400',
|
|
17
16
|
// Account for languages with short week day names
|
|
@@ -19,26 +18,27 @@ var columnHeaderStyles = (0, _primitives.xcss)({
|
|
|
19
18
|
// Account for languages with long week day names
|
|
20
19
|
textAlign: 'center',
|
|
21
20
|
lineHeight: '16px',
|
|
22
|
-
color: 'color.text.subtle'
|
|
21
|
+
color: 'color.text.subtle',
|
|
22
|
+
// Apply correct fallback to shortDay text
|
|
23
|
+
display: 'flex',
|
|
24
|
+
justifyContent: 'center'
|
|
23
25
|
});
|
|
24
|
-
|
|
25
26
|
var WeekHeader = /*#__PURE__*/(0, _react.memo)(function WeekHeader(_ref) {
|
|
26
27
|
var daysShort = _ref.daysShort,
|
|
27
28
|
testId = _ref.testId;
|
|
28
|
-
return
|
|
29
|
+
return /*#__PURE__*/React.createElement(_weekDayGrid.default, {
|
|
29
30
|
isHidden: true,
|
|
30
31
|
testId: testId && "".concat(testId, "--column-headers")
|
|
31
32
|
}, daysShort.map(function (shortDay) {
|
|
32
|
-
return
|
|
33
|
+
return /*#__PURE__*/React.createElement(_primitives.Box, {
|
|
33
34
|
padding: "space.100",
|
|
34
35
|
xcss: columnHeaderStyles,
|
|
35
36
|
key: shortDay,
|
|
36
37
|
role: "columnheader",
|
|
37
38
|
testId: testId && "".concat(testId, "--column-header")
|
|
38
|
-
},
|
|
39
|
+
}, /*#__PURE__*/React.createElement(_text.default, {
|
|
39
40
|
fontWeight: "bold",
|
|
40
41
|
fontSize: "size.050",
|
|
41
|
-
verticalAlign: "middle",
|
|
42
42
|
textTransform: "uppercase"
|
|
43
43
|
}, shortDay));
|
|
44
44
|
}));
|
package/dist/es2019/calendar.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
/* calendar.tsx generated by @compiled/babel-plugin v0.26.1 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
3
4
|
import { forwardRef, memo, useState } from 'react';
|
|
4
|
-
import { jsx } from '@emotion/react';
|
|
5
5
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
|
|
6
6
|
import noop from '@atlaskit/ds-lib/noop';
|
|
7
7
|
import { Box, Stack, xcss } from '@atlaskit/primitives';
|
|
@@ -24,7 +24,7 @@ const boxStyles = xcss({
|
|
|
24
24
|
const analyticsAttributes = {
|
|
25
25
|
componentName: 'calendar',
|
|
26
26
|
packageName: "@atlaskit/calendar",
|
|
27
|
-
packageVersion: "14.0.
|
|
27
|
+
packageVersion: "14.0.2"
|
|
28
28
|
};
|
|
29
29
|
const InnerCalendar = /*#__PURE__*/forwardRef(function Calendar({
|
|
30
30
|
day,
|
|
@@ -160,21 +160,21 @@ const InnerCalendar = /*#__PURE__*/forwardRef(function Calendar({
|
|
|
160
160
|
return `${monthsLong[previousMonth]} ${showPreviousYear ? yearValue - 1 : yearValue}`;
|
|
161
161
|
};
|
|
162
162
|
const headerId = useUniqueId('month-year-header');
|
|
163
|
-
return
|
|
163
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
164
164
|
className: className,
|
|
165
165
|
style: style,
|
|
166
166
|
onBlur: handleContainerBlur,
|
|
167
167
|
onFocus: handleContainerFocus,
|
|
168
168
|
"data-testid": testId && `${testId}--container`,
|
|
169
169
|
ref: ref
|
|
170
|
-
},
|
|
170
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
171
171
|
xcss: boxStyles,
|
|
172
172
|
padding: "space.200",
|
|
173
173
|
"aria-label": "calendar",
|
|
174
174
|
testId: testId && `${testId}--calendar`
|
|
175
|
-
},
|
|
175
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
176
176
|
space: "space.150"
|
|
177
|
-
},
|
|
177
|
+
}, /*#__PURE__*/React.createElement(Header
|
|
178
178
|
// The month number needs to be translated to index in the month
|
|
179
179
|
// name array e.g. 1 (January) -> 0
|
|
180
180
|
, {
|
|
@@ -189,16 +189,16 @@ const InnerCalendar = /*#__PURE__*/forwardRef(function Calendar({
|
|
|
189
189
|
headerId: headerId,
|
|
190
190
|
tabIndex: tabIndex,
|
|
191
191
|
testId: testId
|
|
192
|
-
}),
|
|
192
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
193
193
|
role: "grid",
|
|
194
194
|
tabIndex: tabIndex,
|
|
195
195
|
onKeyDown: handleContainerKeyDown,
|
|
196
196
|
"aria-labelledby": headerId,
|
|
197
197
|
testId: testId && `${testId}--calendar-dates`
|
|
198
|
-
},
|
|
198
|
+
}, /*#__PURE__*/React.createElement(WeekHeaderComponent, {
|
|
199
199
|
daysShort: daysShort,
|
|
200
200
|
testId: testId
|
|
201
|
-
}),
|
|
201
|
+
}), /*#__PURE__*/React.createElement(WeekDaysComponent, {
|
|
202
202
|
weeks: weeks,
|
|
203
203
|
handleClickDay: handleClickDay,
|
|
204
204
|
monthsLong: monthsLong,
|
|
@@ -218,7 +218,7 @@ const InnerCalendar = /*#__PURE__*/forwardRef(function Calendar({
|
|
|
218
218
|
* - [Usage](https://atlassian.design/components/calendar/usage)
|
|
219
219
|
*/
|
|
220
220
|
const Calendar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Calendar(props, ref) {
|
|
221
|
-
return
|
|
221
|
+
return /*#__PURE__*/React.createElement(InnerCalendar, _extends({}, props, {
|
|
222
222
|
ref: ref
|
|
223
223
|
}));
|
|
224
224
|
}));
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
1
|
import { forwardRef, memo, useCallback, useEffect, useRef } from 'react';
|
|
3
|
-
import { css
|
|
2
|
+
import { css } from '@emotion/react';
|
|
4
3
|
import noop from '@atlaskit/ds-lib/noop';
|
|
5
4
|
import { Grid } from '@atlaskit/primitives';
|
|
6
5
|
import { dateCellStyles as getDateCellStyles } from '../styles/date';
|
|
@@ -57,10 +56,10 @@ const Date = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Date({
|
|
|
57
56
|
}
|
|
58
57
|
}, [onClick]);
|
|
59
58
|
const dateCellStyles = css(getDateCellStyles());
|
|
60
|
-
return
|
|
59
|
+
return /*#__PURE__*/React.createElement(Grid, {
|
|
61
60
|
role: "gridcell",
|
|
62
61
|
alignItems: "center"
|
|
63
|
-
},
|
|
62
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
64
63
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
65
64
|
css: dateCellStyles,
|
|
66
65
|
"aria-current": isToday ? 'date' : undefined,
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
1
|
import { memo, useState } from 'react';
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
2
|
import Button from '@atlaskit/button/standard-button';
|
|
5
3
|
import Heading from '@atlaskit/heading';
|
|
6
4
|
import ArrowleftIcon from '@atlaskit/icon/glyph/chevron-left-large';
|
|
@@ -43,40 +41,40 @@ const Header = /*#__PURE__*/memo(function Header({
|
|
|
43
41
|
}
|
|
44
42
|
handleClickNext(e);
|
|
45
43
|
};
|
|
46
|
-
return
|
|
44
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
47
45
|
paddingInline: "space.100"
|
|
48
|
-
},
|
|
46
|
+
}, /*#__PURE__*/React.createElement(Inline, {
|
|
49
47
|
space: "space.0",
|
|
50
48
|
alignBlock: "center",
|
|
51
49
|
spread: "space-between"
|
|
52
|
-
},
|
|
50
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
53
51
|
appearance: "subtle",
|
|
54
52
|
spacing: "none",
|
|
55
53
|
tabIndex: tabIndex,
|
|
56
54
|
onClick: handlePrevMonthInteraction,
|
|
57
55
|
testId: testId && `${testId}--previous-month`,
|
|
58
|
-
iconBefore:
|
|
56
|
+
iconBefore: /*#__PURE__*/React.createElement(ArrowleftIcon, {
|
|
59
57
|
label: `${previousMonthLabel}, ${previousHeading}`,
|
|
60
58
|
size: "medium",
|
|
61
59
|
primaryColor: `var(--ds-icon, ${N700})`,
|
|
62
60
|
testId: testId && `${testId}--previous-month-icon`
|
|
63
61
|
})
|
|
64
|
-
}),
|
|
62
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
65
63
|
"aria-live": hasInteractedWithMonth ? 'polite' : undefined,
|
|
66
64
|
id: announceId,
|
|
67
65
|
testId: testId && `${testId}--current-month-year--container`
|
|
68
|
-
},
|
|
66
|
+
}, /*#__PURE__*/React.createElement(Heading, {
|
|
69
67
|
level: "h400",
|
|
70
68
|
as: "h2",
|
|
71
69
|
id: headerId,
|
|
72
70
|
testId: testId && `${testId}--current-month-year`
|
|
73
|
-
}, `${monthLongTitle} ${year}`)),
|
|
71
|
+
}, `${monthLongTitle} ${year}`)), /*#__PURE__*/React.createElement(Button, {
|
|
74
72
|
appearance: "subtle",
|
|
75
73
|
spacing: "none",
|
|
76
74
|
tabIndex: tabIndex,
|
|
77
75
|
onClick: handleNextMonthInteraction,
|
|
78
76
|
testId: testId && `${testId}--next-month`,
|
|
79
|
-
iconBefore:
|
|
77
|
+
iconBefore: /*#__PURE__*/React.createElement(ArrowrightIcon, {
|
|
80
78
|
label: `${nextMonthLabel}, ${nextHeading}`,
|
|
81
79
|
size: "medium",
|
|
82
80
|
primaryColor: `var(--ds-icon, ${N700})`,
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
1
|
import { Grid } from '@atlaskit/primitives';
|
|
5
2
|
/**
|
|
6
3
|
* __Week day grid__
|
|
@@ -13,12 +10,12 @@ const WeekDayGrid = ({
|
|
|
13
10
|
children,
|
|
14
11
|
isHidden
|
|
15
12
|
}) => {
|
|
16
|
-
const row =
|
|
13
|
+
const row = /*#__PURE__*/React.createElement(Grid, {
|
|
17
14
|
testId: testId,
|
|
18
15
|
templateColumns: "repeat(7, minmax(max-content, 1fr))",
|
|
19
16
|
role: "row"
|
|
20
17
|
}, children);
|
|
21
|
-
return isHidden ?
|
|
18
|
+
return isHidden ? /*#__PURE__*/React.createElement("div", {
|
|
22
19
|
"aria-hidden": "true"
|
|
23
20
|
}, row) : row;
|
|
24
21
|
};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
1
|
import { memo } from 'react';
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
2
|
import Box from '@atlaskit/primitives/box';
|
|
5
3
|
import DateComponent from './date';
|
|
6
4
|
import WeekdayGrid from './week-day-grid';
|
|
@@ -12,13 +10,13 @@ const WeekDays = /*#__PURE__*/memo(function WeekDays({
|
|
|
12
10
|
tabIndex,
|
|
13
11
|
testId
|
|
14
12
|
}) {
|
|
15
|
-
return
|
|
13
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
16
14
|
role: "rowgroup",
|
|
17
15
|
testId: testId && `${testId}--month`
|
|
18
|
-
}, weeks.map((week, i) =>
|
|
16
|
+
}, weeks.map((week, i) => /*#__PURE__*/React.createElement(WeekdayGrid, {
|
|
19
17
|
key: i,
|
|
20
18
|
testId: testId && `${testId}--week`
|
|
21
|
-
}, week.values.map(weekDay =>
|
|
19
|
+
}, week.values.map(weekDay => /*#__PURE__*/React.createElement(DateComponent, {
|
|
22
20
|
key: `${week.id}-${weekDay.id}`,
|
|
23
21
|
isDisabled: weekDay.isDisabled,
|
|
24
22
|
isFocused: weekDay.isFocused,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/* week-header.tsx generated by @compiled/babel-plugin v0.26.1 */
|
|
2
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
2
3
|
import { memo } from 'react';
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
4
|
import Text from '@atlaskit/ds-explorations/text';
|
|
5
5
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
6
6
|
import WeekDayGrid from './week-day-grid';
|
|
@@ -11,26 +11,27 @@ const columnHeaderStyles = xcss({
|
|
|
11
11
|
// Account for languages with long week day names
|
|
12
12
|
textAlign: 'center',
|
|
13
13
|
lineHeight: '16px',
|
|
14
|
-
color: 'color.text.subtle'
|
|
14
|
+
color: 'color.text.subtle',
|
|
15
|
+
// Apply correct fallback to shortDay text
|
|
16
|
+
display: 'flex',
|
|
17
|
+
justifyContent: 'center'
|
|
15
18
|
});
|
|
16
|
-
|
|
17
19
|
const WeekHeader = /*#__PURE__*/memo(function WeekHeader({
|
|
18
20
|
daysShort,
|
|
19
21
|
testId
|
|
20
22
|
}) {
|
|
21
|
-
return
|
|
23
|
+
return /*#__PURE__*/React.createElement(WeekDayGrid, {
|
|
22
24
|
isHidden: true,
|
|
23
25
|
testId: testId && `${testId}--column-headers`
|
|
24
|
-
}, daysShort.map(shortDay =>
|
|
26
|
+
}, daysShort.map(shortDay => /*#__PURE__*/React.createElement(Box, {
|
|
25
27
|
padding: "space.100",
|
|
26
28
|
xcss: columnHeaderStyles,
|
|
27
29
|
key: shortDay,
|
|
28
30
|
role: "columnheader",
|
|
29
31
|
testId: testId && `${testId}--column-header`
|
|
30
|
-
},
|
|
32
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
31
33
|
fontWeight: "bold",
|
|
32
34
|
fontSize: "size.050",
|
|
33
|
-
verticalAlign: "middle",
|
|
34
35
|
textTransform: "uppercase"
|
|
35
36
|
}, shortDay))));
|
|
36
37
|
});
|
package/dist/esm/calendar.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
/* calendar.tsx generated by @compiled/babel-plugin v0.26.1 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
4
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
-
/** @jsx jsx */
|
|
7
8
|
import { forwardRef, memo, useState } from 'react';
|
|
8
|
-
import { jsx } from '@emotion/react';
|
|
9
9
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
|
|
10
10
|
import noop from '@atlaskit/ds-lib/noop';
|
|
11
11
|
import { Box, Stack, xcss } from '@atlaskit/primitives';
|
|
@@ -28,7 +28,7 @@ var boxStyles = xcss({
|
|
|
28
28
|
var analyticsAttributes = {
|
|
29
29
|
componentName: 'calendar',
|
|
30
30
|
packageName: "@atlaskit/calendar",
|
|
31
|
-
packageVersion: "14.0.
|
|
31
|
+
packageVersion: "14.0.2"
|
|
32
32
|
};
|
|
33
33
|
var InnerCalendar = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
|
|
34
34
|
var day = _ref.day,
|
|
@@ -182,21 +182,21 @@ var InnerCalendar = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
|
|
|
182
182
|
return "".concat(monthsLong[previousMonth], " ").concat(showPreviousYear ? yearValue - 1 : yearValue);
|
|
183
183
|
};
|
|
184
184
|
var headerId = useUniqueId('month-year-header');
|
|
185
|
-
return
|
|
185
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
186
186
|
className: className,
|
|
187
187
|
style: style,
|
|
188
188
|
onBlur: handleContainerBlur,
|
|
189
189
|
onFocus: handleContainerFocus,
|
|
190
190
|
"data-testid": testId && "".concat(testId, "--container"),
|
|
191
191
|
ref: ref
|
|
192
|
-
},
|
|
192
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
193
193
|
xcss: boxStyles,
|
|
194
194
|
padding: "space.200",
|
|
195
195
|
"aria-label": "calendar",
|
|
196
196
|
testId: testId && "".concat(testId, "--calendar")
|
|
197
|
-
},
|
|
197
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
198
198
|
space: "space.150"
|
|
199
|
-
},
|
|
199
|
+
}, /*#__PURE__*/React.createElement(Header
|
|
200
200
|
// The month number needs to be translated to index in the month
|
|
201
201
|
// name array e.g. 1 (January) -> 0
|
|
202
202
|
, {
|
|
@@ -211,16 +211,16 @@ var InnerCalendar = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
|
|
|
211
211
|
headerId: headerId,
|
|
212
212
|
tabIndex: tabIndex,
|
|
213
213
|
testId: testId
|
|
214
|
-
}),
|
|
214
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
215
215
|
role: "grid",
|
|
216
216
|
tabIndex: tabIndex,
|
|
217
217
|
onKeyDown: handleContainerKeyDown,
|
|
218
218
|
"aria-labelledby": headerId,
|
|
219
219
|
testId: testId && "".concat(testId, "--calendar-dates")
|
|
220
|
-
},
|
|
220
|
+
}, /*#__PURE__*/React.createElement(WeekHeaderComponent, {
|
|
221
221
|
daysShort: daysShort,
|
|
222
222
|
testId: testId
|
|
223
|
-
}),
|
|
223
|
+
}), /*#__PURE__*/React.createElement(WeekDaysComponent, {
|
|
224
224
|
weeks: weeks,
|
|
225
225
|
handleClickDay: handleClickDay,
|
|
226
226
|
monthsLong: monthsLong,
|
|
@@ -240,7 +240,7 @@ var InnerCalendar = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
|
|
|
240
240
|
* - [Usage](https://atlassian.design/components/calendar/usage)
|
|
241
241
|
*/
|
|
242
242
|
var Calendar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Calendar(props, ref) {
|
|
243
|
-
return
|
|
243
|
+
return /*#__PURE__*/React.createElement(InnerCalendar, _extends({}, props, {
|
|
244
244
|
ref: ref
|
|
245
245
|
}));
|
|
246
246
|
}));
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
1
|
import { forwardRef, memo, useCallback, useEffect, useRef } from 'react';
|
|
3
|
-
import { css
|
|
2
|
+
import { css } from '@emotion/react';
|
|
4
3
|
import noop from '@atlaskit/ds-lib/noop';
|
|
5
4
|
import { Grid } from '@atlaskit/primitives';
|
|
6
5
|
import { dateCellStyles as getDateCellStyles } from '../styles/date';
|
|
@@ -62,10 +61,10 @@ var Date = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Date(_ref2, _ref)
|
|
|
62
61
|
}
|
|
63
62
|
}, [onClick]);
|
|
64
63
|
var dateCellStyles = css(getDateCellStyles());
|
|
65
|
-
return
|
|
64
|
+
return /*#__PURE__*/React.createElement(Grid, {
|
|
66
65
|
role: "gridcell",
|
|
67
66
|
alignItems: "center"
|
|
68
|
-
},
|
|
67
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
69
68
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
70
69
|
css: dateCellStyles,
|
|
71
70
|
"aria-current": isToday ? 'date' : undefined,
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
/** @jsx jsx */
|
|
3
2
|
import { memo, useState } from 'react';
|
|
4
|
-
import { jsx } from '@emotion/react';
|
|
5
3
|
import Button from '@atlaskit/button/standard-button';
|
|
6
4
|
import Heading from '@atlaskit/heading';
|
|
7
5
|
import ArrowleftIcon from '@atlaskit/icon/glyph/chevron-left-large';
|
|
@@ -48,40 +46,40 @@ var Header = /*#__PURE__*/memo(function Header(_ref) {
|
|
|
48
46
|
}
|
|
49
47
|
handleClickNext(e);
|
|
50
48
|
};
|
|
51
|
-
return
|
|
49
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
52
50
|
paddingInline: "space.100"
|
|
53
|
-
},
|
|
51
|
+
}, /*#__PURE__*/React.createElement(Inline, {
|
|
54
52
|
space: "space.0",
|
|
55
53
|
alignBlock: "center",
|
|
56
54
|
spread: "space-between"
|
|
57
|
-
},
|
|
55
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
58
56
|
appearance: "subtle",
|
|
59
57
|
spacing: "none",
|
|
60
58
|
tabIndex: tabIndex,
|
|
61
59
|
onClick: handlePrevMonthInteraction,
|
|
62
60
|
testId: testId && "".concat(testId, "--previous-month"),
|
|
63
|
-
iconBefore:
|
|
61
|
+
iconBefore: /*#__PURE__*/React.createElement(ArrowleftIcon, {
|
|
64
62
|
label: "".concat(previousMonthLabel, ", ").concat(previousHeading),
|
|
65
63
|
size: "medium",
|
|
66
64
|
primaryColor: "var(--ds-icon, ".concat(N700, ")"),
|
|
67
65
|
testId: testId && "".concat(testId, "--previous-month-icon")
|
|
68
66
|
})
|
|
69
|
-
}),
|
|
67
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
70
68
|
"aria-live": hasInteractedWithMonth ? 'polite' : undefined,
|
|
71
69
|
id: announceId,
|
|
72
70
|
testId: testId && "".concat(testId, "--current-month-year--container")
|
|
73
|
-
},
|
|
71
|
+
}, /*#__PURE__*/React.createElement(Heading, {
|
|
74
72
|
level: "h400",
|
|
75
73
|
as: "h2",
|
|
76
74
|
id: headerId,
|
|
77
75
|
testId: testId && "".concat(testId, "--current-month-year")
|
|
78
|
-
}, "".concat(monthLongTitle, " ").concat(year))),
|
|
76
|
+
}, "".concat(monthLongTitle, " ").concat(year))), /*#__PURE__*/React.createElement(Button, {
|
|
79
77
|
appearance: "subtle",
|
|
80
78
|
spacing: "none",
|
|
81
79
|
tabIndex: tabIndex,
|
|
82
80
|
onClick: handleNextMonthInteraction,
|
|
83
81
|
testId: testId && "".concat(testId, "--next-month"),
|
|
84
|
-
iconBefore:
|
|
82
|
+
iconBefore: /*#__PURE__*/React.createElement(ArrowrightIcon, {
|
|
85
83
|
label: "".concat(nextMonthLabel, ", ").concat(nextHeading),
|
|
86
84
|
size: "medium",
|
|
87
85
|
primaryColor: "var(--ds-icon, ".concat(N700, ")"),
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
1
|
import { Grid } from '@atlaskit/primitives';
|
|
5
2
|
/**
|
|
6
3
|
* __Week day grid__
|
|
@@ -12,12 +9,12 @@ var WeekDayGrid = function WeekDayGrid(_ref) {
|
|
|
12
9
|
var testId = _ref.testId,
|
|
13
10
|
children = _ref.children,
|
|
14
11
|
isHidden = _ref.isHidden;
|
|
15
|
-
var row =
|
|
12
|
+
var row = /*#__PURE__*/React.createElement(Grid, {
|
|
16
13
|
testId: testId,
|
|
17
14
|
templateColumns: "repeat(7, minmax(max-content, 1fr))",
|
|
18
15
|
role: "row"
|
|
19
16
|
}, children);
|
|
20
|
-
return isHidden ?
|
|
17
|
+
return isHidden ? /*#__PURE__*/React.createElement("div", {
|
|
21
18
|
"aria-hidden": "true"
|
|
22
19
|
}, row) : row;
|
|
23
20
|
};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
1
|
import { memo } from 'react';
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
2
|
import Box from '@atlaskit/primitives/box';
|
|
5
3
|
import DateComponent from './date';
|
|
6
4
|
import WeekdayGrid from './week-day-grid';
|
|
@@ -11,15 +9,15 @@ var WeekDays = /*#__PURE__*/memo(function WeekDays(_ref) {
|
|
|
11
9
|
shouldSetFocus = _ref.shouldSetFocus,
|
|
12
10
|
tabIndex = _ref.tabIndex,
|
|
13
11
|
testId = _ref.testId;
|
|
14
|
-
return
|
|
12
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
15
13
|
role: "rowgroup",
|
|
16
14
|
testId: testId && "".concat(testId, "--month")
|
|
17
15
|
}, weeks.map(function (week, i) {
|
|
18
|
-
return
|
|
16
|
+
return /*#__PURE__*/React.createElement(WeekdayGrid, {
|
|
19
17
|
key: i,
|
|
20
18
|
testId: testId && "".concat(testId, "--week")
|
|
21
19
|
}, week.values.map(function (weekDay) {
|
|
22
|
-
return
|
|
20
|
+
return /*#__PURE__*/React.createElement(DateComponent, {
|
|
23
21
|
key: "".concat(week.id, "-").concat(weekDay.id),
|
|
24
22
|
isDisabled: weekDay.isDisabled,
|
|
25
23
|
isFocused: weekDay.isFocused,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/* week-header.tsx generated by @compiled/babel-plugin v0.26.1 */
|
|
2
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
2
3
|
import { memo } from 'react';
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
4
|
import Text from '@atlaskit/ds-explorations/text';
|
|
5
5
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
6
6
|
import WeekDayGrid from './week-day-grid';
|
|
@@ -11,26 +11,27 @@ var columnHeaderStyles = xcss({
|
|
|
11
11
|
// Account for languages with long week day names
|
|
12
12
|
textAlign: 'center',
|
|
13
13
|
lineHeight: '16px',
|
|
14
|
-
color: 'color.text.subtle'
|
|
14
|
+
color: 'color.text.subtle',
|
|
15
|
+
// Apply correct fallback to shortDay text
|
|
16
|
+
display: 'flex',
|
|
17
|
+
justifyContent: 'center'
|
|
15
18
|
});
|
|
16
|
-
|
|
17
19
|
var WeekHeader = /*#__PURE__*/memo(function WeekHeader(_ref) {
|
|
18
20
|
var daysShort = _ref.daysShort,
|
|
19
21
|
testId = _ref.testId;
|
|
20
|
-
return
|
|
22
|
+
return /*#__PURE__*/React.createElement(WeekDayGrid, {
|
|
21
23
|
isHidden: true,
|
|
22
24
|
testId: testId && "".concat(testId, "--column-headers")
|
|
23
25
|
}, daysShort.map(function (shortDay) {
|
|
24
|
-
return
|
|
26
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
25
27
|
padding: "space.100",
|
|
26
28
|
xcss: columnHeaderStyles,
|
|
27
29
|
key: shortDay,
|
|
28
30
|
role: "columnheader",
|
|
29
31
|
testId: testId && "".concat(testId, "--column-header")
|
|
30
|
-
},
|
|
32
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
31
33
|
fontWeight: "bold",
|
|
32
34
|
fontSize: "size.050",
|
|
33
|
-
verticalAlign: "middle",
|
|
34
35
|
textTransform: "uppercase"
|
|
35
36
|
}, shortDay));
|
|
36
37
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/calendar",
|
|
3
|
-
"version": "14.0.
|
|
3
|
+
"version": "14.0.2",
|
|
4
4
|
"description": "An interactive calendar for date selection experiences.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -24,15 +24,15 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
27
|
-
"@atlaskit/button": "^16.
|
|
27
|
+
"@atlaskit/button": "^16.17.0",
|
|
28
28
|
"@atlaskit/ds-explorations": "^3.0.0",
|
|
29
29
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
30
30
|
"@atlaskit/heading": "^1.4.0",
|
|
31
|
-
"@atlaskit/icon": "^
|
|
31
|
+
"@atlaskit/icon": "^22.0.0",
|
|
32
32
|
"@atlaskit/locale": "^2.6.0",
|
|
33
|
-
"@atlaskit/primitives": "^1.
|
|
33
|
+
"@atlaskit/primitives": "^1.13.0",
|
|
34
34
|
"@atlaskit/theme": "^12.6.0",
|
|
35
|
-
"@atlaskit/tokens": "^1.
|
|
35
|
+
"@atlaskit/tokens": "^1.29.0",
|
|
36
36
|
"@babel/runtime": "^7.0.0",
|
|
37
37
|
"@emotion/react": "^11.7.1",
|
|
38
38
|
"date-fns": "^2.17.0",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@af/accessibility-testing": "*",
|
|
46
|
+
"@af/integration-testing": "*",
|
|
46
47
|
"@af/visual-regression": "*",
|
|
47
48
|
"@atlaskit/ssr": "*",
|
|
48
49
|
"@atlaskit/visual-regression": "*",
|
package/tmp/api-report-tmp.d.ts
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
## API Report File for "@atlaskit/calendar"
|
|
2
|
-
|
|
3
|
-
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
|
|
7
|
-
/// <reference types="react" />
|
|
8
|
-
|
|
9
|
-
import { CSSProperties } from 'react';
|
|
10
|
-
import { ForwardRefExoticComponent } from 'react';
|
|
11
|
-
import { MemoExoticComponent } from 'react';
|
|
12
|
-
import { RefAttributes } from 'react';
|
|
13
|
-
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
14
|
-
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
15
|
-
|
|
16
|
-
// @public (undocumented)
|
|
17
|
-
type ArrowKeys = 'down' | 'left' | 'right' | 'up';
|
|
18
|
-
|
|
19
|
-
// @public
|
|
20
|
-
const Calendar: MemoExoticComponent<ForwardRefExoticComponent<Pick<CalendarProps, "analyticsContext" | "calendarRef" | "className" | "createAnalyticsEvent" | "day" | "defaultDay" | "defaultMonth" | "defaultPreviouslySelected" | "defaultSelected" | "defaultYear" | "disabled" | "disabledDateFilter" | "locale" | "maxDate" | "minDate" | "month" | "nextMonthLabel" | "onBlur" | "onChange" | "onFocus" | "onSelect" | "previousMonthLabel" | "previouslySelected" | "selected" | "style" | "tabIndex" | "testId" | "today" | "weekStartDay" | "year"> & RefAttributes<HTMLDivElement>>>;
|
|
21
|
-
export default Calendar;
|
|
22
|
-
|
|
23
|
-
// @public (undocumented)
|
|
24
|
-
export interface CalendarProps extends WithAnalyticsEventsProps {
|
|
25
|
-
analyticsContext?: Record<string, any>;
|
|
26
|
-
// @internal
|
|
27
|
-
calendarRef?: React.Ref<CalendarRef>;
|
|
28
|
-
className?: string;
|
|
29
|
-
day?: number;
|
|
30
|
-
defaultDay?: number;
|
|
31
|
-
defaultMonth?: number;
|
|
32
|
-
defaultPreviouslySelected?: Array<string>;
|
|
33
|
-
defaultSelected?: Array<string>;
|
|
34
|
-
defaultYear?: number;
|
|
35
|
-
disabled?: Array<string>;
|
|
36
|
-
disabledDateFilter?: (date: string) => boolean;
|
|
37
|
-
locale?: string;
|
|
38
|
-
maxDate?: string;
|
|
39
|
-
minDate?: string;
|
|
40
|
-
month?: number;
|
|
41
|
-
nextMonthLabel?: string;
|
|
42
|
-
onBlur?: React.FocusEventHandler;
|
|
43
|
-
onChange?: (event: ChangeEvent, analyticsEvent: UIAnalyticsEvent) => void;
|
|
44
|
-
onFocus?: React.FocusEventHandler;
|
|
45
|
-
onSelect?: (event: SelectEvent, analyticsEvent: UIAnalyticsEvent) => void;
|
|
46
|
-
previouslySelected?: Array<string>;
|
|
47
|
-
previousMonthLabel?: string;
|
|
48
|
-
selected?: Array<string>;
|
|
49
|
-
style?: CSSProperties;
|
|
50
|
-
tabIndex?: TabIndex;
|
|
51
|
-
testId?: string;
|
|
52
|
-
today?: string;
|
|
53
|
-
weekStartDay?: WeekDay;
|
|
54
|
-
year?: number;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// @public (undocumented)
|
|
58
|
-
export interface CalendarRef {
|
|
59
|
-
// (undocumented)
|
|
60
|
-
navigate: (type: ArrowKeys) => void;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// @public (undocumented)
|
|
64
|
-
export type ChangeEvent = {
|
|
65
|
-
iso: ISODate;
|
|
66
|
-
type: 'down' | 'left' | 'next' | 'prev' | 'right' | 'up';
|
|
67
|
-
} & DateObj;
|
|
68
|
-
|
|
69
|
-
// @public (undocumented)
|
|
70
|
-
type DateObj = {
|
|
71
|
-
day: number;
|
|
72
|
-
month: number;
|
|
73
|
-
year: number;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
// @public (undocumented)
|
|
77
|
-
type ISODate = string;
|
|
78
|
-
|
|
79
|
-
// @public (undocumented)
|
|
80
|
-
export type SelectEvent = {
|
|
81
|
-
iso: ISODate;
|
|
82
|
-
} & DateObj;
|
|
83
|
-
|
|
84
|
-
// @public (undocumented)
|
|
85
|
-
type TabIndex = -1 | 0;
|
|
86
|
-
|
|
87
|
-
// @public (undocumented)
|
|
88
|
-
type WeekDay = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
89
|
-
|
|
90
|
-
// (No @packageDocumentation comment for this package)
|
|
91
|
-
|
|
92
|
-
```
|