@hedia/recommendation-screen 2.1.73 → 2.1.74-alpha.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 (408) hide show
  1. package/lib/commonjs/RecommendationScreen.js +768 -0
  2. package/lib/commonjs/RecommendationScreen.js.map +1 -0
  3. package/lib/commonjs/assets/IconsSVG/Close.js +20 -0
  4. package/lib/commonjs/assets/IconsSVG/Close.js.map +1 -0
  5. package/lib/commonjs/assets/IconsSVG/CloseOutlined.js +28 -0
  6. package/lib/commonjs/assets/IconsSVG/CloseOutlined.js.map +1 -0
  7. package/lib/commonjs/assets/IconsSVG/Edit.js +23 -0
  8. package/lib/commonjs/assets/IconsSVG/Edit.js.map +1 -0
  9. package/lib/commonjs/assets/IconsSVG/activity/Cycling.js +43 -0
  10. package/lib/commonjs/assets/IconsSVG/activity/Cycling.js.map +1 -0
  11. package/lib/commonjs/assets/IconsSVG/activity/Running.js +33 -0
  12. package/lib/commonjs/assets/IconsSVG/activity/Running.js.map +1 -0
  13. package/lib/commonjs/assets/IconsSVG/activity/Stretching.js +33 -0
  14. package/lib/commonjs/assets/IconsSVG/activity/Stretching.js.map +1 -0
  15. package/lib/commonjs/assets/IconsSVG/activity/Swimming.js +48 -0
  16. package/lib/commonjs/assets/IconsSVG/activity/Swimming.js.map +1 -0
  17. package/lib/commonjs/assets/IconsSVG/activity/Walking.js +38 -0
  18. package/lib/commonjs/assets/IconsSVG/activity/Walking.js.map +1 -0
  19. package/lib/commonjs/assets/IconsSVG/mood/Happy.js +34 -0
  20. package/lib/commonjs/assets/IconsSVG/mood/Happy.js.map +1 -0
  21. package/lib/commonjs/assets/IconsSVG/mood/Neutral.js +34 -0
  22. package/lib/commonjs/assets/IconsSVG/mood/Neutral.js.map +1 -0
  23. package/lib/commonjs/assets/IconsSVG/mood/Sad.js +34 -0
  24. package/lib/commonjs/assets/IconsSVG/mood/Sad.js.map +1 -0
  25. package/lib/commonjs/assets/IconsSVG/mood/SemiHappy.js +34 -0
  26. package/lib/commonjs/assets/IconsSVG/mood/SemiHappy.js.map +1 -0
  27. package/lib/commonjs/assets/IconsSVG/mood/SemiSad.js +34 -0
  28. package/lib/commonjs/assets/IconsSVG/mood/SemiSad.js.map +1 -0
  29. package/lib/commonjs/components/ExitModal.js +124 -0
  30. package/lib/commonjs/components/ExitModal.js.map +1 -0
  31. package/lib/commonjs/components/InfoBars.js +123 -0
  32. package/lib/commonjs/components/InfoBars.js.map +1 -0
  33. package/lib/commonjs/components/InvisibleNumberInput.js +150 -0
  34. package/lib/commonjs/components/InvisibleNumberInput.js.map +1 -0
  35. package/lib/commonjs/components/LineSeparator.js +27 -0
  36. package/lib/commonjs/components/LineSeparator.js.map +1 -0
  37. package/lib/commonjs/components/RecentInsulin.js +105 -0
  38. package/lib/commonjs/components/RecentInsulin.js.map +1 -0
  39. package/lib/commonjs/components/RecommendationModal.js +302 -0
  40. package/lib/commonjs/components/RecommendationModal.js.map +1 -0
  41. package/lib/commonjs/components/RecommendedCarbs.js +289 -0
  42. package/lib/commonjs/components/RecommendedCarbs.js.map +1 -0
  43. package/lib/commonjs/components/RecommendedInsulin.js +208 -0
  44. package/lib/commonjs/components/RecommendedInsulin.js.map +1 -0
  45. package/lib/commonjs/components/Remeasure.js +131 -0
  46. package/lib/commonjs/components/Remeasure.js.map +1 -0
  47. package/lib/commonjs/components/Text.js +25 -0
  48. package/lib/commonjs/components/Text.js.map +1 -0
  49. package/lib/commonjs/components/TimeoutModal.js +113 -0
  50. package/lib/commonjs/components/TimeoutModal.js.map +1 -0
  51. package/lib/commonjs/components/TransferToLogbook.js +83 -0
  52. package/lib/commonjs/components/TransferToLogbook.js.map +1 -0
  53. package/lib/commonjs/components/activity/Activity.js +112 -0
  54. package/lib/commonjs/components/activity/Activity.js.map +1 -0
  55. package/lib/commonjs/components/activity/ActivityIcon.js +86 -0
  56. package/lib/commonjs/components/activity/ActivityIcon.js.map +1 -0
  57. package/lib/commonjs/components/activity/ActivityIntensity.js +65 -0
  58. package/lib/commonjs/components/activity/ActivityIntensity.js.map +1 -0
  59. package/lib/commonjs/components/mood/Emotion.js +86 -0
  60. package/lib/commonjs/components/mood/Emotion.js.map +1 -0
  61. package/lib/commonjs/components/mood/MoodIcon.js +107 -0
  62. package/lib/commonjs/components/mood/MoodIcon.js.map +1 -0
  63. package/lib/commonjs/components/styles/fonts.js +154 -0
  64. package/lib/commonjs/components/styles/fonts.js.map +1 -0
  65. package/lib/commonjs/index.js +21 -0
  66. package/lib/commonjs/index.js.map +1 -0
  67. package/lib/commonjs/locales/da/translations.json +82 -0
  68. package/lib/commonjs/locales/de/translations.json +81 -0
  69. package/lib/commonjs/locales/en/translations.json +84 -0
  70. package/lib/commonjs/locales/es/translations.json +81 -0
  71. package/lib/commonjs/locales/fr/translations.json +81 -0
  72. package/lib/commonjs/locales/it/translations.json +81 -0
  73. package/lib/commonjs/locales/translate.js +63 -0
  74. package/lib/commonjs/locales/translate.js.map +1 -0
  75. package/lib/commonjs/types/enum.js +179 -0
  76. package/lib/commonjs/types/enum.js.map +1 -0
  77. package/lib/commonjs/types/types.js +6 -0
  78. package/lib/commonjs/types/types.js.map +1 -0
  79. package/lib/commonjs/utils/AttentionMessages.js +141 -0
  80. package/lib/commonjs/utils/AttentionMessages.js.map +1 -0
  81. package/lib/commonjs/utils/Constants.js +138 -0
  82. package/lib/commonjs/utils/Constants.js.map +1 -0
  83. package/lib/commonjs/utils/RecommendationError.js +116 -0
  84. package/lib/commonjs/utils/RecommendationError.js.map +1 -0
  85. package/lib/commonjs/utils/RecommendationUtils.js +212 -0
  86. package/lib/commonjs/utils/RecommendationUtils.js.map +1 -0
  87. package/lib/commonjs/utils/Translations.js +22 -0
  88. package/lib/commonjs/utils/Translations.js.map +1 -0
  89. package/lib/commonjs/utils/Utils.js +162 -0
  90. package/lib/commonjs/utils/Utils.js.map +1 -0
  91. package/lib/commonjs/utils/Validations.js +468 -0
  92. package/lib/commonjs/utils/Validations.js.map +1 -0
  93. package/lib/module/RecommendationScreen.js +758 -0
  94. package/lib/module/RecommendationScreen.js.map +1 -0
  95. package/lib/module/assets/IconsSVG/Close.js +11 -0
  96. package/lib/module/assets/IconsSVG/Close.js.map +1 -0
  97. package/lib/module/assets/IconsSVG/CloseOutlined.js +19 -0
  98. package/lib/module/assets/IconsSVG/CloseOutlined.js.map +1 -0
  99. package/lib/module/assets/IconsSVG/Edit.js +14 -0
  100. package/lib/module/assets/IconsSVG/Edit.js.map +1 -0
  101. package/lib/module/assets/IconsSVG/activity/Cycling.js +34 -0
  102. package/lib/module/assets/IconsSVG/activity/Cycling.js.map +1 -0
  103. package/lib/module/assets/IconsSVG/activity/Running.js +24 -0
  104. package/lib/module/assets/IconsSVG/activity/Running.js.map +1 -0
  105. package/lib/module/assets/IconsSVG/activity/Stretching.js +24 -0
  106. package/lib/module/assets/IconsSVG/activity/Stretching.js.map +1 -0
  107. package/lib/module/assets/IconsSVG/activity/Swimming.js +39 -0
  108. package/lib/module/assets/IconsSVG/activity/Swimming.js.map +1 -0
  109. package/lib/module/assets/IconsSVG/activity/Walking.js +29 -0
  110. package/lib/module/assets/IconsSVG/activity/Walking.js.map +1 -0
  111. package/lib/module/assets/IconsSVG/mood/Happy.js +25 -0
  112. package/lib/module/assets/IconsSVG/mood/Happy.js.map +1 -0
  113. package/lib/module/assets/IconsSVG/mood/Neutral.js +25 -0
  114. package/lib/module/assets/IconsSVG/mood/Neutral.js.map +1 -0
  115. package/lib/module/assets/IconsSVG/mood/Sad.js +25 -0
  116. package/lib/module/assets/IconsSVG/mood/Sad.js.map +1 -0
  117. package/lib/module/assets/IconsSVG/mood/SemiHappy.js +25 -0
  118. package/lib/module/assets/IconsSVG/mood/SemiHappy.js.map +1 -0
  119. package/lib/module/assets/IconsSVG/mood/SemiSad.js +25 -0
  120. package/lib/module/assets/IconsSVG/mood/SemiSad.js.map +1 -0
  121. package/lib/module/components/ExitModal.js +114 -0
  122. package/lib/module/components/ExitModal.js.map +1 -0
  123. package/lib/module/components/InfoBars.js +114 -0
  124. package/lib/module/components/InfoBars.js.map +1 -0
  125. package/lib/module/components/InvisibleNumberInput.js +142 -0
  126. package/lib/module/components/InvisibleNumberInput.js.map +1 -0
  127. package/lib/module/components/LineSeparator.js +19 -0
  128. package/lib/module/components/LineSeparator.js.map +1 -0
  129. package/lib/module/components/RecentInsulin.js +97 -0
  130. package/lib/module/components/RecentInsulin.js.map +1 -0
  131. package/lib/module/components/RecommendationModal.js +291 -0
  132. package/lib/module/components/RecommendationModal.js.map +1 -0
  133. package/lib/module/components/RecommendedCarbs.js +281 -0
  134. package/lib/module/components/RecommendedCarbs.js.map +1 -0
  135. package/lib/module/components/RecommendedInsulin.js +200 -0
  136. package/lib/module/components/RecommendedInsulin.js.map +1 -0
  137. package/lib/module/components/Remeasure.js +123 -0
  138. package/lib/module/components/Remeasure.js.map +1 -0
  139. package/lib/module/components/Text.js +16 -0
  140. package/lib/module/components/Text.js.map +1 -0
  141. package/lib/module/components/TimeoutModal.js +103 -0
  142. package/lib/module/components/TimeoutModal.js.map +1 -0
  143. package/lib/module/components/TransferToLogbook.js +75 -0
  144. package/lib/module/components/TransferToLogbook.js.map +1 -0
  145. package/lib/module/components/activity/Activity.js +104 -0
  146. package/lib/module/components/activity/Activity.js.map +1 -0
  147. package/lib/module/components/activity/ActivityIcon.js +78 -0
  148. package/lib/module/components/activity/ActivityIcon.js.map +1 -0
  149. package/lib/module/components/activity/ActivityIntensity.js +57 -0
  150. package/lib/module/components/activity/ActivityIntensity.js.map +1 -0
  151. package/lib/module/components/mood/Emotion.js +78 -0
  152. package/lib/module/components/mood/Emotion.js.map +1 -0
  153. package/lib/module/components/mood/MoodIcon.js +97 -0
  154. package/lib/module/components/mood/MoodIcon.js.map +1 -0
  155. package/lib/module/components/styles/fonts.js +145 -0
  156. package/lib/module/components/styles/fonts.js.map +1 -0
  157. package/lib/module/index.js +5 -0
  158. package/lib/module/index.js.map +1 -0
  159. package/lib/module/locales/da/translations.json +82 -0
  160. package/lib/module/locales/de/translations.json +81 -0
  161. package/lib/module/locales/en/translations.json +84 -0
  162. package/lib/module/locales/es/translations.json +81 -0
  163. package/lib/module/locales/fr/translations.json +81 -0
  164. package/lib/module/locales/it/translations.json +81 -0
  165. package/lib/module/locales/translate.js +55 -0
  166. package/lib/module/locales/translate.js.map +1 -0
  167. package/lib/module/types/enum.js +170 -0
  168. package/lib/module/types/enum.js.map +1 -0
  169. package/lib/module/types/types.js.map +1 -0
  170. package/lib/module/utils/AttentionMessages.js +131 -0
  171. package/lib/module/utils/AttentionMessages.js.map +1 -0
  172. package/{dist/src → lib/module}/utils/Constants.js +78 -35
  173. package/lib/module/utils/Constants.js.map +1 -0
  174. package/{dist/src → lib/module}/utils/RecommendationError.js +28 -6
  175. package/lib/module/utils/RecommendationError.js.map +1 -0
  176. package/{dist/src → lib/module}/utils/RecommendationUtils.js +89 -90
  177. package/lib/module/utils/RecommendationUtils.js.map +1 -0
  178. package/{dist/src → lib/module}/utils/Translations.js +5 -3
  179. package/lib/module/utils/Translations.js.map +1 -0
  180. package/lib/module/utils/Utils.js +155 -0
  181. package/lib/module/utils/Utils.js.map +1 -0
  182. package/{dist/src → lib/module}/utils/Validations.js +155 -128
  183. package/lib/module/utils/Validations.js.map +1 -0
  184. package/{dist/src → lib/typescript}/RecommendationScreen.d.ts +2 -1
  185. package/lib/typescript/RecommendationScreen.d.ts.map +1 -0
  186. package/{dist/src → lib/typescript}/assets/IconsSVG/Close.d.ts +1 -0
  187. package/lib/typescript/assets/IconsSVG/Close.d.ts.map +1 -0
  188. package/{dist/src → lib/typescript}/assets/IconsSVG/CloseOutlined.d.ts +1 -0
  189. package/lib/typescript/assets/IconsSVG/CloseOutlined.d.ts.map +1 -0
  190. package/{dist/src → lib/typescript}/assets/IconsSVG/Edit.d.ts +1 -0
  191. package/lib/typescript/assets/IconsSVG/Edit.d.ts.map +1 -0
  192. package/{dist/src → lib/typescript}/assets/IconsSVG/activity/Cycling.d.ts +1 -0
  193. package/lib/typescript/assets/IconsSVG/activity/Cycling.d.ts.map +1 -0
  194. package/{dist/src → lib/typescript}/assets/IconsSVG/activity/Running.d.ts +1 -0
  195. package/lib/typescript/assets/IconsSVG/activity/Running.d.ts.map +1 -0
  196. package/{dist/src → lib/typescript}/assets/IconsSVG/activity/Stretching.d.ts +1 -0
  197. package/lib/typescript/assets/IconsSVG/activity/Stretching.d.ts.map +1 -0
  198. package/{dist/src → lib/typescript}/assets/IconsSVG/activity/Swimming.d.ts +1 -0
  199. package/lib/typescript/assets/IconsSVG/activity/Swimming.d.ts.map +1 -0
  200. package/{dist/src → lib/typescript}/assets/IconsSVG/activity/Walking.d.ts +1 -0
  201. package/lib/typescript/assets/IconsSVG/activity/Walking.d.ts.map +1 -0
  202. package/{dist/src → lib/typescript}/assets/IconsSVG/mood/Happy.d.ts +1 -0
  203. package/lib/typescript/assets/IconsSVG/mood/Happy.d.ts.map +1 -0
  204. package/{dist/src → lib/typescript}/assets/IconsSVG/mood/Neutral.d.ts +1 -0
  205. package/lib/typescript/assets/IconsSVG/mood/Neutral.d.ts.map +1 -0
  206. package/{dist/src → lib/typescript}/assets/IconsSVG/mood/Sad.d.ts +1 -0
  207. package/lib/typescript/assets/IconsSVG/mood/Sad.d.ts.map +1 -0
  208. package/{dist/src → lib/typescript}/assets/IconsSVG/mood/SemiHappy.d.ts +1 -0
  209. package/lib/typescript/assets/IconsSVG/mood/SemiHappy.d.ts.map +1 -0
  210. package/{dist/src → lib/typescript}/assets/IconsSVG/mood/SemiSad.d.ts +1 -0
  211. package/lib/typescript/assets/IconsSVG/mood/SemiSad.d.ts.map +1 -0
  212. package/{dist/src → lib/typescript}/components/ExitModal.d.ts +1 -0
  213. package/lib/typescript/components/ExitModal.d.ts.map +1 -0
  214. package/{dist/src → lib/typescript}/components/InfoBars.d.ts +1 -0
  215. package/lib/typescript/components/InfoBars.d.ts.map +1 -0
  216. package/{dist/src → lib/typescript}/components/InvisibleNumberInput.d.ts +1 -0
  217. package/lib/typescript/components/InvisibleNumberInput.d.ts.map +1 -0
  218. package/{dist/src → lib/typescript}/components/LineSeparator.d.ts +1 -0
  219. package/lib/typescript/components/LineSeparator.d.ts.map +1 -0
  220. package/{dist/src → lib/typescript}/components/RecentInsulin.d.ts +1 -0
  221. package/lib/typescript/components/RecentInsulin.d.ts.map +1 -0
  222. package/{dist/src → lib/typescript}/components/RecommendationModal.d.ts +1 -0
  223. package/lib/typescript/components/RecommendationModal.d.ts.map +1 -0
  224. package/{dist/src → lib/typescript}/components/RecommendedCarbs.d.ts +1 -0
  225. package/lib/typescript/components/RecommendedCarbs.d.ts.map +1 -0
  226. package/{dist/src → lib/typescript}/components/RecommendedInsulin.d.ts +1 -0
  227. package/lib/typescript/components/RecommendedInsulin.d.ts.map +1 -0
  228. package/{dist/src → lib/typescript}/components/Remeasure.d.ts +1 -0
  229. package/lib/typescript/components/Remeasure.d.ts.map +1 -0
  230. package/{dist/src → lib/typescript}/components/Text.d.ts +1 -0
  231. package/lib/typescript/components/Text.d.ts.map +1 -0
  232. package/{dist/src → lib/typescript}/components/TimeoutModal.d.ts +1 -0
  233. package/lib/typescript/components/TimeoutModal.d.ts.map +1 -0
  234. package/{dist/src → lib/typescript}/components/TransferToLogbook.d.ts +1 -0
  235. package/lib/typescript/components/TransferToLogbook.d.ts.map +1 -0
  236. package/{dist/src → lib/typescript}/components/activity/Activity.d.ts +1 -0
  237. package/lib/typescript/components/activity/Activity.d.ts.map +1 -0
  238. package/{dist/src → lib/typescript}/components/activity/ActivityIcon.d.ts +1 -0
  239. package/lib/typescript/components/activity/ActivityIcon.d.ts.map +1 -0
  240. package/{dist/src → lib/typescript}/components/activity/ActivityIntensity.d.ts +1 -0
  241. package/lib/typescript/components/activity/ActivityIntensity.d.ts.map +1 -0
  242. package/{dist/src → lib/typescript}/components/mood/Emotion.d.ts +1 -0
  243. package/lib/typescript/components/mood/Emotion.d.ts.map +1 -0
  244. package/{dist/src → lib/typescript}/components/mood/MoodIcon.d.ts +1 -0
  245. package/lib/typescript/components/mood/MoodIcon.d.ts.map +1 -0
  246. package/{dist/src → lib/typescript}/components/styles/fonts.d.ts +1 -0
  247. package/lib/typescript/components/styles/fonts.d.ts.map +1 -0
  248. package/lib/typescript/index.d.ts +5 -0
  249. package/lib/typescript/index.d.ts.map +1 -0
  250. package/{dist/src → lib/typescript}/locales/translate.d.ts +1 -0
  251. package/lib/typescript/locales/translate.d.ts.map +1 -0
  252. package/{dist/src → lib/typescript}/types/enum.d.ts +1 -0
  253. package/lib/typescript/types/enum.d.ts.map +1 -0
  254. package/{dist/src → lib/typescript}/types/types.d.ts +1 -0
  255. package/lib/typescript/types/types.d.ts.map +1 -0
  256. package/{dist/src → lib/typescript}/utils/AttentionMessages.d.ts +1 -0
  257. package/lib/typescript/utils/AttentionMessages.d.ts.map +1 -0
  258. package/{dist/src → lib/typescript}/utils/Constants.d.ts +1 -0
  259. package/lib/typescript/utils/Constants.d.ts.map +1 -0
  260. package/{dist/src → lib/typescript}/utils/RecommendationError.d.ts +1 -0
  261. package/lib/typescript/utils/RecommendationError.d.ts.map +1 -0
  262. package/{dist/src → lib/typescript}/utils/RecommendationUtils.d.ts +1 -0
  263. package/lib/typescript/utils/RecommendationUtils.d.ts.map +1 -0
  264. package/{dist/src → lib/typescript}/utils/Translations.d.ts +1 -0
  265. package/lib/typescript/utils/Translations.d.ts.map +1 -0
  266. package/{dist/src → lib/typescript}/utils/Utils.d.ts +1 -0
  267. package/lib/typescript/utils/Utils.d.ts.map +1 -0
  268. package/{dist/src → lib/typescript}/utils/Validations.d.ts +1 -0
  269. package/lib/typescript/utils/Validations.d.ts.map +1 -0
  270. package/package.json +27 -7
  271. package/src/RecommendationScreen.tsx +854 -0
  272. package/src/assets/IconsSVG/Close.tsx +13 -0
  273. package/src/assets/IconsSVG/CloseOutlined.tsx +23 -0
  274. package/src/assets/IconsSVG/Edit.tsx +16 -0
  275. package/src/assets/IconsSVG/activity/Cycling.tsx +41 -0
  276. package/src/assets/IconsSVG/activity/Running.tsx +29 -0
  277. package/src/assets/IconsSVG/activity/Stretching.tsx +29 -0
  278. package/src/assets/IconsSVG/activity/Swimming.tsx +47 -0
  279. package/src/assets/IconsSVG/activity/Walking.tsx +35 -0
  280. package/src/assets/IconsSVG/mood/Happy.tsx +30 -0
  281. package/src/assets/IconsSVG/mood/Neutral.tsx +30 -0
  282. package/src/assets/IconsSVG/mood/Sad.tsx +30 -0
  283. package/src/assets/IconsSVG/mood/SemiHappy.tsx +30 -0
  284. package/src/assets/IconsSVG/mood/SemiSad.tsx +30 -0
  285. package/src/components/ExitModal.tsx +134 -0
  286. package/src/components/InfoBars.tsx +122 -0
  287. package/src/components/InvisibleNumberInput.tsx +170 -0
  288. package/src/components/LineSeparator.tsx +29 -0
  289. package/src/components/RecentInsulin.tsx +109 -0
  290. package/src/components/RecommendationModal.tsx +319 -0
  291. package/src/components/RecommendedCarbs.tsx +303 -0
  292. package/src/components/RecommendedInsulin.tsx +219 -0
  293. package/src/components/Remeasure.tsx +135 -0
  294. package/src/components/Text.tsx +27 -0
  295. package/src/components/TimeoutModal.tsx +121 -0
  296. package/src/components/TransferToLogbook.tsx +92 -0
  297. package/src/components/activity/Activity.tsx +107 -0
  298. package/src/components/activity/ActivityIcon.tsx +77 -0
  299. package/src/components/activity/ActivityIntensity.tsx +67 -0
  300. package/src/components/mood/Emotion.tsx +97 -0
  301. package/src/components/mood/MoodIcon.tsx +91 -0
  302. package/src/components/styles/fonts.ts +145 -0
  303. package/src/index.ts +5 -0
  304. package/src/locales/da/translations.json +82 -0
  305. package/src/locales/de/translations.json +81 -0
  306. package/src/locales/en/translations.json +84 -0
  307. package/src/locales/es/translations.json +81 -0
  308. package/src/locales/fr/translations.json +81 -0
  309. package/src/locales/it/translations.json +81 -0
  310. package/src/locales/translate.ts +62 -0
  311. package/src/types/enum.ts +164 -0
  312. package/src/types/types.ts +19 -0
  313. package/src/utils/AttentionMessages.ts +167 -0
  314. package/src/utils/Constants.ts +77 -0
  315. package/src/utils/RecommendationError.ts +182 -0
  316. package/src/utils/RecommendationUtils.ts +232 -0
  317. package/src/utils/Translations.ts +17 -0
  318. package/src/utils/Utils.ts +156 -0
  319. package/src/utils/Validations.ts +490 -0
  320. package/dist/index.d.ts +0 -5
  321. package/dist/index.js +0 -6
  322. package/dist/index.js.map +0 -1
  323. package/dist/src/RecommendationScreen.js +0 -537
  324. package/dist/src/RecommendationScreen.js.map +0 -1
  325. package/dist/src/assets/IconsSVG/Close.js +0 -7
  326. package/dist/src/assets/IconsSVG/Close.js.map +0 -1
  327. package/dist/src/assets/IconsSVG/CloseOutlined.js +0 -9
  328. package/dist/src/assets/IconsSVG/CloseOutlined.js.map +0 -1
  329. package/dist/src/assets/IconsSVG/Edit.js +0 -8
  330. package/dist/src/assets/IconsSVG/Edit.js.map +0 -1
  331. package/dist/src/assets/IconsSVG/activity/Cycling.js +0 -12
  332. package/dist/src/assets/IconsSVG/activity/Cycling.js.map +0 -1
  333. package/dist/src/assets/IconsSVG/activity/Running.js +0 -10
  334. package/dist/src/assets/IconsSVG/activity/Running.js.map +0 -1
  335. package/dist/src/assets/IconsSVG/activity/Stretching.js +0 -10
  336. package/dist/src/assets/IconsSVG/activity/Stretching.js.map +0 -1
  337. package/dist/src/assets/IconsSVG/activity/Swimming.js +0 -13
  338. package/dist/src/assets/IconsSVG/activity/Swimming.js.map +0 -1
  339. package/dist/src/assets/IconsSVG/activity/Walking.js +0 -11
  340. package/dist/src/assets/IconsSVG/activity/Walking.js.map +0 -1
  341. package/dist/src/assets/IconsSVG/mood/Happy.js +0 -11
  342. package/dist/src/assets/IconsSVG/mood/Happy.js.map +0 -1
  343. package/dist/src/assets/IconsSVG/mood/Neutral.js +0 -11
  344. package/dist/src/assets/IconsSVG/mood/Neutral.js.map +0 -1
  345. package/dist/src/assets/IconsSVG/mood/Sad.js +0 -11
  346. package/dist/src/assets/IconsSVG/mood/Sad.js.map +0 -1
  347. package/dist/src/assets/IconsSVG/mood/SemiHappy.js +0 -11
  348. package/dist/src/assets/IconsSVG/mood/SemiHappy.js.map +0 -1
  349. package/dist/src/assets/IconsSVG/mood/SemiSad.js +0 -11
  350. package/dist/src/assets/IconsSVG/mood/SemiSad.js.map +0 -1
  351. package/dist/src/components/ExitModal.js +0 -91
  352. package/dist/src/components/ExitModal.js.map +0 -1
  353. package/dist/src/components/InfoBars.js +0 -98
  354. package/dist/src/components/InfoBars.js.map +0 -1
  355. package/dist/src/components/InvisibleNumberInput.js +0 -123
  356. package/dist/src/components/InvisibleNumberInput.js.map +0 -1
  357. package/dist/src/components/LineSeparator.js +0 -17
  358. package/dist/src/components/LineSeparator.js.map +0 -1
  359. package/dist/src/components/RecentInsulin.js +0 -90
  360. package/dist/src/components/RecentInsulin.js.map +0 -1
  361. package/dist/src/components/RecommendationModal.js +0 -241
  362. package/dist/src/components/RecommendationModal.js.map +0 -1
  363. package/dist/src/components/RecommendedCarbs.js +0 -234
  364. package/dist/src/components/RecommendedCarbs.js.map +0 -1
  365. package/dist/src/components/RecommendedInsulin.js +0 -166
  366. package/dist/src/components/RecommendedInsulin.js.map +0 -1
  367. package/dist/src/components/Remeasure.js +0 -103
  368. package/dist/src/components/Remeasure.js.map +0 -1
  369. package/dist/src/components/Text.js +0 -14
  370. package/dist/src/components/Text.js.map +0 -1
  371. package/dist/src/components/TimeoutModal.js +0 -84
  372. package/dist/src/components/TimeoutModal.js.map +0 -1
  373. package/dist/src/components/TransferToLogbook.js +0 -68
  374. package/dist/src/components/TransferToLogbook.js.map +0 -1
  375. package/dist/src/components/activity/Activity.js +0 -93
  376. package/dist/src/components/activity/Activity.js.map +0 -1
  377. package/dist/src/components/activity/ActivityIcon.js +0 -66
  378. package/dist/src/components/activity/ActivityIcon.js.map +0 -1
  379. package/dist/src/components/activity/ActivityIntensity.js +0 -55
  380. package/dist/src/components/activity/ActivityIntensity.js.map +0 -1
  381. package/dist/src/components/mood/Emotion.js +0 -69
  382. package/dist/src/components/mood/Emotion.js.map +0 -1
  383. package/dist/src/components/mood/MoodIcon.js +0 -68
  384. package/dist/src/components/mood/MoodIcon.js.map +0 -1
  385. package/dist/src/components/styles/fonts.js +0 -145
  386. package/dist/src/components/styles/fonts.js.map +0 -1
  387. package/dist/src/locales/da/translations.json +0 -82
  388. package/dist/src/locales/de/translations.json +0 -81
  389. package/dist/src/locales/en/translations.json +0 -84
  390. package/dist/src/locales/es/translations.json +0 -81
  391. package/dist/src/locales/fr/translations.json +0 -81
  392. package/dist/src/locales/it/translations.json +0 -81
  393. package/dist/src/locales/translate.js +0 -53
  394. package/dist/src/locales/translate.js.map +0 -1
  395. package/dist/src/types/enum.js +0 -154
  396. package/dist/src/types/enum.js.map +0 -1
  397. package/dist/src/types/types.js.map +0 -1
  398. package/dist/src/utils/AttentionMessages.js +0 -123
  399. package/dist/src/utils/AttentionMessages.js.map +0 -1
  400. package/dist/src/utils/Constants.js.map +0 -1
  401. package/dist/src/utils/RecommendationError.js.map +0 -1
  402. package/dist/src/utils/RecommendationUtils.js.map +0 -1
  403. package/dist/src/utils/Translations.js.map +0 -1
  404. package/dist/src/utils/Utils.js +0 -142
  405. package/dist/src/utils/Utils.js.map +0 -1
  406. package/dist/src/utils/Validations.js.map +0 -1
  407. package/dist/tsconfig.tsbuildinfo +0 -1
  408. /package/{dist/src → lib/module}/types/types.js +0 -0
@@ -0,0 +1,114 @@
1
+ import React from "react";
2
+ import { StyleSheet, View } from "react-native";
3
+ import { BloodGlucoseUnit, BloodKetonesUnit } from "@hedia/types";
4
+ import { t } from "../locales/translate";
5
+ import { colors } from "../utils/Constants";
6
+ import { Utils } from "../utils/Utils";
7
+ import { FONTS } from "./styles/fonts";
8
+ import Text from "./Text";
9
+ /** A standard panel to display some data that the user entered. */
10
+ export default class InfoBars extends React.Component {
11
+ /**
12
+ * Determine the value to be displayed in the infobar.
13
+ *
14
+ * Steps:
15
+ * 1. Unpack showNullAsDash, unit, and value from props.
16
+ * 2. Set noDecimal to be true if unit is BloodGlucoseUnit.MG_DL or if unit is BloodKetonesUnit.MG_DL.
17
+ * 3. Set nullPlaceholder to be ‘-' if noDecimal is true and to '-.-’ otherwise.
18
+ * 4. Return value if it is not null or undefined. Otherwise, if showNullAsDash is true then return nullPlaceholder, otherwise return the string '0'.
19
+ * @returns The string to display as the value in the infobar.
20
+ */
21
+ displayValue = () => {
22
+ const {
23
+ showNullAsDash,
24
+ unit,
25
+ value
26
+ } = this.props;
27
+ const noDecimal = unit === BloodGlucoseUnit.MG_DL || unit === BloodKetonesUnit.MG_DL;
28
+ const nullPlaceholder = noDecimal || !unit ? `-` : `-.-`;
29
+ return value ?? (showNullAsDash ? nullPlaceholder : `0`);
30
+ };
31
+
32
+ /**
33
+ * Determine the unit string to be displayed in the infobar.
34
+ *
35
+ * Steps:
36
+ * 1. Unpack unit from props.
37
+ * 2. Return unit if unit is “units” or the result of calling formatUnit() with unit as argument otherwise.
38
+ * @returns The string to display as the unit in the infobar
39
+ */
40
+ displayUnit = () => {
41
+ const {
42
+ unit
43
+ } = this.props;
44
+ if (!unit) {
45
+ return null;
46
+ }
47
+ return unit === t(`units`) ? unit : Utils.formatUnit(unit);
48
+ };
49
+
50
+ /**
51
+ * @returns JSX element to display a card with the entered value.
52
+ */
53
+ render() {
54
+ const {
55
+ testID
56
+ } = this.props;
57
+ return /*#__PURE__*/React.createElement(View, {
58
+ style: infoStyles.container
59
+ }, /*#__PURE__*/React.createElement(View, {
60
+ style: infoStyles.labelContainer
61
+ }, /*#__PURE__*/React.createElement(Text, {
62
+ style: infoStyles.label
63
+ }, this.props.label)), /*#__PURE__*/React.createElement(View, {
64
+ style: infoStyles.valueUnitContainer
65
+ }, /*#__PURE__*/React.createElement(Text, {
66
+ style: infoStyles.value,
67
+ testID: testID?.valueID
68
+ }, this.displayValue()), /*#__PURE__*/React.createElement(Text, {
69
+ style: {
70
+ ...infoStyles.units,
71
+ paddingLeft: this.props.unit === null ? 0 : 4
72
+ },
73
+ testID: testID?.unitID
74
+ }, this.displayUnit())));
75
+ }
76
+ }
77
+
78
+ /** @internal */
79
+ export const infoStyles = StyleSheet.create({
80
+ container: {
81
+ flex: 1,
82
+ flexDirection: `row`,
83
+ marginBottom: 8,
84
+ padding: 16,
85
+ borderWidth: 1,
86
+ borderColor: colors.dustyDarkBlue,
87
+ borderRadius: 5,
88
+ alignItems: `center`
89
+ },
90
+ labelContainer: {
91
+ flex: 7,
92
+ justifyContent: `flex-start`
93
+ },
94
+ label: {
95
+ ...FONTS.Poppins.regular_Base,
96
+ color: colors.white
97
+ },
98
+ valueUnitContainer: {
99
+ flex: 6.5,
100
+ justifyContent: `flex-end`,
101
+ alignItems: `baseline`,
102
+ flexDirection: `row`
103
+ },
104
+ value: {
105
+ ...FONTS.Poppins.medium_2XL,
106
+ color: colors.white
107
+ },
108
+ units: {
109
+ ...FONTS.Poppins.regular_XS,
110
+ color: colors.white,
111
+ paddingLeft: 4
112
+ }
113
+ });
114
+ //# sourceMappingURL=InfoBars.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","StyleSheet","View","BloodGlucoseUnit","BloodKetonesUnit","t","colors","Utils","FONTS","Text","InfoBars","Component","displayValue","showNullAsDash","unit","value","props","noDecimal","MG_DL","nullPlaceholder","displayUnit","formatUnit","render","testID","createElement","style","infoStyles","container","labelContainer","label","valueUnitContainer","valueID","units","paddingLeft","unitID","create","flex","flexDirection","marginBottom","padding","borderWidth","borderColor","dustyDarkBlue","borderRadius","alignItems","justifyContent","Poppins","regular_Base","color","white","medium_2XL","regular_XS"],"sourceRoot":"../../../src","sources":["components/InfoBars.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,SAASC,gBAAgB,EAAEC,gBAAgB,QAAQ,cAAc;AAEjE,SAASC,CAAC,QAAQ,sBAAsB;AAExC,SAASC,MAAM,QAAQ,oBAAoB;AAC3C,SAASC,KAAK,QAAQ,gBAAgB;AACtC,SAASC,KAAK,QAAQ,gBAAgB;AACtC,OAAOC,I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,GAAGxB,KAAK,CAACsC,OAAO,CAACK,UAAU;IAC3BH,KAAK,EAAE1C,MAAM,CAAC2C,KAAK;IACnBhB,WAAW,EAAE;EACd;AACD,CAAC,CAAC"}
@@ -0,0 +1,142 @@
1
+ import React from "react";
2
+ import { Keyboard, StyleSheet, TextInput } from "react-native";
3
+ /**
4
+ * InvisibleNumberInput is used to enable numerical input by the user without displaying a traditional input field on the screen.
5
+ * Since the input field is made invisible and thus can’t be tapped directly by the user we need to be able to call
6
+ * its focus() method from the parent component in order to activate the input field and show the keyboard.
7
+ * We do this by defining a function that calls the input field’s focus() method inside the InvisibleNumberInput component when it has been mounted.
8
+ * This function is then passed to the parent by giving it as the argument for a callback function named visible.
9
+ */
10
+ export default class InvisibleNumberInput extends React.Component {
11
+ keyboardDidHideSubscription = null;
12
+ inputRef = null;
13
+ constructor(props) {
14
+ super(props);
15
+ this.inputRef = /*#__PURE__*/React.createRef();
16
+ }
17
+
18
+ /** Initialise the state value variable with `0` */
19
+ state = {
20
+ value: `0`
21
+ };
22
+
23
+ /**
24
+ * Called immediately after a component is mounted. Setting state here will trigger re-rendering.
25
+ * Perform various initialisation steps:
26
+ * 1. Set the value state of the component to the startValue prop (or to '0' if it is undefined)
27
+ * 2. Call the visible callback function using an anonymous function as argument. The anonymous function shall do the following:
28
+ * - Set the value state of the InvisibleNumberInput component to the startValue prop (or to '0' if it is undefined)
29
+ * - Return the value from calling the focus() method on the input field.
30
+ */
31
+ componentDidMount() {
32
+ this.keyboardDidHideSubscription = Keyboard.addListener(`keyboardDidHide`, this.callOnTextInputsBlur);
33
+ this.setState({
34
+ value: this.props.startValue ?? `0`
35
+ });
36
+ this.props.visible(() => {
37
+ this.setState({
38
+ value: this.props.startValue ?? `0`
39
+ });
40
+ return this.inputRef?.current?.focus();
41
+ });
42
+ }
43
+
44
+ /**
45
+ * Call the blur method on the TextInput component.
46
+ */
47
+ callOnTextInputsBlur = () => {
48
+ this.inputRef?.current?.blur();
49
+ };
50
+
51
+ /**
52
+ * Sanitise a user-entered value by removing invalid characters
53
+ *
54
+ * Steps:
55
+ * 1. Use regular expressions to make the following manipulations to the text argument in the defined order and save the result to a local string variable named replaced.
56
+ * - Replace any commas with periods
57
+ * - Remove any characters that comes after two groups of zero or more digits separated by a period.
58
+ * 2. Define a function named round that rounds a given string that contains a number to have the amount of decimals given by the decimalPlaces prop. Return the result as a string.
59
+ * 3. If the value of the replaced variable from step 1 is not a NaN (not a number) when converted to a Number type then use the round function defined in step 2 on replaced and return the result
60
+ * 4. (If the NaN-check from step 2 didn’t fail) return the string '0'.
61
+ * @param text The string input to clean up
62
+ * @returns A string with the cleaned text.
63
+ */
64
+ cleanInput = text => {
65
+ const replaced = text.replace(/,/g, `.`).replace(/(\d*\.\d*).*/, `$1`);
66
+ const round = value => {
67
+ const temp = Number(value) * Math.pow(10, this.props.decimalPlaces);
68
+ const rounded = Math.round(temp) / Math.pow(10, this.props.decimalPlaces);
69
+ return rounded.toFixed(this.props.decimalPlaces);
70
+ };
71
+ if (!isNaN(Number(replaced))) {
72
+ return round(replaced);
73
+ }
74
+ return `0`;
75
+ };
76
+
77
+ /**
78
+ * Handle what happens when the text in the input field is being changed.
79
+ * That includes cleaning the text a little and then saving the value and potentially calling a callback function.
80
+ *
81
+ * Steps:
82
+ * 1. If the cleanPartialInput prop is true, use the cleanInput() method to to clean the content of the text argument and save it to a variable named cleaned.
83
+ * Otherwise just replace any commas in the text argument with periods and save the result to the same variable.
84
+ * 2. Remove repeated periods from the text in the cleaned variable and save the the result in a new variable named replacedSeparator.
85
+ * 3. Set the value state of the component to replacedSeparator.
86
+ * 4. If the partialInput callback function prop is defined, call it with replacedSeparator as argument.
87
+ * @param text The updated text in the input field
88
+ */
89
+ handleOnChangeText = text => {
90
+ const cleaned = this.props.cleanPartialInput ? this.cleanInput(text) : text.replace(/,/g, `.`);
91
+ let replacedSeparator = cleaned.replace(/\.+/g, `.`).replace(/(\d*\.\d*).*/, `$1`);
92
+ if (!this.props.negativeAllowed) {
93
+ replacedSeparator = replacedSeparator.replace(/[^0-9.]/g, ``);
94
+ }
95
+ this.setState({
96
+ value: `${replacedSeparator}`
97
+ });
98
+ this.props.partialInput?.(`${replacedSeparator}`);
99
+ };
100
+
101
+ /**
102
+ * Handle what should happen when the user finish editing the input field.
103
+ *
104
+ * Steps:
105
+ * 1. Use the cleanInput() method on the value state and store the result in a variable named cleaned.
106
+ * 2. If the onEnd prop is not null, then convert the value of cleaned to a number and use it as an argument to call the onEnd prop function.
107
+ */
108
+ onEndEdit = () => {
109
+ const cleaned = this.cleanInput(this.state.value);
110
+ this.props.onEnd?.(Number(cleaned));
111
+ };
112
+
113
+ /**
114
+ * @returns JSX element to display a TextInput field with the component’s value state as its value
115
+ * and the handleOnChangeText() and onEndEdit() methods as the textInput’s onChangeText and onEndEditing respectively.
116
+ */
117
+ render() {
118
+ const {
119
+ testID
120
+ } = this.props;
121
+ return /*#__PURE__*/React.createElement(TextInput, {
122
+ testID: testID,
123
+ value: this.state.value,
124
+ ref: this.inputRef,
125
+ style: inputStyles.input,
126
+ keyboardType: `numeric`,
127
+ returnKeyType: `done`,
128
+ onChangeText: this.handleOnChangeText,
129
+ onEndEditing: this.onEndEdit,
130
+ maxLength: this.props.maxLength,
131
+ selectTextOnFocus: true
132
+ });
133
+ }
134
+ }
135
+ const inputStyles = StyleSheet.create({
136
+ input: {
137
+ width: 1,
138
+ height: 1,
139
+ opacity: 0
140
+ }
141
+ });
142
+ //# sourceMappingURL=InvisibleNumberInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Keyboard","StyleSheet","TextInput","InvisibleNumberInput","Component","keyboardDidHideSubscription","inputRef","constructor","props","createRef","state","value","componentDidMount","addListener","callOnTextInputsBlur","setState","startValue","visible","current","focus","blur","cleanInput","text","replaced","replace","round","temp","Number","Math","pow","decimalPlaces","rounded","toFixed","isNaN","handleOnChangeText","cleaned","cleanPartialInput","replacedSeparator","negativeAllowed","partialInput","onEndEdit","onEnd","render","testID","createElement","ref","style","inputStyles","input","keyboardType","returnKeyType","onChangeText","onEndEditing","maxLength","selectTextOnFocus","create","width","height","opacity"],"sourceRoot":"../../../src","sources":["components/InvisibleNumberInput.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA8BC,QAAQ,EAAEC,UAAU,EAAEC,SAAS,QAAQ,cAAc;AA4BnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAMC,oBAAoB,SAASJ,KAAK,CAACK,SAAS,CAAiB;EACjFC,2BAA2B,GAA+B,IAAI;EAC9DC,QAAQ,GAAsC,IAAI;EAClDC,WAAWA,CAACC,KAAa,EAAE;IAC1B,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACF,QAAQ,gBAAGP,KAAK,CAACU,SAAS,EAAa;EAC7C;;EAEA;EACOC,KAAK,GAAW;IACtBC,KAAK,EAAG;EACT,CAAC;;EAED;AACD;AACA;AACA;AACA;AACA;AACA;AACA;EACQC,iBAAiBA,CAAA,EAAS;IAChC,IAAI,CAACP,2BAA2B,GAAGL,QAAQ,CAACa,WAAW,CAAE,iBAAgB,EAAE,IAAI,CAACC,oBAAoB,CAAC;IACrG,IAAI,CAACC,QAAQ,CAAC;MACbJ,KAAK,EAAE,IAAI,CAACH,KAAK,CAACQ,UAAU,IAAK;IAClC,CAAC,CAAC;IACF,IAAI,CAACR,KAAK,CAACS,OAAO,CAAC,MAAY;MAC9B,IAAI,CAACF,QAAQ,CAAC;QACbJ,KAAK,EAAE,IAAI,CAACH,KAAK,CAACQ,UAAU,IAAK;MAClC,CAAC,CAAC;MACF,OAAO,IAAI,CAACV,QAAQ,EAAEY,OAAO,EAAEC,KAAK,EAAE;IACvC,CAAC,CAAC;EACH;;EAEA;AACD;AACA;EACQL,oBAAoB,GAAGA,CAAA,KAAY;IACzC,IAAI,CAACR,QAAQ,EAAEY,OAAO,EAAEE,IAAI,EAAE;EAC/B,CAAC;;EAED;AACD;AACA;AACA;AACA;AACA;AACA;A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AC9D;IACA,IAAI,CAACT,QAAQ,CAAC;MACbJ,KAAK,EAAG,GAAE0B,iBAAkB;IAC7B,CAAC,CAAC;IACF,IAAI,CAAC7B,KAAK,CAAC+B,YAAY,GAAI,GAAEF,iBAAkB,EAAC,CAAC;EAClD,CAAC;;EAED;AACD;AACA;AACA;AACA;AACA;AACA;EACQG,SAAS,GAAGA,CAAA,KAAY;IAC9B,MAAML,OAAO,GAAG,IAAI,CAACd,UAAU,CAAC,IAAI,CAACX,KAAK,CAACC,KAAK,CAAC;IACjD,IAAI,CAACH,KAAK,CAACiC,KAAK,GAAGd,MAAM,CAACQ,OAAO,CAAC,CAAC;EACpC,CAAC;;EAED;AACD;AACA;AACA;EACQO,MAAMA,CAAA,EAAgB;IAC5B,MAAM;MAAEC;IAAO,CAAC,GAAG,IAAI,CAACnC,KAAK;IAC7B,oBACCT,KAAA,CAAA6C,aAAA,CAAC1C,SAAS;MACTyC,MAAM,EAAEA,MAAO;MACfhC,KAAK,EAAE,IAAI,CAACD,KAAK,CAACC,KAAM;MACxBkC,GAAG,EAAE,IAAI,CAACvC,QAAS;MACnBwC,KAAK,EAAEC,WAAW,CAACC,KAAM;MACzBC,YAAY,EAAG,SAAS;MACxBC,aAAa,EAAG,MAAM;MACtBC,YAAY,EAAE,IAAI,CAACjB,kBAAmB;MACtCkB,YAAY,EAAE,IAAI,CAACZ,SAAU;MAC7Ba,SAAS,EAAE,IAAI,CAAC7C,KAAK,CAAC6C,SAAU;MAChCC,iBAAiB;IAAA,EAChB;EAEJ;AACD;AAEA,MAAMP,WAAW,GAAG9C,UAAU,CAACsD,MAAM,CAAC;EACrCP,KAAK,EAAE;IACNQ,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,CAAC;IACTC,OAAO,EAAE;EACV;AACD,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import { StyleSheet, View } from "react-native";
3
+ /** Display a horizontal line for visually separating elements in the user interface. */
4
+ export default class LineSeparator extends React.Component {
5
+ /** @return JSX element for displaying a thin horizontal line in the given color. */
6
+ render() {
7
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
8
+ style: [lineSeparatorStyles.lineStyle, {
9
+ ...this.props
10
+ }]
11
+ }));
12
+ }
13
+ }
14
+ const lineSeparatorStyles = StyleSheet.create({
15
+ lineStyle: {
16
+ borderBottomWidth: 1
17
+ }
18
+ });
19
+ //# sourceMappingURL=LineSeparator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","StyleSheet","View","LineSeparator","Component","render","createElement","Fragment","style","lineSeparatorStyles","lineStyle","props","create","borderBottomWidth"],"sourceRoot":"../../../src","sources":["components/LineSeparator.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAW/C;AACA,eAAe,MAAMC,aAAa,SAASH,KAAK,CAACI,SAAS,CAAS;EAClE;EACOC,MAAMA,CAAA,EAAgB;IAC5B,oBACCL,KAAA,CAAAM,aAAA,CAACN,KAAK,CAACO,QAAQ,qBACdP,KAAA,CAAAM,aAAA,CAACJ,IAAI;MAACM,KAAK,EAAE,CAACC,mBAAmB,CAACC,SAAS,EAAE;QAAE,GAAG,IAAI,CAACC;MAAM,CAAC;IAAE,EAAG,CACnD;EAEnB;AACD;AAEA,MAAMF,mBAAmB,GAAGR,UAAU,CAACW,MAAM,CAAC;EAC7CF,SAAS,EAAE;IACVG,iBAAiB,EAAE;EACpB;AACD,CAAC,CAAC"}
@@ -0,0 +1,97 @@
1
+ import React from "react";
2
+ import { StyleSheet, TouchableOpacity, View } from "react-native";
3
+ import { t } from "../locales/translate";
4
+ import { Testing } from "../types/enum";
5
+ import { colors } from "../utils/Constants";
6
+ import { FONTS } from "./styles/fonts";
7
+ import Text from "./Text";
8
+ /** Display a card that prompts the user to recall if they injected insulin recently. */
9
+ export default class RecentInsulin extends React.Component {
10
+ /**
11
+ *
12
+ * @returns JSX element that displays a card with the question “Have you taken insulin within the last 4 hours?
13
+ * Along with two buttons labeled “Yes” and “No” respectively.
14
+ * If the user taps the “Yes” button, the onRecentInsulinYes prop callback function should be called.
15
+ * If the user taps the “No” button, the onRecentInsulinNo prop callback function should be called.
16
+ */
17
+ render = () => {
18
+ return /*#__PURE__*/React.createElement(View, {
19
+ style: recentInsulinStyles.container
20
+ }, /*#__PURE__*/React.createElement(View, {
21
+ style: recentInsulinStyles.textContainer
22
+ }, /*#__PURE__*/React.createElement(Text, {
23
+ style: recentInsulinStyles.recommended
24
+ }, t(`Recommended amount of insulin`)), /*#__PURE__*/React.createElement(Text, {
25
+ style: recentInsulinStyles.takenInsulin
26
+ }, t(`Have you taken insulin within the last 4 hours?`))), /*#__PURE__*/React.createElement(View, {
27
+ style: recentInsulinStyles.buttonContainer
28
+ }, /*#__PURE__*/React.createElement(TouchableOpacity, {
29
+ testID: Testing.Id.RecentInsulinTestIds.Yes,
30
+ onPress: this.props.onRecentInsulinYes,
31
+ style: recentInsulinStyles.yesButton
32
+ }, /*#__PURE__*/React.createElement(Text, {
33
+ style: recentInsulinStyles.yesNoText
34
+ }, t(`Yes`))), /*#__PURE__*/React.createElement(TouchableOpacity, {
35
+ testID: Testing.Id.RecentInsulinTestIds.No,
36
+ onPress: this.props.onRecentInsulinNo,
37
+ style: recentInsulinStyles.noButton
38
+ }, /*#__PURE__*/React.createElement(Text, {
39
+ style: recentInsulinStyles.yesNoText
40
+ }, t(`No`)))));
41
+ };
42
+ }
43
+ const recentInsulinStyles = StyleSheet.create({
44
+ container: {
45
+ minHeight: 220,
46
+ backgroundColor: colors.deepPurple,
47
+ borderRadius: 5,
48
+ marginBottom: 32,
49
+ paddingHorizontal: 16,
50
+ paddingTop: 16,
51
+ paddingBottom: 50
52
+ },
53
+ textContainer: {
54
+ justifyContent: `center`,
55
+ alignItems: `center`,
56
+ marginBottom: 32
57
+ },
58
+ recommended: {
59
+ ...FONTS.Poppins.medium_Base,
60
+ color: colors.white,
61
+ textAlign: `center`,
62
+ marginBottom: 2
63
+ },
64
+ takenInsulin: {
65
+ ...FONTS.Poppins.regular_SM,
66
+ color: colors.white,
67
+ textAlign: `center`
68
+ },
69
+ buttonContainer: {
70
+ flexDirection: `row`,
71
+ justifyContent: `center`
72
+ },
73
+ yesButton: {
74
+ flex: 1,
75
+ borderRadius: 50,
76
+ minWidth: 127,
77
+ marginLeft: 30,
78
+ marginRight: 12,
79
+ backgroundColor: colors.teal
80
+ },
81
+ noButton: {
82
+ flex: 1,
83
+ borderRadius: 50,
84
+ minWidth: 127,
85
+ marginRight: 30,
86
+ marginLeft: 12,
87
+ backgroundColor: colors.teal
88
+ },
89
+ yesNoText: {
90
+ ...FONTS.Poppins.bold_Base,
91
+ textAlign: `center`,
92
+ paddingHorizontal: 16,
93
+ paddingVertical: 12,
94
+ color: colors.black
95
+ }
96
+ });
97
+ //# sourceMappingURL=RecentInsulin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","StyleSheet","TouchableOpacity","View","t","Testing","colors","FONTS","Text","RecentInsulin","Component","render","createElement","style","recentInsulinStyles","container","textContainer","recommended","takenInsulin","buttonContainer","testID","Id","RecentInsulinTestIds","Yes","onPress","props","onRecentInsulinYes","yesButton","yesNoText","No","onRecentInsulinNo","noButton","create","minHeight","backgroundColor","deepPurple","borderRadius","marginBottom","paddingHorizontal","paddingTop","paddingBottom","justifyContent","alignItems","Poppins","medium_Base","color","white","textAlign","regular_SM","flexDirection","flex","minWidth","marginLeft","marginRight","teal","bold_Base","paddingVertical","black"],"sourceRoot":"../../../src","sources":["components/RecentInsulin.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AAEjE,SAASC,CAAC,QAAQ,sBAAsB;AACxC,SAASC,OAAO,QAAQ,eAAe;AACvC,SAASC,MAAM,QAAQ,oBAAoB;AAC3C,SAASC,KAAK,QAAQ,gBAAgB;A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