@atlaskit/calendar 13.3.3 → 14.0.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,11 @@
1
1
  # @atlaskit/calendar
2
2
 
3
+ ## 14.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#41791](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41791) [`ec7c2a38247`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ec7c2a38247) - Removed all remaining legacy theming logic from the Calendar, Form, InlineDialog, InlineEdit and InlineMessage components.
8
+
3
9
  ## 13.3.3
4
10
 
5
11
  ### Patch Changes
@@ -13,7 +13,6 @@ var _react2 = require("@emotion/react");
13
13
  var _usePlatformLeafEventHandler = require("@atlaskit/analytics-next/usePlatformLeafEventHandler");
14
14
  var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
15
15
  var _primitives = require("@atlaskit/primitives");
16
- var _components = _interopRequireDefault(require("@atlaskit/theme/components"));
17
16
  var _header = _interopRequireDefault(require("./internal/components/header"));
18
17
  var _weekDays = _interopRequireDefault(require("./internal/components/week-days"));
19
18
  var _weekHeader = _interopRequireDefault(require("./internal/components/week-header"));
@@ -35,9 +34,9 @@ var boxStyles = (0, _primitives.xcss)({
35
34
  var analyticsAttributes = {
36
35
  componentName: 'calendar',
37
36
  packageName: "@atlaskit/calendar",
38
- packageVersion: "13.3.3"
37
+ packageVersion: "14.0.0"
39
38
  };
40
- var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_ref, ref) {
39
+ var InnerCalendar = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_ref, ref) {
41
40
  var day = _ref.day,
42
41
  _ref$defaultDay = _ref.defaultDay,
43
42
  defaultDay = _ref$defaultDay === void 0 ? 0 : _ref$defaultDay,
@@ -75,8 +74,6 @@ var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_re
75
74
  weekStartDay = _ref$weekStartDay === void 0 ? 0 : _ref$weekStartDay,
76
75
  testId = _ref.testId,
77
76
  calendarRef = _ref.calendarRef,
78
- _ref$mode = _ref.mode,
79
- mode = _ref$mode === void 0 ? 'light' : _ref$mode,
80
77
  className = _ref.className,
81
78
  style = _ref.style,
82
79
  _ref$tabIndex = _ref.tabIndex,
@@ -218,7 +215,6 @@ var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_re
218
215
  handleClickNext: handleClickNext,
219
216
  handleClickPrev: handleClickPrev,
220
217
  headerId: headerId,
221
- mode: mode,
222
218
  tabIndex: tabIndex,
223
219
  testId: testId
224
220
  }), (0, _react2.jsx)(_primitives.Box, {
@@ -229,12 +225,10 @@ var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_re
229
225
  testId: testId && "".concat(testId, "--calendar-dates")
230
226
  }, (0, _react2.jsx)(_weekHeader.default, {
231
227
  daysShort: daysShort,
232
- mode: mode,
233
228
  testId: testId
234
229
  }), (0, _react2.jsx)(_weekDays.default, {
235
230
  weeks: weeks,
236
231
  handleClickDay: handleClickDay,
237
- mode: mode,
238
232
  monthsLong: monthsLong,
239
233
  shouldSetFocus: shouldSetFocus,
240
234
  tabIndex: tabIndex,
@@ -252,13 +246,9 @@ var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_re
252
246
  * - [Usage](https://atlassian.design/components/calendar/usage)
253
247
  */
254
248
  var Calendar = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(function Calendar(props, ref) {
255
- return (0, _react2.jsx)(_components.default.Consumer, null, function (_ref2) {
256
- var mode = _ref2.mode;
257
- return (0, _react2.jsx)(CalendarWithMode, (0, _extends2.default)({}, props, {
258
- mode: mode,
259
- ref: ref
260
- }));
261
- });
249
+ return (0, _react2.jsx)(InnerCalendar, (0, _extends2.default)({}, props, {
250
+ ref: ref
251
+ }));
262
252
  }));
263
253
  Calendar.displayName = 'Calendar';
264
254
  var _default = exports.default = Calendar;
@@ -32,7 +32,6 @@ var Date = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(fu
32
32
  _ref2$isSibling = _ref2.isSibling,
33
33
  isSibling = _ref2$isSibling === void 0 ? false : _ref2$isSibling,
34
34
  year = _ref2.year,
35
- mode = _ref2.mode,
36
35
  shouldSetFocus = _ref2.shouldSetFocus,
37
36
  tabIndex = _ref2.tabIndex,
38
37
  testId = _ref2.testId;
@@ -70,9 +69,7 @@ var Date = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(fu
70
69
  });
71
70
  }
72
71
  }, [onClick]);
73
- var dateCellStyles = (0, _react.useMemo)(function () {
74
- return (0, _react2.css)((0, _date.dateCellStyles)(mode));
75
- }, [mode]);
72
+ var dateCellStyles = (0, _react2.css)((0, _date.dateCellStyles)());
76
73
  return (0, _react2.jsx)(_primitives.Grid, {
77
74
  role: "gridcell",
78
75
  alignItems: "center"
@@ -15,7 +15,6 @@ var _weekDayGrid = _interopRequireDefault(require("./week-day-grid"));
15
15
  var WeekDays = /*#__PURE__*/(0, _react.memo)(function WeekDays(_ref) {
16
16
  var weeks = _ref.weeks,
17
17
  handleClickDay = _ref.handleClickDay,
18
- mode = _ref.mode,
19
18
  monthsLong = _ref.monthsLong,
20
19
  shouldSetFocus = _ref.shouldSetFocus,
21
20
  tabIndex = _ref.tabIndex,
@@ -41,7 +40,6 @@ var WeekDays = /*#__PURE__*/(0, _react.memo)(function WeekDays(_ref) {
41
40
  isSelected: weekDay.isSelected,
42
41
  isSibling: weekDay.isSiblingMonth,
43
42
  year: weekDay.year,
44
- mode: mode,
45
43
  shouldSetFocus: shouldSetFocus,
46
44
  tabIndex: tabIndex,
47
45
  testId: testId
@@ -5,33 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.dateCellStyles = void 0;
7
7
  var _colors = require("@atlaskit/theme/colors");
8
- var textColor = {
9
- light: "var(--ds-text, ".concat(_colors.N900, ")"),
10
- dark: "var(--ds-text, ".concat(_colors.DN600, ")")
11
- };
12
- var textColorMedium = "var(--ds-text-subtle, ".concat(_colors.N600, ")");
13
- var todayColor = {
14
- light: "var(--ds-text-selected, ".concat(_colors.B400, ")"),
15
- dark: "var(--ds-text-selected, ".concat(_colors.B100, ")")
16
- };
17
- var hoverBackground = {
18
- light: "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N30, ")"),
19
- dark: "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N800, ")")
20
- };
21
- var textSelected = {
22
- light: "var(--ds-text-selected, ".concat(_colors.N0, ")"),
23
- dark: "var(--ds-text-selected, ".concat(_colors.N700, ")")
24
- };
25
- var selectedBackground = {
26
- light: "var(--ds-background-selected, ".concat(_colors.N500, ")"),
27
- dark: "var(--ds-background-selected, ".concat(_colors.N0, ")")
28
- };
29
- var borderColorFocused = {
30
- light: "var(--ds-border-focused, ".concat(_colors.B200, ")"),
31
- dark: "var(--ds-border-focused, ".concat(_colors.B100, ")")
32
- };
33
8
  var dateCellStyles = exports.dateCellStyles = function dateCellStyles() {
34
- var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'light';
35
9
  return {
36
10
  all: 'unset',
37
11
  display: 'block',
@@ -40,7 +14,7 @@ var dateCellStyles = exports.dateCellStyles = function dateCellStyles() {
40
14
  backgroundColor: 'transparent',
41
15
  border: '2px solid transparent',
42
16
  borderRadius: 3,
43
- color: textColor[mode],
17
+ color: "var(--ds-text, ".concat(_colors.N900, ")"),
44
18
  cursor: 'pointer',
45
19
  flexGrow: 1,
46
20
  fontSize: "var(--ds-font-size-100, 14px)",
@@ -49,7 +23,7 @@ var dateCellStyles = exports.dateCellStyles = function dateCellStyles() {
49
23
  color: "var(--ds-text-subtlest, ".concat(_colors.N200, ")")
50
24
  },
51
25
  '&[data-today]': {
52
- color: todayColor[mode],
26
+ color: "var(--ds-text-selected, ".concat(_colors.B400, ")"),
53
27
  fontWeight: "var(--ds-font-weight-bold, bold)",
54
28
  '&::after': {
55
29
  display: 'block',
@@ -67,30 +41,30 @@ var dateCellStyles = exports.dateCellStyles = function dateCellStyles() {
67
41
  color: "var(--ds-text-subtle, ".concat(_colors.N600, ")")
68
42
  },
69
43
  '&[data-selected]': {
70
- backgroundColor: selectedBackground[mode],
71
- color: textSelected[mode]
44
+ backgroundColor: "var(--ds-background-selected, ".concat(_colors.N500, ")"),
45
+ color: "var(--ds-text-selected, ".concat(_colors.N0, ")")
72
46
  },
73
47
  '&[data-disabled]': {
74
48
  color: "var(--ds-text-disabled, ".concat(_colors.N40, ")"),
75
49
  cursor: 'not-allowed'
76
50
  },
77
51
  '&:focus-visible': {
78
- border: "2px solid ".concat(borderColorFocused[mode])
52
+ border: "2px solid ".concat("var(--ds-border-focused, ".concat(_colors.B200, ")"))
79
53
  },
80
54
  '&:hover': {
81
- backgroundColor: hoverBackground[mode],
82
- color: textColor[mode]
55
+ backgroundColor: "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N30, ")"),
56
+ color: "var(--ds-text, ".concat(_colors.N900, ")")
83
57
  },
84
58
  '&:active': {
85
59
  backgroundColor: "var(--ds-background-neutral-subtle-pressed, ".concat(_colors.B50, ")"),
86
- color: textColor[mode]
60
+ color: "var(--ds-text, ".concat(_colors.N900, ")")
87
61
  },
88
62
  '&[data-selected]:hover': {
89
63
  backgroundColor: "var(--ds-background-selected-hovered, ".concat(_colors.B50, ")"),
90
64
  color: "var(--ds-text-selected, ".concat(_colors.N600, ")")
91
65
  },
92
66
  '&[data-prev-selected]:hover': {
93
- color: textColorMedium
67
+ color: "var(--ds-text-subtle, ".concat(_colors.N600, ")")
94
68
  },
95
69
  '&[data-sibling]:hover': {
96
70
  color: "var(--ds-text-subtlest, ".concat(_colors.N200, ")")
@@ -5,7 +5,6 @@ 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';
8
- import GlobalTheme from '@atlaskit/theme/components';
9
8
  import Header from './internal/components/header';
10
9
  import WeekDaysComponent from './internal/components/week-days';
11
10
  import WeekHeaderComponent from './internal/components/week-header';
@@ -25,9 +24,9 @@ const boxStyles = xcss({
25
24
  const analyticsAttributes = {
26
25
  componentName: 'calendar',
27
26
  packageName: "@atlaskit/calendar",
28
- packageVersion: "13.3.3"
27
+ packageVersion: "14.0.0"
29
28
  };
30
- const CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar({
29
+ const InnerCalendar = /*#__PURE__*/forwardRef(function Calendar({
31
30
  day,
32
31
  defaultDay = 0,
33
32
  defaultMonth = 0,
@@ -54,7 +53,6 @@ const CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar({
54
53
  weekStartDay = 0,
55
54
  testId,
56
55
  calendarRef,
57
- mode = 'light',
58
56
  className,
59
57
  style,
60
58
  tabIndex = 0
@@ -189,7 +187,6 @@ const CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar({
189
187
  handleClickNext: handleClickNext,
190
188
  handleClickPrev: handleClickPrev,
191
189
  headerId: headerId,
192
- mode: mode,
193
190
  tabIndex: tabIndex,
194
191
  testId: testId
195
192
  }), jsx(Box, {
@@ -200,12 +197,10 @@ const CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar({
200
197
  testId: testId && `${testId}--calendar-dates`
201
198
  }, jsx(WeekHeaderComponent, {
202
199
  daysShort: daysShort,
203
- mode: mode,
204
200
  testId: testId
205
201
  }), jsx(WeekDaysComponent, {
206
202
  weeks: weeks,
207
203
  handleClickDay: handleClickDay,
208
- mode: mode,
209
204
  monthsLong: monthsLong,
210
205
  shouldSetFocus: shouldSetFocus,
211
206
  tabIndex: tabIndex,
@@ -223,12 +218,9 @@ const CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar({
223
218
  * - [Usage](https://atlassian.design/components/calendar/usage)
224
219
  */
225
220
  const Calendar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Calendar(props, ref) {
226
- return jsx(GlobalTheme.Consumer, null, ({
227
- mode
228
- }) => jsx(CalendarWithMode, _extends({}, props, {
229
- mode: mode,
221
+ return jsx(InnerCalendar, _extends({}, props, {
230
222
  ref: ref
231
- })));
223
+ }));
232
224
  }));
233
225
  Calendar.displayName = 'Calendar';
234
226
  export default Calendar;
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { forwardRef, memo, useCallback, useEffect, useMemo, useRef } from 'react';
2
+ import { forwardRef, memo, useCallback, useEffect, useRef } from 'react';
3
3
  import { css, jsx } from '@emotion/react';
4
4
  import noop from '@atlaskit/ds-lib/noop';
5
5
  import { Grid } from '@atlaskit/primitives';
@@ -17,7 +17,6 @@ const Date = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Date({
17
17
  isSelected = false,
18
18
  isSibling = false,
19
19
  year,
20
- mode,
21
20
  shouldSetFocus,
22
21
  tabIndex,
23
22
  testId
@@ -57,7 +56,7 @@ const Date = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Date({
57
56
  });
58
57
  }
59
58
  }, [onClick]);
60
- const dateCellStyles = useMemo(() => css(getDateCellStyles(mode)), [mode]);
59
+ const dateCellStyles = css(getDateCellStyles());
61
60
  return jsx(Grid, {
62
61
  role: "gridcell",
63
62
  alignItems: "center"
@@ -7,7 +7,6 @@ import WeekdayGrid from './week-day-grid';
7
7
  const WeekDays = /*#__PURE__*/memo(function WeekDays({
8
8
  weeks,
9
9
  handleClickDay,
10
- mode,
11
10
  monthsLong,
12
11
  shouldSetFocus,
13
12
  tabIndex,
@@ -32,7 +31,6 @@ const WeekDays = /*#__PURE__*/memo(function WeekDays({
32
31
  isSelected: weekDay.isSelected,
33
32
  isSibling: weekDay.isSiblingMonth,
34
33
  year: weekDay.year,
35
- mode: mode,
36
34
  shouldSetFocus: shouldSetFocus,
37
35
  tabIndex: tabIndex,
38
36
  testId: testId
@@ -1,30 +1,5 @@
1
- import { B100, B200, B400, B50, DN600, N0, N200, N30, N40, N500, N600, N700, N800, N900 } from '@atlaskit/theme/colors';
2
- const textColor = {
3
- light: `var(--ds-text, ${N900})`,
4
- dark: `var(--ds-text, ${DN600})`
5
- };
6
- const textColorMedium = `var(--ds-text-subtle, ${N600})`;
7
- const todayColor = {
8
- light: `var(--ds-text-selected, ${B400})`,
9
- dark: `var(--ds-text-selected, ${B100})`
10
- };
11
- const hoverBackground = {
12
- light: `var(--ds-background-neutral-subtle-hovered, ${N30})`,
13
- dark: `var(--ds-background-neutral-subtle-hovered, ${N800})`
14
- };
15
- const textSelected = {
16
- light: `var(--ds-text-selected, ${N0})`,
17
- dark: `var(--ds-text-selected, ${N700})`
18
- };
19
- const selectedBackground = {
20
- light: `var(--ds-background-selected, ${N500})`,
21
- dark: `var(--ds-background-selected, ${N0})`
22
- };
23
- const borderColorFocused = {
24
- light: `var(--ds-border-focused, ${B200})`,
25
- dark: `var(--ds-border-focused, ${B100})`
26
- };
27
- export const dateCellStyles = (mode = 'light') => ({
1
+ import { B200, B400, B50, N0, N200, N30, N40, N500, N600, N900 } from '@atlaskit/theme/colors';
2
+ export const dateCellStyles = () => ({
28
3
  all: 'unset',
29
4
  display: 'block',
30
5
  padding: `${"var(--ds-space-050, 4px)"} 9px`,
@@ -32,7 +7,7 @@ export const dateCellStyles = (mode = 'light') => ({
32
7
  backgroundColor: 'transparent',
33
8
  border: '2px solid transparent',
34
9
  borderRadius: 3,
35
- color: textColor[mode],
10
+ color: `var(--ds-text, ${N900})`,
36
11
  cursor: 'pointer',
37
12
  flexGrow: 1,
38
13
  fontSize: "var(--ds-font-size-100, 14px)",
@@ -41,7 +16,7 @@ export const dateCellStyles = (mode = 'light') => ({
41
16
  color: `var(--ds-text-subtlest, ${N200})`
42
17
  },
43
18
  '&[data-today]': {
44
- color: todayColor[mode],
19
+ color: `var(--ds-text-selected, ${B400})`,
45
20
  fontWeight: "var(--ds-font-weight-bold, bold)",
46
21
  '&::after': {
47
22
  display: 'block',
@@ -59,30 +34,30 @@ export const dateCellStyles = (mode = 'light') => ({
59
34
  color: `var(--ds-text-subtle, ${N600})`
60
35
  },
61
36
  '&[data-selected]': {
62
- backgroundColor: selectedBackground[mode],
63
- color: textSelected[mode]
37
+ backgroundColor: `var(--ds-background-selected, ${N500})`,
38
+ color: `var(--ds-text-selected, ${N0})`
64
39
  },
65
40
  '&[data-disabled]': {
66
41
  color: `var(--ds-text-disabled, ${N40})`,
67
42
  cursor: 'not-allowed'
68
43
  },
69
44
  '&:focus-visible': {
70
- border: `2px solid ${borderColorFocused[mode]}`
45
+ border: `2px solid ${`var(--ds-border-focused, ${B200})`}`
71
46
  },
72
47
  '&:hover': {
73
- backgroundColor: hoverBackground[mode],
74
- color: textColor[mode]
48
+ backgroundColor: `var(--ds-background-neutral-subtle-hovered, ${N30})`,
49
+ color: `var(--ds-text, ${N900})`
75
50
  },
76
51
  '&:active': {
77
52
  backgroundColor: `var(--ds-background-neutral-subtle-pressed, ${B50})`,
78
- color: textColor[mode]
53
+ color: `var(--ds-text, ${N900})`
79
54
  },
80
55
  '&[data-selected]:hover': {
81
56
  backgroundColor: `var(--ds-background-selected-hovered, ${B50})`,
82
57
  color: `var(--ds-text-selected, ${N600})`
83
58
  },
84
59
  '&[data-prev-selected]:hover': {
85
- color: textColorMedium
60
+ color: `var(--ds-text-subtle, ${N600})`
86
61
  },
87
62
  '&[data-sibling]:hover': {
88
63
  color: `var(--ds-text-subtlest, ${N200})`
@@ -9,7 +9,6 @@ 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';
12
- import GlobalTheme from '@atlaskit/theme/components';
13
12
  import Header from './internal/components/header';
14
13
  import WeekDaysComponent from './internal/components/week-days';
15
14
  import WeekHeaderComponent from './internal/components/week-header';
@@ -29,9 +28,9 @@ var boxStyles = xcss({
29
28
  var analyticsAttributes = {
30
29
  componentName: 'calendar',
31
30
  packageName: "@atlaskit/calendar",
32
- packageVersion: "13.3.3"
31
+ packageVersion: "14.0.0"
33
32
  };
34
- var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
33
+ var InnerCalendar = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
35
34
  var day = _ref.day,
36
35
  _ref$defaultDay = _ref.defaultDay,
37
36
  defaultDay = _ref$defaultDay === void 0 ? 0 : _ref$defaultDay,
@@ -69,8 +68,6 @@ var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
69
68
  weekStartDay = _ref$weekStartDay === void 0 ? 0 : _ref$weekStartDay,
70
69
  testId = _ref.testId,
71
70
  calendarRef = _ref.calendarRef,
72
- _ref$mode = _ref.mode,
73
- mode = _ref$mode === void 0 ? 'light' : _ref$mode,
74
71
  className = _ref.className,
75
72
  style = _ref.style,
76
73
  _ref$tabIndex = _ref.tabIndex,
@@ -212,7 +209,6 @@ var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
212
209
  handleClickNext: handleClickNext,
213
210
  handleClickPrev: handleClickPrev,
214
211
  headerId: headerId,
215
- mode: mode,
216
212
  tabIndex: tabIndex,
217
213
  testId: testId
218
214
  }), jsx(Box, {
@@ -223,12 +219,10 @@ var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
223
219
  testId: testId && "".concat(testId, "--calendar-dates")
224
220
  }, jsx(WeekHeaderComponent, {
225
221
  daysShort: daysShort,
226
- mode: mode,
227
222
  testId: testId
228
223
  }), jsx(WeekDaysComponent, {
229
224
  weeks: weeks,
230
225
  handleClickDay: handleClickDay,
231
- mode: mode,
232
226
  monthsLong: monthsLong,
233
227
  shouldSetFocus: shouldSetFocus,
234
228
  tabIndex: tabIndex,
@@ -246,13 +240,9 @@ var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
246
240
  * - [Usage](https://atlassian.design/components/calendar/usage)
247
241
  */
248
242
  var Calendar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Calendar(props, ref) {
249
- return jsx(GlobalTheme.Consumer, null, function (_ref2) {
250
- var mode = _ref2.mode;
251
- return jsx(CalendarWithMode, _extends({}, props, {
252
- mode: mode,
253
- ref: ref
254
- }));
255
- });
243
+ return jsx(InnerCalendar, _extends({}, props, {
244
+ ref: ref
245
+ }));
256
246
  }));
257
247
  Calendar.displayName = 'Calendar';
258
248
  export default Calendar;
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { forwardRef, memo, useCallback, useEffect, useMemo, useRef } from 'react';
2
+ import { forwardRef, memo, useCallback, useEffect, useRef } from 'react';
3
3
  import { css, jsx } from '@emotion/react';
4
4
  import noop from '@atlaskit/ds-lib/noop';
5
5
  import { Grid } from '@atlaskit/primitives';
@@ -24,7 +24,6 @@ var Date = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Date(_ref2, _ref)
24
24
  _ref2$isSibling = _ref2.isSibling,
25
25
  isSibling = _ref2$isSibling === void 0 ? false : _ref2$isSibling,
26
26
  year = _ref2.year,
27
- mode = _ref2.mode,
28
27
  shouldSetFocus = _ref2.shouldSetFocus,
29
28
  tabIndex = _ref2.tabIndex,
30
29
  testId = _ref2.testId;
@@ -62,9 +61,7 @@ var Date = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Date(_ref2, _ref)
62
61
  });
63
62
  }
64
63
  }, [onClick]);
65
- var dateCellStyles = useMemo(function () {
66
- return css(getDateCellStyles(mode));
67
- }, [mode]);
64
+ var dateCellStyles = css(getDateCellStyles());
68
65
  return jsx(Grid, {
69
66
  role: "gridcell",
70
67
  alignItems: "center"
@@ -7,7 +7,6 @@ import WeekdayGrid from './week-day-grid';
7
7
  var WeekDays = /*#__PURE__*/memo(function WeekDays(_ref) {
8
8
  var weeks = _ref.weeks,
9
9
  handleClickDay = _ref.handleClickDay,
10
- mode = _ref.mode,
11
10
  monthsLong = _ref.monthsLong,
12
11
  shouldSetFocus = _ref.shouldSetFocus,
13
12
  tabIndex = _ref.tabIndex,
@@ -33,7 +32,6 @@ var WeekDays = /*#__PURE__*/memo(function WeekDays(_ref) {
33
32
  isSelected: weekDay.isSelected,
34
33
  isSibling: weekDay.isSiblingMonth,
35
34
  year: weekDay.year,
36
- mode: mode,
37
35
  shouldSetFocus: shouldSetFocus,
38
36
  tabIndex: tabIndex,
39
37
  testId: testId
@@ -1,31 +1,5 @@
1
- import { B100, B200, B400, B50, DN600, N0, N200, N30, N40, N500, N600, N700, N800, N900 } from '@atlaskit/theme/colors';
2
- var textColor = {
3
- light: "var(--ds-text, ".concat(N900, ")"),
4
- dark: "var(--ds-text, ".concat(DN600, ")")
5
- };
6
- var textColorMedium = "var(--ds-text-subtle, ".concat(N600, ")");
7
- var todayColor = {
8
- light: "var(--ds-text-selected, ".concat(B400, ")"),
9
- dark: "var(--ds-text-selected, ".concat(B100, ")")
10
- };
11
- var hoverBackground = {
12
- light: "var(--ds-background-neutral-subtle-hovered, ".concat(N30, ")"),
13
- dark: "var(--ds-background-neutral-subtle-hovered, ".concat(N800, ")")
14
- };
15
- var textSelected = {
16
- light: "var(--ds-text-selected, ".concat(N0, ")"),
17
- dark: "var(--ds-text-selected, ".concat(N700, ")")
18
- };
19
- var selectedBackground = {
20
- light: "var(--ds-background-selected, ".concat(N500, ")"),
21
- dark: "var(--ds-background-selected, ".concat(N0, ")")
22
- };
23
- var borderColorFocused = {
24
- light: "var(--ds-border-focused, ".concat(B200, ")"),
25
- dark: "var(--ds-border-focused, ".concat(B100, ")")
26
- };
1
+ import { B200, B400, B50, N0, N200, N30, N40, N500, N600, N900 } from '@atlaskit/theme/colors';
27
2
  export var dateCellStyles = function dateCellStyles() {
28
- var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'light';
29
3
  return {
30
4
  all: 'unset',
31
5
  display: 'block',
@@ -34,7 +8,7 @@ export var dateCellStyles = function dateCellStyles() {
34
8
  backgroundColor: 'transparent',
35
9
  border: '2px solid transparent',
36
10
  borderRadius: 3,
37
- color: textColor[mode],
11
+ color: "var(--ds-text, ".concat(N900, ")"),
38
12
  cursor: 'pointer',
39
13
  flexGrow: 1,
40
14
  fontSize: "var(--ds-font-size-100, 14px)",
@@ -43,7 +17,7 @@ export var dateCellStyles = function dateCellStyles() {
43
17
  color: "var(--ds-text-subtlest, ".concat(N200, ")")
44
18
  },
45
19
  '&[data-today]': {
46
- color: todayColor[mode],
20
+ color: "var(--ds-text-selected, ".concat(B400, ")"),
47
21
  fontWeight: "var(--ds-font-weight-bold, bold)",
48
22
  '&::after': {
49
23
  display: 'block',
@@ -61,30 +35,30 @@ export var dateCellStyles = function dateCellStyles() {
61
35
  color: "var(--ds-text-subtle, ".concat(N600, ")")
62
36
  },
63
37
  '&[data-selected]': {
64
- backgroundColor: selectedBackground[mode],
65
- color: textSelected[mode]
38
+ backgroundColor: "var(--ds-background-selected, ".concat(N500, ")"),
39
+ color: "var(--ds-text-selected, ".concat(N0, ")")
66
40
  },
67
41
  '&[data-disabled]': {
68
42
  color: "var(--ds-text-disabled, ".concat(N40, ")"),
69
43
  cursor: 'not-allowed'
70
44
  },
71
45
  '&:focus-visible': {
72
- border: "2px solid ".concat(borderColorFocused[mode])
46
+ border: "2px solid ".concat("var(--ds-border-focused, ".concat(B200, ")"))
73
47
  },
74
48
  '&:hover': {
75
- backgroundColor: hoverBackground[mode],
76
- color: textColor[mode]
49
+ backgroundColor: "var(--ds-background-neutral-subtle-hovered, ".concat(N30, ")"),
50
+ color: "var(--ds-text, ".concat(N900, ")")
77
51
  },
78
52
  '&:active': {
79
53
  backgroundColor: "var(--ds-background-neutral-subtle-pressed, ".concat(B50, ")"),
80
- color: textColor[mode]
54
+ color: "var(--ds-text, ".concat(N900, ")")
81
55
  },
82
56
  '&[data-selected]:hover': {
83
57
  backgroundColor: "var(--ds-background-selected-hovered, ".concat(B50, ")"),
84
58
  color: "var(--ds-text-selected, ".concat(N600, ")")
85
59
  },
86
60
  '&[data-prev-selected]:hover': {
87
- color: textColorMedium
61
+ color: "var(--ds-text-subtle, ".concat(N600, ")")
88
62
  },
89
63
  '&[data-sibling]:hover': {
90
64
  color: "var(--ds-text-subtlest, ".concat(N200, ")")
@@ -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" | "mode" | "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" | "createAnalyticsEvent"> & import("react").RefAttributes<HTMLDivElement>>>;
13
13
  export default Calendar;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { ThemeModes } from '@atlaskit/theme/types';
3
2
  import type { TabIndex } from '../../types';
4
3
  import type { DateObj } from '../types';
5
4
  interface DateProps {
@@ -15,7 +14,6 @@ interface DateProps {
15
14
  isSelected?: boolean;
16
15
  isSibling?: boolean;
17
16
  year: number;
18
- mode?: ThemeModes;
19
17
  shouldSetFocus: boolean;
20
18
  tabIndex: TabIndex;
21
19
  testId?: string;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { ThemeModes } from '@atlaskit/theme/types';
3
2
  import { TabIndex } from '../../types';
4
3
  interface HeaderProps {
5
4
  monthLongTitle: string;
@@ -10,7 +9,6 @@ interface HeaderProps {
10
9
  nextHeading: string;
11
10
  handleClickNext: (e: React.MouseEvent<HTMLElement>) => void;
12
11
  handleClickPrev: (e: React.MouseEvent<HTMLElement>) => void;
13
- mode?: ThemeModes;
14
12
  headerId: string;
15
13
  tabIndex?: TabIndex;
16
14
  testId?: string;
@@ -1,11 +1,9 @@
1
1
  /// <reference types="react" />
2
- import type { ThemeModes } from '@atlaskit/theme/types';
3
2
  import type { TabIndex } from '../../types';
4
3
  import { DateObj, Week } from '../types';
5
4
  interface WeekDaysProps {
6
5
  weeks: Week[];
7
6
  handleClickDay: (date: DateObj) => void;
8
- mode?: ThemeModes;
9
7
  monthsLong: string[];
10
8
  shouldSetFocus: boolean;
11
9
  tabIndex: TabIndex;
@@ -1,8 +1,6 @@
1
1
  /// <reference types="react" />
2
- import type { ThemeModes } from '@atlaskit/theme/types';
3
2
  interface WeekHeaderProps {
4
3
  daysShort: string[];
5
- mode?: ThemeModes;
6
4
  testId?: string;
7
5
  }
8
6
  declare const WeekHeader: import("react").NamedExoticComponent<WeekHeaderProps>;
@@ -1,3 +1,2 @@
1
1
  import { CSSObject } from '@emotion/react';
2
- import { ThemeModes } from '@atlaskit/theme/types';
3
- export declare const dateCellStyles: (mode?: ThemeModes) => CSSObject;
2
+ export declare const dateCellStyles: () => CSSObject;
@@ -1,6 +1,5 @@
1
1
  import { CSSProperties } from 'react';
2
2
  import { UIAnalyticsEvent, WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
- import { ThemeModes } from '@atlaskit/theme/types';
4
3
  import type { ArrowKeys, DateObj, ISODate } from './internal/types';
5
4
  export type WeekDay = 0 | 1 | 2 | 3 | 4 | 5 | 6;
6
5
  export type TabIndex = -1 | 0;
@@ -146,10 +145,6 @@ export interface CalendarProps extends WithAnalyticsEventsProps {
146
145
  * backward compatibility. PLEASE DO NOT USE THIS.
147
146
  */
148
147
  calendarRef?: React.Ref<CalendarRef>;
149
- /**
150
- * @internal Legacy theme mode, can be either 'light' or 'dark'
151
- */
152
- mode?: ThemeModes;
153
148
  /**
154
149
  * Indicates if the calendar can be focused by keyboard or only
155
150
  * programmatically. Defaults to "0".
@@ -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" | "mode" | "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" | "createAnalyticsEvent"> & import("react").RefAttributes<HTMLDivElement>>>;
13
13
  export default Calendar;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { ThemeModes } from '@atlaskit/theme/types';
3
2
  import type { TabIndex } from '../../types';
4
3
  import type { DateObj } from '../types';
5
4
  interface DateProps {
@@ -15,7 +14,6 @@ interface DateProps {
15
14
  isSelected?: boolean;
16
15
  isSibling?: boolean;
17
16
  year: number;
18
- mode?: ThemeModes;
19
17
  shouldSetFocus: boolean;
20
18
  tabIndex: TabIndex;
21
19
  testId?: string;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { ThemeModes } from '@atlaskit/theme/types';
3
2
  import { TabIndex } from '../../types';
4
3
  interface HeaderProps {
5
4
  monthLongTitle: string;
@@ -10,7 +9,6 @@ interface HeaderProps {
10
9
  nextHeading: string;
11
10
  handleClickNext: (e: React.MouseEvent<HTMLElement>) => void;
12
11
  handleClickPrev: (e: React.MouseEvent<HTMLElement>) => void;
13
- mode?: ThemeModes;
14
12
  headerId: string;
15
13
  tabIndex?: TabIndex;
16
14
  testId?: string;
@@ -1,11 +1,9 @@
1
1
  /// <reference types="react" />
2
- import type { ThemeModes } from '@atlaskit/theme/types';
3
2
  import type { TabIndex } from '../../types';
4
3
  import { DateObj, Week } from '../types';
5
4
  interface WeekDaysProps {
6
5
  weeks: Week[];
7
6
  handleClickDay: (date: DateObj) => void;
8
- mode?: ThemeModes;
9
7
  monthsLong: string[];
10
8
  shouldSetFocus: boolean;
11
9
  tabIndex: TabIndex;
@@ -1,8 +1,6 @@
1
1
  /// <reference types="react" />
2
- import type { ThemeModes } from '@atlaskit/theme/types';
3
2
  interface WeekHeaderProps {
4
3
  daysShort: string[];
5
- mode?: ThemeModes;
6
4
  testId?: string;
7
5
  }
8
6
  declare const WeekHeader: import("react").NamedExoticComponent<WeekHeaderProps>;
@@ -1,3 +1,2 @@
1
1
  import { CSSObject } from '@emotion/react';
2
- import { ThemeModes } from '@atlaskit/theme/types';
3
- export declare const dateCellStyles: (mode?: ThemeModes) => CSSObject;
2
+ export declare const dateCellStyles: () => CSSObject;
@@ -1,6 +1,5 @@
1
1
  import { CSSProperties } from 'react';
2
2
  import { UIAnalyticsEvent, WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
- import { ThemeModes } from '@atlaskit/theme/types';
4
3
  import type { ArrowKeys, DateObj, ISODate } from './internal/types';
5
4
  export type WeekDay = 0 | 1 | 2 | 3 | 4 | 5 | 6;
6
5
  export type TabIndex = -1 | 0;
@@ -146,10 +145,6 @@ export interface CalendarProps extends WithAnalyticsEventsProps {
146
145
  * backward compatibility. PLEASE DO NOT USE THIS.
147
146
  */
148
147
  calendarRef?: React.Ref<CalendarRef>;
149
- /**
150
- * @internal Legacy theme mode, can be either 'light' or 'dark'
151
- */
152
- mode?: ThemeModes;
153
148
  /**
154
149
  * Indicates if the calendar can be focused by keyboard or only
155
150
  * programmatically. Defaults to "0".
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/calendar",
3
- "version": "13.3.3",
3
+ "version": "14.0.0",
4
4
  "description": "An interactive calendar for date selection experiences.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
package/report.api.md CHANGED
@@ -21,7 +21,6 @@ import { CSSProperties } from 'react';
21
21
  import { ForwardRefExoticComponent } from 'react';
22
22
  import { MemoExoticComponent } from 'react';
23
23
  import { RefAttributes } from 'react';
24
- import { ThemeModes } from '@atlaskit/theme/types';
25
24
  import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
26
25
  import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
27
26
 
@@ -48,7 +47,6 @@ const Calendar: MemoExoticComponent<
48
47
  | 'locale'
49
48
  | 'maxDate'
50
49
  | 'minDate'
51
- | 'mode'
52
50
  | 'month'
53
51
  | 'nextMonthLabel'
54
52
  | 'onBlur'
@@ -87,8 +85,6 @@ export interface CalendarProps extends WithAnalyticsEventsProps {
87
85
  locale?: string;
88
86
  maxDate?: string;
89
87
  minDate?: string;
90
- // @internal
91
- mode?: ThemeModes;
92
88
  month?: number;
93
89
  nextMonthLabel?: string;
94
90
  onBlur?: React.FocusEventHandler;
@@ -10,7 +10,6 @@ import { CSSProperties } from 'react';
10
10
  import { ForwardRefExoticComponent } from 'react';
11
11
  import { MemoExoticComponent } from 'react';
12
12
  import { RefAttributes } from 'react';
13
- import { ThemeModes } from '@atlaskit/theme/types';
14
13
  import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
15
14
  import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
16
15
 
@@ -18,7 +17,7 @@ import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
18
17
  type ArrowKeys = 'down' | 'left' | 'right' | 'up';
19
18
 
20
19
  // @public
21
- const Calendar: MemoExoticComponent<ForwardRefExoticComponent<Pick<CalendarProps, "analyticsContext" | "calendarRef" | "className" | "createAnalyticsEvent" | "day" | "defaultDay" | "defaultMonth" | "defaultPreviouslySelected" | "defaultSelected" | "defaultYear" | "disabled" | "disabledDateFilter" | "locale" | "maxDate" | "minDate" | "mode" | "month" | "nextMonthLabel" | "onBlur" | "onChange" | "onFocus" | "onSelect" | "previousMonthLabel" | "previouslySelected" | "selected" | "style" | "tabIndex" | "testId" | "today" | "weekStartDay" | "year"> & RefAttributes<HTMLDivElement>>>;
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>>>;
22
21
  export default Calendar;
23
22
 
24
23
  // @public (undocumented)
@@ -38,8 +37,6 @@ export interface CalendarProps extends WithAnalyticsEventsProps {
38
37
  locale?: string;
39
38
  maxDate?: string;
40
39
  minDate?: string;
41
- // @internal
42
- mode?: ThemeModes;
43
40
  month?: number;
44
41
  nextMonthLabel?: string;
45
42
  onBlur?: React.FocusEventHandler;