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

Icon: Add Compact Icons #3771

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

rlingineni
Copy link
Contributor

@rlingineni rlingineni commented Sep 20, 2024

Pull Request Instructions

Init add of new compact icons.

This also moves all icons to a new InternalIcon that supports component icons. You can now use these in the badge component to consume the icons at 16x16 ratios as needed.

There is a new public IconCompact that can also be used for compact icons

Checklist

  • Added unit tests
  • Added documentation + accessibility tests
  • Verified accessibility: keyboard & screen reader interaction
  • Checked dark mode, responsiveness, and right-to-left support
  • Checked stakeholder feedback (e.g. Gestalt designers, relevant feature teams)

@rlingineni rlingineni requested a review from a team as a code owner September 20, 2024 22:11
Copy link

netlify bot commented Sep 20, 2024

Deploy Preview for gestalt ready!

Name Link
🔨 Latest commit 7781b83
🔍 Latest deploy log https://app.netlify.com/sites/gestalt/deploys/671194e90ceb3600087e8633
😎 Deploy Preview https://deploy-preview-3771--gestalt.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@AlbertCarreras
Copy link
Contributor

This icons look incorrect.
Screenshot by Dropbox Capture

@AlbertCarreras
Copy link
Contributor

They should be 24-24 and we can adjust size internally. This should be just moving them out to an internal folder and removing them from the index,

@rlingineni rlingineni changed the title Icons: Add badge-icons Icon: Add badge-icons Oct 8, 2024
@rlingineni rlingineni added the minor release Minor release label Oct 8, 2024
Copy link
Contributor

@AlbertCarreras AlbertCarreras left a comment

Choose a reason for hiding this comment

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

Run yarn tsc please before merging. LGTM

@@ -0,0 +1,5 @@
{
"rules": {
"max-len": 0
Copy link
Contributor

Choose a reason for hiding this comment

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

just curious, what does this rule do? (in the context of this PR)

Copy link
Contributor

@diyorbek diyorbek left a comment

Choose a reason for hiding this comment

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

LGTM

@rlingineni rlingineni changed the title Icon: Add badge-icons Icon: Add Compact Icons Oct 16, 2024
*
* See the [size](https://gestalt.pinterest.systems/web/icon#Size) variant to learn more.
*/
size?: number | string;
Copy link
Contributor

@AlbertCarreras AlbertCarreras Oct 17, 2024

Choose a reason for hiding this comment

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

shouldn't we limit size here?, otherwise we are on the same place

Copy link
Contributor

Choose a reason for hiding this comment

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

they should be '16' the only accepted value for now

Copy link
Contributor Author

@rlingineni rlingineni Oct 17, 2024

Choose a reason for hiding this comment

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

I thought this size is different afaik. This is the SVG height/width. But what we mean by compact Icons is that they are thinner (they can in theory be scaled up) to larger viewboxes.

image

Copy link
Contributor Author

@rlingineni rlingineni Oct 17, 2024

Choose a reason for hiding this comment

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

But maybe you are right in that they should be fixed - I guess we should force them to be 16x16 to limit usage

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed

| 'light'
| 'dark';

type IconName = keyof typeof icons | keyof typeof compactIconsVR | keyof typeof compactIconsClassic;
Copy link
Contributor

Choose a reason for hiding this comment

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

type IconName = keyof typeof icons | keyof typeof compactIconsVR | keyof typeof compactIconsClassic;

do we need : | keyof typeof compactIconsClassic;?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess all VR icons will contain classic right? So maybe you are correct that we don't need this

@@ -222,6 +223,20 @@ Should be used sparingly and only in places where the UI is very dense and a lar
title="Custom SVG icon"
/>
</MainSection.Subsection>
<MainSection.Subsection
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we do a follow up PR adding a single page for IconCompact?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes - I think we should. I wanted to wait since there's not too many right now. and it's a replica of Icon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor release Minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants