This repository has been archived by the owner on Mar 31, 2024. It is now read-only.
forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UI Framework] Improve accessibility issues in the UI framework (elas…
…tic#14073) * Use proper labels in bar example * Make aria-label on icon buttons mandatory * Add role=group to KuiButtonGroup * Add roles to card component * Fix alphabetical ordering in menu * Add accessibility example for KuiCollapseButton * Improve accessibility of Event examples * Add note about labeling to Form docs * Update broken snapshots * Fix icon in HeaderBar example * Add default aria-label to InfoButton if not specified * Fix wrong HTML entities * Fix icon names in Event example * Add icon labels in InfoPanel example * Improve accessibility of Micro and MenuButton examples * Add labels to StatusText example * Apply proper ARIA roles for tabs * Make ToggleButton example accessible * Fix icon names in events sandbox * Also allow aria-labelledby for icon buttons * Fix spelling of collapsible * Make statement about labels more clear * Use proper Link element for linking * Use propTypes to check for icon only buttons * Use defaultProps in KuiInfoButton
- Loading branch information
Showing
52 changed files
with
244 additions
and
46 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
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
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
47 changes: 47 additions & 0 deletions
47
ui_framework/doc_site/src/views/collapse_button/collapse_button_aria.js
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,47 @@ | ||
import React, { Component } from 'react'; | ||
|
||
import { | ||
KuiCollapseButton | ||
} from '../../../../components'; | ||
|
||
import { htmlIdGenerator } from '../../../../services'; | ||
|
||
export default class extends Component { | ||
|
||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
isExpanded: false | ||
}; | ||
} | ||
|
||
onToggleContent = (ev) => { | ||
ev.preventDefault(); | ||
this.setState((state) => ({ | ||
isExpanded: !state.isExpanded | ||
})); | ||
} | ||
|
||
render() { | ||
const { isExpanded } = this.state; | ||
const idGen = htmlIdGenerator(); | ||
return ( | ||
<div> | ||
<KuiCollapseButton | ||
onClick={this.onToggleContent} | ||
direction={isExpanded ? 'down' : 'up'} | ||
aria-label="Toggle panel" | ||
aria-expanded={isExpanded} | ||
aria-controls={idGen('collapsible')} | ||
/> | ||
<div | ||
id={idGen('collapsible')} | ||
style={{ display: isExpanded ? 'block' : 'none' }} | ||
> | ||
Here is some collapsible content. | ||
</div> | ||
</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
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
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
6 changes: 5 additions & 1 deletion
6
ui_framework/doc_site/src/views/info_panel/info_panel_error.html
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
6 changes: 5 additions & 1 deletion
6
ui_framework/doc_site/src/views/info_panel/info_panel_info.html
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
6 changes: 5 additions & 1 deletion
6
ui_framework/doc_site/src/views/info_panel/info_panel_success.html
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
6 changes: 5 additions & 1 deletion
6
ui_framework/doc_site/src/views/info_panel/info_panel_warning.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<button class="kuiMicroButton" title="Edit"> | ||
<button class="kuiMicroButton" title="Edit" aria-label="Edit"> | ||
<span class="kuiIcon fa-gear"></span> | ||
</button> |
4 changes: 2 additions & 2 deletions
4
ui_framework/doc_site/src/views/micro_button/micro_button_elements.html
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,9 +1,9 @@ | ||
<button class="kuiMicroButton" title="Edit"> | ||
<button class="kuiMicroButton" title="Edit" aria-label="Edit"> | ||
<span class="kuiIcon fa-gear"></span> | ||
</button> | ||
|
||
| ||
|
||
<a href="#" class="kuiMicroButton" title="View"> | ||
<a href="#" class="kuiMicroButton" title="View" aria-label="View"> | ||
<span class="kuiIcon fa-eye"></span> | ||
</a> |
Oops, something went wrong.