@atlaskit/drawer 7.2.1 → 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,16 @@
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
+
3
14
  ## 7.2.1
4
15
 
5
16
  ### Patch Changes
@@ -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.1";
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.1",
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.1";
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.1",
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.1";
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.1",
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" | "onClose" | "isOpen" | "testId" | "icon" | "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" | "onClose" | "isOpen" | "testId" | "analyticsContext" | "isFocusLockEnabled" | "autoFocusFirstElem" | "shouldReturnFocus" | "icon" | "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
  /**
@@ -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" | "isOpen" | "testId" | "icon" | "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" | "onClose" | "isOpen" | "testId" | "analyticsContext" | "isFocusLockEnabled" | "autoFocusFirstElem" | "shouldReturnFocus" | "icon" | "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
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/drawer",
3
- "version": "7.2.1",
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/"
@@ -33,8 +33,8 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@atlaskit/analytics-next": "^8.2.0",
36
- "@atlaskit/blanket": "^12.1.0",
37
- "@atlaskit/icon": "^21.10.0",
36
+ "@atlaskit/blanket": "^12.3.0",
37
+ "@atlaskit/icon": "^21.11.0",
38
38
  "@atlaskit/motion": "^1.2.0",
39
39
  "@atlaskit/portal": "^4.0.0",
40
40
  "@atlaskit/theme": "^12.2.0",
@@ -50,15 +50,16 @@
50
50
  },
51
51
  "devDependencies": {
52
52
  "@atlaskit/button": "^16.3.0",
53
- "@atlaskit/checkbox": "^12.3.9",
54
- "@atlaskit/code": "^14.3.3",
53
+ "@atlaskit/checkbox": "^12.4.0",
54
+ "@atlaskit/code": "^14.4.0",
55
55
  "@atlaskit/docs": "*",
56
56
  "@atlaskit/dropdown-menu": "^11.5.0",
57
57
  "@atlaskit/ds-lib": "^2.1.0",
58
58
  "@atlaskit/menu": "^1.3.0",
59
- "@atlaskit/section-message": "^6.2.0",
59
+ "@atlaskit/modal-dialog": "^12.4.0",
60
+ "@atlaskit/section-message": "^6.3.0",
60
61
  "@atlaskit/ssr": "*",
61
- "@atlaskit/textarea": "^4.3.1",
62
+ "@atlaskit/textarea": "^4.5.0",
62
63
  "@atlaskit/visual-regression": "*",
63
64
  "@atlaskit/webdriver-runner": "*",
64
65
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
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