@atlaskit/modal-dialog 14.11.1 → 14.11.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/modal-dialog
2
2
 
3
+ ## 14.11.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 14.11.2
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 14.11.1
4
16
 
5
17
  ### Patch Changes
@@ -152,4 +152,74 @@ describe('Remove autoFocus prop', () => {
152
152
  `,
153
153
  'should remove autoFocus prop with aliased import',
154
154
  );
155
+ defineInlineTest(
156
+ { default: transformer, parser: 'tsx' },
157
+ {},
158
+ `
159
+ import React from 'react';
160
+ import Button from '@atlaskit/button';
161
+ import { ModalDialog } from '@atlaskit/modal-dialog';
162
+
163
+ const SimpleModalDialog = () => {
164
+ return (
165
+ <ModalDialog onClose={closeModal} width={1100}>
166
+ <Button appearance="primary" onClick={closeModal} autoFocus>
167
+ Close
168
+ </Button>
169
+ </ModalDialog>
170
+ );
171
+ }
172
+ `,
173
+ `
174
+ import React from 'react';
175
+ import Button from '@atlaskit/button';
176
+ import { ModalDialog } from '@atlaskit/modal-dialog';
177
+
178
+ const SimpleModalDialog = () => {
179
+ return (
180
+ <ModalDialog onClose={closeModal} width={1100}>
181
+ <Button appearance="primary" onClick={closeModal} autoFocus>
182
+ Close
183
+ </Button>
184
+ </ModalDialog>
185
+ );
186
+ }
187
+ `,
188
+ 'should not remove autoFocus prop from component inside modal',
189
+ );
190
+ defineInlineTest(
191
+ { default: transformer, parser: 'tsx' },
192
+ {},
193
+ `
194
+ import React from 'react';
195
+ import Button from '@atlaskit/button';
196
+ import { ModalDialog } from '@atlaskit/modal-dialog';
197
+
198
+ const SimpleModalDialog = () => {
199
+ return (
200
+ <ModalDialog onClose={closeModal} width={1100} autoFocus={false}>
201
+ <Button appearance="primary" onClick={closeModal} autoFocus>
202
+ Close
203
+ </Button>
204
+ </ModalDialog>
205
+ );
206
+ }
207
+ `,
208
+ `
209
+ import React from 'react';
210
+ import Button from '@atlaskit/button';
211
+ import { ModalDialog } from '@atlaskit/modal-dialog';
212
+
213
+ const SimpleModalDialog = () => {
214
+ return (
215
+ <ModalDialog onClose={closeModal} width={1100}>
216
+ <Button appearance="primary" onClick={closeModal} autoFocus>
217
+ Close
218
+ </Button>
219
+ </ModalDialog>
220
+ );
221
+ }
222
+ `,
223
+ 'should remove modal autoFocus but not from component inside modal',
224
+ );
155
225
  });
@@ -280,10 +280,15 @@ export const createRemoveFuncIfBooleanFor: (
280
280
 
281
281
  source.findJSXElements(specifier).forEach((element) => {
282
282
  getJSXAttributesByName(j, element, prop).forEach((attribute) => {
283
+ const el = attribute.parent.value;
283
284
  if (
284
- attribute.value.value === null ||
285
- (attribute.value.value?.type === 'JSXExpressionContainer' &&
286
- attribute.value.value.expression.type === 'BooleanLiteral')
285
+ // Verify the element we are working on is the element we want
286
+ el.type === 'JSXOpeningElement' &&
287
+ el.name.type === 'JSXIdentifier' &&
288
+ el.name.name === specifier &&
289
+ (attribute.value.value === null ||
290
+ (attribute.value.value?.type === 'JSXExpressionContainer' &&
291
+ attribute.value.value.expression.type === 'BooleanLiteral'))
287
292
  ) {
288
293
  j(attribute).remove();
289
294
  if (comment) {
@@ -1,4 +1,4 @@
1
- /* modal-dialog.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* modal-dialog.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* modal-wrapper.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* modal-wrapper.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -88,7 +88,7 @@ var InternalModalWrapper = function InternalModalWrapper(props) {
88
88
  action: 'closed',
89
89
  componentName: 'modalDialog',
90
90
  packageName: "@atlaskit/modal-dialog",
91
- packageVersion: "14.11.0"
91
+ packageVersion: "0.0.0-development"
92
92
  });
93
93
  var onBlanketClicked = (0, _react.useCallback)(function (e) {
94
94
  if (shouldCloseOnOverlayClick) {
@@ -1,4 +1,4 @@
1
- /* positioner.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* positioner.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  "use strict";
3
3
 
4
4
  var _typeof = require("@babel/runtime/helpers/typeof");
@@ -1,4 +1,4 @@
1
- /* scroll-container.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* scroll-container.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* modal-body.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* modal-body.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* modal-footer.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* modal-footer.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  "use strict";
3
3
 
4
4
  var _typeof = require("@babel/runtime/helpers/typeof");
@@ -1,4 +1,4 @@
1
- /* modal-header.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* modal-header.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* modal-title.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* modal-title.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* modal-dialog.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* modal-dialog.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./modal-dialog.compiled.css";
4
4
  import * as React from 'react';
@@ -1,4 +1,4 @@
1
- /* modal-wrapper.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* modal-wrapper.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./modal-wrapper.compiled.css";
4
4
  import * as React from 'react';
@@ -75,7 +75,7 @@ const InternalModalWrapper = props => {
75
75
  action: 'closed',
76
76
  componentName: 'modalDialog',
77
77
  packageName: "@atlaskit/modal-dialog",
78
- packageVersion: "14.11.0"
78
+ packageVersion: "0.0.0-development"
79
79
  });
80
80
  const onBlanketClicked = useCallback(e => {
81
81
  if (shouldCloseOnOverlayClick) {
@@ -1,4 +1,4 @@
1
- /* positioner.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* positioner.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import "./positioner.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* scroll-container.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* scroll-container.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import "./scroll-container.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React, { forwardRef, useEffect, useRef, useState } from 'react';
@@ -1,4 +1,4 @@
1
- /* modal-body.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* modal-body.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import "./modal-body.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* modal-footer.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* modal-footer.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import "./modal-footer.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* modal-header.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* modal-header.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import "./modal-header.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* modal-title.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* modal-title.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import "./modal-title.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* modal-dialog.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* modal-dialog.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  import _typeof from "@babel/runtime/helpers/typeof";
@@ -1,4 +1,4 @@
1
- /* modal-wrapper.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* modal-wrapper.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./modal-wrapper.compiled.css";
4
4
  import * as React from 'react';
@@ -79,7 +79,7 @@ var InternalModalWrapper = function InternalModalWrapper(props) {
79
79
  action: 'closed',
80
80
  componentName: 'modalDialog',
81
81
  packageName: "@atlaskit/modal-dialog",
82
- packageVersion: "14.11.0"
82
+ packageVersion: "0.0.0-development"
83
83
  });
84
84
  var onBlanketClicked = useCallback(function (e) {
85
85
  if (shouldCloseOnOverlayClick) {
@@ -1,4 +1,4 @@
1
- /* positioner.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* positioner.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import "./positioner.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* scroll-container.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* scroll-container.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import "./scroll-container.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* modal-body.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* modal-body.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import "./modal-body.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* modal-footer.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* modal-footer.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import "./modal-footer.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* modal-header.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* modal-header.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import "./modal-header.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* modal-title.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* modal-title.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import "./modal-title.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/modal-dialog",
3
- "version": "14.11.1",
3
+ "version": "14.11.3",
4
4
  "description": "A modal dialog displays content that requires user interaction, in a layer above the page.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -29,20 +29,20 @@
29
29
  "dependencies": {
30
30
  "@atlaskit/analytics-next": "^11.1.0",
31
31
  "@atlaskit/blanket": "^15.0.0",
32
- "@atlaskit/button": "^23.9.0",
32
+ "@atlaskit/button": "^23.10.0",
33
33
  "@atlaskit/css": "^0.19.0",
34
- "@atlaskit/ds-lib": "^5.3.0",
34
+ "@atlaskit/ds-lib": "^6.0.0",
35
35
  "@atlaskit/icon": "^32.0.0",
36
36
  "@atlaskit/layering": "^3.6.0",
37
- "@atlaskit/motion": "^5.3.0",
37
+ "@atlaskit/motion": "^5.4.0",
38
38
  "@atlaskit/platform-feature-flags": "^1.1.0",
39
39
  "@atlaskit/portal": "^5.2.0",
40
40
  "@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
41
41
  "@atlaskit/primitives": "^18.0.0",
42
- "@atlaskit/theme": "^21.0.0",
43
- "@atlaskit/tokens": "^11.0.0",
42
+ "@atlaskit/theme": "^22.0.0",
43
+ "@atlaskit/tokens": "^11.1.0",
44
44
  "@babel/runtime": "^7.0.0",
45
- "@compiled/react": "^0.18.6",
45
+ "@compiled/react": "^0.20.0",
46
46
  "bind-event-listener": "^3.0.0",
47
47
  "raf-schd": "^4.0.3",
48
48
  "react-focus-lock": "^2.9.5",
@@ -62,16 +62,16 @@
62
62
  "@atlaskit/checkbox": "^17.3.0",
63
63
  "@atlaskit/code": "^17.4.0",
64
64
  "@atlaskit/datetime-picker": "^17.5.0",
65
- "@atlaskit/docs": "^11.4.0",
66
- "@atlaskit/dropdown-menu": "^16.4.0",
65
+ "@atlaskit/docs": "^11.6.0",
66
+ "@atlaskit/dropdown-menu": "^16.6.0",
67
67
  "@atlaskit/flag": "^17.8.0",
68
- "@atlaskit/form": "^15.3.0",
68
+ "@atlaskit/form": "^15.4.0",
69
69
  "@atlaskit/heading": "^5.3.0",
70
70
  "@atlaskit/link": "^3.3.0",
71
71
  "@atlaskit/popup": "^4.13.0",
72
72
  "@atlaskit/radio": "^8.4.0",
73
73
  "@atlaskit/section-message": "^8.12.0",
74
- "@atlaskit/select": "^21.7.0",
74
+ "@atlaskit/select": "^21.8.0",
75
75
  "@atlaskit/spotlight": "^0.10.0",
76
76
  "@atlaskit/textfield": "^8.2.0",
77
77
  "@atlaskit/tooltip": "^20.14.0",