@atlaskit/navigation-system 0.167.2 → 0.168.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/afm-volt/tsconfig.json +75 -0
- package/dist/cjs/entry-points/top-nav-items/index.js +8 -1
- package/dist/cjs/index.js +8 -1
- package/dist/cjs/ui/page-layout/side-nav/toggle-button.js +1 -6
- package/dist/cjs/ui/top-nav-items/nav-logo/app-logo.compiled.css +24 -0
- package/dist/cjs/ui/top-nav-items/nav-logo/app-logo.js +104 -0
- package/dist/cjs/ui/top-nav-items/nav-logo/logo-renderer.js +42 -0
- package/dist/cjs/ui/top-nav-items/{nav-logo.compiled.css → nav-logo/nav-logo.compiled.css} +1 -1
- package/dist/cjs/ui/top-nav-items/{nav-logo.js → nav-logo/nav-logo.js} +8 -33
- package/dist/cjs/ui/top-nav-items/themed/get-custom-theme-styles.js +1 -1
- package/dist/es2019/entry-points/top-nav-items/index.js +2 -1
- package/dist/es2019/index.js +2 -1
- package/dist/es2019/ui/page-layout/side-nav/toggle-button.js +1 -6
- package/dist/es2019/ui/top-nav-items/nav-logo/app-logo.compiled.css +24 -0
- package/dist/es2019/ui/top-nav-items/nav-logo/app-logo.js +94 -0
- package/dist/es2019/ui/top-nav-items/nav-logo/logo-renderer.js +35 -0
- package/dist/{esm/ui/top-nav-items → es2019/ui/top-nav-items/nav-logo}/nav-logo.compiled.css +1 -1
- package/dist/es2019/ui/top-nav-items/{nav-logo.js → nav-logo/nav-logo.js} +9 -36
- package/dist/es2019/ui/top-nav-items/themed/get-custom-theme-styles.js +1 -1
- package/dist/esm/entry-points/top-nav-items/index.js +2 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/ui/page-layout/side-nav/toggle-button.js +1 -6
- package/dist/esm/ui/top-nav-items/nav-logo/app-logo.compiled.css +24 -0
- package/dist/esm/ui/top-nav-items/nav-logo/app-logo.js +95 -0
- package/dist/esm/ui/top-nav-items/nav-logo/logo-renderer.js +33 -0
- package/dist/{es2019/ui/top-nav-items → esm/ui/top-nav-items/nav-logo}/nav-logo.compiled.css +1 -1
- package/dist/esm/ui/top-nav-items/{nav-logo.js → nav-logo/nav-logo.js} +9 -34
- package/dist/esm/ui/top-nav-items/themed/get-custom-theme-styles.js +1 -1
- package/dist/types/entry-points/top-nav-items/index.d.ts +2 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/ui/top-nav-items/nav-logo/app-logo.d.ts +38 -0
- package/dist/types/ui/top-nav-items/nav-logo/logo-renderer.d.ts +14 -0
- package/dist/types/ui/top-nav-items/{nav-logo.d.ts → nav-logo/nav-logo.d.ts} +1 -1
- package/dist/types-ts4.5/entry-points/top-nav-items/index.d.ts +2 -1
- package/dist/types-ts4.5/index.d.ts +2 -1
- package/dist/types-ts4.5/ui/top-nav-items/nav-logo/app-logo.d.ts +38 -0
- package/dist/types-ts4.5/ui/top-nav-items/nav-logo/logo-renderer.d.ts +14 -0
- package/dist/types-ts4.5/ui/top-nav-items/{nav-logo.d.ts → nav-logo/nav-logo.d.ts} +1 -1
- package/examples/top-nav-side-nav-collapsed.tsx +1 -1
- package/examples/top-nav-with-long-name.tsx +63 -0
- package/examples/top-nav-with-temp-nav-app-icon.tsx +5 -5
- package/examples/top-navigation-stress.tsx +15 -12
- package/examples/top-navigation-theming-with-picker.tsx +17 -8
- package/examples/top-navigation-theming.tsx +16 -6
- package/examples/top-navigation.tsx +17 -7
- package/package.json +1 -2
- package/src/entry-points/top-nav-items/index.tsx +2 -1
- package/src/index.tsx +2 -1
- package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/top-nav/breakpoint-lg---with-min-widths--firefox.png +0 -0
- package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/top-nav/breakpoint-lg--firefox.png +0 -0
- package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/top-nav/breakpoint-md---with-min-widths--firefox.png +0 -0
- package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/top-nav/breakpoint-md--firefox.png +0 -0
- package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/top-nav/breakpoint-sm---with-min-widths--firefox.png +0 -0
- package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/top-nav/breakpoint-sm--firefox.png +0 -0
- package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/top-nav/breakpoint-xl---with-min-widths--firefox.png +0 -0
- package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/top-nav/breakpoint-xl--firefox.png +0 -0
- package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/top-nav/breakpoint-xs---with-min-widths--firefox.png +0 -0
- package/src/ui/page-layout/__tests__/informational-vr-tests/__snapshots__/top-nav/breakpoint-xs--firefox.png +0 -0
- package/src/ui/page-layout/side-nav/toggle-button.tsx +1 -11
- package/src/ui/top-nav-items/__tests__/informational-vr-tests/__snapshots__/top-navigation/long-product-name-tooltip--default.png +0 -0
- package/src/ui/top-nav-items/__tests__/informational-vr-tests/__snapshots__/top-navigation/nav-logo-hover---custom-theming--desktop.png +0 -0
- package/src/ui/top-nav-items/__tests__/informational-vr-tests/__snapshots__/top-navigation/nav-logo-hover--desktop.png +0 -0
- package/src/ui/top-nav-items/__tests__/informational-vr-tests/__snapshots__/top-navigation/nav-logo-pressed---custom-theming--desktop.png +0 -0
- package/src/ui/top-nav-items/__tests__/informational-vr-tests/__snapshots__/top-navigation/nav-logo-pressed---custom-theming--mobile.png +0 -0
- package/src/ui/top-nav-items/__tests__/informational-vr-tests/__snapshots__/top-navigation/nav-logo-pressed--desktop.png +0 -0
- package/src/ui/top-nav-items/__tests__/informational-vr-tests/top-navigation.vr.tsx +18 -0
- package/src/ui/top-nav-items/__tests__/unit/top-nav-items.test.tsx +1 -1
- package/src/ui/top-nav-items/__tests__/vr-tests/__snapshots__/top-navigation/theming-is-enabled--desktop--platform-team25-app-icon-tiles-true.png +0 -0
- package/src/ui/top-nav-items/__tests__/vr-tests/__snapshots__/top-navigation/top-navigation-example--desktop--platform-team25-app-icon-tiles-true.png +0 -0
- package/src/ui/top-nav-items/nav-logo/app-logo.tsx +213 -0
- package/src/ui/top-nav-items/nav-logo/logo-renderer.tsx +53 -0
- package/src/ui/top-nav-items/{nav-logo.tsx → nav-logo/nav-logo.tsx} +12 -43
- package/src/ui/top-nav-items/themed/get-custom-theme-styles.tsx +1 -1
|
@@ -10,17 +10,17 @@ import {
|
|
|
10
10
|
TopNavStart,
|
|
11
11
|
} from '@atlaskit/navigation-system/layout/top-nav';
|
|
12
12
|
import {
|
|
13
|
+
AppLogo,
|
|
13
14
|
AppSwitcher,
|
|
14
15
|
ChatButton,
|
|
15
16
|
CreateButton,
|
|
16
17
|
Help,
|
|
17
|
-
NavLogo,
|
|
18
18
|
Notifications,
|
|
19
19
|
Profile,
|
|
20
20
|
Search,
|
|
21
21
|
Settings,
|
|
22
22
|
} from '@atlaskit/navigation-system/top-nav-items';
|
|
23
|
-
import { FocusIcon
|
|
23
|
+
import { FocusIcon } from '@atlaskit/temp-nav-app-icons/focus';
|
|
24
24
|
|
|
25
25
|
import { WithResponsiveViewport } from './utils/example-utils';
|
|
26
26
|
|
|
@@ -38,10 +38,10 @@ export default function TopNavWithTempNavAppIcon() {
|
|
|
38
38
|
<TopNavStart>
|
|
39
39
|
<SideNavToggleButton collapseLabel="Collapse sidebar" expandLabel="Expand sidebar" />
|
|
40
40
|
<AppSwitcher label="App switcher" />
|
|
41
|
-
<
|
|
41
|
+
<AppLogo
|
|
42
42
|
href="http://www.atlassian.design"
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
icon={FocusIcon}
|
|
44
|
+
name="Focus"
|
|
45
45
|
label="Home page"
|
|
46
46
|
/>
|
|
47
47
|
</TopNavStart>
|
|
@@ -12,7 +12,6 @@ import DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdow
|
|
|
12
12
|
import Heading from '@atlaskit/heading';
|
|
13
13
|
import AiChatIcon from '@atlaskit/icon/core/ai-chat';
|
|
14
14
|
import PremiumIcon from '@atlaskit/icon/core/premium';
|
|
15
|
-
import { AtlassianAdministrationIcon, AtlassianAdministrationLogo } from '@atlaskit/logo';
|
|
16
15
|
import { TopNavButton } from '@atlaskit/navigation-system/experimental/top-nav-button';
|
|
17
16
|
import { SideNavToggleButton } from '@atlaskit/navigation-system/layout/side-nav';
|
|
18
17
|
import {
|
|
@@ -23,6 +22,7 @@ import {
|
|
|
23
22
|
} from '@atlaskit/navigation-system/layout/top-nav';
|
|
24
23
|
import { MenuListItem } from '@atlaskit/navigation-system/side-nav-items/menu-list-item';
|
|
25
24
|
import {
|
|
25
|
+
AppLogo,
|
|
26
26
|
AppSwitcher,
|
|
27
27
|
CreateButton,
|
|
28
28
|
CustomTitle,
|
|
@@ -33,24 +33,27 @@ import {
|
|
|
33
33
|
Settings,
|
|
34
34
|
} from '@atlaskit/navigation-system/top-nav-items';
|
|
35
35
|
import { Stack } from '@atlaskit/primitives/compiled';
|
|
36
|
-
import { ConfluenceIcon
|
|
36
|
+
import { ConfluenceIcon } from '@atlaskit/temp-nav-app-icons/confluence';
|
|
37
37
|
import { EditionAwarenessButton } from '@atlassian/growth-pattern-library-edition-awareness-button';
|
|
38
38
|
|
|
39
|
+
import placeholder200x20 from './images/200x20.png';
|
|
39
40
|
import { WithResponsiveViewport } from './utils/example-utils';
|
|
40
41
|
import { MockRoot } from './utils/mock-root';
|
|
41
42
|
import { MockSearch } from './utils/mock-search';
|
|
42
43
|
|
|
44
|
+
|
|
43
45
|
const connieNavLogo = (
|
|
44
|
-
<
|
|
46
|
+
<AppLogo href="" icon={ConfluenceIcon} name="Confluence" label="Home page" />
|
|
45
47
|
);
|
|
46
|
-
|
|
48
|
+
// Stress test nav responsive behaviour with a wide logo
|
|
49
|
+
const wideNavLogo = (
|
|
47
50
|
<NavLogo
|
|
48
51
|
href=""
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
icon={() => <img alt="" src={placeholder200x20} />}
|
|
53
|
+
logo={() => <img alt="" src={placeholder200x20} />}
|
|
51
54
|
label="Home page"
|
|
52
55
|
/>
|
|
53
|
-
)
|
|
56
|
+
)
|
|
54
57
|
|
|
55
58
|
const defaultTopNavEnd = (
|
|
56
59
|
<Fragment>
|
|
@@ -138,7 +141,7 @@ export default function TopNavigationStressExample() {
|
|
|
138
141
|
<Heading as="h2" size="small">
|
|
139
142
|
Wide left column
|
|
140
143
|
</Heading>
|
|
141
|
-
<TopNavigationInstance navLogo={
|
|
144
|
+
<TopNavigationInstance navLogo={wideNavLogo} />
|
|
142
145
|
</Stack>
|
|
143
146
|
|
|
144
147
|
<Stack space="space.100">
|
|
@@ -159,7 +162,7 @@ export default function TopNavigationStressExample() {
|
|
|
159
162
|
<Heading as="h2" size="small">
|
|
160
163
|
Wide left and right column
|
|
161
164
|
</Heading>
|
|
162
|
-
<TopNavigationInstance navLogo={
|
|
165
|
+
<TopNavigationInstance navLogo={wideNavLogo} topNavEnd={extendedTopNavEnd} />
|
|
163
166
|
</Stack>
|
|
164
167
|
|
|
165
168
|
<Stack space="space.100">
|
|
@@ -167,7 +170,7 @@ export default function TopNavigationStressExample() {
|
|
|
167
170
|
No create button
|
|
168
171
|
</Heading>
|
|
169
172
|
<TopNavigationInstance
|
|
170
|
-
navLogo={
|
|
173
|
+
navLogo={wideNavLogo}
|
|
171
174
|
topNavEnd={extendedTopNavEnd}
|
|
172
175
|
topNavMiddle={<MockSearch />}
|
|
173
176
|
/>
|
|
@@ -178,7 +181,7 @@ export default function TopNavigationStressExample() {
|
|
|
178
181
|
No common actions
|
|
179
182
|
</Heading>
|
|
180
183
|
<TopNavigationInstance
|
|
181
|
-
navLogo={
|
|
184
|
+
navLogo={wideNavLogo}
|
|
182
185
|
topNavEnd={extendedTopNavEnd}
|
|
183
186
|
topNavMiddle={null}
|
|
184
187
|
/>
|
|
@@ -189,7 +192,7 @@ export default function TopNavigationStressExample() {
|
|
|
189
192
|
Extra common actions
|
|
190
193
|
</Heading>
|
|
191
194
|
<TopNavigationInstance
|
|
192
|
-
navLogo={
|
|
195
|
+
navLogo={wideNavLogo}
|
|
193
196
|
topNavEnd={extendedTopNavEnd}
|
|
194
197
|
topNavMiddle={
|
|
195
198
|
<Fragment>
|
|
@@ -9,7 +9,7 @@ import { jsx } from '@compiled/react';
|
|
|
9
9
|
import AKBadge from '@atlaskit/badge';
|
|
10
10
|
import { Label } from '@atlaskit/form';
|
|
11
11
|
import { AtlassianIcon, AtlassianLogo } from '@atlaskit/logo';
|
|
12
|
-
import { Main, Root, SideNav } from '@atlaskit/navigation-system';
|
|
12
|
+
import { AppLogo, Main, Root, SideNav } from '@atlaskit/navigation-system';
|
|
13
13
|
import { SideNavToggleButton } from '@atlaskit/navigation-system/layout/side-nav';
|
|
14
14
|
import {
|
|
15
15
|
TopNav,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
} from '@atlaskit/navigation-system/top-nav-items';
|
|
29
29
|
import { Notifications } from '@atlaskit/navigation-system/top-nav-items/notifications';
|
|
30
30
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
31
|
-
import { JiraIcon
|
|
31
|
+
import { JiraIcon } from '@atlaskit/temp-nav-app-icons/jira';
|
|
32
32
|
|
|
33
33
|
// TODO: consider exposing this type properly, but it isn't needed for normal usage
|
|
34
34
|
// eslint-disable-next-line @atlaskit/platform/use-entrypoints-in-examples
|
|
@@ -68,12 +68,21 @@ const TopNavigation = ({ customTheme }: { customTheme?: CustomTheme }) => {
|
|
|
68
68
|
onClick={toggleIsAppSwitcherSelected}
|
|
69
69
|
isSelected={isAppSwitcherSelected}
|
|
70
70
|
/>
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
71
|
+
{fg('platform-team25-app-icon-tiles') ? (
|
|
72
|
+
<AppLogo
|
|
73
|
+
href="http://www.atlassian.design"
|
|
74
|
+
icon={JiraIcon}
|
|
75
|
+
name="Jira"
|
|
76
|
+
label="Home page"
|
|
77
|
+
/>
|
|
78
|
+
) : (
|
|
79
|
+
<NavLogo
|
|
80
|
+
href="http://www.atlassian.design"
|
|
81
|
+
logo={AtlassianLogo}
|
|
82
|
+
icon={AtlassianIcon}
|
|
83
|
+
label="Home page"
|
|
84
|
+
/>
|
|
85
|
+
)}
|
|
77
86
|
</TopNavStart>
|
|
78
87
|
<TopNavMiddle>
|
|
79
88
|
<MockSearch />
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
TopNavStart,
|
|
14
14
|
} from '@atlaskit/navigation-system/layout/top-nav';
|
|
15
15
|
import {
|
|
16
|
+
AppLogo,
|
|
16
17
|
AppSwitcher,
|
|
17
18
|
ChatButton,
|
|
18
19
|
CreateButton,
|
|
@@ -25,7 +26,7 @@ import {
|
|
|
25
26
|
import { Notifications } from '@atlaskit/navigation-system/top-nav-items/notifications';
|
|
26
27
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
27
28
|
import { Stack } from '@atlaskit/primitives';
|
|
28
|
-
import { JiraIcon
|
|
29
|
+
import { JiraIcon } from '@atlaskit/temp-nav-app-icons/jira';
|
|
29
30
|
|
|
30
31
|
// TODO: consider exposing this type properly, but it isn't needed for normal usage
|
|
31
32
|
// eslint-disable-next-line @atlaskit/platform/use-entrypoints-in-examples
|
|
@@ -71,12 +72,21 @@ const TopNavigationThemingInstance = ({ customTheme }: { customTheme?: CustomThe
|
|
|
71
72
|
onClick={toggleIsAppSwitcherSelected}
|
|
72
73
|
isSelected={isAppSwitcherSelected}
|
|
73
74
|
/>
|
|
74
|
-
|
|
75
|
+
{fg('platform-team25-app-icon-tiles') ? (
|
|
76
|
+
<AppLogo
|
|
75
77
|
href="http://www.atlassian.design"
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
icon={JiraIcon}
|
|
79
|
+
name="Jira"
|
|
80
|
+
label="Home page"
|
|
81
|
+
/>
|
|
82
|
+
) : (
|
|
83
|
+
<NavLogo
|
|
84
|
+
href="http://www.atlassian.design"
|
|
85
|
+
icon={JiraIconOld}
|
|
86
|
+
logo={JiraLogoOld}
|
|
87
|
+
label="Home page"
|
|
88
|
+
/>
|
|
89
|
+
)}
|
|
80
90
|
<CustomTitle>Optional custom title</CustomTitle>
|
|
81
91
|
</TopNavStart>
|
|
82
92
|
<TopNavMiddle>
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
TopNavStart,
|
|
18
18
|
} from '@atlaskit/navigation-system/layout/top-nav';
|
|
19
19
|
import {
|
|
20
|
+
AppLogo,
|
|
20
21
|
AppSwitcher,
|
|
21
22
|
ChatButton,
|
|
22
23
|
CreateButton,
|
|
@@ -29,7 +30,7 @@ import {
|
|
|
29
30
|
} from '@atlaskit/navigation-system/top-nav-items';
|
|
30
31
|
import { Notifications } from '@atlaskit/navigation-system/top-nav-items/notifications';
|
|
31
32
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
32
|
-
import { JiraIcon
|
|
33
|
+
import { JiraIcon } from '@atlaskit/temp-nav-app-icons/jira';
|
|
33
34
|
import { token } from '@atlaskit/tokens';
|
|
34
35
|
|
|
35
36
|
import { WithResponsiveViewport } from './utils/example-utils';
|
|
@@ -48,12 +49,21 @@ export const TopNavigationExample = () => (
|
|
|
48
49
|
<TopNavStart>
|
|
49
50
|
<SideNavToggleButton collapseLabel="Collapse sidebar" expandLabel="Expand sidebar" />
|
|
50
51
|
<AppSwitcher label="App switcher" onClick={() => alert('app switcher')} />
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
{fg('platform-team25-app-icon-tiles') ? (
|
|
53
|
+
<AppLogo
|
|
54
|
+
href="http://www.atlassian.design"
|
|
55
|
+
icon={JiraIcon}
|
|
56
|
+
name="Jira"
|
|
57
|
+
label="Home page"
|
|
58
|
+
/>
|
|
59
|
+
) : (
|
|
60
|
+
<NavLogo
|
|
61
|
+
href="http://www.atlassian.design"
|
|
62
|
+
icon={AtlassianIcon}
|
|
63
|
+
logo={AtlassianLogo}
|
|
64
|
+
label="Home page"
|
|
65
|
+
/>
|
|
66
|
+
)}
|
|
57
67
|
</TopNavStart>
|
|
58
68
|
<TopNavMiddle>
|
|
59
69
|
<Search onClick={() => alert('mobile search')} label="Search" />
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/navigation-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.168.0",
|
|
4
4
|
"description": "The latest navigation system for Atlassian products.",
|
|
5
5
|
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
6
6
|
"author": "Atlassian Pty Ltd",
|
|
@@ -66,7 +66,6 @@
|
|
|
66
66
|
"atlaskit:src": "src/index.tsx",
|
|
67
67
|
"atlassian": {
|
|
68
68
|
"team": "ADS: nav4",
|
|
69
|
-
"runReact18": true,
|
|
70
69
|
"website": {
|
|
71
70
|
"name": "Navigation system",
|
|
72
71
|
"category": "Navigation",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { AppSwitcher } from '../../ui/top-nav-items/app-switcher';
|
|
2
|
-
export { NavLogo } from '../../ui/top-nav-items/nav-logo';
|
|
2
|
+
export { NavLogo } from '../../ui/top-nav-items/nav-logo/nav-logo';
|
|
3
|
+
export { AppLogo } from '../../ui/top-nav-items/nav-logo/app-logo';
|
|
3
4
|
export { Search } from '../../ui/top-nav-items/search';
|
|
4
5
|
export { ChatButton } from '../../ui/top-nav-items/chat-button';
|
|
5
6
|
export { EndItem } from '../../ui/top-nav-items/end-item';
|
package/src/index.tsx
CHANGED
|
@@ -59,7 +59,8 @@ export type { ResizeBounds } from './ui/page-layout/panel-splitter/types';
|
|
|
59
59
|
|
|
60
60
|
export { TopNavStart } from './ui/page-layout/top-nav/top-nav-start';
|
|
61
61
|
export { AppSwitcher } from './ui/top-nav-items/app-switcher';
|
|
62
|
-
export { NavLogo } from './ui/top-nav-items/nav-logo';
|
|
62
|
+
export { NavLogo } from './ui/top-nav-items/nav-logo/nav-logo';
|
|
63
|
+
export { AppLogo } from './ui/top-nav-items/nav-logo/app-logo';
|
|
63
64
|
export { TopNavMiddle } from './ui/page-layout/top-nav/top-nav-middle';
|
|
64
65
|
export { Search } from './ui/top-nav-items/search';
|
|
65
66
|
export { ChatButton } from './ui/top-nav-items/chat-button';
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -146,17 +146,7 @@ export const SideNavToggleButton = ({
|
|
|
146
146
|
*/
|
|
147
147
|
const icon = (props: NewCoreIconProps) => (
|
|
148
148
|
<span css={silentIconStyles}>
|
|
149
|
-
{isSideNavExpanded ?
|
|
150
|
-
<SidebarCollapseIcon
|
|
151
|
-
{...props}
|
|
152
|
-
testId={testId ? `${testId}-collapse-icon-temp-do-not-use` : undefined}
|
|
153
|
-
/>
|
|
154
|
-
) : (
|
|
155
|
-
<SidebarExpandIcon
|
|
156
|
-
{...props}
|
|
157
|
-
testId={testId ? `${testId}-expand-icon-temp-do-not-use` : undefined}
|
|
158
|
-
/>
|
|
159
|
-
)}
|
|
149
|
+
{isSideNavExpanded ? <SidebarCollapseIcon {...props} /> : <SidebarExpandIcon {...props} />}
|
|
160
150
|
</span>
|
|
161
151
|
);
|
|
162
152
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Device, snapshotInformational } from '@atlassian/gemini';
|
|
2
2
|
|
|
3
|
+
import TopNavWithLongProductName from '../../../../../examples/top-nav-with-long-name';
|
|
3
4
|
import TopNavWithTempNavAppIcon from '../../../../../examples/top-nav-with-temp-nav-app-icon';
|
|
4
5
|
import { TopNavigationExample } from '../../../../../examples/top-navigation';
|
|
5
6
|
import { TopNavigationThemingSingleExample } from '../../../../../examples/top-navigation-theming';
|
|
@@ -106,3 +107,20 @@ snapshotInformational(TopNavigationThemingSingleExample, {
|
|
|
106
107
|
await page.mouse.down();
|
|
107
108
|
},
|
|
108
109
|
});
|
|
110
|
+
|
|
111
|
+
snapshotInformational(TopNavWithLongProductName, {
|
|
112
|
+
description: 'long product name tooltip',
|
|
113
|
+
featureFlags: {
|
|
114
|
+
'platform-team25-app-icon-tiles': true,
|
|
115
|
+
platform_design_system_nav4_top_nav_columns: true,
|
|
116
|
+
platform_design_system_nav_logo_interaction_states: true,
|
|
117
|
+
},
|
|
118
|
+
prepare: async (page) => {
|
|
119
|
+
// Reduce the viewport size to remove whitespace but include the tooltip
|
|
120
|
+
await page.setViewportSize({ width: 1200, height: 100 });
|
|
121
|
+
await page.getByRole('link', { name: 'Home page' }).hover();
|
|
122
|
+
await page.getByRole('tooltip').waitFor();
|
|
123
|
+
},
|
|
124
|
+
// We need to include the tooltip in this snapshot
|
|
125
|
+
drawsOutsideBounds: true,
|
|
126
|
+
});
|
|
@@ -12,7 +12,7 @@ import { TopNavStart } from '../../../page-layout/top-nav/top-nav-start';
|
|
|
12
12
|
import { AppSwitcher } from '../../app-switcher';
|
|
13
13
|
import { CreateButton } from '../../create-button';
|
|
14
14
|
import { Help } from '../../help';
|
|
15
|
-
import { NavLogo } from '../../nav-logo';
|
|
15
|
+
import { NavLogo } from '../../nav-logo/nav-logo';
|
|
16
16
|
import { Search } from '../../search';
|
|
17
17
|
import { Settings } from '../../settings';
|
|
18
18
|
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
import React, { useCallback, useRef } from 'react';
|
|
6
|
+
|
|
7
|
+
import { cssMap, cx, jsx } from '@compiled/react';
|
|
8
|
+
|
|
9
|
+
import type { LogoProps } from '@atlaskit/logo';
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
|
+
import { Anchor, Inline, Text } from '@atlaskit/primitives';
|
|
12
|
+
import type {
|
|
13
|
+
IconProps as TempIconProps
|
|
14
|
+
} from '@atlaskit/temp-nav-app-icons/types';
|
|
15
|
+
import { token } from '@atlaskit/tokens';
|
|
16
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
17
|
+
|
|
18
|
+
import { useHasCustomTheme } from '../themed/has-custom-theme-context';
|
|
19
|
+
|
|
20
|
+
import { LogoRenderer } from './logo-renderer';
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
const anchorStyles = cssMap({
|
|
24
|
+
root: {
|
|
25
|
+
display: 'flex',
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
height: '32px',
|
|
28
|
+
borderRadius: '10px',
|
|
29
|
+
flexShrink: 0,
|
|
30
|
+
// '&&' is required to add more CSS specificity to ensure styles take precedence over the default Anchor styles
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
33
|
+
'&&': {
|
|
34
|
+
textDecoration: 'none',
|
|
35
|
+
color: 'inherit',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
newMargin: {
|
|
39
|
+
// Additional margin is added to the left of the interactive element, to create visual alignment
|
|
40
|
+
// with the app tile icon and the other icon buttons that use normal (non-tile) icons.
|
|
41
|
+
marginInlineStart: token('space.050'),
|
|
42
|
+
},
|
|
43
|
+
// This is the same between app-logo and nav-logo
|
|
44
|
+
newInteractionStates: {
|
|
45
|
+
'&:hover': {
|
|
46
|
+
backgroundColor: token('color.background.neutral.subtle.hovered'),
|
|
47
|
+
},
|
|
48
|
+
'&:active': {
|
|
49
|
+
// Compiled bug is causing the `&:hover` state to take precedence in Jira
|
|
50
|
+
// Reported to #help-compiled but may not be fixed soon
|
|
51
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
52
|
+
backgroundColor: `${token('color.background.neutral.subtle.pressed')}!important`,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
newInteractionStatesCustomTheming: {
|
|
56
|
+
'&:hover': {
|
|
57
|
+
backgroundColor: 'var(--ds-top-bar-button-background-hovered)',
|
|
58
|
+
},
|
|
59
|
+
'&:active': {
|
|
60
|
+
// Compiled bug is causing the `&:hover` state to take precedence in Jira
|
|
61
|
+
// Reported to #help-compiled but may not be fixed soon
|
|
62
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
63
|
+
backgroundColor: 'var(--ds-top-bar-button-background-pressed)!important',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const logoWrapperStyles = cssMap({
|
|
69
|
+
root: {
|
|
70
|
+
paddingInline: token('space.050'),
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const iconContainerStyles = cssMap({
|
|
75
|
+
root: {
|
|
76
|
+
// Overflow should never occur, but hiding it just in case
|
|
77
|
+
overflow: 'hidden',
|
|
78
|
+
display: 'flex',
|
|
79
|
+
maxWidth: 24,
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
const logoTextStyles = cssMap({
|
|
84
|
+
root: {
|
|
85
|
+
// Logo text should never wrap or overflow
|
|
86
|
+
width: 'max-content',
|
|
87
|
+
maxWidth: 320,
|
|
88
|
+
userSelect: 'none',
|
|
89
|
+
paddingInlineEnd: token('space.025'),
|
|
90
|
+
display: 'none',
|
|
91
|
+
'@media (min-width: 64rem)': {
|
|
92
|
+
// @ts-ignore
|
|
93
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
94
|
+
'&&': {
|
|
95
|
+
display: 'initial',
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
function isTextClamped(element: HTMLElement): boolean {
|
|
102
|
+
// Checking for vertical height rather than horizontal height.
|
|
103
|
+
// When text is "clamped", it's technically being clamped vertically! 🤯
|
|
104
|
+
return element.scrollHeight > element.clientHeight;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* __App logo__
|
|
110
|
+
*
|
|
111
|
+
* The app logo for the top navigation.
|
|
112
|
+
*
|
|
113
|
+
* To provide a responsive experience, label text will render next to an icon at larger viewports.
|
|
114
|
+
*/
|
|
115
|
+
export const AppLogo = ({
|
|
116
|
+
name,
|
|
117
|
+
label,
|
|
118
|
+
href,
|
|
119
|
+
icon,
|
|
120
|
+
onClick,
|
|
121
|
+
}: {
|
|
122
|
+
/**
|
|
123
|
+
* The name of the app. Will be displayed next to the logo in wider viewports, and is used as an accessible label at smaller viewports.
|
|
124
|
+
*/
|
|
125
|
+
name: string;
|
|
126
|
+
/**
|
|
127
|
+
* Provide an accessible label, often used by screen readers.
|
|
128
|
+
* This label should include the name of the app, and if applicable,
|
|
129
|
+
* the location the user will navigate to on click.
|
|
130
|
+
*/
|
|
131
|
+
label: string;
|
|
132
|
+
/**
|
|
133
|
+
* The URL to navigate to when the element is clicked.
|
|
134
|
+
*/
|
|
135
|
+
href: string;
|
|
136
|
+
/**
|
|
137
|
+
* The icon to render.
|
|
138
|
+
*/
|
|
139
|
+
icon: ((props: LogoProps) => JSX.Element) | ((props: TempIconProps) => JSX.Element);
|
|
140
|
+
/**
|
|
141
|
+
* Handler called on click.
|
|
142
|
+
*/
|
|
143
|
+
onClick?: React.MouseEventHandler<HTMLAnchorElement>;
|
|
144
|
+
}) => {
|
|
145
|
+
const ref = useRef<HTMLAnchorElement>(null);
|
|
146
|
+
const nameRef = useRef<HTMLSpanElement | null>(null);
|
|
147
|
+
|
|
148
|
+
const hasCustomTheme = useHasCustomTheme();
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Show the tooltip if the name is truncated
|
|
152
|
+
*/
|
|
153
|
+
const canTooltipAppear = useCallback((): boolean => {
|
|
154
|
+
const text = nameRef.current;
|
|
155
|
+
return Boolean(text && isTextClamped(text));
|
|
156
|
+
}, []);
|
|
157
|
+
|
|
158
|
+
return (
|
|
159
|
+
<Anchor
|
|
160
|
+
ref={ref}
|
|
161
|
+
aria-label={label}
|
|
162
|
+
href={href}
|
|
163
|
+
// @ts-expect-error - non-standard values for `borderRadius` and the custom theming interaction states
|
|
164
|
+
// eslint-disable-next-line @compiled/no-suppress-xcss
|
|
165
|
+
xcss={cx(
|
|
166
|
+
anchorStyles.root,
|
|
167
|
+
fg('platform_design_system_nav_logo_interaction_states') && anchorStyles.newMargin,
|
|
168
|
+
fg('platform_design_system_nav_logo_interaction_states') &&
|
|
169
|
+
(hasCustomTheme
|
|
170
|
+
? anchorStyles.newInteractionStatesCustomTheming
|
|
171
|
+
: anchorStyles.newInteractionStates),
|
|
172
|
+
)}
|
|
173
|
+
onClick={onClick}
|
|
174
|
+
>
|
|
175
|
+
<Inline
|
|
176
|
+
space="space.075"
|
|
177
|
+
alignBlock="center"
|
|
178
|
+
xcss={logoWrapperStyles.root}
|
|
179
|
+
aria-label={label}
|
|
180
|
+
>
|
|
181
|
+
<div css={[iconContainerStyles.root]}>
|
|
182
|
+
<LogoRenderer logoOrIcon={icon} />
|
|
183
|
+
</div>
|
|
184
|
+
<span css={logoTextStyles.root}>
|
|
185
|
+
<Tooltip
|
|
186
|
+
content={name}
|
|
187
|
+
position="bottom"
|
|
188
|
+
ignoreTooltipPointerEvents
|
|
189
|
+
hideTooltipOnMouseDown
|
|
190
|
+
// We don't need a duplicate hidden element containing tooltip content
|
|
191
|
+
// as the content of the tooltip matches what is rendered in the nav item.
|
|
192
|
+
isScreenReaderAnnouncementDisabled
|
|
193
|
+
canAppear={canTooltipAppear}
|
|
194
|
+
>
|
|
195
|
+
{(tooltipProps) => (
|
|
196
|
+
<span {...tooltipProps}>
|
|
197
|
+
<Text
|
|
198
|
+
aria-hidden={true}
|
|
199
|
+
color="inherit"
|
|
200
|
+
weight="semibold"
|
|
201
|
+
maxLines={1}
|
|
202
|
+
ref={nameRef}
|
|
203
|
+
>
|
|
204
|
+
{name}
|
|
205
|
+
</Text>
|
|
206
|
+
</span>
|
|
207
|
+
)}
|
|
208
|
+
</Tooltip>
|
|
209
|
+
</span>
|
|
210
|
+
</Inline>
|
|
211
|
+
</Anchor>
|
|
212
|
+
);
|
|
213
|
+
};
|