@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
@@ -2,9 +2,7 @@ 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
4
  var _excluded = ["icon", "logo", "siteTitle", "onClick", "href", "onMouseDown", "testId", "logoMaxWidth"];
5
-
6
5
  var _css;
7
-
8
6
  /** @jsx jsx */
9
7
  import { Fragment } from 'react';
10
8
  import { css, jsx } from '@emotion/react';
@@ -46,11 +44,10 @@ var productHomeButtonStyles = css((_css = {
46
44
  boxShadow: "var(".concat(VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE, ")"),
47
45
  color: "var(".concat(VAR_PRODUCT_HOME_COLOR_ACTIVE, ")")
48
46
  },
49
- '&:focus': {
47
+ '&:focus-visible': {
50
48
  backgroundColor: "var(".concat(VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS, ")"),
51
- boxShadow: "var(".concat(VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS, ")"),
52
49
  color: "var(".concat(VAR_PRODUCT_HOME_COLOR_FOCUS, ")"),
53
- outline: 0
50
+ outline: "2px solid ".concat("var(--ds-border-focused, #4C9AFF)")
54
51
  },
55
52
  // eslint-disable-next-line @repo/internal/styles/no-nested-styles
56
53
  'div&': {
@@ -98,6 +95,7 @@ var siteTitleStyles = css({
98
95
  paddingRight: gridSize * 2,
99
96
  alignItems: 'center'
100
97
  });
98
+
101
99
  /**
102
100
  * __Product home__
103
101
  *
@@ -109,39 +107,34 @@ var siteTitleStyles = css({
109
107
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#product-home)
110
108
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
111
109
  */
112
-
113
110
  var ProductHome = function ProductHome(_ref) {
114
111
  var _productHomeButtonDyn;
115
-
116
112
  var Icon = _ref.icon,
117
- Logo = _ref.logo,
118
- siteTitle = _ref.siteTitle,
119
- onClick = _ref.onClick,
120
- href = _ref.href,
121
- onMouseDown = _ref.onMouseDown,
122
- testId = _ref.testId,
123
- _ref$logoMaxWidth = _ref.logoMaxWidth,
124
- logoMaxWidth = _ref$logoMaxWidth === void 0 ? 260 : _ref$logoMaxWidth,
125
- rest = _objectWithoutProperties(_ref, _excluded);
126
-
113
+ Logo = _ref.logo,
114
+ siteTitle = _ref.siteTitle,
115
+ onClick = _ref.onClick,
116
+ href = _ref.href,
117
+ onMouseDown = _ref.onMouseDown,
118
+ testId = _ref.testId,
119
+ _ref$logoMaxWidth = _ref.logoMaxWidth,
120
+ logoMaxWidth = _ref$logoMaxWidth === void 0 ? 260 : _ref$logoMaxWidth,
121
+ rest = _objectWithoutProperties(_ref, _excluded);
127
122
  var theme = useTheme();
128
123
  var primaryButton = theme.mode.primaryButton;
129
124
  var _theme$mode$productHo = theme.mode.productHome,
130
- _theme$mode$productHo2 = _theme$mode$productHo.iconColor,
131
- iconColor = _theme$mode$productHo2 === void 0 ? 'inherit' : _theme$mode$productHo2,
132
- _theme$mode$productHo3 = _theme$mode$productHo.iconGradientStart,
133
- iconGradientStart = _theme$mode$productHo3 === void 0 ? 'inherit' : _theme$mode$productHo3,
134
- _theme$mode$productHo4 = _theme$mode$productHo.iconGradientStop,
135
- iconGradientStop = _theme$mode$productHo4 === void 0 ? 'inherit' : _theme$mode$productHo4,
136
- _theme$mode$productHo5 = _theme$mode$productHo.textColor,
137
- textColor = _theme$mode$productHo5 === void 0 ? theme.mode.productHome.color : _theme$mode$productHo5;
125
+ _theme$mode$productHo2 = _theme$mode$productHo.iconColor,
126
+ iconColor = _theme$mode$productHo2 === void 0 ? 'inherit' : _theme$mode$productHo2,
127
+ _theme$mode$productHo3 = _theme$mode$productHo.iconGradientStart,
128
+ iconGradientStart = _theme$mode$productHo3 === void 0 ? 'inherit' : _theme$mode$productHo3,
129
+ _theme$mode$productHo4 = _theme$mode$productHo.iconGradientStop,
130
+ iconGradientStop = _theme$mode$productHo4 === void 0 ? 'inherit' : _theme$mode$productHo4,
131
+ _theme$mode$productHo5 = _theme$mode$productHo.textColor,
132
+ textColor = _theme$mode$productHo5 === void 0 ? theme.mode.productHome.color : _theme$mode$productHo5;
138
133
  var Tag = getTag(onClick, href);
139
-
140
134
  var preventFocusRing = function preventFocusRing(e) {
141
135
  e.preventDefault();
142
136
  onMouseDown && onMouseDown(e);
143
137
  };
144
-
145
138
  var productHomeButtonDynamicStyles = (_productHomeButtonDyn = {}, _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_COLOR_ACTIVE, primaryButton.active.color), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE, primaryButton.active.backgroundColor), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE, primaryButton.active.boxShadow), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_COLOR_FOCUS, primaryButton.focus.color), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS, primaryButton.focus.backgroundColor), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS, primaryButton.focus.boxShadow), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_COLOR_HOVER, primaryButton.hover.color), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER, primaryButton.hover.backgroundColor), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_BOX_SHADOW_HOVER, primaryButton.hover.boxShadow), _defineProperty(_productHomeButtonDyn, VAR_LOGO_MAX_WIDTH, "".concat(logoMaxWidth, "px")), _productHomeButtonDyn);
146
139
  return jsx(Fragment, null, jsx(Tag, _extends({
147
140
  style: productHomeButtonDynamicStyles,
@@ -149,8 +142,8 @@ var ProductHome = function ProductHome(_ref) {
149
142
  href: href,
150
143
  onClick: onClick,
151
144
  onMouseDown: preventFocusRing,
152
- "data-testid": testId && "".concat(testId, "-container") // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
153
-
145
+ "data-testid": testId && "".concat(testId, "-container")
146
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
154
147
  }, rest), jsx("div", {
155
148
  css: [customMaxHeightStyles, productLogoStyles],
156
149
  "data-testid": testId && "".concat(testId, "-logo")
@@ -174,5 +167,4 @@ var ProductHome = function ProductHome(_ref) {
174
167
  "data-testid": testId && "".concat(testId, "-site-title")
175
168
  }, siteTitle));
176
169
  };
177
-
178
170
  export default ProductHome;
@@ -1,8 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
-
3
2
  var _css;
4
-
5
3
  /** @jsx jsx */
4
+
6
5
  import { Fragment } from 'react';
7
6
  import { css, jsx } from '@emotion/react';
8
7
  import { gridSize, PRODUCT_HOME_BREAKPOINT } from '../../common/constants';
@@ -99,22 +98,20 @@ var siteTitleStyles = css({
99
98
  borderRadius: 4,
100
99
  content: '""'
101
100
  }
102
- }); // Not exported to consumers, only used in NavigationSkeleton
103
- // eslint-disable-next-line @repo/internal/react/require-jsdoc
101
+ });
104
102
 
103
+ // Not exported to consumers, only used in NavigationSkeleton
104
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
105
105
  export var ProductHomeSkeleton = function ProductHomeSkeleton(_ref) {
106
106
  var _productHomeButtonDyn;
107
-
108
107
  var showSiteName = _ref.showSiteName;
109
108
  var theme = useTheme();
110
109
  var primaryButton = theme.mode.primaryButton;
111
110
  var productHomeButtonDynamicStyles = (_productHomeButtonDyn = {}, _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_COLOR_ACTIVE, primaryButton.active.color), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE, primaryButton.active.backgroundColor), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE, primaryButton.active.boxShadow), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_COLOR_FOCUS, primaryButton.focus.color), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS, primaryButton.focus.backgroundColor), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS, primaryButton.focus.boxShadow), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_COLOR_HOVER, primaryButton.hover.color), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER, primaryButton.hover.backgroundColor), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_BOX_SHADOW_HOVER, primaryButton.hover.boxShadow), _defineProperty(_productHomeButtonDyn, VAR_SITE_TITLE_BG_COLOR_AFTER, theme.mode.skeleton.backgroundColor), _productHomeButtonDyn);
112
-
113
111
  var siteTitleDynamicStyles = _defineProperty({
114
112
  borderRight: theme.mode.productHome.borderRight,
115
113
  opacity: theme.mode.skeleton.opacity
116
114
  }, VAR_SITE_TITLE_BG_COLOR_AFTER, theme.mode.skeleton.backgroundColor);
117
-
118
115
  return jsx(Fragment, null, jsx("div", {
119
116
  style: productHomeButtonDynamicStyles,
120
117
  css: productHomeButtonStyles
@@ -2,10 +2,8 @@ export var getTag = function 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 var Profile = IconButton; // This exists only to extract props.
13
- // eslint-disable-next-line @repo/internal/react/use-noop
11
+ export var 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 (function (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 var ProfileSkeleton = function ProfileSkeleton() {
7
8
  return /*#__PURE__*/React.createElement(IconButtonSkeleton, {
8
9
  marginLeft: 6,
@@ -2,7 +2,6 @@ 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
4
  var _excluded = ["placeholder", "tooltip", "label", "value"];
5
-
6
5
  /** @jsx jsx */
7
6
  import { Fragment } from 'react';
8
7
  import { css, jsx } from '@emotion/react';
@@ -50,27 +49,22 @@ var searchInputStyles = css({
50
49
  var searchIconStyles = css(_defineProperty({}, "@media (min-width: ".concat(CREATE_BREAKPOINT, "px)"), {
51
50
  display: 'none !important'
52
51
  }));
53
-
54
52
  var SearchComponent = function SearchComponent(props) {
55
53
  var _searchInputDynamicSt;
56
-
57
54
  var onClick = props.onClick,
58
- placeholder = props.placeholder,
59
- label = props.label,
60
- value = props.value;
55
+ placeholder = props.placeholder,
56
+ label = props.label,
57
+ value = props.value;
61
58
  var theme = useTheme();
62
59
  var search = theme.mode.search;
63
-
64
60
  var onChange = function onChange() {
65
61
  // @ts-ignore
66
62
  onClick && onClick.apply(void 0, arguments);
67
63
  };
68
-
69
64
  var onInputClick = function onInputClick() {
70
65
  // @ts-ignore
71
66
  onClick && onClick.apply(void 0, arguments);
72
67
  };
73
-
74
68
  var searchInputDynamicStyles = (_searchInputDynamicSt = {}, _defineProperty(_searchInputDynamicSt, varSearchBackgroundColor, search.default.backgroundColor), _defineProperty(_searchInputDynamicSt, varSearchColor, search.default.color), _defineProperty(_searchInputDynamicSt, varSearchBorderColor, search.default.borderColor), _defineProperty(_searchInputDynamicSt, varSearchFocusBorderColor, search.focus.borderColor), _defineProperty(_searchInputDynamicSt, varSearchHoverBackgroundColor, search.hover.backgroundColor), _searchInputDynamicSt);
75
69
  return jsx("div", {
76
70
  css: searchInputContainerStyles,
@@ -89,6 +83,7 @@ var SearchComponent = function SearchComponent(props) {
89
83
  value: value
90
84
  }));
91
85
  };
86
+
92
87
  /**
93
88
  * __Search__
94
89
  *
@@ -97,28 +92,26 @@ var SearchComponent = function SearchComponent(props) {
97
92
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#search)
98
93
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
99
94
  */
100
-
101
-
102
95
  export var Search = function Search(props) {
103
96
  var placeholder = props.placeholder,
104
- tooltip = props.tooltip,
105
- label = props.label,
106
- value = props.value,
107
- iconButtonProps = _objectWithoutProperties(props, _excluded);
108
-
97
+ tooltip = props.tooltip,
98
+ label = props.label,
99
+ value = props.value,
100
+ iconButtonProps = _objectWithoutProperties(props, _excluded);
109
101
  return jsx(Fragment, null, jsx(SearchComponent, {
110
102
  onClick: iconButtonProps.onClick,
111
103
  placeholder: placeholder,
112
104
  label: label,
113
105
  value: value || ''
114
- }), jsx(IconButton // @ts-ignore Overriding styles is not supported.
106
+ }), jsx(IconButton
107
+ // @ts-ignore Overriding styles is not supported.
115
108
  , _extends({
116
109
  css: searchIconStyles,
117
110
  icon: jsx(SearchIcon, {
118
111
  label: label
119
112
  }),
120
- tooltip: tooltip // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
121
-
113
+ tooltip: tooltip
114
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
122
115
  }, iconButtonProps)));
123
116
  };
124
117
  export default Search;
@@ -1,5 +1,4 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
-
3
2
  /** @jsx jsx */
4
3
  import { Fragment } from 'react';
5
4
  import { css, jsx } from '@emotion/react';
@@ -23,9 +22,10 @@ var searchInputSkeletonStyles = css({
23
22
  });
24
23
  var searchIconStyles = css(_defineProperty({}, "@media (min-width: ".concat(CREATE_BREAKPOINT, "px)"), {
25
24
  display: 'none !important'
26
- })); // Not exported to consumers, only used in NavigationSkeleton
27
- // eslint-disable-next-line @repo/internal/react/require-jsdoc
25
+ }));
28
26
 
27
+ // Not exported to consumers, only used in NavigationSkeleton
28
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
29
29
  export var SearchSkeleton = function SearchSkeleton() {
30
30
  var theme = useTheme();
31
31
  return jsx(Fragment, null, jsx("div", {
@@ -4,7 +4,6 @@ var _excluded = ["tooltip"];
4
4
  import React, { forwardRef } from 'react';
5
5
  import SettingsIcon from '@atlaskit/icon/glyph/settings';
6
6
  import { IconButton } from '../IconButton';
7
-
8
7
  /**
9
8
  * __Settings__
10
9
  *
@@ -15,8 +14,7 @@ import { IconButton } from '../IconButton';
15
14
  */
16
15
  export var Settings = /*#__PURE__*/forwardRef(function (props, ref) {
17
16
  var tooltip = props.tooltip,
18
- iconButtonProps = _objectWithoutProperties(props, _excluded);
19
-
17
+ iconButtonProps = _objectWithoutProperties(props, _excluded);
20
18
  return /*#__PURE__*/React.createElement(IconButton, _extends({
21
19
  icon: /*#__PURE__*/React.createElement(SettingsIcon, {
22
20
  label: typeof tooltip === 'string' ? tooltip : 'Settings Icon'
@@ -4,7 +4,6 @@ var _excluded = ["tooltip"];
4
4
  import React from 'react';
5
5
  import SignInIcon from '@atlaskit/icon/glyph/sign-in';
6
6
  import { IconButton } from '../IconButton';
7
-
8
7
  /**
9
8
  * __Sign in__
10
9
  *
@@ -15,14 +14,13 @@ import { IconButton } from '../IconButton';
15
14
  */
16
15
  export var SignIn = function SignIn(props) {
17
16
  var tooltip = props.tooltip,
18
- iconButtonProps = _objectWithoutProperties(props, _excluded);
19
-
17
+ iconButtonProps = _objectWithoutProperties(props, _excluded);
20
18
  return /*#__PURE__*/React.createElement(IconButton, _extends({
21
19
  icon: /*#__PURE__*/React.createElement(SignInIcon, {
22
20
  label: typeof tooltip === 'string' ? tooltip : 'Sign-in Icon'
23
21
  }),
24
- tooltip: tooltip // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
25
-
22
+ tooltip: tooltip
23
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
26
24
  }, iconButtonProps));
27
25
  };
28
26
  export default SignIn;
@@ -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 var SignInSkeleton = function SignInSkeleton() {
7
8
  return /*#__PURE__*/React.createElement(IconButtonSkeleton, {
8
9
  marginLeft: 6,
@@ -21,6 +21,7 @@ var skeletonCreateButtonStyles = css({
21
21
  marginLeft: 12
22
22
  }
23
23
  });
24
+
24
25
  /**
25
26
  * __Skeleton create button__
26
27
  *
@@ -31,10 +32,9 @@ var skeletonCreateButtonStyles = css({
31
32
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
32
33
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
33
34
  */
34
-
35
35
  export var SkeletonCreateButton = function SkeletonCreateButton(_ref) {
36
36
  var text = _ref.text,
37
- testId = _ref.testId;
37
+ testId = _ref.testId;
38
38
  var theme = useTheme();
39
39
  return jsx("button", {
40
40
  style: theme.mode.create.default,
@@ -28,6 +28,7 @@ var skeletonIconButtonStyles = css({
28
28
  verticalAlign: 'middle'
29
29
  }
30
30
  });
31
+
31
32
  /**
32
33
  * __Skeleton icon button__
33
34
  *
@@ -38,10 +39,9 @@ var skeletonIconButtonStyles = css({
38
39
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
39
40
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
40
41
  */
41
-
42
42
  export var SkeletonIconButton = function SkeletonIconButton(_ref) {
43
43
  var children = _ref.children,
44
- testId = _ref.testId;
44
+ testId = _ref.testId;
45
45
  var theme = useTheme();
46
46
  return jsx("button", {
47
47
  style: theme.mode.iconButton.default,
@@ -1,9 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
-
3
2
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
-
5
3
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
-
7
4
  /** @jsx jsx */
8
5
  import { css, jsx } from '@emotion/react';
9
6
  import { useTheme } from '../../theme';
@@ -70,6 +67,7 @@ var isDropdownButtonStyles = css({
70
67
  verticalAlign: 'middle'
71
68
  }
72
69
  });
70
+
73
71
  /**
74
72
  * __Skeleton primary button__
75
73
  *
@@ -80,24 +78,20 @@ var isDropdownButtonStyles = css({
80
78
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
81
79
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
82
80
  */
83
-
84
81
  export var SkeletonPrimaryButton = function SkeletonPrimaryButton(_ref) {
85
82
  var _objectSpread2;
86
-
87
83
  var _ref$isDropdownButton = _ref.isDropdownButton,
88
- isDropdownButton = _ref$isDropdownButton === void 0 ? false : _ref$isDropdownButton,
89
- _ref$isHighlighted = _ref.isHighlighted,
90
- isHighlighted = _ref$isHighlighted === void 0 ? false : _ref$isHighlighted,
91
- text = _ref.text,
92
- children = _ref.children,
93
- testId = _ref.testId;
84
+ isDropdownButton = _ref$isDropdownButton === void 0 ? false : _ref$isDropdownButton,
85
+ _ref$isHighlighted = _ref.isHighlighted,
86
+ isHighlighted = _ref$isHighlighted === void 0 ? false : _ref$isHighlighted,
87
+ text = _ref.text,
88
+ children = _ref.children,
89
+ testId = _ref.testId;
94
90
  var theme = useTheme();
95
91
  var primaryButton = theme.mode.primaryButton;
96
-
97
92
  var dynamicStyles = _objectSpread(_objectSpread(_objectSpread({}, primaryButton.default), isHighlighted && {
98
93
  color: primaryButton.selected.color
99
94
  }), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, VAR_PRIMARY_BUTTON_BEFORE_HIGHLIGHTED_BACKGROUND_COLOR, primaryButton.selected.borderColor), _defineProperty(_objectSpread2, VAR_PRIMARY_BUTTON_AFTER_DROPDOWN_BORDER_COLOR, isHighlighted ? primaryButton.default.borderColor : primaryButton.default.color), _objectSpread2));
100
-
101
95
  return jsx("button", {
102
96
  type: "button",
103
97
  style: dynamicStyles,
@@ -3,30 +3,28 @@ import React, { createContext, useCallback, useContext, useEffect, useMemo, useR
3
3
  import throttle from 'lodash/throttle';
4
4
  import noop from '@atlaskit/ds-lib/noop';
5
5
  // Prevent width detector from triggering too many re-renders
6
- var THROTTLE_INTERVAL = 16 * 4; // Approx min width of items (based of "More" size)
7
-
6
+ var THROTTLE_INTERVAL = 16 * 4;
7
+ // Approx min width of items (based of "More" size)
8
8
  var ITEM_APPROX_MINWIDTH = 70;
9
-
10
9
  var calculateHash = function calculateHash(w, n) {
11
10
  return w + '#' + n;
12
11
  };
13
-
14
12
  var updateHashRef = function updateHashRef(currentRef, value) {
15
13
  currentRef.unshift(value);
16
14
  currentRef.length = 3;
17
15
  };
18
-
19
16
  var OverflowContext = /*#__PURE__*/createContext({
20
17
  isVisible: true,
21
18
  openOverflowMenu: noop,
22
19
  closeOverflowMenu: noop
23
- }); // eslint-disable-next-line @repo/internal/react/require-jsdoc
20
+ });
24
21
 
22
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
25
23
  export var OverflowProvider = function OverflowProvider(_ref) {
26
24
  var children = _ref.children,
27
- isVisible = _ref.isVisible,
28
- openOverflowMenu = _ref.openOverflowMenu,
29
- closeOverflowMenu = _ref.closeOverflowMenu;
25
+ isVisible = _ref.isVisible,
26
+ openOverflowMenu = _ref.openOverflowMenu,
27
+ closeOverflowMenu = _ref.closeOverflowMenu;
30
28
  var Provider = OverflowContext.Provider;
31
29
  var value = useMemo(function () {
32
30
  return {
@@ -39,6 +37,7 @@ export var OverflowProvider = function OverflowProvider(_ref) {
39
37
  value: value
40
38
  }, children);
41
39
  };
40
+
42
41
  /**
43
42
  * __useOverFlowStatus__
44
43
  *
@@ -46,40 +45,35 @@ export var OverflowProvider = function OverflowProvider(_ref) {
46
45
  *
47
46
  * - [Example](https://atlassian.design/components/atlassian-navigation/examples#responsive)
48
47
  */
49
-
50
48
  export var useOverflowStatus = function useOverflowStatus() {
51
49
  return useContext(OverflowContext);
52
50
  };
53
51
  export var useOverflowController = function useOverflowController(nodes) {
54
52
  var items = React.Children.toArray(nodes);
55
-
56
53
  var _useState = useState(9999),
57
- _useState2 = _slicedToArray(_useState, 2),
58
- width = _useState2[0],
59
- setWidth = _useState2[1];
60
-
54
+ _useState2 = _slicedToArray(_useState, 2),
55
+ width = _useState2[0],
56
+ setWidth = _useState2[1];
61
57
  var _useState3 = useState(items.length),
62
- _useState4 = _slicedToArray(_useState3, 2),
63
- itemsLimit = _useState4[0],
64
- setItemsLimit = _useState4[1];
65
-
58
+ _useState4 = _slicedToArray(_useState3, 2),
59
+ itemsLimit = _useState4[0],
60
+ setItemsLimit = _useState4[1];
66
61
  var _useState5 = useState({}),
67
- _useState6 = _slicedToArray(_useState5, 2),
68
- forceEffectValue = _useState6[0],
69
- triggerForceEffect = _useState6[1]; // Storing items approximate width so we can try expanding when there is enough room
70
-
71
-
72
- var itemsWidths = useRef([]).current; // Storing a couple of width + items count in order to stabilize
73
-
74
- var hashRef = useRef([]); // AFP-2511 TODO: Fix automatic suppressions below
62
+ _useState6 = _slicedToArray(_useState5, 2),
63
+ forceEffectValue = _useState6[0],
64
+ triggerForceEffect = _useState6[1];
65
+ // Storing items approximate width so we can try expanding when there is enough room
66
+ var itemsWidths = useRef([]).current;
67
+ // Storing a couple of width + items count in order to stabilize
68
+ var hashRef = useRef([]);
69
+
70
+ // AFP-2511 TODO: Fix automatic suppressions below
75
71
  // eslint-disable-next-line react-hooks/exhaustive-deps
76
-
77
72
  var throttleSetWidth = useCallback(throttle(setWidth, THROTTLE_INTERVAL), [setWidth]);
78
73
  useEffect(function () {
79
74
  var lastItemWidth = itemsWidths[itemsLimit] || 0;
80
75
  var wasJustLimited = lastItemWidth < 0;
81
76
  var currentHash = calculateHash(width, itemsLimit);
82
-
83
77
  if (hashRef.current[0] === currentHash) {
84
78
  // After removing an item, if width has not changed yet we schedule a force update
85
79
  // to handle case where removing an item does not actually trigger width change
@@ -91,7 +85,6 @@ export var useOverflowController = function useOverflowController(nodes) {
91
85
  return clearTimeout(t);
92
86
  };
93
87
  }
94
-
95
88
  if (wasJustLimited) {
96
89
  // Width was updated either via resize or after changing the limit
97
90
  // we cap the width between ITEM_APPROX_MINWIDTH and 2*ITEM_APPROX_MINWIDTH
@@ -100,22 +93,20 @@ export var useOverflowController = function useOverflowController(nodes) {
100
93
  var partialWidth = Math.max(Math.min(width + lastItemWidth, ITEM_APPROX_MINWIDTH * 2), ITEM_APPROX_MINWIDTH);
101
94
  itemsWidths[itemsLimit] = partialWidth;
102
95
  }
103
-
104
96
  if (width < ITEM_APPROX_MINWIDTH * 0.9 && itemsLimit) {
105
97
  // If current width is less than an item approx width we remove an item
106
98
  // marking the width as negative so we will calculate it on width update
107
99
  // plus we set the hash to stabilise and not removing more than one element
108
100
  // until we are sure width was updated
109
101
  var nextHash = calculateHash(width, itemsLimit - 1);
110
-
111
102
  if (hashRef.current.indexOf(nextHash) === -1) {
112
103
  setItemsLimit(itemsLimit - 1);
113
104
  itemsWidths[itemsLimit - 1] = -(width || 1);
114
105
  updateHashRef(hashRef.current, nextHash);
115
106
  }
116
-
117
107
  return;
118
108
  }
109
+
119
110
  /**
120
111
  * This is not necessarily equal to `lastItemWidth` because the
121
112
  * ```js
@@ -126,20 +117,15 @@ export var useOverflowController = function useOverflowController(nodes) {
126
117
  * Using `lastItemWidth` here can cause collapsing behavior to fail,
127
118
  * such as the issue reported in DSP-7329.
128
119
  */
129
-
130
-
131
120
  var currentLastItemWidth = itemsWidths[itemsLimit] || 0;
132
-
133
121
  if (width - currentLastItemWidth > ITEM_APPROX_MINWIDTH * 1.1 && itemsLimit < items.length) {
134
122
  // If we have enough room to accomodate next item width we increase the limit
135
123
  // unless it has been recently removed
136
124
  var _nextHash = calculateHash(width, itemsLimit + 1);
137
-
138
125
  if (hashRef.current.indexOf(_nextHash) === -1) {
139
126
  setItemsLimit(itemsLimit + 1);
140
127
  updateHashRef(hashRef.current, _nextHash);
141
128
  }
142
-
143
129
  return;
144
130
  }
145
131
  }, [width, hashRef, itemsLimit, itemsWidths, forceEffectValue, items.length]);
@@ -148,7 +134,8 @@ export var useOverflowController = function useOverflowController(nodes) {
148
134
  overflowItems: items.slice(itemsLimit),
149
135
  updateWidth: throttleSetWidth
150
136
  };
151
- }; // Used to extract props for useOverflowStatus();
152
- // eslint-disable-next-line @repo/internal/react/use-noop
137
+ };
153
138
 
139
+ // Used to extract props for useOverflowStatus();
140
+ // eslint-disable-next-line @repo/internal/react/use-noop
154
141
  export default (function (props) {});
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  import QuestionCircleIcon from '@atlaskit/icon/glyph/question-circle';
3
3
  import { SkeletonIconButton } from './components/SkeletonIconButton';
4
4
  import { useTheme } from './theme';
5
-
6
5
  /**
7
6
  * __Skeleton Notification button__
8
7
  *
@@ -15,11 +14,9 @@ import { useTheme } from './theme';
15
14
  */
16
15
  export var SkeletonHelpButton = function SkeletonHelpButton(_ref) {
17
16
  var _ref$label = _ref.label,
18
- label = _ref$label === void 0 ? '' : _ref$label;
19
-
17
+ label = _ref$label === void 0 ? '' : _ref$label;
20
18
  var _useTheme = useTheme(),
21
- navigation = _useTheme.mode.navigation;
22
-
19
+ navigation = _useTheme.mode.navigation;
23
20
  return /*#__PURE__*/React.createElement(SkeletonIconButton, null, /*#__PURE__*/React.createElement(QuestionCircleIcon, {
24
21
  label: label,
25
22
  secondaryColor: navigation.backgroundColor
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import NotificationIcon from '@atlaskit/icon/glyph/notification';
3
3
  import { SkeletonIconButton } from './components/SkeletonIconButton';
4
-
5
4
  /**
6
5
  * __Skeleton Notification button__
7
6
  *
@@ -14,7 +13,7 @@ import { SkeletonIconButton } from './components/SkeletonIconButton';
14
13
  */
15
14
  export var SkeletonNotificationButton = function SkeletonNotificationButton(_ref) {
16
15
  var _ref$label = _ref.label,
17
- label = _ref$label === void 0 ? '' : _ref$label;
16
+ label = _ref$label === void 0 ? '' : _ref$label;
18
17
  return /*#__PURE__*/React.createElement(SkeletonIconButton, null, /*#__PURE__*/React.createElement(NotificationIcon, {
19
18
  label: label
20
19
  }));
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import SettingsIcon from '@atlaskit/icon/glyph/settings';
3
3
  import { SkeletonIconButton } from './components/SkeletonIconButton';
4
-
5
4
  /**
6
5
  * __Skeleton settings button__
7
6
  *
@@ -14,7 +13,7 @@ import { SkeletonIconButton } from './components/SkeletonIconButton';
14
13
  */
15
14
  export var SkeletonSettingsButton = function SkeletonSettingsButton(_ref) {
16
15
  var _ref$label = _ref.label,
17
- label = _ref$label === void 0 ? '' : _ref$label;
16
+ label = _ref$label === void 0 ? '' : _ref$label;
18
17
  return /*#__PURE__*/React.createElement(SkeletonIconButton, null, /*#__PURE__*/React.createElement(SettingsIcon, {
19
18
  label: label
20
19
  }));