-
Notifications
You must be signed in to change notification settings - Fork 67
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
feat(input-chips): new module #2197
Conversation
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 good. I think we could probably flatten some of this structure. It seems like there are too many levels and Im wondering if we can make it much simpler that way.
It's a little bit weird that you need to click on the text section to get the combobox dropdown; I'm not sure if this would cause accessibility concerns, but as a user I'd expect that clicking anywhere inside the box besides on a chip would bring up the combobox and allow me to start typing. |
We actually talked about that previously. I don't see any a11y issues with that. In fact, trying to mimic that for screen readers might be the thing that causes an issue because to trigger that with a keyboard and screen reader, you'd need the chip container to get focus and be interactive in and of itself - as far as I know that's more likely to be problematic. Visually speaking, I'm not convinced there's enough affordance there to expect a click anywhere inside the chip container to focus on the input and toggle the combobox. The reason why we insisted the design to have the placeholder text was actually for that very reason - not enough visual affordance and expectation of "turning on" the combobox when you click into the box. I suppose some users might expect that, but that would most likely be based on whether they've interacted with similar components. IMO this being far from comparable to any native component, I'm not sure that's a universal expectation. In fact, in certain situations (when there are enough chips to cover most of the box) doing that would not make a difference. We could definitely see if we can do some user testing and see if that's a gap. That said, that could be a nice layered feature. Technically, it's another additive option for discoverability, which might be fine, but I doubt the lack of having it is an actual issue. My only major concern would be since the chip close buttons are not that big, someone missing the close target would prompt to open the combobox - not a major unrecoverable issue, but still... Also, I'm not sure to what extent we should be building the interaction into Skin itself. IMO, as long as the interaction allows for all the UIs to surface for the docs to make visual sense (it does currently), Skin doesn't necessarily need to have the exhaustive set of interaction use cases. Those things should probably live in Ebay UI core. |
I agree this is a good progressive enhancement to add to eBayUI which doesn't necessarily need to be in |
Good catch. I was meaning to hook this up, but forgot. I'll add that. |
Ok, I hooked up the combobox expansion toggle on button click. One very important thing that I haven't finalized yet... ❗ IMPORTANT Right now, the combobox list interaction is isolated to the input. I've been strongly considering decoupling that (removing As part of my last change, I added |
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.
Is it proper BEM to use a single underscore?
Otherwise, looks awesome!
background-color: var(--color-background-elevated); | ||
border: none; | ||
border-radius: 16px; | ||
box-shadow: var(--shadow-strong); |
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.
Should we really be deviating this much from core listbox styles? I would imagine that the only part we should override is the positioning.
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.
If DS has the current specs where they have it, and we're trying to make it look how they want, which is a purely visual "preference," should the fact that we've chosen to use combobox under the hood be enough to overturn the visual specs that DS has landed on?
I still think there may be a better name than |
No. Should be double underscore. |
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 a few minor comments.
I don't think the Figma had any min/max/default widths. I can't verify it at the moment (getting a blank page ATM). From the dev perspective, since this is a composite component, it made sense to have it expand into the container limitations and allow implementation-level layouts to control its dimensions. I suppose, we can do what we do with textbox and the fluid modifier. I'll look into that. |
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 overall. I think its really come a long way.
One comment, is there a way to make this interactive on the docs? We have other components which are interactive like combobox and select. It really adds to the whole feel if a user can actually click an item in chips combobox and see it change. Or hit x and see it removed. It doesn't have to be complex, but at least to see the interactions.
…improvements, cleanup
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.
Nice job @ArtBlue And thanks for working with design to remove those early a11y barriers.
@ArtBlue Oops, just spotted what looks like a couple of unsynced dist files in your branch: ![]() |
There are some errors when I run this locally
Also I see a lot of files being deleted when I run locally. Not sure if its because of merge or not. |
Wow! That is extremely opinionated for docs js. LOL. Ok, I'll change them.
I'm not sure. The diff on the PR doesn't have that. Maybe it's something local? |
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.
Lets wait for the floating ui PR to be merged before merging this.
Fixes #2159
Description
Created new input chips module that includes chips and a combobox selector.
Notes
WIP
Screenshots
Basic
![image](https://private-user-images.githubusercontent.com/1675667/280416699-e047cbf3-df87-4716-8ced-eab3092d6678.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNzE3MDAsIm5iZiI6MTczOTE3MTQwMCwicGF0aCI6Ii8xNjc1NjY3LzI4MDQxNjY5OS1lMDQ3Y2JmMy1kZjg3LTQ3MTYtOGNlZC1lYWIzMDkyZDY2NzgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTBUMDcxMDAwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MjZiOWJiM2IzZDdlZDM5MzcxZDI0ZTE2NTBiN2NmZmVmNWI2NjE3MzY5NjY3YmQ0NzhlOWMwZDMyZWRjYjQ4NCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.XhS4M9frUX918RF2LI_614A4B9WRjUQjpcHAB4nncCE)
With Label
![image](https://private-user-images.githubusercontent.com/1675667/280416768-f8f4da25-e50f-44ae-a34e-b9f4b90ec845.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNzE3MDAsIm5iZiI6MTczOTE3MTQwMCwicGF0aCI6Ii8xNjc1NjY3LzI4MDQxNjc2OC1mOGY0ZGEyNS1lNTBmLTQ0YWUtYTM0ZS1iOWY0YjkwZWM4NDUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTBUMDcxMDAwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OTgyMTc1MmE3MzY5YjY1OWFiYzMyZTY5NTZkY2IxYjFkNmMxYjdiMjZmOWFhMGIxMjNkYzExNDk3YTFkNDVlYiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.jHLRShcRIOYr43IZwEqnRZ9yPiDEBEx2UcsRqx18PbI)
With Helper Text
![image](https://private-user-images.githubusercontent.com/1675667/280416893-f3a424bc-549f-4c2a-8793-2c25123293e4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNzE3MDAsIm5iZiI6MTczOTE3MTQwMCwicGF0aCI6Ii8xNjc1NjY3LzI4MDQxNjg5My1mM2E0MjRiYy01NDlmLTRjMmEtODc5My0yYzI1MTIzMjkzZTQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTBUMDcxMDAwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YjgyODFhNzYxM2U2NjI5ZjA5N2QzMGQ4NDIzNjIxNGVkMzFhYzgwMWQxMGZiOGFiZTZkYWRmZmVmYWUxNTc5ZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.6AHZjbvNvTfzYx4aL9jvKPgHcxk1hYDWZGGp9utsQPM)
Disabled State
![image](https://private-user-images.githubusercontent.com/1675667/280417017-60b93b7f-f27a-469a-a315-8d5c592c983a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNzE3MDAsIm5iZiI6MTczOTE3MTQwMCwicGF0aCI6Ii8xNjc1NjY3LzI4MDQxNzAxNy02MGI5M2I3Zi1mMjdhLTQ2OWEtYTMxNS04ZDVjNTkyYzk4M2EucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTBUMDcxMDAwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NjY1OGRhOWQ3MGYyZDRlNjAwZWEzYWE0NDVmNmEwZGY1MzBmM2MwYzJhZjg0NzQ2ZWEwODAyNmJiMTIzMDQ4OSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.iC3BcZEn2EBv7XkEWiFXi6EQQ3gnPpjMGXa6ly1oQOw)
Error State
![image](https://private-user-images.githubusercontent.com/1675667/280417068-74a25888-6cd2-4bbc-8722-85553b8cd4d9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXV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