Skip to content

Commit bfe2e2c

Browse files
feat(toast): S2 migration (#3643)
* feat(toast): S2 migration * fix(toast): vertical and horizontal spacing * chore(toast): remove unused properties * chore(toast): additional spacing refinements and explanatory comments * marissa wip * styles wip * chore(toast): add .spectrum-Toast--noButton for SWC use * fix(toast): update toast test case message w/out button * fix(toast): update toast has button story * fix(toast): scope close button styles to toast * fix(toast): clean up a few typos --------- Co-authored-by: Marissa Huysentruyt <[email protected]>
1 parent 37c0f01 commit bfe2e2c

File tree

6 files changed

+163
-167
lines changed

6 files changed

+163
-167
lines changed

.changeset/red-kiwis-flash.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
"@spectrum-css/toast": major
3+
---
4+
5+
#### S2 toast migration
6+
7+
This migrates the `toast` component to S2. Custom properties have been remapped per the design spec. Mods have been added and placeholder icons have been updated from the new workflow icons. The toast no longer supports a divider.
8+
9+
##### Tokens
10+
11+
| Before | After |
12+
| ---------------------------- | ---------------------------- |
13+
| --spectrum-corner-radius-100 | --spectrum-corner-radius-800 |
14+
15+
##### Mods
16+
17+
The following mods have been added.
18+
19+
`--mod-toast-font-family`
20+
`--mod-toast-font-style`
21+
`--mod-toast-icon-block-size`
22+
`--mod-toast-spacing-action-button-to-close`
23+
`--mod-toast-spacing-bottom-edge-to-close-button`
24+
`--mod-toast-spacing-close-button-to-edge`
25+
`--mod-toast-spacing-text-to-close-button`
26+
`--mod-toast-spacing-top-edge-to-close-button`
27+
28+
##### Passthroughs
29+
30+
The following passthrough has been added.
31+
32+
`--mod-closebutton-icon-color-default`

components/toast/dist/metadata.json

+36-39
Original file line numberDiff line numberDiff line change
@@ -2,103 +2,100 @@
22
"sourceFile": "index.css",
33
"selectors": [
44
".spectrum-Toast",
5+
".spectrum-Toast .spectrum-Button",
6+
".spectrum-Toast .spectrum-CloseButton",
57
".spectrum-Toast--info",
6-
".spectrum-Toast--info .spectrum-Toast-closeButton:focus-visible:not(:active)",
78
".spectrum-Toast--negative",
8-
".spectrum-Toast--negative .spectrum-Toast-closeButton:focus-visible:not(:active)",
99
".spectrum-Toast--positive",
10-
".spectrum-Toast--positive .spectrum-Toast-closeButton:focus-visible:not(:active)",
1110
".spectrum-Toast-body",
12-
".spectrum-Toast-body + .spectrum-Toast-buttons",
13-
".spectrum-Toast-body .spectrum-Button",
14-
".spectrum-Toast-body .spectrum-Button:dir(rtl)",
15-
".spectrum-Toast-buttons",
16-
".spectrum-Toast-buttons .spectrum-CloseButton",
1711
".spectrum-Toast-content",
1812
".spectrum-Toast-content:lang(ja)",
1913
".spectrum-Toast-content:lang(ko)",
2014
".spectrum-Toast-content:lang(zh)",
15+
".spectrum-Toast-text",
2116
".spectrum-Toast-typeIcon",
22-
"[dir=\"rtl\"] .spectrum-Toast-body .spectrum-Button"
17+
".spectrum-Toast.spectrum-Toast--noButton",
18+
".spectrum-Toast:not(:has(.spectrum-Button))"
2319
],
2420
"modifiers": [
2521
"--mod-toast-background-color-default",
26-
"--mod-toast-block-size",
27-
"--mod-toast-border-width",
2822
"--mod-toast-corner-radius",
29-
"--mod-toast-divider-color",
23+
"--mod-toast-font-family",
3024
"--mod-toast-font-size",
25+
"--mod-toast-font-style",
3126
"--mod-toast-font-weight",
27+
"--mod-toast-icon-block-size",
3228
"--mod-toast-informative-background-color-default",
3329
"--mod-toast-line-height",
3430
"--mod-toast-line-height-cjk",
3531
"--mod-toast-max-inline-size",
32+
"--mod-toast-min-block-size",
3633
"--mod-toast-negative-background-color-default",
3734
"--mod-toast-positive-background-color-default",
38-
"--mod-toast-spacing-block-end",
39-
"--mod-toast-spacing-block-start",
40-
"--mod-toast-spacing-bottom-edge-to-divider",
41-
"--mod-toast-spacing-bottom-edge-to-text",
42-
"--mod-toast-spacing-close-button",
35+
"--mod-toast-spacing-block-close-button",
36+
"--mod-toast-spacing-button-to-close-button-horizontal",
37+
"--mod-toast-spacing-close-button-to-end-edge",
4338
"--mod-toast-spacing-icon-to-text",
4439
"--mod-toast-spacing-start-edge-to-text-and-icon",
45-
"--mod-toast-spacing-text-and-action-button-to-divider",
46-
"--mod-toast-spacing-text-to-action-button-horizontal",
47-
"--mod-toast-spacing-top-edge-to-divider",
48-
"--mod-toast-spacing-top-edge-to-icon",
49-
"--mod-toast-spacing-top-edge-to-text",
40+
"--mod-toast-spacing-text-to-button-vertical",
41+
"--mod-toast-spacing-text-to-close-button",
42+
"--mod-toast-spacing-toast-to-edge",
5043
"--mod-toast-text-and-icon-color"
5144
],
5245
"component": [
5346
"--spectrum-toast-background-color-default",
54-
"--spectrum-toast-block-size",
55-
"--spectrum-toast-border-width",
5647
"--spectrum-toast-bottom-to-text",
5748
"--spectrum-toast-corner-radius",
58-
"--spectrum-toast-divider-color",
49+
"--spectrum-toast-font-family",
5950
"--spectrum-toast-font-size",
51+
"--spectrum-toast-font-style",
6052
"--spectrum-toast-font-weight",
6153
"--spectrum-toast-height",
54+
"--spectrum-toast-icon-block-size",
6255
"--spectrum-toast-informative-background-color-default",
6356
"--spectrum-toast-line-height",
6457
"--spectrum-toast-line-height-cjk",
6558
"--spectrum-toast-max-inline-size",
6659
"--spectrum-toast-maximum-width",
60+
"--spectrum-toast-min-block-size",
6761
"--spectrum-toast-negative-background-color-default",
6862
"--spectrum-toast-positive-background-color-default",
69-
"--spectrum-toast-spacing-block-end",
70-
"--spectrum-toast-spacing-block-start",
71-
"--spectrum-toast-spacing-bottom-edge-to-divider",
63+
"--spectrum-toast-spacing-block-close-button",
7264
"--spectrum-toast-spacing-bottom-edge-to-text",
73-
"--spectrum-toast-spacing-close-button",
65+
"--spectrum-toast-spacing-button-to-close-button-horizontal",
66+
"--spectrum-toast-spacing-close-button-to-end-edge",
67+
"--spectrum-toast-spacing-edge-to-button-vertical",
7468
"--spectrum-toast-spacing-icon-to-text",
7569
"--spectrum-toast-spacing-start-edge-to-text-and-icon",
76-
"--spectrum-toast-spacing-text-and-action-button-to-divider",
77-
"--spectrum-toast-spacing-text-to-action-button-horizontal",
78-
"--spectrum-toast-spacing-top-edge-to-divider",
70+
"--spectrum-toast-spacing-text-to-button-horizontal",
71+
"--spectrum-toast-spacing-text-to-close-button",
72+
"--spectrum-toast-spacing-toast-to-edge",
7973
"--spectrum-toast-spacing-top-edge-to-icon",
8074
"--spectrum-toast-spacing-top-edge-to-text",
8175
"--spectrum-toast-text-and-icon-color",
8276
"--spectrum-toast-top-to-text",
8377
"--spectrum-toast-top-to-workflow-icon"
8478
],
8579
"global": [
86-
"--spectrum-border-width-100",
8780
"--spectrum-cjk-line-height-100",
88-
"--spectrum-corner-radius-100",
81+
"--spectrum-corner-radius-800",
82+
"--spectrum-default-font-style",
8983
"--spectrum-font-size-100",
9084
"--spectrum-informative-background-color-default",
9185
"--spectrum-line-height-100",
9286
"--spectrum-negative-background-color-default",
9387
"--spectrum-neutral-subdued-background-color-default",
9488
"--spectrum-positive-background-color-default",
9589
"--spectrum-regular-font-weight",
90+
"--spectrum-sans-font-family-stack",
9691
"--spectrum-spacing-100",
92+
"--spectrum-spacing-200",
9793
"--spectrum-spacing-300",
98-
"--spectrum-text-to-visual-100",
99-
"--spectrum-transparent-white-400",
100-
"--spectrum-white"
94+
"--spectrum-spacing-400",
95+
"--spectrum-text-to-visual-300",
96+
"--spectrum-white",
97+
"--spectrum-workflow-icon-size-100"
10198
],
102-
"passthroughs": [],
103-
"high-contrast": ["--highcontrast-toast-border-color"]
99+
"passthroughs": ["--mod-closebutton-icon-color-default"],
100+
"high-contrast": []
104101
}

0 commit comments

Comments
 (0)