analytica-frontend-lib 1.2.29 → 1.2.31

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.
@@ -0,0 +1,1701 @@
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
+ function getSubjectColorWithOpacity(hexColor, isDark) {
8
+ if (!hexColor) return void 0;
9
+ let color = hexColor.replace(/^#/, "").toLowerCase();
10
+ if (isDark) {
11
+ if (color.length === 8) {
12
+ color = color.slice(0, 6);
13
+ }
14
+ return `#${color}`;
15
+ } else {
16
+ let resultColor;
17
+ if (color.length === 6) {
18
+ resultColor = `#${color}4d`;
19
+ } else if (color.length === 8) {
20
+ resultColor = `#${color}`;
21
+ } else {
22
+ resultColor = `#${color}`;
23
+ }
24
+ return resultColor;
25
+ }
26
+ }
27
+
28
+ // src/components/Text/Text.tsx
29
+ import { jsx } from "react/jsx-runtime";
30
+ var Text = ({
31
+ children,
32
+ size = "md",
33
+ weight = "normal",
34
+ color = "text-text-950",
35
+ as,
36
+ className = "",
37
+ ...props
38
+ }) => {
39
+ let sizeClasses = "";
40
+ let weightClasses = "";
41
+ const sizeClassMap = {
42
+ "2xs": "text-2xs",
43
+ xs: "text-xs",
44
+ sm: "text-sm",
45
+ md: "text-md",
46
+ lg: "text-lg",
47
+ xl: "text-xl",
48
+ "2xl": "text-2xl",
49
+ "3xl": "text-3xl",
50
+ "4xl": "text-4xl",
51
+ "5xl": "text-5xl",
52
+ "6xl": "text-6xl"
53
+ };
54
+ sizeClasses = sizeClassMap[size] ?? sizeClassMap.md;
55
+ const weightClassMap = {
56
+ hairline: "font-hairline",
57
+ light: "font-light",
58
+ normal: "font-normal",
59
+ medium: "font-medium",
60
+ semibold: "font-semibold",
61
+ bold: "font-bold",
62
+ extrabold: "font-extrabold",
63
+ black: "font-black"
64
+ };
65
+ weightClasses = weightClassMap[weight] ?? weightClassMap.normal;
66
+ const baseClasses = "font-primary";
67
+ const Component = as ?? "p";
68
+ return /* @__PURE__ */ jsx(
69
+ Component,
70
+ {
71
+ className: cn(baseClasses, sizeClasses, weightClasses, color, className),
72
+ ...props,
73
+ children
74
+ }
75
+ );
76
+ };
77
+ var Text_default = Text;
78
+
79
+ // src/components/Button/Button.tsx
80
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
81
+ var VARIANT_ACTION_CLASSES = {
82
+ solid: {
83
+ primary: "bg-primary-950 text-text border border-primary-950 hover:bg-primary-800 hover:border-primary-800 focus-visible:outline-none focus-visible:bg-primary-950 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-primary-700 active:border-primary-700 disabled:bg-primary-500 disabled:border-primary-500 disabled:opacity-40 disabled:cursor-not-allowed",
84
+ positive: "bg-success-500 text-text border border-success-500 hover:bg-success-600 hover:border-success-600 focus-visible:outline-none focus-visible:bg-success-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-success-700 active:border-success-700 disabled:bg-success-500 disabled:border-success-500 disabled:opacity-40 disabled:cursor-not-allowed",
85
+ negative: "bg-error-500 text-text border border-error-500 hover:bg-error-600 hover:border-error-600 focus-visible:outline-none focus-visible:bg-error-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-error-700 active:border-error-700 disabled:bg-error-500 disabled:border-error-500 disabled:opacity-40 disabled:cursor-not-allowed"
86
+ },
87
+ outline: {
88
+ primary: "bg-transparent text-primary-950 border border-primary-950 hover:bg-background-50 hover:text-primary-400 hover:border-primary-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 active:border-primary-700 disabled:opacity-40 disabled:cursor-not-allowed",
89
+ positive: "bg-transparent text-success-500 border border-success-300 hover:bg-background-50 hover:text-success-400 hover:border-success-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 active:border-success-700 disabled:opacity-40 disabled:cursor-not-allowed",
90
+ negative: "bg-transparent text-error-500 border border-error-300 hover:bg-background-50 hover:text-error-400 hover:border-error-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 active:border-error-700 disabled:opacity-40 disabled:cursor-not-allowed"
91
+ },
92
+ link: {
93
+ primary: "bg-transparent text-primary-950 hover:text-primary-400 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 disabled:opacity-40 disabled:cursor-not-allowed",
94
+ positive: "bg-transparent text-success-500 hover:text-success-400 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 disabled:opacity-40 disabled:cursor-not-allowed",
95
+ negative: "bg-transparent text-error-500 hover:text-error-400 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 disabled:opacity-40 disabled:cursor-not-allowed"
96
+ }
97
+ };
98
+ var SIZE_CLASSES = {
99
+ "extra-small": "text-xs px-3.5 py-2",
100
+ small: "text-sm px-4 py-2.5",
101
+ medium: "text-md px-5 py-2.5",
102
+ large: "text-lg px-6 py-3",
103
+ "extra-large": "text-lg px-7 py-3.5"
104
+ };
105
+ var Button = ({
106
+ children,
107
+ iconLeft,
108
+ iconRight,
109
+ size = "medium",
110
+ variant = "solid",
111
+ action = "primary",
112
+ className = "",
113
+ disabled,
114
+ type = "button",
115
+ ...props
116
+ }) => {
117
+ const sizeClasses = SIZE_CLASSES[size];
118
+ const variantClasses = VARIANT_ACTION_CLASSES[variant][action];
119
+ const baseClasses = "inline-flex items-center justify-center rounded-full cursor-pointer font-medium";
120
+ return /* @__PURE__ */ jsxs(
121
+ "button",
122
+ {
123
+ className: cn(baseClasses, variantClasses, sizeClasses, className),
124
+ disabled,
125
+ type,
126
+ ...props,
127
+ children: [
128
+ iconLeft && /* @__PURE__ */ jsx2("span", { className: "mr-2 flex items-center", children: iconLeft }),
129
+ children,
130
+ iconRight && /* @__PURE__ */ jsx2("span", { className: "ml-2 flex items-center", children: iconRight })
131
+ ]
132
+ }
133
+ );
134
+ };
135
+ var Button_default = Button;
136
+
137
+ // src/components/Badge/Badge.tsx
138
+ import { Bell } from "phosphor-react";
139
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
140
+ var VARIANT_ACTION_CLASSES2 = {
141
+ solid: {
142
+ error: "bg-error-background text-error-700 focus-visible:outline-none",
143
+ warning: "bg-warning text-warning-800 focus-visible:outline-none",
144
+ success: "bg-success text-success-800 focus-visible:outline-none",
145
+ info: "bg-info text-info-800 focus-visible:outline-none",
146
+ muted: "bg-background-muted text-background-800 focus-visible:outline-none"
147
+ },
148
+ outlined: {
149
+ error: "bg-error text-error-700 border border-error-300 focus-visible:outline-none",
150
+ warning: "bg-warning text-warning-800 border border-warning-300 focus-visible:outline-none",
151
+ success: "bg-success text-success-800 border border-success-300 focus-visible:outline-none",
152
+ info: "bg-info text-info-800 border border-info-300 focus-visible:outline-none",
153
+ muted: "bg-background-muted text-background-800 border border-border-300 focus-visible:outline-none"
154
+ },
155
+ exams: {
156
+ exam1: "bg-exam-1 text-info-700 focus-visible:outline-none",
157
+ exam2: "bg-exam-2 text-typography-1 focus-visible:outline-none",
158
+ exam3: "bg-exam-3 text-typography-2 focus-visible:outline-none",
159
+ exam4: "bg-exam-4 text-success-700 focus-visible:outline-none"
160
+ },
161
+ examsOutlined: {
162
+ exam1: "bg-exam-1 text-info-700 border border-info-700 focus-visible:outline-none",
163
+ exam2: "bg-exam-2 text-typography-1 border border-typography-1 focus-visible:outline-none",
164
+ exam3: "bg-exam-3 text-typography-2 border border-typography-2 focus-visible:outline-none",
165
+ exam4: "bg-exam-4 text-success-700 border border-success-700 focus-visible:outline-none"
166
+ },
167
+ resultStatus: {
168
+ negative: "bg-error text-error-800 focus-visible:outline-none",
169
+ positive: "bg-success text-success-800 focus-visible:outline-none"
170
+ },
171
+ notification: "text-primary"
172
+ };
173
+ var SIZE_CLASSES2 = {
174
+ small: "text-2xs px-2 py-1",
175
+ medium: "text-xs px-2 py-1",
176
+ large: "text-sm px-2 py-1"
177
+ };
178
+ var SIZE_CLASSES_ICON = {
179
+ small: "size-3",
180
+ medium: "size-3.5",
181
+ large: "size-4"
182
+ };
183
+ var Badge = ({
184
+ children,
185
+ iconLeft,
186
+ iconRight,
187
+ size = "medium",
188
+ variant = "solid",
189
+ action = "error",
190
+ className = "",
191
+ notificationActive = false,
192
+ ...props
193
+ }) => {
194
+ const sizeClasses = SIZE_CLASSES2[size];
195
+ const sizeClassesIcon = SIZE_CLASSES_ICON[size];
196
+ const variantActionMap = VARIANT_ACTION_CLASSES2[variant] || {};
197
+ const variantClasses = typeof variantActionMap === "string" ? variantActionMap : variantActionMap[action] ?? variantActionMap.muted ?? "";
198
+ const baseClasses = "inline-flex items-center justify-center rounded-xs font-normal gap-1 relative";
199
+ const baseClassesIcon = "flex items-center";
200
+ if (variant === "notification") {
201
+ return /* @__PURE__ */ jsxs2(
202
+ "div",
203
+ {
204
+ className: cn(baseClasses, variantClasses, sizeClasses, className),
205
+ ...props,
206
+ children: [
207
+ /* @__PURE__ */ jsx3(Bell, { size: 24, className: "text-current", "aria-hidden": "true" }),
208
+ notificationActive && /* @__PURE__ */ jsx3(
209
+ "span",
210
+ {
211
+ "data-testid": "notification-dot",
212
+ className: "absolute top-[5px] right-[10px] block h-2 w-2 rounded-full bg-indicator-error ring-2 ring-white"
213
+ }
214
+ )
215
+ ]
216
+ }
217
+ );
218
+ }
219
+ return /* @__PURE__ */ jsxs2(
220
+ "div",
221
+ {
222
+ className: cn(baseClasses, variantClasses, sizeClasses, className),
223
+ ...props,
224
+ children: [
225
+ iconLeft && /* @__PURE__ */ jsx3("span", { className: cn(baseClassesIcon, sizeClassesIcon), children: iconLeft }),
226
+ children,
227
+ iconRight && /* @__PURE__ */ jsx3("span", { className: cn(baseClassesIcon, sizeClassesIcon), children: iconRight })
228
+ ]
229
+ }
230
+ );
231
+ };
232
+ var Badge_default = Badge;
233
+
234
+ // src/components/CheckBox/CheckBox.tsx
235
+ import {
236
+ forwardRef,
237
+ useState,
238
+ useId
239
+ } from "react";
240
+ import { Check, Minus } from "phosphor-react";
241
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
242
+ var SIZE_CLASSES3 = {
243
+ small: {
244
+ checkbox: "w-4 h-4",
245
+ // 16px x 16px
246
+ textSize: "sm",
247
+ spacing: "gap-1.5",
248
+ // 6px
249
+ borderWidth: "border-2",
250
+ iconSize: 14,
251
+ // pixels for Phosphor icons
252
+ labelHeight: "h-[21px]"
253
+ },
254
+ medium: {
255
+ checkbox: "w-5 h-5",
256
+ // 20px x 20px
257
+ textSize: "md",
258
+ spacing: "gap-2",
259
+ // 8px
260
+ borderWidth: "border-2",
261
+ iconSize: 16,
262
+ // pixels for Phosphor icons
263
+ labelHeight: "h-6"
264
+ },
265
+ large: {
266
+ checkbox: "w-6 h-6",
267
+ // 24px x 24px
268
+ textSize: "lg",
269
+ spacing: "gap-2",
270
+ // 8px
271
+ borderWidth: "border-[3px]",
272
+ // 3px border
273
+ iconSize: 20,
274
+ // pixels for Phosphor icons
275
+ labelHeight: "h-[27px]"
276
+ }
277
+ };
278
+ var BASE_CHECKBOX_CLASSES = "rounded border cursor-pointer transition-all duration-200 flex items-center justify-center focus:outline-none";
279
+ var STATE_CLASSES = {
280
+ default: {
281
+ unchecked: "border-border-400 bg-background hover:border-border-500",
282
+ checked: "border-primary-950 bg-primary-950 text-text hover:border-primary-800 hover:bg-primary-800"
283
+ },
284
+ hovered: {
285
+ unchecked: "border-border-500 bg-background",
286
+ checked: "border-primary-800 bg-primary-800 text-text"
287
+ },
288
+ focused: {
289
+ unchecked: "border-indicator-info bg-background ring-2 ring-indicator-info/20",
290
+ checked: "border-indicator-info bg-primary-950 text-text ring-2 ring-indicator-info/20"
291
+ },
292
+ invalid: {
293
+ unchecked: "border-error-700 bg-background hover:border-error-600",
294
+ checked: "border-error-700 bg-primary-950 text-text"
295
+ },
296
+ disabled: {
297
+ unchecked: "border-border-400 bg-background cursor-not-allowed opacity-40",
298
+ checked: "border-primary-600 bg-primary-600 text-text cursor-not-allowed opacity-40"
299
+ }
300
+ };
301
+ var CheckBox = forwardRef(
302
+ ({
303
+ label,
304
+ size = "medium",
305
+ state = "default",
306
+ indeterminate = false,
307
+ errorMessage,
308
+ helperText,
309
+ className = "",
310
+ labelClassName = "",
311
+ checked: checkedProp,
312
+ disabled,
313
+ id,
314
+ onChange,
315
+ ...props
316
+ }, ref) => {
317
+ const generatedId = useId();
318
+ const inputId = id ?? `checkbox-${generatedId}`;
319
+ const [internalChecked, setInternalChecked] = useState(false);
320
+ const isControlled = checkedProp !== void 0;
321
+ const checked = isControlled ? checkedProp : internalChecked;
322
+ const handleChange = (event) => {
323
+ if (!isControlled) {
324
+ setInternalChecked(event.target.checked);
325
+ }
326
+ onChange?.(event);
327
+ };
328
+ const currentState = disabled ? "disabled" : state;
329
+ const sizeClasses = SIZE_CLASSES3[size];
330
+ const checkVariant = checked || indeterminate ? "checked" : "unchecked";
331
+ const stylingClasses = STATE_CLASSES[currentState][checkVariant];
332
+ const borderWidthClass = state === "focused" || state === "hovered" && size === "large" ? "border-[3px]" : sizeClasses.borderWidth;
333
+ const checkboxClasses = cn(
334
+ BASE_CHECKBOX_CLASSES,
335
+ sizeClasses.checkbox,
336
+ borderWidthClass,
337
+ stylingClasses,
338
+ className
339
+ );
340
+ const renderIcon = () => {
341
+ if (indeterminate) {
342
+ return /* @__PURE__ */ jsx4(
343
+ Minus,
344
+ {
345
+ size: sizeClasses.iconSize,
346
+ weight: "bold",
347
+ color: "currentColor"
348
+ }
349
+ );
350
+ }
351
+ if (checked) {
352
+ return /* @__PURE__ */ jsx4(
353
+ Check,
354
+ {
355
+ size: sizeClasses.iconSize,
356
+ weight: "bold",
357
+ color: "currentColor"
358
+ }
359
+ );
360
+ }
361
+ return null;
362
+ };
363
+ return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col", children: [
364
+ /* @__PURE__ */ jsxs3(
365
+ "div",
366
+ {
367
+ className: cn(
368
+ "flex flex-row items-center",
369
+ sizeClasses.spacing,
370
+ disabled ? "opacity-40" : ""
371
+ ),
372
+ children: [
373
+ /* @__PURE__ */ jsx4(
374
+ "input",
375
+ {
376
+ ref,
377
+ type: "checkbox",
378
+ id: inputId,
379
+ checked,
380
+ disabled,
381
+ onChange: handleChange,
382
+ className: "sr-only",
383
+ ...props
384
+ }
385
+ ),
386
+ /* @__PURE__ */ jsx4("label", { htmlFor: inputId, className: checkboxClasses, children: renderIcon() }),
387
+ label && /* @__PURE__ */ jsx4(
388
+ "div",
389
+ {
390
+ className: cn(
391
+ "flex flex-row items-center",
392
+ sizeClasses.labelHeight
393
+ ),
394
+ children: /* @__PURE__ */ jsx4(
395
+ Text_default,
396
+ {
397
+ as: "label",
398
+ htmlFor: inputId,
399
+ size: sizeClasses.textSize,
400
+ weight: "normal",
401
+ className: cn(
402
+ "cursor-pointer select-none leading-[150%] flex items-center font-roboto",
403
+ labelClassName
404
+ ),
405
+ children: label
406
+ }
407
+ )
408
+ }
409
+ )
410
+ ]
411
+ }
412
+ ),
413
+ errorMessage && /* @__PURE__ */ jsx4(
414
+ Text_default,
415
+ {
416
+ size: "sm",
417
+ weight: "normal",
418
+ className: "mt-1.5",
419
+ color: "text-error-600",
420
+ children: errorMessage
421
+ }
422
+ ),
423
+ helperText && !errorMessage && /* @__PURE__ */ jsx4(
424
+ Text_default,
425
+ {
426
+ size: "sm",
427
+ weight: "normal",
428
+ className: "mt-1.5",
429
+ color: "text-text-500",
430
+ children: helperText
431
+ }
432
+ )
433
+ ] });
434
+ }
435
+ );
436
+ CheckBox.displayName = "CheckBox";
437
+ var CheckBox_default = CheckBox;
438
+
439
+ // src/components/CheckBox/CheckboxList.tsx
440
+ import {
441
+ forwardRef as forwardRef2,
442
+ useId as useId2,
443
+ useEffect,
444
+ useRef,
445
+ Children,
446
+ cloneElement,
447
+ isValidElement
448
+ } from "react";
449
+ import { create, useStore } from "zustand";
450
+ import { jsx as jsx5 } from "react/jsx-runtime";
451
+ var createCheckboxListStore = (name, defaultValues, disabled, onValuesChange) => create((set, get) => ({
452
+ values: defaultValues,
453
+ setValues: (values) => {
454
+ if (!get().disabled) {
455
+ set({ values });
456
+ get().onValuesChange?.(values);
457
+ }
458
+ },
459
+ toggleValue: (value) => {
460
+ if (!get().disabled) {
461
+ const currentValues = get().values;
462
+ const newValues = currentValues.includes(value) ? currentValues.filter((v) => v !== value) : [...currentValues, value];
463
+ set({ values: newValues });
464
+ get().onValuesChange?.(newValues);
465
+ }
466
+ },
467
+ onValuesChange,
468
+ disabled,
469
+ name
470
+ }));
471
+ var useCheckboxListStore = (externalStore) => {
472
+ if (!externalStore) {
473
+ throw new Error("CheckboxListItem must be used within a CheckboxList");
474
+ }
475
+ return externalStore;
476
+ };
477
+ var injectStore = (children, store) => Children.map(children, (child) => {
478
+ if (!isValidElement(child)) return child;
479
+ const typedChild = child;
480
+ const shouldInject = typedChild.type === CheckboxListItem;
481
+ return cloneElement(typedChild, {
482
+ ...shouldInject ? { store } : {},
483
+ ...typedChild.props.children ? { children: injectStore(typedChild.props.children, store) } : {}
484
+ });
485
+ });
486
+ var CheckboxList = forwardRef2(
487
+ ({
488
+ values: propValues,
489
+ defaultValues = [],
490
+ onValuesChange,
491
+ name: propName,
492
+ disabled = false,
493
+ className = "",
494
+ children,
495
+ ...props
496
+ }, ref) => {
497
+ const generatedId = useId2();
498
+ const name = propName || `checkbox-list-${generatedId}`;
499
+ const storeRef = useRef(null);
500
+ storeRef.current ??= createCheckboxListStore(
501
+ name,
502
+ defaultValues,
503
+ disabled,
504
+ onValuesChange
505
+ );
506
+ const store = storeRef.current;
507
+ const { setValues } = useStore(store, (s) => s);
508
+ useEffect(() => {
509
+ const currentValues = store.getState().values;
510
+ if (currentValues.length > 0 && onValuesChange) {
511
+ onValuesChange(currentValues);
512
+ }
513
+ }, []);
514
+ useEffect(() => {
515
+ if (propValues !== void 0) {
516
+ setValues(propValues);
517
+ }
518
+ }, [propValues, setValues]);
519
+ useEffect(() => {
520
+ store.setState({ disabled });
521
+ }, [disabled, store]);
522
+ return /* @__PURE__ */ jsx5(
523
+ "div",
524
+ {
525
+ ref,
526
+ className: cn("flex flex-col gap-2 w-full", className),
527
+ "aria-label": name,
528
+ ...props,
529
+ children: injectStore(children, store)
530
+ }
531
+ );
532
+ }
533
+ );
534
+ CheckboxList.displayName = "CheckboxList";
535
+ var CheckboxListItem = forwardRef2(
536
+ ({
537
+ value,
538
+ store: externalStore,
539
+ disabled: itemDisabled,
540
+ size = "medium",
541
+ state = "default",
542
+ className = "",
543
+ id,
544
+ ...props
545
+ }, ref) => {
546
+ const store = useCheckboxListStore(externalStore);
547
+ const {
548
+ values: groupValues,
549
+ toggleValue,
550
+ disabled: groupDisabled,
551
+ name
552
+ } = useStore(store);
553
+ const generatedId = useId2();
554
+ const inputId = id ?? `checkbox-item-${generatedId}`;
555
+ const isChecked = groupValues.includes(value);
556
+ const isDisabled = groupDisabled || itemDisabled;
557
+ const currentState = isDisabled ? "disabled" : state;
558
+ return /* @__PURE__ */ jsx5(
559
+ CheckBox_default,
560
+ {
561
+ ref,
562
+ id: inputId,
563
+ name,
564
+ value,
565
+ checked: isChecked,
566
+ disabled: isDisabled,
567
+ size,
568
+ state: currentState,
569
+ className,
570
+ onChange: () => {
571
+ if (!isDisabled) {
572
+ toggleValue(value);
573
+ }
574
+ },
575
+ ...props
576
+ }
577
+ );
578
+ }
579
+ );
580
+ CheckboxListItem.displayName = "CheckboxListItem";
581
+ var CheckboxList_default = CheckboxList;
582
+
583
+ // src/components/Radio/Radio.tsx
584
+ import {
585
+ forwardRef as forwardRef3,
586
+ useState as useState2,
587
+ useId as useId3,
588
+ useEffect as useEffect2,
589
+ useRef as useRef2,
590
+ Children as Children2,
591
+ cloneElement as cloneElement2,
592
+ isValidElement as isValidElement2
593
+ } from "react";
594
+ import { create as create2, useStore as useStore2 } from "zustand";
595
+ import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
596
+ var SIZE_CLASSES4 = {
597
+ small: {
598
+ radio: "w-5 h-5",
599
+ textSize: "sm",
600
+ spacing: "gap-1.5",
601
+ borderWidth: "border-2",
602
+ dotSize: "w-2.5 h-2.5",
603
+ labelHeight: "h-5"
604
+ },
605
+ medium: {
606
+ radio: "w-6 h-6",
607
+ textSize: "md",
608
+ spacing: "gap-2",
609
+ borderWidth: "border-2",
610
+ dotSize: "w-3 h-3",
611
+ labelHeight: "h-6"
612
+ },
613
+ large: {
614
+ radio: "w-7 h-7",
615
+ textSize: "lg",
616
+ spacing: "gap-2",
617
+ borderWidth: "border-2",
618
+ dotSize: "w-3.5 h-3.5",
619
+ labelHeight: "h-7"
620
+ },
621
+ extraLarge: {
622
+ radio: "w-8 h-8",
623
+ textSize: "xl",
624
+ spacing: "gap-3",
625
+ borderWidth: "border-2",
626
+ dotSize: "w-4 h-4",
627
+ labelHeight: "h-8"
628
+ }
629
+ };
630
+ var BASE_RADIO_CLASSES = "rounded-full border cursor-pointer transition-all duration-200 flex items-center justify-center focus:outline-none";
631
+ var STATE_CLASSES2 = {
632
+ default: {
633
+ unchecked: "border-border-400 bg-background hover:border-border-500",
634
+ checked: "border-primary-950 bg-background hover:border-primary-800"
635
+ },
636
+ hovered: {
637
+ unchecked: "border-border-500 bg-background",
638
+ checked: "border-info-700 bg-background"
639
+ },
640
+ focused: {
641
+ unchecked: "border-border-400 bg-background",
642
+ checked: "border-primary-950 bg-background"
643
+ },
644
+ invalid: {
645
+ unchecked: "border-border-400 bg-background",
646
+ checked: "border-primary-950 bg-background"
647
+ },
648
+ disabled: {
649
+ unchecked: "border-border-400 bg-background cursor-not-allowed",
650
+ checked: "border-primary-950 bg-background cursor-not-allowed"
651
+ }
652
+ };
653
+ var DOT_CLASSES = {
654
+ default: "bg-primary-950",
655
+ hovered: "bg-info-700",
656
+ focused: "bg-primary-950",
657
+ invalid: "bg-primary-950",
658
+ disabled: "bg-primary-950"
659
+ };
660
+ var Radio = forwardRef3(
661
+ ({
662
+ label,
663
+ size = "medium",
664
+ state = "default",
665
+ errorMessage,
666
+ helperText,
667
+ className = "",
668
+ labelClassName = "",
669
+ checked: checkedProp,
670
+ defaultChecked = false,
671
+ disabled,
672
+ id,
673
+ name,
674
+ value,
675
+ onChange,
676
+ ...props
677
+ }, ref) => {
678
+ const generatedId = useId3();
679
+ const inputId = id ?? `radio-${generatedId}`;
680
+ const inputRef = useRef2(null);
681
+ const [internalChecked, setInternalChecked] = useState2(defaultChecked);
682
+ const isControlled = checkedProp !== void 0;
683
+ const checked = isControlled ? checkedProp : internalChecked;
684
+ const handleChange = (event) => {
685
+ const newChecked = event.target.checked;
686
+ if (!isControlled) {
687
+ setInternalChecked(newChecked);
688
+ }
689
+ if (event.target) {
690
+ event.target.blur();
691
+ }
692
+ onChange?.(event);
693
+ };
694
+ const currentState = disabled ? "disabled" : state;
695
+ const sizeClasses = SIZE_CLASSES4[size];
696
+ const actualRadioSize = sizeClasses.radio;
697
+ const actualDotSize = sizeClasses.dotSize;
698
+ const radioVariant = checked ? "checked" : "unchecked";
699
+ const stylingClasses = STATE_CLASSES2[currentState][radioVariant];
700
+ const getBorderWidth = () => {
701
+ if (currentState === "focused") {
702
+ return "border-2";
703
+ }
704
+ return sizeClasses.borderWidth;
705
+ };
706
+ const borderWidthClass = getBorderWidth();
707
+ const radioClasses = cn(
708
+ BASE_RADIO_CLASSES,
709
+ actualRadioSize,
710
+ borderWidthClass,
711
+ stylingClasses,
712
+ className
713
+ );
714
+ const dotClasses = cn(
715
+ actualDotSize,
716
+ "rounded-full",
717
+ DOT_CLASSES[currentState],
718
+ "transition-all duration-200"
719
+ );
720
+ const isWrapperNeeded = currentState === "focused" || currentState === "invalid";
721
+ const wrapperBorderColor = currentState === "focused" ? "border-indicator-info" : "border-indicator-error";
722
+ const getTextColor = () => {
723
+ if (currentState === "disabled") {
724
+ return checked ? "text-text-900" : "text-text-600";
725
+ }
726
+ if (currentState === "focused") {
727
+ return "text-text-900";
728
+ }
729
+ return checked ? "text-text-900" : "text-text-600";
730
+ };
731
+ const getCursorClass = () => {
732
+ return currentState === "disabled" ? "cursor-not-allowed" : "cursor-pointer";
733
+ };
734
+ return /* @__PURE__ */ jsxs4("div", { className: "flex flex-col", children: [
735
+ /* @__PURE__ */ jsxs4(
736
+ "div",
737
+ {
738
+ className: cn(
739
+ "flex flex-row items-center",
740
+ isWrapperNeeded ? cn("p-1 border-2", wrapperBorderColor, "rounded-lg gap-1.5") : sizeClasses.spacing,
741
+ disabled ? "opacity-40" : ""
742
+ ),
743
+ children: [
744
+ /* @__PURE__ */ jsx6(
745
+ "input",
746
+ {
747
+ ref: (node) => {
748
+ inputRef.current = node;
749
+ if (typeof ref === "function") ref(node);
750
+ else if (ref) ref.current = node;
751
+ },
752
+ type: "radio",
753
+ id: inputId,
754
+ checked,
755
+ disabled,
756
+ name,
757
+ value,
758
+ onChange: handleChange,
759
+ className: "sr-only",
760
+ style: {
761
+ position: "absolute",
762
+ left: "-9999px",
763
+ visibility: "hidden"
764
+ },
765
+ ...props
766
+ }
767
+ ),
768
+ /* @__PURE__ */ jsx6(
769
+ "button",
770
+ {
771
+ type: "button",
772
+ className: radioClasses,
773
+ disabled,
774
+ "aria-pressed": checked,
775
+ onClick: (e) => {
776
+ e.preventDefault();
777
+ if (!disabled) {
778
+ if (inputRef.current) {
779
+ inputRef.current.click();
780
+ inputRef.current.blur();
781
+ }
782
+ }
783
+ },
784
+ onKeyDown: (e) => {
785
+ if ((e.key === "Enter" || e.key === " ") && !disabled) {
786
+ e.preventDefault();
787
+ if (inputRef.current) {
788
+ inputRef.current.click();
789
+ inputRef.current.blur();
790
+ }
791
+ }
792
+ },
793
+ children: checked && /* @__PURE__ */ jsx6("div", { className: dotClasses })
794
+ }
795
+ ),
796
+ label && /* @__PURE__ */ jsx6(
797
+ "div",
798
+ {
799
+ className: cn(
800
+ "flex flex-row items-center",
801
+ sizeClasses.labelHeight,
802
+ "flex-1 min-w-0"
803
+ ),
804
+ children: /* @__PURE__ */ jsx6(
805
+ Text_default,
806
+ {
807
+ as: "label",
808
+ htmlFor: inputId,
809
+ size: sizeClasses.textSize,
810
+ weight: "normal",
811
+ className: cn(
812
+ getCursorClass(),
813
+ "select-none leading-normal flex items-center font-roboto truncate",
814
+ labelClassName
815
+ ),
816
+ color: getTextColor(),
817
+ children: label
818
+ }
819
+ )
820
+ }
821
+ )
822
+ ]
823
+ }
824
+ ),
825
+ errorMessage && /* @__PURE__ */ jsx6(
826
+ Text_default,
827
+ {
828
+ size: "sm",
829
+ weight: "normal",
830
+ className: "mt-1.5 truncate",
831
+ color: "text-error-600",
832
+ children: errorMessage
833
+ }
834
+ ),
835
+ helperText && !errorMessage && /* @__PURE__ */ jsx6(
836
+ Text_default,
837
+ {
838
+ size: "sm",
839
+ weight: "normal",
840
+ className: "mt-1.5 truncate",
841
+ color: "text-text-500",
842
+ children: helperText
843
+ }
844
+ )
845
+ ] });
846
+ }
847
+ );
848
+ Radio.displayName = "Radio";
849
+ var createRadioGroupStore = (name, defaultValue, disabled, onValueChange) => create2((set, get) => ({
850
+ value: defaultValue,
851
+ setValue: (value) => {
852
+ if (!get().disabled) {
853
+ set({ value });
854
+ get().onValueChange?.(value);
855
+ }
856
+ },
857
+ onValueChange,
858
+ disabled,
859
+ name
860
+ }));
861
+ var useRadioGroupStore = (externalStore) => {
862
+ if (!externalStore) {
863
+ throw new Error("RadioGroupItem must be used within a RadioGroup");
864
+ }
865
+ return externalStore;
866
+ };
867
+ var injectStore2 = (children, store) => Children2.map(children, (child) => {
868
+ if (!isValidElement2(child)) return child;
869
+ const typedChild = child;
870
+ const shouldInject = typedChild.type === RadioGroupItem;
871
+ return cloneElement2(typedChild, {
872
+ ...shouldInject ? { store } : {},
873
+ ...typedChild.props.children ? { children: injectStore2(typedChild.props.children, store) } : {}
874
+ });
875
+ });
876
+ var RadioGroup = forwardRef3(
877
+ ({
878
+ value: propValue,
879
+ defaultValue = "",
880
+ onValueChange,
881
+ name: propName,
882
+ disabled = false,
883
+ className = "",
884
+ children,
885
+ ...props
886
+ }, ref) => {
887
+ const generatedId = useId3();
888
+ const name = propName || `radio-group-${generatedId}`;
889
+ const storeRef = useRef2(null);
890
+ storeRef.current ??= createRadioGroupStore(
891
+ name,
892
+ defaultValue,
893
+ disabled,
894
+ onValueChange
895
+ );
896
+ const store = storeRef.current;
897
+ const { setValue } = useStore2(store, (s) => s);
898
+ useEffect2(() => {
899
+ const currentValue = store.getState().value;
900
+ if (currentValue && onValueChange) {
901
+ onValueChange(currentValue);
902
+ }
903
+ }, []);
904
+ useEffect2(() => {
905
+ if (propValue !== void 0) {
906
+ setValue(propValue);
907
+ }
908
+ }, [propValue, setValue]);
909
+ useEffect2(() => {
910
+ store.setState({ disabled });
911
+ }, [disabled, store]);
912
+ return /* @__PURE__ */ jsx6(
913
+ "div",
914
+ {
915
+ ref,
916
+ className,
917
+ role: "radiogroup",
918
+ "aria-label": name,
919
+ ...props,
920
+ children: injectStore2(children, store)
921
+ }
922
+ );
923
+ }
924
+ );
925
+ RadioGroup.displayName = "RadioGroup";
926
+ var RadioGroupItem = forwardRef3(
927
+ ({
928
+ value,
929
+ store: externalStore,
930
+ disabled: itemDisabled,
931
+ size = "medium",
932
+ state = "default",
933
+ className = "",
934
+ id,
935
+ ...props
936
+ }, ref) => {
937
+ const store = useRadioGroupStore(externalStore);
938
+ const {
939
+ value: groupValue,
940
+ setValue,
941
+ disabled: groupDisabled,
942
+ name
943
+ } = useStore2(store);
944
+ const generatedId = useId3();
945
+ const inputId = id ?? `radio-item-${generatedId}`;
946
+ const isChecked = groupValue === value;
947
+ const isDisabled = groupDisabled || itemDisabled;
948
+ const currentState = isDisabled ? "disabled" : state;
949
+ return /* @__PURE__ */ jsx6(
950
+ Radio,
951
+ {
952
+ ref,
953
+ id: inputId,
954
+ name,
955
+ value,
956
+ checked: isChecked,
957
+ disabled: isDisabled,
958
+ size,
959
+ state: currentState,
960
+ className,
961
+ onChange: (e) => {
962
+ if (e.target.checked && !isDisabled) {
963
+ setValue(value);
964
+ }
965
+ },
966
+ ...props
967
+ }
968
+ );
969
+ }
970
+ );
971
+ RadioGroupItem.displayName = "RadioGroupItem";
972
+
973
+ // src/components/Alternative/Alternative.tsx
974
+ import { CheckCircle, XCircle } from "phosphor-react";
975
+ import { forwardRef as forwardRef4, useId as useId4, useState as useState3 } from "react";
976
+ import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
977
+ var AlternativesList = ({
978
+ alternatives,
979
+ name,
980
+ defaultValue,
981
+ value,
982
+ onValueChange,
983
+ disabled = false,
984
+ layout = "default",
985
+ className = "",
986
+ mode = "interactive",
987
+ selectedValue
988
+ }) => {
989
+ const uniqueId = useId4();
990
+ const groupName = name || `alternatives-${uniqueId}`;
991
+ const [actualValue, setActualValue] = useState3(value);
992
+ const isReadonly = mode === "readonly";
993
+ const getStatusStyles = (status, isReadonly2) => {
994
+ const hoverClass = isReadonly2 ? "" : "hover:bg-background-50";
995
+ switch (status) {
996
+ case "correct":
997
+ return "bg-success-background border-success-300";
998
+ case "incorrect":
999
+ return "bg-error-background border-error-300";
1000
+ default:
1001
+ return `bg-background border-border-100 ${hoverClass}`;
1002
+ }
1003
+ };
1004
+ const getStatusBadge = (status) => {
1005
+ switch (status) {
1006
+ case "correct":
1007
+ return /* @__PURE__ */ jsx7(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ jsx7(CheckCircle, {}), children: "Resposta correta" });
1008
+ case "incorrect":
1009
+ return /* @__PURE__ */ jsx7(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ jsx7(XCircle, {}), children: "Resposta incorreta" });
1010
+ default:
1011
+ return null;
1012
+ }
1013
+ };
1014
+ const getLayoutClasses = () => {
1015
+ switch (layout) {
1016
+ case "compact":
1017
+ return "gap-2";
1018
+ case "detailed":
1019
+ return "gap-4";
1020
+ default:
1021
+ return "gap-3.5";
1022
+ }
1023
+ };
1024
+ const renderReadonlyAlternative = (alternative) => {
1025
+ const alternativeId = alternative.value;
1026
+ const isUserSelected = selectedValue === alternative.value;
1027
+ const isCorrectAnswer = alternative.status === "correct";
1028
+ let displayStatus = void 0;
1029
+ if (isUserSelected && !isCorrectAnswer) {
1030
+ displayStatus = "incorrect";
1031
+ } else if (isCorrectAnswer) {
1032
+ displayStatus = "correct";
1033
+ }
1034
+ const statusStyles = getStatusStyles(displayStatus, true);
1035
+ const statusBadge = getStatusBadge(displayStatus);
1036
+ const renderRadio = () => {
1037
+ const radioClasses = `w-6 h-6 rounded-full border-2 cursor-default transition-all duration-200 flex items-center justify-center ${isUserSelected ? "border-primary-950 bg-background" : "border-border-400 bg-background"}`;
1038
+ const dotClasses = "w-3 h-3 rounded-full bg-primary-950 transition-all duration-200";
1039
+ return /* @__PURE__ */ jsx7("div", { className: radioClasses, children: isUserSelected && /* @__PURE__ */ jsx7("div", { className: dotClasses }) });
1040
+ };
1041
+ if (layout === "detailed") {
1042
+ return /* @__PURE__ */ jsx7(
1043
+ "div",
1044
+ {
1045
+ className: cn(
1046
+ "border-2 rounded-lg p-4 w-full",
1047
+ statusStyles,
1048
+ alternative.disabled ? "opacity-50" : ""
1049
+ ),
1050
+ children: /* @__PURE__ */ jsxs5("div", { className: "flex items-start justify-between gap-3", children: [
1051
+ /* @__PURE__ */ jsxs5("div", { className: "flex items-start gap-3 flex-1", children: [
1052
+ /* @__PURE__ */ jsx7("div", { className: "mt-1", children: renderRadio() }),
1053
+ /* @__PURE__ */ jsxs5("div", { className: "flex-1", children: [
1054
+ /* @__PURE__ */ jsx7(
1055
+ "p",
1056
+ {
1057
+ className: cn(
1058
+ "block font-medium",
1059
+ selectedValue === alternative.value || statusBadge ? "text-text-950" : "text-text-600"
1060
+ ),
1061
+ children: alternative.label
1062
+ }
1063
+ ),
1064
+ alternative.description && /* @__PURE__ */ jsx7("p", { className: "text-sm text-text-600 mt-1", children: alternative.description })
1065
+ ] })
1066
+ ] }),
1067
+ statusBadge && /* @__PURE__ */ jsx7("div", { className: "flex-shrink-0", children: statusBadge })
1068
+ ] })
1069
+ },
1070
+ alternativeId
1071
+ );
1072
+ }
1073
+ return /* @__PURE__ */ jsxs5(
1074
+ "div",
1075
+ {
1076
+ className: cn(
1077
+ "flex flex-row justify-between items-start gap-2 p-2 rounded-lg w-full",
1078
+ statusStyles,
1079
+ alternative.disabled ? "opacity-50" : ""
1080
+ ),
1081
+ children: [
1082
+ /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 flex-1", children: [
1083
+ renderRadio(),
1084
+ /* @__PURE__ */ jsx7(
1085
+ "span",
1086
+ {
1087
+ className: cn(
1088
+ "flex-1",
1089
+ selectedValue === alternative.value || statusBadge ? "text-text-950" : "text-text-600"
1090
+ ),
1091
+ children: alternative.label
1092
+ }
1093
+ )
1094
+ ] }),
1095
+ statusBadge && /* @__PURE__ */ jsx7("div", { className: "flex-shrink-0", children: statusBadge })
1096
+ ]
1097
+ },
1098
+ alternativeId
1099
+ );
1100
+ };
1101
+ if (isReadonly) {
1102
+ return /* @__PURE__ */ jsx7(
1103
+ "div",
1104
+ {
1105
+ className: cn("flex flex-col", getLayoutClasses(), "w-full", className),
1106
+ children: alternatives.map(
1107
+ (alternative) => renderReadonlyAlternative(alternative)
1108
+ )
1109
+ }
1110
+ );
1111
+ }
1112
+ return /* @__PURE__ */ jsx7(
1113
+ RadioGroup,
1114
+ {
1115
+ name: groupName,
1116
+ defaultValue,
1117
+ value,
1118
+ onValueChange: (value2) => {
1119
+ setActualValue(value2);
1120
+ onValueChange?.(value2);
1121
+ },
1122
+ disabled,
1123
+ className: cn("flex flex-col", getLayoutClasses(), className),
1124
+ children: alternatives.map((alternative, index) => {
1125
+ const alternativeId = alternative.value || `alt-${index}`;
1126
+ const statusStyles = getStatusStyles(alternative.status, false);
1127
+ const statusBadge = getStatusBadge(alternative.status);
1128
+ if (layout === "detailed") {
1129
+ return /* @__PURE__ */ jsx7(
1130
+ "div",
1131
+ {
1132
+ className: cn(
1133
+ "border-2 rounded-lg p-4 transition-all",
1134
+ statusStyles,
1135
+ alternative.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
1136
+ ),
1137
+ children: /* @__PURE__ */ jsxs5("div", { className: "flex items-start justify-between gap-3", children: [
1138
+ /* @__PURE__ */ jsxs5("div", { className: "flex items-start gap-3 flex-1", children: [
1139
+ /* @__PURE__ */ jsx7(
1140
+ RadioGroupItem,
1141
+ {
1142
+ value: alternative.value,
1143
+ id: alternativeId,
1144
+ disabled: alternative.disabled,
1145
+ className: "mt-1"
1146
+ }
1147
+ ),
1148
+ /* @__PURE__ */ jsxs5("div", { className: "flex-1", children: [
1149
+ /* @__PURE__ */ jsx7(
1150
+ "label",
1151
+ {
1152
+ htmlFor: alternativeId,
1153
+ className: cn(
1154
+ "block font-medium",
1155
+ actualValue === alternative.value ? "text-text-950" : "text-text-600",
1156
+ alternative.disabled ? "cursor-not-allowed" : "cursor-pointer"
1157
+ ),
1158
+ children: alternative.label
1159
+ }
1160
+ ),
1161
+ alternative.description && /* @__PURE__ */ jsx7("p", { className: "text-sm text-text-600 mt-1", children: alternative.description })
1162
+ ] })
1163
+ ] }),
1164
+ statusBadge && /* @__PURE__ */ jsx7("div", { className: "flex-shrink-0", children: statusBadge })
1165
+ ] })
1166
+ },
1167
+ alternativeId
1168
+ );
1169
+ }
1170
+ return /* @__PURE__ */ jsxs5(
1171
+ "div",
1172
+ {
1173
+ className: cn(
1174
+ "flex flex-row justify-between gap-2 items-start p-2 rounded-lg transition-all",
1175
+ statusStyles,
1176
+ alternative.disabled ? "opacity-50 cursor-not-allowed" : ""
1177
+ ),
1178
+ children: [
1179
+ /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 flex-1", children: [
1180
+ /* @__PURE__ */ jsx7(
1181
+ RadioGroupItem,
1182
+ {
1183
+ value: alternative.value,
1184
+ id: alternativeId,
1185
+ disabled: alternative.disabled
1186
+ }
1187
+ ),
1188
+ /* @__PURE__ */ jsx7(
1189
+ "label",
1190
+ {
1191
+ htmlFor: alternativeId,
1192
+ className: cn(
1193
+ "flex-1",
1194
+ actualValue === alternative.value ? "text-text-950" : "text-text-600",
1195
+ alternative.disabled ? "cursor-not-allowed" : "cursor-pointer"
1196
+ ),
1197
+ children: alternative.label
1198
+ }
1199
+ )
1200
+ ] }),
1201
+ statusBadge && /* @__PURE__ */ jsx7("div", { className: "flex-shrink-0", children: statusBadge })
1202
+ ]
1203
+ },
1204
+ alternativeId
1205
+ );
1206
+ })
1207
+ }
1208
+ );
1209
+ };
1210
+ var HeaderAlternative = forwardRef4(
1211
+ ({ className, title, subTitle, content, ...props }, ref) => {
1212
+ return /* @__PURE__ */ jsxs5(
1213
+ "div",
1214
+ {
1215
+ ref,
1216
+ className: cn(
1217
+ "bg-background p-4 flex flex-col gap-4 rounded-xl",
1218
+ className
1219
+ ),
1220
+ ...props,
1221
+ children: [
1222
+ /* @__PURE__ */ jsxs5("span", { className: "flex flex-col", children: [
1223
+ /* @__PURE__ */ jsx7("p", { className: "text-text-950 font-bold text-lg", children: title }),
1224
+ /* @__PURE__ */ jsx7("p", { className: "text-text-700 text-sm ", children: subTitle })
1225
+ ] }),
1226
+ /* @__PURE__ */ jsx7("p", { className: "text-text-950 text-md", children: content })
1227
+ ]
1228
+ }
1229
+ );
1230
+ }
1231
+ );
1232
+
1233
+ // src/components/IconRender/IconRender.tsx
1234
+ import { cloneElement as cloneElement3 } from "react";
1235
+ import * as PhosphorIcons from "phosphor-react";
1236
+
1237
+ // src/assets/icons/subjects/ChatPT.tsx
1238
+ import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
1239
+ var ChatPT = ({ size, color }) => /* @__PURE__ */ jsxs6(
1240
+ "svg",
1241
+ {
1242
+ width: size,
1243
+ height: size,
1244
+ viewBox: "0 0 32 32",
1245
+ fill: "none",
1246
+ xmlns: "http://www.w3.org/2000/svg",
1247
+ children: [
1248
+ /* @__PURE__ */ jsx8(
1249
+ "path",
1250
+ {
1251
+ d: "M27 6H5.00004C4.4696 6 3.9609 6.21071 3.58582 6.58579C3.21075 6.96086 3.00004 7.46957 3.00004 8V28C2.99773 28.3814 3.10562 28.7553 3.31074 29.0768C3.51585 29.3984 3.80947 29.6538 4.15629 29.8125C4.42057 29.9356 4.7085 29.9995 5.00004 30C5.46954 29.9989 5.92347 29.8315 6.28129 29.5275L6.29254 29.5187L10.375 26H27C27.5305 26 28.0392 25.7893 28.4142 25.4142C28.7893 25.0391 29 24.5304 29 24V8C29 7.46957 28.7893 6.96086 28.4142 6.58579C28.0392 6.21071 27.5305 6 27 6ZM27 24H10C9.75992 24.0001 9.52787 24.0866 9.34629 24.2437L5.00004 28V8H27V24Z",
1252
+ fill: color
1253
+ }
1254
+ ),
1255
+ /* @__PURE__ */ jsx8(
1256
+ "path",
1257
+ {
1258
+ d: "M21.1758 12V20.5312H19.7168V12H21.1758ZM23.8535 12V13.1719H17.0625V12H23.8535Z",
1259
+ fill: color
1260
+ }
1261
+ ),
1262
+ /* @__PURE__ */ jsx8(
1263
+ "path",
1264
+ {
1265
+ d: "M13.2402 17.3496H11.0195V16.1836H13.2402C13.627 16.1836 13.9395 16.1211 14.1777 15.9961C14.416 15.8711 14.5898 15.6992 14.6992 15.4805C14.8125 15.2578 14.8691 15.0039 14.8691 14.7188C14.8691 14.4492 14.8125 14.1973 14.6992 13.9629C14.5898 13.7246 14.416 13.5332 14.1777 13.3887C13.9395 13.2441 13.627 13.1719 13.2402 13.1719H11.4707V20.5312H10V12H13.2402C13.9004 12 14.4609 12.1172 14.9219 12.3516C15.3867 12.582 15.7402 12.9023 15.9824 13.3125C16.2246 13.7188 16.3457 14.1836 16.3457 14.707C16.3457 15.2578 16.2246 15.7305 15.9824 16.125C15.7402 16.5195 15.3867 16.8223 14.9219 17.0332C14.4609 17.2441 13.9004 17.3496 13.2402 17.3496Z",
1266
+ fill: color
1267
+ }
1268
+ )
1269
+ ]
1270
+ }
1271
+ );
1272
+
1273
+ // src/assets/icons/subjects/ChatEN.tsx
1274
+ import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
1275
+ var ChatEN = ({ size, color }) => /* @__PURE__ */ jsxs7(
1276
+ "svg",
1277
+ {
1278
+ width: size,
1279
+ height: size,
1280
+ viewBox: "0 0 32 32",
1281
+ fill: "none",
1282
+ xmlns: "http://www.w3.org/2000/svg",
1283
+ children: [
1284
+ /* @__PURE__ */ jsx9(
1285
+ "path",
1286
+ {
1287
+ d: "M27 6H5.00004C4.4696 6 3.9609 6.21071 3.58582 6.58579C3.21075 6.96086 3.00004 7.46957 3.00004 8V28C2.99773 28.3814 3.10562 28.7553 3.31074 29.0768C3.51585 29.3984 3.80947 29.6538 4.15629 29.8125C4.42057 29.9356 4.7085 29.9995 5.00004 30C5.46954 29.9989 5.92347 29.8315 6.28129 29.5275L6.29254 29.5187L10.375 26H27C27.5305 26 28.0392 25.7893 28.4142 25.4142C28.7893 25.0391 29 24.5304 29 24V8C29 7.46957 28.7893 6.96086 28.4142 6.58579C28.0392 6.21071 27.5305 6 27 6ZM27 24H10C9.75992 24.0001 9.52787 24.0866 9.34629 24.2437L5.00004 28V8H27V24Z",
1288
+ fill: color
1289
+ }
1290
+ ),
1291
+ /* @__PURE__ */ jsx9(
1292
+ "path",
1293
+ {
1294
+ d: "M22.5488 12V20.5312H21.0781L17.252 14.4199V20.5312H15.7812V12H17.252L21.0898 18.123V12H22.5488Z",
1295
+ fill: color
1296
+ }
1297
+ ),
1298
+ /* @__PURE__ */ jsx9(
1299
+ "path",
1300
+ {
1301
+ d: "M14.584 19.3652V20.5312H10.0547V19.3652H14.584ZM10.4707 12V20.5312H9V12H10.4707ZM13.9922 15.5625V16.7109H10.0547V15.5625H13.9922ZM14.5547 12V13.1719H10.0547V12H14.5547Z",
1302
+ fill: color
1303
+ }
1304
+ )
1305
+ ]
1306
+ }
1307
+ );
1308
+
1309
+ // src/assets/icons/subjects/ChatES.tsx
1310
+ import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
1311
+ var ChatES = ({ size, color }) => /* @__PURE__ */ jsxs8(
1312
+ "svg",
1313
+ {
1314
+ width: size,
1315
+ height: size,
1316
+ viewBox: "0 0 32 32",
1317
+ fill: "none",
1318
+ xmlns: "http://www.w3.org/2000/svg",
1319
+ children: [
1320
+ /* @__PURE__ */ jsx10(
1321
+ "path",
1322
+ {
1323
+ d: "M27 6H5.00004C4.4696 6 3.9609 6.21071 3.58582 6.58579C3.21075 6.96086 3.00004 7.46957 3.00004 8V28C2.99773 28.3814 3.10562 28.7553 3.31074 29.0768C3.51585 29.3984 3.80947 29.6538 4.15629 29.8125C4.42057 29.9356 4.7085 29.9995 5.00004 30C5.46954 29.9989 5.92347 29.8315 6.28129 29.5275L6.29254 29.5187L10.375 26H27C27.5305 26 28.0392 25.7893 28.4142 25.4142C28.7893 25.0391 29 24.5304 29 24V8C29 7.46957 28.7893 6.96086 28.4142 6.58579C28.0392 6.21071 27.5305 6 27 6ZM27 24H10C9.75992 24.0001 9.52787 24.0866 9.34629 24.2437L5.00004 28V8H27V24Z",
1324
+ fill: color
1325
+ }
1326
+ ),
1327
+ /* @__PURE__ */ jsx10(
1328
+ "path",
1329
+ {
1330
+ d: "M21.1426 17.8027C21.1426 17.627 21.1152 17.4707 21.0605 17.334C21.0098 17.1973 20.918 17.0723 20.7852 16.959C20.6523 16.8457 20.4648 16.7363 20.2227 16.6309C19.9844 16.5215 19.6797 16.4102 19.3086 16.2969C18.9023 16.1719 18.5273 16.0332 18.1836 15.8809C17.8438 15.7246 17.5469 15.5449 17.293 15.3418C17.0391 15.1348 16.8418 14.8984 16.7012 14.6328C16.5605 14.3633 16.4902 14.0527 16.4902 13.7012C16.4902 13.3535 16.5625 13.0371 16.707 12.752C16.8555 12.4668 17.0645 12.2207 17.334 12.0137C17.6074 11.8027 17.9297 11.6406 18.3008 11.5273C18.6719 11.4102 19.082 11.3516 19.5312 11.3516C20.1641 11.3516 20.709 11.4688 21.166 11.7031C21.627 11.9375 21.9805 12.252 22.2266 12.6465C22.4766 13.041 22.6016 13.4766 22.6016 13.9531H21.1426C21.1426 13.6719 21.082 13.4238 20.9609 13.209C20.8438 12.9902 20.6641 12.8184 20.4219 12.6934C20.1836 12.5684 19.8809 12.5059 19.5137 12.5059C19.166 12.5059 18.877 12.5586 18.6465 12.6641C18.416 12.7695 18.2441 12.9121 18.1309 13.0918C18.0176 13.2715 17.9609 13.4746 17.9609 13.7012C17.9609 13.8613 17.998 14.0078 18.0723 14.1406C18.1465 14.2695 18.2598 14.3906 18.4121 14.5039C18.5645 14.6133 18.7559 14.7168 18.9863 14.8145C19.2168 14.9121 19.4883 15.0059 19.8008 15.0957C20.2734 15.2363 20.6855 15.3926 21.0371 15.5645C21.3887 15.7324 21.6816 15.9238 21.916 16.1387C22.1504 16.3535 22.3262 16.5977 22.4434 16.8711C22.5605 17.1406 22.6191 17.4473 22.6191 17.791C22.6191 18.1504 22.5469 18.4746 22.4023 18.7637C22.2578 19.0488 22.0508 19.293 21.7812 19.4961C21.5156 19.6953 21.1953 19.8496 20.8203 19.959C20.4492 20.0645 20.0352 20.1172 19.5781 20.1172C19.168 20.1172 18.7637 20.0625 18.3652 19.9531C17.9707 19.8438 17.6113 19.6777 17.2871 19.4551C16.9629 19.2285 16.7051 18.9473 16.5137 18.6113C16.3223 18.2715 16.2266 17.875 16.2266 17.4219H17.6973C17.6973 17.6992 17.7441 17.9355 17.8379 18.1309C17.9355 18.3262 18.0703 18.4863 18.2422 18.6113C18.4141 18.7324 18.6133 18.8223 18.8398 18.8809C19.0703 18.9395 19.3164 18.9688 19.5781 18.9688C19.9219 18.9688 20.209 18.9199 20.4395 18.8223C20.6738 18.7246 20.8496 18.5879 20.9668 18.4121C21.084 18.2363 21.1426 18.0332 21.1426 17.8027Z",
1331
+ fill: color
1332
+ }
1333
+ ),
1334
+ /* @__PURE__ */ jsx10(
1335
+ "path",
1336
+ {
1337
+ d: "M15.4512 18.834V20H10.9219V18.834H15.4512ZM11.3379 11.4688V20H9.86719V11.4688H11.3379ZM14.8594 15.0312V16.1797H10.9219V15.0312H14.8594ZM15.4219 11.4688V12.6406H10.9219V11.4688H15.4219Z",
1338
+ fill: color
1339
+ }
1340
+ )
1341
+ ]
1342
+ }
1343
+ );
1344
+
1345
+ // src/components/IconRender/IconRender.tsx
1346
+ import { jsx as jsx11 } from "react/jsx-runtime";
1347
+ var IconRender = ({
1348
+ iconName,
1349
+ color = "#000000",
1350
+ size = 24,
1351
+ weight = "regular"
1352
+ }) => {
1353
+ if (typeof iconName === "string") {
1354
+ switch (iconName) {
1355
+ case "Chat_PT":
1356
+ return /* @__PURE__ */ jsx11(ChatPT, { size, color });
1357
+ case "Chat_EN":
1358
+ return /* @__PURE__ */ jsx11(ChatEN, { size, color });
1359
+ case "Chat_ES":
1360
+ return /* @__PURE__ */ jsx11(ChatES, { size, color });
1361
+ default: {
1362
+ const IconComponent = PhosphorIcons[iconName] || PhosphorIcons.Question;
1363
+ return /* @__PURE__ */ jsx11(IconComponent, { size, color, weight });
1364
+ }
1365
+ }
1366
+ } else {
1367
+ return cloneElement3(iconName, {
1368
+ size,
1369
+ color: "currentColor"
1370
+ });
1371
+ }
1372
+ };
1373
+ var IconRender_default = IconRender;
1374
+
1375
+ // src/types/questionTypes.ts
1376
+ var questionTypeLabels = {
1377
+ ["ALTERNATIVA" /* ALTERNATIVA */]: "Alternativa",
1378
+ ["VERDADEIRO_FALSO" /* VERDADEIRO_FALSO */]: "Verdadeiro ou Falso",
1379
+ ["DISSERTATIVA" /* DISSERTATIVA */]: "Discursiva",
1380
+ ["IMAGEM" /* IMAGEM */]: "Imagem",
1381
+ ["MULTIPLA_ESCOLHA" /* MULTIPLA_ESCOLHA */]: "M\xFAltipla Escolha",
1382
+ ["LIGAR_PONTOS" /* LIGAR_PONTOS */]: "Ligar Pontos",
1383
+ ["PREENCHER" /* PREENCHER */]: "Preencher Lacunas"
1384
+ };
1385
+
1386
+ // src/components/MultipleChoice/MultipleChoice.tsx
1387
+ import { useEffect as useEffect3, useState as useState4 } from "react";
1388
+ import { CheckCircle as CheckCircle2, XCircle as XCircle2, Check as Check2 } from "phosphor-react";
1389
+ import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
1390
+ var MultipleChoiceList = ({
1391
+ disabled = false,
1392
+ className = "",
1393
+ choices,
1394
+ name,
1395
+ selectedValues,
1396
+ onHandleSelectedValues,
1397
+ mode = "interactive"
1398
+ }) => {
1399
+ const [actualValue, setActualValue] = useState4(selectedValues);
1400
+ useEffect3(() => {
1401
+ setActualValue(selectedValues);
1402
+ }, [selectedValues]);
1403
+ const getStatusBadge = (status) => {
1404
+ switch (status) {
1405
+ case "correct":
1406
+ return /* @__PURE__ */ jsx12(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ jsx12(CheckCircle2, {}), children: "Resposta correta" });
1407
+ case "incorrect":
1408
+ return /* @__PURE__ */ jsx12(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ jsx12(XCircle2, {}), children: "Resposta incorreta" });
1409
+ default:
1410
+ return null;
1411
+ }
1412
+ };
1413
+ const getStatusStyles = (status) => {
1414
+ switch (status) {
1415
+ case "correct":
1416
+ return "bg-success-background border-success-300";
1417
+ case "incorrect":
1418
+ return "bg-error-background border-error-300";
1419
+ default:
1420
+ return `bg-background border-border-100`;
1421
+ }
1422
+ };
1423
+ const renderVisualCheckbox = (isSelected, isDisabled) => {
1424
+ const checkboxClasses = cn(
1425
+ "w-5 h-5 rounded border-2 cursor-default transition-all duration-200 flex items-center justify-center",
1426
+ isSelected ? "border-primary-950 bg-primary-950 text-text" : "border-border-400 bg-background",
1427
+ isDisabled && "opacity-40 cursor-not-allowed"
1428
+ );
1429
+ return /* @__PURE__ */ jsx12("div", { className: checkboxClasses, children: isSelected && /* @__PURE__ */ jsx12(Check2, { size: 16, weight: "bold" }) });
1430
+ };
1431
+ if (mode === "readonly") {
1432
+ return /* @__PURE__ */ jsx12("div", { className: cn("flex flex-col gap-2", className), children: choices.map((choice, i) => {
1433
+ const isSelected = actualValue?.includes(choice.value) || false;
1434
+ const statusStyles = getStatusStyles(choice.status);
1435
+ const statusBadge = getStatusBadge(choice.status);
1436
+ return /* @__PURE__ */ jsxs9(
1437
+ "div",
1438
+ {
1439
+ className: cn(
1440
+ "flex flex-row justify-between gap-2 items-start p-2 rounded-lg transition-all",
1441
+ statusStyles,
1442
+ choice.disabled ? "opacity-50 cursor-not-allowed" : ""
1443
+ ),
1444
+ children: [
1445
+ /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2 flex-1", children: [
1446
+ renderVisualCheckbox(isSelected, choice.disabled || disabled),
1447
+ /* @__PURE__ */ jsx12(
1448
+ "span",
1449
+ {
1450
+ className: cn(
1451
+ "flex-1",
1452
+ isSelected || choice.status && choice.status != "neutral" ? "text-text-950" : "text-text-600",
1453
+ choice.disabled || disabled ? "cursor-not-allowed" : "cursor-default"
1454
+ ),
1455
+ children: choice.label
1456
+ }
1457
+ )
1458
+ ] }),
1459
+ statusBadge && /* @__PURE__ */ jsx12("div", { className: "flex-shrink-0", children: statusBadge })
1460
+ ]
1461
+ },
1462
+ `readonly-${choice.value}-${i}`
1463
+ );
1464
+ }) });
1465
+ }
1466
+ return /* @__PURE__ */ jsx12(
1467
+ "div",
1468
+ {
1469
+ className: cn(
1470
+ "flex flex-row justify-between gap-2 items-start p-2 rounded-lg transition-all",
1471
+ disabled ? "opacity-50 cursor-not-allowed" : "",
1472
+ className
1473
+ ),
1474
+ children: /* @__PURE__ */ jsx12(
1475
+ CheckboxList_default,
1476
+ {
1477
+ name,
1478
+ values: actualValue,
1479
+ onValuesChange: (v) => {
1480
+ setActualValue(v);
1481
+ onHandleSelectedValues?.(v);
1482
+ },
1483
+ disabled,
1484
+ children: choices.map((choice, i) => /* @__PURE__ */ jsxs9(
1485
+ "div",
1486
+ {
1487
+ className: "flex flex-row gap-2 items-center",
1488
+ children: [
1489
+ /* @__PURE__ */ jsx12(
1490
+ CheckboxListItem,
1491
+ {
1492
+ value: choice.value,
1493
+ id: `interactive-${choice.value}-${i}`,
1494
+ disabled: choice.disabled || disabled
1495
+ }
1496
+ ),
1497
+ /* @__PURE__ */ jsx12(
1498
+ "label",
1499
+ {
1500
+ htmlFor: `interactive-${choice.value}-${i}`,
1501
+ className: cn(
1502
+ "flex-1",
1503
+ actualValue?.includes(choice.value) ? "text-text-950" : "text-text-600",
1504
+ choice.disabled || disabled ? "cursor-not-allowed" : "cursor-pointer"
1505
+ ),
1506
+ children: choice.label
1507
+ }
1508
+ )
1509
+ ]
1510
+ },
1511
+ `interactive-${choice.value}-${i}`
1512
+ ))
1513
+ }
1514
+ )
1515
+ }
1516
+ );
1517
+ };
1518
+
1519
+ // src/components/ActivityCardQuestionBanks/ActivityCardQuestionBanks.tsx
1520
+ import { Plus, CheckCircle as CheckCircle3, XCircle as XCircle3 } from "phosphor-react";
1521
+ import { useMemo } from "react";
1522
+ import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
1523
+ var ActivityCardQuestionBanks = ({
1524
+ question,
1525
+ questionType,
1526
+ iconName = "BookOpen",
1527
+ subjectColor = "#000000",
1528
+ isDark = false,
1529
+ onAddToActivity,
1530
+ assunto,
1531
+ enunciado
1532
+ } = {}) => {
1533
+ const alternatives = useMemo(() => {
1534
+ if (!question?.options || questionType !== "ALTERNATIVA" /* ALTERNATIVA */)
1535
+ return [];
1536
+ const correctOptionIds2 = question.correctOptionIds || [];
1537
+ return question.options.map((option) => {
1538
+ const isCorrect = correctOptionIds2.includes(option.id);
1539
+ return {
1540
+ value: option.id,
1541
+ label: option.option,
1542
+ status: isCorrect ? "correct" : void 0,
1543
+ disabled: !isCorrect
1544
+ };
1545
+ });
1546
+ }, [question, questionType]);
1547
+ const correctOptionId = useMemo(() => {
1548
+ if (!question?.correctOptionIds || question.correctOptionIds.length === 0) {
1549
+ return void 0;
1550
+ }
1551
+ return question.correctOptionIds[0];
1552
+ }, [question]);
1553
+ const multipleChoices = useMemo(() => {
1554
+ if (!question?.options || questionType !== "MULTIPLA_ESCOLHA" /* MULTIPLA_ESCOLHA */)
1555
+ return [];
1556
+ const correctOptionIds2 = question.correctOptionIds || [];
1557
+ return question.options.map((option) => {
1558
+ const isCorrect = correctOptionIds2.includes(option.id);
1559
+ return {
1560
+ value: option.id,
1561
+ label: option.option,
1562
+ status: isCorrect ? "correct" : void 0,
1563
+ disabled: !isCorrect
1564
+ };
1565
+ });
1566
+ }, [question, questionType]);
1567
+ const correctOptionIds = useMemo(() => {
1568
+ return question?.correctOptionIds || [];
1569
+ }, [question]);
1570
+ const getStatusBadge = (status) => {
1571
+ switch (status) {
1572
+ case "correct":
1573
+ return /* @__PURE__ */ jsx13(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ jsx13(CheckCircle3, {}), children: "Resposta correta" });
1574
+ case "incorrect":
1575
+ return /* @__PURE__ */ jsx13(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ jsx13(XCircle3, {}), children: "Resposta incorreta" });
1576
+ }
1577
+ };
1578
+ const getStatusStyles = (status) => {
1579
+ switch (status) {
1580
+ case "correct":
1581
+ return "bg-success-background border-success-300";
1582
+ case "incorrect":
1583
+ return "bg-error-background border-error-300";
1584
+ }
1585
+ };
1586
+ const getLetterByIndex = (index) => String.fromCodePoint(97 + index);
1587
+ const renderAlternative = () => {
1588
+ if (!question || alternatives.length === 0) return null;
1589
+ return /* @__PURE__ */ jsx13("div", { className: "mt-4", children: /* @__PURE__ */ jsx13(
1590
+ AlternativesList,
1591
+ {
1592
+ alternatives,
1593
+ mode: "readonly",
1594
+ layout: "compact",
1595
+ selectedValue: correctOptionId,
1596
+ name: "teacher-question-view"
1597
+ }
1598
+ ) });
1599
+ };
1600
+ const renderMultipleChoice = () => {
1601
+ if (!question || multipleChoices.length === 0) return null;
1602
+ return /* @__PURE__ */ jsx13("div", { className: "mt-4", children: /* @__PURE__ */ jsx13(
1603
+ MultipleChoiceList,
1604
+ {
1605
+ choices: multipleChoices,
1606
+ mode: "readonly",
1607
+ selectedValues: correctOptionIds,
1608
+ name: "teacher-question-view-multiple"
1609
+ }
1610
+ ) });
1611
+ };
1612
+ const renderDissertative = () => {
1613
+ return /* @__PURE__ */ jsx13("div", { className: "mt-4 px-2 py-4", children: /* @__PURE__ */ jsx13(Text_default, { size: "sm", className: "text-text-600 italic", children: "Resposta do aluno" }) });
1614
+ };
1615
+ const renderTrueOrFalse = () => {
1616
+ if (!question || question.options.length === 0) return null;
1617
+ return /* @__PURE__ */ jsx13("div", { className: "mt-4", children: /* @__PURE__ */ jsx13("div", { className: "flex flex-col gap-3.5", children: question.options.map((option, index) => {
1618
+ const isCorrect = correctOptionIds.includes(option.id);
1619
+ const correctAnswer = isCorrect ? "Verdadeiro" : "Falso";
1620
+ const variantCorrect = "correct";
1621
+ return /* @__PURE__ */ jsx13("section", { className: "flex flex-col gap-2", children: /* @__PURE__ */ jsxs10(
1622
+ "div",
1623
+ {
1624
+ className: cn(
1625
+ "flex flex-row justify-between items-center gap-2 p-2 rounded-md border",
1626
+ getStatusStyles(variantCorrect)
1627
+ ),
1628
+ children: [
1629
+ /* @__PURE__ */ jsx13(Text_default, { size: "sm", className: "text-text-900", children: getLetterByIndex(index).concat(") ").concat(option.option) }),
1630
+ /* @__PURE__ */ jsxs10("div", { className: "flex flex-row items-center gap-2 flex-shrink-0", children: [
1631
+ /* @__PURE__ */ jsxs10(Text_default, { size: "sm", className: "text-text-700", children: [
1632
+ "Resposta correta: ",
1633
+ correctAnswer
1634
+ ] }),
1635
+ getStatusBadge(variantCorrect)
1636
+ ] })
1637
+ ]
1638
+ }
1639
+ ) }, option.id);
1640
+ }) }) });
1641
+ };
1642
+ const renderConnectDots = () => {
1643
+ return null;
1644
+ };
1645
+ const renderFill = () => {
1646
+ return null;
1647
+ };
1648
+ const renderImage = () => {
1649
+ return null;
1650
+ };
1651
+ const questionRenderers = {
1652
+ ["ALTERNATIVA" /* ALTERNATIVA */]: renderAlternative,
1653
+ ["MULTIPLA_ESCOLHA" /* MULTIPLA_ESCOLHA */]: renderMultipleChoice,
1654
+ ["DISSERTATIVA" /* DISSERTATIVA */]: renderDissertative,
1655
+ ["VERDADEIRO_FALSO" /* VERDADEIRO_FALSO */]: renderTrueOrFalse,
1656
+ ["LIGAR_PONTOS" /* LIGAR_PONTOS */]: renderConnectDots,
1657
+ ["PREENCHER" /* PREENCHER */]: renderFill,
1658
+ ["IMAGEM" /* IMAGEM */]: renderImage
1659
+ };
1660
+ const renderQuestionContent = () => {
1661
+ if (!questionType) return null;
1662
+ const renderer = questionRenderers[questionType];
1663
+ return renderer ? renderer() : null;
1664
+ };
1665
+ return /* @__PURE__ */ jsxs10("div", { className: "w-full flex flex-col gap-2 px-4 py-6", children: [
1666
+ /* @__PURE__ */ jsxs10("section", { className: "flex flex-row gap-2 text-text-650", children: [
1667
+ /* @__PURE__ */ jsxs10("div", { className: "py-1 px-2 flex flex-row items-center gap-1", children: [
1668
+ /* @__PURE__ */ jsx13(
1669
+ "span",
1670
+ {
1671
+ className: "size-4 rounded-sm flex items-center justify-center shrink-0 text-text-950",
1672
+ style: {
1673
+ backgroundColor: getSubjectColorWithOpacity(subjectColor, isDark)
1674
+ },
1675
+ children: /* @__PURE__ */ jsx13(IconRender_default, { iconName, size: 14, color: "currentColor" })
1676
+ }
1677
+ ),
1678
+ /* @__PURE__ */ jsx13(Text_default, { size: "sm", children: assunto || "Assunto n\xE3o informado" })
1679
+ ] }),
1680
+ /* @__PURE__ */ jsx13("div", { className: "py-1 px-2 flex flex-row items-center gap-1", children: /* @__PURE__ */ jsx13(Text_default, { size: "sm", className: "", children: questionType ? questionTypeLabels[questionType] : "Tipo de quest\xE3o" }) })
1681
+ ] }),
1682
+ /* @__PURE__ */ jsxs10("section", { className: "flex flex-col gap-1", children: [
1683
+ /* @__PURE__ */ jsx13(Text_default, { size: "md", weight: "medium", className: "text-text-950 text-md", children: enunciado || "Enunciado n\xE3o informado" }),
1684
+ renderQuestionContent()
1685
+ ] }),
1686
+ /* @__PURE__ */ jsx13("section", { children: /* @__PURE__ */ jsx13(
1687
+ Button_default,
1688
+ {
1689
+ size: "small",
1690
+ iconLeft: /* @__PURE__ */ jsx13(Plus, {}),
1691
+ className: "w-full",
1692
+ onClick: onAddToActivity,
1693
+ children: "Adicionar \xE0 atividade"
1694
+ }
1695
+ ) })
1696
+ ] });
1697
+ };
1698
+ export {
1699
+ ActivityCardQuestionBanks
1700
+ };
1701
+ //# sourceMappingURL=index.mjs.map