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/index.mjs
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
// src/utils/utils.ts
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { twMerge } from "tailwind-merge";
|
|
4
|
+
function cn(...inputs) {
|
|
5
|
+
return twMerge(clsx(inputs));
|
|
6
|
+
}
|
|
7
|
+
|
|
1
8
|
// src/components/Text/Text.tsx
|
|
2
9
|
import { jsx } from "react/jsx-runtime";
|
|
3
10
|
var Text = ({
|
|
@@ -41,7 +48,7 @@ var Text = ({
|
|
|
41
48
|
return /* @__PURE__ */ jsx(
|
|
42
49
|
Component,
|
|
43
50
|
{
|
|
44
|
-
className:
|
|
51
|
+
className: cn(baseClasses, sizeClasses, weightClasses, color, className),
|
|
45
52
|
...props,
|
|
46
53
|
children
|
|
47
54
|
}
|
|
@@ -93,7 +100,7 @@ var Button = ({
|
|
|
93
100
|
return /* @__PURE__ */ jsxs(
|
|
94
101
|
"button",
|
|
95
102
|
{
|
|
96
|
-
className:
|
|
103
|
+
className: cn(baseClasses, variantClasses, sizeClasses, className),
|
|
97
104
|
disabled,
|
|
98
105
|
type,
|
|
99
106
|
...props,
|
|
@@ -174,7 +181,7 @@ var Badge = ({
|
|
|
174
181
|
return /* @__PURE__ */ jsxs2(
|
|
175
182
|
"div",
|
|
176
183
|
{
|
|
177
|
-
className:
|
|
184
|
+
className: cn(baseClasses, variantClasses, sizeClasses, className),
|
|
178
185
|
...props,
|
|
179
186
|
children: [
|
|
180
187
|
/* @__PURE__ */ jsx3(Bell, { size: 24, className: "text-current", "aria-hidden": "true" }),
|
|
@@ -192,12 +199,12 @@ var Badge = ({
|
|
|
192
199
|
return /* @__PURE__ */ jsxs2(
|
|
193
200
|
"div",
|
|
194
201
|
{
|
|
195
|
-
className:
|
|
202
|
+
className: cn(baseClasses, variantClasses, sizeClasses, className),
|
|
196
203
|
...props,
|
|
197
204
|
children: [
|
|
198
|
-
iconLeft && /* @__PURE__ */ jsx3("span", { className:
|
|
205
|
+
iconLeft && /* @__PURE__ */ jsx3("span", { className: cn(baseClassesIcon, sizeClassesIcon), children: iconLeft }),
|
|
199
206
|
children,
|
|
200
|
-
iconRight && /* @__PURE__ */ jsx3("span", { className:
|
|
207
|
+
iconRight && /* @__PURE__ */ jsx3("span", { className: cn(baseClassesIcon, sizeClassesIcon), children: iconRight })
|
|
201
208
|
]
|
|
202
209
|
}
|
|
203
210
|
);
|
|
@@ -250,37 +257,30 @@ var Alert = ({
|
|
|
250
257
|
const variantColor = COLOR_CLASSES[action];
|
|
251
258
|
const variantIcon = ICONS[action];
|
|
252
259
|
const hasHeading = Boolean(title);
|
|
253
|
-
return /* @__PURE__ */ jsxs3(
|
|
254
|
-
"
|
|
255
|
-
{
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
children: description
|
|
278
|
-
}
|
|
279
|
-
)
|
|
280
|
-
] })
|
|
281
|
-
]
|
|
282
|
-
}
|
|
283
|
-
);
|
|
260
|
+
return /* @__PURE__ */ jsxs3("div", { className: cn(baseClasses, variantClasses, className), ...props, children: [
|
|
261
|
+
/* @__PURE__ */ jsx4("span", { className: cn("mt-0.5", variantColor), children: variantIcon }),
|
|
262
|
+
/* @__PURE__ */ jsxs3("div", { children: [
|
|
263
|
+
hasHeading && /* @__PURE__ */ jsx4(
|
|
264
|
+
Text_default,
|
|
265
|
+
{
|
|
266
|
+
size: "md",
|
|
267
|
+
weight: "medium",
|
|
268
|
+
color: variantColor,
|
|
269
|
+
className: "mb-0.5",
|
|
270
|
+
children: title
|
|
271
|
+
}
|
|
272
|
+
),
|
|
273
|
+
/* @__PURE__ */ jsx4(
|
|
274
|
+
Text_default,
|
|
275
|
+
{
|
|
276
|
+
size: hasHeading ? "sm" : "md",
|
|
277
|
+
weight: "normal",
|
|
278
|
+
color: !hasHeading ? variantColor : "text-text-700",
|
|
279
|
+
children: description
|
|
280
|
+
}
|
|
281
|
+
)
|
|
282
|
+
] })
|
|
283
|
+
] });
|
|
284
284
|
};
|
|
285
285
|
var Alert_default = Alert;
|
|
286
286
|
|
|
@@ -324,7 +324,7 @@ var IconButton = forwardRef(
|
|
|
324
324
|
{
|
|
325
325
|
ref,
|
|
326
326
|
type: "button",
|
|
327
|
-
className:
|
|
327
|
+
className: cn(allClasses, className),
|
|
328
328
|
disabled,
|
|
329
329
|
"aria-pressed": active,
|
|
330
330
|
"aria-label": ariaLabel,
|
|
@@ -370,7 +370,7 @@ var IconRoundedButton = ({
|
|
|
370
370
|
"button",
|
|
371
371
|
{
|
|
372
372
|
type: "button",
|
|
373
|
-
className:
|
|
373
|
+
className: cn(baseClasses, className),
|
|
374
374
|
disabled,
|
|
375
375
|
...props,
|
|
376
376
|
children: /* @__PURE__ */ jsx6("span", { className: "flex items-center justify-center w-5 h-5", children: icon })
|
|
@@ -414,7 +414,7 @@ var NavButton = forwardRef2(
|
|
|
414
414
|
{
|
|
415
415
|
ref,
|
|
416
416
|
type: "button",
|
|
417
|
-
className:
|
|
417
|
+
className: cn(allClasses, className),
|
|
418
418
|
disabled,
|
|
419
419
|
"aria-pressed": selected,
|
|
420
420
|
...props,
|
|
@@ -469,7 +469,7 @@ var SelectionButton = forwardRef3(
|
|
|
469
469
|
{
|
|
470
470
|
ref,
|
|
471
471
|
type: "button",
|
|
472
|
-
className:
|
|
472
|
+
className: cn(allClasses, className),
|
|
473
473
|
disabled,
|
|
474
474
|
"aria-pressed": selected,
|
|
475
475
|
...props,
|
|
@@ -492,7 +492,7 @@ var Table = forwardRef4(
|
|
|
492
492
|
"table",
|
|
493
493
|
{
|
|
494
494
|
ref,
|
|
495
|
-
className:
|
|
495
|
+
className: cn("w-full caption-bottom text-sm", className),
|
|
496
496
|
...props,
|
|
497
497
|
children: [
|
|
498
498
|
/* @__PURE__ */ jsx9("caption", { className: "sr-only", children: "My Table" }),
|
|
@@ -506,7 +506,7 @@ var TableHeader = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
506
506
|
"thead",
|
|
507
507
|
{
|
|
508
508
|
ref,
|
|
509
|
-
className:
|
|
509
|
+
className: cn("[&_tr:first-child]:border-0", className),
|
|
510
510
|
...props
|
|
511
511
|
}
|
|
512
512
|
));
|
|
@@ -515,7 +515,10 @@ var TableBody = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ js
|
|
|
515
515
|
"tbody",
|
|
516
516
|
{
|
|
517
517
|
ref,
|
|
518
|
-
className:
|
|
518
|
+
className: cn(
|
|
519
|
+
"[&_tr:last-child]:border-0 border-t border-border-200",
|
|
520
|
+
className
|
|
521
|
+
),
|
|
519
522
|
...props
|
|
520
523
|
}
|
|
521
524
|
));
|
|
@@ -524,7 +527,10 @@ var TableFooter = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
524
527
|
"tfoot",
|
|
525
528
|
{
|
|
526
529
|
ref,
|
|
527
|
-
className:
|
|
530
|
+
className: cn(
|
|
531
|
+
"border-t bg-background-50 border-border-200 font-medium [&>tr]:last:border-b-0 px-6 py-3.5",
|
|
532
|
+
className
|
|
533
|
+
),
|
|
528
534
|
...props
|
|
529
535
|
}
|
|
530
536
|
));
|
|
@@ -541,12 +547,12 @@ var TableRow = forwardRef4(
|
|
|
541
547
|
"tr",
|
|
542
548
|
{
|
|
543
549
|
ref,
|
|
544
|
-
className:
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
+
className: cn(
|
|
551
|
+
"transition-colors",
|
|
552
|
+
state !== "disabled" ? "hover:bg-muted/50" : "",
|
|
553
|
+
VARIANT_STATES_ROW[state],
|
|
554
|
+
className
|
|
555
|
+
),
|
|
550
556
|
"aria-disabled": state === "disabled",
|
|
551
557
|
...props
|
|
552
558
|
}
|
|
@@ -558,7 +564,10 @@ var TableHead = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ js
|
|
|
558
564
|
"th",
|
|
559
565
|
{
|
|
560
566
|
ref,
|
|
561
|
-
className:
|
|
567
|
+
className: cn(
|
|
568
|
+
"h-10 px-6 py-3.5 bg-muted/50 text-left align-middle font-bold text-text-800 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
569
|
+
className
|
|
570
|
+
),
|
|
562
571
|
...props
|
|
563
572
|
}
|
|
564
573
|
));
|
|
@@ -567,7 +576,10 @@ var TableCell = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ js
|
|
|
567
576
|
"td",
|
|
568
577
|
{
|
|
569
578
|
ref,
|
|
570
|
-
className:
|
|
579
|
+
className: cn(
|
|
580
|
+
"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-md text-text-800 px-6 py-3.5",
|
|
581
|
+
className
|
|
582
|
+
),
|
|
571
583
|
...props
|
|
572
584
|
}
|
|
573
585
|
));
|
|
@@ -576,7 +588,10 @@ var TableCaption = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
576
588
|
"caption",
|
|
577
589
|
{
|
|
578
590
|
ref,
|
|
579
|
-
className:
|
|
591
|
+
className: cn(
|
|
592
|
+
"border-t border-border-200 text-sm text-text-800 px-6 py-3.5",
|
|
593
|
+
className
|
|
594
|
+
),
|
|
580
595
|
...props
|
|
581
596
|
}
|
|
582
597
|
));
|
|
@@ -682,7 +697,13 @@ var CheckBox = forwardRef5(
|
|
|
682
697
|
const checkVariant = checked || indeterminate ? "checked" : "unchecked";
|
|
683
698
|
const stylingClasses = STATE_CLASSES[currentState][checkVariant];
|
|
684
699
|
const borderWidthClass = state === "focused" || state === "hovered" && size === "large" ? "border-[3px]" : sizeClasses.borderWidth;
|
|
685
|
-
const checkboxClasses =
|
|
700
|
+
const checkboxClasses = cn(
|
|
701
|
+
BASE_CHECKBOX_CLASSES,
|
|
702
|
+
sizeClasses.checkbox,
|
|
703
|
+
borderWidthClass,
|
|
704
|
+
stylingClasses,
|
|
705
|
+
className
|
|
706
|
+
);
|
|
686
707
|
const renderIcon = () => {
|
|
687
708
|
if (indeterminate) {
|
|
688
709
|
return /* @__PURE__ */ jsx10(
|
|
@@ -710,7 +731,11 @@ var CheckBox = forwardRef5(
|
|
|
710
731
|
/* @__PURE__ */ jsxs7(
|
|
711
732
|
"div",
|
|
712
733
|
{
|
|
713
|
-
className:
|
|
734
|
+
className: cn(
|
|
735
|
+
"flex flex-row items-center",
|
|
736
|
+
sizeClasses.spacing,
|
|
737
|
+
disabled ? "opacity-40" : ""
|
|
738
|
+
),
|
|
714
739
|
children: [
|
|
715
740
|
/* @__PURE__ */ jsx10(
|
|
716
741
|
"input",
|
|
@@ -729,7 +754,10 @@ var CheckBox = forwardRef5(
|
|
|
729
754
|
label && /* @__PURE__ */ jsx10(
|
|
730
755
|
"div",
|
|
731
756
|
{
|
|
732
|
-
className:
|
|
757
|
+
className: cn(
|
|
758
|
+
"flex flex-row items-center",
|
|
759
|
+
sizeClasses.labelHeight
|
|
760
|
+
),
|
|
733
761
|
children: /* @__PURE__ */ jsx10(
|
|
734
762
|
Text_default,
|
|
735
763
|
{
|
|
@@ -737,7 +765,10 @@ var CheckBox = forwardRef5(
|
|
|
737
765
|
htmlFor: inputId,
|
|
738
766
|
size: sizeClasses.textSize,
|
|
739
767
|
weight: "normal",
|
|
740
|
-
className:
|
|
768
|
+
className: cn(
|
|
769
|
+
"cursor-pointer select-none leading-[150%] flex items-center font-roboto",
|
|
770
|
+
labelClassName
|
|
771
|
+
),
|
|
741
772
|
children: label
|
|
742
773
|
}
|
|
743
774
|
)
|
|
@@ -896,8 +927,19 @@ var Radio = forwardRef6(
|
|
|
896
927
|
return sizeClasses.borderWidth;
|
|
897
928
|
};
|
|
898
929
|
const borderWidthClass = getBorderWidth();
|
|
899
|
-
const radioClasses =
|
|
900
|
-
|
|
930
|
+
const radioClasses = cn(
|
|
931
|
+
BASE_RADIO_CLASSES,
|
|
932
|
+
actualRadioSize,
|
|
933
|
+
borderWidthClass,
|
|
934
|
+
stylingClasses,
|
|
935
|
+
className
|
|
936
|
+
);
|
|
937
|
+
const dotClasses = cn(
|
|
938
|
+
actualDotSize,
|
|
939
|
+
"rounded-full",
|
|
940
|
+
DOT_CLASSES[currentState],
|
|
941
|
+
"transition-all duration-200"
|
|
942
|
+
);
|
|
901
943
|
const isWrapperNeeded = currentState === "focused" || currentState === "invalid";
|
|
902
944
|
const wrapperBorderColor = currentState === "focused" ? "border-indicator-info" : "border-indicator-error";
|
|
903
945
|
const getTextColor = () => {
|
|
@@ -916,7 +958,11 @@ var Radio = forwardRef6(
|
|
|
916
958
|
/* @__PURE__ */ jsxs8(
|
|
917
959
|
"div",
|
|
918
960
|
{
|
|
919
|
-
className:
|
|
961
|
+
className: cn(
|
|
962
|
+
"flex flex-row items-center",
|
|
963
|
+
isWrapperNeeded ? cn("p-1 border-2", wrapperBorderColor, "rounded-lg gap-1.5") : sizeClasses.spacing,
|
|
964
|
+
disabled ? "opacity-40" : ""
|
|
965
|
+
),
|
|
920
966
|
children: [
|
|
921
967
|
/* @__PURE__ */ jsx11(
|
|
922
968
|
"input",
|
|
@@ -973,7 +1019,11 @@ var Radio = forwardRef6(
|
|
|
973
1019
|
label && /* @__PURE__ */ jsx11(
|
|
974
1020
|
"div",
|
|
975
1021
|
{
|
|
976
|
-
className:
|
|
1022
|
+
className: cn(
|
|
1023
|
+
"flex flex-row items-center",
|
|
1024
|
+
sizeClasses.labelHeight,
|
|
1025
|
+
"flex-1 min-w-0"
|
|
1026
|
+
),
|
|
977
1027
|
children: /* @__PURE__ */ jsx11(
|
|
978
1028
|
Text_default,
|
|
979
1029
|
{
|
|
@@ -981,7 +1031,11 @@ var Radio = forwardRef6(
|
|
|
981
1031
|
htmlFor: inputId,
|
|
982
1032
|
size: sizeClasses.textSize,
|
|
983
1033
|
weight: "normal",
|
|
984
|
-
className:
|
|
1034
|
+
className: cn(
|
|
1035
|
+
getCursorClass(),
|
|
1036
|
+
"select-none leading-normal flex items-center font-roboto truncate",
|
|
1037
|
+
labelClassName
|
|
1038
|
+
),
|
|
985
1039
|
color: getTextColor(),
|
|
986
1040
|
children: label
|
|
987
1041
|
}
|
|
@@ -1233,7 +1287,14 @@ var TextArea = forwardRef7(
|
|
|
1233
1287
|
}
|
|
1234
1288
|
const sizeClasses = SIZE_CLASSES5[size];
|
|
1235
1289
|
const stateClasses = STATE_CLASSES3[currentState];
|
|
1236
|
-
const textareaClasses =
|
|
1290
|
+
const textareaClasses = cn(
|
|
1291
|
+
BASE_TEXTAREA_CLASSES,
|
|
1292
|
+
sizeClasses.textarea,
|
|
1293
|
+
stateClasses.base,
|
|
1294
|
+
stateClasses.hover,
|
|
1295
|
+
stateClasses.focus,
|
|
1296
|
+
className
|
|
1297
|
+
);
|
|
1237
1298
|
return /* @__PURE__ */ jsxs9("div", { className: `flex flex-col`, children: [
|
|
1238
1299
|
label && /* @__PURE__ */ jsx12(
|
|
1239
1300
|
Text_default,
|
|
@@ -1243,7 +1304,7 @@ var TextArea = forwardRef7(
|
|
|
1243
1304
|
size: sizeClasses.textSize,
|
|
1244
1305
|
weight: "medium",
|
|
1245
1306
|
color: "text-text-950",
|
|
1246
|
-
className:
|
|
1307
|
+
className: cn("mb-1.5", labelClassName),
|
|
1247
1308
|
children: label
|
|
1248
1309
|
}
|
|
1249
1310
|
),
|
|
@@ -1321,7 +1382,12 @@ var Toast = ({
|
|
|
1321
1382
|
role: "alert",
|
|
1322
1383
|
"aria-live": "assertive",
|
|
1323
1384
|
"aria-atomic": "true",
|
|
1324
|
-
className:
|
|
1385
|
+
className: cn(
|
|
1386
|
+
baseClasses,
|
|
1387
|
+
positionClasses[position],
|
|
1388
|
+
variantClasses,
|
|
1389
|
+
className
|
|
1390
|
+
),
|
|
1325
1391
|
...props,
|
|
1326
1392
|
children: [
|
|
1327
1393
|
/* @__PURE__ */ jsxs10("div", { className: "flex flex-row items-start gap-3", children: [
|
|
@@ -1399,7 +1465,7 @@ var Divider = ({
|
|
|
1399
1465
|
return /* @__PURE__ */ jsx15(
|
|
1400
1466
|
"hr",
|
|
1401
1467
|
{
|
|
1402
|
-
className:
|
|
1468
|
+
className: cn(baseClasses, orientationClasses[orientation], className),
|
|
1403
1469
|
"aria-orientation": orientation,
|
|
1404
1470
|
...props
|
|
1405
1471
|
}
|
|
@@ -1595,7 +1661,7 @@ var Chips = ({
|
|
|
1595
1661
|
return /* @__PURE__ */ jsxs12(
|
|
1596
1662
|
"button",
|
|
1597
1663
|
{
|
|
1598
|
-
className:
|
|
1664
|
+
className: cn(baseClasses, stateClasses, className),
|
|
1599
1665
|
disabled,
|
|
1600
1666
|
type,
|
|
1601
1667
|
...props,
|
|
@@ -1724,7 +1790,10 @@ var renderStackedHitCountDisplay = (showHitCount, showPercentage, clampedValue,
|
|
|
1724
1790
|
return /* @__PURE__ */ jsx18(
|
|
1725
1791
|
"div",
|
|
1726
1792
|
{
|
|
1727
|
-
className:
|
|
1793
|
+
className: cn(
|
|
1794
|
+
"text-xs font-medium leading-[14px] text-right",
|
|
1795
|
+
percentageClassName
|
|
1796
|
+
),
|
|
1728
1797
|
children: displayPriority.type === "hitCount" ? /* @__PURE__ */ jsxs13(Fragment2, { children: [
|
|
1729
1798
|
/* @__PURE__ */ jsx18("span", { className: "text-success-200", children: Math.round(clampedValue) }),
|
|
1730
1799
|
/* @__PURE__ */ jsxs13("span", { className: "text-text-600", children: [
|
|
@@ -1749,7 +1818,11 @@ var ProgressBarBase = ({
|
|
|
1749
1818
|
}) => /* @__PURE__ */ jsxs13(
|
|
1750
1819
|
"div",
|
|
1751
1820
|
{
|
|
1752
|
-
className:
|
|
1821
|
+
className: cn(
|
|
1822
|
+
containerClassName,
|
|
1823
|
+
variantClasses.background,
|
|
1824
|
+
"overflow-hidden relative"
|
|
1825
|
+
),
|
|
1753
1826
|
children: [
|
|
1754
1827
|
/* @__PURE__ */ jsx18(
|
|
1755
1828
|
"progress",
|
|
@@ -1763,7 +1836,11 @@ var ProgressBarBase = ({
|
|
|
1763
1836
|
/* @__PURE__ */ jsx18(
|
|
1764
1837
|
"div",
|
|
1765
1838
|
{
|
|
1766
|
-
className:
|
|
1839
|
+
className: cn(
|
|
1840
|
+
fillClassName,
|
|
1841
|
+
variantClasses.fill,
|
|
1842
|
+
"transition-all duration-300 ease-out"
|
|
1843
|
+
),
|
|
1767
1844
|
style: { width: `${percentage}%` }
|
|
1768
1845
|
}
|
|
1769
1846
|
)
|
|
@@ -1785,7 +1862,12 @@ var StackedLayout = ({
|
|
|
1785
1862
|
}) => /* @__PURE__ */ jsxs13(
|
|
1786
1863
|
"div",
|
|
1787
1864
|
{
|
|
1788
|
-
className:
|
|
1865
|
+
className: cn(
|
|
1866
|
+
"flex flex-col items-start gap-2",
|
|
1867
|
+
dimensions.width,
|
|
1868
|
+
dimensions.height,
|
|
1869
|
+
className
|
|
1870
|
+
),
|
|
1789
1871
|
children: [
|
|
1790
1872
|
shouldShowHeader(label, showPercentage, showHitCount) && /* @__PURE__ */ jsxs13("div", { className: "flex flex-row justify-between items-center w-full h-[19px]", children: [
|
|
1791
1873
|
label && /* @__PURE__ */ jsx18(
|
|
@@ -1794,7 +1876,7 @@ var StackedLayout = ({
|
|
|
1794
1876
|
as: "div",
|
|
1795
1877
|
size: "md",
|
|
1796
1878
|
weight: "medium",
|
|
1797
|
-
className:
|
|
1879
|
+
className: cn("text-text-600 leading-[19px]", labelClassName),
|
|
1798
1880
|
children: label
|
|
1799
1881
|
}
|
|
1800
1882
|
),
|
|
@@ -1852,7 +1934,12 @@ var CompactLayout = ({
|
|
|
1852
1934
|
return /* @__PURE__ */ jsxs13(
|
|
1853
1935
|
"div",
|
|
1854
1936
|
{
|
|
1855
|
-
className:
|
|
1937
|
+
className: cn(
|
|
1938
|
+
"flex flex-col items-start gap-1",
|
|
1939
|
+
dimensions.width,
|
|
1940
|
+
dimensions.height,
|
|
1941
|
+
className
|
|
1942
|
+
),
|
|
1856
1943
|
children: [
|
|
1857
1944
|
shouldShowHeader(label, showPercentage, showHitCount) && /* @__PURE__ */ jsx18(
|
|
1858
1945
|
Text_default,
|
|
@@ -1861,7 +1948,7 @@ var CompactLayout = ({
|
|
|
1861
1948
|
size: "sm",
|
|
1862
1949
|
weight: "medium",
|
|
1863
1950
|
color,
|
|
1864
|
-
className:
|
|
1951
|
+
className: cn("leading-4 w-full", compactClassName),
|
|
1865
1952
|
children: content
|
|
1866
1953
|
}
|
|
1867
1954
|
),
|
|
@@ -1901,7 +1988,7 @@ var DefaultLayout = ({
|
|
|
1901
1988
|
label,
|
|
1902
1989
|
showPercentage
|
|
1903
1990
|
);
|
|
1904
|
-
return /* @__PURE__ */ jsxs13("div", { className:
|
|
1991
|
+
return /* @__PURE__ */ jsxs13("div", { className: cn("flex", sizeClasses.layout, gapClass, className), children: [
|
|
1905
1992
|
displayConfig.showHeader && /* @__PURE__ */ jsxs13("div", { className: "flex flex-row items-center justify-between w-full", children: [
|
|
1906
1993
|
label && /* @__PURE__ */ jsx18(
|
|
1907
1994
|
Text_default,
|
|
@@ -1909,7 +1996,10 @@ var DefaultLayout = ({
|
|
|
1909
1996
|
as: "div",
|
|
1910
1997
|
size: "xs",
|
|
1911
1998
|
weight: "medium",
|
|
1912
|
-
className:
|
|
1999
|
+
className: cn(
|
|
2000
|
+
"text-text-950 leading-none tracking-normal text-center",
|
|
2001
|
+
labelClassName
|
|
2002
|
+
),
|
|
1913
2003
|
children: label
|
|
1914
2004
|
}
|
|
1915
2005
|
),
|
|
@@ -1918,7 +2008,10 @@ var DefaultLayout = ({
|
|
|
1918
2008
|
{
|
|
1919
2009
|
size: "xs",
|
|
1920
2010
|
weight: "medium",
|
|
1921
|
-
className:
|
|
2011
|
+
className: cn(
|
|
2012
|
+
"text-text-950 leading-none tracking-normal text-center",
|
|
2013
|
+
percentageClassName
|
|
2014
|
+
),
|
|
1922
2015
|
children: [
|
|
1923
2016
|
Math.round(percentage),
|
|
1924
2017
|
"%"
|
|
@@ -1934,8 +2027,16 @@ var DefaultLayout = ({
|
|
|
1934
2027
|
percentage,
|
|
1935
2028
|
label,
|
|
1936
2029
|
variantClasses,
|
|
1937
|
-
containerClassName:
|
|
1938
|
-
|
|
2030
|
+
containerClassName: cn(
|
|
2031
|
+
progressBarClass,
|
|
2032
|
+
sizeClasses.container,
|
|
2033
|
+
sizeClasses.borderRadius
|
|
2034
|
+
),
|
|
2035
|
+
fillClassName: cn(
|
|
2036
|
+
sizeClasses.bar,
|
|
2037
|
+
sizeClasses.borderRadius,
|
|
2038
|
+
"shadow-hard-shadow-3"
|
|
2039
|
+
)
|
|
1939
2040
|
}
|
|
1940
2041
|
),
|
|
1941
2042
|
displayConfig.showPercentage && /* @__PURE__ */ jsxs13(
|
|
@@ -1943,7 +2044,10 @@ var DefaultLayout = ({
|
|
|
1943
2044
|
{
|
|
1944
2045
|
size: "xs",
|
|
1945
2046
|
weight: "medium",
|
|
1946
|
-
className:
|
|
2047
|
+
className: cn(
|
|
2048
|
+
"text-text-950 leading-none tracking-normal text-center flex-none",
|
|
2049
|
+
percentageClassName
|
|
2050
|
+
),
|
|
1947
2051
|
children: [
|
|
1948
2052
|
Math.round(percentage),
|
|
1949
2053
|
"%"
|
|
@@ -1956,7 +2060,10 @@ var DefaultLayout = ({
|
|
|
1956
2060
|
as: "div",
|
|
1957
2061
|
size: "xs",
|
|
1958
2062
|
weight: "medium",
|
|
1959
|
-
className:
|
|
2063
|
+
className: cn(
|
|
2064
|
+
"text-text-950 leading-none tracking-normal text-center flex-none",
|
|
2065
|
+
labelClassName
|
|
2066
|
+
),
|
|
1960
2067
|
children: label
|
|
1961
2068
|
}
|
|
1962
2069
|
)
|
|
@@ -2129,7 +2236,12 @@ var ProgressCircle = ({
|
|
|
2129
2236
|
return /* @__PURE__ */ jsxs14(
|
|
2130
2237
|
"div",
|
|
2131
2238
|
{
|
|
2132
|
-
className:
|
|
2239
|
+
className: cn(
|
|
2240
|
+
"relative flex flex-col items-center justify-center",
|
|
2241
|
+
sizeClasses.container,
|
|
2242
|
+
"rounded-lg",
|
|
2243
|
+
className
|
|
2244
|
+
),
|
|
2133
2245
|
children: [
|
|
2134
2246
|
/* @__PURE__ */ jsxs14(
|
|
2135
2247
|
"svg",
|
|
@@ -2148,7 +2260,7 @@ var ProgressCircle = ({
|
|
|
2148
2260
|
r: radius,
|
|
2149
2261
|
fill: "none",
|
|
2150
2262
|
strokeWidth: sizeClasses.strokeWidth,
|
|
2151
|
-
className:
|
|
2263
|
+
className: cn(variantClasses.background, "rounded-lg")
|
|
2152
2264
|
}
|
|
2153
2265
|
),
|
|
2154
2266
|
/* @__PURE__ */ jsx19(
|
|
@@ -2162,7 +2274,10 @@ var ProgressCircle = ({
|
|
|
2162
2274
|
strokeLinecap: "round",
|
|
2163
2275
|
strokeDasharray: circumference,
|
|
2164
2276
|
strokeDashoffset,
|
|
2165
|
-
className:
|
|
2277
|
+
className: cn(
|
|
2278
|
+
variantClasses.fill,
|
|
2279
|
+
"transition-all duration-500 ease-out shadow-soft-shadow-3 rounded-lg"
|
|
2280
|
+
)
|
|
2166
2281
|
}
|
|
2167
2282
|
)
|
|
2168
2283
|
]
|
|
@@ -2180,14 +2295,22 @@ var ProgressCircle = ({
|
|
|
2180
2295
|
/* @__PURE__ */ jsxs14(
|
|
2181
2296
|
"div",
|
|
2182
2297
|
{
|
|
2183
|
-
className:
|
|
2298
|
+
className: cn(
|
|
2299
|
+
"relative z-10 flex flex-col items-center justify-center",
|
|
2300
|
+
sizeClasses.spacing,
|
|
2301
|
+
sizeClasses.contentWidth
|
|
2302
|
+
),
|
|
2184
2303
|
children: [
|
|
2185
2304
|
showPercentage && /* @__PURE__ */ jsxs14(
|
|
2186
2305
|
Text_default,
|
|
2187
2306
|
{
|
|
2188
2307
|
size: sizeClasses.textSize,
|
|
2189
2308
|
weight: sizeClasses.textWeight,
|
|
2190
|
-
className:
|
|
2309
|
+
className: cn(
|
|
2310
|
+
"text-center w-full",
|
|
2311
|
+
variantClasses.textColor,
|
|
2312
|
+
percentageClassName
|
|
2313
|
+
),
|
|
2191
2314
|
children: [
|
|
2192
2315
|
Math.round(percentage),
|
|
2193
2316
|
"%"
|
|
@@ -2200,7 +2323,11 @@ var ProgressCircle = ({
|
|
|
2200
2323
|
as: "span",
|
|
2201
2324
|
size: sizeClasses.labelSize,
|
|
2202
2325
|
weight: sizeClasses.labelWeight,
|
|
2203
|
-
className:
|
|
2326
|
+
className: cn(
|
|
2327
|
+
variantClasses.labelColor,
|
|
2328
|
+
"text-center uppercase tracking-wide truncate w-full",
|
|
2329
|
+
labelClassName
|
|
2330
|
+
),
|
|
2204
2331
|
children: label
|
|
2205
2332
|
}
|
|
2206
2333
|
)
|
|
@@ -2399,7 +2526,10 @@ var Step = ({
|
|
|
2399
2526
|
size: sizeClasses.indicatorTextSize,
|
|
2400
2527
|
weight: "medium",
|
|
2401
2528
|
color: "",
|
|
2402
|
-
className:
|
|
2529
|
+
className: cn(
|
|
2530
|
+
stateClasses.indicatorText,
|
|
2531
|
+
"leading-none text-2xs sm:text-xs"
|
|
2532
|
+
),
|
|
2403
2533
|
children: stepNumber
|
|
2404
2534
|
}
|
|
2405
2535
|
)
|
|
@@ -2411,13 +2541,10 @@ var Step = ({
|
|
|
2411
2541
|
size: sizeClasses.labelTextSize,
|
|
2412
2542
|
weight: "medium",
|
|
2413
2543
|
color: "",
|
|
2414
|
-
className:
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
text-2xs sm:text-xs md:text-xs lg:text-sm
|
|
2419
|
-
whitespace-normal
|
|
2420
|
-
`,
|
|
2544
|
+
className: cn(
|
|
2545
|
+
stateClasses.label,
|
|
2546
|
+
"leading-tight flex-none text-center sm:text-left break-words px-1 sm:px-0 max-w-full text-2xs sm:text-xs md:text-xs lg:text-sm whitespace-normal"
|
|
2547
|
+
),
|
|
2421
2548
|
children: step.label
|
|
2422
2549
|
}
|
|
2423
2550
|
)
|
|
@@ -2463,7 +2590,11 @@ var Stepper = ({
|
|
|
2463
2590
|
return /* @__PURE__ */ jsxs15(
|
|
2464
2591
|
"fieldset",
|
|
2465
2592
|
{
|
|
2466
|
-
className:
|
|
2593
|
+
className: cn(
|
|
2594
|
+
"flex flex-col gap-4 sm:gap-5 md:gap-6",
|
|
2595
|
+
className,
|
|
2596
|
+
"border-0 p-0 m-0"
|
|
2597
|
+
),
|
|
2467
2598
|
children: [
|
|
2468
2599
|
/* @__PURE__ */ jsx20("legend", { className: "absolute w-px h-px p-0 -m-px overflow-hidden whitespace-nowrap border-0", children: "Stepper de formul\xE1rio" }),
|
|
2469
2600
|
showProgress && currentStep !== void 0 && /* @__PURE__ */ jsx20(
|
|
@@ -2478,14 +2609,12 @@ var Stepper = ({
|
|
|
2478
2609
|
/* @__PURE__ */ jsx20(
|
|
2479
2610
|
"div",
|
|
2480
2611
|
{
|
|
2481
|
-
className:
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
gap-2 sm:gap-3 md:gap-4 lg:gap-4
|
|
2488
|
-
`,
|
|
2612
|
+
className: cn(
|
|
2613
|
+
"flex items-center",
|
|
2614
|
+
sizeClasses.container,
|
|
2615
|
+
responsive ? "flex-row overflow-x-auto overflow-y-hidden scrollbar-hide justify-start sm:justify-center md:justify-center lg:justify-center" : "flex-row justify-center",
|
|
2616
|
+
"px-2 sm:px-4 md:px-6 lg:px-0 max-w-full min-w-0 gap-2 sm:gap-3 md:gap-4 lg:gap-4"
|
|
2617
|
+
),
|
|
2489
2618
|
role: "tablist",
|
|
2490
2619
|
"aria-label": "Progress steps",
|
|
2491
2620
|
children: steps.map((step, index) => {
|
|
@@ -2697,7 +2826,7 @@ var Calendar = ({
|
|
|
2697
2826
|
onDateSelect?.(day.date);
|
|
2698
2827
|
};
|
|
2699
2828
|
if (variant === "navigation") {
|
|
2700
|
-
return /* @__PURE__ */ jsxs16("div", { className:
|
|
2829
|
+
return /* @__PURE__ */ jsxs16("div", { className: cn("bg-background rounded-xl pt-6", className), children: [
|
|
2701
2830
|
/* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between mb-4 px-6", children: [
|
|
2702
2831
|
/* @__PURE__ */ jsxs16("div", { className: "relative", ref: monthPickerContainerRef, children: [
|
|
2703
2832
|
/* @__PURE__ */ jsxs16(
|
|
@@ -2857,7 +2986,7 @@ var Calendar = ({
|
|
|
2857
2986
|
}) })
|
|
2858
2987
|
] });
|
|
2859
2988
|
}
|
|
2860
|
-
return /* @__PURE__ */ jsxs16("div", { className:
|
|
2989
|
+
return /* @__PURE__ */ jsxs16("div", { className: cn("bg-background rounded-xl p-4", className), children: [
|
|
2861
2990
|
/* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between mb-3.5", children: [
|
|
2862
2991
|
/* @__PURE__ */ jsxs16("div", { className: "relative", ref: monthPickerContainerRef, children: [
|
|
2863
2992
|
/* @__PURE__ */ jsxs16(
|
|
@@ -3072,7 +3201,12 @@ var Modal = ({
|
|
|
3072
3201
|
const sizeClasses = SIZE_CLASSES10[size];
|
|
3073
3202
|
const baseClasses = "bg-secondary-50 rounded-3xl shadow-hard-shadow-2 border border-border-100 w-full mx-4";
|
|
3074
3203
|
const dialogResetClasses = "p-0 m-0 border-none outline-none max-h-none static";
|
|
3075
|
-
const modalClasses =
|
|
3204
|
+
const modalClasses = cn(
|
|
3205
|
+
baseClasses,
|
|
3206
|
+
sizeClasses,
|
|
3207
|
+
dialogResetClasses,
|
|
3208
|
+
className
|
|
3209
|
+
);
|
|
3076
3210
|
return /* @__PURE__ */ jsx22(
|
|
3077
3211
|
"div",
|
|
3078
3212
|
{
|
|
@@ -3226,21 +3360,28 @@ var CardActivitiesResults = forwardRef9(
|
|
|
3226
3360
|
"div",
|
|
3227
3361
|
{
|
|
3228
3362
|
ref,
|
|
3229
|
-
className:
|
|
3363
|
+
className: cn(
|
|
3364
|
+
"w-full flex flex-col border border-border-50 bg-background rounded-xl",
|
|
3365
|
+
className
|
|
3366
|
+
),
|
|
3230
3367
|
...props,
|
|
3231
3368
|
children: [
|
|
3232
3369
|
/* @__PURE__ */ jsxs18(
|
|
3233
3370
|
"div",
|
|
3234
3371
|
{
|
|
3235
|
-
className:
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3372
|
+
className: cn(
|
|
3373
|
+
"flex flex-col gap-1 items-center justify-center p-4",
|
|
3374
|
+
actionCardClasses,
|
|
3375
|
+
extended ? "rounded-t-xl" : "rounded-xl"
|
|
3376
|
+
),
|
|
3239
3377
|
children: [
|
|
3240
3378
|
/* @__PURE__ */ jsx23(
|
|
3241
3379
|
"span",
|
|
3242
3380
|
{
|
|
3243
|
-
className:
|
|
3381
|
+
className: cn(
|
|
3382
|
+
"size-7.5 rounded-full flex items-center justify-center",
|
|
3383
|
+
actionIconClasses
|
|
3384
|
+
),
|
|
3244
3385
|
children: icon
|
|
3245
3386
|
}
|
|
3246
3387
|
),
|
|
@@ -3253,7 +3394,13 @@ var CardActivitiesResults = forwardRef9(
|
|
|
3253
3394
|
children: title
|
|
3254
3395
|
}
|
|
3255
3396
|
),
|
|
3256
|
-
/* @__PURE__ */ jsx23(
|
|
3397
|
+
/* @__PURE__ */ jsx23(
|
|
3398
|
+
"p",
|
|
3399
|
+
{
|
|
3400
|
+
className: cn("text-lg font-bold truncate", actionSubTitleClasses),
|
|
3401
|
+
children: subTitle
|
|
3402
|
+
}
|
|
3403
|
+
)
|
|
3257
3404
|
]
|
|
3258
3405
|
}
|
|
3259
3406
|
),
|
|
@@ -3261,7 +3408,10 @@ var CardActivitiesResults = forwardRef9(
|
|
|
3261
3408
|
/* @__PURE__ */ jsx23(
|
|
3262
3409
|
"p",
|
|
3263
3410
|
{
|
|
3264
|
-
className:
|
|
3411
|
+
className: cn(
|
|
3412
|
+
"text-2xs font-medium uppercase truncate",
|
|
3413
|
+
actionHeaderClasses
|
|
3414
|
+
),
|
|
3265
3415
|
children: header
|
|
3266
3416
|
}
|
|
3267
3417
|
),
|
|
@@ -3291,7 +3441,7 @@ var CardQuestions = forwardRef9(
|
|
|
3291
3441
|
layout: "horizontal",
|
|
3292
3442
|
padding: "medium",
|
|
3293
3443
|
minHeight: "medium",
|
|
3294
|
-
className:
|
|
3444
|
+
className: cn("justify-between gap-4", className),
|
|
3295
3445
|
...props,
|
|
3296
3446
|
children: [
|
|
3297
3447
|
/* @__PURE__ */ jsxs18("section", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
|
|
@@ -3369,7 +3519,9 @@ var CardProgress = forwardRef9(
|
|
|
3369
3519
|
{
|
|
3370
3520
|
size: "xs",
|
|
3371
3521
|
weight: "medium",
|
|
3372
|
-
className:
|
|
3522
|
+
className: cn(
|
|
3523
|
+
"text-text-950 leading-none tracking-normal text-center flex-none"
|
|
3524
|
+
),
|
|
3373
3525
|
children: [
|
|
3374
3526
|
Math.round(progress),
|
|
3375
3527
|
"%"
|
|
@@ -3388,17 +3540,17 @@ var CardProgress = forwardRef9(
|
|
|
3388
3540
|
padding: "none",
|
|
3389
3541
|
minHeight: "medium",
|
|
3390
3542
|
cursor: "pointer",
|
|
3391
|
-
className:
|
|
3543
|
+
className: cn(isHorizontal ? "h-20" : "", className),
|
|
3392
3544
|
...props,
|
|
3393
3545
|
children: [
|
|
3394
3546
|
/* @__PURE__ */ jsx23(
|
|
3395
3547
|
"div",
|
|
3396
3548
|
{
|
|
3397
|
-
className:
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3549
|
+
className: cn(
|
|
3550
|
+
"flex justify-center items-center [&>svg]:size-6 text-text-950",
|
|
3551
|
+
isHorizontal ? "min-w-[80px] min-h-[80px] rounded-l-xl" : "min-h-[50px] w-full rounded-t-xl",
|
|
3552
|
+
!color.startsWith("#") ? `bg-${color}` : ""
|
|
3553
|
+
),
|
|
3402
3554
|
style: color.startsWith("#") ? { backgroundColor: color } : void 0,
|
|
3403
3555
|
"data-testid": "icon-container",
|
|
3404
3556
|
children: icon
|
|
@@ -3407,10 +3559,10 @@ var CardProgress = forwardRef9(
|
|
|
3407
3559
|
/* @__PURE__ */ jsxs18(
|
|
3408
3560
|
"div",
|
|
3409
3561
|
{
|
|
3410
|
-
className:
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3562
|
+
className: cn(
|
|
3563
|
+
"p-4 flex flex-col justify-between w-full h-full",
|
|
3564
|
+
!isHorizontal && "gap-4"
|
|
3565
|
+
),
|
|
3414
3566
|
children: [
|
|
3415
3567
|
/* @__PURE__ */ jsx23(Text_default, { size: "sm", weight: "bold", className: "text-text-950 truncate", children: header }),
|
|
3416
3568
|
contentComponent[direction]
|
|
@@ -3440,7 +3592,7 @@ var CardTopic = forwardRef9(
|
|
|
3440
3592
|
padding: "small",
|
|
3441
3593
|
minHeight: "medium",
|
|
3442
3594
|
cursor: "pointer",
|
|
3443
|
-
className:
|
|
3595
|
+
className: cn("justify-center gap-2 py-2 px-4", className),
|
|
3444
3596
|
...props,
|
|
3445
3597
|
children: [
|
|
3446
3598
|
subHead && /* @__PURE__ */ jsx23("span", { className: "text-text-600 text-2xs flex flex-row gap-1", children: subHead.map((text, index) => /* @__PURE__ */ jsxs18(Fragment3, { children: [
|
|
@@ -3463,7 +3615,9 @@ var CardTopic = forwardRef9(
|
|
|
3463
3615
|
{
|
|
3464
3616
|
size: "xs",
|
|
3465
3617
|
weight: "medium",
|
|
3466
|
-
className:
|
|
3618
|
+
className: cn(
|
|
3619
|
+
"text-text-950 leading-none tracking-normal text-center flex-none"
|
|
3620
|
+
),
|
|
3467
3621
|
children: [
|
|
3468
3622
|
Math.round(progress),
|
|
3469
3623
|
"%"
|
|
@@ -3497,7 +3651,10 @@ var CardPerformance = forwardRef9(
|
|
|
3497
3651
|
layout: "horizontal",
|
|
3498
3652
|
padding: "medium",
|
|
3499
3653
|
minHeight: "none",
|
|
3500
|
-
className:
|
|
3654
|
+
className: cn(
|
|
3655
|
+
actionVariant == "caret" ? "cursor-pointer" : "",
|
|
3656
|
+
className
|
|
3657
|
+
),
|
|
3501
3658
|
onClick: () => actionVariant == "caret" && onClickButton?.(valueButton),
|
|
3502
3659
|
...props,
|
|
3503
3660
|
children: [
|
|
@@ -3555,15 +3712,15 @@ var CardResults = forwardRef9(
|
|
|
3555
3712
|
layout: "horizontal",
|
|
3556
3713
|
padding: "none",
|
|
3557
3714
|
minHeight: "medium",
|
|
3558
|
-
className:
|
|
3715
|
+
className: cn("items-center cursor-pointer pr-4", className),
|
|
3559
3716
|
...props,
|
|
3560
3717
|
children: [
|
|
3561
3718
|
/* @__PURE__ */ jsx23(
|
|
3562
3719
|
"div",
|
|
3563
3720
|
{
|
|
3564
|
-
className:
|
|
3565
|
-
|
|
3566
|
-
|
|
3721
|
+
className: cn(
|
|
3722
|
+
"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"
|
|
3723
|
+
),
|
|
3567
3724
|
style: {
|
|
3568
3725
|
backgroundColor: color
|
|
3569
3726
|
},
|
|
@@ -3573,10 +3730,10 @@ var CardResults = forwardRef9(
|
|
|
3573
3730
|
/* @__PURE__ */ jsxs18(
|
|
3574
3731
|
"div",
|
|
3575
3732
|
{
|
|
3576
|
-
className:
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3733
|
+
className: cn(
|
|
3734
|
+
"p-4 flex justify-between w-full h-full",
|
|
3735
|
+
isRow ? "flex-row items-center gap-2" : "flex-col"
|
|
3736
|
+
),
|
|
3580
3737
|
children: [
|
|
3581
3738
|
/* @__PURE__ */ jsx23("p", { className: "text-sm font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
|
|
3582
3739
|
/* @__PURE__ */ jsxs18("span", { className: "flex flex-row gap-1 items-center", children: [
|
|
@@ -3625,7 +3782,7 @@ var CardStatus = forwardRef9(
|
|
|
3625
3782
|
layout: "horizontal",
|
|
3626
3783
|
padding: "medium",
|
|
3627
3784
|
minHeight: "medium",
|
|
3628
|
-
className:
|
|
3785
|
+
className: cn("items-center cursor-pointer", className),
|
|
3629
3786
|
...props,
|
|
3630
3787
|
children: /* @__PURE__ */ jsxs18("div", { className: "flex justify-between w-full h-full flex-row items-center gap-2", children: [
|
|
3631
3788
|
/* @__PURE__ */ jsx23("p", { className: "text-sm font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
|
|
@@ -3657,7 +3814,10 @@ var CardSettings = forwardRef9(
|
|
|
3657
3814
|
layout: "horizontal",
|
|
3658
3815
|
padding: "small",
|
|
3659
3816
|
minHeight: "none",
|
|
3660
|
-
className:
|
|
3817
|
+
className: cn(
|
|
3818
|
+
"border-none items-center gap-2 text-text-700",
|
|
3819
|
+
className
|
|
3820
|
+
),
|
|
3661
3821
|
...props,
|
|
3662
3822
|
children: [
|
|
3663
3823
|
/* @__PURE__ */ jsx23("span", { className: "[&>svg]:size-6", children: icon }),
|
|
@@ -3677,15 +3837,19 @@ var CardSupport = forwardRef9(
|
|
|
3677
3837
|
layout: "horizontal",
|
|
3678
3838
|
padding: "medium",
|
|
3679
3839
|
minHeight: "none",
|
|
3680
|
-
className:
|
|
3840
|
+
className: cn(
|
|
3841
|
+
"border-none items-center gap-2 text-text-700",
|
|
3842
|
+
className
|
|
3843
|
+
),
|
|
3681
3844
|
...props,
|
|
3682
3845
|
children: [
|
|
3683
3846
|
/* @__PURE__ */ jsxs18(
|
|
3684
3847
|
"div",
|
|
3685
3848
|
{
|
|
3686
|
-
className:
|
|
3687
|
-
|
|
3688
|
-
|
|
3849
|
+
className: cn(
|
|
3850
|
+
"w-full flex",
|
|
3851
|
+
direction == "col" ? "flex-col" : "flex-row items-center"
|
|
3852
|
+
),
|
|
3689
3853
|
children: [
|
|
3690
3854
|
/* @__PURE__ */ jsx23("span", { className: "w-full min-w-0", children: /* @__PURE__ */ jsx23("p", { className: "text-sm text-text-950 font-bold truncate", children: header }) }),
|
|
3691
3855
|
/* @__PURE__ */ jsx23("span", { className: "flex flex-row gap-1", children })
|
|
@@ -3720,7 +3884,7 @@ var CardForum = forwardRef9(
|
|
|
3720
3884
|
padding: "medium",
|
|
3721
3885
|
minHeight: "none",
|
|
3722
3886
|
variant: "minimal",
|
|
3723
|
-
className:
|
|
3887
|
+
className: cn("w-auto h-auto gap-3", className),
|
|
3724
3888
|
...props,
|
|
3725
3889
|
children: [
|
|
3726
3890
|
/* @__PURE__ */ jsx23(
|
|
@@ -3853,7 +4017,7 @@ var CardAudio = forwardRef9(
|
|
|
3853
4017
|
layout: "horizontal",
|
|
3854
4018
|
padding: "medium",
|
|
3855
4019
|
minHeight: "none",
|
|
3856
|
-
className:
|
|
4020
|
+
className: cn("w-auto h-14 items-center gap-2", className),
|
|
3857
4021
|
...props,
|
|
3858
4022
|
children: [
|
|
3859
4023
|
/* @__PURE__ */ jsx23(
|
|
@@ -4022,7 +4186,10 @@ var CardSimulado = forwardRef9(
|
|
|
4022
4186
|
padding: "medium",
|
|
4023
4187
|
minHeight: "none",
|
|
4024
4188
|
cursor: "pointer",
|
|
4025
|
-
className:
|
|
4189
|
+
className: cn(
|
|
4190
|
+
`${backgroundClass} hover:shadow-soft-shadow-2 transition-shadow duration-200`,
|
|
4191
|
+
className
|
|
4192
|
+
),
|
|
4026
4193
|
...props,
|
|
4027
4194
|
children: /* @__PURE__ */ jsxs18("div", { className: "flex justify-between items-center w-full gap-4", children: [
|
|
4028
4195
|
/* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
|
|
@@ -4085,7 +4252,9 @@ var CardTest = forwardRef9(
|
|
|
4085
4252
|
{
|
|
4086
4253
|
ref,
|
|
4087
4254
|
type: "button",
|
|
4088
|
-
className:
|
|
4255
|
+
className: cn(
|
|
4256
|
+
`${baseClasses} ${interactiveClasses} ${selectedClasses} ${className}`.trim()
|
|
4257
|
+
),
|
|
4089
4258
|
onClick: handleClick,
|
|
4090
4259
|
onKeyDown: handleKeyDown,
|
|
4091
4260
|
"aria-pressed": selected,
|
|
@@ -4129,7 +4298,7 @@ var CardTest = forwardRef9(
|
|
|
4129
4298
|
"div",
|
|
4130
4299
|
{
|
|
4131
4300
|
ref,
|
|
4132
|
-
className: `${baseClasses} ${className}`.trim(),
|
|
4301
|
+
className: cn(`${baseClasses} ${className}`.trim()),
|
|
4133
4302
|
...props,
|
|
4134
4303
|
children: /* @__PURE__ */ jsxs18("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
|
|
4135
4304
|
/* @__PURE__ */ jsx23(
|
|
@@ -4194,16 +4363,16 @@ var CardSimulationHistory = forwardRef9(({ data, onSimulationClick, className, .
|
|
|
4194
4363
|
"div",
|
|
4195
4364
|
{
|
|
4196
4365
|
ref,
|
|
4197
|
-
className:
|
|
4366
|
+
className: cn("w-full max-w-[992px] h-auto", className),
|
|
4198
4367
|
...props,
|
|
4199
4368
|
children: /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-0", children: [
|
|
4200
4369
|
data.map((section, sectionIndex) => /* @__PURE__ */ jsx23("div", { className: "flex flex-col", children: /* @__PURE__ */ jsxs18(
|
|
4201
4370
|
"div",
|
|
4202
4371
|
{
|
|
4203
|
-
className:
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4372
|
+
className: cn(
|
|
4373
|
+
"flex flex-row justify-center items-start px-4 py-6 gap-2 w-full bg-white",
|
|
4374
|
+
sectionIndex === 0 ? "rounded-t-3xl" : ""
|
|
4375
|
+
),
|
|
4207
4376
|
children: [
|
|
4208
4377
|
/* @__PURE__ */ jsx23(
|
|
4209
4378
|
Text_default,
|
|
@@ -4223,10 +4392,10 @@ var CardSimulationHistory = forwardRef9(({ data, onSimulationClick, className, .
|
|
|
4223
4392
|
padding: "medium",
|
|
4224
4393
|
minHeight: "none",
|
|
4225
4394
|
cursor: "pointer",
|
|
4226
|
-
className:
|
|
4227
|
-
|
|
4228
|
-
transition-shadow duration-200 h-auto min-h-[61px]
|
|
4229
|
-
|
|
4395
|
+
className: cn(
|
|
4396
|
+
`${typeStyles.background} rounded-xl hover:shadow-soft-shadow-2
|
|
4397
|
+
transition-shadow duration-200 h-auto min-h-[61px]`
|
|
4398
|
+
),
|
|
4230
4399
|
onClick: () => onSimulationClick?.(simulation),
|
|
4231
4400
|
children: /* @__PURE__ */ jsxs18("div", { className: "flex justify-between items-center w-full gap-2", children: [
|
|
4232
4401
|
/* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-2 flex-1 min-w-0", children: [
|
|
@@ -4306,7 +4475,7 @@ var CardAccordation = forwardRef10(
|
|
|
4306
4475
|
layout: "vertical",
|
|
4307
4476
|
padding: "none",
|
|
4308
4477
|
minHeight: "none",
|
|
4309
|
-
className:
|
|
4478
|
+
className: cn("overflow-hidden", className),
|
|
4310
4479
|
...props,
|
|
4311
4480
|
children: [
|
|
4312
4481
|
/* @__PURE__ */ jsxs19(
|
|
@@ -4323,7 +4492,10 @@ var CardAccordation = forwardRef10(
|
|
|
4323
4492
|
CaretRight2,
|
|
4324
4493
|
{
|
|
4325
4494
|
size: 20,
|
|
4326
|
-
className:
|
|
4495
|
+
className: cn(
|
|
4496
|
+
"text-text-700 transition-transform duration-200 flex-shrink-0",
|
|
4497
|
+
isExpanded ? "rotate-90" : "rotate-0"
|
|
4498
|
+
),
|
|
4327
4499
|
"data-testid": "accordion-caret"
|
|
4328
4500
|
}
|
|
4329
4501
|
)
|
|
@@ -4334,7 +4506,10 @@ var CardAccordation = forwardRef10(
|
|
|
4334
4506
|
"div",
|
|
4335
4507
|
{
|
|
4336
4508
|
id: contentId,
|
|
4337
|
-
className:
|
|
4509
|
+
className: cn(
|
|
4510
|
+
"transition-all duration-300 ease-in-out overflow-hidden",
|
|
4511
|
+
isExpanded ? "max-h-screen opacity-100" : "max-h-0 opacity-0"
|
|
4512
|
+
),
|
|
4338
4513
|
"data-testid": "accordion-content",
|
|
4339
4514
|
children: /* @__PURE__ */ jsx24("div", { className: "p-4 pt-0 border-border-50", children })
|
|
4340
4515
|
}
|
|
@@ -4417,7 +4592,11 @@ var AlternativesList = ({
|
|
|
4417
4592
|
return /* @__PURE__ */ jsx25(
|
|
4418
4593
|
"div",
|
|
4419
4594
|
{
|
|
4420
|
-
className:
|
|
4595
|
+
className: cn(
|
|
4596
|
+
"border-2 rounded-lg p-4 w-full",
|
|
4597
|
+
statusStyles,
|
|
4598
|
+
alternative.disabled ? "opacity-50" : ""
|
|
4599
|
+
),
|
|
4421
4600
|
children: /* @__PURE__ */ jsxs20("div", { className: "flex items-start justify-between gap-3", children: [
|
|
4422
4601
|
/* @__PURE__ */ jsxs20("div", { className: "flex items-start gap-3 flex-1", children: [
|
|
4423
4602
|
/* @__PURE__ */ jsx25("div", { className: "mt-1", children: renderRadio() }),
|
|
@@ -4425,7 +4604,10 @@ var AlternativesList = ({
|
|
|
4425
4604
|
/* @__PURE__ */ jsx25(
|
|
4426
4605
|
"p",
|
|
4427
4606
|
{
|
|
4428
|
-
className:
|
|
4607
|
+
className: cn(
|
|
4608
|
+
"block font-medium",
|
|
4609
|
+
selectedValue === alternative.value || statusBadge ? "text-text-950" : "text-text-600"
|
|
4610
|
+
),
|
|
4429
4611
|
children: alternative.label
|
|
4430
4612
|
}
|
|
4431
4613
|
),
|
|
@@ -4441,14 +4623,21 @@ var AlternativesList = ({
|
|
|
4441
4623
|
return /* @__PURE__ */ jsxs20(
|
|
4442
4624
|
"div",
|
|
4443
4625
|
{
|
|
4444
|
-
className:
|
|
4626
|
+
className: cn(
|
|
4627
|
+
"flex flex-row justify-between items-start gap-2 p-2 rounded-lg w-full",
|
|
4628
|
+
statusStyles,
|
|
4629
|
+
alternative.disabled ? "opacity-50" : ""
|
|
4630
|
+
),
|
|
4445
4631
|
children: [
|
|
4446
4632
|
/* @__PURE__ */ jsxs20("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
4447
4633
|
renderRadio(),
|
|
4448
4634
|
/* @__PURE__ */ jsx25(
|
|
4449
4635
|
"span",
|
|
4450
4636
|
{
|
|
4451
|
-
className:
|
|
4637
|
+
className: cn(
|
|
4638
|
+
"flex-1",
|
|
4639
|
+
selectedValue === alternative.value || statusBadge ? "text-text-950" : "text-text-600"
|
|
4640
|
+
),
|
|
4452
4641
|
children: alternative.label
|
|
4453
4642
|
}
|
|
4454
4643
|
)
|
|
@@ -4463,7 +4652,7 @@ var AlternativesList = ({
|
|
|
4463
4652
|
return /* @__PURE__ */ jsx25(
|
|
4464
4653
|
"div",
|
|
4465
4654
|
{
|
|
4466
|
-
className:
|
|
4655
|
+
className: cn("flex flex-col", getLayoutClasses(), "w-full", className),
|
|
4467
4656
|
children: alternatives.map(
|
|
4468
4657
|
(alternative) => renderReadonlyAlternative(alternative)
|
|
4469
4658
|
)
|
|
@@ -4481,7 +4670,7 @@ var AlternativesList = ({
|
|
|
4481
4670
|
onValueChange?.(value2);
|
|
4482
4671
|
},
|
|
4483
4672
|
disabled,
|
|
4484
|
-
className:
|
|
4673
|
+
className: cn("flex flex-col", getLayoutClasses(), className),
|
|
4485
4674
|
children: alternatives.map((alternative, index) => {
|
|
4486
4675
|
const alternativeId = alternative.value || `alt-${index}`;
|
|
4487
4676
|
const statusStyles = getStatusStyles(alternative.status, false);
|
|
@@ -4490,7 +4679,11 @@ var AlternativesList = ({
|
|
|
4490
4679
|
return /* @__PURE__ */ jsx25(
|
|
4491
4680
|
"div",
|
|
4492
4681
|
{
|
|
4493
|
-
className:
|
|
4682
|
+
className: cn(
|
|
4683
|
+
"border-2 rounded-lg p-4 transition-all",
|
|
4684
|
+
statusStyles,
|
|
4685
|
+
alternative.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
|
|
4686
|
+
),
|
|
4494
4687
|
children: /* @__PURE__ */ jsxs20("div", { className: "flex items-start justify-between gap-3", children: [
|
|
4495
4688
|
/* @__PURE__ */ jsxs20("div", { className: "flex items-start gap-3 flex-1", children: [
|
|
4496
4689
|
/* @__PURE__ */ jsx25(
|
|
@@ -4507,9 +4700,11 @@ var AlternativesList = ({
|
|
|
4507
4700
|
"label",
|
|
4508
4701
|
{
|
|
4509
4702
|
htmlFor: alternativeId,
|
|
4510
|
-
className:
|
|
4511
|
-
|
|
4512
|
-
|
|
4703
|
+
className: cn(
|
|
4704
|
+
"block font-medium",
|
|
4705
|
+
actualValue === alternative.value ? "text-text-950" : "text-text-600",
|
|
4706
|
+
alternative.disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
4707
|
+
),
|
|
4513
4708
|
children: alternative.label
|
|
4514
4709
|
}
|
|
4515
4710
|
),
|
|
@@ -4525,7 +4720,11 @@ var AlternativesList = ({
|
|
|
4525
4720
|
return /* @__PURE__ */ jsxs20(
|
|
4526
4721
|
"div",
|
|
4527
4722
|
{
|
|
4528
|
-
className:
|
|
4723
|
+
className: cn(
|
|
4724
|
+
"flex flex-row justify-between gap-2 items-start p-2 rounded-lg transition-all",
|
|
4725
|
+
statusStyles,
|
|
4726
|
+
alternative.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
4727
|
+
),
|
|
4529
4728
|
children: [
|
|
4530
4729
|
/* @__PURE__ */ jsxs20("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
4531
4730
|
/* @__PURE__ */ jsx25(
|
|
@@ -4540,9 +4739,11 @@ var AlternativesList = ({
|
|
|
4540
4739
|
"label",
|
|
4541
4740
|
{
|
|
4542
4741
|
htmlFor: alternativeId,
|
|
4543
|
-
className:
|
|
4544
|
-
|
|
4545
|
-
|
|
4742
|
+
className: cn(
|
|
4743
|
+
"flex-1",
|
|
4744
|
+
actualValue === alternative.value ? "text-text-950" : "text-text-600",
|
|
4745
|
+
alternative.disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
4746
|
+
),
|
|
4546
4747
|
children: alternative.label
|
|
4547
4748
|
}
|
|
4548
4749
|
)
|
|
@@ -4562,7 +4763,10 @@ var HeaderAlternative = forwardRef11(
|
|
|
4562
4763
|
"div",
|
|
4563
4764
|
{
|
|
4564
4765
|
ref,
|
|
4565
|
-
className:
|
|
4766
|
+
className: cn(
|
|
4767
|
+
"bg-background p-4 flex flex-col gap-4 rounded-xl",
|
|
4768
|
+
className
|
|
4769
|
+
),
|
|
4566
4770
|
...props,
|
|
4567
4771
|
children: [
|
|
4568
4772
|
/* @__PURE__ */ jsxs20("span", { className: "flex flex-col", children: [
|
|
@@ -4657,7 +4861,11 @@ var AlertDialog = forwardRef12(
|
|
|
4657
4861
|
"div",
|
|
4658
4862
|
{
|
|
4659
4863
|
ref,
|
|
4660
|
-
className:
|
|
4864
|
+
className: cn(
|
|
4865
|
+
"bg-background border border-border-100 rounded-lg shadow-lg p-6 m-3",
|
|
4866
|
+
sizeClasses,
|
|
4867
|
+
className
|
|
4868
|
+
),
|
|
4661
4869
|
...props,
|
|
4662
4870
|
children: [
|
|
4663
4871
|
/* @__PURE__ */ jsx26(
|
|
@@ -4826,7 +5034,7 @@ var DropdownMenuTrigger = ({
|
|
|
4826
5034
|
if (onClick) onClick(e);
|
|
4827
5035
|
},
|
|
4828
5036
|
"aria-expanded": open,
|
|
4829
|
-
className:
|
|
5037
|
+
className: cn(className),
|
|
4830
5038
|
...props,
|
|
4831
5039
|
children
|
|
4832
5040
|
}
|
|
@@ -4857,7 +5065,7 @@ var MenuLabel = forwardRef13(({ className, inset, store: _store, ...props }, ref
|
|
|
4857
5065
|
"div",
|
|
4858
5066
|
{
|
|
4859
5067
|
ref,
|
|
4860
|
-
className:
|
|
5068
|
+
className: cn("text-sm w-full", inset ? "pl-8" : "", className),
|
|
4861
5069
|
...props
|
|
4862
5070
|
}
|
|
4863
5071
|
);
|
|
@@ -4985,7 +5193,7 @@ var DropdownMenuSeparator = forwardRef13(({ className, store: _store, ...props }
|
|
|
4985
5193
|
"div",
|
|
4986
5194
|
{
|
|
4987
5195
|
ref,
|
|
4988
|
-
className:
|
|
5196
|
+
className: cn("my-1 h-px bg-border-200", className),
|
|
4989
5197
|
...props
|
|
4990
5198
|
}
|
|
4991
5199
|
));
|
|
@@ -4998,7 +5206,10 @@ var ProfileMenuTrigger = forwardRef13(({ className, onClick, store: externalStor
|
|
|
4998
5206
|
"button",
|
|
4999
5207
|
{
|
|
5000
5208
|
ref,
|
|
5001
|
-
className:
|
|
5209
|
+
className: cn(
|
|
5210
|
+
"rounded-lg size-10 bg-primary-50 flex items-center justify-center cursor-pointer",
|
|
5211
|
+
className
|
|
5212
|
+
),
|
|
5002
5213
|
onClick: (e) => {
|
|
5003
5214
|
e.stopPropagation();
|
|
5004
5215
|
toggleOpen();
|
|
@@ -5017,10 +5228,7 @@ var ProfileMenuHeader = forwardRef13(({ className, name, email, store: _store, .
|
|
|
5017
5228
|
{
|
|
5018
5229
|
ref,
|
|
5019
5230
|
"data-component": "ProfileMenuHeader",
|
|
5020
|
-
className:
|
|
5021
|
-
flex flex-row gap-4 items-center
|
|
5022
|
-
${className}
|
|
5023
|
-
`,
|
|
5231
|
+
className: cn("flex flex-row gap-4 items-center", className),
|
|
5024
5232
|
...props,
|
|
5025
5233
|
children: [
|
|
5026
5234
|
/* @__PURE__ */ jsx27("span", { className: "size-16 bg-primary-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsx27(User, { size: 34, className: "text-primary-950" }) }),
|
|
@@ -5034,18 +5242,7 @@ var ProfileMenuHeader = forwardRef13(({ className, name, email, store: _store, .
|
|
|
5034
5242
|
});
|
|
5035
5243
|
ProfileMenuHeader.displayName = "ProfileMenuHeader";
|
|
5036
5244
|
var ProfileMenuSection = forwardRef13(({ className, children, store: _store, ...props }, ref) => {
|
|
5037
|
-
return /* @__PURE__ */ jsx27(
|
|
5038
|
-
"div",
|
|
5039
|
-
{
|
|
5040
|
-
ref,
|
|
5041
|
-
className: `
|
|
5042
|
-
flex flex-col p-2
|
|
5043
|
-
${className}
|
|
5044
|
-
`,
|
|
5045
|
-
...props,
|
|
5046
|
-
children
|
|
5047
|
-
}
|
|
5048
|
-
);
|
|
5245
|
+
return /* @__PURE__ */ jsx27("div", { ref, className: cn("flex flex-col p-2", className), ...props, children });
|
|
5049
5246
|
});
|
|
5050
5247
|
ProfileMenuSection.displayName = "ProfileMenuSection";
|
|
5051
5248
|
var ProfileMenuFooter = ({
|
|
@@ -5061,7 +5258,7 @@ var ProfileMenuFooter = ({
|
|
|
5061
5258
|
Button_default,
|
|
5062
5259
|
{
|
|
5063
5260
|
variant: "outline",
|
|
5064
|
-
className:
|
|
5261
|
+
className: cn("w-full", className),
|
|
5065
5262
|
disabled,
|
|
5066
5263
|
onClick: (e) => {
|
|
5067
5264
|
setOpen(false);
|
|
@@ -5265,11 +5462,11 @@ var Select = ({
|
|
|
5265
5462
|
"label",
|
|
5266
5463
|
{
|
|
5267
5464
|
htmlFor: selectId,
|
|
5268
|
-
className:
|
|
5465
|
+
className: cn("block font-bold text-text-900 mb-1.5", sizeClasses),
|
|
5269
5466
|
children: label
|
|
5270
5467
|
}
|
|
5271
5468
|
),
|
|
5272
|
-
/* @__PURE__ */ jsx28("div", { className:
|
|
5469
|
+
/* @__PURE__ */ jsx28("div", { className: cn("relative", sizeClasses), ref: selectRef, children: injectStore3(children, store, size, selectId) }),
|
|
5273
5470
|
/* @__PURE__ */ jsxs23("div", { className: "mt-1.5 gap-1.5", children: [
|
|
5274
5471
|
helperText && /* @__PURE__ */ jsx28("p", { className: "text-sm text-text-500", children: helperText }),
|
|
5275
5472
|
errorMessage && /* @__PURE__ */ jsxs23("p", { className: "flex gap-1 items-center text-sm text-indicator-error", children: [
|
|
@@ -5330,7 +5527,10 @@ var SelectTrigger = forwardRef14(
|
|
|
5330
5527
|
/* @__PURE__ */ jsx28(
|
|
5331
5528
|
CaretDown,
|
|
5332
5529
|
{
|
|
5333
|
-
className:
|
|
5530
|
+
className: cn(
|
|
5531
|
+
"h-[1em] w-[1em] opacity-50 transition-transform",
|
|
5532
|
+
open ? "rotate-180" : ""
|
|
5533
|
+
)
|
|
5334
5534
|
}
|
|
5335
5535
|
)
|
|
5336
5536
|
]
|
|
@@ -5357,7 +5557,11 @@ var SelectContent = forwardRef14(
|
|
|
5357
5557
|
{
|
|
5358
5558
|
role: "menu",
|
|
5359
5559
|
ref,
|
|
5360
|
-
className:
|
|
5560
|
+
className: cn(
|
|
5561
|
+
"bg-background z-50 min-w-[210px] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md border-border-100",
|
|
5562
|
+
getPositionClasses(),
|
|
5563
|
+
className
|
|
5564
|
+
),
|
|
5361
5565
|
...props,
|
|
5362
5566
|
children
|
|
5363
5567
|
}
|
|
@@ -5572,7 +5776,10 @@ var MenuItem = forwardRef15(
|
|
|
5572
5776
|
/* @__PURE__ */ jsx29(
|
|
5573
5777
|
"span",
|
|
5574
5778
|
{
|
|
5575
|
-
className:
|
|
5779
|
+
className: cn(
|
|
5780
|
+
"flex flex-row items-center gap-2 px-4 text-text-950 text-xs font-bold",
|
|
5781
|
+
className
|
|
5782
|
+
),
|
|
5576
5783
|
children
|
|
5577
5784
|
}
|
|
5578
5785
|
),
|
|
@@ -5595,10 +5802,10 @@ var MenuItem = forwardRef15(
|
|
|
5595
5802
|
/* @__PURE__ */ jsx29(
|
|
5596
5803
|
"span",
|
|
5597
5804
|
{
|
|
5598
|
-
className:
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5805
|
+
className: cn(
|
|
5806
|
+
"border-b border-text-600 hover:border-primary-600 text-inherit text-xs",
|
|
5807
|
+
selectedValue === value ? "border-b-0 font-bold" : "border-b-primary-200"
|
|
5808
|
+
),
|
|
5602
5809
|
children
|
|
5603
5810
|
}
|
|
5604
5811
|
),
|
|
@@ -5661,7 +5868,7 @@ var MenuOverflow = ({
|
|
|
5661
5868
|
"div",
|
|
5662
5869
|
{
|
|
5663
5870
|
"data-testid": "menu-overflow-wrapper",
|
|
5664
|
-
className:
|
|
5871
|
+
className: cn("relative w-full overflow-hidden", className),
|
|
5665
5872
|
children: [
|
|
5666
5873
|
showLeftArrow && /* @__PURE__ */ jsxs24(
|
|
5667
5874
|
"button",
|
|
@@ -5756,12 +5963,12 @@ var Skeleton = forwardRef16(
|
|
|
5756
5963
|
"div",
|
|
5757
5964
|
{
|
|
5758
5965
|
ref,
|
|
5759
|
-
className:
|
|
5966
|
+
className: cn("flex flex-col", spacingClass, className),
|
|
5760
5967
|
...props,
|
|
5761
5968
|
children: Array.from({ length: lines }, (_, index) => /* @__PURE__ */ jsx30(
|
|
5762
5969
|
"div",
|
|
5763
5970
|
{
|
|
5764
|
-
className:
|
|
5971
|
+
className: cn(variantClass, animationClass),
|
|
5765
5972
|
style: index === lines - 1 ? { width: "60%" } : void 0
|
|
5766
5973
|
},
|
|
5767
5974
|
index
|
|
@@ -5773,7 +5980,7 @@ var Skeleton = forwardRef16(
|
|
|
5773
5980
|
"div",
|
|
5774
5981
|
{
|
|
5775
5982
|
ref,
|
|
5776
|
-
className:
|
|
5983
|
+
className: cn(variantClass, animationClass, className),
|
|
5777
5984
|
style,
|
|
5778
5985
|
...props,
|
|
5779
5986
|
children
|
|
@@ -5801,7 +6008,10 @@ var SkeletonCard = forwardRef16(
|
|
|
5801
6008
|
"div",
|
|
5802
6009
|
{
|
|
5803
6010
|
ref,
|
|
5804
|
-
className:
|
|
6011
|
+
className: cn(
|
|
6012
|
+
"w-full p-4 bg-background border border-border-200 rounded-lg",
|
|
6013
|
+
className
|
|
6014
|
+
),
|
|
5805
6015
|
...props,
|
|
5806
6016
|
children: [
|
|
5807
6017
|
/* @__PURE__ */ jsxs25("div", { className: "flex items-start space-x-3", children: [
|
|
@@ -5830,7 +6040,7 @@ var SkeletonList = forwardRef16(
|
|
|
5830
6040
|
className = "",
|
|
5831
6041
|
...props
|
|
5832
6042
|
}, ref) => {
|
|
5833
|
-
return /* @__PURE__ */ jsx30("div", { ref, className:
|
|
6043
|
+
return /* @__PURE__ */ jsx30("div", { ref, className: cn("space-y-3", className), ...props, children: Array.from({ length: items }, (_, index) => /* @__PURE__ */ jsxs25("div", { className: "flex items-start space-x-3 p-3", children: [
|
|
5834
6044
|
showAvatar && /* @__PURE__ */ jsx30(SkeletonCircle, { width: 32, height: 32 }),
|
|
5835
6045
|
/* @__PURE__ */ jsxs25("div", { className: "flex-1 space-y-2", children: [
|
|
5836
6046
|
showTitle && /* @__PURE__ */ jsx30(SkeletonText, { width: "40%", height: 16 }),
|
|
@@ -5841,7 +6051,7 @@ var SkeletonList = forwardRef16(
|
|
|
5841
6051
|
);
|
|
5842
6052
|
var SkeletonTable = forwardRef16(
|
|
5843
6053
|
({ rows = 5, columns = 4, showHeader = true, className = "", ...props }, ref) => {
|
|
5844
|
-
return /* @__PURE__ */ jsxs25("div", { ref, className:
|
|
6054
|
+
return /* @__PURE__ */ jsxs25("div", { ref, className: cn("w-full", className), ...props, children: [
|
|
5845
6055
|
showHeader && /* @__PURE__ */ jsx30("div", { className: "flex space-x-2 mb-3", children: Array.from({ length: columns }, (_, index) => /* @__PURE__ */ jsx30(
|
|
5846
6056
|
SkeletonText,
|
|
5847
6057
|
{
|
|
@@ -5909,7 +6119,10 @@ var NotFound = ({
|
|
|
5909
6119
|
return /* @__PURE__ */ jsx31(
|
|
5910
6120
|
"div",
|
|
5911
6121
|
{
|
|
5912
|
-
className:
|
|
6122
|
+
className: cn(
|
|
6123
|
+
"flex flex-col w-full h-screen items-center justify-center bg-background-50 px-4",
|
|
6124
|
+
className
|
|
6125
|
+
),
|
|
5913
6126
|
children: /* @__PURE__ */ jsx31(
|
|
5914
6127
|
"main",
|
|
5915
6128
|
{
|
|
@@ -6253,7 +6466,8 @@ import {
|
|
|
6253
6466
|
CaretRight as CaretRight4,
|
|
6254
6467
|
Clock as Clock2,
|
|
6255
6468
|
SquaresFour,
|
|
6256
|
-
BookOpen
|
|
6469
|
+
BookOpen,
|
|
6470
|
+
Book
|
|
6257
6471
|
} from "phosphor-react";
|
|
6258
6472
|
import { forwardRef as forwardRef17, useState as useState12 } from "react";
|
|
6259
6473
|
|
|
@@ -6265,6 +6479,9 @@ var useQuizStore = create6()(
|
|
|
6265
6479
|
(set, get) => {
|
|
6266
6480
|
let timerInterval = null;
|
|
6267
6481
|
const startTimer = () => {
|
|
6482
|
+
if (get().isFinished) {
|
|
6483
|
+
return;
|
|
6484
|
+
}
|
|
6268
6485
|
if (timerInterval) {
|
|
6269
6486
|
clearInterval(timerInterval);
|
|
6270
6487
|
}
|
|
@@ -6283,15 +6500,17 @@ var useQuizStore = create6()(
|
|
|
6283
6500
|
// Initial State
|
|
6284
6501
|
currentQuestionIndex: 0,
|
|
6285
6502
|
selectedAnswers: {},
|
|
6286
|
-
skippedQuestions: [],
|
|
6287
6503
|
userAnswers: [],
|
|
6288
6504
|
timeElapsed: 0,
|
|
6289
6505
|
isStarted: false,
|
|
6290
6506
|
isFinished: false,
|
|
6507
|
+
userId: "",
|
|
6291
6508
|
// Setters
|
|
6292
|
-
|
|
6293
|
-
|
|
6294
|
-
|
|
6509
|
+
setBySimulated: (simulado) => set({ bySimulated: simulado }),
|
|
6510
|
+
setByActivity: (atividade) => set({ byActivity: atividade }),
|
|
6511
|
+
setByQuestionary: (aula) => set({ byQuestionary: aula }),
|
|
6512
|
+
setUserId: (userId) => set({ userId }),
|
|
6513
|
+
getUserId: () => get().userId,
|
|
6295
6514
|
// Navigation
|
|
6296
6515
|
goToNextQuestion: () => {
|
|
6297
6516
|
const { currentQuestionIndex, getTotalQuestions } = get();
|
|
@@ -6313,58 +6532,107 @@ var useQuizStore = create6()(
|
|
|
6313
6532
|
set({ currentQuestionIndex: index });
|
|
6314
6533
|
}
|
|
6315
6534
|
},
|
|
6316
|
-
|
|
6535
|
+
getActiveQuiz: () => {
|
|
6536
|
+
const { bySimulated, byActivity, byQuestionary } = get();
|
|
6537
|
+
if (bySimulated)
|
|
6538
|
+
return { quiz: bySimulated, type: "bySimulated" };
|
|
6539
|
+
if (byActivity)
|
|
6540
|
+
return { quiz: byActivity, type: "byActivity" };
|
|
6541
|
+
if (byQuestionary)
|
|
6542
|
+
return { quiz: byQuestionary, type: "byQuestionary" };
|
|
6543
|
+
return null;
|
|
6544
|
+
},
|
|
6317
6545
|
selectAnswer: (questionId, answerId) => {
|
|
6318
|
-
const {
|
|
6319
|
-
const
|
|
6320
|
-
|
|
6546
|
+
const { getActiveQuiz, userAnswers } = get();
|
|
6547
|
+
const activeQuiz = getActiveQuiz();
|
|
6548
|
+
if (!activeQuiz) return;
|
|
6549
|
+
const updatedQuestions = activeQuiz.quiz.questions.map(
|
|
6550
|
+
(question) => question.id === questionId ? { ...question, answerKey: answerId } : question
|
|
6551
|
+
);
|
|
6552
|
+
const updatedQuiz = {
|
|
6553
|
+
...activeQuiz.quiz,
|
|
6554
|
+
questions: updatedQuestions
|
|
6555
|
+
};
|
|
6556
|
+
const activityId = activeQuiz.quiz.id;
|
|
6557
|
+
const userId = get().getUserId();
|
|
6558
|
+
if (!userId) {
|
|
6559
|
+
console.warn("selectAnswer called before userId is set");
|
|
6560
|
+
return;
|
|
6561
|
+
}
|
|
6562
|
+
const existingAnswerIndex = userAnswers.findIndex(
|
|
6563
|
+
(answer) => answer.questionId === questionId
|
|
6321
6564
|
);
|
|
6565
|
+
const newUserAnswer = {
|
|
6566
|
+
questionId,
|
|
6567
|
+
activityId,
|
|
6568
|
+
userId,
|
|
6569
|
+
answer: answerId,
|
|
6570
|
+
optionId: answerId
|
|
6571
|
+
};
|
|
6572
|
+
let updatedUserAnswers;
|
|
6573
|
+
if (existingAnswerIndex !== -1) {
|
|
6574
|
+
updatedUserAnswers = [...userAnswers];
|
|
6575
|
+
updatedUserAnswers[existingAnswerIndex] = newUserAnswer;
|
|
6576
|
+
} else {
|
|
6577
|
+
updatedUserAnswers = [...userAnswers, newUserAnswer];
|
|
6578
|
+
}
|
|
6322
6579
|
set({
|
|
6323
|
-
|
|
6324
|
-
|
|
6325
|
-
[questionId]: answerId
|
|
6326
|
-
},
|
|
6327
|
-
skippedQuestions: newSkippedQuestions
|
|
6580
|
+
[activeQuiz.type]: updatedQuiz,
|
|
6581
|
+
userAnswers: updatedUserAnswers
|
|
6328
6582
|
});
|
|
6329
|
-
addUserAnswer(questionId, answerId);
|
|
6330
6583
|
},
|
|
6331
6584
|
skipQuestion: () => {
|
|
6332
|
-
const { getCurrentQuestion,
|
|
6585
|
+
const { getCurrentQuestion, userAnswers, getActiveQuiz } = get();
|
|
6333
6586
|
const currentQuestion = getCurrentQuestion();
|
|
6587
|
+
const activeQuiz = getActiveQuiz();
|
|
6588
|
+
if (!activeQuiz) return;
|
|
6334
6589
|
if (currentQuestion) {
|
|
6590
|
+
const activityId = activeQuiz.quiz.id;
|
|
6591
|
+
const userId = get().getUserId();
|
|
6592
|
+
const existingAnswerIndex = userAnswers.findIndex(
|
|
6593
|
+
(answer) => answer.questionId === currentQuestion.id
|
|
6594
|
+
);
|
|
6595
|
+
const newUserAnswer = {
|
|
6596
|
+
questionId: currentQuestion.id,
|
|
6597
|
+
activityId,
|
|
6598
|
+
userId,
|
|
6599
|
+
answer: null,
|
|
6600
|
+
optionId: null
|
|
6601
|
+
};
|
|
6602
|
+
let updatedUserAnswers;
|
|
6603
|
+
if (existingAnswerIndex !== -1) {
|
|
6604
|
+
updatedUserAnswers = [...userAnswers];
|
|
6605
|
+
updatedUserAnswers[existingAnswerIndex] = newUserAnswer;
|
|
6606
|
+
} else {
|
|
6607
|
+
updatedUserAnswers = [...userAnswers, newUserAnswer];
|
|
6608
|
+
}
|
|
6335
6609
|
set({
|
|
6336
|
-
|
|
6610
|
+
userAnswers: updatedUserAnswers
|
|
6337
6611
|
});
|
|
6338
|
-
addUserAnswer(currentQuestion.id);
|
|
6339
6612
|
}
|
|
6340
6613
|
},
|
|
6341
6614
|
addUserAnswer: (questionId, answerId) => {
|
|
6342
|
-
const {
|
|
6343
|
-
const
|
|
6344
|
-
|
|
6345
|
-
|
|
6615
|
+
const { getActiveQuiz, userAnswers } = get();
|
|
6616
|
+
const activeQuiz = getActiveQuiz();
|
|
6617
|
+
if (!activeQuiz) return;
|
|
6618
|
+
const activityId = activeQuiz.quiz.id;
|
|
6619
|
+
const userId = get().getUserId();
|
|
6346
6620
|
const existingAnswerIndex = userAnswers.findIndex(
|
|
6347
|
-
(answer) => answer.
|
|
6621
|
+
(answer) => answer.questionId === questionId
|
|
6348
6622
|
);
|
|
6623
|
+
const newUserAnswer = {
|
|
6624
|
+
questionId,
|
|
6625
|
+
activityId,
|
|
6626
|
+
userId,
|
|
6627
|
+
answer: answerId || null,
|
|
6628
|
+
optionId: answerId || null
|
|
6629
|
+
};
|
|
6349
6630
|
if (existingAnswerIndex !== -1) {
|
|
6350
|
-
const
|
|
6351
|
-
|
|
6352
|
-
|
|
6353
|
-
answerKey: answerId || "",
|
|
6354
|
-
isSkipped: !answerId
|
|
6355
|
-
};
|
|
6356
|
-
set({ userAnswers: updatedAnswers });
|
|
6631
|
+
const updatedUserAnswers = [...userAnswers];
|
|
6632
|
+
updatedUserAnswers[existingAnswerIndex] = newUserAnswer;
|
|
6633
|
+
set({ userAnswers: updatedUserAnswers });
|
|
6357
6634
|
} else {
|
|
6358
|
-
set({
|
|
6359
|
-
userAnswers: [
|
|
6360
|
-
...userAnswers,
|
|
6361
|
-
{
|
|
6362
|
-
...question,
|
|
6363
|
-
answerKey: answerId || "",
|
|
6364
|
-
isSkipped: !answerId
|
|
6365
|
-
}
|
|
6366
|
-
]
|
|
6367
|
-
});
|
|
6635
|
+
set({ userAnswers: [...userAnswers, newUserAnswer] });
|
|
6368
6636
|
}
|
|
6369
6637
|
},
|
|
6370
6638
|
startQuiz: () => {
|
|
@@ -6380,11 +6648,11 @@ var useQuizStore = create6()(
|
|
|
6380
6648
|
set({
|
|
6381
6649
|
currentQuestionIndex: 0,
|
|
6382
6650
|
selectedAnswers: {},
|
|
6383
|
-
skippedQuestions: [],
|
|
6384
6651
|
userAnswers: [],
|
|
6385
6652
|
timeElapsed: 0,
|
|
6386
6653
|
isStarted: false,
|
|
6387
|
-
isFinished: false
|
|
6654
|
+
isFinished: false,
|
|
6655
|
+
userId: ""
|
|
6388
6656
|
});
|
|
6389
6657
|
},
|
|
6390
6658
|
// Timer
|
|
@@ -6393,36 +6661,33 @@ var useQuizStore = create6()(
|
|
|
6393
6661
|
stopTimer,
|
|
6394
6662
|
// Getters
|
|
6395
6663
|
getCurrentQuestion: () => {
|
|
6396
|
-
const {
|
|
6397
|
-
const
|
|
6398
|
-
if (!
|
|
6664
|
+
const { currentQuestionIndex, getActiveQuiz } = get();
|
|
6665
|
+
const activeQuiz = getActiveQuiz();
|
|
6666
|
+
if (!activeQuiz) {
|
|
6399
6667
|
return null;
|
|
6400
6668
|
}
|
|
6401
|
-
return quiz.questions[currentQuestionIndex];
|
|
6669
|
+
return activeQuiz.quiz.questions[currentQuestionIndex];
|
|
6402
6670
|
},
|
|
6403
6671
|
getTotalQuestions: () => {
|
|
6404
|
-
const {
|
|
6405
|
-
const
|
|
6406
|
-
return quiz?.questions?.length || 0;
|
|
6672
|
+
const { getActiveQuiz } = get();
|
|
6673
|
+
const activeQuiz = getActiveQuiz();
|
|
6674
|
+
return activeQuiz?.quiz?.questions?.length || 0;
|
|
6407
6675
|
},
|
|
6408
6676
|
getAnsweredQuestions: () => {
|
|
6409
|
-
const {
|
|
6410
|
-
return
|
|
6677
|
+
const { userAnswers } = get();
|
|
6678
|
+
return userAnswers.filter((answer) => answer.answer !== null).length;
|
|
6411
6679
|
},
|
|
6412
6680
|
getUnansweredQuestions: () => {
|
|
6413
|
-
const {
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
byAula,
|
|
6417
|
-
selectedAnswers,
|
|
6418
|
-
skippedQuestions
|
|
6419
|
-
} = get();
|
|
6420
|
-
const quiz = bySimulado || byAtividade || byAula;
|
|
6421
|
-
if (!quiz) return [];
|
|
6681
|
+
const { getActiveQuiz, userAnswers } = get();
|
|
6682
|
+
const activeQuiz = getActiveQuiz();
|
|
6683
|
+
if (!activeQuiz) return [];
|
|
6422
6684
|
const unansweredQuestions = [];
|
|
6423
|
-
quiz.questions.forEach((question, index) => {
|
|
6424
|
-
const
|
|
6425
|
-
|
|
6685
|
+
activeQuiz.quiz.questions.forEach((question, index) => {
|
|
6686
|
+
const userAnswer = userAnswers.find(
|
|
6687
|
+
(answer) => answer.questionId === question.id
|
|
6688
|
+
);
|
|
6689
|
+
const isAnswered = userAnswer && userAnswer.answer !== null;
|
|
6690
|
+
const isSkipped = userAnswer && userAnswer.answer === null;
|
|
6426
6691
|
if (!isAnswered && !isSkipped) {
|
|
6427
6692
|
unansweredQuestions.push(index + 1);
|
|
6428
6693
|
}
|
|
@@ -6430,8 +6695,8 @@ var useQuizStore = create6()(
|
|
|
6430
6695
|
return unansweredQuestions;
|
|
6431
6696
|
},
|
|
6432
6697
|
getSkippedQuestions: () => {
|
|
6433
|
-
const {
|
|
6434
|
-
return
|
|
6698
|
+
const { userAnswers } = get();
|
|
6699
|
+
return userAnswers.filter((answer) => answer.answer === null).length;
|
|
6435
6700
|
},
|
|
6436
6701
|
getProgress: () => {
|
|
6437
6702
|
const { getTotalQuestions, getAnsweredQuestions } = get();
|
|
@@ -6440,22 +6705,32 @@ var useQuizStore = create6()(
|
|
|
6440
6705
|
return total > 0 ? answered / total * 100 : 0;
|
|
6441
6706
|
},
|
|
6442
6707
|
isQuestionAnswered: (questionId) => {
|
|
6443
|
-
const {
|
|
6444
|
-
|
|
6708
|
+
const { userAnswers } = get();
|
|
6709
|
+
const userAnswer = userAnswers.find(
|
|
6710
|
+
(answer) => answer.questionId === questionId
|
|
6711
|
+
);
|
|
6712
|
+
return userAnswer ? userAnswer.answer !== null : false;
|
|
6445
6713
|
},
|
|
6446
6714
|
isQuestionSkipped: (questionId) => {
|
|
6447
|
-
const {
|
|
6448
|
-
|
|
6715
|
+
const { userAnswers } = get();
|
|
6716
|
+
const userAnswer = userAnswers.find(
|
|
6717
|
+
(answer) => answer.questionId === questionId
|
|
6718
|
+
);
|
|
6719
|
+
return userAnswer ? userAnswer.answer === null : false;
|
|
6449
6720
|
},
|
|
6450
6721
|
getCurrentAnswer: () => {
|
|
6451
|
-
const { getCurrentQuestion,
|
|
6722
|
+
const { getCurrentQuestion, userAnswers } = get();
|
|
6452
6723
|
const currentQuestion = getCurrentQuestion();
|
|
6453
|
-
|
|
6724
|
+
if (!currentQuestion) return void 0;
|
|
6725
|
+
const userAnswer = userAnswers.find(
|
|
6726
|
+
(answer) => answer.questionId === currentQuestion.id
|
|
6727
|
+
);
|
|
6728
|
+
return userAnswer?.answer;
|
|
6454
6729
|
},
|
|
6455
6730
|
getQuizTitle: () => {
|
|
6456
|
-
const {
|
|
6457
|
-
const
|
|
6458
|
-
return quiz?.title || "Quiz";
|
|
6731
|
+
const { getActiveQuiz } = get();
|
|
6732
|
+
const activeQuiz = getActiveQuiz();
|
|
6733
|
+
return activeQuiz?.quiz?.title || "Quiz";
|
|
6459
6734
|
},
|
|
6460
6735
|
formatTime: (seconds) => {
|
|
6461
6736
|
const minutes = Math.floor(seconds / 60);
|
|
@@ -6463,30 +6738,42 @@ var useQuizStore = create6()(
|
|
|
6463
6738
|
return `${minutes.toString().padStart(2, "0")}:${remainingSeconds.toString().padStart(2, "0")}`;
|
|
6464
6739
|
},
|
|
6465
6740
|
getUserAnswers: () => {
|
|
6466
|
-
const { userAnswers } = get();
|
|
6467
|
-
|
|
6741
|
+
const { getActiveQuiz, userAnswers } = get();
|
|
6742
|
+
const activeQuiz = getActiveQuiz();
|
|
6743
|
+
if (!activeQuiz) return [];
|
|
6744
|
+
return activeQuiz.quiz.questions.map((question) => {
|
|
6745
|
+
const userAnswer = userAnswers.find(
|
|
6746
|
+
(answer) => answer.questionId === question.id
|
|
6747
|
+
);
|
|
6748
|
+
return {
|
|
6749
|
+
...question,
|
|
6750
|
+
isSkipped: userAnswer ? userAnswer.answer === null : false
|
|
6751
|
+
};
|
|
6752
|
+
});
|
|
6468
6753
|
},
|
|
6469
6754
|
getUnansweredQuestionsFromUserAnswers: () => {
|
|
6470
|
-
const {
|
|
6471
|
-
const
|
|
6472
|
-
if (!
|
|
6755
|
+
const { getActiveQuiz, userAnswers } = get();
|
|
6756
|
+
const activeQuiz = getActiveQuiz();
|
|
6757
|
+
if (!activeQuiz) return [];
|
|
6473
6758
|
const unansweredQuestions = [];
|
|
6474
|
-
quiz.questions.forEach((question, index) => {
|
|
6759
|
+
activeQuiz.quiz.questions.forEach((question, index) => {
|
|
6475
6760
|
const userAnswer = userAnswers.find(
|
|
6476
|
-
(answer) => answer.
|
|
6761
|
+
(answer) => answer.questionId === question.id
|
|
6477
6762
|
);
|
|
6478
|
-
|
|
6763
|
+
const hasAnswer = userAnswer && userAnswer.answer !== null;
|
|
6764
|
+
const isSkipped = userAnswer && userAnswer.answer === null;
|
|
6765
|
+
if (!hasAnswer || isSkipped) {
|
|
6479
6766
|
unansweredQuestions.push(index + 1);
|
|
6480
6767
|
}
|
|
6481
6768
|
});
|
|
6482
6769
|
return unansweredQuestions;
|
|
6483
6770
|
},
|
|
6484
6771
|
getQuestionsGroupedBySubject: () => {
|
|
6485
|
-
const {
|
|
6486
|
-
const
|
|
6487
|
-
if (!
|
|
6772
|
+
const { getActiveQuiz } = get();
|
|
6773
|
+
const activeQuiz = getActiveQuiz();
|
|
6774
|
+
if (!activeQuiz) return {};
|
|
6488
6775
|
const groupedQuestions = {};
|
|
6489
|
-
quiz.questions.forEach((question) => {
|
|
6776
|
+
activeQuiz.quiz.questions.forEach((question) => {
|
|
6490
6777
|
const subjectId = question.knowledgeMatrix?.[0]?.subjectId || "Sem mat\xE9ria";
|
|
6491
6778
|
if (!groupedQuestions[subjectId]) {
|
|
6492
6779
|
groupedQuestions[subjectId] = [];
|
|
@@ -6494,6 +6781,31 @@ var useQuizStore = create6()(
|
|
|
6494
6781
|
groupedQuestions[subjectId].push(question);
|
|
6495
6782
|
});
|
|
6496
6783
|
return groupedQuestions;
|
|
6784
|
+
},
|
|
6785
|
+
// New methods for userAnswers
|
|
6786
|
+
getUserAnswerByQuestionId: (questionId) => {
|
|
6787
|
+
const { userAnswers } = get();
|
|
6788
|
+
return userAnswers.find((answer) => answer.questionId === questionId) || null;
|
|
6789
|
+
},
|
|
6790
|
+
isQuestionAnsweredByUserAnswers: (questionId) => {
|
|
6791
|
+
const { userAnswers } = get();
|
|
6792
|
+
const answer = userAnswers.find(
|
|
6793
|
+
(answer2) => answer2.questionId === questionId
|
|
6794
|
+
);
|
|
6795
|
+
return answer ? answer.answer !== null : false;
|
|
6796
|
+
},
|
|
6797
|
+
getQuestionStatusFromUserAnswers: (questionId) => {
|
|
6798
|
+
const { userAnswers } = get();
|
|
6799
|
+
const answer = userAnswers.find(
|
|
6800
|
+
(answer2) => answer2.questionId === questionId
|
|
6801
|
+
);
|
|
6802
|
+
if (!answer) return "unanswered";
|
|
6803
|
+
if (answer.answer === null) return "skipped";
|
|
6804
|
+
return "answered";
|
|
6805
|
+
},
|
|
6806
|
+
getUserAnswersForActivity: () => {
|
|
6807
|
+
const { userAnswers } = get();
|
|
6808
|
+
return userAnswers;
|
|
6497
6809
|
}
|
|
6498
6810
|
};
|
|
6499
6811
|
},
|
|
@@ -6513,12 +6825,39 @@ var Quiz = forwardRef17(({ children, className, ...props }, ref) => {
|
|
|
6513
6825
|
"div",
|
|
6514
6826
|
{
|
|
6515
6827
|
ref,
|
|
6516
|
-
className:
|
|
6828
|
+
className: cn(
|
|
6829
|
+
"w-full max-w-[1000px] flex flex-col mx-auto h-full relative not-lg:px-6",
|
|
6830
|
+
className
|
|
6831
|
+
),
|
|
6517
6832
|
...props,
|
|
6518
6833
|
children
|
|
6519
6834
|
}
|
|
6520
6835
|
);
|
|
6521
6836
|
});
|
|
6837
|
+
var QuizHeaderResult = forwardRef17(
|
|
6838
|
+
({ className, ...props }, ref) => {
|
|
6839
|
+
const { getCurrentQuestion, getCurrentAnswer } = useQuizStore();
|
|
6840
|
+
const currentQuestion = getCurrentQuestion();
|
|
6841
|
+
const userAnswer = getCurrentAnswer();
|
|
6842
|
+
const isCorrect = userAnswer === currentQuestion?.correctOptionId;
|
|
6843
|
+
return /* @__PURE__ */ jsxs27(
|
|
6844
|
+
"div",
|
|
6845
|
+
{
|
|
6846
|
+
ref,
|
|
6847
|
+
className: cn(
|
|
6848
|
+
"flex flex-row items-center gap-10 p-3.5 rounded-xl",
|
|
6849
|
+
isCorrect ? "bg-success-background" : "bg-error-background",
|
|
6850
|
+
className
|
|
6851
|
+
),
|
|
6852
|
+
...props,
|
|
6853
|
+
children: [
|
|
6854
|
+
/* @__PURE__ */ jsx33("p", { className: "text-text-950 font-bold text-lg", children: "Resultado" }),
|
|
6855
|
+
/* @__PURE__ */ jsx33("p", { className: "text-text-700 text-md", children: isCorrect ? "\u{1F389} Parab\xE9ns!!" : "N\xE3o foi dessa vez..." })
|
|
6856
|
+
]
|
|
6857
|
+
}
|
|
6858
|
+
);
|
|
6859
|
+
}
|
|
6860
|
+
);
|
|
6522
6861
|
var QuizTitle = forwardRef17(
|
|
6523
6862
|
({ className, ...props }, ref) => {
|
|
6524
6863
|
const {
|
|
@@ -6535,7 +6874,10 @@ var QuizTitle = forwardRef17(
|
|
|
6535
6874
|
"div",
|
|
6536
6875
|
{
|
|
6537
6876
|
ref,
|
|
6538
|
-
className:
|
|
6877
|
+
className: cn(
|
|
6878
|
+
"flex flex-row justify-center items-center relative p-2",
|
|
6879
|
+
className
|
|
6880
|
+
),
|
|
6539
6881
|
...props,
|
|
6540
6882
|
children: [
|
|
6541
6883
|
/* @__PURE__ */ jsxs27("span", { className: "flex flex-col gap-2 text-center", children: [
|
|
@@ -6567,30 +6909,46 @@ var QuizContent = forwardRef17(({ type = "Alternativas", children, className, ..
|
|
|
6567
6909
|
"div",
|
|
6568
6910
|
{
|
|
6569
6911
|
ref,
|
|
6570
|
-
className:
|
|
6912
|
+
className: cn(
|
|
6913
|
+
"rounded-t-xl px-4 pt-4 pb-[80px] h-full flex flex-col gap-4 mb-auto",
|
|
6914
|
+
className
|
|
6915
|
+
),
|
|
6571
6916
|
...props,
|
|
6572
6917
|
children
|
|
6573
6918
|
}
|
|
6574
6919
|
)
|
|
6575
6920
|
] });
|
|
6576
6921
|
});
|
|
6577
|
-
var QuizAlternative = () => {
|
|
6922
|
+
var QuizAlternative = ({ variant = "default" }) => {
|
|
6578
6923
|
const { getCurrentQuestion, selectAnswer, getCurrentAnswer } = useQuizStore();
|
|
6579
6924
|
const currentQuestion = getCurrentQuestion();
|
|
6580
6925
|
const currentAnswer = getCurrentAnswer();
|
|
6581
|
-
const alternatives = currentQuestion?.options?.map((option) =>
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6926
|
+
const alternatives = currentQuestion?.options?.map((option) => {
|
|
6927
|
+
let status = "neutral" /* NEUTRAL */;
|
|
6928
|
+
if (variant === "result") {
|
|
6929
|
+
if (option.id === currentQuestion.correctOptionId) {
|
|
6930
|
+
status = "correct" /* CORRECT */;
|
|
6931
|
+
} else if (currentAnswer === option.id && option.id !== currentQuestion.correctOptionId) {
|
|
6932
|
+
status = "incorrect" /* INCORRECT */;
|
|
6933
|
+
}
|
|
6934
|
+
}
|
|
6935
|
+
return {
|
|
6936
|
+
label: option.option,
|
|
6937
|
+
value: option.id,
|
|
6938
|
+
status
|
|
6939
|
+
};
|
|
6940
|
+
});
|
|
6585
6941
|
if (!alternatives)
|
|
6586
6942
|
return /* @__PURE__ */ jsx33("div", { children: /* @__PURE__ */ jsx33("p", { children: "N\xE3o h\xE1 Alternativas" }) });
|
|
6587
6943
|
return /* @__PURE__ */ jsx33("div", { className: "space-y-4", children: /* @__PURE__ */ jsx33(
|
|
6588
6944
|
AlternativesList,
|
|
6589
6945
|
{
|
|
6946
|
+
mode: variant === "default" ? "interactive" : "readonly",
|
|
6590
6947
|
name: `question-${currentQuestion?.id || "1"}`,
|
|
6591
|
-
layout: "
|
|
6948
|
+
layout: "compact",
|
|
6592
6949
|
alternatives,
|
|
6593
6950
|
value: currentAnswer,
|
|
6951
|
+
selectedValue: currentAnswer,
|
|
6594
6952
|
onValueChange: (value) => {
|
|
6595
6953
|
if (currentQuestion) {
|
|
6596
6954
|
selectAnswer(currentQuestion.id, value);
|
|
@@ -6607,18 +6965,11 @@ var QuizQuestionList = ({
|
|
|
6607
6965
|
const {
|
|
6608
6966
|
getQuestionsGroupedBySubject,
|
|
6609
6967
|
goToQuestion,
|
|
6610
|
-
|
|
6611
|
-
isQuestionSkipped
|
|
6968
|
+
getQuestionStatusFromUserAnswers
|
|
6612
6969
|
} = useQuizStore();
|
|
6613
6970
|
const groupedQuestions = getQuestionsGroupedBySubject();
|
|
6614
6971
|
const getQuestionStatus = (questionId) => {
|
|
6615
|
-
|
|
6616
|
-
return "skipped";
|
|
6617
|
-
}
|
|
6618
|
-
if (isQuestionAnswered(questionId)) {
|
|
6619
|
-
return "answered";
|
|
6620
|
-
}
|
|
6621
|
-
return "unanswered";
|
|
6972
|
+
return getQuestionStatusFromUserAnswers(questionId);
|
|
6622
6973
|
};
|
|
6623
6974
|
const filteredGroupedQuestions = Object.entries(groupedQuestions).reduce(
|
|
6624
6975
|
(acc, [subjectId, questions]) => {
|
|
@@ -6642,8 +6993,8 @@ var QuizQuestionList = ({
|
|
|
6642
6993
|
{}
|
|
6643
6994
|
);
|
|
6644
6995
|
const getQuestionIndex = (questionId) => {
|
|
6645
|
-
const {
|
|
6646
|
-
const quiz =
|
|
6996
|
+
const { bySimulated, byActivity, byQuestionary } = useQuizStore.getState();
|
|
6997
|
+
const quiz = bySimulated ?? byActivity ?? byQuestionary;
|
|
6647
6998
|
if (!quiz) return 0;
|
|
6648
6999
|
const index = quiz.questions.findIndex((q) => q.id === questionId);
|
|
6649
7000
|
return index + 1;
|
|
@@ -6653,7 +7004,7 @@ var QuizQuestionList = ({
|
|
|
6653
7004
|
case "answered":
|
|
6654
7005
|
return "Respondida";
|
|
6655
7006
|
case "skipped":
|
|
6656
|
-
return "
|
|
7007
|
+
return "N\xE3o respondida";
|
|
6657
7008
|
default:
|
|
6658
7009
|
return "Em branco";
|
|
6659
7010
|
}
|
|
@@ -6694,14 +7045,14 @@ var QuizFooter = forwardRef17(({ className, onGoToSimulated, onDetailResult, ...
|
|
|
6694
7045
|
getCurrentAnswer,
|
|
6695
7046
|
skipQuestion,
|
|
6696
7047
|
getCurrentQuestion,
|
|
6697
|
-
|
|
7048
|
+
getQuestionStatusFromUserAnswers
|
|
6698
7049
|
} = useQuizStore();
|
|
6699
7050
|
const totalQuestions = getTotalQuestions();
|
|
6700
7051
|
const isFirstQuestion = currentQuestionIndex === 0;
|
|
6701
7052
|
const isLastQuestion = currentQuestionIndex === totalQuestions - 1;
|
|
6702
7053
|
const currentAnswer = getCurrentAnswer();
|
|
6703
7054
|
const currentQuestion = getCurrentQuestion();
|
|
6704
|
-
const isCurrentQuestionSkipped = currentQuestion ?
|
|
7055
|
+
const isCurrentQuestionSkipped = currentQuestion ? getQuestionStatusFromUserAnswers(currentQuestion.id) === "skipped" : false;
|
|
6705
7056
|
const [alertDialogOpen, setAlertDialogOpen] = useState12(false);
|
|
6706
7057
|
const [modalResultOpen, setModalResultOpen] = useState12(false);
|
|
6707
7058
|
const [modalNavigateOpen, setModalNavigateOpen] = useState12(false);
|
|
@@ -6714,7 +7065,10 @@ var QuizFooter = forwardRef17(({ className, onGoToSimulated, onDetailResult, ...
|
|
|
6714
7065
|
"footer",
|
|
6715
7066
|
{
|
|
6716
7067
|
ref,
|
|
6717
|
-
className:
|
|
7068
|
+
className: cn(
|
|
7069
|
+
"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",
|
|
7070
|
+
className
|
|
7071
|
+
),
|
|
6718
7072
|
...props,
|
|
6719
7073
|
children: [
|
|
6720
7074
|
/* @__PURE__ */ jsxs27("div", { className: "flex flex-row items-center gap-1", children: [
|
|
@@ -6891,6 +7245,223 @@ var QuizFooter = forwardRef17(({ className, onGoToSimulated, onDetailResult, ...
|
|
|
6891
7245
|
)
|
|
6892
7246
|
] });
|
|
6893
7247
|
});
|
|
7248
|
+
var QuizResultHeaderTitle = forwardRef17(({ className, ...props }, ref) => {
|
|
7249
|
+
const { bySimulated } = useQuizStore();
|
|
7250
|
+
return /* @__PURE__ */ jsxs27(
|
|
7251
|
+
"div",
|
|
7252
|
+
{
|
|
7253
|
+
ref,
|
|
7254
|
+
className: cn("flex flex-row pt-4 justify-between", className),
|
|
7255
|
+
...props,
|
|
7256
|
+
children: [
|
|
7257
|
+
/* @__PURE__ */ jsx33("p", { className: "text-text-950 font-bold text-2xl", children: "Resultado" }),
|
|
7258
|
+
bySimulated && /* @__PURE__ */ jsx33(Badge_default, { variant: "solid", action: "info", children: bySimulated.category })
|
|
7259
|
+
]
|
|
7260
|
+
}
|
|
7261
|
+
);
|
|
7262
|
+
});
|
|
7263
|
+
var QuizResultTitle = forwardRef17(({ className, ...props }, ref) => {
|
|
7264
|
+
const { getQuizTitle } = useQuizStore();
|
|
7265
|
+
const quizTitle = getQuizTitle();
|
|
7266
|
+
return /* @__PURE__ */ jsx33(
|
|
7267
|
+
"p",
|
|
7268
|
+
{
|
|
7269
|
+
className: cn("pt-6 pb-4 text-text-950 font-bold text-lg", className),
|
|
7270
|
+
ref,
|
|
7271
|
+
...props,
|
|
7272
|
+
children: quizTitle
|
|
7273
|
+
}
|
|
7274
|
+
);
|
|
7275
|
+
});
|
|
7276
|
+
var QuizResultPerformance = forwardRef17(
|
|
7277
|
+
({ ...props }, ref) => {
|
|
7278
|
+
const {
|
|
7279
|
+
getTotalQuestions,
|
|
7280
|
+
timeElapsed,
|
|
7281
|
+
formatTime,
|
|
7282
|
+
bySimulated,
|
|
7283
|
+
byActivity,
|
|
7284
|
+
byQuestionary
|
|
7285
|
+
} = useQuizStore();
|
|
7286
|
+
const totalQuestions = getTotalQuestions();
|
|
7287
|
+
const quiz = bySimulated || byActivity || byQuestionary;
|
|
7288
|
+
let correctAnswers = 0;
|
|
7289
|
+
let correctEasyAnswers = 0;
|
|
7290
|
+
let correctMediumAnswers = 0;
|
|
7291
|
+
let correctDifficultAnswers = 0;
|
|
7292
|
+
let totalEasyQuestions = 0;
|
|
7293
|
+
let totalMediumQuestions = 0;
|
|
7294
|
+
let totalDifficultQuestions = 0;
|
|
7295
|
+
if (quiz) {
|
|
7296
|
+
quiz.questions.forEach((question) => {
|
|
7297
|
+
const userAnswer = question.answerKey;
|
|
7298
|
+
const isCorrect = userAnswer && userAnswer === question.correctOptionId;
|
|
7299
|
+
if (isCorrect) {
|
|
7300
|
+
correctAnswers++;
|
|
7301
|
+
}
|
|
7302
|
+
if (question.difficulty === "FACIL" /* FACIL */) {
|
|
7303
|
+
totalEasyQuestions++;
|
|
7304
|
+
if (isCorrect) {
|
|
7305
|
+
correctEasyAnswers++;
|
|
7306
|
+
}
|
|
7307
|
+
} else if (question.difficulty === "MEDIO" /* MEDIO */) {
|
|
7308
|
+
totalMediumQuestions++;
|
|
7309
|
+
if (isCorrect) {
|
|
7310
|
+
correctMediumAnswers++;
|
|
7311
|
+
}
|
|
7312
|
+
} else if (question.difficulty === "DIFICIL" /* DIFICIL */) {
|
|
7313
|
+
totalDifficultQuestions++;
|
|
7314
|
+
if (isCorrect) {
|
|
7315
|
+
correctDifficultAnswers++;
|
|
7316
|
+
}
|
|
7317
|
+
}
|
|
7318
|
+
});
|
|
7319
|
+
}
|
|
7320
|
+
const percentage = totalQuestions > 0 ? Math.round(correctAnswers / totalQuestions * 100) : 0;
|
|
7321
|
+
return /* @__PURE__ */ jsxs27(
|
|
7322
|
+
"div",
|
|
7323
|
+
{
|
|
7324
|
+
className: "flex flex-row gap-6 p-6 rounded-xl bg-background justify-between",
|
|
7325
|
+
ref,
|
|
7326
|
+
...props,
|
|
7327
|
+
children: [
|
|
7328
|
+
/* @__PURE__ */ jsxs27("div", { className: "relative", children: [
|
|
7329
|
+
/* @__PURE__ */ jsx33(
|
|
7330
|
+
ProgressCircle_default,
|
|
7331
|
+
{
|
|
7332
|
+
size: "medium",
|
|
7333
|
+
variant: "green",
|
|
7334
|
+
value: percentage,
|
|
7335
|
+
showPercentage: false,
|
|
7336
|
+
label: ""
|
|
7337
|
+
}
|
|
7338
|
+
),
|
|
7339
|
+
/* @__PURE__ */ jsxs27("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
|
|
7340
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-1 mb-1", children: [
|
|
7341
|
+
/* @__PURE__ */ jsx33(Clock2, { size: 12, weight: "regular", className: "text-text-800" }),
|
|
7342
|
+
/* @__PURE__ */ jsx33("span", { className: "text-2xs font-medium text-text-800", children: formatTime(timeElapsed) })
|
|
7343
|
+
] }),
|
|
7344
|
+
/* @__PURE__ */ jsxs27("div", { className: "text-2xl font-medium text-text-800 leading-7", children: [
|
|
7345
|
+
correctAnswers,
|
|
7346
|
+
" de ",
|
|
7347
|
+
totalQuestions
|
|
7348
|
+
] }),
|
|
7349
|
+
/* @__PURE__ */ jsx33("div", { className: "text-2xs font-medium text-text-600 mt-1", children: "Corretas" })
|
|
7350
|
+
] })
|
|
7351
|
+
] }),
|
|
7352
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex flex-col gap-4 w-full", children: [
|
|
7353
|
+
/* @__PURE__ */ jsx33(
|
|
7354
|
+
ProgressBar_default,
|
|
7355
|
+
{
|
|
7356
|
+
className: "w-full",
|
|
7357
|
+
layout: "stacked",
|
|
7358
|
+
variant: "green",
|
|
7359
|
+
value: correctEasyAnswers,
|
|
7360
|
+
max: totalEasyQuestions,
|
|
7361
|
+
label: "F\xE1ceis",
|
|
7362
|
+
showHitCount: true,
|
|
7363
|
+
labelClassName: "text-base font-medium text-text-800 leading-none",
|
|
7364
|
+
percentageClassName: "text-xs font-medium leading-[14px] text-right"
|
|
7365
|
+
}
|
|
7366
|
+
),
|
|
7367
|
+
/* @__PURE__ */ jsx33(
|
|
7368
|
+
ProgressBar_default,
|
|
7369
|
+
{
|
|
7370
|
+
className: "w-full",
|
|
7371
|
+
layout: "stacked",
|
|
7372
|
+
variant: "green",
|
|
7373
|
+
value: correctMediumAnswers,
|
|
7374
|
+
max: totalMediumQuestions,
|
|
7375
|
+
label: "M\xE9dias",
|
|
7376
|
+
showHitCount: true,
|
|
7377
|
+
labelClassName: "text-base font-medium text-text-800 leading-none",
|
|
7378
|
+
percentageClassName: "text-xs font-medium leading-[14px] text-right"
|
|
7379
|
+
}
|
|
7380
|
+
),
|
|
7381
|
+
/* @__PURE__ */ jsx33(
|
|
7382
|
+
ProgressBar_default,
|
|
7383
|
+
{
|
|
7384
|
+
className: "w-full",
|
|
7385
|
+
layout: "stacked",
|
|
7386
|
+
variant: "green",
|
|
7387
|
+
value: correctDifficultAnswers,
|
|
7388
|
+
max: totalDifficultQuestions,
|
|
7389
|
+
label: "Dif\xEDceis",
|
|
7390
|
+
showHitCount: true,
|
|
7391
|
+
labelClassName: "text-base font-medium text-text-800 leading-none",
|
|
7392
|
+
percentageClassName: "text-xs font-medium leading-[14px] text-right"
|
|
7393
|
+
}
|
|
7394
|
+
)
|
|
7395
|
+
] })
|
|
7396
|
+
]
|
|
7397
|
+
}
|
|
7398
|
+
);
|
|
7399
|
+
}
|
|
7400
|
+
);
|
|
7401
|
+
var QuizListResult = forwardRef17(({ className, onSubjectClick, ...props }, ref) => {
|
|
7402
|
+
const { getQuestionsGroupedBySubject, isQuestionAnswered } = useQuizStore();
|
|
7403
|
+
const groupedQuestions = getQuestionsGroupedBySubject();
|
|
7404
|
+
const subjectsStats = Object.entries(groupedQuestions).map(
|
|
7405
|
+
([subjectId, questions]) => {
|
|
7406
|
+
let correct = 0;
|
|
7407
|
+
let incorrect = 0;
|
|
7408
|
+
questions.forEach((question) => {
|
|
7409
|
+
if (isQuestionAnswered(question.id)) {
|
|
7410
|
+
const userAnswer = question.answerKey;
|
|
7411
|
+
if (userAnswer === question.correctOptionId) {
|
|
7412
|
+
correct++;
|
|
7413
|
+
} else {
|
|
7414
|
+
incorrect++;
|
|
7415
|
+
}
|
|
7416
|
+
}
|
|
7417
|
+
});
|
|
7418
|
+
return {
|
|
7419
|
+
subject: subjectId,
|
|
7420
|
+
correct,
|
|
7421
|
+
incorrect,
|
|
7422
|
+
total: questions.length
|
|
7423
|
+
};
|
|
7424
|
+
}
|
|
7425
|
+
);
|
|
7426
|
+
return /* @__PURE__ */ jsxs27("section", { ref, className, ...props, children: [
|
|
7427
|
+
/* @__PURE__ */ jsx33("p", { className: "pt-6 pb-4 text-text-950 font-bold text-lg", children: "Mat\xE9rias" }),
|
|
7428
|
+
/* @__PURE__ */ jsx33("ul", { className: "flex flex-col gap-2", children: subjectsStats.map((subject) => /* @__PURE__ */ jsx33("li", { children: /* @__PURE__ */ jsx33(
|
|
7429
|
+
CardResults,
|
|
7430
|
+
{
|
|
7431
|
+
onClick: () => onSubjectClick?.(subject.subject),
|
|
7432
|
+
className: "max-w-full",
|
|
7433
|
+
header: subject.subject,
|
|
7434
|
+
correct_answers: subject.correct,
|
|
7435
|
+
incorrect_answers: subject.incorrect,
|
|
7436
|
+
icon: /* @__PURE__ */ jsx33(Book, { size: 20 }),
|
|
7437
|
+
direction: "row"
|
|
7438
|
+
}
|
|
7439
|
+
) }, subject.subject)) })
|
|
7440
|
+
] });
|
|
7441
|
+
});
|
|
7442
|
+
var QuizListResultByMateria = ({
|
|
7443
|
+
subject,
|
|
7444
|
+
onQuestionClick
|
|
7445
|
+
}) => {
|
|
7446
|
+
const { getQuestionsGroupedBySubject } = useQuizStore();
|
|
7447
|
+
const groupedQuestions = getQuestionsGroupedBySubject();
|
|
7448
|
+
const answeredQuestions = groupedQuestions[subject] || [];
|
|
7449
|
+
return /* @__PURE__ */ jsxs27("div", { className: "w-full max-w-[1000px] flex flex-col mx-auto h-full relative not-lg:px-6", children: [
|
|
7450
|
+
/* @__PURE__ */ jsx33("div", { className: "flex flex-row pt-4 justify-between", children: /* @__PURE__ */ jsx33("p", { className: "text-text-950 font-bold text-2xl", children: subject }) }),
|
|
7451
|
+
/* @__PURE__ */ jsxs27("section", { className: "flex flex-col ", children: [
|
|
7452
|
+
/* @__PURE__ */ jsx33("p", { className: "pt-6 pb-4 text-text-950 font-bold text-lg", children: "Resultado das quest\xF5es" }),
|
|
7453
|
+
/* @__PURE__ */ jsx33("ul", { className: "flex flex-col gap-2 pt-4", children: answeredQuestions.map((question) => /* @__PURE__ */ jsx33("li", { children: /* @__PURE__ */ jsx33(
|
|
7454
|
+
CardStatus,
|
|
7455
|
+
{
|
|
7456
|
+
className: "max-w-full",
|
|
7457
|
+
header: `Quest\xE3o ${question.id}`,
|
|
7458
|
+
status: question.answerKey === question.correctOptionId ? "correct" : "incorrect",
|
|
7459
|
+
onClick: () => onQuestionClick?.(question)
|
|
7460
|
+
}
|
|
7461
|
+
) }, question.id)) })
|
|
7462
|
+
] })
|
|
7463
|
+
] });
|
|
7464
|
+
};
|
|
6894
7465
|
export {
|
|
6895
7466
|
Alert_default as Alert,
|
|
6896
7467
|
AlertDialog,
|
|
@@ -6942,7 +7513,11 @@ export {
|
|
|
6942
7513
|
QuizContent,
|
|
6943
7514
|
QuizFooter,
|
|
6944
7515
|
QuizHeader,
|
|
7516
|
+
QuizListResultByMateria,
|
|
6945
7517
|
QuizQuestionList,
|
|
7518
|
+
QuizResultHeaderTitle,
|
|
7519
|
+
QuizResultPerformance,
|
|
7520
|
+
QuizResultTitle,
|
|
6946
7521
|
QuizTitle,
|
|
6947
7522
|
Radio_default as Radio,
|
|
6948
7523
|
RadioGroup,
|