@storybook/codemod 7.3.2 → 7.4.0-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +11 -4
- package/project.json +0 -6
- package/src/index.ts +0 -103
- package/src/lib/utils.test.js +0 -9
- package/src/lib/utils.ts +0 -29
- package/src/transforms/__testfixtures__/add-component-parameters/add-component-parameters.input.js +0 -44
- package/src/transforms/__testfixtures__/add-component-parameters/add-component-parameters.output.snapshot +0 -68
- package/src/transforms/__testfixtures__/csf-hoist-story-annotations/basic.input.js +0 -25
- package/src/transforms/__testfixtures__/csf-hoist-story-annotations/basic.output.snapshot +0 -27
- package/src/transforms/__testfixtures__/csf-hoist-story-annotations/overrides.input.js +0 -25
- package/src/transforms/__testfixtures__/csf-hoist-story-annotations/overrides.output.snapshot +0 -28
- package/src/transforms/__testfixtures__/csf-hoist-story-annotations/variable.input.js +0 -13
- package/src/transforms/__testfixtures__/csf-hoist-story-annotations/variable.output.snapshot +0 -17
- package/src/transforms/__testfixtures__/mdx-to-csf/basic.input.mdx +0 -18
- package/src/transforms/__testfixtures__/mdx-to-csf/basic.output.snapshot +0 -40
- package/src/transforms/__testfixtures__/mdx-to-csf/component-id.input.mdx +0 -6
- package/src/transforms/__testfixtures__/mdx-to-csf/component-id.output.snapshot +0 -17
- package/src/transforms/__testfixtures__/mdx-to-csf/decorators.input.mdx +0 -8
- package/src/transforms/__testfixtures__/mdx-to-csf/decorators.output.snapshot +0 -18
- package/src/transforms/__testfixtures__/mdx-to-csf/exclude-stories.input.mdx +0 -19
- package/src/transforms/__testfixtures__/mdx-to-csf/exclude-stories.output.snapshot +0 -39
- package/src/transforms/__testfixtures__/mdx-to-csf/parameters.input.mdx +0 -14
- package/src/transforms/__testfixtures__/mdx-to-csf/parameters.output.snapshot +0 -23
- package/src/transforms/__testfixtures__/mdx-to-csf/plaintext.input.mdx +0 -3
- package/src/transforms/__testfixtures__/mdx-to-csf/plaintext.output.snapshot +0 -11
- package/src/transforms/__testfixtures__/mdx-to-csf/story-function.input.mdx +0 -10
- package/src/transforms/__testfixtures__/mdx-to-csf/story-function.output.snapshot +0 -18
- package/src/transforms/__testfixtures__/mdx-to-csf/story-parameters.input.mdx +0 -18
- package/src/transforms/__testfixtures__/mdx-to-csf/story-parameters.output.snapshot +0 -32
- package/src/transforms/__testfixtures__/mdx-to-csf/story-refs.input.mdx +0 -22
- package/src/transforms/__testfixtures__/mdx-to-csf/story-refs.output.snapshot +0 -34
- package/src/transforms/__testfixtures__/move-builtin-addons/default.input.js +0 -2
- package/src/transforms/__testfixtures__/move-builtin-addons/default.output.snapshot +0 -8
- package/src/transforms/__testfixtures__/move-builtin-addons/with-no-change.input.js +0 -3
- package/src/transforms/__testfixtures__/move-builtin-addons/with-no-change.output.snapshot +0 -7
- package/src/transforms/__testfixtures__/storiesof-to-csf/basic.input.js +0 -18
- package/src/transforms/__testfixtures__/storiesof-to-csf/basic.output.snapshot +0 -45
- package/src/transforms/__testfixtures__/storiesof-to-csf/collision.input.js +0 -11
- package/src/transforms/__testfixtures__/storiesof-to-csf/collision.output.snapshot +0 -38
- package/src/transforms/__testfixtures__/storiesof-to-csf/const.input.js +0 -1
- package/src/transforms/__testfixtures__/storiesof-to-csf/const.output.snapshot +0 -13
- package/src/transforms/__testfixtures__/storiesof-to-csf/decorators.input.js +0 -9
- package/src/transforms/__testfixtures__/storiesof-to-csf/decorators.output.snapshot +0 -18
- package/src/transforms/__testfixtures__/storiesof-to-csf/default.input.js +0 -7
- package/src/transforms/__testfixtures__/storiesof-to-csf/default.output.snapshot +0 -17
- package/src/transforms/__testfixtures__/storiesof-to-csf/digit.input.js +0 -1
- package/src/transforms/__testfixtures__/storiesof-to-csf/digit.output.js +0 -5
- package/src/transforms/__testfixtures__/storiesof-to-csf/digit.output.snapshot +0 -9
- package/src/transforms/__testfixtures__/storiesof-to-csf/export-destructuring.input.js +0 -11
- package/src/transforms/__testfixtures__/storiesof-to-csf/export-destructuring.output.snapshot +0 -23
- package/src/transforms/__testfixtures__/storiesof-to-csf/export-function.input.js +0 -12
- package/src/transforms/__testfixtures__/storiesof-to-csf/export-function.output.snapshot +0 -23
- package/src/transforms/__testfixtures__/storiesof-to-csf/export-names.input.js +0 -14
- package/src/transforms/__testfixtures__/storiesof-to-csf/export-names.output.snapshot +0 -26
- package/src/transforms/__testfixtures__/storiesof-to-csf/exports.input.js +0 -2
- package/src/transforms/__testfixtures__/storiesof-to-csf/exports.output.snapshot +0 -16
- package/src/transforms/__testfixtures__/storiesof-to-csf/module.input.js +0 -12
- package/src/transforms/__testfixtures__/storiesof-to-csf/module.output.snapshot +0 -16
- package/src/transforms/__testfixtures__/storiesof-to-csf/multi.input.js +0 -14
- package/src/transforms/__testfixtures__/storiesof-to-csf/multi.output.snapshot +0 -39
- package/src/transforms/__testfixtures__/storiesof-to-csf/parameters-as-var.input.js +0 -8
- package/src/transforms/__testfixtures__/storiesof-to-csf/parameters-as-var.output.snapshot +0 -20
- package/src/transforms/__testfixtures__/storiesof-to-csf/parameters.input.js +0 -10
- package/src/transforms/__testfixtures__/storiesof-to-csf/parameters.output.snapshot +0 -23
- package/src/transforms/__testfixtures__/storiesof-to-csf/storiesof-var.input.js +0 -11
- package/src/transforms/__testfixtures__/storiesof-to-csf/storiesof-var.output.snapshot +0 -23
- package/src/transforms/__testfixtures__/storiesof-to-csf/story-decorators.input.js +0 -11
- package/src/transforms/__testfixtures__/storiesof-to-csf/story-decorators.output.snapshot +0 -29
- package/src/transforms/__testfixtures__/storiesof-to-csf/story-parameters.input.js +0 -14
- package/src/transforms/__testfixtures__/storiesof-to-csf/story-parameters.output.snapshot +0 -32
- package/src/transforms/__testfixtures__/update-addon-info/update-addon-info.input.js +0 -184
- package/src/transforms/__testfixtures__/update-addon-info/update-addon-info.output.snapshot +0 -184
- package/src/transforms/__testfixtures__/update-organisation-name/update-organisation-name.input.js +0 -19
- package/src/transforms/__testfixtures__/update-organisation-name/update-organisation-name.output.snapshot +0 -23
- package/src/transforms/__testfixtures__/upgrade-hierarchy-separators/csf.input.js +0 -3
- package/src/transforms/__testfixtures__/upgrade-hierarchy-separators/csf.output.snapshot +0 -7
- package/src/transforms/__testfixtures__/upgrade-hierarchy-separators/dynamic-storiesof.input.js +0 -5
- package/src/transforms/__testfixtures__/upgrade-hierarchy-separators/dynamic-storiesof.output.snapshot +0 -9
- package/src/transforms/__testfixtures__/upgrade-hierarchy-separators/storiesof.input.js +0 -8
- package/src/transforms/__testfixtures__/upgrade-hierarchy-separators/storiesof.output.snapshot +0 -12
- package/src/transforms/__tests__/csf-2-to-3.test.ts +0 -439
- package/src/transforms/__tests__/mdx-to-csf.test.ts +0 -628
- package/src/transforms/__tests__/transforms.tests.js +0 -32
- package/src/transforms/__tests__/upgrade-deprecated-types.test.ts +0 -170
- package/src/transforms/add-component-parameters.js +0 -62
- package/src/transforms/csf-2-to-3.ts +0 -335
- package/src/transforms/csf-hoist-story-annotations.js +0 -97
- package/src/transforms/mdx-to-csf.ts +0 -340
- package/src/transforms/move-builtin-addons.js +0 -32
- package/src/transforms/storiesof-to-csf.js +0 -277
- package/src/transforms/update-addon-info.js +0 -114
- package/src/transforms/update-organisation-name.js +0 -71
- package/src/transforms/upgrade-deprecated-types.ts +0 -142
- package/src/transforms/upgrade-hierarchy-separators.js +0 -39
- package/tsconfig.json +0 -10
@@ -1,10 +0,0 @@
|
|
1
|
-
/* eslint-disable */
|
2
|
-
import React from 'react';
|
3
|
-
import Button from './Button';
|
4
|
-
|
5
|
-
import { storiesOf } from '@storybook/react';
|
6
|
-
|
7
|
-
storiesOf('Button', module)
|
8
|
-
.addParameters({ component: Button, foo: 1 })
|
9
|
-
.addParameters({ bar: 2 })
|
10
|
-
.add('with kind parameters', () => <Button label="The Button" />);
|
@@ -1,23 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`storiesof-to-csf transforms correctly using "parameters.input.js" data 1`] = `
|
4
|
-
"/* eslint-disable */
|
5
|
-
import React from 'react';
|
6
|
-
import Button from './Button';
|
7
|
-
|
8
|
-
export default {
|
9
|
-
title: 'Button',
|
10
|
-
|
11
|
-
parameters: {
|
12
|
-
component: Button,
|
13
|
-
foo: 1,
|
14
|
-
bar: 2,
|
15
|
-
},
|
16
|
-
};
|
17
|
-
|
18
|
-
export const WithKindParameters = () => <Button label=\\"The Button\\" />;
|
19
|
-
|
20
|
-
WithKindParameters.story = {
|
21
|
-
name: 'with kind parameters',
|
22
|
-
};"
|
23
|
-
`;
|
@@ -1,11 +0,0 @@
|
|
1
|
-
/* eslint-disable import/no-extraneous-dependencies */
|
2
|
-
import React from 'react';
|
3
|
-
import { storiesOf } from '@storybook/react';
|
4
|
-
import Hero from './Hero';
|
5
|
-
|
6
|
-
const chapter = storiesOf('Webapp screens/Marketing/LandingScreen/Hero', module).add(
|
7
|
-
'default',
|
8
|
-
() => <Hero />
|
9
|
-
);
|
10
|
-
|
11
|
-
chapter.add('loading', () => <Hero loading />);
|
@@ -1,23 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`storiesof-to-csf transforms correctly using "storiesof-var.input.js" data 1`] = `
|
4
|
-
"/* eslint-disable import/no-extraneous-dependencies */
|
5
|
-
import React from 'react';
|
6
|
-
import Hero from './Hero';
|
7
|
-
|
8
|
-
export default {
|
9
|
-
title: 'Webapp screens/Marketing/LandingScreen/Hero',
|
10
|
-
};
|
11
|
-
|
12
|
-
export const Default = () => <Hero />;
|
13
|
-
|
14
|
-
Default.story = {
|
15
|
-
name: 'default',
|
16
|
-
};
|
17
|
-
|
18
|
-
export const Loading = () => <Hero loading />;
|
19
|
-
|
20
|
-
Loading.story = {
|
21
|
-
name: 'loading',
|
22
|
-
};"
|
23
|
-
`;
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import Button from './Button';
|
3
|
-
|
4
|
-
storiesOf('Some.Button', module)
|
5
|
-
.add('with story params and decorators', () => <Button label="The Button" />, {
|
6
|
-
bar: 1,
|
7
|
-
decorators: [withKnobs, (storyFn) => <div className="foo">{storyFn}</div>],
|
8
|
-
})
|
9
|
-
.add('with story decorators', () => <Button label="The Button" />, {
|
10
|
-
decorators: [withKnobs],
|
11
|
-
});
|
@@ -1,29 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`storiesof-to-csf transforms correctly using "story-decorators.input.js" data 1`] = `
|
4
|
-
"import React from 'react';
|
5
|
-
import Button from './Button';
|
6
|
-
|
7
|
-
export default {
|
8
|
-
title: 'Some.Button',
|
9
|
-
};
|
10
|
-
|
11
|
-
export const WithStoryParamsAndDecorators = () => <Button label=\\"The Button\\" />;
|
12
|
-
|
13
|
-
WithStoryParamsAndDecorators.story = {
|
14
|
-
name: 'with story params and decorators',
|
15
|
-
|
16
|
-
parameters: {
|
17
|
-
bar: 1,
|
18
|
-
},
|
19
|
-
|
20
|
-
decorators: [withKnobs, (storyFn) => <div className=\\"foo\\">{storyFn}</div>],
|
21
|
-
};
|
22
|
-
|
23
|
-
export const WithStoryDecorators = () => <Button label=\\"The Button\\" />;
|
24
|
-
|
25
|
-
WithStoryDecorators.story = {
|
26
|
-
name: 'with story decorators',
|
27
|
-
decorators: [withKnobs],
|
28
|
-
};"
|
29
|
-
`;
|
@@ -1,14 +0,0 @@
|
|
1
|
-
/* eslint-disable */
|
2
|
-
import React from 'react';
|
3
|
-
import Button from './Button';
|
4
|
-
|
5
|
-
import { storiesOf } from '@storybook/react';
|
6
|
-
|
7
|
-
storiesOf('Button', module)
|
8
|
-
.add('with story parameters', () => <Button label="The Button" />, {
|
9
|
-
header: false,
|
10
|
-
inline: true,
|
11
|
-
})
|
12
|
-
.add('foo', () => <Button label="Foo" />, {
|
13
|
-
bar: 1,
|
14
|
-
});
|
@@ -1,32 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`storiesof-to-csf transforms correctly using "story-parameters.input.js" data 1`] = `
|
4
|
-
"/* eslint-disable */
|
5
|
-
import React from 'react';
|
6
|
-
import Button from './Button';
|
7
|
-
|
8
|
-
export default {
|
9
|
-
title: 'Button',
|
10
|
-
};
|
11
|
-
|
12
|
-
export const WithStoryParameters = () => <Button label=\\"The Button\\" />;
|
13
|
-
|
14
|
-
WithStoryParameters.story = {
|
15
|
-
name: 'with story parameters',
|
16
|
-
|
17
|
-
parameters: {
|
18
|
-
header: false,
|
19
|
-
inline: true,
|
20
|
-
},
|
21
|
-
};
|
22
|
-
|
23
|
-
export const Foo = () => <Button label=\\"Foo\\" />;
|
24
|
-
|
25
|
-
Foo.story = {
|
26
|
-
name: 'foo',
|
27
|
-
|
28
|
-
parameters: {
|
29
|
-
bar: 1,
|
30
|
-
},
|
31
|
-
};"
|
32
|
-
`;
|
@@ -1,184 +0,0 @@
|
|
1
|
-
/* eslint-disable */
|
2
|
-
import React from 'react';
|
3
|
-
import Button from './Button';
|
4
|
-
|
5
|
-
import { storiesOf } from '@storybook/react';
|
6
|
-
import { action } from '@storybook/addon-actions';
|
7
|
-
|
8
|
-
storiesOf('Button').addWithInfo(
|
9
|
-
'simple usage',
|
10
|
-
'This is the basic usage with the button with providing a label to show the text.',
|
11
|
-
() => (
|
12
|
-
<div>
|
13
|
-
<Button label="The Button" onClick={action('onClick')} />
|
14
|
-
<br />
|
15
|
-
<p>Click the "?" mark at top-right to view the info.</p>
|
16
|
-
</div>
|
17
|
-
)
|
18
|
-
);
|
19
|
-
|
20
|
-
storiesOf('Button').addWithInfo(
|
21
|
-
'simple usage (inline info)',
|
22
|
-
`
|
23
|
-
This is the basic usage with the button with providing a label to show the text.
|
24
|
-
`,
|
25
|
-
() => <Button label="The Button" onClick={action('onClick')} />,
|
26
|
-
{ inline: true }
|
27
|
-
);
|
28
|
-
|
29
|
-
storiesOf('Button').addWithInfo(
|
30
|
-
'simple usage (disable source)',
|
31
|
-
`
|
32
|
-
This is the basic usage with the button with providing a label to show the text.
|
33
|
-
`,
|
34
|
-
() => <Button label="The Button" onClick={action('onClick')} />,
|
35
|
-
{ source: false, inline: true }
|
36
|
-
);
|
37
|
-
|
38
|
-
storiesOf('Button').addWithInfo(
|
39
|
-
'simple usage (no header)',
|
40
|
-
`
|
41
|
-
This is the basic usage with the button with providing a label to show the text.
|
42
|
-
`,
|
43
|
-
() => <Button label="The Button" onClick={action('onClick')} />,
|
44
|
-
{ header: false, inline: true }
|
45
|
-
);
|
46
|
-
|
47
|
-
storiesOf('Button').addWithInfo(
|
48
|
-
'simple usage (no prop tables)',
|
49
|
-
`
|
50
|
-
This is the basic usage with the button with providing a label to show the text.
|
51
|
-
`,
|
52
|
-
() => <Button label="The Button" onClick={action('onClick')} />,
|
53
|
-
{ propTables: false, inline: true }
|
54
|
-
);
|
55
|
-
|
56
|
-
storiesOf('Button').addWithInfo(
|
57
|
-
'simple usage (custom propTables)',
|
58
|
-
`
|
59
|
-
This is the basic usage with the button with providing a label to show the text.
|
60
|
-
Since, the story source code is wrapped inside a div, info addon can't figure out propTypes on it's own.
|
61
|
-
So, we need to give relevant React component classes manually using \`propTypes\` option as shown below:
|
62
|
-
~~~js
|
63
|
-
storiesOf('Button')
|
64
|
-
.addWithInfo(
|
65
|
-
'simple usage (custom propTables)',
|
66
|
-
<info>,
|
67
|
-
<storyFn>,
|
68
|
-
{ inline: true, propTables: [Button]}
|
69
|
-
);
|
70
|
-
~~~
|
71
|
-
`,
|
72
|
-
() => (
|
73
|
-
<div>
|
74
|
-
<Button label="The Button" onClick={action('onClick')} />
|
75
|
-
<br />
|
76
|
-
</div>
|
77
|
-
),
|
78
|
-
{ inline: true, propTables: [Button] }
|
79
|
-
);
|
80
|
-
|
81
|
-
storiesOf('Button').addWithInfo(
|
82
|
-
'simple usage (JSX description)',
|
83
|
-
<div>
|
84
|
-
<h2>This is a JSX info section</h2>
|
85
|
-
<p>
|
86
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ornare massa rutrum metus
|
87
|
-
commodo, a mattis velit dignissim. Fusce vestibulum turpis sed massa egestas pharetra. Sed at
|
88
|
-
libero nulla.
|
89
|
-
</p>
|
90
|
-
<p>
|
91
|
-
<a href="https://github.com/storybookjs/react-storybook-addon-info">This is a link</a>
|
92
|
-
</p>
|
93
|
-
<p>
|
94
|
-
<img src="https://storybook.js.org/images/placeholders/350x150.png" />
|
95
|
-
</p>
|
96
|
-
</div>,
|
97
|
-
() => (
|
98
|
-
<div>
|
99
|
-
<Button label="The Button" onClick={action('onClick')} />
|
100
|
-
<br />
|
101
|
-
<p>Click the "?" mark at top-right to view the info.</p>
|
102
|
-
</div>
|
103
|
-
)
|
104
|
-
);
|
105
|
-
|
106
|
-
storiesOf('Button').addWithInfo(
|
107
|
-
'simple usage (inline JSX description)',
|
108
|
-
<div>
|
109
|
-
<h2>This is a JSX info section</h2>
|
110
|
-
<p>
|
111
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ornare massa rutrum metus
|
112
|
-
commodo, a mattis velit dignissim. Fusce vestibulum turpis sed massa egestas pharetra. Sed at
|
113
|
-
libero nulla.
|
114
|
-
</p>
|
115
|
-
<p>
|
116
|
-
<a href="https://github.com/storybookjs/react-storybook-addon-info">This is a link</a>
|
117
|
-
</p>
|
118
|
-
<p>
|
119
|
-
<img src="https://storybook.js.org/images/placeholders/350x150.png" />
|
120
|
-
</p>
|
121
|
-
</div>,
|
122
|
-
() => <Button label="The Button" onClick={action('onClick')} />,
|
123
|
-
{ inline: true }
|
124
|
-
);
|
125
|
-
|
126
|
-
storiesOf('Button').addWithInfo(
|
127
|
-
'simple usage (maxPropsInLine === 1)',
|
128
|
-
`
|
129
|
-
This is the basic usage with the button with providing a label to show the text.
|
130
|
-
`,
|
131
|
-
() => <Button label="The Button" onClick={action('onClick')} />,
|
132
|
-
{ inline: true, maxPropsIntoLine: 1 }
|
133
|
-
);
|
134
|
-
|
135
|
-
storiesOf('Button').addWithInfo(
|
136
|
-
'simple usage (maxPropObjectKeys === 5)',
|
137
|
-
`
|
138
|
-
This is the basic usage with the button with providing a label to show the text.
|
139
|
-
`,
|
140
|
-
() => <Button label="The Button" object={{ a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 }} />,
|
141
|
-
{ inline: true, maxPropObjectKeys: 5 }
|
142
|
-
);
|
143
|
-
|
144
|
-
storiesOf('Button').addWithInfo(
|
145
|
-
'simple usage (maxPropArrayLength === 8)',
|
146
|
-
`
|
147
|
-
This is the basic usage with the button with providing a label to show the text.
|
148
|
-
`,
|
149
|
-
() => <Button label="The Button" array={[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]} />,
|
150
|
-
{ inline: true, maxPropArrayLength: 8 }
|
151
|
-
);
|
152
|
-
|
153
|
-
storiesOf('Button').addWithInfo(
|
154
|
-
'simple usage (maxPropStringLength === 10)',
|
155
|
-
`
|
156
|
-
This is the basic usage with the button with providing a label to show the text.
|
157
|
-
`,
|
158
|
-
() => <Button label="The Button" string="1 2 3 4 5 6 7 8" />,
|
159
|
-
{ inline: true, maxPropStringLength: 5 }
|
160
|
-
);
|
161
|
-
|
162
|
-
storiesOf('Button').addWithInfo(
|
163
|
-
'with custom styles',
|
164
|
-
`
|
165
|
-
This is an example of how to customize the styles of the info components.
|
166
|
-
For the full styles available, see \`./src/components/Story.js\`
|
167
|
-
`,
|
168
|
-
() => <Button label="The Button" onClick={action('onClick')} />,
|
169
|
-
{
|
170
|
-
inline: true,
|
171
|
-
styles: (stylesheet) => {
|
172
|
-
stylesheet.infoPage = {
|
173
|
-
backgroundColor: '#ccc',
|
174
|
-
};
|
175
|
-
return stylesheet;
|
176
|
-
},
|
177
|
-
}
|
178
|
-
);
|
179
|
-
|
180
|
-
storiesOf('shared/ProgressBar', module)
|
181
|
-
.addDecorator(withKnobs)
|
182
|
-
.addWithInfo('default style', () => (
|
183
|
-
<ProgressBar progress={number('progress', 25)} delay={number('delay', 500)} />
|
184
|
-
));
|
@@ -1,184 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`update-addon-info transforms correctly using "update-addon-info.input.js" data 1`] = `
|
4
|
-
"/* eslint-disable */
|
5
|
-
import React from 'react';
|
6
|
-
import Button from './Button';
|
7
|
-
|
8
|
-
import { storiesOf } from '@storybook/react';
|
9
|
-
import { action } from '@storybook/addon-actions';
|
10
|
-
|
11
|
-
import { withInfo } from \\"@storybook/addon-info\\";
|
12
|
-
|
13
|
-
storiesOf('Button').add('simple usage', withInfo(
|
14
|
-
'This is the basic usage with the button with providing a label to show the text.'
|
15
|
-
)(() => (
|
16
|
-
<div>
|
17
|
-
<Button label=\\"The Button\\" onClick={action('onClick')} />
|
18
|
-
<br />
|
19
|
-
<p>Click the \\"?\\" mark at top-right to view the info.</p>
|
20
|
-
</div>
|
21
|
-
)));
|
22
|
-
|
23
|
-
storiesOf('Button').add('simple usage (inline info)', withInfo({
|
24
|
-
text: \`
|
25
|
-
This is the basic usage with the button with providing a label to show the text.
|
26
|
-
\`,
|
27
|
-
|
28
|
-
inline: true
|
29
|
-
})(() => <Button label=\\"The Button\\" onClick={action('onClick')} />));
|
30
|
-
|
31
|
-
storiesOf('Button').add('simple usage (disable source)', withInfo({
|
32
|
-
text: \`
|
33
|
-
This is the basic usage with the button with providing a label to show the text.
|
34
|
-
\`,
|
35
|
-
|
36
|
-
source: false,
|
37
|
-
inline: true
|
38
|
-
})(() => <Button label=\\"The Button\\" onClick={action('onClick')} />));
|
39
|
-
|
40
|
-
storiesOf('Button').add('simple usage (no header)', withInfo({
|
41
|
-
text: \`
|
42
|
-
This is the basic usage with the button with providing a label to show the text.
|
43
|
-
\`,
|
44
|
-
|
45
|
-
header: false,
|
46
|
-
inline: true
|
47
|
-
})(() => <Button label=\\"The Button\\" onClick={action('onClick')} />));
|
48
|
-
|
49
|
-
storiesOf('Button').add('simple usage (no prop tables)', withInfo({
|
50
|
-
text: \`
|
51
|
-
This is the basic usage with the button with providing a label to show the text.
|
52
|
-
\`,
|
53
|
-
|
54
|
-
propTables: false,
|
55
|
-
inline: true
|
56
|
-
})(() => <Button label=\\"The Button\\" onClick={action('onClick')} />));
|
57
|
-
|
58
|
-
storiesOf('Button').add('simple usage (custom propTables)', withInfo({
|
59
|
-
text: \`
|
60
|
-
This is the basic usage with the button with providing a label to show the text.
|
61
|
-
Since, the story source code is wrapped inside a div, info addon can't figure out propTypes on it's own.
|
62
|
-
So, we need to give relevant React component classes manually using \\\\\`propTypes\\\\\` option as shown below:
|
63
|
-
~~~js
|
64
|
-
storiesOf('Button')
|
65
|
-
.addWithInfo(
|
66
|
-
'simple usage (custom propTables)',
|
67
|
-
<info>,
|
68
|
-
<storyFn>,
|
69
|
-
{ inline: true, propTables: [Button]}
|
70
|
-
);
|
71
|
-
~~~
|
72
|
-
\`,
|
73
|
-
|
74
|
-
inline: true,
|
75
|
-
propTables: [Button]
|
76
|
-
})(() => (
|
77
|
-
<div>
|
78
|
-
<Button label=\\"The Button\\" onClick={action('onClick')} />
|
79
|
-
<br />
|
80
|
-
</div>
|
81
|
-
)));
|
82
|
-
|
83
|
-
storiesOf('Button').add('simple usage (JSX description)', withInfo(<div>
|
84
|
-
<h2>This is a JSX info section</h2>
|
85
|
-
<p>
|
86
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ornare massa rutrum metus
|
87
|
-
commodo, a mattis velit dignissim. Fusce vestibulum turpis sed massa egestas pharetra. Sed at
|
88
|
-
libero nulla.
|
89
|
-
</p>
|
90
|
-
<p>
|
91
|
-
<a href=\\"https://github.com/storybookjs/react-storybook-addon-info\\">This is a link</a>
|
92
|
-
</p>
|
93
|
-
<p>
|
94
|
-
<img src=\\"https://storybook.js.org/images/placeholders/350x150.png\\" />
|
95
|
-
</p>
|
96
|
-
</div>)(() => (
|
97
|
-
<div>
|
98
|
-
<Button label=\\"The Button\\" onClick={action('onClick')} />
|
99
|
-
<br />
|
100
|
-
<p>Click the \\"?\\" mark at top-right to view the info.</p>
|
101
|
-
</div>
|
102
|
-
)));
|
103
|
-
|
104
|
-
storiesOf('Button').add('simple usage (inline JSX description)', withInfo({
|
105
|
-
text: <div>
|
106
|
-
<h2>This is a JSX info section</h2>
|
107
|
-
<p>
|
108
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ornare massa rutrum metus
|
109
|
-
commodo, a mattis velit dignissim. Fusce vestibulum turpis sed massa egestas pharetra. Sed at
|
110
|
-
libero nulla.
|
111
|
-
</p>
|
112
|
-
<p>
|
113
|
-
<a href=\\"https://github.com/storybookjs/react-storybook-addon-info\\">This is a link</a>
|
114
|
-
</p>
|
115
|
-
<p>
|
116
|
-
<img src=\\"https://storybook.js.org/images/placeholders/350x150.png\\" />
|
117
|
-
</p>
|
118
|
-
</div>,
|
119
|
-
|
120
|
-
inline: true
|
121
|
-
})(() => <Button label=\\"The Button\\" onClick={action('onClick')} />));
|
122
|
-
|
123
|
-
storiesOf('Button').add('simple usage (maxPropsInLine === 1)', withInfo({
|
124
|
-
text: \`
|
125
|
-
This is the basic usage with the button with providing a label to show the text.
|
126
|
-
\`,
|
127
|
-
|
128
|
-
inline: true,
|
129
|
-
maxPropsIntoLine: 1
|
130
|
-
})(() => <Button label=\\"The Button\\" onClick={action('onClick')} />));
|
131
|
-
|
132
|
-
storiesOf('Button').add('simple usage (maxPropObjectKeys === 5)', withInfo({
|
133
|
-
text: \`
|
134
|
-
This is the basic usage with the button with providing a label to show the text.
|
135
|
-
\`,
|
136
|
-
|
137
|
-
inline: true,
|
138
|
-
maxPropObjectKeys: 5
|
139
|
-
})(
|
140
|
-
() => <Button label=\\"The Button\\" object={{ a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 }} />
|
141
|
-
));
|
142
|
-
|
143
|
-
storiesOf('Button').add('simple usage (maxPropArrayLength === 8)', withInfo({
|
144
|
-
text: \`
|
145
|
-
This is the basic usage with the button with providing a label to show the text.
|
146
|
-
\`,
|
147
|
-
|
148
|
-
inline: true,
|
149
|
-
maxPropArrayLength: 8
|
150
|
-
})(
|
151
|
-
() => <Button label=\\"The Button\\" array={[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]} />
|
152
|
-
));
|
153
|
-
|
154
|
-
storiesOf('Button').add('simple usage (maxPropStringLength === 10)', withInfo({
|
155
|
-
text: \`
|
156
|
-
This is the basic usage with the button with providing a label to show the text.
|
157
|
-
\`,
|
158
|
-
|
159
|
-
inline: true,
|
160
|
-
maxPropStringLength: 5
|
161
|
-
})(() => <Button label=\\"The Button\\" string=\\"1 2 3 4 5 6 7 8\\" />));
|
162
|
-
|
163
|
-
storiesOf('Button').add('with custom styles', withInfo({
|
164
|
-
text: \`
|
165
|
-
This is an example of how to customize the styles of the info components.
|
166
|
-
For the full styles available, see \\\\\`./src/components/Story.js\\\\\`
|
167
|
-
\`,
|
168
|
-
|
169
|
-
inline: true,
|
170
|
-
|
171
|
-
styles: (stylesheet) => {
|
172
|
-
stylesheet.infoPage = {
|
173
|
-
backgroundColor: '#ccc',
|
174
|
-
};
|
175
|
-
return stylesheet;
|
176
|
-
}
|
177
|
-
})(() => <Button label=\\"The Button\\" onClick={action('onClick')} />));
|
178
|
-
|
179
|
-
storiesOf('shared/ProgressBar', module)
|
180
|
-
.addDecorator(withKnobs)
|
181
|
-
.add('default style', withInfo('default style')(() => (
|
182
|
-
<ProgressBar progress={number('progress', 25)} delay={number('delay', 500)} />
|
183
|
-
)));"
|
184
|
-
`;
|
package/src/transforms/__testfixtures__/update-organisation-name/update-organisation-name.input.js
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
/* eslint-disable */
|
2
|
-
import '@kadira/storybook-addons';
|
3
|
-
import '@kadira/storybook-addon-comments';
|
4
|
-
import '@kadira/react-storybook-decorator-centered';
|
5
|
-
import '@kadira/storybook-addon-graphql';
|
6
|
-
import '@kadira/storybook-addon-info';
|
7
|
-
import '@kadira/storybook-addon-knobs';
|
8
|
-
import '@kadira/storybook-addon-links';
|
9
|
-
import '@kadira/storybook-addon-notes';
|
10
|
-
import '@kadira/storybook-addon-options';
|
11
|
-
import 'storyshots';
|
12
|
-
import '@kadira/storybook-channels';
|
13
|
-
import '@kadira/storybook-channel-postmsg';
|
14
|
-
import '@kadira/storybook-channel-websocket';
|
15
|
-
import '@kadira/getstorybook';
|
16
|
-
import '@kadira/react-storybook';
|
17
|
-
import '@kadira/react-native-storybook';
|
18
|
-
import '@kadira/storybook-ui';
|
19
|
-
import { storiesOf } from '@kadira/react-storybook';
|
@@ -1,23 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`update-organisation-name transforms correctly using "update-organisation-name.input.js" data 1`] = `
|
4
|
-
"/* eslint-disable */
|
5
|
-
import '@storybook/preview-api';
|
6
|
-
import '@storybook/addon-comments';
|
7
|
-
import '@storybook/addon-centered';
|
8
|
-
import '@storybook/addon-graphql';
|
9
|
-
import '@storybook/addon-info';
|
10
|
-
import '@storybook/addon-knobs';
|
11
|
-
import '@storybook/addon-links';
|
12
|
-
import '@storybook/addon-notes';
|
13
|
-
import '@storybook/addon-options';
|
14
|
-
import '@storybook/addon-storyshots';
|
15
|
-
import '@storybook/channels';
|
16
|
-
import '@storybook/channel-postmessage';
|
17
|
-
import '@storybook/channel-websocket';
|
18
|
-
import '@storybook/cli';
|
19
|
-
import '@storybook/react';
|
20
|
-
import '@storybook/react-native';
|
21
|
-
import '@storybook/manager';
|
22
|
-
import { storiesOf } from '@storybook/react';"
|
23
|
-
`;
|
@@ -1,9 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`upgrade-hierarchy-separators transforms correctly using "dynamic-storiesof.input.js" data 1`] = `
|
4
|
-
"import { storiesOf } from '@storybook/react';
|
5
|
-
|
6
|
-
const foo = 'some|generated/path';
|
7
|
-
|
8
|
-
storiesOf(foo, module).add('foobar', () => <>hmm</>);"
|
9
|
-
`;
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import { storiesOf } from '@storybook/react';
|
2
|
-
|
3
|
-
storiesOf('A/B/C', module).add('abc', () => <div>hello</div>);
|
4
|
-
storiesOf('D|E/f', module).add('def', () => <div>hello</div>);
|
5
|
-
|
6
|
-
storiesOf('G|h/i.jkl', module)
|
7
|
-
.add('hijkl', () => <div>hello</div>)
|
8
|
-
.add('whatever', () => <div>goodbye!</div>);
|
package/src/transforms/__testfixtures__/upgrade-hierarchy-separators/storiesof.output.snapshot
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`upgrade-hierarchy-separators transforms correctly using "storiesof.input.js" data 1`] = `
|
4
|
-
"import { storiesOf } from '@storybook/react';
|
5
|
-
|
6
|
-
storiesOf('A/B/C', module).add('abc', () => <div>hello</div>);
|
7
|
-
storiesOf('D/E/f', module).add('def', () => <div>hello</div>);
|
8
|
-
|
9
|
-
storiesOf('G/h/i/jkl', module)
|
10
|
-
.add('hijkl', () => <div>hello</div>)
|
11
|
-
.add('whatever', () => <div>goodbye!</div>);"
|
12
|
-
`;
|