@atlaskit/popup 1.19.4 → 1.20.1
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 +15 -0
- package/dist/cjs/compositional/popup.js +4 -3
- package/dist/es2019/compositional/popup.js +4 -2
- package/dist/esm/compositional/popup.js +4 -3
- package/dist/types/compositional/popup.d.ts +12 -2
- package/dist/types-ts4.5/compositional/popup.d.ts +12 -2
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/popup
|
|
2
2
|
|
|
3
|
+
## 1.20.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 1.20.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#116426](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116426)
|
|
14
|
+
[`d6c9799d09e87`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d6c9799d09e87) -
|
|
15
|
+
Updates compositional popup to take an optional prop for the popup content to expand to the full
|
|
16
|
+
width of the parent container
|
|
17
|
+
|
|
3
18
|
## 1.19.4
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -126,10 +126,10 @@ var PopupContent = exports.PopupContent = function PopupContent(_ref4) {
|
|
|
126
126
|
zIndex = _ref4$zIndex === void 0 ? defaultLayer : _ref4$zIndex,
|
|
127
127
|
_ref4$shouldUseCaptur = _ref4.shouldUseCaptureOnOutsideClick,
|
|
128
128
|
shouldUseCaptureOnOutsideClick = _ref4$shouldUseCaptur === void 0 ? false : _ref4$shouldUseCaptur,
|
|
129
|
-
|
|
130
|
-
shouldRenderToParent = _ref4$shouldRenderToP === void 0 ? false : _ref4$shouldRenderToP,
|
|
129
|
+
shouldRenderToParent = _ref4.shouldRenderToParent,
|
|
131
130
|
_ref4$shouldDisableFo = _ref4.shouldDisableFocusLock,
|
|
132
|
-
shouldDisableFocusLock = _ref4$shouldDisableFo === void 0 ? false : _ref4$shouldDisableFo
|
|
131
|
+
shouldDisableFocusLock = _ref4$shouldDisableFo === void 0 ? false : _ref4$shouldDisableFo,
|
|
132
|
+
shouldFitContainer = _ref4.shouldFitContainer;
|
|
133
133
|
useEnsureIsInsidePopup();
|
|
134
134
|
var isOpen = (0, _react.useContext)(IsOpenContext);
|
|
135
135
|
var id = (0, _react.useContext)(IdContext);
|
|
@@ -153,6 +153,7 @@ var PopupContent = exports.PopupContent = function PopupContent(_ref4) {
|
|
|
153
153
|
testId: testId,
|
|
154
154
|
onClose: onClose,
|
|
155
155
|
autoFocus: autoFocus,
|
|
156
|
+
shouldFitContainer: shouldFitContainer,
|
|
156
157
|
shouldUseCaptureOnOutsideClick: shouldUseCaptureOnOutsideClick,
|
|
157
158
|
shouldRenderToParent: shouldRenderToParent,
|
|
158
159
|
shouldDisableFocusLock: shouldDisableFocusLock,
|
|
@@ -106,8 +106,9 @@ export const PopupContent = ({
|
|
|
106
106
|
autoFocus = true,
|
|
107
107
|
zIndex = defaultLayer,
|
|
108
108
|
shouldUseCaptureOnOutsideClick = false,
|
|
109
|
-
shouldRenderToParent
|
|
110
|
-
shouldDisableFocusLock = false
|
|
109
|
+
shouldRenderToParent,
|
|
110
|
+
shouldDisableFocusLock = false,
|
|
111
|
+
shouldFitContainer
|
|
111
112
|
}) => {
|
|
112
113
|
useEnsureIsInsidePopup();
|
|
113
114
|
const isOpen = useContext(IsOpenContext);
|
|
@@ -132,6 +133,7 @@ export const PopupContent = ({
|
|
|
132
133
|
testId: testId,
|
|
133
134
|
onClose: onClose,
|
|
134
135
|
autoFocus: autoFocus,
|
|
136
|
+
shouldFitContainer: shouldFitContainer,
|
|
135
137
|
shouldUseCaptureOnOutsideClick: shouldUseCaptureOnOutsideClick,
|
|
136
138
|
shouldRenderToParent: shouldRenderToParent,
|
|
137
139
|
shouldDisableFocusLock: shouldDisableFocusLock,
|
|
@@ -116,10 +116,10 @@ export var PopupContent = function PopupContent(_ref4) {
|
|
|
116
116
|
zIndex = _ref4$zIndex === void 0 ? defaultLayer : _ref4$zIndex,
|
|
117
117
|
_ref4$shouldUseCaptur = _ref4.shouldUseCaptureOnOutsideClick,
|
|
118
118
|
shouldUseCaptureOnOutsideClick = _ref4$shouldUseCaptur === void 0 ? false : _ref4$shouldUseCaptur,
|
|
119
|
-
|
|
120
|
-
shouldRenderToParent = _ref4$shouldRenderToP === void 0 ? false : _ref4$shouldRenderToP,
|
|
119
|
+
shouldRenderToParent = _ref4.shouldRenderToParent,
|
|
121
120
|
_ref4$shouldDisableFo = _ref4.shouldDisableFocusLock,
|
|
122
|
-
shouldDisableFocusLock = _ref4$shouldDisableFo === void 0 ? false : _ref4$shouldDisableFo
|
|
121
|
+
shouldDisableFocusLock = _ref4$shouldDisableFo === void 0 ? false : _ref4$shouldDisableFo,
|
|
122
|
+
shouldFitContainer = _ref4.shouldFitContainer;
|
|
123
123
|
useEnsureIsInsidePopup();
|
|
124
124
|
var isOpen = useContext(IsOpenContext);
|
|
125
125
|
var id = useContext(IdContext);
|
|
@@ -143,6 +143,7 @@ export var PopupContent = function PopupContent(_ref4) {
|
|
|
143
143
|
testId: testId,
|
|
144
144
|
onClose: onClose,
|
|
145
145
|
autoFocus: autoFocus,
|
|
146
|
+
shouldFitContainer: shouldFitContainer,
|
|
146
147
|
shouldUseCaptureOnOutsideClick: shouldUseCaptureOnOutsideClick,
|
|
147
148
|
shouldRenderToParent: shouldRenderToParent,
|
|
148
149
|
shouldDisableFocusLock: shouldDisableFocusLock,
|
|
@@ -36,9 +36,18 @@ export type PopupTriggerProps = {
|
|
|
36
36
|
* It must be a child of the Popup component.
|
|
37
37
|
*/
|
|
38
38
|
export declare const PopupTrigger: ({ children }: PopupTriggerProps) => JSX.Element;
|
|
39
|
-
|
|
39
|
+
type CommonContentPopupProps = Pick<LegacyPopupProps, 'boundary' | 'offset' | 'onClose' | 'testId' | 'placement' | 'fallbackPlacements' | 'popupComponent' | 'shouldFlip' | 'rootBoundary' | 'autoFocus' | 'shouldRenderToParent' | 'shouldUseCaptureOnOutsideClick' | 'shouldDisableFocusLock' | 'strategy' | 'zIndex'> & {
|
|
40
40
|
children: (props: ContentProps) => React.ReactNode;
|
|
41
41
|
};
|
|
42
|
+
type ShouldFitContainerContentPopupProps = CommonContentPopupProps & {
|
|
43
|
+
shouldFitContainer: true;
|
|
44
|
+
shouldRenderToParent?: true;
|
|
45
|
+
strategy?: 'absolute';
|
|
46
|
+
};
|
|
47
|
+
type StandardPopupContentProps = CommonContentPopupProps & {
|
|
48
|
+
shouldFitContainer?: false;
|
|
49
|
+
};
|
|
50
|
+
export type PopupContentProps = ShouldFitContainerContentPopupProps | StandardPopupContentProps;
|
|
42
51
|
/**
|
|
43
52
|
* __Popup content__
|
|
44
53
|
*
|
|
@@ -46,4 +55,5 @@ export type PopupContentProps = Pick<LegacyPopupProps, 'boundary' | 'offset' | '
|
|
|
46
55
|
*
|
|
47
56
|
* It must be a child of the Popup component.
|
|
48
57
|
*/
|
|
49
|
-
export declare const PopupContent: ({ children, boundary, offset, strategy, onClose, testId, rootBoundary, shouldFlip, placement, fallbackPlacements, popupComponent, autoFocus, zIndex, shouldUseCaptureOnOutsideClick, shouldRenderToParent, shouldDisableFocusLock, }: PopupContentProps) => JSX.Element | null;
|
|
58
|
+
export declare const PopupContent: ({ children, boundary, offset, strategy, onClose, testId, rootBoundary, shouldFlip, placement, fallbackPlacements, popupComponent, autoFocus, zIndex, shouldUseCaptureOnOutsideClick, shouldRenderToParent, shouldDisableFocusLock, shouldFitContainer, }: PopupContentProps) => JSX.Element | null;
|
|
59
|
+
export {};
|
|
@@ -36,9 +36,18 @@ export type PopupTriggerProps = {
|
|
|
36
36
|
* It must be a child of the Popup component.
|
|
37
37
|
*/
|
|
38
38
|
export declare const PopupTrigger: ({ children }: PopupTriggerProps) => JSX.Element;
|
|
39
|
-
|
|
39
|
+
type CommonContentPopupProps = Pick<LegacyPopupProps, 'boundary' | 'offset' | 'onClose' | 'testId' | 'placement' | 'fallbackPlacements' | 'popupComponent' | 'shouldFlip' | 'rootBoundary' | 'autoFocus' | 'shouldRenderToParent' | 'shouldUseCaptureOnOutsideClick' | 'shouldDisableFocusLock' | 'strategy' | 'zIndex'> & {
|
|
40
40
|
children: (props: ContentProps) => React.ReactNode;
|
|
41
41
|
};
|
|
42
|
+
type ShouldFitContainerContentPopupProps = CommonContentPopupProps & {
|
|
43
|
+
shouldFitContainer: true;
|
|
44
|
+
shouldRenderToParent?: true;
|
|
45
|
+
strategy?: 'absolute';
|
|
46
|
+
};
|
|
47
|
+
type StandardPopupContentProps = CommonContentPopupProps & {
|
|
48
|
+
shouldFitContainer?: false;
|
|
49
|
+
};
|
|
50
|
+
export type PopupContentProps = ShouldFitContainerContentPopupProps | StandardPopupContentProps;
|
|
42
51
|
/**
|
|
43
52
|
* __Popup content__
|
|
44
53
|
*
|
|
@@ -46,4 +55,5 @@ export type PopupContentProps = Pick<LegacyPopupProps, 'boundary' | 'offset' | '
|
|
|
46
55
|
*
|
|
47
56
|
* It must be a child of the Popup component.
|
|
48
57
|
*/
|
|
49
|
-
export declare const PopupContent: ({ children, boundary, offset, strategy, onClose, testId, rootBoundary, shouldFlip, placement, fallbackPlacements, popupComponent, autoFocus, zIndex, shouldUseCaptureOnOutsideClick, shouldRenderToParent, shouldDisableFocusLock, }: PopupContentProps) => JSX.Element | null;
|
|
58
|
+
export declare const PopupContent: ({ children, boundary, offset, strategy, onClose, testId, rootBoundary, shouldFlip, placement, fallbackPlacements, popupComponent, autoFocus, zIndex, shouldUseCaptureOnOutsideClick, shouldRenderToParent, shouldDisableFocusLock, shouldFitContainer, }: PopupContentProps) => JSX.Element | null;
|
|
59
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/popup",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.20.1",
|
|
4
4
|
"description": "A popup displays brief content in an overlay.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
46
46
|
"@atlaskit/popper": "^6.1.0",
|
|
47
47
|
"@atlaskit/portal": "^4.6.0",
|
|
48
|
-
"@atlaskit/primitives": "^
|
|
48
|
+
"@atlaskit/primitives": "^11.0.0",
|
|
49
49
|
"@atlaskit/theme": "^12.11.0",
|
|
50
50
|
"@atlaskit/tokens": "^1.53.0",
|
|
51
51
|
"@babel/runtime": "^7.0.0",
|
|
@@ -63,14 +63,14 @@
|
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@af/accessibility-testing": "*",
|
|
65
65
|
"@af/visual-regression": "*",
|
|
66
|
-
"@atlaskit/button": "^18.
|
|
67
|
-
"@atlaskit/icon": "^22.
|
|
66
|
+
"@atlaskit/button": "^18.3.0",
|
|
67
|
+
"@atlaskit/icon": "^22.6.0",
|
|
68
68
|
"@atlaskit/ssr": "*",
|
|
69
69
|
"@atlaskit/textfield": "^6.4.0",
|
|
70
70
|
"@atlaskit/toggle": "^13.2.0",
|
|
71
71
|
"@atlaskit/visual-regression": "*",
|
|
72
72
|
"@atlassian/feature-flags-test-utils": "*",
|
|
73
|
-
"@testing-library/dom": "^
|
|
73
|
+
"@testing-library/dom": "^10.1.0",
|
|
74
74
|
"@testing-library/react": "^12.1.5",
|
|
75
75
|
"@testing-library/user-event": "^14.4.3",
|
|
76
76
|
"ast-types": "^0.13.3",
|