@atlaskit/navigation-system 0.167.3 → 0.169.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 +21 -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/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/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/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/company-hub-mock.tsx +1 -1
- package/examples/confluence-mock.tsx +1 -1
- package/examples/page-layout.tsx +2 -2
- 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 +13 -13
- package/examples/top-navigation-theming-with-picker.tsx +17 -8
- package/examples/top-navigation-theming.tsx +17 -7
- package/examples/top-navigation.tsx +17 -7
- package/package.json +3 -3
- 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 -9
- 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 +209 -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,21 +33,21 @@ 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
|
|
|
43
|
-
const connieNavLogo =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const administrationNavLogo = (
|
|
44
|
+
const connieNavLogo = <AppLogo href="" icon={ConfluenceIcon} name="Confluence" label="Home page" />;
|
|
45
|
+
// Stress test nav responsive behaviour with a wide logo
|
|
46
|
+
const wideNavLogo = (
|
|
47
47
|
<NavLogo
|
|
48
48
|
href=""
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
icon={() => <img alt="" src={placeholder200x20} />}
|
|
50
|
+
logo={() => <img alt="" src={placeholder200x20} />}
|
|
51
51
|
label="Home page"
|
|
52
52
|
/>
|
|
53
53
|
);
|
|
@@ -138,7 +138,7 @@ export default function TopNavigationStressExample() {
|
|
|
138
138
|
<Heading as="h2" size="small">
|
|
139
139
|
Wide left column
|
|
140
140
|
</Heading>
|
|
141
|
-
<TopNavigationInstance navLogo={
|
|
141
|
+
<TopNavigationInstance navLogo={wideNavLogo} />
|
|
142
142
|
</Stack>
|
|
143
143
|
|
|
144
144
|
<Stack space="space.100">
|
|
@@ -159,7 +159,7 @@ export default function TopNavigationStressExample() {
|
|
|
159
159
|
<Heading as="h2" size="small">
|
|
160
160
|
Wide left and right column
|
|
161
161
|
</Heading>
|
|
162
|
-
<TopNavigationInstance navLogo={
|
|
162
|
+
<TopNavigationInstance navLogo={wideNavLogo} topNavEnd={extendedTopNavEnd} />
|
|
163
163
|
</Stack>
|
|
164
164
|
|
|
165
165
|
<Stack space="space.100">
|
|
@@ -167,7 +167,7 @@ export default function TopNavigationStressExample() {
|
|
|
167
167
|
No create button
|
|
168
168
|
</Heading>
|
|
169
169
|
<TopNavigationInstance
|
|
170
|
-
navLogo={
|
|
170
|
+
navLogo={wideNavLogo}
|
|
171
171
|
topNavEnd={extendedTopNavEnd}
|
|
172
172
|
topNavMiddle={<MockSearch />}
|
|
173
173
|
/>
|
|
@@ -178,7 +178,7 @@ export default function TopNavigationStressExample() {
|
|
|
178
178
|
No common actions
|
|
179
179
|
</Heading>
|
|
180
180
|
<TopNavigationInstance
|
|
181
|
-
navLogo={
|
|
181
|
+
navLogo={wideNavLogo}
|
|
182
182
|
topNavEnd={extendedTopNavEnd}
|
|
183
183
|
topNavMiddle={null}
|
|
184
184
|
/>
|
|
@@ -189,7 +189,7 @@ export default function TopNavigationStressExample() {
|
|
|
189
189
|
Extra common actions
|
|
190
190
|
</Heading>
|
|
191
191
|
<TopNavigationInstance
|
|
192
|
-
navLogo={
|
|
192
|
+
navLogo={wideNavLogo}
|
|
193
193
|
topNavEnd={extendedTopNavEnd}
|
|
194
194
|
topNavMiddle={
|
|
195
195
|
<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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
{fg('platform-team25-app-icon-tiles') ? (
|
|
76
|
+
<AppLogo
|
|
77
|
+
href="http://www.atlassian.design"
|
|
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.169.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",
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"@atlaskit/button": "^23.2.0",
|
|
117
117
|
"@atlaskit/css": "^0.12.0",
|
|
118
118
|
"@atlaskit/ds-lib": "^4.0.0",
|
|
119
|
-
"@atlaskit/icon": "^27.
|
|
119
|
+
"@atlaskit/icon": "^27.3.0",
|
|
120
120
|
"@atlaskit/layering": "^3.0.0",
|
|
121
121
|
"@atlaskit/logo": "^19.5.0",
|
|
122
122
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
"@atlaskit/page-header": "^12.0.0",
|
|
157
157
|
"@atlaskit/page-layout": "^4.2.0",
|
|
158
158
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
|
|
159
|
-
"@atlaskit/select": "^21.
|
|
159
|
+
"@atlaskit/select": "^21.1.0",
|
|
160
160
|
"@atlaskit/skeleton": "^2.0.0",
|
|
161
161
|
"@atlaskit/textfield": "^8.0.0",
|
|
162
162
|
"@atlassian/feature-flags-test-utils": "^0.3.0",
|
|
@@ -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,15 +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
|
-
/>
|
|
153
|
-
) : (
|
|
154
|
-
<SidebarExpandIcon
|
|
155
|
-
{...props}
|
|
156
|
-
/>
|
|
157
|
-
)}
|
|
149
|
+
{isSideNavExpanded ? <SidebarCollapseIcon {...props} /> : <SidebarExpandIcon {...props} />}
|
|
158
150
|
</span>
|
|
159
151
|
);
|
|
160
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,209 @@
|
|
|
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 { IconProps as TempIconProps } from '@atlaskit/temp-nav-app-icons/types';
|
|
13
|
+
import { token } from '@atlaskit/tokens';
|
|
14
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
15
|
+
|
|
16
|
+
import { useHasCustomTheme } from '../themed/has-custom-theme-context';
|
|
17
|
+
|
|
18
|
+
import { LogoRenderer } from './logo-renderer';
|
|
19
|
+
|
|
20
|
+
const anchorStyles = cssMap({
|
|
21
|
+
root: {
|
|
22
|
+
display: 'flex',
|
|
23
|
+
alignItems: 'center',
|
|
24
|
+
height: '32px',
|
|
25
|
+
borderRadius: '10px',
|
|
26
|
+
flexShrink: 0,
|
|
27
|
+
// '&&' is required to add more CSS specificity to ensure styles take precedence over the default Anchor styles
|
|
28
|
+
// @ts-ignore
|
|
29
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
30
|
+
'&&': {
|
|
31
|
+
textDecoration: 'none',
|
|
32
|
+
color: 'inherit',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
newMargin: {
|
|
36
|
+
// Additional margin is added to the left of the interactive element, to create visual alignment
|
|
37
|
+
// with the app tile icon and the other icon buttons that use normal (non-tile) icons.
|
|
38
|
+
marginInlineStart: token('space.050'),
|
|
39
|
+
},
|
|
40
|
+
// This is the same between app-logo and nav-logo
|
|
41
|
+
newInteractionStates: {
|
|
42
|
+
'&:hover': {
|
|
43
|
+
backgroundColor: token('color.background.neutral.subtle.hovered'),
|
|
44
|
+
},
|
|
45
|
+
'&:active': {
|
|
46
|
+
// Compiled bug is causing the `&:hover` state to take precedence in Jira
|
|
47
|
+
// Reported to #help-compiled but may not be fixed soon
|
|
48
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
49
|
+
backgroundColor: `${token('color.background.neutral.subtle.pressed')}!important`,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
newInteractionStatesCustomTheming: {
|
|
53
|
+
'&:hover': {
|
|
54
|
+
backgroundColor: 'var(--ds-top-bar-button-background-hovered)',
|
|
55
|
+
},
|
|
56
|
+
'&:active': {
|
|
57
|
+
// Compiled bug is causing the `&:hover` state to take precedence in Jira
|
|
58
|
+
// Reported to #help-compiled but may not be fixed soon
|
|
59
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
60
|
+
backgroundColor: 'var(--ds-top-bar-button-background-pressed)!important',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const logoWrapperStyles = cssMap({
|
|
66
|
+
root: {
|
|
67
|
+
paddingInline: token('space.050'),
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const iconContainerStyles = cssMap({
|
|
72
|
+
root: {
|
|
73
|
+
// Overflow should never occur, but hiding it just in case
|
|
74
|
+
overflow: 'hidden',
|
|
75
|
+
display: 'flex',
|
|
76
|
+
maxWidth: 24,
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
const logoTextStyles = cssMap({
|
|
81
|
+
root: {
|
|
82
|
+
// Logo text should never wrap or overflow
|
|
83
|
+
width: 'max-content',
|
|
84
|
+
maxWidth: 320,
|
|
85
|
+
userSelect: 'none',
|
|
86
|
+
paddingInlineEnd: token('space.025'),
|
|
87
|
+
display: 'none',
|
|
88
|
+
'@media (min-width: 64rem)': {
|
|
89
|
+
// @ts-ignore
|
|
90
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
91
|
+
'&&': {
|
|
92
|
+
display: 'initial',
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
function isTextClamped(element: HTMLElement): boolean {
|
|
99
|
+
// Checking for vertical height rather than horizontal height.
|
|
100
|
+
// When text is "clamped", it's technically being clamped vertically! 🤯
|
|
101
|
+
return element.scrollHeight > element.clientHeight;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* __App logo__
|
|
106
|
+
*
|
|
107
|
+
* The app logo for the top navigation.
|
|
108
|
+
*
|
|
109
|
+
* To provide a responsive experience, label text will render next to an icon at larger viewports.
|
|
110
|
+
*/
|
|
111
|
+
export const AppLogo = ({
|
|
112
|
+
name,
|
|
113
|
+
label,
|
|
114
|
+
href,
|
|
115
|
+
icon,
|
|
116
|
+
onClick,
|
|
117
|
+
}: {
|
|
118
|
+
/**
|
|
119
|
+
* 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.
|
|
120
|
+
*/
|
|
121
|
+
name: string;
|
|
122
|
+
/**
|
|
123
|
+
* Provide an accessible label, often used by screen readers.
|
|
124
|
+
* This label should include the name of the app, and if applicable,
|
|
125
|
+
* the location the user will navigate to on click.
|
|
126
|
+
*/
|
|
127
|
+
label: string;
|
|
128
|
+
/**
|
|
129
|
+
* The URL to navigate to when the element is clicked.
|
|
130
|
+
*/
|
|
131
|
+
href: string;
|
|
132
|
+
/**
|
|
133
|
+
* The icon to render.
|
|
134
|
+
*/
|
|
135
|
+
icon: ((props: LogoProps) => JSX.Element) | ((props: TempIconProps) => JSX.Element);
|
|
136
|
+
/**
|
|
137
|
+
* Handler called on click.
|
|
138
|
+
*/
|
|
139
|
+
onClick?: React.MouseEventHandler<HTMLAnchorElement>;
|
|
140
|
+
}) => {
|
|
141
|
+
const ref = useRef<HTMLAnchorElement>(null);
|
|
142
|
+
const nameRef = useRef<HTMLSpanElement | null>(null);
|
|
143
|
+
|
|
144
|
+
const hasCustomTheme = useHasCustomTheme();
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Show the tooltip if the name is truncated
|
|
148
|
+
*/
|
|
149
|
+
const canTooltipAppear = useCallback((): boolean => {
|
|
150
|
+
const text = nameRef.current;
|
|
151
|
+
return Boolean(text && isTextClamped(text));
|
|
152
|
+
}, []);
|
|
153
|
+
|
|
154
|
+
return (
|
|
155
|
+
<Anchor
|
|
156
|
+
ref={ref}
|
|
157
|
+
aria-label={label}
|
|
158
|
+
href={href}
|
|
159
|
+
// @ts-expect-error - non-standard values for `borderRadius` and the custom theming interaction states
|
|
160
|
+
// eslint-disable-next-line @compiled/no-suppress-xcss
|
|
161
|
+
xcss={cx(
|
|
162
|
+
anchorStyles.root,
|
|
163
|
+
fg('platform_design_system_nav_logo_interaction_states') && anchorStyles.newMargin,
|
|
164
|
+
fg('platform_design_system_nav_logo_interaction_states') &&
|
|
165
|
+
(hasCustomTheme
|
|
166
|
+
? anchorStyles.newInteractionStatesCustomTheming
|
|
167
|
+
: anchorStyles.newInteractionStates),
|
|
168
|
+
)}
|
|
169
|
+
onClick={onClick}
|
|
170
|
+
>
|
|
171
|
+
<Inline
|
|
172
|
+
space="space.075"
|
|
173
|
+
alignBlock="center"
|
|
174
|
+
xcss={logoWrapperStyles.root}
|
|
175
|
+
aria-label={label}
|
|
176
|
+
>
|
|
177
|
+
<div css={[iconContainerStyles.root]}>
|
|
178
|
+
<LogoRenderer logoOrIcon={icon} />
|
|
179
|
+
</div>
|
|
180
|
+
<span css={logoTextStyles.root}>
|
|
181
|
+
<Tooltip
|
|
182
|
+
content={name}
|
|
183
|
+
position="bottom"
|
|
184
|
+
ignoreTooltipPointerEvents
|
|
185
|
+
hideTooltipOnMouseDown
|
|
186
|
+
// We don't need a duplicate hidden element containing tooltip content
|
|
187
|
+
// as the content of the tooltip matches what is rendered in the nav item.
|
|
188
|
+
isScreenReaderAnnouncementDisabled
|
|
189
|
+
canAppear={canTooltipAppear}
|
|
190
|
+
>
|
|
191
|
+
{(tooltipProps) => (
|
|
192
|
+
<span {...tooltipProps}>
|
|
193
|
+
<Text
|
|
194
|
+
aria-hidden={true}
|
|
195
|
+
color="inherit"
|
|
196
|
+
weight="semibold"
|
|
197
|
+
maxLines={1}
|
|
198
|
+
ref={nameRef}
|
|
199
|
+
>
|
|
200
|
+
{name}
|
|
201
|
+
</Text>
|
|
202
|
+
</span>
|
|
203
|
+
)}
|
|
204
|
+
</Tooltip>
|
|
205
|
+
</span>
|
|
206
|
+
</Inline>
|
|
207
|
+
</Anchor>
|
|
208
|
+
);
|
|
209
|
+
};
|