@atlaskit/side-nav-items 1.12.4 → 1.13.1

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,19 @@
1
1
  # @atlaskit/side-nav-items
2
2
 
3
+ ## 1.13.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 1.13.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`a8f4489e99107`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a8f4489e99107) -
14
+ Fixes the mobile max height of flyout menu popups to use the full available space, when the
15
+ `platform_dst_nav4_flyout_menu_slots_close_button` gate is enabled.
16
+
3
17
  ## 1.12.4
4
18
 
5
19
  ### Patch Changes
@@ -4,5 +4,6 @@
4
4
  ._4t3i1osq{height:100%}
5
5
  ._85i5u2gc{padding-block-end:var(--ds-space-100,8px)}
6
6
  ._bozgu2gc{padding-inline-start:var(--ds-space-100,8px)}
7
+ ._c71lq9dn{max-height:calc(100vh - var(--ds-space-100, 8px)*2 - 8px)}
7
8
  ._y4tiu2gc{padding-inline-end:var(--ds-space-100,8px)}
8
- @media (min-width:48rem){._14b51kdj{width:25pc}}
9
+ @media (min-width:48rem){._14b51kdj{width:25pc}._1jop304o{max-height:var(--max-height,760px)}}
@@ -10,6 +10,7 @@ exports.FlyoutMenuItemContent = void 0;
10
10
  require("./flyout-menu-item-content.compiled.css");
11
11
  var _runtime = require("@compiled/react/runtime");
12
12
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
14
  var _react = _interopRequireWildcard(require("react"));
14
15
  var _analyticsNext = require("@atlaskit/analytics-next");
15
16
  var _mergeRefs = _interopRequireDefault(require("@atlaskit/ds-lib/merge-refs"));
@@ -36,11 +37,18 @@ var FLYOUT_MENU_VERTICAL_OFFSET_PX = 26;
36
37
  * height of 760px.
37
38
  */
38
39
  var FLYOUT_MENU_MAX_HEIGHT_PX = 760;
40
+ var FLYOUT_MENU_PADDING = "var(--ds-space-100, 8px)";
41
+
42
+ /**
43
+ * The margin around the flyout menu popup when it has its modal appearance on mobile screen sizes.
44
+ */
45
+ var FLYOUT_MENU_MODAL_MARGIN = 4;
46
+ var maxHeightCssVar = '--max-height';
39
47
  var flyoutMenuItemContentStyles = {
40
48
  root: "_1q51u2gc _85i5u2gc _bozgu2gc _y4tiu2gc _14b51kdj"
41
49
  };
42
50
  var flyoutMenuItemContentContainerStyles = {
43
- container: "_1e0c1txw _4t3i1osq _2lx21bp4"
51
+ container: "_1e0c1txw _4t3i1osq _2lx21bp4 _c71lq9dn _1jop304o"
44
52
  };
45
53
  /**
46
54
  * __FlyoutMenuItemContent__
@@ -151,9 +159,7 @@ var FlyoutMenuItemContent = exports.FlyoutMenuItemContent = /*#__PURE__*/(0, _re
151
159
  }, (0, _platformFeatureFlags.fg)('platform_dst_nav4_flyout_menu_slots_close_button') ? /*#__PURE__*/_react.default.createElement(_flyoutMenuItemContext.TitleIdContextProvider, {
152
160
  value: titleId
153
161
  }, /*#__PURE__*/_react.default.createElement("div", {
154
- style: {
155
- maxHeight: computedMaxHeight
156
- },
162
+ style: (0, _defineProperty2.default)({}, maxHeightCssVar, computedMaxHeight),
157
163
  "data-testid": containerTestId ? "".concat(containerTestId, "--container") : undefined,
158
164
  className: (0, _runtime.ax)([flyoutMenuItemContentContainerStyles.container])
159
165
  }, children)) : children);
@@ -175,9 +181,9 @@ function createResizeObserver(update) {
175
181
  * 3. Popup exposes the `update` function so consumers can already do this themselves if necessary
176
182
  * 4. Flyout menus are a lot more restricted to other popups, it might not make sense more generally
177
183
  */
178
- var UpdatePopperOnContentResize = /*#__PURE__*/(0, _react.forwardRef)(function (_ref3, forwardedRef) {
179
- var update = _ref3.update,
180
- children = _ref3.children;
184
+ var UpdatePopperOnContentResize = /*#__PURE__*/(0, _react.forwardRef)(function (_ref4, forwardedRef) {
185
+ var update = _ref4.update,
186
+ children = _ref4.children;
181
187
  /**
182
188
  * Storing our `update` function in a ref so that we have a stable reference to it.
183
189
  * We need this because our `ResizeObserver` callback cannot be changed after creating it.
@@ -4,5 +4,6 @@
4
4
  ._4t3i1osq{height:100%}
5
5
  ._85i5u2gc{padding-block-end:var(--ds-space-100,8px)}
6
6
  ._bozgu2gc{padding-inline-start:var(--ds-space-100,8px)}
7
+ ._c71lq9dn{max-height:calc(100vh - var(--ds-space-100, 8px)*2 - 8px)}
7
8
  ._y4tiu2gc{padding-inline-end:var(--ds-space-100,8px)}
8
- @media (min-width:48rem){._14b51kdj{width:25pc}}
9
+ @media (min-width:48rem){._14b51kdj{width:25pc}._1jop304o{max-height:var(--max-height,760px)}}
@@ -26,11 +26,18 @@ const FLYOUT_MENU_VERTICAL_OFFSET_PX = 26;
26
26
  * height of 760px.
27
27
  */
28
28
  const FLYOUT_MENU_MAX_HEIGHT_PX = 760;
29
+ const FLYOUT_MENU_PADDING = "var(--ds-space-100, 8px)";
30
+
31
+ /**
32
+ * The margin around the flyout menu popup when it has its modal appearance on mobile screen sizes.
33
+ */
34
+ const FLYOUT_MENU_MODAL_MARGIN = 4;
35
+ const maxHeightCssVar = '--max-height';
29
36
  const flyoutMenuItemContentStyles = {
30
37
  root: "_1q51u2gc _85i5u2gc _bozgu2gc _y4tiu2gc _14b51kdj"
31
38
  };
32
39
  const flyoutMenuItemContentContainerStyles = {
33
- container: "_1e0c1txw _4t3i1osq _2lx21bp4"
40
+ container: "_1e0c1txw _4t3i1osq _2lx21bp4 _c71lq9dn _1jop304o"
34
41
  };
35
42
  /**
36
43
  * __FlyoutMenuItemContent__
@@ -140,7 +147,7 @@ export const FlyoutMenuItemContent = /*#__PURE__*/forwardRef(({
140
147
  value: titleId
141
148
  }, /*#__PURE__*/React.createElement("div", {
142
149
  style: {
143
- maxHeight: computedMaxHeight
150
+ [maxHeightCssVar]: computedMaxHeight
144
151
  },
145
152
  "data-testid": containerTestId ? `${containerTestId}--container` : undefined,
146
153
  className: ax([flyoutMenuItemContentContainerStyles.container])
@@ -4,5 +4,6 @@
4
4
  ._4t3i1osq{height:100%}
5
5
  ._85i5u2gc{padding-block-end:var(--ds-space-100,8px)}
6
6
  ._bozgu2gc{padding-inline-start:var(--ds-space-100,8px)}
7
+ ._c71lq9dn{max-height:calc(100vh - var(--ds-space-100, 8px)*2 - 8px)}
7
8
  ._y4tiu2gc{padding-inline-end:var(--ds-space-100,8px)}
8
- @media (min-width:48rem){._14b51kdj{width:25pc}}
9
+ @media (min-width:48rem){._14b51kdj{width:25pc}._1jop304o{max-height:var(--max-height,760px)}}
@@ -1,5 +1,6 @@
1
1
  /* flyout-menu-item-content.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
4
  import "./flyout-menu-item-content.compiled.css";
4
5
  import { ax, ix } from "@compiled/react/runtime";
5
6
  import React, { forwardRef, useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from 'react';
@@ -27,11 +28,18 @@ var FLYOUT_MENU_VERTICAL_OFFSET_PX = 26;
27
28
  * height of 760px.
28
29
  */
29
30
  var FLYOUT_MENU_MAX_HEIGHT_PX = 760;
31
+ var FLYOUT_MENU_PADDING = "var(--ds-space-100, 8px)";
32
+
33
+ /**
34
+ * The margin around the flyout menu popup when it has its modal appearance on mobile screen sizes.
35
+ */
36
+ var FLYOUT_MENU_MODAL_MARGIN = 4;
37
+ var maxHeightCssVar = '--max-height';
30
38
  var flyoutMenuItemContentStyles = {
31
39
  root: "_1q51u2gc _85i5u2gc _bozgu2gc _y4tiu2gc _14b51kdj"
32
40
  };
33
41
  var flyoutMenuItemContentContainerStyles = {
34
- container: "_1e0c1txw _4t3i1osq _2lx21bp4"
42
+ container: "_1e0c1txw _4t3i1osq _2lx21bp4 _c71lq9dn _1jop304o"
35
43
  };
36
44
  /**
37
45
  * __FlyoutMenuItemContent__
@@ -142,9 +150,7 @@ export var FlyoutMenuItemContent = /*#__PURE__*/forwardRef(function (_ref, forwa
142
150
  }, fg('platform_dst_nav4_flyout_menu_slots_close_button') ? /*#__PURE__*/React.createElement(TitleIdContextProvider, {
143
151
  value: titleId
144
152
  }, /*#__PURE__*/React.createElement("div", {
145
- style: {
146
- maxHeight: computedMaxHeight
147
- },
153
+ style: _defineProperty({}, maxHeightCssVar, computedMaxHeight),
148
154
  "data-testid": containerTestId ? "".concat(containerTestId, "--container") : undefined,
149
155
  className: ax([flyoutMenuItemContentContainerStyles.container])
150
156
  }, children)) : children);
@@ -166,9 +172,9 @@ function createResizeObserver(update) {
166
172
  * 3. Popup exposes the `update` function so consumers can already do this themselves if necessary
167
173
  * 4. Flyout menus are a lot more restricted to other popups, it might not make sense more generally
168
174
  */
169
- var UpdatePopperOnContentResize = /*#__PURE__*/forwardRef(function (_ref3, forwardedRef) {
170
- var update = _ref3.update,
171
- children = _ref3.children;
175
+ var UpdatePopperOnContentResize = /*#__PURE__*/forwardRef(function (_ref4, forwardedRef) {
176
+ var update = _ref4.update,
177
+ children = _ref4.children;
172
178
  /**
173
179
  * Storing our `update` function in a ref so that we have a stable reference to it.
174
180
  * We need this because our `ResizeObserver` callback cannot be changed after creating it.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/side-nav-items",
3
- "version": "1.12.4",
3
+ "version": "1.13.1",
4
4
  "description": "Menu items and elements for the side nav area.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -48,8 +48,8 @@
48
48
  "@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
49
49
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
50
50
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
51
- "@atlaskit/primitives": "^18.1.0",
52
- "@atlaskit/tokens": "^12.0.0",
51
+ "@atlaskit/primitives": "^19.0.0",
52
+ "@atlaskit/tokens": "^13.0.0",
53
53
  "@atlaskit/tooltip": "^21.1.0",
54
54
  "@babel/runtime": "^7.0.0",
55
55
  "@compiled/react": "^0.20.0",
@@ -64,8 +64,8 @@
64
64
  "@af/integration-testing": "workspace:^",
65
65
  "@af/visual-regression": "workspace:^",
66
66
  "@atlaskit/app-provider": "^4.2.0",
67
- "@atlaskit/lozenge": "^13.5.0",
68
- "@atlaskit/navigation-system": "^7.1.0",
67
+ "@atlaskit/lozenge": "^13.6.0",
68
+ "@atlaskit/navigation-system": "^7.2.0",
69
69
  "@atlaskit/ssr": "workspace:^",
70
70
  "@atlassian/a11y-jest-testing": "^0.11.0",
71
71
  "@atlassian/feature-flags-test-utils": "^1.0.0",