@atlaskit/calendar 13.1.5 → 13.1.7
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 +13 -0
- package/dist/cjs/calendar.js +55 -51
- package/dist/cjs/internal/components/header.js +3 -5
- package/dist/cjs/internal/components/week-day-grid.js +4 -5
- package/dist/cjs/internal/components/week-days.js +1 -2
- package/dist/cjs/internal/components/week-header.js +13 -14
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/calendar.js +55 -51
- package/dist/es2019/internal/components/header.js +1 -3
- package/dist/es2019/internal/components/week-day-grid.js +4 -4
- package/dist/es2019/internal/components/week-days.js +1 -2
- package/dist/es2019/internal/components/week-header.js +12 -13
- package/dist/es2019/version.json +1 -1
- package/dist/esm/calendar.js +55 -51
- package/dist/esm/internal/components/header.js +1 -3
- package/dist/esm/internal/components/week-day-grid.js +4 -4
- package/dist/esm/internal/components/week-days.js +1 -2
- package/dist/esm/internal/components/week-header.js +12 -13
- package/dist/esm/version.json +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/calendar
|
|
2
2
|
|
|
3
|
+
## 13.1.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`b8b41649492`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b8b41649492) - Update how certain background colors are referenced by name. Internal changes only.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
10
|
+
## 13.1.6
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`779727e307a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/779727e307a) - Internal change only. Replace all instances of Box with stable @atlaskit/primitives version.
|
|
15
|
+
|
|
3
16
|
## 13.1.5
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/cjs/calendar.js
CHANGED
|
@@ -11,8 +11,9 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
11
11
|
var _react = require("react");
|
|
12
12
|
var _react2 = require("@emotion/react");
|
|
13
13
|
var _usePlatformLeafEventHandler = require("@atlaskit/analytics-next/usePlatformLeafEventHandler");
|
|
14
|
-
var _box = _interopRequireDefault(require("@atlaskit/ds-explorations/box"));
|
|
15
14
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
15
|
+
var _primitives = require("@atlaskit/primitives");
|
|
16
|
+
var _box = _interopRequireDefault(require("@atlaskit/primitives/box"));
|
|
16
17
|
var _stack = _interopRequireDefault(require("@atlaskit/primitives/stack"));
|
|
17
18
|
var _components = _interopRequireDefault(require("@atlaskit/theme/components"));
|
|
18
19
|
var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
|
|
@@ -30,10 +31,14 @@ var _useLocale2 = _interopRequireDefault(require("./internal/hooks/use-locale"))
|
|
|
30
31
|
var _useUniqueId = _interopRequireDefault(require("./internal/hooks/use-unique-id"));
|
|
31
32
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
32
33
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } /** @jsx jsx */
|
|
34
|
+
var boxStyles = (0, _primitives.xcss)({
|
|
35
|
+
display: 'inlineBlock',
|
|
36
|
+
userSelect: 'none'
|
|
37
|
+
});
|
|
33
38
|
var analyticsAttributes = {
|
|
34
39
|
componentName: 'calendar',
|
|
35
40
|
packageName: "@atlaskit/calendar",
|
|
36
|
-
packageVersion: "13.1.
|
|
41
|
+
packageVersion: "13.1.7"
|
|
37
42
|
};
|
|
38
43
|
var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_ref, ref) {
|
|
39
44
|
var day = _ref.day,
|
|
@@ -171,55 +176,54 @@ var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_re
|
|
|
171
176
|
}),
|
|
172
177
|
monthsLong = _useLocale.monthsLong,
|
|
173
178
|
daysShort = _useLocale.daysShort;
|
|
174
|
-
return (
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
})))));
|
|
179
|
+
return (
|
|
180
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/no-static-element-interactions
|
|
181
|
+
(0, _react2.jsx)("div", {
|
|
182
|
+
className: className,
|
|
183
|
+
style: style,
|
|
184
|
+
onBlur: handleContainerBlur,
|
|
185
|
+
onFocus: handleContainerFocus,
|
|
186
|
+
onKeyDown: handleContainerKeyDown,
|
|
187
|
+
"data-testid": testId && "".concat(testId, "--container"),
|
|
188
|
+
ref: ref
|
|
189
|
+
}, (0, _react2.jsx)(_visuallyHidden.default, null, (0, _react2.jsx)("span", {
|
|
190
|
+
id: announceId,
|
|
191
|
+
"aria-live": "assertive",
|
|
192
|
+
"aria-relevant": "text"
|
|
193
|
+
}, announcerDate)), (0, _react2.jsx)(_box.default, {
|
|
194
|
+
xcss: boxStyles,
|
|
195
|
+
padding: "space.200",
|
|
196
|
+
"aria-describedby": announceId,
|
|
197
|
+
"aria-label": "calendar",
|
|
198
|
+
tabIndex: tabIndex,
|
|
199
|
+
testId: testId && "".concat(testId, "--calendar")
|
|
200
|
+
}, (0, _react2.jsx)(_stack.default, {
|
|
201
|
+
space: "space.150"
|
|
202
|
+
}, (0, _react2.jsx)(_header.default
|
|
203
|
+
// The month number needs to be translated to index in the month
|
|
204
|
+
// name array e.g. 1 (January) -> 0
|
|
205
|
+
, {
|
|
206
|
+
monthLongTitle: monthsLong[monthValue - 1],
|
|
207
|
+
year: yearValue,
|
|
208
|
+
nextMonthLabel: nextMonthLabel,
|
|
209
|
+
previousMonthLabel: previousMonthLabel,
|
|
210
|
+
handleClickNext: handleClickNext,
|
|
211
|
+
handleClickPrev: handleClickPrev,
|
|
212
|
+
mode: mode,
|
|
213
|
+
testId: testId
|
|
214
|
+
}), (0, _react2.jsx)(_box.default, {
|
|
215
|
+
role: "grid"
|
|
216
|
+
}, (0, _react2.jsx)(_weekHeader.default, {
|
|
217
|
+
daysShort: daysShort,
|
|
218
|
+
mode: mode,
|
|
219
|
+
testId: testId
|
|
220
|
+
}), (0, _react2.jsx)(_weekDays.default, {
|
|
221
|
+
weeks: weeks,
|
|
222
|
+
handleClickDay: handleClickDay,
|
|
223
|
+
mode: mode,
|
|
224
|
+
testId: testId
|
|
225
|
+
})))))
|
|
226
|
+
);
|
|
223
227
|
});
|
|
224
228
|
|
|
225
229
|
/**
|
|
@@ -8,11 +8,10 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _react2 = require("@emotion/react");
|
|
10
10
|
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
11
|
-
var _box = _interopRequireDefault(require("@atlaskit/ds-explorations/box"));
|
|
12
11
|
var _heading = _interopRequireDefault(require("@atlaskit/heading"));
|
|
13
12
|
var _chevronLeftLarge = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-left-large"));
|
|
14
13
|
var _chevronRightLarge = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-right-large"));
|
|
15
|
-
var
|
|
14
|
+
var _primitives = require("@atlaskit/primitives");
|
|
16
15
|
var _colors = require("@atlaskit/theme/colors");
|
|
17
16
|
/** @jsx jsx */
|
|
18
17
|
|
|
@@ -26,11 +25,10 @@ var Header = /*#__PURE__*/(0, _react.memo)(function Header(_ref) {
|
|
|
26
25
|
handleClickPrev = _ref.handleClickPrev,
|
|
27
26
|
handleClickNext = _ref.handleClickNext,
|
|
28
27
|
testId = _ref.testId;
|
|
29
|
-
return (0, _react2.jsx)(
|
|
30
|
-
display: "block",
|
|
28
|
+
return (0, _react2.jsx)(_primitives.Box, {
|
|
31
29
|
paddingInline: "space.100",
|
|
32
30
|
"aria-hidden": "true"
|
|
33
|
-
}, (0, _react2.jsx)(
|
|
31
|
+
}, (0, _react2.jsx)(_primitives.Inline, {
|
|
34
32
|
space: "space.0",
|
|
35
33
|
alignBlock: "center",
|
|
36
34
|
spread: "space-between"
|
|
@@ -1,15 +1,14 @@
|
|
|
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.default = void 0;
|
|
8
7
|
var _react = require("@emotion/react");
|
|
9
|
-
var
|
|
8
|
+
var _primitives = require("@atlaskit/primitives");
|
|
10
9
|
/** @jsx jsx */
|
|
11
10
|
|
|
12
|
-
var gridStyles = (0,
|
|
11
|
+
var gridStyles = (0, _primitives.xcss)({
|
|
13
12
|
display: 'grid',
|
|
14
13
|
gridTemplateColumns: 'repeat(7, minmax(max-content, 1fr))'
|
|
15
14
|
});
|
|
@@ -22,9 +21,9 @@ var gridStyles = (0, _react.css)({
|
|
|
22
21
|
var WeekDayGrid = function WeekDayGrid(_ref) {
|
|
23
22
|
var testId = _ref.testId,
|
|
24
23
|
children = _ref.children;
|
|
25
|
-
return (0, _react.jsx)(
|
|
24
|
+
return (0, _react.jsx)(_primitives.Box, {
|
|
26
25
|
testId: testId,
|
|
27
|
-
|
|
26
|
+
xcss: gridStyles,
|
|
28
27
|
role: "row"
|
|
29
28
|
}, children);
|
|
30
29
|
};
|
|
@@ -7,7 +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/
|
|
10
|
+
var _box = _interopRequireDefault(require("@atlaskit/primitives/box"));
|
|
11
11
|
var _date = _interopRequireDefault(require("./date"));
|
|
12
12
|
var _weekDayGrid = _interopRequireDefault(require("./week-day-grid"));
|
|
13
13
|
/** @jsx jsx */
|
|
@@ -18,7 +18,6 @@ var WeekDays = /*#__PURE__*/(0, _react.memo)(function WeekDays(_ref) {
|
|
|
18
18
|
mode = _ref.mode,
|
|
19
19
|
testId = _ref.testId;
|
|
20
20
|
return (0, _react2.jsx)(_box.default, {
|
|
21
|
-
display: "block",
|
|
22
21
|
role: "rowgroup",
|
|
23
22
|
testId: testId && "".concat(testId, "--month")
|
|
24
23
|
}, weeks.map(function (week, i) {
|
|
@@ -7,31 +7,30 @@ 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"));
|
|
11
10
|
var _text = _interopRequireDefault(require("@atlaskit/ds-explorations/text"));
|
|
12
|
-
var
|
|
11
|
+
var _primitives = require("@atlaskit/primitives");
|
|
13
12
|
var _weekDayGrid = _interopRequireDefault(require("./week-day-grid"));
|
|
14
13
|
/** @jsx jsx */
|
|
15
14
|
|
|
15
|
+
var columnHeaderStyles = (0, _primitives.xcss)({
|
|
16
|
+
minWidth: 'size.400',
|
|
17
|
+
// Account for languages with short week day names
|
|
18
|
+
whiteSpace: 'nowrap',
|
|
19
|
+
// Account for languages with long week day names
|
|
20
|
+
textAlign: 'center',
|
|
21
|
+
lineHeight: '16px',
|
|
22
|
+
color: 'color.text.subtle' // Apply correct fallback to shortDay text
|
|
23
|
+
});
|
|
24
|
+
|
|
16
25
|
var WeekHeader = /*#__PURE__*/(0, _react.memo)(function WeekHeader(_ref) {
|
|
17
26
|
var daysShort = _ref.daysShort,
|
|
18
27
|
testId = _ref.testId;
|
|
19
28
|
return (0, _react2.jsx)(_weekDayGrid.default, {
|
|
20
29
|
testId: testId && "".concat(testId, "--column-headers")
|
|
21
30
|
}, daysShort.map(function (shortDay) {
|
|
22
|
-
return (0, _react2.jsx)(
|
|
31
|
+
return (0, _react2.jsx)(_primitives.Box, {
|
|
23
32
|
padding: "space.100",
|
|
24
|
-
|
|
25
|
-
UNSAFE_style: {
|
|
26
|
-
minWidth: 40,
|
|
27
|
-
// Account for languages with short week day names
|
|
28
|
-
whiteSpace: 'nowrap',
|
|
29
|
-
// Account for languages with long week day names
|
|
30
|
-
textAlign: 'center',
|
|
31
|
-
lineHeight: '16px',
|
|
32
|
-
color: "var(--ds-text-subtle, ".concat(_colors.N200, ")") // Apply correct fallback to shortDay text
|
|
33
|
-
},
|
|
34
|
-
|
|
33
|
+
xcss: columnHeaderStyles,
|
|
35
34
|
key: shortDay,
|
|
36
35
|
role: "columnheader"
|
|
37
36
|
}, (0, _react2.jsx)(_text.default, {
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/calendar.js
CHANGED
|
@@ -3,8 +3,9 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
import { forwardRef, memo, useMemo } from 'react';
|
|
4
4
|
import { jsx } from '@emotion/react';
|
|
5
5
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
|
|
6
|
-
import Box from '@atlaskit/ds-explorations/box';
|
|
7
6
|
import noop from '@atlaskit/ds-lib/noop';
|
|
7
|
+
import { xcss } from '@atlaskit/primitives';
|
|
8
|
+
import Box from '@atlaskit/primitives/box';
|
|
8
9
|
import Stack from '@atlaskit/primitives/stack';
|
|
9
10
|
import GlobalTheme from '@atlaskit/theme/components';
|
|
10
11
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
@@ -20,10 +21,14 @@ import useHandleDateChange from './internal/hooks/use-handle-date-change';
|
|
|
20
21
|
import useHandleDateSelect from './internal/hooks/use-handle-date-select';
|
|
21
22
|
import useLocale from './internal/hooks/use-locale';
|
|
22
23
|
import useUniqueId from './internal/hooks/use-unique-id';
|
|
24
|
+
const boxStyles = xcss({
|
|
25
|
+
display: 'inlineBlock',
|
|
26
|
+
userSelect: 'none'
|
|
27
|
+
});
|
|
23
28
|
const analyticsAttributes = {
|
|
24
29
|
componentName: 'calendar',
|
|
25
30
|
packageName: "@atlaskit/calendar",
|
|
26
|
-
packageVersion: "13.1.
|
|
31
|
+
packageVersion: "13.1.7"
|
|
27
32
|
};
|
|
28
33
|
const CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar({
|
|
29
34
|
day,
|
|
@@ -143,55 +148,54 @@ const CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar({
|
|
|
143
148
|
locale,
|
|
144
149
|
weekStartDay
|
|
145
150
|
});
|
|
146
|
-
return
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
})))));
|
|
151
|
+
return (
|
|
152
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/no-static-element-interactions
|
|
153
|
+
jsx("div", {
|
|
154
|
+
className: className,
|
|
155
|
+
style: style,
|
|
156
|
+
onBlur: handleContainerBlur,
|
|
157
|
+
onFocus: handleContainerFocus,
|
|
158
|
+
onKeyDown: handleContainerKeyDown,
|
|
159
|
+
"data-testid": testId && `${testId}--container`,
|
|
160
|
+
ref: ref
|
|
161
|
+
}, jsx(VisuallyHidden, null, jsx("span", {
|
|
162
|
+
id: announceId,
|
|
163
|
+
"aria-live": "assertive",
|
|
164
|
+
"aria-relevant": "text"
|
|
165
|
+
}, announcerDate)), jsx(Box, {
|
|
166
|
+
xcss: boxStyles,
|
|
167
|
+
padding: "space.200",
|
|
168
|
+
"aria-describedby": announceId,
|
|
169
|
+
"aria-label": "calendar",
|
|
170
|
+
tabIndex: tabIndex,
|
|
171
|
+
testId: testId && `${testId}--calendar`
|
|
172
|
+
}, jsx(Stack, {
|
|
173
|
+
space: "space.150"
|
|
174
|
+
}, jsx(Header
|
|
175
|
+
// The month number needs to be translated to index in the month
|
|
176
|
+
// name array e.g. 1 (January) -> 0
|
|
177
|
+
, {
|
|
178
|
+
monthLongTitle: monthsLong[monthValue - 1],
|
|
179
|
+
year: yearValue,
|
|
180
|
+
nextMonthLabel: nextMonthLabel,
|
|
181
|
+
previousMonthLabel: previousMonthLabel,
|
|
182
|
+
handleClickNext: handleClickNext,
|
|
183
|
+
handleClickPrev: handleClickPrev,
|
|
184
|
+
mode: mode,
|
|
185
|
+
testId: testId
|
|
186
|
+
}), jsx(Box, {
|
|
187
|
+
role: "grid"
|
|
188
|
+
}, jsx(WeekHeaderComponent, {
|
|
189
|
+
daysShort: daysShort,
|
|
190
|
+
mode: mode,
|
|
191
|
+
testId: testId
|
|
192
|
+
}), jsx(WeekDaysComponent, {
|
|
193
|
+
weeks: weeks,
|
|
194
|
+
handleClickDay: handleClickDay,
|
|
195
|
+
mode: mode,
|
|
196
|
+
testId: testId
|
|
197
|
+
})))))
|
|
198
|
+
);
|
|
195
199
|
});
|
|
196
200
|
|
|
197
201
|
/**
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import Button from '@atlaskit/button/standard-button';
|
|
5
|
-
import Box from '@atlaskit/ds-explorations/box';
|
|
6
5
|
import Heading from '@atlaskit/heading';
|
|
7
6
|
import ArrowleftIcon from '@atlaskit/icon/glyph/chevron-left-large';
|
|
8
7
|
import ArrowrightIcon from '@atlaskit/icon/glyph/chevron-right-large';
|
|
9
|
-
import Inline from '@atlaskit/primitives
|
|
8
|
+
import { Box, Inline } from '@atlaskit/primitives';
|
|
10
9
|
import { N700 } from '@atlaskit/theme/colors';
|
|
11
10
|
const Header = /*#__PURE__*/memo(function Header({
|
|
12
11
|
monthLongTitle,
|
|
@@ -18,7 +17,6 @@ const Header = /*#__PURE__*/memo(function Header({
|
|
|
18
17
|
testId
|
|
19
18
|
}) {
|
|
20
19
|
return jsx(Box, {
|
|
21
|
-
display: "block",
|
|
22
20
|
paddingInline: "space.100",
|
|
23
21
|
"aria-hidden": "true"
|
|
24
22
|
}, jsx(Inline, {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import Box from '@atlaskit/
|
|
5
|
-
const gridStyles =
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
5
|
+
const gridStyles = xcss({
|
|
6
6
|
display: 'grid',
|
|
7
7
|
gridTemplateColumns: 'repeat(7, minmax(max-content, 1fr))'
|
|
8
8
|
});
|
|
@@ -17,7 +17,7 @@ const WeekDayGrid = ({
|
|
|
17
17
|
children
|
|
18
18
|
}) => jsx(Box, {
|
|
19
19
|
testId: testId,
|
|
20
|
-
|
|
20
|
+
xcss: gridStyles,
|
|
21
21
|
role: "row"
|
|
22
22
|
}, children);
|
|
23
23
|
export default WeekDayGrid;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import Box from '@atlaskit/
|
|
4
|
+
import Box from '@atlaskit/primitives/box';
|
|
5
5
|
import DateComponent from './date';
|
|
6
6
|
import WeekdayGrid from './week-day-grid';
|
|
7
7
|
const WeekDays = /*#__PURE__*/memo(function WeekDays({
|
|
@@ -11,7 +11,6 @@ const WeekDays = /*#__PURE__*/memo(function WeekDays({
|
|
|
11
11
|
testId
|
|
12
12
|
}) {
|
|
13
13
|
return jsx(Box, {
|
|
14
|
-
display: "block",
|
|
15
14
|
role: "rowgroup",
|
|
16
15
|
testId: testId && `${testId}--month`
|
|
17
16
|
}, weeks.map((week, i) => jsx(WeekdayGrid, {
|
|
@@ -1,10 +1,19 @@
|
|
|
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';
|
|
5
4
|
import Text from '@atlaskit/ds-explorations/text';
|
|
6
|
-
import {
|
|
5
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
7
6
|
import WeekDayGrid from './week-day-grid';
|
|
7
|
+
const columnHeaderStyles = xcss({
|
|
8
|
+
minWidth: 'size.400',
|
|
9
|
+
// Account for languages with short week day names
|
|
10
|
+
whiteSpace: 'nowrap',
|
|
11
|
+
// Account for languages with long week day names
|
|
12
|
+
textAlign: 'center',
|
|
13
|
+
lineHeight: '16px',
|
|
14
|
+
color: 'color.text.subtle' // Apply correct fallback to shortDay text
|
|
15
|
+
});
|
|
16
|
+
|
|
8
17
|
const WeekHeader = /*#__PURE__*/memo(function WeekHeader({
|
|
9
18
|
daysShort,
|
|
10
19
|
testId
|
|
@@ -13,17 +22,7 @@ const WeekHeader = /*#__PURE__*/memo(function WeekHeader({
|
|
|
13
22
|
testId: testId && `${testId}--column-headers`
|
|
14
23
|
}, daysShort.map(shortDay => jsx(Box, {
|
|
15
24
|
padding: "space.100",
|
|
16
|
-
|
|
17
|
-
UNSAFE_style: {
|
|
18
|
-
minWidth: 40,
|
|
19
|
-
// Account for languages with short week day names
|
|
20
|
-
whiteSpace: 'nowrap',
|
|
21
|
-
// Account for languages with long week day names
|
|
22
|
-
textAlign: 'center',
|
|
23
|
-
lineHeight: '16px',
|
|
24
|
-
color: `var(--ds-text-subtle, ${N200})` // Apply correct fallback to shortDay text
|
|
25
|
-
},
|
|
26
|
-
|
|
25
|
+
xcss: columnHeaderStyles,
|
|
27
26
|
key: shortDay,
|
|
28
27
|
role: "columnheader"
|
|
29
28
|
}, jsx(Text, {
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/calendar.js
CHANGED
|
@@ -7,8 +7,9 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
7
7
|
import { forwardRef, memo, useMemo } from 'react';
|
|
8
8
|
import { jsx } from '@emotion/react';
|
|
9
9
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
|
|
10
|
-
import Box from '@atlaskit/ds-explorations/box';
|
|
11
10
|
import noop from '@atlaskit/ds-lib/noop';
|
|
11
|
+
import { xcss } from '@atlaskit/primitives';
|
|
12
|
+
import Box from '@atlaskit/primitives/box';
|
|
12
13
|
import Stack from '@atlaskit/primitives/stack';
|
|
13
14
|
import GlobalTheme from '@atlaskit/theme/components';
|
|
14
15
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
@@ -24,10 +25,14 @@ import useHandleDateChange from './internal/hooks/use-handle-date-change';
|
|
|
24
25
|
import useHandleDateSelect from './internal/hooks/use-handle-date-select';
|
|
25
26
|
import useLocale from './internal/hooks/use-locale';
|
|
26
27
|
import useUniqueId from './internal/hooks/use-unique-id';
|
|
28
|
+
var boxStyles = xcss({
|
|
29
|
+
display: 'inlineBlock',
|
|
30
|
+
userSelect: 'none'
|
|
31
|
+
});
|
|
27
32
|
var analyticsAttributes = {
|
|
28
33
|
componentName: 'calendar',
|
|
29
34
|
packageName: "@atlaskit/calendar",
|
|
30
|
-
packageVersion: "13.1.
|
|
35
|
+
packageVersion: "13.1.7"
|
|
31
36
|
};
|
|
32
37
|
var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
|
|
33
38
|
var day = _ref.day,
|
|
@@ -165,55 +170,54 @@ var CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
|
|
|
165
170
|
}),
|
|
166
171
|
monthsLong = _useLocale.monthsLong,
|
|
167
172
|
daysShort = _useLocale.daysShort;
|
|
168
|
-
return
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
})))));
|
|
173
|
+
return (
|
|
174
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/no-static-element-interactions
|
|
175
|
+
jsx("div", {
|
|
176
|
+
className: className,
|
|
177
|
+
style: style,
|
|
178
|
+
onBlur: handleContainerBlur,
|
|
179
|
+
onFocus: handleContainerFocus,
|
|
180
|
+
onKeyDown: handleContainerKeyDown,
|
|
181
|
+
"data-testid": testId && "".concat(testId, "--container"),
|
|
182
|
+
ref: ref
|
|
183
|
+
}, jsx(VisuallyHidden, null, jsx("span", {
|
|
184
|
+
id: announceId,
|
|
185
|
+
"aria-live": "assertive",
|
|
186
|
+
"aria-relevant": "text"
|
|
187
|
+
}, announcerDate)), jsx(Box, {
|
|
188
|
+
xcss: boxStyles,
|
|
189
|
+
padding: "space.200",
|
|
190
|
+
"aria-describedby": announceId,
|
|
191
|
+
"aria-label": "calendar",
|
|
192
|
+
tabIndex: tabIndex,
|
|
193
|
+
testId: testId && "".concat(testId, "--calendar")
|
|
194
|
+
}, jsx(Stack, {
|
|
195
|
+
space: "space.150"
|
|
196
|
+
}, jsx(Header
|
|
197
|
+
// The month number needs to be translated to index in the month
|
|
198
|
+
// name array e.g. 1 (January) -> 0
|
|
199
|
+
, {
|
|
200
|
+
monthLongTitle: monthsLong[monthValue - 1],
|
|
201
|
+
year: yearValue,
|
|
202
|
+
nextMonthLabel: nextMonthLabel,
|
|
203
|
+
previousMonthLabel: previousMonthLabel,
|
|
204
|
+
handleClickNext: handleClickNext,
|
|
205
|
+
handleClickPrev: handleClickPrev,
|
|
206
|
+
mode: mode,
|
|
207
|
+
testId: testId
|
|
208
|
+
}), jsx(Box, {
|
|
209
|
+
role: "grid"
|
|
210
|
+
}, jsx(WeekHeaderComponent, {
|
|
211
|
+
daysShort: daysShort,
|
|
212
|
+
mode: mode,
|
|
213
|
+
testId: testId
|
|
214
|
+
}), jsx(WeekDaysComponent, {
|
|
215
|
+
weeks: weeks,
|
|
216
|
+
handleClickDay: handleClickDay,
|
|
217
|
+
mode: mode,
|
|
218
|
+
testId: testId
|
|
219
|
+
})))))
|
|
220
|
+
);
|
|
217
221
|
});
|
|
218
222
|
|
|
219
223
|
/**
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import Button from '@atlaskit/button/standard-button';
|
|
5
|
-
import Box from '@atlaskit/ds-explorations/box';
|
|
6
5
|
import Heading from '@atlaskit/heading';
|
|
7
6
|
import ArrowleftIcon from '@atlaskit/icon/glyph/chevron-left-large';
|
|
8
7
|
import ArrowrightIcon from '@atlaskit/icon/glyph/chevron-right-large';
|
|
9
|
-
import Inline from '@atlaskit/primitives
|
|
8
|
+
import { Box, Inline } from '@atlaskit/primitives';
|
|
10
9
|
import { N700 } from '@atlaskit/theme/colors';
|
|
11
10
|
var Header = /*#__PURE__*/memo(function Header(_ref) {
|
|
12
11
|
var monthLongTitle = _ref.monthLongTitle,
|
|
@@ -19,7 +18,6 @@ var Header = /*#__PURE__*/memo(function Header(_ref) {
|
|
|
19
18
|
handleClickNext = _ref.handleClickNext,
|
|
20
19
|
testId = _ref.testId;
|
|
21
20
|
return jsx(Box, {
|
|
22
|
-
display: "block",
|
|
23
21
|
paddingInline: "space.100",
|
|
24
22
|
"aria-hidden": "true"
|
|
25
23
|
}, jsx(Inline, {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import Box from '@atlaskit/
|
|
5
|
-
var gridStyles =
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
5
|
+
var gridStyles = xcss({
|
|
6
6
|
display: 'grid',
|
|
7
7
|
gridTemplateColumns: 'repeat(7, minmax(max-content, 1fr))'
|
|
8
8
|
});
|
|
@@ -17,7 +17,7 @@ var WeekDayGrid = function WeekDayGrid(_ref) {
|
|
|
17
17
|
children = _ref.children;
|
|
18
18
|
return jsx(Box, {
|
|
19
19
|
testId: testId,
|
|
20
|
-
|
|
20
|
+
xcss: gridStyles,
|
|
21
21
|
role: "row"
|
|
22
22
|
}, children);
|
|
23
23
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import Box from '@atlaskit/
|
|
4
|
+
import Box from '@atlaskit/primitives/box';
|
|
5
5
|
import DateComponent from './date';
|
|
6
6
|
import WeekdayGrid from './week-day-grid';
|
|
7
7
|
var WeekDays = /*#__PURE__*/memo(function WeekDays(_ref) {
|
|
@@ -10,7 +10,6 @@ var WeekDays = /*#__PURE__*/memo(function WeekDays(_ref) {
|
|
|
10
10
|
mode = _ref.mode,
|
|
11
11
|
testId = _ref.testId;
|
|
12
12
|
return jsx(Box, {
|
|
13
|
-
display: "block",
|
|
14
13
|
role: "rowgroup",
|
|
15
14
|
testId: testId && "".concat(testId, "--month")
|
|
16
15
|
}, weeks.map(function (week, i) {
|
|
@@ -1,10 +1,19 @@
|
|
|
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';
|
|
5
4
|
import Text from '@atlaskit/ds-explorations/text';
|
|
6
|
-
import {
|
|
5
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
7
6
|
import WeekDayGrid from './week-day-grid';
|
|
7
|
+
var columnHeaderStyles = xcss({
|
|
8
|
+
minWidth: 'size.400',
|
|
9
|
+
// Account for languages with short week day names
|
|
10
|
+
whiteSpace: 'nowrap',
|
|
11
|
+
// Account for languages with long week day names
|
|
12
|
+
textAlign: 'center',
|
|
13
|
+
lineHeight: '16px',
|
|
14
|
+
color: 'color.text.subtle' // Apply correct fallback to shortDay text
|
|
15
|
+
});
|
|
16
|
+
|
|
8
17
|
var WeekHeader = /*#__PURE__*/memo(function WeekHeader(_ref) {
|
|
9
18
|
var daysShort = _ref.daysShort,
|
|
10
19
|
testId = _ref.testId;
|
|
@@ -13,17 +22,7 @@ var WeekHeader = /*#__PURE__*/memo(function WeekHeader(_ref) {
|
|
|
13
22
|
}, daysShort.map(function (shortDay) {
|
|
14
23
|
return jsx(Box, {
|
|
15
24
|
padding: "space.100",
|
|
16
|
-
|
|
17
|
-
UNSAFE_style: {
|
|
18
|
-
minWidth: 40,
|
|
19
|
-
// Account for languages with short week day names
|
|
20
|
-
whiteSpace: 'nowrap',
|
|
21
|
-
// Account for languages with long week day names
|
|
22
|
-
textAlign: 'center',
|
|
23
|
-
lineHeight: '16px',
|
|
24
|
-
color: "var(--ds-text-subtle, ".concat(N200, ")") // Apply correct fallback to shortDay text
|
|
25
|
-
},
|
|
26
|
-
|
|
25
|
+
xcss: columnHeaderStyles,
|
|
27
26
|
key: shortDay,
|
|
28
27
|
role: "columnheader"
|
|
29
28
|
}, jsx(Text, {
|
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.7",
|
|
4
4
|
"description": "An interactive calendar for date selection experiences.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -38,7 +38,7 @@
|
|
|
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": "*",
|
|
42
42
|
"@atlaskit/theme": "^12.5.0",
|
|
43
43
|
"@atlaskit/tokens": "^1.5.0",
|
|
44
44
|
"@atlaskit/visually-hidden": "^1.2.0",
|