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
* 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
Copy file name to clipboardExpand all lines: components/assetcard/stories/assetcard.stories.js
+27-1Lines changed: 27 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,10 @@ import { Template } from "./template.js";
8
8
9
9
/**
10
10
* 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
+
*
11
15
*/
12
16
exportdefault{
13
17
title: "Asset card",
@@ -89,7 +93,6 @@ export default {
89
93
packageJson,
90
94
metadata,
91
95
},
92
-
tags: ["!autodocs"],
93
96
};
94
97
95
98
exportconstDefault=AssetCardGroup.bind({});
@@ -98,8 +101,13 @@ Default.args = {
98
101
exampleImage: "portrait",
99
102
content: ["Image"],
100
103
};
104
+
Default.tags=["!autodocs"];
101
105
102
106
// ********* 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." */
103
111
exportconstPortrait=Template.bind({});
104
112
Portrait.args={
105
113
title: "Portrait asset",
@@ -110,6 +118,7 @@ Portrait.tags = ["!dev"];
110
118
Portrait.parameters={
111
119
chromatic: {disableSnapshot: true},
112
120
};
121
+
Portrait.storyName="Default";
113
122
114
123
exportconstLandscape=Template.bind({});
115
124
Landscape.args={
@@ -131,6 +140,9 @@ Square.parameters = {
131
140
chromatic: {disableSnapshot: true},
132
141
};
133
142
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.
* 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.
* 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).
* 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.
/** 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
+
exportconstSizing=(args,context)=>Sizes({
76
92
Template,
77
93
withHeading: false,
78
94
withBorder: false,
79
95
...args
80
96
},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={
84
100
chromatic: {disableSnapshot: true},
85
101
};
86
102
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
+
*/
87
106
exportconstNoLink=Template.bind({});
88
107
NoLink.tags=["!dev"];
89
108
NoLink.args={
@@ -94,7 +113,10 @@ NoLink.args = {
94
113
NoLink.parameters={
95
114
chromatic: {disableSnapshot: true},
96
115
};
116
+
NoLink.storyName="No link";
97
117
118
+
/**
119
+
* When disabled, the avatar should only be used without a link.*/
0 commit comments