-
Notifications
You must be signed in to change notification settings - Fork 196
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(dialog): s2 takeover dialog migration #3347
base: spectrum-two
Are you sure you want to change the base?
feat(dialog): s2 takeover dialog migration #3347
Conversation
🦋 Changeset detectedLatest commit: 90a7253 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 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 |
🚀 Deployed on https://pr-3347--spectrum-css.netlify.app |
37d987f
to
b86d610
Compare
File metricsSummaryTotal size: 1.74 MB* Table reports on changes to a package's main file. Other changes can be found in the collapsed Details section below.
Detailsdialog
modal
tokens
* Results are not gzipped or minified. * An ASCII character in UTF-8 is 8 bits or 1 byte. |
5c3c954
to
179f3f8
Compare
b86d610
to
3b5b527
Compare
"@spectrum-css/dialog": major | ||
"@spectrum-css/modal": minor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we agree with these version bumps? Is it a concern that the dialog component will have undergone 2 major version bumps for S2? I think the changes would be considered breaking changes. And really, the only reason for a second major version is because we split the standard dialog work from this takeover dialog work. Any thoughts there?
Same for modal- is it a minor version bump?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@castastrophe any reservations with the version bumps here? I wasn't sure if 2 major bumps for dialog (we had a major version change for #2860, and I'm proposing a secondary major version bump) was an issue or weird or something.
3b5b527
to
4c4d044
Compare
88db1a4
to
4168200
Compare
8b79f9a
to
f63164c
Compare
f63164c
to
bff05df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can add an example with content in the middle of spectrum-Dialog-header
. In the design, it appears the intention is to have the header content in the middle of this selector. The --spectrum-takeover-dialog-spacing-header-gap
adds space between the title, content and buttons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea- I'll look into adding an example. It may end up as an additional, follow-up card, because we don't support actually adding a different component to that spectrum-Dialog-header-content
space. We only support text right now, but I don't think we want just text centered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aramos-adobe ok I used the fullscreen story as an example. Both the header content is a different component (the steplist) and then I swapped the body content for a table.
I'm not sure how we handle the centered text now in the fullscreenTakeover dialog. I think we need the justify-content: centered
for when there's components in the .spectrum-Dialog-headerContent
element. The only issue I'm seeing is that if a user just has text, like "* Required," it just looks funny to me.
I guess I could add some extra controls to see if a user wants to preview just text (which would bring back the justify-content: space-between
and removing the max-inline-size: unset
on the wrapper) or preview a different component (which would look like it is now, centered). What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marissahuysentruyt do we still need a resolution here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marissahuysentruyt This is a great addition!
f1e6597
to
70de6c8
Compare
bff05df
to
bec02e7
Compare
b71d0c6
to
acde6e5
Compare
bec02e7
to
bec4b1c
Compare
acde6e5
to
531a17b
Compare
a4619d1
to
65d15e2
Compare
2bcf5a9
to
e3f01b8
Compare
hasDivider: { | ||
name: "Divider", | ||
type: { name: "boolean" }, | ||
table: { | ||
type: { summary: "boolean" }, | ||
category: "Component", | ||
}, | ||
control: "boolean", | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must have been brought over accidentally- it is supposed to be removed (dialogs don't support dividers in S2).
9ca5bf9
to
88fb5b5
Compare
db5ff96
to
cd894f5
Compare
…3471) * fix(popover): define --spectrum-popover-border-width in index.css * fix(well): define --spectrum-well-border-color in index.css * fix(tabs): define --spectrum-tabs-font-weight * fix(toast): define default background color and divider color * fix(tag): define undefined custom properties * fix(menu): define menu item background colors * fix(textfield): define undefined custom properties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking really good, nice work!!
This may be a fast-follow but I was wondering about thinking through providing a utility class or mod tokens to adjust the max-width for title vs content, and allowing an earlier break to more flexibly accommodate different types of components (maybe even a good job for a container query as a pro-active defense?):
…tom properties (#3487) * fix(pickerbutton): add missing custom properties * fix(radio): add missing custom props * fix(calendar): add missing custom properties * fix(stepper): define unused custom props * fix(progressbar): remove unused custom properties; change background-color to background see #2929; fix static color * fix(dial): remove unused custom properties; add undefined custom properties
- removed the space between full & screen in docs - added docs pertaining to the close button not being allowed in full- screen/takeover dialogs
- adds new takeover-dialog tokens to control the desktop/mobile spacing - rebuilds mods
- removes is-hidden-story tags - uses the test templates (DialogGroup, DialogFullscreen, etc.)
- removes divider control - adds tokens, mods and selectors to metadata.json
- missing justify content: space-between - reimplement missing modal-max-height and modal-max-width mods
cd894f5
to
ccc13e7
Compare
- adds hasHeroImage arg - adds background and margin customStyles for fullscreen dialog in Chromatic only (so we can see the rounded corners better)
ccc13e7
to
90a7253
Compare
b438a55
to
46ae687
Compare
Description
This implements the design updates and new tokens for the fullscreen and fullscreen takeover dialogs in S2. 🎉 The majority of the migration has been done in the default, standard dialog (from #2860). The effected stories are called Takeover Dialog in Figma. New tokens were utilized to match the design specs. Fullscreen and fullscreenTakeover dialogs do not support additional footer content, checkboxes, or hero images. They are also not dismissible.
Documentation has been updated with info on the takeover dialog variants and the divider story was removed since dividers are no longer supported in dialog components in S2.
Takeover dialogs in Figma support swapping out text for other components in the header content and body areas. The template for dialogs changed to reflect that, utilizing
renderContent
. Additionally, some class names were corrected to follow our typical naming convention (.spectrum-Dialog-header-content > .spectrum-Dialog-headerContent
and.spectrum-Dialog-footer-content > .spectrum-Dialog-footerContent
).New mod properties should reflect the "takeover dialog" language:
New Mods
--mod-takeover-dialog-grid-spacing
--mod-takeover-dialog-spacing-header-content-gap
--mod-takeover-dialog-title-font-size
New modal custom property
--spectrum-modal-takeover-window-to-edge
New aliased tokens were created for mobile value changes:
For
.spectrum--large
:--spectrum-takeover-dialog-spacing-grid-padding:var(--spectrum-spacing-400);
--spectrum-takeover-dialog-spacing-header-gap:var(--spectrum-spacing-300);
--spectrum-takeover-dialog-spacing-title-to-body:var(--spectrum-spacing-400);
For
.spectrum--medium
:--spectrum-takeover-dialog-spacing-grid-padding:var(--spectrum-spacing-500);
--spectrum-takeover-dialog-spacing-header-gap:var(--spectrum-spacing-400);
--spectrum-takeover-dialog-spacing-title-to-body:var(--spectrum-spacing-500);
Designs
S2 Takeover Dialog Token specs
S2 / Desktop Takeover dialog
Jira
This work was captured as "follow up" work in CSS-829
(The bulk of the dialog migration occurred in CSS-714)
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
Divider
component, so any JS or CSS referencing the dialog's divider has been removed from the stories andindex.css
files.isDismissible
control since they don't support the close button..spectrum-Modal--fullscreen
utilizes the updated window-to-edge value (spacing-600
40px), corresponding to the.spectrum-Dialog--fullscreen
story..spectrum-Modal--fullscreenTakeover
utilizes the updated window-to-edge value (0), corresponding to the.spectrum-Dialog--fullscreenTakeover
story.hasHeroImage
,isDismissible
,hasFooter
, are not supported in takeover dialogs, so their controls should only appear for the standard dialog.takeover-dialog-width
takeover-dialog-height
window-to-edge
corner-radius-extra-large-default
takeover-dialog-spacing-grid-padding
takeover-dialog-spacing-header-gap
takeover-dialog-spacing-title-to-body
background-layer-2-color
(in the designs, this is accidentally misnamed asbackground-color-layer2
)dialog.test.js
file) continues to maintain the fullscreen and fullscreenTakeover test templates, and do not have additional variations/test scenarios.Additional validation
renderContent
function for theheader
controls for the takeover dialogs. For instance, put a different component, like help text or breadcrumbs (don't be alarmed if breadcrumb icons do not render- this is a known bug)..spectrum-Dialog-headerContentWrapper
element.content
controls for the takeover dialogs. For instance, import a different component, like swatch group, or form (don't be alarmed if form styles do not render- this is a known bug)..spectrum-Dialog-content
element.Regression testing
Validate:
Screenshots
To-do list