Skip to content

Commit 6ec7da0

Browse files
marissahuysentruytcastastrophe
authored andcommitted
chore(assetcard,avatar,badge): remove mdx files (#3408)
* docs(assetcard): remove MDX file - adds some missing documentation regarding stories, classes and custom properties - corrects sentence-casing of story names * docs(avatar): remove MDX file - adds some missing documentation regarding stories - reorganizes some information to sit with appropriate story/variant - migrates documentation from MDX file to the stories file instead * chore(avatar): fix disabled test arguments * docs(badge): remove MDX file - adds notice badge variants to semantic story - adds sizing story to docs page - migrates documentation in MDX to stories.js instead * docs(badge): pr fixes - remove empty doc block line - remove html wrapper in favor of content array - add notice badge to test coverage
1 parent e5da4fa commit 6ec7da0

File tree

9 files changed

+105
-207
lines changed

9 files changed

+105
-207
lines changed

components/assetcard/stories/assetcard.mdx

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

components/assetcard/stories/assetcard.stories.js

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import { Template } from "./template.js";
88

99
/**
1010
* The asset card component allows users to select and manage assets and their metadata in a grid.
11+
*
12+
* ## Usage notes
13+
* Set the `--spectrum-assetcard-asset-size` custom property to the size at which you want to display the asset.
14+
*
1115
*/
1216
export default {
1317
title: "Asset card",
@@ -89,7 +93,6 @@ export default {
8993
packageJson,
9094
metadata,
9195
},
92-
tags: ["!autodocs"],
9396
};
9497

9598
export const Default = AssetCardGroup.bind({});
@@ -98,8 +101,13 @@ Default.args = {
98101
exampleImage: "portrait",
99102
content: ["Image"],
100103
};
104+
Default.tags = ["!autodocs"];
101105

102106
// ********* DOCS ONLY ********* //
107+
/**
108+
* Inside the tile, an asset card displays the preview of the item it represents. The preview has different styles, depending on the type of item.
109+
*
110+
* The default asset card is also referred to as "portrait." */
103111
export const Portrait = Template.bind({});
104112
Portrait.args = {
105113
title: "Portrait asset",
@@ -110,6 +118,7 @@ Portrait.tags = ["!dev"];
110118
Portrait.parameters = {
111119
chromatic: { disableSnapshot: true },
112120
};
121+
Portrait.storyName = "Default";
113122

114123
export const Landscape = Template.bind({});
115124
Landscape.args = {
@@ -131,6 +140,9 @@ Square.parameters = {
131140
chromatic: { disableSnapshot: true },
132141
};
133142

143+
/**
144+
* Asset cards have two optional content areas for extra information: `.spectrum-AssetCard-content` and `.spectrum-AssetCard-headerContent`. These content areas can include time stamps, non-interactive rating indicators, colored labels, badges, and more.
145+
*/
134146
export const OptionalContent = Template.bind({});
135147
OptionalContent.args = {
136148
title: "MVI_0123.mp4",
@@ -141,7 +153,11 @@ OptionalContent.tags = ["!dev"];
141153
OptionalContent.parameters = {
142154
chromatic: { disableSnapshot: true },
143155
};
156+
OptionalContent.storyName = "Optional content";
144157

158+
/**
159+
* Sometimes it may not make sense to use checkboxes to indicate selection. In those rare cases, show a highlighted state when a user is inspecting one or more cards.
160+
*/
145161
export const HighlightSelection = Template.bind({});
146162
HighlightSelection.args = {
147163
title: "Highlight selection",
@@ -153,7 +169,11 @@ HighlightSelection.tags = ["!dev"];
153169
HighlightSelection.parameters = {
154170
chromatic: { disableSnapshot: true },
155171
};
172+
HighlightSelection.storyName = "Selection - highlight";
156173

174+
/**
175+
* Some cards allow selection, on which the user can take an action. Both single-select and multi-select cards have checkboxes on the top left of the card (or in the top right for RTL languages).
176+
*/
157177
export const CheckboxSelection = Template.bind({});
158178
CheckboxSelection.args = {
159179
title: "Checkbox selection",
@@ -165,7 +185,11 @@ CheckboxSelection.tags = ["!dev"];
165185
CheckboxSelection.parameters = {
166186
chromatic: { disableSnapshot: true },
167187
};
188+
CheckboxSelection.storyName = "Selection - checkbox";
168189

190+
/**
191+
* In cases where it’s important for users to know the order in which they have selected multiple cards — for example, to add video clips to a sequence — use ordered selection. Ordered selection must be multi-selectable.
192+
*/
169193
export const OrderedSelection = Template.bind({});
170194
OrderedSelection.args = {
171195
title: "Ordered selection",
@@ -177,6 +201,7 @@ OrderedSelection.tags = ["!dev"];
177201
OrderedSelection.parameters = {
178202
chromatic: { disableSnapshot: true },
179203
};
204+
OrderedSelection.storyName = "Selection - ordered";
180205

181206
export const DropTarget = Template.bind({});
182207
DropTarget.args = {
@@ -190,6 +215,7 @@ DropTarget.tags = ["!dev"];
190215
DropTarget.parameters = {
191216
chromatic: { disableSnapshot: true },
192217
};
218+
DropTarget.storyName = "Drop target";
193219

194220
// ********* VRT ONLY ********* //
195221
export const WithForcedColors = AssetCardGroup.bind({});

components/avatar/stories/avatar.mdx

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

components/avatar/stories/avatar.stories.js

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@ import { AvatarGroup } from "./avatar.test.js";
77
import { Template } from "./template.js";
88

99
/**
10-
* An image representing a user. Note that a div wrapper is required for avatar:
11-
* ```
12-
* <div class="spectrum-Avatar spectrum-Avatar--size50">
13-
* <img class="spectrum-Avatar-image" src="img/example-ava.jpg" alt="Avatar">
14-
* </div>
15-
* ```
10+
* An image representing a user.
1611
*/
1712
export default {
1813
title: "Avatar",
@@ -65,25 +60,49 @@ export default {
6560
packageJson,
6661
metadata,
6762
},
68-
tags: ["!autodocs"],
6963
};
7064

65+
/**
66+
* Note that a `div` wrapper is required for avatar:
67+
* ```
68+
* <div class="spectrum-Avatar spectrum-Avatar--size50">
69+
* <img class="spectrum-Avatar-image" src="img/example-ava.jpg" alt="Avatar">
70+
* </div>
71+
* ```
72+
*/
7173
export const Default = AvatarGroup.bind({});
7274
Default.args = {};
7375

7476
// ********* DOCS ONLY ********* //
75-
export const SizeOptions = (args, context) => Sizes({
77+
/** Avatar sizes scale exponentially, based on the Spectrum type scale. These range from size-50 to size-700, with the default size for an avatar being `100`. An avatar can also be customized to fit appropriately for your context.
78+
*
79+
* Avatar is available in many sizes using the required `.spectrum-Avatar--size<number>` class. The available size classes are:
80+
81+
- `spectrum-Avatar--size50`
82+
- `spectrum-Avatar--size75`
83+
- `spectrum-Avatar--size100`
84+
- `spectrum-Avatar--size200`
85+
- `spectrum-Avatar--size300`
86+
- `spectrum-Avatar--size400`
87+
- `spectrum-Avatar--size500`
88+
- `spectrum-Avatar--size600`
89+
- `spectrum-Avatar--size700`
90+
*/
91+
export const Sizing = (args, context) => Sizes({
7692
Template,
7793
withHeading: false,
7894
withBorder: false,
7995
...args
8096
}, context);
81-
SizeOptions.tags = ["!dev"];
82-
SizeOptions.args = Default.args;
83-
SizeOptions.parameters = {
97+
Sizing.tags = ["!dev"];
98+
Sizing.args = Default.args;
99+
Sizing.parameters = {
84100
chromatic: { disableSnapshot: true },
85101
};
86102

103+
/**
104+
* An avatar image is wrapped in a link that uses the `.spectrum-Avatar-link` class by default, however, an avatar may also be used without a link.
105+
*/
87106
export const NoLink = Template.bind({});
88107
NoLink.tags = ["!dev"];
89108
NoLink.args = {
@@ -94,7 +113,10 @@ NoLink.args = {
94113
NoLink.parameters = {
95114
chromatic: { disableSnapshot: true },
96115
};
116+
NoLink.storyName = "No link";
97117

118+
/**
119+
* When disabled, the avatar should only be used without a link.*/
98120
export const Disabled = Template.bind({});
99121
Disabled.tags = ["!dev"];
100122
Disabled.args = {

components/avatar/stories/avatar.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const AvatarGroup = Variants({
1010
}, {
1111
testHeading: "Disabled",
1212
isDisabled: true,
13+
hasLink: false,
1314
}, {
1415
testHeading: "Focused",
1516
isFocused: true,

components/badge/stories/badge.mdx

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

0 commit comments

Comments
 (0)