Skip to content

feat(alert dialog): S2 migration #3725

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

cdransf
Copy link
Member

@cdransf cdransf commented May 12, 2025

Description

CSS-1017 + CSS-1133

This migrates the alert dialog component to the latest Spectrum 2 designs. Custom properties have been remapped and added per the design specification.

The icon in the dialog header has been moved from the right side to the left.

The dialog divider has been removed.

Primary button style has been updated to filled.

Multiple variants are now supported:

  • Confirmation
  • Information
  • Destructive
  • Warning (with AlertDiamond icon)
  • Error (with AlertTriangle icon)

Dialog buttons may be displayed either horizontally or vertically.

Removed custom properties

--spectrum-alert-dialog-body-font-size
--spectrum-alert-dialog-description-to-buttons
--spectrum-alert-dialog-divider-to-description
--spectrum-alert-dialog-padding
--spectrum-alert-dialog-title-size
--spectrum-alert-dialog-title-to-divider
--spectrum-alert-dialog-title-to-icon

New custom properties

--spectrum-alert-dialog-background-color
--spectrum-alert-dialog-corner-radius
--spectrum-alert-dialog-description-to-button-group
--spectrum-alert-dialog-edge-to-content
--spectrum-alert-dialog-minimum-title-to-icon
--spectrum-alert-dialog-title-to-description

Removed mods

--mod-alert-dialog-body-font-size
--mod-alert-dialog-description-to-buttons
--mod-alert-dialog-divider-to-description
--mod-alert-dialog-padding
--mod-alert-dialog-title-to-divider
--mod-alert-dialog-title-to-icon

New mods

--mod-alert-dialog-background-color
--mod-alert-dialog-corner-radius
--mod-alert-dialog-description-size
--mod-alert-dialog-description-to-button-group
--mod-alert-dialog-edge-to-content
--mod-alert-dialog-minimum-title-to-icon
--mod-alert-dialog-title-to-description

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

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

@cdransf cdransf self-assigned this May 12, 2025
@cdransf cdransf added wip This is a work in progress, don't judge. skip_vrt Add to a PR to skip running VRT (but still pass the action) labels May 12, 2025
Copy link

changeset-bot bot commented May 12, 2025

🦋 Changeset detected

Latest commit: bd46f2b

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/alertdialog 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

Copy link
Contributor

github-actions bot commented May 12, 2025

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

Copy link
Contributor

github-actions bot commented May 12, 2025

File metrics

Summary

Total size: 1.41 MB*
Total change (Δ): 🟢 ⬇ 0.28 KB (-0.02%)

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

Package Size Minified Gzipped Δ
alertdialog 5.50 KB 5.25 KB 1.25 KB 🔴 ⬆ 0.41 KB

File change details

alertdialog

Filename Head Minified Gzipped Compared to base
index.css 5.50 KB 5.25 KB 1.25 KB 🔴 ⬆ 0.41 KB
metadata.json 3.40 KB - - 🔴 ⬆ 0.31 KB

tokens

Filename Head Minified Gzipped Compared to base
css/dark-vars.css 46.16 KB - - -
css/global-vars.css 78.26 KB - - -
css/index.css 252.91 KB - - 🟢 ⬇ 0.14 KB
css/large-vars.css 41.97 KB - - 🟢 ⬇ 0.07 KB
css/light-vars.css 46.16 KB - - -
css/medium-vars.css 42.10 KB - - 🟢 ⬇ 0.07 KB
json/tokens.json 396.47 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.

@cdransf cdransf force-pushed the cdransf/s2-alert-dialog-migration branch 4 times, most recently from 393e919 to 7a4d68f Compare May 14, 2025 15:23
@cdransf cdransf marked this pull request as ready for review May 14, 2025 17:10
@cdransf cdransf force-pushed the cdransf/s2-alert-dialog-migration branch from f48db01 to 178a298 Compare May 14, 2025 19:52
@cdransf cdransf added size-8 XL ~18-54hrs; huge effort, high complexity, takes a whole sprint, maybe break down. ready-for-review skip_vrt Add to a PR to skip running VRT (but still pass the action) and removed wip This is a work in progress, don't judge. skip_vrt Add to a PR to skip running VRT (but still pass the action) labels May 15, 2025
@cdransf cdransf force-pushed the cdransf/s2-alert-dialog-migration branch from 178a298 to 2f040e0 Compare May 15, 2025 15:58
@cdransf cdransf requested a review from aramos-adobe May 15, 2025 16:23
@cdransf cdransf force-pushed the cdransf/s2-alert-dialog-migration branch 2 times, most recently from 68ce9b0 to 879e039 Compare May 16, 2025 14:41
@cdransf cdransf force-pushed the cdransf/s2-alert-dialog-migration branch from 939b11e to 30c40a0 Compare May 19, 2025 15:53
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.

Sorry it took me longer than I meant to get a review done! I do have some questions for you, and found a few small changes.

  • Tokens are looking really great. The only one I didn't see in the CSS was alert-dialog-top-to-alert-icon. I'm assuming we've left it out because we have a flex/align-items center now on that heading container, or is there a reason?

And finally- There's a customModalStyles arg being passed to the Template() function. Is that necessary? That wasn't anything you added, I just happened to notice it. Feel free to keep it if we don't really know what it does!

Comment on lines +114 to +118
.spectrum-AlertDialog-buttongroup {
display: flex;
justify-content: end;
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can safely delete this entirely. The --mod-buttongroup-justify-content at line 44 is already set to flex-end, so when I tested deleting this selector, it was already justified this way.

Screenshot 2025-05-19 at 1 22 16 PM

Copy link
Member Author

@cdransf cdransf May 19, 2025

Choose a reason for hiding this comment

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

Hmm, these styles result in the vertical button group being right aligned within the alert — with those removed they're still displayed vertically but are left-aligned within the dialog. ✨

Comment on lines 103 to 104
/* @TODO: update to `--spectrum-alert-dialog-body-font-size` when available */
font-size: var(--mod-alert-dialog-description-size, var(--spectrum-alert-dialog-description-size));
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is related to the title font size token I just mentioned as well. Maybe it's worth an ask, just to make sure.

Copy link
Member Author

@cdransf cdransf May 19, 2025

Choose a reason for hiding this comment

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

Good catch! We had --spectrum-alert-dialog-description-font-size available, so I aliased it...

--spectrum-alert-dialog-description-content-size: var(--spectrum-alert-dialog-description-font-size);

...(--spectrum-alert-dialog-description-size is the name of another token) and applied it:

font-size: var(--mod-alert-dialog-description-content-size, var(--spectrum-alert-dialog-description-content-size));

@cdransf cdransf force-pushed the cdransf/s2-alert-dialog-migration branch 5 times, most recently from 00ef68d to 829c762 Compare May 19, 2025 19:32
@cdransf cdransf force-pushed the cdransf/s2-alert-dialog-migration branch from 829c762 to bd46f2b Compare May 19, 2025 21:15
@cdransf cdransf added the size-5 L ~30-42hrs; lots of effort or complexity, most of a sprint needed to complete. label May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-review size-5 L ~30-42hrs; lots of effort or complexity, most of a sprint needed to complete. size-8 XL ~18-54hrs; huge effort, high complexity, takes a whole sprint, maybe break down. skip_vrt Add to a PR to skip running VRT (but still pass the action)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants