Skip to content

Commit b08105d

Browse files
jenndiazcastastrophe
authored andcommitted
feat(buttongroup,page)!: migrate to S2 (#2457)
BREAKING CHANGE: migrates Button Group to Spectrum 2 Also: * docs(buttongroup): expand chromatic coverage * refactor(buttongroup): remove extra css classes
1 parent a13c79d commit b08105d

File tree

7 files changed

+21
-72
lines changed

7 files changed

+21
-72
lines changed

components/buttongroup/dist/metadata.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22
"sourceFile": "index.css",
33
"selectors": [
44
".spectrum-ButtonGroup",
5-
".spectrum-ButtonGroup-item",
6-
".spectrum-ButtonGroup.spectrum-ButtonGroup--sizeS",
7-
".spectrum-ButtonGroup.spectrum-ButtonGroup--vertical"
5+
".spectrum-ButtonGroup--sizeS",
6+
".spectrum-ButtonGroup--vertical",
7+
".spectrum-ButtonGroup-item"
88
],
99
"modifiers": [
1010
"--mod-buttongroup-justify-content",
11-
"--mod-buttongroup-spacing",
12-
"--mod-buttongroup-spacing-horizontal",
13-
"--mod-buttongroup-spacing-vertical"
11+
"--mod-buttongroup-spacing"
1412
],
1513
"component": [
1614
"--spectrum-buttongroup-display",

components/buttongroup/index.css

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,19 @@
1212
*/
1313

1414
.spectrum-ButtonGroup {
15-
/* @deprecated --mod-buttongroup-spacing-horizontal -- replaced by --mod-buttongroup-spacing */
16-
--spectrum-buttongroup-spacing: var(--mod-buttongroup-spacing, var(--mod-buttongroup-spacing-horizontal, var(--spectrum-spacing-300)));
15+
--spectrum-buttongroup-spacing: var(--mod-buttongroup-spacing, var(--spectrum-spacing-300));
1716
--spectrum-buttongroup-display: flex;
1817
--spectrum-buttongroup-flex-direction: row;
19-
--spectrum-buttongroup-justify-content: var(--mod-buttongroup-justify-content, normal);
20-
21-
&.spectrum-ButtonGroup--sizeS {
22-
/* @deprecated --mod-buttongroup-spacing-horizontal -- replaced by --mod-buttongroup-spacing */
23-
--spectrum-buttongroup-spacing: var(--mod-buttongroup-spacing, var(--mod-buttongroup-spacing-horizontal, var(--spectrum-spacing-200)));
24-
}
18+
--spectrum-buttongroup-justify-content: var(--mod-buttongroup-justify-content, flex-start);
19+
}
2520

26-
&.spectrum-ButtonGroup--vertical {
27-
/* @deprecated --mod-buttongroup-spacing-vertical -- replaced by generic --mod-buttongroup-spacing */
28-
--mod-buttongroup-spacing: var(--mod-buttongroup-spacing-vertical);
21+
.spectrum-ButtonGroup--sizeS {
22+
--spectrum-buttongroup-spacing: var(--mod-buttongroup-spacing, var(--spectrum-spacing-200));
23+
}
2924

30-
--spectrum-buttongroup-display: inline-flex;
31-
--spectrum-buttongroup-flex-direction: column;
32-
}
25+
.spectrum-ButtonGroup--vertical {
26+
--spectrum-buttongroup-display: inline-flex;
27+
--spectrum-buttongroup-flex-direction: column;
3328
}
3429

3530
.spectrum-ButtonGroup {

components/buttongroup/stories/buttongroup.stories.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Default.tags = ["!autodocs"];
7474
// ********* DOCS ONLY ********* //
7575

7676
/**
77-
* Default spacing for Medium, Large, and Extra Large t-shirt sizes.
77+
* Default horizontal spacing for when using medium, large, and extra large buttons.
7878
*/
7979
export const Horizontal = Template.bind({});
8080
Horizontal.tags = ["!dev"];
@@ -87,7 +87,7 @@ Horizontal.parameters = {
8787
};
8888

8989
/**
90-
* Spacing for the Small t-shirt size.
90+
* Horizontal spacing for the small t-shirt size. Should be used with small buttons.
9191
*/
9292
export const HorizontalSmall = Template.bind({});
9393
HorizontalSmall.tags = ["!dev"];
@@ -102,7 +102,7 @@ HorizontalSmall.parameters = {
102102
};
103103

104104
/**
105-
* Default spacing for Medium, Large, and Extra Large t-shirt sizes
105+
* Default vertical spacing for when using medium, large, and extra large buttons.
106106
*/
107107
export const Vertical = ButtonGroup.bind({});
108108
Vertical.tags = ["!dev"];
@@ -117,7 +117,7 @@ Vertical.parameters = {
117117
};
118118

119119
/**
120-
* Spacing for the Small t-shirt size.
120+
* Vertical spacing for the small t-shirt size. Should be used with small buttons.
121121
*/
122122
export const VerticalSmall = Template.bind({});
123123
VerticalSmall.tags = ["!dev"];

components/page/dist/metadata.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
"--spectrum-page-content-tap-highlight"
88
],
99
"global": ["--spectrum-gray-75", "--spectrum-transparent-black-25"],
10-
"system-theme": [
11-
"--system-root-page-background-color",
12-
"--system-root-page-content-tap-highlight"
13-
],
10+
"system-theme": [],
1411
"passthroughs": [],
1512
"high-contrast": []
1613
}

components/page/index.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
* governing permissions and limitations under the License.
1212
*/
1313

14-
@import "./themes/spectrum-two.css";
15-
1614
:root {
15+
--spectrum-page-background-color: var(--spectrum-gray-75);
16+
--spectrum-page-content-tap-highlight: var(--spectrum-transparent-black-25);
17+
1718
background: var(--mod-page-background, var(--spectrum-page-background-color));
1819

1920
/* The highlight that appears over a link while it's being tapped */

components/page/themes/spectrum-two.css

Lines changed: 0 additions & 19 deletions
This file was deleted.

components/page/themes/spectrum.css

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)