@atlaskit/modal-dialog 12.6.3 → 12.6.5

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
+ ## 12.6.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`c2484be748e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c2484be748e) - [ux] DSP-11269: hard coded the warning icon to improve color contrast
8
+
9
+ ## 12.6.4
10
+
11
+ ### Patch Changes
12
+
13
+ - [`c673c7246cf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c673c7246cf) - Internal change to improve how media queries are applied. There is no expected behaviour change.
14
+
3
15
  ## 12.6.3
4
16
 
5
17
  ### Patch Changes
@@ -8,6 +8,7 @@ exports.default = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
10
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
11
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
12
  var _react = require("react");
12
13
  var _react2 = require("@emotion/react");
13
14
  var _reactUid = require("react-uid");
@@ -15,15 +16,16 @@ var _mergeRefs = _interopRequireDefault(require("@atlaskit/ds-lib/merge-refs"));
15
16
  var _useAutoFocus = _interopRequireDefault(require("@atlaskit/ds-lib/use-auto-focus"));
16
17
  var _focusRing = _interopRequireDefault(require("@atlaskit/focus-ring"));
17
18
  var _fadeIn = _interopRequireDefault(require("@atlaskit/motion/fade-in"));
19
+ var _primitives = require("@atlaskit/primitives");
18
20
  var _colors = require("@atlaskit/theme/colors");
19
21
  var _constants = require("../constants");
20
22
  var _context = require("../context");
21
23
  var _useOnMotionFinish3 = _interopRequireDefault(require("../hooks/use-on-motion-finish"));
22
24
  var _utils = require("../utils");
23
25
  var _positioner = _interopRequireDefault(require("./positioner"));
26
+ var _css;
24
27
  /** @jsx jsx */
25
-
26
- var dialogStyles = (0, _react2.css)({
28
+ var dialogStyles = (0, _react2.css)((_css = {
27
29
  display: 'flex',
28
30
  width: '100%',
29
31
  maxWidth: '100vw',
@@ -35,46 +37,36 @@ var dialogStyles = (0, _react2.css)({
35
37
  flexDirection: 'column',
36
38
  backgroundColor: "var(--ds-surface-overlay, ".concat(_colors.N0, ")"),
37
39
  color: _constants.textColor,
38
- pointerEvents: 'auto',
39
- '@media (min-width: 480px)': {
40
- width: 'var(--modal-dialog-width)',
41
- maxWidth: 'inherit',
42
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
43
- marginRight: 'inherit',
44
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
45
- marginLeft: 'inherit',
46
- borderRadius: _constants.borderRadius,
47
- boxShadow: "var(--ds-shadow-overlay, ".concat("0 0 0 1px ".concat(_colors.N30A, ", 0 2px 1px ").concat(_colors.N30A, ", 0 0 20px -6px ").concat(_colors.N60A), ")")
48
- },
49
- /**
50
- * This is to support scrolling if the modal's children are wrapped in
51
- * a form.
52
- */
53
- // eslint-disable-next-line @repo/internal/styles/no-nested-styles
54
- '& > form:only-child': {
55
- display: 'inherit',
56
- maxHeight: 'inherit',
57
- flexDirection: 'inherit'
58
- }
59
- });
60
- var viewportScrollStyles = (0, _react2.css)({
40
+ pointerEvents: 'auto'
41
+ }, (0, _defineProperty2.default)(_css, _primitives.media.above.xs, {
42
+ width: 'var(--modal-dialog-width)',
43
+ maxWidth: 'inherit',
44
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
45
+ marginRight: 'inherit',
46
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
47
+ marginLeft: 'inherit',
48
+ borderRadius: _constants.borderRadius,
49
+ boxShadow: "var(--ds-shadow-overlay, ".concat("0 0 0 1px ".concat(_colors.N30A, ", 0 2px 1px ").concat(_colors.N30A, ", 0 0 20px -6px ").concat(_colors.N60A), ")")
50
+ }), (0, _defineProperty2.default)(_css, '& > form:only-child', {
51
+ display: 'inherit',
52
+ maxHeight: 'inherit',
53
+ flexDirection: 'inherit'
54
+ }), _css));
55
+ var viewportScrollStyles = (0, _react2.css)((0, _defineProperty2.default)({
61
56
  /**
62
57
  * This ensures that the element fills the viewport on mobile
63
58
  * while also allowing it to overflow if its height is larger than
64
59
  * the viewport.
65
60
  */
66
61
  minHeight: '100vh',
67
- maxHeight: 'none',
68
- '@media (min-width: 480px)': {
69
- minHeight: 'var(--modal-dialog-height)'
70
- }
71
- });
72
- var bodyScrollStyles = (0, _react2.css)({
73
- '@media (min-width: 480px)': {
74
- height: 'var(--modal-dialog-height)',
75
- maxHeight: 'inherit'
76
- }
77
- });
62
+ maxHeight: 'none'
63
+ }, _primitives.media.above.xs, {
64
+ minHeight: 'var(--modal-dialog-height)'
65
+ }));
66
+ var bodyScrollStyles = (0, _react2.css)((0, _defineProperty2.default)({}, _primitives.media.above.xs, {
67
+ height: 'var(--modal-dialog-height)',
68
+ maxHeight: 'inherit'
69
+ }));
78
70
  var ModalDialog = function ModalDialog(props) {
79
71
  var _props$width = props.width,
80
72
  width = _props$width === void 0 ? 'medium' : _props$width,
@@ -1,12 +1,15 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.default = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
7
9
  var _react = require("@emotion/react");
8
10
  var _curves = require("@atlaskit/motion/curves");
9
11
  var _durations = require("@atlaskit/motion/durations");
12
+ var _primitives = require("@atlaskit/primitives");
10
13
  var _constants = require("@atlaskit/theme/constants");
11
14
  var _constants2 = require("../constants");
12
15
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
@@ -27,27 +30,24 @@ var positionerStyles = (0, _react.css)({
27
30
  left: 0,
28
31
  flexDirection: 'column'
29
32
  });
30
- var viewportScrollStyles = (0, _react.css)({
33
+ var viewportScrollStyles = (0, _react.css)((0, _defineProperty2.default)({
31
34
  height: 'auto',
32
- position: 'relative',
33
- '@media (min-width: 480px)': {
34
- margin: "".concat(_constants2.gutter, "px auto"),
35
- pointerEvents: 'none'
36
- }
37
- });
38
- var bodyScrollStyles = (0, _react.css)({
39
- '@media (min-width: 480px)': {
40
- maxWidth: maxWidthDimensions,
41
- maxHeight: maxHeightDimensions,
42
- marginRight: 'auto',
43
- marginLeft: 'auto',
44
- position: 'absolute',
45
- top: "".concat(_constants2.gutter, "px"),
46
- right: 0,
47
- left: 0,
48
- pointerEvents: 'none'
49
- }
50
- });
35
+ position: 'relative'
36
+ }, _primitives.media.above.xs, {
37
+ margin: "".concat(_constants2.gutter, "px auto"),
38
+ pointerEvents: 'none'
39
+ }));
40
+ var bodyScrollStyles = (0, _react.css)((0, _defineProperty2.default)({}, _primitives.media.above.xs, {
41
+ maxWidth: maxWidthDimensions,
42
+ maxHeight: maxHeightDimensions,
43
+ marginRight: 'auto',
44
+ marginLeft: 'auto',
45
+ position: 'absolute',
46
+ top: "".concat(_constants2.gutter, "px"),
47
+ right: 0,
48
+ left: 0,
49
+ pointerEvents: 'none'
50
+ }));
51
51
  var stackTransitionStyles = (0, _react.css)({
52
52
  transitionDuration: "".concat(_durations.mediumDurationMs, "ms"),
53
53
  transitionProperty: 'transform',
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
11
  var _react = _interopRequireWildcard(require("react"));
11
12
  var _react2 = require("@emotion/react");
12
13
  var _bindEventListener = require("bind-event-listener");
@@ -16,24 +17,24 @@ var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
16
17
  var _useLazyCallback = _interopRequireDefault(require("@atlaskit/ds-lib/use-lazy-callback"));
17
18
  var _useStateRef3 = _interopRequireDefault(require("@atlaskit/ds-lib/use-state-ref"));
18
19
  var _focusRing = _interopRequireDefault(require("@atlaskit/focus-ring"));
20
+ var _primitives = require("@atlaskit/primitives");
19
21
  var _constants = require("../constants");
20
22
  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); }
21
23
  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; }
22
24
  /** @jsx jsx */
23
25
 
24
- var baseStyles = (0, _react2.css)({
26
+ var baseStyles = (0, _react2.css)((0, _defineProperty2.default)({
25
27
  display: 'inherit',
26
28
  margin: "var(--ds-space-0, 0px)",
27
29
  flex: 'inherit',
28
30
  flexDirection: 'inherit',
29
31
  flexGrow: 1,
30
32
  overflowX: 'hidden',
31
- overflowY: 'auto',
32
- '@media (min-width: 480px)': {
33
- height: 'unset',
34
- overflowY: 'auto'
35
- }
36
- });
33
+ overflowY: 'auto'
34
+ }, _primitives.media.above.xs, {
35
+ height: 'unset',
36
+ overflowY: 'auto'
37
+ }));
37
38
  var topKeylineStyles = (0, _react2.css)({
38
39
  borderTop: "".concat(_constants.keylineHeight, "px solid ").concat(_constants.keylineColor)
39
40
  });
@@ -36,6 +36,6 @@ var textColor = "var(--ds-text, ".concat(_colors.N900, ")");
36
36
  exports.textColor = textColor;
37
37
  var iconColor = {
38
38
  danger: "var(--ds-icon-danger, ".concat(_colors.R400, ")"),
39
- warning: "var(--ds-icon-warning, ".concat(_colors.Y400, ")")
39
+ warning: "var(--ds-icon-warning, #D97008)"
40
40
  };
41
41
  exports.iconColor = iconColor;
@@ -86,7 +86,7 @@ var ModalWrapper = function ModalWrapper(props) {
86
86
  action: 'closed',
87
87
  componentName: 'modalDialog',
88
88
  packageName: "@atlaskit/modal-dialog",
89
- packageVersion: "12.6.3"
89
+ packageVersion: "12.6.5"
90
90
  });
91
91
  var onBlanketClicked = (0, _react.useCallback)(function (e) {
92
92
  if (shouldCloseOnOverlayClick) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/modal-dialog",
3
- "version": "12.6.3",
3
+ "version": "12.6.5",
4
4
  "sideEffects": false
5
5
  }
@@ -7,6 +7,7 @@ import mergeRefs from '@atlaskit/ds-lib/merge-refs';
7
7
  import useAutoFocus from '@atlaskit/ds-lib/use-auto-focus';
8
8
  import FocusRing from '@atlaskit/focus-ring';
9
9
  import FadeIn from '@atlaskit/motion/fade-in';
10
+ import { media } from '@atlaskit/primitives';
10
11
  import { N0, N30A, N60A } from '@atlaskit/theme/colors';
11
12
  import { borderRadius, textColor } from '../constants';
12
13
  import { ModalContext, ScrollContext } from '../context';
@@ -26,7 +27,7 @@ const dialogStyles = css({
26
27
  backgroundColor: `var(--ds-surface-overlay, ${N0})`,
27
28
  color: textColor,
28
29
  pointerEvents: 'auto',
29
- '@media (min-width: 480px)': {
30
+ [media.above.xs]: {
30
31
  width: 'var(--modal-dialog-width)',
31
32
  maxWidth: 'inherit',
32
33
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
@@ -40,7 +41,7 @@ const dialogStyles = css({
40
41
  * This is to support scrolling if the modal's children are wrapped in
41
42
  * a form.
42
43
  */
43
- // eslint-disable-next-line @repo/internal/styles/no-nested-styles
44
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
44
45
  '& > form:only-child': {
45
46
  display: 'inherit',
46
47
  maxHeight: 'inherit',
@@ -55,12 +56,12 @@ const viewportScrollStyles = css({
55
56
  */
56
57
  minHeight: '100vh',
57
58
  maxHeight: 'none',
58
- '@media (min-width: 480px)': {
59
+ [media.above.xs]: {
59
60
  minHeight: 'var(--modal-dialog-height)'
60
61
  }
61
62
  });
62
63
  const bodyScrollStyles = css({
63
- '@media (min-width: 480px)': {
64
+ [media.above.xs]: {
64
65
  height: 'var(--modal-dialog-height)',
65
66
  maxHeight: 'inherit'
66
67
  }
@@ -4,6 +4,7 @@
4
4
  import { css, jsx } from '@emotion/react';
5
5
  import { easeInOut } from '@atlaskit/motion/curves';
6
6
  import { mediumDurationMs } from '@atlaskit/motion/durations';
7
+ import { media } from '@atlaskit/primitives';
7
8
  import { layers } from '@atlaskit/theme/constants';
8
9
  import { gutter, verticalOffset } from '../constants';
9
10
  const maxWidthDimensions = `calc(100vw - ${gutter * 2}px)`;
@@ -24,13 +25,13 @@ const positionerStyles = css({
24
25
  const viewportScrollStyles = css({
25
26
  height: 'auto',
26
27
  position: 'relative',
27
- '@media (min-width: 480px)': {
28
+ [media.above.xs]: {
28
29
  margin: `${gutter}px auto`,
29
30
  pointerEvents: 'none'
30
31
  }
31
32
  });
32
33
  const bodyScrollStyles = css({
33
- '@media (min-width: 480px)': {
34
+ [media.above.xs]: {
34
35
  maxWidth: maxWidthDimensions,
35
36
  maxHeight: maxHeightDimensions,
36
37
  marginRight: 'auto',
@@ -9,6 +9,7 @@ import noop from '@atlaskit/ds-lib/noop';
9
9
  import useLazyCallback from '@atlaskit/ds-lib/use-lazy-callback';
10
10
  import useStateRef from '@atlaskit/ds-lib/use-state-ref';
11
11
  import FocusRing from '@atlaskit/focus-ring';
12
+ import { media } from '@atlaskit/primitives';
12
13
  import { keylineColor, keylineHeight } from '../constants';
13
14
  const baseStyles = css({
14
15
  display: 'inherit',
@@ -18,7 +19,7 @@ const baseStyles = css({
18
19
  flexGrow: 1,
19
20
  overflowX: 'hidden',
20
21
  overflowY: 'auto',
21
- '@media (min-width: 480px)': {
22
+ [media.above.xs]: {
22
23
  height: 'unset',
23
24
  overflowY: 'auto'
24
25
  }
@@ -1,4 +1,4 @@
1
- import { N30, N900, R400, Y400 } from '@atlaskit/theme/colors';
1
+ import { N30, N900, R400 } from '@atlaskit/theme/colors';
2
2
  import { borderRadius as getBorderRadius,
3
3
  // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
4
4
  gridSize as getGridSize } from '@atlaskit/theme/constants';
@@ -23,5 +23,5 @@ export const keylineColor = `var(--ds-border, ${N30})`;
23
23
  export const textColor = `var(--ds-text, ${N900})`;
24
24
  export const iconColor = {
25
25
  danger: `var(--ds-icon-danger, ${R400})`,
26
- warning: `var(--ds-icon-warning, ${Y400})`
26
+ warning: "var(--ds-icon-warning, #D97008)"
27
27
  };
@@ -72,7 +72,7 @@ const ModalWrapper = props => {
72
72
  action: 'closed',
73
73
  componentName: 'modalDialog',
74
74
  packageName: "@atlaskit/modal-dialog",
75
- packageVersion: "12.6.3"
75
+ packageVersion: "12.6.5"
76
76
  });
77
77
  const onBlanketClicked = useCallback(e => {
78
78
  if (shouldCloseOnOverlayClick) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/modal-dialog",
3
- "version": "12.6.3",
3
+ "version": "12.6.5",
4
4
  "sideEffects": false
5
5
  }
@@ -1,6 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import _typeof from "@babel/runtime/helpers/typeof";
4
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
5
+ var _css;
4
6
  /** @jsx jsx */
5
7
  import { useMemo } from 'react';
6
8
  import { css, jsx } from '@emotion/react';
@@ -9,13 +11,14 @@ import mergeRefs from '@atlaskit/ds-lib/merge-refs';
9
11
  import useAutoFocus from '@atlaskit/ds-lib/use-auto-focus';
10
12
  import FocusRing from '@atlaskit/focus-ring';
11
13
  import FadeIn from '@atlaskit/motion/fade-in';
14
+ import { media } from '@atlaskit/primitives';
12
15
  import { N0, N30A, N60A } from '@atlaskit/theme/colors';
13
16
  import { borderRadius, textColor } from '../constants';
14
17
  import { ModalContext, ScrollContext } from '../context';
15
18
  import useOnMotionFinish from '../hooks/use-on-motion-finish';
16
19
  import { dialogHeight, dialogWidth } from '../utils';
17
20
  import Positioner from './positioner';
18
- var dialogStyles = css({
21
+ var dialogStyles = css((_css = {
19
22
  display: 'flex',
20
23
  width: '100%',
21
24
  maxWidth: '100vw',
@@ -27,46 +30,36 @@ var dialogStyles = css({
27
30
  flexDirection: 'column',
28
31
  backgroundColor: "var(--ds-surface-overlay, ".concat(N0, ")"),
29
32
  color: textColor,
30
- pointerEvents: 'auto',
31
- '@media (min-width: 480px)': {
32
- width: 'var(--modal-dialog-width)',
33
- maxWidth: 'inherit',
34
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
35
- marginRight: 'inherit',
36
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
37
- marginLeft: 'inherit',
38
- borderRadius: borderRadius,
39
- boxShadow: "var(--ds-shadow-overlay, ".concat("0 0 0 1px ".concat(N30A, ", 0 2px 1px ").concat(N30A, ", 0 0 20px -6px ").concat(N60A), ")")
40
- },
41
- /**
42
- * This is to support scrolling if the modal's children are wrapped in
43
- * a form.
44
- */
45
- // eslint-disable-next-line @repo/internal/styles/no-nested-styles
46
- '& > form:only-child': {
47
- display: 'inherit',
48
- maxHeight: 'inherit',
49
- flexDirection: 'inherit'
50
- }
51
- });
52
- var viewportScrollStyles = css({
33
+ pointerEvents: 'auto'
34
+ }, _defineProperty(_css, media.above.xs, {
35
+ width: 'var(--modal-dialog-width)',
36
+ maxWidth: 'inherit',
37
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
38
+ marginRight: 'inherit',
39
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
40
+ marginLeft: 'inherit',
41
+ borderRadius: borderRadius,
42
+ boxShadow: "var(--ds-shadow-overlay, ".concat("0 0 0 1px ".concat(N30A, ", 0 2px 1px ").concat(N30A, ", 0 0 20px -6px ").concat(N60A), ")")
43
+ }), _defineProperty(_css, '& > form:only-child', {
44
+ display: 'inherit',
45
+ maxHeight: 'inherit',
46
+ flexDirection: 'inherit'
47
+ }), _css));
48
+ var viewportScrollStyles = css(_defineProperty({
53
49
  /**
54
50
  * This ensures that the element fills the viewport on mobile
55
51
  * while also allowing it to overflow if its height is larger than
56
52
  * the viewport.
57
53
  */
58
54
  minHeight: '100vh',
59
- maxHeight: 'none',
60
- '@media (min-width: 480px)': {
61
- minHeight: 'var(--modal-dialog-height)'
62
- }
63
- });
64
- var bodyScrollStyles = css({
65
- '@media (min-width: 480px)': {
66
- height: 'var(--modal-dialog-height)',
67
- maxHeight: 'inherit'
68
- }
69
- });
55
+ maxHeight: 'none'
56
+ }, media.above.xs, {
57
+ minHeight: 'var(--modal-dialog-height)'
58
+ }));
59
+ var bodyScrollStyles = css(_defineProperty({}, media.above.xs, {
60
+ height: 'var(--modal-dialog-height)',
61
+ maxHeight: 'inherit'
62
+ }));
70
63
  var ModalDialog = function ModalDialog(props) {
71
64
  var _props$width = props.width,
72
65
  width = _props$width === void 0 ? 'medium' : _props$width,
@@ -1,9 +1,11 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
2
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
2
3
  /** @jsx jsx */
3
4
 
4
5
  import { css, jsx } from '@emotion/react';
5
6
  import { easeInOut } from '@atlaskit/motion/curves';
6
7
  import { mediumDurationMs } from '@atlaskit/motion/durations';
8
+ import { media } from '@atlaskit/primitives';
7
9
  import { layers } from '@atlaskit/theme/constants';
8
10
  import { gutter, verticalOffset } from '../constants';
9
11
  var maxWidthDimensions = "calc(100vw - ".concat(gutter * 2, "px)");
@@ -21,27 +23,24 @@ var positionerStyles = css({
21
23
  left: 0,
22
24
  flexDirection: 'column'
23
25
  });
24
- var viewportScrollStyles = css({
26
+ var viewportScrollStyles = css(_defineProperty({
25
27
  height: 'auto',
26
- position: 'relative',
27
- '@media (min-width: 480px)': {
28
- margin: "".concat(gutter, "px auto"),
29
- pointerEvents: 'none'
30
- }
31
- });
32
- var bodyScrollStyles = css({
33
- '@media (min-width: 480px)': {
34
- maxWidth: maxWidthDimensions,
35
- maxHeight: maxHeightDimensions,
36
- marginRight: 'auto',
37
- marginLeft: 'auto',
38
- position: 'absolute',
39
- top: "".concat(gutter, "px"),
40
- right: 0,
41
- left: 0,
42
- pointerEvents: 'none'
43
- }
44
- });
28
+ position: 'relative'
29
+ }, media.above.xs, {
30
+ margin: "".concat(gutter, "px auto"),
31
+ pointerEvents: 'none'
32
+ }));
33
+ var bodyScrollStyles = css(_defineProperty({}, media.above.xs, {
34
+ maxWidth: maxWidthDimensions,
35
+ maxHeight: maxHeightDimensions,
36
+ marginRight: 'auto',
37
+ marginLeft: 'auto',
38
+ position: 'absolute',
39
+ top: "".concat(gutter, "px"),
40
+ right: 0,
41
+ left: 0,
42
+ pointerEvents: 'none'
43
+ }));
45
44
  var stackTransitionStyles = css({
46
45
  transitionDuration: "".concat(mediumDurationMs, "ms"),
47
46
  transitionProperty: 'transform',
@@ -1,4 +1,5 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
3
  /** @jsx jsx */
3
4
 
4
5
  import React, { forwardRef, useEffect, useRef, useState } from 'react';
@@ -10,20 +11,20 @@ import noop from '@atlaskit/ds-lib/noop';
10
11
  import useLazyCallback from '@atlaskit/ds-lib/use-lazy-callback';
11
12
  import useStateRef from '@atlaskit/ds-lib/use-state-ref';
12
13
  import FocusRing from '@atlaskit/focus-ring';
14
+ import { media } from '@atlaskit/primitives';
13
15
  import { keylineColor, keylineHeight } from '../constants';
14
- var baseStyles = css({
16
+ var baseStyles = css(_defineProperty({
15
17
  display: 'inherit',
16
18
  margin: "var(--ds-space-0, 0px)",
17
19
  flex: 'inherit',
18
20
  flexDirection: 'inherit',
19
21
  flexGrow: 1,
20
22
  overflowX: 'hidden',
21
- overflowY: 'auto',
22
- '@media (min-width: 480px)': {
23
- height: 'unset',
24
- overflowY: 'auto'
25
- }
26
- });
23
+ overflowY: 'auto'
24
+ }, media.above.xs, {
25
+ height: 'unset',
26
+ overflowY: 'auto'
27
+ }));
27
28
  var topKeylineStyles = css({
28
29
  borderTop: "".concat(keylineHeight, "px solid ").concat(keylineColor)
29
30
  });
@@ -1,4 +1,4 @@
1
- import { N30, N900, R400, Y400 } from '@atlaskit/theme/colors';
1
+ import { N30, N900, R400 } from '@atlaskit/theme/colors';
2
2
  import { borderRadius as getBorderRadius,
3
3
  // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
4
4
  gridSize as getGridSize } from '@atlaskit/theme/constants';
@@ -23,5 +23,5 @@ export var keylineColor = "var(--ds-border, ".concat(N30, ")");
23
23
  export var textColor = "var(--ds-text, ".concat(N900, ")");
24
24
  export var iconColor = {
25
25
  danger: "var(--ds-icon-danger, ".concat(R400, ")"),
26
- warning: "var(--ds-icon-warning, ".concat(Y400, ")")
26
+ warning: "var(--ds-icon-warning, #D97008)"
27
27
  };
@@ -76,7 +76,7 @@ var ModalWrapper = function ModalWrapper(props) {
76
76
  action: 'closed',
77
77
  componentName: 'modalDialog',
78
78
  packageName: "@atlaskit/modal-dialog",
79
- packageVersion: "12.6.3"
79
+ packageVersion: "12.6.5"
80
80
  });
81
81
  var onBlanketClicked = useCallback(function (e) {
82
82
  if (shouldCloseOnOverlayClick) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/modal-dialog",
3
- "version": "12.6.3",
3
+ "version": "12.6.5",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/modal-dialog",
3
- "version": "12.6.3",
3
+ "version": "12.6.5",
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/"
@@ -12,26 +12,7 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
- "typesVersions": {
16
- ">=4.5 <4.9": {
17
- "*": [
18
- "dist/types-ts4.5/*",
19
- "dist/types-ts4.5/index.d.ts"
20
- ]
21
- }
22
- },
23
15
  "sideEffects": false,
24
- "af:exports": {
25
- ".": "./src/index.tsx",
26
- "./types": "./src/types.tsx",
27
- "./hooks": "./src/hooks.tsx",
28
- "./modal-dialog": "./src/modal-wrapper.tsx",
29
- "./modal-header": "./src/modal-header.tsx",
30
- "./modal-title": "./src/modal-title.tsx",
31
- "./modal-body": "./src/modal-body.tsx",
32
- "./modal-footer": "./src/modal-footer.tsx",
33
- "./modal-transition": "./src/modal-transition.tsx"
34
- },
35
16
  "atlaskit:src": "src/index.tsx",
36
17
  "atlassian": {
37
18
  "team": "Design System Team",
@@ -53,8 +34,9 @@
53
34
  "@atlaskit/icon": "^21.12.0",
54
35
  "@atlaskit/motion": "^1.4.0",
55
36
  "@atlaskit/portal": "^4.3.0",
37
+ "@atlaskit/primitives": "^1.0.2",
56
38
  "@atlaskit/theme": "^12.5.0",
57
- "@atlaskit/tokens": "^1.11.0",
39
+ "@atlaskit/tokens": "^1.13.0",
58
40
  "@babel/runtime": "^7.0.0",
59
41
  "@emotion/react": "^11.7.1",
60
42
  "bind-event-listener": "^2.1.1",
@@ -68,6 +50,7 @@
68
50
  },
69
51
  "devDependencies": {
70
52
  "@af/accessibility-testing": "*",
53
+ "@af/visual-regression": "*",
71
54
  "@atlaskit/button": "*",
72
55
  "@atlaskit/ssr": "*",
73
56
  "@atlaskit/visual-regression": "*",
@@ -112,6 +95,25 @@
112
95
  ]
113
96
  }
114
97
  },
98
+ "typesVersions": {
99
+ ">=4.5 <4.9": {
100
+ "*": [
101
+ "dist/types-ts4.5/*",
102
+ "dist/types-ts4.5/index.d.ts"
103
+ ]
104
+ }
105
+ },
106
+ "af:exports": {
107
+ ".": "./src/index.tsx",
108
+ "./types": "./src/types.tsx",
109
+ "./hooks": "./src/hooks.tsx",
110
+ "./modal-dialog": "./src/modal-wrapper.tsx",
111
+ "./modal-header": "./src/modal-header.tsx",
112
+ "./modal-title": "./src/modal-title.tsx",
113
+ "./modal-body": "./src/modal-body.tsx",
114
+ "./modal-footer": "./src/modal-footer.tsx",
115
+ "./modal-transition": "./src/modal-transition.tsx"
116
+ },
115
117
  "homepage": "https://atlassian.design/components/modal-dialog/",
116
118
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
117
119
  }
@@ -0,0 +1,113 @@
1
+ ## API Report File for "@atlaskit/modal-dialog"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ /// <reference types="react" />
8
+
9
+ import { ExitingPersistenceProps } from '@atlaskit/motion/exiting-persistence';
10
+ import { jsx } from '@emotion/react';
11
+ import { default as React_2 } from 'react';
12
+ import { ReactNode } from 'react';
13
+ import { RefObject } from 'react';
14
+ import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
15
+
16
+ // @public (undocumented)
17
+ export type Appearance = 'danger' | 'warning';
18
+
19
+ // @public (undocumented)
20
+ export type KeyboardOrMouseEvent = KeyboardEvent | React_2.KeyboardEvent<any> | React_2.MouseEvent<any>;
21
+
22
+ // @public (undocumented)
23
+ export type ModalAttributes = {
24
+ testId?: ModalDialogProps['testId'];
25
+ titleId: string;
26
+ onClose?: OnCloseHandler;
27
+ };
28
+
29
+ // @public
30
+ export const ModalBody: (props: ModalBodyProps) => jsx.JSX.Element;
31
+
32
+ // @public (undocumented)
33
+ export interface ModalBodyProps {
34
+ children: React_2.ReactNode;
35
+ testId?: string;
36
+ }
37
+
38
+ // @public (undocumented)
39
+ export interface ModalDialogProps {
40
+ autoFocus?: RefObject<HTMLElement | null | undefined> | boolean;
41
+ children?: React_2.ReactNode;
42
+ height?: number | string;
43
+ isBlanketHidden?: boolean;
44
+ label?: string;
45
+ onClose?: OnCloseHandler;
46
+ onCloseComplete?: OnCloseCompleteHandler;
47
+ onOpenComplete?: OnOpenCompleteHandler;
48
+ onStackChange?: OnStackChangeHandler;
49
+ shouldCloseOnEscapePress?: boolean;
50
+ shouldCloseOnOverlayClick?: boolean;
51
+ shouldScrollInViewport?: boolean;
52
+ stackIndex?: number;
53
+ testId?: string;
54
+ width?: WidthNames | number | string;
55
+ }
56
+
57
+ // @public
58
+ export const ModalFooter: (props: ModalFooterProps) => jsx.JSX.Element;
59
+
60
+ // @public (undocumented)
61
+ export interface ModalFooterProps {
62
+ children?: ReactNode;
63
+ testId?: string;
64
+ }
65
+
66
+ // @public
67
+ export const ModalHeader: (props: ModalHeaderProps) => jsx.JSX.Element;
68
+
69
+ // @public (undocumented)
70
+ export interface ModalHeaderProps {
71
+ children?: React_2.ReactNode;
72
+ testId?: string;
73
+ }
74
+
75
+ // @public
76
+ export const ModalTitle: (props: ModalTitleProps) => jsx.JSX.Element;
77
+
78
+ // @public (undocumented)
79
+ export interface ModalTitleProps {
80
+ appearance?: Appearance;
81
+ children?: ReactNode;
82
+ isMultiline?: boolean;
83
+ testId?: string;
84
+ }
85
+
86
+ // @public
87
+ export const ModalTransition: (props: Pick<ExitingPersistenceProps, 'children'>) => JSX.Element;
88
+
89
+ // @public
90
+ const ModalWrapper: (props: ModalDialogProps) => jsx.JSX.Element;
91
+ export default ModalWrapper;
92
+
93
+ // @public (undocumented)
94
+ export type OnCloseCompleteHandler = (element: HTMLElement) => void;
95
+
96
+ // @public (undocumented)
97
+ export type OnCloseHandler = (e: KeyboardOrMouseEvent, analyticEvent: UIAnalyticsEvent) => void;
98
+
99
+ // @public (undocumented)
100
+ export type OnOpenCompleteHandler = (node: HTMLElement, isAppearing: boolean) => void;
101
+
102
+ // @public (undocumented)
103
+ export type OnStackChangeHandler = (stackIndex: number) => void;
104
+
105
+ // @public (undocumented)
106
+ export const useModal: () => ModalAttributes;
107
+
108
+ // @public (undocumented)
109
+ type WidthNames = 'large' | 'medium' | 'small' | 'x-large';
110
+
111
+ // (No @packageDocumentation comment for this package)
112
+
113
+ ```