-
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
Add Suggest Item #2090
Add Suggest Item #2090
Conversation
EuiSuggestItems tests pass
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 layout
prop documentation is a bit confusing for me -
Use
layout
to change the distribution of the EuiSuggestItem elements.
Suggests to me that the order of the content will change, or its organization will be different, as opposed to simply expanding to fit content. This should probably call out or demonstrate that inline
doesn't just allow longer labels but will shorten to fit smaller content as well.
Also, I don't find the inline
and setColumns
values meaningful. Is this functionality expected to be expanded in the future?
@chandlerprall Good point about the @snide is this inline with what you were proposing? |
Yep. In general whenever we're making alternate displays I think it's smart
to tie them to a more flexible enum rather than a Boolean. We tend to add
more over time. Whether layout is the correct propname is a diff issue.
…On Fri, Jul 5, 2019, 11:12 AM Andrea Del Rio ***@***.***> wrote:
@chandlerprall <https://github.com/chandlerprall> Good point about the
layout prop. So that prop was initially called expandLongLabel. However,
while discussing with Dave he suggested to make it more flexible and call
it layout instead. My understanding is that we could eventually support
more layouts. For example something like this:
[image: image]
<https://user-images.githubusercontent.com/4016496/60738541-8a992c80-9f13-11e9-82f3-0388b427f132.png>
@snide <https://github.com/snide> is this inline with what you were
proposing?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2090?email_source=notifications&email_token=AACPHJ42OGNJSQS6GPOCGQDP56FKFA5CNFSM4H5MKMWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZKCMOI#issuecomment-508831289>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACPHJ47L2RGL3NJMT24IPTP56FKFANCNFSM4H5MKMWA>
.
|
Just a note: I've committed to helping @andreadelrio convert this to TypeScript after we're set with the functionality and design of the component. So this is purposefully TS-less, and there will (likely) be a follow-up PR. |
I agree with allowing future options with an enum of values instead of a boolean. However, I don't find the current choices of |
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.
Thanks everyone for your feedback so far. Here are some things I'm considering:
Please send your comments! |
Yep, I think that's a good approach. We could still allow someone to pass a particular color, but that color would then be the full background color and we'd just calculate if the text should be white or black. Similar to how we handle in EuiAvatar.
I like that name better. You can even simplify the options to be: labelDisplay: 'fixed' | 'expand'
I'd assume, based on our previous patterns, that you'd have one large encompassing |
Fully agree with Caroline on 2! |
a211b79
to
3e87f51
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.
This is already getting much simpler. I think you're in the home stretch. The first big PR always takes a while.
2c20086
to
08197bd
Compare
I went ahead and replaced the color options to use the vis palette only. I think it looks better! Thanks for that suggestion. Regarding the expand label situation. I decided to add a |
EuiSuggestItems tests pass
…to suggest-item
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.
Final comments, I swear. Mostly around docs and prop descriptions/requirements. I labelled a few optional. But functionally, stylistically, SASS-wise it all looks great!!!
I haven't had a chance to thoroughly review this yet but I wanted to check if keyboard and screen reader testing was on your radar? I noticed that it's crossed out but, especially as a reusable pattern, I think we have to make sure we're raising the bar on one-off implementations. |
@myasonik Yes, it typically is an item we make sure to check off vs cross-off. But this is a smaller piece of a large component that we're piece-mealing in. When the full component is in review we'll be sure to do a full keyboard nav test as well. |
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.
Looks great! Just saw one duplicated class name and you'll need a changelog entry.
<span className={`euiSuggestItem__type ${colorClass}`}> | ||
<EuiIcon type={type.iconType} /> | ||
</span> | ||
<span className={`euiSuggestItem__label ${labelDisplayClass}`}> |
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.
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.
One small ask, but otherwise LGTM
text: ( | ||
<div> | ||
<p> | ||
<EuiCode>EuiSuggest</EuiCode> description goes here. |
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.
As this is merging into master
, can we comment out this first section or update it with a coming soon message?
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.
I think the idea is just to comment it out from the routes file for now instead.
Summary
Add
SuggestItem
component. Covers #2061Checklist
- [ ] This was checked for breaking changes and labeled appropriately- [ ] This was checked against keyboard-only and screenreader scenarios