@atlaskit/modal-dialog 17.2.1 → 17.2.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 +15 -0
- package/codemods/utils/create-remove-func-if-boolean-for.tsx +2 -1
- package/codemods/utils/create-rename-func-for.tsx +2 -1
- package/dist/cjs/internal/components/modal-dialog.compiled.css +3 -0
- package/dist/cjs/internal/components/modal-dialog.js +3 -2
- package/dist/cjs/internal/components/modal-wrapper.compiled.css +8 -1
- package/dist/cjs/internal/components/modal-wrapper.js +20 -9
- package/dist/es2019/internal/components/modal-dialog.compiled.css +3 -0
- package/dist/es2019/internal/components/modal-dialog.js +3 -2
- package/dist/es2019/internal/components/modal-wrapper.compiled.css +8 -1
- package/dist/es2019/internal/components/modal-wrapper.js +20 -9
- package/dist/esm/internal/components/modal-dialog.compiled.css +3 -0
- package/dist/esm/internal/components/modal-dialog.js +3 -2
- package/dist/esm/internal/components/modal-wrapper.compiled.css +8 -1
- package/dist/esm/internal/components/modal-wrapper.js +20 -9
- package/package.json +5 -4
- package/codemods/utils/get-jsx-attributes-by-name.tsx +0 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/modal-dialog
|
|
2
2
|
|
|
3
|
+
## 17.2.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`3827588cae5e1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3827588cae5e1) -
|
|
8
|
+
Preserve form-wrapped modal scrolling when fixed-position status announcements are enabled.
|
|
9
|
+
|
|
10
|
+
## 17.2.2
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`6a5baf4c2b1ac`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6a5baf4c2b1ac) -
|
|
15
|
+
Behind `platform-dst-top-layer`, a modal with no `height` sizes to its content again. Before, a
|
|
16
|
+
child with `flex: 1` collapsed the modal to 0px.
|
|
17
|
+
|
|
3
18
|
## 17.2.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { type JSCodeshift } from 'jscodeshift';
|
|
2
2
|
import { type Collection } from 'jscodeshift/src/Collection';
|
|
3
3
|
|
|
4
|
+
import { getJSXAttributesByName } from '@atlaskit/codemod-utils/support';
|
|
5
|
+
|
|
4
6
|
import { addCommentToStartOfFile } from './add-comment-to-start-of-file';
|
|
5
7
|
import { getDefaultSpecifier } from './get-default-specifier';
|
|
6
|
-
import { getJSXAttributesByName } from './get-jsx-attributes-by-name';
|
|
7
8
|
import { getNamedSpecifier } from './get-named-specifier';
|
|
8
9
|
|
|
9
10
|
export const createRemoveFuncIfBooleanFor: (
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type JSCodeshift, type VariableDeclaration } from 'jscodeshift';
|
|
2
2
|
import { type Collection } from 'jscodeshift/src/Collection';
|
|
3
3
|
|
|
4
|
+
import { getJSXAttributesByName } from '@atlaskit/codemod-utils/support';
|
|
5
|
+
|
|
4
6
|
import { findIdentifierAndReplaceAttribute } from './find-identifier-and-replace-attribute';
|
|
5
|
-
import { getJSXAttributesByName } from './get-jsx-attributes-by-name';
|
|
6
7
|
import { getNamedSpecifier } from './get-named-specifier';
|
|
7
8
|
import { hasVariableAssignment } from './has-variable-assignment';
|
|
8
9
|
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
._16jlidpf{flex-grow:0}
|
|
2
|
+
._185i1kw7>form{flex-direction:inherit}
|
|
2
3
|
._1bsb1osq{width:100%}
|
|
3
4
|
._1dg11kw7>form:only-child{flex-direction:inherit}
|
|
4
5
|
._1e0c1txw{display:flex}
|
|
6
|
+
._1m0h1kw7>form{display:inherit}
|
|
5
7
|
._1mq81kw7>form:only-child{display:inherit}
|
|
6
8
|
._1o9zkb7n{flex-shrink:1}
|
|
7
9
|
._1q1l1bhr{--ds-elevation-surface-current:var(--ds-surface-overlay,#fff)}
|
|
8
10
|
._1tke1kxc{min-height:100vh}
|
|
9
11
|
._1tkeidpf{min-height:0}
|
|
12
|
+
._1vgv1kw7>form{max-height:inherit}
|
|
10
13
|
._2lx21bp4{flex-direction:column}
|
|
11
14
|
._4t3i1osq{height:100%}
|
|
12
15
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
@@ -42,6 +42,7 @@ var dialogStyles = {
|
|
|
42
42
|
rootMotion: "_yakv1wug _4lht1wug",
|
|
43
43
|
fullscreen: "_1jyk1osq"
|
|
44
44
|
};
|
|
45
|
+
var formWithStatusAnnouncementStyles = null;
|
|
45
46
|
var viewportScrollStyles = null;
|
|
46
47
|
var bodyScrollStyles = null;
|
|
47
48
|
var ModalDialog = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
@@ -143,7 +144,7 @@ var ModalDialog = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
143
144
|
tabIndex: -1,
|
|
144
145
|
"aria-modal": true,
|
|
145
146
|
"data-ds--level": currentLevel,
|
|
146
|
-
className: (0, _runtime.ax)([dialogStyles.root, dialogStyles.rootMotion, !isFullScreen && dialogStyles.borderRadius, shouldScrollInViewport ? "_1tke1kxc _c71lglyw _8kn617ks" : "_cbiz17ks _bolh1kw7"])
|
|
147
|
+
className: (0, _runtime.ax)([dialogStyles.root, (0, _fg.fg)('dst_platform-global_ep_status_announcement') && "_1m0h1kw7 _1vgv1kw7 _185i1kw7", dialogStyles.rootMotion, !isFullScreen && dialogStyles.borderRadius, shouldScrollInViewport ? "_1tke1kxc _c71lglyw _8kn617ks" : "_cbiz17ks _bolh1kw7"])
|
|
147
148
|
}, children)) : /*#__PURE__*/React.createElement(_fadeIn.default
|
|
148
149
|
/**
|
|
149
150
|
* We don't want a 'slide in' for the full screen modals.
|
|
@@ -161,7 +162,7 @@ var ModalDialog = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
161
162
|
'--modal-dialog-height': (0, _dialogHeight.dialogHeight)(height)
|
|
162
163
|
},
|
|
163
164
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
164
|
-
className: (0, _runtime.ax)([dialogStyles.root, !isFullScreen && dialogStyles.borderRadius, shouldScrollInViewport ? "_1tke1kxc _c71lglyw _8kn617ks" : "_cbiz17ks _bolh1kw7", bottomFadeInProps.className]),
|
|
165
|
+
className: (0, _runtime.ax)([dialogStyles.root, (0, _fg.fg)('dst_platform-global_ep_status_announcement') && "_1m0h1kw7 _1vgv1kw7 _185i1kw7", !isFullScreen && dialogStyles.borderRadius, shouldScrollInViewport ? "_1tke1kxc _c71lglyw _8kn617ks" : "_cbiz17ks _bolh1kw7", bottomFadeInProps.className]),
|
|
165
166
|
role: "dialog",
|
|
166
167
|
"aria-labelledby": label ? undefined : titleId,
|
|
167
168
|
"data-testid": defaultTestId,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
._2rkoidpf{border-radius:0}
|
|
2
2
|
._152tze3t{inset-block-start:var(--ds-space-0,0)}
|
|
3
|
+
._185i1kw7>form{flex-direction:inherit}
|
|
3
4
|
._18m91wug{overflow-y:auto}
|
|
4
5
|
._18m9ewfl{overflow-y:visible}
|
|
5
6
|
._18u0idpf{margin-left:0}
|
|
@@ -7,22 +8,28 @@
|
|
|
7
8
|
._1bsbauwl{width:100vw}
|
|
8
9
|
._1dg11kw7>form:only-child{flex-direction:inherit}
|
|
9
10
|
._1e02ze3t{inset-inline-start:var(--ds-space-0,0)}
|
|
11
|
+
._1e0c11p5{display:grid}
|
|
10
12
|
._1e0c1txw{display:flex}
|
|
13
|
+
._1m0h1kw7>form{display:inherit}
|
|
11
14
|
._1mq81kw7>form:only-child{display:inherit}
|
|
12
15
|
._1q1l1bhr{--ds-elevation-surface-current:var(--ds-surface-overlay,#fff)}
|
|
13
16
|
._1reoewfl{overflow-x:visible}
|
|
17
|
+
._1vgv1kw7>form{max-height:inherit}
|
|
14
18
|
._2hwxidpf{margin-right:0}
|
|
15
19
|
._2lx21bp4{flex-direction:column}
|
|
20
|
+
._2z05i47z{grid-template-rows:minmax(0,1fr)}
|
|
16
21
|
._4t3i1kxc{height:100vh}
|
|
17
22
|
._8am5i4x0{-webkit-overflow-scrolling:touch}
|
|
18
23
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
19
24
|
._ds62idpf>form:only-child{min-height:0}
|
|
20
25
|
._kqsw1n9t{position:fixed}
|
|
26
|
+
._kzbqidpf>form{min-height:0}
|
|
21
27
|
._lcxv1wug{pointer-events:auto}
|
|
28
|
+
._lcxvglyw{pointer-events:none}
|
|
22
29
|
._ln19p27b{scrollbar-gutter:stable}
|
|
23
30
|
._m01u1kw7>form:only-child{max-height:inherit}
|
|
24
31
|
._otyridpf{margin-bottom:0}._128mdkaa:focus-visible{outline-width:var(--ds-border-width-focused,2px)}
|
|
25
32
|
._1ah3dkaa:focus-visible{outline-offset:var(--ds-border-width-focused,2px)}
|
|
26
33
|
._mizu1v1w:focus-visible{outline-color:var(--ds-border-focused,#4688ec)}
|
|
27
34
|
._ra3xnqa1:focus-visible{outline-style:solid}
|
|
28
|
-
@media (min-width:30rem){._1jyk17ks{height:var(--modal-dialog-height)}._g7116m9r{width:var(--modal-dialog-width)}._we1i18uh{max-width:calc(100vw - 90pt)}._e8uo221b{max-height:calc(100vh - 90pt)}._1sg41wqb{margin-top:60px}._maxs1wug{margin-right:auto}._1jvh1wqb{margin-bottom:60px}._1uca1wug{margin-left:auto}._1mpv184x{min-height:min-content}.
|
|
35
|
+
@media (min-width:30rem){._1jyk17ks{height:var(--modal-dialog-height)}._g7116m9r{width:var(--modal-dialog-width)}._we1i18uh{max-width:calc(100vw - 90pt)}._e8uo221b{max-height:calc(100vh - 90pt)}._1sg41wqb{margin-top:60px}._maxs1wug{margin-right:auto}._1jvh1wqb{margin-bottom:60px}._1uca1wug{margin-left:auto}._1mpv184x{min-height:min-content}._epkxpb1k{border-radius:var(--ds-radius-xlarge,9pt)}._zg7p130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}}
|
|
@@ -68,12 +68,23 @@ var surfaceStyles = {
|
|
|
68
68
|
root: "_1e0c1txw _2lx21bp4 _bfhk1bhr _1q1l1bhr _lcxv1wug _1mq81kw7 _m01u1kw7 _ds62idpf _1dg11kw7 _mizu1v1w _1ah3dkaa _ra3xnqa1 _128mdkaa _zg7p130s",
|
|
69
69
|
borderRadius: "_2rkoidpf _epkxpb1k"
|
|
70
70
|
};
|
|
71
|
+
var formWithStatusAnnouncementStyles = null;
|
|
71
72
|
var topLayerScrollModeStyles = {
|
|
72
73
|
'full-screen': "_1bsbauwl _4t3i1kxc _kqsw1n9t _152tze3t _1e02ze3t _18m91wug _8am5i4x0",
|
|
73
74
|
'viewport-scroll': "_4t3i1kxc _1sg41wqb _maxs1wug _1jvh1wqb _1uca1wug _1mpv184x _1jyk17ks _g7116m9r _we1i18uh",
|
|
74
75
|
'body-scroll': "_1bsbauwl _4t3i1kxc _1jyk17ks _g7116m9r _we1i18uh _e8uo221b"
|
|
75
76
|
};
|
|
76
|
-
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Sizing container around the surface. As a stretched grid item, the surface sizes to its content
|
|
80
|
+
* and has a definite height. A fixed height with `max-height: max-content` collapses with a
|
|
81
|
+
* `flex: 1` child. `pointer-events: none` keeps presses beside the surface as backdrop presses.
|
|
82
|
+
*/
|
|
83
|
+
var sizingContainerStyles = {
|
|
84
|
+
'body-scroll': "_1e0c11p5 _2z05i47z _lcxvglyw _e8uo221b",
|
|
85
|
+
'viewport-scroll': "_1e0c11p5 _lcxvglyw",
|
|
86
|
+
'full-screen': "_1e0c11p5 _lcxvglyw"
|
|
87
|
+
};
|
|
77
88
|
var allowlistElements = function allowlistElements(element, callback) {
|
|
78
89
|
// Allow focus outside modal when AUI dialog is visible
|
|
79
90
|
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage -- legacy FocusLock allowlist
|
|
@@ -95,7 +106,7 @@ function useModalCloseHandler(providedOnClose) {
|
|
|
95
106
|
action: 'closed',
|
|
96
107
|
componentName: 'modalDialog',
|
|
97
108
|
packageName: "@atlaskit/modal-dialog",
|
|
98
|
-
packageVersion: "17.2.
|
|
109
|
+
packageVersion: "17.2.2"
|
|
99
110
|
});
|
|
100
111
|
}
|
|
101
112
|
function getScrollMode(_ref) {
|
|
@@ -134,11 +145,9 @@ function getTopLayerSurfaceWidth(input) {
|
|
|
134
145
|
}
|
|
135
146
|
function getTopLayerSurfaceHeight(input) {
|
|
136
147
|
if (!input) {
|
|
137
|
-
//
|
|
138
|
-
//
|
|
139
|
-
|
|
140
|
-
// in order for child elements with 100% height to work correctly.
|
|
141
|
-
return 'calc(100vh - 120px)';
|
|
148
|
+
// Size to the content. The sizing container gives the surface a definite height, so
|
|
149
|
+
// children with `height: 100%` still fill it. See `sizingContainerStyles`.
|
|
150
|
+
return 'auto';
|
|
142
151
|
}
|
|
143
152
|
if (typeof input === 'number') {
|
|
144
153
|
return "".concat(input, "px");
|
|
@@ -353,17 +362,19 @@ function ModalWrapperTopLayer(props) {
|
|
|
353
362
|
}), /*#__PURE__*/React.createElement(_dialogScrollLock.DialogScrollLock, {
|
|
354
363
|
isOpen: true
|
|
355
364
|
}), /*#__PURE__*/React.createElement("div", {
|
|
365
|
+
className: (0, _runtime.ax)([sizingContainerStyles[scrollMode]])
|
|
366
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
356
367
|
ref: contentRef,
|
|
357
368
|
style: {
|
|
358
369
|
'--modal-dialog-height': getTopLayerSurfaceHeight(height),
|
|
359
370
|
'--modal-dialog-width': getTopLayerSurfaceWidth(width)
|
|
360
371
|
},
|
|
361
|
-
className: (0, _runtime.ax)([surfaceStyles.root, !isFullScreen && surfaceStyles.borderRadius, topLayerScrollModeStyles[scrollMode]
|
|
372
|
+
className: (0, _runtime.ax)([surfaceStyles.root, (0, _fg.fg)('dst_platform-global_ep_status_announcement') && "_1m0h1kw7 _kzbqidpf _1vgv1kw7 _185i1kw7", !isFullScreen && surfaceStyles.borderRadius, topLayerScrollModeStyles[scrollMode]])
|
|
362
373
|
}, /*#__PURE__*/React.createElement(_context.ModalContext.Provider, {
|
|
363
374
|
value: modalDialogContext
|
|
364
375
|
}, /*#__PURE__*/React.createElement(_scrollContext.ScrollContext.Provider, {
|
|
365
376
|
value: shouldScrollInViewport
|
|
366
|
-
}, /*#__PURE__*/React.createElement(_motionPresenceBoundary.default, null, children)))));
|
|
377
|
+
}, /*#__PURE__*/React.createElement(_motionPresenceBoundary.default, null, children))))));
|
|
367
378
|
}
|
|
368
379
|
|
|
369
380
|
/**
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
._16jlidpf{flex-grow:0}
|
|
2
|
+
._185i1kw7>form{flex-direction:inherit}
|
|
2
3
|
._1bsb1osq{width:100%}
|
|
3
4
|
._1dg11kw7>form:only-child{flex-direction:inherit}
|
|
4
5
|
._1e0c1txw{display:flex}
|
|
6
|
+
._1m0h1kw7>form{display:inherit}
|
|
5
7
|
._1mq81kw7>form:only-child{display:inherit}
|
|
6
8
|
._1o9zkb7n{flex-shrink:1}
|
|
7
9
|
._1q1l1bhr{--ds-elevation-surface-current:var(--ds-surface-overlay,#fff)}
|
|
8
10
|
._1tke1kxc{min-height:100vh}
|
|
9
11
|
._1tkeidpf{min-height:0}
|
|
12
|
+
._1vgv1kw7>form{max-height:inherit}
|
|
10
13
|
._2lx21bp4{flex-direction:column}
|
|
11
14
|
._4t3i1osq{height:100%}
|
|
12
15
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
@@ -31,6 +31,7 @@ const dialogStyles = {
|
|
|
31
31
|
rootMotion: "_yakv1wug _4lht1wug",
|
|
32
32
|
fullscreen: "_1jyk1osq"
|
|
33
33
|
};
|
|
34
|
+
const formWithStatusAnnouncementStyles = null;
|
|
34
35
|
const viewportScrollStyles = null;
|
|
35
36
|
const bodyScrollStyles = null;
|
|
36
37
|
const ModalDialog = /*#__PURE__*/forwardRef((props, ref) => {
|
|
@@ -122,7 +123,7 @@ const ModalDialog = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
122
123
|
tabIndex: -1,
|
|
123
124
|
"aria-modal": true,
|
|
124
125
|
"data-ds--level": currentLevel,
|
|
125
|
-
className: ax([dialogStyles.root, dialogStyles.rootMotion, !isFullScreen && dialogStyles.borderRadius, shouldScrollInViewport ? "_1tke1kxc _c71lglyw _8kn617ks" : "_cbiz17ks _bolh1kw7"])
|
|
126
|
+
className: ax([dialogStyles.root, fg('dst_platform-global_ep_status_announcement') && "_1m0h1kw7 _1vgv1kw7 _185i1kw7", dialogStyles.rootMotion, !isFullScreen && dialogStyles.borderRadius, shouldScrollInViewport ? "_1tke1kxc _c71lglyw _8kn617ks" : "_cbiz17ks _bolh1kw7"])
|
|
126
127
|
}, children)) : /*#__PURE__*/React.createElement(FadeIn
|
|
127
128
|
/**
|
|
128
129
|
* We don't want a 'slide in' for the full screen modals.
|
|
@@ -139,7 +140,7 @@ const ModalDialog = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
139
140
|
'--modal-dialog-height': dialogHeight(height)
|
|
140
141
|
},
|
|
141
142
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
142
|
-
className: ax([dialogStyles.root, !isFullScreen && dialogStyles.borderRadius, shouldScrollInViewport ? "_1tke1kxc _c71lglyw _8kn617ks" : "_cbiz17ks _bolh1kw7", bottomFadeInProps.className]),
|
|
143
|
+
className: ax([dialogStyles.root, fg('dst_platform-global_ep_status_announcement') && "_1m0h1kw7 _1vgv1kw7 _185i1kw7", !isFullScreen && dialogStyles.borderRadius, shouldScrollInViewport ? "_1tke1kxc _c71lglyw _8kn617ks" : "_cbiz17ks _bolh1kw7", bottomFadeInProps.className]),
|
|
143
144
|
role: "dialog",
|
|
144
145
|
"aria-labelledby": label ? undefined : titleId,
|
|
145
146
|
"data-testid": defaultTestId,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
._2rkoidpf{border-radius:0}
|
|
2
2
|
._152tze3t{inset-block-start:var(--ds-space-0,0)}
|
|
3
|
+
._185i1kw7>form{flex-direction:inherit}
|
|
3
4
|
._18m91wug{overflow-y:auto}
|
|
4
5
|
._18m9ewfl{overflow-y:visible}
|
|
5
6
|
._18u0idpf{margin-left:0}
|
|
@@ -7,22 +8,28 @@
|
|
|
7
8
|
._1bsbauwl{width:100vw}
|
|
8
9
|
._1dg11kw7>form:only-child{flex-direction:inherit}
|
|
9
10
|
._1e02ze3t{inset-inline-start:var(--ds-space-0,0)}
|
|
11
|
+
._1e0c11p5{display:grid}
|
|
10
12
|
._1e0c1txw{display:flex}
|
|
13
|
+
._1m0h1kw7>form{display:inherit}
|
|
11
14
|
._1mq81kw7>form:only-child{display:inherit}
|
|
12
15
|
._1q1l1bhr{--ds-elevation-surface-current:var(--ds-surface-overlay,#fff)}
|
|
13
16
|
._1reoewfl{overflow-x:visible}
|
|
17
|
+
._1vgv1kw7>form{max-height:inherit}
|
|
14
18
|
._2hwxidpf{margin-right:0}
|
|
15
19
|
._2lx21bp4{flex-direction:column}
|
|
20
|
+
._2z05i47z{grid-template-rows:minmax(0,1fr)}
|
|
16
21
|
._4t3i1kxc{height:100vh}
|
|
17
22
|
._8am5i4x0{-webkit-overflow-scrolling:touch}
|
|
18
23
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
19
24
|
._ds62idpf>form:only-child{min-height:0}
|
|
20
25
|
._kqsw1n9t{position:fixed}
|
|
26
|
+
._kzbqidpf>form{min-height:0}
|
|
21
27
|
._lcxv1wug{pointer-events:auto}
|
|
28
|
+
._lcxvglyw{pointer-events:none}
|
|
22
29
|
._ln19p27b{scrollbar-gutter:stable}
|
|
23
30
|
._m01u1kw7>form:only-child{max-height:inherit}
|
|
24
31
|
._otyridpf{margin-bottom:0}._128mdkaa:focus-visible{outline-width:var(--ds-border-width-focused,2px)}
|
|
25
32
|
._1ah3dkaa:focus-visible{outline-offset:var(--ds-border-width-focused,2px)}
|
|
26
33
|
._mizu1v1w:focus-visible{outline-color:var(--ds-border-focused,#4688ec)}
|
|
27
34
|
._ra3xnqa1:focus-visible{outline-style:solid}
|
|
28
|
-
@media (min-width:30rem){._1jyk17ks{height:var(--modal-dialog-height)}._g7116m9r{width:var(--modal-dialog-width)}._we1i18uh{max-width:calc(100vw - 90pt)}._e8uo221b{max-height:calc(100vh - 90pt)}._1sg41wqb{margin-top:60px}._maxs1wug{margin-right:auto}._1jvh1wqb{margin-bottom:60px}._1uca1wug{margin-left:auto}._1mpv184x{min-height:min-content}.
|
|
35
|
+
@media (min-width:30rem){._1jyk17ks{height:var(--modal-dialog-height)}._g7116m9r{width:var(--modal-dialog-width)}._we1i18uh{max-width:calc(100vw - 90pt)}._e8uo221b{max-height:calc(100vh - 90pt)}._1sg41wqb{margin-top:60px}._maxs1wug{margin-right:auto}._1jvh1wqb{margin-bottom:60px}._1uca1wug{margin-left:auto}._1mpv184x{min-height:min-content}._epkxpb1k{border-radius:var(--ds-radius-xlarge,9pt)}._zg7p130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}}
|
|
@@ -58,12 +58,23 @@ const surfaceStyles = {
|
|
|
58
58
|
root: "_1e0c1txw _2lx21bp4 _bfhk1bhr _1q1l1bhr _lcxv1wug _1mq81kw7 _m01u1kw7 _ds62idpf _1dg11kw7 _mizu1v1w _1ah3dkaa _ra3xnqa1 _128mdkaa _zg7p130s",
|
|
59
59
|
borderRadius: "_2rkoidpf _epkxpb1k"
|
|
60
60
|
};
|
|
61
|
+
const formWithStatusAnnouncementStyles = null;
|
|
61
62
|
const topLayerScrollModeStyles = {
|
|
62
63
|
'full-screen': "_1bsbauwl _4t3i1kxc _kqsw1n9t _152tze3t _1e02ze3t _18m91wug _8am5i4x0",
|
|
63
64
|
'viewport-scroll': "_4t3i1kxc _1sg41wqb _maxs1wug _1jvh1wqb _1uca1wug _1mpv184x _1jyk17ks _g7116m9r _we1i18uh",
|
|
64
65
|
'body-scroll': "_1bsbauwl _4t3i1kxc _1jyk17ks _g7116m9r _we1i18uh _e8uo221b"
|
|
65
66
|
};
|
|
66
|
-
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Sizing container around the surface. As a stretched grid item, the surface sizes to its content
|
|
70
|
+
* and has a definite height. A fixed height with `max-height: max-content` collapses with a
|
|
71
|
+
* `flex: 1` child. `pointer-events: none` keeps presses beside the surface as backdrop presses.
|
|
72
|
+
*/
|
|
73
|
+
const sizingContainerStyles = {
|
|
74
|
+
'body-scroll': "_1e0c11p5 _2z05i47z _lcxvglyw _e8uo221b",
|
|
75
|
+
'viewport-scroll': "_1e0c11p5 _lcxvglyw",
|
|
76
|
+
'full-screen': "_1e0c11p5 _lcxvglyw"
|
|
77
|
+
};
|
|
67
78
|
const allowlistElements = (element, callback) => {
|
|
68
79
|
// Allow focus outside modal when AUI dialog is visible
|
|
69
80
|
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage -- legacy FocusLock allowlist
|
|
@@ -85,7 +96,7 @@ function useModalCloseHandler(providedOnClose) {
|
|
|
85
96
|
action: 'closed',
|
|
86
97
|
componentName: 'modalDialog',
|
|
87
98
|
packageName: "@atlaskit/modal-dialog",
|
|
88
|
-
packageVersion: "17.2.
|
|
99
|
+
packageVersion: "17.2.2"
|
|
89
100
|
});
|
|
90
101
|
}
|
|
91
102
|
function getScrollMode({
|
|
@@ -125,11 +136,9 @@ function getTopLayerSurfaceWidth(input) {
|
|
|
125
136
|
}
|
|
126
137
|
function getTopLayerSurfaceHeight(input) {
|
|
127
138
|
if (!input) {
|
|
128
|
-
//
|
|
129
|
-
//
|
|
130
|
-
|
|
131
|
-
// in order for child elements with 100% height to work correctly.
|
|
132
|
-
return 'calc(100vh - 120px)';
|
|
139
|
+
// Size to the content. The sizing container gives the surface a definite height, so
|
|
140
|
+
// children with `height: 100%` still fill it. See `sizingContainerStyles`.
|
|
141
|
+
return 'auto';
|
|
133
142
|
}
|
|
134
143
|
if (typeof input === 'number') {
|
|
135
144
|
return `${input}px`;
|
|
@@ -341,17 +350,19 @@ function ModalWrapperTopLayer(props) {
|
|
|
341
350
|
}), /*#__PURE__*/React.createElement(DialogScrollLock, {
|
|
342
351
|
isOpen: true
|
|
343
352
|
}), /*#__PURE__*/React.createElement("div", {
|
|
353
|
+
className: ax([sizingContainerStyles[scrollMode]])
|
|
354
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
344
355
|
ref: contentRef,
|
|
345
356
|
style: {
|
|
346
357
|
'--modal-dialog-height': getTopLayerSurfaceHeight(height),
|
|
347
358
|
'--modal-dialog-width': getTopLayerSurfaceWidth(width)
|
|
348
359
|
},
|
|
349
|
-
className: ax([surfaceStyles.root, !isFullScreen && surfaceStyles.borderRadius, topLayerScrollModeStyles[scrollMode]
|
|
360
|
+
className: ax([surfaceStyles.root, fg('dst_platform-global_ep_status_announcement') && "_1m0h1kw7 _kzbqidpf _1vgv1kw7 _185i1kw7", !isFullScreen && surfaceStyles.borderRadius, topLayerScrollModeStyles[scrollMode]])
|
|
350
361
|
}, /*#__PURE__*/React.createElement(ModalContext.Provider, {
|
|
351
362
|
value: modalDialogContext
|
|
352
363
|
}, /*#__PURE__*/React.createElement(ScrollContext.Provider, {
|
|
353
364
|
value: shouldScrollInViewport
|
|
354
|
-
}, /*#__PURE__*/React.createElement(MotionPresenceBoundary, null, children)))));
|
|
365
|
+
}, /*#__PURE__*/React.createElement(MotionPresenceBoundary, null, children))))));
|
|
355
366
|
}
|
|
356
367
|
|
|
357
368
|
/**
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
._16jlidpf{flex-grow:0}
|
|
2
|
+
._185i1kw7>form{flex-direction:inherit}
|
|
2
3
|
._1bsb1osq{width:100%}
|
|
3
4
|
._1dg11kw7>form:only-child{flex-direction:inherit}
|
|
4
5
|
._1e0c1txw{display:flex}
|
|
6
|
+
._1m0h1kw7>form{display:inherit}
|
|
5
7
|
._1mq81kw7>form:only-child{display:inherit}
|
|
6
8
|
._1o9zkb7n{flex-shrink:1}
|
|
7
9
|
._1q1l1bhr{--ds-elevation-surface-current:var(--ds-surface-overlay,#fff)}
|
|
8
10
|
._1tke1kxc{min-height:100vh}
|
|
9
11
|
._1tkeidpf{min-height:0}
|
|
12
|
+
._1vgv1kw7>form{max-height:inherit}
|
|
10
13
|
._2lx21bp4{flex-direction:column}
|
|
11
14
|
._4t3i1osq{height:100%}
|
|
12
15
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
@@ -33,6 +33,7 @@ var dialogStyles = {
|
|
|
33
33
|
rootMotion: "_yakv1wug _4lht1wug",
|
|
34
34
|
fullscreen: "_1jyk1osq"
|
|
35
35
|
};
|
|
36
|
+
var formWithStatusAnnouncementStyles = null;
|
|
36
37
|
var viewportScrollStyles = null;
|
|
37
38
|
var bodyScrollStyles = null;
|
|
38
39
|
var ModalDialog = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
@@ -134,7 +135,7 @@ var ModalDialog = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
134
135
|
tabIndex: -1,
|
|
135
136
|
"aria-modal": true,
|
|
136
137
|
"data-ds--level": currentLevel,
|
|
137
|
-
className: ax([dialogStyles.root, dialogStyles.rootMotion, !isFullScreen && dialogStyles.borderRadius, shouldScrollInViewport ? "_1tke1kxc _c71lglyw _8kn617ks" : "_cbiz17ks _bolh1kw7"])
|
|
138
|
+
className: ax([dialogStyles.root, fg('dst_platform-global_ep_status_announcement') && "_1m0h1kw7 _1vgv1kw7 _185i1kw7", dialogStyles.rootMotion, !isFullScreen && dialogStyles.borderRadius, shouldScrollInViewport ? "_1tke1kxc _c71lglyw _8kn617ks" : "_cbiz17ks _bolh1kw7"])
|
|
138
139
|
}, children)) : /*#__PURE__*/React.createElement(FadeIn
|
|
139
140
|
/**
|
|
140
141
|
* We don't want a 'slide in' for the full screen modals.
|
|
@@ -152,7 +153,7 @@ var ModalDialog = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
152
153
|
'--modal-dialog-height': dialogHeight(height)
|
|
153
154
|
},
|
|
154
155
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
155
|
-
className: ax([dialogStyles.root, !isFullScreen && dialogStyles.borderRadius, shouldScrollInViewport ? "_1tke1kxc _c71lglyw _8kn617ks" : "_cbiz17ks _bolh1kw7", bottomFadeInProps.className]),
|
|
156
|
+
className: ax([dialogStyles.root, fg('dst_platform-global_ep_status_announcement') && "_1m0h1kw7 _1vgv1kw7 _185i1kw7", !isFullScreen && dialogStyles.borderRadius, shouldScrollInViewport ? "_1tke1kxc _c71lglyw _8kn617ks" : "_cbiz17ks _bolh1kw7", bottomFadeInProps.className]),
|
|
156
157
|
role: "dialog",
|
|
157
158
|
"aria-labelledby": label ? undefined : titleId,
|
|
158
159
|
"data-testid": defaultTestId,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
._2rkoidpf{border-radius:0}
|
|
2
2
|
._152tze3t{inset-block-start:var(--ds-space-0,0)}
|
|
3
|
+
._185i1kw7>form{flex-direction:inherit}
|
|
3
4
|
._18m91wug{overflow-y:auto}
|
|
4
5
|
._18m9ewfl{overflow-y:visible}
|
|
5
6
|
._18u0idpf{margin-left:0}
|
|
@@ -7,22 +8,28 @@
|
|
|
7
8
|
._1bsbauwl{width:100vw}
|
|
8
9
|
._1dg11kw7>form:only-child{flex-direction:inherit}
|
|
9
10
|
._1e02ze3t{inset-inline-start:var(--ds-space-0,0)}
|
|
11
|
+
._1e0c11p5{display:grid}
|
|
10
12
|
._1e0c1txw{display:flex}
|
|
13
|
+
._1m0h1kw7>form{display:inherit}
|
|
11
14
|
._1mq81kw7>form:only-child{display:inherit}
|
|
12
15
|
._1q1l1bhr{--ds-elevation-surface-current:var(--ds-surface-overlay,#fff)}
|
|
13
16
|
._1reoewfl{overflow-x:visible}
|
|
17
|
+
._1vgv1kw7>form{max-height:inherit}
|
|
14
18
|
._2hwxidpf{margin-right:0}
|
|
15
19
|
._2lx21bp4{flex-direction:column}
|
|
20
|
+
._2z05i47z{grid-template-rows:minmax(0,1fr)}
|
|
16
21
|
._4t3i1kxc{height:100vh}
|
|
17
22
|
._8am5i4x0{-webkit-overflow-scrolling:touch}
|
|
18
23
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
19
24
|
._ds62idpf>form:only-child{min-height:0}
|
|
20
25
|
._kqsw1n9t{position:fixed}
|
|
26
|
+
._kzbqidpf>form{min-height:0}
|
|
21
27
|
._lcxv1wug{pointer-events:auto}
|
|
28
|
+
._lcxvglyw{pointer-events:none}
|
|
22
29
|
._ln19p27b{scrollbar-gutter:stable}
|
|
23
30
|
._m01u1kw7>form:only-child{max-height:inherit}
|
|
24
31
|
._otyridpf{margin-bottom:0}._128mdkaa:focus-visible{outline-width:var(--ds-border-width-focused,2px)}
|
|
25
32
|
._1ah3dkaa:focus-visible{outline-offset:var(--ds-border-width-focused,2px)}
|
|
26
33
|
._mizu1v1w:focus-visible{outline-color:var(--ds-border-focused,#4688ec)}
|
|
27
34
|
._ra3xnqa1:focus-visible{outline-style:solid}
|
|
28
|
-
@media (min-width:30rem){._1jyk17ks{height:var(--modal-dialog-height)}._g7116m9r{width:var(--modal-dialog-width)}._we1i18uh{max-width:calc(100vw - 90pt)}._e8uo221b{max-height:calc(100vh - 90pt)}._1sg41wqb{margin-top:60px}._maxs1wug{margin-right:auto}._1jvh1wqb{margin-bottom:60px}._1uca1wug{margin-left:auto}._1mpv184x{min-height:min-content}.
|
|
35
|
+
@media (min-width:30rem){._1jyk17ks{height:var(--modal-dialog-height)}._g7116m9r{width:var(--modal-dialog-width)}._we1i18uh{max-width:calc(100vw - 90pt)}._e8uo221b{max-height:calc(100vh - 90pt)}._1sg41wqb{margin-top:60px}._maxs1wug{margin-right:auto}._1jvh1wqb{margin-bottom:60px}._1uca1wug{margin-left:auto}._1mpv184x{min-height:min-content}._epkxpb1k{border-radius:var(--ds-radius-xlarge,9pt)}._zg7p130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}}
|
|
@@ -59,12 +59,23 @@ var surfaceStyles = {
|
|
|
59
59
|
root: "_1e0c1txw _2lx21bp4 _bfhk1bhr _1q1l1bhr _lcxv1wug _1mq81kw7 _m01u1kw7 _ds62idpf _1dg11kw7 _mizu1v1w _1ah3dkaa _ra3xnqa1 _128mdkaa _zg7p130s",
|
|
60
60
|
borderRadius: "_2rkoidpf _epkxpb1k"
|
|
61
61
|
};
|
|
62
|
+
var formWithStatusAnnouncementStyles = null;
|
|
62
63
|
var topLayerScrollModeStyles = {
|
|
63
64
|
'full-screen': "_1bsbauwl _4t3i1kxc _kqsw1n9t _152tze3t _1e02ze3t _18m91wug _8am5i4x0",
|
|
64
65
|
'viewport-scroll': "_4t3i1kxc _1sg41wqb _maxs1wug _1jvh1wqb _1uca1wug _1mpv184x _1jyk17ks _g7116m9r _we1i18uh",
|
|
65
66
|
'body-scroll': "_1bsbauwl _4t3i1kxc _1jyk17ks _g7116m9r _we1i18uh _e8uo221b"
|
|
66
67
|
};
|
|
67
|
-
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Sizing container around the surface. As a stretched grid item, the surface sizes to its content
|
|
71
|
+
* and has a definite height. A fixed height with `max-height: max-content` collapses with a
|
|
72
|
+
* `flex: 1` child. `pointer-events: none` keeps presses beside the surface as backdrop presses.
|
|
73
|
+
*/
|
|
74
|
+
var sizingContainerStyles = {
|
|
75
|
+
'body-scroll': "_1e0c11p5 _2z05i47z _lcxvglyw _e8uo221b",
|
|
76
|
+
'viewport-scroll': "_1e0c11p5 _lcxvglyw",
|
|
77
|
+
'full-screen': "_1e0c11p5 _lcxvglyw"
|
|
78
|
+
};
|
|
68
79
|
var allowlistElements = function allowlistElements(element, callback) {
|
|
69
80
|
// Allow focus outside modal when AUI dialog is visible
|
|
70
81
|
// eslint-disable-next-line @atlaskit/platform/no-direct-document-usage -- legacy FocusLock allowlist
|
|
@@ -86,7 +97,7 @@ function useModalCloseHandler(providedOnClose) {
|
|
|
86
97
|
action: 'closed',
|
|
87
98
|
componentName: 'modalDialog',
|
|
88
99
|
packageName: "@atlaskit/modal-dialog",
|
|
89
|
-
packageVersion: "17.2.
|
|
100
|
+
packageVersion: "17.2.2"
|
|
90
101
|
});
|
|
91
102
|
}
|
|
92
103
|
function getScrollMode(_ref) {
|
|
@@ -125,11 +136,9 @@ function getTopLayerSurfaceWidth(input) {
|
|
|
125
136
|
}
|
|
126
137
|
function getTopLayerSurfaceHeight(input) {
|
|
127
138
|
if (!input) {
|
|
128
|
-
//
|
|
129
|
-
//
|
|
130
|
-
|
|
131
|
-
// in order for child elements with 100% height to work correctly.
|
|
132
|
-
return 'calc(100vh - 120px)';
|
|
139
|
+
// Size to the content. The sizing container gives the surface a definite height, so
|
|
140
|
+
// children with `height: 100%` still fill it. See `sizingContainerStyles`.
|
|
141
|
+
return 'auto';
|
|
133
142
|
}
|
|
134
143
|
if (typeof input === 'number') {
|
|
135
144
|
return "".concat(input, "px");
|
|
@@ -344,17 +353,19 @@ function ModalWrapperTopLayer(props) {
|
|
|
344
353
|
}), /*#__PURE__*/React.createElement(DialogScrollLock, {
|
|
345
354
|
isOpen: true
|
|
346
355
|
}), /*#__PURE__*/React.createElement("div", {
|
|
356
|
+
className: ax([sizingContainerStyles[scrollMode]])
|
|
357
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
347
358
|
ref: contentRef,
|
|
348
359
|
style: {
|
|
349
360
|
'--modal-dialog-height': getTopLayerSurfaceHeight(height),
|
|
350
361
|
'--modal-dialog-width': getTopLayerSurfaceWidth(width)
|
|
351
362
|
},
|
|
352
|
-
className: ax([surfaceStyles.root, !isFullScreen && surfaceStyles.borderRadius, topLayerScrollModeStyles[scrollMode]
|
|
363
|
+
className: ax([surfaceStyles.root, fg('dst_platform-global_ep_status_announcement') && "_1m0h1kw7 _kzbqidpf _1vgv1kw7 _185i1kw7", !isFullScreen && surfaceStyles.borderRadius, topLayerScrollModeStyles[scrollMode]])
|
|
353
364
|
}, /*#__PURE__*/React.createElement(ModalContext.Provider, {
|
|
354
365
|
value: modalDialogContext
|
|
355
366
|
}, /*#__PURE__*/React.createElement(ScrollContext.Provider, {
|
|
356
367
|
value: shouldScrollInViewport
|
|
357
|
-
}, /*#__PURE__*/React.createElement(MotionPresenceBoundary, null, children)))));
|
|
368
|
+
}, /*#__PURE__*/React.createElement(MotionPresenceBoundary, null, children))))));
|
|
358
369
|
}
|
|
359
370
|
|
|
360
371
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/modal-dialog",
|
|
3
|
-
"version": "17.2.
|
|
3
|
+
"version": "17.2.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/"
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
49
49
|
"@atlaskit/portal": "^7.1.0",
|
|
50
50
|
"@atlaskit/pragmatic-drag-and-drop": "^4.0.0",
|
|
51
|
-
"@atlaskit/primitives": "^22.
|
|
51
|
+
"@atlaskit/primitives": "^22.7.0",
|
|
52
52
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
53
53
|
"@atlaskit/theme": "^28.2.0",
|
|
54
|
-
"@atlaskit/tokens": "^20.
|
|
54
|
+
"@atlaskit/tokens": "^20.11.0",
|
|
55
55
|
"@atlaskit/top-layer": "^7.1.0",
|
|
56
56
|
"@babel/runtime": "^7.0.0",
|
|
57
57
|
"@compiled/react": "^1.0.2",
|
|
@@ -73,9 +73,10 @@
|
|
|
73
73
|
"@atlaskit/breadcrumbs": "^17.8.0",
|
|
74
74
|
"@atlaskit/checkbox": "^19.3.0",
|
|
75
75
|
"@atlaskit/code": "^20.0.0",
|
|
76
|
+
"@atlaskit/codemod-utils": "^5.2.0",
|
|
76
77
|
"@atlaskit/datetime-picker": "^19.4.0",
|
|
77
78
|
"@atlaskit/docs": "^12.3.0",
|
|
78
|
-
"@atlaskit/dropdown-menu": "^21.
|
|
79
|
+
"@atlaskit/dropdown-menu": "^21.2.0",
|
|
79
80
|
"@atlaskit/flag": "^19.0.0",
|
|
80
81
|
"@atlaskit/form": "^18.3.0",
|
|
81
82
|
"@atlaskit/heading": "^8.0.0",
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { type ASTPath, type JSCodeshift, type JSXAttribute } from 'jscodeshift';
|
|
2
|
-
import { type Collection } from 'jscodeshift/src/Collection';
|
|
3
|
-
|
|
4
|
-
export function getJSXAttributesByName(
|
|
5
|
-
j: JSCodeshift,
|
|
6
|
-
element: ASTPath<any>,
|
|
7
|
-
attributeName: string,
|
|
8
|
-
): Collection<JSXAttribute> {
|
|
9
|
-
return j(element)
|
|
10
|
-
.find(j.JSXOpeningElement)
|
|
11
|
-
.find(j.JSXAttribute)
|
|
12
|
-
.filter((attribute) => {
|
|
13
|
-
const matches = j(attribute)
|
|
14
|
-
.find(j.JSXIdentifier)
|
|
15
|
-
.filter((identifier) => identifier.value.name === attributeName);
|
|
16
|
-
return Boolean(matches.length);
|
|
17
|
-
});
|
|
18
|
-
}
|