@atlaskit/calendar 13.3.1 → 13.3.3

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.
@@ -29,7 +29,7 @@ var boxStyles = xcss({
29
29
  var analyticsAttributes = {
30
30
  componentName: 'calendar',
31
31
  packageName: "@atlaskit/calendar",
32
- packageVersion: "13.3.1"
32
+ packageVersion: "13.3.3"
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
  /**
@@ -4,30 +4,30 @@ import { css, jsx } from '@emotion/react';
4
4
  import noop from '@atlaskit/ds-lib/noop';
5
5
  import { Grid } from '@atlaskit/primitives';
6
6
  import { dateCellStyles as getDateCellStyles } from '../styles/date';
7
- var Date = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Date(_ref, ref) {
8
- var day = _ref.children,
9
- _ref$isDisabled = _ref.isDisabled,
10
- isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
11
- _ref$isFocused = _ref.isFocused,
12
- isFocused = _ref$isFocused === void 0 ? false : _ref$isFocused,
13
- _ref$isToday = _ref.isToday,
14
- isToday = _ref$isToday === void 0 ? false : _ref$isToday,
15
- dayLong = _ref.dayLong,
16
- month = _ref.month,
17
- monthLong = _ref.monthLong,
18
- _ref$onClick = _ref.onClick,
19
- onClick = _ref$onClick === void 0 ? noop : _ref$onClick,
20
- _ref$isPreviouslySele = _ref.isPreviouslySelected,
21
- isPreviouslySelected = _ref$isPreviouslySele === void 0 ? false : _ref$isPreviouslySele,
22
- _ref$isSelected = _ref.isSelected,
23
- isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,
24
- _ref$isSibling = _ref.isSibling,
25
- isSibling = _ref$isSibling === void 0 ? false : _ref$isSibling,
26
- year = _ref.year,
27
- mode = _ref.mode,
28
- shouldSetFocus = _ref.shouldSetFocus,
29
- tabIndex = _ref.tabIndex,
30
- testId = _ref.testId;
7
+ var Date = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Date(_ref2, _ref) {
8
+ var day = _ref2.children,
9
+ _ref2$isDisabled = _ref2.isDisabled,
10
+ isDisabled = _ref2$isDisabled === void 0 ? false : _ref2$isDisabled,
11
+ _ref2$isFocused = _ref2.isFocused,
12
+ isFocused = _ref2$isFocused === void 0 ? false : _ref2$isFocused,
13
+ _ref2$isToday = _ref2.isToday,
14
+ isToday = _ref2$isToday === void 0 ? false : _ref2$isToday,
15
+ dayLong = _ref2.dayLong,
16
+ month = _ref2.month,
17
+ monthLong = _ref2.monthLong,
18
+ _ref2$onClick = _ref2.onClick,
19
+ onClick = _ref2$onClick === void 0 ? noop : _ref2$onClick,
20
+ _ref2$isPreviouslySel = _ref2.isPreviouslySelected,
21
+ isPreviouslySelected = _ref2$isPreviouslySel === void 0 ? false : _ref2$isPreviouslySel,
22
+ _ref2$isSelected = _ref2.isSelected,
23
+ isSelected = _ref2$isSelected === void 0 ? false : _ref2$isSelected,
24
+ _ref2$isSibling = _ref2.isSibling,
25
+ isSibling = _ref2$isSibling === void 0 ? false : _ref2$isSibling,
26
+ year = _ref2.year,
27
+ mode = _ref2.mode,
28
+ shouldSetFocus = _ref2.shouldSetFocus,
29
+ tabIndex = _ref2.tabIndex,
30
+ testId = _ref2.testId;
31
31
  var dateRef = useRef({
32
32
  day: day,
33
33
  month: month,
@@ -12,39 +12,34 @@ var WeekDays = /*#__PURE__*/memo(function WeekDays(_ref) {
12
12
  shouldSetFocus = _ref.shouldSetFocus,
13
13
  tabIndex = _ref.tabIndex,
14
14
  testId = _ref.testId;
15
- return (
16
- // TODO: Determine if there is a better way to render the button (should be
17
- // fixed with introduction of keyboard accessibility of Calendar in
18
- // DSP-9939) (DSP-11588)
19
- jsx(Box, {
20
- role: "rowgroup",
21
- testId: testId && "".concat(testId, "--month")
22
- }, weeks.map(function (week, i) {
23
- return jsx(WeekdayGrid, {
24
- key: i,
25
- testId: testId && "".concat(testId, "--week")
26
- }, week.values.map(function (weekDay) {
27
- return jsx(DateComponent, {
28
- key: "".concat(week.id, "-").concat(weekDay.id),
29
- isDisabled: weekDay.isDisabled,
30
- isFocused: weekDay.isFocused,
31
- isToday: weekDay.isToday,
32
- dayLong: weekDay.weekDayName,
33
- month: weekDay.month,
34
- monthLong: monthsLong[weekDay.month - 1],
35
- onClick: handleClickDay,
36
- isPreviouslySelected: weekDay.isPreviouslySelected,
37
- isSelected: weekDay.isSelected,
38
- isSibling: weekDay.isSiblingMonth,
39
- year: weekDay.year,
40
- mode: mode,
41
- shouldSetFocus: shouldSetFocus,
42
- tabIndex: tabIndex,
43
- testId: testId
44
- }, weekDay.day);
45
- }));
46
- }))
47
- );
15
+ return jsx(Box, {
16
+ role: "rowgroup",
17
+ testId: testId && "".concat(testId, "--month")
18
+ }, weeks.map(function (week, i) {
19
+ return jsx(WeekdayGrid, {
20
+ key: i,
21
+ testId: testId && "".concat(testId, "--week")
22
+ }, week.values.map(function (weekDay) {
23
+ return jsx(DateComponent, {
24
+ key: "".concat(week.id, "-").concat(weekDay.id),
25
+ isDisabled: weekDay.isDisabled,
26
+ isFocused: weekDay.isFocused,
27
+ isToday: weekDay.isToday,
28
+ dayLong: weekDay.weekDayName,
29
+ month: weekDay.month,
30
+ monthLong: monthsLong[weekDay.month - 1],
31
+ onClick: handleClickDay,
32
+ isPreviouslySelected: weekDay.isPreviouslySelected,
33
+ isSelected: weekDay.isSelected,
34
+ isSibling: weekDay.isSiblingMonth,
35
+ year: weekDay.year,
36
+ mode: mode,
37
+ shouldSetFocus: shouldSetFocus,
38
+ tabIndex: tabIndex,
39
+ testId: testId
40
+ }, weekDay.day);
41
+ }));
42
+ }));
48
43
  });
49
44
  WeekDays.displayName = 'WeekDays';
50
45
 
@@ -47,7 +47,7 @@ export default function useHandleDateChange(_ref) {
47
47
  yearValue = _ref$year[0],
48
48
  setYearValue = _ref$year[1],
49
49
  _ref$shouldSetFocus = _slicedToArray(_ref.shouldSetFocus, 2),
50
- shouldSetFocus = _ref$shouldSetFocus[0],
50
+ _shouldSetFocus = _ref$shouldSetFocus[0],
51
51
  setShouldSetFocus = _ref$shouldSetFocus[1],
52
52
  onChange = _ref.onChange;
53
53
  var dateRef = useRef({
@@ -1,6 +1,6 @@
1
1
  import type { ChangeEvent } from '../../types';
2
2
  import type { ArrowKeys } from '../types';
3
- export default function useHandleDateChange({ day: [dayValue, setDayValue], month: [monthValue, setMonthValue], year: [yearValue, setYearValue], shouldSetFocus: [shouldSetFocus, setShouldSetFocus], onChange, }: {
3
+ export default function useHandleDateChange({ day: [dayValue, setDayValue], month: [monthValue, setMonthValue], year: [yearValue, setYearValue], shouldSetFocus: [_shouldSetFocus, setShouldSetFocus], onChange, }: {
4
4
  day: readonly [number, (newValue: number) => void];
5
5
  month: readonly [number, (newValue: number) => void];
6
6
  year: readonly [number, (newValue: number) => void];
@@ -1,6 +1,6 @@
1
1
  import type { ChangeEvent } from '../../types';
2
2
  import type { ArrowKeys } from '../types';
3
- export default function useHandleDateChange({ day: [dayValue, setDayValue], month: [monthValue, setMonthValue], year: [yearValue, setYearValue], shouldSetFocus: [shouldSetFocus, setShouldSetFocus], onChange, }: {
3
+ export default function useHandleDateChange({ day: [dayValue, setDayValue], month: [monthValue, setMonthValue], year: [yearValue, setYearValue], shouldSetFocus: [_shouldSetFocus, setShouldSetFocus], onChange, }: {
4
4
  day: readonly [
5
5
  number,
6
6
  (newValue: number) => void
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/calendar",
3
- "version": "13.3.1",
3
+ "version": "13.3.3",
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.9.0",
28
- "@atlaskit/ds-explorations": "^2.2.0",
27
+ "@atlaskit/button": "^16.13.0",
28
+ "@atlaskit/ds-explorations": "^3.0.0",
29
29
  "@atlaskit/ds-lib": "^2.2.0",
30
- "@atlaskit/heading": "^1.3.0",
30
+ "@atlaskit/heading": "^1.4.0",
31
31
  "@atlaskit/icon": "^21.12.0",
32
- "@atlaskit/locale": "^2.5.0",
33
- "@atlaskit/primitives": "^1.3.0",
32
+ "@atlaskit/locale": "^2.6.0",
33
+ "@atlaskit/primitives": "^1.9.0",
34
34
  "@atlaskit/theme": "^12.6.0",
35
- "@atlaskit/tokens": "^1.18.0",
35
+ "@atlaskit/tokens": "^1.28.0",
36
36
  "@babel/runtime": "^7.0.0",
37
37
  "@emotion/react": "^11.7.1",
38
38
  "date-fns": "^2.17.0",