Skip to content

[EuiCard] Refactored to use EuiPanel#4649

Merged
cchaos merged 29 commits intoelastic:masterfrom
cchaos:fix/card_use_panel
Mar 28, 2021
Merged

[EuiCard] Refactored to use EuiPanel#4649
cchaos merged 29 commits intoelastic:masterfrom
cchaos:fix/card_use_panel

Conversation

@cchaos
Copy link
Contributor

@cchaos cchaos commented Mar 17, 2021

Required some updates to how EuiPanel handles div or button

Before it was entirely linked to the existence of onClick, but for cards' we need to onClick (but not focusable) on a div for accessibility reasons. So I've added the prop element which essentially allows consumer to force to either a button or div. But internally, if this is not specified, will always choose button if onClick exists.

👉 [x]: In the props, the extended element only ever shows up as HTMLButton.

Screen Shot 2021-03-17 at 14 42 14 PM

[EuiCard] Now supports more EuiPanel color options through the already existing display prop

     * Matches to the color property of EuiPanel. If defined, removes any border & shadow.
     * Leave as `undefined` to display as a default panel.
     * Selectable cards will always display as a default panel.
Screen.Recording.2021-03-18.at.04.18.42.PM.mp4

Also fixes #4429 where Amsterdam's cards were not getting the empty shade background color

Updated some of EuiCard's props to be directly related to the layout direction

There are 4 props (textAlign, footer, image, and selectable) that are not allowed when the layout="horizontal", so the TS type is now setup this way in addition to the original and still existent console error. Closes #4485

[EuiCheckableCard] Now Uses EuiSplitPanel

This really doesn't change any of the inner-workings of the component and only a slight adjustment to the aesthetics. In the default theme it adds a little more padding because it's now tied to the panel padding for all sides. And in Amsterdam, the default replaces the shadow for a border since likely this will be in a greater form and the shadow is too much.

image

Also fixes #3629, by applying the onChange function to the onClick of the inner split panel that houses it.
Screen Recording 2021-03-20 at 04 16 36 PM

Added Panel nesting guidelines ❤️ @mdefazio

Screen Shot 2021-03-18 at 16 29 47 PM

🔔 [BREAKING] Finally removed the beta badge props from EuiPanel

All three, betaBadgeLabel, betaBadgeTooltipContent, and betaBadgeTitle are now removed. The recommendation is to use EuiCard instead.

For Elastic products, I've checked Cloud, which doesn't have any usages of these on the EuiPanel component. And I've got a local branch ready for the 3 places it's used in Kibana to update to use EuiCard instead.

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • Checked in mobile
  • Checked in Chrome, Safari (focus isn't great, but I want to address it on a larger scale), Edge, and Firefox
  • Props have proper autodocs and playground toggles
  • Added documentation
  • Checked Code Sandbox works for the any docs examples
  • Added or updated jest tests
  • Checked for breaking changes and labeled appropriately
  • Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@cchaos cchaos added the breaking change PRs with breaking changes. (Don't delete - used for automation) label Mar 17, 2021
@kibanamachine
Copy link

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

cchaos added 2 commits March 18, 2021 10:55
Also updating the testing in Kibana docs for quick copy/pastable snippets
@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@cchaos cchaos marked this pull request as ready for review March 18, 2021 21:43
@cchaos cchaos requested a review from thompsongl March 18, 2021 21:44
@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@thompsongl
Copy link
Contributor

HELP: In the props, the extended element only ever shows up as HTMLButton.

Fix in #4659

@kibanamachine
Copy link

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

Copy link
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.

Looks good!

@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@cchaos cchaos merged commit ca6a530 into elastic:master Mar 28, 2021
@cchaos cchaos deleted the fix/card_use_panel branch March 28, 2021 21:12
smith added a commit to smith/kibana that referenced this pull request Apr 2, 2021
In elastic/eui#4649 the `betaBadgeLabel` and related props have been removed from `EuiPanel` and it's now recommended to use an `EuiCard` instead.

Replace these in APM and Observability plugins and update stories so examples can be viewed.
smith added a commit to elastic/kibana that referenced this pull request Apr 7, 2021
In elastic/eui#4649 the `betaBadgeLabel` and related props have been removed from `EuiPanel` and it's now recommended to use an `EuiCard` instead.

Replace these in APM and Observability plugins and update stories so examples can be viewed.
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Apr 7, 2021
In elastic/eui#4649 the `betaBadgeLabel` and related props have been removed from `EuiPanel` and it's now recommended to use an `EuiCard` instead.

Replace these in APM and Observability plugins and update stories so examples can be viewed.
kibanamachine added a commit to elastic/kibana that referenced this pull request Apr 8, 2021
…6512)

In elastic/eui#4649 the `betaBadgeLabel` and related props have been removed from `EuiPanel` and it's now recommended to use an `EuiCard` instead.

Replace these in APM and Observability plugins and update stories so examples can be viewed.

Co-authored-by: Nathan L Smith <nathan.smith@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change PRs with breaking changes. (Don't delete - used for automation)

Projects

None yet

3 participants