@atlaskit/atlassian-navigation 2.2.2 → 2.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/cjs/components/ProductHome/custom-product-home.js +8 -14
- package/dist/cjs/components/ProductHome/product-home.js +5 -3
- package/dist/cjs/theme/defaultTheme.js +3 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/ProductHome/custom-product-home.js +2 -12
- package/dist/es2019/components/ProductHome/product-home.js +6 -7
- package/dist/es2019/theme/defaultTheme.js +3 -3
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/ProductHome/custom-product-home.js +8 -14
- package/dist/esm/components/ProductHome/product-home.js +5 -3
- package/dist/esm/theme/defaultTheme.js +3 -3
- package/dist/esm/version.json +1 -1
- package/package.json +6 -4
- package/report.api.md +637 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/atlassian-navigation
|
|
2
2
|
|
|
3
|
+
## 2.2.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`deeaf03eb21`](https://bitbucket.org/atlassian/atlassian-frontend/commits/deeaf03eb21) - Fix an issue where ProductHome rendered incorrectly in Safari
|
|
8
|
+
|
|
9
|
+
## 2.2.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`416570be6bf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/416570be6bf) - Small update to styles to account for change in `@atlaskit/logo`.
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
16
|
+
## 2.2.3
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [`5b7962fbceb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5b7962fbceb) - Fix visual bug with selected state of navigation iconButtons
|
|
21
|
+
- [`dd991482e67`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dd991482e67) - [ux] Fixed a regression causing the `logoMaxWidth` prop to have no effect. VR tests may need regenerating, but in most cases will not.
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 2.2.2
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -27,7 +27,6 @@ var _excluded = ["iconAlt", "iconUrl", "logoAlt", "logoUrl", "href", "onClick",
|
|
|
27
27
|
|
|
28
28
|
var _css3;
|
|
29
29
|
|
|
30
|
-
var VAR_LOGO_MAX_WIDTH = '--logo-max-width';
|
|
31
30
|
var VAR_PRODUCT_HOME_COLOR_ACTIVE = '--product-home-color-active';
|
|
32
31
|
var VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE = '--product-home-bg-color-active';
|
|
33
32
|
var VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE = '--product-home-box-shadow-active';
|
|
@@ -40,12 +39,7 @@ var VAR_PRODUCT_HOME_BOX_SHADOW_HOVER = '--product-home-box-shadow-hover';
|
|
|
40
39
|
var productLogoStyles = (0, _core.css)((0, _defineProperty2.default)({
|
|
41
40
|
// Ensure anything passed into
|
|
42
41
|
// productHome is aligned correctly
|
|
43
|
-
display: 'flex'
|
|
44
|
-
maxWidth: "var(".concat(VAR_LOGO_MAX_WIDTH, ")"),
|
|
45
|
-
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
46
|
-
'& > *': {
|
|
47
|
-
maxHeight: 24
|
|
48
|
-
}
|
|
42
|
+
display: 'flex'
|
|
49
43
|
}, "@media (max-width: ".concat(_constants.PRODUCT_HOME_BREAKPOINT - 0.1, "px)"), {
|
|
50
44
|
display: 'none'
|
|
51
45
|
}));
|
|
@@ -55,11 +49,7 @@ var customMaxHeightStyles = (0, _core.css)({
|
|
|
55
49
|
var productIconStyles = (0, _core.css)((0, _defineProperty2.default)({
|
|
56
50
|
// Ensure anything passed into
|
|
57
51
|
// productHome is aligned correctly
|
|
58
|
-
display: 'flex'
|
|
59
|
-
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
60
|
-
'& > *': {
|
|
61
|
-
maxHeight: 24
|
|
62
|
-
}
|
|
52
|
+
display: 'flex'
|
|
63
53
|
}, "@media (min-width: ".concat(_constants.PRODUCT_HOME_BREAKPOINT, "px)"), {
|
|
64
54
|
display: 'none'
|
|
65
55
|
}));
|
|
@@ -144,13 +134,17 @@ var CustomProductHome = function CustomProductHome(props) {
|
|
|
144
134
|
onMouseDown: preventFocusRing,
|
|
145
135
|
"data-testid": testId && "".concat(testId, "-container")
|
|
146
136
|
}, rest), logoUrl && (0, _core.jsx)("img", {
|
|
147
|
-
style:
|
|
137
|
+
style: {
|
|
138
|
+
maxWidth: logoMaxWidth
|
|
139
|
+
},
|
|
148
140
|
css: [customMaxHeightStyles, productLogoStyles],
|
|
149
141
|
src: logoUrl,
|
|
150
142
|
alt: logoAlt,
|
|
151
143
|
"data-testid": testId && "".concat(testId, "-logo")
|
|
152
144
|
}), iconUrl && (0, _core.jsx)("img", {
|
|
153
|
-
style:
|
|
145
|
+
style: {
|
|
146
|
+
maxWidth: logoMaxWidth
|
|
147
|
+
},
|
|
154
148
|
css: [customMaxHeightStyles, productIconStyles],
|
|
155
149
|
src: iconUrl,
|
|
156
150
|
alt: iconAlt,
|
|
@@ -85,6 +85,10 @@ var productLogoStyles = (0, _core.css)((0, _defineProperty2.default)({
|
|
|
85
85
|
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
86
86
|
'& > *': {
|
|
87
87
|
maxHeight: 24
|
|
88
|
+
},
|
|
89
|
+
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
90
|
+
'& > span > svg': {
|
|
91
|
+
maxWidth: "var(".concat(VAR_LOGO_MAX_WIDTH, ")")
|
|
88
92
|
}
|
|
89
93
|
}, "@media (max-width: ".concat(_constants.PRODUCT_HOME_BREAKPOINT - 0.1, "px)"), {
|
|
90
94
|
display: 'none'
|
|
@@ -142,7 +146,7 @@ var ProductHome = function ProductHome(_ref) {
|
|
|
142
146
|
onMouseDown && onMouseDown(e);
|
|
143
147
|
};
|
|
144
148
|
|
|
145
|
-
var productHomeButtonDynamicStyles = (_productHomeButtonDyn = {}, (0, _defineProperty2.default)(_productHomeButtonDyn, VAR_PRODUCT_HOME_COLOR_ACTIVE, primaryButton.active.color), (0, _defineProperty2.default)(_productHomeButtonDyn, VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE, primaryButton.active.backgroundColor), (0, _defineProperty2.default)(_productHomeButtonDyn, VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE, primaryButton.active.boxShadow), (0, _defineProperty2.default)(_productHomeButtonDyn, VAR_PRODUCT_HOME_COLOR_FOCUS, primaryButton.focus.color), (0, _defineProperty2.default)(_productHomeButtonDyn, VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS, primaryButton.focus.backgroundColor), (0, _defineProperty2.default)(_productHomeButtonDyn, VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS, primaryButton.focus.boxShadow), (0, _defineProperty2.default)(_productHomeButtonDyn, VAR_PRODUCT_HOME_COLOR_HOVER, primaryButton.hover.color), (0, _defineProperty2.default)(_productHomeButtonDyn, VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER, primaryButton.hover.backgroundColor), (0, _defineProperty2.default)(_productHomeButtonDyn, VAR_PRODUCT_HOME_BOX_SHADOW_HOVER, primaryButton.hover.boxShadow), _productHomeButtonDyn);
|
|
149
|
+
var productHomeButtonDynamicStyles = (_productHomeButtonDyn = {}, (0, _defineProperty2.default)(_productHomeButtonDyn, VAR_PRODUCT_HOME_COLOR_ACTIVE, primaryButton.active.color), (0, _defineProperty2.default)(_productHomeButtonDyn, VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE, primaryButton.active.backgroundColor), (0, _defineProperty2.default)(_productHomeButtonDyn, VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE, primaryButton.active.boxShadow), (0, _defineProperty2.default)(_productHomeButtonDyn, VAR_PRODUCT_HOME_COLOR_FOCUS, primaryButton.focus.color), (0, _defineProperty2.default)(_productHomeButtonDyn, VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS, primaryButton.focus.backgroundColor), (0, _defineProperty2.default)(_productHomeButtonDyn, VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS, primaryButton.focus.boxShadow), (0, _defineProperty2.default)(_productHomeButtonDyn, VAR_PRODUCT_HOME_COLOR_HOVER, primaryButton.hover.color), (0, _defineProperty2.default)(_productHomeButtonDyn, VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER, primaryButton.hover.backgroundColor), (0, _defineProperty2.default)(_productHomeButtonDyn, VAR_PRODUCT_HOME_BOX_SHADOW_HOVER, primaryButton.hover.boxShadow), (0, _defineProperty2.default)(_productHomeButtonDyn, VAR_LOGO_MAX_WIDTH, "".concat(logoMaxWidth, "px")), _productHomeButtonDyn);
|
|
146
150
|
return (0, _core.jsx)(_react.Fragment, null, (0, _core.jsx)(Tag, (0, _extends2.default)({
|
|
147
151
|
style: productHomeButtonDynamicStyles,
|
|
148
152
|
css: productHomeButtonStyles,
|
|
@@ -151,7 +155,6 @@ var ProductHome = function ProductHome(_ref) {
|
|
|
151
155
|
onMouseDown: preventFocusRing,
|
|
152
156
|
"data-testid": testId && "".concat(testId, "-container")
|
|
153
157
|
}, rest), (0, _core.jsx)("div", {
|
|
154
|
-
style: (0, _defineProperty2.default)({}, VAR_LOGO_MAX_WIDTH, logoMaxWidth),
|
|
155
158
|
css: [customMaxHeightStyles, productLogoStyles],
|
|
156
159
|
"data-testid": testId && "".concat(testId, "-logo")
|
|
157
160
|
}, (0, _core.jsx)(Logo, {
|
|
@@ -160,7 +163,6 @@ var ProductHome = function ProductHome(_ref) {
|
|
|
160
163
|
iconColor: iconColor,
|
|
161
164
|
textColor: textColor
|
|
162
165
|
})), (0, _core.jsx)("div", {
|
|
163
|
-
style: (0, _defineProperty2.default)({}, VAR_LOGO_MAX_WIDTH, logoMaxWidth),
|
|
164
166
|
css: [customMaxHeightStyles, productIconStyles],
|
|
165
167
|
"data-testid": testId && "".concat(testId, "-icon")
|
|
166
168
|
}, (0, _core.jsx)(Icon, {
|
|
@@ -60,8 +60,8 @@ var defaultTheme = {
|
|
|
60
60
|
boxShadow: ''
|
|
61
61
|
},
|
|
62
62
|
selected: {
|
|
63
|
-
color: "var(--ds-text-selected)",
|
|
64
|
-
backgroundColor: "var(--ds-background-selected)",
|
|
63
|
+
color: "var(--ds-text-selected, ".concat(_colors.B400, ")"),
|
|
64
|
+
backgroundColor: "var(--ds-background-selected, ".concat((0, _themeHelpers.hexToRGBA)(_colors.B50, 0.6), ")"),
|
|
65
65
|
boxShadow: ''
|
|
66
66
|
}
|
|
67
67
|
},
|
|
@@ -104,7 +104,7 @@ var defaultTheme = {
|
|
|
104
104
|
},
|
|
105
105
|
selected: {
|
|
106
106
|
color: "var(--ds-text-selected, ".concat(_colors.B400, ")"),
|
|
107
|
-
backgroundColor: "var(--ds-background-selected)",
|
|
107
|
+
backgroundColor: "var(--ds-background-selected, ".concat((0, _themeHelpers.hexToRGBA)(_colors.B50, 0.7), ")"),
|
|
108
108
|
boxShadow: '',
|
|
109
109
|
borderColor: "var(--ds-border-selected, ".concat(_colors.B400, ")"),
|
|
110
110
|
bordorBottom: "4px solid ".concat("var(--ds-border-selected, ".concat(_colors.B400, ")"))
|
package/dist/cjs/version.json
CHANGED
|
@@ -6,7 +6,6 @@ import { css, jsx } from '@emotion/core';
|
|
|
6
6
|
import { gridSize, PRODUCT_HOME_BREAKPOINT } from '../../common/constants';
|
|
7
7
|
import { useTheme } from '../../theme';
|
|
8
8
|
import { getTag } from './utils';
|
|
9
|
-
const VAR_LOGO_MAX_WIDTH = '--logo-max-width';
|
|
10
9
|
const VAR_PRODUCT_HOME_COLOR_ACTIVE = '--product-home-color-active';
|
|
11
10
|
const VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE = '--product-home-bg-color-active';
|
|
12
11
|
const VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE = '--product-home-box-shadow-active';
|
|
@@ -20,11 +19,6 @@ const productLogoStyles = css({
|
|
|
20
19
|
// Ensure anything passed into
|
|
21
20
|
// productHome is aligned correctly
|
|
22
21
|
display: 'flex',
|
|
23
|
-
maxWidth: `var(${VAR_LOGO_MAX_WIDTH})`,
|
|
24
|
-
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
25
|
-
'& > *': {
|
|
26
|
-
maxHeight: 24
|
|
27
|
-
},
|
|
28
22
|
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
29
23
|
[`@media (max-width: ${PRODUCT_HOME_BREAKPOINT - 0.1}px)`]: {
|
|
30
24
|
display: 'none'
|
|
@@ -38,10 +32,6 @@ const productIconStyles = css({
|
|
|
38
32
|
// productHome is aligned correctly
|
|
39
33
|
display: 'flex',
|
|
40
34
|
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
41
|
-
'& > *': {
|
|
42
|
-
maxHeight: 24
|
|
43
|
-
},
|
|
44
|
-
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
45
35
|
[`@media (min-width: ${PRODUCT_HOME_BREAKPOINT}px)`]: {
|
|
46
36
|
display: 'none'
|
|
47
37
|
}
|
|
@@ -141,7 +131,7 @@ const CustomProductHome = props => {
|
|
|
141
131
|
"data-testid": testId && `${testId}-container`
|
|
142
132
|
}, rest), logoUrl && jsx("img", {
|
|
143
133
|
style: {
|
|
144
|
-
|
|
134
|
+
maxWidth: logoMaxWidth
|
|
145
135
|
},
|
|
146
136
|
css: [customMaxHeightStyles, productLogoStyles],
|
|
147
137
|
src: logoUrl,
|
|
@@ -149,7 +139,7 @@ const CustomProductHome = props => {
|
|
|
149
139
|
"data-testid": testId && `${testId}-logo`
|
|
150
140
|
}), iconUrl && jsx("img", {
|
|
151
141
|
style: {
|
|
152
|
-
|
|
142
|
+
maxWidth: logoMaxWidth
|
|
153
143
|
},
|
|
154
144
|
css: [customMaxHeightStyles, productIconStyles],
|
|
155
145
|
src: iconUrl,
|
|
@@ -70,6 +70,10 @@ const productLogoStyles = css({
|
|
|
70
70
|
maxHeight: 24
|
|
71
71
|
},
|
|
72
72
|
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
73
|
+
'& > span > svg': {
|
|
74
|
+
maxWidth: `var(${VAR_LOGO_MAX_WIDTH})`
|
|
75
|
+
},
|
|
76
|
+
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
73
77
|
[`@media (max-width: ${PRODUCT_HOME_BREAKPOINT - 0.1}px)`]: {
|
|
74
78
|
display: 'none'
|
|
75
79
|
}
|
|
@@ -133,7 +137,8 @@ const ProductHome = ({
|
|
|
133
137
|
[VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS]: primaryButton.focus.boxShadow,
|
|
134
138
|
[VAR_PRODUCT_HOME_COLOR_HOVER]: primaryButton.hover.color,
|
|
135
139
|
[VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER]: primaryButton.hover.backgroundColor,
|
|
136
|
-
[VAR_PRODUCT_HOME_BOX_SHADOW_HOVER]: primaryButton.hover.boxShadow
|
|
140
|
+
[VAR_PRODUCT_HOME_BOX_SHADOW_HOVER]: primaryButton.hover.boxShadow,
|
|
141
|
+
[VAR_LOGO_MAX_WIDTH]: `${logoMaxWidth}px`
|
|
137
142
|
};
|
|
138
143
|
return jsx(Fragment, null, jsx(Tag, _extends({
|
|
139
144
|
style: productHomeButtonDynamicStyles,
|
|
@@ -143,9 +148,6 @@ const ProductHome = ({
|
|
|
143
148
|
onMouseDown: preventFocusRing,
|
|
144
149
|
"data-testid": testId && `${testId}-container`
|
|
145
150
|
}, rest), jsx("div", {
|
|
146
|
-
style: {
|
|
147
|
-
[VAR_LOGO_MAX_WIDTH]: logoMaxWidth
|
|
148
|
-
},
|
|
149
151
|
css: [customMaxHeightStyles, productLogoStyles],
|
|
150
152
|
"data-testid": testId && `${testId}-logo`
|
|
151
153
|
}, jsx(Logo, {
|
|
@@ -154,9 +156,6 @@ const ProductHome = ({
|
|
|
154
156
|
iconColor: iconColor,
|
|
155
157
|
textColor: textColor
|
|
156
158
|
})), jsx("div", {
|
|
157
|
-
style: {
|
|
158
|
-
[VAR_LOGO_MAX_WIDTH]: logoMaxWidth
|
|
159
|
-
},
|
|
160
159
|
css: [customMaxHeightStyles, productIconStyles],
|
|
161
160
|
"data-testid": testId && `${testId}-icon`
|
|
162
161
|
}, jsx(Icon, {
|
|
@@ -51,8 +51,8 @@ const defaultTheme = {
|
|
|
51
51
|
boxShadow: ''
|
|
52
52
|
},
|
|
53
53
|
selected: {
|
|
54
|
-
color:
|
|
55
|
-
backgroundColor:
|
|
54
|
+
color: `var(--ds-text-selected, ${B400})`,
|
|
55
|
+
backgroundColor: `var(--ds-background-selected, ${hexToRGBA(B50, 0.6)})`,
|
|
56
56
|
boxShadow: ''
|
|
57
57
|
}
|
|
58
58
|
},
|
|
@@ -95,7 +95,7 @@ const defaultTheme = {
|
|
|
95
95
|
},
|
|
96
96
|
selected: {
|
|
97
97
|
color: `var(--ds-text-selected, ${B400})`,
|
|
98
|
-
backgroundColor:
|
|
98
|
+
backgroundColor: `var(--ds-background-selected, ${hexToRGBA(B50, 0.7)})`,
|
|
99
99
|
boxShadow: '',
|
|
100
100
|
borderColor: `var(--ds-border-selected, ${B400})`,
|
|
101
101
|
bordorBottom: `4px solid ${`var(--ds-border-selected, ${B400})`}`
|
package/dist/es2019/version.json
CHANGED
|
@@ -11,7 +11,6 @@ import { css, jsx } from '@emotion/core';
|
|
|
11
11
|
import { gridSize, PRODUCT_HOME_BREAKPOINT } from '../../common/constants';
|
|
12
12
|
import { useTheme } from '../../theme';
|
|
13
13
|
import { getTag } from './utils';
|
|
14
|
-
var VAR_LOGO_MAX_WIDTH = '--logo-max-width';
|
|
15
14
|
var VAR_PRODUCT_HOME_COLOR_ACTIVE = '--product-home-color-active';
|
|
16
15
|
var VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE = '--product-home-bg-color-active';
|
|
17
16
|
var VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE = '--product-home-box-shadow-active';
|
|
@@ -24,12 +23,7 @@ var VAR_PRODUCT_HOME_BOX_SHADOW_HOVER = '--product-home-box-shadow-hover';
|
|
|
24
23
|
var productLogoStyles = css(_defineProperty({
|
|
25
24
|
// Ensure anything passed into
|
|
26
25
|
// productHome is aligned correctly
|
|
27
|
-
display: 'flex'
|
|
28
|
-
maxWidth: "var(".concat(VAR_LOGO_MAX_WIDTH, ")"),
|
|
29
|
-
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
30
|
-
'& > *': {
|
|
31
|
-
maxHeight: 24
|
|
32
|
-
}
|
|
26
|
+
display: 'flex'
|
|
33
27
|
}, "@media (max-width: ".concat(PRODUCT_HOME_BREAKPOINT - 0.1, "px)"), {
|
|
34
28
|
display: 'none'
|
|
35
29
|
}));
|
|
@@ -39,11 +33,7 @@ var customMaxHeightStyles = css({
|
|
|
39
33
|
var productIconStyles = css(_defineProperty({
|
|
40
34
|
// Ensure anything passed into
|
|
41
35
|
// productHome is aligned correctly
|
|
42
|
-
display: 'flex'
|
|
43
|
-
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
44
|
-
'& > *': {
|
|
45
|
-
maxHeight: 24
|
|
46
|
-
}
|
|
36
|
+
display: 'flex'
|
|
47
37
|
}, "@media (min-width: ".concat(PRODUCT_HOME_BREAKPOINT, "px)"), {
|
|
48
38
|
display: 'none'
|
|
49
39
|
}));
|
|
@@ -129,13 +119,17 @@ var CustomProductHome = function CustomProductHome(props) {
|
|
|
129
119
|
onMouseDown: preventFocusRing,
|
|
130
120
|
"data-testid": testId && "".concat(testId, "-container")
|
|
131
121
|
}, rest), logoUrl && jsx("img", {
|
|
132
|
-
style:
|
|
122
|
+
style: {
|
|
123
|
+
maxWidth: logoMaxWidth
|
|
124
|
+
},
|
|
133
125
|
css: [customMaxHeightStyles, productLogoStyles],
|
|
134
126
|
src: logoUrl,
|
|
135
127
|
alt: logoAlt,
|
|
136
128
|
"data-testid": testId && "".concat(testId, "-logo")
|
|
137
129
|
}), iconUrl && jsx("img", {
|
|
138
|
-
style:
|
|
130
|
+
style: {
|
|
131
|
+
maxWidth: logoMaxWidth
|
|
132
|
+
},
|
|
139
133
|
css: [customMaxHeightStyles, productIconStyles],
|
|
140
134
|
src: iconUrl,
|
|
141
135
|
alt: iconAlt,
|
|
@@ -69,6 +69,10 @@ var productLogoStyles = css(_defineProperty({
|
|
|
69
69
|
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
70
70
|
'& > *': {
|
|
71
71
|
maxHeight: 24
|
|
72
|
+
},
|
|
73
|
+
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
74
|
+
'& > span > svg': {
|
|
75
|
+
maxWidth: "var(".concat(VAR_LOGO_MAX_WIDTH, ")")
|
|
72
76
|
}
|
|
73
77
|
}, "@media (max-width: ".concat(PRODUCT_HOME_BREAKPOINT - 0.1, "px)"), {
|
|
74
78
|
display: 'none'
|
|
@@ -127,7 +131,7 @@ var ProductHome = function ProductHome(_ref) {
|
|
|
127
131
|
onMouseDown && onMouseDown(e);
|
|
128
132
|
};
|
|
129
133
|
|
|
130
|
-
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);
|
|
134
|
+
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), _defineProperty(_productHomeButtonDyn, VAR_LOGO_MAX_WIDTH, "".concat(logoMaxWidth, "px")), _productHomeButtonDyn);
|
|
131
135
|
return jsx(Fragment, null, jsx(Tag, _extends({
|
|
132
136
|
style: productHomeButtonDynamicStyles,
|
|
133
137
|
css: productHomeButtonStyles,
|
|
@@ -136,7 +140,6 @@ var ProductHome = function ProductHome(_ref) {
|
|
|
136
140
|
onMouseDown: preventFocusRing,
|
|
137
141
|
"data-testid": testId && "".concat(testId, "-container")
|
|
138
142
|
}, rest), jsx("div", {
|
|
139
|
-
style: _defineProperty({}, VAR_LOGO_MAX_WIDTH, logoMaxWidth),
|
|
140
143
|
css: [customMaxHeightStyles, productLogoStyles],
|
|
141
144
|
"data-testid": testId && "".concat(testId, "-logo")
|
|
142
145
|
}, jsx(Logo, {
|
|
@@ -145,7 +148,6 @@ var ProductHome = function ProductHome(_ref) {
|
|
|
145
148
|
iconColor: iconColor,
|
|
146
149
|
textColor: textColor
|
|
147
150
|
})), jsx("div", {
|
|
148
|
-
style: _defineProperty({}, VAR_LOGO_MAX_WIDTH, logoMaxWidth),
|
|
149
151
|
css: [customMaxHeightStyles, productIconStyles],
|
|
150
152
|
"data-testid": testId && "".concat(testId, "-icon")
|
|
151
153
|
}, jsx(Icon, {
|
|
@@ -51,8 +51,8 @@ var defaultTheme = {
|
|
|
51
51
|
boxShadow: ''
|
|
52
52
|
},
|
|
53
53
|
selected: {
|
|
54
|
-
color: "var(--ds-text-selected)",
|
|
55
|
-
backgroundColor: "var(--ds-background-selected)",
|
|
54
|
+
color: "var(--ds-text-selected, ".concat(B400, ")"),
|
|
55
|
+
backgroundColor: "var(--ds-background-selected, ".concat(hexToRGBA(B50, 0.6), ")"),
|
|
56
56
|
boxShadow: ''
|
|
57
57
|
}
|
|
58
58
|
},
|
|
@@ -95,7 +95,7 @@ var defaultTheme = {
|
|
|
95
95
|
},
|
|
96
96
|
selected: {
|
|
97
97
|
color: "var(--ds-text-selected, ".concat(B400, ")"),
|
|
98
|
-
backgroundColor: "var(--ds-background-selected)",
|
|
98
|
+
backgroundColor: "var(--ds-background-selected, ".concat(hexToRGBA(B50, 0.7), ")"),
|
|
99
99
|
boxShadow: '',
|
|
100
100
|
borderColor: "var(--ds-border-selected, ".concat(B400, ")"),
|
|
101
101
|
bordorBottom: "4px solid ".concat("var(--ds-border-selected, ".concat(B400, ")"))
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/atlassian-navigation",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.5",
|
|
4
4
|
"description": "A horizontal navigation component for Atlassian products.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
7
7
|
},
|
|
8
|
-
"repository": "https://bitbucket.org/atlassian/atlassian-frontend",
|
|
8
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
9
9
|
"author": "Atlassian Pty Ltd",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"main": "dist/cjs/index.js",
|
|
@@ -19,11 +19,12 @@
|
|
|
19
19
|
"deprecatedAutoEntryPoints": true,
|
|
20
20
|
"releaseModel": "scheduled",
|
|
21
21
|
"website": {
|
|
22
|
-
"name": "Atlassian navigation"
|
|
22
|
+
"name": "Atlassian navigation",
|
|
23
|
+
"category": "Components"
|
|
23
24
|
}
|
|
24
25
|
},
|
|
25
26
|
"dependencies": {
|
|
26
|
-
"@atlaskit/analytics-namespaced-context": "^6.
|
|
27
|
+
"@atlaskit/analytics-namespaced-context": "^6.5.0",
|
|
27
28
|
"@atlaskit/button": "^16.3.0",
|
|
28
29
|
"@atlaskit/icon": "^21.10.0",
|
|
29
30
|
"@atlaskit/logo": "*",
|
|
@@ -68,6 +69,7 @@
|
|
|
68
69
|
"import-structure": "atlassian-conventions"
|
|
69
70
|
},
|
|
70
71
|
"@repo/internal": {
|
|
72
|
+
"dom-events": "use-bind-event-listener",
|
|
71
73
|
"ui-components": "lite-mode",
|
|
72
74
|
"analytics": "analytics-next",
|
|
73
75
|
"styling": [
|
package/report.api.md
ADDED
|
@@ -0,0 +1,637 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/atlassian-navigation"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
````ts
|
|
6
|
+
/// <reference types="lodash" />
|
|
7
|
+
/// <reference types="react" />
|
|
8
|
+
|
|
9
|
+
import { AllHTMLAttributes } from 'react';
|
|
10
|
+
import { ComponentType } from 'react';
|
|
11
|
+
import { CSSObject } from '@emotion/core';
|
|
12
|
+
import { CustomThemeButtonProps } from '@atlaskit/button/types';
|
|
13
|
+
import { CustomThemeButtonProps as CustomThemeButtonProps_2 } from '@atlaskit/button/custom-theme-button';
|
|
14
|
+
import { ElementType } from 'react';
|
|
15
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
16
|
+
import { LogoProps } from '@atlaskit/logo';
|
|
17
|
+
import { MouseEvent as MouseEvent_2 } from 'react';
|
|
18
|
+
import { Provider } from 'react';
|
|
19
|
+
import { default as React_2 } from 'react';
|
|
20
|
+
import { ReactChild } from 'react';
|
|
21
|
+
import { ReactNode } from 'react';
|
|
22
|
+
import { ReactNodeArray } from 'react';
|
|
23
|
+
import { RefAttributes } from 'react';
|
|
24
|
+
import { ThemeProps } from '@atlaskit/button/custom-theme-button';
|
|
25
|
+
import { ThemeProps as ThemeProps_2 } from '@atlaskit/button';
|
|
26
|
+
import { ThemeTokens } from '@atlaskit/button/custom-theme-button';
|
|
27
|
+
import { ThemeTokens as ThemeTokens_2 } from '@atlaskit/button';
|
|
28
|
+
|
|
29
|
+
export declare const AppSwitcher: React_2.ForwardRefExoticComponent<
|
|
30
|
+
BaseIconButtonProps & React_2.RefAttributes<any>
|
|
31
|
+
>;
|
|
32
|
+
|
|
33
|
+
export declare type AppSwitcherProps = BaseIconButtonProps;
|
|
34
|
+
|
|
35
|
+
export declare const AtlassianNavigation: (
|
|
36
|
+
props: AtlassianNavigationProps,
|
|
37
|
+
) => JSX.Element;
|
|
38
|
+
|
|
39
|
+
export declare interface AtlassianNavigationProps {
|
|
40
|
+
/**
|
|
41
|
+
* Describes the specific role of this navigation component for users viewing the page with a screen
|
|
42
|
+
* reader. Differentiates from other navigation components on a page.
|
|
43
|
+
*/
|
|
44
|
+
label: string;
|
|
45
|
+
/**
|
|
46
|
+
* Slot for the primary actions.
|
|
47
|
+
*/
|
|
48
|
+
primaryItems: ReactNodeArray;
|
|
49
|
+
/**
|
|
50
|
+
* Slot for the app switcher.
|
|
51
|
+
*/
|
|
52
|
+
renderAppSwitcher?: React_2.ComponentType<{}>;
|
|
53
|
+
/**
|
|
54
|
+
* Slot for the create call to action button.
|
|
55
|
+
*/
|
|
56
|
+
renderCreate?: React_2.ComponentType<{}>;
|
|
57
|
+
/**
|
|
58
|
+
* Slot for the help button.
|
|
59
|
+
*/
|
|
60
|
+
renderHelp?: React_2.ComponentType<{}>;
|
|
61
|
+
/**
|
|
62
|
+
* Slot for the notification button.
|
|
63
|
+
*/
|
|
64
|
+
renderNotifications?: React_2.ComponentType<{}>;
|
|
65
|
+
/**
|
|
66
|
+
* Slot for the product home logo which renders a product's brand.
|
|
67
|
+
*/
|
|
68
|
+
renderProductHome: React_2.ComponentType<{}>;
|
|
69
|
+
/**
|
|
70
|
+
* Slot for the profile button.
|
|
71
|
+
*/
|
|
72
|
+
renderProfile?: React_2.ComponentType<{}>;
|
|
73
|
+
/**
|
|
74
|
+
* Slot for the search textbox.
|
|
75
|
+
*/
|
|
76
|
+
renderSearch?: React_2.ComponentType<{}>;
|
|
77
|
+
/**
|
|
78
|
+
* Slot for the sign in button.
|
|
79
|
+
*/
|
|
80
|
+
renderSignIn?: React_2.ComponentType<{}>;
|
|
81
|
+
/**
|
|
82
|
+
* Slot for the settings button.
|
|
83
|
+
*/
|
|
84
|
+
renderSettings?: React_2.ComponentType<{}>;
|
|
85
|
+
/**
|
|
86
|
+
* Label used for the overflow menu button tooltip.
|
|
87
|
+
*/
|
|
88
|
+
moreLabel?: ReactNode;
|
|
89
|
+
/**
|
|
90
|
+
* __Slow and discouraged custom theme API.__
|
|
91
|
+
*/
|
|
92
|
+
theme?: NavigationTheme;
|
|
93
|
+
/**
|
|
94
|
+
A `testId` prop is provided for specified elements,
|
|
95
|
+
which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
96
|
+
serving as a hook for automated tests.
|
|
97
|
+
|
|
98
|
+
Will set these elements when defined:
|
|
99
|
+
|
|
100
|
+
- Header element - `{testId}-header`
|
|
101
|
+
- Primary actions container - `{testId}-primary-actions`
|
|
102
|
+
- Secondary actions container - `{testId}-secondary-actions`
|
|
103
|
+
- Overflow menu popup - `{testId}-overflow-menu-popup`
|
|
104
|
+
- Overflow menu button - `{testId}-overflow-menu-trigger`
|
|
105
|
+
*/
|
|
106
|
+
testId?: string;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export declare const atlassianTheme: NavigationTheme;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* We aren't inheriting the types from button here because it blows up ERT.
|
|
113
|
+
*/
|
|
114
|
+
declare interface BaseIconButtonProps {
|
|
115
|
+
/**
|
|
116
|
+
* Unique id for the button.
|
|
117
|
+
*/
|
|
118
|
+
id?: string;
|
|
119
|
+
/**
|
|
120
|
+
* On click handler.
|
|
121
|
+
* Second argument is the instrumented analytics event.
|
|
122
|
+
* See @atlaskit/analytics-next for analyticsEvent type information
|
|
123
|
+
*/
|
|
124
|
+
onClick?: (event: React.MouseEvent<HTMLElement>, analyticsEvent: any) => void;
|
|
125
|
+
/**
|
|
126
|
+
* A `testId` prop is provided for specified elements,
|
|
127
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
128
|
+
* serving as a hook for automated tests
|
|
129
|
+
*/
|
|
130
|
+
testId?: string;
|
|
131
|
+
/**
|
|
132
|
+
* Text that will be displayed in the tooltip when hovered or focused on the button.
|
|
133
|
+
*/
|
|
134
|
+
tooltip: React.ReactNode;
|
|
135
|
+
/**
|
|
136
|
+
* Called when the mouse is initially clicked on the element.
|
|
137
|
+
*/
|
|
138
|
+
onMouseDown?: React.MouseEventHandler<HTMLElement>;
|
|
139
|
+
/**
|
|
140
|
+
* Called when the mouse enters the element container.
|
|
141
|
+
*/
|
|
142
|
+
onMouseEnter?: React.MouseEventHandler<HTMLElement>;
|
|
143
|
+
/**
|
|
144
|
+
* Called when the mouse leaves the element container.
|
|
145
|
+
*/
|
|
146
|
+
onMouseLeave?: React.MouseEventHandler<HTMLElement>;
|
|
147
|
+
/**
|
|
148
|
+
* Causes the button to be disabled.
|
|
149
|
+
*/
|
|
150
|
+
isDisabled?: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* If wanting to link to another page you can define the href.
|
|
153
|
+
*/
|
|
154
|
+
href?: string;
|
|
155
|
+
/**
|
|
156
|
+
* If defining `href` you may want to define `target` as well.
|
|
157
|
+
*/
|
|
158
|
+
target?: string;
|
|
159
|
+
/**
|
|
160
|
+
Allows for overriding the component used to render the button.
|
|
161
|
+
|
|
162
|
+
This is primarily intended for compatibility with custom
|
|
163
|
+
routing libraries when using the `href` prop.
|
|
164
|
+
|
|
165
|
+
For further usage information, refer to the [documentation for button](https://atlassian.design/components/button/code).
|
|
166
|
+
|
|
167
|
+
@example
|
|
168
|
+
```tsx
|
|
169
|
+
<Settings
|
|
170
|
+
component={CustomRouterLink}
|
|
171
|
+
href="/path/to/url"
|
|
172
|
+
/>
|
|
173
|
+
```
|
|
174
|
+
*/
|
|
175
|
+
component?: CustomThemeButtonProps['component'];
|
|
176
|
+
/**
|
|
177
|
+
* Handler for the mouse up event.
|
|
178
|
+
*/
|
|
179
|
+
onMouseUp?: React.MouseEventHandler<HTMLElement>;
|
|
180
|
+
/**
|
|
181
|
+
* Handler called when the button gains focus.
|
|
182
|
+
*/
|
|
183
|
+
onFocus?: React.FocusEventHandler<HTMLElement>;
|
|
184
|
+
/**
|
|
185
|
+
* Handler called when the button loses focus.
|
|
186
|
+
*/
|
|
187
|
+
onBlur?: React.FocusEventHandler<HTMLElement>;
|
|
188
|
+
/**
|
|
189
|
+
* Makes the element appear selected.
|
|
190
|
+
*/
|
|
191
|
+
isSelected?: boolean;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
declare type ButtonCSSContext = {
|
|
195
|
+
default: ButtonCSSProperties;
|
|
196
|
+
hover: ButtonCSSProperties;
|
|
197
|
+
focus: ButtonFocusCSSProperties;
|
|
198
|
+
active: ButtonCSSProperties;
|
|
199
|
+
selected: ButtonCSSProperties;
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
declare type ButtonCSSProperties = CSSProperties & {
|
|
203
|
+
boxShadow: string;
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
declare type ButtonFocusCSSProperties = {
|
|
207
|
+
boxShadow: string;
|
|
208
|
+
color: string;
|
|
209
|
+
backgroundColor: string;
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
export declare type Colors = {
|
|
213
|
+
backgroundColor: string;
|
|
214
|
+
color: string;
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
export declare const Create: ({
|
|
218
|
+
onClick,
|
|
219
|
+
href,
|
|
220
|
+
text,
|
|
221
|
+
buttonTooltip,
|
|
222
|
+
iconButtonTooltip,
|
|
223
|
+
testId,
|
|
224
|
+
}: CreateProps) => JSX.Element;
|
|
225
|
+
|
|
226
|
+
export declare type CreateCSS = ButtonCSSContext;
|
|
227
|
+
|
|
228
|
+
export declare interface CreateProps {
|
|
229
|
+
/**
|
|
230
|
+
* Primary text for the call to action.
|
|
231
|
+
*/
|
|
232
|
+
text: string;
|
|
233
|
+
/**
|
|
234
|
+
* Text for the button tooltip when seen on large viewports.
|
|
235
|
+
*/
|
|
236
|
+
buttonTooltip?: React_2.ReactNode;
|
|
237
|
+
/**
|
|
238
|
+
* Text for the icon button tooltip when seen on small viewports.
|
|
239
|
+
*/
|
|
240
|
+
iconButtonTooltip?: React_2.ReactNode;
|
|
241
|
+
/**
|
|
242
|
+
* Click handler.
|
|
243
|
+
* See @atlaskit/analytics-next for analyticsEvent type information
|
|
244
|
+
*/
|
|
245
|
+
onClick?: (e: React_2.MouseEvent<HTMLElement>, analyticsEvent: any) => void;
|
|
246
|
+
/**
|
|
247
|
+
* Causes the Create action to be rendered as a link. This is suitable for when the Create action is handled as a full page rather than in a modal-dialog.
|
|
248
|
+
*/
|
|
249
|
+
href?: string;
|
|
250
|
+
/**
|
|
251
|
+
* A `testId` prop is provided for specified elements,
|
|
252
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
253
|
+
* serving as a hook for automated tests.
|
|
254
|
+
|
|
255
|
+
* Will set these elements when defined:
|
|
256
|
+
|
|
257
|
+
* - Create button shown on large screen sizes - `{testId}-button`
|
|
258
|
+
* - Create icon button shown on small screen sizes - `{testId}-icon-button`
|
|
259
|
+
*/
|
|
260
|
+
testId?: string;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
declare type CSSProperties = CSSObject & {
|
|
264
|
+
backgroundColor: string;
|
|
265
|
+
color: string;
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
export declare const CustomProductHome: (
|
|
269
|
+
props: CustomProductHomeProps,
|
|
270
|
+
) => JSX.Element;
|
|
271
|
+
|
|
272
|
+
export declare interface CustomProductHomeProps {
|
|
273
|
+
/**
|
|
274
|
+
* Alt text for the icon that is displayed on small viewports.
|
|
275
|
+
*/
|
|
276
|
+
iconAlt: string;
|
|
277
|
+
/**
|
|
278
|
+
* Url for the icon that is displayed on small viewports.
|
|
279
|
+
*/
|
|
280
|
+
iconUrl: string;
|
|
281
|
+
/**
|
|
282
|
+
* Alt text for the icon that is displayed on large viewports.
|
|
283
|
+
*/
|
|
284
|
+
logoAlt: string;
|
|
285
|
+
/**
|
|
286
|
+
* Url for the icon that is displayed on large viewports.
|
|
287
|
+
*/
|
|
288
|
+
logoUrl: string;
|
|
289
|
+
/**
|
|
290
|
+
* Maximum width of the logo, in pixels. Defaults to 260px.
|
|
291
|
+
*/
|
|
292
|
+
logoMaxWidth?: number;
|
|
293
|
+
/**
|
|
294
|
+
* Optional onClick handler.
|
|
295
|
+
*/
|
|
296
|
+
onClick?: (event: MouseEvent_2<HTMLElement>) => void;
|
|
297
|
+
/**
|
|
298
|
+
* Optional mouseDown handler.
|
|
299
|
+
*/
|
|
300
|
+
onMouseDown?: (event: MouseEvent_2<HTMLElement>) => void;
|
|
301
|
+
/**
|
|
302
|
+
* Href to be passed to product home.
|
|
303
|
+
* Will add an interactive look and feel when defined.
|
|
304
|
+
*/
|
|
305
|
+
href?: string;
|
|
306
|
+
/**
|
|
307
|
+
* Name of the site that appears next to the logo
|
|
308
|
+
*/
|
|
309
|
+
siteTitle?: string;
|
|
310
|
+
/**
|
|
311
|
+
A `testId` prop is provided for specified elements,
|
|
312
|
+
which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
313
|
+
serving as a hook for automated tests.
|
|
314
|
+
|
|
315
|
+
Will set these elements when defined:
|
|
316
|
+
|
|
317
|
+
- Root element of the component - `{testId}-container`
|
|
318
|
+
- Product logo shown at large screen sizes - `{testId}-logo`
|
|
319
|
+
- Product icon shown at small screen sizes - `{testId}-icon`
|
|
320
|
+
- Site title - `{testId}-site-title`
|
|
321
|
+
*/
|
|
322
|
+
testId?: string;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
export declare const generateTheme: (
|
|
326
|
+
themeColors: GenerateThemeArgs,
|
|
327
|
+
) => NavigationTheme;
|
|
328
|
+
|
|
329
|
+
export declare type GenerateThemeArgs = {
|
|
330
|
+
/**
|
|
331
|
+
* Name of the theme.
|
|
332
|
+
* If you pass in "atlassian" will return the default atlassian theme and not
|
|
333
|
+
* use any of the colors you pass in.
|
|
334
|
+
*/
|
|
335
|
+
name?: string;
|
|
336
|
+
/**
|
|
337
|
+
* Main background color of the horizontal navigation bar.
|
|
338
|
+
*/
|
|
339
|
+
backgroundColor: string;
|
|
340
|
+
/**
|
|
341
|
+
* Highlight color for the navigation actions.
|
|
342
|
+
*/
|
|
343
|
+
highlightColor: string;
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
export declare const Help: React_2.ForwardRefExoticComponent<
|
|
347
|
+
BaseIconButtonProps & {
|
|
348
|
+
badge?: React_2.ComponentType<{}> | undefined;
|
|
349
|
+
} & React_2.RefAttributes<any>
|
|
350
|
+
>;
|
|
351
|
+
|
|
352
|
+
export declare type HelpProps = BaseIconButtonProps & {
|
|
353
|
+
/**
|
|
354
|
+
* Component to be used for the badge.
|
|
355
|
+
* Generally you'll want to use `NotificationIndicator` from [`@atlaskit/notification-indicator`](/packages/notifications/notification-indicator).
|
|
356
|
+
*/
|
|
357
|
+
badge?: ComponentType<{}>;
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
export declare const HORIZONTAL_GLOBAL_NAV_HEIGHT = 56;
|
|
361
|
+
|
|
362
|
+
export declare const IconButton: React_2.ForwardRefExoticComponent<
|
|
363
|
+
BaseIconButtonProps & {
|
|
364
|
+
icon: React_2.ReactChild | undefined;
|
|
365
|
+
theme?:
|
|
366
|
+
| ((
|
|
367
|
+
current: (props: ThemeProps) => ThemeTokens,
|
|
368
|
+
props: ThemeProps,
|
|
369
|
+
) => ThemeTokens)
|
|
370
|
+
| undefined;
|
|
371
|
+
} & React_2.RefAttributes<HTMLElement>
|
|
372
|
+
>;
|
|
373
|
+
|
|
374
|
+
export declare type IconButtonCSS = ButtonCSSContext;
|
|
375
|
+
|
|
376
|
+
export declare type IconButtonProps = BaseIconButtonProps & {
|
|
377
|
+
/**
|
|
378
|
+
* Icon for the button.
|
|
379
|
+
*/
|
|
380
|
+
icon: CustomThemeButtonProps['iconBefore'];
|
|
381
|
+
/**
|
|
382
|
+
* Theme for the icon button.
|
|
383
|
+
*/
|
|
384
|
+
theme?: CustomThemeButtonProps['theme'];
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
declare type LogoStyleProps = {
|
|
388
|
+
iconGradientStart?: string;
|
|
389
|
+
iconGradientStop?: string;
|
|
390
|
+
iconColor?: string;
|
|
391
|
+
textColor?: string;
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
export declare type Mode = {
|
|
395
|
+
create: CreateCSS;
|
|
396
|
+
iconButton: IconButtonCSS;
|
|
397
|
+
navigation: NavigationCSS;
|
|
398
|
+
primaryButton: PrimaryButtonCSS;
|
|
399
|
+
productHome: ProductHomeCSS;
|
|
400
|
+
search: SearchCSS;
|
|
401
|
+
skeleton: SkeletonCSS;
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
export declare type NavigationCSS = CSSProperties;
|
|
405
|
+
|
|
406
|
+
export declare type NavigationTheme = {
|
|
407
|
+
mode: Mode;
|
|
408
|
+
};
|
|
409
|
+
|
|
410
|
+
export declare const Notifications: React_2.ForwardRefExoticComponent<
|
|
411
|
+
BaseIconButtonProps & {
|
|
412
|
+
badge: React_2.ComponentType<{}>;
|
|
413
|
+
} & React_2.RefAttributes<any>
|
|
414
|
+
>;
|
|
415
|
+
|
|
416
|
+
export declare type NotificationsProps = BaseIconButtonProps & {
|
|
417
|
+
/**
|
|
418
|
+
* Component to be used for the badge.
|
|
419
|
+
* Generally you'll want to use `NotificationIndicator` from [`@atlaskit/notification-indicator`](/packages/notifications/notification-indicator).
|
|
420
|
+
*/
|
|
421
|
+
badge: ComponentType<{}>;
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
export declare const PrimaryButton: ForwardRefExoticComponent<
|
|
425
|
+
Omit<CustomThemeButtonProps_2, 'appearance' | 'onClick'> & {
|
|
426
|
+
component?:
|
|
427
|
+
| ComponentType<AllHTMLAttributes<HTMLElement>>
|
|
428
|
+
| ElementType<any>
|
|
429
|
+
| undefined;
|
|
430
|
+
isHighlighted?: boolean | undefined;
|
|
431
|
+
testId?: string | undefined;
|
|
432
|
+
tooltip?: ReactNode;
|
|
433
|
+
onClick?:
|
|
434
|
+
| ((
|
|
435
|
+
event: MouseEvent_2<HTMLElement, MouseEvent>,
|
|
436
|
+
analyticsEvent: any,
|
|
437
|
+
) => void)
|
|
438
|
+
| undefined;
|
|
439
|
+
} & RefAttributes<HTMLElement>
|
|
440
|
+
>;
|
|
441
|
+
|
|
442
|
+
export declare type PrimaryButtonCSS = ButtonCSSContext;
|
|
443
|
+
|
|
444
|
+
export declare type PrimaryButtonProps = Omit<
|
|
445
|
+
CustomThemeButtonProps,
|
|
446
|
+
'appearance' | 'onClick'
|
|
447
|
+
> & {
|
|
448
|
+
/**
|
|
449
|
+
Allows for overriding the component used to render the button.
|
|
450
|
+
|
|
451
|
+
This is primarily intended for compatibility with custom
|
|
452
|
+
routing libraries when using the `href` prop.
|
|
453
|
+
|
|
454
|
+
For further usage information, refer to the [documentation for button](https://atlassian.design/components/button/code).
|
|
455
|
+
|
|
456
|
+
@example
|
|
457
|
+
```tsx
|
|
458
|
+
<Settings
|
|
459
|
+
component={CustomRouterLink}
|
|
460
|
+
href="/path/to/url"
|
|
461
|
+
/>
|
|
462
|
+
```
|
|
463
|
+
*/
|
|
464
|
+
component?: ComponentType<AllHTMLAttributes<HTMLElement>> | ElementType<any>;
|
|
465
|
+
/**
|
|
466
|
+
* Will set the appearance of the button to look highlighted.
|
|
467
|
+
*/
|
|
468
|
+
isHighlighted?: boolean;
|
|
469
|
+
/**
|
|
470
|
+
* A `testId` prop is provided for specified elements,
|
|
471
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
472
|
+
* serving as a hook for automated tests
|
|
473
|
+
*/
|
|
474
|
+
testId?: string;
|
|
475
|
+
/**
|
|
476
|
+
* Optional text to show when the button is focused or hovered.
|
|
477
|
+
*/
|
|
478
|
+
tooltip?: React.ReactNode;
|
|
479
|
+
/**
|
|
480
|
+
* On click handler.
|
|
481
|
+
* See @atlaskit/analytics-next for analyticsEvent type information
|
|
482
|
+
*/
|
|
483
|
+
onClick?: (event: React.MouseEvent<HTMLElement>, analyticsEvent: any) => void;
|
|
484
|
+
};
|
|
485
|
+
|
|
486
|
+
export declare const PrimaryDropdownButton: ForwardRefExoticComponent<
|
|
487
|
+
Omit<PrimaryButtonProps, 'iconAfter'> & {
|
|
488
|
+
isHighlighted?: boolean | undefined;
|
|
489
|
+
testId?: string | undefined;
|
|
490
|
+
tooltip?: ReactNode;
|
|
491
|
+
} & RefAttributes<HTMLElement>
|
|
492
|
+
>;
|
|
493
|
+
|
|
494
|
+
export declare type PrimaryDropdownButtonProps = Omit<
|
|
495
|
+
PrimaryButtonProps,
|
|
496
|
+
'iconAfter'
|
|
497
|
+
> & {
|
|
498
|
+
/**
|
|
499
|
+
* Will set the appearance of the button to look highlighted.
|
|
500
|
+
*/
|
|
501
|
+
isHighlighted?: boolean;
|
|
502
|
+
/**
|
|
503
|
+
* A `testId` prop is provided for specified elements,
|
|
504
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
505
|
+
* serving as a hook for automated tests
|
|
506
|
+
*/
|
|
507
|
+
testId?: string;
|
|
508
|
+
/**
|
|
509
|
+
* Optional text to show when the button is focused or hovered.
|
|
510
|
+
*/
|
|
511
|
+
tooltip?: React.ReactNode;
|
|
512
|
+
};
|
|
513
|
+
|
|
514
|
+
export declare const ProductHome: ({
|
|
515
|
+
icon: Icon,
|
|
516
|
+
logo: Logo,
|
|
517
|
+
siteTitle,
|
|
518
|
+
onClick,
|
|
519
|
+
href,
|
|
520
|
+
onMouseDown,
|
|
521
|
+
testId,
|
|
522
|
+
logoMaxWidth,
|
|
523
|
+
...rest
|
|
524
|
+
}: ProductHomeProps) => JSX.Element;
|
|
525
|
+
|
|
526
|
+
declare type ProductHomeCSS = CSSProperties & LogoStyleProps;
|
|
527
|
+
|
|
528
|
+
export declare interface ProductHomeProps {
|
|
529
|
+
/**
|
|
530
|
+
* The product icon.
|
|
531
|
+
* Expected to be an Icon from the Atlaskit Logo package. Visible on smaller screen sizes
|
|
532
|
+
*/
|
|
533
|
+
icon: ComponentType<Partial<LogoProps>>;
|
|
534
|
+
/**
|
|
535
|
+
* The product logo,
|
|
536
|
+
* visible on larger screen sizes
|
|
537
|
+
*/
|
|
538
|
+
logo: ComponentType<Partial<LogoProps>>;
|
|
539
|
+
/**
|
|
540
|
+
* Maximum width in pixel, that logo can acquire. Defaults to 260px.
|
|
541
|
+
*/
|
|
542
|
+
logoMaxWidth?: number;
|
|
543
|
+
/**
|
|
544
|
+
* Optional onClick handler.
|
|
545
|
+
*/
|
|
546
|
+
onClick?: (event: MouseEvent_2<HTMLElement>) => void;
|
|
547
|
+
/**
|
|
548
|
+
* Optional mouseDown handler.
|
|
549
|
+
*/
|
|
550
|
+
onMouseDown?: (event: MouseEvent_2<HTMLElement>) => void;
|
|
551
|
+
/**
|
|
552
|
+
* Href to be passed to product home.
|
|
553
|
+
* Will add an interactive look and feel when defined.
|
|
554
|
+
*/
|
|
555
|
+
href?: string;
|
|
556
|
+
/**
|
|
557
|
+
* Name of the site that appears next to the logo.
|
|
558
|
+
*/
|
|
559
|
+
siteTitle?: string;
|
|
560
|
+
/**
|
|
561
|
+
A `testId` prop is provided for specified elements,
|
|
562
|
+
which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
563
|
+
serving as a hook for automated tests.
|
|
564
|
+
|
|
565
|
+
Will set these elements when defined:
|
|
566
|
+
|
|
567
|
+
- Root element of the component - `{testId}-container`
|
|
568
|
+
- Product logo shown at large screen sizes - `{testId}-logo`
|
|
569
|
+
- Product icon shown at small screen sizes - `{testId}-icon`
|
|
570
|
+
- Site title - `{testId}-site-title`
|
|
571
|
+
*/
|
|
572
|
+
testId?: string;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
export declare const Profile: ForwardRefExoticComponent<
|
|
576
|
+
BaseIconButtonProps & {
|
|
577
|
+
icon: ReactChild | undefined;
|
|
578
|
+
theme?:
|
|
579
|
+
| ((
|
|
580
|
+
current: (props: ThemeProps_2) => ThemeTokens_2,
|
|
581
|
+
props: ThemeProps_2,
|
|
582
|
+
) => ThemeTokens_2)
|
|
583
|
+
| undefined;
|
|
584
|
+
} & RefAttributes<HTMLElement>
|
|
585
|
+
>;
|
|
586
|
+
|
|
587
|
+
export declare type ProfileProps = IconButtonProps;
|
|
588
|
+
|
|
589
|
+
export declare const Search: (props: SearchProps) => JSX.Element;
|
|
590
|
+
|
|
591
|
+
export declare type SearchCSS = {
|
|
592
|
+
default: CSSProperties;
|
|
593
|
+
focus: CSSObject;
|
|
594
|
+
hover: CSSObject;
|
|
595
|
+
};
|
|
596
|
+
|
|
597
|
+
export declare type SearchProps = BaseIconButtonProps & {
|
|
598
|
+
/**
|
|
599
|
+
* Placeholder text for the search textbox.
|
|
600
|
+
*/
|
|
601
|
+
placeholder: string;
|
|
602
|
+
/**
|
|
603
|
+
* Used to describe the search icon and text field for users viewing the
|
|
604
|
+
* page with a screen reader
|
|
605
|
+
*/
|
|
606
|
+
label: string;
|
|
607
|
+
/**
|
|
608
|
+
* Value of search field.
|
|
609
|
+
*/
|
|
610
|
+
value?: string;
|
|
611
|
+
};
|
|
612
|
+
|
|
613
|
+
export declare const Settings: React_2.ForwardRefExoticComponent<
|
|
614
|
+
BaseIconButtonProps & React_2.RefAttributes<any>
|
|
615
|
+
>;
|
|
616
|
+
|
|
617
|
+
export declare type SettingsProps = BaseIconButtonProps;
|
|
618
|
+
|
|
619
|
+
export declare const SignIn: (props: SignInProps) => JSX.Element;
|
|
620
|
+
|
|
621
|
+
export declare type SignInProps = BaseIconButtonProps;
|
|
622
|
+
|
|
623
|
+
export declare type SkeletonCSS = CSSObject & {
|
|
624
|
+
backgroundColor: string;
|
|
625
|
+
opacity: number;
|
|
626
|
+
};
|
|
627
|
+
|
|
628
|
+
export declare const ThemeProvider: Provider<NavigationTheme>;
|
|
629
|
+
|
|
630
|
+
export declare const useOverflowStatus: () => {
|
|
631
|
+
isVisible: boolean;
|
|
632
|
+
openOverflowMenu: () => void;
|
|
633
|
+
closeOverflowMenu: () => void;
|
|
634
|
+
};
|
|
635
|
+
|
|
636
|
+
export {};
|
|
637
|
+
````
|