diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/forms/package.json | 4 | ||||
-rw-r--r-- | packages/forms/src/button/index.tsx | 12 | ||||
-rw-r--r-- | packages/ui/package.json | 4 | ||||
-rw-r--r-- | packages/ui/src/badge/ProBadge.tsx | 3 | ||||
-rw-r--r-- | packages/ui/src/icon/index.tsx | 12 | ||||
-rw-r--r-- | packages/ui/src/infobox/index.tsx | 3 |
6 files changed, 14 insertions, 24 deletions
diff --git a/packages/forms/package.json b/packages/forms/package.json index d50f4c756..bb76462d8 100644 --- a/packages/forms/package.json +++ b/packages/forms/package.json | |||
@@ -1,6 +1,6 @@ | |||
1 | { | 1 | { |
2 | "name": "@meetfranz/forms", | 2 | "name": "@meetfranz/forms", |
3 | "version": "1.0.16", | 3 | "version": "1.1.0", |
4 | "description": "React form components for Franz", | 4 | "description": "React form components for Franz", |
5 | "main": "lib/index.js", | 5 | "main": "lib/index.js", |
6 | "scripts": { | 6 | "scripts": { |
@@ -35,5 +35,5 @@ | |||
35 | "react-dom": "16.7.0", | 35 | "react-dom": "16.7.0", |
36 | "react-jss": "^8.6.1" | 36 | "react-jss": "^8.6.1" |
37 | }, | 37 | }, |
38 | "gitHead": "9f2ab40b7602bc3df26ebb093b484b9917768f69" | 38 | "gitHead": "e1e46986d902adc4c19ee009016290f9733a7d61" |
39 | } | 39 | } |
diff --git a/packages/forms/src/button/index.tsx b/packages/forms/src/button/index.tsx index 9faedc8f1..b53c2da05 100644 --- a/packages/forms/src/button/index.tsx +++ b/packages/forms/src/button/index.tsx | |||
@@ -1,4 +1,3 @@ | |||
1 | import * as mdiIcons from '@mdi/js'; | ||
2 | import Icon from '@mdi/react'; | 1 | import Icon from '@mdi/react'; |
3 | import { Theme } from '@meetfranz/theme'; | 2 | import { Theme } from '@meetfranz/theme'; |
4 | import classnames from 'classnames'; | 3 | import classnames from 'classnames'; |
@@ -21,7 +20,7 @@ interface IProps extends IFormField, IWithStyle { | |||
21 | stretch?: boolean; | 20 | stretch?: boolean; |
22 | loaded?: boolean; | 21 | loaded?: boolean; |
23 | busy?: boolean; | 22 | busy?: boolean; |
24 | icon?: keyof typeof mdiIcons; | 23 | icon?: string; |
25 | href?: string; | 24 | href?: string; |
26 | target?: string; | 25 | target?: string; |
27 | } | 26 | } |
@@ -175,7 +174,7 @@ class ButtonComponent extends Component<IProps> { | |||
175 | onClick, | 174 | onClick, |
176 | buttonType, | 175 | buttonType, |
177 | loaded, | 176 | loaded, |
178 | icon: iconName, | 177 | icon, |
179 | busy: busyProp, | 178 | busy: busyProp, |
180 | href, | 179 | href, |
181 | target, | 180 | target, |
@@ -185,13 +184,6 @@ class ButtonComponent extends Component<IProps> { | |||
185 | busy, | 184 | busy, |
186 | } = this.state; | 185 | } = this.state; |
187 | 186 | ||
188 | let icon = ''; | ||
189 | if (iconName && mdiIcons[iconName]) { | ||
190 | icon = mdiIcons[iconName]; | ||
191 | } else if (iconName && !mdiIcons[iconName]) { | ||
192 | console.warn(`Icon '${iconName}' was not found`); | ||
193 | } | ||
194 | |||
195 | let showLoader = false; | 187 | let showLoader = false; |
196 | if (loaded) { | 188 | if (loaded) { |
197 | showLoader = !loaded; | 189 | showLoader = !loaded; |
diff --git a/packages/ui/package.json b/packages/ui/package.json index a851ed9cf..4f42b21b5 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json | |||
@@ -1,6 +1,6 @@ | |||
1 | { | 1 | { |
2 | "name": "@meetfranz/ui", | 2 | "name": "@meetfranz/ui", |
3 | "version": "0.0.9", | 3 | "version": "1.0.0", |
4 | "description": "React UI components for Franz", | 4 | "description": "React UI components for Franz", |
5 | "main": "lib/index.js", | 5 | "main": "lib/index.js", |
6 | "scripts": { | 6 | "scripts": { |
@@ -34,5 +34,5 @@ | |||
34 | "react-dom": "16.7.0", | 34 | "react-dom": "16.7.0", |
35 | "react-jss": "^8.6.1" | 35 | "react-jss": "^8.6.1" |
36 | }, | 36 | }, |
37 | "gitHead": "9f2ab40b7602bc3df26ebb093b484b9917768f69" | 37 | "gitHead": "e1e46986d902adc4c19ee009016290f9733a7d61" |
38 | } | 38 | } |
diff --git a/packages/ui/src/badge/ProBadge.tsx b/packages/ui/src/badge/ProBadge.tsx index 2dad7ef49..5cc41f5b2 100644 --- a/packages/ui/src/badge/ProBadge.tsx +++ b/packages/ui/src/badge/ProBadge.tsx | |||
@@ -1,3 +1,4 @@ | |||
1 | import { mdiStar } from '@mdi/js'; | ||
1 | import { Theme } from '@meetfranz/theme'; | 2 | import { Theme } from '@meetfranz/theme'; |
2 | import classnames from 'classnames'; | 3 | import classnames from 'classnames'; |
3 | import React, { Component } from 'react'; | 4 | import React, { Component } from 'react'; |
@@ -52,7 +53,7 @@ class ProBadgeComponent extends Component<IProps> { | |||
52 | ])} | 53 | ])} |
53 | > | 54 | > |
54 | <Icon | 55 | <Icon |
55 | icon="mdiStar" | 56 | icon={mdiStar} |
56 | className={classnames([ | 57 | className={classnames([ |
57 | classes.icon, | 58 | classes.icon, |
58 | inverted && classes.invertedIcon, | 59 | inverted && classes.invertedIcon, |
diff --git a/packages/ui/src/icon/index.tsx b/packages/ui/src/icon/index.tsx index e30d3396d..af467c085 100644 --- a/packages/ui/src/icon/index.tsx +++ b/packages/ui/src/icon/index.tsx | |||
@@ -1,4 +1,3 @@ | |||
1 | import * as mdiIcons from '@mdi/js'; | ||
2 | import MdiIcon from '@mdi/react'; | 1 | import MdiIcon from '@mdi/react'; |
3 | import { Theme } from '@meetfranz/theme'; | 2 | import { Theme } from '@meetfranz/theme'; |
4 | import classnames from 'classnames'; | 3 | import classnames from 'classnames'; |
@@ -8,7 +7,7 @@ import injectStyle from 'react-jss'; | |||
8 | import { IWithStyle } from '../typings/generic'; | 7 | import { IWithStyle } from '../typings/generic'; |
9 | 8 | ||
10 | interface IProps extends IWithStyle { | 9 | interface IProps extends IWithStyle { |
11 | icon: keyof typeof mdiIcons; | 10 | icon: string; |
12 | size?: number; | 11 | size?: number; |
13 | className?: string; | 12 | className?: string; |
14 | } | 13 | } |
@@ -27,16 +26,13 @@ class IconComponent extends Component<IProps> { | |||
27 | render() { | 26 | render() { |
28 | const { | 27 | const { |
29 | classes, | 28 | classes, |
30 | icon: iconName, | 29 | icon, |
31 | size, | 30 | size, |
32 | className, | 31 | className, |
33 | } = this.props; | 32 | } = this.props; |
34 | 33 | ||
35 | let icon = ''; | 34 | if (!icon) { |
36 | if (iconName && mdiIcons[iconName]) { | 35 | console.warn('No Icon specified'); |
37 | icon = mdiIcons[iconName]; | ||
38 | } else if (iconName && !mdiIcons[iconName]) { | ||
39 | console.warn(`Icon '${iconName}' was not found`); | ||
40 | } | 36 | } |
41 | 37 | ||
42 | return ( | 38 | return ( |
diff --git a/packages/ui/src/infobox/index.tsx b/packages/ui/src/infobox/index.tsx index 09fc4596a..e4c2c5a3e 100644 --- a/packages/ui/src/infobox/index.tsx +++ b/packages/ui/src/infobox/index.tsx | |||
@@ -1,3 +1,4 @@ | |||
1 | import { mdiClose } from '@mdi/js'; | ||
1 | import { Theme } from '@meetfranz/theme'; | 2 | import { Theme } from '@meetfranz/theme'; |
2 | import classnames from 'classnames'; | 3 | import classnames from 'classnames'; |
3 | import React, { Component } from 'react'; | 4 | import React, { Component } from 'react'; |
@@ -192,7 +193,7 @@ class InfoboxComponent extends Component<IProps, IState> { | |||
192 | onClick={this.dismiss.bind(this)} | 193 | onClick={this.dismiss.bind(this)} |
193 | className={classes.close} | 194 | className={classes.close} |
194 | > | 195 | > |
195 | <Icon icon="mdiClose" /> | 196 | <Icon icon={mdiClose} /> |
196 | </button> | 197 | </button> |
197 | )} | 198 | )} |
198 | </div> | 199 | </div> |