@atlaskit/atlassian-navigation 4.9.5 → 4.10.1

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 (56) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/components/AppSwitcher/index.js +77 -23
  3. package/dist/cjs/components/AtlassianNavigation/index.js +5 -4
  4. package/dist/cjs/components/Create/index.js +1 -1
  5. package/dist/cjs/components/Help/index.js +35 -3
  6. package/dist/cjs/components/IconButton/index.js +37 -8
  7. package/dist/cjs/components/Notifications/index.js +37 -5
  8. package/dist/cjs/components/PrimaryButton/index.js +20 -12
  9. package/dist/cjs/components/PrimaryDropdownButton/index.js +26 -5
  10. package/dist/cjs/components/ProductHome/custom-product-home.js +13 -13
  11. package/dist/cjs/components/ProductHome/product-home.js +13 -14
  12. package/dist/cjs/components/ProductHome/skeleton.js +7 -7
  13. package/dist/cjs/components/Profile/index.js +44 -9
  14. package/dist/cjs/components/Search/index.js +39 -11
  15. package/dist/cjs/components/Settings/index.js +34 -4
  16. package/dist/cjs/components/SignIn/index.js +35 -4
  17. package/dist/cjs/components/SkeletonPrimaryButton/index.js +1 -2
  18. package/dist/es2019/components/AppSwitcher/index.js +73 -19
  19. package/dist/es2019/components/AtlassianNavigation/index.js +4 -4
  20. package/dist/es2019/components/Create/index.js +1 -1
  21. package/dist/es2019/components/Help/index.js +34 -2
  22. package/dist/es2019/components/IconButton/index.js +36 -7
  23. package/dist/es2019/components/Notifications/index.js +36 -4
  24. package/dist/es2019/components/PrimaryButton/index.js +20 -11
  25. package/dist/es2019/components/PrimaryDropdownButton/index.js +26 -3
  26. package/dist/es2019/components/ProductHome/custom-product-home.js +5 -3
  27. package/dist/es2019/components/ProductHome/product-home.js +5 -4
  28. package/dist/es2019/components/Profile/index.js +41 -8
  29. package/dist/es2019/components/Search/index.js +36 -7
  30. package/dist/es2019/components/Settings/index.js +32 -2
  31. package/dist/es2019/components/SignIn/index.js +33 -2
  32. package/dist/esm/components/AppSwitcher/index.js +77 -23
  33. package/dist/esm/components/AtlassianNavigation/index.js +5 -4
  34. package/dist/esm/components/Create/index.js +1 -1
  35. package/dist/esm/components/Help/index.js +35 -3
  36. package/dist/esm/components/IconButton/index.js +37 -8
  37. package/dist/esm/components/Notifications/index.js +37 -5
  38. package/dist/esm/components/PrimaryButton/index.js +20 -12
  39. package/dist/esm/components/PrimaryDropdownButton/index.js +26 -3
  40. package/dist/esm/components/ProductHome/custom-product-home.js +13 -13
  41. package/dist/esm/components/ProductHome/product-home.js +13 -14
  42. package/dist/esm/components/ProductHome/skeleton.js +5 -7
  43. package/dist/esm/components/Profile/index.js +44 -9
  44. package/dist/esm/components/Search/index.js +39 -11
  45. package/dist/esm/components/Settings/index.js +34 -4
  46. package/dist/esm/components/SignIn/index.js +35 -4
  47. package/dist/esm/components/SkeletonPrimaryButton/index.js +1 -2
  48. package/dist/types/components/AppSwitcher/index.d.ts +0 -9
  49. package/dist/types/components/AtlassianNavigation/types.d.ts +4 -0
  50. package/dist/types/components/ProductHome/product-home.d.ts +1 -1
  51. package/dist/types/controllers/overflow/index.d.ts +1 -1
  52. package/dist/types-ts4.5/components/AppSwitcher/index.d.ts +0 -9
  53. package/dist/types-ts4.5/components/AtlassianNavigation/types.d.ts +4 -0
  54. package/dist/types-ts4.5/components/ProductHome/product-home.d.ts +1 -1
  55. package/dist/types-ts4.5/controllers/overflow/index.d.ts +1 -1
  56. package/package.json +2 -5
@@ -1,7 +1,7 @@
1
1
  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
- var _excluded = ["placeholder", "tooltip", "label", "value"];
4
+ var _excluded = ["component", "href", "id", "isDisabled", "isSelected", "label", "onBlur", "onClick", "onFocus", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseUp", "placeholder", "target", "testId", "tooltip", "value"];
5
5
  /**
6
6
  * @jsxRuntime classic
7
7
  * @jsx jsx
@@ -71,7 +71,6 @@ var searchIconStyles = css(_defineProperty({}, "@media (min-width: ".concat(CREA
71
71
  display: 'none !important'
72
72
  }));
73
73
  var SearchComponent = function SearchComponent(props) {
74
- var _stripEmptyProperties;
75
74
  var onClick = props.onClick,
76
75
  placeholder = props.placeholder,
77
76
  label = props.label,
@@ -86,7 +85,7 @@ var SearchComponent = function SearchComponent(props) {
86
85
  // @ts-expect-error
87
86
  onClick && onClick.apply(void 0, arguments);
88
87
  };
89
- var searchInputDynamicStyles = stripEmptyProperties((_stripEmptyProperties = {}, _defineProperty(_stripEmptyProperties, varSearchBackgroundColor, search.default.backgroundColor), _defineProperty(_stripEmptyProperties, varSearchColor, search.default.color), _defineProperty(_stripEmptyProperties, varSearchBorderColor, search.default.borderColor), _defineProperty(_stripEmptyProperties, varSearchFocusBorderColor, search.focus.borderColor), _defineProperty(_stripEmptyProperties, varSearchHoverBackgroundColor, search.hover.backgroundColor), _stripEmptyProperties));
88
+ var searchInputDynamicStyles = stripEmptyProperties(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, varSearchBackgroundColor, search.default.backgroundColor), varSearchColor, search.default.color), varSearchBorderColor, search.default.borderColor), varSearchFocusBorderColor, search.focus.borderColor), varSearchHoverBackgroundColor, search.hover.backgroundColor));
90
89
  return jsx("div", {
91
90
  css: searchInputContainerStyles,
92
91
  role: "search"
@@ -117,27 +116,56 @@ var SearchComponent = function SearchComponent(props) {
117
116
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
118
117
  */
119
118
  export var Search = function Search(props) {
120
- var placeholder = props.placeholder,
121
- tooltip = props.tooltip,
119
+ var component = props.component,
120
+ href = props.href,
121
+ id = props.id,
122
+ isDisabled = props.isDisabled,
123
+ isSelected = props.isSelected,
122
124
  label = props.label,
125
+ onBlur = props.onBlur,
126
+ onClick = props.onClick,
127
+ onFocus = props.onFocus,
128
+ onMouseDown = props.onMouseDown,
129
+ onMouseEnter = props.onMouseEnter,
130
+ onMouseLeave = props.onMouseLeave,
131
+ onMouseUp = props.onMouseUp,
132
+ placeholder = props.placeholder,
133
+ target = props.target,
134
+ testId = props.testId,
135
+ tooltip = props.tooltip,
123
136
  value = props.value,
124
- iconButtonProps = _objectWithoutProperties(props, _excluded);
137
+ rest = _objectWithoutProperties(props, _excluded);
125
138
  return jsx(Fragment, null, jsx(SearchComponent, {
126
- onClick: iconButtonProps.onClick,
139
+ onClick: onClick,
127
140
  placeholder: placeholder,
128
141
  label: label,
129
142
  value: value || ''
130
- }), jsx(IconButton
131
- // @ts-ignore Overriding styles is not supported.
132
- , _extends({
143
+ }), jsx(IconButton, _extends({
144
+ component: component
145
+ // @ts-ignore Overriding styles is not supported.
146
+ ,
133
147
  css: searchIconStyles,
148
+ href: href,
134
149
  icon: jsx(SearchIcon, {
135
150
  color: "currentColor",
136
151
  spacing: "spacious",
137
152
  label: label
138
153
  }),
154
+ id: id,
155
+ isDisabled: isDisabled,
156
+ isSelected: isSelected,
157
+ onBlur: onBlur,
158
+ onClick: onClick,
159
+ onFocus: onFocus,
160
+ onMouseDown: onMouseDown,
161
+ onMouseEnter: onMouseEnter,
162
+ onMouseLeave: onMouseLeave,
163
+ onMouseUp: onMouseUp,
164
+ target: target,
165
+ testId: testId,
139
166
  tooltip: tooltip
167
+ // Made all explicit, this is left just in case
140
168
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
141
- }, iconButtonProps)));
169
+ }, rest)));
142
170
  };
143
171
  export default Search;
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["tooltip"];
3
+ var _excluded = ["component", "href", "id", "isDisabled", "isSelected", "label", "onBlur", "onClick", "onFocus", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseUp", "target", "testId", "tooltip"];
4
4
  import React, { forwardRef } from 'react';
5
5
  import SettingsIcon from '@atlaskit/icon/core/migration/settings';
6
6
  import { IconButton } from '../IconButton';
@@ -13,18 +13,48 @@ import { IconButton } from '../IconButton';
13
13
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
14
14
  */
15
15
  export var Settings = /*#__PURE__*/forwardRef(function (props, ref) {
16
- var tooltip = props.tooltip,
17
- iconButtonProps = _objectWithoutProperties(props, _excluded);
16
+ var component = props.component,
17
+ href = props.href,
18
+ id = props.id,
19
+ isDisabled = props.isDisabled,
20
+ isSelected = props.isSelected,
21
+ label = props.label,
22
+ onBlur = props.onBlur,
23
+ onClick = props.onClick,
24
+ onFocus = props.onFocus,
25
+ onMouseDown = props.onMouseDown,
26
+ onMouseEnter = props.onMouseEnter,
27
+ onMouseLeave = props.onMouseLeave,
28
+ onMouseUp = props.onMouseUp,
29
+ target = props.target,
30
+ testId = props.testId,
31
+ tooltip = props.tooltip,
32
+ rest = _objectWithoutProperties(props, _excluded);
18
33
  return /*#__PURE__*/React.createElement("div", {
19
34
  role: "listitem"
20
35
  }, /*#__PURE__*/React.createElement(IconButton, _extends({
36
+ component: component,
37
+ href: href,
21
38
  icon: /*#__PURE__*/React.createElement(SettingsIcon, {
22
39
  color: "currentColor",
23
40
  spacing: "spacious",
24
41
  label: typeof tooltip === 'string' ? tooltip : 'Settings Icon'
25
42
  }),
43
+ id: id,
44
+ isDisabled: isDisabled,
45
+ isSelected: isSelected,
46
+ label: label,
47
+ onBlur: onBlur,
48
+ onClick: onClick,
49
+ onFocus: onFocus,
50
+ onMouseDown: onMouseDown,
51
+ onMouseEnter: onMouseEnter,
52
+ onMouseLeave: onMouseLeave,
53
+ onMouseUp: onMouseUp,
26
54
  ref: ref,
55
+ target: target,
56
+ testId: testId,
27
57
  tooltip: tooltip
28
- }, iconButtonProps)));
58
+ }, rest)));
29
59
  });
30
60
  export default Settings;
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["tooltip"];
3
+ var _excluded = ["component", "href", "id", "isDisabled", "isSelected", "label", "onBlur", "onClick", "onFocus", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseUp", "target", "testId", "tooltip"];
4
4
  import React from 'react';
5
5
  import LogInIcon from '@atlaskit/icon/core/migration/log-in--sign-in';
6
6
  import { IconButton } from '../IconButton';
@@ -13,18 +13,49 @@ import { IconButton } from '../IconButton';
13
13
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
14
14
  */
15
15
  export var SignIn = function SignIn(props) {
16
- var tooltip = props.tooltip,
17
- iconButtonProps = _objectWithoutProperties(props, _excluded);
16
+ var component = props.component,
17
+ href = props.href,
18
+ id = props.id,
19
+ isDisabled = props.isDisabled,
20
+ isSelected = props.isSelected,
21
+ label = props.label,
22
+ onBlur = props.onBlur,
23
+ onClick = props.onClick,
24
+ onFocus = props.onFocus,
25
+ onMouseDown = props.onMouseDown,
26
+ onMouseEnter = props.onMouseEnter,
27
+ onMouseLeave = props.onMouseLeave,
28
+ onMouseUp = props.onMouseUp,
29
+ target = props.target,
30
+ testId = props.testId,
31
+ tooltip = props.tooltip,
32
+ rest = _objectWithoutProperties(props, _excluded);
18
33
  return /*#__PURE__*/React.createElement("div", {
19
34
  role: "listitem"
20
35
  }, /*#__PURE__*/React.createElement(IconButton, _extends({
36
+ component: component,
37
+ href: href,
21
38
  icon: /*#__PURE__*/React.createElement(LogInIcon, {
22
39
  color: "currentColor",
23
40
  spacing: "spacious",
24
41
  label: typeof tooltip === 'string' ? tooltip : 'Sign-in Icon'
25
42
  }),
43
+ id: id,
44
+ isDisabled: isDisabled,
45
+ isSelected: isSelected,
46
+ label: label,
47
+ onBlur: onBlur,
48
+ onClick: onClick,
49
+ onFocus: onFocus,
50
+ onMouseDown: onMouseDown,
51
+ onMouseEnter: onMouseEnter,
52
+ onMouseLeave: onMouseLeave,
53
+ onMouseUp: onMouseUp,
54
+ target: target,
55
+ testId: testId,
26
56
  tooltip: tooltip
57
+ // These are all explicit, leaving it in just in case
27
58
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
28
- }, iconButtonProps)));
59
+ }, rest)));
29
60
  };
30
61
  export default SignIn;
@@ -94,7 +94,6 @@ var buttonWrapperStyles = css({
94
94
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
95
95
  */
96
96
  export var SkeletonPrimaryButton = function SkeletonPrimaryButton(_ref) {
97
- var _objectSpread2;
98
97
  var _ref$isDropdownButton = _ref.isDropdownButton,
99
98
  isDropdownButton = _ref$isDropdownButton === void 0 ? false : _ref$isDropdownButton,
100
99
  _ref$isHighlighted = _ref.isHighlighted,
@@ -106,7 +105,7 @@ export var SkeletonPrimaryButton = function SkeletonPrimaryButton(_ref) {
106
105
  var primaryButton = theme.mode.primaryButton;
107
106
  var dynamicStyles = stripEmptyProperties(_objectSpread(_objectSpread(_objectSpread({}, primaryButton.default), isHighlighted && {
108
107
  color: primaryButton.selected.color
109
- }), {}, (_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)));
108
+ }), {}, _defineProperty(_defineProperty({}, VAR_PRIMARY_BUTTON_BEFORE_HIGHLIGHTED_BACKGROUND_COLOR, primaryButton.selected.borderColor), VAR_PRIMARY_BUTTON_AFTER_DROPDOWN_BORDER_COLOR, isHighlighted ? primaryButton.default.borderColor : primaryButton.default.color)));
110
109
  return jsx("div", {
111
110
  role: "listitem",
112
111
  css: buttonWrapperStyles
@@ -10,15 +10,6 @@ import { type AppSwitcherProps } from './types';
10
10
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
11
11
  */
12
12
  export declare const AppSwitcher: React.ForwardRefExoticComponent<import("../IconButton/types").BaseIconButtonProps & React.RefAttributes<any>>;
13
- /**
14
- * __App switcher nav 4__
15
- *
16
- * An app switcher nav 4 {description}.
17
- *
18
- * - [Examples](https://atlassian.design/components/{packageName}/examples)
19
- * - [Code](https://atlassian.design/components/{packageName}/code)
20
- * - [Usage](https://atlassian.design/components/{packageName}/usage)
21
- */
22
13
  export declare const AppSwitcherNav4: React.ForwardRefExoticComponent<import("../IconButton/types").BaseIconButtonProps & React.RefAttributes<any>>;
23
14
  declare const _default: (props: AppSwitcherProps) => void;
24
15
  export default _default;
@@ -72,6 +72,10 @@ export interface AtlassianNavigationProps {
72
72
  * Whether nav is rendered on the server.
73
73
  */
74
74
  isServer?: boolean;
75
+ /**
76
+ * Whether to enable SSR placeholder replacement.
77
+ */
78
+ isSSRPlaceholderEnabled?: boolean;
75
79
  }
76
80
  export interface NavigationSkeletonProps {
77
81
  /**
@@ -11,5 +11,5 @@ import { type ProductHomeProps } from './types';
11
11
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#product-home)
12
12
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
13
13
  */
14
- declare const ProductHome: ({ icon: Icon, logo: Logo, siteTitle, onClick, href, onMouseDown, testId, logoMaxWidth, "aria-label": ariaLabel, ...rest }: ProductHomeProps) => jsx.JSX.Element;
14
+ declare const ProductHome: ({ "aria-label": ariaLabel, href, icon: Icon, logo: Logo, logoMaxWidth, onClick, onMouseDown, siteTitle, testId, ...rest }: ProductHomeProps) => jsx.JSX.Element;
15
15
  export default ProductHome;
@@ -37,7 +37,7 @@ export declare const useOverflowStatus: () => {
37
37
  export declare const useOverflowController: (nodes: ReactNode | ReactNode[]) => {
38
38
  visibleItems: (React.ReactChild | React.ReactFragment | React.ReactPortal)[];
39
39
  overflowItems: (React.ReactChild | React.ReactFragment | React.ReactPortal)[];
40
- updateWidth: import("lodash").DebouncedFunc<React.Dispatch<React.SetStateAction<number>>>;
40
+ updateWidth: import("lodash").DebouncedFuncLeading<React.Dispatch<React.SetStateAction<number>>>;
41
41
  };
42
42
  declare const _default: (props: OverflowContext) => void;
43
43
  export default _default;
@@ -10,15 +10,6 @@ import { type AppSwitcherProps } from './types';
10
10
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
11
11
  */
12
12
  export declare const AppSwitcher: React.ForwardRefExoticComponent<import("../IconButton/types").BaseIconButtonProps & React.RefAttributes<any>>;
13
- /**
14
- * __App switcher nav 4__
15
- *
16
- * An app switcher nav 4 {description}.
17
- *
18
- * - [Examples](https://atlassian.design/components/{packageName}/examples)
19
- * - [Code](https://atlassian.design/components/{packageName}/code)
20
- * - [Usage](https://atlassian.design/components/{packageName}/usage)
21
- */
22
13
  export declare const AppSwitcherNav4: React.ForwardRefExoticComponent<import("../IconButton/types").BaseIconButtonProps & React.RefAttributes<any>>;
23
14
  declare const _default: (props: AppSwitcherProps) => void;
24
15
  export default _default;
@@ -72,6 +72,10 @@ export interface AtlassianNavigationProps {
72
72
  * Whether nav is rendered on the server.
73
73
  */
74
74
  isServer?: boolean;
75
+ /**
76
+ * Whether to enable SSR placeholder replacement.
77
+ */
78
+ isSSRPlaceholderEnabled?: boolean;
75
79
  }
76
80
  export interface NavigationSkeletonProps {
77
81
  /**
@@ -11,5 +11,5 @@ import { type ProductHomeProps } from './types';
11
11
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#product-home)
12
12
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
13
13
  */
14
- declare const ProductHome: ({ icon: Icon, logo: Logo, siteTitle, onClick, href, onMouseDown, testId, logoMaxWidth, "aria-label": ariaLabel, ...rest }: ProductHomeProps) => jsx.JSX.Element;
14
+ declare const ProductHome: ({ "aria-label": ariaLabel, href, icon: Icon, logo: Logo, logoMaxWidth, onClick, onMouseDown, siteTitle, testId, ...rest }: ProductHomeProps) => jsx.JSX.Element;
15
15
  export default ProductHome;
@@ -37,7 +37,7 @@ export declare const useOverflowStatus: () => {
37
37
  export declare const useOverflowController: (nodes: ReactNode | ReactNode[]) => {
38
38
  visibleItems: (React.ReactChild | React.ReactFragment | React.ReactPortal)[];
39
39
  overflowItems: (React.ReactChild | React.ReactFragment | React.ReactPortal)[];
40
- updateWidth: import("lodash").DebouncedFunc<React.Dispatch<React.SetStateAction<number>>>;
40
+ updateWidth: import("lodash").DebouncedFuncLeading<React.Dispatch<React.SetStateAction<number>>>;
41
41
  };
42
42
  declare const _default: (props: OverflowContext) => void;
43
43
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/atlassian-navigation",
3
- "version": "4.9.5",
3
+ "version": "4.10.1",
4
4
  "description": "A horizontal navigation component for Atlassian products.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -54,7 +54,7 @@
54
54
  "@atlaskit/popup": "^1.30.0",
55
55
  "@atlaskit/primitives": "^13.3.0",
56
56
  "@atlaskit/theme": "^14.0.0",
57
- "@atlaskit/tokens": "^2.4.0",
57
+ "@atlaskit/tokens": "^2.5.0",
58
58
  "@atlaskit/tooltip": "^19.0.0",
59
59
  "@atlaskit/width-detector": "^4.3.0",
60
60
  "@babel/runtime": "^7.0.0",
@@ -107,9 +107,6 @@
107
107
  "platform-feature-flags": {
108
108
  "platform-component-visual-refresh": {
109
109
  "type": "boolean"
110
- },
111
- "add_ssr_placeholder_replacements_to_nin_and_nav": {
112
- "type": "boolean"
113
110
  }
114
111
  }
115
112
  }