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
- clarify language around density options
- other minor documentation edits for clarity, grammar, format, and
consistent class notation (`.class-name`)
- use sentence case where it wasn't used
- add description to hasNoInlinePadding
- add migrated tags/status
- move custom width story to hang out with the other docs only stories
- centers accordion - because default width tokens are applied, the
padded layout no longer seems necessary and looks awkward left-aligned,
but we can bring this back if there are unintended side effects
Copy file name to clipboardExpand all lines: components/accordion/stories/accordion.stories.js
+44-34Lines changed: 44 additions & 34 deletions
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,14 @@ import { AccordionGroup, testsContent as accordionContent } from "./accordion.te
7
7
import{Template}from"./template.js";
8
8
9
9
/**
10
-
* The accordion element contains a list of items that can be expanded or collapsed to reveal additional content or information associated with each item. There can be zero expanded items, exactly one expanded item, or more than one item expanded at a time, depending on the configuration. This list of items is defined by child accordion item elements.
10
+
* The accordion element contains a list of items that can be expanded or collapsed to reveal
11
+
* additional content or information associated with each item. There can be zero expanded items,
12
+
* exactly one expanded item, or more than one item expanded at a time, depending on the
13
+
* configuration. This list of items is defined by child accordion item elements.
11
14
*
12
-
* Accordion has three density options: regular (default), compact, or spacious. Each of the different densities have the same font size, but have tighter or looser vertical spacing between the rows.
15
+
* Accordion has three density options: regular (default), compact, or spacious. While all the
16
+
* densities maintain the same font size, compact density reduces vertical spacing between rows,
17
+
* while spacious density increases it.
13
18
*/
14
19
exportdefault{
15
20
title: "Accordion",
@@ -46,7 +51,8 @@ export default {
46
51
control: "select",
47
52
},
48
53
hasNoInlinePadding: {
49
-
name: "No Inline Padding Styling",
54
+
name: "No inline padding styling",
55
+
description: "Displays accordion item headers without default inline padding.",
50
56
type: {name: "boolean"},
51
57
table: {
52
58
type: {summary: "boolean"},
@@ -66,8 +72,6 @@ export default {
66
72
hasNoInlinePadding: false,
67
73
},
68
74
parameters: {
69
-
// Prevent an inacurate depiction of width due to "centered" layout's use of flex on the body.
* The compact density has less spacing between rows.
134
+
* The compact density has less vertical spacing between rows.
129
135
*/
130
136
exportconstCompact=Template.bind({});
131
137
Compact.tags=["!dev"];
@@ -139,7 +145,7 @@ Compact.parameters = {
139
145
Compact.storyName="Density: Compact";
140
146
141
147
/**
142
-
* The spacious density has more spacing between rows.
148
+
* The spacious density has more vertical spacing between rows.
143
149
*/
144
150
exportconstSpacious=Template.bind({});
145
151
Spacious.tags=["!dev"];
@@ -153,8 +159,9 @@ Spacious.parameters = {
153
159
Spacious.storyName="Density: Spacious";
154
160
155
161
/**
156
-
* Individual accordion items (of class `.spectrum-Accordion-item`) can be styled as disabled by applying the `is-disabled` class.
157
-
* This example markup also applies the `disabled` attribute on the heading button.
162
+
* Individual accordion items can be disabled by applying the `.is-disabled` class to the
163
+
* `.spectrum-Accordion-item` element. This example also demonstrates the use of the disabled
164
+
* attribute on the heading button.
158
165
*/
159
166
exportconstDisabled=Template.bind({});
160
167
Disabled.tags=["!dev"];
@@ -167,10 +174,10 @@ Disabled.parameters = {
167
174
};
168
175
169
176
/**
170
-
* The optional quiet style for accordion has no dividers between sections. This style works best when a clear layout
171
-
* (vertical stack, table, grid) makes it easy see and understand. Too many quiet components in a small space can be
172
-
* hard to differentiate. This can be applied by adding the `spectrum-Accordion--quiet` class alongside the
173
-
* parent `spectrum-Accordion` class.
177
+
* The optional quiet style for accordion has no dividers between sections. This style works best
178
+
* when a clear layout (vertical stack, table, grid) makes it easy to see and understand because
179
+
* too many quiet components in a small space can be hard to differentiate. This can be applied by
180
+
* adding the `.spectrum-Accordion--quiet` class alongside the parent `.spectrum-Accordion` class.
174
181
*/
175
182
exportconstQuiet=Template.bind({});
176
183
Quiet.tags=["!dev"];
@@ -183,11 +190,13 @@ Quiet.parameters = {
183
190
};
184
191
185
192
/**
186
-
* The optional no inline padding style for accordion. This sets no overall horizontal padding on either side of the component
187
-
* (but the body text content always keeps its own padding from the edge). This can be applied by adding the `spectrum-Accordion--noInlinePadding` class alongside the
188
-
* parent `spectrum-Accordion` class.
193
+
* Implementations may choose to remove inline padding from the accordion item headers by adding
194
+
* the `.spectrum-Accordion--noInlinePadding` class alongside the parent `.spectrum-Accordion`
195
+
* class. Accordion item header padding will be removed, but the body text content will keep its
0 commit comments