@atlaskit/navigation-system 10.8.0 → 10.9.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 +26 -0
- package/constellation/top-nav-items/examples.mdx +1 -4
- package/dist/cjs/ui/top-nav-items/nav-logo/app-logo.compiled.css +4 -1
- package/dist/cjs/ui/top-nav-items/nav-logo/app-logo.js +15 -3
- package/dist/es2019/ui/top-nav-items/nav-logo/app-logo.compiled.css +4 -1
- package/dist/es2019/ui/top-nav-items/nav-logo/app-logo.js +15 -3
- package/dist/esm/ui/top-nav-items/nav-logo/app-logo.compiled.css +4 -1
- package/dist/esm/ui/top-nav-items/nav-logo/app-logo.js +15 -3
- package/dist/types/ui/top-nav-items/nav-logo/app-logo.d.ts +16 -10
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @atlassian/navigation-system
|
|
2
2
|
|
|
3
|
+
## 10.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`994b264c96af8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/994b264c96af8) -
|
|
8
|
+
`AppLogo` now accepts an optional `secondaryName` prop, which renders supporting text below the
|
|
9
|
+
app name in wider viewports. This can be used to provide extra context for an app or experience
|
|
10
|
+
while keeping the existing `name`, `label`, and small-screen behavior unchanged.
|
|
11
|
+
|
|
12
|
+
```tsx
|
|
13
|
+
import { ConfluenceIcon } from '@atlaskit/logo/confluence-icon';
|
|
14
|
+
import { AppLogo } from '@atlaskit/navigation-system/top-nav-items';
|
|
15
|
+
|
|
16
|
+
<AppLogo
|
|
17
|
+
href="http://www.atlassian.design"
|
|
18
|
+
icon={ConfluenceIcon}
|
|
19
|
+
name="Confluence"
|
|
20
|
+
secondaryName="Documentation"
|
|
21
|
+
label="Home page"
|
|
22
|
+
/>;
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies
|
|
28
|
+
|
|
3
29
|
## 10.8.0
|
|
4
30
|
|
|
5
31
|
### Minor Changes
|
|
@@ -171,10 +171,7 @@ A button component that supports theming. The following variants are available:
|
|
|
171
171
|
Use this component when you need to add buttons to the top nav. Be aware that adding custom buttons
|
|
172
172
|
may negatively impact the consistency across apps.
|
|
173
173
|
|
|
174
|
-
<Example
|
|
175
|
-
Component={TopNavButtonExample}
|
|
176
|
-
featureFlagDefaults={{ 'platform-dst-motion-uplift-button': true }}
|
|
177
|
-
/>
|
|
174
|
+
<Example Component={TopNavButtonExample} />
|
|
178
175
|
|
|
179
176
|
## Responsive
|
|
180
177
|
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
._2rko19bv{border-radius:10px}
|
|
2
2
|
._2rko1mok{border-radius:var(--ds-radius-large,8px)}
|
|
3
3
|
._18zr1b66{padding-inline:var(--ds-space-050,4px)}._18m915vq{overflow-y:hidden}
|
|
4
|
+
._1bah1h6o{justify-content:center}
|
|
4
5
|
._1bsb1ris{width:max-content}
|
|
5
6
|
._1e0c1txw{display:flex}
|
|
6
7
|
._1e0cglyw{display:none}
|
|
7
8
|
._1o9zidpf{flex-shrink:0}
|
|
8
9
|
._1o9zkb7n{flex-shrink:1}
|
|
10
|
+
._1pfh1i6y{margin-block-start:var(--ds-space-negative-025,-2px)}
|
|
9
11
|
._1reo15vq{overflow-x:hidden}
|
|
10
12
|
._1toh1r31._1toh1r31{text-decoration-color:currentColor}
|
|
11
13
|
._1w901kw7._1w901kw7{color:inherit}
|
|
14
|
+
._2lx21bp4{flex-direction:column}
|
|
12
15
|
._4cvr1h6o{align-items:center}
|
|
13
16
|
._4t3izwfg{height:2pc}
|
|
14
17
|
._5jyqglyw._5jyqglyw{text-decoration-line:none}
|
|
@@ -24,4 +27,4 @@
|
|
|
24
27
|
._irr31rps:hover{background-color:var(--ds-top-bar-button-background-hovered)}
|
|
25
28
|
._1di69yc7:active{background-color:var(--ds-background-neutral-subtle-pressed,#0b120e24)!important}
|
|
26
29
|
._1di6yhlj:active{background-color:var(--ds-top-bar-button-background-pressed)!important}
|
|
27
|
-
@media (min-width:64rem){.
|
|
30
|
+
@media (min-width:64rem){._10y41txw._10y41txw{display:flex}}
|
|
@@ -34,14 +34,16 @@ var iconContainerStyles = {
|
|
|
34
34
|
fullHeightSidebar: "_1o9zidpf"
|
|
35
35
|
};
|
|
36
36
|
var logoTextStyles = {
|
|
37
|
-
root: "_1bsb1ris _p12fnklw _uiztglyw _y4tiv77o _1e0cglyw
|
|
37
|
+
root: "_1bsb1ris _p12fnklw _uiztglyw _y4tiv77o _1e0cglyw _2lx21bp4 _1bah1h6o _10y41txw"
|
|
38
|
+
};
|
|
39
|
+
var secondaryNameStyles = {
|
|
40
|
+
root: "_1pfh1i6y"
|
|
38
41
|
};
|
|
39
42
|
function isTextClamped(element) {
|
|
40
43
|
// Checking for vertical height rather than horizontal height.
|
|
41
44
|
// When text is "clamped", it's technically being clamped vertically! 🤯
|
|
42
45
|
return element.scrollHeight > element.clientHeight;
|
|
43
46
|
}
|
|
44
|
-
|
|
45
47
|
/**
|
|
46
48
|
* __App logo__
|
|
47
49
|
*
|
|
@@ -52,6 +54,7 @@ function isTextClamped(element) {
|
|
|
52
54
|
var AppLogo = exports.AppLogo = function AppLogo(_ref) {
|
|
53
55
|
var name = _ref.name,
|
|
54
56
|
label = _ref.label,
|
|
57
|
+
secondaryName = _ref.secondaryName,
|
|
55
58
|
href = _ref.href,
|
|
56
59
|
icon = _ref.icon,
|
|
57
60
|
onClick = _ref.onClick;
|
|
@@ -59,6 +62,7 @@ var AppLogo = exports.AppLogo = function AppLogo(_ref) {
|
|
|
59
62
|
var ref = (0, _react.useRef)(null);
|
|
60
63
|
var nameRef = (0, _react.useRef)(null);
|
|
61
64
|
var hasCustomTheme = (0, _hasCustomThemeContext.useHasCustomTheme)();
|
|
65
|
+
var showSecondaryName = Boolean(secondaryName) && (0, _platformFeatureFlags.fg)('platform_dst_ads_appswitcher_improvements');
|
|
62
66
|
|
|
63
67
|
/**
|
|
64
68
|
* Show the tooltip if the name is truncated
|
|
@@ -107,5 +111,13 @@ var AppLogo = exports.AppLogo = function AppLogo(_ref) {
|
|
|
107
111
|
maxLines: 1,
|
|
108
112
|
ref: nameRef
|
|
109
113
|
}, name));
|
|
110
|
-
})
|
|
114
|
+
}), showSecondaryName && /*#__PURE__*/_react.default.createElement("span", {
|
|
115
|
+
className: (0, _runtime.ax)([secondaryNameStyles.root])
|
|
116
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
117
|
+
"aria-hidden": true,
|
|
118
|
+
color: "color.text.subtlest",
|
|
119
|
+
weight: "regular",
|
|
120
|
+
maxLines: 1,
|
|
121
|
+
size: "small"
|
|
122
|
+
}, secondaryName)))));
|
|
111
123
|
};
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
._2rko19bv{border-radius:10px}
|
|
2
2
|
._2rko1mok{border-radius:var(--ds-radius-large,8px)}
|
|
3
3
|
._18zr1b66{padding-inline:var(--ds-space-050,4px)}._18m915vq{overflow-y:hidden}
|
|
4
|
+
._1bah1h6o{justify-content:center}
|
|
4
5
|
._1bsb1ris{width:max-content}
|
|
5
6
|
._1e0c1txw{display:flex}
|
|
6
7
|
._1e0cglyw{display:none}
|
|
7
8
|
._1o9zidpf{flex-shrink:0}
|
|
8
9
|
._1o9zkb7n{flex-shrink:1}
|
|
10
|
+
._1pfh1i6y{margin-block-start:var(--ds-space-negative-025,-2px)}
|
|
9
11
|
._1reo15vq{overflow-x:hidden}
|
|
10
12
|
._1toh1r31._1toh1r31{text-decoration-color:currentColor}
|
|
11
13
|
._1w901kw7._1w901kw7{color:inherit}
|
|
14
|
+
._2lx21bp4{flex-direction:column}
|
|
12
15
|
._4cvr1h6o{align-items:center}
|
|
13
16
|
._4t3izwfg{height:2pc}
|
|
14
17
|
._5jyqglyw._5jyqglyw{text-decoration-line:none}
|
|
@@ -24,4 +27,4 @@
|
|
|
24
27
|
._irr31rps:hover{background-color:var(--ds-top-bar-button-background-hovered)}
|
|
25
28
|
._1di69yc7:active{background-color:var(--ds-background-neutral-subtle-pressed,#0b120e24)!important}
|
|
26
29
|
._1di6yhlj:active{background-color:var(--ds-top-bar-button-background-pressed)!important}
|
|
27
|
-
@media (min-width:64rem){.
|
|
30
|
+
@media (min-width:64rem){._10y41txw._10y41txw{display:flex}}
|
|
@@ -25,14 +25,16 @@ const iconContainerStyles = {
|
|
|
25
25
|
fullHeightSidebar: "_1o9zidpf"
|
|
26
26
|
};
|
|
27
27
|
const logoTextStyles = {
|
|
28
|
-
root: "_1bsb1ris _p12fnklw _uiztglyw _y4tiv77o _1e0cglyw
|
|
28
|
+
root: "_1bsb1ris _p12fnklw _uiztglyw _y4tiv77o _1e0cglyw _2lx21bp4 _1bah1h6o _10y41txw"
|
|
29
|
+
};
|
|
30
|
+
const secondaryNameStyles = {
|
|
31
|
+
root: "_1pfh1i6y"
|
|
29
32
|
};
|
|
30
33
|
function isTextClamped(element) {
|
|
31
34
|
// Checking for vertical height rather than horizontal height.
|
|
32
35
|
// When text is "clamped", it's technically being clamped vertically! 🤯
|
|
33
36
|
return element.scrollHeight > element.clientHeight;
|
|
34
37
|
}
|
|
35
|
-
|
|
36
38
|
/**
|
|
37
39
|
* __App logo__
|
|
38
40
|
*
|
|
@@ -43,6 +45,7 @@ function isTextClamped(element) {
|
|
|
43
45
|
export const AppLogo = ({
|
|
44
46
|
name,
|
|
45
47
|
label,
|
|
48
|
+
secondaryName,
|
|
46
49
|
href,
|
|
47
50
|
icon,
|
|
48
51
|
onClick
|
|
@@ -51,6 +54,7 @@ export const AppLogo = ({
|
|
|
51
54
|
const ref = useRef(null);
|
|
52
55
|
const nameRef = useRef(null);
|
|
53
56
|
const hasCustomTheme = useHasCustomTheme();
|
|
57
|
+
const showSecondaryName = Boolean(secondaryName) && fg('platform_dst_ads_appswitcher_improvements');
|
|
54
58
|
|
|
55
59
|
/**
|
|
56
60
|
* Show the tooltip if the name is truncated
|
|
@@ -97,5 +101,13 @@ export const AppLogo = ({
|
|
|
97
101
|
weight: "semibold",
|
|
98
102
|
maxLines: 1,
|
|
99
103
|
ref: nameRef
|
|
100
|
-
}, name)))
|
|
104
|
+
}, name))), showSecondaryName && /*#__PURE__*/React.createElement("span", {
|
|
105
|
+
className: ax([secondaryNameStyles.root])
|
|
106
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
107
|
+
"aria-hidden": true,
|
|
108
|
+
color: "color.text.subtlest",
|
|
109
|
+
weight: "regular",
|
|
110
|
+
maxLines: 1,
|
|
111
|
+
size: "small"
|
|
112
|
+
}, secondaryName)))));
|
|
101
113
|
};
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
._2rko19bv{border-radius:10px}
|
|
2
2
|
._2rko1mok{border-radius:var(--ds-radius-large,8px)}
|
|
3
3
|
._18zr1b66{padding-inline:var(--ds-space-050,4px)}._18m915vq{overflow-y:hidden}
|
|
4
|
+
._1bah1h6o{justify-content:center}
|
|
4
5
|
._1bsb1ris{width:max-content}
|
|
5
6
|
._1e0c1txw{display:flex}
|
|
6
7
|
._1e0cglyw{display:none}
|
|
7
8
|
._1o9zidpf{flex-shrink:0}
|
|
8
9
|
._1o9zkb7n{flex-shrink:1}
|
|
10
|
+
._1pfh1i6y{margin-block-start:var(--ds-space-negative-025,-2px)}
|
|
9
11
|
._1reo15vq{overflow-x:hidden}
|
|
10
12
|
._1toh1r31._1toh1r31{text-decoration-color:currentColor}
|
|
11
13
|
._1w901kw7._1w901kw7{color:inherit}
|
|
14
|
+
._2lx21bp4{flex-direction:column}
|
|
12
15
|
._4cvr1h6o{align-items:center}
|
|
13
16
|
._4t3izwfg{height:2pc}
|
|
14
17
|
._5jyqglyw._5jyqglyw{text-decoration-line:none}
|
|
@@ -24,4 +27,4 @@
|
|
|
24
27
|
._irr31rps:hover{background-color:var(--ds-top-bar-button-background-hovered)}
|
|
25
28
|
._1di69yc7:active{background-color:var(--ds-background-neutral-subtle-pressed,#0b120e24)!important}
|
|
26
29
|
._1di6yhlj:active{background-color:var(--ds-top-bar-button-background-pressed)!important}
|
|
27
|
-
@media (min-width:64rem){.
|
|
30
|
+
@media (min-width:64rem){._10y41txw._10y41txw{display:flex}}
|
|
@@ -25,14 +25,16 @@ var iconContainerStyles = {
|
|
|
25
25
|
fullHeightSidebar: "_1o9zidpf"
|
|
26
26
|
};
|
|
27
27
|
var logoTextStyles = {
|
|
28
|
-
root: "_1bsb1ris _p12fnklw _uiztglyw _y4tiv77o _1e0cglyw
|
|
28
|
+
root: "_1bsb1ris _p12fnklw _uiztglyw _y4tiv77o _1e0cglyw _2lx21bp4 _1bah1h6o _10y41txw"
|
|
29
|
+
};
|
|
30
|
+
var secondaryNameStyles = {
|
|
31
|
+
root: "_1pfh1i6y"
|
|
29
32
|
};
|
|
30
33
|
function isTextClamped(element) {
|
|
31
34
|
// Checking for vertical height rather than horizontal height.
|
|
32
35
|
// When text is "clamped", it's technically being clamped vertically! 🤯
|
|
33
36
|
return element.scrollHeight > element.clientHeight;
|
|
34
37
|
}
|
|
35
|
-
|
|
36
38
|
/**
|
|
37
39
|
* __App logo__
|
|
38
40
|
*
|
|
@@ -43,6 +45,7 @@ function isTextClamped(element) {
|
|
|
43
45
|
export var AppLogo = function AppLogo(_ref) {
|
|
44
46
|
var name = _ref.name,
|
|
45
47
|
label = _ref.label,
|
|
48
|
+
secondaryName = _ref.secondaryName,
|
|
46
49
|
href = _ref.href,
|
|
47
50
|
icon = _ref.icon,
|
|
48
51
|
onClick = _ref.onClick;
|
|
@@ -50,6 +53,7 @@ export var AppLogo = function AppLogo(_ref) {
|
|
|
50
53
|
var ref = useRef(null);
|
|
51
54
|
var nameRef = useRef(null);
|
|
52
55
|
var hasCustomTheme = useHasCustomTheme();
|
|
56
|
+
var showSecondaryName = Boolean(secondaryName) && fg('platform_dst_ads_appswitcher_improvements');
|
|
53
57
|
|
|
54
58
|
/**
|
|
55
59
|
* Show the tooltip if the name is truncated
|
|
@@ -98,5 +102,13 @@ export var AppLogo = function AppLogo(_ref) {
|
|
|
98
102
|
maxLines: 1,
|
|
99
103
|
ref: nameRef
|
|
100
104
|
}, name));
|
|
101
|
-
})
|
|
105
|
+
}), showSecondaryName && /*#__PURE__*/React.createElement("span", {
|
|
106
|
+
className: ax([secondaryNameStyles.root])
|
|
107
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
108
|
+
"aria-hidden": true,
|
|
109
|
+
color: "color.text.subtlest",
|
|
110
|
+
weight: "regular",
|
|
111
|
+
maxLines: 1,
|
|
112
|
+
size: "small"
|
|
113
|
+
}, secondaryName)))));
|
|
102
114
|
};
|
|
@@ -4,18 +4,15 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import type { LogoProps } from '@atlaskit/logo';
|
|
7
|
-
|
|
8
|
-
* __App logo__
|
|
9
|
-
*
|
|
10
|
-
* The app logo for the top navigation.
|
|
11
|
-
*
|
|
12
|
-
* To provide a responsive experience, label text will render next to an icon at larger viewports.
|
|
13
|
-
*/
|
|
14
|
-
export declare const AppLogo: ({ name, label, href, icon, onClick, }: {
|
|
7
|
+
interface AppLogoProps {
|
|
15
8
|
/**
|
|
16
|
-
* The name of the app. Will be displayed next to the logo in wider viewports
|
|
9
|
+
* The name of the app. Will be displayed next to the logo in wider viewports.
|
|
17
10
|
*/
|
|
18
11
|
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* Provide a secondaryName for the app. Will be displayed below the name in wider viewports.
|
|
14
|
+
*/
|
|
15
|
+
secondaryName?: string;
|
|
19
16
|
/**
|
|
20
17
|
* Provide an accessible label, often used by screen readers.
|
|
21
18
|
* This label should include the name of the app, and if applicable,
|
|
@@ -34,4 +31,13 @@ export declare const AppLogo: ({ name, label, href, icon, onClick, }: {
|
|
|
34
31
|
* Handler called on click.
|
|
35
32
|
*/
|
|
36
33
|
onClick?: React.MouseEventHandler<HTMLAnchorElement>;
|
|
37
|
-
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* __App logo__
|
|
37
|
+
*
|
|
38
|
+
* The app logo for the top navigation.
|
|
39
|
+
*
|
|
40
|
+
* To provide a responsive experience, label text will render next to an icon at larger viewports.
|
|
41
|
+
*/
|
|
42
|
+
export declare const AppLogo: ({ name, label, secondaryName, href, icon, onClick, }: AppLogoProps) => JSX.Element;
|
|
43
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/navigation-system",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.9.0",
|
|
4
4
|
"description": "The latest navigation system for Atlassian apps.",
|
|
5
5
|
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
6
6
|
"author": "Atlassian Pty Ltd",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@atlaskit/button": "^24.3.0",
|
|
60
60
|
"@atlaskit/css": "^1.0.0",
|
|
61
61
|
"@atlaskit/ds-lib": "^8.0.0",
|
|
62
|
-
"@atlaskit/icon": "^37.
|
|
62
|
+
"@atlaskit/icon": "^37.2.0",
|
|
63
63
|
"@atlaskit/layering": "^5.0.0",
|
|
64
64
|
"@atlaskit/logo": "^21.4.0",
|
|
65
65
|
"@atlaskit/motion": "^7.5.0",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"@atlaskit/top-layer": "^1.10.0",
|
|
112
112
|
"@atlassian/feature-flags-test-utils": "^1.2.0",
|
|
113
113
|
"@atlassian/gemini": "^1.51.0",
|
|
114
|
-
"@atlassian/search-dialog": "^10.
|
|
114
|
+
"@atlassian/search-dialog": "^10.6.0",
|
|
115
115
|
"@atlassian/ssr-tests": "workspace:^",
|
|
116
116
|
"@atlassian/test-utils": "^1.1.0",
|
|
117
117
|
"@atlassian/testing-library": "^0.11.0",
|