summaryrefslogtreecommitdiffstats
path: root/public/src/stories/button.stories.ts
blob: 80411e8201deea00d04dcbf8f131fb06eb4588d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { storiesOf } from '@storybook/angular';
import { action } from '@storybook/addon-actions';
import { boolean, text } from '@storybook/addon-knobs/angular';
import { MatButtonModule, MatIconModule } from '@angular/material';

storiesOf('Button', module)
  .add('Basic', () => ({
    template: `
    <div style="margin:2em;">
      <button mat-raised-button color="primary" (click)="onClick($event)">primary</button>
      <button mat-raised-button color="primary" [disabled]="disabled">disabled</button>
      <button mat-raised-button class="btn-secondry"> {{ btnText }} </button>
    </div>
    `,
    props: {
      disabled: boolean('disabled', true),
      btnText: text('btnText', 'secondry'),
      onClick: action('click')
    },
    moduleMetadata: {
      imports: [MatButtonModule]
    }
  }))
  .add('Round', () => ({
    template: `
    <button mat-mini-fab style="background-color:#009FDB">
      <mat-icon class="material-icons">add</mat-icon>
    </button>
  `,
    moduleMetadata: {
      imports: [MatButtonModule, MatIconModule]
    }
  }));