@magmamath/students-features 1.3.25 → 1.3.26-rc.1

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 (322) hide show
  1. package/dist/commonjs/features/fluency/assets/DivideIcon.js +32 -0
  2. package/dist/commonjs/features/fluency/assets/DivideIcon.js.map +1 -0
  3. package/dist/commonjs/features/fluency/assets/SpringIcon.js +29 -0
  4. package/dist/commonjs/features/fluency/assets/SpringIcon.js.map +1 -0
  5. package/dist/commonjs/features/fluency/assets/StarFillIcon.js +29 -0
  6. package/dist/commonjs/features/fluency/assets/StarFillIcon.js.map +1 -0
  7. package/dist/commonjs/features/fluency/components/Fluency.js +98 -0
  8. package/dist/commonjs/features/fluency/components/Fluency.js.map +1 -0
  9. package/dist/commonjs/features/fluency/components/FluencySolving.js +42 -0
  10. package/dist/commonjs/features/fluency/components/FluencySolving.js.map +1 -0
  11. package/dist/commonjs/features/fluency/components/day-streak-counter/DayStreak.js +91 -0
  12. package/dist/commonjs/features/fluency/components/day-streak-counter/DayStreak.js.map +1 -0
  13. package/dist/commonjs/features/fluency/components/day-streak-counter/DayStreakCounter.js +73 -0
  14. package/dist/commonjs/features/fluency/components/day-streak-counter/DayStreakCounter.js.map +1 -0
  15. package/dist/commonjs/features/fluency/components/fluency-solving/FluencyEquationCard.js +123 -0
  16. package/dist/commonjs/features/fluency/components/fluency-solving/FluencyEquationCard.js.map +1 -0
  17. package/dist/commonjs/features/fluency/components/fluency-solving/FluencyNumpad.js +183 -0
  18. package/dist/commonjs/features/fluency/components/fluency-solving/FluencyNumpad.js.map +1 -0
  19. package/dist/commonjs/features/fluency/components/fluency-solving/FluencySolvingCard.js +64 -0
  20. package/dist/commonjs/features/fluency/components/fluency-solving/FluencySolvingCard.js.map +1 -0
  21. package/dist/commonjs/features/fluency/components/fluency-solving/FluencySolvingHeader.js +71 -0
  22. package/dist/commonjs/features/fluency/components/fluency-solving/FluencySolvingHeader.js.map +1 -0
  23. package/dist/commonjs/features/fluency/components/fluency-solving/FluencySolvingProgress.js +47 -0
  24. package/dist/commonjs/features/fluency/components/fluency-solving/FluencySolvingProgress.js.map +1 -0
  25. package/dist/commonjs/features/fluency/components/matrix/FluencyMatrix.js +36 -0
  26. package/dist/commonjs/features/fluency/components/matrix/FluencyMatrix.js.map +1 -0
  27. package/dist/commonjs/features/fluency/components/matrix/components/MatrixCell.js +47 -0
  28. package/dist/commonjs/features/fluency/components/matrix/components/MatrixCell.js.map +1 -0
  29. package/dist/commonjs/features/fluency/components/matrix/components/MatrixFill.js +57 -0
  30. package/dist/commonjs/features/fluency/components/matrix/components/MatrixFill.js.map +1 -0
  31. package/dist/commonjs/features/fluency/components/matrix/components/MatrixLegend.js +105 -0
  32. package/dist/commonjs/features/fluency/components/matrix/components/MatrixLegend.js.map +1 -0
  33. package/dist/commonjs/features/fluency/components/select-math-operator/MathOperatorRow.js +43 -0
  34. package/dist/commonjs/features/fluency/components/select-math-operator/MathOperatorRow.js.map +1 -0
  35. package/dist/commonjs/features/fluency/components/select-math-operator/ProgressBar.js +124 -0
  36. package/dist/commonjs/features/fluency/components/select-math-operator/ProgressBar.js.map +1 -0
  37. package/dist/commonjs/features/fluency/components/select-math-operator/SelectMathOperator.js +63 -0
  38. package/dist/commonjs/features/fluency/components/select-math-operator/SelectMathOperator.js.map +1 -0
  39. package/dist/commonjs/features/fluency/components/start-banner/BannerFlashcards.js +80 -0
  40. package/dist/commonjs/features/fluency/components/start-banner/BannerFlashcards.js.map +1 -0
  41. package/dist/commonjs/features/fluency/components/start-banner/MathFlashcard.js +73 -0
  42. package/dist/commonjs/features/fluency/components/start-banner/MathFlashcard.js.map +1 -0
  43. package/dist/commonjs/features/fluency/components/start-banner/StartBanner.js +111 -0
  44. package/dist/commonjs/features/fluency/components/start-banner/StartBanner.js.map +1 -0
  45. package/dist/commonjs/features/fluency/context/FluencyContext.js +16 -0
  46. package/dist/commonjs/features/fluency/context/FluencyContext.js.map +1 -0
  47. package/dist/commonjs/features/fluency/fluency.constants.js +80 -0
  48. package/dist/commonjs/features/fluency/fluency.constants.js.map +1 -0
  49. package/dist/commonjs/features/fluency/fluency.helpers.js +67 -0
  50. package/dist/commonjs/features/fluency/fluency.helpers.js.map +1 -0
  51. package/dist/commonjs/features/fluency/fluency.types.js +6 -0
  52. package/dist/commonjs/features/fluency/fluency.types.js.map +1 -0
  53. package/dist/commonjs/features/fluency/hooks/useFluencyModePreset.js +39 -0
  54. package/dist/commonjs/features/fluency/hooks/useFluencyModePreset.js.map +1 -0
  55. package/dist/commonjs/features/fluency/index.js +68 -0
  56. package/dist/commonjs/features/fluency/index.js.map +1 -0
  57. package/dist/commonjs/features/fluency/model/FluencyApiModel.js +11 -0
  58. package/dist/commonjs/features/fluency/model/FluencyApiModel.js.map +1 -0
  59. package/dist/commonjs/features/fluency/model/FluencyDaysStreakModel.js +9 -0
  60. package/dist/commonjs/features/fluency/model/FluencyDaysStreakModel.js.map +1 -0
  61. package/dist/commonjs/features/fluency/model/FluencyInputModel.js +23 -0
  62. package/dist/commonjs/features/fluency/model/FluencyInputModel.js.map +1 -0
  63. package/dist/commonjs/features/fluency/model/FluencyMatrixModel.js +9 -0
  64. package/dist/commonjs/features/fluency/model/FluencyMatrixModel.js.map +1 -0
  65. package/dist/commonjs/features/fluency/model/FluencyModel.js +28 -0
  66. package/dist/commonjs/features/fluency/model/FluencyModel.js.map +1 -0
  67. package/dist/commonjs/features/fluency/model/FluencySolvingModel.js +9 -0
  68. package/dist/commonjs/features/fluency/model/FluencySolvingModel.js.map +1 -0
  69. package/dist/commonjs/index.js +12 -0
  70. package/dist/commonjs/index.js.map +1 -1
  71. package/dist/module/features/fluency/assets/DivideIcon.js +24 -0
  72. package/dist/module/features/fluency/assets/DivideIcon.js.map +1 -0
  73. package/dist/module/features/fluency/assets/SpringIcon.js +22 -0
  74. package/dist/module/features/fluency/assets/SpringIcon.js.map +1 -0
  75. package/dist/module/features/fluency/assets/StarFillIcon.js +21 -0
  76. package/dist/module/features/fluency/assets/StarFillIcon.js.map +1 -0
  77. package/dist/module/features/fluency/components/Fluency.js +92 -0
  78. package/dist/module/features/fluency/components/Fluency.js.map +1 -0
  79. package/dist/module/features/fluency/components/FluencySolving.js +36 -0
  80. package/dist/module/features/fluency/components/FluencySolving.js.map +1 -0
  81. package/dist/module/features/fluency/components/day-streak-counter/DayStreak.js +85 -0
  82. package/dist/module/features/fluency/components/day-streak-counter/DayStreak.js.map +1 -0
  83. package/dist/module/features/fluency/components/day-streak-counter/DayStreakCounter.js +67 -0
  84. package/dist/module/features/fluency/components/day-streak-counter/DayStreakCounter.js.map +1 -0
  85. package/dist/module/features/fluency/components/fluency-solving/FluencyEquationCard.js +117 -0
  86. package/dist/module/features/fluency/components/fluency-solving/FluencyEquationCard.js.map +1 -0
  87. package/dist/module/features/fluency/components/fluency-solving/FluencyNumpad.js +177 -0
  88. package/dist/module/features/fluency/components/fluency-solving/FluencyNumpad.js.map +1 -0
  89. package/dist/module/features/fluency/components/fluency-solving/FluencySolvingCard.js +57 -0
  90. package/dist/module/features/fluency/components/fluency-solving/FluencySolvingCard.js.map +1 -0
  91. package/dist/module/features/fluency/components/fluency-solving/FluencySolvingHeader.js +65 -0
  92. package/dist/module/features/fluency/components/fluency-solving/FluencySolvingHeader.js.map +1 -0
  93. package/dist/module/features/fluency/components/fluency-solving/FluencySolvingProgress.js +41 -0
  94. package/dist/module/features/fluency/components/fluency-solving/FluencySolvingProgress.js.map +1 -0
  95. package/dist/module/features/fluency/components/matrix/FluencyMatrix.js +30 -0
  96. package/dist/module/features/fluency/components/matrix/FluencyMatrix.js.map +1 -0
  97. package/dist/module/features/fluency/components/matrix/components/MatrixCell.js +41 -0
  98. package/dist/module/features/fluency/components/matrix/components/MatrixCell.js.map +1 -0
  99. package/dist/module/features/fluency/components/matrix/components/MatrixFill.js +51 -0
  100. package/dist/module/features/fluency/components/matrix/components/MatrixFill.js.map +1 -0
  101. package/dist/module/features/fluency/components/matrix/components/MatrixLegend.js +99 -0
  102. package/dist/module/features/fluency/components/matrix/components/MatrixLegend.js.map +1 -0
  103. package/dist/module/features/fluency/components/select-math-operator/MathOperatorRow.js +37 -0
  104. package/dist/module/features/fluency/components/select-math-operator/MathOperatorRow.js.map +1 -0
  105. package/dist/module/features/fluency/components/select-math-operator/ProgressBar.js +118 -0
  106. package/dist/module/features/fluency/components/select-math-operator/ProgressBar.js.map +1 -0
  107. package/dist/module/features/fluency/components/select-math-operator/SelectMathOperator.js +57 -0
  108. package/dist/module/features/fluency/components/select-math-operator/SelectMathOperator.js.map +1 -0
  109. package/dist/module/features/fluency/components/start-banner/BannerFlashcards.js +74 -0
  110. package/dist/module/features/fluency/components/start-banner/BannerFlashcards.js.map +1 -0
  111. package/dist/module/features/fluency/components/start-banner/MathFlashcard.js +67 -0
  112. package/dist/module/features/fluency/components/start-banner/MathFlashcard.js.map +1 -0
  113. package/dist/module/features/fluency/components/start-banner/StartBanner.js +105 -0
  114. package/dist/module/features/fluency/components/start-banner/StartBanner.js.map +1 -0
  115. package/dist/module/features/fluency/context/FluencyContext.js +11 -0
  116. package/dist/module/features/fluency/context/FluencyContext.js.map +1 -0
  117. package/dist/module/features/fluency/fluency.constants.js +77 -0
  118. package/dist/module/features/fluency/fluency.constants.js.map +1 -0
  119. package/dist/module/features/fluency/fluency.helpers.js +58 -0
  120. package/dist/module/features/fluency/fluency.helpers.js.map +1 -0
  121. package/dist/module/features/fluency/fluency.types.js +4 -0
  122. package/dist/module/features/fluency/fluency.types.js.map +1 -0
  123. package/dist/module/features/fluency/hooks/useFluencyModePreset.js +34 -0
  124. package/dist/module/features/fluency/hooks/useFluencyModePreset.js.map +1 -0
  125. package/dist/module/features/fluency/index.js +9 -0
  126. package/dist/module/features/fluency/index.js.map +1 -0
  127. package/dist/module/features/fluency/model/FluencyApiModel.js +6 -0
  128. package/dist/module/features/fluency/model/FluencyApiModel.js.map +1 -0
  129. package/dist/module/features/fluency/model/FluencyDaysStreakModel.js +4 -0
  130. package/dist/module/features/fluency/model/FluencyDaysStreakModel.js.map +1 -0
  131. package/dist/module/features/fluency/model/FluencyInputModel.js +18 -0
  132. package/dist/module/features/fluency/model/FluencyInputModel.js.map +1 -0
  133. package/dist/module/features/fluency/model/FluencyMatrixModel.js +4 -0
  134. package/dist/module/features/fluency/model/FluencyMatrixModel.js.map +1 -0
  135. package/dist/module/features/fluency/model/FluencyModel.js +23 -0
  136. package/dist/module/features/fluency/model/FluencyModel.js.map +1 -0
  137. package/dist/module/features/fluency/model/FluencySolvingModel.js +4 -0
  138. package/dist/module/features/fluency/model/FluencySolvingModel.js.map +1 -0
  139. package/dist/module/index.js +1 -0
  140. package/dist/module/index.js.map +1 -1
  141. package/dist/typescript/commonjs/features/fluency/__tests__/FluencyModel.test.d.ts +2 -0
  142. package/dist/typescript/commonjs/features/fluency/__tests__/FluencyModel.test.d.ts.map +1 -0
  143. package/dist/typescript/commonjs/features/fluency/assets/DivideIcon.d.ts +8 -0
  144. package/dist/typescript/commonjs/features/fluency/assets/DivideIcon.d.ts.map +1 -0
  145. package/dist/typescript/commonjs/features/fluency/assets/SpringIcon.d.ts +3 -0
  146. package/dist/typescript/commonjs/features/fluency/assets/SpringIcon.d.ts.map +1 -0
  147. package/dist/typescript/commonjs/features/fluency/assets/StarFillIcon.d.ts +3 -0
  148. package/dist/typescript/commonjs/features/fluency/assets/StarFillIcon.d.ts.map +1 -0
  149. package/dist/typescript/commonjs/features/fluency/components/Fluency.d.ts +13 -0
  150. package/dist/typescript/commonjs/features/fluency/components/Fluency.d.ts.map +1 -0
  151. package/dist/typescript/commonjs/features/fluency/components/FluencySolving.d.ts +9 -0
  152. package/dist/typescript/commonjs/features/fluency/components/FluencySolving.d.ts.map +1 -0
  153. package/dist/typescript/commonjs/features/fluency/components/day-streak-counter/DayStreak.d.ts +11 -0
  154. package/dist/typescript/commonjs/features/fluency/components/day-streak-counter/DayStreak.d.ts.map +1 -0
  155. package/dist/typescript/commonjs/features/fluency/components/day-streak-counter/DayStreakCounter.d.ts +3 -0
  156. package/dist/typescript/commonjs/features/fluency/components/day-streak-counter/DayStreakCounter.d.ts.map +1 -0
  157. package/dist/typescript/commonjs/features/fluency/components/fluency-solving/FluencyEquationCard.d.ts +12 -0
  158. package/dist/typescript/commonjs/features/fluency/components/fluency-solving/FluencyEquationCard.d.ts.map +1 -0
  159. package/dist/typescript/commonjs/features/fluency/components/fluency-solving/FluencyNumpad.d.ts +3 -0
  160. package/dist/typescript/commonjs/features/fluency/components/fluency-solving/FluencyNumpad.d.ts.map +1 -0
  161. package/dist/typescript/commonjs/features/fluency/components/fluency-solving/FluencySolvingCard.d.ts +3 -0
  162. package/dist/typescript/commonjs/features/fluency/components/fluency-solving/FluencySolvingCard.d.ts.map +1 -0
  163. package/dist/typescript/commonjs/features/fluency/components/fluency-solving/FluencySolvingHeader.d.ts +7 -0
  164. package/dist/typescript/commonjs/features/fluency/components/fluency-solving/FluencySolvingHeader.d.ts.map +1 -0
  165. package/dist/typescript/commonjs/features/fluency/components/fluency-solving/FluencySolvingProgress.d.ts +8 -0
  166. package/dist/typescript/commonjs/features/fluency/components/fluency-solving/FluencySolvingProgress.d.ts.map +1 -0
  167. package/dist/typescript/commonjs/features/fluency/components/matrix/FluencyMatrix.d.ts +3 -0
  168. package/dist/typescript/commonjs/features/fluency/components/matrix/FluencyMatrix.d.ts.map +1 -0
  169. package/dist/typescript/commonjs/features/fluency/components/matrix/components/MatrixCell.d.ts +11 -0
  170. package/dist/typescript/commonjs/features/fluency/components/matrix/components/MatrixCell.d.ts.map +1 -0
  171. package/dist/typescript/commonjs/features/fluency/components/matrix/components/MatrixFill.d.ts +3 -0
  172. package/dist/typescript/commonjs/features/fluency/components/matrix/components/MatrixFill.d.ts.map +1 -0
  173. package/dist/typescript/commonjs/features/fluency/components/matrix/components/MatrixLegend.d.ts +5 -0
  174. package/dist/typescript/commonjs/features/fluency/components/matrix/components/MatrixLegend.d.ts.map +1 -0
  175. package/dist/typescript/commonjs/features/fluency/components/select-math-operator/MathOperatorRow.d.ts +13 -0
  176. package/dist/typescript/commonjs/features/fluency/components/select-math-operator/MathOperatorRow.d.ts.map +1 -0
  177. package/dist/typescript/commonjs/features/fluency/components/select-math-operator/ProgressBar.d.ts +8 -0
  178. package/dist/typescript/commonjs/features/fluency/components/select-math-operator/ProgressBar.d.ts.map +1 -0
  179. package/dist/typescript/commonjs/features/fluency/components/select-math-operator/SelectMathOperator.d.ts +3 -0
  180. package/dist/typescript/commonjs/features/fluency/components/select-math-operator/SelectMathOperator.d.ts.map +1 -0
  181. package/dist/typescript/commonjs/features/fluency/components/start-banner/BannerFlashcards.d.ts +11 -0
  182. package/dist/typescript/commonjs/features/fluency/components/start-banner/BannerFlashcards.d.ts.map +1 -0
  183. package/dist/typescript/commonjs/features/fluency/components/start-banner/MathFlashcard.d.ts +28 -0
  184. package/dist/typescript/commonjs/features/fluency/components/start-banner/MathFlashcard.d.ts.map +1 -0
  185. package/dist/typescript/commonjs/features/fluency/components/start-banner/StartBanner.d.ts +3 -0
  186. package/dist/typescript/commonjs/features/fluency/components/start-banner/StartBanner.d.ts.map +1 -0
  187. package/dist/typescript/commonjs/features/fluency/context/FluencyContext.d.ts +11 -0
  188. package/dist/typescript/commonjs/features/fluency/context/FluencyContext.d.ts.map +1 -0
  189. package/dist/typescript/commonjs/features/fluency/fluency.constants.d.ts +25 -0
  190. package/dist/typescript/commonjs/features/fluency/fluency.constants.d.ts.map +1 -0
  191. package/dist/typescript/commonjs/features/fluency/fluency.helpers.d.ts +19 -0
  192. package/dist/typescript/commonjs/features/fluency/fluency.helpers.d.ts.map +1 -0
  193. package/dist/typescript/commonjs/features/fluency/fluency.types.d.ts +46 -0
  194. package/dist/typescript/commonjs/features/fluency/fluency.types.d.ts.map +1 -0
  195. package/dist/typescript/commonjs/features/fluency/hooks/useFluencyModePreset.d.ts +7 -0
  196. package/dist/typescript/commonjs/features/fluency/hooks/useFluencyModePreset.d.ts.map +1 -0
  197. package/dist/typescript/commonjs/features/fluency/index.d.ts +7 -0
  198. package/dist/typescript/commonjs/features/fluency/index.d.ts.map +1 -0
  199. package/dist/typescript/commonjs/features/fluency/model/FluencyApiModel.d.ts +6 -0
  200. package/dist/typescript/commonjs/features/fluency/model/FluencyApiModel.d.ts.map +1 -0
  201. package/dist/typescript/commonjs/features/fluency/model/FluencyDaysStreakModel.d.ts +3 -0
  202. package/dist/typescript/commonjs/features/fluency/model/FluencyDaysStreakModel.d.ts.map +1 -0
  203. package/dist/typescript/commonjs/features/fluency/model/FluencyInputModel.d.ts +12 -0
  204. package/dist/typescript/commonjs/features/fluency/model/FluencyInputModel.d.ts.map +1 -0
  205. package/dist/typescript/commonjs/features/fluency/model/FluencyMatrixModel.d.ts +3 -0
  206. package/dist/typescript/commonjs/features/fluency/model/FluencyMatrixModel.d.ts.map +1 -0
  207. package/dist/typescript/commonjs/features/fluency/model/FluencyModel.d.ts +21 -0
  208. package/dist/typescript/commonjs/features/fluency/model/FluencyModel.d.ts.map +1 -0
  209. package/dist/typescript/commonjs/features/fluency/model/FluencySolvingModel.d.ts +3 -0
  210. package/dist/typescript/commonjs/features/fluency/model/FluencySolvingModel.d.ts.map +1 -0
  211. package/dist/typescript/commonjs/index.d.ts +1 -0
  212. package/dist/typescript/commonjs/index.d.ts.map +1 -1
  213. package/dist/typescript/module/features/fluency/__tests__/FluencyModel.test.d.ts +2 -0
  214. package/dist/typescript/module/features/fluency/__tests__/FluencyModel.test.d.ts.map +1 -0
  215. package/dist/typescript/module/features/fluency/assets/DivideIcon.d.ts +8 -0
  216. package/dist/typescript/module/features/fluency/assets/DivideIcon.d.ts.map +1 -0
  217. package/dist/typescript/module/features/fluency/assets/SpringIcon.d.ts +3 -0
  218. package/dist/typescript/module/features/fluency/assets/SpringIcon.d.ts.map +1 -0
  219. package/dist/typescript/module/features/fluency/assets/StarFillIcon.d.ts +3 -0
  220. package/dist/typescript/module/features/fluency/assets/StarFillIcon.d.ts.map +1 -0
  221. package/dist/typescript/module/features/fluency/components/Fluency.d.ts +13 -0
  222. package/dist/typescript/module/features/fluency/components/Fluency.d.ts.map +1 -0
  223. package/dist/typescript/module/features/fluency/components/FluencySolving.d.ts +9 -0
  224. package/dist/typescript/module/features/fluency/components/FluencySolving.d.ts.map +1 -0
  225. package/dist/typescript/module/features/fluency/components/day-streak-counter/DayStreak.d.ts +11 -0
  226. package/dist/typescript/module/features/fluency/components/day-streak-counter/DayStreak.d.ts.map +1 -0
  227. package/dist/typescript/module/features/fluency/components/day-streak-counter/DayStreakCounter.d.ts +3 -0
  228. package/dist/typescript/module/features/fluency/components/day-streak-counter/DayStreakCounter.d.ts.map +1 -0
  229. package/dist/typescript/module/features/fluency/components/fluency-solving/FluencyEquationCard.d.ts +12 -0
  230. package/dist/typescript/module/features/fluency/components/fluency-solving/FluencyEquationCard.d.ts.map +1 -0
  231. package/dist/typescript/module/features/fluency/components/fluency-solving/FluencyNumpad.d.ts +3 -0
  232. package/dist/typescript/module/features/fluency/components/fluency-solving/FluencyNumpad.d.ts.map +1 -0
  233. package/dist/typescript/module/features/fluency/components/fluency-solving/FluencySolvingCard.d.ts +3 -0
  234. package/dist/typescript/module/features/fluency/components/fluency-solving/FluencySolvingCard.d.ts.map +1 -0
  235. package/dist/typescript/module/features/fluency/components/fluency-solving/FluencySolvingHeader.d.ts +7 -0
  236. package/dist/typescript/module/features/fluency/components/fluency-solving/FluencySolvingHeader.d.ts.map +1 -0
  237. package/dist/typescript/module/features/fluency/components/fluency-solving/FluencySolvingProgress.d.ts +8 -0
  238. package/dist/typescript/module/features/fluency/components/fluency-solving/FluencySolvingProgress.d.ts.map +1 -0
  239. package/dist/typescript/module/features/fluency/components/matrix/FluencyMatrix.d.ts +3 -0
  240. package/dist/typescript/module/features/fluency/components/matrix/FluencyMatrix.d.ts.map +1 -0
  241. package/dist/typescript/module/features/fluency/components/matrix/components/MatrixCell.d.ts +11 -0
  242. package/dist/typescript/module/features/fluency/components/matrix/components/MatrixCell.d.ts.map +1 -0
  243. package/dist/typescript/module/features/fluency/components/matrix/components/MatrixFill.d.ts +3 -0
  244. package/dist/typescript/module/features/fluency/components/matrix/components/MatrixFill.d.ts.map +1 -0
  245. package/dist/typescript/module/features/fluency/components/matrix/components/MatrixLegend.d.ts +5 -0
  246. package/dist/typescript/module/features/fluency/components/matrix/components/MatrixLegend.d.ts.map +1 -0
  247. package/dist/typescript/module/features/fluency/components/select-math-operator/MathOperatorRow.d.ts +13 -0
  248. package/dist/typescript/module/features/fluency/components/select-math-operator/MathOperatorRow.d.ts.map +1 -0
  249. package/dist/typescript/module/features/fluency/components/select-math-operator/ProgressBar.d.ts +8 -0
  250. package/dist/typescript/module/features/fluency/components/select-math-operator/ProgressBar.d.ts.map +1 -0
  251. package/dist/typescript/module/features/fluency/components/select-math-operator/SelectMathOperator.d.ts +3 -0
  252. package/dist/typescript/module/features/fluency/components/select-math-operator/SelectMathOperator.d.ts.map +1 -0
  253. package/dist/typescript/module/features/fluency/components/start-banner/BannerFlashcards.d.ts +11 -0
  254. package/dist/typescript/module/features/fluency/components/start-banner/BannerFlashcards.d.ts.map +1 -0
  255. package/dist/typescript/module/features/fluency/components/start-banner/MathFlashcard.d.ts +28 -0
  256. package/dist/typescript/module/features/fluency/components/start-banner/MathFlashcard.d.ts.map +1 -0
  257. package/dist/typescript/module/features/fluency/components/start-banner/StartBanner.d.ts +3 -0
  258. package/dist/typescript/module/features/fluency/components/start-banner/StartBanner.d.ts.map +1 -0
  259. package/dist/typescript/module/features/fluency/context/FluencyContext.d.ts +11 -0
  260. package/dist/typescript/module/features/fluency/context/FluencyContext.d.ts.map +1 -0
  261. package/dist/typescript/module/features/fluency/fluency.constants.d.ts +25 -0
  262. package/dist/typescript/module/features/fluency/fluency.constants.d.ts.map +1 -0
  263. package/dist/typescript/module/features/fluency/fluency.helpers.d.ts +19 -0
  264. package/dist/typescript/module/features/fluency/fluency.helpers.d.ts.map +1 -0
  265. package/dist/typescript/module/features/fluency/fluency.types.d.ts +46 -0
  266. package/dist/typescript/module/features/fluency/fluency.types.d.ts.map +1 -0
  267. package/dist/typescript/module/features/fluency/hooks/useFluencyModePreset.d.ts +7 -0
  268. package/dist/typescript/module/features/fluency/hooks/useFluencyModePreset.d.ts.map +1 -0
  269. package/dist/typescript/module/features/fluency/index.d.ts +7 -0
  270. package/dist/typescript/module/features/fluency/index.d.ts.map +1 -0
  271. package/dist/typescript/module/features/fluency/model/FluencyApiModel.d.ts +6 -0
  272. package/dist/typescript/module/features/fluency/model/FluencyApiModel.d.ts.map +1 -0
  273. package/dist/typescript/module/features/fluency/model/FluencyDaysStreakModel.d.ts +3 -0
  274. package/dist/typescript/module/features/fluency/model/FluencyDaysStreakModel.d.ts.map +1 -0
  275. package/dist/typescript/module/features/fluency/model/FluencyInputModel.d.ts +12 -0
  276. package/dist/typescript/module/features/fluency/model/FluencyInputModel.d.ts.map +1 -0
  277. package/dist/typescript/module/features/fluency/model/FluencyMatrixModel.d.ts +3 -0
  278. package/dist/typescript/module/features/fluency/model/FluencyMatrixModel.d.ts.map +1 -0
  279. package/dist/typescript/module/features/fluency/model/FluencyModel.d.ts +21 -0
  280. package/dist/typescript/module/features/fluency/model/FluencyModel.d.ts.map +1 -0
  281. package/dist/typescript/module/features/fluency/model/FluencySolvingModel.d.ts +3 -0
  282. package/dist/typescript/module/features/fluency/model/FluencySolvingModel.d.ts.map +1 -0
  283. package/dist/typescript/module/index.d.ts +1 -0
  284. package/dist/typescript/module/index.d.ts.map +1 -1
  285. package/package.json +1 -1
  286. package/src/features/fluency/__tests__/FluencyModel.test.ts +28 -0
  287. package/src/features/fluency/assets/DivideIcon.tsx +21 -0
  288. package/src/features/fluency/assets/SpringIcon.tsx +17 -0
  289. package/src/features/fluency/assets/StarFillIcon.tsx +16 -0
  290. package/src/features/fluency/components/Fluency.tsx +101 -0
  291. package/src/features/fluency/components/FluencySolving.tsx +32 -0
  292. package/src/features/fluency/components/day-streak-counter/DayStreak.tsx +82 -0
  293. package/src/features/fluency/components/day-streak-counter/DayStreakCounter.tsx +68 -0
  294. package/src/features/fluency/components/fluency-solving/FluencyEquationCard.tsx +115 -0
  295. package/src/features/fluency/components/fluency-solving/FluencyNumpad.tsx +150 -0
  296. package/src/features/fluency/components/fluency-solving/FluencySolvingCard.tsx +49 -0
  297. package/src/features/fluency/components/fluency-solving/FluencySolvingHeader.tsx +67 -0
  298. package/src/features/fluency/components/fluency-solving/FluencySolvingProgress.tsx +40 -0
  299. package/src/features/fluency/components/matrix/FluencyMatrix.tsx +29 -0
  300. package/src/features/fluency/components/matrix/components/MatrixCell.tsx +46 -0
  301. package/src/features/fluency/components/matrix/components/MatrixFill.tsx +50 -0
  302. package/src/features/fluency/components/matrix/components/MatrixLegend.tsx +102 -0
  303. package/src/features/fluency/components/select-math-operator/MathOperatorRow.tsx +38 -0
  304. package/src/features/fluency/components/select-math-operator/ProgressBar.tsx +127 -0
  305. package/src/features/fluency/components/select-math-operator/SelectMathOperator.tsx +49 -0
  306. package/src/features/fluency/components/start-banner/BannerFlashcards.tsx +45 -0
  307. package/src/features/fluency/components/start-banner/MathFlashcard.tsx +69 -0
  308. package/src/features/fluency/components/start-banner/StartBanner.tsx +105 -0
  309. package/src/features/fluency/context/FluencyContext.ts +20 -0
  310. package/src/features/fluency/fluency.constants.ts +83 -0
  311. package/src/features/fluency/fluency.helpers.ts +71 -0
  312. package/src/features/fluency/fluency.types.ts +41 -0
  313. package/src/features/fluency/hooks/useFluencyModePreset.ts +24 -0
  314. package/src/features/fluency/index.ts +6 -0
  315. package/src/features/fluency/model/FluencyApiModel.ts +5 -0
  316. package/src/features/fluency/model/FluencyDaysStreakModel.ts +1 -0
  317. package/src/features/fluency/model/FluencyInputModel.ts +21 -0
  318. package/src/features/fluency/model/FluencyMatrixModel.ts +1 -0
  319. package/src/features/fluency/model/FluencyModel.ts +30 -0
  320. package/src/features/fluency/model/FluencySolvingModel.ts +1 -0
  321. package/src/i18n/.generated/schema.json +23 -0
  322. package/src/index.ts +1 -0
@@ -0,0 +1,21 @@
1
+ import React from 'react'
2
+ import Svg, { Path } from 'react-native-svg'
3
+ import { COLORS } from '@magmamath/react-native-ui'
4
+
5
+ type DivideIconProps = {
6
+ size?: number
7
+ color?: string
8
+ }
9
+
10
+ export const DivideIcon = ({ size = 20, color = COLORS.NEUTRAL_9 }: DivideIconProps) => {
11
+ return (
12
+ <Svg width={size} height={size} viewBox="0 0 17 17" fill="none">
13
+ <Path
14
+ fillRule="evenodd"
15
+ clipRule="evenodd"
16
+ d="M16 .22a.75.75 0 010 1.06L1.28 16a.75.75 0 01-1.06-1.06L14.94.22a.75.75 0 011.06 0z"
17
+ fill={color}
18
+ />
19
+ </Svg>
20
+ )
21
+ }
@@ -0,0 +1,17 @@
1
+ import * as React from 'react'
2
+ import Svg, { Path } from 'react-native-svg'
3
+
4
+ export const SpringIcon = () => {
5
+ return (
6
+ <Svg width={89} height={28} viewBox="0 0 89 28" fill="none">
7
+ <Path
8
+ opacity={0.3}
9
+ d="M78.6 22.803c5.16-6.21 7.39-12.429 7.39-12.429s-9.147.354-13.334-3.964m4.843 8.342C40.345 31.653 33.237 6.535 44.312 2.88 55.388-.774 56.293 23.042 28.317 24.918 17.69 25.63 8.093 23.18 2.5 18.683"
10
+ stroke="#33334D"
11
+ strokeWidth={5}
12
+ strokeLinecap="round"
13
+ strokeLinejoin="round"
14
+ />
15
+ </Svg>
16
+ )
17
+ }
@@ -0,0 +1,16 @@
1
+ import React from 'react'
2
+ import Svg, { Path } from 'react-native-svg'
3
+
4
+ export const StarFillIcon = () => {
5
+ return (
6
+ <Svg width={10} height={11} viewBox="0 0 10 11" fill="none">
7
+ <Path
8
+ fillRule="evenodd"
9
+ clipRule="evenodd"
10
+ d="M5.767.432a.89.89 0 00-1.526 0L2.925 2.625l-2.25.563A.89.89 0 00.26 4.68l1.664 1.664-.553 2.626a.89.89 0 001.287.97l2.34-1.24 1.55.862.824.412a.89.89 0 001.269-.98l-.559-2.65L9.747 4.68a.89.89 0 00-.413-1.492l-2.251-.563L5.767.432z"
11
+ fill="#33334D"
12
+ fillOpacity={0.25}
13
+ />
14
+ </Svg>
15
+ )
16
+ }
@@ -0,0 +1,101 @@
1
+ import React from 'react'
2
+ import { View, StyleSheet, useWindowDimensions } from 'react-native'
3
+ import {
4
+ Button,
5
+ ButtonVariant,
6
+ Typography,
7
+ HeadingVariants,
8
+ SPACING,
9
+ COLORS,
10
+ } from '@magmamath/react-native-ui'
11
+ import { useText } from '../../../i18n/i18n'
12
+ import { StartBanner } from './start-banner/StartBanner'
13
+ import { DayStreakCounter } from './day-streak-counter/DayStreakCounter'
14
+ import { SelectMathOperator } from './select-math-operator/SelectMathOperator'
15
+ import { FluencyMatrix } from './matrix/FluencyMatrix'
16
+ import type { FluencyModel } from '../model/FluencyModel'
17
+ import { FluencyProvider } from '../context/FluencyContext'
18
+ import type { FluencyMode } from '../fluency.constants'
19
+ import { isWeb } from '../../../shared/common.constants'
20
+ import { MenuIcon } from '../../../shared/icons/MenuIcon'
21
+ import { BURGER_MENU_BREAKPOINT } from '@magmamath/students-features'
22
+
23
+ type FluencyProps = {
24
+ model: FluencyModel
25
+ onMenuPress?: () => void
26
+ onStartPress?: () => void
27
+ onPracticePress?: () => void
28
+ onModeSelectPress?: (mode: FluencyMode) => void
29
+ }
30
+
31
+ export const Fluency = ({
32
+ model,
33
+ onMenuPress,
34
+ onStartPress,
35
+ onPracticePress,
36
+ onModeSelectPress,
37
+ }: FluencyProps) => {
38
+ const t = useText()
39
+ const dimensions = useWindowDimensions()
40
+ const withMenuButton = isWeb && dimensions.width <= BURGER_MENU_BREAKPOINT
41
+
42
+ return (
43
+ <FluencyProvider value={{ model, onStartPress, onPracticePress, onModeSelectPress }}>
44
+ <View style={styles.container}>
45
+ <View style={styles.titleRow}>
46
+ {withMenuButton && (
47
+ <View style={styles.burgerMenu}>
48
+ <Button
49
+ onPress={onMenuPress}
50
+ variant={ButtonVariant.TERTIARY}
51
+ icon={<MenuIcon size={24} />}
52
+ />
53
+ </View>
54
+ )}
55
+ <Typography variant={HeadingVariants.H2} style={styles.title}>
56
+ {t('student.fluency.title')}
57
+ </Typography>
58
+ </View>
59
+
60
+ <View style={styles.header}>
61
+ <StartBanner />
62
+ <DayStreakCounter />
63
+ </View>
64
+
65
+ <View style={styles.matrixContainer}>
66
+ <View style={styles.operatorWrapper}>
67
+ <SelectMathOperator />
68
+ </View>
69
+ <FluencyMatrix />
70
+ </View>
71
+ </View>
72
+ </FluencyProvider>
73
+ )
74
+ }
75
+
76
+ const styles = StyleSheet.create({
77
+ container: {},
78
+ titleRow: {
79
+ flexDirection: 'row',
80
+ alignItems: 'center',
81
+ },
82
+ burgerMenu: {
83
+ marginRight: SPACING[200],
84
+ },
85
+ title: { color: COLORS.NEUTRAL_9 },
86
+ header: {
87
+ height: 182,
88
+ flexDirection: 'row',
89
+ marginTop: SPACING[400],
90
+ gap: SPACING[400],
91
+ zIndex: 1,
92
+ },
93
+ matrixContainer: {
94
+ flexDirection: 'row',
95
+ marginTop: SPACING[400],
96
+ gap: SPACING[200],
97
+ },
98
+ operatorWrapper: {
99
+ alignSelf: 'flex-start',
100
+ },
101
+ })
@@ -0,0 +1,32 @@
1
+ import React from 'react'
2
+ import { View, StyleSheet } from 'react-native'
3
+ import { COLORS } from '@magmamath/react-native-ui'
4
+ import type { FluencyModel } from '../model/FluencyModel'
5
+ import { FluencyProvider } from '../context/FluencyContext'
6
+ import { FluencySolvingHeader } from './fluency-solving/FluencySolvingHeader'
7
+ import { FluencySolvingProgress } from './fluency-solving/FluencySolvingProgress'
8
+ import { FluencySolvingCard } from './fluency-solving/FluencySolvingCard'
9
+
10
+ type FluencySolvingProps = {
11
+ model: FluencyModel
12
+ onClosePress?: () => void
13
+ }
14
+
15
+ export const FluencySolving = ({ model, onClosePress }: FluencySolvingProps) => {
16
+ return (
17
+ <FluencyProvider value={{ model }}>
18
+ <View style={styles.container}>
19
+ <FluencySolvingHeader onClosePress={onClosePress} />
20
+ <FluencySolvingProgress total={20} activeIndex={4} />
21
+ <FluencySolvingCard />
22
+ </View>
23
+ </FluencyProvider>
24
+ )
25
+ }
26
+
27
+ const styles = StyleSheet.create({
28
+ container: {
29
+ flex: 1,
30
+ backgroundColor: COLORS.NEUTRAL_1,
31
+ },
32
+ })
@@ -0,0 +1,82 @@
1
+ import {
2
+ BORDER_RADIUS,
3
+ COLORS,
4
+ CorrectIcon,
5
+ HeadingVariants,
6
+ SPACING,
7
+ Typography,
8
+ } from '@magmamath/react-native-ui'
9
+ import React from 'react'
10
+ import { StyleSheet, TextStyle, View, ViewStyle } from 'react-native'
11
+ import type { FluencyModePreset } from '../../fluency.types'
12
+
13
+ const CIRCLE_SIZE = SPACING[800]
14
+ const CIRCLE_BORDER_RADIUS = BORDER_RADIUS[400]
15
+
16
+ type StreakStatus = 'missed' | 'gained' | 'today'
17
+
18
+ type StreakDayProps = {
19
+ label: string
20
+ status: StreakStatus
21
+ streakColor: FluencyModePreset['header']['streakColor']
22
+ }
23
+
24
+ type StatusStyle = {
25
+ circle: ViewStyle
26
+ label: TextStyle
27
+ hasIcon: boolean
28
+ }
29
+
30
+ const getStatusStyle = (
31
+ status: StreakStatus,
32
+ streakColor: FluencyModePreset['header']['streakColor']
33
+ ): StatusStyle => {
34
+ if (status === 'gained') {
35
+ return {
36
+ circle: { backgroundColor: streakColor.gained, borderWidth: 1, borderColor: COLORS.NEUTRAL_3 },
37
+ label: { color: streakColor.gained },
38
+ hasIcon: true,
39
+ }
40
+ }
41
+ if (status === 'today') {
42
+ return {
43
+ circle: { backgroundColor: COLORS.NEUTRAL_2, borderWidth: 3, borderColor: streakColor.todayBorder },
44
+ label: { color: streakColor.todayBorder },
45
+ hasIcon: false,
46
+ }
47
+ }
48
+ return {
49
+ circle: { backgroundColor: COLORS.NEUTRAL_2, borderWidth: 1, borderColor: COLORS.NEUTRAL_3 },
50
+ label: { color: COLORS.NEUTRAL_4 },
51
+ hasIcon: false,
52
+ }
53
+ }
54
+
55
+ export const StreakDay = ({ label, status, streakColor }: StreakDayProps) => {
56
+ const { circle, label: labelStyle, hasIcon } = getStatusStyle(status, streakColor)
57
+
58
+ return (
59
+ <View style={styles.container}>
60
+ <View style={[styles.circle, circle]}>
61
+ {hasIcon && <CorrectIcon color={COLORS.NEUTRAL_1} />}
62
+ </View>
63
+ <Typography variant={HeadingVariants.H3} style={labelStyle}>
64
+ {label}
65
+ </Typography>
66
+ </View>
67
+ )
68
+ }
69
+
70
+ const styles = StyleSheet.create({
71
+ container: {
72
+ alignItems: 'center',
73
+ gap: SPACING[100],
74
+ },
75
+ circle: {
76
+ width: CIRCLE_SIZE,
77
+ height: CIRCLE_SIZE,
78
+ borderRadius: CIRCLE_BORDER_RADIUS,
79
+ alignItems: 'center',
80
+ justifyContent: 'center',
81
+ },
82
+ })
@@ -0,0 +1,68 @@
1
+ import React from 'react'
2
+ import { View, StyleSheet } from 'react-native'
3
+ import { BORDER_RADIUS, COLORS, SHADOWS, SPACING, Typography } from '@magmamath/react-native-ui'
4
+ import { StreakDay } from './DayStreak'
5
+ import { useFluencyModePreset } from '../../hooks/useFluencyModePreset'
6
+ import { useText } from '../../../../i18n/i18n'
7
+
8
+ export const DayStreakCounter = () => {
9
+ const t = useText()
10
+ const { header } = useFluencyModePreset()
11
+
12
+ return (
13
+ <View style={styles.container}>
14
+ <Typography style={styles.label}>{t('student.fluency.practiceThisWeek')}</Typography>
15
+
16
+ <View style={styles.streakDays}>
17
+ {/* TODO: Replace hardcoded days and statuses with real streak data from the model */}
18
+ <StreakDay
19
+ label={t('student.fluency.dayMonday')}
20
+ status="gained"
21
+ streakColor={header.streakColor}
22
+ />
23
+ <StreakDay
24
+ label={t('student.fluency.dayTuesday')}
25
+ status="gained"
26
+ streakColor={header.streakColor}
27
+ />
28
+ <StreakDay
29
+ label={t('student.fluency.dayWednesday')}
30
+ status="missed"
31
+ streakColor={header.streakColor}
32
+ />
33
+ <StreakDay
34
+ label={t('student.fluency.dayThursday')}
35
+ status="today"
36
+ streakColor={header.streakColor}
37
+ />
38
+ <StreakDay
39
+ label={t('student.fluency.dayFriday')}
40
+ status="gained"
41
+ streakColor={header.streakColor}
42
+ />
43
+ </View>
44
+ </View>
45
+ )
46
+ }
47
+
48
+ const styles = StyleSheet.create({
49
+ container: {
50
+ height: '100%',
51
+ width: 230,
52
+ paddingVertical: SPACING[200],
53
+ paddingHorizontal: SPACING[400],
54
+ borderRadius: BORDER_RADIUS[300],
55
+ backgroundColor: COLORS.NEUTRAL_1,
56
+ ...SHADOWS[1],
57
+ },
58
+ label: {
59
+ fontSize: SPACING[300],
60
+ fontWeight: '700',
61
+ color: COLORS.NEUTRAL_8,
62
+ },
63
+ streakDays: {
64
+ flexDirection: 'row',
65
+ marginTop: 10,
66
+ gap: SPACING[200],
67
+ },
68
+ })
@@ -0,0 +1,115 @@
1
+ import React, { ComponentType } from 'react'
2
+ import { View, StyleSheet } from 'react-native'
3
+ import {
4
+ BORDER_RADIUS,
5
+ COLORS,
6
+ FONT_FAMILY,
7
+ HeadingVariants,
8
+ SHADOWS,
9
+ SPACING,
10
+ Typography,
11
+ } from '@magmamath/react-native-ui'
12
+
13
+ type FluencyEquationCardProps = {
14
+ accentColor: string
15
+ OperatorIcon: ComponentType<{ color?: string; size?: number }>
16
+ input: string
17
+ }
18
+
19
+ export const FluencyEquationCard = ({
20
+ accentColor,
21
+ OperatorIcon,
22
+ input,
23
+ }: FluencyEquationCardProps) => {
24
+ const answerTextStyle = [styles.number, styles.answerText, { color: accentColor }]
25
+
26
+ return (
27
+ <View style={styles.stack}>
28
+ <View style={[styles.cardBase, styles.cardLayer2]} />
29
+ <View style={[styles.cardBase, styles.cardLayer1]} />
30
+ <View style={[styles.cardBase, styles.cardFront]}>
31
+ <Typography variant={HeadingVariants.H9} style={styles.cardLabel}>
32
+ Type your answer
33
+ </Typography>
34
+
35
+ <View style={styles.equationRow}>
36
+ <Typography style={styles.number}>6</Typography>
37
+ <OperatorIcon color={accentColor} size={36} />
38
+ <Typography style={styles.number}>6</Typography>
39
+ <Typography style={styles.equals}>=</Typography>
40
+
41
+ <View style={styles.answerBox}>
42
+ <Typography style={answerTextStyle}>{input}</Typography>
43
+ </View>
44
+ </View>
45
+ </View>
46
+ </View>
47
+ )
48
+ }
49
+
50
+ const CARD_HEIGHT = 260
51
+
52
+ const styles = StyleSheet.create({
53
+ stack: {
54
+ width: '100%',
55
+ maxWidth: 560,
56
+ },
57
+ cardBase: {
58
+ height: CARD_HEIGHT,
59
+ borderRadius: BORDER_RADIUS[400],
60
+ backgroundColor: COLORS.NEUTRAL_1,
61
+ ...SHADOWS[5],
62
+ },
63
+ cardLayer2: {
64
+ position: 'absolute',
65
+ top: 24,
66
+ left: 40,
67
+ right: 40,
68
+ },
69
+ cardLayer1: {
70
+ position: 'absolute',
71
+ top: 12,
72
+ left: 20,
73
+ right: 20,
74
+ ...SHADOWS[5],
75
+ },
76
+ cardFront: {
77
+ alignItems: 'center',
78
+ justifyContent: 'center',
79
+ },
80
+ cardLabel: {
81
+ fontSize: 11,
82
+ fontWeight: '700',
83
+ letterSpacing: 1.3,
84
+ marginBottom: SPACING[300],
85
+ color: COLORS.NEUTRAL_7,
86
+ },
87
+ equationRow: {
88
+ flexDirection: 'row',
89
+ alignItems: 'center',
90
+ gap: SPACING[300],
91
+ marginTop: SPACING[600],
92
+ },
93
+ number: {
94
+ fontSize: 60,
95
+ color: COLORS.NEUTRAL_10,
96
+ fontWeight: '700',
97
+ fontFamily: FONT_FAMILY.buenosAires,
98
+ },
99
+ equals: {
100
+ fontSize: 60,
101
+ color: COLORS.NEUTRAL_7,
102
+ fontWeight: '700',
103
+ fontFamily: FONT_FAMILY.buenosAires,
104
+ },
105
+ answerBox: {
106
+ width: 100,
107
+ height: 44,
108
+ alignItems: 'center',
109
+ borderBottomWidth: 8,
110
+ borderBottomColor: COLORS.NEUTRAL_10,
111
+ },
112
+ answerText: {
113
+ position: 'absolute',
114
+ },
115
+ })
@@ -0,0 +1,150 @@
1
+ import React from 'react'
2
+ import { StyleSheet, View } from 'react-native'
3
+ import { useUnit } from 'effector-react'
4
+ import {
5
+ ButtonStates,
6
+ COLORS,
7
+ FONT_FAMILY,
8
+ SelectGroup,
9
+ SelectOptionColor,
10
+ SelectOptionSize,
11
+ SPACING,
12
+ } from '@magmamath/react-native-ui'
13
+ import { BackspaceIcon } from '../../../../shared/icons/keyboard/BackspaceIcon'
14
+ import { useFluency } from '../../context/FluencyContext'
15
+ import { useFluencyModePreset } from '../../hooks/useFluencyModePreset'
16
+
17
+ type NumpadKey = {
18
+ key: string
19
+ title: string | React.ReactNode
20
+ value: number | 'backspace' | 'enter'
21
+ customColorScheme?: typeof ACTION_KEY_COLOR_SCHEME
22
+ }
23
+
24
+ const ACTION_KEY_COLOR_SCHEME = {
25
+ [ButtonStates.DEFAULT]: {
26
+ backgroundColor: COLORS.NEUTRAL_3,
27
+ borderColor: COLORS.NEUTRAL_5,
28
+ raiseColor: COLORS.NEUTRAL_5,
29
+ color: COLORS.NEUTRAL_9,
30
+ },
31
+ [ButtonStates.HOVER]: {
32
+ backgroundColor: COLORS.NEUTRAL_2,
33
+ borderColor: COLORS.NEUTRAL_4,
34
+ raiseColor: COLORS.NEUTRAL_4,
35
+ color: COLORS.NEUTRAL_9,
36
+ },
37
+ }
38
+
39
+ const NUMPAD_KEYS: NumpadKey[] = [
40
+ { key: '1', title: '1', value: 1 },
41
+ { key: '2', title: '2', value: 2 },
42
+ { key: '3', title: '3', value: 3 },
43
+ { key: '4', title: '4', value: 4 },
44
+ { key: '5', title: '5', value: 5 },
45
+ { key: '6', title: '6', value: 6 },
46
+ { key: '7', title: '7', value: 7 },
47
+ { key: '8', title: '8', value: 8 },
48
+ { key: '9', title: '9', value: 9 },
49
+ {
50
+ key: 'backspace',
51
+ title: <BackspaceIcon size={20} color={COLORS.NEUTRAL_9} />,
52
+ value: 'backspace',
53
+ customColorScheme: ACTION_KEY_COLOR_SCHEME,
54
+ },
55
+ { key: '0', title: '0', value: 0 },
56
+ { key: 'enter', title: 'Enter', value: 'enter', customColorScheme: ACTION_KEY_COLOR_SCHEME },
57
+ ]
58
+
59
+ export const FluencyNumpad = () => {
60
+ const { model } = useFluency()
61
+ const { header, matrix } = useFluencyModePreset()
62
+ const input = useUnit(model.input.$state)
63
+
64
+ const accentColor = header.streakColor.todayBorder
65
+ const accentBorderColor = matrix.mastery.mastered
66
+
67
+ const enterAccentScheme = {
68
+ [ButtonStates.DEFAULT]: {
69
+ backgroundColor: accentColor,
70
+ borderColor: accentBorderColor,
71
+ raiseColor: accentBorderColor,
72
+ color: COLORS.NEUTRAL_1,
73
+ },
74
+ [ButtonStates.HOVER]: {
75
+ backgroundColor: accentColor,
76
+ borderColor: accentBorderColor,
77
+ raiseColor: accentBorderColor,
78
+ color: COLORS.NEUTRAL_1,
79
+ },
80
+ [ButtonStates.PRESSED]: {
81
+ backgroundColor: accentColor,
82
+ borderColor: accentBorderColor,
83
+ raiseColor: accentBorderColor,
84
+ color: COLORS.NEUTRAL_1,
85
+ },
86
+ [ButtonStates.ACTIVE]: {
87
+ backgroundColor: accentColor,
88
+ borderColor: accentBorderColor,
89
+ raiseColor: accentBorderColor,
90
+ color: COLORS.NEUTRAL_1,
91
+ },
92
+ }
93
+
94
+ const options = NUMPAD_KEYS.map(({ value, customColorScheme, ...props }) => {
95
+ const isEnterKey = value === 'enter'
96
+ const colorScheme = isEnterKey && input ? enterAccentScheme : customColorScheme
97
+
98
+ return {
99
+ ...props,
100
+ customColorScheme: colorScheme,
101
+ onPressIn: () => {
102
+ if (value === 'backspace') return model.input.set({ erase: 'latest' })
103
+ if (value === 'enter') return model.input.submitFx()
104
+ model.input.set({ value })
105
+ },
106
+ }
107
+ })
108
+
109
+ return (
110
+ <View style={styles.container}>
111
+ <SelectGroup
112
+ numOfRows={4}
113
+ color={SelectOptionColor.GREY}
114
+ size={SelectOptionSize.SMALL}
115
+ options={options}
116
+ style={{
117
+ container: styles.grid,
118
+ row: styles.row,
119
+ option: {
120
+ button: styles.optionButton,
121
+ text: styles.optionText,
122
+ },
123
+ }}
124
+ />
125
+ </View>
126
+ )
127
+ }
128
+
129
+ const styles = StyleSheet.create({
130
+ container: {
131
+ alignItems: 'center',
132
+ paddingVertical: SPACING[400],
133
+ marginTop: SPACING[200],
134
+ },
135
+ grid: {
136
+ width: 360,
137
+ gap: SPACING[200],
138
+ },
139
+ row: {
140
+ gap: SPACING[200],
141
+ },
142
+ optionButton: {
143
+ height: 60,
144
+ },
145
+ optionText: {
146
+ fontSize: 24,
147
+ fontWeight: '700',
148
+ fontFamily: FONT_FAMILY.buenosAires,
149
+ },
150
+ })
@@ -0,0 +1,49 @@
1
+ import React, { useEffect } from 'react'
2
+ import { View, StyleSheet } from 'react-native'
3
+ import { useUnit } from 'effector-react'
4
+ import { FluencyNumpad } from './FluencyNumpad'
5
+ import { FluencyEquationCard } from './FluencyEquationCard'
6
+ import { SPACING } from '@magmamath/react-native-ui'
7
+ import { useFluencyModePreset } from '../../hooks/useFluencyModePreset'
8
+ import { useFluency } from '../../context/FluencyContext'
9
+ import { isWeb } from '../../../../shared/common.constants'
10
+
11
+ export const FluencySolvingCard = () => {
12
+ const { model } = useFluency()
13
+ const { header, icon: OperatorIcon } = useFluencyModePreset()
14
+ const accentColor = header.streakColor.todayBorder // TODO: add accentColor in mode preset.
15
+ const input = useUnit(model.input.$state)
16
+
17
+ useEffect(() => {
18
+ if (!isWeb) return
19
+
20
+ const handleKeyDown = (event: KeyboardEvent) => {
21
+ const isDigit = /^\d$/.test(event.key)
22
+ if (isDigit) return model.input.set({ value: Number(event.key) })
23
+ if (event.key === 'Backspace') return model.input.set({ erase: 'latest' })
24
+ if (event.key === 'Enter') return model.input.submitFx()
25
+ }
26
+
27
+ window.addEventListener('keydown', handleKeyDown)
28
+ return () => window.removeEventListener('keydown', handleKeyDown)
29
+ }, [])
30
+
31
+ return (
32
+ <View>
33
+ <View style={styles.wrapper}>
34
+ <FluencyEquationCard accentColor={accentColor} OperatorIcon={OperatorIcon} input={input} />
35
+ </View>
36
+
37
+ <FluencyNumpad />
38
+ </View>
39
+ )
40
+ }
41
+
42
+ const styles = StyleSheet.create({
43
+ wrapper: {
44
+ alignItems: 'center',
45
+ paddingVertical: SPACING[400],
46
+ paddingHorizontal: SPACING[600],
47
+ marginTop: SPACING[300],
48
+ },
49
+ })