diff --git a/__mocks__/inject-decorator.angular-stories.txt b/__mocks__/inject-decorator.angular-stories.txt new file mode 100644 index 000000000000..5baa440d797b --- /dev/null +++ b/__mocks__/inject-decorator.angular-stories.txt @@ -0,0 +1,15 @@ +import { Component } from '@angular/core'; +import { storiesOf } from '@storybook/angular'; + +@Component({ + selector: 'storybook-with-ng-content', + template: `
`, +}) +class WithNgContentComponent {} + +storiesOf('Custom|ng-content', module).add('Default', () => ({ + template: `

This is rendered in ng-content

`, + moduleMetadata: { + declarations: [WithNgContentComponent], + }, +})); diff --git a/__mocks__/inject-decorator.no-stories.txt b/__mocks__/inject-decorator.no-stories.txt new file mode 100644 index 000000000000..f0124e61691c --- /dev/null +++ b/__mocks__/inject-decorator.no-stories.txt @@ -0,0 +1,3 @@ +while(true) { + console.log("it's a kind of magic"); +} \ No newline at end of file diff --git a/__mocks__/inject-decorator.stories.txt b/__mocks__/inject-decorator.stories.txt new file mode 100644 index 000000000000..c4f0c4d53e5d --- /dev/null +++ b/__mocks__/inject-decorator.stories.txt @@ -0,0 +1,153 @@ +import React from 'react'; +import { storiesOf } from '@storybook/react'; +import { withInfo } from '@storybook/addon-info'; +import { action } from '@storybook/addon-actions'; + +import DocgenButton from '../components/DocgenButton'; +import FlowTypeButton from '../components/FlowTypeButton'; +import BaseButton from '../components/BaseButton'; +import TableComponent from '../components/TableComponent'; + +storiesOf('Addons|Info.React Docgen', module) + .add( + 'Comments from PropType declarations', + withInfo( + 'Comments above the PropType declarations should be extracted from the React component file itself and rendered in the Info Addon prop table' + )(() => ) + ) + .add( + 'Comments from Flow declarations', + withInfo( + 'Comments above the Flow declarations should be extracted from the React component file itself and rendered in the Info Addon prop table' + )(() => ) + ) + .add( + 'Comments from component declaration', + withInfo( + 'Comments above the component declaration should be extracted from the React component file itself and rendered below the Info Addon heading' + )(() => ) + ); + +const markdownDescription = ` +#### You can use markdown in your withInfo() description. + +Sometimes you might want to manually include some code examples: +~~~js +const Button = () =>