@atlaskit/atlassian-navigation 5.7.1 → 5.7.3
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 +13 -0
- package/afm-cc/tsconfig.json +0 -1
- package/afm-products/tsconfig.json +0 -1
- package/dist/cjs/common/action-section-desktop-css.js +12 -0
- package/dist/cjs/common/action-section-mobile-css.js +12 -0
- package/dist/cjs/common/constants.js +3 -0
- package/dist/cjs/common/styles.js +13 -9
- package/dist/cjs/components/AppSwitcher/app-switcher-nav4.js +61 -0
- package/dist/cjs/components/AppSwitcher/app-switcher.js +79 -0
- package/dist/cjs/components/AppSwitcher/index.js +1 -119
- package/dist/cjs/components/AtlassianNavigation/index.js +6 -0
- package/dist/cjs/components/AtlassianNavigation/skeleton.js +2 -0
- package/dist/cjs/components/Create/index.js +2 -0
- package/dist/cjs/components/Help/index.js +2 -0
- package/dist/cjs/components/IconButton/index.js +1 -0
- package/dist/cjs/components/Notifications/index.js +2 -0
- package/dist/cjs/components/PrimaryButton/index.js +2 -0
- package/dist/cjs/components/PrimaryDropdownButton/index.js +2 -0
- package/dist/cjs/components/PrimaryItemsContainer/index.js +5 -4
- package/dist/cjs/components/ProductHome/app-home.js +180 -0
- package/dist/cjs/components/ProductHome/custom-product-home.js +2 -0
- package/dist/cjs/components/ProductHome/product-home.js +21 -110
- package/dist/cjs/components/Profile/index.js +2 -0
- package/dist/cjs/components/Profile/profile.js +74 -0
- package/dist/cjs/components/Search/index.js +2 -0
- package/dist/cjs/components/Settings/index.js +2 -0
- package/dist/cjs/components/SignIn/index.js +2 -0
- package/dist/cjs/controllers/overflow/index.js +2 -0
- package/dist/cjs/controllers/overflow/overflow-context.js +16 -0
- package/dist/cjs/controllers/overflow/overflow-provider.js +27 -0
- package/dist/cjs/controllers/overflow/use-overflow-controller.js +111 -0
- package/dist/cjs/controllers/overflow/use-overflow-status.js +20 -0
- package/dist/cjs/entry-points/app-switcher.js +4 -3
- package/dist/cjs/entry-points/overflow.js +2 -2
- package/dist/cjs/entry-points/profile.js +2 -2
- package/dist/cjs/entry-points/skeleton-help-button.js +2 -1
- package/dist/cjs/index.js +8 -7
- package/dist/cjs/nav4-skeleton-help-button.js +33 -0
- package/dist/cjs/nav4-skeleton-notification-button.js +24 -0
- package/dist/cjs/nav4-skeleton-settings-button.js +23 -0
- package/dist/cjs/nav4-skeleton-switcher-button.js +24 -0
- package/dist/cjs/skeleton-help-button.js +1 -24
- package/dist/cjs/skeleton-notification-button.js +8 -16
- package/dist/cjs/skeleton-settings-button.js +8 -15
- package/dist/cjs/skeleton-switcher-button.js +14 -17
- package/dist/cjs/theme/atlassian-theme.js +16 -0
- package/dist/cjs/theme/convert-hex-shorthand.js +47 -0
- package/dist/cjs/theme/default-theme-brand-refresh.js +10 -0
- package/dist/cjs/theme/default-theme.js +1 -2
- package/dist/cjs/theme/generate-text-color.js +13 -0
- package/dist/cjs/theme/get-box-shadow.js +9 -0
- package/dist/cjs/theme/get-contrast-color.js +12 -0
- package/dist/cjs/theme/hex-to-rgba.js +18 -0
- package/dist/cjs/theme/index.js +2 -2
- package/dist/cjs/theme/theme-context.js +10 -0
- package/dist/cjs/theme/theme-generator.js +28 -18
- package/dist/cjs/theme/theme-helpers.js +10 -5
- package/dist/cjs/theme/theme-provider.js +11 -8
- package/dist/cjs/theme/themes.js +11 -8
- package/dist/cjs/theme/use-theme.js +2 -2
- package/dist/es2019/common/action-section-desktop-css.js +6 -0
- package/dist/es2019/common/action-section-mobile-css.js +6 -0
- package/dist/es2019/common/constants.js +3 -0
- package/dist/es2019/common/styles.js +2 -11
- package/dist/es2019/components/AppSwitcher/app-switcher-nav4.js +52 -0
- package/dist/es2019/components/AppSwitcher/app-switcher.js +70 -0
- package/dist/es2019/components/AppSwitcher/index.js +0 -116
- package/dist/es2019/components/AtlassianNavigation/index.js +6 -0
- package/dist/es2019/components/AtlassianNavigation/skeleton.js +2 -0
- package/dist/es2019/components/Create/index.js +2 -0
- package/dist/es2019/components/Help/index.js +2 -0
- package/dist/es2019/components/IconButton/index.js +1 -0
- package/dist/es2019/components/Notifications/index.js +2 -0
- package/dist/es2019/components/PrimaryButton/index.js +2 -0
- package/dist/es2019/components/PrimaryDropdownButton/index.js +2 -0
- package/dist/es2019/components/PrimaryItemsContainer/index.js +2 -1
- package/dist/es2019/components/ProductHome/app-home.js +185 -0
- package/dist/es2019/components/ProductHome/custom-product-home.js +2 -0
- package/dist/es2019/components/ProductHome/product-home.js +5 -110
- package/dist/es2019/components/Profile/index.js +2 -0
- package/dist/es2019/components/Profile/profile.js +65 -0
- package/dist/es2019/components/Search/index.js +2 -0
- package/dist/es2019/components/Settings/index.js +2 -0
- package/dist/es2019/components/SignIn/index.js +2 -0
- package/dist/es2019/controllers/overflow/index.js +2 -0
- package/dist/es2019/controllers/overflow/overflow-context.js +8 -0
- package/dist/es2019/controllers/overflow/overflow-provider.js +18 -0
- package/dist/es2019/controllers/overflow/use-overflow-controller.js +89 -0
- package/dist/es2019/controllers/overflow/use-overflow-status.js +13 -0
- package/dist/es2019/entry-points/app-switcher.js +2 -1
- package/dist/es2019/entry-points/overflow.js +1 -1
- package/dist/es2019/entry-points/profile.js +1 -1
- package/dist/es2019/entry-points/skeleton-help-button.js +2 -1
- package/dist/es2019/index.js +4 -3
- package/dist/es2019/nav4-skeleton-help-button.js +24 -0
- package/dist/es2019/nav4-skeleton-notification-button.js +15 -0
- package/dist/es2019/nav4-skeleton-settings-button.js +14 -0
- package/dist/es2019/nav4-skeleton-switcher-button.js +15 -0
- package/dist/es2019/skeleton-help-button.js +1 -22
- package/dist/es2019/skeleton-notification-button.js +1 -13
- package/dist/es2019/skeleton-settings-button.js +1 -12
- package/dist/es2019/skeleton-switcher-button.js +8 -14
- package/dist/es2019/theme/atlassian-theme.js +10 -0
- package/dist/es2019/theme/convert-hex-shorthand.js +27 -0
- package/dist/es2019/theme/default-theme-brand-refresh.js +3 -0
- package/dist/es2019/theme/default-theme.js +0 -1
- package/dist/es2019/theme/generate-text-color.js +6 -0
- package/dist/es2019/theme/get-box-shadow.js +1 -0
- package/dist/es2019/theme/get-contrast-color.js +3 -0
- package/dist/es2019/theme/hex-to-rgba.js +8 -0
- package/dist/es2019/theme/index.js +1 -1
- package/dist/es2019/theme/theme-context.js +4 -0
- package/dist/es2019/theme/theme-generator.js +12 -2
- package/dist/es2019/theme/theme-helpers.js +3 -5
- package/dist/es2019/theme/theme-provider.js +5 -7
- package/dist/es2019/theme/themes.js +6 -8
- package/dist/es2019/theme/use-theme.js +1 -1
- package/dist/esm/common/action-section-desktop-css.js +5 -0
- package/dist/esm/common/action-section-mobile-css.js +5 -0
- package/dist/esm/common/constants.js +3 -0
- package/dist/esm/common/styles.js +2 -8
- package/dist/esm/components/AppSwitcher/app-switcher-nav4.js +52 -0
- package/dist/esm/components/AppSwitcher/app-switcher.js +70 -0
- package/dist/esm/components/AppSwitcher/index.js +0 -115
- package/dist/esm/components/AtlassianNavigation/index.js +6 -0
- package/dist/esm/components/AtlassianNavigation/skeleton.js +2 -0
- package/dist/esm/components/Create/index.js +2 -0
- package/dist/esm/components/Help/index.js +2 -0
- package/dist/esm/components/IconButton/index.js +1 -0
- package/dist/esm/components/Notifications/index.js +2 -0
- package/dist/esm/components/PrimaryButton/index.js +2 -0
- package/dist/esm/components/PrimaryDropdownButton/index.js +2 -0
- package/dist/esm/components/PrimaryItemsContainer/index.js +2 -1
- package/dist/esm/components/ProductHome/app-home.js +172 -0
- package/dist/esm/components/ProductHome/custom-product-home.js +2 -0
- package/dist/esm/components/ProductHome/product-home.js +16 -110
- package/dist/esm/components/Profile/index.js +2 -0
- package/dist/esm/components/Profile/profile.js +65 -0
- package/dist/esm/components/Search/index.js +2 -0
- package/dist/esm/components/Settings/index.js +2 -0
- package/dist/esm/components/SignIn/index.js +2 -0
- package/dist/esm/controllers/overflow/index.js +2 -0
- package/dist/esm/controllers/overflow/overflow-context.js +8 -0
- package/dist/esm/controllers/overflow/overflow-provider.js +19 -0
- package/dist/esm/controllers/overflow/use-overflow-controller.js +103 -0
- package/dist/esm/controllers/overflow/use-overflow-status.js +15 -0
- package/dist/esm/entry-points/app-switcher.js +2 -1
- package/dist/esm/entry-points/overflow.js +1 -1
- package/dist/esm/entry-points/profile.js +1 -1
- package/dist/esm/entry-points/skeleton-help-button.js +2 -1
- package/dist/esm/index.js +4 -3
- package/dist/esm/nav4-skeleton-help-button.js +26 -0
- package/dist/esm/nav4-skeleton-notification-button.js +17 -0
- package/dist/esm/nav4-skeleton-settings-button.js +16 -0
- package/dist/esm/nav4-skeleton-switcher-button.js +17 -0
- package/dist/esm/skeleton-help-button.js +0 -23
- package/dist/esm/skeleton-notification-button.js +1 -15
- package/dist/esm/skeleton-settings-button.js +1 -14
- package/dist/esm/skeleton-switcher-button.js +8 -16
- package/dist/esm/theme/atlassian-theme.js +10 -0
- package/dist/esm/theme/convert-hex-shorthand.js +40 -0
- package/dist/esm/theme/default-theme-brand-refresh.js +3 -0
- package/dist/esm/theme/default-theme.js +0 -1
- package/dist/esm/theme/generate-text-color.js +6 -0
- package/dist/esm/theme/get-box-shadow.js +3 -0
- package/dist/esm/theme/get-contrast-color.js +5 -0
- package/dist/esm/theme/hex-to-rgba.js +11 -0
- package/dist/esm/theme/index.js +1 -1
- package/dist/esm/theme/theme-context.js +4 -0
- package/dist/esm/theme/theme-generator.js +12 -2
- package/dist/esm/theme/theme-helpers.js +3 -5
- package/dist/esm/theme/theme-provider.js +5 -7
- package/dist/esm/theme/themes.js +6 -8
- package/dist/esm/theme/use-theme.js +1 -1
- package/dist/types/common/action-section-desktop-css.d.ts +5 -0
- package/dist/types/common/action-section-mobile-css.d.ts +5 -0
- package/dist/types/common/constants.d.ts +3 -0
- package/dist/types/common/styles.d.ts +2 -10
- package/dist/types/components/AppSwitcher/app-switcher-nav4.d.ts +6 -0
- package/dist/types/components/AppSwitcher/app-switcher.d.ts +14 -0
- package/dist/types/components/AppSwitcher/index.d.ts +0 -12
- package/dist/types/components/AppSwitcher/types.d.ts +3 -0
- package/dist/types/components/AtlassianNavigation/index.d.ts +2 -0
- package/dist/types/components/AtlassianNavigation/skeleton.d.ts +2 -0
- package/dist/types/components/AtlassianNavigation/types.d.ts +6 -0
- package/dist/types/components/Create/index.d.ts +2 -0
- package/dist/types/components/Help/index.d.ts +2 -0
- package/dist/types/components/IconButton/index.d.ts +1 -0
- package/dist/types/components/Notifications/index.d.ts +2 -0
- package/dist/types/components/PrimaryButton/index.d.ts +2 -0
- package/dist/types/components/PrimaryDropdownButton/index.d.ts +2 -0
- package/dist/types/components/ProductHome/app-home.d.ts +20 -0
- package/dist/types/components/ProductHome/custom-product-home.d.ts +2 -0
- package/dist/types/components/ProductHome/product-home.d.ts +4 -13
- package/dist/types/components/Profile/index.d.ts +2 -0
- package/dist/types/components/Profile/profile.d.ts +14 -0
- package/dist/types/components/Profile/types.d.ts +3 -0
- package/dist/types/components/Search/index.d.ts +2 -0
- package/dist/types/components/Search/types.d.ts +3 -0
- package/dist/types/components/Settings/index.d.ts +2 -0
- package/dist/types/components/Settings/types.d.ts +3 -0
- package/dist/types/components/SignIn/index.d.ts +2 -0
- package/dist/types/components/SignIn/types.d.ts +3 -0
- package/dist/types/components/SkeletonCreateButton/types.d.ts +3 -0
- package/dist/types/components/SkeletonIconButton/types.d.ts +3 -0
- package/dist/types/components/SkeletonPrimaryButton/types.d.ts +3 -0
- package/dist/types/controllers/overflow/index.d.ts +2 -0
- package/dist/types/controllers/overflow/overflow-context.d.ts +17 -0
- package/dist/types/controllers/overflow/overflow-provider.d.ts +3 -0
- package/dist/types/controllers/overflow/use-overflow-controller.d.ts +7 -0
- package/dist/types/controllers/overflow/use-overflow-status.d.ts +11 -0
- package/dist/types/entry-points/app-switcher.d.ts +2 -1
- package/dist/types/entry-points/overflow.d.ts +1 -1
- package/dist/types/entry-points/profile.d.ts +1 -1
- package/dist/types/entry-points/skeleton-help-button.d.ts +2 -1
- package/dist/types/index.d.ts +4 -3
- package/dist/types/nav4-skeleton-help-button.d.ts +8 -0
- package/dist/types/nav4-skeleton-notification-button.d.ts +9 -0
- package/dist/types/nav4-skeleton-settings-button.d.ts +8 -0
- package/dist/types/nav4-skeleton-switcher-button.d.ts +8 -0
- package/dist/types/skeleton-help-button.d.ts +0 -6
- package/dist/types/skeleton-notification-button.d.ts +1 -7
- package/dist/types/skeleton-settings-button.d.ts +1 -6
- package/dist/types/skeleton-switcher-button.d.ts +6 -6
- package/dist/types/theme/atlassian-theme.d.ts +5 -0
- package/dist/types/theme/convert-hex-shorthand.d.ts +1 -0
- package/dist/types/theme/default-theme-brand-refresh.d.ts +1 -0
- package/dist/types/theme/default-theme.d.ts +0 -1
- package/dist/types/theme/generate-text-color.d.ts +1 -0
- package/dist/types/theme/get-box-shadow.d.ts +1 -0
- package/dist/types/theme/get-contrast-color.d.ts +1 -0
- package/dist/types/theme/hex-to-rgba.d.ts +1 -0
- package/dist/types/theme/index.d.ts +1 -1
- package/dist/types/theme/theme-context.d.ts +3 -0
- package/dist/types/theme/theme-generator.d.ts +5 -0
- package/dist/types/theme/theme-helpers.d.ts +1 -1
- package/dist/types/theme/theme-provider.d.ts +4 -2
- package/dist/types/theme/themes.d.ts +4 -1
- package/dist/types/theme/types.d.ts +30 -0
- package/dist/types-ts4.5/common/action-section-desktop-css.d.ts +5 -0
- package/dist/types-ts4.5/common/action-section-mobile-css.d.ts +5 -0
- package/dist/types-ts4.5/common/constants.d.ts +3 -0
- package/dist/types-ts4.5/common/styles.d.ts +2 -10
- package/dist/types-ts4.5/components/AppSwitcher/app-switcher-nav4.d.ts +6 -0
- package/dist/types-ts4.5/components/AppSwitcher/app-switcher.d.ts +14 -0
- package/dist/types-ts4.5/components/AppSwitcher/index.d.ts +0 -12
- package/dist/types-ts4.5/components/AppSwitcher/types.d.ts +3 -0
- package/dist/types-ts4.5/components/AtlassianNavigation/index.d.ts +2 -0
- package/dist/types-ts4.5/components/AtlassianNavigation/skeleton.d.ts +2 -0
- package/dist/types-ts4.5/components/AtlassianNavigation/types.d.ts +6 -0
- package/dist/types-ts4.5/components/Create/index.d.ts +2 -0
- package/dist/types-ts4.5/components/Help/index.d.ts +2 -0
- package/dist/types-ts4.5/components/IconButton/index.d.ts +1 -0
- package/dist/types-ts4.5/components/Notifications/index.d.ts +2 -0
- package/dist/types-ts4.5/components/PrimaryButton/index.d.ts +2 -0
- package/dist/types-ts4.5/components/PrimaryDropdownButton/index.d.ts +2 -0
- package/dist/types-ts4.5/components/ProductHome/app-home.d.ts +20 -0
- package/dist/types-ts4.5/components/ProductHome/custom-product-home.d.ts +2 -0
- package/dist/types-ts4.5/components/ProductHome/product-home.d.ts +4 -13
- package/dist/types-ts4.5/components/Profile/index.d.ts +2 -0
- package/dist/types-ts4.5/components/Profile/profile.d.ts +14 -0
- package/dist/types-ts4.5/components/Profile/types.d.ts +3 -0
- package/dist/types-ts4.5/components/Search/index.d.ts +2 -0
- package/dist/types-ts4.5/components/Search/types.d.ts +3 -0
- package/dist/types-ts4.5/components/Settings/index.d.ts +2 -0
- package/dist/types-ts4.5/components/Settings/types.d.ts +3 -0
- package/dist/types-ts4.5/components/SignIn/index.d.ts +2 -0
- package/dist/types-ts4.5/components/SignIn/types.d.ts +3 -0
- package/dist/types-ts4.5/components/SkeletonCreateButton/types.d.ts +3 -0
- package/dist/types-ts4.5/components/SkeletonIconButton/types.d.ts +3 -0
- package/dist/types-ts4.5/components/SkeletonPrimaryButton/types.d.ts +3 -0
- package/dist/types-ts4.5/controllers/overflow/index.d.ts +2 -0
- package/dist/types-ts4.5/controllers/overflow/overflow-context.d.ts +17 -0
- package/dist/types-ts4.5/controllers/overflow/overflow-provider.d.ts +3 -0
- package/dist/types-ts4.5/controllers/overflow/use-overflow-controller.d.ts +7 -0
- package/dist/types-ts4.5/controllers/overflow/use-overflow-status.d.ts +11 -0
- package/dist/types-ts4.5/entry-points/app-switcher.d.ts +2 -1
- package/dist/types-ts4.5/entry-points/overflow.d.ts +1 -1
- package/dist/types-ts4.5/entry-points/profile.d.ts +1 -1
- package/dist/types-ts4.5/entry-points/skeleton-help-button.d.ts +2 -1
- package/dist/types-ts4.5/index.d.ts +4 -3
- package/dist/types-ts4.5/nav4-skeleton-help-button.d.ts +8 -0
- package/dist/types-ts4.5/nav4-skeleton-notification-button.d.ts +9 -0
- package/dist/types-ts4.5/nav4-skeleton-settings-button.d.ts +8 -0
- package/dist/types-ts4.5/nav4-skeleton-switcher-button.d.ts +8 -0
- package/dist/types-ts4.5/skeleton-help-button.d.ts +0 -6
- package/dist/types-ts4.5/skeleton-notification-button.d.ts +1 -7
- package/dist/types-ts4.5/skeleton-settings-button.d.ts +1 -6
- package/dist/types-ts4.5/skeleton-switcher-button.d.ts +6 -6
- package/dist/types-ts4.5/theme/atlassian-theme.d.ts +5 -0
- package/dist/types-ts4.5/theme/convert-hex-shorthand.d.ts +1 -0
- package/dist/types-ts4.5/theme/default-theme-brand-refresh.d.ts +1 -0
- package/dist/types-ts4.5/theme/default-theme.d.ts +0 -1
- package/dist/types-ts4.5/theme/generate-text-color.d.ts +1 -0
- package/dist/types-ts4.5/theme/get-box-shadow.d.ts +1 -0
- package/dist/types-ts4.5/theme/get-contrast-color.d.ts +1 -0
- package/dist/types-ts4.5/theme/hex-to-rgba.d.ts +1 -0
- package/dist/types-ts4.5/theme/index.d.ts +1 -1
- package/dist/types-ts4.5/theme/theme-context.d.ts +3 -0
- package/dist/types-ts4.5/theme/theme-generator.d.ts +5 -0
- package/dist/types-ts4.5/theme/theme-helpers.d.ts +1 -1
- package/dist/types-ts4.5/theme/theme-provider.d.ts +4 -2
- package/dist/types-ts4.5/theme/themes.d.ts +4 -1
- package/dist/types-ts4.5/theme/types.d.ts +30 -0
- package/package.json +12 -12
- package/afm-jira/tsconfig.json +0 -64
- /package/dist/cjs/components/AppSwitcher/{index.compiled.css → app-switcher.compiled.css} +0 -0
- /package/dist/cjs/{skeleton-help-button.compiled.css → nav4-skeleton-help-button.compiled.css} +0 -0
- /package/dist/es2019/components/AppSwitcher/{index.compiled.css → app-switcher.compiled.css} +0 -0
- /package/dist/es2019/{skeleton-help-button.compiled.css → nav4-skeleton-help-button.compiled.css} +0 -0
- /package/dist/esm/components/AppSwitcher/{index.compiled.css → app-switcher.compiled.css} +0 -0
- /package/dist/esm/{skeleton-help-button.compiled.css → nav4-skeleton-help-button.compiled.css} +0 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.AppHome = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
var _react2 = require("@emotion/react");
|
|
14
|
+
var _compiled = require("@atlaskit/primitives/compiled");
|
|
15
|
+
var _constants = require("../../common/constants");
|
|
16
|
+
var _theme = require("../../theme");
|
|
17
|
+
var _utils = require("../../utils");
|
|
18
|
+
var _utils2 = require("./utils");
|
|
19
|
+
var _excluded = ["aria-label", "href", "name", "icon", "onClick", "onMouseDown", "siteTitle", "testId"];
|
|
20
|
+
/**
|
|
21
|
+
* @jsxRuntime classic
|
|
22
|
+
* @jsx jsx
|
|
23
|
+
*/
|
|
24
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
25
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
26
|
+
var VAR_PRODUCT_HOME_COLOR_ACTIVE = '--product-home-color-active';
|
|
27
|
+
var VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE = '--product-home-bg-color-active';
|
|
28
|
+
var VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE = '--product-home-box-shadow-active';
|
|
29
|
+
var VAR_PRODUCT_HOME_COLOR_FOCUS = '--product-home-color-focus';
|
|
30
|
+
var VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS = '--product-home-bg-color-focus';
|
|
31
|
+
var VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS = '--product-home-box-shadow-focus';
|
|
32
|
+
var VAR_PRODUCT_HOME_COLOR_HOVER = '--product-home-color-hover';
|
|
33
|
+
var VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER = '--product-home-bg-color-hover';
|
|
34
|
+
var VAR_PRODUCT_HOME_BOX_SHADOW_HOVER = '--product-home-box-shadow-hover';
|
|
35
|
+
var productHomeButtonStyles = (0, _react2.css)((0, _defineProperty2.default)((0, _defineProperty2.default)({
|
|
36
|
+
display: 'flex',
|
|
37
|
+
padding: "var(--ds-space-050, 4px)",
|
|
38
|
+
alignItems: 'center',
|
|
39
|
+
background: 'none',
|
|
40
|
+
border: 0,
|
|
41
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
42
|
+
color: 'inherit',
|
|
43
|
+
cursor: 'pointer',
|
|
44
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
45
|
+
'&::-moz-focus-inner': {
|
|
46
|
+
border: 0
|
|
47
|
+
},
|
|
48
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
49
|
+
'&:first-of-type': {
|
|
50
|
+
marginInlineStart: 0
|
|
51
|
+
},
|
|
52
|
+
'&:hover': {
|
|
53
|
+
backgroundColor: "var(".concat(VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER, ")"),
|
|
54
|
+
boxShadow: "var(".concat(VAR_PRODUCT_HOME_BOX_SHADOW_HOVER, ")"),
|
|
55
|
+
color: "var(".concat(VAR_PRODUCT_HOME_COLOR_HOVER, ")")
|
|
56
|
+
},
|
|
57
|
+
'&:active': {
|
|
58
|
+
backgroundColor: "var(".concat(VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE, ")"),
|
|
59
|
+
boxShadow: "var(".concat(VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE, ")"),
|
|
60
|
+
color: "var(".concat(VAR_PRODUCT_HOME_COLOR_ACTIVE, ")")
|
|
61
|
+
},
|
|
62
|
+
'&:focus-visible': {
|
|
63
|
+
backgroundColor: "var(".concat(VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS, ")"),
|
|
64
|
+
color: "var(".concat(VAR_PRODUCT_HOME_COLOR_FOCUS, ")"),
|
|
65
|
+
outline: "var(--ds-border-width-focused, 2px)".concat(" solid ", "var(--ds-border-focused, #4688EC)")
|
|
66
|
+
},
|
|
67
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
68
|
+
'div&': {
|
|
69
|
+
pointerEvents: 'none'
|
|
70
|
+
}
|
|
71
|
+
}, "@media (max-width: ".concat(_constants.PRODUCT_HOME_BREAKPOINT - 0.1, "px)"), {
|
|
72
|
+
margin: "0 ".concat("var(--ds-space-100, 8px)")
|
|
73
|
+
}), "@media (min-width: ".concat(_constants.PRODUCT_HOME_BREAKPOINT, "px)"), {
|
|
74
|
+
margin: "0 ".concat("var(--ds-space-200, 16px)")
|
|
75
|
+
}));
|
|
76
|
+
var appHomeIconStyles = (0, _react2.css)({
|
|
77
|
+
borderRadius: '10px'
|
|
78
|
+
});
|
|
79
|
+
var appIconStyles = (0, _react2.css)({
|
|
80
|
+
display: 'flex',
|
|
81
|
+
maxWidth: 24
|
|
82
|
+
});
|
|
83
|
+
var appLogoTextStyles = (0, _react2.css)((0, _defineProperty2.default)({
|
|
84
|
+
// Logo text should never wrap or overflow
|
|
85
|
+
width: 'max-content',
|
|
86
|
+
paddingInlineEnd: "var(--ds-space-025, 2px)"
|
|
87
|
+
}, "@media (max-width: ".concat(_constants.PRODUCT_HOME_BREAKPOINT - 0.1, "px)"), {
|
|
88
|
+
display: 'none'
|
|
89
|
+
}));
|
|
90
|
+
var siteTitleStyles = (0, _react2.css)({
|
|
91
|
+
display: 'flex',
|
|
92
|
+
alignItems: 'center',
|
|
93
|
+
marginInlineEnd: "var(--ds-space-050, 4px)",
|
|
94
|
+
marginInlineStart: "var(--ds-space-050, 4px)",
|
|
95
|
+
paddingInlineEnd: "var(--ds-space-200, 16px)"
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* __App home__
|
|
100
|
+
*
|
|
101
|
+
* A variant of the ProductHome component designed for use with the updated app logos.
|
|
102
|
+
*
|
|
103
|
+
* Takes an icon, displayed at all viewport sizes, and a product name, which is
|
|
104
|
+
* displayed only at larger viewport sizes.
|
|
105
|
+
*
|
|
106
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#app-product-home)
|
|
107
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
108
|
+
*
|
|
109
|
+
* @deprecated `@atlaskit/atlassian-navigation` is deprecated. Use `@atlaskit/navigation-system` instead.
|
|
110
|
+
*/
|
|
111
|
+
var AppHome = exports.AppHome = function AppHome(_ref) {
|
|
112
|
+
var ariaLabel = _ref['aria-label'],
|
|
113
|
+
href = _ref.href,
|
|
114
|
+
name = _ref.name,
|
|
115
|
+
Icon = _ref.icon,
|
|
116
|
+
onClick = _ref.onClick,
|
|
117
|
+
onMouseDown = _ref.onMouseDown,
|
|
118
|
+
siteTitle = _ref.siteTitle,
|
|
119
|
+
testId = _ref.testId,
|
|
120
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
121
|
+
var theme = (0, _theme.useTheme)();
|
|
122
|
+
var primaryButton = theme.mode.primaryButton;
|
|
123
|
+
// After the brand refresh, iconColor and textColor should be set to 'undefined' to allow the original
|
|
124
|
+
// multi-color logo tile colors to be visible, rather than a hardcoded blue.
|
|
125
|
+
var _theme$mode$productHo = theme.mode.productHome,
|
|
126
|
+
_theme$mode$productHo2 = _theme$mode$productHo.iconColor,
|
|
127
|
+
iconColor = _theme$mode$productHo2 === void 0 ? undefined : _theme$mode$productHo2,
|
|
128
|
+
_theme$mode$productHo3 = _theme$mode$productHo.textColor,
|
|
129
|
+
textColor = _theme$mode$productHo3 === void 0 ? undefined : _theme$mode$productHo3;
|
|
130
|
+
|
|
131
|
+
// The default theme is set at module scope and immediately used in context.
|
|
132
|
+
// To allow the feature flag to switch the logo color at runtime, we also detect the original hardcoded
|
|
133
|
+
// values and override them to undefined.
|
|
134
|
+
if (iconColor === '#357DE8' && textColor === "var(--ds-text, #292A2E)") {
|
|
135
|
+
iconColor = undefined;
|
|
136
|
+
textColor = undefined;
|
|
137
|
+
}
|
|
138
|
+
var Tag = (0, _utils2.getTag)(onClick, href);
|
|
139
|
+
var preventFocusRing = function preventFocusRing(e) {
|
|
140
|
+
e.preventDefault();
|
|
141
|
+
onMouseDown && onMouseDown(e);
|
|
142
|
+
};
|
|
143
|
+
var productHomeButtonDynamicStyles = (0, _utils.stripEmptyProperties)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, VAR_PRODUCT_HOME_COLOR_ACTIVE, primaryButton.active.color), VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE, primaryButton.active.backgroundColor), VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE, primaryButton.active.boxShadow), VAR_PRODUCT_HOME_COLOR_FOCUS, primaryButton.focus.color), VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS, primaryButton.focus.backgroundColor), VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS, primaryButton.focus.boxShadow), VAR_PRODUCT_HOME_COLOR_HOVER, primaryButton.hover.color), VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER, primaryButton.hover.backgroundColor), VAR_PRODUCT_HOME_BOX_SHADOW_HOVER, primaryButton.hover.boxShadow));
|
|
144
|
+
return (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(Tag
|
|
145
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
146
|
+
, (0, _extends2.default)({
|
|
147
|
+
style: productHomeButtonDynamicStyles,
|
|
148
|
+
css: [productHomeButtonStyles, appHomeIconStyles],
|
|
149
|
+
href: href,
|
|
150
|
+
onClick: onClick,
|
|
151
|
+
onMouseDown: preventFocusRing,
|
|
152
|
+
"data-testid": testId && "".concat(testId, "-container"),
|
|
153
|
+
"aria-label": ariaLabel
|
|
154
|
+
// Made all props explicit, leaving just in case
|
|
155
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
156
|
+
}, rest), (0, _react2.jsx)(_compiled.Inline, {
|
|
157
|
+
space: "space.075",
|
|
158
|
+
alignBlock: "center"
|
|
159
|
+
}, (0, _react2.jsx)("div", {
|
|
160
|
+
css: [appIconStyles],
|
|
161
|
+
"data-testid": testId && "".concat(testId, "-icon")
|
|
162
|
+
}, (0, _react2.jsx)(Icon, {
|
|
163
|
+
iconColor: iconColor,
|
|
164
|
+
shouldUseNewLogoDesign: true,
|
|
165
|
+
size: "small",
|
|
166
|
+
appearance: "brand"
|
|
167
|
+
})), (0, _react2.jsx)("span", {
|
|
168
|
+
css: appLogoTextStyles
|
|
169
|
+
}, (0, _react2.jsx)(_compiled.Text, {
|
|
170
|
+
"aria-hidden": true,
|
|
171
|
+
color: "inherit",
|
|
172
|
+
weight: "semibold"
|
|
173
|
+
}, name)))), siteTitle && (0, _react2.jsx)("div", {
|
|
174
|
+
style: {
|
|
175
|
+
borderRight: theme.mode.productHome.borderRight
|
|
176
|
+
},
|
|
177
|
+
css: siteTitleStyles,
|
|
178
|
+
"data-testid": testId && "".concat(testId, "-site-title")
|
|
179
|
+
}, siteTitle));
|
|
180
|
+
};
|
|
@@ -103,6 +103,8 @@ var siteTitleStyles = (0, _react2.css)({
|
|
|
103
103
|
*
|
|
104
104
|
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#custom-product-home)
|
|
105
105
|
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
106
|
+
*
|
|
107
|
+
* @deprecated `@atlaskit/atlassian-navigation` is deprecated. Use `@atlaskit/navigation-system` instead.
|
|
106
108
|
*/
|
|
107
109
|
var CustomProductHome = function CustomProductHome(props) {
|
|
108
110
|
var href = props.href,
|
|
@@ -5,19 +5,24 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports
|
|
8
|
+
Object.defineProperty(exports, "AppHome", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _appHome.AppHome;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
exports.default = void 0;
|
|
9
15
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
16
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
17
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
18
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
19
|
var _react2 = require("@emotion/react");
|
|
14
|
-
var _compiled = require("@atlaskit/primitives/compiled");
|
|
15
20
|
var _constants = require("../../common/constants");
|
|
16
21
|
var _theme = require("../../theme");
|
|
17
22
|
var _utils = require("../../utils");
|
|
18
23
|
var _utils2 = require("./utils");
|
|
19
|
-
var
|
|
20
|
-
|
|
24
|
+
var _appHome = require("./app-home");
|
|
25
|
+
var _excluded = ["aria-label", "href", "icon", "logo", "logoMaxWidth", "onClick", "onMouseDown", "siteTitle", "testId"];
|
|
21
26
|
/**
|
|
22
27
|
* @jsxRuntime classic
|
|
23
28
|
* @jsx jsx
|
|
@@ -106,20 +111,6 @@ var productIconStyles = (0, _react2.css)((0, _defineProperty2.default)({
|
|
|
106
111
|
}, "@media (min-width: ".concat(_constants.PRODUCT_HOME_BREAKPOINT, "px)"), {
|
|
107
112
|
display: 'none'
|
|
108
113
|
}));
|
|
109
|
-
var appHomeIconStyles = (0, _react2.css)({
|
|
110
|
-
borderRadius: '10px'
|
|
111
|
-
});
|
|
112
|
-
var appIconStyles = (0, _react2.css)({
|
|
113
|
-
display: 'flex',
|
|
114
|
-
maxWidth: 24
|
|
115
|
-
});
|
|
116
|
-
var appLogoTextStyles = (0, _react2.css)((0, _defineProperty2.default)({
|
|
117
|
-
// Logo text should never wrap or overflow
|
|
118
|
-
width: 'max-content',
|
|
119
|
-
paddingInlineEnd: "var(--ds-space-025, 2px)"
|
|
120
|
-
}, "@media (max-width: ".concat(_constants.PRODUCT_HOME_BREAKPOINT - 0.1, "px)"), {
|
|
121
|
-
display: 'none'
|
|
122
|
-
}));
|
|
123
114
|
var siteTitleStyles = (0, _react2.css)({
|
|
124
115
|
display: 'flex',
|
|
125
116
|
alignItems: 'center',
|
|
@@ -129,21 +120,25 @@ var siteTitleStyles = (0, _react2.css)({
|
|
|
129
120
|
});
|
|
130
121
|
|
|
131
122
|
/**
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* A variant of the ProductHome component designed for use with the updated app logos.
|
|
123
|
+
* __Product home__
|
|
135
124
|
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
125
|
+
* The ProductHome component displays the product visual identity composed of:
|
|
126
|
+
* logo, icon, and optional text. Values for logo and icon are never displayed
|
|
127
|
+
* at the same time, where icon is used only when space is restricted. Should be
|
|
128
|
+
* passed into `AtlassianNavigation`'s `renderProductHome` prop.
|
|
138
129
|
*
|
|
139
|
-
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#
|
|
130
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#product-home)
|
|
140
131
|
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
132
|
+
*
|
|
133
|
+
* @deprecated `@atlaskit/atlassian-navigation` is deprecated. Use `@atlaskit/navigation-system` instead.
|
|
141
134
|
*/
|
|
142
|
-
var
|
|
135
|
+
var ProductHome = function ProductHome(_ref) {
|
|
143
136
|
var ariaLabel = _ref['aria-label'],
|
|
144
137
|
href = _ref.href,
|
|
145
|
-
name = _ref.name,
|
|
146
138
|
Icon = _ref.icon,
|
|
139
|
+
Logo = _ref.logo,
|
|
140
|
+
_ref$logoMaxWidth = _ref.logoMaxWidth,
|
|
141
|
+
logoMaxWidth = _ref$logoMaxWidth === void 0 ? 260 : _ref$logoMaxWidth,
|
|
147
142
|
onClick = _ref.onClick,
|
|
148
143
|
onMouseDown = _ref.onMouseDown,
|
|
149
144
|
siteTitle = _ref.siteTitle,
|
|
@@ -151,96 +146,12 @@ var AppHome = exports.AppHome = function AppHome(_ref) {
|
|
|
151
146
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
152
147
|
var theme = (0, _theme.useTheme)();
|
|
153
148
|
var primaryButton = theme.mode.primaryButton;
|
|
154
|
-
// After the brand refresh, iconColor and textColor should be set to 'undefined' to allow the original
|
|
155
|
-
// multi-color logo tile colors to be visible, rather than a hardcoded blue.
|
|
156
149
|
var _theme$mode$productHo = theme.mode.productHome,
|
|
157
150
|
_theme$mode$productHo2 = _theme$mode$productHo.iconColor,
|
|
158
151
|
iconColor = _theme$mode$productHo2 === void 0 ? undefined : _theme$mode$productHo2,
|
|
159
152
|
_theme$mode$productHo3 = _theme$mode$productHo.textColor,
|
|
160
153
|
textColor = _theme$mode$productHo3 === void 0 ? undefined : _theme$mode$productHo3;
|
|
161
154
|
|
|
162
|
-
// The default theme is set at module scope and immediately used in context.
|
|
163
|
-
// To allow the feature flag to switch the logo color at runtime, we also detect the original hardcoded
|
|
164
|
-
// values and override them to undefined.
|
|
165
|
-
if (iconColor === '#357DE8' && textColor === "var(--ds-text, #292A2E)") {
|
|
166
|
-
iconColor = undefined;
|
|
167
|
-
textColor = undefined;
|
|
168
|
-
}
|
|
169
|
-
var Tag = (0, _utils2.getTag)(onClick, href);
|
|
170
|
-
var preventFocusRing = function preventFocusRing(e) {
|
|
171
|
-
e.preventDefault();
|
|
172
|
-
onMouseDown && onMouseDown(e);
|
|
173
|
-
};
|
|
174
|
-
var productHomeButtonDynamicStyles = (0, _utils.stripEmptyProperties)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, VAR_PRODUCT_HOME_COLOR_ACTIVE, primaryButton.active.color), VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE, primaryButton.active.backgroundColor), VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE, primaryButton.active.boxShadow), VAR_PRODUCT_HOME_COLOR_FOCUS, primaryButton.focus.color), VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS, primaryButton.focus.backgroundColor), VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS, primaryButton.focus.boxShadow), VAR_PRODUCT_HOME_COLOR_HOVER, primaryButton.hover.color), VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER, primaryButton.hover.backgroundColor), VAR_PRODUCT_HOME_BOX_SHADOW_HOVER, primaryButton.hover.boxShadow));
|
|
175
|
-
return (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(Tag
|
|
176
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
177
|
-
, (0, _extends2.default)({
|
|
178
|
-
style: productHomeButtonDynamicStyles,
|
|
179
|
-
css: [productHomeButtonStyles, appHomeIconStyles],
|
|
180
|
-
href: href,
|
|
181
|
-
onClick: onClick,
|
|
182
|
-
onMouseDown: preventFocusRing,
|
|
183
|
-
"data-testid": testId && "".concat(testId, "-container"),
|
|
184
|
-
"aria-label": ariaLabel
|
|
185
|
-
// Made all props explicit, leaving just in case
|
|
186
|
-
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
187
|
-
}, rest), (0, _react2.jsx)(_compiled.Inline, {
|
|
188
|
-
space: "space.075",
|
|
189
|
-
alignBlock: "center"
|
|
190
|
-
}, (0, _react2.jsx)("div", {
|
|
191
|
-
css: [appIconStyles],
|
|
192
|
-
"data-testid": testId && "".concat(testId, "-icon")
|
|
193
|
-
}, (0, _react2.jsx)(Icon, {
|
|
194
|
-
iconColor: iconColor,
|
|
195
|
-
shouldUseNewLogoDesign: true,
|
|
196
|
-
size: "small",
|
|
197
|
-
appearance: "brand"
|
|
198
|
-
})), (0, _react2.jsx)("span", {
|
|
199
|
-
css: appLogoTextStyles
|
|
200
|
-
}, (0, _react2.jsx)(_compiled.Text, {
|
|
201
|
-
"aria-hidden": true,
|
|
202
|
-
color: "inherit",
|
|
203
|
-
weight: "semibold"
|
|
204
|
-
}, name)))), siteTitle && (0, _react2.jsx)("div", {
|
|
205
|
-
style: {
|
|
206
|
-
borderRight: theme.mode.productHome.borderRight
|
|
207
|
-
},
|
|
208
|
-
css: siteTitleStyles,
|
|
209
|
-
"data-testid": testId && "".concat(testId, "-site-title")
|
|
210
|
-
}, siteTitle));
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* __Product home__
|
|
215
|
-
*
|
|
216
|
-
* The ProductHome component displays the product visual identity composed of:
|
|
217
|
-
* logo, icon, and optional text. Values for logo and icon are never displayed
|
|
218
|
-
* at the same time, where icon is used only when space is restricted. Should be
|
|
219
|
-
* passed into `AtlassianNavigation`'s `renderProductHome` prop.
|
|
220
|
-
*
|
|
221
|
-
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#product-home)
|
|
222
|
-
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
223
|
-
*/
|
|
224
|
-
var ProductHome = function ProductHome(_ref2) {
|
|
225
|
-
var ariaLabel = _ref2['aria-label'],
|
|
226
|
-
href = _ref2.href,
|
|
227
|
-
Icon = _ref2.icon,
|
|
228
|
-
Logo = _ref2.logo,
|
|
229
|
-
_ref2$logoMaxWidth = _ref2.logoMaxWidth,
|
|
230
|
-
logoMaxWidth = _ref2$logoMaxWidth === void 0 ? 260 : _ref2$logoMaxWidth,
|
|
231
|
-
onClick = _ref2.onClick,
|
|
232
|
-
onMouseDown = _ref2.onMouseDown,
|
|
233
|
-
siteTitle = _ref2.siteTitle,
|
|
234
|
-
testId = _ref2.testId,
|
|
235
|
-
rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
|
|
236
|
-
var theme = (0, _theme.useTheme)();
|
|
237
|
-
var primaryButton = theme.mode.primaryButton;
|
|
238
|
-
var _theme$mode$productHo4 = theme.mode.productHome,
|
|
239
|
-
_theme$mode$productHo5 = _theme$mode$productHo4.iconColor,
|
|
240
|
-
iconColor = _theme$mode$productHo5 === void 0 ? undefined : _theme$mode$productHo5,
|
|
241
|
-
_theme$mode$productHo6 = _theme$mode$productHo4.textColor,
|
|
242
|
-
textColor = _theme$mode$productHo6 === void 0 ? undefined : _theme$mode$productHo6;
|
|
243
|
-
|
|
244
155
|
// If the theme returns the default Atlassian theme, rely on the Logo default behaviour instead
|
|
245
156
|
if (iconColor === '#357DE8' && textColor === "var(--ds-text, #292A2E)") {
|
|
246
157
|
iconColor = undefined;
|
|
@@ -20,6 +20,8 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
20
20
|
*
|
|
21
21
|
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#profile)
|
|
22
22
|
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
23
|
+
*
|
|
24
|
+
* @deprecated `@atlaskit/atlassian-navigation` is deprecated. Use `@atlaskit/navigation-system` instead.
|
|
23
25
|
*/
|
|
24
26
|
var Profile = exports.Profile = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
25
27
|
var component = props.component,
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Profile = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _IconButton = require("../IconButton");
|
|
13
|
+
var _excluded = ["component", "href", "icon", "id", "isDisabled", "isSelected", "label", "onBlur", "onClick", "onFocus", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseUp", "target", "testId", "theme", "tooltip"];
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
15
|
+
/**
|
|
16
|
+
* __Profile__
|
|
17
|
+
*
|
|
18
|
+
* A profile button which takes an icon/avatar component can be that can be
|
|
19
|
+
* passed into `AtlassianNavigation`'s `renderProfile` prop.
|
|
20
|
+
*
|
|
21
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#profile)
|
|
22
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
23
|
+
*
|
|
24
|
+
* @deprecated `@atlaskit/atlassian-navigation` is deprecated. Use `@atlaskit/navigation-system` instead.
|
|
25
|
+
*/
|
|
26
|
+
var Profile = exports.Profile = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
27
|
+
var component = props.component,
|
|
28
|
+
href = props.href,
|
|
29
|
+
icon = props.icon,
|
|
30
|
+
id = props.id,
|
|
31
|
+
isDisabled = props.isDisabled,
|
|
32
|
+
isSelected = props.isSelected,
|
|
33
|
+
labelProp = props.label,
|
|
34
|
+
onBlur = props.onBlur,
|
|
35
|
+
onClick = props.onClick,
|
|
36
|
+
onFocus = props.onFocus,
|
|
37
|
+
onMouseDown = props.onMouseDown,
|
|
38
|
+
onMouseEnter = props.onMouseEnter,
|
|
39
|
+
onMouseLeave = props.onMouseLeave,
|
|
40
|
+
onMouseUp = props.onMouseUp,
|
|
41
|
+
target = props.target,
|
|
42
|
+
testId = props.testId,
|
|
43
|
+
theme = props.theme,
|
|
44
|
+
tooltip = props.tooltip,
|
|
45
|
+
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
46
|
+
var label = labelProp || (typeof tooltip === 'string' ? tooltip : 'Your profile and settings');
|
|
47
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
48
|
+
role: "listitem"
|
|
49
|
+
}, /*#__PURE__*/_react.default.createElement(_IconButton.IconButton, (0, _extends2.default)({
|
|
50
|
+
component: component,
|
|
51
|
+
href: href,
|
|
52
|
+
icon: icon,
|
|
53
|
+
id: id,
|
|
54
|
+
isDisabled: isDisabled,
|
|
55
|
+
isSelected: isSelected,
|
|
56
|
+
label: label,
|
|
57
|
+
onBlur: onBlur,
|
|
58
|
+
onClick: onClick,
|
|
59
|
+
onFocus: onFocus,
|
|
60
|
+
onMouseDown: onMouseDown,
|
|
61
|
+
onMouseEnter: onMouseEnter,
|
|
62
|
+
onMouseLeave: onMouseLeave,
|
|
63
|
+
onMouseUp: onMouseUp,
|
|
64
|
+
ref: ref,
|
|
65
|
+
target: target,
|
|
66
|
+
testId: testId
|
|
67
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
68
|
+
,
|
|
69
|
+
theme: theme,
|
|
70
|
+
tooltip: tooltip,
|
|
71
|
+
isTooltipAnnouncementDisabled: true
|
|
72
|
+
// These are mostly explicit, leaving it in just in case
|
|
73
|
+
}, rest)));
|
|
74
|
+
});
|
|
@@ -122,6 +122,8 @@ var SearchComponent = function SearchComponent(props) {
|
|
|
122
122
|
*
|
|
123
123
|
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#search)
|
|
124
124
|
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
125
|
+
*
|
|
126
|
+
* @deprecated `@atlaskit/atlassian-navigation` is deprecated. Use `@atlaskit/navigation-system` instead.
|
|
125
127
|
*/
|
|
126
128
|
var Search = exports.Search = function Search(props) {
|
|
127
129
|
var component = props.component,
|
|
@@ -28,6 +28,8 @@ var iconSpacingStyles = {
|
|
|
28
28
|
*
|
|
29
29
|
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#settings)
|
|
30
30
|
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
31
|
+
*
|
|
32
|
+
* @deprecated `@atlaskit/atlassian-navigation` is deprecated. Use `@atlaskit/navigation-system` instead.
|
|
31
33
|
*/
|
|
32
34
|
var Settings = exports.Settings = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
33
35
|
var component = props.component,
|
|
@@ -26,6 +26,8 @@ var iconSpacingStyles = {
|
|
|
26
26
|
*
|
|
27
27
|
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#sign-in)
|
|
28
28
|
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
29
|
+
*
|
|
30
|
+
* @deprecated `@atlaskit/atlassian-navigation` is deprecated. Use `@atlaskit/navigation-system` instead.
|
|
29
31
|
*/
|
|
30
32
|
var SignIn = exports.SignIn = function SignIn(props) {
|
|
31
33
|
var component = props.component,
|
|
@@ -56,6 +56,8 @@ var OverflowProvider = exports.OverflowProvider = function OverflowProvider(_ref
|
|
|
56
56
|
* Returns the current context value for the nearest OverflowProvider.
|
|
57
57
|
*
|
|
58
58
|
* - [Example](https://atlassian.design/components/atlassian-navigation/examples#responsive)
|
|
59
|
+
*
|
|
60
|
+
* @deprecated `@atlaskit/atlassian-navigation` is deprecated. Use `@atlaskit/navigation-system` instead.
|
|
59
61
|
*/
|
|
60
62
|
var useOverflowStatus = exports.useOverflowStatus = function useOverflowStatus() {
|
|
61
63
|
return (0, _react.useContext)(OverflowContext);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.OverflowContext = void 0;
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
10
|
+
/* eslint-disable @repo/internal/react/require-jsdoc */
|
|
11
|
+
|
|
12
|
+
var OverflowContext = exports.OverflowContext = /*#__PURE__*/(0, _react.createContext)({
|
|
13
|
+
isVisible: true,
|
|
14
|
+
openOverflowMenu: _noop.default,
|
|
15
|
+
closeOverflowMenu: _noop.default
|
|
16
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.OverflowProvider = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _overflowContext = require("./overflow-context");
|
|
10
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
11
|
+
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
12
|
+
var OverflowProvider = exports.OverflowProvider = function OverflowProvider(_ref) {
|
|
13
|
+
var children = _ref.children,
|
|
14
|
+
isVisible = _ref.isVisible,
|
|
15
|
+
openOverflowMenu = _ref.openOverflowMenu,
|
|
16
|
+
closeOverflowMenu = _ref.closeOverflowMenu;
|
|
17
|
+
var value = (0, _react.useMemo)(function () {
|
|
18
|
+
return {
|
|
19
|
+
isVisible: isVisible,
|
|
20
|
+
openOverflowMenu: openOverflowMenu,
|
|
21
|
+
closeOverflowMenu: closeOverflowMenu
|
|
22
|
+
};
|
|
23
|
+
}, [isVisible, openOverflowMenu, closeOverflowMenu]);
|
|
24
|
+
return /*#__PURE__*/_react.default.createElement(_overflowContext.OverflowContext.Provider, {
|
|
25
|
+
value: value
|
|
26
|
+
}, children);
|
|
27
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.useOverflowController = void 0;
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _throttle = _interopRequireDefault(require("lodash/throttle"));
|
|
12
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
13
|
+
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
14
|
+
|
|
15
|
+
var THROTTLE_INTERVAL = 16 * 4;
|
|
16
|
+
var ITEM_APPROX_MINWIDTH = 70;
|
|
17
|
+
var calculateHash = function calculateHash(w, n) {
|
|
18
|
+
return w + '#' + n;
|
|
19
|
+
};
|
|
20
|
+
var updateHashRef = function updateHashRef(currentRef, value) {
|
|
21
|
+
currentRef.unshift(value);
|
|
22
|
+
currentRef.length = 3;
|
|
23
|
+
};
|
|
24
|
+
var useOverflowController = exports.useOverflowController = function useOverflowController(nodes) {
|
|
25
|
+
var items = _react.default.Children.toArray(nodes);
|
|
26
|
+
var _useState = (0, _react.useState)(9999),
|
|
27
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
28
|
+
width = _useState2[0],
|
|
29
|
+
setWidth = _useState2[1];
|
|
30
|
+
var _useState3 = (0, _react.useState)(items.length),
|
|
31
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
32
|
+
itemsLimit = _useState4[0],
|
|
33
|
+
setItemsLimit = _useState4[1];
|
|
34
|
+
var _useState5 = (0, _react.useState)({}),
|
|
35
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
36
|
+
forceEffectValue = _useState6[0],
|
|
37
|
+
triggerForceEffect = _useState6[1];
|
|
38
|
+
// Storing items approximate width so we can try expanding when there is enough room
|
|
39
|
+
var itemsWidths = (0, _react.useRef)([]).current;
|
|
40
|
+
// Storing a couple of width + items count in order to stabilize
|
|
41
|
+
var hashRef = (0, _react.useRef)([]);
|
|
42
|
+
|
|
43
|
+
// AFP-2511 TODO: Fix automatic suppressions below
|
|
44
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
45
|
+
var throttleSetWidth = (0, _react.useCallback)((0, _throttle.default)(setWidth, THROTTLE_INTERVAL), [setWidth]);
|
|
46
|
+
(0, _react.useEffect)(function () {
|
|
47
|
+
var lastItemWidth = itemsWidths[itemsLimit] || 0;
|
|
48
|
+
var wasJustLimited = lastItemWidth < 0;
|
|
49
|
+
var currentHash = calculateHash(width, itemsLimit);
|
|
50
|
+
if (hashRef.current[0] === currentHash) {
|
|
51
|
+
// After removing an item, if width has not changed yet we schedule a force update
|
|
52
|
+
// to handle case where removing an item does not actually trigger width change
|
|
53
|
+
var t = setTimeout(function () {
|
|
54
|
+
updateHashRef(hashRef.current, '');
|
|
55
|
+
triggerForceEffect({});
|
|
56
|
+
}, THROTTLE_INTERVAL * 1.5);
|
|
57
|
+
return function () {
|
|
58
|
+
return clearTimeout(t);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
if (wasJustLimited) {
|
|
62
|
+
// Width was updated either via resize or after changing the limit
|
|
63
|
+
// we cap the width between ITEM_APPROX_MINWIDTH and 2*ITEM_APPROX_MINWIDTH
|
|
64
|
+
// because width is throttled as when fast expanding/resizing partialWidth
|
|
65
|
+
// will not be reliable (edge case)
|
|
66
|
+
var partialWidth = Math.max(Math.min(width + lastItemWidth, ITEM_APPROX_MINWIDTH * 2), ITEM_APPROX_MINWIDTH);
|
|
67
|
+
itemsWidths[itemsLimit] = partialWidth;
|
|
68
|
+
}
|
|
69
|
+
if (width < ITEM_APPROX_MINWIDTH * 0.9 && itemsLimit) {
|
|
70
|
+
// If current width is less than an item approx width we remove an item
|
|
71
|
+
// marking the width as negative so we will calculate it on width update
|
|
72
|
+
// plus we set the hash to stabilise and not removing more than one element
|
|
73
|
+
// until we are sure width was updated
|
|
74
|
+
var nextHash = calculateHash(width, itemsLimit - 1);
|
|
75
|
+
if (hashRef.current.indexOf(nextHash) === -1) {
|
|
76
|
+
setItemsLimit(itemsLimit - 1);
|
|
77
|
+
itemsWidths[itemsLimit - 1] = -(width || 1);
|
|
78
|
+
updateHashRef(hashRef.current, nextHash);
|
|
79
|
+
}
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* This is not necessarily equal to `lastItemWidth` because the
|
|
85
|
+
* ```js
|
|
86
|
+
* if (wasJustLimited) {}
|
|
87
|
+
* ```
|
|
88
|
+
* branch above modifies `itemsWidths`.
|
|
89
|
+
*
|
|
90
|
+
* Using `lastItemWidth` here can cause collapsing behavior to fail,
|
|
91
|
+
* such as the issue reported in DSP-7329.
|
|
92
|
+
*/
|
|
93
|
+
var currentLastItemWidth = itemsWidths[itemsLimit] || 0;
|
|
94
|
+
if (width - currentLastItemWidth > ITEM_APPROX_MINWIDTH * 1.1 && itemsLimit < items.length) {
|
|
95
|
+
// If we have enough room to accomodate next item width we increase the limit
|
|
96
|
+
// unless it has been recently removed
|
|
97
|
+
var _nextHash = calculateHash(width, itemsLimit + 1);
|
|
98
|
+
if (hashRef.current.indexOf(_nextHash) === -1) {
|
|
99
|
+
setItemsLimit(itemsLimit + 1);
|
|
100
|
+
updateHashRef(hashRef.current, _nextHash);
|
|
101
|
+
}
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
return;
|
|
105
|
+
}, [width, hashRef, itemsLimit, itemsWidths, forceEffectValue, items.length]);
|
|
106
|
+
return {
|
|
107
|
+
visibleItems: items.slice(0, itemsLimit),
|
|
108
|
+
overflowItems: items.slice(itemsLimit),
|
|
109
|
+
updateWidth: throttleSetWidth
|
|
110
|
+
};
|
|
111
|
+
};
|