Skip to content

Commit

Permalink
feat(dialog)!: s2 standard dialog migration
Browse files Browse the repository at this point in the history
* docs(dialog): dialog controls/coverage
- adds new features/behaviors such as the checkbox in the footer,
wrapping for footer/header content, being able to have close button and
button group, hasHeroImage
- removes Divider support in dialog
- adds is-hidden-story to replicate what is on main and remove most
stories from the sidebar
- adds some comments and TODOs giving context to this choice
- removes layout from control table from default argTypes
- removes hasFooter from control table for fullscreen/fullscreenTakeover
argTypes
- adds a comment to explain the custom argTypes changes for those stories
- also adds a comment about multiple conditionals for argTypes

* refactor(modal): use corner-radius-extra-large-default to match design
specs

* fix(underlay): update comment notes for spectrum-overlay-color
- also comments out a duplicated custom property and adds a TODO comment

* refactor(dialog): new css for S2 dialog
- adds some opportunities for mod properties
- fixes dismissible grid spacing between additional header content and
close button
- scope passthrough mods to spectrum-Dialog class
- add flex-direction: column to footer (this should allow the footer
content and button group to stack at small screens at smallest dialog
sizes on the mobile scale.)

* feat(dialog): rebuild mods
- lots of mods are renamed to use "standard dialog" language

* chore(dialog): create changeset

* chore(dialog): update peer deps data
- remove divider from peerDependencies and peerDependenciesMeta
- adds closebutton, checkbox and typography to peerDependenciesMeta

* chore: remove divider tests

* chore(buttongroup): add flex-wrap mod property

* chore(buttongroup): creates buttongroup changeset

* chore(buttongroup,dialog): rebuild mods

* fix(dialog): platform custom variables
- calls for --spectrum-standard-dialog-spacing-edge-to-content

* chore(tokens): create changeset for custom standard dialog token

* chore(tray): fix spelling of isDismissible arg

* fix(dialog,modal): custom styles for modal background color
- because modal was originally setting the background color of dialogs,
there was some 'antialiasing bleed through' behind the dialog. By adding
customStyles to Modal, we can set --mod-modal-background-color to
transparent and get rid of the hairline color (especially noticeable
behind a hero image in a dialog)

* docs(dialog): adds modal background color documentation

* fix(dialog): use font-stack instead of font-family
  • Loading branch information
marissahuysentruyt committed Dec 6, 2024
1 parent 27d01df commit acde6e5
Show file tree
Hide file tree
Showing 21 changed files with 1,000 additions and 476 deletions.
5 changes: 5 additions & 0 deletions .changeset/few-doors-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@spectrum-css/buttongroup": patch
---

Adds a new `--mod-buttongroup-flex-wrap` custom property to leverage if a user wishes to customize the `flex-wrap` property.
5 changes: 5 additions & 0 deletions .changeset/loud-vans-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@spectrum-css/tokens": patch
---

Adds `--spectrum-standard-dialog-spacing-edge-to-content` to properly adjust the spacing for desktop/mobile dialog styles.
52 changes: 52 additions & 0 deletions .changeset/metal-fireants-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
"@spectrum-css/dialog": major
"@spectrum-css/modal": patch
"@spectrum-css/underlay": patch
---

Spectrum 2 Standard Dialog Migration

This is the migration for standard dialog. The Divider component is no longer supported in S2 dialogs. In addition, some new and updated tokens are in place to update dialog corner rounding, font treatments, spacing/padding, and maximum/minimum widths. There were several new elements implemented as well, including optional header and footer content, hero/cover images, checkbox and text-only options in the footer content area.

The `.spectrum-Dialog--small`, `.spectrum-Dialog--medium`, and `.spectrum-Dialog--large` sizing classes were deprecated and removed from the CSS in favor of the t-shirt sizes. Additionally, the spelling of the `.spectrum-Dialog--dismissable` class was corrected to `.spectrum-Dialog--dismissible`.

Mod properties are either "new," have been renamed to reflect the respective dialog language, or were removed:

_New Mods_
`--mod-standard-dialog-spacing-title-to-header-content`
`--mod-standard-dialog-spacing-title-to-description`
`--mod-standard-dialog-header-content-font-size`

_Renamed Mods_
`--mod-dialog-confirm-small-width` > `--mod-standard-dialog-max-width-small`
`--mod-dialog-confirm-medium-width` > `--mod-standard-dialog-max-width`
`--mod-dialog-confirm-large-width` > `--mod-standard-dialog-max-width-large`
`--mod-dialog-confirm-border-radius` > `--mod-standard-dialog-border-radius`
`--mod-dialog-confirm-description-text-size` > `--mod-standard-dialog-description-font-size`
`--mod-dialog-confirm-description-text-line-height` > `--mod-standard-dialog-description-line-height`
`--mod-dialog-confirm-description-text-color` > `--mod-standard-dialog-description-text-color`
`--mod-dialog-confirm-description-font-weight` > `--mod-standard-dialog-description-font-weight`
`--mod-dialog-heading-font-weight` > `--mod-standard-dialog-heading-font-weight`
`--mod-dialog-confirm-title-text-line-height` > `--mod-standard-dialog-heading-line-height`
`--mod-dialog-confirm-title-text-color` > `--mod-standard-dialog-heading-text-color`
`--mod-dialog-confirm-title-text-size` > `--mod-standard-dialog-heading-font-size`
`--mod-dialog-confirm-hero-height` > `--mod-standard-dialog-hero-block-size`
`--mod-dialog-min-inline-size` > `--mod-standard-dialog-min-inline-size`
`--mod-dialog-confirm-padding-grid` > `--mod-standard-dialog-spacing-grid-padding`
`--mod-dialog-confirm-footer-padding-top` > `--mod-standard-dialog-spacing-description-to-footer`
`--mod-dialog-confirm-close-button-padding` > `--mod-standard-dialog-spacing-edge-to-close-button`
`--mod-dialog-confirm-gap-size` > `--mod-standard-dialog-spacing-footer-to-button-group`

_Removed Mods_
`--mod-dialog-confirm-buttongroup-padding-top`
`--mod-dialog-confirm-close-button-size`
`--mod-dialog-confirm-description-margin`
`--mod-dialog-confirm-description-padding`
`--mod-dialog-confirm-divider-block-spacing-end`
`--mod-dialog-confirm-divider-block-spacing-start`
`--mod-dialog-confirm-divider-height`

Modal and underlay updates

- Modal component now uses the updated corner rounding.
- Underlay has an updated comment that addresses the overlay-color/overlay-opacity tokens.
28 changes: 14 additions & 14 deletions components/buttongroup/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,28 @@ governing permissions and limitations under the License.
*/

.spectrum-ButtonGroup {
--spectrum-buttongroup-spacing-horizontal: var(--spectrum-spacing-200);
--spectrum-buttongroup-spacing-vertical: var(--spectrum-spacing-200);
--spectrum-buttongroup-spacing-horizontal: var(--spectrum-spacing-200);
--spectrum-buttongroup-spacing-vertical: var(--spectrum-spacing-200);
}

.spectrum-ButtonGroup--sizeS {
--spectrum-buttongroup-spacing-horizontal: var(--spectrum-spacing-100);
--spectrum-buttongroup-spacing-vertical: var(--spectrum-spacing-100);
--spectrum-buttongroup-spacing-horizontal: var(--spectrum-spacing-100);
--spectrum-buttongroup-spacing-vertical: var(--spectrum-spacing-100);
}

.spectrum-ButtonGroup {
display: flex;
flex-wrap: wrap;
gap: var(--mod-buttongroup-spacing-horizontal, var(--spectrum-buttongroup-spacing-horizontal));
justify-content: var(--mod-buttongroup-justify-content, normal);
display: flex;
flex-wrap: var(--mod-buttongroup-flex-wrap, wrap);
gap: var(--mod-buttongroup-spacing-horizontal, var(--spectrum-buttongroup-spacing-horizontal));
justify-content: var(--mod-buttongroup-justify-content, normal);

.spectrum-ButtonGroup-item {
flex-shrink: 0;
}
.spectrum-ButtonGroup-item {
flex-shrink: 0;
}
}

.spectrum-ButtonGroup--vertical {
display: inline-flex;
flex-direction: column;
gap: var(--mod-buttongroup-spacing-vertical, var(--spectrum-buttongroup-spacing-vertical));
display: inline-flex;
flex-direction: column;
gap: var(--mod-buttongroup-spacing-vertical, var(--spectrum-buttongroup-spacing-vertical));
}
1 change: 1 addition & 0 deletions components/buttongroup/metadata/mods.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
| Modifiable custom properties |
| -------------------------------------- |
| `--mod-buttongroup-flex-wrap` |
| `--mod-buttongroup-justify-content` |
| `--mod-buttongroup-spacing-horizontal` |
| `--mod-buttongroup-spacing-vertical` |
Loading

0 comments on commit acde6e5

Please sign in to comment.