@atlaskit/popup 6.3.0 → 6.3.2
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 +18 -0
- package/dist/cjs/popper-wrapper.compiled.css +0 -1
- package/dist/cjs/popper-wrapper.js +2 -3
- package/dist/cjs/use-focus-manager.js +7 -0
- package/dist/es2019/popper-wrapper.compiled.css +0 -1
- package/dist/es2019/popper-wrapper.js +2 -3
- package/dist/es2019/use-focus-manager.js +7 -0
- package/dist/esm/popper-wrapper.compiled.css +0 -1
- package/dist/esm/popper-wrapper.js +2 -3
- package/dist/esm/use-focus-manager.js +7 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/popup
|
|
2
2
|
|
|
3
|
+
## 6.3.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`261fd53b131ba`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/261fd53b131ba) -
|
|
8
|
+
Cleaned up new shape theme styles, making new border and radius values the default.
|
|
9
|
+
|
|
10
|
+
## 6.3.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`1c9e0caa93d4c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1c9e0caa93d4c) -
|
|
15
|
+
Behind platform_dst-popup-trigger-initial-focus-ref: when the popup's focus trap deactivates and
|
|
16
|
+
shouldReturnFocus is true, an animation-frame callback now rescues focus back to the trigger
|
|
17
|
+
element if the browser silently dropped focus to document.body instead of returning it to the
|
|
18
|
+
trigger.
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 6.3.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
._1r04idpf{inset:0}
|
|
2
|
-
._2rko12b0{border-radius:var(--ds-radius-small,4px)}
|
|
3
2
|
._2rko1mok{border-radius:var(--ds-radius-large,8px)}
|
|
4
3
|
._dk5d1b66{inset-inline:var(--ds-space-050,4px)}._152t1b66{inset-block-start:var(--ds-space-050,4px)}
|
|
5
4
|
._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
|
|
@@ -30,8 +30,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
30
30
|
var LOCAL_CURRENT_SURFACE_CSS_VAR = '--ds-elevation-surface-current';
|
|
31
31
|
var fullWidthStyles = null;
|
|
32
32
|
var wrapperStyles = {
|
|
33
|
-
root: "
|
|
34
|
-
rootT26Shape: "_2rko1mok",
|
|
33
|
+
root: "_2rko1mok _1e0c1ule _vchhusvi _1pby1nn1 _bfhk1bhr _16qs130s _syazi7uo _1q1l1bhr _nt751r31 _49pcglyw _1hvw1o36",
|
|
35
34
|
fullWidth: "_1bsb1osq",
|
|
36
35
|
motion: "_c71l1kw7 _1e0c1txw"
|
|
37
36
|
};
|
|
@@ -102,7 +101,7 @@ var DefaultPopupComponent = /*#__PURE__*/(0, _react.forwardRef)(function (props,
|
|
|
102
101
|
htmlAttributes = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
103
102
|
return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
|
|
104
103
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
105
|
-
className: (0, _runtime.ax)([wrapperStyles.root,
|
|
104
|
+
className: (0, _runtime.ax)([wrapperStyles.root, appearance === 'UNSAFE_modal-below-sm' && "_dk5d1b66 _c71l1ei0 _kqsw1n9t _152t1b66", (!shouldRenderToParent || shouldFitViewport) && "_1reo1wug _18m91wug", shouldFitContainer && "_1bsb1osq", className])
|
|
106
105
|
}, htmlAttributes, {
|
|
107
106
|
ref: !(0, _fg.fg)('platform-dst-motion-uplift-popup') ? ref : undefined
|
|
108
107
|
}), children);
|
|
@@ -61,6 +61,13 @@ var useFocusManager = exports.useFocusManager = function useFocusManager(_ref) {
|
|
|
61
61
|
return function () {
|
|
62
62
|
cancelAllFrames();
|
|
63
63
|
focusTrap.deactivate();
|
|
64
|
+
if ((0, _fg.fg)('platform_dst-popup-trigger-initial-focus-ref') && shouldReturnFocus) {
|
|
65
|
+
requestFrame(function () {
|
|
66
|
+
if (triggerRef !== null && triggerRef !== void 0 && triggerRef.isConnected && (document.activeElement === document.body || document.activeElement === document.documentElement || !document.activeElement)) {
|
|
67
|
+
triggerRef.focus();
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
64
71
|
};
|
|
65
72
|
}, [popupRef, triggerRef, autoFocus, initialFocusRef, shouldCloseOnTab, shouldDisableFocusTrap, requestFrame, cancelAllFrames, shouldReturnFocus, shouldRenderToParent, currentLevel]);
|
|
66
73
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
._1r04idpf{inset:0}
|
|
2
|
-
._2rko12b0{border-radius:var(--ds-radius-small,4px)}
|
|
3
2
|
._2rko1mok{border-radius:var(--ds-radius-large,8px)}
|
|
4
3
|
._dk5d1b66{inset-inline:var(--ds-space-050,4px)}._152t1b66{inset-block-start:var(--ds-space-050,4px)}
|
|
5
4
|
._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
|
|
@@ -14,8 +14,7 @@ import { useFocusManager } from './use-focus-manager';
|
|
|
14
14
|
const LOCAL_CURRENT_SURFACE_CSS_VAR = '--ds-elevation-surface-current';
|
|
15
15
|
const fullWidthStyles = null;
|
|
16
16
|
const wrapperStyles = {
|
|
17
|
-
root: "
|
|
18
|
-
rootT26Shape: "_2rko1mok",
|
|
17
|
+
root: "_2rko1mok _1e0c1ule _vchhusvi _1pby1nn1 _bfhk1bhr _16qs130s _syazi7uo _1q1l1bhr _nt751r31 _49pcglyw _1hvw1o36",
|
|
19
18
|
fullWidth: "_1bsb1osq",
|
|
20
19
|
motion: "_c71l1kw7 _1e0c1txw"
|
|
21
20
|
};
|
|
@@ -88,7 +87,7 @@ const DefaultPopupComponent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
88
87
|
} = props;
|
|
89
88
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
90
89
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
91
|
-
className: ax([wrapperStyles.root,
|
|
90
|
+
className: ax([wrapperStyles.root, appearance === 'UNSAFE_modal-below-sm' && "_dk5d1b66 _c71l1ei0 _kqsw1n9t _152t1b66", (!shouldRenderToParent || shouldFitViewport) && "_1reo1wug _18m91wug", shouldFitContainer && "_1bsb1osq", className])
|
|
92
91
|
}, htmlAttributes, {
|
|
93
92
|
ref: !fg('platform-dst-motion-uplift-popup') ? ref : undefined
|
|
94
93
|
}), children);
|
|
@@ -57,6 +57,13 @@ export const useFocusManager = ({
|
|
|
57
57
|
return () => {
|
|
58
58
|
cancelAllFrames();
|
|
59
59
|
focusTrap.deactivate();
|
|
60
|
+
if (fg('platform_dst-popup-trigger-initial-focus-ref') && shouldReturnFocus) {
|
|
61
|
+
requestFrame(() => {
|
|
62
|
+
if (triggerRef !== null && triggerRef !== void 0 && triggerRef.isConnected && (document.activeElement === document.body || document.activeElement === document.documentElement || !document.activeElement)) {
|
|
63
|
+
triggerRef.focus();
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
60
67
|
};
|
|
61
68
|
}, [popupRef, triggerRef, autoFocus, initialFocusRef, shouldCloseOnTab, shouldDisableFocusTrap, requestFrame, cancelAllFrames, shouldReturnFocus, shouldRenderToParent, currentLevel]);
|
|
62
69
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
._1r04idpf{inset:0}
|
|
2
|
-
._2rko12b0{border-radius:var(--ds-radius-small,4px)}
|
|
3
2
|
._2rko1mok{border-radius:var(--ds-radius-large,8px)}
|
|
4
3
|
._dk5d1b66{inset-inline:var(--ds-space-050,4px)}._152t1b66{inset-block-start:var(--ds-space-050,4px)}
|
|
5
4
|
._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
|
|
@@ -21,8 +21,7 @@ import { useFocusManager } from './use-focus-manager';
|
|
|
21
21
|
var LOCAL_CURRENT_SURFACE_CSS_VAR = '--ds-elevation-surface-current';
|
|
22
22
|
var fullWidthStyles = null;
|
|
23
23
|
var wrapperStyles = {
|
|
24
|
-
root: "
|
|
25
|
-
rootT26Shape: "_2rko1mok",
|
|
24
|
+
root: "_2rko1mok _1e0c1ule _vchhusvi _1pby1nn1 _bfhk1bhr _16qs130s _syazi7uo _1q1l1bhr _nt751r31 _49pcglyw _1hvw1o36",
|
|
26
25
|
fullWidth: "_1bsb1osq",
|
|
27
26
|
motion: "_c71l1kw7 _1e0c1txw"
|
|
28
27
|
};
|
|
@@ -93,7 +92,7 @@ var DefaultPopupComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
93
92
|
htmlAttributes = _objectWithoutProperties(props, _excluded);
|
|
94
93
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
95
94
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
96
|
-
className: ax([wrapperStyles.root,
|
|
95
|
+
className: ax([wrapperStyles.root, appearance === 'UNSAFE_modal-below-sm' && "_dk5d1b66 _c71l1ei0 _kqsw1n9t _152t1b66", (!shouldRenderToParent || shouldFitViewport) && "_1reo1wug _18m91wug", shouldFitContainer && "_1bsb1osq", className])
|
|
97
96
|
}, htmlAttributes, {
|
|
98
97
|
ref: !fg('platform-dst-motion-uplift-popup') ? ref : undefined
|
|
99
98
|
}), children);
|
|
@@ -54,6 +54,13 @@ export var useFocusManager = function useFocusManager(_ref) {
|
|
|
54
54
|
return function () {
|
|
55
55
|
cancelAllFrames();
|
|
56
56
|
focusTrap.deactivate();
|
|
57
|
+
if (fg('platform_dst-popup-trigger-initial-focus-ref') && shouldReturnFocus) {
|
|
58
|
+
requestFrame(function () {
|
|
59
|
+
if (triggerRef !== null && triggerRef !== void 0 && triggerRef.isConnected && (document.activeElement === document.body || document.activeElement === document.documentElement || !document.activeElement)) {
|
|
60
|
+
triggerRef.focus();
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
57
64
|
};
|
|
58
65
|
}, [popupRef, triggerRef, autoFocus, initialFocusRef, shouldCloseOnTab, shouldDisableFocusTrap, requestFrame, cancelAllFrames, shouldReturnFocus, shouldRenderToParent, currentLevel]);
|
|
59
66
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/popup",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.2",
|
|
4
4
|
"description": "A popup displays brief content in an overlay.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@atlaskit/portal": "^6.4.0",
|
|
41
41
|
"@atlaskit/primitives": "^22.5.0",
|
|
42
42
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
43
|
-
"@atlaskit/tokens": "^16.
|
|
43
|
+
"@atlaskit/tokens": "^16.11.0",
|
|
44
44
|
"@atlaskit/top-layer": "^4.4.0",
|
|
45
45
|
"@babel/runtime": "^7.0.0",
|
|
46
46
|
"@compiled/react": "^1.0.2",
|
|
@@ -108,14 +108,14 @@
|
|
|
108
108
|
"popup-onclose-fix": {
|
|
109
109
|
"type": "boolean"
|
|
110
110
|
},
|
|
111
|
-
"platform-dst-shape-theme-default": {
|
|
112
|
-
"type": "boolean"
|
|
113
|
-
},
|
|
114
111
|
"platform_dst_nested_escape": {
|
|
115
112
|
"type": "boolean"
|
|
116
113
|
},
|
|
117
114
|
"platform-dst-motion-uplift-popup": {
|
|
118
115
|
"type": "boolean"
|
|
116
|
+
},
|
|
117
|
+
"platform_dst-popup-trigger-initial-focus-ref": {
|
|
118
|
+
"type": "boolean"
|
|
119
119
|
}
|
|
120
120
|
},
|
|
121
121
|
"homepage": "https://atlassian.design/components/popup/"
|