diff --git a/examples/cra-kitchen-sink/src/__snapshots__/storyshots.test.js.snap b/examples/cra-kitchen-sink/src/__snapshots__/storyshots.test.js.snap index 89c3bf934c34..cc4aa4c93345 100644 --- a/examples/cra-kitchen-sink/src/__snapshots__/storyshots.test.js.snap +++ b/examples/cra-kitchen-sink/src/__snapshots__/storyshots.test.js.snap @@ -1,5 +1,855 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`Storyshots AddonInfo.DocgenButton DocgenButton 1`] = ` +
+
+ +
+ + Show Info + +
+ + × + +
+
+
+

+ AddonInfo.DocgenButton +

+

+ DocgenButton +

+
+
+

+ Some Description +

+
+
+

+ Story Source +

+
+            
+ + < + DocgenButton + + + + + + onClick + + + = + + + + clicked() + + + + + + + + + label + + + = + + + " + Docgen Button + " + + + + + + + + /> + +
+
+
+
+

+ Prop Types +

+
+

+ " + DocgenButton + " Component +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ property + + propType + + required + + default + + description +
+ disabled + + bool + + no + + + + false + + + +
+ enm + + other + + no + + - + +
+ label + + string + + yes + + - + +
+ msg + + other + + no + + - + +
+ onClick + + func + + no + + + + onClick() + + + +
+ one + + other + + no + + - + +
+ two + + other + + no + + - + +
+ union + + other + + no + + - + +
+
+
+
+
+
+
+`; + +exports[`Storyshots AddonInfo.FlowTypeButton FlowTypeButton 1`] = ` +
+
+ +
+ + Show Info + +
+ + × + +
+
+
+

+ AddonInfo.FlowTypeButton +

+

+ FlowTypeButton +

+
+
+

+ Some Description +

+
+
+

+ Story Source +

+
+            
+ + < + FlowTypeButton + + + + + + onClick + + + = + + + + clicked() + + + + + + + + + label + + + = + + + " + Flow Typed Button + " + + + + + + + + /> + +
+
+
+
+

+ Prop Types +

+
+

+ " + FlowTypeButton + " Component +

+ + + + + + + + + + + + + + + + + + + + +
+ property + + propType + + required + + default + + description +
+ disabled + + + + + + false + + + +
+ onClick + + + + + + onClick() + + + +
+
+
+
+
+
+
+`; + exports[`Storyshots App full app 1`] = `

Welcome to React diff --git a/examples/cra-kitchen-sink/src/components/FlowTypeButton.js b/examples/cra-kitchen-sink/src/components/FlowTypeButton.js new file mode 100644 index 000000000000..3ef725f86de1 --- /dev/null +++ b/examples/cra-kitchen-sink/src/components/FlowTypeButton.js @@ -0,0 +1,24 @@ +// @flow +import React from 'react'; + +type PropsType = { + /** The text to be rendered in the button */ + label: string, + /** Function to be called when the button is clicked */ + onClick?: Function, + /** Boolean representing wether the button is disabled */ + disabled?: boolean, +}; + +/** Flow type button description */ +const FlowTypeButton = ({ label, onClick, disabled }: PropsType) => + ; + +FlowTypeButton.defaultProps = { + disabled: false, + onClick: () => {}, +}; + +export default FlowTypeButton; diff --git a/examples/cra-kitchen-sink/src/stories/index.js b/examples/cra-kitchen-sink/src/stories/index.js index 38db317317cf..ada77d629f7c 100644 --- a/examples/cra-kitchen-sink/src/stories/index.js +++ b/examples/cra-kitchen-sink/src/stories/index.js @@ -27,6 +27,7 @@ import App from '../App'; import Logger from './Logger'; import Container from './Container'; import DocgenButton from '../components/DocgenButton'; +import FlowTypeButton from '../components/FlowTypeButton'; const EVENTS = { TEST_EVENT_1: 'test-event-1', @@ -167,6 +168,13 @@ storiesOf('AddonInfo.DocgenButton', module).addWithInfo('DocgenButton', 'Some De ); +storiesOf( + 'AddonInfo.FlowTypeButton', + module +).addWithInfo('FlowTypeButton', 'Some Description', () => + +); + storiesOf('App', module).add('full app', () => ); storiesOf('Some really long story kind description', module)