-
Notifications
You must be signed in to change notification settings - Fork 82
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: v5 icons #2647
Closed
Closed
feat: v5 icons #2647
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
denkristoffer
force-pushed
the
feat/icons-v5
branch
from
January 10, 2024 09:56
a21e68b
to
c9dfdf5
Compare
denkristoffer
force-pushed
the
feat/icons-v5
branch
from
January 10, 2024 10:25
c9dfdf5
to
919f5fc
Compare
denkristoffer
force-pushed
the
feat/icons-v5
branch
from
January 10, 2024 10:39
919f5fc
to
97288af
Compare
Closed
denkristoffer
force-pushed
the
feat/icons-v5
branch
from
January 11, 2024 09:17
97288af
to
f8a0b44
Compare
size-limit report 📦
|
denkristoffer
force-pushed
the
feat/icons-v5
branch
from
January 11, 2024 09:50
d58b1ba
to
4cf7dc4
Compare
denkristoffer
force-pushed
the
feat/icons-v5
branch
from
January 11, 2024 10:33
4cf7dc4
to
d706d0e
Compare
denkristoffer
force-pushed
the
feat/icons-v5
branch
from
January 11, 2024 12:16
d706d0e
to
4b76968
Compare
denkristoffer
force-pushed
the
feat/icons-v5
branch
from
January 11, 2024 12:29
4b76968
to
ed3b8fc
Compare
cf-remylenoir
force-pushed
the
feat/icons-v5
branch
from
June 14, 2024 15:13
326366a
to
1f83157
Compare
massao
force-pushed
the
feat/icons-v5
branch
2 times, most recently
from
June 17, 2024 12:13
10f610a
to
b8af06d
Compare
I'm closing this for the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose of PR
Forma 36 v5 icons alpha.
Storybook here: https://5fd1dda724cc620021ace8c5-xtuzuwaspq.chromatic.com/?path=/story/components-icons--overview
How to review
Most of the changed files are deletions of the old icons. Actual changes are the following files:
Click to see the list
packages/components/icon/src/Icon.tsx
packages/components/icon/src/types.ts
packages/components/icon/src/utils/generateComponentWithVariants.ts
packages/components/icon/src/utils/generateForma36Icon.tsx
packages/components/icon/src/utils/generateIconComponent.tsx
packages/components/icon/src/utils/wrapPhosphorIcon.tsx
packages/components/icons/src/PhosphorIcons.tsx
packages/components/icons/src/EmbeddedBlockIcon.tsx
packages/components/icons/src/EmbeddedLineIcon.tsx
packages/components/icons/src/EntryIcon.tsx
packages/components/icons/src/EnvironmentAliasIcon.tsx
packages/components/icons/src/EnvironmentIcon.tsx
packages/components/icons/src/ReleaseIcon.tsx
packages/components/icons/src/RichTextIcon.tsx
packages/components/icons/src/TextSubscriptIcon.tsx
packages/components/icons/src/TextSuperscriptIcon.tsx
packages/components/icons/src/WorkflowsIcon.tsx
What's new
color
prop where you can use our tokens.trimmed
prop is gone too!isActive
prop that renders an active state. This state has a filled look, entirely different from the default icon.Approach
Generation & utils
This is a full implementation of the proposal from #2637. It adds a few icon utility functions we can use going forward.
generateIconComponent
is basically our existinggenerateIcon
function, it returns aBox
component with an SVG tag.generateComponentWithVariants
makes it easier to create a component that returns different sub-components based on which variant you pass the original component. This let's us return one type of icon when theisActive
prop istrue
an another type of icon when it'sfalse
. This function can be extended in the future if we need to support other variants.wrapPhosphorIcon
is a function that takes an icon imported from@phosphor-icons/react
, wraps it in our ownIcon
component, and makes sure to pass the necessary props to the Phosphor icon when we want to override size or colour.generateForma36Icon
is the last level abstraction needed. It takes an icon imported from@phosphor-icons/react
and useswrapPhosphorIcon
andgenerateComponentWithVariants
to create a fully-fledged icon component that behaves as our own icons do.Package compiling/build
Unless changed before we merge this work, changes were made for the
icon
andicons
packages and documented here 0b047d5#diff-40f60e1037245d7b8a98a7325d53890a717da9979adeb54a61a795c4ba07f9c9