@atlaskit/page-layout 3.3.2 → 3.4.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 +20 -1
- package/README.md +6 -3
- package/__perf__/examples.tsx +45 -69
- package/__perf__/utils/perf-example.tsx +53 -55
- package/__perf__/utils/product-integration/atlassian-navigation.tsx +80 -77
- package/__perf__/utils/product-integration/create.tsx +12 -15
- package/__perf__/utils/product-integration/help-popup.tsx +38 -38
- package/__perf__/utils/product-integration/notifications-popup.tsx +76 -74
- package/__perf__/utils/product-integration/profile-popup.tsx +53 -53
- package/__perf__/utils/product-integration/sample-footer.tsx +30 -26
- package/__perf__/utils/product-integration/sample-header.tsx +15 -11
- package/__perf__/utils/product-integration/side-navigation.tsx +92 -101
- package/dist/cjs/components/resize-control/grab-area.js +8 -1
- package/dist/cjs/components/resize-control/index.js +9 -3
- package/dist/cjs/components/resize-control/resize-button.js +6 -0
- package/dist/cjs/components/resize-control/shadow.js +9 -5
- package/dist/cjs/components/skip-links/skip-link-components.js +4 -2
- package/dist/cjs/components/skip-links/use-custom-skip-link.js +3 -0
- package/dist/cjs/components/slots/banner-slot.js +12 -5
- package/dist/cjs/components/slots/content.js +6 -0
- package/dist/cjs/components/slots/internal/left-sidebar-inner.js +18 -1
- package/dist/cjs/components/slots/internal/left-sidebar-outer.js +16 -1
- package/dist/cjs/components/slots/internal/resizable-children-wrapper.js +7 -1
- package/dist/cjs/components/slots/internal/slot-focus-ring.js +9 -2
- package/dist/cjs/components/slots/left-panel.js +10 -3
- package/dist/cjs/components/slots/left-sidebar-without-resize.js +5 -0
- package/dist/cjs/components/slots/left-sidebar.js +4 -1
- package/dist/cjs/components/slots/main.js +8 -2
- package/dist/cjs/components/slots/page-layout.js +10 -2
- package/dist/cjs/components/slots/right-panel.js +10 -3
- package/dist/cjs/components/slots/right-sidebar.js +14 -9
- package/dist/cjs/components/slots/slot-dimensions.js +5 -1
- package/dist/cjs/components/slots/top-navigation.js +13 -6
- package/dist/es2019/components/resize-control/grab-area.js +8 -1
- package/dist/es2019/components/resize-control/index.js +10 -2
- package/dist/es2019/components/resize-control/resize-button.js +7 -1
- package/dist/es2019/components/resize-control/shadow.js +8 -5
- package/dist/es2019/components/skip-links/skip-link-components.js +5 -1
- package/dist/es2019/components/skip-links/use-custom-skip-link.js +3 -0
- package/dist/es2019/components/slots/banner-slot.js +12 -5
- package/dist/es2019/components/slots/content.js +5 -0
- package/dist/es2019/components/slots/internal/left-sidebar-inner.js +19 -3
- package/dist/es2019/components/slots/internal/left-sidebar-outer.js +18 -3
- package/dist/es2019/components/slots/internal/resizable-children-wrapper.js +6 -1
- package/dist/es2019/components/slots/internal/slot-focus-ring.js +8 -2
- package/dist/es2019/components/slots/left-panel.js +10 -3
- package/dist/es2019/components/slots/left-sidebar-without-resize.js +5 -0
- package/dist/es2019/components/slots/left-sidebar.js +6 -0
- package/dist/es2019/components/slots/main.js +8 -2
- package/dist/es2019/components/slots/page-layout.js +15 -1
- package/dist/es2019/components/slots/right-panel.js +10 -3
- package/dist/es2019/components/slots/right-sidebar.js +14 -9
- package/dist/es2019/components/slots/slot-dimensions.js +4 -1
- package/dist/es2019/components/slots/top-navigation.js +13 -6
- package/dist/esm/components/resize-control/grab-area.js +8 -1
- package/dist/esm/components/resize-control/index.js +10 -2
- package/dist/esm/components/resize-control/resize-button.js +6 -0
- package/dist/esm/components/resize-control/shadow.js +8 -5
- package/dist/esm/components/skip-links/skip-link-components.js +5 -1
- package/dist/esm/components/skip-links/use-custom-skip-link.js +3 -0
- package/dist/esm/components/slots/banner-slot.js +12 -5
- package/dist/esm/components/slots/content.js +5 -0
- package/dist/esm/components/slots/internal/left-sidebar-inner.js +17 -1
- package/dist/esm/components/slots/internal/left-sidebar-outer.js +16 -1
- package/dist/esm/components/slots/internal/resizable-children-wrapper.js +6 -1
- package/dist/esm/components/slots/internal/slot-focus-ring.js +8 -2
- package/dist/esm/components/slots/left-panel.js +10 -3
- package/dist/esm/components/slots/left-sidebar-without-resize.js +5 -0
- package/dist/esm/components/slots/left-sidebar.js +6 -0
- package/dist/esm/components/slots/main.js +8 -2
- package/dist/esm/components/slots/page-layout.js +10 -2
- package/dist/esm/components/slots/right-panel.js +10 -3
- package/dist/esm/components/slots/right-sidebar.js +14 -9
- package/dist/esm/components/slots/slot-dimensions.js +5 -1
- package/dist/esm/components/slots/top-navigation.js +13 -6
- package/dist/types/components/resize-control/grab-area.d.ts +3 -0
- package/dist/types/components/resize-control/shadow.d.ts +3 -0
- package/dist/types/components/skip-links/skip-link-components.d.ts +3 -0
- package/dist/types/components/slots/content.d.ts +3 -0
- package/dist/types/components/slots/internal/left-sidebar-inner.d.ts +3 -0
- package/dist/types/components/slots/internal/left-sidebar-outer.d.ts +3 -0
- package/dist/types/components/slots/internal/resizable-children-wrapper.d.ts +3 -0
- package/dist/types/components/slots/internal/slot-focus-ring.d.ts +3 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types-ts4.5/components/resize-control/grab-area.d.ts +3 -0
- package/dist/types-ts4.5/components/resize-control/shadow.d.ts +3 -0
- package/dist/types-ts4.5/components/skip-links/skip-link-components.d.ts +3 -0
- package/dist/types-ts4.5/components/slots/content.d.ts +3 -0
- package/dist/types-ts4.5/components/slots/internal/left-sidebar-inner.d.ts +3 -0
- package/dist/types-ts4.5/components/slots/internal/left-sidebar-outer.d.ts +3 -0
- package/dist/types-ts4.5/components/slots/internal/resizable-children-wrapper.d.ts +3 -0
- package/dist/types-ts4.5/components/slots/internal/slot-focus-ring.d.ts +3 -0
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/package.json +123 -123
- package/report.api.md +83 -84
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/page-layout
|
|
2
2
|
|
|
3
|
+
## 3.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#110836](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110836)
|
|
8
|
+
[`a8bd419fd70b9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a8bd419fd70b9) -
|
|
9
|
+
Explicitly set jsxRuntime to classic via pragma comments in order to avoid issues where jsxRuntime
|
|
10
|
+
is implicitly set to automatic.
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
16
|
+
## 3.3.3
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 3.3.2
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -24,7 +43,7 @@
|
|
|
24
43
|
|
|
25
44
|
- [#100748](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/100748)
|
|
26
45
|
[`ff76f4c7a63d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ff76f4c7a63d) -
|
|
27
|
-
Add support for React 18.
|
|
46
|
+
Add support for React 18 in non-strict mode.
|
|
28
47
|
|
|
29
48
|
## 3.2.2
|
|
30
49
|
|
package/README.md
CHANGED
|
@@ -10,7 +10,10 @@ yarn add @atlaskit/page-layout
|
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
|
-
Detailed docs and example usage can be found
|
|
13
|
+
Detailed docs and example usage can be found
|
|
14
|
+
[here](https://atlassian.design/components/page-layout/).
|
|
14
15
|
|
|
15
|
-
To add side navigation, use
|
|
16
|
-
|
|
16
|
+
To add side navigation, use
|
|
17
|
+
[@atlaskit/side-navigation](https://atlassian.design/components/side-navigation/) To add top/global
|
|
18
|
+
navigation, use
|
|
19
|
+
[@atlaskit/atlassian-navigation](https://atlassian.design/components/atlassian-navigation/)
|
package/__perf__/examples.tsx
CHANGED
|
@@ -1,89 +1,65 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
findByTestId,
|
|
5
|
-
findByText,
|
|
6
|
-
fireEvent,
|
|
7
|
-
getByTestId,
|
|
8
|
-
} from '@testing-library/dom'; // eslint-disable-line import/no-extraneous-dependencies
|
|
3
|
+
import { findByTestId, findByText, fireEvent, getByTestId } from '@testing-library/dom'; // eslint-disable-line import/no-extraneous-dependencies
|
|
9
4
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
10
|
-
import {
|
|
11
|
-
type InteractionTaskArgs,
|
|
12
|
-
type PublicInteractionTask,
|
|
13
|
-
} from 'storybook-addon-performance'; // eslint-disable-line import/no-extraneous-dependencies
|
|
5
|
+
import { type InteractionTaskArgs, type PublicInteractionTask } from 'storybook-addon-performance'; // eslint-disable-line import/no-extraneous-dependencies
|
|
14
6
|
|
|
15
7
|
import ProductExample from './utils/perf-example';
|
|
16
8
|
|
|
17
9
|
const interactionTasks: PublicInteractionTask[] = [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
{
|
|
11
|
+
name: 'Side nav: Opening nested side nav',
|
|
12
|
+
description: 'Open a nested item in side-navigation',
|
|
21
13
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
{
|
|
32
|
-
name: 'Global nav: Open dropdown',
|
|
33
|
-
description: 'Open a dropdown in side-navigation',
|
|
14
|
+
run: async ({ container }: InteractionTaskArgs): Promise<void> => {
|
|
15
|
+
const element: HTMLElement | null = getByTestId(container, 'nav-side-queues--item');
|
|
16
|
+
fireEvent.click(element);
|
|
17
|
+
await findByText(container, 'Untriaged', undefined, { timeout: 2000 });
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'Global nav: Open dropdown',
|
|
22
|
+
description: 'Open a dropdown in side-navigation',
|
|
34
23
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
name: 'Global nav: Notifications',
|
|
50
|
-
description: 'Open the notifications panel in global navigation',
|
|
24
|
+
run: async ({ container }: InteractionTaskArgs): Promise<void> => {
|
|
25
|
+
const element: HTMLElement | null = getByTestId(container, 'nav-help');
|
|
26
|
+
fireEvent.click(element);
|
|
27
|
+
await findByTestId(container.parentElement || container, 'nav-help-content', undefined, {
|
|
28
|
+
timeout: 2000,
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'Global nav: Notifications',
|
|
34
|
+
description: 'Open the notifications panel in global navigation',
|
|
51
35
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
'jira-notifications',
|
|
61
|
-
undefined,
|
|
62
|
-
{
|
|
63
|
-
timeout: 2000,
|
|
64
|
-
},
|
|
65
|
-
);
|
|
66
|
-
},
|
|
67
|
-
},
|
|
36
|
+
run: async ({ container }: InteractionTaskArgs): Promise<void> => {
|
|
37
|
+
const element: HTMLElement | null = getByTestId(container, 'nav-notifications');
|
|
38
|
+
fireEvent.click(element);
|
|
39
|
+
await findByTestId(container.parentElement || container, 'jira-notifications', undefined, {
|
|
40
|
+
timeout: 2000,
|
|
41
|
+
});
|
|
42
|
+
},
|
|
43
|
+
},
|
|
68
44
|
];
|
|
69
45
|
|
|
70
46
|
const performance = () => {
|
|
71
|
-
|
|
72
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
47
|
+
return (
|
|
48
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
49
|
+
<div style={{ margin: '-1rem 0 0 -1rem', height: '100vh' }}>
|
|
50
|
+
<ProductExample />
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
77
53
|
};
|
|
78
54
|
|
|
79
55
|
performance.story = {
|
|
80
|
-
|
|
56
|
+
name: 'Performance',
|
|
81
57
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
58
|
+
parameters: {
|
|
59
|
+
performance: {
|
|
60
|
+
interactions: interactionTasks,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
87
63
|
};
|
|
88
64
|
|
|
89
65
|
export default performance;
|
|
@@ -1,82 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
*/
|
|
1
4
|
/** @jsx jsx */
|
|
2
5
|
|
|
6
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
7
|
import { css, jsx } from '@emotion/react';
|
|
4
8
|
|
|
5
9
|
import { token } from '@atlaskit/tokens';
|
|
6
10
|
|
|
7
|
-
import {
|
|
8
|
-
Content,
|
|
9
|
-
LeftSidebar,
|
|
10
|
-
Main,
|
|
11
|
-
PageLayout,
|
|
12
|
-
TopNavigation,
|
|
13
|
-
} from '../../src';
|
|
11
|
+
import { Content, LeftSidebar, Main, PageLayout, TopNavigation } from '../../src';
|
|
14
12
|
|
|
15
13
|
import JiraIntegrationExample from './product-integration/atlassian-navigation';
|
|
16
14
|
import Sidebar from './product-integration/side-navigation';
|
|
17
15
|
|
|
18
16
|
const wrapperStyles = css({
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
boxSizing: 'border-box',
|
|
18
|
+
height: '100%',
|
|
19
|
+
padding: token('space.100', '8px'),
|
|
20
|
+
backgroundColor: token('color.background.neutral.subtle'),
|
|
21
|
+
outlineOffset: -4,
|
|
22
|
+
overflowY: 'auto',
|
|
25
23
|
});
|
|
26
24
|
|
|
27
25
|
const Wrapper = ({
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
borderColor,
|
|
27
|
+
children,
|
|
28
|
+
noOutline,
|
|
29
|
+
noHorizontalScrollbar,
|
|
32
30
|
}: {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
borderColor: string;
|
|
32
|
+
children: React.ReactNode;
|
|
33
|
+
noOutline?: boolean;
|
|
34
|
+
noHorizontalScrollbar?: boolean;
|
|
37
35
|
}) => (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
36
|
+
<div
|
|
37
|
+
css={wrapperStyles}
|
|
38
|
+
style={{
|
|
39
|
+
outline: noOutline ? 'none' : `2px dashed ${borderColor}`,
|
|
40
|
+
overflowX: noHorizontalScrollbar ? 'hidden' : 'auto',
|
|
41
|
+
}}
|
|
42
|
+
>
|
|
43
|
+
{children}
|
|
44
|
+
</div>
|
|
47
45
|
);
|
|
48
46
|
|
|
49
47
|
const sidebarWrapperStyles = css({
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
height: '100%',
|
|
49
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
50
|
+
nav: {
|
|
51
|
+
minWidth: 20,
|
|
52
|
+
overflowX: 'hidden',
|
|
53
|
+
},
|
|
56
54
|
});
|
|
57
55
|
|
|
58
56
|
const slotLabelStyles = css({ textAlign: 'center' });
|
|
59
57
|
|
|
60
58
|
const BasicGrid = () => {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
59
|
+
return (
|
|
60
|
+
<PageLayout>
|
|
61
|
+
<TopNavigation height={60} isFixed={true}>
|
|
62
|
+
<JiraIntegrationExample />
|
|
63
|
+
</TopNavigation>
|
|
64
|
+
<Content testId="content">
|
|
65
|
+
<LeftSidebar testId="left-sidebar" isFixed={false} width={450}>
|
|
66
|
+
<div css={sidebarWrapperStyles}>
|
|
67
|
+
<Sidebar />
|
|
68
|
+
</div>
|
|
69
|
+
</LeftSidebar>
|
|
70
|
+
<Main>
|
|
71
|
+
<Wrapper noOutline borderColor={token('color.border')}>
|
|
72
|
+
<h3 css={slotLabelStyles}>Main</h3>
|
|
73
|
+
</Wrapper>
|
|
74
|
+
</Main>
|
|
75
|
+
</Content>
|
|
76
|
+
</PageLayout>
|
|
77
|
+
);
|
|
80
78
|
};
|
|
81
79
|
|
|
82
80
|
export default BasicGrid;
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
*/
|
|
1
4
|
/** @jsx jsx */
|
|
2
5
|
import { Fragment, type MouseEvent, useState } from 'react';
|
|
3
6
|
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
4
8
|
import { jsx } from '@emotion/react';
|
|
5
9
|
|
|
6
10
|
// AFP-1799 storybook examples in src cause issues
|
|
7
11
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
AtlassianNavigation,
|
|
13
|
+
PrimaryButton,
|
|
14
|
+
ProductHome,
|
|
15
|
+
Search,
|
|
16
|
+
Settings,
|
|
13
17
|
} from '@atlaskit/atlassian-navigation';
|
|
14
18
|
import Drawer from '@atlaskit/drawer';
|
|
15
19
|
import { JiraIcon, JiraLogo } from '@atlaskit/logo';
|
|
@@ -20,96 +24,95 @@ import { NotificationsPopup } from './notifications-popup';
|
|
|
20
24
|
import { ProfilePopup } from './profile-popup';
|
|
21
25
|
|
|
22
26
|
const drawerLabelText = {
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
search: 'Search drawer',
|
|
28
|
+
settings: 'Settings drawer',
|
|
25
29
|
};
|
|
26
30
|
|
|
27
31
|
const { search, settings } = drawerLabelText;
|
|
28
32
|
|
|
29
33
|
const ProductHomeExample = () => (
|
|
30
|
-
|
|
34
|
+
<ProductHome icon={JiraIcon} logo={JiraLogo} siteTitle="Extranet" />
|
|
31
35
|
);
|
|
32
36
|
|
|
33
37
|
const SearchDrawer = () => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
38
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
39
|
+
|
|
40
|
+
const onClick = () => {
|
|
41
|
+
setIsOpen(!isOpen);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const onClose = () => {
|
|
45
|
+
setIsOpen(false);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<Fragment>
|
|
50
|
+
<Search
|
|
51
|
+
onClick={onClick}
|
|
52
|
+
testId="nav-search"
|
|
53
|
+
placeholder="Search..."
|
|
54
|
+
tooltip="Search"
|
|
55
|
+
label="Search"
|
|
56
|
+
/>
|
|
57
|
+
<Drawer label={search} isOpen={isOpen} onClose={onClose}>
|
|
58
|
+
<div>{search}</div>
|
|
59
|
+
</Drawer>
|
|
60
|
+
</Fragment>
|
|
61
|
+
);
|
|
58
62
|
};
|
|
59
63
|
|
|
60
64
|
const SettingsDrawer = () => {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
65
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
66
|
+
|
|
67
|
+
const onClick = () => {
|
|
68
|
+
setIsOpen(!isOpen);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const onClose = () => {
|
|
72
|
+
setIsOpen(false);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<Fragment>
|
|
77
|
+
<Settings isSelected={isOpen} onClick={onClick} tooltip="Settings" />
|
|
78
|
+
<Drawer label={settings} isOpen={isOpen} onClose={onClose}>
|
|
79
|
+
{settings}
|
|
80
|
+
</Drawer>
|
|
81
|
+
</Fragment>
|
|
82
|
+
);
|
|
79
83
|
};
|
|
80
84
|
|
|
81
|
-
const buttonClick =
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
};
|
|
85
|
+
const buttonClick = (toLog: string) => (e: MouseEvent<HTMLElement | HTMLAnchorElement>) => {
|
|
86
|
+
if (e.ctrlKey || e.metaKey) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
e.preventDefault();
|
|
90
|
+
};
|
|
88
91
|
|
|
89
92
|
const primaryItems = [
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
<PrimaryButton onClick={buttonClick('Projects')}>Projects</PrimaryButton>,
|
|
94
|
+
<PrimaryButton onClick={buttonClick('Filters')} isHighlighted>
|
|
95
|
+
Filters
|
|
96
|
+
</PrimaryButton>,
|
|
97
|
+
<PrimaryButton onClick={buttonClick('Dashboards')}>Dashboards</PrimaryButton>,
|
|
98
|
+
<PrimaryButton onClick={buttonClick('Apps')}>Apps</PrimaryButton>,
|
|
96
99
|
];
|
|
97
100
|
|
|
98
101
|
const PerfExample = () => (
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
102
|
+
<Fragment>
|
|
103
|
+
<AtlassianNavigation
|
|
104
|
+
label="site"
|
|
105
|
+
moreLabel="More"
|
|
106
|
+
primaryItems={primaryItems}
|
|
107
|
+
renderCreate={DefaultCreate}
|
|
108
|
+
renderHelp={HelpPopup}
|
|
109
|
+
renderNotifications={NotificationsPopup}
|
|
110
|
+
renderProductHome={ProductHomeExample}
|
|
111
|
+
renderProfile={ProfilePopup}
|
|
112
|
+
renderSearch={SearchDrawer}
|
|
113
|
+
renderSettings={SettingsDrawer}
|
|
114
|
+
/>
|
|
115
|
+
</Fragment>
|
|
113
116
|
);
|
|
114
117
|
|
|
115
118
|
export default PerfExample;
|
|
@@ -5,22 +5,19 @@ import noop from '@atlaskit/ds-lib/noop';
|
|
|
5
5
|
import { token } from '@atlaskit/tokens';
|
|
6
6
|
|
|
7
7
|
const StyledTooltip = () => (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
{/* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 */}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
[c]
|
|
14
|
-
</span>
|
|
15
|
-
</span>
|
|
8
|
+
<span>
|
|
9
|
+
Create
|
|
10
|
+
{/* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 */}
|
|
11
|
+
<span style={{ color: token('color.text.accent.orange', 'orange') }}> [c]</span>
|
|
12
|
+
</span>
|
|
16
13
|
);
|
|
17
14
|
|
|
18
15
|
export const DefaultCreate = () => (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
<Create
|
|
17
|
+
buttonTooltip={<StyledTooltip />}
|
|
18
|
+
iconButtonTooltip="Create button"
|
|
19
|
+
onClick={noop}
|
|
20
|
+
text="Create"
|
|
21
|
+
testId="create-cta"
|
|
22
|
+
/>
|
|
26
23
|
);
|
|
@@ -5,48 +5,48 @@ import { ButtonItem, MenuGroup, Section } from '@atlaskit/menu';
|
|
|
5
5
|
import Popup from '@atlaskit/popup';
|
|
6
6
|
|
|
7
7
|
const HelpContent = () => (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
8
|
+
<MenuGroup testId={'nav-help-content'}>
|
|
9
|
+
<Section title="Help">
|
|
10
|
+
<ButtonItem>Atlassian Documentation</ButtonItem>
|
|
11
|
+
<ButtonItem>Atlassian Community</ButtonItem>
|
|
12
|
+
<ButtonItem>What's New</ButtonItem>
|
|
13
|
+
<ButtonItem>Get Jira Mobile</ButtonItem>
|
|
14
|
+
<ButtonItem>Keyboard shortcuts</ButtonItem>
|
|
15
|
+
<ButtonItem>About Jira</ButtonItem>
|
|
16
|
+
</Section>
|
|
17
|
+
<Section title="Legal" hasSeparator>
|
|
18
|
+
<ButtonItem>Terms of use</ButtonItem>
|
|
19
|
+
<ButtonItem>Privacy Policy</ButtonItem>
|
|
20
|
+
</Section>
|
|
21
|
+
</MenuGroup>
|
|
22
22
|
);
|
|
23
23
|
|
|
24
24
|
export const HelpPopup = () => {
|
|
25
|
-
|
|
25
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
const onClick = () => {
|
|
28
|
+
setIsOpen(!isOpen);
|
|
29
|
+
};
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
const onClose = () => {
|
|
32
|
+
setIsOpen(false);
|
|
33
|
+
};
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
35
|
+
return (
|
|
36
|
+
<Popup
|
|
37
|
+
placement="bottom-start"
|
|
38
|
+
content={HelpContent}
|
|
39
|
+
isOpen={isOpen}
|
|
40
|
+
onClose={onClose}
|
|
41
|
+
trigger={(triggerProps) => (
|
|
42
|
+
<Help
|
|
43
|
+
testId={'nav-help'}
|
|
44
|
+
isSelected={isOpen}
|
|
45
|
+
onClick={onClick}
|
|
46
|
+
tooltip="Help"
|
|
47
|
+
{...triggerProps}
|
|
48
|
+
/>
|
|
49
|
+
)}
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
52
|
};
|