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

FCT 1079 - filters Chip #2937

Merged
merged 5 commits into from
Oct 7, 2024
Merged

FCT 1079 - filters Chip #2937

merged 5 commits into from
Oct 7, 2024

Conversation

ByronDWall
Copy link
Contributor

@ByronDWall ByronDWall commented Oct 2, 2024

This PR implements the Chip component with necessary styles and state as specified in figma.

The Chip is implemented as an li, and should be used as a child of a ul component, as it is meant to list the selected filter values in a FilterMenu.

Component Enhancements:

  • Chip Component: Refactored to accept label and isDisabled props, and styled using @commercetools-uikit/design-system and @emotion/react.
  • FilterMenu Chip Test: Updated the test for the Chip component to check for the label prop and role attribute.

PLEASE NOTE: The Filters storybook must be updated to have a local-dev tag before merging this PR to main so that the Filters docs do not get published to the prod site, these docs are published for this PR as a courtesy to the reviewers.

Chip can be seen here

@ByronDWall ByronDWall requested a review from FilPob October 2, 2024 16:34
@ByronDWall ByronDWall self-assigned this Oct 2, 2024
@ByronDWall ByronDWall requested a review from a team as a code owner October 2, 2024 16:34
@ByronDWall ByronDWall requested review from stephsprinkle, jaikamat, ddouglasz, tylermorrisford and misama-ct and removed request for a team October 2, 2024 16:34
Copy link

changeset-bot bot commented Oct 2, 2024

⚠️ No Changeset found

Latest commit: aa7adc2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Oct 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ui-kit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 7, 2024 2:10pm

Copy link
Contributor

@jaikamat jaikamat left a comment

Choose a reason for hiding this comment

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

Looks like it does the thing!

@FilPob
Copy link

FilPob commented Oct 4, 2024

@ByronDWall thanks! I just realized we introduced color-neutral-50 recently. Could we please use it for the font color when disabled? That makes it a bit more readable also in the disabled state.

@FilPob
Copy link

FilPob commented Oct 4, 2024

and one more tiny thing. In the designs the overall height is 24px, in the PR it's 22

Copy link
Contributor

@ddouglasz ddouglasz left a comment

Choose a reason for hiding this comment

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

Left a really tiny nit. Otherwise 👌🏽

return (
<>
<div>{props.label}</div>
<ul style={{ display: 'flex', gap: '8px' }}>
Copy link
Contributor

@ddouglasz ddouglasz Oct 4, 2024

Choose a reason for hiding this comment

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

Do you think we should use spacing20 here?

Suggested change
<ul style={{ display: 'flex', gap: '8px' }}>
<ul style={{ display: 'flex', gap: designTokens.spacing20 }}>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, but jsyk, this code is meant to be temporary

color: ${designTokens.colorPrimary20};
background-color: ${designTokens.colorPrimary95};
padding: 0 ${designTokens.spacing20};
border-radius: calc(
Copy link
Contributor

Choose a reason for hiding this comment

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

smooth!

@ByronDWall
Copy link
Contributor Author

@FilPob how do you feel about using colorNeutral40 instead of colorNeutral50?

colorNeutral40 meets AA accessibility contrast ratio guidelines:
Screenshot 2024-10-04 at 9 15 44 AM

while colorNeutral50 does not:
Screenshot 2024-10-04 at 9 16 14 AM

@FilPob
Copy link

FilPob commented Oct 4, 2024

@ByronDWall yeah lets do that! thanks

@ByronDWall
Copy link
Contributor Author

@FilPob height and colors should now be as specified, thx!

@ByronDWall ByronDWall enabled auto-merge (squash) October 7, 2024 14:02
@ByronDWall ByronDWall merged commit 73f1f8e into main Oct 7, 2024
6 of 7 checks passed
@ByronDWall ByronDWall deleted the FCT-1078-chip branch October 7, 2024 14:08
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.

6 participants