@hedia/recommendation-screen 2.1.75 → 2.2.0-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 (393) hide show
  1. package/dist/index.d.ts +5 -0
  2. package/dist/index.js +5 -0
  3. package/{lib/typescript → dist/src}/RecommendationScreen.d.ts +68 -82
  4. package/dist/src/RecommendationScreen.js +522 -0
  5. package/dist/src/assets/assets/activity/Cyclist.png +0 -0
  6. package/dist/src/assets/assets/activity/Other.png +0 -0
  7. package/dist/src/assets/assets/activity/Runner.png +0 -0
  8. package/dist/src/assets/assets/activity/Swimmer.png +0 -0
  9. package/dist/src/assets/assets/activity/Walk.png +0 -0
  10. package/dist/src/assets/assets/fonts/Poppins-Bold.ttf +0 -0
  11. package/dist/src/assets/assets/fonts/Poppins-SemiBold.ttf +0 -0
  12. package/dist/src/assets/assets/icons/Edit.tsx +22 -0
  13. package/dist/src/assets/assets/icons/X.tsx +14 -0
  14. package/dist/src/assets/assets/mood/happy.png +0 -0
  15. package/dist/src/assets/assets/mood/happy_active.png +0 -0
  16. package/dist/src/assets/assets/mood/neutral.png +0 -0
  17. package/dist/src/assets/assets/mood/neutral_active.png +0 -0
  18. package/dist/src/assets/assets/mood/sad.png +0 -0
  19. package/dist/src/assets/assets/mood/sad_active.png +0 -0
  20. package/dist/src/assets/assets/mood/semi_happy.png +0 -0
  21. package/dist/src/assets/assets/mood/semi_happy_active.png +0 -0
  22. package/dist/src/assets/assets/mood/semi_sad.png +0 -0
  23. package/dist/src/assets/assets/mood/semi_sad_active.png +0 -0
  24. package/dist/src/assets/icons/Edit.d.ts +4 -0
  25. package/dist/src/assets/icons/Edit.js +7 -0
  26. package/dist/src/assets/icons/X.d.ts +4 -0
  27. package/dist/src/assets/icons/X.js +6 -0
  28. package/dist/src/components/ForecastInfoBar.d.ts +109 -0
  29. package/dist/src/components/ForecastInfoBar.js +138 -0
  30. package/dist/src/components/Header.d.ts +8 -0
  31. package/dist/src/components/Header.js +54 -0
  32. package/dist/src/components/Icon.d.ts +20 -0
  33. package/dist/src/components/Icon.js +43 -0
  34. package/{lib/typescript → dist/src}/components/InfoBars.d.ts +28 -14
  35. package/dist/src/components/InfoBars.js +128 -0
  36. package/{lib/typescript → dist/src}/components/InvisibleNumberInput.d.ts +3 -9
  37. package/dist/src/components/InvisibleNumberInput.js +121 -0
  38. package/dist/src/components/LimitationMessage.d.ts +14 -0
  39. package/dist/src/components/LimitationMessage.js +30 -0
  40. package/{lib/typescript → dist/src}/components/LineSeparator.d.ts +1 -6
  41. package/dist/src/components/LineSeparator.js +18 -0
  42. package/{lib/typescript → dist/src}/components/RecentInsulin.d.ts +1 -3
  43. package/dist/src/components/RecentInsulin.js +73 -0
  44. package/{lib/typescript → dist/src}/components/RecommendationModal.d.ts +63 -63
  45. package/dist/src/components/RecommendationModal.js +226 -0
  46. package/{lib/typescript → dist/src}/components/RecommendedCarbs.d.ts +0 -3
  47. package/dist/src/components/RecommendedCarbs.js +251 -0
  48. package/{lib/typescript → dist/src}/components/RecommendedInsulin.d.ts +1 -2
  49. package/dist/src/components/RecommendedInsulin.js +180 -0
  50. package/{lib/typescript → dist/src}/components/Remeasure.d.ts +15 -6
  51. package/dist/src/components/Remeasure.js +130 -0
  52. package/{lib/typescript/components/TransferToLogbook.d.ts → dist/src/components/SaveButton.d.ts} +2 -3
  53. package/dist/src/components/SaveButton.js +71 -0
  54. package/dist/src/components/TwoOptionModal.d.ts +136 -0
  55. package/dist/src/components/TwoOptionModal.js +141 -0
  56. package/{lib/typescript → dist/src}/components/activity/Activity.d.ts +2 -3
  57. package/dist/src/components/activity/Activity.js +84 -0
  58. package/{lib/typescript → dist/src}/components/activity/ActivityIcon.d.ts +7 -8
  59. package/dist/src/components/activity/ActivityIcon.js +58 -0
  60. package/{lib/typescript → dist/src}/components/activity/ActivityIntensity.d.ts +1 -2
  61. package/dist/src/components/activity/ActivityIntensity.js +58 -0
  62. package/{lib/typescript → dist/src}/components/mood/Emotion.d.ts +1 -2
  63. package/dist/src/components/mood/Emotion.js +64 -0
  64. package/{lib/typescript → dist/src}/components/mood/MoodIcon.d.ts +5 -5
  65. package/dist/src/components/mood/MoodIcon.js +63 -0
  66. package/dist/src/components/text/TextBold.d.ts +8 -0
  67. package/dist/src/components/text/TextBold.js +12 -0
  68. package/dist/src/components/text/TextRegular.d.ts +8 -0
  69. package/dist/src/components/text/TextRegular.js +12 -0
  70. package/dist/src/locale/da/messages.js +1 -0
  71. package/dist/src/locale/da/messages.po +349 -0
  72. package/dist/src/locale/de/messages.js +1 -0
  73. package/dist/src/locale/de/messages.po +349 -0
  74. package/dist/src/locale/en/messages.js +1 -0
  75. package/dist/src/locale/en/messages.po +349 -0
  76. package/dist/src/locale/es/messages.js +1 -0
  77. package/dist/src/locale/es/messages.po +349 -0
  78. package/dist/src/locale/fr/messages.js +1 -0
  79. package/dist/src/locale/fr/messages.po +349 -0
  80. package/dist/src/locale/i18nUtils.d.ts +18 -0
  81. package/dist/src/locale/i18nUtils.js +39 -0
  82. package/dist/src/locale/it/messages.js +1 -0
  83. package/dist/src/locale/it/messages.po +349 -0
  84. package/{lib/typescript → dist/src}/types/enum.d.ts +15 -22
  85. package/dist/src/types/enum.js +145 -0
  86. package/{lib/typescript → dist/src}/types/types.d.ts +0 -1
  87. package/dist/src/types/types.js +1 -0
  88. package/{lib/typescript → dist/src}/utils/AttentionMessages.d.ts +0 -1
  89. package/dist/src/utils/AttentionMessages.js +118 -0
  90. package/{lib/typescript → dist/src}/utils/Constants.d.ts +3 -18
  91. package/{lib/module → dist/src}/utils/Constants.js +21 -79
  92. package/{lib/typescript → dist/src}/utils/RecommendationError.d.ts +0 -1
  93. package/dist/src/utils/RecommendationError.js +63 -0
  94. package/{lib/typescript → dist/src}/utils/RecommendationUtils.d.ts +0 -1
  95. package/{lib/module → dist/src}/utils/RecommendationUtils.js +88 -90
  96. package/{lib/typescript → dist/src}/utils/Translations.d.ts +0 -1
  97. package/{lib/module → dist/src}/utils/Translations.js +5 -7
  98. package/{lib/typescript → dist/src}/utils/Utils.d.ts +1 -2
  99. package/dist/src/utils/Utils.js +141 -0
  100. package/{lib/typescript → dist/src}/utils/Validations.d.ts +1 -2
  101. package/{lib/module → dist/src}/utils/Validations.js +128 -156
  102. package/package.json +96 -109
  103. package/lib/commonjs/RecommendationScreen.js +0 -778
  104. package/lib/commonjs/RecommendationScreen.js.map +0 -1
  105. package/lib/commonjs/assets/IconsSVG/Close.js +0 -20
  106. package/lib/commonjs/assets/IconsSVG/Close.js.map +0 -1
  107. package/lib/commonjs/assets/IconsSVG/CloseOutlined.js +0 -28
  108. package/lib/commonjs/assets/IconsSVG/CloseOutlined.js.map +0 -1
  109. package/lib/commonjs/assets/IconsSVG/Edit.js +0 -23
  110. package/lib/commonjs/assets/IconsSVG/Edit.js.map +0 -1
  111. package/lib/commonjs/assets/IconsSVG/activity/Cycling.js +0 -43
  112. package/lib/commonjs/assets/IconsSVG/activity/Cycling.js.map +0 -1
  113. package/lib/commonjs/assets/IconsSVG/activity/Running.js +0 -33
  114. package/lib/commonjs/assets/IconsSVG/activity/Running.js.map +0 -1
  115. package/lib/commonjs/assets/IconsSVG/activity/Stretching.js +0 -33
  116. package/lib/commonjs/assets/IconsSVG/activity/Stretching.js.map +0 -1
  117. package/lib/commonjs/assets/IconsSVG/activity/Swimming.js +0 -48
  118. package/lib/commonjs/assets/IconsSVG/activity/Swimming.js.map +0 -1
  119. package/lib/commonjs/assets/IconsSVG/activity/Walking.js +0 -38
  120. package/lib/commonjs/assets/IconsSVG/activity/Walking.js.map +0 -1
  121. package/lib/commonjs/assets/IconsSVG/mood/Happy.js +0 -34
  122. package/lib/commonjs/assets/IconsSVG/mood/Happy.js.map +0 -1
  123. package/lib/commonjs/assets/IconsSVG/mood/Neutral.js +0 -34
  124. package/lib/commonjs/assets/IconsSVG/mood/Neutral.js.map +0 -1
  125. package/lib/commonjs/assets/IconsSVG/mood/Sad.js +0 -34
  126. package/lib/commonjs/assets/IconsSVG/mood/Sad.js.map +0 -1
  127. package/lib/commonjs/assets/IconsSVG/mood/SemiHappy.js +0 -34
  128. package/lib/commonjs/assets/IconsSVG/mood/SemiHappy.js.map +0 -1
  129. package/lib/commonjs/assets/IconsSVG/mood/SemiSad.js +0 -34
  130. package/lib/commonjs/assets/IconsSVG/mood/SemiSad.js.map +0 -1
  131. package/lib/commonjs/components/ExitModal.js +0 -124
  132. package/lib/commonjs/components/ExitModal.js.map +0 -1
  133. package/lib/commonjs/components/InfoBars.js +0 -123
  134. package/lib/commonjs/components/InfoBars.js.map +0 -1
  135. package/lib/commonjs/components/InvisibleNumberInput.js +0 -150
  136. package/lib/commonjs/components/InvisibleNumberInput.js.map +0 -1
  137. package/lib/commonjs/components/LineSeparator.js +0 -27
  138. package/lib/commonjs/components/LineSeparator.js.map +0 -1
  139. package/lib/commonjs/components/RecentInsulin.js +0 -105
  140. package/lib/commonjs/components/RecentInsulin.js.map +0 -1
  141. package/lib/commonjs/components/RecommendationModal.js +0 -302
  142. package/lib/commonjs/components/RecommendationModal.js.map +0 -1
  143. package/lib/commonjs/components/RecommendedCarbs.js +0 -289
  144. package/lib/commonjs/components/RecommendedCarbs.js.map +0 -1
  145. package/lib/commonjs/components/RecommendedInsulin.js +0 -209
  146. package/lib/commonjs/components/RecommendedInsulin.js.map +0 -1
  147. package/lib/commonjs/components/Remeasure.js +0 -131
  148. package/lib/commonjs/components/Remeasure.js.map +0 -1
  149. package/lib/commonjs/components/Text.js +0 -25
  150. package/lib/commonjs/components/Text.js.map +0 -1
  151. package/lib/commonjs/components/TimeoutModal.js +0 -113
  152. package/lib/commonjs/components/TimeoutModal.js.map +0 -1
  153. package/lib/commonjs/components/TransferToLogbook.js +0 -83
  154. package/lib/commonjs/components/TransferToLogbook.js.map +0 -1
  155. package/lib/commonjs/components/activity/Activity.js +0 -112
  156. package/lib/commonjs/components/activity/Activity.js.map +0 -1
  157. package/lib/commonjs/components/activity/ActivityIcon.js +0 -86
  158. package/lib/commonjs/components/activity/ActivityIcon.js.map +0 -1
  159. package/lib/commonjs/components/activity/ActivityIntensity.js +0 -65
  160. package/lib/commonjs/components/activity/ActivityIntensity.js.map +0 -1
  161. package/lib/commonjs/components/mood/Emotion.js +0 -86
  162. package/lib/commonjs/components/mood/Emotion.js.map +0 -1
  163. package/lib/commonjs/components/mood/MoodIcon.js +0 -107
  164. package/lib/commonjs/components/mood/MoodIcon.js.map +0 -1
  165. package/lib/commonjs/components/styles/fonts.js +0 -160
  166. package/lib/commonjs/components/styles/fonts.js.map +0 -1
  167. package/lib/commonjs/index.js +0 -21
  168. package/lib/commonjs/index.js.map +0 -1
  169. package/lib/commonjs/locales/da/translations.json +0 -82
  170. package/lib/commonjs/locales/de/translations.json +0 -81
  171. package/lib/commonjs/locales/en/translations.json +0 -84
  172. package/lib/commonjs/locales/es/translations.json +0 -81
  173. package/lib/commonjs/locales/fr/translations.json +0 -81
  174. package/lib/commonjs/locales/it/translations.json +0 -81
  175. package/lib/commonjs/locales/translate.js +0 -63
  176. package/lib/commonjs/locales/translate.js.map +0 -1
  177. package/lib/commonjs/types/enum.js +0 -179
  178. package/lib/commonjs/types/enum.js.map +0 -1
  179. package/lib/commonjs/types/types.js +0 -6
  180. package/lib/commonjs/types/types.js.map +0 -1
  181. package/lib/commonjs/utils/AttentionMessages.js +0 -141
  182. package/lib/commonjs/utils/AttentionMessages.js.map +0 -1
  183. package/lib/commonjs/utils/Constants.js +0 -138
  184. package/lib/commonjs/utils/Constants.js.map +0 -1
  185. package/lib/commonjs/utils/RecommendationError.js +0 -116
  186. package/lib/commonjs/utils/RecommendationError.js.map +0 -1
  187. package/lib/commonjs/utils/RecommendationUtils.js +0 -212
  188. package/lib/commonjs/utils/RecommendationUtils.js.map +0 -1
  189. package/lib/commonjs/utils/Translations.js +0 -22
  190. package/lib/commonjs/utils/Translations.js.map +0 -1
  191. package/lib/commonjs/utils/Utils.js +0 -162
  192. package/lib/commonjs/utils/Utils.js.map +0 -1
  193. package/lib/commonjs/utils/Validations.js +0 -468
  194. package/lib/commonjs/utils/Validations.js.map +0 -1
  195. package/lib/module/RecommendationScreen.js +0 -768
  196. package/lib/module/RecommendationScreen.js.map +0 -1
  197. package/lib/module/assets/IconsSVG/Close.js +0 -11
  198. package/lib/module/assets/IconsSVG/Close.js.map +0 -1
  199. package/lib/module/assets/IconsSVG/CloseOutlined.js +0 -19
  200. package/lib/module/assets/IconsSVG/CloseOutlined.js.map +0 -1
  201. package/lib/module/assets/IconsSVG/Edit.js +0 -14
  202. package/lib/module/assets/IconsSVG/Edit.js.map +0 -1
  203. package/lib/module/assets/IconsSVG/activity/Cycling.js +0 -34
  204. package/lib/module/assets/IconsSVG/activity/Cycling.js.map +0 -1
  205. package/lib/module/assets/IconsSVG/activity/Running.js +0 -24
  206. package/lib/module/assets/IconsSVG/activity/Running.js.map +0 -1
  207. package/lib/module/assets/IconsSVG/activity/Stretching.js +0 -24
  208. package/lib/module/assets/IconsSVG/activity/Stretching.js.map +0 -1
  209. package/lib/module/assets/IconsSVG/activity/Swimming.js +0 -39
  210. package/lib/module/assets/IconsSVG/activity/Swimming.js.map +0 -1
  211. package/lib/module/assets/IconsSVG/activity/Walking.js +0 -29
  212. package/lib/module/assets/IconsSVG/activity/Walking.js.map +0 -1
  213. package/lib/module/assets/IconsSVG/mood/Happy.js +0 -25
  214. package/lib/module/assets/IconsSVG/mood/Happy.js.map +0 -1
  215. package/lib/module/assets/IconsSVG/mood/Neutral.js +0 -25
  216. package/lib/module/assets/IconsSVG/mood/Neutral.js.map +0 -1
  217. package/lib/module/assets/IconsSVG/mood/Sad.js +0 -25
  218. package/lib/module/assets/IconsSVG/mood/Sad.js.map +0 -1
  219. package/lib/module/assets/IconsSVG/mood/SemiHappy.js +0 -25
  220. package/lib/module/assets/IconsSVG/mood/SemiHappy.js.map +0 -1
  221. package/lib/module/assets/IconsSVG/mood/SemiSad.js +0 -25
  222. package/lib/module/assets/IconsSVG/mood/SemiSad.js.map +0 -1
  223. package/lib/module/components/ExitModal.js +0 -114
  224. package/lib/module/components/ExitModal.js.map +0 -1
  225. package/lib/module/components/InfoBars.js +0 -114
  226. package/lib/module/components/InfoBars.js.map +0 -1
  227. package/lib/module/components/InvisibleNumberInput.js +0 -142
  228. package/lib/module/components/InvisibleNumberInput.js.map +0 -1
  229. package/lib/module/components/LineSeparator.js +0 -19
  230. package/lib/module/components/LineSeparator.js.map +0 -1
  231. package/lib/module/components/RecentInsulin.js +0 -97
  232. package/lib/module/components/RecentInsulin.js.map +0 -1
  233. package/lib/module/components/RecommendationModal.js +0 -291
  234. package/lib/module/components/RecommendationModal.js.map +0 -1
  235. package/lib/module/components/RecommendedCarbs.js +0 -281
  236. package/lib/module/components/RecommendedCarbs.js.map +0 -1
  237. package/lib/module/components/RecommendedInsulin.js +0 -201
  238. package/lib/module/components/RecommendedInsulin.js.map +0 -1
  239. package/lib/module/components/Remeasure.js +0 -123
  240. package/lib/module/components/Remeasure.js.map +0 -1
  241. package/lib/module/components/Text.js +0 -16
  242. package/lib/module/components/Text.js.map +0 -1
  243. package/lib/module/components/TimeoutModal.js +0 -103
  244. package/lib/module/components/TimeoutModal.js.map +0 -1
  245. package/lib/module/components/TransferToLogbook.js +0 -75
  246. package/lib/module/components/TransferToLogbook.js.map +0 -1
  247. package/lib/module/components/activity/Activity.js +0 -104
  248. package/lib/module/components/activity/Activity.js.map +0 -1
  249. package/lib/module/components/activity/ActivityIcon.js +0 -78
  250. package/lib/module/components/activity/ActivityIcon.js.map +0 -1
  251. package/lib/module/components/activity/ActivityIntensity.js +0 -57
  252. package/lib/module/components/activity/ActivityIntensity.js.map +0 -1
  253. package/lib/module/components/mood/Emotion.js +0 -78
  254. package/lib/module/components/mood/Emotion.js.map +0 -1
  255. package/lib/module/components/mood/MoodIcon.js +0 -97
  256. package/lib/module/components/mood/MoodIcon.js.map +0 -1
  257. package/lib/module/components/styles/fonts.js +0 -152
  258. package/lib/module/components/styles/fonts.js.map +0 -1
  259. package/lib/module/index.js +0 -5
  260. package/lib/module/index.js.map +0 -1
  261. package/lib/module/locales/da/translations.json +0 -82
  262. package/lib/module/locales/de/translations.json +0 -81
  263. package/lib/module/locales/en/translations.json +0 -84
  264. package/lib/module/locales/es/translations.json +0 -81
  265. package/lib/module/locales/fr/translations.json +0 -81
  266. package/lib/module/locales/it/translations.json +0 -81
  267. package/lib/module/locales/translate.js +0 -55
  268. package/lib/module/locales/translate.js.map +0 -1
  269. package/lib/module/types/enum.js +0 -170
  270. package/lib/module/types/enum.js.map +0 -1
  271. package/lib/module/types/types.js +0 -2
  272. package/lib/module/types/types.js.map +0 -1
  273. package/lib/module/utils/AttentionMessages.js +0 -131
  274. package/lib/module/utils/AttentionMessages.js.map +0 -1
  275. package/lib/module/utils/Constants.js.map +0 -1
  276. package/lib/module/utils/RecommendationError.js +0 -87
  277. package/lib/module/utils/RecommendationError.js.map +0 -1
  278. package/lib/module/utils/RecommendationUtils.js.map +0 -1
  279. package/lib/module/utils/Translations.js.map +0 -1
  280. package/lib/module/utils/Utils.js +0 -155
  281. package/lib/module/utils/Utils.js.map +0 -1
  282. package/lib/module/utils/Validations.js.map +0 -1
  283. package/lib/typescript/RecommendationScreen.d.ts.map +0 -1
  284. package/lib/typescript/assets/IconsSVG/Close.d.ts +0 -5
  285. package/lib/typescript/assets/IconsSVG/Close.d.ts.map +0 -1
  286. package/lib/typescript/assets/IconsSVG/CloseOutlined.d.ts +0 -5
  287. package/lib/typescript/assets/IconsSVG/CloseOutlined.d.ts.map +0 -1
  288. package/lib/typescript/assets/IconsSVG/Edit.d.ts +0 -5
  289. package/lib/typescript/assets/IconsSVG/Edit.d.ts.map +0 -1
  290. package/lib/typescript/assets/IconsSVG/activity/Cycling.d.ts +0 -5
  291. package/lib/typescript/assets/IconsSVG/activity/Cycling.d.ts.map +0 -1
  292. package/lib/typescript/assets/IconsSVG/activity/Running.d.ts +0 -5
  293. package/lib/typescript/assets/IconsSVG/activity/Running.d.ts.map +0 -1
  294. package/lib/typescript/assets/IconsSVG/activity/Stretching.d.ts +0 -5
  295. package/lib/typescript/assets/IconsSVG/activity/Stretching.d.ts.map +0 -1
  296. package/lib/typescript/assets/IconsSVG/activity/Swimming.d.ts +0 -5
  297. package/lib/typescript/assets/IconsSVG/activity/Swimming.d.ts.map +0 -1
  298. package/lib/typescript/assets/IconsSVG/activity/Walking.d.ts +0 -5
  299. package/lib/typescript/assets/IconsSVG/activity/Walking.d.ts.map +0 -1
  300. package/lib/typescript/assets/IconsSVG/mood/Happy.d.ts +0 -5
  301. package/lib/typescript/assets/IconsSVG/mood/Happy.d.ts.map +0 -1
  302. package/lib/typescript/assets/IconsSVG/mood/Neutral.d.ts +0 -5
  303. package/lib/typescript/assets/IconsSVG/mood/Neutral.d.ts.map +0 -1
  304. package/lib/typescript/assets/IconsSVG/mood/Sad.d.ts +0 -5
  305. package/lib/typescript/assets/IconsSVG/mood/Sad.d.ts.map +0 -1
  306. package/lib/typescript/assets/IconsSVG/mood/SemiHappy.d.ts +0 -5
  307. package/lib/typescript/assets/IconsSVG/mood/SemiHappy.d.ts.map +0 -1
  308. package/lib/typescript/assets/IconsSVG/mood/SemiSad.d.ts +0 -5
  309. package/lib/typescript/assets/IconsSVG/mood/SemiSad.d.ts.map +0 -1
  310. package/lib/typescript/components/ExitModal.d.ts +0 -26
  311. package/lib/typescript/components/ExitModal.d.ts.map +0 -1
  312. package/lib/typescript/components/InfoBars.d.ts.map +0 -1
  313. package/lib/typescript/components/InvisibleNumberInput.d.ts.map +0 -1
  314. package/lib/typescript/components/LineSeparator.d.ts.map +0 -1
  315. package/lib/typescript/components/RecentInsulin.d.ts.map +0 -1
  316. package/lib/typescript/components/RecommendationModal.d.ts.map +0 -1
  317. package/lib/typescript/components/RecommendedCarbs.d.ts.map +0 -1
  318. package/lib/typescript/components/RecommendedInsulin.d.ts.map +0 -1
  319. package/lib/typescript/components/Remeasure.d.ts.map +0 -1
  320. package/lib/typescript/components/Text.d.ts +0 -14
  321. package/lib/typescript/components/Text.d.ts.map +0 -1
  322. package/lib/typescript/components/TimeoutModal.d.ts +0 -25
  323. package/lib/typescript/components/TimeoutModal.d.ts.map +0 -1
  324. package/lib/typescript/components/TransferToLogbook.d.ts.map +0 -1
  325. package/lib/typescript/components/activity/Activity.d.ts.map +0 -1
  326. package/lib/typescript/components/activity/ActivityIcon.d.ts.map +0 -1
  327. package/lib/typescript/components/activity/ActivityIntensity.d.ts.map +0 -1
  328. package/lib/typescript/components/mood/Emotion.d.ts.map +0 -1
  329. package/lib/typescript/components/mood/MoodIcon.d.ts.map +0 -1
  330. package/lib/typescript/components/styles/fonts.d.ts +0 -151
  331. package/lib/typescript/components/styles/fonts.d.ts.map +0 -1
  332. package/lib/typescript/index.d.ts +0 -5
  333. package/lib/typescript/index.d.ts.map +0 -1
  334. package/lib/typescript/locales/translate.d.ts +0 -20
  335. package/lib/typescript/locales/translate.d.ts.map +0 -1
  336. package/lib/typescript/types/enum.d.ts.map +0 -1
  337. package/lib/typescript/types/types.d.ts.map +0 -1
  338. package/lib/typescript/utils/AttentionMessages.d.ts.map +0 -1
  339. package/lib/typescript/utils/Constants.d.ts.map +0 -1
  340. package/lib/typescript/utils/RecommendationError.d.ts.map +0 -1
  341. package/lib/typescript/utils/RecommendationUtils.d.ts.map +0 -1
  342. package/lib/typescript/utils/Translations.d.ts.map +0 -1
  343. package/lib/typescript/utils/Utils.d.ts.map +0 -1
  344. package/lib/typescript/utils/Validations.d.ts.map +0 -1
  345. package/src/RecommendationScreen.tsx +0 -854
  346. package/src/assets/IconsSVG/Close.tsx +0 -13
  347. package/src/assets/IconsSVG/CloseOutlined.tsx +0 -23
  348. package/src/assets/IconsSVG/Edit.tsx +0 -16
  349. package/src/assets/IconsSVG/activity/Cycling.tsx +0 -41
  350. package/src/assets/IconsSVG/activity/Running.tsx +0 -29
  351. package/src/assets/IconsSVG/activity/Stretching.tsx +0 -29
  352. package/src/assets/IconsSVG/activity/Swimming.tsx +0 -47
  353. package/src/assets/IconsSVG/activity/Walking.tsx +0 -35
  354. package/src/assets/IconsSVG/mood/Happy.tsx +0 -30
  355. package/src/assets/IconsSVG/mood/Neutral.tsx +0 -30
  356. package/src/assets/IconsSVG/mood/Sad.tsx +0 -30
  357. package/src/assets/IconsSVG/mood/SemiHappy.tsx +0 -30
  358. package/src/assets/IconsSVG/mood/SemiSad.tsx +0 -30
  359. package/src/components/ExitModal.tsx +0 -134
  360. package/src/components/InfoBars.tsx +0 -122
  361. package/src/components/InvisibleNumberInput.tsx +0 -170
  362. package/src/components/LineSeparator.tsx +0 -29
  363. package/src/components/RecentInsulin.tsx +0 -109
  364. package/src/components/RecommendationModal.tsx +0 -319
  365. package/src/components/RecommendedCarbs.tsx +0 -303
  366. package/src/components/RecommendedInsulin.tsx +0 -220
  367. package/src/components/Remeasure.tsx +0 -135
  368. package/src/components/Text.tsx +0 -27
  369. package/src/components/TimeoutModal.tsx +0 -121
  370. package/src/components/TransferToLogbook.tsx +0 -92
  371. package/src/components/activity/Activity.tsx +0 -107
  372. package/src/components/activity/ActivityIcon.tsx +0 -77
  373. package/src/components/activity/ActivityIntensity.tsx +0 -67
  374. package/src/components/mood/Emotion.tsx +0 -97
  375. package/src/components/mood/MoodIcon.tsx +0 -91
  376. package/src/components/styles/fonts.ts +0 -151
  377. package/src/index.ts +0 -5
  378. package/src/locales/da/translations.json +0 -82
  379. package/src/locales/de/translations.json +0 -81
  380. package/src/locales/en/translations.json +0 -84
  381. package/src/locales/es/translations.json +0 -81
  382. package/src/locales/fr/translations.json +0 -81
  383. package/src/locales/it/translations.json +0 -81
  384. package/src/locales/translate.ts +0 -62
  385. package/src/types/enum.ts +0 -164
  386. package/src/types/types.ts +0 -19
  387. package/src/utils/AttentionMessages.ts +0 -167
  388. package/src/utils/Constants.ts +0 -77
  389. package/src/utils/RecommendationError.ts +0 -182
  390. package/src/utils/RecommendationUtils.ts +0 -232
  391. package/src/utils/Translations.ts +0 -17
  392. package/src/utils/Utils.ts +0 -156
  393. package/src/utils/Validations.ts +0 -490
@@ -1,81 +0,0 @@
1
- {
2
- "Active Insulin": "Insulina attiva",
3
- "Activity": "Attività fisica",
4
- "Additional": "Ulteriori",
5
- "Attention": "Attenzione",
6
- "Based on the selected activity your insulin recommendation is reduced by:": "In base all'attività selezionata, la prescrizione per l'insulina è ridotta di:",
7
- "Blood Glucose Level": "Indice glicemico",
8
- "Blood Ketone Level": "Livello di chetoni nel sangue",
9
- "Carbohydrates": "Carboidrati",
10
- "Close calculation": "Chiudi calcolo",
11
- "Consider not to initiate physical activity before your blood glucose level is within the recommended ranges prior to physical activity.": "Ricorda di non iniziare l'attività fisica prima che il livello di glucosio nel sangue non sia rientrato negli intervalli raccomandati prima dell'attività fisica.",
12
- "Enter Manually": "Immetti manualmente",
13
- "Entered": "Inserito",
14
- "Error. Hedia Calculator does not support an insulin dose greater than {SAFETY_INSULIN_LIMIT} units": "Errore. Hedia Calculator non supporta una dose di insulina superiore a {SAFETY_INSULIN_LIMIT} unità",
15
- "Error. Hedia Calculator does not support insulin recommendations with boluses older than 4 hours": "Errore. Hedia Calculator non supporta le raccomandazioni di insulina con boli più vecchi di 4 ore",
16
- "Error. Hedia Calculator does not support your activity intensity value": "Errore. Hedia Calculator non supporta il valore dell'intensità dell'attività",
17
- "Error. Hedia Calculator does not support your activity type value": "Errore. Hedia Calculator non supporta il valore del tipo di attività",
18
- "Error. Hedia Calculator does not support your current blood glucose level.": "Errore. Hedia Calculator non supporta la tua glicemia attuale.",
19
- "Error. Hedia Calculator does not support your current blood glucose unit.": "Errore. Hedia Calculator non supporta l'attuale unità misura di glucosio nel sangue.",
20
- "Error. Hedia Calculator does not support your current blood ketone level.": "Errore. Hedia Calculator non supporta l'attuale livello di chetoni nel sangue.",
21
- "Error. Hedia Calculator does not support your current blood ketone unit.": "Errore. Hedia Calculator non supporta l'attuale unità di misura di chetoni del sangue.",
22
- "Error. Hedia Calculator does not support your current language.": "Errore. Hedia Calculator non supporta la lingua corrente.",
23
- "Error. Hedia Calculator does not support your injection method.": "Errore. Hedia Calculator non supporta il metodo di iniezione.",
24
- "Error. Hedia Calculator only supports activities with a duration of maximum 60 minutes.": "Errore. Hedia Calculator supporta solo attività della durata massima di 60 minuti.",
25
- "Error. Please verify that your activity settings are set up correctly.": "Errore. Verificare che le impostazioni delle attività siano impostate correttamente.",
26
- "Error. Please verify that your activity target blood glucose value is correct.": "Errore. Verificare che il indice glicemico desiderato durante l’attività sia corretto.",
27
- "Error. Please verify that your insulin sensitivity value is correct.": "Errore. Verificare che il valore della sensibilità all'insulina sia corretto.",
28
- "Error. Please verify that your insulin to carb ratio value is correct.": "Errore. Verificare che il valore del rapporto insulina/carboidrati sia corretto.",
29
- "Error. Please verify that your target blood glucose value is correct.": "Errore. Verificare che il valore obiettivo della glicemia sia corretto.",
30
- "Error. Please verify your notifications settings.": "Errore. Verificare le impostazioni di notifica.",
31
- "Food": "Cibo",
32
- "grams": "grammi",
33
- "grams of carbohydrates": "grammi di carboidrati",
34
- "Hard": "Intensa",
35
- "Have you taken insulin within the last 4 hours?": "Hai assunto insulina nelle ultime 4 ore?",
36
- "Hedia Calculator does not support activities that finished more than 4 hours ago.": "Hedia Calculator non supporta attività che siano terminate più di 4 ore fa.",
37
- "Hedia Calculator does not support insulin recommendations with more than 300 grams of carbohydrates present.": "Hedia Calculator non supporta le prescrizioni di insulina con più di 300 grammi di carboidrati presenti.",
38
- "Hedia does not support more than {SAFETY_INSULIN_LIMIT} units of insulin per calculation.": "Hedia non supporta più di {SAFETY_INSULIN_LIMIT} unità di insulina per ogni calcolo.",
39
- "Hedia doesn't support more than {SAFETY_INSULIN_LIMIT} units of insulin per calculation, but because of the physical activity you entered it has been further reduced by {0}% to {1} units for this calculation.": "Hedia non supporta più di {SAFETY_INSULIN_LIMIT} unità di insulina per ogni calcolo, ma, a seguito dell'attività fisica che hai inserito, è stata ulteriormente ridotta del {0}% a {1} unità per questo calcolo.",
40
- "hours": "ore",
41
- "How are you feeling?": "Come ti senti?",
42
- "If it is possible, postpone your planned exercise.": "Se possibile, posticipa l'allenamento pianificato.",
43
- "Instead of taking insulin": "Invece di assumere insulina",
44
- "Insulin recommendation": "Prescrizione di insulina",
45
- "Light": "Leggera",
46
- "min": "min",
47
- "Moderate": "Moderata",
48
- "More than 15 minutes has passed since this calculation was started.": "Sono passati più di 15 minuti dall'inizio di questo calcolo.",
49
- "NO": "NO",
50
- "No": "No",
51
- "No, return to dashboard": "No, torna al pannello di controllo",
52
- "OFF": "SPENTO",
53
- "OK": "OK",
54
- "Please go through the calculation steps with new measurements to ensure a safe recommendation.": "Completa tutte le fasi del calcolo con nuove misurazioni per assicurare una prescrizione sicura.",
55
- "Recommendation from {day} at {time} was not transfered to your logbook.{0}Did you use the recommendation?": "La prescrizione del {day} alle {time} non è stata trasferita nel tuo diario.{0} Hai usato la prescrizione?",
56
- "Recommended": "Prescritta",
57
- "Recommended amount of insulin": "Quantità prescritta di insulina",
58
- "Remind me to remeasure in": "Ricordami di misurare nuovamente tra",
59
- "Return to dashboard": "Torna al pannello di controllo",
60
- "Save data before closing?": "Salvare i dati prima della chiusura?",
61
- "Save to logbook": "Salva nel diario",
62
- "Start new calculation": "Inizia il nuovo calcolo",
63
- "Total": "Totale",
64
- "Transfer to logbook": "Trasferisci al diario",
65
- "Transferred to logbook": "Trasferito al diario",
66
- "Units": "Unità",
67
- "units": "unità",
68
- "Untitled Activity": "Attività senza titolo",
69
- "We recommend eating an additional:": "Consigliamo di ingerire una quantità supplementare:",
70
- "Would you like to add this to your current calculation?": "Vuoi aggiungere questo al tuo calcolo corrente?",
71
- "Yes": "Sì",
72
- "Yes, save to logbook": "Sì, salva nel diario",
73
- "You have a high blood glucose level.": "Hai un alto indice glicemico.",
74
- "You should take rapid-acting insulin and measure ketones.": "Devi assumere insulina ad azione rapida e misurare i chetoni.",
75
- "You will be reminded to measure your blood glucose level in 15 min.": "Ti verrà ricordato di misurare il indice glicemico tra 15 min.",
76
- "Your blood glucose level is very low.": "Il indice glicemico è molto basso.",
77
- "Your blood glucose level is very low. Take glucagon or eat carbohydrates if possible. Seek medical attention.": "Il indice glicemico è molto basso. Assumi glucagon o ingerisci carboidrati, se possibile. Rivolgiti a un medico.",
78
- "Your recommendation would have been higher than {0} units of insulin, but it has been limited for safety reasons.{1} Hedia never recommends more than {SAFETY_INSULIN_LIMIT} units of insulin per calculation, but because of the physical activity you entered it has been further reduced by {2}% to {3}.": "La tua prescrizione sarebbe stata superiore a {0} unità di insulina, ma è stata limitata per motivi di sicurezza.{1} Hedia non prescrive mai più di {SAFETY_INSULIN_LIMIT} unità di insulina per calcolo, ma a seguito dell'attività fisica che hai inserito, questa è stata ulteriormente ridotta del {2}% a {3}.",
79
- "Your recommendation would have been higher than {SAFETY_INSULIN_LIMIT} units of insulin, but it has been limited for safety reasons. Hedia never recommends more than {SAFETY_INSULIN_LIMIT} units of insulin per calculation.": "La tua prescrizione sarebbe stata superiore a {SAFETY_INSULIN_LIMIT} unità di insulina, ma è stata limitata per motivi di sicurezza. Hedia non prescrive mai più di {SAFETY_INSULIN_LIMIT} unità di insulina per calcolo.",
80
- "Your saved data will be used for future calculations.": "I dati salvati saranno utilizzati per calcoli futuri."
81
- }
@@ -1,62 +0,0 @@
1
- import "moment/min/locales";
2
-
3
- import moment from "moment";
4
-
5
- import { Languages } from "@hedia/types";
6
-
7
- /** Internalisation object containing the translations. Call changeLanguage in order to change the language. */
8
- const languageMap: Record<keyof typeof Languages, Record<string, string>> = {
9
- da: require(`./da/translations.json`),
10
- en: require(`./en/translations.json`),
11
- de: require(`./de/translations.json`),
12
- es: require(`./es/translations.json`),
13
- fr: require(`./fr/translations.json`),
14
- it: require(`./it/translations.json`),
15
- };
16
- let toLocaleTexts: Record<string, string>;
17
-
18
- /**
19
- * Change the language that is used to display text on the recommendation screen.
20
- *
21
- * Steps:
22
- * 1. Set the locale for the date-time library
23
- * 2. Load the desired language in the memory
24
- * @param language The language to switch to.
25
- */
26
- export const changeLocale = (language: keyof typeof Languages) => {
27
- moment.locale(language === `en` ? `en-gb` : language);
28
- toLocaleTexts = languageMap[language];
29
- };
30
-
31
- /**
32
- * Get the translation in the language that was initialised by the changeLocale function.
33
- *
34
- * @param textKeys The key for the desired translation.
35
- * @param values The parameters to be introduced in the translations.
36
- */
37
- const translate = (textKeys: string, values?: Record<string, unknown>) => {
38
- const englishTexts = languageMap[`en`];
39
- const englishText: string = englishTexts[textKeys];
40
- const translatedText: string = toLocaleTexts?.[textKeys];
41
-
42
- if (!englishText && !translatedText) {
43
- console.warn(`No text/key with value ${textKeys} was found`);
44
- return textKeys;
45
- }
46
-
47
- if (!values) {
48
- return translatedText ?? englishText;
49
- }
50
-
51
- let translatedTextWithValues = translatedText;
52
- let englishTextsWithValues = englishText;
53
- const valuesKeys = Object.keys(values);
54
- for (const k of valuesKeys) {
55
- const re = new RegExp(`\\{${k}\\}`, "g");
56
- translatedTextWithValues = translatedTextWithValues?.replace(re, `${values[k]}`);
57
- englishTextsWithValues = englishTextsWithValues.replace(re, `${values[k]}`);
58
- }
59
- return translatedTextWithValues ?? englishTextsWithValues;
60
- };
61
-
62
- export { translate as t };
package/src/types/enum.ts DELETED
@@ -1,164 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-namespace */
2
- /** Namespace containing data required by component testing */
3
- export namespace Testing {
4
- /** Namespace containing data about the testing ids for certain components in order to test their expected behaviour */
5
- export namespace Id {
6
- export enum RecommendationScreenTestIds {
7
- RecommendationScrollView = `recommendation-screen-scroll-view`,
8
- }
9
-
10
- export enum ActivityTestIds {
11
- ActivityDuration = `activity-duration-minutes`,
12
- ActivityReduction = `activity-reduction-percentage`,
13
- }
14
-
15
- export enum RecentInsulinTestIds {
16
- No = "recent-insulin-no",
17
- Yes = "recent-insulin-yes",
18
- }
19
-
20
- export enum RecommendedCarbsTestIds {
21
- RecommendedCarbs = "recommended-carbs",
22
- EditRecommendedCarbs = `edit-recommended-carbs`,
23
- InvisibleCarbInput = `invisible-recommended-carbs-input`,
24
- EnteredCarbs = "entered-carbs",
25
- RemoveRecommendation = `remove-carb-recommendation`,
26
- TotalCarbs = "total-carbs",
27
- }
28
-
29
- export enum RecommendedInsulinTestIds {
30
- EditRecommendedInsulinIcon = `edit-recommended-insulin-icon`,
31
- EditRecommendedInsulin = `edit-recommended-insulin`,
32
- InvisibleInsulinInput = `invisible-recommended-insulin-input`,
33
- ShownInsulinText = `shown-insulin-text`,
34
- }
35
-
36
- export enum RecommendationModalTestIds {
37
- DeclineCarbs = "recommendation-modal-decline-carbs",
38
- AcceptCarbs = "recommendation-modal-accept-carbs",
39
- OkButton = "recommendation-modal-ok-button",
40
- LimitationOkButton = `limitation-message-ok-button`,
41
- SuggestedCarbs = `recommendation-modal-suggested-carbs`,
42
- }
43
-
44
- export enum RemeasureTestIds {
45
- RemeasureSlider = `remeasure-slider`,
46
- RemeasureHours = `remeasure-hours`,
47
- }
48
-
49
- export enum TransferToLogbookTestIds {
50
- TransferButton = "transfer-to-logbook-button",
51
- }
52
-
53
- export enum ExitModalTestIds {
54
- ExitButton = `exit-two-option-modal`,
55
- FirstOption = `first-option-button`,
56
- SecondOption = `second-option-button`,
57
- }
58
-
59
- export enum TimeOutModalTestIds {
60
- ExitButton = `exit-two-option-modal`,
61
- FirstOption = `first-option-button`,
62
- SecondOption = `second-option-button`,
63
- }
64
-
65
- /** Namespace containing ids for the InfoBars component value, lavel and unit fields */
66
- export namespace InfoBarTestIds {
67
- export enum Value {
68
- BloodKetone = `blood-ketone-value`,
69
- BloodGlucose = `blood-glucose-value`,
70
- ActiveInsulin = `active-insulin-value`,
71
- }
72
- export enum Label {
73
- BloodKetone = `blood-ketone-label`,
74
- BloodGlucose = `blood-glucose-label`,
75
- ActiveInsulin = `active-insulin-label`,
76
- }
77
- export enum Unit {
78
- BloodKetone = `blood-ketone-unit`,
79
- BloodGlucose = `blood-glucose-unit`,
80
- ActiveInsulin = `active-insulin-unit`,
81
- }
82
- }
83
- }
84
-
85
- /** Namespace containing all the TestIdEnum keys */
86
- export namespace Types {
87
- export type TestIdEnum =
88
- | Id.ActivityTestIds
89
- | Id.RecentInsulinTestIds
90
- | Id.RecommendedCarbsTestIds
91
- | Id.RecommendedInsulinTestIds
92
- | Id.RecommendationModalTestIds
93
- | Id.RemeasureTestIds
94
- | Id.TransferToLogbookTestIds
95
- | Id.ExitModalTestIds
96
- | Id.TimeOutModalTestIds
97
- | Id.InfoBarTestIds.Unit
98
- | Id.InfoBarTestIds.Value
99
- | Id.InfoBarTestIds.Label;
100
- }
101
- }
102
-
103
- /**
104
- * Indicator of which error has happened.
105
- * See the corresponding RecommendationError {@link RecommendationError} for details.
106
- */
107
- export enum RecommendationErrorEnum {
108
- ActivityDuration,
109
- ActivityTargetBGL,
110
- ActivitySettings,
111
- ActivityDate,
112
- ActivityIntensity,
113
- ActivityType,
114
- BolusInsulinDose,
115
- BolusInsulinSecondsPassed,
116
- RecentBolus,
117
- CarbohydrateLimit,
118
- InsulinSensitivity,
119
- InsulinToCarbsRatio,
120
- LatestLogbook6HoursBGL,
121
- CurrentBGL,
122
- CurrentBKL,
123
- TargetBGL,
124
- UserReminder,
125
- Language,
126
- InjectionMethod,
127
- BloodKetoneUnit,
128
- BloodGlucoseUnit,
129
- BloodKetoneProps,
130
- }
131
-
132
- /** Indicates the category of the user’s blood glucose level. */
133
- export enum BgLevel {
134
- SevereHypoglycemia,
135
- Hypoglycemia,
136
- MildHypoglycemia,
137
- Normoglycemia,
138
- NormoglycemiaUnder5MMOL,
139
- MildHyperglycemia,
140
- Hyperglycemia,
141
- SevereHyperglycemia,
142
- UnsupportedBGLevel,
143
- BGLevelNotProvided,
144
- }
145
-
146
- /** The possible initial recommendation times with values in hours. */
147
- export enum RecommendationReminders {
148
- ReminderOff = 0,
149
- Reminder15Minutes = 0.25,
150
- Reminder60Minutes = 1,
151
- HediaReminderDefault = 1.5,
152
- }
153
-
154
- export enum ExitModalActions {
155
- CloseCalculation = `CloseCalculation`,
156
- Transfer = `Transfer`,
157
- Hide = `Hide`,
158
- }
159
-
160
- export enum TimeoutModalActions {
161
- CloseCalculation = `CloseCalculation`,
162
- RestartCalculation = `RestartCalculation`,
163
- Transfer = `Transfer`,
164
- }
@@ -1,19 +0,0 @@
1
- import { Activity } from "@hedia/types";
2
-
3
- /** Interface used to describe a numerical interval. It is assumed that min < max. */
4
- export interface IInterval {
5
- /** The lower bound of the interval. */
6
- min: number;
7
- /** The upper bound of the interval. */
8
- max: number;
9
- }
10
-
11
- /**
12
- * Represents the properties needed to show the user visual information about the physical activity.
13
- */
14
- export interface IActivityDisplayProps {
15
- /** Title of the physical activity */
16
- activityTitle: string | null;
17
- /** Type of the physical activity */
18
- activityType: Activity.Enums.ActivityEnum | null;
19
- }
@@ -1,167 +0,0 @@
1
- import moment from "moment";
2
-
3
- import { BolusCalculator } from "@hedia/types";
4
-
5
- import { t } from "../locales/translate";
6
-
7
- /** Provides methods for getting variants of attention messages */
8
- export const AttentionMessage = {
9
- /**
10
- * @return Concatenation of:
11
- * {@link Messages.VeryLowBGL} +
12
- * {@link Messages.Reminder15Minutes}
13
- */
14
- SevereHypoglycemia: (): string => `${Messages.VeryLowBGL()}${`\n`}${Messages.Reminder15Minutes()}`,
15
-
16
- /**
17
- * @return Concatenation of:
18
- * {@link Messages.LowBGL} +
19
- * {@link Messages.Reminder15Minutes}
20
- */
21
- Hypoglycemia: (): string => `${Messages.LowBGL()}${`\n`}${Messages.Reminder15Minutes()}`,
22
-
23
- /** @return The value of: {@link Messages.Reminder15Minutes} */
24
- MildHypoglycemia: (): string => Messages.Reminder15Minutes(),
25
-
26
- /** @return The value of: {@link Messages.PostponePhysicalActivityUnder5MMOL} */
27
- NormoglycemiaActivityUnder5MMOL: (): string => Messages.PostponePhysicalActivityUnder5MMOL(),
28
-
29
- /**
30
- * @return Concatenation of:
31
- * {@link Messages.HighBGL} +
32
- * {@link Messages.InsulinKetones} +
33
- * {@link Messages.Reminder15Minutes} +
34
- * {@link Messages.PostponePhysicalActivity}
35
- */
36
- HyperglycemiaActivity: (): string =>
37
- `${Messages.HighBGL()}${`\n`}${Messages.InsulinKetones()}${`\n`}${Messages.Reminder15Minutes()}${`\n`}${Messages.PostponePhysicalActivity()}`,
38
-
39
- /**
40
- * @return Concatenation of:
41
- * {@link Messages.HighBGL} +
42
- * {@link Messages.InsulinKetones}
43
- */
44
- SevereHyperglycemia: (): string => `${Messages.HighBGL()}${`\n`}${Messages.InsulinKetones()}${`\n`}`,
45
-
46
- /**
47
- * @return Concatenation of:
48
- * {@link Messages.HighBGL} +
49
- * {@link Messages.InsulinKetones} +
50
- * {@link Messages.Reminder15Minutes} +
51
- * {@link Messages.PostponePhysicalActivity}
52
- */
53
- SevereHyperglycemiaActivity: (): string =>
54
- `${Messages.HighBGL()}${`\n`}${Messages.InsulinKetones()}${`\n`}${Messages.Reminder15Minutes()}${`\n`}${Messages.PostponePhysicalActivity()}`,
55
-
56
- /** no message provided for this level */
57
- BGLevelNotProvided: null,
58
-
59
- /** no message provided for this level*/
60
- Hyperglycemia: null,
61
-
62
- /** no message provided for this level */
63
- MildHyperglycemia: null,
64
-
65
- /** no message provided for this level */
66
- Normoglycemia: null,
67
-
68
- /** no message provided for this level */
69
- NormoglycemiaUnder5MMOL: null,
70
-
71
- /** no message provided for this level */
72
- UnsupportedBGLevel: null,
73
- };
74
-
75
- /**
76
- * @param message The message to append the {@link Messages.PostponePhysicalActivityUnder5MMOL} to
77
- * @returns The initial messaged concatenated with the {@link Messages.PostponePhysicalActivityUnder5MMOL}
78
- */
79
- export function addPostponeActivityMessageUnder5MMOL(message: string): string {
80
- return `${message}${`\n`}${Messages.PostponePhysicalActivityUnder5MMOL()}`;
81
- }
82
-
83
- const SAFETY_INSULIN_LIMIT = BolusCalculator.Constants.SAFETY_INSULIN_LIMIT;
84
-
85
- /**
86
- * Calculate the limited insulin value based on the physical activity reduction value
87
- * @param reduction The reduction percentage an activity reduce the total insulin intake
88
- * @returns The limited insulin value.
89
- */
90
- export function getLimitedValue(reduction: number): number {
91
- return SAFETY_INSULIN_LIMIT - SAFETY_INSULIN_LIMIT * reduction;
92
- }
93
-
94
- /** Provides methods for getting strings for composing attention messages and other important communications to the user. */
95
- export class Messages {
96
- /** Inform the user that their BGL is very low and what they should do about it. */
97
- public static VeryLowBGL = (): string =>
98
- t(
99
- `Your blood glucose level is very low. Take glucagon or eat carbohydrates if possible. Seek medical attention.`,
100
- );
101
- /** Inform the user that their BGL is very low. */
102
- public static LowBGL = (): string => t(`Your blood glucose level is very low.`);
103
- /** Inform the user that they will be reminded to remeasure their BGL soon. */
104
- public static Reminder15Minutes = (): string =>
105
- t(`You will be reminded to measure your blood glucose level in 15 min.`);
106
- /** Encourages the user to postpone exercise. Specifically when their BGL is high. */
107
- public static PostponePhysicalActivity = (): string => t(`If it is possible, postpone your planned exercise.`);
108
- /** Encourages the user to postpone exercise. Specifically when their BGL is low. */
109
- public static PostponePhysicalActivityUnder5MMOL = (): string =>
110
- t(
111
- `Consider not to initiate physical activity before your blood glucose level is within the recommended ranges prior to physical activity.`,
112
- );
113
- /** Inform about high BGL. */
114
- public static HighBGL = (): string => t(`You have a high blood glucose level.`);
115
- /** Encourage user to measure ketones. */
116
- public static InsulinKetones = (): string => t(`You should take rapid-acting insulin and measure ketones.`);
117
- /** Inform the user that their insulin recommendation was limited for safety. */
118
- public static RecommendationWasLimited = (): string =>
119
- t(
120
- `Your recommendation would have been higher than {SAFETY_INSULIN_LIMIT} units of insulin, but it has been limited for safety reasons. Hedia never recommends more than {SAFETY_INSULIN_LIMIT} units of insulin per calculation.`,
121
- { SAFETY_INSULIN_LIMIT },
122
- );
123
- /** Inform the user that their insulin recommendation was limited for safety in combination with an activity. */
124
- public static RecommendationWasLimitedActivity = (activityReduction: number): string =>
125
- t(
126
- `Your recommendation would have been higher than {0} units of insulin, but it has been limited for safety reasons.{1} Hedia never recommends more than {SAFETY_INSULIN_LIMIT} units of insulin per calculation, but because of the physical activity you entered it has been further reduced by {2}% to {3}.`,
127
- {
128
- 0: getLimitedValue(activityReduction),
129
- 1: `\n\n`,
130
- SAFETY_INSULIN_LIMIT,
131
- 2: (activityReduction * 100).toFixed(0),
132
- 3: getLimitedValue(activityReduction),
133
- },
134
- );
135
- /** Inform the user that the insulin amount they entered is above HDA’s safety limit. */
136
- public static InsulinInputWasLimited = (activityReduction: number | null): string =>
137
- activityReduction
138
- ? t(
139
- `Hedia doesn't support more than {SAFETY_INSULIN_LIMIT} units of insulin per calculation, but because of the physical activity you entered it has been further reduced by {0}% to {1} units for this calculation.`,
140
- {
141
- SAFETY_INSULIN_LIMIT,
142
- 0: (activityReduction * 100).toFixed(0),
143
- 1: getLimitedValue(activityReduction),
144
- },
145
- )
146
- : t(`Hedia does not support more than {SAFETY_INSULIN_LIMIT} units of insulin per calculation.`, {
147
- SAFETY_INSULIN_LIMIT,
148
- });
149
- /** Title for the modal that informs the user that their calculation is too old. */
150
- public static TimeoutPrompTitle = (): string =>
151
- t(`More than 15 minutes has passed since this calculation was started.`);
152
- /**
153
- * Inform the user that their recommendation calculation is too old.
154
- * Variant to show when they didn’t see the actual insulin recommendation because they didn’t tell whether they injected insulin recently.
155
- */
156
- public static TimeoutRecommendationNotVisible = (): string =>
157
- t(`Please go through the calculation steps with new measurements to ensure a safe recommendation.`);
158
- /** Inform the user that their recommendation calculation is too old. */
159
- public static TimeoutRecommendationVisible = (date: Date): string => {
160
- const day = moment(date).format(`LL`);
161
- const time = moment(date).format(`HH:mm`);
162
- return t(
163
- `Recommendation from {day} at {time} was not transfered to your logbook.{0}Did you use the recommendation?`,
164
- { day, time, 0: `\n` },
165
- );
166
- };
167
- }
@@ -1,77 +0,0 @@
1
- import { BolusCalculator } from "@hedia/types";
2
-
3
- import { IInterval } from "../types/types";
4
-
5
- /** Reusable color definitions. */
6
- export const colors = {
7
- blue: `#578aff`,
8
- darkBlue: `#0F1231`,
9
- darkBlueX: `#1B1F48`,
10
- semiDarkBlue: `#1B1F48`,
11
- dustyBlue: `#C5D0E7`,
12
- dustyDarkBlue: `#353A71`,
13
- fadeBlue: `#8388C8`,
14
- lightBlue: `#C8CCFA`,
15
- mistBlue: `#4A5B86`,
16
- purple: `#a200ff`,
17
- deepPurple: `#571BD8`,
18
- teal: `#01FFFC`,
19
- gradientMain: [`#8B38F5`, `#D593E5`],
20
- gradientPurple: [`#a200ff`, `#578aff`],
21
- white: `#FFFFFF`,
22
- black: `#000000`,
23
- transparentWhite: `#FFFFFF00`,
24
- transparentBlack: `#000000E6`,
25
- transparentDarkBlue: `#0F123120`,
26
- transparentLightBlue: `#578AFF1A`,
27
- activityGreen: `#A5D871`,
28
- activityOrange: `#F9BD5A`,
29
- activityRed: `#EC5466`,
30
- };
31
-
32
- /** The threshold above which hyperglycemia is considered to be severe in mmol/L */
33
- export const SEVERE_HYPERGLYCEMIA_START_MMOL = 15;
34
-
35
- /** The number of seconds in four hours. */
36
- export const FOUR_HOURS_SECONDS = 14400;
37
- /** The number of minutes in one hour. */
38
- export const ONE_HOUR_MINUTES = 60;
39
- /** Extra time before an activity starts or stops. */
40
- export const ACTIVITY_BUFFER_MINUTES = 10;
41
-
42
- /** The lower and upper limits for the amount of carbohydrates in grams. */
43
- export const CARBOHYDRATES_LIMTS: IInterval = { min: 0, max: 300 };
44
- /** The lower and upper limits for the insulin dose in units. The upper limit is represented by the SAFETY_INSULIN_LIMIT constant while the lower limit is 0. */
45
- export const INSULIN_DOSE_LIMITS: IInterval = { min: 0, max: BolusCalculator.Constants.SAFETY_INSULIN_LIMIT };
46
- /** The lower and upper limits for the age of boluses that gets taken into account for calculating insulin on board. */
47
- export const BOLUS_SECONDS_PASSED_LIMITS: IInterval = { min: 0, max: FOUR_HOURS_SECONDS };
48
-
49
- /** The lower and upper limits for the duration of an activity in minutes. */
50
- export const ACTIVITY_DURATION_MINUTES_LIMITS: IInterval = { min: 1, max: ONE_HOUR_MINUTES };
51
- /** The lower and upper limits of insulin sensitivity settings. */
52
- export const INSULIN_SENSITIVITY_MMOL_LIMITS: IInterval = { min: 0.3, max: 10 };
53
- /** The lower and upper limits of insulin-to-carbs ratio settings. */
54
- export const INSULIN_TO_CARBS_RATIO_LIMITS: IInterval = { min: 1, max: 50 };
55
-
56
- /** The lower and upper limits of the entered blood glucose level value in mmol/L. */
57
- export const CURRENT_BGL_MMOL_LIMITS: IInterval = { min: 1.1, max: 33.3 };
58
- /** The conversion factor to multiply a blood glucose value with to go from mmol/L to mg/dL. */
59
- export const MMOLL_PER_MGDL_BGL = 0.0555;
60
- /** The conversion factor to multiply a blood glucose value with to go from mg/dL to mmol/L. */
61
- export const MGDL_PER_MMOLL_BGL: number = 1 / MMOLL_PER_MGDL_BGL;
62
-
63
- /** The lower and upper limits of the entered blood ketones value in mmol/L. */
64
- export const CURRENT_BKL_MMOL_LIMITS: IInterval = { min: 0, max: 8 };
65
- /** The conversion factor to multiply a blood ketones value with to go from mmol/L to mg/dL. */
66
- export const MMOLL_PER_MGDL_BKL = 0.096;
67
- /** The conversion factor to multiply a blood ketones value with to go from mg/dL to mmol/L. */
68
- export const MGDL_PER_MMOLL_BKL: number = 1 / MMOLL_PER_MGDL_BKL;
69
-
70
- /** The lower and upper limits for a valid BGL target in mmol/L. */
71
- export const TARGET_BGL_MMOL_LIMITS: IInterval = { min: 5, max: 13.9 };
72
- /** The lower and upper limits for a valid activity BGL target in mmol/L. */
73
- export const ACTIVITY_TARGET_BGL_MMOL_LIMITS: IInterval = { min: 5, max: 13.9 };
74
- /** The lower and upper limits for how long the reminder notification timer may be. */
75
- export const REMINDER_HOURS_LIMITS: IInterval = { min: 0, max: 6 };
76
- /** The lower and upper limits for activity reduction. */
77
- export const ACTIVITY_SETTINGS_INTERVAL_LIMITS: IInterval = { min: 0, max: 1 };