You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore[actionbutton, actiongroup]: fix application of aria-labels (#3230)
* chore: aria-label only appears on icon-only button
* chore: refactors action group to use different args
- ensures that actiongroup arg types are used in some of the documentation
template instead of actionbutton args
- removes white space from stories file
- corrects some sentence-case instances for story names
* chore: fix context passing to template and indentation
Copy file name to clipboardExpand all lines: components/actionbutton/stories/actionbutton.stories.js
-16Lines changed: 0 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -99,26 +99,22 @@ Default.args = {};
99
99
Default.tags=["!autodocs"];
100
100
101
101
// ********* DOCS ONLY ********* //
102
-
103
102
/**
104
103
* Action buttons should always have a label, unless they are only using an icon that is universally understood and accessible. They can have an optional icon, but it should not be used for decoration. Use an icon only when necessary and when it has a strong association with the label text.
105
104
*
106
105
* The label can be hidden to create an icon-only action button. If the label is hidden, an icon is required, and the label will appear in a tooltip on hover.
107
106
*/
108
-
109
107
exportconstStandard=TreatmentTemplate.bind({});
110
108
Standard.args=Default.args;
111
109
Standard.tags=["!dev"];
112
110
Standard.parameters={
113
111
chromatic: {disableSnapshot: true},
114
112
};
115
-
116
113
Standard.storyName="Default";
117
114
118
115
/**
119
116
* The emphasized action button has a blue background for its selected state in order to provide a visual prominence. This is optimal for when the selection should call attention, such as within a tool bar.
120
117
*/
121
-
122
118
exportconstEmphasized=TreatmentTemplate.bind({});
123
119
Emphasized.tags=["!dev"];
124
120
Emphasized.args={
@@ -133,7 +129,6 @@ Emphasized.parameters = {
133
129
/**
134
130
* Adding the `.spectrum-ActionButton--emphasized` class to a quiet action button can be effective in calling attention.
* Quiet action buttons have no visible background until they’re interacted with. This style works best when a clear layout (vertical stack, table, grid) makes it easy to parse the buttons. Too many quiet components in a small space can be hard to read.
152
147
*/
153
-
154
148
exportconstQuiet=TreatmentTemplate.bind({});
155
149
Quiet.tags=["!dev"];
156
150
Quiet.args={
@@ -165,7 +159,6 @@ Quiet.parameters = {
165
159
/**
166
160
* An action button can have a hold icon (a small corner triangle). This icon indicates that holding down the action button for a short amount of time can reveal a popover menu, which can be used, for example, to switch between related actions. Because of the way padding is calculated, the hold icon must be placed before the workflow icon in the markup.
StaticWhiteQuiet.storyName="Static white (quiet)";
195
-
196
185
StaticWhiteQuiet.parameters={
197
186
chromatic: {disableSnapshot: true}
198
187
};
@@ -203,7 +192,6 @@ StaticBlackDocs.args = {
203
192
staticColor: "black",
204
193
};
205
194
StaticBlackDocs.storyName="Static black";
206
-
207
195
StaticBlackDocs.parameters={
208
196
chromatic: {disableSnapshot: true},
209
197
};
@@ -214,17 +202,14 @@ StaticBlackQuiet.args = {
214
202
staticColor: "black",
215
203
isQuiet: true,
216
204
};
217
-
218
205
StaticBlackQuiet.storyName="Static black (quiet)";
219
-
220
206
StaticBlackQuiet.parameters={
221
207
chromatic: {disableSnapshot: true}
222
208
};
223
209
224
210
/**
225
211
* Action buttons come in five different sizes: extra-small, small, medium, large, and extra-large. The medium size is the default and most frequently used option. Use the other sizes sparingly; they should be used to create a hierarchy of importance within the page.
* An action group in a disabled state shows that the action 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 an action group may become available later.
* When an action group is justified, it takes up the entire available container width, divided equally for each action button that is inside the group.
* When space is limited in an action group, there are 2 options for the group's overflow behavior: wrap or collapse. By default, an action group is set to wrap, meaning that the action buttons inside the group wrap to form another line. Alternatively, an action group can be set to collapse inside a **More (...)** action button.
0 commit comments