@atlaskit/popup 1.9.1 → 1.9.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,18 @@
1
1
  # @atlaskit/popup
2
2
 
3
+ ## 1.9.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`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.
8
+ - Updated dependencies
9
+
10
+ ## 1.9.2
11
+
12
+ ### Patch Changes
13
+
14
+ - [`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`.
15
+
3
16
  ## 1.9.1
4
17
 
5
18
  ### Patch Changes
@@ -7,28 +7,31 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
11
  var _react = require("react");
11
12
  var _react2 = require("@emotion/react");
13
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
14
  var _popper = require("@atlaskit/popper");
13
15
  var _colors = require("@atlaskit/theme/colors");
14
16
  var _constants = require("@atlaskit/theme/constants");
17
+ var _tokens = require("@atlaskit/tokens");
15
18
  var _repositionOnUpdate = require("./reposition-on-update");
16
19
  var _useCloseManager = require("./use-close-manager");
17
20
  var _useFocusManager = require("./use-focus-manager");
21
+ var _css;
18
22
  /** @jsx jsx */
19
-
20
- var popupStyles = (0, _react2.css)({
23
+ var popupStyles = (0, _react2.css)((_css = {
21
24
  display: 'block',
22
25
  boxSizing: 'border-box',
23
26
  zIndex: _constants.layers.layer(),
24
27
  flex: '1 1 auto',
25
28
  backgroundColor: "var(--ds-surface-overlay, ".concat(_colors.N0, ")"),
26
29
  borderRadius: "var(--ds-border-radius, 3px)",
27
- boxShadow: "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(_colors.N50A, ", 0 0 1px ").concat(_colors.N60A), ")"),
28
- overflow: 'auto',
29
- ':focus': {
30
- outline: 'none'
31
- }
30
+ boxShadow: "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(_colors.N50A, ", 0 0 1px ").concat(_colors.N60A), ")")
31
+ }, (0, _defineProperty2.default)(_css, _tokens.CURRENT_SURFACE_CSS_VAR, "var(--ds-surface-overlay, ".concat(_colors.N0, ")")), (0, _defineProperty2.default)(_css, ':focus', {
32
+ outline: 'none'
33
+ }), _css), !(0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.render-popup-in-parent_f73ij') && {
34
+ overflow: 'auto'
32
35
  });
33
36
  var DefaultPopupComponent = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
34
37
  return (0, _react2.jsx)("div", (0, _extends2.default)({
package/dist/cjs/popup.js CHANGED
@@ -46,25 +46,23 @@ var Popup = /*#__PURE__*/(0, _react.memo)(function (_ref) {
46
46
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
47
47
  triggerRef = _useState2[0],
48
48
  setTriggerRef = _useState2[1];
49
- var renderPopperWrapper = function renderPopperWrapper() {
50
- return (0, _react2.jsx)(_popperWrapper.default, {
51
- content: content,
52
- isOpen: isOpen,
53
- placement: placement,
54
- fallbackPlacements: fallbackPlacements,
55
- boundary: boundary,
56
- rootBoundary: rootBoundary,
57
- shouldFlip: shouldFlip,
58
- offset: offset,
59
- popupComponent: PopupContainer,
60
- id: id,
61
- testId: testId,
62
- onClose: onClose,
63
- autoFocus: autoFocus,
64
- shouldUseCaptureOnOutsideClick: shouldUseCaptureOnOutsideClick,
65
- triggerRef: triggerRef
66
- });
67
- };
49
+ var renderPopperWrapper = (0, _react2.jsx)(_popperWrapper.default, {
50
+ content: content,
51
+ isOpen: isOpen,
52
+ placement: placement,
53
+ fallbackPlacements: fallbackPlacements,
54
+ boundary: boundary,
55
+ rootBoundary: rootBoundary,
56
+ shouldFlip: shouldFlip,
57
+ offset: offset,
58
+ popupComponent: PopupContainer,
59
+ id: id,
60
+ testId: testId,
61
+ onClose: onClose,
62
+ autoFocus: autoFocus,
63
+ shouldUseCaptureOnOutsideClick: shouldUseCaptureOnOutsideClick,
64
+ triggerRef: triggerRef
65
+ });
68
66
  return (0, _react2.jsx)(_popper.Manager, null, (0, _react2.jsx)(_popper.Reference, null, function (_ref2) {
69
67
  var _ref3 = _ref2.ref;
70
68
  return trigger({
@@ -82,11 +80,11 @@ var Popup = /*#__PURE__*/(0, _react.memo)(function (_ref) {
82
80
  'aria-expanded': isOpen,
83
81
  'aria-haspopup': true
84
82
  });
85
- }), isOpen && ((0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.render-popup-in-parent_f73ij') ? shouldRenderToParent ? renderPopperWrapper() : (0, _react2.jsx)(_portal.default, {
83
+ }), isOpen && ((0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.render-popup-in-parent_f73ij') ? shouldRenderToParent ? renderPopperWrapper : (0, _react2.jsx)(_portal.default, {
86
84
  zIndex: zIndex
87
- }, renderPopperWrapper()) : (0, _react2.jsx)(_portal.default, {
85
+ }, renderPopperWrapper) : (0, _react2.jsx)(_portal.default, {
88
86
  zIndex: zIndex
89
- }, renderPopperWrapper())));
87
+ }, renderPopperWrapper)));
90
88
  });
91
89
  exports.Popup = Popup;
92
90
  var _default = Popup;
@@ -2,9 +2,11 @@ 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';
5
6
  import { Popper } from '@atlaskit/popper';
6
7
  import { N0, N50A, N60A } from '@atlaskit/theme/colors';
7
8
  import { layers } from '@atlaskit/theme/constants';
9
+ import { CURRENT_SURFACE_CSS_VAR } from '@atlaskit/tokens';
8
10
  import { RepositionOnUpdate } from './reposition-on-update';
9
11
  import { useCloseManager } from './use-close-manager';
10
12
  import { useFocusManager } from './use-focus-manager';
@@ -16,10 +18,12 @@ const popupStyles = css({
16
18
  backgroundColor: `var(--ds-surface-overlay, ${N0})`,
17
19
  borderRadius: "var(--ds-border-radius, 3px)",
18
20
  boxShadow: `var(--ds-shadow-overlay, ${`0 4px 8px -2px ${N50A}, 0 0 1px ${N60A}`})`,
19
- overflow: 'auto',
21
+ [CURRENT_SURFACE_CSS_VAR]: `var(--ds-surface-overlay, ${N0})`,
20
22
  ':focus': {
21
23
  outline: 'none'
22
24
  }
25
+ }, !getBooleanFF('platform.design-system-team.render-popup-in-parent_f73ij') && {
26
+ overflow: 'auto'
23
27
  });
24
28
  const DefaultPopupComponent = /*#__PURE__*/forwardRef((props, ref) => jsx("div", _extends({
25
29
  css: popupStyles
@@ -28,7 +28,7 @@ export const Popup = /*#__PURE__*/memo(({
28
28
  shouldRenderToParent = false
29
29
  }) => {
30
30
  const [triggerRef, setTriggerRef] = useState(null);
31
- const renderPopperWrapper = () => jsx(PopperWrapper, {
31
+ const renderPopperWrapper = jsx(PopperWrapper, {
32
32
  content: content,
33
33
  isOpen: isOpen,
34
34
  placement: placement,
@@ -63,10 +63,10 @@ export const Popup = /*#__PURE__*/memo(({
63
63
  'aria-expanded': isOpen,
64
64
  'aria-haspopup': true
65
65
  });
66
- }), isOpen && (getBooleanFF('platform.design-system-team.render-popup-in-parent_f73ij') ? shouldRenderToParent ? renderPopperWrapper() : jsx(Portal, {
66
+ }), isOpen && (getBooleanFF('platform.design-system-team.render-popup-in-parent_f73ij') ? shouldRenderToParent ? renderPopperWrapper : jsx(Portal, {
67
67
  zIndex: zIndex
68
- }, renderPopperWrapper()) : jsx(Portal, {
68
+ }, renderPopperWrapper) : jsx(Portal, {
69
69
  zIndex: zIndex
70
- }, renderPopperWrapper())));
70
+ }, renderPopperWrapper)));
71
71
  });
72
72
  export default Popup;
@@ -1,26 +1,30 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
+ var _css;
3
5
  /** @jsx jsx */
4
6
  import { forwardRef, useMemo, useState } from 'react';
5
7
  import { css, jsx } from '@emotion/react';
8
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
6
9
  import { Popper } from '@atlaskit/popper';
7
10
  import { N0, N50A, N60A } from '@atlaskit/theme/colors';
8
11
  import { layers } from '@atlaskit/theme/constants';
12
+ import { CURRENT_SURFACE_CSS_VAR } from '@atlaskit/tokens';
9
13
  import { RepositionOnUpdate } from './reposition-on-update';
10
14
  import { useCloseManager } from './use-close-manager';
11
15
  import { useFocusManager } from './use-focus-manager';
12
- var popupStyles = css({
16
+ var popupStyles = css((_css = {
13
17
  display: 'block',
14
18
  boxSizing: 'border-box',
15
19
  zIndex: layers.layer(),
16
20
  flex: '1 1 auto',
17
21
  backgroundColor: "var(--ds-surface-overlay, ".concat(N0, ")"),
18
22
  borderRadius: "var(--ds-border-radius, 3px)",
19
- boxShadow: "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(N50A, ", 0 0 1px ").concat(N60A), ")"),
20
- overflow: 'auto',
21
- ':focus': {
22
- outline: 'none'
23
- }
23
+ boxShadow: "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(N50A, ", 0 0 1px ").concat(N60A), ")")
24
+ }, _defineProperty(_css, CURRENT_SURFACE_CSS_VAR, "var(--ds-surface-overlay, ".concat(N0, ")")), _defineProperty(_css, ':focus', {
25
+ outline: 'none'
26
+ }), _css), !getBooleanFF('platform.design-system-team.render-popup-in-parent_f73ij') && {
27
+ overflow: 'auto'
24
28
  });
25
29
  var DefaultPopupComponent = /*#__PURE__*/forwardRef(function (props, ref) {
26
30
  return jsx("div", _extends({
package/dist/esm/popup.js CHANGED
@@ -38,25 +38,23 @@ export var Popup = /*#__PURE__*/memo(function (_ref) {
38
38
  _useState2 = _slicedToArray(_useState, 2),
39
39
  triggerRef = _useState2[0],
40
40
  setTriggerRef = _useState2[1];
41
- var renderPopperWrapper = function renderPopperWrapper() {
42
- return jsx(PopperWrapper, {
43
- content: content,
44
- isOpen: isOpen,
45
- placement: placement,
46
- fallbackPlacements: fallbackPlacements,
47
- boundary: boundary,
48
- rootBoundary: rootBoundary,
49
- shouldFlip: shouldFlip,
50
- offset: offset,
51
- popupComponent: PopupContainer,
52
- id: id,
53
- testId: testId,
54
- onClose: onClose,
55
- autoFocus: autoFocus,
56
- shouldUseCaptureOnOutsideClick: shouldUseCaptureOnOutsideClick,
57
- triggerRef: triggerRef
58
- });
59
- };
41
+ var renderPopperWrapper = jsx(PopperWrapper, {
42
+ content: content,
43
+ isOpen: isOpen,
44
+ placement: placement,
45
+ fallbackPlacements: fallbackPlacements,
46
+ boundary: boundary,
47
+ rootBoundary: rootBoundary,
48
+ shouldFlip: shouldFlip,
49
+ offset: offset,
50
+ popupComponent: PopupContainer,
51
+ id: id,
52
+ testId: testId,
53
+ onClose: onClose,
54
+ autoFocus: autoFocus,
55
+ shouldUseCaptureOnOutsideClick: shouldUseCaptureOnOutsideClick,
56
+ triggerRef: triggerRef
57
+ });
60
58
  return jsx(Manager, null, jsx(Reference, null, function (_ref2) {
61
59
  var _ref3 = _ref2.ref;
62
60
  return trigger({
@@ -74,10 +72,10 @@ export var Popup = /*#__PURE__*/memo(function (_ref) {
74
72
  'aria-expanded': isOpen,
75
73
  'aria-haspopup': true
76
74
  });
77
- }), isOpen && (getBooleanFF('platform.design-system-team.render-popup-in-parent_f73ij') ? shouldRenderToParent ? renderPopperWrapper() : jsx(Portal, {
75
+ }), isOpen && (getBooleanFF('platform.design-system-team.render-popup-in-parent_f73ij') ? shouldRenderToParent ? renderPopperWrapper : jsx(Portal, {
78
76
  zIndex: zIndex
79
- }, renderPopperWrapper()) : jsx(Portal, {
77
+ }, renderPopperWrapper) : jsx(Portal, {
80
78
  zIndex: zIndex
81
- }, renderPopperWrapper())));
79
+ }, renderPopperWrapper)));
82
80
  });
83
81
  export default Popup;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/popup",
3
- "version": "1.9.1",
3
+ "version": "1.9.3",
4
4
  "description": "A popup displays brief content in an overlay.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -40,7 +40,7 @@
40
40
  "@atlaskit/popper": "^5.5.0",
41
41
  "@atlaskit/portal": "^4.3.0",
42
42
  "@atlaskit/theme": "^12.5.0",
43
- "@atlaskit/tokens": "^1.13.0",
43
+ "@atlaskit/tokens": "^1.18.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "@emotion/react": "^11.7.1",
46
46
  "bind-event-listener": "^2.1.1",
@@ -52,7 +52,8 @@
52
52
  },
53
53
  "devDependencies": {
54
54
  "@af/accessibility-testing": "*",
55
- "@atlaskit/button": "^16.8.0",
55
+ "@af/visual-regression": "*",
56
+ "@atlaskit/button": "^16.9.0",
56
57
  "@atlaskit/icon": "^21.12.0",
57
58
  "@atlaskit/ssr": "*",
58
59
  "@atlaskit/visual-regression": "*",
@@ -1,5 +0,0 @@
1
- {
2
- "name": "@atlaskit/popup",
3
- "version": "1.9.1",
4
- "sideEffects": false
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "name": "@atlaskit/popup",
3
- "version": "1.9.1",
4
- "sideEffects": false
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "name": "@atlaskit/popup",
3
- "version": "1.9.1",
4
- "sideEffects": false
5
- }