diff options
author | Stefan Malzner <stefan@adlk.io> | 2019-06-13 15:48:23 +0200 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2019-06-13 15:48:23 +0200 |
commit | e5fbcfc9eb02a1cbb1c5876a3c1a01f79ad15180 (patch) | |
tree | 676d3c5478a7279d3cf510ad3f620ed2d3a76491 /uidev | |
parent | Add custom recipe limitation (diff) | |
parent | Merge branch 'release/5.2.0-beta.2' (diff) | |
download | ferdium-app-e5fbcfc9eb02a1cbb1c5876a3c1a01f79ad15180.tar.gz ferdium-app-e5fbcfc9eb02a1cbb1c5876a3c1a01f79ad15180.tar.zst ferdium-app-e5fbcfc9eb02a1cbb1c5876a3c1a01f79ad15180.zip |
Merge branch 'develop' into feature/3rd-party-limit
Diffstat (limited to 'uidev')
-rw-r--r-- | uidev/src/app.tsx | 2 | ||||
-rw-r--r-- | uidev/src/stories/button.stories.tsx | 40 |
2 files changed, 39 insertions, 3 deletions
diff --git a/uidev/src/app.tsx b/uidev/src/app.tsx index 870911c2f..cef22e7a7 100644 --- a/uidev/src/app.tsx +++ b/uidev/src/app.tsx | |||
@@ -2,7 +2,7 @@ import CSS from 'csstype'; | |||
2 | import { Classes } from 'jss'; | 2 | import { Classes } from 'jss'; |
3 | import { observer } from 'mobx-react'; | 3 | import { observer } from 'mobx-react'; |
4 | import DevTools from 'mobx-react-devtools'; | 4 | import DevTools from 'mobx-react-devtools'; |
5 | import React, { Component } from 'react'; | 5 | import React from 'react'; |
6 | import injectSheet from 'react-jss'; | 6 | import injectSheet from 'react-jss'; |
7 | 7 | ||
8 | import { WithTheme } from './withTheme'; | 8 | import { WithTheme } from './withTheme'; |
diff --git a/uidev/src/stories/button.stories.tsx b/uidev/src/stories/button.stories.tsx index c8e9bcbf3..f7537895c 100644 --- a/uidev/src/stories/button.stories.tsx +++ b/uidev/src/stories/button.stories.tsx | |||
@@ -1,8 +1,11 @@ | |||
1 | import { observable } from 'mobx'; | 1 | import { observable } from 'mobx'; |
2 | import { observer } from 'mobx-react'; | 2 | import { observer } from 'mobx-react'; |
3 | import React from 'react'; | 3 | import React from 'react'; |
4 | import injectSheet from 'react-jss'; | ||
4 | 5 | ||
5 | import { Button } from '@meetfranz/forms'; | 6 | import { Button, Input } from '@meetfranz/forms'; |
7 | import { classes } from 'istanbul-lib-coverage'; | ||
8 | import { Classes } from 'jss'; | ||
6 | import { storiesOf } from '../stores/stories'; | 9 | import { storiesOf } from '../stores/stories'; |
7 | 10 | ||
8 | const defaultProps = { | 11 | const defaultProps = { |
@@ -13,6 +16,17 @@ const defaultProps = { | |||
13 | disabled: false, | 16 | disabled: false, |
14 | }; | 17 | }; |
15 | 18 | ||
19 | const styles = { | ||
20 | combinedElements: { | ||
21 | display: 'flex', | ||
22 | justifyContent: 'space-between', | ||
23 | }, | ||
24 | input: { | ||
25 | flex: 1, | ||
26 | marginRight: 20, | ||
27 | }, | ||
28 | }; | ||
29 | |||
16 | const createStore = (args?: any) => { | 30 | const createStore = (args?: any) => { |
17 | return observable(Object.assign({}, defaultProps, args)); | 31 | return observable(Object.assign({}, defaultProps, args)); |
18 | }; | 32 | }; |
@@ -99,4 +113,26 @@ storiesOf('Button') | |||
99 | e.preventDefault(); | 113 | e.preventDefault(); |
100 | alert('Click event'); | 114 | alert('Click event'); |
101 | }, | 115 | }, |
102 | })} />)); | 116 | })}/> |
117 | )) | ||
118 | .add('Long multi-line button', () => ( | ||
119 | <WithStoreButton store={createStore({ | ||
120 | label: 'But there is something that I must say to my people, who stand on the warm threshold which leads into the palace of justice: In the process of gaining our rightful place, we must not be guilty of wrongful deeds. Let us not seek to satisfy our thirst for freedom by drinking from the cup of bitterness and hatred. We must forever conduct our struggle on the high plane of dignity and discipline. We must not allow our creative protest to degenerate into physical violence. Again and again, we must rise to the majestic heights of meeting physical force with soul force.', | ||
121 | })} /> | ||
122 | )) | ||
123 | .add('Button with Input', injectSheet(styles)(observer(({ classes }: { classes: Classes }) => ( | ||
124 | <div className={classes.combinedElements}> | ||
125 | <Input showLabel={false} className={classes.input} noMargin /> | ||
126 | <WithStoreButton store={createStore({})} /> | ||
127 | </div> | ||
128 | )), | ||
129 | )) | ||
130 | .add('Icon Button with Input', injectSheet(styles)(observer(({ classes }: { classes: Classes }) => ( | ||
131 | <div className={classes.combinedElements}> | ||
132 | <Input showLabel={false} className={classes.input} noMargin /> | ||
133 | <WithStoreButton store={createStore({ | ||
134 | icon: 'mdiInformation', | ||
135 | })} /> | ||
136 | </div> | ||
137 | )), | ||
138 | )); | ||