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(actionbutton): s2 migration #2669

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

Conversation

mdt2
Copy link
Collaborator

@mdt2 mdt2 commented Apr 17, 2024

Waiting for S2 icons

Description

Migrates Action Button to Spectrum 2 design specifications. Includes:

  • Medium is now the default size and .spectrum-Switch--sizeM has been removed.
  • Includes the Spectrum 2 down state transform.
  • The component border was not removed to continue support for Windows High Contrast Mode (WHCM), but the color was adjusted to transparent and the mod custom properties were removed so as not to interfere with WHCM accessibility.
  • Background and content colors were updated.
  • Mod custom properties have been adjusted (find changes in actionbutton.yml)
  • Adjustment of Storybook testing preview to make Selected and Selected + Emphasized variants instead of states to test more cases

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

@jawinn

  • Compare ActionButton Storybook to the design specs to ensure correct tokens are used (S2 spec is above, but I also found this Figma file to be useful while making these changes)
  • StaticWhite and StaticBlack don't have an emphasized selected state and the emphasized control isn't shown on these stories
  • WHCM is looking good
  • Check that all variants and states are being shown in the testing preview (I rearranged some things to better align with this Figma file from design and surface the states for selected and selected + emphasized)
  • Design validation @mdt2

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.

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 documentation, I have updated the documentation accordingly.
  • ✨ This pull request is ready to merge. ✨

Copy link
Contributor

github-actions bot commented Apr 17, 2024

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

Copy link
Contributor

github-actions bot commented Apr 17, 2024

File metrics

Summary

Total size: 4.48 MB*
Total change (Δ): ⬇ 79.48 KB (-1.70%)

Table reports on changes to a package's main file. Other changes can be found in the collapsed Details section below.

Package Size Δ
actionbutton 23.75 KB ⬇ 17.86 KB

Details

actionbutton

File Head Base Δ
index-base.css 23.75 KB 30.54 KB ⬇ 6.78 KB (-22.21%)
index-vars.css 23.75 KB 41.61 KB ⬇ 17.86 KB (-42.91%)
index.css 23.75 KB 41.61 KB ⬇ 17.86 KB (-42.91%)
metadata.json 10.36 KB 17.66 KB ⬇ 7.30 KB (-41.32%)
index-theme.css - 11.65 KB 🚨 deleted, moved, or renamed
themes/express.css - 8.92 KB 🚨 deleted, moved, or renamed
themes/spectrum.css - 9.11 KB 🚨 deleted, moved, or renamed
* Size determined by adding together the size of the main file for all packages in the library.
* Results are not gzipped or minified.
* An ASCII character in UTF-8 is 8 bits or 1 byte.

@mdt2 mdt2 force-pushed the mdt2/css-739-s2-actionbutton branch from de5e49c to 6220dae Compare April 17, 2024 16:35
Comment on lines +78 to +80
isHovered: { table: { disable: true } },
isFocused: { table: { disable: true } },
isActive: { table: { disable: true } },
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jawinn curious if you think this could be a solve to your callout in my switch PR. This way, we hide these controls from the users so the classes don't get added in the markup unless the testing preview is turned on. So we maintain the current Chromatic coverage and users can still manually try out those hover and focus and active states.

I still don't think it's ideal to be adding classes that we don't support in the CSS and I'd be hesitant to start adding this on other PRs, but it solves the class problem here without changing coverage. My hope is that we can get some native focus and hover coverage in Chromatic without the classes. I think we have one or two cards on the board/in the backlog for that

Copy link
Collaborator

@jawinn jawinn Apr 18, 2024

Choose a reason for hiding this comment

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

I think this is a good solution!

This is probably the best option for now, AFAIK. The currently documented Chromatic way to to do focus uses play functions, which won't work well in the kitchen sink views where we can have multiple things that should show hover and focus at the same time. It looks like the only options for hover all involve styles/a class.

Copy link
Collaborator

@rise-erpelding rise-erpelding left a comment

Choose a reason for hiding this comment

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

Hi, this is looking really good!

  • S2 Token spec appears to match, mostly
    • The only thing I noticed here was that I didn't see a cjk line height being applied, and I think there is one in the spec
    • I also didn't look very closely at spacing since we'd previously talked about that not matching the spec, but I can if you'd like me to!
  • Static white and static black don't have emphasized styling/no control is visible in Storybook ✅
  • WHCM is looking good, both light and dark ✅
    • I did have a question though, there is no style differentiation for selected hover state as there is for non-forced-colors, it's the same purple/cyan color for selected as it is for selected & hover. It's already like this in prod, so nothing that was introduced here. Is that something that would be worthwhile to fix here, to give it a different border color or something like that on hover?
  • All variants and states are being shown in the testing preview ✅

@mdt2
Copy link
Collaborator Author

mdt2 commented Apr 18, 2024

Thanks Rise! To document some context here, when you say "didn't look very closely at spacing since we'd previously talked about that not matching the spec" we're talking about the top to edge spacing tokens, which don't seem to be needed since we're using display: flex. I also didn't make updates to the icon only spacing since visually it looks like the spec even though we're not using the spec tokens to avoid causing more work for SWC.

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.

Excellent work! ⭐ I did not notice any issues after going through the validation steps and comparing against the Figma.

components/actionbutton/metadata/actionbutton.yml Outdated Show resolved Hide resolved
@pfulton pfulton force-pushed the spectrum-two branch 2 times, most recently from f3dd9ff to 9931a8e Compare April 19, 2024 18:22
@castastrophe castastrophe force-pushed the spectrum-two branch 4 times, most recently from 8f768fd to 8768360 Compare April 26, 2024 18:31
pfulton and others added 12 commits April 26, 2024 16:37
Includes new color values for Spectrum 2
BREAKING CHANGE: migrates `Action Group` to Spectrum 2, Removes some mod properties
BREAKING CHANGE: migrates Button Group to Spectrum 2

Also:
* docs(buttongroup): expand chromatic coverage
* refactor(buttongroup): remove extra css classes
BREAKING CHANGE: uses Spectrum 2 tokens
 - @spectrum-css/preview@7.4.2-next.0
 - @spectrum-css/actiongroup@5.0.0-next.0
 - @spectrum-css/buttongroup@7.0.0-next.0
 - @spectrum-css/tokens@14.0.0-next.0
 - @spectrum-css/bundle-builder@6.3.1-next.0
 - @spectrum-css/component-builder-simple@5.0.1-next.0
 - @spectrum-css/component-builder@6.0.1-next.0
BREAKING CHANGE: migrates Close Button to Spectrum 2

Additionally:
* test: increase chromatic coverage
* fix(closebutton): pass staticColor as arg for SB display
* chore(closebutton): remove themes dir
* docs(closebutton): adds s2 migration notes
* chore(closebutton): specify s2 tokens release for dependency

---------

Co-authored-by: Patrick Fulton <pfulton@adobe.com>
* chore: migrate gray-50 to gray-25

Migrates any instance of `--spectrum-gray-50` to use
`--spectrum-gray-25` as per the S2 migration guide

* chore: migrate gray-75 to gray-50

Migrates usages of `--spectrum-gray-75` to use
`--spectrum-gray-50` as per the s2 migration guide.

* chore: migrate gray-100 to gray-75

Migrates usages of `--spectrum-gray-100` to use
`--spectrum-gray-75` as per the s2 migration guide

* chore: migrate gray-200 to gray-100

Migrates usages of `--spectrum-gray-200` to use
`--spectrum-gray-100` as per the s2 migration guide

* chore: migrate gray-300 to gray-200

Migrates usages of `--spectrum-gray-300` to use
`spectrum-gray-200` as per the s2 migration guide

* chore(infieldbutton): gray-300 to gray-200
mdt2 and others added 16 commits April 26, 2024 16:37
Remove dates from in front of version numbers on migration guides, as
we're adjusting to this format going forward. Includes removal of the
placeholder "x/x/2024" dates that were added. The button component
was excluded from this update as they're already removed in the button
s2 migration PR.
* feat(opacitycheckerboard): small t-shirt size squares
* docs(opacitycheckerboard): chromatic coverage for t-shirt size
* feat: add example gradients for static black and white

Add new gradient backgrounds, displayed for static black and static
white variants. These are used for examples only. This adds CSS custom
properties available globally within Storybook and sets them on the
existing decorator.

* docs(fieldlabel): support static colors decorator in storybook

Change Field label stories that show static black and static white,
so they work with the recently added decorator that changes the main
Storybook background.

* docs(button): adjust static colors template

Adjust static colors template to better handle the static color
decorator and gradients.

* chore(fieldlabel): apply eslint indentation changes to stories
 - @spectrum-css/preview@8.1.0-next.1
 - @spectrum-css/accordion@4.2.7-next.2
 - @spectrum-css/actionbar@7.2.5-next.2
 - @spectrum-css/actionbutton@5.2.7-next.2
 - @spectrum-css/actiongroup@5.0.0-next.3
 - @spectrum-css/actionmenu@5.1.4-next.2
 - @spectrum-css/alertbanner@1.1.42-next.2
 - @spectrum-css/alertdialog@1.2.5-next.2
 - @spectrum-css/asset@4.0.1-next.2
 - @spectrum-css/assetcard@3.1.5-next.2
 - @spectrum-css/assetlist@5.2.5-next.2
 - @spectrum-css/avatar@6.1.6-next.2
 - @spectrum-css/badge@3.2.6-next.2
 - @spectrum-css/breadcrumb@8.2.6-next.2
 - @spectrum-css/button@14.0.0-next.4
 - @spectrum-css/buttongroup@7.0.0-next.3
 - @spectrum-css/calendar@4.2.6-next.2
 - @spectrum-css/card@7.0.3-next.2
 - @spectrum-css/checkbox@14.0.0-next.4
 - @spectrum-css/clearbutton@5.1.5-next.2
 - @spectrum-css/closebutton@5.0.0-next.2
 - @spectrum-css/coachindicator@1.1.6-next.2
 - @spectrum-css/coachmark@6.1.6-next.2
 - @spectrum-css/colorarea@4.1.6-next.2
 - @spectrum-css/colorhandle@7.1.5-next.2
 - @spectrum-css/colorloupe@4.2.5-next.2
 - @spectrum-css/colorslider@5.1.6-next.2
 - @spectrum-css/colorwheel@3.1.6-next.2
 - @spectrum-css/combobox@2.1.7-next.2
 - @spectrum-css/commons@9.1.4-next.1
 - @spectrum-css/contextualhelp@2.1.6-next.2
 - @spectrum-css/datepicker@2.1.5-next.2
 - @spectrum-css/dial@2.2.5-next.2
 - @spectrum-css/dialog@9.2.5-next.2
 - @spectrum-css/divider@2.2.6-next.2
 - @spectrum-css/dropindicator@4.1.5-next.2
 - @spectrum-css/dropzone@5.2.6-next.2
 - @spectrum-css/fieldgroup@4.2.5-next.2
 - @spectrum-css/fieldlabel@8.0.0-next.2
 - @spectrum-css/floatingactionbutton@1.2.6-next.2
 - @spectrum-css/helptext@4.1.6-next.2
 - @spectrum-css/icon@6.0.6-next.2
 - @spectrum-css/illustratedmessage@6.1.6-next.2
 - @spectrum-css/infieldbutton@4.2.5-next.2
 - @spectrum-css/inlinealert@7.1.7-next.2
 - @spectrum-css/link@4.2.6-next.2
 - @spectrum-css/logicbutton@3.3.5-next.2
 - @spectrum-css/menu@6.1.6-next.2
 - @spectrum-css/miller@5.1.5-next.2
 - @spectrum-css/modal@4.2.7-next.2
 - @spectrum-css/opacitycheckerboard@1.1.6-next.2
 - @spectrum-css/page@7.1.5-next.2
 - @spectrum-css/pagination@7.1.7-next.2
 - @spectrum-css/picker@7.2.8-next.2
 - @spectrum-css/pickerbutton@4.1.6-next.2
 - @spectrum-css/popover@6.2.6-next.2
 - @spectrum-css/progressbar@3.1.6-next.2
 - @spectrum-css/progresscircle@2.2.4-next.2
 - @spectrum-css/radio@8.1.6-next.2
 - @spectrum-css/rating@4.2.5-next.2
 - @spectrum-css/search@6.2.5-next.2
 - @spectrum-css/sidenav@4.2.5-next.2
 - @spectrum-css/site@4.2.5-next.2
 - @spectrum-css/slider@4.3.6-next.2
 - @spectrum-css/splitview@4.2.5-next.2
 - @spectrum-css/statuslight@6.1.7-next.2
 - @spectrum-css/steplist@4.1.5-next.2
 - @spectrum-css/stepper@5.1.6-next.2
 - @spectrum-css/swatch@5.1.6-next.2
 - @spectrum-css/swatchgroup@2.1.6-next.2
 - @spectrum-css/switch@4.2.6-next.2
 - @spectrum-css/table@5.2.6-next.2
 - @spectrum-css/tabs@4.1.5-next.2
 - @spectrum-css/tag@8.1.6-next.2
 - @spectrum-css/taggroup@4.1.6-next.2
 - @spectrum-css/textfield@6.1.7-next.2
 - @spectrum-css/thumbnail@5.2.5-next.2
 - @spectrum-css/toast@9.1.26-next.2
 - @spectrum-css/tooltip@5.3.6-next.2
 - @spectrum-css/tray@2.2.8-next.2
 - @spectrum-css/treeview@9.2.7-next.2
 - @spectrum-css/typography@5.1.6-next.2
 - @spectrum-css/underlay@3.2.5-next.2
 - @spectrum-css/well@4.1.5-next.2
 - @spectrum-css/generator@2.1.1-next.0
 - @spectrum-css/tokens@14.0.0-next.6
* feat(switch): s2 migration

* chore: remove themes

* fix: animation

* fix: whcm light mode unchecked handle shows

* docs(storybook): align chromatic setup with new standard

* fix: checked corners for non-retina display

* fix: whcm handle selected color

* fix: namespace mods, use semantic tokens instead of global

* fix: handle state colors
* chore(tokens): use spectrum-tokens@13.0.0-beta.30
* chore: add changeset
* chore: release (next)

* docs: reset changes to changelog

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Patrick Fulton <pfulton@adobe.com>
* feat(fieldlabel)!: s2 migration (#2569)

BREAKING CHANGE: uses Spectrum 2 tokens

Also:
* feat(fieldlabel): medium as default and 100 sizing tokens

- Use the correct "100" sized tokens for medium.
- Make medium styles the default, to conform with existing pattern.
  .spectrum-FieldLabel--sizeM class removed as it is no longer
  necessary.

* feat(fieldlabel): use correct font size tokens

The font-size tokens used for large and extra large needed to be shifted
up to match the s2 spec.

* refactor(fieldlabel): remove deprecated mods

Remove renamed mods marked as deprecated for S2 release.

* docs(fieldlabel): spectrum 2 noted in migration notes

Updates some docs and adds migration notes. Clarifies some docs around
"left" and "right", and fixes duplicate ID warnings from examples code.

* docs(fieldlabel): form - docs update and regenerate mods

Add migration guide section to "Form", that currently lives within the
Field label component. Regenerates mods to include the removal of
deprecated renamed mods.

* fix(fieldlabel): rename mod property referencing global token

A mod custom property was referencing a global token instead of the
component itself. Renames this and adds a note to the migration guide.

* feat(fieldlabel): use correct sizing tokens

Use correct tokens for some large and extra large custom properties,
to matching with design.

* style(fieldlabel): applying linter formatting adjustments

Run linter fix on the fieldlabel component, which rearranges a few
declarations.

* docs(fieldlabel): document asterisk icon size

Add documentation about asterisk UI icon sizes specified on the design.
These sizes are already handled in the Storybook template, but were not
really explained to the user.

* feat(fieldlabel): black and white static color variants

Add classes for static colors, as defined on the designs. And adds
examples of these variants to the documentation.

* build(fieldlabel): specify s2 tokens release for dependency

Use Spectrum 2 version of tokens package in dependencies list.

* chore: rebase against main and update components to use prerelease tokens

* chore: run branch through format; update pathing and fix errors

* chore: add changeset for css update

---------

Co-authored-by: Josh Winn <965114+jawinn@users.noreply.github.com>
Co-authored-by: Patrick Fulton <pfulton@adobe.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@mdt2 mdt2 force-pushed the mdt2/css-739-s2-actionbutton branch from 6220dae to e5e36b9 Compare April 29, 2024 16:15
Copy link

changeset-bot bot commented Apr 29, 2024

🦋 Changeset detected

Latest commit: fa9418c

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

This PR includes changesets to release 13 packages
Name Type
@spectrum-css/actionbutton Major
@spectrum-css/actiongroup Major
@spectrum-css/actionmenu Major
@spectrum-css/breadcrumb Major
@spectrum-css/calendar Major
@spectrum-css/card Major
@spectrum-css/coachmark Major
@spectrum-css/contextualhelp Major
@spectrum-css/dropzone Major
@spectrum-css/pagination Major
@spectrum-css/stepper Major
@spectrum-css/datepicker Major
@spectrum-css/slider Major

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

@pfulton pfulton force-pushed the spectrum-two branch 2 times, most recently from e0e0fd2 to 698e904 Compare May 3, 2024 18:39
@mdt2 mdt2 added blocked See description and comments for what is blocking this issue and removed ready-for-review labels May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked See description and comments for what is blocking this issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants