@atlaskit/modal-dialog 12.0.2 → 12.2.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 +35 -0
- package/dist/cjs/internal/components/modal-dialog.js +6 -4
- package/dist/cjs/internal/constants.js +5 -7
- package/dist/cjs/modal-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/internal/components/modal-dialog.js +5 -4
- package/dist/es2019/internal/constants.js +5 -6
- package/dist/es2019/modal-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/internal/components/modal-dialog.js +5 -4
- package/dist/esm/internal/constants.js +5 -6
- package/dist/esm/modal-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/internal/constants.d.ts +3 -5
- package/package.json +9 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# @atlaskit/modal-dialog
|
|
2
2
|
|
|
3
|
+
## 12.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`2d60dd3116d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2d60dd3116d) - [ux] Modal dialogs which contain no focusable children will now lock focus to the modal container. The container will have a focus ring, so some VR tests may need to be regenerated.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [`3fced6aa641`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3fced6aa641) - Bumped `react-focus-lock` to version `^2.2.1`.
|
|
12
|
+
- [`a8c55e479e8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a8c55e479e8) - Removes unused dependency on emotion-styled
|
|
13
|
+
- [`f460cc7c411`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f460cc7c411) - Builds for this package now pass through a tokens babel plugin, removing runtime invocations of the tokens() function and improving bundle size.
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
16
|
+
## 12.1.1
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [`2b2290121eb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2b2290121eb) - Raised the minimum version carat range of focus ring to latest.
|
|
21
|
+
|
|
22
|
+
## 12.1.0
|
|
23
|
+
|
|
24
|
+
### Minor Changes
|
|
25
|
+
|
|
26
|
+
- [`993eb469fcb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/993eb469fcb) - Instrumented `@atlaskit/modal-dialog` with the new theming package, `@atlaskit/tokens`. Tokens will be visible only in applications configured to use the new Tokens API (currently in alpha).These changes are intended to be interoperable with the legacy theme implementation. Legacy dark mode users should expect no visual or breaking changes.
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- Updated dependencies
|
|
31
|
+
|
|
32
|
+
## 12.0.3
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- Updated dependencies
|
|
37
|
+
|
|
3
38
|
## 12.0.2
|
|
4
39
|
|
|
5
40
|
### Patch Changes
|
|
@@ -23,6 +23,8 @@ var _mergeRefs = _interopRequireDefault(require("@atlaskit/ds-lib/merge-refs"));
|
|
|
23
23
|
|
|
24
24
|
var _useAutoFocus = _interopRequireDefault(require("@atlaskit/ds-lib/use-auto-focus"));
|
|
25
25
|
|
|
26
|
+
var _focusRing = _interopRequireDefault(require("@atlaskit/focus-ring"));
|
|
27
|
+
|
|
26
28
|
var _fadeIn = _interopRequireDefault(require("@atlaskit/motion/fade-in"));
|
|
27
29
|
|
|
28
30
|
var _colors = require("@atlaskit/theme/colors");
|
|
@@ -47,7 +49,7 @@ var dialogStyles = (0, _core.css)({
|
|
|
47
49
|
maxHeight: '100vh',
|
|
48
50
|
flex: '1 1 auto',
|
|
49
51
|
flexDirection: 'column',
|
|
50
|
-
backgroundColor: _colors.N0,
|
|
52
|
+
backgroundColor: "var(--ds-background-overlay, ".concat(_colors.N0, ")"),
|
|
51
53
|
color: _constants.textColor,
|
|
52
54
|
pointerEvents: 'auto',
|
|
53
55
|
'@media (min-width: 480px)': {
|
|
@@ -56,7 +58,7 @@ var dialogStyles = (0, _core.css)({
|
|
|
56
58
|
marginRight: 'inherit',
|
|
57
59
|
marginLeft: 'inherit',
|
|
58
60
|
borderRadius: _constants.borderRadius,
|
|
59
|
-
boxShadow: "0 0 0 1px ".concat(_colors.N30A, ", 0 2px 1px ").concat(_colors.N30A, ", 0 0 20px -6px ").concat(_colors.N60A)
|
|
61
|
+
boxShadow: "var(--ds-overlay, ".concat("0 0 0 1px ".concat(_colors.N30A, ", 0 2px 1px ").concat(_colors.N30A, ", 0 0 20px -6px ").concat(_colors.N60A), ")")
|
|
60
62
|
},
|
|
61
63
|
|
|
62
64
|
/**
|
|
@@ -134,7 +136,7 @@ var ModalDialog = function ModalDialog(props) {
|
|
|
134
136
|
entranceDirection: "bottom",
|
|
135
137
|
onFinish: onMotionFinish
|
|
136
138
|
}, function (bottomFadeInProps) {
|
|
137
|
-
return (0, _core.jsx)("section", (0, _extends2.default)({}, bottomFadeInProps, {
|
|
139
|
+
return (0, _core.jsx)(_focusRing.default, null, (0, _core.jsx)("section", (0, _extends2.default)({}, bottomFadeInProps, {
|
|
138
140
|
ref: (0, _mergeRefs.default)([bottomFadeInProps.ref, motionRef]),
|
|
139
141
|
style: {
|
|
140
142
|
'--modal-dialog-width': (0, _utils.dialogWidth)(width),
|
|
@@ -147,7 +149,7 @@ var ModalDialog = function ModalDialog(props) {
|
|
|
147
149
|
"data-modal-stack": stackIndex,
|
|
148
150
|
tabIndex: -1,
|
|
149
151
|
"aria-modal": true
|
|
150
|
-
}), children);
|
|
152
|
+
}), children));
|
|
151
153
|
}))));
|
|
152
154
|
};
|
|
153
155
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.iconColor = exports.
|
|
6
|
+
exports.iconColor = exports.textColor = exports.keylineColor = exports.keylineHeight = exports.titleIconMargin = exports.footerItemGap = exports.padding = exports.verticalOffset = exports.borderRadius = exports.gutter = exports.width = void 0;
|
|
7
7
|
|
|
8
8
|
var _colors = require("@atlaskit/theme/colors");
|
|
9
9
|
|
|
@@ -35,14 +35,12 @@ var titleIconMargin = gridSize;
|
|
|
35
35
|
exports.titleIconMargin = titleIconMargin;
|
|
36
36
|
var keylineHeight = 2;
|
|
37
37
|
exports.keylineHeight = keylineHeight;
|
|
38
|
-
var keylineColor = _colors.N30;
|
|
38
|
+
var keylineColor = "var(--ds-border-neutral, ".concat(_colors.N30, ")");
|
|
39
39
|
exports.keylineColor = keylineColor;
|
|
40
|
-
var textColor = (0, _colors.text)();
|
|
40
|
+
var textColor = "var(--ds-text-highEmphasis, ".concat((0, _colors.text)(), ")");
|
|
41
41
|
exports.textColor = textColor;
|
|
42
|
-
var focusOutlineColor = _colors.N800;
|
|
43
|
-
exports.focusOutlineColor = focusOutlineColor;
|
|
44
42
|
var iconColor = {
|
|
45
|
-
danger: _colors.R400,
|
|
46
|
-
warning: _colors.Y400
|
|
43
|
+
danger: "var(--ds-iconBorder-danger, ".concat(_colors.R400, ")"),
|
|
44
|
+
warning: "var(--ds-iconBorder-warning, ".concat(_colors.Y400, ")")
|
|
47
45
|
};
|
|
48
46
|
exports.iconColor = iconColor;
|
|
@@ -85,7 +85,7 @@ var ModalWrapper = function ModalWrapper(props) {
|
|
|
85
85
|
action: 'closed',
|
|
86
86
|
componentName: 'modalDialog',
|
|
87
87
|
packageName: "@atlaskit/modal-dialog",
|
|
88
|
-
packageVersion: "12.0
|
|
88
|
+
packageVersion: "12.2.0"
|
|
89
89
|
});
|
|
90
90
|
var onBlanketClicked = (0, _react.useCallback)(function (e) {
|
|
91
91
|
if (shouldCloseOnOverlayClick) {
|
package/dist/cjs/version.json
CHANGED
|
@@ -6,6 +6,7 @@ import { css, jsx } from '@emotion/core';
|
|
|
6
6
|
import { useUID } from 'react-uid';
|
|
7
7
|
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
8
8
|
import useAutoFocus from '@atlaskit/ds-lib/use-auto-focus';
|
|
9
|
+
import FocusRing from '@atlaskit/focus-ring';
|
|
9
10
|
import FadeIn from '@atlaskit/motion/fade-in';
|
|
10
11
|
import { N0, N30A, N60A } from '@atlaskit/theme/colors';
|
|
11
12
|
import { borderRadius, textColor } from '../constants';
|
|
@@ -22,7 +23,7 @@ const dialogStyles = css({
|
|
|
22
23
|
maxHeight: '100vh',
|
|
23
24
|
flex: '1 1 auto',
|
|
24
25
|
flexDirection: 'column',
|
|
25
|
-
backgroundColor: N0
|
|
26
|
+
backgroundColor: `var(--ds-background-overlay, ${N0})`,
|
|
26
27
|
color: textColor,
|
|
27
28
|
pointerEvents: 'auto',
|
|
28
29
|
'@media (min-width: 480px)': {
|
|
@@ -31,7 +32,7 @@ const dialogStyles = css({
|
|
|
31
32
|
marginRight: 'inherit',
|
|
32
33
|
marginLeft: 'inherit',
|
|
33
34
|
borderRadius,
|
|
34
|
-
boxShadow: `0 0 0 1px ${N30A}, 0 2px 1px ${N30A}, 0 0 20px -6px ${N60A}`
|
|
35
|
+
boxShadow: `var(--ds-overlay, ${`0 0 0 1px ${N30A}, 0 2px 1px ${N30A}, 0 0 20px -6px ${N60A}`})`
|
|
35
36
|
},
|
|
36
37
|
|
|
37
38
|
/**
|
|
@@ -101,7 +102,7 @@ const ModalDialog = props => {
|
|
|
101
102
|
}, jsx(FadeIn, {
|
|
102
103
|
entranceDirection: "bottom",
|
|
103
104
|
onFinish: onMotionFinish
|
|
104
|
-
}, bottomFadeInProps => jsx("section", _extends({}, bottomFadeInProps, {
|
|
105
|
+
}, bottomFadeInProps => jsx(FocusRing, null, jsx("section", _extends({}, bottomFadeInProps, {
|
|
105
106
|
ref: mergeRefs([bottomFadeInProps.ref, motionRef]),
|
|
106
107
|
style: {
|
|
107
108
|
'--modal-dialog-width': dialogWidth(width),
|
|
@@ -114,7 +115,7 @@ const ModalDialog = props => {
|
|
|
114
115
|
"data-modal-stack": stackIndex,
|
|
115
116
|
tabIndex: -1,
|
|
116
117
|
"aria-modal": true
|
|
117
|
-
}), children)))));
|
|
118
|
+
}), children))))));
|
|
118
119
|
};
|
|
119
120
|
|
|
120
121
|
export default ModalDialog;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { N30, R400, text, Y400 } from '@atlaskit/theme/colors';
|
|
2
2
|
import { borderRadius as getBorderRadius, gridSize as getGridSize } from '@atlaskit/theme/constants';
|
|
3
3
|
export const width = {
|
|
4
4
|
values: ['small', 'medium', 'large', 'x-large'],
|
|
@@ -18,10 +18,9 @@ export const padding = gridSize * 3;
|
|
|
18
18
|
export const footerItemGap = gridSize;
|
|
19
19
|
export const titleIconMargin = gridSize;
|
|
20
20
|
export const keylineHeight = 2;
|
|
21
|
-
export const keylineColor = N30
|
|
22
|
-
export const textColor =
|
|
23
|
-
export const focusOutlineColor = N800;
|
|
21
|
+
export const keylineColor = `var(--ds-border-neutral, ${N30})`;
|
|
22
|
+
export const textColor = `var(--ds-text-highEmphasis, ${text()})`;
|
|
24
23
|
export const iconColor = {
|
|
25
|
-
danger: R400
|
|
26
|
-
warning: Y400
|
|
24
|
+
danger: `var(--ds-iconBorder-danger, ${R400})`,
|
|
25
|
+
warning: `var(--ds-iconBorder-warning, ${Y400})`
|
|
27
26
|
};
|
|
@@ -50,7 +50,7 @@ const ModalWrapper = props => {
|
|
|
50
50
|
action: 'closed',
|
|
51
51
|
componentName: 'modalDialog',
|
|
52
52
|
packageName: "@atlaskit/modal-dialog",
|
|
53
|
-
packageVersion: "12.0
|
|
53
|
+
packageVersion: "12.2.0"
|
|
54
54
|
});
|
|
55
55
|
const onBlanketClicked = useCallback(e => {
|
|
56
56
|
if (shouldCloseOnOverlayClick) {
|
package/dist/es2019/version.json
CHANGED
|
@@ -8,6 +8,7 @@ import { css, jsx } from '@emotion/core';
|
|
|
8
8
|
import { useUID } from 'react-uid';
|
|
9
9
|
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
10
10
|
import useAutoFocus from '@atlaskit/ds-lib/use-auto-focus';
|
|
11
|
+
import FocusRing from '@atlaskit/focus-ring';
|
|
11
12
|
import FadeIn from '@atlaskit/motion/fade-in';
|
|
12
13
|
import { N0, N30A, N60A } from '@atlaskit/theme/colors';
|
|
13
14
|
import { borderRadius, textColor } from '../constants';
|
|
@@ -24,7 +25,7 @@ var dialogStyles = css({
|
|
|
24
25
|
maxHeight: '100vh',
|
|
25
26
|
flex: '1 1 auto',
|
|
26
27
|
flexDirection: 'column',
|
|
27
|
-
backgroundColor: N0,
|
|
28
|
+
backgroundColor: "var(--ds-background-overlay, ".concat(N0, ")"),
|
|
28
29
|
color: textColor,
|
|
29
30
|
pointerEvents: 'auto',
|
|
30
31
|
'@media (min-width: 480px)': {
|
|
@@ -33,7 +34,7 @@ var dialogStyles = css({
|
|
|
33
34
|
marginRight: 'inherit',
|
|
34
35
|
marginLeft: 'inherit',
|
|
35
36
|
borderRadius: borderRadius,
|
|
36
|
-
boxShadow: "0 0 0 1px ".concat(N30A, ", 0 2px 1px ").concat(N30A, ", 0 0 20px -6px ").concat(N60A)
|
|
37
|
+
boxShadow: "var(--ds-overlay, ".concat("0 0 0 1px ".concat(N30A, ", 0 2px 1px ").concat(N30A, ", 0 0 20px -6px ").concat(N60A), ")")
|
|
37
38
|
},
|
|
38
39
|
|
|
39
40
|
/**
|
|
@@ -111,7 +112,7 @@ var ModalDialog = function ModalDialog(props) {
|
|
|
111
112
|
entranceDirection: "bottom",
|
|
112
113
|
onFinish: onMotionFinish
|
|
113
114
|
}, function (bottomFadeInProps) {
|
|
114
|
-
return jsx("section", _extends({}, bottomFadeInProps, {
|
|
115
|
+
return jsx(FocusRing, null, jsx("section", _extends({}, bottomFadeInProps, {
|
|
115
116
|
ref: mergeRefs([bottomFadeInProps.ref, motionRef]),
|
|
116
117
|
style: {
|
|
117
118
|
'--modal-dialog-width': dialogWidth(width),
|
|
@@ -124,7 +125,7 @@ var ModalDialog = function ModalDialog(props) {
|
|
|
124
125
|
"data-modal-stack": stackIndex,
|
|
125
126
|
tabIndex: -1,
|
|
126
127
|
"aria-modal": true
|
|
127
|
-
}), children);
|
|
128
|
+
}), children));
|
|
128
129
|
}))));
|
|
129
130
|
};
|
|
130
131
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { N30, R400, text, Y400 } from '@atlaskit/theme/colors';
|
|
2
2
|
import { borderRadius as getBorderRadius, gridSize as getGridSize } from '@atlaskit/theme/constants';
|
|
3
3
|
export var width = {
|
|
4
4
|
values: ['small', 'medium', 'large', 'x-large'],
|
|
@@ -18,10 +18,9 @@ export var padding = gridSize * 3;
|
|
|
18
18
|
export var footerItemGap = gridSize;
|
|
19
19
|
export var titleIconMargin = gridSize;
|
|
20
20
|
export var keylineHeight = 2;
|
|
21
|
-
export var keylineColor = N30;
|
|
22
|
-
export var textColor =
|
|
23
|
-
export var focusOutlineColor = N800;
|
|
21
|
+
export var keylineColor = "var(--ds-border-neutral, ".concat(N30, ")");
|
|
22
|
+
export var textColor = "var(--ds-text-highEmphasis, ".concat(text(), ")");
|
|
24
23
|
export var iconColor = {
|
|
25
|
-
danger: R400,
|
|
26
|
-
warning: Y400
|
|
24
|
+
danger: "var(--ds-iconBorder-danger, ".concat(R400, ")"),
|
|
25
|
+
warning: "var(--ds-iconBorder-warning, ".concat(Y400, ")")
|
|
27
26
|
};
|
|
@@ -56,7 +56,7 @@ var ModalWrapper = function ModalWrapper(props) {
|
|
|
56
56
|
action: 'closed',
|
|
57
57
|
componentName: 'modalDialog',
|
|
58
58
|
packageName: "@atlaskit/modal-dialog",
|
|
59
|
-
packageVersion: "12.0
|
|
59
|
+
packageVersion: "12.2.0"
|
|
60
60
|
});
|
|
61
61
|
var onBlanketClicked = useCallback(function (e) {
|
|
62
62
|
if (shouldCloseOnOverlayClick) {
|
package/dist/esm/version.json
CHANGED
|
@@ -15,11 +15,9 @@ export declare const padding: number;
|
|
|
15
15
|
export declare const footerItemGap: number;
|
|
16
16
|
export declare const titleIconMargin: number;
|
|
17
17
|
export declare const keylineHeight = 2;
|
|
18
|
-
export declare const keylineColor
|
|
19
|
-
export declare const textColor:
|
|
20
|
-
export declare const
|
|
21
|
-
declare type IconColor = {
|
|
18
|
+
export declare const keylineColor: "var(--ds-border-neutral)";
|
|
19
|
+
export declare const textColor: "var(--ds-text-highEmphasis)";
|
|
20
|
+
export declare const iconColor: {
|
|
22
21
|
[key in Appearance]: string;
|
|
23
22
|
};
|
|
24
|
-
export declare const iconColor: IconColor;
|
|
25
23
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/modal-dialog",
|
|
3
|
-
"version": "12.0
|
|
3
|
+
"version": "12.2.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/"
|
|
@@ -41,15 +41,16 @@
|
|
|
41
41
|
"@atlaskit/blanket": "^12.2.0",
|
|
42
42
|
"@atlaskit/codemod-utils": "^3.4.0",
|
|
43
43
|
"@atlaskit/ds-lib": "^1.3.0",
|
|
44
|
-
"@atlaskit/focus-ring": "0.2.
|
|
44
|
+
"@atlaskit/focus-ring": "^0.2.4",
|
|
45
45
|
"@atlaskit/icon": "^21.9.0",
|
|
46
46
|
"@atlaskit/motion": "^1.0.0",
|
|
47
47
|
"@atlaskit/portal": "^4.1.0",
|
|
48
48
|
"@atlaskit/theme": "^12.0.0",
|
|
49
|
+
"@atlaskit/tokens": "^0.4.0",
|
|
49
50
|
"@babel/runtime": "^7.0.0",
|
|
50
51
|
"@emotion/core": "^10.0.9",
|
|
51
52
|
"raf-schd": "^2.1.0",
|
|
52
|
-
"react-focus-lock": "^
|
|
53
|
+
"react-focus-lock": "^2.5.2",
|
|
53
54
|
"react-scrolllock": "^5.0.1",
|
|
54
55
|
"react-uid": "^2.2.0"
|
|
55
56
|
},
|
|
@@ -103,9 +104,12 @@
|
|
|
103
104
|
"@repo/internal": {
|
|
104
105
|
"ui-components": "lite-mode",
|
|
105
106
|
"analytics": "analytics-next",
|
|
106
|
-
"theming": "
|
|
107
|
+
"theming": "tokens",
|
|
107
108
|
"deprecation": "no-deprecated-imports",
|
|
108
|
-
"styling":
|
|
109
|
+
"styling": [
|
|
110
|
+
"static",
|
|
111
|
+
"emotion"
|
|
112
|
+
]
|
|
109
113
|
}
|
|
110
114
|
},
|
|
111
115
|
"homepage": "https://atlassian.design/components/modal-dialog/",
|