Skip to content

Commit 90275f5

Browse files
jenndiazcastastrophe
authored andcommitted
feat(buttongroup)!: 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 58d7841 commit 90275f5

File tree

7 files changed

+21
-76
lines changed

7 files changed

+21
-76
lines changed

components/buttongroup/index.css

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

14-
@import "./themes/spectrum-two.css";
15-
1614
.spectrum-ButtonGroup {
17-
/* @deprecated --mod-buttongroup-spacing-horizontal -- replaced by --mod-buttongroup-spacing */
18-
--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));
1916
--spectrum-buttongroup-display: flex;
2017
--spectrum-buttongroup-flex-direction: row;
21-
--spectrum-buttongroup-justify-content: var(--mod-buttongroup-justify-content, normal);
22-
23-
&.spectrum-ButtonGroup--sizeS {
24-
/* @deprecated --mod-buttongroup-spacing-horizontal -- replaced by --mod-buttongroup-spacing */
25-
--spectrum-buttongroup-spacing: var(--mod-buttongroup-spacing, var(--mod-buttongroup-spacing-horizontal, var(--spectrum-spacing-200)));
26-
}
18+
--spectrum-buttongroup-justify-content: var(--mod-buttongroup-justify-content, flex-start);
19+
}
2720

28-
&.spectrum-ButtonGroup--vertical {
29-
/* @deprecated --mod-buttongroup-spacing-vertical -- replaced by generic --mod-buttongroup-spacing */
30-
--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+
}
3124

32-
--spectrum-buttongroup-display: inline-flex;
33-
--spectrum-buttongroup-flex-direction: column;
34-
}
25+
.spectrum-ButtonGroup--vertical {
26+
--spectrum-buttongroup-display: inline-flex;
27+
--spectrum-buttongroup-flex-direction: column;
3528
}
3629

3730
.spectrum-ButtonGroup {

components/buttongroup/metadata/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",
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
| Modifiable custom properties |
2-
| -------------------------------------- |
3-
| `--mod-buttongroup-justify-content` |
4-
| `--mod-buttongroup-spacing` |
5-
| `--mod-buttongroup-spacing-horizontal` |
6-
| `--mod-buttongroup-spacing-vertical` |
1+
| Modifiable custom properties |
2+
| ----------------------------------- |
3+
| `--mod-buttongroup-justify-content` |
4+
| `--mod-buttongroup-spacing` |

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/buttongroup/themes/express.css

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

components/buttongroup/themes/spectrum-two.css

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

components/buttongroup/themes/spectrum.css

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

0 commit comments

Comments
 (0)