@cuemath/leap 3.5.27-as2 → 3.5.27-as3
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/assets/illustrations/illustrations.js +2 -0
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/line-icons/icons/dots-icon.js +21 -0
- package/dist/assets/line-icons/icons/dots-icon.js.map +1 -0
- package/dist/assets/line-icons/icons/pause-icon.js +24 -0
- package/dist/assets/line-icons/icons/pause-icon.js.map +1 -0
- package/dist/features/chapters/chapters-list/chapter-item/chapter-circular-progress/chapter-circular-progress.js +29 -28
- package/dist/features/chapters/chapters-list/chapter-item/chapter-circular-progress/chapter-circular-progress.js.map +1 -1
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js +1 -2
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js.map +1 -1
- package/dist/features/timeline/monthly-report/api/use-monthly-report-get.js +8 -5
- package/dist/features/timeline/monthly-report/api/use-monthly-report-get.js.map +1 -1
- package/dist/features/timeline/monthly-report/comps/activities/activities-card/activities-card.js +1 -1
- package/dist/features/timeline/monthly-report/comps/activities/activities-card/activities-card.js.map +1 -1
- package/dist/features/timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.js +29 -23
- package/dist/features/timeline/monthly-report/comps/activities/activities-card-puzzles/activities-card-puzzles.js.map +1 -1
- package/dist/features/timeline/monthly-report/comps/activities/activities.js.map +1 -1
- package/dist/features/timeline/monthly-report/comps/activities/constants.js +1 -1
- package/dist/features/timeline/monthly-report/comps/activities/constants.js.map +1 -1
- package/dist/features/timeline/monthly-report/comps/activities/utils.js.map +1 -1
- package/dist/features/timeline/monthly-report/comps/attendance/attendance-constants.js +29 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendance-constants.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendance-utils.js +95 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendance-utils.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendance.js +77 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendance.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendance.styled.js +39 -0
- package/dist/features/timeline/monthly-report/comps/attendance/attendance.styled.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/feedback/feedback.js +92 -0
- package/dist/features/timeline/monthly-report/comps/feedback/feedback.js.map +1 -0
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goal-chapter-card.js +23 -22
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goal-chapter-card.js.map +1 -1
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/{goals-card.styled.js → goals-card-styled.js} +1 -1
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/{goals-card.styled.js.map → goals-card-styled.js.map} +1 -1
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goals-card.js +57 -57
- package/dist/features/timeline/monthly-report/comps/goals/goals-card/goals-card.js.map +1 -1
- package/dist/features/timeline/monthly-report/comps/goals/goals-constants.js +5 -4
- package/dist/features/timeline/monthly-report/comps/goals/goals-constants.js.map +1 -1
- package/dist/features/timeline/monthly-report/{monthly-report.styled.js → monthly-report-styled.js} +1 -1
- package/dist/features/timeline/monthly-report/{monthly-report.styled.js.map → monthly-report-styled.js.map} +1 -1
- package/dist/features/timeline/monthly-report/{monthly-report.types.js → monthly-report-types.js} +1 -1
- package/dist/features/timeline/monthly-report/monthly-report-types.js.map +1 -0
- package/dist/features/timeline/monthly-report/monthly-report.js +50 -27
- package/dist/features/timeline/monthly-report/monthly-report.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/api/use-monthly-timeline-get.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.js +1 -1
- package/dist/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/{monthly-timeline.types.js → monthly-timeline-types.js} +1 -1
- package/dist/features/timeline/monthly-timeline/{monthly-timeline.types.js.map → monthly-timeline-types.js.map} +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-timeline-view.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-timeline.js +15 -15
- package/dist/features/timeline/monthly-timeline/monthly-timeline.js.map +1 -1
- package/dist/features/ui/animated-arc/animated-arc-styled.js +1 -1
- package/dist/features/ui/animated-arc/animated-arc-styled.js.map +1 -1
- package/dist/features/ui/animated-arc/animated-arc.js +10 -10
- package/dist/features/ui/animated-arc/animated-arc.js.map +1 -1
- package/dist/index.d.ts +23 -7
- package/dist/index.js +566 -562
- package/dist/index.js.map +1 -1
- package/dist/static/thumps-down.a1192a62.svg +1 -0
- package/dist/static/thumps-up.caa35a98.svg +1 -0
- package/package.json +1 -1
- package/dist/features/timeline/monthly-report/monthly-report.types.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activities.js","sources":["../../../../../../src/features/timeline/monthly-report/comps/activities/activities.tsx"],"sourcesContent":["import { memo, type FC } from 'react';\n\nimport { type IActivitiesProps } from './activities-types';\nimport { type TNodeTypes } from '../../../../chapters-v2/comps/node-card/node-card-types';\nimport ActivitiesCard from './activities-card/activities-card';\nimport { type CARD_TYPE } from '../../monthly-report
|
|
1
|
+
{"version":3,"file":"activities.js","sources":["../../../../../../src/features/timeline/monthly-report/comps/activities/activities.tsx"],"sourcesContent":["import { memo, type FC } from 'react';\n\nimport { type IActivitiesProps } from './activities-types';\nimport { type TNodeTypes } from '../../../../chapters-v2/comps/node-card/node-card-types';\nimport ActivitiesCard from './activities-card/activities-card';\nimport { type CARD_TYPE } from '../../monthly-report-types';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport Separator from '../../../../ui/separator/separator';\n\nconst Activities: FC<IActivitiesProps> = ({ activities, onPuzzleClick }) => {\n return (\n <FlexView>\n <Text $renderAs=\"ab1-bold\" $color=\"BLACK_1\">\n Activities\n </Text>\n <Separator heightX={1} />\n <FlexView $flexRowGapX={1.5}>\n {Object.entries(activities).map(([cardType, activitiesList]) => {\n if (!activitiesList?.length) return null;\n\n return (\n <ActivitiesCard\n key={cardType}\n nodeType={activitiesList[0]?.node_type as TNodeTypes}\n cardType={cardType as CARD_TYPE}\n activitiesList={activitiesList}\n onPuzzleClick={onPuzzleClick}\n />\n );\n })}\n </FlexView>\n </FlexView>\n );\n};\n\nexport default memo(Activities);\n"],"names":["Activities","activities","onPuzzleClick","FlexView","jsx","Text","Separator","cardType","activitiesList","ActivitiesCard","_a","Activities$1","memo"],"mappings":";;;;;;AAUA,MAAMA,IAAmC,CAAC,EAAE,YAAAC,GAAY,eAAAC,0BAEnDC,GACC,EAAA,UAAA;AAAA,EAAA,gBAAAC,EAACC,GAAK,EAAA,WAAU,YAAW,QAAO,WAAU,UAE5C,cAAA;AAAA,EACA,gBAAAD,EAACE,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,EACtB,gBAAAF,EAAAD,GAAA,EAAS,cAAc,KACrB,UAAO,OAAA,QAAQF,CAAU,EAAE,IAAI,CAAC,CAACM,GAAUC,CAAc,MAAM;;AAC1D,WAACA,KAAA,QAAAA,EAAgB,SAGnB,gBAAAJ;AAAA,MAACK;AAAA,MAAA;AAAA,QAEC,WAAUC,IAAAF,EAAe,CAAC,MAAhB,gBAAAE,EAAmB;AAAA,QAC7B,UAAAH;AAAA,QACA,gBAAAC;AAAA,QACA,eAAAN;AAAA,MAAA;AAAA,MAJKK;AAAA,IAAA,IAJ2B;AAAA,EAWrC,CAAA,GACH;AACF,EAAA,CAAA,GAIWI,IAAAC,EAAKZ,CAAU;"}
|
|
@@ -5,7 +5,7 @@ import T from "../../../../../assets/line-icons/icons/status.js";
|
|
|
5
5
|
import e from "../../../../../assets/line-icons/icons/exclamation.js";
|
|
6
6
|
import { NODE_STATE as E } from "../../../daily-timeline-types.js";
|
|
7
7
|
import { ILLUSTRATIONS as c } from "../../../../../assets/illustrations/illustrations.js";
|
|
8
|
-
import { CARD_TYPE as o } from "../../monthly-report
|
|
8
|
+
import { CARD_TYPE as o } from "../../monthly-report-types.js";
|
|
9
9
|
function R(a) {
|
|
10
10
|
switch (a) {
|
|
11
11
|
case o.learn:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../../../src/features/timeline/monthly-report/comps/activities/constants.tsx"],"sourcesContent":["import { LOTTIE } from '../../../../../assets/lottie/lottie';\nimport Check2Icon from '../../../../../assets/line-icons/icons/check2';\nimport StatusIcon from '../../../../../assets/line-icons/icons/status';\nimport ExclamationIcon from '../../../../../assets/line-icons/icons/exclamation';\nimport { NODE_STATE } from '../../../daily-timeline-types';\nimport { ILLUSTRATIONS } from '../../../../../assets/illustrations/illustrations';\nimport { CARD_TYPE } from '../../monthly-report
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../../../src/features/timeline/monthly-report/comps/activities/constants.tsx"],"sourcesContent":["import { LOTTIE } from '../../../../../assets/lottie/lottie';\nimport Check2Icon from '../../../../../assets/line-icons/icons/check2';\nimport StatusIcon from '../../../../../assets/line-icons/icons/status';\nimport ExclamationIcon from '../../../../../assets/line-icons/icons/exclamation';\nimport { NODE_STATE } from '../../../daily-timeline-types';\nimport { ILLUSTRATIONS } from '../../../../../assets/illustrations/illustrations';\nimport { CARD_TYPE } from '../../monthly-report-types';\n\nexport function getCardTypeIconMap(cardType: CARD_TYPE) {\n switch (cardType) {\n case CARD_TYPE.learn:\n return {\n lottie: LOTTIE.LEARN,\n color: 'YELLOW_2',\n background: ILLUSTRATIONS.NODE_LEARN_BG,\n };\n case CARD_TYPE.practice:\n case CARD_TYPE.smart_practice:\n case CARD_TYPE.extra_practice:\n return {\n lottie: LOTTIE.PRACTICE,\n color: 'PURPLE_2',\n background: ILLUSTRATIONS.NODE_PRACTICE_BG,\n };\n case CARD_TYPE.puzzle:\n return {\n lottie: LOTTIE.PUZZLE,\n color: 'PURPLE_2',\n background: ILLUSTRATIONS.NODE_PUZZLE_BG,\n };\n case CARD_TYPE.test:\n case CARD_TYPE.diagnostic:\n return {\n lottie: LOTTIE.TEST,\n color: 'ORANGE_2',\n background: ILLUSTRATIONS.NODE_CUSTOM_TEST_BG,\n };\n case CARD_TYPE.challenge:\n return {\n lottie: LOTTIE.COMPETITIVE_ARENA,\n color: 'ORANGE_2',\n background: ILLUSTRATIONS.NODE_TEST_PREP_BG,\n };\n case CARD_TYPE.advanced:\n return {\n lottie: LOTTIE.TEST,\n color: 'GREEN_2',\n background: ILLUSTRATIONS.NODE_ACTIVITY_BG,\n };\n case CARD_TYPE.subjective:\n return {\n lottie: LOTTIE.SUBJECTIVE,\n color: 'BLUE_2',\n background: ILLUSTRATIONS.NODE_SUBJECTIVE_BG,\n };\n case CARD_TYPE.recap:\n case CARD_TYPE.remedial:\n case CARD_TYPE.revision:\n return {\n lottie: LOTTIE.RECAP,\n color: 'BLUE_2',\n background: ILLUSTRATIONS.NODE_RECAP_BG,\n };\n\n case CARD_TYPE.activity:\n return {\n lottie: LOTTIE.ACTIVITY,\n color: 'ORANGE_2',\n background: ILLUSTRATIONS.NODE_ACTIVITY_BG,\n };\n\n case CARD_TYPE.video:\n return {\n lottie: LOTTIE.VIDEO,\n color: 'GREEN_2',\n background: ILLUSTRATIONS.NODE_VIDEO_BG,\n };\n\n default:\n return {\n lottie: LOTTIE.PROJECT,\n color: 'GREEN_2',\n background: ILLUSTRATIONS.NODE_PROJECT_BG,\n };\n }\n}\n\nexport const stateIcon = {\n [NODE_STATE.COMPLETED]: <Check2Icon color=\"WHITE\" />,\n [NODE_STATE.IN_PROGRESS]: <StatusIcon color=\"WHITE\" />,\n [NODE_STATE.PENDING]: <ExclamationIcon color=\"WHITE\" />,\n [NODE_STATE.NOT_STARTED]: <ExclamationIcon color=\"WHITE\" />,\n};\n"],"names":["getCardTypeIconMap","cardType","CARD_TYPE","LOTTIE","ILLUSTRATIONS","stateIcon","NODE_STATE","jsx","Check2Icon","StatusIcon","ExclamationIcon"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EAAU;AACN,aAAA;AAAA,QACL,QAAQC,EAAO;AAAA,QACf,OAAO;AAAA,QACP,YAAYC,EAAc;AAAA,MAAA;AAAA,IAG9B;AACS,aAAA;AAAA,QACL,QAAQD,EAAO;AAAA,QACf,OAAO;AAAA,QACP,YAAYC,EAAc;AAAA,MAAA;AAAA,EAEhC;AACF;AAEO,MAAMC,IAAY;AAAA,EACvB,CAACC,EAAW,SAAS,GAAI,gBAAAC,EAAAC,GAAA,EAAW,OAAM,SAAQ;AAAA,EAClD,CAACF,EAAW,WAAW,GAAI,gBAAAC,EAAAE,GAAA,EAAW,OAAM,SAAQ;AAAA,EACpD,CAACH,EAAW,OAAO,GAAI,gBAAAC,EAAAG,GAAA,EAAgB,OAAM,SAAQ;AAAA,EACrD,CAACJ,EAAW,WAAW,GAAI,gBAAAC,EAAAG,GAAA,EAAgB,OAAM,SAAQ;AAC3D;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../../../src/features/timeline/monthly-report/comps/activities/utils.ts"],"sourcesContent":["import { type IMonthlyActivity } from '../../monthly-report
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../../../src/features/timeline/monthly-report/comps/activities/utils.ts"],"sourcesContent":["import { type IMonthlyActivity } from '../../monthly-report-types';\nimport { NODE_STATE } from '../../../daily-timeline-types';\n\nexport const countActivitiesByState = (activitiesList: IMonthlyActivity[]) => {\n const totalDone = activitiesList.filter(\n activity => activity.state === NODE_STATE.COMPLETED,\n ).length;\n const totalPending = activitiesList.filter(\n activity => activity.state === NODE_STATE.IN_PROGRESS,\n ).length;\n const totalOverdue = activitiesList.filter(\n activity => activity.state === NODE_STATE.PENDING,\n ).length;\n\n return { totalDone, totalPending, totalOverdue };\n};\n"],"names":["countActivitiesByState","activitiesList","totalDone","activity","NODE_STATE","totalPending","totalOverdue"],"mappings":";AAGa,MAAAA,IAAyB,CAACC,MAAuC;AAC5E,QAAMC,IAAYD,EAAe;AAAA,IAC/B,CAAAE,MAAYA,EAAS,UAAUC,EAAW;AAAA,EAC1C,EAAA,QACIC,IAAeJ,EAAe;AAAA,IAClC,CAAAE,MAAYA,EAAS,UAAUC,EAAW;AAAA,EAC1C,EAAA,QACIE,IAAeL,EAAe;AAAA,IAClC,CAAAE,MAAYA,EAAS,UAAUC,EAAW;AAAA,EAC1C,EAAA;AAEK,SAAA,EAAE,WAAAF,GAAW,cAAAG,GAAc,cAAAC;AACpC;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const E = {
|
|
2
|
+
ATTENDED: "attended",
|
|
3
|
+
MISSED: "missed",
|
|
4
|
+
PAUSED: "paused"
|
|
5
|
+
}, A = {
|
|
6
|
+
DAYS_PER_WEEK: 7,
|
|
7
|
+
DAY_HEADERS: ["S", "M", "Tu", "W", "Th", "F", "S"],
|
|
8
|
+
FIRST_DAY_OF_WEEK: 0
|
|
9
|
+
// Sunday = 0
|
|
10
|
+
}, S = [
|
|
11
|
+
"Jan",
|
|
12
|
+
"Feb",
|
|
13
|
+
"Mar",
|
|
14
|
+
"Apr",
|
|
15
|
+
"May",
|
|
16
|
+
"Jun",
|
|
17
|
+
"Jul",
|
|
18
|
+
"Aug",
|
|
19
|
+
"Sep",
|
|
20
|
+
"Oct",
|
|
21
|
+
"Nov",
|
|
22
|
+
"Dec"
|
|
23
|
+
];
|
|
24
|
+
export {
|
|
25
|
+
E as ATTENDANCE_STATUS,
|
|
26
|
+
A as CALENDAR_CONFIG,
|
|
27
|
+
S as MONTH_NAMES
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=attendance-constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attendance-constants.js","sources":["../../../../../../src/features/timeline/monthly-report/comps/attendance/attendance-constants.ts"],"sourcesContent":["export const ATTENDANCE_STATUS = {\n ATTENDED: 'attended',\n MISSED: 'missed',\n PAUSED: 'paused',\n} as const;\n\nexport const CALENDAR_CONFIG = {\n DAYS_PER_WEEK: 7,\n DAY_HEADERS: ['S', 'M', 'Tu', 'W', 'Th', 'F', 'S'],\n FIRST_DAY_OF_WEEK: 0, // Sunday = 0\n} as const;\n\nexport const MONTH_NAMES = [\n 'Jan',\n 'Feb',\n 'Mar',\n 'Apr',\n 'May',\n 'Jun',\n 'Jul',\n 'Aug',\n 'Sep',\n 'Oct',\n 'Nov',\n 'Dec',\n];\n"],"names":["ATTENDANCE_STATUS","CALENDAR_CONFIG","MONTH_NAMES"],"mappings":"AAAO,MAAMA,IAAoB;AAAA,EAC/B,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,QAAQ;AACV,GAEaC,IAAkB;AAAA,EAC7B,eAAe;AAAA,EACf,aAAa,CAAC,KAAK,KAAK,MAAM,KAAK,MAAM,KAAK,GAAG;AAAA,EACjD,mBAAmB;AAAA;AACrB,GAEaC,IAAc;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import S from "../../../../../assets/line-icons/icons/check2.js";
|
|
3
|
+
import f from "../../../../../assets/line-icons/icons/cross.js";
|
|
4
|
+
import D from "../../../../../assets/line-icons/icons/dots-icon.js";
|
|
5
|
+
import _ from "../../../../../assets/line-icons/icons/pause-icon.js";
|
|
6
|
+
import { ATTENDANCE_STATUS as a } from "./attendance-constants.js";
|
|
7
|
+
import { StatusSymbol as C } from "./attendance.styled.js";
|
|
8
|
+
import T from "../../../../ui/theme/clrs.js";
|
|
9
|
+
const l = T(), w = (t) => t == null ? void 0 : t.map((o) => I(o)).join(`
|
|
10
|
+
`), b = (t) => t.is_present ? a.ATTENDED : t.is_paused ? a.PAUSED : a.MISSED, x = (t) => {
|
|
11
|
+
let o = 0, s = 0, r = 0;
|
|
12
|
+
Object.values(t).forEach((i) => {
|
|
13
|
+
i.forEach((e) => {
|
|
14
|
+
switch (b(e)) {
|
|
15
|
+
case a.ATTENDED:
|
|
16
|
+
o++;
|
|
17
|
+
break;
|
|
18
|
+
case a.PAUSED:
|
|
19
|
+
r++;
|
|
20
|
+
break;
|
|
21
|
+
default:
|
|
22
|
+
s++;
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
const n = [];
|
|
28
|
+
return o > 0 && n.push(`${o} attended`), s > 0 && n.push(`${s} missed`), r > 0 && n.push(`${r} paused`), `${n.join(", ")}.`;
|
|
29
|
+
}, A = (t) => {
|
|
30
|
+
if (t.length === 0)
|
|
31
|
+
return {
|
|
32
|
+
status: null,
|
|
33
|
+
themeColor: null,
|
|
34
|
+
statusSymbol: ""
|
|
35
|
+
};
|
|
36
|
+
if (t.length > 1)
|
|
37
|
+
return {
|
|
38
|
+
status: a.PAUSED,
|
|
39
|
+
themeColor: "WHITE_4",
|
|
40
|
+
statusSymbol: /* @__PURE__ */ u(C, { $top: "2px", $right: "2px", children: /* @__PURE__ */ u(D, { color: "GREEN_6", width: 8, height: 8 }) }),
|
|
41
|
+
tooltipBgColor: "WHITE_5",
|
|
42
|
+
snackbarBg: l.WHITE_5
|
|
43
|
+
};
|
|
44
|
+
const o = t.find((r) => r.is_present), s = t.find((r) => r.is_paused);
|
|
45
|
+
return o ? {
|
|
46
|
+
status: a.ATTENDED,
|
|
47
|
+
themeColor: "GREEN_1",
|
|
48
|
+
statusSymbol: /* @__PURE__ */ u(S, { color: "GREEN_6", width: 14, height: 14 }),
|
|
49
|
+
tooltipBgColor: "GREEN_2",
|
|
50
|
+
snackbarBg: l.GREEN_2
|
|
51
|
+
} : s ? {
|
|
52
|
+
status: a.PAUSED,
|
|
53
|
+
themeColor: "WHITE_4",
|
|
54
|
+
statusSymbol: /* @__PURE__ */ u(_, { color: "BLACK_T_60", width: 8, height: 8 }),
|
|
55
|
+
tooltipBgColor: "WHITE_5",
|
|
56
|
+
snackbarBg: l.WHITE_5
|
|
57
|
+
} : {
|
|
58
|
+
status: a.MISSED,
|
|
59
|
+
themeColor: "ORANGE_1",
|
|
60
|
+
statusSymbol: /* @__PURE__ */ u(f, { color: "RED", width: 12, height: 12 }),
|
|
61
|
+
tooltipBgColor: "ORANGE_2",
|
|
62
|
+
snackbarBg: l.ORANGE_2
|
|
63
|
+
};
|
|
64
|
+
}, P = (t, o, s) => {
|
|
65
|
+
const r = new Date(s, o - 1, 1).getDay(), n = new Date(s, o, 0).getDate(), i = [];
|
|
66
|
+
for (let e = 0; e < r; e++)
|
|
67
|
+
i.push(null);
|
|
68
|
+
for (let e = 1; e <= n; e++) {
|
|
69
|
+
const m = `${s}-${o.toString().padStart(2, "0")}-${e.toString().padStart(2, "0")}`, c = t[m] || [], { status: d, themeColor: h, statusSymbol: E, tooltipBgColor: g, snackbarBg: p } = A(c);
|
|
70
|
+
i.push({
|
|
71
|
+
date: e,
|
|
72
|
+
status: d,
|
|
73
|
+
hasClasses: c.length > 0,
|
|
74
|
+
classes: c,
|
|
75
|
+
themeColor: h,
|
|
76
|
+
statusSymbol: E,
|
|
77
|
+
tooltipBgColor: g,
|
|
78
|
+
snackbarBg: p
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return i;
|
|
82
|
+
}, I = (t) => {
|
|
83
|
+
if (!t.status) return "";
|
|
84
|
+
const s = new Date(t.time * 1e3).getHours(), r = s >= 12 ? "PM" : "AM";
|
|
85
|
+
return `${`${s % 12 || 12} ${r}`}: ${t.status}`;
|
|
86
|
+
};
|
|
87
|
+
export {
|
|
88
|
+
x as attendanceStatsText,
|
|
89
|
+
P as generateCalendarGrid,
|
|
90
|
+
b as getClassStatus,
|
|
91
|
+
A as getDayStatusInfo,
|
|
92
|
+
w as getSnackbarMsg,
|
|
93
|
+
I as getStatusText
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=attendance-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attendance-utils.js","sources":["../../../../../../src/features/timeline/monthly-report/comps/attendance/attendance-utils.tsx"],"sourcesContent":["import type { JSX } from 'react';\n\nimport Check2Icon from '../../../../../assets/line-icons/icons/check2';\nimport CrossIcon from '../../../../../assets/line-icons/icons/cross';\nimport DotIcon from '../../../../../assets/line-icons/icons/dots-icon';\nimport PauseIcon from '../../../../../assets/line-icons/icons/pause-icon';\nimport type { TColorNames } from '../../../../ui/types';\nimport type { IClassEvent, TCalendarData } from '../../monthly-report-types';\nimport { ATTENDANCE_STATUS } from './attendance-constants';\nimport type { ICalendarDay, TAttendanceStatus } from './attendance-types';\nimport * as Styled from './attendance.styled';\nimport getColors from '../../../../ui/theme/clrs';\n\nconst colors = getColors();\n\nexport const getSnackbarMsg = (classes: IClassEvent[] | undefined) => {\n return classes?.map(item => getStatusText(item)).join('\\n');\n};\n\nexport const getClassStatus = (classEvent: IClassEvent): TAttendanceStatus => {\n if (classEvent.is_present) {\n return ATTENDANCE_STATUS.ATTENDED;\n }\n\n if (classEvent.is_paused) {\n return ATTENDANCE_STATUS.PAUSED;\n }\n\n return ATTENDANCE_STATUS.MISSED;\n};\n\nexport const attendanceStatsText = (calendarData: TCalendarData) => {\n let attended = 0;\n let missed = 0;\n let paused = 0;\n\n Object.values(calendarData).forEach(dayClasses => {\n dayClasses.forEach(classEvent => {\n const status = getClassStatus(classEvent);\n\n switch (status) {\n case ATTENDANCE_STATUS.ATTENDED:\n attended++;\n break;\n case ATTENDANCE_STATUS.PAUSED:\n paused++;\n break;\n default:\n missed++;\n break;\n }\n });\n });\n\n const parts: string[] = [];\n\n if (attended > 0) parts.push(`${attended} attended`);\n\n if (missed > 0) parts.push(`${missed} missed`);\n\n if (paused > 0) parts.push(`${paused} paused`);\n\n return `${parts.join(', ')}.`;\n};\n\nexport const getDayStatusInfo = (dayClasses: IClassEvent[]) => {\n if (dayClasses.length === 0) {\n return {\n status: null,\n themeColor: null,\n statusSymbol: '',\n };\n }\n\n if (dayClasses.length > 1) {\n return {\n status: ATTENDANCE_STATUS.PAUSED,\n themeColor: 'WHITE_4',\n statusSymbol: (\n <Styled.StatusSymbol $top=\"2px\" $right=\"2px\">\n <DotIcon color=\"GREEN_6\" width={8} height={8} />\n </Styled.StatusSymbol>\n ),\n tooltipBgColor: 'WHITE_5',\n snackbarBg: colors.WHITE_5,\n };\n }\n\n const attendedClass = dayClasses.find(cls => cls.is_present);\n const pausedClass = dayClasses.find(cls => cls.is_paused);\n\n if (attendedClass) {\n return {\n status: ATTENDANCE_STATUS.ATTENDED,\n themeColor: 'GREEN_1',\n statusSymbol: <Check2Icon color=\"GREEN_6\" width={14} height={14} />,\n tooltipBgColor: 'GREEN_2',\n snackbarBg: colors.GREEN_2,\n };\n }\n\n if (pausedClass) {\n return {\n status: ATTENDANCE_STATUS.PAUSED,\n themeColor: 'WHITE_4',\n statusSymbol: <PauseIcon color=\"BLACK_T_60\" width={8} height={8} />,\n tooltipBgColor: 'WHITE_5',\n snackbarBg: colors.WHITE_5,\n };\n }\n\n return {\n status: ATTENDANCE_STATUS.MISSED,\n themeColor: 'ORANGE_1',\n statusSymbol: <CrossIcon color=\"RED\" width={12} height={12} />,\n tooltipBgColor: 'ORANGE_2',\n snackbarBg: colors.ORANGE_2,\n };\n};\n\nexport const generateCalendarGrid = (\n calendarData: TCalendarData,\n reportMonth: number,\n reportYear: number,\n): (ICalendarDay | null)[] => {\n const firstDay = new Date(reportYear, reportMonth - 1, 1).getDay();\n const daysInMonth = new Date(reportYear, reportMonth, 0).getDate();\n const grid: (ICalendarDay | null)[] = [];\n\n // Add empty cells for days before the first day of the month\n for (let i = 0; i < firstDay; i++) {\n grid.push(null);\n }\n\n // Add all days of the month\n for (let day = 1; day <= daysInMonth; day++) {\n const dateString = `${reportYear}-${reportMonth.toString().padStart(2, '0')}-${day\n .toString()\n .padStart(2, '0')}`;\n const dayClasses = calendarData[dateString] || [];\n const { status, themeColor, statusSymbol, tooltipBgColor, snackbarBg } =\n getDayStatusInfo(dayClasses);\n\n grid.push({\n date: day,\n status,\n hasClasses: dayClasses.length > 0,\n classes: dayClasses,\n themeColor: themeColor as TColorNames | null,\n statusSymbol: statusSymbol as JSX.Element,\n tooltipBgColor: tooltipBgColor as TColorNames | null,\n snackbarBg,\n });\n }\n\n return grid;\n};\n\nexport const getStatusText = (classEvent: IClassEvent) => {\n if (!classEvent.status) return '';\n\n const date = new Date(classEvent.time * 1000);\n const hours = date.getHours();\n const ampm = hours >= 12 ? 'PM' : 'AM';\n const displayHours = hours % 12 || 12;\n\n const timeStr = `${displayHours} ${ampm}`;\n\n return `${timeStr}: ${classEvent.status}`;\n};\n"],"names":["colors","getColors","getSnackbarMsg","classes","item","getStatusText","getClassStatus","classEvent","ATTENDANCE_STATUS","attendanceStatsText","calendarData","attended","missed","paused","dayClasses","parts","getDayStatusInfo","jsx","Styled.StatusSymbol","DotIcon","attendedClass","cls","pausedClass","Check2Icon","PauseIcon","CrossIcon","generateCalendarGrid","reportMonth","reportYear","firstDay","daysInMonth","grid","i","day","dateString","status","themeColor","statusSymbol","tooltipBgColor","snackbarBg","hours","ampm"],"mappings":";;;;;;;;AAaA,MAAMA,IAASC,EAAU,GAEZC,IAAiB,CAACC,MACtBA,KAAA,gBAAAA,EAAS,IAAI,CAAQC,MAAAC,EAAcD,CAAI,GAAG,KAAK;AAAA,IAG3CE,IAAiB,CAACC,MACzBA,EAAW,aACNC,EAAkB,WAGvBD,EAAW,YACNC,EAAkB,SAGpBA,EAAkB,QAGdC,IAAsB,CAACC,MAAgC;AAClE,MAAIC,IAAW,GACXC,IAAS,GACTC,IAAS;AAEb,SAAO,OAAOH,CAAY,EAAE,QAAQ,CAAcI,MAAA;AAChD,IAAAA,EAAW,QAAQ,CAAcP,MAAA;AAG/B,cAFeD,EAAeC,CAAU,GAExB;AAAA,QACd,KAAKC,EAAkB;AACrB,UAAAG;AACA;AAAA,QACF,KAAKH,EAAkB;AACrB,UAAAK;AACA;AAAA,QACF;AACE,UA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1,77 @@
|
|
|
1
|
+
import { jsxs as n, jsx as r, Fragment as b } from "react/jsx-runtime";
|
|
2
|
+
import { memo as u, useMemo as l } from "react";
|
|
3
|
+
import { IS_APP_RUNNING_IN_RN as _ } from "../../../../../constants/app-config.js";
|
|
4
|
+
import f from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
|
|
5
|
+
import m from "../../../../ui/layout/flex-view.js";
|
|
6
|
+
import C from "../../../../ui/separator/separator.js";
|
|
7
|
+
import t from "../../../../ui/text/text.js";
|
|
8
|
+
import { CALENDAR_CONFIG as T, MONTH_NAMES as S } from "./attendance-constants.js";
|
|
9
|
+
import { attendanceStatsText as I, generateCalendarGrid as B, getSnackbarMsg as N, getStatusText as x } from "./attendance-utils.js";
|
|
10
|
+
import { CalendarHeader as E, CalendarBody as H, TooltipWrapper as j, CalendarDay as K, StatusSymbol as L } from "./attendance.styled.js";
|
|
11
|
+
const W = ({
|
|
12
|
+
calendarData: o,
|
|
13
|
+
reportMonth: s,
|
|
14
|
+
reportYear: c,
|
|
15
|
+
onDateClick: i
|
|
16
|
+
}) => {
|
|
17
|
+
const h = l(
|
|
18
|
+
() => !!o && I(o),
|
|
19
|
+
[o]
|
|
20
|
+
), p = l(
|
|
21
|
+
() => !!o && B(o, s, c),
|
|
22
|
+
[o, s, c]
|
|
23
|
+
), A = l(() => o ? Object.values(o).some((e) => e.length > 0) : !1, [o]);
|
|
24
|
+
return !o || Object.keys(o).length === 0 || !A || !p ? null : /* @__PURE__ */ n(m, { children: [
|
|
25
|
+
/* @__PURE__ */ r(t, { $renderAs: "ab1-bold", $color: "BLACK_1", children: "Attendance" }),
|
|
26
|
+
/* @__PURE__ */ r(t, { $renderAs: "ub2-bold", $color: "BLACK_T_60", children: h }),
|
|
27
|
+
/* @__PURE__ */ r(C, { heightX: 1 }),
|
|
28
|
+
/* @__PURE__ */ n(m, { $borderColor: "WHITE_5", children: [
|
|
29
|
+
/* @__PURE__ */ r(E, { children: T.DAY_HEADERS.map((e) => /* @__PURE__ */ r(t, { $align: "center", $renderAs: "ub3", $color: "BLACK_T_60", children: e }, e)) }),
|
|
30
|
+
/* @__PURE__ */ r(H, { children: p.map((e, g) => /* @__PURE__ */ r(
|
|
31
|
+
j,
|
|
32
|
+
{
|
|
33
|
+
onClick: () => i == null ? void 0 : i({
|
|
34
|
+
type: "info",
|
|
35
|
+
message: N((e == null ? void 0 : e.classes) || []) ?? "",
|
|
36
|
+
bgColor: (e == null ? void 0 : e.snackbarBg) || "WHITE_5"
|
|
37
|
+
}),
|
|
38
|
+
children: /* @__PURE__ */ r(
|
|
39
|
+
f,
|
|
40
|
+
{
|
|
41
|
+
renderAs: "primary",
|
|
42
|
+
position: "top",
|
|
43
|
+
hidden: _ || !(e != null && e.hasClasses),
|
|
44
|
+
backgroundColor: (e == null ? void 0 : e.tooltipBgColor) || "WHITE_5",
|
|
45
|
+
isBlocking: !0,
|
|
46
|
+
tooltipItem: e != null && e.classes ? /* @__PURE__ */ n(m, { $gutterX: 0.5, $gapX: 0.5, children: [
|
|
47
|
+
/* @__PURE__ */ n(t, { $align: "center", $renderAs: "ab3", $color: "BLACK_1", children: [
|
|
48
|
+
S[s],
|
|
49
|
+
" ",
|
|
50
|
+
e.date
|
|
51
|
+
] }),
|
|
52
|
+
e.classes.map(($) => /* @__PURE__ */ r(t, { $align: "center", $renderAs: "ab3", children: x($) }, $.time))
|
|
53
|
+
] }) : "",
|
|
54
|
+
children: /* @__PURE__ */ r(
|
|
55
|
+
K,
|
|
56
|
+
{
|
|
57
|
+
$background: (e == null ? void 0 : e.themeColor) || "WHITE_1",
|
|
58
|
+
$justifyContent: "center",
|
|
59
|
+
$alignItems: "center",
|
|
60
|
+
children: e && /* @__PURE__ */ n(b, { children: [
|
|
61
|
+
/* @__PURE__ */ r(t, { $renderAs: "ab2", $color: "BLACK_T_38", children: e.date }),
|
|
62
|
+
/* @__PURE__ */ r(L, { children: !!e.statusSymbol && e.statusSymbol })
|
|
63
|
+
] })
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
},
|
|
69
|
+
e ? `day-${e.date}` : `empty-${g}`
|
|
70
|
+
)) })
|
|
71
|
+
] })
|
|
72
|
+
] });
|
|
73
|
+
}, U = u(W);
|
|
74
|
+
export {
|
|
75
|
+
U as default
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=attendance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attendance.js","sources":["../../../../../../src/features/timeline/monthly-report/comps/attendance/attendance.tsx"],"sourcesContent":["import { memo, useMemo, type FC } from 'react';\n\nimport { IS_APP_RUNNING_IN_RN } from '../../../../../constants/app-config';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport { CALENDAR_CONFIG, MONTH_NAMES } from './attendance-constants';\nimport type { ICalendarDay, IAttendanceProps } from './attendance-types';\nimport {\n attendanceStatsText,\n generateCalendarGrid,\n getSnackbarMsg,\n getStatusText,\n} from './attendance-utils';\nimport * as Styled from './attendance.styled';\n\nconst Attendance: FC<IAttendanceProps> = ({\n calendarData,\n reportMonth,\n reportYear,\n onDateClick,\n}) => {\n const attendanceStats = useMemo(\n () => !!calendarData && attendanceStatsText(calendarData),\n [calendarData],\n );\n const calendarGrid = useMemo(\n () => !!calendarData && generateCalendarGrid(calendarData, reportMonth, reportYear),\n [calendarData, reportMonth, reportYear],\n );\n\n const hasClasses = useMemo(() => {\n if (!calendarData) return false;\n\n return Object.values(calendarData).some(dayClasses => dayClasses.length > 0);\n }, [calendarData]);\n\n if (!calendarData || Object.keys(calendarData).length === 0 || !hasClasses || !calendarGrid) {\n return null;\n }\n\n return (\n <FlexView>\n <Text $renderAs=\"ab1-bold\" $color=\"BLACK_1\">\n Attendance\n </Text>\n <Text $renderAs=\"ub2-bold\" $color=\"BLACK_T_60\">\n {attendanceStats}\n </Text>\n <Separator heightX={1} />\n <FlexView $borderColor=\"WHITE_5\">\n <Styled.CalendarHeader>\n {CALENDAR_CONFIG.DAY_HEADERS.map(dayLetter => (\n <Text $align=\"center\" $renderAs=\"ub3\" $color=\"BLACK_T_60\" key={dayLetter}>\n {dayLetter}\n </Text>\n ))}\n </Styled.CalendarHeader>\n <Styled.CalendarBody>\n {calendarGrid.map((day: ICalendarDay | null, index: number) => (\n <Styled.TooltipWrapper\n key={day ? `day-${day.date}` : `empty-${index}`}\n onClick={() =>\n onDateClick?.({\n type: 'info',\n message: getSnackbarMsg(day?.classes || []) ?? '',\n bgColor: day?.snackbarBg || 'WHITE_5',\n })\n }\n >\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"top\"\n hidden={IS_APP_RUNNING_IN_RN || !day?.hasClasses}\n backgroundColor={day?.tooltipBgColor || 'WHITE_5'}\n isBlocking={true}\n tooltipItem={\n day?.classes ? (\n <FlexView $gutterX={0.5} $gapX={0.5}>\n <Text $align=\"center\" $renderAs=\"ab3\" $color=\"BLACK_1\">\n {MONTH_NAMES[reportMonth]} {day.date}\n </Text>\n {day.classes.map(classEvent => (\n <Text $align=\"center\" $renderAs=\"ab3\" key={classEvent.time}>\n {getStatusText(classEvent)}\n </Text>\n ))}\n </FlexView>\n ) : (\n ''\n )\n }\n >\n <Styled.CalendarDay\n $background={day?.themeColor || 'WHITE_1'}\n $justifyContent=\"center\"\n $alignItems=\"center\"\n >\n {day && (\n <>\n <Text $renderAs=\"ab2\" $color=\"BLACK_T_38\">\n {day.date}\n </Text>\n <Styled.StatusSymbol>\n {!!day.statusSymbol && day.statusSymbol}\n </Styled.StatusSymbol>\n </>\n )}\n </Styled.CalendarDay>\n </ArrowTooltip>\n </Styled.TooltipWrapper>\n ))}\n </Styled.CalendarBody>\n </FlexView>\n </FlexView>\n );\n};\n\nexport default memo(Attendance);\n"],"names":["Attendance","calendarData","reportMonth","reportYear","onDateClick","attendanceStats","useMemo","attendanceStatsText","calendarGrid","generateCalendarGrid","hasClasses","dayClasses","FlexView","jsx","Text","Separator","jsxs","Styled.CalendarHeader","dayLetter","Styled.CalendarBody","day","index","Styled.TooltipWrapper","getSnackbarMsg","ArrowTooltip","IS_APP_RUNNING_IN_RN","MONTH_NAMES","classEvent","getStatusText","Styled.CalendarDay","Fragment","Styled.StatusSymbol","Attendance$1","memo"],"mappings":";;;;;;;;;;AAiBA,MAAMA,IAAmC,CAAC;AAAA,EACxC,cAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AACF,MAAM;AACJ,QAAMC,IAAkBC;AAAA,IACtB,MAAM,CAAC,CAACL,KAAgBM,EAAoBN,CAAY;AAAA,IACxD,CAACA,CAAY;AAAA,EAAA,GAETO,IAAeF;AAAA,IACnB,MAAM,CAAC,CAACL,KAAgBQ,EAAqBR,GAAcC,GAAaC,CAAU;AAAA,IAClF,CAACF,GAAcC,GAAaC,CAAU;AAAA,EAAA,GAGlCO,IAAaJ,EAAQ,MACpBL,IAEE,OAAO,OAAOA,CAAY,EAAE,KAAK,CAAcU,MAAAA,EAAW,SAAS,CAAC,IAFjD,IAGzB,CAACV,CAAY,CAAC;AAEb,SAAA,CAACA,KAAgB,OAAO,KAAKA,CAAY,EAAE,WAAW,KAAK,CAACS,KAAc,CAACF,IACtE,yBAINI,GACC,EAAA,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAK,EAAA,WAAU,YAAW,QAAO,WAAU,UAE5C,cAAA;AAAA,sBACCA,GAAK,EAAA,WAAU,YAAW,QAAO,cAC/B,UACHT,GAAA;AAAA,IACA,gBAAAQ,EAACE,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,IACvB,gBAAAC,EAACJ,GAAS,EAAA,cAAa,WACrB,UAAA;AAAA,MAAA,gBAAAC,EAACI,GAAA,EACE,YAAgB,YAAY,IAAI,OAC9B,gBAAAJ,EAAAC,GAAA,EAAK,QAAO,UAAS,WAAU,OAAM,QAAO,c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,oBACA,gBAAAD,EAACkB,GAAA,EACE,WAAC,CAACX,EAAI,gBAAgBA,EAAI,cAC7B;AAAA,kBAAA,GACF;AAAA,gBAAA;AAAA,cAEJ;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,QAhDKA,IAAM,OAAOA,EAAI,IAAI,KAAK,SAASC,CAAK;AAAA,MAkDhD,CAAA,GACH;AAAA,IAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ,GAEeW,IAAAC,EAAKjC,CAAU;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import r from "styled-components";
|
|
2
|
+
import t from "../../../../ui/layout/flex-view.js";
|
|
3
|
+
const e = r.div`
|
|
4
|
+
display: grid;
|
|
5
|
+
grid-template-columns: repeat(7, 1fr);
|
|
6
|
+
padding: 4px 0;
|
|
7
|
+
background-color: ${({ theme: o }) => o.colors.WHITE_2};
|
|
8
|
+
border-bottom: 1px solid ${({ theme: o }) => o.colors.WHITE_5};
|
|
9
|
+
`, l = r.div`
|
|
10
|
+
display: grid;
|
|
11
|
+
grid-template-columns: repeat(7, 1fr);
|
|
12
|
+
gap: 0;
|
|
13
|
+
`, p = r(t)`
|
|
14
|
+
position: relative;
|
|
15
|
+
aspect-ratio: 1;
|
|
16
|
+
border-right: 1px solid ${({ theme: o }) => o.colors.WHITE_5};
|
|
17
|
+
border-bottom: 1px solid ${({ theme: o }) => o.colors.WHITE_5};
|
|
18
|
+
|
|
19
|
+
&:nth-child(7n) {
|
|
20
|
+
border-right: none;
|
|
21
|
+
}
|
|
22
|
+
`, a = r.div`
|
|
23
|
+
position: absolute;
|
|
24
|
+
top: ${({ $top: o }) => o || "2px"};
|
|
25
|
+
right: ${({ $right: o }) => o || "2px"};
|
|
26
|
+
`, s = r.div`
|
|
27
|
+
> div {
|
|
28
|
+
width: 100%;
|
|
29
|
+
height: 100%;
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
export {
|
|
33
|
+
l as CalendarBody,
|
|
34
|
+
p as CalendarDay,
|
|
35
|
+
e as CalendarHeader,
|
|
36
|
+
a as StatusSymbol,
|
|
37
|
+
s as TooltipWrapper
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=attendance.styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attendance.styled.js","sources":["../../../../../../src/features/timeline/monthly-report/comps/attendance/attendance.styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../../ui/layout/flex-view';\n\nexport const CalendarHeader = styled.div`\n display: grid;\n grid-template-columns: repeat(7, 1fr);\n padding: 4px 0;\n background-color: ${({ theme }) => theme.colors.WHITE_2};\n border-bottom: 1px solid ${({ theme }) => theme.colors.WHITE_5};\n`;\n\nexport const CalendarBody = styled.div`\n display: grid;\n grid-template-columns: repeat(7, 1fr);\n gap: 0;\n`;\n\nexport const CalendarDay = styled(FlexView)`\n position: relative;\n aspect-ratio: 1;\n border-right: 1px solid ${({ theme }) => theme.colors.WHITE_5};\n border-bottom: 1px solid ${({ theme }) => theme.colors.WHITE_5};\n\n &:nth-child(7n) {\n border-right: none;\n }\n`;\n\nexport const StatusSymbol = styled.div<{ $top?: string; $right?: string }>`\n position: absolute;\n top: ${({ $top }) => $top || '2px'};\n right: ${({ $right }) => $right || '2px'};\n`;\n\nexport const TooltipWrapper = styled.div`\n > div {\n width: 100%;\n height: 100%;\n }\n`;\n"],"names":["CalendarHeader","styled","theme","CalendarBody","CalendarDay","FlexView","StatusSymbol","$top","$right","TooltipWrapper"],"mappings":";;AAIO,MAAMA,IAAiBC,EAAO;AAAA;AAAA;AAAA;AAAA,sBAIf,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA,6BAC5B,CAAC,EAAE,OAAAA,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA,GAGnDC,IAAeF,EAAO;AAAA;AAAA;AAAA;AAAA,GAMtBG,IAAcH,EAAOI,CAAQ;AAAA;AAAA;AAAA,4BAGd,CAAC,EAAE,OAAAH,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA,6BAClC,CAAC,EAAE,OAAAA,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOnDI,IAAeL,EAAO;AAAA;AAAA,SAE1B,CAAC,EAAE,MAAAM,QAAWA,KAAQ,KAAK;AAAA,WACzB,CAAC,EAAE,QAAAC,QAAaA,KAAU,KAAK;AAAA,GAG7BC,IAAiBR,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import o from "../../../../ui/layout/flex-view.js";
|
|
3
|
+
import k from "../../../../ui/text/text.js";
|
|
4
|
+
import { ILLUSTRATIONS as d } from "../../../../../assets/illustrations/illustrations.js";
|
|
5
|
+
import g from "../../../../ui/image/image.js";
|
|
6
|
+
import f from "../../../../ui/buttons/clickable/clickable.js";
|
|
7
|
+
import { useMonthlyReportPatch as w } from "../../api/use-monthly-report-get.js";
|
|
8
|
+
import { memo as y, useCallback as n } from "react";
|
|
9
|
+
import $ from "../../../../ui/separator/separator.js";
|
|
10
|
+
const P = ({
|
|
11
|
+
reportId: s,
|
|
12
|
+
studentName: b,
|
|
13
|
+
onFeedback: l,
|
|
14
|
+
studentCourseId: h,
|
|
15
|
+
showSnackbar: a
|
|
16
|
+
}) => {
|
|
17
|
+
const u = n(
|
|
18
|
+
(r, i) => {
|
|
19
|
+
r && a && a({
|
|
20
|
+
type: "error",
|
|
21
|
+
message: "Something went wrong. Please try again.",
|
|
22
|
+
bgColor: "red"
|
|
23
|
+
}), !r && l && (i != null && i.feedback) && l(i.feedback, h);
|
|
24
|
+
},
|
|
25
|
+
[l, h]
|
|
26
|
+
), { patch: m, isProcessing: p } = w({
|
|
27
|
+
onComplete: u
|
|
28
|
+
}), t = n(
|
|
29
|
+
(r) => {
|
|
30
|
+
m(s, { feedback: r });
|
|
31
|
+
},
|
|
32
|
+
[s, m]
|
|
33
|
+
), C = n(() => {
|
|
34
|
+
t("positive");
|
|
35
|
+
}, [t]), X = n(() => {
|
|
36
|
+
t("negative");
|
|
37
|
+
}, [t]);
|
|
38
|
+
return /* @__PURE__ */ c(o, { $gapX: 1.25, children: [
|
|
39
|
+
/* @__PURE__ */ c(k, { $renderAs: "ab2-black", $color: "BLACK_1", children: [
|
|
40
|
+
"Are you happy with ",
|
|
41
|
+
b ?? "her",
|
|
42
|
+
" progress?"
|
|
43
|
+
] }),
|
|
44
|
+
/* @__PURE__ */ e($, { heightX: 1.5 }),
|
|
45
|
+
/* @__PURE__ */ c(o, { $flexDirection: "row", $flexGapX: 3, $alignItems: "center", $justifyContent: "center", children: [
|
|
46
|
+
/* @__PURE__ */ e(
|
|
47
|
+
f,
|
|
48
|
+
{
|
|
49
|
+
label: "Report thumps up",
|
|
50
|
+
disabled: p,
|
|
51
|
+
onClick: C,
|
|
52
|
+
children: /* @__PURE__ */ e(
|
|
53
|
+
o,
|
|
54
|
+
{
|
|
55
|
+
$widthX: 5,
|
|
56
|
+
$heightX: 5,
|
|
57
|
+
$alignItems: "center",
|
|
58
|
+
$justifyContent: "center",
|
|
59
|
+
$borderRadiusX: 2.5,
|
|
60
|
+
$borderColor: "BLACK_5",
|
|
61
|
+
children: /* @__PURE__ */ e(g, { src: d.THUMPS_UP, alt: "UP", width: 32, height: 32 })
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
/* @__PURE__ */ e(
|
|
67
|
+
f,
|
|
68
|
+
{
|
|
69
|
+
label: "Report thumps down",
|
|
70
|
+
disabled: p,
|
|
71
|
+
onClick: X,
|
|
72
|
+
children: /* @__PURE__ */ e(
|
|
73
|
+
o,
|
|
74
|
+
{
|
|
75
|
+
$widthX: 5,
|
|
76
|
+
$heightX: 5,
|
|
77
|
+
$alignItems: "center",
|
|
78
|
+
$justifyContent: "center",
|
|
79
|
+
$borderRadiusX: 2.5,
|
|
80
|
+
children: /* @__PURE__ */ e(g, { src: d.THUMPS_DOWN, alt: "DOWN", width: 32, height: 32 })
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
] }),
|
|
86
|
+
/* @__PURE__ */ e($, { heightX: 1.5 })
|
|
87
|
+
] });
|
|
88
|
+
}, I = y(P);
|
|
89
|
+
export {
|
|
90
|
+
I as default
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=feedback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback.js","sources":["../../../../../../src/features/timeline/monthly-report/comps/feedback/feedback.tsx"],"sourcesContent":["import FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { ILLUSTRATIONS } from '../../../../../assets/illustrations/illustrations';\nimport Image from '../../../../ui/image/image';\nimport Clickable from '../../../../ui/buttons/clickable/clickable';\nimport { useMonthlyReportPatch } from '../../api/use-monthly-report-get';\nimport { IMonthlyReportResponse, TFeedback } from '../../monthly-report-types';\nimport { memo, useCallback } from 'react';\nimport { IFeedbackTypesProps } from './feedback-types';\nimport Separator from '../../../../ui/separator/separator';\n\nconst Feedback = ({\n reportId,\n studentName,\n onFeedback,\n studentCourseId,\n showSnackbar,\n}: IFeedbackTypesProps) => {\n const onComplete = useCallback(\n (err: string | null, data?: IMonthlyReportResponse) => {\n if (err && showSnackbar) {\n showSnackbar({\n type: 'error',\n message: 'Something went wrong. Please try again.',\n bgColor: 'red',\n });\n }\n\n if (!err && onFeedback && data?.feedback) {\n onFeedback(data.feedback, studentCourseId);\n }\n },\n [onFeedback, studentCourseId],\n );\n\n const { patch: updateMilestone, isProcessing } = useMonthlyReportPatch({\n onComplete,\n });\n\n const handleFeedback = useCallback(\n (feedback: TFeedback) => {\n updateMilestone(reportId, { feedback });\n },\n [reportId, updateMilestone],\n );\n\n const handlePositiveFeedback = useCallback(() => {\n handleFeedback('positive');\n }, [handleFeedback]);\n\n const handleNegativeFeedback = useCallback(() => {\n handleFeedback('negative');\n }, [handleFeedback]);\n\n return (\n <FlexView $gapX={1.25}>\n <Text $renderAs=\"ab2-black\" $color=\"BLACK_1\">\n Are you happy with {studentName ?? 'her'} progress?\n </Text>\n <Separator heightX={1.5} />\n <FlexView $flexDirection=\"row\" $flexGapX={3} $alignItems=\"center\" $justifyContent=\"center\">\n <Clickable\n label=\"Report thumps up\"\n disabled={isProcessing}\n onClick={handlePositiveFeedback}\n >\n <FlexView\n $widthX={5}\n $heightX={5}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $borderRadiusX={2.5}\n $borderColor=\"BLACK_5\"\n >\n <Image src={ILLUSTRATIONS.THUMPS_UP} alt=\"UP\" width={32} height={32} />\n </FlexView>\n </Clickable>\n <Clickable\n label=\"Report thumps down\"\n disabled={isProcessing}\n onClick={handleNegativeFeedback}\n >\n <FlexView\n $widthX={5}\n $heightX={5}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $borderRadiusX={2.5}\n >\n <Image src={ILLUSTRATIONS.THUMPS_DOWN} alt=\"DOWN\" width={32} height={32} />\n </FlexView>\n </Clickable>\n </FlexView>\n <Separator heightX={1.5} />\n </FlexView>\n );\n};\n\nexport default memo(Feedback);\n"],"names":["Feedback","reportId","studentName","onFeedback","studentCourseId","showSnackbar","onComplete","useCallback","err","data","updateMilestone","isProcessing","useMonthlyReportPatch","handleFeedback","feedback","handlePositiveFeedback","handleNegativeFeedback","jsxs","FlexView","Text","jsx","Separator","Clickable","Image","ILLUSTRATIONS","Feedback$1","memo"],"mappings":";;;;;;;;;AAWA,MAAMA,IAAW,CAAC;AAAA,EAChB,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,cAAAC;AACF,MAA2B;AACzB,QAAMC,IAAaC;AAAA,IACjB,CAACC,GAAoBC,MAAkC;AACrD,MAAID,KAAOH,KACIA,EAAA;A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gBAAAE,EAACG,GAAM,EAAA,KAAKC,EAAc,WAAW,KAAI,MAAK,OAAO,IAAI,QAAQ,GAAI,CAAA;AAAA,YAAA;AAAA,UACvE;AAAA,QAAA;AAAA,MACF;AAAA,MACA,gBAAAJ;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,OAAM;AAAA,UACN,UAAUX;AAAA,UACV,SAASK;AAAA,UAET,UAAA,gBAAAI;AAAA,YAACF;AAAA,YAAA;AAAA,cACC,SAAS;AAAA,cACT,UAAU;AAAA,cACV,aAAY;AAAA,cACZ,iBAAgB;AAAA,cAChB,gBAAgB;AAAA,cAEhB,UAAA,gBAAAE,EAACG,GAAM,EAAA,KAAKC,EAAc,aAAa,KAAI,QAAO,OAAO,IAAI,QAAQ,GAAI,CAAA;AAAA,YAAA;AAAA,UAC3E;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,IACA,gBAAAJ,EAACC,GAAU,EAAA,SAAS,IAAK,CAAA;AAAA,EAC3B,EAAA,CAAA;AAEJ,GAEeI,IAAAC,EAAK1B,CAAQ;"}
|
|
@@ -1,47 +1,48 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsxs as o, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import i from "../../../../../ui/text/text.js";
|
|
3
|
+
import c from "../../../../../ui/layout/flex-view.js";
|
|
4
|
+
import f from "../../../../../chapters/chapters-list/chapter-item/chapter-circular-progress/chapter-circular-progress.js";
|
|
5
|
+
import { calculateProgress as p } from "../goals-constants.js";
|
|
6
|
+
const v = ({ chapters: t }) => !t || t.length === 0 ? null : t.map((r, g) => {
|
|
7
|
+
const { completed: u, total: a } = r.progress_stat, { completed: _, total: m } = r.previous_progress_stat || {}, e = p(u, a), d = p(_ || 0, m || 0), s = e - d, l = r.previous_progress_stat && s > 0 && a === m, $ = l ? s : 0;
|
|
8
|
+
return /* @__PURE__ */ o(
|
|
9
|
+
c,
|
|
9
10
|
{
|
|
10
11
|
$flexDirection: "row",
|
|
11
12
|
$flexGapX: 1,
|
|
12
13
|
$gutterX: 1,
|
|
13
14
|
children: [
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
r.image_url && /* @__PURE__ */ n(
|
|
16
|
+
f,
|
|
16
17
|
{
|
|
17
|
-
completionPercentage:
|
|
18
|
-
imageUrl:
|
|
19
|
-
delta:
|
|
18
|
+
completionPercentage: l ? d : e,
|
|
19
|
+
imageUrl: r.image_url,
|
|
20
|
+
delta: $,
|
|
20
21
|
imageWidth: 40,
|
|
21
22
|
iconWidth: 16,
|
|
22
|
-
|
|
23
|
+
deltaProgressColor: "GREEN_5",
|
|
23
24
|
iconColor: "WHITE",
|
|
24
25
|
iconBackgroundColor: "BLACK_1",
|
|
25
26
|
iconPosition: { top: 0, right: 0 }
|
|
26
27
|
}
|
|
27
28
|
),
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
|
|
29
|
+
/* @__PURE__ */ o(c, { children: [
|
|
30
|
+
/* @__PURE__ */ n(i, { $renderAs: "ub2", $color: "BLACK_1", children: r.chapter_name }),
|
|
31
|
+
/* @__PURE__ */ o(c, { $flexDirection: "row", $alignItems: "center", $flexGapX: 0.25, children: [
|
|
32
|
+
/* @__PURE__ */ n(i, { $renderAs: "ub3", $color: "BLACK_T_60", children: e === 100 ? "Completed" : `${e}% completed` }),
|
|
33
|
+
l && e !== 100 && /* @__PURE__ */ o(i, { $renderAs: "ab3", $color: "GREEN_6", children: [
|
|
33
34
|
"(+",
|
|
34
|
-
Math.round(
|
|
35
|
+
Math.round(s),
|
|
35
36
|
"%)"
|
|
36
37
|
] })
|
|
37
38
|
] })
|
|
38
39
|
] })
|
|
39
40
|
]
|
|
40
41
|
},
|
|
41
|
-
`${
|
|
42
|
+
`${r.chapter_name}-${g}`
|
|
42
43
|
);
|
|
43
44
|
});
|
|
44
45
|
export {
|
|
45
|
-
|
|
46
|
+
v as default
|
|
46
47
|
};
|
|
47
48
|
//# sourceMappingURL=goal-chapter-card.js.map
|
package/dist/features/timeline/monthly-report/comps/goals/goals-card/goal-chapter-card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"goal-chapter-card.js","sources":["../../../../../../../src/features/timeline/monthly-report/comps/goals/goals-card/goal-chapter-card.tsx"],"sourcesContent":["import { type FC } from 'react';\n\nimport { type IGoalsCardChaptersProps } from './goals-card-types';\nimport Text from '../../../../../ui/text/text';\nimport FlexView from '../../../../../ui/layout/flex-view';\nimport ChapterCircularProgress from '../../../../../chapters/chapters-list/chapter-item/chapter-circular-progress/chapter-circular-progress';\n\nconst GoalsCardChapters: FC<IGoalsCardChaptersProps> = ({ chapters }) => {\n if (!chapters || chapters.length === 0) {\n return null;\n }\n\n return chapters.map((chapter, i) => {\n const { completed, total } = chapter.progress_stat;\n const { completed: prevCompleted, total: prevTotal } = chapter.previous_progress_stat || {};\n const progress =
|
|
1
|
+
{"version":3,"file":"goal-chapter-card.js","sources":["../../../../../../../src/features/timeline/monthly-report/comps/goals/goals-card/goal-chapter-card.tsx"],"sourcesContent":["import { type FC } from 'react';\n\nimport { type IGoalsCardChaptersProps } from './goals-card-types';\nimport Text from '../../../../../ui/text/text';\nimport FlexView from '../../../../../ui/layout/flex-view';\nimport ChapterCircularProgress from '../../../../../chapters/chapters-list/chapter-item/chapter-circular-progress/chapter-circular-progress';\nimport { calculateProgress } from '../goals-constants';\n\nconst GoalsCardChapters: FC<IGoalsCardChaptersProps> = ({ chapters }) => {\n if (!chapters || chapters.length === 0) {\n return null;\n }\n\n return chapters.map((chapter, i) => {\n const { completed, total } = chapter.progress_stat;\n const { completed: prevCompleted, total: prevTotal } = chapter.previous_progress_stat || {};\n const progress = calculateProgress(completed, total);\n const previousProgress = calculateProgress(prevCompleted || 0, prevTotal || 0);\n const progressDifference = progress - previousProgress;\n const showDelta =\n chapter.previous_progress_stat && progressDifference > 0 && total === prevTotal;\n const delta = showDelta ? progressDifference : 0;\n\n return (\n <FlexView\n $flexDirection=\"row\"\n $flexGapX={1}\n $gutterX={1}\n key={`${chapter.chapter_name}-${i}`}\n >\n {chapter.image_url && (\n <ChapterCircularProgress\n completionPercentage={showDelta ? previousProgress : progress}\n imageUrl={chapter.image_url}\n delta={delta}\n imageWidth={40}\n iconWidth={16}\n deltaProgressColor=\"GREEN_5\"\n iconColor=\"WHITE\"\n iconBackgroundColor=\"BLACK_1\"\n iconPosition={{ top: 0, right: 0 }}\n />\n )}\n <FlexView>\n <Text $renderAs=\"ub2\" $color=\"BLACK_1\">\n {chapter.chapter_name}\n </Text>\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGapX={0.25}>\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {progress === 100 ? 'Completed' : `${progress}% completed`}\n </Text>\n {showDelta && progress !== 100 && (\n <Text $renderAs=\"ab3\" $color=\"GREEN_6\">\n (+{Math.round(progressDifference)}%)\n </Text>\n )}\n </FlexView>\n </FlexView>\n </FlexView>\n );\n });\n};\n\nexport default GoalsCardChapters;\n"],"names":["GoalsCardChapters","chapters","chapter","i","completed","total","prevCompleted","prevTotal","progress","calculateProgress","previousProgress","progressDifference","showDelta","delta","jsxs","FlexView","jsx","ChapterCircularProgress","Text"],"mappings":";;;;;AAQA,MAAMA,IAAiD,CAAC,EAAE,UAAAC,QACpD,CAACA,KAAYA,EAAS,WAAW,IAC5B,OAGFA,EAAS,IAAI,CAACC,GAASC,MAAM;AAClC,QAAM,EAAE,WAAAC,GAAW,OAAAC,MAAUH,EAAQ,eAC/B,EAAE,WAAWI,GAAe,OAAOC,MAAcL,EAAQ,0BAA0B,IACnFM,IAAWC,EAAkBL,GAAWC,CAAK,GAC7CK,IAAmBD,EAAkBH,KAAiB,GAAGC,KAAa,CAAC,GACvEI,IAAqBH,IAAWE,GAChCE,IACJV,EAAQ,0BAA0BS,IAAqB,KAAKN,MAAUE,GAClEM,IAAQD,IAAYD,IAAqB;AAG7C,SAAA,gBAAAG;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,gBAAe;AAAA,MACf,WAAW;AAAA,MACX,UAAU;AAAA,MAGT,UAAA;AAAA,QAAAb,EAAQ,aACP,gBAAAc;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,sBAAsBL,IAAYF,IAAmBF;AAAA,YACrD,UAAUN,EAAQ;AAAA,YAClB,OAAAW;AAAA,YACA,YAAY;AAAA,YACZ,WAAW;AAAA,YACX,oBAAmB;AAAA,YACnB,WAAU;AAAA,YACV,qBAAoB;AAAA,YACpB,cAAc,EAAE,KAAK,GAAG,OAAO,EAAE;AAAA,UAAA;AAAA,QACnC;AAAA,0BAEDE,GACC,EAAA,UAAA;AAAA,UAAA,gBAAAC,EAACE,KAAK,WAAU,OAAM,QAAO,WAC1B,YAAQ,cACX;AAAA,4BACCH,GAAS,EAAA,gBAAe,OAAM,aAAY,UAAS,WAAW,MAC7D,UAAA;AAAA,YAAC,gBAAAC,EAAAE,GAAA,EAAK,WAAU,OAAM,QAAO,cAC1B,gBAAa,MAAM,cAAc,GAAGV,CAAQ,cAC/C,CAAA;AAAA,YACCI,KAAaJ,MAAa,OACzB,gBAAAM,EAACI,KAAK,WAAU,OAAM,QAAO,WAAU,UAAA;AAAA,cAAA;AAAA,cAClC,KAAK,MAAMP,CAAkB;AAAA,cAAE;AAAA,YAAA,GACpC;AAAA,UAAA,GAEJ;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,IA7BK,GAAGT,EAAQ,YAAY,IAAIC,CAAC;AAAA,EAAA;AA8BnC,CAEH;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"goals-card
|
|
1
|
+
{"version":3,"file":"goals-card-styled.js","sources":["../../../../../../../src/features/timeline/monthly-report/comps/goals/goals-card/goals-card-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../../../ui/layout/flex-view';\n\nexport const ProgressBarContainer = styled(FlexView)`\n position: absolute;\n bottom: 0px;\n left: 0;\n right: 0;\n`;\n\nexport const ChaptersContainer = styled(FlexView)`\n border-top: none;\n`;\n\nexport const TagContainer = styled(FlexView)`\n position: relative;\n &::after {\n content: '';\n position: absolute;\n height: 12px;\n width: 20px;\n left: 10px;\n top: -8px;\n clip-path: polygon(50% 0%, 0% 100%, 100% 100%);\n background-color: ${({ theme, $background }) => theme.colors[$background ?? 'WHITE_1']};\n }\n`;\n"],"names":["ProgressBarContainer","styled","FlexView","ChaptersContainer","TagContainer","theme","$background"],"mappings":";;AAIa,MAAAA,IAAuBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,GAOtCC,IAAoBF,EAAOC,CAAQ;AAAA;AAAA,GAInCE,IAAeH,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAUnB,CAAC,EAAE,OAAAG,GAAO,aAAAC,QAAkBD,EAAM,OAAOC,KAAe,SAAS,CAAC;AAAA;AAAA;"}
|