@atlaskit/atlassian-navigation 2.3.4 → 2.4.0
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 +17 -0
- package/dist/cjs/common/constants.js +0 -2
- 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 +16 -33
- package/dist/cjs/components/ProductHome/index.js +0 -3
- package/dist/cjs/components/ProductHome/product-home.js +22 -39
- 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 +12 -29
- 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 +5 -8
- package/dist/cjs/theme/index.js +0 -5
- package/dist/cjs/theme/theme-generator.js +8 -22
- 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/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 +5 -10
- package/dist/es2019/components/ProductHome/product-home.js +5 -10
- 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 +5 -10
- 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 +5 -5
- package/dist/es2019/theme/theme-generator.js +7 -9
- 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/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 +16 -24
- package/dist/esm/components/ProductHome/product-home.js +22 -30
- 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 +12 -19
- 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 +5 -5
- package/dist/esm/theme/theme-generator.js +8 -15
- 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/theme/types.d.ts +1 -6
- package/package.json +9 -8
- package/report.api.md +14 -8
|
@@ -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({
|
|
@@ -2,9 +2,7 @@ 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
4
|
var _excluded = ["iconAlt", "iconUrl", "logoAlt", "logoUrl", "href", "onClick", "siteTitle", "onMouseDown", "testId", "logoMaxWidth"];
|
|
5
|
-
|
|
6
5
|
var _css3;
|
|
7
|
-
|
|
8
6
|
/** @jsx jsx */
|
|
9
7
|
import { Fragment } from 'react';
|
|
10
8
|
import { css, jsx } from '@emotion/react';
|
|
@@ -62,11 +60,10 @@ var productHomeButtonStyles = css((_css3 = {
|
|
|
62
60
|
boxShadow: "var(".concat(VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE, ")"),
|
|
63
61
|
color: "var(".concat(VAR_PRODUCT_HOME_COLOR_ACTIVE, ")")
|
|
64
62
|
},
|
|
65
|
-
'&:focus': {
|
|
63
|
+
'&:focus-visible': {
|
|
66
64
|
backgroundColor: "var(".concat(VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS, ")"),
|
|
67
|
-
boxShadow: "var(".concat(VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS, ")"),
|
|
68
65
|
color: "var(".concat(VAR_PRODUCT_HOME_COLOR_FOCUS, ")"),
|
|
69
|
-
outline:
|
|
66
|
+
outline: "2px solid ".concat("var(--ds-border-focused, #4C9AFF)")
|
|
70
67
|
},
|
|
71
68
|
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
72
69
|
'div&': {
|
|
@@ -84,6 +81,7 @@ var siteTitleStyles = css({
|
|
|
84
81
|
paddingRight: gridSize * 2,
|
|
85
82
|
alignItems: 'center'
|
|
86
83
|
});
|
|
84
|
+
|
|
87
85
|
/**
|
|
88
86
|
* __Custom product home__
|
|
89
87
|
*
|
|
@@ -92,32 +90,27 @@ var siteTitleStyles = css({
|
|
|
92
90
|
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#custom-product-home)
|
|
93
91
|
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
94
92
|
*/
|
|
95
|
-
|
|
96
93
|
var CustomProductHome = function CustomProductHome(props) {
|
|
97
94
|
var _productHomeButtonDyn;
|
|
98
|
-
|
|
99
95
|
var iconAlt = props.iconAlt,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
96
|
+
iconUrl = props.iconUrl,
|
|
97
|
+
logoAlt = props.logoAlt,
|
|
98
|
+
logoUrl = props.logoUrl,
|
|
99
|
+
href = props.href,
|
|
100
|
+
onClick = props.onClick,
|
|
101
|
+
siteTitle = props.siteTitle,
|
|
102
|
+
onMouseDown = props.onMouseDown,
|
|
103
|
+
testId = props.testId,
|
|
104
|
+
_props$logoMaxWidth = props.logoMaxWidth,
|
|
105
|
+
logoMaxWidth = _props$logoMaxWidth === void 0 ? 260 : _props$logoMaxWidth,
|
|
106
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
112
107
|
var theme = useTheme();
|
|
113
108
|
var primaryButton = theme.mode.primaryButton;
|
|
114
109
|
var Tag = getTag(onClick, href);
|
|
115
|
-
|
|
116
110
|
var preventFocusRing = function preventFocusRing(event) {
|
|
117
111
|
event.preventDefault();
|
|
118
112
|
onMouseDown && onMouseDown(event);
|
|
119
113
|
};
|
|
120
|
-
|
|
121
114
|
var productHomeButtonDynamicStyles = (_productHomeButtonDyn = {}, _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_COLOR_ACTIVE, primaryButton.active.color), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE, primaryButton.active.backgroundColor), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE, primaryButton.active.boxShadow), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_COLOR_FOCUS, primaryButton.focus.color), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS, primaryButton.focus.backgroundColor), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS, primaryButton.focus.boxShadow), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_COLOR_HOVER, primaryButton.hover.color), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER, primaryButton.hover.backgroundColor), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_BOX_SHADOW_HOVER, primaryButton.hover.boxShadow), _productHomeButtonDyn);
|
|
122
115
|
return jsx(Fragment, null, jsx(Tag, _extends({
|
|
123
116
|
href: href,
|
|
@@ -125,8 +118,8 @@ var CustomProductHome = function CustomProductHome(props) {
|
|
|
125
118
|
css: productHomeButtonStyles,
|
|
126
119
|
onClick: onClick,
|
|
127
120
|
onMouseDown: preventFocusRing,
|
|
128
|
-
"data-testid": testId && "".concat(testId, "-container")
|
|
129
|
-
|
|
121
|
+
"data-testid": testId && "".concat(testId, "-container")
|
|
122
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
130
123
|
}, rest), logoUrl && jsx("img", {
|
|
131
124
|
style: {
|
|
132
125
|
maxWidth: logoMaxWidth
|
|
@@ -151,5 +144,4 @@ var CustomProductHome = function CustomProductHome(props) {
|
|
|
151
144
|
"data-testid": testId && "".concat(testId, "-site-title")
|
|
152
145
|
}, siteTitle));
|
|
153
146
|
};
|
|
154
|
-
|
|
155
147
|
export default CustomProductHome;
|