@atlaskit/atlassian-navigation 2.2.3 → 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 (169) hide show
  1. package/CHANGELOG.md +20 -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 +17 -2
  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 +17 -2
  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 +17 -2
  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 +9 -5
  166. package/report.api.md +637 -0
  167. package/dist/es2019/theme/ThemeProvider.js +0 -4
  168. package/dist/es2019/theme/useTheme.js +0 -3
  169. package/dist/esm/theme/ThemeProvider.js +0 -4
@@ -84,6 +84,15 @@ const SearchComponent = props => {
84
84
  value: value
85
85
  }));
86
86
  };
87
+ /**
88
+ * __Search__
89
+ *
90
+ * A search input that can be passed into `AtlassianNavigation`'s `renderSearch` prop.
91
+ *
92
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#search)
93
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
94
+ */
95
+
87
96
 
88
97
  export const Search = props => {
89
98
  const {
@@ -103,7 +112,8 @@ export const 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;
@@ -26,7 +26,9 @@ const searchIconStyles = css({
26
26
  [`@media (min-width: ${CREATE_BREAKPOINT}px)`]: {
27
27
  display: 'none !important'
28
28
  }
29
- });
29
+ }); // Not exported to consumers, only used in NavigationSkeleton
30
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
31
+
30
32
  export const SearchSkeleton = () => {
31
33
  const theme = useTheme();
32
34
  return jsx(Fragment, null, jsx("div", {
@@ -2,6 +2,15 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { forwardRef } from 'react';
3
3
  import SettingsIcon from '@atlaskit/icon/glyph/settings';
4
4
  import { IconButton } from '../IconButton';
5
+
6
+ /**
7
+ * __Settings__
8
+ *
9
+ * A settings button that can be passed into `AtlassianNavigation`'s `renderSettings` prop.
10
+ *
11
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#settings)
12
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
13
+ */
5
14
  export const Settings = /*#__PURE__*/forwardRef((props, ref) => {
6
15
  const {
7
16
  tooltip,
@@ -2,6 +2,15 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
3
  import SignInIcon from '@atlaskit/icon/glyph/sign-in';
4
4
  import { IconButton } from '../IconButton';
5
+
6
+ /**
7
+ * __Sign in__
8
+ *
9
+ * A sign-in button that can be passed into `AtlassianNavigation`'s `renderSignIn` prop.
10
+ *
11
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#sign-in)
12
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
13
+ */
5
14
  export const SignIn = props => {
6
15
  const {
7
16
  tooltip,
@@ -11,7 +20,8 @@ export const SignIn = props => {
11
20
  icon: /*#__PURE__*/React.createElement(SignInIcon, {
12
21
  label: typeof tooltip === 'string' ? tooltip : 'Sign-in Icon'
13
22
  }),
14
- tooltip: tooltip
23
+ tooltip: tooltip // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
24
+
15
25
  }, iconButtonProps));
16
26
  };
17
27
  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 const SignInSkeleton = () => /*#__PURE__*/React.createElement(IconButtonSkeleton, {
5
7
  marginLeft: 6,
6
8
  marginRight: 6,
@@ -21,6 +21,17 @@ const 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 const SkeletonCreateButton = ({
25
36
  text,
26
37
  testId
@@ -29,6 +40,7 @@ export const SkeletonCreateButton = ({
29
40
  return jsx("button", {
30
41
  style: theme.mode.create.default,
31
42
  css: skeletonCreateButtonStyles,
32
- "data-testid": testId
43
+ "data-testid": testId,
44
+ type: "button"
33
45
  }, text);
34
46
  };
@@ -28,6 +28,17 @@ const 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 const SkeletonIconButton = ({
32
43
  children,
33
44
  testId
@@ -36,6 +47,7 @@ export const SkeletonIconButton = ({
36
47
  return jsx("button", {
37
48
  style: theme.mode.iconButton.default,
38
49
  "data-testid": testId,
39
- css: skeletonIconButtonStyles
50
+ css: skeletonIconButtonStyles,
51
+ type: "button"
40
52
  }, children);
41
53
  };
@@ -64,6 +64,17 @@ const isDropdownButtonStyles = css({
64
64
  verticalAlign: 'middle'
65
65
  }
66
66
  });
67
+ /**
68
+ * __Skeleton primary button__
69
+ *
70
+ * Skeleton buttons are lightweight HTML button elements with CSS that represent
71
+ * their heavier interactive counterparts, for use when elements of the
72
+ * navigation are loaded dynamically. This one represents a primary button.
73
+ *
74
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
75
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
76
+ */
77
+
67
78
  export const SkeletonPrimaryButton = ({
68
79
  isDropdownButton = false,
69
80
  isHighlighted = false,
@@ -81,6 +92,7 @@ export const SkeletonPrimaryButton = ({
81
92
  [VAR_PRIMARY_BUTTON_AFTER_DROPDOWN_BORDER_COLOR]: isHighlighted ? primaryButton.default.borderColor : primaryButton.default.color
82
93
  };
83
94
  return jsx("button", {
95
+ type: "button",
84
96
  style: dynamicStyles,
85
97
  css: [primaryButtonSkeletonStyles, isHighlighted && isHighlightedStyles, isDropdownButton && isDropdownButtonStyles, isHighlighted && (isDropdownButton ? isHighlightedAndDropdownButtonStyles : isHighlightedNotDropdownButtonStyles)],
86
98
  "data-testid": testId
@@ -1,5 +1,6 @@
1
1
  import React, { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
2
2
  import throttle from 'lodash/throttle';
3
+ import noop from '@atlaskit/ds-lib/noop';
3
4
  // Prevent width detector from triggering too many re-renders
4
5
  const THROTTLE_INTERVAL = 16 * 4; // Approx min width of items (based of "More" size)
5
6
 
@@ -12,13 +13,12 @@ const updateHashRef = (currentRef, value) => {
12
13
  currentRef.length = 3;
13
14
  };
14
15
 
15
- const noop = () => {};
16
-
17
16
  const OverflowContext = /*#__PURE__*/createContext({
18
17
  isVisible: true,
19
18
  openOverflowMenu: noop,
20
19
  closeOverflowMenu: noop
21
- });
20
+ }); // eslint-disable-next-line @repo/internal/react/require-jsdoc
21
+
22
22
  export const OverflowProvider = ({
23
23
  children,
24
24
  isVisible,
@@ -37,6 +37,14 @@ export const OverflowProvider = ({
37
37
  value: value
38
38
  }, children);
39
39
  };
40
+ /**
41
+ * __useOverFlowStatus__
42
+ *
43
+ * Returns the current context value for the nearest OverflowProvider.
44
+ *
45
+ * - [Example](https://atlassian.design/components/atlassian-navigation/examples#responsive)
46
+ */
47
+
40
48
  export const useOverflowStatus = () => useContext(OverflowContext);
41
49
  export const useOverflowController = nodes => {
42
50
  const items = React.Children.toArray(nodes);
@@ -109,5 +117,6 @@ export const useOverflowController = nodes => {
109
117
  updateWidth: throttleSetWidth
110
118
  };
111
119
  }; // Used to extract props for useOverflowStatus();
120
+ // eslint-disable-next-line @repo/internal/react/use-noop
112
121
 
113
122
  export default (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 const SkeletonHelpButton = ({
6
17
  label = ''
7
18
  }) => {
@@ -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 const SkeletonNotificationButton = ({
5
16
  label = ''
6
17
  }) => /*#__PURE__*/React.createElement(SkeletonIconButton, null, /*#__PURE__*/React.createElement(NotificationIcon, {
@@ -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 const SkeletonSettingsButton = ({
5
16
  label = ''
6
17
  }) => /*#__PURE__*/React.createElement(SkeletonIconButton, null, /*#__PURE__*/React.createElement(SettingsIcon, {
@@ -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 const SkeletonSwitcherButton = ({
5
16
  label = ''
6
17
  }) => /*#__PURE__*/React.createElement(SkeletonIconButton, null, /*#__PURE__*/React.createElement(AppSwitcherIcon, {
@@ -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
  const 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';
@@ -1,7 +1,8 @@
1
- import defaultTheme, { DEFAULT_THEME_NAME } from './defaultTheme';
2
- import { generateTextColor, getBoxShadow, getContrastColor, hexToRGBA } from './themeHelpers';
1
+ import defaultTheme, { DEFAULT_THEME_NAME } from './default-theme';
2
+ import { generateTextColor, getBoxShadow, getContrastColor, hexToRGBA } from './theme-helpers';
3
+
4
+ const generateOpacityValue = color => color === '#000000' ? 0.3 : 0.6; // eslint-disable-next-line @repo/internal/react/consistent-types-definitions
3
5
 
4
- const generateOpacityValue = color => color === '#000000' ? 0.3 : 0.6;
5
6
 
6
7
  const generateButtonCSSStates = (colors, buttonType) => {
7
8
  const {
@@ -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 const 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 const 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 const atlassianTheme = generateTheme({
5
5
  name: DEFAULT_THEME_NAME,
6
6
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
@@ -0,0 +1,3 @@
1
+ import { useContext } from 'react';
2
+ import { ThemeContext } from './theme-provider';
3
+ export const useTheme = () => useContext(ThemeContext);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/atlassian-navigation",
3
- "version": "2.2.3",
3
+ "version": "2.2.6",
4
4
  "sideEffects": false
5
5
  }
@@ -4,6 +4,16 @@ var _excluded = ["tooltip"];
4
4
  import React, { forwardRef } from 'react';
5
5
  import AppSwitcherIcon from '@atlaskit/icon/glyph/app-switcher';
6
6
  import { IconButton } from '../IconButton';
7
+
8
+ /**
9
+ * _App switcher__
10
+ *
11
+ * An AppSwitcher button that can be passed into `AtlassianNavigation`'s
12
+ * `renderAppSwitcher` prop.
13
+ *
14
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#app-switcher)
15
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
16
+ */
7
17
  export var AppSwitcher = /*#__PURE__*/forwardRef(function (props, ref) {
8
18
  var tooltip = props.tooltip,
9
19
  iconButtonProps = _objectWithoutProperties(props, _excluded);
@@ -16,5 +26,6 @@ export var AppSwitcher = /*#__PURE__*/forwardRef(function (props, ref) {
16
26
  ref: ref
17
27
  }, iconButtonProps));
18
28
  }); // exists only to extract props
29
+ // eslint-disable-next-line @repo/internal/react/use-noop
19
30
 
20
31
  export default (function (props) {});
@@ -64,6 +64,15 @@ var analyticsData = {
64
64
  },
65
65
  componentName: 'atlassianNavigation'
66
66
  };
67
+ /**
68
+ * __Atlassian navigation__
69
+ *
70
+ * The horizontal navigation component for Atlassian products.
71
+ *
72
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples)
73
+ * - [Code](https://atlassian.design/components/atlassian-navigation/examples)
74
+ */
75
+
67
76
  export var AtlassianNavigation = function AtlassianNavigation(props) {
68
77
  var label = props.label,
69
78
  _props$primaryItems = props.primaryItems,
@@ -98,7 +107,8 @@ export var AtlassianNavigation = function AtlassianNavigation(props) {
98
107
  testId: testId,
99
108
  moreLabel: moreLabel,
100
109
  items: primaryItems,
101
- create: create,
110
+ create: create // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
111
+ ,
102
112
  theme: theme
103
113
  })), jsx("div", {
104
114
  css: rightStyles,
@@ -61,6 +61,20 @@ var rightStyles = css({
61
61
  flexShrink: 0
62
62
  }
63
63
  });
64
+ /**
65
+ * __Navigation skeleton__
66
+ *
67
+ * Use loading skeletons to reduce the perceived loading time of heavier
68
+ * full-page experiences. This should only be used when the whole navigation is
69
+ * delayed; if there are only certain dynamically loaded navigation items that
70
+ * slow down the page, you should look into using
71
+ * [skeleton buttons](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
72
+ * instead.
73
+ *
74
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-loader)
75
+ * - [Code](https://atlassian.design/components/{packageName}/code)
76
+ */
77
+
64
78
  export var NavigationSkeleton = function NavigationSkeleton(_ref) {
65
79
  var _ref$primaryItemsCoun = _ref.primaryItemsCount,
66
80
  primaryItemsCount = _ref$primaryItemsCoun === void 0 ? 4 : _ref$primaryItemsCoun,
@@ -8,7 +8,9 @@ var badgeContainerStyles = css({
8
8
  });
9
9
  var containerStyles = css({
10
10
  position: 'relative'
11
- });
11
+ }); // Not exported to consumers
12
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
13
+
12
14
  export var BadgeContainer = function BadgeContainer(props) {
13
15
  var badgeId = props.id,
14
16
  Badge = props.badge,
@@ -35,6 +35,16 @@ var TooltipSwitch = function TooltipSwitch(_ref) {
35
35
  hideTooltipOnClick: true
36
36
  }, children) : jsx(Fragment, null, children);
37
37
  };
38
+ /**
39
+ * _Create__
40
+ *
41
+ * A call to action button that can be passed into `AtlassianNavigation`'s
42
+ * `renderCreate` prop. It is shown after all other primary buttons.
43
+ *
44
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#create)
45
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
46
+ */
47
+
38
48
 
39
49
  export var Create = function Create(_ref2) {
40
50
  var onClick = _ref2.onClick,
@@ -52,7 +62,8 @@ export var Create = function Create(_ref2) {
52
62
  }, jsx(Button, {
53
63
  id: "createGlobalItem",
54
64
  onClick: onClick,
55
- href: href,
65
+ href: href // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
66
+ ,
56
67
  theme: getCreateButtonTheme(theme),
57
68
  testId: testId && "".concat(testId, "-button"),
58
69
  "data-hide-on-smallscreens": true
@@ -64,7 +75,8 @@ export var Create = function Create(_ref2) {
64
75
  }),
65
76
  onClick: onClick,
66
77
  href: href,
67
- tooltip: iconButtonTooltip,
78
+ tooltip: iconButtonTooltip // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
79
+ ,
68
80
  theme: getCreateButtonTheme(theme),
69
81
  "aria-label": text,
70
82
  "data-hide-on-largescreens": true
@@ -16,7 +16,9 @@ var skeletonStyles = css({
16
16
  });
17
17
  var mobileStyles = css(_defineProperty({}, "@media (max-width: ".concat(CREATE_BREAKPOINT - 1, "px)"), {
18
18
  display: 'none !important'
19
- }));
19
+ })); // Not exported to consumers, only used in NavigationSkeleton
20
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
21
+
20
22
  export var CreateSkeleton = function CreateSkeleton() {
21
23
  var theme = useTheme();
22
24
  return jsx(Fragment, null, jsx("div", {
@@ -7,6 +7,15 @@ import { useTheme } from '../../theme';
7
7
  import { BadgeContainer } from '../BadgeContainer';
8
8
  import { IconButton } from '../IconButton';
9
9
  var HELP_NOTIFICATION_BADGE_ID = 'atlassian-navigation-help-notification-count';
10
+ /**
11
+ * __Help__
12
+ *
13
+ * A help button that can be passed into `AtlassianNavigation`'s `renderHelp` prop.
14
+ *
15
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#help)
16
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
17
+ */
18
+
10
19
  export var Help = /*#__PURE__*/forwardRef(function (props, ref) {
11
20
  var badge = props.badge,
12
21
  tooltip = props.tooltip,
@@ -6,6 +6,16 @@ import Button from '@atlaskit/button/custom-theme-button';
6
6
  import Tooltip from '@atlaskit/tooltip';
7
7
  import { useTheme } from '../../theme';
8
8
  import { getIconButtonTheme } from './styles';
9
+
10
+ /**
11
+ * __Icon button__
12
+ *
13
+ * An icon button is used to create navigation items such as Help, Settings
14
+ * and Notifications. You can use this component to create your own items to
15
+ * pass into `AtlassianNavigation`'s render props, but where possible you should
16
+ * rely on the defaults.
17
+ *
18
+ */
9
19
  export var IconButton = /*#__PURE__*/forwardRef(function (props, ref) {
10
20
  var icon = props.icon,
11
21
  testId = props.testId,
@@ -17,7 +27,8 @@ export var IconButton = /*#__PURE__*/forwardRef(function (props, ref) {
17
27
  appearance: "primary",
18
28
  testId: testId,
19
29
  iconBefore: icon,
20
- ref: ref,
30
+ ref: ref // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
31
+ ,
21
32
  theme: getIconButtonTheme(theme)
22
33
  }, buttonProps));
23
34
 
@@ -12,7 +12,9 @@ var buttonHeight = gridSize * 4;
12
12
  var skeletonStyles = css({
13
13
  borderRadius: '50%',
14
14
  opacity: 0.15
15
- });
15
+ }); // Not exported to consumers, only used in NavigationSkeleton
16
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
17
+
16
18
  export var IconButtonSkeleton = function IconButtonSkeleton(_ref) {
17
19
  var className = _ref.className,
18
20
  marginLeft = _ref.marginLeft,
@@ -6,6 +6,16 @@ import NotificationIcon from '@atlaskit/icon/glyph/notification';
6
6
  import { BadgeContainer } from '../BadgeContainer';
7
7
  import { IconButton } from '../IconButton';
8
8
  var NOTIFICATIONS_BADGE_ID = 'atlassian-navigation-notification-count';
9
+ /**
10
+ * __Notifications__
11
+ *
12
+ * A notifications button that can be passed into `AtlassianNavigation`'s
13
+ * `renderNotifications` prop.
14
+ *
15
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#notifications)
16
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
17
+ */
18
+
9
19
  export var Notifications = /*#__PURE__*/forwardRef(function (props, ref) {
10
20
  var badge = props.badge,
11
21
  tooltip = props.tooltip,
@@ -38,6 +38,16 @@ var buttonHighlightedStyles = css({
38
38
  content: '""'
39
39
  }
40
40
  });
41
+ /**
42
+ * __Primary button__
43
+ *
44
+ * A primary button allows you to add top-level navigation items.
45
+ * Should be passed into `AtlassianNavigation`'s `primaryItems` prop.
46
+ *
47
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#dropdown-menu)
48
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
49
+ */
50
+
41
51
  export var PrimaryButton = /*#__PURE__*/forwardRef(function (props, ref) {
42
52
  var _ref;
43
53
 
@@ -56,7 +66,8 @@ export var PrimaryButton = /*#__PURE__*/forwardRef(function (props, ref) {
56
66
  appearance: "primary",
57
67
  testId: testId,
58
68
  ref: ref,
59
- isSelected: isSelected,
69
+ isSelected: isSelected // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
70
+ ,
60
71
  theme: getPrimaryButtonTheme(theme)
61
72
  }, buttonProps), children));
62
73
 
@@ -1,5 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
-
3
1
  /** @jsx jsx */
4
2
  import { css, jsx } from '@emotion/core';
5
3
  import { buttonHeight, gridSize } from '../../common/constants';
@@ -11,11 +9,14 @@ var skeletonStyles = css({
11
9
  height: "".concat(buttonHeight - paddingAll * 2.5, "px"),
12
10
  borderRadius: "".concat(gridSize / 2, "px"),
13
11
  opacity: 0.15
14
- });
12
+ }); // Not exported to consumers, only used in NavigationSkeleton
13
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
14
+
15
15
  export var PrimaryButtonSkeleton = function PrimaryButtonSkeleton(props) {
16
16
  var theme = useTheme();
17
- return jsx("div", _extends({
17
+ return jsx("div", {
18
18
  style: theme.mode.skeleton,
19
- css: skeletonStyles
20
- }, props));
19
+ css: skeletonStyles,
20
+ className: props.className
21
+ });
21
22
  };
@@ -10,6 +10,16 @@ var chevronIconStyles = css({
10
10
  marginLeft: '-8px',
11
11
  opacity: 0.51
12
12
  });
13
+ /**
14
+ * __Primary dropdown button__
15
+ *
16
+ * A primary dropdown button allows you to add dropdown menus to the navigation.
17
+ * Should be passed into `AtlassianNavigation`'s `primaryItems` prop.
18
+ *
19
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#button)
20
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
21
+ */
22
+
13
23
  export var PrimaryDropdownButton = /*#__PURE__*/forwardRef(function (props, ref) {
14
24
  return jsx(PrimaryButton, _extends({
15
25
  iconAfter: jsx("span", {