1 | import React from 'react';
|
2 | import { action } from '@storybook/addon-actions';
|
3 | import { ActionBar } from './ActionBar';
|
4 | var action1 = action('action1');
|
5 | var action2 = action('action2');
|
6 | var action3 = action('action3');
|
7 | export default {
|
8 | component: ActionBar,
|
9 | title: 'Basics/ActionBar',
|
10 | decorators: [function (storyFn) {
|
11 | return React.createElement("div", {
|
12 | style: {
|
13 | position: 'relative',
|
14 | width: '300px',
|
15 | height: '64px',
|
16 | margin: '1rem',
|
17 | background: 'papayawhip',
|
18 | border: '1px solid rgba(0,0,0,.05)'
|
19 | }
|
20 | }, storyFn());
|
21 | }]
|
22 | };
|
23 | export var singleItem = function singleItem() {
|
24 | return React.createElement(ActionBar, {
|
25 | actionItems: [{
|
26 | title: 'Clear',
|
27 | onClick: action1
|
28 | }]
|
29 | });
|
30 | };
|
31 | singleItem.displayName = "singleItem";
|
32 | export var manyItems = function manyItems() {
|
33 | return React.createElement(ActionBar, {
|
34 | actionItems: [{
|
35 | title: 'Action string',
|
36 | onClick: action1
|
37 | }, {
|
38 | title: React.createElement("div", null, "Action node"),
|
39 | onClick: action2
|
40 | }, {
|
41 | title: 'Long action string',
|
42 | onClick: action3
|
43 | }]
|
44 | });
|
45 | };
|
46 | manyItems.displayName = "manyItems"; |
\ | No newline at end of file |