@@ -47,6 +47,43 @@ const imageDemoTransformSource = (_src, storyContext) => {
47
47
}}
48
48
argTypes = { {
49
49
imgSrc: { type: { name: ' string' , required: true } },
50
+ tag_name: {
51
+ type: { name: ' string' },
52
+ description: ' The root tag for the component' ,
53
+ table: {
54
+ defaultValue: {
55
+ summary: ' div' ,
56
+ },
57
+ },
58
+ },
59
+ inner_tag_name: {
60
+ type: { name: ' string' },
61
+ description:
62
+ ' The tag for both the media content and media object elements' ,
63
+ table: {
64
+ defaultValue: {
65
+ summary: ' div' ,
66
+ },
67
+ },
68
+ },
69
+ content_tag_name: {
70
+ type: { name: ' string' },
71
+ description: ' The tag for the media content element' ,
72
+ table: {
73
+ defaultValue: {
74
+ summary: ' `inner_tag_name`' ,
75
+ },
76
+ },
77
+ },
78
+ object_tag_name: {
79
+ type: { name: ' string' },
80
+ description: ' The tag for the media object element' ,
81
+ table: {
82
+ defaultValue: {
83
+ summary: ' `inner_tag_name`' ,
84
+ },
85
+ },
86
+ },
50
87
text: { type: { name: ' string' } },
51
88
class: { type: { name: ' string' } },
52
89
reverse: { type: { name: ' boolean' } },
@@ -175,3 +212,61 @@ By adding the `o-media--jaunty` class, the media object will have a fun little r
175
212
{ (args ) => imageDemo (args )}
176
213
</Story >
177
214
</Canvas >
215
+
216
+ ## Alignment
217
+
218
+ By default, the Media object optimizes its alignment based on its content alone.
219
+ This may result in inconsistent alignment when multiple Media objects with
220
+ inconsistent content lengths are displayed side by side.
221
+
222
+ You may add the ` o-media--align-start ` modifier to force consistent alignment
223
+ between adjacent Media objects. This pairs nicely with [ the Deck object modifier
224
+ of the same name] ( /docs/objects-deck--block-alignment ) .
225
+
226
+ <Canvas >
227
+ <Story
228
+ name = " Align Default"
229
+ args = { {
230
+ text: ' Default alignment' ,
231
+ }}
232
+ parameters = { {
233
+ docs: {
234
+ transformSource: imageDemoTransformSource ,
235
+ },
236
+ }}
237
+ >
238
+ { (args ) => imageDemo (args )}
239
+ </Story >
240
+ <Story
241
+ name = " Align Start"
242
+ args = { {
243
+ align_start: true ,
244
+ text: ' Align start alignment' ,
245
+ }}
246
+ parameters = { {
247
+ docs: {
248
+ transformSource: imageDemoTransformSource ,
249
+ },
250
+ }}
251
+ >
252
+ { (args ) => imageDemo (args )}
253
+ </Story >
254
+ </Canvas >
255
+
256
+ ## Template Properties
257
+
258
+ - ` class ` (string): Appends to the CSS class of the root element
259
+ - ` tag_name ` (string, default ` 'div' ` ): The root tag for the component
260
+ - ` inner_tag_name ` (string, default ` 'div' ` ): The tag for both the media content and media object elements
261
+ - ` object_tag_name ` (string, default ` inner_tag_name ` ): The tag for the media object element
262
+ - ` content_tag_name ` (string, default ` inner_tag_name ` ): The tag for the media content element
263
+ - ` align_start ` (boolean, default ` false ` ): Adds the ` o-media--align-start ` CSS class modifier
264
+ - ` jaunty ` (boolean, default ` false ` ): Adds the ` o-media--jaunty ` CSS class modifier
265
+ - ` generous ` (boolean, default ` false ` ): Adds the ` o-media--generous ` CSS class modifier
266
+ - ` reverse ` (boolean, default ` false ` ): Adds the ` o-media--reverse ` CSS class modifier
267
+ - ` reverse_markup ` (boolean, default ` false ` ): Flips the order of the object and content markup so that the content is first
268
+
269
+ ## Template Blocks
270
+
271
+ - ` object ` : Block for the static object (the image, checkbox, etc.)
272
+ - ` content ` : Block for the wrapping content (typically text)
0 commit comments