-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(icons)!: s2 icons - use latest workflow and ui icon sets (#3001)
* feat(icon): updated s2 icons - workflow and ui Uses and updates to the latest icon sets for S2. ==== Workflow icons ==== Uses the latest version of this package. There is a large difference between the set of icons available for S1 and S2. These differences are documented separately from this work. ==== UI icons ==== Updates the ui-icons package with the latest set of icons. This includes deprecations and some new icons. See the change log for a full list of changes. The UI icons no longer contain both a medium and a large SVG asset. The file structure and loading have been changed to use the single asset. Co-authored-by: [ Cassondra ] <[email protected]> Also includes: * build(storybook): use latest 4.0.0 version of workflow icons * feat(icon): remove guessing of icon set if not provided * refactor(icon): refactors, cleans up, and documents template logic and utilities * feat(icon): exclude new ui icons not yet ready for production (CSS-1115) * feat(icon): exclude 22x20 workflow icons (CSS-1116)
- Loading branch information
1 parent
dce3669
commit a25e0a9
Showing
156 changed files
with
1,321 additions
and
881 deletions.
There are no files selected for viewing
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
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 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 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 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 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 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 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", | ||
], | ||
{ | ||
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. | ||
* | ||
* 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 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 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 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 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.