@atlaskit/atlassian-navigation 5.7.2 → 5.7.4
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/constants.js +3 -0
- 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/skeleton-help-button.js +1 -24
- package/dist/cjs/skeleton-switcher-button.js +6 -0
- package/dist/cjs/theme/atlassian-theme.js +3 -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-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-generator.js +22 -13
- package/dist/cjs/theme/theme-provider.js +2 -0
- package/dist/cjs/theme/themes.js +3 -0
- package/dist/es2019/common/constants.js +3 -0
- 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/skeleton-help-button.js +1 -22
- package/dist/es2019/skeleton-switcher-button.js +7 -0
- package/dist/es2019/theme/atlassian-theme.js +3 -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-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-generator.js +11 -2
- package/dist/es2019/theme/theme-provider.js +2 -0
- package/dist/es2019/theme/themes.js +3 -0
- package/dist/esm/common/constants.js +3 -0
- 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/skeleton-help-button.js +0 -23
- package/dist/esm/skeleton-switcher-button.js +7 -0
- package/dist/esm/theme/atlassian-theme.js +3 -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-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-generator.js +11 -2
- package/dist/esm/theme/theme-provider.js +2 -0
- package/dist/esm/theme/themes.js +3 -0
- package/dist/types/common/constants.d.ts +3 -0
- 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/skeleton-help-button.d.ts +0 -6
- package/dist/types/skeleton-switcher-button.d.ts +5 -0
- package/dist/types/theme/atlassian-theme.d.ts +3 -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-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-generator.d.ts +5 -0
- package/dist/types/theme/theme-provider.d.ts +2 -0
- package/dist/types/theme/themes.d.ts +3 -0
- package/dist/types/theme/types.d.ts +30 -0
- package/dist/types-ts4.5/common/constants.d.ts +3 -0
- 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/skeleton-help-button.d.ts +0 -6
- package/dist/types-ts4.5/skeleton-switcher-button.d.ts +5 -0
- package/dist/types-ts4.5/theme/atlassian-theme.d.ts +3 -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-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-generator.d.ts +5 -0
- package/dist/types-ts4.5/theme/theme-provider.d.ts +2 -0
- package/dist/types-ts4.5/theme/themes.d.ts +3 -0
- package/dist/types-ts4.5/theme/types.d.ts +30 -0
- package/package.json +10 -10
- 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
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useOverflowStatus = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _overflowContext = require("./overflow-context");
|
|
9
|
+
/**
|
|
10
|
+
* __useOverFlowStatus__
|
|
11
|
+
*
|
|
12
|
+
* Returns the current context value for the nearest OverflowProvider.
|
|
13
|
+
*
|
|
14
|
+
* - [Example](https://atlassian.design/components/atlassian-navigation/examples#responsive)
|
|
15
|
+
*
|
|
16
|
+
* @deprecated `@atlaskit/atlassian-navigation` is deprecated. Use `@atlaskit/navigation-system` instead.
|
|
17
|
+
*/
|
|
18
|
+
var useOverflowStatus = exports.useOverflowStatus = function useOverflowStatus() {
|
|
19
|
+
return (0, _react.useContext)(_overflowContext.OverflowContext);
|
|
20
|
+
};
|
|
@@ -6,13 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "AppSwitcher", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _appSwitcher.AppSwitcher;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "AppSwitcherNav4", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function get() {
|
|
15
|
-
return
|
|
15
|
+
return _appSwitcherNav.AppSwitcherNav4;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
var
|
|
18
|
+
var _appSwitcher = require("../components/AppSwitcher/app-switcher");
|
|
19
|
+
var _appSwitcherNav = require("../components/AppSwitcher/app-switcher-nav4");
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "useOverflowStatus", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _useOverflowStatus.useOverflowStatus;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
var
|
|
12
|
+
var _useOverflowStatus = require("../controllers/overflow/use-overflow-status");
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "Profile", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _profile.Profile;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
var
|
|
12
|
+
var _profile = require("../components/Profile/profile");
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "Nav4SkeletonHelpButton", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _nav4SkeletonHelpButton.Nav4SkeletonHelpButton;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "SkeletonHelpButton", {
|
|
@@ -15,4 +15,5 @@ Object.defineProperty(exports, "SkeletonHelpButton", {
|
|
|
15
15
|
return _skeletonHelpButton.SkeletonHelpButton;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
var _nav4SkeletonHelpButton = require("../nav4-skeleton-help-button");
|
|
18
19
|
var _skeletonHelpButton = require("../skeleton-help-button");
|
package/dist/cjs/index.js
CHANGED
|
@@ -12,13 +12,13 @@ Object.defineProperty(exports, "AppHome", {
|
|
|
12
12
|
Object.defineProperty(exports, "AppSwitcher", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function get() {
|
|
15
|
-
return
|
|
15
|
+
return _appSwitcher.AppSwitcher;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "AppSwitcherNav4", {
|
|
19
19
|
enumerable: true,
|
|
20
20
|
get: function get() {
|
|
21
|
-
return
|
|
21
|
+
return _appSwitcherNav.AppSwitcherNav4;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "AtlassianNavigation", {
|
|
@@ -84,7 +84,7 @@ Object.defineProperty(exports, "ProductHome", {
|
|
|
84
84
|
Object.defineProperty(exports, "Profile", {
|
|
85
85
|
enumerable: true,
|
|
86
86
|
get: function get() {
|
|
87
|
-
return
|
|
87
|
+
return _profile.Profile;
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
90
|
Object.defineProperty(exports, "Search", {
|
|
@@ -126,11 +126,12 @@ Object.defineProperty(exports, "generateTheme", {
|
|
|
126
126
|
Object.defineProperty(exports, "useOverflowStatus", {
|
|
127
127
|
enumerable: true,
|
|
128
128
|
get: function get() {
|
|
129
|
-
return
|
|
129
|
+
return _useOverflowStatus.useOverflowStatus;
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
132
|
var _AtlassianNavigation = require("./components/AtlassianNavigation");
|
|
133
|
-
var
|
|
133
|
+
var _appSwitcher = require("./components/AppSwitcher/app-switcher");
|
|
134
|
+
var _appSwitcherNav = require("./components/AppSwitcher/app-switcher-nav4");
|
|
134
135
|
var _Create = require("./components/Create");
|
|
135
136
|
var _Help = require("./components/Help");
|
|
136
137
|
var _Notifications = require("./components/Notifications");
|
|
@@ -138,10 +139,10 @@ var _PrimaryButton = require("./components/PrimaryButton");
|
|
|
138
139
|
var _PrimaryDropdownButton = require("./components/PrimaryDropdownButton");
|
|
139
140
|
var _IconButton = require("./components/IconButton");
|
|
140
141
|
var _ProductHome = require("./components/ProductHome");
|
|
141
|
-
var
|
|
142
|
+
var _profile = require("./components/Profile/profile");
|
|
142
143
|
var _Search = require("./components/Search");
|
|
143
144
|
var _Settings = require("./components/Settings");
|
|
144
145
|
var _SignIn = require("./components/SignIn");
|
|
145
|
-
var
|
|
146
|
+
var _useOverflowStatus = require("./controllers/overflow/use-overflow-status");
|
|
146
147
|
var _constants = require("./common/constants");
|
|
147
148
|
var _theme = require("./theme");
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* nav4-skeleton-help-button.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Nav4SkeletonHelpButton = void 0;
|
|
9
|
+
require("./nav4-skeleton-help-button.compiled.css");
|
|
10
|
+
var _runtime = require("@compiled/react/runtime");
|
|
11
|
+
var _react = _interopRequireDefault(require("react"));
|
|
12
|
+
var _questionCircle = _interopRequireDefault(require("@atlaskit/icon/core/question-circle"));
|
|
13
|
+
var _compiled = require("@atlaskit/primitives/compiled");
|
|
14
|
+
var _SkeletonIconButton = require("./components/SkeletonIconButton");
|
|
15
|
+
var iconSpacingStyles = {
|
|
16
|
+
space050: "_1rjc1b66 _18zr1b66"
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* __Nav 4 skeleton help button__
|
|
21
|
+
*
|
|
22
|
+
* A nav 4 skeleton help button {description}.
|
|
23
|
+
*/
|
|
24
|
+
var Nav4SkeletonHelpButton = exports.Nav4SkeletonHelpButton = function Nav4SkeletonHelpButton(_ref) {
|
|
25
|
+
var _ref$label = _ref.label,
|
|
26
|
+
label = _ref$label === void 0 ? '' : _ref$label;
|
|
27
|
+
return /*#__PURE__*/_react.default.createElement(_SkeletonIconButton.SkeletonIconButton, null, /*#__PURE__*/_react.default.createElement(_compiled.Flex, {
|
|
28
|
+
xcss: iconSpacingStyles.space050
|
|
29
|
+
}, /*#__PURE__*/_react.default.createElement(_questionCircle.default, {
|
|
30
|
+
label: label,
|
|
31
|
+
color: "var(--ds-icon, #292A2E)"
|
|
32
|
+
})));
|
|
33
|
+
};
|