diff --git a/packages/devui/src/Dialog/Dialog.stories.js b/packages/devui/src/Dialog/Dialog.stories.js index 8c0fb275..9573ba5e 100644 --- a/packages/devui/src/Dialog/Dialog.stories.js +++ b/packages/devui/src/Dialog/Dialog.stories.js @@ -20,6 +20,12 @@ Default.args = { fullWidth: false, children: 'Hello Dialog!', }; +Default.argTypes = { + actions: { table: { disable: true } }, + onDismiss: { table: { disable: true } }, + onSubmit: { table: { disable: true } }, + theme: { table: { disable: true } }, +}; export const WithForm = Template.bind({}); WithForm.args = { @@ -32,35 +38,12 @@ WithForm.args = { schema, uiSchema, }; -// storiesOf('Dialog', module) -// .addDecorator(withKnobs) -// .add('default', () => ( -// -// {text('children', 'Hello Dialog!')} -// -// )) -// .add('with form', () => ( -// -// )); +WithForm.argTypes = { + title: { table: { disable: true } }, + children: { table: { disable: true } }, + actions: { table: { disable: true } }, + modal: { table: { disable: true } }, + onDismiss: { table: { disable: true } }, + onSubmit: { table: { disable: true } }, + theme: { table: { disable: true } }, +}; diff --git a/packages/devui/src/Editor/Editor.stories.js b/packages/devui/src/Editor/Editor.stories.js new file mode 100644 index 00000000..dc6b5f04 --- /dev/null +++ b/packages/devui/src/Editor/Editor.stories.js @@ -0,0 +1,56 @@ +import React from 'react'; +import Editor from './'; +import { default as WithTabsComponent } from './WithTabs'; + +const value = ` +var themes = []; + +function getThemes() { + return themes; +} +`; + +export default { + title: 'Editor', + component: Editor, +}; + +const Template = (args) => ; + +export const Default = Template.bind({}); +Default.args = { + value, + lineNumbers: true, + lineWrapping: false, + foldGutter: true, + readOnly: false, + autofocus: true, +}; + +const WithTabsTemplate = (args) => ; + +export const WithTabs = WithTabsTemplate.bind({}); +WithTabs.args = { + lineNumbers: true, + align: 'left', +}; +// storiesOf('Editor', module) +// .addDecorator(withKnobs) +// .add( +// 'default', +// () => ( +// +// ), +// { info: 'Based on [CodeMirror](http://codemirror.net/).' } +// ) +// .add('with tabs', () => ( +// +// )); diff --git a/packages/devui/src/Editor/stories/WithTabs.js b/packages/devui/src/Editor/WithTabs.js similarity index 78% rename from packages/devui/src/Editor/stories/WithTabs.js rename to packages/devui/src/Editor/WithTabs.js index 07753aa6..566b6560 100644 --- a/packages/devui/src/Editor/stories/WithTabs.js +++ b/packages/devui/src/Editor/WithTabs.js @@ -1,7 +1,6 @@ import React, { Component } from 'react'; -import { select } from '@storybook/addon-knobs'; -import Editor from '../'; -import Tabs from '../../Tabs'; +import Editor from './'; +import Tabs from '../Tabs'; const value1 = ` const func1 = () => {} @@ -18,7 +17,7 @@ export default class WithTabs extends Component { }; render() { - const { lineNumbers } = this.props; + const { align, lineNumbers } = this.props; return ( { this.setState({ selected }); }} - align={select('align', ['left', 'right', 'center'], 'left')} + align={align} /> ); } diff --git a/packages/devui/src/Editor/stories/index.js b/packages/devui/src/Editor/stories/index.js deleted file mode 100755 index 7c48b3e6..00000000 --- a/packages/devui/src/Editor/stories/index.js +++ /dev/null @@ -1,35 +0,0 @@ -import React from 'react'; -import { storiesOf } from '@storybook/react'; -import { action } from '@storybook/addon-actions'; -import { withKnobs, text, boolean } from '@storybook/addon-knobs'; -import Editor from '../'; -import WithTabs from './WithTabs'; - -const value = ` -var themes = []; - -function getThemes() { - return themes; -} -`; - -storiesOf('Editor', module) - .addDecorator(withKnobs) - .add( - 'default', - () => ( - - ), - { info: 'Based on [CodeMirror](http://codemirror.net/).' } - ) - .add('with tabs', () => ( - - ));