Skip to content

feat(picker): refactoring template markup, testing token passthroughs #3792

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

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

Conversation

aramos-adobe
Copy link
Contributor

@aramos-adobe aramos-adobe commented May 19, 2025

Description

Refactored the Picker component template to encapsulate the popover, help text, label, and spectrum-Picker-button within a unified structure. The spectrum-Picker now acts as the root class, allowing for more targeted button styles and streamlined --mod and style passthroughs to child elements.

For example, --mod-popover-animation-distance—defined in the Popover—now registers correctly within the Picker, enabling size variant tokens to apply expected values when the corresponding size class is used.

New mod

--mod-picker-popover-animation-distance

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

  1. Open the storybook for the picker component:
    - [ ] Correct --spectrum-picker-popover-animation-distance token changes according per size variant
    - [ ] Layout still works for top and side labels
    - [ ] Test grid environment still in tact

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 19, 2025

🦋 Changeset detected

Latest commit: da7dad2

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

This PR includes changesets to release 1 package
Name Type
@spectrum-css/picker 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

@aramos-adobe aramos-adobe marked this pull request as draft May 19, 2025 22:20
Copy link
Contributor

github-actions bot commented May 19, 2025

File metrics

Summary

Total size: 1.41 MB*

Package Size Minified Gzipped
picker 28.63 KB 27.36 KB 3.50 KB

picker

Filename Head Minified Gzipped Compared to base
index.css 28.63 KB 27.36 KB 3.50 KB 🟢 ⬇ 0.02 KB
metadata.json 14.42 KB - - 🔴 ⬆ 0.16 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 19, 2025

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

@aramos-adobe aramos-adobe force-pushed the aramos-adobe/css1065-picker-markup-followup branch from d7c1ead to e519171 Compare May 19, 2025 22:53
@aramos-adobe aramos-adobe self-assigned this May 20, 2025
@aramos-adobe aramos-adobe added size-5 L ~30-42hrs; lots of effort or complexity, most of a sprint needed to complete. ready-for-review S2 Spectrum 2 labels May 20, 2025
@aramos-adobe aramos-adobe marked this pull request as ready for review May 20, 2025 22:06
@aramos-adobe aramos-adobe changed the title Aramos-adobe/css1065-picker-markup-followup feat(picker): refactoring template markup, testing token passthroughs May 20, 2025
Copy link
Collaborator

@marissahuysentruyt marissahuysentruyt left a comment

Choose a reason for hiding this comment

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

I think there's some style fixes that need to be addressed, specifically for the quiet variants. I left a thought about probably reimplementing the isQuiet arg getting passed to Picker() (not Template()). We'll also need to double check the side+quiet variant since the text alignment is pretty wonky:

This PR preview:
Screenshot 2025-05-23 at 11 39 17 AM

The table migration preview:
Screenshot 2025-05-23 at 11 39 10 AM

placeholder,
currentValue,
contentIconName,
isQuiet = false,
Copy link
Collaborator

@marissahuysentruyt marissahuysentruyt May 23, 2025

Choose a reason for hiding this comment

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

I'm not totally sure where to put this comment, but I think it's related to the removal of this isQuiet arg.

I noticed on the docs page that the Quiet Invalid story has borders. I'm not certain where that code lives however...

If I put the .spectrum-Picker--quiet on the button itself, the borders are removed as expected.

Preview:
Screenshot 2025-05-23 at 11 30 21 AM

Other recent PR preview (from the table migration):
Screenshot 2025-05-23 at 11 30 29 AM

@marissahuysentruyt
Copy link
Collaborator

@aramos-adobe Would you be open to adding a test case where we check side + quiet pickers? That's the controls I used to find the text alignment issue.

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-5 L ~30-42hrs; lots of effort or complexity, most of a sprint needed to complete.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants