@cuemath/leap 3.5.68-as2 → 3.5.69-as1

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.
@@ -1,58 +1,70 @@
1
- import { jsxs as e, jsx as r } from "react/jsx-runtime";
2
- import { memo as p } from "react";
3
- import o from "../../../../ui/text/text.js";
4
- import l from "../score-badge/score-badge.js";
5
- import { HeaderContainer as f, BackButtonContainer as s, BackButtonWrapper as h } from "./report-header-styled.js";
6
- import { IS_APP_RUNNING_IN_RN as $ } from "../../../../../constants/app-config.js";
7
- import u from "../../../../ui/separator/separator.js";
8
- import { formatTestDate as B } from "../../math-fit-report-helpers.js";
1
+ import { jsxs as t, jsx as r } from "react/jsx-runtime";
2
+ import { memo as u, useMemo as h } from "react";
3
+ import n from "../../../../ui/text/text.js";
4
+ import g from "../score-badge/score-badge.js";
5
+ import { IS_APP_RUNNING_IN_RN as o } from "../../../../../constants/app-config.js";
6
+ import B from "../../../../ui/separator/separator.js";
7
+ import { formatTestDate as $ } from "../../math-fit-report-helpers.js";
9
8
  import _ from "../../../../../assets/line-icons/icons/back2.js";
10
- import g from "../../../../ui/buttons/icon-button/icon-button.js";
11
- const y = p(function({
12
- createdOnTs: t,
13
- maxScore: n,
14
- score: a,
15
- scoreChange: i,
16
- studentName: m,
17
- userType: c,
18
- onBack: d
9
+ import x from "../../../../ui/buttons/icon-button/icon-button.js";
10
+ import { HeaderContainer as A, BackButtonContainer as C, BackButtonWrapper as I } from "./report-header-styled.js";
11
+ const P = u(function({
12
+ createdOnTs: a,
13
+ maxScore: i,
14
+ score: d,
15
+ scoreChange: s,
16
+ studentName: c,
17
+ userType: l,
18
+ onBack: m,
19
+ compactView: e = !1,
20
+ showGreeting: f = !0
19
21
  }) {
20
- return /* @__PURE__ */ e(
21
- f,
22
+ const p = h(() => o ? e ? 5 : 9.6 : 11.75, [e]);
23
+ return /* @__PURE__ */ t(
24
+ A,
22
25
  {
23
26
  $background: "BLUE_4",
24
- $heightX: $ ? 9.6 : 11.75,
27
+ $heightX: p,
25
28
  $gapX: 1.5,
26
29
  $gutterX: 1.5,
27
- $justifyContent: "flex-end",
30
+ $justifyContent: e ? "center" : "flex-end",
28
31
  $position: "relative",
29
32
  children: [
30
- c === "TEACHER" && /* @__PURE__ */ r(s, { $height: "100%", children: /* @__PURE__ */ r(h, { children: /* @__PURE__ */ r(
31
- g,
33
+ l === "TEACHER" && /* @__PURE__ */ r(C, { $height: "100%", children: /* @__PURE__ */ r(I, { children: /* @__PURE__ */ r(
34
+ x,
32
35
  {
33
36
  Icon: _,
34
37
  renderAs: "secondary-gray",
35
38
  analyticsLabel: "chapter_page_exit",
36
39
  size: "xsmall",
37
- onClick: d
40
+ onClick: m
38
41
  }
39
42
  ) }) }),
40
- /* @__PURE__ */ e(o, { $renderAs: "ab1-bold", $color: "BLACK_1", children: [
43
+ f && /* @__PURE__ */ t(n, { $renderAs: "ab1-bold", $color: "BLACK_1", children: [
41
44
  "Well done, ",
42
- m || "",
45
+ c || "",
43
46
  "!"
44
47
  ] }),
45
- /* @__PURE__ */ r(u, { heightX: 0.5 }),
46
- /* @__PURE__ */ r(l, { score: a, maxScore: n, scoreChange: i, renderInHeader: !0 }),
47
- /* @__PURE__ */ e(o, { $renderAs: "ac4", $color: "BLACK_T_60", children: [
48
+ /* @__PURE__ */ r(B, { heightX: 0.5 }),
49
+ /* @__PURE__ */ r(
50
+ g,
51
+ {
52
+ score: d,
53
+ maxScore: i,
54
+ scoreChange: s,
55
+ renderInHeader: !0,
56
+ renderInMobile: !!(o || e)
57
+ }
58
+ ),
59
+ /* @__PURE__ */ t(n, { $renderAs: o || e ? "ac5" : "ac4", $color: "BLACK_T_60", children: [
48
60
  "TEST Score • ",
49
- B(t)
61
+ $(a)
50
62
  ] })
51
63
  ]
52
64
  }
53
65
  );
54
66
  });
55
67
  export {
56
- y as default
68
+ P as default
57
69
  };
58
70
  //# sourceMappingURL=report-header.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"report-header.js","sources":["../../../../../../src/features/math-fit/math-fit-report/comps/report-header/report-header.tsx"],"sourcesContent":["import { memo, type FC } from 'react';\n\nimport Text from '../../../../ui/text/text';\nimport ScoreBadge from '../score-badge/score-badge';\nimport type { IReportHeaderProps } from './report-header-types';\nimport * as Styled from './report-header-styled';\nimport { IS_APP_RUNNING_IN_RN } from '../../../../../constants/app-config';\nimport Separator from '../../../../ui/separator/separator';\nimport { formatTestDate } from '../../math-fit-report-helpers';\nimport Back2Icon from '../../../../../assets/line-icons/icons/back2';\nimport IconButton from '../../../../ui/buttons/icon-button/icon-button';\n\nconst ReportHeader: FC<IReportHeaderProps> = memo(function ReportHeader({\n createdOnTs,\n maxScore,\n score,\n scoreChange,\n studentName,\n userType,\n onBack,\n}) {\n return (\n <Styled.HeaderContainer\n $background=\"BLUE_4\"\n $heightX={IS_APP_RUNNING_IN_RN ? 9.6 : 11.75}\n $gapX={1.5}\n $gutterX={1.5}\n $justifyContent=\"flex-end\"\n $position=\"relative\"\n >\n {userType === 'TEACHER' && (\n <Styled.BackButtonContainer $height=\"100%\">\n <Styled.BackButtonWrapper>\n <IconButton\n Icon={Back2Icon}\n renderAs=\"secondary-gray\"\n analyticsLabel=\"chapter_page_exit\"\n size=\"xsmall\"\n onClick={onBack}\n />\n </Styled.BackButtonWrapper>\n </Styled.BackButtonContainer>\n )}\n <Text $renderAs=\"ab1-bold\" $color=\"BLACK_1\">\n Well done, {studentName || ''}!\n </Text>\n <Separator heightX={0.5} />\n <ScoreBadge score={score} maxScore={maxScore} scoreChange={scoreChange} renderInHeader />\n <Text $renderAs=\"ac4\" $color=\"BLACK_T_60\">\n TEST Score • {formatTestDate(createdOnTs)}\n </Text>\n </Styled.HeaderContainer>\n );\n});\n\nexport default ReportHeader;\n"],"names":["ReportHeader","memo","createdOnTs","maxScore","score","scoreChange","studentName","userType","onBack","jsxs","Styled.HeaderContainer","IS_APP_RUNNING_IN_RN","jsx","Styled.BackButtonContainer","Styled.BackButtonWrapper","IconButton","Back2Icon","Text","Separator","ScoreBadge","formatTestDate"],"mappings":";;;;;;;;;;AAYM,MAAAA,IAAuCC,EAAK,SAAsB;AAAA,EACtE,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AACF,GAAG;AAEC,SAAA,gBAAAC;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,aAAY;AAAA,MACZ,UAAUC,IAAuB,MAAM;AAAA,MACvC,OAAO;AAAA,MACP,UAAU;AAAA,MACV,iBAAgB;AAAA,MAChB,WAAU;AAAA,MAET,UAAA;AAAA,QAAaJ,MAAA,aACX,gBAAAK,EAAAC,GAAA,EAA2B,SAAQ,QAClC,UAAA,gBAAAD,EAACE,GAAA,EACC,UAAA,gBAAAF;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,MAAMC;AAAA,YACN,UAAS;AAAA,YACT,gBAAe;AAAA,YACf,MAAK;AAAA,YACL,SAASR;AAAA,UAAA;AAAA,WAEb,EACF,CAAA;AAAA,QAED,gBAAAC,EAAAQ,GAAA,EAAK,WAAU,YAAW,QAAO,WAAU,UAAA;AAAA,UAAA;AAAA,UAC9BX,KAAe;AAAA,UAAG;AAAA,QAAA,GAChC;AAAA,QACA,gBAAAM,EAACM,GAAU,EAAA,SAAS,IAAK,CAAA;AAAA,0BACxBC,GAAW,EAAA,OAAAf,GAAc,UAAAD,GAAoB,aAAAE,GAA0B,gBAAc,IAAC;AAAA,QACtF,gBAAAI,EAAAQ,GAAA,EAAK,WAAU,OAAM,QAAO,cAAa,UAAA;AAAA,UAAA;AAAA,UAC1BG,EAAelB,CAAW;AAAA,QAAA,GAC1C;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
1
+ {"version":3,"file":"report-header.js","sources":["../../../../../../src/features/math-fit/math-fit-report/comps/report-header/report-header.tsx"],"sourcesContent":["import { memo, useMemo, type FC } from 'react';\nimport Text from '../../../../ui/text/text';\nimport ScoreBadge from '../score-badge/score-badge';\nimport type { IReportHeaderProps } from './report-header-types';\nimport { IS_APP_RUNNING_IN_RN } from '../../../../../constants/app-config';\nimport Separator from '../../../../ui/separator/separator';\nimport { formatTestDate } from '../../math-fit-report-helpers';\nimport Back2Icon from '../../../../../assets/line-icons/icons/back2';\nimport IconButton from '../../../../ui/buttons/icon-button/icon-button';\nimport * as Styled from './report-header-styled';\n\nconst ReportHeader: FC<IReportHeaderProps> = memo(function ReportHeader({\n createdOnTs,\n maxScore,\n score,\n scoreChange,\n studentName,\n userType,\n onBack,\n compactView = false,\n showGreeting = true,\n}) {\n const headerHeight = useMemo(() => {\n if (IS_APP_RUNNING_IN_RN) {\n return compactView ? 5 : 9.6;\n }\n\n return 11.75;\n }, [compactView]);\n\n const justifyContent = compactView ? 'center' : 'flex-end';\n const dateTextVariant = IS_APP_RUNNING_IN_RN || compactView ? 'ac5' : 'ac4';\n const renderScoreBadgeAsMobile = !!(IS_APP_RUNNING_IN_RN || compactView);\n\n return (\n <Styled.HeaderContainer\n $background=\"BLUE_4\"\n $heightX={headerHeight}\n $gapX={1.5}\n $gutterX={1.5}\n $justifyContent={justifyContent}\n $position=\"relative\"\n >\n {userType === 'TEACHER' && (\n <Styled.BackButtonContainer $height=\"100%\">\n <Styled.BackButtonWrapper>\n <IconButton\n Icon={Back2Icon}\n renderAs=\"secondary-gray\"\n analyticsLabel=\"chapter_page_exit\"\n size=\"xsmall\"\n onClick={onBack}\n />\n </Styled.BackButtonWrapper>\n </Styled.BackButtonContainer>\n )}\n {showGreeting && (\n <Text $renderAs=\"ab1-bold\" $color=\"BLACK_1\">\n Well done, {studentName || ''}!\n </Text>\n )}\n <Separator heightX={0.5} />\n <ScoreBadge\n score={score}\n maxScore={maxScore}\n scoreChange={scoreChange}\n renderInHeader\n renderInMobile={renderScoreBadgeAsMobile}\n />\n <Text $renderAs={dateTextVariant} $color=\"BLACK_T_60\">\n TEST Score • {formatTestDate(createdOnTs)}\n </Text>\n </Styled.HeaderContainer>\n );\n});\n\nexport default ReportHeader;\n"],"names":["ReportHeader","memo","createdOnTs","maxScore","score","scoreChange","studentName","userType","onBack","compactView","showGreeting","headerHeight","useMemo","IS_APP_RUNNING_IN_RN","jsxs","Styled.HeaderContainer","jsx","Styled.BackButtonContainer","Styled.BackButtonWrapper","IconButton","Back2Icon","Text","Separator","ScoreBadge","formatTestDate"],"mappings":";;;;;;;;;;AAWM,MAAAA,IAAuCC,EAAK,SAAsB;AAAA,EACtE,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,cAAAC,IAAe;AACjB,GAAG;AACK,QAAAC,IAAeC,EAAQ,MACvBC,IACKJ,IAAc,IAAI,MAGpB,OACN,CAACA,CAAW,CAAC;AAOd,SAAA,gBAAAK;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,aAAY;AAAA,MACZ,UAAUJ;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,iBAVmBF,IAAc,WAAW;AAAA,MAW5C,WAAU;AAAA,MAET,UAAA;AAAA,QAAaF,MAAA,aACX,gBAAAS,EAAAC,GAAA,EAA2B,SAAQ,QAClC,UAAA,gBAAAD,EAACE,GAAA,EACC,UAAA,gBAAAF;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,MAAMC;AAAA,YACN,UAAS;AAAA,YACT,gBAAe;AAAA,YACf,MAAK;AAAA,YACL,SAASZ;AAAA,UAAA;AAAA,WAEb,EACF,CAAA;AAAA,QAEDE,KACE,gBAAAI,EAAAO,GAAA,EAAK,WAAU,YAAW,QAAO,WAAU,UAAA;AAAA,UAAA;AAAA,UAC9Bf,KAAe;AAAA,UAAG;AAAA,QAAA,GAChC;AAAA,QAEF,gBAAAU,EAACM,GAAU,EAAA,SAAS,IAAK,CAAA;AAAA,QACzB,gBAAAN;AAAA,UAACO;AAAA,UAAA;AAAA,YACC,OAAAnB;AAAA,YACA,UAAAD;AAAA,YACA,aAAAE;AAAA,YACA,gBAAc;AAAA,YACd,gBAnC2B,CAAC,EAAEQ,KAAwBJ;AAAA,UAmCtC;AAAA,QAClB;AAAA,QACC,gBAAAK,EAAAO,GAAA,EAAK,WAtCcR,KAAwBJ,IAAc,QAAQ,OAsChC,QAAO,cAAa,UAAA;AAAA,UAAA;AAAA,UACtCe,EAAetB,CAAW;AAAA,QAAA,GAC1C;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
@@ -0,0 +1,9 @@
1
+ const e = (r, t) => r ? t ? "ah3-bold" : "ah2-bold" : "ac2", o = (r, t) => r ? t ? "ab1-bold" : "ah4-bold" : "ac4", n = (r, t) => r && !t ? 5 : 2, a = (r, t) => r ? t ? 3 : -7 : 9, c = (r, t) => r ? t ? 7 : 10 : 2;
2
+ export {
3
+ a as getArrowMarginBottom,
4
+ n as getMaxScoreMarginBottom,
5
+ o as getMaxScoreTextSize,
6
+ c as getScoreChangeMarginBottom,
7
+ e as getScoreTextSize
8
+ };
9
+ //# sourceMappingURL=score-badge-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"score-badge-helpers.js","sources":["../../../../../../src/features/math-fit/math-fit-report/comps/score-badge/score-badge-helpers.ts"],"sourcesContent":["import type { TTextVariants } from '../../../../ui/types';\n\nexport const getScoreTextSize = (\n renderInHeader: boolean,\n renderInMobile: boolean,\n): TTextVariants => {\n if (renderInHeader) {\n return renderInMobile ? 'ah3-bold' : 'ah2-bold';\n }\n\n return 'ac2';\n};\n\nexport const getMaxScoreTextSize = (\n renderInHeader: boolean,\n renderInMobile: boolean,\n): TTextVariants => {\n if (renderInHeader) {\n return renderInMobile ? 'ab1-bold' : 'ah4-bold';\n }\n\n return 'ac4';\n};\n\nexport const getMaxScoreMarginBottom = (\n renderInHeader: boolean,\n renderInMobile: boolean,\n): number => {\n if (renderInHeader && !renderInMobile) {\n return 5;\n }\n\n return 2;\n};\n\nexport const getArrowMarginBottom = (renderInHeader: boolean, renderInMobile: boolean): number => {\n if (!renderInHeader) {\n return 9;\n }\n\n return renderInMobile ? 3 : -7;\n};\n\nexport const getScoreChangeMarginBottom = (\n renderInHeader: boolean,\n renderInMobile: boolean,\n): number => {\n if (!renderInHeader) {\n return 2;\n }\n\n return renderInMobile ? 7 : 10;\n};\n"],"names":["getScoreTextSize","renderInHeader","renderInMobile","getMaxScoreTextSize","getMaxScoreMarginBottom","getArrowMarginBottom","getScoreChangeMarginBottom"],"mappings":"AAEa,MAAAA,IAAmB,CAC9BC,GACAC,MAEID,IACKC,IAAiB,aAAa,aAGhC,OAGIC,IAAsB,CACjCF,GACAC,MAEID,IACKC,IAAiB,aAAa,aAGhC,OAGIE,IAA0B,CACrCH,GACAC,MAEID,KAAkB,CAACC,IACd,IAGF,GAGIG,IAAuB,CAACJ,GAAyBC,MACvDD,IAIEC,IAAiB,IAAI,KAHnB,GAMEI,IAA6B,CACxCL,GACAC,MAEKD,IAIEC,IAAiB,IAAI,KAHnB;"}
@@ -1,30 +1,32 @@
1
- import { jsxs as m, jsx as o, Fragment as $ } from "react/jsx-runtime";
2
- import { memo as d } from "react";
3
- import c from "../../../../ui/text/text.js";
4
- import { ArrowIcon as f } from "./score-badge-styled.js";
5
- import r from "../../../../ui/layout/flex-view.js";
6
- import s from "../../../../ui/separator/separator.js";
7
- const F = d(function({
8
- score: l,
9
- maxScore: n = 10,
10
- scoreChange: t,
11
- renderInHeader: i = !1
1
+ import { jsxs as e, jsx as o, Fragment as B } from "react/jsx-runtime";
2
+ import { memo as h } from "react";
3
+ import m from "../../../../ui/layout/flex-view.js";
4
+ import p from "../../../../ui/separator/separator.js";
5
+ import a from "../../../../ui/text/text.js";
6
+ import { getScoreTextSize as d, getMaxScoreMarginBottom as A, getMaxScoreTextSize as w, getArrowMarginBottom as M, getScoreChangeMarginBottom as T } from "./score-badge-helpers.js";
7
+ import { ArrowIcon as z } from "./score-badge-styled.js";
8
+ const K = h(function({
9
+ score: c,
10
+ maxScore: g = 10,
11
+ scoreChange: r,
12
+ renderInHeader: t = !1,
13
+ renderInMobile: i = !1
12
14
  }) {
13
- const a = t !== void 0 && t !== 0, e = t ? t > 0 : !1;
14
- return /* @__PURE__ */ m(r, { $flexDirection: "row", $alignItems: "flex-end", children: [
15
- /* @__PURE__ */ o(c, { $renderAs: i ? "ah2-bold" : "ac2", $color: "BLACK_1", children: l ? l.toFixed(1) : "-" }),
16
- !!l && /* @__PURE__ */ o(r, { $marginBottom: i ? 5 : 2, children: /* @__PURE__ */ m(c, { $renderAs: i ? "ah4-bold" : "ac4", $color: "BLACK_1", children: [
15
+ const n = r !== void 0 && r !== 0, s = n && r > 0, x = d(t, i), l = A(t, i), f = w(t, i), S = M(t, i), $ = T(t, i);
16
+ return /* @__PURE__ */ e(m, { $flexDirection: "row", $alignItems: "flex-end", children: [
17
+ /* @__PURE__ */ o(a, { $renderAs: x, $color: "BLACK_1", children: c ? c.toFixed(1) : "-" }),
18
+ !!c && /* @__PURE__ */ o(m, { $marginBottom: l, children: /* @__PURE__ */ e(a, { $renderAs: f, $color: "BLACK_1", children: [
17
19
  "/",
18
- n
20
+ g
19
21
  ] }) }),
20
- /* @__PURE__ */ o(s, { width: 8 }),
21
- a && /* @__PURE__ */ m($, { children: [
22
- /* @__PURE__ */ o(r, { $marginBottom: i ? -7 : 9, $alignSelf: "center", children: /* @__PURE__ */ o(f, { $isPositive: e, $renderInHeader: i }) }),
23
- /* @__PURE__ */ o(r, { $marginBottom: i ? 10 : 2, children: /* @__PURE__ */ o(c, { $renderAs: "ac4", $color: e ? "GREEN_6" : "RED", children: Math.abs(t).toFixed(1) }) })
22
+ /* @__PURE__ */ o(p, { width: 8 }),
23
+ n && /* @__PURE__ */ e(B, { children: [
24
+ /* @__PURE__ */ o(m, { $marginBottom: S, $alignSelf: "center", children: /* @__PURE__ */ o(z, { $isPositive: s, $renderInHeader: t }) }),
25
+ /* @__PURE__ */ o(m, { $marginBottom: $, children: /* @__PURE__ */ o(a, { $renderAs: "ac4", $color: s ? "GREEN_6" : "RED", children: Math.abs(r).toFixed(1) }) })
24
26
  ] })
25
27
  ] });
26
28
  });
27
29
  export {
28
- F as default
30
+ K as default
29
31
  };
30
32
  //# sourceMappingURL=score-badge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"score-badge.js","sources":["../../../../../../src/features/math-fit/math-fit-report/comps/score-badge/score-badge.tsx"],"sourcesContent":["import { memo, type FC } from 'react';\n\nimport Text from '../../../../ui/text/text';\nimport type { IScoreBadgeProps } from './score-badge-types';\nimport * as Styled from './score-badge-styled';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Separator from '../../../../ui/separator/separator';\n\nconst ScoreBadge: FC<IScoreBadgeProps> = memo(function ScoreBadge({\n score,\n maxScore = 10,\n scoreChange,\n renderInHeader = false,\n}) {\n const hasChange = scoreChange !== undefined && scoreChange !== 0;\n const isPositive = scoreChange ? scoreChange > 0 : false;\n\n return (\n <FlexView $flexDirection=\"row\" $alignItems=\"flex-end\">\n <Text $renderAs={renderInHeader ? 'ah2-bold' : 'ac2'} $color=\"BLACK_1\">\n {score ? score.toFixed(1) : '-'}\n </Text>\n {!!score && (\n <FlexView $marginBottom={renderInHeader ? 5 : 2}>\n <Text $renderAs={renderInHeader ? 'ah4-bold' : 'ac4'} $color=\"BLACK_1\">\n /{maxScore}\n </Text>\n </FlexView>\n )}\n <Separator width={8} />\n {hasChange && (\n <>\n <FlexView $marginBottom={renderInHeader ? -7 : 9} $alignSelf=\"center\">\n <Styled.ArrowIcon $isPositive={isPositive} $renderInHeader={renderInHeader} />\n </FlexView>\n <FlexView $marginBottom={renderInHeader ? 10 : 2}>\n <Text $renderAs=\"ac4\" $color={isPositive ? 'GREEN_6' : 'RED'}>\n {Math.abs(scoreChange).toFixed(1)}\n </Text>\n </FlexView>\n </>\n )}\n </FlexView>\n );\n});\n\nexport default ScoreBadge;\n"],"names":["ScoreBadge","memo","score","maxScore","scoreChange","renderInHeader","hasChange","isPositive","jsxs","FlexView","jsx","Text","Separator","Fragment","Styled.ArrowIcon"],"mappings":";;;;;;AAQM,MAAAA,IAAmCC,EAAK,SAAoB;AAAA,EAChE,OAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,aAAAC;AAAA,EACA,gBAAAC,IAAiB;AACnB,GAAG;AACK,QAAAC,IAAYF,MAAgB,UAAaA,MAAgB,GACzDG,IAAaH,IAAcA,IAAc,IAAI;AAEnD,SACG,gBAAAI,EAAAC,GAAA,EAAS,gBAAe,OAAM,aAAY,YACzC,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAK,EAAA,WAAWN,IAAiB,aAAa,OAAO,QAAO,WAC1D,UAAAH,IAAQA,EAAM,QAAQ,CAAC,IAAI,KAC9B;AAAA,IACC,CAAC,CAACA,KACA,gBAAAQ,EAAAD,GAAA,EAAS,eAAeJ,IAAiB,IAAI,GAC5C,UAAA,gBAAAG,EAACG,KAAK,WAAWN,IAAiB,aAAa,OAAO,QAAO,WAAU,UAAA;AAAA,MAAA;AAAA,MACnEF;AAAA,IAAA,EAAA,CACJ,EACF,CAAA;AAAA,IAEF,gBAAAO,EAACE,GAAU,EAAA,OAAO,EAAG,CAAA;AAAA,IACpBN,KAEG,gBAAAE,EAAAK,GAAA,EAAA,UAAA;AAAA,MAAA,gBAAAH,EAACD,GAAS,EAAA,eAAeJ,IAAiB,KAAK,GAAG,YAAW,UAC3D,UAAC,gBAAAK,EAAAI,GAAA,EAAiB,aAAaP,GAAY,iBAAiBF,EAAgB,CAAA,GAC9E;AAAA,MACA,gBAAAK,EAACD,KAAS,eAAeJ,IAAiB,KAAK,GAC7C,UAAA,gBAAAK,EAACC,KAAK,WAAU,OAAM,QAAQJ,IAAa,YAAY,OACpD,UAAK,KAAA,IAAIH,CAAW,EAAE,QAAQ,CAAC,EAAA,CAClC,EACF,CAAA;AAAA,IAAA,GACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,CAAC;"}
1
+ {"version":3,"file":"score-badge.js","sources":["../../../../../../src/features/math-fit/math-fit-report/comps/score-badge/score-badge.tsx"],"sourcesContent":["import { memo, type FC } from 'react';\n\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Separator from '../../../../ui/separator/separator';\nimport type { IScoreBadgeProps } from './score-badge-types';\nimport Text from '../../../../ui/text/text';\nimport {\n getArrowMarginBottom,\n getMaxScoreMarginBottom,\n getMaxScoreTextSize,\n getScoreChangeMarginBottom,\n getScoreTextSize,\n} from './score-badge-helpers';\nimport * as Styled from './score-badge-styled';\n\nconst ScoreBadge: FC<IScoreBadgeProps> = memo(function ScoreBadge({\n score,\n maxScore = 10,\n scoreChange,\n renderInHeader = false,\n renderInMobile = false,\n}) {\n const hasChange = scoreChange !== undefined && scoreChange !== 0;\n const isPositive = hasChange && scoreChange > 0;\n const scoreTextSize = getScoreTextSize(renderInHeader, renderInMobile);\n const maxScoreMarginBottom = getMaxScoreMarginBottom(renderInHeader, renderInMobile);\n const maxScoreTextSize = getMaxScoreTextSize(renderInHeader, renderInMobile);\n const arrowMarginBottom = getArrowMarginBottom(renderInHeader, renderInMobile);\n const scoreChangeMarginBottom = getScoreChangeMarginBottom(renderInHeader, renderInMobile);\n\n return (\n <FlexView $flexDirection=\"row\" $alignItems=\"flex-end\">\n <Text $renderAs={scoreTextSize} $color=\"BLACK_1\">\n {score ? score.toFixed(1) : '-'}\n </Text>\n {!!score && (\n <FlexView $marginBottom={maxScoreMarginBottom}>\n <Text $renderAs={maxScoreTextSize} $color=\"BLACK_1\">\n /{maxScore}\n </Text>\n </FlexView>\n )}\n <Separator width={8} />\n {hasChange && (\n <>\n <FlexView $marginBottom={arrowMarginBottom} $alignSelf=\"center\">\n <Styled.ArrowIcon $isPositive={isPositive} $renderInHeader={renderInHeader} />\n </FlexView>\n <FlexView $marginBottom={scoreChangeMarginBottom}>\n <Text $renderAs=\"ac4\" $color={isPositive ? 'GREEN_6' : 'RED'}>\n {Math.abs(scoreChange).toFixed(1)}\n </Text>\n </FlexView>\n </>\n )}\n </FlexView>\n );\n});\n\nexport default ScoreBadge;\n"],"names":["ScoreBadge","memo","score","maxScore","scoreChange","renderInHeader","renderInMobile","hasChange","isPositive","scoreTextSize","getScoreTextSize","maxScoreMarginBottom","getMaxScoreMarginBottom","maxScoreTextSize","getMaxScoreTextSize","arrowMarginBottom","getArrowMarginBottom","scoreChangeMarginBottom","getScoreChangeMarginBottom","jsxs","FlexView","jsx","Text","Separator","Fragment","Styled.ArrowIcon"],"mappings":";;;;;;;AAeM,MAAAA,IAAmCC,EAAK,SAAoB;AAAA,EAChE,OAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,aAAAC;AAAA,EACA,gBAAAC,IAAiB;AAAA,EACjB,gBAAAC,IAAiB;AACnB,GAAG;AACK,QAAAC,IAAYH,MAAgB,UAAaA,MAAgB,GACzDI,IAAaD,KAAaH,IAAc,GACxCK,IAAgBC,EAAiBL,GAAgBC,CAAc,GAC/DK,IAAuBC,EAAwBP,GAAgBC,CAAc,GAC7EO,IAAmBC,EAAoBT,GAAgBC,CAAc,GACrES,IAAoBC,EAAqBX,GAAgBC,CAAc,GACvEW,IAA0BC,EAA2Bb,GAAgBC,CAAc;AAEzF,SACG,gBAAAa,EAAAC,GAAA,EAAS,gBAAe,OAAM,aAAY,YACzC,UAAA;AAAA,IAAC,gBAAAC,EAAAC,GAAA,EAAK,WAAWb,GAAe,QAAO,WACpC,cAAQP,EAAM,QAAQ,CAAC,IAAI,IAC9B,CAAA;AAAA,IACC,CAAC,CAACA,KACD,gBAAAmB,EAACD,GAAS,EAAA,eAAeT,GACvB,UAAA,gBAAAQ,EAACG,GAAK,EAAA,WAAWT,GAAkB,QAAO,WAAU,UAAA;AAAA,MAAA;AAAA,MAChDV;AAAA,IAAA,EAAA,CACJ,EACF,CAAA;AAAA,IAEF,gBAAAkB,EAACE,GAAU,EAAA,OAAO,EAAG,CAAA;AAAA,IACpBhB,KAEG,gBAAAY,EAAAK,GAAA,EAAA,UAAA;AAAA,MAAA,gBAAAH,EAACD,GAAS,EAAA,eAAeL,GAAmB,YAAW,UACrD,UAAA,gBAAAM,EAACI,GAAA,EAAiB,aAAajB,GAAY,iBAAiBH,EAAgB,CAAA,GAC9E;AAAA,wBACCe,GAAS,EAAA,eAAeH,GACvB,UAAC,gBAAAI,EAAAC,GAAA,EAAK,WAAU,OAAM,QAAQd,IAAa,YAAY,OACpD,eAAK,IAAIJ,CAAW,EAAE,QAAQ,CAAC,EAClC,CAAA,GACF;AAAA,IAAA,GACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,CAAC;"}
@@ -1,67 +1,70 @@
1
- import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
- import { memo as _, useCallback as E, Fragment as S } from "react";
1
+ import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
+ import { memo as X, useCallback as _, Fragment as L } from "react";
3
3
  import { useTheme as w } from "styled-components";
4
- import B from "../../../../ui/buttons/button/button.js";
4
+ import y from "../../../../ui/buttons/button/button.js";
5
5
  import r from "../../../../ui/layout/flex-view.js";
6
- import m from "../../../../ui/text/text.js";
7
- import N from "../score-badge/score-badge.js";
8
- import { Divider as X } from "./score-section-styled.js";
9
- import u from "../../../../ui/separator/separator.js";
10
- import { getQuestionStatusBgColor as D } from "../../math-fit-report-helpers.js";
11
- import { EQuestionState as b } from "../../../math-fit-overview/math-fit-overview-types.js";
12
- import { IS_APP_RUNNING_IN_RN as G } from "../../../../../constants/app-config.js";
13
- import { EDeviceType as L } from "../../../../ui/theme/constants.js";
14
- const M = _(function({
15
- isMonthlyReportPage: c,
16
- onReviewSection: l,
17
- section: a,
18
- sheet: $
6
+ import l from "../../../../ui/text/text.js";
7
+ import G from "../score-badge/score-badge.js";
8
+ import { Divider as K } from "./score-section-styled.js";
9
+ import g from "../../../../ui/separator/separator.js";
10
+ import { getQuestionStatusBgColor as k } from "../../math-fit-report-helpers.js";
11
+ import { EQuestionState as u } from "../../../math-fit-overview/math-fit-overview-types.js";
12
+ import { EDeviceType as j } from "../../../../ui/theme/constants.js";
13
+ const Y = X(function({
14
+ onReviewSection: c,
15
+ section: s,
16
+ sheet: $,
17
+ compactView: a = !1,
18
+ showReviewButton: b = !0
19
19
  }) {
20
20
  const {
21
- title: g,
21
+ title: x,
22
22
  score: f,
23
- scoreChange: I,
23
+ scoreChange: C,
24
24
  sessionId: p,
25
- isIncomplete: o = !1,
26
- sectionNumber: x,
27
- topics: C
28
- } = a, { device: A } = w(), s = A <= L.MOBILE, h = [...C ?? []].sort((i, d) => i.miniGoal.order - d.miniGoal.order), T = E(() => {
29
- !o && a.sheet && l && l($, p);
30
- }, [o, l, a.sheet, $, p]);
31
- return /* @__PURE__ */ t(r, { children: [
32
- /* @__PURE__ */ t(r, { $flexDirection: "row", $alignItems: "center", children: [
33
- /* @__PURE__ */ t(m, { $renderAs: "ab2-bold", $color: "BLACK_1", children: [
34
- g,
25
+ isIncomplete: t = !1,
26
+ sectionNumber: T,
27
+ topics: A
28
+ } = s, { device: I } = w(), m = I <= j.MOBILE, h = [...A ?? []].sort((i, d) => i.miniGoal.order - d.miniGoal.order), E = m || a ? "column" : "row", B = m || a ? "" : "center", S = m || a ? 0.5 : 0, D = _(() => {
29
+ !t && s.sheet && c && c($, p);
30
+ }, [t, c, s.sheet, $, p]);
31
+ return /* @__PURE__ */ o(r, { children: [
32
+ /* @__PURE__ */ o(r, { $flexDirection: "row", $alignItems: "center", children: [
33
+ /* @__PURE__ */ o(l, { $renderAs: "ab2-bold", $color: "BLACK_1", children: [
34
+ x,
35
35
  ":"
36
36
  ] }),
37
- /* @__PURE__ */ e(u, { width: 4 }),
38
- o ? /* @__PURE__ */ e(r, { $gutter: 3, $gap: 2.5, $background: "BLACK_5", children: /* @__PURE__ */ e(m, { $renderAs: "ab4-bold", $color: "WHITE", children: "INCOMPLETE" }) }) : f && /* @__PURE__ */ e(N, { score: f, maxScore: 10, scoreChange: I })
37
+ /* @__PURE__ */ e(g, { width: 4 }),
38
+ t ? /* @__PURE__ */ e(r, { $gutter: 3, $gap: 2.5, $background: "BLACK_5", children: /* @__PURE__ */ e(l, { $renderAs: "ab4-bold", $color: "WHITE", children: "INCOMPLETE" }) }) : f && /* @__PURE__ */ e(G, { score: f, maxScore: 10, scoreChange: C })
39
39
  ] }),
40
- /* @__PURE__ */ e(r, { $flexRowGapX: 0.5, $gapX: 0.75, children: h.map((i, d) => /* @__PURE__ */ t(S, { children: [
41
- /* @__PURE__ */ t(
40
+ /* @__PURE__ */ e(r, { $flexRowGapX: 0.5, $gapX: 0.75, children: h.map((i, d) => /* @__PURE__ */ o(L, { children: [
41
+ /* @__PURE__ */ o(
42
42
  r,
43
43
  {
44
- $flexDirection: s || c ? "column" : "row",
44
+ $flexDirection: E,
45
45
  $justifyContent: "space-between",
46
- $alignItems: s || c ? "" : "center",
47
- $flexRowGapX: s || c ? 0.5 : 0,
46
+ $alignItems: B,
47
+ $flexRowGapX: S,
48
48
  children: [
49
- /* @__PURE__ */ e(m, { $renderAs: "ub2", $color: o ? "BLACK_T_38" : "BLACK_1", children: i.name }),
49
+ /* @__PURE__ */ e(l, { $renderAs: "ub2", $color: t ? "BLACK_T_38" : "BLACK_1", children: i.name }),
50
50
  /* @__PURE__ */ e(r, { $flexGapX: 0.5, $flexDirection: "row", $flexWrap: !0, children: i.miniGoal.items.map((n) => /* @__PURE__ */ e(
51
51
  r,
52
52
  {
53
- $widthX: 1.25,
54
53
  $heightX: 1.25,
54
+ $gutterX: 0.5,
55
55
  $alignItems: "center",
56
56
  $justifyContent: "center",
57
- $borderRadiusX: 2,
58
- $background: D(n.state),
59
- children: /* @__PURE__ */ e(
60
- m,
57
+ $borderRadiusX: 1,
58
+ $background: k(n.state),
59
+ children: /* @__PURE__ */ o(
60
+ l,
61
61
  {
62
62
  $renderAs: "ub3",
63
- $color: n.state === b.SKIPPED || n.state === b.UNATTEMPTED ? "BLACK_T_38" : "WHITE",
64
- children: n.order
63
+ $color: n.state === u.SKIPPED || n.state === u.UNATTEMPTED ? "BLACK_T_38" : "WHITE",
64
+ children: [
65
+ "Q",
66
+ n.order
67
+ ]
65
68
  }
66
69
  )
67
70
  },
@@ -70,24 +73,24 @@ const M = _(function({
70
73
  ]
71
74
  }
72
75
  ),
73
- d !== h.length - 1 && /* @__PURE__ */ e(X, {})
76
+ d !== h.length - 1 && /* @__PURE__ */ e(K, {})
74
77
  ] }, i.name)) }),
75
- !G && !c && /* @__PURE__ */ t(r, { $alignItems: "center", children: [
76
- /* @__PURE__ */ e(u, { heightX: 0.75 }),
78
+ b && /* @__PURE__ */ o(r, { $alignItems: "center", children: [
79
+ /* @__PURE__ */ e(g, { heightX: 0.75 }),
77
80
  /* @__PURE__ */ e(
78
- B,
81
+ y,
79
82
  {
80
- label: `Review Section ${x}`,
81
- renderAs: o ? "secondary" : "primary",
83
+ label: `Review Section ${T}`,
84
+ renderAs: t ? "secondary" : "primary",
82
85
  size: "small",
83
- onClick: T,
84
- disabled: o
86
+ onClick: D,
87
+ disabled: t
85
88
  }
86
89
  )
87
90
  ] })
88
91
  ] });
89
92
  });
90
93
  export {
91
- M as default
94
+ Y as default
92
95
  };
93
96
  //# sourceMappingURL=score-section.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"score-section.js","sources":["../../../../../../src/features/math-fit/math-fit-report/comps/score-section/score-section.tsx"],"sourcesContent":["import { Fragment, memo, useCallback, type FC } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport Button from '../../../../ui/buttons/button/button';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport ScoreBadge from '../score-badge/score-badge';\nimport type { IScoreSectionProps } from './score-section-types';\nimport * as Styled from './score-section-styled';\nimport Separator from '../../../../ui/separator/separator';\nimport { getQuestionStatusBgColor } from '../../math-fit-report-helpers';\nimport { EQuestionState } from '../../../math-fit-overview/math-fit-overview-types';\nimport { IS_APP_RUNNING_IN_RN } from '../../../../../constants/app-config';\nimport { EDeviceType } from '../../../../ui/theme/constants';\n\nconst ScoreSection: FC<IScoreSectionProps> = memo(function ScoreSection({\n isMonthlyReportPage,\n onReviewSection,\n section,\n sheet,\n}) {\n const {\n title,\n score,\n scoreChange,\n sessionId,\n isIncomplete = false,\n sectionNumber,\n topics,\n } = section;\n\n const { device } = useTheme();\n const isMobile = device <= EDeviceType.MOBILE;\n\n const sortedTopics = [...(topics ?? [])].sort((a, b) => a.miniGoal.order - b.miniGoal.order);\n\n const onClickReview = useCallback(() => {\n if (!isIncomplete && section.sheet && onReviewSection) {\n onReviewSection(sheet, sessionId);\n }\n }, [isIncomplete, onReviewSection, section.sheet, sheet, sessionId]);\n\n return (\n <FlexView>\n <FlexView $flexDirection=\"row\" $alignItems=\"center\">\n <Text $renderAs=\"ab2-bold\" $color=\"BLACK_1\">\n {title}:\n </Text>\n <Separator width={4} />\n {isIncomplete ? (\n <FlexView $gutter={3} $gap={2.5} $background=\"BLACK_5\">\n <Text $renderAs=\"ab4-bold\" $color=\"WHITE\">\n INCOMPLETE\n </Text>\n </FlexView>\n ) : (\n score && <ScoreBadge score={score} maxScore={10} scoreChange={scoreChange} />\n )}\n </FlexView>\n <FlexView $flexRowGapX={0.5} $gapX={0.75}>\n {sortedTopics.map((topic, index) => (\n <Fragment key={topic.name}>\n <FlexView\n $flexDirection={isMobile || isMonthlyReportPage ? 'column' : 'row'}\n $justifyContent=\"space-between\"\n $alignItems={isMobile || isMonthlyReportPage ? '' : 'center'}\n $flexRowGapX={isMobile || isMonthlyReportPage ? 0.5 : 0}\n >\n <Text $renderAs=\"ub2\" $color={isIncomplete ? 'BLACK_T_38' : 'BLACK_1'}>\n {topic.name}\n </Text>\n <FlexView $flexGapX={0.5} $flexDirection=\"row\" $flexWrap>\n {topic.miniGoal.items.map(question => (\n <FlexView\n key={question.item_reference}\n $widthX={1.25}\n $heightX={1.25}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $borderRadiusX={2}\n $background={getQuestionStatusBgColor(question.state)}\n >\n <Text\n $renderAs=\"ub3\"\n $color={\n question.state === EQuestionState.SKIPPED ||\n question.state === EQuestionState.UNATTEMPTED\n ? 'BLACK_T_38'\n : 'WHITE'\n }\n >\n {question.order}\n </Text>\n </FlexView>\n ))}\n </FlexView>\n </FlexView>\n {index !== sortedTopics.length - 1 && <Styled.Divider />}\n </Fragment>\n ))}\n </FlexView>\n {!IS_APP_RUNNING_IN_RN && !isMonthlyReportPage && (\n <FlexView $alignItems=\"center\">\n <Separator heightX={0.75} />\n <Button\n label={`Review Section ${sectionNumber}`}\n renderAs={isIncomplete ? 'secondary' : 'primary'}\n size=\"small\"\n onClick={onClickReview}\n disabled={isIncomplete}\n />\n </FlexView>\n )}\n </FlexView>\n );\n});\n\nexport default ScoreSection;\n"],"names":["ScoreSection","memo","isMonthlyReportPage","onReviewSection","section","sheet","title","score","scoreChange","sessionId","isIncomplete","sectionNumber","topics","device","useTheme","isMobile","EDeviceType","sortedTopics","a","b","onClickReview","useCallback","FlexView","jsxs","Text","jsx","Separator","ScoreBadge","topic","index","Fragment","question","getQuestionStatusBgColor","EQuestionState","Styled.Divider","IS_APP_RUNNING_IN_RN","Button"],"mappings":";;;;;;;;;;;;;AAeM,MAAAA,IAAuCC,EAAK,SAAsB;AAAA,EACtE,qBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC;AACF,GAAG;AACK,QAAA;AAAA,IACJ,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,eAAAC;AAAA,IACA,QAAAC;AAAA,EACE,IAAAR,GAEE,EAAE,QAAAS,MAAWC,KACbC,IAAWF,KAAUG,EAAY,QAEjCC,IAAe,CAAC,GAAIL,KAAU,CAAA,CAAG,EAAE,KAAK,CAACM,GAAGC,MAAMD,EAAE,SAAS,QAAQC,EAAE,SAAS,KAAK,GAErFC,IAAgBC,EAAY,MAAM;AACtC,IA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AAAA,cAACH;AAAA,cAAA;AAAA,gBAEC,SAAS;AAAA,gBACT,UAAU;AAAA,gBACV,aAAY;AAAA,gBACZ,iBAAgB;AAAA,gBAChB,gBAAgB;AAAA,gBAChB,aAAaU,EAAyBD,EAAS,KAAK;AAAA,gBAEpD,UAAA,gBAAAN;AAAA,kBAACD;AAAA,kBAAA;AAAA,oBACC,WAAU;AAAA,oBACV,QACEO,EAAS,UAAUE,EAAe,WAClCF,EAAS,UAAUE,EAAe,cAC9B,eACA;AAAA,oBAGL,UAASF,EAAA;AAAA,kBAAA;AAAA,gBACZ;AAAA,cAAA;AAAA,cAlBKA,EAAS;AAAA,YAoBjB,CAAA,GACH;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,MACCF,MAAUZ,EAAa,SAAS,KAAM,gBAAAQ,EAAAS,GAAA,EAAe;AAAA,IApCzC,EAAA,GAAAN,EAAM,IAqCrB,CACD,GACH;AAAA,IACC,CAACO,KAAwB,CAACjC,KACxB,gBAAAqB,EAAAD,GAAA,EAAS,aAAY,UACpB,UAAA;AAAA,MAAC,gBAAAG,EAAAC,GAAA,EAAU,SAAS,KAAM,CAAA;AAAA,MAC1B,gBAAAD;AAAA,QAACW;AAAA,QAAA;AAAA,UACC,OAAO,kBAAkBzB,CAAa;AAAA,UACtC,UAAUD,IAAe,cAAc;AAAA,UACvC,MAAK;AAAA,UACL,SAASU;AAAA,UACT,UAAUV;AAAA,QAAA;AAAA,MACZ;AAAA,IAAA,GACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,CAAC;"}
1
+ {"version":3,"file":"score-section.js","sources":["../../../../../../src/features/math-fit/math-fit-report/comps/score-section/score-section.tsx"],"sourcesContent":["import { Fragment, memo, useCallback, type FC } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport Button from '../../../../ui/buttons/button/button';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport ScoreBadge from '../score-badge/score-badge';\nimport type { IScoreSectionProps } from './score-section-types';\nimport * as Styled from './score-section-styled';\nimport Separator from '../../../../ui/separator/separator';\nimport { getQuestionStatusBgColor } from '../../math-fit-report-helpers';\nimport { EQuestionState } from '../../../math-fit-overview/math-fit-overview-types';\nimport { EDeviceType } from '../../../../ui/theme/constants';\n\nconst ScoreSection: FC<IScoreSectionProps> = memo(function ScoreSection({\n onReviewSection,\n section,\n sheet,\n compactView = false,\n showReviewButton = true,\n}) {\n const {\n title,\n score,\n scoreChange,\n sessionId,\n isIncomplete = false,\n sectionNumber,\n topics,\n } = section;\n\n const { device } = useTheme();\n const isMobile = device <= EDeviceType.MOBILE;\n\n const sortedTopics = [...(topics ?? [])].sort((a, b) => a.miniGoal.order - b.miniGoal.order);\n const layoutDirection = isMobile || compactView ? 'column' : 'row';\n const alignment = isMobile || compactView ? '' : 'center';\n const gap = isMobile || compactView ? 0.5 : 0;\n\n const onClickReview = useCallback(() => {\n if (!isIncomplete && section.sheet && onReviewSection) {\n onReviewSection(sheet, sessionId);\n }\n }, [isIncomplete, onReviewSection, section.sheet, sheet, sessionId]);\n\n return (\n <FlexView>\n <FlexView $flexDirection=\"row\" $alignItems=\"center\">\n <Text $renderAs=\"ab2-bold\" $color=\"BLACK_1\">\n {title}:\n </Text>\n <Separator width={4} />\n {isIncomplete ? (\n <FlexView $gutter={3} $gap={2.5} $background=\"BLACK_5\">\n <Text $renderAs=\"ab4-bold\" $color=\"WHITE\">\n INCOMPLETE\n </Text>\n </FlexView>\n ) : (\n score && <ScoreBadge score={score} maxScore={10} scoreChange={scoreChange} />\n )}\n </FlexView>\n <FlexView $flexRowGapX={0.5} $gapX={0.75}>\n {sortedTopics.map((topic, index) => (\n <Fragment key={topic.name}>\n <FlexView\n $flexDirection={layoutDirection}\n $justifyContent=\"space-between\"\n $alignItems={alignment}\n $flexRowGapX={gap}\n >\n <Text $renderAs=\"ub2\" $color={isIncomplete ? 'BLACK_T_38' : 'BLACK_1'}>\n {topic.name}\n </Text>\n <FlexView $flexGapX={0.5} $flexDirection=\"row\" $flexWrap>\n {topic.miniGoal.items.map(question => (\n <FlexView\n key={question.item_reference}\n $heightX={1.25}\n $gutterX={0.5}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $borderRadiusX={1}\n $background={getQuestionStatusBgColor(question.state)}\n >\n <Text\n $renderAs=\"ub3\"\n $color={\n question.state === EQuestionState.SKIPPED ||\n question.state === EQuestionState.UNATTEMPTED\n ? 'BLACK_T_38'\n : 'WHITE'\n }\n >\n Q{question.order}\n </Text>\n </FlexView>\n ))}\n </FlexView>\n </FlexView>\n {index !== sortedTopics.length - 1 && <Styled.Divider />}\n </Fragment>\n ))}\n </FlexView>\n {showReviewButton && (\n <FlexView $alignItems=\"center\">\n <Separator heightX={0.75} />\n <Button\n label={`Review Section ${sectionNumber}`}\n renderAs={isIncomplete ? 'secondary' : 'primary'}\n size=\"small\"\n onClick={onClickReview}\n disabled={isIncomplete}\n />\n </FlexView>\n )}\n </FlexView>\n );\n});\n\nexport default ScoreSection;\n"],"names":["ScoreSection","memo","onReviewSection","section","sheet","compactView","showReviewButton","title","score","scoreChange","sessionId","isIncomplete","sectionNumber","topics","device","useTheme","isMobile","EDeviceType","sortedTopics","a","b","layoutDirection","alignment","gap","onClickReview","useCallback","FlexView","jsxs","Text","jsx","Separator","ScoreBadge","topic","index","Fragment","question","getQuestionStatusBgColor","EQuestionState","Styled.Divider","Button"],"mappings":";;;;;;;;;;;;AAcM,MAAAA,IAAuCC,EAAK,SAAsB;AAAA,EACtE,iBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,kBAAAC,IAAmB;AACrB,GAAG;AACK,QAAA;AAAA,IACJ,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,eAAAC;AAAA,IACA,QAAAC;AAAA,EACE,IAAAV,GAEE,EAAE,QAAAW,MAAWC,KACbC,IAAW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x as r } from "react/jsx-runtime";
2
- import { memo as g, useMemo as l } from "react";
2
+ import { memo as _, useMemo as c } from "react";
3
+ import { IS_APP_RUNNING_IN_RN as x } from "../../../constants/app-config.js";
3
4
  import o from "../../ui/layout/flex-view.js";
4
- import c from "../../ui/text/text.js";
5
- import d from "./comps/report-header/report-header.js";
6
- import f from "./comps/score-section/score-section.js";
7
- import { transformSectionsToReportData as x, LEGEND_ITEMS as _, getQuestionStatusBgColor as b } from "./math-fit-report-helpers.js";
8
- const C = g(function({
5
+ import s from "../../ui/text/text.js";
6
+ import b from "./comps/report-header/report-header.js";
7
+ import C from "./comps/score-section/score-section.js";
8
+ import { transformSectionsToReportData as R, LEGEND_ITEMS as X, getQuestionStatusBgColor as I } from "./math-fit-report-helpers.js";
9
+ const A = _(function({
9
10
  data: e,
10
11
  onReview: $,
11
- studentName: m,
12
- userType: a,
13
- onBack: p,
14
- isMonthlyReportPage: i
12
+ studentName: h,
13
+ userType: m,
14
+ onBack: u,
15
+ compactView: i = !1,
16
+ showBorder: a = !1,
17
+ showEncouragement: g = !0
15
18
  }) {
16
- const s = l(() => x(e.sections), [e.sections]), u = l(() => {
19
+ const p = a ? "WHITE_5" : void 0, l = c(() => R(e.sections), [e.sections]), f = c(() => {
17
20
  if (e.previous_score && e.score)
18
21
  return e.score - e.previous_score;
19
22
  }, [e.score, e.previous_score]);
20
- return /* @__PURE__ */ n(
21
- o,
22
- {
23
- $flex: 1,
24
- $background: "BLACK_T_04",
25
- $borderColor: i ? "WHITE_5" : void 0,
26
- children: [
27
- /* @__PURE__ */ r(
28
- d,
29
- {
30
- score: e.score ?? 0,
31
- maxScore: 10,
32
- scoreChange: u,
33
- createdOnTs: e.created_on_ts,
34
- studentName: m,
35
- userType: a,
36
- onBack: p
37
- }
38
- ),
39
- s.map((t, h) => /* @__PURE__ */ n(o, { $background: "WHITE", children: [
40
- /* @__PURE__ */ r(o, { $gapX: 1.5, $gutterX: 1.25, children: /* @__PURE__ */ r(
41
- f,
42
- {
43
- isMonthlyReportPage: !!i,
44
- onReviewSection: $,
45
- section: t,
46
- sheet: t.sheet
47
- }
48
- ) }),
49
- h !== s.length - 1 && /* @__PURE__ */ r(o, { $height: 1, $background: "BLACK_T_08" })
50
- ] }, t.title)),
51
- /* @__PURE__ */ n(o, { $gutterX: 1, $flexColumnGapX: 1, $gapX: 1, $flexRowGapX: 2, $alignItems: "center", children: [
52
- /* @__PURE__ */ r(o, { $flexDirection: "row", $flexColumnGapX: 1, $alignItems: "center", children: _.map((t) => /* @__PURE__ */ n(
53
- o,
54
- {
55
- $flexDirection: "row",
56
- $flexColumnGapX: 0.25,
57
- $alignItems: "center",
58
- children: [
59
- /* @__PURE__ */ r(c, { $renderAs: "ub3", $color: "BLACK_T_60", children: t.label }),
60
- /* @__PURE__ */ r(
61
- o,
62
- {
63
- $width: 10,
64
- $height: 10,
65
- $borderRadiusX: 1,
66
- $background: b(t.state)
67
- }
68
- )
69
- ]
70
- },
71
- t.label
72
- )) }),
73
- !i && /* @__PURE__ */ n(o, { $flexRowGapX: 0.25, $marginBottomX: 0.5, $alignItems: "center", children: [
74
- /* @__PURE__ */ r(c, { $renderAs: "ub3-bold", $color: "BLACK_1", $align: "center", children: "Keep Up the Great Work! 🚀" }),
75
- /* @__PURE__ */ r(c, { $renderAs: "ub3", $color: "BLACK_1", $align: "center", children: "You’re getting stronger at MathFit each day. See you next month!" })
76
- ] })
77
- ] })
78
- ]
79
- }
80
- );
81
- }), I = C;
23
+ return /* @__PURE__ */ n(o, { $flex: 1, $background: "BLACK_T_04", $borderColor: p, children: [
24
+ /* @__PURE__ */ r(
25
+ b,
26
+ {
27
+ score: e.score ?? 0,
28
+ maxScore: 10,
29
+ scoreChange: f,
30
+ createdOnTs: e.created_on_ts,
31
+ studentName: h,
32
+ userType: m,
33
+ onBack: u,
34
+ compactView: i,
35
+ showGreeting: !i
36
+ }
37
+ ),
38
+ l.map((t, d) => /* @__PURE__ */ n(o, { $background: "WHITE", children: [
39
+ /* @__PURE__ */ r(o, { $gapX: 1.5, $gutterX: 1.25, children: /* @__PURE__ */ r(
40
+ C,
41
+ {
42
+ onReviewSection: $,
43
+ section: t,
44
+ sheet: t.sheet,
45
+ compactView: i,
46
+ showReviewButton: !i && !x
47
+ }
48
+ ) }),
49
+ d !== l.length - 1 && /* @__PURE__ */ r(o, { $height: 1, $background: "BLACK_T_08" })
50
+ ] }, t.title)),
51
+ /* @__PURE__ */ n(o, { $gutterX: 1, $flexColumnGapX: 1, $gapX: 1, $flexRowGapX: 2, $alignItems: "center", children: [
52
+ /* @__PURE__ */ r(o, { $flexDirection: "row", $flexColumnGapX: 1, $alignItems: "center", children: X.map((t) => /* @__PURE__ */ n(
53
+ o,
54
+ {
55
+ $flexDirection: "row",
56
+ $flexColumnGapX: 0.25,
57
+ $alignItems: "center",
58
+ children: [
59
+ /* @__PURE__ */ r(s, { $renderAs: "ub3", $color: "BLACK_T_60", children: t.label }),
60
+ /* @__PURE__ */ r(
61
+ o,
62
+ {
63
+ $width: 10,
64
+ $height: 10,
65
+ $borderRadiusX: 1,
66
+ $background: I(t.state)
67
+ }
68
+ )
69
+ ]
70
+ },
71
+ t.label
72
+ )) }),
73
+ g && /* @__PURE__ */ n(o, { $flexRowGapX: 0.25, $marginBottomX: 0.5, $alignItems: "center", children: [
74
+ /* @__PURE__ */ r(s, { $renderAs: "ub3-bold", $color: "BLACK_1", $align: "center", children: "Keep Up the Great Work! 🚀" }),
75
+ /* @__PURE__ */ r(s, { $renderAs: "ub3", $color: "BLACK_1", $align: "center", children: "You're getting stronger at MathFit each day. See you next month!" })
76
+ ] })
77
+ ] })
78
+ ] });
79
+ }), N = A;
82
80
  export {
83
- I as default
81
+ N as default
84
82
  };
85
83
  //# sourceMappingURL=math-fit-report.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"math-fit-report.js","sources":["../../../../src/features/math-fit/math-fit-report/math-fit-report.tsx"],"sourcesContent":["import { memo, useMemo, type FC } from 'react';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport ReportHeader from './comps/report-header/report-header';\nimport ScoreSection from './comps/score-section/score-section';\nimport {\n getQuestionStatusBgColor,\n LEGEND_ITEMS,\n transformSectionsToReportData,\n} from './math-fit-report-helpers';\nimport type { IMathFitReportProps } from './math-fit-report-types';\n\nconst MathFitReport: FC<IMathFitReportProps> = memo(function MathFitReport({\n data,\n onReview,\n studentName,\n userType,\n onBack,\n isMonthlyReportPage,\n}) {\n const sectionData = useMemo(() => transformSectionsToReportData(data.sections), [data.sections]);\n\n const scoreChange = useMemo(() => {\n if (data.previous_score && data.score) {\n return data.score - data.previous_score;\n }\n\n return undefined;\n }, [data.score, data.previous_score]);\n\n return (\n <FlexView\n $flex={1}\n $background=\"BLACK_T_04\"\n $borderColor={isMonthlyReportPage ? 'WHITE_5' : undefined}\n >\n <ReportHeader\n score={data.score ?? 0}\n maxScore={10}\n scoreChange={scoreChange}\n createdOnTs={data.created_on_ts}\n studentName={studentName}\n userType={userType}\n onBack={onBack}\n />\n\n {sectionData.map((section, index) => (\n <FlexView key={section.title} $background=\"WHITE\">\n <FlexView $gapX={1.5} $gutterX={1.25}>\n <ScoreSection\n isMonthlyReportPage={!!isMonthlyReportPage}\n onReviewSection={onReview}\n section={section}\n sheet={section.sheet}\n />\n </FlexView>\n {index !== sectionData.length - 1 && <FlexView $height={1} $background=\"BLACK_T_08\" />}\n </FlexView>\n ))}\n\n <FlexView $gutterX={1} $flexColumnGapX={1} $gapX={1} $flexRowGapX={2} $alignItems=\"center\">\n <FlexView $flexDirection=\"row\" $flexColumnGapX={1} $alignItems=\"center\">\n {LEGEND_ITEMS.map(item => (\n <FlexView\n key={item.label}\n $flexDirection=\"row\"\n $flexColumnGapX={0.25}\n $alignItems=\"center\"\n >\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {item.label}\n </Text>\n <FlexView\n $width={10}\n $height={10}\n $borderRadiusX={1}\n $background={getQuestionStatusBgColor(item.state)}\n />\n </FlexView>\n ))}\n </FlexView>\n {!isMonthlyReportPage && (\n <FlexView $flexRowGapX={0.25} $marginBottomX={0.5} $alignItems=\"center\">\n <Text $renderAs=\"ub3-bold\" $color=\"BLACK_1\" $align=\"center\">\n Keep Up the Great Work! 🚀\n </Text>\n <Text $renderAs=\"ub3\" $color=\"BLACK_1\" $align=\"center\">\n Youre getting stronger at MathFit each day. See you next month!\n </Text>\n </FlexView>\n )}\n </FlexView>\n </FlexView>\n );\n});\n\nexport default MathFitReport;\n"],"names":["MathFitReport","memo","data","onReview","studentName","userType","onBack","isMonthlyReportPage","sectionData","useMemo","transformSectionsToReportData","scoreChange","jsxs","FlexView","jsx","ReportHeader","section","index","ScoreSection","LEGEND_ITEMS","item","Text","getQuestionStatusBgColor","MathFitReport$1"],"mappings":";;;;;;;AAaA,MAAMA,IAAyCC,EAAK,SAAuB;AAAA,EACzE,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,qBAAAC;AACF,GAAG;AACK,QAAAC,IAAcC,EAAQ,MAAMC,EAA8BR,EAAK,QAAQ,GAAG,CAACA,EAAK,QAAQ,CAAC,GAEzFS,IAAcF,EAAQ,MAAM;AAC5B,QAAAP,EAAK,kBAAkBA,EAAK;AACvB,aAAAA,EAAK,QAAQA,EAAK;AAAA,KAI1B,CAACA,EAAK,OAAOA,EAAK,cAAc,CAAC;AAGlC,SAAA,gBAAAU;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,MACP,aAAY;AAAA,MACZ,cAAcN,IAAsB,YAAY;AAAA,MAEhD,UAAA;AAAA,QAAA,gBAAAO;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,OAAOb,EAAK,SAAS;AAAA,YACrB,UAAU;AAAA,YACV,aAAAS;AAAA,YACA,aAAaT,EAAK;AAAA,YAClB,aAAAE;AAAA,YACA,UAAAC;AAAA,YACA,QAAAC;AAAA,UAAA;AAAA,QACF;AA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O,UAAS,UAE5D,6BAAA,CAAA;AAAA,YACA,gBAAAP,EAACO,KAAK,WAAU,OAAM,QAAO,WAAU,QAAO,UAAS,UAEvD,mEAAA,CAAA;AAAA,UAAA,GACF;AAAA,QAAA,GAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC,GAEDE,IAAevB;"}
1
+ {"version":3,"file":"math-fit-report.js","sources":["../../../../src/features/math-fit/math-fit-report/math-fit-report.tsx"],"sourcesContent":["import { memo, useMemo, type FC } from 'react';\n\nimport { IS_APP_RUNNING_IN_RN } from '../../../constants/app-config';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport ReportHeader from './comps/report-header/report-header';\nimport ScoreSection from './comps/score-section/score-section';\nimport {\n getQuestionStatusBgColor,\n LEGEND_ITEMS,\n transformSectionsToReportData,\n} from './math-fit-report-helpers';\nimport type { IMathFitReportProps } from './math-fit-report-types';\n\nconst MathFitReport: FC<IMathFitReportProps> = memo(function MathFitReport({\n data,\n onReview,\n studentName,\n userType,\n onBack,\n compactView = false,\n showBorder = false,\n showEncouragement = true,\n}) {\n const borderColor = showBorder ? 'WHITE_5' : undefined;\n const sectionData = useMemo(() => transformSectionsToReportData(data.sections), [data.sections]);\n\n const scoreChange = useMemo(() => {\n if (data.previous_score && data.score) {\n return data.score - data.previous_score;\n }\n\n return undefined;\n }, [data.score, data.previous_score]);\n\n return (\n <FlexView $flex={1} $background=\"BLACK_T_04\" $borderColor={borderColor}>\n <ReportHeader\n score={data.score ?? 0}\n maxScore={10}\n scoreChange={scoreChange}\n createdOnTs={data.created_on_ts}\n studentName={studentName}\n userType={userType}\n onBack={onBack}\n compactView={compactView}\n showGreeting={!compactView}\n />\n\n {sectionData.map((section, index) => (\n <FlexView key={section.title} $background=\"WHITE\">\n <FlexView $gapX={1.5} $gutterX={1.25}>\n <ScoreSection\n onReviewSection={onReview}\n section={section}\n sheet={section.sheet}\n compactView={compactView}\n showReviewButton={!compactView && !IS_APP_RUNNING_IN_RN}\n />\n </FlexView>\n {index !== sectionData.length - 1 && <FlexView $height={1} $background=\"BLACK_T_08\" />}\n </FlexView>\n ))}\n\n <FlexView $gutterX={1} $flexColumnGapX={1} $gapX={1} $flexRowGapX={2} $alignItems=\"center\">\n <FlexView $flexDirection=\"row\" $flexColumnGapX={1} $alignItems=\"center\">\n {LEGEND_ITEMS.map(item => (\n <FlexView\n key={item.label}\n $flexDirection=\"row\"\n $flexColumnGapX={0.25}\n $alignItems=\"center\"\n >\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {item.label}\n </Text>\n <FlexView\n $width={10}\n $height={10}\n $borderRadiusX={1}\n $background={getQuestionStatusBgColor(item.state)}\n />\n </FlexView>\n ))}\n </FlexView>\n {showEncouragement && (\n <FlexView $flexRowGapX={0.25} $marginBottomX={0.5} $alignItems=\"center\">\n <Text $renderAs=\"ub3-bold\" $color=\"BLACK_1\" $align=\"center\">\n Keep Up the Great Work! 🚀\n </Text>\n <Text $renderAs=\"ub3\" $color=\"BLACK_1\" $align=\"center\">\n You're getting stronger at MathFit each day. See you next month!\n </Text>\n </FlexView>\n )}\n </FlexView>\n </FlexView>\n );\n});\n\nexport default MathFitReport;\n"],"names":["MathFitReport","memo","data","onReview","studentName","userType","onBack","compactView","showBorder","showEncouragement","borderColor","sectionData","useMemo","transformSectionsToReportData","scoreChange","FlexView","jsx","ReportHeader","section","index","jsxs","ScoreSection","IS_APP_RUNNING_IN_RN","LEGEND_ITEMS","item","Text","getQuestionStatusBgColor","MathFitReport$1"],"mappings":";;;;;;;;AAcA,MAAMA,IAAyCC,EAAK,SAAuB;AAAA,EACzE,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,YAAAC,IAAa;AAAA,EACb,mBAAAC,IAAoB;AACtB,GAAG;AACK,QAAAC,IAAcF,IAAa,YAAY,QACvCG,IAAc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AAAJ;AAAA,QAACL;AAAA,QAAA;AAAA,UAEC,gBAAe;AAAA,UACf,iBAAiB;AAAA,UACjB,aAAY;AAAA,UAEZ,UAAA;AAAA,YAAA,gBAAAC,EAACS,KAAK,WAAU,OAAM,QAAO,cAC1B,YAAK,OACR;AAAA,YACA,gBAAAT;AAAA,cAACD;AAAA,cAAA;AAAA,gBACC,QAAQ;AAAA,gBACR,SAAS;AAAA,gBACT,gBAAgB;AAAA,gBAChB,aAAaW,EAAyBF,EAAK,KAAK;AAAA,cAAA;AAAA,YAClD;AAAA,UAAA;AAAA,QAAA;AAAA,QAbKA,EAAK;AAAA,MAeb,CAAA,GACH;AAAA,MACCf,uBACEM,GAAS,EAAA,cAAc,MAAM,gBAAgB,KAAK,aAAY,UAC7D,UAAA;AAAA,QAAA,gBAAAC,EAACS,KAAK,WAAU,YAAW,QAAO,WAAU,QAAO,UAAS,UAE5D,6BAAA,CAAA;AAAA,QACA,gBAAAT,EAACS,KAAK,WAAU,OAAM,QAAO,WAAU,QAAO,UAAS,UAEvD,mEAAA,CAAA;AAAA,MAAA,GACF;AAAA,IAAA,GAEJ;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC,GAEDE,IAAe3B;"}
@@ -1,21 +1,23 @@
1
- import { jsxs as p, jsx as r } from "react/jsx-runtime";
2
- import a from "../../../../../math-fit/math-fit-report/math-fit-report.js";
1
+ import { jsxs as a, jsx as r } from "react/jsx-runtime";
2
+ import n from "../../../../../math-fit/math-fit-report/math-fit-report.js";
3
3
  import t from "../../../../../ui/layout/flex-view.js";
4
- import l from "../../../../../ui/separator/separator.js";
5
- import n from "../../../../../ui/text/text.js";
4
+ import p from "../../../../../ui/separator/separator.js";
5
+ import l from "../../../../../ui/text/text.js";
6
6
  const u = ({
7
7
  mathfitTests: e,
8
8
  studentName: i
9
- }) => !e || e.length === 0 ? null : /* @__PURE__ */ p(t, { children: [
10
- /* @__PURE__ */ r(n, { $renderAs: "ab1-bold", $color: "BLACK_1", children: "MathFit Test Report" }),
11
- /* @__PURE__ */ r(l, { heightX: 1 }),
9
+ }) => !e || e.length === 0 ? null : /* @__PURE__ */ a(t, { children: [
10
+ /* @__PURE__ */ r(l, { $renderAs: "ab1-bold", $color: "BLACK_1", children: "MathFit Test Report" }),
11
+ /* @__PURE__ */ r(p, { heightX: 1 }),
12
12
  /* @__PURE__ */ r(t, { $flexGapX: 1.5, children: e.map((o) => /* @__PURE__ */ r(
13
- a,
13
+ n,
14
14
  {
15
15
  data: o,
16
16
  studentName: i,
17
17
  userType: "STUDENT",
18
- isMonthlyReportPage: !0,
18
+ compactView: !0,
19
+ showBorder: !0,
20
+ showEncouragement: !1,
19
21
  onBack: () => {
20
22
  },
21
23
  onReview: () => {
@@ -1 +1 @@
1
- {"version":3,"file":"mathfit.js","sources":["../../../../../../../src/features/timeline/monthly-timeline/monthly-report/comps/mathfit/mathfit.tsx"],"sourcesContent":["import { type IMathFitAssessmentResponse } from '../../../../../math-fit/math-fit-overview/math-fit-overview-types';\nimport MathFitReport from '../../../../../math-fit/math-fit-report/math-fit-report';\nimport FlexView from '../../../../../ui/layout/flex-view';\nimport Separator from '../../../../../ui/separator/separator';\nimport Text from '../../../../../ui/text/text';\n\nconst Mathfit = ({\n mathfitTests,\n studentName,\n}: {\n mathfitTests: IMathFitAssessmentResponse[];\n studentName: string;\n}) => {\n if (!mathfitTests || mathfitTests.length === 0) {\n return null;\n }\n\n return (\n <FlexView>\n <Text $renderAs=\"ab1-bold\" $color=\"BLACK_1\">\n MathFit Test Report\n </Text>\n <Separator heightX={1} />\n <FlexView $flexGapX={1.5}>\n {mathfitTests.map(test => (\n <MathFitReport\n key={test.id}\n data={test}\n studentName={studentName}\n userType=\"STUDENT\"\n isMonthlyReportPage\n onBack={() => {}}\n onReview={() => {}}\n />\n ))}\n </FlexView>\n </FlexView>\n );\n};\n\nexport default Mathfit;\n"],"names":["Mathfit","mathfitTests","studentName","FlexView","jsx","Text","Separator","test","MathFitReport"],"mappings":";;;;;AAMA,MAAMA,IAAU,CAAC;AAAA,EACf,cAAAC;AAAA,EACA,aAAAC;AACF,MAIM,CAACD,KAAgBA,EAAa,WAAW,IACpC,yBAINE,GACC,EAAA,UAAA;AAAA,EAAA,gBAAAC,EAACC,GAAK,EAAA,WAAU,YAAW,QAAO,WAAU,UAE5C,uBAAA;AAAA,EACA,gBAAAD,EAACE,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,oBACtBH,GAAS,EAAA,WAAW,KAClB,UAAAF,EAAa,IAAI,CAChBM,MAAA,gBAAAH;AAAA,IAACI;AAAA,IAAA;AAAA,MAEC,MAAMD;AAAA,MACN,aAAAL;AAAA,MACA,UAAS;AAAA,MACT,qBAAmB;AAAA,MACnB,QAAQ,MAAM;AAAA,MAAC;AAAA,MACf,UAAU,MAAM;AAAA,MAAC;AAAA,IAAA;AAAA,IANZK,EAAK;AAAA,EAQb,CAAA,GACH;AACF,EAAA,CAAA;"}
1
+ {"version":3,"file":"mathfit.js","sources":["../../../../../../../src/features/timeline/monthly-timeline/monthly-report/comps/mathfit/mathfit.tsx"],"sourcesContent":["import { type IMathFitAssessmentResponse } from '../../../../../math-fit/math-fit-overview/math-fit-overview-types';\nimport MathFitReport from '../../../../../math-fit/math-fit-report/math-fit-report';\nimport FlexView from '../../../../../ui/layout/flex-view';\nimport Separator from '../../../../../ui/separator/separator';\nimport Text from '../../../../../ui/text/text';\n\nconst Mathfit = ({\n mathfitTests,\n studentName,\n}: {\n mathfitTests: IMathFitAssessmentResponse[];\n studentName: string;\n}) => {\n if (!mathfitTests || mathfitTests.length === 0) {\n return null;\n }\n\n return (\n <FlexView>\n <Text $renderAs=\"ab1-bold\" $color=\"BLACK_1\">\n MathFit Test Report\n </Text>\n <Separator heightX={1} />\n <FlexView $flexGapX={1.5}>\n {mathfitTests.map(test => (\n <MathFitReport\n key={test.id}\n data={test}\n studentName={studentName}\n userType=\"STUDENT\"\n compactView={true}\n showBorder={true}\n showEncouragement={false}\n onBack={() => {}}\n onReview={() => {}}\n />\n ))}\n </FlexView>\n </FlexView>\n );\n};\n\nexport default Mathfit;\n"],"names":["Mathfit","mathfitTests","studentName","FlexView","jsx","Text","Separator","test","MathFitReport"],"mappings":";;;;;AAMA,MAAMA,IAAU,CAAC;AAAA,EACf,cAAAC;AAAA,EACA,aAAAC;AACF,MAIM,CAACD,KAAgBA,EAAa,WAAW,IACpC,yBAINE,GACC,EAAA,UAAA;AAAA,EAAA,gBAAAC,EAACC,GAAK,EAAA,WAAU,YAAW,QAAO,WAAU,UAE5C,uBAAA;AAAA,EACA,gBAAAD,EAACE,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,oBACtBH,GAAS,EAAA,WAAW,KAClB,UAAAF,EAAa,IAAI,CAChBM,MAAA,gBAAAH;AAAA,IAACI;AAAA,IAAA;AAAA,MAEC,MAAMD;AAAA,MACN,aAAAL;AAAA,MACA,UAAS;AAAA,MACT,aAAa;AAAA,MACb,YAAY;AAAA,MACZ,mBAAmB;AAAA,MACnB,QAAQ,MAAM;AAAA,MAAC;AAAA,MACf,UAAU,MAAM;AAAA,MAAC;AAAA,IAAA;AAAA,IARZK,EAAK;AAAA,EAUb,CAAA,GACH;AACF,EAAA,CAAA;"}
package/dist/index.d.ts CHANGED
@@ -2791,8 +2791,10 @@ declare interface IMathFitReportProps {
2791
2791
  onReview: (sheetData: INodeDataProps, sectionId: string) => void;
2792
2792
  studentName: string;
2793
2793
  userType: TUserTypes;
2794
- isMonthlyReportPage?: boolean;
2795
2794
  onBack: () => void;
2795
+ compactView?: boolean;
2796
+ showBorder?: boolean;
2797
+ showEncouragement?: boolean;
2796
2798
  }
2797
2799
 
2798
2800
  declare interface IMathFitSection {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/leap",
3
- "version": "3.5.68-as2",
3
+ "version": "3.5.69-as1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"