@storybook/addon-knobs: add button() knob (#23302)

This commit is contained in:
Gustavo Henke
2018-02-01 07:33:34 +11:00
committed by Sheetal Nandi
parent 1d7a6e1f41
commit 99614fa920
2 changed files with 5 additions and 0 deletions

View File

@@ -46,6 +46,8 @@ export function date(name: string, value?: Date): Date;
export function array<T>(name: string, value: T[], separator?: string): T[];
export function button(name: string, handler: () => any): void;
export interface WrapStoryProps {
context?: object;
storyFn?: RenderFunction;

View File

@@ -11,6 +11,7 @@ import {
select,
date,
array,
button,
knob,
} from '@storybook/addon-knobs';
@@ -58,6 +59,8 @@ stories.add('with all knobs', () => {
const genericKnob: X = knob<X>('Some generic knob', { value: 'a', type: 'text' });
button('Some button', () => console.log('Button knob clicked'));
const style = {
...customStyle,
fontWeight: bold ? 800 as 800 : 400 as 400, // tslint:disable-line no-unnecessary-type-assertion