Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Emotion] Convert EuiCheckbox, EuiRadio, and EuiSwitch #7969

Merged
merged 23 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
701ba82
Convert form style variables to its own utility function
cee-chen Aug 18, 2024
c4e6bc8
Replace `@mixin euiIconBackground` inline CSS SVGs with `<EuiIcon />`
cee-chen Aug 18, 2024
e676ad9
Convert custom control mixins/styles
cee-chen Aug 18, 2024
6ff66df
Remove unnecessary `euiCustomControl` usage in EuiRange
cee-chen Aug 18, 2024
c716b95
[EuiRadio] Convert to use new form util
cee-chen Aug 18, 2024
7974fc0
[EuiCheckbox] Convert base styles
cee-chen Aug 18, 2024
a64bbf4
[EuiCheckbox] Convert readOnly styles
cee-chen Aug 18, 2024
7dd90d8
Update downstream snapshots
cee-chen Aug 18, 2024
f25d657
[EuiSwitch] Set up style variables + `mini` size
cee-chen Aug 18, 2024
75b586e
[EuiSwitch] Convert wrapper/label styles
cee-chen Aug 18, 2024
02ce820
[EuiSwitch] Convert button (height/width) and body (bg color) styles
cee-chen Aug 18, 2024
20ee48a
[opinionated] extra disabled light mode tweaking
cee-chen Aug 18, 2024
eaea656
[EuiSwitch] Convert thumb styles
cee-chen Aug 18, 2024
db328c0
Restore thumb transition/animation movement
cee-chen Aug 18, 2024
2fb2811
[EuiSwitch] Convert check/cross icon styles
cee-chen Aug 18, 2024
1aa72ab
[EuiSwitch] Update snapshots & screenshots
cee-chen Aug 18, 2024
3df9000
[EuiSwitch] Update downstream snapshots/usages
cee-chen Aug 18, 2024
c48491f
Delete Sass files
cee-chen Aug 18, 2024
3d407a7
[TEMP] Comment out Sass var usage
cee-chen Aug 18, 2024
0795d3e
changelog
cee-chen Aug 18, 2024
5abd42a
[PR feedback] Fix focus outline for webkit browsers
cee-chen Aug 19, 2024
7cbbbb1
[PR feedback] Fix extra inline strut height on EuiSwitches
cee-chen Aug 19, 2024
cd8b659
Merge branch 'main' into emotion/custom-controls
cee-chen Aug 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading