@atlaskit/calendar 13.3.0 → 13.3.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 +77 -65
- package/codemods/utils.tsx +2 -1
- package/dist/cjs/calendar.js +51 -55
- package/dist/cjs/internal/components/date.js +1 -2
- package/dist/cjs/internal/components/header.js +1 -2
- package/dist/cjs/internal/components/week-day-grid.js +11 -12
- package/dist/cjs/internal/components/week-days.js +29 -35
- package/dist/cjs/internal/components/week-header.js +2 -3
- package/dist/cjs/internal/constants.js +4 -8
- package/dist/cjs/internal/styles/date.js +2 -3
- package/dist/es2019/calendar.js +50 -53
- package/dist/es2019/internal/components/week-day-grid.js +12 -9
- package/dist/es2019/internal/components/week-days.js +24 -29
- package/dist/es2019/internal/components/week-header.js +1 -1
- package/dist/esm/calendar.js +50 -53
- package/dist/esm/internal/components/week-day-grid.js +10 -10
- package/dist/esm/internal/components/week-days.js +28 -33
- package/dist/esm/internal/components/week-header.js +1 -1
- package/dist/types/internal/components/week-day-grid.d.ts +2 -1
- package/dist/types-ts4.5/internal/components/week-day-grid.d.ts +2 -1
- package/package.json +7 -7
package/dist/cjs/calendar.js
CHANGED
|
@@ -35,7 +35,7 @@ var boxStyles = (0, _primitives.xcss)({
|
|
|
35
35
|
var analyticsAttributes = {
|
|
36
36
|
componentName: 'calendar',
|
|
37
37
|
packageName: "@atlaskit/calendar",
|
|
38
|
-
packageVersion: "13.3.
|
|
38
|
+
packageVersion: "13.3.2"
|
|
39
39
|
};
|
|
40
40
|
var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_ref, ref) {
|
|
41
41
|
var day = _ref.day,
|
|
@@ -191,58 +191,55 @@ var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_re
|
|
|
191
191
|
return "".concat(monthsLong[previousMonth], " ").concat(showPreviousYear ? yearValue - 1 : yearValue);
|
|
192
192
|
};
|
|
193
193
|
var headerId = (0, _useUniqueId.default)('month-year-header');
|
|
194
|
-
return (
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
,
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
testId: testId
|
|
244
|
-
})))))
|
|
245
|
-
);
|
|
194
|
+
return (0, _react2.jsx)("div", {
|
|
195
|
+
className: className,
|
|
196
|
+
style: style,
|
|
197
|
+
onBlur: handleContainerBlur,
|
|
198
|
+
onFocus: handleContainerFocus,
|
|
199
|
+
"data-testid": testId && "".concat(testId, "--container"),
|
|
200
|
+
ref: ref
|
|
201
|
+
}, (0, _react2.jsx)(_primitives.Box, {
|
|
202
|
+
xcss: boxStyles,
|
|
203
|
+
padding: "space.200",
|
|
204
|
+
"aria-label": "calendar",
|
|
205
|
+
testId: testId && "".concat(testId, "--calendar")
|
|
206
|
+
}, (0, _react2.jsx)(_primitives.Stack, {
|
|
207
|
+
space: "space.150"
|
|
208
|
+
}, (0, _react2.jsx)(_header.default
|
|
209
|
+
// The month number needs to be translated to index in the month
|
|
210
|
+
// name array e.g. 1 (January) -> 0
|
|
211
|
+
, {
|
|
212
|
+
monthLongTitle: monthsLong[monthValue - 1],
|
|
213
|
+
year: yearValue,
|
|
214
|
+
nextMonthLabel: nextMonthLabel,
|
|
215
|
+
previousMonthLabel: previousMonthLabel,
|
|
216
|
+
nextHeading: getNextHeading(),
|
|
217
|
+
previousHeading: getPreviousHeading(),
|
|
218
|
+
handleClickNext: handleClickNext,
|
|
219
|
+
handleClickPrev: handleClickPrev,
|
|
220
|
+
headerId: headerId,
|
|
221
|
+
mode: mode,
|
|
222
|
+
tabIndex: tabIndex,
|
|
223
|
+
testId: testId
|
|
224
|
+
}), (0, _react2.jsx)(_primitives.Box, {
|
|
225
|
+
role: "grid",
|
|
226
|
+
tabIndex: tabIndex,
|
|
227
|
+
onKeyDown: handleContainerKeyDown,
|
|
228
|
+
"aria-labelledby": headerId,
|
|
229
|
+
testId: testId && "".concat(testId, "--calendar-dates")
|
|
230
|
+
}, (0, _react2.jsx)(_weekHeader.default, {
|
|
231
|
+
daysShort: daysShort,
|
|
232
|
+
mode: mode,
|
|
233
|
+
testId: testId
|
|
234
|
+
}), (0, _react2.jsx)(_weekDays.default, {
|
|
235
|
+
weeks: weeks,
|
|
236
|
+
handleClickDay: handleClickDay,
|
|
237
|
+
mode: mode,
|
|
238
|
+
monthsLong: monthsLong,
|
|
239
|
+
shouldSetFocus: shouldSetFocus,
|
|
240
|
+
tabIndex: tabIndex,
|
|
241
|
+
testId: testId
|
|
242
|
+
})))));
|
|
246
243
|
});
|
|
247
244
|
|
|
248
245
|
/**
|
|
@@ -264,5 +261,4 @@ var Calendar = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef
|
|
|
264
261
|
});
|
|
265
262
|
}));
|
|
266
263
|
Calendar.displayName = 'Calendar';
|
|
267
|
-
var _default = Calendar;
|
|
268
|
-
exports.default = _default;
|
|
264
|
+
var _default = exports.default = Calendar;
|
|
@@ -99,5 +99,4 @@ var Date = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
|
99
99
|
Date.displayName = 'Date';
|
|
100
100
|
|
|
101
101
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
102
|
-
var _default = Date;
|
|
103
|
-
exports.default = _default;
|
|
102
|
+
var _default = exports.default = Date;
|
|
@@ -100,5 +100,4 @@ var Header = /*#__PURE__*/(0, _react.memo)(function Header(_ref) {
|
|
|
100
100
|
Header.displayName = 'Header';
|
|
101
101
|
|
|
102
102
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
103
|
-
var _default = Header;
|
|
104
|
-
exports.default = _default;
|
|
103
|
+
var _default = exports.default = Header;
|
|
@@ -16,16 +16,15 @@ var _primitives = require("@atlaskit/primitives");
|
|
|
16
16
|
*/
|
|
17
17
|
var WeekDayGrid = function WeekDayGrid(_ref) {
|
|
18
18
|
var testId = _ref.testId,
|
|
19
|
-
children = _ref.children
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
);
|
|
19
|
+
children = _ref.children,
|
|
20
|
+
isHidden = _ref.isHidden;
|
|
21
|
+
var row = (0, _react.jsx)(_primitives.Grid, {
|
|
22
|
+
testId: testId,
|
|
23
|
+
templateColumns: "repeat(7, minmax(max-content, 1fr))",
|
|
24
|
+
role: "row"
|
|
25
|
+
}, children);
|
|
26
|
+
return isHidden ? (0, _react.jsx)("div", {
|
|
27
|
+
"aria-hidden": "true"
|
|
28
|
+
}, row) : row;
|
|
29
29
|
};
|
|
30
|
-
var _default = WeekDayGrid;
|
|
31
|
-
exports.default = _default;
|
|
30
|
+
var _default = exports.default = WeekDayGrid;
|
|
@@ -20,42 +20,36 @@ var WeekDays = /*#__PURE__*/(0, _react.memo)(function WeekDays(_ref) {
|
|
|
20
20
|
shouldSetFocus = _ref.shouldSetFocus,
|
|
21
21
|
tabIndex = _ref.tabIndex,
|
|
22
22
|
testId = _ref.testId;
|
|
23
|
-
return (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
(0, _react2.jsx)(
|
|
28
|
-
|
|
29
|
-
testId: testId && "".concat(testId, "--
|
|
30
|
-
},
|
|
31
|
-
return (0, _react2.jsx)(
|
|
32
|
-
key:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
testId: testId
|
|
52
|
-
}, weekDay.day);
|
|
53
|
-
}));
|
|
54
|
-
}))
|
|
55
|
-
);
|
|
23
|
+
return (0, _react2.jsx)(_box.default, {
|
|
24
|
+
role: "rowgroup",
|
|
25
|
+
testId: testId && "".concat(testId, "--month")
|
|
26
|
+
}, weeks.map(function (week, i) {
|
|
27
|
+
return (0, _react2.jsx)(_weekDayGrid.default, {
|
|
28
|
+
key: i,
|
|
29
|
+
testId: testId && "".concat(testId, "--week")
|
|
30
|
+
}, week.values.map(function (weekDay) {
|
|
31
|
+
return (0, _react2.jsx)(_date.default, {
|
|
32
|
+
key: "".concat(week.id, "-").concat(weekDay.id),
|
|
33
|
+
isDisabled: weekDay.isDisabled,
|
|
34
|
+
isFocused: weekDay.isFocused,
|
|
35
|
+
isToday: weekDay.isToday,
|
|
36
|
+
dayLong: weekDay.weekDayName,
|
|
37
|
+
month: weekDay.month,
|
|
38
|
+
monthLong: monthsLong[weekDay.month - 1],
|
|
39
|
+
onClick: handleClickDay,
|
|
40
|
+
isPreviouslySelected: weekDay.isPreviouslySelected,
|
|
41
|
+
isSelected: weekDay.isSelected,
|
|
42
|
+
isSibling: weekDay.isSiblingMonth,
|
|
43
|
+
year: weekDay.year,
|
|
44
|
+
mode: mode,
|
|
45
|
+
shouldSetFocus: shouldSetFocus,
|
|
46
|
+
tabIndex: tabIndex,
|
|
47
|
+
testId: testId
|
|
48
|
+
}, weekDay.day);
|
|
49
|
+
}));
|
|
50
|
+
}));
|
|
56
51
|
});
|
|
57
52
|
WeekDays.displayName = 'WeekDays';
|
|
58
53
|
|
|
59
54
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
60
|
-
var _default = WeekDays;
|
|
61
|
-
exports.default = _default;
|
|
55
|
+
var _default = exports.default = WeekDays;
|
|
@@ -26,10 +26,10 @@ var WeekHeader = /*#__PURE__*/(0, _react.memo)(function WeekHeader(_ref) {
|
|
|
26
26
|
var daysShort = _ref.daysShort,
|
|
27
27
|
testId = _ref.testId;
|
|
28
28
|
return (0, _react2.jsx)(_weekDayGrid.default, {
|
|
29
|
+
isHidden: true,
|
|
29
30
|
testId: testId && "".concat(testId, "--column-headers")
|
|
30
31
|
}, daysShort.map(function (shortDay) {
|
|
31
32
|
return (0, _react2.jsx)(_primitives.Box, {
|
|
32
|
-
"aria-hidden": "true",
|
|
33
33
|
padding: "space.100",
|
|
34
34
|
xcss: columnHeaderStyles,
|
|
35
35
|
key: shortDay,
|
|
@@ -46,5 +46,4 @@ var WeekHeader = /*#__PURE__*/(0, _react.memo)(function WeekHeader(_ref) {
|
|
|
46
46
|
WeekHeader.displayName = 'WeekHeader';
|
|
47
47
|
|
|
48
48
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
49
|
-
var _default = WeekHeader;
|
|
50
|
-
exports.default = _default;
|
|
49
|
+
var _default = exports.default = WeekHeader;
|
|
@@ -4,16 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.monthsPerYear = exports.daysPerWeek = exports.blankStringArray = exports.arrowKeys = void 0;
|
|
7
|
-
var arrowKeys = {
|
|
7
|
+
var arrowKeys = exports.arrowKeys = {
|
|
8
8
|
ArrowDown: 'down',
|
|
9
9
|
ArrowLeft: 'left',
|
|
10
10
|
ArrowRight: 'right',
|
|
11
11
|
ArrowUp: 'up'
|
|
12
12
|
};
|
|
13
|
-
exports.
|
|
14
|
-
var
|
|
15
|
-
exports.
|
|
16
|
-
var monthsPerYear = 12;
|
|
17
|
-
exports.monthsPerYear = monthsPerYear;
|
|
18
|
-
var blankStringArray = [];
|
|
19
|
-
exports.blankStringArray = blankStringArray;
|
|
13
|
+
var daysPerWeek = exports.daysPerWeek = 7;
|
|
14
|
+
var monthsPerYear = exports.monthsPerYear = 12;
|
|
15
|
+
var blankStringArray = exports.blankStringArray = [];
|
|
@@ -30,7 +30,7 @@ var borderColorFocused = {
|
|
|
30
30
|
light: "var(--ds-border-focused, ".concat(_colors.B200, ")"),
|
|
31
31
|
dark: "var(--ds-border-focused, ".concat(_colors.B100, ")")
|
|
32
32
|
};
|
|
33
|
-
var dateCellStyles = function dateCellStyles() {
|
|
33
|
+
var dateCellStyles = exports.dateCellStyles = function dateCellStyles() {
|
|
34
34
|
var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'light';
|
|
35
35
|
return {
|
|
36
36
|
all: 'unset',
|
|
@@ -100,5 +100,4 @@ var dateCellStyles = function dateCellStyles() {
|
|
|
100
100
|
color: "var(--ds-text-disabled, ".concat(_colors.N40, ")")
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
|
-
};
|
|
104
|
-
exports.dateCellStyles = dateCellStyles;
|
|
103
|
+
};
|
package/dist/es2019/calendar.js
CHANGED
|
@@ -25,7 +25,7 @@ const boxStyles = xcss({
|
|
|
25
25
|
const analyticsAttributes = {
|
|
26
26
|
componentName: 'calendar',
|
|
27
27
|
packageName: "@atlaskit/calendar",
|
|
28
|
-
packageVersion: "13.3.
|
|
28
|
+
packageVersion: "13.3.2"
|
|
29
29
|
};
|
|
30
30
|
const CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar({
|
|
31
31
|
day,
|
|
@@ -162,58 +162,55 @@ const CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar({
|
|
|
162
162
|
return `${monthsLong[previousMonth]} ${showPreviousYear ? yearValue - 1 : yearValue}`;
|
|
163
163
|
};
|
|
164
164
|
const headerId = useUniqueId('month-year-header');
|
|
165
|
-
return (
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
testId: testId
|
|
215
|
-
})))))
|
|
216
|
-
);
|
|
165
|
+
return jsx("div", {
|
|
166
|
+
className: className,
|
|
167
|
+
style: style,
|
|
168
|
+
onBlur: handleContainerBlur,
|
|
169
|
+
onFocus: handleContainerFocus,
|
|
170
|
+
"data-testid": testId && `${testId}--container`,
|
|
171
|
+
ref: ref
|
|
172
|
+
}, jsx(Box, {
|
|
173
|
+
xcss: boxStyles,
|
|
174
|
+
padding: "space.200",
|
|
175
|
+
"aria-label": "calendar",
|
|
176
|
+
testId: testId && `${testId}--calendar`
|
|
177
|
+
}, jsx(Stack, {
|
|
178
|
+
space: "space.150"
|
|
179
|
+
}, jsx(Header
|
|
180
|
+
// The month number needs to be translated to index in the month
|
|
181
|
+
// name array e.g. 1 (January) -> 0
|
|
182
|
+
, {
|
|
183
|
+
monthLongTitle: monthsLong[monthValue - 1],
|
|
184
|
+
year: yearValue,
|
|
185
|
+
nextMonthLabel: nextMonthLabel,
|
|
186
|
+
previousMonthLabel: previousMonthLabel,
|
|
187
|
+
nextHeading: getNextHeading(),
|
|
188
|
+
previousHeading: getPreviousHeading(),
|
|
189
|
+
handleClickNext: handleClickNext,
|
|
190
|
+
handleClickPrev: handleClickPrev,
|
|
191
|
+
headerId: headerId,
|
|
192
|
+
mode: mode,
|
|
193
|
+
tabIndex: tabIndex,
|
|
194
|
+
testId: testId
|
|
195
|
+
}), jsx(Box, {
|
|
196
|
+
role: "grid",
|
|
197
|
+
tabIndex: tabIndex,
|
|
198
|
+
onKeyDown: handleContainerKeyDown,
|
|
199
|
+
"aria-labelledby": headerId,
|
|
200
|
+
testId: testId && `${testId}--calendar-dates`
|
|
201
|
+
}, jsx(WeekHeaderComponent, {
|
|
202
|
+
daysShort: daysShort,
|
|
203
|
+
mode: mode,
|
|
204
|
+
testId: testId
|
|
205
|
+
}), jsx(WeekDaysComponent, {
|
|
206
|
+
weeks: weeks,
|
|
207
|
+
handleClickDay: handleClickDay,
|
|
208
|
+
mode: mode,
|
|
209
|
+
monthsLong: monthsLong,
|
|
210
|
+
shouldSetFocus: shouldSetFocus,
|
|
211
|
+
tabIndex: tabIndex,
|
|
212
|
+
testId: testId
|
|
213
|
+
})))));
|
|
217
214
|
});
|
|
218
215
|
|
|
219
216
|
/**
|
|
@@ -10,13 +10,16 @@ import { Grid } from '@atlaskit/primitives';
|
|
|
10
10
|
*/
|
|
11
11
|
const WeekDayGrid = ({
|
|
12
12
|
testId,
|
|
13
|
-
children
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
children,
|
|
14
|
+
isHidden
|
|
15
|
+
}) => {
|
|
16
|
+
const row = jsx(Grid, {
|
|
17
|
+
testId: testId,
|
|
18
|
+
templateColumns: "repeat(7, minmax(max-content, 1fr))",
|
|
19
|
+
role: "row"
|
|
20
|
+
}, children);
|
|
21
|
+
return isHidden ? jsx("div", {
|
|
22
|
+
"aria-hidden": "true"
|
|
23
|
+
}, row) : row;
|
|
24
|
+
};
|
|
22
25
|
export default WeekDayGrid;
|
|
@@ -13,35 +13,30 @@ const WeekDays = /*#__PURE__*/memo(function WeekDays({
|
|
|
13
13
|
tabIndex,
|
|
14
14
|
testId
|
|
15
15
|
}) {
|
|
16
|
-
return (
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
shouldSetFocus: shouldSetFocus,
|
|
41
|
-
tabIndex: tabIndex,
|
|
42
|
-
testId: testId
|
|
43
|
-
}, weekDay.day)))))
|
|
44
|
-
);
|
|
16
|
+
return jsx(Box, {
|
|
17
|
+
role: "rowgroup",
|
|
18
|
+
testId: testId && `${testId}--month`
|
|
19
|
+
}, weeks.map((week, i) => jsx(WeekdayGrid, {
|
|
20
|
+
key: i,
|
|
21
|
+
testId: testId && `${testId}--week`
|
|
22
|
+
}, week.values.map(weekDay => jsx(DateComponent, {
|
|
23
|
+
key: `${week.id}-${weekDay.id}`,
|
|
24
|
+
isDisabled: weekDay.isDisabled,
|
|
25
|
+
isFocused: weekDay.isFocused,
|
|
26
|
+
isToday: weekDay.isToday,
|
|
27
|
+
dayLong: weekDay.weekDayName,
|
|
28
|
+
month: weekDay.month,
|
|
29
|
+
monthLong: monthsLong[weekDay.month - 1],
|
|
30
|
+
onClick: handleClickDay,
|
|
31
|
+
isPreviouslySelected: weekDay.isPreviouslySelected,
|
|
32
|
+
isSelected: weekDay.isSelected,
|
|
33
|
+
isSibling: weekDay.isSiblingMonth,
|
|
34
|
+
year: weekDay.year,
|
|
35
|
+
mode: mode,
|
|
36
|
+
shouldSetFocus: shouldSetFocus,
|
|
37
|
+
tabIndex: tabIndex,
|
|
38
|
+
testId: testId
|
|
39
|
+
}, weekDay.day)))));
|
|
45
40
|
});
|
|
46
41
|
WeekDays.displayName = 'WeekDays';
|
|
47
42
|
|
|
@@ -19,9 +19,9 @@ const WeekHeader = /*#__PURE__*/memo(function WeekHeader({
|
|
|
19
19
|
testId
|
|
20
20
|
}) {
|
|
21
21
|
return jsx(WeekDayGrid, {
|
|
22
|
+
isHidden: true,
|
|
22
23
|
testId: testId && `${testId}--column-headers`
|
|
23
24
|
}, daysShort.map(shortDay => jsx(Box, {
|
|
24
|
-
"aria-hidden": "true",
|
|
25
25
|
padding: "space.100",
|
|
26
26
|
xcss: columnHeaderStyles,
|
|
27
27
|
key: shortDay,
|
package/dist/esm/calendar.js
CHANGED
|
@@ -29,7 +29,7 @@ var boxStyles = xcss({
|
|
|
29
29
|
var analyticsAttributes = {
|
|
30
30
|
componentName: 'calendar',
|
|
31
31
|
packageName: "@atlaskit/calendar",
|
|
32
|
-
packageVersion: "13.3.
|
|
32
|
+
packageVersion: "13.3.2"
|
|
33
33
|
};
|
|
34
34
|
var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
|
|
35
35
|
var day = _ref.day,
|
|
@@ -185,58 +185,55 @@ var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
|
|
|
185
185
|
return "".concat(monthsLong[previousMonth], " ").concat(showPreviousYear ? yearValue - 1 : yearValue);
|
|
186
186
|
};
|
|
187
187
|
var headerId = useUniqueId('month-year-header');
|
|
188
|
-
return (
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
,
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
testId: testId
|
|
238
|
-
})))))
|
|
239
|
-
);
|
|
188
|
+
return jsx("div", {
|
|
189
|
+
className: className,
|
|
190
|
+
style: style,
|
|
191
|
+
onBlur: handleContainerBlur,
|
|
192
|
+
onFocus: handleContainerFocus,
|
|
193
|
+
"data-testid": testId && "".concat(testId, "--container"),
|
|
194
|
+
ref: ref
|
|
195
|
+
}, jsx(Box, {
|
|
196
|
+
xcss: boxStyles,
|
|
197
|
+
padding: "space.200",
|
|
198
|
+
"aria-label": "calendar",
|
|
199
|
+
testId: testId && "".concat(testId, "--calendar")
|
|
200
|
+
}, jsx(Stack, {
|
|
201
|
+
space: "space.150"
|
|
202
|
+
}, jsx(Header
|
|
203
|
+
// The month number needs to be translated to index in the month
|
|
204
|
+
// name array e.g. 1 (January) -> 0
|
|
205
|
+
, {
|
|
206
|
+
monthLongTitle: monthsLong[monthValue - 1],
|
|
207
|
+
year: yearValue,
|
|
208
|
+
nextMonthLabel: nextMonthLabel,
|
|
209
|
+
previousMonthLabel: previousMonthLabel,
|
|
210
|
+
nextHeading: getNextHeading(),
|
|
211
|
+
previousHeading: getPreviousHeading(),
|
|
212
|
+
handleClickNext: handleClickNext,
|
|
213
|
+
handleClickPrev: handleClickPrev,
|
|
214
|
+
headerId: headerId,
|
|
215
|
+
mode: mode,
|
|
216
|
+
tabIndex: tabIndex,
|
|
217
|
+
testId: testId
|
|
218
|
+
}), jsx(Box, {
|
|
219
|
+
role: "grid",
|
|
220
|
+
tabIndex: tabIndex,
|
|
221
|
+
onKeyDown: handleContainerKeyDown,
|
|
222
|
+
"aria-labelledby": headerId,
|
|
223
|
+
testId: testId && "".concat(testId, "--calendar-dates")
|
|
224
|
+
}, jsx(WeekHeaderComponent, {
|
|
225
|
+
daysShort: daysShort,
|
|
226
|
+
mode: mode,
|
|
227
|
+
testId: testId
|
|
228
|
+
}), jsx(WeekDaysComponent, {
|
|
229
|
+
weeks: weeks,
|
|
230
|
+
handleClickDay: handleClickDay,
|
|
231
|
+
mode: mode,
|
|
232
|
+
monthsLong: monthsLong,
|
|
233
|
+
shouldSetFocus: shouldSetFocus,
|
|
234
|
+
tabIndex: tabIndex,
|
|
235
|
+
testId: testId
|
|
236
|
+
})))));
|
|
240
237
|
});
|
|
241
238
|
|
|
242
239
|
/**
|