@atlaskit/popup 4.17.0 → 4.19.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.
Files changed (39) hide show
  1. package/CHANGELOG.md +207 -0
  2. package/dist/cjs/compositional/popup-content-top-layer.compiled.css +2 -0
  3. package/dist/cjs/compositional/popup-content-top-layer.js +135 -0
  4. package/dist/cjs/compositional/popup-content.js +36 -0
  5. package/dist/cjs/internal/top-layer-bridge.js +55 -0
  6. package/dist/cjs/popper-wrapper.js +13 -8
  7. package/dist/cjs/popup-top-layer.compiled.css +2 -0
  8. package/dist/cjs/popup-top-layer.js +185 -0
  9. package/dist/cjs/popup.js +63 -45
  10. package/dist/es2019/compositional/popup-content-top-layer.compiled.css +2 -0
  11. package/dist/es2019/compositional/popup-content-top-layer.js +140 -0
  12. package/dist/es2019/compositional/popup-content.js +36 -0
  13. package/dist/es2019/internal/top-layer-bridge.js +51 -0
  14. package/dist/es2019/popper-wrapper.js +11 -8
  15. package/dist/es2019/popup-top-layer.compiled.css +2 -0
  16. package/dist/es2019/popup-top-layer.js +193 -0
  17. package/dist/es2019/popup.js +52 -33
  18. package/dist/esm/compositional/popup-content-top-layer.compiled.css +2 -0
  19. package/dist/esm/compositional/popup-content-top-layer.js +126 -0
  20. package/dist/esm/compositional/popup-content.js +36 -0
  21. package/dist/esm/internal/top-layer-bridge.js +50 -0
  22. package/dist/esm/popper-wrapper.js +13 -8
  23. package/dist/esm/popup-top-layer.compiled.css +2 -0
  24. package/dist/esm/popup-top-layer.js +176 -0
  25. package/dist/esm/popup.js +63 -45
  26. package/dist/types/compositional/popup-content-top-layer.d.ts +21 -0
  27. package/dist/types/compositional/popup-content.d.ts +2 -2
  28. package/dist/types/internal/top-layer-bridge.d.ts +29 -0
  29. package/dist/types/popper-wrapper.d.ts +1 -1
  30. package/dist/types/popup-top-layer.d.ts +16 -0
  31. package/dist/types/types.d.ts +38 -0
  32. package/dist/types-ts4.5/compositional/popup-content-top-layer.d.ts +21 -0
  33. package/dist/types-ts4.5/compositional/popup-content.d.ts +2 -2
  34. package/dist/types-ts4.5/internal/top-layer-bridge.d.ts +29 -0
  35. package/dist/types-ts4.5/popper-wrapper.d.ts +1 -1
  36. package/dist/types-ts4.5/popup-top-layer.d.ts +16 -0
  37. package/dist/types-ts4.5/types.d.ts +38 -0
  38. package/package.json +13 -8
  39. package/offerings.json +0 -34
@@ -139,6 +139,11 @@ interface BaseProps {
139
139
  * The distance the popup should be offset from the reference in the format of [along, away] (units in px).
140
140
  * The default is `[0, 8]`, which means the popup will be `8px` away from the edge of the reference specified
141
141
  * by the `placement` prop.
142
+ *
143
+ * @private
144
+ * Note: when `platform-dst-top-layer` is enabled, both the `along` and `away`
145
+ * values are passed through to the top-layer placement (via `fromLegacyPlacement`),
146
+ * matching the legacy popper-js behaviour.
142
147
  */
143
148
  offset?: [
144
149
  number,
@@ -154,22 +159,38 @@ interface BaseProps {
154
159
  * When the preferred placement doesn't have enough space,
155
160
  * the modifier will test the ones provided in the list, and use the first suitable one.
156
161
  * If no fallback placements are suitable, it reverts back to the original placement.
162
+ *
163
+ * @private
164
+ * @deprecated No-op when `platform-dst-top-layer` is enabled — CSS Anchor Positioning
165
+ * generates fallbacks automatically via `position-try-fallbacks`.
157
166
  */
158
167
  fallbackPlacements?: Placement[];
159
168
  /**
160
169
  * The boundary element that the popup will check for overflow.
161
170
  * The default is `"clippingParents"` which are parent scroll containers,
162
171
  * but can be set to any element.
172
+ *
173
+ * @private
174
+ * @deprecated No-op when `platform-dst-top-layer` is enabled — the viewport
175
+ * is the natural boundary for top-layer elements.
163
176
  */
164
177
  boundary?: 'clippingParents' | HTMLElement;
165
178
  /**
166
179
  * The root boundary that the popup will check for overflow.
167
180
  * The default is `"viewport"` but it can be set to `"document"`.
181
+ *
182
+ * @private
183
+ * @deprecated No-op when `platform-dst-top-layer` is enabled — the viewport
184
+ * is the natural boundary for top-layer elements.
168
185
  */
169
186
  rootBoundary?: 'viewport' | 'document';
170
187
  /**
171
188
  * Allows the popup to be placed on the opposite side of its trigger if it doesn't fit in the viewport.
172
189
  * The default is `true`.
190
+ *
191
+ * @private
192
+ * @deprecated No-op when `platform-dst-top-layer` is enabled — CSS Anchor Positioning
193
+ * handles flipping natively via `position-try-fallbacks`.
173
194
  */
174
195
  shouldFlip?: boolean;
175
196
  /**
@@ -213,6 +234,10 @@ interface BaseProps {
213
234
  /**
214
235
  * The root element where the popup should be rendered.
215
236
  * Defaults to `false`.
237
+ *
238
+ * @private
239
+ * @deprecated No-op when `platform-dst-top-layer` is enabled — content always
240
+ * renders in the browser's top layer.
216
241
  */
217
242
  shouldRenderToParent?: boolean;
218
243
  /**
@@ -225,6 +250,10 @@ interface BaseProps {
225
250
  /**
226
251
  * This makes the popup close on Tab key press. It will only work when `shouldRenderToParent` is `true`.
227
252
  * The default is `false`.
253
+ *
254
+ * @private
255
+ * @deprecated No-op when `platform-dst-top-layer` is enabled — focus trapping
256
+ * is role-based in the top-layer path.
228
257
  */
229
258
  shouldDisableFocusLock?: boolean;
230
259
  /**
@@ -235,6 +264,10 @@ interface BaseProps {
235
264
  /**
236
265
  * This controls the positioning strategy to use. Can vary between `absolute` and `fixed`.
237
266
  * The default is `fixed`.
267
+ *
268
+ * @private
269
+ * @deprecated No-op when `platform-dst-top-layer` is enabled — CSS Anchor Positioning
270
+ * replaces Popper's positioning strategy.
238
271
  */
239
272
  strategy?: 'absolute' | 'fixed';
240
273
  /**
@@ -275,6 +308,10 @@ interface InternalPopupProps extends BaseProps {
275
308
  * Z-index that the popup should be displayed in.
276
309
  * This is passed to the portal component.
277
310
  * The default is 400.
311
+ *
312
+ * @private
313
+ * @deprecated No-op when `platform-dst-top-layer` is enabled — the browser's
314
+ * top layer manages stacking without z-index.
278
315
  */
279
316
  zIndex?: number;
280
317
  }
@@ -288,6 +325,7 @@ type ShouldFitContainerPopupProps = InternalPopupProps & {
288
325
  };
289
326
  export type PopupProps = StandardPopupProps | ShouldFitContainerPopupProps;
290
327
  export interface PopperWrapperProps extends BaseProps {
328
+ zIndex?: number;
291
329
  triggerRef: TriggerRef;
292
330
  }
293
331
  export type CloseManagerHook = Pick<PopupProps, 'isOpen' | 'onClose'> & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/popup",
3
- "version": "4.17.0",
3
+ "version": "4.19.0",
4
4
  "description": "A popup displays brief content in an overlay.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -42,12 +42,13 @@
42
42
  "@atlaskit/css": "^0.19.0",
43
43
  "@atlaskit/ds-lib": "^7.0.0",
44
44
  "@atlaskit/layering": "^3.7.0",
45
- "@atlaskit/motion": "^6.0.0",
45
+ "@atlaskit/motion": "^6.2.0",
46
46
  "@atlaskit/platform-feature-flags": "^1.1.0",
47
47
  "@atlaskit/popper": "^7.2.0",
48
- "@atlaskit/portal": "^5.4.0",
48
+ "@atlaskit/portal": "^5.5.0",
49
49
  "@atlaskit/primitives": "^19.0.0",
50
50
  "@atlaskit/tokens": "^13.0.0",
51
+ "@atlaskit/top-layer": "^0.6.0",
51
52
  "@babel/runtime": "^7.0.0",
52
53
  "@compiled/react": "^0.20.0",
53
54
  "bind-event-listener": "^3.0.0",
@@ -64,20 +65,21 @@
64
65
  "@af/integration-testing": "workspace:^",
65
66
  "@af/visual-regression": "workspace:^",
66
67
  "@atlaskit/button": "^23.11.0",
67
- "@atlaskit/code": "^17.4.0",
68
+ "@atlaskit/code": "^17.5.0",
68
69
  "@atlaskit/docs": "^11.8.0",
69
70
  "@atlaskit/form": "^15.5.0",
70
71
  "@atlaskit/heading": "^5.4.0",
71
- "@atlaskit/icon": "^34.3.0",
72
+ "@atlaskit/icon": "^34.5.0",
72
73
  "@atlaskit/link": "^3.4.0",
73
- "@atlaskit/modal-dialog": "^14.18.0",
74
+ "@atlaskit/modal-dialog": "^15.0.0",
74
75
  "@atlaskit/section-message": "^8.12.0",
75
76
  "@atlaskit/textfield": "^8.3.0",
76
77
  "@atlaskit/toggle": "^15.6.0",
77
- "@atlassian/feature-flags-test-utils": "^1.0.0",
78
+ "@atlassian/feature-flags-test-utils": "^1.1.0",
78
79
  "@atlassian/react-compiler-gating": "workspace:^",
79
80
  "@atlassian/ssr-tests": "workspace:^",
80
81
  "@atlassian/structured-docs-types": "workspace:^",
82
+ "@atlassian/testing-library": "^0.5.0",
81
83
  "@testing-library/react": "^16.3.0",
82
84
  "@testing-library/user-event": "^14.4.3",
83
85
  "ast-types": "^0.13.3",
@@ -111,6 +113,9 @@
111
113
  }
112
114
  },
113
115
  "platform-feature-flags": {
116
+ "platform-dst-top-layer": {
117
+ "type": "boolean"
118
+ },
114
119
  "platform_dst_popup-disable-focuslock": {
115
120
  "type": "boolean"
116
121
  },
@@ -132,7 +137,7 @@
132
137
  "platform_dst_nested_escape": {
133
138
  "type": "boolean"
134
139
  },
135
- "platform-dst-motion-uplift": {
140
+ "platform-dst-motion-uplift-popup": {
136
141
  "type": "boolean"
137
142
  }
138
143
  },
package/offerings.json DELETED
@@ -1,34 +0,0 @@
1
- [
2
- {
3
- "name": "Popup",
4
- "package": "@atlaskit/popup",
5
- "import": {
6
- "name": "Popup",
7
- "package": "@atlaskit/popup",
8
- "type": "default"
9
- },
10
- "keywords": ["popup", "overlay", "floating", "content", "trigger"],
11
- "categories": ["overlay"],
12
- "shortDescription": "A component for displaying popup content relative to a trigger element.",
13
- "status": "general-availability",
14
- "accessibilityGuidelines": [
15
- "Provide appropriate focus management",
16
- "Use clear trigger labels",
17
- "Ensure keyboard navigation support",
18
- "Provide escape key dismissal"
19
- ],
20
- "usageGuidelines": [
21
- "Use for contextual content that appears on demand",
22
- "Position appropriately relative to trigger",
23
- "Consider dismissal behavior",
24
- "Use appropriate content sizing"
25
- ],
26
- "contentGuidelines": [
27
- "Keep popup content focused and relevant",
28
- "Use clear, concise content",
29
- "Provide appropriate actions when needed",
30
- "Consider content hierarchy"
31
- ],
32
- "examples": ["./examples/ai/popup.tsx"]
33
- }
34
- ]