@atlaskit/drawer 7.5.1 → 7.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/components/blanket.js +6 -3
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/primitives/content.js +1 -1
- package/dist/cjs/components/primitives/drawer-wrapper.js +18 -19
- package/dist/cjs/components/primitives/sidebar.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/blanket.js +7 -4
- package/dist/es2019/components/index.js +1 -1
- package/dist/es2019/components/primitives/content.js +1 -1
- package/dist/es2019/components/primitives/drawer-wrapper.js +17 -21
- package/dist/es2019/components/primitives/sidebar.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/blanket.js +7 -4
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/primitives/content.js +1 -1
- package/dist/esm/components/primitives/drawer-wrapper.js +17 -21
- package/dist/esm/components/primitives/sidebar.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/components/index.d.ts +2 -2
- package/dist/types-ts4.5/components/blanket.d.ts +13 -0
- package/dist/types-ts4.5/components/index.d.ts +31 -0
- package/dist/types-ts4.5/components/primitives/content.d.ts +8 -0
- package/dist/types-ts4.5/components/primitives/drawer-wrapper.d.ts +26 -0
- package/dist/types-ts4.5/components/primitives/focus-lock.d.ts +11 -0
- package/dist/types-ts4.5/components/primitives/hooks/use-prevent-programmatic-scroll.d.ts +9 -0
- package/dist/types-ts4.5/components/primitives/icon-button.d.ts +9 -0
- package/dist/types-ts4.5/components/primitives/index.d.ts +5 -0
- package/dist/types-ts4.5/components/primitives/sidebar.d.ts +9 -0
- package/dist/types-ts4.5/components/types.d.ts +147 -0
- package/dist/types-ts4.5/components/utils.d.ts +7 -0
- package/dist/types-ts4.5/constants.d.ts +7 -0
- package/dist/types-ts4.5/index.d.ts +2 -0
- package/package.json +7 -8
- package/tmp/api-report-tmp.d.ts +141 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/drawer
|
|
2
2
|
|
|
3
|
+
## 7.5.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`779727e307a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/779727e307a) - Internal change only. Replace all instances of Box with stable @atlaskit/primitives version.
|
|
8
|
+
|
|
9
|
+
## 7.5.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
|
|
14
|
+
|
|
3
15
|
## 7.5.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -8,11 +8,14 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _react2 = require("@emotion/react");
|
|
10
10
|
var _blanket = _interopRequireDefault(require("@atlaskit/blanket"));
|
|
11
|
-
var _box = _interopRequireDefault(require("@atlaskit/ds-explorations/box"));
|
|
12
11
|
var _motion = require("@atlaskit/motion");
|
|
13
12
|
var _constants = require("../constants");
|
|
14
13
|
/** @jsx jsx */
|
|
15
14
|
|
|
15
|
+
var blanketStyles = (0, _react2.css)({
|
|
16
|
+
position: 'relative'
|
|
17
|
+
});
|
|
18
|
+
|
|
16
19
|
/**
|
|
17
20
|
* A wrapper around `@atlaskit/blanket` that adds a fade in/out transition.
|
|
18
21
|
*/
|
|
@@ -39,8 +42,8 @@ var Blanket = function Blanket(_ref) {
|
|
|
39
42
|
animationTimingFunction: _constants.animationTimingFunction
|
|
40
43
|
}, function (_ref2) {
|
|
41
44
|
var className = _ref2.className;
|
|
42
|
-
return (0, _react2.jsx)(
|
|
43
|
-
|
|
45
|
+
return (0, _react2.jsx)("div", {
|
|
46
|
+
css: blanketStyles,
|
|
44
47
|
className: className
|
|
45
48
|
}, (0, _react2.jsx)(_blanket.default, {
|
|
46
49
|
isTinted: true,
|
|
@@ -27,7 +27,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
27
27
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
28
28
|
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; } } /* eslint-disable @repo/internal/dom-events/no-unsafe-event-listeners */
|
|
29
29
|
var packageName = "@atlaskit/drawer";
|
|
30
|
-
var packageVersion = "7.5.
|
|
30
|
+
var packageVersion = "7.5.3";
|
|
31
31
|
var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
|
|
32
32
|
var createAndFireOnClick = function createAndFireOnClick(createAnalyticsEvent, trigger) {
|
|
33
33
|
return createAndFireEventOnAtlaskit({
|
|
@@ -29,7 +29,7 @@ var Content = function Content(_ref) {
|
|
|
29
29
|
* a complete override with no chance of partially changing styles.
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
|
-
// eslint-disable-next-line @
|
|
32
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @repo/internal/react/no-unsafe-spread-props
|
|
33
33
|
(0, _react.jsx)("div", (0, _extends2.default)({
|
|
34
34
|
css: (0, _react.css)(cssFn(defaultStyles))
|
|
35
35
|
}, props))
|
|
@@ -5,15 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.wrapperWidth = exports.default = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
8
|
var _react = require("react");
|
|
10
9
|
var _react2 = require("@emotion/react");
|
|
11
10
|
var _useCallbackRef = require("use-callback-ref");
|
|
12
|
-
var
|
|
13
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
11
|
+
var _colors = require("@atlaskit/theme/colors");
|
|
14
12
|
var _usePreventProgrammaticScroll = _interopRequireDefault(require("./hooks/use-prevent-programmatic-scroll"));
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
/** @jsx jsx */
|
|
14
|
+
|
|
17
15
|
var wrapperWidth = {
|
|
18
16
|
full: {
|
|
19
17
|
width: '100vw'
|
|
@@ -22,21 +20,26 @@ var wrapperWidth = {
|
|
|
22
20
|
width: '95vw'
|
|
23
21
|
},
|
|
24
22
|
narrow: {
|
|
25
|
-
width:
|
|
23
|
+
width: 360
|
|
26
24
|
},
|
|
27
25
|
medium: {
|
|
28
|
-
width:
|
|
26
|
+
width: 480
|
|
29
27
|
},
|
|
30
28
|
wide: {
|
|
31
|
-
width:
|
|
29
|
+
width: 600
|
|
32
30
|
}
|
|
33
31
|
};
|
|
34
32
|
exports.wrapperWidth = wrapperWidth;
|
|
35
|
-
var wrapperStyles = {
|
|
33
|
+
var wrapperStyles = (0, _react2.css)({
|
|
34
|
+
display: 'flex',
|
|
35
|
+
height: '100vh',
|
|
36
|
+
position: 'fixed',
|
|
37
|
+
zIndex: 500,
|
|
36
38
|
top: 0,
|
|
37
39
|
left: 0,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
backgroundColor: "var(--ds-surface-overlay, ".concat(_colors.N0, ")"),
|
|
41
|
+
overflow: 'hidden'
|
|
42
|
+
});
|
|
40
43
|
/**
|
|
41
44
|
* A wrapper that controls the styling of the drawer with a few hacks with refs to get our Touch±Scroll locks working.
|
|
42
45
|
*/
|
|
@@ -63,15 +66,11 @@ var DrawerWrapper = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, scrollRe
|
|
|
63
66
|
}, [scrollRef]);
|
|
64
67
|
var ref = (0, _useCallbackRef.useMergeRefs)([drawerRef, assignSecondChildRef]);
|
|
65
68
|
(0, _usePreventProgrammaticScroll.default)();
|
|
66
|
-
return (0, _react2.jsx)(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
backgroundColor: "elevation.surface.overlay",
|
|
70
|
-
overflow: "hidden",
|
|
71
|
-
layer: "blanket",
|
|
72
|
-
UNSAFE_style: _objectSpread(_objectSpread({}, wrapperStyles), wrapperWidth[width]),
|
|
69
|
+
return (0, _react2.jsx)("div", {
|
|
70
|
+
css: wrapperStyles,
|
|
71
|
+
style: wrapperWidth[width],
|
|
73
72
|
className: className,
|
|
74
|
-
|
|
73
|
+
"data-testid": testId,
|
|
75
74
|
ref: ref
|
|
76
75
|
}, children);
|
|
77
76
|
});
|
|
@@ -29,7 +29,7 @@ var sidebarCSS = function sidebarCSS() {
|
|
|
29
29
|
var Sidebar = function Sidebar(_ref) {
|
|
30
30
|
var cssFn = _ref.cssFn,
|
|
31
31
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
32
|
-
// eslint-disable-next-line @
|
|
32
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @repo/internal/react/no-unsafe-spread-props
|
|
33
33
|
return (0, _react.jsx)("div", (0, _extends2.default)({
|
|
34
34
|
css: (0, _react.css)(cssFn(defaultStyle))
|
|
35
35
|
}, props));
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import AkBlanket from '@atlaskit/blanket';
|
|
5
|
-
import Box from '@atlaskit/ds-explorations/box';
|
|
6
5
|
import { ExitingPersistence, FadeIn } from '@atlaskit/motion';
|
|
7
6
|
import { animationTimingFunction, transitionDurationMs } from '../constants';
|
|
7
|
+
const blanketStyles = css({
|
|
8
|
+
position: 'relative'
|
|
9
|
+
});
|
|
10
|
+
|
|
8
11
|
/**
|
|
9
12
|
* A wrapper around `@atlaskit/blanket` that adds a fade in/out transition.
|
|
10
13
|
*/
|
|
@@ -32,8 +35,8 @@ const Blanket = ({
|
|
|
32
35
|
animationTimingFunction: animationTimingFunction
|
|
33
36
|
}, ({
|
|
34
37
|
className
|
|
35
|
-
}) => jsx(
|
|
36
|
-
|
|
38
|
+
}) => jsx("div", {
|
|
39
|
+
css: blanketStyles,
|
|
37
40
|
className: className
|
|
38
41
|
}, jsx(AkBlanket, {
|
|
39
42
|
isTinted: true,
|
|
@@ -8,7 +8,7 @@ import { defaultFocusLockSettings } from '../constants';
|
|
|
8
8
|
import Blanket from './blanket';
|
|
9
9
|
import DrawerPrimitive from './primitives';
|
|
10
10
|
const packageName = "@atlaskit/drawer";
|
|
11
|
-
const packageVersion = "7.5.
|
|
11
|
+
const packageVersion = "7.5.3";
|
|
12
12
|
const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
13
13
|
const createAndFireOnClick = (createAnalyticsEvent, trigger) => createAndFireEventOnAtlaskit({
|
|
14
14
|
action: 'dismissed',
|
|
@@ -19,7 +19,7 @@ const Content = ({
|
|
|
19
19
|
* a complete override with no chance of partially changing styles.
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
// eslint-disable-next-line @
|
|
22
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @repo/internal/react/no-unsafe-spread-props
|
|
23
23
|
jsx("div", _extends({
|
|
24
24
|
css: css(cssFn(defaultStyles))
|
|
25
25
|
}, props));
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
|
|
3
3
|
import { forwardRef, useCallback } from 'react';
|
|
4
|
-
import { jsx } from '@emotion/react';
|
|
4
|
+
import { css, jsx } from '@emotion/react';
|
|
5
5
|
import { useMergeRefs } from 'use-callback-ref';
|
|
6
|
-
import
|
|
7
|
-
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
8
|
-
import { gridSize } from '@atlaskit/theme/constants';
|
|
6
|
+
import { N0 } from '@atlaskit/theme/colors';
|
|
9
7
|
import usePreventProgrammaticScroll from './hooks/use-prevent-programmatic-scroll';
|
|
10
8
|
export const wrapperWidth = {
|
|
11
9
|
full: {
|
|
@@ -15,20 +13,25 @@ export const wrapperWidth = {
|
|
|
15
13
|
width: '95vw'
|
|
16
14
|
},
|
|
17
15
|
narrow: {
|
|
18
|
-
width:
|
|
16
|
+
width: 360
|
|
19
17
|
},
|
|
20
18
|
medium: {
|
|
21
|
-
width:
|
|
19
|
+
width: 480
|
|
22
20
|
},
|
|
23
21
|
wide: {
|
|
24
|
-
width:
|
|
22
|
+
width: 600
|
|
25
23
|
}
|
|
26
24
|
};
|
|
27
|
-
const wrapperStyles = {
|
|
25
|
+
const wrapperStyles = css({
|
|
26
|
+
display: 'flex',
|
|
27
|
+
height: '100vh',
|
|
28
|
+
position: 'fixed',
|
|
29
|
+
zIndex: 500,
|
|
28
30
|
top: 0,
|
|
29
31
|
left: 0,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
backgroundColor: `var(--ds-surface-overlay, ${N0})`,
|
|
33
|
+
overflow: 'hidden'
|
|
34
|
+
});
|
|
32
35
|
/**
|
|
33
36
|
* A wrapper that controls the styling of the drawer with a few hacks with refs to get our Touch±Scroll locks working.
|
|
34
37
|
*/
|
|
@@ -55,18 +58,11 @@ const DrawerWrapper = /*#__PURE__*/forwardRef(({
|
|
|
55
58
|
}, [scrollRef]);
|
|
56
59
|
const ref = useMergeRefs([drawerRef, assignSecondChildRef]);
|
|
57
60
|
usePreventProgrammaticScroll();
|
|
58
|
-
return jsx(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
backgroundColor: "elevation.surface.overlay",
|
|
62
|
-
overflow: "hidden",
|
|
63
|
-
layer: "blanket",
|
|
64
|
-
UNSAFE_style: {
|
|
65
|
-
...wrapperStyles,
|
|
66
|
-
...wrapperWidth[width]
|
|
67
|
-
},
|
|
61
|
+
return jsx("div", {
|
|
62
|
+
css: wrapperStyles,
|
|
63
|
+
style: wrapperWidth[width],
|
|
68
64
|
className: className,
|
|
69
|
-
|
|
65
|
+
"data-testid": testId,
|
|
70
66
|
ref: ref
|
|
71
67
|
}, children);
|
|
72
68
|
});
|
|
@@ -20,7 +20,7 @@ const Sidebar = ({
|
|
|
20
20
|
cssFn,
|
|
21
21
|
...props
|
|
22
22
|
}) => {
|
|
23
|
-
// eslint-disable-next-line @
|
|
23
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @repo/internal/react/no-unsafe-spread-props
|
|
24
24
|
return jsx("div", _extends({
|
|
25
25
|
css: css(cssFn(defaultStyle))
|
|
26
26
|
}, props));
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import AkBlanket from '@atlaskit/blanket';
|
|
5
|
-
import Box from '@atlaskit/ds-explorations/box';
|
|
6
5
|
import { ExitingPersistence, FadeIn } from '@atlaskit/motion';
|
|
7
6
|
import { animationTimingFunction, transitionDurationMs } from '../constants';
|
|
7
|
+
var blanketStyles = css({
|
|
8
|
+
position: 'relative'
|
|
9
|
+
});
|
|
10
|
+
|
|
8
11
|
/**
|
|
9
12
|
* A wrapper around `@atlaskit/blanket` that adds a fade in/out transition.
|
|
10
13
|
*/
|
|
@@ -31,8 +34,8 @@ var Blanket = function Blanket(_ref) {
|
|
|
31
34
|
animationTimingFunction: animationTimingFunction
|
|
32
35
|
}, function (_ref2) {
|
|
33
36
|
var className = _ref2.className;
|
|
34
|
-
return jsx(
|
|
35
|
-
|
|
37
|
+
return jsx("div", {
|
|
38
|
+
css: blanketStyles,
|
|
36
39
|
className: className
|
|
37
40
|
}, jsx(AkBlanket, {
|
|
38
41
|
isTinted: true,
|
|
@@ -18,7 +18,7 @@ import { defaultFocusLockSettings } from '../constants';
|
|
|
18
18
|
import Blanket from './blanket';
|
|
19
19
|
import DrawerPrimitive from './primitives';
|
|
20
20
|
var packageName = "@atlaskit/drawer";
|
|
21
|
-
var packageVersion = "7.5.
|
|
21
|
+
var packageVersion = "7.5.3";
|
|
22
22
|
var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
23
23
|
var createAndFireOnClick = function createAndFireOnClick(createAnalyticsEvent, trigger) {
|
|
24
24
|
return createAndFireEventOnAtlaskit({
|
|
@@ -23,7 +23,7 @@ var Content = function Content(_ref) {
|
|
|
23
23
|
* a complete override with no chance of partially changing styles.
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
// eslint-disable-next-line @
|
|
26
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @repo/internal/react/no-unsafe-spread-props
|
|
27
27
|
jsx("div", _extends({
|
|
28
28
|
css: css(cssFn(defaultStyles))
|
|
29
29
|
}, props))
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
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; }
|
|
3
|
-
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) { _defineProperty(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; }
|
|
4
1
|
/** @jsx jsx */
|
|
5
2
|
|
|
6
3
|
import { forwardRef, useCallback } from 'react';
|
|
7
|
-
import { jsx } from '@emotion/react';
|
|
4
|
+
import { css, jsx } from '@emotion/react';
|
|
8
5
|
import { useMergeRefs } from 'use-callback-ref';
|
|
9
|
-
import
|
|
10
|
-
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
11
|
-
import { gridSize } from '@atlaskit/theme/constants';
|
|
6
|
+
import { N0 } from '@atlaskit/theme/colors';
|
|
12
7
|
import usePreventProgrammaticScroll from './hooks/use-prevent-programmatic-scroll';
|
|
13
8
|
export var wrapperWidth = {
|
|
14
9
|
full: {
|
|
@@ -18,20 +13,25 @@ export var wrapperWidth = {
|
|
|
18
13
|
width: '95vw'
|
|
19
14
|
},
|
|
20
15
|
narrow: {
|
|
21
|
-
width:
|
|
16
|
+
width: 360
|
|
22
17
|
},
|
|
23
18
|
medium: {
|
|
24
|
-
width:
|
|
19
|
+
width: 480
|
|
25
20
|
},
|
|
26
21
|
wide: {
|
|
27
|
-
width:
|
|
22
|
+
width: 600
|
|
28
23
|
}
|
|
29
24
|
};
|
|
30
|
-
var wrapperStyles = {
|
|
25
|
+
var wrapperStyles = css({
|
|
26
|
+
display: 'flex',
|
|
27
|
+
height: '100vh',
|
|
28
|
+
position: 'fixed',
|
|
29
|
+
zIndex: 500,
|
|
31
30
|
top: 0,
|
|
32
31
|
left: 0,
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
backgroundColor: "var(--ds-surface-overlay, ".concat(N0, ")"),
|
|
33
|
+
overflow: 'hidden'
|
|
34
|
+
});
|
|
35
35
|
/**
|
|
36
36
|
* A wrapper that controls the styling of the drawer with a few hacks with refs to get our Touch±Scroll locks working.
|
|
37
37
|
*/
|
|
@@ -58,15 +58,11 @@ var DrawerWrapper = /*#__PURE__*/forwardRef(function (_ref, scrollRef) {
|
|
|
58
58
|
}, [scrollRef]);
|
|
59
59
|
var ref = useMergeRefs([drawerRef, assignSecondChildRef]);
|
|
60
60
|
usePreventProgrammaticScroll();
|
|
61
|
-
return jsx(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
backgroundColor: "elevation.surface.overlay",
|
|
65
|
-
overflow: "hidden",
|
|
66
|
-
layer: "blanket",
|
|
67
|
-
UNSAFE_style: _objectSpread(_objectSpread({}, wrapperStyles), wrapperWidth[width]),
|
|
61
|
+
return jsx("div", {
|
|
62
|
+
css: wrapperStyles,
|
|
63
|
+
style: wrapperWidth[width],
|
|
68
64
|
className: className,
|
|
69
|
-
|
|
65
|
+
"data-testid": testId,
|
|
70
66
|
ref: ref
|
|
71
67
|
}, children);
|
|
72
68
|
});
|
|
@@ -23,7 +23,7 @@ var sidebarCSS = function sidebarCSS() {
|
|
|
23
23
|
var Sidebar = function Sidebar(_ref) {
|
|
24
24
|
var cssFn = _ref.cssFn,
|
|
25
25
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
26
|
-
// eslint-disable-next-line @
|
|
26
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @repo/internal/react/no-unsafe-spread-props
|
|
27
27
|
return jsx("div", _extends({
|
|
28
28
|
css: css(cssFn(defaultStyle))
|
|
29
29
|
}, props));
|
package/dist/esm/version.json
CHANGED
|
@@ -22,10 +22,10 @@ export declare class DrawerBase extends Component<DrawerProps, {
|
|
|
22
22
|
handleKeyDown: (event: KeyboardEvent) => void;
|
|
23
23
|
render(): JSX.Element | null;
|
|
24
24
|
}
|
|
25
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DrawerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "children" | "onKeyDown" | "onClose" | "testId" | "icon" | "onOpenComplete" | "onCloseComplete" | "shouldUnmountOnExit" | "overrides" | "
|
|
25
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DrawerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "children" | "onKeyDown" | "onClose" | "testId" | "icon" | "onOpenComplete" | "onCloseComplete" | "shouldUnmountOnExit" | "overrides" | "zIndex" | "isOpen"> & Partial<Pick<Omit<DrawerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "width" | keyof import("./types").FocusLockSettings>> & Partial<Pick<{
|
|
26
26
|
autoFocusFirstElem?: boolean | (() => HTMLElement | null) | undefined;
|
|
27
27
|
isFocusLockEnabled?: boolean | undefined;
|
|
28
28
|
shouldReturnFocus?: boolean | undefined;
|
|
29
29
|
width: DrawerWidth;
|
|
30
|
-
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "width" | "children" | "onKeyDown" | "key" | "onClose" | "testId" | "icon" | "onOpenComplete" | "onCloseComplete" | "shouldUnmountOnExit" | "overrides" | "
|
|
30
|
+
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "width" | "children" | "onKeyDown" | "key" | "onClose" | "testId" | "icon" | "onOpenComplete" | "onCloseComplete" | "shouldUnmountOnExit" | "overrides" | "zIndex" | "isOpen" | "analyticsContext" | keyof import("./types").FocusLockSettings> & React.RefAttributes<any>>;
|
|
31
31
|
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
type BlanketProps = {
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
onBlanketClicked: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
7
|
+
testId?: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* A wrapper around `@atlaskit/blanket` that adds a fade in/out transition.
|
|
11
|
+
*/
|
|
12
|
+
declare const Blanket: ({ isOpen, onBlanketClicked, testId }: BlanketProps) => jsx.JSX.Element;
|
|
13
|
+
export default Blanket;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { DrawerProps, DrawerWidth } from './types';
|
|
3
|
+
export declare class DrawerBase extends Component<DrawerProps, {
|
|
4
|
+
renderPortal: boolean;
|
|
5
|
+
}> {
|
|
6
|
+
static defaultProps: {
|
|
7
|
+
autoFocusFirstElem?: boolean | (() => HTMLElement | null) | undefined;
|
|
8
|
+
isFocusLockEnabled?: boolean | undefined;
|
|
9
|
+
shouldReturnFocus?: boolean | undefined;
|
|
10
|
+
width: DrawerWidth;
|
|
11
|
+
};
|
|
12
|
+
state: {
|
|
13
|
+
renderPortal: boolean;
|
|
14
|
+
};
|
|
15
|
+
body: HTMLBodyElement | null | undefined;
|
|
16
|
+
componentDidMount(): void;
|
|
17
|
+
componentWillUnmount(): void;
|
|
18
|
+
componentDidUpdate(prevProps: DrawerProps): void;
|
|
19
|
+
private handleBlanketClick;
|
|
20
|
+
private handleBackButtonClick;
|
|
21
|
+
private handleClose;
|
|
22
|
+
handleKeyDown: (event: KeyboardEvent) => void;
|
|
23
|
+
render(): JSX.Element | null;
|
|
24
|
+
}
|
|
25
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DrawerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "children" | "onKeyDown" | "onClose" | "testId" | "icon" | "onOpenComplete" | "onCloseComplete" | "shouldUnmountOnExit" | "overrides" | "zIndex" | "isOpen"> & Partial<Pick<Omit<DrawerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "width" | keyof import("./types").FocusLockSettings>> & Partial<Pick<{
|
|
26
|
+
autoFocusFirstElem?: boolean | (() => HTMLElement | null) | undefined;
|
|
27
|
+
isFocusLockEnabled?: boolean | undefined;
|
|
28
|
+
shouldReturnFocus?: boolean | undefined;
|
|
29
|
+
width: DrawerWidth;
|
|
30
|
+
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "width" | "children" | "onKeyDown" | "key" | "onClose" | "testId" | "icon" | "onOpenComplete" | "onCloseComplete" | "shouldUnmountOnExit" | "overrides" | "zIndex" | "isOpen" | "analyticsContext" | keyof import("./types").FocusLockSettings> & React.RefAttributes<any>>;
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { ReactElement, Ref } from 'react';
|
|
3
|
+
import { DrawerPrimitiveProps, Widths } from '../types';
|
|
4
|
+
export declare const wrapperWidth: Widths;
|
|
5
|
+
interface FocusLockRefTargetProps extends Pick<DrawerPrimitiveProps, 'width' | 'testId'> {
|
|
6
|
+
/**
|
|
7
|
+
* This must have two children explicitly as we target the second child as the Content.
|
|
8
|
+
*/
|
|
9
|
+
children: [
|
|
10
|
+
ReactElement,
|
|
11
|
+
ReactElement
|
|
12
|
+
];
|
|
13
|
+
/**
|
|
14
|
+
* A ref pointing to our drawer wrapper, passed to `onCloseComplete` and `onOpenComplete` callbacks.
|
|
15
|
+
*/
|
|
16
|
+
drawerRef: Ref<HTMLDivElement>;
|
|
17
|
+
/**
|
|
18
|
+
* The className coming from the SlideIn render callback.
|
|
19
|
+
*/
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A wrapper that controls the styling of the drawer with a few hacks with refs to get our Touch±Scroll locks working.
|
|
24
|
+
*/
|
|
25
|
+
declare const DrawerWrapper: import("react").ForwardRefExoticComponent<FocusLockRefTargetProps & import("react").RefAttributes<HTMLElement>>;
|
|
26
|
+
export default DrawerWrapper;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import { FocusLockProps } from '../types';
|
|
3
|
+
export default class FocusLock extends Component<FocusLockProps> {
|
|
4
|
+
static defaultProps: {
|
|
5
|
+
autoFocusFirstElem?: boolean | (() => HTMLElement | null) | undefined;
|
|
6
|
+
isFocusLockEnabled?: boolean | undefined;
|
|
7
|
+
shouldReturnFocus?: boolean | undefined;
|
|
8
|
+
};
|
|
9
|
+
componentDidMount(): void;
|
|
10
|
+
render(): JSX.Element;
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prevents programmatic scrolling of the viewport with `scrollIntoView`.
|
|
3
|
+
* Should be used in conjunction with a scroll lock to prevent a user from scrolling.
|
|
4
|
+
*
|
|
5
|
+
* ⚠️ This is copied from `packages/design-system/modal-dialog/src/internal/hooks/use-prevent-programmatic-scroll.tsx`
|
|
6
|
+
*
|
|
7
|
+
* @returns scroll top offset of the viewport
|
|
8
|
+
*/
|
|
9
|
+
export default function usePreventProgrammaticScroll(): number;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { FC, MouseEventHandler, ReactNode } from 'react';
|
|
3
|
+
interface IconButtonProps {
|
|
4
|
+
testId?: string;
|
|
5
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare const IconButton: FC<IconButtonProps>;
|
|
9
|
+
export default IconButton;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import { DrawerPrimitiveProps } from '../types';
|
|
4
|
+
declare const DrawerPrimitive: ({ children, icon: Icon, onClose, onCloseComplete, onOpenComplete, overrides, testId, in: isOpen, shouldReturnFocus, autoFocusFirstElem, isFocusLockEnabled, width, }: DrawerPrimitiveProps) => jsx.JSX.Element;
|
|
5
|
+
export default DrawerPrimitive;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { ComponentType, ReactElement, ReactNode, SyntheticEvent } from 'react';
|
|
2
|
+
import { CSSObject } from '@emotion/react';
|
|
3
|
+
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
4
|
+
export type Widths = {
|
|
5
|
+
extended: {
|
|
6
|
+
width: string;
|
|
7
|
+
};
|
|
8
|
+
full: {
|
|
9
|
+
width: string;
|
|
10
|
+
};
|
|
11
|
+
medium: {
|
|
12
|
+
width: number;
|
|
13
|
+
};
|
|
14
|
+
narrow: {
|
|
15
|
+
width: number;
|
|
16
|
+
};
|
|
17
|
+
wide: {
|
|
18
|
+
width: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export type DrawerWidth = 'extended' | 'full' | 'medium' | 'narrow' | 'wide';
|
|
22
|
+
export interface BaseProps {
|
|
23
|
+
/**
|
|
24
|
+
* A unique hook to be used for testing.
|
|
25
|
+
*/
|
|
26
|
+
testId?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The content of the drawer.
|
|
29
|
+
*/
|
|
30
|
+
children?: ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* Icon to be rendered in your drawer as a component, if available.
|
|
33
|
+
*/
|
|
34
|
+
icon?: ComponentType<any>;
|
|
35
|
+
/**
|
|
36
|
+
* Available drawer sizes.
|
|
37
|
+
*/
|
|
38
|
+
width?: DrawerWidth;
|
|
39
|
+
/**
|
|
40
|
+
* A callback function that will be called when the drawer has finished its opening transition.
|
|
41
|
+
*/
|
|
42
|
+
onOpenComplete?: (node: HTMLElement | null) => void;
|
|
43
|
+
/**
|
|
44
|
+
* A callback function that will be called when the drawer has finished its close transition.
|
|
45
|
+
*/
|
|
46
|
+
onCloseComplete?: (node: HTMLElement | null) => void;
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release.
|
|
49
|
+
* Boolean that controls if drawer should be retained/discarded
|
|
50
|
+
*/
|
|
51
|
+
shouldUnmountOnExit?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Override drawer components.
|
|
54
|
+
*/
|
|
55
|
+
overrides?: OverridesType;
|
|
56
|
+
}
|
|
57
|
+
export type DefaultsType = {
|
|
58
|
+
Sidebar: {
|
|
59
|
+
component: React.ComponentType<SidebarProps>;
|
|
60
|
+
cssFn: (defaultStyles: CSSObject) => CSSObject;
|
|
61
|
+
};
|
|
62
|
+
Content: {
|
|
63
|
+
component: React.ComponentType<ContentProps>;
|
|
64
|
+
cssFn: (defaultStyles: CSSObject) => CSSObject;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
export type OverridesType = {
|
|
68
|
+
Sidebar?: {
|
|
69
|
+
component?: React.ComponentType<SidebarProps>;
|
|
70
|
+
/**
|
|
71
|
+
* @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release. See DSP-2673 for more information.
|
|
72
|
+
*/
|
|
73
|
+
cssFn?: (defaultStyles: CSSObject) => CSSObject;
|
|
74
|
+
};
|
|
75
|
+
Content?: {
|
|
76
|
+
component?: React.ComponentType<ContentProps>;
|
|
77
|
+
/**
|
|
78
|
+
* @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release. See DSP-2673 for more information.
|
|
79
|
+
*/
|
|
80
|
+
cssFn?: (defaultStyles: CSSObject) => CSSObject;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
export type DrawerPrimitiveDefaults = Pick<DefaultsType, 'Sidebar' | 'Content'>;
|
|
84
|
+
export type DrawerPrimitiveOverrides = Pick<OverridesType, 'Sidebar' | 'Content'>;
|
|
85
|
+
export interface SidebarProps extends React.HTMLProps<HTMLDivElement> {
|
|
86
|
+
/**
|
|
87
|
+
* @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release. See DSP-2673 for more information.
|
|
88
|
+
*/
|
|
89
|
+
cssFn: (defaultStyles: CSSObject) => CSSObject;
|
|
90
|
+
}
|
|
91
|
+
export type SidebarCSSProps = Omit<SidebarProps, 'cssFn'>;
|
|
92
|
+
export interface ContentProps extends React.HTMLProps<HTMLDivElement> {
|
|
93
|
+
/**
|
|
94
|
+
* @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release. See DSP-2673 for more information.
|
|
95
|
+
*/
|
|
96
|
+
cssFn: (defaultStyles: CSSObject) => CSSObject;
|
|
97
|
+
}
|
|
98
|
+
export type ContentCSSProps = Omit<ContentProps, 'cssFn'>;
|
|
99
|
+
export interface DrawerPrimitiveProps extends BaseProps, FocusLockSettings {
|
|
100
|
+
in: boolean;
|
|
101
|
+
onClose: (event: SyntheticEvent<HTMLElement>) => void;
|
|
102
|
+
}
|
|
103
|
+
export type DrawerProps = BaseProps & FocusLockSettings & WithAnalyticsEventsProps & {
|
|
104
|
+
/**
|
|
105
|
+
* Callback function called while the drawer is displayed and `keydown` event is triggered.
|
|
106
|
+
*/
|
|
107
|
+
onKeyDown?: (event: SyntheticEvent) => void;
|
|
108
|
+
/**
|
|
109
|
+
* Callback function called when the drawer is closed.
|
|
110
|
+
*/
|
|
111
|
+
onClose?: (event: SyntheticEvent<HTMLElement>, analyticsEvent: any) => void;
|
|
112
|
+
/**
|
|
113
|
+
* Controls if the drawer is open or closed.
|
|
114
|
+
*/
|
|
115
|
+
isOpen: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Z-index that the popup should be displayed in.
|
|
118
|
+
* This is passed to the portal component.
|
|
119
|
+
* Defaults to `unset`.
|
|
120
|
+
*/
|
|
121
|
+
zIndex?: number;
|
|
122
|
+
};
|
|
123
|
+
export interface FocusLockSettings {
|
|
124
|
+
/**
|
|
125
|
+
* Controls whether to focus the first tabbable element inside the focus lock.
|
|
126
|
+
*/
|
|
127
|
+
autoFocusFirstElem?: boolean | (() => HTMLElement | null);
|
|
128
|
+
/**
|
|
129
|
+
* Whether the focus lock is active or not.
|
|
130
|
+
*/
|
|
131
|
+
isFocusLockEnabled?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Whether to return the focus to the previous active element on closing the drawer.
|
|
134
|
+
*/
|
|
135
|
+
shouldReturnFocus?: boolean;
|
|
136
|
+
}
|
|
137
|
+
export interface FocusLockProps extends FocusLockSettings {
|
|
138
|
+
/**
|
|
139
|
+
* Content inside the focus lock.
|
|
140
|
+
* Must strictly be a ReactElement and it *must* be implemented to take a `ref` passed from `react-scrolllock` to enable Touch Scrolling.
|
|
141
|
+
*/
|
|
142
|
+
children?: ReactElement;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Type of keyboard event that triggers which key will should close the drawer.
|
|
146
|
+
*/
|
|
147
|
+
export type CloseTrigger = 'backButton' | 'blanket' | 'escKey';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type OverridesFunc<X extends Record<string, any>, Y extends Record<string, any>> = (key: string) => Record<string, any>;
|
|
2
|
+
export type ExtenderType = <D extends Record<string, any>, O extends Record<string, any>>(d: D, o?: O) => OverridesFunc<D, O>;
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Please avoid using this function as we intend to remote it in a future release. See DSP-2673 for more information.
|
|
5
|
+
*/
|
|
6
|
+
export declare const createExtender: ExtenderType;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DrawerWidth, FocusLockSettings } from './components/types';
|
|
2
|
+
export declare const transitionDuration = "0.22s";
|
|
3
|
+
export declare const transitionDurationMs = 220;
|
|
4
|
+
export declare const transitionTimingFunction: import("@atlaskit/motion/curves").AnimationCurve;
|
|
5
|
+
export declare const widths: DrawerWidth[];
|
|
6
|
+
export declare const animationTimingFunction: () => import("@atlaskit/motion/curves").AnimationCurve;
|
|
7
|
+
export declare const defaultFocusLockSettings: FocusLockSettings;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { default } from './components';
|
|
2
|
+
export type { BaseProps, CloseTrigger, ContentCSSProps, ContentProps, DefaultsType, DrawerPrimitiveDefaults, DrawerPrimitiveOverrides, DrawerPrimitiveProps, DrawerProps, DrawerWidth, FocusLockProps, OverridesType, SidebarCSSProps, SidebarProps, Widths, } from './components/types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/drawer",
|
|
3
|
-
"version": "7.5.
|
|
3
|
+
"version": "7.5.3",
|
|
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/"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"atlassian": {
|
|
27
27
|
"team": "Design System Team",
|
|
28
28
|
"deprecatedAutoEntryPoints": true,
|
|
29
|
-
"releaseModel": "
|
|
29
|
+
"releaseModel": "continuous",
|
|
30
30
|
"website": {
|
|
31
31
|
"name": "Drawer",
|
|
32
32
|
"category": "Components"
|
|
@@ -35,12 +35,11 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
37
37
|
"@atlaskit/blanket": "^12.4.0",
|
|
38
|
-
"@atlaskit/ds-explorations": "^2.1.0",
|
|
39
38
|
"@atlaskit/icon": "^21.12.0",
|
|
40
39
|
"@atlaskit/motion": "^1.4.0",
|
|
41
40
|
"@atlaskit/portal": "^4.3.0",
|
|
42
41
|
"@atlaskit/theme": "^12.5.0",
|
|
43
|
-
"@atlaskit/tokens": "^1.
|
|
42
|
+
"@atlaskit/tokens": "^1.5.0",
|
|
44
43
|
"@babel/runtime": "^7.0.0",
|
|
45
44
|
"@emotion/react": "^11.7.1",
|
|
46
45
|
"bind-event-listener": "^2.1.1",
|
|
@@ -58,13 +57,13 @@
|
|
|
58
57
|
"@atlaskit/checkbox": "^12.6.0",
|
|
59
58
|
"@atlaskit/code": "^14.6.0",
|
|
60
59
|
"@atlaskit/docs": "*",
|
|
61
|
-
"@atlaskit/dropdown-menu": "^11.
|
|
60
|
+
"@atlaskit/dropdown-menu": "^11.9.0",
|
|
62
61
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
63
|
-
"@atlaskit/menu": "^1.
|
|
64
|
-
"@atlaskit/modal-dialog": "^12.
|
|
62
|
+
"@atlaskit/menu": "^1.7.0",
|
|
63
|
+
"@atlaskit/modal-dialog": "^12.6.0",
|
|
65
64
|
"@atlaskit/section-message": "^6.4.0",
|
|
66
65
|
"@atlaskit/ssr": "*",
|
|
67
|
-
"@atlaskit/textarea": "^4.
|
|
66
|
+
"@atlaskit/textarea": "^4.7.0",
|
|
68
67
|
"@atlaskit/visual-regression": "*",
|
|
69
68
|
"@atlaskit/webdriver-runner": "*",
|
|
70
69
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
@@ -0,0 +1,141 @@
|
|
|
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
|
+
|
|
7
|
+
import { ComponentType } from 'react';
|
|
8
|
+
import { CSSObject } from '@emotion/react';
|
|
9
|
+
import { default as React_2 } from 'react';
|
|
10
|
+
import { ReactElement } from 'react';
|
|
11
|
+
import { ReactNode } from 'react';
|
|
12
|
+
import { SyntheticEvent } from 'react';
|
|
13
|
+
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
14
|
+
import { WithContextProps } from '@atlaskit/analytics-next';
|
|
15
|
+
|
|
16
|
+
// @public (undocumented)
|
|
17
|
+
export interface BaseProps {
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
icon?: ComponentType<any>;
|
|
20
|
+
onCloseComplete?: (node: HTMLElement | null) => void;
|
|
21
|
+
onOpenComplete?: (node: HTMLElement | null) => void;
|
|
22
|
+
overrides?: OverridesType;
|
|
23
|
+
// @deprecated (undocumented)
|
|
24
|
+
shouldUnmountOnExit?: boolean;
|
|
25
|
+
testId?: string;
|
|
26
|
+
width?: DrawerWidth;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// @public
|
|
30
|
+
export type CloseTrigger = 'backButton' | 'blanket' | 'escKey';
|
|
31
|
+
|
|
32
|
+
// @public (undocumented)
|
|
33
|
+
export type ContentCSSProps = Omit<ContentProps, 'cssFn'>;
|
|
34
|
+
|
|
35
|
+
// @public (undocumented)
|
|
36
|
+
export interface ContentProps extends React.HTMLProps<HTMLDivElement> {
|
|
37
|
+
// @deprecated (undocumented)
|
|
38
|
+
cssFn: (defaultStyles: CSSObject) => CSSObject;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// @public (undocumented)
|
|
42
|
+
const _default: React_2.ForwardRefExoticComponent<Pick<Pick<Omit<DrawerProps, keyof WithAnalyticsEventsProps>, "children" | "icon" | "isOpen" | "onClose" | "onCloseComplete" | "onKeyDown" | "onOpenComplete" | "overrides" | "shouldUnmountOnExit" | "testId" | "zIndex"> & Partial<Pick<Omit<DrawerProps, keyof WithAnalyticsEventsProps>, "width" | keyof FocusLockSettings>> & Partial<Pick<{
|
|
43
|
+
autoFocusFirstElem?: (() => HTMLElement | null) | boolean | undefined;
|
|
44
|
+
isFocusLockEnabled?: boolean | undefined;
|
|
45
|
+
shouldReturnFocus?: boolean | undefined;
|
|
46
|
+
width: DrawerWidth;
|
|
47
|
+
}, never>> & React_2.RefAttributes<any> & WithContextProps, "analyticsContext" | "children" | "icon" | "isOpen" | "key" | "onClose" | "onCloseComplete" | "onKeyDown" | "onOpenComplete" | "overrides" | "shouldUnmountOnExit" | "testId" | "width" | "zIndex" | keyof FocusLockSettings> & React_2.RefAttributes<any>>;
|
|
48
|
+
export default _default;
|
|
49
|
+
|
|
50
|
+
// @public (undocumented)
|
|
51
|
+
export type DefaultsType = {
|
|
52
|
+
Sidebar: {
|
|
53
|
+
component: React.ComponentType<SidebarProps>;
|
|
54
|
+
cssFn: (defaultStyles: CSSObject) => CSSObject;
|
|
55
|
+
};
|
|
56
|
+
Content: {
|
|
57
|
+
component: React.ComponentType<ContentProps>;
|
|
58
|
+
cssFn: (defaultStyles: CSSObject) => CSSObject;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
// @public (undocumented)
|
|
63
|
+
export type DrawerPrimitiveDefaults = Pick<DefaultsType, 'Content' | 'Sidebar'>;
|
|
64
|
+
|
|
65
|
+
// @public (undocumented)
|
|
66
|
+
export type DrawerPrimitiveOverrides = Pick<OverridesType, 'Content' | 'Sidebar'>;
|
|
67
|
+
|
|
68
|
+
// @public (undocumented)
|
|
69
|
+
export interface DrawerPrimitiveProps extends BaseProps, FocusLockSettings {
|
|
70
|
+
// (undocumented)
|
|
71
|
+
in: boolean;
|
|
72
|
+
// (undocumented)
|
|
73
|
+
onClose: (event: SyntheticEvent<HTMLElement>) => void;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// @public (undocumented)
|
|
77
|
+
export type DrawerProps = BaseProps & FocusLockSettings & WithAnalyticsEventsProps & {
|
|
78
|
+
onKeyDown?: (event: SyntheticEvent) => void;
|
|
79
|
+
onClose?: (event: SyntheticEvent<HTMLElement>, analyticsEvent: any) => void;
|
|
80
|
+
isOpen: boolean;
|
|
81
|
+
zIndex?: number;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// @public (undocumented)
|
|
85
|
+
export type DrawerWidth = 'extended' | 'full' | 'medium' | 'narrow' | 'wide';
|
|
86
|
+
|
|
87
|
+
// @public (undocumented)
|
|
88
|
+
export interface FocusLockProps extends FocusLockSettings {
|
|
89
|
+
children?: ReactElement;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// @public (undocumented)
|
|
93
|
+
interface FocusLockSettings {
|
|
94
|
+
autoFocusFirstElem?: (() => HTMLElement | null) | boolean;
|
|
95
|
+
isFocusLockEnabled?: boolean;
|
|
96
|
+
shouldReturnFocus?: boolean;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// @public (undocumented)
|
|
100
|
+
export type OverridesType = {
|
|
101
|
+
Sidebar?: {
|
|
102
|
+
component?: React.ComponentType<SidebarProps>;
|
|
103
|
+
cssFn?: (defaultStyles: CSSObject) => CSSObject;
|
|
104
|
+
};
|
|
105
|
+
Content?: {
|
|
106
|
+
component?: React.ComponentType<ContentProps>;
|
|
107
|
+
cssFn?: (defaultStyles: CSSObject) => CSSObject;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
// @public (undocumented)
|
|
112
|
+
export type SidebarCSSProps = Omit<SidebarProps, 'cssFn'>;
|
|
113
|
+
|
|
114
|
+
// @public (undocumented)
|
|
115
|
+
export interface SidebarProps extends React.HTMLProps<HTMLDivElement> {
|
|
116
|
+
// @deprecated (undocumented)
|
|
117
|
+
cssFn: (defaultStyles: CSSObject) => CSSObject;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// @public (undocumented)
|
|
121
|
+
export type Widths = {
|
|
122
|
+
extended: {
|
|
123
|
+
width: string;
|
|
124
|
+
};
|
|
125
|
+
full: {
|
|
126
|
+
width: string;
|
|
127
|
+
};
|
|
128
|
+
medium: {
|
|
129
|
+
width: number;
|
|
130
|
+
};
|
|
131
|
+
narrow: {
|
|
132
|
+
width: number;
|
|
133
|
+
};
|
|
134
|
+
wide: {
|
|
135
|
+
width: number;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
// (No @packageDocumentation comment for this package)
|
|
140
|
+
|
|
141
|
+
```
|