-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CJL-46 add aria and keyboard support to accordion components
CJL-46 add aria and keyboard support to MultiSelect - refactor to use Checkbox - add classnames dependency - add generateUID util CJL-46 use unique id and classnames for accordion items CJL-46 refactor pagination using classnames CJL-46 refactor pagination for aria and keyboard accessibility CJL-46 check if first/last before changing page fixes keyboard page changes CJL-46 add aria and keyboard accessibility to avatar menu CJL-46 update Tag component - add size, optionLabel and onOptionClick props - use onOptionClick to distinguish click on button vs the tag - use optionLabel for aria label - use size prop and append to classname (was limited to just ‘sm’ before) - remove small prop - use classnames - update Tag readme with props and example CJL-46 use Tag component in SearchMultiSelect, refactor using classnames CJL-46 add aria label to pagination buttons since text is hidden CJL-46 add prop classname to accordions CJL-46 refactor Accordion using classnames CJL-46 fix nested accordion story CJL-46 update eslint to warn for unused variables CJL-46 correct default tag size in story CJL-46 use class to fix vertical align instead on inline style in Pagination CJL-46 add classname to root class in MultiSelect CJL-46 add option label to Tag story CJL-46 add constants for charCodes CJL-46 add notes about keyboard accessibility in readme
- Loading branch information
1 parent
7a69ca3
commit 662554c
Showing
17 changed files
with
547 additions
and
295 deletions.
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 |
---|---|---|
@@ -1 +1,27 @@ | ||
The `<Tag>` component is used to indicate active or selected items, filters or options. Refer to [this](http://design-prototypes.gumgum.com/black-tie/documentation/#icons-btl) page for icon names. | ||
|
||
**Example**: | ||
|
||
```jsx | ||
<Tag | ||
context="primary" | ||
hasOption | ||
onOptionClick={() => {}} | ||
optionIcon="bt-times" | ||
size="sm" | ||
text="Sample Tag" | ||
/> | ||
``` | ||
|
||
| **prop name** | **description** | | ||
| ------------- | ----------------------------------------------------------------------------------------------------------------------- | | ||
| className | Class to add to the root element {string} {required} | | ||
| context | Any of \`normal, primary, success, warning, danger\` or leave unset to get default appearance {string} {defaults to ''} | | ||
| hasOption | Indicate if the tag has an option button {boolean} {defaults to false} | | ||
| onClick | Click handler for the root element {function} | | ||
| onOptionClick | Click handler for the option button element {function} | | ||
| optionIcon | Icon name for the option button {string} {defaults to 'bt-times'} | | ||
| optionLabel | Aria label for the option button {string} {defaults to 'Remove tag'} | | ||
| size | Any of \`sm, xs\` {string} | | ||
| style | Styles to add to the root element {object} | | ||
| text | Tag display text {string} | |
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 |
---|---|---|
@@ -1,42 +1,45 @@ | ||
The `<Accordion>` component is a collapsible container for holding related elements. Nest `<AccordionItem>` components inside `<Accordion>` for each drawer. Nest `<AccordionItemContent>` in each `<AccordionItem>` if you would like to display listed information within an open `<AccordionItem>`. Each `<Accordion>` related component accepts a className and otherProps so you are able to further customize the component. | ||
|
||
*Accordion example*: | ||
_Accordion example_: | ||
|
||
You can use `<Accordion>` to display any information that you pass in, such as: | ||
|
||
``` | ||
<Accordion> | ||
<AccordionItem label="Controls"> | ||
<FormGroup> | ||
<FormGroupLabel text="Name" /> | ||
<TextInput name="name" /> | ||
</FormGroup> | ||
<FormGroup> | ||
<FormGroupLabel text="Name" /> | ||
<TextInput name="name" /> | ||
</FormGroup> | ||
</AccordionItem> | ||
</Accordion> | ||
``` | ||
|
||
|
||
You can also use `<Accordion>` to display information in a list form, in the case you want to list items in rows. Example: | ||
|
||
``` | ||
<Accordion> | ||
<AccordionItem label="Settings"> | ||
<AccordionItemContent> | ||
<Column md="6"> | ||
Setting 1 | ||
</Column> | ||
<Column md=6> | ||
<Button>Save</Button> | ||
</Column> | ||
<Column md="6"> | ||
Setting 1 | ||
</Column> | ||
<Column md=6> | ||
<Button>Save</Button> | ||
</Column> | ||
</AccordionItemContent> | ||
<AccordionItemContent> | ||
<Column md="6"> | ||
Setting 2 | ||
</Column> | ||
<Column md=6> | ||
<Button>Save</Button> | ||
</Column> | ||
<Column md="6"> | ||
Setting 2 | ||
</Column> | ||
<Column md=6> | ||
<Button>Save</Button> | ||
</Column> | ||
</AccordionItemContent> | ||
</AccordionItem> | ||
</Accordion> | ||
``` | ||
|
||
**Keyboard Accessibility:** | ||
|
||
When an accordion is in focus you can toggle it expanded/collapsed with the spacebar or enter keys. |
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
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
Oops, something went wrong.