Skip to content

Commit

Permalink
Fix build issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
Miles Johnson committed Apr 17, 2019
1 parent 508970a commit 2cb3937
Show file tree
Hide file tree
Showing 19 changed files with 142 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Extremely helpful in meeting the threshold.
## 🎨 Styleguide Requirements

Our styleguide (powered by [Storybook](https://storybook.js.org/)) requires a bit of manual
documentation of components to be properly infer prop types.
documenting of components to properly infer prop types.

- Component definitions require a
[docblock comment description](https://github.com/reactjs/react-docgen#proptypes). Furthermore, a
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/components/FormActions.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ storiesOf('Core/FormActions', module)
.add('With a reset button.', () => <FormActions showReset />)
.add('With small buttons in a processing state.', () => (
<FormActions showReset small processing />
));
))
.add('In a danger state.', () => <FormActions danger />);
8 changes: 7 additions & 1 deletion packages/forms/src/components/Autocomplete.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ storiesOf('Forms/Autocomplete', module)
inspectComponents: [Autocomplete],
})
.add('Connected to the parent `Form`.', () => (
<Form onSubmit={action('onSubmit')}>
<Form
onSubmit={() => {
action('onSubmit')();

return Promise.resolve();
}}
>
<Autocomplete
name="field"
label="Label"
Expand Down
8 changes: 7 additions & 1 deletion packages/forms/src/components/CheckBox.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ storiesOf('Forms/CheckBox', module)
inspectComponents: [CheckBox],
})
.add('Connected to the parent `Form`.', () => (
<Form onSubmit={action('onSubmit')}>
<Form
onSubmit={() => {
action('onSubmit')();

return Promise.resolve();
}}
>
<CheckBox name="field" label="Label" validator={() => {}} />
</Form>
));
8 changes: 7 additions & 1 deletion packages/forms/src/components/CheckBoxController.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ storiesOf('Forms/CheckBoxController', module)
inspectComponents: [CheckBoxController],
})
.add('Connected to the parent `Form`.', () => (
<Form onSubmit={action('onSubmit')}>
<Form
onSubmit={() => {
action('onSubmit')();

return Promise.resolve();
}}
>
<CheckBoxController name="field" label="Label" validator={() => {}}>
{CheckBox => (
<div>
Expand Down
8 changes: 7 additions & 1 deletion packages/forms/src/components/DatePickerInput.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ storiesOf('Forms/DatePickerInput', module)
inspectComponents: [DatePickerInput],
})
.add('Connected to the parent `Form`.', () => (
<Form onSubmit={action('onSubmit')}>
<Form
onSubmit={() => {
action('onSubmit')();

return Promise.resolve();
}}
>
<DatePickerInput name="field" label="Label" validator={() => {}} />
</Form>
));
8 changes: 7 additions & 1 deletion packages/forms/src/components/DateTimeSelect.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ storiesOf('Forms/DateTimeSelect', module)
inspectComponents: [DateTimeSelect],
})
.add('Connected to the parent `Form`.', () => (
<Form onSubmit={action('onSubmit')}>
<Form
onSubmit={() => {
action('onSubmit')();

return Promise.resolve();
}}
>
<DateTimeSelect name="field" label="Label" validator={() => {}} />
</Form>
));
12 changes: 10 additions & 2 deletions packages/forms/src/components/FeedbackForm.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ storiesOf('Forms/FeedbackForm', module)
channel="Lunar"
channelID={1}
teamID={2}
onSubmit={action('onSubmit')}
onSubmit={() => {
action('onSubmit')();

return Promise.resolve();
}}
/>
))
.add('Without bug reporting.', () => (
Expand All @@ -28,7 +32,11 @@ storiesOf('Forms/FeedbackForm', module)
channel="Lunar"
channelID={1}
teamID={2}
onSubmit={action('onSubmit')}
onSubmit={() => {
action('onSubmit')();

return Promise.resolve();
}}
disableBugReporting
/>
));
8 changes: 7 additions & 1 deletion packages/forms/src/components/FileInput.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ storiesOf('Forms/FileInput', module)
inspectComponents: [FileInput],
})
.add('Connected to the parent `Form`.', () => (
<Form onSubmit={action('onSubmit')}>
<Form
onSubmit={() => {
action('onSubmit')();

return Promise.resolve();
}}
>
<FileInput name="field" label="Label" validator={() => {}} />
</Form>
));
24 changes: 21 additions & 3 deletions packages/forms/src/components/FilterMenu.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ storiesOf('Forms/FilterMenu', module)
})
.addDecorator(story => <div style={{ margin: 'auto' }}>{story()}</div>)
.add('Form in a dropdown.', () => (
<Form onSubmit={action('onSubmit')}>
<Form
onSubmit={() => {
action('onSubmit')();

return Promise.resolve();
}}
>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
<FilterMenu
accessibilityLabel="Filter menu"
Expand Down Expand Up @@ -47,7 +53,13 @@ storiesOf('Forms/FilterMenu', module)
</Form>
))
.add('Left-aligned menu.', () => (
<Form onSubmit={action('onSubmit')}>
<Form
onSubmit={() => {
action('onSubmit')();

return Promise.resolve();
}}
>
<FilterMenu dropdownProps={{ left: 0 }} accessibilityLabel="Filter menu">
<Row>
<Select
Expand Down Expand Up @@ -75,7 +87,13 @@ storiesOf('Forms/FilterMenu', module)
</Form>
))
.add('With overflow.', () => (
<Form onSubmit={action('onSubmit')}>
<Form
onSubmit={() => {
action('onSubmit')();

return Promise.resolve();
}}
>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
<FilterMenu accessibilityLabel="Filter menu" menuProps={{ maxHeight: 200 }} zIndex={2}>
<Row>
Expand Down
12 changes: 10 additions & 2 deletions packages/forms/src/components/Form.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ class UnmountExample extends React.Component<{}, { mounted: boolean }> {
return (
<Form
onFailedSubmit={action('onFailedSubmit')}
onSubmit={action('onSubmit')}
onSubmit={() => {
action('onSubmit')();

return Promise.resolve();
}}
onStateUpdate={action('onStateUpdate')}
>
{mounted && (
Expand Down Expand Up @@ -113,7 +117,11 @@ storiesOf('Forms/Form', module)
<Form
initialValues={values}
onFailedSubmit={action('onFailedSubmit')}
onSubmit={action('onSubmit')}
onSubmit={() => {
action('onSubmit')();

return Promise.resolve();
}}
onStateUpdate={action('onStateUpdate')}
>
<Input
Expand Down
8 changes: 7 additions & 1 deletion packages/forms/src/components/FormActions.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ storiesOf('Forms/FormActions', module)
inspectComponents: [FormActions],
})
.add('Connected to the parent `Form`.', () => (
<Form onSubmit={action('onSubmit')}>
<Form
onSubmit={() => {
action('onSubmit')();

return Promise.resolve();
}}
>
<FormActions />
</Form>
));
8 changes: 7 additions & 1 deletion packages/forms/src/components/Input.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ storiesOf('Forms/Input', module)
inspectComponents: [Input],
})
.add('Connected to the parent `Form`.', () => (
<Form onSubmit={action('onSubmit')}>
<Form
onSubmit={() => {
action('onSubmit')();

return Promise.resolve();
}}
>
<Input name="field" label="Label" validator={() => {}} />
</Form>
));
8 changes: 7 additions & 1 deletion packages/forms/src/components/Multicomplete.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ storiesOf('Forms/Multicomplete', module)
inspectComponents: [Multicomplete],
})
.add('Connected to the parent `Form`.', () => (
<Form onSubmit={action('onSubmit')}>
<Form
onSubmit={() => {
action('onSubmit')();

return Promise.resolve();
}}
>
<Multicomplete
name="field"
label="Label"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ storiesOf('Forms/RadioButtonController', module)
inspectComponents: [RadioButtonController],
})
.add('Connected to the parent `Form`.', () => (
<Form onSubmit={action('onSubmit')}>
<Form
onSubmit={() => {
action('onSubmit')();

return Promise.resolve();
}}
>
<RadioButtonController name="field" label="Label" validator={() => {}}>
{RadioButton => (
<div>
Expand Down
8 changes: 7 additions & 1 deletion packages/forms/src/components/Select.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ storiesOf('Forms/Select', module)
inspectComponents: [Select],
})
.add('Connected to the parent `Form`.', () => (
<Form onSubmit={action('onSubmit')}>
<Form
onSubmit={() => {
action('onSubmit')();

return Promise.resolve();
}}
>
<Select name="field" label="Label" validator={() => {}}>
<option value="foo">Foo</option>
<option value="bar">Bar</option>
Expand Down
8 changes: 7 additions & 1 deletion packages/forms/src/components/Switch.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ storiesOf('Forms/Switch', module)
inspectComponents: [Switch],
})
.add('Connected to the parent `Form`.', () => (
<Form onSubmit={action('onSubmit')}>
<Form
onSubmit={() => {
action('onSubmit')();

return Promise.resolve();
}}
>
<Switch name="field" label="Label" validator={() => {}} />
</Form>
));
8 changes: 7 additions & 1 deletion packages/forms/src/components/TextArea.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ storiesOf('Forms/TextArea', module)
inspectComponents: [TextArea],
})
.add('Connected to the parent `Form`.', () => (
<Form onSubmit={action('onSubmit')}>
<Form
onSubmit={() => {
action('onSubmit')();

return Promise.resolve();
}}
>
<TextArea name="field" label="Label" validator={() => {}} />
</Form>
));
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ storiesOf('Forms/ToggleButtonController', module)
inspectComponents: [ToggleButtonController],
})
.add('Connected to the parent `Form`.', () => (
<Form onSubmit={action('onSubmit')}>
<Form
onSubmit={() => {
action('onSubmit')();

return Promise.resolve();
}}
>
<ToggleButtonController name="field" label="Label" validator={() => {}}>
{ControlledButton => (
<ButtonGroup>
Expand Down

0 comments on commit 2cb3937

Please sign in to comment.