@tecsinapse/react-core 1.18.0 → 1.19.0

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 (222) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/components/atoms/Avatar/Avatar.js.map +1 -1
  3. package/dist/components/atoms/Avatar/helpers.js.map +1 -1
  4. package/dist/components/atoms/Avatar/index.js.map +1 -1
  5. package/dist/components/atoms/Avatar/styled.js.map +1 -1
  6. package/dist/components/atoms/Badge/Badge.js.map +1 -1
  7. package/dist/components/atoms/Badge/index.js.map +1 -1
  8. package/dist/components/atoms/Badge/styled.js.map +1 -1
  9. package/dist/components/atoms/BoxContent/BoxContent.js.map +1 -1
  10. package/dist/components/atoms/BoxContent/index.js.map +1 -1
  11. package/dist/components/atoms/BoxContent/styled.js +1 -1
  12. package/dist/components/atoms/BoxContent/styled.js.map +1 -1
  13. package/dist/components/atoms/Button/Button.js +1 -1
  14. package/dist/components/atoms/Button/Button.js.map +1 -1
  15. package/dist/components/atoms/Button/States/BaseState.js.map +1 -1
  16. package/dist/components/atoms/Button/States/Error.js +1 -1
  17. package/dist/components/atoms/Button/States/Error.js.map +1 -1
  18. package/dist/components/atoms/Button/States/Loading.js.map +1 -1
  19. package/dist/components/atoms/Button/States/Success.js +1 -1
  20. package/dist/components/atoms/Button/States/Success.js.map +1 -1
  21. package/dist/components/atoms/Button/States/index.js.map +1 -1
  22. package/dist/components/atoms/Button/States/styled.js +1 -1
  23. package/dist/components/atoms/Button/States/styled.js.map +1 -1
  24. package/dist/components/atoms/Button/index.js +1 -1
  25. package/dist/components/atoms/Button/index.js.map +1 -1
  26. package/dist/components/atoms/Button/styled.js.map +1 -1
  27. package/dist/components/atoms/Card/Card.js +1 -1
  28. package/dist/components/atoms/Card/Card.js.map +1 -1
  29. package/dist/components/atoms/Card/Footer/Footer.js.map +1 -1
  30. package/dist/components/atoms/Card/Footer/index.js.map +1 -1
  31. package/dist/components/atoms/Card/Header/Header.js.map +1 -1
  32. package/dist/components/atoms/Card/Header/index.js.map +1 -1
  33. package/dist/components/atoms/Card/index.js.map +1 -1
  34. package/dist/components/atoms/Card/styled.js.map +1 -1
  35. package/dist/components/atoms/Checkbox/Checkbox.js +1 -1
  36. package/dist/components/atoms/Checkbox/Checkbox.js.map +1 -1
  37. package/dist/components/atoms/Checkbox/index.js.map +1 -1
  38. package/dist/components/atoms/Checkbox/styled.js +1 -1
  39. package/dist/components/atoms/Checkbox/styled.js.map +1 -1
  40. package/dist/components/atoms/Divider/Divider.js.map +1 -1
  41. package/dist/components/atoms/Divider/index.js.map +1 -1
  42. package/dist/components/atoms/Divider/styled.js.map +1 -1
  43. package/dist/components/atoms/GroupButton/GroupButton.d.ts +1 -1
  44. package/dist/components/atoms/GroupButton/GroupButton.js +1 -1
  45. package/dist/components/atoms/GroupButton/GroupButton.js.map +1 -1
  46. package/dist/components/atoms/GroupButton/GroupButtonOption.js.map +1 -1
  47. package/dist/components/atoms/GroupButton/index.js +1 -1
  48. package/dist/components/atoms/GroupButton/index.js.map +1 -1
  49. package/dist/components/atoms/GroupButton/styled.js +1 -1
  50. package/dist/components/atoms/GroupButton/styled.js.map +1 -1
  51. package/dist/components/atoms/Icon/Icon.js +1 -1
  52. package/dist/components/atoms/Icon/Icon.js.map +1 -1
  53. package/dist/components/atoms/Icon/helpers.js +1 -1
  54. package/dist/components/atoms/Icon/helpers.js.map +1 -1
  55. package/dist/components/atoms/Icon/index.js.map +1 -1
  56. package/dist/components/atoms/Input/Hint.js.map +1 -1
  57. package/dist/components/atoms/Input/InputContainer/InputContainer.d.ts +1 -1
  58. package/dist/components/atoms/Input/InputContainer/InputContainer.js +1 -1
  59. package/dist/components/atoms/Input/InputContainer/InputContainer.js.map +1 -1
  60. package/dist/components/atoms/Input/InputElement/InputElement.d.ts +3 -4
  61. package/dist/components/atoms/Input/InputElement/InputElement.js +1 -1
  62. package/dist/components/atoms/Input/InputElement/InputElement.js.map +1 -1
  63. package/dist/components/atoms/Input/InputMaskElement/InputMaskElement.d.ts +3 -4
  64. package/dist/components/atoms/Input/InputMaskElement/InputMaskElement.js +1 -1
  65. package/dist/components/atoms/Input/InputMaskElement/InputMaskElement.js.map +1 -1
  66. package/dist/components/atoms/Input/PressableInputContainer/PressableInputContainer.js +1 -1
  67. package/dist/components/atoms/Input/PressableInputContainer/PressableInputContainer.js.map +1 -1
  68. package/dist/components/atoms/Input/PressableInputContainer/index.js.map +1 -1
  69. package/dist/components/atoms/Input/PressableInputContainer/styled.js.map +1 -1
  70. package/dist/components/atoms/Input/hooks/useInputFocus.js.map +1 -1
  71. package/dist/components/atoms/Input/hooks/useNumberMask.js.map +1 -1
  72. package/dist/components/atoms/Input/hooks/useStringMask.js +1 -1
  73. package/dist/components/atoms/Input/hooks/useStringMask.js.map +1 -1
  74. package/dist/components/atoms/Input/index.js +1 -1
  75. package/dist/components/atoms/Input/index.js.map +1 -1
  76. package/dist/components/atoms/Input/styled.js +1 -1
  77. package/dist/components/atoms/Input/styled.js.map +1 -1
  78. package/dist/components/atoms/Paper/Paper.js +1 -1
  79. package/dist/components/atoms/Paper/Paper.js.map +1 -1
  80. package/dist/components/atoms/Paper/index.js.map +1 -1
  81. package/dist/components/atoms/Paper/styled.js.map +1 -1
  82. package/dist/components/atoms/PressableSurface/PressableSurface.js +1 -1
  83. package/dist/components/atoms/PressableSurface/PressableSurface.js.map +1 -1
  84. package/dist/components/atoms/PressableSurface/index.js.map +1 -1
  85. package/dist/components/atoms/ProgressBar/ProgressBar.d.ts +1 -1
  86. package/dist/components/atoms/ProgressBar/ProgressBar.js.map +1 -1
  87. package/dist/components/atoms/ProgressBar/index.js.map +1 -1
  88. package/dist/components/atoms/ProgressBar/styled.js +1 -1
  89. package/dist/components/atoms/ProgressBar/styled.js.map +1 -1
  90. package/dist/components/atoms/RadioButton/RadioButton.js +1 -1
  91. package/dist/components/atoms/RadioButton/RadioButton.js.map +1 -1
  92. package/dist/components/atoms/RadioButton/index.js.map +1 -1
  93. package/dist/components/atoms/RadioButton/styled.js +1 -1
  94. package/dist/components/atoms/RadioButton/styled.js.map +1 -1
  95. package/dist/components/atoms/Switch/Switch.d.ts +1 -1
  96. package/dist/components/atoms/Switch/Switch.js +1 -1
  97. package/dist/components/atoms/Switch/Switch.js.map +1 -1
  98. package/dist/components/atoms/Switch/animation.js.map +1 -1
  99. package/dist/components/atoms/Switch/index.js.map +1 -1
  100. package/dist/components/atoms/Switch/styled.d.ts +2 -14
  101. package/dist/components/atoms/Switch/styled.js +1 -1
  102. package/dist/components/atoms/Switch/styled.js.map +1 -1
  103. package/dist/components/atoms/Tag/Tag.js +1 -1
  104. package/dist/components/atoms/Tag/Tag.js.map +1 -1
  105. package/dist/components/atoms/Tag/index.js.map +1 -1
  106. package/dist/components/atoms/Tag/styled.js +1 -1
  107. package/dist/components/atoms/Tag/styled.js.map +1 -1
  108. package/dist/components/atoms/Text/Text.js +1 -1
  109. package/dist/components/atoms/Text/Text.js.map +1 -1
  110. package/dist/components/atoms/Text/functions.js.map +1 -1
  111. package/dist/components/atoms/Text/index.js.map +1 -1
  112. package/dist/components/atoms/Text/styled.js +1 -1
  113. package/dist/components/atoms/Text/styled.js.map +1 -1
  114. package/dist/components/atoms/shared/PaperAndCard.js.map +1 -1
  115. package/dist/components/molecules/Calendar/Calendar.js.map +1 -1
  116. package/dist/components/molecules/Calendar/components/MonthWeek.js.map +1 -1
  117. package/dist/components/molecules/Calendar/components/Weekdays.js.map +1 -1
  118. package/dist/components/molecules/Calendar/components/index.js +1 -1
  119. package/dist/components/molecules/Calendar/components/index.js.map +1 -1
  120. package/dist/components/molecules/Calendar/index.d.ts +1 -1
  121. package/dist/components/molecules/Calendar/index.js +1 -1
  122. package/dist/components/molecules/Calendar/index.js.map +1 -1
  123. package/dist/components/molecules/Calendar/styled.js +1 -1
  124. package/dist/components/molecules/Calendar/styled.js.map +1 -1
  125. package/dist/components/molecules/DatePicker/DatePicker.js +1 -1
  126. package/dist/components/molecules/DatePicker/DatePicker.js.map +1 -1
  127. package/dist/components/molecules/DatePicker/index.js.map +1 -1
  128. package/dist/components/molecules/DatePicker/styled.js +1 -1
  129. package/dist/components/molecules/DatePicker/styled.js.map +1 -1
  130. package/dist/components/molecules/DateTimePicker/DateTimePicker.js +1 -1
  131. package/dist/components/molecules/DateTimePicker/DateTimePicker.js.map +1 -1
  132. package/dist/components/molecules/DateTimePicker/index.js.map +1 -1
  133. package/dist/components/molecules/DateTimePicker/styled.js.map +1 -1
  134. package/dist/components/molecules/DateTimeSelector/DateTimeSelector.js +2 -1
  135. package/dist/components/molecules/DateTimeSelector/DateTimeSelector.js.map +1 -1
  136. package/dist/components/molecules/DateTimeSelector/Selector.js.map +1 -1
  137. package/dist/components/molecules/DateTimeSelector/index.js +1 -1
  138. package/dist/components/molecules/DateTimeSelector/index.js.map +1 -1
  139. package/dist/components/molecules/DateTimeSelector/styled.js +1 -1
  140. package/dist/components/molecules/DateTimeSelector/styled.js.map +1 -1
  141. package/dist/components/molecules/Grid/functions.js +1 -1
  142. package/dist/components/molecules/Grid/functions.js.map +1 -1
  143. package/dist/components/molecules/Grid/index.d.ts +1 -1
  144. package/dist/components/molecules/Grid/index.js +3 -5
  145. package/dist/components/molecules/Grid/index.js.map +1 -1
  146. package/dist/components/molecules/HintInputContainer/HintInputContainer.js +1 -1
  147. package/dist/components/molecules/HintInputContainer/HintInputContainer.js.map +1 -1
  148. package/dist/components/molecules/HintInputContainer/index.js.map +1 -1
  149. package/dist/components/molecules/HintInputContainer/styled.js.map +1 -1
  150. package/dist/components/molecules/IconTextButton/IconComponent.js +1 -1
  151. package/dist/components/molecules/IconTextButton/IconComponent.js.map +1 -1
  152. package/dist/components/molecules/IconTextButton/IconTextButton.d.ts +1 -3
  153. package/dist/components/molecules/IconTextButton/IconTextButton.js.map +1 -1
  154. package/dist/components/molecules/IconTextButton/index.js.map +1 -1
  155. package/dist/components/molecules/IconTextButton/styled.js.map +1 -1
  156. package/dist/components/molecules/InputPassword/InputPasswordIcon.js +1 -1
  157. package/dist/components/molecules/InputPassword/InputPasswordIcon.js.map +1 -1
  158. package/dist/components/molecules/InputPassword/index.js.map +1 -1
  159. package/dist/components/molecules/InputPassword/styled.js.map +1 -1
  160. package/dist/components/molecules/LabeledSwitch/LabeledSwitch.js.map +1 -1
  161. package/dist/components/molecules/LabeledSwitch/index.js +1 -1
  162. package/dist/components/molecules/LabeledSwitch/index.js.map +1 -1
  163. package/dist/components/molecules/Snackbar/Snackbar.js +1 -1
  164. package/dist/components/molecules/Snackbar/Snackbar.js.map +1 -1
  165. package/dist/components/molecules/Snackbar/index.js.map +1 -1
  166. package/dist/components/molecules/Snackbar/styled.js +1 -1
  167. package/dist/components/molecules/Snackbar/styled.js.map +1 -1
  168. package/dist/components/molecules/TextArea/TextArea.d.ts +1 -1
  169. package/dist/components/molecules/TextArea/TextArea.js.map +1 -1
  170. package/dist/components/molecules/TextArea/index.js +1 -1
  171. package/dist/components/molecules/TextArea/index.js.map +1 -1
  172. package/dist/components/molecules/TextArea/styled.d.ts +2 -14
  173. package/dist/components/molecules/TextArea/styled.js.map +1 -1
  174. package/dist/hooks/index.js.map +1 -1
  175. package/dist/hooks/useDebouncedState.js.map +1 -1
  176. package/dist/hooks/useTheme.js.map +1 -1
  177. package/dist/index.d.ts +1 -1
  178. package/dist/index.js +21 -7
  179. package/dist/index.js.map +1 -1
  180. package/dist/styles/ThemeProvider.js.map +1 -1
  181. package/dist/styles/definitions.js +1 -1
  182. package/dist/styles/definitions.js.map +1 -1
  183. package/dist/styles/light.js.map +1 -1
  184. package/dist/types/defaults.js.map +1 -1
  185. package/dist/utils/IPhoneXHelper.js +3 -3
  186. package/dist/utils/IPhoneXHelper.js.map +1 -1
  187. package/dist/utils/ResponsiveFontSize.js +6 -6
  188. package/dist/utils/ResponsiveFontSize.js.map +1 -1
  189. package/dist/utils/extractNumbersFromString.js +1 -1
  190. package/dist/utils/extractNumbersFromString.js.map +1 -1
  191. package/dist/utils/formatWithMask.js.map +1 -1
  192. package/dist/utils/index.js.map +1 -1
  193. package/dist/utils/lightenDarkenColor.js.map +1 -1
  194. package/dist/utils/masks.js.map +1 -1
  195. package/dist/utils/variantComplement.js +1 -1
  196. package/dist/utils/variantComplement.js.map +1 -1
  197. package/package.json +2 -2
  198. package/src/components/atoms/Badge/styled.ts +2 -3
  199. package/src/components/atoms/GroupButton/GroupButton.tsx +2 -5
  200. package/src/components/atoms/Input/InputContainer/InputContainer.tsx +3 -3
  201. package/src/components/atoms/Input/InputElement/InputElement.tsx +4 -5
  202. package/src/components/atoms/Input/InputMaskElement/InputMaskElement.tsx +4 -5
  203. package/src/components/atoms/ProgressBar/ProgressBar.tsx +2 -4
  204. package/src/components/atoms/Switch/Switch.tsx +1 -1
  205. package/src/components/atoms/Switch/animation.ts +4 -6
  206. package/src/components/atoms/Switch/styled.ts +4 -6
  207. package/src/components/atoms/Tag/Tag.tsx +1 -1
  208. package/src/components/atoms/shared/PaperAndCard.ts +1 -1
  209. package/src/components/molecules/Calendar/index.ts +1 -1
  210. package/src/components/molecules/DatePicker/DatePicker.tsx +12 -8
  211. package/src/components/molecules/DateTimePicker/DateTimePicker.tsx +19 -11
  212. package/src/components/molecules/DateTimeSelector/DateTimeSelector.tsx +0 -1
  213. package/src/components/molecules/Grid/index.ts +1 -1
  214. package/src/components/molecules/HintInputContainer/HintInputContainer.tsx +6 -1
  215. package/src/components/molecules/IconTextButton/IconTextButton.tsx +1 -3
  216. package/src/components/molecules/Snackbar/Snackbar.tsx +1 -1
  217. package/src/components/molecules/Snackbar/styled.ts +6 -2
  218. package/src/components/molecules/TextArea/TextArea.tsx +6 -2
  219. package/src/components/molecules/TextArea/styled.ts +5 -2
  220. package/src/index.ts +12 -1
  221. package/src/utils/IPhoneXHelper.ts +27 -22
  222. package/src/utils/ResponsiveFontSize.ts +55 -36
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports.borderColorGradationVC = exports.borderColorVC = exports.colorGradationVC = exports.colorVC = exports.fontColorVC = void 0;
4
+ exports.fontColorVC = exports.colorVC = exports.colorGradationVC = exports.borderColorVC = exports.borderColorGradationVC = void 0;
5
5
  const fontColorVC = {
6
6
  filled: 'light',
7
7
  outlined: 'orange',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/variantComplement.ts"],"names":["fontColorVC","filled","outlined","text","colorVC","colorGradationVC","borderColorVC","borderColorGradationVC"],"mappings":";;;;AAOO,MAAMA,WAA+C,GAAG;AAC7DC,EAAAA,MAAM,EAAE,OADqD;AAE7DC,EAAAA,QAAQ,EAAE,QAFmD;AAG7DC,EAAAA,IAAI,EAAE;AAHuD,CAAxD;;AAMA,MAAMC,OAAuC,GAAG;AACrDH,EAAAA,MAAM,EAAE,SAD6C;AAErDC,EAAAA,QAAQ,EAAE,SAF2C;AAGrDC,EAAAA,IAAI,EAAE;AAH+C,CAAhD;;AAMA,MAAME,gBAAyD,GAAG;AACvEJ,EAAAA,MAAM,EAAE,MAD+D;AAEvEC,EAAAA,QAAQ,EAAE,MAF6D;AAGvEC,EAAAA,IAAI,EAAE;AAHiE,CAAlE;;AAMA,MAAMG,aAA6C,GAAG;AAC3DL,EAAAA,MAAM,EAAE,SADmD;AAE3DC,EAAAA,QAAQ,EAAE,SAFiD;AAG3DC,EAAAA,IAAI,EAAE;AAHqD,CAAtD;;AAMA,MAAMI,sBAA+D,GAAG;AAC7EN,EAAAA,MAAM,EAAE,MADqE;AAE7EC,EAAAA,QAAQ,EAAE,MAFmE;AAG7EC,EAAAA,IAAI,EAAE;AAHuE,CAAxE","sourcesContent":["import {\n ColorGradationType,\n ColorType,\n FontColorType,\n VariantType,\n} from '../types/defaults';\n\nexport const fontColorVC: Record<VariantType, FontColorType> = {\n filled: 'light',\n outlined: 'orange',\n text: 'orange',\n};\n\nexport const colorVC: Record<VariantType, ColorType> = {\n filled: 'primary',\n outlined: 'primary',\n text: 'primary',\n};\n\nexport const colorGradationVC: Record<VariantType, ColorGradationType> = {\n filled: 'dark',\n outlined: 'dark',\n text: 'dark',\n};\n\nexport const borderColorVC: Record<VariantType, ColorType> = {\n filled: 'primary',\n outlined: 'primary',\n text: 'primary',\n};\n\nexport const borderColorGradationVC: Record<VariantType, ColorGradationType> = {\n filled: 'dark',\n outlined: 'dark',\n text: 'dark',\n};\n"],"file":"variantComplement.js"}
1
+ {"version":3,"file":"variantComplement.js","names":["fontColorVC","filled","outlined","text","colorVC","colorGradationVC","borderColorVC","borderColorGradationVC"],"sources":["../../src/utils/variantComplement.ts"],"sourcesContent":["import {\n ColorGradationType,\n ColorType,\n FontColorType,\n VariantType,\n} from '../types/defaults';\n\nexport const fontColorVC: Record<VariantType, FontColorType> = {\n filled: 'light',\n outlined: 'orange',\n text: 'orange',\n};\n\nexport const colorVC: Record<VariantType, ColorType> = {\n filled: 'primary',\n outlined: 'primary',\n text: 'primary',\n};\n\nexport const colorGradationVC: Record<VariantType, ColorGradationType> = {\n filled: 'dark',\n outlined: 'dark',\n text: 'dark',\n};\n\nexport const borderColorVC: Record<VariantType, ColorType> = {\n filled: 'primary',\n outlined: 'primary',\n text: 'primary',\n};\n\nexport const borderColorGradationVC: Record<VariantType, ColorGradationType> = {\n filled: 'dark',\n outlined: 'dark',\n text: 'dark',\n};\n"],"mappings":";;;;AAOO,MAAMA,WAA+C,GAAG;EAC7DC,MAAM,EAAE,OADqD;EAE7DC,QAAQ,EAAE,QAFmD;EAG7DC,IAAI,EAAE;AAHuD,CAAxD;;AAMA,MAAMC,OAAuC,GAAG;EACrDH,MAAM,EAAE,SAD6C;EAErDC,QAAQ,EAAE,SAF2C;EAGrDC,IAAI,EAAE;AAH+C,CAAhD;;AAMA,MAAME,gBAAyD,GAAG;EACvEJ,MAAM,EAAE,MAD+D;EAEvEC,QAAQ,EAAE,MAF6D;EAGvEC,IAAI,EAAE;AAHiE,CAAlE;;AAMA,MAAMG,aAA6C,GAAG;EAC3DL,MAAM,EAAE,SADmD;EAE3DC,QAAQ,EAAE,SAFiD;EAG3DC,IAAI,EAAE;AAHqD,CAAtD;;AAMA,MAAMI,sBAA+D,GAAG;EAC7EN,MAAM,EAAE,MADqE;EAE7EC,QAAQ,EAAE,MAFmE;EAG7EC,IAAI,EAAE;AAHuE,CAAxE"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tecsinapse/react-core",
3
3
  "description": "TecSinapse hybrid React components",
4
- "version": "1.18.0",
4
+ "version": "1.19.0",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -34,5 +34,5 @@
34
34
  "react-native": "^0.64.0",
35
35
  "react-native-vector-icons": "^8.1.0 || ^9.0.0"
36
36
  },
37
- "gitHead": "7014df32d2de88a1f42259b56599d7fc10d794a9"
37
+ "gitHead": "59f85f1085ace4af0b26b85e32faf92cd2bf303f"
38
38
  }
@@ -23,9 +23,8 @@ const baseStyle = ({
23
23
  `;
24
24
  };
25
25
 
26
- export const BadgeStyle = styled(View)<Partial<StyleProps & BadgeProps>>(
27
- baseStyle
28
- );
26
+ export const BadgeStyle =
27
+ styled(View)<Partial<StyleProps & BadgeProps>>(baseStyle);
29
28
 
30
29
  export const ViewStyled = styled(View)<Partial<StyleProps & BadgeProps>>`
31
30
  align-items: center;
@@ -44,16 +44,13 @@ export interface GroupButtonProps<T> {
44
44
  disableAllOptions?: boolean;
45
45
  }
46
46
 
47
- const GroupButton = <T extends unknown>({
48
- style,
49
- ...rest
50
- }: GroupButtonProps<T>) => {
47
+ const GroupButton = <T,>({ style, ...rest }: GroupButtonProps<T>) => {
51
48
  return (
52
49
  <StyledGroupButton style={style}>{groupOptions(rest)}</StyledGroupButton>
53
50
  );
54
51
  };
55
52
 
56
- const groupOptions = <T extends unknown>({
53
+ const groupOptions = <T,>({
57
54
  options,
58
55
  renderOption,
59
56
  renderKey,
@@ -7,14 +7,14 @@ import {
7
7
  FontColorType,
8
8
  FontStackType,
9
9
  FontWeightType,
10
- TypographyVariationType
11
- } from '../../../../types/defaults';
10
+ TypographyVariationType,
11
+ } from '@tecsinapse/react-core';
12
12
  import { Text, TextProps } from '../../Text';
13
13
  import {
14
14
  StyledBorderKeeper,
15
15
  StyledIconContent,
16
16
  StyledInputContainer,
17
- StyledLabelContainer
17
+ StyledLabelContainer,
18
18
  } from '../styled';
19
19
 
20
20
  export type InputVariantType = 'default' | 'error' | 'success';
@@ -1,7 +1,7 @@
1
1
  import { useTheme } from '@emotion/react';
2
2
  import { ThemeProp } from '@tecsinapse/react-core';
3
- import React, { FC } from 'react';
4
- import { StyleProp, TextInputProps, TextStyle } from 'react-native';
3
+ import React from 'react';
4
+ import { StyleProp, TextInput, TextInputProps, TextStyle } from 'react-native';
5
5
  import { StyledInputElement } from '../styled';
6
6
 
7
7
  export interface InputElementProps
@@ -13,10 +13,9 @@ export interface InputElementProps
13
13
  onChange?: (value: string) => void;
14
14
  onFocus?: () => void;
15
15
  onBlur?: () => void;
16
- ref?: React.Ref<any>;
17
16
  }
18
17
 
19
- const InputElement: FC<InputElementProps> = React.forwardRef(
18
+ const InputElement = React.forwardRef<TextInput, InputElementProps>(
20
19
  (
21
20
  {
22
21
  onChange,
@@ -26,7 +25,7 @@ const InputElement: FC<InputElementProps> = React.forwardRef(
26
25
  placeholderTextColor,
27
26
  ...rest
28
27
  },
29
- ref: React.Ref<any>
28
+ ref
30
29
  ): JSX.Element => {
31
30
  const theme = useTheme() as ThemeProp;
32
31
  const _placeholderColor = placeholderTextColor || theme.font.color.dark;
@@ -1,7 +1,7 @@
1
1
  import { useTheme } from '@emotion/react';
2
2
  import { ThemeProp } from '@tecsinapse/react-core';
3
- import React, { FC, useCallback, useEffect } from 'react';
4
- import { StyleProp, TextInputProps, TextStyle } from 'react-native';
3
+ import React, { useCallback, useEffect } from 'react';
4
+ import { StyleProp, TextInput, TextInputProps, TextStyle } from 'react-native';
5
5
  import { StyledInputElement } from '../styled';
6
6
  import { MaskType, useStringMask } from '../hooks/useStringMask';
7
7
  import { CurrencyOptions, useNumberMask } from '../hooks/useNumberMask';
@@ -24,10 +24,9 @@ export interface InputMaskElementProps
24
24
  mask?: (MaskType[] | ((value: string) => MaskType[])) | CurrencyOptions;
25
25
  onFocus?: () => void;
26
26
  onBlur?: () => void;
27
- ref?: React.Ref<any>;
28
27
  }
29
28
 
30
- const InputMaskElement: FC<InputMaskElementProps> = React.forwardRef(
29
+ const InputMaskElement = React.forwardRef<TextInput, InputMaskElementProps>(
31
30
  (
32
31
  {
33
32
  onChange,
@@ -38,7 +37,7 @@ const InputMaskElement: FC<InputMaskElementProps> = React.forwardRef(
38
37
  mask,
39
38
  ...rest
40
39
  },
41
- ref: React.Ref<any>
40
+ ref
42
41
  ): JSX.Element => {
43
42
  const theme = useTheme() as ThemeProp;
44
43
 
@@ -4,8 +4,8 @@ import { Animated, ViewProps } from 'react-native';
4
4
  import {
5
5
  ColorGradationType,
6
6
  ColorType,
7
- ThemeProp
8
- } from '../../../types/defaults';
7
+ ThemeProp,
8
+ } from '@tecsinapse/react-core';
9
9
  import { extractNumbersFromString } from '../../../utils';
10
10
  import { Container, Progress, Segment } from './styled';
11
11
 
@@ -54,8 +54,6 @@ const ProgressBar: React.FC<ProgressBarProps> = ({
54
54
  const items = [...Array(segments).keys()];
55
55
 
56
56
  const segmentsRender = items.map(index => {
57
-
58
-
59
57
  const max = segmentWidth * (index + 1);
60
58
  const min = segmentWidth * index;
61
59
  const minmax = (totalProgress - min) / (max - min);
@@ -10,7 +10,7 @@ import {
10
10
  ColorGradationType,
11
11
  ColorType,
12
12
  ThemeProp,
13
- } from '../../../types/defaults';
13
+ } from '@tecsinapse/react-core';
14
14
  import {
15
15
  extractNumbersFromString,
16
16
  lightenDarkenColor,
@@ -1,6 +1,6 @@
1
1
  import { Animated, Easing } from 'react-native';
2
2
 
3
- const ANIMATION_SPEED = 140
3
+ const ANIMATION_SPEED = 140;
4
4
 
5
5
  export const transitionSwitch = (
6
6
  active: boolean,
@@ -8,9 +8,8 @@ export const transitionSwitch = (
8
8
  transitionValue: Animated.Value,
9
9
  animatedColor: Animated.Value
10
10
  ): void => {
11
+ if (translate <= 0) return;
11
12
 
12
- if (translate <= 0) return
13
-
14
13
  if (active) {
15
14
  Animated.timing(transitionValue, {
16
15
  toValue: translate,
@@ -23,8 +22,8 @@ export const transitionSwitch = (
23
22
  duration: ANIMATION_SPEED,
24
23
  useNativeDriver: false,
25
24
  }).start();
26
- return
27
- }
25
+ return;
26
+ }
28
27
 
29
28
  Animated.timing(transitionValue, {
30
29
  toValue: 0,
@@ -37,5 +36,4 @@ export const transitionSwitch = (
37
36
  duration: ANIMATION_SPEED,
38
37
  useNativeDriver: false,
39
38
  }).start();
40
-
41
39
  };
@@ -1,14 +1,12 @@
1
1
  import styled from '@emotion/native';
2
2
  import { Animated } from 'react-native';
3
- import { StyleProps } from '../../../types/defaults';
3
+ import { StyleProps } from '@tecsinapse/react-core';
4
4
  import { RFValueStr } from '../../../utils';
5
5
 
6
- export const SWITCH_BODY_WIDTH = '40px'
7
- export const SWITCH_PIN_WIDTH = '16px'
6
+ export const SWITCH_BODY_WIDTH = '40px';
7
+ export const SWITCH_PIN_WIDTH = '16px';
8
8
 
9
- export const StyledSwitchContent = styled(Animated.View)<
10
- Partial<StyleProps>
11
- >`
9
+ export const StyledSwitchContent = styled(Animated.View)<Partial<StyleProps>>`
12
10
  border-radius: ${({ theme }) => theme.borderRadius.pill};
13
11
  padding: 0 ${({ theme }) => theme.spacing.micro};
14
12
  justify-content: center;
@@ -43,7 +43,7 @@ const Tag: React.FC<TagProps> = ({
43
43
  <StyledTagContainer
44
44
  {...rest}
45
45
  variant={variant}
46
- style={[{ opacity: (fadeAnim as unknown) as number }, style]}
46
+ style={[{ opacity: fadeAnim as unknown as number }, style]}
47
47
  visible={!dismiss}
48
48
  >
49
49
  {icon && (
@@ -18,7 +18,7 @@ export const elevatedStyles = ({
18
18
  shadowOffset: { width: 0, height: 2 },
19
19
  shadowOpacity: 0.05,
20
20
  shadowRadius: 5,
21
- elevation: 2
21
+ elevation: 2,
22
22
  }),
23
23
  ];
24
24
  /* eslint-enable @typescript-eslint/no-explicit-any */
@@ -3,5 +3,5 @@ export {
3
3
  CalendarProps,
4
4
  SelectionType,
5
5
  DateRange,
6
- Value
6
+ Value,
7
7
  } from './Calendar';
@@ -7,21 +7,26 @@ import { CalendarProps, DateRange, SelectionType } from '../Calendar';
7
7
  import { HintInputContainer } from '../HintInputContainer';
8
8
  import { CalendarIcon, getStyledTextComponent } from './styled';
9
9
 
10
- export interface DatePickerProps<T extends SelectionType> extends InputContainerProps, Omit<CalendarProps<T>, 'style'> {
10
+ export interface DatePickerProps<T extends SelectionType>
11
+ extends InputContainerProps,
12
+ Omit<CalendarProps<T>, 'style'> {
11
13
  controlComponent?: (
12
14
  onPress: () => void,
13
15
  displayValue?: string
14
16
  ) => JSX.Element;
15
17
  TextComponent?: React.FC<TextProps>;
16
- CalendarComponent: React.FC<CalendarProps<T>>
18
+ CalendarComponent: React.FC<CalendarProps<T>>;
17
19
  placeholder?: string;
18
20
  onFocus?: () => void | never;
19
21
  onBlur?: () => void | never;
20
22
  format?: string;
21
23
  closeOnPick?: boolean;
22
- renderCalendar: (calendar: React.ReactElement, blur?: () => void) => JSX.Element|null
23
- requestShowCalendar: () => void
24
- requestCloseCalendar: () => void
24
+ renderCalendar: (
25
+ calendar: React.ReactElement,
26
+ blur?: () => void
27
+ ) => JSX.Element | null;
28
+ requestShowCalendar: () => void;
29
+ requestCloseCalendar: () => void;
25
30
  }
26
31
 
27
32
  function DatePicker<T extends SelectionType>({
@@ -51,7 +56,6 @@ function DatePicker<T extends SelectionType>({
51
56
  requestCloseCalendar,
52
57
  ...rest
53
58
  }: DatePickerProps<T>): JSX.Element {
54
-
55
59
  const { focused, handleBlur, handleFocus } = useInputFocus(
56
60
  onFocus,
57
61
  onBlur,
@@ -59,7 +63,7 @@ function DatePicker<T extends SelectionType>({
59
63
  );
60
64
 
61
65
  const handleShowCalendar = React.useCallback(() => {
62
- requestShowCalendar()
66
+ requestShowCalendar();
63
67
  handleFocus();
64
68
  }, [handleFocus, requestShowCalendar]);
65
69
 
@@ -99,7 +103,7 @@ function DatePicker<T extends SelectionType>({
99
103
  onChange={onChange}
100
104
  locale={locale}
101
105
  />
102
- )
106
+ );
103
107
 
104
108
  return (
105
109
  <>
@@ -7,7 +7,9 @@ import { DateTimeSelector, DateTimeSelectorProps } from '../DateTimeSelector';
7
7
  import { HintInputContainer } from '../HintInputContainer';
8
8
  import { getStyledDateTimeSelector } from './styled';
9
9
 
10
- export interface DateTimePickerProps extends InputContainerProps, Omit<DateTimeSelectorProps, 'style'> {
10
+ export interface DateTimePickerProps
11
+ extends InputContainerProps,
12
+ Omit<DateTimeSelectorProps, 'style'> {
11
13
  controlComponent?: (
12
14
  onPress: () => void,
13
15
  displayValue?: string
@@ -17,9 +19,12 @@ export interface DateTimePickerProps extends InputContainerProps, Omit<DateTimeS
17
19
  placeholder?: string;
18
20
  onFocus?: () => void | never;
19
21
  onBlur?: () => void | never;
20
- renderSelector: (selector: React.ReactElement, blur?: () => void) => JSX.Element|null
21
- requestShowSelector: () => void
22
- requestCloseSelector: () => void
22
+ renderSelector: (
23
+ selector: React.ReactElement,
24
+ blur?: () => void
25
+ ) => JSX.Element | null;
26
+ requestShowSelector: () => void;
27
+ requestCloseSelector: () => void;
23
28
  }
24
29
 
25
30
  const DateTimePicker: React.FC<DateTimePickerProps> = ({
@@ -59,7 +64,6 @@ const DateTimePicker: React.FC<DateTimePickerProps> = ({
59
64
  requestCloseSelector,
60
65
  ...rest
61
66
  }) => {
62
-
63
67
  const { focused, handleBlur, handleFocus } = useInputFocus(
64
68
  onFocus,
65
69
  onBlur,
@@ -67,18 +71,22 @@ const DateTimePicker: React.FC<DateTimePickerProps> = ({
67
71
  );
68
72
 
69
73
  const handleShowSelector = () => {
70
- requestShowSelector()
74
+ requestShowSelector();
71
75
  handleFocus();
72
76
  };
73
77
 
74
78
  const handleChoosing = (value: Date) => {
75
- onChange?.(value)
76
- requestCloseSelector()
79
+ onChange?.(value);
80
+ requestCloseSelector();
77
81
  };
78
82
 
79
83
  const StyledText = getStyledTextComponent(TextComponent);
80
- const displayValue = (value ? formatDate(value, format, { locale: locale }) : placeholder) || ' ';
81
- const StyledDateTimeSelector = getStyledDateTimeSelector(DateTimeSelectorComponent)
84
+ const displayValue =
85
+ (value ? formatDate(value, format, { locale: locale }) : placeholder) ||
86
+ ' ';
87
+ const StyledDateTimeSelector = getStyledDateTimeSelector(
88
+ DateTimeSelectorComponent
89
+ );
82
90
 
83
91
  const dateTimeSelector = (
84
92
  <StyledDateTimeSelector
@@ -102,7 +110,7 @@ const DateTimePicker: React.FC<DateTimePickerProps> = ({
102
110
  minuteLabel={minuteLabel}
103
111
  onChange={handleChoosing}
104
112
  />
105
- )
113
+ );
106
114
 
107
115
  return (
108
116
  <>
@@ -99,7 +99,6 @@ const DateTimeSelector: React.FC<DateTimeSelectorProps> = ({
99
99
  value,
100
100
  onChange,
101
101
  mode = 'date',
102
- format,
103
102
  locale,
104
103
  upperDateThreshold: _upperDateThreshold,
105
104
  lowerDateThreshold: _lowerDateThreshold,
@@ -63,4 +63,4 @@ export interface IGridItem {
63
63
  wrapper?: boolean;
64
64
  }
65
65
 
66
- export * from './functions';
66
+ export { getGridItemColumSpan, getGridItemPadding } from './functions';
@@ -1,6 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import { StyleProp, View, ViewStyle } from 'react-native';
3
- import { Hint, InputVariantType, PressableInputContainer, PressableInputContainerProps } from '../../atoms/Input';
3
+ import {
4
+ Hint,
5
+ InputVariantType,
6
+ PressableInputContainer,
7
+ PressableInputContainerProps,
8
+ } from '../../atoms/Input';
4
9
  import { TextProps } from '../../atoms/Text';
5
10
 
6
11
  export interface HintInputContainerProps extends PressableInputContainerProps {
@@ -1,6 +1,4 @@
1
- import { ButtonProps } from '../../atoms/Button';
2
- import { IconProps } from '../../atoms/Icon';
3
- import { TextProps } from '../../atoms/Text';
1
+ import { ButtonProps, IconProps, TextProps } from '@tecsinapse/react-core';
4
2
 
5
3
  export type IconPositionOptions = 'left' | 'right';
6
4
 
@@ -84,7 +84,7 @@ export const Snackbar: React.FC<SnackbarProps> = ({
84
84
  anchor={anchor}
85
85
  anchorDistance={anchorDistance}
86
86
  visible={open}
87
- style={[{ opacity: (fadeAnim as unknown) as number }, style]}
87
+ style={[{ opacity: fadeAnim as unknown as number }, style]}
88
88
  timeout={timeout}
89
89
  >
90
90
  <StyledContainerFlexRow>
@@ -32,7 +32,9 @@ const anchorTop = ({
32
32
  return (
33
33
  anchor === 'top' &&
34
34
  css`
35
- top: ${anchorDistance ? `${RFValue(anchorDistance)}px` : theme.spacing.deca};
35
+ top: ${anchorDistance
36
+ ? `${RFValue(anchorDistance)}px`
37
+ : theme.spacing.deca};
36
38
  `
37
39
  );
38
40
  };
@@ -45,7 +47,9 @@ const anchorBottom = ({
45
47
  return (
46
48
  anchor === 'bottom' &&
47
49
  css`
48
- bottom: ${anchorDistance ? `${RFValue(anchorDistance)}px` : theme.spacing.deca};
50
+ bottom: ${anchorDistance
51
+ ? `${RFValue(anchorDistance)}px`
52
+ : theme.spacing.deca};
49
53
  `
50
54
  );
51
55
  };
@@ -1,7 +1,11 @@
1
1
  import React, { FC } from 'react';
2
2
  import { View } from 'react-native';
3
- import { FontStackType, FontWeightType } from '../../../types/defaults';
4
- import { Hint, InputContainerProps, InputElementProps } from '../../atoms/Input';
3
+ import { FontStackType, FontWeightType } from '@tecsinapse/react-core';
4
+ import {
5
+ Hint,
6
+ InputContainerProps,
7
+ InputElementProps,
8
+ } from '../../atoms/Input';
5
9
  import { Text, TextProps } from '../../atoms/Text';
6
10
  import { StyledInputContainer } from './styled';
7
11
 
@@ -1,5 +1,5 @@
1
1
  import styled from '@emotion/native';
2
- import { StyleProps } from '../../../types/defaults';
2
+ import { StyleProps } from '@tecsinapse/react-core';
3
3
  import { extractNumbersFromString, RFValue, RFValueStr } from '../../../utils';
4
4
  import { InputContainer, InputElement } from '../../atoms/Input';
5
5
  import { TextAreaProps } from './TextArea';
@@ -12,7 +12,10 @@ export const TextAreaInputBase = styled(InputElement)<
12
12
  Partial<TextAreaProps> & Partial<StyleProps>
13
13
  >`
14
14
  max-height: ${({ theme, numberOfLines }) =>
15
- `${RFValue(extractNumbersFromString(theme.typography.h5.lineHeight) * (numberOfLines || 1))}px`};
15
+ `${RFValue(
16
+ extractNumbersFromString(theme.typography.h5.lineHeight) *
17
+ (numberOfLines || 1)
18
+ )}px`};
16
19
  width: 100%;
17
20
  padding: 0;
18
21
  margin: ${RFValueStr('3px')} 0;
package/src/index.ts CHANGED
@@ -68,7 +68,18 @@ export {
68
68
  DateTimeSelectorMode,
69
69
  DateTimeSelectorProps,
70
70
  } from './components/molecules/DateTimeSelector';
71
- export * from './components/molecules/Grid';
71
+ export {
72
+ GridSpacing,
73
+ IGridItem,
74
+ getGridItemPadding,
75
+ getGridItemColumSpan,
76
+ IGrid,
77
+ FlexAlignBase,
78
+ FlexAlignType,
79
+ FlexPositioning,
80
+ FlexSpacing,
81
+ PaddingPosition,
82
+ } from './components/molecules/Grid';
72
83
  export {
73
84
  HintInputContainer,
74
85
  HintInputContainerProps,
@@ -1,34 +1,39 @@
1
1
  import { Dimensions, Platform, StatusBar } from 'react-native';
2
2
 
3
3
  export function isIphoneX() {
4
- const dimen = Dimensions.get('window');
5
- return (
6
- Platform.OS === 'ios' &&
7
- !Platform.isPad &&
8
- !Platform.isTVOS &&
9
- ((dimen.height === 780 || dimen.width === 780)
10
- || (dimen.height === 812 || dimen.width === 812)
11
- || (dimen.height === 844 || dimen.width === 844)
12
- || (dimen.height === 896 || dimen.width === 896)
13
- || (dimen.height === 926 || dimen.width === 926))
14
- );
4
+ const dimen = Dimensions.get('window');
5
+ return (
6
+ Platform.OS === 'ios' &&
7
+ !Platform.isPad &&
8
+ !Platform.isTVOS &&
9
+ (dimen.height === 780 ||
10
+ dimen.width === 780 ||
11
+ dimen.height === 812 ||
12
+ dimen.width === 812 ||
13
+ dimen.height === 844 ||
14
+ dimen.width === 844 ||
15
+ dimen.height === 896 ||
16
+ dimen.width === 896 ||
17
+ dimen.height === 926 ||
18
+ dimen.width === 926)
19
+ );
15
20
  }
16
21
 
17
22
  export function ifIphoneX(iphoneXStyle, regularStyle) {
18
- if (isIphoneX()) {
19
- return iphoneXStyle;
20
- }
21
- return regularStyle;
23
+ if (isIphoneX()) {
24
+ return iphoneXStyle;
25
+ }
26
+ return regularStyle;
22
27
  }
23
28
 
24
29
  export function getStatusBarHeight(safe) {
25
- return Platform.select({
26
- ios: ifIphoneX(safe ? 44 : 30, 20),
27
- android: StatusBar.currentHeight,
28
- default: 0
29
- });
30
+ return Platform.select({
31
+ ios: ifIphoneX(safe ? 44 : 30, 20),
32
+ android: StatusBar.currentHeight,
33
+ default: 0,
34
+ });
30
35
  }
31
36
 
32
37
  export function getBottomSpace() {
33
- return isIphoneX() ? 34 : 0;
34
- }
38
+ return isIphoneX() ? 34 : 0;
39
+ }