@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,71 @@
1
+ import { arc, pie } from 'd3-shape'
2
+ import type { PieChartManagerConfig, SliceInputData, SliceShape } from '../chart.types'
3
+
4
+ export class SliceShapeGenerator {
5
+ private innerRadius = 0
6
+ private readonly d3Pie = pie<SliceInputData>()
7
+ .value(({ value }) => value)
8
+ .sort(null)
9
+
10
+ constructor(private readonly config: PieChartManagerConfig) {}
11
+
12
+ public generateSlices(data: SliceInputData[]): SliceShape[] {
13
+ this.innerRadius = this.getInnerRadius(data.length)
14
+
15
+ return this.d3Pie(data).map((datum, index) => ({
16
+ index,
17
+ startAngle: datum.startAngle,
18
+ endAngle: datum.endAngle,
19
+ fillPercent: datum.data.fillPercent ?? 0,
20
+ backgroundColor: datum.data.backgroundColor ?? this.config.colors.background,
21
+ fillColor: datum.data.fillColor,
22
+ borderColor: datum.data.borderColor,
23
+ data: datum.data,
24
+ }))
25
+ }
26
+
27
+ public generateSlicePath(slice: SliceShape): string {
28
+ const cornerRadius = this.getCornerRadius(100)
29
+ return this.buildArc(slice, this.config.outerRadius, cornerRadius)
30
+ }
31
+
32
+ public generateFillPath(slice: SliceShape): string {
33
+ const innerRadius = this.innerRadius
34
+ const outerRadius = this.config.outerRadius
35
+ const fillRadius = innerRadius + (outerRadius - innerRadius) * (slice.fillPercent / 100)
36
+ const radialThickness = fillRadius - innerRadius
37
+ const cornerRadius = Math.min(this.getCornerRadius(slice.fillPercent), radialThickness / 2)
38
+
39
+ return this.buildArc(slice, fillRadius, cornerRadius)
40
+ }
41
+
42
+ private getInnerRadius(sliceCount: number): number {
43
+ const { innerRadius } = this.config
44
+ return typeof innerRadius === 'function' ? innerRadius(sliceCount) : innerRadius
45
+ }
46
+
47
+ private getCornerRadius(fillPercent: number): number {
48
+ const { cornerRadius } = this.config
49
+ return typeof cornerRadius === 'function' ? cornerRadius(fillPercent) : cornerRadius
50
+ }
51
+
52
+ private get padAngle(): number {
53
+ return this.config.gapBetweenSlices / this.config.outerRadius
54
+ }
55
+
56
+ private buildArc(slice: SliceShape, outerRadius: number, cornerRadius: number): string {
57
+ const innerRadius = this.innerRadius
58
+
59
+ return arc()
60
+ .outerRadius(outerRadius)
61
+ .innerRadius(innerRadius)
62
+ .cornerRadius(cornerRadius)
63
+ .padAngle(this.padAngle)
64
+ .padRadius(this.config.outerRadius)({
65
+ startAngle: slice.startAngle,
66
+ endAngle: slice.endAngle,
67
+ innerRadius,
68
+ outerRadius,
69
+ }) as string
70
+ }
71
+ }
@@ -0,0 +1,178 @@
1
+ import React, { useState } from 'react'
2
+ import { View, StyleSheet } from 'react-native'
3
+ import {
4
+ Dropdown,
5
+ HeadingVariants,
6
+ Menu,
7
+ Typography,
8
+ CaretDownIcon,
9
+ CaretUpIcon,
10
+ Button,
11
+ ButtonVariant,
12
+ SPACING,
13
+ ButtonSize,
14
+ PlayIcon,
15
+ COLORS,
16
+ ButtonColor,
17
+ } from '@magmamath/react-native-ui'
18
+ import { SketchArrowRight } from '../../../shared/icons/SketchArrowRight'
19
+ import { SliceDiamondIcon } from '../../../shared/icons/SliceDiamondIcon'
20
+
21
+ // TODO: temp, remove and pass from props
22
+ const items = [
23
+ {
24
+ key: 'item-1',
25
+ title: 'Grade1',
26
+ },
27
+ {
28
+ key: 'item-1',
29
+ title: 'Grade2',
30
+ },
31
+ {
32
+ key: 'item-1',
33
+ title: 'Grade3',
34
+ },
35
+ ]
36
+
37
+ type PracticeProgressHeaderProps = {
38
+ title: string
39
+ grade: string
40
+ nextUp: string
41
+ topic: string
42
+ buttonLabel: string
43
+ topicColor: string
44
+ }
45
+
46
+ export const PracticeProgressHeader = ({
47
+ title,
48
+ grade,
49
+ nextUp,
50
+ topic,
51
+ buttonLabel,
52
+ topicColor,
53
+ }: PracticeProgressHeaderProps) => {
54
+ const [isDropdownOpen, setIsDropdownOpen] = useState(false)
55
+ const CaretIcon = isDropdownOpen ? CaretUpIcon : CaretDownIcon
56
+
57
+ return (
58
+ <View style={styles.container}>
59
+ <View style={styles.title}>
60
+ <Typography variant={HeadingVariants.H2} style={styles.dark}>
61
+ {title}
62
+ </Typography>
63
+ <Dropdown
64
+ isOpen={isDropdownOpen}
65
+ anchor={
66
+ <Button
67
+ variant={ButtonVariant.TERTIARY}
68
+ onPress={() => setIsDropdownOpen((prev) => !prev)}
69
+ >
70
+ <Typography variant={HeadingVariants.H8} style={styles.dark}>
71
+ {grade}
72
+ </Typography>
73
+ <View style={styles.caret}>
74
+ <CaretIcon color={COLORS.NEUTRAL_9} />
75
+ </View>
76
+ </Button>
77
+ }
78
+ >
79
+ <Menu style={styles.menu} items={items} />
80
+ </Dropdown>
81
+ </View>
82
+
83
+ <View style={styles.nextUp}>
84
+ <View style={styles.content}>
85
+ <View style={styles.subtitle}>
86
+ <Typography variant={HeadingVariants.H2} style={styles.dark}>
87
+ {nextUp}
88
+ </Typography>
89
+ </View>
90
+ <View style={[styles.row, styles.tilted]}>
91
+ <Typography variant={HeadingVariants.H7} style={styles.muted}>
92
+ {topic}
93
+ </Typography>
94
+ <View style={styles.diamond}>
95
+ <SliceDiamondIcon color={topicColor} />
96
+ </View>
97
+ </View>
98
+ </View>
99
+ <View style={styles.arrow}>
100
+ <SketchArrowRight />
101
+ </View>
102
+ <Button
103
+ icon={<PlayIcon size={16} color={COLORS.NEUTRAL_1} />}
104
+ variant={ButtonVariant.PRIMARY}
105
+ size={ButtonSize.LARGE}
106
+ colorScheme={ButtonColor.YELLOW}
107
+ raiseLevel={6}
108
+ style={{ container: styles.startButton }}
109
+ >
110
+ <Typography variant={HeadingVariants.H6} style={styles.startButtonText}>
111
+ {buttonLabel}
112
+ </Typography>
113
+ </Button>
114
+ </View>
115
+ </View>
116
+ )
117
+ }
118
+
119
+ const styles = StyleSheet.create({
120
+ container: {
121
+ flexDirection: 'row',
122
+ justifyContent: 'space-between',
123
+ alignItems: 'center',
124
+ marginBottom: SPACING[400],
125
+ },
126
+ title: {
127
+ flexDirection: 'row',
128
+ alignItems: 'center',
129
+ gap: SPACING[200],
130
+ },
131
+ dark: {
132
+ color: COLORS.NEUTRAL_9,
133
+ },
134
+ caret: {
135
+ marginLeft: SPACING[100],
136
+ },
137
+ menu: {
138
+ top: SPACING[100],
139
+ minWidth: 110,
140
+ },
141
+ nextUp: {
142
+ flexDirection: 'row',
143
+ alignItems: 'center',
144
+ gap: SPACING[400],
145
+ },
146
+ content: {
147
+ alignItems: 'center',
148
+ gap: SPACING[100],
149
+ },
150
+ subtitle: {
151
+ transform: [{ rotate: '355deg' }],
152
+ marginRight: SPACING[300],
153
+ },
154
+ tilted: {
155
+ transform: [{ rotate: '355deg' }],
156
+ },
157
+ row: {
158
+ flexDirection: 'row',
159
+ gap: SPACING[100],
160
+ },
161
+ muted: {
162
+ color: COLORS.NEUTRAL_8,
163
+ },
164
+ diamond: {
165
+ bottom: 10,
166
+ },
167
+ arrow: {
168
+ transform: [{ rotate: '358deg' }],
169
+ },
170
+ startButton: {
171
+ minWidth: 145,
172
+ },
173
+ startButtonText: {
174
+ fontWeight: '700',
175
+ textTransform: 'uppercase',
176
+ color: COLORS.NEUTRAL_1,
177
+ },
178
+ })
@@ -0,0 +1 @@
1
+ export { PracticeProgress } from './PracticeProgress'
@@ -0,0 +1,133 @@
1
+ import React, { useState } from 'react'
2
+ import { Pressable, View, StyleSheet } from 'react-native'
3
+ import {
4
+ BORDER_RADIUS,
5
+ CaretDownIcon,
6
+ CaretUpIcon,
7
+ COLORS,
8
+ HeadingVariants,
9
+ SPACING,
10
+ Typography,
11
+ } from '@magmamath/react-native-ui'
12
+ import { ListItem, type ListItemData } from './ListItem'
13
+
14
+ const HEADER_HEIGHT = 60
15
+ const RADIUS = BORDER_RADIUS[200]
16
+ const PROGRESS_BAR_WIDTH = 50
17
+ const PROGRESS_BAR_HEIGHT = 10
18
+
19
+ type ListCardProps = {
20
+ title: string
21
+ icon: JSX.Element
22
+ color: string
23
+ items: ListItemData[]
24
+ progress?: number
25
+ rightContent?: React.ReactNode
26
+ isFirst?: boolean
27
+ isLast?: boolean
28
+ }
29
+
30
+ export const ListCard = ({
31
+ title,
32
+ icon,
33
+ color,
34
+ items,
35
+ progress = 0,
36
+ rightContent,
37
+ isFirst,
38
+ isLast,
39
+ }: ListCardProps) => {
40
+ const [expanded, setExpanded] = useState(false)
41
+ const Caret = expanded ? CaretUpIcon : CaretDownIcon
42
+
43
+ return (
44
+ <View style={[styles.container, isFirst && styles.first, isLast && styles.last]}>
45
+ <Pressable style={styles.header} onPress={() => setExpanded((prev) => !prev)}>
46
+ {icon}
47
+ <View style={styles.caret}>
48
+ <Caret color={COLORS.NEUTRAL_9} />
49
+ </View>
50
+ <Typography variant={HeadingVariants.H6} style={styles.title}>
51
+ {title}
52
+ </Typography>
53
+ {rightContent ?? (
54
+ <View style={styles.progress}>
55
+ <Typography variant={HeadingVariants.H7} style={[styles.percentage, { color }]}>
56
+ {Math.round(progress)}%
57
+ </Typography>
58
+ <View style={styles.track}>
59
+ <View
60
+ style={[styles.fill, { width: `${progress}%`, backgroundColor: color }]}
61
+ />
62
+ </View>
63
+ </View>
64
+ )}
65
+ </Pressable>
66
+ {expanded && (
67
+ <View style={styles.items}>
68
+ {items.map((item, index) => (
69
+ <ListItem key={index} {...item} />
70
+ ))}
71
+ </View>
72
+ )}
73
+ </View>
74
+ )
75
+ }
76
+
77
+ const styles = StyleSheet.create({
78
+ container: {
79
+ justifyContent: 'center',
80
+ backgroundColor: COLORS.NEUTRAL_2,
81
+ borderWidth: 1,
82
+ borderColor: COLORS.NEUTRAL_4,
83
+ borderTopWidth: 0,
84
+ overflow: 'hidden',
85
+ },
86
+ first: {
87
+ borderTopWidth: 1,
88
+ borderTopLeftRadius: RADIUS,
89
+ borderTopRightRadius: RADIUS,
90
+ },
91
+ last: {
92
+ borderBottomLeftRadius: RADIUS,
93
+ borderBottomRightRadius: RADIUS,
94
+ },
95
+ header: {
96
+ flexDirection: 'row',
97
+ alignItems: 'center',
98
+ height: HEADER_HEIGHT,
99
+ padding: SPACING[400],
100
+ backgroundColor: COLORS.NEUTRAL_2,
101
+ },
102
+ caret: {
103
+ marginLeft: SPACING[400],
104
+ },
105
+ title: {
106
+ marginLeft: SPACING[200],
107
+ flex: 1,
108
+ },
109
+ progress: {
110
+ flexDirection: 'row',
111
+ alignItems: 'center',
112
+ gap: SPACING[200],
113
+ },
114
+ percentage: {
115
+ textAlign: 'right',
116
+ },
117
+ track: {
118
+ width: PROGRESS_BAR_WIDTH,
119
+ height: PROGRESS_BAR_HEIGHT,
120
+ backgroundColor: COLORS.NEUTRAL_4,
121
+ borderRadius: BORDER_RADIUS[200],
122
+ overflow: 'hidden',
123
+ },
124
+ fill: {
125
+ height: '100%',
126
+ borderRadius: BORDER_RADIUS[200],
127
+ },
128
+ items: {
129
+ gap: SPACING[200],
130
+ padding: SPACING[200],
131
+ backgroundColor: COLORS.NEUTRAL_1,
132
+ },
133
+ })
@@ -0,0 +1,113 @@
1
+ import React from 'react'
2
+ import { View, Text, StyleSheet } from 'react-native'
3
+ import { ArrowRightIcon, CheckIcon } from '@magmamath/react-native-ui'
4
+
5
+ const TEXT_COLOR = '#4D4D63'
6
+ const SUBTITLE_COLOR = '#80808F'
7
+ const FINISHED_BG = '#EFFBF5'
8
+ const FINISHED_TITLE = '#00804A'
9
+ const FINISHED_SUBTITLE = '#29A96F'
10
+ const FINISHED_ICON = '#5CD497'
11
+ const SHADOW_COLOR = '#333333'
12
+ const ICON_SIZE = 25
13
+ const FONT_FAMILY = 'Buenos Aires'
14
+
15
+ export type ListItemData = {
16
+ title: string
17
+ subtitle: string
18
+ skillsLeft: number
19
+ isFinished?: boolean
20
+ }
21
+
22
+ type ListItemProps = ListItemData
23
+
24
+ export const ListItem = ({ title, subtitle, skillsLeft, isFinished = false }: ListItemProps) => {
25
+ return (
26
+ <View style={[styles.card, isFinished && styles.finished]}>
27
+ <View style={styles.content}>
28
+ <Text style={[styles.title, isFinished && styles.titleFinished]} numberOfLines={1}>
29
+ {title}
30
+ </Text>
31
+ <Text style={[styles.subtitle, isFinished && styles.subtitleFinished]} numberOfLines={1}>
32
+ {subtitle}
33
+ </Text>
34
+ </View>
35
+ <View style={styles.trailing}>
36
+ {!isFinished && <Text style={styles.skills}>{skillsLeft} skills left</Text>}
37
+ <View style={styles.icon}>
38
+ {isFinished ? (
39
+ <CheckIcon color={FINISHED_ICON} />
40
+ ) : (
41
+ <ArrowRightIcon color={TEXT_COLOR} />
42
+ )}
43
+ </View>
44
+ </View>
45
+ </View>
46
+ )
47
+ }
48
+
49
+ const styles = StyleSheet.create({
50
+ card: {
51
+ flexDirection: 'row',
52
+ alignItems: 'center',
53
+ paddingVertical: 8,
54
+ paddingLeft: 32,
55
+ paddingRight: 16,
56
+ backgroundColor: 'white',
57
+ borderRadius: 12,
58
+ gap: 8,
59
+ shadowColor: SHADOW_COLOR,
60
+ shadowOffset: { width: 0, height: 1 },
61
+ shadowOpacity: 0.25,
62
+ shadowRadius: 3,
63
+ elevation: 3,
64
+ },
65
+ finished: {
66
+ backgroundColor: FINISHED_BG,
67
+ shadowOffset: { width: 0, height: 0 },
68
+ shadowOpacity: 0.4,
69
+ shadowRadius: 0.5,
70
+ elevation: 1,
71
+ },
72
+ content: {
73
+ flex: 1,
74
+ },
75
+ title: {
76
+ color: TEXT_COLOR,
77
+ fontSize: 13,
78
+ fontFamily: FONT_FAMILY,
79
+ fontWeight: '400',
80
+ lineHeight: 18.2,
81
+ },
82
+ titleFinished: {
83
+ color: FINISHED_TITLE,
84
+ },
85
+ subtitle: {
86
+ color: SUBTITLE_COLOR,
87
+ fontSize: 10,
88
+ fontFamily: FONT_FAMILY,
89
+ fontWeight: '400',
90
+ lineHeight: 14,
91
+ },
92
+ subtitleFinished: {
93
+ color: FINISHED_SUBTITLE,
94
+ },
95
+ trailing: {
96
+ flexDirection: 'row',
97
+ alignItems: 'center',
98
+ gap: 8,
99
+ },
100
+ skills: {
101
+ color: TEXT_COLOR,
102
+ fontSize: 13,
103
+ fontFamily: FONT_FAMILY,
104
+ fontWeight: '400',
105
+ lineHeight: 18.2,
106
+ },
107
+ icon: {
108
+ width: ICON_SIZE,
109
+ height: ICON_SIZE,
110
+ justifyContent: 'center',
111
+ alignItems: 'center',
112
+ },
113
+ })
@@ -0,0 +1,10 @@
1
+ import React from 'react'
2
+ import { Text, View } from 'react-native'
3
+
4
+ export const TeacherRecs = () => {
5
+ return (
6
+ <View>
7
+ <Text></Text>
8
+ </View>
9
+ )
10
+ }
@@ -0,0 +1,60 @@
1
+ import React, { useState } from 'react'
2
+ import { StyleSheet, View } from 'react-native'
3
+ import { COLORS, SelectGroup, SelectOptionColor, SPACING } from '@magmamath/react-native-ui'
4
+ import { StatsCard } from './StatsCard'
5
+ import { StarIcon } from '../../../shared/icons/StarIcon'
6
+ import { TimerIcon } from '../../../shared/icons/TimerIcon'
7
+
8
+ type Option = {
9
+ key: string
10
+ title: string
11
+ }
12
+
13
+ const OPTIONS: Option[] = [
14
+ { key: '1', title: 'This week' },
15
+ { key: '2', title: 'Last week' },
16
+ { key: '3', title: 'All time' },
17
+ ]
18
+
19
+ const DEFAULT_SELECTED = [OPTIONS[0]]
20
+
21
+ export const PracticeProgressStats = () => {
22
+ const [selected, setSelected] = useState<Option[]>(DEFAULT_SELECTED)
23
+
24
+ return (
25
+ <View style={styles.container}>
26
+ <View style={styles.cards}>
27
+ <StatsCard
28
+ value="46"
29
+ label="Practice stars"
30
+ color={COLORS.PRIMARY_YELLOW}
31
+ icon={<StarIcon />}
32
+ />
33
+ <StatsCard
34
+ value="24m"
35
+ label="Practice time"
36
+ color={COLORS.PRIMARY_PURPLE}
37
+ icon={<TimerIcon />}
38
+ />
39
+ </View>
40
+
41
+ <SelectGroup
42
+ color={SelectOptionColor.GREY}
43
+ options={OPTIONS}
44
+ selectedOptions={selected}
45
+ onOptionChange={(option) => setSelected([option as Option])}
46
+ />
47
+ </View>
48
+ )
49
+ }
50
+
51
+ const styles = StyleSheet.create({
52
+ container: {
53
+ gap: SPACING[100],
54
+ },
55
+ cards: {
56
+ flexDirection: 'row',
57
+ justifyContent: 'space-between',
58
+ gap: SPACING[300],
59
+ },
60
+ })
@@ -0,0 +1,58 @@
1
+ import React from 'react'
2
+ import { View, StyleSheet, Text, Platform } from 'react-native'
3
+ import {
4
+ COLORS,
5
+ HeadingVariants,
6
+ ParagraphVariants,
7
+ SPACING,
8
+ Typography,
9
+ } from '@magmamath/react-native-ui'
10
+
11
+ type StatsCardProps = {
12
+ value: string
13
+ label: string
14
+ color: string
15
+ icon: JSX.Element
16
+ }
17
+
18
+ export const StatsCard = ({ value, label, color, icon }: StatsCardProps) => {
19
+ return (
20
+ <View style={[styles.card, { borderColor: color }]}>
21
+ <View
22
+ style={{
23
+ width: 42,
24
+ height: 42,
25
+ alignItems: 'center',
26
+ justifyContent: 'center',
27
+ borderRadius: '100%',
28
+ backgroundColor: color,
29
+ }}
30
+ >
31
+ {icon}
32
+ </View>
33
+ <View>
34
+ <Text style={{ color, fontSize: 32, fontWeight: 700, fontFamily: 'Buenos Aires' }}>
35
+ {value}
36
+ </Text>
37
+ <Text
38
+ style={{ color: COLORS.NEUTRAL_8, fontSize: 10, fontFamily: 'Buenos Aires', top: -6 }}
39
+ >
40
+ {label}
41
+ </Text>
42
+ </View>
43
+ </View>
44
+ )
45
+ }
46
+
47
+ const styles = StyleSheet.create({
48
+ card: {
49
+ flex: 1,
50
+ height: 65,
51
+ alignItems: 'center',
52
+ flexDirection: 'row',
53
+ borderRadius: 12,
54
+ borderWidth: 4,
55
+ padding: 8,
56
+ gap: 8,
57
+ },
58
+ })
@@ -0,0 +1,67 @@
1
+ import { COLORS } from '@magmamath/react-native-ui'
2
+ import { dynamicInnerRadius, dynamicCornerRadius } from './chart/chart.helpers'
3
+ import type { PieChartManagerConfig, SliceInputData } from './chart/chart.types'
4
+
5
+ export const SAMPLE_DATA: SliceInputData[] = [
6
+ {
7
+ value: 1, // Large slice
8
+ fillPercent: 100,
9
+ backgroundColor: COLORS.NEUTRAL_4,
10
+ fillColor: COLORS.PRIMARY_BLUE,
11
+ borderColor: COLORS.BLUE_6,
12
+ },
13
+ {
14
+ value: 1,
15
+ fillPercent: 75,
16
+ backgroundColor: COLORS.NEUTRAL_4,
17
+ fillColor: COLORS.PRIMARY_TURQUOISE,
18
+ borderColor: COLORS.TURQUOISE_6,
19
+ }, // Small
20
+ {
21
+ value: 1,
22
+ fillPercent: 75,
23
+ backgroundColor: COLORS.NEUTRAL_4,
24
+ fillColor: COLORS.PRIMARY_TURQUOISE,
25
+ borderColor: COLORS.TURQUOISE_6,
26
+ }, // Small
27
+ {
28
+ value: 1,
29
+ fillPercent: 50,
30
+ backgroundColor: COLORS.NEUTRAL_4,
31
+ fillColor: COLORS.PRIMARY_GREEN,
32
+ borderColor: COLORS.GREEN_6,
33
+ },
34
+ {
35
+ value: 1, // Small slice
36
+ fillPercent: 20,
37
+ backgroundColor: COLORS.NEUTRAL_4,
38
+ fillColor: COLORS.PRIMARY_ORANGE,
39
+ borderColor: COLORS.ORANGE_6,
40
+ },
41
+ {
42
+ value: 1, // Large slice
43
+ fillPercent: 90,
44
+ backgroundColor: COLORS.NEUTRAL_4,
45
+ fillColor: COLORS.PRIMARY_PURPLE,
46
+ borderColor: COLORS.PURPLE_6,
47
+ },
48
+ ]
49
+
50
+ export const DEFAULT_CONFIG: PieChartManagerConfig = {
51
+ size: 430,
52
+ outerRadius: 210,
53
+ innerRadius: dynamicInnerRadius,
54
+ gapBetweenSlices: 8,
55
+ cornerRadius: dynamicCornerRadius,
56
+ // minSlicePercent: 5, // Minimum visual size for any slice (prevents tiny slices)
57
+ pressOffset: 4, // How far slice moves on Y axis when pressed
58
+ borderWidth: 4, // Stroke width when pressed
59
+ colors: {
60
+ background: 'white', // page background color don't update
61
+ },
62
+ outerArc: {
63
+ color: '#FFFFFF40',
64
+ strokeWidth: 11.75, // Height of each pattern row
65
+ dashWidth: 22, // Width of dashes (fixed for all slices)
66
+ },
67
+ }
package/src/index.ts CHANGED
@@ -9,5 +9,6 @@ export * from './features/problemSelector'
9
9
  export * from './features/gifCelebrations'
10
10
  export * from './features/exampleSolution'
11
11
  export * from './features/keyboard'
12
+ export * from './features/pmProgress'
12
13
  export * from './features/openEnded'
13
14
  export * from './shared/icons'