@storybook/codemod 0.0.0-pr-23435-sha-bd98198e → 0.0.0-pr-23897-sha-78c2d886

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/package.json +11 -4
  2. package/project.json +0 -6
  3. package/src/index.ts +0 -103
  4. package/src/lib/utils.test.js +0 -9
  5. package/src/lib/utils.ts +0 -29
  6. package/src/transforms/__testfixtures__/add-component-parameters/add-component-parameters.input.js +0 -44
  7. package/src/transforms/__testfixtures__/add-component-parameters/add-component-parameters.output.snapshot +0 -68
  8. package/src/transforms/__testfixtures__/csf-hoist-story-annotations/basic.input.js +0 -25
  9. package/src/transforms/__testfixtures__/csf-hoist-story-annotations/basic.output.snapshot +0 -27
  10. package/src/transforms/__testfixtures__/csf-hoist-story-annotations/overrides.input.js +0 -25
  11. package/src/transforms/__testfixtures__/csf-hoist-story-annotations/overrides.output.snapshot +0 -28
  12. package/src/transforms/__testfixtures__/csf-hoist-story-annotations/variable.input.js +0 -13
  13. package/src/transforms/__testfixtures__/csf-hoist-story-annotations/variable.output.snapshot +0 -17
  14. package/src/transforms/__testfixtures__/mdx-to-csf/basic.input.mdx +0 -18
  15. package/src/transforms/__testfixtures__/mdx-to-csf/basic.output.snapshot +0 -40
  16. package/src/transforms/__testfixtures__/mdx-to-csf/component-id.input.mdx +0 -6
  17. package/src/transforms/__testfixtures__/mdx-to-csf/component-id.output.snapshot +0 -17
  18. package/src/transforms/__testfixtures__/mdx-to-csf/decorators.input.mdx +0 -8
  19. package/src/transforms/__testfixtures__/mdx-to-csf/decorators.output.snapshot +0 -18
  20. package/src/transforms/__testfixtures__/mdx-to-csf/exclude-stories.input.mdx +0 -19
  21. package/src/transforms/__testfixtures__/mdx-to-csf/exclude-stories.output.snapshot +0 -39
  22. package/src/transforms/__testfixtures__/mdx-to-csf/parameters.input.mdx +0 -14
  23. package/src/transforms/__testfixtures__/mdx-to-csf/parameters.output.snapshot +0 -23
  24. package/src/transforms/__testfixtures__/mdx-to-csf/plaintext.input.mdx +0 -3
  25. package/src/transforms/__testfixtures__/mdx-to-csf/plaintext.output.snapshot +0 -11
  26. package/src/transforms/__testfixtures__/mdx-to-csf/story-function.input.mdx +0 -10
  27. package/src/transforms/__testfixtures__/mdx-to-csf/story-function.output.snapshot +0 -18
  28. package/src/transforms/__testfixtures__/mdx-to-csf/story-parameters.input.mdx +0 -18
  29. package/src/transforms/__testfixtures__/mdx-to-csf/story-parameters.output.snapshot +0 -32
  30. package/src/transforms/__testfixtures__/mdx-to-csf/story-refs.input.mdx +0 -22
  31. package/src/transforms/__testfixtures__/mdx-to-csf/story-refs.output.snapshot +0 -34
  32. package/src/transforms/__testfixtures__/move-builtin-addons/default.input.js +0 -2
  33. package/src/transforms/__testfixtures__/move-builtin-addons/default.output.snapshot +0 -8
  34. package/src/transforms/__testfixtures__/move-builtin-addons/with-no-change.input.js +0 -3
  35. package/src/transforms/__testfixtures__/move-builtin-addons/with-no-change.output.snapshot +0 -7
  36. package/src/transforms/__testfixtures__/storiesof-to-csf/basic.input.js +0 -18
  37. package/src/transforms/__testfixtures__/storiesof-to-csf/basic.output.snapshot +0 -45
  38. package/src/transforms/__testfixtures__/storiesof-to-csf/collision.input.js +0 -11
  39. package/src/transforms/__testfixtures__/storiesof-to-csf/collision.output.snapshot +0 -38
  40. package/src/transforms/__testfixtures__/storiesof-to-csf/const.input.js +0 -1
  41. package/src/transforms/__testfixtures__/storiesof-to-csf/const.output.snapshot +0 -13
  42. package/src/transforms/__testfixtures__/storiesof-to-csf/decorators.input.js +0 -9
  43. package/src/transforms/__testfixtures__/storiesof-to-csf/decorators.output.snapshot +0 -18
  44. package/src/transforms/__testfixtures__/storiesof-to-csf/default.input.js +0 -7
  45. package/src/transforms/__testfixtures__/storiesof-to-csf/default.output.snapshot +0 -17
  46. package/src/transforms/__testfixtures__/storiesof-to-csf/digit.input.js +0 -1
  47. package/src/transforms/__testfixtures__/storiesof-to-csf/digit.output.js +0 -5
  48. package/src/transforms/__testfixtures__/storiesof-to-csf/digit.output.snapshot +0 -9
  49. package/src/transforms/__testfixtures__/storiesof-to-csf/export-destructuring.input.js +0 -11
  50. package/src/transforms/__testfixtures__/storiesof-to-csf/export-destructuring.output.snapshot +0 -23
  51. package/src/transforms/__testfixtures__/storiesof-to-csf/export-function.input.js +0 -12
  52. package/src/transforms/__testfixtures__/storiesof-to-csf/export-function.output.snapshot +0 -23
  53. package/src/transforms/__testfixtures__/storiesof-to-csf/export-names.input.js +0 -14
  54. package/src/transforms/__testfixtures__/storiesof-to-csf/export-names.output.snapshot +0 -26
  55. package/src/transforms/__testfixtures__/storiesof-to-csf/exports.input.js +0 -2
  56. package/src/transforms/__testfixtures__/storiesof-to-csf/exports.output.snapshot +0 -16
  57. package/src/transforms/__testfixtures__/storiesof-to-csf/module.input.js +0 -12
  58. package/src/transforms/__testfixtures__/storiesof-to-csf/module.output.snapshot +0 -16
  59. package/src/transforms/__testfixtures__/storiesof-to-csf/multi.input.js +0 -14
  60. package/src/transforms/__testfixtures__/storiesof-to-csf/multi.output.snapshot +0 -39
  61. package/src/transforms/__testfixtures__/storiesof-to-csf/parameters-as-var.input.js +0 -8
  62. package/src/transforms/__testfixtures__/storiesof-to-csf/parameters-as-var.output.snapshot +0 -20
  63. package/src/transforms/__testfixtures__/storiesof-to-csf/parameters.input.js +0 -10
  64. package/src/transforms/__testfixtures__/storiesof-to-csf/parameters.output.snapshot +0 -23
  65. package/src/transforms/__testfixtures__/storiesof-to-csf/storiesof-var.input.js +0 -11
  66. package/src/transforms/__testfixtures__/storiesof-to-csf/storiesof-var.output.snapshot +0 -23
  67. package/src/transforms/__testfixtures__/storiesof-to-csf/story-decorators.input.js +0 -11
  68. package/src/transforms/__testfixtures__/storiesof-to-csf/story-decorators.output.snapshot +0 -29
  69. package/src/transforms/__testfixtures__/storiesof-to-csf/story-parameters.input.js +0 -14
  70. package/src/transforms/__testfixtures__/storiesof-to-csf/story-parameters.output.snapshot +0 -32
  71. package/src/transforms/__testfixtures__/update-addon-info/update-addon-info.input.js +0 -184
  72. package/src/transforms/__testfixtures__/update-addon-info/update-addon-info.output.snapshot +0 -184
  73. package/src/transforms/__testfixtures__/update-organisation-name/update-organisation-name.input.js +0 -19
  74. package/src/transforms/__testfixtures__/update-organisation-name/update-organisation-name.output.snapshot +0 -23
  75. package/src/transforms/__testfixtures__/upgrade-hierarchy-separators/csf.input.js +0 -3
  76. package/src/transforms/__testfixtures__/upgrade-hierarchy-separators/csf.output.snapshot +0 -7
  77. package/src/transforms/__testfixtures__/upgrade-hierarchy-separators/dynamic-storiesof.input.js +0 -5
  78. package/src/transforms/__testfixtures__/upgrade-hierarchy-separators/dynamic-storiesof.output.snapshot +0 -9
  79. package/src/transforms/__testfixtures__/upgrade-hierarchy-separators/storiesof.input.js +0 -8
  80. package/src/transforms/__testfixtures__/upgrade-hierarchy-separators/storiesof.output.snapshot +0 -12
  81. package/src/transforms/__tests__/csf-2-to-3.test.ts +0 -439
  82. package/src/transforms/__tests__/mdx-to-csf.test.ts +0 -628
  83. package/src/transforms/__tests__/transforms.tests.js +0 -32
  84. package/src/transforms/__tests__/upgrade-deprecated-types.test.ts +0 -170
  85. package/src/transforms/add-component-parameters.js +0 -62
  86. package/src/transforms/csf-2-to-3.ts +0 -335
  87. package/src/transforms/csf-hoist-story-annotations.js +0 -97
  88. package/src/transforms/mdx-to-csf.ts +0 -340
  89. package/src/transforms/move-builtin-addons.js +0 -32
  90. package/src/transforms/storiesof-to-csf.js +0 -277
  91. package/src/transforms/update-addon-info.js +0 -114
  92. package/src/transforms/update-organisation-name.js +0 -71
  93. package/src/transforms/upgrade-deprecated-types.ts +0 -142
  94. package/src/transforms/upgrade-hierarchy-separators.js +0 -39
  95. package/tsconfig.json +0 -10
@@ -1,11 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`mdx-to-csf transforms correctly using "plaintext.input.js" data 1`] = `
4
- "import React from 'react';
5
- export default {};
6
- export const Plaintext = () => 'Plain text';
7
-
8
- Plaintext.story = {
9
- name: 'plaintext',
10
- };"
11
- `;
@@ -1,10 +0,0 @@
1
- import { Story, Meta } from '@storybook/addon-docs';
2
-
3
- <Story name="function" height="100px">
4
- {() => {
5
- const btn = document.createElement('button');
6
- btn.innerHTML = 'Hello Button';
7
- btn.addEventListener('click', action('Click'));
8
- return btn;
9
- }}
10
- </Story>;
@@ -1,18 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`mdx-to-csf transforms correctly using "story-function.input.js" data 1`] = `
4
- "import React from 'react';
5
- export default {};
6
-
7
- export const Function = () => {
8
- const btn = document.createElement('button');
9
- btn.innerHTML = 'Hello Button';
10
- btn.addEventListener('click', action('Click'));
11
- return btn;
12
- };
13
-
14
- Function.story = {
15
- name: 'function',
16
- height: '100px',
17
- };"
18
- `;
@@ -1,18 +0,0 @@
1
- import Button from './Button';
2
- import { storiesOf } from '@storybook/react';
3
- import { Meta, Story } from '@storybook/addon-docs';
4
-
5
- <Meta title='Button' />
6
-
7
- <Story
8
- name='with story parameters'
9
- parameters={{
10
- header: false,
11
- inline: true,
12
- }}><Button label='The Button' /></Story>
13
-
14
- <Story
15
- name='foo'
16
- parameters={{
17
- bar: 1,
18
- }}><Button label='Foo' /></Story>
@@ -1,32 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`mdx-to-csf transforms correctly using "story-parameters.input.js" data 1`] = `
4
- "import React from 'react';
5
- import Button from './Button';
6
- import { storiesOf } from '@storybook/react';
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,22 +0,0 @@
1
- import { Story, Meta } from '@storybook/addon-docs';
2
- import { action } from '@storybook/addon-actions';
3
- import { Button } from '@storybook/react/demo';
4
-
5
- <Meta
6
- title="Addons|Docs/mdx"
7
- component={Button}
8
- decorators={[storyFn => <div style={{ backgroundColor: 'yellow' }}>{storyFn()}</div>]}
9
- parameters={{ notes: 'component notes' }}
10
- />
11
-
12
- ## Getting into details
13
-
14
- <Story name="solo story">
15
- <Button onClick={action('clicked')}>solo</Button>
16
- </Story>
17
-
18
- <Source name="hello story" />
19
-
20
- ## Configurable height
21
-
22
- <Story id="basics-button--all-buttons" height="400px" />
@@ -1,34 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`mdx-to-csf transforms correctly using "story-refs.input.js" data 1`] = `
4
- "import React from 'react';
5
- import { action } from '@storybook/addon-actions';
6
- import { Button } from '@storybook/react/demo';
7
-
8
- export default {
9
- title: 'Addons|Docs/mdx',
10
- component: Button,
11
-
12
- decorators: [
13
- (storyFn) => (
14
- <div
15
- style={{
16
- backgroundColor: 'yellow',
17
- }}
18
- >
19
- {storyFn()}
20
- </div>
21
- ),
22
- ],
23
-
24
- parameters: {
25
- notes: 'component notes',
26
- },
27
- };
28
-
29
- export const SoloStory = () => <Button onClick={action('clicked')}>solo</Button>;
30
-
31
- SoloStory.story = {
32
- name: 'solo story',
33
- };"
34
- `;
@@ -1,2 +0,0 @@
1
- /* eslint-disable */
2
- import { storyOf, action, linkTo } from '@storybook/react';
@@ -1,8 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`move-builtin-addons transforms correctly using "default.input.js" data 1`] = `
4
- "/* eslint-disable */
5
- import { storyOf } from '@storybook/react';
6
- import { linkTo } from '@storybook/addon-links';
7
- import { action } from '@storybook/addon-actions';"
8
- `;
@@ -1,3 +0,0 @@
1
- /* eslint-disable */
2
- import { action } from '@kadira/storybook-addons';
3
- import { storyOf } from '@storybook/react';
@@ -1,7 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`move-builtin-addons transforms correctly using "with-no-change.input.js" data 1`] = `
4
- "/* eslint-disable */
5
- import { action } from '@kadira/storybook-addons';
6
- import { storyOf } from '@storybook/react';"
7
- `;
@@ -1,18 +0,0 @@
1
- /* eslint-disable */
2
- import React from 'react';
3
- import Button from './Button';
4
-
5
- import { storiesOf, configure } from '@storybook/react';
6
- import { action } from '@storybook/addon-actions';
7
-
8
- storiesOf('Button', module)
9
- .add('story1', () => <Button label="Story 1" />)
10
- .add('second story', () => <Button label="Story 2" onClick={action('click')} />)
11
- .add('complex story', () => (
12
- <div>
13
- <Button label="The Button" onClick={action('onClick')} />
14
- <br />
15
- </div>
16
- ))
17
- .add('w/punctuation', () => <Button label="Story 2" onClick={action('click')} />)
18
- .add('Start Case', () => <Button label="Story 2" onClick={action('click')} />);
@@ -1,45 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`storiesof-to-csf transforms correctly using "basic.input.js" data 1`] = `
4
- "/* eslint-disable */
5
- import React from 'react';
6
- import Button from './Button';
7
-
8
- import { configure } from '@storybook/react';
9
- import { action } from '@storybook/addon-actions';
10
-
11
- export default {
12
- title: 'Button',
13
- };
14
-
15
- export const Story1 = () => <Button label=\\"Story 1\\" />;
16
-
17
- Story1.story = {
18
- name: 'story1',
19
- };
20
-
21
- export const SecondStory = () => <Button label=\\"Story 2\\" onClick={action('click')} />;
22
-
23
- SecondStory.story = {
24
- name: 'second story',
25
- };
26
-
27
- export const ComplexStory = () => (
28
- <div>
29
- <Button label=\\"The Button\\" onClick={action('onClick')} />
30
- <br />
31
- </div>
32
- );
33
-
34
- ComplexStory.story = {
35
- name: 'complex story',
36
- };
37
-
38
- export const WPunctuation = () => <Button label=\\"Story 2\\" onClick={action('click')} />;
39
-
40
- WPunctuation.story = {
41
- name: 'w/punctuation',
42
- };
43
-
44
- export const StartCase = () => <Button label=\\"Story 2\\" onClick={action('click')} />;"
45
- `;
@@ -1,11 +0,0 @@
1
- export const Foo = 1;
2
- const Bar = 1;
3
- const _Bar = 1;
4
- const Baz = 1;
5
- const __Baz = 1;
6
-
7
- storiesOf('foo', module)
8
- .add('foo', () => <button />)
9
- .add('bar', () => <button />)
10
- .add('_baz', () => <button />)
11
- .add('baz', () => <button />);
@@ -1,38 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`storiesof-to-csf transforms correctly using "collision.input.js" data 1`] = `
4
- "export const Foo = 1;
5
- const Bar = 1;
6
- const _Bar = 1;
7
- const Baz = 1;
8
- const __Baz = 1;
9
-
10
- export default {
11
- title: 'foo',
12
- excludeStories: ['Foo'],
13
- };
14
-
15
- export const _Foo = () => <button />;
16
-
17
- _Foo.story = {
18
- name: 'foo',
19
- };
20
-
21
- export const __Bar = () => <button />;
22
-
23
- __Bar.story = {
24
- name: 'bar',
25
- };
26
-
27
- export const _Baz = () => <button />;
28
-
29
- _Baz.story = {
30
- name: '_baz',
31
- };
32
-
33
- export const ___Baz = () => <button />;
34
-
35
- ___Baz.story = {
36
- name: 'baz',
37
- };"
38
- `;
@@ -1 +0,0 @@
1
- storiesOf('bar', module).add('const', () => <button />);
@@ -1,13 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`storiesof-to-csf transforms correctly using "const.input.js" data 1`] = `
4
- "export default {
5
- title: 'bar',
6
- };
7
-
8
- export const Const = () => <button />;
9
-
10
- Const.story = {
11
- name: 'const',
12
- };"
13
- `;
@@ -1,9 +0,0 @@
1
- /* eslint-disable */
2
- import React from 'react';
3
- import Button from './Button';
4
-
5
- // This isn't a valid story, but it tests the `import { comp } from ...` case
6
- storiesOf('Some.Button', module)
7
- .addDecorator(withKnobs)
8
- .addDecorator((storyFn) => <div className="foo">{storyFn}</div>)
9
- .add('with decorator', () => <Button label="The Button" />);
@@ -1,18 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`storiesof-to-csf transforms correctly using "decorators.input.js" data 1`] = `
4
- "/* eslint-disable */
5
- import React from 'react';
6
- import Button from './Button';
7
-
8
- export default {
9
- title: 'Some.Button',
10
- decorators: [withKnobs, (storyFn) => <div className=\\"foo\\">{storyFn}</div>],
11
- };
12
-
13
- export const WithDecorator = () => <Button label=\\"The Button\\" />;
14
-
15
- WithDecorator.story = {
16
- name: 'with decorator',
17
- };"
18
- `;
@@ -1,7 +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).add('default', () => <Button label="Story 1" />);
@@ -1,17 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`storiesof-to-csf transforms correctly using "default.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 Default = () => <Button label=\\"Story 1\\" />;
13
-
14
- Default.story = {
15
- name: 'default',
16
- };"
17
- `;
@@ -1 +0,0 @@
1
- storiesOf('bar', module).add('1', () => <button />);
@@ -1,5 +0,0 @@
1
- export default {
2
- title: 'bar',
3
- };
4
-
5
- export const _1 = () => <button />;
@@ -1,9 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`storiesof-to-csf transforms correctly using "digit.input.js" data 1`] = `
4
- "export default {
5
- title: 'bar',
6
- };
7
-
8
- export const _1 = () => <button />;"
9
- `;
@@ -1,11 +0,0 @@
1
- /* eslint-disable import/no-extraneous-dependencies */
2
- import React from 'react';
3
- import { storiesOf } from '@storybook/react';
4
- import ComponentRow from './ComponentRow';
5
- import * as SpecRowStories from './SpecRow.stories';
6
-
7
- export const { actions } = SpecRowStories;
8
-
9
- storiesOf('ComponentRow', module).add('pending', () => (
10
- <ComponentRow snapshots={snapshots.pending} buildNumber={2} {...actions} />
11
- ));
@@ -1,23 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`storiesof-to-csf transforms correctly using "export-destructuring.input.js" data 1`] = `
4
- "/* eslint-disable import/no-extraneous-dependencies */
5
- import React from 'react';
6
- import ComponentRow from './ComponentRow';
7
- import * as SpecRowStories from './SpecRow.stories';
8
-
9
- export const { actions } = SpecRowStories;
10
-
11
- export default {
12
- title: 'ComponentRow',
13
- excludeStories: ['actions'],
14
- };
15
-
16
- export const Pending = () => (
17
- <ComponentRow snapshots={snapshots.pending} buildNumber={2} {...actions} />
18
- );
19
-
20
- Pending.story = {
21
- name: 'pending',
22
- };"
23
- `;
@@ -1,12 +0,0 @@
1
- /* eslint-disable import/no-extraneous-dependencies */
2
- import React from 'react';
3
- import { storiesOf } from '@storybook/react';
4
- import ComponentItem from './ComponentItem';
5
-
6
- export function someHelper() {
7
- return 5;
8
- }
9
-
10
- storiesOf('ComponentItem', module)
11
- .addDecorator((storyFn) => <div style={{ margin: '1rem' }}>{storyFn()}</div>)
12
- .add('loading', () => <ComponentItem loading />);
@@ -1,23 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`storiesof-to-csf transforms correctly using "export-function.input.js" data 1`] = `
4
- "/* eslint-disable import/no-extraneous-dependencies */
5
- import React from 'react';
6
- import ComponentItem from './ComponentItem';
7
-
8
- export function someHelper() {
9
- return 5;
10
- }
11
-
12
- export default {
13
- title: 'ComponentItem',
14
- decorators: [(storyFn) => <div style={{ margin: '1rem' }}>{storyFn()}</div>],
15
- excludeStories: ['someHelper'],
16
- };
17
-
18
- export const Loading = () => <ComponentItem loading />;
19
-
20
- Loading.story = {
21
- name: 'loading',
22
- };"
23
- `;
@@ -1,14 +0,0 @@
1
- /* eslint-disable import/no-extraneous-dependencies */
2
- import React from 'react';
3
- import { storiesOf } from '@storybook/react';
4
- import FlexCenter from './FlexCenter';
5
- import { specs, urls } from './LiveView.stories';
6
- import { ignoredRegions } from './IgnoredRegions.stories';
7
-
8
- export { specs, urls, ignoredRegions };
9
-
10
- storiesOf('FlexCenter', module).add('2:1', () => (
11
- <FlexCenter width={200} height={100} style={{ background: 'papayawhip' }}>
12
- <div style={{ padding: 30, background: 'hotpink' }}>2:1</div>
13
- </FlexCenter>
14
- ));
@@ -1,26 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`storiesof-to-csf transforms correctly using "export-names.input.js" data 1`] = `
4
- "/* eslint-disable import/no-extraneous-dependencies */
5
- import React from 'react';
6
- import FlexCenter from './FlexCenter';
7
- import { specs, urls } from './LiveView.stories';
8
- import { ignoredRegions } from './IgnoredRegions.stories';
9
-
10
- export { specs, urls, ignoredRegions };
11
-
12
- export default {
13
- title: 'FlexCenter',
14
- excludeStories: ['specs', 'urls', 'ignoredRegions'],
15
- };
16
-
17
- export const _21 = () => (
18
- <FlexCenter width={200} height={100} style={{ background: 'papayawhip' }}>
19
- <div style={{ padding: 30, background: 'hotpink' }}>2:1</div>
20
- </FlexCenter>
21
- );
22
-
23
- _21.story = {
24
- name: '2:1',
25
- };"
26
- `;
@@ -1,2 +0,0 @@
1
- export const foo = 1;
2
- storiesOf('bar', module).add('baz', () => <button />);
@@ -1,16 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`storiesof-to-csf transforms correctly using "exports.input.js" data 1`] = `
4
- "export const foo = 1;
5
-
6
- export default {
7
- title: 'bar',
8
- excludeStories: ['foo'],
9
- };
10
-
11
- export const Baz = () => <button />;
12
-
13
- Baz.story = {
14
- name: 'baz',
15
- };"
16
- `;
@@ -1,12 +0,0 @@
1
- /* eslint-disable */
2
- import React from 'react';
3
- import Button from './Button';
4
- import { storiesOf } from '@storybook/react';
5
-
6
- export default {
7
- title: 'foo',
8
- };
9
-
10
- const bar = 1;
11
-
12
- storiesOf('foo', module).add('bar', () => <Button />);
@@ -1,16 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`storiesof-to-csf transforms correctly using "module.input.js" data 1`] = `
4
- "/* eslint-disable */
5
- import React from 'react';
6
- import Button from './Button';
7
- import { storiesOf } from '@storybook/react';
8
-
9
- export default {
10
- title: 'foo',
11
- };
12
-
13
- const bar = 1;
14
-
15
- storiesOf('foo', module).add('bar', () => <Button />);"
16
- `;
@@ -1,14 +0,0 @@
1
- /* eslint-disable */
2
- import React from 'react';
3
- import Button from './Button';
4
-
5
- // If we have multiple storiesOf calls, export multiple defaults. It's not valid
6
- // JS but will still save the user time in converting.
7
-
8
- storiesOf('Button1', module)
9
- .add('story1', () => <Button label="Button1.1" />)
10
- .add('story2', () => <Button label="Button1.2" />);
11
-
12
- storiesOf('Button2', module)
13
- .add('story1', () => <Button label="Button2.1" />)
14
- .add('story2', () => <Button label="Button2.2" />);
@@ -1,39 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`storiesof-to-csf transforms correctly using "multi.input.js" data 1`] = `
4
- "/* eslint-disable */
5
- import React from 'react';
6
- import Button from './Button';
7
-
8
- export default {
9
- title: 'Button1',
10
- };
11
-
12
- export const Story1 = () => <Button label=\\"Button1.1\\" />;
13
-
14
- Story1.story = {
15
- name: 'story1',
16
- };
17
-
18
- export const Story2 = () => <Button label=\\"Button1.2\\" />;
19
-
20
- Story2.story = {
21
- name: 'story2',
22
- };
23
-
24
- export default {
25
- title: 'Button2',
26
- };
27
-
28
- export const _Story1 = () => <Button label=\\"Button2.1\\" />;
29
-
30
- _Story1.story = {
31
- name: 'story1',
32
- };
33
-
34
- export const _Story2 = () => <Button label=\\"Button2.2\\" />;
35
-
36
- _Story2.story = {
37
- name: 'story2',
38
- };"
39
- `;
@@ -1,8 +0,0 @@
1
- /* eslint-disable import/no-extraneous-dependencies */
2
- import React from 'react';
3
- import { storiesOf } from '@storybook/react';
4
- import Canvas from './Canvas';
5
-
6
- const CHROMATIC_DELAY = { chromatic: { delay: 500 } };
7
-
8
- storiesOf('Canvas', module).add('loading', () => <Canvas loading />, CHROMATIC_DELAY);
@@ -1,20 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`storiesof-to-csf transforms correctly using "parameters-as-var.input.js" data 1`] = `
4
- "/* eslint-disable import/no-extraneous-dependencies */
5
- import React from 'react';
6
- import Canvas from './Canvas';
7
-
8
- const CHROMATIC_DELAY = { chromatic: { delay: 500 } };
9
-
10
- export default {
11
- title: 'Canvas',
12
- };
13
-
14
- export const Loading = () => <Canvas loading />;
15
-
16
- Loading.story = {
17
- name: 'loading',
18
- parameters: CHROMATIC_DELAY,
19
- };"
20
- `;