Skip to content
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(chip-group): Add Chip Group component #6075

Merged
merged 124 commits into from
Apr 21, 2023

Conversation

macandcheese
Copy link
Contributor

@macandcheese macandcheese commented Dec 16, 2022

Related Issue: #1933

Opening as a draft Ready for review :)

Summary

This still needs work but want to get a branch up so folks can preview and provide feedback.

This PR adds the proposed chip-group component and some associated changes to chip.

  • chip-group can be used for spacing and keyboard navigation of selectable or non-selectable chip components.
  • chip-group defaults to selection-mode:none, but supports single, single-persist, and multiple selection modes.

To do / looking for feedback:

  • Currently, users need to add selectable property to child chip components to enable the selection capability. This could potentially be managed by the parent chip-group: conditionally applied via an internal property based on selection-mode, but that creates a weird situation where selectable is not documented but the selected property is public, since that will always need to be available to a user. Open to thoughts there.

  • Currently, once dismissed, the previous chip is focused. If the first chip is dismissed, focus is moved to the "next first chip" as it takes the place - does this make sense?

  • Add more tests as needed.

  • Audit of keyboard navigation.

  • Need an a11y audit from @geospatialem :)

  • Style cleanup / design feedback from @SkyeSeitz @ashetland :)

  • General pattern feedback :)

Screen.Recording.2022-12-16.at.9.18.05.AM.mov

@macandcheese macandcheese added the new component Issues tied to a new component. label Dec 16, 2022
@github-actions github-actions bot added the enhancement Issues tied to a new feature or request. label Dec 16, 2022
macandcheese added a commit that referenced this pull request Dec 17, 2022
…ng (#6086)

**Related Issue:** #6081
[#6803](#6083)

## Summary
As suggested by @alisonailea [in this
comment](#6075 (comment)),
extracts some common keyboard navigation focus helpers into a shared
utility.

Along the way discovered a few things that are fixed alongside the
refactors:

Accordion:
- Cleanup: The keyboard expected navigation changed at some point, which
I confirmed with @geospatialem, but there was a lot of related stale
code that is removed.

Dropdown:
- Fix: Previously, tab / shift tab would skip elements resulting in
navigating to every other item.
- Fix: Previously, there was inconsistent close behavior when using tab
/ shift tab at the first / last item.
- Fix: Previously, when `accordion-item` had a populated `href`
property, there was a "double focus" issue.
- Cleanup: Uses the new utility to handle keyboard navigation / focus


Stepper / Tabs:
- Cleanup: Uses the new utility to handle keyboard navigation / focus


All existing tests are passing, but we may want some extra passes of
manual testing, especially in the dropdown case, since there were so
many weird bugs previously.
@macandcheese macandcheese marked this pull request as ready for review December 18, 2022 23:18
@macandcheese macandcheese requested a review from a team as a code owner December 18, 2022 23:18
@macandcheese macandcheese added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Dec 18, 2022
@macandcheese macandcheese added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Apr 21, 2023
@macandcheese macandcheese added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Apr 21, 2023
@macandcheese macandcheese added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Apr 21, 2023
@macandcheese macandcheese removed the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Apr 21, 2023
@macandcheese macandcheese added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Apr 21, 2023
@macandcheese macandcheese added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Apr 21, 2023
@macandcheese macandcheese added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Apr 21, 2023
@macandcheese macandcheese added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Apr 21, 2023
@macandcheese macandcheese merged commit 77dec87 into master Apr 21, 2023
@macandcheese macandcheese deleted the macandcheese/1933-add-chip-group branch April 21, 2023 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues tied to a new feature or request. new component Issues tied to a new component. pr ready for visual snapshots Adding this label will run visual snapshot testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants