@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.
- package/CHANGELOG.md +20 -0
- package/dist/cjs/components/AppSwitcher/index.js +10 -0
- package/dist/cjs/components/AtlassianNavigation/index.js +10 -1
- package/dist/cjs/components/AtlassianNavigation/skeleton.js +13 -0
- package/dist/cjs/components/BadgeContainer/index.js +2 -1
- package/dist/cjs/components/Create/index.js +14 -2
- package/dist/cjs/components/Create/skeleton.js +2 -1
- package/dist/cjs/components/Help/index.js +9 -0
- package/dist/cjs/components/IconButton/index.js +11 -1
- package/dist/cjs/components/IconButton/skeleton.js +2 -1
- package/dist/cjs/components/Notifications/index.js +10 -0
- package/dist/cjs/components/PrimaryButton/index.js +12 -1
- package/dist/cjs/components/PrimaryButton/skeleton.js +6 -8
- package/dist/cjs/components/PrimaryDropdownButton/index.js +10 -0
- package/dist/cjs/components/PrimaryItemsContainer/index.js +2 -1
- package/dist/cjs/components/PrimaryItemsContainer/skeleton.js +2 -1
- package/dist/cjs/components/ProductHome/custom-product-home.js +10 -1
- package/dist/cjs/components/ProductHome/product-home.js +17 -2
- package/dist/cjs/components/ProductHome/skeleton.js +2 -1
- package/dist/cjs/components/Profile/index.js +10 -0
- package/dist/cjs/components/Profile/skeleton.js +2 -0
- package/dist/cjs/components/Search/index.js +11 -1
- package/dist/cjs/components/Search/skeleton.js +2 -1
- package/dist/cjs/components/Settings/index.js +8 -0
- package/dist/cjs/components/SignIn/index.js +10 -1
- package/dist/cjs/components/SignIn/skeleton.js +2 -0
- package/dist/cjs/components/SkeletonCreateButton/index.js +12 -1
- package/dist/cjs/components/SkeletonIconButton/index.js +12 -1
- package/dist/cjs/components/SkeletonPrimaryButton/index.js +11 -0
- package/dist/cjs/controllers/overflow/index.js +14 -5
- package/dist/cjs/skeleton-help-button.js +10 -0
- package/dist/cjs/skeleton-notification-button.js +10 -0
- package/dist/cjs/skeleton-settings-button.js +10 -0
- package/dist/cjs/skeleton-switcher-button.js +10 -0
- package/dist/cjs/theme/{defaultTheme.js → default-theme.js} +1 -1
- package/dist/cjs/theme/index.js +5 -5
- package/dist/cjs/theme/{themeGenerator.js → theme-generator.js} +4 -3
- package/dist/cjs/theme/{themeHelpers.js → theme-helpers.js} +0 -0
- package/dist/cjs/theme/{ThemeProvider.js → theme-provider.js} +8 -0
- package/dist/cjs/theme/themes.js +2 -2
- package/dist/cjs/theme/{useTheme.js → use-theme.js} +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/AppSwitcher/index.js +11 -0
- package/dist/es2019/components/AtlassianNavigation/index.js +11 -1
- package/dist/es2019/components/AtlassianNavigation/skeleton.js +14 -0
- package/dist/es2019/components/BadgeContainer/index.js +3 -1
- package/dist/es2019/components/Create/index.js +14 -2
- package/dist/es2019/components/Create/skeleton.js +3 -1
- package/dist/es2019/components/Help/index.js +9 -0
- package/dist/es2019/components/IconButton/index.js +12 -1
- package/dist/es2019/components/IconButton/skeleton.js +3 -1
- package/dist/es2019/components/Notifications/index.js +10 -0
- package/dist/es2019/components/PrimaryButton/index.js +12 -1
- package/dist/es2019/components/PrimaryButton/skeleton.js +7 -6
- package/dist/es2019/components/PrimaryDropdownButton/index.js +10 -0
- package/dist/es2019/components/PrimaryItemsContainer/index.js +3 -1
- package/dist/es2019/components/PrimaryItemsContainer/skeleton.js +3 -1
- package/dist/es2019/components/ProductHome/custom-product-home.js +10 -1
- package/dist/es2019/components/ProductHome/product-home.js +17 -2
- package/dist/es2019/components/ProductHome/skeleton.js +3 -1
- package/dist/es2019/components/Profile/index.js +11 -0
- package/dist/es2019/components/Profile/skeleton.js +3 -1
- package/dist/es2019/components/Search/index.js +11 -1
- package/dist/es2019/components/Search/skeleton.js +3 -1
- package/dist/es2019/components/Settings/index.js +9 -0
- package/dist/es2019/components/SignIn/index.js +11 -1
- package/dist/es2019/components/SignIn/skeleton.js +3 -1
- package/dist/es2019/components/SkeletonCreateButton/index.js +13 -1
- package/dist/es2019/components/SkeletonIconButton/index.js +13 -1
- package/dist/es2019/components/SkeletonPrimaryButton/index.js +12 -0
- package/dist/es2019/controllers/overflow/index.js +12 -3
- package/dist/es2019/skeleton-help-button.js +11 -0
- package/dist/es2019/skeleton-notification-button.js +11 -0
- package/dist/es2019/skeleton-settings-button.js +11 -0
- package/dist/es2019/skeleton-switcher-button.js +11 -0
- package/dist/es2019/theme/{defaultTheme.js → default-theme.js} +1 -1
- package/dist/es2019/theme/index.js +4 -4
- package/dist/es2019/theme/{themeGenerator.js → theme-generator.js} +4 -3
- package/dist/es2019/theme/{themeHelpers.js → theme-helpers.js} +0 -0
- package/dist/es2019/theme/theme-provider.js +12 -0
- package/dist/es2019/theme/themes.js +2 -2
- package/dist/es2019/theme/use-theme.js +3 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/AppSwitcher/index.js +11 -0
- package/dist/esm/components/AtlassianNavigation/index.js +11 -1
- package/dist/esm/components/AtlassianNavigation/skeleton.js +14 -0
- package/dist/esm/components/BadgeContainer/index.js +3 -1
- package/dist/esm/components/Create/index.js +14 -2
- package/dist/esm/components/Create/skeleton.js +3 -1
- package/dist/esm/components/Help/index.js +9 -0
- package/dist/esm/components/IconButton/index.js +12 -1
- package/dist/esm/components/IconButton/skeleton.js +3 -1
- package/dist/esm/components/Notifications/index.js +10 -0
- package/dist/esm/components/PrimaryButton/index.js +12 -1
- package/dist/esm/components/PrimaryButton/skeleton.js +7 -6
- package/dist/esm/components/PrimaryDropdownButton/index.js +10 -0
- package/dist/esm/components/PrimaryItemsContainer/index.js +3 -1
- package/dist/esm/components/PrimaryItemsContainer/skeleton.js +3 -1
- package/dist/esm/components/ProductHome/custom-product-home.js +10 -1
- package/dist/esm/components/ProductHome/product-home.js +17 -2
- package/dist/esm/components/ProductHome/skeleton.js +3 -1
- package/dist/esm/components/Profile/index.js +11 -0
- package/dist/esm/components/Profile/skeleton.js +3 -1
- package/dist/esm/components/Search/index.js +11 -1
- package/dist/esm/components/Search/skeleton.js +3 -1
- package/dist/esm/components/Settings/index.js +9 -0
- package/dist/esm/components/SignIn/index.js +11 -1
- package/dist/esm/components/SignIn/skeleton.js +3 -1
- package/dist/esm/components/SkeletonCreateButton/index.js +13 -1
- package/dist/esm/components/SkeletonIconButton/index.js +13 -1
- package/dist/esm/components/SkeletonPrimaryButton/index.js +12 -0
- package/dist/esm/controllers/overflow/index.js +12 -3
- package/dist/esm/skeleton-help-button.js +11 -0
- package/dist/esm/skeleton-notification-button.js +11 -0
- package/dist/esm/skeleton-settings-button.js +11 -0
- package/dist/esm/skeleton-switcher-button.js +11 -0
- package/dist/esm/theme/{defaultTheme.js → default-theme.js} +1 -1
- package/dist/esm/theme/index.js +4 -4
- package/dist/esm/theme/{themeGenerator.js → theme-generator.js} +4 -3
- package/dist/esm/theme/{themeHelpers.js → theme-helpers.js} +0 -0
- package/dist/esm/theme/theme-provider.js +12 -0
- package/dist/esm/theme/themes.js +2 -2
- package/dist/esm/theme/{useTheme.js → use-theme.js} +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/components/AppSwitcher/index.d.ts +9 -0
- package/dist/types/components/AtlassianNavigation/index.d.ts +8 -0
- package/dist/types/components/AtlassianNavigation/skeleton.d.ts +13 -0
- package/dist/types/components/Create/index.d.ts +9 -0
- package/dist/types/components/Create/types.d.ts +2 -2
- package/dist/types/components/Help/index.d.ts +8 -0
- package/dist/types/components/IconButton/index.d.ts +9 -0
- package/dist/types/components/IconButton/types.d.ts +14 -14
- package/dist/types/components/Notifications/index.d.ts +9 -0
- package/dist/types/components/PrimaryButton/index.d.ts +9 -0
- package/dist/types/components/PrimaryButton/types.d.ts +14 -14
- package/dist/types/components/PrimaryDropdownButton/index.d.ts +9 -0
- package/dist/types/components/ProductHome/custom-product-home.d.ts +8 -0
- package/dist/types/components/ProductHome/product-home.d.ts +11 -0
- package/dist/types/components/Profile/index.d.ts +9 -0
- package/dist/types/components/Search/index.d.ts +8 -0
- package/dist/types/components/Settings/index.d.ts +8 -0
- package/dist/types/components/SignIn/index.d.ts +8 -0
- package/dist/types/components/SkeletonCreateButton/index.d.ts +10 -0
- package/dist/types/components/SkeletonIconButton/index.d.ts +10 -0
- package/dist/types/components/SkeletonPrimaryButton/index.d.ts +10 -0
- package/dist/types/controllers/overflow/index.d.ts +17 -4
- package/dist/types/skeleton-help-button.d.ts +10 -0
- package/dist/types/skeleton-notification-button.d.ts +10 -0
- package/dist/types/skeleton-settings-button.d.ts +10 -0
- package/dist/types/skeleton-switcher-button.d.ts +10 -0
- package/dist/types/theme/{defaultTheme.d.ts → default-theme.d.ts} +0 -0
- package/dist/types/theme/index.d.ts +4 -4
- package/dist/types/theme/{themeGenerator.d.ts → theme-generator.d.ts} +0 -0
- package/dist/types/theme/{themeHelpers.d.ts → theme-helpers.d.ts} +0 -0
- package/dist/types/theme/{ThemeProvider.d.ts → theme-provider.d.ts} +5 -0
- package/dist/types/theme/{useTheme.d.ts → use-theme.d.ts} +0 -0
- package/docs/01-intro.tsx +2 -2
- package/docs/02-atlassian-navigation.tsx +2 -2
- package/docs/03-product-home.tsx +4 -4
- package/docs/04-app-switcher.tsx +2 -2
- package/docs/05-create.tsx +4 -4
- package/docs/06-primary-actions.tsx +4 -4
- package/docs/07-secondary-actions.tsx +2 -2
- package/docs/97-theming.tsx +1 -1
- package/package.json +9 -5
- package/report.api.md +637 -0
- package/dist/es2019/theme/ThemeProvider.js +0 -4
- package/dist/es2019/theme/useTheme.js +0 -3
- package/dist/esm/theme/ThemeProvider.js +0 -4
|
@@ -15,6 +15,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
15
15
|
|
|
16
16
|
var _throttle = _interopRequireDefault(require("lodash/throttle"));
|
|
17
17
|
|
|
18
|
+
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
19
|
+
|
|
18
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
21
|
|
|
20
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -33,13 +35,11 @@ var updateHashRef = function updateHashRef(currentRef, value) {
|
|
|
33
35
|
currentRef.length = 3;
|
|
34
36
|
};
|
|
35
37
|
|
|
36
|
-
var noop = function noop() {};
|
|
37
|
-
|
|
38
38
|
var OverflowContext = /*#__PURE__*/(0, _react.createContext)({
|
|
39
39
|
isVisible: true,
|
|
40
|
-
openOverflowMenu:
|
|
41
|
-
closeOverflowMenu:
|
|
42
|
-
});
|
|
40
|
+
openOverflowMenu: _noop.default,
|
|
41
|
+
closeOverflowMenu: _noop.default
|
|
42
|
+
}); // eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
43
43
|
|
|
44
44
|
var OverflowProvider = function OverflowProvider(_ref) {
|
|
45
45
|
var children = _ref.children,
|
|
@@ -58,6 +58,14 @@ var OverflowProvider = function OverflowProvider(_ref) {
|
|
|
58
58
|
value: value
|
|
59
59
|
}, children);
|
|
60
60
|
};
|
|
61
|
+
/**
|
|
62
|
+
* __useOverFlowStatus__
|
|
63
|
+
*
|
|
64
|
+
* Returns the current context value for the nearest OverflowProvider.
|
|
65
|
+
*
|
|
66
|
+
* - [Example](https://atlassian.design/components/atlassian-navigation/examples#responsive)
|
|
67
|
+
*/
|
|
68
|
+
|
|
61
69
|
|
|
62
70
|
exports.OverflowProvider = OverflowProvider;
|
|
63
71
|
|
|
@@ -153,6 +161,7 @@ var useOverflowController = function useOverflowController(nodes) {
|
|
|
153
161
|
updateWidth: throttleSetWidth
|
|
154
162
|
};
|
|
155
163
|
}; // Used to extract props for useOverflowStatus();
|
|
164
|
+
// eslint-disable-next-line @repo/internal/react/use-noop
|
|
156
165
|
|
|
157
166
|
|
|
158
167
|
exports.useOverflowController = useOverflowController;
|
|
@@ -15,6 +15,16 @@ var _SkeletonIconButton = require("./components/SkeletonIconButton");
|
|
|
15
15
|
|
|
16
16
|
var _theme = require("./theme");
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* __Skeleton Notification button__
|
|
20
|
+
*
|
|
21
|
+
* Skeleton buttons are lightweight HTML button elements with CSS that represent
|
|
22
|
+
* their heavier interactive counterparts, for use when elements of the
|
|
23
|
+
* navigation are loaded dynamically. This one represents the Help button.
|
|
24
|
+
*
|
|
25
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
|
|
26
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
27
|
+
*/
|
|
18
28
|
var SkeletonHelpButton = function SkeletonHelpButton(_ref) {
|
|
19
29
|
var _ref$label = _ref.label,
|
|
20
30
|
label = _ref$label === void 0 ? '' : _ref$label;
|
|
@@ -13,6 +13,16 @@ var _notification = _interopRequireDefault(require("@atlaskit/icon/glyph/notific
|
|
|
13
13
|
|
|
14
14
|
var _SkeletonIconButton = require("./components/SkeletonIconButton");
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* __Skeleton Notification button__
|
|
18
|
+
*
|
|
19
|
+
* Skeleton buttons are lightweight HTML button elements with CSS that represent
|
|
20
|
+
* their heavier interactive counterparts, for use when elements of the
|
|
21
|
+
* navigation are loaded dynamically. This one represents the Notification button.
|
|
22
|
+
*
|
|
23
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
|
|
24
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
25
|
+
*/
|
|
16
26
|
var SkeletonNotificationButton = function SkeletonNotificationButton(_ref) {
|
|
17
27
|
var _ref$label = _ref.label,
|
|
18
28
|
label = _ref$label === void 0 ? '' : _ref$label;
|
|
@@ -13,6 +13,16 @@ var _settings = _interopRequireDefault(require("@atlaskit/icon/glyph/settings"))
|
|
|
13
13
|
|
|
14
14
|
var _SkeletonIconButton = require("./components/SkeletonIconButton");
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* __Skeleton settings button__
|
|
18
|
+
*
|
|
19
|
+
* Skeleton buttons are lightweight HTML button elements with CSS that represent
|
|
20
|
+
* their heavier interactive counterparts, for use when elements of the
|
|
21
|
+
* navigation are loaded dynamically. This one represents the Settings button.
|
|
22
|
+
*
|
|
23
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
|
|
24
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
25
|
+
*/
|
|
16
26
|
var SkeletonSettingsButton = function SkeletonSettingsButton(_ref) {
|
|
17
27
|
var _ref$label = _ref.label,
|
|
18
28
|
label = _ref$label === void 0 ? '' : _ref$label;
|
|
@@ -13,6 +13,16 @@ var _appSwitcher = _interopRequireDefault(require("@atlaskit/icon/glyph/app-swit
|
|
|
13
13
|
|
|
14
14
|
var _SkeletonIconButton = require("./components/SkeletonIconButton");
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* __Skeleton switcher button__
|
|
18
|
+
*
|
|
19
|
+
* Skeleton buttons are lightweight HTML button elements with CSS that represent
|
|
20
|
+
* their heavier interactive counterparts, for use when elements of the
|
|
21
|
+
* navigation are loaded dynamically. This one represents the AppSwitcher button.
|
|
22
|
+
*
|
|
23
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
|
|
24
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
25
|
+
*/
|
|
16
26
|
var SkeletonSwitcherButton = function SkeletonSwitcherButton(_ref) {
|
|
17
27
|
var _ref$label = _ref.label,
|
|
18
28
|
label = _ref$label === void 0 ? '' : _ref$label;
|
package/dist/cjs/theme/index.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "ThemeProvider", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _themeProvider.ThemeProvider;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "atlassianTheme", {
|
|
@@ -40,12 +40,12 @@ Object.defineProperty(exports, "useTheme", {
|
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
-
var _themeGenerator = require("./
|
|
43
|
+
var _themeGenerator = require("./theme-generator");
|
|
44
44
|
|
|
45
|
-
var
|
|
45
|
+
var _themeProvider = require("./theme-provider");
|
|
46
46
|
|
|
47
47
|
var _themes = require("./themes");
|
|
48
48
|
|
|
49
|
-
var _useTheme = require("./
|
|
49
|
+
var _useTheme = require("./use-theme");
|
|
50
50
|
|
|
51
|
-
var _themeHelpers = require("./
|
|
51
|
+
var _themeHelpers = require("./theme-helpers");
|
|
@@ -11,9 +11,9 @@ exports.generateTheme = exports.default = void 0;
|
|
|
11
11
|
|
|
12
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
13
|
|
|
14
|
-
var _defaultTheme = _interopRequireWildcard(require("./
|
|
14
|
+
var _defaultTheme = _interopRequireWildcard(require("./default-theme"));
|
|
15
15
|
|
|
16
|
-
var _themeHelpers = require("./
|
|
16
|
+
var _themeHelpers = require("./theme-helpers");
|
|
17
17
|
|
|
18
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
19
|
|
|
@@ -25,7 +25,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
25
25
|
|
|
26
26
|
var generateOpacityValue = function generateOpacityValue(color) {
|
|
27
27
|
return color === '#000000' ? 0.3 : 0.6;
|
|
28
|
-
};
|
|
28
|
+
}; // eslint-disable-next-line @repo/internal/react/consistent-types-definitions
|
|
29
|
+
|
|
29
30
|
|
|
30
31
|
var generateButtonCSSStates = function generateButtonCSSStates(colors, buttonType) {
|
|
31
32
|
var backgroundColor = colors.backgroundColor,
|
|
File without changes
|
|
@@ -9,7 +9,15 @@ var _react = require("react");
|
|
|
9
9
|
|
|
10
10
|
var _themes = require("./themes");
|
|
11
11
|
|
|
12
|
+
// Internal only
|
|
13
|
+
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
12
14
|
var ThemeContext = /*#__PURE__*/(0, _react.createContext)(_themes.defaultTheme);
|
|
15
|
+
/**
|
|
16
|
+
* __Theme provider__
|
|
17
|
+
*
|
|
18
|
+
* A provider for the theme context used by all navigation components.
|
|
19
|
+
*/
|
|
20
|
+
|
|
13
21
|
exports.ThemeContext = ThemeContext;
|
|
14
22
|
var ThemeProvider = ThemeContext.Provider;
|
|
15
23
|
exports.ThemeProvider = ThemeProvider;
|
package/dist/cjs/theme/themes.js
CHANGED
|
@@ -7,9 +7,9 @@ exports.defaultTheme = exports.atlassianTheme = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _colors = require("@atlaskit/theme/colors");
|
|
9
9
|
|
|
10
|
-
var _defaultTheme = require("./
|
|
10
|
+
var _defaultTheme = require("./default-theme");
|
|
11
11
|
|
|
12
|
-
var _themeGenerator = require("./
|
|
12
|
+
var _themeGenerator = require("./theme-generator");
|
|
13
13
|
|
|
14
14
|
var atlassianTheme = (0, _themeGenerator.generateTheme)({
|
|
15
15
|
name: _defaultTheme.DEFAULT_THEME_NAME,
|
|
@@ -7,10 +7,10 @@ exports.useTheme = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _themeProvider = require("./theme-provider");
|
|
11
11
|
|
|
12
12
|
var useTheme = function useTheme() {
|
|
13
|
-
return (0, _react.useContext)(
|
|
13
|
+
return (0, _react.useContext)(_themeProvider.ThemeContext);
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
exports.useTheme = useTheme;
|
package/dist/cjs/version.json
CHANGED
|
@@ -2,6 +2,16 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
3
|
import AppSwitcherIcon from '@atlaskit/icon/glyph/app-switcher';
|
|
4
4
|
import { IconButton } from '../IconButton';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* _App switcher__
|
|
8
|
+
*
|
|
9
|
+
* An AppSwitcher button that can be passed into `AtlassianNavigation`'s
|
|
10
|
+
* `renderAppSwitcher` prop.
|
|
11
|
+
*
|
|
12
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#app-switcher)
|
|
13
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
14
|
+
*/
|
|
5
15
|
export const AppSwitcher = /*#__PURE__*/forwardRef((props, ref) => {
|
|
6
16
|
const {
|
|
7
17
|
tooltip,
|
|
@@ -15,5 +25,6 @@ export const AppSwitcher = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
15
25
|
ref: ref
|
|
16
26
|
}, iconButtonProps));
|
|
17
27
|
}); // exists only to extract props
|
|
28
|
+
// eslint-disable-next-line @repo/internal/react/use-noop
|
|
18
29
|
|
|
19
30
|
export default (props => {});
|
|
@@ -64,6 +64,15 @@ const 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 const AtlassianNavigation = props => {
|
|
68
77
|
const {
|
|
69
78
|
label: label,
|
|
@@ -97,7 +106,8 @@ export const AtlassianNavigation = props => {
|
|
|
97
106
|
testId: testId,
|
|
98
107
|
moreLabel: moreLabel,
|
|
99
108
|
items: primaryItems,
|
|
100
|
-
create: create
|
|
109
|
+
create: create // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
110
|
+
,
|
|
101
111
|
theme: theme
|
|
102
112
|
})), jsx("div", {
|
|
103
113
|
css: rightStyles,
|
|
@@ -61,6 +61,20 @@ const 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 const NavigationSkeleton = ({
|
|
65
79
|
primaryItemsCount = 4,
|
|
66
80
|
secondaryItemsCount = 4,
|
|
@@ -8,7 +8,9 @@ const badgeContainerStyles = css({
|
|
|
8
8
|
});
|
|
9
9
|
const 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 const BadgeContainer = props => {
|
|
13
15
|
const {
|
|
14
16
|
id: badgeId,
|
|
@@ -38,6 +38,16 @@ const TooltipSwitch = ({
|
|
|
38
38
|
content: buttonTooltip,
|
|
39
39
|
hideTooltipOnClick: true
|
|
40
40
|
}, children) : jsx(Fragment, null, children);
|
|
41
|
+
/**
|
|
42
|
+
* _Create__
|
|
43
|
+
*
|
|
44
|
+
* A call to action button that can be passed into `AtlassianNavigation`'s
|
|
45
|
+
* `renderCreate` prop. It is shown after all other primary buttons.
|
|
46
|
+
*
|
|
47
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#create)
|
|
48
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
49
|
+
*/
|
|
50
|
+
|
|
41
51
|
|
|
42
52
|
export const Create = ({
|
|
43
53
|
onClick,
|
|
@@ -56,7 +66,8 @@ export const Create = ({
|
|
|
56
66
|
}, jsx(Button, {
|
|
57
67
|
id: "createGlobalItem",
|
|
58
68
|
onClick: onClick,
|
|
59
|
-
href: href
|
|
69
|
+
href: href // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
70
|
+
,
|
|
60
71
|
theme: getCreateButtonTheme(theme),
|
|
61
72
|
testId: testId && `${testId}-button`,
|
|
62
73
|
"data-hide-on-smallscreens": true
|
|
@@ -68,7 +79,8 @@ export const Create = ({
|
|
|
68
79
|
}),
|
|
69
80
|
onClick: onClick,
|
|
70
81
|
href: href,
|
|
71
|
-
tooltip: iconButtonTooltip
|
|
82
|
+
tooltip: iconButtonTooltip // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
83
|
+
,
|
|
72
84
|
theme: getCreateButtonTheme(theme),
|
|
73
85
|
"aria-label": text,
|
|
74
86
|
"data-hide-on-largescreens": true
|
|
@@ -17,7 +17,9 @@ const mobileStyles = css({
|
|
|
17
17
|
[`@media (max-width: ${CREATE_BREAKPOINT - 1}px)`]: {
|
|
18
18
|
display: 'none !important'
|
|
19
19
|
}
|
|
20
|
-
});
|
|
20
|
+
}); // Not exported to consumers, only used in NavigationSkeleton
|
|
21
|
+
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
22
|
+
|
|
21
23
|
export const CreateSkeleton = () => {
|
|
22
24
|
const theme = useTheme();
|
|
23
25
|
return jsx(Fragment, null, jsx("div", {
|
|
@@ -5,6 +5,15 @@ import { useTheme } from '../../theme';
|
|
|
5
5
|
import { BadgeContainer } from '../BadgeContainer';
|
|
6
6
|
import { IconButton } from '../IconButton';
|
|
7
7
|
const HELP_NOTIFICATION_BADGE_ID = 'atlassian-navigation-help-notification-count';
|
|
8
|
+
/**
|
|
9
|
+
* __Help__
|
|
10
|
+
*
|
|
11
|
+
* A help button that can be passed into `AtlassianNavigation`'s `renderHelp` prop.
|
|
12
|
+
*
|
|
13
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#help)
|
|
14
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
15
|
+
*/
|
|
16
|
+
|
|
8
17
|
export const Help = /*#__PURE__*/forwardRef((props, ref) => {
|
|
9
18
|
const {
|
|
10
19
|
badge,
|
|
@@ -4,6 +4,16 @@ import Button from '@atlaskit/button/custom-theme-button';
|
|
|
4
4
|
import Tooltip from '@atlaskit/tooltip';
|
|
5
5
|
import { useTheme } from '../../theme';
|
|
6
6
|
import { getIconButtonTheme } from './styles';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* __Icon button__
|
|
10
|
+
*
|
|
11
|
+
* An icon button is used to create navigation items such as Help, Settings
|
|
12
|
+
* and Notifications. You can use this component to create your own items to
|
|
13
|
+
* pass into `AtlassianNavigation`'s render props, but where possible you should
|
|
14
|
+
* rely on the defaults.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
7
17
|
export const IconButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
8
18
|
const {
|
|
9
19
|
icon,
|
|
@@ -16,7 +26,8 @@ export const IconButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
16
26
|
appearance: "primary",
|
|
17
27
|
testId: testId,
|
|
18
28
|
iconBefore: icon,
|
|
19
|
-
ref: ref
|
|
29
|
+
ref: ref // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
30
|
+
,
|
|
20
31
|
theme: getIconButtonTheme(theme)
|
|
21
32
|
}, buttonProps));
|
|
22
33
|
|
|
@@ -6,7 +6,9 @@ const buttonHeight = gridSize * 4;
|
|
|
6
6
|
const skeletonStyles = css({
|
|
7
7
|
borderRadius: '50%',
|
|
8
8
|
opacity: 0.15
|
|
9
|
-
});
|
|
9
|
+
}); // Not exported to consumers, only used in NavigationSkeleton
|
|
10
|
+
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
11
|
+
|
|
10
12
|
export const IconButtonSkeleton = ({
|
|
11
13
|
className,
|
|
12
14
|
marginLeft,
|
|
@@ -4,6 +4,16 @@ import NotificationIcon from '@atlaskit/icon/glyph/notification';
|
|
|
4
4
|
import { BadgeContainer } from '../BadgeContainer';
|
|
5
5
|
import { IconButton } from '../IconButton';
|
|
6
6
|
const NOTIFICATIONS_BADGE_ID = 'atlassian-navigation-notification-count';
|
|
7
|
+
/**
|
|
8
|
+
* __Notifications__
|
|
9
|
+
*
|
|
10
|
+
* A notifications button that can be passed into `AtlassianNavigation`'s
|
|
11
|
+
* `renderNotifications` prop.
|
|
12
|
+
*
|
|
13
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#notifications)
|
|
14
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
15
|
+
*/
|
|
16
|
+
|
|
7
17
|
export const Notifications = /*#__PURE__*/forwardRef((props, ref) => {
|
|
8
18
|
const {
|
|
9
19
|
badge,
|
|
@@ -35,6 +35,16 @@ const buttonHighlightedStyles = css({
|
|
|
35
35
|
content: '""'
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
|
+
/**
|
|
39
|
+
* __Primary button__
|
|
40
|
+
*
|
|
41
|
+
* A primary button allows you to add top-level navigation items.
|
|
42
|
+
* Should be passed into `AtlassianNavigation`'s `primaryItems` prop.
|
|
43
|
+
*
|
|
44
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#dropdown-menu)
|
|
45
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
46
|
+
*/
|
|
47
|
+
|
|
38
48
|
export const PrimaryButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
39
49
|
const {
|
|
40
50
|
children,
|
|
@@ -55,7 +65,8 @@ export const PrimaryButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
55
65
|
appearance: "primary",
|
|
56
66
|
testId: testId,
|
|
57
67
|
ref: ref,
|
|
58
|
-
isSelected: isSelected
|
|
68
|
+
isSelected: isSelected // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
69
|
+
,
|
|
59
70
|
theme: getPrimaryButtonTheme(theme)
|
|
60
71
|
}, buttonProps), children));
|
|
61
72
|
|
|
@@ -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 @@ const skeletonStyles = css({
|
|
|
11
9
|
height: `${buttonHeight - paddingAll * 2.5}px`,
|
|
12
10
|
borderRadius: `${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 const PrimaryButtonSkeleton = props => {
|
|
16
16
|
const theme = useTheme();
|
|
17
|
-
return jsx("div",
|
|
17
|
+
return jsx("div", {
|
|
18
18
|
style: theme.mode.skeleton,
|
|
19
|
-
css: skeletonStyles
|
|
20
|
-
|
|
19
|
+
css: skeletonStyles,
|
|
20
|
+
className: props.className
|
|
21
|
+
});
|
|
21
22
|
};
|
|
@@ -10,6 +10,16 @@ const 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 const PrimaryDropdownButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
14
24
|
return jsx(PrimaryButton, _extends({
|
|
15
25
|
iconAfter: jsx("span", {
|
|
@@ -28,7 +28,9 @@ const widthObserverContainerStyles = css({
|
|
|
28
28
|
margin: '0px',
|
|
29
29
|
position: 'relative',
|
|
30
30
|
flexShrink: 1
|
|
31
|
-
});
|
|
31
|
+
}); // Internal only
|
|
32
|
+
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
33
|
+
|
|
32
34
|
export const PrimaryItemsContainer = ({
|
|
33
35
|
moreLabel,
|
|
34
36
|
items,
|
|
@@ -6,7 +6,9 @@ import { PrimaryButtonSkeleton } from '../PrimaryButton/skeleton';
|
|
|
6
6
|
const primaryButtonSkeletonStyles = css({
|
|
7
7
|
marginRight: gridSize * 1.5,
|
|
8
8
|
marginLeft: gridSize * 1.5
|
|
9
|
-
});
|
|
9
|
+
}); // Internal only
|
|
10
|
+
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
11
|
+
|
|
10
12
|
export const PrimaryItemsContainerSkeleton = ({
|
|
11
13
|
count
|
|
12
14
|
}) => jsx(Fragment, null, Array.from({
|
|
@@ -87,6 +87,14 @@ const siteTitleStyles = css({
|
|
|
87
87
|
paddingRight: gridSize * 2,
|
|
88
88
|
alignItems: 'center'
|
|
89
89
|
});
|
|
90
|
+
/**
|
|
91
|
+
* __Custom product home__
|
|
92
|
+
*
|
|
93
|
+
* Use `CustomProductHome` to provide a custom logo and icon with URLs.
|
|
94
|
+
*
|
|
95
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#custom-product-home)
|
|
96
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
97
|
+
*/
|
|
90
98
|
|
|
91
99
|
const CustomProductHome = props => {
|
|
92
100
|
const {
|
|
@@ -128,7 +136,8 @@ const CustomProductHome = props => {
|
|
|
128
136
|
css: productHomeButtonStyles,
|
|
129
137
|
onClick: onClick,
|
|
130
138
|
onMouseDown: preventFocusRing,
|
|
131
|
-
"data-testid": testId && `${testId}-container`
|
|
139
|
+
"data-testid": testId && `${testId}-container` // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
140
|
+
|
|
132
141
|
}, rest), logoUrl && jsx("img", {
|
|
133
142
|
style: {
|
|
134
143
|
maxWidth: logoMaxWidth
|
|
@@ -67,10 +67,13 @@ const productLogoStyles = css({
|
|
|
67
67
|
maxWidth: `var(${VAR_LOGO_MAX_WIDTH})`,
|
|
68
68
|
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
69
69
|
'& > *': {
|
|
70
|
-
maxWidth: `var(${VAR_LOGO_MAX_WIDTH})`,
|
|
71
70
|
maxHeight: 24
|
|
72
71
|
},
|
|
73
72
|
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
73
|
+
'& > span > svg': {
|
|
74
|
+
maxWidth: `var(${VAR_LOGO_MAX_WIDTH})`
|
|
75
|
+
},
|
|
76
|
+
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
74
77
|
[`@media (max-width: ${PRODUCT_HOME_BREAKPOINT - 0.1}px)`]: {
|
|
75
78
|
display: 'none'
|
|
76
79
|
}
|
|
@@ -98,6 +101,17 @@ const siteTitleStyles = css({
|
|
|
98
101
|
paddingRight: gridSize * 2,
|
|
99
102
|
alignItems: 'center'
|
|
100
103
|
});
|
|
104
|
+
/**
|
|
105
|
+
* __Product home__
|
|
106
|
+
*
|
|
107
|
+
* The ProductHome component displays the product visual identity composed of:
|
|
108
|
+
* logo, icon, and optional text. Values for logo and icon are never displayed
|
|
109
|
+
* at the same time, where icon is used only when space is restricted. Should be
|
|
110
|
+
* passed into `AtlassianNavigation`'s `renderProductHome` prop.
|
|
111
|
+
*
|
|
112
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#product-home)
|
|
113
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
114
|
+
*/
|
|
101
115
|
|
|
102
116
|
const ProductHome = ({
|
|
103
117
|
icon: Icon,
|
|
@@ -143,7 +157,8 @@ const ProductHome = ({
|
|
|
143
157
|
href: href,
|
|
144
158
|
onClick: onClick,
|
|
145
159
|
onMouseDown: preventFocusRing,
|
|
146
|
-
"data-testid": testId && `${testId}-container`
|
|
160
|
+
"data-testid": testId && `${testId}-container` // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
161
|
+
|
|
147
162
|
}, rest), jsx("div", {
|
|
148
163
|
css: [customMaxHeightStyles, productLogoStyles],
|
|
149
164
|
"data-testid": testId && `${testId}-logo`
|
|
@@ -103,7 +103,9 @@ const siteTitleStyles = css({
|
|
|
103
103
|
borderRadius: 4,
|
|
104
104
|
content: '""'
|
|
105
105
|
}
|
|
106
|
-
});
|
|
106
|
+
}); // Not exported to consumers, only used in NavigationSkeleton
|
|
107
|
+
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
108
|
+
|
|
107
109
|
export const ProductHomeSkeleton = ({
|
|
108
110
|
showSiteName
|
|
109
111
|
}) => {
|
|
@@ -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 const Profile = IconButton; // This exists only to extract props.
|
|
13
|
+
// eslint-disable-next-line @repo/internal/react/use-noop
|
|
3
14
|
|
|
4
15
|
export default (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 const ProfileSkeleton = () => /*#__PURE__*/React.createElement(IconButtonSkeleton, {
|
|
5
7
|
marginLeft: 6,
|
|
6
8
|
marginRight: 6,
|