analytica-frontend-lib 1.2.50 → 1.2.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/ActivityCardQuestionBanks/index.css +12 -0
  2. package/dist/ActivityCardQuestionBanks/index.css.map +1 -1
  3. package/dist/ActivityCardQuestionPreview/index.css +12 -0
  4. package/dist/ActivityCardQuestionPreview/index.css.map +1 -1
  5. package/dist/ActivityDetails/index.css +12 -0
  6. package/dist/ActivityDetails/index.css.map +1 -1
  7. package/dist/ActivityFilters/index.css +12 -0
  8. package/dist/ActivityFilters/index.css.map +1 -1
  9. package/dist/ActivityPreview/index.css +12 -0
  10. package/dist/ActivityPreview/index.css.map +1 -1
  11. package/dist/AlertManager/index.css +12 -0
  12. package/dist/AlertManager/index.css.map +1 -1
  13. package/dist/RecommendedLessonDetails/index.d.ts +2 -1
  14. package/dist/RecommendedLessonDetails/index.d.ts.map +1 -1
  15. package/dist/RecommendedLessonDetails/index.js +2632 -28
  16. package/dist/RecommendedLessonDetails/index.js.map +1 -1
  17. package/dist/RecommendedLessonDetails/index.mjs +2668 -38
  18. package/dist/RecommendedLessonDetails/index.mjs.map +1 -1
  19. package/dist/RecommendedLessonsHistory/index.css +12 -0
  20. package/dist/RecommendedLessonsHistory/index.css.map +1 -1
  21. package/dist/SendActivityModal/SendActivityModal.css +12 -0
  22. package/dist/SendActivityModal/SendActivityModal.css.map +1 -1
  23. package/dist/SendActivityModal/index.css +12 -0
  24. package/dist/SendActivityModal/index.css.map +1 -1
  25. package/dist/TableProvider/index.css +12 -0
  26. package/dist/TableProvider/index.css.map +1 -1
  27. package/dist/index.css +12 -0
  28. package/dist/index.css.map +1 -1
  29. package/dist/index.d.ts +2 -2
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +300 -18
  32. package/dist/index.js.map +1 -1
  33. package/dist/index.mjs +301 -14
  34. package/dist/index.mjs.map +1 -1
  35. package/dist/styles.css +12 -0
  36. package/dist/styles.css.map +1 -1
  37. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -23125,7 +23125,7 @@ var RecommendedLessonsHistory = ({
23125
23125
  };
23126
23126
 
23127
23127
  // src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
23128
- import { useMemo as useMemo26 } from "react";
23128
+ import { useMemo as useMemo27 } from "react";
23129
23129
 
23130
23130
  // src/components/RecommendedLessonDetails/components/Breadcrumb.tsx
23131
23131
  import { CaretRightIcon as CaretRightIcon2 } from "@phosphor-icons/react";
@@ -23442,6 +23442,16 @@ var StudentsTable = ({
23442
23442
  ] }) });
23443
23443
  };
23444
23444
 
23445
+ // src/components/RecommendedLessonDetails/components/StudentPerformanceModal.tsx
23446
+ import { useMemo as useMemo26 } from "react";
23447
+ import {
23448
+ LightbulbFilamentIcon,
23449
+ WarningCircleIcon as WarningCircleIcon2,
23450
+ UserIcon as UserIcon2,
23451
+ CheckCircleIcon,
23452
+ XCircleIcon
23453
+ } from "@phosphor-icons/react";
23454
+
23445
23455
  // src/components/RecommendedLessonDetails/types.ts
23446
23456
  var DEFAULT_LABELS = {
23447
23457
  viewLesson: "Ver aula",
@@ -23455,9 +23465,285 @@ var DEFAULT_LABELS = {
23455
23465
  completionColumn: "Conclus\xE3o",
23456
23466
  durationColumn: "Dura\xE7\xE3o"
23457
23467
  };
23468
+ var DEFAULT_PERFORMANCE_LABELS = {
23469
+ title: "Desempenho",
23470
+ correctAnswersLabel: "N\xB0 DE QUEST\xD5ES CORRETAS",
23471
+ incorrectAnswersLabel: "N\xB0 DE QUEST\xD5ES INCORRETAS",
23472
+ bestResultLabel: "MELHOR RESULTADO",
23473
+ hardestTopicLabel: "MAIOR DIFICULDADE",
23474
+ lessonsTitle: "Aulas"
23475
+ };
23458
23476
 
23459
- // src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
23477
+ // src/components/RecommendedLessonDetails/components/StudentPerformanceModal.tsx
23460
23478
  import { jsx as jsx93, jsxs as jsxs76 } from "react/jsx-runtime";
23479
+ var PerformanceCard = ({
23480
+ icon,
23481
+ label,
23482
+ value,
23483
+ secondaryLabel,
23484
+ secondaryValue,
23485
+ variant
23486
+ }) => {
23487
+ const headerBgColor = {
23488
+ success: "bg-success-200",
23489
+ error: "bg-error-100"
23490
+ }[variant];
23491
+ const valueColor = {
23492
+ success: "text-success-700",
23493
+ error: "text-error-700"
23494
+ }[variant];
23495
+ const iconBgColor = {
23496
+ success: "bg-warning-300",
23497
+ error: "bg-error-300"
23498
+ }[variant];
23499
+ const secondaryLabelColor = {
23500
+ success: "text-success-600",
23501
+ error: "text-error-600"
23502
+ }[variant];
23503
+ return /* @__PURE__ */ jsxs76("div", { className: "flex flex-col rounded-xl border border-border-50 bg-background overflow-hidden", children: [
23504
+ /* @__PURE__ */ jsxs76(
23505
+ "div",
23506
+ {
23507
+ className: `flex flex-col items-center justify-center p-4 gap-1 ${headerBgColor}`,
23508
+ children: [
23509
+ /* @__PURE__ */ jsx93(
23510
+ Text_default,
23511
+ {
23512
+ as: "span",
23513
+ className: `size-8 rounded-full flex items-center justify-center ${iconBgColor}`,
23514
+ children: icon
23515
+ }
23516
+ ),
23517
+ /* @__PURE__ */ jsx93(
23518
+ Text_default,
23519
+ {
23520
+ size: "2xs",
23521
+ weight: "medium",
23522
+ className: "text-text-800 uppercase text-center leading-none",
23523
+ children: label
23524
+ }
23525
+ ),
23526
+ /* @__PURE__ */ jsx93(Text_default, { size: "xl", weight: "bold", className: `${valueColor} text-center`, children: value })
23527
+ ]
23528
+ }
23529
+ ),
23530
+ /* @__PURE__ */ jsxs76("div", { className: "flex flex-col items-center gap-2 px-4 py-3", children: [
23531
+ /* @__PURE__ */ jsx93(
23532
+ Text_default,
23533
+ {
23534
+ size: "2xs",
23535
+ weight: "medium",
23536
+ className: `${secondaryLabelColor} uppercase text-center`,
23537
+ children: secondaryLabel
23538
+ }
23539
+ ),
23540
+ /* @__PURE__ */ jsx93(Badge_default, { size: "large", action: "info", children: secondaryValue || "-" })
23541
+ ] })
23542
+ ] });
23543
+ };
23544
+ var getAlternativeStatus = (isCorrect, isSelected) => {
23545
+ if (isCorrect) {
23546
+ return "correct";
23547
+ }
23548
+ if (isSelected) {
23549
+ return "incorrect";
23550
+ }
23551
+ return void 0;
23552
+ };
23553
+ var mapAlternatives = (question) => {
23554
+ return question.alternatives.map((alt) => ({
23555
+ value: alt.id,
23556
+ label: alt.text,
23557
+ status: getAlternativeStatus(alt.isCorrect, alt.isSelected)
23558
+ }));
23559
+ };
23560
+ var getSelectedValue = (question) => {
23561
+ const selected = question.alternatives.find((alt) => alt.isSelected);
23562
+ return selected?.id;
23563
+ };
23564
+ var QuestionAccordionItem = ({
23565
+ question,
23566
+ index
23567
+ }) => /* @__PURE__ */ jsx93(
23568
+ CardAccordation,
23569
+ {
23570
+ value: question.id,
23571
+ className: "bg-background rounded-xl border border-border-50",
23572
+ triggerClassName: "py-5 px-5",
23573
+ contentClassName: "px-5 pb-5",
23574
+ trigger: /* @__PURE__ */ jsxs76("div", { className: "flex items-center justify-between flex-1", children: [
23575
+ /* @__PURE__ */ jsxs76(Text_default, { size: "sm", weight: "semibold", className: "text-text-950", children: [
23576
+ "Quest\xE3o ",
23577
+ index + 1
23578
+ ] }),
23579
+ /* @__PURE__ */ jsx93(
23580
+ Badge_default,
23581
+ {
23582
+ size: "small",
23583
+ action: question.isCorrect ? "success" : "error",
23584
+ variant: "solid",
23585
+ iconLeft: question.isCorrect ? /* @__PURE__ */ jsx93(CheckCircleIcon, {}) : /* @__PURE__ */ jsx93(XCircleIcon, {}),
23586
+ children: question.isCorrect ? "Correta" : "Incorreta"
23587
+ }
23588
+ )
23589
+ ] }),
23590
+ children: /* @__PURE__ */ jsxs76("div", { className: "flex flex-col gap-3", children: [
23591
+ /* @__PURE__ */ jsx93(Text_default, { size: "sm", className: "text-text-700", children: question.statement }),
23592
+ /* @__PURE__ */ jsx93(
23593
+ CardAccordation,
23594
+ {
23595
+ value: `${question.id}-alternatives`,
23596
+ className: "bg-background rounded-lg border border-border-50",
23597
+ triggerClassName: "py-5 px-5",
23598
+ contentClassName: "px-5 py-5",
23599
+ trigger: /* @__PURE__ */ jsx93(Text_default, { size: "sm", weight: "medium", className: "text-text-800", children: "Alternativas" }),
23600
+ children: /* @__PURE__ */ jsx93(
23601
+ AlternativesList,
23602
+ {
23603
+ mode: "readonly",
23604
+ alternatives: mapAlternatives(question),
23605
+ selectedValue: getSelectedValue(question),
23606
+ layout: "default"
23607
+ }
23608
+ )
23609
+ }
23610
+ )
23611
+ ] })
23612
+ }
23613
+ );
23614
+ var LessonAccordionItem = ({ lesson }) => /* @__PURE__ */ jsx93(
23615
+ CardAccordation,
23616
+ {
23617
+ value: lesson.id,
23618
+ className: "bg-background rounded-xl border border-border-50",
23619
+ triggerClassName: "py-5 px-5",
23620
+ contentClassName: "px-5 pb-5",
23621
+ trigger: /* @__PURE__ */ jsxs76("div", { className: "flex flex-col gap-1 flex-1", children: [
23622
+ /* @__PURE__ */ jsx93(Text_default, { size: "sm", weight: "semibold", className: "text-text-950", children: lesson.title }),
23623
+ /* @__PURE__ */ jsx93(
23624
+ ProgressBar_default,
23625
+ {
23626
+ value: lesson.progress,
23627
+ variant: "blue",
23628
+ size: "medium",
23629
+ showPercentage: true,
23630
+ layout: "default"
23631
+ }
23632
+ )
23633
+ ] }),
23634
+ children: /* @__PURE__ */ jsx93("div", { className: "flex flex-col gap-2", children: lesson.questions.map((question, index) => /* @__PURE__ */ jsx93(
23635
+ QuestionAccordionItem,
23636
+ {
23637
+ question,
23638
+ index
23639
+ },
23640
+ question.id
23641
+ )) })
23642
+ }
23643
+ );
23644
+ var LoadingSkeleton2 = () => /* @__PURE__ */ jsxs76("div", { className: "flex flex-col gap-4 animate-pulse", children: [
23645
+ /* @__PURE__ */ jsx93("div", { className: "h-6 bg-background-200 rounded w-48" }),
23646
+ /* @__PURE__ */ jsxs76("div", { className: "grid grid-cols-2 gap-3", children: [
23647
+ /* @__PURE__ */ jsx93("div", { className: "h-44 bg-background-200 rounded-xl" }),
23648
+ /* @__PURE__ */ jsx93("div", { className: "h-44 bg-background-200 rounded-xl" })
23649
+ ] })
23650
+ ] });
23651
+ var PerformanceContent = ({
23652
+ data,
23653
+ labels
23654
+ }) => /* @__PURE__ */ jsxs76("div", { className: "flex flex-col gap-5", children: [
23655
+ /* @__PURE__ */ jsxs76("div", { className: "flex items-center gap-2", children: [
23656
+ /* @__PURE__ */ jsx93(
23657
+ Text_default,
23658
+ {
23659
+ as: "span",
23660
+ className: "size-8 rounded-full bg-background-100 flex items-center justify-center",
23661
+ children: /* @__PURE__ */ jsx93(UserIcon2, { size: 16, className: "text-text-500" })
23662
+ }
23663
+ ),
23664
+ /* @__PURE__ */ jsx93(Text_default, { size: "md", weight: "medium", className: "text-text-950", children: data.studentName })
23665
+ ] }),
23666
+ /* @__PURE__ */ jsxs76("div", { className: "grid grid-cols-2 gap-3", children: [
23667
+ /* @__PURE__ */ jsx93(
23668
+ PerformanceCard,
23669
+ {
23670
+ icon: /* @__PURE__ */ jsx93(
23671
+ LightbulbFilamentIcon,
23672
+ {
23673
+ size: 18,
23674
+ weight: "fill",
23675
+ className: "text-white"
23676
+ }
23677
+ ),
23678
+ label: labels.correctAnswersLabel,
23679
+ value: data.correctAnswers,
23680
+ secondaryLabel: labels.bestResultLabel,
23681
+ secondaryValue: data.bestResult,
23682
+ variant: "success"
23683
+ }
23684
+ ),
23685
+ /* @__PURE__ */ jsx93(
23686
+ PerformanceCard,
23687
+ {
23688
+ icon: /* @__PURE__ */ jsx93(
23689
+ WarningCircleIcon2,
23690
+ {
23691
+ size: 18,
23692
+ weight: "fill",
23693
+ className: "text-error-700"
23694
+ }
23695
+ ),
23696
+ label: labels.incorrectAnswersLabel,
23697
+ value: data.incorrectAnswers,
23698
+ secondaryLabel: labels.hardestTopicLabel,
23699
+ secondaryValue: data.hardestTopic,
23700
+ variant: "error"
23701
+ }
23702
+ )
23703
+ ] }),
23704
+ data.lessons.length > 0 && /* @__PURE__ */ jsxs76("div", { className: "flex flex-col gap-3", children: [
23705
+ /* @__PURE__ */ jsx93(Text_default, { size: "md", weight: "semibold", className: "text-text-950", children: labels.lessonsTitle }),
23706
+ /* @__PURE__ */ jsx93("div", { className: "flex flex-col gap-2", children: data.lessons.map((lesson) => /* @__PURE__ */ jsx93(LessonAccordionItem, { lesson }, lesson.id)) })
23707
+ ] })
23708
+ ] });
23709
+ var renderModalContent = (loading, data, labels) => {
23710
+ if (loading) {
23711
+ return /* @__PURE__ */ jsx93(LoadingSkeleton2, {});
23712
+ }
23713
+ if (data) {
23714
+ return /* @__PURE__ */ jsx93(PerformanceContent, { data, labels });
23715
+ }
23716
+ return null;
23717
+ };
23718
+ var StudentPerformanceModal = ({
23719
+ isOpen,
23720
+ onClose,
23721
+ data,
23722
+ loading = false,
23723
+ labels: customLabels
23724
+ }) => {
23725
+ const labels = useMemo26(
23726
+ () => ({ ...DEFAULT_PERFORMANCE_LABELS, ...customLabels }),
23727
+ [customLabels]
23728
+ );
23729
+ if (!data && !loading) {
23730
+ return null;
23731
+ }
23732
+ return /* @__PURE__ */ jsx93(
23733
+ Modal_default,
23734
+ {
23735
+ isOpen,
23736
+ onClose,
23737
+ title: labels.title,
23738
+ size: "lg",
23739
+ contentClassName: "max-h-[70vh] overflow-y-auto",
23740
+ children: renderModalContent(loading, data, labels)
23741
+ }
23742
+ );
23743
+ };
23744
+
23745
+ // src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
23746
+ import { jsx as jsx94, jsxs as jsxs77 } from "react/jsx-runtime";
23461
23747
  var RecommendedLessonDetails = ({
23462
23748
  data,
23463
23749
  loading = false,
@@ -23470,11 +23756,11 @@ var RecommendedLessonDetails = ({
23470
23756
  labels: customLabels,
23471
23757
  className
23472
23758
  }) => {
23473
- const labels = useMemo26(
23759
+ const labels = useMemo27(
23474
23760
  () => ({ ...DEFAULT_LABELS, ...customLabels }),
23475
23761
  [customLabels]
23476
23762
  );
23477
- const defaultBreadcrumbs = useMemo26(
23763
+ const defaultBreadcrumbs = useMemo27(
23478
23764
  () => [
23479
23765
  { label: "Aulas recomendadas", path: "/aulas-recomendadas" },
23480
23766
  { label: data?.goal.title || "Detalhes" }
@@ -23482,7 +23768,7 @@ var RecommendedLessonDetails = ({
23482
23768
  [data?.goal.title]
23483
23769
  );
23484
23770
  const breadcrumbItems = breadcrumbs || defaultBreadcrumbs;
23485
- const displayStudents = useMemo26(() => {
23771
+ const displayStudents = useMemo27(() => {
23486
23772
  if (!data?.details.students) return [];
23487
23773
  const deadline = data?.goal.finalDate;
23488
23774
  return data.details.students.map(
@@ -23490,17 +23776,17 @@ var RecommendedLessonDetails = ({
23490
23776
  );
23491
23777
  }, [data?.details.students, data?.goal.finalDate]);
23492
23778
  if (loading) {
23493
- return /* @__PURE__ */ jsx93(
23779
+ return /* @__PURE__ */ jsx94(
23494
23780
  "div",
23495
23781
  {
23496
23782
  className: cn("flex flex-col gap-6", className),
23497
23783
  "data-testid": "lesson-details-loading",
23498
- children: /* @__PURE__ */ jsx93(LoadingSkeleton, {})
23784
+ children: /* @__PURE__ */ jsx94(LoadingSkeleton, {})
23499
23785
  }
23500
23786
  );
23501
23787
  }
23502
23788
  if (error) {
23503
- return /* @__PURE__ */ jsx93(
23789
+ return /* @__PURE__ */ jsx94(
23504
23790
  "div",
23505
23791
  {
23506
23792
  className: cn(
@@ -23508,21 +23794,21 @@ var RecommendedLessonDetails = ({
23508
23794
  className
23509
23795
  ),
23510
23796
  "data-testid": "lesson-details-error",
23511
- children: /* @__PURE__ */ jsx93(Text_default, { size: "md", className: "text-error-700", children: error })
23797
+ children: /* @__PURE__ */ jsx94(Text_default, { size: "md", className: "text-error-700", children: error })
23512
23798
  }
23513
23799
  );
23514
23800
  }
23515
23801
  if (!data) {
23516
23802
  return null;
23517
23803
  }
23518
- return /* @__PURE__ */ jsxs76(
23804
+ return /* @__PURE__ */ jsxs77(
23519
23805
  "div",
23520
23806
  {
23521
23807
  className: cn("flex flex-col gap-6", className),
23522
23808
  "data-testid": "recommended-lesson-details",
23523
23809
  children: [
23524
- /* @__PURE__ */ jsx93(Breadcrumb, { items: breadcrumbItems, onItemClick: onBreadcrumbClick }),
23525
- /* @__PURE__ */ jsx93(
23810
+ /* @__PURE__ */ jsx94(Breadcrumb, { items: breadcrumbItems, onItemClick: onBreadcrumbClick }),
23811
+ /* @__PURE__ */ jsx94(
23526
23812
  LessonHeader,
23527
23813
  {
23528
23814
  data,
@@ -23531,8 +23817,8 @@ var RecommendedLessonDetails = ({
23531
23817
  viewLessonLabel: labels.viewLesson
23532
23818
  }
23533
23819
  ),
23534
- /* @__PURE__ */ jsx93(ResultsSection, { data, labels }),
23535
- /* @__PURE__ */ jsx93(
23820
+ /* @__PURE__ */ jsx94(ResultsSection, { data, labels }),
23821
+ /* @__PURE__ */ jsx94(
23536
23822
  StudentsTable,
23537
23823
  {
23538
23824
  students: displayStudents,
@@ -23849,6 +24135,7 @@ export {
23849
24135
  StatisticsCard,
23850
24136
  Stepper_default as Stepper,
23851
24137
  StudentLessonStatus,
24138
+ StudentPerformanceModal,
23852
24139
  SubjectEnum,
23853
24140
  SubjectInfo,
23854
24141
  Support_default as Support,