-
Notifications
You must be signed in to change notification settings - Fork 842
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reintroduce
EuiSwitch
a11y changes (#2491)
* Convert `EuiSwitch` to TS (#2243) * convert euiswitch to ts * remove test file * euiswitchevent; store id in state * change interface to type * CL * type for button * showLabel=false example * fix misc docs proptype warnings * reintroduce compressed and mini styles * another example * CL * cleanup * use p with aria-describedby * add click hanlder to p-label
- Loading branch information
1 parent
d9508fd
commit cbf9c4f
Showing
20 changed files
with
339 additions
and
301 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
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
81 changes: 0 additions & 81 deletions
81
src/components/form/switch/__snapshots__/switch.test.js.snap
This file was deleted.
Oops, something went wrong.
101 changes: 101 additions & 0 deletions
101
src/components/form/switch/__snapshots__/switch.test.tsx.snap
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,101 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`EuiSwitch assigns automatically generated ID to label 1`] = ` | ||
<div | ||
class="euiSwitch" | ||
> | ||
<button | ||
aria-checked="false" | ||
aria-describedby="generated-id" | ||
class="euiSwitch__button" | ||
id="generated-id" | ||
role="switch" | ||
type="button" | ||
> | ||
<span | ||
class="euiSwitch__body" | ||
> | ||
<span | ||
class="euiSwitch__thumb" | ||
/> | ||
<span | ||
class="euiSwitch__track" | ||
> | ||
<svg | ||
class="euiIcon euiIcon--medium euiIcon-isLoading euiSwitch__icon" | ||
focusable="false" | ||
height="16" | ||
viewBox="0 0 16 16" | ||
width="16" | ||
xmlns="http://www.w3.org/2000/svg" | ||
/> | ||
<svg | ||
class="euiIcon euiIcon--medium euiIcon-isLoading euiSwitch__icon euiSwitch__icon--checked" | ||
focusable="false" | ||
height="16" | ||
viewBox="0 0 16 16" | ||
width="16" | ||
xmlns="http://www.w3.org/2000/svg" | ||
/> | ||
</span> | ||
</span> | ||
</button> | ||
<p | ||
class="euiSwitch__label" | ||
id="generated-id" | ||
> | ||
Label | ||
</p> | ||
</div> | ||
`; | ||
|
||
exports[`EuiSwitch is rendered 1`] = ` | ||
<div | ||
class="euiSwitch testClass1 testClass2" | ||
> | ||
<button | ||
aria-checked="false" | ||
aria-describedby="generated-id" | ||
aria-label="aria-label" | ||
class="euiSwitch__button" | ||
data-test-subj="test subject string" | ||
id="test" | ||
role="switch" | ||
type="button" | ||
> | ||
<span | ||
class="euiSwitch__body" | ||
> | ||
<span | ||
class="euiSwitch__thumb" | ||
/> | ||
<span | ||
class="euiSwitch__track" | ||
> | ||
<svg | ||
class="euiIcon euiIcon--medium euiIcon-isLoading euiSwitch__icon" | ||
focusable="false" | ||
height="16" | ||
viewBox="0 0 16 16" | ||
width="16" | ||
xmlns="http://www.w3.org/2000/svg" | ||
/> | ||
<svg | ||
class="euiIcon euiIcon--medium euiIcon-isLoading euiSwitch__icon euiSwitch__icon--checked" | ||
focusable="false" | ||
height="16" | ||
viewBox="0 0 16 16" | ||
width="16" | ||
xmlns="http://www.w3.org/2000/svg" | ||
/> | ||
</span> | ||
</span> | ||
</button> | ||
<p | ||
class="euiSwitch__label" | ||
id="generated-id" | ||
> | ||
Label | ||
</p> | ||
</div> | ||
`; |
Oops, something went wrong.