@tecsinapse/react-web-kit 1.16.1 → 1.17.2

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/components/atoms/Input/Input.js +6 -1
  3. package/dist/components/atoms/Input/Input.js.map +1 -1
  4. package/dist/components/atoms/InputMask/InputMask.d.ts +6 -0
  5. package/dist/components/atoms/InputMask/InputMask.js +86 -0
  6. package/dist/components/atoms/InputMask/InputMask.js.map +1 -0
  7. package/dist/components/atoms/InputMask/index.d.ts +1 -0
  8. package/dist/components/atoms/InputMask/index.js +24 -0
  9. package/dist/components/atoms/InputMask/index.js.map +1 -0
  10. package/dist/components/atoms/InputMask/styled.d.ts +4 -0
  11. package/dist/components/atoms/InputMask/styled.js +20 -0
  12. package/dist/components/atoms/InputMask/styled.js.map +1 -0
  13. package/dist/components/atoms/Skeleton/Skeleton.d.ts +1 -0
  14. package/dist/components/atoms/Skeleton/Skeleton.js +10 -1
  15. package/dist/components/atoms/Skeleton/Skeleton.js.map +1 -1
  16. package/dist/components/atoms/Skeleton/styled.js +7 -5
  17. package/dist/components/atoms/Skeleton/styled.js.map +1 -1
  18. package/dist/components/molecules/DatePicker/DatePicker.js.map +1 -1
  19. package/dist/index.d.ts +3 -2
  20. package/dist/index.js +16 -0
  21. package/dist/index.js.map +1 -1
  22. package/package.json +3 -3
  23. package/src/components/atoms/Input/Input.stories.tsx +0 -71
  24. package/src/components/atoms/Input/Input.tsx +7 -1
  25. package/src/components/atoms/InputMask/InputMask.stories.tsx +80 -0
  26. package/src/components/atoms/InputMask/InputMask.tsx +90 -0
  27. package/src/components/atoms/InputMask/index.ts +1 -0
  28. package/src/components/atoms/InputMask/styled.ts +10 -0
  29. package/src/components/atoms/Skeleton/Skeleton.stories.tsx +23 -0
  30. package/src/components/atoms/Skeleton/Skeleton.tsx +10 -1
  31. package/src/components/atoms/Skeleton/styled.ts +7 -3
  32. package/src/components/molecules/DatePicker/DatePicker.tsx +1 -1
  33. package/src/index.ts +9 -2
package/CHANGELOG.md CHANGED
@@ -3,6 +3,40 @@
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.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)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * error render, added ternary ([#163902](https://github.com/tecsinapse/design-system/issues/163902)) ([fd52d5c](https://github.com/tecsinapse/design-system/commit/fd52d5cfe7ca7f56c0b721ad17d8bac589295bf5))
12
+
13
+
14
+
15
+
16
+
17
+ ## [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)
18
+
19
+
20
+ ### Features
21
+
22
+ * standardizing input label and placeholder ([#163902](https://github.com/tecsinapse/design-system/issues/163902)) ([225a57b](https://github.com/tecsinapse/design-system/commit/225a57b8c5f8b6a7ae1058a56590a3f0dd294d55))
23
+
24
+
25
+
26
+
27
+
28
+ # [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)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * inputMask accepting undefined. ([6037162](https://github.com/tecsinapse/design-system/commit/6037162a564c118c8faed8359418ff7eda6d1645))
34
+ * wrong storybook title ([c421df4](https://github.com/tecsinapse/design-system/commit/c421df46fec3d8c9119af9ca70c4efad693921dd))
35
+
36
+
37
+
38
+
39
+
6
40
  ## [1.16.1](https://github.com/tecsinapse/design-system/compare/@tecsinapse/react-web-kit@1.16.0...@tecsinapse/react-web-kit@1.16.1) (2022-04-01)
7
41
 
8
42
 
@@ -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,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,0BAAD,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/D8B,CAAjC;;AAkEAxB,KAAK,CAAC4B,WAAN,GAAoB,OAApB;eAEe5B,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 ...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,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,IAjBF;AAkBEC,EAAAA,OAlBF;AAmBEC,EAAAA,MAnBF;AAoBEC,EAAAA,WApBF;AAqBEC,EAAAA,KArBF;AAsBE,KAAGC;AAtBL,CADF,EAyBEC,GAzBF,KA0BK;AACH,QAAMC,KAAK,GAAGR,aAAa,IAAI,6BAAC,eAAD;AAAM,IAAA,IAAI,EAAEC,IAAZ;AAAkB,IAAA,OAAO,EAAEF;AAA3B,IAA/B;;AACA,QAAM;AAAEU,IAAAA,OAAF;AAAWC,IAAAA,UAAX;AAAuBC,IAAAA;AAAvB,MAAuC,8BAC3CT,OAD2C,EAE3CC,MAF2C,EAG3C,CAACT,QAH0C,CAA7C;AAMA,QAAMkB,SAAS,GAAG3B,KAAK,IAAI,CAACmB,WAA5B;AAEA,SACE,6BAAC,oBAAD;AAAM,IAAA,KAAK,EAAET;AAAb,KACE,6BAAC,yBAAD;AACE,IAAA,KAAK,EAAEU,KAAK,GAAGpB,KAAH,GAAW4B,SADzB;AAEE,IAAA,UAAU,EAAE3B,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,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"}
@@ -0,0 +1,6 @@
1
+ import { InputContainerProps, InputMaskElementProps } from '@tecsinapse/react-core';
2
+ import { FC } from 'react';
3
+ export interface InputMaskWebProps extends Omit<InputMaskElementProps, 'style'>, InputContainerProps {
4
+ }
5
+ declare const InputMask: FC<InputMaskWebProps>;
6
+ export default InputMask;
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _reactCore = require("@tecsinapse/react-core");
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ var _reactNativeWeb = require("react-native-web");
13
+
14
+ var _styled = require("./styled");
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
18
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
19
+
20
+ const InputMask = _react.default.forwardRef(({
21
+ label,
22
+ labelColor,
23
+ labelColorVariant,
24
+ labelColorTone,
25
+ labelTypography,
26
+ labelStack,
27
+ labelWeight,
28
+ leftComponent,
29
+ rightComponent,
30
+ disabled,
31
+ style,
32
+ borderColor,
33
+ borderColorGradation,
34
+ inputContainerStyle,
35
+ variant = 'default',
36
+ hintComponent,
37
+ hint,
38
+ onFocus,
39
+ onBlur,
40
+ value,
41
+ placeholder,
42
+ ...rest
43
+ }, ref) => {
44
+ const _hint = hintComponent || _react.default.createElement(_reactCore.Hint, {
45
+ text: hint,
46
+ variant: variant
47
+ });
48
+
49
+ const {
50
+ focused,
51
+ handleBlur,
52
+ handleFocus
53
+ } = (0, _reactCore.useInputFocus)(onFocus, onBlur, !disabled);
54
+ const onlyLabel = label && !placeholder;
55
+ return _react.default.createElement(_reactNativeWeb.View, {
56
+ style: style
57
+ }, _react.default.createElement(_reactCore.InputContainer, {
58
+ label: String(value) ? label : undefined,
59
+ labelColor: labelColor,
60
+ labelColorVariant: labelColorVariant,
61
+ labelColorTone: labelColorTone,
62
+ labelTypography: labelTypography,
63
+ labelStack: labelStack,
64
+ labelWeight: labelWeight,
65
+ leftComponent: leftComponent,
66
+ rightComponent: rightComponent,
67
+ borderColor: borderColor,
68
+ borderColorGradation: borderColorGradation,
69
+ inputContainerStyle: inputContainerStyle,
70
+ focused: focused,
71
+ disabled: disabled,
72
+ variant: variant
73
+ }, _react.default.createElement(_styled.StyledWebTextInputMask, _extends({}, rest, {
74
+ placeholder: onlyLabel ? label : placeholder,
75
+ value: value,
76
+ ref: ref,
77
+ disabled: disabled,
78
+ onFocus: handleFocus,
79
+ onBlur: handleBlur
80
+ }))), hint && _hint);
81
+ });
82
+
83
+ InputMask.displayName = 'InputMask';
84
+ var _default = InputMask;
85
+ exports.default = _default;
86
+ //# sourceMappingURL=InputMask.js.map
@@ -0,0 +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","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,IAAA,IAAI,EAAEC,IAAZ;AAAkB,IAAA,OAAO,EAAEF;AAA3B,IAA/B;;AACA,QAAM;AAAEU,IAAAA,OAAF;AAAWC,IAAAA,UAAX;AAAuBC,IAAAA;AAAvB,MAAuC,8BAC3CT,OAD2C,EAE3CC,MAF2C,EAG3C,CAACT,QAH0C,CAA7C;AAMA,QAAMkB,SAAS,GAAG3B,KAAK,IAAI,CAACoB,WAA5B;AAEA,SACE,6BAAC,oBAAD;AAAM,IAAA,KAAK,EAAEV;AAAb,KACE,6BAAC,yBAAD;AACE,IAAA,KAAK,EAAEkB,MAAM,CAACT,KAAD,CAAN,GAAgBnB,KAAhB,GAAwB6B,SADjC;AAEE,IAAA,UAAU,EAAE5B,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,EAAEW,OAbX;AAcE,IAAA,QAAQ,EAAEf,QAdZ;AAeE,IAAA,OAAO,EAAEK;AAfX,KAiBE,6BAAC,8BAAD,eACMO,IADN;AAEE,IAAA,WAAW,EAAEM,SAAS,GAAG3B,KAAH,GAAWoB,WAFnC;AAGE,IAAA,KAAK,EAAED,KAHT;AAIE,IAAA,GAAG,EAAEG,GAJP;AAKE,IAAA,QAAQ,EAAEb,QALZ;AAME,IAAA,OAAO,EAAEiB,WANX;AAOE,IAAA,MAAM,EAAED;AAPV,KAjBF,CADF,EA4BGT,IAAI,IAAIO,KA5BX,CADF;AAgCD,CArEsC,CAAzC;;AAwEA1B,SAAS,CAACiC,WAAV,GAAwB,WAAxB;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"}
@@ -0,0 +1 @@
1
+ export { default as InputMask, InputMaskWebProps } from './InputMask';
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "InputMask", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _InputMask.default;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "InputMaskWebProps", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _InputMask.InputMaskWebProps;
16
+ }
17
+ });
18
+
19
+ var _InputMask = _interopRequireWildcard(require("./InputMask"));
20
+
21
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
22
+
23
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/atoms/InputMask/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA","sourcesContent":["export { default as InputMask, InputMaskWebProps } from './InputMask';\n"],"file":"index.js"}
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledWebTextInputMask: import("@emotion/native").StyledComponent<any, {}, {
3
+ ref?: import("react").Ref<any> | undefined;
4
+ }>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledWebTextInputMask = void 0;
7
+
8
+ var _native = _interopRequireDefault(require("@emotion/native"));
9
+
10
+ var _reactCore = require("@tecsinapse/react-core");
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ const StyledWebTextInputMask = (0, _native.default)(_reactCore.InputMaskElement)`
15
+ &:focus-visible {
16
+ outline-width: 0;
17
+ }
18
+ `;
19
+ exports.StyledWebTextInputMask = StyledWebTextInputMask;
20
+ //# sourceMappingURL=styled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/atoms/InputMask/styled.ts"],"names":["StyledWebTextInputMask","InputMaskElement"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEO,MAAMA,sBAAsB,GAAG,qBAAOC,2BAAP,CAEpC;AACF;AACA;AACA;AACA,CANO","sourcesContent":["import styled from '@emotion/native';\nimport { InputMaskElement, StyleProps } from '@tecsinapse/react-core';\n\nexport const StyledWebTextInputMask = styled(InputMaskElement)<\n Partial<StyleProps>\n>`\n &:focus-visible {\n outline-width: 0;\n }\n`;\n"],"file":"styled.js"}
@@ -4,6 +4,7 @@ export interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {
4
4
  width?: number;
5
5
  height?: number;
6
6
  animation?: 'pulse' | 'wave';
7
+ active?: boolean;
7
8
  radius?: BorderRadiusType;
8
9
  }
9
10
  declare const Skeleton: React.FC<SkeletonProps>;
@@ -9,6 +9,8 @@ var _react = _interopRequireDefault(require("react"));
9
9
 
10
10
  var _styled = require("./styled");
11
11
 
12
+ var _reactNativeWeb = require("react-native-web");
13
+
12
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
15
 
14
16
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -18,6 +20,7 @@ const Skeleton = ({
18
20
  width,
19
21
  height,
20
22
  animation = 'wave',
23
+ active = true,
21
24
  radius,
22
25
  ...rest
23
26
  }) => {
@@ -29,8 +32,14 @@ const Skeleton = ({
29
32
  width: width,
30
33
  height: height,
31
34
  animation: animation,
35
+ active: active,
32
36
  radius: radius
33
- }, rest), children);
37
+ }, rest), _react.default.createElement(_reactNativeWeb.View, {
38
+ style: {
39
+ opacity: active ? 0 : 1
40
+ },
41
+ pointerEvents: active ? 'none' : 'auto'
42
+ }, children));
34
43
  };
35
44
 
36
45
  var _default = Skeleton;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Skeleton/Skeleton.tsx"],"names":["Skeleton","children","width","height","animation","radius","rest","Error"],"mappings":";;;;;;;AAAA;;AACA;;;;;;AAUA,MAAMA,QAAiC,GAAG,CAAC;AACzCC,EAAAA,QADyC;AAEzCC,EAAAA,KAFyC;AAGzCC,EAAAA,MAHyC;AAIzCC,EAAAA,SAAS,GAAG,MAJ6B;AAKzCC,EAAAA,MALyC;AAMzC,KAAGC;AANsC,CAAD,KAOpC;AACJ,MAAI,CAACJ,KAAD,IAAU,CAACC,MAAX,IAAqB,CAACF,QAA1B,EAAoC;AAClC,UAAM,IAAIM,KAAJ,CACJ,oEADI,CAAN;AAGD;;AAED,SACE,6BAAC,eAAD;AACE,IAAA,KAAK,EAAEL,KADT;AAEE,IAAA,MAAM,EAAEC,MAFV;AAGE,IAAA,SAAS,EAAEC,SAHb;AAIE,IAAA,MAAM,EAAEC;AAJV,KAKMC,IALN,GAOGL,QAPH,CADF;AAWD,CAzBD;;eA2BeD,Q","sourcesContent":["import React from 'react';\nimport { Wrapper } from './styled';\nimport { BorderRadiusType } from '@tecsinapse/react-core';\n\nexport interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {\n width?: number;\n height?: number;\n animation?: 'pulse' | 'wave';\n radius?: BorderRadiusType;\n}\n\nconst Skeleton: React.FC<SkeletonProps> = ({\n children,\n width,\n height,\n animation = 'wave',\n radius,\n ...rest\n}) => {\n if (!width && !height && !children) {\n throw new Error(\n '[Skeleton] You should provide children or specify width and height'\n );\n }\n\n return (\n <Wrapper\n width={width}\n height={height}\n animation={animation}\n radius={radius}\n {...rest}\n >\n {children}\n </Wrapper>\n );\n};\n\nexport default Skeleton;\n"],"file":"Skeleton.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/Skeleton/Skeleton.tsx"],"names":["Skeleton","children","width","height","animation","active","radius","rest","Error","opacity"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;;;AAUA,MAAMA,QAAiC,GAAG,CAAC;AACzCC,EAAAA,QADyC;AAEzCC,EAAAA,KAFyC;AAGzCC,EAAAA,MAHyC;AAIzCC,EAAAA,SAAS,GAAG,MAJ6B;AAKzCC,EAAAA,MAAM,GAAG,IALgC;AAMzCC,EAAAA,MANyC;AAOzC,KAAGC;AAPsC,CAAD,KAQpC;AACJ,MAAI,CAACL,KAAD,IAAU,CAACC,MAAX,IAAqB,CAACF,QAA1B,EAAoC;AAClC,UAAM,IAAIO,KAAJ,CACJ,oEADI,CAAN;AAGD;;AAED,SACE,6BAAC,eAAD;AACE,IAAA,KAAK,EAAEN,KADT;AAEE,IAAA,MAAM,EAAEC,MAFV;AAGE,IAAA,SAAS,EAAEC,SAHb;AAIE,IAAA,MAAM,EAAEC,MAJV;AAKE,IAAA,MAAM,EAAEC;AALV,KAMMC,IANN,GAQE,6BAAC,oBAAD;AACE,IAAA,KAAK,EAAE;AAAEE,MAAAA,OAAO,EAAEJ,MAAM,GAAG,CAAH,GAAO;AAAxB,KADT;AAEE,IAAA,aAAa,EAAEA,MAAM,GAAG,MAAH,GAAY;AAFnC,KAIGJ,QAJH,CARF,CADF;AAiBD,CAhCD;;eAkCeD,Q","sourcesContent":["import React from 'react';\nimport { Wrapper } from './styled';\nimport { BorderRadiusType } from '@tecsinapse/react-core';\nimport { View } from 'react-native';\n\nexport interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {\n width?: number;\n height?: number;\n animation?: 'pulse' | 'wave';\n active?: boolean;\n radius?: BorderRadiusType;\n}\n\nconst Skeleton: React.FC<SkeletonProps> = ({\n children,\n width,\n height,\n animation = 'wave',\n active = true,\n radius,\n ...rest\n}) => {\n if (!width && !height && !children) {\n throw new Error(\n '[Skeleton] You should provide children or specify width and height'\n );\n }\n\n return (\n <Wrapper\n width={width}\n height={height}\n animation={animation}\n active={active}\n radius={radius}\n {...rest}\n >\n <View\n style={{ opacity: active ? 0 : 1 }}\n pointerEvents={active ? 'none' : 'auto'}\n >\n {children}\n </View>\n </Wrapper>\n );\n};\n\nexport default Skeleton;\n"],"file":"Skeleton.js"}
@@ -16,7 +16,7 @@ const pulseKf = (0, _react.keyframes)`
16
16
  opacity: 1;
17
17
  }
18
18
  50% {
19
- opacity: 0.4;
19
+ opacity: 0.1;
20
20
  }
21
21
  100% {
22
22
  opacity: 1;
@@ -59,8 +59,9 @@ const pulseAnim = (0, _react.css)`
59
59
  const Wrapper = (0, _styled.default)('div')`
60
60
  background-color: ${({
61
61
  theme,
62
- animation
63
- }) => animation === 'pulse' ? theme.miscellaneous.bodyColor : theme.miscellaneous.surfaceColor};
62
+ animation,
63
+ active
64
+ }) => !active ? undefined : animation === 'pulse' ? theme.miscellaneous.bodyColor : theme.miscellaneous.surfaceColor};
64
65
  width: ${({
65
66
  width
66
67
  }) => `${width}px` ?? '100%'};
@@ -72,8 +73,9 @@ const Wrapper = (0, _styled.default)('div')`
72
73
  radius
73
74
  }) => radius ? theme.borderRadius[radius] : 'unset'};
74
75
  ${({
75
- animation
76
- }) => animation === 'pulse' ? pulseAnim : waveAnim};
76
+ animation,
77
+ active
78
+ }) => !active ? undefined : animation === 'pulse' ? pulseAnim : waveAnim};
77
79
  `;
78
80
  exports.Wrapper = Wrapper;
79
81
  //# sourceMappingURL=styled.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Skeleton/styled.ts"],"names":["pulseKf","waveKf","waveAnim","pulseAnim","Wrapper","theme","animation","miscellaneous","bodyColor","surfaceColor","width","height","radius","borderRadius"],"mappings":";;;;;;;AAAA;;AACA;;;;AAIA,MAAMA,OAAO,GAAG,qBAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAVA;AAYA,MAAMC,MAAM,GAAG,qBAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAVA;AAYA,MAAMC,QAAQ,GAAG,eAAI;AACrB;AACA;AACA;AACA,iBAAiBD,MAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAnBA;AAqBA,MAAME,SAAS,GAAG,eAAI;AACtB,eAAeH,OAAQ;AACvB,CAFA;AAIO,MAAMI,OAAO,GAAG,qBAAO,KAAP,CAAmD;AAC1E,sBAAsB,CAAC;AACnBC,EAAAA,KADmB;AAEnBC,EAAAA;AAFmB,CAAD,KAIlBA,SAAS,KAAK,OAAd,GACID,KAAK,CAACE,aAAN,CAAoBC,SADxB,GAEIH,KAAK,CAACE,aAAN,CAAoBE,YAAa;AACzC,WAAW,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAgB,GAAEA,KAAM,IAAT,IAAgB,MAAO;AACjD,YAAY,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAiB,GAAEA,MAAO,IAAV,IAAiB,MAAO;AACpD,mBAAmB,CAAC;AAAEN,EAAAA,KAAF;AAASO,EAAAA;AAAT,CAAD,KACfA,MAAM,GAAGP,KAAK,CAACQ,YAAN,CAAmBD,MAAnB,CAAH,GAAgC,OAAQ;AAClD,IAAI,CAAC;AAAEN,EAAAA;AAAF,CAAD,KAAoBA,SAAS,KAAK,OAAd,GAAwBH,SAAxB,GAAoCD,QAAU;AACtE,CAbO","sourcesContent":["import { css, keyframes } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport { StyleProps } from '@tecsinapse/react-core';\nimport { SkeletonProps } from './Skeleton';\n\nconst pulseKf = keyframes`\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0.4;\n }\n 100% {\n opacity: 1;\n }\n`;\n\nconst waveKf = keyframes`\n 0% {\n transform: translateX(-100%);\n }\n 50% {\n transform: translateX(100%);\n }\n 100% {\n transform: translateX(100%);\n }\n`;\n\nconst waveAnim = css`\n position: relative;\n overflow: hidden;\n &::after {\n animation: ${waveKf} 1.6s linear 0.5s infinite;\n background: linear-gradient(\n 90deg,\n transparent,\n rgba(0, 0, 0, 0.04),\n transparent\n );\n content: '';\n position: absolute;\n transform: translateX(-100%);\n bottom: 0;\n left: 0;\n right: 0;\n top: 0;\n }\n`;\n\nconst pulseAnim = css`\n animation: ${pulseKf} 1.5s ease-in-out 0.5s infinite;\n`;\n\nexport const Wrapper = styled('div')<Partial<StyleProps & SkeletonProps>>`\n background-color: ${({\n theme,\n animation,\n }: StyleProps & Partial<SkeletonProps>) =>\n animation === 'pulse'\n ? theme.miscellaneous.bodyColor\n : theme.miscellaneous.surfaceColor};\n width: ${({ width }) => `${width}px` ?? '100%'};\n height: ${({ height }) => `${height}px` ?? 'auto'};\n border-radius: ${({ theme, radius }: StyleProps & Partial<SkeletonProps>) =>\n radius ? theme.borderRadius[radius] : 'unset'};\n ${({ animation }) => (animation === 'pulse' ? pulseAnim : waveAnim)};\n`;\n"],"file":"styled.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/Skeleton/styled.ts"],"names":["pulseKf","waveKf","waveAnim","pulseAnim","Wrapper","theme","animation","active","undefined","miscellaneous","bodyColor","surfaceColor","width","height","radius","borderRadius"],"mappings":";;;;;;;AAAA;;AACA;;;;AAIA,MAAMA,OAAO,GAAG,qBAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAVA;AAYA,MAAMC,MAAM,GAAG,qBAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAVA;AAYA,MAAMC,QAAQ,GAAG,eAAI;AACrB;AACA;AACA;AACA,iBAAiBD,MAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAnBA;AAqBA,MAAME,SAAS,GAAG,eAAI;AACtB,eAAeH,OAAQ;AACvB,CAFA;AAIO,MAAMI,OAAO,GAAG,qBAAO,KAAP,CAAmD;AAC1E,sBAAsB,CAAC;AACnBC,EAAAA,KADmB;AAEnBC,EAAAA,SAFmB;AAGnBC,EAAAA;AAHmB,CAAD,KAKlB,CAACA,MAAD,GACIC,SADJ,GAEIF,SAAS,KAAK,OAAd,GACAD,KAAK,CAACI,aAAN,CAAoBC,SADpB,GAEAL,KAAK,CAACI,aAAN,CAAoBE,YAAa;AACzC,WAAW,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAgB,GAAEA,KAAM,IAAT,IAAgB,MAAO;AACjD,YAAY,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAiB,GAAEA,MAAO,IAAV,IAAiB,MAAO;AACpD,mBAAmB,CAAC;AAAER,EAAAA,KAAF;AAASS,EAAAA;AAAT,CAAD,KACfA,MAAM,GAAGT,KAAK,CAACU,YAAN,CAAmBD,MAAnB,CAAH,GAAgC,OAAQ;AAClD,IAAI,CAAC;AAAER,EAAAA,SAAF;AAAaC,EAAAA;AAAb,CAAD,KACA,CAACA,MAAD,GAAUC,SAAV,GAAsBF,SAAS,KAAK,OAAd,GAAwBH,SAAxB,GAAoCD,QAAS;AACvE,CAjBO","sourcesContent":["import { css, keyframes } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport { StyleProps } from '@tecsinapse/react-core';\nimport { SkeletonProps } from './Skeleton';\n\nconst pulseKf = keyframes`\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0.1;\n }\n 100% {\n opacity: 1;\n }\n`;\n\nconst waveKf = keyframes`\n 0% {\n transform: translateX(-100%);\n }\n 50% {\n transform: translateX(100%);\n }\n 100% {\n transform: translateX(100%);\n }\n`;\n\nconst waveAnim = css`\n position: relative;\n overflow: hidden;\n &::after {\n animation: ${waveKf} 1.6s linear 0.5s infinite;\n background: linear-gradient(\n 90deg,\n transparent,\n rgba(0, 0, 0, 0.04),\n transparent\n );\n content: '';\n position: absolute;\n transform: translateX(-100%);\n bottom: 0;\n left: 0;\n right: 0;\n top: 0;\n }\n`;\n\nconst pulseAnim = css`\n animation: ${pulseKf} 1.5s ease-in-out 0.5s infinite;\n`;\n\nexport const Wrapper = styled('div')<Partial<StyleProps & SkeletonProps>>`\n background-color: ${({\n theme,\n animation,\n active,\n }: StyleProps & Partial<SkeletonProps>) =>\n !active\n ? undefined\n : animation === 'pulse'\n ? theme.miscellaneous.bodyColor\n : theme.miscellaneous.surfaceColor};\n width: ${({ width }) => `${width}px` ?? '100%'};\n height: ${({ height }) => `${height}px` ?? 'auto'};\n border-radius: ${({ theme, radius }: StyleProps & Partial<SkeletonProps>) =>\n radius ? theme.borderRadius[radius] : 'unset'};\n ${({ animation, active }) =>\n !active ? undefined : animation === 'pulse' ? pulseAnim : waveAnim};\n`;\n"],"file":"styled.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/molecules/DatePicker/DatePicker.tsx"],"names":["DatePicker","value","type","rest","visible","setVisible","show","close","getYear","lowest","undefined","Date","getFullYear","getMonth","Calendar","calendar"],"mappings":";;;;;;;AAAA;;AAOA;;AACA;;;;;;;;AAUO,MAAMA,UAAU,GAAG,CAA0B;AAClDC,EAAAA,KADkD;AAElDC,EAAAA,IAFkD;AAGlD,KAAGC;AAH+C,CAA1B,KAIgB;AACxC,QAAM,CAACC,OAAD,EAAUC,UAAV,IAAwB,qBAAS,KAAT,CAA9B;AACA,QAAMC,IAAI,GAAG,wBAAY,MAAMD,UAAU,CAAC,IAAD,CAA5B,EAAoC,EAApC,CAAb;AACA,QAAME,KAAK,GAAG,wBAAY,MAAMF,UAAU,CAAC,KAAD,CAA5B,EAAqC,EAArC,CAAd;AAEA,QAAMG,OAAO,GAAG,oBAAQ,MAAM;AAC5B,QAAIP,KAAJ,EAAW;AACT,UAAIC,IAAI,KAAK,OAAb,EAAsB;AACpB,YAAKD,KAAD,CAAqBQ,MAArB,KAAgCC,SAApC,EACE,OAAO,IAAIC,IAAJ,CAAUV,KAAD,CAAqBQ,MAA9B,EAAsCG,WAAtC,EAAP;AACH,OAHD,MAGO;AACL,eAAO,IAAID,IAAJ,CAASV,KAAT,EAAwBW,WAAxB,EAAP;AACD;AACF;;AACD,WAAOF,SAAP;AACD,GAVe,EAUb,CAACT,KAAD,CAVa,CAAhB;AAYA,QAAMY,QAAQ,GAAG,oBAAQ,MAAM;AAC7B,QAAIZ,KAAJ,EAAW;AACT,UAAIC,IAAI,KAAK,OAAb,EAAsB;AACpB,YAAKD,KAAD,CAAqBQ,MAArB,KAAgCC,SAApC,EACE,OAAO,IAAIC,IAAJ,CAAUV,KAAD,CAAqBQ,MAA9B,EAAsCI,QAAtC,EAAP;AACH,OAHD,MAGO;AACL,eAAO,IAAIF,IAAJ,CAASV,KAAT,EAAwBY,QAAxB,EAAP;AACD;AACF;;AACD,WAAOH,SAAP;AACD,GAVgB,EAUd,CAACT,KAAD,CAVc,CAAjB;AAYA,SACE,6BAAC,qBAAD,eACME,IADN;AAEE,IAAA,iBAAiB,EAAEW,mBAFrB;AAGE,IAAA,KAAK,EAAEb,KAHT;AAIE,IAAA,IAAI,EAAEC,IAJR;AAKE,IAAA,IAAI,EAAEM,OALR;AAME,IAAA,KAAK,EAAEK,QANT;AAOE,IAAA,mBAAmB,EAAEP,IAPvB;AAQE,IAAA,oBAAoB,EAAEC,KARxB;AASE,IAAA,cAAc,EAAEQ,QAAQ,IACtB,6BAAC,kBAAD;AAAU,MAAA,OAAO,EAAEX,OAAnB;AAA4B,MAAA,UAAU,EAAEC;AAAxC,OACGU,QADH;AAVJ,KADF;AAiBD,CAlDM","sourcesContent":["import {\n Calendar,\n DatePicker as DatePickerCore,\n DatePickerProps,\n DateRange,\n SelectionType,\n} from '@tecsinapse/react-core';\nimport React, { useCallback, useMemo, useState } from 'react';\nimport { Dropdown } from '../../atoms/Dropdown';\n\nexport type WebDatePickerProps<T extends SelectionType> = Omit<\n DatePickerProps<T>,\n | 'CalendarComponent'\n | 'renderCalendar'\n | 'requestCloseCalendar'\n | 'requestShowCalendar'\n>;\n\nexport const DatePicker = <T extends SelectionType>({\n value,\n type,\n ...rest\n}: WebDatePickerProps<T>): JSX.Element => {\n const [visible, setVisible] = useState(false);\n const show = useCallback(() => setVisible(true), []);\n const close = useCallback(() => setVisible(false), []);\n\n const getYear = useMemo(() => {\n if (value) {\n if (type === 'range') {\n if ((value as DateRange).lowest !== undefined)\n return new Date((value as DateRange).lowest).getFullYear();\n } else {\n return new Date(value as Date).getFullYear();\n }\n }\n return undefined;\n }, [value]);\n\n const getMonth = useMemo(() => {\n if (value) {\n if (type === 'range') {\n if ((value as DateRange).lowest !== undefined)\n return new Date((value as DateRange).lowest).getMonth();\n } else {\n return new Date(value as Date).getMonth();\n }\n }\n return undefined;\n }, [value]);\n\n return (\n <DatePickerCore\n {...rest}\n CalendarComponent={Calendar}\n value={value}\n type={type}\n year={getYear}\n month={getMonth}\n requestShowCalendar={show}\n requestCloseCalendar={close}\n renderCalendar={calendar => (\n <Dropdown visible={visible} setVisible={setVisible}>\n {calendar}\n </Dropdown>\n )}\n />\n );\n};\n"],"file":"DatePicker.js"}
1
+ {"version":3,"sources":["../../../../src/components/molecules/DatePicker/DatePicker.tsx"],"names":["DatePicker","value","type","rest","visible","setVisible","show","close","getYear","lowest","undefined","Date","getFullYear","getMonth","Calendar","calendar"],"mappings":";;;;;;;AAAA;;AAOA;;AACA;;;;;;;;AAUO,MAAMA,UAAU,GAAG,CAA0B;AAClDC,EAAAA,KADkD;AAElDC,EAAAA,IAFkD;AAGlD,KAAGC;AAH+C,CAA1B,KAIgB;AACxC,QAAM,CAACC,OAAD,EAAUC,UAAV,IAAwB,qBAAS,KAAT,CAA9B;AACA,QAAMC,IAAI,GAAG,wBAAY,MAAMD,UAAU,CAAC,IAAD,CAA5B,EAAoC,EAApC,CAAb;AACA,QAAME,KAAK,GAAG,wBAAY,MAAMF,UAAU,CAAC,KAAD,CAA5B,EAAqC,EAArC,CAAd;AAEA,QAAMG,OAAO,GAAG,oBAAQ,MAAM;AAC5B,QAAIP,KAAJ,EAAW;AACT,UAAIC,IAAI,KAAK,OAAb,EAAsB;AACpB,YAAKD,KAAD,CAAqBQ,MAArB,KAAgCC,SAApC,EACE,OAAO,IAAIC,IAAJ,CAAUV,KAAD,CAAqBQ,MAA9B,EAAsCG,WAAtC,EAAP;AACH,OAHD,MAGO;AACL,eAAO,IAAID,IAAJ,CAASV,KAAT,EAAwBW,WAAxB,EAAP;AACD;AACF;;AACD,WAAOF,SAAP;AACD,GAVe,EAUb,CAACT,KAAD,CAVa,CAAhB;AAYA,QAAMY,QAAQ,GAAG,oBAAQ,MAAM;AAC7B,QAAIZ,KAAJ,EAAW;AACT,UAAIC,IAAI,KAAK,OAAb,EAAsB;AACpB,YAAKD,KAAD,CAAqBQ,MAArB,KAAgCC,SAApC,EACE,OAAO,IAAIC,IAAJ,CAAUV,KAAD,CAAqBQ,MAA9B,EAAsCI,QAAtC,EAAP;AACH,OAHD,MAGO;AACL,eAAO,IAAIF,IAAJ,CAASV,KAAT,EAAwBY,QAAxB,EAAP;AACD;AACF;;AACD,WAAOH,SAAP;AACD,GAVgB,EAUd,CAACT,KAAD,CAVc,CAAjB;AAYA,SACE,6BAAC,qBAAD,eACME,IADN;AAEE,IAAA,iBAAiB,EAAEW,mBAFrB;AAGE,IAAA,KAAK,EAAEb,KAHT;AAIE,IAAA,IAAI,EAAEC,IAJR;AAKE,IAAA,IAAI,EAAEM,OALR;AAME,IAAA,KAAK,EAAEK,QANT;AAOE,IAAA,mBAAmB,EAAEP,IAPvB;AAQE,IAAA,oBAAoB,EAAEC,KARxB;AASE,IAAA,cAAc,EAAEQ,QAAQ,IACtB,6BAAC,kBAAD;AAAU,MAAA,OAAO,EAAEX,OAAnB;AAA4B,MAAA,UAAU,EAAEC;AAAxC,OACGU,QADH;AAVJ,KADF;AAiBD,CAlDM","sourcesContent":["import {\n Calendar,\n DatePicker as DatePickerCore,\n DatePickerProps,\n DateRange,\n SelectionType,\n} from '@tecsinapse/react-core';\nimport React, { useCallback, useMemo, useState } from 'react';\nimport { Dropdown } from '../../atoms/Dropdown';\n\nexport type WebDatePickerProps<T extends SelectionType> = Omit<\n DatePickerProps<T>,\n | 'CalendarComponent'\n | 'renderCalendar'\n | 'requestCloseCalendar'\n | 'requestShowCalendar'\n>;\n\nexport const DatePicker = <T extends SelectionType>({\n value,\n type,\n ...rest\n}: WebDatePickerProps<T>): JSX.Element => {\n const [visible, setVisible] = useState(false);\n const show = useCallback(() => setVisible(true), []);\n const close = useCallback(() => setVisible(false), []);\n\n const getYear = useMemo(() => {\n if (value) {\n if (type === 'range') {\n if ((value as DateRange).lowest !== undefined)\n return new Date((value as DateRange).lowest).getFullYear();\n } else {\n return new Date(value as Date).getFullYear();\n }\n }\n return undefined;\n }, [value]);\n\n const getMonth = useMemo(() => {\n if (value) {\n if (type === 'range') {\n if ((value as DateRange).lowest !== undefined)\n return new Date((value as DateRange).lowest).getMonth();\n } else {\n return new Date(value as Date).getMonth();\n }\n }\n return undefined;\n }, [value]);\n\n return (\n <DatePickerCore\n {...rest}\n CalendarComponent={Calendar}\n value={value}\n type={type}\n year={getYear}\n month={getMonth}\n requestShowCalendar={show}\n requestCloseCalendar={close}\n renderCalendar={calendar => (\n <Dropdown visible={visible} setVisible={setVisible}>\n {calendar}\n </Dropdown>\n )}\n />\n );\n};\n"],"file":"DatePicker.js"}
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export { Button, useMouseHover, WebButtonProps, } from './components/atoms/Butto
4
4
  export { Input, InputWebProps } from './components/atoms/Input';
5
5
  export { Tag, TagProps } from './components/atoms/Tag';
6
6
  export { InputPassword, InputPasswordWebProps, } from './components/molecules/InputPassword';
7
+ export { InputMask, InputMaskWebProps } from './components/atoms/InputMask';
7
8
  export { Menubar, MenubarProps, MenubarOptionsType, MenubarItemsOptions, MenubarMostUsedType, } from './components/molecules/Menubar';
8
9
  export { Drawer, DrawerProps } from './components/molecules/Drawer';
9
10
  export { Select, SelectProps } from './components/molecules/Select';
@@ -16,5 +17,5 @@ export { Modal, ModalProps } from './components/atoms/Modal';
16
17
  export { TextArea, TextAreaProps } from './components/molecules/TextArea';
17
18
  export { Tooltip, ITooltip } from './components/atoms/Tooltip';
18
19
  export * from './hooks';
19
- export { DatePicker, WebDatePickerProps } from './components/molecules/DatePicker';
20
- export { DateTimePicker, WebDateTimePickerProps } from './components/molecules/DateTimePicker';
20
+ export { DatePicker, WebDatePickerProps, } from './components/molecules/DatePicker';
21
+ export { DateTimePicker, WebDateTimePickerProps, } from './components/molecules/DateTimePicker';
package/dist/index.js CHANGED
@@ -15,6 +15,8 @@ var _exportNames = {
15
15
  TagProps: true,
16
16
  InputPassword: true,
17
17
  InputPasswordWebProps: true,
18
+ InputMask: true,
19
+ InputMaskWebProps: true,
18
20
  Menubar: true,
19
21
  MenubarProps: true,
20
22
  MenubarOptionsType: true,
@@ -113,6 +115,18 @@ Object.defineProperty(exports, "InputPasswordWebProps", {
113
115
  return _InputPassword.InputPasswordWebProps;
114
116
  }
115
117
  });
118
+ Object.defineProperty(exports, "InputMask", {
119
+ enumerable: true,
120
+ get: function () {
121
+ return _InputMask.InputMask;
122
+ }
123
+ });
124
+ Object.defineProperty(exports, "InputMaskWebProps", {
125
+ enumerable: true,
126
+ get: function () {
127
+ return _InputMask.InputMaskWebProps;
128
+ }
129
+ });
116
130
  Object.defineProperty(exports, "Menubar", {
117
131
  enumerable: true,
118
132
  get: function () {
@@ -324,6 +338,8 @@ var _Tag = require("./components/atoms/Tag");
324
338
 
325
339
  var _InputPassword = require("./components/molecules/InputPassword");
326
340
 
341
+ var _InputMask = require("./components/atoms/InputMask");
342
+
327
343
  var _Menubar = require("./components/molecules/Menubar");
328
344
 
329
345
  var _Drawer = require("./components/molecules/Drawer");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAIA;;AAKA;;AACA;;AACA;;AAIA;;AAOA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AACA","sourcesContent":["export * from '@tecsinapse/react-core';\nexport {\n default as Badge,\n BadgeWebProps,\n} from './components/atoms/Badge/Badge';\nexport {\n Button,\n useMouseHover,\n WebButtonProps,\n} from './components/atoms/Button';\nexport { Input, InputWebProps } from './components/atoms/Input';\nexport { Tag, TagProps } from './components/atoms/Tag';\nexport {\n InputPassword,\n InputPasswordWebProps,\n} from './components/molecules/InputPassword';\nexport {\n Menubar,\n MenubarProps,\n MenubarOptionsType,\n MenubarItemsOptions,\n MenubarMostUsedType,\n} from './components/molecules/Menubar';\nexport { Drawer, DrawerProps } from './components/molecules/Drawer';\nexport { Select, SelectProps } from './components/molecules/Select';\nexport { Snackbar, SnackbarWebProps } from './components/molecules/Snackbar';\nexport {\n Breadcrumbs,\n BreadcrumbsProps,\n BreadcrumbType,\n} from './components/molecules/Breadcrumbs';\nexport { Skeleton, SkeletonProps } from './components/atoms/Skeleton';\nexport { Accordion, AccordionProps } from './components/atoms/Accordion';\nexport {\n DataGrid,\n DataGridProps,\n HeadersType,\n} from './components/organisms/DataGrid';\nexport { Modal, ModalProps } from './components/atoms/Modal';\nexport { TextArea, TextAreaProps } from './components/molecules/TextArea';\nexport { Tooltip, ITooltip } from './components/atoms/Tooltip';\nexport * from './hooks';\nexport { DatePicker, WebDatePickerProps } from './components/molecules/DatePicker'\nexport { DateTimePicker, WebDateTimePickerProps } from './components/molecules/DateTimePicker'"],"file":"index.js"}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAIA;;AAKA;;AACA;;AACA;;AAIA;;AACA;;AAOA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAIA","sourcesContent":["export * from '@tecsinapse/react-core';\nexport {\n default as Badge,\n BadgeWebProps,\n} from './components/atoms/Badge/Badge';\nexport {\n Button,\n useMouseHover,\n WebButtonProps,\n} from './components/atoms/Button';\nexport { Input, InputWebProps } from './components/atoms/Input';\nexport { Tag, TagProps } from './components/atoms/Tag';\nexport {\n InputPassword,\n InputPasswordWebProps,\n} from './components/molecules/InputPassword';\nexport { InputMask, InputMaskWebProps } from './components/atoms/InputMask';\nexport {\n Menubar,\n MenubarProps,\n MenubarOptionsType,\n MenubarItemsOptions,\n MenubarMostUsedType,\n} from './components/molecules/Menubar';\nexport { Drawer, DrawerProps } from './components/molecules/Drawer';\nexport { Select, SelectProps } from './components/molecules/Select';\nexport { Snackbar, SnackbarWebProps } from './components/molecules/Snackbar';\nexport {\n Breadcrumbs,\n BreadcrumbsProps,\n BreadcrumbType,\n} from './components/molecules/Breadcrumbs';\nexport { Skeleton, SkeletonProps } from './components/atoms/Skeleton';\nexport { Accordion, AccordionProps } from './components/atoms/Accordion';\nexport {\n DataGrid,\n DataGridProps,\n HeadersType,\n} from './components/organisms/DataGrid';\nexport { Modal, ModalProps } from './components/atoms/Modal';\nexport { TextArea, TextAreaProps } from './components/molecules/TextArea';\nexport { Tooltip, ITooltip } from './components/atoms/Tooltip';\nexport * from './hooks';\nexport {\n DatePicker,\n WebDatePickerProps,\n} from './components/molecules/DatePicker';\nexport {\n DateTimePicker,\n WebDateTimePickerProps,\n} from './components/molecules/DateTimePicker';\n"],"file":"index.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.16.1",
4
+ "version": "1.17.2",
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.15.1",
17
+ "@tecsinapse/react-core": "^1.16.0",
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": "0cb88258820a3029580021c04ab65fc62563fff3"
36
+ "gitHead": "6ca09ace6c0df4a67383ee165bd592512aa3c0ac"
37
37
  }
@@ -2,8 +2,6 @@ import { action } from '@storybook/addon-actions';
2
2
  import { Story } from '@storybook/react';
3
3
  import React, { useState } from 'react';
4
4
  import Input, { InputWebProps } from './Input';
5
- import { Masks } from '@tecsinapse/react-core/src';
6
- import { CurrencyOptions } from '@tecsinapse/react-core/src/components/atoms/Input/hooks/useNumberMask';
7
5
 
8
6
  export default {
9
7
  title: 'Hybrid/Input',
@@ -39,72 +37,3 @@ Base.args = {
39
37
  disabled: false,
40
38
  label: 'Login',
41
39
  };
42
-
43
- const TemplateStringMask: Story<InputWebProps> = args => {
44
- const [value, setValue] = useState<string>('');
45
-
46
- const onChange = text => {
47
- setValue(text);
48
- if (args.onChange) {
49
- args.onChange(text);
50
- }
51
- };
52
-
53
- return (
54
- <Input
55
- {...args}
56
- label={args.label}
57
- value={value}
58
- onChange={onChange}
59
- placeholder={args.placeholder}
60
- mask={Masks.COMBINED_PHONE}
61
- />
62
- );
63
- };
64
-
65
- export const StringMask = TemplateStringMask.bind({});
66
-
67
- StringMask.args = {
68
- onChange: value => action('onChange')(value),
69
- placeholder: 'Type your phone',
70
- disabled: false,
71
- label: 'Phone',
72
- };
73
-
74
- const TemplateNumberMask: Story<InputWebProps> = args => {
75
- const [value, setValue] = useState<number>(1200.2);
76
-
77
- const onChange = text => {
78
- setValue(text);
79
- if (args.onChange) {
80
- args.onChange(text);
81
- }
82
- };
83
-
84
- const numberMaskExample: CurrencyOptions = {
85
- symbol: 'R$ ',
86
- separator: '.',
87
- decimal: ',',
88
- precision: 2,
89
- };
90
-
91
- return (
92
- <Input
93
- {...args}
94
- label={args.label}
95
- value={value}
96
- onChange={onChange}
97
- placeholder={args.placeholder}
98
- mask={numberMaskExample}
99
- />
100
- );
101
- };
102
-
103
- export const NumberMask = TemplateNumberMask.bind({});
104
-
105
- NumberMask.args = {
106
- onChange: value => action('onChange')(value),
107
- placeholder: 'Type the price in R$',
108
- disabled: false,
109
- label: 'Price',
110
- };
@@ -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}
@@ -0,0 +1,80 @@
1
+ import { action } from '@storybook/addon-actions';
2
+ import { Story } from '@storybook/react';
3
+ import React, { useState } from 'react';
4
+ import InputMask, { InputMaskWebProps } from './InputMask';
5
+ import { Masks } from '@tecsinapse/react-core/src';
6
+ import { CurrencyOptions } from '@tecsinapse/react-core/dist/components/atoms/Input';
7
+
8
+ export default {
9
+ title: 'Hybrid/InputMask',
10
+ component: InputMask,
11
+ };
12
+
13
+ const TemplateStringMask: Story<InputMaskWebProps> = args => {
14
+ const [value, setValue] = useState<string>();
15
+
16
+ const onChange = text => {
17
+ setValue(text);
18
+ if (args.onChange) {
19
+ args.onChange(text);
20
+ }
21
+ };
22
+
23
+ return (
24
+ <InputMask
25
+ {...args}
26
+ label={args.label}
27
+ value={value}
28
+ onChange={onChange}
29
+ placeholder={args.placeholder}
30
+ mask={Masks.COMBINED_PHONE}
31
+ />
32
+ );
33
+ };
34
+
35
+ export const StringMask = TemplateStringMask.bind({});
36
+
37
+ StringMask.args = {
38
+ onChange: value => action('onChange')(value),
39
+ placeholder: 'Type your phone',
40
+ disabled: false,
41
+ label: 'Phone',
42
+ };
43
+
44
+ const TemplateNumberMask: Story<InputMaskWebProps> = args => {
45
+ const [value, setValue] = useState<number>(1200.2);
46
+
47
+ const onChange = text => {
48
+ setValue(text);
49
+ if (args.onChange) {
50
+ args.onChange(text);
51
+ }
52
+ };
53
+
54
+ const numberMaskExample: CurrencyOptions = {
55
+ symbol: 'R$ ',
56
+ separator: '.',
57
+ decimal: ',',
58
+ precision: 2,
59
+ };
60
+
61
+ return (
62
+ <InputMask
63
+ {...args}
64
+ label={args.label}
65
+ value={value}
66
+ onChange={onChange}
67
+ placeholder={args.placeholder}
68
+ mask={numberMaskExample}
69
+ />
70
+ );
71
+ };
72
+
73
+ export const NumberMask = TemplateNumberMask.bind({});
74
+
75
+ NumberMask.args = {
76
+ onChange: value => action('onChange')(value),
77
+ placeholder: 'Type the price in R$',
78
+ disabled: false,
79
+ label: 'Price',
80
+ };
@@ -0,0 +1,90 @@
1
+ import {
2
+ Hint,
3
+ InputContainer,
4
+ InputContainerProps,
5
+ InputMaskElementProps,
6
+ useInputFocus,
7
+ } from '@tecsinapse/react-core';
8
+ import React, { FC } from 'react';
9
+ import { View } from 'react-native';
10
+ import { StyledWebTextInputMask } from './styled';
11
+
12
+ export interface InputMaskWebProps
13
+ extends Omit<InputMaskElementProps, 'style'>,
14
+ InputContainerProps {}
15
+
16
+ const InputMask: FC<InputMaskWebProps> = React.forwardRef(
17
+ (
18
+ {
19
+ label,
20
+ labelColor,
21
+ labelColorVariant,
22
+ labelColorTone,
23
+ labelTypography,
24
+ labelStack,
25
+ labelWeight,
26
+ leftComponent,
27
+ rightComponent,
28
+ disabled,
29
+ style,
30
+ borderColor,
31
+ borderColorGradation,
32
+ inputContainerStyle,
33
+ variant = 'default',
34
+ hintComponent,
35
+ hint,
36
+ onFocus,
37
+ onBlur,
38
+ value,
39
+ placeholder,
40
+ ...rest
41
+ },
42
+ ref
43
+ ) => {
44
+ const _hint = hintComponent || <Hint text={hint} variant={variant} />;
45
+ const { focused, handleBlur, handleFocus } = useInputFocus(
46
+ onFocus,
47
+ onBlur,
48
+ !disabled
49
+ );
50
+
51
+ const onlyLabel = label && !placeholder;
52
+
53
+ return (
54
+ <View style={style}>
55
+ <InputContainer
56
+ label={String(value) ? label : undefined}
57
+ labelColor={labelColor}
58
+ labelColorVariant={labelColorVariant}
59
+ labelColorTone={labelColorTone}
60
+ labelTypography={labelTypography}
61
+ labelStack={labelStack}
62
+ labelWeight={labelWeight}
63
+ leftComponent={leftComponent}
64
+ rightComponent={rightComponent}
65
+ borderColor={borderColor}
66
+ borderColorGradation={borderColorGradation}
67
+ inputContainerStyle={inputContainerStyle}
68
+ focused={focused}
69
+ disabled={disabled}
70
+ variant={variant}
71
+ >
72
+ <StyledWebTextInputMask
73
+ {...rest}
74
+ placeholder={onlyLabel ? label : placeholder}
75
+ value={value}
76
+ ref={ref}
77
+ disabled={disabled}
78
+ onFocus={handleFocus}
79
+ onBlur={handleBlur}
80
+ />
81
+ </InputContainer>
82
+ {hint && _hint}
83
+ </View>
84
+ );
85
+ }
86
+ );
87
+
88
+ InputMask.displayName = 'InputMask';
89
+
90
+ export default InputMask;
@@ -0,0 +1 @@
1
+ export { default as InputMask, InputMaskWebProps } from './InputMask';
@@ -0,0 +1,10 @@
1
+ import styled from '@emotion/native';
2
+ import { InputMaskElement, StyleProps } from '@tecsinapse/react-core';
3
+
4
+ export const StyledWebTextInputMask = styled(InputMaskElement)<
5
+ Partial<StyleProps>
6
+ >`
7
+ &:focus-visible {
8
+ outline-width: 0;
9
+ }
10
+ `;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { Story } from '@storybook/react';
3
3
  import Skeleton from './Skeleton';
4
4
  import { SkeletonProps } from './Skeleton';
5
+ import { Text, Card } from '@tecsinapse/react-web-kit';
5
6
 
6
7
  export default {
7
8
  title: 'Web/Skeleton',
@@ -13,3 +14,25 @@ const Template: Story<SkeletonProps> = args => <Skeleton {...args} />;
13
14
  export const Base = Template.bind({});
14
15
 
15
16
  Base.args = { width: 100, height: 50 };
17
+
18
+ const ChildrenTemplate: Story<SkeletonProps> = args => {
19
+ return (
20
+ <Skeleton {...args}>
21
+ <Card
22
+ elevated
23
+ style={{
24
+ height: '100px',
25
+ width: '200px',
26
+ alignItems: 'center',
27
+ justifyContent: 'center',
28
+ }}
29
+ >
30
+ <Text>Skeleton card!</Text>
31
+ </Card>
32
+ </Skeleton>
33
+ );
34
+ };
35
+
36
+ export const Children = ChildrenTemplate.bind({});
37
+
38
+ Children.args = { animation: 'pulse' };
@@ -1,11 +1,13 @@
1
1
  import React from 'react';
2
2
  import { Wrapper } from './styled';
3
3
  import { BorderRadiusType } from '@tecsinapse/react-core';
4
+ import { View } from 'react-native';
4
5
 
5
6
  export interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {
6
7
  width?: number;
7
8
  height?: number;
8
9
  animation?: 'pulse' | 'wave';
10
+ active?: boolean;
9
11
  radius?: BorderRadiusType;
10
12
  }
11
13
 
@@ -14,6 +16,7 @@ const Skeleton: React.FC<SkeletonProps> = ({
14
16
  width,
15
17
  height,
16
18
  animation = 'wave',
19
+ active = true,
17
20
  radius,
18
21
  ...rest
19
22
  }) => {
@@ -28,10 +31,16 @@ const Skeleton: React.FC<SkeletonProps> = ({
28
31
  width={width}
29
32
  height={height}
30
33
  animation={animation}
34
+ active={active}
31
35
  radius={radius}
32
36
  {...rest}
33
37
  >
34
- {children}
38
+ <View
39
+ style={{ opacity: active ? 0 : 1 }}
40
+ pointerEvents={active ? 'none' : 'auto'}
41
+ >
42
+ {children}
43
+ </View>
35
44
  </Wrapper>
36
45
  );
37
46
  };
@@ -8,7 +8,7 @@ const pulseKf = keyframes`
8
8
  opacity: 1;
9
9
  }
10
10
  50% {
11
- opacity: 0.4;
11
+ opacity: 0.1;
12
12
  }
13
13
  100% {
14
14
  opacity: 1;
@@ -56,13 +56,17 @@ export const Wrapper = styled('div')<Partial<StyleProps & SkeletonProps>>`
56
56
  background-color: ${({
57
57
  theme,
58
58
  animation,
59
+ active,
59
60
  }: StyleProps & Partial<SkeletonProps>) =>
60
- animation === 'pulse'
61
+ !active
62
+ ? undefined
63
+ : animation === 'pulse'
61
64
  ? theme.miscellaneous.bodyColor
62
65
  : theme.miscellaneous.surfaceColor};
63
66
  width: ${({ width }) => `${width}px` ?? '100%'};
64
67
  height: ${({ height }) => `${height}px` ?? 'auto'};
65
68
  border-radius: ${({ theme, radius }: StyleProps & Partial<SkeletonProps>) =>
66
69
  radius ? theme.borderRadius[radius] : 'unset'};
67
- ${({ animation }) => (animation === 'pulse' ? pulseAnim : waveAnim)};
70
+ ${({ animation, active }) =>
71
+ !active ? undefined : animation === 'pulse' ? pulseAnim : waveAnim};
68
72
  `;
@@ -2,7 +2,7 @@ import {
2
2
  Calendar,
3
3
  DatePicker as DatePickerCore,
4
4
  DatePickerProps,
5
- DateRange,
5
+ DateRange,
6
6
  SelectionType,
7
7
  } from '@tecsinapse/react-core';
8
8
  import React, { useCallback, useMemo, useState } from 'react';
package/src/index.ts CHANGED
@@ -14,6 +14,7 @@ export {
14
14
  InputPassword,
15
15
  InputPasswordWebProps,
16
16
  } from './components/molecules/InputPassword';
17
+ export { InputMask, InputMaskWebProps } from './components/atoms/InputMask';
17
18
  export {
18
19
  Menubar,
19
20
  MenubarProps,
@@ -40,5 +41,11 @@ export { Modal, ModalProps } from './components/atoms/Modal';
40
41
  export { TextArea, TextAreaProps } from './components/molecules/TextArea';
41
42
  export { Tooltip, ITooltip } from './components/atoms/Tooltip';
42
43
  export * from './hooks';
43
- export { DatePicker, WebDatePickerProps } from './components/molecules/DatePicker'
44
- export { DateTimePicker, WebDateTimePickerProps } from './components/molecules/DateTimePicker'
44
+ export {
45
+ DatePicker,
46
+ WebDatePickerProps,
47
+ } from './components/molecules/DatePicker';
48
+ export {
49
+ DateTimePicker,
50
+ WebDateTimePickerProps,
51
+ } from './components/molecules/DateTimePicker';