Skip to content

[EuiFormRow] Fixes and extra class & [EuiDescribedFormGroup] Sizing fixes and added ratio#5756

Merged
cchaos merged 11 commits intoelastic:mainfrom
cchaos:EuiDescribedFormGroup/ratios
Apr 18, 2022
Merged

[EuiFormRow] Fixes and extra class & [EuiDescribedFormGroup] Sizing fixes and added ratio#5756
cchaos merged 11 commits intoelastic:mainfrom
cchaos:EuiDescribedFormGroup/ratios

Conversation

@cchaos
Copy link
Copy Markdown
Contributor

@cchaos cchaos commented Apr 1, 2022

[EuiFormRow]

Fixed calculation of hasEmptyLabelSpace [commit]

The calculation wasn't working with the new Amsterdam line-height.

image

Added —hasLabel class for nested styling [commit]

This helped to adjust the field column vertical alignment by faking a line of pseudo text. It does add this class to pretty much all EuiFormRow snapshots 😸 .

[EuiDescribedFormGroup]

Fixed vertical alignment, wrapping of description text [commit]

  • Adds a <p> wrapper to description if it’s just a string
  • Removes all the padding classes that tried to calculate margin based on title size
  • Adds alignItems="baseline” to the flex group adding a pseudo element to form rows that don’t contain labels

image

Added ratio prop [commit]

Closes #2540

Screen Shot 2022-04-02 at 16 12 27 PM

Need help: Snapshots no good Moved styles back to Sass

Docs!

Checklist

  • Checked in both light and dark modes
  • Checked in mobile
  • Checked in Chrome, Safari, Edge, and Firefox
  • Props have proper autodocs and playground toggles
  • Added documentation
  • Checked Code Sandbox works for any docs examples
  • Added or updated jest and cypress tests
  • [ ] Checked for breaking changes and labeled appropriately
  • [ ] Checked for accessibility including keyboard-only and screenreader modes
  • Updated the Figma library counterpart
  • A changelog entry exists and is marked appropriately

cchaos added 7 commits April 1, 2022 12:57
…tion text

- Adds a `<p>` wrapper to description if it’s just a string
- Removes all the padding classes that tried to calculate margin based on title size
- Adds `alignItems="baseline”` to the flex group adding a pseudo element to form rows that don’t contain labels
@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_5756/

@cchaos cchaos marked this pull request as ready for review April 2, 2022 21:13
@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_5756/

@cchaos
Copy link
Copy Markdown
Contributor Author

cchaos commented Apr 4, 2022

This PR is reviewable. Just need to find a solution to the snapshot issue using Emotion on components.

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_5756/

@cchaos cchaos added this to the Elastic Stack 8.3 milestone Apr 6, 2022
@elizabetdev elizabetdev self-requested a review April 11, 2022 14:08
Copy link
Copy Markdown
Contributor

@elizabetdev elizabetdev left a comment

Choose a reason for hiding this comment

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

LGTM! 🎉

Tested in Chrome, Safari, Edge, and Firefox. I also run the code locally to test a few scenarios.

Just need to find a solution to the snapshot issue using Emotion on components.

I tried this locally and if you merge main the snapshot issue gets fixed and you can use Emotion.

Co-authored-by: Elizabet Oliveira <elizabet.oliveira@elastic.co>
@cchaos
Copy link
Copy Markdown
Contributor Author

cchaos commented Apr 11, 2022

I tried this locally and if you merge main the snapshot issue gets fixed and you can use Emotion.

Thanks, yeah I've already reverted back to Sass. There really wasn't much benefit since the rest of the component is still Sass. So I'll just leave it as is until the full conversion.

@thompsongl thompsongl self-requested a review April 11, 2022 16:43
@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_5756/

Copy link
Copy Markdown
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

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

Code changes LGTM!

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_5756/

@cchaos cchaos merged commit 0ca08da into elastic:main Apr 18, 2022
@cchaos cchaos deleted the EuiDescribedFormGroup/ratios branch April 18, 2022 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[EuiDescribedFormGroup] Allow custom widths to be set

4 participants