/* global window */
import React from 'react';
import { storiesOf } from '@storybook/react';
import { action, configureActions, decorateAction } from '@storybook/addon-actions';
import { setOptions } from '@storybook/addon-options';
import { Button } from '@storybook/react/demo';
import { File } from 'global';
const pickFirst = decorateAction([args => args.slice(0, 1)]);
storiesOf('Addons|Actions', module)
.add('Hello World', () => )
.add('Decorated Action', () => )
.add('Circular Payload', () => {
const circular = { foo: {} };
circular.foo.circular = circular;
return ;
})
.add('Function Name', () => {
const fn = action('fnName');
return ;
})
.add('Reserved keyword as name', () => )
.add('All types', () => {
function A() {}
function B() {}
const bound = B.bind({});
let file;
try {
file = new File([''], 'filename.txt', { type: 'text/plain', lastModified: new Date() });
} catch (error) {
file = error;
}
const reg = /fooBar/g;
return (
{setOptions({ selectedAddonPanel: 'storybook/actions/actions-panel' })}
);
})
.add('configureActions', () => {
configureActions({
depth: 2,
});
return (
);
});