@atlaskit/calendar 13.2.1 → 13.3.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 +12 -0
- package/dist/cjs/calendar.js +8 -21
- package/dist/cjs/internal/components/date.js +3 -20
- package/dist/cjs/internal/components/header.js +41 -21
- package/dist/cjs/internal/components/week-header.js +1 -2
- package/dist/cjs/internal/hooks/use-get-weeks.js +2 -2
- package/dist/cjs/internal/hooks/use-handle-date-change.js +2 -2
- package/dist/cjs/internal/styles/date.js +27 -25
- package/dist/es2019/calendar.js +7 -18
- package/dist/es2019/internal/components/date.js +3 -20
- package/dist/es2019/internal/components/header.js +38 -22
- package/dist/es2019/internal/components/week-header.js +1 -2
- package/dist/es2019/internal/styles/date.js +1 -3
- package/dist/esm/calendar.js +9 -22
- package/dist/esm/internal/components/date.js +3 -20
- package/dist/esm/internal/components/header.js +42 -22
- package/dist/esm/internal/components/week-header.js +1 -2
- package/dist/esm/internal/hooks/use-get-weeks.js +2 -2
- package/dist/esm/internal/hooks/use-handle-date-change.js +2 -2
- package/dist/esm/internal/styles/date.js +27 -24
- package/dist/types/internal/components/header.d.ts +2 -2
- package/dist/types-ts4.5/internal/components/header.d.ts +2 -2
- package/package.json +9 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/calendar
|
|
2
2
|
|
|
3
|
+
## 13.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`26825f14d51`](https://bitbucket.org/atlassian/atlassian-frontend/commits/26825f14d51) - [ux] This adds greater keyboard accessibility to calendar, and removes the feature flag that gated this change.
|
|
8
|
+
|
|
9
|
+
## 13.2.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`ceedd1f27df`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ceedd1f27df) - [ux] Ensures month/year does not render as live region until it has changed or has otherwise been interacted with for better usability. Part of feature flag for keyboard accessibility.
|
|
14
|
+
|
|
3
15
|
## 13.2.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/calendar.js
CHANGED
|
@@ -12,10 +12,8 @@ var _react = require("react");
|
|
|
12
12
|
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
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
15
|
var _primitives = require("@atlaskit/primitives");
|
|
17
16
|
var _components = _interopRequireDefault(require("@atlaskit/theme/components"));
|
|
18
|
-
var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
|
|
19
17
|
var _header = _interopRequireDefault(require("./internal/components/header"));
|
|
20
18
|
var _weekDays = _interopRequireDefault(require("./internal/components/week-days"));
|
|
21
19
|
var _weekHeader = _interopRequireDefault(require("./internal/components/week-header"));
|
|
@@ -28,8 +26,8 @@ var _useHandleDateChange2 = _interopRequireDefault(require("./internal/hooks/use
|
|
|
28
26
|
var _useHandleDateSelect2 = _interopRequireDefault(require("./internal/hooks/use-handle-date-select"));
|
|
29
27
|
var _useLocale2 = _interopRequireDefault(require("./internal/hooks/use-locale"));
|
|
30
28
|
var _useUniqueId = _interopRequireDefault(require("./internal/hooks/use-unique-id"));
|
|
31
|
-
function ownKeys(
|
|
32
|
-
function _objectSpread(
|
|
29
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
30
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /** @jsx jsx */
|
|
33
31
|
var boxStyles = (0, _primitives.xcss)({
|
|
34
32
|
display: 'inline-block',
|
|
35
33
|
userSelect: 'none'
|
|
@@ -37,7 +35,7 @@ var boxStyles = (0, _primitives.xcss)({
|
|
|
37
35
|
var analyticsAttributes = {
|
|
38
36
|
componentName: 'calendar',
|
|
39
37
|
packageName: "@atlaskit/calendar",
|
|
40
|
-
packageVersion: "13.
|
|
38
|
+
packageVersion: "13.3.0"
|
|
41
39
|
};
|
|
42
40
|
var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_ref, ref) {
|
|
43
41
|
var day = _ref.day,
|
|
@@ -178,10 +176,6 @@ var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_re
|
|
|
178
176
|
daysLong: daysLong,
|
|
179
177
|
weekStartDay: weekStartDay
|
|
180
178
|
});
|
|
181
|
-
var announceId = (0, _useUniqueId.default)('announce');
|
|
182
|
-
var announcerDate = (0, _react.useMemo)(function () {
|
|
183
|
-
return new Date(yearValue, monthValue - 1, dayValue).toString();
|
|
184
|
-
}, [dayValue, monthValue, yearValue]);
|
|
185
179
|
var getNextHeading = function getNextHeading() {
|
|
186
180
|
// Next month is (currentMonth - 1) + 1, or just currentMonth in this
|
|
187
181
|
// instance.
|
|
@@ -204,19 +198,12 @@ var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_re
|
|
|
204
198
|
style: style,
|
|
205
199
|
onBlur: handleContainerBlur,
|
|
206
200
|
onFocus: handleContainerFocus,
|
|
207
|
-
onKeyDown: (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.calendar-keyboard-accessibility_967h1') ? undefined : handleContainerKeyDown,
|
|
208
201
|
"data-testid": testId && "".concat(testId, "--container"),
|
|
209
202
|
ref: ref
|
|
210
|
-
}, (0,
|
|
211
|
-
id: announceId,
|
|
212
|
-
"aria-live": "assertive",
|
|
213
|
-
"aria-relevant": "text"
|
|
214
|
-
}, announcerDate)), (0, _react2.jsx)(_primitives.Box, {
|
|
203
|
+
}, (0, _react2.jsx)(_primitives.Box, {
|
|
215
204
|
xcss: boxStyles,
|
|
216
205
|
padding: "space.200",
|
|
217
|
-
"aria-describedby": (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.calendar-keyboard-accessibility_967h1') ? undefined : announceId,
|
|
218
206
|
"aria-label": "calendar",
|
|
219
|
-
tabIndex: (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.calendar-keyboard-accessibility_967h1') ? undefined : tabIndex,
|
|
220
207
|
testId: testId && "".concat(testId, "--calendar")
|
|
221
208
|
}, (0, _react2.jsx)(_primitives.Stack, {
|
|
222
209
|
space: "space.150"
|
|
@@ -234,13 +221,13 @@ var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_re
|
|
|
234
221
|
handleClickPrev: handleClickPrev,
|
|
235
222
|
headerId: headerId,
|
|
236
223
|
mode: mode,
|
|
237
|
-
tabIndex:
|
|
224
|
+
tabIndex: tabIndex,
|
|
238
225
|
testId: testId
|
|
239
226
|
}), (0, _react2.jsx)(_primitives.Box, {
|
|
240
227
|
role: "grid",
|
|
241
|
-
tabIndex:
|
|
242
|
-
onKeyDown:
|
|
243
|
-
"aria-labelledby":
|
|
228
|
+
tabIndex: tabIndex,
|
|
229
|
+
onKeyDown: handleContainerKeyDown,
|
|
230
|
+
"aria-labelledby": headerId,
|
|
244
231
|
testId: testId && "".concat(testId, "--calendar-dates")
|
|
245
232
|
}, (0, _react2.jsx)(_weekHeader.default, {
|
|
246
233
|
daysShort: daysShort,
|
|
@@ -8,7 +8,6 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _react2 = require("@emotion/react");
|
|
10
10
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
11
|
var _primitives = require("@atlaskit/primitives");
|
|
13
12
|
var _date = require("../styles/date");
|
|
14
13
|
/** @jsx jsx */
|
|
@@ -53,7 +52,7 @@ var Date = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
|
53
52
|
}, [day, month, year, isDisabled]);
|
|
54
53
|
var focusRef = (0, _react.useRef)(null);
|
|
55
54
|
(0, _react.useEffect)(function () {
|
|
56
|
-
if (
|
|
55
|
+
if (isFocused && shouldSetFocus && focusRef.current) {
|
|
57
56
|
focusRef.current.focus();
|
|
58
57
|
}
|
|
59
58
|
}, [isFocused, shouldSetFocus]);
|
|
@@ -74,7 +73,7 @@ var Date = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
|
74
73
|
var dateCellStyles = (0, _react.useMemo)(function () {
|
|
75
74
|
return (0, _react2.css)((0, _date.dateCellStyles)(mode));
|
|
76
75
|
}, [mode]);
|
|
77
|
-
return (0,
|
|
76
|
+
return (0, _react2.jsx)(_primitives.Grid, {
|
|
78
77
|
role: "gridcell",
|
|
79
78
|
alignItems: "center"
|
|
80
79
|
}, (0, _react2.jsx)("button", {
|
|
@@ -95,23 +94,7 @@ var Date = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
|
95
94
|
"data-sibling": isSibling || undefined,
|
|
96
95
|
"data-today": isToday || undefined,
|
|
97
96
|
"data-testid": testId && (isSelected ? "".concat(testId, "--selected-day") : "".concat(testId, "--day"))
|
|
98
|
-
}, day))
|
|
99
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
100
|
-
css: dateCellStyles,
|
|
101
|
-
"aria-selected": isSelected ? 'true' : 'false',
|
|
102
|
-
tabIndex: isSelected ? 0 : -1,
|
|
103
|
-
type: "button",
|
|
104
|
-
role: "gridcell",
|
|
105
|
-
onClick: handleClick,
|
|
106
|
-
ref: ref,
|
|
107
|
-
"data-disabled": isDisabled || undefined,
|
|
108
|
-
"data-focused": isFocused || undefined,
|
|
109
|
-
"data-prev-selected": isPreviouslySelected || undefined,
|
|
110
|
-
"data-selected": isSelected || undefined,
|
|
111
|
-
"data-sibling": isSibling || undefined,
|
|
112
|
-
"data-today": isToday || undefined,
|
|
113
|
-
"data-testid": testId && (isSelected ? "".concat(testId, "--selected-day") : "".concat(testId, "--day"))
|
|
114
|
-
}, day);
|
|
97
|
+
}, day));
|
|
115
98
|
}));
|
|
116
99
|
Date.displayName = 'Date';
|
|
117
100
|
|
|
@@ -5,13 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
8
9
|
var _react = require("react");
|
|
9
10
|
var _react2 = require("@emotion/react");
|
|
10
11
|
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
11
12
|
var _heading = _interopRequireDefault(require("@atlaskit/heading"));
|
|
12
13
|
var _chevronLeftLarge = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-left-large"));
|
|
13
14
|
var _chevronRightLarge = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-right-large"));
|
|
14
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
15
|
var _primitives = require("@atlaskit/primitives");
|
|
16
16
|
var _colors = require("@atlaskit/theme/colors");
|
|
17
17
|
var _useUniqueId = _interopRequireDefault(require("../../internal/hooks/use-unique-id"));
|
|
@@ -21,7 +21,7 @@ var Header = /*#__PURE__*/(0, _react.memo)(function Header(_ref) {
|
|
|
21
21
|
var monthLongTitle = _ref.monthLongTitle,
|
|
22
22
|
year = _ref.year,
|
|
23
23
|
_ref$previousMonthLab = _ref.previousMonthLabel,
|
|
24
|
-
previousMonthLabel = _ref$previousMonthLab === void 0 ?
|
|
24
|
+
previousMonthLabel = _ref$previousMonthLab === void 0 ? 'Previous month' : _ref$previousMonthLab,
|
|
25
25
|
previousHeading = _ref.previousHeading,
|
|
26
26
|
_ref$nextMonthLabel = _ref.nextMonthLabel,
|
|
27
27
|
nextMonthLabel = _ref$nextMonthLabel === void 0 ? 'Next month' : _ref$nextMonthLabel,
|
|
@@ -32,15 +32,32 @@ var Header = /*#__PURE__*/(0, _react.memo)(function Header(_ref) {
|
|
|
32
32
|
tabIndex = _ref.tabIndex,
|
|
33
33
|
testId = _ref.testId;
|
|
34
34
|
var announceId = (0, _useUniqueId.default)('month-year-announce');
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
|
|
36
|
+
// All of this is because `aria-atomic` is not fully supported for different
|
|
37
|
+
// assistive technologies. We want the value of the current month and year to
|
|
38
|
+
// be announced, but *only* if that value has been interacted with since
|
|
39
|
+
// being mounted. This allows us to conditionally apply the `aria-live`
|
|
40
|
+
// attribute. Without this, the `aria-live` property is set on mount and
|
|
41
|
+
// overrides the default input's readout in downstream consumers (e.g.
|
|
42
|
+
// datetime picker).
|
|
43
|
+
var _useState = (0, _react.useState)(false),
|
|
44
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
45
|
+
hasInteractedWithMonth = _useState2[0],
|
|
46
|
+
setHasInteractedWithMonth = _useState2[1];
|
|
47
|
+
var handlePrevMonthInteraction = function handlePrevMonthInteraction(e) {
|
|
48
|
+
if (!hasInteractedWithMonth) {
|
|
49
|
+
setHasInteractedWithMonth(true);
|
|
50
|
+
}
|
|
51
|
+
handleClickPrev(e);
|
|
52
|
+
};
|
|
53
|
+
var handleNextMonthInteraction = function handleNextMonthInteraction(e) {
|
|
54
|
+
if (!hasInteractedWithMonth) {
|
|
55
|
+
setHasInteractedWithMonth(true);
|
|
56
|
+
}
|
|
57
|
+
handleClickNext(e);
|
|
58
|
+
};
|
|
41
59
|
return (0, _react2.jsx)(_primitives.Box, {
|
|
42
|
-
paddingInline: "space.100"
|
|
43
|
-
"aria-hidden": (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.calendar-keyboard-accessibility_967h1') ? undefined : 'true'
|
|
60
|
+
paddingInline: "space.100"
|
|
44
61
|
}, (0, _react2.jsx)(_primitives.Inline, {
|
|
45
62
|
space: "space.0",
|
|
46
63
|
alignBlock: "center",
|
|
@@ -48,29 +65,32 @@ var Header = /*#__PURE__*/(0, _react.memo)(function Header(_ref) {
|
|
|
48
65
|
}, (0, _react2.jsx)(_standardButton.default, {
|
|
49
66
|
appearance: "subtle",
|
|
50
67
|
spacing: "none",
|
|
51
|
-
tabIndex:
|
|
52
|
-
onClick:
|
|
68
|
+
tabIndex: tabIndex,
|
|
69
|
+
onClick: handlePrevMonthInteraction,
|
|
53
70
|
testId: testId && "".concat(testId, "--previous-month"),
|
|
54
71
|
iconBefore: (0, _react2.jsx)(_chevronLeftLarge.default, {
|
|
55
|
-
label:
|
|
72
|
+
label: "".concat(previousMonthLabel, ", ").concat(previousHeading),
|
|
56
73
|
size: "medium",
|
|
57
74
|
primaryColor: "var(--ds-icon, ".concat(_colors.N700, ")"),
|
|
58
75
|
testId: testId && "".concat(testId, "--previous-month-icon")
|
|
59
76
|
})
|
|
60
|
-
}), (0,
|
|
61
|
-
|
|
62
|
-
(0, _react2.jsx)(_primitives.Box, {
|
|
63
|
-
"aria-live": "polite",
|
|
77
|
+
}), (0, _react2.jsx)(_primitives.Box, {
|
|
78
|
+
"aria-live": hasInteractedWithMonth ? 'polite' : undefined,
|
|
64
79
|
id: announceId,
|
|
65
80
|
testId: testId && "".concat(testId, "--current-month-year--container")
|
|
66
|
-
},
|
|
81
|
+
}, (0, _react2.jsx)(_heading.default, {
|
|
82
|
+
level: "h400",
|
|
83
|
+
as: "h2",
|
|
84
|
+
id: headerId,
|
|
85
|
+
testId: testId && "".concat(testId, "--current-month-year")
|
|
86
|
+
}, "".concat(monthLongTitle, " ").concat(year))), (0, _react2.jsx)(_standardButton.default, {
|
|
67
87
|
appearance: "subtle",
|
|
68
88
|
spacing: "none",
|
|
69
|
-
tabIndex:
|
|
70
|
-
onClick:
|
|
89
|
+
tabIndex: tabIndex,
|
|
90
|
+
onClick: handleNextMonthInteraction,
|
|
71
91
|
testId: testId && "".concat(testId, "--next-month"),
|
|
72
92
|
iconBefore: (0, _react2.jsx)(_chevronRightLarge.default, {
|
|
73
|
-
label:
|
|
93
|
+
label: "".concat(nextMonthLabel, ", ").concat(nextHeading),
|
|
74
94
|
size: "medium",
|
|
75
95
|
primaryColor: "var(--ds-icon, ".concat(_colors.N700, ")"),
|
|
76
96
|
testId: testId && "".concat(testId, "--next-month-icon")
|
|
@@ -8,7 +8,6 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _react2 = require("@emotion/react");
|
|
10
10
|
var _text = _interopRequireDefault(require("@atlaskit/ds-explorations/text"));
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
11
|
var _primitives = require("@atlaskit/primitives");
|
|
13
12
|
var _weekDayGrid = _interopRequireDefault(require("./week-day-grid"));
|
|
14
13
|
/** @jsx jsx */
|
|
@@ -30,7 +29,7 @@ var WeekHeader = /*#__PURE__*/(0, _react.memo)(function WeekHeader(_ref) {
|
|
|
30
29
|
testId: testId && "".concat(testId, "--column-headers")
|
|
31
30
|
}, daysShort.map(function (shortDay) {
|
|
32
31
|
return (0, _react2.jsx)(_primitives.Box, {
|
|
33
|
-
"aria-hidden":
|
|
32
|
+
"aria-hidden": "true",
|
|
34
33
|
padding: "space.100",
|
|
35
34
|
xcss: columnHeaderStyles,
|
|
36
35
|
key: shortDay,
|
|
@@ -12,8 +12,8 @@ var _dateFns = require("date-fns");
|
|
|
12
12
|
var _constants = require("../constants");
|
|
13
13
|
var _dateToString = _interopRequireDefault(require("../utils/date-to-string"));
|
|
14
14
|
var _getBaseCalendar = _interopRequireDefault(require("../utils/get-base-calendar"));
|
|
15
|
-
function ownKeys(
|
|
16
|
-
function _objectSpread(
|
|
15
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } // eslint-disable-next-line no-restricted-imports
|
|
17
17
|
function useGetCalendarWithSixthWeek(calendar, _ref) {
|
|
18
18
|
var month = _ref.month,
|
|
19
19
|
year = _ref.year,
|
|
@@ -11,8 +11,8 @@ var _react = require("react");
|
|
|
11
11
|
var _constants = require("../constants");
|
|
12
12
|
var _dateToString = _interopRequireDefault(require("../utils/date-to-string"));
|
|
13
13
|
var _getDaysInMonth = _interopRequireDefault(require("../utils/get-days-in-month"));
|
|
14
|
-
function ownKeys(
|
|
15
|
-
function _objectSpread(
|
|
14
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
16
|
var getNextMonth = function getNextMonth(monthValue, yearValue) {
|
|
17
17
|
var month = monthValue;
|
|
18
18
|
var year = yearValue;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.dateCellStyles = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
7
|
var _colors = require("@atlaskit/theme/colors");
|
|
11
8
|
var textColor = {
|
|
12
9
|
light: "var(--ds-text, ".concat(_colors.N900, ")"),
|
|
@@ -33,11 +30,9 @@ var borderColorFocused = {
|
|
|
33
30
|
light: "var(--ds-border-focused, ".concat(_colors.B200, ")"),
|
|
34
31
|
dark: "var(--ds-border-focused, ".concat(_colors.B100, ")")
|
|
35
32
|
};
|
|
36
|
-
var focusBorderSelector = (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.calendar-keyboard-accessibility_967h1') ? '&:focus-visible' : '&[data-focused]';
|
|
37
33
|
var dateCellStyles = function dateCellStyles() {
|
|
38
|
-
var _ref;
|
|
39
34
|
var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'light';
|
|
40
|
-
return
|
|
35
|
+
return {
|
|
41
36
|
all: 'unset',
|
|
42
37
|
display: 'block',
|
|
43
38
|
padding: "var(--ds-space-050, 4px)".concat(" 9px"),
|
|
@@ -78,25 +73,32 @@ var dateCellStyles = function dateCellStyles() {
|
|
|
78
73
|
'&[data-disabled]': {
|
|
79
74
|
color: "var(--ds-text-disabled, ".concat(_colors.N40, ")"),
|
|
80
75
|
cursor: 'not-allowed'
|
|
76
|
+
},
|
|
77
|
+
'&:focus-visible': {
|
|
78
|
+
border: "2px solid ".concat(borderColorFocused[mode])
|
|
79
|
+
},
|
|
80
|
+
'&:hover': {
|
|
81
|
+
backgroundColor: hoverBackground[mode],
|
|
82
|
+
color: textColor[mode]
|
|
83
|
+
},
|
|
84
|
+
'&:active': {
|
|
85
|
+
backgroundColor: "var(--ds-background-neutral-subtle-pressed, ".concat(_colors.B50, ")"),
|
|
86
|
+
color: textColor[mode]
|
|
87
|
+
},
|
|
88
|
+
'&[data-selected]:hover': {
|
|
89
|
+
backgroundColor: "var(--ds-background-selected-hovered, ".concat(_colors.B50, ")"),
|
|
90
|
+
color: "var(--ds-text-selected, ".concat(_colors.N600, ")")
|
|
91
|
+
},
|
|
92
|
+
'&[data-prev-selected]:hover': {
|
|
93
|
+
color: textColorMedium
|
|
94
|
+
},
|
|
95
|
+
'&[data-sibling]:hover': {
|
|
96
|
+
color: "var(--ds-text-subtlest, ".concat(_colors.N200, ")")
|
|
97
|
+
},
|
|
98
|
+
'&[data-disabled]:hover': {
|
|
99
|
+
backgroundColor: 'transparent',
|
|
100
|
+
color: "var(--ds-text-disabled, ".concat(_colors.N40, ")")
|
|
81
101
|
}
|
|
82
|
-
}
|
|
83
|
-
border: "2px solid ".concat(borderColorFocused[mode])
|
|
84
|
-
}), (0, _defineProperty2.default)(_ref, '&:hover', {
|
|
85
|
-
backgroundColor: hoverBackground[mode],
|
|
86
|
-
color: textColor[mode]
|
|
87
|
-
}), (0, _defineProperty2.default)(_ref, '&:active', {
|
|
88
|
-
backgroundColor: "var(--ds-background-neutral-subtle-pressed, ".concat(_colors.B50, ")"),
|
|
89
|
-
color: textColor[mode]
|
|
90
|
-
}), (0, _defineProperty2.default)(_ref, '&[data-selected]:hover', {
|
|
91
|
-
backgroundColor: "var(--ds-background-selected-hovered, ".concat(_colors.B50, ")"),
|
|
92
|
-
color: "var(--ds-text-selected, ".concat(_colors.N600, ")")
|
|
93
|
-
}), (0, _defineProperty2.default)(_ref, '&[data-prev-selected]:hover', {
|
|
94
|
-
color: textColorMedium
|
|
95
|
-
}), (0, _defineProperty2.default)(_ref, '&[data-sibling]:hover', {
|
|
96
|
-
color: "var(--ds-text-subtlest, ".concat(_colors.N200, ")")
|
|
97
|
-
}), (0, _defineProperty2.default)(_ref, '&[data-disabled]:hover', {
|
|
98
|
-
backgroundColor: 'transparent',
|
|
99
|
-
color: "var(--ds-text-disabled, ".concat(_colors.N40, ")")
|
|
100
|
-
}), _ref;
|
|
102
|
+
};
|
|
101
103
|
};
|
|
102
104
|
exports.dateCellStyles = dateCellStyles;
|
package/dist/es2019/calendar.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
/** @jsx jsx */
|
|
3
|
-
import { forwardRef, memo,
|
|
3
|
+
import { forwardRef, memo, useState } 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 { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { Box, Stack, xcss } from '@atlaskit/primitives';
|
|
9
8
|
import GlobalTheme from '@atlaskit/theme/components';
|
|
10
|
-
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
11
9
|
import Header from './internal/components/header';
|
|
12
10
|
import WeekDaysComponent from './internal/components/week-days';
|
|
13
11
|
import WeekHeaderComponent from './internal/components/week-header';
|
|
@@ -27,7 +25,7 @@ const boxStyles = xcss({
|
|
|
27
25
|
const analyticsAttributes = {
|
|
28
26
|
componentName: 'calendar',
|
|
29
27
|
packageName: "@atlaskit/calendar",
|
|
30
|
-
packageVersion: "13.
|
|
28
|
+
packageVersion: "13.3.0"
|
|
31
29
|
};
|
|
32
30
|
const CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar({
|
|
33
31
|
day,
|
|
@@ -149,8 +147,6 @@ const CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar({
|
|
|
149
147
|
daysLong,
|
|
150
148
|
weekStartDay
|
|
151
149
|
});
|
|
152
|
-
const announceId = useUniqueId('announce');
|
|
153
|
-
const announcerDate = useMemo(() => new Date(yearValue, monthValue - 1, dayValue).toString(), [dayValue, monthValue, yearValue]);
|
|
154
150
|
const getNextHeading = () => {
|
|
155
151
|
// Next month is (currentMonth - 1) + 1, or just currentMonth in this
|
|
156
152
|
// instance.
|
|
@@ -173,19 +169,12 @@ const CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar({
|
|
|
173
169
|
style: style,
|
|
174
170
|
onBlur: handleContainerBlur,
|
|
175
171
|
onFocus: handleContainerFocus,
|
|
176
|
-
onKeyDown: getBooleanFF('platform.design-system-team.calendar-keyboard-accessibility_967h1') ? undefined : handleContainerKeyDown,
|
|
177
172
|
"data-testid": testId && `${testId}--container`,
|
|
178
173
|
ref: ref
|
|
179
|
-
},
|
|
180
|
-
id: announceId,
|
|
181
|
-
"aria-live": "assertive",
|
|
182
|
-
"aria-relevant": "text"
|
|
183
|
-
}, announcerDate)), jsx(Box, {
|
|
174
|
+
}, jsx(Box, {
|
|
184
175
|
xcss: boxStyles,
|
|
185
176
|
padding: "space.200",
|
|
186
|
-
"aria-describedby": getBooleanFF('platform.design-system-team.calendar-keyboard-accessibility_967h1') ? undefined : announceId,
|
|
187
177
|
"aria-label": "calendar",
|
|
188
|
-
tabIndex: getBooleanFF('platform.design-system-team.calendar-keyboard-accessibility_967h1') ? undefined : tabIndex,
|
|
189
178
|
testId: testId && `${testId}--calendar`
|
|
190
179
|
}, jsx(Stack, {
|
|
191
180
|
space: "space.150"
|
|
@@ -203,13 +192,13 @@ const CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar({
|
|
|
203
192
|
handleClickPrev: handleClickPrev,
|
|
204
193
|
headerId: headerId,
|
|
205
194
|
mode: mode,
|
|
206
|
-
tabIndex:
|
|
195
|
+
tabIndex: tabIndex,
|
|
207
196
|
testId: testId
|
|
208
197
|
}), jsx(Box, {
|
|
209
198
|
role: "grid",
|
|
210
|
-
tabIndex:
|
|
211
|
-
onKeyDown:
|
|
212
|
-
"aria-labelledby":
|
|
199
|
+
tabIndex: tabIndex,
|
|
200
|
+
onKeyDown: handleContainerKeyDown,
|
|
201
|
+
"aria-labelledby": headerId,
|
|
213
202
|
testId: testId && `${testId}--calendar-dates`
|
|
214
203
|
}, jsx(WeekHeaderComponent, {
|
|
215
204
|
daysShort: daysShort,
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { forwardRef, memo, useCallback, useEffect, useMemo, useRef } from 'react';
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import noop from '@atlaskit/ds-lib/noop';
|
|
5
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { Grid } from '@atlaskit/primitives';
|
|
7
6
|
import { dateCellStyles as getDateCellStyles } from '../styles/date';
|
|
8
7
|
const Date = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Date({
|
|
@@ -39,7 +38,7 @@ const Date = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Date({
|
|
|
39
38
|
}, [day, month, year, isDisabled]);
|
|
40
39
|
const focusRef = useRef(null);
|
|
41
40
|
useEffect(() => {
|
|
42
|
-
if (
|
|
41
|
+
if (isFocused && shouldSetFocus && focusRef.current) {
|
|
43
42
|
focusRef.current.focus();
|
|
44
43
|
}
|
|
45
44
|
}, [isFocused, shouldSetFocus]);
|
|
@@ -59,7 +58,7 @@ const Date = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Date({
|
|
|
59
58
|
}
|
|
60
59
|
}, [onClick]);
|
|
61
60
|
const dateCellStyles = useMemo(() => css(getDateCellStyles(mode)), [mode]);
|
|
62
|
-
return
|
|
61
|
+
return jsx(Grid, {
|
|
63
62
|
role: "gridcell",
|
|
64
63
|
alignItems: "center"
|
|
65
64
|
}, jsx("button", {
|
|
@@ -80,23 +79,7 @@ const Date = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Date({
|
|
|
80
79
|
"data-sibling": isSibling || undefined,
|
|
81
80
|
"data-today": isToday || undefined,
|
|
82
81
|
"data-testid": testId && (isSelected ? `${testId}--selected-day` : `${testId}--day`)
|
|
83
|
-
}, day))
|
|
84
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
85
|
-
css: dateCellStyles,
|
|
86
|
-
"aria-selected": isSelected ? 'true' : 'false',
|
|
87
|
-
tabIndex: isSelected ? 0 : -1,
|
|
88
|
-
type: "button",
|
|
89
|
-
role: "gridcell",
|
|
90
|
-
onClick: handleClick,
|
|
91
|
-
ref: ref,
|
|
92
|
-
"data-disabled": isDisabled || undefined,
|
|
93
|
-
"data-focused": isFocused || undefined,
|
|
94
|
-
"data-prev-selected": isPreviouslySelected || undefined,
|
|
95
|
-
"data-selected": isSelected || undefined,
|
|
96
|
-
"data-sibling": isSibling || undefined,
|
|
97
|
-
"data-today": isToday || undefined,
|
|
98
|
-
"data-testid": testId && (isSelected ? `${testId}--selected-day` : `${testId}--day`)
|
|
99
|
-
}, day);
|
|
82
|
+
}, day));
|
|
100
83
|
}));
|
|
101
84
|
Date.displayName = 'Date';
|
|
102
85
|
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { memo } from 'react';
|
|
2
|
+
import { memo, useState } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import Button from '@atlaskit/button/standard-button';
|
|
5
5
|
import Heading from '@atlaskit/heading';
|
|
6
6
|
import ArrowleftIcon from '@atlaskit/icon/glyph/chevron-left-large';
|
|
7
7
|
import ArrowrightIcon from '@atlaskit/icon/glyph/chevron-right-large';
|
|
8
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { Box, Inline } from '@atlaskit/primitives';
|
|
10
9
|
import { N700 } from '@atlaskit/theme/colors';
|
|
11
10
|
import useUniqueId from '../../internal/hooks/use-unique-id';
|
|
12
11
|
const Header = /*#__PURE__*/memo(function Header({
|
|
13
12
|
monthLongTitle,
|
|
14
13
|
year,
|
|
15
|
-
previousMonthLabel =
|
|
14
|
+
previousMonthLabel = 'Previous month',
|
|
16
15
|
previousHeading,
|
|
17
16
|
nextMonthLabel = 'Next month',
|
|
18
17
|
nextHeading,
|
|
@@ -23,15 +22,29 @@ const Header = /*#__PURE__*/memo(function Header({
|
|
|
23
22
|
testId
|
|
24
23
|
}) {
|
|
25
24
|
const announceId = useUniqueId('month-year-announce');
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
|
|
26
|
+
// All of this is because `aria-atomic` is not fully supported for different
|
|
27
|
+
// assistive technologies. We want the value of the current month and year to
|
|
28
|
+
// be announced, but *only* if that value has been interacted with since
|
|
29
|
+
// being mounted. This allows us to conditionally apply the `aria-live`
|
|
30
|
+
// attribute. Without this, the `aria-live` property is set on mount and
|
|
31
|
+
// overrides the default input's readout in downstream consumers (e.g.
|
|
32
|
+
// datetime picker).
|
|
33
|
+
const [hasInteractedWithMonth, setHasInteractedWithMonth] = useState(false);
|
|
34
|
+
const handlePrevMonthInteraction = e => {
|
|
35
|
+
if (!hasInteractedWithMonth) {
|
|
36
|
+
setHasInteractedWithMonth(true);
|
|
37
|
+
}
|
|
38
|
+
handleClickPrev(e);
|
|
39
|
+
};
|
|
40
|
+
const handleNextMonthInteraction = e => {
|
|
41
|
+
if (!hasInteractedWithMonth) {
|
|
42
|
+
setHasInteractedWithMonth(true);
|
|
43
|
+
}
|
|
44
|
+
handleClickNext(e);
|
|
45
|
+
};
|
|
32
46
|
return jsx(Box, {
|
|
33
|
-
paddingInline: "space.100"
|
|
34
|
-
"aria-hidden": getBooleanFF('platform.design-system-team.calendar-keyboard-accessibility_967h1') ? undefined : 'true'
|
|
47
|
+
paddingInline: "space.100"
|
|
35
48
|
}, jsx(Inline, {
|
|
36
49
|
space: "space.0",
|
|
37
50
|
alignBlock: "center",
|
|
@@ -39,29 +52,32 @@ const Header = /*#__PURE__*/memo(function Header({
|
|
|
39
52
|
}, jsx(Button, {
|
|
40
53
|
appearance: "subtle",
|
|
41
54
|
spacing: "none",
|
|
42
|
-
tabIndex:
|
|
43
|
-
onClick:
|
|
55
|
+
tabIndex: tabIndex,
|
|
56
|
+
onClick: handlePrevMonthInteraction,
|
|
44
57
|
testId: testId && `${testId}--previous-month`,
|
|
45
58
|
iconBefore: jsx(ArrowleftIcon, {
|
|
46
|
-
label:
|
|
59
|
+
label: `${previousMonthLabel}, ${previousHeading}`,
|
|
47
60
|
size: "medium",
|
|
48
61
|
primaryColor: `var(--ds-icon, ${N700})`,
|
|
49
62
|
testId: testId && `${testId}--previous-month-icon`
|
|
50
63
|
})
|
|
51
|
-
}),
|
|
52
|
-
|
|
53
|
-
jsx(Box, {
|
|
54
|
-
"aria-live": "polite",
|
|
64
|
+
}), jsx(Box, {
|
|
65
|
+
"aria-live": hasInteractedWithMonth ? 'polite' : undefined,
|
|
55
66
|
id: announceId,
|
|
56
67
|
testId: testId && `${testId}--current-month-year--container`
|
|
57
|
-
},
|
|
68
|
+
}, jsx(Heading, {
|
|
69
|
+
level: "h400",
|
|
70
|
+
as: "h2",
|
|
71
|
+
id: headerId,
|
|
72
|
+
testId: testId && `${testId}--current-month-year`
|
|
73
|
+
}, `${monthLongTitle} ${year}`)), jsx(Button, {
|
|
58
74
|
appearance: "subtle",
|
|
59
75
|
spacing: "none",
|
|
60
|
-
tabIndex:
|
|
61
|
-
onClick:
|
|
76
|
+
tabIndex: tabIndex,
|
|
77
|
+
onClick: handleNextMonthInteraction,
|
|
62
78
|
testId: testId && `${testId}--next-month`,
|
|
63
79
|
iconBefore: jsx(ArrowrightIcon, {
|
|
64
|
-
label:
|
|
80
|
+
label: `${nextMonthLabel}, ${nextHeading}`,
|
|
65
81
|
size: "medium",
|
|
66
82
|
primaryColor: `var(--ds-icon, ${N700})`,
|
|
67
83
|
testId: testId && `${testId}--next-month-icon`
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import Text from '@atlaskit/ds-explorations/text';
|
|
5
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
7
6
|
import WeekDayGrid from './week-day-grid';
|
|
8
7
|
const columnHeaderStyles = xcss({
|
|
@@ -22,7 +21,7 @@ const WeekHeader = /*#__PURE__*/memo(function WeekHeader({
|
|
|
22
21
|
return jsx(WeekDayGrid, {
|
|
23
22
|
testId: testId && `${testId}--column-headers`
|
|
24
23
|
}, daysShort.map(shortDay => jsx(Box, {
|
|
25
|
-
"aria-hidden":
|
|
24
|
+
"aria-hidden": "true",
|
|
26
25
|
padding: "space.100",
|
|
27
26
|
xcss: columnHeaderStyles,
|
|
28
27
|
key: shortDay,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
2
1
|
import { B100, B200, B400, B50, DN600, N0, N200, N30, N40, N500, N600, N700, N800, N900 } from '@atlaskit/theme/colors';
|
|
3
2
|
const textColor = {
|
|
4
3
|
light: `var(--ds-text, ${N900})`,
|
|
@@ -25,7 +24,6 @@ const borderColorFocused = {
|
|
|
25
24
|
light: `var(--ds-border-focused, ${B200})`,
|
|
26
25
|
dark: `var(--ds-border-focused, ${B100})`
|
|
27
26
|
};
|
|
28
|
-
const focusBorderSelector = getBooleanFF('platform.design-system-team.calendar-keyboard-accessibility_967h1') ? '&:focus-visible' : '&[data-focused]';
|
|
29
27
|
export const dateCellStyles = (mode = 'light') => ({
|
|
30
28
|
all: 'unset',
|
|
31
29
|
display: 'block',
|
|
@@ -68,7 +66,7 @@ export const dateCellStyles = (mode = 'light') => ({
|
|
|
68
66
|
color: `var(--ds-text-disabled, ${N40})`,
|
|
69
67
|
cursor: 'not-allowed'
|
|
70
68
|
},
|
|
71
|
-
|
|
69
|
+
'&:focus-visible': {
|
|
72
70
|
border: `2px solid ${borderColorFocused[mode]}`
|
|
73
71
|
},
|
|
74
72
|
'&:hover': {
|
package/dist/esm/calendar.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
-
function ownKeys(
|
|
5
|
-
function _objectSpread(
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
6
|
/** @jsx jsx */
|
|
7
|
-
import { forwardRef, memo,
|
|
7
|
+
import { forwardRef, memo, useState } 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 { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
12
11
|
import { Box, Stack, xcss } from '@atlaskit/primitives';
|
|
13
12
|
import GlobalTheme from '@atlaskit/theme/components';
|
|
14
|
-
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
15
13
|
import Header from './internal/components/header';
|
|
16
14
|
import WeekDaysComponent from './internal/components/week-days';
|
|
17
15
|
import WeekHeaderComponent from './internal/components/week-header';
|
|
@@ -31,7 +29,7 @@ var boxStyles = xcss({
|
|
|
31
29
|
var analyticsAttributes = {
|
|
32
30
|
componentName: 'calendar',
|
|
33
31
|
packageName: "@atlaskit/calendar",
|
|
34
|
-
packageVersion: "13.
|
|
32
|
+
packageVersion: "13.3.0"
|
|
35
33
|
};
|
|
36
34
|
var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
|
|
37
35
|
var day = _ref.day,
|
|
@@ -172,10 +170,6 @@ var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
|
|
|
172
170
|
daysLong: daysLong,
|
|
173
171
|
weekStartDay: weekStartDay
|
|
174
172
|
});
|
|
175
|
-
var announceId = useUniqueId('announce');
|
|
176
|
-
var announcerDate = useMemo(function () {
|
|
177
|
-
return new Date(yearValue, monthValue - 1, dayValue).toString();
|
|
178
|
-
}, [dayValue, monthValue, yearValue]);
|
|
179
173
|
var getNextHeading = function getNextHeading() {
|
|
180
174
|
// Next month is (currentMonth - 1) + 1, or just currentMonth in this
|
|
181
175
|
// instance.
|
|
@@ -198,19 +192,12 @@ var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
|
|
|
198
192
|
style: style,
|
|
199
193
|
onBlur: handleContainerBlur,
|
|
200
194
|
onFocus: handleContainerFocus,
|
|
201
|
-
onKeyDown: getBooleanFF('platform.design-system-team.calendar-keyboard-accessibility_967h1') ? undefined : handleContainerKeyDown,
|
|
202
195
|
"data-testid": testId && "".concat(testId, "--container"),
|
|
203
196
|
ref: ref
|
|
204
|
-
},
|
|
205
|
-
id: announceId,
|
|
206
|
-
"aria-live": "assertive",
|
|
207
|
-
"aria-relevant": "text"
|
|
208
|
-
}, announcerDate)), jsx(Box, {
|
|
197
|
+
}, jsx(Box, {
|
|
209
198
|
xcss: boxStyles,
|
|
210
199
|
padding: "space.200",
|
|
211
|
-
"aria-describedby": getBooleanFF('platform.design-system-team.calendar-keyboard-accessibility_967h1') ? undefined : announceId,
|
|
212
200
|
"aria-label": "calendar",
|
|
213
|
-
tabIndex: getBooleanFF('platform.design-system-team.calendar-keyboard-accessibility_967h1') ? undefined : tabIndex,
|
|
214
201
|
testId: testId && "".concat(testId, "--calendar")
|
|
215
202
|
}, jsx(Stack, {
|
|
216
203
|
space: "space.150"
|
|
@@ -228,13 +215,13 @@ var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
|
|
|
228
215
|
handleClickPrev: handleClickPrev,
|
|
229
216
|
headerId: headerId,
|
|
230
217
|
mode: mode,
|
|
231
|
-
tabIndex:
|
|
218
|
+
tabIndex: tabIndex,
|
|
232
219
|
testId: testId
|
|
233
220
|
}), jsx(Box, {
|
|
234
221
|
role: "grid",
|
|
235
|
-
tabIndex:
|
|
236
|
-
onKeyDown:
|
|
237
|
-
"aria-labelledby":
|
|
222
|
+
tabIndex: tabIndex,
|
|
223
|
+
onKeyDown: handleContainerKeyDown,
|
|
224
|
+
"aria-labelledby": headerId,
|
|
238
225
|
testId: testId && "".concat(testId, "--calendar-dates")
|
|
239
226
|
}, jsx(WeekHeaderComponent, {
|
|
240
227
|
daysShort: daysShort,
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { forwardRef, memo, useCallback, useEffect, useMemo, useRef } from 'react';
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import noop from '@atlaskit/ds-lib/noop';
|
|
5
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { Grid } from '@atlaskit/primitives';
|
|
7
6
|
import { dateCellStyles as getDateCellStyles } from '../styles/date';
|
|
8
7
|
var Date = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Date(_ref, ref) {
|
|
@@ -45,7 +44,7 @@ var Date = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Date(_ref, ref) {
|
|
|
45
44
|
}, [day, month, year, isDisabled]);
|
|
46
45
|
var focusRef = useRef(null);
|
|
47
46
|
useEffect(function () {
|
|
48
|
-
if (
|
|
47
|
+
if (isFocused && shouldSetFocus && focusRef.current) {
|
|
49
48
|
focusRef.current.focus();
|
|
50
49
|
}
|
|
51
50
|
}, [isFocused, shouldSetFocus]);
|
|
@@ -66,7 +65,7 @@ var Date = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Date(_ref, ref) {
|
|
|
66
65
|
var dateCellStyles = useMemo(function () {
|
|
67
66
|
return css(getDateCellStyles(mode));
|
|
68
67
|
}, [mode]);
|
|
69
|
-
return
|
|
68
|
+
return jsx(Grid, {
|
|
70
69
|
role: "gridcell",
|
|
71
70
|
alignItems: "center"
|
|
72
71
|
}, jsx("button", {
|
|
@@ -87,23 +86,7 @@ var Date = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Date(_ref, ref) {
|
|
|
87
86
|
"data-sibling": isSibling || undefined,
|
|
88
87
|
"data-today": isToday || undefined,
|
|
89
88
|
"data-testid": testId && (isSelected ? "".concat(testId, "--selected-day") : "".concat(testId, "--day"))
|
|
90
|
-
}, day))
|
|
91
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
92
|
-
css: dateCellStyles,
|
|
93
|
-
"aria-selected": isSelected ? 'true' : 'false',
|
|
94
|
-
tabIndex: isSelected ? 0 : -1,
|
|
95
|
-
type: "button",
|
|
96
|
-
role: "gridcell",
|
|
97
|
-
onClick: handleClick,
|
|
98
|
-
ref: ref,
|
|
99
|
-
"data-disabled": isDisabled || undefined,
|
|
100
|
-
"data-focused": isFocused || undefined,
|
|
101
|
-
"data-prev-selected": isPreviouslySelected || undefined,
|
|
102
|
-
"data-selected": isSelected || undefined,
|
|
103
|
-
"data-sibling": isSibling || undefined,
|
|
104
|
-
"data-today": isToday || undefined,
|
|
105
|
-
"data-testid": testId && (isSelected ? "".concat(testId, "--selected-day") : "".concat(testId, "--day"))
|
|
106
|
-
}, day);
|
|
89
|
+
}, day));
|
|
107
90
|
}));
|
|
108
91
|
Date.displayName = 'Date';
|
|
109
92
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
1
2
|
/** @jsx jsx */
|
|
2
|
-
import { memo } from 'react';
|
|
3
|
+
import { memo, useState } from 'react';
|
|
3
4
|
import { jsx } from '@emotion/react';
|
|
4
5
|
import Button from '@atlaskit/button/standard-button';
|
|
5
6
|
import Heading from '@atlaskit/heading';
|
|
6
7
|
import ArrowleftIcon from '@atlaskit/icon/glyph/chevron-left-large';
|
|
7
8
|
import ArrowrightIcon from '@atlaskit/icon/glyph/chevron-right-large';
|
|
8
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
9
9
|
import { Box, Inline } from '@atlaskit/primitives';
|
|
10
10
|
import { N700 } from '@atlaskit/theme/colors';
|
|
11
11
|
import useUniqueId from '../../internal/hooks/use-unique-id';
|
|
@@ -13,7 +13,7 @@ var Header = /*#__PURE__*/memo(function Header(_ref) {
|
|
|
13
13
|
var monthLongTitle = _ref.monthLongTitle,
|
|
14
14
|
year = _ref.year,
|
|
15
15
|
_ref$previousMonthLab = _ref.previousMonthLabel,
|
|
16
|
-
previousMonthLabel = _ref$previousMonthLab === void 0 ?
|
|
16
|
+
previousMonthLabel = _ref$previousMonthLab === void 0 ? 'Previous month' : _ref$previousMonthLab,
|
|
17
17
|
previousHeading = _ref.previousHeading,
|
|
18
18
|
_ref$nextMonthLabel = _ref.nextMonthLabel,
|
|
19
19
|
nextMonthLabel = _ref$nextMonthLabel === void 0 ? 'Next month' : _ref$nextMonthLabel,
|
|
@@ -24,15 +24,32 @@ var Header = /*#__PURE__*/memo(function Header(_ref) {
|
|
|
24
24
|
tabIndex = _ref.tabIndex,
|
|
25
25
|
testId = _ref.testId;
|
|
26
26
|
var announceId = useUniqueId('month-year-announce');
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
|
|
28
|
+
// All of this is because `aria-atomic` is not fully supported for different
|
|
29
|
+
// assistive technologies. We want the value of the current month and year to
|
|
30
|
+
// be announced, but *only* if that value has been interacted with since
|
|
31
|
+
// being mounted. This allows us to conditionally apply the `aria-live`
|
|
32
|
+
// attribute. Without this, the `aria-live` property is set on mount and
|
|
33
|
+
// overrides the default input's readout in downstream consumers (e.g.
|
|
34
|
+
// datetime picker).
|
|
35
|
+
var _useState = useState(false),
|
|
36
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
37
|
+
hasInteractedWithMonth = _useState2[0],
|
|
38
|
+
setHasInteractedWithMonth = _useState2[1];
|
|
39
|
+
var handlePrevMonthInteraction = function handlePrevMonthInteraction(e) {
|
|
40
|
+
if (!hasInteractedWithMonth) {
|
|
41
|
+
setHasInteractedWithMonth(true);
|
|
42
|
+
}
|
|
43
|
+
handleClickPrev(e);
|
|
44
|
+
};
|
|
45
|
+
var handleNextMonthInteraction = function handleNextMonthInteraction(e) {
|
|
46
|
+
if (!hasInteractedWithMonth) {
|
|
47
|
+
setHasInteractedWithMonth(true);
|
|
48
|
+
}
|
|
49
|
+
handleClickNext(e);
|
|
50
|
+
};
|
|
33
51
|
return jsx(Box, {
|
|
34
|
-
paddingInline: "space.100"
|
|
35
|
-
"aria-hidden": getBooleanFF('platform.design-system-team.calendar-keyboard-accessibility_967h1') ? undefined : 'true'
|
|
52
|
+
paddingInline: "space.100"
|
|
36
53
|
}, jsx(Inline, {
|
|
37
54
|
space: "space.0",
|
|
38
55
|
alignBlock: "center",
|
|
@@ -40,29 +57,32 @@ var Header = /*#__PURE__*/memo(function Header(_ref) {
|
|
|
40
57
|
}, jsx(Button, {
|
|
41
58
|
appearance: "subtle",
|
|
42
59
|
spacing: "none",
|
|
43
|
-
tabIndex:
|
|
44
|
-
onClick:
|
|
60
|
+
tabIndex: tabIndex,
|
|
61
|
+
onClick: handlePrevMonthInteraction,
|
|
45
62
|
testId: testId && "".concat(testId, "--previous-month"),
|
|
46
63
|
iconBefore: jsx(ArrowleftIcon, {
|
|
47
|
-
label:
|
|
64
|
+
label: "".concat(previousMonthLabel, ", ").concat(previousHeading),
|
|
48
65
|
size: "medium",
|
|
49
66
|
primaryColor: "var(--ds-icon, ".concat(N700, ")"),
|
|
50
67
|
testId: testId && "".concat(testId, "--previous-month-icon")
|
|
51
68
|
})
|
|
52
|
-
}),
|
|
53
|
-
|
|
54
|
-
jsx(Box, {
|
|
55
|
-
"aria-live": "polite",
|
|
69
|
+
}), jsx(Box, {
|
|
70
|
+
"aria-live": hasInteractedWithMonth ? 'polite' : undefined,
|
|
56
71
|
id: announceId,
|
|
57
72
|
testId: testId && "".concat(testId, "--current-month-year--container")
|
|
58
|
-
},
|
|
73
|
+
}, jsx(Heading, {
|
|
74
|
+
level: "h400",
|
|
75
|
+
as: "h2",
|
|
76
|
+
id: headerId,
|
|
77
|
+
testId: testId && "".concat(testId, "--current-month-year")
|
|
78
|
+
}, "".concat(monthLongTitle, " ").concat(year))), jsx(Button, {
|
|
59
79
|
appearance: "subtle",
|
|
60
80
|
spacing: "none",
|
|
61
|
-
tabIndex:
|
|
62
|
-
onClick:
|
|
81
|
+
tabIndex: tabIndex,
|
|
82
|
+
onClick: handleNextMonthInteraction,
|
|
63
83
|
testId: testId && "".concat(testId, "--next-month"),
|
|
64
84
|
iconBefore: jsx(ArrowrightIcon, {
|
|
65
|
-
label:
|
|
85
|
+
label: "".concat(nextMonthLabel, ", ").concat(nextHeading),
|
|
66
86
|
size: "medium",
|
|
67
87
|
primaryColor: "var(--ds-icon, ".concat(N700, ")"),
|
|
68
88
|
testId: testId && "".concat(testId, "--next-month-icon")
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import Text from '@atlaskit/ds-explorations/text';
|
|
5
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
7
6
|
import WeekDayGrid from './week-day-grid';
|
|
8
7
|
var columnHeaderStyles = xcss({
|
|
@@ -22,7 +21,7 @@ var WeekHeader = /*#__PURE__*/memo(function WeekHeader(_ref) {
|
|
|
22
21
|
testId: testId && "".concat(testId, "--column-headers")
|
|
23
22
|
}, daysShort.map(function (shortDay) {
|
|
24
23
|
return jsx(Box, {
|
|
25
|
-
"aria-hidden":
|
|
24
|
+
"aria-hidden": "true",
|
|
26
25
|
padding: "space.100",
|
|
27
26
|
xcss: columnHeaderStyles,
|
|
28
27
|
key: shortDay,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
function ownKeys(
|
|
4
|
-
function _objectSpread(
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
import { useMemo } from 'react';
|
|
6
6
|
|
|
7
7
|
// eslint-disable-next-line no-restricted-imports
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
function ownKeys(
|
|
4
|
-
function _objectSpread(
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
import { useCallback, useEffect, useRef } from 'react';
|
|
6
6
|
import { daysPerWeek, monthsPerYear } from '../constants';
|
|
7
7
|
import dateToString from '../utils/date-to-string';
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
3
1
|
import { B100, B200, B400, B50, DN600, N0, N200, N30, N40, N500, N600, N700, N800, N900 } from '@atlaskit/theme/colors';
|
|
4
2
|
var textColor = {
|
|
5
3
|
light: "var(--ds-text, ".concat(N900, ")"),
|
|
@@ -26,11 +24,9 @@ var borderColorFocused = {
|
|
|
26
24
|
light: "var(--ds-border-focused, ".concat(B200, ")"),
|
|
27
25
|
dark: "var(--ds-border-focused, ".concat(B100, ")")
|
|
28
26
|
};
|
|
29
|
-
var focusBorderSelector = getBooleanFF('platform.design-system-team.calendar-keyboard-accessibility_967h1') ? '&:focus-visible' : '&[data-focused]';
|
|
30
27
|
export var dateCellStyles = function dateCellStyles() {
|
|
31
|
-
var _ref;
|
|
32
28
|
var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'light';
|
|
33
|
-
return
|
|
29
|
+
return {
|
|
34
30
|
all: 'unset',
|
|
35
31
|
display: 'block',
|
|
36
32
|
padding: "var(--ds-space-050, 4px)".concat(" 9px"),
|
|
@@ -71,24 +67,31 @@ export var dateCellStyles = function dateCellStyles() {
|
|
|
71
67
|
'&[data-disabled]': {
|
|
72
68
|
color: "var(--ds-text-disabled, ".concat(N40, ")"),
|
|
73
69
|
cursor: 'not-allowed'
|
|
70
|
+
},
|
|
71
|
+
'&:focus-visible': {
|
|
72
|
+
border: "2px solid ".concat(borderColorFocused[mode])
|
|
73
|
+
},
|
|
74
|
+
'&:hover': {
|
|
75
|
+
backgroundColor: hoverBackground[mode],
|
|
76
|
+
color: textColor[mode]
|
|
77
|
+
},
|
|
78
|
+
'&:active': {
|
|
79
|
+
backgroundColor: "var(--ds-background-neutral-subtle-pressed, ".concat(B50, ")"),
|
|
80
|
+
color: textColor[mode]
|
|
81
|
+
},
|
|
82
|
+
'&[data-selected]:hover': {
|
|
83
|
+
backgroundColor: "var(--ds-background-selected-hovered, ".concat(B50, ")"),
|
|
84
|
+
color: "var(--ds-text-selected, ".concat(N600, ")")
|
|
85
|
+
},
|
|
86
|
+
'&[data-prev-selected]:hover': {
|
|
87
|
+
color: textColorMedium
|
|
88
|
+
},
|
|
89
|
+
'&[data-sibling]:hover': {
|
|
90
|
+
color: "var(--ds-text-subtlest, ".concat(N200, ")")
|
|
91
|
+
},
|
|
92
|
+
'&[data-disabled]:hover': {
|
|
93
|
+
backgroundColor: 'transparent',
|
|
94
|
+
color: "var(--ds-text-disabled, ".concat(N40, ")")
|
|
74
95
|
}
|
|
75
|
-
}
|
|
76
|
-
border: "2px solid ".concat(borderColorFocused[mode])
|
|
77
|
-
}), _defineProperty(_ref, '&:hover', {
|
|
78
|
-
backgroundColor: hoverBackground[mode],
|
|
79
|
-
color: textColor[mode]
|
|
80
|
-
}), _defineProperty(_ref, '&:active', {
|
|
81
|
-
backgroundColor: "var(--ds-background-neutral-subtle-pressed, ".concat(B50, ")"),
|
|
82
|
-
color: textColor[mode]
|
|
83
|
-
}), _defineProperty(_ref, '&[data-selected]:hover', {
|
|
84
|
-
backgroundColor: "var(--ds-background-selected-hovered, ".concat(B50, ")"),
|
|
85
|
-
color: "var(--ds-text-selected, ".concat(N600, ")")
|
|
86
|
-
}), _defineProperty(_ref, '&[data-prev-selected]:hover', {
|
|
87
|
-
color: textColorMedium
|
|
88
|
-
}), _defineProperty(_ref, '&[data-sibling]:hover', {
|
|
89
|
-
color: "var(--ds-text-subtlest, ".concat(N200, ")")
|
|
90
|
-
}), _defineProperty(_ref, '&[data-disabled]:hover', {
|
|
91
|
-
backgroundColor: 'transparent',
|
|
92
|
-
color: "var(--ds-text-disabled, ".concat(N40, ")")
|
|
93
|
-
}), _ref;
|
|
96
|
+
};
|
|
94
97
|
};
|
|
@@ -8,8 +8,8 @@ interface HeaderProps {
|
|
|
8
8
|
previousHeading: string;
|
|
9
9
|
nextMonthLabel?: string;
|
|
10
10
|
nextHeading: string;
|
|
11
|
-
handleClickNext
|
|
12
|
-
handleClickPrev
|
|
11
|
+
handleClickNext: (e: React.MouseEvent<HTMLElement>) => void;
|
|
12
|
+
handleClickPrev: (e: React.MouseEvent<HTMLElement>) => void;
|
|
13
13
|
mode?: ThemeModes;
|
|
14
14
|
headerId: string;
|
|
15
15
|
tabIndex?: TabIndex;
|
|
@@ -8,8 +8,8 @@ interface HeaderProps {
|
|
|
8
8
|
previousHeading: string;
|
|
9
9
|
nextMonthLabel?: string;
|
|
10
10
|
nextHeading: string;
|
|
11
|
-
handleClickNext
|
|
12
|
-
handleClickPrev
|
|
11
|
+
handleClickNext: (e: React.MouseEvent<HTMLElement>) => void;
|
|
12
|
+
handleClickPrev: (e: React.MouseEvent<HTMLElement>) => void;
|
|
13
13
|
mode?: ThemeModes;
|
|
14
14
|
headerId: string;
|
|
15
15
|
tabIndex?: TabIndex;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/calendar",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.3.0",
|
|
4
4
|
"description": "An interactive calendar for date selection experiences.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -12,14 +12,6 @@
|
|
|
12
12
|
"module": "dist/esm/index.js",
|
|
13
13
|
"module:es2019": "dist/es2019/index.js",
|
|
14
14
|
"types": "dist/types/index.d.ts",
|
|
15
|
-
"typesVersions": {
|
|
16
|
-
">=4.5 <4.9": {
|
|
17
|
-
"*": [
|
|
18
|
-
"dist/types-ts4.5/*",
|
|
19
|
-
"dist/types-ts4.5/index.d.ts"
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
15
|
"sideEffects": false,
|
|
24
16
|
"atlaskit:src": "src/index.tsx",
|
|
25
17
|
"atlassian": {
|
|
@@ -38,11 +30,9 @@
|
|
|
38
30
|
"@atlaskit/heading": "^1.3.0",
|
|
39
31
|
"@atlaskit/icon": "^21.12.0",
|
|
40
32
|
"@atlaskit/locale": "^2.5.0",
|
|
41
|
-
"@atlaskit/platform-feature-flags": "*",
|
|
42
33
|
"@atlaskit/primitives": "^1.2.0",
|
|
43
34
|
"@atlaskit/theme": "^12.5.0",
|
|
44
|
-
"@atlaskit/tokens": "^1.
|
|
45
|
-
"@atlaskit/visually-hidden": "^1.2.0",
|
|
35
|
+
"@atlaskit/tokens": "^1.18.0",
|
|
46
36
|
"@babel/runtime": "^7.0.0",
|
|
47
37
|
"@emotion/react": "^11.7.1",
|
|
48
38
|
"date-fns": "^2.17.0",
|
|
@@ -53,11 +43,11 @@
|
|
|
53
43
|
},
|
|
54
44
|
"devDependencies": {
|
|
55
45
|
"@af/accessibility-testing": "*",
|
|
46
|
+
"@af/visual-regression": "*",
|
|
56
47
|
"@atlaskit/ssr": "*",
|
|
57
48
|
"@atlaskit/visual-regression": "*",
|
|
58
49
|
"@atlaskit/webdriver-runner": "*",
|
|
59
50
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
60
|
-
"@atlassian/feature-flags-test-utils": "*",
|
|
61
51
|
"@testing-library/dom": "^8.17.1",
|
|
62
52
|
"@testing-library/react": "^12.1.5",
|
|
63
53
|
"jest-in-case": "^1.0.2",
|
|
@@ -91,9 +81,12 @@
|
|
|
91
81
|
]
|
|
92
82
|
}
|
|
93
83
|
},
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
84
|
+
"typesVersions": {
|
|
85
|
+
">=4.5 <4.9": {
|
|
86
|
+
"*": [
|
|
87
|
+
"dist/types-ts4.5/*",
|
|
88
|
+
"dist/types-ts4.5/index.d.ts"
|
|
89
|
+
]
|
|
97
90
|
}
|
|
98
91
|
},
|
|
99
92
|
"af:exports": {
|