aboutsummaryrefslogtreecommitdiffstats
path: root/packages/forms/src/input
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2019-01-11 21:07:21 +0100
committerLibravatar Stefan Malzner <stefan@adlk.io>2019-01-11 21:07:21 +0100
commit0ac2806481852249c6a2d4a032cc2c0324a58ef8 (patch)
tree03292af10a5a97b824293ff8878d2a5c821d5ed2 /packages/forms/src/input
parentexpose legacy styles (diff)
downloadferdium-app-0ac2806481852249c6a2d4a032cc2c0324a58ef8.tar.gz
ferdium-app-0ac2806481852249c6a2d4a032cc2c0324a58ef8.tar.zst
ferdium-app-0ac2806481852249c6a2d4a032cc2c0324a58ef8.zip
Add toggle element to @meetfranz/forms
Diffstat (limited to 'packages/forms/src/input')
-rw-r--r--packages/forms/src/input/index.tsx10
-rw-r--r--packages/forms/src/input/styles.ts2
2 files changed, 5 insertions, 7 deletions
diff --git a/packages/forms/src/input/index.tsx b/packages/forms/src/input/index.tsx
index 0e19e3368..d82ee5fe3 100644
--- a/packages/forms/src/input/index.tsx
+++ b/packages/forms/src/input/index.tsx
@@ -16,14 +16,12 @@ import scorePasswordFunc from './scorePassword';
16 16
17import styles from './styles'; 17import styles from './styles';
18 18
19interface IProps extends IFormField, React.InputHTMLAttributes<HTMLInputElement>, IWithStyle { 19interface IProps extends React.InputHTMLAttributes<HTMLInputElement>, IFormField, IWithStyle {
20 label: string;
21 focus?: boolean; 20 focus?: boolean;
22 prefix?: string; 21 prefix?: string;
23 suffix?: string; 22 suffix?: string;
24 scorePassword?: boolean; 23 scorePassword?: boolean;
25 showPasswordToggle?: boolean; 24 showPasswordToggle?: boolean;
26 error?: string;
27} 25}
28 26
29interface IState { 27interface IState {
@@ -32,15 +30,15 @@ interface IState {
32} 30}
33 31
34@observer 32@observer
35class Input extends Component<IProps, IState> { 33class InputComponent extends Component<IProps, IState> {
36 public static defaultProps = { 34 public static defaultProps = {
37 classes: {},
38 focus: false, 35 focus: false,
39 onChange: () => {}, 36 onChange: () => {},
40 scorePassword: false, 37 scorePassword: false,
41 showLabel: true, 38 showLabel: true,
42 showPasswordToggle: false, 39 showPasswordToggle: false,
43 type: 'text', 40 type: 'text',
41 disabled: false,
44 }; 42 };
45 43
46 state = { 44 state = {
@@ -172,4 +170,4 @@ class Input extends Component<IProps, IState> {
172 } 170 }
173} 171}
174 172
175export default injectSheet(styles)(Input); 173export const Input = injectSheet(styles)(InputComponent);
diff --git a/packages/forms/src/input/styles.ts b/packages/forms/src/input/styles.ts
index 2cdda12ee..2b34e92c3 100644
--- a/packages/forms/src/input/styles.ts
+++ b/packages/forms/src/input/styles.ts
@@ -1,5 +1,5 @@
1import { Theme } from '@meetfranz/theme';
1import CSS from 'csstype'; 2import CSS from 'csstype';
2import { Theme } from '../../../theme/lib';
3 3
4const prefixStyles = (theme: Theme) => ({ 4const prefixStyles = (theme: Theme) => ({
5 background: theme.inputPrefixBackground, 5 background: theme.inputPrefixBackground,