@atlaskit/atlassian-navigation 2.2.4 → 2.2.7
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 +19 -0
- package/dist/cjs/components/AppSwitcher/index.js +10 -0
- package/dist/cjs/components/AtlassianNavigation/index.js +10 -1
- package/dist/cjs/components/AtlassianNavigation/skeleton.js +13 -0
- package/dist/cjs/components/BadgeContainer/index.js +2 -1
- package/dist/cjs/components/Create/index.js +14 -2
- package/dist/cjs/components/Create/skeleton.js +2 -1
- package/dist/cjs/components/Help/index.js +9 -0
- package/dist/cjs/components/IconButton/index.js +11 -1
- package/dist/cjs/components/IconButton/skeleton.js +2 -1
- package/dist/cjs/components/Notifications/index.js +10 -0
- package/dist/cjs/components/PrimaryButton/index.js +12 -1
- package/dist/cjs/components/PrimaryButton/skeleton.js +6 -8
- package/dist/cjs/components/PrimaryDropdownButton/index.js +10 -0
- package/dist/cjs/components/PrimaryItemsContainer/index.js +2 -1
- package/dist/cjs/components/PrimaryItemsContainer/skeleton.js +2 -1
- package/dist/cjs/components/ProductHome/custom-product-home.js +10 -1
- package/dist/cjs/components/ProductHome/product-home.js +14 -3
- package/dist/cjs/components/ProductHome/skeleton.js +2 -1
- package/dist/cjs/components/Profile/index.js +10 -0
- package/dist/cjs/components/Profile/skeleton.js +2 -0
- package/dist/cjs/components/Search/index.js +11 -1
- package/dist/cjs/components/Search/skeleton.js +2 -1
- package/dist/cjs/components/Settings/index.js +8 -0
- package/dist/cjs/components/SignIn/index.js +10 -1
- package/dist/cjs/components/SignIn/skeleton.js +2 -0
- package/dist/cjs/components/SkeletonCreateButton/index.js +12 -1
- package/dist/cjs/components/SkeletonIconButton/index.js +12 -1
- package/dist/cjs/components/SkeletonPrimaryButton/index.js +11 -0
- package/dist/cjs/controllers/overflow/index.js +14 -5
- package/dist/cjs/skeleton-help-button.js +10 -0
- package/dist/cjs/skeleton-notification-button.js +10 -0
- package/dist/cjs/skeleton-settings-button.js +10 -0
- package/dist/cjs/skeleton-switcher-button.js +10 -0
- package/dist/cjs/theme/{defaultTheme.js → default-theme.js} +1 -1
- package/dist/cjs/theme/index.js +5 -5
- package/dist/cjs/theme/{themeGenerator.js → theme-generator.js} +4 -3
- package/dist/cjs/theme/{themeHelpers.js → theme-helpers.js} +0 -0
- package/dist/cjs/theme/{ThemeProvider.js → theme-provider.js} +8 -0
- package/dist/cjs/theme/themes.js +2 -2
- package/dist/cjs/theme/{useTheme.js → use-theme.js} +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/AppSwitcher/index.js +11 -0
- package/dist/es2019/components/AtlassianNavigation/index.js +11 -1
- package/dist/es2019/components/AtlassianNavigation/skeleton.js +14 -0
- package/dist/es2019/components/BadgeContainer/index.js +3 -1
- package/dist/es2019/components/Create/index.js +14 -2
- package/dist/es2019/components/Create/skeleton.js +3 -1
- package/dist/es2019/components/Help/index.js +9 -0
- package/dist/es2019/components/IconButton/index.js +12 -1
- package/dist/es2019/components/IconButton/skeleton.js +3 -1
- package/dist/es2019/components/Notifications/index.js +10 -0
- package/dist/es2019/components/PrimaryButton/index.js +12 -1
- package/dist/es2019/components/PrimaryButton/skeleton.js +7 -6
- package/dist/es2019/components/PrimaryDropdownButton/index.js +10 -0
- package/dist/es2019/components/PrimaryItemsContainer/index.js +3 -1
- package/dist/es2019/components/PrimaryItemsContainer/skeleton.js +3 -1
- package/dist/es2019/components/ProductHome/custom-product-home.js +10 -1
- package/dist/es2019/components/ProductHome/product-home.js +14 -3
- package/dist/es2019/components/ProductHome/skeleton.js +3 -1
- package/dist/es2019/components/Profile/index.js +11 -0
- package/dist/es2019/components/Profile/skeleton.js +3 -1
- package/dist/es2019/components/Search/index.js +11 -1
- package/dist/es2019/components/Search/skeleton.js +3 -1
- package/dist/es2019/components/Settings/index.js +9 -0
- package/dist/es2019/components/SignIn/index.js +11 -1
- package/dist/es2019/components/SignIn/skeleton.js +3 -1
- package/dist/es2019/components/SkeletonCreateButton/index.js +13 -1
- package/dist/es2019/components/SkeletonIconButton/index.js +13 -1
- package/dist/es2019/components/SkeletonPrimaryButton/index.js +12 -0
- package/dist/es2019/controllers/overflow/index.js +12 -3
- package/dist/es2019/skeleton-help-button.js +11 -0
- package/dist/es2019/skeleton-notification-button.js +11 -0
- package/dist/es2019/skeleton-settings-button.js +11 -0
- package/dist/es2019/skeleton-switcher-button.js +11 -0
- package/dist/es2019/theme/{defaultTheme.js → default-theme.js} +1 -1
- package/dist/es2019/theme/index.js +4 -4
- package/dist/es2019/theme/{themeGenerator.js → theme-generator.js} +4 -3
- package/dist/es2019/theme/{themeHelpers.js → theme-helpers.js} +0 -0
- package/dist/es2019/theme/theme-provider.js +12 -0
- package/dist/es2019/theme/themes.js +2 -2
- package/dist/es2019/theme/use-theme.js +3 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/AppSwitcher/index.js +11 -0
- package/dist/esm/components/AtlassianNavigation/index.js +11 -1
- package/dist/esm/components/AtlassianNavigation/skeleton.js +14 -0
- package/dist/esm/components/BadgeContainer/index.js +3 -1
- package/dist/esm/components/Create/index.js +14 -2
- package/dist/esm/components/Create/skeleton.js +3 -1
- package/dist/esm/components/Help/index.js +9 -0
- package/dist/esm/components/IconButton/index.js +12 -1
- package/dist/esm/components/IconButton/skeleton.js +3 -1
- package/dist/esm/components/Notifications/index.js +10 -0
- package/dist/esm/components/PrimaryButton/index.js +12 -1
- package/dist/esm/components/PrimaryButton/skeleton.js +7 -6
- package/dist/esm/components/PrimaryDropdownButton/index.js +10 -0
- package/dist/esm/components/PrimaryItemsContainer/index.js +3 -1
- package/dist/esm/components/PrimaryItemsContainer/skeleton.js +3 -1
- package/dist/esm/components/ProductHome/custom-product-home.js +10 -1
- package/dist/esm/components/ProductHome/product-home.js +14 -3
- package/dist/esm/components/ProductHome/skeleton.js +3 -1
- package/dist/esm/components/Profile/index.js +11 -0
- package/dist/esm/components/Profile/skeleton.js +3 -1
- package/dist/esm/components/Search/index.js +11 -1
- package/dist/esm/components/Search/skeleton.js +3 -1
- package/dist/esm/components/Settings/index.js +9 -0
- package/dist/esm/components/SignIn/index.js +11 -1
- package/dist/esm/components/SignIn/skeleton.js +3 -1
- package/dist/esm/components/SkeletonCreateButton/index.js +13 -1
- package/dist/esm/components/SkeletonIconButton/index.js +13 -1
- package/dist/esm/components/SkeletonPrimaryButton/index.js +12 -0
- package/dist/esm/controllers/overflow/index.js +12 -3
- package/dist/esm/skeleton-help-button.js +11 -0
- package/dist/esm/skeleton-notification-button.js +11 -0
- package/dist/esm/skeleton-settings-button.js +11 -0
- package/dist/esm/skeleton-switcher-button.js +11 -0
- package/dist/esm/theme/{defaultTheme.js → default-theme.js} +1 -1
- package/dist/esm/theme/index.js +4 -4
- package/dist/esm/theme/{themeGenerator.js → theme-generator.js} +4 -3
- package/dist/esm/theme/{themeHelpers.js → theme-helpers.js} +0 -0
- package/dist/esm/theme/theme-provider.js +12 -0
- package/dist/esm/theme/themes.js +2 -2
- package/dist/esm/theme/{useTheme.js → use-theme.js} +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/components/AppSwitcher/index.d.ts +9 -0
- package/dist/types/components/AtlassianNavigation/index.d.ts +8 -0
- package/dist/types/components/AtlassianNavigation/skeleton.d.ts +13 -0
- package/dist/types/components/Create/index.d.ts +9 -0
- package/dist/types/components/Create/types.d.ts +2 -2
- package/dist/types/components/Help/index.d.ts +8 -0
- package/dist/types/components/IconButton/index.d.ts +9 -0
- package/dist/types/components/IconButton/types.d.ts +14 -14
- package/dist/types/components/Notifications/index.d.ts +9 -0
- package/dist/types/components/PrimaryButton/index.d.ts +9 -0
- package/dist/types/components/PrimaryButton/types.d.ts +14 -14
- package/dist/types/components/PrimaryDropdownButton/index.d.ts +9 -0
- package/dist/types/components/ProductHome/custom-product-home.d.ts +8 -0
- package/dist/types/components/ProductHome/product-home.d.ts +11 -0
- package/dist/types/components/Profile/index.d.ts +9 -0
- package/dist/types/components/Search/index.d.ts +8 -0
- package/dist/types/components/Settings/index.d.ts +8 -0
- package/dist/types/components/SignIn/index.d.ts +8 -0
- package/dist/types/components/SkeletonCreateButton/index.d.ts +10 -0
- package/dist/types/components/SkeletonIconButton/index.d.ts +10 -0
- package/dist/types/components/SkeletonPrimaryButton/index.d.ts +10 -0
- package/dist/types/controllers/overflow/index.d.ts +18 -5
- package/dist/types/skeleton-help-button.d.ts +10 -0
- package/dist/types/skeleton-notification-button.d.ts +10 -0
- package/dist/types/skeleton-settings-button.d.ts +10 -0
- package/dist/types/skeleton-switcher-button.d.ts +10 -0
- package/dist/types/theme/{defaultTheme.d.ts → default-theme.d.ts} +0 -0
- package/dist/types/theme/index.d.ts +4 -4
- package/dist/types/theme/{themeGenerator.d.ts → theme-generator.d.ts} +0 -0
- package/dist/types/theme/{themeHelpers.d.ts → theme-helpers.d.ts} +0 -0
- package/dist/types/theme/{ThemeProvider.d.ts → theme-provider.d.ts} +5 -0
- package/dist/types/theme/{useTheme.d.ts → use-theme.d.ts} +0 -0
- package/docs/01-intro.tsx +2 -2
- package/docs/02-atlassian-navigation.tsx +2 -2
- package/docs/03-product-home.tsx +4 -4
- package/docs/04-app-switcher.tsx +2 -2
- package/docs/05-create.tsx +4 -4
- package/docs/06-primary-actions.tsx +4 -4
- package/docs/07-secondary-actions.tsx +2 -2
- package/docs/97-theming.tsx +1 -1
- package/package.json +6 -4
- package/dist/es2019/theme/ThemeProvider.js +0 -4
- package/dist/es2019/theme/useTheme.js +0 -3
- package/dist/esm/theme/ThemeProvider.js +0 -4
|
@@ -29,7 +29,9 @@ var widthObserverContainerStyles = css({
|
|
|
29
29
|
margin: '0px',
|
|
30
30
|
position: 'relative',
|
|
31
31
|
flexShrink: 1
|
|
32
|
-
});
|
|
32
|
+
}); // Internal only
|
|
33
|
+
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
34
|
+
|
|
33
35
|
export var PrimaryItemsContainer = function PrimaryItemsContainer(_ref) {
|
|
34
36
|
var moreLabel = _ref.moreLabel,
|
|
35
37
|
items = _ref.items,
|
|
@@ -6,7 +6,9 @@ import { PrimaryButtonSkeleton } from '../PrimaryButton/skeleton';
|
|
|
6
6
|
var primaryButtonSkeletonStyles = css({
|
|
7
7
|
marginRight: gridSize * 1.5,
|
|
8
8
|
marginLeft: gridSize * 1.5
|
|
9
|
-
});
|
|
9
|
+
}); // Internal only
|
|
10
|
+
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
11
|
+
|
|
10
12
|
export var PrimaryItemsContainerSkeleton = function PrimaryItemsContainerSkeleton(_ref) {
|
|
11
13
|
var count = _ref.count;
|
|
12
14
|
return jsx(Fragment, null, Array.from({
|
|
@@ -84,6 +84,14 @@ var siteTitleStyles = css({
|
|
|
84
84
|
paddingRight: gridSize * 2,
|
|
85
85
|
alignItems: 'center'
|
|
86
86
|
});
|
|
87
|
+
/**
|
|
88
|
+
* __Custom product home__
|
|
89
|
+
*
|
|
90
|
+
* Use `CustomProductHome` to provide a custom logo and icon with URLs.
|
|
91
|
+
*
|
|
92
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#custom-product-home)
|
|
93
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
94
|
+
*/
|
|
87
95
|
|
|
88
96
|
var CustomProductHome = function CustomProductHome(props) {
|
|
89
97
|
var _productHomeButtonDyn;
|
|
@@ -117,7 +125,8 @@ var CustomProductHome = function CustomProductHome(props) {
|
|
|
117
125
|
css: productHomeButtonStyles,
|
|
118
126
|
onClick: onClick,
|
|
119
127
|
onMouseDown: preventFocusRing,
|
|
120
|
-
"data-testid": testId && "".concat(testId, "-container")
|
|
128
|
+
"data-testid": testId && "".concat(testId, "-container") // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
129
|
+
|
|
121
130
|
}, rest), logoUrl && jsx("img", {
|
|
122
131
|
style: {
|
|
123
132
|
maxWidth: logoMaxWidth
|
|
@@ -68,12 +68,11 @@ var productLogoStyles = css(_defineProperty({
|
|
|
68
68
|
maxWidth: "var(".concat(VAR_LOGO_MAX_WIDTH, ")"),
|
|
69
69
|
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
70
70
|
'& > *': {
|
|
71
|
-
maxWidth: "var(".concat(VAR_LOGO_MAX_WIDTH, ")"),
|
|
72
71
|
maxHeight: 24
|
|
73
72
|
},
|
|
74
73
|
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
75
74
|
'& > span > svg': {
|
|
76
|
-
|
|
75
|
+
maxWidth: "var(".concat(VAR_LOGO_MAX_WIDTH, ")")
|
|
77
76
|
}
|
|
78
77
|
}, "@media (max-width: ".concat(PRODUCT_HOME_BREAKPOINT - 0.1, "px)"), {
|
|
79
78
|
display: 'none'
|
|
@@ -99,6 +98,17 @@ var siteTitleStyles = css({
|
|
|
99
98
|
paddingRight: gridSize * 2,
|
|
100
99
|
alignItems: 'center'
|
|
101
100
|
});
|
|
101
|
+
/**
|
|
102
|
+
* __Product home__
|
|
103
|
+
*
|
|
104
|
+
* The ProductHome component displays the product visual identity composed of:
|
|
105
|
+
* logo, icon, and optional text. Values for logo and icon are never displayed
|
|
106
|
+
* at the same time, where icon is used only when space is restricted. Should be
|
|
107
|
+
* passed into `AtlassianNavigation`'s `renderProductHome` prop.
|
|
108
|
+
*
|
|
109
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#product-home)
|
|
110
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
111
|
+
*/
|
|
102
112
|
|
|
103
113
|
var ProductHome = function ProductHome(_ref) {
|
|
104
114
|
var _productHomeButtonDyn;
|
|
@@ -139,7 +149,8 @@ var ProductHome = function ProductHome(_ref) {
|
|
|
139
149
|
href: href,
|
|
140
150
|
onClick: onClick,
|
|
141
151
|
onMouseDown: preventFocusRing,
|
|
142
|
-
"data-testid": testId && "".concat(testId, "-container")
|
|
152
|
+
"data-testid": testId && "".concat(testId, "-container") // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
153
|
+
|
|
143
154
|
}, rest), jsx("div", {
|
|
144
155
|
css: [customMaxHeightStyles, productLogoStyles],
|
|
145
156
|
"data-testid": testId && "".concat(testId, "-logo")
|
|
@@ -99,7 +99,9 @@ var siteTitleStyles = css({
|
|
|
99
99
|
borderRadius: 4,
|
|
100
100
|
content: '""'
|
|
101
101
|
}
|
|
102
|
-
});
|
|
102
|
+
}); // Not exported to consumers, only used in NavigationSkeleton
|
|
103
|
+
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
104
|
+
|
|
103
105
|
export var ProductHomeSkeleton = function ProductHomeSkeleton(_ref) {
|
|
104
106
|
var _productHomeButtonDyn;
|
|
105
107
|
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { IconButton } from '../IconButton';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* __Profile__
|
|
5
|
+
*
|
|
6
|
+
* A profile button which takes an icon/avatar component can be that can be
|
|
7
|
+
* passed into `AtlassianNavigation`'s `renderProfile` prop.
|
|
8
|
+
*
|
|
9
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#profile)
|
|
10
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
11
|
+
*/
|
|
2
12
|
export var Profile = IconButton; // This exists only to extract props.
|
|
13
|
+
// eslint-disable-next-line @repo/internal/react/use-noop
|
|
3
14
|
|
|
4
15
|
export default (function (props) {});
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
3
|
-
import { IconButtonSkeleton } from '../IconButton/skeleton';
|
|
3
|
+
import { IconButtonSkeleton } from '../IconButton/skeleton'; // Not exported to consumers, only used in NavigationSkeleton
|
|
4
|
+
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
5
|
+
|
|
4
6
|
export var ProfileSkeleton = function ProfileSkeleton() {
|
|
5
7
|
return /*#__PURE__*/React.createElement(IconButtonSkeleton, {
|
|
6
8
|
marginLeft: 6,
|
|
@@ -85,6 +85,15 @@ var SearchComponent = function SearchComponent(props) {
|
|
|
85
85
|
value: value
|
|
86
86
|
}));
|
|
87
87
|
};
|
|
88
|
+
/**
|
|
89
|
+
* __Search__
|
|
90
|
+
*
|
|
91
|
+
* A search input that can be passed into `AtlassianNavigation`'s `renderSearch` prop.
|
|
92
|
+
*
|
|
93
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#search)
|
|
94
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
95
|
+
*/
|
|
96
|
+
|
|
88
97
|
|
|
89
98
|
export var Search = function Search(props) {
|
|
90
99
|
var placeholder = props.placeholder,
|
|
@@ -103,7 +112,8 @@ export var Search = function Search(props) {
|
|
|
103
112
|
icon: jsx(SearchIcon, {
|
|
104
113
|
label: label
|
|
105
114
|
}),
|
|
106
|
-
tooltip: tooltip
|
|
115
|
+
tooltip: tooltip // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
116
|
+
|
|
107
117
|
}, iconButtonProps)));
|
|
108
118
|
};
|
|
109
119
|
export default Search;
|
|
@@ -23,7 +23,9 @@ var searchInputSkeletonStyles = css({
|
|
|
23
23
|
});
|
|
24
24
|
var searchIconStyles = css(_defineProperty({}, "@media (min-width: ".concat(CREATE_BREAKPOINT, "px)"), {
|
|
25
25
|
display: 'none !important'
|
|
26
|
-
}));
|
|
26
|
+
})); // Not exported to consumers, only used in NavigationSkeleton
|
|
27
|
+
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
28
|
+
|
|
27
29
|
export var SearchSkeleton = function SearchSkeleton() {
|
|
28
30
|
var theme = useTheme();
|
|
29
31
|
return jsx(Fragment, null, jsx("div", {
|
|
@@ -4,6 +4,15 @@ var _excluded = ["tooltip"];
|
|
|
4
4
|
import React, { forwardRef } from 'react';
|
|
5
5
|
import SettingsIcon from '@atlaskit/icon/glyph/settings';
|
|
6
6
|
import { IconButton } from '../IconButton';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* __Settings__
|
|
10
|
+
*
|
|
11
|
+
* A settings button that can be passed into `AtlassianNavigation`'s `renderSettings` prop.
|
|
12
|
+
*
|
|
13
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#settings)
|
|
14
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
15
|
+
*/
|
|
7
16
|
export var Settings = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
8
17
|
var tooltip = props.tooltip,
|
|
9
18
|
iconButtonProps = _objectWithoutProperties(props, _excluded);
|
|
@@ -4,6 +4,15 @@ var _excluded = ["tooltip"];
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import SignInIcon from '@atlaskit/icon/glyph/sign-in';
|
|
6
6
|
import { IconButton } from '../IconButton';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* __Sign in__
|
|
10
|
+
*
|
|
11
|
+
* A sign-in button that can be passed into `AtlassianNavigation`'s `renderSignIn` prop.
|
|
12
|
+
*
|
|
13
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#sign-in)
|
|
14
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
15
|
+
*/
|
|
7
16
|
export var SignIn = function SignIn(props) {
|
|
8
17
|
var tooltip = props.tooltip,
|
|
9
18
|
iconButtonProps = _objectWithoutProperties(props, _excluded);
|
|
@@ -12,7 +21,8 @@ export var SignIn = function SignIn(props) {
|
|
|
12
21
|
icon: /*#__PURE__*/React.createElement(SignInIcon, {
|
|
13
22
|
label: typeof tooltip === 'string' ? tooltip : 'Sign-in Icon'
|
|
14
23
|
}),
|
|
15
|
-
tooltip: tooltip
|
|
24
|
+
tooltip: tooltip // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
25
|
+
|
|
16
26
|
}, iconButtonProps));
|
|
17
27
|
};
|
|
18
28
|
export default SignIn;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
3
|
-
import { IconButtonSkeleton } from '../IconButton/skeleton';
|
|
3
|
+
import { IconButtonSkeleton } from '../IconButton/skeleton'; // Not exported to consumers, only used in NavigationSkeleton
|
|
4
|
+
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
5
|
+
|
|
4
6
|
export var SignInSkeleton = function SignInSkeleton() {
|
|
5
7
|
return /*#__PURE__*/React.createElement(IconButtonSkeleton, {
|
|
6
8
|
marginLeft: 6,
|
|
@@ -21,6 +21,17 @@ var skeletonCreateButtonStyles = css({
|
|
|
21
21
|
marginLeft: 12
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
+
/**
|
|
25
|
+
* __Skeleton create button__
|
|
26
|
+
*
|
|
27
|
+
* Skeleton buttons are lightweight HTML button elements with CSS that represent
|
|
28
|
+
* their heavier interactive counterparts, for use when elements of the
|
|
29
|
+
* navigation are loaded dynamically. This one represents the Create button.
|
|
30
|
+
*
|
|
31
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
|
|
32
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
33
|
+
*/
|
|
34
|
+
|
|
24
35
|
export var SkeletonCreateButton = function SkeletonCreateButton(_ref) {
|
|
25
36
|
var text = _ref.text,
|
|
26
37
|
testId = _ref.testId;
|
|
@@ -28,6 +39,7 @@ export var SkeletonCreateButton = function SkeletonCreateButton(_ref) {
|
|
|
28
39
|
return jsx("button", {
|
|
29
40
|
style: theme.mode.create.default,
|
|
30
41
|
css: skeletonCreateButtonStyles,
|
|
31
|
-
"data-testid": testId
|
|
42
|
+
"data-testid": testId,
|
|
43
|
+
type: "button"
|
|
32
44
|
}, text);
|
|
33
45
|
};
|
|
@@ -28,6 +28,17 @@ var skeletonIconButtonStyles = css({
|
|
|
28
28
|
verticalAlign: 'middle'
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
|
+
/**
|
|
32
|
+
* __Skeleton icon button__
|
|
33
|
+
*
|
|
34
|
+
* Skeleton buttons are lightweight HTML button elements with CSS that represent
|
|
35
|
+
* their heavier interactive counterparts, for use when elements of the
|
|
36
|
+
* navigation are loaded dynamically. This one represents a generic icon button.
|
|
37
|
+
*
|
|
38
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
|
|
39
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
40
|
+
*/
|
|
41
|
+
|
|
31
42
|
export var SkeletonIconButton = function SkeletonIconButton(_ref) {
|
|
32
43
|
var children = _ref.children,
|
|
33
44
|
testId = _ref.testId;
|
|
@@ -35,6 +46,7 @@ export var SkeletonIconButton = function SkeletonIconButton(_ref) {
|
|
|
35
46
|
return jsx("button", {
|
|
36
47
|
style: theme.mode.iconButton.default,
|
|
37
48
|
"data-testid": testId,
|
|
38
|
-
css: skeletonIconButtonStyles
|
|
49
|
+
css: skeletonIconButtonStyles,
|
|
50
|
+
type: "button"
|
|
39
51
|
}, children);
|
|
40
52
|
};
|
|
@@ -70,6 +70,17 @@ var isDropdownButtonStyles = css({
|
|
|
70
70
|
verticalAlign: 'middle'
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
|
+
/**
|
|
74
|
+
* __Skeleton primary button__
|
|
75
|
+
*
|
|
76
|
+
* Skeleton buttons are lightweight HTML button elements with CSS that represent
|
|
77
|
+
* their heavier interactive counterparts, for use when elements of the
|
|
78
|
+
* navigation are loaded dynamically. This one represents a primary button.
|
|
79
|
+
*
|
|
80
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
|
|
81
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
82
|
+
*/
|
|
83
|
+
|
|
73
84
|
export var SkeletonPrimaryButton = function SkeletonPrimaryButton(_ref) {
|
|
74
85
|
var _objectSpread2;
|
|
75
86
|
|
|
@@ -88,6 +99,7 @@ export var SkeletonPrimaryButton = function SkeletonPrimaryButton(_ref) {
|
|
|
88
99
|
}), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, VAR_PRIMARY_BUTTON_BEFORE_HIGHLIGHTED_BACKGROUND_COLOR, primaryButton.selected.borderColor), _defineProperty(_objectSpread2, VAR_PRIMARY_BUTTON_AFTER_DROPDOWN_BORDER_COLOR, isHighlighted ? primaryButton.default.borderColor : primaryButton.default.color), _objectSpread2));
|
|
89
100
|
|
|
90
101
|
return jsx("button", {
|
|
102
|
+
type: "button",
|
|
91
103
|
style: dynamicStyles,
|
|
92
104
|
css: [primaryButtonSkeletonStyles, isHighlighted && isHighlightedStyles, isDropdownButton && isDropdownButtonStyles, isHighlighted && (isDropdownButton ? isHighlightedAndDropdownButtonStyles : isHighlightedNotDropdownButtonStyles)],
|
|
93
105
|
"data-testid": testId
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import React, { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import throttle from 'lodash/throttle';
|
|
4
|
+
import noop from '@atlaskit/ds-lib/noop';
|
|
4
5
|
// Prevent width detector from triggering too many re-renders
|
|
5
6
|
var THROTTLE_INTERVAL = 16 * 4; // Approx min width of items (based of "More" size)
|
|
6
7
|
|
|
@@ -15,13 +16,12 @@ var updateHashRef = function updateHashRef(currentRef, value) {
|
|
|
15
16
|
currentRef.length = 3;
|
|
16
17
|
};
|
|
17
18
|
|
|
18
|
-
var noop = function noop() {};
|
|
19
|
-
|
|
20
19
|
var OverflowContext = /*#__PURE__*/createContext({
|
|
21
20
|
isVisible: true,
|
|
22
21
|
openOverflowMenu: noop,
|
|
23
22
|
closeOverflowMenu: noop
|
|
24
|
-
});
|
|
23
|
+
}); // eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
24
|
+
|
|
25
25
|
export var OverflowProvider = function OverflowProvider(_ref) {
|
|
26
26
|
var children = _ref.children,
|
|
27
27
|
isVisible = _ref.isVisible,
|
|
@@ -39,6 +39,14 @@ export var OverflowProvider = function OverflowProvider(_ref) {
|
|
|
39
39
|
value: value
|
|
40
40
|
}, children);
|
|
41
41
|
};
|
|
42
|
+
/**
|
|
43
|
+
* __useOverFlowStatus__
|
|
44
|
+
*
|
|
45
|
+
* Returns the current context value for the nearest OverflowProvider.
|
|
46
|
+
*
|
|
47
|
+
* - [Example](https://atlassian.design/components/atlassian-navigation/examples#responsive)
|
|
48
|
+
*/
|
|
49
|
+
|
|
42
50
|
export var useOverflowStatus = function useOverflowStatus() {
|
|
43
51
|
return useContext(OverflowContext);
|
|
44
52
|
};
|
|
@@ -128,5 +136,6 @@ export var useOverflowController = function useOverflowController(nodes) {
|
|
|
128
136
|
updateWidth: throttleSetWidth
|
|
129
137
|
};
|
|
130
138
|
}; // Used to extract props for useOverflowStatus();
|
|
139
|
+
// eslint-disable-next-line @repo/internal/react/use-noop
|
|
131
140
|
|
|
132
141
|
export default (function (props) {});
|
|
@@ -2,6 +2,17 @@ import React from 'react';
|
|
|
2
2
|
import QuestionCircleIcon from '@atlaskit/icon/glyph/question-circle';
|
|
3
3
|
import { SkeletonIconButton } from './components/SkeletonIconButton';
|
|
4
4
|
import { useTheme } from './theme';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* __Skeleton Notification button__
|
|
8
|
+
*
|
|
9
|
+
* Skeleton buttons are lightweight HTML button elements with CSS that represent
|
|
10
|
+
* their heavier interactive counterparts, for use when elements of the
|
|
11
|
+
* navigation are loaded dynamically. This one represents the Help button.
|
|
12
|
+
*
|
|
13
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
|
|
14
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
15
|
+
*/
|
|
5
16
|
export var SkeletonHelpButton = function SkeletonHelpButton(_ref) {
|
|
6
17
|
var _ref$label = _ref.label,
|
|
7
18
|
label = _ref$label === void 0 ? '' : _ref$label;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import NotificationIcon from '@atlaskit/icon/glyph/notification';
|
|
3
3
|
import { SkeletonIconButton } from './components/SkeletonIconButton';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* __Skeleton Notification button__
|
|
7
|
+
*
|
|
8
|
+
* Skeleton buttons are lightweight HTML button elements with CSS that represent
|
|
9
|
+
* their heavier interactive counterparts, for use when elements of the
|
|
10
|
+
* navigation are loaded dynamically. This one represents the Notification button.
|
|
11
|
+
*
|
|
12
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
|
|
13
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
14
|
+
*/
|
|
4
15
|
export var SkeletonNotificationButton = function SkeletonNotificationButton(_ref) {
|
|
5
16
|
var _ref$label = _ref.label,
|
|
6
17
|
label = _ref$label === void 0 ? '' : _ref$label;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import SettingsIcon from '@atlaskit/icon/glyph/settings';
|
|
3
3
|
import { SkeletonIconButton } from './components/SkeletonIconButton';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* __Skeleton settings button__
|
|
7
|
+
*
|
|
8
|
+
* Skeleton buttons are lightweight HTML button elements with CSS that represent
|
|
9
|
+
* their heavier interactive counterparts, for use when elements of the
|
|
10
|
+
* navigation are loaded dynamically. This one represents the Settings button.
|
|
11
|
+
*
|
|
12
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
|
|
13
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
14
|
+
*/
|
|
4
15
|
export var SkeletonSettingsButton = function SkeletonSettingsButton(_ref) {
|
|
5
16
|
var _ref$label = _ref.label,
|
|
6
17
|
label = _ref$label === void 0 ? '' : _ref$label;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import AppSwitcherIcon from '@atlaskit/icon/glyph/app-switcher';
|
|
3
3
|
import { SkeletonIconButton } from './components/SkeletonIconButton';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* __Skeleton switcher button__
|
|
7
|
+
*
|
|
8
|
+
* Skeleton buttons are lightweight HTML button elements with CSS that represent
|
|
9
|
+
* their heavier interactive counterparts, for use when elements of the
|
|
10
|
+
* navigation are loaded dynamically. This one represents the AppSwitcher button.
|
|
11
|
+
*
|
|
12
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
|
|
13
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
14
|
+
*/
|
|
4
15
|
export var SkeletonSwitcherButton = function SkeletonSwitcherButton(_ref) {
|
|
5
16
|
var _ref$label = _ref.label,
|
|
6
17
|
label = _ref$label === void 0 ? '' : _ref$label;
|
package/dist/esm/theme/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { generateTheme } from './
|
|
2
|
-
export { ThemeProvider } from './
|
|
1
|
+
export { generateTheme } from './theme-generator';
|
|
2
|
+
export { ThemeProvider } from './theme-provider';
|
|
3
3
|
export { atlassianTheme, defaultTheme } from './themes';
|
|
4
|
-
export { useTheme } from './
|
|
5
|
-
export { hexToRGBA } from './
|
|
4
|
+
export { useTheme } from './use-theme';
|
|
5
|
+
export { hexToRGBA } from './theme-helpers';
|
|
@@ -4,12 +4,13 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
4
4
|
|
|
5
5
|
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
6
|
|
|
7
|
-
import defaultTheme, { DEFAULT_THEME_NAME } from './
|
|
8
|
-
import { generateTextColor, getBoxShadow, getContrastColor, hexToRGBA } from './
|
|
7
|
+
import defaultTheme, { DEFAULT_THEME_NAME } from './default-theme';
|
|
8
|
+
import { generateTextColor, getBoxShadow, getContrastColor, hexToRGBA } from './theme-helpers';
|
|
9
9
|
|
|
10
10
|
var generateOpacityValue = function generateOpacityValue(color) {
|
|
11
11
|
return color === '#000000' ? 0.3 : 0.6;
|
|
12
|
-
};
|
|
12
|
+
}; // eslint-disable-next-line @repo/internal/react/consistent-types-definitions
|
|
13
|
+
|
|
13
14
|
|
|
14
15
|
var generateButtonCSSStates = function generateButtonCSSStates(colors, buttonType) {
|
|
15
16
|
var backgroundColor = colors.backgroundColor,
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
import { defaultTheme } from './themes'; // Internal only
|
|
3
|
+
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
4
|
+
|
|
5
|
+
export var ThemeContext = /*#__PURE__*/createContext(defaultTheme);
|
|
6
|
+
/**
|
|
7
|
+
* __Theme provider__
|
|
8
|
+
*
|
|
9
|
+
* A provider for the theme context used by all navigation components.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export var ThemeProvider = ThemeContext.Provider;
|
package/dist/esm/theme/themes.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { B400, N0 } from '@atlaskit/theme/colors';
|
|
2
|
-
import { DEFAULT_THEME_NAME } from './
|
|
3
|
-
import { generateTheme } from './
|
|
2
|
+
import { DEFAULT_THEME_NAME } from './default-theme';
|
|
3
|
+
import { generateTheme } from './theme-generator';
|
|
4
4
|
export var atlassianTheme = generateTheme({
|
|
5
5
|
name: DEFAULT_THEME_NAME,
|
|
6
6
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
package/dist/esm/version.json
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AppSwitcherProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* _App switcher__
|
|
5
|
+
*
|
|
6
|
+
* An AppSwitcher button that can be passed into `AtlassianNavigation`'s
|
|
7
|
+
* `renderAppSwitcher` prop.
|
|
8
|
+
*
|
|
9
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#app-switcher)
|
|
10
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
11
|
+
*/
|
|
3
12
|
export declare const AppSwitcher: React.ForwardRefExoticComponent<import("../IconButton/types").BaseIconButtonProps & React.RefAttributes<any>>;
|
|
4
13
|
declare const _default: (props: AppSwitcherProps) => void;
|
|
5
14
|
export default _default;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { AtlassianNavigationProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* __Atlassian navigation__
|
|
5
|
+
*
|
|
6
|
+
* The horizontal navigation component for Atlassian products.
|
|
7
|
+
*
|
|
8
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples)
|
|
9
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/examples)
|
|
10
|
+
*/
|
|
3
11
|
export declare const AtlassianNavigation: (props: AtlassianNavigationProps) => JSX.Element;
|
|
4
12
|
export default AtlassianNavigation;
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { NavigationSkeletonProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* __Navigation skeleton__
|
|
5
|
+
*
|
|
6
|
+
* Use loading skeletons to reduce the perceived loading time of heavier
|
|
7
|
+
* full-page experiences. This should only be used when the whole navigation is
|
|
8
|
+
* delayed; if there are only certain dynamically loaded navigation items that
|
|
9
|
+
* slow down the page, you should look into using
|
|
10
|
+
* [skeleton buttons](https://atlassian.design/components/atlassian-navigation/examples#skeleton-button)
|
|
11
|
+
* instead.
|
|
12
|
+
*
|
|
13
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#skeleton-loader)
|
|
14
|
+
* - [Code](https://atlassian.design/components/{packageName}/code)
|
|
15
|
+
*/
|
|
3
16
|
export declare const NavigationSkeleton: ({ primaryItemsCount, secondaryItemsCount, theme, showSiteName, shouldShowSearch, testId, }: NavigationSkeletonProps) => JSX.Element;
|
|
4
17
|
export default NavigationSkeleton;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CreateProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* _Create__
|
|
5
|
+
*
|
|
6
|
+
* A call to action button that can be passed into `AtlassianNavigation`'s
|
|
7
|
+
* `renderCreate` prop. It is shown after all other primary buttons.
|
|
8
|
+
*
|
|
9
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#create)
|
|
10
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
11
|
+
*/
|
|
3
12
|
export declare const Create: ({ onClick, href, text, buttonTooltip, iconButtonTooltip, testId, }: CreateProps) => JSX.Element;
|
|
4
13
|
export default Create;
|
|
@@ -25,9 +25,9 @@ export interface CreateProps {
|
|
|
25
25
|
* A `testId` prop is provided for specified elements,
|
|
26
26
|
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
27
27
|
* serving as a hook for automated tests.
|
|
28
|
-
|
|
28
|
+
*
|
|
29
29
|
* Will set these elements when defined:
|
|
30
|
-
|
|
30
|
+
*
|
|
31
31
|
* - Create button shown on large screen sizes - `{testId}-button`
|
|
32
32
|
* - Create icon button shown on small screen sizes - `{testId}-icon-button`
|
|
33
33
|
*/
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* __Help__
|
|
4
|
+
*
|
|
5
|
+
* A help button that can be passed into `AtlassianNavigation`'s `renderHelp` prop.
|
|
6
|
+
*
|
|
7
|
+
* - [Examples](https://atlassian.design/components/atlassian-navigation/examples#help)
|
|
8
|
+
* - [Code](https://atlassian.design/components/atlassian-navigation/code)
|
|
9
|
+
*/
|
|
2
10
|
export declare const Help: React.ForwardRefExoticComponent<import("../IconButton/types").BaseIconButtonProps & {
|
|
3
11
|
badge?: React.ComponentType<{}> | undefined;
|
|
4
12
|
} & React.RefAttributes<any>>;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* __Icon button__
|
|
4
|
+
*
|
|
5
|
+
* An icon button is used to create navigation items such as Help, Settings
|
|
6
|
+
* and Notifications. You can use this component to create your own items to
|
|
7
|
+
* pass into `AtlassianNavigation`'s render props, but where possible you should
|
|
8
|
+
* rely on the defaults.
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
2
11
|
export declare const IconButton: React.ForwardRefExoticComponent<import("./types").BaseIconButtonProps & {
|
|
3
12
|
icon: React.ReactChild | undefined;
|
|
4
13
|
theme?: ((current: (props: import("@atlaskit/button/custom-theme-button").ThemeProps) => import("@atlaskit/button/custom-theme-button").ThemeTokens, props: import("@atlaskit/button/custom-theme-button").ThemeProps) => import("@atlaskit/button/custom-theme-button").ThemeTokens) | undefined;
|