forked from elastic/eui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert
EuiSwitch
conversions (elastic#2255)
* Revert "Convert `EuiSwitch` to TS (elastic#2243)" This reverts commit 39dbcf6. * Revert "Aligning switch semantics with aria role (elastic#2193)" This reverts commit 76e58de. * CL
- Loading branch information
1 parent
26c131a
commit dbfa8c5
Showing
14 changed files
with
263 additions
and
256 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
81 changes: 81 additions & 0 deletions
81
src/components/form/switch/__snapshots__/switch.test.js.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,81 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`EuiSwitch assigns automatically generated ID to label 1`] = ` | ||
<div | ||
class="euiSwitch" | ||
> | ||
<input | ||
class="euiSwitch__input" | ||
id="generated-id" | ||
type="checkbox" | ||
/> | ||
<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> | ||
</div> | ||
`; | ||
|
||
exports[`EuiSwitch is rendered 1`] = ` | ||
<div | ||
class="euiSwitch testClass1 testClass2" | ||
> | ||
<input | ||
aria-label="aria-label" | ||
class="euiSwitch__input" | ||
data-test-subj="test subject string" | ||
id="test" | ||
type="checkbox" | ||
/> | ||
<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> | ||
</div> | ||
`; |
97 changes: 0 additions & 97 deletions
97
src/components/form/switch/__snapshots__/switch.test.tsx.snap
This file was deleted.
Oops, something went wrong.
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,15 @@ | ||
import { CommonProps } from '../../common'; | ||
|
||
import { FunctionComponent, InputHTMLAttributes, ReactNode } from 'react'; | ||
|
||
declare module '@elastic/eui' { | ||
/** | ||
* @see './switch.js' | ||
*/ | ||
export type EuiSwitchProps = CommonProps & | ||
InputHTMLAttributes<HTMLInputElement> & { | ||
label?: ReactNode; | ||
}; | ||
|
||
export const EuiSwitch: FunctionComponent<EuiSwitchProps>; | ||
} |
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 @@ | ||
export { EuiSwitch } from './switch'; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.