analytica-frontend-lib 1.0.83 → 1.0.85
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/Accordation/index.js +163 -74
- package/dist/Accordation/index.js.map +1 -1
- package/dist/Accordation/index.mjs +163 -74
- package/dist/Accordation/index.mjs.map +1 -1
- package/dist/Alert/index.js +32 -32
- package/dist/Alert/index.js.map +1 -1
- package/dist/Alert/index.mjs +32 -32
- package/dist/Alert/index.mjs.map +1 -1
- package/dist/AlertDialog/index.js +13 -2
- package/dist/AlertDialog/index.js.map +1 -1
- package/dist/AlertDialog/index.mjs +13 -2
- package/dist/AlertDialog/index.mjs.map +1 -1
- package/dist/Alternative/index.js +86 -25
- package/dist/Alternative/index.js.map +1 -1
- package/dist/Alternative/index.mjs +86 -25
- package/dist/Alternative/index.mjs.map +1 -1
- package/dist/Badge/index.js +13 -4
- package/dist/Badge/index.js.map +1 -1
- package/dist/Badge/index.mjs +13 -4
- package/dist/Badge/index.mjs.map +1 -1
- package/dist/Button/index.js +10 -1
- package/dist/Button/index.js.map +1 -1
- package/dist/Button/index.mjs +8 -1
- package/dist/Button/index.mjs.map +1 -1
- package/dist/Calendar/index.js +11 -2
- package/dist/Calendar/index.js.map +1 -1
- package/dist/Calendar/index.mjs +11 -2
- package/dist/Calendar/index.mjs.map +1 -1
- package/dist/Card/index.js +154 -71
- package/dist/Card/index.js.map +1 -1
- package/dist/Card/index.mjs +154 -71
- package/dist/Card/index.mjs.map +1 -1
- package/dist/CheckBox/index.js +28 -5
- package/dist/CheckBox/index.js.map +1 -1
- package/dist/CheckBox/index.mjs +28 -5
- package/dist/CheckBox/index.mjs.map +1 -1
- package/dist/Chips/index.js +10 -1
- package/dist/Chips/index.js.map +1 -1
- package/dist/Chips/index.mjs +10 -1
- package/dist/Chips/index.mjs.map +1 -1
- package/dist/Divider/index.js +10 -1
- package/dist/Divider/index.js.map +1 -1
- package/dist/Divider/index.mjs +8 -1
- package/dist/Divider/index.mjs.map +1 -1
- package/dist/DropdownMenu/index.js +18 -22
- package/dist/DropdownMenu/index.js.map +1 -1
- package/dist/DropdownMenu/index.mjs +18 -22
- package/dist/DropdownMenu/index.mjs.map +1 -1
- package/dist/IconButton/index.js +10 -1
- package/dist/IconButton/index.js.map +1 -1
- package/dist/IconButton/index.mjs +10 -1
- package/dist/IconButton/index.mjs.map +1 -1
- package/dist/IconRoundedButton/index.js +10 -1
- package/dist/IconRoundedButton/index.js.map +1 -1
- package/dist/IconRoundedButton/index.mjs +8 -1
- package/dist/IconRoundedButton/index.mjs.map +1 -1
- package/dist/Menu/index.js +22 -10
- package/dist/Menu/index.js.map +1 -1
- package/dist/Menu/index.mjs +22 -10
- package/dist/Menu/index.mjs.map +1 -1
- package/dist/Modal/index.js +15 -1
- package/dist/Modal/index.js.map +1 -1
- package/dist/Modal/index.mjs +15 -1
- package/dist/Modal/index.mjs.map +1 -1
- package/dist/NavButton/index.js +10 -1
- package/dist/NavButton/index.js.map +1 -1
- package/dist/NavButton/index.mjs +10 -1
- package/dist/NavButton/index.mjs.map +1 -1
- package/dist/NotFound/index.js +13 -3
- package/dist/NotFound/index.js.map +1 -1
- package/dist/NotFound/index.mjs +13 -3
- package/dist/NotFound/index.mjs.map +1 -1
- package/dist/ProgressBar/index.js +63 -15
- package/dist/ProgressBar/index.js.map +1 -1
- package/dist/ProgressBar/index.mjs +63 -15
- package/dist/ProgressBar/index.mjs.map +1 -1
- package/dist/ProgressCircle/index.js +34 -7
- package/dist/ProgressCircle/index.js.map +1 -1
- package/dist/ProgressCircle/index.mjs +34 -7
- package/dist/ProgressCircle/index.mjs.map +1 -1
- package/dist/Quiz/index.d.mts +25 -2
- package/dist/Quiz/index.d.ts +25 -2
- package/dist/Quiz/index.js +972 -260
- package/dist/Quiz/index.js.map +1 -1
- package/dist/Quiz/index.mjs +968 -261
- package/dist/Quiz/index.mjs.map +1 -1
- package/dist/Quiz/useQuizStore/index.d.mts +44 -12
- package/dist/Quiz/useQuizStore/index.d.ts +44 -12
- package/dist/Quiz/useQuizStore/index.js +206 -85
- package/dist/Quiz/useQuizStore/index.js.map +1 -1
- package/dist/Quiz/useQuizStore/index.mjs +203 -85
- package/dist/Quiz/useQuizStore/index.mjs.map +1 -1
- package/dist/Radio/index.js +36 -6
- package/dist/Radio/index.js.map +1 -1
- package/dist/Radio/index.mjs +36 -6
- package/dist/Radio/index.mjs.map +1 -1
- package/dist/Select/index.js +20 -4
- package/dist/Select/index.js.map +1 -1
- package/dist/Select/index.mjs +20 -4
- package/dist/Select/index.mjs.map +1 -1
- package/dist/SelectionButton/index.js +10 -1
- package/dist/SelectionButton/index.js.map +1 -1
- package/dist/SelectionButton/index.mjs +10 -1
- package/dist/SelectionButton/index.mjs.map +1 -1
- package/dist/Skeleton/index.js +18 -6
- package/dist/Skeleton/index.js.map +1 -1
- package/dist/Skeleton/index.mjs +18 -6
- package/dist/Skeleton/index.mjs.map +1 -1
- package/dist/Stepper/index.js +27 -18
- package/dist/Stepper/index.js.map +1 -1
- package/dist/Stepper/index.mjs +27 -18
- package/dist/Stepper/index.mjs.map +1 -1
- package/dist/Table/index.js +37 -13
- package/dist/Table/index.js.map +1 -1
- package/dist/Table/index.mjs +37 -13
- package/dist/Table/index.mjs.map +1 -1
- package/dist/Text/index.js +10 -1
- package/dist/Text/index.js.map +1 -1
- package/dist/Text/index.mjs +8 -1
- package/dist/Text/index.mjs.map +1 -1
- package/dist/TextArea/index.js +17 -3
- package/dist/TextArea/index.js.map +1 -1
- package/dist/TextArea/index.mjs +17 -3
- package/dist/TextArea/index.mjs.map +1 -1
- package/dist/Toast/Toaster/index.js +15 -1
- package/dist/Toast/Toaster/index.js.map +1 -1
- package/dist/Toast/Toaster/index.mjs +15 -1
- package/dist/Toast/Toaster/index.mjs.map +1 -1
- package/dist/Toast/index.js +15 -1
- package/dist/Toast/index.js.map +1 -1
- package/dist/Toast/index.mjs +15 -1
- package/dist/Toast/index.mjs.map +1 -1
- package/dist/index.css +8 -9
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +903 -325
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +901 -326
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +8 -9
- package/dist/styles.css.map +1 -1
- package/package.json +3 -1
package/dist/Quiz/index.js
CHANGED
|
@@ -25,7 +25,13 @@ __export(Quiz_exports, {
|
|
|
25
25
|
QuizContent: () => QuizContent,
|
|
26
26
|
QuizFooter: () => QuizFooter,
|
|
27
27
|
QuizHeader: () => QuizHeader,
|
|
28
|
+
QuizHeaderResult: () => QuizHeaderResult,
|
|
29
|
+
QuizListResult: () => QuizListResult,
|
|
30
|
+
QuizListResultByMateria: () => QuizListResultByMateria,
|
|
28
31
|
QuizQuestionList: () => QuizQuestionList,
|
|
32
|
+
QuizResultHeaderTitle: () => QuizResultHeaderTitle,
|
|
33
|
+
QuizResultPerformance: () => QuizResultPerformance,
|
|
34
|
+
QuizResultTitle: () => QuizResultTitle,
|
|
29
35
|
QuizTitle: () => QuizTitle
|
|
30
36
|
});
|
|
31
37
|
module.exports = __toCommonJS(Quiz_exports);
|
|
@@ -33,6 +39,15 @@ var import_phosphor_react6 = require("phosphor-react");
|
|
|
33
39
|
|
|
34
40
|
// src/components/Badge/Badge.tsx
|
|
35
41
|
var import_phosphor_react = require("phosphor-react");
|
|
42
|
+
|
|
43
|
+
// src/utils/utils.ts
|
|
44
|
+
var import_clsx = require("clsx");
|
|
45
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
46
|
+
function cn(...inputs) {
|
|
47
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// src/components/Badge/Badge.tsx
|
|
36
51
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
52
|
var VARIANT_ACTION_CLASSES = {
|
|
38
53
|
solid: {
|
|
@@ -98,7 +113,7 @@ var Badge = ({
|
|
|
98
113
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
99
114
|
"div",
|
|
100
115
|
{
|
|
101
|
-
className:
|
|
116
|
+
className: cn(baseClasses, variantClasses, sizeClasses, className),
|
|
102
117
|
...props,
|
|
103
118
|
children: [
|
|
104
119
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_phosphor_react.Bell, { size: 24, className: "text-current", "aria-hidden": "true" }),
|
|
@@ -116,12 +131,12 @@ var Badge = ({
|
|
|
116
131
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
117
132
|
"div",
|
|
118
133
|
{
|
|
119
|
-
className:
|
|
134
|
+
className: cn(baseClasses, variantClasses, sizeClasses, className),
|
|
120
135
|
...props,
|
|
121
136
|
children: [
|
|
122
|
-
iconLeft && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className:
|
|
137
|
+
iconLeft && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: cn(baseClassesIcon, sizeClassesIcon), children: iconLeft }),
|
|
123
138
|
children,
|
|
124
|
-
iconRight && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className:
|
|
139
|
+
iconRight && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: cn(baseClassesIcon, sizeClassesIcon), children: iconRight })
|
|
125
140
|
]
|
|
126
141
|
}
|
|
127
142
|
);
|
|
@@ -178,7 +193,7 @@ var Text = ({
|
|
|
178
193
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
179
194
|
Component,
|
|
180
195
|
{
|
|
181
|
-
className:
|
|
196
|
+
className: cn(baseClasses, sizeClasses, weightClasses, color, className),
|
|
182
197
|
...props,
|
|
183
198
|
children
|
|
184
199
|
}
|
|
@@ -299,8 +314,19 @@ var Radio = (0, import_react.forwardRef)(
|
|
|
299
314
|
return sizeClasses.borderWidth;
|
|
300
315
|
};
|
|
301
316
|
const borderWidthClass = getBorderWidth();
|
|
302
|
-
const radioClasses =
|
|
303
|
-
|
|
317
|
+
const radioClasses = cn(
|
|
318
|
+
BASE_RADIO_CLASSES,
|
|
319
|
+
actualRadioSize,
|
|
320
|
+
borderWidthClass,
|
|
321
|
+
stylingClasses,
|
|
322
|
+
className
|
|
323
|
+
);
|
|
324
|
+
const dotClasses = cn(
|
|
325
|
+
actualDotSize,
|
|
326
|
+
"rounded-full",
|
|
327
|
+
DOT_CLASSES[currentState],
|
|
328
|
+
"transition-all duration-200"
|
|
329
|
+
);
|
|
304
330
|
const isWrapperNeeded = currentState === "focused" || currentState === "invalid";
|
|
305
331
|
const wrapperBorderColor = currentState === "focused" ? "border-indicator-info" : "border-indicator-error";
|
|
306
332
|
const getTextColor = () => {
|
|
@@ -319,7 +345,11 @@ var Radio = (0, import_react.forwardRef)(
|
|
|
319
345
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
320
346
|
"div",
|
|
321
347
|
{
|
|
322
|
-
className:
|
|
348
|
+
className: cn(
|
|
349
|
+
"flex flex-row items-center",
|
|
350
|
+
isWrapperNeeded ? cn("p-1 border-2", wrapperBorderColor, "rounded-lg gap-1.5") : sizeClasses.spacing,
|
|
351
|
+
disabled ? "opacity-40" : ""
|
|
352
|
+
),
|
|
323
353
|
children: [
|
|
324
354
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
325
355
|
"input",
|
|
@@ -376,7 +406,11 @@ var Radio = (0, import_react.forwardRef)(
|
|
|
376
406
|
label && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
377
407
|
"div",
|
|
378
408
|
{
|
|
379
|
-
className:
|
|
409
|
+
className: cn(
|
|
410
|
+
"flex flex-row items-center",
|
|
411
|
+
sizeClasses.labelHeight,
|
|
412
|
+
"flex-1 min-w-0"
|
|
413
|
+
),
|
|
380
414
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
381
415
|
Text_default,
|
|
382
416
|
{
|
|
@@ -384,7 +418,11 @@ var Radio = (0, import_react.forwardRef)(
|
|
|
384
418
|
htmlFor: inputId,
|
|
385
419
|
size: sizeClasses.textSize,
|
|
386
420
|
weight: "normal",
|
|
387
|
-
className:
|
|
421
|
+
className: cn(
|
|
422
|
+
getCursorClass(),
|
|
423
|
+
"select-none leading-normal flex items-center font-roboto truncate",
|
|
424
|
+
labelClassName
|
|
425
|
+
),
|
|
388
426
|
color: getTextColor(),
|
|
389
427
|
children: label
|
|
390
428
|
}
|
|
@@ -613,7 +651,11 @@ var AlternativesList = ({
|
|
|
613
651
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
614
652
|
"div",
|
|
615
653
|
{
|
|
616
|
-
className:
|
|
654
|
+
className: cn(
|
|
655
|
+
"border-2 rounded-lg p-4 w-full",
|
|
656
|
+
statusStyles,
|
|
657
|
+
alternative.disabled ? "opacity-50" : ""
|
|
658
|
+
),
|
|
617
659
|
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
618
660
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-start gap-3 flex-1", children: [
|
|
619
661
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "mt-1", children: renderRadio() }),
|
|
@@ -621,7 +663,10 @@ var AlternativesList = ({
|
|
|
621
663
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
622
664
|
"p",
|
|
623
665
|
{
|
|
624
|
-
className:
|
|
666
|
+
className: cn(
|
|
667
|
+
"block font-medium",
|
|
668
|
+
selectedValue === alternative.value || statusBadge ? "text-text-950" : "text-text-600"
|
|
669
|
+
),
|
|
625
670
|
children: alternative.label
|
|
626
671
|
}
|
|
627
672
|
),
|
|
@@ -637,14 +682,21 @@ var AlternativesList = ({
|
|
|
637
682
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
638
683
|
"div",
|
|
639
684
|
{
|
|
640
|
-
className:
|
|
685
|
+
className: cn(
|
|
686
|
+
"flex flex-row justify-between items-start gap-2 p-2 rounded-lg w-full",
|
|
687
|
+
statusStyles,
|
|
688
|
+
alternative.disabled ? "opacity-50" : ""
|
|
689
|
+
),
|
|
641
690
|
children: [
|
|
642
691
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
643
692
|
renderRadio(),
|
|
644
693
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
645
694
|
"span",
|
|
646
695
|
{
|
|
647
|
-
className:
|
|
696
|
+
className: cn(
|
|
697
|
+
"flex-1",
|
|
698
|
+
selectedValue === alternative.value || statusBadge ? "text-text-950" : "text-text-600"
|
|
699
|
+
),
|
|
648
700
|
children: alternative.label
|
|
649
701
|
}
|
|
650
702
|
)
|
|
@@ -659,7 +711,7 @@ var AlternativesList = ({
|
|
|
659
711
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
660
712
|
"div",
|
|
661
713
|
{
|
|
662
|
-
className:
|
|
714
|
+
className: cn("flex flex-col", getLayoutClasses(), "w-full", className),
|
|
663
715
|
children: alternatives.map(
|
|
664
716
|
(alternative) => renderReadonlyAlternative(alternative)
|
|
665
717
|
)
|
|
@@ -677,7 +729,7 @@ var AlternativesList = ({
|
|
|
677
729
|
onValueChange?.(value2);
|
|
678
730
|
},
|
|
679
731
|
disabled,
|
|
680
|
-
className:
|
|
732
|
+
className: cn("flex flex-col", getLayoutClasses(), className),
|
|
681
733
|
children: alternatives.map((alternative, index) => {
|
|
682
734
|
const alternativeId = alternative.value || `alt-${index}`;
|
|
683
735
|
const statusStyles = getStatusStyles(alternative.status, false);
|
|
@@ -686,7 +738,11 @@ var AlternativesList = ({
|
|
|
686
738
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
687
739
|
"div",
|
|
688
740
|
{
|
|
689
|
-
className:
|
|
741
|
+
className: cn(
|
|
742
|
+
"border-2 rounded-lg p-4 transition-all",
|
|
743
|
+
statusStyles,
|
|
744
|
+
alternative.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
|
|
745
|
+
),
|
|
690
746
|
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
691
747
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-start gap-3 flex-1", children: [
|
|
692
748
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
@@ -703,9 +759,11 @@ var AlternativesList = ({
|
|
|
703
759
|
"label",
|
|
704
760
|
{
|
|
705
761
|
htmlFor: alternativeId,
|
|
706
|
-
className:
|
|
707
|
-
|
|
708
|
-
|
|
762
|
+
className: cn(
|
|
763
|
+
"block font-medium",
|
|
764
|
+
actualValue === alternative.value ? "text-text-950" : "text-text-600",
|
|
765
|
+
alternative.disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
766
|
+
),
|
|
709
767
|
children: alternative.label
|
|
710
768
|
}
|
|
711
769
|
),
|
|
@@ -721,7 +779,11 @@ var AlternativesList = ({
|
|
|
721
779
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
722
780
|
"div",
|
|
723
781
|
{
|
|
724
|
-
className:
|
|
782
|
+
className: cn(
|
|
783
|
+
"flex flex-row justify-between gap-2 items-start p-2 rounded-lg transition-all",
|
|
784
|
+
statusStyles,
|
|
785
|
+
alternative.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
786
|
+
),
|
|
725
787
|
children: [
|
|
726
788
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
727
789
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
@@ -736,9 +798,11 @@ var AlternativesList = ({
|
|
|
736
798
|
"label",
|
|
737
799
|
{
|
|
738
800
|
htmlFor: alternativeId,
|
|
739
|
-
className:
|
|
740
|
-
|
|
741
|
-
|
|
801
|
+
className: cn(
|
|
802
|
+
"flex-1",
|
|
803
|
+
actualValue === alternative.value ? "text-text-950" : "text-text-600",
|
|
804
|
+
alternative.disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
805
|
+
),
|
|
742
806
|
children: alternative.label
|
|
743
807
|
}
|
|
744
808
|
)
|
|
@@ -758,7 +822,10 @@ var HeaderAlternative = (0, import_react2.forwardRef)(
|
|
|
758
822
|
"div",
|
|
759
823
|
{
|
|
760
824
|
ref,
|
|
761
|
-
className:
|
|
825
|
+
className: cn(
|
|
826
|
+
"bg-background p-4 flex flex-col gap-4 rounded-xl",
|
|
827
|
+
className
|
|
828
|
+
),
|
|
762
829
|
...props,
|
|
763
830
|
children: [
|
|
764
831
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "flex flex-col", children: [
|
|
@@ -816,7 +883,7 @@ var Button = ({
|
|
|
816
883
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
817
884
|
"button",
|
|
818
885
|
{
|
|
819
|
-
className:
|
|
886
|
+
className: cn(baseClasses, variantClasses, sizeClasses, className),
|
|
820
887
|
disabled,
|
|
821
888
|
type,
|
|
822
889
|
...props,
|
|
@@ -870,7 +937,7 @@ var IconButton = (0, import_react3.forwardRef)(
|
|
|
870
937
|
{
|
|
871
938
|
ref,
|
|
872
939
|
type: "button",
|
|
873
|
-
className:
|
|
940
|
+
className: cn(allClasses, className),
|
|
874
941
|
disabled,
|
|
875
942
|
"aria-pressed": active,
|
|
876
943
|
"aria-label": ariaLabel,
|
|
@@ -894,6 +961,9 @@ var useQuizStore = (0, import_zustand2.create)()(
|
|
|
894
961
|
(set, get) => {
|
|
895
962
|
let timerInterval = null;
|
|
896
963
|
const startTimer = () => {
|
|
964
|
+
if (get().isFinished) {
|
|
965
|
+
return;
|
|
966
|
+
}
|
|
897
967
|
if (timerInterval) {
|
|
898
968
|
clearInterval(timerInterval);
|
|
899
969
|
}
|
|
@@ -912,15 +982,17 @@ var useQuizStore = (0, import_zustand2.create)()(
|
|
|
912
982
|
// Initial State
|
|
913
983
|
currentQuestionIndex: 0,
|
|
914
984
|
selectedAnswers: {},
|
|
915
|
-
skippedQuestions: [],
|
|
916
985
|
userAnswers: [],
|
|
917
986
|
timeElapsed: 0,
|
|
918
987
|
isStarted: false,
|
|
919
988
|
isFinished: false,
|
|
989
|
+
userId: "",
|
|
920
990
|
// Setters
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
991
|
+
setBySimulated: (simulado) => set({ bySimulated: simulado }),
|
|
992
|
+
setByActivity: (atividade) => set({ byActivity: atividade }),
|
|
993
|
+
setByQuestionary: (aula) => set({ byQuestionary: aula }),
|
|
994
|
+
setUserId: (userId) => set({ userId }),
|
|
995
|
+
getUserId: () => get().userId,
|
|
924
996
|
// Navigation
|
|
925
997
|
goToNextQuestion: () => {
|
|
926
998
|
const { currentQuestionIndex, getTotalQuestions } = get();
|
|
@@ -942,58 +1014,107 @@ var useQuizStore = (0, import_zustand2.create)()(
|
|
|
942
1014
|
set({ currentQuestionIndex: index });
|
|
943
1015
|
}
|
|
944
1016
|
},
|
|
945
|
-
|
|
1017
|
+
getActiveQuiz: () => {
|
|
1018
|
+
const { bySimulated, byActivity, byQuestionary } = get();
|
|
1019
|
+
if (bySimulated)
|
|
1020
|
+
return { quiz: bySimulated, type: "bySimulated" };
|
|
1021
|
+
if (byActivity)
|
|
1022
|
+
return { quiz: byActivity, type: "byActivity" };
|
|
1023
|
+
if (byQuestionary)
|
|
1024
|
+
return { quiz: byQuestionary, type: "byQuestionary" };
|
|
1025
|
+
return null;
|
|
1026
|
+
},
|
|
946
1027
|
selectAnswer: (questionId, answerId) => {
|
|
947
|
-
const {
|
|
948
|
-
const
|
|
949
|
-
|
|
1028
|
+
const { getActiveQuiz, userAnswers } = get();
|
|
1029
|
+
const activeQuiz = getActiveQuiz();
|
|
1030
|
+
if (!activeQuiz) return;
|
|
1031
|
+
const updatedQuestions = activeQuiz.quiz.questions.map(
|
|
1032
|
+
(question) => question.id === questionId ? { ...question, answerKey: answerId } : question
|
|
950
1033
|
);
|
|
1034
|
+
const updatedQuiz = {
|
|
1035
|
+
...activeQuiz.quiz,
|
|
1036
|
+
questions: updatedQuestions
|
|
1037
|
+
};
|
|
1038
|
+
const activityId = activeQuiz.quiz.id;
|
|
1039
|
+
const userId = get().getUserId();
|
|
1040
|
+
if (!userId) {
|
|
1041
|
+
console.warn("selectAnswer called before userId is set");
|
|
1042
|
+
return;
|
|
1043
|
+
}
|
|
1044
|
+
const existingAnswerIndex = userAnswers.findIndex(
|
|
1045
|
+
(answer) => answer.questionId === questionId
|
|
1046
|
+
);
|
|
1047
|
+
const newUserAnswer = {
|
|
1048
|
+
questionId,
|
|
1049
|
+
activityId,
|
|
1050
|
+
userId,
|
|
1051
|
+
answer: answerId,
|
|
1052
|
+
optionId: answerId
|
|
1053
|
+
};
|
|
1054
|
+
let updatedUserAnswers;
|
|
1055
|
+
if (existingAnswerIndex !== -1) {
|
|
1056
|
+
updatedUserAnswers = [...userAnswers];
|
|
1057
|
+
updatedUserAnswers[existingAnswerIndex] = newUserAnswer;
|
|
1058
|
+
} else {
|
|
1059
|
+
updatedUserAnswers = [...userAnswers, newUserAnswer];
|
|
1060
|
+
}
|
|
951
1061
|
set({
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
[questionId]: answerId
|
|
955
|
-
},
|
|
956
|
-
skippedQuestions: newSkippedQuestions
|
|
1062
|
+
[activeQuiz.type]: updatedQuiz,
|
|
1063
|
+
userAnswers: updatedUserAnswers
|
|
957
1064
|
});
|
|
958
|
-
addUserAnswer(questionId, answerId);
|
|
959
1065
|
},
|
|
960
1066
|
skipQuestion: () => {
|
|
961
|
-
const { getCurrentQuestion,
|
|
1067
|
+
const { getCurrentQuestion, userAnswers, getActiveQuiz } = get();
|
|
962
1068
|
const currentQuestion = getCurrentQuestion();
|
|
1069
|
+
const activeQuiz = getActiveQuiz();
|
|
1070
|
+
if (!activeQuiz) return;
|
|
963
1071
|
if (currentQuestion) {
|
|
1072
|
+
const activityId = activeQuiz.quiz.id;
|
|
1073
|
+
const userId = get().getUserId();
|
|
1074
|
+
const existingAnswerIndex = userAnswers.findIndex(
|
|
1075
|
+
(answer) => answer.questionId === currentQuestion.id
|
|
1076
|
+
);
|
|
1077
|
+
const newUserAnswer = {
|
|
1078
|
+
questionId: currentQuestion.id,
|
|
1079
|
+
activityId,
|
|
1080
|
+
userId,
|
|
1081
|
+
answer: null,
|
|
1082
|
+
optionId: null
|
|
1083
|
+
};
|
|
1084
|
+
let updatedUserAnswers;
|
|
1085
|
+
if (existingAnswerIndex !== -1) {
|
|
1086
|
+
updatedUserAnswers = [...userAnswers];
|
|
1087
|
+
updatedUserAnswers[existingAnswerIndex] = newUserAnswer;
|
|
1088
|
+
} else {
|
|
1089
|
+
updatedUserAnswers = [...userAnswers, newUserAnswer];
|
|
1090
|
+
}
|
|
964
1091
|
set({
|
|
965
|
-
|
|
1092
|
+
userAnswers: updatedUserAnswers
|
|
966
1093
|
});
|
|
967
|
-
addUserAnswer(currentQuestion.id);
|
|
968
1094
|
}
|
|
969
1095
|
},
|
|
970
1096
|
addUserAnswer: (questionId, answerId) => {
|
|
971
|
-
const {
|
|
972
|
-
const
|
|
973
|
-
|
|
974
|
-
|
|
1097
|
+
const { getActiveQuiz, userAnswers } = get();
|
|
1098
|
+
const activeQuiz = getActiveQuiz();
|
|
1099
|
+
if (!activeQuiz) return;
|
|
1100
|
+
const activityId = activeQuiz.quiz.id;
|
|
1101
|
+
const userId = get().getUserId();
|
|
975
1102
|
const existingAnswerIndex = userAnswers.findIndex(
|
|
976
|
-
(answer) => answer.
|
|
1103
|
+
(answer) => answer.questionId === questionId
|
|
977
1104
|
);
|
|
1105
|
+
const newUserAnswer = {
|
|
1106
|
+
questionId,
|
|
1107
|
+
activityId,
|
|
1108
|
+
userId,
|
|
1109
|
+
answer: answerId || null,
|
|
1110
|
+
optionId: answerId || null
|
|
1111
|
+
};
|
|
978
1112
|
if (existingAnswerIndex !== -1) {
|
|
979
|
-
const
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
answerKey: answerId || "",
|
|
983
|
-
isSkipped: !answerId
|
|
984
|
-
};
|
|
985
|
-
set({ userAnswers: updatedAnswers });
|
|
1113
|
+
const updatedUserAnswers = [...userAnswers];
|
|
1114
|
+
updatedUserAnswers[existingAnswerIndex] = newUserAnswer;
|
|
1115
|
+
set({ userAnswers: updatedUserAnswers });
|
|
986
1116
|
} else {
|
|
987
|
-
set({
|
|
988
|
-
userAnswers: [
|
|
989
|
-
...userAnswers,
|
|
990
|
-
{
|
|
991
|
-
...question,
|
|
992
|
-
answerKey: answerId || "",
|
|
993
|
-
isSkipped: !answerId
|
|
994
|
-
}
|
|
995
|
-
]
|
|
996
|
-
});
|
|
1117
|
+
set({ userAnswers: [...userAnswers, newUserAnswer] });
|
|
997
1118
|
}
|
|
998
1119
|
},
|
|
999
1120
|
startQuiz: () => {
|
|
@@ -1009,11 +1130,11 @@ var useQuizStore = (0, import_zustand2.create)()(
|
|
|
1009
1130
|
set({
|
|
1010
1131
|
currentQuestionIndex: 0,
|
|
1011
1132
|
selectedAnswers: {},
|
|
1012
|
-
skippedQuestions: [],
|
|
1013
1133
|
userAnswers: [],
|
|
1014
1134
|
timeElapsed: 0,
|
|
1015
1135
|
isStarted: false,
|
|
1016
|
-
isFinished: false
|
|
1136
|
+
isFinished: false,
|
|
1137
|
+
userId: ""
|
|
1017
1138
|
});
|
|
1018
1139
|
},
|
|
1019
1140
|
// Timer
|
|
@@ -1022,36 +1143,33 @@ var useQuizStore = (0, import_zustand2.create)()(
|
|
|
1022
1143
|
stopTimer,
|
|
1023
1144
|
// Getters
|
|
1024
1145
|
getCurrentQuestion: () => {
|
|
1025
|
-
const {
|
|
1026
|
-
const
|
|
1027
|
-
if (!
|
|
1146
|
+
const { currentQuestionIndex, getActiveQuiz } = get();
|
|
1147
|
+
const activeQuiz = getActiveQuiz();
|
|
1148
|
+
if (!activeQuiz) {
|
|
1028
1149
|
return null;
|
|
1029
1150
|
}
|
|
1030
|
-
return quiz.questions[currentQuestionIndex];
|
|
1151
|
+
return activeQuiz.quiz.questions[currentQuestionIndex];
|
|
1031
1152
|
},
|
|
1032
1153
|
getTotalQuestions: () => {
|
|
1033
|
-
const {
|
|
1034
|
-
const
|
|
1035
|
-
return quiz?.questions?.length || 0;
|
|
1154
|
+
const { getActiveQuiz } = get();
|
|
1155
|
+
const activeQuiz = getActiveQuiz();
|
|
1156
|
+
return activeQuiz?.quiz?.questions?.length || 0;
|
|
1036
1157
|
},
|
|
1037
1158
|
getAnsweredQuestions: () => {
|
|
1038
|
-
const {
|
|
1039
|
-
return
|
|
1159
|
+
const { userAnswers } = get();
|
|
1160
|
+
return userAnswers.filter((answer) => answer.answer !== null).length;
|
|
1040
1161
|
},
|
|
1041
1162
|
getUnansweredQuestions: () => {
|
|
1042
|
-
const {
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
byAula,
|
|
1046
|
-
selectedAnswers,
|
|
1047
|
-
skippedQuestions
|
|
1048
|
-
} = get();
|
|
1049
|
-
const quiz = bySimulado || byAtividade || byAula;
|
|
1050
|
-
if (!quiz) return [];
|
|
1163
|
+
const { getActiveQuiz, userAnswers } = get();
|
|
1164
|
+
const activeQuiz = getActiveQuiz();
|
|
1165
|
+
if (!activeQuiz) return [];
|
|
1051
1166
|
const unansweredQuestions = [];
|
|
1052
|
-
quiz.questions.forEach((question, index) => {
|
|
1053
|
-
const
|
|
1054
|
-
|
|
1167
|
+
activeQuiz.quiz.questions.forEach((question, index) => {
|
|
1168
|
+
const userAnswer = userAnswers.find(
|
|
1169
|
+
(answer) => answer.questionId === question.id
|
|
1170
|
+
);
|
|
1171
|
+
const isAnswered = userAnswer && userAnswer.answer !== null;
|
|
1172
|
+
const isSkipped = userAnswer && userAnswer.answer === null;
|
|
1055
1173
|
if (!isAnswered && !isSkipped) {
|
|
1056
1174
|
unansweredQuestions.push(index + 1);
|
|
1057
1175
|
}
|
|
@@ -1059,8 +1177,8 @@ var useQuizStore = (0, import_zustand2.create)()(
|
|
|
1059
1177
|
return unansweredQuestions;
|
|
1060
1178
|
},
|
|
1061
1179
|
getSkippedQuestions: () => {
|
|
1062
|
-
const {
|
|
1063
|
-
return
|
|
1180
|
+
const { userAnswers } = get();
|
|
1181
|
+
return userAnswers.filter((answer) => answer.answer === null).length;
|
|
1064
1182
|
},
|
|
1065
1183
|
getProgress: () => {
|
|
1066
1184
|
const { getTotalQuestions, getAnsweredQuestions } = get();
|
|
@@ -1069,22 +1187,32 @@ var useQuizStore = (0, import_zustand2.create)()(
|
|
|
1069
1187
|
return total > 0 ? answered / total * 100 : 0;
|
|
1070
1188
|
},
|
|
1071
1189
|
isQuestionAnswered: (questionId) => {
|
|
1072
|
-
const {
|
|
1073
|
-
|
|
1190
|
+
const { userAnswers } = get();
|
|
1191
|
+
const userAnswer = userAnswers.find(
|
|
1192
|
+
(answer) => answer.questionId === questionId
|
|
1193
|
+
);
|
|
1194
|
+
return userAnswer ? userAnswer.answer !== null : false;
|
|
1074
1195
|
},
|
|
1075
1196
|
isQuestionSkipped: (questionId) => {
|
|
1076
|
-
const {
|
|
1077
|
-
|
|
1197
|
+
const { userAnswers } = get();
|
|
1198
|
+
const userAnswer = userAnswers.find(
|
|
1199
|
+
(answer) => answer.questionId === questionId
|
|
1200
|
+
);
|
|
1201
|
+
return userAnswer ? userAnswer.answer === null : false;
|
|
1078
1202
|
},
|
|
1079
1203
|
getCurrentAnswer: () => {
|
|
1080
|
-
const { getCurrentQuestion,
|
|
1204
|
+
const { getCurrentQuestion, userAnswers } = get();
|
|
1081
1205
|
const currentQuestion = getCurrentQuestion();
|
|
1082
|
-
|
|
1206
|
+
if (!currentQuestion) return void 0;
|
|
1207
|
+
const userAnswer = userAnswers.find(
|
|
1208
|
+
(answer) => answer.questionId === currentQuestion.id
|
|
1209
|
+
);
|
|
1210
|
+
return userAnswer?.answer;
|
|
1083
1211
|
},
|
|
1084
1212
|
getQuizTitle: () => {
|
|
1085
|
-
const {
|
|
1086
|
-
const
|
|
1087
|
-
return quiz?.title || "Quiz";
|
|
1213
|
+
const { getActiveQuiz } = get();
|
|
1214
|
+
const activeQuiz = getActiveQuiz();
|
|
1215
|
+
return activeQuiz?.quiz?.title || "Quiz";
|
|
1088
1216
|
},
|
|
1089
1217
|
formatTime: (seconds) => {
|
|
1090
1218
|
const minutes = Math.floor(seconds / 60);
|
|
@@ -1092,30 +1220,42 @@ var useQuizStore = (0, import_zustand2.create)()(
|
|
|
1092
1220
|
return `${minutes.toString().padStart(2, "0")}:${remainingSeconds.toString().padStart(2, "0")}`;
|
|
1093
1221
|
},
|
|
1094
1222
|
getUserAnswers: () => {
|
|
1095
|
-
const { userAnswers } = get();
|
|
1096
|
-
|
|
1223
|
+
const { getActiveQuiz, userAnswers } = get();
|
|
1224
|
+
const activeQuiz = getActiveQuiz();
|
|
1225
|
+
if (!activeQuiz) return [];
|
|
1226
|
+
return activeQuiz.quiz.questions.map((question) => {
|
|
1227
|
+
const userAnswer = userAnswers.find(
|
|
1228
|
+
(answer) => answer.questionId === question.id
|
|
1229
|
+
);
|
|
1230
|
+
return {
|
|
1231
|
+
...question,
|
|
1232
|
+
isSkipped: userAnswer ? userAnswer.answer === null : false
|
|
1233
|
+
};
|
|
1234
|
+
});
|
|
1097
1235
|
},
|
|
1098
1236
|
getUnansweredQuestionsFromUserAnswers: () => {
|
|
1099
|
-
const {
|
|
1100
|
-
const
|
|
1101
|
-
if (!
|
|
1237
|
+
const { getActiveQuiz, userAnswers } = get();
|
|
1238
|
+
const activeQuiz = getActiveQuiz();
|
|
1239
|
+
if (!activeQuiz) return [];
|
|
1102
1240
|
const unansweredQuestions = [];
|
|
1103
|
-
quiz.questions.forEach((question, index) => {
|
|
1241
|
+
activeQuiz.quiz.questions.forEach((question, index) => {
|
|
1104
1242
|
const userAnswer = userAnswers.find(
|
|
1105
|
-
(answer) => answer.
|
|
1243
|
+
(answer) => answer.questionId === question.id
|
|
1106
1244
|
);
|
|
1107
|
-
|
|
1245
|
+
const hasAnswer = userAnswer && userAnswer.answer !== null;
|
|
1246
|
+
const isSkipped = userAnswer && userAnswer.answer === null;
|
|
1247
|
+
if (!hasAnswer || isSkipped) {
|
|
1108
1248
|
unansweredQuestions.push(index + 1);
|
|
1109
1249
|
}
|
|
1110
1250
|
});
|
|
1111
1251
|
return unansweredQuestions;
|
|
1112
1252
|
},
|
|
1113
1253
|
getQuestionsGroupedBySubject: () => {
|
|
1114
|
-
const {
|
|
1115
|
-
const
|
|
1116
|
-
if (!
|
|
1254
|
+
const { getActiveQuiz } = get();
|
|
1255
|
+
const activeQuiz = getActiveQuiz();
|
|
1256
|
+
if (!activeQuiz) return {};
|
|
1117
1257
|
const groupedQuestions = {};
|
|
1118
|
-
quiz.questions.forEach((question) => {
|
|
1258
|
+
activeQuiz.quiz.questions.forEach((question) => {
|
|
1119
1259
|
const subjectId = question.knowledgeMatrix?.[0]?.subjectId || "Sem mat\xE9ria";
|
|
1120
1260
|
if (!groupedQuestions[subjectId]) {
|
|
1121
1261
|
groupedQuestions[subjectId] = [];
|
|
@@ -1123,6 +1263,31 @@ var useQuizStore = (0, import_zustand2.create)()(
|
|
|
1123
1263
|
groupedQuestions[subjectId].push(question);
|
|
1124
1264
|
});
|
|
1125
1265
|
return groupedQuestions;
|
|
1266
|
+
},
|
|
1267
|
+
// New methods for userAnswers
|
|
1268
|
+
getUserAnswerByQuestionId: (questionId) => {
|
|
1269
|
+
const { userAnswers } = get();
|
|
1270
|
+
return userAnswers.find((answer) => answer.questionId === questionId) || null;
|
|
1271
|
+
},
|
|
1272
|
+
isQuestionAnsweredByUserAnswers: (questionId) => {
|
|
1273
|
+
const { userAnswers } = get();
|
|
1274
|
+
const answer = userAnswers.find(
|
|
1275
|
+
(answer2) => answer2.questionId === questionId
|
|
1276
|
+
);
|
|
1277
|
+
return answer ? answer.answer !== null : false;
|
|
1278
|
+
},
|
|
1279
|
+
getQuestionStatusFromUserAnswers: (questionId) => {
|
|
1280
|
+
const { userAnswers } = get();
|
|
1281
|
+
const answer = userAnswers.find(
|
|
1282
|
+
(answer2) => answer2.questionId === questionId
|
|
1283
|
+
);
|
|
1284
|
+
if (!answer) return "unanswered";
|
|
1285
|
+
if (answer.answer === null) return "skipped";
|
|
1286
|
+
return "answered";
|
|
1287
|
+
},
|
|
1288
|
+
getUserAnswersForActivity: () => {
|
|
1289
|
+
const { userAnswers } = get();
|
|
1290
|
+
return userAnswers;
|
|
1126
1291
|
}
|
|
1127
1292
|
};
|
|
1128
1293
|
},
|
|
@@ -1210,7 +1375,11 @@ var AlertDialog = (0, import_react4.forwardRef)(
|
|
|
1210
1375
|
"div",
|
|
1211
1376
|
{
|
|
1212
1377
|
ref,
|
|
1213
|
-
className:
|
|
1378
|
+
className: cn(
|
|
1379
|
+
"bg-background border border-border-100 rounded-lg shadow-lg p-6 m-3",
|
|
1380
|
+
sizeClasses,
|
|
1381
|
+
className
|
|
1382
|
+
),
|
|
1214
1383
|
...props,
|
|
1215
1384
|
children: [
|
|
1216
1385
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
@@ -1309,7 +1478,12 @@ var Modal = ({
|
|
|
1309
1478
|
const sizeClasses = SIZE_CLASSES5[size];
|
|
1310
1479
|
const baseClasses = "bg-secondary-50 rounded-3xl shadow-hard-shadow-2 border border-border-100 w-full mx-4";
|
|
1311
1480
|
const dialogResetClasses = "p-0 m-0 border-none outline-none max-h-none static";
|
|
1312
|
-
const modalClasses =
|
|
1481
|
+
const modalClasses = cn(
|
|
1482
|
+
baseClasses,
|
|
1483
|
+
sizeClasses,
|
|
1484
|
+
dialogResetClasses,
|
|
1485
|
+
className
|
|
1486
|
+
);
|
|
1313
1487
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1314
1488
|
"div",
|
|
1315
1489
|
{
|
|
@@ -1522,11 +1696,11 @@ var Select = ({
|
|
|
1522
1696
|
"label",
|
|
1523
1697
|
{
|
|
1524
1698
|
htmlFor: selectId,
|
|
1525
|
-
className:
|
|
1699
|
+
className: cn("block font-bold text-text-900 mb-1.5", sizeClasses),
|
|
1526
1700
|
children: label
|
|
1527
1701
|
}
|
|
1528
1702
|
),
|
|
1529
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className:
|
|
1703
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: cn("relative", sizeClasses), ref: selectRef, children: injectStore2(children, store, size, selectId) }),
|
|
1530
1704
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mt-1.5 gap-1.5", children: [
|
|
1531
1705
|
helperText && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-sm text-text-500", children: helperText }),
|
|
1532
1706
|
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("p", { className: "flex gap-1 items-center text-sm text-indicator-error", children: [
|
|
@@ -1587,7 +1761,10 @@ var SelectTrigger = (0, import_react6.forwardRef)(
|
|
|
1587
1761
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1588
1762
|
import_phosphor_react4.CaretDown,
|
|
1589
1763
|
{
|
|
1590
|
-
className:
|
|
1764
|
+
className: cn(
|
|
1765
|
+
"h-[1em] w-[1em] opacity-50 transition-transform",
|
|
1766
|
+
open ? "rotate-180" : ""
|
|
1767
|
+
)
|
|
1591
1768
|
}
|
|
1592
1769
|
)
|
|
1593
1770
|
]
|
|
@@ -1614,7 +1791,11 @@ var SelectContent = (0, import_react6.forwardRef)(
|
|
|
1614
1791
|
{
|
|
1615
1792
|
role: "menu",
|
|
1616
1793
|
ref,
|
|
1617
|
-
className:
|
|
1794
|
+
className: cn(
|
|
1795
|
+
"bg-background z-50 min-w-[210px] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md border-border-100",
|
|
1796
|
+
getPositionClasses(),
|
|
1797
|
+
className
|
|
1798
|
+
),
|
|
1618
1799
|
...props,
|
|
1619
1800
|
children
|
|
1620
1801
|
}
|
|
@@ -1798,7 +1979,10 @@ var renderStackedHitCountDisplay = (showHitCount, showPercentage, clampedValue,
|
|
|
1798
1979
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1799
1980
|
"div",
|
|
1800
1981
|
{
|
|
1801
|
-
className:
|
|
1982
|
+
className: cn(
|
|
1983
|
+
"text-xs font-medium leading-[14px] text-right",
|
|
1984
|
+
percentageClassName
|
|
1985
|
+
),
|
|
1802
1986
|
children: displayPriority.type === "hitCount" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
1803
1987
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-success-200", children: Math.round(clampedValue) }),
|
|
1804
1988
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "text-text-600", children: [
|
|
@@ -1823,7 +2007,11 @@ var ProgressBarBase = ({
|
|
|
1823
2007
|
}) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1824
2008
|
"div",
|
|
1825
2009
|
{
|
|
1826
|
-
className:
|
|
2010
|
+
className: cn(
|
|
2011
|
+
containerClassName,
|
|
2012
|
+
variantClasses.background,
|
|
2013
|
+
"overflow-hidden relative"
|
|
2014
|
+
),
|
|
1827
2015
|
children: [
|
|
1828
2016
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1829
2017
|
"progress",
|
|
@@ -1837,7 +2025,11 @@ var ProgressBarBase = ({
|
|
|
1837
2025
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1838
2026
|
"div",
|
|
1839
2027
|
{
|
|
1840
|
-
className:
|
|
2028
|
+
className: cn(
|
|
2029
|
+
fillClassName,
|
|
2030
|
+
variantClasses.fill,
|
|
2031
|
+
"transition-all duration-300 ease-out"
|
|
2032
|
+
),
|
|
1841
2033
|
style: { width: `${percentage}%` }
|
|
1842
2034
|
}
|
|
1843
2035
|
)
|
|
@@ -1859,7 +2051,12 @@ var StackedLayout = ({
|
|
|
1859
2051
|
}) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1860
2052
|
"div",
|
|
1861
2053
|
{
|
|
1862
|
-
className:
|
|
2054
|
+
className: cn(
|
|
2055
|
+
"flex flex-col items-start gap-2",
|
|
2056
|
+
dimensions.width,
|
|
2057
|
+
dimensions.height,
|
|
2058
|
+
className
|
|
2059
|
+
),
|
|
1863
2060
|
children: [
|
|
1864
2061
|
shouldShowHeader(label, showPercentage, showHitCount) && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-row justify-between items-center w-full h-[19px]", children: [
|
|
1865
2062
|
label && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
@@ -1868,7 +2065,7 @@ var StackedLayout = ({
|
|
|
1868
2065
|
as: "div",
|
|
1869
2066
|
size: "md",
|
|
1870
2067
|
weight: "medium",
|
|
1871
|
-
className:
|
|
2068
|
+
className: cn("text-text-600 leading-[19px]", labelClassName),
|
|
1872
2069
|
children: label
|
|
1873
2070
|
}
|
|
1874
2071
|
),
|
|
@@ -1926,7 +2123,12 @@ var CompactLayout = ({
|
|
|
1926
2123
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1927
2124
|
"div",
|
|
1928
2125
|
{
|
|
1929
|
-
className:
|
|
2126
|
+
className: cn(
|
|
2127
|
+
"flex flex-col items-start gap-1",
|
|
2128
|
+
dimensions.width,
|
|
2129
|
+
dimensions.height,
|
|
2130
|
+
className
|
|
2131
|
+
),
|
|
1930
2132
|
children: [
|
|
1931
2133
|
shouldShowHeader(label, showPercentage, showHitCount) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1932
2134
|
Text_default,
|
|
@@ -1935,7 +2137,7 @@ var CompactLayout = ({
|
|
|
1935
2137
|
size: "sm",
|
|
1936
2138
|
weight: "medium",
|
|
1937
2139
|
color,
|
|
1938
|
-
className:
|
|
2140
|
+
className: cn("leading-4 w-full", compactClassName),
|
|
1939
2141
|
children: content
|
|
1940
2142
|
}
|
|
1941
2143
|
),
|
|
@@ -1975,7 +2177,7 @@ var DefaultLayout = ({
|
|
|
1975
2177
|
label,
|
|
1976
2178
|
showPercentage
|
|
1977
2179
|
);
|
|
1978
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className:
|
|
2180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: cn("flex", sizeClasses.layout, gapClass, className), children: [
|
|
1979
2181
|
displayConfig.showHeader && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-row items-center justify-between w-full", children: [
|
|
1980
2182
|
label && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1981
2183
|
Text_default,
|
|
@@ -1983,7 +2185,10 @@ var DefaultLayout = ({
|
|
|
1983
2185
|
as: "div",
|
|
1984
2186
|
size: "xs",
|
|
1985
2187
|
weight: "medium",
|
|
1986
|
-
className:
|
|
2188
|
+
className: cn(
|
|
2189
|
+
"text-text-950 leading-none tracking-normal text-center",
|
|
2190
|
+
labelClassName
|
|
2191
|
+
),
|
|
1987
2192
|
children: label
|
|
1988
2193
|
}
|
|
1989
2194
|
),
|
|
@@ -1992,7 +2197,10 @@ var DefaultLayout = ({
|
|
|
1992
2197
|
{
|
|
1993
2198
|
size: "xs",
|
|
1994
2199
|
weight: "medium",
|
|
1995
|
-
className:
|
|
2200
|
+
className: cn(
|
|
2201
|
+
"text-text-950 leading-none tracking-normal text-center",
|
|
2202
|
+
percentageClassName
|
|
2203
|
+
),
|
|
1996
2204
|
children: [
|
|
1997
2205
|
Math.round(percentage),
|
|
1998
2206
|
"%"
|
|
@@ -2008,8 +2216,16 @@ var DefaultLayout = ({
|
|
|
2008
2216
|
percentage,
|
|
2009
2217
|
label,
|
|
2010
2218
|
variantClasses,
|
|
2011
|
-
containerClassName:
|
|
2012
|
-
|
|
2219
|
+
containerClassName: cn(
|
|
2220
|
+
progressBarClass,
|
|
2221
|
+
sizeClasses.container,
|
|
2222
|
+
sizeClasses.borderRadius
|
|
2223
|
+
),
|
|
2224
|
+
fillClassName: cn(
|
|
2225
|
+
sizeClasses.bar,
|
|
2226
|
+
sizeClasses.borderRadius,
|
|
2227
|
+
"shadow-hard-shadow-3"
|
|
2228
|
+
)
|
|
2013
2229
|
}
|
|
2014
2230
|
),
|
|
2015
2231
|
displayConfig.showPercentage && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
@@ -2017,7 +2233,10 @@ var DefaultLayout = ({
|
|
|
2017
2233
|
{
|
|
2018
2234
|
size: "xs",
|
|
2019
2235
|
weight: "medium",
|
|
2020
|
-
className:
|
|
2236
|
+
className: cn(
|
|
2237
|
+
"text-text-950 leading-none tracking-normal text-center flex-none",
|
|
2238
|
+
percentageClassName
|
|
2239
|
+
),
|
|
2021
2240
|
children: [
|
|
2022
2241
|
Math.round(percentage),
|
|
2023
2242
|
"%"
|
|
@@ -2030,7 +2249,10 @@ var DefaultLayout = ({
|
|
|
2030
2249
|
as: "div",
|
|
2031
2250
|
size: "xs",
|
|
2032
2251
|
weight: "medium",
|
|
2033
|
-
className:
|
|
2252
|
+
className: cn(
|
|
2253
|
+
"text-text-950 leading-none tracking-normal text-center flex-none",
|
|
2254
|
+
labelClassName
|
|
2255
|
+
),
|
|
2034
2256
|
children: label
|
|
2035
2257
|
}
|
|
2036
2258
|
)
|
|
@@ -2216,21 +2438,28 @@ var CardActivitiesResults = (0, import_react7.forwardRef)(
|
|
|
2216
2438
|
"div",
|
|
2217
2439
|
{
|
|
2218
2440
|
ref,
|
|
2219
|
-
className:
|
|
2441
|
+
className: cn(
|
|
2442
|
+
"w-full flex flex-col border border-border-50 bg-background rounded-xl",
|
|
2443
|
+
className
|
|
2444
|
+
),
|
|
2220
2445
|
...props,
|
|
2221
2446
|
children: [
|
|
2222
2447
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2223
2448
|
"div",
|
|
2224
2449
|
{
|
|
2225
|
-
className:
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2450
|
+
className: cn(
|
|
2451
|
+
"flex flex-col gap-1 items-center justify-center p-4",
|
|
2452
|
+
actionCardClasses,
|
|
2453
|
+
extended ? "rounded-t-xl" : "rounded-xl"
|
|
2454
|
+
),
|
|
2229
2455
|
children: [
|
|
2230
2456
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2231
2457
|
"span",
|
|
2232
2458
|
{
|
|
2233
|
-
className:
|
|
2459
|
+
className: cn(
|
|
2460
|
+
"size-7.5 rounded-full flex items-center justify-center",
|
|
2461
|
+
actionIconClasses
|
|
2462
|
+
),
|
|
2234
2463
|
children: icon
|
|
2235
2464
|
}
|
|
2236
2465
|
),
|
|
@@ -2243,7 +2472,13 @@ var CardActivitiesResults = (0, import_react7.forwardRef)(
|
|
|
2243
2472
|
children: title
|
|
2244
2473
|
}
|
|
2245
2474
|
),
|
|
2246
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2475
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2476
|
+
"p",
|
|
2477
|
+
{
|
|
2478
|
+
className: cn("text-lg font-bold truncate", actionSubTitleClasses),
|
|
2479
|
+
children: subTitle
|
|
2480
|
+
}
|
|
2481
|
+
)
|
|
2247
2482
|
]
|
|
2248
2483
|
}
|
|
2249
2484
|
),
|
|
@@ -2251,7 +2486,10 @@ var CardActivitiesResults = (0, import_react7.forwardRef)(
|
|
|
2251
2486
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2252
2487
|
"p",
|
|
2253
2488
|
{
|
|
2254
|
-
className:
|
|
2489
|
+
className: cn(
|
|
2490
|
+
"text-2xs font-medium uppercase truncate",
|
|
2491
|
+
actionHeaderClasses
|
|
2492
|
+
),
|
|
2255
2493
|
children: header
|
|
2256
2494
|
}
|
|
2257
2495
|
),
|
|
@@ -2281,7 +2519,7 @@ var CardQuestions = (0, import_react7.forwardRef)(
|
|
|
2281
2519
|
layout: "horizontal",
|
|
2282
2520
|
padding: "medium",
|
|
2283
2521
|
minHeight: "medium",
|
|
2284
|
-
className:
|
|
2522
|
+
className: cn("justify-between gap-4", className),
|
|
2285
2523
|
...props,
|
|
2286
2524
|
children: [
|
|
2287
2525
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
|
|
@@ -2359,7 +2597,9 @@ var CardProgress = (0, import_react7.forwardRef)(
|
|
|
2359
2597
|
{
|
|
2360
2598
|
size: "xs",
|
|
2361
2599
|
weight: "medium",
|
|
2362
|
-
className:
|
|
2600
|
+
className: cn(
|
|
2601
|
+
"text-text-950 leading-none tracking-normal text-center flex-none"
|
|
2602
|
+
),
|
|
2363
2603
|
children: [
|
|
2364
2604
|
Math.round(progress),
|
|
2365
2605
|
"%"
|
|
@@ -2378,17 +2618,17 @@ var CardProgress = (0, import_react7.forwardRef)(
|
|
|
2378
2618
|
padding: "none",
|
|
2379
2619
|
minHeight: "medium",
|
|
2380
2620
|
cursor: "pointer",
|
|
2381
|
-
className:
|
|
2621
|
+
className: cn(isHorizontal ? "h-20" : "", className),
|
|
2382
2622
|
...props,
|
|
2383
2623
|
children: [
|
|
2384
2624
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2385
2625
|
"div",
|
|
2386
2626
|
{
|
|
2387
|
-
className:
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2627
|
+
className: cn(
|
|
2628
|
+
"flex justify-center items-center [&>svg]:size-6 text-text-950",
|
|
2629
|
+
isHorizontal ? "min-w-[80px] min-h-[80px] rounded-l-xl" : "min-h-[50px] w-full rounded-t-xl",
|
|
2630
|
+
!color.startsWith("#") ? `bg-${color}` : ""
|
|
2631
|
+
),
|
|
2392
2632
|
style: color.startsWith("#") ? { backgroundColor: color } : void 0,
|
|
2393
2633
|
"data-testid": "icon-container",
|
|
2394
2634
|
children: icon
|
|
@@ -2397,10 +2637,10 @@ var CardProgress = (0, import_react7.forwardRef)(
|
|
|
2397
2637
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2398
2638
|
"div",
|
|
2399
2639
|
{
|
|
2400
|
-
className:
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2640
|
+
className: cn(
|
|
2641
|
+
"p-4 flex flex-col justify-between w-full h-full",
|
|
2642
|
+
!isHorizontal && "gap-4"
|
|
2643
|
+
),
|
|
2404
2644
|
children: [
|
|
2405
2645
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text_default, { size: "sm", weight: "bold", className: "text-text-950 truncate", children: header }),
|
|
2406
2646
|
contentComponent[direction]
|
|
@@ -2430,7 +2670,7 @@ var CardTopic = (0, import_react7.forwardRef)(
|
|
|
2430
2670
|
padding: "small",
|
|
2431
2671
|
minHeight: "medium",
|
|
2432
2672
|
cursor: "pointer",
|
|
2433
|
-
className:
|
|
2673
|
+
className: cn("justify-center gap-2 py-2 px-4", className),
|
|
2434
2674
|
...props,
|
|
2435
2675
|
children: [
|
|
2436
2676
|
subHead && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-text-600 text-2xs flex flex-row gap-1", children: subHead.map((text, index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react7.Fragment, { children: [
|
|
@@ -2453,7 +2693,9 @@ var CardTopic = (0, import_react7.forwardRef)(
|
|
|
2453
2693
|
{
|
|
2454
2694
|
size: "xs",
|
|
2455
2695
|
weight: "medium",
|
|
2456
|
-
className:
|
|
2696
|
+
className: cn(
|
|
2697
|
+
"text-text-950 leading-none tracking-normal text-center flex-none"
|
|
2698
|
+
),
|
|
2457
2699
|
children: [
|
|
2458
2700
|
Math.round(progress),
|
|
2459
2701
|
"%"
|
|
@@ -2487,7 +2729,10 @@ var CardPerformance = (0, import_react7.forwardRef)(
|
|
|
2487
2729
|
layout: "horizontal",
|
|
2488
2730
|
padding: "medium",
|
|
2489
2731
|
minHeight: "none",
|
|
2490
|
-
className:
|
|
2732
|
+
className: cn(
|
|
2733
|
+
actionVariant == "caret" ? "cursor-pointer" : "",
|
|
2734
|
+
className
|
|
2735
|
+
),
|
|
2491
2736
|
onClick: () => actionVariant == "caret" && onClickButton?.(valueButton),
|
|
2492
2737
|
...props,
|
|
2493
2738
|
children: [
|
|
@@ -2545,15 +2790,15 @@ var CardResults = (0, import_react7.forwardRef)(
|
|
|
2545
2790
|
layout: "horizontal",
|
|
2546
2791
|
padding: "none",
|
|
2547
2792
|
minHeight: "medium",
|
|
2548
|
-
className:
|
|
2793
|
+
className: cn("items-center cursor-pointer pr-4", className),
|
|
2549
2794
|
...props,
|
|
2550
2795
|
children: [
|
|
2551
2796
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2552
2797
|
"div",
|
|
2553
2798
|
{
|
|
2554
|
-
className:
|
|
2555
|
-
|
|
2556
|
-
|
|
2799
|
+
className: cn(
|
|
2800
|
+
"flex justify-center items-center [&>svg]:size-8 text-text-950 min-w-20 max-w-20 min-h-20 h-full rounded-l-xl"
|
|
2801
|
+
),
|
|
2557
2802
|
style: {
|
|
2558
2803
|
backgroundColor: color
|
|
2559
2804
|
},
|
|
@@ -2563,10 +2808,10 @@ var CardResults = (0, import_react7.forwardRef)(
|
|
|
2563
2808
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2564
2809
|
"div",
|
|
2565
2810
|
{
|
|
2566
|
-
className:
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2811
|
+
className: cn(
|
|
2812
|
+
"p-4 flex justify-between w-full h-full",
|
|
2813
|
+
isRow ? "flex-row items-center gap-2" : "flex-col"
|
|
2814
|
+
),
|
|
2570
2815
|
children: [
|
|
2571
2816
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-sm font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
|
|
2572
2817
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "flex flex-row gap-1 items-center", children: [
|
|
@@ -2615,7 +2860,7 @@ var CardStatus = (0, import_react7.forwardRef)(
|
|
|
2615
2860
|
layout: "horizontal",
|
|
2616
2861
|
padding: "medium",
|
|
2617
2862
|
minHeight: "medium",
|
|
2618
|
-
className:
|
|
2863
|
+
className: cn("items-center cursor-pointer", className),
|
|
2619
2864
|
...props,
|
|
2620
2865
|
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex justify-between w-full h-full flex-row items-center gap-2", children: [
|
|
2621
2866
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-sm font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
|
|
@@ -2647,7 +2892,10 @@ var CardSettings = (0, import_react7.forwardRef)(
|
|
|
2647
2892
|
layout: "horizontal",
|
|
2648
2893
|
padding: "small",
|
|
2649
2894
|
minHeight: "none",
|
|
2650
|
-
className:
|
|
2895
|
+
className: cn(
|
|
2896
|
+
"border-none items-center gap-2 text-text-700",
|
|
2897
|
+
className
|
|
2898
|
+
),
|
|
2651
2899
|
...props,
|
|
2652
2900
|
children: [
|
|
2653
2901
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "[&>svg]:size-6", children: icon }),
|
|
@@ -2667,15 +2915,19 @@ var CardSupport = (0, import_react7.forwardRef)(
|
|
|
2667
2915
|
layout: "horizontal",
|
|
2668
2916
|
padding: "medium",
|
|
2669
2917
|
minHeight: "none",
|
|
2670
|
-
className:
|
|
2918
|
+
className: cn(
|
|
2919
|
+
"border-none items-center gap-2 text-text-700",
|
|
2920
|
+
className
|
|
2921
|
+
),
|
|
2671
2922
|
...props,
|
|
2672
2923
|
children: [
|
|
2673
2924
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2674
2925
|
"div",
|
|
2675
2926
|
{
|
|
2676
|
-
className:
|
|
2677
|
-
|
|
2678
|
-
|
|
2927
|
+
className: cn(
|
|
2928
|
+
"w-full flex",
|
|
2929
|
+
direction == "col" ? "flex-col" : "flex-row items-center"
|
|
2930
|
+
),
|
|
2679
2931
|
children: [
|
|
2680
2932
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "w-full min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-sm text-text-950 font-bold truncate", children: header }) }),
|
|
2681
2933
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "flex flex-row gap-1", children })
|
|
@@ -2710,7 +2962,7 @@ var CardForum = (0, import_react7.forwardRef)(
|
|
|
2710
2962
|
padding: "medium",
|
|
2711
2963
|
minHeight: "none",
|
|
2712
2964
|
variant: "minimal",
|
|
2713
|
-
className:
|
|
2965
|
+
className: cn("w-auto h-auto gap-3", className),
|
|
2714
2966
|
...props,
|
|
2715
2967
|
children: [
|
|
2716
2968
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
@@ -2843,7 +3095,7 @@ var CardAudio = (0, import_react7.forwardRef)(
|
|
|
2843
3095
|
layout: "horizontal",
|
|
2844
3096
|
padding: "medium",
|
|
2845
3097
|
minHeight: "none",
|
|
2846
|
-
className:
|
|
3098
|
+
className: cn("w-auto h-14 items-center gap-2", className),
|
|
2847
3099
|
...props,
|
|
2848
3100
|
children: [
|
|
2849
3101
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
@@ -3012,7 +3264,10 @@ var CardSimulado = (0, import_react7.forwardRef)(
|
|
|
3012
3264
|
padding: "medium",
|
|
3013
3265
|
minHeight: "none",
|
|
3014
3266
|
cursor: "pointer",
|
|
3015
|
-
className:
|
|
3267
|
+
className: cn(
|
|
3268
|
+
`${backgroundClass} hover:shadow-soft-shadow-2 transition-shadow duration-200`,
|
|
3269
|
+
className
|
|
3270
|
+
),
|
|
3016
3271
|
...props,
|
|
3017
3272
|
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex justify-between items-center w-full gap-4", children: [
|
|
3018
3273
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
|
|
@@ -3075,7 +3330,9 @@ var CardTest = (0, import_react7.forwardRef)(
|
|
|
3075
3330
|
{
|
|
3076
3331
|
ref,
|
|
3077
3332
|
type: "button",
|
|
3078
|
-
className:
|
|
3333
|
+
className: cn(
|
|
3334
|
+
`${baseClasses} ${interactiveClasses} ${selectedClasses} ${className}`.trim()
|
|
3335
|
+
),
|
|
3079
3336
|
onClick: handleClick,
|
|
3080
3337
|
onKeyDown: handleKeyDown,
|
|
3081
3338
|
"aria-pressed": selected,
|
|
@@ -3119,7 +3376,7 @@ var CardTest = (0, import_react7.forwardRef)(
|
|
|
3119
3376
|
"div",
|
|
3120
3377
|
{
|
|
3121
3378
|
ref,
|
|
3122
|
-
className: `${baseClasses} ${className}`.trim(),
|
|
3379
|
+
className: cn(`${baseClasses} ${className}`.trim()),
|
|
3123
3380
|
...props,
|
|
3124
3381
|
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
|
|
3125
3382
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
@@ -3184,16 +3441,16 @@ var CardSimulationHistory = (0, import_react7.forwardRef)(({ data, onSimulationC
|
|
|
3184
3441
|
"div",
|
|
3185
3442
|
{
|
|
3186
3443
|
ref,
|
|
3187
|
-
className:
|
|
3444
|
+
className: cn("w-full max-w-[992px] h-auto", className),
|
|
3188
3445
|
...props,
|
|
3189
3446
|
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col gap-0", children: [
|
|
3190
3447
|
data.map((section, sectionIndex) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
3191
3448
|
"div",
|
|
3192
3449
|
{
|
|
3193
|
-
className:
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3450
|
+
className: cn(
|
|
3451
|
+
"flex flex-row justify-center items-start px-4 py-6 gap-2 w-full bg-white",
|
|
3452
|
+
sectionIndex === 0 ? "rounded-t-3xl" : ""
|
|
3453
|
+
),
|
|
3197
3454
|
children: [
|
|
3198
3455
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3199
3456
|
Text_default,
|
|
@@ -3213,10 +3470,10 @@ var CardSimulationHistory = (0, import_react7.forwardRef)(({ data, onSimulationC
|
|
|
3213
3470
|
padding: "medium",
|
|
3214
3471
|
minHeight: "none",
|
|
3215
3472
|
cursor: "pointer",
|
|
3216
|
-
className:
|
|
3217
|
-
|
|
3218
|
-
transition-shadow duration-200 h-auto min-h-[61px]
|
|
3219
|
-
|
|
3473
|
+
className: cn(
|
|
3474
|
+
`${typeStyles.background} rounded-xl hover:shadow-soft-shadow-2
|
|
3475
|
+
transition-shadow duration-200 h-auto min-h-[61px]`
|
|
3476
|
+
),
|
|
3220
3477
|
onClick: () => onSimulationClick?.(simulation),
|
|
3221
3478
|
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex justify-between items-center w-full gap-2", children: [
|
|
3222
3479
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col gap-2 flex-1 min-w-0", children: [
|
|
@@ -3264,19 +3521,236 @@ var CardSimulationHistory = (0, import_react7.forwardRef)(({ data, onSimulationC
|
|
|
3264
3521
|
);
|
|
3265
3522
|
});
|
|
3266
3523
|
|
|
3267
|
-
// src/components/
|
|
3524
|
+
// src/components/ProgressCircle/ProgressCircle.tsx
|
|
3268
3525
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
3526
|
+
var SIZE_CLASSES8 = {
|
|
3527
|
+
small: {
|
|
3528
|
+
container: "w-[90px] h-[90px]",
|
|
3529
|
+
// 90px circle from design specs
|
|
3530
|
+
strokeWidth: 4,
|
|
3531
|
+
// 4px stroke width - matches ProgressBar small (h-1)
|
|
3532
|
+
textSize: "2xl",
|
|
3533
|
+
// 24px for percentage (font-size: 24px)
|
|
3534
|
+
textWeight: "medium",
|
|
3535
|
+
// font-weight: 500
|
|
3536
|
+
labelSize: "2xs",
|
|
3537
|
+
// Will be overridden with custom 8px in className
|
|
3538
|
+
labelWeight: "bold",
|
|
3539
|
+
// font-weight: 700
|
|
3540
|
+
spacing: "gap-0",
|
|
3541
|
+
// Reduced gap between percentage and label for better spacing
|
|
3542
|
+
contentWidth: "max-w-[50px]"
|
|
3543
|
+
// Reduced width to fit text inside circle
|
|
3544
|
+
},
|
|
3545
|
+
medium: {
|
|
3546
|
+
container: "w-[152px] h-[152px]",
|
|
3547
|
+
// 151.67px ≈ 152px circle from design specs
|
|
3548
|
+
strokeWidth: 8,
|
|
3549
|
+
// 8px stroke width - matches ProgressBar medium (h-2)
|
|
3550
|
+
textSize: "2xl",
|
|
3551
|
+
// 24px for percentage (font-size: 24px)
|
|
3552
|
+
textWeight: "medium",
|
|
3553
|
+
// font-weight: 500
|
|
3554
|
+
labelSize: "xs",
|
|
3555
|
+
// 12px for status label (font-size: 12px)
|
|
3556
|
+
labelWeight: "medium",
|
|
3557
|
+
// font-weight: 500 (changed from bold)
|
|
3558
|
+
spacing: "gap-1",
|
|
3559
|
+
// 4px gap between percentage and label
|
|
3560
|
+
contentWidth: "max-w-[90px]"
|
|
3561
|
+
// Reduced width to fit text inside circle
|
|
3562
|
+
}
|
|
3563
|
+
};
|
|
3564
|
+
var VARIANT_CLASSES3 = {
|
|
3565
|
+
blue: {
|
|
3566
|
+
background: "stroke-primary-100",
|
|
3567
|
+
// Light blue background (#BBDCF7)
|
|
3568
|
+
fill: "stroke-primary-700",
|
|
3569
|
+
// Blue for activity progress (#2271C4)
|
|
3570
|
+
textColor: "text-primary-700",
|
|
3571
|
+
// Blue text color (#2271C4)
|
|
3572
|
+
labelColor: "text-text-700"
|
|
3573
|
+
// Gray text for label (#525252)
|
|
3574
|
+
},
|
|
3575
|
+
green: {
|
|
3576
|
+
background: "stroke-background-300",
|
|
3577
|
+
// Gray background (#D5D4D4 - matches design)
|
|
3578
|
+
fill: "stroke-success-200",
|
|
3579
|
+
// Green for performance (#84D3A2 - matches design)
|
|
3580
|
+
textColor: "text-text-800",
|
|
3581
|
+
// Dark gray text (#404040 - matches design)
|
|
3582
|
+
labelColor: "text-text-600"
|
|
3583
|
+
// Medium gray text for label (#737373 - matches design)
|
|
3584
|
+
}
|
|
3585
|
+
};
|
|
3586
|
+
var ProgressCircle = ({
|
|
3587
|
+
value,
|
|
3588
|
+
max = 100,
|
|
3589
|
+
size = "small",
|
|
3590
|
+
variant = "blue",
|
|
3591
|
+
label,
|
|
3592
|
+
showPercentage = true,
|
|
3593
|
+
className = "",
|
|
3594
|
+
labelClassName = "",
|
|
3595
|
+
percentageClassName = ""
|
|
3596
|
+
}) => {
|
|
3597
|
+
const safeValue = isNaN(value) ? 0 : value;
|
|
3598
|
+
const clampedValue = Math.max(0, Math.min(safeValue, max));
|
|
3599
|
+
const percentage = max === 0 ? 0 : clampedValue / max * 100;
|
|
3600
|
+
const sizeClasses = SIZE_CLASSES8[size];
|
|
3601
|
+
const variantClasses = VARIANT_CLASSES3[variant];
|
|
3602
|
+
const radius = size === "small" ? 37 : 64;
|
|
3603
|
+
const circumference = 2 * Math.PI * radius;
|
|
3604
|
+
const strokeDashoffset = circumference - percentage / 100 * circumference;
|
|
3605
|
+
const center = size === "small" ? 45 : 76;
|
|
3606
|
+
const svgSize = size === "small" ? 90 : 152;
|
|
3607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3608
|
+
"div",
|
|
3609
|
+
{
|
|
3610
|
+
className: cn(
|
|
3611
|
+
"relative flex flex-col items-center justify-center",
|
|
3612
|
+
sizeClasses.container,
|
|
3613
|
+
"rounded-lg",
|
|
3614
|
+
className
|
|
3615
|
+
),
|
|
3616
|
+
children: [
|
|
3617
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3618
|
+
"svg",
|
|
3619
|
+
{
|
|
3620
|
+
className: "absolute inset-0 transform -rotate-90",
|
|
3621
|
+
width: svgSize,
|
|
3622
|
+
height: svgSize,
|
|
3623
|
+
viewBox: `0 0 ${svgSize} ${svgSize}`,
|
|
3624
|
+
"aria-hidden": "true",
|
|
3625
|
+
children: [
|
|
3626
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3627
|
+
"circle",
|
|
3628
|
+
{
|
|
3629
|
+
cx: center,
|
|
3630
|
+
cy: center,
|
|
3631
|
+
r: radius,
|
|
3632
|
+
fill: "none",
|
|
3633
|
+
strokeWidth: sizeClasses.strokeWidth,
|
|
3634
|
+
className: cn(variantClasses.background, "rounded-lg")
|
|
3635
|
+
}
|
|
3636
|
+
),
|
|
3637
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3638
|
+
"circle",
|
|
3639
|
+
{
|
|
3640
|
+
cx: center,
|
|
3641
|
+
cy: center,
|
|
3642
|
+
r: radius,
|
|
3643
|
+
fill: "none",
|
|
3644
|
+
strokeWidth: sizeClasses.strokeWidth,
|
|
3645
|
+
strokeLinecap: "round",
|
|
3646
|
+
strokeDasharray: circumference,
|
|
3647
|
+
strokeDashoffset,
|
|
3648
|
+
className: cn(
|
|
3649
|
+
variantClasses.fill,
|
|
3650
|
+
"transition-all duration-500 ease-out shadow-soft-shadow-3 rounded-lg"
|
|
3651
|
+
)
|
|
3652
|
+
}
|
|
3653
|
+
)
|
|
3654
|
+
]
|
|
3655
|
+
}
|
|
3656
|
+
),
|
|
3657
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3658
|
+
"progress",
|
|
3659
|
+
{
|
|
3660
|
+
value: clampedValue,
|
|
3661
|
+
max,
|
|
3662
|
+
"aria-label": typeof label === "string" ? label : "Progress",
|
|
3663
|
+
className: "absolute opacity-0 w-0 h-0"
|
|
3664
|
+
}
|
|
3665
|
+
),
|
|
3666
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3667
|
+
"div",
|
|
3668
|
+
{
|
|
3669
|
+
className: cn(
|
|
3670
|
+
"relative z-10 flex flex-col items-center justify-center",
|
|
3671
|
+
sizeClasses.spacing,
|
|
3672
|
+
sizeClasses.contentWidth
|
|
3673
|
+
),
|
|
3674
|
+
children: [
|
|
3675
|
+
showPercentage && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3676
|
+
Text_default,
|
|
3677
|
+
{
|
|
3678
|
+
size: sizeClasses.textSize,
|
|
3679
|
+
weight: sizeClasses.textWeight,
|
|
3680
|
+
className: cn(
|
|
3681
|
+
"text-center w-full",
|
|
3682
|
+
variantClasses.textColor,
|
|
3683
|
+
percentageClassName
|
|
3684
|
+
),
|
|
3685
|
+
children: [
|
|
3686
|
+
Math.round(percentage),
|
|
3687
|
+
"%"
|
|
3688
|
+
]
|
|
3689
|
+
}
|
|
3690
|
+
),
|
|
3691
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3692
|
+
Text_default,
|
|
3693
|
+
{
|
|
3694
|
+
as: "span",
|
|
3695
|
+
size: sizeClasses.labelSize,
|
|
3696
|
+
weight: sizeClasses.labelWeight,
|
|
3697
|
+
className: cn(
|
|
3698
|
+
variantClasses.labelColor,
|
|
3699
|
+
"text-center uppercase tracking-wide truncate w-full",
|
|
3700
|
+
labelClassName
|
|
3701
|
+
),
|
|
3702
|
+
children: label
|
|
3703
|
+
}
|
|
3704
|
+
)
|
|
3705
|
+
]
|
|
3706
|
+
}
|
|
3707
|
+
)
|
|
3708
|
+
]
|
|
3709
|
+
}
|
|
3710
|
+
);
|
|
3711
|
+
};
|
|
3712
|
+
var ProgressCircle_default = ProgressCircle;
|
|
3713
|
+
|
|
3714
|
+
// src/components/Quiz/Quiz.tsx
|
|
3715
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
3269
3716
|
var Quiz = (0, import_react8.forwardRef)(({ children, className, ...props }, ref) => {
|
|
3270
|
-
return /* @__PURE__ */ (0,
|
|
3717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3271
3718
|
"div",
|
|
3272
3719
|
{
|
|
3273
3720
|
ref,
|
|
3274
|
-
className:
|
|
3721
|
+
className: cn(
|
|
3722
|
+
"w-full max-w-[1000px] flex flex-col mx-auto h-full relative not-lg:px-6",
|
|
3723
|
+
className
|
|
3724
|
+
),
|
|
3275
3725
|
...props,
|
|
3276
3726
|
children
|
|
3277
3727
|
}
|
|
3278
3728
|
);
|
|
3279
3729
|
});
|
|
3730
|
+
var QuizHeaderResult = (0, import_react8.forwardRef)(
|
|
3731
|
+
({ className, ...props }, ref) => {
|
|
3732
|
+
const { getCurrentQuestion, getCurrentAnswer } = useQuizStore();
|
|
3733
|
+
const currentQuestion = getCurrentQuestion();
|
|
3734
|
+
const userAnswer = getCurrentAnswer();
|
|
3735
|
+
const isCorrect = userAnswer === currentQuestion?.correctOptionId;
|
|
3736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
3737
|
+
"div",
|
|
3738
|
+
{
|
|
3739
|
+
ref,
|
|
3740
|
+
className: cn(
|
|
3741
|
+
"flex flex-row items-center gap-10 p-3.5 rounded-xl",
|
|
3742
|
+
isCorrect ? "bg-success-background" : "bg-error-background",
|
|
3743
|
+
className
|
|
3744
|
+
),
|
|
3745
|
+
...props,
|
|
3746
|
+
children: [
|
|
3747
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "text-text-950 font-bold text-lg", children: "Resultado" }),
|
|
3748
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "text-text-700 text-md", children: isCorrect ? "\u{1F389} Parab\xE9ns!!" : "N\xE3o foi dessa vez..." })
|
|
3749
|
+
]
|
|
3750
|
+
}
|
|
3751
|
+
);
|
|
3752
|
+
}
|
|
3753
|
+
);
|
|
3280
3754
|
var QuizTitle = (0, import_react8.forwardRef)(
|
|
3281
3755
|
({ className, ...props }, ref) => {
|
|
3282
3756
|
const {
|
|
@@ -3289,18 +3763,21 @@ var QuizTitle = (0, import_react8.forwardRef)(
|
|
|
3289
3763
|
} = useQuizStore();
|
|
3290
3764
|
const totalQuestions = getTotalQuestions();
|
|
3291
3765
|
const quizTitle = getQuizTitle();
|
|
3292
|
-
return /* @__PURE__ */ (0,
|
|
3766
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
3293
3767
|
"div",
|
|
3294
3768
|
{
|
|
3295
3769
|
ref,
|
|
3296
|
-
className:
|
|
3770
|
+
className: cn(
|
|
3771
|
+
"flex flex-row justify-center items-center relative p-2",
|
|
3772
|
+
className
|
|
3773
|
+
),
|
|
3297
3774
|
...props,
|
|
3298
3775
|
children: [
|
|
3299
|
-
/* @__PURE__ */ (0,
|
|
3300
|
-
/* @__PURE__ */ (0,
|
|
3301
|
-
/* @__PURE__ */ (0,
|
|
3776
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "flex flex-col gap-2 text-center", children: [
|
|
3777
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "text-text-950 font-bold text-md", children: quizTitle }),
|
|
3778
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "text-text-600 text-xs", children: totalQuestions > 0 ? `${currentQuestionIndex + 1} de ${totalQuestions}` : "0 de 0" })
|
|
3302
3779
|
] }),
|
|
3303
|
-
/* @__PURE__ */ (0,
|
|
3780
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "absolute right-2", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Badge_default, { variant: "outlined", action: "info", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_phosphor_react6.Clock, {}), children: isStarted ? formatTime(timeElapsed) : "00:00" }) })
|
|
3304
3781
|
]
|
|
3305
3782
|
}
|
|
3306
3783
|
);
|
|
@@ -3309,7 +3786,7 @@ var QuizTitle = (0, import_react8.forwardRef)(
|
|
|
3309
3786
|
var QuizHeader = () => {
|
|
3310
3787
|
const { getCurrentQuestion } = useQuizStore();
|
|
3311
3788
|
const currentQuestion = getCurrentQuestion();
|
|
3312
|
-
return /* @__PURE__ */ (0,
|
|
3789
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3313
3790
|
HeaderAlternative,
|
|
3314
3791
|
{
|
|
3315
3792
|
title: currentQuestion ? `Quest\xE3o ${currentQuestion.id}` : "Quest\xE3o",
|
|
@@ -3319,36 +3796,52 @@ var QuizHeader = () => {
|
|
|
3319
3796
|
);
|
|
3320
3797
|
};
|
|
3321
3798
|
var QuizContent = (0, import_react8.forwardRef)(({ type = "Alternativas", children, className, ...props }, ref) => {
|
|
3322
|
-
return /* @__PURE__ */ (0,
|
|
3323
|
-
/* @__PURE__ */ (0,
|
|
3324
|
-
/* @__PURE__ */ (0,
|
|
3799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
3800
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "px-4 pb-2 pt-6", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "font-bold text-lg text-text-950", children: type }) }),
|
|
3801
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3325
3802
|
"div",
|
|
3326
3803
|
{
|
|
3327
3804
|
ref,
|
|
3328
|
-
className:
|
|
3805
|
+
className: cn(
|
|
3806
|
+
"rounded-t-xl px-4 pt-4 pb-[80px] h-full flex flex-col gap-4 mb-auto",
|
|
3807
|
+
className
|
|
3808
|
+
),
|
|
3329
3809
|
...props,
|
|
3330
3810
|
children
|
|
3331
3811
|
}
|
|
3332
3812
|
)
|
|
3333
3813
|
] });
|
|
3334
3814
|
});
|
|
3335
|
-
var QuizAlternative = () => {
|
|
3815
|
+
var QuizAlternative = ({ variant = "default" }) => {
|
|
3336
3816
|
const { getCurrentQuestion, selectAnswer, getCurrentAnswer } = useQuizStore();
|
|
3337
3817
|
const currentQuestion = getCurrentQuestion();
|
|
3338
3818
|
const currentAnswer = getCurrentAnswer();
|
|
3339
|
-
const alternatives = currentQuestion?.options?.map((option) =>
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3819
|
+
const alternatives = currentQuestion?.options?.map((option) => {
|
|
3820
|
+
let status = "neutral" /* NEUTRAL */;
|
|
3821
|
+
if (variant === "result") {
|
|
3822
|
+
if (option.id === currentQuestion.correctOptionId) {
|
|
3823
|
+
status = "correct" /* CORRECT */;
|
|
3824
|
+
} else if (currentAnswer === option.id && option.id !== currentQuestion.correctOptionId) {
|
|
3825
|
+
status = "incorrect" /* INCORRECT */;
|
|
3826
|
+
}
|
|
3827
|
+
}
|
|
3828
|
+
return {
|
|
3829
|
+
label: option.option,
|
|
3830
|
+
value: option.id,
|
|
3831
|
+
status
|
|
3832
|
+
};
|
|
3833
|
+
});
|
|
3343
3834
|
if (!alternatives)
|
|
3344
|
-
return /* @__PURE__ */ (0,
|
|
3345
|
-
return /* @__PURE__ */ (0,
|
|
3835
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { children: "N\xE3o h\xE1 Alternativas" }) });
|
|
3836
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3346
3837
|
AlternativesList,
|
|
3347
3838
|
{
|
|
3839
|
+
mode: variant === "default" ? "interactive" : "readonly",
|
|
3348
3840
|
name: `question-${currentQuestion?.id || "1"}`,
|
|
3349
|
-
layout: "
|
|
3841
|
+
layout: "compact",
|
|
3350
3842
|
alternatives,
|
|
3351
3843
|
value: currentAnswer,
|
|
3844
|
+
selectedValue: currentAnswer,
|
|
3352
3845
|
onValueChange: (value) => {
|
|
3353
3846
|
if (currentQuestion) {
|
|
3354
3847
|
selectAnswer(currentQuestion.id, value);
|
|
@@ -3365,18 +3858,11 @@ var QuizQuestionList = ({
|
|
|
3365
3858
|
const {
|
|
3366
3859
|
getQuestionsGroupedBySubject,
|
|
3367
3860
|
goToQuestion,
|
|
3368
|
-
|
|
3369
|
-
isQuestionSkipped
|
|
3861
|
+
getQuestionStatusFromUserAnswers
|
|
3370
3862
|
} = useQuizStore();
|
|
3371
3863
|
const groupedQuestions = getQuestionsGroupedBySubject();
|
|
3372
3864
|
const getQuestionStatus = (questionId) => {
|
|
3373
|
-
|
|
3374
|
-
return "skipped";
|
|
3375
|
-
}
|
|
3376
|
-
if (isQuestionAnswered(questionId)) {
|
|
3377
|
-
return "answered";
|
|
3378
|
-
}
|
|
3379
|
-
return "unanswered";
|
|
3865
|
+
return getQuestionStatusFromUserAnswers(questionId);
|
|
3380
3866
|
};
|
|
3381
3867
|
const filteredGroupedQuestions = Object.entries(groupedQuestions).reduce(
|
|
3382
3868
|
(acc, [subjectId, questions]) => {
|
|
@@ -3400,8 +3886,8 @@ var QuizQuestionList = ({
|
|
|
3400
3886
|
{}
|
|
3401
3887
|
);
|
|
3402
3888
|
const getQuestionIndex = (questionId) => {
|
|
3403
|
-
const {
|
|
3404
|
-
const quiz =
|
|
3889
|
+
const { bySimulated, byActivity, byQuestionary } = useQuizStore.getState();
|
|
3890
|
+
const quiz = bySimulated ?? byActivity ?? byQuestionary;
|
|
3405
3891
|
if (!quiz) return 0;
|
|
3406
3892
|
const index = quiz.questions.findIndex((q) => q.id === questionId);
|
|
3407
3893
|
return index + 1;
|
|
@@ -3411,21 +3897,21 @@ var QuizQuestionList = ({
|
|
|
3411
3897
|
case "answered":
|
|
3412
3898
|
return "Respondida";
|
|
3413
3899
|
case "skipped":
|
|
3414
|
-
return "
|
|
3900
|
+
return "N\xE3o respondida";
|
|
3415
3901
|
default:
|
|
3416
3902
|
return "Em branco";
|
|
3417
3903
|
}
|
|
3418
3904
|
};
|
|
3419
|
-
return /* @__PURE__ */ (0,
|
|
3420
|
-
([subjectId, questions]) => /* @__PURE__ */ (0,
|
|
3421
|
-
/* @__PURE__ */ (0,
|
|
3422
|
-
/* @__PURE__ */ (0,
|
|
3423
|
-
/* @__PURE__ */ (0,
|
|
3905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "space-y-6 px-4", children: Object.entries(filteredGroupedQuestions).map(
|
|
3906
|
+
([subjectId, questions]) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("section", { className: "flex flex-col gap-2", children: [
|
|
3907
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "pt-6 pb-4 flex flex-row gap-2", children: [
|
|
3908
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "bg-primary-500 p-1 rounded-sm flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_phosphor_react6.BookOpen, { size: 17, className: "text-white" }) }),
|
|
3909
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "text-text-800 font-bold text-lg", children: subjectId })
|
|
3424
3910
|
] }),
|
|
3425
|
-
/* @__PURE__ */ (0,
|
|
3911
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("ul", { className: "flex flex-col gap-2", children: questions.map((question) => {
|
|
3426
3912
|
const status = getQuestionStatus(question.id);
|
|
3427
3913
|
const questionNumber = getQuestionIndex(question.id);
|
|
3428
|
-
return /* @__PURE__ */ (0,
|
|
3914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3429
3915
|
CardStatus,
|
|
3430
3916
|
{
|
|
3431
3917
|
header: `Quest\xE3o ${questionNumber.toString().padStart(2, "0")}`,
|
|
@@ -3452,14 +3938,14 @@ var QuizFooter = (0, import_react8.forwardRef)(({ className, onGoToSimulated, on
|
|
|
3452
3938
|
getCurrentAnswer,
|
|
3453
3939
|
skipQuestion,
|
|
3454
3940
|
getCurrentQuestion,
|
|
3455
|
-
|
|
3941
|
+
getQuestionStatusFromUserAnswers
|
|
3456
3942
|
} = useQuizStore();
|
|
3457
3943
|
const totalQuestions = getTotalQuestions();
|
|
3458
3944
|
const isFirstQuestion = currentQuestionIndex === 0;
|
|
3459
3945
|
const isLastQuestion = currentQuestionIndex === totalQuestions - 1;
|
|
3460
3946
|
const currentAnswer = getCurrentAnswer();
|
|
3461
3947
|
const currentQuestion = getCurrentQuestion();
|
|
3462
|
-
const isCurrentQuestionSkipped = currentQuestion ?
|
|
3948
|
+
const isCurrentQuestionSkipped = currentQuestion ? getQuestionStatusFromUserAnswers(currentQuestion.id) === "skipped" : false;
|
|
3463
3949
|
const [alertDialogOpen, setAlertDialogOpen] = (0, import_react8.useState)(false);
|
|
3464
3950
|
const [modalResultOpen, setModalResultOpen] = (0, import_react8.useState)(false);
|
|
3465
3951
|
const [modalNavigateOpen, setModalNavigateOpen] = (0, import_react8.useState)(false);
|
|
@@ -3467,24 +3953,27 @@ var QuizFooter = (0, import_react8.forwardRef)(({ className, onGoToSimulated, on
|
|
|
3467
3953
|
const unansweredQuestions = getUnansweredQuestionsFromUserAnswers();
|
|
3468
3954
|
const userAnswers = getUserAnswers();
|
|
3469
3955
|
const allQuestions = getTotalQuestions();
|
|
3470
|
-
return /* @__PURE__ */ (0,
|
|
3471
|
-
/* @__PURE__ */ (0,
|
|
3956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
3957
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
3472
3958
|
"footer",
|
|
3473
3959
|
{
|
|
3474
3960
|
ref,
|
|
3475
|
-
className:
|
|
3961
|
+
className: cn(
|
|
3962
|
+
"w-full px-2 bg-background lg:max-w-[1000px] not-lg:max-w-[calc(100vw-32px)] border-t border-border-50 fixed bottom-0 min-h-[80px] flex flex-row justify-between items-center",
|
|
3963
|
+
className
|
|
3964
|
+
),
|
|
3476
3965
|
...props,
|
|
3477
3966
|
children: [
|
|
3478
|
-
/* @__PURE__ */ (0,
|
|
3479
|
-
/* @__PURE__ */ (0,
|
|
3967
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-row items-center gap-1", children: [
|
|
3968
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3480
3969
|
IconButton_default,
|
|
3481
3970
|
{
|
|
3482
|
-
icon: /* @__PURE__ */ (0,
|
|
3971
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_phosphor_react6.SquaresFour, { size: 24, className: "text-text-950" }),
|
|
3483
3972
|
size: "md",
|
|
3484
3973
|
onClick: () => setModalNavigateOpen(true)
|
|
3485
3974
|
}
|
|
3486
3975
|
),
|
|
3487
|
-
isFirstQuestion ? /* @__PURE__ */ (0,
|
|
3976
|
+
isFirstQuestion ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3488
3977
|
Button_default,
|
|
3489
3978
|
{
|
|
3490
3979
|
variant: "outline",
|
|
@@ -3495,13 +3984,13 @@ var QuizFooter = (0, import_react8.forwardRef)(({ className, onGoToSimulated, on
|
|
|
3495
3984
|
},
|
|
3496
3985
|
children: "Pular"
|
|
3497
3986
|
}
|
|
3498
|
-
) : /* @__PURE__ */ (0,
|
|
3987
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3499
3988
|
Button_default,
|
|
3500
3989
|
{
|
|
3501
3990
|
size: "medium",
|
|
3502
3991
|
variant: "link",
|
|
3503
3992
|
action: "primary",
|
|
3504
|
-
iconLeft: /* @__PURE__ */ (0,
|
|
3993
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_phosphor_react6.CaretLeft, { size: 18 }),
|
|
3505
3994
|
onClick: () => {
|
|
3506
3995
|
goToPreviousQuestion();
|
|
3507
3996
|
},
|
|
@@ -3509,7 +3998,7 @@ var QuizFooter = (0, import_react8.forwardRef)(({ className, onGoToSimulated, on
|
|
|
3509
3998
|
}
|
|
3510
3999
|
)
|
|
3511
4000
|
] }),
|
|
3512
|
-
!isFirstQuestion && /* @__PURE__ */ (0,
|
|
4001
|
+
!isFirstQuestion && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3513
4002
|
Button_default,
|
|
3514
4003
|
{
|
|
3515
4004
|
size: "small",
|
|
@@ -3522,7 +4011,7 @@ var QuizFooter = (0, import_react8.forwardRef)(({ className, onGoToSimulated, on
|
|
|
3522
4011
|
children: "Pular"
|
|
3523
4012
|
}
|
|
3524
4013
|
),
|
|
3525
|
-
isLastQuestion ? /* @__PURE__ */ (0,
|
|
4014
|
+
isLastQuestion ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3526
4015
|
Button_default,
|
|
3527
4016
|
{
|
|
3528
4017
|
size: "medium",
|
|
@@ -3538,13 +4027,13 @@ var QuizFooter = (0, import_react8.forwardRef)(({ className, onGoToSimulated, on
|
|
|
3538
4027
|
},
|
|
3539
4028
|
children: "Finalizar"
|
|
3540
4029
|
}
|
|
3541
|
-
) : /* @__PURE__ */ (0,
|
|
4030
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3542
4031
|
Button_default,
|
|
3543
4032
|
{
|
|
3544
4033
|
size: "medium",
|
|
3545
4034
|
variant: "link",
|
|
3546
4035
|
action: "primary",
|
|
3547
|
-
iconRight: /* @__PURE__ */ (0,
|
|
4036
|
+
iconRight: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_phosphor_react6.CaretRight, { size: 18 }),
|
|
3548
4037
|
disabled: !currentAnswer && !isCurrentQuestionSkipped,
|
|
3549
4038
|
onClick: () => {
|
|
3550
4039
|
goToNextQuestion();
|
|
@@ -3555,7 +4044,7 @@ var QuizFooter = (0, import_react8.forwardRef)(({ className, onGoToSimulated, on
|
|
|
3555
4044
|
]
|
|
3556
4045
|
}
|
|
3557
4046
|
),
|
|
3558
|
-
/* @__PURE__ */ (0,
|
|
4047
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3559
4048
|
AlertDialog,
|
|
3560
4049
|
{
|
|
3561
4050
|
isOpen: alertDialogOpen,
|
|
@@ -3569,7 +4058,7 @@ var QuizFooter = (0, import_react8.forwardRef)(({ className, onGoToSimulated, on
|
|
|
3569
4058
|
}
|
|
3570
4059
|
}
|
|
3571
4060
|
),
|
|
3572
|
-
/* @__PURE__ */ (0,
|
|
4061
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3573
4062
|
Modal_default,
|
|
3574
4063
|
{
|
|
3575
4064
|
isOpen: modalResultOpen,
|
|
@@ -3579,8 +4068,8 @@ var QuizFooter = (0, import_react8.forwardRef)(({ className, onGoToSimulated, on
|
|
|
3579
4068
|
closeOnEscape: false,
|
|
3580
4069
|
hideCloseButton: true,
|
|
3581
4070
|
size: "md",
|
|
3582
|
-
children: /* @__PURE__ */ (0,
|
|
3583
|
-
/* @__PURE__ */ (0,
|
|
4071
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col w-full h-full items-center justify-center gap-4", children: [
|
|
4072
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3584
4073
|
"img",
|
|
3585
4074
|
{
|
|
3586
4075
|
src: simulated_result_default,
|
|
@@ -3588,9 +4077,9 @@ var QuizFooter = (0, import_react8.forwardRef)(({ className, onGoToSimulated, on
|
|
|
3588
4077
|
className: "w-[282px] h-auto object-cover"
|
|
3589
4078
|
}
|
|
3590
4079
|
),
|
|
3591
|
-
/* @__PURE__ */ (0,
|
|
3592
|
-
/* @__PURE__ */ (0,
|
|
3593
|
-
/* @__PURE__ */ (0,
|
|
4080
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col gap-2 text-center", children: [
|
|
4081
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h2", { className: "text-text-950 font-bold text-lg", children: "Voc\xEA concluiu o simulado!" }),
|
|
4082
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "text-text-500 font-sm", children: [
|
|
3594
4083
|
"Voc\xEA acertou",
|
|
3595
4084
|
" ",
|
|
3596
4085
|
userAnswers.filter(
|
|
@@ -3602,8 +4091,8 @@ var QuizFooter = (0, import_react8.forwardRef)(({ className, onGoToSimulated, on
|
|
|
3602
4091
|
" quest\xF5es."
|
|
3603
4092
|
] })
|
|
3604
4093
|
] }),
|
|
3605
|
-
/* @__PURE__ */ (0,
|
|
3606
|
-
/* @__PURE__ */ (0,
|
|
4094
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "px-6 flex flex-row items-center gap-2 w-full", children: [
|
|
4095
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3607
4096
|
Button_default,
|
|
3608
4097
|
{
|
|
3609
4098
|
variant: "outline",
|
|
@@ -3613,31 +4102,31 @@ var QuizFooter = (0, import_react8.forwardRef)(({ className, onGoToSimulated, on
|
|
|
3613
4102
|
children: "Ir para simulados"
|
|
3614
4103
|
}
|
|
3615
4104
|
),
|
|
3616
|
-
/* @__PURE__ */ (0,
|
|
4105
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Button_default, { className: "w-full", onClick: onDetailResult, children: "Detalhar resultado" })
|
|
3617
4106
|
] })
|
|
3618
4107
|
] })
|
|
3619
4108
|
}
|
|
3620
4109
|
),
|
|
3621
|
-
/* @__PURE__ */ (0,
|
|
4110
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3622
4111
|
Modal_default,
|
|
3623
4112
|
{
|
|
3624
4113
|
isOpen: modalNavigateOpen,
|
|
3625
4114
|
onClose: () => setModalNavigateOpen(false),
|
|
3626
4115
|
title: "Quest\xF5es",
|
|
3627
4116
|
size: "lg",
|
|
3628
|
-
children: /* @__PURE__ */ (0,
|
|
3629
|
-
/* @__PURE__ */ (0,
|
|
3630
|
-
/* @__PURE__ */ (0,
|
|
3631
|
-
/* @__PURE__ */ (0,
|
|
3632
|
-
/* @__PURE__ */ (0,
|
|
3633
|
-
/* @__PURE__ */ (0,
|
|
3634
|
-
/* @__PURE__ */ (0,
|
|
3635
|
-
/* @__PURE__ */ (0,
|
|
3636
|
-
/* @__PURE__ */ (0,
|
|
4117
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col w-full h-full", children: [
|
|
4118
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-row justify-between items-center py-6 pt-6 pb-4 border-b border-border-200", children: [
|
|
4119
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "text-text-950 font-bold text-lg", children: "Filtrar por" }),
|
|
4120
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "max-w-[266px]", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Select_default, { value: filterType, onValueChange: setFilterType, children: [
|
|
4121
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SelectTrigger, { variant: "rounded", className: "max-w-[266px]", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SelectValue, { placeholder: "Selecione uma op\xE7\xE3o" }) }),
|
|
4122
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(SelectContent, { children: [
|
|
4123
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SelectItem, { value: "all", children: "Todas" }),
|
|
4124
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SelectItem, { value: "unanswered", children: "Em branco" }),
|
|
4125
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SelectItem, { value: "answered", children: "Respondidas" })
|
|
3637
4126
|
] })
|
|
3638
4127
|
] }) })
|
|
3639
4128
|
] }),
|
|
3640
|
-
/* @__PURE__ */ (0,
|
|
4129
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex flex-col gap-2 not-lg:h-[calc(100vh-200px)] lg:max-h-[687px] overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3641
4130
|
QuizQuestionList,
|
|
3642
4131
|
{
|
|
3643
4132
|
filterType,
|
|
@@ -3649,6 +4138,223 @@ var QuizFooter = (0, import_react8.forwardRef)(({ className, onGoToSimulated, on
|
|
|
3649
4138
|
)
|
|
3650
4139
|
] });
|
|
3651
4140
|
});
|
|
4141
|
+
var QuizResultHeaderTitle = (0, import_react8.forwardRef)(({ className, ...props }, ref) => {
|
|
4142
|
+
const { bySimulated } = useQuizStore();
|
|
4143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4144
|
+
"div",
|
|
4145
|
+
{
|
|
4146
|
+
ref,
|
|
4147
|
+
className: cn("flex flex-row pt-4 justify-between", className),
|
|
4148
|
+
...props,
|
|
4149
|
+
children: [
|
|
4150
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "text-text-950 font-bold text-2xl", children: "Resultado" }),
|
|
4151
|
+
bySimulated && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Badge_default, { variant: "solid", action: "info", children: bySimulated.category })
|
|
4152
|
+
]
|
|
4153
|
+
}
|
|
4154
|
+
);
|
|
4155
|
+
});
|
|
4156
|
+
var QuizResultTitle = (0, import_react8.forwardRef)(({ className, ...props }, ref) => {
|
|
4157
|
+
const { getQuizTitle } = useQuizStore();
|
|
4158
|
+
const quizTitle = getQuizTitle();
|
|
4159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4160
|
+
"p",
|
|
4161
|
+
{
|
|
4162
|
+
className: cn("pt-6 pb-4 text-text-950 font-bold text-lg", className),
|
|
4163
|
+
ref,
|
|
4164
|
+
...props,
|
|
4165
|
+
children: quizTitle
|
|
4166
|
+
}
|
|
4167
|
+
);
|
|
4168
|
+
});
|
|
4169
|
+
var QuizResultPerformance = (0, import_react8.forwardRef)(
|
|
4170
|
+
({ ...props }, ref) => {
|
|
4171
|
+
const {
|
|
4172
|
+
getTotalQuestions,
|
|
4173
|
+
timeElapsed,
|
|
4174
|
+
formatTime,
|
|
4175
|
+
bySimulated,
|
|
4176
|
+
byActivity,
|
|
4177
|
+
byQuestionary
|
|
4178
|
+
} = useQuizStore();
|
|
4179
|
+
const totalQuestions = getTotalQuestions();
|
|
4180
|
+
const quiz = bySimulated || byActivity || byQuestionary;
|
|
4181
|
+
let correctAnswers = 0;
|
|
4182
|
+
let correctEasyAnswers = 0;
|
|
4183
|
+
let correctMediumAnswers = 0;
|
|
4184
|
+
let correctDifficultAnswers = 0;
|
|
4185
|
+
let totalEasyQuestions = 0;
|
|
4186
|
+
let totalMediumQuestions = 0;
|
|
4187
|
+
let totalDifficultQuestions = 0;
|
|
4188
|
+
if (quiz) {
|
|
4189
|
+
quiz.questions.forEach((question) => {
|
|
4190
|
+
const userAnswer = question.answerKey;
|
|
4191
|
+
const isCorrect = userAnswer && userAnswer === question.correctOptionId;
|
|
4192
|
+
if (isCorrect) {
|
|
4193
|
+
correctAnswers++;
|
|
4194
|
+
}
|
|
4195
|
+
if (question.difficulty === "FACIL" /* FACIL */) {
|
|
4196
|
+
totalEasyQuestions++;
|
|
4197
|
+
if (isCorrect) {
|
|
4198
|
+
correctEasyAnswers++;
|
|
4199
|
+
}
|
|
4200
|
+
} else if (question.difficulty === "MEDIO" /* MEDIO */) {
|
|
4201
|
+
totalMediumQuestions++;
|
|
4202
|
+
if (isCorrect) {
|
|
4203
|
+
correctMediumAnswers++;
|
|
4204
|
+
}
|
|
4205
|
+
} else if (question.difficulty === "DIFICIL" /* DIFICIL */) {
|
|
4206
|
+
totalDifficultQuestions++;
|
|
4207
|
+
if (isCorrect) {
|
|
4208
|
+
correctDifficultAnswers++;
|
|
4209
|
+
}
|
|
4210
|
+
}
|
|
4211
|
+
});
|
|
4212
|
+
}
|
|
4213
|
+
const percentage = totalQuestions > 0 ? Math.round(correctAnswers / totalQuestions * 100) : 0;
|
|
4214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4215
|
+
"div",
|
|
4216
|
+
{
|
|
4217
|
+
className: "flex flex-row gap-6 p-6 rounded-xl bg-background justify-between",
|
|
4218
|
+
ref,
|
|
4219
|
+
...props,
|
|
4220
|
+
children: [
|
|
4221
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "relative", children: [
|
|
4222
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4223
|
+
ProgressCircle_default,
|
|
4224
|
+
{
|
|
4225
|
+
size: "medium",
|
|
4226
|
+
variant: "green",
|
|
4227
|
+
value: percentage,
|
|
4228
|
+
showPercentage: false,
|
|
4229
|
+
label: ""
|
|
4230
|
+
}
|
|
4231
|
+
),
|
|
4232
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
|
|
4233
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center gap-1 mb-1", children: [
|
|
4234
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_phosphor_react6.Clock, { size: 12, weight: "regular", className: "text-text-800" }),
|
|
4235
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-2xs font-medium text-text-800", children: formatTime(timeElapsed) })
|
|
4236
|
+
] }),
|
|
4237
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "text-2xl font-medium text-text-800 leading-7", children: [
|
|
4238
|
+
correctAnswers,
|
|
4239
|
+
" de ",
|
|
4240
|
+
totalQuestions
|
|
4241
|
+
] }),
|
|
4242
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "text-2xs font-medium text-text-600 mt-1", children: "Corretas" })
|
|
4243
|
+
] })
|
|
4244
|
+
] }),
|
|
4245
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col gap-4 w-full", children: [
|
|
4246
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4247
|
+
ProgressBar_default,
|
|
4248
|
+
{
|
|
4249
|
+
className: "w-full",
|
|
4250
|
+
layout: "stacked",
|
|
4251
|
+
variant: "green",
|
|
4252
|
+
value: correctEasyAnswers,
|
|
4253
|
+
max: totalEasyQuestions,
|
|
4254
|
+
label: "F\xE1ceis",
|
|
4255
|
+
showHitCount: true,
|
|
4256
|
+
labelClassName: "text-base font-medium text-text-800 leading-none",
|
|
4257
|
+
percentageClassName: "text-xs font-medium leading-[14px] text-right"
|
|
4258
|
+
}
|
|
4259
|
+
),
|
|
4260
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4261
|
+
ProgressBar_default,
|
|
4262
|
+
{
|
|
4263
|
+
className: "w-full",
|
|
4264
|
+
layout: "stacked",
|
|
4265
|
+
variant: "green",
|
|
4266
|
+
value: correctMediumAnswers,
|
|
4267
|
+
max: totalMediumQuestions,
|
|
4268
|
+
label: "M\xE9dias",
|
|
4269
|
+
showHitCount: true,
|
|
4270
|
+
labelClassName: "text-base font-medium text-text-800 leading-none",
|
|
4271
|
+
percentageClassName: "text-xs font-medium leading-[14px] text-right"
|
|
4272
|
+
}
|
|
4273
|
+
),
|
|
4274
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4275
|
+
ProgressBar_default,
|
|
4276
|
+
{
|
|
4277
|
+
className: "w-full",
|
|
4278
|
+
layout: "stacked",
|
|
4279
|
+
variant: "green",
|
|
4280
|
+
value: correctDifficultAnswers,
|
|
4281
|
+
max: totalDifficultQuestions,
|
|
4282
|
+
label: "Dif\xEDceis",
|
|
4283
|
+
showHitCount: true,
|
|
4284
|
+
labelClassName: "text-base font-medium text-text-800 leading-none",
|
|
4285
|
+
percentageClassName: "text-xs font-medium leading-[14px] text-right"
|
|
4286
|
+
}
|
|
4287
|
+
)
|
|
4288
|
+
] })
|
|
4289
|
+
]
|
|
4290
|
+
}
|
|
4291
|
+
);
|
|
4292
|
+
}
|
|
4293
|
+
);
|
|
4294
|
+
var QuizListResult = (0, import_react8.forwardRef)(({ className, onSubjectClick, ...props }, ref) => {
|
|
4295
|
+
const { getQuestionsGroupedBySubject, isQuestionAnswered } = useQuizStore();
|
|
4296
|
+
const groupedQuestions = getQuestionsGroupedBySubject();
|
|
4297
|
+
const subjectsStats = Object.entries(groupedQuestions).map(
|
|
4298
|
+
([subjectId, questions]) => {
|
|
4299
|
+
let correct = 0;
|
|
4300
|
+
let incorrect = 0;
|
|
4301
|
+
questions.forEach((question) => {
|
|
4302
|
+
if (isQuestionAnswered(question.id)) {
|
|
4303
|
+
const userAnswer = question.answerKey;
|
|
4304
|
+
if (userAnswer === question.correctOptionId) {
|
|
4305
|
+
correct++;
|
|
4306
|
+
} else {
|
|
4307
|
+
incorrect++;
|
|
4308
|
+
}
|
|
4309
|
+
}
|
|
4310
|
+
});
|
|
4311
|
+
return {
|
|
4312
|
+
subject: subjectId,
|
|
4313
|
+
correct,
|
|
4314
|
+
incorrect,
|
|
4315
|
+
total: questions.length
|
|
4316
|
+
};
|
|
4317
|
+
}
|
|
4318
|
+
);
|
|
4319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("section", { ref, className, ...props, children: [
|
|
4320
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "pt-6 pb-4 text-text-950 font-bold text-lg", children: "Mat\xE9rias" }),
|
|
4321
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("ul", { className: "flex flex-col gap-2", children: subjectsStats.map((subject) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4322
|
+
CardResults,
|
|
4323
|
+
{
|
|
4324
|
+
onClick: () => onSubjectClick?.(subject.subject),
|
|
4325
|
+
className: "max-w-full",
|
|
4326
|
+
header: subject.subject,
|
|
4327
|
+
correct_answers: subject.correct,
|
|
4328
|
+
incorrect_answers: subject.incorrect,
|
|
4329
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_phosphor_react6.Book, { size: 20 }),
|
|
4330
|
+
direction: "row"
|
|
4331
|
+
}
|
|
4332
|
+
) }, subject.subject)) })
|
|
4333
|
+
] });
|
|
4334
|
+
});
|
|
4335
|
+
var QuizListResultByMateria = ({
|
|
4336
|
+
subject,
|
|
4337
|
+
onQuestionClick
|
|
4338
|
+
}) => {
|
|
4339
|
+
const { getQuestionsGroupedBySubject } = useQuizStore();
|
|
4340
|
+
const groupedQuestions = getQuestionsGroupedBySubject();
|
|
4341
|
+
const answeredQuestions = groupedQuestions[subject] || [];
|
|
4342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w-full max-w-[1000px] flex flex-col mx-auto h-full relative not-lg:px-6", children: [
|
|
4343
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex flex-row pt-4 justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "text-text-950 font-bold text-2xl", children: subject }) }),
|
|
4344
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("section", { className: "flex flex-col ", children: [
|
|
4345
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "pt-6 pb-4 text-text-950 font-bold text-lg", children: "Resultado das quest\xF5es" }),
|
|
4346
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("ul", { className: "flex flex-col gap-2 pt-4", children: answeredQuestions.map((question) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4347
|
+
CardStatus,
|
|
4348
|
+
{
|
|
4349
|
+
className: "max-w-full",
|
|
4350
|
+
header: `Quest\xE3o ${question.id}`,
|
|
4351
|
+
status: question.answerKey === question.correctOptionId ? "correct" : "incorrect",
|
|
4352
|
+
onClick: () => onQuestionClick?.(question)
|
|
4353
|
+
}
|
|
4354
|
+
) }, question.id)) })
|
|
4355
|
+
] })
|
|
4356
|
+
] });
|
|
4357
|
+
};
|
|
3652
4358
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3653
4359
|
0 && (module.exports = {
|
|
3654
4360
|
Quiz,
|
|
@@ -3656,7 +4362,13 @@ var QuizFooter = (0, import_react8.forwardRef)(({ className, onGoToSimulated, on
|
|
|
3656
4362
|
QuizContent,
|
|
3657
4363
|
QuizFooter,
|
|
3658
4364
|
QuizHeader,
|
|
4365
|
+
QuizHeaderResult,
|
|
4366
|
+
QuizListResult,
|
|
4367
|
+
QuizListResultByMateria,
|
|
3659
4368
|
QuizQuestionList,
|
|
4369
|
+
QuizResultHeaderTitle,
|
|
4370
|
+
QuizResultPerformance,
|
|
4371
|
+
QuizResultTitle,
|
|
3660
4372
|
QuizTitle
|
|
3661
4373
|
});
|
|
3662
4374
|
//# sourceMappingURL=index.js.map
|