@atlaskit/popup 1.6.3 → 1.7.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 +12 -0
- package/dist/cjs/popper-wrapper.js +1 -14
- package/dist/cjs/popup.js +27 -19
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/popper-wrapper.js +2 -15
- package/dist/es2019/popup.js +24 -19
- package/dist/es2019/version.json +1 -1
- package/dist/esm/popper-wrapper.js +2 -15
- package/dist/esm/popup.js +27 -19
- package/dist/esm/version.json +1 -1
- package/dist/types/types.d.ts +5 -0
- package/dist/types-ts4.5/types.d.ts +5 -0
- package/package.json +12 -7
- package/report.api.md +15 -0
- package/tmp/api-report-tmp.d.ts +81 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/popup
|
|
2
2
|
|
|
3
|
+
## 1.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`eca89633804`](https://bitbucket.org/atlassian/atlassian-frontend/commits/eca89633804) - Add a new prop `shouldRenderToParent` to allow render popup into a DOM node within the parent DOM hierarchy instead of React portal.
|
|
8
|
+
|
|
9
|
+
## 1.6.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`e2a6337bb05`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e2a6337bb05) - Reverts changes 1.6.3 in @atlaskit/popup, reverts disabling pointer events on iframes when popup is open.
|
|
14
|
+
|
|
3
15
|
## 1.6.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -30,16 +30,6 @@ var popupStyles = (0, _react2.css)({
|
|
|
30
30
|
outline: 'none'
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
|
-
|
|
34
|
-
// disables iframe pointer events while popup is open, except if iframe is nested inside popup
|
|
35
|
-
// solves an issue of popup not being closed on iframe click
|
|
36
|
-
// @ts-expect-error adding `!important` to style rules is currently a type error
|
|
37
|
-
var blockPointerEventsOnExternalIframeStyles = (0, _react2.css)({
|
|
38
|
-
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
39
|
-
'iframe:not([data-ds--popup] iframe)': {
|
|
40
|
-
pointerEvents: 'none !important'
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
33
|
var DefaultPopupComponent = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
44
34
|
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
45
35
|
css: popupStyles
|
|
@@ -109,7 +99,6 @@ function PopperWrapper(_ref) {
|
|
|
109
99
|
id: id,
|
|
110
100
|
"data-placement": placement,
|
|
111
101
|
"data-testid": testId,
|
|
112
|
-
"data-ds--popup": "true",
|
|
113
102
|
ref: function ref(node) {
|
|
114
103
|
if (node) {
|
|
115
104
|
if (typeof _ref3 === 'function') {
|
|
@@ -125,9 +114,7 @@ function PopperWrapper(_ref) {
|
|
|
125
114
|
// first on the browser address bar when using keyboard
|
|
126
115
|
,
|
|
127
116
|
tabIndex: autoFocus ? 0 : undefined
|
|
128
|
-
}, (0, _react2.jsx)(
|
|
129
|
-
styles: blockPointerEventsOnExternalIframeStyles
|
|
130
|
-
}), (0, _react2.jsx)(_repositionOnUpdate.RepositionOnUpdate, {
|
|
117
|
+
}, (0, _react2.jsx)(_repositionOnUpdate.RepositionOnUpdate, {
|
|
131
118
|
update: update
|
|
132
119
|
}, content({
|
|
133
120
|
update: update,
|
package/dist/cjs/popup.js
CHANGED
|
@@ -8,6 +8,7 @@ exports.default = exports.Popup = void 0;
|
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _popper = require("@atlaskit/popper");
|
|
12
13
|
var _portal = _interopRequireDefault(require("@atlaskit/portal"));
|
|
13
14
|
var _constants = require("@atlaskit/theme/constants");
|
|
@@ -38,11 +39,32 @@ var Popup = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
38
39
|
_ref$zIndex = _ref.zIndex,
|
|
39
40
|
zIndex = _ref$zIndex === void 0 ? defaultLayer : _ref$zIndex,
|
|
40
41
|
_ref$shouldUseCapture = _ref.shouldUseCaptureOnOutsideClick,
|
|
41
|
-
shouldUseCaptureOnOutsideClick = _ref$shouldUseCapture === void 0 ? false : _ref$shouldUseCapture
|
|
42
|
+
shouldUseCaptureOnOutsideClick = _ref$shouldUseCapture === void 0 ? false : _ref$shouldUseCapture,
|
|
43
|
+
_ref$shouldRenderToPa = _ref.shouldRenderToParent,
|
|
44
|
+
shouldRenderToParent = _ref$shouldRenderToPa === void 0 ? false : _ref$shouldRenderToPa;
|
|
42
45
|
var _useState = (0, _react.useState)(null),
|
|
43
46
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
44
47
|
triggerRef = _useState2[0],
|
|
45
48
|
setTriggerRef = _useState2[1];
|
|
49
|
+
var renderPopperWrapper = function renderPopperWrapper() {
|
|
50
|
+
return (0, _react2.jsx)(_popperWrapper.default, {
|
|
51
|
+
content: content,
|
|
52
|
+
isOpen: isOpen,
|
|
53
|
+
placement: placement,
|
|
54
|
+
fallbackPlacements: fallbackPlacements,
|
|
55
|
+
boundary: boundary,
|
|
56
|
+
rootBoundary: rootBoundary,
|
|
57
|
+
shouldFlip: shouldFlip,
|
|
58
|
+
offset: offset,
|
|
59
|
+
popupComponent: PopupContainer,
|
|
60
|
+
id: id,
|
|
61
|
+
testId: testId,
|
|
62
|
+
onClose: onClose,
|
|
63
|
+
autoFocus: autoFocus,
|
|
64
|
+
shouldUseCaptureOnOutsideClick: shouldUseCaptureOnOutsideClick,
|
|
65
|
+
triggerRef: triggerRef
|
|
66
|
+
});
|
|
67
|
+
};
|
|
46
68
|
return (0, _react2.jsx)(_popper.Manager, null, (0, _react2.jsx)(_popper.Reference, null, function (_ref2) {
|
|
47
69
|
var _ref3 = _ref2.ref;
|
|
48
70
|
return trigger({
|
|
@@ -60,25 +82,11 @@ var Popup = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
60
82
|
'aria-expanded': isOpen,
|
|
61
83
|
'aria-haspopup': true
|
|
62
84
|
});
|
|
63
|
-
}), isOpen && (0, _react2.jsx)(_portal.default, {
|
|
85
|
+
}), isOpen && ((0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.render-popup-in-parent_f73ij') ? shouldRenderToParent ? renderPopperWrapper() : (0, _react2.jsx)(_portal.default, {
|
|
86
|
+
zIndex: zIndex
|
|
87
|
+
}, renderPopperWrapper()) : (0, _react2.jsx)(_portal.default, {
|
|
64
88
|
zIndex: zIndex
|
|
65
|
-
}, (
|
|
66
|
-
content: content,
|
|
67
|
-
isOpen: isOpen,
|
|
68
|
-
placement: placement,
|
|
69
|
-
fallbackPlacements: fallbackPlacements,
|
|
70
|
-
boundary: boundary,
|
|
71
|
-
rootBoundary: rootBoundary,
|
|
72
|
-
shouldFlip: shouldFlip,
|
|
73
|
-
offset: offset,
|
|
74
|
-
popupComponent: PopupContainer,
|
|
75
|
-
id: id,
|
|
76
|
-
testId: testId,
|
|
77
|
-
onClose: onClose,
|
|
78
|
-
autoFocus: autoFocus,
|
|
79
|
-
shouldUseCaptureOnOutsideClick: shouldUseCaptureOnOutsideClick,
|
|
80
|
-
triggerRef: triggerRef
|
|
81
|
-
})));
|
|
89
|
+
}, renderPopperWrapper())));
|
|
82
90
|
});
|
|
83
91
|
exports.Popup = Popup;
|
|
84
92
|
var _default = Popup;
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import { forwardRef, useMemo, useState } from 'react';
|
|
4
|
-
import { css,
|
|
4
|
+
import { css, jsx } from '@emotion/react';
|
|
5
5
|
import { Popper } from '@atlaskit/popper';
|
|
6
6
|
import { N0, N50A, N60A } from '@atlaskit/theme/colors';
|
|
7
7
|
import { borderRadius, layers } from '@atlaskit/theme/constants';
|
|
@@ -21,16 +21,6 @@ const popupStyles = css({
|
|
|
21
21
|
outline: 'none'
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
|
|
25
|
-
// disables iframe pointer events while popup is open, except if iframe is nested inside popup
|
|
26
|
-
// solves an issue of popup not being closed on iframe click
|
|
27
|
-
// @ts-expect-error adding `!important` to style rules is currently a type error
|
|
28
|
-
const blockPointerEventsOnExternalIframeStyles = css({
|
|
29
|
-
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
30
|
-
'iframe:not([data-ds--popup] iframe)': {
|
|
31
|
-
pointerEvents: 'none !important'
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
24
|
const DefaultPopupComponent = /*#__PURE__*/forwardRef((props, ref) => jsx("div", _extends({
|
|
35
25
|
css: popupStyles
|
|
36
26
|
}, props, {
|
|
@@ -89,7 +79,6 @@ function PopperWrapper({
|
|
|
89
79
|
id: id,
|
|
90
80
|
"data-placement": placement,
|
|
91
81
|
"data-testid": testId,
|
|
92
|
-
"data-ds--popup": "true",
|
|
93
82
|
ref: node => {
|
|
94
83
|
if (node) {
|
|
95
84
|
if (typeof ref === 'function') {
|
|
@@ -105,9 +94,7 @@ function PopperWrapper({
|
|
|
105
94
|
// first on the browser address bar when using keyboard
|
|
106
95
|
,
|
|
107
96
|
tabIndex: autoFocus ? 0 : undefined
|
|
108
|
-
}, jsx(
|
|
109
|
-
styles: blockPointerEventsOnExternalIframeStyles
|
|
110
|
-
}), jsx(RepositionOnUpdate, {
|
|
97
|
+
}, jsx(RepositionOnUpdate, {
|
|
111
98
|
update: update
|
|
112
99
|
}, content({
|
|
113
100
|
update,
|
package/dist/es2019/popup.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import { memo, useState } from 'react';
|
|
4
4
|
import { jsx } from '@emotion/react';
|
|
5
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { Manager, Reference } from '@atlaskit/popper';
|
|
6
7
|
import Portal from '@atlaskit/portal';
|
|
7
8
|
import { layers } from '@atlaskit/theme/constants';
|
|
@@ -23,9 +24,27 @@ export const Popup = /*#__PURE__*/memo(({
|
|
|
23
24
|
popupComponent: PopupContainer,
|
|
24
25
|
autoFocus = true,
|
|
25
26
|
zIndex = defaultLayer,
|
|
26
|
-
shouldUseCaptureOnOutsideClick = false
|
|
27
|
+
shouldUseCaptureOnOutsideClick = false,
|
|
28
|
+
shouldRenderToParent = false
|
|
27
29
|
}) => {
|
|
28
30
|
const [triggerRef, setTriggerRef] = useState(null);
|
|
31
|
+
const renderPopperWrapper = () => jsx(PopperWrapper, {
|
|
32
|
+
content: content,
|
|
33
|
+
isOpen: isOpen,
|
|
34
|
+
placement: placement,
|
|
35
|
+
fallbackPlacements: fallbackPlacements,
|
|
36
|
+
boundary: boundary,
|
|
37
|
+
rootBoundary: rootBoundary,
|
|
38
|
+
shouldFlip: shouldFlip,
|
|
39
|
+
offset: offset,
|
|
40
|
+
popupComponent: PopupContainer,
|
|
41
|
+
id: id,
|
|
42
|
+
testId: testId,
|
|
43
|
+
onClose: onClose,
|
|
44
|
+
autoFocus: autoFocus,
|
|
45
|
+
shouldUseCaptureOnOutsideClick: shouldUseCaptureOnOutsideClick,
|
|
46
|
+
triggerRef: triggerRef
|
|
47
|
+
});
|
|
29
48
|
return jsx(Manager, null, jsx(Reference, null, ({
|
|
30
49
|
ref
|
|
31
50
|
}) => {
|
|
@@ -44,24 +63,10 @@ export const Popup = /*#__PURE__*/memo(({
|
|
|
44
63
|
'aria-expanded': isOpen,
|
|
45
64
|
'aria-haspopup': true
|
|
46
65
|
});
|
|
47
|
-
}), isOpen && jsx(Portal, {
|
|
66
|
+
}), isOpen && (getBooleanFF('platform.design-system-team.render-popup-in-parent_f73ij') ? shouldRenderToParent ? renderPopperWrapper() : jsx(Portal, {
|
|
48
67
|
zIndex: zIndex
|
|
49
|
-
}, jsx(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
placement: placement,
|
|
53
|
-
fallbackPlacements: fallbackPlacements,
|
|
54
|
-
boundary: boundary,
|
|
55
|
-
rootBoundary: rootBoundary,
|
|
56
|
-
shouldFlip: shouldFlip,
|
|
57
|
-
offset: offset,
|
|
58
|
-
popupComponent: PopupContainer,
|
|
59
|
-
id: id,
|
|
60
|
-
testId: testId,
|
|
61
|
-
onClose: onClose,
|
|
62
|
-
autoFocus: autoFocus,
|
|
63
|
-
shouldUseCaptureOnOutsideClick: shouldUseCaptureOnOutsideClick,
|
|
64
|
-
triggerRef: triggerRef
|
|
65
|
-
})));
|
|
68
|
+
}, renderPopperWrapper()) : jsx(Portal, {
|
|
69
|
+
zIndex: zIndex
|
|
70
|
+
}, renderPopperWrapper())));
|
|
66
71
|
});
|
|
67
72
|
export default Popup;
|
package/dist/es2019/version.json
CHANGED
|
@@ -2,7 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
/** @jsx jsx */
|
|
4
4
|
import { forwardRef, useMemo, useState } from 'react';
|
|
5
|
-
import { css,
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
6
6
|
import { Popper } from '@atlaskit/popper';
|
|
7
7
|
import { N0, N50A, N60A } from '@atlaskit/theme/colors';
|
|
8
8
|
import { borderRadius, layers } from '@atlaskit/theme/constants';
|
|
@@ -22,16 +22,6 @@ var popupStyles = css({
|
|
|
22
22
|
outline: 'none'
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
|
-
|
|
26
|
-
// disables iframe pointer events while popup is open, except if iframe is nested inside popup
|
|
27
|
-
// solves an issue of popup not being closed on iframe click
|
|
28
|
-
// @ts-expect-error adding `!important` to style rules is currently a type error
|
|
29
|
-
var blockPointerEventsOnExternalIframeStyles = css({
|
|
30
|
-
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
31
|
-
'iframe:not([data-ds--popup] iframe)': {
|
|
32
|
-
pointerEvents: 'none !important'
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
25
|
var DefaultPopupComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
36
26
|
return jsx("div", _extends({
|
|
37
27
|
css: popupStyles
|
|
@@ -101,7 +91,6 @@ function PopperWrapper(_ref) {
|
|
|
101
91
|
id: id,
|
|
102
92
|
"data-placement": placement,
|
|
103
93
|
"data-testid": testId,
|
|
104
|
-
"data-ds--popup": "true",
|
|
105
94
|
ref: function ref(node) {
|
|
106
95
|
if (node) {
|
|
107
96
|
if (typeof _ref3 === 'function') {
|
|
@@ -117,9 +106,7 @@ function PopperWrapper(_ref) {
|
|
|
117
106
|
// first on the browser address bar when using keyboard
|
|
118
107
|
,
|
|
119
108
|
tabIndex: autoFocus ? 0 : undefined
|
|
120
|
-
}, jsx(
|
|
121
|
-
styles: blockPointerEventsOnExternalIframeStyles
|
|
122
|
-
}), jsx(RepositionOnUpdate, {
|
|
109
|
+
}, jsx(RepositionOnUpdate, {
|
|
123
110
|
update: update
|
|
124
111
|
}, content({
|
|
125
112
|
update: update,
|
package/dist/esm/popup.js
CHANGED
|
@@ -3,6 +3,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
4
|
import { memo, useState } from 'react';
|
|
5
5
|
import { jsx } from '@emotion/react';
|
|
6
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { Manager, Reference } from '@atlaskit/popper';
|
|
7
8
|
import Portal from '@atlaskit/portal';
|
|
8
9
|
import { layers } from '@atlaskit/theme/constants';
|
|
@@ -30,11 +31,32 @@ export var Popup = /*#__PURE__*/memo(function (_ref) {
|
|
|
30
31
|
_ref$zIndex = _ref.zIndex,
|
|
31
32
|
zIndex = _ref$zIndex === void 0 ? defaultLayer : _ref$zIndex,
|
|
32
33
|
_ref$shouldUseCapture = _ref.shouldUseCaptureOnOutsideClick,
|
|
33
|
-
shouldUseCaptureOnOutsideClick = _ref$shouldUseCapture === void 0 ? false : _ref$shouldUseCapture
|
|
34
|
+
shouldUseCaptureOnOutsideClick = _ref$shouldUseCapture === void 0 ? false : _ref$shouldUseCapture,
|
|
35
|
+
_ref$shouldRenderToPa = _ref.shouldRenderToParent,
|
|
36
|
+
shouldRenderToParent = _ref$shouldRenderToPa === void 0 ? false : _ref$shouldRenderToPa;
|
|
34
37
|
var _useState = useState(null),
|
|
35
38
|
_useState2 = _slicedToArray(_useState, 2),
|
|
36
39
|
triggerRef = _useState2[0],
|
|
37
40
|
setTriggerRef = _useState2[1];
|
|
41
|
+
var renderPopperWrapper = function renderPopperWrapper() {
|
|
42
|
+
return jsx(PopperWrapper, {
|
|
43
|
+
content: content,
|
|
44
|
+
isOpen: isOpen,
|
|
45
|
+
placement: placement,
|
|
46
|
+
fallbackPlacements: fallbackPlacements,
|
|
47
|
+
boundary: boundary,
|
|
48
|
+
rootBoundary: rootBoundary,
|
|
49
|
+
shouldFlip: shouldFlip,
|
|
50
|
+
offset: offset,
|
|
51
|
+
popupComponent: PopupContainer,
|
|
52
|
+
id: id,
|
|
53
|
+
testId: testId,
|
|
54
|
+
onClose: onClose,
|
|
55
|
+
autoFocus: autoFocus,
|
|
56
|
+
shouldUseCaptureOnOutsideClick: shouldUseCaptureOnOutsideClick,
|
|
57
|
+
triggerRef: triggerRef
|
|
58
|
+
});
|
|
59
|
+
};
|
|
38
60
|
return jsx(Manager, null, jsx(Reference, null, function (_ref2) {
|
|
39
61
|
var _ref3 = _ref2.ref;
|
|
40
62
|
return trigger({
|
|
@@ -52,24 +74,10 @@ export var Popup = /*#__PURE__*/memo(function (_ref) {
|
|
|
52
74
|
'aria-expanded': isOpen,
|
|
53
75
|
'aria-haspopup': true
|
|
54
76
|
});
|
|
55
|
-
}), isOpen && jsx(Portal, {
|
|
77
|
+
}), isOpen && (getBooleanFF('platform.design-system-team.render-popup-in-parent_f73ij') ? shouldRenderToParent ? renderPopperWrapper() : jsx(Portal, {
|
|
78
|
+
zIndex: zIndex
|
|
79
|
+
}, renderPopperWrapper()) : jsx(Portal, {
|
|
56
80
|
zIndex: zIndex
|
|
57
|
-
},
|
|
58
|
-
content: content,
|
|
59
|
-
isOpen: isOpen,
|
|
60
|
-
placement: placement,
|
|
61
|
-
fallbackPlacements: fallbackPlacements,
|
|
62
|
-
boundary: boundary,
|
|
63
|
-
rootBoundary: rootBoundary,
|
|
64
|
-
shouldFlip: shouldFlip,
|
|
65
|
-
offset: offset,
|
|
66
|
-
popupComponent: PopupContainer,
|
|
67
|
-
id: id,
|
|
68
|
-
testId: testId,
|
|
69
|
-
onClose: onClose,
|
|
70
|
-
autoFocus: autoFocus,
|
|
71
|
-
shouldUseCaptureOnOutsideClick: shouldUseCaptureOnOutsideClick,
|
|
72
|
-
triggerRef: triggerRef
|
|
73
|
-
})));
|
|
81
|
+
}, renderPopperWrapper())));
|
|
74
82
|
});
|
|
75
83
|
export default Popup;
|
package/dist/esm/version.json
CHANGED
package/dist/types/types.d.ts
CHANGED
|
@@ -147,6 +147,11 @@ export interface PopupProps extends BaseProps {
|
|
|
147
147
|
* Defaults to `layers.layer()` from `@atlaskit/theme`.
|
|
148
148
|
*/
|
|
149
149
|
zIndex?: number;
|
|
150
|
+
/**
|
|
151
|
+
* The root element where the popup should be rendered.
|
|
152
|
+
* Defaults to `false`.
|
|
153
|
+
*/
|
|
154
|
+
shouldRenderToParent?: boolean;
|
|
150
155
|
}
|
|
151
156
|
export interface PopperWrapperProps extends BaseProps {
|
|
152
157
|
triggerRef: TriggerRef;
|
|
@@ -150,6 +150,11 @@ export interface PopupProps extends BaseProps {
|
|
|
150
150
|
* Defaults to `layers.layer()` from `@atlaskit/theme`.
|
|
151
151
|
*/
|
|
152
152
|
zIndex?: number;
|
|
153
|
+
/**
|
|
154
|
+
* The root element where the popup should be rendered.
|
|
155
|
+
* Defaults to `false`.
|
|
156
|
+
*/
|
|
157
|
+
shouldRenderToParent?: boolean;
|
|
153
158
|
}
|
|
154
159
|
export interface PopperWrapperProps extends BaseProps {
|
|
155
160
|
triggerRef: TriggerRef;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/popup",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "A popup displays brief content in an overlay.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"atlassian": {
|
|
30
30
|
"team": "Design System Team",
|
|
31
|
-
"releaseModel": "
|
|
31
|
+
"releaseModel": "continuous",
|
|
32
32
|
"website": {
|
|
33
33
|
"name": "Popup",
|
|
34
34
|
"category": "Components"
|
|
@@ -36,10 +36,11 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
39
|
+
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
39
40
|
"@atlaskit/popper": "^5.5.0",
|
|
40
41
|
"@atlaskit/portal": "^4.3.0",
|
|
41
42
|
"@atlaskit/theme": "^12.5.0",
|
|
42
|
-
"@atlaskit/tokens": "^1.
|
|
43
|
+
"@atlaskit/tokens": "^1.5.0",
|
|
43
44
|
"@babel/runtime": "^7.0.0",
|
|
44
45
|
"@emotion/react": "^11.7.1",
|
|
45
46
|
"bind-event-listener": "^2.1.1",
|
|
@@ -54,18 +55,17 @@
|
|
|
54
55
|
"@atlaskit/docs": "*",
|
|
55
56
|
"@atlaskit/icon": "^21.12.0",
|
|
56
57
|
"@atlaskit/menu": "^1.7.0",
|
|
57
|
-
"@atlaskit/page-layout": "^1.6.0",
|
|
58
58
|
"@atlaskit/radio": "^5.6.0",
|
|
59
59
|
"@atlaskit/section-message": "^6.4.0",
|
|
60
|
-
"@atlaskit/select": "^16.
|
|
60
|
+
"@atlaskit/select": "^16.5.0",
|
|
61
61
|
"@atlaskit/ssr": "*",
|
|
62
62
|
"@atlaskit/textfield": "^5.5.0",
|
|
63
63
|
"@atlaskit/toggle": "^12.6.0",
|
|
64
64
|
"@atlaskit/visual-regression": "*",
|
|
65
65
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
66
|
+
"@atlassian/feature-flags-test-utils": "*",
|
|
66
67
|
"@testing-library/dom": "^8.17.1",
|
|
67
68
|
"@testing-library/react": "^12.1.5",
|
|
68
|
-
"@testing-library/user-event": "^14.4.3",
|
|
69
69
|
"ast-types": "^0.13.3",
|
|
70
70
|
"jest-axe": "^4.0.0",
|
|
71
71
|
"jscodeshift": "^0.13.0",
|
|
@@ -101,5 +101,10 @@
|
|
|
101
101
|
}
|
|
102
102
|
},
|
|
103
103
|
"homepage": "https://atlassian.design/components/popup/",
|
|
104
|
-
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
104
|
+
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
|
|
105
|
+
"platform-feature-flags": {
|
|
106
|
+
"platform.design-system-team.render-popup-in-parent_f73ij": {
|
|
107
|
+
"type": "boolean"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
105
110
|
}
|
package/report.api.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
### Table of contents
|
|
9
9
|
|
|
10
10
|
- [Main Entry Types](#main-entry-types)
|
|
11
|
+
- [Peer Dependencies](#peer-dependencies)
|
|
11
12
|
|
|
12
13
|
### Main Entry Types
|
|
13
14
|
|
|
@@ -69,6 +70,7 @@ export interface PopupComponentProps {
|
|
|
69
70
|
|
|
70
71
|
// @public (undocumented)
|
|
71
72
|
export interface PopupProps extends BaseProps {
|
|
73
|
+
shouldRenderToParent?: boolean;
|
|
72
74
|
trigger: (props: TriggerProps) => React_2.ReactNode;
|
|
73
75
|
zIndex?: number;
|
|
74
76
|
}
|
|
@@ -89,3 +91,16 @@ export interface TriggerProps {
|
|
|
89
91
|
```
|
|
90
92
|
|
|
91
93
|
<!--SECTION END: Main Entry Types-->
|
|
94
|
+
|
|
95
|
+
### Peer Dependencies
|
|
96
|
+
|
|
97
|
+
<!--SECTION START: Peer Dependencies-->
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"react": "^16.8.0",
|
|
102
|
+
"react-dom": "^16.8.0"
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
<!--SECTION END: Peer Dependencies-->
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/popup"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
import { ComponentType } from 'react';
|
|
8
|
+
import { CSSProperties } from 'react';
|
|
9
|
+
import { Dispatch } from 'react';
|
|
10
|
+
import { FC } from 'react';
|
|
11
|
+
import { Placement } from '@atlaskit/popper';
|
|
12
|
+
import { PopperChildrenProps } from '@atlaskit/popper';
|
|
13
|
+
import { default as React_2 } from 'react';
|
|
14
|
+
import { ReactNode } from 'react';
|
|
15
|
+
import { Ref } from 'react';
|
|
16
|
+
import { SetStateAction } from 'react';
|
|
17
|
+
|
|
18
|
+
// @public (undocumented)
|
|
19
|
+
interface BaseProps {
|
|
20
|
+
autoFocus?: boolean;
|
|
21
|
+
boundary?: 'clippingParents' | HTMLElement;
|
|
22
|
+
content: (props: ContentProps) => React_2.ReactNode;
|
|
23
|
+
fallbackPlacements?: Placement[];
|
|
24
|
+
id?: string;
|
|
25
|
+
isOpen: boolean;
|
|
26
|
+
offset?: [number, number];
|
|
27
|
+
onClose?(event: Event | React_2.KeyboardEvent | React_2.MouseEvent): void;
|
|
28
|
+
placement?: Placement;
|
|
29
|
+
popupComponent?: ComponentType<PopupComponentProps>;
|
|
30
|
+
rootBoundary?: 'document' | 'viewport';
|
|
31
|
+
shouldFlip?: boolean;
|
|
32
|
+
shouldUseCaptureOnOutsideClick?: boolean;
|
|
33
|
+
testId?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// @public (undocumented)
|
|
37
|
+
export interface ContentProps {
|
|
38
|
+
isOpen: boolean;
|
|
39
|
+
onClose?: BaseProps['onClose'];
|
|
40
|
+
setInitialFocusRef: Dispatch<SetStateAction<HTMLElement | null>>;
|
|
41
|
+
update: PopperChildrenProps['update'];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// @public (undocumented)
|
|
45
|
+
const Popup: FC<PopupProps>;
|
|
46
|
+
export { Popup }
|
|
47
|
+
export default Popup;
|
|
48
|
+
|
|
49
|
+
// @public (undocumented)
|
|
50
|
+
export interface PopupComponentProps {
|
|
51
|
+
'data-placement': Placement;
|
|
52
|
+
'data-testid'?: string;
|
|
53
|
+
children: ReactNode;
|
|
54
|
+
id?: string;
|
|
55
|
+
ref: Ref<HTMLDivElement>;
|
|
56
|
+
style: CSSProperties;
|
|
57
|
+
tabIndex: number | undefined;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// @public (undocumented)
|
|
61
|
+
export interface PopupProps extends BaseProps {
|
|
62
|
+
shouldRenderToParent?: boolean;
|
|
63
|
+
trigger: (props: TriggerProps) => React_2.ReactNode;
|
|
64
|
+
zIndex?: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// @public (undocumented)
|
|
68
|
+
export interface TriggerProps {
|
|
69
|
+
// (undocumented)
|
|
70
|
+
'aria-controls'?: string;
|
|
71
|
+
// (undocumented)
|
|
72
|
+
'aria-expanded': boolean;
|
|
73
|
+
// (undocumented)
|
|
74
|
+
'aria-haspopup': boolean;
|
|
75
|
+
// (undocumented)
|
|
76
|
+
ref: Ref<any>;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// (No @packageDocumentation comment for this package)
|
|
80
|
+
|
|
81
|
+
```
|