@atlaskit/calendar 14.3.5 → 14.4.0

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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/calendar
2
2
 
3
+ ## 14.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`974d1508085ce`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/974d1508085ce) -
8
+ Add a new prop `shouldSetFocusOnCurrentDay` to automatically set the focus to the current day.
9
+
10
+ ## 14.3.6
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
3
16
  ## 14.3.5
4
17
 
5
18
  ### Patch Changes
@@ -28,7 +28,8 @@ var _useUniqueId = _interopRequireDefault(require("./internal/hooks/use-unique-i
28
28
  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
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
30
  * @jsxRuntime classic
31
- */ /** @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
31
+ * @jsx jsx
32
+ */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
32
33
  var boxStyles = (0, _primitives.xcss)({
33
34
  display: 'inline-block',
34
35
  userSelect: 'none'
@@ -36,7 +37,7 @@ var boxStyles = (0, _primitives.xcss)({
36
37
  var analyticsAttributes = {
37
38
  componentName: 'calendar',
38
39
  packageName: "@atlaskit/calendar",
39
- packageVersion: "14.3.5"
40
+ packageVersion: "14.4.0"
40
41
  };
41
42
  var InnerCalendar = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_ref, ref) {
42
43
  var day = _ref.day,
@@ -67,6 +68,8 @@ var InnerCalendar = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_ref,
67
68
  previouslySelected = _ref.previouslySelected,
68
69
  previousMonthLabel = _ref.previousMonthLabel,
69
70
  selected = _ref.selected,
71
+ _ref$shouldSetFocusOn = _ref.shouldSetFocusOnCurrentDay,
72
+ shouldSetFocusOnCurrentDay = _ref$shouldSetFocusOn === void 0 ? false : _ref$shouldSetFocusOn,
70
73
  today = _ref.today,
71
74
  _ref$locale = _ref.locale,
72
75
  locale = _ref$locale === void 0 ? 'en-US' : _ref$locale,
@@ -234,7 +237,7 @@ var InnerCalendar = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_ref,
234
237
  weeks: weeks,
235
238
  handleClickDay: handleClickDay,
236
239
  monthsLong: monthsLong,
237
- shouldSetFocus: shouldSetFocus,
240
+ shouldSetFocus: shouldSetFocus || shouldSetFocusOnCurrentDay,
238
241
  tabIndex: tabIndex,
239
242
  testId: testId
240
243
  })))));
@@ -12,8 +12,8 @@ var _primitives = require("@atlaskit/primitives");
12
12
  var _date = require("../styles/date");
13
13
  /**
14
14
  * @jsxRuntime classic
15
+ * @jsx jsx
15
16
  */
16
- /** @jsx jsx */
17
17
 
18
18
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
19
19
 
@@ -16,8 +16,8 @@ var _primitives = require("@atlaskit/primitives");
16
16
  var _useUniqueId = _interopRequireDefault(require("../../internal/hooks/use-unique-id"));
17
17
  /**
18
18
  * @jsxRuntime classic
19
+ * @jsx jsx
19
20
  */
20
- /** @jsx jsx */
21
21
 
22
22
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
23
23
 
@@ -8,8 +8,8 @@ var _react = require("@emotion/react");
8
8
  var _primitives = require("@atlaskit/primitives");
9
9
  /**
10
10
  * @jsxRuntime classic
11
+ * @jsx jsx
11
12
  */
12
- /** @jsx jsx */
13
13
 
14
14
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
15
15
 
@@ -12,8 +12,8 @@ var _date = _interopRequireDefault(require("./date"));
12
12
  var _weekDayGrid = _interopRequireDefault(require("./week-day-grid"));
13
13
  /**
14
14
  * @jsxRuntime classic
15
+ * @jsx jsx
15
16
  */
16
- /** @jsx jsx */
17
17
 
18
18
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
19
19
 
@@ -11,8 +11,8 @@ var _primitives = require("@atlaskit/primitives");
11
11
  var _weekDayGrid = _interopRequireDefault(require("./week-day-grid"));
12
12
  /**
13
13
  * @jsxRuntime classic
14
+ * @jsx jsx
14
15
  */
15
- /** @jsx jsx */
16
16
 
17
17
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
18
18
 
@@ -1,8 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  /**
3
3
  * @jsxRuntime classic
4
+ * @jsx jsx
4
5
  */
5
- /** @jsx jsx */
6
6
  import { forwardRef, memo, useState } from 'react';
7
7
 
8
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
@@ -29,7 +29,7 @@ const boxStyles = xcss({
29
29
  const analyticsAttributes = {
30
30
  componentName: 'calendar',
31
31
  packageName: "@atlaskit/calendar",
32
- packageVersion: "14.3.5"
32
+ packageVersion: "14.4.0"
33
33
  };
34
34
  const InnerCalendar = /*#__PURE__*/forwardRef(function Calendar({
35
35
  day,
@@ -51,6 +51,7 @@ const InnerCalendar = /*#__PURE__*/forwardRef(function Calendar({
51
51
  previouslySelected,
52
52
  previousMonthLabel,
53
53
  selected,
54
+ shouldSetFocusOnCurrentDay = false,
54
55
  today,
55
56
  locale = 'en-US',
56
57
  year,
@@ -209,7 +210,7 @@ const InnerCalendar = /*#__PURE__*/forwardRef(function Calendar({
209
210
  weeks: weeks,
210
211
  handleClickDay: handleClickDay,
211
212
  monthsLong: monthsLong,
212
- shouldSetFocus: shouldSetFocus,
213
+ shouldSetFocus: shouldSetFocus || shouldSetFocusOnCurrentDay,
213
214
  tabIndex: tabIndex,
214
215
  testId: testId
215
216
  })))));
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @jsxRuntime classic
3
+ * @jsx jsx
3
4
  */
4
- /** @jsx jsx */
5
5
  import { forwardRef, memo, useCallback, useEffect, useRef } from 'react';
6
6
 
7
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @jsxRuntime classic
3
+ * @jsx jsx
3
4
  */
4
- /** @jsx jsx */
5
5
  import { memo, useState } from 'react';
6
6
 
7
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @jsxRuntime classic
3
+ * @jsx jsx
3
4
  */
4
- /** @jsx jsx */
5
5
 
6
6
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
7
  import { jsx } from '@emotion/react';
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @jsxRuntime classic
3
+ * @jsx jsx
3
4
  */
4
- /** @jsx jsx */
5
5
  import { memo } from 'react';
6
6
 
7
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @jsxRuntime classic
3
+ * @jsx jsx
3
4
  */
4
- /** @jsx jsx */
5
5
  import { memo } from 'react';
6
6
 
7
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
@@ -5,8 +5,8 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
5
5
  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
6
  /**
7
7
  * @jsxRuntime classic
8
+ * @jsx jsx
8
9
  */
9
- /** @jsx jsx */
10
10
  import { forwardRef, memo, useState } from 'react';
11
11
 
12
12
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
@@ -33,7 +33,7 @@ var boxStyles = xcss({
33
33
  var analyticsAttributes = {
34
34
  componentName: 'calendar',
35
35
  packageName: "@atlaskit/calendar",
36
- packageVersion: "14.3.5"
36
+ packageVersion: "14.4.0"
37
37
  };
38
38
  var InnerCalendar = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
39
39
  var day = _ref.day,
@@ -64,6 +64,8 @@ var InnerCalendar = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
64
64
  previouslySelected = _ref.previouslySelected,
65
65
  previousMonthLabel = _ref.previousMonthLabel,
66
66
  selected = _ref.selected,
67
+ _ref$shouldSetFocusOn = _ref.shouldSetFocusOnCurrentDay,
68
+ shouldSetFocusOnCurrentDay = _ref$shouldSetFocusOn === void 0 ? false : _ref$shouldSetFocusOn,
67
69
  today = _ref.today,
68
70
  _ref$locale = _ref.locale,
69
71
  locale = _ref$locale === void 0 ? 'en-US' : _ref$locale,
@@ -231,7 +233,7 @@ var InnerCalendar = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
231
233
  weeks: weeks,
232
234
  handleClickDay: handleClickDay,
233
235
  monthsLong: monthsLong,
234
- shouldSetFocus: shouldSetFocus,
236
+ shouldSetFocus: shouldSetFocus || shouldSetFocusOnCurrentDay,
235
237
  tabIndex: tabIndex,
236
238
  testId: testId
237
239
  })))));
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @jsxRuntime classic
3
+ * @jsx jsx
3
4
  */
4
- /** @jsx jsx */
5
5
  import { forwardRef, memo, useCallback, useEffect, useRef } from 'react';
6
6
 
7
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
@@ -1,8 +1,8 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  /**
3
3
  * @jsxRuntime classic
4
+ * @jsx jsx
4
5
  */
5
- /** @jsx jsx */
6
6
  import { memo, useState } from 'react';
7
7
 
8
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @jsxRuntime classic
3
+ * @jsx jsx
3
4
  */
4
- /** @jsx jsx */
5
5
 
6
6
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
7
  import { jsx } from '@emotion/react';
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @jsxRuntime classic
3
+ * @jsx jsx
3
4
  */
4
- /** @jsx jsx */
5
5
  import { memo } from 'react';
6
6
 
7
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @jsxRuntime classic
3
+ * @jsx jsx
3
4
  */
4
- /** @jsx jsx */
5
5
  import { memo } from 'react';
6
6
 
7
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
@@ -9,5 +9,5 @@ import type { CalendarProps } from './types';
9
9
  * - [Code](https://atlassian.design/components/calendar/code)
10
10
  * - [Usage](https://atlassian.design/components/calendar/usage)
11
11
  */
12
- declare const Calendar: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Pick<CalendarProps, "day" | "defaultDay" | "defaultMonth" | "defaultPreviouslySelected" | "defaultSelected" | "defaultYear" | "disabled" | "disabledDateFilter" | "maxDate" | "minDate" | "month" | "nextMonthLabel" | "onBlur" | "onChange" | "onFocus" | "onSelect" | "previouslySelected" | "previousMonthLabel" | "selected" | "today" | "year" | "locale" | "analyticsContext" | "weekStartDay" | "testId" | "className" | "style" | "calendarRef" | "tabIndex" | "createAnalyticsEvent"> & import("react").RefAttributes<HTMLDivElement>>>;
12
+ declare const Calendar: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Pick<CalendarProps, "day" | "defaultDay" | "defaultMonth" | "defaultPreviouslySelected" | "defaultSelected" | "defaultYear" | "disabled" | "disabledDateFilter" | "maxDate" | "minDate" | "month" | "nextMonthLabel" | "onBlur" | "onChange" | "onFocus" | "onSelect" | "previouslySelected" | "previousMonthLabel" | "selected" | "today" | "year" | "locale" | "analyticsContext" | "weekStartDay" | "testId" | "className" | "style" | "calendarRef" | "tabIndex" | "shouldSetFocusOnCurrentDay" | "createAnalyticsEvent"> & import("react").RefAttributes<HTMLDivElement>>>;
13
13
  export default Calendar;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @jsxRuntime classic
3
+ * @jsx jsx
3
4
  */
4
- /** @jsx jsx */
5
5
  import { type ReactNode } from 'react';
6
6
  import { jsx } from '@emotion/react';
7
7
  interface WeekDayGridProps extends React.HTMLAttributes<HTMLElement> {
@@ -149,6 +149,11 @@ export interface CalendarProps extends WithAnalyticsEventsProps {
149
149
  * programmatically. Defaults to "0".
150
150
  */
151
151
  tabIndex?: TabIndex;
152
+ /**
153
+ * This allows the calendar to automatically set the focus to the current day.
154
+ * The default is false.
155
+ */
156
+ shouldSetFocusOnCurrentDay?: boolean;
152
157
  }
153
158
  export interface CalendarRef {
154
159
  navigate: (type: ArrowKeys) => void;
@@ -9,5 +9,5 @@ import type { CalendarProps } from './types';
9
9
  * - [Code](https://atlassian.design/components/calendar/code)
10
10
  * - [Usage](https://atlassian.design/components/calendar/usage)
11
11
  */
12
- declare const Calendar: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Pick<CalendarProps, "day" | "defaultDay" | "defaultMonth" | "defaultPreviouslySelected" | "defaultSelected" | "defaultYear" | "disabled" | "disabledDateFilter" | "maxDate" | "minDate" | "month" | "nextMonthLabel" | "onBlur" | "onChange" | "onFocus" | "onSelect" | "previouslySelected" | "previousMonthLabel" | "selected" | "today" | "year" | "locale" | "analyticsContext" | "weekStartDay" | "testId" | "className" | "style" | "calendarRef" | "tabIndex" | "createAnalyticsEvent"> & import("react").RefAttributes<HTMLDivElement>>>;
12
+ declare const Calendar: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Pick<CalendarProps, "day" | "defaultDay" | "defaultMonth" | "defaultPreviouslySelected" | "defaultSelected" | "defaultYear" | "disabled" | "disabledDateFilter" | "maxDate" | "minDate" | "month" | "nextMonthLabel" | "onBlur" | "onChange" | "onFocus" | "onSelect" | "previouslySelected" | "previousMonthLabel" | "selected" | "today" | "year" | "locale" | "analyticsContext" | "weekStartDay" | "testId" | "className" | "style" | "calendarRef" | "tabIndex" | "shouldSetFocusOnCurrentDay" | "createAnalyticsEvent"> & import("react").RefAttributes<HTMLDivElement>>>;
13
13
  export default Calendar;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @jsxRuntime classic
3
+ * @jsx jsx
3
4
  */
4
- /** @jsx jsx */
5
5
  import { type ReactNode } from 'react';
6
6
  import { jsx } from '@emotion/react';
7
7
  interface WeekDayGridProps extends React.HTMLAttributes<HTMLElement> {
@@ -149,6 +149,11 @@ export interface CalendarProps extends WithAnalyticsEventsProps {
149
149
  * programmatically. Defaults to "0".
150
150
  */
151
151
  tabIndex?: TabIndex;
152
+ /**
153
+ * This allows the calendar to automatically set the focus to the current day.
154
+ * The default is false.
155
+ */
156
+ shouldSetFocusOnCurrentDay?: boolean;
152
157
  }
153
158
  export interface CalendarRef {
154
159
  navigate: (type: ArrowKeys) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/calendar",
3
- "version": "14.3.5",
3
+ "version": "14.4.0",
4
4
  "description": "An interactive calendar for date selection experiences.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -28,14 +28,14 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@atlaskit/analytics-next": "^9.3.0",
31
- "@atlaskit/button": "^18.3.0",
31
+ "@atlaskit/button": "^19.1.0",
32
32
  "@atlaskit/ds-lib": "^2.3.0",
33
33
  "@atlaskit/heading": "^2.4.0",
34
- "@atlaskit/icon": "^22.6.0",
34
+ "@atlaskit/icon": "^22.7.0",
35
35
  "@atlaskit/locale": "^2.7.0",
36
36
  "@atlaskit/primitives": "^11.0.0",
37
37
  "@atlaskit/theme": "^12.11.0",
38
- "@atlaskit/tokens": "^1.53.0",
38
+ "@atlaskit/tokens": "^1.56.0",
39
39
  "@babel/runtime": "^7.0.0",
40
40
  "@emotion/react": "^11.7.1",
41
41
  "date-fns": "^2.17.0",