@atlaskit/modal-dialog 12.2.13 → 12.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/__perf__/default.tsx +3 -1
  3. package/__perf__/interactions.tsx +1 -1
  4. package/__perf__/scroll.tsx +1 -1
  5. package/codemods/{12.0.0-lite-mode.ts → 12.0.0-lite-mode.tsx} +2 -2
  6. package/codemods/__tests__/{12.0.0-lite-mode.test.ts → 12.0.0-lite-mode.test.tsx} +0 -0
  7. package/codemods/__tests__/{inline-WidthNames-declaration.test.ts → inline-width-names-declaration.test.tsx} +1 -1
  8. package/codemods/__tests__/{map-body-from-props.test.ts → map-body-from-props.test.tsx} +0 -0
  9. package/codemods/__tests__/{map-container-from-props.test.ts → map-container-from-props.test.tsx} +0 -0
  10. package/codemods/__tests__/{map-footer-from-props.test.ts → map-footer-from-props.test.tsx} +0 -0
  11. package/codemods/__tests__/{map-header-from-props.test.ts → map-header-from-props.test.tsx} +0 -0
  12. package/codemods/__tests__/{remove-appearance-prop.test.ts → remove-appearance-prop.test.tsx} +0 -0
  13. package/codemods/__tests__/{remove-component-override-props.test.ts → remove-component-override-props.test.tsx} +0 -0
  14. package/codemods/__tests__/{rename-appearance-type.test.ts → rename-appearance-type.test.tsx} +0 -0
  15. package/codemods/__tests__/{rename-inner-component-prop-types.test.ts → rename-inner-component-prop-types.test.tsx} +0 -0
  16. package/codemods/__tests__/{rename-scrollBehavior-to-shouldScrollInViewport.test.ts → rename-scroll-behavior-to-should-scroll-in-viewport.test.tsx} +1 -1
  17. package/codemods/migrations/{inline-WidthNames-declaration.ts → inline-width-names-declaration.tsx} +0 -0
  18. package/codemods/migrations/{map-body-from-props.ts → map-body-from-props.tsx} +0 -0
  19. package/codemods/migrations/{map-container-from-props.ts → map-container-from-props.tsx} +0 -0
  20. package/codemods/migrations/{map-footer-from-props.ts → map-footer-from-props.tsx} +0 -0
  21. package/codemods/migrations/{map-header-from-props.ts → map-header-from-props.tsx} +0 -0
  22. package/codemods/migrations/{remove-appearance-prop.ts → remove-appearance-prop.tsx} +0 -0
  23. package/codemods/migrations/{remove-component-override-props.ts → remove-component-override-props.tsx} +0 -0
  24. package/codemods/migrations/{rename-appearance-type.ts → rename-appearance-type.tsx} +0 -0
  25. package/codemods/migrations/{rename-inner-component-prop-types.ts → rename-inner-component-prop-types.tsx} +0 -0
  26. package/codemods/migrations/{rename-scrollBehavior-to-shouldScrollInViewport.ts → rename-scroll-behavior-to-should-scroll-in-viewport.tsx} +0 -0
  27. package/dist/cjs/internal/components/modal-dialog.js +2 -1
  28. package/dist/cjs/internal/components/positioner.js +6 -3
  29. package/dist/cjs/internal/context.js +1 -0
  30. package/dist/cjs/internal/hooks/use-on-motion-finish.js +1 -0
  31. package/dist/cjs/internal/hooks/use-scroll.js +1 -0
  32. package/dist/cjs/modal-body.js +13 -2
  33. package/dist/cjs/modal-footer.js +9 -0
  34. package/dist/cjs/modal-header.js +9 -0
  35. package/dist/cjs/modal-title.js +13 -2
  36. package/dist/cjs/modal-transition.js +9 -0
  37. package/dist/cjs/modal-wrapper.js +33 -11
  38. package/dist/cjs/version.json +1 -1
  39. package/dist/es2019/internal/components/modal-dialog.js +2 -1
  40. package/dist/es2019/internal/components/positioner.js +6 -3
  41. package/dist/es2019/internal/context.js +1 -0
  42. package/dist/es2019/internal/hooks/use-on-motion-finish.js +1 -0
  43. package/dist/es2019/internal/hooks/use-scroll.js +2 -1
  44. package/dist/es2019/modal-body.js +13 -2
  45. package/dist/es2019/modal-footer.js +9 -0
  46. package/dist/es2019/modal-header.js +9 -0
  47. package/dist/es2019/modal-title.js +13 -2
  48. package/dist/es2019/modal-transition.js +9 -0
  49. package/dist/es2019/modal-wrapper.js +32 -7
  50. package/dist/es2019/version.json +1 -1
  51. package/dist/esm/internal/components/modal-dialog.js +2 -1
  52. package/dist/esm/internal/components/positioner.js +6 -3
  53. package/dist/esm/internal/context.js +1 -0
  54. package/dist/esm/internal/hooks/use-on-motion-finish.js +1 -0
  55. package/dist/esm/internal/hooks/use-scroll.js +2 -1
  56. package/dist/esm/modal-body.js +13 -2
  57. package/dist/esm/modal-footer.js +9 -0
  58. package/dist/esm/modal-header.js +9 -0
  59. package/dist/esm/modal-title.js +13 -2
  60. package/dist/esm/modal-transition.js +9 -0
  61. package/dist/esm/modal-wrapper.js +32 -10
  62. package/dist/esm/version.json +1 -1
  63. package/dist/types/modal-body.d.ts +9 -0
  64. package/dist/types/modal-footer.d.ts +9 -0
  65. package/dist/types/modal-header.d.ts +9 -0
  66. package/dist/types/modal-title.d.ts +9 -0
  67. package/dist/types/modal-transition.d.ts +9 -0
  68. package/dist/types/modal-wrapper.d.ts +10 -0
  69. package/dist/types/types.d.ts +2 -2
  70. package/package.json +10 -9
  71. package/report.api.md +210 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @atlaskit/modal-dialog
2
2
 
3
+ ## 12.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`c44f3f5f973`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c44f3f5f973) - Modal Dialog’s focus lock now allows focus to reach elements outside the modal if they contain the data-atlas-extension attribute, such as a browser extension that renders in-browser.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
13
+ ## 12.2.15
14
+
15
+ ### Patch Changes
16
+
17
+ - [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
18
+
19
+ ## 12.2.14
20
+
21
+ ### Patch Changes
22
+
23
+ - [`454ec1bbf07`](https://bitbucket.org/atlassian/atlassian-frontend/commits/454ec1bbf07) - Internal code change turning on new linting rules.
24
+ - Updated dependencies
25
+
3
26
  ## 12.2.13
4
27
 
5
28
  ### Patch Changes
@@ -17,7 +17,9 @@ export default function Example() {
17
17
 
18
18
  return (
19
19
  <>
20
- <button onClick={open}>open modal</button>
20
+ <button onClick={open} type="button">
21
+ open modal
22
+ </button>
21
23
 
22
24
  <ModalTransition>
23
25
  {isOpen && (
@@ -27,7 +27,7 @@ const InteractionPerformance = ({ index = 0 }: { index?: number }) => {
27
27
 
28
28
  return (
29
29
  <>
30
- <button data-testid="open-button" onClick={open}>
30
+ <button data-testid="open-button" onClick={open} type="button">
31
31
  {openText(index)}
32
32
  </button>
33
33
 
@@ -34,7 +34,7 @@ const ScrollPerformance = () => {
34
34
 
35
35
  return (
36
36
  <>
37
- <button data-testid="open" onClick={open}>
37
+ <button data-testid="open" onClick={open} type="button">
38
38
  {openText}
39
39
  </button>
40
40
 
@@ -7,7 +7,7 @@ import {
7
7
  } from '@atlaskit/codemod-utils';
8
8
 
9
9
  import { handlePropSpread } from './migrations/handle-prop-spread';
10
- import { inlineWidthNamesDeclaration } from './migrations/inline-WidthNames-declaration';
10
+ import { inlineWidthNamesDeclaration } from './migrations/inline-width-names-declaration';
11
11
  import { mapActionsProp } from './migrations/map-actions-prop';
12
12
  import { mapBodyFromProps } from './migrations/map-body-from-props';
13
13
  import { mapContainerFromProps } from './migrations/map-container-from-props';
@@ -19,7 +19,7 @@ import { removeComponentOverrideProps } from './migrations/remove-component-over
19
19
  import { removeIsChromeless } from './migrations/remove-is-chromeless';
20
20
  import { renameAppearanceType } from './migrations/rename-appearance-type';
21
21
  import { renameInnerComponentPropTypes } from './migrations/rename-inner-component-prop-types';
22
- import { renameScrollBehaviorToShouldScrollInViewport } from './migrations/rename-scrollBehavior-to-shouldScrollInViewport';
22
+ import { renameScrollBehaviorToShouldScrollInViewport } from './migrations/rename-scroll-behavior-to-should-scroll-in-viewport';
23
23
 
24
24
  /**
25
25
  * The order of these migrations matters!
@@ -1,6 +1,6 @@
1
1
  import { createTransformer } from '@atlaskit/codemod-utils';
2
2
 
3
- import { inlineWidthNamesDeclaration } from '../migrations/inline-WidthNames-declaration';
3
+ import { inlineWidthNamesDeclaration } from '../migrations/inline-width-names-declaration';
4
4
 
5
5
  const transformer = createTransformer([inlineWidthNamesDeclaration]);
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { createTransformer } from '@atlaskit/codemod-utils';
2
2
 
3
- import { renameScrollBehaviorToShouldScrollInViewport } from '../migrations/rename-scrollBehavior-to-shouldScrollInViewport';
3
+ import { renameScrollBehaviorToShouldScrollInViewport } from '../migrations/rename-scroll-behavior-to-should-scroll-in-viewport';
4
4
 
5
5
  const transformer = createTransformer([
6
6
  renameScrollBehaviorToShouldScrollInViewport,
@@ -152,7 +152,8 @@ var ModalDialog = function ModalDialog(props) {
152
152
  "aria-modal": true
153
153
  }), children));
154
154
  }))));
155
- };
155
+ }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
156
+
156
157
 
157
158
  var _default = ModalDialog;
158
159
  exports.default = _default;
@@ -56,9 +56,11 @@ var stackTransitionStyles = (0, _core.css)({
56
56
  transitionProperty: 'transform',
57
57
  transitionTimingFunction: _curves.easeInOut,
58
58
 
59
- /** Duplicated from @atlaskit/motion/accessibility
59
+ /**
60
+ * Duplicated from @atlaskit/motion/accessibility
60
61
  * because @repo/internal/styles/consistent-style-ordering
61
- * doesn't work well with object spreading. */
62
+ * doesn't work well with object spreading.
63
+ */
62
64
  '@media (prefers-reduced-motion: reduce)': {
63
65
  animation: 'none',
64
66
  transition: 'none'
@@ -85,7 +87,8 @@ var Positioner = function Positioner(props) {
85
87
  stackIndex > 0 ? stackTransformStyles : stackIdleStyles, shouldScrollInViewport ? viewportScrollStyles : bodyScrollStyles],
86
88
  "data-testid": testId && "".concat(testId, "--positioner")
87
89
  }, children);
88
- };
90
+ }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
91
+
89
92
 
90
93
  var _default = Positioner;
91
94
  exports.default = _default;
@@ -7,6 +7,7 @@ exports.ScrollContext = exports.ModalContext = void 0;
7
7
 
8
8
  var _react = require("react");
9
9
 
10
+ /* eslint-disable @repo/internal/react/require-jsdoc */
10
11
  var ModalContext = /*#__PURE__*/(0, _react.createContext)(null);
11
12
  exports.ModalContext = ModalContext;
12
13
  var ScrollContext = /*#__PURE__*/(0, _react.createContext)(null);
@@ -7,6 +7,7 @@ exports.default = useOnMotionFinish;
7
7
 
8
8
  var _react = require("react");
9
9
 
10
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
10
11
  function useOnMotionFinish(_ref) {
11
12
  var onOpenComplete = _ref.onOpenComplete,
12
13
  onCloseComplete = _ref.onCloseComplete;
@@ -9,6 +9,7 @@ var _react = require("react");
9
9
 
10
10
  var _context = require("../context");
11
11
 
12
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
12
13
  function useScroll() {
13
14
  var shouldScrollInViewport = (0, _react.useContext)(_context.ScrollContext);
14
15
 
@@ -29,19 +29,30 @@ var bodyStyles = (0, _core.css)({
29
29
  /**
30
30
  * Adding the padding here avoids cropping the keyline on its sides.
31
31
  * The combined vertical spacing is maintained by subtracting the
32
- * keyline height from header and footer. */
32
+ * keyline height from header and footer.
33
+ */
33
34
 
34
35
  var bodyScrollStyles = (0, _core.css)({
35
36
  padding: "".concat(_constants.keylineHeight, "px ").concat(_constants.padding, "px")
36
37
  });
37
38
  /**
38
39
  * Keylines will not be shown if scrolling in viewport so we do
39
- * not account for them in this case. */
40
+ * not account for them in this case.
41
+ */
40
42
 
41
43
  var viewportScrollStyles = (0, _core.css)({
42
44
  padding: "0px ".concat(_constants.padding, "px")
43
45
  });
44
46
 
47
+ /**
48
+ * __Modal body__
49
+ *
50
+ * A modal body is used to display the main content of a modal.
51
+ *
52
+ * - [Examples](https://atlassian.design/components/modal-dialog/examples)
53
+ * - [Code](https://atlassian.design/components/modal-dialog/code#modal-body-props)
54
+ * - [Usage](https://atlassian.design/components/modal-dialog/usage)
55
+ */
45
56
  var ModalBody = function ModalBody(props) {
46
57
  var children = props.children,
47
58
  userDefinedTestId = props.testId;
@@ -22,6 +22,15 @@ var footerStyles = (0, _core.css)({
22
22
  gap: "".concat(_constants.footerItemGap, "px")
23
23
  });
24
24
 
25
+ /**
26
+ * __Modal footer__
27
+ *
28
+ * A modal footer often contains a primary action and the ability to cancel and close the dialog, though can contain any React element.
29
+ *
30
+ * - [Examples](https://atlassian.design/components/modal-dialog/examples#modal-footer)
31
+ * - [Code](https://atlassian.design/components/modal-dialog/code#modal-footer-props)
32
+ * - [Usage](https://atlassian.design/components/modal-dialog/usage)
33
+ */
25
34
  var ModalFooter = function ModalFooter(props) {
26
35
  var children = props.children,
27
36
  userDefinedTestId = props.testId;
@@ -25,6 +25,15 @@ var headerStyles = (0, _core.css)({
25
25
  justifyContent: 'space-between'
26
26
  });
27
27
 
28
+ /**
29
+ * __Modal header__
30
+ *
31
+ * A modal header contains the title of the modal and can contain other React elements such as a close button.
32
+ *
33
+ * - [Examples](https://atlassian.design/components/modal-dialog/examples#modal-header)
34
+ * - [Code](https://atlassian.design/components/modal-dialog/code#modal-header-props)
35
+ * - [Usage](https://atlassian.design/components/modal-dialog/usage)
36
+ */
28
37
  var ModalHeader = function ModalHeader(props) {
29
38
  var children = props.children,
30
39
  userDefinedTestId = props.testId;
@@ -38,7 +38,8 @@ var textStyles = (0, _core.css)({
38
38
  /**
39
39
  * This ensures that the element fills the whole header space
40
40
  * and its content does not overflow (since flex items don't
41
- * shrink past its content size by default). */
41
+ * shrink past its content size by default).
42
+ */
42
43
  flex: '1 1 auto',
43
44
  wordWrap: 'break-word'
44
45
  });
@@ -50,7 +51,8 @@ var iconStyles = (0, _core.css)({
50
51
  /**
51
52
  * When the title is truncated (not multi-line), we adjust the
52
53
  * line height to avoid cropping the descenders. This removes
53
- * the extra spacing that we get from that adjustment. */
54
+ * the extra spacing that we get from that adjustment.
55
+ */
54
56
 
55
57
  var lineHeightOffset = fontSize - fontSize * adjustedLineHeight;
56
58
  var truncatedTextStyles = (0, _core.css)({
@@ -78,6 +80,15 @@ var TitleIcon = function TitleIcon(_ref) {
78
80
  }));
79
81
  };
80
82
 
83
+ /**
84
+ * __Modal title__
85
+ *
86
+ * A modal title is used to display a title within a modal.
87
+ *
88
+ * - [Examples](https://atlassian.design/components/modal-dialog/examples)
89
+ * - [Code](https://atlassian.design/components/modal-dialog/code)
90
+ * - [Usage](https://atlassian.design/components/modal-dialog/usage)
91
+ */
81
92
  var ModalTitle = function ModalTitle(props) {
82
93
  var appearance = props.appearance,
83
94
  children = props.children,
@@ -11,6 +11,15 @@ var _react = _interopRequireDefault(require("react"));
11
11
 
12
12
  var _exitingPersistence = _interopRequireDefault(require("@atlaskit/motion/exiting-persistence"));
13
13
 
14
+ /**
15
+ * __Modal transition__
16
+ *
17
+ * A modal transition wraps a modal to provide a fluid transition upon opening and closing.
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
+ */
14
23
  var ModalTransition = function ModalTransition(props) {
15
24
  return /*#__PURE__*/_react.default.createElement(_exitingPersistence.default, {
16
25
  appear: true
@@ -11,8 +11,6 @@ exports.default = void 0;
11
11
 
12
12
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
13
 
14
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
15
-
16
14
  var _react = require("react");
17
15
 
18
16
  var _core = require("@emotion/core");
@@ -41,12 +39,11 @@ var _useModalStack = _interopRequireDefault(require("./internal/hooks/use-modal-
41
39
 
42
40
  var _usePreventProgrammaticScroll = _interopRequireDefault(require("./internal/hooks/use-prevent-programmatic-scroll"));
43
41
 
44
- var _excluded = ["autoFocus", "shouldCloseOnEscapePress", "shouldCloseOnOverlayClick", "shouldScrollInViewport", "stackIndex", "onClose", "onStackChange", "isBlanketHidden", "testId"];
45
-
46
42
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
47
43
 
48
44
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
49
45
 
46
+ /** @jsx jsx */
50
47
  var fillScreenStyles = (0, _core.css)({
51
48
  width: '100vw',
52
49
  height: '100vh',
@@ -57,6 +54,22 @@ var fillScreenStyles = (0, _core.css)({
57
54
  WebkitOverflowScrolling: 'touch'
58
55
  });
59
56
 
57
+ var whiteListElements = function whiteListElements(element) {
58
+ // allows focus to reach elements outside the modal if they contain the data-atlas-extension attribute
59
+ return !element.hasAttribute('data-atlas-extension');
60
+ };
61
+ /**
62
+ * __Modal wrapper__
63
+ *
64
+ * A modal wrapper displays content that requires user interaction, in a layer above the page.
65
+ * This component is primary container for other modal components.
66
+ *
67
+ * - [Examples](https://atlassian.design/components/modal-dialog/examples)
68
+ * - [Code](https://atlassian.design/components/modal-dialog/code)
69
+ * - [Usage](https://atlassian.design/components/modal-dialog/usage)
70
+ */
71
+
72
+
60
73
  var ModalWrapper = function ModalWrapper(props) {
61
74
  var _props$autoFocus = props.autoFocus,
62
75
  autoFocus = _props$autoFocus === void 0 ? true : _props$autoFocus,
@@ -72,8 +85,12 @@ var ModalWrapper = function ModalWrapper(props) {
72
85
  _props$onStackChange = props.onStackChange,
73
86
  onStackChange = _props$onStackChange === void 0 ? _noop.default : _props$onStackChange,
74
87
  isBlanketHidden = props.isBlanketHidden,
75
- testId = props.testId,
76
- modalDialogProps = (0, _objectWithoutProperties2.default)(props, _excluded);
88
+ children = props.children,
89
+ height = props.height,
90
+ width = props.width,
91
+ onCloseComplete = props.onCloseComplete,
92
+ onOpenComplete = props.onOpenComplete,
93
+ testId = props.testId;
77
94
  var calculatedStackIndex = (0, _useModalStack.default)({
78
95
  onStackChange: onStackChange
79
96
  });
@@ -86,7 +103,7 @@ var ModalWrapper = function ModalWrapper(props) {
86
103
  action: 'closed',
87
104
  componentName: 'modalDialog',
88
105
  packageName: "@atlaskit/modal-dialog",
89
- packageVersion: "12.2.13"
106
+ packageVersion: "12.3.0"
90
107
  });
91
108
  var onBlanketClicked = (0, _react.useCallback)(function (e) {
92
109
  if (shouldCloseOnOverlayClick) {
@@ -102,13 +119,17 @@ var ModalWrapper = function ModalWrapper(props) {
102
119
  isTinted: !isBlanketHidden,
103
120
  onBlanketClicked: onBlanketClicked,
104
121
  testId: testId && "".concat(testId, "--blanket")
105
- }, (0, _core.jsx)(_modalDialog.default, (0, _extends2.default)({
122
+ }, (0, _core.jsx)(_modalDialog.default, {
106
123
  testId: testId,
107
124
  autoFocus: autoFocus,
108
125
  stackIndex: stackIndex,
109
126
  onClose: onCloseHandler,
110
- shouldScrollInViewport: shouldScrollInViewport
111
- }, modalDialogProps)));
127
+ shouldScrollInViewport: shouldScrollInViewport,
128
+ height: height,
129
+ width: width,
130
+ onCloseComplete: onCloseComplete,
131
+ onOpenComplete: onOpenComplete
132
+ }, children));
112
133
  return (0, _core.jsx)(_portal.default, {
113
134
  zIndex: _constants.layers.modal()
114
135
  }, (0, _core.jsx)(_fadeIn.default, null, function (fadeInProps) {
@@ -118,7 +139,8 @@ var ModalWrapper = function ModalWrapper(props) {
118
139
  }), (0, _core.jsx)(_reactFocusLock.default, {
119
140
  autoFocus: autoFocusLock,
120
141
  disabled: !isForeground,
121
- returnFocus: true
142
+ returnFocus: true,
143
+ whiteList: whiteListElements
122
144
  }, (0, _core.jsx)(_reactScrolllock.default, null), shouldScrollInViewport ? (0, _core.jsx)(_reactScrolllock.TouchScrollable, null, modalDialogWithBlanket) : modalDialogWithBlanket));
123
145
  }));
124
146
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/modal-dialog",
3
- "version": "12.2.13",
3
+ "version": "12.3.0",
4
4
  "sideEffects": false
5
5
  }
@@ -117,6 +117,7 @@ const ModalDialog = props => {
117
117
  tabIndex: -1,
118
118
  "aria-modal": true
119
119
  }), children))))));
120
- };
120
+ }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
121
+
121
122
 
122
123
  export default ModalDialog;
@@ -44,9 +44,11 @@ const stackTransitionStyles = css({
44
44
  transitionProperty: 'transform',
45
45
  transitionTimingFunction: easeInOut,
46
46
 
47
- /** Duplicated from @atlaskit/motion/accessibility
47
+ /**
48
+ * Duplicated from @atlaskit/motion/accessibility
48
49
  * because @repo/internal/styles/consistent-style-ordering
49
- * doesn't work well with object spreading. */
50
+ * doesn't work well with object spreading.
51
+ */
50
52
  '@media (prefers-reduced-motion: reduce)': {
51
53
  animation: 'none',
52
54
  transition: 'none'
@@ -75,6 +77,7 @@ const Positioner = props => {
75
77
  stackIndex > 0 ? stackTransformStyles : stackIdleStyles, shouldScrollInViewport ? viewportScrollStyles : bodyScrollStyles],
76
78
  "data-testid": testId && `${testId}--positioner`
77
79
  }, children);
78
- };
80
+ }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
81
+
79
82
 
80
83
  export default Positioner;
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @repo/internal/react/require-jsdoc */
1
2
  import { createContext } from 'react';
2
3
  export const ModalContext = /*#__PURE__*/createContext(null);
3
4
  export const ScrollContext = /*#__PURE__*/createContext(null);
@@ -1,4 +1,5 @@
1
1
  import { useCallback, useRef } from 'react';
2
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
2
3
  export default function useOnMotionFinish({
3
4
  onOpenComplete,
4
5
  onCloseComplete
@@ -1,5 +1,6 @@
1
1
  import { useContext } from 'react';
2
- import { ScrollContext } from '../context';
2
+ import { ScrollContext } from '../context'; // eslint-disable-next-line @repo/internal/react/require-jsdoc
3
+
3
4
  export default function useScroll() {
4
5
  const shouldScrollInViewport = useContext(ScrollContext);
5
6
 
@@ -13,19 +13,30 @@ const bodyStyles = css({
13
13
  /**
14
14
  * Adding the padding here avoids cropping the keyline on its sides.
15
15
  * The combined vertical spacing is maintained by subtracting the
16
- * keyline height from header and footer. */
16
+ * keyline height from header and footer.
17
+ */
17
18
 
18
19
  const bodyScrollStyles = css({
19
20
  padding: `${keylineHeight}px ${padding}px`
20
21
  });
21
22
  /**
22
23
  * Keylines will not be shown if scrolling in viewport so we do
23
- * not account for them in this case. */
24
+ * not account for them in this case.
25
+ */
24
26
 
25
27
  const viewportScrollStyles = css({
26
28
  padding: `0px ${padding}px`
27
29
  });
28
30
 
31
+ /**
32
+ * __Modal body__
33
+ *
34
+ * A modal body is used to display the main content of a modal.
35
+ *
36
+ * - [Examples](https://atlassian.design/components/modal-dialog/examples)
37
+ * - [Code](https://atlassian.design/components/modal-dialog/code#modal-body-props)
38
+ * - [Usage](https://atlassian.design/components/modal-dialog/usage)
39
+ */
29
40
  const ModalBody = props => {
30
41
  const {
31
42
  children,
@@ -12,6 +12,15 @@ const footerStyles = css({
12
12
  gap: `${footerItemGap}px`
13
13
  });
14
14
 
15
+ /**
16
+ * __Modal footer__
17
+ *
18
+ * A modal footer often contains a primary action and the ability to cancel and close the dialog, though can contain any React element.
19
+ *
20
+ * - [Examples](https://atlassian.design/components/modal-dialog/examples#modal-footer)
21
+ * - [Code](https://atlassian.design/components/modal-dialog/code#modal-footer-props)
22
+ * - [Usage](https://atlassian.design/components/modal-dialog/usage)
23
+ */
15
24
  const ModalFooter = props => {
16
25
  const {
17
26
  children,
@@ -12,6 +12,15 @@ const headerStyles = css({
12
12
  justifyContent: 'space-between'
13
13
  });
14
14
 
15
+ /**
16
+ * __Modal header__
17
+ *
18
+ * A modal header contains the title of the modal and can contain other React elements such as a close button.
19
+ *
20
+ * - [Examples](https://atlassian.design/components/modal-dialog/examples#modal-header)
21
+ * - [Code](https://atlassian.design/components/modal-dialog/code#modal-header-props)
22
+ * - [Usage](https://atlassian.design/components/modal-dialog/usage)
23
+ */
15
24
  const ModalHeader = props => {
16
25
  const {
17
26
  children,
@@ -24,7 +24,8 @@ const textStyles = css({
24
24
  /**
25
25
  * This ensures that the element fills the whole header space
26
26
  * and its content does not overflow (since flex items don't
27
- * shrink past its content size by default). */
27
+ * shrink past its content size by default).
28
+ */
28
29
  flex: '1 1 auto',
29
30
  wordWrap: 'break-word'
30
31
  });
@@ -36,7 +37,8 @@ const iconStyles = css({
36
37
  /**
37
38
  * When the title is truncated (not multi-line), we adjust the
38
39
  * line height to avoid cropping the descenders. This removes
39
- * the extra spacing that we get from that adjustment. */
40
+ * the extra spacing that we get from that adjustment.
41
+ */
40
42
 
41
43
  const lineHeightOffset = fontSize - fontSize * adjustedLineHeight;
42
44
  const truncatedTextStyles = css({
@@ -65,6 +67,15 @@ const TitleIcon = ({
65
67
  }));
66
68
  };
67
69
 
70
+ /**
71
+ * __Modal title__
72
+ *
73
+ * A modal title is used to display a title within a modal.
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
+ */
68
79
  const ModalTitle = props => {
69
80
  const {
70
81
  appearance,
@@ -1,5 +1,14 @@
1
1
  import React from 'react';
2
2
  import ExitingPersistence from '@atlaskit/motion/exiting-persistence';
3
+ /**
4
+ * __Modal transition__
5
+ *
6
+ * A modal transition wraps a modal to provide a fluid transition upon opening and closing.
7
+ *
8
+ * - [Examples](https://atlassian.design/components/modal-dialog/examples)
9
+ * - [Code](https://atlassian.design/components/modal-dialog/code)
10
+ * - [Usage](https://atlassian.design/components/modal-dialog/usage)
11
+ */
3
12
 
4
13
  const ModalTransition = props => {
5
14
  return /*#__PURE__*/React.createElement(ExitingPersistence, {