@atlaskit/popup 9.0.1 → 9.0.3

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 CHANGED
@@ -1,5 +1,24 @@
1
1
  # @atlaskit/popup
2
2
 
3
+ ## 9.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`cf31b7db11afe`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cf31b7db11afe) -
8
+ Isolate container content from parent entry and exit motion behind
9
+ platform-dst-motion-isolate-presence, so nested tags animate only for their own changes.
10
+ - Updated dependencies
11
+
12
+ ## 9.0.2
13
+
14
+ ### Patch Changes
15
+
16
+ - [`c0d0247b0e650`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c0d0247b0e650) -
17
+ With `platform-dst-top-layer` enabled, restore the raw `testId` on the default popup content
18
+ wrapper. Custom `popupComponent` implementations continue receiving the raw ID. The popover host
19
+ uses `${testId}--container` instead of `${testId}--content`, matching legacy Popup test ID naming
20
+ in both APIs.
21
+
3
22
  ## 9.0.1
4
23
 
5
24
  ### Patch Changes
@@ -190,7 +190,7 @@ function PopupContentTopLayer(_ref) {
190
190
  shouldAnimate: true,
191
191
  placement: topLayerPlacement,
192
192
  onClose: handleOnClose,
193
- testId: testId && "".concat(testId, "--content")
193
+ testId: testId && "".concat(testId, "--container")
194
194
  }), Container ? /*#__PURE__*/React.createElement(Container, {
195
195
  style: EMPTY_STYLE,
196
196
  id: providedId,
@@ -212,6 +212,7 @@ function PopupContentTopLayer(_ref) {
212
212
  // level in. Same shape as `../popup-top-layer.tsx`.
213
213
  React.createElement(_popoverSurface.PopoverSurface, null, /*#__PURE__*/React.createElement("div", {
214
214
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
215
- className: xcss
215
+ className: xcss,
216
+ "data-testid": testId
216
217
  }, children(contentProps))));
217
218
  }
@@ -18,6 +18,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
18
18
  var _runtime = require("@compiled/react/runtime");
19
19
  var _useLayering2 = require("@atlaskit/layering/use-layering");
20
20
  var _motion = _interopRequireDefault(require("@atlaskit/motion/entering/motion"));
21
+ var _motionPresenceBoundary = _interopRequireDefault(require("@atlaskit/motion/motion-presence-boundary"));
21
22
  var _fg = require("@atlaskit/platform-feature-flags/fg");
22
23
  var _main = require("@atlaskit/popper/main");
23
24
  var _repositionOnUpdate = require("./reposition-on-update");
@@ -235,12 +236,12 @@ function PopperWrapper(_ref) {
235
236
  isReferenceHidden: isReferenceHidden
236
237
  }, /*#__PURE__*/React.createElement(_repositionOnUpdate.RepositionOnUpdate, {
237
238
  update: update
238
- }, content({
239
+ }, /*#__PURE__*/React.createElement(_motionPresenceBoundary.default, null, content({
239
240
  update: update,
240
241
  isOpen: isOpen,
241
242
  onClose: onClose,
242
243
  setInitialFocusRef: setInitialFocusRef
243
- })));
244
+ }))));
244
245
  var isAutoPlacement = placement === 'auto' || placement === 'auto-start' || placement === 'auto-end';
245
246
  var container = /*#__PURE__*/React.createElement("div", {
246
247
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
@@ -13,6 +13,7 @@ var _runtime = require("@compiled/react/runtime");
13
13
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
14
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
15
  var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
16
+ var _motionPresenceBoundary = _interopRequireDefault(require("@atlaskit/motion/motion-presence-boundary"));
16
17
  var _getAriaForTrigger = require("@atlaskit/top-layer/get-aria-for-trigger");
17
18
  var _index = require("@atlaskit/top-layer/placement-map/index");
18
19
  var _popoverSurface = require("@atlaskit/top-layer/popover-surface");
@@ -221,7 +222,7 @@ var PopupTopLayer = exports.PopupTopLayer = /*#__PURE__*/(0, _react.memo)(functi
221
222
  onClose: handleOnClose,
222
223
  shouldAnimate: true,
223
224
  placement: topLayerPlacement,
224
- testId: testId && "".concat(testId, "--content")
225
+ testId: testId && "".concat(testId, "--container")
225
226
  }), Container ? /*#__PURE__*/React.createElement(Container, {
226
227
  style: EMPTY_STYLE,
227
228
  id: providedId,
@@ -233,7 +234,7 @@ var PopupTopLayer = exports.PopupTopLayer = /*#__PURE__*/(0, _react.memo)(functi
233
234
  // `overflow: auto` branch off it.
234
235
  ,
235
236
  shouldFitViewport: shouldFitViewport
236
- }, content(contentProps)) :
237
+ }, /*#__PURE__*/React.createElement(_motionPresenceBoundary.default, null, content(contentProps))) :
237
238
  /*#__PURE__*/
238
239
  // `PopoverSurface` owns `overflow: auto` and the `box-shadow` on the
239
240
  // same element, so it is the scroll container. The wrapper exists only
@@ -243,6 +244,7 @@ var PopupTopLayer = exports.PopupTopLayer = /*#__PURE__*/(0, _react.memo)(functi
243
244
  // level in. Same shape as `compositional/popup-content-top-layer.tsx`.
244
245
  React.createElement(_popoverSurface.PopoverSurface, null, /*#__PURE__*/React.createElement("div", {
245
246
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
246
- className: xcss
247
- }, content(contentProps)))));
247
+ className: xcss,
248
+ "data-testid": testId
249
+ }, /*#__PURE__*/React.createElement(_motionPresenceBoundary.default, null, content(contentProps))))));
248
250
  });
package/dist/cjs/popup.js CHANGED
@@ -20,7 +20,7 @@ var _fg = require("@atlaskit/platform-feature-flags/fg");
20
20
  var _manager = require("@atlaskit/popper/manager");
21
21
  var _reference = require("@atlaskit/popper/reference");
22
22
  var _portal = _interopRequireDefault(require("@atlaskit/portal/portal"));
23
- var _compiled = require("@atlaskit/primitives/compiled");
23
+ var _box = require("@atlaskit/primitives/compiled/box");
24
24
  var _popperWrapper = _interopRequireDefault(require("./popper-wrapper"));
25
25
  var _popupTopLayer = require("./popup-top-layer");
26
26
  var _useAppearance = require("./use-appearance");
@@ -153,7 +153,7 @@ var PopupLegacy = function PopupLegacy(props) {
153
153
  zIndex: zIndex
154
154
  }, renderPopperWrapper))));
155
155
  if (shouldFitContainer) {
156
- return /*#__PURE__*/React.createElement(_compiled.Box, {
156
+ return /*#__PURE__*/React.createElement(_box.Box, {
157
157
  xcss: wrapperStyles.root
158
158
  }, popupContent);
159
159
  }
@@ -8,7 +8,7 @@ exports.usePopupAppearance = usePopupAppearance;
8
8
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
9
  var _react = require("react");
10
10
  var _fg = require("@atlaskit/platform-feature-flags/fg");
11
- var _compiled = require("@atlaskit/primitives/compiled");
11
+ var _useMediaQuery = require("@atlaskit/primitives/compiled/use-media-query");
12
12
  /**
13
13
  * **usePopupAppearance()**
14
14
  *
@@ -27,7 +27,7 @@ function usePopupAppearance(_ref) {
27
27
  * The state change is only needed if the popup can become a modal - and this is maintained
28
28
  */
29
29
  var shouldUseMediaQuery = !(0, _fg.fg)('platform_dst_popup_media_query_perf_fix') || canBecomeModal;
30
- var mq = (0, _compiled.UNSAFE_useMediaQuery)('below.sm', shouldUseMediaQuery ? function (e) {
30
+ var mq = (0, _useMediaQuery.UNSAFE_useMediaQuery)('below.sm', shouldUseMediaQuery ? function (e) {
31
31
  setIsSmallViewport(!!e.matches);
32
32
  } : undefined);
33
33
  var _useState = (0, _react.useState)(!!(mq !== null && mq !== void 0 && mq.matches)),
@@ -196,7 +196,7 @@ export function PopupContentTopLayer({
196
196
  shouldAnimate: true,
197
197
  placement: topLayerPlacement,
198
198
  onClose: handleOnClose,
199
- testId: testId && `${testId}--content`
199
+ testId: testId && `${testId}--container`
200
200
  }), Container ? /*#__PURE__*/React.createElement(Container, {
201
201
  style: EMPTY_STYLE,
202
202
  id: providedId,
@@ -218,6 +218,7 @@ export function PopupContentTopLayer({
218
218
  // level in. Same shape as `../popup-top-layer.tsx`.
219
219
  React.createElement(PopoverSurface, null, /*#__PURE__*/React.createElement("div", {
220
220
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
221
- className: xcss
221
+ className: xcss,
222
+ "data-testid": testId
222
223
  }, children(contentProps))));
223
224
  }
@@ -6,6 +6,7 @@ import { forwardRef, Fragment, useMemo, useState } from 'react';
6
6
  import { ax, ix } from '@compiled/react/runtime';
7
7
  import { useLayering } from '@atlaskit/layering/use-layering';
8
8
  import Motion from '@atlaskit/motion/entering/motion';
9
+ import MotionPresenceBoundary from '@atlaskit/motion/motion-presence-boundary';
9
10
  import { fg } from '@atlaskit/platform-feature-flags/fg';
10
11
  import { Popper } from '@atlaskit/popper/main';
11
12
  import { RepositionOnUpdate } from './reposition-on-update';
@@ -211,12 +212,12 @@ function PopperWrapper({
211
212
  isReferenceHidden: isReferenceHidden
212
213
  }, /*#__PURE__*/React.createElement(RepositionOnUpdate, {
213
214
  update: update
214
- }, content({
215
+ }, /*#__PURE__*/React.createElement(MotionPresenceBoundary, null, content({
215
216
  update,
216
217
  isOpen,
217
218
  onClose,
218
219
  setInitialFocusRef
219
- })));
220
+ }))));
220
221
  const isAutoPlacement = placement === 'auto' || placement === 'auto-start' || placement === 'auto-end';
221
222
  const container = /*#__PURE__*/React.createElement("div", {
222
223
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
@@ -4,6 +4,7 @@ import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import { Fragment, memo, useCallback, useEffect, useMemo, useRef } from 'react';
6
6
  import noop from '@atlaskit/ds-lib/noop';
7
+ import MotionPresenceBoundary from '@atlaskit/motion/motion-presence-boundary';
7
8
  import { getAriaForTrigger } from '@atlaskit/top-layer/get-aria-for-trigger';
8
9
  import { fromLegacyPlacement } from '@atlaskit/top-layer/placement-map/index';
9
10
  import { PopoverSurface } from '@atlaskit/top-layer/popover-surface';
@@ -233,7 +234,7 @@ export const PopupTopLayer = /*#__PURE__*/memo(function PopupTopLayer({
233
234
  onClose: handleOnClose,
234
235
  shouldAnimate: true,
235
236
  placement: topLayerPlacement,
236
- testId: testId && `${testId}--content`
237
+ testId: testId && `${testId}--container`
237
238
  }), Container ? /*#__PURE__*/React.createElement(Container, {
238
239
  style: EMPTY_STYLE,
239
240
  id: providedId,
@@ -245,7 +246,7 @@ export const PopupTopLayer = /*#__PURE__*/memo(function PopupTopLayer({
245
246
  // `overflow: auto` branch off it.
246
247
  ,
247
248
  shouldFitViewport: shouldFitViewport
248
- }, content(contentProps)) :
249
+ }, /*#__PURE__*/React.createElement(MotionPresenceBoundary, null, content(contentProps))) :
249
250
  /*#__PURE__*/
250
251
  // `PopoverSurface` owns `overflow: auto` and the `box-shadow` on the
251
252
  // same element, so it is the scroll container. The wrapper exists only
@@ -255,6 +256,7 @@ export const PopupTopLayer = /*#__PURE__*/memo(function PopupTopLayer({
255
256
  // level in. Same shape as `compositional/popup-content-top-layer.tsx`.
256
257
  React.createElement(PopoverSurface, null, /*#__PURE__*/React.createElement("div", {
257
258
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
258
- className: xcss
259
- }, content(contentProps)))));
259
+ className: xcss,
260
+ "data-testid": testId
261
+ }, /*#__PURE__*/React.createElement(MotionPresenceBoundary, null, content(contentProps))))));
260
262
  });
@@ -12,7 +12,7 @@ import { fg } from '@atlaskit/platform-feature-flags/fg';
12
12
  import { Manager } from '@atlaskit/popper/manager';
13
13
  import { Reference } from '@atlaskit/popper/reference';
14
14
  import Portal from '@atlaskit/portal/portal';
15
- import { Box } from '@atlaskit/primitives/compiled';
15
+ import { Box } from '@atlaskit/primitives/compiled/box';
16
16
  import PopperWrapper from './popper-wrapper';
17
17
  import { PopupTopLayer } from './popup-top-layer';
18
18
  import { usePopupAppearance } from './use-appearance';
@@ -1,6 +1,6 @@
1
1
  import { useState } from 'react';
2
2
  import { fg } from '@atlaskit/platform-feature-flags/fg';
3
- import { UNSAFE_useMediaQuery as useMediaQuery } from '@atlaskit/primitives/compiled';
3
+ import { UNSAFE_useMediaQuery as useMediaQuery } from '@atlaskit/primitives/compiled/use-media-query';
4
4
 
5
5
  /**
6
6
  * **usePopupAppearance()**
@@ -182,7 +182,7 @@ export function PopupContentTopLayer(_ref) {
182
182
  shouldAnimate: true,
183
183
  placement: topLayerPlacement,
184
184
  onClose: handleOnClose,
185
- testId: testId && "".concat(testId, "--content")
185
+ testId: testId && "".concat(testId, "--container")
186
186
  }), Container ? /*#__PURE__*/React.createElement(Container, {
187
187
  style: EMPTY_STYLE,
188
188
  id: providedId,
@@ -204,6 +204,7 @@ export function PopupContentTopLayer(_ref) {
204
204
  // level in. Same shape as `../popup-top-layer.tsx`.
205
205
  React.createElement(PopoverSurface, null, /*#__PURE__*/React.createElement("div", {
206
206
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
207
- className: xcss
207
+ className: xcss,
208
+ "data-testid": testId
208
209
  }, children(contentProps))));
209
210
  }
@@ -13,6 +13,7 @@ import { forwardRef, Fragment, useMemo, useState } from 'react';
13
13
  import { ax, ix } from '@compiled/react/runtime';
14
14
  import { useLayering } from '@atlaskit/layering/use-layering';
15
15
  import Motion from '@atlaskit/motion/entering/motion';
16
+ import MotionPresenceBoundary from '@atlaskit/motion/motion-presence-boundary';
16
17
  import { fg } from '@atlaskit/platform-feature-flags/fg';
17
18
  import { Popper } from '@atlaskit/popper/main';
18
19
  import { RepositionOnUpdate } from './reposition-on-update';
@@ -226,12 +227,12 @@ function PopperWrapper(_ref) {
226
227
  isReferenceHidden: isReferenceHidden
227
228
  }, /*#__PURE__*/React.createElement(RepositionOnUpdate, {
228
229
  update: update
229
- }, content({
230
+ }, /*#__PURE__*/React.createElement(MotionPresenceBoundary, null, content({
230
231
  update: update,
231
232
  isOpen: isOpen,
232
233
  onClose: onClose,
233
234
  setInitialFocusRef: setInitialFocusRef
234
- })));
235
+ }))));
235
236
  var isAutoPlacement = placement === 'auto' || placement === 'auto-start' || placement === 'auto-end';
236
237
  var container = /*#__PURE__*/React.createElement("div", {
237
238
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
@@ -7,6 +7,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
7
7
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
8
8
  import { Fragment, memo, useCallback, useEffect, useMemo, useRef } from 'react';
9
9
  import noop from '@atlaskit/ds-lib/noop';
10
+ import MotionPresenceBoundary from '@atlaskit/motion/motion-presence-boundary';
10
11
  import { getAriaForTrigger } from '@atlaskit/top-layer/get-aria-for-trigger';
11
12
  import { fromLegacyPlacement } from '@atlaskit/top-layer/placement-map/index';
12
13
  import { PopoverSurface } from '@atlaskit/top-layer/popover-surface';
@@ -212,7 +213,7 @@ export var PopupTopLayer = /*#__PURE__*/memo(function PopupTopLayer(_ref) {
212
213
  onClose: handleOnClose,
213
214
  shouldAnimate: true,
214
215
  placement: topLayerPlacement,
215
- testId: testId && "".concat(testId, "--content")
216
+ testId: testId && "".concat(testId, "--container")
216
217
  }), Container ? /*#__PURE__*/React.createElement(Container, {
217
218
  style: EMPTY_STYLE,
218
219
  id: providedId,
@@ -224,7 +225,7 @@ export var PopupTopLayer = /*#__PURE__*/memo(function PopupTopLayer(_ref) {
224
225
  // `overflow: auto` branch off it.
225
226
  ,
226
227
  shouldFitViewport: shouldFitViewport
227
- }, content(contentProps)) :
228
+ }, /*#__PURE__*/React.createElement(MotionPresenceBoundary, null, content(contentProps))) :
228
229
  /*#__PURE__*/
229
230
  // `PopoverSurface` owns `overflow: auto` and the `box-shadow` on the
230
231
  // same element, so it is the scroll container. The wrapper exists only
@@ -234,6 +235,7 @@ export var PopupTopLayer = /*#__PURE__*/memo(function PopupTopLayer(_ref) {
234
235
  // level in. Same shape as `compositional/popup-content-top-layer.tsx`.
235
236
  React.createElement(PopoverSurface, null, /*#__PURE__*/React.createElement("div", {
236
237
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
237
- className: xcss
238
- }, content(contentProps)))));
238
+ className: xcss,
239
+ "data-testid": testId
240
+ }, /*#__PURE__*/React.createElement(MotionPresenceBoundary, null, content(contentProps))))));
239
241
  });
package/dist/esm/popup.js CHANGED
@@ -14,7 +14,7 @@ import { fg } from '@atlaskit/platform-feature-flags/fg';
14
14
  import { Manager } from '@atlaskit/popper/manager';
15
15
  import { Reference } from '@atlaskit/popper/reference';
16
16
  import Portal from '@atlaskit/portal/portal';
17
- import { Box } from '@atlaskit/primitives/compiled';
17
+ import { Box } from '@atlaskit/primitives/compiled/box';
18
18
  import PopperWrapper from './popper-wrapper';
19
19
  import { PopupTopLayer } from './popup-top-layer';
20
20
  import { usePopupAppearance } from './use-appearance';
@@ -1,7 +1,7 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import { useState } from 'react';
3
3
  import { fg } from '@atlaskit/platform-feature-flags/fg';
4
- import { UNSAFE_useMediaQuery as useMediaQuery } from '@atlaskit/primitives/compiled';
4
+ import { UNSAFE_useMediaQuery as useMediaQuery } from '@atlaskit/primitives/compiled/use-media-query';
5
5
 
6
6
  /**
7
7
  * **usePopupAppearance()**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/popup",
3
- "version": "9.0.1",
3
+ "version": "9.0.3",
4
4
  "description": "A popup displays brief content in an overlay.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -37,13 +37,13 @@
37
37
  "@atlaskit/css": "^1.1.0",
38
38
  "@atlaskit/ds-lib": "^8.0.0",
39
39
  "@atlaskit/layering": "^6.0.0",
40
- "@atlaskit/motion": "^9.3.0",
40
+ "@atlaskit/motion": "^9.4.0",
41
41
  "@atlaskit/platform-feature-flags": "^2.2.0",
42
42
  "@atlaskit/popper": "^9.4.0",
43
43
  "@atlaskit/portal": "^7.0.0",
44
44
  "@atlaskit/primitives": "^22.5.0",
45
45
  "@atlaskit/react-compiler-gating": "^0.2.0",
46
- "@atlaskit/tokens": "^20.3.0",
46
+ "@atlaskit/tokens": "^20.4.0",
47
47
  "@atlaskit/top-layer": "^6.2.0",
48
48
  "@babel/runtime": "^7.0.0",
49
49
  "@compiled/react": "^1.0.2",