@atlaskit/navigation-system 0.177.0 → 0.177.2

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.
Files changed (70) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/constellation/index/examples.mdx +3 -5
  3. package/dist/cjs/ui/menu-item/expandable-menu-item/expandable-menu-item-trigger.compiled.css +1 -0
  4. package/dist/cjs/ui/menu-item/expandable-menu-item/expandable-menu-item-trigger.js +3 -2
  5. package/dist/cjs/ui/top-nav-items/nav-logo/app-logo.js +1 -2
  6. package/dist/es2019/ui/menu-item/expandable-menu-item/expandable-menu-item-trigger.compiled.css +1 -0
  7. package/dist/es2019/ui/menu-item/expandable-menu-item/expandable-menu-item-trigger.js +3 -2
  8. package/dist/es2019/ui/top-nav-items/nav-logo/app-logo.js +1 -2
  9. package/dist/esm/ui/menu-item/expandable-menu-item/expandable-menu-item-trigger.compiled.css +1 -0
  10. package/dist/esm/ui/menu-item/expandable-menu-item/expandable-menu-item-trigger.js +3 -2
  11. package/dist/esm/ui/top-nav-items/nav-logo/app-logo.js +1 -2
  12. package/examples/expandable-menu-item.tsx +13 -0
  13. package/examples/{constellation/interactive-layout.tsx → interactive-layout.tsx} +2 -2
  14. package/examples/{top-nav-with-temp-nav-app-icon.tsx → top-nav-with-temp-nav-app-icon-app-logo.tsx} +3 -1
  15. package/examples/top-nav-with-temp-nav-app-icon-custom-logo.tsx +63 -0
  16. package/package.json +6 -7
  17. package/src/__tests__/informational-vr-tests/__snapshots__/layering/layers-in-main-slot--desktop--platform-dst-nav4-layering-in-main-slot-fixes-false.png +0 -0
  18. package/src/__tests__/informational-vr-tests/__snapshots__/layering/layers-in-main-slot--desktop--platform-dst-nav4-layering-in-main-slot-fixes-true.png +0 -0
  19. package/src/__tests__/informational-vr-tests/__snapshots__/menu-items-deeply-nested/side-nav-with-deeply-nested-menu-items---nested-menu-item-selected--default.png +0 -0
  20. package/src/__tests__/informational-vr-tests/__snapshots__/menu-items-deeply-nested/side-nav-with-deeply-nested-menu-items---scrolled-to-the-end--default.png +0 -0
  21. package/src/__tests__/informational-vr-tests/__snapshots__/menu-items-deeply-nested/side-nav-with-deeply-nested-menu-items--default.png +0 -0
  22. package/src/__tests__/informational-vr-tests/__snapshots__/sidebar-drag-and-drop/sidebar-drag-and-drop---hover-bug--desktop-chrome.png +0 -0
  23. package/src/__tests__/informational-vr-tests/__snapshots__/sidebar-drag-and-drop/sidebar-drag-and-drop---hover-bug--desktop-firefox.png +0 -0
  24. package/src/__tests__/informational-vr-tests/__snapshots__/sidebar-drag-and-drop/sidebar-drag-and-drop---hover-bug--desktop-webkit.png +0 -0
  25. package/src/__tests__/informational-vr-tests/__snapshots__/sidebar-drag-and-drop/sidebar-drag-and-drop--desktop-chrome.png +0 -0
  26. package/src/__tests__/informational-vr-tests/__snapshots__/sidebar-drag-and-drop/sidebar-drag-and-drop--desktop-firefox.png +0 -0
  27. package/src/__tests__/informational-vr-tests/__snapshots__/sidebar-drag-and-drop/sidebar-drag-and-drop--desktop-webkit.png +0 -0
  28. package/src/ui/menu-item/__tests__/informational-vr-tests/__snapshots__/menu-item/link-menu-item---scroll-into-view-behavior--desktop-chrome.png +0 -0
  29. package/src/ui/menu-item/__tests__/informational-vr-tests/__snapshots__/menu-item/link-menu-item---scroll-into-view-behavior--desktop-firefox.png +0 -0
  30. package/src/ui/menu-item/__tests__/informational-vr-tests/__snapshots__/menu-item/link-menu-item---scroll-into-view-behavior--desktop-safari.png +0 -0
  31. package/src/ui/menu-item/__tests__/vr-tests/__snapshots__/expandable/expandable-menu-item-selected-with-icon--default.png +0 -0
  32. package/src/ui/menu-item/__tests__/vr-tests/__snapshots__/menu-item/button-menu-item-example--desktop-chrome.png +0 -0
  33. package/src/ui/menu-item/__tests__/vr-tests/__snapshots__/menu-item/button-menu-item-example--desktop-firefox.png +0 -0
  34. package/src/ui/menu-item/__tests__/vr-tests/__snapshots__/menu-item/button-menu-item-rtlexample--desktop-chrome.png +0 -0
  35. package/src/ui/menu-item/__tests__/vr-tests/__snapshots__/menu-item/button-menu-item-rtlexample--desktop-firefox.png +0 -0
  36. package/src/ui/menu-item/__tests__/vr-tests/__snapshots__/menu-item/link-menu-item-example--desktop-chrome.png +0 -0
  37. package/src/ui/menu-item/__tests__/vr-tests/__snapshots__/menu-item/link-menu-item-example--desktop-firefox.png +0 -0
  38. package/src/ui/menu-item/__tests__/vr-tests/__snapshots__/menu-item/link-menu-item-rtlexample--desktop-chrome.png +0 -0
  39. package/src/ui/menu-item/__tests__/vr-tests/__snapshots__/menu-item/link-menu-item-rtlexample--desktop-firefox.png +0 -0
  40. package/src/ui/menu-item/__tests__/vr-tests/__snapshots__/menu-item-conditional-tooltip/button-menu-item--content-long---description-long---default.png +0 -0
  41. package/src/ui/menu-item/__tests__/vr-tests/__snapshots__/menu-item-conditional-tooltip/button-menu-item--content-long---description-none---default.png +0 -0
  42. package/src/ui/menu-item/__tests__/vr-tests/__snapshots__/menu-item-conditional-tooltip/button-menu-item--content-long---description-short---default.png +0 -0
  43. package/src/ui/menu-item/__tests__/vr-tests/__snapshots__/menu-item-conditional-tooltip/button-menu-item--content-short---description-long---default.png +0 -0
  44. package/src/ui/menu-item/__tests__/vr-tests/__snapshots__/menu-item-conditional-tooltip/button-menu-item--content-short---description-none---default.png +0 -0
  45. package/src/ui/menu-item/__tests__/vr-tests/__snapshots__/menu-item-conditional-tooltip/button-menu-item--content-short---description-short---default.png +0 -0
  46. package/src/ui/menu-item/__tests__/vr-tests/__snapshots__/menu-item-conditional-tooltip/button-menu-item-add-action-button--default.png +0 -0
  47. package/src/ui/menu-item/__tests__/vr-tests/__snapshots__/menu-item-conditional-tooltip/button-menu-item-with-tooltip-disabled--default.png +0 -0
  48. package/src/ui/menu-item/__tests__/vr-tests/__snapshots__/menu-item-conditional-tooltip/link-menu-item--content-long---description-long---default.png +0 -0
  49. package/src/ui/menu-item/__tests__/vr-tests/__snapshots__/menu-item-conditional-tooltip/link-menu-item--content-long---description-none---default.png +0 -0
  50. package/src/ui/menu-item/__tests__/vr-tests/__snapshots__/menu-item-conditional-tooltip/link-menu-item--content-long---description-short---default.png +0 -0
  51. package/src/ui/menu-item/__tests__/vr-tests/__snapshots__/menu-item-conditional-tooltip/link-menu-item--content-short---description-long---default.png +0 -0
  52. package/src/ui/menu-item/__tests__/vr-tests/__snapshots__/menu-item-conditional-tooltip/link-menu-item--content-short---description-none---default.png +0 -0
  53. package/src/ui/menu-item/__tests__/vr-tests/__snapshots__/menu-item-conditional-tooltip/link-menu-item--content-short---description-short---default.png +0 -0
  54. package/src/ui/menu-item/__tests__/vr-tests/__snapshots__/menu-item-conditional-tooltip/link-menu-item-with-tooltip-disabled--default.png +0 -0
  55. package/src/ui/menu-item/__tests__/vr-tests/__snapshots__/menu-item-conditional-tooltip/menu-item-button-with-nested-children--default.png +0 -0
  56. package/src/ui/menu-item/expandable-menu-item/expandable-menu-item-trigger.tsx +10 -1
  57. package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/page-layout/large-panel-default-width-on-mobile--desktop--platform-design-system-nav4-panel-mobile-width-fix-false.png +0 -0
  58. package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/page-layout/large-panel-default-width-on-mobile--desktop--platform-design-system-nav4-panel-mobile-width-fix-true.png +0 -0
  59. package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/page-layout/small-panel-default-width-on-mobile--desktop--platform-design-system-nav4-panel-mobile-width-fix-false.png +0 -0
  60. package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/page-layout/small-panel-default-width-on-mobile--desktop--platform-design-system-nav4-panel-mobile-width-fix-true.png +0 -0
  61. package/src/ui/page-layout/__tests__/unit/_test-utils.tsx +0 -52
  62. package/src/ui/page-layout/__tests__/unit/panel-splitter-and-suspense.test.tsx +9 -4
  63. package/src/ui/page-layout/__tests__/unit/react-safety.test.tsx +25 -0
  64. package/src/ui/page-layout/__tests__/vr-tests/__snapshots__/page-layout/panel-default-background-color--desktop.png +0 -0
  65. package/src/ui/page-layout/__tests__/vr-tests/__snapshots__/page-layout/panel-should-have-correct-width-when-there-is-no-sidenav-mounted--desktop.png +0 -0
  66. package/src/ui/page-layout/__tests__/vr-tests/__snapshots__/page-layout/side-nav-content-slot---scroll-with-sticky-child--desktop.png +0 -0
  67. package/src/ui/page-layout/__tests__/vr-tests/__snapshots__/page-layout/side-nav-slots--desktop.png +0 -0
  68. package/src/ui/top-nav-items/__tests__/informational-vr-tests/top-navigation.vr.tsx +3 -3
  69. package/src/ui/top-nav-items/nav-logo/app-logo.tsx +1 -6
  70. package/src/ui/page-layout/__tests__/unit/suspense.test.tsx +0 -13
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlassian/navigation-system
2
2
 
3
+ ## 0.177.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#198583](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/198583)
8
+ [`eaabec48bbfdc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/eaabec48bbfdc) -
9
+ Minor internal refactor to AppLogo to remove a component prop that was unused.
10
+ - Updated dependencies
11
+
12
+ ## 0.177.1
13
+
14
+ ### Patch Changes
15
+
16
+ - [#195513](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/195513)
17
+ [`1574f6e829fe4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1574f6e829fe4) -
18
+ Fix support for `currentColor` in icons used in `elemBefore` of `ExpandableMenuItemTrigger` to
19
+ ensure correct icon color in selected state.
20
+
3
21
  ## 0.177.0
4
22
 
5
23
  ### Minor Changes
@@ -1,7 +1,5 @@
1
1
  import SectionMessage from '@atlaskit/section-message';
2
2
 
3
- import { InteractiveLayoutExample } from '../../examples/constellation/interactive-layout';
4
-
5
3
  Navigation is how users get around a site to complete their tasks. The navigation-system package
6
4
  provides the following:
7
5
 
@@ -31,9 +29,9 @@ For ready-made navigation experiences see
31
29
 
32
30
  ## Examples
33
31
 
34
- To see in full screen interactive example below, open the code sandbox below.
35
-
36
- <Example Component={InteractiveLayoutExample} appearance="source-only" />
32
+ - <a href="https://go.atlassian.com/nav4-interactive-example" target="_blank">
33
+ Full screen interactive example
34
+ </a> (only available for Atlassian employees at this stage).
37
35
 
38
36
  ## Related
39
37
 
@@ -7,5 +7,6 @@
7
7
  ._1mmi1txw{--expandable-chevron-display:flex}
8
8
  ._1mmiglyw{--expandable-chevron-display:none}
9
9
  ._b31z1txw:has(:focus-visible), ._1vnl1txw:hover{--expandable-chevron-display:flex}
10
+ ._syaz1qo3{color:var(--ds-icon-selected,#0c66e4)}
10
11
  ._v9u71txw:has([aria-expanded=true][aria-haspopup=true]){--expandable-chevron-display:flex}
11
12
  [dir=rtl] ._1tz3r0mg{transform:scaleX(-1)}
@@ -27,7 +27,8 @@ var wrapperStyles = {
27
27
  };
28
28
  var iconStyles = {
29
29
  chevron: "_1e0ciw0t _1tz3r0mg",
30
- providedElemBefore: "_1e0c1xb2"
30
+ providedElemBefore: "_1e0c1xb2",
31
+ providedElemBeforeSelected: "_syaz1qo3"
31
32
  };
32
33
  var ExpandableMenuItemIcon = function ExpandableMenuItemIcon(_ref) {
33
34
  var iconProps = _ref.iconProps,
@@ -43,7 +44,7 @@ var ExpandableMenuItemIcon = function ExpandableMenuItemIcon(_ref) {
43
44
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
44
45
  className: (0, _runtime.ax)([iconStyles.chevron])
45
46
  }, chevronElem), providedElemBefore && /*#__PURE__*/_react.default.createElement("div", {
46
- className: (0, _runtime.ax)([iconStyles.providedElemBefore])
47
+ className: (0, _runtime.ax)([iconStyles.providedElemBefore, isSelected && iconStyles.providedElemBeforeSelected])
47
48
  }, providedElemBefore));
48
49
  };
49
50
  /**
@@ -73,8 +73,7 @@ var AppLogo = exports.AppLogo = function AppLogo(_ref) {
73
73
  }, /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
74
74
  space: "space.075",
75
75
  alignBlock: "center",
76
- xcss: logoWrapperStyles.root,
77
- "aria-label": label
76
+ xcss: logoWrapperStyles.root
78
77
  }, /*#__PURE__*/_react.default.createElement("div", {
79
78
  className: (0, _runtime.ax)([iconContainerStyles.root])
80
79
  }, /*#__PURE__*/_react.default.createElement(_logoRenderer.LogoRenderer
@@ -7,5 +7,6 @@
7
7
  ._1mmi1txw{--expandable-chevron-display:flex}
8
8
  ._1mmiglyw{--expandable-chevron-display:none}
9
9
  ._b31z1txw:has(:focus-visible), ._1vnl1txw:hover{--expandable-chevron-display:flex}
10
+ ._syaz1qo3{color:var(--ds-icon-selected,#0c66e4)}
10
11
  ._v9u71txw:has([aria-expanded=true][aria-haspopup=true]){--expandable-chevron-display:flex}
11
12
  [dir=rtl] ._1tz3r0mg{transform:scaleX(-1)}
@@ -18,7 +18,8 @@ const wrapperStyles = {
18
18
  };
19
19
  const iconStyles = {
20
20
  chevron: "_1e0ciw0t _1tz3r0mg",
21
- providedElemBefore: "_1e0c1xb2"
21
+ providedElemBefore: "_1e0c1xb2",
22
+ providedElemBeforeSelected: "_syaz1qo3"
22
23
  };
23
24
  const ExpandableMenuItemIcon = ({
24
25
  iconProps,
@@ -35,7 +36,7 @@ const ExpandableMenuItemIcon = ({
35
36
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
36
37
  className: ax([iconStyles.chevron])
37
38
  }, chevronElem), providedElemBefore && /*#__PURE__*/React.createElement("div", {
38
- className: ax([iconStyles.providedElemBefore])
39
+ className: ax([iconStyles.providedElemBefore, isSelected && iconStyles.providedElemBeforeSelected])
39
40
  }, providedElemBefore));
40
41
  };
41
42
  /**
@@ -65,8 +65,7 @@ export const AppLogo = ({
65
65
  }, /*#__PURE__*/React.createElement(Inline, {
66
66
  space: "space.075",
67
67
  alignBlock: "center",
68
- xcss: logoWrapperStyles.root,
69
- "aria-label": label
68
+ xcss: logoWrapperStyles.root
70
69
  }, /*#__PURE__*/React.createElement("div", {
71
70
  className: ax([iconContainerStyles.root])
72
71
  }, /*#__PURE__*/React.createElement(LogoRenderer
@@ -7,5 +7,6 @@
7
7
  ._1mmi1txw{--expandable-chevron-display:flex}
8
8
  ._1mmiglyw{--expandable-chevron-display:none}
9
9
  ._b31z1txw:has(:focus-visible), ._1vnl1txw:hover{--expandable-chevron-display:flex}
10
+ ._syaz1qo3{color:var(--ds-icon-selected,#0c66e4)}
10
11
  ._v9u71txw:has([aria-expanded=true][aria-haspopup=true]){--expandable-chevron-display:flex}
11
12
  [dir=rtl] ._1tz3r0mg{transform:scaleX(-1)}
@@ -18,7 +18,8 @@ var wrapperStyles = {
18
18
  };
19
19
  var iconStyles = {
20
20
  chevron: "_1e0ciw0t _1tz3r0mg",
21
- providedElemBefore: "_1e0c1xb2"
21
+ providedElemBefore: "_1e0c1xb2",
22
+ providedElemBeforeSelected: "_syaz1qo3"
22
23
  };
23
24
  var ExpandableMenuItemIcon = function ExpandableMenuItemIcon(_ref) {
24
25
  var iconProps = _ref.iconProps,
@@ -34,7 +35,7 @@ var ExpandableMenuItemIcon = function ExpandableMenuItemIcon(_ref) {
34
35
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
35
36
  className: ax([iconStyles.chevron])
36
37
  }, chevronElem), providedElemBefore && /*#__PURE__*/React.createElement("div", {
37
- className: ax([iconStyles.providedElemBefore])
38
+ className: ax([iconStyles.providedElemBefore, isSelected && iconStyles.providedElemBeforeSelected])
38
39
  }, providedElemBefore));
39
40
  };
40
41
  /**
@@ -64,8 +64,7 @@ export var AppLogo = function AppLogo(_ref) {
64
64
  }, /*#__PURE__*/React.createElement(Inline, {
65
65
  space: "space.075",
66
66
  alignBlock: "center",
67
- xcss: logoWrapperStyles.root,
68
- "aria-label": label
67
+ xcss: logoWrapperStyles.root
69
68
  }, /*#__PURE__*/React.createElement("div", {
70
69
  className: ax([iconContainerStyles.root])
71
70
  }, /*#__PURE__*/React.createElement(LogoRenderer
@@ -212,6 +212,19 @@ export const ExpandableMenuItemSelectedWithIcon = () => (
212
212
  <ButtonMenuItem>Item 2</ButtonMenuItem>
213
213
  </ExpandableMenuItemContent>
214
214
  </ExpandableMenuItem>
215
+ <ExpandableMenuItem>
216
+ <ExpandableMenuItemTrigger
217
+ href="#test"
218
+ isSelected
219
+ elemBefore={<HomeIcon label="" color="currentColor" />}
220
+ >
221
+ Parent menu item (with currentColor)
222
+ </ExpandableMenuItemTrigger>
223
+ <ExpandableMenuItemContent>
224
+ <ButtonMenuItem>Item 1</ButtonMenuItem>
225
+ <ButtonMenuItem>Item 2</ButtonMenuItem>
226
+ </ExpandableMenuItemContent>
227
+ </ExpandableMenuItem>
215
228
  </MenuList>
216
229
  </SideNavContent>
217
230
  </div>
@@ -49,8 +49,8 @@ import {
49
49
  import { Inline, Stack, Text } from '@atlaskit/primitives';
50
50
  import { token } from '@atlaskit/tokens';
51
51
 
52
- import { WithResponsiveViewport } from '../utils/example-utils';
53
- import { LongPlaceholderContent } from '../utils/long-placeholder-content';
52
+ import { WithResponsiveViewport } from './utils/example-utils';
53
+ import { LongPlaceholderContent } from './utils/long-placeholder-content';
54
54
 
55
55
  const bannerStyles = cssMap({
56
56
  root: {
@@ -26,7 +26,7 @@ import { WithResponsiveViewport } from './utils/example-utils';
26
26
 
27
27
  const Badge = () => <AKBadge appearance="important">{5}</AKBadge>;
28
28
 
29
- export default function TopNavWithTempNavAppIcon() {
29
+ export function TopNavWithTempNavAppIconAppLogo() {
30
30
  return (
31
31
  <WithResponsiveViewport>
32
32
  {/**
@@ -61,3 +61,5 @@ export default function TopNavWithTempNavAppIcon() {
61
61
  </WithResponsiveViewport>
62
62
  );
63
63
  }
64
+
65
+ export default TopNavWithTempNavAppIconAppLogo;
@@ -0,0 +1,63 @@
1
+ import React from 'react';
2
+
3
+ import AKBadge from '@atlaskit/badge';
4
+ import { Root } from '@atlaskit/navigation-system/layout/root';
5
+ import { SideNavToggleButton } from '@atlaskit/navigation-system/layout/side-nav';
6
+ import {
7
+ TopNav,
8
+ TopNavEnd,
9
+ TopNavMiddle,
10
+ TopNavStart,
11
+ } from '@atlaskit/navigation-system/layout/top-nav';
12
+ import {
13
+ AppSwitcher,
14
+ ChatButton,
15
+ CreateButton,
16
+ CustomLogo,
17
+ Help,
18
+ Notifications,
19
+ Profile,
20
+ Search,
21
+ Settings,
22
+ } from '@atlaskit/navigation-system/top-nav-items';
23
+ import { FocusIcon, FocusLogo } from '@atlaskit/temp-nav-app-icons/focus';
24
+
25
+ import { WithResponsiveViewport } from './utils/example-utils';
26
+
27
+ const Badge = () => <AKBadge appearance="important">{5}</AKBadge>;
28
+
29
+ export default function TopNavWithTempNavAppIcon() {
30
+ return (
31
+ <WithResponsiveViewport>
32
+ {/**
33
+ * Wrapping in `Root to ensure the TopNav height is set correctly, as it would in a proper composed usage.
34
+ * Root sets the top bar height CSS variable that TopNav uses to set its height
35
+ */}
36
+ <Root>
37
+ <TopNav>
38
+ <TopNavStart>
39
+ <SideNavToggleButton collapseLabel="Collapse sidebar" expandLabel="Expand sidebar" />
40
+ <AppSwitcher label="App switcher" />
41
+ <CustomLogo
42
+ href="http://www.atlassian.design"
43
+ icon={FocusIcon}
44
+ logo={FocusLogo}
45
+ label="Home page"
46
+ />
47
+ </TopNavStart>
48
+ <TopNavMiddle>
49
+ <Search label="Search" />
50
+ <CreateButton>Create</CreateButton>
51
+ </TopNavMiddle>
52
+ <TopNavEnd>
53
+ <ChatButton>Chat</ChatButton>
54
+ <Notifications label="Notifications" badge={Badge} />
55
+ <Help label="Help" />
56
+ <Settings label="Settings" />
57
+ <Profile label="Your profile" />
58
+ </TopNavEnd>
59
+ </TopNav>
60
+ </Root>
61
+ </WithResponsiveViewport>
62
+ );
63
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/navigation-system",
3
- "version": "0.177.0",
3
+ "version": "0.177.2",
4
4
  "description": "The latest navigation system for Atlassian apps.",
5
5
  "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
6
6
  "author": "Atlassian Pty Ltd",
@@ -116,7 +116,7 @@
116
116
  "@atlaskit/button": "^23.3.0",
117
117
  "@atlaskit/css": "^0.12.0",
118
118
  "@atlaskit/ds-lib": "^5.0.0",
119
- "@atlaskit/icon": "^27.9.0",
119
+ "@atlaskit/icon": "^27.10.0",
120
120
  "@atlaskit/layering": "^3.0.0",
121
121
  "@atlaskit/logo": "^19.6.0",
122
122
  "@atlaskit/platform-feature-flags": "^1.1.0",
@@ -142,10 +142,10 @@
142
142
  "@af/integration-testing": "workspace:^",
143
143
  "@af/react-unit-testing": "workspace:^",
144
144
  "@af/visual-regression": "workspace:^",
145
- "@atlaskit/app-provider": "^3.0.0",
145
+ "@atlaskit/app-provider": "^3.1.0",
146
146
  "@atlaskit/badge": "^18.1.0",
147
147
  "@atlaskit/banner": "^14.0.0",
148
- "@atlaskit/breadcrumbs": "^15.2.0",
148
+ "@atlaskit/breadcrumbs": "^15.3.0",
149
149
  "@atlaskit/dropdown-menu": "^16.3.0",
150
150
  "@atlaskit/form": "^12.0.0",
151
151
  "@atlaskit/heading": "^5.2.0",
@@ -158,7 +158,7 @@
158
158
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
159
159
  "@atlaskit/select": "^21.2.0",
160
160
  "@atlaskit/skeleton": "^2.1.0",
161
- "@atlaskit/temp-nav-app-icons": "^0.9.0",
161
+ "@atlaskit/temp-nav-app-icons": "^0.10.0",
162
162
  "@atlaskit/textfield": "^8.0.0",
163
163
  "@atlassian/feature-flags-test-utils": "^0.3.0",
164
164
  "@atlassian/gemini": "^1.19.0",
@@ -168,8 +168,7 @@
168
168
  "@testing-library/react-hooks": "^8.0.1",
169
169
  "@testing-library/user-event": "^14.4.3",
170
170
  "raf-stub": "^2.0.1",
171
- "react-dom": "^18.2.0",
172
- "typescript": "~5.4.2"
171
+ "react-dom": "^18.2.0"
173
172
  },
174
173
  "techstack": {
175
174
  "@atlassian/frontend": {
@@ -95,6 +95,9 @@ const iconStyles = cssMap({
95
95
  providedElemBefore: {
96
96
  display: `var(${providedElemBeforeDisplayCssVar})`,
97
97
  },
98
+ providedElemBeforeSelected: {
99
+ color: token('color.icon.selected'),
100
+ },
98
101
  });
99
102
 
100
103
  const ExpandableMenuItemIcon = ({
@@ -118,7 +121,13 @@ const ExpandableMenuItemIcon = ({
118
121
  <>
119
122
  <div css={iconStyles.chevron}>{chevronElem}</div>
120
123
  {/* If there is no provided elemBefore, not rendering the wrapper either to simplify the DOM */}
121
- {providedElemBefore && <div css={iconStyles.providedElemBefore}>{providedElemBefore}</div>}
124
+ {providedElemBefore && (
125
+ <div
126
+ css={[iconStyles.providedElemBefore, isSelected && iconStyles.providedElemBeforeSelected]}
127
+ >
128
+ {providedElemBefore}
129
+ </div>
130
+ )}
122
131
  </>
123
132
  );
124
133
  };
@@ -1,9 +1,3 @@
1
- import React, { type ReactNode, Suspense } from 'react';
2
-
3
- import { render, screen, waitForElementToBeRemoved } from '@testing-library/react';
4
-
5
- import { getSuspenseResource } from '@af/react-unit-testing/suspense-resource';
6
-
7
1
  export function resetMatchMedia() {
8
2
  const mediaNoop: MediaQueryList = {
9
3
  media: '',
@@ -189,49 +183,3 @@ export function filterFromConsoleErrorOutput(searchString: RegExp): ResetConsole
189
183
  // Expected error due to jsdom not knowing how to parse the `@starting-style` at-rule.
190
184
  // See: https://github.com/jsdom/jsdom/issues/3236
191
185
  export const parseCssErrorRegex = /Could not parse CSS stylesheet/;
192
-
193
- // TODO: pull into a jest matcher:
194
- // expect(<App/>).toWorkWithSuspense();
195
- export async function runSuspenseTest(node: ReactNode) {
196
- const resource = getSuspenseResource();
197
-
198
- function ResourceContent() {
199
- resource.read();
200
-
201
- return <span>Content</span>;
202
- }
203
-
204
- function App() {
205
- return (
206
- <>
207
- <Suspense fallback={<div data-testid="suspense" />}>
208
- <div data-testid="suspense-child">
209
- {node}
210
- <ResourceContent />
211
- </div>
212
- </Suspense>
213
- <div>hi</div>
214
- </>
215
- );
216
- }
217
-
218
- // Initial render with no suspense
219
- const { rerender } = render(<App />);
220
-
221
- expect(screen.queryByTestId('suspense')).not.toBeInTheDocument();
222
- expect(screen.getByTestId('suspense-child')).toBeVisible();
223
-
224
- // Render again while suspended
225
- const { complete } = resource.load();
226
- rerender(<App />);
227
-
228
- expect(screen.getByTestId('suspense')).toBeInTheDocument();
229
- expect(screen.getByTestId('suspense-child')).not.toBeVisible();
230
-
231
- // Resolve promise (which will cause a re-render)
232
- complete();
233
- await waitForElementToBeRemoved(() => screen.queryByTestId('suspense'));
234
-
235
- expect(screen.queryByTestId('suspense')).not.toBeInTheDocument();
236
- expect(screen.getByTestId('suspense-child')).toBeVisible();
237
- }
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
2
 
3
+ import { toBeSuspendable } from '@af/react-unit-testing';
4
+
3
5
  import { PanelSplitter } from '../../panel-splitter/panel-splitter';
4
6
  import { Root } from '../../root';
5
7
  import { SideNav } from '../../side-nav/side-nav';
@@ -10,7 +12,6 @@ import {
10
12
  parseCssErrorRegex,
11
13
  type ResetConsoleErrorFn,
12
14
  resetMatchMedia,
13
- runSuspenseTest,
14
15
  } from './_test-utils';
15
16
 
16
17
  let resetConsoleErrorSpyFn: ResetConsoleErrorFn;
@@ -26,13 +27,17 @@ beforeEach(() => {
26
27
  resetMatchMedia();
27
28
  });
28
29
 
30
+ expect.extend({
31
+ toBeSuspendable,
32
+ });
33
+
29
34
  test('panel splitter works with suspense', async () => {
30
- await runSuspenseTest(
35
+ expect(() => (
31
36
  <Root>
32
37
  <SideNav>
33
38
  <SideNavContent>Side navigation content</SideNavContent>
34
39
  <PanelSplitter label="Resize side nav" />
35
40
  </SideNav>
36
- </Root>,
37
- );
41
+ </Root>
42
+ )).toBeSuspendable();
38
43
  });
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+
3
+ import { toBeSuspendable, toPassStrictMode } from '@af/react-unit-testing';
4
+
5
+ import CompositionExample from '../../../../../examples/composition';
6
+
7
+ import { resetMatchMedia } from './_test-utils';
8
+
9
+ beforeEach(() => {
10
+ resetMatchMedia();
11
+ });
12
+
13
+ // TODO: move to `jestFrameworkSetup.js` in follow up pull request
14
+ expect.extend({
15
+ toBeSuspendable,
16
+ toPassStrictMode,
17
+ });
18
+
19
+ it('should support being suspended', async () => {
20
+ await expect(() => <CompositionExample />).toBeSuspendable();
21
+ });
22
+
23
+ it('should be strict mode compliant', async () => {
24
+ await expect(() => <CompositionExample />).toPassStrictMode();
25
+ });
@@ -1,7 +1,7 @@
1
1
  import { Device, snapshotInformational } from '@atlassian/gemini';
2
2
 
3
3
  import TopNavWithLongProductName from '../../../../../examples/top-nav-with-long-name';
4
- import TopNavWithTempNavAppIcon from '../../../../../examples/top-nav-with-temp-nav-app-icon';
4
+ import { TopNavWithTempNavAppIconAppLogo } from '../../../../../examples/top-nav-with-temp-nav-app-icon-app-logo';
5
5
  import { TopNavigationExample } from '../../../../../examples/top-navigation';
6
6
  import { TopNavigationThemingSingleExample } from '../../../../../examples/top-navigation-theming';
7
7
 
@@ -58,7 +58,7 @@ const interactionStateSharedOptions: Parameters<typeof snapshotInformational>[1]
58
58
  *
59
59
  * Can make all these normal VR tests once pressed state variants are added to Gemini.
60
60
  */
61
- snapshotInformational(TopNavWithTempNavAppIcon, {
61
+ snapshotInformational(TopNavWithTempNavAppIconAppLogo, {
62
62
  ...interactionStateSharedOptions,
63
63
  description: 'nav logo hover',
64
64
  featureFlags: {
@@ -69,7 +69,7 @@ snapshotInformational(TopNavWithTempNavAppIcon, {
69
69
  },
70
70
  });
71
71
 
72
- snapshotInformational(TopNavWithTempNavAppIcon, {
72
+ snapshotInformational(TopNavWithTempNavAppIconAppLogo, {
73
73
  ...interactionStateSharedOptions,
74
74
  description: 'nav logo pressed',
75
75
  featureFlags: {
@@ -163,12 +163,7 @@ export const AppLogo = ({
163
163
  )}
164
164
  onClick={onClick}
165
165
  >
166
- <Inline
167
- space="space.075"
168
- alignBlock="center"
169
- xcss={logoWrapperStyles.root}
170
- aria-label={label}
171
- >
166
+ <Inline space="space.075" alignBlock="center" xcss={logoWrapperStyles.root}>
172
167
  <div css={[iconContainerStyles.root]}>
173
168
  <LogoRenderer
174
169
  // Top nav always uses the new logo design
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
-
3
- import CompositionExample from '../../../../../examples/composition';
4
-
5
- beforeEach(() => {
6
- resetMatchMedia();
7
- });
8
-
9
- import { resetMatchMedia, runSuspenseTest } from './_test-utils';
10
-
11
- it('should support being suspended', async () => {
12
- await runSuspenseTest(<CompositionExample />);
13
- });