@tecsinapse/react-web-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-web-kit@1.17.2...@tecsinapse/react-web-kit@1.17.3) (2022-05-24)
7
+
8
+ **Note:** Version bump only for package @tecsinapse/react-web-kit
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.17.2](https://github.com/tecsinapse/design-system/compare/@tecsinapse/react-web-kit@1.17.1...@tecsinapse/react-web-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-web-kit@1.17.0...@tecsinapse/react-web-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-web-kit@1.16.1...@tecsinapse/react-web-kit@1.17.0) (2022-05-10)
7
37
 
8
38
 
@@ -37,6 +37,8 @@ const Input = _react.default.forwardRef(({
37
37
  hint,
38
38
  onFocus,
39
39
  onBlur,
40
+ placeholder,
41
+ value,
40
42
  ...rest
41
43
  }, ref) => {
42
44
  const _hint = hintComponent || _react.default.createElement(_reactCore.Hint, {
@@ -49,10 +51,11 @@ const Input = _react.default.forwardRef(({
49
51
  handleBlur,
50
52
  handleFocus
51
53
  } = (0, _reactCore.useInputFocus)(onFocus, onBlur, !disabled);
54
+ const onlyLabel = label && !placeholder;
52
55
  return _react.default.createElement(_reactNativeWeb.View, {
53
56
  style: style
54
57
  }, _react.default.createElement(_reactCore.InputContainer, {
55
- label: label,
58
+ label: value ? label : undefined,
56
59
  labelColor: labelColor,
57
60
  labelColorVariant: labelColorVariant,
58
61
  labelColorTone: labelColorTone,
@@ -68,6 +71,8 @@ const Input = _react.default.forwardRef(({
68
71
  disabled: disabled,
69
72
  variant: variant
70
73
  }, _react.default.createElement(_styled.StyledWebTextInput, _extends({}, rest, {
74
+ placeholder: onlyLabel ? label : placeholder,
75
+ value: value,
71
76
  ref: ref,
72
77
  disabled: disabled,
73
78
  onFocus: handleFocus,
@@ -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","inputContainerStyle","variant","hintComponent","hint","onFocus","onBlur","rest","ref","_hint","focused","handleBlur","handleFocus","displayName"],"mappings":";;;;;;;AAAA;;AAOA;;AACA;;AACA;;;;;;AAMA,MAAMA,KAAwB,GAAGC,eAAMC,UAAN,CAC/B,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,mBAdF;AAeEC,EAAAA,OAAO,GAAG,SAfZ;AAgBEC,EAAAA,aAhBF;AAiBEC,EAAAA,I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er,\n InputContainerProps,\n InputElementProps,\n useInputFocus,\n} from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\nimport { View } from 'react-native';\nimport { StyledWebTextInput } from './styled';\n\nexport interface InputWebProps\n extends Omit<InputElementProps, 'style'>,\n InputContainerProps {}\n\nconst Input: FC<InputWebProps> = 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 inputContainerStyle,\n variant = 'default',\n hintComponent,\n hint,\n onFocus,\n onBlur,\n ...rest\n },\n ref\n ) => {\n const _hint = hintComponent || <Hint text={hint} variant={variant} />;\n const { focused, handleBlur, handleFocus } = useInputFocus(\n onFocus,\n onBlur,\n !disabled\n );\n\n return (\n <View style={style}>\n <InputContainer\n label={label}\n labelColor={labelColor}\n labelColorVariant={labelColorVariant}\n labelColorTone={labelColorTone}\n labelTypography={labelTypography}\n labelStack={labelStack}\n labelWeight={labelWeight}\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 <StyledWebTextInput\n {...rest}\n ref={ref}\n disabled={disabled}\n onFocus={handleFocus}\n onBlur={handleBlur}\n />\n </InputContainer>\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","inputContainerStyle","variant","hintComponent","hint","onFocus","onBlur","placeholder","value","rest","ref","_hint","focused","handleBlur","handleFocus","onlyLabel","undefined","displayName"],"mappings":";;;;;;;AAAA;;AAOA;;AACA;;AACA;;;;;;AAMA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IAAA,cAAc,EAAEC,cATlB;AAUE,IAAA,WAAW,EAAEG,WAVf;AAWE,IAAA,oBAAoB,EAAEC,oBAXxB;AAYE,IAAA,mBAAmB,EAAEC,mBAZvB;AAaE,IAAA,OAAO,EAAEW,OAbX;AAcE,IAAA,QAAQ,EAAEf,QAdZ;AAeE,IAAA,OAAO,EAAEK;AAfX,KAiBE,6BAAC,0BAAD,eACMO,IADN;AAEE,IAAA,WAAW,EAAEM,SAAS,GAAG3B,KAAH,GAAWmB,WAFnC;AAGE,IAAA,KAAK,EAAEC,KAHT;AAIE,IAAA,GAAG,EAAEE,GAJP;AAKE,IAAA,QAAQ,EAAEb,QALZ;AAME,IAAA,OAAO,EAAEiB,WANX;AAOE,IAAA,MAAM,EAAED;AAPV,KAjBF,CADF,EA4BGT,IAAI,IAAIO,KA5BX,CADF;AAgCD,CArE8B,CAAjC;;AAwEA1B,KAAK,CAACgC,WAAN,GAAoB,OAApB;eAEehC,K","sourcesContent":["import {\n Hint,\n InputContainer,\n InputContainerProps,\n InputElementProps,\n useInputFocus,\n} from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\nimport { View } from 'react-native';\nimport { StyledWebTextInput } from './styled';\n\nexport interface InputWebProps\n extends Omit<InputElementProps, 'style'>,\n InputContainerProps {}\n\nconst Input: FC<InputWebProps> = 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 inputContainerStyle,\n variant = 'default',\n hintComponent,\n hint,\n onFocus,\n onBlur,\n placeholder,\n value,\n ...rest\n },\n ref\n ) => {\n const _hint = hintComponent || <Hint text={hint} variant={variant} />;\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 <InputContainer\n label={value ? label : undefined}\n labelColor={labelColor}\n labelColorVariant={labelColorVariant}\n labelColorTone={labelColorTone}\n labelTypography={labelTypography}\n labelStack={labelStack}\n labelWeight={labelWeight}\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 <StyledWebTextInput\n {...rest}\n placeholder={onlyLabel ? label : placeholder}\n value={value}\n ref={ref}\n disabled={disabled}\n onFocus={handleFocus}\n onBlur={handleBlur}\n />\n </InputContainer>\n {hint && _hint}\n </View>\n );\n }\n);\n\nInput.displayName = 'Input';\n\nexport default Input;\n"],"file":"Input.js"}
@@ -37,6 +37,8 @@ const InputMask = _react.default.forwardRef(({
37
37
  hint,
38
38
  onFocus,
39
39
  onBlur,
40
+ value,
41
+ placeholder,
40
42
  ...rest
41
43
  }, ref) => {
42
44
  const _hint = hintComponent || _react.default.createElement(_reactCore.Hint, {
@@ -49,10 +51,11 @@ const InputMask = _react.default.forwardRef(({
49
51
  handleBlur,
50
52
  handleFocus
51
53
  } = (0, _reactCore.useInputFocus)(onFocus, onBlur, !disabled);
54
+ const onlyLabel = label && !placeholder;
52
55
  return _react.default.createElement(_reactNativeWeb.View, {
53
56
  style: style
54
57
  }, _react.default.createElement(_reactCore.InputContainer, {
55
- label: label,
58
+ label: String(value) ? label : undefined,
56
59
  labelColor: labelColor,
57
60
  labelColorVariant: labelColorVariant,
58
61
  labelColorTone: labelColorTone,
@@ -68,6 +71,8 @@ const InputMask = _react.default.forwardRef(({
68
71
  disabled: disabled,
69
72
  variant: variant
70
73
  }, _react.default.createElement(_styled.StyledWebTextInputMask, _extends({}, rest, {
74
+ placeholder: onlyLabel ? label : placeholder,
75
+ value: value,
71
76
  ref: ref,
72
77
  disabled: disabled,
73
78
  onFocus: handleFocus,
@@ -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","inputContainerStyle","variant","hintComponent","hint","onFocus","onBlur","rest","ref","_hint","focused","handleBlur","handleFocus","displayName"],"mappings":";;;;;;;AAAA;;AAOA;;AACA;;AACA;;;;;;AAMA,MAAMA,SAAgC,GAAGC,eAAMC,UAAN,CACvC,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,mBAdF;AAeEC,EAAAA,OAAO,GAAG,SAfZ;AAgBEC,EAAAA,aAhBF;AAiBEC,EAAAA,IAjBF;AAkBEC,EAAAA,OAlBF;AAmBEC,EAAAA,MAnBF;AAoBE,KAAGC;AApBL,CADF,EAuBEC,GAvBF,KAwBK;AACH,QAAMC,KAAK,GAAGN,aAAa,IAAI,6BAAC,eAAD;AAAM,IAAA,IAAI,EAAEC,IAAZ;AAAkB,IAAA,OAAO,EAAEF;AAA3B,IAA/B;;AACA,QAAM;AAAEQ,IAAAA,OAAF;AAAWC,IAAAA,UAAX;AAAuBC,IAAAA;AAAvB,MAAuC,8BAC3CP,OAD2C,EAE3CC,MAF2C,EAG3C,CAACT,QAH0C,CAA7C;AAMA,SACE,6BAAC,oBAAD;AAAM,IAAA,KAAK,EAAEC;AAAb,KACE,6BAAC,yBAAD;AACE,IAAA,KAAK,EAAEV,KADT;AAEE,IAAA,UAAU,EAAEC,UAFd;AAGE,IAAA,iBAAiB,EAAEC,iBAHrB;AAIE,IAAA,cAAc,EAAEC,cAJlB;AAKE,IAAA,eAAe,EAAEC,eALnB;AAME,IAAA,UAAU,EAAEC,UANd;AAOE,IAAA,WAAW,EAAEC,WAPf;AAQE,IAAA,aAAa,EAAEC,aARjB;AASE,IAAA,cAAc,EAAEC,cATlB;AAUE,IAAA,WAAW,EAAEG,WAVf;AAWE,IAAA,oBAAoB,EAAEC,oBAXxB;AAYE,IAAA,mBAAmB,EAAEC,mBAZvB;AAaE,IAAA,OAAO,EAAES,OAbX;AAcE,IAAA,QAAQ,EAAEb,QAdZ;AAeE,IAAA,OAAO,EAAEK;AAfX,KAiBE,6BAAC,8BAAD,eACMK,IADN;AAEE,IAAA,GAAG,EAAEC,GAFP;AAGE,IAAA,QAAQ,EAAEX,QAHZ;AAIE,IAAA,OAAO,EAAEe,WAJX;AAKE,IAAA,MAAM,EAAED;AALV,KAjBF,CADF,EA0BGP,IAAI,IAAIK,KA1BX,CADF;AA8BD,CA/DsC,CAAzC;;AAkEAxB,SAAS,CAAC4B,WAAV,GAAwB,WAAxB;eAEe5B,S","sourcesContent":["import {\n Hint,\n InputContainer,\n InputContainerProps,\n InputMaskElementProps,\n useInputFocus,\n} from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\nimport { View } from 'react-native';\nimport { StyledWebTextInputMask } from './styled';\n\nexport interface InputMaskWebProps\n extends Omit<InputMaskElementProps, 'style'>,\n InputContainerProps {}\n\nconst InputMask: FC<InputMaskWebProps> = 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 inputContainerStyle,\n variant = 'default',\n hintComponent,\n hint,\n onFocus,\n onBlur,\n ...rest\n },\n ref\n ) => {\n const _hint = hintComponent || <Hint text={hint} variant={variant} />;\n const { focused, handleBlur, handleFocus } = useInputFocus(\n onFocus,\n onBlur,\n !disabled\n );\n\n return (\n <View style={style}>\n <InputContainer\n label={label}\n labelColor={labelColor}\n labelColorVariant={labelColorVariant}\n labelColorTone={labelColorTone}\n labelTypography={labelTypography}\n labelStack={labelStack}\n labelWeight={labelWeight}\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 <StyledWebTextInputMask\n {...rest}\n ref={ref}\n disabled={disabled}\n onFocus={handleFocus}\n onBlur={handleBlur}\n />\n </InputContainer>\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","inputContainerStyle","variant","hintComponent","hint","onFocus","onBlur","value","placeholder","rest","ref","_hint","focused","handleBlur","handleFocus","onlyLabel","String","undefined","displayName"],"mappings":";;;;;;;AAAA;;AAOA;;AACA;;AACA;;;;;;AAMA,MAAMA,SAAgC,GAAGC,eAAMC,UAAN,CACvC,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,mBAdF;AAeEC,EAAAA,OAAO,GAAG,SAfZ;AAgBEC,EAAAA,aAhBF;AAiBEC,EAAAA,IAjBF;AAkBEC,EAAAA,OAlBF;AAmBEC,EAAAA,MAnBF;AAoBEC,EAAAA,KApBF;AAqBEC,EAAAA,WArBF;AAsBE,KAAGC;AAtBL,CADF,EAyBEC,GAzBF,KA0BK;AACH,QAAMC,KAAK,GAAGR,aAAa,IAAI,6BAAC,eAAD;AAAM,IA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B;eAEejC,S","sourcesContent":["import {\n Hint,\n InputContainer,\n InputContainerProps,\n InputMaskElementProps,\n useInputFocus,\n} from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\nimport { View } from 'react-native';\nimport { StyledWebTextInputMask } from './styled';\n\nexport interface InputMaskWebProps\n extends Omit<InputMaskElementProps, 'style'>,\n InputContainerProps {}\n\nconst InputMask: FC<InputMaskWebProps> = 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 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 || <Hint text={hint} variant={variant} />;\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 <InputContainer\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 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 <StyledWebTextInputMask\n {...rest}\n placeholder={onlyLabel ? label : placeholder}\n value={value}\n ref={ref}\n disabled={disabled}\n onFocus={handleFocus}\n onBlur={handleBlur}\n />\n </InputContainer>\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-web-kit",
3
3
  "description": "TecSinapse React 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",
@@ -14,7 +14,7 @@
14
14
  "@emotion/native": "^11.0.0",
15
15
  "@emotion/react": "^11.4.1",
16
16
  "@emotion/styled": "^11.3.0",
17
- "@tecsinapse/react-core": "^1.16.0",
17
+ "@tecsinapse/react-core": "^1.16.1",
18
18
  "@types/react-native": "^0.64.4",
19
19
  "react-native-vector-icons": "^9.1.0",
20
20
  "react-transition-group": "^4.4.2"
@@ -33,5 +33,5 @@
33
33
  "react-dom": "^16.8.0 || ^17.0.0",
34
34
  "react-native-web": "^0.17.1"
35
35
  },
36
- "gitHead": "ae6f88727b5e35210ada1c7ea0b54d24094af22c"
36
+ "gitHead": "f4d635a35883748ec2594557606c00e2822a1ad6"
37
37
  }
@@ -35,6 +35,8 @@ const Input: FC<InputWebProps> = React.forwardRef(
35
35
  hint,
36
36
  onFocus,
37
37
  onBlur,
38
+ placeholder,
39
+ value,
38
40
  ...rest
39
41
  },
40
42
  ref
@@ -46,10 +48,12 @@ const Input: FC<InputWebProps> = React.forwardRef(
46
48
  !disabled
47
49
  );
48
50
 
51
+ const onlyLabel = label && !placeholder;
52
+
49
53
  return (
50
54
  <View style={style}>
51
55
  <InputContainer
52
- label={label}
56
+ label={value ? label : undefined}
53
57
  labelColor={labelColor}
54
58
  labelColorVariant={labelColorVariant}
55
59
  labelColorTone={labelColorTone}
@@ -67,6 +71,8 @@ const Input: FC<InputWebProps> = React.forwardRef(
67
71
  >
68
72
  <StyledWebTextInput
69
73
  {...rest}
74
+ placeholder={onlyLabel ? label : placeholder}
75
+ value={value}
70
76
  ref={ref}
71
77
  disabled={disabled}
72
78
  onFocus={handleFocus}
@@ -35,6 +35,8 @@ const InputMask: FC<InputMaskWebProps> = React.forwardRef(
35
35
  hint,
36
36
  onFocus,
37
37
  onBlur,
38
+ value,
39
+ placeholder,
38
40
  ...rest
39
41
  },
40
42
  ref
@@ -46,10 +48,12 @@ const InputMask: FC<InputMaskWebProps> = React.forwardRef(
46
48
  !disabled
47
49
  );
48
50
 
51
+ const onlyLabel = label && !placeholder;
52
+
49
53
  return (
50
54
  <View style={style}>
51
55
  <InputContainer
52
- label={label}
56
+ label={String(value) ? label : undefined}
53
57
  labelColor={labelColor}
54
58
  labelColorVariant={labelColorVariant}
55
59
  labelColorTone={labelColorTone}
@@ -67,6 +71,8 @@ const InputMask: FC<InputMaskWebProps> = React.forwardRef(
67
71
  >
68
72
  <StyledWebTextInputMask
69
73
  {...rest}
74
+ placeholder={onlyLabel ? label : placeholder}
75
+ value={value}
70
76
  ref={ref}
71
77
  disabled={disabled}
72
78
  onFocus={handleFocus}