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

feat(radio): adding new colors, type, and size tokens, invalid state, WHCM #3555

Open
wants to merge 9 commits into
base: spectrum-two
Choose a base branch
from

Conversation

aramos-adobe
Copy link
Collaborator

@aramos-adobe aramos-adobe commented Feb 13, 2025

Radio S2 Migration

Updates:

  • Now has an invalid/error state
  • High contrast tokens have been modified
  • Typography tokens modified

New tokens

--spectrum-radio-invalid-color-default
--spectrum-radio-invalid-color-hover
--spectrum-radio-invalid-color-down
--spectrum-radio-invalid-color-key-focus
--spectrum-radio-border-width
--spectrum-radio-text-font-weight
--spectrum-radio-text-font-style

Modified tokens

--spectrum-radio-emphasized-accent-color
--spectrum-radio-emphasized-accent-color-hover
--spectrum-radio-emphasized-accent-color-down
--spectrum-radio-emphasized-accent-color-focus

Validation steps

  • Review Radio story
  • Review test environment
Screenshot 2025-02-25 at 12 54 47 PM Screenshot 2025-02-13 at 4 05 05 PM

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 Feb 13, 2025

🦋 Changeset detected

Latest commit: ccb1d52

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

This PR includes changesets to release 2 packages
Name Type
@spectrum-css/radio Major
@spectrum-css/helptext Minor

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

@aramos-adobe aramos-adobe changed the base branch from spectrum-2 to spectrum-two February 13, 2025 19:45
Copy link
Contributor

github-actions bot commented Feb 13, 2025

File metrics

Summary

Total size: 1.37 MB*
No change in file sizes

Package Size Minified Gzipped
helptext 7.13 KB 6.83 KB 1.09 KB
radio 17.86 KB 16.95 KB 2.39 KB

File change details

helptext

Filename Head Minified Gzipped Compared to base
index.css 7.13 KB 6.83 KB 1.09 KB 🔴 ⬆ 0.02 KB
metadata.json 3.31 KB - - -

radio

Filename Head Minified Gzipped Compared to base
index.css 17.86 KB 16.95 KB 2.39 KB 🔴 ⬆ 2.62 KB
metadata.json 9.92 KB - - 🔴 ⬆ 1.27 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 Feb 13, 2025

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

@aramos-adobe aramos-adobe force-pushed the aramos-adobe/css712-radio-group-s2-migration branch from 8dee413 to a46599d Compare February 13, 2025 20:07
@aramos-adobe aramos-adobe self-assigned this Feb 13, 2025
@castastrophe castastrophe force-pushed the spectrum-two branch 5 times, most recently from d5e72d4 to 0f14273 Compare February 24, 2025 22:39
@aramos-adobe aramos-adobe force-pushed the aramos-adobe/css712-radio-group-s2-migration branch from 0704a09 to 63b2cc9 Compare February 25, 2025 17:49
@aramos-adobe aramos-adobe force-pushed the aramos-adobe/css712-radio-group-s2-migration branch from 8e3b47f to 75c6f2b Compare March 3, 2025 15:25
Copy link
Collaborator

@jawinn jawinn left a comment

Choose a reason for hiding this comment

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

Nice work. Visually everything is looking good to me.
Just a few suggestions here that are mostly Storybook related.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add a new docs only "Invalid" story with documentation? With this I'd mention the .is-invalid class that the implementation would apply.

Comment on lines 45 to 48
{
testHeading: "Invalid",
isInvalid: true,
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice additions to the tests.

There are a few combinations I can see aren't covered in the testing grid yet, that I'd suggest also adding:

  • invalid + checked
  • disabled + checked
  • read-only + checked

Comment on lines -155 to -158
"--spectrum-neutral-background-color-selected-default",
"--spectrum-neutral-background-color-selected-down",
"--spectrum-neutral-background-color-selected-hover",
"--spectrum-neutral-background-color-selected-key-focus",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I still see these on the token specs under "Radio button token changes", but it looks like that part of the Figma might be wrong, and they're actually neutral-content-color tokens now according to the other section of the Figma? The design team may need to update that.

@@ -37,6 +37,7 @@ export default {
control: { type: "text" },
},
isEmphasized,
isInvalid,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd also import and add isFocused here, along with a default arg value of false, since that's being used now.

isHovered: true,
},
{
testHeading: "Focus",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
testHeading: "Focus",
testHeading: "Focus-visible",

Comment on lines 65 to 70
@focusin=${function() {
updateArgs({ isFocused: true });
}}
@focusout=${function() {
updateArgs({ isFocused: false });
}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
@focusin=${function() {
updateArgs({ isFocused: true });
}}
@focusout=${function() {
updateArgs({ isFocused: false });
}}

I'd recommend removing this, as it will show the focus ring on click in the Default story. It should only show on tab focus. That's because these events are different behavior than the :focus-visible in our styles.

@aramos-adobe aramos-adobe requested a review from jawinn March 6, 2025 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants