@atlaskit/calendar 12.1.12 → 12.2.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,27 @@
1
1
  # @atlaskit/calendar
2
2
 
3
+ ## 12.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`6f7a4353204`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6f7a4353204) - Added ability to provide custom aria-labels for next- and previous-month buttons using `nextMonthLabel` and `previousMonthLabel`
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
13
+ ## 12.1.14
14
+
15
+ ### Patch Changes
16
+
17
+ - [`c8c7eec9fb8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c8c7eec9fb8) - [ux] Updates tokens used for selected hovered state
18
+
19
+ ## 12.1.13
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies
24
+
3
25
  ## 12.1.12
4
26
 
5
27
  ### Patch Changes
@@ -83,7 +83,7 @@ var gridsContainerStyles = (0, _core.css)({
83
83
  var analyticsAttributes = {
84
84
  componentName: 'calendar',
85
85
  packageName: "@atlaskit/calendar",
86
- packageVersion: "12.1.12"
86
+ packageVersion: "12.2.0"
87
87
  };
88
88
  var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_ref, ref) {
89
89
  var day = _ref.day,
@@ -102,6 +102,7 @@ var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_re
102
102
  minDate = _ref.minDate,
103
103
  maxDate = _ref.maxDate,
104
104
  month = _ref.month,
105
+ nextMonthLabel = _ref.nextMonthLabel,
105
106
  _ref$onBlur = _ref.onBlur,
106
107
  onBlur = _ref$onBlur === void 0 ? _noop.default : _ref$onBlur,
107
108
  _ref$onChange = _ref.onChange,
@@ -111,6 +112,7 @@ var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_re
111
112
  _ref$onSelect = _ref.onSelect,
112
113
  onSelect = _ref$onSelect === void 0 ? _noop.default : _ref$onSelect,
113
114
  previouslySelected = _ref.previouslySelected,
115
+ previousMonthLabel = _ref.previousMonthLabel,
114
116
  selected = _ref.selected,
115
117
  today = _ref.today,
116
118
  _ref$locale = _ref.locale,
@@ -249,6 +251,8 @@ var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_re
249
251
  , {
250
252
  monthLongTitle: monthsLong[monthValue - 1],
251
253
  year: yearValue,
254
+ nextMonthLabel: nextMonthLabel,
255
+ previousMonthLabel: previousMonthLabel,
252
256
  handleClickNext: handleClickNext,
253
257
  handleClickPrev: handleClickPrev,
254
258
  mode: mode,
@@ -49,6 +49,10 @@ var arrowRightStyles = (0, _core.css)({
49
49
  var Heading = /*#__PURE__*/(0, _react.memo)(function Heading(_ref) {
50
50
  var monthLongTitle = _ref.monthLongTitle,
51
51
  year = _ref.year,
52
+ _ref$previousMonthLab = _ref.previousMonthLabel,
53
+ previousMonthLabel = _ref$previousMonthLab === void 0 ? 'Last month' : _ref$previousMonthLab,
54
+ _ref$nextMonthLabel = _ref.nextMonthLabel,
55
+ nextMonthLabel = _ref$nextMonthLabel === void 0 ? 'Next month' : _ref$nextMonthLabel,
52
56
  handleClickPrev = _ref.handleClickPrev,
53
57
  handleClickNext = _ref.handleClickNext,
54
58
  mode = _ref.mode,
@@ -67,9 +71,10 @@ var Heading = /*#__PURE__*/(0, _react.memo)(function Heading(_ref) {
67
71
  onClick: handleClickPrev,
68
72
  testId: testId && "".concat(testId, "--previous-month"),
69
73
  iconBefore: (0, _core.jsx)(_chevronLeftLarge.default, {
70
- label: "Last month",
74
+ label: previousMonthLabel,
71
75
  size: "medium",
72
- primaryColor: "var(--ds-text-subtlest, ".concat(_colors.N70, ")")
76
+ primaryColor: "var(--ds-text-subtlest, ".concat(_colors.N70, ")"),
77
+ testId: testId && "".concat(testId, "--previous-month-icon")
73
78
  })
74
79
  }), (0, _core.jsx)("div", {
75
80
  // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
@@ -83,9 +88,10 @@ var Heading = /*#__PURE__*/(0, _react.memo)(function Heading(_ref) {
83
88
  onClick: handleClickNext,
84
89
  testId: testId && "".concat(testId, "--next-month"),
85
90
  iconBefore: (0, _core.jsx)(_chevronRightLarge.default, {
86
- label: "Next month",
91
+ label: nextMonthLabel,
87
92
  size: "medium",
88
- primaryColor: "var(--ds-text-subtlest, ".concat(_colors.N70, ")")
93
+ primaryColor: "var(--ds-text-subtlest, ".concat(_colors.N70, ")"),
94
+ testId: testId && "".concat(testId, "--next-month-icon")
89
95
  })
90
96
  }));
91
97
  });
@@ -88,10 +88,10 @@ var dateCellStyles = function dateCellStyles() {
88
88
  color: textColor[mode]
89
89
  },
90
90
  '&[data-selected]:hover': {
91
- color: textColorMedium
91
+ backgroundColor: "var(--ds-background-selected-hovered, ".concat(_colors.B50, ")"),
92
+ color: "var(--ds-text-selected, ".concat(_colors.N600, ")")
92
93
  },
93
94
  '&[data-prev-selected]:hover': {
94
- backgroundColor: "var(--ds-background-selected, ".concat(_colors.B50, ")"),
95
95
  color: textColorMedium
96
96
  },
97
97
  '&[data-sibling]:hover': {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/calendar",
3
- "version": "12.1.12",
3
+ "version": "12.2.0",
4
4
  "sideEffects": false
5
5
  }
@@ -48,7 +48,7 @@ const gridsContainerStyles = css({
48
48
  const analyticsAttributes = {
49
49
  componentName: 'calendar',
50
50
  packageName: "@atlaskit/calendar",
51
- packageVersion: "12.1.12"
51
+ packageVersion: "12.2.0"
52
52
  };
53
53
  const CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar({
54
54
  day,
@@ -62,11 +62,13 @@ const CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar({
62
62
  minDate,
63
63
  maxDate,
64
64
  month,
65
+ nextMonthLabel,
65
66
  onBlur = noop,
66
67
  onChange = noop,
67
68
  onFocus = noop,
68
69
  onSelect = noop,
69
70
  previouslySelected,
71
+ previousMonthLabel,
70
72
  selected,
71
73
  today,
72
74
  locale = 'en-US',
@@ -189,6 +191,8 @@ const CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar({
189
191
  , {
190
192
  monthLongTitle: monthsLong[monthValue - 1],
191
193
  year: yearValue,
194
+ nextMonthLabel: nextMonthLabel,
195
+ previousMonthLabel: previousMonthLabel,
192
196
  handleClickNext: handleClickNext,
193
197
  handleClickPrev: handleClickPrev,
194
198
  mode: mode,
@@ -31,6 +31,8 @@ const arrowRightStyles = css({
31
31
  const Heading = /*#__PURE__*/memo(function Heading({
32
32
  monthLongTitle,
33
33
  year,
34
+ previousMonthLabel = 'Last month',
35
+ nextMonthLabel = 'Next month',
34
36
  handleClickPrev,
35
37
  handleClickNext,
36
38
  mode,
@@ -48,9 +50,10 @@ const Heading = /*#__PURE__*/memo(function Heading({
48
50
  onClick: handleClickPrev,
49
51
  testId: testId && `${testId}--previous-month`,
50
52
  iconBefore: jsx(ArrowleftIcon, {
51
- label: "Last month",
53
+ label: previousMonthLabel,
52
54
  size: "medium",
53
- primaryColor: `var(--ds-text-subtlest, ${N70})`
55
+ primaryColor: `var(--ds-text-subtlest, ${N70})`,
56
+ testId: testId && `${testId}--previous-month-icon`
54
57
  })
55
58
  }), jsx("div", {
56
59
  // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
@@ -64,9 +67,10 @@ const Heading = /*#__PURE__*/memo(function Heading({
64
67
  onClick: handleClickNext,
65
68
  testId: testId && `${testId}--next-month`,
66
69
  iconBefore: jsx(ArrowrightIcon, {
67
- label: "Next month",
70
+ label: nextMonthLabel,
68
71
  size: "medium",
69
- primaryColor: `var(--ds-text-subtlest, ${N70})`
72
+ primaryColor: `var(--ds-text-subtlest, ${N70})`,
73
+ testId: testId && `${testId}--next-month-icon`
70
74
  })
71
75
  }));
72
76
  });
@@ -77,10 +77,10 @@ export const dateCellStyles = (mode = 'light') => ({
77
77
  color: textColor[mode]
78
78
  },
79
79
  '&[data-selected]:hover': {
80
- color: textColorMedium
80
+ backgroundColor: `var(--ds-background-selected-hovered, ${B50})`,
81
+ color: `var(--ds-text-selected, ${N600})`
81
82
  },
82
83
  '&[data-prev-selected]:hover': {
83
- backgroundColor: `var(--ds-background-selected, ${B50})`,
84
84
  color: textColorMedium
85
85
  },
86
86
  '&[data-sibling]:hover': {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/calendar",
3
- "version": "12.1.12",
3
+ "version": "12.2.0",
4
4
  "sideEffects": false
5
5
  }
@@ -54,7 +54,7 @@ var gridsContainerStyles = css({
54
54
  var analyticsAttributes = {
55
55
  componentName: 'calendar',
56
56
  packageName: "@atlaskit/calendar",
57
- packageVersion: "12.1.12"
57
+ packageVersion: "12.2.0"
58
58
  };
59
59
  var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
60
60
  var day = _ref.day,
@@ -73,6 +73,7 @@ var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
73
73
  minDate = _ref.minDate,
74
74
  maxDate = _ref.maxDate,
75
75
  month = _ref.month,
76
+ nextMonthLabel = _ref.nextMonthLabel,
76
77
  _ref$onBlur = _ref.onBlur,
77
78
  onBlur = _ref$onBlur === void 0 ? noop : _ref$onBlur,
78
79
  _ref$onChange = _ref.onChange,
@@ -82,6 +83,7 @@ var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
82
83
  _ref$onSelect = _ref.onSelect,
83
84
  onSelect = _ref$onSelect === void 0 ? noop : _ref$onSelect,
84
85
  previouslySelected = _ref.previouslySelected,
86
+ previousMonthLabel = _ref.previousMonthLabel,
85
87
  selected = _ref.selected,
86
88
  today = _ref.today,
87
89
  _ref$locale = _ref.locale,
@@ -220,6 +222,8 @@ var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
220
222
  , {
221
223
  monthLongTitle: monthsLong[monthValue - 1],
222
224
  year: yearValue,
225
+ nextMonthLabel: nextMonthLabel,
226
+ previousMonthLabel: previousMonthLabel,
223
227
  handleClickNext: handleClickNext,
224
228
  handleClickPrev: handleClickPrev,
225
229
  mode: mode,
@@ -34,6 +34,10 @@ var arrowRightStyles = css({
34
34
  var Heading = /*#__PURE__*/memo(function Heading(_ref) {
35
35
  var monthLongTitle = _ref.monthLongTitle,
36
36
  year = _ref.year,
37
+ _ref$previousMonthLab = _ref.previousMonthLabel,
38
+ previousMonthLabel = _ref$previousMonthLab === void 0 ? 'Last month' : _ref$previousMonthLab,
39
+ _ref$nextMonthLabel = _ref.nextMonthLabel,
40
+ nextMonthLabel = _ref$nextMonthLabel === void 0 ? 'Next month' : _ref$nextMonthLabel,
37
41
  handleClickPrev = _ref.handleClickPrev,
38
42
  handleClickNext = _ref.handleClickNext,
39
43
  mode = _ref.mode,
@@ -52,9 +56,10 @@ var Heading = /*#__PURE__*/memo(function Heading(_ref) {
52
56
  onClick: handleClickPrev,
53
57
  testId: testId && "".concat(testId, "--previous-month"),
54
58
  iconBefore: jsx(ArrowleftIcon, {
55
- label: "Last month",
59
+ label: previousMonthLabel,
56
60
  size: "medium",
57
- primaryColor: "var(--ds-text-subtlest, ".concat(N70, ")")
61
+ primaryColor: "var(--ds-text-subtlest, ".concat(N70, ")"),
62
+ testId: testId && "".concat(testId, "--previous-month-icon")
58
63
  })
59
64
  }), jsx("div", {
60
65
  // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
@@ -68,9 +73,10 @@ var Heading = /*#__PURE__*/memo(function Heading(_ref) {
68
73
  onClick: handleClickNext,
69
74
  testId: testId && "".concat(testId, "--next-month"),
70
75
  iconBefore: jsx(ArrowrightIcon, {
71
- label: "Next month",
76
+ label: nextMonthLabel,
72
77
  size: "medium",
73
- primaryColor: "var(--ds-text-subtlest, ".concat(N70, ")")
78
+ primaryColor: "var(--ds-text-subtlest, ".concat(N70, ")"),
79
+ testId: testId && "".concat(testId, "--next-month-icon")
74
80
  })
75
81
  }));
76
82
  });
@@ -79,10 +79,10 @@ export var dateCellStyles = function dateCellStyles() {
79
79
  color: textColor[mode]
80
80
  },
81
81
  '&[data-selected]:hover': {
82
- color: textColorMedium
82
+ backgroundColor: "var(--ds-background-selected-hovered, ".concat(B50, ")"),
83
+ color: "var(--ds-text-selected, ".concat(N600, ")")
83
84
  },
84
85
  '&[data-prev-selected]:hover': {
85
- backgroundColor: "var(--ds-background-selected, ".concat(B50, ")"),
86
86
  color: textColorMedium
87
87
  },
88
88
  '&[data-sibling]:hover': {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/calendar",
3
- "version": "12.1.12",
3
+ "version": "12.2.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import type { CalendarProps } from './types';
3
- declare const Calendar: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Pick<CalendarProps, "year" | "mode" | "testId" | "style" | "disabled" | "selected" | "className" | "onFocus" | "onBlur" | "onChange" | "onSelect" | "analyticsContext" | "day" | "month" | "defaultDay" | "defaultMonth" | "defaultYear" | "today" | "defaultSelected" | "previouslySelected" | "defaultPreviouslySelected" | "weekStartDay" | "disabledDateFilter" | "minDate" | "maxDate" | "locale" | "calendarRef" | "createAnalyticsEvent"> & import("react").RefAttributes<HTMLDivElement>>>;
3
+ declare const Calendar: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Pick<CalendarProps, "year" | "previousMonthLabel" | "nextMonthLabel" | "mode" | "testId" | "style" | "disabled" | "selected" | "className" | "onFocus" | "onBlur" | "onChange" | "onSelect" | "analyticsContext" | "day" | "month" | "defaultDay" | "defaultMonth" | "defaultYear" | "today" | "defaultSelected" | "previouslySelected" | "defaultPreviouslySelected" | "weekStartDay" | "disabledDateFilter" | "minDate" | "maxDate" | "locale" | "calendarRef" | "createAnalyticsEvent"> & import("react").RefAttributes<HTMLDivElement>>>;
4
4
  export default Calendar;
@@ -3,6 +3,8 @@ import { ThemeModes } from '@atlaskit/theme/types';
3
3
  interface Props {
4
4
  monthLongTitle: string;
5
5
  year: number;
6
+ previousMonthLabel?: string;
7
+ nextMonthLabel?: string;
6
8
  handleClickNext?: () => void;
7
9
  handleClickPrev?: () => void;
8
10
  mode?: ThemeModes;
@@ -34,6 +34,8 @@ export interface CalendarProps extends WithAnalyticsEventsProps {
34
34
  minDate?: string;
35
35
  /** The number of the month (from 1 to 12) which the calendar should be on. */
36
36
  month?: number;
37
+ /** The aria-label attribute associated with the next-month arrow. */
38
+ nextMonthLabel?: string;
37
39
  /** Function which is called when the calendar is no longer focused. */
38
40
  onBlur?: React.FocusEventHandler;
39
41
  /** Called when the calendar is navigated. This can be triggered by the keyboard, or by clicking the navigational buttons.
@@ -49,6 +51,8 @@ export interface CalendarProps extends WithAnalyticsEventsProps {
49
51
  /** Takes an array of dates as string in the format 'YYYY-MM-DD'. All dates
50
52
  provided are given a background color. */
51
53
  previouslySelected?: Array<string>;
54
+ /** The aria-label attribute associated with the previous-month arrow. */
55
+ previousMonthLabel?: string;
52
56
  /** Takes an array of dates as string in the format 'YYYY-MM-DD'. All dates
53
57
  provided are given a background color. */
54
58
  selected?: Array<string>;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@atlaskit/calendar",
3
- "version": "12.1.12",
3
+ "version": "12.2.0",
4
4
  "description": "An interactive calendar for date selection experiences.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
7
7
  },
8
- "repository": "https://bitbucket.org/atlassian/atlassian-frontend",
8
+ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
9
9
  "author": "Atlassian Pty Ltd",
10
10
  "license": "Apache-2.0",
11
11
  "main": "dist/cjs/index.js",
@@ -18,17 +18,18 @@
18
18
  "team": "Design System Team",
19
19
  "releaseModel": "scheduled",
20
20
  "website": {
21
- "name": "Calendar"
21
+ "name": "Calendar",
22
+ "category": "Components"
22
23
  }
23
24
  },
24
25
  "dependencies": {
25
26
  "@atlaskit/analytics-next": "^8.2.0",
26
27
  "@atlaskit/button": "^16.3.0",
27
- "@atlaskit/ds-lib": "^1.4.0",
28
+ "@atlaskit/ds-lib": "^2.0.0",
28
29
  "@atlaskit/icon": "^21.10.0",
29
30
  "@atlaskit/locale": "^2.3.0",
30
31
  "@atlaskit/theme": "^12.1.0",
31
- "@atlaskit/tokens": "^0.9.0",
32
+ "@atlaskit/tokens": "^0.10.0",
32
33
  "@atlaskit/visually-hidden": "^1.0.0",
33
34
  "@babel/runtime": "^7.0.0",
34
35
  "@emotion/core": "^10.0.9",
@@ -40,7 +41,7 @@
40
41
  },
41
42
  "devDependencies": {
42
43
  "@atlaskit/docs": "*",
43
- "@atlaskit/select": "^15.0.0",
44
+ "@atlaskit/select": "^15.3.0",
44
45
  "@atlaskit/ssr": "*",
45
46
  "@atlaskit/visual-regression": "*",
46
47
  "@atlaskit/webdriver-runner": "*",
@@ -60,6 +61,7 @@
60
61
  "import-structure": "atlassian-conventions"
61
62
  },
62
63
  "@repo/internal": {
64
+ "dom-events": "use-bind-event-listener",
63
65
  "ui-components": "lite-mode",
64
66
  "analytics": "analytics-next",
65
67
  "theming": "tokens",
@@ -3,5 +3,6 @@
3
3
  "main": "../dist/cjs/entry-points/types.js",
4
4
  "module": "../dist/esm/entry-points/types.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/types.js",
6
+ "sideEffects": false,
6
7
  "types": "../dist/types/entry-points/types.d.ts"
7
8
  }