@atlaskit/modal-dialog 15.0.4 → 15.1.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,17 @@
1
1
  # @atlaskit/modal-dialog
2
2
 
3
+ ## 15.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`cfeab708c0a5d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cfeab708c0a5d) -
8
+ Add ref forwarding to the modal dialog. The ref will be placed on the outer container of the modal
9
+ dialog.
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 15.0.4
4
16
 
5
17
  ### Patch Changes
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
- exports.FullScreenModalDialog = FullScreenModalDialog;
8
+ exports.FullScreenModalDialog = void 0;
8
9
  Object.defineProperty(exports, "ModalBody", {
9
10
  enumerable: true,
10
11
  get: function get() {
@@ -36,14 +37,16 @@ Object.defineProperty(exports, "ModalTransition", {
36
37
  }
37
38
  });
38
39
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
39
- var _react = _interopRequireDefault(require("react"));
40
+ var _react = _interopRequireWildcard(require("react"));
40
41
  var _modalWrapper = _interopRequireDefault(require("./internal/components/modal-wrapper"));
41
42
  var _modalTransition = _interopRequireDefault(require("./modal-transition"));
42
43
  var _modalHeader = _interopRequireDefault(require("./modal-header"));
43
44
  var _modalTitle = _interopRequireDefault(require("./modal-title"));
44
45
  var _modalBody = _interopRequireDefault(require("./modal-body"));
45
46
  var _modalFooter = _interopRequireDefault(require("./modal-footer"));
46
- function FullScreenModalDialog(props) {
47
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
48
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
49
+ var FullScreenModalDialog = exports.FullScreenModalDialog = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
47
50
  return /*#__PURE__*/_react.default.createElement(_modalWrapper.default
48
51
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
49
52
  , (0, _extends2.default)({}, props, {
@@ -82,6 +85,8 @@ function FullScreenModalDialog(props) {
82
85
  *
83
86
  * We don't want consumers to disable it.
84
87
  */,
85
- isBlanketHidden: false
88
+ isBlanketHidden: false,
89
+ ref: ref
86
90
  }));
87
- }
91
+ });
92
+ FullScreenModalDialog.displayName = 'FullScreenModalDialog';
@@ -59,7 +59,7 @@ var dialogStyles = {
59
59
  };
60
60
  var viewportScrollStyles = null;
61
61
  var bodyScrollStyles = null;
62
- var ModalDialog = function ModalDialog(props) {
62
+ var ModalDialog = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
63
63
  var _props$width = props.width,
64
64
  width = _props$width === void 0 ? 'medium' : _props$width,
65
65
  _props$shouldScrollIn = props.shouldScrollInViewport,
@@ -134,7 +134,7 @@ var ModalDialog = function ModalDialog(props) {
134
134
  xcss: (0, _css.cx)(dialogStyles.motion, isFullScreen && dialogStyles.fullscreen)
135
135
  }, /*#__PURE__*/React.createElement("section", {
136
136
  "aria-label": label,
137
- ref: motionRef,
137
+ ref: (0, _mergeRefs.default)([motionRef, ref]),
138
138
  style: {
139
139
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
140
140
  '--modal-dialog-width': dialogWidth(width),
@@ -158,7 +158,7 @@ var ModalDialog = function ModalDialog(props) {
158
158
  }, function (bottomFadeInProps) {
159
159
  return /*#__PURE__*/React.createElement("section", (0, _extends2.default)({}, bottomFadeInProps, {
160
160
  "aria-label": label,
161
- ref: (0, _mergeRefs.default)([bottomFadeInProps.ref, motionRef]),
161
+ ref: (0, _mergeRefs.default)([bottomFadeInProps.ref, motionRef, ref]),
162
162
  style: {
163
163
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
164
164
  '--modal-dialog-width': dialogWidth(width),
@@ -176,7 +176,7 @@ var ModalDialog = function ModalDialog(props) {
176
176
  "data-ds--level": currentLevel
177
177
  }), children);
178
178
  }))));
179
- };
179
+ });
180
180
 
181
181
  // eslint-disable-next-line @repo/internal/react/require-jsdoc
182
182
  var _default = exports.default = ModalDialog;
@@ -74,18 +74,7 @@ var allowlistElements = function allowlistElements(element, callback) {
74
74
  }
75
75
  return true;
76
76
  };
77
-
78
- /**
79
- * __Modal wrapper__
80
- *
81
- * A modal wrapper displays content that requires user interaction, in a layer above the page.
82
- * This component is primary container for other modal components.
83
- *
84
- * - [Examples](https://atlassian.design/components/modal-dialog/examples)
85
- * - [Code](https://atlassian.design/components/modal-dialog/code)
86
- * - [Usage](https://atlassian.design/components/modal-dialog/usage)
87
- */
88
- var InternalModalWrapper = function InternalModalWrapper(props) {
77
+ var InternalModalWrapper = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
89
78
  var autoFocus = props.autoFocus,
90
79
  focusLockAllowlist = props.focusLockAllowlist,
91
80
  _props$shouldCloseOnE = props.shouldCloseOnEscapePress,
@@ -124,7 +113,7 @@ var InternalModalWrapper = function InternalModalWrapper(props) {
124
113
  action: 'closed',
125
114
  componentName: 'modalDialog',
126
115
  packageName: "@atlaskit/modal-dialog",
127
- packageVersion: "0.0.0-development"
116
+ packageVersion: "15.0.4"
128
117
  });
129
118
  var onBlanketClicked = (0, _react.useCallback)(function (e) {
130
119
  if (shouldCloseOnOverlayClick) {
@@ -359,7 +348,8 @@ var InternalModalWrapper = function InternalModalWrapper(props) {
359
348
  onOpenComplete: onOpenComplete,
360
349
  hasProvidedOnClose: Boolean(providedOnClose),
361
350
  isFullScreen: isFullScreen,
362
- UNSAFE_shouldDisableMotionUplift: UNSAFE_shouldDisableMotionUplift
351
+ UNSAFE_shouldDisableMotionUplift: UNSAFE_shouldDisableMotionUplift,
352
+ ref: ref
363
353
  }, children));
364
354
  var returnFocus = true;
365
355
  var onDeactivation = _noop.default;
@@ -400,5 +390,7 @@ var InternalModalWrapper = function InternalModalWrapper(props) {
400
390
  whiteList: allowListCallback
401
391
  }, /*#__PURE__*/React.createElement(_reactScrolllock.default, null), shouldScrollInViewport ? /*#__PURE__*/React.createElement(_reactScrolllock.TouchScrollable, null, modalDialogWithBlanket) : modalDialogWithBlanket));
402
392
  })));
403
- };
393
+ });
394
+
395
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
404
396
  var _default = exports.default = InternalModalWrapper;
@@ -1,16 +1,33 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
- exports.default = ModalWrapper;
8
+ exports.default = void 0;
8
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- var _react = _interopRequireDefault(require("react"));
10
+ var _react = _interopRequireWildcard(require("react"));
10
11
  var _modalWrapper = _interopRequireDefault(require("./internal/components/modal-wrapper"));
11
- function ModalWrapper(props) {
12
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
13
+ /**
14
+ * __Modal wrapper__
15
+ *
16
+ * A modal wrapper displays content that requires user interaction, in a layer above the page.
17
+ * This component is primary container for other modal components.
18
+ *
19
+ * - [Examples](https://atlassian.design/components/modal-dialog/examples)
20
+ * - [Code](https://atlassian.design/components/modal-dialog/code)
21
+ * - [Usage](https://atlassian.design/components/modal-dialog/usage)
22
+ */
23
+ var ModalWrapper = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
12
24
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
13
25
  return /*#__PURE__*/_react.default.createElement(_modalWrapper.default, (0, _extends2.default)({}, props, {
14
- isFullScreen: false
26
+ isFullScreen: false,
27
+ ref: ref
15
28
  }));
16
- }
29
+ });
30
+ ModalWrapper.displayName = 'ModalWrapper';
31
+
32
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
33
+ var _default = exports.default = ModalWrapper;
@@ -1,7 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
2
+ import React, { forwardRef } from 'react';
3
3
  import InternalModalWrapper from './internal/components/modal-wrapper';
4
- export function FullScreenModalDialog(props) {
4
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
5
+ export const FullScreenModalDialog = /*#__PURE__*/forwardRef((props, ref) => {
5
6
  return /*#__PURE__*/React.createElement(InternalModalWrapper
6
7
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
7
8
  , _extends({}, props, {
@@ -40,9 +41,11 @@ export function FullScreenModalDialog(props) {
40
41
  *
41
42
  * We don't want consumers to disable it.
42
43
  */,
43
- isBlanketHidden: false
44
+ isBlanketHidden: false,
45
+ ref: ref
44
46
  }));
45
- }
47
+ });
48
+ FullScreenModalDialog.displayName = 'FullScreenModalDialog';
46
49
  export { default as ModalTransition } from './modal-transition';
47
50
  export { default as ModalHeader } from './modal-header';
48
51
  export { default as ModalTitle } from './modal-title';
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./modal-dialog.compiled.css";
4
4
  import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
- import { useEffect, useMemo } from 'react';
6
+ import { forwardRef, useEffect, useMemo } from 'react';
7
7
  import { cx } from '@atlaskit/css';
8
8
  import mergeRefs from '@atlaskit/ds-lib/merge-refs';
9
9
  import useAutoFocus from '@atlaskit/ds-lib/use-auto-focus';
@@ -48,7 +48,7 @@ const dialogStyles = {
48
48
  };
49
49
  const viewportScrollStyles = null;
50
50
  const bodyScrollStyles = null;
51
- const ModalDialog = props => {
51
+ const ModalDialog = /*#__PURE__*/forwardRef((props, ref) => {
52
52
  const {
53
53
  width = 'medium',
54
54
  shouldScrollInViewport = false,
@@ -117,7 +117,7 @@ const ModalDialog = props => {
117
117
  xcss: cx(dialogStyles.motion, isFullScreen && dialogStyles.fullscreen)
118
118
  }, /*#__PURE__*/React.createElement("section", {
119
119
  "aria-label": label,
120
- ref: motionRef,
120
+ ref: mergeRefs([motionRef, ref]),
121
121
  style: {
122
122
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
123
123
  '--modal-dialog-width': dialogWidth(width),
@@ -140,7 +140,7 @@ const ModalDialog = props => {
140
140
  onFinish: onMotionFinish
141
141
  }, bottomFadeInProps => /*#__PURE__*/React.createElement("section", _extends({}, bottomFadeInProps, {
142
142
  "aria-label": label,
143
- ref: mergeRefs([bottomFadeInProps.ref, motionRef]),
143
+ ref: mergeRefs([bottomFadeInProps.ref, motionRef, ref]),
144
144
  style: {
145
145
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
146
146
  '--modal-dialog-width': dialogWidth(width),
@@ -157,7 +157,7 @@ const ModalDialog = props => {
157
157
  "aria-modal": true,
158
158
  "data-ds--level": currentLevel
159
159
  }), children)))));
160
- };
160
+ });
161
161
 
162
162
  // eslint-disable-next-line @repo/internal/react/require-jsdoc
163
163
  export default ModalDialog;
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./modal-wrapper.compiled.css";
4
4
  import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
- import { useCallback, useEffect, useMemo, useRef } from 'react';
6
+ import { forwardRef, useCallback, useEffect, useMemo, useRef } from 'react';
7
7
  import FocusLock from 'react-focus-lock';
8
8
  import ScrollLock, { TouchScrollable } from 'react-scrolllock';
9
9
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
@@ -64,18 +64,7 @@ const allowlistElements = (element, callback) => {
64
64
  }
65
65
  return true;
66
66
  };
67
-
68
- /**
69
- * __Modal wrapper__
70
- *
71
- * A modal wrapper displays content that requires user interaction, in a layer above the page.
72
- * This component is primary container for other modal components.
73
- *
74
- * - [Examples](https://atlassian.design/components/modal-dialog/examples)
75
- * - [Code](https://atlassian.design/components/modal-dialog/code)
76
- * - [Usage](https://atlassian.design/components/modal-dialog/usage)
77
- */
78
- const InternalModalWrapper = props => {
67
+ const InternalModalWrapper = /*#__PURE__*/forwardRef((props, ref) => {
79
68
  const {
80
69
  autoFocus,
81
70
  focusLockAllowlist,
@@ -110,7 +99,7 @@ const InternalModalWrapper = props => {
110
99
  action: 'closed',
111
100
  componentName: 'modalDialog',
112
101
  packageName: "@atlaskit/modal-dialog",
113
- packageVersion: "0.0.0-development"
102
+ packageVersion: "15.0.4"
114
103
  });
115
104
  const onBlanketClicked = useCallback(e => {
116
105
  if (shouldCloseOnOverlayClick) {
@@ -344,7 +333,8 @@ const InternalModalWrapper = props => {
344
333
  onOpenComplete: onOpenComplete,
345
334
  hasProvidedOnClose: Boolean(providedOnClose),
346
335
  isFullScreen: isFullScreen,
347
- UNSAFE_shouldDisableMotionUplift: UNSAFE_shouldDisableMotionUplift
336
+ UNSAFE_shouldDisableMotionUplift: UNSAFE_shouldDisableMotionUplift,
337
+ ref: ref
348
338
  }, children));
349
339
  let returnFocus = true;
350
340
  let onDeactivation = noop;
@@ -383,5 +373,7 @@ const InternalModalWrapper = props => {
383
373
  onDeactivation: onDeactivation,
384
374
  whiteList: allowListCallback
385
375
  }, /*#__PURE__*/React.createElement(ScrollLock, null), shouldScrollInViewport ? /*#__PURE__*/React.createElement(TouchScrollable, null, modalDialogWithBlanket) : modalDialogWithBlanket)))));
386
- };
376
+ });
377
+
378
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
387
379
  export default InternalModalWrapper;
@@ -1,9 +1,24 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
2
+ import React, { forwardRef } from 'react';
3
3
  import InternalModalWrapper from './internal/components/modal-wrapper';
4
- export default function ModalWrapper(props) {
4
+ /**
5
+ * __Modal wrapper__
6
+ *
7
+ * A modal wrapper displays content that requires user interaction, in a layer above the page.
8
+ * This component is primary container for other modal components.
9
+ *
10
+ * - [Examples](https://atlassian.design/components/modal-dialog/examples)
11
+ * - [Code](https://atlassian.design/components/modal-dialog/code)
12
+ * - [Usage](https://atlassian.design/components/modal-dialog/usage)
13
+ */
14
+ const ModalWrapper = /*#__PURE__*/forwardRef((props, ref) => {
5
15
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
6
16
  return /*#__PURE__*/React.createElement(InternalModalWrapper, _extends({}, props, {
7
- isFullScreen: false
17
+ isFullScreen: false,
18
+ ref: ref
8
19
  }));
9
- }
20
+ });
21
+ ModalWrapper.displayName = 'ModalWrapper';
22
+
23
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
24
+ export default ModalWrapper;
@@ -1,7 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
2
+ import React, { forwardRef } from 'react';
3
3
  import InternalModalWrapper from './internal/components/modal-wrapper';
4
- export function FullScreenModalDialog(props) {
4
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
5
+ export var FullScreenModalDialog = /*#__PURE__*/forwardRef(function (props, ref) {
5
6
  return /*#__PURE__*/React.createElement(InternalModalWrapper
6
7
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
7
8
  , _extends({}, props, {
@@ -40,9 +41,11 @@ export function FullScreenModalDialog(props) {
40
41
  *
41
42
  * We don't want consumers to disable it.
42
43
  */,
43
- isBlanketHidden: false
44
+ isBlanketHidden: false,
45
+ ref: ref
44
46
  }));
45
- }
47
+ });
48
+ FullScreenModalDialog.displayName = 'FullScreenModalDialog';
46
49
  export { default as ModalTransition } from './modal-transition';
47
50
  export { default as ModalHeader } from './modal-header';
48
51
  export { default as ModalTitle } from './modal-title';
@@ -5,7 +5,7 @@ import _typeof from "@babel/runtime/helpers/typeof";
5
5
  import "./modal-dialog.compiled.css";
6
6
  import * as React from 'react';
7
7
  import { ax, ix } from "@compiled/react/runtime";
8
- import { useEffect, useMemo } from 'react';
8
+ import { forwardRef, useEffect, useMemo } from 'react';
9
9
  import { cx } from '@atlaskit/css';
10
10
  import mergeRefs from '@atlaskit/ds-lib/merge-refs';
11
11
  import useAutoFocus from '@atlaskit/ds-lib/use-auto-focus';
@@ -50,7 +50,7 @@ var dialogStyles = {
50
50
  };
51
51
  var viewportScrollStyles = null;
52
52
  var bodyScrollStyles = null;
53
- var ModalDialog = function ModalDialog(props) {
53
+ var ModalDialog = /*#__PURE__*/forwardRef(function (props, ref) {
54
54
  var _props$width = props.width,
55
55
  width = _props$width === void 0 ? 'medium' : _props$width,
56
56
  _props$shouldScrollIn = props.shouldScrollInViewport,
@@ -125,7 +125,7 @@ var ModalDialog = function ModalDialog(props) {
125
125
  xcss: cx(dialogStyles.motion, isFullScreen && dialogStyles.fullscreen)
126
126
  }, /*#__PURE__*/React.createElement("section", {
127
127
  "aria-label": label,
128
- ref: motionRef,
128
+ ref: mergeRefs([motionRef, ref]),
129
129
  style: {
130
130
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
131
131
  '--modal-dialog-width': dialogWidth(width),
@@ -149,7 +149,7 @@ var ModalDialog = function ModalDialog(props) {
149
149
  }, function (bottomFadeInProps) {
150
150
  return /*#__PURE__*/React.createElement("section", _extends({}, bottomFadeInProps, {
151
151
  "aria-label": label,
152
- ref: mergeRefs([bottomFadeInProps.ref, motionRef]),
152
+ ref: mergeRefs([bottomFadeInProps.ref, motionRef, ref]),
153
153
  style: {
154
154
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
155
155
  '--modal-dialog-width': dialogWidth(width),
@@ -167,7 +167,7 @@ var ModalDialog = function ModalDialog(props) {
167
167
  "data-ds--level": currentLevel
168
168
  }), children);
169
169
  }))));
170
- };
170
+ });
171
171
 
172
172
  // eslint-disable-next-line @repo/internal/react/require-jsdoc
173
173
  export default ModalDialog;
@@ -4,7 +4,7 @@ import _typeof from "@babel/runtime/helpers/typeof";
4
4
  import "./modal-wrapper.compiled.css";
5
5
  import * as React from 'react';
6
6
  import { ax, ix } from "@compiled/react/runtime";
7
- import { useCallback, useEffect, useMemo, useRef } from 'react';
7
+ import { forwardRef, useCallback, useEffect, useMemo, useRef } from 'react';
8
8
  import FocusLock from 'react-focus-lock';
9
9
  import ScrollLock, { TouchScrollable } from 'react-scrolllock';
10
10
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
@@ -65,18 +65,7 @@ var allowlistElements = function allowlistElements(element, callback) {
65
65
  }
66
66
  return true;
67
67
  };
68
-
69
- /**
70
- * __Modal wrapper__
71
- *
72
- * A modal wrapper displays content that requires user interaction, in a layer above the page.
73
- * This component is primary container for other modal components.
74
- *
75
- * - [Examples](https://atlassian.design/components/modal-dialog/examples)
76
- * - [Code](https://atlassian.design/components/modal-dialog/code)
77
- * - [Usage](https://atlassian.design/components/modal-dialog/usage)
78
- */
79
- var InternalModalWrapper = function InternalModalWrapper(props) {
68
+ var InternalModalWrapper = /*#__PURE__*/forwardRef(function (props, ref) {
80
69
  var autoFocus = props.autoFocus,
81
70
  focusLockAllowlist = props.focusLockAllowlist,
82
71
  _props$shouldCloseOnE = props.shouldCloseOnEscapePress,
@@ -115,7 +104,7 @@ var InternalModalWrapper = function InternalModalWrapper(props) {
115
104
  action: 'closed',
116
105
  componentName: 'modalDialog',
117
106
  packageName: "@atlaskit/modal-dialog",
118
- packageVersion: "0.0.0-development"
107
+ packageVersion: "15.0.4"
119
108
  });
120
109
  var onBlanketClicked = useCallback(function (e) {
121
110
  if (shouldCloseOnOverlayClick) {
@@ -350,7 +339,8 @@ var InternalModalWrapper = function InternalModalWrapper(props) {
350
339
  onOpenComplete: onOpenComplete,
351
340
  hasProvidedOnClose: Boolean(providedOnClose),
352
341
  isFullScreen: isFullScreen,
353
- UNSAFE_shouldDisableMotionUplift: UNSAFE_shouldDisableMotionUplift
342
+ UNSAFE_shouldDisableMotionUplift: UNSAFE_shouldDisableMotionUplift,
343
+ ref: ref
354
344
  }, children));
355
345
  var returnFocus = true;
356
346
  var onDeactivation = noop;
@@ -391,5 +381,7 @@ var InternalModalWrapper = function InternalModalWrapper(props) {
391
381
  whiteList: allowListCallback
392
382
  }, /*#__PURE__*/React.createElement(ScrollLock, null), shouldScrollInViewport ? /*#__PURE__*/React.createElement(TouchScrollable, null, modalDialogWithBlanket) : modalDialogWithBlanket));
393
383
  })));
394
- };
384
+ });
385
+
386
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
395
387
  export default InternalModalWrapper;
@@ -1,9 +1,24 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
2
+ import React, { forwardRef } from 'react';
3
3
  import InternalModalWrapper from './internal/components/modal-wrapper';
4
- export default function ModalWrapper(props) {
4
+ /**
5
+ * __Modal wrapper__
6
+ *
7
+ * A modal wrapper displays content that requires user interaction, in a layer above the page.
8
+ * This component is primary container for other modal components.
9
+ *
10
+ * - [Examples](https://atlassian.design/components/modal-dialog/examples)
11
+ * - [Code](https://atlassian.design/components/modal-dialog/code)
12
+ * - [Usage](https://atlassian.design/components/modal-dialog/usage)
13
+ */
14
+ var ModalWrapper = /*#__PURE__*/forwardRef(function (props, ref) {
5
15
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
6
16
  return /*#__PURE__*/React.createElement(InternalModalWrapper, _extends({}, props, {
7
- isFullScreen: false
17
+ isFullScreen: false,
18
+ ref: ref
8
19
  }));
9
- }
20
+ });
21
+ ModalWrapper.displayName = 'ModalWrapper';
22
+
23
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
24
+ export default ModalWrapper;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import type { ModalDialogProps } from './types';
3
3
  export interface FullScreenModalDialogProps extends Omit<ModalDialogProps, 'width' | 'height' | 'shouldScrollInViewport' | 'shouldCloseOnOverlayClick' | 'isBlanketHidden'> {
4
4
  }
5
- export declare function FullScreenModalDialog(props: FullScreenModalDialogProps): React.JSX.Element;
5
+ export declare const FullScreenModalDialog: React.ForwardRefExoticComponent<React.PropsWithoutRef<FullScreenModalDialogProps> & React.RefAttributes<HTMLElement>>;
6
6
  export { default as ModalTransition } from './modal-transition';
7
7
  export { default as ModalHeader } from './modal-header';
8
8
  export { default as ModalTitle } from './modal-title';
@@ -6,5 +6,5 @@ import type { ModalDialogProps } from '../../types';
6
6
  import type { InternalModalDialogProps } from '../types';
7
7
  export declare const dialogWidth: (input?: ModalDialogProps["width"]) => string;
8
8
  export declare const dialogHeight: (input?: ModalDialogProps["height"]) => string;
9
- declare const ModalDialog: (props: InternalModalDialogProps) => JSX.Element;
9
+ declare const ModalDialog: React.ForwardRefExoticComponent<React.PropsWithoutRef<InternalModalDialogProps> & React.RefAttributes<HTMLElement>>;
10
10
  export default ModalDialog;
@@ -5,15 +5,5 @@
5
5
  import type { ModalDialogProps } from '../../types';
6
6
  import type { InternalModalWrapperProps } from '../types';
7
7
  export type { ModalDialogProps };
8
- /**
9
- * __Modal wrapper__
10
- *
11
- * A modal wrapper displays content that requires user interaction, in a layer above the page.
12
- * This component is primary container for other modal components.
13
- *
14
- * - [Examples](https://atlassian.design/components/modal-dialog/examples)
15
- * - [Code](https://atlassian.design/components/modal-dialog/code)
16
- * - [Usage](https://atlassian.design/components/modal-dialog/usage)
17
- */
18
- declare const InternalModalWrapper: (props: InternalModalWrapperProps) => JSX.Element;
8
+ declare const InternalModalWrapper: React.ForwardRefExoticComponent<React.PropsWithoutRef<InternalModalWrapperProps> & React.RefAttributes<HTMLElement>>;
19
9
  export default InternalModalWrapper;
@@ -1,4 +1,15 @@
1
1
  import React from 'react';
2
2
  import { type ModalDialogProps } from './internal/components/modal-wrapper';
3
3
  export type { ModalDialogProps };
4
- export default function ModalWrapper(props: ModalDialogProps): React.JSX.Element;
4
+ /**
5
+ * __Modal wrapper__
6
+ *
7
+ * A modal wrapper displays content that requires user interaction, in a layer above the page.
8
+ * This component is primary container for other modal components.
9
+ *
10
+ * - [Examples](https://atlassian.design/components/modal-dialog/examples)
11
+ * - [Code](https://atlassian.design/components/modal-dialog/code)
12
+ * - [Usage](https://atlassian.design/components/modal-dialog/usage)
13
+ */
14
+ declare const ModalWrapper: React.ForwardRefExoticComponent<React.PropsWithoutRef<ModalDialogProps> & React.RefAttributes<HTMLElement>>;
15
+ export default ModalWrapper;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import type { ModalDialogProps } from './types';
3
3
  export interface FullScreenModalDialogProps extends Omit<ModalDialogProps, 'width' | 'height' | 'shouldScrollInViewport' | 'shouldCloseOnOverlayClick' | 'isBlanketHidden'> {
4
4
  }
5
- export declare function FullScreenModalDialog(props: FullScreenModalDialogProps): React.JSX.Element;
5
+ export declare const FullScreenModalDialog: React.ForwardRefExoticComponent<React.PropsWithoutRef<FullScreenModalDialogProps> & React.RefAttributes<HTMLElement>>;
6
6
  export { default as ModalTransition } from './modal-transition';
7
7
  export { default as ModalHeader } from './modal-header';
8
8
  export { default as ModalTitle } from './modal-title';
@@ -6,5 +6,5 @@ import type { ModalDialogProps } from '../../types';
6
6
  import type { InternalModalDialogProps } from '../types';
7
7
  export declare const dialogWidth: (input?: ModalDialogProps["width"]) => string;
8
8
  export declare const dialogHeight: (input?: ModalDialogProps["height"]) => string;
9
- declare const ModalDialog: (props: InternalModalDialogProps) => JSX.Element;
9
+ declare const ModalDialog: React.ForwardRefExoticComponent<React.PropsWithoutRef<InternalModalDialogProps> & React.RefAttributes<HTMLElement>>;
10
10
  export default ModalDialog;
@@ -5,15 +5,5 @@
5
5
  import type { ModalDialogProps } from '../../types';
6
6
  import type { InternalModalWrapperProps } from '../types';
7
7
  export type { ModalDialogProps };
8
- /**
9
- * __Modal wrapper__
10
- *
11
- * A modal wrapper displays content that requires user interaction, in a layer above the page.
12
- * This component is primary container for other modal components.
13
- *
14
- * - [Examples](https://atlassian.design/components/modal-dialog/examples)
15
- * - [Code](https://atlassian.design/components/modal-dialog/code)
16
- * - [Usage](https://atlassian.design/components/modal-dialog/usage)
17
- */
18
- declare const InternalModalWrapper: (props: InternalModalWrapperProps) => JSX.Element;
8
+ declare const InternalModalWrapper: React.ForwardRefExoticComponent<React.PropsWithoutRef<InternalModalWrapperProps> & React.RefAttributes<HTMLElement>>;
19
9
  export default InternalModalWrapper;
@@ -1,4 +1,15 @@
1
1
  import React from 'react';
2
2
  import { type ModalDialogProps } from './internal/components/modal-wrapper';
3
3
  export type { ModalDialogProps };
4
- export default function ModalWrapper(props: ModalDialogProps): React.JSX.Element;
4
+ /**
5
+ * __Modal wrapper__
6
+ *
7
+ * A modal wrapper displays content that requires user interaction, in a layer above the page.
8
+ * This component is primary container for other modal components.
9
+ *
10
+ * - [Examples](https://atlassian.design/components/modal-dialog/examples)
11
+ * - [Code](https://atlassian.design/components/modal-dialog/code)
12
+ * - [Usage](https://atlassian.design/components/modal-dialog/usage)
13
+ */
14
+ declare const ModalWrapper: React.ForwardRefExoticComponent<React.PropsWithoutRef<ModalDialogProps> & React.RefAttributes<HTMLElement>>;
15
+ export default ModalWrapper;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/modal-dialog",
3
- "version": "15.0.4",
3
+ "version": "15.1.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/"
@@ -48,7 +48,7 @@
48
48
  "@atlaskit/primitives": "^19.0.0",
49
49
  "@atlaskit/theme": "^23.2.0",
50
50
  "@atlaskit/tokens": "^13.0.0",
51
- "@atlaskit/top-layer": "^0.6.0",
51
+ "@atlaskit/top-layer": "^0.7.0",
52
52
  "@babel/runtime": "^7.0.0",
53
53
  "@compiled/react": "^0.20.0",
54
54
  "bind-event-listener": "^3.0.0",
@@ -71,12 +71,12 @@
71
71
  "@atlaskit/code": "^17.5.0",
72
72
  "@atlaskit/datetime-picker": "^17.8.0",
73
73
  "@atlaskit/docs": "^11.8.0",
74
- "@atlaskit/dropdown-menu": "^16.8.0",
74
+ "@atlaskit/dropdown-menu": "^16.9.0",
75
75
  "@atlaskit/flag": "^17.11.0",
76
76
  "@atlaskit/form": "^15.5.0",
77
77
  "@atlaskit/heading": "^5.4.0",
78
78
  "@atlaskit/link": "^3.4.0",
79
- "@atlaskit/popup": "^4.19.0",
79
+ "@atlaskit/popup": "^4.20.0",
80
80
  "@atlaskit/radio": "^8.6.0",
81
81
  "@atlaskit/section-message": "^8.12.0",
82
82
  "@atlaskit/select": "^21.12.0",