@atlaskit/menu 2.14.4 → 3.1.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,32 @@
1
1
  # @atlaskit/menu
2
2
 
3
+ ## 3.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#118691](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/118691)
8
+ [`fe3551cf3dd67`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fe3551cf3dd67) -
9
+ We are testing improvements behind a feature flag. Menu items will support icons regardless of
10
+ their spacing. If this fix is successful it will be available in a later release.
11
+
12
+ ## 3.0.0
13
+
14
+ ### Major Changes
15
+
16
+ - [#117363](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117363)
17
+ [`10a0f7f6c2027`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/10a0f7f6c2027) -
18
+ This package's `peerDependencies` have been adjusted for `react` and/or `react-dom` to reflect the
19
+ status of only supporting React 18 going forward. No explicit breaking change to React support has
20
+ been made in this release, but this is to signify going forward, breaking changes for React 16 or
21
+ React 17 may come via non-major semver releases.
22
+
23
+ Please refer this community post for more details:
24
+ https://community.developer.atlassian.com/t/rfc-78-dropping-support-for-react-16-and-rendering-in-a-react-18-concurrent-root-in-jira-and-confluence/87026
25
+
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies
29
+
3
30
  ## 2.14.4
4
31
 
5
32
  ### Patch Changes
@@ -9,6 +9,7 @@ var _react = require("react");
9
9
  var _react2 = require("@emotion/react");
10
10
  var _deprecationWarning = require("@atlaskit/ds-lib/deprecation-warning");
11
11
  var _focusRing = _interopRequireDefault(require("@atlaskit/focus-ring"));
12
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
13
  var _primitives = require("@atlaskit/primitives");
13
14
  var _colors = require("@atlaskit/theme/colors");
14
15
  var _menuContext = require("./menu-context");
@@ -25,8 +26,16 @@ var defaultRender = function defaultRender(Component, props) {
25
26
  (0, _react2.jsx)(Component, props)
26
27
  );
27
28
  };
29
+ var beforeAfterElementStylesOld = (0, _react2.css)({
30
+ display: 'flex',
31
+ alignItems: 'center',
32
+ justifyContent: 'center',
33
+ flexShrink: 0
34
+ });
28
35
  var beforeAfterElementStyles = (0, _react2.css)({
29
36
  display: 'flex',
37
+ minWidth: 24,
38
+ minHeight: 24,
30
39
  alignItems: 'center',
31
40
  justifyContent: 'center',
32
41
  flexShrink: 0
@@ -214,7 +223,7 @@ var MenuItemPrimitive = function MenuItemPrimitive(_ref) {
214
223
  testId: testId && "".concat(testId, "--container")
215
224
  }, iconBefore && (0, _react2.jsx)("span", {
216
225
  "data-item-elem-before": true,
217
- css: beforeAfterElementStyles,
226
+ css: (0, _platformFeatureFlags.fg)('platform_ads_component_no_icon_spacing_support') ? beforeAfterElementStyles : beforeAfterElementStylesOld,
218
227
  "data-testid": testId && "".concat(testId, "--icon-before")
219
228
  }, iconBefore), title && (0, _react2.jsx)(_primitives.Stack, {
220
229
  alignBlock: "center",
@@ -229,7 +238,7 @@ var MenuItemPrimitive = function MenuItemPrimitive(_ref) {
229
238
  css: [descriptionStyles, isDisabled && disabledDescriptionStyles, shouldDescriptionWrap ? wordBreakStyles : truncateStyles]
230
239
  }, description)), iconAfter && (0, _react2.jsx)("span", {
231
240
  "data-item-elem-after": true,
232
- css: beforeAfterElementStyles,
241
+ css: (0, _platformFeatureFlags.fg)('platform_ads_component_no_icon_spacing_support') ? beforeAfterElementStyles : beforeAfterElementStylesOld,
233
242
  "data-testid": testId && "".concat(testId, "--icon-after")
234
243
  }, iconAfter))
235
244
  }));
@@ -8,14 +8,23 @@ import { useContext } from 'react';
8
8
  import { ClassNames, css, jsx } from '@emotion/react';
9
9
  import { propDeprecationWarning } from '@atlaskit/ds-lib/deprecation-warning';
10
10
  import FocusRing from '@atlaskit/focus-ring';
11
+ import { fg } from '@atlaskit/platform-feature-flags';
11
12
  import { Inline, Stack, xcss } from '@atlaskit/primitives';
12
13
  import { N20, N200, N30 } from '@atlaskit/theme/colors';
13
14
  import { SELECTION_STYLE_CONTEXT_DO_NOT_USE, SpacingContext } from './menu-context';
14
15
  const defaultRender = (Component, props) =>
15
16
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
16
17
  jsx(Component, props);
18
+ const beforeAfterElementStylesOld = css({
19
+ display: 'flex',
20
+ alignItems: 'center',
21
+ justifyContent: 'center',
22
+ flexShrink: 0
23
+ });
17
24
  const beforeAfterElementStyles = css({
18
25
  display: 'flex',
26
+ minWidth: 24,
27
+ minHeight: 24,
19
28
  alignItems: 'center',
20
29
  justifyContent: 'center',
21
30
  flexShrink: 0
@@ -201,7 +210,7 @@ const MenuItemPrimitive = ({
201
210
  testId: testId && `${testId}--container`
202
211
  }, iconBefore && jsx("span", {
203
212
  "data-item-elem-before": true,
204
- css: beforeAfterElementStyles,
213
+ css: fg('platform_ads_component_no_icon_spacing_support') ? beforeAfterElementStyles : beforeAfterElementStylesOld,
205
214
  "data-testid": testId && `${testId}--icon-before`
206
215
  }, iconBefore), title && jsx(Stack, {
207
216
  alignBlock: "center",
@@ -216,7 +225,7 @@ const MenuItemPrimitive = ({
216
225
  css: [descriptionStyles, isDisabled && disabledDescriptionStyles, shouldDescriptionWrap ? wordBreakStyles : truncateStyles]
217
226
  }, description)), iconAfter && jsx("span", {
218
227
  "data-item-elem-after": true,
219
- css: beforeAfterElementStyles,
228
+ css: fg('platform_ads_component_no_icon_spacing_support') ? beforeAfterElementStyles : beforeAfterElementStylesOld,
220
229
  "data-testid": testId && `${testId}--icon-after`
221
230
  }, iconAfter))
222
231
  }));
@@ -8,6 +8,7 @@ import { useContext } from 'react';
8
8
  import { ClassNames, css, jsx } from '@emotion/react';
9
9
  import { propDeprecationWarning } from '@atlaskit/ds-lib/deprecation-warning';
10
10
  import FocusRing from '@atlaskit/focus-ring';
11
+ import { fg } from '@atlaskit/platform-feature-flags';
11
12
  import { Inline, Stack, xcss } from '@atlaskit/primitives';
12
13
  import { N20, N200, N30 } from '@atlaskit/theme/colors';
13
14
  import { SELECTION_STYLE_CONTEXT_DO_NOT_USE, SpacingContext } from './menu-context';
@@ -17,8 +18,16 @@ var defaultRender = function defaultRender(Component, props) {
17
18
  jsx(Component, props)
18
19
  );
19
20
  };
21
+ var beforeAfterElementStylesOld = css({
22
+ display: 'flex',
23
+ alignItems: 'center',
24
+ justifyContent: 'center',
25
+ flexShrink: 0
26
+ });
20
27
  var beforeAfterElementStyles = css({
21
28
  display: 'flex',
29
+ minWidth: 24,
30
+ minHeight: 24,
22
31
  alignItems: 'center',
23
32
  justifyContent: 'center',
24
33
  flexShrink: 0
@@ -206,7 +215,7 @@ var MenuItemPrimitive = function MenuItemPrimitive(_ref) {
206
215
  testId: testId && "".concat(testId, "--container")
207
216
  }, iconBefore && jsx("span", {
208
217
  "data-item-elem-before": true,
209
- css: beforeAfterElementStyles,
218
+ css: fg('platform_ads_component_no_icon_spacing_support') ? beforeAfterElementStyles : beforeAfterElementStylesOld,
210
219
  "data-testid": testId && "".concat(testId, "--icon-before")
211
220
  }, iconBefore), title && jsx(Stack, {
212
221
  alignBlock: "center",
@@ -221,7 +230,7 @@ var MenuItemPrimitive = function MenuItemPrimitive(_ref) {
221
230
  css: [descriptionStyles, isDisabled && disabledDescriptionStyles, shouldDescriptionWrap ? wordBreakStyles : truncateStyles]
222
231
  }, description)), iconAfter && jsx("span", {
223
232
  "data-item-elem-after": true,
224
- css: beforeAfterElementStyles,
233
+ css: fg('platform_ads_component_no_icon_spacing_support') ? beforeAfterElementStyles : beforeAfterElementStylesOld,
225
234
  "data-testid": testId && "".concat(testId, "--icon-after")
226
235
  }, iconAfter))
227
236
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/menu",
3
- "version": "2.14.4",
3
+ "version": "3.1.0",
4
4
  "description": "A list of options to help users navigate, or perform actions.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -41,30 +41,30 @@
41
41
  }
42
42
  },
43
43
  "dependencies": {
44
- "@atlaskit/app-provider": "^1.8.0",
45
- "@atlaskit/ds-lib": "^3.5.0",
46
- "@atlaskit/focus-ring": "^2.1.0",
47
- "@atlaskit/interaction-context": "^2.6.0",
44
+ "@atlaskit/app-provider": "^2.0.0",
45
+ "@atlaskit/ds-lib": "^4.0.0",
46
+ "@atlaskit/focus-ring": "^3.0.0",
47
+ "@atlaskit/interaction-context": "^3.0.0",
48
48
  "@atlaskit/platform-feature-flags": "^1.1.0",
49
- "@atlaskit/primitives": "^13.5.0",
50
- "@atlaskit/theme": "^16.0.0",
51
- "@atlaskit/tokens": "^3.3.0",
49
+ "@atlaskit/primitives": "^14.1.0",
50
+ "@atlaskit/theme": "^17.0.0",
51
+ "@atlaskit/tokens": "^4.2.0",
52
52
  "@babel/runtime": "^7.0.0",
53
53
  "@emotion/react": "^11.7.1"
54
54
  },
55
55
  "peerDependencies": {
56
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
57
- "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
56
+ "react": "^18.2.0",
57
+ "react-dom": "^18.2.0"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@af/accessibility-testing": "*",
61
61
  "@af/integration-testing": "*",
62
62
  "@af/visual-regression": "*",
63
- "@atlaskit/button": "^20.5.1",
63
+ "@atlaskit/button": "^21.1.0",
64
64
  "@atlaskit/docs": "*",
65
- "@atlaskit/icon": "^23.9.0",
66
- "@atlaskit/icon-file-type": "^6.9.0",
67
- "@atlaskit/icon-object": "^6.11.0",
65
+ "@atlaskit/icon": "^24.1.0",
66
+ "@atlaskit/icon-file-type": "^7.0.0",
67
+ "@atlaskit/icon-object": "^7.0.0",
68
68
  "@atlaskit/link": "*",
69
69
  "@atlaskit/section-message": "*",
70
70
  "@atlaskit/visual-regression": "*",
@@ -121,6 +121,9 @@
121
121
  ".": "./src/index.tsx"
122
122
  },
123
123
  "platform-feature-flags": {
124
+ "platform_ads_component_no_icon_spacing_support": {
125
+ "type": "boolean"
126
+ },
124
127
  "platform_button_item-add-ufo-metrics": {
125
128
  "type": "boolean"
126
129
  }