@storybook/cli
Version:
Storybook's CLI - easiest method of adding storybook to your projects
54 lines (46 loc) • 1.06 kB
text/typescript
import { Component, Input, Output, EventEmitter } from '@angular/core';
export default class ButtonComponent {
/**
* Is this the principal call to action on the page?
*/
primary = false;
/**
* What background color to use
*/
backgroundColor?: string;
/**
* How large should the button be?
*/
size: 'small' | 'medium' | 'large' = 'medium';
/**
* Button contents
*
* @required
*/
label = 'Button';
/**
* Optional click handler
*/
onClick = new EventEmitter<Event>();
public get classes(): string[] {
const mode = this.primary ? 'storybook-button--primary' : 'storybook-button--secondary';
return ['storybook-button', `storybook-button--${this.size}`, mode];
}
}