-
Notifications
You must be signed in to change notification settings - Fork 201
feat(icons)!: s2 icons - use latest workflow and ui icon sets #3001
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
0b9cb8f
feat(icon): updated s2 icons - workflow and ui
jawinn 34759e4
build(storybook): use latest 4.0.0 version of workflow icons
jawinn 3d78c7c
feat(icon): remove guessing of icon set if not provided
jawinn 9a0bb4d
refactor(icon): clean up some logic in icon template
jawinn 48e507f
fix(icon): fix non-ref svg file loading and some missing icons
jawinn eb30536
chore: ui-icons dist should not be ignored
jawinn afa9935
feat(icon): remove new ui icons not yet ready for production
jawinn 8b4839a
feat(icon): exclude 22x20 workflow icons
jawinn 7a8e705
refactor(icon): simplify icon data fetching in icon template
jawinn 8188445
docs(icon): update docs with some wording suggestions
jawinn a1ddd79
docs(icon): fix fill color storybook control when using reference
jawinn 976bfd3
docs(icon): icon list stories - dynamic columns and remove from vrt
jawinn 168a4ce
docs(icon): add chromatic-ignore classes to test templates
jawinn 82080bd
docs(icon): minor icon documentation updates
jawinn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
"@spectrum-css/preview": major | ||
--- | ||
|
||
Updates Storybook to use the latest icon sets for Spectrum 2. Includes changes to the directories that | ||
are used for loading in the sprite sheet and the individual icons, as they have moved. | ||
|
||
The global Icon Loader has been updated to apply the existing key name renaming from file names to icon | ||
names. This is now done once at the loader step, rather than each time within the Icon component template. | ||
The loader also now excludes the handful of 22x20 workflow icons, as these are not yet handled within the | ||
design system. |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
"@spectrum-css/ui-icons": major | ||
--- | ||
|
||
# Breaking change | ||
|
||
Iconography in v1 inclued 2 sizes, `medium` and `large`, as well as a single SVG asset that included both versions to be toggled with classes via CSS (found in folder`combined`). Icons in v2 no longer have multiple sizes and all assets are sourced from a single folder`svg` which can be found in the `dist` directory of this workspace. **Raw SVG assets can no longer be sourced from the top-level of the workspace and must be loaded from `@spectrum-css/ui-icons/dist/svg/*.svg` instead.** Please find below an outline of the new, deprecated, and unchanged icons. | ||
|
||
| Icon name | Migration notes | | ||
| ----------------- | --------------- | | ||
| Arrow75 | Deprecated | | ||
| Arrow100 | - | | ||
| Arrow200 | Deprecated | | ||
| Arrow300 | Deprecated | | ||
| Arrow400 | - | | ||
| Arrow500 | Deprecated | | ||
| Arrow600 | Deprecated | | ||
| Asterisk75 | Deprecated | | ||
| Asterisk100 | - | | ||
| Asterisk200 | - | | ||
| Asterisk300 | - | | ||
| Checkmark50 | - | | ||
| Checkmark75 | - | | ||
| Checkmark100 | - | | ||
| Checkmark200 | - | | ||
| Checkmark300 | - | | ||
| Checkmark400 | - | | ||
| Checkmark500 | Deprecated | | ||
| Checkmark600 | Deprecated | | ||
| Chevron50 | - | | ||
| Chevron75 | - | | ||
| Chevron100 | - | | ||
| Chevron200 | - | | ||
| Chevron300 | - | | ||
| Chevron400 | - | | ||
| Chevron500 | Deprecated | | ||
| Chevron600 | Deprecated | | ||
| CornerTriangle75 | - | | ||
| CornerTriangle100 | - | | ||
| CornerTriangle200 | - | | ||
| CornerTriangle300 | - | | ||
| Cross75 | - | | ||
| Cross100 | - | | ||
| Cross200 | - | | ||
| Cross300 | - | | ||
| Cross400 | - | | ||
| Cross500 | - | | ||
| Cross600 | - | | ||
| Dash50 | - | | ||
| Dash75 | - | | ||
| Dash100 | - | | ||
| Dash200 | - | | ||
| Dash300 | - | | ||
| Dash400 | Deprecated | | ||
| Dash500 | Deprecated | | ||
| Dash600 | Deprecated | | ||
| SingleGripper | Deprecated | | ||
| DoubleGripper | Deprecated | | ||
| TripleGripper | Deprecated | |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@spectrum-css/icon": major | ||
--- | ||
|
||
Updates the icon component to use the new Spectrum 2 icon sets. The `.spectrum-UIIcon--medium` and `.spectrum-UIIcon--large` classes have been removed, as UI icons are now delivered with a single SVG. The color property also now makes use of the `--iconPrimary` custom property that is defined in some of the SVG files. Storybook has been updated to use and load the new SVGs, whose name format and directories have changed. |
This file contains hidden or 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 file contains hidden or 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 file contains hidden or 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 file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,55 @@ | ||
export const IconLoader = async () => ({ | ||
icons: { | ||
workflow: { | ||
medium: await import.meta.glob( | ||
"/node_modules/@adobe/spectrum-css-workflow-icons/dist/18/*.svg", | ||
import { cleanUiIconName, cleanWorkflowIconName } from "@spectrum-css/icon/stories/utilities.js"; | ||
|
||
/** | ||
* Loads all SVG files from both icon sets, and stores a string with the SVG markup. | ||
* | ||
* Excludes "22x20" workflow icons as they are not yet used within the design system. | ||
* | ||
* @see https://storybook.js.org/docs/writing-stories/loaders | ||
* @see https://vite.dev/guide/features#glob-import | ||
*/ | ||
export const IconLoader = async () => { | ||
let iconData = { | ||
icons: { | ||
workflow: await import.meta.glob( | ||
[ | ||
"/node_modules/@adobe/spectrum-css-workflow-icons/dist/assets/svg/*.svg", | ||
"!/node_modules/@adobe/spectrum-css-workflow-icons/dist/assets/svg/*_22x20*.svg", | ||
], | ||
jawinn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
eager: true, | ||
query: "?raw", | ||
import: "default", | ||
} | ||
), | ||
large: await import.meta.glob( | ||
"/node_modules/@adobe/spectrum-css-workflow-icons/dist/24/*.svg", | ||
ui: await import.meta.glob( | ||
"/node_modules/@spectrum-css/ui-icons/dist/svg/*.svg", | ||
{ | ||
eager: true, | ||
query: "?raw", | ||
import: "default", | ||
} | ||
), | ||
}, | ||
ui: { | ||
medium: await import.meta.glob( | ||
"/node_modules/@spectrum-css/ui-icons/dist/medium/*.svg", | ||
{ | ||
eager: true, | ||
query: "?raw", | ||
import: "default", | ||
} | ||
), | ||
large: await import.meta.glob( | ||
"/node_modules/@spectrum-css/ui-icons/dist/large/*.svg", | ||
{ | ||
eager: true, | ||
query: "?raw", | ||
import: "default", | ||
} | ||
), | ||
}, | ||
}, | ||
}); | ||
}; | ||
|
||
/** | ||
* Changes all keys in the IconLoader object to be just the cleaned icon name used within our Storybook's Icon component, | ||
* instead of the full file name and directory that was loaded. | ||
jawinn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* | ||
* E.g. "/node_modules/@adobe/spectrum-css-workflow-icons/dist/assets/svg/S2_Icon_3DAsset_20_N.svg" would become just "3DAsset". | ||
*/ | ||
iconData.icons.workflow = Object.fromEntries( | ||
Object.entries(iconData.icons.workflow).map( | ||
([key, value]) => [cleanWorkflowIconName(key.split("/").pop()), value] | ||
) | ||
); | ||
|
||
iconData.icons.ui = Object.fromEntries( | ||
Object.entries(iconData.icons.ui).map( | ||
([key, value]) => [cleanUiIconName(key.split("/").pop()), value] | ||
) | ||
); | ||
|
||
return iconData; | ||
}; |
This file contains hidden or 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 file contains hidden or 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 file contains hidden or 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 file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.