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(search): s2 migration #2673

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

feat(search): s2 migration #2673

wants to merge 52 commits into from

Conversation

mdt2
Copy link
Collaborator

@mdt2 mdt2 commented Apr 18, 2024

Description

I believe this is blocked until we get the S2 icons.

S2 migration of Search to align with design specs. On top of the migration work, this PR includes:

  • Removal of /themes
  • Removal of quiet variant
  • Increased Chromatic coverage
  • Minor mod adjustments
  • Updated migration guide notes

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

  • Storybook testing preview shows all variants (except for hover as we cant show that without adding a class)
  • Test WHCM in light and dark mode
  • Be sure to test hover while focused since there are specific tokens applied for this
  • Design validation

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

changeset-bot bot commented Apr 18, 2024

🦋 Changeset detected

Latest commit: cc78761

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

This PR includes changesets to release 7 packages
Name Type
@spectrum-css/search Major
@spectrum-css/textfield Patch
@spectrum-css/combobox Patch
@spectrum-css/datepicker Patch
@spectrum-css/pagination Patch
@spectrum-css/stepper Patch
@spectrum-css/slider 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 Apr 18, 2024

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

Copy link
Contributor

github-actions bot commented Apr 18, 2024

File metrics

Summary

Total size: 4.54 MB*
Total change (Δ): ⬇ 17.90 KB (-0.38%)

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

Package Size Δ
search 11.57 KB ⬇ 4.21 KB
textfield 38.42 KB ⬆ 0.09 KB

Details

search

File Head Base Δ
index-base.css 11.57 KB 13.14 KB ⬇ 1.56 KB (-11.91%)
index-vars.css 11.57 KB 15.79 KB ⬇ 4.21 KB (-26.69%)
index.css 11.57 KB 15.79 KB ⬇ 4.21 KB (-26.69%)
metadata.json 6.03 KB 7.16 KB ⬇ 1.12 KB (-15.70%)
index-theme.css - 3.23 KB 🚨 deleted, moved, or renamed
themes/express.css - 1.97 KB 🚨 deleted, moved, or renamed
themes/spectrum.css - 1.84 KB 🚨 deleted, moved, or renamed

textfield

File Head Base Δ
index-base.css 37.48 KB 37.40 KB ⬆ 0.09 KB (0.23%)
index-theme.css 1.52 KB 1.52 KB -
index-vars.css 38.42 KB 38.33 KB ⬆ 0.09 KB (0.22%)
index.css 38.42 KB 38.33 KB ⬆ 0.09 KB (0.22%)
metadata.json 17.97 KB 17.97 KB -
themes/express.css 1.05 KB 1.05 KB -
themes/spectrum.css 1.04 KB 1.04 KB -
* 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.

Comment on lines +31 to +34
isFocused: {
table: { disable: true },
type: { name: "boolean" },
},
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 added this because TextField uses this class in it's Storybook, so we can use this arg to pass through to TextField to show the focus state in our Chromatic testing preview for Search.

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.

The CSS for this is looking so much cleaner and the testing preview matches several of the others that we've done! ✨ Here are a few visual things I noticed when going through this PR that might need some changes:

image
  • I'm wondering if this might need an .is-keyboardFocused:hover selector, this hover state looks like it might be unintentional (it goes gray from black):
image

Other questions I have that were carryover from how the component was before:

  • Is there a way to preview the search field with the help text? I know there's a spec for spacing the help text from the component, and I see that it's being used in the code, but I didn't see a way to view it in Storybook.
  • Would it be helpful at all to have a control to show/not show the clear button? I was thinking if it wasn't showing by default I could check the pill-edge-to-text spacing but then I realized that anytime it'd be used, the text would always be the placeholder "Search" text and the spacing between the end of that text box and the edge of the text field is a bit irrelevant. But is there any reason why anyone might want to look at the search field without the clear button instead of it always being there?
  • In WHCM, there's a clear color difference between the text color of the placeholder text and the text color when there's a value, it was like this before, and it's probably not a big deal, but it seemed a little odd to me so I thought I'd call it out:
    image
    image

@@ -298,6 +325,18 @@ governing permissions and limitations under the License.
var(--mod-search-bottom-to-text, var(--spectrum-search-bottom-to-text)) -
var(--mod-search-border-width, var(--spectrum-search-border-width))
);
padding-inline-start: calc(
var(--mod-search-edge-to-text, var(--spectrum-search-edge-to-text)) -
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason for using edge-to-text rather than edge-to-visual here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Great catch, I missed this one.

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.

One thing I am wondering about is the focus and focus indicator on the clear button. In our Storybook, you can tab focus the field and then tab focus the clear button, which shows a rounded focus indicator:
Screenshot 2024-04-25 at 5 03 27 PM

I didn't see a design for that focus on the clear button to reference, and also took a look at the SWC search, which doesn't have it tab focusable (the field clears with the Esc key it seems). Is the intention for us to not have it as a tab stop?

components/search/stories/search.stories.js Show resolved Hide resolved
@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 14 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
* fix(commons): remove renamed mods marked for deprecation

Remove mods that were renamed and previously marked for deprecation,
and regenerate mods lists. This will help in reviewing the accuracy of
other components' mods lists as they are being migrated to s2.

* docs: migration guide notes for mod property deprecations

Add notes to components affected by mod property changes in the commons
basebutton.

* docs(closebutton): updated docs for migration guide and icon size

- Removes the "Icon size" variant options, as noted in the closebutton
  PR. Per Figma changelog "removed icon size as a property".
- Updates migration guide with a more organized history.

* fix(commons): remove another mod referencing global token

Deprecates an additional mod name that was referencing a global token,
and updates migration notes for all affected components.
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.
mdt2 and others added 8 commits April 26, 2024 16:37
* 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
Copy link
Collaborator Author

mdt2 commented Apr 29, 2024

Thanks for the feedback! Some responses for Rise:

  • Disabled border color - Great callout. I've updated Textfield to improve this which will probably just be a patch change.
  • .is-keyboardFocused:hover - I've also added this, good catch.
  • Help text - Yeah totally! I added some help text sections to our Chromatic coverage, and you should see a control to show the help text and also the ability to change the text now.
  • Clear button - I went down a bit of a rabbit hole with this one trying to use useArgs() to only show this button when there's an input value. I wasn't able to get it working within a reasonable timebox and came to the same conclusion you did about the spacing.
  • WHCM placeholder color - I noticed this too. I think that using the disabled color for the placeholder text can help communicate that its placeholder text, so that seemed ok to me. Let me know if you have a different value you think would work better!

And a response for Josh:

  • Clear button focus - This feels like it's in that gray area of whether we would handle this or if it's an implementation detail 🤔 Seems like removing the focus on our end would be a Storybook-only adjustment and would look something like adding an arg to ClearButton to adjust aria-hidden and tab-index, is that what you were thinking? I can add a commit for that and see what you think.

mdt2 and others added 3 commits April 30, 2024 10:01
Co-authored-by: [ Cassondra ] <castastrophe@users.noreply.github.com>
Co-authored-by: [ Cassondra ] <castastrophe@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants