@atlaskit/atlassian-navigation 2.3.3 → 2.3.5
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/dist/cjs/common/constants.js +12 -4
- package/dist/cjs/common/styles.js +0 -4
- package/dist/cjs/components/AppSwitcher/index.js +4 -16
- package/dist/cjs/components/AtlassianNavigation/index.js +23 -28
- package/dist/cjs/components/AtlassianNavigation/skeleton.js +15 -24
- package/dist/cjs/components/BadgeContainer/index.js +6 -7
- package/dist/cjs/components/Create/index.js +12 -24
- package/dist/cjs/components/Create/skeleton.js +4 -11
- package/dist/cjs/components/Create/styles.js +2 -9
- package/dist/cjs/components/Help/index.js +4 -20
- package/dist/cjs/components/IconButton/index.js +5 -20
- package/dist/cjs/components/IconButton/skeleton.js +6 -16
- package/dist/cjs/components/IconButton/styles.js +2 -9
- package/dist/cjs/components/Notifications/index.js +3 -15
- package/dist/cjs/components/PrimaryButton/index.js +8 -22
- package/dist/cjs/components/PrimaryButton/skeleton.js +4 -7
- package/dist/cjs/components/PrimaryButton/styles.js +2 -9
- package/dist/cjs/components/PrimaryDropdownButton/index.js +2 -8
- package/dist/cjs/components/PrimaryItemsContainer/index.js +16 -28
- package/dist/cjs/components/PrimaryItemsContainer/skeleton.js +4 -8
- package/dist/cjs/components/ProductHome/custom-product-home.js +14 -30
- package/dist/cjs/components/ProductHome/index.js +0 -3
- package/dist/cjs/components/ProductHome/product-home.js +20 -36
- package/dist/cjs/components/ProductHome/skeleton.js +3 -12
- package/dist/cjs/components/ProductHome/utils.js +0 -4
- package/dist/cjs/components/Profile/index.js +3 -6
- package/dist/cjs/components/Profile/skeleton.js +0 -6
- package/dist/cjs/components/Search/index.js +23 -37
- package/dist/cjs/components/Search/skeleton.js +4 -11
- package/dist/cjs/components/Settings/index.js +1 -12
- package/dist/cjs/components/SignIn/index.js +3 -12
- package/dist/cjs/components/SignIn/skeleton.js +0 -6
- package/dist/cjs/components/SkeletonCreateButton/index.js +3 -6
- package/dist/cjs/components/SkeletonIconButton/index.js +3 -6
- package/dist/cjs/components/SkeletonPrimaryButton/index.js +7 -18
- package/dist/cjs/controllers/overflow/index.js +27 -56
- package/dist/cjs/index.js +0 -16
- package/dist/cjs/skeleton-help-button.js +2 -11
- package/dist/cjs/skeleton-notification-button.js +1 -7
- package/dist/cjs/skeleton-settings-button.js +1 -7
- package/dist/cjs/skeleton-switcher-button.js +1 -7
- package/dist/cjs/skeleton.js +0 -4
- package/dist/cjs/theme/default-theme.js +4 -8
- package/dist/cjs/theme/index.js +0 -5
- package/dist/cjs/theme/theme-generator.js +7 -21
- package/dist/cjs/theme/theme-helpers.js +2 -27
- package/dist/cjs/theme/theme-provider.js +1 -4
- package/dist/cjs/theme/themes.js +0 -4
- package/dist/cjs/theme/use-theme.js +0 -4
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/common/constants.js +6 -1
- package/dist/es2019/components/AppSwitcher/index.js +3 -3
- package/dist/es2019/components/AtlassianNavigation/index.js +6 -4
- package/dist/es2019/components/AtlassianNavigation/skeleton.js +4 -3
- package/dist/es2019/components/BadgeContainer/index.js +3 -2
- package/dist/es2019/components/Create/index.js +5 -5
- package/dist/es2019/components/Create/skeleton.js +3 -2
- package/dist/es2019/components/Create/styles.js +4 -2
- package/dist/es2019/components/Help/index.js +1 -1
- package/dist/es2019/components/IconButton/index.js +2 -4
- package/dist/es2019/components/IconButton/skeleton.js +3 -2
- package/dist/es2019/components/IconButton/styles.js +4 -2
- package/dist/es2019/components/Notifications/index.js +1 -1
- package/dist/es2019/components/PrimaryButton/index.js +3 -5
- package/dist/es2019/components/PrimaryButton/skeleton.js +4 -2
- package/dist/es2019/components/PrimaryButton/styles.js +4 -2
- package/dist/es2019/components/PrimaryDropdownButton/index.js +1 -2
- package/dist/es2019/components/PrimaryItemsContainer/index.js +5 -4
- package/dist/es2019/components/PrimaryItemsContainer/skeleton.js +3 -2
- package/dist/es2019/components/ProductHome/custom-product-home.js +3 -7
- package/dist/es2019/components/ProductHome/product-home.js +3 -7
- package/dist/es2019/components/ProductHome/skeleton.js +4 -2
- package/dist/es2019/components/ProductHome/utils.js +0 -2
- package/dist/es2019/components/Profile/index.js +3 -3
- package/dist/es2019/components/Profile/skeleton.js +3 -2
- package/dist/es2019/components/Search/index.js +21 -13
- package/dist/es2019/components/Search/skeleton.js +3 -2
- package/dist/es2019/components/Settings/index.js +0 -1
- package/dist/es2019/components/SignIn/index.js +2 -3
- package/dist/es2019/components/SignIn/skeleton.js +3 -2
- package/dist/es2019/components/SkeletonCreateButton/index.js +1 -1
- package/dist/es2019/components/SkeletonIconButton/index.js +1 -1
- package/dist/es2019/components/SkeletonPrimaryButton/index.js +3 -2
- package/dist/es2019/controllers/overflow/index.js +15 -24
- package/dist/es2019/skeleton-help-button.js +0 -1
- package/dist/es2019/skeleton-notification-button.js +0 -1
- package/dist/es2019/skeleton-settings-button.js +0 -1
- package/dist/es2019/skeleton-switcher-button.js +0 -1
- package/dist/es2019/theme/default-theme.js +4 -5
- package/dist/es2019/theme/theme-generator.js +6 -8
- package/dist/es2019/theme/theme-helpers.js +4 -11
- package/dist/es2019/theme/theme-provider.js +4 -3
- package/dist/es2019/version.json +1 -1
- package/dist/esm/common/constants.js +6 -1
- package/dist/esm/components/AppSwitcher/index.js +4 -5
- package/dist/esm/components/AtlassianNavigation/index.js +22 -20
- package/dist/esm/components/AtlassianNavigation/skeleton.js +14 -13
- package/dist/esm/components/BadgeContainer/index.js +5 -4
- package/dist/esm/components/Create/index.js +11 -12
- package/dist/esm/components/Create/skeleton.js +3 -3
- package/dist/esm/components/Create/styles.js +2 -6
- package/dist/esm/components/Help/index.js +4 -6
- package/dist/esm/components/IconButton/index.js +5 -8
- package/dist/esm/components/IconButton/skeleton.js +6 -10
- package/dist/esm/components/IconButton/styles.js +2 -6
- package/dist/esm/components/Notifications/index.js +3 -4
- package/dist/esm/components/PrimaryButton/index.js +8 -12
- package/dist/esm/components/PrimaryButton/skeleton.js +4 -2
- package/dist/esm/components/PrimaryButton/styles.js +2 -6
- package/dist/esm/components/PrimaryDropdownButton/index.js +1 -2
- package/dist/esm/components/PrimaryItemsContainer/index.js +15 -17
- package/dist/esm/components/PrimaryItemsContainer/skeleton.js +3 -2
- package/dist/esm/components/ProductHome/custom-product-home.js +14 -21
- package/dist/esm/components/ProductHome/product-home.js +20 -27
- package/dist/esm/components/ProductHome/skeleton.js +4 -7
- package/dist/esm/components/ProductHome/utils.js +0 -2
- package/dist/esm/components/Profile/index.js +3 -3
- package/dist/esm/components/Profile/skeleton.js +3 -2
- package/dist/esm/components/Search/index.js +24 -27
- package/dist/esm/components/Search/skeleton.js +3 -3
- package/dist/esm/components/Settings/index.js +1 -3
- package/dist/esm/components/SignIn/index.js +3 -5
- package/dist/esm/components/SignIn/skeleton.js +3 -2
- package/dist/esm/components/SkeletonCreateButton/index.js +2 -2
- package/dist/esm/components/SkeletonIconButton/index.js +2 -2
- package/dist/esm/components/SkeletonPrimaryButton/index.js +7 -13
- package/dist/esm/controllers/overflow/index.js +27 -40
- package/dist/esm/skeleton-help-button.js +2 -5
- package/dist/esm/skeleton-notification-button.js +1 -2
- package/dist/esm/skeleton-settings-button.js +1 -2
- package/dist/esm/skeleton-switcher-button.js +1 -2
- package/dist/esm/theme/default-theme.js +4 -5
- package/dist/esm/theme/theme-generator.js +7 -14
- package/dist/esm/theme/theme-helpers.js +2 -15
- package/dist/esm/theme/theme-provider.js +4 -3
- package/dist/esm/version.json +1 -1
- package/dist/types/common/constants.d.ts +5 -0
- package/package.json +3 -3
- package/report.api.md +14 -1
|
@@ -4,7 +4,6 @@ var _excluded = ["tooltip"];
|
|
|
4
4
|
import React, { forwardRef } from 'react';
|
|
5
5
|
import AppSwitcherIcon from '@atlaskit/icon/glyph/app-switcher';
|
|
6
6
|
import { IconButton } from '../IconButton';
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* _App switcher__
|
|
10
9
|
*
|
|
@@ -16,8 +15,7 @@ import { IconButton } from '../IconButton';
|
|
|
16
15
|
*/
|
|
17
16
|
export var AppSwitcher = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
18
17
|
var tooltip = props.tooltip,
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
iconButtonProps = _objectWithoutProperties(props, _excluded);
|
|
21
19
|
return /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
22
20
|
icon: /*#__PURE__*/React.createElement(AppSwitcherIcon, {
|
|
23
21
|
label: typeof tooltip === 'string' ? tooltip : 'Appswitcher Icon'
|
|
@@ -25,7 +23,8 @@ export var AppSwitcher = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
25
23
|
tooltip: tooltip,
|
|
26
24
|
ref: ref
|
|
27
25
|
}, iconButtonProps));
|
|
28
|
-
});
|
|
29
|
-
// eslint-disable-next-line @repo/internal/react/use-noop
|
|
26
|
+
});
|
|
30
27
|
|
|
28
|
+
// exists only to extract props
|
|
29
|
+
// eslint-disable-next-line @repo/internal/react/use-noop
|
|
31
30
|
export default (function (props) {});
|
|
@@ -16,7 +16,7 @@ var containerStyles = css({
|
|
|
16
16
|
justifyContent: 'space-between',
|
|
17
17
|
flexShrink: 0,
|
|
18
18
|
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
19
|
-
'[data-
|
|
19
|
+
'[data-color-mode="light"] &, [data-color-mode="dark"] &': {
|
|
20
20
|
// eslint-disable-next-line @atlaskit/design-system/no-unsafe-design-token-usage
|
|
21
21
|
borderBottom: "1px solid ".concat("var(--ds-border, #091E4224)"),
|
|
22
22
|
// TODO: (DSP-2087) Remove the below once tokens have launched
|
|
@@ -32,7 +32,8 @@ var containerStyles = css({
|
|
|
32
32
|
right: 0,
|
|
33
33
|
left: 0,
|
|
34
34
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
35
|
-
background: "linear-gradient(180deg, ".concat(N40A, " 0, ").concat(N40A, " 1px, ").concat(N30A, " 1px, ").concat(hexToRGBA(
|
|
35
|
+
background: "linear-gradient(180deg, ".concat(N40A, " 0, ").concat(N40A, " 1px, ").concat(N30A, " 1px, ").concat(hexToRGBA(
|
|
36
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
36
37
|
N900, 0), " 4px)"),
|
|
37
38
|
content: '""'
|
|
38
39
|
}
|
|
@@ -64,6 +65,7 @@ var analyticsData = {
|
|
|
64
65
|
},
|
|
65
66
|
componentName: 'atlassianNavigation'
|
|
66
67
|
};
|
|
68
|
+
|
|
67
69
|
/**
|
|
68
70
|
* __Atlassian navigation__
|
|
69
71
|
*
|
|
@@ -72,25 +74,24 @@ var analyticsData = {
|
|
|
72
74
|
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples)
|
|
73
75
|
* - [Code](https://atlassian.design/components/atlassian-navigation/examples)
|
|
74
76
|
*/
|
|
75
|
-
|
|
76
77
|
export var AtlassianNavigation = function AtlassianNavigation(props) {
|
|
77
78
|
var label = props.label,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
79
|
+
_props$primaryItems = props.primaryItems,
|
|
80
|
+
primaryItems = _props$primaryItems === void 0 ? [] : _props$primaryItems,
|
|
81
|
+
AppSwitcher = props.renderAppSwitcher,
|
|
82
|
+
create = props.renderCreate,
|
|
83
|
+
Help = props.renderHelp,
|
|
84
|
+
Notifications = props.renderNotifications,
|
|
85
|
+
ProductHome = props.renderProductHome,
|
|
86
|
+
Profile = props.renderProfile,
|
|
87
|
+
Search = props.renderSearch,
|
|
88
|
+
SignIn = props.renderSignIn,
|
|
89
|
+
Settings = props.renderSettings,
|
|
90
|
+
_props$moreLabel = props.moreLabel,
|
|
91
|
+
moreLabel = _props$moreLabel === void 0 ? '…' : _props$moreLabel,
|
|
92
|
+
_props$theme = props.theme,
|
|
93
|
+
theme = _props$theme === void 0 ? defaultTheme : _props$theme,
|
|
94
|
+
testId = props.testId;
|
|
94
95
|
return jsx(ThemeProvider, {
|
|
95
96
|
value: theme
|
|
96
97
|
}, jsx(NavigationAnalyticsContext, {
|
|
@@ -107,7 +108,8 @@ export var AtlassianNavigation = function AtlassianNavigation(props) {
|
|
|
107
108
|
testId: testId,
|
|
108
109
|
moreLabel: moreLabel,
|
|
109
110
|
items: primaryItems,
|
|
110
|
-
create: create
|
|
111
|
+
create: create
|
|
112
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
111
113
|
,
|
|
112
114
|
theme: theme
|
|
113
115
|
})), jsx("div", {
|
|
@@ -19,7 +19,7 @@ var containerStyles = css({
|
|
|
19
19
|
justifyContent: 'space-between',
|
|
20
20
|
flexShrink: 0,
|
|
21
21
|
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
22
|
-
'[data-
|
|
22
|
+
'[data-color-mode="light"] &, [data-color-mode="dark"] &': {
|
|
23
23
|
// eslint-disable-next-line @atlaskit/design-system/no-unsafe-design-token-usage
|
|
24
24
|
borderBottom: "1px solid ".concat("var(--ds-border, #091E4224)"),
|
|
25
25
|
// TODO: (DSP-2087) Remove the below once tokens have launched
|
|
@@ -35,7 +35,8 @@ var containerStyles = css({
|
|
|
35
35
|
right: 0,
|
|
36
36
|
left: 0,
|
|
37
37
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
38
|
-
background: "linear-gradient(180deg, ".concat(N40A, " 0, ").concat(N40A, " 1px, ").concat(N30A, " 1px, ").concat(hexToRGBA(
|
|
38
|
+
background: "linear-gradient(180deg, ".concat(N40A, " 0, ").concat(N40A, " 1px, ").concat(N30A, " 1px, ").concat(hexToRGBA(
|
|
39
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
39
40
|
N900, 0), " 4px)"),
|
|
40
41
|
content: '""'
|
|
41
42
|
}
|
|
@@ -61,6 +62,7 @@ var rightStyles = css({
|
|
|
61
62
|
flexShrink: 0
|
|
62
63
|
}
|
|
63
64
|
});
|
|
65
|
+
|
|
64
66
|
/**
|
|
65
67
|
* __Navigation skeleton__
|
|
66
68
|
*
|
|
@@ -74,19 +76,18 @@ var rightStyles = css({
|
|
|
74
76
|
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-loader)
|
|
75
77
|
* - [Code](https://atlassian.design/components/{packageName}/code)
|
|
76
78
|
*/
|
|
77
|
-
|
|
78
79
|
export var NavigationSkeleton = function NavigationSkeleton(_ref) {
|
|
79
80
|
var _ref$primaryItemsCoun = _ref.primaryItemsCount,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
81
|
+
primaryItemsCount = _ref$primaryItemsCoun === void 0 ? 4 : _ref$primaryItemsCoun,
|
|
82
|
+
_ref$secondaryItemsCo = _ref.secondaryItemsCount,
|
|
83
|
+
secondaryItemsCount = _ref$secondaryItemsCo === void 0 ? 4 : _ref$secondaryItemsCo,
|
|
84
|
+
_ref$theme = _ref.theme,
|
|
85
|
+
theme = _ref$theme === void 0 ? defaultTheme : _ref$theme,
|
|
86
|
+
_ref$showSiteName = _ref.showSiteName,
|
|
87
|
+
showSiteName = _ref$showSiteName === void 0 ? false : _ref$showSiteName,
|
|
88
|
+
_ref$shouldShowSearch = _ref.shouldShowSearch,
|
|
89
|
+
shouldShowSearch = _ref$shouldShowSearch === void 0 ? true : _ref$shouldShowSearch,
|
|
90
|
+
testId = _ref.testId;
|
|
90
91
|
return jsx(ThemeProvider, {
|
|
91
92
|
value: theme
|
|
92
93
|
}, jsx("div", {
|
|
@@ -8,13 +8,14 @@ var badgeContainerStyles = css({
|
|
|
8
8
|
});
|
|
9
9
|
var containerStyles = css({
|
|
10
10
|
position: 'relative'
|
|
11
|
-
});
|
|
12
|
-
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
11
|
+
});
|
|
13
12
|
|
|
13
|
+
// Not exported to consumers
|
|
14
|
+
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
14
15
|
export var BadgeContainer = function BadgeContainer(props) {
|
|
15
16
|
var badgeId = props.id,
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
Badge = props.badge,
|
|
18
|
+
children = props.children;
|
|
18
19
|
return jsx("div", {
|
|
19
20
|
css: containerStyles
|
|
20
21
|
}, children, jsx("div", {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
2
|
/** @jsx jsx */
|
|
4
3
|
import { Fragment } from 'react';
|
|
5
4
|
import { css, jsx } from '@emotion/react';
|
|
@@ -26,15 +25,15 @@ var wrapperStyles = css({
|
|
|
26
25
|
marginLeft: gridSize * 1.5
|
|
27
26
|
}
|
|
28
27
|
});
|
|
29
|
-
|
|
30
28
|
var TooltipSwitch = function TooltipSwitch(_ref) {
|
|
31
29
|
var buttonTooltip = _ref.buttonTooltip,
|
|
32
|
-
|
|
30
|
+
children = _ref.children;
|
|
33
31
|
return buttonTooltip ? jsx(Tooltip, {
|
|
34
32
|
content: buttonTooltip,
|
|
35
33
|
hideTooltipOnClick: true
|
|
36
34
|
}, children) : jsx(Fragment, null, children);
|
|
37
35
|
};
|
|
36
|
+
|
|
38
37
|
/**
|
|
39
38
|
* _Create__
|
|
40
39
|
*
|
|
@@ -44,15 +43,13 @@ var TooltipSwitch = function TooltipSwitch(_ref) {
|
|
|
44
43
|
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#create)
|
|
45
44
|
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
46
45
|
*/
|
|
47
|
-
|
|
48
|
-
|
|
49
46
|
export var Create = function Create(_ref2) {
|
|
50
47
|
var onClick = _ref2.onClick,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
href = _ref2.href,
|
|
49
|
+
text = _ref2.text,
|
|
50
|
+
buttonTooltip = _ref2.buttonTooltip,
|
|
51
|
+
iconButtonTooltip = _ref2.iconButtonTooltip,
|
|
52
|
+
testId = _ref2.testId;
|
|
56
53
|
var theme = useTheme();
|
|
57
54
|
return jsx("div", {
|
|
58
55
|
css: wrapperStyles,
|
|
@@ -62,7 +59,8 @@ export var Create = function Create(_ref2) {
|
|
|
62
59
|
}, jsx(Button, {
|
|
63
60
|
id: "createGlobalItem",
|
|
64
61
|
onClick: onClick,
|
|
65
|
-
href: href
|
|
62
|
+
href: href
|
|
63
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
66
64
|
,
|
|
67
65
|
theme: getCreateButtonTheme(theme),
|
|
68
66
|
testId: testId && "".concat(testId, "-button"),
|
|
@@ -75,7 +73,8 @@ export var Create = function Create(_ref2) {
|
|
|
75
73
|
}),
|
|
76
74
|
onClick: onClick,
|
|
77
75
|
href: href,
|
|
78
|
-
tooltip: iconButtonTooltip
|
|
76
|
+
tooltip: iconButtonTooltip
|
|
77
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
79
78
|
,
|
|
80
79
|
theme: getCreateButtonTheme(theme),
|
|
81
80
|
"aria-label": text,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
2
|
/** @jsx jsx */
|
|
4
3
|
import { Fragment } from 'react';
|
|
5
4
|
import { css, jsx } from '@emotion/react';
|
|
@@ -16,9 +15,10 @@ var skeletonStyles = css({
|
|
|
16
15
|
});
|
|
17
16
|
var mobileStyles = css(_defineProperty({}, "@media (max-width: ".concat(CREATE_BREAKPOINT - 1, "px)"), {
|
|
18
17
|
display: 'none !important'
|
|
19
|
-
}));
|
|
20
|
-
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
18
|
+
}));
|
|
21
19
|
|
|
20
|
+
// Not exported to consumers, only used in NavigationSkeleton
|
|
21
|
+
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
22
22
|
export var CreateSkeleton = function CreateSkeleton() {
|
|
23
23
|
var theme = useTheme();
|
|
24
24
|
return jsx(Fragment, null, jsx("div", {
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
|
|
7
4
|
export var getCreateButtonTheme = function getCreateButtonTheme(_ref) {
|
|
8
5
|
var create = _ref.mode.create;
|
|
9
6
|
return function (current, props) {
|
|
10
7
|
var _current = current(props),
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
buttonStyles = _current.buttonStyles,
|
|
9
|
+
spinnerStyles = _current.spinnerStyles;
|
|
14
10
|
return {
|
|
15
11
|
buttonStyles: _objectSpread(_objectSpread(_objectSpread({}, buttonStyles), create.default), {}, {
|
|
16
12
|
margin: 0,
|
|
@@ -7,6 +7,7 @@ import { useTheme } from '../../theme';
|
|
|
7
7
|
import { BadgeContainer } from '../BadgeContainer';
|
|
8
8
|
import { IconButton } from '../IconButton';
|
|
9
9
|
var HELP_NOTIFICATION_BADGE_ID = 'atlassian-navigation-help-notification-count';
|
|
10
|
+
|
|
10
11
|
/**
|
|
11
12
|
* __Help__
|
|
12
13
|
*
|
|
@@ -15,15 +16,12 @@ var HELP_NOTIFICATION_BADGE_ID = 'atlassian-navigation-help-notification-count';
|
|
|
15
16
|
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#help)
|
|
16
17
|
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
17
18
|
*/
|
|
18
|
-
|
|
19
19
|
export var Help = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
20
20
|
var badge = props.badge,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
tooltip = props.tooltip,
|
|
22
|
+
iconButtonProps = _objectWithoutProperties(props, _excluded);
|
|
24
23
|
var _useTheme = useTheme(),
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
navigation = _useTheme.mode.navigation;
|
|
27
25
|
var button = /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
28
26
|
icon: /*#__PURE__*/React.createElement(QuestionCircleIcon, {
|
|
29
27
|
label: typeof tooltip === 'string' ? tooltip : 'Help Icon',
|
|
@@ -6,7 +6,6 @@ import Button from '@atlaskit/button/custom-theme-button';
|
|
|
6
6
|
import Tooltip from '@atlaskit/tooltip';
|
|
7
7
|
import { useTheme } from '../../theme';
|
|
8
8
|
import { getIconButtonTheme } from './styles';
|
|
9
|
-
|
|
10
9
|
/**
|
|
11
10
|
* __Icon button__
|
|
12
11
|
*
|
|
@@ -18,26 +17,24 @@ import { getIconButtonTheme } from './styles';
|
|
|
18
17
|
*/
|
|
19
18
|
export var IconButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
20
19
|
var icon = props.icon,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
testId = props.testId,
|
|
21
|
+
tooltip = props.tooltip,
|
|
22
|
+
buttonProps = _objectWithoutProperties(props, _excluded);
|
|
25
23
|
var theme = useTheme();
|
|
26
24
|
var button = /*#__PURE__*/React.createElement(Button, _extends({
|
|
27
25
|
appearance: "primary",
|
|
28
26
|
testId: testId,
|
|
29
27
|
iconBefore: icon,
|
|
30
|
-
ref: ref
|
|
28
|
+
ref: ref
|
|
29
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
31
30
|
,
|
|
32
31
|
theme: getIconButtonTheme(theme)
|
|
33
32
|
}, buttonProps));
|
|
34
|
-
|
|
35
33
|
if (tooltip) {
|
|
36
34
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
37
35
|
content: tooltip,
|
|
38
36
|
hideTooltipOnClick: true
|
|
39
37
|
}, button);
|
|
40
38
|
}
|
|
41
|
-
|
|
42
39
|
return button;
|
|
43
40
|
});
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
|
|
7
4
|
/** @jsx jsx */
|
|
8
5
|
import { css, jsx } from '@emotion/react';
|
|
9
6
|
import { gridSize } from '../../common/constants';
|
|
@@ -12,23 +9,22 @@ var buttonHeight = gridSize * 4;
|
|
|
12
9
|
var skeletonStyles = css({
|
|
13
10
|
borderRadius: '50%',
|
|
14
11
|
opacity: 0.15
|
|
15
|
-
});
|
|
16
|
-
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
12
|
+
});
|
|
17
13
|
|
|
14
|
+
// Not exported to consumers, only used in NavigationSkeleton
|
|
15
|
+
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
18
16
|
export var IconButtonSkeleton = function IconButtonSkeleton(_ref) {
|
|
19
17
|
var className = _ref.className,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
marginLeft = _ref.marginLeft,
|
|
19
|
+
marginRight = _ref.marginRight,
|
|
20
|
+
size = _ref.size;
|
|
23
21
|
var theme = useTheme();
|
|
24
|
-
|
|
25
22
|
var dynamicStyles = _objectSpread({
|
|
26
23
|
marginLeft: typeof marginLeft === 'number' ? marginLeft : gridSize / 2,
|
|
27
24
|
marginRight: typeof marginRight === 'number' ? marginRight : 0,
|
|
28
25
|
width: typeof size === 'number' ? size : buttonHeight,
|
|
29
26
|
height: typeof size === 'number' ? size : buttonHeight
|
|
30
27
|
}, theme.mode.skeleton);
|
|
31
|
-
|
|
32
28
|
return jsx("div", {
|
|
33
29
|
className: className,
|
|
34
30
|
style: dynamicStyles,
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
|
|
7
4
|
export var getIconButtonTheme = function getIconButtonTheme(_ref) {
|
|
8
5
|
var iconButton = _ref.mode.iconButton;
|
|
9
6
|
return function (current, props) {
|
|
10
7
|
var _current = current(props),
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
buttonStyles = _current.buttonStyles,
|
|
9
|
+
spinnerStyles = _current.spinnerStyles;
|
|
14
10
|
return {
|
|
15
11
|
buttonStyles: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, buttonStyles), {}, {
|
|
16
12
|
borderRadius: '100%',
|
|
@@ -6,6 +6,7 @@ import NotificationIcon from '@atlaskit/icon/glyph/notification';
|
|
|
6
6
|
import { BadgeContainer } from '../BadgeContainer';
|
|
7
7
|
import { IconButton } from '../IconButton';
|
|
8
8
|
var NOTIFICATIONS_BADGE_ID = 'atlassian-navigation-notification-count';
|
|
9
|
+
|
|
9
10
|
/**
|
|
10
11
|
* __Notifications__
|
|
11
12
|
*
|
|
@@ -15,12 +16,10 @@ var NOTIFICATIONS_BADGE_ID = 'atlassian-navigation-notification-count';
|
|
|
15
16
|
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#notifications)
|
|
16
17
|
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
17
18
|
*/
|
|
18
|
-
|
|
19
19
|
export var Notifications = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
20
20
|
var badge = props.badge,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
tooltip = props.tooltip,
|
|
22
|
+
iconButtonProps = _objectWithoutProperties(props, _excluded);
|
|
24
23
|
return /*#__PURE__*/React.createElement(BadgeContainer, {
|
|
25
24
|
id: NOTIFICATIONS_BADGE_ID,
|
|
26
25
|
badge: badge
|
|
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
var _excluded = ["children", "testId", "tooltip", "isSelected", "isHighlighted"];
|
|
5
|
-
|
|
6
5
|
/** @jsx jsx */
|
|
7
6
|
import { forwardRef } from 'react';
|
|
8
7
|
import { css, jsx } from '@emotion/react';
|
|
@@ -38,6 +37,7 @@ var buttonHighlightedStyles = css({
|
|
|
38
37
|
content: '""'
|
|
39
38
|
}
|
|
40
39
|
});
|
|
40
|
+
|
|
41
41
|
/**
|
|
42
42
|
* __Primary button__
|
|
43
43
|
*
|
|
@@ -47,17 +47,14 @@ var buttonHighlightedStyles = css({
|
|
|
47
47
|
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#dropdown-menu)
|
|
48
48
|
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
49
49
|
*/
|
|
50
|
-
|
|
51
50
|
export var PrimaryButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
52
51
|
var _ref;
|
|
53
|
-
|
|
54
52
|
var children = props.children,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
testId = props.testId,
|
|
54
|
+
tooltip = props.tooltip,
|
|
55
|
+
isSelected = props.isSelected,
|
|
56
|
+
isHighlighted = props.isHighlighted,
|
|
57
|
+
buttonProps = _objectWithoutProperties(props, _excluded);
|
|
61
58
|
var theme = useTheme();
|
|
62
59
|
var button = jsx("div", {
|
|
63
60
|
style: (_ref = {}, _defineProperty(_ref, VAR_BUTTON_SELECTED_COLOR, theme.mode.primaryButton.selected.color), _defineProperty(_ref, VAR_BUTTON_SELECTED_BORDER_COLOR, theme.mode.primaryButton.selected.borderColor), _ref),
|
|
@@ -66,18 +63,17 @@ export var PrimaryButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
66
63
|
appearance: "primary",
|
|
67
64
|
testId: testId,
|
|
68
65
|
ref: ref,
|
|
69
|
-
isSelected: isSelected
|
|
66
|
+
isSelected: isSelected
|
|
67
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
70
68
|
,
|
|
71
69
|
theme: getPrimaryButtonTheme(theme)
|
|
72
70
|
}, buttonProps), children));
|
|
73
|
-
|
|
74
71
|
if (tooltip) {
|
|
75
72
|
return jsx(Tooltip, {
|
|
76
73
|
content: tooltip,
|
|
77
74
|
hideTooltipOnClick: true
|
|
78
75
|
}, button);
|
|
79
76
|
}
|
|
80
|
-
|
|
81
77
|
return button;
|
|
82
78
|
});
|
|
83
79
|
export default PrimaryButton;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
+
|
|
2
3
|
import { css, jsx } from '@emotion/react';
|
|
3
4
|
import { buttonHeight, gridSize } from '../../common/constants';
|
|
4
5
|
import { useTheme } from '../../theme';
|
|
@@ -9,9 +10,10 @@ var skeletonStyles = css({
|
|
|
9
10
|
height: "".concat(buttonHeight - paddingAll * 2.5, "px"),
|
|
10
11
|
borderRadius: "".concat(gridSize / 2, "px"),
|
|
11
12
|
opacity: 0.15
|
|
12
|
-
});
|
|
13
|
-
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
13
|
+
});
|
|
14
14
|
|
|
15
|
+
// Not exported to consumers, only used in NavigationSkeleton
|
|
16
|
+
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
15
17
|
export var PrimaryButtonSkeleton = function PrimaryButtonSkeleton(props) {
|
|
16
18
|
var theme = useTheme();
|
|
17
19
|
return jsx("div", {
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
|
|
7
4
|
export var getPrimaryButtonTheme = function getPrimaryButtonTheme(_ref) {
|
|
8
5
|
var primaryButton = _ref.mode.primaryButton;
|
|
9
6
|
return function (current, props) {
|
|
10
7
|
var _current = current(props),
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
buttonStyles = _current.buttonStyles,
|
|
9
|
+
spinnerStyles = _current.spinnerStyles;
|
|
14
10
|
return {
|
|
15
11
|
buttonStyles: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, buttonStyles), primaryButton.default), props.isSelected && primaryButton.selected), {}, {
|
|
16
12
|
fontWeight: 500,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
2
|
/** @jsx jsx */
|
|
4
3
|
import { forwardRef } from 'react';
|
|
5
4
|
import { css, jsx } from '@emotion/react';
|
|
@@ -10,6 +9,7 @@ var chevronIconStyles = css({
|
|
|
10
9
|
marginLeft: '-8px',
|
|
11
10
|
opacity: 0.51
|
|
12
11
|
});
|
|
12
|
+
|
|
13
13
|
/**
|
|
14
14
|
* __Primary dropdown button__
|
|
15
15
|
*
|
|
@@ -19,7 +19,6 @@ var chevronIconStyles = css({
|
|
|
19
19
|
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#button)
|
|
20
20
|
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
21
21
|
*/
|
|
22
|
-
|
|
23
22
|
export var PrimaryDropdownButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
24
23
|
return jsx(PrimaryButton, _extends({
|
|
25
24
|
iconAfter: jsx("span", {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
|
|
4
3
|
/** @jsx jsx */
|
|
5
4
|
import { useCallback, useState } from 'react';
|
|
6
5
|
import { css, jsx } from '@emotion/react';
|
|
@@ -29,26 +28,24 @@ var widthObserverContainerStyles = css({
|
|
|
29
28
|
margin: '0px',
|
|
30
29
|
position: 'relative',
|
|
31
30
|
flexShrink: 1
|
|
32
|
-
});
|
|
33
|
-
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
31
|
+
});
|
|
34
32
|
|
|
33
|
+
// Internal only
|
|
34
|
+
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
35
35
|
export var PrimaryItemsContainer = function PrimaryItemsContainer(_ref) {
|
|
36
36
|
var moreLabel = _ref.moreLabel,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
items = _ref.items,
|
|
38
|
+
Create = _ref.create,
|
|
39
|
+
theme = _ref.theme,
|
|
40
|
+
testId = _ref.testId;
|
|
42
41
|
var _useState = useState(false),
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
43
|
+
isMoreOpen = _useState2[0],
|
|
44
|
+
setIsMoreOpen = _useState2[1];
|
|
47
45
|
var _useOverflowControlle = useOverflowController(items),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
updateWidth = _useOverflowControlle.updateWidth,
|
|
47
|
+
visibleItems = _useOverflowControlle.visibleItems,
|
|
48
|
+
overflowItems = _useOverflowControlle.overflowItems;
|
|
52
49
|
var onMoreClick = useCallback(function () {
|
|
53
50
|
setIsMoreOpen(!isMoreOpen);
|
|
54
51
|
}, [isMoreOpen, setIsMoreOpen]);
|
|
@@ -71,7 +68,8 @@ export var PrimaryItemsContainer = function PrimaryItemsContainer(_ref) {
|
|
|
71
68
|
openOverflowMenu: openOverflowMenu,
|
|
72
69
|
closeOverflowMenu: onMoreClose
|
|
73
70
|
}, overflowItems);
|
|
74
|
-
},
|
|
71
|
+
},
|
|
72
|
+
// Overflow items has an unstable reference - so we will only recalculate
|
|
75
73
|
// content if `overflowItems` length changes.
|
|
76
74
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
77
75
|
[overflowItems.length, openOverflowMenu, onMoreClose]);
|
|
@@ -6,9 +6,10 @@ import { PrimaryButtonSkeleton } from '../PrimaryButton/skeleton';
|
|
|
6
6
|
var primaryButtonSkeletonStyles = css({
|
|
7
7
|
marginRight: gridSize * 1.5,
|
|
8
8
|
marginLeft: gridSize * 1.5
|
|
9
|
-
});
|
|
10
|
-
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
9
|
+
});
|
|
11
10
|
|
|
11
|
+
// Internal only
|
|
12
|
+
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
12
13
|
export var PrimaryItemsContainerSkeleton = function PrimaryItemsContainerSkeleton(_ref) {
|
|
13
14
|
var count = _ref.count;
|
|
14
15
|
return jsx(Fragment, null, Array.from({
|