@atlaskit/calendar 13.1.13 → 13.1.15
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 +12 -0
- package/dist/cjs/calendar.js +4 -6
- package/dist/cjs/internal/components/date.js +22 -17
- package/dist/cjs/internal/components/week-day-grid.js +9 -9
- package/dist/cjs/internal/components/week-days.js +29 -24
- package/dist/cjs/internal/components/week-header.js +16 -11
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/calendar.js +2 -4
- package/dist/es2019/internal/components/date.js +22 -17
- package/dist/es2019/internal/components/week-day-grid.js +6 -7
- package/dist/es2019/internal/components/week-days.js +25 -20
- package/dist/es2019/internal/components/week-header.js +5 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/calendar.js +2 -4
- package/dist/esm/internal/components/date.js +22 -17
- package/dist/esm/internal/components/week-day-grid.js +10 -10
- package/dist/esm/internal/components/week-days.js +29 -24
- package/dist/esm/internal/components/week-header.js +16 -11
- package/dist/esm/version.json +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/calendar
|
|
2
2
|
|
|
3
|
+
## 13.1.15
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`3fadbb8bf73`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3fadbb8bf73) - Internal changes.
|
|
8
|
+
|
|
9
|
+
## 13.1.14
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`7e4085cd951`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7e4085cd951) - Allow caret version range in @atlaskit/primitives dependency.
|
|
14
|
+
|
|
3
15
|
## 13.1.13
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/calendar.js
CHANGED
|
@@ -13,8 +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 _box = _interopRequireDefault(require("@atlaskit/primitives/box"));
|
|
17
|
-
var _stack = _interopRequireDefault(require("@atlaskit/primitives/stack"));
|
|
18
16
|
var _components = _interopRequireDefault(require("@atlaskit/theme/components"));
|
|
19
17
|
var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
|
|
20
18
|
var _header = _interopRequireDefault(require("./internal/components/header"));
|
|
@@ -38,7 +36,7 @@ var boxStyles = (0, _primitives.xcss)({
|
|
|
38
36
|
var analyticsAttributes = {
|
|
39
37
|
componentName: 'calendar',
|
|
40
38
|
packageName: "@atlaskit/calendar",
|
|
41
|
-
packageVersion: "13.1.
|
|
39
|
+
packageVersion: "13.1.15"
|
|
42
40
|
};
|
|
43
41
|
var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_ref, ref) {
|
|
44
42
|
var day = _ref.day,
|
|
@@ -190,14 +188,14 @@ var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_re
|
|
|
190
188
|
id: announceId,
|
|
191
189
|
"aria-live": "assertive",
|
|
192
190
|
"aria-relevant": "text"
|
|
193
|
-
}, announcerDate)), (0, _react2.jsx)(
|
|
191
|
+
}, announcerDate)), (0, _react2.jsx)(_primitives.Box, {
|
|
194
192
|
xcss: boxStyles,
|
|
195
193
|
padding: "space.200",
|
|
196
194
|
"aria-describedby": announceId,
|
|
197
195
|
"aria-label": "calendar",
|
|
198
196
|
tabIndex: tabIndex,
|
|
199
197
|
testId: testId && "".concat(testId, "--calendar")
|
|
200
|
-
}, (0, _react2.jsx)(
|
|
198
|
+
}, (0, _react2.jsx)(_primitives.Stack, {
|
|
201
199
|
space: "space.150"
|
|
202
200
|
}, (0, _react2.jsx)(_header.default
|
|
203
201
|
// The month number needs to be translated to index in the month
|
|
@@ -211,7 +209,7 @@ var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_re
|
|
|
211
209
|
handleClickPrev: handleClickPrev,
|
|
212
210
|
mode: mode,
|
|
213
211
|
testId: testId
|
|
214
|
-
}), (0, _react2.jsx)(
|
|
212
|
+
}), (0, _react2.jsx)(_primitives.Box, {
|
|
215
213
|
role: "grid"
|
|
216
214
|
}, (0, _react2.jsx)(_weekHeader.default, {
|
|
217
215
|
daysShort: daysShort,
|
|
@@ -62,23 +62,28 @@ var Date = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
|
62
62
|
var dateCellStyles = (0, _react.useMemo)(function () {
|
|
63
63
|
return (0, _react2.css)((0, _date.dateCellStyles)(mode));
|
|
64
64
|
}, [mode]);
|
|
65
|
-
return (
|
|
66
|
-
//
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
65
|
+
return (
|
|
66
|
+
// TODO: Determine if there is a better way to render the button (should
|
|
67
|
+
// be fixed with introduction of keyboard accessibility of Calendar in
|
|
68
|
+
// DSP-9939) (DSP-11588)
|
|
69
|
+
(0, _react2.jsx)("button", {
|
|
70
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
71
|
+
css: dateCellStyles,
|
|
72
|
+
"aria-selected": isSelected ? 'true' : 'false',
|
|
73
|
+
tabIndex: isSelected ? 0 : -1,
|
|
74
|
+
type: "button",
|
|
75
|
+
role: "gridcell",
|
|
76
|
+
onClick: handleClick,
|
|
77
|
+
ref: ref,
|
|
78
|
+
"data-disabled": isDisabled || undefined,
|
|
79
|
+
"data-focused": isFocused || undefined,
|
|
80
|
+
"data-prev-selected": isPreviouslySelected || undefined,
|
|
81
|
+
"data-selected": isSelected || undefined,
|
|
82
|
+
"data-sibling": isSibling || undefined,
|
|
83
|
+
"data-today": isToday || undefined,
|
|
84
|
+
"data-testid": testId && isSelected ? "".concat(testId, "--selected-day") : undefined
|
|
85
|
+
}, day)
|
|
86
|
+
);
|
|
82
87
|
}));
|
|
83
88
|
Date.displayName = 'Date';
|
|
84
89
|
|
|
@@ -8,10 +8,6 @@ var _react = require("@emotion/react");
|
|
|
8
8
|
var _primitives = require("@atlaskit/primitives");
|
|
9
9
|
/** @jsx jsx */
|
|
10
10
|
|
|
11
|
-
var gridStyles = (0, _primitives.xcss)({
|
|
12
|
-
display: 'grid',
|
|
13
|
-
gridTemplateColumns: 'repeat(7, minmax(max-content, 1fr))'
|
|
14
|
-
});
|
|
15
11
|
/**
|
|
16
12
|
* __Week day grid__
|
|
17
13
|
*
|
|
@@ -21,11 +17,15 @@ var gridStyles = (0, _primitives.xcss)({
|
|
|
21
17
|
var WeekDayGrid = function WeekDayGrid(_ref) {
|
|
22
18
|
var testId = _ref.testId,
|
|
23
19
|
children = _ref.children;
|
|
24
|
-
return (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
return (
|
|
21
|
+
// TODO: Determine if there is a better way to render the row (should be
|
|
22
|
+
// fixed with introduction of keyboard accessibility of Calendar in DSP-9939) (DSP-11588)
|
|
23
|
+
(0, _react.jsx)(_primitives.Grid, {
|
|
24
|
+
testId: testId,
|
|
25
|
+
templateColumns: "repeat(7, minmax(max-content, 1fr))",
|
|
26
|
+
role: "row"
|
|
27
|
+
}, children)
|
|
28
|
+
);
|
|
29
29
|
};
|
|
30
30
|
var _default = WeekDayGrid;
|
|
31
31
|
exports.default = _default;
|
|
@@ -17,30 +17,35 @@ var WeekDays = /*#__PURE__*/(0, _react.memo)(function WeekDays(_ref) {
|
|
|
17
17
|
handleClickDay = _ref.handleClickDay,
|
|
18
18
|
mode = _ref.mode,
|
|
19
19
|
testId = _ref.testId;
|
|
20
|
-
return (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
testId: testId && "".concat(testId, "--
|
|
27
|
-
},
|
|
28
|
-
return (0, _react2.jsx)(
|
|
29
|
-
key:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
20
|
+
return (
|
|
21
|
+
// TODO: Determine if there is a better way to render the button (should be
|
|
22
|
+
// fixed with introduction of keyboard accessibility of Calendar in
|
|
23
|
+
// DSP-9939) (DSP-11588)
|
|
24
|
+
(0, _react2.jsx)(_box.default, {
|
|
25
|
+
role: "rowgroup",
|
|
26
|
+
testId: testId && "".concat(testId, "--month")
|
|
27
|
+
}, weeks.map(function (week, i) {
|
|
28
|
+
return (0, _react2.jsx)(_weekDayGrid.default, {
|
|
29
|
+
key: i,
|
|
30
|
+
testId: testId && "".concat(testId, "--week")
|
|
31
|
+
}, week.values.map(function (weekDay) {
|
|
32
|
+
return (0, _react2.jsx)(_date.default, {
|
|
33
|
+
key: "".concat(week.id, "-").concat(weekDay.id),
|
|
34
|
+
isDisabled: weekDay.isDisabled,
|
|
35
|
+
isFocused: weekDay.isFocused,
|
|
36
|
+
isToday: weekDay.isToday,
|
|
37
|
+
month: weekDay.month,
|
|
38
|
+
onClick: handleClickDay,
|
|
39
|
+
isPreviouslySelected: weekDay.isPreviouslySelected,
|
|
40
|
+
isSelected: weekDay.isSelected,
|
|
41
|
+
isSibling: weekDay.isSiblingMonth,
|
|
42
|
+
year: weekDay.year,
|
|
43
|
+
mode: mode,
|
|
44
|
+
testId: testId
|
|
45
|
+
}, weekDay.day);
|
|
46
|
+
}));
|
|
47
|
+
}))
|
|
48
|
+
);
|
|
44
49
|
});
|
|
45
50
|
WeekDays.displayName = 'WeekDays';
|
|
46
51
|
|
|
@@ -28,17 +28,22 @@ var WeekHeader = /*#__PURE__*/(0, _react.memo)(function WeekHeader(_ref) {
|
|
|
28
28
|
return (0, _react2.jsx)(_weekDayGrid.default, {
|
|
29
29
|
testId: testId && "".concat(testId, "--column-headers")
|
|
30
30
|
}, daysShort.map(function (shortDay) {
|
|
31
|
-
return (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
31
|
+
return (
|
|
32
|
+
// TODO: Determine if there is a better way to render the button
|
|
33
|
+
// (should be fixed with introduction of keyboard accessibility of
|
|
34
|
+
// Calendar in DSP-9939) (DSP-11588)
|
|
35
|
+
(0, _react2.jsx)(_primitives.Box, {
|
|
36
|
+
padding: "space.100",
|
|
37
|
+
xcss: columnHeaderStyles,
|
|
38
|
+
key: shortDay,
|
|
39
|
+
role: "columnheader"
|
|
40
|
+
}, (0, _react2.jsx)(_text.default, {
|
|
41
|
+
fontWeight: "bold",
|
|
42
|
+
fontSize: "size.050",
|
|
43
|
+
verticalAlign: "middle",
|
|
44
|
+
textTransform: "uppercase"
|
|
45
|
+
}, shortDay))
|
|
46
|
+
);
|
|
42
47
|
}));
|
|
43
48
|
});
|
|
44
49
|
WeekHeader.displayName = 'WeekHeader';
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/calendar.js
CHANGED
|
@@ -4,9 +4,7 @@ import { forwardRef, memo, useMemo } from 'react';
|
|
|
4
4
|
import { jsx } from '@emotion/react';
|
|
5
5
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
|
|
6
6
|
import noop from '@atlaskit/ds-lib/noop';
|
|
7
|
-
import { xcss } from '@atlaskit/primitives';
|
|
8
|
-
import Box from '@atlaskit/primitives/box';
|
|
9
|
-
import Stack from '@atlaskit/primitives/stack';
|
|
7
|
+
import { Box, Stack, xcss } from '@atlaskit/primitives';
|
|
10
8
|
import GlobalTheme from '@atlaskit/theme/components';
|
|
11
9
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
12
10
|
import Header from './internal/components/header';
|
|
@@ -28,7 +26,7 @@ const boxStyles = xcss({
|
|
|
28
26
|
const analyticsAttributes = {
|
|
29
27
|
componentName: 'calendar',
|
|
30
28
|
packageName: "@atlaskit/calendar",
|
|
31
|
-
packageVersion: "13.1.
|
|
29
|
+
packageVersion: "13.1.15"
|
|
32
30
|
};
|
|
33
31
|
const CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar({
|
|
34
32
|
day,
|
|
@@ -47,23 +47,28 @@ const Date = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Date({
|
|
|
47
47
|
}
|
|
48
48
|
}, [onClick]);
|
|
49
49
|
const dateCellStyles = useMemo(() => css(getDateCellStyles(mode)), [mode]);
|
|
50
|
-
return
|
|
51
|
-
//
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
50
|
+
return (
|
|
51
|
+
// TODO: Determine if there is a better way to render the button (should
|
|
52
|
+
// be fixed with introduction of keyboard accessibility of Calendar in
|
|
53
|
+
// DSP-9939) (DSP-11588)
|
|
54
|
+
jsx("button", {
|
|
55
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
56
|
+
css: dateCellStyles,
|
|
57
|
+
"aria-selected": isSelected ? 'true' : 'false',
|
|
58
|
+
tabIndex: isSelected ? 0 : -1,
|
|
59
|
+
type: "button",
|
|
60
|
+
role: "gridcell",
|
|
61
|
+
onClick: handleClick,
|
|
62
|
+
ref: ref,
|
|
63
|
+
"data-disabled": isDisabled || undefined,
|
|
64
|
+
"data-focused": isFocused || undefined,
|
|
65
|
+
"data-prev-selected": isPreviouslySelected || undefined,
|
|
66
|
+
"data-selected": isSelected || undefined,
|
|
67
|
+
"data-sibling": isSibling || undefined,
|
|
68
|
+
"data-today": isToday || undefined,
|
|
69
|
+
"data-testid": testId && isSelected ? `${testId}--selected-day` : undefined
|
|
70
|
+
}, day)
|
|
71
|
+
);
|
|
67
72
|
}));
|
|
68
73
|
Date.displayName = 'Date';
|
|
69
74
|
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import {
|
|
5
|
-
const gridStyles = xcss({
|
|
6
|
-
display: 'grid',
|
|
7
|
-
gridTemplateColumns: 'repeat(7, minmax(max-content, 1fr))'
|
|
8
|
-
});
|
|
4
|
+
import { Grid } from '@atlaskit/primitives';
|
|
9
5
|
/**
|
|
10
6
|
* __Week day grid__
|
|
11
7
|
*
|
|
@@ -15,9 +11,12 @@ const gridStyles = xcss({
|
|
|
15
11
|
const WeekDayGrid = ({
|
|
16
12
|
testId,
|
|
17
13
|
children
|
|
18
|
-
}) =>
|
|
14
|
+
}) =>
|
|
15
|
+
// TODO: Determine if there is a better way to render the row (should be
|
|
16
|
+
// fixed with introduction of keyboard accessibility of Calendar in DSP-9939) (DSP-11588)
|
|
17
|
+
jsx(Grid, {
|
|
19
18
|
testId: testId,
|
|
20
|
-
|
|
19
|
+
templateColumns: "repeat(7, minmax(max-content, 1fr))",
|
|
21
20
|
role: "row"
|
|
22
21
|
}, children);
|
|
23
22
|
export default WeekDayGrid;
|
|
@@ -10,26 +10,31 @@ const WeekDays = /*#__PURE__*/memo(function WeekDays({
|
|
|
10
10
|
mode,
|
|
11
11
|
testId
|
|
12
12
|
}) {
|
|
13
|
-
return
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
13
|
+
return (
|
|
14
|
+
// TODO: Determine if there is a better way to render the button (should be
|
|
15
|
+
// fixed with introduction of keyboard accessibility of Calendar in
|
|
16
|
+
// DSP-9939) (DSP-11588)
|
|
17
|
+
jsx(Box, {
|
|
18
|
+
role: "rowgroup",
|
|
19
|
+
testId: testId && `${testId}--month`
|
|
20
|
+
}, weeks.map((week, i) => jsx(WeekdayGrid, {
|
|
21
|
+
key: i,
|
|
22
|
+
testId: testId && `${testId}--week`
|
|
23
|
+
}, week.values.map(weekDay => jsx(DateComponent, {
|
|
24
|
+
key: `${week.id}-${weekDay.id}`,
|
|
25
|
+
isDisabled: weekDay.isDisabled,
|
|
26
|
+
isFocused: weekDay.isFocused,
|
|
27
|
+
isToday: weekDay.isToday,
|
|
28
|
+
month: weekDay.month,
|
|
29
|
+
onClick: handleClickDay,
|
|
30
|
+
isPreviouslySelected: weekDay.isPreviouslySelected,
|
|
31
|
+
isSelected: weekDay.isSelected,
|
|
32
|
+
isSibling: weekDay.isSiblingMonth,
|
|
33
|
+
year: weekDay.year,
|
|
34
|
+
mode: mode,
|
|
35
|
+
testId: testId
|
|
36
|
+
}, weekDay.day)))))
|
|
37
|
+
);
|
|
33
38
|
});
|
|
34
39
|
WeekDays.displayName = 'WeekDays';
|
|
35
40
|
|
|
@@ -20,7 +20,11 @@ const WeekHeader = /*#__PURE__*/memo(function WeekHeader({
|
|
|
20
20
|
}) {
|
|
21
21
|
return jsx(WeekDayGrid, {
|
|
22
22
|
testId: testId && `${testId}--column-headers`
|
|
23
|
-
}, daysShort.map(shortDay =>
|
|
23
|
+
}, daysShort.map(shortDay =>
|
|
24
|
+
// TODO: Determine if there is a better way to render the button
|
|
25
|
+
// (should be fixed with introduction of keyboard accessibility of
|
|
26
|
+
// Calendar in DSP-9939) (DSP-11588)
|
|
27
|
+
jsx(Box, {
|
|
24
28
|
padding: "space.100",
|
|
25
29
|
xcss: columnHeaderStyles,
|
|
26
30
|
key: shortDay,
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/calendar.js
CHANGED
|
@@ -8,9 +8,7 @@ import { forwardRef, memo, useMemo } from 'react';
|
|
|
8
8
|
import { jsx } from '@emotion/react';
|
|
9
9
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
|
|
10
10
|
import noop from '@atlaskit/ds-lib/noop';
|
|
11
|
-
import { xcss } from '@atlaskit/primitives';
|
|
12
|
-
import Box from '@atlaskit/primitives/box';
|
|
13
|
-
import Stack from '@atlaskit/primitives/stack';
|
|
11
|
+
import { Box, Stack, xcss } from '@atlaskit/primitives';
|
|
14
12
|
import GlobalTheme from '@atlaskit/theme/components';
|
|
15
13
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
16
14
|
import Header from './internal/components/header';
|
|
@@ -32,7 +30,7 @@ var boxStyles = xcss({
|
|
|
32
30
|
var analyticsAttributes = {
|
|
33
31
|
componentName: 'calendar',
|
|
34
32
|
packageName: "@atlaskit/calendar",
|
|
35
|
-
packageVersion: "13.1.
|
|
33
|
+
packageVersion: "13.1.15"
|
|
36
34
|
};
|
|
37
35
|
var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
|
|
38
36
|
var day = _ref.day,
|
|
@@ -54,23 +54,28 @@ var Date = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Date(_ref, ref) {
|
|
|
54
54
|
var dateCellStyles = useMemo(function () {
|
|
55
55
|
return css(getDateCellStyles(mode));
|
|
56
56
|
}, [mode]);
|
|
57
|
-
return
|
|
58
|
-
//
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
57
|
+
return (
|
|
58
|
+
// TODO: Determine if there is a better way to render the button (should
|
|
59
|
+
// be fixed with introduction of keyboard accessibility of Calendar in
|
|
60
|
+
// DSP-9939) (DSP-11588)
|
|
61
|
+
jsx("button", {
|
|
62
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
63
|
+
css: dateCellStyles,
|
|
64
|
+
"aria-selected": isSelected ? 'true' : 'false',
|
|
65
|
+
tabIndex: isSelected ? 0 : -1,
|
|
66
|
+
type: "button",
|
|
67
|
+
role: "gridcell",
|
|
68
|
+
onClick: handleClick,
|
|
69
|
+
ref: ref,
|
|
70
|
+
"data-disabled": isDisabled || undefined,
|
|
71
|
+
"data-focused": isFocused || undefined,
|
|
72
|
+
"data-prev-selected": isPreviouslySelected || undefined,
|
|
73
|
+
"data-selected": isSelected || undefined,
|
|
74
|
+
"data-sibling": isSibling || undefined,
|
|
75
|
+
"data-today": isToday || undefined,
|
|
76
|
+
"data-testid": testId && isSelected ? "".concat(testId, "--selected-day") : undefined
|
|
77
|
+
}, day)
|
|
78
|
+
);
|
|
74
79
|
}));
|
|
75
80
|
Date.displayName = 'Date';
|
|
76
81
|
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import {
|
|
5
|
-
var gridStyles = xcss({
|
|
6
|
-
display: 'grid',
|
|
7
|
-
gridTemplateColumns: 'repeat(7, minmax(max-content, 1fr))'
|
|
8
|
-
});
|
|
4
|
+
import { Grid } from '@atlaskit/primitives';
|
|
9
5
|
/**
|
|
10
6
|
* __Week day grid__
|
|
11
7
|
*
|
|
@@ -15,10 +11,14 @@ var gridStyles = xcss({
|
|
|
15
11
|
var WeekDayGrid = function WeekDayGrid(_ref) {
|
|
16
12
|
var testId = _ref.testId,
|
|
17
13
|
children = _ref.children;
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
return (
|
|
15
|
+
// TODO: Determine if there is a better way to render the row (should be
|
|
16
|
+
// fixed with introduction of keyboard accessibility of Calendar in DSP-9939) (DSP-11588)
|
|
17
|
+
jsx(Grid, {
|
|
18
|
+
testId: testId,
|
|
19
|
+
templateColumns: "repeat(7, minmax(max-content, 1fr))",
|
|
20
|
+
role: "row"
|
|
21
|
+
}, children)
|
|
22
|
+
);
|
|
23
23
|
};
|
|
24
24
|
export default WeekDayGrid;
|
|
@@ -9,30 +9,35 @@ var WeekDays = /*#__PURE__*/memo(function WeekDays(_ref) {
|
|
|
9
9
|
handleClickDay = _ref.handleClickDay,
|
|
10
10
|
mode = _ref.mode,
|
|
11
11
|
testId = _ref.testId;
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
testId: testId && "".concat(testId, "--
|
|
19
|
-
},
|
|
20
|
-
return jsx(
|
|
21
|
-
key:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
12
|
+
return (
|
|
13
|
+
// TODO: Determine if there is a better way to render the button (should be
|
|
14
|
+
// fixed with introduction of keyboard accessibility of Calendar in
|
|
15
|
+
// DSP-9939) (DSP-11588)
|
|
16
|
+
jsx(Box, {
|
|
17
|
+
role: "rowgroup",
|
|
18
|
+
testId: testId && "".concat(testId, "--month")
|
|
19
|
+
}, weeks.map(function (week, i) {
|
|
20
|
+
return jsx(WeekdayGrid, {
|
|
21
|
+
key: i,
|
|
22
|
+
testId: testId && "".concat(testId, "--week")
|
|
23
|
+
}, week.values.map(function (weekDay) {
|
|
24
|
+
return jsx(DateComponent, {
|
|
25
|
+
key: "".concat(week.id, "-").concat(weekDay.id),
|
|
26
|
+
isDisabled: weekDay.isDisabled,
|
|
27
|
+
isFocused: weekDay.isFocused,
|
|
28
|
+
isToday: weekDay.isToday,
|
|
29
|
+
month: weekDay.month,
|
|
30
|
+
onClick: handleClickDay,
|
|
31
|
+
isPreviouslySelected: weekDay.isPreviouslySelected,
|
|
32
|
+
isSelected: weekDay.isSelected,
|
|
33
|
+
isSibling: weekDay.isSiblingMonth,
|
|
34
|
+
year: weekDay.year,
|
|
35
|
+
mode: mode,
|
|
36
|
+
testId: testId
|
|
37
|
+
}, weekDay.day);
|
|
38
|
+
}));
|
|
39
|
+
}))
|
|
40
|
+
);
|
|
36
41
|
});
|
|
37
42
|
WeekDays.displayName = 'WeekDays';
|
|
38
43
|
|
|
@@ -20,17 +20,22 @@ var WeekHeader = /*#__PURE__*/memo(function WeekHeader(_ref) {
|
|
|
20
20
|
return jsx(WeekDayGrid, {
|
|
21
21
|
testId: testId && "".concat(testId, "--column-headers")
|
|
22
22
|
}, daysShort.map(function (shortDay) {
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
return (
|
|
24
|
+
// TODO: Determine if there is a better way to render the button
|
|
25
|
+
// (should be fixed with introduction of keyboard accessibility of
|
|
26
|
+
// Calendar in DSP-9939) (DSP-11588)
|
|
27
|
+
jsx(Box, {
|
|
28
|
+
padding: "space.100",
|
|
29
|
+
xcss: columnHeaderStyles,
|
|
30
|
+
key: shortDay,
|
|
31
|
+
role: "columnheader"
|
|
32
|
+
}, jsx(Text, {
|
|
33
|
+
fontWeight: "bold",
|
|
34
|
+
fontSize: "size.050",
|
|
35
|
+
verticalAlign: "middle",
|
|
36
|
+
textTransform: "uppercase"
|
|
37
|
+
}, shortDay))
|
|
38
|
+
);
|
|
34
39
|
}));
|
|
35
40
|
});
|
|
36
41
|
WeekHeader.displayName = 'WeekHeader';
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/calendar",
|
|
3
|
-
"version": "13.1.
|
|
3
|
+
"version": "13.1.15",
|
|
4
4
|
"description": "An interactive calendar for date selection experiences.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"@atlaskit/heading": "^1.3.0",
|
|
39
39
|
"@atlaskit/icon": "^21.12.0",
|
|
40
40
|
"@atlaskit/locale": "^2.5.0",
|
|
41
|
-
"@atlaskit/primitives": "
|
|
41
|
+
"@atlaskit/primitives": "^1.0.0",
|
|
42
42
|
"@atlaskit/theme": "^12.5.0",
|
|
43
|
-
"@atlaskit/tokens": "^1.
|
|
43
|
+
"@atlaskit/tokens": "^1.13.0",
|
|
44
44
|
"@atlaskit/visually-hidden": "^1.2.0",
|
|
45
45
|
"@babel/runtime": "^7.0.0",
|
|
46
46
|
"@emotion/react": "^11.7.1",
|
|
@@ -94,4 +94,4 @@
|
|
|
94
94
|
},
|
|
95
95
|
"homepage": "https://atlassian.design/components/calendar/",
|
|
96
96
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
97
|
-
}
|
|
97
|
+
}
|