@atlaskit/drawer 7.1.10 → 7.2.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 +23 -0
- package/dist/cjs/components/blanket.js +4 -2
- package/dist/cjs/components/index.js +5 -3
- package/dist/cjs/components/primitives/content.js +4 -4
- package/dist/cjs/components/primitives/icon-button.js +5 -4
- package/dist/cjs/components/primitives/index.js +12 -11
- package/dist/cjs/components/primitives/sidebar.js +4 -4
- package/dist/cjs/components/utils.js +2 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/blanket.js +4 -2
- package/dist/es2019/components/index.js +7 -3
- package/dist/es2019/components/primitives/content.js +3 -3
- package/dist/es2019/components/primitives/icon-button.js +3 -2
- package/dist/es2019/components/primitives/index.js +3 -2
- package/dist/es2019/components/primitives/sidebar.js +3 -3
- package/dist/es2019/components/utils.js +5 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/blanket.js +4 -2
- package/dist/esm/components/index.js +6 -3
- package/dist/esm/components/primitives/content.js +3 -3
- package/dist/esm/components/primitives/icon-button.js +3 -2
- package/dist/esm/components/primitives/index.js +3 -2
- package/dist/esm/components/primitives/sidebar.js +3 -3
- package/dist/esm/components/utils.js +2 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/components/blanket.d.ts +2 -1
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/components/primitives/content.d.ts +2 -3
- package/dist/types/components/primitives/index.d.ts +2 -2
- package/dist/types/components/primitives/sidebar.d.ts +1 -1
- package/dist/types/components/types.d.ts +48 -18
- package/package.json +14 -10
- package/report.api.md +196 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @atlaskit/drawer
|
|
2
2
|
|
|
3
|
+
## 7.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`cc4fe7bdf0c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cc4fe7bdf0c) - Updates `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behavior change.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [`11da403db81`](https://bitbucket.org/atlassian/atlassian-frontend/commits/11da403db81) - Internal change to add optional `testId` prop pass-through to blanket component. There should be no change in behaviour.
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 7.1.12
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
|
|
19
|
+
|
|
20
|
+
## 7.1.11
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- [`fd86b8e4c63`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fd86b8e4c63) - Internal code change turning on new linting rules.
|
|
25
|
+
|
|
3
26
|
## 7.1.10
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
|
@@ -20,7 +20,8 @@ var _constants = require("../constants");
|
|
|
20
20
|
*/
|
|
21
21
|
var Blanket = function Blanket(_ref) {
|
|
22
22
|
var isOpen = _ref.isOpen,
|
|
23
|
-
onBlanketClicked = _ref.onBlanketClicked
|
|
23
|
+
onBlanketClicked = _ref.onBlanketClicked,
|
|
24
|
+
testId = _ref.testId;
|
|
24
25
|
return /*#__PURE__*/_react.default.createElement(_motion.ExitingPersistence, {
|
|
25
26
|
appear: true
|
|
26
27
|
}, isOpen && /*#__PURE__*/_react.default.createElement(_motion.FadeIn
|
|
@@ -45,7 +46,8 @@ var Blanket = function Blanket(_ref) {
|
|
|
45
46
|
className: className
|
|
46
47
|
}, /*#__PURE__*/_react.default.createElement(_blanket.default, {
|
|
47
48
|
isTinted: true,
|
|
48
|
-
onBlanketClicked: onBlanketClicked
|
|
49
|
+
onBlanketClicked: onBlanketClicked,
|
|
50
|
+
testId: testId
|
|
49
51
|
}));
|
|
50
52
|
}));
|
|
51
53
|
};
|
|
@@ -46,7 +46,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
46
46
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
47
47
|
|
|
48
48
|
var packageName = "@atlaskit/drawer";
|
|
49
|
-
var packageVersion = "7.
|
|
49
|
+
var packageVersion = "7.2.0";
|
|
50
50
|
var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
|
|
51
51
|
|
|
52
52
|
var createAndFireOnClick = function createAndFireOnClick(createAnalyticsEvent, trigger) {
|
|
@@ -164,7 +164,8 @@ var DrawerBase = /*#__PURE__*/function (_Component) {
|
|
|
164
164
|
zIndex: "unset"
|
|
165
165
|
}, /*#__PURE__*/_react.default.createElement(_blanket.default, {
|
|
166
166
|
isOpen: isOpen,
|
|
167
|
-
onBlanketClicked: this.handleBlanketClick
|
|
167
|
+
onBlanketClicked: this.handleBlanketClick,
|
|
168
|
+
testId: testId && "".concat(testId, "--blanket")
|
|
168
169
|
}), /*#__PURE__*/_react.default.createElement(_focusLock.default, {
|
|
169
170
|
autoFocusFirstElem: autoFocusFirstElem,
|
|
170
171
|
isFocusLockEnabled: isFocusLockEnabled,
|
|
@@ -177,7 +178,8 @@ var DrawerBase = /*#__PURE__*/function (_Component) {
|
|
|
177
178
|
onCloseComplete: onCloseComplete,
|
|
178
179
|
onOpenComplete: onOpenComplete,
|
|
179
180
|
width: width,
|
|
180
|
-
shouldUnmountOnExit: shouldUnmountOnExit
|
|
181
|
+
shouldUnmountOnExit: shouldUnmountOnExit // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
182
|
+
,
|
|
181
183
|
overrides: overrides
|
|
182
184
|
}, children)));
|
|
183
185
|
}
|
|
@@ -11,7 +11,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
|
|
12
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _react = require("@emotion/react");
|
|
15
15
|
|
|
16
16
|
var _constants = require("@atlaskit/theme/constants");
|
|
17
17
|
|
|
@@ -36,9 +36,9 @@ var Content = function Content(_ref) {
|
|
|
36
36
|
* guide suggested as it made more sense as a transformer of the current styles rather than
|
|
37
37
|
* a complete override with no chance of partially changing styles.
|
|
38
38
|
*/
|
|
39
|
-
// eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
40
|
-
(0,
|
|
41
|
-
css: cssFn(defaultStyles)
|
|
39
|
+
// eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage, @repo/internal/react/no-unsafe-spread-props
|
|
40
|
+
(0, _react.jsx)("div", (0, _extends2.default)({
|
|
41
|
+
css: (0, _react.css)(cssFn(defaultStyles))
|
|
42
42
|
}, props))
|
|
43
43
|
);
|
|
44
44
|
};
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
9
|
|
|
10
10
|
var _colors = require("@atlaskit/theme/colors");
|
|
11
11
|
|
|
@@ -13,7 +13,7 @@ var _constants = require("@atlaskit/theme/constants");
|
|
|
13
13
|
|
|
14
14
|
/** @jsx jsx */
|
|
15
15
|
var gridSize = (0, _constants.gridSize)();
|
|
16
|
-
var iconButtonStyles = (0,
|
|
16
|
+
var iconButtonStyles = (0, _react.css)({
|
|
17
17
|
display: 'flex',
|
|
18
18
|
width: 5 * gridSize,
|
|
19
19
|
height: 5 * gridSize,
|
|
@@ -41,13 +41,14 @@ var IconButton = function IconButton(_ref) {
|
|
|
41
41
|
var children = _ref.children,
|
|
42
42
|
onClick = _ref.onClick,
|
|
43
43
|
testId = _ref.testId;
|
|
44
|
-
return (0,
|
|
44
|
+
return (0, _react.jsx)("button", {
|
|
45
45
|
type: "button",
|
|
46
46
|
css: iconButtonStyles,
|
|
47
47
|
onClick: onClick,
|
|
48
48
|
"data-testid": testId
|
|
49
49
|
}, children);
|
|
50
|
-
};
|
|
50
|
+
}; // eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
51
|
+
|
|
51
52
|
|
|
52
53
|
var _default = IconButton;
|
|
53
54
|
exports.default = _default;
|
|
@@ -11,7 +11,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
11
11
|
|
|
12
12
|
var _react = require("react");
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _react2 = require("@emotion/react");
|
|
15
15
|
|
|
16
16
|
var _arrowLeft = _interopRequireDefault(require("@atlaskit/icon/glyph/arrow-left"));
|
|
17
17
|
|
|
@@ -43,7 +43,7 @@ var widths = {
|
|
|
43
43
|
medium: 60 * (0, _constants.gridSize)(),
|
|
44
44
|
wide: 75 * (0, _constants.gridSize)()
|
|
45
45
|
};
|
|
46
|
-
var wrapperStyles = (0,
|
|
46
|
+
var wrapperStyles = (0, _react2.css)({
|
|
47
47
|
display: 'flex',
|
|
48
48
|
height: '100vh',
|
|
49
49
|
position: 'fixed',
|
|
@@ -75,7 +75,7 @@ var CustomSlideIn = function CustomSlideIn(_ref) {
|
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
var duration = isExiting ? _constants2.transitionDurationMs * 2 : _constants2.transitionDurationMs;
|
|
78
|
-
return (0,
|
|
78
|
+
return (0, _react2.jsx)(_motion.SlideIn, {
|
|
79
79
|
animationTimingFunction: _constants2.animationTimingFunction,
|
|
80
80
|
duration: duration,
|
|
81
81
|
enterFrom: "left",
|
|
@@ -113,15 +113,15 @@ var DrawerPrimitive = function DrawerPrimitive(_ref2) {
|
|
|
113
113
|
onCloseComplete === null || onCloseComplete === void 0 ? void 0 : onCloseComplete(ref.current);
|
|
114
114
|
}
|
|
115
115
|
}, [onCloseComplete, onOpenComplete]);
|
|
116
|
-
return (0,
|
|
116
|
+
return (0, _react2.jsx)(_motion.ExitingPersistence, {
|
|
117
117
|
appear: true
|
|
118
|
-
}, isOpen && (0,
|
|
118
|
+
}, isOpen && (0, _react2.jsx)(CustomSlideIn, {
|
|
119
119
|
onFinish: onFinish
|
|
120
120
|
}, function (_ref3) {
|
|
121
121
|
var _props$width;
|
|
122
122
|
|
|
123
123
|
var className = _ref3.className;
|
|
124
|
-
return (0,
|
|
124
|
+
return (0, _react2.jsx)("div", {
|
|
125
125
|
className: className,
|
|
126
126
|
css: wrapperStyles,
|
|
127
127
|
style: {
|
|
@@ -129,16 +129,17 @@ var DrawerPrimitive = function DrawerPrimitive(_ref2) {
|
|
|
129
129
|
},
|
|
130
130
|
"data-testid": testId,
|
|
131
131
|
ref: ref
|
|
132
|
-
}, (0,
|
|
132
|
+
}, (0, _react2.jsx)(Sidebar, sideBarOverrides, (0, _react2.jsx)(_iconButton.default, {
|
|
133
133
|
onClick: onClose,
|
|
134
134
|
testId: testId && 'DrawerPrimitiveSidebarCloseButton'
|
|
135
|
-
}, Icon ? (0,
|
|
135
|
+
}, Icon ? (0, _react2.jsx)(Icon, {
|
|
136
136
|
size: "large"
|
|
137
|
-
}) : (0,
|
|
137
|
+
}) : (0, _react2.jsx)(_arrowLeft.default, {
|
|
138
138
|
label: "Close drawer"
|
|
139
|
-
}))), (0,
|
|
139
|
+
}))), (0, _react2.jsx)(Content, contentOverrides, children));
|
|
140
140
|
}));
|
|
141
|
-
};
|
|
141
|
+
}; // eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
142
|
+
|
|
142
143
|
|
|
143
144
|
var _default = DrawerPrimitive;
|
|
144
145
|
exports.default = _default;
|
|
@@ -11,7 +11,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
|
|
12
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _react = require("@emotion/react");
|
|
15
15
|
|
|
16
16
|
var _colors = require("@atlaskit/theme/colors");
|
|
17
17
|
|
|
@@ -38,9 +38,9 @@ var sidebarCSS = function sidebarCSS() {
|
|
|
38
38
|
var Sidebar = function Sidebar(_ref) {
|
|
39
39
|
var cssFn = _ref.cssFn,
|
|
40
40
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
41
|
-
// eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
42
|
-
return (0,
|
|
43
|
-
css: cssFn(defaultStyle)
|
|
41
|
+
// eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage, @repo/internal/react/no-unsafe-spread-props
|
|
42
|
+
return (0, _react.jsx)("div", (0, _extends2.default)({
|
|
43
|
+
css: (0, _react.css)(cssFn(defaultStyle))
|
|
44
44
|
}, props));
|
|
45
45
|
};
|
|
46
46
|
|
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.createExtender = void 0;
|
|
7
7
|
|
|
8
|
+
// eslint-disable-next-line @repo/internal/react/consistent-types-definitions
|
|
9
|
+
|
|
8
10
|
/**
|
|
9
11
|
* @deprecated Please avoid using this function as we intend to remote it in a future release. See DSP-2673 for more information.
|
|
10
12
|
*/
|
package/dist/cjs/version.json
CHANGED
|
@@ -8,7 +8,8 @@ import { animationTimingFunction, transitionDurationMs } from '../constants';
|
|
|
8
8
|
*/
|
|
9
9
|
const Blanket = ({
|
|
10
10
|
isOpen,
|
|
11
|
-
onBlanketClicked
|
|
11
|
+
onBlanketClicked,
|
|
12
|
+
testId
|
|
12
13
|
}) => {
|
|
13
14
|
return /*#__PURE__*/React.createElement(ExitingPersistence, {
|
|
14
15
|
appear: true
|
|
@@ -34,7 +35,8 @@ const Blanket = ({
|
|
|
34
35
|
className: className
|
|
35
36
|
}, /*#__PURE__*/React.createElement(AkBlanket, {
|
|
36
37
|
isTinted: true,
|
|
37
|
-
onBlanketClicked: onBlanketClicked
|
|
38
|
+
onBlanketClicked: onBlanketClicked,
|
|
39
|
+
testId: testId
|
|
38
40
|
}))));
|
|
39
41
|
};
|
|
40
42
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
|
|
3
|
+
/* eslint-disable @repo/internal/dom-events/no-unsafe-event-listeners */
|
|
2
4
|
import React, { Component } from 'react';
|
|
3
5
|
import { canUseDOM } from 'exenv';
|
|
4
6
|
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
@@ -7,7 +9,7 @@ import Blanket from './blanket';
|
|
|
7
9
|
import FocusLock from './focus-lock';
|
|
8
10
|
import DrawerPrimitive from './primitives';
|
|
9
11
|
const packageName = "@atlaskit/drawer";
|
|
10
|
-
const packageVersion = "7.
|
|
12
|
+
const packageVersion = "7.2.0";
|
|
11
13
|
const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
12
14
|
|
|
13
15
|
const createAndFireOnClick = (createAnalyticsEvent, trigger) => createAndFireEventOnAtlaskit({
|
|
@@ -118,7 +120,8 @@ export class DrawerBase extends Component {
|
|
|
118
120
|
zIndex: "unset"
|
|
119
121
|
}, /*#__PURE__*/React.createElement(Blanket, {
|
|
120
122
|
isOpen: isOpen,
|
|
121
|
-
onBlanketClicked: this.handleBlanketClick
|
|
123
|
+
onBlanketClicked: this.handleBlanketClick,
|
|
124
|
+
testId: testId && `${testId}--blanket`
|
|
122
125
|
}), /*#__PURE__*/React.createElement(FocusLock, {
|
|
123
126
|
autoFocusFirstElem: autoFocusFirstElem,
|
|
124
127
|
isFocusLockEnabled: isFocusLockEnabled,
|
|
@@ -131,7 +134,8 @@ export class DrawerBase extends Component {
|
|
|
131
134
|
onCloseComplete: onCloseComplete,
|
|
132
135
|
onOpenComplete: onOpenComplete,
|
|
133
136
|
width: width,
|
|
134
|
-
shouldUnmountOnExit: shouldUnmountOnExit
|
|
137
|
+
shouldUnmountOnExit: shouldUnmountOnExit // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
138
|
+
,
|
|
135
139
|
overrides: overrides
|
|
136
140
|
}, children)));
|
|
137
141
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
-
import { jsx } from '@emotion/
|
|
4
|
+
import { css, jsx } from '@emotion/react';
|
|
5
5
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
6
6
|
const defaultStyles = {
|
|
7
7
|
flex: 1,
|
|
@@ -21,9 +21,9 @@ const Content = ({
|
|
|
21
21
|
* guide suggested as it made more sense as a transformer of the current styles rather than
|
|
22
22
|
* a complete override with no chance of partially changing styles.
|
|
23
23
|
*/
|
|
24
|
-
// eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
24
|
+
// eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage, @repo/internal/react/no-unsafe-spread-props
|
|
25
25
|
jsx("div", _extends({
|
|
26
|
-
css: cssFn(defaultStyles)
|
|
26
|
+
css: css(cssFn(defaultStyles))
|
|
27
27
|
}, props));
|
|
28
28
|
|
|
29
29
|
export default {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { css, jsx } from '@emotion/
|
|
2
|
+
import { css, jsx } from '@emotion/react';
|
|
3
3
|
import { B50, N30A } from '@atlaskit/theme/colors';
|
|
4
4
|
import { gridSize as getGridSize } from '@atlaskit/theme/constants';
|
|
5
5
|
const gridSize = getGridSize();
|
|
@@ -36,6 +36,7 @@ const IconButton = ({
|
|
|
36
36
|
css: iconButtonStyles,
|
|
37
37
|
onClick: onClick,
|
|
38
38
|
"data-testid": testId
|
|
39
|
-
}, children);
|
|
39
|
+
}, children); // eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
40
|
+
|
|
40
41
|
|
|
41
42
|
export default IconButton;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { useCallback, useRef } from 'react';
|
|
3
|
-
import { css, jsx } from '@emotion/
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import ArrowLeft from '@atlaskit/icon/glyph/arrow-left';
|
|
5
5
|
import { ExitingPersistence, SlideIn, useExitingPersistence } from '@atlaskit/motion';
|
|
6
6
|
import { N0 } from '@atlaskit/theme/colors';
|
|
@@ -115,6 +115,7 @@ const DrawerPrimitive = ({
|
|
|
115
115
|
label: "Close drawer"
|
|
116
116
|
}))), jsx(Content, contentOverrides, children));
|
|
117
117
|
}));
|
|
118
|
-
};
|
|
118
|
+
}; // eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
119
|
+
|
|
119
120
|
|
|
120
121
|
export default DrawerPrimitive;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
-
import { jsx } from '@emotion/
|
|
4
|
+
import { css, jsx } from '@emotion/react';
|
|
5
5
|
import { N500 } from '@atlaskit/theme/colors';
|
|
6
6
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
7
7
|
const defaultStyle = {
|
|
@@ -23,9 +23,9 @@ const Sidebar = ({
|
|
|
23
23
|
cssFn,
|
|
24
24
|
...props
|
|
25
25
|
}) => {
|
|
26
|
-
// eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
26
|
+
// eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage, @repo/internal/react/no-unsafe-spread-props
|
|
27
27
|
return jsx("div", _extends({
|
|
28
|
-
css: cssFn(defaultStyle)
|
|
28
|
+
css: css(cssFn(defaultStyle))
|
|
29
29
|
}, props));
|
|
30
30
|
};
|
|
31
31
|
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
// eslint-disable-next-line @repo/internal/react/consistent-types-definitions
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* @deprecated Please avoid using this function as we intend to remote it in a future release. See DSP-2673 for more information.
|
|
3
5
|
*/
|
|
4
6
|
export const createExtender = function createExtender(defaults,
|
|
5
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* We're defaulting to an Object.create call here to circumvent
|
|
6
9
|
* the fact that {} can't be reconciled
|
|
7
10
|
* with a type that extends Record<string, any>
|
|
8
11
|
*
|
|
@@ -10,7 +13,7 @@ export const createExtender = function createExtender(defaults,
|
|
|
10
13
|
* from nullifying a particular component in the tree.
|
|
11
14
|
* This can be reverted with additional logic,
|
|
12
15
|
* at such a time as this nullification becomes an actual usecase.
|
|
13
|
-
|
|
16
|
+
*/
|
|
14
17
|
overrides = Object.create(Object.prototype)) {
|
|
15
18
|
if (!defaults) {
|
|
16
19
|
throw new Error('a default set of overrides *must* be passed in as the first argument');
|
package/dist/es2019/version.json
CHANGED
|
@@ -8,7 +8,8 @@ import { animationTimingFunction, transitionDurationMs } from '../constants';
|
|
|
8
8
|
*/
|
|
9
9
|
var Blanket = function Blanket(_ref) {
|
|
10
10
|
var isOpen = _ref.isOpen,
|
|
11
|
-
onBlanketClicked = _ref.onBlanketClicked
|
|
11
|
+
onBlanketClicked = _ref.onBlanketClicked,
|
|
12
|
+
testId = _ref.testId;
|
|
12
13
|
return /*#__PURE__*/React.createElement(ExitingPersistence, {
|
|
13
14
|
appear: true
|
|
14
15
|
}, isOpen && /*#__PURE__*/React.createElement(FadeIn
|
|
@@ -33,7 +34,8 @@ var Blanket = function Blanket(_ref) {
|
|
|
33
34
|
className: className
|
|
34
35
|
}, /*#__PURE__*/React.createElement(AkBlanket, {
|
|
35
36
|
isTinted: true,
|
|
36
|
-
onBlanketClicked: onBlanketClicked
|
|
37
|
+
onBlanketClicked: onBlanketClicked,
|
|
38
|
+
testId: testId
|
|
37
39
|
}));
|
|
38
40
|
}));
|
|
39
41
|
};
|
|
@@ -10,6 +10,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
10
10
|
|
|
11
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
12
|
|
|
13
|
+
/* eslint-disable @repo/internal/dom-events/no-unsafe-event-listeners */
|
|
13
14
|
import React, { Component } from 'react';
|
|
14
15
|
import { canUseDOM } from 'exenv';
|
|
15
16
|
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
@@ -18,7 +19,7 @@ import Blanket from './blanket';
|
|
|
18
19
|
import FocusLock from './focus-lock';
|
|
19
20
|
import DrawerPrimitive from './primitives';
|
|
20
21
|
var packageName = "@atlaskit/drawer";
|
|
21
|
-
var packageVersion = "7.
|
|
22
|
+
var packageVersion = "7.2.0";
|
|
22
23
|
var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
23
24
|
|
|
24
25
|
var createAndFireOnClick = function createAndFireOnClick(createAnalyticsEvent, trigger) {
|
|
@@ -143,7 +144,8 @@ export var DrawerBase = /*#__PURE__*/function (_Component) {
|
|
|
143
144
|
zIndex: "unset"
|
|
144
145
|
}, /*#__PURE__*/React.createElement(Blanket, {
|
|
145
146
|
isOpen: isOpen,
|
|
146
|
-
onBlanketClicked: this.handleBlanketClick
|
|
147
|
+
onBlanketClicked: this.handleBlanketClick,
|
|
148
|
+
testId: testId && "".concat(testId, "--blanket")
|
|
147
149
|
}), /*#__PURE__*/React.createElement(FocusLock, {
|
|
148
150
|
autoFocusFirstElem: autoFocusFirstElem,
|
|
149
151
|
isFocusLockEnabled: isFocusLockEnabled,
|
|
@@ -156,7 +158,8 @@ export var DrawerBase = /*#__PURE__*/function (_Component) {
|
|
|
156
158
|
onCloseComplete: onCloseComplete,
|
|
157
159
|
onOpenComplete: onOpenComplete,
|
|
158
160
|
width: width,
|
|
159
|
-
shouldUnmountOnExit: shouldUnmountOnExit
|
|
161
|
+
shouldUnmountOnExit: shouldUnmountOnExit // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
162
|
+
,
|
|
160
163
|
overrides: overrides
|
|
161
164
|
}, children)));
|
|
162
165
|
}
|
|
@@ -3,7 +3,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
3
3
|
var _excluded = ["cssFn"];
|
|
4
4
|
|
|
5
5
|
/** @jsx jsx */
|
|
6
|
-
import { jsx } from '@emotion/
|
|
6
|
+
import { css, jsx } from '@emotion/react';
|
|
7
7
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
8
8
|
var defaultStyles = {
|
|
9
9
|
flex: 1,
|
|
@@ -26,9 +26,9 @@ var Content = function Content(_ref) {
|
|
|
26
26
|
* guide suggested as it made more sense as a transformer of the current styles rather than
|
|
27
27
|
* a complete override with no chance of partially changing styles.
|
|
28
28
|
*/
|
|
29
|
-
// eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
29
|
+
// eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage, @repo/internal/react/no-unsafe-spread-props
|
|
30
30
|
jsx("div", _extends({
|
|
31
|
-
css: cssFn(defaultStyles)
|
|
31
|
+
css: css(cssFn(defaultStyles))
|
|
32
32
|
}, props))
|
|
33
33
|
);
|
|
34
34
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { css, jsx } from '@emotion/
|
|
2
|
+
import { css, jsx } from '@emotion/react';
|
|
3
3
|
import { B50, N30A } from '@atlaskit/theme/colors';
|
|
4
4
|
import { gridSize as getGridSize } from '@atlaskit/theme/constants';
|
|
5
5
|
var gridSize = getGridSize();
|
|
@@ -37,6 +37,7 @@ var IconButton = function IconButton(_ref) {
|
|
|
37
37
|
onClick: onClick,
|
|
38
38
|
"data-testid": testId
|
|
39
39
|
}, children);
|
|
40
|
-
};
|
|
40
|
+
}; // eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
41
|
+
|
|
41
42
|
|
|
42
43
|
export default IconButton;
|
|
@@ -5,7 +5,7 @@ var _excluded = ["children", "icon", "onClose", "onCloseComplete", "onOpenComple
|
|
|
5
5
|
|
|
6
6
|
/** @jsx jsx */
|
|
7
7
|
import { useCallback, useRef } from 'react';
|
|
8
|
-
import { css, jsx } from '@emotion/
|
|
8
|
+
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import ArrowLeft from '@atlaskit/icon/glyph/arrow-left';
|
|
10
10
|
import { ExitingPersistence, SlideIn, useExitingPersistence } from '@atlaskit/motion';
|
|
11
11
|
import { N0 } from '@atlaskit/theme/colors';
|
|
@@ -120,6 +120,7 @@ var DrawerPrimitive = function DrawerPrimitive(_ref2) {
|
|
|
120
120
|
label: "Close drawer"
|
|
121
121
|
}))), jsx(Content, contentOverrides, children));
|
|
122
122
|
}));
|
|
123
|
-
};
|
|
123
|
+
}; // eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
124
|
+
|
|
124
125
|
|
|
125
126
|
export default DrawerPrimitive;
|
|
@@ -3,7 +3,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
3
3
|
var _excluded = ["cssFn"];
|
|
4
4
|
|
|
5
5
|
/** @jsx jsx */
|
|
6
|
-
import { jsx } from '@emotion/
|
|
6
|
+
import { css, jsx } from '@emotion/react';
|
|
7
7
|
import { N500 } from '@atlaskit/theme/colors';
|
|
8
8
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
9
9
|
var defaultStyle = {
|
|
@@ -27,9 +27,9 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
27
27
|
var cssFn = _ref.cssFn,
|
|
28
28
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
29
29
|
|
|
30
|
-
// eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
30
|
+
// eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage, @repo/internal/react/no-unsafe-spread-props
|
|
31
31
|
return jsx("div", _extends({
|
|
32
|
-
css: cssFn(defaultStyle)
|
|
32
|
+
css: css(cssFn(defaultStyle))
|
|
33
33
|
}, props));
|
|
34
34
|
};
|
|
35
35
|
|
package/dist/esm/version.json
CHANGED
|
@@ -2,9 +2,10 @@ import React from 'react';
|
|
|
2
2
|
declare type BlanketProps = {
|
|
3
3
|
isOpen: boolean;
|
|
4
4
|
onBlanketClicked: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
5
|
+
testId?: string;
|
|
5
6
|
};
|
|
6
7
|
/**
|
|
7
8
|
* A wrapper around `@atlaskit/blanket` that adds a fade in/out transition.
|
|
8
9
|
*/
|
|
9
|
-
declare const Blanket: ({ isOpen, onBlanketClicked }: BlanketProps) => JSX.Element;
|
|
10
|
+
declare const Blanket: ({ isOpen, onBlanketClicked, testId }: BlanketProps) => JSX.Element;
|
|
10
11
|
export default Blanket;
|
|
@@ -27,5 +27,5 @@ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DrawerPro
|
|
|
27
27
|
isFocusLockEnabled: boolean;
|
|
28
28
|
shouldReturnFocus: boolean;
|
|
29
29
|
autoFocusFirstElem: boolean;
|
|
30
|
-
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "width" | "children" | "onKeyDown" | "key" | "isOpen" | "
|
|
30
|
+
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "width" | "children" | "onKeyDown" | "key" | "isOpen" | "testId" | "analyticsContext" | "isFocusLockEnabled" | "autoFocusFirstElem" | "shouldReturnFocus" | "icon" | "onClose" | "onCloseComplete" | "onOpenComplete" | "overrides" | "shouldUnmountOnExit"> & React.RefAttributes<any>>;
|
|
31
31
|
export default _default;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
|
|
3
|
-
import { CSSObject } from '@emotion/core';
|
|
2
|
+
import { CSSObject, jsx } from '@emotion/react';
|
|
4
3
|
import { ContentProps } from '../types';
|
|
5
4
|
declare const _default: {
|
|
6
|
-
component: ({ cssFn, ...props }: ContentProps) => JSX.Element;
|
|
5
|
+
component: ({ cssFn, ...props }: ContentProps) => jsx.JSX.Element;
|
|
7
6
|
cssFn: () => CSSObject;
|
|
8
7
|
};
|
|
9
8
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
3
|
import { DrawerPrimitiveProps } from '../types';
|
|
4
|
-
declare const DrawerPrimitive: ({ children, icon: Icon, onClose, onCloseComplete, onOpenComplete, overrides, testId, in: isOpen, ...props }: DrawerPrimitiveProps) => JSX.Element;
|
|
4
|
+
declare const DrawerPrimitive: ({ children, icon: Icon, onClose, onCloseComplete, onOpenComplete, overrides, testId, in: isOpen, ...props }: DrawerPrimitiveProps) => jsx.JSX.Element;
|
|
5
5
|
export default DrawerPrimitive;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentType, ReactNode, SyntheticEvent } from 'react';
|
|
2
|
-
import { CSSObject } from '@emotion/
|
|
2
|
+
import { CSSObject } from '@emotion/react';
|
|
3
3
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
4
4
|
export declare type Widths = {
|
|
5
5
|
extended: string;
|
|
@@ -10,24 +10,38 @@ export declare type Widths = {
|
|
|
10
10
|
};
|
|
11
11
|
export declare type DrawerWidth = 'extended' | 'full' | 'medium' | 'narrow' | 'wide';
|
|
12
12
|
export interface BaseProps {
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* A unique hook to be used for testing.
|
|
15
|
+
*/
|
|
14
16
|
testId?: string;
|
|
15
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* The content of the drawer.
|
|
19
|
+
*/
|
|
16
20
|
children?: ReactNode;
|
|
17
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Icon to be rendered in your drawer as a component, if available.
|
|
23
|
+
*/
|
|
18
24
|
icon?: ComponentType<any>;
|
|
19
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Available drawer sizes.
|
|
27
|
+
*/
|
|
20
28
|
width?: DrawerWidth;
|
|
21
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* A callback function that will be called when the drawer has finished its opening transition.
|
|
31
|
+
*/
|
|
22
32
|
onOpenComplete?: (node: HTMLElement | null) => void;
|
|
23
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* A callback function that will be called when the drawer has finished its close transition.
|
|
35
|
+
*/
|
|
24
36
|
onCloseComplete?: (node: HTMLElement | null) => void;
|
|
25
37
|
/**
|
|
26
|
-
*
|
|
38
|
+
* @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release.
|
|
27
39
|
* Boolean that controls if drawer should be retained/discarded
|
|
28
|
-
|
|
40
|
+
*/
|
|
29
41
|
shouldUnmountOnExit?: boolean;
|
|
30
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* Override drawer components.
|
|
44
|
+
*/
|
|
31
45
|
overrides?: OverridesType;
|
|
32
46
|
}
|
|
33
47
|
export declare type DefaultsType = {
|
|
@@ -77,22 +91,38 @@ export interface DrawerPrimitiveProps extends BaseProps {
|
|
|
77
91
|
onClose: (event: SyntheticEvent<HTMLElement>) => void;
|
|
78
92
|
}
|
|
79
93
|
export declare type DrawerProps = BaseProps & FocusLockProps & WithAnalyticsEventsProps & {
|
|
80
|
-
/**
|
|
94
|
+
/**
|
|
95
|
+
* Callback function called while the drawer is displayed and `keydown` event is triggered.
|
|
96
|
+
*/
|
|
81
97
|
onKeyDown?: (event: SyntheticEvent) => void;
|
|
82
|
-
/**
|
|
98
|
+
/**
|
|
99
|
+
* Callback function called when the drawer is closed.
|
|
100
|
+
*/
|
|
83
101
|
onClose?: (event: SyntheticEvent<HTMLElement>, analyticsEvent: any) => void;
|
|
84
|
-
/**
|
|
102
|
+
/**
|
|
103
|
+
* Controls if the drawer is open or closed.
|
|
104
|
+
*/
|
|
85
105
|
isOpen: boolean;
|
|
86
106
|
};
|
|
87
107
|
export interface FocusLockProps {
|
|
88
|
-
/**
|
|
108
|
+
/**
|
|
109
|
+
* Controls whether to focus the first tabbable element inside the focus lock.
|
|
110
|
+
*/
|
|
89
111
|
autoFocusFirstElem?: boolean | (() => HTMLElement | null);
|
|
90
|
-
/**
|
|
112
|
+
/**
|
|
113
|
+
* Content inside the focus lock.
|
|
114
|
+
*/
|
|
91
115
|
children?: ReactNode;
|
|
92
|
-
/**
|
|
116
|
+
/**
|
|
117
|
+
* Whether the focus lock is active or not.
|
|
118
|
+
*/
|
|
93
119
|
isFocusLockEnabled?: boolean;
|
|
94
|
-
/**
|
|
120
|
+
/**
|
|
121
|
+
* Whether to return the focus to the previous active element on closing the drawer.
|
|
122
|
+
*/
|
|
95
123
|
shouldReturnFocus?: boolean;
|
|
96
124
|
}
|
|
97
|
-
/**
|
|
125
|
+
/**
|
|
126
|
+
* Type of keyboard event that triggers which key will should close the drawer.
|
|
127
|
+
*/
|
|
98
128
|
export declare type CloseTrigger = 'backButton' | 'blanket' | 'escKey';
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/drawer",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"description": "A drawer is a panel that slides in from the left side of the screen.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
7
7
|
},
|
|
8
|
-
"repository": "https://bitbucket.org/atlassian/atlassian-frontend",
|
|
8
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
9
9
|
"author": "Atlassian Pty Ltd",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"main": "dist/cjs/index.js",
|
|
@@ -13,26 +13,27 @@
|
|
|
13
13
|
"module:es2019": "dist/es2019/index.js",
|
|
14
14
|
"types": "dist/types/index.d.ts",
|
|
15
15
|
"sideEffects": false,
|
|
16
|
-
"atlaskit:src": "src/index.
|
|
16
|
+
"atlaskit:src": "src/index.tsx",
|
|
17
17
|
"homepage": "https://atlassian.design/components/drawer",
|
|
18
18
|
"atlassian": {
|
|
19
19
|
"team": "Design System Team",
|
|
20
20
|
"deprecatedAutoEntryPoints": true,
|
|
21
21
|
"releaseModel": "scheduled",
|
|
22
22
|
"website": {
|
|
23
|
-
"name": "Drawer"
|
|
23
|
+
"name": "Drawer",
|
|
24
|
+
"category": "Components"
|
|
24
25
|
}
|
|
25
26
|
},
|
|
26
27
|
"dependencies": {
|
|
27
28
|
"@atlaskit/analytics-next": "^8.2.0",
|
|
28
29
|
"@atlaskit/blanket": "^12.1.0",
|
|
29
30
|
"@atlaskit/icon": "^21.10.0",
|
|
30
|
-
"@atlaskit/motion": "^1.0
|
|
31
|
+
"@atlaskit/motion": "^1.2.0",
|
|
31
32
|
"@atlaskit/portal": "^4.0.0",
|
|
32
|
-
"@atlaskit/theme": "^12.
|
|
33
|
+
"@atlaskit/theme": "^12.2.0",
|
|
33
34
|
"@atlaskit/tokens": "^0.10.0",
|
|
34
35
|
"@babel/runtime": "^7.0.0",
|
|
35
|
-
"@emotion/
|
|
36
|
+
"@emotion/react": "^11.7.1",
|
|
36
37
|
"exenv": "^1.2.2",
|
|
37
38
|
"react-focus-lock": "^2.5.2",
|
|
38
39
|
"tiny-invariant": "^1.2.0"
|
|
@@ -45,9 +46,10 @@
|
|
|
45
46
|
"@atlaskit/checkbox": "^12.3.9",
|
|
46
47
|
"@atlaskit/code": "^14.3.3",
|
|
47
48
|
"@atlaskit/docs": "*",
|
|
48
|
-
"@atlaskit/dropdown-menu": "^11.
|
|
49
|
+
"@atlaskit/dropdown-menu": "^11.4.0",
|
|
50
|
+
"@atlaskit/ds-lib": "^2.1.0",
|
|
49
51
|
"@atlaskit/menu": "^1.3.0",
|
|
50
|
-
"@atlaskit/section-message": "^6.
|
|
52
|
+
"@atlaskit/section-message": "^6.2.0",
|
|
51
53
|
"@atlaskit/ssr": "*",
|
|
52
54
|
"@atlaskit/textarea": "^4.3.1",
|
|
53
55
|
"@atlaskit/visual-regression": "*",
|
|
@@ -59,7 +61,7 @@
|
|
|
59
61
|
"lodash": "^4.17.21",
|
|
60
62
|
"react-dom": "^16.8.0",
|
|
61
63
|
"react-lorem-component": "^0.13.0",
|
|
62
|
-
"typescript": "4.
|
|
64
|
+
"typescript": "4.3.5",
|
|
63
65
|
"wait-for-expect": "^1.2.0"
|
|
64
66
|
},
|
|
65
67
|
"techstack": {
|
|
@@ -67,6 +69,8 @@
|
|
|
67
69
|
"import-structure": "atlassian-conventions"
|
|
68
70
|
},
|
|
69
71
|
"@repo/internal": {
|
|
72
|
+
"dom-events": "use-bind-event-listener",
|
|
73
|
+
"design-system": "v1",
|
|
70
74
|
"analytics": "analytics-next",
|
|
71
75
|
"theming": "tokens",
|
|
72
76
|
"styling": [
|
package/report.api.md
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/drawer"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { ComponentType } from 'react';
|
|
7
|
+
import { CSSObject } from '@emotion/core';
|
|
8
|
+
import { default as React_2 } from 'react';
|
|
9
|
+
import { ReactNode } from 'react';
|
|
10
|
+
import { SyntheticEvent } from 'react';
|
|
11
|
+
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
12
|
+
import { WithContextProps } from '@atlaskit/analytics-next';
|
|
13
|
+
|
|
14
|
+
export declare interface BaseProps {
|
|
15
|
+
/** A unique hook to be used for testing. */
|
|
16
|
+
testId?: string;
|
|
17
|
+
/** The content of the drawer. */
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
/** Icon to be rendered in your drawer as a component, if available. */
|
|
20
|
+
icon?: ComponentType<any>;
|
|
21
|
+
/** Available drawer sizes. */
|
|
22
|
+
width?: DrawerWidth;
|
|
23
|
+
/** A callback function that will be called when the drawer has finished its opening transition. */
|
|
24
|
+
onOpenComplete?: (node: HTMLElement | null) => void;
|
|
25
|
+
/** A callback function that will be called when the drawer has finished its close transition. */
|
|
26
|
+
onCloseComplete?: (node: HTMLElement | null) => void;
|
|
27
|
+
/**
|
|
28
|
+
* * @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release.
|
|
29
|
+
* Boolean that controls if drawer should be retained/discarded
|
|
30
|
+
* */
|
|
31
|
+
shouldUnmountOnExit?: boolean;
|
|
32
|
+
/** Override drawer components. */
|
|
33
|
+
overrides?: OverridesType;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Type of keyboard event that triggers which key will should close the drawer. */
|
|
37
|
+
export declare type CloseTrigger = 'backButton' | 'blanket' | 'escKey';
|
|
38
|
+
|
|
39
|
+
export declare type ContentCSSProps = Omit<ContentProps, 'cssFn'>;
|
|
40
|
+
|
|
41
|
+
export declare interface ContentProps extends React.HTMLProps<HTMLDivElement> {
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release. See DSP-2673 for more information.
|
|
44
|
+
*/
|
|
45
|
+
cssFn: (defaultStyles: CSSObject) => CSSObject;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
declare const _default: React_2.ForwardRefExoticComponent<
|
|
49
|
+
Pick<
|
|
50
|
+
Pick<
|
|
51
|
+
Omit<DrawerProps, keyof WithAnalyticsEventsProps>,
|
|
52
|
+
| 'children'
|
|
53
|
+
| 'onKeyDown'
|
|
54
|
+
| 'isOpen'
|
|
55
|
+
| 'testId'
|
|
56
|
+
| 'icon'
|
|
57
|
+
| 'onClose'
|
|
58
|
+
| 'onCloseComplete'
|
|
59
|
+
| 'onOpenComplete'
|
|
60
|
+
| 'overrides'
|
|
61
|
+
| 'shouldUnmountOnExit'
|
|
62
|
+
> &
|
|
63
|
+
Partial<
|
|
64
|
+
Pick<
|
|
65
|
+
Omit<DrawerProps, keyof WithAnalyticsEventsProps>,
|
|
66
|
+
| 'width'
|
|
67
|
+
| 'isFocusLockEnabled'
|
|
68
|
+
| 'autoFocusFirstElem'
|
|
69
|
+
| 'shouldReturnFocus'
|
|
70
|
+
>
|
|
71
|
+
> &
|
|
72
|
+
Partial<
|
|
73
|
+
Pick<
|
|
74
|
+
{
|
|
75
|
+
width: DrawerWidth;
|
|
76
|
+
isFocusLockEnabled: boolean;
|
|
77
|
+
shouldReturnFocus: boolean;
|
|
78
|
+
autoFocusFirstElem: boolean;
|
|
79
|
+
},
|
|
80
|
+
never
|
|
81
|
+
>
|
|
82
|
+
> &
|
|
83
|
+
React_2.RefAttributes<any> &
|
|
84
|
+
WithContextProps,
|
|
85
|
+
| 'width'
|
|
86
|
+
| 'children'
|
|
87
|
+
| 'onKeyDown'
|
|
88
|
+
| 'key'
|
|
89
|
+
| 'isOpen'
|
|
90
|
+
| 'analyticsContext'
|
|
91
|
+
| 'testId'
|
|
92
|
+
| 'isFocusLockEnabled'
|
|
93
|
+
| 'autoFocusFirstElem'
|
|
94
|
+
| 'shouldReturnFocus'
|
|
95
|
+
| 'icon'
|
|
96
|
+
| 'onClose'
|
|
97
|
+
| 'onCloseComplete'
|
|
98
|
+
| 'onOpenComplete'
|
|
99
|
+
| 'overrides'
|
|
100
|
+
| 'shouldUnmountOnExit'
|
|
101
|
+
> &
|
|
102
|
+
React_2.RefAttributes<any>
|
|
103
|
+
>;
|
|
104
|
+
export default _default;
|
|
105
|
+
|
|
106
|
+
export declare type DefaultsType = {
|
|
107
|
+
Sidebar: {
|
|
108
|
+
component: React.ComponentType<SidebarProps>;
|
|
109
|
+
cssFn: (defaultStyles: CSSObject) => CSSObject;
|
|
110
|
+
};
|
|
111
|
+
Content: {
|
|
112
|
+
component: React.ComponentType<ContentProps>;
|
|
113
|
+
cssFn: (defaultStyles: CSSObject) => CSSObject;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export declare type DrawerPrimitiveDefaults = Pick<
|
|
118
|
+
DefaultsType,
|
|
119
|
+
'Sidebar' | 'Content'
|
|
120
|
+
>;
|
|
121
|
+
|
|
122
|
+
export declare type DrawerPrimitiveOverrides = Pick<
|
|
123
|
+
OverridesType,
|
|
124
|
+
'Sidebar' | 'Content'
|
|
125
|
+
>;
|
|
126
|
+
|
|
127
|
+
export declare interface DrawerPrimitiveProps extends BaseProps {
|
|
128
|
+
in: boolean;
|
|
129
|
+
onClose: (event: SyntheticEvent<HTMLElement>) => void;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export declare type DrawerProps = BaseProps &
|
|
133
|
+
FocusLockProps &
|
|
134
|
+
WithAnalyticsEventsProps & {
|
|
135
|
+
/** Callback function called while the drawer is displayed and `keydown` event is triggered. */
|
|
136
|
+
onKeyDown?: (event: SyntheticEvent) => void;
|
|
137
|
+
/** Callback function called when the drawer is closed. */
|
|
138
|
+
onClose?: (event: SyntheticEvent<HTMLElement>, analyticsEvent: any) => void;
|
|
139
|
+
/** Controls if the drawer is open or closed. */
|
|
140
|
+
isOpen: boolean;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export declare type DrawerWidth =
|
|
144
|
+
| 'extended'
|
|
145
|
+
| 'full'
|
|
146
|
+
| 'medium'
|
|
147
|
+
| 'narrow'
|
|
148
|
+
| 'wide';
|
|
149
|
+
|
|
150
|
+
export declare interface FocusLockProps {
|
|
151
|
+
/** Controls whether to focus the first tabbable element inside the focus lock. */
|
|
152
|
+
autoFocusFirstElem?: boolean | (() => HTMLElement | null);
|
|
153
|
+
/** Content inside the focus lock. */
|
|
154
|
+
children?: ReactNode;
|
|
155
|
+
/** Whether the focus lock is active or not. */
|
|
156
|
+
isFocusLockEnabled?: boolean;
|
|
157
|
+
/** Whether to return the focus to the previous active element on closing the drawer. */
|
|
158
|
+
shouldReturnFocus?: boolean;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export declare type OverridesType = {
|
|
162
|
+
Sidebar?: {
|
|
163
|
+
component?: React.ComponentType<SidebarProps>;
|
|
164
|
+
/**
|
|
165
|
+
* @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release. See DSP-2673 for more information.
|
|
166
|
+
*/
|
|
167
|
+
cssFn?: (defaultStyles: CSSObject) => CSSObject;
|
|
168
|
+
};
|
|
169
|
+
Content?: {
|
|
170
|
+
component?: React.ComponentType<ContentProps>;
|
|
171
|
+
/**
|
|
172
|
+
* @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release. See DSP-2673 for more information.
|
|
173
|
+
*/
|
|
174
|
+
cssFn?: (defaultStyles: CSSObject) => CSSObject;
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
export declare type SidebarCSSProps = Omit<SidebarProps, 'cssFn'>;
|
|
179
|
+
|
|
180
|
+
export declare interface SidebarProps extends React.HTMLProps<HTMLDivElement> {
|
|
181
|
+
/**
|
|
182
|
+
* @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release. See DSP-2673 for more information.
|
|
183
|
+
*/
|
|
184
|
+
cssFn: (defaultStyles: CSSObject) => CSSObject;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export declare type Widths = {
|
|
188
|
+
extended: string;
|
|
189
|
+
full: string;
|
|
190
|
+
medium: number;
|
|
191
|
+
narrow: number;
|
|
192
|
+
wide: number;
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
export {};
|
|
196
|
+
```
|