Skip to content

Commit acde6e5

Browse files
feat(dialog)!: s2 standard dialog migration
* 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
1 parent 27d01df commit acde6e5

21 files changed

+1000
-476
lines changed

.changeset/few-doors-smile.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@spectrum-css/buttongroup": patch
3+
---
4+
5+
Adds a new `--mod-buttongroup-flex-wrap` custom property to leverage if a user wishes to customize the `flex-wrap` property.

.changeset/loud-vans-brush.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@spectrum-css/tokens": patch
3+
---
4+
5+
Adds `--spectrum-standard-dialog-spacing-edge-to-content` to properly adjust the spacing for desktop/mobile dialog styles.

.changeset/metal-fireants-switch.md

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
"@spectrum-css/dialog": major
3+
"@spectrum-css/modal": patch
4+
"@spectrum-css/underlay": patch
5+
---
6+
7+
Spectrum 2 Standard Dialog Migration
8+
9+
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.
10+
11+
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`.
12+
13+
Mod properties are either "new," have been renamed to reflect the respective dialog language, or were removed:
14+
15+
_New Mods_
16+
`--mod-standard-dialog-spacing-title-to-header-content`
17+
`--mod-standard-dialog-spacing-title-to-description`
18+
`--mod-standard-dialog-header-content-font-size`
19+
20+
_Renamed Mods_
21+
`--mod-dialog-confirm-small-width` > `--mod-standard-dialog-max-width-small`
22+
`--mod-dialog-confirm-medium-width` > `--mod-standard-dialog-max-width`
23+
`--mod-dialog-confirm-large-width` > `--mod-standard-dialog-max-width-large`
24+
`--mod-dialog-confirm-border-radius` > `--mod-standard-dialog-border-radius`
25+
`--mod-dialog-confirm-description-text-size` > `--mod-standard-dialog-description-font-size`
26+
`--mod-dialog-confirm-description-text-line-height` > `--mod-standard-dialog-description-line-height`
27+
`--mod-dialog-confirm-description-text-color` > `--mod-standard-dialog-description-text-color`
28+
`--mod-dialog-confirm-description-font-weight` > `--mod-standard-dialog-description-font-weight`
29+
`--mod-dialog-heading-font-weight` > `--mod-standard-dialog-heading-font-weight`
30+
`--mod-dialog-confirm-title-text-line-height` > `--mod-standard-dialog-heading-line-height`
31+
`--mod-dialog-confirm-title-text-color` > `--mod-standard-dialog-heading-text-color`
32+
`--mod-dialog-confirm-title-text-size` > `--mod-standard-dialog-heading-font-size`
33+
`--mod-dialog-confirm-hero-height` > `--mod-standard-dialog-hero-block-size`
34+
`--mod-dialog-min-inline-size` > `--mod-standard-dialog-min-inline-size`
35+
`--mod-dialog-confirm-padding-grid` > `--mod-standard-dialog-spacing-grid-padding`
36+
`--mod-dialog-confirm-footer-padding-top` > `--mod-standard-dialog-spacing-description-to-footer`
37+
`--mod-dialog-confirm-close-button-padding` > `--mod-standard-dialog-spacing-edge-to-close-button`
38+
`--mod-dialog-confirm-gap-size` > `--mod-standard-dialog-spacing-footer-to-button-group`
39+
40+
_Removed Mods_
41+
`--mod-dialog-confirm-buttongroup-padding-top`
42+
`--mod-dialog-confirm-close-button-size`
43+
`--mod-dialog-confirm-description-margin`
44+
`--mod-dialog-confirm-description-padding`
45+
`--mod-dialog-confirm-divider-block-spacing-end`
46+
`--mod-dialog-confirm-divider-block-spacing-start`
47+
`--mod-dialog-confirm-divider-height`
48+
49+
Modal and underlay updates
50+
51+
- Modal component now uses the updated corner rounding.
52+
- Underlay has an updated comment that addresses the overlay-color/overlay-opacity tokens.

components/buttongroup/index.css

+14-14
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,28 @@ governing permissions and limitations under the License.
1111
*/
1212

1313
.spectrum-ButtonGroup {
14-
--spectrum-buttongroup-spacing-horizontal: var(--spectrum-spacing-200);
15-
--spectrum-buttongroup-spacing-vertical: var(--spectrum-spacing-200);
14+
--spectrum-buttongroup-spacing-horizontal: var(--spectrum-spacing-200);
15+
--spectrum-buttongroup-spacing-vertical: var(--spectrum-spacing-200);
1616
}
1717

1818
.spectrum-ButtonGroup--sizeS {
19-
--spectrum-buttongroup-spacing-horizontal: var(--spectrum-spacing-100);
20-
--spectrum-buttongroup-spacing-vertical: var(--spectrum-spacing-100);
19+
--spectrum-buttongroup-spacing-horizontal: var(--spectrum-spacing-100);
20+
--spectrum-buttongroup-spacing-vertical: var(--spectrum-spacing-100);
2121
}
2222

2323
.spectrum-ButtonGroup {
24-
display: flex;
25-
flex-wrap: wrap;
26-
gap: var(--mod-buttongroup-spacing-horizontal, var(--spectrum-buttongroup-spacing-horizontal));
27-
justify-content: var(--mod-buttongroup-justify-content, normal);
24+
display: flex;
25+
flex-wrap: var(--mod-buttongroup-flex-wrap, wrap);
26+
gap: var(--mod-buttongroup-spacing-horizontal, var(--spectrum-buttongroup-spacing-horizontal));
27+
justify-content: var(--mod-buttongroup-justify-content, normal);
2828

29-
.spectrum-ButtonGroup-item {
30-
flex-shrink: 0;
31-
}
29+
.spectrum-ButtonGroup-item {
30+
flex-shrink: 0;
31+
}
3232
}
3333

3434
.spectrum-ButtonGroup--vertical {
35-
display: inline-flex;
36-
flex-direction: column;
37-
gap: var(--mod-buttongroup-spacing-vertical, var(--spectrum-buttongroup-spacing-vertical));
35+
display: inline-flex;
36+
flex-direction: column;
37+
gap: var(--mod-buttongroup-spacing-vertical, var(--spectrum-buttongroup-spacing-vertical));
3838
}
+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
| Modifiable custom properties |
22
| -------------------------------------- |
3+
| `--mod-buttongroup-flex-wrap` |
34
| `--mod-buttongroup-justify-content` |
45
| `--mod-buttongroup-spacing-horizontal` |
56
| `--mod-buttongroup-spacing-vertical` |

0 commit comments

Comments
 (0)