@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.
@@ -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.0"
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
- // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/no-static-element-interactions
196
- (0, _react2.jsx)("div", {
197
- className: className,
198
- style: style,
199
- onBlur: handleContainerBlur,
200
- onFocus: handleContainerFocus,
201
- "data-testid": testId && "".concat(testId, "--container"),
202
- ref: ref
203
- }, (0, _react2.jsx)(_primitives.Box, {
204
- xcss: boxStyles,
205
- padding: "space.200",
206
- "aria-label": "calendar",
207
- testId: testId && "".concat(testId, "--calendar")
208
- }, (0, _react2.jsx)(_primitives.Stack, {
209
- space: "space.150"
210
- }, (0, _react2.jsx)(_header.default
211
- // The month number needs to be translated to index in the month
212
- // name array e.g. 1 (January) -> 0
213
- , {
214
- monthLongTitle: monthsLong[monthValue - 1],
215
- year: yearValue,
216
- nextMonthLabel: nextMonthLabel,
217
- previousMonthLabel: previousMonthLabel,
218
- nextHeading: getNextHeading(),
219
- previousHeading: getPreviousHeading(),
220
- handleClickNext: handleClickNext,
221
- handleClickPrev: handleClickPrev,
222
- headerId: headerId,
223
- mode: mode,
224
- tabIndex: tabIndex,
225
- testId: testId
226
- }), (0, _react2.jsx)(_primitives.Box, {
227
- role: "grid",
228
- tabIndex: tabIndex,
229
- onKeyDown: handleContainerKeyDown,
230
- "aria-labelledby": headerId,
231
- testId: testId && "".concat(testId, "--calendar-dates")
232
- }, (0, _react2.jsx)(_weekHeader.default, {
233
- daysShort: daysShort,
234
- mode: mode,
235
- testId: testId
236
- }), (0, _react2.jsx)(_weekDays.default, {
237
- weeks: weeks,
238
- handleClickDay: handleClickDay,
239
- mode: mode,
240
- monthsLong: monthsLong,
241
- shouldSetFocus: shouldSetFocus,
242
- tabIndex: tabIndex,
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
- return (
21
- // TODO: Determine if there is a better way to render the row (should be
22
- // fixed with introduction of keyboard accessibility of Calendar in DSP-9939) (DSP-11588)
23
- (0, _react.jsx)(_primitives.Grid, {
24
- testId: testId,
25
- templateColumns: "repeat(7, minmax(max-content, 1fr))",
26
- role: "row"
27
- }, children)
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
- // TODO: Determine if there is a better way to render the button (should be
25
- // fixed with introduction of keyboard accessibility of Calendar in
26
- // DSP-9939) (DSP-11588)
27
- (0, _react2.jsx)(_box.default, {
28
- role: "rowgroup",
29
- testId: testId && "".concat(testId, "--month")
30
- }, weeks.map(function (week, i) {
31
- return (0, _react2.jsx)(_weekDayGrid.default, {
32
- key: i,
33
- testId: testId && "".concat(testId, "--week")
34
- }, week.values.map(function (weekDay) {
35
- return (0, _react2.jsx)(_date.default, {
36
- key: "".concat(week.id, "-").concat(weekDay.id),
37
- isDisabled: weekDay.isDisabled,
38
- isFocused: weekDay.isFocused,
39
- isToday: weekDay.isToday,
40
- dayLong: weekDay.weekDayName,
41
- month: weekDay.month,
42
- monthLong: monthsLong[weekDay.month - 1],
43
- onClick: handleClickDay,
44
- isPreviouslySelected: weekDay.isPreviouslySelected,
45
- isSelected: weekDay.isSelected,
46
- isSibling: weekDay.isSiblingMonth,
47
- year: weekDay.year,
48
- mode: mode,
49
- shouldSetFocus: shouldSetFocus,
50
- tabIndex: tabIndex,
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.arrowKeys = arrowKeys;
14
- var daysPerWeek = 7;
15
- exports.daysPerWeek = daysPerWeek;
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
+ };
@@ -25,7 +25,7 @@ const boxStyles = xcss({
25
25
  const analyticsAttributes = {
26
26
  componentName: 'calendar',
27
27
  packageName: "@atlaskit/calendar",
28
- packageVersion: "13.3.0"
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
- // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/no-static-element-interactions
167
- jsx("div", {
168
- className: className,
169
- style: style,
170
- onBlur: handleContainerBlur,
171
- onFocus: handleContainerFocus,
172
- "data-testid": testId && `${testId}--container`,
173
- ref: ref
174
- }, jsx(Box, {
175
- xcss: boxStyles,
176
- padding: "space.200",
177
- "aria-label": "calendar",
178
- testId: testId && `${testId}--calendar`
179
- }, jsx(Stack, {
180
- space: "space.150"
181
- }, jsx(Header
182
- // The month number needs to be translated to index in the month
183
- // name array e.g. 1 (January) -> 0
184
- , {
185
- monthLongTitle: monthsLong[monthValue - 1],
186
- year: yearValue,
187
- nextMonthLabel: nextMonthLabel,
188
- previousMonthLabel: previousMonthLabel,
189
- nextHeading: getNextHeading(),
190
- previousHeading: getPreviousHeading(),
191
- handleClickNext: handleClickNext,
192
- handleClickPrev: handleClickPrev,
193
- headerId: headerId,
194
- mode: mode,
195
- tabIndex: tabIndex,
196
- testId: testId
197
- }), jsx(Box, {
198
- role: "grid",
199
- tabIndex: tabIndex,
200
- onKeyDown: handleContainerKeyDown,
201
- "aria-labelledby": headerId,
202
- testId: testId && `${testId}--calendar-dates`
203
- }, jsx(WeekHeaderComponent, {
204
- daysShort: daysShort,
205
- mode: mode,
206
- testId: testId
207
- }), jsx(WeekDaysComponent, {
208
- weeks: weeks,
209
- handleClickDay: handleClickDay,
210
- mode: mode,
211
- monthsLong: monthsLong,
212
- shouldSetFocus: shouldSetFocus,
213
- tabIndex: tabIndex,
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
- // TODO: Determine if there is a better way to render the row (should be
16
- // fixed with introduction of keyboard accessibility of Calendar in DSP-9939) (DSP-11588)
17
- jsx(Grid, {
18
- testId: testId,
19
- templateColumns: "repeat(7, minmax(max-content, 1fr))",
20
- role: "row"
21
- }, children);
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
- // TODO: Determine if there is a better way to render the button (should be
18
- // fixed with introduction of keyboard accessibility of Calendar in
19
- // DSP-9939) (DSP-11588)
20
- jsx(Box, {
21
- role: "rowgroup",
22
- testId: testId && `${testId}--month`
23
- }, weeks.map((week, i) => jsx(WeekdayGrid, {
24
- key: i,
25
- testId: testId && `${testId}--week`
26
- }, week.values.map(weekDay => jsx(DateComponent, {
27
- key: `${week.id}-${weekDay.id}`,
28
- isDisabled: weekDay.isDisabled,
29
- isFocused: weekDay.isFocused,
30
- isToday: weekDay.isToday,
31
- dayLong: weekDay.weekDayName,
32
- month: weekDay.month,
33
- monthLong: monthsLong[weekDay.month - 1],
34
- onClick: handleClickDay,
35
- isPreviouslySelected: weekDay.isPreviouslySelected,
36
- isSelected: weekDay.isSelected,
37
- isSibling: weekDay.isSiblingMonth,
38
- year: weekDay.year,
39
- mode: mode,
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,
@@ -29,7 +29,7 @@ var boxStyles = xcss({
29
29
  var analyticsAttributes = {
30
30
  componentName: 'calendar',
31
31
  packageName: "@atlaskit/calendar",
32
- packageVersion: "13.3.0"
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
- // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/no-static-element-interactions
190
- jsx("div", {
191
- className: className,
192
- style: style,
193
- onBlur: handleContainerBlur,
194
- onFocus: handleContainerFocus,
195
- "data-testid": testId && "".concat(testId, "--container"),
196
- ref: ref
197
- }, jsx(Box, {
198
- xcss: boxStyles,
199
- padding: "space.200",
200
- "aria-label": "calendar",
201
- testId: testId && "".concat(testId, "--calendar")
202
- }, jsx(Stack, {
203
- space: "space.150"
204
- }, jsx(Header
205
- // The month number needs to be translated to index in the month
206
- // name array e.g. 1 (January) -> 0
207
- , {
208
- monthLongTitle: monthsLong[monthValue - 1],
209
- year: yearValue,
210
- nextMonthLabel: nextMonthLabel,
211
- previousMonthLabel: previousMonthLabel,
212
- nextHeading: getNextHeading(),
213
- previousHeading: getPreviousHeading(),
214
- handleClickNext: handleClickNext,
215
- handleClickPrev: handleClickPrev,
216
- headerId: headerId,
217
- mode: mode,
218
- tabIndex: tabIndex,
219
- testId: testId
220
- }), jsx(Box, {
221
- role: "grid",
222
- tabIndex: tabIndex,
223
- onKeyDown: handleContainerKeyDown,
224
- "aria-labelledby": headerId,
225
- testId: testId && "".concat(testId, "--calendar-dates")
226
- }, jsx(WeekHeaderComponent, {
227
- daysShort: daysShort,
228
- mode: mode,
229
- testId: testId
230
- }), jsx(WeekDaysComponent, {
231
- weeks: weeks,
232
- handleClickDay: handleClickDay,
233
- mode: mode,
234
- monthsLong: monthsLong,
235
- shouldSetFocus: shouldSetFocus,
236
- tabIndex: tabIndex,
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
  /**