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(popover): migrate s2 popover #3365

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

Conversation

marissahuysentruyt
Copy link
Collaborator

@marissahuysentruyt marissahuysentruyt commented Nov 4, 2024

Description

Welcome to the new and improved S2 popover! 🥳

This PR updates tokens used in the popover component. Additionally, it brings over all of the relevant stories, tests, and documentation from main (in the hopes of reducing the conflicts the merge may introduce). The copy/pastes from main are marked with [from main] in the commit messages.

- In .storybook/base.css: This update is from main and helps to stop cutting off the nested popover content.

Most of the work in popover.stories.js and template.js is just copied over from main.
- In template.js:

  1. I removed popoverAlignment["inset-inline-start"] = "0"; from 2 position cases (and left a comment explaining that decision).
  2. I replaced the renderContent() from main with the content.map() that works on spectrum-two.
  3. When spectrum-two merges, most of the comments in template.js can be uncommented and refactored to use the approaches we use in main.

- In popover.stories.js`

  1. When spectrum-two merges, most of the comments in popover.stories.js can be uncommented and refactored to use the approaches we use in main. There's a few TODO comments left to hopefully remind us about certain things during that merge.
  2. We'll need to remove the decorator, remove "Component/" from the title, and turn on the metadata/packageJson.

There are several components that have popover as a subcomponent. Those were updated with just enough additional code to make them work. Coachmark did have some additional CSS needs, particularly relating to the new popover corner rounding and the image/media.

Popover Mods

Some mods have been renamed to match their new token names, or better reflect their purposes:

Old mod name New mod name
--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-y

Designs

S2 Popover Token specs
S2 / Desktop Popover

Jira

CSS-615

Pending Questions

  1. How should we be handling the "container padding" as seen in Figma? I'm currently implementing it here: feat(popover): migrate s2 popover #3365 (comment)
Screenshot 2024-11-06 at 3 52 29 PM
  1. Should popover handle the nested menu overlap margin? My guess is no...
Screenshot 2024-11-06 at 3 52 49 PM
  1. Do I need to address search within at all? It's deprecated component that calls for popover. It's very broken looking, but maybe that's to be expected.

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

  • Popover design review and approval
  • Pull down the branch
  • Visit the popover storybook. Verify all stories from main appear on the docs page. No immediate changes have been made to popover positions or tip placements.
  • The default popover matches the [s2 popover specs].(https://www.figma.com/design/eoZHKJH9a3LJkHYCGt60Vb/S2-token-specs?node-id=27417-7447)
  • Verify the action button trigger and popover menu items are accessible via keyboard.
  • Create various combinations of the popover to verify combos are considered in the CSS:
    • mobile vs desktop
    • light vs dark mode (the border color/transparency should change in dark mode)
    • popover positioning and tip placement
  • Verify new tokens are used:
    • popover-border-color (see the comment in index.css)
    • popover-border-opacity
    • drop-shadow-elevated-color
    • drop-shadow-elevated-x
    • drop-shadow-elevated-y
    • drop-shadow-elevated-blur
  • Verify updated tokens are used:
    • corner-radius-large-default
    • popover-edge-to-content-area (popover-top-to-content-area was removed from tokens)
    • border-width-100
    • background-layer-2-color (it may not be pointing to gray-25 as intended, but should once we make the full change to S2 tokens)
  • Chromatic coverage (using popover.test.js file) continues to maintains test templates, and does not have additional variations/test scenarios.
  • Action bar, action menu, coach mark, combobox, contextual help, date picker and picker (which all call for a popover component) look acceptable. There may be slight style issues to handle with those components' migrations, as opposed to this PR.

Before:
Screenshot 2024-11-06 at 5 16 11 PM

After:
Screenshot 2024-11-06 at 5 16 28 PM

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. ✨

pfulton and others added 30 commits May 9, 2024 12:23
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/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
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 <[email protected]>
* 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.
Takes in the latest beta release for S2 tokens
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
* feat(tokens): use spectrum tokens beta 21
* chore(tokens): add custom token for corner rounding
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
 - @spectrum-css/[email protected]
…2559)

* feat(cornerrounding): documentation, custom tokens

- feat(cornerrounding): add custom token
- chore(cornerrounding): adds dist
- docs(cornerrounding): add file strucutre for foundations
- feat(cornerrounding): override token value
  - Sets custom var to override token spectrum-corner-radius-full
- chore(cornerrounding): add override to dist
  - Adds custom var to override token value to dist
- chore(cornerrounding): adjust file structure
  - Also renames file
- feat(cornerrounding): add Foundations story for corner-rounding
- feat(cornerrounding): add action buttons and checkboxes
  - Adds action buttons and checkboxes stories to demonstrate corner rounding
- docs(cornerrounding): update corner-rounding docs
  - better utilize storybook features
  - clean up checkbox and action button stories
  - hide stories in corner-rounding directory
  - improve table styling and css token use
  - improve corner rounding documentation
  - add tables for component size tokens
- fix(cornerrounding): remove mdx for tables
- fix(cornerrounding): use sentence case
- feat(cornerrounding): use custom token on close button
- docs: add alias note
- docs: remove reference to non-alias tokens
- feat(actionbutton): partial migration for corner rounding only
- feat(checkbox): partial migration for corner rounding only
- chore(closebutton): update custom var post-refactor
- fix: token rebase issue
- chore(actionbutton,checkbox): update package version
- chore: use corner-radius alias token
- chore: update tokens version
- chore: revert unneeded component version change
- docs: design requested updates, show token with example
- docs: move tables to stories, inline spacing for tables

* fix: includes error

---------

Co-authored-by: Melissa Thompson <[email protected]>
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
- `--bottom-start` was added to the popover within the picker markup
- removes the transform: unset and utilizes a display: block instead for
the popover wrapper to override the animation distance properly
- removes `--spectrum-popover-nested-container-spacing` from CSS because
it was defined but never used. also removes its reference in the stories
file
- corrects the margin on the NestedPopover story to use the animation-
distance token as margin instead of spacing-100
- compensates for the additional 16px of padding on all sides of popover
- adds the inset-inline-start: 0 args for positioning
@marissahuysentruyt marissahuysentruyt force-pushed the marissahuysentruyt/css-615-s2-popover branch from f55a947 to a0ff0b2 Compare November 22, 2024 21:31
@@ -0,0 +1,8 @@
---
"@spectrum-css/coachmark": minor
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just making sure here: the changes in the coachmark CSS are actually a result of the breaking changes from popover. Would that still be considered a minor change in the coachmark CSS?

@marissahuysentruyt
Copy link
Collaborator Author

marissahuysentruyt commented Dec 2, 2024

One other thing I noticed is a display issue with the corners overlapping when I hover over the coachmark action button's popover menu items. Is this missing the padding? Feel free to leave this for the coachmark migration if it's outside the scope of this PR:

@jawinn I was going to leave this for the coachmark. I have a card that captures this right now: https://jira.corp.adobe.com/browse/CSS-1067

@marissahuysentruyt
Copy link
Collaborator Author

marissahuysentruyt commented Dec 2, 2024

Some follow-up Jira tickets have been created:
CSS-1065(in response to picker questions found in this branch)
CSS-1066(in response to the coachmark dropshadow/filter questions)
CSS-1067(in response to the coachmark menu padding questions)

@castastrophe castastrophe force-pushed the spectrum-two branch 3 times, most recently from cdb180d to 27d01df Compare December 4, 2024 14:54
@castastrophe castastrophe force-pushed the spectrum-two branch 6 times, most recently from fc916f1 to 9d7f088 Compare December 29, 2024 19:50
@marissahuysentruyt marissahuysentruyt added wip This is a work in progress, don't judge. and removed ready-for-review labels Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S2 Spectrum 2 skip_vrt Add to a PR to skip running VRT (but still pass the action) wip This is a work in progress, don't judge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants