@atlaskit/modal-dialog 12.2.13 → 12.2.14

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 +7 -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 +25 -10
  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 +24 -6
  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 +24 -9
  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 +8 -7
  71. package/report.api.md +210 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlaskit/modal-dialog
2
2
 
3
+ ## 12.2.14
4
+
5
+ ### Patch Changes
6
+
7
+ - [`454ec1bbf07`](https://bitbucket.org/atlassian/atlassian-frontend/commits/454ec1bbf07) - Internal code change turning on new linting rules.
8
+ - Updated dependencies
9
+
3
10
  ## 12.2.13
4
11
 
5
12
  ### 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',
@@ -56,6 +53,16 @@ var fillScreenStyles = (0, _core.css)({
56
53
  overflowY: 'auto',
57
54
  WebkitOverflowScrolling: 'touch'
58
55
  });
56
+ /**
57
+ * __Modal wrapper__
58
+ *
59
+ * A modal wrapper displays content that requires user interaction, in a layer above the page.
60
+ * This component is primary container for other modal components.
61
+ *
62
+ * - [Examples](https://atlassian.design/components/modal-dialog/examples)
63
+ * - [Code](https://atlassian.design/components/modal-dialog/code)
64
+ * - [Usage](https://atlassian.design/components/modal-dialog/usage)
65
+ */
59
66
 
60
67
  var ModalWrapper = function ModalWrapper(props) {
61
68
  var _props$autoFocus = props.autoFocus,
@@ -72,8 +79,12 @@ var ModalWrapper = function ModalWrapper(props) {
72
79
  _props$onStackChange = props.onStackChange,
73
80
  onStackChange = _props$onStackChange === void 0 ? _noop.default : _props$onStackChange,
74
81
  isBlanketHidden = props.isBlanketHidden,
75
- testId = props.testId,
76
- modalDialogProps = (0, _objectWithoutProperties2.default)(props, _excluded);
82
+ children = props.children,
83
+ height = props.height,
84
+ width = props.width,
85
+ onCloseComplete = props.onCloseComplete,
86
+ onOpenComplete = props.onOpenComplete,
87
+ testId = props.testId;
77
88
  var calculatedStackIndex = (0, _useModalStack.default)({
78
89
  onStackChange: onStackChange
79
90
  });
@@ -86,7 +97,7 @@ var ModalWrapper = function ModalWrapper(props) {
86
97
  action: 'closed',
87
98
  componentName: 'modalDialog',
88
99
  packageName: "@atlaskit/modal-dialog",
89
- packageVersion: "12.2.13"
100
+ packageVersion: "12.2.14"
90
101
  });
91
102
  var onBlanketClicked = (0, _react.useCallback)(function (e) {
92
103
  if (shouldCloseOnOverlayClick) {
@@ -102,13 +113,17 @@ var ModalWrapper = function ModalWrapper(props) {
102
113
  isTinted: !isBlanketHidden,
103
114
  onBlanketClicked: onBlanketClicked,
104
115
  testId: testId && "".concat(testId, "--blanket")
105
- }, (0, _core.jsx)(_modalDialog.default, (0, _extends2.default)({
116
+ }, (0, _core.jsx)(_modalDialog.default, {
106
117
  testId: testId,
107
118
  autoFocus: autoFocus,
108
119
  stackIndex: stackIndex,
109
120
  onClose: onCloseHandler,
110
- shouldScrollInViewport: shouldScrollInViewport
111
- }, modalDialogProps)));
121
+ shouldScrollInViewport: shouldScrollInViewport,
122
+ height: height,
123
+ width: width,
124
+ onCloseComplete: onCloseComplete,
125
+ onOpenComplete: onOpenComplete
126
+ }, children));
112
127
  return (0, _core.jsx)(_portal.default, {
113
128
  zIndex: _constants.layers.modal()
114
129
  }, (0, _core.jsx)(_fadeIn.default, null, function (fadeInProps) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/modal-dialog",
3
- "version": "12.2.13",
3
+ "version": "12.2.14",
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, {
@@ -24,6 +24,16 @@ const fillScreenStyles = css({
24
24
  overflowY: 'auto',
25
25
  WebkitOverflowScrolling: 'touch'
26
26
  });
27
+ /**
28
+ * __Modal wrapper__
29
+ *
30
+ * A modal wrapper displays content that requires user interaction, in a layer above the page.
31
+ * This component is primary container for other modal components.
32
+ *
33
+ * - [Examples](https://atlassian.design/components/modal-dialog/examples)
34
+ * - [Code](https://atlassian.design/components/modal-dialog/code)
35
+ * - [Usage](https://atlassian.design/components/modal-dialog/usage)
36
+ */
27
37
 
28
38
  const ModalWrapper = props => {
29
39
  const {
@@ -35,8 +45,12 @@ const ModalWrapper = props => {
35
45
  onClose = noop,
36
46
  onStackChange = noop,
37
47
  isBlanketHidden,
38
- testId,
39
- ...modalDialogProps
48
+ children,
49
+ height,
50
+ width,
51
+ onCloseComplete,
52
+ onOpenComplete,
53
+ testId
40
54
  } = props;
41
55
  const calculatedStackIndex = useModalStack({
42
56
  onStackChange
@@ -50,7 +64,7 @@ const ModalWrapper = props => {
50
64
  action: 'closed',
51
65
  componentName: 'modalDialog',
52
66
  packageName: "@atlaskit/modal-dialog",
53
- packageVersion: "12.2.13"
67
+ packageVersion: "12.2.14"
54
68
  });
55
69
  const onBlanketClicked = useCallback(e => {
56
70
  if (shouldCloseOnOverlayClick) {
@@ -66,13 +80,17 @@ const ModalWrapper = props => {
66
80
  isTinted: !isBlanketHidden,
67
81
  onBlanketClicked: onBlanketClicked,
68
82
  testId: testId && `${testId}--blanket`
69
- }, jsx(ModalDialog, _extends({
83
+ }, jsx(ModalDialog, {
70
84
  testId: testId,
71
85
  autoFocus: autoFocus,
72
86
  stackIndex: stackIndex,
73
87
  onClose: onCloseHandler,
74
- shouldScrollInViewport: shouldScrollInViewport
75
- }, modalDialogProps)));
88
+ shouldScrollInViewport: shouldScrollInViewport,
89
+ height: height,
90
+ width: width,
91
+ onCloseComplete: onCloseComplete,
92
+ onOpenComplete: onOpenComplete
93
+ }, children));
76
94
  return jsx(Portal, {
77
95
  zIndex: layers.modal()
78
96
  }, jsx(FadeIn, null, fadeInProps => jsx("div", _extends({}, fadeInProps, {