Skip to content

Commit cd06a57

Browse files
marissahuysentruytcastastrophe
authored andcommitted
chore(accordion,actionbar,asset): remove mdx files (#3407)
* docs(accordion): remove MDX file - adds accordion sizing story - migrates documentation in MDX to stories.js instead * docs(actionbar): remove MDX file - adds actionbar flexible and sticky variants to default/emphasized stories - migrates documentation in MDX to stories.js instead - updates references to mods tables * docs(asset): remove MDX file
1 parent 78b5240 commit cd06a57

File tree

7 files changed

+79
-157
lines changed

7 files changed

+79
-157
lines changed

components/accordion/stories/accordion.mdx

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

components/accordion/stories/accordion.stories.js

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { Template as Link } from "@spectrum-css/link/stories/template.js";
1+
import { Sizes } from "@spectrum-css/preview/decorators";
22
import { disableDefaultModes } from "@spectrum-css/preview/modes";
3+
import { Template as Link } from "@spectrum-css/link/stories/template.js";
34
import { size } from "@spectrum-css/preview/types";
45
import { Template as Typography } from "@spectrum-css/typography/stories/template.js";
56
import metadata from "../metadata/metadata.json";
@@ -9,6 +10,10 @@ import { Template } from "./template.js";
910

1011
/**
1112
* 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.
13+
*
14+
* ## Density options
15+
*
16+
* Accordion has three density options and requires that you specify one of the density types: compact, regular, or spacious.
1217
*/
1318
export default {
1419
title: "Accordion",
@@ -64,7 +69,6 @@ export default {
6469
packageJson,
6570
metadata,
6671
},
67-
tags: ["!autodocs"],
6872
};
6973

7074
/* Content sourced from: https://www.adobe.com/products/catalog.html#:~:text=Frequently%20asked%20questions. */
@@ -182,10 +186,30 @@ Compact.args = {
182186
items: content,
183187
density: "compact",
184188
};
189+
Compact.parameters = {
190+
chromatic: { disableSnapshot: true },
191+
};
192+
Compact.storyName = "Density - Compact";
185193

186194
export const Spacious = Template.bind({});
187195
Spacious.tags = ["!dev"];
188196
Spacious.args = {
189197
items: content,
190198
density: "spacious",
191199
};
200+
Spacious.parameters = {
201+
chromatic: { disableSnapshot: true },
202+
};
203+
Spacious.storyName = "Density - Spacious";
204+
205+
export const Sizing = (args, context) => Sizes({
206+
Template,
207+
withBorder: false,
208+
withHeading: false,
209+
items: content,
210+
...args,
211+
}, context);
212+
Sizing.tags = ["!dev"];
213+
Sizing.parameters = {
214+
chromatic: { disableSnapshot: true },
215+
};

components/actionbar/stories/actionbar.mdx

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

components/actionbar/stories/actionbar.stories.js

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ import { isEmphasized, isOpen } from "@spectrum-css/preview/types";
66
import metadata from "../metadata/metadata.json";
77
import packageJson from "../package.json";
88
import { ActionBarGroup } from "./actionbar.test.js";
9-
import { Template } from "./template.js";
9+
import { BehavioralTemplate } from "./template.js";
1010

1111
/**
12-
* The action bar component is a floating full width bar that appears upon selection.
12+
* The action bar component is a floating full width bar that appears upon selection. Action bars are used for single and bulk selection patterns, when a user needs to perform actions on either a single or multiple items at the same time.
13+
*
14+
* ## Popover dependency
15+
* Action bar requires popover, which is nested within the action bar. Action bar background, border, and corner radius are applied to the nested popover component and can be overridden by using action bar's `--mod-*` prefixed custom properties. A [list of the properties](#modifiable-properties) can be found below.
1316
*/
1417
export default {
1518
title: "Action bar",
@@ -70,11 +73,11 @@ export default {
7073
packageJson,
7174
metadata,
7275
},
73-
tags: ["!autodocs"],
7476
};
7577

7678
export const Default = ActionBarGroup.bind({});
7779
Default.args = {};
80+
Default.tags = ["!autodocs"];
7881

7982
// ********* VRT ONLY ********* //
8083
export const WithForcedColors = ActionBarGroup.bind({});
@@ -88,11 +91,26 @@ WithForcedColors.parameters = {
8891
};
8992

9093
// ********* DOCS ONLY ********* //
91-
export const Emphasized = Template.bind({});
94+
/**The emphasized action bar has a blue background that adds visual emphasis on the actions and selection. Use this for when the bar should call attention (e.g., floating in a table). */
95+
export const Emphasized = BehavioralTemplate.bind({});
9296
Emphasized.tags = ["!dev"];
9397
Emphasized.args = {
9498
isEmphasized: true,
9599
};
96100
Emphasized.parameters = {
97101
chromatic: { disableSnapshot: true },
98102
};
103+
104+
/** By default, action bars fill the width of their container. Below are example of the other behavioral variants available.
105+
*
106+
* - Standard action bars fill the width of their container.
107+
* - Flexible action bars fit the width of their content.
108+
* - Sticky action bars will sit on top of content until dismissed. Scroll down on this example to view how the sticky action bar behaves within a scrollable element.
109+
*
110+
*/
111+
export const Standard = BehavioralTemplate.bind({});
112+
Standard.parameters = {
113+
chromatic: { disableSnapshot: true },
114+
};
115+
Standard.tags = ["!dev"];
116+
Standard.storyName = "Default";

components/actionbar/stories/template.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Container } from "@spectrum-css/preview/decorators";
12
import { Template as ActionGroup } from "@spectrum-css/actiongroup/stories/template.js";
23
import { Template as CloseButton } from "@spectrum-css/closebutton/stories/template.js";
34
import { Template as FieldLabel } from "@spectrum-css/fieldlabel/stories/template.js";
@@ -76,3 +77,33 @@ export const Template = ({
7677
</div>
7778
`;
7879
};
80+
81+
/* This template shows standard, flexible, and sticky action bars in one story. */
82+
/* The fixed behavior works best in an iframe, so is not represented in this template. */
83+
export const BehavioralTemplate = (args, context) => Container({
84+
withBorder: false,
85+
withHeading: false,
86+
direction: "column",
87+
content: html`
88+
${Container({
89+
withBorder: false,
90+
heading: "Standard",
91+
content: Template({...args, customPopoverStyles: {"transform": "unset"}}, context)
92+
})}
93+
${Container({
94+
withBorder: false,
95+
heading: "Flexible",
96+
content: Template({...args, isFlexible: true,}, context)
97+
})}
98+
${Container({
99+
withBorder: false,
100+
heading: "Sticky",
101+
containerStyles: {
102+
"max-block-size": "100px",
103+
"max-inline-size": " 550px",
104+
"overflow": "auto",
105+
},
106+
content: ["Scroll down to view sticky behavior. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", Template({...args, isSticky: true,}, context)]
107+
})}
108+
`
109+
});

components/asset/stories/asset.mdx

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

components/asset/stories/asset.stories.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ export default {
3939
packageJson,
4040
metadata,
4141
},
42-
tags: ["!autodocs"],
4342
};
4443

4544
export const Default = AssetGroup.bind({});

0 commit comments

Comments
 (0)