@atlaskit/atlassian-navigation 2.1.4 → 2.2.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 (29) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +3 -3
  3. package/dist/cjs/components/AtlassianNavigation/skeleton.js +4 -2
  4. package/dist/cjs/controllers/overflow/index.js +2 -2
  5. package/dist/cjs/theme/themeGenerator.js +2 -1
  6. package/dist/cjs/version.json +1 -1
  7. package/dist/es2019/components/AtlassianNavigation/skeleton.js +2 -1
  8. package/dist/es2019/controllers/overflow/index.js +2 -2
  9. package/dist/es2019/theme/themeGenerator.js +2 -1
  10. package/dist/es2019/version.json +1 -1
  11. package/dist/esm/components/AtlassianNavigation/skeleton.js +2 -1
  12. package/dist/esm/controllers/overflow/index.js +2 -2
  13. package/dist/esm/theme/themeGenerator.js +2 -1
  14. package/dist/esm/version.json +1 -1
  15. package/dist/types/common/styles.d.ts +519 -514
  16. package/dist/types/components/AtlassianNavigation/skeleton.d.ts +1 -0
  17. package/dist/types/components/AtlassianNavigation/types.d.ts +30 -15
  18. package/dist/types/components/Help/index.d.ts +1 -1
  19. package/dist/types/components/IconButton/index.d.ts +1 -1
  20. package/dist/types/components/PrimaryButton/index.d.ts +1 -1
  21. package/dist/types/components/PrimaryDropdownButton/index.d.ts +1 -1
  22. package/dist/types/components/Profile/index.d.ts +1 -1
  23. package/dist/types/controllers/overflow/index.d.ts +2 -2
  24. package/package.json +6 -3
  25. package/skeleton/package.json +1 -0
  26. package/skeleton-help-button/package.json +1 -0
  27. package/skeleton-notification-button/package.json +1 -0
  28. package/skeleton-settings-button/package.json +1 -0
  29. package/skeleton-switcher-button/package.json +1 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @atlaskit/atlassian-navigation
2
2
 
3
+ ## 2.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`81addc0c144`](https://bitbucket.org/atlassian/atlassian-frontend/commits/81addc0c144) - [ux] Pass boxShadow for the focus styling of search section in the theme generator.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
13
+ ## 2.1.6
14
+
15
+ ### Patch Changes
16
+
17
+ - [`3622df604ee`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3622df604ee) - Fixes bug where navigation items cannot be added after intial render if the initial item array was empty
18
+
19
+ ## 2.1.5
20
+
21
+ ### Patch Changes
22
+
23
+ - [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade to TypeScript 4.2.4
24
+ - Updated dependencies
25
+
3
26
  ## 2.1.4
4
27
 
5
28
  ### Patch Changes
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Atlassian Navigation
1
+ # Atlassian navigation
2
2
 
3
- The new top navigation experience used in Atlassian products.
3
+ A horizontal navigation component for Atlassian products.
4
4
 
5
5
  ## Installation
6
6
 
@@ -10,7 +10,7 @@ yarn add @atlaskit/atlassian-navigation
10
10
 
11
11
  ## Usage
12
12
 
13
- Detailed docs and example usage can be found [here](https://atlaskit.atlassian.com/packages/navigation/atlassian-navigation).
13
+ Detailed docs and example usage can be found [here](https://atlassian.design/components/atlassian-navigation).
14
14
 
15
15
  To add side navigation, use [@atlaskit/side-navigation](https://atlaskit.atlassian.com/packages/navigation/side-navigation)
16
16
  To control the layout of these navigation elements and add expand/collapse functionality to `side-navigation`, use [@atlaskit/page-layout](https://atlaskit.atlassian.com/packages/design-system/page-layout).
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.NavigationSkeleton = void 0;
6
+ exports.default = exports.NavigationSkeleton = void 0;
7
7
 
8
8
  var _core = require("@emotion/core");
9
9
 
@@ -120,4 +120,6 @@ var NavigationSkeleton = function NavigationSkeleton(_ref) {
120
120
  }), (0, _core.jsx)(_skeleton4.ProfileSkeleton, null))));
121
121
  };
122
122
 
123
- exports.NavigationSkeleton = NavigationSkeleton;
123
+ exports.NavigationSkeleton = NavigationSkeleton;
124
+ var _default = NavigationSkeleton;
125
+ exports.default = _default;
@@ -93,7 +93,7 @@ var useOverflowController = function useOverflowController(nodes) {
93
93
 
94
94
  var throttleSetWidth = (0, _react.useCallback)((0, _throttle.default)(setWidth, THROTTLE_INTERVAL), [setWidth]);
95
95
  (0, _react.useEffect)(function () {
96
- var lastItemWidth = itemsWidths[itemsLimit];
96
+ var lastItemWidth = itemsWidths[itemsLimit] || 0;
97
97
  var wasJustLimited = lastItemWidth < 0;
98
98
  var currentHash = calculateHash(width, itemsLimit);
99
99
 
@@ -134,7 +134,7 @@ var useOverflowController = function useOverflowController(nodes) {
134
134
  return;
135
135
  }
136
136
 
137
- if (width - itemsWidths[itemsLimit] > ITEM_APPROX_MINWIDTH * 1.1 && itemsLimit < items.length) {
137
+ if (width - lastItemWidth > ITEM_APPROX_MINWIDTH * 1.1 && itemsLimit < items.length) {
138
138
  // If we have enough room to accomodate next item width we increase the limit
139
139
  // unless it has been recently removed
140
140
  var _nextHash = calculateHash(width, itemsLimit + 1);
@@ -107,7 +107,8 @@ var generateTheme = function generateTheme(themeColors) {
107
107
  borderColor: (0, _themeHelpers.hexToRGBA)(color, 0.5)
108
108
  },
109
109
  focus: {
110
- borderColor: (0, _themeHelpers.hexToRGBA)(highlightColor, 0.8)
110
+ borderColor: (0, _themeHelpers.hexToRGBA)(highlightColor, 0.8),
111
+ boxShadow: (0, _themeHelpers.getBoxShadow)((0, _themeHelpers.hexToRGBA)(highlightColor, 0.5))
111
112
  },
112
113
  hover: {
113
114
  backgroundColor: (0, _themeHelpers.getContrastColor)(0.1, generateOpacityValue(color), backgroundColor),
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/atlassian-navigation",
3
- "version": "2.1.4",
3
+ "version": "2.2.0",
4
4
  "sideEffects": false
5
5
  }
@@ -95,4 +95,5 @@ export const NavigationSkeleton = ({
95
95
  marginRight: gridSize / 2,
96
96
  size: gridSize * 3.25
97
97
  })), jsx(ProfileSkeleton, null))));
98
- };
98
+ };
99
+ export default NavigationSkeleton;
@@ -51,7 +51,7 @@ export const useOverflowController = nodes => {
51
51
 
52
52
  const throttleSetWidth = useCallback(throttle(setWidth, THROTTLE_INTERVAL), [setWidth]);
53
53
  useEffect(() => {
54
- const lastItemWidth = itemsWidths[itemsLimit];
54
+ const lastItemWidth = itemsWidths[itemsLimit] || 0;
55
55
  const wasJustLimited = lastItemWidth < 0;
56
56
  const currentHash = calculateHash(width, itemsLimit);
57
57
 
@@ -90,7 +90,7 @@ export const useOverflowController = nodes => {
90
90
  return;
91
91
  }
92
92
 
93
- if (width - itemsWidths[itemsLimit] > ITEM_APPROX_MINWIDTH * 1.1 && itemsLimit < items.length) {
93
+ if (width - lastItemWidth > ITEM_APPROX_MINWIDTH * 1.1 && itemsLimit < items.length) {
94
94
  // If we have enough room to accomodate next item width we increase the limit
95
95
  // unless it has been recently removed
96
96
  const nextHash = calculateHash(width, itemsLimit + 1);
@@ -84,7 +84,8 @@ export const generateTheme = themeColors => {
84
84
  borderColor: hexToRGBA(color, 0.5)
85
85
  },
86
86
  focus: {
87
- borderColor: hexToRGBA(highlightColor, 0.8)
87
+ borderColor: hexToRGBA(highlightColor, 0.8),
88
+ boxShadow: getBoxShadow(hexToRGBA(highlightColor, 0.5))
88
89
  },
89
90
  hover: {
90
91
  backgroundColor: getContrastColor(0.1, generateOpacityValue(color), backgroundColor),
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/atlassian-navigation",
3
- "version": "2.1.4",
3
+ "version": "2.2.0",
4
4
  "sideEffects": false
5
5
  }
@@ -101,4 +101,5 @@ export var NavigationSkeleton = function NavigationSkeleton(_ref) {
101
101
  size: gridSize * 3.25
102
102
  });
103
103
  }), jsx(ProfileSkeleton, null))));
104
- };
104
+ };
105
+ export default NavigationSkeleton;
@@ -68,7 +68,7 @@ export var useOverflowController = function useOverflowController(nodes) {
68
68
 
69
69
  var throttleSetWidth = useCallback(throttle(setWidth, THROTTLE_INTERVAL), [setWidth]);
70
70
  useEffect(function () {
71
- var lastItemWidth = itemsWidths[itemsLimit];
71
+ var lastItemWidth = itemsWidths[itemsLimit] || 0;
72
72
  var wasJustLimited = lastItemWidth < 0;
73
73
  var currentHash = calculateHash(width, itemsLimit);
74
74
 
@@ -109,7 +109,7 @@ export var useOverflowController = function useOverflowController(nodes) {
109
109
  return;
110
110
  }
111
111
 
112
- if (width - itemsWidths[itemsLimit] > ITEM_APPROX_MINWIDTH * 1.1 && itemsLimit < items.length) {
112
+ if (width - lastItemWidth > ITEM_APPROX_MINWIDTH * 1.1 && itemsLimit < items.length) {
113
113
  // If we have enough room to accomodate next item width we increase the limit
114
114
  // unless it has been recently removed
115
115
  var _nextHash = calculateHash(width, itemsLimit + 1);
@@ -91,7 +91,8 @@ export var generateTheme = function generateTheme(themeColors) {
91
91
  borderColor: hexToRGBA(color, 0.5)
92
92
  },
93
93
  focus: {
94
- borderColor: hexToRGBA(highlightColor, 0.8)
94
+ borderColor: hexToRGBA(highlightColor, 0.8),
95
+ boxShadow: getBoxShadow(hexToRGBA(highlightColor, 0.5))
95
96
  },
96
97
  hover: {
97
98
  backgroundColor: getContrastColor(0.1, generateOpacityValue(color), backgroundColor),
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/atlassian-navigation",
3
- "version": "2.1.4",
3
+ "version": "2.2.0",
4
4
  "sideEffects": false
5
5
  }