@atlaskit/drawer 7.4.0 → 7.4.2

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.
Files changed (31) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/components/blanket.js +23 -8
  3. package/dist/cjs/components/index.js +1 -1
  4. package/dist/cjs/components/primitives/drawer-wrapper.js +2 -1
  5. package/dist/cjs/version.json +1 -1
  6. package/dist/es2019/components/blanket.js +17 -5
  7. package/dist/es2019/components/index.js +1 -1
  8. package/dist/es2019/components/primitives/drawer-wrapper.js +1 -1
  9. package/dist/es2019/version.json +1 -1
  10. package/dist/esm/components/blanket.js +17 -5
  11. package/dist/esm/components/index.js +1 -1
  12. package/dist/esm/components/primitives/drawer-wrapper.js +1 -1
  13. package/dist/esm/version.json +1 -1
  14. package/dist/types/components/blanket.d.ts +3 -1
  15. package/dist/types/components/index.d.ts +2 -2
  16. package/dist/types/components/primitives/drawer-wrapper.d.ts +2 -1
  17. package/package.json +3 -13
  18. package/report.api.md +43 -33
  19. package/dist/types-ts4.0/components/blanket.d.ts +0 -11
  20. package/dist/types-ts4.0/components/index.d.ts +0 -31
  21. package/dist/types-ts4.0/components/primitives/content.d.ts +0 -8
  22. package/dist/types-ts4.0/components/primitives/drawer-wrapper.d.ts +0 -25
  23. package/dist/types-ts4.0/components/primitives/focus-lock.d.ts +0 -11
  24. package/dist/types-ts4.0/components/primitives/hooks/use-prevent-programmatic-scroll.d.ts +0 -9
  25. package/dist/types-ts4.0/components/primitives/icon-button.d.ts +0 -8
  26. package/dist/types-ts4.0/components/primitives/index.d.ts +0 -5
  27. package/dist/types-ts4.0/components/primitives/sidebar.d.ts +0 -9
  28. package/dist/types-ts4.0/components/types.d.ts +0 -137
  29. package/dist/types-ts4.0/components/utils.d.ts +0 -7
  30. package/dist/types-ts4.0/constants.d.ts +0 -7
  31. package/dist/types-ts4.0/index.d.ts +0 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/drawer
2
2
 
3
+ ## 7.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`5bd499c254f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5bd499c254f) - Fix zIndex stacking of internal Blanket component during css transition
8
+
9
+ ## 7.4.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 7.4.0
4
16
 
5
17
  ### Minor Changes
@@ -9,22 +9,36 @@ exports.default = void 0;
9
9
 
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
 
12
+ var _react2 = require("@emotion/react");
13
+
12
14
  var _blanket = _interopRequireDefault(require("@atlaskit/blanket"));
13
15
 
14
16
  var _motion = require("@atlaskit/motion");
15
17
 
16
- var _constants = require("../constants");
18
+ var _constants = require("@atlaskit/theme/constants");
19
+
20
+ var _constants2 = require("../constants");
21
+
22
+ /** @jsx jsx */
17
23
 
24
+ /**
25
+ * The FadeIn opacity transition creates a new stacking context so we need ensure layering is the same as @atlaskit/blanket
26
+ */
27
+ var stackingStyles = (0, _react2.css)({
28
+ position: 'relative',
29
+ zIndex: _constants.layers.blanket()
30
+ });
18
31
  /**
19
32
  * A wrapper around `@atlaskit/blanket` that adds a fade in/out transition.
20
33
  */
34
+
21
35
  var Blanket = function Blanket(_ref) {
22
36
  var isOpen = _ref.isOpen,
23
37
  onBlanketClicked = _ref.onBlanketClicked,
24
38
  testId = _ref.testId;
25
- return /*#__PURE__*/_react.default.createElement(_motion.ExitingPersistence, {
39
+ return (0, _react2.jsx)(_motion.ExitingPersistence, {
26
40
  appear: true
27
- }, isOpen && /*#__PURE__*/_react.default.createElement(_motion.FadeIn
41
+ }, isOpen && (0, _react2.jsx)(_motion.FadeIn
28
42
  /**
29
43
  * We double the duration because the fade in keyframes have
30
44
  * `opacity: 1` at `50%`.
@@ -32,19 +46,20 @@ var Blanket = function Blanket(_ref) {
32
46
  * The fade out animation uses half the passed duration so it evens out.
33
47
  */
34
48
  , {
35
- duration: _constants.transitionDurationMs * 2
49
+ duration: _constants2.transitionDurationMs * 2
36
50
  /**
37
51
  * We don't expose this on `FadeIn` but it does get passed down.
38
52
  * TODO: figure out how we want to handle this...
39
53
  */
40
54
  // @ts-ignore
41
55
  ,
42
- animationTimingFunction: _constants.animationTimingFunction
56
+ animationTimingFunction: _constants2.animationTimingFunction
43
57
  }, function (_ref2) {
44
58
  var className = _ref2.className;
45
- return /*#__PURE__*/_react.default.createElement("div", {
46
- className: className
47
- }, /*#__PURE__*/_react.default.createElement(_blanket.default, {
59
+ return (0, _react2.jsx)("div", {
60
+ className: className,
61
+ css: stackingStyles
62
+ }, (0, _react2.jsx)(_blanket.default, {
48
63
  isTinted: true,
49
64
  onBlanketClicked: onBlanketClicked,
50
65
  testId: testId && testId
@@ -50,7 +50,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
50
50
  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; } }
51
51
 
52
52
  var packageName = "@atlaskit/drawer";
53
- var packageVersion = "7.4.0";
53
+ var packageVersion = "7.4.2";
54
54
  var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
55
55
 
56
56
  var createAndFireOnClick = function createAndFireOnClick(createAnalyticsEvent, trigger) {
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = void 0;
8
+ exports.widths = exports.default = void 0;
9
9
 
10
10
  var _react = require("react");
11
11
 
@@ -27,6 +27,7 @@ var widths = {
27
27
  medium: 60 * (0, _constants.gridSize)(),
28
28
  wide: 75 * (0, _constants.gridSize)()
29
29
  };
30
+ exports.widths = widths;
30
31
  var wrapperStyles = (0, _react2.css)({
31
32
  display: 'flex',
32
33
  height: '100vh',
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/drawer",
3
- "version": "7.4.0",
3
+ "version": "7.4.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,19 +1,30 @@
1
+ /** @jsx jsx */
1
2
  import React from 'react';
3
+ import { css, jsx } from '@emotion/react';
2
4
  import AkBlanket from '@atlaskit/blanket';
3
5
  import { ExitingPersistence, FadeIn } from '@atlaskit/motion';
6
+ import { layers } from '@atlaskit/theme/constants';
4
7
  import { animationTimingFunction, transitionDurationMs } from '../constants';
5
8
 
9
+ /**
10
+ * The FadeIn opacity transition creates a new stacking context so we need ensure layering is the same as @atlaskit/blanket
11
+ */
12
+ const stackingStyles = css({
13
+ position: 'relative',
14
+ zIndex: layers.blanket()
15
+ });
6
16
  /**
7
17
  * A wrapper around `@atlaskit/blanket` that adds a fade in/out transition.
8
18
  */
19
+
9
20
  const Blanket = ({
10
21
  isOpen,
11
22
  onBlanketClicked,
12
23
  testId
13
24
  }) => {
14
- return /*#__PURE__*/React.createElement(ExitingPersistence, {
25
+ return jsx(ExitingPersistence, {
15
26
  appear: true
16
- }, isOpen && /*#__PURE__*/React.createElement(FadeIn
27
+ }, isOpen && jsx(FadeIn
17
28
  /**
18
29
  * We double the duration because the fade in keyframes have
19
30
  * `opacity: 1` at `50%`.
@@ -31,9 +42,10 @@ const Blanket = ({
31
42
  animationTimingFunction: animationTimingFunction
32
43
  }, ({
33
44
  className
34
- }) => /*#__PURE__*/React.createElement("div", {
35
- className: className
36
- }, /*#__PURE__*/React.createElement(AkBlanket, {
45
+ }) => jsx("div", {
46
+ className: className,
47
+ css: stackingStyles
48
+ }, jsx(AkBlanket, {
37
49
  isTinted: true,
38
50
  onBlanketClicked: onBlanketClicked,
39
51
  testId: testId && testId
@@ -9,7 +9,7 @@ import { defaultFocusLockSettings } from '../constants';
9
9
  import Blanket from './blanket';
10
10
  import DrawerPrimitive from './primitives';
11
11
  const packageName = "@atlaskit/drawer";
12
- const packageVersion = "7.4.0";
12
+ const packageVersion = "7.4.2";
13
13
  const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
14
14
 
15
15
  const createAndFireOnClick = (createAnalyticsEvent, trigger) => createAndFireEventOnAtlaskit({
@@ -5,7 +5,7 @@ import { useMergeRefs } from 'use-callback-ref';
5
5
  import { N0 } from '@atlaskit/theme/colors';
6
6
  import { gridSize, layers } from '@atlaskit/theme/constants';
7
7
  import usePreventProgrammaticScroll from './hooks/use-prevent-programmatic-scroll';
8
- const widths = {
8
+ export const widths = {
9
9
  full: '100vw',
10
10
  extended: '95vw',
11
11
  narrow: 45 * gridSize(),
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/drawer",
3
- "version": "7.4.0",
3
+ "version": "7.4.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,18 +1,29 @@
1
+ /** @jsx jsx */
1
2
  import React from 'react';
3
+ import { css, jsx } from '@emotion/react';
2
4
  import AkBlanket from '@atlaskit/blanket';
3
5
  import { ExitingPersistence, FadeIn } from '@atlaskit/motion';
6
+ import { layers } from '@atlaskit/theme/constants';
4
7
  import { animationTimingFunction, transitionDurationMs } from '../constants';
5
8
 
9
+ /**
10
+ * The FadeIn opacity transition creates a new stacking context so we need ensure layering is the same as @atlaskit/blanket
11
+ */
12
+ var stackingStyles = css({
13
+ position: 'relative',
14
+ zIndex: layers.blanket()
15
+ });
6
16
  /**
7
17
  * A wrapper around `@atlaskit/blanket` that adds a fade in/out transition.
8
18
  */
19
+
9
20
  var Blanket = function Blanket(_ref) {
10
21
  var isOpen = _ref.isOpen,
11
22
  onBlanketClicked = _ref.onBlanketClicked,
12
23
  testId = _ref.testId;
13
- return /*#__PURE__*/React.createElement(ExitingPersistence, {
24
+ return jsx(ExitingPersistence, {
14
25
  appear: true
15
- }, isOpen && /*#__PURE__*/React.createElement(FadeIn
26
+ }, isOpen && jsx(FadeIn
16
27
  /**
17
28
  * We double the duration because the fade in keyframes have
18
29
  * `opacity: 1` at `50%`.
@@ -30,9 +41,10 @@ var Blanket = function Blanket(_ref) {
30
41
  animationTimingFunction: animationTimingFunction
31
42
  }, function (_ref2) {
32
43
  var className = _ref2.className;
33
- return /*#__PURE__*/React.createElement("div", {
34
- className: className
35
- }, /*#__PURE__*/React.createElement(AkBlanket, {
44
+ return jsx("div", {
45
+ className: className,
46
+ css: stackingStyles
47
+ }, jsx(AkBlanket, {
36
48
  isTinted: true,
37
49
  onBlanketClicked: onBlanketClicked,
38
50
  testId: testId && testId
@@ -23,7 +23,7 @@ import { defaultFocusLockSettings } from '../constants';
23
23
  import Blanket from './blanket';
24
24
  import DrawerPrimitive from './primitives';
25
25
  var packageName = "@atlaskit/drawer";
26
- var packageVersion = "7.4.0";
26
+ var packageVersion = "7.4.2";
27
27
  var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
28
28
 
29
29
  var createAndFireOnClick = function createAndFireOnClick(createAnalyticsEvent, trigger) {
@@ -5,7 +5,7 @@ import { useMergeRefs } from 'use-callback-ref';
5
5
  import { N0 } from '@atlaskit/theme/colors';
6
6
  import { gridSize, layers } from '@atlaskit/theme/constants';
7
7
  import usePreventProgrammaticScroll from './hooks/use-prevent-programmatic-scroll';
8
- var widths = {
8
+ export var widths = {
9
9
  full: '100vw',
10
10
  extended: '95vw',
11
11
  narrow: 45 * gridSize(),
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/drawer",
3
- "version": "7.4.0",
3
+ "version": "7.4.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,4 +1,6 @@
1
+ /** @jsx jsx */
1
2
  import React from 'react';
3
+ import { jsx } from '@emotion/react';
2
4
  declare type BlanketProps = {
3
5
  isOpen: boolean;
4
6
  onBlanketClicked: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
@@ -7,5 +9,5 @@ declare type BlanketProps = {
7
9
  /**
8
10
  * A wrapper around `@atlaskit/blanket` that adds a fade in/out transition.
9
11
  */
10
- declare const Blanket: ({ isOpen, onBlanketClicked, testId }: BlanketProps) => JSX.Element;
12
+ declare const Blanket: ({ isOpen, onBlanketClicked, testId }: BlanketProps) => jsx.JSX.Element;
11
13
  export default Blanket;
@@ -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" | "isOpen" | "zIndex"> & Partial<Pick<Omit<DrawerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "width" | keyof import("./types").FocusLockSettings>> & Partial<Pick<{
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" | "isOpen" | "analyticsContext" | "zIndex" | keyof import("./types").FocusLockSettings> & React.RefAttributes<any>>;
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;
@@ -1,6 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { ReactElement, Ref } from 'react';
3
- import { DrawerPrimitiveProps } from '../types';
3
+ import { DrawerPrimitiveProps, Widths } from '../types';
4
+ export declare const widths: Widths;
4
5
  interface FocusLockRefTargetProps extends Pick<DrawerPrimitiveProps, 'width' | 'testId'> {
5
6
  /**
6
7
  * This must have two children explicitly as we target the second child as the Content.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/drawer",
3
- "version": "7.4.0",
3
+ "version": "7.4.2",
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/"
@@ -12,14 +12,6 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
- "typesVersions": {
16
- ">=4.0 <4.5": {
17
- "*": [
18
- "dist/types-ts4.0/*",
19
- "dist/types-ts4.0/index.d.ts"
20
- ]
21
- }
22
- },
23
15
  "sideEffects": false,
24
16
  "atlaskit:src": "src/index.tsx",
25
17
  "homepage": "https://atlassian.design/components/drawer",
@@ -40,7 +32,7 @@
40
32
  "@atlaskit/motion": "^1.3.0",
41
33
  "@atlaskit/portal": "^4.0.0",
42
34
  "@atlaskit/theme": "^12.2.0",
43
- "@atlaskit/tokens": "^0.10.0",
35
+ "@atlaskit/tokens": "^0.11.0",
44
36
  "@babel/runtime": "^7.0.0",
45
37
  "@emotion/react": "^11.7.1",
46
38
  "bind-event-listener": "^2.1.1",
@@ -54,7 +46,7 @@
54
46
  "react": "^16.8.0"
55
47
  },
56
48
  "devDependencies": {
57
- "@atlaskit/button": "^16.4.0",
49
+ "@atlaskit/button": "^16.5.0",
58
50
  "@atlaskit/checkbox": "^12.4.0",
59
51
  "@atlaskit/code": "^14.4.0",
60
52
  "@atlaskit/docs": "*",
@@ -68,9 +60,7 @@
68
60
  "@atlaskit/visual-regression": "*",
69
61
  "@atlaskit/webdriver-runner": "*",
70
62
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
71
- "@testing-library/dom": "^8.17.1",
72
63
  "@testing-library/react": "^12.1.5",
73
- "enzyme": "^3.10.0",
74
64
  "lodash": "^4.17.21",
75
65
  "react-dom": "^16.8.0",
76
66
  "react-lorem-component": "^0.13.0",
package/report.api.md CHANGED
@@ -1,17 +1,23 @@
1
+ <!-- API Report Version: 2.2 -->
2
+
1
3
  ## API Report File for "@atlaskit/drawer"
2
4
 
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
5
+ > Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
6
+ > [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
7
+
8
+ ### Table of contents
4
9
 
5
- <!--
6
- Generated API Report version: 2.0
7
- -->
10
+ - [Main Entry Types](#main-entry-types)
8
11
 
9
- [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
12
+ ### Main Entry Types
13
+
14
+ <!--SECTION START: Main Entry Types-->
10
15
 
11
16
  ```ts
12
17
  import { ComponentType } from 'react';
13
18
  import { CSSObject } from '@emotion/react';
14
19
  import { default as React_2 } from 'react';
20
+ import { ReactElement } from 'react';
15
21
  import { ReactNode } from 'react';
16
22
  import { SyntheticEvent } from 'react';
17
23
  import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
@@ -48,56 +54,54 @@ const _default: React_2.ForwardRefExoticComponent<
48
54
  Pick<
49
55
  Omit<DrawerProps, keyof WithAnalyticsEventsProps>,
50
56
  | 'children'
51
- | 'onKeyDown'
52
- | 'isOpen'
53
- | 'testId'
54
- | 'zIndex'
55
57
  | 'icon'
58
+ | 'isOpen'
56
59
  | 'onClose'
57
60
  | 'onCloseComplete'
61
+ | 'onKeyDown'
58
62
  | 'onOpenComplete'
59
63
  | 'overrides'
60
64
  | 'shouldUnmountOnExit'
65
+ | 'testId'
66
+ | 'zIndex'
61
67
  > &
62
68
  Partial<
63
69
  Pick<
64
70
  Omit<DrawerProps, keyof WithAnalyticsEventsProps>,
65
- | 'width'
66
- | 'isFocusLockEnabled'
67
- | 'autoFocusFirstElem'
68
- | 'shouldReturnFocus'
71
+ 'width' | keyof FocusLockSettings
69
72
  >
70
73
  > &
71
74
  Partial<
72
75
  Pick<
73
76
  {
77
+ autoFocusFirstElem?:
78
+ | (() => HTMLElement | null)
79
+ | boolean
80
+ | undefined;
81
+ isFocusLockEnabled?: boolean | undefined;
82
+ shouldReturnFocus?: boolean | undefined;
74
83
  width: DrawerWidth;
75
- isFocusLockEnabled: boolean;
76
- shouldReturnFocus: boolean;
77
- autoFocusFirstElem: boolean;
78
84
  },
79
85
  never
80
86
  >
81
87
  > &
82
88
  React_2.RefAttributes<any> &
83
89
  WithContextProps,
84
- | 'width'
85
- | 'children'
86
- | 'onKeyDown'
87
- | 'key'
88
- | 'isOpen'
89
- | 'testId'
90
90
  | 'analyticsContext'
91
- | 'isFocusLockEnabled'
92
- | 'autoFocusFirstElem'
93
- | 'shouldReturnFocus'
94
- | 'zIndex'
91
+ | 'children'
95
92
  | 'icon'
93
+ | 'isOpen'
94
+ | 'key'
96
95
  | 'onClose'
97
96
  | 'onCloseComplete'
97
+ | 'onKeyDown'
98
98
  | 'onOpenComplete'
99
99
  | 'overrides'
100
100
  | 'shouldUnmountOnExit'
101
+ | 'testId'
102
+ | 'width'
103
+ | 'zIndex'
104
+ | keyof FocusLockSettings
101
105
  > &
102
106
  React_2.RefAttributes<any>
103
107
  >;
@@ -116,16 +120,16 @@ export type DefaultsType = {
116
120
  };
117
121
 
118
122
  // @public (undocumented)
119
- export type DrawerPrimitiveDefaults = Pick<DefaultsType, 'Sidebar' | 'Content'>;
123
+ export type DrawerPrimitiveDefaults = Pick<DefaultsType, 'Content' | 'Sidebar'>;
120
124
 
121
125
  // @public (undocumented)
122
126
  export type DrawerPrimitiveOverrides = Pick<
123
127
  OverridesType,
124
- 'Sidebar' | 'Content'
128
+ 'Content' | 'Sidebar'
125
129
  >;
126
130
 
127
131
  // @public (undocumented)
128
- export interface DrawerPrimitiveProps extends BaseProps {
132
+ export interface DrawerPrimitiveProps extends BaseProps, FocusLockSettings {
129
133
  // (undocumented)
130
134
  in: boolean;
131
135
  // (undocumented)
@@ -134,7 +138,7 @@ export interface DrawerPrimitiveProps extends BaseProps {
134
138
 
135
139
  // @public (undocumented)
136
140
  export type DrawerProps = BaseProps &
137
- FocusLockProps &
141
+ FocusLockSettings &
138
142
  WithAnalyticsEventsProps & {
139
143
  onKeyDown?: (event: SyntheticEvent) => void;
140
144
  onClose?: (event: SyntheticEvent<HTMLElement>, analyticsEvent: any) => void;
@@ -146,9 +150,13 @@ export type DrawerProps = BaseProps &
146
150
  export type DrawerWidth = 'extended' | 'full' | 'medium' | 'narrow' | 'wide';
147
151
 
148
152
  // @public (undocumented)
149
- export interface FocusLockProps {
150
- autoFocusFirstElem?: boolean | (() => HTMLElement | null);
151
- children?: ReactNode;
153
+ export interface FocusLockProps extends FocusLockSettings {
154
+ children?: ReactElement;
155
+ }
156
+
157
+ // @public (undocumented)
158
+ interface FocusLockSettings {
159
+ autoFocusFirstElem?: (() => HTMLElement | null) | boolean;
152
160
  isFocusLockEnabled?: boolean;
153
161
  shouldReturnFocus?: boolean;
154
162
  }
@@ -185,3 +193,5 @@ export type Widths = {
185
193
 
186
194
  // (No @packageDocumentation comment for this package)
187
195
  ```
196
+
197
+ <!--SECTION END: Main Entry Types-->
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- declare type BlanketProps = {
3
- isOpen: boolean;
4
- onBlanketClicked: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
5
- testId?: string;
6
- };
7
- /**
8
- * A wrapper around `@atlaskit/blanket` that adds a fade in/out transition.
9
- */
10
- declare const Blanket: ({ isOpen, onBlanketClicked, testId }: BlanketProps) => JSX.Element;
11
- export default Blanket;
@@ -1,31 +0,0 @@
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" | "isOpen" | "zIndex"> & 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" | "isOpen" | "analyticsContext" | "zIndex" | keyof import("./types").FocusLockSettings> & React.RefAttributes<any>>;
31
- export default _default;
@@ -1,8 +0,0 @@
1
- /** @jsx jsx */
2
- import { CSSObject, jsx } from '@emotion/react';
3
- import { ContentProps } from '../types';
4
- declare const _default: {
5
- component: ({ cssFn, ...props }: ContentProps) => jsx.JSX.Element;
6
- cssFn: () => CSSObject;
7
- };
8
- export default _default;
@@ -1,25 +0,0 @@
1
- /** @jsx jsx */
2
- import { ReactElement, Ref } from 'react';
3
- import { DrawerPrimitiveProps } from '../types';
4
- interface FocusLockRefTargetProps extends Pick<DrawerPrimitiveProps, 'width' | 'testId'> {
5
- /**
6
- * This must have two children explicitly as we target the second child as the Content.
7
- */
8
- children: [
9
- ReactElement,
10
- ReactElement
11
- ];
12
- /**
13
- * A ref pointing to our drawer wrapper, passed to `onCloseComplete` and `onOpenComplete` callbacks.
14
- */
15
- drawerRef: Ref<HTMLDivElement>;
16
- /**
17
- * The className coming from the SlideIn render callback.
18
- */
19
- className?: string;
20
- }
21
- /**
22
- * A wrapper that controls the styling of the drawer with a few hacks with refs to get our Touch±Scroll locks working.
23
- */
24
- declare const DrawerWrapper: import("react").ForwardRefExoticComponent<FocusLockRefTargetProps & import("react").RefAttributes<HTMLElement>>;
25
- export default DrawerWrapper;
@@ -1,11 +0,0 @@
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
- }
@@ -1,9 +0,0 @@
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;
@@ -1,8 +0,0 @@
1
- /** @jsx jsx */
2
- import { FC, MouseEventHandler } from 'react';
3
- interface IconButtonProps {
4
- testId?: string;
5
- onClick?: MouseEventHandler<HTMLButtonElement>;
6
- }
7
- declare const IconButton: FC<IconButtonProps>;
8
- export default IconButton;
@@ -1,5 +0,0 @@
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;
@@ -1,9 +0,0 @@
1
- /** @jsx jsx */
2
- import { FC } from 'react';
3
- import { CSSObject } from '@emotion/react';
4
- import { SidebarProps } from '../types';
5
- declare const _default: {
6
- component: FC<SidebarProps>;
7
- cssFn: () => CSSObject;
8
- };
9
- export default _default;
@@ -1,137 +0,0 @@
1
- import { ComponentType, ReactElement, ReactNode, SyntheticEvent } from 'react';
2
- import { CSSObject } from '@emotion/react';
3
- import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
4
- export declare type Widths = {
5
- extended: string;
6
- full: string;
7
- medium: number;
8
- narrow: number;
9
- wide: number;
10
- };
11
- export declare type DrawerWidth = 'extended' | 'full' | 'medium' | 'narrow' | 'wide';
12
- export interface BaseProps {
13
- /**
14
- * A unique hook to be used for testing.
15
- */
16
- testId?: string;
17
- /**
18
- * The content of the drawer.
19
- */
20
- children?: ReactNode;
21
- /**
22
- * Icon to be rendered in your drawer as a component, if available.
23
- */
24
- icon?: ComponentType<any>;
25
- /**
26
- * Available drawer sizes.
27
- */
28
- width?: DrawerWidth;
29
- /**
30
- * A callback function that will be called when the drawer has finished its opening transition.
31
- */
32
- onOpenComplete?: (node: HTMLElement | null) => void;
33
- /**
34
- * A callback function that will be called when the drawer has finished its close transition.
35
- */
36
- onCloseComplete?: (node: HTMLElement | null) => void;
37
- /**
38
- * @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release.
39
- * Boolean that controls if drawer should be retained/discarded
40
- */
41
- shouldUnmountOnExit?: boolean;
42
- /**
43
- * Override drawer components.
44
- */
45
- overrides?: OverridesType;
46
- }
47
- export declare type DefaultsType = {
48
- Sidebar: {
49
- component: React.ComponentType<SidebarProps>;
50
- cssFn: (defaultStyles: CSSObject) => CSSObject;
51
- };
52
- Content: {
53
- component: React.ComponentType<ContentProps>;
54
- cssFn: (defaultStyles: CSSObject) => CSSObject;
55
- };
56
- };
57
- export declare type OverridesType = {
58
- Sidebar?: {
59
- component?: React.ComponentType<SidebarProps>;
60
- /**
61
- * @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release. See DSP-2673 for more information.
62
- */
63
- cssFn?: (defaultStyles: CSSObject) => CSSObject;
64
- };
65
- Content?: {
66
- component?: React.ComponentType<ContentProps>;
67
- /**
68
- * @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release. See DSP-2673 for more information.
69
- */
70
- cssFn?: (defaultStyles: CSSObject) => CSSObject;
71
- };
72
- };
73
- export declare type DrawerPrimitiveDefaults = Pick<DefaultsType, 'Sidebar' | 'Content'>;
74
- export declare type DrawerPrimitiveOverrides = Pick<OverridesType, 'Sidebar' | 'Content'>;
75
- export interface SidebarProps extends React.HTMLProps<HTMLDivElement> {
76
- /**
77
- * @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release. See DSP-2673 for more information.
78
- */
79
- cssFn: (defaultStyles: CSSObject) => CSSObject;
80
- }
81
- export declare type SidebarCSSProps = Omit<SidebarProps, 'cssFn'>;
82
- export interface ContentProps extends React.HTMLProps<HTMLDivElement> {
83
- /**
84
- * @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release. See DSP-2673 for more information.
85
- */
86
- cssFn: (defaultStyles: CSSObject) => CSSObject;
87
- }
88
- export declare type ContentCSSProps = Omit<ContentProps, 'cssFn'>;
89
- export interface DrawerPrimitiveProps extends BaseProps, FocusLockSettings {
90
- in: boolean;
91
- onClose: (event: SyntheticEvent<HTMLElement>) => void;
92
- }
93
- export declare type DrawerProps = BaseProps & FocusLockSettings & WithAnalyticsEventsProps & {
94
- /**
95
- * Callback function called while the drawer is displayed and `keydown` event is triggered.
96
- */
97
- onKeyDown?: (event: SyntheticEvent) => void;
98
- /**
99
- * Callback function called when the drawer is closed.
100
- */
101
- onClose?: (event: SyntheticEvent<HTMLElement>, analyticsEvent: any) => void;
102
- /**
103
- * Controls if the drawer is open or closed.
104
- */
105
- isOpen: boolean;
106
- /**
107
- * Z-index that the popup should be displayed in.
108
- * This is passed to the portal component.
109
- * Defaults to `unset`.
110
- */
111
- zIndex?: number;
112
- };
113
- export interface FocusLockSettings {
114
- /**
115
- * Controls whether to focus the first tabbable element inside the focus lock.
116
- */
117
- autoFocusFirstElem?: boolean | (() => HTMLElement | null);
118
- /**
119
- * Whether the focus lock is active or not.
120
- */
121
- isFocusLockEnabled?: boolean;
122
- /**
123
- * Whether to return the focus to the previous active element on closing the drawer.
124
- */
125
- shouldReturnFocus?: boolean;
126
- }
127
- export interface FocusLockProps extends FocusLockSettings {
128
- /**
129
- * Content inside the focus lock.
130
- * Must strictly be a ReactElement and it *must* be implemented to take a `ref` passed from `react-scrolllock` to enable Touch Scrolling.
131
- */
132
- children?: ReactElement;
133
- }
134
- /**
135
- * Type of keyboard event that triggers which key will should close the drawer.
136
- */
137
- export declare type CloseTrigger = 'backButton' | 'blanket' | 'escKey';
@@ -1,7 +0,0 @@
1
- declare type OverridesFunc<X extends Record<string, any>, Y extends Record<string, any>> = (key: string) => Record<string, any>;
2
- export declare 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 {};
@@ -1,7 +0,0 @@
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;
@@ -1,2 +0,0 @@
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';