@atlaskit/calendar 13.1.2 → 13.1.4
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 +6 -6
- package/dist/cjs/internal/components/week-day-grid.js +6 -3
- package/dist/cjs/internal/components/week-days.js +10 -5
- package/dist/cjs/internal/components/week-header.js +7 -3
- package/dist/cjs/internal/styles/date.js +5 -4
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/calendar.js +6 -6
- package/dist/es2019/internal/components/week-day-grid.js +5 -3
- package/dist/es2019/internal/components/week-days.js +9 -4
- package/dist/es2019/internal/components/week-header.js +7 -3
- package/dist/es2019/internal/styles/date.js +5 -4
- package/dist/es2019/version.json +1 -1
- package/dist/esm/calendar.js +6 -6
- package/dist/esm/internal/components/week-day-grid.js +5 -3
- package/dist/esm/internal/components/week-days.js +10 -5
- package/dist/esm/internal/components/week-header.js +7 -3
- package/dist/esm/internal/styles/date.js +5 -4
- package/dist/esm/version.json +1 -1
- package/dist/types/internal/components/week-header.d.ts +1 -0
- package/dist/types-ts4.5/internal/components/week-header.d.ts +1 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/calendar
|
|
2
2
|
|
|
3
|
+
## 13.1.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`774ed69ecef`](https://bitbucket.org/atlassian/atlassian-frontend/commits/774ed69ecef) - Internal changes to use space tokens for spacing values. There is no visual change.
|
|
8
|
+
|
|
9
|
+
## 13.1.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`74fec133d99`](https://bitbucket.org/atlassian/atlassian-frontend/commits/74fec133d99) - [ux] Add proper grid roles to calendar.
|
|
14
|
+
|
|
3
15
|
## 13.1.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/calendar.js
CHANGED
|
@@ -33,7 +33,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
33
33
|
var analyticsAttributes = {
|
|
34
34
|
componentName: 'calendar',
|
|
35
35
|
packageName: "@atlaskit/calendar",
|
|
36
|
-
packageVersion: "13.1.
|
|
36
|
+
packageVersion: "13.1.4"
|
|
37
37
|
};
|
|
38
38
|
var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_ref, ref) {
|
|
39
39
|
var day = _ref.day,
|
|
@@ -177,7 +177,6 @@ var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_re
|
|
|
177
177
|
onBlur: handleContainerBlur,
|
|
178
178
|
onFocus: handleContainerFocus,
|
|
179
179
|
onKeyDown: handleContainerKeyDown,
|
|
180
|
-
role: "presentation",
|
|
181
180
|
testId: testId && "".concat(testId, "--container"),
|
|
182
181
|
ref: ref
|
|
183
182
|
}, (0, _react2.jsx)(_visuallyHidden.default, null, (0, _react2.jsx)("span", {
|
|
@@ -192,8 +191,8 @@ var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_re
|
|
|
192
191
|
},
|
|
193
192
|
"aria-describedby": announceId,
|
|
194
193
|
"aria-label": "calendar",
|
|
195
|
-
|
|
196
|
-
|
|
194
|
+
tabIndex: tabIndex,
|
|
195
|
+
testId: testId && "".concat(testId, "--calendar")
|
|
197
196
|
}, (0, _react2.jsx)(_stack.default, {
|
|
198
197
|
space: "space.150"
|
|
199
198
|
}, (0, _react2.jsx)(_header.default
|
|
@@ -210,10 +209,11 @@ var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_re
|
|
|
210
209
|
testId: testId
|
|
211
210
|
}), (0, _react2.jsx)(_box.default, {
|
|
212
211
|
display: "block",
|
|
213
|
-
role: "
|
|
212
|
+
role: "grid"
|
|
214
213
|
}, (0, _react2.jsx)(_weekHeader.default, {
|
|
215
214
|
daysShort: daysShort,
|
|
216
|
-
mode: mode
|
|
215
|
+
mode: mode,
|
|
216
|
+
testId: testId
|
|
217
217
|
}), (0, _react2.jsx)(_weekDays.default, {
|
|
218
218
|
weeks: weeks,
|
|
219
219
|
handleClickDay: handleClickDay,
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.default = void 0;
|
|
7
8
|
var _react = require("@emotion/react");
|
|
9
|
+
var _box = _interopRequireDefault(require("@atlaskit/ds-explorations/box"));
|
|
8
10
|
/** @jsx jsx */
|
|
9
11
|
|
|
10
12
|
var gridStyles = (0, _react.css)({
|
|
@@ -20,9 +22,10 @@ var gridStyles = (0, _react.css)({
|
|
|
20
22
|
var WeekDayGrid = function WeekDayGrid(_ref) {
|
|
21
23
|
var testId = _ref.testId,
|
|
22
24
|
children = _ref.children;
|
|
23
|
-
return (0, _react.jsx)(
|
|
24
|
-
|
|
25
|
-
css: gridStyles
|
|
25
|
+
return (0, _react.jsx)(_box.default, {
|
|
26
|
+
testId: testId,
|
|
27
|
+
css: gridStyles,
|
|
28
|
+
role: "row"
|
|
26
29
|
}, children);
|
|
27
30
|
};
|
|
28
31
|
var _default = WeekDayGrid;
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _react2 = require("@emotion/react");
|
|
10
|
+
var _box = _interopRequireDefault(require("@atlaskit/ds-explorations/box"));
|
|
10
11
|
var _date = _interopRequireDefault(require("./date"));
|
|
11
12
|
var _weekDayGrid = _interopRequireDefault(require("./week-day-grid"));
|
|
12
13
|
/** @jsx jsx */
|
|
@@ -16,11 +17,15 @@ var WeekDays = /*#__PURE__*/(0, _react.memo)(function WeekDays(_ref) {
|
|
|
16
17
|
handleClickDay = _ref.handleClickDay,
|
|
17
18
|
mode = _ref.mode,
|
|
18
19
|
testId = _ref.testId;
|
|
19
|
-
return (0, _react2.jsx)(
|
|
20
|
-
|
|
20
|
+
return (0, _react2.jsx)(_box.default, {
|
|
21
|
+
display: "block",
|
|
22
|
+
role: "rowgroup",
|
|
21
23
|
testId: testId && "".concat(testId, "--month")
|
|
22
|
-
}, weeks.map(function (week) {
|
|
23
|
-
return
|
|
24
|
+
}, weeks.map(function (week, i) {
|
|
25
|
+
return (0, _react2.jsx)(_weekDayGrid.default, {
|
|
26
|
+
key: i,
|
|
27
|
+
testId: testId && "".concat(testId, "--week")
|
|
28
|
+
}, week.values.map(function (weekDay) {
|
|
24
29
|
return (0, _react2.jsx)(_date.default, {
|
|
25
30
|
key: "".concat(week.id, "-").concat(weekDay.id),
|
|
26
31
|
isDisabled: weekDay.isDisabled,
|
|
@@ -35,7 +40,7 @@ var WeekDays = /*#__PURE__*/(0, _react.memo)(function WeekDays(_ref) {
|
|
|
35
40
|
mode: mode,
|
|
36
41
|
testId: testId
|
|
37
42
|
}, weekDay.day);
|
|
38
|
-
});
|
|
43
|
+
}));
|
|
39
44
|
}));
|
|
40
45
|
});
|
|
41
46
|
WeekDays.displayName = 'WeekDays';
|
|
@@ -14,8 +14,11 @@ var _weekDayGrid = _interopRequireDefault(require("./week-day-grid"));
|
|
|
14
14
|
/** @jsx jsx */
|
|
15
15
|
|
|
16
16
|
var WeekHeader = /*#__PURE__*/(0, _react.memo)(function WeekHeader(_ref) {
|
|
17
|
-
var daysShort = _ref.daysShort
|
|
18
|
-
|
|
17
|
+
var daysShort = _ref.daysShort,
|
|
18
|
+
testId = _ref.testId;
|
|
19
|
+
return (0, _react2.jsx)(_weekDayGrid.default, {
|
|
20
|
+
testId: testId && "".concat(testId, "--column-headers")
|
|
21
|
+
}, daysShort.map(function (shortDay) {
|
|
19
22
|
return (0, _react2.jsx)(_box.default, {
|
|
20
23
|
padding: "space.100",
|
|
21
24
|
display: "block",
|
|
@@ -29,7 +32,8 @@ var WeekHeader = /*#__PURE__*/(0, _react.memo)(function WeekHeader(_ref) {
|
|
|
29
32
|
color: "var(--ds-text-subtle, ".concat(_colors.N200, ")") // Apply correct fallback to shortDay text
|
|
30
33
|
},
|
|
31
34
|
|
|
32
|
-
key: shortDay
|
|
35
|
+
key: shortDay,
|
|
36
|
+
role: "columnheader"
|
|
33
37
|
}, (0, _react2.jsx)(_text.default, {
|
|
34
38
|
fontWeight: "bold",
|
|
35
39
|
fontSize: "size.050",
|
|
@@ -35,13 +35,14 @@ var dateCellStyles = function dateCellStyles() {
|
|
|
35
35
|
return {
|
|
36
36
|
all: 'unset',
|
|
37
37
|
display: 'block',
|
|
38
|
-
padding:
|
|
38
|
+
padding: "var(--ds-space-050, 4px)".concat(" 9px"),
|
|
39
39
|
position: 'relative',
|
|
40
40
|
backgroundColor: 'transparent',
|
|
41
41
|
border: '2px solid transparent',
|
|
42
42
|
borderRadius: 3,
|
|
43
43
|
color: textColor[mode],
|
|
44
44
|
cursor: 'pointer',
|
|
45
|
+
flexGrow: 1,
|
|
45
46
|
fontSize: "var(--ds-font-size-100, 14px)",
|
|
46
47
|
textAlign: 'center',
|
|
47
48
|
'&[data-sibling]': {
|
|
@@ -54,9 +55,9 @@ var dateCellStyles = function dateCellStyles() {
|
|
|
54
55
|
display: 'block',
|
|
55
56
|
height: 2,
|
|
56
57
|
position: 'absolute',
|
|
57
|
-
right:
|
|
58
|
-
bottom:
|
|
59
|
-
left:
|
|
58
|
+
right: "var(--ds-space-025, 2px)",
|
|
59
|
+
bottom: "var(--ds-space-025, 2px)",
|
|
60
|
+
left: "var(--ds-space-025, 2px)",
|
|
60
61
|
backgroundColor: 'currentColor',
|
|
61
62
|
content: '""'
|
|
62
63
|
}
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/calendar.js
CHANGED
|
@@ -23,7 +23,7 @@ import useUniqueId from './internal/hooks/use-unique-id';
|
|
|
23
23
|
const analyticsAttributes = {
|
|
24
24
|
componentName: 'calendar',
|
|
25
25
|
packageName: "@atlaskit/calendar",
|
|
26
|
-
packageVersion: "13.1.
|
|
26
|
+
packageVersion: "13.1.4"
|
|
27
27
|
};
|
|
28
28
|
const CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar({
|
|
29
29
|
day,
|
|
@@ -149,7 +149,6 @@ const CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar({
|
|
|
149
149
|
onBlur: handleContainerBlur,
|
|
150
150
|
onFocus: handleContainerFocus,
|
|
151
151
|
onKeyDown: handleContainerKeyDown,
|
|
152
|
-
role: "presentation",
|
|
153
152
|
testId: testId && `${testId}--container`,
|
|
154
153
|
ref: ref
|
|
155
154
|
}, jsx(VisuallyHidden, null, jsx("span", {
|
|
@@ -164,8 +163,8 @@ const CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar({
|
|
|
164
163
|
},
|
|
165
164
|
"aria-describedby": announceId,
|
|
166
165
|
"aria-label": "calendar",
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
tabIndex: tabIndex,
|
|
167
|
+
testId: testId && `${testId}--calendar`
|
|
169
168
|
}, jsx(Stack, {
|
|
170
169
|
space: "space.150"
|
|
171
170
|
}, jsx(Header
|
|
@@ -182,10 +181,11 @@ const CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar({
|
|
|
182
181
|
testId: testId
|
|
183
182
|
}), jsx(Box, {
|
|
184
183
|
display: "block",
|
|
185
|
-
role: "
|
|
184
|
+
role: "grid"
|
|
186
185
|
}, jsx(WeekHeaderComponent, {
|
|
187
186
|
daysShort: daysShort,
|
|
188
|
-
mode: mode
|
|
187
|
+
mode: mode,
|
|
188
|
+
testId: testId
|
|
189
189
|
}), jsx(WeekDaysComponent, {
|
|
190
190
|
weeks: weeks,
|
|
191
191
|
handleClickDay: handleClickDay,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
|
+
import Box from '@atlaskit/ds-explorations/box';
|
|
4
5
|
const gridStyles = css({
|
|
5
6
|
display: 'grid',
|
|
6
7
|
gridTemplateColumns: 'repeat(7, minmax(max-content, 1fr))'
|
|
@@ -14,8 +15,9 @@ const gridStyles = css({
|
|
|
14
15
|
const WeekDayGrid = ({
|
|
15
16
|
testId,
|
|
16
17
|
children
|
|
17
|
-
}) => jsx(
|
|
18
|
-
|
|
19
|
-
css: gridStyles
|
|
18
|
+
}) => jsx(Box, {
|
|
19
|
+
testId: testId,
|
|
20
|
+
css: gridStyles,
|
|
21
|
+
role: "row"
|
|
20
22
|
}, children);
|
|
21
23
|
export default WeekDayGrid;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
+
import Box from '@atlaskit/ds-explorations/box';
|
|
4
5
|
import DateComponent from './date';
|
|
5
6
|
import WeekdayGrid from './week-day-grid';
|
|
6
7
|
const WeekDays = /*#__PURE__*/memo(function WeekDays({
|
|
@@ -9,10 +10,14 @@ const WeekDays = /*#__PURE__*/memo(function WeekDays({
|
|
|
9
10
|
mode,
|
|
10
11
|
testId
|
|
11
12
|
}) {
|
|
12
|
-
return jsx(
|
|
13
|
-
|
|
13
|
+
return jsx(Box, {
|
|
14
|
+
display: "block",
|
|
15
|
+
role: "rowgroup",
|
|
14
16
|
testId: testId && `${testId}--month`
|
|
15
|
-
}, weeks.map(week
|
|
17
|
+
}, weeks.map((week, i) => jsx(WeekdayGrid, {
|
|
18
|
+
key: i,
|
|
19
|
+
testId: testId && `${testId}--week`
|
|
20
|
+
}, week.values.map(weekDay => jsx(DateComponent, {
|
|
16
21
|
key: `${week.id}-${weekDay.id}`,
|
|
17
22
|
isDisabled: weekDay.isDisabled,
|
|
18
23
|
isFocused: weekDay.isFocused,
|
|
@@ -25,7 +30,7 @@ const WeekDays = /*#__PURE__*/memo(function WeekDays({
|
|
|
25
30
|
year: weekDay.year,
|
|
26
31
|
mode: mode,
|
|
27
32
|
testId: testId
|
|
28
|
-
}, weekDay.day))));
|
|
33
|
+
}, weekDay.day)))));
|
|
29
34
|
});
|
|
30
35
|
WeekDays.displayName = 'WeekDays';
|
|
31
36
|
|
|
@@ -6,9 +6,12 @@ import Text from '@atlaskit/ds-explorations/text';
|
|
|
6
6
|
import { N200 } from '@atlaskit/theme/colors';
|
|
7
7
|
import WeekDayGrid from './week-day-grid';
|
|
8
8
|
const WeekHeader = /*#__PURE__*/memo(function WeekHeader({
|
|
9
|
-
daysShort
|
|
9
|
+
daysShort,
|
|
10
|
+
testId
|
|
10
11
|
}) {
|
|
11
|
-
return jsx(WeekDayGrid,
|
|
12
|
+
return jsx(WeekDayGrid, {
|
|
13
|
+
testId: testId && `${testId}--column-headers`
|
|
14
|
+
}, daysShort.map(shortDay => jsx(Box, {
|
|
12
15
|
padding: "space.100",
|
|
13
16
|
display: "block",
|
|
14
17
|
UNSAFE_style: {
|
|
@@ -21,7 +24,8 @@ const WeekHeader = /*#__PURE__*/memo(function WeekHeader({
|
|
|
21
24
|
color: `var(--ds-text-subtle, ${N200})` // Apply correct fallback to shortDay text
|
|
22
25
|
},
|
|
23
26
|
|
|
24
|
-
key: shortDay
|
|
27
|
+
key: shortDay,
|
|
28
|
+
role: "columnheader"
|
|
25
29
|
}, jsx(Text, {
|
|
26
30
|
fontWeight: "bold",
|
|
27
31
|
fontSize: "size.050",
|
|
@@ -27,13 +27,14 @@ const borderColorFocused = {
|
|
|
27
27
|
export const dateCellStyles = (mode = 'light') => ({
|
|
28
28
|
all: 'unset',
|
|
29
29
|
display: 'block',
|
|
30
|
-
padding:
|
|
30
|
+
padding: `${"var(--ds-space-050, 4px)"} 9px`,
|
|
31
31
|
position: 'relative',
|
|
32
32
|
backgroundColor: 'transparent',
|
|
33
33
|
border: '2px solid transparent',
|
|
34
34
|
borderRadius: 3,
|
|
35
35
|
color: textColor[mode],
|
|
36
36
|
cursor: 'pointer',
|
|
37
|
+
flexGrow: 1,
|
|
37
38
|
fontSize: "var(--ds-font-size-100, 14px)",
|
|
38
39
|
textAlign: 'center',
|
|
39
40
|
'&[data-sibling]': {
|
|
@@ -46,9 +47,9 @@ export const dateCellStyles = (mode = 'light') => ({
|
|
|
46
47
|
display: 'block',
|
|
47
48
|
height: 2,
|
|
48
49
|
position: 'absolute',
|
|
49
|
-
right:
|
|
50
|
-
bottom:
|
|
51
|
-
left:
|
|
50
|
+
right: "var(--ds-space-025, 2px)",
|
|
51
|
+
bottom: "var(--ds-space-025, 2px)",
|
|
52
|
+
left: "var(--ds-space-025, 2px)",
|
|
52
53
|
backgroundColor: 'currentColor',
|
|
53
54
|
content: '""'
|
|
54
55
|
}
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/calendar.js
CHANGED
|
@@ -27,7 +27,7 @@ import useUniqueId from './internal/hooks/use-unique-id';
|
|
|
27
27
|
var analyticsAttributes = {
|
|
28
28
|
componentName: 'calendar',
|
|
29
29
|
packageName: "@atlaskit/calendar",
|
|
30
|
-
packageVersion: "13.1.
|
|
30
|
+
packageVersion: "13.1.4"
|
|
31
31
|
};
|
|
32
32
|
var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
|
|
33
33
|
var day = _ref.day,
|
|
@@ -171,7 +171,6 @@ var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
|
|
|
171
171
|
onBlur: handleContainerBlur,
|
|
172
172
|
onFocus: handleContainerFocus,
|
|
173
173
|
onKeyDown: handleContainerKeyDown,
|
|
174
|
-
role: "presentation",
|
|
175
174
|
testId: testId && "".concat(testId, "--container"),
|
|
176
175
|
ref: ref
|
|
177
176
|
}, jsx(VisuallyHidden, null, jsx("span", {
|
|
@@ -186,8 +185,8 @@ var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
|
|
|
186
185
|
},
|
|
187
186
|
"aria-describedby": announceId,
|
|
188
187
|
"aria-label": "calendar",
|
|
189
|
-
|
|
190
|
-
|
|
188
|
+
tabIndex: tabIndex,
|
|
189
|
+
testId: testId && "".concat(testId, "--calendar")
|
|
191
190
|
}, jsx(Stack, {
|
|
192
191
|
space: "space.150"
|
|
193
192
|
}, jsx(Header
|
|
@@ -204,10 +203,11 @@ var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
|
|
|
204
203
|
testId: testId
|
|
205
204
|
}), jsx(Box, {
|
|
206
205
|
display: "block",
|
|
207
|
-
role: "
|
|
206
|
+
role: "grid"
|
|
208
207
|
}, jsx(WeekHeaderComponent, {
|
|
209
208
|
daysShort: daysShort,
|
|
210
|
-
mode: mode
|
|
209
|
+
mode: mode,
|
|
210
|
+
testId: testId
|
|
211
211
|
}), jsx(WeekDaysComponent, {
|
|
212
212
|
weeks: weeks,
|
|
213
213
|
handleClickDay: handleClickDay,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
|
+
import Box from '@atlaskit/ds-explorations/box';
|
|
4
5
|
var gridStyles = css({
|
|
5
6
|
display: 'grid',
|
|
6
7
|
gridTemplateColumns: 'repeat(7, minmax(max-content, 1fr))'
|
|
@@ -14,9 +15,10 @@ var gridStyles = css({
|
|
|
14
15
|
var WeekDayGrid = function WeekDayGrid(_ref) {
|
|
15
16
|
var testId = _ref.testId,
|
|
16
17
|
children = _ref.children;
|
|
17
|
-
return jsx(
|
|
18
|
-
|
|
19
|
-
css: gridStyles
|
|
18
|
+
return jsx(Box, {
|
|
19
|
+
testId: testId,
|
|
20
|
+
css: gridStyles,
|
|
21
|
+
role: "row"
|
|
20
22
|
}, children);
|
|
21
23
|
};
|
|
22
24
|
export default WeekDayGrid;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
+
import Box from '@atlaskit/ds-explorations/box';
|
|
4
5
|
import DateComponent from './date';
|
|
5
6
|
import WeekdayGrid from './week-day-grid';
|
|
6
7
|
var WeekDays = /*#__PURE__*/memo(function WeekDays(_ref) {
|
|
@@ -8,11 +9,15 @@ var WeekDays = /*#__PURE__*/memo(function WeekDays(_ref) {
|
|
|
8
9
|
handleClickDay = _ref.handleClickDay,
|
|
9
10
|
mode = _ref.mode,
|
|
10
11
|
testId = _ref.testId;
|
|
11
|
-
return jsx(
|
|
12
|
-
|
|
12
|
+
return jsx(Box, {
|
|
13
|
+
display: "block",
|
|
14
|
+
role: "rowgroup",
|
|
13
15
|
testId: testId && "".concat(testId, "--month")
|
|
14
|
-
}, weeks.map(function (week) {
|
|
15
|
-
return
|
|
16
|
+
}, weeks.map(function (week, i) {
|
|
17
|
+
return jsx(WeekdayGrid, {
|
|
18
|
+
key: i,
|
|
19
|
+
testId: testId && "".concat(testId, "--week")
|
|
20
|
+
}, week.values.map(function (weekDay) {
|
|
16
21
|
return jsx(DateComponent, {
|
|
17
22
|
key: "".concat(week.id, "-").concat(weekDay.id),
|
|
18
23
|
isDisabled: weekDay.isDisabled,
|
|
@@ -27,7 +32,7 @@ var WeekDays = /*#__PURE__*/memo(function WeekDays(_ref) {
|
|
|
27
32
|
mode: mode,
|
|
28
33
|
testId: testId
|
|
29
34
|
}, weekDay.day);
|
|
30
|
-
});
|
|
35
|
+
}));
|
|
31
36
|
}));
|
|
32
37
|
});
|
|
33
38
|
WeekDays.displayName = 'WeekDays';
|
|
@@ -6,8 +6,11 @@ import Text from '@atlaskit/ds-explorations/text';
|
|
|
6
6
|
import { N200 } from '@atlaskit/theme/colors';
|
|
7
7
|
import WeekDayGrid from './week-day-grid';
|
|
8
8
|
var WeekHeader = /*#__PURE__*/memo(function WeekHeader(_ref) {
|
|
9
|
-
var daysShort = _ref.daysShort
|
|
10
|
-
|
|
9
|
+
var daysShort = _ref.daysShort,
|
|
10
|
+
testId = _ref.testId;
|
|
11
|
+
return jsx(WeekDayGrid, {
|
|
12
|
+
testId: testId && "".concat(testId, "--column-headers")
|
|
13
|
+
}, daysShort.map(function (shortDay) {
|
|
11
14
|
return jsx(Box, {
|
|
12
15
|
padding: "space.100",
|
|
13
16
|
display: "block",
|
|
@@ -21,7 +24,8 @@ var WeekHeader = /*#__PURE__*/memo(function WeekHeader(_ref) {
|
|
|
21
24
|
color: "var(--ds-text-subtle, ".concat(N200, ")") // Apply correct fallback to shortDay text
|
|
22
25
|
},
|
|
23
26
|
|
|
24
|
-
key: shortDay
|
|
27
|
+
key: shortDay,
|
|
28
|
+
role: "columnheader"
|
|
25
29
|
}, jsx(Text, {
|
|
26
30
|
fontWeight: "bold",
|
|
27
31
|
fontSize: "size.050",
|
|
@@ -29,13 +29,14 @@ export var dateCellStyles = function dateCellStyles() {
|
|
|
29
29
|
return {
|
|
30
30
|
all: 'unset',
|
|
31
31
|
display: 'block',
|
|
32
|
-
padding:
|
|
32
|
+
padding: "var(--ds-space-050, 4px)".concat(" 9px"),
|
|
33
33
|
position: 'relative',
|
|
34
34
|
backgroundColor: 'transparent',
|
|
35
35
|
border: '2px solid transparent',
|
|
36
36
|
borderRadius: 3,
|
|
37
37
|
color: textColor[mode],
|
|
38
38
|
cursor: 'pointer',
|
|
39
|
+
flexGrow: 1,
|
|
39
40
|
fontSize: "var(--ds-font-size-100, 14px)",
|
|
40
41
|
textAlign: 'center',
|
|
41
42
|
'&[data-sibling]': {
|
|
@@ -48,9 +49,9 @@ export var dateCellStyles = function dateCellStyles() {
|
|
|
48
49
|
display: 'block',
|
|
49
50
|
height: 2,
|
|
50
51
|
position: 'absolute',
|
|
51
|
-
right:
|
|
52
|
-
bottom:
|
|
53
|
-
left:
|
|
52
|
+
right: "var(--ds-space-025, 2px)",
|
|
53
|
+
bottom: "var(--ds-space-025, 2px)",
|
|
54
|
+
left: "var(--ds-space-025, 2px)",
|
|
54
55
|
backgroundColor: 'currentColor',
|
|
55
56
|
content: '""'
|
|
56
57
|
}
|
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.4",
|
|
4
4
|
"description": "An interactive calendar for date selection experiences.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
35
35
|
"@atlaskit/button": "^16.7.0",
|
|
36
|
-
"@atlaskit/ds-explorations": "^2.
|
|
36
|
+
"@atlaskit/ds-explorations": "^2.2.0",
|
|
37
37
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
38
38
|
"@atlaskit/heading": "^1.3.0",
|
|
39
39
|
"@atlaskit/icon": "^21.12.0",
|
|
40
40
|
"@atlaskit/locale": "^2.5.0",
|
|
41
41
|
"@atlaskit/primitives": "^0.9.0",
|
|
42
42
|
"@atlaskit/theme": "^12.5.0",
|
|
43
|
-
"@atlaskit/tokens": "^1.
|
|
43
|
+
"@atlaskit/tokens": "^1.5.0",
|
|
44
44
|
"@atlaskit/visually-hidden": "^1.2.0",
|
|
45
45
|
"@babel/runtime": "^7.0.0",
|
|
46
46
|
"@emotion/react": "^11.7.1",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@atlaskit/docs": "*",
|
|
55
|
-
"@atlaskit/select": "^16.
|
|
55
|
+
"@atlaskit/select": "^16.5.0",
|
|
56
56
|
"@atlaskit/ssr": "*",
|
|
57
57
|
"@atlaskit/visual-regression": "*",
|
|
58
58
|
"@atlaskit/webdriver-runner": "*",
|