@@ -12,9 +12,7 @@ export default {
12
12
title : 'Buttons/Menu Item' ,
13
13
component : 'uui-menu-item' ,
14
14
decorators : [
15
- ( story : any ) => html `
16
- < div style ="max-width: 500px; "> ${ story ( ) } </ div >
17
- ` ,
15
+ ( story : any ) => html ` < div style ="max-width: 500px; "> ${ story ( ) } </ div > ` ,
18
16
] ,
19
17
id : 'uui-menu-item' ,
20
18
args : {
@@ -130,12 +128,12 @@ AAAOverview.parameters = {
130
128
131
129
export const Nested = ( ) =>
132
130
html `
133
- ${ labelNames . map (
134
- ( name : string ) =>
135
- html ` < uui-menu-item label ="${ name } " has-children >
136
- ${ renderItems ( ) }
137
- </ uui-menu-item > `
138
- ) }
131
+ ${ labelNames . map (
132
+ ( name : string ) =>
133
+ html ` < uui-menu-item label ="${ name } " has-children >
134
+ ${ renderItems ( ) }
135
+ </ uui-menu-item > `
136
+ ) }
139
137
` ;
140
138
Nested . parameters = {
141
139
docs : {
@@ -163,12 +161,12 @@ function activeStoryOnClick(e: UUIMenuItemEvent) {
163
161
164
162
export const Active = ( ) =>
165
163
html `
166
- ${ MenuItems . map (
167
- menuItem =>
168
- html `< uui-menu-item
164
+ ${ MenuItems . map (
165
+ menuItem =>
166
+ html `< uui-menu-item
169
167
label ="${ menuItem . title } "
170
168
@click-label =${ activeStoryOnClick } > </ uui-menu-item > `
171
- ) }
169
+ ) }
172
170
` ;
173
171
Active . parameters = {
174
172
docs : {
@@ -181,10 +179,12 @@ Active.parameters = {
181
179
182
180
export const Loading = ( ) =>
183
181
html `
184
- ${ MenuItems . map (
185
- menuItem =>
186
- html `< uui-menu-item label ="${ menuItem . title } " ?loading =${ menuItem . loading } > </ uui-menu-item > `
187
- ) }
182
+ ${ MenuItems . map (
183
+ menuItem =>
184
+ html `< uui-menu-item
185
+ label ="${ menuItem . title } "
186
+ ?loading =${ menuItem . loading } > </ uui-menu-item > `
187
+ ) }
188
188
` ;
189
189
Loading . parameters = {
190
190
docs : {
@@ -208,12 +208,14 @@ function disabledStoryOnClick(e: UUIMenuItemEvent) {
208
208
209
209
export const Disabled = ( ) =>
210
210
html `
211
- ${ MenuItems . map ( menuItem =>
212
- html `
213
- < uui-menu-item
214
- @click-label =${ disabledStoryOnClick }
215
- label ="${ menuItem . title } "> </ uui-menu-item >
216
- ` ) }
211
+ ${ MenuItems . map (
212
+ menuItem =>
213
+ html `
214
+ < uui-menu-item
215
+ @click-label =${ disabledStoryOnClick }
216
+ label ="${ menuItem . title } "> </ uui-menu-item >
217
+ `
218
+ ) }
217
219
` ;
218
220
Disabled . parameters = {
219
221
docs : {
@@ -226,16 +228,18 @@ Disabled.parameters = {
226
228
227
229
export const WithActions = ( ) =>
228
230
html `
229
- ${ MenuItems . map ( menuItem =>
230
- html `
231
- < uui-menu-item label ="${ menuItem . title } ">
232
- < uui-action-bar slot ="actions ">
233
- < uui-button label ="Open actions menu "
234
- > < uui-symbol-more > </ uui-symbol-more
235
- > </ uui-button >
236
- </ uui-action-bar >
237
- </ uui-menu-item >
238
- ` ) }
231
+ ${ MenuItems . map (
232
+ menuItem =>
233
+ html `
234
+ < uui-menu-item label ="${ menuItem . title } ">
235
+ < uui-action-bar slot ="actions ">
236
+ < uui-button label ="Open actions menu "
237
+ > < uui-symbol-more > </ uui-symbol-more
238
+ > </ uui-button >
239
+ </ uui-action-bar >
240
+ </ uui-menu-item >
241
+ `
242
+ ) }
239
243
` ;
240
244
WithActions . parameters = {
241
245
docs : {
@@ -255,7 +259,10 @@ WithActions.parameters = {
255
259
256
260
export const Selectable = ( ) =>
257
261
html `
258
- ${ MenuItems . map ( menuItem => html `< uui-menu-item label ="${ menuItem . title } "> </ uui-menu-item > ` ) }
262
+ ${ MenuItems . map (
263
+ menuItem =>
264
+ html `< uui-menu-item label ="${ menuItem . title } "> </ uui-menu-item > `
265
+ ) }
259
266
` ;
260
267
Selectable . args = {
261
268
selectable : true ,
@@ -273,24 +280,24 @@ Selectable.parameters = {
273
280
export const WithIcon = ( props : any ) =>
274
281
html `
275
282
< uui-icon-registry-essential >
276
- ${ MenuItems . map (
277
- menuItem =>
278
- html `
279
- < uui-menu-item
280
- label =${ menuItem . title }
281
- ?loading =${ props . loading }
282
- ?disabled=${ props . disabled }
283
- ?has-children=${ props . hasChildren }
284
- ?show-children=${ props . showChildren }
285
- ?selected=${ props . selected }
286
- ?active=${ props . active }
287
- ?selectable=${ props . selectable }
288
- href=${ props . href }
289
- target=${ props . target } >
290
- < uui-icon slot ="icon " name =${ menuItem . icon } > </ uui-icon >
291
- </ uui-menu-item >
292
- `
293
- ) }
283
+ ${ MenuItems . map (
284
+ menuItem =>
285
+ html `
286
+ < uui-menu-item
287
+ label =${ menuItem . title }
288
+ ?loading =${ props . loading }
289
+ ?disabled=${ props . disabled }
290
+ ?has-children=${ props . hasChildren }
291
+ ?show-children=${ props . showChildren }
292
+ ?selected=${ props . selected }
293
+ ?active=${ props . active }
294
+ ?selectable=${ props . selectable }
295
+ href=${ props . href }
296
+ target=${ props . target } >
297
+ < uui-icon slot ="icon " name =${ menuItem . icon } > </ uui-icon >
298
+ </ uui-menu-item >
299
+ `
300
+ ) }
294
301
</ uui-icon-registry-essential >
295
302
` ;
296
303
WithIcon . parameters = {
@@ -308,19 +315,19 @@ WithIcon.parameters = {
308
315
export const AnchorTag = ( props : any ) =>
309
316
html `
310
317
< uui-icon-registry-essential >
311
- < uui-menu-item
312
- label =${ props . label }
313
- ?loading =${ props . loading }
314
- ?disabled=${ props . disabled }
315
- ?has-children=${ props . hasChildren }
316
- ?show-children=${ props . showChildren }
317
- ?selected=${ props . selected }
318
- ?active=${ props . active }
319
- ?selectable=${ props . selectable }
320
- href=${ props . href }
321
- target=${ props . target } >
322
- < uui-icon slot ="icon " name ="document "> </ uui-icon >
323
- </ uui-menu-item >
318
+ < uui-menu-item
319
+ label =${ props . label }
320
+ ?loading =${ props . loading }
321
+ ?disabled=${ props . disabled }
322
+ ?has-children=${ props . hasChildren }
323
+ ?show-children=${ props . showChildren }
324
+ ?selected=${ props . selected }
325
+ ?active=${ props . active }
326
+ ?selectable=${ props . selectable }
327
+ href=${ props . href }
328
+ target=${ props . target } >
329
+ < uui-icon slot ="icon " name ="document "> </ uui-icon >
330
+ </ uui-menu-item >
324
331
</ uui-icon-registry-essential >
325
332
` ;
326
333
AnchorTag . args = {
@@ -340,3 +347,24 @@ AnchorTag.parameters = {
340
347
} ,
341
348
} ,
342
349
} ;
350
+
351
+ export const ItemIndentation : Story = ( ) =>
352
+ html `
353
+ ${ MenuItems . map (
354
+ ( menuItem , i ) =>
355
+ html `
356
+ < uui-menu-item
357
+ label ="${ menuItem . title } "
358
+ style ="${ ifDefined ( i === 1 ? '--uui-menu-item-indent: 1' : '' ) } ">
359
+ </ uui-menu-item >
360
+ `
361
+ ) }
362
+ ` ;
363
+
364
+ ItemIndentation . parameters = {
365
+ docs : {
366
+ source : {
367
+ code : `<uui-menu-item label="Menu Item 1" style="--uui-menu-item-indent: 1"></uui-menu-item>` ,
368
+ } ,
369
+ } ,
370
+ } ;
0 commit comments