@atlaskit/modal-dialog 13.2.0 → 13.4.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,23 @@
1
1
  # @atlaskit/modal-dialog
2
2
 
3
+ ## 13.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#129320](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/129320)
8
+ [`1993bb92c16b6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1993bb92c16b6) -
9
+ [ux] Add legacy AUI modal to focus lock allowlist by default
10
+
11
+ ## 13.3.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#129312](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/129312)
16
+ [`26ac9f1e06b2e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/26ac9f1e06b2e) -
17
+ Modal body now explicitly sets the font style to use typography tokens, instead of relying on the
18
+ CSS reset to be present. This change is behind the feature flag
19
+ `platform_ads_explicit_font_styles`.
20
+
3
21
  ## 13.2.0
4
22
 
5
23
  ### Minor Changes
@@ -8,6 +8,7 @@ exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _react2 = require("@emotion/react");
10
10
  var _reactScrolllock = require("react-scrolllock");
11
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
12
  var _hooks = require("./hooks");
12
13
  var _scrollContainer = _interopRequireDefault(require("./internal/components/scroll-container"));
13
14
  var _useScroll = _interopRequireDefault(require("./internal/hooks/use-scroll"));
@@ -22,6 +23,9 @@ var bodyStyles = (0, _react2.css)({
22
23
  /* This ensures the body fills the whole space between header and footer. */
23
24
  flex: '1 1 auto'
24
25
  });
26
+ var fontStyles = (0, _react2.css)({
27
+ font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)"
28
+ });
25
29
 
26
30
  /**
27
31
  * Adding the padding here avoids cropping the keyline on its sides.
@@ -57,12 +61,12 @@ var ModalBody = function ModalBody(props) {
57
61
  var shouldScrollInViewport = (0, _useScroll.default)();
58
62
  var testId = userDefinedTestId || modalTestId && "".concat(modalTestId, "--body");
59
63
  return shouldScrollInViewport ? (0, _react2.jsx)("div", {
60
- css: [bodyStyles, viewportScrollStyles],
64
+ css: [bodyStyles, viewportScrollStyles, (0, _platformFeatureFlags.fg)('platform_ads_explicit_font_styles') && fontStyles],
61
65
  "data-testid": testId
62
66
  }, children) : (0, _react2.jsx)(_reactScrolllock.TouchScrollable, null, (0, _react2.jsx)(_scrollContainer.default, {
63
67
  testId: userDefinedTestId || modalTestId
64
68
  }, (0, _react2.jsx)("div", {
65
- css: [bodyStyles, bodyScrollStyles],
69
+ css: [bodyStyles, bodyScrollStyles, (0, _platformFeatureFlags.fg)('platform_ads_explicit_font_styles') && fontStyles],
66
70
  "data-testid": testId
67
71
  }, children)));
68
72
  };
@@ -16,7 +16,6 @@ var _blanket = _interopRequireDefault(require("@atlaskit/blanket"));
16
16
  var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
17
17
  var _layering = require("@atlaskit/layering");
18
18
  var _fadeIn = _interopRequireDefault(require("@atlaskit/motion/fade-in"));
19
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
20
19
  var _portal = _interopRequireDefault(require("@atlaskit/portal"));
21
20
  var _constants = require("@atlaskit/theme/constants");
22
21
  var _modalDialog = _interopRequireDefault(require("./internal/components/modal-dialog"));
@@ -41,11 +40,9 @@ var fillScreenStyles = (0, _react2.css)({
41
40
  WebkitOverflowScrolling: 'touch'
42
41
  });
43
42
  var allowlistElements = function allowlistElements(element, callback) {
44
- var isAuiDialogAllowlisted = (0, _platformFeatureFlags.fg)('platform_dst_allowlist-aui-dialog-for-ak-modal');
45
43
  // Allow focus to reach elements outside the modal:
46
-
47
44
  // if AUI dialog is allowListed and visible
48
- if (isAuiDialogAllowlisted && !!document.querySelector('.aui-blanket:not([hidden])')) {
45
+ if (!!document.querySelector('.aui-blanket:not([hidden])')) {
49
46
  return false;
50
47
  }
51
48
  // allows to pass a callback function to allow elements be ignored by focus lock
@@ -102,7 +99,7 @@ var ModalWrapper = function ModalWrapper(props) {
102
99
  action: 'closed',
103
100
  componentName: 'modalDialog',
104
101
  packageName: "@atlaskit/modal-dialog",
105
- packageVersion: "13.2.0"
102
+ packageVersion: "13.4.0"
106
103
  });
107
104
  var onBlanketClicked = (0, _react.useCallback)(function (e) {
108
105
  if (shouldCloseOnOverlayClick) {
@@ -8,6 +8,7 @@ import React from 'react';
8
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
9
  import { css, jsx } from '@emotion/react';
10
10
  import { TouchScrollable } from 'react-scrolllock';
11
+ import { fg } from '@atlaskit/platform-feature-flags';
11
12
  import { useModal } from './hooks';
12
13
  import ScrollContainer from './internal/components/scroll-container';
13
14
  import useScroll from './internal/hooks/use-scroll';
@@ -15,6 +16,9 @@ const bodyStyles = css({
15
16
  /* This ensures the body fills the whole space between header and footer. */
16
17
  flex: '1 1 auto'
17
18
  });
19
+ const fontStyles = css({
20
+ font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)"
21
+ });
18
22
 
19
23
  /**
20
24
  * Adding the padding here avoids cropping the keyline on its sides.
@@ -53,12 +57,12 @@ const ModalBody = props => {
53
57
  const shouldScrollInViewport = useScroll();
54
58
  const testId = userDefinedTestId || modalTestId && `${modalTestId}--body`;
55
59
  return shouldScrollInViewport ? jsx("div", {
56
- css: [bodyStyles, viewportScrollStyles],
60
+ css: [bodyStyles, viewportScrollStyles, fg('platform_ads_explicit_font_styles') && fontStyles],
57
61
  "data-testid": testId
58
62
  }, children) : jsx(TouchScrollable, null, jsx(ScrollContainer, {
59
63
  testId: userDefinedTestId || modalTestId
60
64
  }, jsx("div", {
61
- css: [bodyStyles, bodyScrollStyles],
65
+ css: [bodyStyles, bodyScrollStyles, fg('platform_ads_explicit_font_styles') && fontStyles],
62
66
  "data-testid": testId
63
67
  }, children)));
64
68
  };
@@ -15,7 +15,6 @@ import Blanket from '@atlaskit/blanket';
15
15
  import noop from '@atlaskit/ds-lib/noop';
16
16
  import { Layering } from '@atlaskit/layering';
17
17
  import FadeIn from '@atlaskit/motion/fade-in';
18
- import { fg } from '@atlaskit/platform-feature-flags';
19
18
  import Portal from '@atlaskit/portal';
20
19
  import { layers } from '@atlaskit/theme/constants';
21
20
  import ModalDialog from './internal/components/modal-dialog';
@@ -31,11 +30,9 @@ const fillScreenStyles = css({
31
30
  WebkitOverflowScrolling: 'touch'
32
31
  });
33
32
  const allowlistElements = (element, callback) => {
34
- const isAuiDialogAllowlisted = fg('platform_dst_allowlist-aui-dialog-for-ak-modal');
35
33
  // Allow focus to reach elements outside the modal:
36
-
37
34
  // if AUI dialog is allowListed and visible
38
- if (isAuiDialogAllowlisted && !!document.querySelector('.aui-blanket:not([hidden])')) {
35
+ if (!!document.querySelector('.aui-blanket:not([hidden])')) {
39
36
  return false;
40
37
  }
41
38
  // allows to pass a callback function to allow elements be ignored by focus lock
@@ -88,7 +85,7 @@ const ModalWrapper = props => {
88
85
  action: 'closed',
89
86
  componentName: 'modalDialog',
90
87
  packageName: "@atlaskit/modal-dialog",
91
- packageVersion: "13.2.0"
88
+ packageVersion: "13.4.0"
92
89
  });
93
90
  const onBlanketClicked = useCallback(e => {
94
91
  if (shouldCloseOnOverlayClick) {
@@ -8,6 +8,7 @@ import React from 'react';
8
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
9
  import { css, jsx } from '@emotion/react';
10
10
  import { TouchScrollable } from 'react-scrolllock';
11
+ import { fg } from '@atlaskit/platform-feature-flags';
11
12
  import { useModal } from './hooks';
12
13
  import ScrollContainer from './internal/components/scroll-container';
13
14
  import useScroll from './internal/hooks/use-scroll';
@@ -15,6 +16,9 @@ var bodyStyles = css({
15
16
  /* This ensures the body fills the whole space between header and footer. */
16
17
  flex: '1 1 auto'
17
18
  });
19
+ var fontStyles = css({
20
+ font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)"
21
+ });
18
22
 
19
23
  /**
20
24
  * Adding the padding here avoids cropping the keyline on its sides.
@@ -50,12 +54,12 @@ var ModalBody = function ModalBody(props) {
50
54
  var shouldScrollInViewport = useScroll();
51
55
  var testId = userDefinedTestId || modalTestId && "".concat(modalTestId, "--body");
52
56
  return shouldScrollInViewport ? jsx("div", {
53
- css: [bodyStyles, viewportScrollStyles],
57
+ css: [bodyStyles, viewportScrollStyles, fg('platform_ads_explicit_font_styles') && fontStyles],
54
58
  "data-testid": testId
55
59
  }, children) : jsx(TouchScrollable, null, jsx(ScrollContainer, {
56
60
  testId: userDefinedTestId || modalTestId
57
61
  }, jsx("div", {
58
- css: [bodyStyles, bodyScrollStyles],
62
+ css: [bodyStyles, bodyScrollStyles, fg('platform_ads_explicit_font_styles') && fontStyles],
59
63
  "data-testid": testId
60
64
  }, children)));
61
65
  };
@@ -15,7 +15,6 @@ import Blanket from '@atlaskit/blanket';
15
15
  import noop from '@atlaskit/ds-lib/noop';
16
16
  import { Layering } from '@atlaskit/layering';
17
17
  import FadeIn from '@atlaskit/motion/fade-in';
18
- import { fg } from '@atlaskit/platform-feature-flags';
19
18
  import Portal from '@atlaskit/portal';
20
19
  import { layers } from '@atlaskit/theme/constants';
21
20
  import ModalDialog from './internal/components/modal-dialog';
@@ -31,11 +30,9 @@ var fillScreenStyles = css({
31
30
  WebkitOverflowScrolling: 'touch'
32
31
  });
33
32
  var allowlistElements = function allowlistElements(element, callback) {
34
- var isAuiDialogAllowlisted = fg('platform_dst_allowlist-aui-dialog-for-ak-modal');
35
33
  // Allow focus to reach elements outside the modal:
36
-
37
34
  // if AUI dialog is allowListed and visible
38
- if (isAuiDialogAllowlisted && !!document.querySelector('.aui-blanket:not([hidden])')) {
35
+ if (!!document.querySelector('.aui-blanket:not([hidden])')) {
39
36
  return false;
40
37
  }
41
38
  // allows to pass a callback function to allow elements be ignored by focus lock
@@ -92,7 +89,7 @@ var ModalWrapper = function ModalWrapper(props) {
92
89
  action: 'closed',
93
90
  componentName: 'modalDialog',
94
91
  packageName: "@atlaskit/modal-dialog",
95
- packageVersion: "13.2.0"
92
+ packageVersion: "13.4.0"
96
93
  });
97
94
  var onBlanketClicked = useCallback(function (e) {
98
95
  if (shouldCloseOnOverlayClick) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/modal-dialog",
3
- "version": "13.2.0",
3
+ "version": "13.4.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/"
@@ -40,7 +40,7 @@
40
40
  "@atlaskit/platform-feature-flags": "^1.1.0",
41
41
  "@atlaskit/portal": "^5.1.0",
42
42
  "@atlaskit/pragmatic-drag-and-drop": "^1.5.0",
43
- "@atlaskit/primitives": "^14.1.0",
43
+ "@atlaskit/primitives": "^14.2.0",
44
44
  "@atlaskit/theme": "^18.0.0",
45
45
  "@atlaskit/tokens": "^4.5.0",
46
46
  "@babel/runtime": "^7.0.0",
@@ -138,15 +138,15 @@
138
138
  "type": "boolean",
139
139
  "referenceOnly": true
140
140
  },
141
- "platform_dst_allowlist-aui-dialog-for-ak-modal": {
142
- "type": "boolean"
143
- },
144
141
  "platform_modal-dialog-heading-icon-a11y-fix": {
145
142
  "type": "boolean"
146
143
  },
147
144
  "platform_design_system_motion_on_finish_fix": {
148
145
  "type": "boolean",
149
146
  "referenceOnly": "true"
147
+ },
148
+ "platform_ads_explicit_font_styles": {
149
+ "type": "boolean"
150
150
  }
151
151
  },
152
152
  "homepage": "https://atlassian.design/components/modal-dialog/"