feat(popover): migrate s2 popover#3365
Conversation
🦋 Changeset detectedLatest commit: 1fac2ba The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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: 2.23 MB* Table reports on changes to a package's main file. Other changes can be found in the collapsed Details section below.
Detailscoachmark
picker
popover
* Results are not gzipped or minified. * An ASCII character in UTF-8 is 8 bits or 1 byte. |
|
🚀 Deployed on https://pr-3365--spectrum-css.netlify.app |
c982e9c to
d9214ec
Compare
9eacd5d to
b2e341b
Compare
rise-erpelding
left a comment
There was a problem hiding this comment.
I think this is good to go! Thanks for all your hard work on this, and for all the follow-up cards that you've made to explore some of the other complexities that came about with this migration - those cover a whole lot of the things that I noticed reviewing this.
I made a tiny callout about maybe linking Down state docs if you want, but I have a couple of other non-blocking questions/maybe concerns:
- I'm honestly a little puzzled as to why the left/right-positioned popovers with tip are so far away from the source compared to the top/bottom-positioned popovers with tip. This isn't anything you introduced, because I saw it on main too! To me, this seems like it could be a bug - the spacing is set based on
popover-pointer-widthif it's side-positioned, and based onpopover-pointer-heightif it's vertically positioned from its source, butpopover-pointer-widthandpopover-pointer-heightdon't ever change, if I'm not mistaken - it's just that for side-positioned popovers inline-size is set to the height and otherwise it's set to the width.

- It also totally feels weird that we get popovers that look like this in rtl where the tip is way away from the source, but that would be a reason to use the logical position, I guess, so we probably don't need to take any further action there.

- Lastly, I know you have a card for the drop-shadows as pertaining to coachmark already, but I can't help but notice how much bigger the shadows look compared to Figma. I know I've done my fair share of digging and I think the mechanisms used to render the shadows in Figma are completely different than what is used in CSS for
filter: drop-shadow()but that would be something that I'd love for us to standardize further at some point in the future.
That's all I've got! Nice work, once again!
3958f41 to
1fac2ba
Compare
| /* tip size minus where it overlaps with popover border */ | ||
| /* stylelint-disable-next-line csstools/use-logical -- intentional, right stays on the same side even for RTL */ | ||
| margin-left: calc(var(--mod-popover-pointer-width, var(--spectrum-popover-pointer-width)) - var(--mod-popover-border-width, var(--spectrum-popover-border-width))); | ||
| margin-left: calc(var(--mod-popover-animation-distance, var(--spectrum-popover-animation-distance)) - var(--mod-popover-border-width, var(--spectrum-popover-border-width))); |
There was a problem hiding this comment.
This change looks good! I'm wondering if popover-animation-distance is the token we want but some of the context may have left my brain since yesterday--the top/bottom positions are still using popover-pointer-height while the side positions use popover-animation-distance, right? It all computes to the same value in the end, but I'm wondering if the tokens ever change their values if that leaves room for inconsistency down the road?
There was a problem hiding this comment.
Good points! So, I've used the popover-pointer-height token in place of the popover-animatino-distance`, which makes much more sense I think.
To address your other comments from yesterday:
- There are little documentation blurbs on the docs page for the positions that don't adapt to RTL. "* Text direction does not affect the position" and "* Changes side with text direction (like a logical property)". Is that offer enough clarity on the expected behaviors for users when they use particular positions?
- I agree on the drop shadow. I thought maybe that our popover shadows were just looking "bigger" than the shadows in Figma because our background color is white, while Figma's background colors are light gray but...it's not light gray in all the files so that argument is nothing 😆 We have that card to document that we know it looks maybe a little funny, so I don't think I'm going to address anything further in this PR. Does that sound ok?
1fac2ba to
8df58b8
Compare
jawinn
left a comment
There was a problem hiding this comment.
Nice work working through this one. Approved!
I didn't see any issues. Just two tiny docs wording nitpicks here.
- new tokens and token values used for popover - create changeset - rebuild metadata.json - adjust popoverWidth and popoverHeight args to accommodate new padding - update test file with new popoverWidth and popoverHeight - correct side aligned popovers distance to source * fix(coachmark): nested popover style updates - update the border radius of the popover nested in coachmark to match S2 popover specs - update popover `--mod-popover-content-area-spacing` variable name (previously --mod-popover-content-area-spacing-vertical) - rebuild metadata.json * fix(picker): update popover selector class - with the new default position for popover, the selector class for the popover in picker also needed to be updated. (--bottom-start) - create changeset - rebuild metadata.json * docs(popover): fixup some docs wording - add down state link
8df58b8 to
a3aeafd
Compare
feat(popover): new S2 popover styles - new tokens and token values used for popover - create changeset - rebuild metadata.json - adjust popoverWidth and popoverHeight args to accommodate new padding - update test file with new popoverWidth and popoverHeight - correct side aligned popovers distance to source * fix(coachmark): nested popover style updates - update the border radius of the popover nested in coachmark to match S2 popover specs - update popover `--mod-popover-content-area-spacing` variable name (previously --mod-popover-content-area-spacing-vertical) - rebuild metadata.json * fix(picker): update popover selector class - with the new default position for popover, the selector class for the popover in picker also needed to be updated. (--bottom-start) - create changeset - rebuild metadata.json * docs(popover): fixup some docs wording - add down state link
feat(popover): new S2 popover styles - new tokens and token values used for popover - create changeset - rebuild metadata.json - adjust popoverWidth and popoverHeight args to accommodate new padding - update test file with new popoverWidth and popoverHeight - correct side aligned popovers distance to source * fix(coachmark): nested popover style updates - update the border radius of the popover nested in coachmark to match S2 popover specs - update popover `--mod-popover-content-area-spacing` variable name (previously --mod-popover-content-area-spacing-vertical) - rebuild metadata.json * fix(picker): update popover selector class - with the new default position for popover, the selector class for the popover in picker also needed to be updated. (--bottom-start) - create changeset - rebuild metadata.json * docs(popover): fixup some docs wording - add down state link
feat(popover): new S2 popover styles - new tokens and token values used for popover - create changeset - rebuild metadata.json - adjust popoverWidth and popoverHeight args to accommodate new padding - update test file with new popoverWidth and popoverHeight - correct side aligned popovers distance to source * fix(coachmark): nested popover style updates - update the border radius of the popover nested in coachmark to match S2 popover specs - update popover `--mod-popover-content-area-spacing` variable name (previously --mod-popover-content-area-spacing-vertical) - rebuild metadata.json * fix(picker): update popover selector class - with the new default position for popover, the selector class for the popover in picker also needed to be updated. (--bottom-start) - create changeset - rebuild metadata.json * docs(popover): fixup some docs wording - add down state link
feat(popover): new S2 popover styles - new tokens and token values used for popover - create changeset - rebuild metadata.json - adjust popoverWidth and popoverHeight args to accommodate new padding - update test file with new popoverWidth and popoverHeight - correct side aligned popovers distance to source * fix(coachmark): nested popover style updates - update the border radius of the popover nested in coachmark to match S2 popover specs - update popover `--mod-popover-content-area-spacing` variable name (previously --mod-popover-content-area-spacing-vertical) - rebuild metadata.json * fix(picker): update popover selector class - with the new default position for popover, the selector class for the popover in picker also needed to be updated. (--bottom-start) - create changeset - rebuild metadata.json * docs(popover): fixup some docs wording - add down state link
feat(popover): new S2 popover styles - new tokens and token values used for popover - create changeset - rebuild metadata.json - adjust popoverWidth and popoverHeight args to accommodate new padding - update test file with new popoverWidth and popoverHeight - correct side aligned popovers distance to source * fix(coachmark): nested popover style updates - update the border radius of the popover nested in coachmark to match S2 popover specs - update popover `--mod-popover-content-area-spacing` variable name (previously --mod-popover-content-area-spacing-vertical) - rebuild metadata.json * fix(picker): update popover selector class - with the new default position for popover, the selector class for the popover in picker also needed to be updated. (--bottom-start) - create changeset - rebuild metadata.json * docs(popover): fixup some docs wording - add down state link
feat(popover): new S2 popover styles - new tokens and token values used for popover - create changeset - rebuild metadata.json - adjust popoverWidth and popoverHeight args to accommodate new padding - update test file with new popoverWidth and popoverHeight - correct side aligned popovers distance to source * fix(coachmark): nested popover style updates - update the border radius of the popover nested in coachmark to match S2 popover specs - update popover `--mod-popover-content-area-spacing` variable name (previously --mod-popover-content-area-spacing-vertical) - rebuild metadata.json * fix(picker): update popover selector class - with the new default position for popover, the selector class for the popover in picker also needed to be updated. (--bottom-start) - create changeset - rebuild metadata.json * docs(popover): fixup some docs wording - add down state link
feat(popover): new S2 popover styles - new tokens and token values used for popover - create changeset - rebuild metadata.json - adjust popoverWidth and popoverHeight args to accommodate new padding - update test file with new popoverWidth and popoverHeight - correct side aligned popovers distance to source * fix(coachmark): nested popover style updates - update the border radius of the popover nested in coachmark to match S2 popover specs - update popover `--mod-popover-content-area-spacing` variable name (previously --mod-popover-content-area-spacing-vertical) - rebuild metadata.json * fix(picker): update popover selector class - with the new default position for popover, the selector class for the popover in picker also needed to be updated. (--bottom-start) - create changeset - rebuild metadata.json * docs(popover): fixup some docs wording - add down state link
feat(popover): new S2 popover styles - new tokens and token values used for popover - create changeset - rebuild metadata.json - adjust popoverWidth and popoverHeight args to accommodate new padding - update test file with new popoverWidth and popoverHeight - correct side aligned popovers distance to source * fix(coachmark): nested popover style updates - update the border radius of the popover nested in coachmark to match S2 popover specs - update popover `--mod-popover-content-area-spacing` variable name (previously --mod-popover-content-area-spacing-vertical) - rebuild metadata.json * fix(picker): update popover selector class - with the new default position for popover, the selector class for the popover in picker also needed to be updated. (--bottom-start) - create changeset - rebuild metadata.json * docs(popover): fixup some docs wording - add down state link
feat(popover): new S2 popover styles - new tokens and token values used for popover - create changeset - rebuild metadata.json - adjust popoverWidth and popoverHeight args to accommodate new padding - update test file with new popoverWidth and popoverHeight - correct side aligned popovers distance to source * fix(coachmark): nested popover style updates - update the border radius of the popover nested in coachmark to match S2 popover specs - update popover `--mod-popover-content-area-spacing` variable name (previously --mod-popover-content-area-spacing-vertical) - rebuild metadata.json * fix(picker): update popover selector class - with the new default position for popover, the selector class for the popover in picker also needed to be updated. (--bottom-start) - create changeset - rebuild metadata.json * docs(popover): fixup some docs wording - add down state link
Description
Welcome to the new and improved S2 popover! 🥳
This PR updates tokens used in the popover component. The work includes new S2 tokens specifically for colors, padding and the border radius for popover. There is also a transparent border in light mode and a visible border in dark mode.
There are several components that have popover as a subcomponent. Those were updated with just enough additional code to make them "work." Coachmark and picker did have some additional CSS needs, particularly relating to the new popover corner rounding, and the new
bottom-startpositioning.Popover Mods
Some mods have been renamed to match their new token names, or better reflect their purposes:
--mod-popover-content-area-spacing-vertical--mod-popover-content-area-spacing--mod-popover-shadow-blur--mod-popover-drop-shadow-blur--mod-popover-shadow-color--mod-popover-drop-shadow-color--mod-popover-shadow-horizontal--mod-popover-drop-shadow-x--mod-popover-shadow-vertical--mod-popover-drop-shadow-yNotes
but the cascade doesn't quite work because of the markup differences. CSS-1065 captures some of the thoughts and issues, and Josh brought up some good questions/context in his comment below in regards to nesting elements and SWC.
Designs
S2 Popover Token specs
S2 / Desktop Popover
Jira
CSS-615
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
mainappear on the docs page. No changes should have been made to popover positions or tip placements.popover-border-color(see the comment in index.css)popover-border-opacitydrop-shadow-elevated-colordrop-shadow-elevated-xdrop-shadow-elevated-ydrop-shadow-elevated-blurcorner-radius-large-defaultpopover-edge-to-content-area(popover-top-to-content-areawas removed from tokens)border-width-100background-layer-2-color(it may not be pointing togray-25as intended, but should once we make the full change to S2 tokens)Regression testing
Validate:
Screenshots
Before:

After:

To-do list