Skip to content

Commit 97fe29f

Browse files
authored
Merge pull request #3157 from adobe/aramos-adobe/css930-buttongroup-doc-migration
docs(buttongroup): adding vertical horizontal and disabled stories
2 parents bccce81 + eb5f424 commit 97fe29f

File tree

3 files changed

+91
-12
lines changed

3 files changed

+91
-12
lines changed

components/buttongroup/metadata/buttongroup.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Button group
2-
SpectrumSiteSlug: https://spectrum.adobe.com/page/button/
2+
SpectrumSiteSlug: https://spectrum.adobe.com/page/button-group/
33
sections:
44
- name: Custom Properties API
55
description: |

components/buttongroup/stories/buttongroup.stories.js

Lines changed: 73 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import pkgJson from "../package.json";
55
import { ButtonGroup } from "./buttongroup.test.js";
66

77
/**
8-
* A grouping of buttons.
8+
* A button group is a grouping of buttons whose actions are related to each other.
99
*/
1010
export default {
1111
title: "Button group",
@@ -36,34 +36,96 @@ export default {
3636
size: "m",
3737
iconName: undefined,
3838
vertical: false,
39+
items: [
40+
{
41+
variant: "secondary",
42+
treatment: "outline",
43+
label: "No, thanks",
44+
45+
},
46+
{
47+
variant: "secondary",
48+
treatment: "outline",
49+
label: "Remind me later",
50+
},
51+
{
52+
variant: "primary",
53+
treatment: "fill",
54+
label: "Rate now",
55+
},
56+
],
3957
},
4058
parameters: {
4159
packageJson: pkgJson,
4260
},
4361
};
4462

4563
export const Default = ButtonGroup.bind({});
46-
Default.args = {
64+
Default.args = {};
65+
Default.tags = ["!autodocs"];
66+
67+
// ********* DOCS ONLY ********* //
68+
69+
/**
70+
* Default spacing for Medium, Large, and Extra Large t-shirt sizes.
71+
*/
72+
export const Horizontal = ButtonGroup.bind({});
73+
Horizontal.tags = ["!dev"];
74+
Horizontal.args = Default.args;
75+
76+
77+
/**
78+
* Spacing for the Small t-shirt size.
79+
*/
80+
export const HorizontalSmall = ButtonGroup.bind({});
81+
HorizontalSmall.tags = ["!dev"];
82+
HorizontalSmall.args = {
83+
size: "s"
84+
};
85+
86+
/**
87+
* Default spacing for Medium, Large, and Extra Large t-shirt sizes
88+
*/
89+
export const Vertical = ButtonGroup.bind({});
90+
Vertical.tags = ["!dev"];
91+
Vertical.args = {
92+
vertical: true,
93+
};
94+
95+
/**
96+
* Spacing for the Small t-shirt size.
97+
*/
98+
export const VerticalSmall = ButtonGroup.bind({});
99+
VerticalSmall.tags = ["!dev"];
100+
VerticalSmall.args = {
101+
vertical: true,
102+
size: "s"
103+
};
104+
105+
/**
106+
* A button group in a disabled state shows that the buttons within the group exist, but are not available in that circumstance. This state can be used to maintain layout continuity and to communicate that a button group may become available later.
107+
*/
108+
109+
export const Disabled = ButtonGroup.bind({});
110+
Disabled.tags = ["!dev"];
111+
Disabled.args = {
47112
items: [
48113
{
49114
variant: "secondary",
50115
treatment: "outline",
51-
label: "No, thanks",
52-
},
53-
{
54-
variant: "secondary",
55-
treatment: "outline",
56-
label: "Remind me later",
57-
116+
label: "Cancel",
117+
isDisabled: true,
58118
},
59119
{
60120
variant: "primary",
61121
treatment: "fill",
62-
label: "Rate now",
122+
label: "Enable",
123+
isDisabled: true,
63124
},
64-
],
125+
]
65126
};
66127

128+
67129
// ********* VRT ONLY ********* //
68130
export const WithForcedColors = ButtonGroup.bind({});
69131
WithForcedColors.args = Default.args;

components/buttongroup/stories/buttongroup.test.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,22 @@ export const ButtonGroup = Variants({
1111
testHeading: "Vertical",
1212
vertical: true,
1313
},
14+
{
15+
testHeading: "Disabled",
16+
items: [
17+
{
18+
variant: "secondary",
19+
treatment: "outline",
20+
label: "Cancel",
21+
isDisabled: true,
22+
},
23+
{
24+
variant: "primary",
25+
treatment: "fill",
26+
label: "Enable",
27+
isDisabled: true,
28+
},
29+
]
30+
}
1431
],
1532
});

0 commit comments

Comments
 (0)