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 EuiFormControlLayoutDelimited (2/3) #7957

Merged
merged 21 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
39c8497
[docs] Clean up EuiFormControlLayoutDelimited example
cee-chen Aug 9, 2024
18d507f
DRY out repeated border/border-radius styles by adding new prop
cee-chen Aug 11, 2024
5dfc86c
Set up basic delimited styles
cee-chen Aug 11, 2024
3eab24a
Allowing passing styles directly to `.euiFormControlLayout__childrenW…
cee-chen Aug 11, 2024
f41ff68
Set up invalid styles
cee-chen Aug 11, 2024
43edc3e
Replace fullWidth CSS with React context
cee-chen Aug 11, 2024
800ab9b
Convert delimiter styles to Emotion
cee-chen Aug 11, 2024
dfe0d36
Convert `.euiFormControlLayoutDelimited__input` styles
cee-chen Aug 11, 2024
2091371
Delete Sass files
cee-chen Aug 11, 2024
8631903
[EuiDatePicker] Fix styles that were relying on direct usage of `.eui…
cee-chen Aug 11, 2024
7ae705a
[EuiDatePickerRange] Fix regressed disabled background styles
cee-chen Aug 11, 2024
92ff1ef
[EuiSuperDatePicker] Fix quick select only styling + remove now-unnec…
cee-chen Aug 11, 2024
25e35da
[EuiDualRange] Fix broken CSS selector
cee-chen Aug 11, 2024
4903635
[VRT] Update screenshots and add new permutations story
cee-chen Aug 11, 2024
fc74c1c
[tests] `shouldRenderCustomStyles`
cee-chen Aug 11, 2024
6bd72d5
Enhance `cloneElementWithCss` to allow prepending cloned CSS as oppos…
cee-chen Aug 12, 2024
25e2db7
changelog
cee-chen Aug 12, 2024
7424d0d
Tweak EuiFieldNumber's browser stepper UI to follow EUI's color mode
cee-chen Aug 13, 2024
78c1c29
[PR feedback] Tweak delimited playground to pass invalid/disabled/rea…
cee-chen Aug 13, 2024
f2d8e9f
More CSS tweaks
cee-chen Aug 13, 2024
4216c21
Fix border-radius regression/lapse
cee-chen Aug 13, 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[adding here for loose connection]

I notice that borders of append/prepend don't align correctly with the form control wrapper anymore. Is that expected?

Screenshot 2024-08-13 at 09 41 48

Screen.Recording.2024-08-13.at.09.43.45.mov

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😭 Thanks for pointing this out!

Copy link
Contributor Author

@cee-chen cee-chen Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fixed now in 4216c21
(edit: force pushed, forgot to update VRT)

mgadewoll marked this conversation as resolved.
Show resolved Hide resolved
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.
9 changes: 9 additions & 0 deletions packages/eui/changelogs/upcoming/7957.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
**Bug fixes**

- Fixed a visual bug with `<EuiDualRange showInput="inputWithPopover" />` form controls

**CSS-in-JS conversions**

- Converted `EuiFormLayoutDelimited` to Emotion
- Fixed `cloneElementWithCss` throwing an error when used multiple times without a `key` prop
- Updated `cloneElementWithCss` utility to support a third argument that allows prepending vs. appending the cloned Emotion css className
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ export default () => (
fullWidth
startControl={
<EuiFieldNumber
controlOnly
placeholder="0"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
endControl={
<EuiFieldNumber
controlOnly
placeholder="100"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
Expand All @@ -36,15 +36,15 @@ export default () => (
<EuiFormControlLayoutDelimited
startControl={
<EuiFieldNumber
controlOnly
placeholder="0"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
endControl={
<EuiFieldNumber
controlOnly
placeholder="100"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
Expand All @@ -54,15 +54,15 @@ export default () => (
append={<EuiFormLabel>px</EuiFormLabel>}
startControl={
<EuiFieldNumber
controlOnly
placeholder="0"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
endControl={
<EuiFieldNumber
controlOnly
placeholder="100"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
Expand All @@ -73,14 +73,14 @@ export default () => (
startControl={
<EuiFieldNumber
placeholder="0"
className="euiFieldNumber"
controlOnly
aria-label="Use aria labels when no actual label is in use"
/>
}
endControl={
<EuiFieldNumber
controlOnly
placeholder="100"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
Expand All @@ -91,15 +91,15 @@ export default () => (
isLoading
startControl={
<EuiFieldNumber
controlOnly
placeholder="0"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
endControl={
<EuiFieldNumber
controlOnly
placeholder="100"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
Expand All @@ -109,15 +109,15 @@ export default () => (
isLoading
startControl={
<EuiFieldNumber
controlOnly
placeholder="0"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
endControl={
<EuiFieldNumber
controlOnly
placeholder="100"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
Expand All @@ -127,15 +127,15 @@ export default () => (
compressed
startControl={
<EuiFieldNumber
controlOnly
placeholder="0"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
endControl={
<EuiFieldNumber
controlOnly
placeholder="100"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
Expand All @@ -145,16 +145,16 @@ export default () => (
prepend={<EuiFormLabel>Add</EuiFormLabel>}
startControl={
<EuiFieldNumber
controlOnly
placeholder="0"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
delimiter="+"
endControl={
<EuiFieldNumber
controlOnly
placeholder="100"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
Expand All @@ -164,16 +164,16 @@ export default () => (
prepend={<EuiFormLabel>Merge</EuiFormLabel>}
startControl={
<EuiFieldNumber
controlOnly
placeholder="0"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
delimiter={<EuiIcon type="merge" />}
endControl={
<EuiFieldNumber
controlOnly
placeholder="100"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
Expand All @@ -184,16 +184,16 @@ export default () => (
prepend={<EuiFormLabel>Read only</EuiFormLabel>}
startControl={
<EuiFieldNumber
controlOnly
placeholder="0"
className="euiFieldNumber"
readOnly
aria-label="Use aria labels when no actual label is in use"
/>
}
endControl={
<EuiFieldNumber
controlOnly
placeholder="100"
className="euiFieldNumber"
readOnly
aria-label="Use aria labels when no actual label is in use"
/>
Expand All @@ -205,16 +205,16 @@ export default () => (
prepend={<EuiFormLabel>Disabled</EuiFormLabel>}
startControl={
<EuiFieldNumber
controlOnly
placeholder="0"
className="euiFieldNumber"
disabled
aria-label="Use aria labels when no actual label is in use"
/>
}
endControl={
<EuiFieldNumber
controlOnly
placeholder="100"
className="euiFieldNumber"
disabled
aria-label="Use aria labels when no actual label is in use"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ exports[`EuiDatePicker localization accepts the locale prop 1`] = `
class="euiDatePicker testClass1 testClass2 emotion-euiDatePicker-inline-shadow-euiTestCss"
>
<div
class="euiFormControlLayout euiFormControlLayoutDelimited emotion-euiFormControlLayout"
class="euiFormControlLayout emotion-euiFormControlLayout-group"
>
<div
class="euiFormControlLayout__childrenWrapper emotion-euiFormControlLayout__childrenWrapper"
class="euiFormControlLayout__childrenWrapper emotion-euiFormControlLayout__childrenWrapper-inGroup-prependOnly-appendOnly"
>
<div
class="react-datepicker emotion-euiReactDatePicker"
Expand Down Expand Up @@ -484,10 +484,10 @@ exports[`EuiDatePicker localization inherits locale from context 1`] = `
class="euiDatePicker testClass1 testClass2 emotion-euiDatePicker-inline-shadow-euiTestCss"
>
<div
class="euiFormControlLayout euiFormControlLayoutDelimited emotion-euiFormControlLayout"
class="euiFormControlLayout emotion-euiFormControlLayout-group"
>
<div
class="euiFormControlLayout__childrenWrapper emotion-euiFormControlLayout__childrenWrapper"
class="euiFormControlLayout__childrenWrapper emotion-euiFormControlLayout__childrenWrapper-inGroup-prependOnly-appendOnly"
>
<div
class="react-datepicker emotion-euiReactDatePicker"
Expand Down
Loading
Loading