@atlaskit/atlassian-navigation 2.6.15 → 2.6.17
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 +12 -0
- package/dist/cjs/components/PrimaryItemsContainerV2/index.js +83 -43
- package/dist/cjs/components/ProductHome/product-home.js +10 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/PrimaryItemsContainerV2/index.js +68 -44
- package/dist/es2019/components/ProductHome/product-home.js +9 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/PrimaryItemsContainerV2/index.js +85 -45
- package/dist/esm/components/ProductHome/product-home.js +10 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/components/PrimaryItemsContainerV2/index.d.ts +1 -3
- package/dist/types-ts4.5/components/PrimaryItemsContainerV2/index.d.ts +1 -3
- package/package.json +4 -4
- package/__perf__/default.tsx +0 -14
- package/docs/01-intro.tsx +0 -46
- package/docs/02-atlassian-navigation.tsx +0 -38
- package/docs/03-product-home.tsx +0 -73
- package/docs/04-app-switcher.tsx +0 -29
- package/docs/05-create.tsx +0 -37
- package/docs/06-primary-actions.tsx +0 -64
- package/docs/07-secondary-actions.tsx +0 -206
- package/docs/96-skeleton-buttons.tsx +0 -88
- package/docs/97-theming.tsx +0 -45
- package/docs/98-overflow-menu.tsx +0 -49
- package/docs/99-migrating-from-navigation-next.tsx +0 -52
- package/docs/ert/skeleton-create-button.tsx +0 -3
- package/docs/ert/skeleton-icon-button.tsx +0 -3
- package/docs/ert/skeleton-primary-button.tsx +0 -3
- package/docs/ert/skeleton-switcher-button.tsx +0 -3
|
@@ -91,12 +91,20 @@ var productIconStyles = css(_defineProperty({
|
|
|
91
91
|
}));
|
|
92
92
|
var siteTitleStyles = css({
|
|
93
93
|
display: 'flex',
|
|
94
|
+
// Overridden in PFF styles applied below; consolidate in FF cleanup
|
|
94
95
|
marginRight: "var(--ds-space-050, 4px)",
|
|
95
96
|
marginLeft: "var(--ds-space-050, 4px)",
|
|
96
97
|
paddingRight: "var(--ds-space-200, 16px)",
|
|
97
98
|
alignItems: 'center'
|
|
98
99
|
});
|
|
99
|
-
|
|
100
|
+
|
|
101
|
+
// When cleaning up feature flag, these styles can be moved into the above block
|
|
102
|
+
var featureFlaggedSiteTitleStyles = css(_defineProperty({
|
|
103
|
+
// Under the FF, we've made the site title handle it's spacing, with the
|
|
104
|
+
// PrimaryItemsContainer not needing to worry about its paddingInlineStart.
|
|
105
|
+
// This makes it cleaner for the title styles to appear and disappear with mq's
|
|
106
|
+
marginRight: "var(--ds-space-100, 8px)"
|
|
107
|
+
}, "@media (max-width: ".concat(PRODUCT_HOME_BREAKPOINT - 0.1, "px)"), {
|
|
100
108
|
display: 'none'
|
|
101
109
|
}));
|
|
102
110
|
|
|
@@ -167,7 +175,7 @@ var ProductHome = function ProductHome(_ref) {
|
|
|
167
175
|
style: {
|
|
168
176
|
borderRight: theme.mode.productHome.borderRight
|
|
169
177
|
},
|
|
170
|
-
css: [siteTitleStyles, getBooleanFF('platform.design-system-team.navigation-v2-no-jank_5yhbd') &&
|
|
178
|
+
css: [siteTitleStyles, getBooleanFF('platform.design-system-team.navigation-v2-no-jank_5yhbd') && featureFlaggedSiteTitleStyles],
|
|
171
179
|
"data-testid": testId && "".concat(testId, "-site-title")
|
|
172
180
|
}, siteTitle));
|
|
173
181
|
};
|
package/dist/esm/version.json
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
2
|
import { NavigationTheme } from '../../theme';
|
|
5
3
|
import { PrimaryItemsContainerProps } from '../PrimaryItemsContainer/types';
|
|
6
4
|
export declare const PrimaryItemsContainer: React.MemoExoticComponent<({ moreLabel, items, create: Create, theme, testId, }: PrimaryItemsContainerProps & {
|
|
7
5
|
theme: NavigationTheme;
|
|
8
|
-
}) =>
|
|
6
|
+
}) => JSX.Element>;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
2
|
import { NavigationTheme } from '../../theme';
|
|
5
3
|
import { PrimaryItemsContainerProps } from '../PrimaryItemsContainer/types';
|
|
6
4
|
export declare const PrimaryItemsContainer: React.MemoExoticComponent<({ moreLabel, items, create: Create, theme, testId, }: PrimaryItemsContainerProps & {
|
|
7
5
|
theme: NavigationTheme;
|
|
8
|
-
}) =>
|
|
6
|
+
}) => JSX.Element>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/atlassian-navigation",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.17",
|
|
4
4
|
"description": "A horizontal navigation component for Atlassian products.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"sideEffects": false,
|
|
24
24
|
"atlaskit:src": "src/index.tsx",
|
|
25
25
|
"atlassian": {
|
|
26
|
-
"team": "Design System
|
|
26
|
+
"team": "Design System Pyxis",
|
|
27
27
|
"deprecatedAutoEntryPoints": true,
|
|
28
28
|
"releaseModel": "continuous",
|
|
29
29
|
"website": {
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"@atlaskit/icon": "^21.12.0",
|
|
39
39
|
"@atlaskit/logo": "*",
|
|
40
40
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
41
|
-
"@atlaskit/popup": "^1.
|
|
42
|
-
"@atlaskit/primitives": "^1.0.
|
|
41
|
+
"@atlaskit/popup": "^1.9.0",
|
|
42
|
+
"@atlaskit/primitives": "^1.0.6",
|
|
43
43
|
"@atlaskit/theme": "^12.5.0",
|
|
44
44
|
"@atlaskit/tokens": "^1.13.0",
|
|
45
45
|
"@atlaskit/tooltip": "^17.8.0",
|
package/__perf__/default.tsx
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { AtlassianNavigation, Settings } from '../src';
|
|
4
|
-
|
|
5
|
-
const DefaultSettings = () => <Settings tooltip="Product settings" />;
|
|
6
|
-
|
|
7
|
-
export default () => (
|
|
8
|
-
<AtlassianNavigation
|
|
9
|
-
label="site"
|
|
10
|
-
renderProductHome={() => null}
|
|
11
|
-
renderSettings={DefaultSettings}
|
|
12
|
-
primaryItems={[]}
|
|
13
|
-
/>
|
|
14
|
-
);
|
package/docs/01-intro.tsx
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { code, Example, md } from '@atlaskit/docs';
|
|
4
|
-
|
|
5
|
-
export default md`
|
|
6
|
-
|
|
7
|
-
## Documentation
|
|
8
|
-
|
|
9
|
-
All the documentation can be found in the **sidebar nav links** 👈
|
|
10
|
-
|
|
11
|
-
- [Atlassian navigation](atlassian-navigation/docs/atlassian-navigation)
|
|
12
|
-
- [Product home](atlassian-navigation/docs/product-home)
|
|
13
|
-
- [App switcher](atlassian-navigation/docs/app-switcher)
|
|
14
|
-
- [Create](atlassian-navigation/docs/create)
|
|
15
|
-
- [Primary actions](atlassian-navigation/docs/primary-actions)
|
|
16
|
-
- [Secondary actions](atlassian-navigation/docs/secondary-actions)
|
|
17
|
-
- [Theming](atlassian-navigation/docs/theming)
|
|
18
|
-
- [Overflow menu](atlassian-navigation/docs/overflow-menu)
|
|
19
|
-
- [Migrating from navigation-next](atlassian-navigation/docs/migrating-from-navigation-next)
|
|
20
|
-
|
|
21
|
-
## Usage
|
|
22
|
-
|
|
23
|
-
${code`
|
|
24
|
-
import React, { useState } from 'react';
|
|
25
|
-
import { AtlassianNavigation, ProductHome, PrimaryButton } from '../src';
|
|
26
|
-
|
|
27
|
-
const AtlassianHome = () => (
|
|
28
|
-
<ProductHome icon={AtlassianIcon} logo={AtlassianLogo} />
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
<AtlassianNavigation
|
|
32
|
-
renderProductHome={AtlassianHome}
|
|
33
|
-
primaryItems={[
|
|
34
|
-
<PrimaryButton>Issues</PrimaryButton>
|
|
35
|
-
]}
|
|
36
|
-
/>
|
|
37
|
-
`}
|
|
38
|
-
|
|
39
|
-
${(
|
|
40
|
-
<Example
|
|
41
|
-
title="Atlassian navigation"
|
|
42
|
-
Component={require('../examples/barebones').default}
|
|
43
|
-
source={require('!!raw-loader!../examples/barebones')}
|
|
44
|
-
/>
|
|
45
|
-
)}
|
|
46
|
-
`;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { code, Example, md, Props } from '@atlaskit/docs';
|
|
4
|
-
|
|
5
|
-
export default md`
|
|
6
|
-
The primary component that will render the horizontal navigation.
|
|
7
|
-
Compose with other components like [product home](product-home),
|
|
8
|
-
[create](create),
|
|
9
|
-
[primary button](primary-button),
|
|
10
|
-
and more to build up your navigation experience.
|
|
11
|
-
|
|
12
|
-
${code`
|
|
13
|
-
import { AtlassianNavigation } from '@atlaskit/atlassian-navigation';
|
|
14
|
-
|
|
15
|
-
<AtlassianNavigation
|
|
16
|
-
primaryItems={[
|
|
17
|
-
<PrimaryButton>Issues</PrimaryButton>,
|
|
18
|
-
<ExploreDropdown />,
|
|
19
|
-
]}
|
|
20
|
-
renderProductHome={ProductHomeExample}
|
|
21
|
-
/>
|
|
22
|
-
`}
|
|
23
|
-
|
|
24
|
-
${(
|
|
25
|
-
<Example
|
|
26
|
-
title="Atlassian navigation"
|
|
27
|
-
Component={require('../examples/barebones').default}
|
|
28
|
-
source={require('!!raw-loader!../examples/barebones')}
|
|
29
|
-
/>
|
|
30
|
-
)}
|
|
31
|
-
|
|
32
|
-
${(
|
|
33
|
-
<Props
|
|
34
|
-
heading="Props"
|
|
35
|
-
props={require('!!extract-react-types-loader!../src/components/AtlassianNavigation')}
|
|
36
|
-
/>
|
|
37
|
-
)}
|
|
38
|
-
`;
|
package/docs/03-product-home.tsx
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { code, Example, md, Props } from '@atlaskit/docs';
|
|
4
|
-
|
|
5
|
-
export default md`
|
|
6
|
-
To be composed with [Atlassian navigation](atlassian-navigation).
|
|
7
|
-
Will render the logo or icon for the consuming product while handling responsive viewports.
|
|
8
|
-
|
|
9
|
-
Defining navigation for a product that does not have a logo inside [\`@atlaskit/logo\`](/packages/design-system/logo) or wanting to use a custom logo?
|
|
10
|
-
You'll want to create use the **custom product home** component further below.
|
|
11
|
-
|
|
12
|
-
${code`
|
|
13
|
-
import { ProductHome } from '@atlaskit/atlassian-navigation';
|
|
14
|
-
import { AtlassianLogo, AtlassianIcon } from '@atlaskit/logo';
|
|
15
|
-
|
|
16
|
-
<ProductHome icon={AtlassianIcon} logo={AtlassianLogo} />
|
|
17
|
-
`}
|
|
18
|
-
|
|
19
|
-
${(
|
|
20
|
-
<Example
|
|
21
|
-
title="Product home"
|
|
22
|
-
Component={require('../examples/product-home').default}
|
|
23
|
-
source={require('!!raw-loader!../examples/product-home')}
|
|
24
|
-
/>
|
|
25
|
-
)}
|
|
26
|
-
|
|
27
|
-
${(
|
|
28
|
-
<Props
|
|
29
|
-
heading="Props"
|
|
30
|
-
props={require('!!extract-react-types-loader!../src/components/ProductHome/product-home')}
|
|
31
|
-
/>
|
|
32
|
-
)}
|
|
33
|
-
|
|
34
|
-
## Custom product home
|
|
35
|
-
|
|
36
|
-
If you're making a custom product that doesn't have a readily available logo you'll want to use the custom product home component.
|
|
37
|
-
|
|
38
|
-
Are you defining navigation for a product that exists inside [\`@atlaskit/logo\`](/packages/design-system/logo)?
|
|
39
|
-
You'll want to use the **product home component** above.
|
|
40
|
-
|
|
41
|
-
${code`
|
|
42
|
-
import { CustomProductHome } from '@atlaskit/atlassian-navigation';
|
|
43
|
-
import icon from './shared/assets/atlassian-icon.png';
|
|
44
|
-
import logo from './shared/assets/atlassian-logo.png';
|
|
45
|
-
|
|
46
|
-
export default () => (
|
|
47
|
-
<CustomProductHome
|
|
48
|
-
href="#"
|
|
49
|
-
iconAlt="Atlassian"
|
|
50
|
-
iconUrl={icon}
|
|
51
|
-
logoAlt="Atlassian"
|
|
52
|
-
logoUrl={logo}
|
|
53
|
-
/>
|
|
54
|
-
);
|
|
55
|
-
`}
|
|
56
|
-
|
|
57
|
-
${(
|
|
58
|
-
<Example
|
|
59
|
-
title="Custom product home"
|
|
60
|
-
Component={require('../examples/custom-product-home').default}
|
|
61
|
-
source={require('!!raw-loader!../examples/custom-product-home')}
|
|
62
|
-
/>
|
|
63
|
-
)}
|
|
64
|
-
|
|
65
|
-
### Props
|
|
66
|
-
|
|
67
|
-
${(
|
|
68
|
-
<Props
|
|
69
|
-
heading=""
|
|
70
|
-
props={require('!!extract-react-types-loader!../src/components/ProductHome/custom-product-home')}
|
|
71
|
-
/>
|
|
72
|
-
)}
|
|
73
|
-
`;
|
package/docs/04-app-switcher.tsx
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { code, Example, md, Props } from '@atlaskit/docs';
|
|
4
|
-
|
|
5
|
-
export default md`
|
|
6
|
-
App switcher is a pre-made button with an icon that you can use to then implement an app switcher,
|
|
7
|
-
generally you'll want to use the [Atlassian switcher](/packages/navigation/atlassian-switcher) component composed with
|
|
8
|
-
|
|
9
|
-
${code`
|
|
10
|
-
import { AppSwitcher } from '@atlaskit/atlassian-navigation';
|
|
11
|
-
|
|
12
|
-
<AppSwitcher tooltip="Switch to..." />;
|
|
13
|
-
`}
|
|
14
|
-
|
|
15
|
-
${(
|
|
16
|
-
<Example
|
|
17
|
-
title="App switcher"
|
|
18
|
-
Component={require('../examples/app-switcher').default}
|
|
19
|
-
source={require('!!raw-loader!../examples/app-switcher')}
|
|
20
|
-
/>
|
|
21
|
-
)}
|
|
22
|
-
|
|
23
|
-
${(
|
|
24
|
-
<Props
|
|
25
|
-
heading="Props"
|
|
26
|
-
props={require('!!extract-react-types-loader!../src/components/AppSwitcher')}
|
|
27
|
-
/>
|
|
28
|
-
)}
|
|
29
|
-
`;
|
package/docs/05-create.tsx
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { code, Example, md, Props } from '@atlaskit/docs';
|
|
4
|
-
|
|
5
|
-
export default md`
|
|
6
|
-
Primary call to action component for the Atlassian navigation package which handles responsive viewports.
|
|
7
|
-
Compose this with the [Atlassian navigation](atlassian-navigation) package.
|
|
8
|
-
|
|
9
|
-
${code`
|
|
10
|
-
import { Create } from '@atlaskit/atlassian-navigation';
|
|
11
|
-
|
|
12
|
-
<Create text="Create" onClick={console.log} />;
|
|
13
|
-
`}
|
|
14
|
-
|
|
15
|
-
${(
|
|
16
|
-
<Example
|
|
17
|
-
title="Create"
|
|
18
|
-
Component={require('../examples/create').default}
|
|
19
|
-
source={require('!!raw-loader!../examples/create')}
|
|
20
|
-
/>
|
|
21
|
-
)}
|
|
22
|
-
|
|
23
|
-
${(
|
|
24
|
-
<Example
|
|
25
|
-
title="Create as a link"
|
|
26
|
-
Component={require('../examples/create-with-link').default}
|
|
27
|
-
source={require('!!raw-loader!../examples/create-with-link')}
|
|
28
|
-
/>
|
|
29
|
-
)}
|
|
30
|
-
|
|
31
|
-
${(
|
|
32
|
-
<Props
|
|
33
|
-
heading="Props"
|
|
34
|
-
props={require('!!extract-react-types-loader!../src/components/Create')}
|
|
35
|
-
/>
|
|
36
|
-
)}
|
|
37
|
-
`;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { code, Example, md, Props } from '@atlaskit/docs';
|
|
4
|
-
|
|
5
|
-
export default md`
|
|
6
|
-
These actions are to be used with the \`primaryItems\` prop in the \`primaryItems\` of the Atlassian navigation component.
|
|
7
|
-
|
|
8
|
-
## Primary button
|
|
9
|
-
|
|
10
|
-
Buttons to be used when navigating through pages in your application,
|
|
11
|
-
or displaying modals,
|
|
12
|
-
drawers,
|
|
13
|
-
etc.
|
|
14
|
-
|
|
15
|
-
${code`
|
|
16
|
-
import { PrimaryButton } from '@atlaskit/atlassian-navigation';
|
|
17
|
-
|
|
18
|
-
<PrimaryButton>Explore</PrimaryButton>;
|
|
19
|
-
`}
|
|
20
|
-
|
|
21
|
-
${(
|
|
22
|
-
<Example
|
|
23
|
-
title="Primary button"
|
|
24
|
-
Component={require('../examples/primary-button').default}
|
|
25
|
-
source={require('!!raw-loader!../examples/primary-button')}
|
|
26
|
-
/>
|
|
27
|
-
)}
|
|
28
|
-
|
|
29
|
-
### Props
|
|
30
|
-
|
|
31
|
-
${(
|
|
32
|
-
<Props
|
|
33
|
-
heading=""
|
|
34
|
-
props={require('!!extract-react-types-loader!../src/components/PrimaryButton')}
|
|
35
|
-
/>
|
|
36
|
-
)}
|
|
37
|
-
|
|
38
|
-
## Primary dropdown button
|
|
39
|
-
|
|
40
|
-
Dropdown button to be used when composing with [Popup](/packages/design-system/popup) and [Menu](/packages/design-system/menu).
|
|
41
|
-
|
|
42
|
-
${code`
|
|
43
|
-
import { PrimaryDropdownButton } from '@atlaskit/atlassian-navigation';
|
|
44
|
-
|
|
45
|
-
<PrimaryDropdownButton>Explore</PrimaryDropdownButton>;
|
|
46
|
-
`}
|
|
47
|
-
|
|
48
|
-
${(
|
|
49
|
-
<Example
|
|
50
|
-
title="Primary dropdown button"
|
|
51
|
-
Component={require('../examples/primary-dropdown-button').default}
|
|
52
|
-
source={require('!!raw-loader!../examples/primary-dropdown-button')}
|
|
53
|
-
/>
|
|
54
|
-
)}
|
|
55
|
-
|
|
56
|
-
### Props
|
|
57
|
-
|
|
58
|
-
${(
|
|
59
|
-
<Props
|
|
60
|
-
heading=""
|
|
61
|
-
props={require('!!extract-react-types-loader!../src/components/PrimaryDropdownButton')}
|
|
62
|
-
/>
|
|
63
|
-
)}
|
|
64
|
-
`;
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { code, Example, md, Props } from '@atlaskit/docs';
|
|
4
|
-
|
|
5
|
-
export default md`
|
|
6
|
-
These components should be used for the right actions in [Atlassian-navigation](atlassian-navigation).
|
|
7
|
-
They each have a specific prop to slot the component in.
|
|
8
|
-
It is up to you to implement the behaviour behind the buttons.
|
|
9
|
-
|
|
10
|
-
## Help
|
|
11
|
-
|
|
12
|
-
Used for showing help in your application.
|
|
13
|
-
Generally you'll want to compose this with [Popup](/packages/design-system/popup) and [Menu](/packages/design-system/menu).
|
|
14
|
-
|
|
15
|
-
${code`
|
|
16
|
-
import { Help } from '@atlaskit/atlassian-navigation';
|
|
17
|
-
|
|
18
|
-
<Help onClick={console.log} tooltip="Get help" />;
|
|
19
|
-
`}
|
|
20
|
-
|
|
21
|
-
${(
|
|
22
|
-
<Example
|
|
23
|
-
title="Help button"
|
|
24
|
-
Component={require('../examples/help-button').default}
|
|
25
|
-
source={require('!!raw-loader!../examples/help-button')}
|
|
26
|
-
/>
|
|
27
|
-
)}
|
|
28
|
-
|
|
29
|
-
### Props
|
|
30
|
-
|
|
31
|
-
${(
|
|
32
|
-
<Props
|
|
33
|
-
heading=""
|
|
34
|
-
props={require('!!extract-react-types-loader!../src/components/Help')}
|
|
35
|
-
/>
|
|
36
|
-
)}
|
|
37
|
-
|
|
38
|
-
## Profile
|
|
39
|
-
|
|
40
|
-
Used for showing an authenticated user.
|
|
41
|
-
Generally you'll want to compose this with [Popup](/packages/design-system/popup) and [Menu](/packages/design-system/menu).
|
|
42
|
-
|
|
43
|
-
You are required to correctly style the avatar image.
|
|
44
|
-
You will want to use the \`SignIn\` component if they are not logged in.
|
|
45
|
-
|
|
46
|
-
${code`
|
|
47
|
-
import { Profile } from '@atlaskit/atlassian-navigation';
|
|
48
|
-
|
|
49
|
-
<Profile
|
|
50
|
-
tooltip="Your profile and settings"
|
|
51
|
-
onClick={onClick}
|
|
52
|
-
icon={
|
|
53
|
-
<img
|
|
54
|
-
style={{ borderRadius: '50%', width: 24, height: 24 }}
|
|
55
|
-
src={avatarUrl}
|
|
56
|
-
/>
|
|
57
|
-
}
|
|
58
|
-
/>
|
|
59
|
-
`}
|
|
60
|
-
|
|
61
|
-
${(
|
|
62
|
-
<Example
|
|
63
|
-
title="Profile button"
|
|
64
|
-
Component={require('../examples/profile').default}
|
|
65
|
-
source={require('!!raw-loader!../examples/profile')}
|
|
66
|
-
/>
|
|
67
|
-
)}
|
|
68
|
-
|
|
69
|
-
### Props
|
|
70
|
-
|
|
71
|
-
${(
|
|
72
|
-
<Props
|
|
73
|
-
heading=""
|
|
74
|
-
props={require('!!extract-react-types-loader!../src/components/Profile')}
|
|
75
|
-
/>
|
|
76
|
-
)}
|
|
77
|
-
|
|
78
|
-
## Search
|
|
79
|
-
|
|
80
|
-
Used for showing a search textbox,
|
|
81
|
-
will display a textbox at large viewports and an icon at small viewports.
|
|
82
|
-
You will need to handle hooking up events accordingly.
|
|
83
|
-
Search includes its own \`search\` landmark internally for users navigating with screen readers.
|
|
84
|
-
|
|
85
|
-
This is made to be composed with [Global search](/packages/search/global-search) or [Quick search](/packages/search/quick-search)
|
|
86
|
-
|
|
87
|
-
### Prop information
|
|
88
|
-
Search has three similar required props: \`placeholder\` \`tooltip\` and \`label\`. Each has a different purpose and use cases
|
|
89
|
-
and so must be provided separately:
|
|
90
|
-
- \`placeholder\` text displays inside the search box before the user has input text
|
|
91
|
-
- \`tooltip\` can contain not just text, but any React node – such as a badge for a keyboard shortcut
|
|
92
|
-
- \`label\` text is read to users who visit the search field with a screen reader
|
|
93
|
-
|
|
94
|
-
${code`
|
|
95
|
-
import { Search } from '@atlaskit/atlassian-navigation';
|
|
96
|
-
|
|
97
|
-
<Search onClick={onClick} placeholder="Search..." tooltip="Search" label="Search" />
|
|
98
|
-
`}
|
|
99
|
-
|
|
100
|
-
${(
|
|
101
|
-
<Example
|
|
102
|
-
title="Search"
|
|
103
|
-
Component={require('../examples/search').default}
|
|
104
|
-
source={require('!!raw-loader!../examples/search')}
|
|
105
|
-
/>
|
|
106
|
-
)}
|
|
107
|
-
|
|
108
|
-
### Props
|
|
109
|
-
|
|
110
|
-
${(
|
|
111
|
-
<Props
|
|
112
|
-
heading=""
|
|
113
|
-
props={require('!!extract-react-types-loader!../src/components/Search')}
|
|
114
|
-
/>
|
|
115
|
-
)}
|
|
116
|
-
|
|
117
|
-
## Settings
|
|
118
|
-
|
|
119
|
-
Used for showing a settings button,
|
|
120
|
-
Generally you'll want to compose this with [Popup](/packages/design-system/popup) and [Menu](/packages/design-system/menu).
|
|
121
|
-
|
|
122
|
-
${code`
|
|
123
|
-
import { Settings } from '@atlaskit/atlassian-navigation';
|
|
124
|
-
|
|
125
|
-
<Settings onClick={console.log} tooltip="Product settings" />
|
|
126
|
-
`}
|
|
127
|
-
|
|
128
|
-
${(
|
|
129
|
-
<Example
|
|
130
|
-
title="Settings"
|
|
131
|
-
Component={require('../examples/settings').default}
|
|
132
|
-
source={require('!!raw-loader!../examples/settings')}
|
|
133
|
-
/>
|
|
134
|
-
)}
|
|
135
|
-
|
|
136
|
-
### Props
|
|
137
|
-
|
|
138
|
-
${(
|
|
139
|
-
<Props
|
|
140
|
-
heading=""
|
|
141
|
-
props={require('!!extract-react-types-loader!../src/components/Settings')}
|
|
142
|
-
/>
|
|
143
|
-
)}
|
|
144
|
-
|
|
145
|
-
## Sign in
|
|
146
|
-
|
|
147
|
-
Used for showing a sign in button.
|
|
148
|
-
You will want to link to the Atlassian account log in page.
|
|
149
|
-
Make sure to only show this when the user is not logged in,
|
|
150
|
-
otherwise use the \`Profile\` component.
|
|
151
|
-
|
|
152
|
-
${code`
|
|
153
|
-
import { Settings } from '@atlaskit/atlassian-navigation';
|
|
154
|
-
|
|
155
|
-
<SignIn href="#" tooltip="Sign in" />
|
|
156
|
-
`}
|
|
157
|
-
|
|
158
|
-
${(
|
|
159
|
-
<Example
|
|
160
|
-
title="Settings"
|
|
161
|
-
Component={require('../examples/sign-in').default}
|
|
162
|
-
source={require('!!raw-loader!../examples/sign-in')}
|
|
163
|
-
/>
|
|
164
|
-
)}
|
|
165
|
-
|
|
166
|
-
### Props
|
|
167
|
-
|
|
168
|
-
${(
|
|
169
|
-
<Props
|
|
170
|
-
heading=""
|
|
171
|
-
props={require('!!extract-react-types-loader!../src/components/SignIn')}
|
|
172
|
-
/>
|
|
173
|
-
)}
|
|
174
|
-
|
|
175
|
-
## Notifications
|
|
176
|
-
|
|
177
|
-
Used for showing Atlassian notifications.
|
|
178
|
-
You'll want to compose this with [notification indicator](/packages/notifications/notification-indicator),
|
|
179
|
-
[notification log client](/packages/notifications/notification-log-client),
|
|
180
|
-
and [Atlassian notifications](/packages/navigation/atlassian-notifications).
|
|
181
|
-
|
|
182
|
-
See the examples for patterns regarding clearing the notification badge count.
|
|
183
|
-
|
|
184
|
-
${code`
|
|
185
|
-
import { Notifications } from '@atlaskit/atlassian-navigation';
|
|
186
|
-
|
|
187
|
-
<Notifications badge={null} tooltip="Notifications" />
|
|
188
|
-
`}
|
|
189
|
-
|
|
190
|
-
${(
|
|
191
|
-
<Example
|
|
192
|
-
title="Notifications"
|
|
193
|
-
Component={require('../examples/notifications').default}
|
|
194
|
-
source={require('!!raw-loader!../examples/notifications')}
|
|
195
|
-
/>
|
|
196
|
-
)}
|
|
197
|
-
|
|
198
|
-
### Props
|
|
199
|
-
|
|
200
|
-
${(
|
|
201
|
-
<Props
|
|
202
|
-
heading=""
|
|
203
|
-
props={require('!!extract-react-types-loader!../src/components/Notifications')}
|
|
204
|
-
/>
|
|
205
|
-
)}
|
|
206
|
-
`;
|