feat: Accessibility improvements (#7224)

* feat: adds a11y for ContentType & Responses region

* feat: adds a11y to expandable/collapsible elements

* fix: add aria label to select element for content types

* fix: add aria label prop to contentType component

* Change optag to h3 for better tag hierarchy


Co-authored-by: ediiotero <eddie.otero@oddball.io>
Co-authored-by: Mike Lumetta <mike.lumetta@adhocteam.us>
Co-authored-by: Alexander Valencia <alex.valencia@adhocteam.us>
This commit is contained in:
Giles Wells
2021-05-12 12:40:31 -04:00
committed by GitHub
parent 8872d0e2ed
commit 72811bd827
12 changed files with 96 additions and 55 deletions

View File

@@ -0,0 +1,10 @@
/**
* Replace invalid characters from a string to create an html-ready ID
*
* @param {string} id A string that may contain invalid characters for the HTML ID attribute
* @param {string} [replacement=_] The string to replace invalid characters with; "_" by default
* @return {string} Information about the parameter schema
*/
export default function createHtmlReadyId(id, replacement = "_") {
return id.replace(/[^\w-]/g, replacement)
}