-
Notifications
You must be signed in to change notification settings - Fork 198
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
base: spectrum-two
Are you sure you want to change the base?
feat(radio): adding new colors, type, and size tokens, invalid state, WHCM #3555
Conversation
🦋 Changeset detectedLatest commit: ccb1d52 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
File metricsSummaryTotal size: 1.37 MB*
File change detailshelptext
radio
* An ASCII character in UTF-8 is 8 bits or 1 byte. |
🚀 Deployed on https://pr-3555--spectrum-css.netlify.app |
8dee413
to
a46599d
Compare
d5e72d4
to
0f14273
Compare
0704a09
to
63b2cc9
Compare
3499231
to
ad861d0
Compare
8e3b47f
to
75c6f2b
Compare
There was a problem hiding this 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.
There was a problem hiding this comment.
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.
{ | ||
testHeading: "Invalid", | ||
isInvalid: true, | ||
} |
There was a problem hiding this comment.
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
"--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", |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testHeading: "Focus", | |
testHeading: "Focus-visible", |
components/radio/stories/template.js
Outdated
@focusin=${function() { | ||
updateArgs({ isFocused: true }); | ||
}} | ||
@focusout=${function() { | ||
updateArgs({ isFocused: false }); | ||
}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Radio S2 Migration
Updates:
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
Regression testing
Validate:
Screenshots
To-do list