@tecsinapse/react-core 1.15.1 → 1.16.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 (247) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/components/atoms/Avatar/Avatar.js +1 -3
  3. package/dist/components/atoms/Avatar/Avatar.js.map +1 -1
  4. package/dist/components/atoms/Avatar/helpers.js +1 -3
  5. package/dist/components/atoms/Avatar/helpers.js.map +1 -1
  6. package/dist/components/atoms/Avatar/index.js +5 -15
  7. package/dist/components/atoms/Avatar/index.js.map +1 -1
  8. package/dist/components/atoms/Avatar/styled.js +1 -3
  9. package/dist/components/atoms/Avatar/styled.js.map +1 -1
  10. package/dist/components/atoms/Badge/Badge.js +1 -3
  11. package/dist/components/atoms/Badge/Badge.js.map +1 -1
  12. package/dist/components/atoms/Badge/index.js +5 -15
  13. package/dist/components/atoms/Badge/index.js.map +1 -1
  14. package/dist/components/atoms/Badge/styled.js +1 -3
  15. package/dist/components/atoms/Badge/styled.js.map +1 -1
  16. package/dist/components/atoms/BoxContent/BoxContent.js +1 -3
  17. package/dist/components/atoms/BoxContent/BoxContent.js.map +1 -1
  18. package/dist/components/atoms/BoxContent/index.js +5 -15
  19. package/dist/components/atoms/BoxContent/index.js.map +1 -1
  20. package/dist/components/atoms/BoxContent/styled.js +2 -4
  21. package/dist/components/atoms/BoxContent/styled.js.map +1 -1
  22. package/dist/components/atoms/Button/Button.js +1 -3
  23. package/dist/components/atoms/Button/Button.js.map +1 -1
  24. package/dist/components/atoms/Button/States/BaseState.js +1 -3
  25. package/dist/components/atoms/Button/States/BaseState.js.map +1 -1
  26. package/dist/components/atoms/Button/States/Error.js +1 -3
  27. package/dist/components/atoms/Button/States/Error.js.map +1 -1
  28. package/dist/components/atoms/Button/States/Loading.js +1 -3
  29. package/dist/components/atoms/Button/States/Loading.js.map +1 -1
  30. package/dist/components/atoms/Button/States/Success.js +1 -3
  31. package/dist/components/atoms/Button/States/Success.js.map +1 -1
  32. package/dist/components/atoms/Button/States/index.js +8 -21
  33. package/dist/components/atoms/Button/States/index.js.map +1 -1
  34. package/dist/components/atoms/Button/States/styled.js +1 -3
  35. package/dist/components/atoms/Button/States/styled.js.map +1 -1
  36. package/dist/components/atoms/Button/index.js +12 -51
  37. package/dist/components/atoms/Button/index.js.map +1 -1
  38. package/dist/components/atoms/Button/styled.js +1 -3
  39. package/dist/components/atoms/Button/styled.js.map +1 -1
  40. package/dist/components/atoms/Card/Card.js +1 -3
  41. package/dist/components/atoms/Card/Card.js.map +1 -1
  42. package/dist/components/atoms/Card/Footer/Footer.js +1 -3
  43. package/dist/components/atoms/Card/Footer/Footer.js.map +1 -1
  44. package/dist/components/atoms/Card/Footer/index.js +5 -15
  45. package/dist/components/atoms/Card/Footer/index.js.map +1 -1
  46. package/dist/components/atoms/Card/Header/Header.js +1 -3
  47. package/dist/components/atoms/Card/Header/Header.js.map +1 -1
  48. package/dist/components/atoms/Card/Header/index.js +5 -15
  49. package/dist/components/atoms/Card/Header/index.js.map +1 -1
  50. package/dist/components/atoms/Card/index.js +5 -15
  51. package/dist/components/atoms/Card/index.js.map +1 -1
  52. package/dist/components/atoms/Card/styled.js +1 -3
  53. package/dist/components/atoms/Card/styled.js.map +1 -1
  54. package/dist/components/atoms/Checkbox/Checkbox.js +1 -3
  55. package/dist/components/atoms/Checkbox/Checkbox.js.map +1 -1
  56. package/dist/components/atoms/Checkbox/index.js +5 -15
  57. package/dist/components/atoms/Checkbox/index.js.map +1 -1
  58. package/dist/components/atoms/Checkbox/styled.js +1 -3
  59. package/dist/components/atoms/Checkbox/styled.js.map +1 -1
  60. package/dist/components/atoms/Divider/Divider.js +1 -3
  61. package/dist/components/atoms/Divider/Divider.js.map +1 -1
  62. package/dist/components/atoms/Divider/index.js +5 -15
  63. package/dist/components/atoms/Divider/index.js.map +1 -1
  64. package/dist/components/atoms/Divider/styled.js +1 -3
  65. package/dist/components/atoms/Divider/styled.js.map +1 -1
  66. package/dist/components/atoms/GroupButton/GroupButton.js +7 -9
  67. package/dist/components/atoms/GroupButton/GroupButton.js.map +1 -1
  68. package/dist/components/atoms/GroupButton/GroupButtonOption.js +1 -3
  69. package/dist/components/atoms/GroupButton/GroupButtonOption.js.map +1 -1
  70. package/dist/components/atoms/GroupButton/index.js +9 -33
  71. package/dist/components/atoms/GroupButton/index.js.map +1 -1
  72. package/dist/components/atoms/GroupButton/styled.js +12 -14
  73. package/dist/components/atoms/GroupButton/styled.js.map +1 -1
  74. package/dist/components/atoms/Icon/Icon.js +1 -3
  75. package/dist/components/atoms/Icon/Icon.js.map +1 -1
  76. package/dist/components/atoms/Icon/helpers.js +1 -3
  77. package/dist/components/atoms/Icon/helpers.js.map +1 -1
  78. package/dist/components/atoms/Icon/index.js +5 -15
  79. package/dist/components/atoms/Icon/index.js.map +1 -1
  80. package/dist/components/atoms/Input/Hint.js +1 -3
  81. package/dist/components/atoms/Input/Hint.js.map +1 -1
  82. package/dist/components/atoms/Input/InputContainer/InputContainer.js +1 -3
  83. package/dist/components/atoms/Input/InputContainer/InputContainer.js.map +1 -1
  84. package/dist/components/atoms/Input/InputElement/InputElement.d.ts +2 -5
  85. package/dist/components/atoms/Input/InputElement/InputElement.js +5 -49
  86. package/dist/components/atoms/Input/InputElement/InputElement.js.map +1 -1
  87. package/dist/components/atoms/Input/InputMaskElement/InputMaskElement.d.ts +17 -0
  88. package/dist/components/atoms/Input/InputMaskElement/InputMaskElement.js +84 -0
  89. package/dist/components/atoms/Input/InputMaskElement/InputMaskElement.js.map +1 -0
  90. package/dist/components/atoms/Input/PressableInputContainer/PressableInputContainer.js +1 -3
  91. package/dist/components/atoms/Input/PressableInputContainer/PressableInputContainer.js.map +1 -1
  92. package/dist/components/atoms/Input/PressableInputContainer/index.js +5 -15
  93. package/dist/components/atoms/Input/PressableInputContainer/index.js.map +1 -1
  94. package/dist/components/atoms/Input/PressableInputContainer/styled.js +1 -3
  95. package/dist/components/atoms/Input/PressableInputContainer/styled.js.map +1 -1
  96. package/dist/components/atoms/Input/hooks/useInputFocus.js +1 -3
  97. package/dist/components/atoms/Input/hooks/useInputFocus.js.map +1 -1
  98. package/dist/components/atoms/Input/hooks/useNumberMask.js +1 -3
  99. package/dist/components/atoms/Input/hooks/useNumberMask.js.map +1 -1
  100. package/dist/components/atoms/Input/hooks/useStringMask.js +3 -5
  101. package/dist/components/atoms/Input/hooks/useStringMask.js.map +1 -1
  102. package/dist/components/atoms/Input/index.d.ts +1 -0
  103. package/dist/components/atoms/Input/index.js +28 -82
  104. package/dist/components/atoms/Input/index.js.map +1 -1
  105. package/dist/components/atoms/Input/styled.js +2 -4
  106. package/dist/components/atoms/Input/styled.js.map +1 -1
  107. package/dist/components/atoms/Paper/Paper.js +1 -3
  108. package/dist/components/atoms/Paper/Paper.js.map +1 -1
  109. package/dist/components/atoms/Paper/index.js +5 -15
  110. package/dist/components/atoms/Paper/index.js.map +1 -1
  111. package/dist/components/atoms/Paper/styled.js +1 -3
  112. package/dist/components/atoms/Paper/styled.js.map +1 -1
  113. package/dist/components/atoms/PressableSurface/PressableSurface.js +1 -3
  114. package/dist/components/atoms/PressableSurface/PressableSurface.js.map +1 -1
  115. package/dist/components/atoms/PressableSurface/index.js +5 -15
  116. package/dist/components/atoms/PressableSurface/index.js.map +1 -1
  117. package/dist/components/atoms/ProgressBar/ProgressBar.js +3 -7
  118. package/dist/components/atoms/ProgressBar/ProgressBar.js.map +1 -1
  119. package/dist/components/atoms/ProgressBar/index.js +5 -15
  120. package/dist/components/atoms/ProgressBar/index.js.map +1 -1
  121. package/dist/components/atoms/ProgressBar/styled.js +1 -3
  122. package/dist/components/atoms/ProgressBar/styled.js.map +1 -1
  123. package/dist/components/atoms/RadioButton/RadioButton.js +1 -3
  124. package/dist/components/atoms/RadioButton/RadioButton.js.map +1 -1
  125. package/dist/components/atoms/RadioButton/index.js +5 -15
  126. package/dist/components/atoms/RadioButton/index.js.map +1 -1
  127. package/dist/components/atoms/RadioButton/styled.js +1 -3
  128. package/dist/components/atoms/RadioButton/styled.js.map +1 -1
  129. package/dist/components/atoms/Switch/Switch.js +1 -3
  130. package/dist/components/atoms/Switch/Switch.js.map +1 -1
  131. package/dist/components/atoms/Switch/animation.js +1 -3
  132. package/dist/components/atoms/Switch/animation.js.map +1 -1
  133. package/dist/components/atoms/Switch/index.js +5 -15
  134. package/dist/components/atoms/Switch/index.js.map +1 -1
  135. package/dist/components/atoms/Switch/styled.js +1 -3
  136. package/dist/components/atoms/Switch/styled.js.map +1 -1
  137. package/dist/components/atoms/Tag/Tag.js +2 -4
  138. package/dist/components/atoms/Tag/Tag.js.map +1 -1
  139. package/dist/components/atoms/Tag/index.js +5 -15
  140. package/dist/components/atoms/Tag/index.js.map +1 -1
  141. package/dist/components/atoms/Tag/styled.js +1 -3
  142. package/dist/components/atoms/Tag/styled.js.map +1 -1
  143. package/dist/components/atoms/Text/Text.js +1 -3
  144. package/dist/components/atoms/Text/Text.js.map +1 -1
  145. package/dist/components/atoms/Text/index.js +5 -15
  146. package/dist/components/atoms/Text/index.js.map +1 -1
  147. package/dist/components/atoms/Text/styled.js +1 -3
  148. package/dist/components/atoms/Text/styled.js.map +1 -1
  149. package/dist/components/atoms/shared/PaperAndCard.js +1 -3
  150. package/dist/components/atoms/shared/PaperAndCard.js.map +1 -1
  151. package/dist/components/molecules/Calendar/Calendar.js +3 -5
  152. package/dist/components/molecules/Calendar/Calendar.js.map +1 -1
  153. package/dist/components/molecules/Calendar/components/MonthWeek.js +4 -6
  154. package/dist/components/molecules/Calendar/components/MonthWeek.js.map +1 -1
  155. package/dist/components/molecules/Calendar/components/Weekdays.js +1 -3
  156. package/dist/components/molecules/Calendar/components/Weekdays.js.map +1 -1
  157. package/dist/components/molecules/Calendar/components/index.js +6 -15
  158. package/dist/components/molecules/Calendar/components/index.js.map +1 -1
  159. package/dist/components/molecules/Calendar/index.js +8 -33
  160. package/dist/components/molecules/Calendar/index.js.map +1 -1
  161. package/dist/components/molecules/Calendar/styled.js +4 -6
  162. package/dist/components/molecules/Calendar/styled.js.map +1 -1
  163. package/dist/components/molecules/DatePicker/DatePicker.js +1 -3
  164. package/dist/components/molecules/DatePicker/DatePicker.js.map +1 -1
  165. package/dist/components/molecules/DatePicker/index.js +5 -15
  166. package/dist/components/molecules/DatePicker/index.js.map +1 -1
  167. package/dist/components/molecules/DatePicker/styled.js +2 -4
  168. package/dist/components/molecules/DatePicker/styled.js.map +1 -1
  169. package/dist/components/molecules/DateTimePicker/DateTimePicker.js +2 -4
  170. package/dist/components/molecules/DateTimePicker/DateTimePicker.js.map +1 -1
  171. package/dist/components/molecules/DateTimePicker/index.js +5 -15
  172. package/dist/components/molecules/DateTimePicker/index.js.map +1 -1
  173. package/dist/components/molecules/DateTimePicker/styled.js +1 -3
  174. package/dist/components/molecules/DateTimePicker/styled.js.map +1 -1
  175. package/dist/components/molecules/DateTimeSelector/DateTimeSelector.js +2 -4
  176. package/dist/components/molecules/DateTimeSelector/DateTimeSelector.js.map +1 -1
  177. package/dist/components/molecules/DateTimeSelector/Selector.js +1 -3
  178. package/dist/components/molecules/DateTimeSelector/Selector.js.map +1 -1
  179. package/dist/components/molecules/DateTimeSelector/index.js +6 -21
  180. package/dist/components/molecules/DateTimeSelector/index.js.map +1 -1
  181. package/dist/components/molecules/DateTimeSelector/styled.js +1 -3
  182. package/dist/components/molecules/DateTimeSelector/styled.js.map +1 -1
  183. package/dist/components/molecules/Grid/Grid.js +3 -5
  184. package/dist/components/molecules/Grid/Grid.js.map +1 -1
  185. package/dist/components/molecules/Grid/Item/Item.js +4 -6
  186. package/dist/components/molecules/Grid/Item/Item.js.map +1 -1
  187. package/dist/components/molecules/Grid/Item/index.js +5 -15
  188. package/dist/components/molecules/Grid/Item/index.js.map +1 -1
  189. package/dist/components/molecules/Grid/index.js +8 -27
  190. package/dist/components/molecules/Grid/index.js.map +1 -1
  191. package/dist/components/molecules/HintInputContainer/HintInputContainer.js +1 -3
  192. package/dist/components/molecules/HintInputContainer/HintInputContainer.js.map +1 -1
  193. package/dist/components/molecules/HintInputContainer/index.js +4 -9
  194. package/dist/components/molecules/HintInputContainer/index.js.map +1 -1
  195. package/dist/components/molecules/InputPassword/InputPasswordIcon.js +1 -3
  196. package/dist/components/molecules/InputPassword/InputPasswordIcon.js.map +1 -1
  197. package/dist/components/molecules/InputPassword/index.js +4 -9
  198. package/dist/components/molecules/InputPassword/index.js.map +1 -1
  199. package/dist/components/molecules/InputPassword/styled.js +1 -3
  200. package/dist/components/molecules/InputPassword/styled.js.map +1 -1
  201. package/dist/components/molecules/Snackbar/Snackbar.js +3 -5
  202. package/dist/components/molecules/Snackbar/Snackbar.js.map +1 -1
  203. package/dist/components/molecules/Snackbar/index.js +5 -15
  204. package/dist/components/molecules/Snackbar/index.js.map +1 -1
  205. package/dist/components/molecules/Snackbar/styled.js +1 -3
  206. package/dist/components/molecules/Snackbar/styled.js.map +1 -1
  207. package/dist/components/molecules/TextArea/TextArea.js +1 -3
  208. package/dist/components/molecules/TextArea/TextArea.js.map +1 -1
  209. package/dist/components/molecules/TextArea/index.js +7 -21
  210. package/dist/components/molecules/TextArea/index.js.map +1 -1
  211. package/dist/components/molecules/TextArea/styled.js +1 -3
  212. package/dist/components/molecules/TextArea/styled.js.map +1 -1
  213. package/dist/hooks/index.js +6 -15
  214. package/dist/hooks/index.js.map +1 -1
  215. package/dist/hooks/useDebouncedState.js +1 -3
  216. package/dist/hooks/useDebouncedState.js.map +1 -1
  217. package/dist/hooks/useTheme.js +1 -3
  218. package/dist/hooks/useTheme.js.map +1 -1
  219. package/dist/index.d.ts +1 -1
  220. package/dist/index.js +123 -531
  221. package/dist/index.js.map +1 -1
  222. package/dist/styles/ThemeProvider.js +1 -3
  223. package/dist/styles/ThemeProvider.js.map +1 -1
  224. package/dist/styles/definitions.js +1 -3
  225. package/dist/styles/definitions.js.map +1 -1
  226. package/dist/styles/light.js +1 -3
  227. package/dist/styles/light.js.map +1 -1
  228. package/dist/types/defaults.js +1 -3
  229. package/dist/utils/IPhoneXHelper.js +1 -3
  230. package/dist/utils/IPhoneXHelper.js.map +1 -1
  231. package/dist/utils/ResponsiveFontSize.js +1 -3
  232. package/dist/utils/ResponsiveFontSize.js.map +1 -1
  233. package/dist/utils/extractNumbersFromString.js +1 -3
  234. package/dist/utils/extractNumbersFromString.js.map +1 -1
  235. package/dist/utils/formatWithMask.js +1 -3
  236. package/dist/utils/formatWithMask.js.map +1 -1
  237. package/dist/utils/index.js +11 -45
  238. package/dist/utils/index.js.map +1 -1
  239. package/dist/utils/lightenDarkenColor.js +1 -3
  240. package/dist/utils/lightenDarkenColor.js.map +1 -1
  241. package/dist/utils/masks.js +3 -5
  242. package/dist/utils/masks.js.map +1 -1
  243. package/package.json +2 -2
  244. package/src/components/atoms/Input/InputElement/InputElement.tsx +5 -74
  245. package/src/components/atoms/Input/InputMaskElement/InputMaskElement.tsx +120 -0
  246. package/src/components/atoms/Input/index.ts +4 -0
  247. package/src/index.ts +2 -0
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.useInputFocus = void 0;
7
5
 
8
6
  var _react = require("react");
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/atoms/Input/hooks/useInputFocus.ts"],"names":["useInputFocus","onFocus","onBlur","focusEnabled","focused","setFocused","handleFocus","handleBlur"],"mappings":";;;;;;;AAAA;;AAEO,MAAMA,aAAa,GAAG,CAC3BC,OAD2B,EAE3BC,MAF2B,EAG3BC,YAAY,GAAG,IAHY,KAIxB;AACH,QAAM,CAACC,OAAD,EAAUC,UAAV,IAAwB,qBAAkB,KAAlB,CAA9B;AAEA,QAAMC,WAAW,GAAG,wBAAY,MAAM;AACpC,QAAIH,YAAJ,EAAkB;AAChBE,MAAAA,UAAU,CAAC,IAAD,CAAV;AACAJ,MAAAA,OAAO,IAAIA,OAAO,EAAlB;AACD;AACF,GALmB,EAKjB,CAACE,YAAD,EAAeE,UAAf,EAA2BJ,OAA3B,CALiB,CAApB;AAOA,QAAMM,UAAU,GAAG,wBAAY,MAAM;AACnC,QAAIJ,YAAJ,EAAkB;AAChBE,MAAAA,UAAU,CAAC,KAAD,CAAV;AACAH,MAAAA,MAAM,IAAIA,MAAM,EAAhB;AACD;AACF,GALkB,EAKhB,CAACC,YAAD,EAAeE,UAAf,EAA2BH,MAA3B,CALgB,CAAnB;AAOA,SAAO;AACLE,IAAAA,OADK;AAELG,IAAAA,UAFK;AAGLD,IAAAA;AAHK,GAAP;AAKD,CA1BM","sourcesContent":["import { useCallback, useState } from 'react';\n\nexport const useInputFocus = (\n onFocus?: () => void,\n onBlur?: () => void,\n focusEnabled = true\n) => {\n const [focused, setFocused] = useState<boolean>(false);\n\n const handleFocus = useCallback(() => {\n if (focusEnabled) {\n setFocused(true);\n onFocus && onFocus();\n }\n }, [focusEnabled, setFocused, onFocus]);\n\n const handleBlur = useCallback(() => {\n if (focusEnabled) {\n setFocused(false);\n onBlur && onBlur();\n }\n }, [focusEnabled, setFocused, onBlur]);\n\n return {\n focused,\n handleBlur,\n handleFocus,\n };\n};\n"],"file":"useInputFocus.js"}
1
+ {"version":3,"sources":["../../../../../src/components/atoms/Input/hooks/useInputFocus.ts"],"names":["useInputFocus","onFocus","onBlur","focusEnabled","focused","setFocused","handleFocus","handleBlur"],"mappings":";;;;;AAAA;;AAEO,MAAMA,aAAa,GAAG,CAC3BC,OAD2B,EAE3BC,MAF2B,EAG3BC,YAAY,GAAG,IAHY,KAIxB;AACH,QAAM,CAACC,OAAD,EAAUC,UAAV,IAAwB,qBAAkB,KAAlB,CAA9B;AAEA,QAAMC,WAAW,GAAG,wBAAY,MAAM;AACpC,QAAIH,YAAJ,EAAkB;AAChBE,MAAAA,UAAU,CAAC,IAAD,CAAV;AACAJ,MAAAA,OAAO,IAAIA,OAAO,EAAlB;AACD;AACF,GALmB,EAKjB,CAACE,YAAD,EAAeE,UAAf,EAA2BJ,OAA3B,CALiB,CAApB;AAOA,QAAMM,UAAU,GAAG,wBAAY,MAAM;AACnC,QAAIJ,YAAJ,EAAkB;AAChBE,MAAAA,UAAU,CAAC,KAAD,CAAV;AACAH,MAAAA,MAAM,IAAIA,MAAM,EAAhB;AACD;AACF,GALkB,EAKhB,CAACC,YAAD,EAAeE,UAAf,EAA2BH,MAA3B,CALgB,CAAnB;AAOA,SAAO;AACLE,IAAAA,OADK;AAELG,IAAAA,UAFK;AAGLD,IAAAA;AAHK,GAAP;AAKD,CA1BM","sourcesContent":["import { useCallback, useState } from 'react';\n\nexport const useInputFocus = (\n onFocus?: () => void,\n onBlur?: () => void,\n focusEnabled = true\n) => {\n const [focused, setFocused] = useState<boolean>(false);\n\n const handleFocus = useCallback(() => {\n if (focusEnabled) {\n setFocused(true);\n onFocus && onFocus();\n }\n }, [focusEnabled, setFocused, onFocus]);\n\n const handleBlur = useCallback(() => {\n if (focusEnabled) {\n setFocused(false);\n onBlur && onBlur();\n }\n }, [focusEnabled, setFocused, onBlur]);\n\n return {\n focused,\n handleBlur,\n handleFocus,\n };\n};\n"],"file":"useInputFocus.js"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.useNumberMask = exports.getInternalNumberAndMask = void 0;
7
5
 
8
6
  var _currency = _interopRequireDefault(require("currency.js"));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/atoms/Input/hooks/useNumberMask.ts"],"names":["DEFAULT_OPTIONS","symbol","separator","decimal","precision","getRegex","RegExp","getInternalNumberAndMask","value","options","mergedOptions","internalNumber","stringValue","String","decimalIndex","indexOf","currentPrecision","length","zeros","i","Number","onlyNumbers","padZeros","padStart","replace","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","useNumberMask","defaultValue","applyMask","raw","formatted","format","setValue","handleChangeValue","formattedValue"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;AAKA,MAAMA,eAAg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KAAD,CAAR;AAID,GAPuB,EAQxB,CAACF,SAAD,EAAYI,QAAZ,CARwB,CAA1B;AAWA,SAAO,CAACzB,KAAD,EAAQ0B,iBAAR,CAAP;AACD,CAjCM","sourcesContent":["import currency from 'currency.js';\nimport { useCallback, useState } from 'react';\nimport { extractNumbersFromString } from '../../../../utils';\nimport { MaskValue } from './useStringMask';\n\nexport type CurrencyOptions = currency.Options;\n\nconst DEFAULT_OPTIONS: CurrencyOptions = {\n symbol: 'R$ ',\n separator: '.',\n decimal: ',',\n precision: 2,\n};\n\nconst getRegex = (precision: number) =>\n new RegExp(`\\\\B(?=(\\\\d{${precision}})(?!\\\\d))`, 'g');\n\nexport const getInternalNumberAndMask = (\n value: string | number,\n options?: CurrencyOptions\n): { internalNumber: number; mergedOptions: CurrencyOptions } => {\n const mergedOptions = { ...DEFAULT_OPTIONS, ...options };\n const { precision = -1 } = mergedOptions;\n\n let internalNumber;\n\n if (typeof value === 'number') {\n if (precision) {\n let stringValue = String(value);\n const decimalIndex = stringValue.indexOf('.');\n const currentPrecision = decimalIndex + precision;\n if (decimalIndex !== -1 && currentPrecision <= stringValue.length) {\n const zeros = stringValue.length + 1 - currentPrecision;\n for (let i = 0; i < zeros; i++) stringValue = stringValue + `0`;\n }\n internalNumber = Number(stringValue);\n } else {\n internalNumber = value;\n }\n } else {\n const onlyNumbers = String(extractNumbersFromString(value));\n const padZeros = String(onlyNumbers).padStart(precision + 1, '0');\n internalNumber = Number(padZeros.replace(getRegex(precision), '.'));\n }\n\n if (internalNumber > Number.MAX_SAFE_INTEGER) {\n internalNumber = Number.MAX_SAFE_INTEGER;\n }\n\n if (internalNumber < Number.MIN_SAFE_INTEGER) {\n internalNumber = Number.MIN_SAFE_INTEGER;\n }\n\n return {\n internalNumber,\n mergedOptions,\n };\n};\n\n/**\n * TODO:\n * @param options\n * @param defaultValue\n * @returns\n */\nexport const useNumberMask = (\n options?: CurrencyOptions,\n defaultValue?: string | number\n): [MaskValue, (value: string | number) => void] => {\n const applyMask = useCallback(\n (value: string | number = 0): MaskValue => {\n const { internalNumber, mergedOptions } = getInternalNumberAndMask(\n value,\n options\n );\n\n return {\n raw: internalNumber,\n formatted: currency(internalNumber).format(mergedOptions),\n };\n },\n [options, getRegex]\n );\n\n const [value, setValue] = useState<MaskValue>(applyMask(defaultValue));\n\n const handleChangeValue = useCallback(\n (formattedValue: string | number) => {\n const { raw, formatted } = applyMask(formattedValue);\n setValue({\n raw,\n formatted,\n });\n },\n [applyMask, setValue]\n );\n\n return [value, handleChangeValue];\n};\n"],"file":"useNumberMask.js"}
1
+ {"version":3,"sources":["../../../../../src/components/atoms/Input/hooks/useNumberMask.ts"],"names":["DEFAULT_OPTIONS","symbol","separator","decimal","precision","getRegex","RegExp","getInternalNumberAndMask","value","options","mergedOptions","internalNumber","stringValue","String","decimalIndex","indexOf","currentPrecision","length","zeros","i","Number","onlyNumbers","padZeros","padStart","replace","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","useNumberMask","defaultValue","applyMask","raw","formatted","format","setValue","handleChangeValue","formattedValue"],"mappings":";;;;;AAAA;;AACA;;AACA;;;;AAKA,MAAMA,eAAgC,GAAG;AACvCC,EAAAA,MAAM,EAAE,KAD+B;AAEvCC,EAAAA,SAAS,EAAE,GAF4B;AAGvCC,EAAAA,OAAO,EAAE,GAH8B;AAIvCC,EAAAA,SAAS,EAAE;AAJ4B,CAAzC;;AAOA,MAAMC,QAAQ,GAAID,SAAD,IACf,IAAIE,MAAJ,CAAY,cAAaF,SAAU,YAAnC,EAAgD,GAAhD,CADF;;AAGO,MAAMG,wBAAwB,GAAG,CACtCC,KADsC,EAEtCC,OAFsC,KAGyB;AAC/D,QAAMC,aAAa,GAAG,EAAE,GAAGV,eAAL;AAAsB,OAAGS;AAAzB,GAAtB;AACA,QAAM;AAAEL,IAAAA,SAAS,GAAG,CAAC;AAAf,MAAqBM,aAA3B;AAEA,MAAIC,cAAJ;;AAEA,MAAI,OAAOH,KAAP,KAAiB,QAArB,E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iB,aAAa,GAAG,CAC3BlB,OAD2B,EAE3BmB,YAF2B,KAGuB;AAClD,QAAMC,SAAS,GAAG,wBAChB,CAACrB,KAAsB,GAAG,CAA1B,KAA2C;AACzC,UAAM;AAAEG,MAAAA,cAAF;AAAkBD,MAAAA;AAAlB,QAAoCH,wBAAwB,CAChEC,KADgE,EAEhEC,OAFgE,CAAlE;AAKA,WAAO;AACLqB,MAAAA,GAAG,EAAEnB,cADA;AAELoB,MAAAA,SAAS,EAAE,uBAASpB,cAAT,EAAyBqB,MAAzB,CAAgCtB,aAAhC;AAFN,KAAP;AAID,GAXe,EAYhB,CAACD,OAAD,EAAUJ,QAAV,CAZgB,CAAlB;AAeA,QAAM,CAACG,KAAD,EAAQyB,QAAR,IAAoB,qBAAoBJ,SAAS,CAACD,YAAD,CAA7B,CAA1B;AAEA,QAAMM,iBAAiB,GAAG,wBACvBC,cAAD,IAAqC;AACnC,UAAM;AAAEL,MAAAA,GAAF;AAAOC,MAAAA;AAAP,QAAqBF,SAAS,CAACM,cAAD,CAApC;AACAF,IAAAA,QAAQ,CAAC;AACPH,MAAAA,GADO;AAEPC,MAAAA;AAFO,KAAD,CAAR;AAID,GAPuB,EAQxB,CAACF,SAAD,EAAYI,QAAZ,CARwB,CAA1B;AAWA,SAAO,CAACzB,KAAD,EAAQ0B,iBAAR,CAAP;AACD,CAjCM","sourcesContent":["import currency from 'currency.js';\nimport { useCallback, useState } from 'react';\nimport { extractNumbersFromString } from '../../../../utils';\nimport { MaskValue } from './useStringMask';\n\nexport type CurrencyOptions = currency.Options;\n\nconst DEFAULT_OPTIONS: CurrencyOptions = {\n symbol: 'R$ ',\n separator: '.',\n decimal: ',',\n precision: 2,\n};\n\nconst getRegex = (precision: number) =>\n new RegExp(`\\\\B(?=(\\\\d{${precision}})(?!\\\\d))`, 'g');\n\nexport const getInternalNumberAndMask = (\n value: string | number,\n options?: CurrencyOptions\n): { internalNumber: number; mergedOptions: CurrencyOptions } => {\n const mergedOptions = { ...DEFAULT_OPTIONS, ...options };\n const { precision = -1 } = mergedOptions;\n\n let internalNumber;\n\n if (typeof value === 'number') {\n if (precision) {\n let stringValue = String(value);\n const decimalIndex = stringValue.indexOf('.');\n const currentPrecision = decimalIndex + precision;\n if (decimalIndex !== -1 && currentPrecision <= stringValue.length) {\n const zeros = stringValue.length + 1 - currentPrecision;\n for (let i = 0; i < zeros; i++) stringValue = stringValue + `0`;\n }\n internalNumber = Number(stringValue);\n } else {\n internalNumber = value;\n }\n } else {\n const onlyNumbers = String(extractNumbersFromString(value));\n const padZeros = String(onlyNumbers).padStart(precision + 1, '0');\n internalNumber = Number(padZeros.replace(getRegex(precision), '.'));\n }\n\n if (internalNumber > Number.MAX_SAFE_INTEGER) {\n internalNumber = Number.MAX_SAFE_INTEGER;\n }\n\n if (internalNumber < Number.MIN_SAFE_INTEGER) {\n internalNumber = Number.MIN_SAFE_INTEGER;\n }\n\n return {\n internalNumber,\n mergedOptions,\n };\n};\n\n/**\n * TODO:\n * @param options\n * @param defaultValue\n * @returns\n */\nexport const useNumberMask = (\n options?: CurrencyOptions,\n defaultValue?: string | number\n): [MaskValue, (value: string | number) => void] => {\n const applyMask = useCallback(\n (value: string | number = 0): MaskValue => {\n const { internalNumber, mergedOptions } = getInternalNumberAndMask(\n value,\n options\n );\n\n return {\n raw: internalNumber,\n formatted: currency(internalNumber).format(mergedOptions),\n };\n },\n [options, getRegex]\n );\n\n const [value, setValue] = useState<MaskValue>(applyMask(defaultValue));\n\n const handleChangeValue = useCallback(\n (formattedValue: string | number) => {\n const { raw, formatted } = applyMask(formattedValue);\n setValue({\n raw,\n formatted,\n });\n },\n [applyMask, setValue]\n );\n\n return [value, handleChangeValue];\n};\n"],"file":"useNumberMask.js"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.useStringMask = exports.getMask = exports.mergeMask = void 0;
7
5
 
8
6
  var _react = require("react");
@@ -91,12 +89,12 @@ const useStringMask = (mask, defaultValue) => {
91
89
  formatted
92
90
  };
93
91
  }, [mask]);
94
- const [value, setValue] = (0, _react.useState)(applyMask(defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.toString()));
92
+ const [value, setValue] = (0, _react.useState)(applyMask(defaultValue == null ? void 0 : defaultValue.toString()));
95
93
  const handleChangeValue = (0, _react.useCallback)(formattedValue => {
96
94
  const {
97
95
  raw,
98
96
  formatted
99
- } = applyMask(formattedValue === null || formattedValue === void 0 ? void 0 : formattedValue.toString());
97
+ } = applyMask(formattedValue == null ? void 0 : formattedValue.toString());
100
98
  setValue({
101
99
  raw,
102
100
  formatted
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/atoms/Input/hooks/useStringMask.ts"],"names":["mergeMask","value","mask","formatted","raw","iMask","iChars","length","maskChar","valueChar","rawValueChar","maskCharRegex","Array","isArray","matchRegex","RegExp","test","getMask","newValue","maskArray","regexArray","forEach","exp","push","i","useStringMask","defaultValue","applyMask","selectedMask","setValue","toString","handleChangeValue","formattedValue"],"mappings":";;;;;;;AAAA;;AAeO,MAAMA,SAAS,GAAG,CAACC,KAAK,GAAG,EAAT,EAAaC,IAAb,KAA6C;AACpE,MAAIC,SAAS,GAAG,EAAhB;AACA,MAAIC,GAAG,GAAG,EAAV;AACA,MAAIC,KAAK,GAAG,CAAZ;AACA,MAAIC,MAAM,GAAG,CAAb;;AAEA,SAAO,EAAED,KAAK,KAAKH,IAAI,CAACK,MAAf,IAAyBD,MAAM,KAAKL,KAAK,CAACM,MAA5C,CAAP,EAA4D;AAC1D,UAAMC,QAAQ,GAAGN,IAAI,CAACG,KAAD,CAArB;AACA,UAAMI,SAAS,GAAGR,KAAK,CAACK,MAAD,CAAvB;;AAEA,QAAIE,QAAQ,KAAKC,SAAjB,EAA4B;AAC1BN,MAAAA,SAAS,IAAIK,QAAb;AACAF,MAAAA,MAAM;AACND,MAAAA,KAAK;AACL;AACD;;AAED,UA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AAEPD,MAAAA;AAFO,KAAD,CAAR;AAID,GAPuB,EAQxB,CAACwB,SAAD,EAAYE,QAAZ,CARwB,CAA1B;AAWA,SAAO,CAAC5B,KAAD,EAAQ8B,iBAAR,CAAP;AACD,CAjCM","sourcesContent":["import { useCallback, useState } from 'react';\n\nexport interface MaskValue {\n formatted?: string;\n raw?: string | number;\n}\n\nexport type MaskType = string | RegExp | Array<RegExp>;\n\n/**\n * TODO:\n * @param value\n * @param mask\n * @returns\n */\nexport const mergeMask = (value = '', mask: MaskType[]): MaskValue => {\n let formatted = '';\n let raw = '';\n let iMask = 0;\n let iChars = 0;\n\n while (!(iMask === mask.length || iChars === value.length)) {\n const maskChar = mask[iMask];\n const valueChar = value[iChars];\n\n if (maskChar === valueChar) {\n formatted += maskChar;\n iChars++;\n iMask++;\n continue;\n }\n\n const rawValueChar = value[iChars];\n\n if (typeof maskChar === 'object') {\n iChars++;\n\n const maskCharRegex = Array.isArray(maskChar) ? maskChar[0] : maskChar;\n const matchRegex = RegExp(maskCharRegex).test(valueChar);\n\n if (matchRegex) {\n formatted += valueChar;\n raw += rawValueChar;\n iMask++;\n }\n } else {\n formatted += maskChar;\n iMask++;\n }\n }\n\n return { raw, formatted };\n};\n\nexport const getMask = (\n mask: MaskType[] | ((value: string) => MaskType[]),\n newValue: string\n): MaskType[] => {\n let maskArray: MaskType[];\n const regexArray: MaskType[] = [];\n\n if (typeof mask === 'function') {\n maskArray = mask(newValue);\n } else {\n maskArray = mask;\n }\n\n maskArray.forEach(exp => {\n if (typeof exp !== 'string') {\n if (Array.isArray(exp)) regexArray.push(exp);\n else regexArray.push(exp);\n } else {\n for (let i = 0; i < exp.length; i++) {\n if (exp[i] === '\\\\') {\n regexArray.push(exp[i + 1]);\n i++;\n } else {\n if (exp[i] === '9') regexArray.push(/\\d/);\n else if (exp[i] === 'a') regexArray.push(/[a-zA-Z]/);\n else regexArray.push(exp[i]);\n }\n }\n }\n });\n\n return regexArray;\n};\n\n/**\n * TODO:\n * @param mask\n * @param defaultValue\n * @returns\n */\nexport const useStringMask = (\n mask: MaskType[] | ((value: string) => MaskType[]),\n defaultValue?: string | number\n): [MaskValue, (text: string | number) => void] => {\n const applyMask = useCallback(\n (value = ''): MaskValue => {\n const selectedMask = getMask(mask, value);\n const { formatted, raw } = mergeMask(value, selectedMask);\n\n return {\n raw,\n formatted,\n };\n },\n [mask]\n );\n\n const [value, setValue] = useState<MaskValue>(\n applyMask(defaultValue?.toString())\n );\n\n const handleChangeValue = useCallback(\n (formattedValue: string | number) => {\n const { raw, formatted } = applyMask(formattedValue?.toString());\n setValue({\n raw,\n formatted,\n });\n },\n [applyMask, setValue]\n );\n\n return [value, handleChangeValue];\n};\n"],"file":"useStringMask.js"}
1
+ {"version":3,"sources":["../../../../../src/components/atoms/Input/hooks/useStringMask.ts"],"names":["mergeMask","value","mask","formatted","raw","iMask","iChars","length","maskChar","valueChar","rawValueChar","maskCharRegex","Array","isArray","matchRegex","RegExp","test","getMask","newValue","maskArray","regexArray","forEach","exp","push","i","useStringMask","defaultValue","applyMask","selectedMask","setValue","toString","handleChangeValue","formattedValue"],"mappings":";;;;;AAAA;;AAeO,MAAMA,SAAS,GAAG,CAACC,KAAK,GAAG,EAAT,EAAaC,IAAb,KAA6C;AACpE,MAAIC,SAAS,GAAG,EAAhB;AACA,MAAIC,GAAG,GAAG,EAAV;AACA,MAAIC,KAAK,GAAG,CAAZ;AACA,MAAIC,MAAM,GAAG,CAAb;;AAEA,SAAO,EAAED,KAAK,KAAKH,IAAI,CAACK,MAAf,IAAyBD,MAAM,KAAKL,KAAK,CAACM,MAA5C,CAAP,EAA4D;AAC1D,UAAMC,QAAQ,GAAGN,IAAI,CAACG,KAAD,CAArB;AACA,UAAMI,SAAS,GAAGR,KAAK,CAACK,MAAD,CAAvB;;AAEA,QAAIE,QAAQ,KAAKC,SAAjB,EAA4B;AAC1BN,MAAAA,SAAS,IAAIK,QAAb;AACAF,MAAAA,MAAM;AACND,MAAAA,KAAK;AACL;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AA;AAFO,KAAD,CAAR;AAID,GAPuB,EAQxB,CAACwB,SAAD,EAAYE,QAAZ,CARwB,CAA1B;AAWA,SAAO,CAAC5B,KAAD,EAAQ8B,iBAAR,CAAP;AACD,CAjCM","sourcesContent":["import { useCallback, useState } from 'react';\n\nexport interface MaskValue {\n formatted?: string;\n raw?: string | number;\n}\n\nexport type MaskType = string | RegExp | Array<RegExp>;\n\n/**\n * TODO:\n * @param value\n * @param mask\n * @returns\n */\nexport const mergeMask = (value = '', mask: MaskType[]): MaskValue => {\n let formatted = '';\n let raw = '';\n let iMask = 0;\n let iChars = 0;\n\n while (!(iMask === mask.length || iChars === value.length)) {\n const maskChar = mask[iMask];\n const valueChar = value[iChars];\n\n if (maskChar === valueChar) {\n formatted += maskChar;\n iChars++;\n iMask++;\n continue;\n }\n\n const rawValueChar = value[iChars];\n\n if (typeof maskChar === 'object') {\n iChars++;\n\n const maskCharRegex = Array.isArray(maskChar) ? maskChar[0] : maskChar;\n const matchRegex = RegExp(maskCharRegex).test(valueChar);\n\n if (matchRegex) {\n formatted += valueChar;\n raw += rawValueChar;\n iMask++;\n }\n } else {\n formatted += maskChar;\n iMask++;\n }\n }\n\n return { raw, formatted };\n};\n\nexport const getMask = (\n mask: MaskType[] | ((value: string) => MaskType[]),\n newValue: string\n): MaskType[] => {\n let maskArray: MaskType[];\n const regexArray: MaskType[] = [];\n\n if (typeof mask === 'function') {\n maskArray = mask(newValue);\n } else {\n maskArray = mask;\n }\n\n maskArray.forEach(exp => {\n if (typeof exp !== 'string') {\n if (Array.isArray(exp)) regexArray.push(exp);\n else regexArray.push(exp);\n } else {\n for (let i = 0; i < exp.length; i++) {\n if (exp[i] === '\\\\') {\n regexArray.push(exp[i + 1]);\n i++;\n } else {\n if (exp[i] === '9') regexArray.push(/\\d/);\n else if (exp[i] === 'a') regexArray.push(/[a-zA-Z]/);\n else regexArray.push(exp[i]);\n }\n }\n }\n });\n\n return regexArray;\n};\n\n/**\n * TODO:\n * @param mask\n * @param defaultValue\n * @returns\n */\nexport const useStringMask = (\n mask: MaskType[] | ((value: string) => MaskType[]),\n defaultValue?: string | number\n): [MaskValue, (text: string | number) => void] => {\n const applyMask = useCallback(\n (value = ''): MaskValue => {\n const selectedMask = getMask(mask, value);\n const { formatted, raw } = mergeMask(value, selectedMask);\n\n return {\n raw,\n formatted,\n };\n },\n [mask]\n );\n\n const [value, setValue] = useState<MaskValue>(\n applyMask(defaultValue?.toString())\n );\n\n const handleChangeValue = useCallback(\n (formattedValue: string | number) => {\n const { raw, formatted } = applyMask(formattedValue?.toString());\n setValue({\n raw,\n formatted,\n });\n },\n [applyMask, setValue]\n );\n\n return [value, handleChangeValue];\n};\n"],"file":"useStringMask.js"}
@@ -4,5 +4,6 @@ export * from './hooks/useNumberMask';
4
4
  export * from './hooks/useStringMask';
5
5
  export { default as InputContainer, InputContainerProps, InputVariantType, } from './InputContainer/InputContainer';
6
6
  export { default as InputElement, InputElementProps, } from './InputElement/InputElement';
7
+ export { default as InputMaskElement, InputMaskElementProps, } from './InputMaskElement/InputMaskElement';
7
8
  export { PressableInputContainer, PressableInputContainerProps, } from './PressableInputContainer';
8
9
  export { StyledBorderKeeper, disabledInputStyles } from './styled';
@@ -1,95 +1,33 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  var _exportNames = {
7
5
  Hint: true,
8
6
  InputContainer: true,
7
+ InputElement: true,
8
+ InputMaskElement: true,
9
9
  InputContainerProps: true,
10
10
  InputVariantType: true,
11
- InputElement: true,
12
11
  InputElementProps: true,
12
+ InputMaskElementProps: true,
13
13
  PressableInputContainer: true,
14
14
  PressableInputContainerProps: true,
15
15
  StyledBorderKeeper: true,
16
16
  disabledInputStyles: true
17
17
  };
18
- Object.defineProperty(exports, "Hint", {
19
- enumerable: true,
20
- get: function () {
21
- return _Hint.default;
22
- }
23
- });
24
- Object.defineProperty(exports, "InputContainer", {
25
- enumerable: true,
26
- get: function () {
27
- return _InputContainer.default;
28
- }
29
- });
30
- Object.defineProperty(exports, "InputContainerProps", {
31
- enumerable: true,
32
- get: function () {
33
- return _InputContainer.InputContainerProps;
34
- }
35
- });
36
- Object.defineProperty(exports, "InputVariantType", {
37
- enumerable: true,
38
- get: function () {
39
- return _InputContainer.InputVariantType;
40
- }
41
- });
42
- Object.defineProperty(exports, "InputElement", {
43
- enumerable: true,
44
- get: function () {
45
- return _InputElement.default;
46
- }
47
- });
48
- Object.defineProperty(exports, "InputElementProps", {
49
- enumerable: true,
50
- get: function () {
51
- return _InputElement.InputElementProps;
52
- }
53
- });
54
- Object.defineProperty(exports, "PressableInputContainer", {
55
- enumerable: true,
56
- get: function () {
57
- return _PressableInputContainer.PressableInputContainer;
58
- }
59
- });
60
- Object.defineProperty(exports, "PressableInputContainerProps", {
61
- enumerable: true,
62
- get: function () {
63
- return _PressableInputContainer.PressableInputContainerProps;
64
- }
65
- });
66
- Object.defineProperty(exports, "StyledBorderKeeper", {
67
- enumerable: true,
68
- get: function () {
69
- return _styled.StyledBorderKeeper;
70
- }
71
- });
72
- Object.defineProperty(exports, "disabledInputStyles", {
73
- enumerable: true,
74
- get: function () {
75
- return _styled.disabledInputStyles;
76
- }
77
- });
18
+ exports.disabledInputStyles = exports.StyledBorderKeeper = exports.PressableInputContainerProps = exports.PressableInputContainer = exports.InputMaskElementProps = exports.InputElementProps = exports.InputVariantType = exports.InputContainerProps = exports.InputMaskElement = exports.InputElement = exports.InputContainer = exports.Hint = void 0;
78
19
 
79
20
  var _Hint = _interopRequireDefault(require("./Hint"));
80
21
 
22
+ exports.Hint = _Hint.default;
23
+
81
24
  var _useInputFocus = require("./hooks/useInputFocus");
82
25
 
83
26
  Object.keys(_useInputFocus).forEach(function (key) {
84
27
  if (key === "default" || key === "__esModule") return;
85
28
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
86
29
  if (key in exports && exports[key] === _useInputFocus[key]) return;
87
- Object.defineProperty(exports, key, {
88
- enumerable: true,
89
- get: function () {
90
- return _useInputFocus[key];
91
- }
92
- });
30
+ exports[key] = _useInputFocus[key];
93
31
  });
94
32
 
95
33
  var _useNumberMask = require("./hooks/useNumberMask");
@@ -98,12 +36,7 @@ Object.keys(_useNumberMask).forEach(function (key) {
98
36
  if (key === "default" || key === "__esModule") return;
99
37
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
100
38
  if (key in exports && exports[key] === _useNumberMask[key]) return;
101
- Object.defineProperty(exports, key, {
102
- enumerable: true,
103
- get: function () {
104
- return _useNumberMask[key];
105
- }
106
- });
39
+ exports[key] = _useNumberMask[key];
107
40
  });
108
41
 
109
42
  var _useStringMask = require("./hooks/useStringMask");
@@ -112,22 +45,35 @@ Object.keys(_useStringMask).forEach(function (key) {
112
45
  if (key === "default" || key === "__esModule") return;
113
46
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
114
47
  if (key in exports && exports[key] === _useStringMask[key]) return;
115
- Object.defineProperty(exports, key, {
116
- enumerable: true,
117
- get: function () {
118
- return _useStringMask[key];
119
- }
120
- });
48
+ exports[key] = _useStringMask[key];
121
49
  });
122
50
 
123
51
  var _InputContainer = _interopRequireWildcard(require("./InputContainer/InputContainer"));
124
52
 
53
+ exports.InputContainer = _InputContainer.default;
54
+ exports.InputContainerProps = _InputContainer.InputContainerProps;
55
+ exports.InputVariantType = _InputContainer.InputVariantType;
56
+
125
57
  var _InputElement = _interopRequireWildcard(require("./InputElement/InputElement"));
126
58
 
59
+ exports.InputElement = _InputElement.default;
60
+ exports.InputElementProps = _InputElement.InputElementProps;
61
+
62
+ var _InputMaskElement = _interopRequireWildcard(require("./InputMaskElement/InputMaskElement"));
63
+
64
+ exports.InputMaskElement = _InputMaskElement.default;
65
+ exports.InputMaskElementProps = _InputMaskElement.InputMaskElementProps;
66
+
127
67
  var _PressableInputContainer = require("./PressableInputContainer");
128
68
 
69
+ exports.PressableInputContainer = _PressableInputContainer.PressableInputContainer;
70
+ exports.PressableInputContainerProps = _PressableInputContainer.PressableInputContainerProps;
71
+
129
72
  var _styled = require("./styled");
130
73
 
74
+ exports.StyledBorderKeeper = _styled.StyledBorderKeeper;
75
+ exports.disabledInputStyles = _styled.disabledInputStyles;
76
+
131
77
  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); }
132
78
 
133
79
  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; }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Input/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAKA;;AAIA;;AAIA","sourcesContent":["export { default as Hint } from './Hint';\nexport * from './hooks/useInputFocus';\nexport * from './hooks/useNumberMask';\nexport * from './hooks/useStringMask';\nexport {\n default as InputContainer,\n InputContainerProps,\n InputVariantType,\n} from './InputContainer/InputContainer';\nexport {\n default as InputElement,\n InputElementProps,\n} from './InputElement/InputElement';\nexport {\n PressableInputContainer,\n PressableInputContainerProps,\n} from './PressableInputContainer';\nexport { StyledBorderKeeper, disabledInputStyles } from './styled';\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/Input/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;;;;;AAKA;;;;;AAIA;;;;;AAIA;;;;;AAIA","sourcesContent":["export { default as Hint } from './Hint';\nexport * from './hooks/useInputFocus';\nexport * from './hooks/useNumberMask';\nexport * from './hooks/useStringMask';\nexport {\n default as InputContainer,\n InputContainerProps,\n InputVariantType,\n} from './InputContainer/InputContainer';\nexport {\n default as InputElement,\n InputElementProps,\n} from './InputElement/InputElement';\nexport {\n default as InputMaskElement,\n InputMaskElementProps,\n} from './InputMaskElement/InputMaskElement';\nexport {\n PressableInputContainer,\n PressableInputContainerProps,\n} from './PressableInputContainer';\nexport { StyledBorderKeeper, disabledInputStyles } from './styled';\n"],"file":"index.js"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.StyledHintIcon = exports.StyledHintContainer = exports.StyledInputElement = exports.StyledBorderKeeper = exports.StyledLabelContainer = exports.StyledInputElementBase = exports.StyledInputContainer = exports.StyledIconContent = exports.disabledInputStyles = void 0;
7
5
 
8
6
  var _native = _interopRequireWildcard(require("@emotion/native"));
@@ -41,7 +39,7 @@ const disabledInputStyles = ({
41
39
  disabled,
42
40
  theme
43
41
  }) => disabled && (0, _native.css)`
44
- color: ${theme === null || theme === void 0 ? void 0 : theme.color.secondary.light};
42
+ color: ${theme == null ? void 0 : theme.color.secondary.light};
45
43
  `;
46
44
 
47
45
  exports.disabledInputStyles = disabledInputStyles;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Input/styled.ts"],"names":["leftIconStyles","leftComponent","theme","spacing","centi","rightIconStyles","rightComponent","disabledContainerStyles","disabled","disabledInputStyles","color","secondary","light","focusedStyles","focused","borderColor","borderWidth","nano","dark","StyledIconContent","styled","View","zIndex","default","StyledInputContainer","StyledInputElementBase","TextInput","font","stack","typography","base","fontSize","weight","bold","StyledLabelContainer","props","micro","StyledBorderKeeperBase","miscellaneous","surfaceColor","borderColorGradation","borderRadius","mili","pico","StyledBorderKeeper","StyledInputElement","StyledHintContainer","StyledHintIcon","Icon"],"mappings":";;;;;;;AAAA;;AACA;;AAGA;;AACA;;;;;;AAGA,MAAMA,cAAc,GAAG,CAAC;AACtBC,EAAAA,aADsB;AAEtBC,EAAAA;AAFsB,CAAD,KAIrB,CAACD,aAAD,IACA,gBAAI;AACN,oBAAoBC,KAAK,CAACC,OAAN,CAAcC,KAAM;AACxC,GAPA;;AASA,MAAMC,eAAe,GAAG,CAAC;AACvBC,EAAAA,cADuB;AAEvBJ,EAAAA;AAFuB,CAAD,KAItB,CAACI,cAAD,IACA,gBAAI;AACN,qBAAqBJ,KAAK,CAACC,OAAN,CAAcC,KAAM;AACzC,GAPA;;AASA,MAAMG,uBAAuB,GAAG,CAAC;AAC/BC,EAAAA;AAD+B,CAAD,KAG9BA,QAAQ,IACR,gBAAI;AACN;AACA,GANA;;AAQO,MAAMC,mBAAmB,GAAG,CAAC;AAClCD,EAAAA,QADkC;AAElCN,EAAAA;AAFkC,CAAD,KAIjCM,QAAQ,IACR,gBAAI;AACN,aAAaN,KADR,aACQA,KADR,uBACQA,KAAK,CAAEQ,KAAP,CAAaC,SAAb,CAAuBC,KAAM;AAC1C,GAPO;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AC7B,GARoC,CAA7B;;;AAWP,MAAME,sBAAsB,GAAGjB,gBAAOC,IAEpC;AACF,sBAAsB,CAAC;AAAEnB,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACoC,aAAN,CAAoBC,YAAa;AACtE,kBAAkB,CAAC;AACfrC,EAAAA,KADe;AAEfa,EAAAA,WAAW,GAAG,WAFC;AAGfyB,EAAAA,oBAAoB,GAAG;AAHR,CAAD,KAIVtC,KAAK,CAACQ,KAAN,CAAYK,WAAZ,EAAyByB,oBAAzB,CAA+C;AACvD,mBAAmB,CAAC;AAAEtC,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACuC,YAAN,CAAmBC,IAAK;AAC1D,kBAAkB,CAAC;AAAExC,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACc,WAAN,CAAkB2B,IAAK;AACxD;AACA;AACA;AACA,CAdA;AAgBO,MAAMC,kBAAkB,GAAG,qBAAOP,sBAAP,EAGhCF,KAAK,IAAI,gBAAI;AACf,MAAMtB,aAAa,CAACsB,KAAD,CAAQ;AAC3B,MAAM5B,uBAAuB,CAAC4B,KAAD,CAAQ;AACrC,GANkC,CAA3B;;AASA,MAAMU,kBAAkB,GAAG,qBAAOpB,sBAAP,EAGhCU,KAAK,IAAI,gBAAI;AACf,MAAM1B,mBAAmB,CAAC0B,KAAD,CAAQ;AACjC,GALkC,CAA3B;;AAQA,MAAMW,mBAAmB,GAAG1B,gBAAOC,IAA0B;AACpE,gBAAgB,CAAC;AAAEnB,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACC,OAAN,CAAciC,KAAM;AACnD;AACA;AACA,CAJO;;AAMA,MAAMW,cAAc,GAAG,qBAAOC,UAAP,CAAkC;AAChE,kBAAkB,CAAC;AAAE9C,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACC,OAAN,CAAciC,KAAM;AACrD,CAFO","sourcesContent":["import styled, { css } from '@emotion/native';\nimport { TextInput } from 'react-native';\nimport { InputElementProps } from '.';\nimport { StyleProps } from '../../../types/defaults';\nimport { RFValueStr } from '../../../utils';\nimport { Icon } from '../Icon';\nimport { InputContainerProps } from './InputContainer/InputContainer';\n\nconst leftIconStyles = ({\n leftComponent,\n theme,\n}: Partial<InputContainerProps> & StyleProps) =>\n !leftComponent &&\n css`\n padding-left: ${theme.spacing.centi};\n `;\n\nconst rightIconStyles = ({\n rightComponent,\n theme,\n}: Partial<InputContainerProps> & StyleProps) =>\n !rightComponent &&\n css`\n padding-right: ${theme.spacing.centi};\n `;\n\nconst disabledContainerStyles = ({\n disabled,\n}: Partial<InputContainerProps> & StyleProps) =>\n disabled &&\n css`\n background-color: transparent;\n `;\n\nexport const disabledInputStyles = ({\n disabled,\n theme,\n}: Partial<InputContainerProps> & Partial<StyleProps>) =>\n disabled &&\n css`\n color: ${theme?.color.secondary.light};\n `;\n\nconst focusedStyles = ({\n focused,\n borderColor = 'secondary',\n theme,\n}: Partial<InputContainerProps> & StyleProps) =>\n focused &&\n css`\n border-width: ${theme.borderWidth.nano};\n border-color: ${theme.color[borderColor].dark};\n `;\n\nexport const StyledIconContent = styled.View<Partial<StyleProps>>`\n z-index: ${({ theme }) => theme.zIndex.default};\n flex-direction: row;\n align-items: center;\n`;\n\nexport const StyledInputContainer = styled.View<\n Partial<InputContainerProps> & Partial<StyleProps>\n>`\n flex-direction: row;\n align-items: center;\n min-height: ${RFValueStr('44px')};\n`;\n\nexport const StyledInputElementBase = styled(TextInput)<\n InputElementProps & Partial<StyleProps>\n>`\n font-family: ${({ theme }) => `'${theme.font.stack.default}'`};\n font-size: ${({ theme }) => theme.typography.base.fontSize};\n font-weight: ${({ theme }) => theme.font.weight.bold};\n color: ${({ theme }) => theme.font.color.dark};\n`;\n\nexport const StyledLabelContainer = styled.View<\n Partial<InputContainerProps> & Partial<StyleProps>\n>(\n props => css`\n flex: 1;\n padding: ${props.theme.spacing.micro} 0;\n ${leftIconStyles(props)}\n ${rightIconStyles(props)}\n `\n);\n\nconst StyledBorderKeeperBase = styled.View<\n Partial<InputContainerProps> & Partial<StyleProps>\n>`\n background-color: ${({ theme }) => theme.miscellaneous.surfaceColor};\n border-color: ${({\n theme,\n borderColor = 'secondary',\n borderColorGradation = 'light',\n }) => theme.color[borderColor][borderColorGradation]};\n border-radius: ${({ theme }) => theme.borderRadius.mili};\n border-width: ${({ theme }) => theme.borderWidth.pico};\n position: absolute;\n width: 100%;\n height: 100%;\n`;\n\nexport const StyledBorderKeeper = styled(StyledBorderKeeperBase)<\n Partial<StyleProps>\n>(\n props => css`\n ${focusedStyles(props)}\n ${disabledContainerStyles(props)}\n `\n);\n\nexport const StyledInputElement = styled(StyledInputElementBase)<\n InputElementProps & Partial<StyleProps>\n>(\n props => css`\n ${disabledInputStyles(props)}\n `\n);\n\nexport const StyledHintContainer = styled.View<Partial<StyleProps>>`\n margin-top: ${({ theme }) => theme.spacing.micro};\n flex-direction: row;\n align-items: center;\n`;\n\nexport const StyledHintIcon = styled(Icon)<Partial<StyleProps>>`\n margin-right: ${({ theme }) => theme.spacing.micro};\n`;\n"],"file":"styled.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/Input/styled.ts"],"names":["leftIconStyles","leftComponent","theme","spacing","centi","rightIconStyles","rightComponent","disabledContainerStyles","disabled","disabledInputStyles","color","secondary","light","focusedStyles","focused","borderColor","borderWidth","nano","dark","StyledIconContent","styled","View","zIndex","default","StyledInputContainer","StyledInputElementBase","TextInput","font","stack","typography","base","fontSize","weight","bold","StyledLabelContainer","props","micro","StyledBorderKeeperBase","miscellaneous","surfaceColor","borderColorGradation","borderRadius","mili","pico","StyledBorderKeeper","StyledInputElement","StyledHintContainer","StyledHintIcon","Icon"],"mappings":";;;;;AAAA;;AACA;;AAGA;;AACA;;;;;;AAGA,MAAMA,cAAc,GAAG,CAAC;AACtBC,EAAAA,aADsB;AAEtBC,EAAAA;AAFsB,CAAD,KAIrB,CAACD,aAAD,IACA,gBAAI;AACN,oBAAoBC,KAAK,CAACC,OAAN,CAAcC,KAAM;AACxC,GAPA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,EAGhCU,KAAK,IAAI,gBAAI;AACf,MAAM1B,mBAAmB,CAAC0B,KAAD,CAAQ;AACjC,GALkC,CAA3B;;AAQA,MAAMW,mBAAmB,GAAG1B,gBAAOC,IAA0B;AACpE,gBAAgB,CAAC;AAAEnB,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACC,OAAN,CAAciC,KAAM;AACnD;AACA;AACA,CAJO;;AAMA,MAAMW,cAAc,GAAG,qBAAOC,UAAP,CAAkC;AAChE,kBAAkB,CAAC;AAAE9C,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACC,OAAN,CAAciC,KAAM;AACrD,CAFO","sourcesContent":["import styled, { css } from '@emotion/native';\nimport { TextInput } from 'react-native';\nimport { InputElementProps } from '.';\nimport { StyleProps } from '../../../types/defaults';\nimport { RFValueStr } from '../../../utils';\nimport { Icon } from '../Icon';\nimport { InputContainerProps } from './InputContainer/InputContainer';\n\nconst leftIconStyles = ({\n leftComponent,\n theme,\n}: Partial<InputContainerProps> & StyleProps) =>\n !leftComponent &&\n css`\n padding-left: ${theme.spacing.centi};\n `;\n\nconst rightIconStyles = ({\n rightComponent,\n theme,\n}: Partial<InputContainerProps> & StyleProps) =>\n !rightComponent &&\n css`\n padding-right: ${theme.spacing.centi};\n `;\n\nconst disabledContainerStyles = ({\n disabled,\n}: Partial<InputContainerProps> & StyleProps) =>\n disabled &&\n css`\n background-color: transparent;\n `;\n\nexport const disabledInputStyles = ({\n disabled,\n theme,\n}: Partial<InputContainerProps> & Partial<StyleProps>) =>\n disabled &&\n css`\n color: ${theme?.color.secondary.light};\n `;\n\nconst focusedStyles = ({\n focused,\n borderColor = 'secondary',\n theme,\n}: Partial<InputContainerProps> & StyleProps) =>\n focused &&\n css`\n border-width: ${theme.borderWidth.nano};\n border-color: ${theme.color[borderColor].dark};\n `;\n\nexport const StyledIconContent = styled.View<Partial<StyleProps>>`\n z-index: ${({ theme }) => theme.zIndex.default};\n flex-direction: row;\n align-items: center;\n`;\n\nexport const StyledInputContainer = styled.View<\n Partial<InputContainerProps> & Partial<StyleProps>\n>`\n flex-direction: row;\n align-items: center;\n min-height: ${RFValueStr('44px')};\n`;\n\nexport const StyledInputElementBase = styled(TextInput)<\n InputElementProps & Partial<StyleProps>\n>`\n font-family: ${({ theme }) => `'${theme.font.stack.default}'`};\n font-size: ${({ theme }) => theme.typography.base.fontSize};\n font-weight: ${({ theme }) => theme.font.weight.bold};\n color: ${({ theme }) => theme.font.color.dark};\n`;\n\nexport const StyledLabelContainer = styled.View<\n Partial<InputContainerProps> & Partial<StyleProps>\n>(\n props => css`\n flex: 1;\n padding: ${props.theme.spacing.micro} 0;\n ${leftIconStyles(props)}\n ${rightIconStyles(props)}\n `\n);\n\nconst StyledBorderKeeperBase = styled.View<\n Partial<InputContainerProps> & Partial<StyleProps>\n>`\n background-color: ${({ theme }) => theme.miscellaneous.surfaceColor};\n border-color: ${({\n theme,\n borderColor = 'secondary',\n borderColorGradation = 'light',\n }) => theme.color[borderColor][borderColorGradation]};\n border-radius: ${({ theme }) => theme.borderRadius.mili};\n border-width: ${({ theme }) => theme.borderWidth.pico};\n position: absolute;\n width: 100%;\n height: 100%;\n`;\n\nexport const StyledBorderKeeper = styled(StyledBorderKeeperBase)<\n Partial<StyleProps>\n>(\n props => css`\n ${focusedStyles(props)}\n ${disabledContainerStyles(props)}\n `\n);\n\nexport const StyledInputElement = styled(StyledInputElementBase)<\n InputElementProps & Partial<StyleProps>\n>(\n props => css`\n ${disabledInputStyles(props)}\n `\n);\n\nexport const StyledHintContainer = styled.View<Partial<StyleProps>>`\n margin-top: ${({ theme }) => theme.spacing.micro};\n flex-direction: row;\n align-items: center;\n`;\n\nexport const StyledHintIcon = styled(Icon)<Partial<StyleProps>>`\n margin-right: ${({ theme }) => theme.spacing.micro};\n`;\n"],"file":"styled.js"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.default = void 0;
7
5
 
8
6
  var _react = _interopRequireDefault(require("react"));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Paper/Paper.tsx"],"names":["Paper","children","elevated","rest"],"mappings":";;;;;;;AAAA;;AAEA;;;;;;AAQA,MAAMA,KAAqB,GAAG,CAAC;AAC7BC,EAAAA,QAD6B;AAE7BC,EAAAA,QAAQ,GAAG,KAFkB;AAG7B,KAAGC;AAH0B,CAAD,KAK5B,6BAAC,mBAAD,eAAiBA,IAAjB;AAAuB,EAAA,QAAQ,EAAED;AAAjC,IACGD,QADH,CALF;;eAUeD,K","sourcesContent":["import React, { FC } from 'react';\nimport { StyleProp, ViewStyle } from 'react-native';\nimport { StyledPaper } from './styled';\n\nexport interface PaperProps {\n /** Creates elevation shadow */\n elevated?: boolean;\n style?: StyleProp<ViewStyle>;\n}\n\nconst Paper: FC<PaperProps> = ({\n children,\n elevated = false,\n ...rest\n}): JSX.Element => (\n <StyledPaper {...rest} elevated={elevated}>\n {children}\n </StyledPaper>\n);\n\nexport default Paper;\n"],"file":"Paper.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/Paper/Paper.tsx"],"names":["Paper","children","elevated","rest"],"mappings":";;;;;AAAA;;AAEA;;;;;;AAQA,MAAMA,KAAqB,GAAG,CAAC;AAC7BC,EAAAA,QAD6B;AAE7BC,EAAAA,QAAQ,GAAG,KAFkB;AAG7B,KAAGC;AAH0B,CAAD,KAK5B,6BAAC,mBAAD,eAAiBA,IAAjB;AAAuB,EAAA,QAAQ,EAAED;AAAjC,IACGD,QADH,CALF;;eAUeD,K","sourcesContent":["import React, { FC } from 'react';\nimport { StyleProp, ViewStyle } from 'react-native';\nimport { StyledPaper } from './styled';\n\nexport interface PaperProps {\n /** Creates elevation shadow */\n elevated?: boolean;\n style?: StyleProp<ViewStyle>;\n}\n\nconst Paper: FC<PaperProps> = ({\n children,\n elevated = false,\n ...rest\n}): JSX.Element => (\n <StyledPaper {...rest} elevated={elevated}>\n {children}\n </StyledPaper>\n);\n\nexport default Paper;\n"],"file":"Paper.js"}
@@ -1,23 +1,13 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "Paper", {
7
- enumerable: true,
8
- get: function () {
9
- return _Paper.default;
10
- }
11
- });
12
- Object.defineProperty(exports, "PaperProps", {
13
- enumerable: true,
14
- get: function () {
15
- return _Paper.PaperProps;
16
- }
17
- });
3
+ exports.__esModule = true;
4
+ exports.PaperProps = exports.Paper = void 0;
18
5
 
19
6
  var _Paper = _interopRequireWildcard(require("./Paper"));
20
7
 
8
+ exports.Paper = _Paper.default;
9
+ exports.PaperProps = _Paper.PaperProps;
10
+
21
11
  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
12
 
23
13
  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; }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Paper/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA","sourcesContent":["export { default as Paper, PaperProps } from './Paper';\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/Paper/index.ts"],"names":[],"mappings":";;;;;AAAA","sourcesContent":["export { default as Paper, PaperProps } from './Paper';\n"],"file":"index.js"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.StyledPaper = void 0;
7
5
 
8
6
  var _reactNative = require("react-native");
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Paper/styled.ts"],"names":["StyledPaper","Animated","View","props"],"mappings":";;;;;;;AAAA;;AACA;;AAGA;;;;;;AAEO,MAAMA,WAAW,GAAG,qBAAOC,sBAASC,IAAhB,EAGzBC,KAAK,IAAI,gBAAI;AACf,MAAM,8BAAWA,KAAX,CAAkB;AACxB,MAAM,kCAAeA,KAAf,CAAsB;AAC5B,GAN2B,CAApB","sourcesContent":["import { Animated } from 'react-native';\nimport styled, { css } from '@emotion/native';\nimport { StyleProps } from '@tecsinapse/react-core';\nimport { PaperProps } from './Paper';\nimport { baseStyles, elevatedStyles } from '../shared/PaperAndCard';\n\nexport const StyledPaper = styled(Animated.View)<\n PaperProps & Partial<StyleProps>\n>(\n props => css`\n ${baseStyles(props)}\n ${elevatedStyles(props)}\n `\n);\n"],"file":"styled.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/Paper/styled.ts"],"names":["StyledPaper","Animated","View","props"],"mappings":";;;;;AAAA;;AACA;;AAGA;;;;;;AAEO,MAAMA,WAAW,GAAG,qBAAOC,sBAASC,IAAhB,EAGzBC,KAAK,IAAI,gBAAI;AACf,MAAM,8BAAWA,KAAX,CAAkB;AACxB,MAAM,kCAAeA,KAAf,CAAsB;AAC5B,GAN2B,CAApB","sourcesContent":["import { Animated } from 'react-native';\nimport styled, { css } from '@emotion/native';\nimport { StyleProps } from '@tecsinapse/react-core';\nimport { PaperProps } from './Paper';\nimport { baseStyles, elevatedStyles } from '../shared/PaperAndCard';\n\nexport const StyledPaper = styled(Animated.View)<\n PaperProps & Partial<StyleProps>\n>(\n props => css`\n ${baseStyles(props)}\n ${elevatedStyles(props)}\n `\n);\n"],"file":"styled.js"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.default = void 0;
7
5
 
8
6
  var _react = require("@emotion/react");
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/PressableSurface/PressableSurface.tsx"],"names":["COLOR_VARIATION_FACTOR","PressableSurface","children","surfaceColor","effect","effectIntensity","effectStyle","style","rest","theme","effectBaseColor","miscellaneous","bgColor","readyStyle","prepareStyle","props","effectColor","lighten","darken","composedStyle","backgroundColor","pressed","applyEffectStyle","variation"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;;;;;AAEA,MAAMA,sBAAsB,GAAG,EAA/B;;AASA,MAAMC,gBAA2C,GAAG,CAAC;AACnDC,EAAAA,QADmD;AAEnDC,EAAAA,YAFmD;AAGnDC,EAAAA,MAHmD;AAInDC,EAAAA,eAJmD;AAKnDC,EAAAA,WALmD;AAMnDC,EAAAA,KANmD;AAOnD,KAAGC;AAPgD,CAAD,KAQ9C;AACJ,QAAMC,KAAK,GAAG,sBAAd;AACA,MAAIC,eAAe,GAAGD,KAAK,CAACE,aAAN,CAAoBR,YAA1C;AACA,MAAIS,OAAO,GAAG,aAAd;;AAEA,MAAIT,YAAJ,EAAkB;AAChBO,IAAAA,eAAe,GAAGP,YAAlB;AACAS,IAAAA,OAAO,GAAGF,eAAV;AACD;;AAED,QAAMG,UAAU,GAAGC,YAAY,CAC7B;AAAEV,IAAAA,MAAF;AAAUC,IAAAA,eAAV;AAA2BE,IAAAA,KAA3B;AAAkCD,IAAAA;AAAlC,GAD6B,EAE7BI,eAF6B,EAG7BE,OAH6B,CAA/B;AAKA,SACE,8BAAC,sBAAD,eAAeJ,IAAf;AAAqB,IAAA,KAAK,EAAEK;AAA5B,MACGX,QADH,CADF;AAKD,CA5BD;;AA8BA,MAAMY,YAAY,GAAG,CACnBC,KADmB,EAEnBC,WAFmB,EAGnBJ,OAHmB,KAIX;AACR,QAAM;AACJR,IAAAA,MAAM,GAAG,QADL;AAEJC,IAAAA,eAAe,GAAGL,sBAFd;AAGJO,IAAAA,KAHI;AAIJD,IAAAA;AAJI,MAKFS,KALJ;AAOA,QAAME,OAAO,GAAG,+BAAmBD,WAAnB,EAAgCX,eAAhC,CAAhB;AACA,QAAMa,MAAM,GAAG,+BAAmBF,WAAnB,EAAgC,CAACX,eAAjC,CAAf;AACA,QAAMc,aAAa,GAAG,CAAC;AAAEC,IAAAA,eAAe,EAAER;AAAnB,GAAD,EAA+BL,KAA/B,CAAtB;;AAEA,MAAID,WAAJ,EAAiB;AACf,WAAO,CAAC;AAAEe,MAAAA;AAAF,KAAD,KAAiB,CAACF,aAAD,EAAgBb,WAAW,CAACe,OAAD,CAA3B,CAAxB;AACD;;AAED,UAAQjB,MAAR;AACE,SAAK,QAAL;AACE,aAAOkB,gBAAgB,CAACH,aAAD,EAAgBD,MAAhB,CAAvB;;AAEF,SAAK,SAAL;AACE,aAAOI,gBAAgB,CAACH,aAAD,EAAgBF,OAAhB,CAAvB;;AAEF,SAAK,MAAL;AACE,aAAOE,aAAP;AARJ;AAUD,CA9BD;;AAgCA,MAAMG,gBAAgB,GAAG,CAACf,KAAD,EAAagB,SAAb,KAAmC;AAC1D,SAAO,CAAC;AAAEF,IAAAA;AAAF,GAAD,KAAiB,CAACd,KAAD,EAAQc,OAAO,IAAI;AAAED,IAAAA,eAAe,EAAEG;AAAnB,GAAnB,CAAxB;AACD,CAFD;;eAIetB,gB","sourcesContent":["import { useTheme } from '@emotion/react';\nimport React, { FC } from 'react';\nimport { Pressable, PressableProps, StyleProp, ViewStyle } from 'react-native';\nimport { ThemeProp } from '../../../types/defaults';\nimport { lightenDarkenColor } from '../../../utils';\n\nconst COLOR_VARIATION_FACTOR = 25;\n\nexport interface PressableSurfaceProps extends PressableProps {\n effect?: 'darken' | 'lighten' | 'none';\n surfaceColor?: string;\n effectIntensity?: number;\n effectStyle?: (pressed: boolean) => StyleProp<ViewStyle>;\n}\n\nconst PressableSurface: FC<PressableSurfaceProps> = ({\n children,\n surfaceColor,\n effect,\n effectIntensity,\n effectStyle,\n style,\n ...rest\n}) => {\n const theme = useTheme() as ThemeProp;\n let effectBaseColor = theme.miscellaneous.surfaceColor;\n let bgColor = 'transparent';\n\n if (surfaceColor) {\n effectBaseColor = surfaceColor;\n bgColor = effectBaseColor;\n }\n\n const readyStyle = prepareStyle(\n { effect, effectIntensity, style, effectStyle },\n effectBaseColor,\n bgColor\n );\n return (\n <Pressable {...rest} style={readyStyle}>\n {children}\n </Pressable>\n );\n};\n\nconst prepareStyle = (\n props: PressableSurfaceProps,\n effectColor: string,\n bgColor: string\n): any => {\n const {\n effect = 'darken',\n effectIntensity = COLOR_VARIATION_FACTOR,\n style,\n effectStyle,\n } = props;\n\n const lighten = lightenDarkenColor(effectColor, effectIntensity);\n const darken = lightenDarkenColor(effectColor, -effectIntensity);\n const composedStyle = [{ backgroundColor: bgColor }, style];\n\n if (effectStyle) {\n return ({ pressed }) => [composedStyle, effectStyle(pressed)];\n }\n\n switch (effect) {\n case 'darken':\n return applyEffectStyle(composedStyle, darken);\n\n case 'lighten':\n return applyEffectStyle(composedStyle, lighten);\n\n case 'none':\n return composedStyle;\n }\n};\n\nconst applyEffectStyle = (style: any, variation: string) => {\n return ({ pressed }) => [style, pressed && { backgroundColor: variation }];\n};\n\nexport default PressableSurface;\n"],"file":"PressableSurface.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/PressableSurface/PressableSurface.tsx"],"names":["COLOR_VARIATION_FACTOR","PressableSurface","children","surfaceColor","effect","effectIntensity","effectStyle","style","rest","theme","effectBaseColor","miscellaneous","bgColor","readyStyle","prepareStyle","props","effectColor","lighten","darken","composedStyle","backgroundColor","pressed","applyEffectStyle","variation"],"mappings":";;;;;AAA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CAAC;AAAEe,MAAAA;AAAF,KAAD,KAAiB,CAACF,aAAD,EAAgBb,WAAW,CAACe,OAAD,CAA3B,CAAxB;AACD;;AAED,UAAQjB,MAAR;AACE,SAAK,QAAL;AACE,aAAOkB,gBAAgB,CAACH,aAAD,EAAgBD,MAAhB,CAAvB;;AAEF,SAAK,SAAL;AACE,aAAOI,gBAAgB,CAACH,aAAD,EAAgBF,OAAhB,CAAvB;;AAEF,SAAK,MAAL;AACE,aAAOE,aAAP;AARJ;AAUD,CA9BD;;AAgCA,MAAMG,gBAAgB,GAAG,CAACf,KAAD,EAAagB,SAAb,KAAmC;AAC1D,SAAO,CAAC;AAAEF,IAAAA;AAAF,GAAD,KAAiB,CAACd,KAAD,EAAQc,OAAO,IAAI;AAAED,IAAAA,eAAe,EAAEG;AAAnB,GAAnB,CAAxB;AACD,CAFD;;eAIetB,gB","sourcesContent":["import { useTheme } from '@emotion/react';\nimport React, { FC } from 'react';\nimport { Pressable, PressableProps, StyleProp, ViewStyle } from 'react-native';\nimport { ThemeProp } from '../../../types/defaults';\nimport { lightenDarkenColor } from '../../../utils';\n\nconst COLOR_VARIATION_FACTOR = 25;\n\nexport interface PressableSurfaceProps extends PressableProps {\n effect?: 'darken' | 'lighten' | 'none';\n surfaceColor?: string;\n effectIntensity?: number;\n effectStyle?: (pressed: boolean) => StyleProp<ViewStyle>;\n}\n\nconst PressableSurface: FC<PressableSurfaceProps> = ({\n children,\n surfaceColor,\n effect,\n effectIntensity,\n effectStyle,\n style,\n ...rest\n}) => {\n const theme = useTheme() as ThemeProp;\n let effectBaseColor = theme.miscellaneous.surfaceColor;\n let bgColor = 'transparent';\n\n if (surfaceColor) {\n effectBaseColor = surfaceColor;\n bgColor = effectBaseColor;\n }\n\n const readyStyle = prepareStyle(\n { effect, effectIntensity, style, effectStyle },\n effectBaseColor,\n bgColor\n );\n return (\n <Pressable {...rest} style={readyStyle}>\n {children}\n </Pressable>\n );\n};\n\nconst prepareStyle = (\n props: PressableSurfaceProps,\n effectColor: string,\n bgColor: string\n): any => {\n const {\n effect = 'darken',\n effectIntensity = COLOR_VARIATION_FACTOR,\n style,\n effectStyle,\n } = props;\n\n const lighten = lightenDarkenColor(effectColor, effectIntensity);\n const darken = lightenDarkenColor(effectColor, -effectIntensity);\n const composedStyle = [{ backgroundColor: bgColor }, style];\n\n if (effectStyle) {\n return ({ pressed }) => [composedStyle, effectStyle(pressed)];\n }\n\n switch (effect) {\n case 'darken':\n return applyEffectStyle(composedStyle, darken);\n\n case 'lighten':\n return applyEffectStyle(composedStyle, lighten);\n\n case 'none':\n return composedStyle;\n }\n};\n\nconst applyEffectStyle = (style: any, variation: string) => {\n return ({ pressed }) => [style, pressed && { backgroundColor: variation }];\n};\n\nexport default PressableSurface;\n"],"file":"PressableSurface.js"}
@@ -1,23 +1,13 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "PressableSurface", {
7
- enumerable: true,
8
- get: function () {
9
- return _PressableSurface.default;
10
- }
11
- });
12
- Object.defineProperty(exports, "PressableSurfaceProps", {
13
- enumerable: true,
14
- get: function () {
15
- return _PressableSurface.PressableSurfaceProps;
16
- }
17
- });
3
+ exports.__esModule = true;
4
+ exports.PressableSurfaceProps = exports.PressableSurface = void 0;
18
5
 
19
6
  var _PressableSurface = _interopRequireWildcard(require("./PressableSurface"));
20
7
 
8
+ exports.PressableSurface = _PressableSurface.default;
9
+ exports.PressableSurfaceProps = _PressableSurface.PressableSurfaceProps;
10
+
21
11
  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
12
 
23
13
  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; }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/PressableSurface/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA","sourcesContent":["export {\n default as PressableSurface,\n PressableSurfaceProps,\n} from './PressableSurface';\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/PressableSurface/index.ts"],"names":[],"mappings":";;;;;AAAA","sourcesContent":["export {\n default as PressableSurface,\n PressableSurfaceProps,\n} from './PressableSurface';\n"],"file":"index.js"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.default = void 0;
7
5
 
8
6
  var _react = require("@emotion/react");
@@ -45,8 +43,6 @@ const ProgressBar = ({
45
43
  let progressPercent = `${width}%`;
46
44
 
47
45
  if (animate && animationParameters) {
48
- var _animationValue$inter;
49
-
50
46
  _reactNative.Animated.timing(animationValue, {
51
47
  toValue: 1,
52
48
  duration: animationParameters.duration / items.length,
@@ -54,8 +50,8 @@ const ProgressBar = ({
54
50
  delay: animationParameters.direction === 'right' ? index * (animationParameters.duration / items.length) : (items.length - index - 1) * (animationParameters.duration / items.length)
55
51
  }).start();
56
52
 
57
- const rangeAnimation = (animationParameters === null || animationParameters === void 0 ? void 0 : animationParameters.direction) === 'right' ? [`${valueMin < 0 ? 0 : valueMin}%`, `${width}%`] : [`${valueMax}%`, `${width}%`];
58
- progressPercent = (_animationValue$inter = animationValue.interpolate) === null || _animationValue$inter === void 0 ? void 0 : _animationValue$inter.call(animationValue, {
53
+ const rangeAnimation = (animationParameters == null ? void 0 : animationParameters.direction) === 'right' ? [`${valueMin < 0 ? 0 : valueMin}%`, `${width}%`] : [`${valueMax}%`, `${width}%`];
54
+ progressPercent = animationValue.interpolate == null ? void 0 : animationValue.interpolate({
59
55
  inputRange: [0, 1],
60
56
  outputRange: rangeAnimation
61
57
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/ProgressBar/ProgressBar.tsx"],"names":["ProgressBar","segments","_segments","valueMin","valueNow","_valueNow","valueMax","color","colorTone","animate","animationParameters","rest","theme","totalProgress","Math","max","segmentWidth","items","Array","keys","segmentsRender","map","index","animationValue","React","useRef","Animated","Value","current","min","minmax","width","progressPercent","timing","toValue","duration","length","useNativeDriver","delay","direction","start","rangeAnimation","interpolate","inputRange","outputRange","borderRightWidth","backgroundColor"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAMA;;AACA;;;;;;AAqBA,MAAMA,WAAuC,GAAG,CAAC;AAC/CC,EAAAA,QAAQ,EAAEC,SAAS,GAAG,CADyB;AAE/CC,EAAAA,QAAQ,GAAG,CAFoC;AAG/CC,EAAAA,QAAQ,EAAEC,SAHqC;AAI/CC,EAAAA,QAAQ,GAAG,GAJoC;AAK/CC,EAAAA,KAAK,GAAG,SALuC;AAM/CC,EAAAA,SAAS,GAAG,QANmC;AAO/CC,EAAAA,OAP+C;AAQ/CC,EAAAA,mBAR+C;AAS/C,KAAGC;AAT4C,CAAD,KAU1C;AACJ,QAAMC,KAAK,GAAG,sBAAd;AAEA,QAAMR,QAAQ,GACZ,OAAOC,SAAP,KAAqB,QAArB,GACI,qCAAyBA,SAAzB,CADJ,GAEIA,SAHN;AAKA,QAAMQ,aAAa,GAAI,CAACT,QAAQ,GAAGD,QAAZ,KAAyBG,QAAQ,GAAGH,QAApC,CAAD,GAAk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AuB,CAAxB,KACCZ,mBAAmB,CAACyB,QAApB,GAA+BlB,KAAK,CAACmB,MADtC;AAPwB,OAAhC,EASGI,KATH;;AAWA,YAAMC,cAAc,GAClB,CAAA/B,mBAAmB,SAAnB,IAAAA,mBAAmB,WAAnB,YAAAA,mBAAmB,CAAE6B,SAArB,MAAmC,OAAnC,GACI,CAAE,GAAEpC,QAAQ,GAAG,CAAX,GAAe,CAAf,GAAmBA,QAAS,GAAhC,EAAqC,GAAE4B,KAAM,GAA7C,CADJ,GAEI,CAAE,GAAEzB,QAAS,GAAb,EAAkB,GAAEyB,KAAM,GAA1B,CAHN;AAKAC,MAAAA,eAAe,4BAAGT,cAAc,CAACmB,WAAlB,0DAAG,2BAAAnB,cAAc,EAAe;AAC7CoB,QAAAA,UAAU,EAAE,CAAC,CAAD,EAAI,CAAJ,CADiC;AAE7CC,QAAAA,WAAW,EAAEH;AAFgC,OAAf,CAAhC;AAID;;AAED,WACE,oBAAC,eAAD;AACE,MAAA,GAAG,EAAEnB,KADP;AAEE,MAAA,KAAK,EAAE;AACLuB,QAAAA,gBAAgB,EAAEvB,KAAK,IAAIrB,QAAQ,GAAG,CAApB,GAAwB,CAAxB,GAA4B;AADzC;AAFT,OAME,oBAAC,gBAAD;AACE,MAAA,KAAK,EAAE;AACL8B,QAAAA,KAAK,EAAEC,eADF;AAELc,QAAAA,eAAe,EAAElC,KAAK,CAACL,KAAN,CAAYA,KAAZ,EAAmBC,SAAnB,CAFZ;AAGLqC,QAAAA,gBAAgB,EAAEd,KAAK,GAAG,CAAR,IAAaA,KAAK,GAAG,GAArB,GAA2B,CAA3B,GAA+B;AAH5C;AADT,MANF,CADF;AAgBD,GAjDsB,CAAvB;AAmDA,SAAO,oBAAC,iBAAD,EAAepB,IAAf,EAAsBS,cAAtB,CAAP;AACD,CA5ED;;eA8EepB,W","sourcesContent":["import { useTheme } from '@emotion/react';\nimport * as React from 'react';\nimport { Animated, ViewProps } from 'react-native';\nimport {\n ColorGradationType,\n ColorType,\n ThemeProp\n} from '../../../types/defaults';\nimport { extractNumbersFromString } from '../../../utils';\nimport { Container, Progress, Segment } from './styled';\n\nexport interface ProgressBarProps extends ViewProps {\n /** Number of segments. Defaults to 1. Set to 1 when 0 or less */\n segments?: number;\n /** Minimum possible value (0% of the bar). Defaults to 0 */\n valueMin?: number;\n /** Maximum possible value (100% of the bar). Defaults to 100 */\n valueMax?: number;\n /** Current value */\n valueNow: number | string;\n /** Filled partition color. Defaults to 'primary' */\n color?: ColorType;\n /** Filled partition color tone. Defaults to 'medium' */\n colorTone?: ColorGradationType;\n /** Animation */\n animate: boolean;\n /** Parameters animation */\n animationParameters?: { direction: 'left' | 'right'; duration: number };\n}\n\nconst ProgressBar: React.FC<ProgressBarProps> = ({\n segments: _segments = 1,\n valueMin = 0,\n valueNow: _valueNow,\n valueMax = 100,\n color = 'primary',\n colorTone = 'medium',\n animate,\n animationParameters,\n ...rest\n}) => {\n const theme = useTheme() as ThemeProp;\n\n const valueNow =\n typeof _valueNow === 'string'\n ? extractNumbersFromString(_valueNow)\n : _valueNow;\n\n const totalProgress = ((valueNow - valueMin) / (valueMax - valueMin)) * 100;\n const segments = Math.max(1, _segments);\n const segmentWidth = 100 / Math.max(segments);\n\n const items = [...Array(segments).keys()];\n\n const segmentsRender = items.map(index => {\n const animationValue = React.useRef(new Animated.Value(0)).current;\n\n const max = segmentWidth * (index + 1);\n const min = segmentWidth * index;\n const minmax = (totalProgress - min) / (max - min);\n const width = (minmax > 1 ? 1 : minmax < 0 ? 0 : minmax) * 100;\n\n let progressPercent: string | Animated.AnimatedInterpolation = `${width}%`;\n\n if (animate && animationParameters) {\n Animated.timing(animationValue, {\n toValue: 1,\n duration: animationParameters.duration / items.length,\n useNativeDriver: false,\n delay:\n animationParameters.direction === 'right'\n ? index * (animationParameters.duration / items.length)\n : (items.length - index - 1) *\n (animationParameters.duration / items.length),\n }).start();\n\n const rangeAnimation =\n animationParameters?.direction === 'right'\n ? [`${valueMin < 0 ? 0 : valueMin}%`, `${width}%`]\n : [`${valueMax}%`, `${width}%`];\n\n progressPercent = animationValue.interpolate?.({\n inputRange: [0, 1],\n outputRange: rangeAnimation,\n });\n }\n\n return (\n <Segment\n key={index}\n style={{\n borderRightWidth: index == segments - 1 ? 0 : 2,\n }}\n >\n <Progress\n style={{\n width: progressPercent,\n backgroundColor: theme.color[color][colorTone],\n borderRightWidth: width > 0 && width < 100 ? 2 : 0,\n }}\n />\n </Segment>\n );\n });\n\n return <Container {...rest}>{segmentsRender}</Container>;\n};\n\nexport default ProgressBar;\n"],"file":"ProgressBar.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/ProgressBar/ProgressBar.tsx"],"names":["ProgressBar","segments","_segments","valueMin","valueNow","_valueNow","valueMax","color","colorTone","animate","animationParameters","rest","theme","totalProgress","Math","max","segmentWidth","items","Array","keys","segmentsRender","map","index","animationValue","React","useRef","Animated","Value","current","min","minmax","width","progressPercent","timing","toValue","duration","length","useNativeDriver","delay","direction","start","rangeAnimation","interpolate","inputRange","outputRange","borderRightWidth","backgroundColor"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAMA;;AACA;;;;;;AAqBA,MAAMA,WAAuC,GAAG,CAAC;AAC/CC,EAAAA,QAAQ,EAAEC,SAAS,GAAG,CADyB;AAE/CC,EAAAA,QAAQ,GAAG,CAFoC;AAG/CC,EAAAA,QAAQ,EAAEC,SAHqC;AAI/CC,EAAAA,QAAQ,GAAG,GAJoC;AAK/CC,EAAAA,KAAK,GAAG,SALuC;AAM/CC,EAAAA,SAAS,GAAG,QANmC;AAO/CC,EAAAA,OAP+C;AAQ/CC,EAAAA,mBAR+C;AAS/C,KAAGC;AAT4C,CAAD,KAU1C;AACJ,QAAMC,KAAK,GAAG,sBAAd;AAEA,QAAMR,QAAQ,GACZ,OAAOC,SAAP,KAAqB,QAArB,GACI,qCAAyBA,SAAzB,CADJ,GAEIA,SAHN;AAKA,QAAMQ,aAAa,GAAI,CAACT,QAAQ,GAAGD,QAAZ,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AAK,CAACmB,MAAN,GAAed,KAAf,GAAuB,CAAxB,KACCZ,mBAAmB,CAACyB,QAApB,GAA+BlB,KAAK,CAACmB,MADtC;AAPwB,OAAhC,EASGI,KATH;;AAWA,YAAMC,cAAc,GAClB,CAAA/B,mBAAmB,QAAnB,YAAAA,mBAAmB,CAAE6B,SAArB,MAAmC,OAAnC,GACI,CAAE,GAAEpC,QAAQ,GAAG,CAAX,GAAe,CAAf,GAAmBA,QAAS,GAAhC,EAAqC,GAAE4B,KAAM,GAA7C,CADJ,GAEI,CAAE,GAAEzB,QAAS,GAAb,EAAkB,GAAEyB,KAAM,GAA1B,CAHN;AAKAC,MAAAA,eAAe,GAAGT,cAAc,CAACmB,WAAlB,oBAAGnB,cAAc,CAACmB,WAAf,CAA6B;AAC7CC,QAAAA,UAAU,EAAE,CAAC,CAAD,EAAI,CAAJ,CADiC;AAE7CC,QAAAA,WAAW,EAAEH;AAFgC,OAA7B,CAAlB;AAID;;AAED,WACE,oBAAC,eAAD;AACE,MAAA,GAAG,EAAEnB,KADP;AAEE,MAAA,KAAK,EAAE;AACLuB,QAAAA,gBAAgB,EAAEvB,KAAK,IAAIrB,QAAQ,GAAG,CAApB,GAAwB,CAAxB,GAA4B;AADzC;AAFT,OAME,oBAAC,gBAAD;AACE,MAAA,KAAK,EAAE;AACL8B,QAAAA,KAAK,EAAEC,eADF;AAELc,QAAAA,eAAe,EAAElC,KAAK,CAACL,KAAN,CAAYA,KAAZ,EAAmBC,SAAnB,CAFZ;AAGLqC,QAAAA,gBAAgB,EAAEd,KAAK,GAAG,CAAR,IAAaA,KAAK,GAAG,GAArB,GAA2B,CAA3B,GAA+B;AAH5C;AADT,MANF,CADF;AAgBD,GAjDsB,CAAvB;AAmDA,SAAO,oBAAC,iBAAD,EAAepB,IAAf,EAAsBS,cAAtB,CAAP;AACD,CA5ED;;eA8EepB,W","sourcesContent":["import { useTheme } from '@emotion/react';\nimport * as React from 'react';\nimport { Animated, ViewProps } from 'react-native';\nimport {\n ColorGradationType,\n ColorType,\n ThemeProp\n} from '../../../types/defaults';\nimport { extractNumbersFromString } from '../../../utils';\nimport { Container, Progress, Segment } from './styled';\n\nexport interface ProgressBarProps extends ViewProps {\n /** Number of segments. Defaults to 1. Set to 1 when 0 or less */\n segments?: number;\n /** Minimum possible value (0% of the bar). Defaults to 0 */\n valueMin?: number;\n /** Maximum possible value (100% of the bar). Defaults to 100 */\n valueMax?: number;\n /** Current value */\n valueNow: number | string;\n /** Filled partition color. Defaults to 'primary' */\n color?: ColorType;\n /** Filled partition color tone. Defaults to 'medium' */\n colorTone?: ColorGradationType;\n /** Animation */\n animate: boolean;\n /** Parameters animation */\n animationParameters?: { direction: 'left' | 'right'; duration: number };\n}\n\nconst ProgressBar: React.FC<ProgressBarProps> = ({\n segments: _segments = 1,\n valueMin = 0,\n valueNow: _valueNow,\n valueMax = 100,\n color = 'primary',\n colorTone = 'medium',\n animate,\n animationParameters,\n ...rest\n}) => {\n const theme = useTheme() as ThemeProp;\n\n const valueNow =\n typeof _valueNow === 'string'\n ? extractNumbersFromString(_valueNow)\n : _valueNow;\n\n const totalProgress = ((valueNow - valueMin) / (valueMax - valueMin)) * 100;\n const segments = Math.max(1, _segments);\n const segmentWidth = 100 / Math.max(segments);\n\n const items = [...Array(segments).keys()];\n\n const segmentsRender = items.map(index => {\n const animationValue = React.useRef(new Animated.Value(0)).current;\n\n const max = segmentWidth * (index + 1);\n const min = segmentWidth * index;\n const minmax = (totalProgress - min) / (max - min);\n const width = (minmax > 1 ? 1 : minmax < 0 ? 0 : minmax) * 100;\n\n let progressPercent: string | Animated.AnimatedInterpolation = `${width}%`;\n\n if (animate && animationParameters) {\n Animated.timing(animationValue, {\n toValue: 1,\n duration: animationParameters.duration / items.length,\n useNativeDriver: false,\n delay:\n animationParameters.direction === 'right'\n ? index * (animationParameters.duration / items.length)\n : (items.length - index - 1) *\n (animationParameters.duration / items.length),\n }).start();\n\n const rangeAnimation =\n animationParameters?.direction === 'right'\n ? [`${valueMin < 0 ? 0 : valueMin}%`, `${width}%`]\n : [`${valueMax}%`, `${width}%`];\n\n progressPercent = animationValue.interpolate?.({\n inputRange: [0, 1],\n outputRange: rangeAnimation,\n });\n }\n\n return (\n <Segment\n key={index}\n style={{\n borderRightWidth: index == segments - 1 ? 0 : 2,\n }}\n >\n <Progress\n style={{\n width: progressPercent,\n backgroundColor: theme.color[color][colorTone],\n borderRightWidth: width > 0 && width < 100 ? 2 : 0,\n }}\n />\n </Segment>\n );\n });\n\n return <Container {...rest}>{segmentsRender}</Container>;\n};\n\nexport default ProgressBar;\n"],"file":"ProgressBar.js"}
@@ -1,23 +1,13 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "ProgressBar", {
7
- enumerable: true,
8
- get: function () {
9
- return _ProgressBar.default;
10
- }
11
- });
12
- Object.defineProperty(exports, "ProgressBarProps", {
13
- enumerable: true,
14
- get: function () {
15
- return _ProgressBar.ProgressBarProps;
16
- }
17
- });
3
+ exports.__esModule = true;
4
+ exports.ProgressBarProps = exports.ProgressBar = void 0;
18
5
 
19
6
  var _ProgressBar = _interopRequireWildcard(require("./ProgressBar"));
20
7
 
8
+ exports.ProgressBar = _ProgressBar.default;
9
+ exports.ProgressBarProps = _ProgressBar.ProgressBarProps;
10
+
21
11
  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
12
 
23
13
  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; }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/ProgressBar/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA","sourcesContent":["export { default as ProgressBar, ProgressBarProps } from './ProgressBar';\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/ProgressBar/index.ts"],"names":[],"mappings":";;;;;AAAA","sourcesContent":["export { default as ProgressBar, ProgressBarProps } from './ProgressBar';\n"],"file":"index.js"}