@@ -2,8 +2,9 @@ import '.';
2
2
import '@umbraco-ui/uui-badge/lib' ;
3
3
import '@umbraco-ui/uui-icon/lib' ;
4
4
5
- import { Story } from '@storybook/web-components' ;
5
+ import { Meta , Story } from '@storybook/web-components' ;
6
6
import { html } from 'lit-html' ;
7
+ import { UUIButtonElement } from './uui-button.element' ;
7
8
8
9
export default {
9
10
title : 'Buttons/Button' ,
@@ -15,9 +16,9 @@ export default {
15
16
target : undefined ,
16
17
look : 'default' ,
17
18
color : 'default' ,
18
- type : '' ,
19
+ type : undefined ,
19
20
label : 'Button' ,
20
- state : '' ,
21
+ state : undefined ,
21
22
} ,
22
23
argTypes : {
23
24
look : {
@@ -54,7 +55,7 @@ export default {
54
55
'--uui-button-background-color-disabled' : { control : { type : 'color' } } ,
55
56
'--uui-button-contrast-disabled' : { control : { type : 'color' } } ,
56
57
} ,
57
- } ;
58
+ } as Meta < UUIButtonElement > ;
58
59
59
60
const cssProps = [
60
61
'--uui-button-height' ,
@@ -87,12 +88,12 @@ const Template: Story = props => {
87
88
. reduce ( reducer ) }
88
89
?disabled=${ props . disabled }
89
90
?compact=${ props . compact }
91
+ .state=${ props . state }
92
+ .href=${ props . href }
93
+ .target=${ props . target }
90
94
look=${ props . look }
91
95
color=${ props . color }
92
96
label=${ props . label }
93
- state=${ props . state }
94
- href=${ props . href }
95
- target=${ props . target }
96
97
> ${ props . content } </ uui-button
97
98
>
98
99
` ;
@@ -340,3 +341,82 @@ AnchorTag.parameters = {
340
341
} ,
341
342
} ,
342
343
} ;
344
+
345
+ export const MultiLine : Story = props => {
346
+ return html `
347
+ < uui-button
348
+ type =${ props . type }
349
+ style =${ cssProps
350
+ . map ( cssProp => ( props [ cssProp ] ? `${ cssProp } : ${ props [ cssProp ] } ` : '' ) )
351
+ . reduce ( reducer ) }
352
+ ?disabled=${ props . disabled }
353
+ ?compact=${ props . compact }
354
+ look=${ props . look }
355
+ color=${ props . color }
356
+ label=${ props . label }
357
+ state=${ props . state }
358
+ href=${ props . href }
359
+ target=${ props . target }
360
+ > Hello < br />
361
+ I am button</ uui-button
362
+ >
363
+ < br /> < br />
364
+ < uui-button
365
+ type =${ props . type }
366
+ style =${ cssProps
367
+ . map ( cssProp => ( props [ cssProp ] ? `${ cssProp } : ${ props [ cssProp ] } ` : '' ) )
368
+ . reduce ( reducer ) }
369
+ ?disabled=${ props . disabled }
370
+ ?compact=${ props . compact }
371
+ look=${ props . look }
372
+ color=${ props . color }
373
+ label=${ props . label }
374
+ state=${ props . state }
375
+ href=${ props . href }
376
+ target=${ props . target } >
377
+ < uui-badge color ="danger "> 2</ uui-badge >
378
+ Hello < br />
379
+ I am button
380
+ </ uui-button >
381
+ < br /> < br />
382
+ < uui-button
383
+ type =${ props . type }
384
+ style =${ cssProps
385
+ . map ( cssProp => ( props [ cssProp ] ? `${ cssProp } : ${ props [ cssProp ] } ` : '' ) )
386
+ . reduce ( reducer ) }
387
+ ?disabled=${ props . disabled }
388
+ compact
389
+ look=${ props . look }
390
+ color=${ props . color }
391
+ label=${ props . label }
392
+ state=${ props . state }
393
+ href=${ props . href }
394
+ target=${ props . target } >
395
+ Hi < br />
396
+ I am compact
397
+ </ uui-button >
398
+ < br /> < br />
399
+ < uui-icon-registry-essential >
400
+ < uui-button
401
+ type =${ props . type }
402
+ style =${ cssProps
403
+ . map ( cssProp =>
404
+ props [ cssProp ] ? `${ cssProp } : ${ props [ cssProp ] } ` : ''
405
+ )
406
+ . reduce ( reducer ) }
407
+ ?disabled=${ props . disabled }
408
+ ?compact=${ props . compact }
409
+ look=${ props . look }
410
+ color=${ props . color }
411
+ label=${ props . label }
412
+ state=${ props . state }
413
+ href=${ props . href }
414
+ target=${ props . target } >
415
+ < uui-icon .name =${ 'favorite' } > </ uui-icon >
416
+ < br /> Home
417
+ </ uui-button >
418
+ </ uui-icon-registry-essential >
419
+ ` ;
420
+ } ;
421
+
422
+ MultiLine . args = { look : 'primary' } ;
0 commit comments