@atlaskit/calendar 12.4.5 → 13.0.1

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.
Files changed (32) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/cjs/calendar.js +24 -42
  3. package/dist/cjs/internal/components/date.js +19 -17
  4. package/dist/cjs/internal/components/{heading.js → header.js} +21 -45
  5. package/dist/cjs/internal/components/week-day-grid.js +34 -0
  6. package/dist/cjs/internal/components/week-days.js +7 -14
  7. package/dist/cjs/internal/components/week-header.js +28 -23
  8. package/dist/cjs/internal/styles/date.js +2 -2
  9. package/dist/cjs/version.json +1 -1
  10. package/dist/es2019/calendar.js +22 -42
  11. package/dist/es2019/internal/components/date.js +19 -17
  12. package/dist/es2019/internal/components/header.js +60 -0
  13. package/dist/es2019/internal/components/week-day-grid.js +23 -0
  14. package/dist/es2019/internal/components/week-days.js +7 -15
  15. package/dist/es2019/internal/components/week-header.js +23 -23
  16. package/dist/es2019/internal/styles/date.js +2 -2
  17. package/dist/es2019/version.json +1 -1
  18. package/dist/esm/calendar.js +23 -42
  19. package/dist/esm/internal/components/date.js +19 -17
  20. package/dist/esm/internal/components/header.js +61 -0
  21. package/dist/esm/internal/components/week-day-grid.js +25 -0
  22. package/dist/esm/internal/components/week-days.js +7 -15
  23. package/dist/esm/internal/components/week-header.js +24 -24
  24. package/dist/esm/internal/styles/date.js +2 -2
  25. package/dist/esm/version.json +1 -1
  26. package/dist/types/calendar.d.ts +1 -1
  27. package/dist/types/internal/components/{heading.d.ts → header.d.ts} +3 -3
  28. package/dist/types/internal/components/week-day-grid.d.ts +15 -0
  29. package/package.json +11 -4
  30. package/report.api.md +1 -1
  31. package/dist/es2019/internal/components/heading.js +0 -82
  32. package/dist/esm/internal/components/heading.js +0 -88
@@ -0,0 +1,60 @@
1
+ /** @jsx jsx */
2
+ import { memo } from 'react';
3
+ import { jsx } from '@emotion/react';
4
+ import Button from '@atlaskit/button/standard-button';
5
+ import Box from '@atlaskit/ds-explorations/box';
6
+ import Inline from '@atlaskit/ds-explorations/inline';
7
+ import Heading from '@atlaskit/heading';
8
+ import ArrowleftIcon from '@atlaskit/icon/glyph/chevron-left-large';
9
+ import ArrowrightIcon from '@atlaskit/icon/glyph/chevron-right-large';
10
+ import { N70 } from '@atlaskit/theme/colors';
11
+ const Header = /*#__PURE__*/memo(function Header({
12
+ monthLongTitle,
13
+ year,
14
+ previousMonthLabel = 'Last month',
15
+ nextMonthLabel = 'Next month',
16
+ handleClickPrev,
17
+ handleClickNext,
18
+ testId
19
+ }) {
20
+ return jsx(Box, {
21
+ display: "block",
22
+ paddingInline: "scale.100",
23
+ "aria-hidden": "true"
24
+ }, jsx(Inline, {
25
+ gap: "scale.0",
26
+ alignItems: "center",
27
+ justifyContent: "space-between"
28
+ }, jsx(Button, {
29
+ appearance: "subtle",
30
+ spacing: "none",
31
+ tabIndex: -1,
32
+ onClick: handleClickPrev,
33
+ testId: testId && `${testId}--previous-month`,
34
+ iconBefore: jsx(ArrowleftIcon, {
35
+ label: previousMonthLabel,
36
+ size: "medium",
37
+ primaryColor: `var(--ds-text-subtlest, ${N70})`,
38
+ testId: testId && `${testId}--previous-month-icon`
39
+ })
40
+ }), jsx(Heading, {
41
+ level: "h400",
42
+ as: "div",
43
+ testId: testId && `${testId}--current-month-year`
44
+ }, `${monthLongTitle} ${year}`), jsx(Button, {
45
+ appearance: "subtle",
46
+ spacing: "none",
47
+ tabIndex: -1,
48
+ onClick: handleClickNext,
49
+ testId: testId && `${testId}--next-month`,
50
+ iconBefore: jsx(ArrowrightIcon, {
51
+ label: nextMonthLabel,
52
+ size: "medium",
53
+ primaryColor: `var(--ds-text-subtlest, ${N70})`,
54
+ testId: testId && `${testId}--next-month-icon`
55
+ })
56
+ })));
57
+ });
58
+ Header.displayName = 'Header'; // eslint-disable-next-line @repo/internal/react/require-jsdoc
59
+
60
+ export default Header;
@@ -0,0 +1,23 @@
1
+ /** @jsx jsx */
2
+ import { css, jsx } from '@emotion/react';
3
+ const gridStyles = css({
4
+ display: 'grid',
5
+ gridTemplateColumns: 'repeat(7, minmax(max-content, 1fr))'
6
+ });
7
+
8
+ /**
9
+ * __Week day grid__
10
+ *
11
+ * A week day grid aligns elements in a 7 wide grid layout.
12
+ *
13
+ */
14
+ const WeekDayGrid = ({
15
+ testId,
16
+ children
17
+ }) => // eslint-disable-next-line @repo/internal/react/use-primitives
18
+ jsx("div", {
19
+ "data-testid": testId,
20
+ css: gridStyles
21
+ }, children);
22
+
23
+ export default WeekDayGrid;
@@ -1,27 +1,19 @@
1
1
  /** @jsx jsx */
2
2
  import { memo } from 'react';
3
- import { css, jsx } from '@emotion/react';
3
+ import { jsx } from '@emotion/react';
4
4
  import DateComponent from './date';
5
- const daysGridStyles = css({
6
- display: 'grid',
7
- gridTemplateColumns: 'repeat(7, 1fr)',
8
- border: 0
9
- });
5
+ import WeekdayGrid from './week-day-grid';
10
6
  const WeekDays = /*#__PURE__*/memo(function WeekDays({
11
7
  weeks,
12
8
  handleClickDay,
13
9
  mode,
14
10
  testId
15
11
  }) {
16
- return jsx("div", {
12
+ return jsx(WeekdayGrid, {
17
13
  role: "grid",
18
- "data-testid": testId && `${testId}--month`
19
- }, weeks.map(week => jsx("div", {
20
- role: "row",
21
- key: week.id,
22
- css: daysGridStyles
23
- }, week.values.map(weekDay => jsx(DateComponent, {
24
- key: weekDay.id,
14
+ testId: testId && `${testId}--month`
15
+ }, weeks.map(week => week.values.map(weekDay => jsx(DateComponent, {
16
+ key: `${week.id}-${weekDay.id}`,
25
17
  isDisabled: weekDay.isDisabled,
26
18
  isFocused: weekDay.isFocused,
27
19
  isToday: weekDay.isToday,
@@ -33,7 +25,7 @@ const WeekDays = /*#__PURE__*/memo(function WeekDays({
33
25
  year: weekDay.year,
34
26
  mode: mode,
35
27
  testId: testId
36
- }, weekDay.day)))));
28
+ }, weekDay.day))));
37
29
  });
38
30
  WeekDays.displayName = 'WeekDays'; // eslint-disable-next-line @repo/internal/react/require-jsdoc
39
31
 
@@ -1,33 +1,33 @@
1
1
  /** @jsx jsx */
2
2
  import { memo } from 'react';
3
- import { css, jsx } from '@emotion/react';
3
+ import { jsx } from '@emotion/react';
4
+ import Box from '@atlaskit/ds-explorations/box';
5
+ import Text from '@atlaskit/ds-explorations/text';
4
6
  import { N200 } from '@atlaskit/theme/colors';
5
- const dayNameGridStyles = css({
6
- display: 'grid',
7
- gridTemplateColumns: 'repeat(7, 1fr)',
8
- border: 0
9
- });
10
- const dayNameCellStyles = css({
11
- boxSizing: 'border-box',
12
- minWidth: 40,
13
- padding: `${"var(--ds-scale-100, 8px)"} ${"var(--ds-scale-100, 8px)"}`,
14
- border: 0,
15
- color: `var(--ds-text-subtle, ${N200})`,
16
- fontSize: 11,
17
- fontWeight: 700,
18
- textAlign: 'center',
19
- textTransform: 'uppercase',
20
- whiteSpace: 'nowrap'
21
- });
7
+ import WeekDayGrid from './week-day-grid';
22
8
  const WeekHeader = /*#__PURE__*/memo(function WeekHeader({
23
9
  daysShort
24
10
  }) {
25
- return jsx("div", {
26
- css: dayNameGridStyles
27
- }, daysShort.map(shortDay => jsx("span", {
28
- css: dayNameCellStyles,
11
+ return jsx(WeekDayGrid, null, daysShort.map(shortDay => jsx(Box, {
12
+ padding: "scale.100",
13
+ display: "block",
14
+ UNSAFE_style: {
15
+ minWidth: 40,
16
+ // Account for languages with short week day names
17
+ whiteSpace: 'nowrap',
18
+ // Account for languages with long week day names
19
+ textAlign: 'center',
20
+ lineHeight: '16px',
21
+ color: `var(--ds-text-subtle, ${N200})` // Apply correct fallback to shortDay text
22
+
23
+ },
29
24
  key: shortDay
30
- }, shortDay)));
25
+ }, jsx(Text, {
26
+ fontWeight: "700",
27
+ fontSize: "11px",
28
+ verticalAlign: "middle",
29
+ textTransform: "uppercase"
30
+ }, shortDay))));
31
31
  });
32
32
  WeekHeader.displayName = 'WeekHeader'; // eslint-disable-next-line @repo/internal/react/require-jsdoc
33
33
 
@@ -34,14 +34,14 @@ export const dateCellStyles = (mode = 'light') => ({
34
34
  borderRadius: 3,
35
35
  color: textColor[mode],
36
36
  cursor: 'pointer',
37
- fontSize: 14,
37
+ fontSize: "var(--ds-font-size-100, 14px)",
38
38
  textAlign: 'center',
39
39
  '&[data-sibling]': {
40
40
  color: `var(--ds-text-subtlest, ${N200})`
41
41
  },
42
42
  '&[data-today]': {
43
43
  color: todayColor[mode],
44
- fontWeight: 'bold',
44
+ fontWeight: "var(--ds-font-weight-bold, bold)",
45
45
  '&::after': {
46
46
  display: 'block',
47
47
  height: 2,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/calendar",
3
- "version": "12.4.5",
3
+ "version": "13.0.1",
4
4
  "sideEffects": false
5
5
  }
@@ -8,13 +8,14 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
8
8
 
9
9
  /** @jsx jsx */
10
10
  import { forwardRef, memo, useMemo } from 'react';
11
- import { css, jsx } from '@emotion/react';
11
+ import { jsx } from '@emotion/react';
12
12
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
13
+ import Box from '@atlaskit/ds-explorations/box';
14
+ import Stack from '@atlaskit/ds-explorations/stack';
13
15
  import noop from '@atlaskit/ds-lib/noop';
14
- import { DN600, N0, N700, N900 } from '@atlaskit/theme/colors';
15
16
  import GlobalTheme from '@atlaskit/theme/components';
16
17
  import VisuallyHidden from '@atlaskit/visually-hidden';
17
- import HeadingComponent from './internal/components/heading';
18
+ import Header from './internal/components/header';
18
19
  import WeekDaysComponent from './internal/components/week-days';
19
20
  import WeekHeaderComponent from './internal/components/week-header';
20
21
  import { blankStringArray } from './internal/constants';
@@ -26,38 +27,10 @@ import useHandleDateChange from './internal/hooks/use-handle-date-change';
26
27
  import useHandleDateSelect from './internal/hooks/use-handle-date-select';
27
28
  import useLocale from './internal/hooks/use-locale';
28
29
  import useUniqueId from './internal/hooks/use-unique-id';
29
- var lightWrapperStyles = css({
30
- display: 'inline-block',
31
- boxSizing: 'border-box',
32
- // TODO Delete this comment after verifying spacing token -> previous value `16`
33
- padding: "var(--ds-scale-200, 16px)",
34
- backgroundColor: "var(--ds-UNSAFE_util-transparent, ".concat(N0, ")"),
35
- color: "var(--ds-text, ".concat(N900, ")"),
36
- outline: 'none',
37
- userSelect: 'none'
38
- });
39
- var darkWrapperStyles = css({
40
- display: 'inline-block',
41
- boxSizing: 'border-box',
42
- // TODO Delete this comment after verifying spacing token -> previous value `16`
43
- padding: "var(--ds-scale-200, 16px)",
44
- backgroundColor: "var(--ds-UNSAFE_util-transparent, ".concat(N700, ")"),
45
- color: "var(--ds-text, ".concat(DN600, ")"),
46
- outline: 'none',
47
- userSelect: 'none'
48
- });
49
- var gridsContainerStyles = css({
50
- display: 'inline-block',
51
- width: 289,
52
- // TODO Delete this comment after verifying spacing token -> previous value `0`
53
- margin: "var(--ds-scale-0, 0px)",
54
- marginBottom: 5,
55
- textAlign: 'center'
56
- });
57
30
  var analyticsAttributes = {
58
31
  componentName: 'calendar',
59
32
  packageName: "@atlaskit/calendar",
60
- packageVersion: "12.4.5"
33
+ packageVersion: "13.0.1"
61
34
  };
62
35
  var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
63
36
  var day = _ref.day,
@@ -97,7 +70,8 @@ var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
97
70
  weekStartDay = _ref$weekStartDay === void 0 ? 0 : _ref$weekStartDay,
98
71
  testId = _ref.testId,
99
72
  calendarRef = _ref.calendarRef,
100
- mode = _ref.mode,
73
+ _ref$mode = _ref.mode,
74
+ mode = _ref$mode === void 0 ? 'light' : _ref$mode,
101
75
  className = _ref.className,
102
76
  style = _ref.style,
103
77
  _ref$tabIndex = _ref.tabIndex,
@@ -203,26 +177,33 @@ var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
203
177
  monthsLong = _useLocale.monthsLong,
204
178
  daysShort = _useLocale.daysShort;
205
179
 
206
- return jsx("div", {
180
+ return jsx(Box, {
207
181
  className: className,
208
- style: style,
182
+ UNSAFE_style: style,
183
+ backgroundColor: "elevation.surface",
209
184
  onBlur: handleContainerBlur,
210
185
  onFocus: handleContainerFocus,
211
186
  onKeyDown: handleContainerKeyDown,
212
187
  role: "presentation",
213
- "data-testid": testId && "".concat(testId, "--container"),
188
+ testId: testId && "".concat(testId, "--container"),
214
189
  ref: ref
215
190
  }, jsx(VisuallyHidden, null, jsx("span", {
216
191
  id: announceId,
217
192
  "aria-live": "assertive",
218
193
  "aria-relevant": "text"
219
- }, announcerDate)), jsx("div", {
220
- css: !mode || mode === 'light' ? lightWrapperStyles : darkWrapperStyles,
194
+ }, announcerDate)), jsx(Box, {
195
+ display: "inlineBlock",
196
+ padding: "scale.200",
197
+ UNSAFE_style: {
198
+ userSelect: 'none'
199
+ },
221
200
  "aria-describedby": announceId,
222
201
  "aria-label": "calendar",
223
202
  role: "grid",
224
203
  tabIndex: tabIndex
225
- }, jsx(HeadingComponent // The month number needs to be translated to index in the month
204
+ }, jsx(Stack, {
205
+ gap: "scale.150"
206
+ }, jsx(Header // The month number needs to be translated to index in the month
226
207
  // name array e.g. 1 (January) -> 0
227
208
  , {
228
209
  monthLongTitle: monthsLong[monthValue - 1],
@@ -233,8 +214,8 @@ var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
233
214
  handleClickPrev: handleClickPrev,
234
215
  mode: mode,
235
216
  testId: testId
236
- }), jsx("div", {
237
- css: gridsContainerStyles,
217
+ }), jsx(Box, {
218
+ display: "block",
238
219
  role: "presentation"
239
220
  }, jsx(WeekHeaderComponent, {
240
221
  daysShort: daysShort,
@@ -244,7 +225,7 @@ var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
244
225
  handleClickDay: handleClickDay,
245
226
  mode: mode,
246
227
  testId: testId
247
- }))));
228
+ })))));
248
229
  });
249
230
  /**
250
231
  * __Calendar__
@@ -55,23 +55,25 @@ var Date = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Date(_ref, ref) {
55
55
  var dateCellStyles = useMemo(function () {
56
56
  return css(getDateCellStyles(mode));
57
57
  }, [mode]);
58
- return jsx("button", {
59
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
60
- css: dateCellStyles,
61
- "aria-selected": isSelected ? 'true' : 'false',
62
- tabIndex: isSelected ? 0 : -1,
63
- type: "button",
64
- role: "gridcell",
65
- onClick: handleClick,
66
- ref: ref,
67
- "data-disabled": isDisabled || undefined,
68
- "data-focused": isFocused || undefined,
69
- "data-prev-selected": isPreviouslySelected || undefined,
70
- "data-selected": isSelected || undefined,
71
- "data-sibling": isSibling || undefined,
72
- "data-today": isToday || undefined,
73
- "data-testid": testId && isSelected ? "".concat(testId, "--selected-day") : undefined
74
- }, day);
58
+ return (// eslint-disable-next-line @repo/internal/react/use-primitives
59
+ jsx("button", {
60
+ // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
61
+ css: dateCellStyles,
62
+ "aria-selected": isSelected ? 'true' : 'false',
63
+ tabIndex: isSelected ? 0 : -1,
64
+ type: "button",
65
+ role: "gridcell",
66
+ onClick: handleClick,
67
+ ref: ref,
68
+ "data-disabled": isDisabled || undefined,
69
+ "data-focused": isFocused || undefined,
70
+ "data-prev-selected": isPreviouslySelected || undefined,
71
+ "data-selected": isSelected || undefined,
72
+ "data-sibling": isSibling || undefined,
73
+ "data-today": isToday || undefined,
74
+ "data-testid": testId && isSelected ? "".concat(testId, "--selected-day") : undefined
75
+ }, day)
76
+ );
75
77
  }));
76
78
  Date.displayName = 'Date'; // eslint-disable-next-line @repo/internal/react/require-jsdoc
77
79
 
@@ -0,0 +1,61 @@
1
+ /** @jsx jsx */
2
+ import { memo } from 'react';
3
+ import { jsx } from '@emotion/react';
4
+ import Button from '@atlaskit/button/standard-button';
5
+ import Box from '@atlaskit/ds-explorations/box';
6
+ import Inline from '@atlaskit/ds-explorations/inline';
7
+ import Heading from '@atlaskit/heading';
8
+ import ArrowleftIcon from '@atlaskit/icon/glyph/chevron-left-large';
9
+ import ArrowrightIcon from '@atlaskit/icon/glyph/chevron-right-large';
10
+ import { N70 } from '@atlaskit/theme/colors';
11
+ var Header = /*#__PURE__*/memo(function Header(_ref) {
12
+ var monthLongTitle = _ref.monthLongTitle,
13
+ year = _ref.year,
14
+ _ref$previousMonthLab = _ref.previousMonthLabel,
15
+ previousMonthLabel = _ref$previousMonthLab === void 0 ? 'Last month' : _ref$previousMonthLab,
16
+ _ref$nextMonthLabel = _ref.nextMonthLabel,
17
+ nextMonthLabel = _ref$nextMonthLabel === void 0 ? 'Next month' : _ref$nextMonthLabel,
18
+ handleClickPrev = _ref.handleClickPrev,
19
+ handleClickNext = _ref.handleClickNext,
20
+ testId = _ref.testId;
21
+ return jsx(Box, {
22
+ display: "block",
23
+ paddingInline: "scale.100",
24
+ "aria-hidden": "true"
25
+ }, jsx(Inline, {
26
+ gap: "scale.0",
27
+ alignItems: "center",
28
+ justifyContent: "space-between"
29
+ }, jsx(Button, {
30
+ appearance: "subtle",
31
+ spacing: "none",
32
+ tabIndex: -1,
33
+ onClick: handleClickPrev,
34
+ testId: testId && "".concat(testId, "--previous-month"),
35
+ iconBefore: jsx(ArrowleftIcon, {
36
+ label: previousMonthLabel,
37
+ size: "medium",
38
+ primaryColor: "var(--ds-text-subtlest, ".concat(N70, ")"),
39
+ testId: testId && "".concat(testId, "--previous-month-icon")
40
+ })
41
+ }), jsx(Heading, {
42
+ level: "h400",
43
+ as: "div",
44
+ testId: testId && "".concat(testId, "--current-month-year")
45
+ }, "".concat(monthLongTitle, " ").concat(year)), jsx(Button, {
46
+ appearance: "subtle",
47
+ spacing: "none",
48
+ tabIndex: -1,
49
+ onClick: handleClickNext,
50
+ testId: testId && "".concat(testId, "--next-month"),
51
+ iconBefore: jsx(ArrowrightIcon, {
52
+ label: nextMonthLabel,
53
+ size: "medium",
54
+ primaryColor: "var(--ds-text-subtlest, ".concat(N70, ")"),
55
+ testId: testId && "".concat(testId, "--next-month-icon")
56
+ })
57
+ })));
58
+ });
59
+ Header.displayName = 'Header'; // eslint-disable-next-line @repo/internal/react/require-jsdoc
60
+
61
+ export default Header;
@@ -0,0 +1,25 @@
1
+ /** @jsx jsx */
2
+ import { css, jsx } from '@emotion/react';
3
+ var gridStyles = css({
4
+ display: 'grid',
5
+ gridTemplateColumns: 'repeat(7, minmax(max-content, 1fr))'
6
+ });
7
+
8
+ /**
9
+ * __Week day grid__
10
+ *
11
+ * A week day grid aligns elements in a 7 wide grid layout.
12
+ *
13
+ */
14
+ var WeekDayGrid = function WeekDayGrid(_ref) {
15
+ var testId = _ref.testId,
16
+ children = _ref.children;
17
+ return (// eslint-disable-next-line @repo/internal/react/use-primitives
18
+ jsx("div", {
19
+ "data-testid": testId,
20
+ css: gridStyles
21
+ }, children)
22
+ );
23
+ };
24
+
25
+ export default WeekDayGrid;
@@ -1,28 +1,20 @@
1
1
  /** @jsx jsx */
2
2
  import { memo } from 'react';
3
- import { css, jsx } from '@emotion/react';
3
+ import { jsx } from '@emotion/react';
4
4
  import DateComponent from './date';
5
- var daysGridStyles = css({
6
- display: 'grid',
7
- gridTemplateColumns: 'repeat(7, 1fr)',
8
- border: 0
9
- });
5
+ import WeekdayGrid from './week-day-grid';
10
6
  var WeekDays = /*#__PURE__*/memo(function WeekDays(_ref) {
11
7
  var weeks = _ref.weeks,
12
8
  handleClickDay = _ref.handleClickDay,
13
9
  mode = _ref.mode,
14
10
  testId = _ref.testId;
15
- return jsx("div", {
11
+ return jsx(WeekdayGrid, {
16
12
  role: "grid",
17
- "data-testid": testId && "".concat(testId, "--month")
13
+ testId: testId && "".concat(testId, "--month")
18
14
  }, weeks.map(function (week) {
19
- return jsx("div", {
20
- role: "row",
21
- key: week.id,
22
- css: daysGridStyles
23
- }, week.values.map(function (weekDay) {
15
+ return week.values.map(function (weekDay) {
24
16
  return jsx(DateComponent, {
25
- key: weekDay.id,
17
+ key: "".concat(week.id, "-").concat(weekDay.id),
26
18
  isDisabled: weekDay.isDisabled,
27
19
  isFocused: weekDay.isFocused,
28
20
  isToday: weekDay.isToday,
@@ -35,7 +27,7 @@ var WeekDays = /*#__PURE__*/memo(function WeekDays(_ref) {
35
27
  mode: mode,
36
28
  testId: testId
37
29
  }, weekDay.day);
38
- }));
30
+ });
39
31
  }));
40
32
  });
41
33
  WeekDays.displayName = 'WeekDays'; // eslint-disable-next-line @repo/internal/react/require-jsdoc
@@ -1,33 +1,33 @@
1
1
  /** @jsx jsx */
2
2
  import { memo } from 'react';
3
- import { css, jsx } from '@emotion/react';
3
+ import { jsx } from '@emotion/react';
4
+ import Box from '@atlaskit/ds-explorations/box';
5
+ import Text from '@atlaskit/ds-explorations/text';
4
6
  import { N200 } from '@atlaskit/theme/colors';
5
- var dayNameGridStyles = css({
6
- display: 'grid',
7
- gridTemplateColumns: 'repeat(7, 1fr)',
8
- border: 0
9
- });
10
- var dayNameCellStyles = css({
11
- boxSizing: 'border-box',
12
- minWidth: 40,
13
- padding: "var(--ds-scale-100, 8px)".concat(" ", "var(--ds-scale-100, 8px)"),
14
- border: 0,
15
- color: "var(--ds-text-subtle, ".concat(N200, ")"),
16
- fontSize: 11,
17
- fontWeight: 700,
18
- textAlign: 'center',
19
- textTransform: 'uppercase',
20
- whiteSpace: 'nowrap'
21
- });
7
+ import WeekDayGrid from './week-day-grid';
22
8
  var WeekHeader = /*#__PURE__*/memo(function WeekHeader(_ref) {
23
9
  var daysShort = _ref.daysShort;
24
- return jsx("div", {
25
- css: dayNameGridStyles
26
- }, daysShort.map(function (shortDay) {
27
- return jsx("span", {
28
- css: dayNameCellStyles,
10
+ return jsx(WeekDayGrid, null, daysShort.map(function (shortDay) {
11
+ return jsx(Box, {
12
+ padding: "scale.100",
13
+ display: "block",
14
+ UNSAFE_style: {
15
+ minWidth: 40,
16
+ // Account for languages with short week day names
17
+ whiteSpace: 'nowrap',
18
+ // Account for languages with long week day names
19
+ textAlign: 'center',
20
+ lineHeight: '16px',
21
+ color: "var(--ds-text-subtle, ".concat(N200, ")") // Apply correct fallback to shortDay text
22
+
23
+ },
29
24
  key: shortDay
30
- }, shortDay);
25
+ }, jsx(Text, {
26
+ fontWeight: "700",
27
+ fontSize: "11px",
28
+ verticalAlign: "middle",
29
+ textTransform: "uppercase"
30
+ }, shortDay));
31
31
  }));
32
32
  });
33
33
  WeekHeader.displayName = 'WeekHeader'; // eslint-disable-next-line @repo/internal/react/require-jsdoc
@@ -36,14 +36,14 @@ export var dateCellStyles = function dateCellStyles() {
36
36
  borderRadius: 3,
37
37
  color: textColor[mode],
38
38
  cursor: 'pointer',
39
- fontSize: 14,
39
+ fontSize: "var(--ds-font-size-100, 14px)",
40
40
  textAlign: 'center',
41
41
  '&[data-sibling]': {
42
42
  color: "var(--ds-text-subtlest, ".concat(N200, ")")
43
43
  },
44
44
  '&[data-today]': {
45
45
  color: todayColor[mode],
46
- fontWeight: 'bold',
46
+ fontWeight: "var(--ds-font-weight-bold, bold)",
47
47
  '&::after': {
48
48
  display: 'block',
49
49
  height: 2,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/calendar",
3
- "version": "12.4.5",
3
+ "version": "13.0.1",
4
4
  "sideEffects": false
5
5
  }
@@ -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, "year" | "previousMonthLabel" | "nextMonthLabel" | "mode" | "testId" | "style" | "className" | "tabIndex" | "onFocus" | "onBlur" | "onChange" | "onSelect" | "disabled" | "selected" | "analyticsContext" | "day" | "defaultDay" | "defaultMonth" | "defaultPreviouslySelected" | "defaultSelected" | "defaultYear" | "disabledDateFilter" | "maxDate" | "minDate" | "month" | "previouslySelected" | "today" | "locale" | "weekStartDay" | "calendarRef" | "createAnalyticsEvent"> & import("react").RefAttributes<HTMLDivElement>>>;
12
+ declare const Calendar: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Pick<CalendarProps, "year" | "previousMonthLabel" | "nextMonthLabel" | "mode" | "testId" | "className" | "style" | "tabIndex" | "onFocus" | "onBlur" | "onChange" | "onSelect" | "disabled" | "selected" | "analyticsContext" | "day" | "defaultDay" | "defaultMonth" | "defaultPreviouslySelected" | "defaultSelected" | "defaultYear" | "disabledDateFilter" | "maxDate" | "minDate" | "month" | "previouslySelected" | "today" | "locale" | "weekStartDay" | "calendarRef" | "createAnalyticsEvent"> & import("react").RefAttributes<HTMLDivElement>>>;
13
13
  export default Calendar;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ThemeModes } from '@atlaskit/theme/types';
3
- interface HeadingProps {
3
+ interface HeaderProps {
4
4
  monthLongTitle: string;
5
5
  year: number;
6
6
  previousMonthLabel?: string;
@@ -10,5 +10,5 @@ interface HeadingProps {
10
10
  mode?: ThemeModes;
11
11
  testId?: string;
12
12
  }
13
- declare const Heading: import("react").NamedExoticComponent<HeadingProps>;
14
- export default Heading;
13
+ declare const Header: import("react").NamedExoticComponent<HeaderProps>;
14
+ export default Header;
@@ -0,0 +1,15 @@
1
+ /** @jsx jsx */
2
+ import { ReactNode } from 'react';
3
+ import { jsx } from '@emotion/react';
4
+ interface WeekDayGridProps extends React.HTMLAttributes<HTMLElement> {
5
+ testId?: string;
6
+ children: ReactNode;
7
+ }
8
+ /**
9
+ * __Week day grid__
10
+ *
11
+ * A week day grid aligns elements in a 7 wide grid layout.
12
+ *
13
+ */
14
+ declare const WeekDayGrid: ({ testId, children }: WeekDayGridProps) => jsx.JSX.Element;
15
+ export default WeekDayGrid;