Skip to content

feat(icon, ui-icons): add missing ui icons and sizing classes #3866

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 4 commits into from
May 29, 2025

Conversation

rise-erpelding
Copy link
Collaborator

@rise-erpelding rise-erpelding commented May 29, 2025

Description

Newly added S2 UI icons did not yet have tokens available for their sizes (that define width/height for both platform scales). This work adds these icons back (they had previously been added in a commit on #3001) and adds the tokens to their respective CSS classes now that they are available.

The tokens added here are:

  • add-icon-size-50
  • add-icon-size-75
  • add-icon-size-100
  • add-icon-size-200
  • add-icon-size-300
  • drag-handle-icon-size-75
  • drag-handle-icon-size-100
  • drag-handle-icon-size-200
  • drag-handle-icon-size-300
  • gripper-icon-size-100
  • link-out-icon-size-100
  • link-out-icon-size-200
  • link-out-icon-size-300
  • link-out-icon-size-400

NOTE: It appears that link-out-icon-size-75 is missing from this list and should have been included (it's needed for the small sized menu linkout). It does not appear to be in the same a4u package that the other UI icons came from (even on the latest version), so it may need to be added. A follow-up ticket has been created for this work and linked to the appropriate existing follow-up tickets for the menu component's S2 migration, see CSS-1221.

CSS-1194

How and where has this been tested?

Please tag yourself on the tests you've marked complete to confirm the tests have been run by someone other than the author.

Validation steps

  • Confirm that the code updates to the ui-icons package (use the "Display the source diff" option) are the inverse of the commit where they were removed. (The changeset is different, however; I've created a new changeset for ui-icons for this work.) [@cdransf]
  • Pull the branch down locally. Run yarn nx reset before yarn install and yarn start to ensure that icons rebuild properly. [@cdransf]
  • Check that the added UI icons from the list in the PR description appear on the Icon/Ui Icons story in the local build as well as the PR preview. [@cdransf]
  • Inspect the added UI icons to confirm that they are using the appropriate size token for each (--spectrum-add-icon-size-50, --spectrum-add-icon-size-75, etc.). You can also compare this to the S2 token spec (on the "S2 Foundational tokens" page) to confirm that the sizes for medium/large contexts are rendering appropriately. [@cdransf]

Regression testing

Validate:

  1. The documentation pages for at least two other components are still loading, including:
  • The pages render correctly, are accessible, and are responsive.
  1. If components have been modified, VRTs have been run on this branch:
  • VRTs have been run and looked at.
  • Any VRT changes have been accepted (by reviewer and/or PR author), or there are no changes.

Screenshots

To-do list

  • I have read the contribution guidelines.
  • I have updated relevant storybook stories and templates.
  • I have tested these changes in Windows High Contrast mode.
  • If my change impacts other components, I have tested to make sure they don't break.
  • If my change impacts documentation, I have updated the documentation accordingly.
  • ✨ This pull request is ready to merge. ✨

Copy link

changeset-bot bot commented May 29, 2025

🦋 Changeset detected

Latest commit: 69b8f90

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

This PR includes changesets to release 3 packages
Name Type
@spectrum-css/icon Minor
@spectrum-css/ui-icons Minor
@spectrum-css/preview 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

Copy link
Contributor

github-actions bot commented May 29, 2025

File metrics

Summary

Total size: 1.42 MB*
No change in file sizes

Package Size Minified Gzipped
icon 12.65 KB 11.72 KB 1.56 KB

File change details

icon

Filename Head Minified Gzipped Compared to base
index.css 12.65 KB 11.72 KB 1.56 KB 🔴 ⬆ 1.27 KB
metadata.json 6.78 KB - - 🔴 ⬆ 1.01 KB

ui-icons

Filename Head Minified Gzipped Compared to base
icons.json 0.93 KB - - 🔴 ⬆ 0.27 KB
spectrum-css-icons.svg 14.50 KB - - 🔴 ⬆ 4.42 KB
svg/Add100.svg 0.25 KB - - 🆕 0.25 KB
svg/Add200.svg 0.32 KB - - 🆕 0.32 KB
svg/Add300.svg 0.32 KB - - 🆕 0.32 KB
svg/Add50.svg 0.31 KB - - 🆕 0.31 KB
svg/Add75.svg 0.27 KB - - 🆕 0.27 KB
svg/Arrow100.svg 0.56 KB - - -
svg/Arrow400.svg 0.35 KB - - -
svg/Asterisk100.svg 0.58 KB - - -
svg/Asterisk200.svg 0.58 KB - - -
svg/Asterisk300.svg 0.60 KB - - -
svg/Checkmark100.svg 0.29 KB - - -
svg/Checkmark200.svg 0.33 KB - - -
svg/Checkmark300.svg 0.36 KB - - -
svg/Checkmark400.svg 0.33 KB - - -
svg/Checkmark50.svg 0.31 KB - - -
svg/Checkmark75.svg 0.31 KB - - -
svg/Chevron100.svg 0.51 KB - - -
svg/Chevron200.svg 0.41 KB - - -
svg/Chevron300.svg 0.30 KB - - -
svg/Chevron400.svg 0.29 KB - - -
svg/Chevron50.svg 0.34 KB - - -
svg/Chevron75.svg 0.28 KB - - -
svg/CornerTriangle100.svg 0.25 KB - - -
svg/CornerTriangle200.svg 0.25 KB - - -
svg/CornerTriangle300.svg 0.26 KB - - -
svg/CornerTriangle75.svg 0.25 KB - - -
svg/Cross100.svg 0.36 KB - - -
svg/Cross200.svg 0.36 KB - - -
svg/Cross300.svg 0.36 KB - - -
svg/Cross400.svg 0.36 KB - - -
svg/Cross500.svg 0.38 KB - - -
svg/Cross600.svg 0.36 KB - - -
svg/Cross75.svg 0.34 KB - - -
svg/Dash100.svg 0.20 KB - - -
svg/Dash200.svg 0.23 KB - - -
svg/Dash300.svg 0.23 KB - - -
svg/Dash50.svg 0.23 KB - - -
svg/Dash75.svg 0.22 KB - - -
svg/DragHandle100.svg 0.50 KB - - 🆕 0.50 KB
svg/DragHandle200.svg 0.53 KB - - 🆕 0.53 KB
svg/DragHandle300.svg 0.53 KB - - 🆕 0.53 KB
svg/DragHandle75.svg 0.53 KB - - 🆕 0.53 KB
svg/Gripper100.svg 0.20 KB - - 🆕 0.20 KB
svg/LinkOut100.svg 0.32 KB - - 🆕 0.32 KB
svg/LinkOut200.svg 0.31 KB - - 🆕 0.31 KB
svg/LinkOut300.svg 0.31 KB - - 🆕 0.31 KB
svg/LinkOut400.svg 0.30 KB - - 🆕 0.30 KB
* Size is the sum of all main files for packages in the library.
* An ASCII character in UTF-8 is 8 bits or 1 byte.

Copy link
Contributor

github-actions bot commented May 29, 2025

🚀 Deployed on https://pr-3866--spectrum-css.netlify.app

@rise-erpelding rise-erpelding added ready-for-review S2 Spectrum 2 size-2 S ~6-18hrs; not hard or time consuming, one or two work days to complete. labels May 29, 2025
@rise-erpelding rise-erpelding self-assigned this May 29, 2025
@rise-erpelding rise-erpelding force-pushed the rise-erpelding/css-1194-new-ui-icons branch from 42d4e2c to 38d28cd Compare May 29, 2025 01:29
Comment on lines -174 to -176
return workflowIconsCleaned.sort().map((iconName) => IconWithLabelTemplate({ ...args, iconName }, context));
return workflowIconsCleaned.map((iconName) => IconWithLabelTemplate({ ...args, iconName }, context));
}, () => {
return uiIconsWithDirections.sort().map((iconName) => IconWithLabelTemplate({ ...args, uiIconName: iconName }, context));
Copy link
Collaborator Author

@rise-erpelding rise-erpelding May 29, 2025

Choose a reason for hiding this comment

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

I believe these two were already being sorted in a way that separates the icon name and numerical size (in components/icon/stories/utilities.js), so adding .sort() here was reverting the sorted icons list back to ASCII order (so that Add100 appears before Add50, for instance).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I know we haven't done releases for ui-icons or icon yet so the original changesets are still hanging out, if it's better to update those changesets instead of adding a new one, I'm happy to do that!

Copy link
Member

@cdransf cdransf left a comment

Choose a reason for hiding this comment

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

Ran through validation steps and everything looks good!✨

Copy link
Contributor

@5t3ph 5t3ph left a comment

Choose a reason for hiding this comment

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

🙌

@rise-erpelding rise-erpelding force-pushed the rise-erpelding/css-1194-new-ui-icons branch from 38d28cd to 69b8f90 Compare May 29, 2025 17:59
@rise-erpelding rise-erpelding merged commit 1b33315 into spectrum-two May 29, 2025
12 checks passed
@rise-erpelding rise-erpelding deleted the rise-erpelding/css-1194-new-ui-icons branch May 29, 2025 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-review S2 Spectrum 2 size-2 S ~6-18hrs; not hard or time consuming, one or two work days to complete.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants