@atlaskit/side-navigation 1.2.8 → 1.2.11
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 +18 -0
- package/README.md +3 -3
- package/constellation/index/examples.mdx +97 -0
- package/constellation/index/props.mdx +30 -0
- package/constellation/index/usage.mdx +23 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/components/NestableNavigationContent/index.d.ts +3 -3
- package/package.json +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/side-navigation
|
|
2
2
|
|
|
3
|
+
## 1.2.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`efa50ac72ba`](https://bitbucket.org/atlassian/atlassian-frontend/commits/efa50ac72ba) - Adjusts jsdoc strings to improve prop documentation
|
|
8
|
+
|
|
9
|
+
## 1.2.10
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 1.2.9
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [`85ca75319b1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/85ca75319b1) - Move side-navigation docs to Constellation (atlassian.design)
|
|
20
|
+
|
|
3
21
|
## 1.2.8
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Side Navigation
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A side navigation experience used in Atlassian products.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ yarn add @atlaskit/side-navigation
|
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
|
-
Detailed docs and example usage can be found [here](https://
|
|
13
|
+
Detailed docs and example usage can be found [here](https://atlassian.design/components/side-navigation).
|
|
14
14
|
|
|
15
|
-
To add a top navigation, use [@atlaskit/atlassian-navigation](https://
|
|
15
|
+
To add a top navigation, use [@atlaskit/atlassian-navigation](https://atlassian.design/components/atlassian-navigation)
|
|
16
16
|
To control the layout of these navigation elements and add expand/collapse functionality to `side-navigation`, use [@atlaskit/page-layout](https://atlaskit.atlassian.com/packages/design-system/page-layout).
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
order: 0
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
import ButtonItemExample from '../../examples/constellation/button-item';
|
|
6
|
+
import ContainerExample from '../../examples/constellation/container';
|
|
7
|
+
import ContentExample from '../../examples/constellation/content';
|
|
8
|
+
import CustomItemExample from '../../examples/constellation/custom-item';
|
|
9
|
+
import DefaultExample from '../../examples/constellation/default';
|
|
10
|
+
import GoBackExample from '../../examples/constellation/go-back';
|
|
11
|
+
import HeaderAndFooterExample from '../../examples/constellation/header-and-footer';
|
|
12
|
+
import LinkItemExample from '../../examples/constellation/link-item';
|
|
13
|
+
import LoadingExample from '../../examples/constellation/loading';
|
|
14
|
+
import NestedExample from '../../examples/constellation/nested';
|
|
15
|
+
import SectionExample from '../../examples/constellation/section';
|
|
16
|
+
|
|
17
|
+
## Default
|
|
18
|
+
|
|
19
|
+
A side navigation example showing all [components](#side-navigation-components) and [items](#side-navigation-items) composed together.
|
|
20
|
+
|
|
21
|
+
<Example Component={DefaultExample} packageName="@atlaskit/side-navigation" />
|
|
22
|
+
|
|
23
|
+
## Side navigation components
|
|
24
|
+
|
|
25
|
+
### Container
|
|
26
|
+
|
|
27
|
+
Uses 100% of its parent's height and width, so make sure to place it into an element with explicit values set.<br />
|
|
28
|
+
**Minimum width of 240px.**
|
|
29
|
+
|
|
30
|
+
<Example Component={ContainerExample} packageName="@atlaskit/side-navigation"/>
|
|
31
|
+
|
|
32
|
+
### Header and footer
|
|
33
|
+
|
|
34
|
+
You can customise header and footer using `NavigationHeader` and `NavigationFooter`.
|
|
35
|
+
|
|
36
|
+
<Example Component={HeaderAndFooterExample} packageName="@atlaskit/side-navigation"/>
|
|
37
|
+
|
|
38
|
+
### Content
|
|
39
|
+
|
|
40
|
+
Used as the container for [navigation items](#side-navigation-items). For nested views see the following example.
|
|
41
|
+
|
|
42
|
+
<Example Component={ContentExample} packageName="@atlaskit/side-navigation"/>
|
|
43
|
+
|
|
44
|
+
### Section
|
|
45
|
+
|
|
46
|
+
Used to separate items into sections. Using the `title` prop makes a section implicitly group the items for screen readers with no additional work required.
|
|
47
|
+
|
|
48
|
+
<Example Component={SectionExample} packageName="@atlaskit/side-navigation"/>
|
|
49
|
+
|
|
50
|
+
### Nested navigation
|
|
51
|
+
|
|
52
|
+
The container for navigation items with nested views is `NestableNavigationContent`.
|
|
53
|
+
|
|
54
|
+
<Example Component={NestedExample} packageName="@atlaskit/side-navigation"/>
|
|
55
|
+
|
|
56
|
+
## Side navigation items
|
|
57
|
+
|
|
58
|
+
Granular items that can be rendered as part of the navigation experience.<br />
|
|
59
|
+
The `Section` component **must** be used to ensure consistent spacing around blocks of items.
|
|
60
|
+
|
|
61
|
+
### Go back item
|
|
62
|
+
|
|
63
|
+
This item is used to provide a customized "go back" button in nested navigations.
|
|
64
|
+
|
|
65
|
+
<Example Component={GoBackExample} packageName="@atlaskit/side-navigation"/>
|
|
66
|
+
|
|
67
|
+
### Link item
|
|
68
|
+
|
|
69
|
+
Renders an item wrapped in an anchor tag, useful when you have an item that should change routes using native browser navigation.
|
|
70
|
+
|
|
71
|
+
For custom SPA transitions use a custom item with the respective router logic, following the next example.
|
|
72
|
+
|
|
73
|
+
<Example Component={LinkItemExample} packageName="@atlaskit/side-navigation"/>
|
|
74
|
+
|
|
75
|
+
### Custom item
|
|
76
|
+
|
|
77
|
+
Handles use cases where a custom router link component is needed.
|
|
78
|
+
|
|
79
|
+
The custom component receives all overflow props passed to the custom item component, as well as when using TypeScript will add the custom component props to the root component props type for type safety.
|
|
80
|
+
|
|
81
|
+
<Example Component={CustomItemExample} packageName="@atlaskit/side-navigation"/>
|
|
82
|
+
|
|
83
|
+
### Button item
|
|
84
|
+
|
|
85
|
+
Renders an item wrapped in a button tag, used primarily when an action does something other than changing routes.
|
|
86
|
+
|
|
87
|
+
<Example Component={ButtonItemExample} packageName="@atlaskit/side-navigation"/>
|
|
88
|
+
|
|
89
|
+
### Heading item
|
|
90
|
+
|
|
91
|
+
Available for advanced use cases, for most situations providing a `title` to `Section` should be enough.
|
|
92
|
+
|
|
93
|
+
## Loading
|
|
94
|
+
|
|
95
|
+
Use loading skeletons to reduce the perceived loading time.
|
|
96
|
+
|
|
97
|
+
<Example Component={LoadingExample} packageName="@atlaskit/side-navigation"/>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import SideNavigationProps from '!!extract-react-types-loader!../../src/components/SideNavigation'
|
|
2
|
+
import HeaderProps from '!!extract-react-types-loader!../../src/components/Header'
|
|
3
|
+
import FooterProps from '!!extract-react-types-loader!../../src/components/Footer'
|
|
4
|
+
import NavigationContentProps from '!!extract-react-types-loader!../../src/components/NavigationContent'
|
|
5
|
+
import NestableNavigationContentProps from '!!extract-react-types-loader!../../src/components/NestableNavigationContent'
|
|
6
|
+
import SectionProps from '!!extract-react-types-loader!../../src/components/Section'
|
|
7
|
+
|
|
8
|
+
### Navigation props
|
|
9
|
+
|
|
10
|
+
<PropsTable heading="" props={SideNavigationProps}/>
|
|
11
|
+
|
|
12
|
+
### Header props
|
|
13
|
+
|
|
14
|
+
<PropsTable heading="" props={HeaderProps}/>
|
|
15
|
+
|
|
16
|
+
### Footer props
|
|
17
|
+
|
|
18
|
+
<PropsTable heading="" props={FooterProps}/>
|
|
19
|
+
|
|
20
|
+
### Content props
|
|
21
|
+
|
|
22
|
+
<PropsTable heading="" props={NavigationContentProps}/>
|
|
23
|
+
|
|
24
|
+
### Nestable content props
|
|
25
|
+
|
|
26
|
+
<PropsTable heading="" props={NestableNavigationContentProps}/>
|
|
27
|
+
|
|
28
|
+
### Section props
|
|
29
|
+
|
|
30
|
+
<PropsTable heading="" props={SectionProps}/>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
order: 2
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
import buttonConciseDo from './images/button-concise-do.png';
|
|
6
|
+
import buttonConciseDont from './images/button-concise-dont.png';
|
|
7
|
+
import buttonCapitalizationDo from './images/button-capitalization-do.png';
|
|
8
|
+
import buttonCapitalizationDont from './images/button-capitalization-dont.png';
|
|
9
|
+
import buttonActionDo from './images/button-action-do.png';
|
|
10
|
+
import buttonActionDont from './images/button-action-dont.png';
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
### Loading states
|
|
15
|
+
|
|
16
|
+
Occasionally it's necessary to load some of the side navigation content asynchronously. There are a few things to take care of
|
|
17
|
+
|
|
18
|
+
* Only use skeletons when you're quite certain of what the loaded state will look like. Most items that would appear in side navigation are probably fine to use with skeletons, for example, `@atlaskit/tree`.
|
|
19
|
+
* When transitioning from loading skeleton to loaded items, try to ensure the jump does not look janky - use the equivalent skeleton item that is appropriate and be careful of things jumping around by a few pixels. We should be striving for UI that feels __stable__, which means it doesn't jump around when content loads.
|
|
20
|
+
* Ensure loading does not take too long - try to anticipate if a user will look at your menu via hover events and the like, and pre-load the data as soon as possible.
|
|
21
|
+
* When content is loading in, make sure it all loads in at the same time - our minds aren't fast enough to distinguish each item loading individually, for example, and it would appear slower to most users.
|
|
22
|
+
|
|
23
|
+
For a more in-depth look at how to approach loading states, please check out the _work in progress_ [skeleton exploration](https://hello.atlassian.net/wiki/spaces/ADG/pages/598816601/Loading+experiences+-+3.4+-+Guideline+exploration+-+Skeleton#Exploration-(spec)) (content restricted to Atlassian staff).
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/version.json
CHANGED
package/dist/esm/version.json
CHANGED
|
@@ -38,9 +38,9 @@ export interface NestableNavigationContentProps {
|
|
|
38
38
|
*/
|
|
39
39
|
onChange?: (stack: string[]) => void;
|
|
40
40
|
/**
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
Custom overrides for the composed components.
|
|
42
|
+
|
|
43
|
+
@deprecated Please avoid using this prop as we intend to remove the prop completely in a future release. See DSP-2682 for more information.
|
|
44
44
|
*/
|
|
45
45
|
overrides?: {
|
|
46
46
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/side-navigation",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.11",
|
|
4
4
|
"description": "A highly composable side navigation component that supports nested views.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"@atlaskit/ds-lib": "^1.4.0",
|
|
27
27
|
"@atlaskit/icon": "^21.10.0",
|
|
28
28
|
"@atlaskit/menu": "^1.3.0",
|
|
29
|
-
"@atlaskit/motion": "^1.
|
|
29
|
+
"@atlaskit/motion": "^1.1.0",
|
|
30
30
|
"@atlaskit/theme": "^12.1.0",
|
|
31
|
-
"@atlaskit/tokens": "^0.
|
|
31
|
+
"@atlaskit/tokens": "^0.10.0",
|
|
32
32
|
"@babel/runtime": "^7.0.0",
|
|
33
33
|
"@emotion/core": "^10.0.9"
|
|
34
34
|
},
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"react": "^16.8.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@atlaskit/atlassian-navigation": "^2.
|
|
39
|
+
"@atlaskit/atlassian-navigation": "^2.2.0",
|
|
40
40
|
"@atlaskit/button": "^16.3.0",
|
|
41
41
|
"@atlaskit/docs": "*",
|
|
42
|
-
"@atlaskit/logo": "^13.
|
|
42
|
+
"@atlaskit/logo": "^13.6.0",
|
|
43
43
|
"@atlaskit/onboarding": "^10.3.0",
|
|
44
44
|
"@atlaskit/section-message": "^6.0.0",
|
|
45
45
|
"@atlaskit/select": "^15.2.0",
|
|
@@ -67,5 +67,6 @@
|
|
|
67
67
|
"deprecation": "no-deprecated-imports"
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
|
+
"homepage": "https://atlassian.design/components/side-navigation/",
|
|
70
71
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
71
72
|
}
|