-
Notifications
You must be signed in to change notification settings - Fork 843
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
Add List Group component #1377
Add List Group component #1377
Conversation
Note for link with action: I have a stash where the secondary button is positioned absolutely and the main button has the hover state (as opposed to the containing span). I'll work that through a bit further and see if it simplifies things. I suspect it will make for better hover and focus states along with cleaner CSS. Related, you'll notice a slightly odd focus state when you navigate to and trigger the primary button action (the focus state does not fill the entire list item area). |
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.
The design of these look great. I like that there are bordered and flushed options so the consumer doesn't have to think about the extra padding effects. My main concerns are around relying on importing other components and/or forcing the consumer to pass in certain components (like buttons if they want onClick
).
This component, similar to the way we handle normal buttons, facet buttons, and badges can completely take care of the handling of onClick
vs href
vs extraAction
. Meaning, it can do the logic of deciding what type of html element (span vs button vs anchor) to display and their states.
I've tried to describe how to change things in the code review, but lmk if you want to zoom over it.
For those reviewing, I'm currently working to make this component accept an array of list items, similar to the Description List component. |
83eb261
to
c06d88f
Compare
@cchaos , et al, this EuiListGroup PR is ready for a fresh review. Thanks for the great feedback the first time around, this feels much more complete and organized! Some notable changes:
|
@ryankeairns Here is a PR: ryankeairns#1 I tried to explain a bit of the new render schema and some caveats. |
Simplify inner contents of `EuiListGroupItem`
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.
9031563
to
2ced43b
Compare
a9a2bd1
to
8db8fd9
Compare
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.
LGTM. We will eventually need to flesh out more of the jest tests too, but let's get this in to keep the ball rolling. 😃
@chandlerprall we're moving quick on this (I have another PR based on this one) and we'd like to get it in PMs hands. I'm going to merge this but please feel free to do a post-merge review! |
🔨 This will be converted to TS in a follow-up PR 🔧
Summary
As a precursor to the K7 side nav redesign, this component provides a way to neatly display a list of items. In particular, it can handle link list items with an optional icon and an optional secondary action.
It starts with a basic list of items in plain text. The most likely use case for EUI users will be easily displaying a list of links. This can be accomplished by supplying a
label
and anhref
with an optionaliconType
. In the event users want advanced text formatting or button capabilities (such asonClick
), they can pass other EUI component likeEuiText
andEuiButtonEmpty
, respectively.The more advanced use case will be for the K7 navigation. In this case, we'll need to supply not only an
EuiButtonEmpty
but also a secondary button action vialinkAction
.For those reasons, both
label
andlinkAction
are set toPropTypes.node
. I've provided an example of the more advanced K7 side nav use case, but perhaps we don't want to advertise that.Screenshots
Checklist
This was checked for breaking changes and labeled appropriatelyJest tests were updated or added to match the most common scenariosThis required updates to Framer X components