@atlaskit/popup 1.10.0 → 1.10.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 +56 -44
- package/dist/cjs/index.js +1 -2
- package/dist/cjs/popper-wrapper.js +9 -7
- package/dist/cjs/popup.js +4 -8
- package/dist/cjs/reposition-on-update.js +2 -3
- package/dist/cjs/use-close-manager.js +2 -3
- package/dist/cjs/use-focus-manager.js +4 -4
- package/dist/es2019/popper-wrapper.js +16 -9
- package/dist/es2019/popup.js +2 -4
- package/dist/es2019/use-focus-manager.js +2 -1
- package/dist/esm/popper-wrapper.js +8 -5
- package/dist/esm/popup.js +2 -4
- package/dist/esm/use-focus-manager.js +2 -1
- package/dist/types/popper-wrapper.d.ts +1 -1
- package/dist/types/types.d.ts +10 -5
- package/package.json +2 -9
- package/report.api.md +2 -1
- package/dist/types-ts4.5/index.d.ts +0 -4
- package/dist/types-ts4.5/popper-wrapper.d.ts +0 -4
- package/dist/types-ts4.5/popup.d.ts +0 -5
- package/dist/types-ts4.5/reposition-on-update.d.ts +0 -3
- package/dist/types-ts4.5/types.d.ts +0 -175
- package/dist/types-ts4.5/use-close-manager.d.ts +0 -2
- package/dist/types-ts4.5/use-focus-manager.d.ts +0 -2
- package/tmp/api-report-tmp.d.ts +0 -81
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
# @atlaskit/popup
|
|
2
2
|
|
|
3
|
+
## 1.10.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#41354](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41354) [`d621fe3e4f8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d621fe3e4f8) - fix ReferenceError where frameId is used before it is initialised
|
|
8
|
+
|
|
9
|
+
## 1.10.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#40515](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40515) [`a54578d2ea9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a54578d2ea9) - This removes the feature flag for the `shouldRenderToParent` prop. The prop is available for use.
|
|
14
|
+
|
|
3
15
|
## 1.10.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
6
18
|
|
|
7
|
-
- [`f355884a4aa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f355884a4aa) - [ux] Support to press escape key and only close the top layer
|
|
19
|
+
- [#39726](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39726) [`f355884a4aa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f355884a4aa) - [ux] Support to press escape key and only close the top layer
|
|
8
20
|
|
|
9
21
|
### Patch Changes
|
|
10
22
|
|
|
@@ -14,44 +26,44 @@
|
|
|
14
26
|
|
|
15
27
|
### Patch Changes
|
|
16
28
|
|
|
17
|
-
- [`84442a93613`](https://bitbucket.org/atlassian/atlassian-frontend/commits/84442a93613) - Adds support for surface detection when using design tokens. Enabling children to be styled with the surface color of the popup when using the `utility.elevation.surface.current` design token.
|
|
29
|
+
- [#39278](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39278) [`84442a93613`](https://bitbucket.org/atlassian/atlassian-frontend/commits/84442a93613) - Adds support for surface detection when using design tokens. Enabling children to be styled with the surface color of the popup when using the `utility.elevation.surface.current` design token.
|
|
18
30
|
- Updated dependencies
|
|
19
31
|
|
|
20
32
|
## 1.9.2
|
|
21
33
|
|
|
22
34
|
### Patch Changes
|
|
23
35
|
|
|
24
|
-
- [`065da872439`](https://bitbucket.org/atlassian/atlassian-frontend/commits/065da872439) - Css changes for testing the feature flag `platform.design-system-team.render-popup-in-parent_f73ij`.
|
|
36
|
+
- [#38011](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38011) [`065da872439`](https://bitbucket.org/atlassian/atlassian-frontend/commits/065da872439) - Css changes for testing the feature flag `platform.design-system-team.render-popup-in-parent_f73ij`.
|
|
25
37
|
|
|
26
38
|
## 1.9.1
|
|
27
39
|
|
|
28
40
|
### Patch Changes
|
|
29
41
|
|
|
30
|
-
- [`6a0a3c059ba`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6a0a3c059ba) - Remove unused argument from internal focus management function.
|
|
42
|
+
- [#37614](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/37614) [`6a0a3c059ba`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6a0a3c059ba) - Remove unused argument from internal focus management function.
|
|
31
43
|
|
|
32
44
|
## 1.9.0
|
|
33
45
|
|
|
34
46
|
### Minor Changes
|
|
35
47
|
|
|
36
|
-
- [`3920dcfd848`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3920dcfd848) - This removes the feature flag made for upgrading the `focus-trap` dependency and keeps `focus-trap` at it's original version.
|
|
48
|
+
- [#34797](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34797) [`3920dcfd848`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3920dcfd848) - This removes the feature flag made for upgrading the `focus-trap` dependency and keeps `focus-trap` at it's original version.
|
|
37
49
|
|
|
38
50
|
## 1.8.3
|
|
39
51
|
|
|
40
52
|
### Patch Changes
|
|
41
53
|
|
|
42
|
-
- [`4ae083a7e66`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4ae083a7e66) - Use `@af/accessibility-testing` for default jest-axe config and jest-axe import in accessibility testing.
|
|
54
|
+
- [#36754](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/36754) [`4ae083a7e66`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4ae083a7e66) - Use `@af/accessibility-testing` for default jest-axe config and jest-axe import in accessibility testing.
|
|
43
55
|
|
|
44
56
|
## 1.8.2
|
|
45
57
|
|
|
46
58
|
### Patch Changes
|
|
47
59
|
|
|
48
|
-
- [`472a62ce219`](https://bitbucket.org/atlassian/atlassian-frontend/commits/472a62ce219) - [ux] Fixes `autoFocus` functionality on upgrade of focus-trap to v7.
|
|
60
|
+
- [#36447](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/36447) [`472a62ce219`](https://bitbucket.org/atlassian/atlassian-frontend/commits/472a62ce219) - [ux] Fixes `autoFocus` functionality on upgrade of focus-trap to v7.
|
|
49
61
|
|
|
50
62
|
## 1.8.1
|
|
51
63
|
|
|
52
64
|
### Patch Changes
|
|
53
65
|
|
|
54
|
-
- [`599bfe90ee3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/599bfe90ee3) - Internal change to use shape tokens. There is no expected visual change.
|
|
66
|
+
- [#35441](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35441) [`599bfe90ee3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/599bfe90ee3) - Internal change to use shape tokens. There is no expected visual change.
|
|
55
67
|
|
|
56
68
|
## 1.8.0
|
|
57
69
|
|
|
@@ -63,37 +75,37 @@
|
|
|
63
75
|
|
|
64
76
|
### Minor Changes
|
|
65
77
|
|
|
66
|
-
- [`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.
|
|
78
|
+
- [#35092](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35092) [`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.
|
|
67
79
|
|
|
68
80
|
## 1.6.4
|
|
69
81
|
|
|
70
82
|
### Patch Changes
|
|
71
83
|
|
|
72
|
-
- [`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.
|
|
84
|
+
- [#35299](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35299) [`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.
|
|
73
85
|
|
|
74
86
|
## 1.6.3
|
|
75
87
|
|
|
76
88
|
### Patch Changes
|
|
77
89
|
|
|
78
|
-
- [`c394dbc632f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c394dbc632f) - Addresses the problem where the popup fails to close upon clicking on the iframe
|
|
90
|
+
- [#34314](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34314) [`c394dbc632f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c394dbc632f) - Addresses the problem where the popup fails to close upon clicking on the iframe
|
|
79
91
|
|
|
80
92
|
## 1.6.2
|
|
81
93
|
|
|
82
94
|
### Patch Changes
|
|
83
95
|
|
|
84
|
-
- [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
|
|
96
|
+
- [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793) [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
|
|
85
97
|
|
|
86
98
|
## 1.6.1
|
|
87
99
|
|
|
88
100
|
### Patch Changes
|
|
89
101
|
|
|
90
|
-
- [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
|
|
102
|
+
- [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649) [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
|
|
91
103
|
|
|
92
104
|
## 1.6.0
|
|
93
105
|
|
|
94
106
|
### Minor Changes
|
|
95
107
|
|
|
96
|
-
- [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
|
|
108
|
+
- [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258) [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
|
|
97
109
|
|
|
98
110
|
### Patch Changes
|
|
99
111
|
|
|
@@ -127,31 +139,31 @@
|
|
|
127
139
|
|
|
128
140
|
### Patch Changes
|
|
129
141
|
|
|
130
|
-
- [`9827dcb82b8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9827dcb82b8) - No-op change to introduce spacing tokens to design system components.
|
|
142
|
+
- [#26303](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/26303) [`9827dcb82b8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9827dcb82b8) - No-op change to introduce spacing tokens to design system components.
|
|
131
143
|
|
|
132
144
|
## 1.5.0
|
|
133
145
|
|
|
134
146
|
### Minor Changes
|
|
135
147
|
|
|
136
|
-
- [`c520e306869`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c520e306869) - Updates `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behavior change.
|
|
148
|
+
- [#24710](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24710) [`c520e306869`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c520e306869) - Updates `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behavior change.
|
|
137
149
|
|
|
138
150
|
## 1.4.2
|
|
139
151
|
|
|
140
152
|
### Patch Changes
|
|
141
153
|
|
|
142
|
-
- [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
|
|
154
|
+
- [#24874](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24874) [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
|
|
143
155
|
|
|
144
156
|
## 1.4.1
|
|
145
157
|
|
|
146
158
|
### Patch Changes
|
|
147
159
|
|
|
148
|
-
- [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
|
|
160
|
+
- [#24492](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24492) [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
|
|
149
161
|
|
|
150
162
|
## 1.4.0
|
|
151
163
|
|
|
152
164
|
### Minor Changes
|
|
153
165
|
|
|
154
|
-
- [`01d80d395bc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/01d80d395bc) - pass event to onOpenChange consistently
|
|
166
|
+
- [#23381](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/23381) [`01d80d395bc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/01d80d395bc) - pass event to onOpenChange consistently
|
|
155
167
|
|
|
156
168
|
### Patch Changes
|
|
157
169
|
|
|
@@ -162,13 +174,13 @@
|
|
|
162
174
|
|
|
163
175
|
### Patch Changes
|
|
164
176
|
|
|
165
|
-
- [`8a5bdb3c844`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8a5bdb3c844) - Upgrading internal dependency (bind-event-listener) for improved internal types
|
|
177
|
+
- [#22614](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/22614) [`8a5bdb3c844`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8a5bdb3c844) - Upgrading internal dependency (bind-event-listener) for improved internal types
|
|
166
178
|
|
|
167
179
|
## 1.3.9
|
|
168
180
|
|
|
169
181
|
### Patch Changes
|
|
170
182
|
|
|
171
|
-
- [`dcf8150c49c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dcf8150c49c) - Allow `trigger` props to be applied to any HTML element tag without causing type errors for the `ref` type
|
|
183
|
+
- [#21570](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/21570) [`dcf8150c49c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dcf8150c49c) - Allow `trigger` props to be applied to any HTML element tag without causing type errors for the `ref` type
|
|
172
184
|
|
|
173
185
|
## 1.3.8
|
|
174
186
|
|
|
@@ -180,13 +192,13 @@
|
|
|
180
192
|
|
|
181
193
|
### Patch Changes
|
|
182
194
|
|
|
183
|
-
- [`2e7bbdfd813`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e7bbdfd813) - Upgrading internal dependency 'bind-event-listener' to 2.1.0 for improved types
|
|
195
|
+
- [#21242](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/21242) [`2e7bbdfd813`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e7bbdfd813) - Upgrading internal dependency 'bind-event-listener' to 2.1.0 for improved types
|
|
184
196
|
|
|
185
197
|
## 1.3.6
|
|
186
198
|
|
|
187
199
|
### Patch Changes
|
|
188
200
|
|
|
189
|
-
- [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade to TypeScript 4.2.4
|
|
201
|
+
- [#20650](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/20650) [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade to TypeScript 4.2.4
|
|
190
202
|
|
|
191
203
|
## 1.3.5
|
|
192
204
|
|
|
@@ -210,7 +222,7 @@
|
|
|
210
222
|
|
|
211
223
|
### Patch Changes
|
|
212
224
|
|
|
213
|
-
- [`19d72473dfb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/19d72473dfb) - The no-unsafe-design-token-usage eslint rule now respects the new token naming conventions when auto-fixing by correctly formatting token ids.
|
|
225
|
+
- [#16752](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/16752) [`19d72473dfb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/19d72473dfb) - The no-unsafe-design-token-usage eslint rule now respects the new token naming conventions when auto-fixing by correctly formatting token ids.
|
|
214
226
|
- [`19d72473dfb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/19d72473dfb) - The no-unsafe-design-token-usage eslint rule now respects the new token naming conventions when auto-fixing by correctly formatting token ids.
|
|
215
227
|
- Updated dependencies
|
|
216
228
|
|
|
@@ -224,7 +236,7 @@
|
|
|
224
236
|
|
|
225
237
|
### Minor Changes
|
|
226
238
|
|
|
227
|
-
- [`2e42aa0d900`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e42aa0d900) - **Note**: It is a re-release of the wrongly `patched` version `1.1.6` that should have been a `minor` release.
|
|
239
|
+
- [#17576](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/17576) [`2e42aa0d900`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e42aa0d900) - **Note**: It is a re-release of the wrongly `patched` version `1.1.6` that should have been a `minor` release.
|
|
228
240
|
|
|
229
241
|
Expose `fallbackPlacement` modifier from to specify a list of fallback options to try incase there isn't enough space
|
|
230
242
|
|
|
@@ -236,7 +248,7 @@
|
|
|
236
248
|
|
|
237
249
|
### Minor Changes
|
|
238
250
|
|
|
239
|
-
- [`c2dd770a743`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c2dd770a743) - Add new prop which controls is outside click should be bound using capture
|
|
251
|
+
- [#16960](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/16960) [`c2dd770a743`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c2dd770a743) - Add new prop which controls is outside click should be bound using capture
|
|
240
252
|
|
|
241
253
|
## 1.1.6
|
|
242
254
|
|
|
@@ -244,7 +256,7 @@ _WRONG RELEASE TYPE - DON'T USE_
|
|
|
244
256
|
|
|
245
257
|
### Minor Changes
|
|
246
258
|
|
|
247
|
-
- [`f142150a3e8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f142150a3e8) - Expose `fallbackPlacement` modifier from to specify a list of fallback options to try incase there isn't enough space
|
|
259
|
+
- [#15998](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/15998) [`f142150a3e8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f142150a3e8) - Expose `fallbackPlacement` modifier from to specify a list of fallback options to try incase there isn't enough space
|
|
248
260
|
|
|
249
261
|
### Patch Changes
|
|
250
262
|
|
|
@@ -285,7 +297,7 @@ _WRONG RELEASE TYPE - DON'T USE_
|
|
|
285
297
|
|
|
286
298
|
### Minor Changes
|
|
287
299
|
|
|
288
|
-
- [`04cf9c3d28c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/04cf9c3d28c) - [ux] Colors now sourced from tokens.
|
|
300
|
+
- [#12837](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/12837) [`04cf9c3d28c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/04cf9c3d28c) - [ux] Colors now sourced from tokens.
|
|
289
301
|
|
|
290
302
|
### Patch Changes
|
|
291
303
|
|
|
@@ -295,31 +307,31 @@ _WRONG RELEASE TYPE - DON'T USE_
|
|
|
295
307
|
|
|
296
308
|
### Patch Changes
|
|
297
309
|
|
|
298
|
-
- [`378d1cef00f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/378d1cef00f) - Bump `@atlaskit/theme` to version `^11.3.0`.
|
|
310
|
+
- [#12880](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/12880) [`378d1cef00f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/378d1cef00f) - Bump `@atlaskit/theme` to version `^11.3.0`.
|
|
299
311
|
|
|
300
312
|
## 1.0.7
|
|
301
313
|
|
|
302
314
|
### Patch Changes
|
|
303
315
|
|
|
304
|
-
- [`d6f7ff383cf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d6f7ff383cf) - Updates to development dependency `storybook-addon-performance`
|
|
316
|
+
- [#12167](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/12167) [`d6f7ff383cf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d6f7ff383cf) - Updates to development dependency `storybook-addon-performance`
|
|
305
317
|
|
|
306
318
|
## 1.0.6
|
|
307
319
|
|
|
308
320
|
### Patch Changes
|
|
309
321
|
|
|
310
|
-
- [`1858f20ac3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1858f20ac3) - Optimised popup performance as part of the lite-mode project. Changes are internal and have no implications for component API or usage.
|
|
322
|
+
- [#6930](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/6930) [`1858f20ac3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1858f20ac3) - Optimised popup performance as part of the lite-mode project. Changes are internal and have no implications for component API or usage.
|
|
311
323
|
|
|
312
324
|
## 1.0.5
|
|
313
325
|
|
|
314
326
|
### Patch Changes
|
|
315
327
|
|
|
316
|
-
- [`d3265f19be`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d3265f19be) - Transpile packages using babel rather than tsc
|
|
328
|
+
- [#5857](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/5857) [`d3265f19be`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d3265f19be) - Transpile packages using babel rather than tsc
|
|
317
329
|
|
|
318
330
|
## 1.0.4
|
|
319
331
|
|
|
320
332
|
### Patch Changes
|
|
321
333
|
|
|
322
|
-
- [`5f58283e1f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5f58283e1f) - Export types using Typescript's new "export type" syntax to satisfy Typescript's --isolatedModules compiler option.
|
|
334
|
+
- [#5497](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/5497) [`5f58283e1f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5f58283e1f) - Export types using Typescript's new "export type" syntax to satisfy Typescript's --isolatedModules compiler option.
|
|
323
335
|
This requires version 3.8 of Typescript, read more about how we handle Typescript versions here: https://atlaskit.atlassian.com/get-started
|
|
324
336
|
Also add `typescript` to `devDependencies` to denote version that the package was built with.
|
|
325
337
|
|
|
@@ -333,13 +345,13 @@ _WRONG RELEASE TYPE - DON'T USE_
|
|
|
333
345
|
|
|
334
346
|
### Patch Changes
|
|
335
347
|
|
|
336
|
-
- [`fc8f6e61f3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fc8f6e61f3) - Fix codemod utilities being exposed through the codemod cli
|
|
348
|
+
- [#4346](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/4346) [`fc8f6e61f3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fc8f6e61f3) - Fix codemod utilities being exposed through the codemod cli
|
|
337
349
|
|
|
338
350
|
## 1.0.1
|
|
339
351
|
|
|
340
352
|
### Patch Changes
|
|
341
353
|
|
|
342
|
-
- [`6c525a8229`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6c525a8229) - Upgraded to TypeScript 3.9.6 and tslib to 2.0.0
|
|
354
|
+
- [#3885](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/3885) [`6c525a8229`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6c525a8229) - Upgraded to TypeScript 3.9.6 and tslib to 2.0.0
|
|
343
355
|
|
|
344
356
|
Since tslib is a dependency for all our packages we recommend that products also follow this tslib upgrade
|
|
345
357
|
to prevent duplicates of tslib being bundled.
|
|
@@ -348,7 +360,7 @@ _WRONG RELEASE TYPE - DON'T USE_
|
|
|
348
360
|
|
|
349
361
|
### Major Changes
|
|
350
362
|
|
|
351
|
-
- [`740e011f8d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/740e011f8d) - This first major release of popup brings in major changes from @atlaskit/popper. These changes come with performance, maintainability and behavioral improvements.
|
|
363
|
+
- [#3823](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/3823) [`740e011f8d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/740e011f8d) - This first major release of popup brings in major changes from @atlaskit/popper. These changes come with performance, maintainability and behavioral improvements.
|
|
352
364
|
|
|
353
365
|
As popup wraps popper's functionality, these changes result in a breaking change for popup as well.
|
|
354
366
|
|
|
@@ -380,7 +392,7 @@ _WRONG RELEASE TYPE - DON'T USE_
|
|
|
380
392
|
`npx @atlaskit/codemod-cli --parser [PARSER] --extensions [FILE_EXTENSIONS] [TARGET_PATH]`
|
|
381
393
|
|
|
382
394
|
Or run `npx @atlaskit/codemod-cli -h` for more details on usage.
|
|
383
|
-
For Atlassians, refer to [this doc](https://
|
|
395
|
+
For Atlassians, refer to [this doc](https://hello.atlassian.net/wiki/spaces/AF/pages/2627171992/Codemods) for more details on the codemod CLI.
|
|
384
396
|
|
|
385
397
|
### Patch Changes
|
|
386
398
|
|
|
@@ -390,13 +402,13 @@ _WRONG RELEASE TYPE - DON'T USE_
|
|
|
390
402
|
|
|
391
403
|
### Patch Changes
|
|
392
404
|
|
|
393
|
-
- [`8dd80245bb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8dd80245bb) - Remove unnecessary code for IE11.
|
|
405
|
+
- [#4329](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/4329) [`8dd80245bb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8dd80245bb) - Remove unnecessary code for IE11.
|
|
394
406
|
|
|
395
407
|
## 0.6.0
|
|
396
408
|
|
|
397
409
|
### Minor Changes
|
|
398
410
|
|
|
399
|
-
- [`87f4720f27`](https://bitbucket.org/atlassian/atlassian-frontend/commits/87f4720f27) - Officially dropping IE11 support, from this version onwards there are no warranties of the package working in IE11.
|
|
411
|
+
- [#3335](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/3335) [`87f4720f27`](https://bitbucket.org/atlassian/atlassian-frontend/commits/87f4720f27) - Officially dropping IE11 support, from this version onwards there are no warranties of the package working in IE11.
|
|
400
412
|
For more information see: https://community.developer.atlassian.com/t/atlaskit-to-drop-support-for-internet-explorer-11-from-1st-july-2020/39534
|
|
401
413
|
|
|
402
414
|
### Patch Changes
|
|
@@ -407,31 +419,31 @@ _WRONG RELEASE TYPE - DON'T USE_
|
|
|
407
419
|
|
|
408
420
|
### Minor Changes
|
|
409
421
|
|
|
410
|
-
- [`ebcb467688`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ebcb467688) - Add a new prop `autoFocus` to allow consumers to control whether the Popup takes focus when opened
|
|
422
|
+
- [#3289](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/3289) [`ebcb467688`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ebcb467688) - Add a new prop `autoFocus` to allow consumers to control whether the Popup takes focus when opened
|
|
411
423
|
|
|
412
424
|
## 0.4.3
|
|
413
425
|
|
|
414
426
|
### Patch Changes
|
|
415
427
|
|
|
416
|
-
- [`54a9514fcf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/54a9514fcf) - Build and supporting files will no longer be published to npm
|
|
428
|
+
- [#2866](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/2866) [`54a9514fcf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/54a9514fcf) - Build and supporting files will no longer be published to npm
|
|
417
429
|
|
|
418
430
|
## 0.4.2
|
|
419
431
|
|
|
420
432
|
### Patch Changes
|
|
421
433
|
|
|
422
|
-
- [`649f69b6d7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/649f69b6d7) - Patch all packages that are used by confluence that have a broken es2019 dist
|
|
434
|
+
- [#2430](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/2430) [`649f69b6d7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/649f69b6d7) - Patch all packages that are used by confluence that have a broken es2019 dist
|
|
423
435
|
|
|
424
436
|
## 0.4.1
|
|
425
437
|
|
|
426
438
|
### Patch Changes
|
|
427
439
|
|
|
428
|
-
- [`f4d4de67e4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f4d4de67e4) - Prevent closing of popup when clicked element (which is inside content) is removed from the DOM
|
|
440
|
+
- [#2186](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/2186) [`f4d4de67e4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f4d4de67e4) - Prevent closing of popup when clicked element (which is inside content) is removed from the DOM
|
|
429
441
|
|
|
430
442
|
## 0.4.0
|
|
431
443
|
|
|
432
444
|
### Minor Changes
|
|
433
445
|
|
|
434
|
-
- [`ead13374cf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ead13374cf) - **BREAKING:** Removes `tag` prop and unneeded wrapping element around the trigger.
|
|
446
|
+
- [#2060](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/2060) [`ead13374cf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ead13374cf) - **BREAKING:** Removes `tag` prop and unneeded wrapping element around the trigger.
|
|
435
447
|
|
|
436
448
|
## 0.3.5
|
|
437
449
|
|
package/dist/cjs/index.js
CHANGED
|
@@ -12,5 +12,4 @@ Object.defineProperty(exports, "Popup", {
|
|
|
12
12
|
exports.default = void 0;
|
|
13
13
|
var _popup = require("./popup");
|
|
14
14
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
15
|
-
var _default = _popup.Popup;
|
|
16
|
-
exports.default = _default;
|
|
15
|
+
var _default = exports.default = _popup.Popup;
|
|
@@ -10,7 +10,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _react = require("react");
|
|
12
12
|
var _react2 = require("@emotion/react");
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var _popper = require("@atlaskit/popper");
|
|
15
14
|
var _colors = require("@atlaskit/theme/colors");
|
|
16
15
|
var _constants = require("@atlaskit/theme/constants");
|
|
@@ -30,12 +29,14 @@ var popupStyles = (0, _react2.css)((_css = {
|
|
|
30
29
|
boxShadow: "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(_colors.N50A, ", 0 0 1px ").concat(_colors.N60A), ")")
|
|
31
30
|
}, (0, _defineProperty2.default)(_css, _tokens.CURRENT_SURFACE_CSS_VAR, "var(--ds-surface-overlay, ".concat(_colors.N0, ")")), (0, _defineProperty2.default)(_css, ':focus', {
|
|
32
31
|
outline: 'none'
|
|
33
|
-
}), _css)
|
|
32
|
+
}), _css));
|
|
33
|
+
var popupOverflowStyles = (0, _react2.css)({
|
|
34
34
|
overflow: 'auto'
|
|
35
35
|
});
|
|
36
36
|
var DefaultPopupComponent = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
37
|
+
var shouldRenderToParent = props.shouldRenderToParent;
|
|
37
38
|
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
38
|
-
css: popupStyles
|
|
39
|
+
css: [popupStyles, !shouldRenderToParent && popupOverflowStyles]
|
|
39
40
|
}, props, {
|
|
40
41
|
ref: ref
|
|
41
42
|
}));
|
|
@@ -58,7 +59,8 @@ function PopperWrapper(_ref) {
|
|
|
58
59
|
_ref$autoFocus = _ref.autoFocus,
|
|
59
60
|
autoFocus = _ref$autoFocus === void 0 ? true : _ref$autoFocus,
|
|
60
61
|
triggerRef = _ref.triggerRef,
|
|
61
|
-
shouldUseCaptureOnOutsideClick = _ref.shouldUseCaptureOnOutsideClick
|
|
62
|
+
shouldUseCaptureOnOutsideClick = _ref.shouldUseCaptureOnOutsideClick,
|
|
63
|
+
shouldRenderToParent = _ref.shouldRenderToParent;
|
|
62
64
|
var _useState = (0, _react.useState)(null),
|
|
63
65
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
64
66
|
popupRef = _useState2[0],
|
|
@@ -116,7 +118,8 @@ function PopperWrapper(_ref) {
|
|
|
116
118
|
// using tabIndex={-1} would cause a bug where Safari focuses
|
|
117
119
|
// first on the browser address bar when using keyboard
|
|
118
120
|
,
|
|
119
|
-
tabIndex: autoFocus ? 0 : undefined
|
|
121
|
+
tabIndex: autoFocus ? 0 : undefined,
|
|
122
|
+
shouldRenderToParent: shouldRenderToParent
|
|
120
123
|
}, (0, _react2.jsx)(_repositionOnUpdate.RepositionOnUpdate, {
|
|
121
124
|
update: update
|
|
122
125
|
}, content({
|
|
@@ -129,5 +132,4 @@ function PopperWrapper(_ref) {
|
|
|
129
132
|
}
|
|
130
133
|
|
|
131
134
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
132
|
-
var _default = PopperWrapper;
|
|
133
|
-
exports.default = _default;
|
|
135
|
+
var _default = exports.default = PopperWrapper;
|
package/dist/cjs/popup.js
CHANGED
|
@@ -9,7 +9,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
11
|
var _layering = require("@atlaskit/layering");
|
|
12
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
12
|
var _popper = require("@atlaskit/popper");
|
|
14
13
|
var _portal = _interopRequireDefault(require("@atlaskit/portal"));
|
|
15
14
|
var _constants = require("@atlaskit/theme/constants");
|
|
@@ -18,7 +17,7 @@ var _popperWrapper = _interopRequireDefault(require("./popper-wrapper"));
|
|
|
18
17
|
/** @jsx jsx */
|
|
19
18
|
|
|
20
19
|
var defaultLayer = _constants.layers.layer();
|
|
21
|
-
var Popup = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
20
|
+
var Popup = exports.Popup = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
22
21
|
var isOpen = _ref.isOpen,
|
|
23
22
|
id = _ref.id,
|
|
24
23
|
offset = _ref.offset,
|
|
@@ -62,6 +61,7 @@ var Popup = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
62
61
|
onClose: onClose,
|
|
63
62
|
autoFocus: autoFocus,
|
|
64
63
|
shouldUseCaptureOnOutsideClick: shouldUseCaptureOnOutsideClick,
|
|
64
|
+
shouldRenderToParent: shouldRenderToParent,
|
|
65
65
|
triggerRef: triggerRef
|
|
66
66
|
}));
|
|
67
67
|
return (0, _react2.jsx)(_popper.Manager, null, (0, _react2.jsx)(_popper.Reference, null, function (_ref2) {
|
|
@@ -81,12 +81,8 @@ var Popup = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
81
81
|
'aria-expanded': isOpen,
|
|
82
82
|
'aria-haspopup': true
|
|
83
83
|
});
|
|
84
|
-
}), isOpen && (
|
|
85
|
-
zIndex: zIndex
|
|
86
|
-
}, renderPopperWrapper) : (0, _react2.jsx)(_portal.default, {
|
|
84
|
+
}), isOpen && (shouldRenderToParent ? renderPopperWrapper : (0, _react2.jsx)(_portal.default, {
|
|
87
85
|
zIndex: zIndex
|
|
88
86
|
}, renderPopperWrapper)));
|
|
89
87
|
});
|
|
90
|
-
exports.
|
|
91
|
-
var _default = Popup;
|
|
92
|
-
exports.default = _default;
|
|
88
|
+
var _default = exports.default = Popup;
|
|
@@ -9,7 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
10
10
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
11
11
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
12
|
-
var RepositionOnUpdate = function RepositionOnUpdate(_ref) {
|
|
12
|
+
var RepositionOnUpdate = exports.RepositionOnUpdate = function RepositionOnUpdate(_ref) {
|
|
13
13
|
var children = _ref.children,
|
|
14
14
|
update = _ref.update;
|
|
15
15
|
// Ref used here to skip update on first render (when refs haven't been set)
|
|
@@ -25,5 +25,4 @@ var RepositionOnUpdate = function RepositionOnUpdate(_ref) {
|
|
|
25
25
|
|
|
26
26
|
// wrapping in fragment to make TS happy (known issue with FC returning children)
|
|
27
27
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, children);
|
|
28
|
-
};
|
|
29
|
-
exports.RepositionOnUpdate = RepositionOnUpdate;
|
|
28
|
+
};
|
|
@@ -9,7 +9,7 @@ var _react = require("react");
|
|
|
9
9
|
var _bindEventListener = require("bind-event-listener");
|
|
10
10
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
11
11
|
var _layering = require("@atlaskit/layering");
|
|
12
|
-
var useCloseManager = function useCloseManager(_ref) {
|
|
12
|
+
var useCloseManager = exports.useCloseManager = function useCloseManager(_ref) {
|
|
13
13
|
var isOpen = _ref.isOpen,
|
|
14
14
|
onClose = _ref.onClose,
|
|
15
15
|
popupRef = _ref.popupRef,
|
|
@@ -67,5 +67,4 @@ var useCloseManager = function useCloseManager(_ref) {
|
|
|
67
67
|
}]);
|
|
68
68
|
return unbind;
|
|
69
69
|
}, [isOpen, onClose, popupRef, triggerRef, capture, isLayerDisabled]);
|
|
70
|
-
};
|
|
71
|
-
exports.useCloseManager = useCloseManager;
|
|
70
|
+
};
|
|
@@ -8,7 +8,7 @@ exports.useFocusManager = void 0;
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _focusTrap = _interopRequireDefault(require("focus-trap"));
|
|
10
10
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
11
|
-
var useFocusManager = function useFocusManager(_ref) {
|
|
11
|
+
var useFocusManager = exports.useFocusManager = function useFocusManager(_ref) {
|
|
12
12
|
var popupRef = _ref.popupRef,
|
|
13
13
|
initialFocusRef = _ref.initialFocusRef;
|
|
14
14
|
(0, _react.useEffect)(function () {
|
|
@@ -23,9 +23,10 @@ var useFocusManager = function useFocusManager(_ref) {
|
|
|
23
23
|
returnFocusOnDeactivate: true
|
|
24
24
|
};
|
|
25
25
|
var focusTrap = (0, _focusTrap.default)(popupRef, trapConfig);
|
|
26
|
+
var frameId = null;
|
|
26
27
|
|
|
27
28
|
// wait for the popup to reposition itself before we focus
|
|
28
|
-
|
|
29
|
+
frameId = requestAnimationFrame(function () {
|
|
29
30
|
frameId = null;
|
|
30
31
|
focusTrap.activate();
|
|
31
32
|
});
|
|
@@ -37,5 +38,4 @@ var useFocusManager = function useFocusManager(_ref) {
|
|
|
37
38
|
focusTrap.deactivate();
|
|
38
39
|
};
|
|
39
40
|
}, [popupRef, initialFocusRef]);
|
|
40
|
-
};
|
|
41
|
-
exports.useFocusManager = useFocusManager;
|
|
41
|
+
};
|
|
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import { forwardRef, useMemo, useState } from 'react';
|
|
4
4
|
import { css, jsx } from '@emotion/react';
|
|
5
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { Popper } from '@atlaskit/popper';
|
|
7
6
|
import { N0, N50A, N60A } from '@atlaskit/theme/colors';
|
|
8
7
|
import { layers } from '@atlaskit/theme/constants';
|
|
@@ -22,14 +21,20 @@ const popupStyles = css({
|
|
|
22
21
|
':focus': {
|
|
23
22
|
outline: 'none'
|
|
24
23
|
}
|
|
25
|
-
}
|
|
24
|
+
});
|
|
25
|
+
const popupOverflowStyles = css({
|
|
26
26
|
overflow: 'auto'
|
|
27
27
|
});
|
|
28
|
-
const DefaultPopupComponent = /*#__PURE__*/forwardRef((props, ref) =>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
const DefaultPopupComponent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
29
|
+
const {
|
|
30
|
+
shouldRenderToParent
|
|
31
|
+
} = props;
|
|
32
|
+
return jsx("div", _extends({
|
|
33
|
+
css: [popupStyles, !shouldRenderToParent && popupOverflowStyles]
|
|
34
|
+
}, props, {
|
|
35
|
+
ref: ref
|
|
36
|
+
}));
|
|
37
|
+
});
|
|
33
38
|
function PopperWrapper({
|
|
34
39
|
isOpen,
|
|
35
40
|
id,
|
|
@@ -45,7 +50,8 @@ function PopperWrapper({
|
|
|
45
50
|
popupComponent: PopupContainer = DefaultPopupComponent,
|
|
46
51
|
autoFocus = true,
|
|
47
52
|
triggerRef,
|
|
48
|
-
shouldUseCaptureOnOutsideClick
|
|
53
|
+
shouldUseCaptureOnOutsideClick,
|
|
54
|
+
shouldRenderToParent
|
|
49
55
|
}) {
|
|
50
56
|
const [popupRef, setPopupRef] = useState(null);
|
|
51
57
|
const [initialFocusRef, setInitialFocusRef] = useState(null);
|
|
@@ -97,7 +103,8 @@ function PopperWrapper({
|
|
|
97
103
|
// using tabIndex={-1} would cause a bug where Safari focuses
|
|
98
104
|
// first on the browser address bar when using keyboard
|
|
99
105
|
,
|
|
100
|
-
tabIndex: autoFocus ? 0 : undefined
|
|
106
|
+
tabIndex: autoFocus ? 0 : undefined,
|
|
107
|
+
shouldRenderToParent: shouldRenderToParent
|
|
101
108
|
}, jsx(RepositionOnUpdate, {
|
|
102
109
|
update: update
|
|
103
110
|
}, content({
|
package/dist/es2019/popup.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { memo, useState } from 'react';
|
|
4
4
|
import { jsx } from '@emotion/react';
|
|
5
5
|
import { UNSAFE_LAYERING } from '@atlaskit/layering';
|
|
6
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { Manager, Reference } from '@atlaskit/popper';
|
|
8
7
|
import Portal from '@atlaskit/portal';
|
|
9
8
|
import { layers } from '@atlaskit/theme/constants';
|
|
@@ -44,6 +43,7 @@ export const Popup = /*#__PURE__*/memo(({
|
|
|
44
43
|
onClose: onClose,
|
|
45
44
|
autoFocus: autoFocus,
|
|
46
45
|
shouldUseCaptureOnOutsideClick: shouldUseCaptureOnOutsideClick,
|
|
46
|
+
shouldRenderToParent: shouldRenderToParent,
|
|
47
47
|
triggerRef: triggerRef
|
|
48
48
|
}));
|
|
49
49
|
return jsx(Manager, null, jsx(Reference, null, ({
|
|
@@ -64,9 +64,7 @@ export const Popup = /*#__PURE__*/memo(({
|
|
|
64
64
|
'aria-expanded': isOpen,
|
|
65
65
|
'aria-haspopup': true
|
|
66
66
|
});
|
|
67
|
-
}), isOpen && (
|
|
68
|
-
zIndex: zIndex
|
|
69
|
-
}, renderPopperWrapper) : jsx(Portal, {
|
|
67
|
+
}), isOpen && (shouldRenderToParent ? renderPopperWrapper : jsx(Portal, {
|
|
70
68
|
zIndex: zIndex
|
|
71
69
|
}, renderPopperWrapper)));
|
|
72
70
|
});
|
|
@@ -17,9 +17,10 @@ export const useFocusManager = ({
|
|
|
17
17
|
returnFocusOnDeactivate: true
|
|
18
18
|
};
|
|
19
19
|
const focusTrap = createFocusTrap(popupRef, trapConfig);
|
|
20
|
+
let frameId = null;
|
|
20
21
|
|
|
21
22
|
// wait for the popup to reposition itself before we focus
|
|
22
|
-
|
|
23
|
+
frameId = requestAnimationFrame(() => {
|
|
23
24
|
frameId = null;
|
|
24
25
|
focusTrap.activate();
|
|
25
26
|
});
|
|
@@ -5,7 +5,6 @@ var _css;
|
|
|
5
5
|
/** @jsx jsx */
|
|
6
6
|
import { forwardRef, useMemo, useState } from 'react';
|
|
7
7
|
import { css, jsx } from '@emotion/react';
|
|
8
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { Popper } from '@atlaskit/popper';
|
|
10
9
|
import { N0, N50A, N60A } from '@atlaskit/theme/colors';
|
|
11
10
|
import { layers } from '@atlaskit/theme/constants';
|
|
@@ -23,12 +22,14 @@ var popupStyles = css((_css = {
|
|
|
23
22
|
boxShadow: "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(N50A, ", 0 0 1px ").concat(N60A), ")")
|
|
24
23
|
}, _defineProperty(_css, CURRENT_SURFACE_CSS_VAR, "var(--ds-surface-overlay, ".concat(N0, ")")), _defineProperty(_css, ':focus', {
|
|
25
24
|
outline: 'none'
|
|
26
|
-
}), _css)
|
|
25
|
+
}), _css));
|
|
26
|
+
var popupOverflowStyles = css({
|
|
27
27
|
overflow: 'auto'
|
|
28
28
|
});
|
|
29
29
|
var DefaultPopupComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
30
|
+
var shouldRenderToParent = props.shouldRenderToParent;
|
|
30
31
|
return jsx("div", _extends({
|
|
31
|
-
css: popupStyles
|
|
32
|
+
css: [popupStyles, !shouldRenderToParent && popupOverflowStyles]
|
|
32
33
|
}, props, {
|
|
33
34
|
ref: ref
|
|
34
35
|
}));
|
|
@@ -51,7 +52,8 @@ function PopperWrapper(_ref) {
|
|
|
51
52
|
_ref$autoFocus = _ref.autoFocus,
|
|
52
53
|
autoFocus = _ref$autoFocus === void 0 ? true : _ref$autoFocus,
|
|
53
54
|
triggerRef = _ref.triggerRef,
|
|
54
|
-
shouldUseCaptureOnOutsideClick = _ref.shouldUseCaptureOnOutsideClick
|
|
55
|
+
shouldUseCaptureOnOutsideClick = _ref.shouldUseCaptureOnOutsideClick,
|
|
56
|
+
shouldRenderToParent = _ref.shouldRenderToParent;
|
|
55
57
|
var _useState = useState(null),
|
|
56
58
|
_useState2 = _slicedToArray(_useState, 2),
|
|
57
59
|
popupRef = _useState2[0],
|
|
@@ -109,7 +111,8 @@ function PopperWrapper(_ref) {
|
|
|
109
111
|
// using tabIndex={-1} would cause a bug where Safari focuses
|
|
110
112
|
// first on the browser address bar when using keyboard
|
|
111
113
|
,
|
|
112
|
-
tabIndex: autoFocus ? 0 : undefined
|
|
114
|
+
tabIndex: autoFocus ? 0 : undefined,
|
|
115
|
+
shouldRenderToParent: shouldRenderToParent
|
|
113
116
|
}, jsx(RepositionOnUpdate, {
|
|
114
117
|
update: update
|
|
115
118
|
}, content({
|
package/dist/esm/popup.js
CHANGED
|
@@ -4,7 +4,6 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
4
4
|
import { memo, useState } from 'react';
|
|
5
5
|
import { jsx } from '@emotion/react';
|
|
6
6
|
import { UNSAFE_LAYERING } from '@atlaskit/layering';
|
|
7
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { Manager, Reference } from '@atlaskit/popper';
|
|
9
8
|
import Portal from '@atlaskit/portal';
|
|
10
9
|
import { layers } from '@atlaskit/theme/constants';
|
|
@@ -54,6 +53,7 @@ export var Popup = /*#__PURE__*/memo(function (_ref) {
|
|
|
54
53
|
onClose: onClose,
|
|
55
54
|
autoFocus: autoFocus,
|
|
56
55
|
shouldUseCaptureOnOutsideClick: shouldUseCaptureOnOutsideClick,
|
|
56
|
+
shouldRenderToParent: shouldRenderToParent,
|
|
57
57
|
triggerRef: triggerRef
|
|
58
58
|
}));
|
|
59
59
|
return jsx(Manager, null, jsx(Reference, null, function (_ref2) {
|
|
@@ -73,9 +73,7 @@ export var Popup = /*#__PURE__*/memo(function (_ref) {
|
|
|
73
73
|
'aria-expanded': isOpen,
|
|
74
74
|
'aria-haspopup': true
|
|
75
75
|
});
|
|
76
|
-
}), isOpen && (
|
|
77
|
-
zIndex: zIndex
|
|
78
|
-
}, renderPopperWrapper) : jsx(Portal, {
|
|
76
|
+
}), isOpen && (shouldRenderToParent ? renderPopperWrapper : jsx(Portal, {
|
|
79
77
|
zIndex: zIndex
|
|
80
78
|
}, renderPopperWrapper)));
|
|
81
79
|
});
|
|
@@ -16,9 +16,10 @@ export var useFocusManager = function useFocusManager(_ref) {
|
|
|
16
16
|
returnFocusOnDeactivate: true
|
|
17
17
|
};
|
|
18
18
|
var focusTrap = createFocusTrap(popupRef, trapConfig);
|
|
19
|
+
var frameId = null;
|
|
19
20
|
|
|
20
21
|
// wait for the popup to reposition itself before we focus
|
|
21
|
-
|
|
22
|
+
frameId = requestAnimationFrame(function () {
|
|
22
23
|
frameId = null;
|
|
23
24
|
focusTrap.activate();
|
|
24
25
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
import { PopperWrapperProps } from './types';
|
|
3
|
-
declare function PopperWrapper({ isOpen, id, offset, testId, content, fallbackPlacements, onClose, boundary, rootBoundary, shouldFlip, placement, popupComponent: PopupContainer, autoFocus, triggerRef, shouldUseCaptureOnOutsideClick, }: PopperWrapperProps): jsx.JSX.Element;
|
|
3
|
+
declare function PopperWrapper({ isOpen, id, offset, testId, content, fallbackPlacements, onClose, boundary, rootBoundary, shouldFlip, placement, popupComponent: PopupContainer, autoFocus, triggerRef, shouldUseCaptureOnOutsideClick, shouldRenderToParent, }: PopperWrapperProps): jsx.JSX.Element;
|
|
4
4
|
export default PopperWrapper;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -56,6 +56,11 @@ export interface PopupComponentProps {
|
|
|
56
56
|
* Tab index passed through by the parent popup.
|
|
57
57
|
*/
|
|
58
58
|
tabIndex: number | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* The root element where the popup should be rendered.
|
|
61
|
+
* Defaults to `false`.
|
|
62
|
+
*/
|
|
63
|
+
shouldRenderToParent?: boolean;
|
|
59
64
|
}
|
|
60
65
|
interface BaseProps {
|
|
61
66
|
/**
|
|
@@ -134,6 +139,11 @@ interface BaseProps {
|
|
|
134
139
|
* `capture: true`.
|
|
135
140
|
*/
|
|
136
141
|
shouldUseCaptureOnOutsideClick?: boolean;
|
|
142
|
+
/**
|
|
143
|
+
* The root element where the popup should be rendered.
|
|
144
|
+
* Defaults to `false`.
|
|
145
|
+
*/
|
|
146
|
+
shouldRenderToParent?: boolean;
|
|
137
147
|
}
|
|
138
148
|
export interface PopupProps extends BaseProps {
|
|
139
149
|
/**
|
|
@@ -148,11 +158,6 @@ export interface PopupProps extends BaseProps {
|
|
|
148
158
|
* Defaults to `layers.layer()` from `@atlaskit/theme`.
|
|
149
159
|
*/
|
|
150
160
|
zIndex?: number;
|
|
151
|
-
/**
|
|
152
|
-
* The root element where the popup should be rendered.
|
|
153
|
-
* Defaults to `false`.
|
|
154
|
-
*/
|
|
155
|
-
shouldRenderToParent?: boolean;
|
|
156
161
|
}
|
|
157
162
|
export interface PopperWrapperProps extends BaseProps {
|
|
158
163
|
triggerRef: TriggerRef;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/popup",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.2",
|
|
4
4
|
"description": "A popup displays brief content in an overlay.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
39
39
|
"@atlaskit/layering": "^0.2.0",
|
|
40
|
-
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
41
40
|
"@atlaskit/popper": "^5.5.0",
|
|
42
41
|
"@atlaskit/portal": "^4.3.0",
|
|
43
42
|
"@atlaskit/theme": "^12.6.0",
|
|
@@ -59,7 +58,6 @@
|
|
|
59
58
|
"@atlaskit/ssr": "*",
|
|
60
59
|
"@atlaskit/visual-regression": "*",
|
|
61
60
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
62
|
-
"@atlassian/feature-flags-test-utils": "*",
|
|
63
61
|
"@testing-library/dom": "^8.17.1",
|
|
64
62
|
"@testing-library/react": "^12.1.5",
|
|
65
63
|
"ast-types": "^0.13.3",
|
|
@@ -96,10 +94,5 @@
|
|
|
96
94
|
}
|
|
97
95
|
},
|
|
98
96
|
"homepage": "https://atlassian.design/components/popup/",
|
|
99
|
-
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
100
|
-
"platform-feature-flags": {
|
|
101
|
-
"platform.design-system-team.render-popup-in-parent_f73ij": {
|
|
102
|
-
"type": "boolean"
|
|
103
|
-
}
|
|
104
|
-
}
|
|
97
|
+
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
105
98
|
}
|
package/report.api.md
CHANGED
|
@@ -40,6 +40,7 @@ interface BaseProps {
|
|
|
40
40
|
popupComponent?: ComponentType<PopupComponentProps>;
|
|
41
41
|
rootBoundary?: 'document' | 'viewport';
|
|
42
42
|
shouldFlip?: boolean;
|
|
43
|
+
shouldRenderToParent?: boolean;
|
|
43
44
|
shouldUseCaptureOnOutsideClick?: boolean;
|
|
44
45
|
testId?: string;
|
|
45
46
|
}
|
|
@@ -64,13 +65,13 @@ export interface PopupComponentProps {
|
|
|
64
65
|
children: ReactNode;
|
|
65
66
|
id?: string;
|
|
66
67
|
ref: Ref<HTMLDivElement>;
|
|
68
|
+
shouldRenderToParent?: boolean;
|
|
67
69
|
style: CSSProperties;
|
|
68
70
|
tabIndex: number | undefined;
|
|
69
71
|
}
|
|
70
72
|
|
|
71
73
|
// @public (undocumented)
|
|
72
74
|
export interface PopupProps extends BaseProps {
|
|
73
|
-
shouldRenderToParent?: boolean;
|
|
74
75
|
trigger: (props: TriggerProps) => React_2.ReactNode;
|
|
75
76
|
zIndex?: number;
|
|
76
77
|
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { jsx } from '@emotion/react';
|
|
2
|
-
import { PopperWrapperProps } from './types';
|
|
3
|
-
declare function PopperWrapper({ isOpen, id, offset, testId, content, fallbackPlacements, onClose, boundary, rootBoundary, shouldFlip, placement, popupComponent: PopupContainer, autoFocus, triggerRef, shouldUseCaptureOnOutsideClick, }: PopperWrapperProps): jsx.JSX.Element;
|
|
4
|
-
export default PopperWrapper;
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import React, { ComponentType, CSSProperties, Dispatch, ReactNode, Ref, SetStateAction } from 'react';
|
|
2
|
-
import { Placement, PopperChildrenProps } from '@atlaskit/popper';
|
|
3
|
-
export interface TriggerProps {
|
|
4
|
-
ref: Ref<any>;
|
|
5
|
-
'aria-controls'?: string;
|
|
6
|
-
'aria-expanded': boolean;
|
|
7
|
-
'aria-haspopup': boolean;
|
|
8
|
-
}
|
|
9
|
-
export type PopupRef = HTMLDivElement | null;
|
|
10
|
-
export type TriggerRef = HTMLElement | HTMLButtonElement | null;
|
|
11
|
-
export interface ContentProps {
|
|
12
|
-
/**
|
|
13
|
-
* Will reposition the popup if any of the content has changed.
|
|
14
|
-
* Useful for when positions change and the popup was not aware.
|
|
15
|
-
*/
|
|
16
|
-
update: PopperChildrenProps['update'];
|
|
17
|
-
/**
|
|
18
|
-
* Passed through from the parent popup.
|
|
19
|
-
*/
|
|
20
|
-
isOpen: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Passed through from the parent popup.
|
|
23
|
-
*/
|
|
24
|
-
onClose?: BaseProps['onClose'];
|
|
25
|
-
/**
|
|
26
|
-
* Escape hatch to set the initial focus for a specific element when the popup is opened.
|
|
27
|
-
*/
|
|
28
|
-
setInitialFocusRef: Dispatch<SetStateAction<HTMLElement | null>>;
|
|
29
|
-
}
|
|
30
|
-
export interface PopupComponentProps {
|
|
31
|
-
/**
|
|
32
|
-
* Children passed passed through by the parent popup.
|
|
33
|
-
*/
|
|
34
|
-
children: ReactNode;
|
|
35
|
-
/**
|
|
36
|
-
* Placement passed through by the parent popup.
|
|
37
|
-
*/
|
|
38
|
-
'data-placement': Placement;
|
|
39
|
-
/**
|
|
40
|
-
* Test id passed through by the parent popup.
|
|
41
|
-
*/
|
|
42
|
-
'data-testid'?: string;
|
|
43
|
-
/**
|
|
44
|
-
* Id passed through by the parent popup.
|
|
45
|
-
*/
|
|
46
|
-
id?: string;
|
|
47
|
-
/**
|
|
48
|
-
* Ref that should be assigned to the root element.
|
|
49
|
-
*/
|
|
50
|
-
ref: Ref<HTMLDivElement>;
|
|
51
|
-
/**
|
|
52
|
-
* Style that should be assigned to the root element.
|
|
53
|
-
*/
|
|
54
|
-
style: CSSProperties;
|
|
55
|
-
/**
|
|
56
|
-
* Tab index passed through by the parent popup.
|
|
57
|
-
*/
|
|
58
|
-
tabIndex: number | undefined;
|
|
59
|
-
}
|
|
60
|
-
interface BaseProps {
|
|
61
|
-
/**
|
|
62
|
-
* Used to either show or hide the popup.
|
|
63
|
-
* When set to `false` popup will not render anything to the DOM.
|
|
64
|
-
*/
|
|
65
|
-
isOpen: boolean;
|
|
66
|
-
/**
|
|
67
|
-
* Render props for content that is displayed inside the popup.
|
|
68
|
-
*/
|
|
69
|
-
content: (props: ContentProps) => React.ReactNode;
|
|
70
|
-
/**
|
|
71
|
-
* Id that is assigned to the popup container element.
|
|
72
|
-
*/
|
|
73
|
-
id?: string;
|
|
74
|
-
/**
|
|
75
|
-
* Distance the popup should be offset from the reference in the format of [along, away] (units in px).
|
|
76
|
-
* Defaults to [0, 8] - which means the popup will be 8px away from the edge of the reference specified
|
|
77
|
-
* by the `placement` prop.
|
|
78
|
-
*/
|
|
79
|
-
offset?: [
|
|
80
|
-
number,
|
|
81
|
-
number
|
|
82
|
-
];
|
|
83
|
-
/**
|
|
84
|
-
* Placement of where the popup should be displayed relative to the trigger element.
|
|
85
|
-
* Defaults to `"auto"`.
|
|
86
|
-
*/
|
|
87
|
-
placement?: Placement;
|
|
88
|
-
/**
|
|
89
|
-
* Defines a list of placements to try.
|
|
90
|
-
* When no space is available on the preferred placement,
|
|
91
|
-
* the modifier will test the ones provided in the list, and use the first suitable one.
|
|
92
|
-
* If no fallback placements are suitable, it reverts back to the original placement.
|
|
93
|
-
*/
|
|
94
|
-
fallbackPlacements?: Placement[];
|
|
95
|
-
/**
|
|
96
|
-
* The boundary element that the popup will check for overflow.
|
|
97
|
-
* Defaults to `"clippingParents"` which are parent scroll containers,
|
|
98
|
-
* but can be set to any element.
|
|
99
|
-
*/
|
|
100
|
-
boundary?: 'clippingParents' | HTMLElement;
|
|
101
|
-
/**
|
|
102
|
-
* The root boundary that the popup will check for overflow.
|
|
103
|
-
* Defaults to `"viewport"` but can be set to `"document"`.
|
|
104
|
-
*/
|
|
105
|
-
rootBoundary?: 'viewport' | 'document';
|
|
106
|
-
/**
|
|
107
|
-
* Allows the Popup to be placed on the opposite side of its trigger if it does not fit in the viewport.
|
|
108
|
-
* Defaults to `true`.
|
|
109
|
-
*/
|
|
110
|
-
shouldFlip?: boolean;
|
|
111
|
-
/**
|
|
112
|
-
* A `testId` prop is provided for specified elements,
|
|
113
|
-
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
114
|
-
* serving as a hook for automated tests.
|
|
115
|
-
*/
|
|
116
|
-
testId?: string;
|
|
117
|
-
/**
|
|
118
|
-
* Handler that is called when the popup wants to close itself.
|
|
119
|
-
* Generally this will be either when clicking away from the popup or pressing the escape key.
|
|
120
|
-
* You'll want to use this to set open state accordingly and then pump it back into the `isOpen` prop.
|
|
121
|
-
*/
|
|
122
|
-
onClose?(event: Event | React.MouseEvent | React.KeyboardEvent): void;
|
|
123
|
-
/**
|
|
124
|
-
* The element that is shown when `isOpen` prop is `true`.
|
|
125
|
-
* The result of the `content` prop will be placed as children here.
|
|
126
|
-
* Defaults to an element with an elevation of `e200` with _no padding_.
|
|
127
|
-
*/
|
|
128
|
-
popupComponent?: ComponentType<PopupComponentProps>;
|
|
129
|
-
/**
|
|
130
|
-
* Controls whether the popup takes focus when opening.
|
|
131
|
-
* This changes the `popupComponent` component tabIndex to `null`.
|
|
132
|
-
* Defaults to `true`.
|
|
133
|
-
*/
|
|
134
|
-
autoFocus?: boolean;
|
|
135
|
-
/**
|
|
136
|
-
* Controls if the event which handles clicks outside the popup is be bound with
|
|
137
|
-
* `capture: true`.
|
|
138
|
-
*/
|
|
139
|
-
shouldUseCaptureOnOutsideClick?: boolean;
|
|
140
|
-
}
|
|
141
|
-
export interface PopupProps extends BaseProps {
|
|
142
|
-
/**
|
|
143
|
-
* Render props used to anchor the popup to your content.
|
|
144
|
-
* Make this an interactive element,
|
|
145
|
-
* such as an `@atlaskit/button` component.
|
|
146
|
-
*/
|
|
147
|
-
trigger: (props: TriggerProps) => React.ReactNode;
|
|
148
|
-
/**
|
|
149
|
-
* Z-index that the popup should be displayed in.
|
|
150
|
-
* This is passed to the portal component.
|
|
151
|
-
* Defaults to `layers.layer()` from `@atlaskit/theme`.
|
|
152
|
-
*/
|
|
153
|
-
zIndex?: number;
|
|
154
|
-
/**
|
|
155
|
-
* The root element where the popup should be rendered.
|
|
156
|
-
* Defaults to `false`.
|
|
157
|
-
*/
|
|
158
|
-
shouldRenderToParent?: boolean;
|
|
159
|
-
}
|
|
160
|
-
export interface PopperWrapperProps extends BaseProps {
|
|
161
|
-
triggerRef: TriggerRef;
|
|
162
|
-
}
|
|
163
|
-
export type CloseManagerHook = Pick<PopupProps, 'isOpen' | 'onClose'> & {
|
|
164
|
-
popupRef: PopupRef;
|
|
165
|
-
triggerRef: TriggerRef;
|
|
166
|
-
shouldUseCaptureOnOutsideClick?: boolean;
|
|
167
|
-
};
|
|
168
|
-
export type FocusManagerHook = {
|
|
169
|
-
popupRef: PopupRef;
|
|
170
|
-
initialFocusRef: HTMLElement | null;
|
|
171
|
-
};
|
|
172
|
-
export type RepositionOnUpdateProps = {
|
|
173
|
-
update: PopperChildrenProps['update'];
|
|
174
|
-
};
|
|
175
|
-
export {};
|
package/tmp/api-report-tmp.d.ts
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
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
|
-
```
|