@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.
- package/dist/commonjs/features/pmProgress/PracticeProgress.js +264 -0
- package/dist/commonjs/features/pmProgress/PracticeProgress.js.map +1 -0
- package/dist/commonjs/features/pmProgress/chart/chart.helpers.js +24 -0
- package/dist/commonjs/features/pmProgress/chart/chart.helpers.js.map +1 -0
- package/dist/commonjs/features/pmProgress/chart/chart.types.js +2 -0
- package/dist/commonjs/features/pmProgress/chart/chart.types.js.map +1 -0
- package/dist/commonjs/features/pmProgress/chart/components/PracticeProgressPieChart.js +44 -0
- package/dist/commonjs/features/pmProgress/chart/components/PracticeProgressPieChart.js.map +1 -0
- package/dist/commonjs/features/pmProgress/chart/components/SlicesClipPaths.js +38 -0
- package/dist/commonjs/features/pmProgress/chart/components/SlicesClipPaths.js.map +1 -0
- package/dist/commonjs/features/pmProgress/chart/components/SlicesPaths.js +64 -0
- package/dist/commonjs/features/pmProgress/chart/components/SlicesPaths.js.map +1 -0
- package/dist/commonjs/features/pmProgress/chart/components/layers/SliceArcPattern.js +38 -0
- package/dist/commonjs/features/pmProgress/chart/components/layers/SliceArcPattern.js.map +1 -0
- package/dist/commonjs/features/pmProgress/chart/components/layers/SliceBackgroundColor.js +21 -0
- package/dist/commonjs/features/pmProgress/chart/components/layers/SliceBackgroundColor.js.map +1 -0
- package/dist/commonjs/features/pmProgress/chart/components/layers/SliceFillColor.js +49 -0
- package/dist/commonjs/features/pmProgress/chart/components/layers/SliceFillColor.js.map +1 -0
- package/dist/commonjs/features/pmProgress/chart/model/ArcPatternGenerator.js +49 -0
- package/dist/commonjs/features/pmProgress/chart/model/ArcPatternGenerator.js.map +1 -0
- package/dist/commonjs/features/pmProgress/chart/model/PieChartManager.js +25 -0
- package/dist/commonjs/features/pmProgress/chart/model/PieChartManager.js.map +1 -0
- package/dist/commonjs/features/pmProgress/chart/model/SliceHighlight.js +20 -0
- package/dist/commonjs/features/pmProgress/chart/model/SliceHighlight.js.map +1 -0
- package/dist/commonjs/features/pmProgress/chart/model/SliceShapeGenerator.js +67 -0
- package/dist/commonjs/features/pmProgress/chart/model/SliceShapeGenerator.js.map +1 -0
- package/dist/commonjs/features/pmProgress/header/PracticeProgressHeader.js +180 -0
- package/dist/commonjs/features/pmProgress/header/PracticeProgressHeader.js.map +1 -0
- package/dist/commonjs/features/pmProgress/index.js +13 -0
- package/dist/commonjs/features/pmProgress/index.js.map +1 -0
- package/dist/commonjs/features/pmProgress/list/ListCard.js +128 -0
- package/dist/commonjs/features/pmProgress/list/ListCard.js.map +1 -0
- package/dist/commonjs/features/pmProgress/list/ListItem.js +128 -0
- package/dist/commonjs/features/pmProgress/list/ListItem.js.map +1 -0
- package/dist/commonjs/features/pmProgress/recs/TeacherRecs.js +17 -0
- package/dist/commonjs/features/pmProgress/recs/TeacherRecs.js.map +1 -0
- package/dist/commonjs/features/pmProgress/stats/PracticeProgressStats.js +63 -0
- package/dist/commonjs/features/pmProgress/stats/PracticeProgressStats.js.map +1 -0
- package/dist/commonjs/features/pmProgress/stats/StatsCard.js +66 -0
- package/dist/commonjs/features/pmProgress/stats/StatsCard.js.map +1 -0
- package/dist/commonjs/features/pmProgress/temp.js +74 -0
- package/dist/commonjs/features/pmProgress/temp.js.map +1 -0
- package/dist/commonjs/index.js +14 -2
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/shared/icons/PentagonIcon.js +32 -0
- package/dist/commonjs/shared/icons/PentagonIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/SketchArrowRight.js +33 -0
- package/dist/commonjs/shared/icons/SketchArrowRight.js.map +1 -0
- package/dist/commonjs/shared/icons/SliceDiamondIcon.js +32 -0
- package/dist/commonjs/shared/icons/SliceDiamondIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/StarIcon.js +32 -0
- package/dist/commonjs/shared/icons/StarIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/TimerIcon.js +35 -0
- package/dist/commonjs/shared/icons/TimerIcon.js.map +1 -0
- package/dist/module/features/pmProgress/PracticeProgress.js +258 -0
- package/dist/module/features/pmProgress/PracticeProgress.js.map +1 -0
- package/dist/module/features/pmProgress/chart/chart.helpers.js +16 -0
- package/dist/module/features/pmProgress/chart/chart.helpers.js.map +1 -0
- package/dist/module/features/pmProgress/chart/chart.types.js +2 -0
- package/dist/module/features/pmProgress/chart/chart.types.js.map +1 -0
- package/dist/module/features/pmProgress/chart/components/PracticeProgressPieChart.js +38 -0
- package/dist/module/features/pmProgress/chart/components/PracticeProgressPieChart.js.map +1 -0
- package/dist/module/features/pmProgress/chart/components/SlicesClipPaths.js +32 -0
- package/dist/module/features/pmProgress/chart/components/SlicesClipPaths.js.map +1 -0
- package/dist/module/features/pmProgress/chart/components/SlicesPaths.js +58 -0
- package/dist/module/features/pmProgress/chart/components/SlicesPaths.js.map +1 -0
- package/dist/module/features/pmProgress/chart/components/layers/SliceArcPattern.js +32 -0
- package/dist/module/features/pmProgress/chart/components/layers/SliceArcPattern.js.map +1 -0
- package/dist/module/features/pmProgress/chart/components/layers/SliceBackgroundColor.js +15 -0
- package/dist/module/features/pmProgress/chart/components/layers/SliceBackgroundColor.js.map +1 -0
- package/dist/module/features/pmProgress/chart/components/layers/SliceFillColor.js +43 -0
- package/dist/module/features/pmProgress/chart/components/layers/SliceFillColor.js.map +1 -0
- package/dist/module/features/pmProgress/chart/model/ArcPatternGenerator.js +44 -0
- package/dist/module/features/pmProgress/chart/model/ArcPatternGenerator.js.map +1 -0
- package/dist/module/features/pmProgress/chart/model/PieChartManager.js +20 -0
- package/dist/module/features/pmProgress/chart/model/PieChartManager.js.map +1 -0
- package/dist/module/features/pmProgress/chart/model/SliceHighlight.js +15 -0
- package/dist/module/features/pmProgress/chart/model/SliceHighlight.js.map +1 -0
- package/dist/module/features/pmProgress/chart/model/SliceShapeGenerator.js +62 -0
- package/dist/module/features/pmProgress/chart/model/SliceShapeGenerator.js.map +1 -0
- package/dist/module/features/pmProgress/header/PracticeProgressHeader.js +174 -0
- package/dist/module/features/pmProgress/header/PracticeProgressHeader.js.map +1 -0
- package/dist/module/features/pmProgress/index.js +4 -0
- package/dist/module/features/pmProgress/index.js.map +1 -0
- package/dist/module/features/pmProgress/list/ListCard.js +121 -0
- package/dist/module/features/pmProgress/list/ListCard.js.map +1 -0
- package/dist/module/features/pmProgress/list/ListItem.js +122 -0
- package/dist/module/features/pmProgress/list/ListItem.js.map +1 -0
- package/dist/module/features/pmProgress/recs/TeacherRecs.js +11 -0
- package/dist/module/features/pmProgress/recs/TeacherRecs.js.map +1 -0
- package/dist/module/features/pmProgress/stats/PracticeProgressStats.js +56 -0
- package/dist/module/features/pmProgress/stats/PracticeProgressStats.js.map +1 -0
- package/dist/module/features/pmProgress/stats/StatsCard.js +60 -0
- package/dist/module/features/pmProgress/stats/StatsCard.js.map +1 -0
- package/dist/module/features/pmProgress/temp.js +70 -0
- package/dist/module/features/pmProgress/temp.js.map +1 -0
- package/dist/module/index.js +1 -0
- package/dist/module/index.js.map +1 -1
- package/dist/module/shared/icons/PentagonIcon.js +24 -0
- package/dist/module/shared/icons/PentagonIcon.js.map +1 -0
- package/dist/module/shared/icons/SketchArrowRight.js +25 -0
- package/dist/module/shared/icons/SketchArrowRight.js.map +1 -0
- package/dist/module/shared/icons/SliceDiamondIcon.js +24 -0
- package/dist/module/shared/icons/SliceDiamondIcon.js.map +1 -0
- package/dist/module/shared/icons/StarIcon.js +24 -0
- package/dist/module/shared/icons/StarIcon.js.map +1 -0
- package/dist/module/shared/icons/TimerIcon.js +27 -0
- package/dist/module/shared/icons/TimerIcon.js.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/PracticeProgress.d.ts +3 -0
- package/dist/typescript/commonjs/features/pmProgress/PracticeProgress.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/chart/chart.helpers.d.ts +5 -0
- package/dist/typescript/commonjs/features/pmProgress/chart/chart.helpers.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/chart/chart.types.d.ts +35 -0
- package/dist/typescript/commonjs/features/pmProgress/chart/chart.types.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/chart/components/PracticeProgressPieChart.d.ts +9 -0
- package/dist/typescript/commonjs/features/pmProgress/chart/components/PracticeProgressPieChart.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/chart/components/SlicesClipPaths.d.ts +10 -0
- package/dist/typescript/commonjs/features/pmProgress/chart/components/SlicesClipPaths.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/chart/components/SlicesPaths.d.ts +11 -0
- package/dist/typescript/commonjs/features/pmProgress/chart/components/SlicesPaths.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/chart/components/layers/SliceArcPattern.d.ts +12 -0
- package/dist/typescript/commonjs/features/pmProgress/chart/components/layers/SliceArcPattern.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/chart/components/layers/SliceBackgroundColor.d.ts +8 -0
- package/dist/typescript/commonjs/features/pmProgress/chart/components/layers/SliceBackgroundColor.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/chart/components/layers/SliceFillColor.d.ts +13 -0
- package/dist/typescript/commonjs/features/pmProgress/chart/components/layers/SliceFillColor.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/chart/model/ArcPatternGenerator.d.ts +12 -0
- package/dist/typescript/commonjs/features/pmProgress/chart/model/ArcPatternGenerator.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/chart/model/PieChartManager.d.ts +16 -0
- package/dist/typescript/commonjs/features/pmProgress/chart/model/PieChartManager.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/chart/model/SliceHighlight.d.ts +10 -0
- package/dist/typescript/commonjs/features/pmProgress/chart/model/SliceHighlight.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/chart/model/SliceShapeGenerator.d.ts +15 -0
- package/dist/typescript/commonjs/features/pmProgress/chart/model/SliceShapeGenerator.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/header/PracticeProgressHeader.d.ts +12 -0
- package/dist/typescript/commonjs/features/pmProgress/header/PracticeProgressHeader.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/index.d.ts +2 -0
- package/dist/typescript/commonjs/features/pmProgress/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/list/ListCard.d.ts +15 -0
- package/dist/typescript/commonjs/features/pmProgress/list/ListCard.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/list/ListItem.d.ts +11 -0
- package/dist/typescript/commonjs/features/pmProgress/list/ListItem.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/recs/TeacherRecs.d.ts +3 -0
- package/dist/typescript/commonjs/features/pmProgress/recs/TeacherRecs.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/stats/PracticeProgressStats.d.ts +3 -0
- package/dist/typescript/commonjs/features/pmProgress/stats/PracticeProgressStats.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/stats/StatsCard.d.ts +10 -0
- package/dist/typescript/commonjs/features/pmProgress/stats/StatsCard.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/temp.d.ts +4 -0
- package/dist/typescript/commonjs/features/pmProgress/temp.d.ts.map +1 -0
- package/dist/typescript/commonjs/index.d.ts +1 -0
- package/dist/typescript/commonjs/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/PentagonIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/PentagonIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/SketchArrowRight.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/SketchArrowRight.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/SliceDiamondIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/SliceDiamondIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/StarIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/StarIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/TimerIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/TimerIcon.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/PracticeProgress.d.ts +3 -0
- package/dist/typescript/module/features/pmProgress/PracticeProgress.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/chart/chart.helpers.d.ts +5 -0
- package/dist/typescript/module/features/pmProgress/chart/chart.helpers.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/chart/chart.types.d.ts +35 -0
- package/dist/typescript/module/features/pmProgress/chart/chart.types.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/chart/components/PracticeProgressPieChart.d.ts +9 -0
- package/dist/typescript/module/features/pmProgress/chart/components/PracticeProgressPieChart.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/chart/components/SlicesClipPaths.d.ts +10 -0
- package/dist/typescript/module/features/pmProgress/chart/components/SlicesClipPaths.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/chart/components/SlicesPaths.d.ts +11 -0
- package/dist/typescript/module/features/pmProgress/chart/components/SlicesPaths.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/chart/components/layers/SliceArcPattern.d.ts +12 -0
- package/dist/typescript/module/features/pmProgress/chart/components/layers/SliceArcPattern.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/chart/components/layers/SliceBackgroundColor.d.ts +8 -0
- package/dist/typescript/module/features/pmProgress/chart/components/layers/SliceBackgroundColor.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/chart/components/layers/SliceFillColor.d.ts +13 -0
- package/dist/typescript/module/features/pmProgress/chart/components/layers/SliceFillColor.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/chart/model/ArcPatternGenerator.d.ts +12 -0
- package/dist/typescript/module/features/pmProgress/chart/model/ArcPatternGenerator.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/chart/model/PieChartManager.d.ts +16 -0
- package/dist/typescript/module/features/pmProgress/chart/model/PieChartManager.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/chart/model/SliceHighlight.d.ts +10 -0
- package/dist/typescript/module/features/pmProgress/chart/model/SliceHighlight.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/chart/model/SliceShapeGenerator.d.ts +15 -0
- package/dist/typescript/module/features/pmProgress/chart/model/SliceShapeGenerator.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/header/PracticeProgressHeader.d.ts +12 -0
- package/dist/typescript/module/features/pmProgress/header/PracticeProgressHeader.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/index.d.ts +2 -0
- package/dist/typescript/module/features/pmProgress/index.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/list/ListCard.d.ts +15 -0
- package/dist/typescript/module/features/pmProgress/list/ListCard.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/list/ListItem.d.ts +11 -0
- package/dist/typescript/module/features/pmProgress/list/ListItem.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/recs/TeacherRecs.d.ts +3 -0
- package/dist/typescript/module/features/pmProgress/recs/TeacherRecs.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/stats/PracticeProgressStats.d.ts +3 -0
- package/dist/typescript/module/features/pmProgress/stats/PracticeProgressStats.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/stats/StatsCard.d.ts +10 -0
- package/dist/typescript/module/features/pmProgress/stats/StatsCard.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/temp.d.ts +4 -0
- package/dist/typescript/module/features/pmProgress/temp.d.ts.map +1 -0
- package/dist/typescript/module/index.d.ts +1 -0
- package/dist/typescript/module/index.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/PentagonIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/PentagonIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/SketchArrowRight.d.ts +4 -0
- package/dist/typescript/module/shared/icons/SketchArrowRight.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/SliceDiamondIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/SliceDiamondIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/StarIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/StarIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/TimerIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/TimerIcon.d.ts.map +1 -0
- package/package.json +4 -2
- package/src/features/pmProgress/PracticeProgress.tsx +249 -0
- package/src/features/pmProgress/chart/chart.helpers.ts +15 -0
- package/src/features/pmProgress/chart/chart.types.ts +36 -0
- package/src/features/pmProgress/chart/components/PracticeProgressPieChart.tsx +32 -0
- package/src/features/pmProgress/chart/components/SlicesClipPaths.tsx +36 -0
- package/src/features/pmProgress/chart/components/SlicesPaths.tsx +67 -0
- package/src/features/pmProgress/chart/components/layers/SliceArcPattern.tsx +44 -0
- package/src/features/pmProgress/chart/components/layers/SliceBackgroundColor.tsx +11 -0
- package/src/features/pmProgress/chart/components/layers/SliceFillColor.tsx +55 -0
- package/src/features/pmProgress/chart/model/ArcPatternGenerator.ts +48 -0
- package/src/features/pmProgress/chart/model/PieChartManager.ts +20 -0
- package/src/features/pmProgress/chart/model/SliceHighlight.ts +17 -0
- package/src/features/pmProgress/chart/model/SliceShapeGenerator.ts +71 -0
- package/src/features/pmProgress/header/PracticeProgressHeader.tsx +178 -0
- package/src/features/pmProgress/index.ts +1 -0
- package/src/features/pmProgress/list/ListCard.tsx +133 -0
- package/src/features/pmProgress/list/ListItem.tsx +113 -0
- package/src/features/pmProgress/recs/TeacherRecs.tsx +10 -0
- package/src/features/pmProgress/stats/PracticeProgressStats.tsx +60 -0
- package/src/features/pmProgress/stats/StatsCard.tsx +58 -0
- package/src/features/pmProgress/temp.ts +67 -0
- package/src/index.ts +1 -0
- package/src/shared/icons/PentagonIcon.tsx +17 -0
- package/src/shared/icons/SketchArrowRight.tsx +18 -0
- package/src/shared/icons/SliceDiamondIcon.tsx +16 -0
- package/src/shared/icons/StarIcon.tsx +17 -0
- package/src/shared/icons/TimerIcon.tsx +21 -0
- package/dist/commonjs/features/chatbot/TTS_HIGHLIGHTING.md +0 -120
- package/dist/module/features/chatbot/TTS_HIGHLIGHTING.md +0 -120
- package/src/features/chatbot/TTS_HIGHLIGHTING.md +0 -120
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.OuterArcPatternGenerator = void 0;
|
|
7
|
+
class OuterArcPatternGenerator {
|
|
8
|
+
constructor(config) {
|
|
9
|
+
this.config = config;
|
|
10
|
+
}
|
|
11
|
+
generateArcPath(slice, radius) {
|
|
12
|
+
const gapAngle = this.config.gapBetweenSlices / (2 * radius);
|
|
13
|
+
const startAngle = slice.startAngle + gapAngle;
|
|
14
|
+
const endAngle = slice.endAngle - gapAngle;
|
|
15
|
+
const startPoint = this.polarToCartesian(radius, startAngle);
|
|
16
|
+
const endPoint = this.polarToCartesian(radius, endAngle);
|
|
17
|
+
const largeArcFlag = endAngle - startAngle > Math.PI ? 1 : 0;
|
|
18
|
+
return `M ${startPoint.x} ${startPoint.y} A ${radius} ${radius} 0 ${largeArcFlag} 1 ${endPoint.x} ${endPoint.y}`;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Returns the sizes of the two rings where the checkerboard dashes are drawn. */
|
|
22
|
+
getPatternTrackSizes() {
|
|
23
|
+
const {
|
|
24
|
+
outerRadius,
|
|
25
|
+
outerArc
|
|
26
|
+
} = this.config;
|
|
27
|
+
return [outerRadius - outerArc.strokeWidth / 2, outerRadius - outerArc.strokeWidth * 1.5];
|
|
28
|
+
}
|
|
29
|
+
getDashWidthForRadius(radius) {
|
|
30
|
+
return this.config.outerArc.dashWidth * (radius / this.config.outerRadius);
|
|
31
|
+
}
|
|
32
|
+
getDashOffset(rowIndex, radius) {
|
|
33
|
+
const dashAngle = this.config.outerArc.dashWidth / this.config.outerRadius;
|
|
34
|
+
const dashWidthAtRadius = dashAngle * radius;
|
|
35
|
+
const baseOffset = dashWidthAtRadius / 2;
|
|
36
|
+
if (rowIndex === 1) {
|
|
37
|
+
return baseOffset - dashWidthAtRadius;
|
|
38
|
+
}
|
|
39
|
+
return baseOffset;
|
|
40
|
+
}
|
|
41
|
+
polarToCartesian(radius, angleInRadians) {
|
|
42
|
+
return {
|
|
43
|
+
x: radius * Math.sin(angleInRadians),
|
|
44
|
+
y: -radius * Math.cos(angleInRadians)
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.OuterArcPatternGenerator = OuterArcPatternGenerator;
|
|
49
|
+
//# sourceMappingURL=ArcPatternGenerator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["OuterArcPatternGenerator","constructor","config","generateArcPath","slice","radius","gapAngle","gapBetweenSlices","startAngle","endAngle","startPoint","polarToCartesian","endPoint","largeArcFlag","Math","PI","x","y","getPatternTrackSizes","outerRadius","outerArc","strokeWidth","getDashWidthForRadius","dashWidth","getDashOffset","rowIndex","dashAngle","dashWidthAtRadius","baseOffset","angleInRadians","sin","cos","exports"],"sourceRoot":"../../../../../../src","sources":["features/pmProgress/chart/model/ArcPatternGenerator.ts"],"mappings":";;;;;;AAEO,MAAMA,wBAAwB,CAAC;EACpCC,WAAWA,CAAkBC,MAA6B,EAAE;IAAA,KAA/BA,MAA6B,GAA7BA,MAA6B;EAAG;EAEtDC,eAAeA,CAACC,KAAiB,EAAEC,MAAc,EAAE;IACxD,MAAMC,QAAQ,GAAG,IAAI,CAACJ,MAAM,CAACK,gBAAgB,IAAI,CAAC,GAAGF,MAAM,CAAC;IAC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C,EAAE;MAClB,OAAOG,UAAU,GAAGD,iBAAiB;IACvC;IACA,OAAOC,UAAU;EACnB;EAEQjB,gBAAgBA,CAACN,MAAc,EAAEwB,cAAsB,EAAE;IAC/D,OAAO;MACLb,CAAC,EAAEX,MAAM,GAAGS,IAAI,CAACgB,GAAG,CAACD,cAAc,CAAC;MACpCZ,CAAC,EAAE,CAACZ,MAAM,GAAGS,IAAI,CAACiB,GAAG,CAACF,cAAc;IACtC,CAAC;EACH;AACF;AAACG,OAAA,CAAAhC,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PieChartManager = void 0;
|
|
7
|
+
var _SliceShapeGenerator = require("./SliceShapeGenerator.js");
|
|
8
|
+
var _ArcPatternGenerator = require("./ArcPatternGenerator.js");
|
|
9
|
+
var _SliceHighlight = require("./SliceHighlight.js");
|
|
10
|
+
class PieChartManager {
|
|
11
|
+
constructor(config) {
|
|
12
|
+
this.config = config;
|
|
13
|
+
this.shape = new _SliceShapeGenerator.SliceShapeGenerator(config);
|
|
14
|
+
this.pattern = new _ArcPatternGenerator.OuterArcPatternGenerator(config);
|
|
15
|
+
this.highlight = new _SliceHighlight.SliceHighlight(config);
|
|
16
|
+
}
|
|
17
|
+
getCenter() {
|
|
18
|
+
return {
|
|
19
|
+
x: this.config.size / 2,
|
|
20
|
+
y: this.config.size / 2
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.PieChartManager = PieChartManager;
|
|
25
|
+
//# sourceMappingURL=PieChartManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_SliceShapeGenerator","require","_ArcPatternGenerator","_SliceHighlight","PieChartManager","constructor","config","shape","SliceShapeGenerator","pattern","OuterArcPatternGenerator","highlight","SliceHighlight","getCenter","x","size","y","exports"],"sourceRoot":"../../../../../../src","sources":["features/pmProgress/chart/model/PieChartManager.ts"],"mappings":";;;;;;AAAA,IAAAA,oBAAA,GAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AAGO,MAAMG,eAAe,CAAC;EAK3BC,WAAWA,CAAiBC,MAA6B,EAAE;IAAA,KAA/BA,MAA6B,GAA7BA,MAA6B;IACvD,IAAI,CAACC,KAAK,GAAG,IAAIC,wCAAmB,CAACF,MAAM,CAAC;IAC5C,IAAI,CAACG,OAAO,GAAG,IAAIC,6CAAwB,CAACJ,MAAM,CAAC;IACnD,IAAI,CAACK,SAAS,GAAG,IAAIC,8BAAc,CAACN,MAAM,CAAC;EAC7C;EAEOO,SAASA,CAAA,EAAG;IACjB,OAAO;MAAEC,CAAC,EAAE,IAAI,CAACR,MAAM,CAACS,IAAI,GAAG,CAAC;MAAEC,CAAC,EAAE,IAAI,CAACV,MAAM,CAACS,IAAI,GAAG;IAAE,CAAC;EAC7D;AACF;AAACE,OAAA,CAAAb,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SliceHighlight = void 0;
|
|
7
|
+
var _effector = require("effector");
|
|
8
|
+
class SliceHighlight {
|
|
9
|
+
highlightSlice = (0, _effector.createEvent)();
|
|
10
|
+
resetHighlight = (0, _effector.createEvent)();
|
|
11
|
+
$highlightedIndex = (0, _effector.createStore)(null).on(this.highlightSlice, (_, index) => index).reset(this.resetHighlight);
|
|
12
|
+
constructor(config) {
|
|
13
|
+
this.config = config;
|
|
14
|
+
}
|
|
15
|
+
getTranslateY(isHighlighted) {
|
|
16
|
+
return isHighlighted ? -this.config.pressOffset : 0;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.SliceHighlight = SliceHighlight;
|
|
20
|
+
//# sourceMappingURL=SliceHighlight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_effector","require","SliceHighlight","highlightSlice","createEvent","resetHighlight","$highlightedIndex","createStore","on","_","index","reset","constructor","config","getTranslateY","isHighlighted","pressOffset","exports"],"sourceRoot":"../../../../../../src","sources":["features/pmProgress/chart/model/SliceHighlight.ts"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAGO,MAAMC,cAAc,CAAC;EACVC,cAAc,GAAG,IAAAC,qBAAW,EAAS,CAAC;EACtCC,cAAc,GAAG,IAAAD,qBAAW,EAAC,CAAC;EAE9BE,iBAAiB,GAAG,IAAAC,qBAAW,EAAgB,IAAI,CAAC,CACjEC,EAAE,CAAC,IAAI,CAACL,cAAc,EAAE,CAACM,CAAC,EAAEC,KAAK,KAAKA,KAAK,CAAC,CAC5CC,KAAK,CAAC,IAAI,CAACN,cAAc,CAAC;EAE7BO,WAAWA,CAAkBC,MAA6B,EAAE;IAAA,KAA/BA,MAA6B,GAA7BA,MAA6B;EAAG;EAEtDC,aAAaA,CAACC,aAAsB,EAAU;IACnD,OAAOA,aAAa,GAAG,CAAC,IAAI,CAACF,MAAM,CAACG,WAAW,GAAG,CAAC;EACrD;AACF;AAACC,OAAA,CAAAf,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SliceShapeGenerator = void 0;
|
|
7
|
+
var _d3Shape = require("d3-shape");
|
|
8
|
+
class SliceShapeGenerator {
|
|
9
|
+
innerRadius = 0;
|
|
10
|
+
d3Pie = (0, _d3Shape.pie)().value(({
|
|
11
|
+
value
|
|
12
|
+
}) => value).sort(null);
|
|
13
|
+
constructor(config) {
|
|
14
|
+
this.config = config;
|
|
15
|
+
}
|
|
16
|
+
generateSlices(data) {
|
|
17
|
+
this.innerRadius = this.getInnerRadius(data.length);
|
|
18
|
+
return this.d3Pie(data).map((datum, index) => ({
|
|
19
|
+
index,
|
|
20
|
+
startAngle: datum.startAngle,
|
|
21
|
+
endAngle: datum.endAngle,
|
|
22
|
+
fillPercent: datum.data.fillPercent ?? 0,
|
|
23
|
+
backgroundColor: datum.data.backgroundColor ?? this.config.colors.background,
|
|
24
|
+
fillColor: datum.data.fillColor,
|
|
25
|
+
borderColor: datum.data.borderColor,
|
|
26
|
+
data: datum.data
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
generateSlicePath(slice) {
|
|
30
|
+
const cornerRadius = this.getCornerRadius(100);
|
|
31
|
+
return this.buildArc(slice, this.config.outerRadius, cornerRadius);
|
|
32
|
+
}
|
|
33
|
+
generateFillPath(slice) {
|
|
34
|
+
const innerRadius = this.innerRadius;
|
|
35
|
+
const outerRadius = this.config.outerRadius;
|
|
36
|
+
const fillRadius = innerRadius + (outerRadius - innerRadius) * (slice.fillPercent / 100);
|
|
37
|
+
const radialThickness = fillRadius - innerRadius;
|
|
38
|
+
const cornerRadius = Math.min(this.getCornerRadius(slice.fillPercent), radialThickness / 2);
|
|
39
|
+
return this.buildArc(slice, fillRadius, cornerRadius);
|
|
40
|
+
}
|
|
41
|
+
getInnerRadius(sliceCount) {
|
|
42
|
+
const {
|
|
43
|
+
innerRadius
|
|
44
|
+
} = this.config;
|
|
45
|
+
return typeof innerRadius === 'function' ? innerRadius(sliceCount) : innerRadius;
|
|
46
|
+
}
|
|
47
|
+
getCornerRadius(fillPercent) {
|
|
48
|
+
const {
|
|
49
|
+
cornerRadius
|
|
50
|
+
} = this.config;
|
|
51
|
+
return typeof cornerRadius === 'function' ? cornerRadius(fillPercent) : cornerRadius;
|
|
52
|
+
}
|
|
53
|
+
get padAngle() {
|
|
54
|
+
return this.config.gapBetweenSlices / this.config.outerRadius;
|
|
55
|
+
}
|
|
56
|
+
buildArc(slice, outerRadius, cornerRadius) {
|
|
57
|
+
const innerRadius = this.innerRadius;
|
|
58
|
+
return (0, _d3Shape.arc)().outerRadius(outerRadius).innerRadius(innerRadius).cornerRadius(cornerRadius).padAngle(this.padAngle).padRadius(this.config.outerRadius)({
|
|
59
|
+
startAngle: slice.startAngle,
|
|
60
|
+
endAngle: slice.endAngle,
|
|
61
|
+
innerRadius,
|
|
62
|
+
outerRadius
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.SliceShapeGenerator = SliceShapeGenerator;
|
|
67
|
+
//# sourceMappingURL=SliceShapeGenerator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_d3Shape","require","SliceShapeGenerator","innerRadius","d3Pie","pie","value","sort","constructor","config","generateSlices","data","getInnerRadius","length","map","datum","index","startAngle","endAngle","fillPercent","backgroundColor","colors","background","fillColor","borderColor","generateSlicePath","slice","cornerRadius","getCornerRadius","buildArc","outerRadius","generateFillPath","fillRadius","radialThickness","Math","min","sliceCount","padAngle","gapBetweenSlices","arc","padRadius","exports"],"sourceRoot":"../../../../../../src","sources":["features/pmProgress/chart/model/SliceShapeGenerator.ts"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAGO,MAAMC,mBAAmB,CAAC;EACvBC,WAAW,GAAG,CAAC;EACNC,KAAK,GAAG,IAAAC,YAAG,EAAiB,CAAC,CAC3CC,KAAK,CAAC,CAAC;IAAEA;EAAM,CAAC,KAAKA,KAAK,CAAC,CAC3BC,IAAI,CAAC,IAAI,CAAC;EAEbC,WAAWA,CAAkBC,MAA6B,EAAE;IAAA,KAA/BA,MAA6B,GAA7BA,MAA6B;EAAG;EAEtDC,cAAcA,CAACC,IAAsB,EAAgB;IAC1D,IAAI,CAACR,WAAW,GAAG,IAAI,CAACS,cAAc,CAACD,IAAI,CAACE,MAAM,CAAC;IAEnD,OAAO,IAAI,CAACT,K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CAACwB,UAAkB,EAAU;IACjD,MAAM;MAAEjC;IAAY,CAAC,GAAG,IAAI,CAACM,MAAM;IACnC,OAAO,OAAON,WAAW,KAAK,UAAU,GAAGA,WAAW,CAACiC,UAAU,CAAC,GAAGjC,WAAW;EAClF;EAEQyB,eAAeA,CAACT,WAAmB,EAAU;IACnD,MAAM;MAAEQ;IAAa,CAAC,GAAG,IAAI,CAAClB,MAAM;IACpC,OAAO,OAAOkB,YAAY,KAAK,UAAU,GAAGA,YAAY,CAACR,WAAW,CAAC,GAAGQ,YAAY;EACtF;EAEA,IAAYU,QAAQA,CAAA,EAAW;IAC7B,OAAO,IAAI,CAAC5B,MAAM,CAAC6B,gBAAgB,GAAG,IAAI,CAAC7B,MAAM,CAACqB,WAAW;EAC/D;EAEQD,QAAQA,CAACH,KAAiB,EAAEI,WAAmB,EAAEH,YAAoB,EAAU;IACrF,MAAMxB,WAAW,GAAG,IAAI,CAACA,WAAW;IAEpC,OAAO,IAAAoC,YAAG,EAAC,CAAC,CACTT,WAAW,CAACA,WAAW,CAAC,CACxB3B,WAAW,CAACA,WAAW,CAAC,CACxBwB,YAAY,CAACA,YAAY,CAAC,CAC1BU,QAAQ,CAAC,IAAI,CAACA,QAAQ,CAAC,CACvBG,SAAS,CAAC,IAAI,CAAC/B,MAAM,CAACqB,WAAW,CAAC,CAAC;MACpCb,UAAU,EAAES,KAAK,CAACT,UAAU;MAC5BC,QAAQ,EAAEQ,KAAK,CAACR,QAAQ;MACxBf,WAAW;MACX2B;IACF,CAAC,CAAC;EACJ;AACF;AAACW,OAAA,CAAAvC,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PracticeProgressHeader = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _reactNativeUi = require("@magmamath/react-native-ui");
|
|
10
|
+
var _SketchArrowRight = require("../../../shared/icons/SketchArrowRight.js");
|
|
11
|
+
var _SliceDiamondIcon = require("../../../shared/icons/SliceDiamondIcon.js");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
+
// TODO: temp, remove and pass from props
|
|
16
|
+
const items = [{
|
|
17
|
+
key: 'item-1',
|
|
18
|
+
title: 'Grade1'
|
|
19
|
+
}, {
|
|
20
|
+
key: 'item-1',
|
|
21
|
+
title: 'Grade2'
|
|
22
|
+
}, {
|
|
23
|
+
key: 'item-1',
|
|
24
|
+
title: 'Grade3'
|
|
25
|
+
}];
|
|
26
|
+
const PracticeProgressHeader = ({
|
|
27
|
+
title,
|
|
28
|
+
grade,
|
|
29
|
+
nextUp,
|
|
30
|
+
topic,
|
|
31
|
+
buttonLabel,
|
|
32
|
+
topicColor
|
|
33
|
+
}) => {
|
|
34
|
+
const [isDropdownOpen, setIsDropdownOpen] = (0, _react.useState)(false);
|
|
35
|
+
const CaretIcon = isDropdownOpen ? _reactNativeUi.CaretUpIcon : _reactNativeUi.CaretDownIcon;
|
|
36
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
37
|
+
style: styles.container,
|
|
38
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
39
|
+
style: styles.title,
|
|
40
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Typography, {
|
|
41
|
+
variant: _reactNativeUi.HeadingVariants.H2,
|
|
42
|
+
style: styles.dark,
|
|
43
|
+
children: title
|
|
44
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Dropdown, {
|
|
45
|
+
isOpen: isDropdownOpen,
|
|
46
|
+
anchor: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeUi.Button, {
|
|
47
|
+
variant: _reactNativeUi.ButtonVariant.TERTIARY,
|
|
48
|
+
onPress: () => setIsDropdownOpen(prev => !prev),
|
|
49
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Typography, {
|
|
50
|
+
variant: _reactNativeUi.HeadingVariants.H8,
|
|
51
|
+
style: styles.dark,
|
|
52
|
+
children: grade
|
|
53
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
54
|
+
style: styles.caret,
|
|
55
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(CaretIcon, {
|
|
56
|
+
color: _reactNativeUi.COLORS.NEUTRAL_9
|
|
57
|
+
})
|
|
58
|
+
})]
|
|
59
|
+
}),
|
|
60
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Menu, {
|
|
61
|
+
style: styles.menu,
|
|
62
|
+
items: items
|
|
63
|
+
})
|
|
64
|
+
})]
|
|
65
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
66
|
+
style: styles.nextUp,
|
|
67
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
68
|
+
style: styles.content,
|
|
69
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
70
|
+
style: styles.subtitle,
|
|
71
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Typography, {
|
|
72
|
+
variant: _reactNativeUi.HeadingVariants.H2,
|
|
73
|
+
style: styles.dark,
|
|
74
|
+
children: nextUp
|
|
75
|
+
})
|
|
76
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
77
|
+
style: [styles.row, styles.tilted],
|
|
78
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Typography, {
|
|
79
|
+
variant: _reactNativeUi.HeadingVariants.H7,
|
|
80
|
+
style: styles.muted,
|
|
81
|
+
children: topic
|
|
82
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
83
|
+
style: styles.diamond,
|
|
84
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SliceDiamondIcon.SliceDiamondIcon, {
|
|
85
|
+
color: topicColor
|
|
86
|
+
})
|
|
87
|
+
})]
|
|
88
|
+
})]
|
|
89
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
90
|
+
style: styles.arrow,
|
|
91
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SketchArrowRight.SketchArrowRight, {})
|
|
92
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Button, {
|
|
93
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.PlayIcon, {
|
|
94
|
+
size: 16,
|
|
95
|
+
color: _reactNativeUi.COLORS.NEUTRAL_1
|
|
96
|
+
}),
|
|
97
|
+
variant: _reactNativeUi.ButtonVariant.PRIMARY,
|
|
98
|
+
size: _reactNativeUi.ButtonSize.LARGE,
|
|
99
|
+
colorScheme: _reactNativeUi.ButtonColor.YELLOW,
|
|
100
|
+
raiseLevel: 6,
|
|
101
|
+
style: {
|
|
102
|
+
container: styles.startButton
|
|
103
|
+
},
|
|
104
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Typography, {
|
|
105
|
+
variant: _reactNativeUi.HeadingVariants.H6,
|
|
106
|
+
style: styles.startButtonText,
|
|
107
|
+
children: buttonLabel
|
|
108
|
+
})
|
|
109
|
+
})]
|
|
110
|
+
})]
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
exports.PracticeProgressHeader = PracticeProgressHeader;
|
|
114
|
+
const styles = _reactNative.StyleSheet.create({
|
|
115
|
+
container: {
|
|
116
|
+
flexDirection: 'row',
|
|
117
|
+
justifyContent: 'space-between',
|
|
118
|
+
alignItems: 'center',
|
|
119
|
+
marginBottom: _reactNativeUi.SPACING[400]
|
|
120
|
+
},
|
|
121
|
+
title: {
|
|
122
|
+
flexDirection: 'row',
|
|
123
|
+
alignItems: 'center',
|
|
124
|
+
gap: _reactNativeUi.SPACING[200]
|
|
125
|
+
},
|
|
126
|
+
dark: {
|
|
127
|
+
color: _reactNativeUi.COLORS.NEUTRAL_9
|
|
128
|
+
},
|
|
129
|
+
caret: {
|
|
130
|
+
marginLeft: _reactNativeUi.SPACING[100]
|
|
131
|
+
},
|
|
132
|
+
menu: {
|
|
133
|
+
top: _reactNativeUi.SPACING[100],
|
|
134
|
+
minWidth: 110
|
|
135
|
+
},
|
|
136
|
+
nextUp: {
|
|
137
|
+
flexDirection: 'row',
|
|
138
|
+
alignItems: 'center',
|
|
139
|
+
gap: _reactNativeUi.SPACING[400]
|
|
140
|
+
},
|
|
141
|
+
content: {
|
|
142
|
+
alignItems: 'center',
|
|
143
|
+
gap: _reactNativeUi.SPACING[100]
|
|
144
|
+
},
|
|
145
|
+
subtitle: {
|
|
146
|
+
transform: [{
|
|
147
|
+
rotate: '355deg'
|
|
148
|
+
}],
|
|
149
|
+
marginRight: _reactNativeUi.SPACING[300]
|
|
150
|
+
},
|
|
151
|
+
tilted: {
|
|
152
|
+
transform: [{
|
|
153
|
+
rotate: '355deg'
|
|
154
|
+
}]
|
|
155
|
+
},
|
|
156
|
+
row: {
|
|
157
|
+
flexDirection: 'row',
|
|
158
|
+
gap: _reactNativeUi.SPACING[100]
|
|
159
|
+
},
|
|
160
|
+
muted: {
|
|
161
|
+
color: _reactNativeUi.COLORS.NEUTRAL_8
|
|
162
|
+
},
|
|
163
|
+
diamond: {
|
|
164
|
+
bottom: 10
|
|
165
|
+
},
|
|
166
|
+
arrow: {
|
|
167
|
+
transform: [{
|
|
168
|
+
rotate: '358deg'
|
|
169
|
+
}]
|
|
170
|
+
},
|
|
171
|
+
startButton: {
|
|
172
|
+
minWidth: 145
|
|
173
|
+
},
|
|
174
|
+
startButtonText: {
|
|
175
|
+
fontWeight: '700',
|
|
176
|
+
textTransform: 'uppercase',
|
|
177
|
+
color: _reactNativeUi.COLORS.NEUTRAL_1
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
//# sourceMappingURL=PracticeProgressHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeUi","_SketchArrowRight","_SliceDiamondIcon","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","items","key","title","PracticeProgressHeader","grade","nextUp","topic","buttonLabel","topicColor","isDropdownOpen","setIsDropdownOpen","useState","CaretIcon","CaretUpIcon","CaretDownIcon","jsxs","View","style","styles","container","children","jsx","Typography","variant","HeadingVariants","H2","dark","Dropdown","isOpen","anchor","Button","ButtonVariant","TERTIARY","onPress","prev","H8","caret","color","COLORS","NEUTRAL_9","Menu","menu","content","subtitle","row","tilted","H7","muted","diamond","SliceDiamondIcon","arrow","SketchArrowRight","icon","PlayIcon","size","NEUTRAL_1","PRIMARY","ButtonSize","LARGE","colorScheme","ButtonColor","YELLOW","raiseLevel","startButton","H6","startButtonText","exports","StyleSheet","create","flexDirection","justifyContent","alignItems","marginBottom","SPACING","gap","marginLeft","top","minWidth","transform","rotate","marginRight","NEUTRAL_8","bottom","fontWeight","textTransform"],"sourceRoot":"../../../../../src","sources":["features/pmProgress/header/PracticeProgressHeader.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AAeA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AAAyE,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAM,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC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,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAS,CAAC,CAAC;IACjCC,WAAW,EAAEP,sBAAO,CAAC,GAAG;EAC1B,CAAC;EACD5B,MAAM,EAAE;IACNiC,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAS,CAAC;EAClC,CAAC;EACDnC,GAAG,EAAE;IACHyB,aAAa,EAAE,KAAK;IACpBK,GAAG,EAAED,sBAAO,CAAC,GAAG;EAClB,CAAC;EACD1B,KAAK,EAAE;IACLV,KAAK,EAAEC,qBAAM,CAAC2C;EAChB,CAAC;EACDjC,OAAO,EAAE;IACPkC,MAAM,EAAE;EACV,CAAC;EACDhC,KAAK,EAAE;IACL4B,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAS,CAAC;EAClC,CAAC;EACDhB,WAAW,EAAE;IACXc,QAAQ,EAAE;EACZ,CAAC;EACDZ,eAAe,EAAE;IACfkB,UAAU,EAAE,KAAK;IACjBC,aAAa,EAAE,WAAW;IAC1B/C,KAAK,EAAEC,qBAAM,CAACiB;EAChB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "PracticeProgress", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _PracticeProgress.PracticeProgress;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _PracticeProgress = require("./PracticeProgress.js");
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_PracticeProgress","require"],"sourceRoot":"../../../../src","sources":["features/pmProgress/index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ListCard = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _reactNativeUi = require("@magmamath/react-native-ui");
|
|
10
|
+
var _ListItem = require("./ListItem.js");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
const HEADER_HEIGHT = 60;
|
|
15
|
+
const RADIUS = _reactNativeUi.BORDER_RADIUS[200];
|
|
16
|
+
const PROGRESS_BAR_WIDTH = 50;
|
|
17
|
+
const PROGRESS_BAR_HEIGHT = 10;
|
|
18
|
+
const ListCard = ({
|
|
19
|
+
title,
|
|
20
|
+
icon,
|
|
21
|
+
color,
|
|
22
|
+
items,
|
|
23
|
+
progress = 0,
|
|
24
|
+
rightContent,
|
|
25
|
+
isFirst,
|
|
26
|
+
isLast
|
|
27
|
+
}) => {
|
|
28
|
+
const [expanded, setExpanded] = (0, _react.useState)(false);
|
|
29
|
+
const Caret = expanded ? _reactNativeUi.CaretUpIcon : _reactNativeUi.CaretDownIcon;
|
|
30
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
31
|
+
style: [styles.container, isFirst && styles.first, isLast && styles.last],
|
|
32
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
|
|
33
|
+
style: styles.header,
|
|
34
|
+
onPress: () => setExpanded(prev => !prev),
|
|
35
|
+
children: [icon, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
36
|
+
style: styles.caret,
|
|
37
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Caret, {
|
|
38
|
+
color: _reactNativeUi.COLORS.NEUTRAL_9
|
|
39
|
+
})
|
|
40
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Typography, {
|
|
41
|
+
variant: _reactNativeUi.HeadingVariants.H6,
|
|
42
|
+
style: styles.title,
|
|
43
|
+
children: title
|
|
44
|
+
}), rightContent ?? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
45
|
+
style: styles.progress,
|
|
46
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeUi.Typography, {
|
|
47
|
+
variant: _reactNativeUi.HeadingVariants.H7,
|
|
48
|
+
style: [styles.percentage, {
|
|
49
|
+
color
|
|
50
|
+
}],
|
|
51
|
+
children: [Math.round(progress), "%"]
|
|
52
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
53
|
+
style: styles.track,
|
|
54
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
55
|
+
style: [styles.fill, {
|
|
56
|
+
width: `${progress}%`,
|
|
57
|
+
backgroundColor: color
|
|
58
|
+
}]
|
|
59
|
+
})
|
|
60
|
+
})]
|
|
61
|
+
})]
|
|
62
|
+
}), expanded && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
63
|
+
style: styles.items,
|
|
64
|
+
children: items.map((item, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_ListItem.ListItem, {
|
|
65
|
+
...item
|
|
66
|
+
}, index))
|
|
67
|
+
})]
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
exports.ListCard = ListCard;
|
|
71
|
+
const styles = _reactNative.StyleSheet.create({
|
|
72
|
+
container: {
|
|
73
|
+
justifyContent: 'center',
|
|
74
|
+
backgroundColor: _reactNativeUi.COLORS.NEUTRAL_2,
|
|
75
|
+
borderWidth: 1,
|
|
76
|
+
borderColor: _reactNativeUi.COLORS.NEUTRAL_4,
|
|
77
|
+
borderTopWidth: 0,
|
|
78
|
+
overflow: 'hidden'
|
|
79
|
+
},
|
|
80
|
+
first: {
|
|
81
|
+
borderTopWidth: 1,
|
|
82
|
+
borderTopLeftRadius: RADIUS,
|
|
83
|
+
borderTopRightRadius: RADIUS
|
|
84
|
+
},
|
|
85
|
+
last: {
|
|
86
|
+
borderBottomLeftRadius: RADIUS,
|
|
87
|
+
borderBottomRightRadius: RADIUS
|
|
88
|
+
},
|
|
89
|
+
header: {
|
|
90
|
+
flexDirection: 'row',
|
|
91
|
+
alignItems: 'center',
|
|
92
|
+
height: HEADER_HEIGHT,
|
|
93
|
+
padding: _reactNativeUi.SPACING[400],
|
|
94
|
+
backgroundColor: _reactNativeUi.COLORS.NEUTRAL_2
|
|
95
|
+
},
|
|
96
|
+
caret: {
|
|
97
|
+
marginLeft: _reactNativeUi.SPACING[400]
|
|
98
|
+
},
|
|
99
|
+
title: {
|
|
100
|
+
marginLeft: _reactNativeUi.SPACING[200],
|
|
101
|
+
flex: 1
|
|
102
|
+
},
|
|
103
|
+
progress: {
|
|
104
|
+
flexDirection: 'row',
|
|
105
|
+
alignItems: 'center',
|
|
106
|
+
gap: _reactNativeUi.SPACING[200]
|
|
107
|
+
},
|
|
108
|
+
percentage: {
|
|
109
|
+
textAlign: 'right'
|
|
110
|
+
},
|
|
111
|
+
track: {
|
|
112
|
+
width: PROGRESS_BAR_WIDTH,
|
|
113
|
+
height: PROGRESS_BAR_HEIGHT,
|
|
114
|
+
backgroundColor: _reactNativeUi.COLORS.NEUTRAL_4,
|
|
115
|
+
borderRadius: _reactNativeUi.BORDER_RADIUS[200],
|
|
116
|
+
overflow: 'hidden'
|
|
117
|
+
},
|
|
118
|
+
fill: {
|
|
119
|
+
height: '100%',
|
|
120
|
+
borderRadius: _reactNativeUi.BORDER_RADIUS[200]
|
|
121
|
+
},
|
|
122
|
+
items: {
|
|
123
|
+
gap: _reactNativeUi.SPACING[200],
|
|
124
|
+
padding: _reactNativeUi.SPACING[200],
|
|
125
|
+
backgroundColor: _reactNativeUi.COLORS.NEUTRAL_1
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
//# sourceMappingURL=ListCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeUi","_ListItem","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","HEADER_HEIGHT","RADIUS","BORDER_RADIUS","PROGRESS_BAR_WIDTH","PROGRESS_BAR_HEIGHT","ListCard","title","icon","color","items","progress","rightContent","isFirst","isLast","expanded","setExpanded","useState","Caret","CaretUpIcon","CaretDownIcon","jsxs","View","style","styles","container","first","last","children","Pressable","header","onPress","prev","jsx","caret","COLORS","NEUTRAL_9","Typography","variant","HeadingVariants","H6","H7","percentage","Math","round","track","fill","width","backgroundColor","map","item","index","ListItem","exports","StyleSheet","create","justifyContent","NEUTRAL_2","borderWidth","borderColor","NEUTRAL_4","borderTopWidth","overflow","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","flexDirection","alignItems","height","padding","SPACING","marginLeft","flex","gap","textAlign","borderRadius","NEUTRAL_1"],"sourceRoot":"../../../../../src","sources":["features/pmProgress/list/ListCard.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAA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