11import { storiesOf , moduleMetadata } from "@storybook/angular" ;
2+ import { action } from "@storybook/addon-actions" ;
23import { withKnobs , select , boolean } from "@storybook/addon-knobs/angular" ;
34
45import { ButtonModule } from "./button.module" ;
@@ -18,17 +19,17 @@ storiesOf("Components|Button", module)
1819 . addDecorator ( withKnobs )
1920 . add ( "Basic" , ( ) => ( {
2021 template : `
21- <button [ibmButton]="ibmButton" [size]="size" [isExpressive]="isExpressive">Button</button>
22+ <button [ibmButton]="ibmButton" (click)="click($event)" [size]="size" [isExpressive]="isExpressive">Button</button>
2223
23- <button [ibmButton]="ibmButton" [size]="size" [isExpressive]="isExpressive" disabled="true">Button</button>
24+ <button [ibmButton]="ibmButton" (click)="click($event)" [size]="size" [isExpressive]="isExpressive" disabled="true">Button</button>
2425
25- <button [ibmButton]="ibmButton" [size]="size" [isExpressive]="isExpressive">
26+ <button [ibmButton]="ibmButton" (click)="click($event)" [size]="size" [isExpressive]="isExpressive">
2627 With icon<svg class="bx--btn__icon" ibmIcon="add" size="16"></svg>
2728 </button>
2829 <br><br>
2930 <ibm-button-set>
30- <button ibmButton="secondary" [size]="size" [isExpressive]="isExpressive">Button</button>
31- <button [ibmButton]="ibmButton" [size]="size" [isExpressive]="isExpressive">Button</button>
31+ <button ibmButton="secondary" (click)="click($event)" [size]="size" [isExpressive]="isExpressive">Button</button>
32+ <button [ibmButton]="ibmButton" (click)="click($event)" [size]="size" [isExpressive]="isExpressive">Button</button>
3233 </ibm-button-set>
3334 ` ,
3435 props : {
@@ -37,7 +38,8 @@ storiesOf("Components|Button", module)
3738 [ "primary" , "secondary" , "tertiary" , "ghost" , "danger" , "danger--primary" , "danger--tertiary" , "danger--ghost" ] ,
3839 "primary" ) ,
3940 isExpressive : boolean ( "Expressive button style" , false ) ,
40- size : select ( "Size of the buttons" , [ "normal" , "sm" , "field" , "lg" , "xl" ] , "normal" )
41+ size : select ( "Size of the buttons" , [ "normal" , "sm" , "field" , "lg" , "xl" ] , "normal" ) ,
42+ click : action ( "button clicked!" )
4143 }
4244 } ) )
4345 . add ( "Icon only" , ( ) => ( {
@@ -48,7 +50,8 @@ storiesOf("Components|Button", module)
4850 [iconOnly]="true"
4951 [hasAssistiveText]="true"
5052 [assistiveTextPlacement]="assistiveTextPlacement"
51- [assistiveTextAlignment]="assistiveTextAlignment">
53+ [assistiveTextAlignment]="assistiveTextAlignment"
54+ (click)="click($event)">
5255 <svg class="bx--btn__icon" ibmIcon="copy" size="16"></svg>
5356 <span class="bx--assistive-text">Icon description</span>
5457 </button>
@@ -60,7 +63,8 @@ storiesOf("Components|Button", module)
6063 "tertiary" ) ,
6164 size : select ( "Size of the buttons" , [ "normal" , "sm" , "field" , "lg" , "xl" ] , "normal" ) ,
6265 assistiveTextPlacement : select ( "Placement of assistive text" , [ "top" , "bottom" , "left" , "right" ] , "top" ) ,
63- assistiveTextAlignment : select ( "Alignment of assistive text" , [ "center" , "start" , "end" ] , "center" )
66+ assistiveTextAlignment : select ( "Alignment of assistive text" , [ "center" , "start" , "end" ] , "center" ) ,
67+ click : action ( "button clicked!" )
6468 }
6569 } ) )
6670 . add ( "Skeleton" , ( ) => ( {
0 commit comments