analytica-frontend-lib 1.0.44 → 1.0.46

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,1085 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/Card/Card.tsx
21
+ var Card_exports = {};
22
+ __export(Card_exports, {
23
+ CardActivesResults: () => CardActivesResults,
24
+ CardPerformance: () => CardPerformance,
25
+ CardProgress: () => CardProgress,
26
+ CardQuestions: () => CardQuestions,
27
+ CardResults: () => CardResults,
28
+ CardStatus: () => CardStatus,
29
+ CardTopic: () => CardTopic
30
+ });
31
+ module.exports = __toCommonJS(Card_exports);
32
+ var import_react = require("react");
33
+
34
+ // src/components/Button/Button.tsx
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var VARIANT_ACTION_CLASSES = {
37
+ solid: {
38
+ 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",
39
+ 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",
40
+ 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"
41
+ },
42
+ outline: {
43
+ 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",
44
+ 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",
45
+ 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"
46
+ },
47
+ link: {
48
+ 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",
49
+ 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",
50
+ 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"
51
+ }
52
+ };
53
+ var SIZE_CLASSES = {
54
+ "extra-small": "text-xs px-3.5 py-2",
55
+ small: "text-sm px-4 py-2.5",
56
+ medium: "text-md px-5 py-2.5",
57
+ large: "text-lg px-6 py-3",
58
+ "extra-large": "text-lg px-7 py-3.5"
59
+ };
60
+ var Button = ({
61
+ children,
62
+ iconLeft,
63
+ iconRight,
64
+ size = "medium",
65
+ variant = "solid",
66
+ action = "primary",
67
+ className = "",
68
+ disabled,
69
+ type = "button",
70
+ ...props
71
+ }) => {
72
+ const sizeClasses = SIZE_CLASSES[size];
73
+ const variantClasses = VARIANT_ACTION_CLASSES[variant][action];
74
+ const baseClasses = "inline-flex items-center justify-center rounded-full cursor-pointer font-medium";
75
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
76
+ "button",
77
+ {
78
+ className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
79
+ disabled,
80
+ type,
81
+ ...props,
82
+ children: [
83
+ iconLeft && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "mr-2 flex items-center", children: iconLeft }),
84
+ children,
85
+ iconRight && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "ml-2 flex items-center", children: iconRight })
86
+ ]
87
+ }
88
+ );
89
+ };
90
+ var Button_default = Button;
91
+
92
+ // src/components/Badge/Badge.tsx
93
+ var import_phosphor_react = require("phosphor-react");
94
+ var import_jsx_runtime2 = require("react/jsx-runtime");
95
+ var VARIANT_ACTION_CLASSES2 = {
96
+ solid: {
97
+ error: "bg-error text-error-700 focus-visible:outline-none",
98
+ warning: "bg-warning text-warning-800 focus-visible:outline-none",
99
+ success: "bg-success text-success-800 focus-visible:outline-none",
100
+ info: "bg-info text-info-800 focus-visible:outline-none",
101
+ muted: "bg-background-muted text-background-800 focus-visible:outline-none"
102
+ },
103
+ outlined: {
104
+ error: "bg-error text-error-700 border border-error-300 focus-visible:outline-none",
105
+ warning: "bg-warning text-warning-800 border border-warning-300 focus-visible:outline-none",
106
+ success: "bg-success text-success-800 border border-success-300 focus-visible:outline-none",
107
+ info: "bg-info text-info-800 border border-info-300 focus-visible:outline-none",
108
+ muted: "bg-background-muted text-background-800 border border-border-300 focus-visible:outline-none"
109
+ },
110
+ exams: {
111
+ exam1: "bg-exam-1 text-info-700 focus-visible:outline-none",
112
+ exam2: "bg-exam-2 text-typography-1 focus-visible:outline-none",
113
+ exam3: "bg-exam-3 text-typography-2 focus-visible:outline-none",
114
+ exam4: "bg-exam-4 text-success-700 focus-visible:outline-none"
115
+ },
116
+ resultStatus: {
117
+ negative: "bg-error text-error-800 focus-visible:outline-none",
118
+ positive: "bg-success text-success-800 focus-visible:outline-none"
119
+ },
120
+ notification: "text-primary"
121
+ };
122
+ var SIZE_CLASSES2 = {
123
+ small: "text-2xs px-2 py-1",
124
+ medium: "text-xs px-2 py-1",
125
+ large: "text-sm px-2 py-1"
126
+ };
127
+ var SIZE_CLASSES_ICON = {
128
+ small: "size-3",
129
+ medium: "size-3.5",
130
+ large: "size-4"
131
+ };
132
+ var Badge = ({
133
+ children,
134
+ iconLeft,
135
+ iconRight,
136
+ size = "medium",
137
+ variant = "solid",
138
+ action = "error",
139
+ className = "",
140
+ notificationActive = false,
141
+ ...props
142
+ }) => {
143
+ const sizeClasses = SIZE_CLASSES2[size];
144
+ const sizeClassesIcon = SIZE_CLASSES_ICON[size];
145
+ const variantActionMap = VARIANT_ACTION_CLASSES2[variant] || {};
146
+ const variantClasses = typeof variantActionMap === "string" ? variantActionMap : variantActionMap[action] ?? variantActionMap.muted ?? "";
147
+ const baseClasses = "inline-flex items-center justify-center rounded-xs font-normal gap-1 relative";
148
+ const baseClassesIcon = "flex items-center";
149
+ if (variant === "notification") {
150
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
151
+ "div",
152
+ {
153
+ className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
154
+ ...props,
155
+ children: [
156
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_phosphor_react.Bell, { size: 24, className: "text-primary-950" }),
157
+ notificationActive && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
158
+ "span",
159
+ {
160
+ "data-testid": "notification-dot",
161
+ className: "absolute top-[5px] right-[10px] block h-2 w-2 rounded-full bg-indicator-error ring-2 ring-white"
162
+ }
163
+ )
164
+ ]
165
+ }
166
+ );
167
+ }
168
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
169
+ "div",
170
+ {
171
+ className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
172
+ ...props,
173
+ children: [
174
+ iconLeft && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: `${baseClassesIcon} ${sizeClassesIcon}`, children: iconLeft }),
175
+ children,
176
+ iconRight && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: `${baseClassesIcon} ${sizeClassesIcon}`, children: iconRight })
177
+ ]
178
+ }
179
+ );
180
+ };
181
+ var Badge_default = Badge;
182
+
183
+ // src/components/Text/Text.tsx
184
+ var import_jsx_runtime3 = require("react/jsx-runtime");
185
+ var Text = ({
186
+ children,
187
+ size = "md",
188
+ weight = "normal",
189
+ color = "text-text-950",
190
+ as,
191
+ className = "",
192
+ ...props
193
+ }) => {
194
+ let sizeClasses = "";
195
+ let weightClasses = "";
196
+ const sizeClassMap = {
197
+ "2xs": "text-2xs",
198
+ xs: "text-xs",
199
+ sm: "text-sm",
200
+ md: "text-md",
201
+ lg: "text-lg",
202
+ xl: "text-xl",
203
+ "2xl": "text-2xl",
204
+ "3xl": "text-3xl",
205
+ "4xl": "text-4xl",
206
+ "5xl": "text-5xl",
207
+ "6xl": "text-6xl"
208
+ };
209
+ sizeClasses = sizeClassMap[size] ?? sizeClassMap.md;
210
+ const weightClassMap = {
211
+ hairline: "font-hairline",
212
+ light: "font-light",
213
+ normal: "font-normal",
214
+ medium: "font-medium",
215
+ semibold: "font-semibold",
216
+ bold: "font-bold",
217
+ extrabold: "font-extrabold",
218
+ black: "font-black"
219
+ };
220
+ weightClasses = weightClassMap[weight] ?? weightClassMap.normal;
221
+ const baseClasses = "font-primary";
222
+ const Component = as ?? "p";
223
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
224
+ Component,
225
+ {
226
+ className: `${baseClasses} ${sizeClasses} ${weightClasses} ${color} ${className}`,
227
+ ...props,
228
+ children
229
+ }
230
+ );
231
+ };
232
+ var Text_default = Text;
233
+
234
+ // src/components/ProgressBar/ProgressBar.tsx
235
+ var import_jsx_runtime4 = require("react/jsx-runtime");
236
+ var SIZE_CLASSES3 = {
237
+ small: {
238
+ container: "h-1",
239
+ // 4px height (h-1 = 4px in Tailwind)
240
+ bar: "h-1",
241
+ // 4px height for the fill bar
242
+ spacing: "gap-2",
243
+ // 8px gap between label and progress bar
244
+ layout: "flex-col",
245
+ // vertical layout for small
246
+ borderRadius: "rounded-full"
247
+ // 9999px border radius
248
+ },
249
+ medium: {
250
+ container: "h-2",
251
+ // 8px height (h-2 = 8px in Tailwind)
252
+ bar: "h-2",
253
+ // 8px height for the fill bar
254
+ spacing: "gap-2",
255
+ // 8px gap between progress bar and label
256
+ layout: "flex-row items-center",
257
+ // horizontal layout for medium
258
+ borderRadius: "rounded-lg"
259
+ // 8px border radius
260
+ }
261
+ };
262
+ var VARIANT_CLASSES = {
263
+ blue: {
264
+ background: "bg-background-300",
265
+ // Background track color (#D5D4D4)
266
+ fill: "bg-primary-700"
267
+ // Blue for activity progress (#2271C4)
268
+ },
269
+ green: {
270
+ background: "bg-background-300",
271
+ // Background track color (#D5D4D4)
272
+ fill: "bg-success-200"
273
+ // Green for performance (#84D3A2)
274
+ }
275
+ };
276
+ var calculateProgressValues = (value, max) => {
277
+ const safeValue = isNaN(value) ? 0 : value;
278
+ const clampedValue = Math.max(0, Math.min(safeValue, max));
279
+ const percentage = max === 0 ? 0 : clampedValue / max * 100;
280
+ return { clampedValue, percentage };
281
+ };
282
+ var shouldShowHeader = (label, showPercentage, showHitCount) => {
283
+ return !!(label || showPercentage || showHitCount);
284
+ };
285
+ var getDisplayPriority = (showHitCount, showPercentage, label, clampedValue, max, percentage) => {
286
+ if (showHitCount) {
287
+ return {
288
+ type: "hitCount",
289
+ content: `${Math.round(clampedValue)} de ${max}`,
290
+ hasMetrics: true
291
+ };
292
+ }
293
+ if (showPercentage) {
294
+ return {
295
+ type: "percentage",
296
+ content: `${Math.round(percentage)}%`,
297
+ hasMetrics: true
298
+ };
299
+ }
300
+ return {
301
+ type: "label",
302
+ content: label,
303
+ hasMetrics: false
304
+ };
305
+ };
306
+ var getCompactLayoutConfig = ({
307
+ showPercentage,
308
+ showHitCount,
309
+ percentage,
310
+ clampedValue,
311
+ max,
312
+ label,
313
+ percentageClassName,
314
+ labelClassName
315
+ }) => {
316
+ const displayPriority = getDisplayPriority(
317
+ showHitCount,
318
+ showPercentage,
319
+ label,
320
+ clampedValue,
321
+ max,
322
+ percentage
323
+ );
324
+ return {
325
+ color: displayPriority.hasMetrics ? "text-primary-600" : "text-primary-700",
326
+ className: displayPriority.hasMetrics ? percentageClassName : labelClassName,
327
+ content: displayPriority.content
328
+ };
329
+ };
330
+ var getDefaultLayoutDisplayConfig = (size, label, showPercentage) => ({
331
+ showHeader: size === "small" && !!(label || showPercentage),
332
+ showPercentage: size === "medium" && showPercentage,
333
+ showLabel: size === "medium" && !!label && !showPercentage
334
+ // Only show label when percentage is not shown
335
+ });
336
+ var renderStackedHitCountDisplay = (showHitCount, showPercentage, clampedValue, max, percentage, percentageClassName) => {
337
+ if (!showHitCount && !showPercentage) return null;
338
+ const displayPriority = getDisplayPriority(
339
+ showHitCount,
340
+ showPercentage,
341
+ null,
342
+ // label is not relevant for stacked layout metrics display
343
+ clampedValue,
344
+ max,
345
+ percentage
346
+ );
347
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
348
+ "div",
349
+ {
350
+ className: `text-xs font-medium leading-[14px] text-right ${percentageClassName}`,
351
+ children: displayPriority.type === "hitCount" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
352
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-success-200", children: Math.round(clampedValue) }),
353
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "text-text-600", children: [
354
+ " de ",
355
+ max
356
+ ] })
357
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text_default, { size: "xs", weight: "medium", className: "text-success-200", children: [
358
+ Math.round(percentage),
359
+ "%"
360
+ ] })
361
+ }
362
+ );
363
+ };
364
+ var ProgressBarBase = ({
365
+ clampedValue,
366
+ max,
367
+ percentage,
368
+ label,
369
+ variantClasses,
370
+ containerClassName,
371
+ fillClassName
372
+ }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
373
+ "div",
374
+ {
375
+ className: `${containerClassName} ${variantClasses.background} overflow-hidden relative`,
376
+ children: [
377
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
378
+ "progress",
379
+ {
380
+ value: clampedValue,
381
+ max,
382
+ "aria-label": typeof label === "string" ? `${label}: ${Math.round(percentage)}% complete` : `Progress: ${Math.round(percentage)}% of ${max}`,
383
+ className: "absolute inset-0 w-full h-full opacity-0"
384
+ }
385
+ ),
386
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
387
+ "div",
388
+ {
389
+ className: `${fillClassName} ${variantClasses.fill} transition-all duration-300 ease-out`,
390
+ style: { width: `${percentage}%` }
391
+ }
392
+ )
393
+ ]
394
+ }
395
+ );
396
+ var StackedLayout = ({
397
+ className,
398
+ label,
399
+ showPercentage,
400
+ showHitCount,
401
+ labelClassName,
402
+ percentageClassName,
403
+ clampedValue,
404
+ max,
405
+ percentage,
406
+ variantClasses,
407
+ dimensions
408
+ }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
409
+ "div",
410
+ {
411
+ className: `flex flex-col items-start gap-2 ${dimensions.width} ${dimensions.height} ${className}`,
412
+ children: [
413
+ shouldShowHeader(label, showPercentage, showHitCount) && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex flex-row justify-between items-center w-full h-[19px]", children: [
414
+ label && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
415
+ Text_default,
416
+ {
417
+ as: "div",
418
+ size: "md",
419
+ weight: "medium",
420
+ className: `text-text-600 leading-[19px] ${labelClassName}`,
421
+ children: label
422
+ }
423
+ ),
424
+ renderStackedHitCountDisplay(
425
+ showHitCount,
426
+ showPercentage,
427
+ clampedValue,
428
+ max,
429
+ percentage,
430
+ percentageClassName
431
+ )
432
+ ] }),
433
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
434
+ ProgressBarBase,
435
+ {
436
+ clampedValue,
437
+ max,
438
+ percentage,
439
+ label,
440
+ variantClasses,
441
+ containerClassName: "w-full h-2 rounded-lg",
442
+ fillClassName: "h-2 rounded-lg shadow-hard-shadow-3"
443
+ }
444
+ )
445
+ ]
446
+ }
447
+ );
448
+ var CompactLayout = ({
449
+ className,
450
+ label,
451
+ showPercentage,
452
+ showHitCount,
453
+ labelClassName,
454
+ percentageClassName,
455
+ clampedValue,
456
+ max,
457
+ percentage,
458
+ variantClasses,
459
+ dimensions
460
+ }) => {
461
+ const {
462
+ color,
463
+ className: compactClassName,
464
+ content
465
+ } = getCompactLayoutConfig({
466
+ showPercentage,
467
+ showHitCount,
468
+ percentage,
469
+ clampedValue,
470
+ max,
471
+ label,
472
+ percentageClassName,
473
+ labelClassName
474
+ });
475
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
476
+ "div",
477
+ {
478
+ className: `flex flex-col items-start gap-1 ${dimensions.width} ${dimensions.height} ${className}`,
479
+ children: [
480
+ shouldShowHeader(label, showPercentage, showHitCount) && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
481
+ Text_default,
482
+ {
483
+ as: "div",
484
+ size: "sm",
485
+ weight: "medium",
486
+ color,
487
+ className: `leading-4 w-full ${compactClassName}`,
488
+ children: content
489
+ }
490
+ ),
491
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
492
+ ProgressBarBase,
493
+ {
494
+ clampedValue,
495
+ max,
496
+ percentage,
497
+ label,
498
+ variantClasses,
499
+ containerClassName: "w-full h-1 rounded-full",
500
+ fillClassName: "h-1 rounded-full"
501
+ }
502
+ )
503
+ ]
504
+ }
505
+ );
506
+ };
507
+ var DefaultLayout = ({
508
+ className,
509
+ size,
510
+ sizeClasses,
511
+ variantClasses,
512
+ label,
513
+ showPercentage,
514
+ labelClassName,
515
+ percentageClassName,
516
+ clampedValue,
517
+ max,
518
+ percentage
519
+ }) => {
520
+ const gapClass = size === "medium" ? "gap-2" : sizeClasses.spacing;
521
+ const progressBarClass = size === "medium" ? "flex-grow" : "w-full";
522
+ const displayConfig = getDefaultLayoutDisplayConfig(
523
+ size,
524
+ label,
525
+ showPercentage
526
+ );
527
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: `flex ${sizeClasses.layout} ${gapClass} ${className}`, children: [
528
+ displayConfig.showHeader && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex flex-row items-center justify-between w-full", children: [
529
+ label && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
530
+ Text_default,
531
+ {
532
+ as: "div",
533
+ size: "xs",
534
+ weight: "medium",
535
+ className: `text-text-950 leading-none tracking-normal text-center ${labelClassName}`,
536
+ children: label
537
+ }
538
+ ),
539
+ showPercentage && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
540
+ Text_default,
541
+ {
542
+ size: "xs",
543
+ weight: "medium",
544
+ className: `text-text-950 leading-none tracking-normal text-center ${percentageClassName}`,
545
+ children: [
546
+ Math.round(percentage),
547
+ "%"
548
+ ]
549
+ }
550
+ )
551
+ ] }),
552
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
553
+ ProgressBarBase,
554
+ {
555
+ clampedValue,
556
+ max,
557
+ percentage,
558
+ label,
559
+ variantClasses,
560
+ containerClassName: `${progressBarClass} ${sizeClasses.container} ${sizeClasses.borderRadius}`,
561
+ fillClassName: `${sizeClasses.bar} ${sizeClasses.borderRadius} shadow-hard-shadow-3`
562
+ }
563
+ ),
564
+ displayConfig.showPercentage && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
565
+ Text_default,
566
+ {
567
+ size: "xs",
568
+ weight: "medium",
569
+ className: `text-text-950 leading-none tracking-normal text-center flex-none ${percentageClassName}`,
570
+ children: [
571
+ Math.round(percentage),
572
+ "%"
573
+ ]
574
+ }
575
+ ),
576
+ displayConfig.showLabel && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
577
+ Text_default,
578
+ {
579
+ as: "div",
580
+ size: "xs",
581
+ weight: "medium",
582
+ className: `text-text-950 leading-none tracking-normal text-center flex-none ${labelClassName}`,
583
+ children: label
584
+ }
585
+ )
586
+ ] });
587
+ };
588
+ var ProgressBar = ({
589
+ value,
590
+ max = 100,
591
+ size = "medium",
592
+ variant = "blue",
593
+ layout = "default",
594
+ label,
595
+ showPercentage = false,
596
+ showHitCount = false,
597
+ className = "",
598
+ labelClassName = "",
599
+ percentageClassName = "",
600
+ stackedWidth,
601
+ stackedHeight,
602
+ compactWidth,
603
+ compactHeight
604
+ }) => {
605
+ const { clampedValue, percentage } = calculateProgressValues(value, max);
606
+ const sizeClasses = SIZE_CLASSES3[size];
607
+ const variantClasses = VARIANT_CLASSES[variant];
608
+ if (layout === "stacked") {
609
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
610
+ StackedLayout,
611
+ {
612
+ className,
613
+ label,
614
+ showPercentage,
615
+ showHitCount,
616
+ labelClassName,
617
+ percentageClassName,
618
+ clampedValue,
619
+ max,
620
+ percentage,
621
+ variantClasses,
622
+ dimensions: {
623
+ width: stackedWidth ?? "w-[380px]",
624
+ height: stackedHeight ?? "h-[35px]"
625
+ }
626
+ }
627
+ );
628
+ }
629
+ if (layout === "compact") {
630
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
631
+ CompactLayout,
632
+ {
633
+ className,
634
+ label,
635
+ showPercentage,
636
+ showHitCount,
637
+ labelClassName,
638
+ percentageClassName,
639
+ clampedValue,
640
+ max,
641
+ percentage,
642
+ variantClasses,
643
+ dimensions: {
644
+ width: compactWidth ?? "w-[131px]",
645
+ height: compactHeight ?? "h-[24px]"
646
+ }
647
+ }
648
+ );
649
+ }
650
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
651
+ DefaultLayout,
652
+ {
653
+ className,
654
+ size,
655
+ sizeClasses,
656
+ variantClasses,
657
+ label,
658
+ showPercentage,
659
+ labelClassName,
660
+ percentageClassName,
661
+ clampedValue,
662
+ max,
663
+ percentage
664
+ }
665
+ );
666
+ };
667
+ var ProgressBar_default = ProgressBar;
668
+
669
+ // src/components/Card/Card.tsx
670
+ var import_phosphor_react2 = require("phosphor-react");
671
+ var import_jsx_runtime5 = require("react/jsx-runtime");
672
+ var ACTION_CARD_CLASSES = {
673
+ warning: "bg-warning-background",
674
+ success: "bg-success-300",
675
+ error: "bg-error-100",
676
+ info: "bg-info-background"
677
+ };
678
+ var ACTION_ICON_CLASSES = {
679
+ warning: "bg-warning-300 text-text",
680
+ success: "bg-yellow-300 text-text-950",
681
+ error: "bg-error-500 text-text",
682
+ info: "bg-info-500 text-text"
683
+ };
684
+ var ACTION_SUBTITLE_CLASSES = {
685
+ warning: "text-warning-600",
686
+ success: "text-success-700",
687
+ error: "text-error-700",
688
+ info: "text-info-700"
689
+ };
690
+ var ACTION_HEADER_CLASSES = {
691
+ warning: "text-warning-300",
692
+ success: "text-success-300",
693
+ error: "text-error-300",
694
+ info: "text-info-300"
695
+ };
696
+ var CardActivesResults = (0, import_react.forwardRef)(
697
+ ({
698
+ icon,
699
+ title,
700
+ subTitle,
701
+ header,
702
+ extended = false,
703
+ action = "success",
704
+ description,
705
+ className,
706
+ ...props
707
+ }, ref) => {
708
+ const actionCardClasses = ACTION_CARD_CLASSES[action];
709
+ const actionIconClasses = ACTION_ICON_CLASSES[action];
710
+ const actionSubTitleClasses = ACTION_SUBTITLE_CLASSES[action];
711
+ const actionHeaderClasses = ACTION_HEADER_CLASSES[action];
712
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
713
+ "div",
714
+ {
715
+ ref,
716
+ className: `w-full flex flex-col border border-border-50 bg-background rounded-xl ${className}`,
717
+ ...props,
718
+ children: [
719
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
720
+ "div",
721
+ {
722
+ className: `
723
+ flex flex-col gap-1 items-center justify-center p-4
724
+ ${actionCardClasses}
725
+ ${extended ? "rounded-t-xl" : "rounded-xl"}`,
726
+ children: [
727
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
728
+ "span",
729
+ {
730
+ className: `size-7.5 rounded-full flex items-center justify-center ${actionIconClasses}`,
731
+ children: icon
732
+ }
733
+ ),
734
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-text-800 font-medium uppercase text-2xs", children: title }),
735
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: `text-lg font-bold ${actionSubTitleClasses}`, children: subTitle })
736
+ ]
737
+ }
738
+ ),
739
+ extended && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-col items-center gap-2.5 pb-9.5 pt-2.5", children: [
740
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
741
+ "p",
742
+ {
743
+ className: `text-2xs font-medium uppercase ${actionHeaderClasses}`,
744
+ children: header
745
+ }
746
+ ),
747
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-sm text-info-800 text-center", children: description })
748
+ ] })
749
+ ]
750
+ }
751
+ );
752
+ }
753
+ );
754
+ var CardQuestions = (0, import_react.forwardRef)(
755
+ ({
756
+ header,
757
+ state = "undone",
758
+ className,
759
+ onClickButton,
760
+ valueButton,
761
+ ...props
762
+ }, ref) => {
763
+ const isDone = state === "done";
764
+ const stateLabel = isDone ? "Realizado" : "N\xE3o Realizado";
765
+ const buttonLabel = isDone ? "Ver Quest\xE3o" : "Responder";
766
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
767
+ "div",
768
+ {
769
+ ref,
770
+ className: `
771
+ w-full flex flex-row justify-between rounded-xl p-4 gap-4 bg-background border border-border-50
772
+ ${className}
773
+ `,
774
+ ...props,
775
+ children: [
776
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("section", { className: "flex flex-col gap-1", children: [
777
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "font-bold text-xs text-text-950", children: header }),
778
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-row gap-6 items-center", children: [
779
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
780
+ Badge_default,
781
+ {
782
+ size: "medium",
783
+ variant: "solid",
784
+ action: isDone ? "success" : "error",
785
+ children: stateLabel
786
+ }
787
+ ),
788
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "flex flex-row items-center gap-1 text-text-700 text-xs", children: [
789
+ isDone ? "Nota" : "Sem nota",
790
+ isDone && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Badge_default, { size: "medium", action: "success", children: "00" })
791
+ ] })
792
+ ] })
793
+ ] }),
794
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Button_default, { size: "extra-small", onClick: () => onClickButton?.(valueButton), children: buttonLabel })
795
+ ]
796
+ }
797
+ );
798
+ }
799
+ );
800
+ var CardProgress = (0, import_react.forwardRef)(
801
+ ({
802
+ header,
803
+ subhead,
804
+ initialDate,
805
+ endDate,
806
+ progress = 0,
807
+ direction = "horizontal",
808
+ icon,
809
+ color = "#B7DFFF",
810
+ className,
811
+ ...props
812
+ }, ref) => {
813
+ const isHorizontal = direction === "horizontal";
814
+ const contentComponent = {
815
+ horizontal: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
816
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-row gap-6 items-center", children: [
817
+ initialDate && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "flex flex-row gap-1 items-center text-2xs", children: [
818
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-text-800 font-semibold", children: "In\xEDcio" }),
819
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-text-600", children: initialDate })
820
+ ] }),
821
+ endDate && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "flex flex-row gap-1 items-center text-2xs", children: [
822
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-text-800 font-semibold", children: "Fim" }),
823
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-text-600", children: endDate })
824
+ ] })
825
+ ] }),
826
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
827
+ ProgressBar_default,
828
+ {
829
+ size: "medium",
830
+ showPercentage: true,
831
+ value: progress,
832
+ "data-testid": "progress-bar"
833
+ }
834
+ )
835
+ ] }),
836
+ vertical: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-sm text-text-800", children: subhead })
837
+ };
838
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
839
+ "div",
840
+ {
841
+ ref,
842
+ className: `
843
+ w-full flex border border-border-50 rounded-xl
844
+ ${isHorizontal ? "flex-row h-20" : "flex-col"}
845
+ ${className}
846
+ `,
847
+ ...props,
848
+ children: [
849
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
850
+ "div",
851
+ {
852
+ className: `
853
+ flex justify-center items-center [&>svg]:size-8 text-text-950
854
+ ${isHorizontal ? "w-20 h-full rounded-l-xl" : "min-h-[50px] w-full rounded-t-xl"}
855
+ `,
856
+ style: {
857
+ backgroundColor: color
858
+ },
859
+ children: icon
860
+ }
861
+ ),
862
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
863
+ "div",
864
+ {
865
+ className: `
866
+ p-4 flex flex-col justify-between w-full h-full
867
+ ${!isHorizontal && "gap-4"}
868
+ `,
869
+ children: [
870
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-xs font-bold text-text-950", children: header }),
871
+ contentComponent[direction]
872
+ ]
873
+ }
874
+ )
875
+ ]
876
+ }
877
+ );
878
+ }
879
+ );
880
+ var CardTopic = (0, import_react.forwardRef)(
881
+ ({
882
+ header,
883
+ subHead,
884
+ progress,
885
+ showPercentage = false,
886
+ className = "",
887
+ ...props
888
+ }, ref) => {
889
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
890
+ "div",
891
+ {
892
+ ref,
893
+ className: `w-full py-2 px-4 flex flex-col justify-center gap-2 border border-border-50 rounded-xl min-h-20 ${className}`,
894
+ ...props,
895
+ children: [
896
+ subHead && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "text-text-600 text-2xs flex flex-row gap-1", children: subHead.map((text, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react.Fragment, { children: [
897
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: text }),
898
+ index < subHead.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: "\u2022" })
899
+ ] }, `${text} - ${index}`)) }),
900
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-xs text-text-950 font-bold", children: header }),
901
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ProgressBar_default, { showPercentage, value: progress })
902
+ ]
903
+ }
904
+ );
905
+ }
906
+ );
907
+ var CardPerformance = (0, import_react.forwardRef)(
908
+ ({
909
+ header,
910
+ progress,
911
+ description = "Sem dados ainda! Voc\xEA ainda n\xE3o fez um question\xE1rio neste assunto.",
912
+ className = "",
913
+ onClickButton,
914
+ valueButton,
915
+ ...props
916
+ }, ref) => {
917
+ const hasProgress = progress !== void 0;
918
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
919
+ "div",
920
+ {
921
+ ref,
922
+ className: `w-full h-20.5 flex flex-row justify-between p-4 gap-2 bg-background border border-border-50 ${className}`,
923
+ ...props,
924
+ children: [
925
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "w-full flex flex-col justify-between gap-2", children: [
926
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-row justify-between items-center", children: [
927
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-md font-bold text-text-950", children: header }),
928
+ hasProgress && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
929
+ Button_default,
930
+ {
931
+ variant: "outline",
932
+ size: "extra-small",
933
+ onClick: () => onClickButton?.(valueButton),
934
+ children: "Ver Aula"
935
+ }
936
+ )
937
+ ] }),
938
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "w-full", children: hasProgress ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ProgressBar_default, { value: progress, label: `${progress}% corretas` }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-xs text-text-600", children: description }) })
939
+ ] }),
940
+ !hasProgress && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
941
+ import_phosphor_react2.CaretRight,
942
+ {
943
+ className: "size-4.5",
944
+ "data-testid": "caret-icon",
945
+ onClick: () => onClickButton?.(valueButton)
946
+ }
947
+ )
948
+ ]
949
+ }
950
+ );
951
+ }
952
+ );
953
+ var CardResults = (0, import_react.forwardRef)(
954
+ ({
955
+ header,
956
+ correct_answers,
957
+ incorrect_answers,
958
+ icon,
959
+ direction = "col",
960
+ color = "#B7DFFF",
961
+ className,
962
+ ...props
963
+ }, ref) => {
964
+ const isRow = direction == "row";
965
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
966
+ "div",
967
+ {
968
+ ref,
969
+ className: `
970
+ w-full flex border border-border-50 rounded-xl min-h-20 flex-row items-center pr-4
971
+ ${className}
972
+ `,
973
+ ...props,
974
+ children: [
975
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
976
+ "div",
977
+ {
978
+ className: `
979
+ flex justify-center items-center [&>svg]:size-8 text-text-950 min-w-20 max-w-20 h-full rounded-l-xl
980
+ `,
981
+ style: {
982
+ backgroundColor: color
983
+ },
984
+ children: icon
985
+ }
986
+ ),
987
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
988
+ "div",
989
+ {
990
+ className: `
991
+ p-4 flex justify-between w-full h-full
992
+ ${isRow ? "flex-row items-center" : "flex-col"}
993
+ `,
994
+ children: [
995
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-xs font-bold text-text-950", children: header }),
996
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "flex flex-row gap-1 items-center", children: [
997
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
998
+ Badge_default,
999
+ {
1000
+ action: "success",
1001
+ variant: "solid",
1002
+ size: "medium",
1003
+ iconLeft: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react2.CheckCircle, {}),
1004
+ children: [
1005
+ correct_answers,
1006
+ " Corretas"
1007
+ ]
1008
+ }
1009
+ ),
1010
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1011
+ Badge_default,
1012
+ {
1013
+ action: "error",
1014
+ variant: "solid",
1015
+ size: "medium",
1016
+ iconLeft: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react2.XCircle, {}),
1017
+ children: [
1018
+ incorrect_answers,
1019
+ " Incorretas"
1020
+ ]
1021
+ }
1022
+ )
1023
+ ] })
1024
+ ]
1025
+ }
1026
+ ),
1027
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react2.CaretRight, { className: "min-w-6 min-h-6" })
1028
+ ]
1029
+ }
1030
+ );
1031
+ }
1032
+ );
1033
+ var CardStatus = (0, import_react.forwardRef)(
1034
+ ({ header, className, status, ...props }, ref) => {
1035
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1036
+ "div",
1037
+ {
1038
+ ref,
1039
+ className: `
1040
+ w-full flex border border-border-50 rounded-xl min-h-20 flex-row items-center pr-4
1041
+ ${className}
1042
+ `,
1043
+ ...props,
1044
+ children: [
1045
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1046
+ "div",
1047
+ {
1048
+ className: `
1049
+ p-4 flex justify-between w-full h-full flex-row items-center
1050
+ `,
1051
+ children: [
1052
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-xs font-bold text-text-950", children: header }),
1053
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "flex flex-row gap-1 items-center", children: [
1054
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1055
+ Badge_default,
1056
+ {
1057
+ action: status == "correct" ? "success" : "error",
1058
+ variant: "solid",
1059
+ size: "medium",
1060
+ iconLeft: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react2.CheckCircle, {}),
1061
+ children: status == "correct" ? "Correta" : "Incorreta"
1062
+ }
1063
+ ),
1064
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-sm text-text-800", children: "Respondida" })
1065
+ ] })
1066
+ ]
1067
+ }
1068
+ ),
1069
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react2.CaretRight, { className: "min-w-6 min-h-6" })
1070
+ ]
1071
+ }
1072
+ );
1073
+ }
1074
+ );
1075
+ // Annotate the CommonJS export names for ESM import in node:
1076
+ 0 && (module.exports = {
1077
+ CardActivesResults,
1078
+ CardPerformance,
1079
+ CardProgress,
1080
+ CardQuestions,
1081
+ CardResults,
1082
+ CardStatus,
1083
+ CardTopic
1084
+ });
1085
+ //# sourceMappingURL=index.js.map