@atlaskit/popup 4.11.0 → 4.13.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @atlaskit/popup
2
2
 
3
+ ## 4.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`dd02781bfb92f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/dd02781bfb92f) -
8
+ Increases the height of the popup on viewports with appearance `UNSAFE_modal-below-sm`, i.e.
9
+ viewports below "sm" (mobile) from 50vh to 100vh. This change is behind the
10
+ `platform_dst_nav4_flyout_menu_slots_close_button` feature gate.
11
+
12
+ ## 4.12.0
13
+
14
+ ### Minor Changes
15
+
16
+ - [`2f8e40fb0a94f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2f8e40fb0a94f) -
17
+ Popups using `shouldFitViewport` will now be scrollable even if they are rendered to parent using
18
+ `shouldRenderToParent`. Previously, only popups rendered in portals would be scrollable.
19
+
20
+ This change is behind the feature gate `platform_dst_nav4_flyoutmenuitem_render_to_parent`.
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies
25
+
3
26
  ## 4.11.0
4
27
 
5
28
  ### Minor Changes
@@ -12,6 +12,7 @@
12
12
  ._1reo1wug{overflow-x:auto}
13
13
  ._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
14
14
  ._bfhk1i5c{background-color:var(--ds-blanket,#050c1f75)}
15
+ ._c71l1ei0{max-height:calc(100vh - var(--ds-space-050, 4px)*2)}
15
16
  ._c71ldtre{max-height:50vh}
16
17
  ._kqsw1n9t{position:fixed}
17
18
  ._syazi7uo{color:var(--ds-text,#292a2e)}
@@ -21,7 +21,7 @@ var _popper = require("@atlaskit/popper");
21
21
  var _repositionOnUpdate = require("./reposition-on-update");
22
22
  var _useCloseManager = require("./use-close-manager");
23
23
  var _useFocusManager = require("./use-focus-manager");
24
- var _excluded = ["shouldRenderToParent", "shouldFitContainer", "children", "appearance", "className", "isReferenceHidden"];
24
+ var _excluded = ["shouldRenderToParent", "shouldFitContainer", "children", "appearance", "className", "isReferenceHidden", "shouldFitViewport"];
25
25
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
26
26
  var LOCAL_CURRENT_SURFACE_CSS_VAR = '--ds-elevation-surface-current';
27
27
  var fullWidthStyles = null;
@@ -32,6 +32,7 @@ var wrapperStyles = {
32
32
  var scrollableStyles = null;
33
33
  var blanketStyles = null;
34
34
  var modalStyles = null;
35
+ var newModalStyles = null;
35
36
  var focusRingStyles = {
36
37
  root: "_mizu194a _1ah3dkaa _ra3xnqa1 _128mdkaa _1cvmnqa1 _4davt94y"
37
38
  };
@@ -42,10 +43,11 @@ var DefaultPopupComponent = /*#__PURE__*/(0, _react.forwardRef)(function (props,
42
43
  appearance = props.appearance,
43
44
  className = props.className,
44
45
  _isReferenceHidden = props.isReferenceHidden,
46
+ shouldFitViewport = props.shouldFitViewport,
45
47
  htmlAttributes = (0, _objectWithoutProperties2.default)(props, _excluded);
46
48
  return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
47
49
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
48
- className: (0, _runtime.ax)([wrapperStyles.root, (0, _platformFeatureFlags.fg)('platform-dst-shape-theme-default') && wrapperStyles.rootT26Shape, appearance === 'UNSAFE_modal-below-sm' && "_dk5d1b66 _c71ldtre _kqsw1n9t _152t1b66", !shouldRenderToParent && "_1reo1wug _18m91wug", shouldFitContainer && "_1bsb1osq", className])
50
+ className: (0, _runtime.ax)([wrapperStyles.root, (0, _platformFeatureFlags.fg)('platform-dst-shape-theme-default') && wrapperStyles.rootT26Shape, appearance === 'UNSAFE_modal-below-sm' && !(0, _platformFeatureFlags.fg)('platform_dst_nav4_flyout_menu_slots_close_button') && "_dk5d1b66 _c71ldtre _kqsw1n9t _152t1b66", appearance === 'UNSAFE_modal-below-sm' && (0, _platformFeatureFlags.fg)('platform_dst_nav4_flyout_menu_slots_close_button') && "_dk5d1b66 _c71l1ei0 _kqsw1n9t _152t1b66", (!shouldRenderToParent || shouldFitViewport && (0, _platformFeatureFlags.fg)('platform_dst_nav4_flyoutmenuitem_render_to_parent')) && "_1reo1wug _18m91wug", shouldFitContainer && "_1bsb1osq", className])
49
51
  }, htmlAttributes, {
50
52
  ref: ref
51
53
  }), children);
@@ -172,6 +174,7 @@ function PopperWrapper(_ref) {
172
174
  tabIndex: autoFocus ? 0 : undefined,
173
175
  shouldRenderToParent: shouldRenderToParent,
174
176
  shouldFitContainer: shouldFitContainer,
177
+ shouldFitViewport: shouldFitViewport,
175
178
  isReferenceHidden: isReferenceHidden
176
179
  }, /*#__PURE__*/React.createElement(_repositionOnUpdate.RepositionOnUpdate, {
177
180
  update: update
@@ -12,6 +12,7 @@
12
12
  ._1reo1wug{overflow-x:auto}
13
13
  ._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
14
14
  ._bfhk1i5c{background-color:var(--ds-blanket,#050c1f75)}
15
+ ._c71l1ei0{max-height:calc(100vh - var(--ds-space-050, 4px)*2)}
15
16
  ._c71ldtre{max-height:50vh}
16
17
  ._kqsw1n9t{position:fixed}
17
18
  ._syazi7uo{color:var(--ds-text,#292a2e)}
@@ -19,6 +19,7 @@ const wrapperStyles = {
19
19
  const scrollableStyles = null;
20
20
  const blanketStyles = null;
21
21
  const modalStyles = null;
22
+ const newModalStyles = null;
22
23
  const focusRingStyles = {
23
24
  root: "_mizu194a _1ah3dkaa _ra3xnqa1 _128mdkaa _1cvmnqa1 _4davt94y"
24
25
  };
@@ -30,11 +31,12 @@ const DefaultPopupComponent = /*#__PURE__*/forwardRef((props, ref) => {
30
31
  appearance,
31
32
  className,
32
33
  isReferenceHidden: _isReferenceHidden,
34
+ shouldFitViewport,
33
35
  ...htmlAttributes
34
36
  } = props;
35
37
  return /*#__PURE__*/React.createElement("div", _extends({
36
38
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
37
- className: ax([wrapperStyles.root, fg('platform-dst-shape-theme-default') && wrapperStyles.rootT26Shape, appearance === 'UNSAFE_modal-below-sm' && "_dk5d1b66 _c71ldtre _kqsw1n9t _152t1b66", !shouldRenderToParent && "_1reo1wug _18m91wug", shouldFitContainer && "_1bsb1osq", className])
39
+ className: ax([wrapperStyles.root, fg('platform-dst-shape-theme-default') && wrapperStyles.rootT26Shape, appearance === 'UNSAFE_modal-below-sm' && !fg('platform_dst_nav4_flyout_menu_slots_close_button') && "_dk5d1b66 _c71ldtre _kqsw1n9t _152t1b66", appearance === 'UNSAFE_modal-below-sm' && fg('platform_dst_nav4_flyout_menu_slots_close_button') && "_dk5d1b66 _c71l1ei0 _kqsw1n9t _152t1b66", (!shouldRenderToParent || shouldFitViewport && fg('platform_dst_nav4_flyoutmenuitem_render_to_parent')) && "_1reo1wug _18m91wug", shouldFitContainer && "_1bsb1osq", className])
38
40
  }, htmlAttributes, {
39
41
  ref: ref
40
42
  }), children);
@@ -152,6 +154,7 @@ function PopperWrapper({
152
154
  tabIndex: autoFocus ? 0 : undefined,
153
155
  shouldRenderToParent: shouldRenderToParent,
154
156
  shouldFitContainer: shouldFitContainer,
157
+ shouldFitViewport: shouldFitViewport,
155
158
  isReferenceHidden: isReferenceHidden
156
159
  }, /*#__PURE__*/React.createElement(RepositionOnUpdate, {
157
160
  update: update
@@ -12,6 +12,7 @@
12
12
  ._1reo1wug{overflow-x:auto}
13
13
  ._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
14
14
  ._bfhk1i5c{background-color:var(--ds-blanket,#050c1f75)}
15
+ ._c71l1ei0{max-height:calc(100vh - var(--ds-space-050, 4px)*2)}
15
16
  ._c71ldtre{max-height:50vh}
16
17
  ._kqsw1n9t{position:fixed}
17
18
  ._syazi7uo{color:var(--ds-text,#292a2e)}
@@ -3,7 +3,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  import _extends from "@babel/runtime/helpers/extends";
5
5
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
6
- var _excluded = ["shouldRenderToParent", "shouldFitContainer", "children", "appearance", "className", "isReferenceHidden"];
6
+ var _excluded = ["shouldRenderToParent", "shouldFitContainer", "children", "appearance", "className", "isReferenceHidden", "shouldFitViewport"];
7
7
  import "./popper-wrapper.compiled.css";
8
8
  import * as React from 'react';
9
9
  import { forwardRef, Fragment, useMemo, useState } from 'react';
@@ -23,6 +23,7 @@ var wrapperStyles = {
23
23
  var scrollableStyles = null;
24
24
  var blanketStyles = null;
25
25
  var modalStyles = null;
26
+ var newModalStyles = null;
26
27
  var focusRingStyles = {
27
28
  root: "_mizu194a _1ah3dkaa _ra3xnqa1 _128mdkaa _1cvmnqa1 _4davt94y"
28
29
  };
@@ -33,10 +34,11 @@ var DefaultPopupComponent = /*#__PURE__*/forwardRef(function (props, ref) {
33
34
  appearance = props.appearance,
34
35
  className = props.className,
35
36
  _isReferenceHidden = props.isReferenceHidden,
37
+ shouldFitViewport = props.shouldFitViewport,
36
38
  htmlAttributes = _objectWithoutProperties(props, _excluded);
37
39
  return /*#__PURE__*/React.createElement("div", _extends({
38
40
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
39
- className: ax([wrapperStyles.root, fg('platform-dst-shape-theme-default') && wrapperStyles.rootT26Shape, appearance === 'UNSAFE_modal-below-sm' && "_dk5d1b66 _c71ldtre _kqsw1n9t _152t1b66", !shouldRenderToParent && "_1reo1wug _18m91wug", shouldFitContainer && "_1bsb1osq", className])
41
+ className: ax([wrapperStyles.root, fg('platform-dst-shape-theme-default') && wrapperStyles.rootT26Shape, appearance === 'UNSAFE_modal-below-sm' && !fg('platform_dst_nav4_flyout_menu_slots_close_button') && "_dk5d1b66 _c71ldtre _kqsw1n9t _152t1b66", appearance === 'UNSAFE_modal-below-sm' && fg('platform_dst_nav4_flyout_menu_slots_close_button') && "_dk5d1b66 _c71l1ei0 _kqsw1n9t _152t1b66", (!shouldRenderToParent || shouldFitViewport && fg('platform_dst_nav4_flyoutmenuitem_render_to_parent')) && "_1reo1wug _18m91wug", shouldFitContainer && "_1bsb1osq", className])
40
42
  }, htmlAttributes, {
41
43
  ref: ref
42
44
  }), children);
@@ -163,6 +165,7 @@ function PopperWrapper(_ref) {
163
165
  tabIndex: autoFocus ? 0 : undefined,
164
166
  shouldRenderToParent: shouldRenderToParent,
165
167
  shouldFitContainer: shouldFitContainer,
168
+ shouldFitViewport: shouldFitViewport,
166
169
  isReferenceHidden: isReferenceHidden
167
170
  }, /*#__PURE__*/React.createElement(RepositionOnUpdate, {
168
171
  update: update
@@ -90,9 +90,16 @@ export interface PopupComponentProps {
90
90
  * The default is `false`.
91
91
  */
92
92
  shouldFitContainer?: boolean;
93
+ /**
94
+ * Determines if the popup will have a `max-width` and `max-height` set to
95
+ * constrain it to the viewport.
96
+ */
97
+ shouldFitViewport?: boolean;
93
98
  /**
94
99
  * The "default" appearance is used for standard popups.
95
100
  * The "UNSAFE_modal-below-sm" appearance makes the popup appear as a modal when the viewport is smaller than "sm".
101
+ * When the feature gate `platform_dst_nav4_flyout_menu_slots_close_button` is enabled, the appearance should only
102
+ * be set to "UNSAFE_modal-below-sm" if the provided popup includes a close button.
96
103
  */
97
104
  appearance?: 'default' | 'UNSAFE_modal-below-sm';
98
105
  /**
@@ -90,9 +90,16 @@ export interface PopupComponentProps {
90
90
  * The default is `false`.
91
91
  */
92
92
  shouldFitContainer?: boolean;
93
+ /**
94
+ * Determines if the popup will have a `max-width` and `max-height` set to
95
+ * constrain it to the viewport.
96
+ */
97
+ shouldFitViewport?: boolean;
93
98
  /**
94
99
  * The "default" appearance is used for standard popups.
95
100
  * The "UNSAFE_modal-below-sm" appearance makes the popup appear as a modal when the viewport is smaller than "sm".
101
+ * When the feature gate `platform_dst_nav4_flyout_menu_slots_close_button` is enabled, the appearance should only
102
+ * be set to "UNSAFE_modal-below-sm" if the provided popup includes a close button.
96
103
  */
97
104
  appearance?: 'default' | 'UNSAFE_modal-below-sm';
98
105
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/popup",
3
- "version": "4.11.0",
3
+ "version": "4.13.0",
4
4
  "description": "A popup displays brief content in an overlay.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -34,12 +34,12 @@
34
34
  "dependencies": {
35
35
  "@atlaskit/css": "^0.19.0",
36
36
  "@atlaskit/ds-lib": "^5.3.0",
37
- "@atlaskit/layering": "^3.5.0",
37
+ "@atlaskit/layering": "^3.6.0",
38
38
  "@atlaskit/platform-feature-flags": "^1.1.0",
39
39
  "@atlaskit/popper": "^7.1.0",
40
40
  "@atlaskit/portal": "^5.1.0",
41
41
  "@atlaskit/primitives": "^17.0.0",
42
- "@atlaskit/tokens": "^9.0.0",
42
+ "@atlaskit/tokens": "^9.1.0",
43
43
  "@babel/runtime": "^7.0.0",
44
44
  "@compiled/react": "^0.18.6",
45
45
  "bind-event-listener": "^3.0.0",
@@ -60,7 +60,7 @@
60
60
  "@atlaskit/docs": "^11.2.0",
61
61
  "@atlaskit/form": "^15.2.0",
62
62
  "@atlaskit/heading": "^5.2.0",
63
- "@atlaskit/icon": "^29.3.0",
63
+ "@atlaskit/icon": "^29.4.0",
64
64
  "@atlaskit/link": "^3.3.0",
65
65
  "@atlaskit/modal-dialog": "^14.9.0",
66
66
  "@atlaskit/section-message": "^8.11.0",
@@ -119,6 +119,9 @@
119
119
  },
120
120
  "platform_dst_nav4_flyout_menu_slots_close_button": {
121
121
  "type": "boolean"
122
+ },
123
+ "platform_dst_nav4_flyoutmenuitem_render_to_parent": {
124
+ "type": "boolean"
122
125
  }
123
126
  },
124
127
  "homepage": "https://atlassian.design/components/popup/"