@atlaskit/navigation-system 0.176.2 → 0.177.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/ui/page-layout/banner.js +1 -2
  3. package/dist/es2019/ui/page-layout/banner.js +1 -2
  4. package/dist/esm/ui/page-layout/banner.js +1 -2
  5. package/dist/types/ui/page-layout/banner.d.ts +2 -0
  6. package/dist/types-ts4.5/ui/page-layout/banner.d.ts +2 -0
  7. package/examples/constellation/side-nav-items/actions-and-actions-on-hover.tsx +6 -4
  8. package/examples/constellation/side-nav-items/container-avatar.tsx +4 -2
  9. package/examples/constellation/side-nav-items/elem-after.tsx +6 -4
  10. package/examples/constellation/side-nav-items/elem-before.tsx +7 -5
  11. package/examples/constellation/side-nav-items/expandable-menu-item-default-variant.tsx +9 -3
  12. package/examples/constellation/side-nav-items/expandable-menu-item-link-variant.tsx +199 -173
  13. package/examples/constellation/side-nav-items/flyout-menu-item.tsx +9 -4
  14. package/examples/constellation/side-nav-items/link-menu-item.tsx +103 -94
  15. package/examples/constellation/side-nav-items/menu-divider.tsx +6 -4
  16. package/examples/constellation/side-nav-items/menu-section.tsx +20 -8
  17. package/examples/constellation/side-nav-items/right-to-left.tsx +11 -5
  18. package/examples/constellation/side-nav-items/top-level-spacer.tsx +8 -6
  19. package/examples/constellation/side-nav-items/truncation.tsx +4 -2
  20. package/examples/constellation/top-nav-items/top-nav-button.tsx +6 -2
  21. package/package.json +1 -4
  22. 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
  23. 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
  24. package/src/__tests__/informational-vr-tests/__snapshots__/layering/layers-in-main-slot-short-viewport--desktop--platform-dst-nav4-layering-in-main-slot-fixes-false.png +0 -0
  25. package/src/__tests__/informational-vr-tests/__snapshots__/layering/layers-in-main-slot-short-viewport--desktop--platform-dst-nav4-layering-in-main-slot-fixes-true.png +0 -0
  26. package/src/__tests__/informational-vr-tests/__snapshots__/layering/side-nav-expanded-on-mobile--mobile.png +0 -0
  27. package/src/__tests__/informational-vr-tests/__snapshots__/layering/side-nav-expanded-on-mobile-without-panel--mobile.png +0 -0
  28. package/src/__tests__/vr-tests/__snapshots__/skip-links/skip-links--light-mode.png +0 -0
  29. package/src/__tests__/vr-tests/layering.vr.tsx +12 -77
  30. package/src/ui/menu-item/__tests__/vr-tests/__snapshots__/expandable/expandable-menu-item-selected-with-icon--default.png +0 -0
  31. package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/slot-borders/above-md-breakpoint---side-nav-expanded--default--platform-design-system-nav4-panel-default-border-false-platform-design-system-nav4-sidenav-border-false.png +0 -0
  32. package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/slot-borders/above-md-breakpoint---side-nav-expanded--default--platform-design-system-nav4-panel-default-border-false-platform-design-system-nav4-sidenav-border-true.png +0 -0
  33. package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/slot-borders/above-md-breakpoint---side-nav-expanded--default--platform-design-system-nav4-panel-default-border-true-platform-design-system-nav4-sidenav-border-false.png +0 -0
  34. package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/slot-borders/above-md-breakpoint---side-nav-expanded--default--platform-design-system-nav4-panel-default-border-true-platform-design-system-nav4-sidenav-border-true.png +0 -0
  35. package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/slot-borders/above-md-breakpoint---side-nav-flyout--default--platform-design-system-nav4-panel-default-border-false-platform-design-system-nav4-sidenav-border-false.png +0 -0
  36. package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/slot-borders/above-md-breakpoint---side-nav-flyout--default--platform-design-system-nav4-panel-default-border-false-platform-design-system-nav4-sidenav-border-true.png +0 -0
  37. package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/slot-borders/above-md-breakpoint---side-nav-flyout--default--platform-design-system-nav4-panel-default-border-true-platform-design-system-nav4-sidenav-border-false.png +0 -0
  38. package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/slot-borders/above-md-breakpoint---side-nav-flyout--default--platform-design-system-nav4-panel-default-border-true-platform-design-system-nav4-sidenav-border-true.png +0 -0
  39. package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/slot-borders/below-md-breakpoint---side-nav-expanded--default--platform-design-system-nav4-panel-default-border-false-platform-design-system-nav4-sidenav-border-false.png +0 -0
  40. package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/slot-borders/below-md-breakpoint---side-nav-expanded--default--platform-design-system-nav4-panel-default-border-false-platform-design-system-nav4-sidenav-border-true.png +0 -0
  41. package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/slot-borders/below-md-breakpoint---side-nav-expanded--default--platform-design-system-nav4-panel-default-border-true-platform-design-system-nav4-sidenav-border-false.png +0 -0
  42. package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/slot-borders/below-md-breakpoint---side-nav-expanded--default--platform-design-system-nav4-panel-default-border-true-platform-design-system-nav4-sidenav-border-true.png +0 -0
  43. package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/top-nav/breakpoint-lg---composition--firefox.png +0 -0
  44. package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/top-nav/breakpoint-md---composition--firefox.png +0 -0
  45. package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/top-nav/breakpoint-xl---composition--firefox.png +0 -0
  46. package/src/ui/page-layout/__tests__/unit/banner.test.tsx +1 -1
  47. package/src/ui/page-layout/__tests__/vr-tests/page-layout.vr.tsx +5 -57
  48. package/src/ui/page-layout/banner.tsx +3 -4
  49. package/tsconfig.dev.json +3 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlassian/navigation-system
2
2
 
3
+ ## 0.177.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`e12d813a2d3fd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e12d813a2d3fd) -
8
+ The default height of the Banner layout area has been updated to 48px, down from 64px, to align
9
+ with the height of the @atlaskit/banner component. This change was previously behind a feature
10
+ flag, which has now been removed.
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
3
16
  ## 0.176.2
4
17
 
5
18
  ### Patch Changes
@@ -10,7 +10,6 @@ require("./banner.compiled.css");
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
  var React = _react;
12
12
  var _runtime = require("@compiled/react/runtime");
13
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
13
  var _skipLinksContext = require("../../context/skip-links/skip-links-context");
15
14
  var _constants = require("./constants");
16
15
  var _hoistSlotSizesContext = require("./hoist-slot-sizes-context");
@@ -30,7 +29,7 @@ function Banner(_ref) {
30
29
  var children = _ref.children,
31
30
  xcss = _ref.xcss,
32
31
  _ref$height = _ref.height,
33
- height = _ref$height === void 0 ? (0, _platformFeatureFlags.fg)('platform_dst_nav4_banner_default_height') ? 48 : 64 : _ref$height,
32
+ height = _ref$height === void 0 ? 48 : _ref$height,
34
33
  _ref$skipLinkLabel = _ref.skipLinkLabel,
35
34
  skipLinkLabel = _ref$skipLinkLabel === void 0 ? 'Banner' : _ref$skipLinkLabel,
36
35
  testId = _ref.testId,
@@ -3,7 +3,6 @@ import "./banner.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import { useContext } from 'react';
6
- import { fg } from '@atlaskit/platform-feature-flags';
7
6
  import { useSkipLinkInternal } from '../../context/skip-links/skip-links-context';
8
7
  import { bannerMountedVar, localSlotLayers, UNSAFE_bannerVar } from './constants';
9
8
  import { DangerouslyHoistSlotSizes } from './hoist-slot-sizes-context';
@@ -22,7 +21,7 @@ export function Banner({
22
21
  children,
23
22
  xcss,
24
23
  // 48px has been chosen to align with the height of the Banner component from `@atlaskit/banner`.
25
- height = fg('platform_dst_nav4_banner_default_height') ? 48 : 64,
24
+ height = 48,
26
25
  skipLinkLabel = 'Banner',
27
26
  testId,
28
27
  id: providedId
@@ -3,7 +3,6 @@ import "./banner.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import { useContext } from 'react';
6
- import { fg } from '@atlaskit/platform-feature-flags';
7
6
  import { useSkipLinkInternal } from '../../context/skip-links/skip-links-context';
8
7
  import { bannerMountedVar, localSlotLayers, UNSAFE_bannerVar } from './constants';
9
8
  import { DangerouslyHoistSlotSizes } from './hoist-slot-sizes-context';
@@ -22,7 +21,7 @@ export function Banner(_ref) {
22
21
  var children = _ref.children,
23
22
  xcss = _ref.xcss,
24
23
  _ref$height = _ref.height,
25
- height = _ref$height === void 0 ? fg('platform_dst_nav4_banner_default_height') ? 48 : 64 : _ref$height,
24
+ height = _ref$height === void 0 ? 48 : _ref$height,
26
25
  _ref$skipLinkLabel = _ref.skipLinkLabel,
27
26
  skipLinkLabel = _ref$skipLinkLabel === void 0 ? 'Banner' : _ref$skipLinkLabel,
28
27
  testId = _ref.testId,
@@ -18,6 +18,8 @@ export declare function Banner({ children, xcss, height, skipLinkLabel, testId,
18
18
  xcss?: StrictXCSSProp<'backgroundColor', never>;
19
19
  /**
20
20
  * The height of the layout area.
21
+ *
22
+ * Defaults to 48px.
21
23
  */
22
24
  height?: number;
23
25
  }): JSX.Element;
@@ -18,6 +18,8 @@ export declare function Banner({ children, xcss, height, skipLinkLabel, testId,
18
18
  xcss?: StrictXCSSProp<'backgroundColor', never>;
19
19
  /**
20
20
  * The height of the layout area.
21
+ *
22
+ * Defaults to 48px.
21
23
  */
22
24
  height?: number;
23
25
  }): JSX.Element;
@@ -38,6 +38,8 @@ function MoreAction() {
38
38
  );
39
39
  }
40
40
 
41
+ const exampleHref = '#example-href';
42
+
41
43
  export function ActionsAndActionsOnHoverExample() {
42
44
  return (
43
45
  <Inline space="space.600">
@@ -45,7 +47,7 @@ export function ActionsAndActionsOnHoverExample() {
45
47
  <SideNavContent>
46
48
  <MenuList>
47
49
  <LinkMenuItem
48
- href="#"
50
+ href={exampleHref}
49
51
  elemBefore={<HomeIcon label="" color="currentColor" spacing="spacious" />}
50
52
  actions={
51
53
  <>
@@ -57,7 +59,7 @@ export function ActionsAndActionsOnHoverExample() {
57
59
  Link menu item (actions)
58
60
  </LinkMenuItem>
59
61
  <LinkMenuItem
60
- href="#"
62
+ href={exampleHref}
61
63
  elemBefore={<HomeIcon label="" color="currentColor" spacing="spacious" />}
62
64
  actionsOnHover={
63
65
  <>
@@ -69,7 +71,7 @@ export function ActionsAndActionsOnHoverExample() {
69
71
  Link menu item (actionsOnHover)
70
72
  </LinkMenuItem>
71
73
  <LinkMenuItem
72
- href="#"
74
+ href={exampleHref}
73
75
  elemBefore={<HomeIcon label="" color="currentColor" spacing="spacious" />}
74
76
  actions={<MoreAction />}
75
77
  actionsOnHover={<AddAction />}
@@ -78,7 +80,7 @@ export function ActionsAndActionsOnHoverExample() {
78
80
  </LinkMenuItem>
79
81
 
80
82
  <LinkMenuItem
81
- href="#"
83
+ href={exampleHref}
82
84
  elemBefore={<HomeIcon label="" color="currentColor" spacing="spacious" />}
83
85
  elemAfter={<Lozenge>New</Lozenge>}
84
86
  actions={<MoreAction />}
@@ -10,15 +10,17 @@ import ScienceIcon from '../../images/science.svg';
10
10
 
11
11
  import { MockSideNav } from './common/mock-side-nav';
12
12
 
13
+ const exampleHref = '#example-href';
14
+
13
15
  export function ContainerAvatarExample() {
14
16
  return (
15
17
  <MockSideNav>
16
18
  <SideNavContent>
17
19
  <MenuList>
18
- <LinkMenuItem href="#" elemBefore={<ContainerAvatar src={MoneyIcon} />}>
20
+ <LinkMenuItem href={exampleHref} elemBefore={<ContainerAvatar src={MoneyIcon} />}>
19
21
  Link menu item (ContainerAvatar)
20
22
  </LinkMenuItem>
21
- <LinkMenuItem href="#" elemBefore={<ContainerAvatar src={ScienceIcon} />}>
23
+ <LinkMenuItem href={exampleHref} elemBefore={<ContainerAvatar src={ScienceIcon} />}>
22
24
  Link menu item (ContainerAvatar)
23
25
  </LinkMenuItem>
24
26
  </MenuList>
@@ -11,34 +11,36 @@ import { Inline } from '@atlaskit/primitives/compiled';
11
11
 
12
12
  import { MockSideNav } from './common/mock-side-nav';
13
13
 
14
+ const exampleHref = '#example-href';
15
+
14
16
  export function ElemAfterExample() {
15
17
  return (
16
18
  <MockSideNav>
17
19
  <SideNavContent>
18
20
  <MenuList>
19
21
  <LinkMenuItem
20
- href="#"
22
+ href={exampleHref}
21
23
  elemBefore={<HomeIcon label="" color="currentColor" spacing="spacious" />}
22
24
  elemAfter={<Lozenge>New</Lozenge>}
23
25
  >
24
26
  Link menu item (lozenge)
25
27
  </LinkMenuItem>
26
28
  <LinkMenuItem
27
- href="#"
29
+ href={exampleHref}
28
30
  elemBefore={<HomeIcon label="" color="currentColor" spacing="spacious" />}
29
31
  elemAfter={<Badge>24</Badge>}
30
32
  >
31
33
  Link menu item (badge)
32
34
  </LinkMenuItem>
33
35
  <LinkMenuItem
34
- href="#"
36
+ href={exampleHref}
35
37
  elemBefore={<HomeIcon label="" color="currentColor" spacing="spacious" />}
36
38
  elemAfter={<LinkExternalIcon label="" size="small" />}
37
39
  >
38
40
  Link menu item (icon)
39
41
  </LinkMenuItem>
40
42
  <LinkMenuItem
41
- href="#"
43
+ href={exampleHref}
42
44
  elemBefore={<HomeIcon label="" color="currentColor" spacing="spacious" />}
43
45
  elemAfter={
44
46
  <Inline space="space.050" alignBlock="center">
@@ -24,6 +24,8 @@ import MoneyIcon from '../../images/money.svg';
24
24
 
25
25
  import { MockSideNav } from './common/mock-side-nav';
26
26
 
27
+ const exampleHref = '#example-href';
28
+
27
29
  export function ElemBeforeExample() {
28
30
  return (
29
31
  <Inline space="space.600">
@@ -31,19 +33,19 @@ export function ElemBeforeExample() {
31
33
  <SideNavContent>
32
34
  <MenuList>
33
35
  <LinkMenuItem
34
- href="#"
36
+ href={exampleHref}
35
37
  elemBefore={<HomeIcon label="" color="currentColor" spacing="spacious" />}
36
38
  >
37
39
  Link menu item (icon)
38
40
  </LinkMenuItem>
39
- <LinkMenuItem href="#" elemBefore={<ContainerAvatar src={MoneyIcon} />}>
41
+ <LinkMenuItem href={exampleHref} elemBefore={<ContainerAvatar src={MoneyIcon} />}>
40
42
  Link menu item (ContainerAvatar)
41
43
  </LinkMenuItem>
42
- <LinkMenuItem href="#" elemBefore={<JiraIcon label="" />}>
44
+ <LinkMenuItem href={exampleHref} elemBefore={<JiraIcon label="" />}>
43
45
  Link menu item (app tile)
44
46
  </LinkMenuItem>
45
- <LinkMenuItem href="#">Link menu item (spacer)</LinkMenuItem>
46
- <LinkMenuItem href="#" elemBefore={COLLAPSE_ELEM_BEFORE}>
47
+ <LinkMenuItem href={exampleHref}>Link menu item (spacer)</LinkMenuItem>
48
+ <LinkMenuItem href={exampleHref} elemBefore={COLLAPSE_ELEM_BEFORE}>
47
49
  Link menu item (no elemBefore)
48
50
  </LinkMenuItem>
49
51
  </MenuList>
@@ -27,10 +27,12 @@ import MoneyIcon from '../../images/money.svg';
27
27
 
28
28
  import { MockSideNav } from './common/mock-side-nav';
29
29
 
30
+ const exampleHref = '#example-href';
31
+
30
32
  function PlaceholderExpandableContent() {
31
33
  return (
32
34
  <ExpandableMenuItemContent>
33
- <LinkMenuItem href="#">Expandable menu item content</LinkMenuItem>
35
+ <LinkMenuItem href={exampleHref}>Expandable menu item content</LinkMenuItem>
34
36
  </ExpandableMenuItemContent>
35
37
  );
36
38
  }
@@ -109,7 +111,9 @@ export function ExpandableMenuItemDefaultVariantExample() {
109
111
  Exp default menu item (level 2)
110
112
  </ExpandableMenuItemTrigger>
111
113
  <ExpandableMenuItemContent>
112
- <LinkMenuItem href="#">Expandable menu item content</LinkMenuItem>
114
+ <LinkMenuItem href={exampleHref}>
115
+ Expandable menu item content
116
+ </LinkMenuItem>
113
117
  </ExpandableMenuItemContent>
114
118
  </ExpandableMenuItem>
115
119
  </ExpandableMenuItemContent>
@@ -125,7 +129,9 @@ export function ExpandableMenuItemDefaultVariantExample() {
125
129
  Exp default menu item (level 2)
126
130
  </ExpandableMenuItemTrigger>
127
131
  <ExpandableMenuItemContent>
128
- <LinkMenuItem href="#">Expandable menu item content</LinkMenuItem>
132
+ <LinkMenuItem href={exampleHref}>
133
+ Expandable menu item content
134
+ </LinkMenuItem>
129
135
  </ExpandableMenuItemContent>
130
136
  </ExpandableMenuItem>
131
137
  </ExpandableMenuItemContent>