@atlaskit/atlassian-navigation 2.3.4 → 2.4.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 (138) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/common/constants.js +0 -2
  3. package/dist/cjs/common/styles.js +0 -4
  4. package/dist/cjs/components/AppSwitcher/index.js +4 -16
  5. package/dist/cjs/components/AtlassianNavigation/index.js +23 -28
  6. package/dist/cjs/components/AtlassianNavigation/skeleton.js +15 -24
  7. package/dist/cjs/components/BadgeContainer/index.js +6 -7
  8. package/dist/cjs/components/Create/index.js +12 -24
  9. package/dist/cjs/components/Create/skeleton.js +4 -11
  10. package/dist/cjs/components/Create/styles.js +2 -9
  11. package/dist/cjs/components/Help/index.js +4 -20
  12. package/dist/cjs/components/IconButton/index.js +5 -20
  13. package/dist/cjs/components/IconButton/skeleton.js +6 -16
  14. package/dist/cjs/components/IconButton/styles.js +2 -9
  15. package/dist/cjs/components/Notifications/index.js +3 -15
  16. package/dist/cjs/components/PrimaryButton/index.js +8 -22
  17. package/dist/cjs/components/PrimaryButton/skeleton.js +4 -7
  18. package/dist/cjs/components/PrimaryButton/styles.js +2 -9
  19. package/dist/cjs/components/PrimaryDropdownButton/index.js +2 -8
  20. package/dist/cjs/components/PrimaryItemsContainer/index.js +16 -28
  21. package/dist/cjs/components/PrimaryItemsContainer/skeleton.js +4 -8
  22. package/dist/cjs/components/ProductHome/custom-product-home.js +16 -33
  23. package/dist/cjs/components/ProductHome/index.js +0 -3
  24. package/dist/cjs/components/ProductHome/product-home.js +22 -39
  25. package/dist/cjs/components/ProductHome/skeleton.js +3 -12
  26. package/dist/cjs/components/ProductHome/utils.js +0 -4
  27. package/dist/cjs/components/Profile/index.js +3 -6
  28. package/dist/cjs/components/Profile/skeleton.js +0 -6
  29. package/dist/cjs/components/Search/index.js +12 -29
  30. package/dist/cjs/components/Search/skeleton.js +4 -11
  31. package/dist/cjs/components/Settings/index.js +1 -12
  32. package/dist/cjs/components/SignIn/index.js +3 -12
  33. package/dist/cjs/components/SignIn/skeleton.js +0 -6
  34. package/dist/cjs/components/SkeletonCreateButton/index.js +3 -6
  35. package/dist/cjs/components/SkeletonIconButton/index.js +3 -6
  36. package/dist/cjs/components/SkeletonPrimaryButton/index.js +7 -18
  37. package/dist/cjs/controllers/overflow/index.js +27 -56
  38. package/dist/cjs/index.js +0 -16
  39. package/dist/cjs/skeleton-help-button.js +2 -11
  40. package/dist/cjs/skeleton-notification-button.js +1 -7
  41. package/dist/cjs/skeleton-settings-button.js +1 -7
  42. package/dist/cjs/skeleton-switcher-button.js +1 -7
  43. package/dist/cjs/skeleton.js +0 -4
  44. package/dist/cjs/theme/default-theme.js +5 -8
  45. package/dist/cjs/theme/index.js +0 -5
  46. package/dist/cjs/theme/theme-generator.js +8 -22
  47. package/dist/cjs/theme/theme-helpers.js +2 -27
  48. package/dist/cjs/theme/theme-provider.js +1 -4
  49. package/dist/cjs/theme/themes.js +0 -4
  50. package/dist/cjs/theme/use-theme.js +0 -4
  51. package/dist/cjs/version.json +1 -1
  52. package/dist/es2019/components/AppSwitcher/index.js +3 -3
  53. package/dist/es2019/components/AtlassianNavigation/index.js +6 -4
  54. package/dist/es2019/components/AtlassianNavigation/skeleton.js +4 -3
  55. package/dist/es2019/components/BadgeContainer/index.js +3 -2
  56. package/dist/es2019/components/Create/index.js +5 -5
  57. package/dist/es2019/components/Create/skeleton.js +3 -2
  58. package/dist/es2019/components/Create/styles.js +4 -2
  59. package/dist/es2019/components/Help/index.js +1 -1
  60. package/dist/es2019/components/IconButton/index.js +2 -4
  61. package/dist/es2019/components/IconButton/skeleton.js +3 -2
  62. package/dist/es2019/components/IconButton/styles.js +4 -2
  63. package/dist/es2019/components/Notifications/index.js +1 -1
  64. package/dist/es2019/components/PrimaryButton/index.js +3 -5
  65. package/dist/es2019/components/PrimaryButton/skeleton.js +4 -2
  66. package/dist/es2019/components/PrimaryButton/styles.js +4 -2
  67. package/dist/es2019/components/PrimaryDropdownButton/index.js +1 -2
  68. package/dist/es2019/components/PrimaryItemsContainer/index.js +5 -4
  69. package/dist/es2019/components/PrimaryItemsContainer/skeleton.js +3 -2
  70. package/dist/es2019/components/ProductHome/custom-product-home.js +5 -10
  71. package/dist/es2019/components/ProductHome/product-home.js +5 -10
  72. package/dist/es2019/components/ProductHome/skeleton.js +4 -2
  73. package/dist/es2019/components/ProductHome/utils.js +0 -2
  74. package/dist/es2019/components/Profile/index.js +3 -3
  75. package/dist/es2019/components/Profile/skeleton.js +3 -2
  76. package/dist/es2019/components/Search/index.js +5 -10
  77. package/dist/es2019/components/Search/skeleton.js +3 -2
  78. package/dist/es2019/components/Settings/index.js +0 -1
  79. package/dist/es2019/components/SignIn/index.js +2 -3
  80. package/dist/es2019/components/SignIn/skeleton.js +3 -2
  81. package/dist/es2019/components/SkeletonCreateButton/index.js +1 -1
  82. package/dist/es2019/components/SkeletonIconButton/index.js +1 -1
  83. package/dist/es2019/components/SkeletonPrimaryButton/index.js +3 -2
  84. package/dist/es2019/controllers/overflow/index.js +15 -24
  85. package/dist/es2019/skeleton-help-button.js +0 -1
  86. package/dist/es2019/skeleton-notification-button.js +0 -1
  87. package/dist/es2019/skeleton-settings-button.js +0 -1
  88. package/dist/es2019/skeleton-switcher-button.js +0 -1
  89. package/dist/es2019/theme/default-theme.js +5 -5
  90. package/dist/es2019/theme/theme-generator.js +7 -9
  91. package/dist/es2019/theme/theme-helpers.js +4 -11
  92. package/dist/es2019/theme/theme-provider.js +4 -3
  93. package/dist/es2019/version.json +1 -1
  94. package/dist/esm/components/AppSwitcher/index.js +4 -5
  95. package/dist/esm/components/AtlassianNavigation/index.js +22 -20
  96. package/dist/esm/components/AtlassianNavigation/skeleton.js +14 -13
  97. package/dist/esm/components/BadgeContainer/index.js +5 -4
  98. package/dist/esm/components/Create/index.js +11 -12
  99. package/dist/esm/components/Create/skeleton.js +3 -3
  100. package/dist/esm/components/Create/styles.js +2 -6
  101. package/dist/esm/components/Help/index.js +4 -6
  102. package/dist/esm/components/IconButton/index.js +5 -8
  103. package/dist/esm/components/IconButton/skeleton.js +6 -10
  104. package/dist/esm/components/IconButton/styles.js +2 -6
  105. package/dist/esm/components/Notifications/index.js +3 -4
  106. package/dist/esm/components/PrimaryButton/index.js +8 -12
  107. package/dist/esm/components/PrimaryButton/skeleton.js +4 -2
  108. package/dist/esm/components/PrimaryButton/styles.js +2 -6
  109. package/dist/esm/components/PrimaryDropdownButton/index.js +1 -2
  110. package/dist/esm/components/PrimaryItemsContainer/index.js +15 -17
  111. package/dist/esm/components/PrimaryItemsContainer/skeleton.js +3 -2
  112. package/dist/esm/components/ProductHome/custom-product-home.js +16 -24
  113. package/dist/esm/components/ProductHome/product-home.js +22 -30
  114. package/dist/esm/components/ProductHome/skeleton.js +4 -7
  115. package/dist/esm/components/ProductHome/utils.js +0 -2
  116. package/dist/esm/components/Profile/index.js +3 -3
  117. package/dist/esm/components/Profile/skeleton.js +3 -2
  118. package/dist/esm/components/Search/index.js +12 -19
  119. package/dist/esm/components/Search/skeleton.js +3 -3
  120. package/dist/esm/components/Settings/index.js +1 -3
  121. package/dist/esm/components/SignIn/index.js +3 -5
  122. package/dist/esm/components/SignIn/skeleton.js +3 -2
  123. package/dist/esm/components/SkeletonCreateButton/index.js +2 -2
  124. package/dist/esm/components/SkeletonIconButton/index.js +2 -2
  125. package/dist/esm/components/SkeletonPrimaryButton/index.js +7 -13
  126. package/dist/esm/controllers/overflow/index.js +27 -40
  127. package/dist/esm/skeleton-help-button.js +2 -5
  128. package/dist/esm/skeleton-notification-button.js +1 -2
  129. package/dist/esm/skeleton-settings-button.js +1 -2
  130. package/dist/esm/skeleton-switcher-button.js +1 -2
  131. package/dist/esm/theme/default-theme.js +5 -5
  132. package/dist/esm/theme/theme-generator.js +8 -15
  133. package/dist/esm/theme/theme-helpers.js +2 -15
  134. package/dist/esm/theme/theme-provider.js +4 -3
  135. package/dist/esm/version.json +1 -1
  136. package/dist/types/theme/types.d.ts +1 -6
  137. package/package.json +9 -8
  138. package/report.api.md +14 -8
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.useTheme = void 0;
7
-
8
7
  var _react = require("react");
9
-
10
8
  var _themeProvider = require("./theme-provider");
11
-
12
9
  var useTheme = function useTheme() {
13
10
  return (0, _react.useContext)(_themeProvider.ThemeContext);
14
11
  };
15
-
16
12
  exports.useTheme = useTheme;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/atlassian-navigation",
3
- "version": "2.3.4",
3
+ "version": "2.4.0",
4
4
  "sideEffects": false
5
5
  }
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { forwardRef } from 'react';
3
3
  import AppSwitcherIcon from '@atlaskit/icon/glyph/app-switcher';
4
4
  import { IconButton } from '../IconButton';
5
-
6
5
  /**
7
6
  * _App switcher__
8
7
  *
@@ -24,7 +23,8 @@ export const AppSwitcher = /*#__PURE__*/forwardRef((props, ref) => {
24
23
  tooltip: tooltip,
25
24
  ref: ref
26
25
  }, iconButtonProps));
27
- }); // exists only to extract props
28
- // eslint-disable-next-line @repo/internal/react/use-noop
26
+ });
29
27
 
28
+ // exists only to extract props
29
+ // eslint-disable-next-line @repo/internal/react/use-noop
30
30
  export default (props => {});
@@ -16,7 +16,7 @@ const containerStyles = css({
16
16
  justifyContent: 'space-between',
17
17
  flexShrink: 0,
18
18
  // eslint-disable-next-line @repo/internal/styles/no-nested-styles
19
- '[data-theme="light"] &, [data-theme="dark"] &': {
19
+ '[data-color-mode="light"] &, [data-color-mode="dark"] &': {
20
20
  // eslint-disable-next-line @atlaskit/design-system/no-unsafe-design-token-usage
21
21
  borderBottom: `1px solid ${"var(--ds-border, #091E4224)"}`,
22
22
  // TODO: (DSP-2087) Remove the below once tokens have launched
@@ -32,7 +32,8 @@ const containerStyles = css({
32
32
  right: 0,
33
33
  left: 0,
34
34
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
35
- background: `linear-gradient(180deg, ${N40A} 0, ${N40A} 1px, ${N30A} 1px, ${hexToRGBA( // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
35
+ background: `linear-gradient(180deg, ${N40A} 0, ${N40A} 1px, ${N30A} 1px, ${hexToRGBA(
36
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
36
37
  N900, 0)} 4px)`,
37
38
  content: '""'
38
39
  }
@@ -64,6 +65,7 @@ const analyticsData = {
64
65
  },
65
66
  componentName: 'atlassianNavigation'
66
67
  };
68
+
67
69
  /**
68
70
  * __Atlassian navigation__
69
71
  *
@@ -72,7 +74,6 @@ const analyticsData = {
72
74
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples)
73
75
  * - [Code](https://atlassian.design/components/atlassian-navigation/examples)
74
76
  */
75
-
76
77
  export const AtlassianNavigation = props => {
77
78
  const {
78
79
  label: label,
@@ -106,7 +107,8 @@ export const AtlassianNavigation = props => {
106
107
  testId: testId,
107
108
  moreLabel: moreLabel,
108
109
  items: primaryItems,
109
- create: create // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
110
+ create: create
111
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
110
112
  ,
111
113
  theme: theme
112
114
  })), jsx("div", {
@@ -19,7 +19,7 @@ const containerStyles = css({
19
19
  justifyContent: 'space-between',
20
20
  flexShrink: 0,
21
21
  // eslint-disable-next-line @repo/internal/styles/no-nested-styles
22
- '[data-theme="light"] &, [data-theme="dark"] &': {
22
+ '[data-color-mode="light"] &, [data-color-mode="dark"] &': {
23
23
  // eslint-disable-next-line @atlaskit/design-system/no-unsafe-design-token-usage
24
24
  borderBottom: `1px solid ${"var(--ds-border, #091E4224)"}`,
25
25
  // TODO: (DSP-2087) Remove the below once tokens have launched
@@ -35,7 +35,8 @@ const containerStyles = css({
35
35
  right: 0,
36
36
  left: 0,
37
37
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
38
- background: `linear-gradient(180deg, ${N40A} 0, ${N40A} 1px, ${N30A} 1px, ${hexToRGBA( // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
38
+ background: `linear-gradient(180deg, ${N40A} 0, ${N40A} 1px, ${N30A} 1px, ${hexToRGBA(
39
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
39
40
  N900, 0)} 4px)`,
40
41
  content: '""'
41
42
  }
@@ -61,6 +62,7 @@ const rightStyles = css({
61
62
  flexShrink: 0
62
63
  }
63
64
  });
65
+
64
66
  /**
65
67
  * __Navigation skeleton__
66
68
  *
@@ -74,7 +76,6 @@ const rightStyles = css({
74
76
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-loader)
75
77
  * - [Code](https://atlassian.design/components/{packageName}/code)
76
78
  */
77
-
78
79
  export const NavigationSkeleton = ({
79
80
  primaryItemsCount = 4,
80
81
  secondaryItemsCount = 4,
@@ -8,9 +8,10 @@ const badgeContainerStyles = css({
8
8
  });
9
9
  const containerStyles = css({
10
10
  position: 'relative'
11
- }); // Not exported to consumers
12
- // eslint-disable-next-line @repo/internal/react/require-jsdoc
11
+ });
13
12
 
13
+ // Not exported to consumers
14
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
14
15
  export const BadgeContainer = props => {
15
16
  const {
16
17
  id: badgeId,
@@ -30,7 +30,6 @@ const wrapperStyles = css({
30
30
  marginLeft: gridSize * 1.5
31
31
  }
32
32
  });
33
-
34
33
  const TooltipSwitch = ({
35
34
  buttonTooltip,
36
35
  children
@@ -38,6 +37,7 @@ const TooltipSwitch = ({
38
37
  content: buttonTooltip,
39
38
  hideTooltipOnClick: true
40
39
  }, children) : jsx(Fragment, null, children);
40
+
41
41
  /**
42
42
  * _Create__
43
43
  *
@@ -47,8 +47,6 @@ const TooltipSwitch = ({
47
47
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#create)
48
48
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
49
49
  */
50
-
51
-
52
50
  export const Create = ({
53
51
  onClick,
54
52
  href,
@@ -66,7 +64,8 @@ export const Create = ({
66
64
  }, jsx(Button, {
67
65
  id: "createGlobalItem",
68
66
  onClick: onClick,
69
- href: href // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
67
+ href: href
68
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
70
69
  ,
71
70
  theme: getCreateButtonTheme(theme),
72
71
  testId: testId && `${testId}-button`,
@@ -79,7 +78,8 @@ export const Create = ({
79
78
  }),
80
79
  onClick: onClick,
81
80
  href: href,
82
- tooltip: iconButtonTooltip // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
81
+ tooltip: iconButtonTooltip
82
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
83
83
  ,
84
84
  theme: getCreateButtonTheme(theme),
85
85
  "aria-label": text,
@@ -17,9 +17,10 @@ const mobileStyles = css({
17
17
  [`@media (max-width: ${CREATE_BREAKPOINT - 1}px)`]: {
18
18
  display: 'none !important'
19
19
  }
20
- }); // Not exported to consumers, only used in NavigationSkeleton
21
- // eslint-disable-next-line @repo/internal/react/require-jsdoc
20
+ });
22
21
 
22
+ // Not exported to consumers, only used in NavigationSkeleton
23
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
23
24
  export const CreateSkeleton = () => {
24
25
  const theme = useTheme();
25
26
  return jsx(Fragment, null, jsx("div", {
@@ -8,7 +8,8 @@ export const getCreateButtonTheme = ({
8
8
  spinnerStyles
9
9
  } = current(props);
10
10
  return {
11
- buttonStyles: { ...buttonStyles,
11
+ buttonStyles: {
12
+ ...buttonStyles,
12
13
  ...create.default,
13
14
  margin: 0,
14
15
  fontWeight: 500,
@@ -19,7 +20,8 @@ export const getCreateButtonTheme = ({
19
20
  // '&&' is required to add more CSS specificity
20
21
  // && it not a valid CSSObject property
21
22
  // @ts-ignore
22
- '&&': { ...(props.state === 'active' && create.active)
23
+ '&&': {
24
+ ...(props.state === 'active' && create.active)
23
25
  }
24
26
  },
25
27
  spinnerStyles
@@ -5,6 +5,7 @@ import { useTheme } from '../../theme';
5
5
  import { BadgeContainer } from '../BadgeContainer';
6
6
  import { IconButton } from '../IconButton';
7
7
  const HELP_NOTIFICATION_BADGE_ID = 'atlassian-navigation-help-notification-count';
8
+
8
9
  /**
9
10
  * __Help__
10
11
  *
@@ -13,7 +14,6 @@ const HELP_NOTIFICATION_BADGE_ID = 'atlassian-navigation-help-notification-count
13
14
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#help)
14
15
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
15
16
  */
16
-
17
17
  export const Help = /*#__PURE__*/forwardRef((props, ref) => {
18
18
  const {
19
19
  badge,
@@ -4,7 +4,6 @@ import Button from '@atlaskit/button/custom-theme-button';
4
4
  import Tooltip from '@atlaskit/tooltip';
5
5
  import { useTheme } from '../../theme';
6
6
  import { getIconButtonTheme } from './styles';
7
-
8
7
  /**
9
8
  * __Icon button__
10
9
  *
@@ -26,17 +25,16 @@ export const IconButton = /*#__PURE__*/forwardRef((props, ref) => {
26
25
  appearance: "primary",
27
26
  testId: testId,
28
27
  iconBefore: icon,
29
- ref: ref // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
28
+ ref: ref
29
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
30
30
  ,
31
31
  theme: getIconButtonTheme(theme)
32
32
  }, buttonProps));
33
-
34
33
  if (tooltip) {
35
34
  return /*#__PURE__*/React.createElement(Tooltip, {
36
35
  content: tooltip,
37
36
  hideTooltipOnClick: true
38
37
  }, button);
39
38
  }
40
-
41
39
  return button;
42
40
  });
@@ -6,9 +6,10 @@ const buttonHeight = gridSize * 4;
6
6
  const skeletonStyles = css({
7
7
  borderRadius: '50%',
8
8
  opacity: 0.15
9
- }); // Not exported to consumers, only used in NavigationSkeleton
10
- // eslint-disable-next-line @repo/internal/react/require-jsdoc
9
+ });
11
10
 
11
+ // Not exported to consumers, only used in NavigationSkeleton
12
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
12
13
  export const IconButtonSkeleton = ({
13
14
  className,
14
15
  marginLeft,
@@ -8,7 +8,8 @@ export const getIconButtonTheme = ({
8
8
  spinnerStyles
9
9
  } = current(props);
10
10
  return {
11
- buttonStyles: { ...buttonStyles,
11
+ buttonStyles: {
12
+ ...buttonStyles,
12
13
  borderRadius: '100%',
13
14
  display: 'flex',
14
15
  margin: '0 2px',
@@ -23,7 +24,8 @@ export const getIconButtonTheme = ({
23
24
  // '&&' is required to add more CSS specificity
24
25
  // && it not a valid CSSObject property
25
26
  // @ts-ignore
26
- '&&': { ...(props.state === 'active' && iconButton.active)
27
+ '&&': {
28
+ ...(props.state === 'active' && iconButton.active)
27
29
  },
28
30
  ...(props.state === 'selected' && iconButton.selected),
29
31
  '> span': {
@@ -4,6 +4,7 @@ import NotificationIcon from '@atlaskit/icon/glyph/notification';
4
4
  import { BadgeContainer } from '../BadgeContainer';
5
5
  import { IconButton } from '../IconButton';
6
6
  const NOTIFICATIONS_BADGE_ID = 'atlassian-navigation-notification-count';
7
+
7
8
  /**
8
9
  * __Notifications__
9
10
  *
@@ -13,7 +14,6 @@ const NOTIFICATIONS_BADGE_ID = 'atlassian-navigation-notification-count';
13
14
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#notifications)
14
15
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
15
16
  */
16
-
17
17
  export const Notifications = /*#__PURE__*/forwardRef((props, ref) => {
18
18
  const {
19
19
  badge,
@@ -1,5 +1,4 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
-
3
2
  /** @jsx jsx */
4
3
  import { forwardRef } from 'react';
5
4
  import { css, jsx } from '@emotion/react';
@@ -35,6 +34,7 @@ const buttonHighlightedStyles = css({
35
34
  content: '""'
36
35
  }
37
36
  });
37
+
38
38
  /**
39
39
  * __Primary button__
40
40
  *
@@ -44,7 +44,6 @@ const buttonHighlightedStyles = css({
44
44
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#dropdown-menu)
45
45
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
46
46
  */
47
-
48
47
  export const PrimaryButton = /*#__PURE__*/forwardRef((props, ref) => {
49
48
  const {
50
49
  children,
@@ -65,18 +64,17 @@ export const PrimaryButton = /*#__PURE__*/forwardRef((props, ref) => {
65
64
  appearance: "primary",
66
65
  testId: testId,
67
66
  ref: ref,
68
- isSelected: isSelected // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
67
+ isSelected: isSelected
68
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
69
69
  ,
70
70
  theme: getPrimaryButtonTheme(theme)
71
71
  }, buttonProps), children));
72
-
73
72
  if (tooltip) {
74
73
  return jsx(Tooltip, {
75
74
  content: tooltip,
76
75
  hideTooltipOnClick: true
77
76
  }, button);
78
77
  }
79
-
80
78
  return button;
81
79
  });
82
80
  export default PrimaryButton;
@@ -1,4 +1,5 @@
1
1
  /** @jsx jsx */
2
+
2
3
  import { css, jsx } from '@emotion/react';
3
4
  import { buttonHeight, gridSize } from '../../common/constants';
4
5
  import { useTheme } from '../../theme';
@@ -9,9 +10,10 @@ const skeletonStyles = css({
9
10
  height: `${buttonHeight - paddingAll * 2.5}px`,
10
11
  borderRadius: `${gridSize / 2}px`,
11
12
  opacity: 0.15
12
- }); // Not exported to consumers, only used in NavigationSkeleton
13
- // eslint-disable-next-line @repo/internal/react/require-jsdoc
13
+ });
14
14
 
15
+ // Not exported to consumers, only used in NavigationSkeleton
16
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
15
17
  export const PrimaryButtonSkeleton = props => {
16
18
  const theme = useTheme();
17
19
  return jsx("div", {
@@ -8,7 +8,8 @@ export const getPrimaryButtonTheme = ({
8
8
  spinnerStyles
9
9
  } = current(props);
10
10
  return {
11
- buttonStyles: { ...buttonStyles,
11
+ buttonStyles: {
12
+ ...buttonStyles,
12
13
  ...primaryButton.default,
13
14
  ...(props.isSelected && primaryButton.selected),
14
15
  fontWeight: 500,
@@ -22,7 +23,8 @@ export const getPrimaryButtonTheme = ({
22
23
  // '&&' is required to add more CSS specificity
23
24
  // && it not a valid CSSObject property
24
25
  // @ts-ignore
25
- '&&': { ...(props.state === 'active' && primaryButton.active)
26
+ '&&': {
27
+ ...(props.state === 'active' && primaryButton.active)
26
28
  }
27
29
  },
28
30
  spinnerStyles
@@ -1,5 +1,4 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
-
3
2
  /** @jsx jsx */
4
3
  import { forwardRef } from 'react';
5
4
  import { css, jsx } from '@emotion/react';
@@ -10,6 +9,7 @@ const chevronIconStyles = css({
10
9
  marginLeft: '-8px',
11
10
  opacity: 0.51
12
11
  });
12
+
13
13
  /**
14
14
  * __Primary dropdown button__
15
15
  *
@@ -19,7 +19,6 @@ const chevronIconStyles = css({
19
19
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#button)
20
20
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
21
21
  */
22
-
23
22
  export const PrimaryDropdownButton = /*#__PURE__*/forwardRef((props, ref) => {
24
23
  return jsx(PrimaryButton, _extends({
25
24
  iconAfter: jsx("span", {
@@ -1,5 +1,4 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
-
3
2
  /** @jsx jsx */
4
3
  import { useCallback, useState } from 'react';
5
4
  import { css, jsx } from '@emotion/react';
@@ -28,9 +27,10 @@ const widthObserverContainerStyles = css({
28
27
  margin: '0px',
29
28
  position: 'relative',
30
29
  flexShrink: 1
31
- }); // Internal only
32
- // eslint-disable-next-line @repo/internal/react/require-jsdoc
30
+ });
33
31
 
32
+ // Internal only
33
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
34
34
  export const PrimaryItemsContainer = ({
35
35
  moreLabel,
36
36
  items,
@@ -62,7 +62,8 @@ export const PrimaryItemsContainer = ({
62
62
  isVisible: false,
63
63
  openOverflowMenu: openOverflowMenu,
64
64
  closeOverflowMenu: onMoreClose
65
- }, overflowItems), // Overflow items has an unstable reference - so we will only recalculate
65
+ }, overflowItems),
66
+ // Overflow items has an unstable reference - so we will only recalculate
66
67
  // content if `overflowItems` length changes.
67
68
  // eslint-disable-next-line react-hooks/exhaustive-deps
68
69
  [overflowItems.length, openOverflowMenu, onMoreClose]);
@@ -6,9 +6,10 @@ import { PrimaryButtonSkeleton } from '../PrimaryButton/skeleton';
6
6
  const primaryButtonSkeletonStyles = css({
7
7
  marginRight: gridSize * 1.5,
8
8
  marginLeft: gridSize * 1.5
9
- }); // Internal only
10
- // eslint-disable-next-line @repo/internal/react/require-jsdoc
9
+ });
11
10
 
11
+ // Internal only
12
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
12
13
  export const PrimaryItemsContainerSkeleton = ({
13
14
  count
14
15
  }) => jsx(Fragment, null, Array.from({
@@ -1,5 +1,4 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
-
3
2
  /** @jsx jsx */
4
3
  import { Fragment } from 'react';
5
4
  import { css, jsx } from '@emotion/react';
@@ -61,11 +60,10 @@ const productHomeButtonStyles = css({
61
60
  boxShadow: `var(${VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE})`,
62
61
  color: `var(${VAR_PRODUCT_HOME_COLOR_ACTIVE})`
63
62
  },
64
- '&:focus': {
63
+ '&:focus-visible': {
65
64
  backgroundColor: `var(${VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS})`,
66
- boxShadow: `var(${VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS})`,
67
65
  color: `var(${VAR_PRODUCT_HOME_COLOR_FOCUS})`,
68
- outline: 0
66
+ outline: `2px solid ${"var(--ds-border-focused, #4C9AFF)"}`
69
67
  },
70
68
  // eslint-disable-next-line @repo/internal/styles/no-nested-styles
71
69
  'div&': {
@@ -87,6 +85,7 @@ const siteTitleStyles = css({
87
85
  paddingRight: gridSize * 2,
88
86
  alignItems: 'center'
89
87
  });
88
+
90
89
  /**
91
90
  * __Custom product home__
92
91
  *
@@ -95,7 +94,6 @@ const siteTitleStyles = css({
95
94
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#custom-product-home)
96
95
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
97
96
  */
98
-
99
97
  const CustomProductHome = props => {
100
98
  const {
101
99
  iconAlt,
@@ -113,12 +111,10 @@ const CustomProductHome = props => {
113
111
  const theme = useTheme();
114
112
  const primaryButton = theme.mode.primaryButton;
115
113
  const Tag = getTag(onClick, href);
116
-
117
114
  const preventFocusRing = event => {
118
115
  event.preventDefault();
119
116
  onMouseDown && onMouseDown(event);
120
117
  };
121
-
122
118
  const productHomeButtonDynamicStyles = {
123
119
  [VAR_PRODUCT_HOME_COLOR_ACTIVE]: primaryButton.active.color,
124
120
  [VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE]: primaryButton.active.backgroundColor,
@@ -136,8 +132,8 @@ const CustomProductHome = props => {
136
132
  css: productHomeButtonStyles,
137
133
  onClick: onClick,
138
134
  onMouseDown: preventFocusRing,
139
- "data-testid": testId && `${testId}-container` // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
140
-
135
+ "data-testid": testId && `${testId}-container`
136
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
141
137
  }, rest), logoUrl && jsx("img", {
142
138
  style: {
143
139
  maxWidth: logoMaxWidth
@@ -162,5 +158,4 @@ const CustomProductHome = props => {
162
158
  "data-testid": testId && `${testId}-site-title`
163
159
  }, siteTitle));
164
160
  };
165
-
166
161
  export default CustomProductHome;
@@ -1,5 +1,4 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
-
3
2
  /** @jsx jsx */
4
3
  import { Fragment } from 'react';
5
4
  import { css, jsx } from '@emotion/react';
@@ -41,11 +40,10 @@ const productHomeButtonStyles = css({
41
40
  boxShadow: `var(${VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE})`,
42
41
  color: `var(${VAR_PRODUCT_HOME_COLOR_ACTIVE})`
43
42
  },
44
- '&:focus': {
43
+ '&:focus-visible': {
45
44
  backgroundColor: `var(${VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS})`,
46
- boxShadow: `var(${VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS})`,
47
45
  color: `var(${VAR_PRODUCT_HOME_COLOR_FOCUS})`,
48
- outline: 0
46
+ outline: `2px solid ${"var(--ds-border-focused, #4C9AFF)"}`
49
47
  },
50
48
  // eslint-disable-next-line @repo/internal/styles/no-nested-styles
51
49
  'div&': {
@@ -101,6 +99,7 @@ const siteTitleStyles = css({
101
99
  paddingRight: gridSize * 2,
102
100
  alignItems: 'center'
103
101
  });
102
+
104
103
  /**
105
104
  * __Product home__
106
105
  *
@@ -112,7 +111,6 @@ const siteTitleStyles = css({
112
111
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#product-home)
113
112
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
114
113
  */
115
-
116
114
  const ProductHome = ({
117
115
  icon: Icon,
118
116
  logo: Logo,
@@ -133,12 +131,10 @@ const ProductHome = ({
133
131
  textColor = theme.mode.productHome.color
134
132
  } = theme.mode.productHome;
135
133
  const Tag = getTag(onClick, href);
136
-
137
134
  const preventFocusRing = e => {
138
135
  e.preventDefault();
139
136
  onMouseDown && onMouseDown(e);
140
137
  };
141
-
142
138
  const productHomeButtonDynamicStyles = {
143
139
  [VAR_PRODUCT_HOME_COLOR_ACTIVE]: primaryButton.active.color,
144
140
  [VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE]: primaryButton.active.backgroundColor,
@@ -157,8 +153,8 @@ const ProductHome = ({
157
153
  href: href,
158
154
  onClick: onClick,
159
155
  onMouseDown: preventFocusRing,
160
- "data-testid": testId && `${testId}-container` // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
161
-
156
+ "data-testid": testId && `${testId}-container`
157
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
162
158
  }, rest), jsx("div", {
163
159
  css: [customMaxHeightStyles, productLogoStyles],
164
160
  "data-testid": testId && `${testId}-logo`
@@ -182,5 +178,4 @@ const ProductHome = ({
182
178
  "data-testid": testId && `${testId}-site-title`
183
179
  }, siteTitle));
184
180
  };
185
-
186
181
  export default ProductHome;
@@ -1,4 +1,5 @@
1
1
  /** @jsx jsx */
2
+
2
3
  import { Fragment } from 'react';
3
4
  import { css, jsx } from '@emotion/react';
4
5
  import { gridSize, PRODUCT_HOME_BREAKPOINT } from '../../common/constants';
@@ -103,9 +104,10 @@ const siteTitleStyles = css({
103
104
  borderRadius: 4,
104
105
  content: '""'
105
106
  }
106
- }); // Not exported to consumers, only used in NavigationSkeleton
107
- // eslint-disable-next-line @repo/internal/react/require-jsdoc
107
+ });
108
108
 
109
+ // Not exported to consumers, only used in NavigationSkeleton
110
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
109
111
  export const ProductHomeSkeleton = ({
110
112
  showSiteName
111
113
  }) => {
@@ -2,10 +2,8 @@ export const getTag = (onClick, href) => {
2
2
  if (href) {
3
3
  return 'a';
4
4
  }
5
-
6
5
  if (onClick) {
7
6
  return 'button';
8
7
  }
9
-
10
8
  return 'div';
11
9
  };
@@ -1,5 +1,4 @@
1
1
  import { IconButton } from '../IconButton';
2
-
3
2
  /**
4
3
  * __Profile__
5
4
  *
@@ -9,7 +8,8 @@ import { IconButton } from '../IconButton';
9
8
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#profile)
10
9
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
11
10
  */
12
- export const Profile = IconButton; // This exists only to extract props.
13
- // eslint-disable-next-line @repo/internal/react/use-noop
11
+ export const Profile = IconButton;
14
12
 
13
+ // This exists only to extract props.
14
+ // eslint-disable-next-line @repo/internal/react/use-noop
15
15
  export default (props => {});
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
2
  import { gridSize } from '@atlaskit/theme/constants';
3
- import { IconButtonSkeleton } from '../IconButton/skeleton'; // Not exported to consumers, only used in NavigationSkeleton
4
- // eslint-disable-next-line @repo/internal/react/require-jsdoc
3
+ import { IconButtonSkeleton } from '../IconButton/skeleton';
5
4
 
5
+ // Not exported to consumers, only used in NavigationSkeleton
6
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
6
7
  export const ProfileSkeleton = () => /*#__PURE__*/React.createElement(IconButtonSkeleton, {
7
8
  marginLeft: 6,
8
9
  marginRight: 6,