analytica-frontend-lib 1.1.4 → 1.1.6

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.
@@ -977,6 +977,7 @@ var useQuizStore = create2()(
977
977
  isStarted: false,
978
978
  isFinished: false,
979
979
  userId: "",
980
+ variant: "default",
980
981
  // Setters
981
982
  setBySimulated: (simulado) => set({ bySimulated: simulado }),
982
983
  setByActivity: (atividade) => set({ byActivity: atividade }),
@@ -984,6 +985,7 @@ var useQuizStore = create2()(
984
985
  setUserId: (userId) => set({ userId }),
985
986
  setUserAnswers: (userAnswers) => set({ userAnswers }),
986
987
  getUserId: () => get().userId,
988
+ setVariant: (variant) => set({ variant }),
987
989
  // Navigation
988
990
  goToNextQuestion: () => {
989
991
  const { currentQuestionIndex, getTotalQuestions } = get();
@@ -4526,7 +4528,11 @@ var getStatusStyles = (variantCorrect) => {
4526
4528
  return "bg-error-background border-error-300";
4527
4529
  }
4528
4530
  };
4529
- var Quiz = forwardRef10(({ children, className, ...props }, ref) => {
4531
+ var Quiz = forwardRef10(({ children, className, variant = "default", ...props }, ref) => {
4532
+ const { setVariant } = useQuizStore();
4533
+ useEffect7(() => {
4534
+ setVariant(variant);
4535
+ }, [variant, setVariant]);
4530
4536
  return /* @__PURE__ */ jsx17(
4531
4537
  "div",
4532
4538
  {
@@ -4635,8 +4641,8 @@ var QuizContainer = forwardRef10(({ children, className, ...props }, ref) => {
4635
4641
  }
4636
4642
  );
4637
4643
  });
4638
- var QuizContent = forwardRef10(({ variant, paddingBottom }) => {
4639
- const { getCurrentQuestion } = useQuizStore();
4644
+ var QuizContent = forwardRef10(({ paddingBottom }) => {
4645
+ const { getCurrentQuestion, variant } = useQuizStore();
4640
4646
  const currentQuestion = getCurrentQuestion();
4641
4647
  const questionComponents = {
4642
4648
  ["ALTERNATIVA" /* ALTERNATIVA */]: QuizAlternative,
@@ -5402,7 +5408,6 @@ var QuizFooter = forwardRef10(
5402
5408
  onGoToSimulated,
5403
5409
  onDetailResult,
5404
5410
  handleFinishSimulated,
5405
- variant = "default",
5406
5411
  ...props
5407
5412
  }, ref) => {
5408
5413
  const {
@@ -5416,6 +5421,7 @@ var QuizFooter = forwardRef10(
5416
5421
  skipQuestion,
5417
5422
  getCurrentQuestion,
5418
5423
  getQuestionStatusFromUserAnswers,
5424
+ variant,
5419
5425
  getActiveQuiz
5420
5426
  } = useQuizStore();
5421
5427
  const totalQuestions = getTotalQuestions();
@@ -5427,6 +5433,7 @@ var QuizFooter = forwardRef10(
5427
5433
  const [alertDialogOpen, setAlertDialogOpen] = useState7(false);
5428
5434
  const [modalResultOpen, setModalResultOpen] = useState7(false);
5429
5435
  const [modalNavigateOpen, setModalNavigateOpen] = useState7(false);
5436
+ const [modalResolutionOpen, setModalResolutionOpen] = useState7(false);
5430
5437
  const [filterType, setFilterType] = useState7("all");
5431
5438
  const unansweredQuestions = getUnansweredQuestionsFromUserAnswers();
5432
5439
  const userAnswers = getUserAnswers();
@@ -5541,7 +5548,16 @@ var QuizFooter = forwardRef10(
5541
5548
  children: "Avan\xE7ar"
5542
5549
  }
5543
5550
  )
5544
- ] }) : /* @__PURE__ */ jsx17("div", { className: "flex flex-row items-center justify-end w-full", children: /* @__PURE__ */ jsx17(Button_default, { variant: "solid", action: "primary", size: "medium", children: "Ver Resolu\xE7\xE3o" }) })
5551
+ ] }) : /* @__PURE__ */ jsx17("div", { className: "flex flex-row items-center justify-end w-full", children: /* @__PURE__ */ jsx17(
5552
+ Button_default,
5553
+ {
5554
+ variant: "solid",
5555
+ action: "primary",
5556
+ size: "medium",
5557
+ onClick: () => setModalResolutionOpen(true),
5558
+ children: "Ver Resolu\xE7\xE3o"
5559
+ }
5560
+ ) })
5545
5561
  }
5546
5562
  ),
5547
5563
  /* @__PURE__ */ jsx17(
@@ -5643,6 +5659,16 @@ var QuizFooter = forwardRef10(
5643
5659
  ) })
5644
5660
  ] })
5645
5661
  }
5662
+ ),
5663
+ /* @__PURE__ */ jsx17(
5664
+ Modal_default,
5665
+ {
5666
+ isOpen: modalResolutionOpen,
5667
+ onClose: () => setModalResolutionOpen(false),
5668
+ title: "Resolu\xE7\xE3o",
5669
+ size: "lg",
5670
+ children: currentQuestion?.answerKey
5671
+ }
5646
5672
  )
5647
5673
  ] });
5648
5674
  }