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

[CL-221] Add chip-select component #9021

Merged
merged 26 commits into from May 23, 2024
Merged

[CL-221] Add chip-select component #9021

merged 26 commits into from May 23, 2024

Conversation

vleague2
Copy link
Contributor

@vleague2 vleague2 commented May 2, 2024

Type of change

- [ ] Bug fix
- [x] New feature development
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other

Objective

This PR adds a new CL component: bit-chip-select

Non-goals: full compliance with Figma design spec--further design and a11y changes will occur in a separate PR off of #8696

Code changes

  • libs/components/src/chip-select: New component, docs, stories
  • libs/components/src/menu: Changes to facilitate truncation, start + end slots, disabled state
  • libs/components/src/option: Changes to type signature to more accurately convey what is required

Screenshots

See Storybook for more

Screen.Recording.2024-05-21.at.10.04.12.PM.mov

Before you submit

  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team
  • Ensure that all UI additions follow WCAG AA requirements

@github-actions github-actions bot added the needs-qa Marks a PR as requiring QA approval label May 2, 2024
Copy link

codecov bot commented May 2, 2024

Codecov Report

Attention: Patch coverage is 2.53165% with 77 lines in your changes are missing coverage. Please review.

Project coverage is 28.15%. Comparing base (b0cc480) to head (4bd0d15).
Report is 30 commits behind head on main.

Files Patch % Lines
...omponents/src/chip-select/chip-select.component.ts 0.00% 53 Missing ⚠️
.../components/src/chip-select/chip-select.stories.ts 0.00% 21 Missing ⚠️
libs/components/src/chip-select/index.ts 0.00% 1 Missing ⚠️
libs/components/src/index.ts 0.00% 1 Missing ⚠️
libs/components/src/select/option.component.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main    #9021    +/-   ##
========================================
  Coverage   28.15%   28.15%            
========================================
  Files        2369     2375     +6     
  Lines       70028    70220   +192     
  Branches    13160    13172    +12     
========================================
+ Hits        19718    19773    +55     
- Misses      48751    48882   +131     
- Partials     1559     1565     +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This comment was marked as off-topic.

@vleague2 vleague2 changed the title testing icon sizes [CL-221] Add chip-select component May 3, 2024
@willmartian willmartian marked this pull request as ready for review May 22, 2024 02:17
@willmartian willmartian requested a review from a team as a code owner May 22, 2024 02:17
@willmartian willmartian removed the needs-qa Marks a PR as requiring QA approval label May 22, 2024
@willmartian willmartian self-assigned this May 22, 2024
@danielleflinn danielleflinn self-requested a review May 22, 2024 19:06
danielleflinn
danielleflinn previously approved these changes May 22, 2024
Copy link
Member

@danielleflinn danielleflinn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For an initial commit this looks good.

In Figma I have the chip text-size as body2. We might want to update that now since it doesn't rely on any new styles. But I'll leave that up to you @willmartian if you'd prefer to tackle it in the follow up one.

We should address the following in a followup PR:

  • chip focus state
  • chip styles for hover, pressed, and focused states
  • keyboard navigation and SR announcements
  • style updates that will happen as part of updates to the bit-menu

@willmartian
Copy link
Contributor

Thanks @danielleflinn! I went ahead and added a focus ring and updated the font size to use body2. Will finalize the other items in a separate ticket.

@danielleflinn
Copy link
Member

@willmartian I just noticed in the menu the list focus is only on the top of the item, but in the bit-menu story we have it on both the top and bottom. Is this expected? Will it be addressed in the follow up PR?
Screenshot 2024-05-22 at 2 44 25 PM

Copy link
Contributor Author

@vleague2 vleague2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ty for such beautiful work ✨ Here are a couple of questions!

libs/components/src/chip-select/chip-select.component.html Outdated Show resolved Hide resolved
libs/components/src/chip-select/chip-select.component.ts Outdated Show resolved Hide resolved
type="button"
[attr.aria-label]="'removeItem' | i18n: label"
[disabled]="disabled"
class="tw-bg-transparent hover:tw-bg-transparent tw-outline-none tw-rounded-full tw-p-1 tw-my-1 tw-mr-1 tw-text-[inherit] tw-border-solid tw-border tw-border-text-muted hover:tw-border-text-contrast hover:disabled:tw-border-transparent tw-aspect-square tw-flex tw-items-center tw-justify-center tw-h-fit focus-visible:tw-ring-2 tw-ring-text-contrast focus-visible:hover:tw-border-transparent"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The focus ring is kind of oblong?

Screenshot 2024-05-23 at 9 42 11 AM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, I am not seeing that in FF, but I am on Chrome. Will solve that in the follow up PR for CL-291.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That screenshot is from Chrome 😭

@willmartian
Copy link
Contributor

willmartian commented May 23, 2024

I just noticed in the menu the list focus is only on the top of the item, but in the bit-menu story we have it on both the top and bottom. Is this expected? Will it be addressed in the follow up PR?

@danielleflinn I believe this is a style bug with the menu component itself. I would like to care of that when we update menu styles in CL-237 if that is cool? (Also, the focus rings in the menu component are also not up to spec on main.)

Copy link
Contributor Author

@vleague2 vleague2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ This is me symbolically approving the PR because I can't actually approve it since I own it

Copy link
Contributor

@willmartian willmartian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, amazing work

Copy link
Contributor

@willmartian willmartian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh actually, it looks like the menu changes here introduces a regression in the product switcher. Gonna fix this real quick.

edit: fixed in 4bd0d15

image

Copy link
Contributor Author

@vleague2 vleague2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Width changes look good

@willmartian willmartian merged commit 08a6f91 into main May 23, 2024
62 checks passed
@willmartian willmartian deleted the ps/cl-221/chip-select branch May 23, 2024 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants