@tecsinapse/react-native-kit 1.17.0 → 1.17.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,36 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.17.3](https://github.com/tecsinapse/design-system/compare/@tecsinapse/react-native-kit@1.17.2...@tecsinapse/react-native-kit@1.17.3) (2022-05-24)
7
+
8
+ **Note:** Version bump only for package @tecsinapse/react-native-kit
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.17.2](https://github.com/tecsinapse/design-system/compare/@tecsinapse/react-native-kit@1.17.1...@tecsinapse/react-native-kit@1.17.2) (2022-05-13)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * error render, added ternary ([#163902](https://github.com/tecsinapse/design-system/issues/163902)) ([fd52d5c](https://github.com/tecsinapse/design-system/commit/fd52d5cfe7ca7f56c0b721ad17d8bac589295bf5))
20
+
21
+
22
+
23
+
24
+
25
+ ## [1.17.1](https://github.com/tecsinapse/design-system/compare/@tecsinapse/react-native-kit@1.17.0...@tecsinapse/react-native-kit@1.17.1) (2022-05-13)
26
+
27
+
28
+ ### Features
29
+
30
+ * standardizing input label and placeholder ([#163902](https://github.com/tecsinapse/design-system/issues/163902)) ([225a57b](https://github.com/tecsinapse/design-system/commit/225a57b8c5f8b6a7ae1058a56590a3f0dd294d55))
31
+
32
+
33
+
34
+
35
+
6
36
  # [1.17.0](https://github.com/tecsinapse/design-system/compare/@tecsinapse/react-native-kit@1.16.2...@tecsinapse/react-native-kit@1.17.0) (2022-05-10)
7
37
 
8
38
 
@@ -39,6 +39,8 @@ const Input = _react.default.forwardRef(({
39
39
  hint,
40
40
  onFocus,
41
41
  onBlur,
42
+ value,
43
+ placeholder,
42
44
  ...rest
43
45
  }, ref) => {
44
46
  const _hint = hintComponent || _react.default.createElement(_reactCore.Hint, {
@@ -52,10 +54,11 @@ const Input = _react.default.forwardRef(({
52
54
  handleBlur,
53
55
  handleFocus
54
56
  } = (0, _reactCore.useInputFocus)(onFocus, onBlur, !disabled);
57
+ const onlyLabel = label && !placeholder;
55
58
  return _react.default.createElement(_reactNative.View, {
56
59
  style: style
57
60
  }, _react.default.createElement(_styled.StyledInputContainer, {
58
- label: label,
61
+ label: value ? label : undefined,
59
62
  labelColor: labelColor,
60
63
  labelColorVariant: labelColorVariant,
61
64
  labelColorTone: labelColorTone,
@@ -72,6 +75,8 @@ const Input = _react.default.forwardRef(({
72
75
  disabled: disabled,
73
76
  variant: variant
74
77
  }, _react.default.createElement(_styled.StyledNativeInput, _extends({}, rest, {
78
+ placeholder: onlyLabel ? label : placeholder,
79
+ value: value,
75
80
  ref: ref,
76
81
  fontStack: inputFontStack,
77
82
  fontWeight: inputFontWeight,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Input/Input.tsx"],"names":["Input","React","forwardRef","label","labelColor","labelColorVariant","labelColorTone","labelTypography","labelStack","labelWeight","leftComponent","rightComponent","disabled","style","borderColor","borderColorGradation","inputFontStack","inputFontWeight","inputContainerStyle","variant","hintComponent","hint","onFocus","onBlur","rest","ref","_hint","Text","focused","handleBlur","handleFocus","displayName"],"mappings":";;;;;AAAA;;AAQA;;AACA;;AACA;;AACA;;;;;;AASA,MAAMA,KAA2B,GAAGC,eAAMC,UAAN,CAClC,CACE;AACEC,EAAAA,KADF;AAEEC,EAAAA,UAFF;AAGEC,EAAAA,iBAHF;AAIEC,EAAAA,cAJF;AAKEC,EAAAA,eALF;AAMEC,EAAAA,UANF;AAOEC,EAAAA,WAPF;AAQEC,EAAAA,aARF;AASEC,EAAAA,cATF;AAUEC,EAAAA,QAVF;AAWEC,EAAAA,KAXF;AAYEC,EAAAA,WAZF;AAaEC,EAAAA,oBAbF;AAcEC,EAAAA,cAAc,GAAG,SAdnB;AAeEC,EAAAA,eAAe,GAAG,MAfpB;A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,EAAEL,QALZ;AAME,IAAA,OAAO,EAAEkB,WANX;AAOE,IAAA,MAAM,EAAED;AAPV,KAlBF,CADF,EA6BGR,IAAI,IAAIK,KA7BX,CADF;AAiCD,CAtEiC,CAApC;;AAyEA1B,KAAK,CAAC+B,WAAN,GAAoB,OAApB;eAEe/B,K","sourcesContent":["import {\n FontStackType,\n FontWeightType,\n Hint,\n InputContainerProps,\n InputElementProps,\n useInputFocus,\n} from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\nimport { View } from 'react-native';\nimport { Text } from '../Text';\nimport { StyledInputContainer, StyledNativeInput } from './styled';\n\nexport interface InputNativeProps\n extends Omit<InputElementProps, 'style'>,\n InputContainerProps {\n inputFontStack?: FontStackType;\n inputFontWeight?: FontWeightType;\n}\n\nconst Input: FC<InputNativeProps> = React.forwardRef(\n (\n {\n label,\n labelColor,\n labelColorVariant,\n labelColorTone,\n labelTypography,\n labelStack,\n labelWeight,\n leftComponent,\n rightComponent,\n disabled,\n style,\n borderColor,\n borderColorGradation,\n inputFontStack = 'default',\n inputFontWeight = 'bold',\n inputContainerStyle,\n variant = 'default',\n hintComponent,\n hint,\n onFocus,\n onBlur,\n ...rest\n },\n ref\n ) => {\n const _hint = hintComponent || (\n <Hint TextComponent={Text} text={hint} variant={variant} />\n );\n const { focused, handleBlur, handleFocus } = useInputFocus(\n onFocus,\n onBlur,\n !disabled\n );\n\n return (\n <View style={style}>\n <StyledInputContainer\n label={label}\n labelColor={labelColor}\n labelColorVariant={labelColorVariant}\n labelColorTone={labelColorTone}\n labelTypography={labelTypography}\n labelStack={labelStack}\n labelWeight={labelWeight}\n LabelComponent={Text}\n leftComponent={leftComponent}\n rightComponent={rightComponent}\n borderColor={borderColor}\n borderColorGradation={borderColorGradation}\n inputContainerStyle={inputContainerStyle}\n focused={focused}\n disabled={disabled}\n variant={variant}\n >\n <StyledNativeInput\n {...rest}\n ref={ref}\n fontStack={inputFontStack}\n fontWeight={inputFontWeight}\n disabled={disabled}\n onFocus={handleFocus}\n onBlur={handleBlur}\n />\n </StyledInputContainer>\n {hint && _hint}\n </View>\n );\n }\n);\n\nInput.displayName = 'Input';\n\nexport default Input;\n"],"file":"Input.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/Input/Input.tsx"],"names":["Input","React","forwardRef","label","labelColor","labelColorVariant","labelColorTone","labelTypography","labelStack","labelWeight","leftComponent","rightComponent","disabled","style","borderColor","borderColorGradation","inputFontStack","inputFontWeight","inputContainerStyle","variant","hintComponent","hint","onFocus","onBlur","value","placeholder","rest","ref","_hint","Text","focused","handleBlur","handleFocus","onlyLabel","undefined","displayName"],"mappings":";;;;;AAAA;;AAQA;;AACA;;AACA;;AACA;;;;;;AASA,MAAMA,KAA2B,GAAGC,eAAMC,UAAN,CAClC,CACE;AACEC,EAAAA,KADF;AAEEC,EAAAA,UAFF;AAGEC,EAAAA,iBAHF;AAIEC,EAAAA,cAJF;AAKEC,EAAAA,eALF;AAMEC,EAAAA,UANF;AAOEC,EAAAA,WAPF;AAQEC,EAAAA,aARF;AASEC,EAAAA,cATF;AAUEC,EAAAA,QAVF;AAWEC,EAAAA,KAXF;AAYEC,EAAAA,WAZF;AAaEC,EAAAA,oBAbF;AAcEC,EAAAA,cAAc,GAAG,SAdnB;AAeEC,EAAAA,eAAe,GAAG,MAfpB;AAgBEC,EAAAA,mBAhBF;AAiBEC,EAAAA,OAAO,GAAG,SAjBZ;AAkBEC,EAAAA,aAlBF;AAmBEC,EAAAA,IAnBF;AAoBEC,EAAAA,OApBF;AAqBEC,EAAAA,MArBF;AAsBEC,EAAAA,KAtBF;AAuBEC,EAAAA,WAvBF;AAwBE,KAAGC;AAxBL,CADF,EA2BEC,GA3BF,KA4BK;AACH,QAAMC,KAAK,GAAGR,aAAa,IACzB,6BAAC,eAAD;AAAM,IAAA,aAAa,EAAES,UAArB;AAA2B,IAAA,IAAI,EAAER,IAAjC;AAAuC,IAAA,OAAO,EAAEF;AAAhD,IADF;;AAGA,QAAM;AAAEW,IA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ourcesContent":["import {\n FontStackType,\n FontWeightType,\n Hint,\n InputContainerProps,\n InputElementProps,\n useInputFocus,\n} from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\nimport { View } from 'react-native';\nimport { Text } from '../Text';\nimport { StyledInputContainer, StyledNativeInput } from './styled';\n\nexport interface InputNativeProps\n extends Omit<InputElementProps, 'style'>,\n InputContainerProps {\n inputFontStack?: FontStackType;\n inputFontWeight?: FontWeightType;\n}\n\nconst Input: FC<InputNativeProps> = React.forwardRef(\n (\n {\n label,\n labelColor,\n labelColorVariant,\n labelColorTone,\n labelTypography,\n labelStack,\n labelWeight,\n leftComponent,\n rightComponent,\n disabled,\n style,\n borderColor,\n borderColorGradation,\n inputFontStack = 'default',\n inputFontWeight = 'bold',\n inputContainerStyle,\n variant = 'default',\n hintComponent,\n hint,\n onFocus,\n onBlur,\n value,\n placeholder,\n ...rest\n },\n ref\n ) => {\n const _hint = hintComponent || (\n <Hint TextComponent={Text} text={hint} variant={variant} />\n );\n const { focused, handleBlur, handleFocus } = useInputFocus(\n onFocus,\n onBlur,\n !disabled\n );\n\n const onlyLabel = label && !placeholder;\n\n return (\n <View style={style}>\n <StyledInputContainer\n label={value ? label : undefined}\n labelColor={labelColor}\n labelColorVariant={labelColorVariant}\n labelColorTone={labelColorTone}\n labelTypography={labelTypography}\n labelStack={labelStack}\n labelWeight={labelWeight}\n LabelComponent={Text}\n leftComponent={leftComponent}\n rightComponent={rightComponent}\n borderColor={borderColor}\n borderColorGradation={borderColorGradation}\n inputContainerStyle={inputContainerStyle}\n focused={focused}\n disabled={disabled}\n variant={variant}\n >\n <StyledNativeInput\n {...rest}\n placeholder={onlyLabel ? label : placeholder}\n value={value}\n ref={ref}\n fontStack={inputFontStack}\n fontWeight={inputFontWeight}\n disabled={disabled}\n onFocus={handleFocus}\n onBlur={handleBlur}\n />\n </StyledInputContainer>\n {hint && _hint}\n </View>\n );\n }\n);\n\nInput.displayName = 'Input';\n\nexport default Input;\n"],"file":"Input.js"}
@@ -39,6 +39,8 @@ const InputMask = _react.default.forwardRef(({
39
39
  hint,
40
40
  onFocus,
41
41
  onBlur,
42
+ value,
43
+ placeholder,
42
44
  ...rest
43
45
  }, ref) => {
44
46
  const _hint = hintComponent || _react.default.createElement(_reactCore.Hint, {
@@ -52,10 +54,11 @@ const InputMask = _react.default.forwardRef(({
52
54
  handleBlur,
53
55
  handleFocus
54
56
  } = (0, _reactCore.useInputFocus)(onFocus, onBlur, !disabled);
57
+ const onlyLabel = label && !placeholder;
55
58
  return _react.default.createElement(_reactNative.View, {
56
59
  style: style
57
60
  }, _react.default.createElement(_styled.StyledInputContainer, {
58
- label: label,
61
+ label: String(value) ? label : undefined,
59
62
  labelColor: labelColor,
60
63
  labelColorVariant: labelColorVariant,
61
64
  labelColorTone: labelColorTone,
@@ -72,6 +75,8 @@ const InputMask = _react.default.forwardRef(({
72
75
  disabled: disabled,
73
76
  variant: variant
74
77
  }, _react.default.createElement(_styled.StyledNativeInputMask, _extends({}, rest, {
78
+ placeholder: onlyLabel ? label : placeholder,
79
+ value: value,
75
80
  ref: ref,
76
81
  fontStack: inputFontStack,
77
82
  fontWeight: inputFontWeight,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/InputMask/InputMask.tsx"],"names":["InputMask","React","forwardRef","label","labelColor","labelColorVariant","labelColorTone","labelTypography","labelStack","labelWeight","leftComponent","rightComponent","disabled","style","borderColor","borderColorGradation","inputFontStack","inputFontWeight","inputContainerStyle","variant","hintComponent","hint","onFocus","onBlur","rest","ref","_hint","Text","focused","handleBlur","handleFocus","displayName"],"mappings":";;;;;AAAA;;AAQA;;AACA;;AACA;;AACA;;;;;;AASA,MAAMA,SAAmC,GAAGC,eAAMC,UAAN,CAC1C,CACE;AACEC,EAAAA,KADF;AAEEC,EAAAA,UAFF;AAGEC,EAAAA,iBAHF;AAIEC,EAAAA,cAJF;AAKEC,EAAAA,eALF;AAMEC,EAAAA,UANF;AAOEC,EAAAA,WAPF;AAQEC,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AfZ;AAgBE,IAAA,OAAO,EAAEO;AAhBX,KAkBE,6BAAC,6BAAD,eACMK,IADN;AAEE,IAAA,GAAG,EAAEC,GAFP;AAGE,IAAA,SAAS,EAAET,cAHb;AAIE,IAAA,UAAU,EAAEC,eAJd;AAKE,IAAA,QAAQ,EAAEL,QALZ;AAME,IAAA,OAAO,EAAEkB,WANX;AAOE,IAAA,MAAM,EAAED;AAPV,KAlBF,CADF,EA6BGR,IAAI,IAAIK,KA7BX,CADF;AAiCD,CAtEyC,CAA5C;;AAyEA1B,SAAS,CAAC+B,WAAV,GAAwB,WAAxB;eAEe/B,S","sourcesContent":["import {\n FontStackType,\n FontWeightType,\n Hint,\n InputContainerProps,\n InputMaskElementProps,\n useInputFocus,\n} from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\nimport { View } from 'react-native';\nimport { StyledInputContainer, StyledNativeInputMask } from './styled';\nimport { Text } from '../Text';\n\nexport interface InputMaskNativeProps\n extends Omit<InputMaskElementProps, 'style'>,\n InputContainerProps {\n inputFontStack?: FontStackType;\n inputFontWeight?: FontWeightType;\n}\n\nconst InputMask: FC<InputMaskNativeProps> = React.forwardRef(\n (\n {\n label,\n labelColor,\n labelColorVariant,\n labelColorTone,\n labelTypography,\n labelStack,\n labelWeight,\n leftComponent,\n rightComponent,\n disabled,\n style,\n borderColor,\n borderColorGradation,\n inputFontStack = 'default',\n inputFontWeight = 'bold',\n inputContainerStyle,\n variant = 'default',\n hintComponent,\n hint,\n onFocus,\n onBlur,\n ...rest\n },\n ref\n ) => {\n const _hint = hintComponent || (\n <Hint TextComponent={Text} text={hint} variant={variant} />\n );\n const { focused, handleBlur, handleFocus } = useInputFocus(\n onFocus,\n onBlur,\n !disabled\n );\n\n return (\n <View style={style}>\n <StyledInputContainer\n label={label}\n labelColor={labelColor}\n labelColorVariant={labelColorVariant}\n labelColorTone={labelColorTone}\n labelTypography={labelTypography}\n labelStack={labelStack}\n labelWeight={labelWeight}\n LabelComponent={Text}\n leftComponent={leftComponent}\n rightComponent={rightComponent}\n borderColor={borderColor}\n borderColorGradation={borderColorGradation}\n inputContainerStyle={inputContainerStyle}\n focused={focused}\n disabled={disabled}\n variant={variant}\n >\n <StyledNativeInputMask\n {...rest}\n ref={ref}\n fontStack={inputFontStack}\n fontWeight={inputFontWeight}\n disabled={disabled}\n onFocus={handleFocus}\n onBlur={handleBlur}\n />\n </StyledInputContainer>\n {hint && _hint}\n </View>\n );\n }\n);\n\nInputMask.displayName = 'InputMask';\n\nexport default InputMask;\n"],"file":"InputMask.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/InputMask/InputMask.tsx"],"names":["InputMask","React","forwardRef","label","labelColor","labelColorVariant","labelColorTone","labelTypography","labelStack","labelWeight","leftComponent","rightComponent","disabled","style","borderColor","borderColorGradation","inputFontStack","inputFontWeight","inputContainerStyle","variant","hintComponent","hint","onFocus","onBlur","value","placeholder","rest","ref","_hint","Text","focused","handleBlur","handleFocus","onlyLabel","String","undefined","displayName"],"mappings":";;;;;AAAA;;AAQA;;AACA;;AACA;;AACA;;;;;;AASA,MAAMA,SAAmC,GAAGC,eAAMC,UAAN,CAC1C,CACE;AACEC,EAAAA,KADF;AAEEC,EAAAA,UAFF;AAGEC,EAAAA,iBAHF;AAIEC,EAAAA,cAJF;AAKEC,EAAAA,eALF;AAMEC,EAAAA,UANF;AAOEC,EAAAA,WAPF;AAQEC,EAAAA,aARF;AASEC,EAAAA,cATF;AAUEC,EAAAA,QAVF;AAWEC,EAAAA,KAXF;AAYEC,EAAAA,WAZF;AAaEC,EAAAA,oBAbF;AAcEC,EAAAA,cAAc,GAAG,SAdnB;AAeEC,EAAAA,eAAe,GAAG,MAfpB;AAgBEC,EAAAA,mBAhBF;AAiBEC,EAAAA,OAAO,GAAG,SAjBZ;AAkBEC,EAAAA,aAlBF;AAmBEC,EAAAA,IAnBF;AAoBEC,EAAAA,OApBF;AAqBEC,EAAAA,MArBF;AAsBEC,EAAAA,KAtBF;AAuBEC,EAAAA,WAvB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,cALb;AAME,IAAA,UAAU,EAAEC,eANd;AAOE,IAAA,QAAQ,EAAEL,QAPZ;AAQE,IAAA,OAAO,EAAEoB,WARX;AASE,IAAA,MAAM,EAAED;AATV,KAlBF,CADF,EA+BGV,IAAI,IAAIO,KA/BX,CADF;AAmCD,CA5EyC,CAA5C;;AA+EA5B,SAAS,CAACoC,WAAV,GAAwB,WAAxB;eAEepC,S","sourcesContent":["import {\n FontStackType,\n FontWeightType,\n Hint,\n InputContainerProps,\n InputMaskElementProps,\n useInputFocus,\n} from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\nimport { View } from 'react-native';\nimport { StyledInputContainer, StyledNativeInputMask } from './styled';\nimport { Text } from '../Text';\n\nexport interface InputMaskNativeProps\n extends Omit<InputMaskElementProps, 'style'>,\n InputContainerProps {\n inputFontStack?: FontStackType;\n inputFontWeight?: FontWeightType;\n}\n\nconst InputMask: FC<InputMaskNativeProps> = React.forwardRef(\n (\n {\n label,\n labelColor,\n labelColorVariant,\n labelColorTone,\n labelTypography,\n labelStack,\n labelWeight,\n leftComponent,\n rightComponent,\n disabled,\n style,\n borderColor,\n borderColorGradation,\n inputFontStack = 'default',\n inputFontWeight = 'bold',\n inputContainerStyle,\n variant = 'default',\n hintComponent,\n hint,\n onFocus,\n onBlur,\n value,\n placeholder,\n ...rest\n },\n ref\n ) => {\n const _hint = hintComponent || (\n <Hint TextComponent={Text} text={hint} variant={variant} />\n );\n const { focused, handleBlur, handleFocus } = useInputFocus(\n onFocus,\n onBlur,\n !disabled\n );\n\n const onlyLabel = label && !placeholder;\n\n return (\n <View style={style}>\n <StyledInputContainer\n label={String(value) ? label : undefined}\n labelColor={labelColor}\n labelColorVariant={labelColorVariant}\n labelColorTone={labelColorTone}\n labelTypography={labelTypography}\n labelStack={labelStack}\n labelWeight={labelWeight}\n LabelComponent={Text}\n leftComponent={leftComponent}\n rightComponent={rightComponent}\n borderColor={borderColor}\n borderColorGradation={borderColorGradation}\n inputContainerStyle={inputContainerStyle}\n focused={focused}\n disabled={disabled}\n variant={variant}\n >\n <StyledNativeInputMask\n {...rest}\n placeholder={onlyLabel ? label : placeholder}\n value={value}\n ref={ref}\n fontStack={inputFontStack}\n fontWeight={inputFontWeight}\n disabled={disabled}\n onFocus={handleFocus}\n onBlur={handleBlur}\n />\n </StyledInputContainer>\n {hint && _hint}\n </View>\n );\n }\n);\n\nInputMask.displayName = 'InputMask';\n\nexport default InputMask;\n"],"file":"InputMask.js"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tecsinapse/react-native-kit",
3
3
  "description": "TecSinapse React Native components",
4
- "version": "1.17.0",
4
+ "version": "1.17.3",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "MIT",
@@ -13,7 +13,7 @@
13
13
  "dependencies": {
14
14
  "@emotion/native": "^11.0.0",
15
15
  "@emotion/react": "^11.4.1",
16
- "@tecsinapse/react-core": "^1.16.0",
16
+ "@tecsinapse/react-core": "^1.16.1",
17
17
  "react-native-linear-gradient": "^2.5.6"
18
18
  },
19
19
  "repository": {
@@ -36,5 +36,5 @@
36
36
  "devDependencies": {
37
37
  "@types/uuid": "^8.3.3"
38
38
  },
39
- "gitHead": "ae6f88727b5e35210ada1c7ea0b54d24094af22c"
39
+ "gitHead": "f4d635a35883748ec2594557606c00e2822a1ad6"
40
40
  }
@@ -42,6 +42,8 @@ const Input: FC<InputNativeProps> = React.forwardRef(
42
42
  hint,
43
43
  onFocus,
44
44
  onBlur,
45
+ value,
46
+ placeholder,
45
47
  ...rest
46
48
  },
47
49
  ref
@@ -55,10 +57,12 @@ const Input: FC<InputNativeProps> = React.forwardRef(
55
57
  !disabled
56
58
  );
57
59
 
60
+ const onlyLabel = label && !placeholder;
61
+
58
62
  return (
59
63
  <View style={style}>
60
64
  <StyledInputContainer
61
- label={label}
65
+ label={value ? label : undefined}
62
66
  labelColor={labelColor}
63
67
  labelColorVariant={labelColorVariant}
64
68
  labelColorTone={labelColorTone}
@@ -77,6 +81,8 @@ const Input: FC<InputNativeProps> = React.forwardRef(
77
81
  >
78
82
  <StyledNativeInput
79
83
  {...rest}
84
+ placeholder={onlyLabel ? label : placeholder}
85
+ value={value}
80
86
  ref={ref}
81
87
  fontStack={inputFontStack}
82
88
  fontWeight={inputFontWeight}
@@ -42,6 +42,8 @@ const InputMask: FC<InputMaskNativeProps> = React.forwardRef(
42
42
  hint,
43
43
  onFocus,
44
44
  onBlur,
45
+ value,
46
+ placeholder,
45
47
  ...rest
46
48
  },
47
49
  ref
@@ -55,10 +57,12 @@ const InputMask: FC<InputMaskNativeProps> = React.forwardRef(
55
57
  !disabled
56
58
  );
57
59
 
60
+ const onlyLabel = label && !placeholder;
61
+
58
62
  return (
59
63
  <View style={style}>
60
64
  <StyledInputContainer
61
- label={label}
65
+ label={String(value) ? label : undefined}
62
66
  labelColor={labelColor}
63
67
  labelColorVariant={labelColorVariant}
64
68
  labelColorTone={labelColorTone}
@@ -77,6 +81,8 @@ const InputMask: FC<InputMaskNativeProps> = React.forwardRef(
77
81
  >
78
82
  <StyledNativeInputMask
79
83
  {...rest}
84
+ placeholder={onlyLabel ? label : placeholder}
85
+ value={value}
80
86
  ref={ref}
81
87
  fontStack={inputFontStack}
82
88
  fontWeight={inputFontWeight}