@atlaskit/drawer 7.2.0 → 7.3.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 CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/drawer
2
2
 
3
+ ## 7.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`b975291711b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b975291711b) - Add zindex as prop to drawer
8
+
9
+ ### Patch Changes
10
+
11
+ - [`a0653d05aa0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a0653d05aa0) - Add `testId` prop to internal blanket component, passthrough `testId` from Drawer to Blanket for testing purposes. No behaviour change.
12
+ - Updated dependencies
13
+
14
+ ## 7.2.1
15
+
16
+ ### Patch Changes
17
+
18
+ - [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
19
+
3
20
  ## 7.2.0
4
21
 
5
22
  ### Minor Changes
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/constants.js",
5
5
  "module:es2019": "../dist/es2019/constants.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/constants.d.ts"
7
+ "types": "../dist/types/constants.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/constants.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
@@ -47,7 +47,7 @@ var Blanket = function Blanket(_ref) {
47
47
  }, /*#__PURE__*/_react.default.createElement(_blanket.default, {
48
48
  isTinted: true,
49
49
  onBlanketClicked: onBlanketClicked,
50
- testId: testId
50
+ testId: testId && testId
51
51
  }));
52
52
  }));
53
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.2.0";
49
+ var packageVersion = "7.3.0";
50
50
  var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
51
51
 
52
52
  var createAndFireOnClick = function createAndFireOnClick(createAnalyticsEvent, trigger) {
@@ -159,9 +159,11 @@ var DrawerBase = /*#__PURE__*/function (_Component) {
159
159
  autoFocusFirstElem = _this$props3.autoFocusFirstElem,
160
160
  isFocusLockEnabled = _this$props3.isFocusLockEnabled,
161
161
  shouldReturnFocus = _this$props3.shouldReturnFocus,
162
- overrides = _this$props3.overrides;
162
+ overrides = _this$props3.overrides,
163
+ _this$props3$zIndex = _this$props3.zIndex,
164
+ zIndex = _this$props3$zIndex === void 0 ? 'unset' : _this$props3$zIndex;
163
165
  return /*#__PURE__*/_react.default.createElement(_portal.default, {
164
- zIndex: "unset"
166
+ zIndex: zIndex
165
167
  }, /*#__PURE__*/_react.default.createElement(_blanket.default, {
166
168
  isOpen: isOpen,
167
169
  onBlanketClicked: this.handleBlanketClick,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/drawer",
3
- "version": "7.2.0",
3
+ "version": "7.3.0",
4
4
  "sideEffects": false
5
5
  }
@@ -36,7 +36,7 @@ const Blanket = ({
36
36
  }, /*#__PURE__*/React.createElement(AkBlanket, {
37
37
  isTinted: true,
38
38
  onBlanketClicked: onBlanketClicked,
39
- testId: testId
39
+ testId: testId && testId
40
40
  }))));
41
41
  };
42
42
 
@@ -9,7 +9,7 @@ import Blanket from './blanket';
9
9
  import FocusLock from './focus-lock';
10
10
  import DrawerPrimitive from './primitives';
11
11
  const packageName = "@atlaskit/drawer";
12
- const packageVersion = "7.2.0";
12
+ const packageVersion = "7.3.0";
13
13
  const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
14
14
 
15
15
  const createAndFireOnClick = (createAnalyticsEvent, trigger) => createAndFireEventOnAtlaskit({
@@ -114,10 +114,11 @@ export class DrawerBase extends Component {
114
114
  autoFocusFirstElem,
115
115
  isFocusLockEnabled,
116
116
  shouldReturnFocus,
117
- overrides
117
+ overrides,
118
+ zIndex = 'unset'
118
119
  } = this.props;
119
120
  return /*#__PURE__*/React.createElement(Portal, {
120
- zIndex: "unset"
121
+ zIndex: zIndex
121
122
  }, /*#__PURE__*/React.createElement(Blanket, {
122
123
  isOpen: isOpen,
123
124
  onBlanketClicked: this.handleBlanketClick,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/drawer",
3
- "version": "7.2.0",
3
+ "version": "7.3.0",
4
4
  "sideEffects": false
5
5
  }
@@ -35,7 +35,7 @@ var Blanket = function Blanket(_ref) {
35
35
  }, /*#__PURE__*/React.createElement(AkBlanket, {
36
36
  isTinted: true,
37
37
  onBlanketClicked: onBlanketClicked,
38
- testId: testId
38
+ testId: testId && testId
39
39
  }));
40
40
  }));
41
41
  };
@@ -19,7 +19,7 @@ import Blanket from './blanket';
19
19
  import FocusLock from './focus-lock';
20
20
  import DrawerPrimitive from './primitives';
21
21
  var packageName = "@atlaskit/drawer";
22
- var packageVersion = "7.2.0";
22
+ var packageVersion = "7.3.0";
23
23
  var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
24
24
 
25
25
  var createAndFireOnClick = function createAndFireOnClick(createAnalyticsEvent, trigger) {
@@ -139,9 +139,11 @@ export var DrawerBase = /*#__PURE__*/function (_Component) {
139
139
  autoFocusFirstElem = _this$props3.autoFocusFirstElem,
140
140
  isFocusLockEnabled = _this$props3.isFocusLockEnabled,
141
141
  shouldReturnFocus = _this$props3.shouldReturnFocus,
142
- overrides = _this$props3.overrides;
142
+ overrides = _this$props3.overrides,
143
+ _this$props3$zIndex = _this$props3.zIndex,
144
+ zIndex = _this$props3$zIndex === void 0 ? 'unset' : _this$props3$zIndex;
143
145
  return /*#__PURE__*/React.createElement(Portal, {
144
- zIndex: "unset"
146
+ zIndex: zIndex
145
147
  }, /*#__PURE__*/React.createElement(Blanket, {
146
148
  isOpen: isOpen,
147
149
  onBlanketClicked: this.handleBlanketClick,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/drawer",
3
- "version": "7.2.0",
3
+ "version": "7.3.0",
4
4
  "sideEffects": false
5
5
  }
@@ -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" | "isOpen" | "testId" | "icon" | "onClose" | "onCloseComplete" | "onOpenComplete" | "overrides" | "shouldUnmountOnExit"> & Partial<Pick<Omit<DrawerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "width" | "isFocusLockEnabled" | "autoFocusFirstElem" | "shouldReturnFocus">> & Partial<Pick<{
25
+ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DrawerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "children" | "onKeyDown" | "onClose" | "isOpen" | "testId" | "zIndex" | "icon" | "onCloseComplete" | "onOpenComplete" | "overrides" | "shouldUnmountOnExit"> & Partial<Pick<Omit<DrawerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "width" | "isFocusLockEnabled" | "autoFocusFirstElem" | "shouldReturnFocus">> & Partial<Pick<{
26
26
  width: DrawerWidth;
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" | "testId" | "analyticsContext" | "isFocusLockEnabled" | "autoFocusFirstElem" | "shouldReturnFocus" | "icon" | "onClose" | "onCloseComplete" | "onOpenComplete" | "overrides" | "shouldUnmountOnExit"> & React.RefAttributes<any>>;
30
+ }, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "width" | "children" | "onKeyDown" | "key" | "onClose" | "isOpen" | "testId" | "analyticsContext" | "isFocusLockEnabled" | "autoFocusFirstElem" | "shouldReturnFocus" | "zIndex" | "icon" | "onCloseComplete" | "onOpenComplete" | "overrides" | "shouldUnmountOnExit"> & React.RefAttributes<any>>;
31
31
  export default _default;
@@ -103,6 +103,12 @@ export declare type DrawerProps = BaseProps & FocusLockProps & WithAnalyticsEven
103
103
  * Controls if the drawer is open or closed.
104
104
  */
105
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;
106
112
  };
107
113
  export interface FocusLockProps {
108
114
  /**
@@ -0,0 +1,11 @@
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;
@@ -0,0 +1,6 @@
1
+ import { Component } from 'react';
2
+ import { FocusLockProps } from './types';
3
+ export default class FocusLock extends Component<FocusLockProps> {
4
+ componentDidMount(): void;
5
+ render(): JSX.Element;
6
+ }
@@ -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
+ width: DrawerWidth;
8
+ isFocusLockEnabled: boolean;
9
+ shouldReturnFocus: boolean;
10
+ autoFocusFirstElem: boolean;
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" | "isOpen" | "testId" | "zIndex" | "icon" | "onCloseComplete" | "onOpenComplete" | "overrides" | "shouldUnmountOnExit"> & Partial<Pick<Omit<DrawerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "width" | "isFocusLockEnabled" | "autoFocusFirstElem" | "shouldReturnFocus">> & Partial<Pick<{
26
+ width: DrawerWidth;
27
+ isFocusLockEnabled: boolean;
28
+ shouldReturnFocus: boolean;
29
+ autoFocusFirstElem: boolean;
30
+ }, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "width" | "children" | "onKeyDown" | "key" | "onClose" | "isOpen" | "testId" | "analyticsContext" | "isFocusLockEnabled" | "autoFocusFirstElem" | "shouldReturnFocus" | "zIndex" | "icon" | "onCloseComplete" | "onOpenComplete" | "overrides" | "shouldUnmountOnExit"> & React.RefAttributes<any>>;
31
+ export default _default;
@@ -0,0 +1,8 @@
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;
@@ -0,0 +1,8 @@
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;
@@ -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, ...props }: DrawerPrimitiveProps) => jsx.JSX.Element;
5
+ export default DrawerPrimitive;
@@ -0,0 +1,9 @@
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;
@@ -0,0 +1,134 @@
1
+ import { ComponentType, 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 {
90
+ in: boolean;
91
+ onClose: (event: SyntheticEvent<HTMLElement>) => void;
92
+ }
93
+ export declare type DrawerProps = BaseProps & FocusLockProps & 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 FocusLockProps {
114
+ /**
115
+ * Controls whether to focus the first tabbable element inside the focus lock.
116
+ */
117
+ autoFocusFirstElem?: boolean | (() => HTMLElement | null);
118
+ /**
119
+ * Content inside the focus lock.
120
+ */
121
+ children?: ReactNode;
122
+ /**
123
+ * Whether the focus lock is active or not.
124
+ */
125
+ isFocusLockEnabled?: boolean;
126
+ /**
127
+ * Whether to return the focus to the previous active element on closing the drawer.
128
+ */
129
+ shouldReturnFocus?: boolean;
130
+ }
131
+ /**
132
+ * Type of keyboard event that triggers which key will should close the drawer.
133
+ */
134
+ export declare type CloseTrigger = 'backButton' | 'blanket' | 'escKey';
@@ -0,0 +1,7 @@
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 {};
@@ -0,0 +1,6 @@
1
+ import type { DrawerWidth } 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;
@@ -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.2.0",
3
+ "version": "7.3.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/"
@@ -12,6 +12,13 @@
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
+ ]
20
+ }
21
+ },
15
22
  "sideEffects": false,
16
23
  "atlaskit:src": "src/index.tsx",
17
24
  "homepage": "https://atlassian.design/components/drawer",
@@ -26,8 +33,8 @@
26
33
  },
27
34
  "dependencies": {
28
35
  "@atlaskit/analytics-next": "^8.2.0",
29
- "@atlaskit/blanket": "^12.1.0",
30
- "@atlaskit/icon": "^21.10.0",
36
+ "@atlaskit/blanket": "^12.3.0",
37
+ "@atlaskit/icon": "^21.11.0",
31
38
  "@atlaskit/motion": "^1.2.0",
32
39
  "@atlaskit/portal": "^4.0.0",
33
40
  "@atlaskit/theme": "^12.2.0",
@@ -43,25 +50,26 @@
43
50
  },
44
51
  "devDependencies": {
45
52
  "@atlaskit/button": "^16.3.0",
46
- "@atlaskit/checkbox": "^12.3.9",
47
- "@atlaskit/code": "^14.3.3",
53
+ "@atlaskit/checkbox": "^12.4.0",
54
+ "@atlaskit/code": "^14.4.0",
48
55
  "@atlaskit/docs": "*",
49
- "@atlaskit/dropdown-menu": "^11.4.0",
56
+ "@atlaskit/dropdown-menu": "^11.5.0",
50
57
  "@atlaskit/ds-lib": "^2.1.0",
51
58
  "@atlaskit/menu": "^1.3.0",
52
- "@atlaskit/section-message": "^6.2.0",
59
+ "@atlaskit/modal-dialog": "^12.4.0",
60
+ "@atlaskit/section-message": "^6.3.0",
53
61
  "@atlaskit/ssr": "*",
54
- "@atlaskit/textarea": "^4.3.1",
62
+ "@atlaskit/textarea": "^4.5.0",
55
63
  "@atlaskit/visual-regression": "*",
56
64
  "@atlaskit/webdriver-runner": "*",
57
65
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
58
- "@testing-library/dom": "^7.7.3",
59
- "@testing-library/react": "^8.0.1",
66
+ "@testing-library/dom": "^8.17.1",
67
+ "@testing-library/react": "^12.1.5",
60
68
  "enzyme": "^3.10.0",
61
69
  "lodash": "^4.17.21",
62
70
  "react-dom": "^16.8.0",
63
71
  "react-lorem-component": "^0.13.0",
64
- "typescript": "4.3.5",
72
+ "typescript": "4.5.5",
65
73
  "wait-for-expect": "^1.2.0"
66
74
  },
67
75
  "techstack": {
package/report.api.md CHANGED
@@ -1,10 +1,12 @@
1
- ## API Report File for "@atlaskit/drawer"
1
+ ## API Report File for "@atlaskit/drawer".
2
2
 
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
3
+ > Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
4
6
 
5
7
  ```ts
6
8
  import { ComponentType } from 'react';
7
- import { CSSObject } from '@emotion/core';
9
+ import { CSSObject } from '@emotion/react';
8
10
  import { default as React_2 } from 'react';
9
11
  import { ReactNode } from 'react';
10
12
  import { SyntheticEvent } from 'react';
@@ -12,28 +14,44 @@ import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
12
14
  import { WithContextProps } from '@atlaskit/analytics-next';
13
15
 
14
16
  export declare interface BaseProps {
15
- /** A unique hook to be used for testing. */
17
+ /**
18
+ * A unique hook to be used for testing.
19
+ */
16
20
  testId?: string;
17
- /** The content of the drawer. */
21
+ /**
22
+ * The content of the drawer.
23
+ */
18
24
  children?: ReactNode;
19
- /** Icon to be rendered in your drawer as a component, if available. */
25
+ /**
26
+ * Icon to be rendered in your drawer as a component, if available.
27
+ */
20
28
  icon?: ComponentType<any>;
21
- /** Available drawer sizes. */
29
+ /**
30
+ * Available drawer sizes.
31
+ */
22
32
  width?: DrawerWidth;
23
- /** A callback function that will be called when the drawer has finished its opening transition. */
33
+ /**
34
+ * A callback function that will be called when the drawer has finished its opening transition.
35
+ */
24
36
  onOpenComplete?: (node: HTMLElement | null) => void;
25
- /** A callback function that will be called when the drawer has finished its close transition. */
37
+ /**
38
+ * A callback function that will be called when the drawer has finished its close transition.
39
+ */
26
40
  onCloseComplete?: (node: HTMLElement | null) => void;
27
41
  /**
28
- * * @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release.
42
+ * @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release.
29
43
  * Boolean that controls if drawer should be retained/discarded
30
- * */
44
+ */
31
45
  shouldUnmountOnExit?: boolean;
32
- /** Override drawer components. */
46
+ /**
47
+ * Override drawer components.
48
+ */
33
49
  overrides?: OverridesType;
34
50
  }
35
51
 
36
- /** Type of keyboard event that triggers which key will should close the drawer. */
52
+ /**
53
+ * Type of keyboard event that triggers which key will should close the drawer.
54
+ */
37
55
  export declare type CloseTrigger = 'backButton' | 'blanket' | 'escKey';
38
56
 
39
57
  export declare type ContentCSSProps = Omit<ContentProps, 'cssFn'>;
@@ -53,6 +71,7 @@ declare const _default: React_2.ForwardRefExoticComponent<
53
71
  | 'onKeyDown'
54
72
  | 'isOpen'
55
73
  | 'testId'
74
+ | 'zIndex'
56
75
  | 'icon'
57
76
  | 'onClose'
58
77
  | 'onCloseComplete'
@@ -87,11 +106,12 @@ declare const _default: React_2.ForwardRefExoticComponent<
87
106
  | 'onKeyDown'
88
107
  | 'key'
89
108
  | 'isOpen'
90
- | 'analyticsContext'
91
109
  | 'testId'
110
+ | 'analyticsContext'
92
111
  | 'isFocusLockEnabled'
93
112
  | 'autoFocusFirstElem'
94
113
  | 'shouldReturnFocus'
114
+ | 'zIndex'
95
115
  | 'icon'
96
116
  | 'onClose'
97
117
  | 'onCloseComplete'
@@ -132,12 +152,24 @@ export declare interface DrawerPrimitiveProps extends BaseProps {
132
152
  export declare type DrawerProps = BaseProps &
133
153
  FocusLockProps &
134
154
  WithAnalyticsEventsProps & {
135
- /** Callback function called while the drawer is displayed and `keydown` event is triggered. */
155
+ /**
156
+ * Callback function called while the drawer is displayed and `keydown` event is triggered.
157
+ */
136
158
  onKeyDown?: (event: SyntheticEvent) => void;
137
- /** Callback function called when the drawer is closed. */
159
+ /**
160
+ * Callback function called when the drawer is closed.
161
+ */
138
162
  onClose?: (event: SyntheticEvent<HTMLElement>, analyticsEvent: any) => void;
139
- /** Controls if the drawer is open or closed. */
163
+ /**
164
+ * Controls if the drawer is open or closed.
165
+ */
140
166
  isOpen: boolean;
167
+ /**
168
+ * Z-index that the popup should be displayed in.
169
+ * This is passed to the portal component.
170
+ * Defaults to `unset`.
171
+ */
172
+ zIndex?: number;
141
173
  };
142
174
 
143
175
  export declare type DrawerWidth =
@@ -148,13 +180,21 @@ export declare type DrawerWidth =
148
180
  | 'wide';
149
181
 
150
182
  export declare interface FocusLockProps {
151
- /** Controls whether to focus the first tabbable element inside the focus lock. */
183
+ /**
184
+ * Controls whether to focus the first tabbable element inside the focus lock.
185
+ */
152
186
  autoFocusFirstElem?: boolean | (() => HTMLElement | null);
153
- /** Content inside the focus lock. */
187
+ /**
188
+ * Content inside the focus lock.
189
+ */
154
190
  children?: ReactNode;
155
- /** Whether the focus lock is active or not. */
191
+ /**
192
+ * Whether the focus lock is active or not.
193
+ */
156
194
  isFocusLockEnabled?: boolean;
157
- /** Whether to return the focus to the previous active element on closing the drawer. */
195
+ /**
196
+ * Whether to return the focus to the previous active element on closing the drawer.
197
+ */
158
198
  shouldReturnFocus?: boolean;
159
199
  }
160
200