@atlaskit/atlassian-navigation 2.2.5 → 2.2.6

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 (168) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/cjs/components/AppSwitcher/index.js +10 -0
  3. package/dist/cjs/components/AtlassianNavigation/index.js +10 -1
  4. package/dist/cjs/components/AtlassianNavigation/skeleton.js +13 -0
  5. package/dist/cjs/components/BadgeContainer/index.js +2 -1
  6. package/dist/cjs/components/Create/index.js +14 -2
  7. package/dist/cjs/components/Create/skeleton.js +2 -1
  8. package/dist/cjs/components/Help/index.js +9 -0
  9. package/dist/cjs/components/IconButton/index.js +11 -1
  10. package/dist/cjs/components/IconButton/skeleton.js +2 -1
  11. package/dist/cjs/components/Notifications/index.js +10 -0
  12. package/dist/cjs/components/PrimaryButton/index.js +12 -1
  13. package/dist/cjs/components/PrimaryButton/skeleton.js +6 -8
  14. package/dist/cjs/components/PrimaryDropdownButton/index.js +10 -0
  15. package/dist/cjs/components/PrimaryItemsContainer/index.js +2 -1
  16. package/dist/cjs/components/PrimaryItemsContainer/skeleton.js +2 -1
  17. package/dist/cjs/components/ProductHome/custom-product-home.js +10 -1
  18. package/dist/cjs/components/ProductHome/product-home.js +13 -1
  19. package/dist/cjs/components/ProductHome/skeleton.js +2 -1
  20. package/dist/cjs/components/Profile/index.js +10 -0
  21. package/dist/cjs/components/Profile/skeleton.js +2 -0
  22. package/dist/cjs/components/Search/index.js +11 -1
  23. package/dist/cjs/components/Search/skeleton.js +2 -1
  24. package/dist/cjs/components/Settings/index.js +8 -0
  25. package/dist/cjs/components/SignIn/index.js +10 -1
  26. package/dist/cjs/components/SignIn/skeleton.js +2 -0
  27. package/dist/cjs/components/SkeletonCreateButton/index.js +12 -1
  28. package/dist/cjs/components/SkeletonIconButton/index.js +12 -1
  29. package/dist/cjs/components/SkeletonPrimaryButton/index.js +11 -0
  30. package/dist/cjs/controllers/overflow/index.js +14 -5
  31. package/dist/cjs/skeleton-help-button.js +10 -0
  32. package/dist/cjs/skeleton-notification-button.js +10 -0
  33. package/dist/cjs/skeleton-settings-button.js +10 -0
  34. package/dist/cjs/skeleton-switcher-button.js +10 -0
  35. package/dist/cjs/theme/{defaultTheme.js → default-theme.js} +1 -1
  36. package/dist/cjs/theme/index.js +5 -5
  37. package/dist/cjs/theme/{themeGenerator.js → theme-generator.js} +4 -3
  38. package/dist/cjs/theme/{themeHelpers.js → theme-helpers.js} +0 -0
  39. package/dist/cjs/theme/{ThemeProvider.js → theme-provider.js} +8 -0
  40. package/dist/cjs/theme/themes.js +2 -2
  41. package/dist/cjs/theme/{useTheme.js → use-theme.js} +2 -2
  42. package/dist/cjs/version.json +1 -1
  43. package/dist/es2019/components/AppSwitcher/index.js +11 -0
  44. package/dist/es2019/components/AtlassianNavigation/index.js +11 -1
  45. package/dist/es2019/components/AtlassianNavigation/skeleton.js +14 -0
  46. package/dist/es2019/components/BadgeContainer/index.js +3 -1
  47. package/dist/es2019/components/Create/index.js +14 -2
  48. package/dist/es2019/components/Create/skeleton.js +3 -1
  49. package/dist/es2019/components/Help/index.js +9 -0
  50. package/dist/es2019/components/IconButton/index.js +12 -1
  51. package/dist/es2019/components/IconButton/skeleton.js +3 -1
  52. package/dist/es2019/components/Notifications/index.js +10 -0
  53. package/dist/es2019/components/PrimaryButton/index.js +12 -1
  54. package/dist/es2019/components/PrimaryButton/skeleton.js +7 -6
  55. package/dist/es2019/components/PrimaryDropdownButton/index.js +10 -0
  56. package/dist/es2019/components/PrimaryItemsContainer/index.js +3 -1
  57. package/dist/es2019/components/PrimaryItemsContainer/skeleton.js +3 -1
  58. package/dist/es2019/components/ProductHome/custom-product-home.js +10 -1
  59. package/dist/es2019/components/ProductHome/product-home.js +13 -1
  60. package/dist/es2019/components/ProductHome/skeleton.js +3 -1
  61. package/dist/es2019/components/Profile/index.js +11 -0
  62. package/dist/es2019/components/Profile/skeleton.js +3 -1
  63. package/dist/es2019/components/Search/index.js +11 -1
  64. package/dist/es2019/components/Search/skeleton.js +3 -1
  65. package/dist/es2019/components/Settings/index.js +9 -0
  66. package/dist/es2019/components/SignIn/index.js +11 -1
  67. package/dist/es2019/components/SignIn/skeleton.js +3 -1
  68. package/dist/es2019/components/SkeletonCreateButton/index.js +13 -1
  69. package/dist/es2019/components/SkeletonIconButton/index.js +13 -1
  70. package/dist/es2019/components/SkeletonPrimaryButton/index.js +12 -0
  71. package/dist/es2019/controllers/overflow/index.js +12 -3
  72. package/dist/es2019/skeleton-help-button.js +11 -0
  73. package/dist/es2019/skeleton-notification-button.js +11 -0
  74. package/dist/es2019/skeleton-settings-button.js +11 -0
  75. package/dist/es2019/skeleton-switcher-button.js +11 -0
  76. package/dist/es2019/theme/{defaultTheme.js → default-theme.js} +1 -1
  77. package/dist/es2019/theme/index.js +4 -4
  78. package/dist/es2019/theme/{themeGenerator.js → theme-generator.js} +4 -3
  79. package/dist/es2019/theme/{themeHelpers.js → theme-helpers.js} +0 -0
  80. package/dist/es2019/theme/theme-provider.js +12 -0
  81. package/dist/es2019/theme/themes.js +2 -2
  82. package/dist/es2019/theme/use-theme.js +3 -0
  83. package/dist/es2019/version.json +1 -1
  84. package/dist/esm/components/AppSwitcher/index.js +11 -0
  85. package/dist/esm/components/AtlassianNavigation/index.js +11 -1
  86. package/dist/esm/components/AtlassianNavigation/skeleton.js +14 -0
  87. package/dist/esm/components/BadgeContainer/index.js +3 -1
  88. package/dist/esm/components/Create/index.js +14 -2
  89. package/dist/esm/components/Create/skeleton.js +3 -1
  90. package/dist/esm/components/Help/index.js +9 -0
  91. package/dist/esm/components/IconButton/index.js +12 -1
  92. package/dist/esm/components/IconButton/skeleton.js +3 -1
  93. package/dist/esm/components/Notifications/index.js +10 -0
  94. package/dist/esm/components/PrimaryButton/index.js +12 -1
  95. package/dist/esm/components/PrimaryButton/skeleton.js +7 -6
  96. package/dist/esm/components/PrimaryDropdownButton/index.js +10 -0
  97. package/dist/esm/components/PrimaryItemsContainer/index.js +3 -1
  98. package/dist/esm/components/PrimaryItemsContainer/skeleton.js +3 -1
  99. package/dist/esm/components/ProductHome/custom-product-home.js +10 -1
  100. package/dist/esm/components/ProductHome/product-home.js +13 -1
  101. package/dist/esm/components/ProductHome/skeleton.js +3 -1
  102. package/dist/esm/components/Profile/index.js +11 -0
  103. package/dist/esm/components/Profile/skeleton.js +3 -1
  104. package/dist/esm/components/Search/index.js +11 -1
  105. package/dist/esm/components/Search/skeleton.js +3 -1
  106. package/dist/esm/components/Settings/index.js +9 -0
  107. package/dist/esm/components/SignIn/index.js +11 -1
  108. package/dist/esm/components/SignIn/skeleton.js +3 -1
  109. package/dist/esm/components/SkeletonCreateButton/index.js +13 -1
  110. package/dist/esm/components/SkeletonIconButton/index.js +13 -1
  111. package/dist/esm/components/SkeletonPrimaryButton/index.js +12 -0
  112. package/dist/esm/controllers/overflow/index.js +12 -3
  113. package/dist/esm/skeleton-help-button.js +11 -0
  114. package/dist/esm/skeleton-notification-button.js +11 -0
  115. package/dist/esm/skeleton-settings-button.js +11 -0
  116. package/dist/esm/skeleton-switcher-button.js +11 -0
  117. package/dist/esm/theme/{defaultTheme.js → default-theme.js} +1 -1
  118. package/dist/esm/theme/index.js +4 -4
  119. package/dist/esm/theme/{themeGenerator.js → theme-generator.js} +4 -3
  120. package/dist/esm/theme/{themeHelpers.js → theme-helpers.js} +0 -0
  121. package/dist/esm/theme/theme-provider.js +12 -0
  122. package/dist/esm/theme/themes.js +2 -2
  123. package/dist/esm/theme/{useTheme.js → use-theme.js} +1 -1
  124. package/dist/esm/version.json +1 -1
  125. package/dist/types/components/AppSwitcher/index.d.ts +9 -0
  126. package/dist/types/components/AtlassianNavigation/index.d.ts +8 -0
  127. package/dist/types/components/AtlassianNavigation/skeleton.d.ts +13 -0
  128. package/dist/types/components/Create/index.d.ts +9 -0
  129. package/dist/types/components/Create/types.d.ts +2 -2
  130. package/dist/types/components/Help/index.d.ts +8 -0
  131. package/dist/types/components/IconButton/index.d.ts +9 -0
  132. package/dist/types/components/IconButton/types.d.ts +14 -14
  133. package/dist/types/components/Notifications/index.d.ts +9 -0
  134. package/dist/types/components/PrimaryButton/index.d.ts +9 -0
  135. package/dist/types/components/PrimaryButton/types.d.ts +14 -14
  136. package/dist/types/components/PrimaryDropdownButton/index.d.ts +9 -0
  137. package/dist/types/components/ProductHome/custom-product-home.d.ts +8 -0
  138. package/dist/types/components/ProductHome/product-home.d.ts +11 -0
  139. package/dist/types/components/Profile/index.d.ts +9 -0
  140. package/dist/types/components/Search/index.d.ts +8 -0
  141. package/dist/types/components/Settings/index.d.ts +8 -0
  142. package/dist/types/components/SignIn/index.d.ts +8 -0
  143. package/dist/types/components/SkeletonCreateButton/index.d.ts +10 -0
  144. package/dist/types/components/SkeletonIconButton/index.d.ts +10 -0
  145. package/dist/types/components/SkeletonPrimaryButton/index.d.ts +10 -0
  146. package/dist/types/controllers/overflow/index.d.ts +17 -4
  147. package/dist/types/skeleton-help-button.d.ts +10 -0
  148. package/dist/types/skeleton-notification-button.d.ts +10 -0
  149. package/dist/types/skeleton-settings-button.d.ts +10 -0
  150. package/dist/types/skeleton-switcher-button.d.ts +10 -0
  151. package/dist/types/theme/{defaultTheme.d.ts → default-theme.d.ts} +0 -0
  152. package/dist/types/theme/index.d.ts +4 -4
  153. package/dist/types/theme/{themeGenerator.d.ts → theme-generator.d.ts} +0 -0
  154. package/dist/types/theme/{themeHelpers.d.ts → theme-helpers.d.ts} +0 -0
  155. package/dist/types/theme/{ThemeProvider.d.ts → theme-provider.d.ts} +5 -0
  156. package/dist/types/theme/{useTheme.d.ts → use-theme.d.ts} +0 -0
  157. package/docs/01-intro.tsx +2 -2
  158. package/docs/02-atlassian-navigation.tsx +2 -2
  159. package/docs/03-product-home.tsx +4 -4
  160. package/docs/04-app-switcher.tsx +2 -2
  161. package/docs/05-create.tsx +4 -4
  162. package/docs/06-primary-actions.tsx +4 -4
  163. package/docs/07-secondary-actions.tsx +2 -2
  164. package/docs/97-theming.tsx +1 -1
  165. package/package.json +5 -3
  166. package/dist/es2019/theme/ThemeProvider.js +0 -4
  167. package/dist/es2019/theme/useTheme.js +0 -3
  168. package/dist/esm/theme/ThemeProvider.js +0 -4
@@ -98,6 +98,17 @@ var siteTitleStyles = css({
98
98
  paddingRight: gridSize * 2,
99
99
  alignItems: 'center'
100
100
  });
101
+ /**
102
+ * __Product home__
103
+ *
104
+ * The ProductHome component displays the product visual identity composed of:
105
+ * logo, icon, and optional text. Values for logo and icon are never displayed
106
+ * at the same time, where icon is used only when space is restricted. Should be
107
+ * passed into `AtlassianNavigation`'s `renderProductHome` prop.
108
+ *
109
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#product-home)
110
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
111
+ */
101
112
 
102
113
  var ProductHome = function ProductHome(_ref) {
103
114
  var _productHomeButtonDyn;
@@ -138,7 +149,8 @@ var ProductHome = function ProductHome(_ref) {
138
149
  href: href,
139
150
  onClick: onClick,
140
151
  onMouseDown: preventFocusRing,
141
- "data-testid": testId && "".concat(testId, "-container")
152
+ "data-testid": testId && "".concat(testId, "-container") // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
153
+
142
154
  }, rest), jsx("div", {
143
155
  css: [customMaxHeightStyles, productLogoStyles],
144
156
  "data-testid": testId && "".concat(testId, "-logo")
@@ -99,7 +99,9 @@ var siteTitleStyles = css({
99
99
  borderRadius: 4,
100
100
  content: '""'
101
101
  }
102
- });
102
+ }); // Not exported to consumers, only used in NavigationSkeleton
103
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
104
+
103
105
  export var ProductHomeSkeleton = function ProductHomeSkeleton(_ref) {
104
106
  var _productHomeButtonDyn;
105
107
 
@@ -1,4 +1,15 @@
1
1
  import { IconButton } from '../IconButton';
2
+
3
+ /**
4
+ * __Profile__
5
+ *
6
+ * A profile button which takes an icon/avatar component can be that can be
7
+ * passed into `AtlassianNavigation`'s `renderProfile` prop.
8
+ *
9
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#profile)
10
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
11
+ */
2
12
  export var Profile = IconButton; // This exists only to extract props.
13
+ // eslint-disable-next-line @repo/internal/react/use-noop
3
14
 
4
15
  export default (function (props) {});
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
2
  import { gridSize } from '@atlaskit/theme/constants';
3
- import { IconButtonSkeleton } from '../IconButton/skeleton';
3
+ import { IconButtonSkeleton } from '../IconButton/skeleton'; // Not exported to consumers, only used in NavigationSkeleton
4
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
5
+
4
6
  export var ProfileSkeleton = function ProfileSkeleton() {
5
7
  return /*#__PURE__*/React.createElement(IconButtonSkeleton, {
6
8
  marginLeft: 6,
@@ -85,6 +85,15 @@ var SearchComponent = function SearchComponent(props) {
85
85
  value: value
86
86
  }));
87
87
  };
88
+ /**
89
+ * __Search__
90
+ *
91
+ * A search input that can be passed into `AtlassianNavigation`'s `renderSearch` prop.
92
+ *
93
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#search)
94
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
95
+ */
96
+
88
97
 
89
98
  export var Search = function Search(props) {
90
99
  var placeholder = props.placeholder,
@@ -103,7 +112,8 @@ export var Search = function Search(props) {
103
112
  icon: jsx(SearchIcon, {
104
113
  label: label
105
114
  }),
106
- tooltip: tooltip
115
+ tooltip: tooltip // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
116
+
107
117
  }, iconButtonProps)));
108
118
  };
109
119
  export default Search;
@@ -23,7 +23,9 @@ var searchInputSkeletonStyles = css({
23
23
  });
24
24
  var searchIconStyles = css(_defineProperty({}, "@media (min-width: ".concat(CREATE_BREAKPOINT, "px)"), {
25
25
  display: 'none !important'
26
- }));
26
+ })); // Not exported to consumers, only used in NavigationSkeleton
27
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
28
+
27
29
  export var SearchSkeleton = function SearchSkeleton() {
28
30
  var theme = useTheme();
29
31
  return jsx(Fragment, null, jsx("div", {
@@ -4,6 +4,15 @@ 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
+ /**
9
+ * __Settings__
10
+ *
11
+ * A settings button that can be passed into `AtlassianNavigation`'s `renderSettings` prop.
12
+ *
13
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#settings)
14
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
15
+ */
7
16
  export var Settings = /*#__PURE__*/forwardRef(function (props, ref) {
8
17
  var tooltip = props.tooltip,
9
18
  iconButtonProps = _objectWithoutProperties(props, _excluded);
@@ -4,6 +4,15 @@ 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
+ /**
9
+ * __Sign in__
10
+ *
11
+ * A sign-in button that can be passed into `AtlassianNavigation`'s `renderSignIn` prop.
12
+ *
13
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#sign-in)
14
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
15
+ */
7
16
  export var SignIn = function SignIn(props) {
8
17
  var tooltip = props.tooltip,
9
18
  iconButtonProps = _objectWithoutProperties(props, _excluded);
@@ -12,7 +21,8 @@ export var SignIn = function SignIn(props) {
12
21
  icon: /*#__PURE__*/React.createElement(SignInIcon, {
13
22
  label: typeof tooltip === 'string' ? tooltip : 'Sign-in Icon'
14
23
  }),
15
- tooltip: tooltip
24
+ tooltip: tooltip // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
25
+
16
26
  }, iconButtonProps));
17
27
  };
18
28
  export default SignIn;
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
2
  import { gridSize } from '@atlaskit/theme/constants';
3
- import { IconButtonSkeleton } from '../IconButton/skeleton';
3
+ import { IconButtonSkeleton } from '../IconButton/skeleton'; // Not exported to consumers, only used in NavigationSkeleton
4
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
5
+
4
6
  export var SignInSkeleton = function SignInSkeleton() {
5
7
  return /*#__PURE__*/React.createElement(IconButtonSkeleton, {
6
8
  marginLeft: 6,
@@ -21,6 +21,17 @@ var skeletonCreateButtonStyles = css({
21
21
  marginLeft: 12
22
22
  }
23
23
  });
24
+ /**
25
+ * __Skeleton create button__
26
+ *
27
+ * Skeleton buttons are lightweight HTML button elements with CSS that represent
28
+ * their heavier interactive counterparts, for use when elements of the
29
+ * navigation are loaded dynamically. This one represents the Create button.
30
+ *
31
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
32
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
33
+ */
34
+
24
35
  export var SkeletonCreateButton = function SkeletonCreateButton(_ref) {
25
36
  var text = _ref.text,
26
37
  testId = _ref.testId;
@@ -28,6 +39,7 @@ export var SkeletonCreateButton = function SkeletonCreateButton(_ref) {
28
39
  return jsx("button", {
29
40
  style: theme.mode.create.default,
30
41
  css: skeletonCreateButtonStyles,
31
- "data-testid": testId
42
+ "data-testid": testId,
43
+ type: "button"
32
44
  }, text);
33
45
  };
@@ -28,6 +28,17 @@ var skeletonIconButtonStyles = css({
28
28
  verticalAlign: 'middle'
29
29
  }
30
30
  });
31
+ /**
32
+ * __Skeleton icon button__
33
+ *
34
+ * Skeleton buttons are lightweight HTML button elements with CSS that represent
35
+ * their heavier interactive counterparts, for use when elements of the
36
+ * navigation are loaded dynamically. This one represents a generic icon button.
37
+ *
38
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
39
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
40
+ */
41
+
31
42
  export var SkeletonIconButton = function SkeletonIconButton(_ref) {
32
43
  var children = _ref.children,
33
44
  testId = _ref.testId;
@@ -35,6 +46,7 @@ export var SkeletonIconButton = function SkeletonIconButton(_ref) {
35
46
  return jsx("button", {
36
47
  style: theme.mode.iconButton.default,
37
48
  "data-testid": testId,
38
- css: skeletonIconButtonStyles
49
+ css: skeletonIconButtonStyles,
50
+ type: "button"
39
51
  }, children);
40
52
  };
@@ -70,6 +70,17 @@ var isDropdownButtonStyles = css({
70
70
  verticalAlign: 'middle'
71
71
  }
72
72
  });
73
+ /**
74
+ * __Skeleton primary button__
75
+ *
76
+ * Skeleton buttons are lightweight HTML button elements with CSS that represent
77
+ * their heavier interactive counterparts, for use when elements of the
78
+ * navigation are loaded dynamically. This one represents a primary button.
79
+ *
80
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
81
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
82
+ */
83
+
73
84
  export var SkeletonPrimaryButton = function SkeletonPrimaryButton(_ref) {
74
85
  var _objectSpread2;
75
86
 
@@ -88,6 +99,7 @@ export var SkeletonPrimaryButton = function SkeletonPrimaryButton(_ref) {
88
99
  }), {}, (_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));
89
100
 
90
101
  return jsx("button", {
102
+ type: "button",
91
103
  style: dynamicStyles,
92
104
  css: [primaryButtonSkeletonStyles, isHighlighted && isHighlightedStyles, isDropdownButton && isDropdownButtonStyles, isHighlighted && (isDropdownButton ? isHighlightedAndDropdownButtonStyles : isHighlightedNotDropdownButtonStyles)],
93
105
  "data-testid": testId
@@ -1,6 +1,7 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import React, { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
3
3
  import throttle from 'lodash/throttle';
4
+ import noop from '@atlaskit/ds-lib/noop';
4
5
  // Prevent width detector from triggering too many re-renders
5
6
  var THROTTLE_INTERVAL = 16 * 4; // Approx min width of items (based of "More" size)
6
7
 
@@ -15,13 +16,12 @@ var updateHashRef = function updateHashRef(currentRef, value) {
15
16
  currentRef.length = 3;
16
17
  };
17
18
 
18
- var noop = function noop() {};
19
-
20
19
  var OverflowContext = /*#__PURE__*/createContext({
21
20
  isVisible: true,
22
21
  openOverflowMenu: noop,
23
22
  closeOverflowMenu: noop
24
- });
23
+ }); // eslint-disable-next-line @repo/internal/react/require-jsdoc
24
+
25
25
  export var OverflowProvider = function OverflowProvider(_ref) {
26
26
  var children = _ref.children,
27
27
  isVisible = _ref.isVisible,
@@ -39,6 +39,14 @@ export var OverflowProvider = function OverflowProvider(_ref) {
39
39
  value: value
40
40
  }, children);
41
41
  };
42
+ /**
43
+ * __useOverFlowStatus__
44
+ *
45
+ * Returns the current context value for the nearest OverflowProvider.
46
+ *
47
+ * - [Example](https://atlassian.design/components/atlassian-navigation/examples#responsive)
48
+ */
49
+
42
50
  export var useOverflowStatus = function useOverflowStatus() {
43
51
  return useContext(OverflowContext);
44
52
  };
@@ -128,5 +136,6 @@ export var useOverflowController = function useOverflowController(nodes) {
128
136
  updateWidth: throttleSetWidth
129
137
  };
130
138
  }; // Used to extract props for useOverflowStatus();
139
+ // eslint-disable-next-line @repo/internal/react/use-noop
131
140
 
132
141
  export default (function (props) {});
@@ -2,6 +2,17 @@ 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
+ /**
7
+ * __Skeleton Notification button__
8
+ *
9
+ * Skeleton buttons are lightweight HTML button elements with CSS that represent
10
+ * their heavier interactive counterparts, for use when elements of the
11
+ * navigation are loaded dynamically. This one represents the Help button.
12
+ *
13
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
14
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
15
+ */
5
16
  export var SkeletonHelpButton = function SkeletonHelpButton(_ref) {
6
17
  var _ref$label = _ref.label,
7
18
  label = _ref$label === void 0 ? '' : _ref$label;
@@ -1,6 +1,17 @@
1
1
  import React from 'react';
2
2
  import NotificationIcon from '@atlaskit/icon/glyph/notification';
3
3
  import { SkeletonIconButton } from './components/SkeletonIconButton';
4
+
5
+ /**
6
+ * __Skeleton Notification button__
7
+ *
8
+ * Skeleton buttons are lightweight HTML button elements with CSS that represent
9
+ * their heavier interactive counterparts, for use when elements of the
10
+ * navigation are loaded dynamically. This one represents the Notification button.
11
+ *
12
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
13
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
14
+ */
4
15
  export var SkeletonNotificationButton = function SkeletonNotificationButton(_ref) {
5
16
  var _ref$label = _ref.label,
6
17
  label = _ref$label === void 0 ? '' : _ref$label;
@@ -1,6 +1,17 @@
1
1
  import React from 'react';
2
2
  import SettingsIcon from '@atlaskit/icon/glyph/settings';
3
3
  import { SkeletonIconButton } from './components/SkeletonIconButton';
4
+
5
+ /**
6
+ * __Skeleton settings button__
7
+ *
8
+ * Skeleton buttons are lightweight HTML button elements with CSS that represent
9
+ * their heavier interactive counterparts, for use when elements of the
10
+ * navigation are loaded dynamically. This one represents the Settings button.
11
+ *
12
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
13
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
14
+ */
4
15
  export var SkeletonSettingsButton = function SkeletonSettingsButton(_ref) {
5
16
  var _ref$label = _ref.label,
6
17
  label = _ref$label === void 0 ? '' : _ref$label;
@@ -1,6 +1,17 @@
1
1
  import React from 'react';
2
2
  import AppSwitcherIcon from '@atlaskit/icon/glyph/app-switcher';
3
3
  import { SkeletonIconButton } from './components/SkeletonIconButton';
4
+
5
+ /**
6
+ * __Skeleton switcher button__
7
+ *
8
+ * Skeleton buttons are lightweight HTML button elements with CSS that represent
9
+ * their heavier interactive counterparts, for use when elements of the
10
+ * navigation are loaded dynamically. This one represents the AppSwitcher button.
11
+ *
12
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
13
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
14
+ */
4
15
  export var SkeletonSwitcherButton = function SkeletonSwitcherButton(_ref) {
5
16
  var _ref$label = _ref.label,
6
17
  label = _ref$label === void 0 ? '' : _ref$label;
@@ -1,5 +1,5 @@
1
1
  import { B200, B400, B50, N0, N20, N200, N40, N600, N700 } from '@atlaskit/theme/colors';
2
- import { hexToRGBA } from './themeHelpers';
2
+ import { hexToRGBA } from './theme-helpers';
3
3
  var defaultTheme = {
4
4
  mode: {
5
5
  create: {
@@ -1,5 +1,5 @@
1
- export { generateTheme } from './themeGenerator';
2
- export { ThemeProvider } from './ThemeProvider';
1
+ export { generateTheme } from './theme-generator';
2
+ export { ThemeProvider } from './theme-provider';
3
3
  export { atlassianTheme, defaultTheme } from './themes';
4
- export { useTheme } from './useTheme';
5
- export { hexToRGBA } from './themeHelpers';
4
+ export { useTheme } from './use-theme';
5
+ export { hexToRGBA } from './theme-helpers';
@@ -4,12 +4,13 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
4
4
 
5
5
  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
6
 
7
- import defaultTheme, { DEFAULT_THEME_NAME } from './defaultTheme';
8
- import { generateTextColor, getBoxShadow, getContrastColor, hexToRGBA } from './themeHelpers';
7
+ import defaultTheme, { DEFAULT_THEME_NAME } from './default-theme';
8
+ import { generateTextColor, getBoxShadow, getContrastColor, hexToRGBA } from './theme-helpers';
9
9
 
10
10
  var generateOpacityValue = function generateOpacityValue(color) {
11
11
  return color === '#000000' ? 0.3 : 0.6;
12
- };
12
+ }; // eslint-disable-next-line @repo/internal/react/consistent-types-definitions
13
+
13
14
 
14
15
  var generateButtonCSSStates = function generateButtonCSSStates(colors, buttonType) {
15
16
  var backgroundColor = colors.backgroundColor,
@@ -0,0 +1,12 @@
1
+ import { createContext } from 'react';
2
+ import { defaultTheme } from './themes'; // Internal only
3
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
4
+
5
+ export var ThemeContext = /*#__PURE__*/createContext(defaultTheme);
6
+ /**
7
+ * __Theme provider__
8
+ *
9
+ * A provider for the theme context used by all navigation components.
10
+ */
11
+
12
+ export var ThemeProvider = ThemeContext.Provider;
@@ -1,6 +1,6 @@
1
1
  import { B400, N0 } from '@atlaskit/theme/colors';
2
- import { DEFAULT_THEME_NAME } from './defaultTheme';
3
- import { generateTheme } from './themeGenerator';
2
+ import { DEFAULT_THEME_NAME } from './default-theme';
3
+ import { generateTheme } from './theme-generator';
4
4
  export var atlassianTheme = generateTheme({
5
5
  name: DEFAULT_THEME_NAME,
6
6
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
@@ -1,5 +1,5 @@
1
1
  import { useContext } from 'react';
2
- import { ThemeContext } from './ThemeProvider';
2
+ import { ThemeContext } from './theme-provider';
3
3
  export var useTheme = function useTheme() {
4
4
  return useContext(ThemeContext);
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/atlassian-navigation",
3
- "version": "2.2.5",
3
+ "version": "2.2.6",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,14 @@
1
1
  import React from 'react';
2
2
  import { AppSwitcherProps } from './types';
3
+ /**
4
+ * _App switcher__
5
+ *
6
+ * An AppSwitcher button that can be passed into `AtlassianNavigation`'s
7
+ * `renderAppSwitcher` prop.
8
+ *
9
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#app-switcher)
10
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
11
+ */
3
12
  export declare const AppSwitcher: React.ForwardRefExoticComponent<import("../IconButton/types").BaseIconButtonProps & React.RefAttributes<any>>;
4
13
  declare const _default: (props: AppSwitcherProps) => void;
5
14
  export default _default;
@@ -1,4 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { AtlassianNavigationProps } from './types';
3
+ /**
4
+ * __Atlassian navigation__
5
+ *
6
+ * The horizontal navigation component for Atlassian products.
7
+ *
8
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples)
9
+ * - [Code](https://atlassian.design/components/atlassian-navigation/examples)
10
+ */
3
11
  export declare const AtlassianNavigation: (props: AtlassianNavigationProps) => JSX.Element;
4
12
  export default AtlassianNavigation;
@@ -1,4 +1,17 @@
1
1
  /// <reference types="react" />
2
2
  import { NavigationSkeletonProps } from './types';
3
+ /**
4
+ * __Navigation skeleton__
5
+ *
6
+ * Use loading skeletons to reduce the perceived loading time of heavier
7
+ * full-page experiences. This should only be used when the whole navigation is
8
+ * delayed; if there are only certain dynamically loaded navigation items that
9
+ * slow down the page, you should look into using
10
+ * [skeleton buttons](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
11
+ * instead.
12
+ *
13
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-loader)
14
+ * - [Code](https://atlassian.design/components/{packageName}/code)
15
+ */
3
16
  export declare const NavigationSkeleton: ({ primaryItemsCount, secondaryItemsCount, theme, showSiteName, shouldShowSearch, testId, }: NavigationSkeletonProps) => JSX.Element;
4
17
  export default NavigationSkeleton;
@@ -1,4 +1,13 @@
1
1
  /// <reference types="react" />
2
2
  import { CreateProps } from './types';
3
+ /**
4
+ * _Create__
5
+ *
6
+ * A call to action button that can be passed into `AtlassianNavigation`'s
7
+ * `renderCreate` prop. It is shown after all other primary buttons.
8
+ *
9
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#create)
10
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
11
+ */
3
12
  export declare const Create: ({ onClick, href, text, buttonTooltip, iconButtonTooltip, testId, }: CreateProps) => JSX.Element;
4
13
  export default Create;
@@ -25,9 +25,9 @@ export interface CreateProps {
25
25
  * A `testId` prop is provided for specified elements,
26
26
  * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
27
27
  * serving as a hook for automated tests.
28
-
28
+ *
29
29
  * Will set these elements when defined:
30
-
30
+ *
31
31
  * - Create button shown on large screen sizes - `{testId}-button`
32
32
  * - Create icon button shown on small screen sizes - `{testId}-icon-button`
33
33
  */
@@ -1,4 +1,12 @@
1
1
  import React from 'react';
2
+ /**
3
+ * __Help__
4
+ *
5
+ * A help button that can be passed into `AtlassianNavigation`'s `renderHelp` prop.
6
+ *
7
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#help)
8
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
9
+ */
2
10
  export declare const Help: React.ForwardRefExoticComponent<import("../IconButton/types").BaseIconButtonProps & {
3
11
  badge?: React.ComponentType<{}> | undefined;
4
12
  } & React.RefAttributes<any>>;
@@ -1,4 +1,13 @@
1
1
  import React from 'react';
2
+ /**
3
+ * __Icon button__
4
+ *
5
+ * An icon button is used to create navigation items such as Help, Settings
6
+ * and Notifications. You can use this component to create your own items to
7
+ * pass into `AtlassianNavigation`'s render props, but where possible you should
8
+ * rely on the defaults.
9
+ *
10
+ */
2
11
  export declare const IconButton: React.ForwardRefExoticComponent<import("./types").BaseIconButtonProps & {
3
12
  icon: React.ReactChild | undefined;
4
13
  theme?: ((current: (props: import("@atlaskit/button/custom-theme-button").ThemeProps) => import("@atlaskit/button/custom-theme-button").ThemeTokens, props: import("@atlaskit/button/custom-theme-button").ThemeProps) => import("@atlaskit/button/custom-theme-button").ThemeTokens) | undefined;
@@ -59,20 +59,20 @@ export interface BaseIconButtonProps {
59
59
  */
60
60
  target?: string;
61
61
  /**
62
- Allows for overriding the component used to render the button.
63
-
64
- This is primarily intended for compatibility with custom
65
- routing libraries when using the `href` prop.
66
-
67
- For further usage information, refer to the [documentation for button](https://atlassian.design/components/button/code).
68
-
69
- @example
70
- ```tsx
71
- <Settings
72
- component={CustomRouterLink}
73
- href="/path/to/url"
74
- />
75
- ```
62
+ * Allows for overriding the component used to render the button.
63
+ *
64
+ * This is primarily intended for compatibility with custom
65
+ * routing libraries when using the `href` prop.
66
+ *
67
+ * For further usage information, refer to the [documentation for button](https://atlassian.design/components/button/code).
68
+ *
69
+ * @example
70
+ * ```tsx
71
+ * <Settings
72
+ * component={CustomRouterLink}
73
+ * href="/path/to/url"
74
+ * />
75
+ * ```
76
76
  */
77
77
  component?: CustomThemeButtonProps['component'];
78
78
  /**
@@ -1,4 +1,13 @@
1
1
  import React from 'react';
2
+ /**
3
+ * __Notifications__
4
+ *
5
+ * A notifications button that can be passed into `AtlassianNavigation`'s
6
+ * `renderNotifications` prop.
7
+ *
8
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#notifications)
9
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
10
+ */
2
11
  export declare const Notifications: React.ForwardRefExoticComponent<import("../IconButton/types").BaseIconButtonProps & {
3
12
  badge: React.ComponentType<{}>;
4
13
  } & React.RefAttributes<any>>;
@@ -1,4 +1,13 @@
1
1
  /// <reference types="react" />
2
+ /**
3
+ * __Primary button__
4
+ *
5
+ * A primary button allows you to add top-level navigation items.
6
+ * Should be passed into `AtlassianNavigation`'s `primaryItems` prop.
7
+ *
8
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#dropdown-menu)
9
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
10
+ */
2
11
  export declare const PrimaryButton: import("react").ForwardRefExoticComponent<Omit<import("@atlaskit/button/custom-theme-button").CustomThemeButtonProps, "appearance" | "onClick"> & {
3
12
  component?: import("react").ComponentType<import("react").AllHTMLAttributes<HTMLElement>> | import("react").ElementType<any> | undefined;
4
13
  isHighlighted?: boolean | undefined;