@atlaskit/modal-dialog 12.6.7 → 12.6.9

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,18 @@
1
1
  # @atlaskit/modal-dialog
2
2
 
3
+ ## 12.6.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [`c8d28bd7519`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c8d28bd7519) - Adds role of region to modal dialog body when scrollable
8
+
9
+ ## 12.6.8
10
+
11
+ ### Patch Changes
12
+
13
+ - [`d6f63fa1abc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d6f63fa1abc) - Adds support for surface detection when using design tokens. Enabling children to be styled with the Modal’s surface color when using the `utility.elevation.surface.current` design token.
14
+ - Updated dependencies
15
+
3
16
  ## 12.6.7
4
17
 
5
18
  ### Patch Changes
@@ -18,6 +18,7 @@ var _focusRing = _interopRequireDefault(require("@atlaskit/focus-ring"));
18
18
  var _fadeIn = _interopRequireDefault(require("@atlaskit/motion/fade-in"));
19
19
  var _primitives = require("@atlaskit/primitives");
20
20
  var _colors = require("@atlaskit/theme/colors");
21
+ var _tokens = require("@atlaskit/tokens");
21
22
  var _constants = require("../constants");
22
23
  var _context = require("../context");
23
24
  var _useOnMotionFinish3 = _interopRequireDefault(require("../hooks/use-on-motion-finish"));
@@ -36,9 +37,8 @@ var dialogStyles = (0, _react2.css)((_css = {
36
37
  flex: '0 1 auto',
37
38
  flexDirection: 'column',
38
39
  backgroundColor: "var(--ds-surface-overlay, ".concat(_colors.N0, ")"),
39
- color: _constants.textColor,
40
- pointerEvents: 'auto'
41
- }, (0, _defineProperty2.default)(_css, _primitives.media.above.xs, {
40
+ color: _constants.textColor
41
+ }, (0, _defineProperty2.default)(_css, _tokens.CURRENT_SURFACE_CSS_VAR, "var(--ds-surface-overlay, ".concat(_colors.N0, ")")), (0, _defineProperty2.default)(_css, "pointerEvents", 'auto'), (0, _defineProperty2.default)(_css, _primitives.media.above.xs, {
42
42
  width: 'var(--modal-dialog-width)',
43
43
  maxWidth: 'inherit',
44
44
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
@@ -109,8 +109,10 @@ var ScrollContainer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
109
109
  return (0, _react2.jsx)(_focusRing.default, {
110
110
  isInset: true
111
111
  }, (0, _react2.jsx)("div", {
112
+ // tabindex is allowed here so that keyboard users can scroll content
112
113
  // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
113
114
  tabIndex: showContentFocus ? 0 : undefined,
115
+ role: showContentFocus ? 'region' : undefined,
114
116
  "aria-label": showContentFocus ? 'Scrollable content' : undefined,
115
117
  "data-testid": testId && "".concat(testId, "--scrollable"),
116
118
  ref: (0, _mergeRefs.default)([ref, scrollableRef]),
@@ -84,7 +84,7 @@ var ModalWrapper = function ModalWrapper(props) {
84
84
  action: 'closed',
85
85
  componentName: 'modalDialog',
86
86
  packageName: "@atlaskit/modal-dialog",
87
- packageVersion: "12.6.7"
87
+ packageVersion: "12.6.9"
88
88
  });
89
89
  var onBlanketClicked = (0, _react.useCallback)(function (e) {
90
90
  if (shouldCloseOnOverlayClick) {
@@ -9,6 +9,7 @@ import FocusRing from '@atlaskit/focus-ring';
9
9
  import FadeIn from '@atlaskit/motion/fade-in';
10
10
  import { media } from '@atlaskit/primitives';
11
11
  import { N0, N30A, N60A } from '@atlaskit/theme/colors';
12
+ import { CURRENT_SURFACE_CSS_VAR } from '@atlaskit/tokens';
12
13
  import { borderRadius, textColor } from '../constants';
13
14
  import { ModalContext, ScrollContext } from '../context';
14
15
  import useOnMotionFinish from '../hooks/use-on-motion-finish';
@@ -26,6 +27,7 @@ const dialogStyles = css({
26
27
  flexDirection: 'column',
27
28
  backgroundColor: `var(--ds-surface-overlay, ${N0})`,
28
29
  color: textColor,
30
+ [CURRENT_SURFACE_CSS_VAR]: `var(--ds-surface-overlay, ${N0})`,
29
31
  pointerEvents: 'auto',
30
32
  [media.above.xs]: {
31
33
  width: 'var(--modal-dialog-width)',
@@ -88,8 +88,10 @@ const ScrollContainer = /*#__PURE__*/forwardRef((props, ref) => {
88
88
  return jsx(FocusRing, {
89
89
  isInset: true
90
90
  }, jsx("div", {
91
+ // tabindex is allowed here so that keyboard users can scroll content
91
92
  // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
92
93
  tabIndex: showContentFocus ? 0 : undefined,
94
+ role: showContentFocus ? 'region' : undefined,
93
95
  "aria-label": showContentFocus ? 'Scrollable content' : undefined,
94
96
  "data-testid": testId && `${testId}--scrollable`,
95
97
  ref: mergeRefs([ref, scrollableRef]),
@@ -70,7 +70,7 @@ const ModalWrapper = props => {
70
70
  action: 'closed',
71
71
  componentName: 'modalDialog',
72
72
  packageName: "@atlaskit/modal-dialog",
73
- packageVersion: "12.6.7"
73
+ packageVersion: "12.6.9"
74
74
  });
75
75
  const onBlanketClicked = useCallback(e => {
76
76
  if (shouldCloseOnOverlayClick) {
@@ -13,6 +13,7 @@ import FocusRing from '@atlaskit/focus-ring';
13
13
  import FadeIn from '@atlaskit/motion/fade-in';
14
14
  import { media } from '@atlaskit/primitives';
15
15
  import { N0, N30A, N60A } from '@atlaskit/theme/colors';
16
+ import { CURRENT_SURFACE_CSS_VAR } from '@atlaskit/tokens';
16
17
  import { borderRadius, textColor } from '../constants';
17
18
  import { ModalContext, ScrollContext } from '../context';
18
19
  import useOnMotionFinish from '../hooks/use-on-motion-finish';
@@ -29,9 +30,8 @@ var dialogStyles = css((_css = {
29
30
  flex: '0 1 auto',
30
31
  flexDirection: 'column',
31
32
  backgroundColor: "var(--ds-surface-overlay, ".concat(N0, ")"),
32
- color: textColor,
33
- pointerEvents: 'auto'
34
- }, _defineProperty(_css, media.above.xs, {
33
+ color: textColor
34
+ }, _defineProperty(_css, CURRENT_SURFACE_CSS_VAR, "var(--ds-surface-overlay, ".concat(N0, ")")), _defineProperty(_css, "pointerEvents", 'auto'), _defineProperty(_css, media.above.xs, {
35
35
  width: 'var(--modal-dialog-width)',
36
36
  maxWidth: 'inherit',
37
37
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
@@ -99,8 +99,10 @@ var ScrollContainer = /*#__PURE__*/forwardRef(function (props, ref) {
99
99
  return jsx(FocusRing, {
100
100
  isInset: true
101
101
  }, jsx("div", {
102
+ // tabindex is allowed here so that keyboard users can scroll content
102
103
  // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
103
104
  tabIndex: showContentFocus ? 0 : undefined,
105
+ role: showContentFocus ? 'region' : undefined,
104
106
  "aria-label": showContentFocus ? 'Scrollable content' : undefined,
105
107
  "data-testid": testId && "".concat(testId, "--scrollable"),
106
108
  ref: mergeRefs([ref, scrollableRef]),
@@ -74,7 +74,7 @@ var ModalWrapper = function ModalWrapper(props) {
74
74
  action: 'closed',
75
75
  componentName: 'modalDialog',
76
76
  packageName: "@atlaskit/modal-dialog",
77
- packageVersion: "12.6.7"
77
+ packageVersion: "12.6.9"
78
78
  });
79
79
  var onBlanketClicked = useCallback(function (e) {
80
80
  if (shouldCloseOnOverlayClick) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/modal-dialog",
3
- "version": "12.6.7",
3
+ "version": "12.6.9",
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/"
@@ -36,7 +36,7 @@
36
36
  "@atlaskit/portal": "^4.3.0",
37
37
  "@atlaskit/primitives": "^1.2.0",
38
38
  "@atlaskit/theme": "^12.5.0",
39
- "@atlaskit/tokens": "^1.15.0",
39
+ "@atlaskit/tokens": "^1.17.0",
40
40
  "@babel/runtime": "^7.0.0",
41
41
  "@emotion/react": "^11.7.1",
42
42
  "bind-event-listener": "^2.1.1",
@@ -50,6 +50,7 @@
50
50
  },
51
51
  "devDependencies": {
52
52
  "@af/accessibility-testing": "*",
53
+ "@af/integration-testing": "*",
53
54
  "@af/visual-regression": "*",
54
55
  "@atlaskit/button": "*",
55
56
  "@atlaskit/ssr": "*",