@atlaskit/atlassian-navigation 5.3.4 → 5.3.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,11 @@
1
1
  # @atlaskit/atlassian-navigation
2
2
 
3
+ ## 5.3.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
3
9
  ## 5.3.4
4
10
 
5
11
  ### Patch Changes
@@ -38,6 +38,9 @@
38
38
  {
39
39
  "path": "../../popup/afm-cc/tsconfig.json"
40
40
  },
41
+ {
42
+ "path": "../../primitives/afm-cc/tsconfig.json"
43
+ },
41
44
  {
42
45
  "path": "../../theme/afm-cc/tsconfig.json"
43
46
  },
@@ -38,6 +38,9 @@
38
38
  {
39
39
  "path": "../../popup/afm-jira/tsconfig.json"
40
40
  },
41
+ {
42
+ "path": "../../primitives/afm-jira/tsconfig.json"
43
+ },
41
44
  {
42
45
  "path": "../../theme/afm-jira/tsconfig.json"
43
46
  },
@@ -38,6 +38,9 @@
38
38
  {
39
39
  "path": "../../popup/afm-passionfruit/tsconfig.json"
40
40
  },
41
+ {
42
+ "path": "../../primitives/afm-passionfruit/tsconfig.json"
43
+ },
41
44
  {
42
45
  "path": "../../theme/afm-passionfruit/tsconfig.json"
43
46
  },
@@ -38,6 +38,9 @@
38
38
  {
39
39
  "path": "../../popup/afm-post-office/tsconfig.json"
40
40
  },
41
+ {
42
+ "path": "../../primitives/afm-post-office/tsconfig.json"
43
+ },
41
44
  {
42
45
  "path": "../../theme/afm-post-office/tsconfig.json"
43
46
  },
@@ -38,6 +38,9 @@
38
38
  {
39
39
  "path": "../../popup/afm-townsquare/tsconfig.json"
40
40
  },
41
+ {
42
+ "path": "../../primitives/afm-townsquare/tsconfig.json"
43
+ },
41
44
  {
42
45
  "path": "../../theme/afm-townsquare/tsconfig.json"
43
46
  },
@@ -0,0 +1,54 @@
1
+ {
2
+ "extends": "../../../../tsconfig.entry-points.volt.json",
3
+ "compilerOptions": {
4
+ "declaration": true,
5
+ "target": "es5",
6
+ "outDir": "../../../../../volt/tsDist/@atlaskit__atlassian-navigation/app",
7
+ "rootDir": "../",
8
+ "composite": true
9
+ },
10
+ "include": [
11
+ "../src/**/*.ts",
12
+ "../src/**/*.tsx"
13
+ ],
14
+ "exclude": [
15
+ "../src/**/__tests__/*",
16
+ "../src/**/*.test.*",
17
+ "../src/**/test.*"
18
+ ],
19
+ "references": [
20
+ {
21
+ "path": "../../../analytics/analytics-namespaced-context/afm-volt/tsconfig.json"
22
+ },
23
+ {
24
+ "path": "../../button/afm-volt/tsconfig.json"
25
+ },
26
+ {
27
+ "path": "../../ds-lib/afm-volt/tsconfig.json"
28
+ },
29
+ {
30
+ "path": "../../icon/afm-volt/tsconfig.json"
31
+ },
32
+ {
33
+ "path": "../../logo/afm-volt/tsconfig.json"
34
+ },
35
+ {
36
+ "path": "../../../platform/feature-flags/afm-volt/tsconfig.json"
37
+ },
38
+ {
39
+ "path": "../../popup/afm-volt/tsconfig.json"
40
+ },
41
+ {
42
+ "path": "../../theme/afm-volt/tsconfig.json"
43
+ },
44
+ {
45
+ "path": "../../tokens/afm-volt/tsconfig.json"
46
+ },
47
+ {
48
+ "path": "../../tooltip/afm-volt/tsconfig.json"
49
+ },
50
+ {
51
+ "path": "../../width-detector/afm-volt/tsconfig.json"
52
+ }
53
+ ]
54
+ }
@@ -1,9 +1,16 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
8
+ Object.defineProperty(exports, "AppHome", {
9
+ enumerable: true,
10
+ get: function get() {
11
+ return _productHome.AppHome;
12
+ }
13
+ });
7
14
  Object.defineProperty(exports, "CustomProductHome", {
8
15
  enumerable: true,
9
16
  get: function get() {
@@ -16,5 +23,6 @@ Object.defineProperty(exports, "ProductHome", {
16
23
  return _productHome.default;
17
24
  }
18
25
  });
19
- var _productHome = _interopRequireDefault(require("./product-home"));
20
- var _customProductHome = _interopRequireDefault(require("./custom-product-home"));
26
+ var _productHome = _interopRequireWildcard(require("./product-home"));
27
+ var _customProductHome = _interopRequireDefault(require("./custom-product-home"));
28
+ 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); }
@@ -4,19 +4,21 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.default = void 0;
7
+ exports.default = exports.AppHome = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
  var _react = require("react");
12
12
  var _react2 = require("@emotion/react");
13
13
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
+ var _primitives = require("@atlaskit/primitives");
14
15
  var _colors = require("@atlaskit/theme/colors");
15
16
  var _constants = require("../../common/constants");
16
17
  var _theme = require("../../theme");
17
18
  var _utils = require("../../utils");
18
19
  var _utils2 = require("./utils");
19
- var _excluded = ["aria-label", "href", "icon", "logo", "logoMaxWidth", "onClick", "onMouseDown", "siteTitle", "testId"];
20
+ var _excluded = ["aria-label", "href", "name", "icon", "onClick", "onMouseDown", "siteTitle", "testId"],
21
+ _excluded2 = ["aria-label", "href", "icon", "logo", "logoMaxWidth", "onClick", "onMouseDown", "siteTitle", "testId"];
20
22
  /**
21
23
  * @jsxRuntime classic
22
24
  * @jsx jsx
@@ -103,6 +105,20 @@ var productIconStyles = (0, _react2.css)((0, _defineProperty2.default)({
103
105
  }, "@media (min-width: ".concat(_constants.PRODUCT_HOME_BREAKPOINT, "px)"), {
104
106
  display: 'none'
105
107
  }));
108
+ var appHomeIconStyles = (0, _react2.css)({
109
+ borderRadius: '10px'
110
+ });
111
+ var appIconStyles = (0, _react2.css)({
112
+ display: 'flex',
113
+ maxWidth: 24
114
+ });
115
+ var appLogoTextStyles = (0, _react2.css)((0, _defineProperty2.default)({
116
+ // Logo text should never wrap or overflow
117
+ width: 'max-content',
118
+ paddingInlineEnd: "var(--ds-space-025, 2px)"
119
+ }, "@media (max-width: ".concat(_constants.PRODUCT_HOME_BREAKPOINT - 0.1, "px)"), {
120
+ display: 'none'
121
+ }));
106
122
  var siteTitleStyles = (0, _react2.css)({
107
123
  display: 'flex',
108
124
  alignItems: 'center',
@@ -112,23 +128,21 @@ var siteTitleStyles = (0, _react2.css)({
112
128
  });
113
129
 
114
130
  /**
115
- * __Product home__
131
+ * __App home__
116
132
  *
117
- * The ProductHome component displays the product visual identity composed of:
118
- * logo, icon, and optional text. Values for logo and icon are never displayed
119
- * at the same time, where icon is used only when space is restricted. Should be
120
- * passed into `AtlassianNavigation`'s `renderProductHome` prop.
133
+ * A variant of the ProductHome component designed for use with the updated app logos.
121
134
  *
122
- * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#product-home)
135
+ * Takes an icon, displayed at all viewport sizes, and a product name, which is
136
+ * displayed only at larger viewport sizes.
137
+ *
138
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#app-product-home)
123
139
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
124
140
  */
125
- var ProductHome = function ProductHome(_ref) {
141
+ var AppHome = exports.AppHome = function AppHome(_ref) {
126
142
  var ariaLabel = _ref['aria-label'],
127
143
  href = _ref.href,
144
+ name = _ref.name,
128
145
  Icon = _ref.icon,
129
- Logo = _ref.logo,
130
- _ref$logoMaxWidth = _ref.logoMaxWidth,
131
- logoMaxWidth = _ref$logoMaxWidth === void 0 ? 260 : _ref$logoMaxWidth,
132
146
  onClick = _ref.onClick,
133
147
  onMouseDown = _ref.onMouseDown,
134
148
  siteTitle = _ref.siteTitle,
@@ -140,9 +154,93 @@ var ProductHome = function ProductHome(_ref) {
140
154
  // multi-color logo tile colors to be visible, rather than a hardcoded blue.
141
155
  var _theme$mode$productHo = theme.mode.productHome,
142
156
  _theme$mode$productHo2 = _theme$mode$productHo.iconColor,
143
- iconColor = _theme$mode$productHo2 === void 0 ? (0, _platformFeatureFlags.fg)('platform-team25-app-icon-tiles') ? undefined : 'inherit' : _theme$mode$productHo2,
157
+ iconColor = _theme$mode$productHo2 === void 0 ? undefined : _theme$mode$productHo2,
144
158
  _theme$mode$productHo3 = _theme$mode$productHo.textColor,
145
- textColor = _theme$mode$productHo3 === void 0 ? (0, _platformFeatureFlags.fg)('platform-team25-app-icon-tiles') ? undefined : theme.mode.productHome.color : _theme$mode$productHo3;
159
+ textColor = _theme$mode$productHo3 === void 0 ? undefined : _theme$mode$productHo3;
160
+
161
+ // The default theme is set at module scope and immediately used in context.
162
+ // To allow the feature flag to switch the logo color at runtime, we also detect the original hardcoded
163
+ // values and override them to undefined.
164
+ if (iconColor === '#357DE8' && textColor === "var(--ds-text, ".concat(_colors.N700, ")")) {
165
+ iconColor = undefined;
166
+ textColor = undefined;
167
+ }
168
+ var Tag = (0, _utils2.getTag)(onClick, href);
169
+ var preventFocusRing = function preventFocusRing(e) {
170
+ e.preventDefault();
171
+ onMouseDown && onMouseDown(e);
172
+ };
173
+ var productHomeButtonDynamicStyles = (0, _utils.stripEmptyProperties)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, VAR_PRODUCT_HOME_COLOR_ACTIVE, primaryButton.active.color), VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE, primaryButton.active.backgroundColor), VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE, primaryButton.active.boxShadow), VAR_PRODUCT_HOME_COLOR_FOCUS, primaryButton.focus.color), VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS, primaryButton.focus.backgroundColor), VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS, primaryButton.focus.boxShadow), VAR_PRODUCT_HOME_COLOR_HOVER, primaryButton.hover.color), VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER, primaryButton.hover.backgroundColor), VAR_PRODUCT_HOME_BOX_SHADOW_HOVER, primaryButton.hover.boxShadow));
174
+ return (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(Tag
175
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
176
+ , (0, _extends2.default)({
177
+ style: productHomeButtonDynamicStyles,
178
+ css: [productHomeButtonStyles, appHomeIconStyles],
179
+ href: href,
180
+ onClick: onClick,
181
+ onMouseDown: preventFocusRing,
182
+ "data-testid": testId && "".concat(testId, "-container"),
183
+ "aria-label": ariaLabel
184
+ // Made all props explicit, leaving just in case
185
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
186
+ }, rest), (0, _react2.jsx)(_primitives.Inline, {
187
+ space: "space.075",
188
+ alignBlock: "center"
189
+ }, (0, _react2.jsx)("div", {
190
+ css: [appIconStyles],
191
+ "data-testid": testId && "".concat(testId, "-icon")
192
+ }, (0, _react2.jsx)(Icon, {
193
+ iconColor: iconColor,
194
+ shouldUseNewLogoDesign: true,
195
+ size: "small",
196
+ appearance: "brand"
197
+ })), (0, _react2.jsx)("span", {
198
+ css: appLogoTextStyles
199
+ }, (0, _react2.jsx)(_primitives.Text, {
200
+ "aria-hidden": true,
201
+ color: "inherit",
202
+ weight: "semibold"
203
+ }, name)))), siteTitle && (0, _react2.jsx)("div", {
204
+ style: {
205
+ borderRight: theme.mode.productHome.borderRight
206
+ },
207
+ css: siteTitleStyles,
208
+ "data-testid": testId && "".concat(testId, "-site-title")
209
+ }, siteTitle));
210
+ };
211
+
212
+ /**
213
+ * __Product home__
214
+ *
215
+ * The ProductHome component displays the product visual identity composed of:
216
+ * logo, icon, and optional text. Values for logo and icon are never displayed
217
+ * at the same time, where icon is used only when space is restricted. Should be
218
+ * passed into `AtlassianNavigation`'s `renderProductHome` prop.
219
+ *
220
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#product-home)
221
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
222
+ */
223
+ var ProductHome = function ProductHome(_ref2) {
224
+ var ariaLabel = _ref2['aria-label'],
225
+ href = _ref2.href,
226
+ Icon = _ref2.icon,
227
+ Logo = _ref2.logo,
228
+ _ref2$logoMaxWidth = _ref2.logoMaxWidth,
229
+ logoMaxWidth = _ref2$logoMaxWidth === void 0 ? 260 : _ref2$logoMaxWidth,
230
+ onClick = _ref2.onClick,
231
+ onMouseDown = _ref2.onMouseDown,
232
+ siteTitle = _ref2.siteTitle,
233
+ testId = _ref2.testId,
234
+ rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
235
+ var theme = (0, _theme.useTheme)();
236
+ var primaryButton = theme.mode.primaryButton;
237
+ // After the brand refresh, iconColor and textColor should be set to 'undefined' to allow the original
238
+ // multi-color logo tile colors to be visible, rather than a hardcoded blue.
239
+ var _theme$mode$productHo4 = theme.mode.productHome,
240
+ _theme$mode$productHo5 = _theme$mode$productHo4.iconColor,
241
+ iconColor = _theme$mode$productHo5 === void 0 ? (0, _platformFeatureFlags.fg)('platform-team25-app-icon-tiles') ? undefined : 'inherit' : _theme$mode$productHo5,
242
+ _theme$mode$productHo6 = _theme$mode$productHo4.textColor,
243
+ textColor = _theme$mode$productHo6 === void 0 ? (0, _platformFeatureFlags.fg)('platform-team25-app-icon-tiles') ? undefined : theme.mode.productHome.color : _theme$mode$productHo6;
146
244
 
147
245
  // The default theme is set at module scope and immediately used in context.
148
246
  // To allow the feature flag to switch the logo color at runtime, we also detect the original hardcoded
package/dist/cjs/index.js CHANGED
@@ -3,6 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ Object.defineProperty(exports, "AppHome", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _ProductHome.AppHome;
10
+ }
11
+ });
6
12
  Object.defineProperty(exports, "AppSwitcher", {
7
13
  enumerable: true,
8
14
  get: function get() {
@@ -1,2 +1,2 @@
1
- export { default as ProductHome } from './product-home';
1
+ export { default as ProductHome, AppHome } from './product-home';
2
2
  export { default as CustomProductHome } from './custom-product-home';
@@ -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 { Inline, Text } from '@atlaskit/primitives';
11
12
  import { N700 } from '@atlaskit/theme/colors';
12
13
  import { PRODUCT_HOME_BREAKPOINT } from '../../common/constants';
13
14
  import { useTheme } from '../../theme';
@@ -102,6 +103,22 @@ const productIconStyles = css({
102
103
  display: 'none'
103
104
  }
104
105
  });
106
+ const appHomeIconStyles = css({
107
+ borderRadius: '10px'
108
+ });
109
+ const appIconStyles = css({
110
+ display: 'flex',
111
+ maxWidth: 24
112
+ });
113
+ const appLogoTextStyles = css({
114
+ // Logo text should never wrap or overflow
115
+ width: 'max-content',
116
+ paddingInlineEnd: "var(--ds-space-025, 2px)",
117
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
118
+ [`@media (max-width: ${PRODUCT_HOME_BREAKPOINT - 0.1}px)`]: {
119
+ display: 'none'
120
+ }
121
+ });
105
122
  const siteTitleStyles = css({
106
123
  display: 'flex',
107
124
  alignItems: 'center',
@@ -110,6 +127,98 @@ const siteTitleStyles = css({
110
127
  paddingInlineEnd: "var(--ds-space-200, 16px)"
111
128
  });
112
129
 
130
+ /**
131
+ * __App home__
132
+ *
133
+ * A variant of the ProductHome component designed for use with the updated app logos.
134
+ *
135
+ * Takes an icon, displayed at all viewport sizes, and a product name, which is
136
+ * displayed only at larger viewport sizes.
137
+ *
138
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#app-product-home)
139
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
140
+ */
141
+ export const AppHome = ({
142
+ 'aria-label': ariaLabel,
143
+ href,
144
+ name,
145
+ icon: Icon,
146
+ onClick,
147
+ onMouseDown,
148
+ siteTitle,
149
+ testId,
150
+ ...rest
151
+ }) => {
152
+ const theme = useTheme();
153
+ const primaryButton = theme.mode.primaryButton;
154
+ // After the brand refresh, iconColor and textColor should be set to 'undefined' to allow the original
155
+ // multi-color logo tile colors to be visible, rather than a hardcoded blue.
156
+ let {
157
+ iconColor = undefined,
158
+ textColor = undefined
159
+ } = theme.mode.productHome;
160
+
161
+ // The default theme is set at module scope and immediately used in context.
162
+ // To allow the feature flag to switch the logo color at runtime, we also detect the original hardcoded
163
+ // values and override them to undefined.
164
+ if (iconColor === '#357DE8' && textColor === `var(--ds-text, ${N700})`) {
165
+ iconColor = undefined;
166
+ textColor = undefined;
167
+ }
168
+ const Tag = getTag(onClick, href);
169
+ const preventFocusRing = e => {
170
+ e.preventDefault();
171
+ onMouseDown && onMouseDown(e);
172
+ };
173
+ const productHomeButtonDynamicStyles = stripEmptyProperties({
174
+ [VAR_PRODUCT_HOME_COLOR_ACTIVE]: primaryButton.active.color,
175
+ [VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE]: primaryButton.active.backgroundColor,
176
+ [VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE]: primaryButton.active.boxShadow,
177
+ [VAR_PRODUCT_HOME_COLOR_FOCUS]: primaryButton.focus.color,
178
+ [VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS]: primaryButton.focus.backgroundColor,
179
+ [VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS]: primaryButton.focus.boxShadow,
180
+ [VAR_PRODUCT_HOME_COLOR_HOVER]: primaryButton.hover.color,
181
+ [VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER]: primaryButton.hover.backgroundColor,
182
+ [VAR_PRODUCT_HOME_BOX_SHADOW_HOVER]: primaryButton.hover.boxShadow
183
+ });
184
+ return jsx(Fragment, null, jsx(Tag
185
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
186
+ , _extends({
187
+ style: productHomeButtonDynamicStyles,
188
+ css: [productHomeButtonStyles, appHomeIconStyles],
189
+ href: href,
190
+ onClick: onClick,
191
+ onMouseDown: preventFocusRing,
192
+ "data-testid": testId && `${testId}-container`,
193
+ "aria-label": ariaLabel
194
+ // Made all props explicit, leaving just in case
195
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
196
+ }, rest), jsx(Inline, {
197
+ space: "space.075",
198
+ alignBlock: "center"
199
+ }, jsx("div", {
200
+ css: [appIconStyles],
201
+ "data-testid": testId && `${testId}-icon`
202
+ }, jsx(Icon, {
203
+ iconColor: iconColor,
204
+ shouldUseNewLogoDesign: true,
205
+ size: "small",
206
+ appearance: "brand"
207
+ })), jsx("span", {
208
+ css: appLogoTextStyles
209
+ }, jsx(Text, {
210
+ "aria-hidden": true,
211
+ color: "inherit",
212
+ weight: "semibold"
213
+ }, name)))), siteTitle && jsx("div", {
214
+ style: {
215
+ borderRight: theme.mode.productHome.borderRight
216
+ },
217
+ css: siteTitleStyles,
218
+ "data-testid": testId && `${testId}-site-title`
219
+ }, siteTitle));
220
+ };
221
+
113
222
  /**
114
223
  * __Product home__
115
224
  *
@@ -6,7 +6,7 @@ export { Notifications } from './components/Notifications';
6
6
  export { PrimaryButton } from './components/PrimaryButton';
7
7
  export { PrimaryDropdownButton } from './components/PrimaryDropdownButton';
8
8
  export { IconButton } from './components/IconButton';
9
- export { CustomProductHome, ProductHome } from './components/ProductHome';
9
+ export { CustomProductHome, ProductHome, AppHome } from './components/ProductHome';
10
10
  export { Profile } from './components/Profile';
11
11
  export { Search } from './components/Search';
12
12
  export { Settings } from './components/Settings';
@@ -1,2 +1,2 @@
1
- export { default as ProductHome } from './product-home';
1
+ export { default as ProductHome, AppHome } from './product-home';
2
2
  export { default as CustomProductHome } from './custom-product-home';
@@ -1,7 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- var _excluded = ["aria-label", "href", "icon", "logo", "logoMaxWidth", "onClick", "onMouseDown", "siteTitle", "testId"];
4
+ var _excluded = ["aria-label", "href", "name", "icon", "onClick", "onMouseDown", "siteTitle", "testId"],
5
+ _excluded2 = ["aria-label", "href", "icon", "logo", "logoMaxWidth", "onClick", "onMouseDown", "siteTitle", "testId"];
5
6
  /**
6
7
  * @jsxRuntime classic
7
8
  * @jsx jsx
@@ -11,6 +12,7 @@ import { Fragment } from 'react';
11
12
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
12
13
  import { css, jsx } from '@emotion/react';
13
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
+ import { Inline, Text } from '@atlaskit/primitives';
14
16
  import { N700 } from '@atlaskit/theme/colors';
15
17
  import { PRODUCT_HOME_BREAKPOINT } from '../../common/constants';
16
18
  import { useTheme } from '../../theme';
@@ -97,6 +99,20 @@ var productIconStyles = css(_defineProperty({
97
99
  }, "@media (min-width: ".concat(PRODUCT_HOME_BREAKPOINT, "px)"), {
98
100
  display: 'none'
99
101
  }));
102
+ var appHomeIconStyles = css({
103
+ borderRadius: '10px'
104
+ });
105
+ var appIconStyles = css({
106
+ display: 'flex',
107
+ maxWidth: 24
108
+ });
109
+ var appLogoTextStyles = css(_defineProperty({
110
+ // Logo text should never wrap or overflow
111
+ width: 'max-content',
112
+ paddingInlineEnd: "var(--ds-space-025, 2px)"
113
+ }, "@media (max-width: ".concat(PRODUCT_HOME_BREAKPOINT - 0.1, "px)"), {
114
+ display: 'none'
115
+ }));
100
116
  var siteTitleStyles = css({
101
117
  display: 'flex',
102
118
  alignItems: 'center',
@@ -106,23 +122,21 @@ var siteTitleStyles = css({
106
122
  });
107
123
 
108
124
  /**
109
- * __Product home__
125
+ * __App home__
110
126
  *
111
- * The ProductHome component displays the product visual identity composed of:
112
- * logo, icon, and optional text. Values for logo and icon are never displayed
113
- * at the same time, where icon is used only when space is restricted. Should be
114
- * passed into `AtlassianNavigation`'s `renderProductHome` prop.
127
+ * A variant of the ProductHome component designed for use with the updated app logos.
115
128
  *
116
- * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#product-home)
129
+ * Takes an icon, displayed at all viewport sizes, and a product name, which is
130
+ * displayed only at larger viewport sizes.
131
+ *
132
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#app-product-home)
117
133
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
118
134
  */
119
- var ProductHome = function ProductHome(_ref) {
135
+ export var AppHome = function AppHome(_ref) {
120
136
  var ariaLabel = _ref['aria-label'],
121
137
  href = _ref.href,
138
+ name = _ref.name,
122
139
  Icon = _ref.icon,
123
- Logo = _ref.logo,
124
- _ref$logoMaxWidth = _ref.logoMaxWidth,
125
- logoMaxWidth = _ref$logoMaxWidth === void 0 ? 260 : _ref$logoMaxWidth,
126
140
  onClick = _ref.onClick,
127
141
  onMouseDown = _ref.onMouseDown,
128
142
  siteTitle = _ref.siteTitle,
@@ -134,9 +148,93 @@ var ProductHome = function ProductHome(_ref) {
134
148
  // multi-color logo tile colors to be visible, rather than a hardcoded blue.
135
149
  var _theme$mode$productHo = theme.mode.productHome,
136
150
  _theme$mode$productHo2 = _theme$mode$productHo.iconColor,
137
- iconColor = _theme$mode$productHo2 === void 0 ? fg('platform-team25-app-icon-tiles') ? undefined : 'inherit' : _theme$mode$productHo2,
151
+ iconColor = _theme$mode$productHo2 === void 0 ? undefined : _theme$mode$productHo2,
138
152
  _theme$mode$productHo3 = _theme$mode$productHo.textColor,
139
- textColor = _theme$mode$productHo3 === void 0 ? fg('platform-team25-app-icon-tiles') ? undefined : theme.mode.productHome.color : _theme$mode$productHo3;
153
+ textColor = _theme$mode$productHo3 === void 0 ? undefined : _theme$mode$productHo3;
154
+
155
+ // The default theme is set at module scope and immediately used in context.
156
+ // To allow the feature flag to switch the logo color at runtime, we also detect the original hardcoded
157
+ // values and override them to undefined.
158
+ if (iconColor === '#357DE8' && textColor === "var(--ds-text, ".concat(N700, ")")) {
159
+ iconColor = undefined;
160
+ textColor = undefined;
161
+ }
162
+ var Tag = getTag(onClick, href);
163
+ var preventFocusRing = function preventFocusRing(e) {
164
+ e.preventDefault();
165
+ onMouseDown && onMouseDown(e);
166
+ };
167
+ var productHomeButtonDynamicStyles = stripEmptyProperties(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, VAR_PRODUCT_HOME_COLOR_ACTIVE, primaryButton.active.color), VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE, primaryButton.active.backgroundColor), VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE, primaryButton.active.boxShadow), VAR_PRODUCT_HOME_COLOR_FOCUS, primaryButton.focus.color), VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS, primaryButton.focus.backgroundColor), VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS, primaryButton.focus.boxShadow), VAR_PRODUCT_HOME_COLOR_HOVER, primaryButton.hover.color), VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER, primaryButton.hover.backgroundColor), VAR_PRODUCT_HOME_BOX_SHADOW_HOVER, primaryButton.hover.boxShadow));
168
+ return jsx(Fragment, null, jsx(Tag
169
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
170
+ , _extends({
171
+ style: productHomeButtonDynamicStyles,
172
+ css: [productHomeButtonStyles, appHomeIconStyles],
173
+ href: href,
174
+ onClick: onClick,
175
+ onMouseDown: preventFocusRing,
176
+ "data-testid": testId && "".concat(testId, "-container"),
177
+ "aria-label": ariaLabel
178
+ // Made all props explicit, leaving just in case
179
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
180
+ }, rest), jsx(Inline, {
181
+ space: "space.075",
182
+ alignBlock: "center"
183
+ }, jsx("div", {
184
+ css: [appIconStyles],
185
+ "data-testid": testId && "".concat(testId, "-icon")
186
+ }, jsx(Icon, {
187
+ iconColor: iconColor,
188
+ shouldUseNewLogoDesign: true,
189
+ size: "small",
190
+ appearance: "brand"
191
+ })), jsx("span", {
192
+ css: appLogoTextStyles
193
+ }, jsx(Text, {
194
+ "aria-hidden": true,
195
+ color: "inherit",
196
+ weight: "semibold"
197
+ }, name)))), siteTitle && jsx("div", {
198
+ style: {
199
+ borderRight: theme.mode.productHome.borderRight
200
+ },
201
+ css: siteTitleStyles,
202
+ "data-testid": testId && "".concat(testId, "-site-title")
203
+ }, siteTitle));
204
+ };
205
+
206
+ /**
207
+ * __Product home__
208
+ *
209
+ * The ProductHome component displays the product visual identity composed of:
210
+ * logo, icon, and optional text. Values for logo and icon are never displayed
211
+ * at the same time, where icon is used only when space is restricted. Should be
212
+ * passed into `AtlassianNavigation`'s `renderProductHome` prop.
213
+ *
214
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#product-home)
215
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
216
+ */
217
+ var ProductHome = function ProductHome(_ref2) {
218
+ var ariaLabel = _ref2['aria-label'],
219
+ href = _ref2.href,
220
+ Icon = _ref2.icon,
221
+ Logo = _ref2.logo,
222
+ _ref2$logoMaxWidth = _ref2.logoMaxWidth,
223
+ logoMaxWidth = _ref2$logoMaxWidth === void 0 ? 260 : _ref2$logoMaxWidth,
224
+ onClick = _ref2.onClick,
225
+ onMouseDown = _ref2.onMouseDown,
226
+ siteTitle = _ref2.siteTitle,
227
+ testId = _ref2.testId,
228
+ rest = _objectWithoutProperties(_ref2, _excluded2);
229
+ var theme = useTheme();
230
+ var primaryButton = theme.mode.primaryButton;
231
+ // After the brand refresh, iconColor and textColor should be set to 'undefined' to allow the original
232
+ // multi-color logo tile colors to be visible, rather than a hardcoded blue.
233
+ var _theme$mode$productHo4 = theme.mode.productHome,
234
+ _theme$mode$productHo5 = _theme$mode$productHo4.iconColor,
235
+ iconColor = _theme$mode$productHo5 === void 0 ? fg('platform-team25-app-icon-tiles') ? undefined : 'inherit' : _theme$mode$productHo5,
236
+ _theme$mode$productHo6 = _theme$mode$productHo4.textColor,
237
+ textColor = _theme$mode$productHo6 === void 0 ? fg('platform-team25-app-icon-tiles') ? undefined : theme.mode.productHome.color : _theme$mode$productHo6;
140
238
 
141
239
  // The default theme is set at module scope and immediately used in context.
142
240
  // To allow the feature flag to switch the logo color at runtime, we also detect the original hardcoded
package/dist/esm/index.js CHANGED
@@ -6,7 +6,7 @@ export { Notifications } from './components/Notifications';
6
6
  export { PrimaryButton } from './components/PrimaryButton';
7
7
  export { PrimaryDropdownButton } from './components/PrimaryDropdownButton';
8
8
  export { IconButton } from './components/IconButton';
9
- export { CustomProductHome, ProductHome } from './components/ProductHome';
9
+ export { CustomProductHome, ProductHome, AppHome } from './components/ProductHome';
10
10
  export { Profile } from './components/Profile';
11
11
  export { Search } from './components/Search';
12
12
  export { Settings } from './components/Settings';
@@ -1,2 +1,2 @@
1
- export { default as ProductHome } from './product-home';
1
+ export { default as ProductHome, AppHome } from './product-home';
2
2
  export { default as CustomProductHome } from './custom-product-home';
@@ -1,5 +1,17 @@
1
1
  import { jsx } from '@emotion/react';
2
- import { type ProductHomeProps } from './types';
2
+ import { type AppHomeProps, type ProductHomeProps } from './types';
3
+ /**
4
+ * __App home__
5
+ *
6
+ * A variant of the ProductHome component designed for use with the updated app logos.
7
+ *
8
+ * Takes an icon, displayed at all viewport sizes, and a product name, which is
9
+ * displayed only at larger viewport sizes.
10
+ *
11
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#app-product-home)
12
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
13
+ */
14
+ export declare const AppHome: ({ "aria-label": ariaLabel, href, name, icon: Icon, onClick, onMouseDown, siteTitle, testId, ...rest }: AppHomeProps) => jsx.JSX.Element;
3
15
  /**
4
16
  * __Product home__
5
17
  *
@@ -54,6 +54,52 @@ export interface ProductHomeProps {
54
54
  */
55
55
  'aria-label'?: string;
56
56
  }
57
+ export interface AppHomeProps {
58
+ /**
59
+ * The product icon.
60
+ * Expected to be an Icon from the Atlaskit Logo package. Visible at all screen sizes.
61
+ */
62
+ icon: ComponentType<LogoProps>;
63
+ /**
64
+ * The name of the app.
65
+ * Displays next to the icon, visible at larger screen sizes.
66
+ */
67
+ name: string;
68
+ /**
69
+ * Optional onClick handler.
70
+ */
71
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
72
+ /**
73
+ * Optional mouseDown handler.
74
+ */
75
+ onMouseDown?: (event: MouseEvent<HTMLElement>) => void;
76
+ /**
77
+ * Href to be passed to product home.
78
+ * Will add an interactive look and feel when defined.
79
+ */
80
+ href?: string;
81
+ /**
82
+ * Name of the site that appears next to the logo.
83
+ */
84
+ siteTitle?: string;
85
+ /**
86
+ A `testId` prop is provided for specified elements,
87
+ which is a unique string that appears as a data attribute `data-testid` in the rendered code,
88
+ serving as a hook for automated tests.
89
+
90
+ Will set these elements when defined:
91
+
92
+ - Root element of the component - `{testId}-container`
93
+ - Product logo shown at large screen sizes - `{testId}-logo`
94
+ - Product icon shown at small screen sizes - `{testId}-icon`
95
+ - Site title - `{testId}-site-title`
96
+ */
97
+ testId?: string;
98
+ /**
99
+ * Provide an accessible label, often used by screen readers.
100
+ */
101
+ 'aria-label'?: string;
102
+ }
57
103
  export interface CustomProductHomeProps {
58
104
  /**
59
105
  * Alt text for the icon that is displayed on small viewports.
@@ -14,8 +14,8 @@ export { PrimaryDropdownButton } from './components/PrimaryDropdownButton';
14
14
  export type { PrimaryDropdownButtonProps } from './components/PrimaryDropdownButton/types';
15
15
  export { IconButton } from './components/IconButton';
16
16
  export type { IconButtonProps } from './components/IconButton/types';
17
- export { CustomProductHome, ProductHome } from './components/ProductHome';
18
- export type { CustomProductHomeProps, ProductHomeProps } from './components/ProductHome/types';
17
+ export { CustomProductHome, ProductHome, AppHome } from './components/ProductHome';
18
+ export type { CustomProductHomeProps, ProductHomeProps, AppHomeProps, } from './components/ProductHome/types';
19
19
  export { Profile } from './components/Profile';
20
20
  export type { ProfileProps } from './components/Profile/types';
21
21
  export { Search } from './components/Search';
@@ -1,2 +1,2 @@
1
- export { default as ProductHome } from './product-home';
1
+ export { default as ProductHome, AppHome } from './product-home';
2
2
  export { default as CustomProductHome } from './custom-product-home';
@@ -1,5 +1,17 @@
1
1
  import { jsx } from '@emotion/react';
2
- import { type ProductHomeProps } from './types';
2
+ import { type AppHomeProps, type ProductHomeProps } from './types';
3
+ /**
4
+ * __App home__
5
+ *
6
+ * A variant of the ProductHome component designed for use with the updated app logos.
7
+ *
8
+ * Takes an icon, displayed at all viewport sizes, and a product name, which is
9
+ * displayed only at larger viewport sizes.
10
+ *
11
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#app-product-home)
12
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
13
+ */
14
+ export declare const AppHome: ({ "aria-label": ariaLabel, href, name, icon: Icon, onClick, onMouseDown, siteTitle, testId, ...rest }: AppHomeProps) => jsx.JSX.Element;
3
15
  /**
4
16
  * __Product home__
5
17
  *
@@ -54,6 +54,52 @@ export interface ProductHomeProps {
54
54
  */
55
55
  'aria-label'?: string;
56
56
  }
57
+ export interface AppHomeProps {
58
+ /**
59
+ * The product icon.
60
+ * Expected to be an Icon from the Atlaskit Logo package. Visible at all screen sizes.
61
+ */
62
+ icon: ComponentType<LogoProps>;
63
+ /**
64
+ * The name of the app.
65
+ * Displays next to the icon, visible at larger screen sizes.
66
+ */
67
+ name: string;
68
+ /**
69
+ * Optional onClick handler.
70
+ */
71
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
72
+ /**
73
+ * Optional mouseDown handler.
74
+ */
75
+ onMouseDown?: (event: MouseEvent<HTMLElement>) => void;
76
+ /**
77
+ * Href to be passed to product home.
78
+ * Will add an interactive look and feel when defined.
79
+ */
80
+ href?: string;
81
+ /**
82
+ * Name of the site that appears next to the logo.
83
+ */
84
+ siteTitle?: string;
85
+ /**
86
+ A `testId` prop is provided for specified elements,
87
+ which is a unique string that appears as a data attribute `data-testid` in the rendered code,
88
+ serving as a hook for automated tests.
89
+
90
+ Will set these elements when defined:
91
+
92
+ - Root element of the component - `{testId}-container`
93
+ - Product logo shown at large screen sizes - `{testId}-logo`
94
+ - Product icon shown at small screen sizes - `{testId}-icon`
95
+ - Site title - `{testId}-site-title`
96
+ */
97
+ testId?: string;
98
+ /**
99
+ * Provide an accessible label, often used by screen readers.
100
+ */
101
+ 'aria-label'?: string;
102
+ }
57
103
  export interface CustomProductHomeProps {
58
104
  /**
59
105
  * Alt text for the icon that is displayed on small viewports.
@@ -14,8 +14,8 @@ export { PrimaryDropdownButton } from './components/PrimaryDropdownButton';
14
14
  export type { PrimaryDropdownButtonProps } from './components/PrimaryDropdownButton/types';
15
15
  export { IconButton } from './components/IconButton';
16
16
  export type { IconButtonProps } from './components/IconButton/types';
17
- export { CustomProductHome, ProductHome } from './components/ProductHome';
18
- export type { CustomProductHomeProps, ProductHomeProps } from './components/ProductHome/types';
17
+ export { CustomProductHome, ProductHome, AppHome } from './components/ProductHome';
18
+ export type { CustomProductHomeProps, ProductHomeProps, AppHomeProps, } from './components/ProductHome/types';
19
19
  export { Profile } from './components/Profile';
20
20
  export type { ProfileProps } from './components/Profile/types';
21
21
  export { Search } from './components/Search';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/atlassian-navigation",
3
- "version": "5.3.4",
3
+ "version": "5.3.5",
4
4
  "description": "A horizontal navigation component for Atlassian products.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -39,21 +39,21 @@
39
39
  "category": "Navigation",
40
40
  "status": {
41
41
  "type": "intent-to-deprecate",
42
- "description": "We are in the process of building a new top navigation component: [@atlaskit/navigation-system](/components/navigation-system/top-navigation/examples) (For Atlassian employees only at this stage)"
42
+ "description": "We are planning on deprecating Atlassian navigation. We recommend using Navigation system instead. [View Navigation system documentation](/components/navigation-system)"
43
43
  }
44
- },
45
- "runReact18": true
44
+ }
46
45
  },
47
46
  "dependencies": {
48
47
  "@atlaskit/analytics-namespaced-context": "^7.0.0",
49
48
  "@atlaskit/button": "^23.2.0",
50
49
  "@atlaskit/ds-lib": "^4.0.0",
51
- "@atlaskit/icon": "^27.0.0",
52
- "@atlaskit/logo": "^19.1.0",
50
+ "@atlaskit/icon": "^27.3.0",
51
+ "@atlaskit/logo": "^19.5.0",
53
52
  "@atlaskit/platform-feature-flags": "^1.1.0",
54
53
  "@atlaskit/popup": "^4.3.0",
55
- "@atlaskit/theme": "^18.0.0",
56
- "@atlaskit/tokens": "^5.3.0",
54
+ "@atlaskit/primitives": "^14.10.0",
55
+ "@atlaskit/theme": "^19.0.0",
56
+ "@atlaskit/tokens": "^5.4.0",
57
57
  "@atlaskit/tooltip": "^20.3.0",
58
58
  "@atlaskit/width-detector": "^5.0.0",
59
59
  "@babel/runtime": "^7.0.0",
@@ -79,14 +79,13 @@
79
79
  "@atlaskit/menu": "^8.0.0",
80
80
  "@atlaskit/notification-indicator": "^10.0.0",
81
81
  "@atlaskit/notification-log-client": "^6.2.0",
82
- "@atlaskit/primitives": "^14.9.0",
83
82
  "@atlaskit/section-message": "^8.2.0",
84
83
  "@atlaskit/spinner": "^18.0.0",
85
- "@atlaskit/temp-nav-app-icons": "^0.8.0",
84
+ "@atlaskit/temp-nav-app-icons": "^0.9.0",
86
85
  "@atlaskit/textfield": "^8.0.0",
87
86
  "@atlaskit/visual-regression": "workspace:^",
88
- "@atlassian/switcher": "^36.11.0",
89
- "@atlassian/switcher-test-utils": "^6.0.0",
87
+ "@atlassian/switcher": "^36.14.0",
88
+ "@atlassian/switcher-test-utils": "^7.1.0",
90
89
  "@testing-library/react": "^13.4.0",
91
90
  "@testing-library/react-hooks": "^8.0.1",
92
91
  "@testing-library/user-event": "^14.4.3",