Skip to content

Commit

Permalink
[Emotion] Convert EuiCheckbox, EuiRadio, and EuiSwitch (#7969)
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen authored Aug 19, 2024
1 parent 15904be commit e66230a
Show file tree
Hide file tree
Showing 58 changed files with 1,529 additions and 1,260 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions packages/eui/changelogs/upcoming/7969.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
**CSS-in-JS conversions**

- Converted `EuiCheckbox` to Emotion
- Converted `EuiRadio` to Emotion
- Converted `EuiSwitch` to Emotion
- Removed the following Sass variables:
- `$euiFormCustomControlDisabledIconColor`
- `$euiFormCustomControlBorderColor`
- `$euiRadioSize`
- `$euiCheckBoxSize`
- `$euiCheckboxBorderRadius`
- `$euiSwitchHeight` (and compressed/mini variants)
- `$euiSwitchWidth` (and compressed/mini variants)
- `$euiSwitchThumbSize` (and compressed/mini variants)
- `$euiSwitchIconHeight`
- `$euiSwitchOffColor`
- Removed the following Sass mixins:
- `euiIconBackground`
- `euiCustomControl`
- `euiCustomControlSelected`
- `euiCustomControlDisabled`
- `euiCustomControlFocused`
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, Fragment } from 'react';
import React, { useState } from 'react';

import { EuiCheckbox, EuiSpacer } from '../../../../src/components';

Expand Down Expand Up @@ -26,7 +26,7 @@ export default () => {
};

return (
<Fragment>
<>
<EuiCheckbox
id={basicCheckboxId}
label="I am a checkbox"
Expand Down Expand Up @@ -59,9 +59,9 @@ export default () => {
id={compressedCheckboxId}
label="I am a readonly checkbox"
checked={checked}
onChange={(e) => onChange(e)}
onChange={() => {}}
readOnly
/>
</Fragment>
</>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -145,19 +145,24 @@ exports[`EuiBasicTable renders (kitchen sink) with pagination, selection, sortin
class="euiTableCellContent"
>
<div
class="euiCheckbox euiCheckbox--noLabel emotion-euiCheckbox"
class="euiCheckbox emotion-euiCheckbox"
>
<input
aria-label="Select all rows"
class="euiCheckbox__input"
data-test-subj="checkboxSelectAll"
id="_selection_column-checkbox_generated-id"
title="Select all rows"
type="checkbox"
/>
<div
class="euiCheckbox__square"
/>
class="euiCheckbox__square emotion-euiCheckbox__square-unselected"
>
<span
class="emotion-euiCheckbox__icon-check"
data-euiicon-type="empty"
/>
<input
aria-label="Select all rows"
class="euiCheckbox__input emotion-euiCheckbox__input"
data-test-subj="checkboxSelectAll"
id="_selection_column-checkbox_generated-id"
title="Select all rows"
type="checkbox"
/>
</div>
</div>
</div>
</th>
Expand Down Expand Up @@ -269,19 +274,24 @@ exports[`EuiBasicTable renders (kitchen sink) with pagination, selection, sortin
class="euiTableCellContent"
>
<div
class="euiCheckbox euiCheckbox--noLabel emotion-euiCheckbox"
class="euiCheckbox emotion-euiCheckbox"
>
<input
aria-label="Select row 1"
class="euiCheckbox__input"
data-test-subj="checkboxSelectRow-1"
id="__table_generated-id_selection_column_1-checkbox"
title="Select row 1"
type="checkbox"
/>
<div
class="euiCheckbox__square"
/>
class="euiCheckbox__square emotion-euiCheckbox__square-unselected"
>
<span
class="emotion-euiCheckbox__icon-check"
data-euiicon-type="empty"
/>
<input
aria-label="Select row 1"
class="euiCheckbox__input emotion-euiCheckbox__input"
data-test-subj="checkboxSelectRow-1"
id="__table_generated-id_selection_column_1-checkbox"
title="Select row 1"
type="checkbox"
/>
</div>
</div>
</div>
</td>
Expand Down Expand Up @@ -375,19 +385,24 @@ exports[`EuiBasicTable renders (kitchen sink) with pagination, selection, sortin
class="euiTableCellContent"
>
<div
class="euiCheckbox euiCheckbox--noLabel emotion-euiCheckbox"
class="euiCheckbox emotion-euiCheckbox"
>
<input
aria-label="Select row 2"
class="euiCheckbox__input"
data-test-subj="checkboxSelectRow-2"
id="__table_generated-id_selection_column_2-checkbox"
title="Select row 2"
type="checkbox"
/>
<div
class="euiCheckbox__square"
/>
class="euiCheckbox__square emotion-euiCheckbox__square-unselected"
>
<span
class="emotion-euiCheckbox__icon-check"
data-euiicon-type="empty"
/>
<input
aria-label="Select row 2"
class="euiCheckbox__input emotion-euiCheckbox__input"
data-test-subj="checkboxSelectRow-2"
id="__table_generated-id_selection_column_2-checkbox"
title="Select row 2"
type="checkbox"
/>
</div>
</div>
</div>
</td>
Expand Down Expand Up @@ -481,19 +496,24 @@ exports[`EuiBasicTable renders (kitchen sink) with pagination, selection, sortin
class="euiTableCellContent"
>
<div
class="euiCheckbox euiCheckbox--noLabel emotion-euiCheckbox"
class="euiCheckbox emotion-euiCheckbox"
>
<input
aria-label="Select row 3"
class="euiCheckbox__input"
data-test-subj="checkboxSelectRow-3"
id="__table_generated-id_selection_column_3-checkbox"
title="Select row 3"
type="checkbox"
/>
<div
class="euiCheckbox__square"
/>
class="euiCheckbox__square emotion-euiCheckbox__square-unselected"
>
<span
class="emotion-euiCheckbox__icon-check"
data-euiicon-type="empty"
/>
<input
aria-label="Select row 3"
class="euiCheckbox__input emotion-euiCheckbox__input"
data-test-subj="checkboxSelectRow-3"
id="__table_generated-id_selection_column_3-checkbox"
title="Select row 3"
type="checkbox"
/>
</div>
</div>
</div>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,24 @@ exports[`EuiInMemoryTable behavior mobile header 1`] = `
<div
class="euiCheckbox emotion-euiCheckbox"
>
<input
aria-label="Select all rows"
class="euiCheckbox__input"
data-test-subj="checkboxSelectAll"
id="_selection_column-checkbox_generated-id"
title="Select all rows"
type="checkbox"
/>
<div
class="euiCheckbox__square"
/>
class="euiCheckbox__square emotion-euiCheckbox__square-unselected"
>
<span
class="emotion-euiCheckbox__icon-check"
data-euiicon-type="empty"
/>
<input
aria-label="Select all rows"
class="euiCheckbox__input emotion-euiCheckbox__input"
data-test-subj="checkboxSelectAll"
id="_selection_column-checkbox_generated-id"
title="Select all rows"
type="checkbox"
/>
</div>
<label
class="euiCheckbox__label"
class="euiCheckbox__label emotion-euiCheckbox__label"
for="_selection_column-checkbox_generated-id"
>
Select all rows
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,23 @@ exports[`EuiCheckableCard is rendered 1`] = `
>
<div
aria-label="aria-label"
class="euiRadio euiRadio--noLabel"
class="euiRadio emotion-euiRadio"
data-test-subj="test subject string"
>
<input
class="euiRadio__input"
id="id"
type="radio"
value=""
/>
<div
class="euiRadio__circle"
/>
class="euiRadio__circle emotion-euiRadio__circle-unselected"
>
<span
class="emotion-euiRadio__icon"
data-euiicon-type="dot"
/>
<input
class="euiRadio__input emotion-euiRadio__input"
id="id"
type="radio"
value=""
/>
</div>
</div>
</div>
<div
Expand All @@ -44,18 +49,23 @@ exports[`EuiCheckableCard renders a checkbox when specified 1`] = `
class="euiPanel euiPanel--subdued euiPanel--paddingMedium euiSplitPanel__inner emotion-euiPanel-none-m-subdued-isClickable-euiSplitPanelInner"
>
<div
class="euiCheckbox euiCheckbox--noLabel emotion-euiCheckbox"
class="euiCheckbox emotion-euiCheckbox"
>
<input
aria-label="aria-label"
class="euiCheckbox__input"
data-test-subj="test subject string"
id="id"
type="checkbox"
/>
<div
class="euiCheckbox__square"
/>
class="euiCheckbox__square emotion-euiCheckbox__square-unselected"
>
<span
class="emotion-euiCheckbox__icon-check"
data-euiicon-type="empty"
/>
<input
aria-label="aria-label"
class="euiCheckbox__input emotion-euiCheckbox__input"
data-test-subj="test subject string"
id="id"
type="checkbox"
/>
</div>
</div>
</div>
<div
Expand All @@ -79,17 +89,22 @@ exports[`EuiCheckableCard renders children 1`] = `
class="euiPanel euiPanel--subdued euiPanel--paddingMedium euiSplitPanel__inner emotion-euiPanel-none-m-subdued-isClickable-euiSplitPanelInner"
>
<div
class="euiRadio euiRadio--noLabel"
class="euiRadio emotion-euiRadio"
>
<input
class="euiRadio__input"
id="id"
type="radio"
value=""
/>
<div
class="euiRadio__circle"
/>
class="euiRadio__circle emotion-euiRadio__circle-unselected"
>
<span
class="emotion-euiRadio__icon"
data-euiicon-type="dot"
/>
<input
class="euiRadio__input emotion-euiRadio__input"
id="id"
type="radio"
value=""
/>
</div>
</div>
</div>
<div
Expand Down Expand Up @@ -120,18 +135,23 @@ exports[`EuiCheckableCard renders disabled 1`] = `
class="euiPanel euiPanel--subdued euiPanel--paddingMedium euiSplitPanel__inner emotion-euiPanel-none-m-subdued-euiSplitPanelInner"
>
<div
class="euiRadio euiRadio--noLabel"
class="euiRadio emotion-euiRadio"
>
<input
class="euiRadio__input"
disabled=""
id="id"
type="radio"
value=""
/>
<div
class="euiRadio__circle"
/>
class="euiRadio__circle emotion-euiRadio__circle-disabled-unselected"
>
<span
class="emotion-euiRadio__icon"
data-euiicon-type="dot"
/>
<input
class="euiRadio__input emotion-euiRadio__input"
disabled=""
id="id"
type="radio"
value=""
/>
</div>
</div>
</div>
<div
Expand All @@ -155,17 +175,22 @@ exports[`EuiCheckableCard renders panel props 1`] = `
class="euiPanel euiPanel--subdued euiPanel--paddingMedium euiSplitPanel__inner emotion-euiPanel-none-m-subdued-isClickable-euiSplitPanelInner"
>
<div
class="euiRadio euiRadio--noLabel"
class="euiRadio emotion-euiRadio"
>
<input
class="euiRadio__input"
id="id"
type="radio"
value=""
/>
<div
class="euiRadio__circle"
/>
class="euiRadio__circle emotion-euiRadio__circle-unselected"
>
<span
class="emotion-euiRadio__icon"
data-euiicon-type="dot"
/>
<input
class="euiRadio__input emotion-euiRadio__input"
id="id"
type="radio"
value=""
/>
</div>
</div>
</div>
<div
Expand Down
Loading

0 comments on commit e66230a

Please sign in to comment.