@magmamath/students-features 0.9.113 → 0.9.114-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (247) hide show
  1. package/dist/commonjs/features/pmProgress/PracticeProgress.js +264 -0
  2. package/dist/commonjs/features/pmProgress/PracticeProgress.js.map +1 -0
  3. package/dist/commonjs/features/pmProgress/chart/chart.helpers.js +24 -0
  4. package/dist/commonjs/features/pmProgress/chart/chart.helpers.js.map +1 -0
  5. package/dist/commonjs/features/pmProgress/chart/chart.types.js +2 -0
  6. package/dist/commonjs/features/pmProgress/chart/chart.types.js.map +1 -0
  7. package/dist/commonjs/features/pmProgress/chart/components/PracticeProgressPieChart.js +44 -0
  8. package/dist/commonjs/features/pmProgress/chart/components/PracticeProgressPieChart.js.map +1 -0
  9. package/dist/commonjs/features/pmProgress/chart/components/SlicesClipPaths.js +38 -0
  10. package/dist/commonjs/features/pmProgress/chart/components/SlicesClipPaths.js.map +1 -0
  11. package/dist/commonjs/features/pmProgress/chart/components/SlicesPaths.js +64 -0
  12. package/dist/commonjs/features/pmProgress/chart/components/SlicesPaths.js.map +1 -0
  13. package/dist/commonjs/features/pmProgress/chart/components/layers/SliceArcPattern.js +38 -0
  14. package/dist/commonjs/features/pmProgress/chart/components/layers/SliceArcPattern.js.map +1 -0
  15. package/dist/commonjs/features/pmProgress/chart/components/layers/SliceBackgroundColor.js +21 -0
  16. package/dist/commonjs/features/pmProgress/chart/components/layers/SliceBackgroundColor.js.map +1 -0
  17. package/dist/commonjs/features/pmProgress/chart/components/layers/SliceFillColor.js +49 -0
  18. package/dist/commonjs/features/pmProgress/chart/components/layers/SliceFillColor.js.map +1 -0
  19. package/dist/commonjs/features/pmProgress/chart/model/ArcPatternGenerator.js +49 -0
  20. package/dist/commonjs/features/pmProgress/chart/model/ArcPatternGenerator.js.map +1 -0
  21. package/dist/commonjs/features/pmProgress/chart/model/PieChartManager.js +25 -0
  22. package/dist/commonjs/features/pmProgress/chart/model/PieChartManager.js.map +1 -0
  23. package/dist/commonjs/features/pmProgress/chart/model/SliceHighlight.js +20 -0
  24. package/dist/commonjs/features/pmProgress/chart/model/SliceHighlight.js.map +1 -0
  25. package/dist/commonjs/features/pmProgress/chart/model/SliceShapeGenerator.js +67 -0
  26. package/dist/commonjs/features/pmProgress/chart/model/SliceShapeGenerator.js.map +1 -0
  27. package/dist/commonjs/features/pmProgress/header/PracticeProgressHeader.js +180 -0
  28. package/dist/commonjs/features/pmProgress/header/PracticeProgressHeader.js.map +1 -0
  29. package/dist/commonjs/features/pmProgress/index.js +13 -0
  30. package/dist/commonjs/features/pmProgress/index.js.map +1 -0
  31. package/dist/commonjs/features/pmProgress/list/ListCard.js +128 -0
  32. package/dist/commonjs/features/pmProgress/list/ListCard.js.map +1 -0
  33. package/dist/commonjs/features/pmProgress/list/ListItem.js +128 -0
  34. package/dist/commonjs/features/pmProgress/list/ListItem.js.map +1 -0
  35. package/dist/commonjs/features/pmProgress/recs/TeacherRecs.js +17 -0
  36. package/dist/commonjs/features/pmProgress/recs/TeacherRecs.js.map +1 -0
  37. package/dist/commonjs/features/pmProgress/stats/PracticeProgressStats.js +63 -0
  38. package/dist/commonjs/features/pmProgress/stats/PracticeProgressStats.js.map +1 -0
  39. package/dist/commonjs/features/pmProgress/stats/StatsCard.js +66 -0
  40. package/dist/commonjs/features/pmProgress/stats/StatsCard.js.map +1 -0
  41. package/dist/commonjs/features/pmProgress/temp.js +74 -0
  42. package/dist/commonjs/features/pmProgress/temp.js.map +1 -0
  43. package/dist/commonjs/index.js +14 -2
  44. package/dist/commonjs/index.js.map +1 -1
  45. package/dist/commonjs/shared/icons/PentagonIcon.js +32 -0
  46. package/dist/commonjs/shared/icons/PentagonIcon.js.map +1 -0
  47. package/dist/commonjs/shared/icons/SketchArrowRight.js +33 -0
  48. package/dist/commonjs/shared/icons/SketchArrowRight.js.map +1 -0
  49. package/dist/commonjs/shared/icons/SliceDiamondIcon.js +32 -0
  50. package/dist/commonjs/shared/icons/SliceDiamondIcon.js.map +1 -0
  51. package/dist/commonjs/shared/icons/StarIcon.js +32 -0
  52. package/dist/commonjs/shared/icons/StarIcon.js.map +1 -0
  53. package/dist/commonjs/shared/icons/TimerIcon.js +35 -0
  54. package/dist/commonjs/shared/icons/TimerIcon.js.map +1 -0
  55. package/dist/module/features/pmProgress/PracticeProgress.js +258 -0
  56. package/dist/module/features/pmProgress/PracticeProgress.js.map +1 -0
  57. package/dist/module/features/pmProgress/chart/chart.helpers.js +16 -0
  58. package/dist/module/features/pmProgress/chart/chart.helpers.js.map +1 -0
  59. package/dist/module/features/pmProgress/chart/chart.types.js +2 -0
  60. package/dist/module/features/pmProgress/chart/chart.types.js.map +1 -0
  61. package/dist/module/features/pmProgress/chart/components/PracticeProgressPieChart.js +38 -0
  62. package/dist/module/features/pmProgress/chart/components/PracticeProgressPieChart.js.map +1 -0
  63. package/dist/module/features/pmProgress/chart/components/SlicesClipPaths.js +32 -0
  64. package/dist/module/features/pmProgress/chart/components/SlicesClipPaths.js.map +1 -0
  65. package/dist/module/features/pmProgress/chart/components/SlicesPaths.js +58 -0
  66. package/dist/module/features/pmProgress/chart/components/SlicesPaths.js.map +1 -0
  67. package/dist/module/features/pmProgress/chart/components/layers/SliceArcPattern.js +32 -0
  68. package/dist/module/features/pmProgress/chart/components/layers/SliceArcPattern.js.map +1 -0
  69. package/dist/module/features/pmProgress/chart/components/layers/SliceBackgroundColor.js +15 -0
  70. package/dist/module/features/pmProgress/chart/components/layers/SliceBackgroundColor.js.map +1 -0
  71. package/dist/module/features/pmProgress/chart/components/layers/SliceFillColor.js +43 -0
  72. package/dist/module/features/pmProgress/chart/components/layers/SliceFillColor.js.map +1 -0
  73. package/dist/module/features/pmProgress/chart/model/ArcPatternGenerator.js +44 -0
  74. package/dist/module/features/pmProgress/chart/model/ArcPatternGenerator.js.map +1 -0
  75. package/dist/module/features/pmProgress/chart/model/PieChartManager.js +20 -0
  76. package/dist/module/features/pmProgress/chart/model/PieChartManager.js.map +1 -0
  77. package/dist/module/features/pmProgress/chart/model/SliceHighlight.js +15 -0
  78. package/dist/module/features/pmProgress/chart/model/SliceHighlight.js.map +1 -0
  79. package/dist/module/features/pmProgress/chart/model/SliceShapeGenerator.js +62 -0
  80. package/dist/module/features/pmProgress/chart/model/SliceShapeGenerator.js.map +1 -0
  81. package/dist/module/features/pmProgress/header/PracticeProgressHeader.js +174 -0
  82. package/dist/module/features/pmProgress/header/PracticeProgressHeader.js.map +1 -0
  83. package/dist/module/features/pmProgress/index.js +4 -0
  84. package/dist/module/features/pmProgress/index.js.map +1 -0
  85. package/dist/module/features/pmProgress/list/ListCard.js +121 -0
  86. package/dist/module/features/pmProgress/list/ListCard.js.map +1 -0
  87. package/dist/module/features/pmProgress/list/ListItem.js +122 -0
  88. package/dist/module/features/pmProgress/list/ListItem.js.map +1 -0
  89. package/dist/module/features/pmProgress/recs/TeacherRecs.js +11 -0
  90. package/dist/module/features/pmProgress/recs/TeacherRecs.js.map +1 -0
  91. package/dist/module/features/pmProgress/stats/PracticeProgressStats.js +56 -0
  92. package/dist/module/features/pmProgress/stats/PracticeProgressStats.js.map +1 -0
  93. package/dist/module/features/pmProgress/stats/StatsCard.js +60 -0
  94. package/dist/module/features/pmProgress/stats/StatsCard.js.map +1 -0
  95. package/dist/module/features/pmProgress/temp.js +70 -0
  96. package/dist/module/features/pmProgress/temp.js.map +1 -0
  97. package/dist/module/index.js +1 -0
  98. package/dist/module/index.js.map +1 -1
  99. package/dist/module/shared/icons/PentagonIcon.js +24 -0
  100. package/dist/module/shared/icons/PentagonIcon.js.map +1 -0
  101. package/dist/module/shared/icons/SketchArrowRight.js +25 -0
  102. package/dist/module/shared/icons/SketchArrowRight.js.map +1 -0
  103. package/dist/module/shared/icons/SliceDiamondIcon.js +24 -0
  104. package/dist/module/shared/icons/SliceDiamondIcon.js.map +1 -0
  105. package/dist/module/shared/icons/StarIcon.js +24 -0
  106. package/dist/module/shared/icons/StarIcon.js.map +1 -0
  107. package/dist/module/shared/icons/TimerIcon.js +27 -0
  108. package/dist/module/shared/icons/TimerIcon.js.map +1 -0
  109. package/dist/typescript/commonjs/features/pmProgress/PracticeProgress.d.ts +3 -0
  110. package/dist/typescript/commonjs/features/pmProgress/PracticeProgress.d.ts.map +1 -0
  111. package/dist/typescript/commonjs/features/pmProgress/chart/chart.helpers.d.ts +5 -0
  112. package/dist/typescript/commonjs/features/pmProgress/chart/chart.helpers.d.ts.map +1 -0
  113. package/dist/typescript/commonjs/features/pmProgress/chart/chart.types.d.ts +35 -0
  114. package/dist/typescript/commonjs/features/pmProgress/chart/chart.types.d.ts.map +1 -0
  115. package/dist/typescript/commonjs/features/pmProgress/chart/components/PracticeProgressPieChart.d.ts +9 -0
  116. package/dist/typescript/commonjs/features/pmProgress/chart/components/PracticeProgressPieChart.d.ts.map +1 -0
  117. package/dist/typescript/commonjs/features/pmProgress/chart/components/SlicesClipPaths.d.ts +10 -0
  118. package/dist/typescript/commonjs/features/pmProgress/chart/components/SlicesClipPaths.d.ts.map +1 -0
  119. package/dist/typescript/commonjs/features/pmProgress/chart/components/SlicesPaths.d.ts +11 -0
  120. package/dist/typescript/commonjs/features/pmProgress/chart/components/SlicesPaths.d.ts.map +1 -0
  121. package/dist/typescript/commonjs/features/pmProgress/chart/components/layers/SliceArcPattern.d.ts +12 -0
  122. package/dist/typescript/commonjs/features/pmProgress/chart/components/layers/SliceArcPattern.d.ts.map +1 -0
  123. package/dist/typescript/commonjs/features/pmProgress/chart/components/layers/SliceBackgroundColor.d.ts +8 -0
  124. package/dist/typescript/commonjs/features/pmProgress/chart/components/layers/SliceBackgroundColor.d.ts.map +1 -0
  125. package/dist/typescript/commonjs/features/pmProgress/chart/components/layers/SliceFillColor.d.ts +13 -0
  126. package/dist/typescript/commonjs/features/pmProgress/chart/components/layers/SliceFillColor.d.ts.map +1 -0
  127. package/dist/typescript/commonjs/features/pmProgress/chart/model/ArcPatternGenerator.d.ts +12 -0
  128. package/dist/typescript/commonjs/features/pmProgress/chart/model/ArcPatternGenerator.d.ts.map +1 -0
  129. package/dist/typescript/commonjs/features/pmProgress/chart/model/PieChartManager.d.ts +16 -0
  130. package/dist/typescript/commonjs/features/pmProgress/chart/model/PieChartManager.d.ts.map +1 -0
  131. package/dist/typescript/commonjs/features/pmProgress/chart/model/SliceHighlight.d.ts +10 -0
  132. package/dist/typescript/commonjs/features/pmProgress/chart/model/SliceHighlight.d.ts.map +1 -0
  133. package/dist/typescript/commonjs/features/pmProgress/chart/model/SliceShapeGenerator.d.ts +15 -0
  134. package/dist/typescript/commonjs/features/pmProgress/chart/model/SliceShapeGenerator.d.ts.map +1 -0
  135. package/dist/typescript/commonjs/features/pmProgress/header/PracticeProgressHeader.d.ts +12 -0
  136. package/dist/typescript/commonjs/features/pmProgress/header/PracticeProgressHeader.d.ts.map +1 -0
  137. package/dist/typescript/commonjs/features/pmProgress/index.d.ts +2 -0
  138. package/dist/typescript/commonjs/features/pmProgress/index.d.ts.map +1 -0
  139. package/dist/typescript/commonjs/features/pmProgress/list/ListCard.d.ts +15 -0
  140. package/dist/typescript/commonjs/features/pmProgress/list/ListCard.d.ts.map +1 -0
  141. package/dist/typescript/commonjs/features/pmProgress/list/ListItem.d.ts +11 -0
  142. package/dist/typescript/commonjs/features/pmProgress/list/ListItem.d.ts.map +1 -0
  143. package/dist/typescript/commonjs/features/pmProgress/recs/TeacherRecs.d.ts +3 -0
  144. package/dist/typescript/commonjs/features/pmProgress/recs/TeacherRecs.d.ts.map +1 -0
  145. package/dist/typescript/commonjs/features/pmProgress/stats/PracticeProgressStats.d.ts +3 -0
  146. package/dist/typescript/commonjs/features/pmProgress/stats/PracticeProgressStats.d.ts.map +1 -0
  147. package/dist/typescript/commonjs/features/pmProgress/stats/StatsCard.d.ts +10 -0
  148. package/dist/typescript/commonjs/features/pmProgress/stats/StatsCard.d.ts.map +1 -0
  149. package/dist/typescript/commonjs/features/pmProgress/temp.d.ts +4 -0
  150. package/dist/typescript/commonjs/features/pmProgress/temp.d.ts.map +1 -0
  151. package/dist/typescript/commonjs/index.d.ts +1 -0
  152. package/dist/typescript/commonjs/index.d.ts.map +1 -1
  153. package/dist/typescript/commonjs/shared/icons/PentagonIcon.d.ts +4 -0
  154. package/dist/typescript/commonjs/shared/icons/PentagonIcon.d.ts.map +1 -0
  155. package/dist/typescript/commonjs/shared/icons/SketchArrowRight.d.ts +4 -0
  156. package/dist/typescript/commonjs/shared/icons/SketchArrowRight.d.ts.map +1 -0
  157. package/dist/typescript/commonjs/shared/icons/SliceDiamondIcon.d.ts +4 -0
  158. package/dist/typescript/commonjs/shared/icons/SliceDiamondIcon.d.ts.map +1 -0
  159. package/dist/typescript/commonjs/shared/icons/StarIcon.d.ts +4 -0
  160. package/dist/typescript/commonjs/shared/icons/StarIcon.d.ts.map +1 -0
  161. package/dist/typescript/commonjs/shared/icons/TimerIcon.d.ts +4 -0
  162. package/dist/typescript/commonjs/shared/icons/TimerIcon.d.ts.map +1 -0
  163. package/dist/typescript/module/features/pmProgress/PracticeProgress.d.ts +3 -0
  164. package/dist/typescript/module/features/pmProgress/PracticeProgress.d.ts.map +1 -0
  165. package/dist/typescript/module/features/pmProgress/chart/chart.helpers.d.ts +5 -0
  166. package/dist/typescript/module/features/pmProgress/chart/chart.helpers.d.ts.map +1 -0
  167. package/dist/typescript/module/features/pmProgress/chart/chart.types.d.ts +35 -0
  168. package/dist/typescript/module/features/pmProgress/chart/chart.types.d.ts.map +1 -0
  169. package/dist/typescript/module/features/pmProgress/chart/components/PracticeProgressPieChart.d.ts +9 -0
  170. package/dist/typescript/module/features/pmProgress/chart/components/PracticeProgressPieChart.d.ts.map +1 -0
  171. package/dist/typescript/module/features/pmProgress/chart/components/SlicesClipPaths.d.ts +10 -0
  172. package/dist/typescript/module/features/pmProgress/chart/components/SlicesClipPaths.d.ts.map +1 -0
  173. package/dist/typescript/module/features/pmProgress/chart/components/SlicesPaths.d.ts +11 -0
  174. package/dist/typescript/module/features/pmProgress/chart/components/SlicesPaths.d.ts.map +1 -0
  175. package/dist/typescript/module/features/pmProgress/chart/components/layers/SliceArcPattern.d.ts +12 -0
  176. package/dist/typescript/module/features/pmProgress/chart/components/layers/SliceArcPattern.d.ts.map +1 -0
  177. package/dist/typescript/module/features/pmProgress/chart/components/layers/SliceBackgroundColor.d.ts +8 -0
  178. package/dist/typescript/module/features/pmProgress/chart/components/layers/SliceBackgroundColor.d.ts.map +1 -0
  179. package/dist/typescript/module/features/pmProgress/chart/components/layers/SliceFillColor.d.ts +13 -0
  180. package/dist/typescript/module/features/pmProgress/chart/components/layers/SliceFillColor.d.ts.map +1 -0
  181. package/dist/typescript/module/features/pmProgress/chart/model/ArcPatternGenerator.d.ts +12 -0
  182. package/dist/typescript/module/features/pmProgress/chart/model/ArcPatternGenerator.d.ts.map +1 -0
  183. package/dist/typescript/module/features/pmProgress/chart/model/PieChartManager.d.ts +16 -0
  184. package/dist/typescript/module/features/pmProgress/chart/model/PieChartManager.d.ts.map +1 -0
  185. package/dist/typescript/module/features/pmProgress/chart/model/SliceHighlight.d.ts +10 -0
  186. package/dist/typescript/module/features/pmProgress/chart/model/SliceHighlight.d.ts.map +1 -0
  187. package/dist/typescript/module/features/pmProgress/chart/model/SliceShapeGenerator.d.ts +15 -0
  188. package/dist/typescript/module/features/pmProgress/chart/model/SliceShapeGenerator.d.ts.map +1 -0
  189. package/dist/typescript/module/features/pmProgress/header/PracticeProgressHeader.d.ts +12 -0
  190. package/dist/typescript/module/features/pmProgress/header/PracticeProgressHeader.d.ts.map +1 -0
  191. package/dist/typescript/module/features/pmProgress/index.d.ts +2 -0
  192. package/dist/typescript/module/features/pmProgress/index.d.ts.map +1 -0
  193. package/dist/typescript/module/features/pmProgress/list/ListCard.d.ts +15 -0
  194. package/dist/typescript/module/features/pmProgress/list/ListCard.d.ts.map +1 -0
  195. package/dist/typescript/module/features/pmProgress/list/ListItem.d.ts +11 -0
  196. package/dist/typescript/module/features/pmProgress/list/ListItem.d.ts.map +1 -0
  197. package/dist/typescript/module/features/pmProgress/recs/TeacherRecs.d.ts +3 -0
  198. package/dist/typescript/module/features/pmProgress/recs/TeacherRecs.d.ts.map +1 -0
  199. package/dist/typescript/module/features/pmProgress/stats/PracticeProgressStats.d.ts +3 -0
  200. package/dist/typescript/module/features/pmProgress/stats/PracticeProgressStats.d.ts.map +1 -0
  201. package/dist/typescript/module/features/pmProgress/stats/StatsCard.d.ts +10 -0
  202. package/dist/typescript/module/features/pmProgress/stats/StatsCard.d.ts.map +1 -0
  203. package/dist/typescript/module/features/pmProgress/temp.d.ts +4 -0
  204. package/dist/typescript/module/features/pmProgress/temp.d.ts.map +1 -0
  205. package/dist/typescript/module/index.d.ts +1 -0
  206. package/dist/typescript/module/index.d.ts.map +1 -1
  207. package/dist/typescript/module/shared/icons/PentagonIcon.d.ts +4 -0
  208. package/dist/typescript/module/shared/icons/PentagonIcon.d.ts.map +1 -0
  209. package/dist/typescript/module/shared/icons/SketchArrowRight.d.ts +4 -0
  210. package/dist/typescript/module/shared/icons/SketchArrowRight.d.ts.map +1 -0
  211. package/dist/typescript/module/shared/icons/SliceDiamondIcon.d.ts +4 -0
  212. package/dist/typescript/module/shared/icons/SliceDiamondIcon.d.ts.map +1 -0
  213. package/dist/typescript/module/shared/icons/StarIcon.d.ts +4 -0
  214. package/dist/typescript/module/shared/icons/StarIcon.d.ts.map +1 -0
  215. package/dist/typescript/module/shared/icons/TimerIcon.d.ts +4 -0
  216. package/dist/typescript/module/shared/icons/TimerIcon.d.ts.map +1 -0
  217. package/package.json +4 -2
  218. package/src/features/pmProgress/PracticeProgress.tsx +249 -0
  219. package/src/features/pmProgress/chart/chart.helpers.ts +15 -0
  220. package/src/features/pmProgress/chart/chart.types.ts +36 -0
  221. package/src/features/pmProgress/chart/components/PracticeProgressPieChart.tsx +32 -0
  222. package/src/features/pmProgress/chart/components/SlicesClipPaths.tsx +36 -0
  223. package/src/features/pmProgress/chart/components/SlicesPaths.tsx +67 -0
  224. package/src/features/pmProgress/chart/components/layers/SliceArcPattern.tsx +44 -0
  225. package/src/features/pmProgress/chart/components/layers/SliceBackgroundColor.tsx +11 -0
  226. package/src/features/pmProgress/chart/components/layers/SliceFillColor.tsx +55 -0
  227. package/src/features/pmProgress/chart/model/ArcPatternGenerator.ts +48 -0
  228. package/src/features/pmProgress/chart/model/PieChartManager.ts +20 -0
  229. package/src/features/pmProgress/chart/model/SliceHighlight.ts +17 -0
  230. package/src/features/pmProgress/chart/model/SliceShapeGenerator.ts +71 -0
  231. package/src/features/pmProgress/header/PracticeProgressHeader.tsx +178 -0
  232. package/src/features/pmProgress/index.ts +1 -0
  233. package/src/features/pmProgress/list/ListCard.tsx +133 -0
  234. package/src/features/pmProgress/list/ListItem.tsx +113 -0
  235. package/src/features/pmProgress/recs/TeacherRecs.tsx +10 -0
  236. package/src/features/pmProgress/stats/PracticeProgressStats.tsx +60 -0
  237. package/src/features/pmProgress/stats/StatsCard.tsx +58 -0
  238. package/src/features/pmProgress/temp.ts +67 -0
  239. package/src/index.ts +1 -0
  240. package/src/shared/icons/PentagonIcon.tsx +17 -0
  241. package/src/shared/icons/SketchArrowRight.tsx +18 -0
  242. package/src/shared/icons/SliceDiamondIcon.tsx +16 -0
  243. package/src/shared/icons/StarIcon.tsx +17 -0
  244. package/src/shared/icons/TimerIcon.tsx +21 -0
  245. package/dist/commonjs/features/chatbot/TTS_HIGHLIGHTING.md +0 -120
  246. package/dist/module/features/chatbot/TTS_HIGHLIGHTING.md +0 -120
  247. package/src/features/chatbot/TTS_HIGHLIGHTING.md +0 -120
@@ -0,0 +1,249 @@
1
+ import React from 'react'
2
+ import { View, StyleSheet, Text, ListRenderItemInfo } from 'react-native'
3
+ import {
4
+ BORDER_RADIUS,
5
+ COLORS,
6
+ SPACING,
7
+ ScrollableList,
8
+ Button,
9
+ ButtonSize,
10
+ ButtonVariant,
11
+ } from '@magmamath/react-native-ui'
12
+ import { PracticeProgressPieChart } from './chart/components/PracticeProgressPieChart'
13
+ import { DEFAULT_CONFIG, SAMPLE_DATA } from './temp'
14
+ import { PracticeProgressHeader } from './header/PracticeProgressHeader'
15
+ import { PracticeProgressStats } from './stats/PracticeProgressStats'
16
+ import { ListCard } from './list/ListCard'
17
+ import { ListItemData } from './list/ListItem'
18
+ import { SliceDiamondIcon } from '../../shared/icons/SliceDiamondIcon'
19
+ import { PentagonIcon } from '../../shared/icons/PentagonIcon'
20
+
21
+ type CardData = {
22
+ id: string
23
+ title: string
24
+ icon: JSX.Element
25
+ color: string
26
+ items: ListItemData[]
27
+ progress: number
28
+ }
29
+
30
+ const SAMPLE_ITEMS: ListItemData[] = [
31
+ { title: 'Solve real-world problems', subtitle: '4.NS.3B', skillsLeft: 3 },
32
+ { title: 'Divide fractions', subtitle: '4.NS.3A', skillsLeft: 0, isFinished: true },
33
+ { title: 'Add and subtract fractions', subtitle: '4.NS.2A', skillsLeft: 5 },
34
+ { title: 'Multiply whole numbers', subtitle: '4.NS.1C', skillsLeft: 0, isFinished: true },
35
+ ]
36
+
37
+ const LIST_DATA: CardData[] = [
38
+ ...Array.from({ length: 11 }, (_, i) => ({
39
+ id: `algebra-${i}`,
40
+ title: 'Algebra and Functions',
41
+ color: COLORS.PRIMARY_INDIGO,
42
+ icon: <SliceDiamondIcon color={COLORS.PRIMARY_INDIGO} />,
43
+ items: SAMPLE_ITEMS,
44
+ progress: Math.round(10 + i * 8),
45
+ })),
46
+ {
47
+ id: 'data-analysis',
48
+ title: 'Data Analysis and Probability',
49
+ color: COLORS.PRIMARY_BLUE,
50
+ icon: <SliceDiamondIcon color={COLORS.PRIMARY_BLUE} />,
51
+ items: SAMPLE_ITEMS,
52
+ progress: 63,
53
+ },
54
+ {
55
+ id: 'ratios',
56
+ title: 'Ratios and Proportionality',
57
+ color: COLORS.PRIMARY_RED,
58
+ icon: <SliceDiamondIcon color={COLORS.PRIMARY_RED} />,
59
+ items: SAMPLE_ITEMS,
60
+ progress: 27,
61
+ },
62
+ ]
63
+
64
+ const FLUENCY_DATA: CardData = {
65
+ id: 'fluency',
66
+ title: 'Fluency',
67
+ color: COLORS.PRIMARY_ORANGE,
68
+ icon: <SliceDiamondIcon color={COLORS.PRIMARY_ORANGE} />,
69
+ items: SAMPLE_ITEMS,
70
+ progress: 85,
71
+ }
72
+
73
+ const SCROLLBAR_WIDTH = 8
74
+ const BADGE_SIZE = 20
75
+ const BADGE_OFFSET = -8
76
+ const BADGE_FONT_SIZE = 12
77
+ const CHART_SIZE = 432
78
+ const STATS_MAX_HEIGHT = 136
79
+
80
+ const ListFooter = () => (
81
+ <>
82
+ <View style={styles.separator} />
83
+ <ListCard
84
+ icon={FLUENCY_DATA.icon}
85
+ title={FLUENCY_DATA.title}
86
+ color={FLUENCY_DATA.color}
87
+ items={FLUENCY_DATA.items}
88
+ progress={FLUENCY_DATA.progress}
89
+ isFirst
90
+ isLast
91
+ />
92
+ </>
93
+ )
94
+
95
+ export const PracticeProgress = () => (
96
+ <View style={styles.container}>
97
+ <PracticeProgressHeader
98
+ title="Practice & Progress"
99
+ buttonLabel="START"
100
+ grade="Grade 4"
101
+ nextUp="Next up!"
102
+ topic="Algebra and functions"
103
+ topicColor={COLORS.PRIMARY_RED}
104
+ />
105
+
106
+ <View style={styles.content}>
107
+ <View style={styles.column}>
108
+ <View style={styles.recommendations}>
109
+ <View style={styles.badgeWrapper}>
110
+ <ListCard
111
+ icon={<PentagonIcon color={COLORS.PRIMARY_YELLOW} />}
112
+ title="Teacher Recommendations"
113
+ color={COLORS.PRIMARY_YELLOW}
114
+ items={SAMPLE_ITEMS}
115
+ progress={42}
116
+ isFirst
117
+ isLast
118
+ rightContent={
119
+ <Button size={ButtonSize.SMALL} variant={ButtonVariant.SECONDARY}>
120
+ PRACTICE
121
+ </Button>
122
+ }
123
+ />
124
+ <View style={styles.badge}>
125
+ <Text style={styles.badgeText}>7</Text>
126
+ </View>
127
+ </View>
128
+ </View>
129
+
130
+ <View style={styles.cards}>
131
+ <ScrollableList<CardData>
132
+ style={styles.scroll}
133
+ scrollbarWidth={SCROLLBAR_WIDTH}
134
+ hideShadow
135
+ data={LIST_DATA}
136
+ renderItem={({ item, index }: ListRenderItemInfo<CardData>) => (
137
+ <ListCard
138
+ icon={item.icon}
139
+ title={item.title}
140
+ color={item.color}
141
+ items={item.items}
142
+ progress={item.progress}
143
+ isFirst={index === 0}
144
+ isLast={index === LIST_DATA.length - 1}
145
+ />
146
+ )}
147
+ keyExtractor={(item) => item.id}
148
+ contentContainerStyle={styles.list}
149
+ ListFooterComponent={ListFooter}
150
+ />
151
+ </View>
152
+ </View>
153
+
154
+ <View style={styles.metrics}>
155
+ <View style={styles.chart}>
156
+ <PracticeProgressPieChart data={SAMPLE_DATA} config={DEFAULT_CONFIG} />
157
+ </View>
158
+ <View style={styles.stats}>
159
+ <PracticeProgressStats />
160
+ </View>
161
+ </View>
162
+ </View>
163
+ </View>
164
+ )
165
+
166
+ const styles = StyleSheet.create({
167
+ container: {
168
+ flex: 1,
169
+ },
170
+ content: {
171
+ flex: 1,
172
+ flexDirection: 'row',
173
+ },
174
+ column: {
175
+ flex: 1,
176
+ gap: SPACING[200],
177
+ marginRight: SPACING[400] + SPACING[50],
178
+ },
179
+ recommendations: {
180
+ backgroundColor: COLORS.NEUTRAL_1,
181
+ padding: SPACING[200],
182
+ borderRadius: BORDER_RADIUS[400],
183
+ overflow: 'visible',
184
+ },
185
+ badgeWrapper: {
186
+ position: 'relative',
187
+ },
188
+ badge: {
189
+ position: 'absolute',
190
+ top: BADGE_OFFSET,
191
+ right: BADGE_OFFSET,
192
+ width: BADGE_SIZE,
193
+ height: BADGE_SIZE,
194
+ backgroundColor: COLORS.PRIMARY_RED,
195
+ alignItems: 'center',
196
+ justifyContent: 'center',
197
+ borderRadius: BADGE_SIZE / 2,
198
+ },
199
+ badgeText: {
200
+ fontSize: BADGE_FONT_SIZE,
201
+ fontWeight: '600',
202
+ color: COLORS.NEUTRAL_1,
203
+ textAlign: 'center',
204
+ },
205
+ cards: {
206
+ flex: 1,
207
+ backgroundColor: COLORS.NEUTRAL_1,
208
+ padding: SPACING[200],
209
+ borderRadius: BORDER_RADIUS[400],
210
+ overflow: 'visible',
211
+ },
212
+ scroll: {
213
+ flex: 1,
214
+ },
215
+ list: {
216
+ marginRight: SPACING[400],
217
+ },
218
+ separator: {
219
+ height: 1,
220
+ backgroundColor: COLORS.NEUTRAL_4,
221
+ marginHorizontal: SPACING[100],
222
+ marginVertical: SPACING[200],
223
+ },
224
+ metrics: {
225
+ height: '100%',
226
+ },
227
+ chart: {
228
+ alignItems: 'center',
229
+ justifyContent: 'center',
230
+ backgroundColor: COLORS.NEUTRAL_1,
231
+ borderRadius: BORDER_RADIUS[250],
232
+ width: CHART_SIZE,
233
+ height: CHART_SIZE,
234
+ marginBottom: SPACING[400],
235
+ marginTop: SPACING[400],
236
+ },
237
+ stats: {
238
+ maxHeight: STATS_MAX_HEIGHT,
239
+ height: '100%',
240
+ padding: SPACING[200],
241
+ backgroundColor: COLORS.NEUTRAL_1,
242
+ borderRadius: BORDER_RADIUS[300],
243
+ shadowColor: COLORS.NEUTRAL_9,
244
+ shadowOffset: { width: 0, height: 1 },
245
+ shadowOpacity: 0.1,
246
+ shadowRadius: 3,
247
+ elevation: 2,
248
+ },
249
+ })
@@ -0,0 +1,15 @@
1
+ export const getSliceClipId = (index: number | string) => `slice-clip-${index}`
2
+ export const getFillClipId = (index: number | string) => `fill-clip-${index}`
3
+
4
+ export const dynamicInnerRadius = (sliceCount: number): number => {
5
+ if (sliceCount > 5) return 16
6
+ if (sliceCount > 3) return 20
7
+ return 30
8
+ }
9
+
10
+ export const dynamicCornerRadius = (fillPercent: number): number => {
11
+ return 8
12
+ if (fillPercent >= 75) return 8
13
+ if (fillPercent >= 40) return 5
14
+ return 2
15
+ }
@@ -0,0 +1,36 @@
1
+ export type SliceInputData = {
2
+ value: number
3
+ fillPercent?: number
4
+ backgroundColor?: string
5
+ fillColor: string
6
+ borderColor: string
7
+ }
8
+
9
+ export type SliceShape = {
10
+ index: number
11
+ startAngle: number
12
+ endAngle: number
13
+ fillPercent: number
14
+ backgroundColor: string
15
+ fillColor: string
16
+ borderColor: string
17
+ data: SliceInputData
18
+ }
19
+
20
+ export type PieChartManagerConfig = {
21
+ size: number
22
+ outerRadius: number
23
+ innerRadius: number | ((sliceCount: number) => number)
24
+ cornerRadius: number | ((fillPercent: number) => number)
25
+ gapBetweenSlices: number
26
+ borderWidth: number
27
+ pressOffset: number
28
+ outerArc: {
29
+ color: string
30
+ strokeWidth: number
31
+ dashWidth: number
32
+ }
33
+ colors: {
34
+ background: string
35
+ }
36
+ }
@@ -0,0 +1,32 @@
1
+ import React, { memo, useMemo, useState } from 'react'
2
+ import { StyleSheet, View } from 'react-native'
3
+ import Svg, { G } from 'react-native-svg'
4
+ import { PieChartManager } from '../model/PieChartManager'
5
+ import { SlicesClipPaths } from './SlicesClipPaths'
6
+ import { SlicesPaths } from './SlicesPaths'
7
+ import type { PieChartManagerConfig, SliceInputData } from '../chart.types'
8
+
9
+ type PracticeProgressPieChartProps = {
10
+ data: SliceInputData[]
11
+ config: PieChartManagerConfig
12
+ }
13
+
14
+ export const PracticeProgressPieChart = memo(({ data, config }: PracticeProgressPieChartProps) => {
15
+ const [pieChartManager] = useState(() => new PieChartManager(config))
16
+ const center = pieChartManager.getCenter()
17
+
18
+ const slices = useMemo(() => {
19
+ return pieChartManager.shape.generateSlices(data)
20
+ }, [data])
21
+
22
+ return (
23
+ <View>
24
+ <Svg width={config.size} height={config.size}>
25
+ <G x={center.x} y={center.y}>
26
+ <SlicesClipPaths slices={slices} pieChartManager={pieChartManager} />
27
+ <SlicesPaths slices={slices} pieChartManager={pieChartManager} config={config} />
28
+ </G>
29
+ </Svg>
30
+ </View>
31
+ )
32
+ })
@@ -0,0 +1,36 @@
1
+ import React from 'react'
2
+ import { ClipPath, Defs, Path } from 'react-native-svg'
3
+ import { getSliceClipId, getFillClipId } from '../chart.helpers'
4
+ import type { SliceShape } from '../chart.types'
5
+ import type { PieChartManager } from '../model/PieChartManager'
6
+
7
+ type SlicesClipPathsProps = {
8
+ slices: SliceShape[]
9
+ pieChartManager: PieChartManager
10
+ }
11
+
12
+ export const SlicesClipPaths = ({ slices, pieChartManager }: SlicesClipPathsProps) => {
13
+ return (
14
+ <Defs>
15
+ {slices.map((slice) => {
16
+ const isPartiallyFilled = slice.fillPercent > 0 && slice.fillPercent < 100
17
+ const shapeId = getSliceClipId(slice.index)
18
+ const fillId = getFillClipId(slice.index)
19
+
20
+ return (
21
+ <React.Fragment key={slice.index}>
22
+ <ClipPath id={shapeId}>
23
+ <Path d={pieChartManager.shape.generateSlicePath(slice)} />
24
+ </ClipPath>
25
+
26
+ {isPartiallyFilled && (
27
+ <ClipPath id={fillId}>
28
+ <Path d={pieChartManager.shape.generateFillPath(slice)} />
29
+ </ClipPath>
30
+ )}
31
+ </React.Fragment>
32
+ )
33
+ })}
34
+ </Defs>
35
+ )
36
+ }
@@ -0,0 +1,67 @@
1
+ import React from 'react'
2
+ import { Platform, StyleSheet } from 'react-native'
3
+ import { G } from 'react-native-svg'
4
+ import { useUnit } from 'effector-react'
5
+ import { SliceBackgroundColor } from './layers/SliceBackgroundColor'
6
+ import { SliceFillColor } from './layers/SliceFillColor'
7
+ import { SliceArcPattern } from './layers/SliceArcPattern'
8
+ import type { PieChartManagerConfig, SliceShape } from '../chart.types'
9
+ import type { PieChartManager } from '../model/PieChartManager'
10
+
11
+ type SlicesPathsProps = {
12
+ slices: SliceShape[]
13
+ pieChartManager: PieChartManager
14
+ config: PieChartManagerConfig
15
+ }
16
+
17
+ export const SlicesPaths = ({ slices, pieChartManager, config }: SlicesPathsProps) => {
18
+ const highlightedIndex = useUnit(pieChartManager.highlight.$highlightedIndex)
19
+
20
+ return (
21
+ <>
22
+ {slices.map((slice) => {
23
+ const id = `${slice.index}`
24
+ const shapeSvg = pieChartManager.shape.generateSlicePath(slice)
25
+ const fillSvg = pieChartManager.shape.generateFillPath(slice)
26
+ const isHighlighted = highlightedIndex === slice.index
27
+ const translateY = pieChartManager.highlight.getTranslateY(isHighlighted)
28
+
29
+ return (
30
+ <G
31
+ key={id}
32
+ style={styles.container}
33
+ translateY={translateY}
34
+ onPressIn={() => pieChartManager.highlight.highlightSlice(slice.index)}
35
+ onPressOut={() => pieChartManager.highlight.resetHighlight()}
36
+ >
37
+ <SliceBackgroundColor path={shapeSvg} color={slice.backgroundColor} />
38
+
39
+ <SliceFillColor
40
+ clipPathId={id}
41
+ shapeSvg={shapeSvg}
42
+ fillSvg={fillSvg}
43
+ color={slice.fillColor}
44
+ percent={slice.fillPercent}
45
+ borderColor={isHighlighted ? slice.borderColor : undefined}
46
+ borderWidth={isHighlighted ? config.borderWidth : undefined}
47
+ />
48
+
49
+ <SliceArcPattern
50
+ clipPathId={id}
51
+ slice={slice}
52
+ config={config}
53
+ pieChartManager={pieChartManager}
54
+ />
55
+ </G>
56
+ )
57
+ })}
58
+ </>
59
+ )
60
+ }
61
+
62
+ const styles = StyleSheet.create({
63
+ container: {
64
+ cursor: 'pointer',
65
+ ...(Platform.OS === 'web' ? { transition: 'transform 0.1s ease-in-out' } : {}),
66
+ },
67
+ })
@@ -0,0 +1,44 @@
1
+ import React from 'react'
2
+ import { G, Path } from 'react-native-svg'
3
+ import { getSliceClipId } from '../../chart.helpers'
4
+ import type { PieChartManagerConfig, SliceShape } from '../../chart.types'
5
+ import type { PieChartManager } from '../../model/PieChartManager'
6
+
7
+ type SliceArcPatternProps = {
8
+ clipPathId: string
9
+ slice: SliceShape
10
+ pieChartManager: PieChartManager
11
+ config: PieChartManagerConfig
12
+ }
13
+
14
+ export const SliceArcPattern = ({
15
+ clipPathId,
16
+ slice,
17
+ pieChartManager,
18
+ config,
19
+ }: SliceArcPatternProps) => {
20
+ const patternSizes = pieChartManager.pattern.getPatternTrackSizes()
21
+
22
+ return (
23
+ <G clipPath={`url(#${getSliceClipId(clipPathId)})`}>
24
+ {patternSizes.map((radius, rowIndex) => {
25
+ const arcPath = pieChartManager.pattern.generateArcPath(slice, radius)
26
+ const dashWidth = pieChartManager.pattern.getDashWidthForRadius(radius)
27
+ const dashOffset = pieChartManager.pattern.getDashOffset(rowIndex, radius)
28
+
29
+ return (
30
+ <Path
31
+ key={rowIndex}
32
+ d={arcPath}
33
+ fill="none"
34
+ stroke={config.outerArc.color}
35
+ strokeWidth={config.outerArc.strokeWidth}
36
+ strokeDasharray={[dashWidth, dashWidth]}
37
+ strokeDashoffset={dashOffset}
38
+ strokeLinecap="butt"
39
+ />
40
+ )
41
+ })}
42
+ </G>
43
+ )
44
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react'
2
+ import { Path } from 'react-native-svg'
3
+
4
+ type BackgroundLayerProps = {
5
+ path: string
6
+ color: string
7
+ }
8
+
9
+ export const SliceBackgroundColor = ({ path, color }: BackgroundLayerProps) => {
10
+ return <Path d={path} fill={color} />
11
+ }
@@ -0,0 +1,55 @@
1
+ import React from 'react'
2
+ import { G, Path } from 'react-native-svg'
3
+ import { getSliceClipId, getFillClipId } from '../../chart.helpers'
4
+
5
+ type SliceFillColorProps = {
6
+ clipPathId: string
7
+ shapeSvg: string
8
+ fillSvg: string
9
+ color: string
10
+ percent: number
11
+ borderColor?: string
12
+ borderWidth?: number
13
+ }
14
+
15
+ export const SliceFillColor = ({
16
+ clipPathId,
17
+ shapeSvg,
18
+ fillSvg,
19
+ color,
20
+ percent,
21
+ borderColor,
22
+ borderWidth,
23
+ }: SliceFillColorProps) => {
24
+ const isFullyFilled = percent >= 100
25
+ const isPartiallyFilled = percent > 0
26
+ const hasBorder = borderColor != null && borderWidth != null && borderWidth > 0
27
+
28
+ if (isFullyFilled) {
29
+ return (
30
+ <G clipPath={`url(#${getSliceClipId(clipPathId)})`}>
31
+ <Path
32
+ d={shapeSvg}
33
+ fill={color}
34
+ stroke={hasBorder ? borderColor : undefined}
35
+ strokeWidth={hasBorder ? borderWidth * 2 : undefined}
36
+ />
37
+ </G>
38
+ )
39
+ }
40
+
41
+ if (isPartiallyFilled) {
42
+ return (
43
+ <G clipPath={`url(#${getFillClipId(clipPathId)})`}>
44
+ <Path
45
+ d={fillSvg}
46
+ fill={color}
47
+ stroke={hasBorder ? borderColor : undefined}
48
+ strokeWidth={hasBorder ? borderWidth * 2 : undefined}
49
+ />
50
+ </G>
51
+ )
52
+ }
53
+
54
+ return null
55
+ }
@@ -0,0 +1,48 @@
1
+ import type { PieChartManagerConfig, SliceShape } from '../chart.types'
2
+
3
+ export class OuterArcPatternGenerator {
4
+ constructor(private readonly config: PieChartManagerConfig) {}
5
+
6
+ public generateArcPath(slice: SliceShape, radius: number) {
7
+ const gapAngle = this.config.gapBetweenSlices / (2 * radius)
8
+ const startAngle = slice.startAngle + gapAngle
9
+ const endAngle = slice.endAngle - gapAngle
10
+
11
+ const startPoint = this.polarToCartesian(radius, startAngle)
12
+ const endPoint = this.polarToCartesian(radius, endAngle)
13
+ const largeArcFlag = endAngle - startAngle > Math.PI ? 1 : 0
14
+
15
+ return `M ${startPoint.x} ${startPoint.y} A ${radius} ${radius} 0 ${largeArcFlag} 1 ${endPoint.x} ${endPoint.y}`
16
+ }
17
+
18
+ /** Returns the sizes of the two rings where the checkerboard dashes are drawn. */
19
+ public getPatternTrackSizes(): [number, number] {
20
+ const { outerRadius, outerArc } = this.config
21
+ return [
22
+ outerRadius - outerArc.strokeWidth / 2,
23
+ outerRadius - outerArc.strokeWidth * 1.5,
24
+ ]
25
+ }
26
+
27
+ public getDashWidthForRadius(radius: number) {
28
+ return this.config.outerArc.dashWidth * (radius / this.config.outerRadius)
29
+ }
30
+
31
+ public getDashOffset(rowIndex: number, radius: number) {
32
+ const dashAngle = this.config.outerArc.dashWidth / this.config.outerRadius
33
+ const dashWidthAtRadius = dashAngle * radius
34
+ const baseOffset = dashWidthAtRadius / 2
35
+
36
+ if (rowIndex === 1) {
37
+ return baseOffset - dashWidthAtRadius
38
+ }
39
+ return baseOffset
40
+ }
41
+
42
+ private polarToCartesian(radius: number, angleInRadians: number) {
43
+ return {
44
+ x: radius * Math.sin(angleInRadians),
45
+ y: -radius * Math.cos(angleInRadians),
46
+ }
47
+ }
48
+ }
@@ -0,0 +1,20 @@
1
+ import { SliceShapeGenerator } from './SliceShapeGenerator'
2
+ import { OuterArcPatternGenerator } from './ArcPatternGenerator'
3
+ import { SliceHighlight } from './SliceHighlight'
4
+ import type { PieChartManagerConfig } from '../chart.types'
5
+
6
+ export class PieChartManager {
7
+ public readonly shape: SliceShapeGenerator
8
+ public readonly pattern: OuterArcPatternGenerator
9
+ public readonly highlight: SliceHighlight
10
+
11
+ constructor(public readonly config: PieChartManagerConfig) {
12
+ this.shape = new SliceShapeGenerator(config)
13
+ this.pattern = new OuterArcPatternGenerator(config)
14
+ this.highlight = new SliceHighlight(config)
15
+ }
16
+
17
+ public getCenter() {
18
+ return { x: this.config.size / 2, y: this.config.size / 2 }
19
+ }
20
+ }
@@ -0,0 +1,17 @@
1
+ import { createEvent, createStore } from 'effector'
2
+ import type { PieChartManagerConfig } from '../chart.types'
3
+
4
+ export class SliceHighlight {
5
+ public readonly highlightSlice = createEvent<number>()
6
+ public readonly resetHighlight = createEvent()
7
+
8
+ public readonly $highlightedIndex = createStore<number | null>(null)
9
+ .on(this.highlightSlice, (_, index) => index)
10
+ .reset(this.resetHighlight)
11
+
12
+ constructor(private readonly config: PieChartManagerConfig) {}
13
+
14
+ public getTranslateY(isHighlighted: boolean): number {
15
+ return isHighlighted ? -this.config.pressOffset : 0
16
+ }
17
+ }