@atlaskit/calendar 14.5.1 → 15.0.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 +15 -0
- package/dist/cjs/calendar.js +3 -8
- package/dist/cjs/internal/components/header.js +2 -2
- package/dist/es2019/calendar.js +3 -8
- package/dist/es2019/internal/components/header.js +2 -2
- package/dist/esm/calendar.js +3 -8
- package/dist/esm/internal/components/header.js +2 -2
- package/dist/types/calendar.d.ts +1 -1
- package/dist/types/entry-points/types.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types.d.ts +1 -9
- package/dist/types-ts4.5/calendar.d.ts +1 -1
- package/dist/types-ts4.5/entry-points/types.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +1 -9
- package/package.json +7 -13
- package/dist/cjs/internal/hooks/use-calendar-ref.js +0 -16
- package/dist/cjs/internal/hooks/use-unique-id.js +0 -12
- package/dist/es2019/internal/hooks/use-calendar-ref.js +0 -9
- package/dist/es2019/internal/hooks/use-unique-id.js +0 -7
- package/dist/esm/internal/hooks/use-calendar-ref.js +0 -10
- package/dist/esm/internal/hooks/use-unique-id.js +0 -7
- package/dist/types/internal/hooks/use-calendar-ref.d.ts +0 -5
- package/dist/types/internal/hooks/use-unique-id.d.ts +0 -1
- package/dist/types-ts4.5/internal/hooks/use-calendar-ref.d.ts +0 -5
- package/dist/types-ts4.5/internal/hooks/use-unique-id.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/calendar
|
|
2
2
|
|
|
3
|
+
## 15.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#136647](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/136647)
|
|
8
|
+
[`a3f810c087f5d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a3f810c087f5d) -
|
|
9
|
+
Remove `calendarRef` prop. This has been included as a legacy prop but is no longer in use within
|
|
10
|
+
Atlassian.
|
|
11
|
+
|
|
12
|
+
## 14.5.2
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 14.5.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/cjs/calendar.js
CHANGED
|
@@ -12,19 +12,18 @@ 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 _reactUid = require("@atlaskit/ds-lib/react-uid");
|
|
15
16
|
var _primitives = require("@atlaskit/primitives");
|
|
16
17
|
var _header = _interopRequireDefault(require("./internal/components/header"));
|
|
17
18
|
var _weekDays = _interopRequireDefault(require("./internal/components/week-days"));
|
|
18
19
|
var _weekHeader = _interopRequireDefault(require("./internal/components/week-header"));
|
|
19
20
|
var _constants = require("./internal/constants");
|
|
20
|
-
var _useCalendarRef = _interopRequireDefault(require("./internal/hooks/use-calendar-ref"));
|
|
21
21
|
var _useControlledDateState = _interopRequireDefault(require("./internal/hooks/use-controlled-date-state"));
|
|
22
22
|
var _useFocusing2 = _interopRequireDefault(require("./internal/hooks/use-focusing"));
|
|
23
23
|
var _useGetWeeks = _interopRequireDefault(require("./internal/hooks/use-get-weeks"));
|
|
24
24
|
var _useHandleDateChange2 = _interopRequireDefault(require("./internal/hooks/use-handle-date-change"));
|
|
25
25
|
var _useHandleDateSelect2 = _interopRequireDefault(require("./internal/hooks/use-handle-date-select"));
|
|
26
26
|
var _useLocale2 = _interopRequireDefault(require("./internal/hooks/use-locale"));
|
|
27
|
-
var _useUniqueId = _interopRequireDefault(require("./internal/hooks/use-unique-id"));
|
|
28
27
|
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; }
|
|
29
28
|
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; } /**
|
|
30
29
|
* @jsxRuntime classic
|
|
@@ -37,7 +36,7 @@ var boxStyles = (0, _primitives.xcss)({
|
|
|
37
36
|
var analyticsAttributes = {
|
|
38
37
|
componentName: 'calendar',
|
|
39
38
|
packageName: "@atlaskit/calendar",
|
|
40
|
-
packageVersion: "
|
|
39
|
+
packageVersion: "15.0.0"
|
|
41
40
|
};
|
|
42
41
|
var InnerCalendar = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_ref, ref) {
|
|
43
42
|
var day = _ref.day,
|
|
@@ -78,7 +77,6 @@ var InnerCalendar = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_ref,
|
|
|
78
77
|
_ref$weekStartDay = _ref.weekStartDay,
|
|
79
78
|
weekStartDay = _ref$weekStartDay === void 0 ? 0 : _ref$weekStartDay,
|
|
80
79
|
testId = _ref.testId,
|
|
81
|
-
calendarRef = _ref.calendarRef,
|
|
82
80
|
className = _ref.className,
|
|
83
81
|
style = _ref.style,
|
|
84
82
|
_ref$tabIndex = _ref.tabIndex,
|
|
@@ -154,9 +152,6 @@ var InnerCalendar = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_ref,
|
|
|
154
152
|
}),
|
|
155
153
|
handleContainerBlur = _useFocusing.handleContainerBlur,
|
|
156
154
|
handleContainerFocus = _useFocusing.handleContainerFocus;
|
|
157
|
-
(0, _useCalendarRef.default)(calendarRef, {
|
|
158
|
-
navigate: navigate
|
|
159
|
-
});
|
|
160
155
|
var _useLocale = (0, _useLocale2.default)({
|
|
161
156
|
locale: locale,
|
|
162
157
|
weekStartDay: weekStartDay
|
|
@@ -192,7 +187,7 @@ var InnerCalendar = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_ref,
|
|
|
192
187
|
var showPreviousYear = monthValue === 1;
|
|
193
188
|
return "".concat(monthsLong[previousMonth], " ").concat(showPreviousYear ? yearValue - 1 : yearValue);
|
|
194
189
|
};
|
|
195
|
-
var headerId = (0,
|
|
190
|
+
var headerId = (0, _reactUid.useId)();
|
|
196
191
|
return (0, _react2.jsx)("div", {
|
|
197
192
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
198
193
|
className: className
|
|
@@ -9,11 +9,11 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
11
|
var _new = require("@atlaskit/button/new");
|
|
12
|
+
var _reactUid = require("@atlaskit/ds-lib/react-uid");
|
|
12
13
|
var _heading = _interopRequireDefault(require("@atlaskit/heading"));
|
|
13
14
|
var _chevronLeftLarge = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-left-large"));
|
|
14
15
|
var _chevronRightLarge = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-right-large"));
|
|
15
16
|
var _primitives = require("@atlaskit/primitives");
|
|
16
|
-
var _useUniqueId = _interopRequireDefault(require("../../internal/hooks/use-unique-id"));
|
|
17
17
|
/**
|
|
18
18
|
* @jsxRuntime classic
|
|
19
19
|
* @jsx jsx
|
|
@@ -35,7 +35,7 @@ var Header = /*#__PURE__*/(0, _react.memo)(function Header(_ref) {
|
|
|
35
35
|
headerId = _ref.headerId,
|
|
36
36
|
tabIndex = _ref.tabIndex,
|
|
37
37
|
testId = _ref.testId;
|
|
38
|
-
var announceId = (0,
|
|
38
|
+
var announceId = (0, _reactUid.useId)();
|
|
39
39
|
|
|
40
40
|
// All of this is because `aria-atomic` is not fully supported for different
|
|
41
41
|
// assistive technologies. We want the value of the current month and year to
|
package/dist/es2019/calendar.js
CHANGED
|
@@ -9,19 +9,18 @@ import { forwardRef, memo, useState } from 'react';
|
|
|
9
9
|
import { jsx } from '@emotion/react';
|
|
10
10
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
|
|
11
11
|
import noop from '@atlaskit/ds-lib/noop';
|
|
12
|
+
import { useId } from '@atlaskit/ds-lib/react-uid';
|
|
12
13
|
import { Box, Stack, xcss } from '@atlaskit/primitives';
|
|
13
14
|
import Header from './internal/components/header';
|
|
14
15
|
import WeekDaysComponent from './internal/components/week-days';
|
|
15
16
|
import WeekHeaderComponent from './internal/components/week-header';
|
|
16
17
|
import { blankStringArray } from './internal/constants';
|
|
17
|
-
import useCalendarRef from './internal/hooks/use-calendar-ref';
|
|
18
18
|
import useControlledDateState from './internal/hooks/use-controlled-date-state';
|
|
19
19
|
import useFocusing from './internal/hooks/use-focusing';
|
|
20
20
|
import useGetWeeks from './internal/hooks/use-get-weeks';
|
|
21
21
|
import useHandleDateChange from './internal/hooks/use-handle-date-change';
|
|
22
22
|
import useHandleDateSelect from './internal/hooks/use-handle-date-select';
|
|
23
23
|
import useLocale from './internal/hooks/use-locale';
|
|
24
|
-
import useUniqueId from './internal/hooks/use-unique-id';
|
|
25
24
|
const boxStyles = xcss({
|
|
26
25
|
display: 'inline-block',
|
|
27
26
|
userSelect: 'none'
|
|
@@ -29,7 +28,7 @@ const boxStyles = xcss({
|
|
|
29
28
|
const analyticsAttributes = {
|
|
30
29
|
componentName: 'calendar',
|
|
31
30
|
packageName: "@atlaskit/calendar",
|
|
32
|
-
packageVersion: "
|
|
31
|
+
packageVersion: "15.0.0"
|
|
33
32
|
};
|
|
34
33
|
const InnerCalendar = /*#__PURE__*/forwardRef(function Calendar({
|
|
35
34
|
day,
|
|
@@ -58,7 +57,6 @@ const InnerCalendar = /*#__PURE__*/forwardRef(function Calendar({
|
|
|
58
57
|
analyticsContext,
|
|
59
58
|
weekStartDay = 0,
|
|
60
59
|
testId,
|
|
61
|
-
calendarRef,
|
|
62
60
|
className,
|
|
63
61
|
style,
|
|
64
62
|
tabIndex = 0
|
|
@@ -126,9 +124,6 @@ const InnerCalendar = /*#__PURE__*/forwardRef(function Calendar({
|
|
|
126
124
|
onFocus,
|
|
127
125
|
onBlur
|
|
128
126
|
});
|
|
129
|
-
useCalendarRef(calendarRef, {
|
|
130
|
-
navigate
|
|
131
|
-
});
|
|
132
127
|
const {
|
|
133
128
|
monthsLong,
|
|
134
129
|
daysShort,
|
|
@@ -165,7 +160,7 @@ const InnerCalendar = /*#__PURE__*/forwardRef(function Calendar({
|
|
|
165
160
|
const showPreviousYear = monthValue === 1;
|
|
166
161
|
return `${monthsLong[previousMonth]} ${showPreviousYear ? yearValue - 1 : yearValue}`;
|
|
167
162
|
};
|
|
168
|
-
const headerId =
|
|
163
|
+
const headerId = useId();
|
|
169
164
|
return jsx("div", {
|
|
170
165
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
171
166
|
className: className
|
|
@@ -7,11 +7,11 @@ import { memo, useState } from 'react';
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { jsx } from '@emotion/react';
|
|
9
9
|
import { IconButton } from '@atlaskit/button/new';
|
|
10
|
+
import { useId } from '@atlaskit/ds-lib/react-uid';
|
|
10
11
|
import Heading from '@atlaskit/heading';
|
|
11
12
|
import ArrowleftIcon from '@atlaskit/icon/glyph/chevron-left-large';
|
|
12
13
|
import ArrowrightIcon from '@atlaskit/icon/glyph/chevron-right-large';
|
|
13
14
|
import { Box, Inline } from '@atlaskit/primitives';
|
|
14
|
-
import useUniqueId from '../../internal/hooks/use-unique-id';
|
|
15
15
|
const Header = /*#__PURE__*/memo(function Header({
|
|
16
16
|
monthLongTitle,
|
|
17
17
|
year,
|
|
@@ -25,7 +25,7 @@ const Header = /*#__PURE__*/memo(function Header({
|
|
|
25
25
|
tabIndex,
|
|
26
26
|
testId
|
|
27
27
|
}) {
|
|
28
|
-
const announceId =
|
|
28
|
+
const announceId = useId();
|
|
29
29
|
|
|
30
30
|
// All of this is because `aria-atomic` is not fully supported for different
|
|
31
31
|
// assistive technologies. We want the value of the current month and year to
|
package/dist/esm/calendar.js
CHANGED
|
@@ -13,19 +13,18 @@ import { forwardRef, memo, useState } from 'react';
|
|
|
13
13
|
import { jsx } from '@emotion/react';
|
|
14
14
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
|
|
15
15
|
import noop from '@atlaskit/ds-lib/noop';
|
|
16
|
+
import { useId } from '@atlaskit/ds-lib/react-uid';
|
|
16
17
|
import { Box, Stack, xcss } from '@atlaskit/primitives';
|
|
17
18
|
import Header from './internal/components/header';
|
|
18
19
|
import WeekDaysComponent from './internal/components/week-days';
|
|
19
20
|
import WeekHeaderComponent from './internal/components/week-header';
|
|
20
21
|
import { blankStringArray } from './internal/constants';
|
|
21
|
-
import useCalendarRef from './internal/hooks/use-calendar-ref';
|
|
22
22
|
import useControlledDateState from './internal/hooks/use-controlled-date-state';
|
|
23
23
|
import useFocusing from './internal/hooks/use-focusing';
|
|
24
24
|
import useGetWeeks from './internal/hooks/use-get-weeks';
|
|
25
25
|
import useHandleDateChange from './internal/hooks/use-handle-date-change';
|
|
26
26
|
import useHandleDateSelect from './internal/hooks/use-handle-date-select';
|
|
27
27
|
import useLocale from './internal/hooks/use-locale';
|
|
28
|
-
import useUniqueId from './internal/hooks/use-unique-id';
|
|
29
28
|
var boxStyles = xcss({
|
|
30
29
|
display: 'inline-block',
|
|
31
30
|
userSelect: 'none'
|
|
@@ -33,7 +32,7 @@ var boxStyles = xcss({
|
|
|
33
32
|
var analyticsAttributes = {
|
|
34
33
|
componentName: 'calendar',
|
|
35
34
|
packageName: "@atlaskit/calendar",
|
|
36
|
-
packageVersion: "
|
|
35
|
+
packageVersion: "15.0.0"
|
|
37
36
|
};
|
|
38
37
|
var InnerCalendar = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
|
|
39
38
|
var day = _ref.day,
|
|
@@ -74,7 +73,6 @@ var InnerCalendar = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
|
|
|
74
73
|
_ref$weekStartDay = _ref.weekStartDay,
|
|
75
74
|
weekStartDay = _ref$weekStartDay === void 0 ? 0 : _ref$weekStartDay,
|
|
76
75
|
testId = _ref.testId,
|
|
77
|
-
calendarRef = _ref.calendarRef,
|
|
78
76
|
className = _ref.className,
|
|
79
77
|
style = _ref.style,
|
|
80
78
|
_ref$tabIndex = _ref.tabIndex,
|
|
@@ -150,9 +148,6 @@ var InnerCalendar = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
|
|
|
150
148
|
}),
|
|
151
149
|
handleContainerBlur = _useFocusing.handleContainerBlur,
|
|
152
150
|
handleContainerFocus = _useFocusing.handleContainerFocus;
|
|
153
|
-
useCalendarRef(calendarRef, {
|
|
154
|
-
navigate: navigate
|
|
155
|
-
});
|
|
156
151
|
var _useLocale = useLocale({
|
|
157
152
|
locale: locale,
|
|
158
153
|
weekStartDay: weekStartDay
|
|
@@ -188,7 +183,7 @@ var InnerCalendar = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
|
|
|
188
183
|
var showPreviousYear = monthValue === 1;
|
|
189
184
|
return "".concat(monthsLong[previousMonth], " ").concat(showPreviousYear ? yearValue - 1 : yearValue);
|
|
190
185
|
};
|
|
191
|
-
var headerId =
|
|
186
|
+
var headerId = useId();
|
|
192
187
|
return jsx("div", {
|
|
193
188
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
194
189
|
className: className
|
|
@@ -8,11 +8,11 @@ import { memo, useState } from 'react';
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
9
|
import { jsx } from '@emotion/react';
|
|
10
10
|
import { IconButton } from '@atlaskit/button/new';
|
|
11
|
+
import { useId } from '@atlaskit/ds-lib/react-uid';
|
|
11
12
|
import Heading from '@atlaskit/heading';
|
|
12
13
|
import ArrowleftIcon from '@atlaskit/icon/glyph/chevron-left-large';
|
|
13
14
|
import ArrowrightIcon from '@atlaskit/icon/glyph/chevron-right-large';
|
|
14
15
|
import { Box, Inline } from '@atlaskit/primitives';
|
|
15
|
-
import useUniqueId from '../../internal/hooks/use-unique-id';
|
|
16
16
|
var Header = /*#__PURE__*/memo(function Header(_ref) {
|
|
17
17
|
var monthLongTitle = _ref.monthLongTitle,
|
|
18
18
|
year = _ref.year,
|
|
@@ -27,7 +27,7 @@ var Header = /*#__PURE__*/memo(function Header(_ref) {
|
|
|
27
27
|
headerId = _ref.headerId,
|
|
28
28
|
tabIndex = _ref.tabIndex,
|
|
29
29
|
testId = _ref.testId;
|
|
30
|
-
var announceId =
|
|
30
|
+
var announceId = useId();
|
|
31
31
|
|
|
32
32
|
// All of this is because `aria-atomic` is not fully supported for different
|
|
33
33
|
// assistive technologies. We want the value of the current month and year to
|
package/dist/types/calendar.d.ts
CHANGED
|
@@ -9,5 +9,5 @@ import type { CalendarProps } from './types';
|
|
|
9
9
|
* - [Code](https://atlassian.design/components/calendar/code)
|
|
10
10
|
* - [Usage](https://atlassian.design/components/calendar/usage)
|
|
11
11
|
*/
|
|
12
|
-
declare const Calendar: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Pick<CalendarProps, "day" | "defaultDay" | "defaultMonth" | "defaultPreviouslySelected" | "defaultSelected" | "defaultYear" | "disabled" | "disabledDateFilter" | "maxDate" | "minDate" | "month" | "nextMonthLabel" | "onBlur" | "onChange" | "onFocus" | "onSelect" | "previouslySelected" | "previousMonthLabel" | "selected" | "today" | "year" | "locale" | "analyticsContext" | "weekStartDay" | "testId" | "className" | "style" | "
|
|
12
|
+
declare const Calendar: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Pick<CalendarProps, "day" | "defaultDay" | "defaultMonth" | "defaultPreviouslySelected" | "defaultSelected" | "defaultYear" | "disabled" | "disabledDateFilter" | "maxDate" | "minDate" | "month" | "nextMonthLabel" | "onBlur" | "onChange" | "onFocus" | "onSelect" | "previouslySelected" | "previousMonthLabel" | "selected" | "today" | "year" | "locale" | "analyticsContext" | "weekStartDay" | "testId" | "className" | "style" | "tabIndex" | "shouldSetFocusOnCurrentDay" | "createAnalyticsEvent"> & import("react").RefAttributes<HTMLDivElement>>>;
|
|
13
13
|
export default Calendar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { CalendarProps, ChangeEvent, SelectEvent,
|
|
1
|
+
export type { CalendarProps, ChangeEvent, SelectEvent, WeekDay } from '../types';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default } from './calendar';
|
|
2
|
-
export type { CalendarProps, ChangeEvent, SelectEvent
|
|
2
|
+
export type { CalendarProps, ChangeEvent, SelectEvent } from './types';
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CSSProperties } from 'react';
|
|
2
2
|
import { type UIAnalyticsEvent, type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
|
-
import type {
|
|
3
|
+
import type { DateObj, ISODate } from './internal/types';
|
|
4
4
|
export type WeekDay = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
5
5
|
export type TabIndex = -1 | 0;
|
|
6
6
|
export type ChangeEvent = {
|
|
@@ -139,11 +139,6 @@ export interface CalendarProps extends WithAnalyticsEventsProps {
|
|
|
139
139
|
* Style customization to apply to the calendar.
|
|
140
140
|
*/
|
|
141
141
|
style?: CSSProperties;
|
|
142
|
-
/**
|
|
143
|
-
* @internal An additional ref which exposes Calendar's internal api's. We kept this for
|
|
144
|
-
* backward compatibility. PLEASE DO NOT USE THIS.
|
|
145
|
-
*/
|
|
146
|
-
calendarRef?: React.Ref<CalendarRef>;
|
|
147
142
|
/**
|
|
148
143
|
* Indicates if the calendar can be focused by keyboard or only
|
|
149
144
|
* programmatically. Defaults to "0".
|
|
@@ -155,6 +150,3 @@ export interface CalendarProps extends WithAnalyticsEventsProps {
|
|
|
155
150
|
*/
|
|
156
151
|
shouldSetFocusOnCurrentDay?: boolean;
|
|
157
152
|
}
|
|
158
|
-
export interface CalendarRef {
|
|
159
|
-
navigate: (type: ArrowKeys) => void;
|
|
160
|
-
}
|
|
@@ -9,5 +9,5 @@ import type { CalendarProps } from './types';
|
|
|
9
9
|
* - [Code](https://atlassian.design/components/calendar/code)
|
|
10
10
|
* - [Usage](https://atlassian.design/components/calendar/usage)
|
|
11
11
|
*/
|
|
12
|
-
declare const Calendar: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Pick<CalendarProps, "day" | "defaultDay" | "defaultMonth" | "defaultPreviouslySelected" | "defaultSelected" | "defaultYear" | "disabled" | "disabledDateFilter" | "maxDate" | "minDate" | "month" | "nextMonthLabel" | "onBlur" | "onChange" | "onFocus" | "onSelect" | "previouslySelected" | "previousMonthLabel" | "selected" | "today" | "year" | "locale" | "analyticsContext" | "weekStartDay" | "testId" | "className" | "style" | "
|
|
12
|
+
declare const Calendar: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Pick<CalendarProps, "day" | "defaultDay" | "defaultMonth" | "defaultPreviouslySelected" | "defaultSelected" | "defaultYear" | "disabled" | "disabledDateFilter" | "maxDate" | "minDate" | "month" | "nextMonthLabel" | "onBlur" | "onChange" | "onFocus" | "onSelect" | "previouslySelected" | "previousMonthLabel" | "selected" | "today" | "year" | "locale" | "analyticsContext" | "weekStartDay" | "testId" | "className" | "style" | "tabIndex" | "shouldSetFocusOnCurrentDay" | "createAnalyticsEvent"> & import("react").RefAttributes<HTMLDivElement>>>;
|
|
13
13
|
export default Calendar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { CalendarProps, ChangeEvent, SelectEvent,
|
|
1
|
+
export type { CalendarProps, ChangeEvent, SelectEvent, WeekDay } from '../types';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default } from './calendar';
|
|
2
|
-
export type { CalendarProps, ChangeEvent, SelectEvent
|
|
2
|
+
export type { CalendarProps, ChangeEvent, SelectEvent } from './types';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CSSProperties } from 'react';
|
|
2
2
|
import { type UIAnalyticsEvent, type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
|
-
import type {
|
|
3
|
+
import type { DateObj, ISODate } from './internal/types';
|
|
4
4
|
export type WeekDay = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
5
5
|
export type TabIndex = -1 | 0;
|
|
6
6
|
export type ChangeEvent = {
|
|
@@ -139,11 +139,6 @@ export interface CalendarProps extends WithAnalyticsEventsProps {
|
|
|
139
139
|
* Style customization to apply to the calendar.
|
|
140
140
|
*/
|
|
141
141
|
style?: CSSProperties;
|
|
142
|
-
/**
|
|
143
|
-
* @internal An additional ref which exposes Calendar's internal api's. We kept this for
|
|
144
|
-
* backward compatibility. PLEASE DO NOT USE THIS.
|
|
145
|
-
*/
|
|
146
|
-
calendarRef?: React.Ref<CalendarRef>;
|
|
147
142
|
/**
|
|
148
143
|
* Indicates if the calendar can be focused by keyboard or only
|
|
149
144
|
* programmatically. Defaults to "0".
|
|
@@ -155,6 +150,3 @@ export interface CalendarProps extends WithAnalyticsEventsProps {
|
|
|
155
150
|
*/
|
|
156
151
|
shouldSetFocusOnCurrentDay?: boolean;
|
|
157
152
|
}
|
|
158
|
-
export interface CalendarRef {
|
|
159
|
-
navigate: (type: ArrowKeys) => void;
|
|
160
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/calendar",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.0",
|
|
4
4
|
"description": "An interactive calendar for date selection experiences.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -16,10 +16,6 @@
|
|
|
16
16
|
"atlaskit:src": "src/index.tsx",
|
|
17
17
|
"atlassian": {
|
|
18
18
|
"team": "Design System Team",
|
|
19
|
-
"releaseModel": "continuous",
|
|
20
|
-
"productPushConsumption": [
|
|
21
|
-
"jira"
|
|
22
|
-
],
|
|
23
19
|
"website": {
|
|
24
20
|
"name": "Calendar",
|
|
25
21
|
"category": "Components"
|
|
@@ -28,18 +24,17 @@
|
|
|
28
24
|
},
|
|
29
25
|
"dependencies": {
|
|
30
26
|
"@atlaskit/analytics-next": "^10.1.0",
|
|
31
|
-
"@atlaskit/button": "^
|
|
32
|
-
"@atlaskit/ds-lib": "^2.
|
|
27
|
+
"@atlaskit/button": "^20.1.0",
|
|
28
|
+
"@atlaskit/ds-lib": "^2.5.0",
|
|
33
29
|
"@atlaskit/heading": "^2.4.0",
|
|
34
|
-
"@atlaskit/icon": "^22.
|
|
30
|
+
"@atlaskit/icon": "^22.15.0",
|
|
35
31
|
"@atlaskit/locale": "^2.8.0",
|
|
36
|
-
"@atlaskit/primitives": "^12.
|
|
32
|
+
"@atlaskit/primitives": "^12.1.0",
|
|
37
33
|
"@atlaskit/theme": "^13.0.0",
|
|
38
|
-
"@atlaskit/tokens": "^1.
|
|
34
|
+
"@atlaskit/tokens": "^1.59.0",
|
|
39
35
|
"@babel/runtime": "^7.0.0",
|
|
40
36
|
"@emotion/react": "^11.7.1",
|
|
41
|
-
"date-fns": "^2.17.0"
|
|
42
|
-
"react-uid": "^2.2.0"
|
|
37
|
+
"date-fns": "^2.17.0"
|
|
43
38
|
},
|
|
44
39
|
"peerDependencies": {
|
|
45
40
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
@@ -55,7 +50,6 @@
|
|
|
55
50
|
"jest-in-case": "^1.0.2",
|
|
56
51
|
"jscodeshift": "^0.13.0",
|
|
57
52
|
"react-dom": "^16.8.0",
|
|
58
|
-
"react-test-renderer": "^16.8.0",
|
|
59
53
|
"storybook-addon-performance": "^0.16.0",
|
|
60
54
|
"typescript": "~5.4.2",
|
|
61
55
|
"wait-for-expect": "^1.2.0"
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = useCalendarRef;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
9
|
-
function useCalendarRef(calendarRef, _ref) {
|
|
10
|
-
var navigate = _ref.navigate;
|
|
11
|
-
(0, _react.useImperativeHandle)(calendarRef, function () {
|
|
12
|
-
return {
|
|
13
|
-
navigate: navigate
|
|
14
|
-
};
|
|
15
|
-
}, [navigate]);
|
|
16
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = useUniqueId;
|
|
7
|
-
var _reactUid = require("react-uid");
|
|
8
|
-
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
9
|
-
function useUniqueId(prefix) {
|
|
10
|
-
var seed = (0, _reactUid.useUIDSeed)();
|
|
11
|
-
return "".concat(prefix, "-").concat(seed(prefix));
|
|
12
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { useImperativeHandle } from 'react';
|
|
2
|
-
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
3
|
-
export default function useCalendarRef(calendarRef, _ref) {
|
|
4
|
-
var navigate = _ref.navigate;
|
|
5
|
-
useImperativeHandle(calendarRef, function () {
|
|
6
|
-
return {
|
|
7
|
-
navigate: navigate
|
|
8
|
-
};
|
|
9
|
-
}, [navigate]);
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function useUniqueId(prefix: string): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function useUniqueId(prefix: string): string;
|