@atlaskit/atlassian-navigation 4.9.5 → 4.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/components/AppSwitcher/index.js +77 -23
- package/dist/cjs/components/AtlassianNavigation/index.js +5 -4
- package/dist/cjs/components/Create/index.js +1 -1
- package/dist/cjs/components/Help/index.js +35 -3
- package/dist/cjs/components/IconButton/index.js +37 -8
- package/dist/cjs/components/Notifications/index.js +37 -5
- package/dist/cjs/components/PrimaryButton/index.js +20 -12
- package/dist/cjs/components/PrimaryDropdownButton/index.js +26 -5
- package/dist/cjs/components/ProductHome/custom-product-home.js +13 -13
- package/dist/cjs/components/ProductHome/product-home.js +13 -14
- package/dist/cjs/components/ProductHome/skeleton.js +7 -7
- package/dist/cjs/components/Profile/index.js +44 -9
- package/dist/cjs/components/Search/index.js +39 -11
- package/dist/cjs/components/Settings/index.js +34 -4
- package/dist/cjs/components/SignIn/index.js +35 -4
- package/dist/cjs/components/SkeletonPrimaryButton/index.js +1 -2
- package/dist/es2019/components/AppSwitcher/index.js +73 -19
- package/dist/es2019/components/AtlassianNavigation/index.js +4 -4
- package/dist/es2019/components/Create/index.js +1 -1
- package/dist/es2019/components/Help/index.js +34 -2
- package/dist/es2019/components/IconButton/index.js +36 -7
- package/dist/es2019/components/Notifications/index.js +36 -4
- package/dist/es2019/components/PrimaryButton/index.js +20 -11
- package/dist/es2019/components/PrimaryDropdownButton/index.js +26 -3
- package/dist/es2019/components/ProductHome/custom-product-home.js +5 -3
- package/dist/es2019/components/ProductHome/product-home.js +5 -4
- package/dist/es2019/components/Profile/index.js +41 -8
- package/dist/es2019/components/Search/index.js +36 -7
- package/dist/es2019/components/Settings/index.js +32 -2
- package/dist/es2019/components/SignIn/index.js +33 -2
- package/dist/esm/components/AppSwitcher/index.js +77 -23
- package/dist/esm/components/AtlassianNavigation/index.js +5 -4
- package/dist/esm/components/Create/index.js +1 -1
- package/dist/esm/components/Help/index.js +35 -3
- package/dist/esm/components/IconButton/index.js +37 -8
- package/dist/esm/components/Notifications/index.js +37 -5
- package/dist/esm/components/PrimaryButton/index.js +20 -12
- package/dist/esm/components/PrimaryDropdownButton/index.js +26 -3
- package/dist/esm/components/ProductHome/custom-product-home.js +13 -13
- package/dist/esm/components/ProductHome/product-home.js +13 -14
- package/dist/esm/components/ProductHome/skeleton.js +5 -7
- package/dist/esm/components/Profile/index.js +44 -9
- package/dist/esm/components/Search/index.js +39 -11
- package/dist/esm/components/Settings/index.js +34 -4
- package/dist/esm/components/SignIn/index.js +35 -4
- package/dist/esm/components/SkeletonPrimaryButton/index.js +1 -2
- package/dist/types/components/AppSwitcher/index.d.ts +0 -9
- package/dist/types/components/AtlassianNavigation/types.d.ts +4 -0
- package/dist/types/components/ProductHome/product-home.d.ts +1 -1
- package/dist/types/controllers/overflow/index.d.ts +1 -1
- package/dist/types-ts4.5/components/AppSwitcher/index.d.ts +0 -9
- package/dist/types-ts4.5/components/AtlassianNavigation/types.d.ts +4 -0
- package/dist/types-ts4.5/components/ProductHome/product-home.d.ts +1 -1
- package/dist/types-ts4.5/controllers/overflow/index.d.ts +1 -1
- package/package.json +2 -5
|
@@ -6,7 +6,6 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
6
6
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
7
|
import { css, jsx } from '@emotion/react';
|
|
8
8
|
import { NavigationAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
9
|
import { N30 } from '@atlaskit/theme/colors';
|
|
11
10
|
import { HORIZONTAL_GLOBAL_NAV_HEIGHT } from '../../common/constants';
|
|
12
11
|
import { defaultTheme, ThemeProvider } from '../../theme';
|
|
@@ -82,7 +81,9 @@ export var AtlassianNavigation = function AtlassianNavigation(props) {
|
|
|
82
81
|
theme = _props$theme === void 0 ? defaultTheme : _props$theme,
|
|
83
82
|
testId = props.testId,
|
|
84
83
|
_props$isServer = props.isServer,
|
|
85
|
-
isServer = _props$isServer === void 0 ? false : _props$isServer
|
|
84
|
+
isServer = _props$isServer === void 0 ? false : _props$isServer,
|
|
85
|
+
_props$isSSRPlacehold = props.isSSRPlaceholderEnabled,
|
|
86
|
+
isSSRPlaceholderEnabled = _props$isSSRPlacehold === void 0 ? false : _props$isSSRPlacehold;
|
|
86
87
|
return jsx(ThemeProvider, {
|
|
87
88
|
value: theme
|
|
88
89
|
}, jsx(NavigationAnalyticsContext, {
|
|
@@ -94,9 +95,9 @@ export var AtlassianNavigation = function AtlassianNavigation(props) {
|
|
|
94
95
|
"data-testid": testId && "".concat(testId, "-header"),
|
|
95
96
|
role: "banner",
|
|
96
97
|
"data-vc": "atlassian-navigation".concat(isServer ? '-ssr' : '')
|
|
97
|
-
}, isServer &&
|
|
98
|
+
}, isServer && isSSRPlaceholderEnabled && {
|
|
98
99
|
'data-ssr-placeholder': 'atlassian-navigation-placeholder'
|
|
99
|
-
}, !isServer &&
|
|
100
|
+
}, !isServer && isSSRPlaceholderEnabled && {
|
|
100
101
|
'data-ssr-placeholder-replace': 'atlassian-navigation-placeholder'
|
|
101
102
|
}), jsx("nav", {
|
|
102
103
|
css: leftStyles,
|
|
@@ -70,7 +70,7 @@ export var Create = function Create(_ref2) {
|
|
|
70
70
|
"aria-label": label,
|
|
71
71
|
onClick: onClick,
|
|
72
72
|
href: href
|
|
73
|
-
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
73
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides, @atlaskit/design-system/no-unsafe-style-overrides
|
|
74
74
|
,
|
|
75
75
|
theme: getCreateButtonTheme(theme),
|
|
76
76
|
testId: testId && "".concat(testId, "-button"),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["badge", "tooltip"];
|
|
3
|
+
var _excluded = ["badge", "component", "href", "id", "isDisabled", "isSelected", "label", "onBlur", "onClick", "onFocus", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseUp", "target", "testId", "tooltip"];
|
|
4
4
|
import React, { forwardRef } from 'react';
|
|
5
5
|
import QuestionCircleIcon from '@atlaskit/icon/core/migration/question-circle';
|
|
6
6
|
import { useTheme } from '../../theme';
|
|
@@ -18,20 +18,52 @@ var HELP_NOTIFICATION_BADGE_ID = 'atlassian-navigation-help-notification-count';
|
|
|
18
18
|
*/
|
|
19
19
|
export var Help = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
20
20
|
var badge = props.badge,
|
|
21
|
+
component = props.component,
|
|
22
|
+
href = props.href,
|
|
23
|
+
id = props.id,
|
|
24
|
+
isDisabled = props.isDisabled,
|
|
25
|
+
isSelected = props.isSelected,
|
|
26
|
+
label = props.label,
|
|
27
|
+
onBlur = props.onBlur,
|
|
28
|
+
onClick = props.onClick,
|
|
29
|
+
onFocus = props.onFocus,
|
|
30
|
+
onMouseDown = props.onMouseDown,
|
|
31
|
+
onMouseEnter = props.onMouseEnter,
|
|
32
|
+
onMouseLeave = props.onMouseLeave,
|
|
33
|
+
onMouseUp = props.onMouseUp,
|
|
34
|
+
target = props.target,
|
|
35
|
+
testId = props.testId,
|
|
21
36
|
tooltip = props.tooltip,
|
|
22
|
-
|
|
37
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
23
38
|
var _useTheme = useTheme(),
|
|
24
39
|
navigation = _useTheme.mode.navigation;
|
|
25
40
|
var button = /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
41
|
+
component: component,
|
|
42
|
+
href: href,
|
|
26
43
|
icon: /*#__PURE__*/React.createElement(QuestionCircleIcon, {
|
|
27
44
|
label: typeof tooltip === 'string' ? tooltip : 'Help Icon',
|
|
28
45
|
color: "currentColor",
|
|
29
46
|
spacing: "spacious",
|
|
30
47
|
LEGACY_secondaryColor: navigation.backgroundColor
|
|
31
48
|
}),
|
|
49
|
+
id: id,
|
|
50
|
+
isDisabled: isDisabled,
|
|
51
|
+
isSelected: isSelected,
|
|
52
|
+
label: label,
|
|
53
|
+
onBlur: onBlur,
|
|
54
|
+
onClick: onClick,
|
|
55
|
+
onFocus: onFocus,
|
|
56
|
+
onMouseDown: onMouseDown,
|
|
57
|
+
onMouseEnter: onMouseEnter,
|
|
58
|
+
onMouseLeave: onMouseLeave,
|
|
59
|
+
onMouseUp: onMouseUp,
|
|
32
60
|
ref: ref,
|
|
61
|
+
target: target,
|
|
62
|
+
testId: testId,
|
|
33
63
|
tooltip: tooltip
|
|
34
|
-
|
|
64
|
+
// These are all explicit, leaving it in just in case
|
|
65
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
66
|
+
}, rest));
|
|
35
67
|
return badge ? /*#__PURE__*/React.createElement(BadgeContainer, {
|
|
36
68
|
id: HELP_NOTIFICATION_BADGE_ID,
|
|
37
69
|
badge: badge,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["icon", "label", "testId", "tooltip"];
|
|
3
|
+
var _excluded = ["icon", "label", "testId", "tooltip", "component", "href", "id", "isDisabled", "isSelected", "onBlur", "onClick", "onFocus", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseUp", "target", "theme"];
|
|
4
4
|
import React, { forwardRef } from 'react';
|
|
5
5
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
6
6
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -20,18 +20,47 @@ export var IconButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
20
20
|
label = props.label,
|
|
21
21
|
testId = props.testId,
|
|
22
22
|
tooltip = props.tooltip,
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
component = props.component,
|
|
24
|
+
href = props.href,
|
|
25
|
+
id = props.id,
|
|
26
|
+
isDisabled = props.isDisabled,
|
|
27
|
+
isSelected = props.isSelected,
|
|
28
|
+
onBlur = props.onBlur,
|
|
29
|
+
onClick = props.onClick,
|
|
30
|
+
onFocus = props.onFocus,
|
|
31
|
+
onMouseDown = props.onMouseDown,
|
|
32
|
+
onMouseEnter = props.onMouseEnter,
|
|
33
|
+
onMouseLeave = props.onMouseLeave,
|
|
34
|
+
onMouseUp = props.onMouseUp,
|
|
35
|
+
target = props.target,
|
|
36
|
+
theme = props.theme,
|
|
37
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
38
|
+
var themeFromContext = useTheme();
|
|
25
39
|
var button = /*#__PURE__*/React.createElement(Button, _extends({
|
|
26
40
|
appearance: "primary",
|
|
27
41
|
"aria-label": label,
|
|
28
|
-
|
|
42
|
+
component: component,
|
|
43
|
+
href: href,
|
|
29
44
|
iconBefore: icon,
|
|
30
|
-
|
|
31
|
-
|
|
45
|
+
id: id,
|
|
46
|
+
isDisabled: isDisabled,
|
|
47
|
+
isSelected: isSelected,
|
|
48
|
+
onBlur: onBlur,
|
|
49
|
+
onClick: onClick,
|
|
50
|
+
onFocus: onFocus,
|
|
51
|
+
onMouseDown: onMouseDown,
|
|
52
|
+
onMouseEnter: onMouseEnter,
|
|
53
|
+
onMouseLeave: onMouseLeave,
|
|
54
|
+
onMouseUp: onMouseUp,
|
|
55
|
+
ref: ref,
|
|
56
|
+
target: target,
|
|
57
|
+
testId: testId
|
|
58
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides, @atlaskit/design-system/no-unsafe-style-overrides
|
|
32
59
|
,
|
|
33
|
-
theme: getIconButtonTheme(
|
|
34
|
-
|
|
60
|
+
theme: theme || getIconButtonTheme(themeFromContext)
|
|
61
|
+
// These are all explicit, leaving it in just in case
|
|
62
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
63
|
+
}, rest));
|
|
35
64
|
if (tooltip) {
|
|
36
65
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
37
66
|
content: tooltip,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["badge", "tooltip"];
|
|
3
|
+
var _excluded = ["badge", "component", "href", "id", "isDisabled", "isSelected", "label", "onBlur", "onClick", "onFocus", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseUp", "target", "testId", "tooltip"];
|
|
4
4
|
import React, { forwardRef } from 'react';
|
|
5
5
|
import NotificationIcon from '@atlaskit/icon/core/migration/notification';
|
|
6
6
|
import { BadgeContainer } from '../BadgeContainer';
|
|
@@ -18,21 +18,53 @@ var NOTIFICATIONS_BADGE_ID = 'atlassian-navigation-notification-count';
|
|
|
18
18
|
*/
|
|
19
19
|
export var Notifications = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
20
20
|
var badge = props.badge,
|
|
21
|
+
component = props.component,
|
|
22
|
+
href = props.href,
|
|
23
|
+
id = props.id,
|
|
24
|
+
isDisabled = props.isDisabled,
|
|
25
|
+
isSelected = props.isSelected,
|
|
26
|
+
label = props.label,
|
|
27
|
+
onBlur = props.onBlur,
|
|
28
|
+
onClick = props.onClick,
|
|
29
|
+
onFocus = props.onFocus,
|
|
30
|
+
onMouseDown = props.onMouseDown,
|
|
31
|
+
onMouseEnter = props.onMouseEnter,
|
|
32
|
+
onMouseLeave = props.onMouseLeave,
|
|
33
|
+
onMouseUp = props.onMouseUp,
|
|
34
|
+
target = props.target,
|
|
35
|
+
testId = props.testId,
|
|
21
36
|
tooltip = props.tooltip,
|
|
22
|
-
|
|
37
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
23
38
|
return /*#__PURE__*/React.createElement(BadgeContainer, {
|
|
24
39
|
id: NOTIFICATIONS_BADGE_ID,
|
|
25
40
|
badge: badge,
|
|
26
41
|
role: "listitem"
|
|
27
42
|
}, /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
43
|
+
"aria-describedby": NOTIFICATIONS_BADGE_ID,
|
|
44
|
+
component: component,
|
|
45
|
+
href: href,
|
|
28
46
|
icon: /*#__PURE__*/React.createElement(NotificationIcon, {
|
|
29
47
|
spacing: "spacious",
|
|
30
48
|
color: "currentColor",
|
|
31
49
|
label: typeof tooltip === 'string' ? tooltip : 'Notification Icon'
|
|
32
50
|
}),
|
|
33
|
-
|
|
51
|
+
id: id,
|
|
52
|
+
isDisabled: isDisabled,
|
|
53
|
+
isSelected: isSelected,
|
|
54
|
+
label: label,
|
|
55
|
+
onBlur: onBlur,
|
|
56
|
+
onClick: onClick,
|
|
57
|
+
onFocus: onFocus,
|
|
58
|
+
onMouseDown: onMouseDown,
|
|
59
|
+
onMouseEnter: onMouseEnter,
|
|
60
|
+
onMouseLeave: onMouseLeave,
|
|
61
|
+
onMouseUp: onMouseUp,
|
|
34
62
|
ref: ref,
|
|
35
|
-
|
|
36
|
-
|
|
63
|
+
target: target,
|
|
64
|
+
testId: testId,
|
|
65
|
+
tooltip: tooltip
|
|
66
|
+
// These are all explicit, leaving it in just in case
|
|
67
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
68
|
+
}, rest)));
|
|
37
69
|
});
|
|
38
70
|
export default Notifications;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
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
|
-
var _excluded = ["children", "
|
|
4
|
+
var _excluded = ["children", "component", "isHighlighted", "isLoading", "isSelected", "onClick", "testId", "theme", "tooltip"];
|
|
5
5
|
/**
|
|
6
6
|
* @jsxRuntime classic
|
|
7
7
|
* @jsx jsx
|
|
@@ -53,29 +53,37 @@ var buttonHighlightedStyles = css({
|
|
|
53
53
|
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
54
54
|
*/
|
|
55
55
|
export var PrimaryButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
56
|
-
var _ref;
|
|
57
56
|
var children = props.children,
|
|
57
|
+
component = props.component,
|
|
58
|
+
isHighlighted = props.isHighlighted,
|
|
59
|
+
isLoading = props.isLoading,
|
|
60
|
+
isSelected = props.isSelected,
|
|
61
|
+
onClick = props.onClick,
|
|
58
62
|
testId = props.testId,
|
|
63
|
+
theme = props.theme,
|
|
59
64
|
tooltip = props.tooltip,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
buttonProps = _objectWithoutProperties(props, _excluded);
|
|
63
|
-
var theme = useTheme();
|
|
65
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
66
|
+
var themeFromContext = useTheme();
|
|
64
67
|
var button = jsx("div", {
|
|
65
68
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
66
|
-
style: (
|
|
69
|
+
style: _defineProperty(_defineProperty({}, VAR_BUTTON_SELECTED_COLOR, themeFromContext.mode.primaryButton.selected.color), VAR_BUTTON_SELECTED_BORDER_COLOR, themeFromContext.mode.primaryButton.selected.borderColor),
|
|
67
70
|
css: [buttonBaseStyles, isHighlighted && buttonHighlightedStyles],
|
|
68
71
|
role: "listitem",
|
|
69
72
|
"data-vc": "primary-button"
|
|
70
73
|
}, jsx(Button, _extends({
|
|
71
74
|
appearance: "primary",
|
|
72
|
-
|
|
75
|
+
component: component,
|
|
76
|
+
isLoading: isLoading,
|
|
77
|
+
isSelected: isSelected,
|
|
78
|
+
onClick: onClick,
|
|
73
79
|
ref: ref,
|
|
74
|
-
|
|
75
|
-
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
80
|
+
testId: testId
|
|
81
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides, @atlaskit/design-system/no-unsafe-style-overrides
|
|
76
82
|
,
|
|
77
|
-
theme: getPrimaryButtonTheme(
|
|
78
|
-
|
|
83
|
+
theme: theme || getPrimaryButtonTheme(themeFromContext)
|
|
84
|
+
// These are all explicit, leaving it in just in case
|
|
85
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
86
|
+
}, rest), children));
|
|
79
87
|
if (tooltip) {
|
|
80
88
|
return jsx(Tooltip, {
|
|
81
89
|
content: tooltip,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["component", "isHighlighted", "isLoading", "onClick", "testId", "theme", "tooltip"];
|
|
2
4
|
/**
|
|
3
5
|
* @jsxRuntime classic
|
|
4
6
|
* @jsx jsx
|
|
@@ -21,8 +23,19 @@ import { PrimaryButton } from '../PrimaryButton';
|
|
|
21
23
|
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
22
24
|
*/
|
|
23
25
|
export var PrimaryDropdownButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
26
|
+
var component = props.component,
|
|
27
|
+
isHighlighted = props.isHighlighted,
|
|
28
|
+
isLoading = props.isLoading,
|
|
29
|
+
onClick = props.onClick,
|
|
30
|
+
testId = props.testId,
|
|
31
|
+
theme = props.theme,
|
|
32
|
+
tooltip = props.tooltip,
|
|
33
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
24
34
|
return jsx(PrimaryButton, _extends({
|
|
25
|
-
|
|
35
|
+
component: component,
|
|
36
|
+
iconAfter:
|
|
37
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
38
|
+
fg('platform-component-visual-refresh') ? jsx(ChevronIcon, {
|
|
26
39
|
label: "",
|
|
27
40
|
color: "currentColor"
|
|
28
41
|
}) : jsx(ChevronIconMigration, {
|
|
@@ -30,7 +43,17 @@ export var PrimaryDropdownButton = /*#__PURE__*/forwardRef(function (props, ref)
|
|
|
30
43
|
color: "currentColor",
|
|
31
44
|
label: ""
|
|
32
45
|
}),
|
|
33
|
-
|
|
34
|
-
|
|
46
|
+
isHighlighted: isHighlighted,
|
|
47
|
+
isLoading: isLoading,
|
|
48
|
+
onClick: onClick,
|
|
49
|
+
ref: ref,
|
|
50
|
+
testId: testId
|
|
51
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
52
|
+
,
|
|
53
|
+
theme: theme,
|
|
54
|
+
tooltip: tooltip
|
|
55
|
+
// These are mostly explicit, leaving it in just in case
|
|
56
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
57
|
+
}, rest));
|
|
35
58
|
});
|
|
36
59
|
export default PrimaryDropdownButton;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
-
var _excluded = ["iconAlt", "iconUrl", "logoAlt", "
|
|
5
|
-
var _css3;
|
|
4
|
+
var _excluded = ["href", "iconAlt", "iconUrl", "logoAlt", "logoMaxWidth", "logoUrl", "onClick", "onMouseDown", "siteTitle", "testId"];
|
|
6
5
|
/**
|
|
7
6
|
* @jsxRuntime classic
|
|
8
7
|
* @jsx jsx
|
|
@@ -41,7 +40,7 @@ var productIconStyles = css(_defineProperty({
|
|
|
41
40
|
}, "@media (min-width: ".concat(PRODUCT_HOME_BREAKPOINT, "px)"), {
|
|
42
41
|
display: 'none'
|
|
43
42
|
}));
|
|
44
|
-
var productHomeButtonStyles = css((
|
|
43
|
+
var productHomeButtonStyles = css(_defineProperty(_defineProperty({
|
|
45
44
|
display: 'flex',
|
|
46
45
|
padding: "var(--ds-space-050, 4px)",
|
|
47
46
|
alignItems: 'center',
|
|
@@ -77,11 +76,11 @@ var productHomeButtonStyles = css((_css3 = {
|
|
|
77
76
|
'div&': {
|
|
78
77
|
pointerEvents: 'none'
|
|
79
78
|
}
|
|
80
|
-
},
|
|
79
|
+
}, "@media (max-width: ".concat(PRODUCT_HOME_BREAKPOINT - 0.1, "px)"), {
|
|
81
80
|
margin: "0 ".concat("var(--ds-space-100, 8px)")
|
|
82
|
-
}),
|
|
81
|
+
}), "@media (min-width: ".concat(PRODUCT_HOME_BREAKPOINT, "px)"), {
|
|
83
82
|
margin: "0 ".concat("var(--ds-space-200, 16px)")
|
|
84
|
-
})
|
|
83
|
+
}));
|
|
85
84
|
var siteTitleStyles = css({
|
|
86
85
|
display: 'flex',
|
|
87
86
|
alignItems: 'center',
|
|
@@ -99,18 +98,17 @@ var siteTitleStyles = css({
|
|
|
99
98
|
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
100
99
|
*/
|
|
101
100
|
var CustomProductHome = function CustomProductHome(props) {
|
|
102
|
-
var
|
|
103
|
-
|
|
101
|
+
var href = props.href,
|
|
102
|
+
iconAlt = props.iconAlt,
|
|
104
103
|
iconUrl = props.iconUrl,
|
|
105
104
|
logoAlt = props.logoAlt,
|
|
105
|
+
_props$logoMaxWidth = props.logoMaxWidth,
|
|
106
|
+
logoMaxWidth = _props$logoMaxWidth === void 0 ? 260 : _props$logoMaxWidth,
|
|
106
107
|
logoUrl = props.logoUrl,
|
|
107
|
-
href = props.href,
|
|
108
108
|
onClick = props.onClick,
|
|
109
|
-
siteTitle = props.siteTitle,
|
|
110
109
|
onMouseDown = props.onMouseDown,
|
|
110
|
+
siteTitle = props.siteTitle,
|
|
111
111
|
testId = props.testId,
|
|
112
|
-
_props$logoMaxWidth = props.logoMaxWidth,
|
|
113
|
-
logoMaxWidth = _props$logoMaxWidth === void 0 ? 260 : _props$logoMaxWidth,
|
|
114
112
|
rest = _objectWithoutProperties(props, _excluded);
|
|
115
113
|
var theme = useTheme();
|
|
116
114
|
var primaryButton = theme.mode.primaryButton;
|
|
@@ -119,7 +117,7 @@ var CustomProductHome = function CustomProductHome(props) {
|
|
|
119
117
|
event.preventDefault();
|
|
120
118
|
onMouseDown && onMouseDown(event);
|
|
121
119
|
};
|
|
122
|
-
var productHomeButtonDynamicStyles = (
|
|
120
|
+
var productHomeButtonDynamicStyles = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, 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);
|
|
123
121
|
return jsx(Fragment, null, jsx(Tag, _extends({
|
|
124
122
|
href: href
|
|
125
123
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
@@ -129,6 +127,8 @@ var CustomProductHome = function CustomProductHome(props) {
|
|
|
129
127
|
onClick: onClick,
|
|
130
128
|
onMouseDown: preventFocusRing,
|
|
131
129
|
"data-testid": testId && "".concat(testId, "-container")
|
|
130
|
+
// Currently all props are mapped, but leaving in case people are
|
|
131
|
+
// passing non-explicit props
|
|
132
132
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
133
133
|
}, rest), logoUrl && jsx("img", {
|
|
134
134
|
style: {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
-
var _excluded = ["
|
|
5
|
-
var _css;
|
|
4
|
+
var _excluded = ["aria-label", "href", "icon", "logo", "logoMaxWidth", "onClick", "onMouseDown", "siteTitle", "testId"];
|
|
6
5
|
/**
|
|
7
6
|
* @jsxRuntime classic
|
|
8
7
|
* @jsx jsx
|
|
@@ -25,7 +24,7 @@ var VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS = '--product-home-box-shadow-focus';
|
|
|
25
24
|
var VAR_PRODUCT_HOME_COLOR_HOVER = '--product-home-color-hover';
|
|
26
25
|
var VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER = '--product-home-bg-color-hover';
|
|
27
26
|
var VAR_PRODUCT_HOME_BOX_SHADOW_HOVER = '--product-home-box-shadow-hover';
|
|
28
|
-
var productHomeButtonStyles = css((
|
|
27
|
+
var productHomeButtonStyles = css(_defineProperty(_defineProperty({
|
|
29
28
|
display: 'flex',
|
|
30
29
|
padding: "var(--ds-space-050, 4px)",
|
|
31
30
|
alignItems: 'center',
|
|
@@ -61,11 +60,11 @@ var productHomeButtonStyles = css((_css = {
|
|
|
61
60
|
'div&': {
|
|
62
61
|
pointerEvents: 'none'
|
|
63
62
|
}
|
|
64
|
-
},
|
|
63
|
+
}, "@media (max-width: ".concat(PRODUCT_HOME_BREAKPOINT - 0.1, "px)"), {
|
|
65
64
|
margin: "0 ".concat("var(--ds-space-100, 8px)")
|
|
66
|
-
}),
|
|
65
|
+
}), "@media (min-width: ".concat(PRODUCT_HOME_BREAKPOINT, "px)"), {
|
|
67
66
|
margin: "0 ".concat("var(--ds-space-200, 16px)")
|
|
68
|
-
})
|
|
67
|
+
}));
|
|
69
68
|
var productLogoStyles = css(_defineProperty({
|
|
70
69
|
// Ensure anything passed into
|
|
71
70
|
// productHome is aligned correctly
|
|
@@ -116,17 +115,16 @@ var siteTitleStyles = css({
|
|
|
116
115
|
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
117
116
|
*/
|
|
118
117
|
var ProductHome = function ProductHome(_ref) {
|
|
119
|
-
var
|
|
120
|
-
|
|
118
|
+
var ariaLabel = _ref['aria-label'],
|
|
119
|
+
href = _ref.href,
|
|
120
|
+
Icon = _ref.icon,
|
|
121
121
|
Logo = _ref.logo,
|
|
122
|
-
|
|
122
|
+
_ref$logoMaxWidth = _ref.logoMaxWidth,
|
|
123
|
+
logoMaxWidth = _ref$logoMaxWidth === void 0 ? 260 : _ref$logoMaxWidth,
|
|
123
124
|
onClick = _ref.onClick,
|
|
124
|
-
href = _ref.href,
|
|
125
125
|
onMouseDown = _ref.onMouseDown,
|
|
126
|
+
siteTitle = _ref.siteTitle,
|
|
126
127
|
testId = _ref.testId,
|
|
127
|
-
_ref$logoMaxWidth = _ref.logoMaxWidth,
|
|
128
|
-
logoMaxWidth = _ref$logoMaxWidth === void 0 ? 260 : _ref$logoMaxWidth,
|
|
129
|
-
ariaLabel = _ref['aria-label'],
|
|
130
128
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
131
129
|
var theme = useTheme();
|
|
132
130
|
var primaryButton = theme.mode.primaryButton;
|
|
@@ -140,7 +138,7 @@ var ProductHome = function ProductHome(_ref) {
|
|
|
140
138
|
e.preventDefault();
|
|
141
139
|
onMouseDown && onMouseDown(e);
|
|
142
140
|
};
|
|
143
|
-
var productHomeButtonDynamicStyles = stripEmptyProperties((
|
|
141
|
+
var productHomeButtonDynamicStyles = stripEmptyProperties(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, 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), VAR_LOGO_MAX_WIDTH, "".concat(logoMaxWidth, "px")));
|
|
144
142
|
return jsx(Fragment, null, jsx(Tag
|
|
145
143
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
146
144
|
, _extends({
|
|
@@ -151,6 +149,7 @@ var ProductHome = function ProductHome(_ref) {
|
|
|
151
149
|
onMouseDown: preventFocusRing,
|
|
152
150
|
"data-testid": testId && "".concat(testId, "-container"),
|
|
153
151
|
"aria-label": ariaLabel
|
|
152
|
+
// Made all props explicit, leaving just in case
|
|
154
153
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
155
154
|
}, rest), jsx("div", {
|
|
156
155
|
css: [customMaxHeightStyles, productLogoStyles],
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
var _css;
|
|
3
2
|
/**
|
|
4
3
|
* @jsxRuntime classic
|
|
5
4
|
* @jsx jsx
|
|
@@ -22,7 +21,7 @@ var VAR_PRODUCT_HOME_COLOR_HOVER = '--product-home-color-hover';
|
|
|
22
21
|
var VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER = '--product-home-bg-color-hover';
|
|
23
22
|
var VAR_PRODUCT_HOME_BOX_SHADOW_HOVER = '--product-home-box-shadow-hover';
|
|
24
23
|
var VAR_SITE_TITLE_BG_COLOR_AFTER = '--site-title-bg-color-after';
|
|
25
|
-
var productHomeButtonStyles = css((
|
|
24
|
+
var productHomeButtonStyles = css(_defineProperty(_defineProperty({
|
|
26
25
|
display: 'flex',
|
|
27
26
|
padding: "var(--ds-space-050, 4px)",
|
|
28
27
|
alignItems: 'center',
|
|
@@ -59,11 +58,11 @@ var productHomeButtonStyles = css((_css = {
|
|
|
59
58
|
'div&': {
|
|
60
59
|
pointerEvents: 'none'
|
|
61
60
|
}
|
|
62
|
-
},
|
|
61
|
+
}, "@media (max-width: ".concat(PRODUCT_HOME_BREAKPOINT - 0.1, "px)"), {
|
|
63
62
|
margin: "0 ".concat("var(--ds-space-100, 8px)")
|
|
64
|
-
}),
|
|
63
|
+
}), "@media (min-width: ".concat(PRODUCT_HOME_BREAKPOINT, "px)"), {
|
|
65
64
|
margin: "0 ".concat("var(--ds-space-200, 16px)")
|
|
66
|
-
})
|
|
65
|
+
}));
|
|
67
66
|
var productLogoStyles = css(_defineProperty({
|
|
68
67
|
display: 'flex',
|
|
69
68
|
width: 120,
|
|
@@ -112,11 +111,10 @@ var siteTitleStyles = css({
|
|
|
112
111
|
// Not exported to consumers, only used in NavigationSkeleton
|
|
113
112
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
114
113
|
export var ProductHomeSkeleton = function ProductHomeSkeleton(_ref) {
|
|
115
|
-
var _stripEmptyProperties;
|
|
116
114
|
var showSiteName = _ref.showSiteName;
|
|
117
115
|
var theme = useTheme();
|
|
118
116
|
var primaryButton = theme.mode.primaryButton;
|
|
119
|
-
var productHomeButtonDynamicStyles = stripEmptyProperties((
|
|
117
|
+
var productHomeButtonDynamicStyles = stripEmptyProperties(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, 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), VAR_SITE_TITLE_BG_COLOR_AFTER, theme.mode.skeleton.backgroundColor));
|
|
120
118
|
var siteTitleDynamicStyles = _defineProperty({
|
|
121
119
|
borderRight: theme.mode.productHome.borderRight,
|
|
122
120
|
opacity: theme.mode.skeleton.opacity
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["component", "href", "icon", "id", "isDisabled", "isSelected", "label", "onBlur", "onClick", "onFocus", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseUp", "target", "testId", "theme", "tooltip"];
|
|
2
4
|
import React, { forwardRef } from 'react';
|
|
3
5
|
import { IconButton } from '../IconButton';
|
|
4
6
|
/**
|
|
@@ -11,20 +13,53 @@ import { IconButton } from '../IconButton';
|
|
|
11
13
|
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
12
14
|
*/
|
|
13
15
|
export var Profile = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
+
var component = props.component,
|
|
17
|
+
href = props.href,
|
|
18
|
+
icon = props.icon,
|
|
19
|
+
id = props.id,
|
|
20
|
+
isDisabled = props.isDisabled,
|
|
21
|
+
isSelected = props.isSelected,
|
|
22
|
+
labelProp = props.label,
|
|
23
|
+
onBlur = props.onBlur,
|
|
24
|
+
onClick = props.onClick,
|
|
25
|
+
onFocus = props.onFocus,
|
|
26
|
+
onMouseDown = props.onMouseDown,
|
|
27
|
+
onMouseEnter = props.onMouseEnter,
|
|
28
|
+
onMouseLeave = props.onMouseLeave,
|
|
29
|
+
onMouseUp = props.onMouseUp,
|
|
30
|
+
target = props.target,
|
|
31
|
+
testId = props.testId,
|
|
32
|
+
theme = props.theme,
|
|
33
|
+
tooltip = props.tooltip,
|
|
34
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
16
35
|
var label = labelProp || (typeof tooltip === 'string' ? tooltip : 'Your profile and settings');
|
|
17
|
-
|
|
18
|
-
// All other implementations of IconButton within the components are using spread props, so
|
|
19
|
-
// to use explicit props could cause regressions.
|
|
20
|
-
// TODO: Remove these spread props for better static analysis
|
|
21
|
-
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
22
36
|
return /*#__PURE__*/React.createElement("div", {
|
|
23
37
|
role: "listitem"
|
|
24
38
|
}, /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
39
|
+
component: component,
|
|
40
|
+
href: href,
|
|
41
|
+
icon: icon,
|
|
42
|
+
id: id,
|
|
43
|
+
isDisabled: isDisabled,
|
|
44
|
+
isSelected: isSelected,
|
|
25
45
|
label: label,
|
|
26
|
-
|
|
27
|
-
|
|
46
|
+
onBlur: onBlur,
|
|
47
|
+
onClick: onClick,
|
|
48
|
+
onFocus: onFocus,
|
|
49
|
+
onMouseDown: onMouseDown,
|
|
50
|
+
onMouseEnter: onMouseEnter,
|
|
51
|
+
onMouseLeave: onMouseLeave,
|
|
52
|
+
onMouseUp: onMouseUp,
|
|
53
|
+
ref: ref,
|
|
54
|
+
target: target,
|
|
55
|
+
testId: testId
|
|
56
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
57
|
+
,
|
|
58
|
+
theme: theme,
|
|
59
|
+
tooltip: tooltip
|
|
60
|
+
// These are mostly explicit, leaving it in just in case
|
|
61
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
62
|
+
}, rest)));
|
|
28
63
|
});
|
|
29
64
|
|
|
30
65
|
// This exists only to extract props.
|