@atlaskit/modal-dialog 14.10.4 → 14.11.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 +16 -0
- package/codemods/utils.tsx +41 -15
- package/dist/cjs/internal/components/modal-dialog.js +2 -1
- package/dist/cjs/modal-header.compiled.css +3 -0
- package/dist/cjs/modal-header.js +13 -19
- package/dist/es2019/internal/components/modal-dialog.js +2 -1
- package/dist/es2019/modal-header.compiled.css +3 -0
- package/dist/es2019/modal-header.js +11 -17
- package/dist/esm/internal/components/modal-dialog.js +2 -1
- package/dist/esm/modal-header.compiled.css +3 -0
- package/dist/esm/modal-header.js +11 -17
- package/package.json +2 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/modal-dialog
|
|
2
2
|
|
|
3
|
+
## 14.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`ef58c5c05a8fe`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ef58c5c05a8fe) -
|
|
8
|
+
Clean up flag to ensure `autoFocus` is never off in preparation for removing the boolean
|
|
9
|
+
`autoFocus` option.
|
|
10
|
+
|
|
11
|
+
## 14.10.5
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`54274768b5a88`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/54274768b5a88) -
|
|
16
|
+
Fixed an issue where the modal title could overflow the width of the modal instead of truncating
|
|
17
|
+
when `isMultiline` is set to false
|
|
18
|
+
|
|
3
19
|
## 14.10.4
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/codemods/utils.tsx
CHANGED
|
@@ -61,7 +61,11 @@ export function getJSXAttributesByName(
|
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
export function hasImportDeclaration(
|
|
64
|
+
export function hasImportDeclaration(
|
|
65
|
+
j: core.JSCodeshift,
|
|
66
|
+
source: any,
|
|
67
|
+
importPath: string,
|
|
68
|
+
): boolean {
|
|
65
69
|
const imports = source
|
|
66
70
|
.find(j.ImportDeclaration)
|
|
67
71
|
.filter(
|
|
@@ -223,7 +227,12 @@ export function addToImport({
|
|
|
223
227
|
});
|
|
224
228
|
}
|
|
225
229
|
|
|
226
|
-
export const createRenameFuncFor: (
|
|
230
|
+
export const createRenameFuncFor: (
|
|
231
|
+
component: string,
|
|
232
|
+
importName: string,
|
|
233
|
+
from: string,
|
|
234
|
+
to: string,
|
|
235
|
+
) => (j: core.JSCodeshift, source: Collection<Node>) => void =
|
|
227
236
|
(component: string, importName: string, from: string, to: string) =>
|
|
228
237
|
(j: core.JSCodeshift, source: Collection<Node>) => {
|
|
229
238
|
const specifier = getNamedSpecifier(j, source, component, importName);
|
|
@@ -253,7 +262,12 @@ export const createRenameFuncFor: (component: string, importName: string, from:
|
|
|
253
262
|
}
|
|
254
263
|
};
|
|
255
264
|
|
|
256
|
-
export const createRemoveFuncIfBooleanFor: (
|
|
265
|
+
export const createRemoveFuncIfBooleanFor: (
|
|
266
|
+
component: string,
|
|
267
|
+
importName: string,
|
|
268
|
+
prop: string,
|
|
269
|
+
comment?: string,
|
|
270
|
+
) => (j: core.JSCodeshift, source: Collection<Node>) => void =
|
|
257
271
|
(component: string, importName: string, prop: string, comment?: string) =>
|
|
258
272
|
(j: core.JSCodeshift, source: Collection<Node>) => {
|
|
259
273
|
const specifier =
|
|
@@ -280,11 +294,16 @@ export const createRemoveFuncIfBooleanFor: (component: string, importName: strin
|
|
|
280
294
|
});
|
|
281
295
|
};
|
|
282
296
|
|
|
283
|
-
export const createRenameImportFor: ({
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
297
|
+
export const createRenameImportFor: ({
|
|
298
|
+
componentName,
|
|
299
|
+
newComponentName,
|
|
300
|
+
oldPackagePath,
|
|
301
|
+
newPackagePath,
|
|
302
|
+
}: {
|
|
303
|
+
componentName: string;
|
|
304
|
+
newComponentName?: string;
|
|
305
|
+
oldPackagePath: string;
|
|
306
|
+
newPackagePath: string;
|
|
288
307
|
}) => (j: core.JSCodeshift, source: Collection<Node>) => void =
|
|
289
308
|
({
|
|
290
309
|
componentName,
|
|
@@ -366,10 +385,14 @@ export const createRenameImportFor: ({ componentName, newComponentName, oldPacka
|
|
|
366
385
|
.remove();
|
|
367
386
|
};
|
|
368
387
|
|
|
369
|
-
export const createRemoveImportsFor: ({
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
388
|
+
export const createRemoveImportsFor: ({
|
|
389
|
+
importsToRemove,
|
|
390
|
+
packagePath,
|
|
391
|
+
comment,
|
|
392
|
+
}: {
|
|
393
|
+
importsToRemove: string[];
|
|
394
|
+
packagePath: string;
|
|
395
|
+
comment: string;
|
|
373
396
|
}) => (j: core.JSCodeshift, source: Collection<Node>) => void =
|
|
374
397
|
({
|
|
375
398
|
importsToRemove,
|
|
@@ -440,9 +463,12 @@ export const createRemoveImportsFor: ({ importsToRemove, packagePath, comment, }
|
|
|
440
463
|
}
|
|
441
464
|
};
|
|
442
465
|
|
|
443
|
-
export const createTransformer: (
|
|
444
|
-
|
|
445
|
-
|
|
466
|
+
export const createTransformer: (
|
|
467
|
+
component: string,
|
|
468
|
+
migrates: {
|
|
469
|
+
(j: core.JSCodeshift, source: Collection<Node>): void;
|
|
470
|
+
}[],
|
|
471
|
+
) => (fileInfo: FileInfo, api: API, options: Options) => string =
|
|
446
472
|
(component: string, migrates: { (j: core.JSCodeshift, source: Collection<Node>): void }[]) =>
|
|
447
473
|
(fileInfo: FileInfo, { jscodeshift: j }: API, options: Options) => {
|
|
448
474
|
const source: Collection<Node> = j(fileInfo.source);
|
|
@@ -60,7 +60,8 @@ var ModalDialog = function ModalDialog(props) {
|
|
|
60
60
|
var defaultTestId = testId || 'modal-dialog';
|
|
61
61
|
// https://product-fabric.atlassian.net/browse/DSP-24307
|
|
62
62
|
// If flag and falsy, use true instead.
|
|
63
|
-
|
|
63
|
+
// When we remove boolean `autoFocus`, we won't have to worry about this
|
|
64
|
+
var autoFocus = !providedAutoFocus ? true : providedAutoFocus;
|
|
64
65
|
(0, _react.useEffect)(function () {
|
|
65
66
|
// Modal dialogs can appear on top of iframe elements that are on another domain.
|
|
66
67
|
// There is a Chrome bug where drag and drop in an element on top of a cross domain
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
._18zr1ejb{padding-inline:var(--ds-space-300,24px)}
|
|
2
2
|
._1bah1yb4{justify-content:space-between}
|
|
3
|
+
._1bsb1osq{width:100%}
|
|
3
4
|
._1e0c1txw{display:flex}
|
|
4
5
|
._1q511ejb{padding-block-start:var(--ds-space-300,24px)}
|
|
6
|
+
._1ul9idpf{min-width:0}
|
|
7
|
+
._2lx21sbv{flex-direction:row-reverse}
|
|
5
8
|
._4cvr1h6o{align-items:center}
|
|
6
9
|
._6rth1i6y{margin-block-end:var(--ds-space-negative-025,-2px)}
|
|
7
10
|
._85i5pxbi{padding-block-end:var(--ds-space-200,1pc)}
|
package/dist/cjs/modal-header.js
CHANGED
|
@@ -9,15 +9,14 @@ exports.default = void 0;
|
|
|
9
9
|
require("./modal-header.compiled.css");
|
|
10
10
|
var _runtime = require("@compiled/react/runtime");
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
12
|
-
var
|
|
12
|
+
var _compiled = require("@atlaskit/primitives/compiled");
|
|
13
13
|
var _closeButton = require("./close-button");
|
|
14
14
|
var _hooks = require("./hooks");
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
});
|
|
15
|
+
var styles = {
|
|
16
|
+
header: "_18zr1ejb _1e0c1txw _kqswh2mm _4cvr1h6o _1bah1yb4 _6rth1i6y _85i5pxbi _1q511ejb",
|
|
17
|
+
flex: "_2lx21sbv _1bsb1osq",
|
|
18
|
+
titleContainer: "_1ul9idpf"
|
|
19
|
+
};
|
|
21
20
|
/**
|
|
22
21
|
* __Modal header__
|
|
23
22
|
*
|
|
@@ -42,25 +41,20 @@ var ModalHeader = function ModalHeader(props) {
|
|
|
42
41
|
var shouldShowCloseButton = hasCloseButton && hasProvidedOnClose && onClose;
|
|
43
42
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
44
43
|
"data-testid": testId,
|
|
45
|
-
className: (0, _runtime.ax)([
|
|
46
|
-
}, shouldShowCloseButton ?
|
|
47
|
-
/*#__PURE__*/
|
|
48
|
-
// The reason we are putting the close button first in the DOM and then
|
|
49
|
-
// reordering them is to ensure that users of assistive technology get
|
|
50
|
-
// all the context of a modal when initial focus is placed on the close
|
|
51
|
-
// button, since it's the first interactive element.
|
|
52
|
-
_react.default.createElement(_primitives.Flex, {
|
|
44
|
+
className: (0, _runtime.ax)([styles.header])
|
|
45
|
+
}, shouldShowCloseButton ? /*#__PURE__*/_react.default.createElement(_compiled.Flex, {
|
|
53
46
|
gap: "space.200",
|
|
54
47
|
justifyContent: "space-between",
|
|
55
|
-
xcss:
|
|
56
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
48
|
+
xcss: styles.flex
|
|
49
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Flex, {
|
|
57
50
|
justifyContent: "end"
|
|
58
51
|
}, /*#__PURE__*/_react.default.createElement(_closeButton.CloseButton, {
|
|
59
52
|
onClick: onClose,
|
|
60
53
|
testId: modalTestId
|
|
61
|
-
})), /*#__PURE__*/_react.default.createElement(
|
|
54
|
+
})), /*#__PURE__*/_react.default.createElement(_compiled.Flex, {
|
|
62
55
|
justifyContent: "start",
|
|
63
|
-
alignItems: "center"
|
|
56
|
+
alignItems: "center",
|
|
57
|
+
xcss: styles.titleContainer
|
|
64
58
|
}, children)) : children);
|
|
65
59
|
};
|
|
66
60
|
var _default = exports.default = ModalHeader;
|
|
@@ -48,7 +48,8 @@ const ModalDialog = props => {
|
|
|
48
48
|
const defaultTestId = testId || 'modal-dialog';
|
|
49
49
|
// https://product-fabric.atlassian.net/browse/DSP-24307
|
|
50
50
|
// If flag and falsy, use true instead.
|
|
51
|
-
|
|
51
|
+
// When we remove boolean `autoFocus`, we won't have to worry about this
|
|
52
|
+
const autoFocus = !providedAutoFocus ? true : providedAutoFocus;
|
|
52
53
|
useEffect(() => {
|
|
53
54
|
// Modal dialogs can appear on top of iframe elements that are on another domain.
|
|
54
55
|
// There is a Chrome bug where drag and drop in an element on top of a cross domain
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
._18zr1ejb{padding-inline:var(--ds-space-300,24px)}
|
|
2
2
|
._1bah1yb4{justify-content:space-between}
|
|
3
|
+
._1bsb1osq{width:100%}
|
|
3
4
|
._1e0c1txw{display:flex}
|
|
4
5
|
._1q511ejb{padding-block-start:var(--ds-space-300,24px)}
|
|
6
|
+
._1ul9idpf{min-width:0}
|
|
7
|
+
._2lx21sbv{flex-direction:row-reverse}
|
|
5
8
|
._4cvr1h6o{align-items:center}
|
|
6
9
|
._6rth1i6y{margin-block-end:var(--ds-space-negative-025,-2px)}
|
|
7
10
|
._85i5pxbi{padding-block-end:var(--ds-space-200,1pc)}
|
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
import "./modal-header.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React from 'react';
|
|
5
|
-
|
|
6
|
-
import { Flex, xcss } from '@atlaskit/primitives';
|
|
5
|
+
import { Flex } from '@atlaskit/primitives/compiled';
|
|
7
6
|
import { CloseButton } from './close-button';
|
|
8
7
|
import { useModal } from './hooks';
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
8
|
+
const styles = {
|
|
9
|
+
header: "_18zr1ejb _1e0c1txw _kqswh2mm _4cvr1h6o _1bah1yb4 _6rth1i6y _85i5pxbi _1q511ejb",
|
|
10
|
+
flex: "_2lx21sbv _1bsb1osq",
|
|
11
|
+
titleContainer: "_1ul9idpf"
|
|
12
|
+
};
|
|
14
13
|
/**
|
|
15
14
|
* __Modal header__
|
|
16
15
|
*
|
|
@@ -37,17 +36,11 @@ const ModalHeader = props => {
|
|
|
37
36
|
const shouldShowCloseButton = hasCloseButton && hasProvidedOnClose && onClose;
|
|
38
37
|
return /*#__PURE__*/React.createElement("div", {
|
|
39
38
|
"data-testid": testId,
|
|
40
|
-
className: ax([
|
|
41
|
-
}, shouldShowCloseButton ?
|
|
42
|
-
/*#__PURE__*/
|
|
43
|
-
// The reason we are putting the close button first in the DOM and then
|
|
44
|
-
// reordering them is to ensure that users of assistive technology get
|
|
45
|
-
// all the context of a modal when initial focus is placed on the close
|
|
46
|
-
// button, since it's the first interactive element.
|
|
47
|
-
React.createElement(Flex, {
|
|
39
|
+
className: ax([styles.header])
|
|
40
|
+
}, shouldShowCloseButton ? /*#__PURE__*/React.createElement(Flex, {
|
|
48
41
|
gap: "space.200",
|
|
49
42
|
justifyContent: "space-between",
|
|
50
|
-
xcss:
|
|
43
|
+
xcss: styles.flex
|
|
51
44
|
}, /*#__PURE__*/React.createElement(Flex, {
|
|
52
45
|
justifyContent: "end"
|
|
53
46
|
}, /*#__PURE__*/React.createElement(CloseButton, {
|
|
@@ -55,7 +48,8 @@ const ModalHeader = props => {
|
|
|
55
48
|
testId: modalTestId
|
|
56
49
|
})), /*#__PURE__*/React.createElement(Flex, {
|
|
57
50
|
justifyContent: "start",
|
|
58
|
-
alignItems: "center"
|
|
51
|
+
alignItems: "center",
|
|
52
|
+
xcss: styles.titleContainer
|
|
59
53
|
}, children)) : children);
|
|
60
54
|
};
|
|
61
55
|
export default ModalHeader;
|
|
@@ -51,7 +51,8 @@ var ModalDialog = function ModalDialog(props) {
|
|
|
51
51
|
var defaultTestId = testId || 'modal-dialog';
|
|
52
52
|
// https://product-fabric.atlassian.net/browse/DSP-24307
|
|
53
53
|
// If flag and falsy, use true instead.
|
|
54
|
-
|
|
54
|
+
// When we remove boolean `autoFocus`, we won't have to worry about this
|
|
55
|
+
var autoFocus = !providedAutoFocus ? true : providedAutoFocus;
|
|
55
56
|
useEffect(function () {
|
|
56
57
|
// Modal dialogs can appear on top of iframe elements that are on another domain.
|
|
57
58
|
// There is a Chrome bug where drag and drop in an element on top of a cross domain
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
._18zr1ejb{padding-inline:var(--ds-space-300,24px)}
|
|
2
2
|
._1bah1yb4{justify-content:space-between}
|
|
3
|
+
._1bsb1osq{width:100%}
|
|
3
4
|
._1e0c1txw{display:flex}
|
|
4
5
|
._1q511ejb{padding-block-start:var(--ds-space-300,24px)}
|
|
6
|
+
._1ul9idpf{min-width:0}
|
|
7
|
+
._2lx21sbv{flex-direction:row-reverse}
|
|
5
8
|
._4cvr1h6o{align-items:center}
|
|
6
9
|
._6rth1i6y{margin-block-end:var(--ds-space-negative-025,-2px)}
|
|
7
10
|
._85i5pxbi{padding-block-end:var(--ds-space-200,1pc)}
|
package/dist/esm/modal-header.js
CHANGED
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
import "./modal-header.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React from 'react';
|
|
5
|
-
|
|
6
|
-
import { Flex, xcss } from '@atlaskit/primitives';
|
|
5
|
+
import { Flex } from '@atlaskit/primitives/compiled';
|
|
7
6
|
import { CloseButton } from './close-button';
|
|
8
7
|
import { useModal } from './hooks';
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
8
|
+
var styles = {
|
|
9
|
+
header: "_18zr1ejb _1e0c1txw _kqswh2mm _4cvr1h6o _1bah1yb4 _6rth1i6y _85i5pxbi _1q511ejb",
|
|
10
|
+
flex: "_2lx21sbv _1bsb1osq",
|
|
11
|
+
titleContainer: "_1ul9idpf"
|
|
12
|
+
};
|
|
14
13
|
/**
|
|
15
14
|
* __Modal header__
|
|
16
15
|
*
|
|
@@ -35,17 +34,11 @@ var ModalHeader = function ModalHeader(props) {
|
|
|
35
34
|
var shouldShowCloseButton = hasCloseButton && hasProvidedOnClose && onClose;
|
|
36
35
|
return /*#__PURE__*/React.createElement("div", {
|
|
37
36
|
"data-testid": testId,
|
|
38
|
-
className: ax([
|
|
39
|
-
}, shouldShowCloseButton ?
|
|
40
|
-
/*#__PURE__*/
|
|
41
|
-
// The reason we are putting the close button first in the DOM and then
|
|
42
|
-
// reordering them is to ensure that users of assistive technology get
|
|
43
|
-
// all the context of a modal when initial focus is placed on the close
|
|
44
|
-
// button, since it's the first interactive element.
|
|
45
|
-
React.createElement(Flex, {
|
|
37
|
+
className: ax([styles.header])
|
|
38
|
+
}, shouldShowCloseButton ? /*#__PURE__*/React.createElement(Flex, {
|
|
46
39
|
gap: "space.200",
|
|
47
40
|
justifyContent: "space-between",
|
|
48
|
-
xcss:
|
|
41
|
+
xcss: styles.flex
|
|
49
42
|
}, /*#__PURE__*/React.createElement(Flex, {
|
|
50
43
|
justifyContent: "end"
|
|
51
44
|
}, /*#__PURE__*/React.createElement(CloseButton, {
|
|
@@ -53,7 +46,8 @@ var ModalHeader = function ModalHeader(props) {
|
|
|
53
46
|
testId: modalTestId
|
|
54
47
|
})), /*#__PURE__*/React.createElement(Flex, {
|
|
55
48
|
justifyContent: "start",
|
|
56
|
-
alignItems: "center"
|
|
49
|
+
alignItems: "center",
|
|
50
|
+
xcss: styles.titleContainer
|
|
57
51
|
}, children)) : children);
|
|
58
52
|
};
|
|
59
53
|
export default ModalHeader;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/modal-dialog",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.11.0",
|
|
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/"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@af/accessibility-testing": "workspace:^",
|
|
56
56
|
"@af/integration-testing": "workspace:^",
|
|
57
57
|
"@af/visual-regression": "workspace:^",
|
|
58
|
-
"@atlaskit/avatar": "^25.
|
|
58
|
+
"@atlaskit/avatar": "^25.8.0",
|
|
59
59
|
"@atlaskit/avatar-group": "^12.4.0",
|
|
60
60
|
"@atlaskit/banner": "^14.0.0",
|
|
61
61
|
"@atlaskit/breadcrumbs": "^15.3.0",
|
|
@@ -124,9 +124,6 @@
|
|
|
124
124
|
"platform_modal-dialog-heading-icon-a11y-fix": {
|
|
125
125
|
"type": "boolean"
|
|
126
126
|
},
|
|
127
|
-
"platform_dst_autofocus-never-false": {
|
|
128
|
-
"type": "boolean"
|
|
129
|
-
},
|
|
130
127
|
"platform-dst-shape-theme-default": {
|
|
131
128
|
"type": "boolean"
|
|
132
129
|
}
|