mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-22 22:19:48 +03:00
stash
This commit is contained in:
parent
fd6d9a8cfd
commit
b135fdbea7
|
@ -4,7 +4,7 @@ import { MdFiberManualRecord } from 'react-icons/md';
|
|||
import Button from './';
|
||||
|
||||
export default {
|
||||
title: 'Components/Button',
|
||||
title: 'Button',
|
||||
component: Button,
|
||||
};
|
||||
|
||||
|
|
36
packages/devui/src/ContextMenu/ContextMenu.stories.js
Normal file
36
packages/devui/src/ContextMenu/ContextMenu.stories.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
import React from 'react';
|
||||
import styled from 'styled-components';
|
||||
import ContextMenu from './';
|
||||
import { items } from './data';
|
||||
|
||||
export default {
|
||||
title: 'ContextMenu',
|
||||
component: ContextMenu,
|
||||
};
|
||||
|
||||
const Container = styled.div`
|
||||
display: flex;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
`;
|
||||
|
||||
const Template = (args) => (
|
||||
<Container>
|
||||
<ContextMenu {...args} />
|
||||
</Container>
|
||||
);
|
||||
|
||||
export const Default = Template.bind({});
|
||||
Default.args = {
|
||||
visible: true,
|
||||
x: 100,
|
||||
y: 100,
|
||||
items,
|
||||
};
|
||||
Default.argTypes = {
|
||||
visible: { table: { disable: true } },
|
||||
items: { table: { disable: true } },
|
||||
onClick: { table: { disable: true } },
|
||||
};
|
|
@ -1,29 +0,0 @@
|
|||
import React from 'react';
|
||||
import { storiesOf } from '@storybook/react';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import styled from 'styled-components';
|
||||
import { withKnobs, number } from '@storybook/addon-knobs';
|
||||
import ContextMenu from '../';
|
||||
import { items } from './data';
|
||||
|
||||
export const Container = styled.div`
|
||||
display: flex;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
`;
|
||||
|
||||
storiesOf('ContextMenu', module)
|
||||
.addDecorator(withKnobs)
|
||||
.add('default', () => (
|
||||
<Container>
|
||||
<ContextMenu
|
||||
visible
|
||||
onClick={action('menu item clicked')}
|
||||
x={number('x', 100)}
|
||||
y={number('y', 100)}
|
||||
items={items}
|
||||
/>
|
||||
</Container>
|
||||
));
|
66
packages/devui/src/Dialog/Dialog.stories.js
Normal file
66
packages/devui/src/Dialog/Dialog.stories.js
Normal file
|
@ -0,0 +1,66 @@
|
|||
import React from 'react';
|
||||
import Dialog from './';
|
||||
import { schema, uiSchema, formData } from '../Form/stories/schema';
|
||||
|
||||
export default {
|
||||
title: 'Dialog',
|
||||
component: Dialog,
|
||||
};
|
||||
|
||||
const Template = (args) => <Dialog {...args} />;
|
||||
|
||||
export const Default = Template.bind({});
|
||||
Default.args = {
|
||||
title: 'Dialog Title',
|
||||
submitText: 'Submit!',
|
||||
open: true,
|
||||
noHeader: false,
|
||||
noFooter: false,
|
||||
modal: false,
|
||||
fullWidth: false,
|
||||
children: 'Hello Dialog!',
|
||||
};
|
||||
|
||||
export const WithForm = Template.bind({});
|
||||
WithForm.args = {
|
||||
open: true,
|
||||
noHeader: false,
|
||||
noFooter: false,
|
||||
fullWidth: false,
|
||||
submitText: 'Submit!',
|
||||
formData,
|
||||
schema,
|
||||
uiSchema,
|
||||
};
|
||||
// storiesOf('Dialog', module)
|
||||
// .addDecorator(withKnobs)
|
||||
// .add('default', () => (
|
||||
// <Dialog
|
||||
// title={text('title', 'Dialog Title')}
|
||||
// submitText={text('submitText', 'Submit!')}
|
||||
// open={boolean('open', true)}
|
||||
// noHeader={boolean('noHeader', false)}
|
||||
// noFooter={boolean('noFooter', false)}
|
||||
// modal={boolean('modal', false)}
|
||||
// fullWidth={boolean('fullWidth', false)}
|
||||
// onDismiss={action('dialog dismissed')}
|
||||
// onSubmit={action('dialog submitted')}
|
||||
// >
|
||||
// {text('children', 'Hello Dialog!')}
|
||||
// </Dialog>
|
||||
// ))
|
||||
// .add('with form', () => (
|
||||
// <Dialog
|
||||
// open={boolean('open', true)}
|
||||
// noHeader={boolean('noHeader', false)}
|
||||
// noFooter={boolean('noFooter', false)}
|
||||
// fullWidth={boolean('fullWidth', false)}
|
||||
// submitText={text('submitText', 'Submit!')}
|
||||
// formData={object('formData', formData)}
|
||||
// schema={object('schema', schema)}
|
||||
// uiSchema={object('uiSchema', uiSchema)}
|
||||
// onChange={action('form changed')}
|
||||
// onSubmit={action('form submitted')}
|
||||
// onDismiss={action('dialog dismissed')}
|
||||
// />
|
||||
// ));
|
|
@ -1,39 +0,0 @@
|
|||
import React from 'react';
|
||||
import { storiesOf } from '@storybook/react';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { withKnobs, text, boolean, object } from '@storybook/addon-knobs';
|
||||
import Dialog from '../';
|
||||
import { schema, uiSchema, formData } from '../../Form/stories/schema';
|
||||
|
||||
storiesOf('Dialog', module)
|
||||
.addDecorator(withKnobs)
|
||||
.add('default', () => (
|
||||
<Dialog
|
||||
title={text('title', 'Dialog Title')}
|
||||
submitText={text('submitText', 'Submit!')}
|
||||
open={boolean('open', true)}
|
||||
noHeader={boolean('noHeader', false)}
|
||||
noFooter={boolean('noFooter', false)}
|
||||
modal={boolean('modal', false)}
|
||||
fullWidth={boolean('fullWidth', false)}
|
||||
onDismiss={action('dialog dismissed')}
|
||||
onSubmit={action('dialog submitted')}
|
||||
>
|
||||
{text('children', 'Hello Dialog!')}
|
||||
</Dialog>
|
||||
))
|
||||
.add('with form', () => (
|
||||
<Dialog
|
||||
open={boolean('open', true)}
|
||||
noHeader={boolean('noHeader', false)}
|
||||
noFooter={boolean('noFooter', false)}
|
||||
fullWidth={boolean('fullWidth', false)}
|
||||
submitText={text('submitText', 'Submit!')}
|
||||
formData={object('formData', formData)}
|
||||
schema={object('schema', schema)}
|
||||
uiSchema={object('uiSchema', uiSchema)}
|
||||
onChange={action('form changed')}
|
||||
onSubmit={action('form submitted')}
|
||||
onDismiss={action('dialog dismissed')}
|
||||
/>
|
||||
));
|
Loading…
Reference in New Issue
Block a user