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

Add Card.Icon #243

Merged
merged 24 commits into from
Apr 26, 2023
Merged

Add Card.Icon #243

merged 24 commits into from
Apr 26, 2023

Conversation

josepmartins
Copy link
Contributor

@josepmartins josepmartins commented Apr 21, 2023

Summary

Add Card.Icon to the Card component. This allows using Octicons in the Card component to fit future and existing use cases.

Icon

Icon + Label

List of notable changes:

  • added Icon as part of the composable API
  • added a shared color constants to retrofit Card and Label usage.
  • updated Card layout to use grid-template-areas for the Icon + Label combination
  • updated Card documentation
  • added new stories and tests coverage

What should reviewers focus on?

Steps to test:

Supporting resources (related issues, external links, etc):

Contributor checklist:

  • All new and existing CI checks pass
  • Tests prove that the feature works and covers both happy and unhappy paths
  • Any drop in coverage, breaking changes or regressions have been documented above
  • New visual snapshots have been generated / updated for any UI changes
  • All developer debugging and non-functional logging has been removed
  • Related issues have been referenced in the PR description

Reviewer checklist:

  • Check that pull request and proposed changes adhere to our contribution guidelines and code of conduct
  • Check that tests prove the feature works and covers both happy and unhappy paths
  • Check that there aren't other open Pull Requests for the same update/change

Screenshots:

Please try to provide before and after screenshots or videos

Before After

@changeset-bot
Copy link

changeset-bot bot commented Apr 21, 2023

🦋 Changeset detected

Latest commit: 84cb913

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@primer/react-brand Patch
@primer/brand-primitives Patch
@primer/brand-e2e Patch
@primer/brand-fonts Patch
@primer/brand-config Patch
@primer/brand-storybook Patch

Not sure what this means? Click here to learn what changesets are.

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

@josepmartins josepmartins changed the title Josepmartins/add card icon Add Card Icon Apr 21, 2023
@josepmartins josepmartins self-assigned this Apr 21, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 21, 2023

🔍 Design token changes found

View CSS variable changes
- --brand-Label-color-default: var(--base-color-scale-blue-5);
+ --brand-Label-color-default: var(--brand-color-text-default);
- --brand-Label-color-default: var(--base-color-scale-blue-4);
+ --brand-Label-color-default: var(--brand-color-text-default);
- --brand-Label-color-default: var(--base-color-scale-blue-5);
+ --brand-Label-color-default: var(--brand-color-text-default);

@github-actions
Copy link
Contributor

github-actions bot commented Apr 21, 2023

⚠️ Visual differences found

Our visual comparison tests found UI differences.

Please review the differences by using the test artifacts to ensure that the changes were intentional.

Artifacts can be downloaded and reviewed locally.

Download links are available at the bottom of the workflow summary screen.

Example:

artifacts section of workflow run

If the changes are expected, please run npm run test:visual:update-snapshots to replace the previous fixtures.

Review visual differences

@josepmartins josepmartins temporarily deployed to github-pages April 21, 2023 13:01 — with GitHub Actions Inactive
@josepmartins josepmartins temporarily deployed to github-pages April 21, 2023 13:16 — with GitHub Actions Inactive
@josepmartins josepmartins temporarily deployed to github-pages April 21, 2023 14:36 — with GitHub Actions Inactive
@josepmartins josepmartins added the enhancement New feature or request label Apr 24, 2023
@josepmartins josepmartins marked this pull request as ready for review April 24, 2023 14:49
@josepmartins josepmartins temporarily deployed to github-pages April 24, 2023 14:58 — with GitHub Actions Inactive
@josepmartins josepmartins temporarily deployed to github-pages April 24, 2023 15:17 — with GitHub Actions Inactive
@josepmartins josepmartins temporarily deployed to github-pages April 25, 2023 07:36 — with GitHub Actions Inactive
Copy link
Contributor

@danielguillan danielguillan left a comment

Choose a reason for hiding this comment

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

Looking good!

.changeset/curly-parents-develop.md Outdated Show resolved Hide resolved
apps/docs/content/components/Card.mdx Outdated Show resolved Hide resolved
@josepmartins josepmartins temporarily deployed to github-pages April 25, 2023 13:27 — with GitHub Actions Inactive
<Card href="https://github.com">
<Card.Icon
icon={
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="20" height="20">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be 24x24?

Copy link
Collaborator

@rezrah rezrah left a comment

Choose a reason for hiding this comment

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

This looks great @josepmartins. Left some 💬 but also pre-emptively approving.

One additional comment: Can we add a playground to Storybook now? With the color variations to Card.Icon and Card.Label, I think it would be helpful to users if they can toggle and preview the colors in Storybook.

Also FYI that your snapshots are out-of-date.

Josep Martins and others added 5 commits April 25, 2023 16:21
@josepmartins josepmartins temporarily deployed to github-pages April 25, 2023 14:31 — with GitHub Actions Inactive
@josepmartins josepmartins temporarily deployed to github-pages April 25, 2023 20:42 — with GitHub Actions Inactive
@josepmartins
Copy link
Contributor Author

@rezrah thank you!

I've added a basic Playground for icon and label colors, happy to iterate on upcoming PR's if needed: https://primer-e75d38a33c-26139705.drafts.github.io/storybook/?path=/story/components-card--playground

@egim I've introduced some changes on the Card inner layout and tested using the Stack component, it should work fine out of the box even when Cards have different content or line lenght. Let me know if you have questions.

Stacked example: https://primer-e75d38a33c-26139705.drafts.github.io/storybook/?path=/story/components-card-features--stacked

Screenshot 2023-04-26 at 08 22 33

@josepmartins josepmartins merged commit 9c479f9 into main Apr 26, 2023
@josepmartins josepmartins deleted the josepmartins/add-card-icon branch April 26, 2023 06:24
@primer-css primer-css mentioned this pull request Apr 26, 2023
@josepmartins josepmartins changed the title Add Card Icon Add Card.Icon Apr 27, 2023
@egim
Copy link

egim commented Apr 27, 2023

@egim I've introduced some changes on the Card inner layout and tested using the Stack component, it should work fine out of the box even when Cards have different content or line lenght. Let me know if you have questions.

This is wonderful, we will utilize very soon. Thank you @josepmartins! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request update snapshots
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants