[Inputs] Implement form element append/prepend design updates#9305
Conversation
ad10709 to
668534a
Compare
- updates append/prepend styling, border radius, background colors
…ton from the form layout context
… color on valid state & cleanup
- base and filled buttons don't have a transition anymore either, it seems logical to remove and align
- mainly due to the added wrapper element on append/prepend
668534a to
c275d28
Compare
- the entire layout wrapper has a background
- that's not the final proposal yet, just an update
68418c9 to
a7bbf0d
Compare
|
This PR contains breaking changes. The opener of this pull request is asked to perform the following due diligence steps below, to assist EUI in our next Kibana upgrade:
|
- we'll use the custom style version going forward
…pend - there might be use cases where custom content purposefully looks different; we instead want to ensure expected usage through guidance and patterns
|
A couple of mid-review comments, mostly so you know I'm at it:
|
@acstll Woops, that's a mistake, it should use |
acstll
left a comment
There was a problem hiding this comment.
Code-wise it looks correct, only a single comment which is a nit!
I followed the guide for the QA — thanks a lot for providing it!
I found 3 things design-wise worth pointing out (I left a brief comment in the code where I thought it might be related but it could be wrong 😛)
(1) padding in FormControlLayout's side
I think the 4px padding in the "side" in the FormControlLayout is not present in the spec when there's a label, only when there's a button
| code | spec |
|---|---|
![]() |
![]() |
(2) gap in prepend/append
this seems to be 8px and not 4px in the spec, otherwise items are too close to each other when there's no label
| code | spec |
|---|---|
![]() |
![]() |
(3) font size for buttons
in the spec, font size for buttons seems larger (~2px) than labels only, I wonder if that should be the case for element="button"
| code | spec |
|---|---|
![]() |
![]() |
packages/eui/src/components/form/form_control_layout/form_control_layout.styles.ts
Show resolved
Hide resolved
...ges/eui/src/components/form/form_control_layout/append_prepend/form_append_prepend.styles.ts
Outdated
Show resolved
Hide resolved
packages/eui/src/components/form/form_control_layout/form_control_layout.styles.ts
Show resolved
Hide resolved
packages/eui/src/components/form/form_control_layout/form_control_layout.styles.ts
Outdated
Show resolved
Hide resolved
- additionally adjusts the spacing around form labels for visual balance as those already have their own spacing
…xpectedly - prevents e.g. EuiCheckbox label from being displayed as disabled if the form layout is disabled but the checkbox is not
- we don't want the badge being automatically adjusted on parents disabled state
@acstll We aligned with @JoseLuisGJ that we keep the matching |
- due to spacing changes
|
@acstll I added a couple small additional updates to this PR that I noticed while checking Kibana usages:
|
acstll
left a comment
There was a problem hiding this comment.
Thanks for the updates @mgadewoll! I checked the ones from my comments and the other ones you described (#9305 (comment)).
All changes look good and the outcome is correct.
I was about to approve but there is this one suggestion about the label padding I think is worth sharing. Let me know what you think!
packages/eui/src/components/form/form_control_layout/form_control_layout.styles.ts
Outdated
Show resolved
Hide resolved
...ges/eui/src/components/form/form_control_layout/append_prepend/form_append_prepend.styles.ts
Outdated
Show resolved
Hide resolved
23bf918 to
9a55d71
Compare
acstll
left a comment
There was a problem hiding this comment.
🟢 Thanks a lot for that last one update!
💚 Build SucceededHistory
cc @mgadewoll |
💚 Build Succeeded
History
cc @mgadewoll |
6a2422c
into
elastic:feat/visual-refresh-append-prepend-updates
## Dependency updates - `@elastic/eui` - v112.3.0 ⏩ v113.0.0 - `@elastic/eui-theme-borealis` - v5.4.0 ⏩ v6.0.0 - `@elastic/eslint-plugin-eui` - v2.8.0 ⏩ v2.9.0 --- ## Changes 1. EUI component update: API and Design updates to form layout append/prepend by using the new components `EuiFormPrepend` and `EuiFormAppend` (EUI [#9308](elastic/eui#9308)) >[!important] ❗ This upgrade PR includes all changes previously made in the specific QA PR #248805. Please see the description in that PR for detailed information about the specific changes. 2. Additional changes related to the form layout changes >[!note] 🔗 Please see the [section "Additional changes"](#248805 (comment)) in #248805 for an overview of additional changes. 3. Removed token update: Replaced `ghost` and `ink` token usages with `textInk` or `plainDark` and `textGhost` or `plainLight` respectively (EUI [#9379](elastic/eui#9379)) ## Package updates ### `@elastic/eui` [v113.0.0](https://github.com/elastic/eui/releases/tag/v113.0.0) - Updated `EuiFlyout` manager to close all flyouts when a parent flyout is closed. ([#9378](elastic/eui#9378)) - Added `textInk` and `textGhost` color tokens for text and icon colors that should always remain dark or light regardless of color mode. ([#9379](elastic/eui#9379)) - Added `EuiFormAppend` and `EuiFormPrepend` components ([#9014](elastic/eui#9014)) - Added support for `type="span"` on `EuiFormLabel` for visual-only form labels ([#9014](elastic/eui#9014)) - Updated `EuiFormLabel` to render a `span` if no `htmlFor` is passed ([#9014](elastic/eui#9014)) - Updated `EuiFormControlLayout` to use `EuiFormAppend` and `EuiFormPrepend` ([#9014](elastic/eui#9014)) - Updated `EuiAutoRefresh` and `EuiColorPicker` to use `EuiFormPrepend` ([#9014](elastic/eui#9014)) - Updated `EuiFormAppend`/`EuiFormPrepend` styling ([#9305](elastic/eui#9305)) - Updated `EuiFormAppend`/`EuiFormPrepend` to inherit `isDisabled` state from `EuiFormControlLayout` ([#9305](elastic/eui#9305)) - Updated `EuiFormControlLayout` hover, disabled and readonly styling ([#9305](elastic/eui#9305)) - Updated `EuiFormControlButton` to inherit `isDisabled`, `readOnly` and `isInvalid` states from `EuiFormControlLayout` ([#9305](elastic/eui#9305)) - Added `iconSide` prop on `EuiDatePickerRange` ([#9305](elastic/eui#9305)) - Updated `EuiSuperDatePicker` valid state styling ([#9305](elastic/eui#9305)) - Removed background color transition on `EuiButtonEmpty` (other button variants don't have a transition anymore either) ([#9305](elastic/eui#9305)) - Added `isLoading` prop on `EuiFormControlButton` ([#9328](elastic/eui#9328)) - Updated paddings for `EuiButton`, `EuiButtonEmpty`, `EuiFilterButton` ([#8948](elastic/eui#8948)) - Updated paddings for `append`/`prepend` on `EuiFormControlLayout` ([#8948](elastic/eui#8948)) - Added optional `scrollContainerRef` prop to `EuiFlyoutBody` for accessing the flyout's internal scroll container. ([#9373](elastic/eui#9373)) **Bug fixes** - Updated `EuiColorPicker` to ensure `id` is correctly passed onto the internal `EuiFormControlLayout` ([#9014](elastic/eui#9014)) **Breaking changes** - Removed `ink` and `ghost` theme tokens. Use `textInk` / `textGhost` for text and icon colors or `plainDark` /`plainLight` for non-text use cases. ([#9379](elastic/eui#9379)) - Updated `EuiQuickSelectPopover` in `EuiSuperDatePicker` to use `EuiFormPrepend`. This results in more restricted `buttonProps` as they reflect `EuiFormPrepend` instead of generic `EuiButtonEmpty` props. ([#9014](elastic/eui#9014)) - Removed `components.superDatePickerBackgroundSuccees` token ([#9305](elastic/eui#9305)) ### `@elastic/eui-theme-borealis` v6.0.0 - Added `textInk` and `textGhost` color tokens for text and icon colors that should always remain dark or light regardless of color mode. ([#9379](elastic/eui#9379)) ### `@elastic/eslint-plugin-eui` v2.9.0 - Prevented `badge-accessibility-rules` rule autofix from duplicating `aria-hidden` attributes. ([#9366](elastic/eui#9366)) - Skip `badge-accessibility-rules` rule validation when a spread operator is used in a component. ([#9366](elastic/eui#9366)) --------- Co-authored-by: Weronika Olejniczak <weronika.olejniczak@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>










Summary
Important
This PR merges into a feature branch.
closes https://github.com/elastic/eui-private/issues/496
Changes
EuiFormAppend/EuiFormPrependstyling:EuiButtonEmptywith variantprimarygapvalue fromxstosEuiFormAppend/EuiFormPrependto inheritisDisabledstate fromEuiFormControlLayoutEuiFormControlLayoutstyling:euiTheme.border.radius.smallinstead of0now)EuiFormControlButtonto inheritisDisabled,readOnlyandisInvalidstates fromEuiFormControlLayouticonSideprop onEuiDatePickerRangeEuiSuperDatePickerstyling:checkCircleicon on valid input dataEuiButtonEmpty(other button variants don't have a transition anymore either)Breaking changes
components.superDatePickerBackgroundSucceestokenWhy are we making this change?
✨ UI modernization: The design updates are part of the global UI modernization efforts.
Screenshots #
EuiFormControlLayoutappend/prepend - New API (usingEuiFormAppend/EuiFormPrepend)EuiFormControlLayoutappend/prepend - Custom (old) API (custom content)EuiFormControlLayoutDelimitedEuiFormControlButtoninsideEuiFormControlLayoutAutofill styles (Chrome)
EuiSuperDatePicker valid styles
EuiDatePickerRange
iconSide="right"+iconTypeImpact to users
components.superDatePickerBackgroundSucceestokenℹ️ The token is not in use but e.g. Kibana requires snapshot updates:
x-pack/platform/plugins/shared/security/public/authentication/login/components/login_form/__snapshots__/login_form.test.tsx.snapx-pack/platform/plugins/shared/security/public/management/roles/edit_role/collapsible_panel/__snapshots__/collapsible_panel.test.tsx.snapx-pack/platform/plugins/shared/security/public/management/roles/edit_role/privileges/kibana/simple_privilege_section/__snapshots__/simple_privilege_section.test.tsx.snapQA
Review stories:
EuiFormAppend(PR, feature branch)EuiFormPrepend(PR, feature branch)EuiFormControlLayoutappend/prependwith old API to compare with current production (PR, production)EuiFormControlLayoutappend/prependwith new API (PR, feature branch)EuiFormControlLayoutappend/prependwith new & old API side by side (PR, feature branch)EuiFormControlLayoutwithEuiFormControlButton(PR)EuiFormControlLayoutDelimited(PR, feature branch, production)EuiSuperDatePicker(PR, feature branch, production)Review checks:
append/prependandEuiFormAppend/EuiFormPrependmatch design specsEuiFormControlLayoutEuiFormControlLayoutDelimitedEuiFieldTextandEuiFieldNumberEuiSuperDatePickerandEuiDatePickerRangeEuiSuperDatePickerrenders an icon and no background when a valid time span is selectedGeneral checklist
@defaultif default values are missing) and playground toggles