-
Notifications
You must be signed in to change notification settings - Fork 842
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 EuiButtonEmpty #6863
Conversation
fd9b536
to
a18a507
Compare
- place the padding on the parent button instead of on the content - remove the text truncation (already handled by the new component - no need to repeat) - retain `className`s, as they're used/targeted in many places in Kibana, but update syntax
18dd77f
to
64e25ae
Compare
- flush modifiers - transition + comment - leave out transform/animation - those aren't defined in the new base CSS-in-JS util and don't need to be unset
+ rewrite enums to new preferred syntax
+ add missing `textProps` test
- TODO: add another story for link vs button? - add another with all permutations visible at once (like in docs?)
Preview documentation changes for this PR: https://eui.elastic.co/pr_6863/ |
64e25ae
to
03afc3f
Compare
Preview documentation changes for this PR: https://eui.elastic.co/pr_6863/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_6863/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
closes #6388 - this is the last button component to be converted to Emotion 🎉
WHOOP! Love to see it! This looks good and it's so nice to have these inside of Sorybook. I compared staging to prod and everything looks the same for the most part. I did notice the very small typographical difference mentioned.
One observation for the current Playground for EuiEmptyButton
's with ghost
as the color.
In light mode when selecting the buttons in the Playground, it doesn't have a background highlight but in Storybook it does. It works fine in the docs example when switching to dark mode and selecting the buttons, so I don't think it's a problem but I figured I would call it out. I know ghost has its quirks 👻
![image](https://private-user-images.githubusercontent.com/40739624/248908433-0c57d80a-de67-4ab9-b938-a36aba2703bb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1ODgyMzIsIm5iZiI6MTczOTU4NzkzMiwicGF0aCI6Ii80MDczOTYyNC8yNDg5MDg0MzMtMGM1N2Q4MGEtZGU2Ny00YWI5LWI5MzgtYTM2YWJhMjcwM2JiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDAyNTIxMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY4NjA5N2Y0YjQ0ZWIxYzJmNWQ1ZjYzZjI0NDdiZGViOTM0NWY1OTEyNTIyMDFiYTllYWI3N2NlNmJkMTI2M2YmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.XRdR3LFXL-TpG7RWZOyEfWbeOWQq9CbmVVzcqNXl9B8)
// Override the cursor and allow users to highlight text when in the read only state | ||
isReadOnly: css` | ||
&.euiButtonEmpty:disabled { | ||
&:disabled { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for including the TODO in this PR!
Co-authored-by: Bree Hall <40739624+breehall@users.noreply.github.com>
Yep, good eye! It's basically a quirk of |
Preview documentation changes for this PR: https://eui.elastic.co/pr_6863/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_6863/ |
`eui@82.1.0` ⏩ `83.0.0`⚠️ The biggest change in this PR by far is the `EuiButtonEmpty` Emotion conversion, which changes the DOM structure of the button slightly as well as several CSS classes around it. EUI has attempted to convert any custom EuiButtonEmpty CSS overrides where possible, but would super appreciate it if CODEOWNERS checked their touched files. If anything other than a snapshot or test was touched, please double check the display of your button(s) and confirm everything still looks shipshape. Feel free to ping us for advice if not. --- ## [`83.0.0`](https://github.com/elastic/eui/tree/v83.0.0) **Bug fixes** - Fixed `EuiPaginationButton` styling affected by `EuiButtonEmpty`'s Emotion conversion ([#6893](elastic/eui#6893)) **Breaking changes** - Removed `isPlaceholder` prop from `EuiPaginationButton` ([#6893](elastic/eui#6893)) ## [`82.2.1`](https://github.com/elastic/eui/tree/v82.2.1) - Updated supported Node engine versions to allow Node 16, 18 and >=20 ([#6884](elastic/eui#6884)) ## [`82.2.0`](https://github.com/elastic/eui/tree/v82.2.0) - Updated EUI's SVG icons library to use latest SVGO v3 optimization ([#6843](elastic/eui#6843)) - Added success color `EuiNotificationBadge` ([#6864](elastic/eui#6864)) - Added `badgeColor` prop to `EuiFilterButton` ([#6864](elastic/eui#6864)) - Updated `EuiBadge` to use CSS-in-JS for named colors instead of inline styles. Custom colors will still use inline styles. ([#6864](elastic/eui#6864)) **CSS-in-JS conversions** - Converted `EuiButtonGroup` and `EuiButtonGroupButton` to Emotion ([#6841](elastic/eui#6841)) - Converted `EuiButtonIcon` to Emotion ([#6844](elastic/eui#6844)) - Converted `EuiButtonEmpty` to Emotion ([#6863](elastic/eui#6863)) - Converted `EuiCollapsibleNav` and `EuiCollapsibleNavGroup` to Emotion ([#6865](elastic/eui#6865)) - Removed Sass variables `$euiCollapsibleNavGroupLightBackgroundColor`, `$euiCollapsibleNavGroupDarkBackgroundColor`, and `$euiCollapsibleNavGroupDarkHighContrastColor` ([#6865](elastic/eui#6865)) --------- Co-authored-by: Cee Chen <constance.chen@elastic.co> Co-authored-by: Jeramy Soucy <jeramy.soucy@elastic.co> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Summary
This PR:
EuiButtonEmpty
to Emotion, removing/cleaning up unnecessary CSS due to dogfooding of new internalEuiButtonDisplay
components.euiButtonEmpty--
modifier classesEuiButtonContentDeprecated
fully - this was the last component using the old/deprecated internal button componentsAs always, for review I recommend following along by commit (due to the number of affected snapshots).
QA
gh pr checkout 6863 && yarn storybook
color
,flush
, andsize
permutations work as expected in StorybookGeneral checklist
Emotion checklist
Acceptance criteria
- [ ] All SCSS overrides have been removed from the Amsterdam theme- No overrides for this component- [ ] Any dependent components are identified in a new issue- All dependent usages in EUI are calling the generic.euiButtonEmpty
or.euiButtonEmpty__content
Checklists
Kibana usage
Kibana due diligence
**/target, **/*.snap, **/*.storyshot
for less noise) foreui{Component}
(case sensitive) to find:- [ ] Any Sass or CSS that will need to be updated, particularly if a component Sass var was deletedNone{euiComponent}-
(case sensitive) to check for usage of modifier classes- [ ] If usage exists, consider converting to a- Usages can be swapped out for non-modifierdata
attribute so that consumers still have something to hook into.euiButtonEmpty
euiBadge
class on a div instead of simply using theEuiBadge
component)General
className(s)
read as expected in snapshots and browsersUnit tests
shouldRenderCustomStyles()
test was added and passes with parent component and any nestedchildProps
(e.g.tooltipProps
)- [ ] Removed any mounted snapshotsSass/Emotion conversion process
src/components/index.scss
- [ ] Deleted anysrc/amsterdam/overrides/{component}.scss
files (styles within should have been converted to the baseline Emotion styles)- [ ] Converted all global Sass vars/mixins to JS (e.g.$euiSize
toeuiTheme.size.base
)- [ ] Removed or converted component-specific Sass vars/mixins to exported JS versions- [ ] Listed var/mixin removals in changelog- [ ] Ranyarn compile-scss
to update var/mixin JSON files- [ ] Simplifiedcalc()
tomathWithUnits
if possible (if mixing different unit types, this may not be possible)- [ ] Added an@warn
deprecation message within theglobal_styling/mixins/{component}.scss
fileCSS tech debt
euiCanAnimate
-inline
and-block
logical properties (check inline styles as well as CSS)- [ ] Usedgap
property to add margin between items if using flexDOM Cleanup
euiComponent
,euiComponent__child
)Extras/nice-to-have
- [ ] Documentation pass- [ ] Check for issues in the backlog that could be a quick fix for that component- [ ] Optional component/code cleanup: consider splitting up the component into multiple children if it's overly verbose or difficult to reason about