aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2019-01-15 11:59:39 +0100
committerLibravatar Stefan Malzner <stefan@adlk.io>2019-01-15 11:59:39 +0100
commite31248830eb63c8bff3d9add3baa4ca8916b74e1 (patch)
tree5424634ccd5861fdf53340ad3f1001922394c5a9 /packages
parentPublish (diff)
downloadferdium-app-e31248830eb63c8bff3d9add3baa4ca8916b74e1.tar.gz
ferdium-app-e31248830eb63c8bff3d9add3baa4ca8916b74e1.tar.zst
ferdium-app-e31248830eb63c8bff3d9add3baa4ca8916b74e1.zip
Button, add missing success state
Diffstat (limited to 'packages')
-rw-r--r--packages/forms/src/button/index.tsx12
-rw-r--r--packages/theme/package-lock.json2
-rw-r--r--packages/theme/src/themes/dark/index.ts1
-rw-r--r--packages/theme/src/themes/default/index.ts4
4 files changed, 17 insertions, 2 deletions
diff --git a/packages/forms/src/button/index.tsx b/packages/forms/src/button/index.tsx
index d2c5ad96d..784ead04c 100644
--- a/packages/forms/src/button/index.tsx
+++ b/packages/forms/src/button/index.tsx
@@ -10,7 +10,7 @@ import Loader from 'react-loader';
10 10
11import { IFormField, IWithStyle } from '../typings/generic'; 11import { IFormField, IWithStyle } from '../typings/generic';
12 12
13type ButtonType = 'primary' | 'secondary' | 'danger' | 'warning' | 'inverted'; 13type ButtonType = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'inverted';
14 14
15interface IProps extends React.InputHTMLAttributes<HTMLButtonElement>, IFormField, IWithStyle { 15interface IProps extends React.InputHTMLAttributes<HTMLButtonElement>, IFormField, IWithStyle {
16 buttonType?: ButtonType; 16 buttonType?: ButtonType;
@@ -61,6 +61,14 @@ const styles = (theme: Theme) => ({
61 fill: theme.buttonSecondaryTextColor, 61 fill: theme.buttonSecondaryTextColor,
62 }, 62 },
63 }, 63 },
64 success: {
65 background: theme.buttonSuccessBackground,
66 color: theme.buttonSuccessTextColor,
67
68 '& svg': {
69 fill: theme.buttonSuccessTextColor,
70 },
71 },
64 danger: { 72 danger: {
65 background: theme.buttonDangerBackground, 73 background: theme.buttonDangerBackground,
66 color: theme.buttonDangerTextColor, 74 color: theme.buttonDangerTextColor,
@@ -144,6 +152,7 @@ class ButtonComponent extends Component<IProps> {
144 render() { 152 render() {
145 const { 153 const {
146 classes, 154 classes,
155 className,
147 theme, 156 theme,
148 disabled, 157 disabled,
149 id, 158 id,
@@ -185,6 +194,7 @@ class ButtonComponent extends Component<IProps> {
185 [`${classes.button}`]: true, 194 [`${classes.button}`]: true,
186 [`${classes[buttonType as ButtonType]}`]: true, 195 [`${classes[buttonType as ButtonType]}`]: true,
187 [`${classes.disabled}`]: disabled, 196 [`${classes.disabled}`]: disabled,
197 [`${className}`]: className,
188 })} 198 })}
189 disabled={disabled} 199 disabled={disabled}
190 > 200 >
diff --git a/packages/theme/package-lock.json b/packages/theme/package-lock.json
index f188e8d98..a1673ffe8 100644
--- a/packages/theme/package-lock.json
+++ b/packages/theme/package-lock.json
@@ -1,6 +1,6 @@
1{ 1{
2 "name": "@meetfranz/theme", 2 "name": "@meetfranz/theme",
3 "version": "1.0.1", 3 "version": "1.0.2",
4 "lockfileVersion": 1, 4 "lockfileVersion": 1,
5 "requires": true, 5 "requires": true,
6 "dependencies": { 6 "dependencies": {
diff --git a/packages/theme/src/themes/dark/index.ts b/packages/theme/src/themes/dark/index.ts
index bc2db5ca0..58ef63217 100644
--- a/packages/theme/src/themes/dark/index.ts
+++ b/packages/theme/src/themes/dark/index.ts
@@ -43,6 +43,7 @@ export const buttonWarningTextColor = legacyStyles.darkThemeTextColor;
43export const buttonLoaderColor = { 43export const buttonLoaderColor = {
44 primary: '#FFF', 44 primary: '#FFF',
45 secondary: buttonSecondaryTextColor, 45 secondary: buttonSecondaryTextColor,
46 success: '#FFF',
46 warning: '#FFF', 47 warning: '#FFF',
47 danger: '#FFF', 48 danger: '#FFF',
48 inverted: defaultStyles.brandPrimary, 49 inverted: defaultStyles.brandPrimary,
diff --git a/packages/theme/src/themes/default/index.ts b/packages/theme/src/themes/default/index.ts
index 92b82cff1..0f78928c3 100644
--- a/packages/theme/src/themes/default/index.ts
+++ b/packages/theme/src/themes/default/index.ts
@@ -58,6 +58,9 @@ export const buttonPrimaryTextColor = '#FFF';
58export const buttonSecondaryBackground = legacyStyles.themeGrayLighter; 58export const buttonSecondaryBackground = legacyStyles.themeGrayLighter;
59export const buttonSecondaryTextColor = legacyStyles.themeGray; 59export const buttonSecondaryTextColor = legacyStyles.themeGray;
60 60
61export const buttonSuccessBackground = brandSuccess;
62export const buttonSuccessTextColor = '#FFF';
63
61export const buttonDangerBackground = brandDanger; 64export const buttonDangerBackground = brandDanger;
62export const buttonDangerTextColor = '#FFF'; 65export const buttonDangerTextColor = '#FFF';
63 66
@@ -71,6 +74,7 @@ export const buttonInvertedBorder = `1px solid ${brandPrimary}`;
71export const buttonLoaderColor = { 74export const buttonLoaderColor = {
72 primary: '#FFF', 75 primary: '#FFF',
73 secondary: buttonSecondaryTextColor, 76 secondary: buttonSecondaryTextColor,
77 success: '#FFF',
74 warning: '#FFF', 78 warning: '#FFF',
75 danger: '#FFF', 79 danger: '#FFF',
76 inverted: brandPrimary, 80 inverted: brandPrimary,