This repository has been archived by the owner on Aug 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
WIP: pagination docs #712
Open
KiriHoy
wants to merge
1
commit into
develop
Choose a base branch
from
feature/pagination-docs-test
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
WIP: pagination docs #712
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
content/components/pagination/accessibility/a11y-colorblind/index.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
layout: example/page | ||
examples: | ||
- template: ../example-code.md | ||
filter: deuteranopia | ||
alignment: inline |
5 changes: 5 additions & 0 deletions
5
content/components/pagination/accessibility/a11y-grayscale/index.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
layout: example/page | ||
examples: | ||
- template: ../example-code.md | ||
filter: grayscale | ||
alignment: inline |
5 changes: 5 additions & 0 deletions
5
content/components/pagination/accessibility/a11y-keyboard/index.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
layout: example/page | ||
examples: | ||
- template: ../example-code.md | ||
tabbing: true | ||
alignment: inline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
layout: component/code-demo | ||
iframe: a11y-colorblind | ||
iframeFullwidth: true | ||
--- | ||
## Colour impairment | ||
|
||
How the pagination is viewed with various colour blindnesses |
35 changes: 35 additions & 0 deletions
35
content/components/pagination/accessibility/example-code.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<div> | ||
<nav role="navigation" aria-label="Pagination Navigation" class="au-pagination "> | ||
<ul class=" au-link-list au-link-list--inline"> | ||
<li class="au-pagination-control disabled "> | ||
<a href="#" class="au-pagination-link au-pagination-controls-link disabled js-focus-me " aria-label="Go to previous page" text="Previous" aria-disabled="true">Previous | ||
</a> | ||
</li> | ||
<li class="au-pagination-item active"> | ||
<a href="#" class="au-pagination-link active js-focus-me" id="1" aria-label="Page 1" aria-current="true">1 | ||
</a> | ||
</li> | ||
<li class="au-pagination-item "> | ||
<a href="#" class="au-pagination-link js-focus-me" id="2" aria-label="Page 2" aria-current="false">2 | ||
</a> | ||
</li> | ||
<li class="au-pagination-item "> | ||
<a href="#" class="au-pagination-link js-focus-me" id="3" aria-label="Page 3" aria-current="false">3 | ||
</a> | ||
</li> | ||
<li class="au-pagination-item"> | ||
<a class="au-pagination-link js-focus-me" href="#" aria-label=""> | ||
<span class="au-pagination-link--quick-jumper " aria-hidden="true">...</span> | ||
</a> | ||
</li> | ||
<li class="au-pagination-item "> | ||
<a href="#" class="au-pagination-link js-focus-me" id="10" aria-label="Page 10" aria-current="false">10 | ||
</a> | ||
</li> | ||
<li class="au-pagination-control"> | ||
<a href="#" class="au-pagination-link au-pagination-controls-link js-focus-me" aria-label="Go to next page" text="Next">Next | ||
</a> | ||
</li> | ||
</ul> | ||
</nav> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
layout: component/code-demo | ||
iframe: a11y-grayscale | ||
iframeFullwidth: true | ||
--- | ||
## Grayscale | ||
|
||
How the pagination is viewed with total colour blindness. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
layout: component/page | ||
pagetitle: Pagination accessibility | ||
|
||
header: | ||
- /_shared/header.md | ||
|
||
component_nav: | ||
- /components/_tabs.md | ||
|
||
sidebar: | ||
- /components/search.md | ||
- /components/sidebar.md | ||
|
||
main: | ||
- colorblind.md | ||
- grayscale.md | ||
- keyboard.md | ||
- screenreader.md | ||
|
||
footer: | ||
- /_shared/footer.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
layout: component/code-demo | ||
iframe: a11y-keyboard | ||
iframeFullwidth: true | ||
--- | ||
## Keyboard accessibility | ||
|
||
How keyboard navigation works with page alerts. |
15 changes: 15 additions & 0 deletions
15
content/components/pagination/accessibility/screenreader.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
layout: component/screenreader | ||
heading: Screen readers | ||
speak: | | ||
|
||
[Heading level 3] Alert title. | ||
|
||
Alert Content [link] link. | ||
|
||
--- | ||
|
||
|
||
How the page alerts demo is described by assistive technology. | ||
|
||
As read with macOS High Sierra VoiceOver. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
layout: component/page | ||
pagetitle: TODO rationale | ||
|
||
header: | ||
- /_shared/header.md | ||
|
||
component_nav: | ||
- /components/_tabs.md | ||
|
||
sidebar: | ||
- /components/search.md | ||
- /components/sidebar.md | ||
|
||
main: | ||
- react-usage.md | ||
- react-props.md | ||
- react-exports.md | ||
|
||
footer: | ||
- /_shared/footer.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
layout: section | ||
--- | ||
|
||
### Exports | ||
|
||
| Name | Type | Description | ||
|------------|---------|----------------------------------------------------------------------------- | ||
| `AUpagination` | default | The page alerts component | ||
|
||
### [md]node_modules import | ||
|
||
```jsx | ||
import AUpagination from '@gov.au/pagination'; | ||
``` | ||
|
||
### [md]pancake import | ||
|
||
```jsx | ||
import AUpagination from './pagination'; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
layout: section | ||
--- | ||
|
||
### Props | ||
|
||
| Prop name | Type | Description | ||
|----------------|--------------------------------------------------------------------------------------- | --- | | ||
| left | boolean | Align pagination to the left | ||
| right | boolean | Align pagination to the right | ||
| center | boolean | Align pagination to the center | ||
| totalResults | number | Total amount of items in Pagination list | ||
| recordsPerPage | number | Number of results that display per page | ||
|
||
All other props are spread into the component |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
layout: section | ||
--- | ||
|
||
## React Usage | ||
|
||
```jsx | ||
import AUpagination from '@gov.au/pagination'; | ||
|
||
<AUPagination totalResults={ 100 } recordsPerPage={ 10 } center onChange={ this.onChanged } /> | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,55 @@ | ||
We're currently discussing whether or not our community will benefit from a | ||
navigation component. Join the conversation in our | ||
[community forum](https://community.digital.gov.au/t/pagination/118). | ||
--- | ||
layout: component/code-demo | ||
iframe: examples/example-default | ||
iframeFullwidth: true | ||
code: | ||
- HTML: | | ||
|
||
<div> | ||
<nav role="navigation" aria-label="Pagination Navigation" class="au-pagination "> | ||
<ul class=" au-link-list au-link-list--inline"> | ||
<li class="au-pagination-control disabled "> | ||
<a href="#" class="au-pagination-link au-pagination-controls-link disabled " aria-label="Go to previous page" text="Previous" aria-disabled="true">Previous | ||
</a> | ||
</li> | ||
<li class="au-pagination-item active"> | ||
<a href="#" class="au-pagination-link active" id="1" aria-label="Page 1" aria-current="true">1 | ||
</a> | ||
</li> | ||
<li class="au-pagination-item "> | ||
<a href="#" class="au-pagination-link " id="2" aria-label="Page 2" aria-current="false">2 | ||
</a> | ||
</li> | ||
<li class="au-pagination-item "> | ||
<a href="#" class="au-pagination-link " id="3" aria-label="Page 3" aria-current="false">3 | ||
</a> | ||
</li> | ||
<li class="au-pagination-item"> | ||
<a class="au-pagination-link " href="#" aria-label=""> | ||
<span class="au-pagination-link--quick-jumper " aria-hidden="true">...</span> | ||
</a> | ||
</li> | ||
<li class="au-pagination-item "> | ||
<a href="#" class="au-pagination-link " id="10" aria-label="Page 10" aria-current="false">10 | ||
</a> | ||
</li> | ||
<li class="au-pagination-control"> | ||
<a href="#" class="au-pagination-link au-pagination-controls-link" aria-label="Go to next page" text="Next">Next | ||
</a> | ||
</li> | ||
</ul> | ||
</nav> | ||
</div> | ||
|
||
|
||
- React: | | ||
|
||
import AUpagination from '@gov.au/pagination'; | ||
|
||
<AUPagination totalResults={ 100 } recordsPerPage={ 10 } center onChange={ this.onChanged } /> | ||
|
||
|
||
--- | ||
## Default | ||
|
||
Pagination allows users to navigate through multiple pages of content. The first and last pagaination items are always visible to the user. Users can either select an individual page from the pagination list, or use the `Previous` and `Next` keys to navigate through the pagination items sequentially . The ellipsis can also be used to display ether the next 5 pages or the previous 5 pages in the list. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
layout: component/discussion-callout | ||
btntext: Community | ||
btnurl: https://community.digital.gov.au/t/ | ||
btntype: secondary | ||
--- | ||
|
||
Our components are a collaborative effort, we welcome constructive conversation and contribution. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
layout: component/discussion-callout | ||
btntext: GitHub | ||
btnurl: https://github.com/govau/design-system-components/tree/master/packages/ | ||
btntype: secondary | ||
--- | ||
|
||
Found an issue? Interested in contributing code? We'd love your feedback over at our GitHub repository. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
layout: component/page | ||
pagetitle: TODO discussion | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this have a TODO? |
||
|
||
header: | ||
- /_shared/header.md | ||
|
||
component_nav: | ||
- /components/_tabs.md | ||
|
||
sidebar: | ||
- /components/search.md | ||
- /components/sidebar.md | ||
|
||
main: | ||
- community-intro.md | ||
- github-intro.md | ||
|
||
footer: | ||
- /_shared/footer.md |
35 changes: 35 additions & 0 deletions
35
content/components/pagination/examples/example-default/example-code.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<div> | ||
<nav role="navigation" aria-label="Pagination Navigation" class="au-pagination "> | ||
<ul class=" au-link-list au-link-list--inline"> | ||
<li class="au-pagination-control disabled "> | ||
<a href="#" class="au-pagination-link au-pagination-controls-link disabled " aria-label="Go to previous page" text="Previous" aria-disabled="true">Previous | ||
</a> | ||
</li> | ||
<li class="au-pagination-item active"> | ||
<a href="#" class="au-pagination-link active" id="1" aria-label="Page 1" aria-current="true">1 | ||
</a> | ||
</li> | ||
<li class="au-pagination-item "> | ||
<a href="#" class="au-pagination-link " id="2" aria-label="Page 2" aria-current="false">2 | ||
</a> | ||
</li> | ||
<li class="au-pagination-item "> | ||
<a href="#" class="au-pagination-link " id="3" aria-label="Page 3" aria-current="false">3 | ||
</a> | ||
</li> | ||
<li class="au-pagination-item"> | ||
<a class="au-pagination-link " href="#" aria-label=""> | ||
<span class="au-pagination-link--quick-jumper " aria-hidden="true">...</span> | ||
</a> | ||
</li> | ||
<li class="au-pagination-item "> | ||
<a href="#" class="au-pagination-link " id="10" aria-label="Page 10" aria-current="false">10 | ||
</a> | ||
</li> | ||
<li class="au-pagination-control"> | ||
<a href="#" class="au-pagination-link au-pagination-controls-link" aria-label="Go to next page" text="Next">Next | ||
</a> | ||
</li> | ||
</ul> | ||
</nav> | ||
</div> |
4 changes: 4 additions & 0 deletions
4
content/components/pagination/examples/example-default/index.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
layout: example/page | ||
examples: | ||
- template: example-code.md | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
content/components/pagination/live/example-default/example-code.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<div> | ||
<nav role="navigation" aria-label="Pagination Navigation" class="au-pagination "> | ||
<ul class=" au-link-list au-link-list--inline"> | ||
<li class="au-pagination-control disabled "> | ||
<a href="#" class="au-pagination-link au-pagination-controls-link disabled " aria-label="Go to previous page" text="Previous" aria-disabled="true">Previous | ||
</a> | ||
</li> | ||
<li class="au-pagination-item active"> | ||
<a href="#" class="au-pagination-link active" id="1" aria-label="Page 1" aria-current="true">1 | ||
</a> | ||
</li> | ||
<li class="au-pagination-item "> | ||
<a href="#" class="au-pagination-link " id="2" aria-label="Page 2" aria-current="false">2 | ||
</a> | ||
</li> | ||
<li class="au-pagination-item "> | ||
<a href="#" class="au-pagination-link " id="3" aria-label="Page 3" aria-current="false">3 | ||
</a> | ||
</li> | ||
<li class="au-pagination-item"> | ||
<a class="au-pagination-link " href="#" aria-label=""> | ||
<span class="au-pagination-link--quick-jumper " aria-hidden="true">...</span> | ||
</a> | ||
</li> | ||
<li class="au-pagination-item "> | ||
<a href="#" class="au-pagination-link " id="10" aria-label="Page 10" aria-current="false">10 | ||
</a> | ||
</li> | ||
<li class="au-pagination-control"> | ||
<a href="#" class="au-pagination-link au-pagination-controls-link" aria-label="Go to next page" text="Next">Next | ||
</a> | ||
</li> | ||
</ul> | ||
</nav> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
layout: example/page | ||
examples: | ||
- template: example-code.md | ||
- template: example-dark.md | ||
style: dark |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
layout: example/page | ||
pagetitle: TODO live demo | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this have a TODO? |
||
examples: | ||
- template: ../accessibility/example-code.md | ||
livedemo: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
layout: component/rationale.js | ||
heading: First and last pagination items always visible | ||
--- | ||
|
||
By design the first and last items in the pagination list will always be visible where applicable. | ||
|
||
Showing the last item in the pagination list enables the end user to know the limit of the pagination and how many pages of results are present. Showing both the first and last items upfront provides the user with a quick way to navigate to either of these options with needing to use the `Previous` and `Next` keys. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this have a TODO?