@atlaskit/atlassian-navigation 5.1.3 → 5.1.5

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/atlassian-navigation
2
2
 
3
+ ## 5.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 5.1.4
10
+
11
+ ### Patch Changes
12
+
13
+ - [#133393](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/133393)
14
+ [`379be130e4891`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/379be130e4891) -
15
+ Fixes bug with internal feature flagging logic
16
+
3
17
  ## 5.1.3
4
18
 
5
19
  ### Patch Changes
@@ -11,6 +11,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
11
11
  var _react = require("react");
12
12
  var _react2 = require("@emotion/react");
13
13
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
+ var _colors = require("@atlaskit/theme/colors");
14
15
  var _constants = require("../../common/constants");
15
16
  var _theme = require("../../theme");
16
17
  var _utils = require("../../utils");
@@ -135,11 +136,21 @@ var ProductHome = function ProductHome(_ref) {
135
136
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
136
137
  var theme = (0, _theme.useTheme)();
137
138
  var primaryButton = theme.mode.primaryButton;
139
+ // After the brand refresh, iconColor and textColor should be set to 'undefined' to allow the original
140
+ // multi-color logo tile colors to be visible, rather than a hardcoded blue.
138
141
  var _theme$mode$productHo = theme.mode.productHome,
139
142
  _theme$mode$productHo2 = _theme$mode$productHo.iconColor,
140
143
  iconColor = _theme$mode$productHo2 === void 0 ? (0, _platformFeatureFlags.fg)('platform-team25-app-icon-tiles') ? undefined : 'inherit' : _theme$mode$productHo2,
141
144
  _theme$mode$productHo3 = _theme$mode$productHo.textColor,
142
145
  textColor = _theme$mode$productHo3 === void 0 ? (0, _platformFeatureFlags.fg)('platform-team25-app-icon-tiles') ? undefined : theme.mode.productHome.color : _theme$mode$productHo3;
146
+
147
+ // The default theme is set at module scope and immediately used in context.
148
+ // To allow the feature flag to switch the logo color at runtime, we also detect the original hardcoded
149
+ // values and override them to undefined.
150
+ if (iconColor === '#357DE8' && textColor === "var(--ds-text, ".concat(_colors.N700, ")") && (0, _platformFeatureFlags.fg)('platform-team25-app-icon-tiles')) {
151
+ iconColor = undefined;
152
+ textColor = undefined;
153
+ }
143
154
  var Tag = (0, _utils2.getTag)(onClick, href);
144
155
  var preventFocusRing = function preventFocusRing(e) {
145
156
  e.preventDefault();
@@ -164,12 +175,18 @@ var ProductHome = function ProductHome(_ref) {
164
175
  }, (0, _react2.jsx)(Logo, {
165
176
  iconColor: iconColor,
166
177
  textColor: textColor
178
+ // @ts-ignore - The new icons don't have an appearance prop at the moment
179
+ ,
180
+ appearance: (0, _platformFeatureFlags.fg)('platform-team25-app-icon-tiles') ? 'brand' : undefined
167
181
  })), (0, _react2.jsx)("div", {
168
182
  css: [customMaxHeightStyles, productIconStyles],
169
183
  "data-testid": testId && "".concat(testId, "-icon")
170
184
  }, (0, _react2.jsx)(Icon, {
171
185
  iconColor: iconColor,
172
186
  size: (0, _platformFeatureFlags.fg)('platform-team25-app-icon-tiles') ? 'small' : undefined
187
+ // @ts-ignore - The new icons don't have an appearance prop at the moment
188
+ ,
189
+ appearance: (0, _platformFeatureFlags.fg)('platform-team25-app-icon-tiles') ? 'brand' : undefined
173
190
  }))), siteTitle && (0, _react2.jsx)("div", {
174
191
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
175
192
  style: {
@@ -135,10 +135,11 @@ var defaultTheme = {
135
135
  };
136
136
 
137
137
  // Create deep copy of defaultTheme
138
- var defaultThemeBrandRefresh = exports.defaultThemeBrandRefresh = JSON.parse(JSON.stringify(defaultTheme));
138
+ var defaultThemeCopy = JSON.parse(JSON.stringify(defaultTheme));
139
139
 
140
140
  // Update iconColor and textColor in defaultThemeBrandRefresh
141
- defaultThemeBrandRefresh.mode.productHome.iconColor = undefined;
142
- defaultThemeBrandRefresh.mode.productHome.textColor = undefined;
141
+ defaultThemeCopy.mode.productHome.iconColor = undefined;
142
+ defaultThemeCopy.mode.productHome.textColor = undefined;
143
+ var defaultThemeBrandRefresh = exports.defaultThemeBrandRefresh = defaultThemeCopy;
143
144
  var DEFAULT_THEME_NAME = exports.DEFAULT_THEME_NAME = 'atlassian';
144
145
  var _default = exports.default = defaultTheme;
@@ -8,6 +8,7 @@ import { Fragment } from 'react';
8
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
9
  import { css, jsx } from '@emotion/react';
10
10
  import { fg } from '@atlaskit/platform-feature-flags';
11
+ import { N700 } from '@atlaskit/theme/colors';
11
12
  import { PRODUCT_HOME_BREAKPOINT } from '../../common/constants';
12
13
  import { useTheme } from '../../theme';
13
14
  import { stripEmptyProperties } from '../../utils';
@@ -134,10 +135,20 @@ const ProductHome = ({
134
135
  }) => {
135
136
  const theme = useTheme();
136
137
  const primaryButton = theme.mode.primaryButton;
137
- const {
138
+ // After the brand refresh, iconColor and textColor should be set to 'undefined' to allow the original
139
+ // multi-color logo tile colors to be visible, rather than a hardcoded blue.
140
+ let {
138
141
  iconColor = fg('platform-team25-app-icon-tiles') ? undefined : 'inherit',
139
142
  textColor = fg('platform-team25-app-icon-tiles') ? undefined : theme.mode.productHome.color
140
143
  } = theme.mode.productHome;
144
+
145
+ // The default theme is set at module scope and immediately used in context.
146
+ // To allow the feature flag to switch the logo color at runtime, we also detect the original hardcoded
147
+ // values and override them to undefined.
148
+ if (iconColor === '#357DE8' && textColor === `var(--ds-text, ${N700})` && fg('platform-team25-app-icon-tiles')) {
149
+ iconColor = undefined;
150
+ textColor = undefined;
151
+ }
141
152
  const Tag = getTag(onClick, href);
142
153
  const preventFocusRing = e => {
143
154
  e.preventDefault();
@@ -173,12 +184,18 @@ const ProductHome = ({
173
184
  }, jsx(Logo, {
174
185
  iconColor: iconColor,
175
186
  textColor: textColor
187
+ // @ts-ignore - The new icons don't have an appearance prop at the moment
188
+ ,
189
+ appearance: fg('platform-team25-app-icon-tiles') ? 'brand' : undefined
176
190
  })), jsx("div", {
177
191
  css: [customMaxHeightStyles, productIconStyles],
178
192
  "data-testid": testId && `${testId}-icon`
179
193
  }, jsx(Icon, {
180
194
  iconColor: iconColor,
181
195
  size: fg('platform-team25-app-icon-tiles') ? 'small' : undefined
196
+ // @ts-ignore - The new icons don't have an appearance prop at the moment
197
+ ,
198
+ appearance: fg('platform-team25-app-icon-tiles') ? 'brand' : undefined
182
199
  }))), siteTitle && jsx("div", {
183
200
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
184
201
  style: {
@@ -129,10 +129,11 @@ const defaultTheme = {
129
129
  };
130
130
 
131
131
  // Create deep copy of defaultTheme
132
- export const defaultThemeBrandRefresh = JSON.parse(JSON.stringify(defaultTheme));
132
+ const defaultThemeCopy = JSON.parse(JSON.stringify(defaultTheme));
133
133
 
134
134
  // Update iconColor and textColor in defaultThemeBrandRefresh
135
- defaultThemeBrandRefresh.mode.productHome.iconColor = undefined;
136
- defaultThemeBrandRefresh.mode.productHome.textColor = undefined;
135
+ defaultThemeCopy.mode.productHome.iconColor = undefined;
136
+ defaultThemeCopy.mode.productHome.textColor = undefined;
137
+ export const defaultThemeBrandRefresh = defaultThemeCopy;
137
138
  export const DEFAULT_THEME_NAME = 'atlassian';
138
139
  export default defaultTheme;
@@ -11,6 +11,7 @@ import { Fragment } from 'react';
11
11
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
12
12
  import { css, jsx } from '@emotion/react';
13
13
  import { fg } from '@atlaskit/platform-feature-flags';
14
+ import { N700 } from '@atlaskit/theme/colors';
14
15
  import { PRODUCT_HOME_BREAKPOINT } from '../../common/constants';
15
16
  import { useTheme } from '../../theme';
16
17
  import { stripEmptyProperties } from '../../utils';
@@ -129,11 +130,21 @@ var ProductHome = function ProductHome(_ref) {
129
130
  rest = _objectWithoutProperties(_ref, _excluded);
130
131
  var theme = useTheme();
131
132
  var primaryButton = theme.mode.primaryButton;
133
+ // After the brand refresh, iconColor and textColor should be set to 'undefined' to allow the original
134
+ // multi-color logo tile colors to be visible, rather than a hardcoded blue.
132
135
  var _theme$mode$productHo = theme.mode.productHome,
133
136
  _theme$mode$productHo2 = _theme$mode$productHo.iconColor,
134
137
  iconColor = _theme$mode$productHo2 === void 0 ? fg('platform-team25-app-icon-tiles') ? undefined : 'inherit' : _theme$mode$productHo2,
135
138
  _theme$mode$productHo3 = _theme$mode$productHo.textColor,
136
139
  textColor = _theme$mode$productHo3 === void 0 ? fg('platform-team25-app-icon-tiles') ? undefined : theme.mode.productHome.color : _theme$mode$productHo3;
140
+
141
+ // The default theme is set at module scope and immediately used in context.
142
+ // To allow the feature flag to switch the logo color at runtime, we also detect the original hardcoded
143
+ // values and override them to undefined.
144
+ if (iconColor === '#357DE8' && textColor === "var(--ds-text, ".concat(N700, ")") && fg('platform-team25-app-icon-tiles')) {
145
+ iconColor = undefined;
146
+ textColor = undefined;
147
+ }
137
148
  var Tag = getTag(onClick, href);
138
149
  var preventFocusRing = function preventFocusRing(e) {
139
150
  e.preventDefault();
@@ -158,12 +169,18 @@ var ProductHome = function ProductHome(_ref) {
158
169
  }, jsx(Logo, {
159
170
  iconColor: iconColor,
160
171
  textColor: textColor
172
+ // @ts-ignore - The new icons don't have an appearance prop at the moment
173
+ ,
174
+ appearance: fg('platform-team25-app-icon-tiles') ? 'brand' : undefined
161
175
  })), jsx("div", {
162
176
  css: [customMaxHeightStyles, productIconStyles],
163
177
  "data-testid": testId && "".concat(testId, "-icon")
164
178
  }, jsx(Icon, {
165
179
  iconColor: iconColor,
166
180
  size: fg('platform-team25-app-icon-tiles') ? 'small' : undefined
181
+ // @ts-ignore - The new icons don't have an appearance prop at the moment
182
+ ,
183
+ appearance: fg('platform-team25-app-icon-tiles') ? 'brand' : undefined
167
184
  }))), siteTitle && jsx("div", {
168
185
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
169
186
  style: {
@@ -129,10 +129,11 @@ var defaultTheme = {
129
129
  };
130
130
 
131
131
  // Create deep copy of defaultTheme
132
- export var defaultThemeBrandRefresh = JSON.parse(JSON.stringify(defaultTheme));
132
+ var defaultThemeCopy = JSON.parse(JSON.stringify(defaultTheme));
133
133
 
134
134
  // Update iconColor and textColor in defaultThemeBrandRefresh
135
- defaultThemeBrandRefresh.mode.productHome.iconColor = undefined;
136
- defaultThemeBrandRefresh.mode.productHome.textColor = undefined;
135
+ defaultThemeCopy.mode.productHome.iconColor = undefined;
136
+ defaultThemeCopy.mode.productHome.textColor = undefined;
137
+ export var defaultThemeBrandRefresh = defaultThemeCopy;
137
138
  export var DEFAULT_THEME_NAME = 'atlassian';
138
139
  export default defaultTheme;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/atlassian-navigation",
3
- "version": "5.1.3",
3
+ "version": "5.1.5",
4
4
  "description": "A horizontal navigation component for Atlassian products.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -48,13 +48,13 @@
48
48
  "@atlaskit/analytics-namespaced-context": "^7.0.0",
49
49
  "@atlaskit/button": "^23.0.0",
50
50
  "@atlaskit/ds-lib": "^4.0.0",
51
- "@atlaskit/icon": "^25.4.0",
51
+ "@atlaskit/icon": "^25.5.0",
52
52
  "@atlaskit/logo": "^16.0.0",
53
53
  "@atlaskit/platform-feature-flags": "^1.1.0",
54
- "@atlaskit/popup": "^3.0.0",
55
- "@atlaskit/primitives": "^14.2.0",
54
+ "@atlaskit/popup": "^4.0.0",
55
+ "@atlaskit/primitives": "^14.3.0",
56
56
  "@atlaskit/theme": "^18.0.0",
57
- "@atlaskit/tokens": "^4.5.0",
57
+ "@atlaskit/tokens": "^4.7.0",
58
58
  "@atlaskit/tooltip": "^20.0.0",
59
59
  "@atlaskit/width-detector": "^5.0.0",
60
60
  "@babel/runtime": "^7.0.0",
@@ -74,7 +74,7 @@
74
74
  "@atlaskit/avatar": "^25.0.0",
75
75
  "@atlaskit/badge": "^18.1.0",
76
76
  "@atlaskit/docs": "^10.0.0",
77
- "@atlaskit/drawer": "^10.0.0",
77
+ "@atlaskit/drawer": "^10.1.0",
78
78
  "@atlaskit/dropdown-menu": "^14.0.0",
79
79
  "@atlaskit/form": "^12.0.0",
80
80
  "@atlaskit/menu": "^3.2.0",
@@ -85,7 +85,7 @@
85
85
  "@atlaskit/temp-nav-app-icons": "^0.7.0",
86
86
  "@atlaskit/textfield": "^8.0.0",
87
87
  "@atlaskit/visual-regression": "^0.10.0",
88
- "@atlassian/switcher": "^35.19.0",
88
+ "@atlassian/switcher": "^35.20.0",
89
89
  "@atlassian/switcher-test-utils": "^4.1.0",
90
90
  "@testing-library/react": "^13.4.0",
91
91
  "@testing-library/react-hooks": "^8.0.1",