-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(docs): updates pagination docs to new format (VIV-2120) #2176
Open
TaylorJ76
wants to merge
1
commit into
main
Choose a base branch
from
VIV-2120-docs-pagination
base: main
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
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
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
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,3 @@ | ||
## Resources | ||
|
||
- [Pagination: Manual accessibility test](https://docs.google.com/spreadsheets/d/19vZut40IcH_DSMQEd1v3Pryaj2zQy8Vi2-YNAGmig_0/edit?gid=1175911860#gid=1175911860) |
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,103 @@ | ||
## Labelling | ||
|
||
### Label | ||
|
||
<docs-do-dont> | ||
<docs-do slot="description" headline="Use the label attribute whenever possible" caption="It provides a description of the purpose of the Number Field to all users and it is accessibly linked to the input element."> | ||
|
||
```html preview example | ||
<vwc-number-field label="Wanted quantity"></vwc-number-field> | ||
``` | ||
|
||
</docs-do> | ||
<docs-do dont headline="Don't use the placeholder attribute as a label"> | ||
|
||
```html preview example | ||
<vwc-number-field placeholder="Wanted quantity"></vwc-number-field> | ||
``` | ||
|
||
It's bad for UX and accessibility.<br />[The problem with placeholders](https://www.deque.com/blog/accessible-forms-the-problem-with-placeholders/) | ||
|
||
</docs-do> | ||
</docs-do-dont> | ||
|
||
### Helper Text | ||
|
||
<docs-do-dont> | ||
<docs-do slot="description" headline="Use helper text to provide extra information about the field" caption="It is visible to the user at all times and it is read out by screen readers when the user focuses on the input element."> | ||
|
||
```html preview example | ||
<vwc-number-field | ||
label="Wanted quantity" | ||
helper-text="set a number higher than 1 less than 10" | ||
></vwc-number-field> | ||
``` | ||
|
||
</docs-do> | ||
</docs-do-dont> | ||
|
||
## Scale | ||
|
||
<docs-do-dont headline="Use condensed Number Fields when space is limited" reverse> | ||
|
||
<div slot="description"> | ||
|
||
The `condensed` Text Field is useful when used inside other components (inside [data-grid-cell](/components/data-grid/#cell) or [action-group](/components/action-group/) for a [toolbar](/components/button/use-cases/#toolbars)) as they take up less space. | ||
|
||
</div> | ||
<docs-do> | ||
|
||
```html preview example | ||
<div class="container"> | ||
<vwc-data-grid> | ||
<vwc-data-grid-row row-type="header"> | ||
<vwc-data-grid-cell cell-type="columnheader">User</vwc-data-grid-cell> | ||
<vwc-data-grid-cell | ||
class="controls" | ||
cell-type="columnheader" | ||
></vwc-data-grid-cell> | ||
</vwc-data-grid-row> | ||
<vwc-data-grid-row> | ||
<vwc-data-grid-cell> | ||
<vwc-number-field label="Wanted quantity"></vwc-number-field> | ||
</vwc-data-grid-cell> | ||
<vwc-data-grid-cell class="controls"> | ||
<vwc-button | ||
appearance="outlined" | ||
size="condensed" | ||
icon="edit-line" | ||
aria-label="Edit" | ||
></vwc-button> | ||
<vwc-button | ||
appearance="outlined" | ||
size="condensed" | ||
icon="delete-line" | ||
aria-label="Delete" | ||
connotation="alert" | ||
></vwc-button> | ||
</vwc-data-grid-cell> | ||
</vwc-data-grid-row> | ||
</vwc-data-grid> | ||
</div> | ||
|
||
<style> | ||
.conainer { | ||
display: block; | ||
padding: 8px 0; | ||
} | ||
|
||
.controls { | ||
width: 5.75rem; | ||
} | ||
</style> | ||
``` | ||
|
||
</docs-do> | ||
</docs-do-dont> | ||
|
||
## Related Components | ||
|
||
- [Text Area](/components/text-area/) | ||
- [Text Field](/components/text-field) | ||
- [Combobox](/components/combobox/) | ||
- [Searchable Select](/components/searchable-select/) |
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
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,14 @@ | ||
## With border | ||
|
||
```html preview | ||
<vwc-pagination class="outlined" total="10" shape="pill"></vwc-pagination> | ||
|
||
<style> | ||
.outlined { | ||
border: 1px solid var(--vvd-color-neutral-400); | ||
padding: 6px; | ||
border-radius: 24px; | ||
display: inline-block; | ||
} | ||
</style> | ||
``` |
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,49 @@ | ||
## Total | ||
|
||
The `total` attribute sets the total amount of pages. If set to `0` (it's default value) both 'Previous' and 'Next' links will be disabled. | ||
|
||
```html preview | ||
<vwc-pagination total="20"></vwc-pagination> | ||
``` | ||
|
||
## Selected Index | ||
|
||
The `selected-index` attribute sets the currently selected page. | ||
|
||
Note that the value is zero-indexed. It is set to `-1` if total pages is `0`. | ||
|
||
```html preview | ||
<vwc-pagination total="20" selected-index="5"></vwc-pagination> | ||
``` | ||
|
||
## Size | ||
|
||
The `size` attribute sets the pagination's buttons sizes. | ||
|
||
```html preview | ||
<p>super-condensed (default)</p> | ||
<vwc-pagination size="super-condensed" total="20"></vwc-pagination> | ||
<p>condensed</p> | ||
<vwc-pagination size="condensed" total="20"></vwc-pagination> | ||
<p>normal</p> | ||
<vwc-pagination size="normal" total="20"></vwc-pagination> | ||
``` | ||
|
||
## Shape | ||
|
||
The `shape` attribute sets the pagination's buttons shapes. | ||
|
||
```html preview | ||
<p>rounded (default)</p> | ||
<vwc-pagination shape="rounded" total="20"></vwc-pagination> | ||
<p>pill</p> | ||
<vwc-pagination shape="pill" total="20"></vwc-pagination> | ||
``` | ||
|
||
## Nav Icons | ||
|
||
The `nav-icons` attribute changes the pagination's "Previous" and "Next" buttons to be chevron icons. | ||
|
||
```html preview | ||
<vwc-pagination total="20" nav-icons selected-index="2"></vwc-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
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.
this can be an info note :)