analytica-frontend-lib 1.0.70 → 1.0.71

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.
Files changed (47) hide show
  1. package/dist/Accordation/index.d.mts +12 -0
  2. package/dist/Accordation/index.d.ts +12 -0
  3. package/dist/Accordation/index.js +1663 -0
  4. package/dist/Accordation/index.js.map +1 -0
  5. package/dist/Accordation/index.mjs +1654 -0
  6. package/dist/Accordation/index.mjs.map +1 -0
  7. package/dist/AlertDialog/index.d.mts +40 -0
  8. package/dist/AlertDialog/index.d.ts +40 -0
  9. package/dist/AlertDialog/index.js +233 -0
  10. package/dist/AlertDialog/index.js.map +1 -0
  11. package/dist/AlertDialog/index.mjs +212 -0
  12. package/dist/AlertDialog/index.mjs.map +1 -0
  13. package/dist/Alternative/index.d.mts +81 -0
  14. package/dist/Alternative/index.d.ts +81 -0
  15. package/dist/Alternative/index.js +745 -0
  16. package/dist/Alternative/index.js.map +1 -0
  17. package/dist/Alternative/index.mjs +728 -0
  18. package/dist/Alternative/index.mjs.map +1 -0
  19. package/dist/Badge/index.js +1 -1
  20. package/dist/Badge/index.js.map +1 -1
  21. package/dist/Badge/index.mjs +1 -1
  22. package/dist/Badge/index.mjs.map +1 -1
  23. package/dist/Card/index.js +1 -1
  24. package/dist/Card/index.js.map +1 -1
  25. package/dist/Card/index.mjs +1 -1
  26. package/dist/Card/index.mjs.map +1 -1
  27. package/dist/Radio/index.d.mts +120 -2
  28. package/dist/Radio/index.d.ts +120 -2
  29. package/dist/Radio/index.js +176 -3
  30. package/dist/Radio/index.js.map +1 -1
  31. package/dist/Radio/index.mjs +176 -4
  32. package/dist/Radio/index.mjs.map +1 -1
  33. package/dist/Skeleton/index.d.mts +10 -9
  34. package/dist/Skeleton/index.d.ts +10 -9
  35. package/dist/Skeleton/index.js.map +1 -1
  36. package/dist/Skeleton/index.mjs.map +1 -1
  37. package/dist/index.css +174 -0
  38. package/dist/index.css.map +1 -1
  39. package/dist/index.d.mts +4 -1
  40. package/dist/index.d.ts +4 -1
  41. package/dist/index.js +2383 -1778
  42. package/dist/index.js.map +1 -1
  43. package/dist/index.mjs +2441 -1832
  44. package/dist/index.mjs.map +1 -1
  45. package/dist/styles.css +174 -0
  46. package/dist/styles.css.map +1 -1
  47. package/package.json +4 -1
@@ -0,0 +1,1663 @@
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/Accordation/Accordation.tsx
21
+ var Accordation_exports = {};
22
+ __export(Accordation_exports, {
23
+ CardAccordation: () => CardAccordation
24
+ });
25
+ module.exports = __toCommonJS(Accordation_exports);
26
+ var import_react2 = require("react");
27
+
28
+ // src/components/Card/Card.tsx
29
+ var import_react = require("react");
30
+
31
+ // src/components/Button/Button.tsx
32
+ var import_jsx_runtime = require("react/jsx-runtime");
33
+ var VARIANT_ACTION_CLASSES = {
34
+ solid: {
35
+ 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",
36
+ 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",
37
+ 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"
38
+ },
39
+ outline: {
40
+ 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",
41
+ 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",
42
+ 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"
43
+ },
44
+ link: {
45
+ 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",
46
+ 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",
47
+ 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"
48
+ }
49
+ };
50
+ var SIZE_CLASSES = {
51
+ "extra-small": "text-xs px-3.5 py-2",
52
+ small: "text-sm px-4 py-2.5",
53
+ medium: "text-md px-5 py-2.5",
54
+ large: "text-lg px-6 py-3",
55
+ "extra-large": "text-lg px-7 py-3.5"
56
+ };
57
+ var Button = ({
58
+ children,
59
+ iconLeft,
60
+ iconRight,
61
+ size = "medium",
62
+ variant = "solid",
63
+ action = "primary",
64
+ className = "",
65
+ disabled,
66
+ type = "button",
67
+ ...props
68
+ }) => {
69
+ const sizeClasses = SIZE_CLASSES[size];
70
+ const variantClasses = VARIANT_ACTION_CLASSES[variant][action];
71
+ const baseClasses = "inline-flex items-center justify-center rounded-full cursor-pointer font-medium";
72
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
73
+ "button",
74
+ {
75
+ className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
76
+ disabled,
77
+ type,
78
+ ...props,
79
+ children: [
80
+ iconLeft && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "mr-2 flex items-center", children: iconLeft }),
81
+ children,
82
+ iconRight && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "ml-2 flex items-center", children: iconRight })
83
+ ]
84
+ }
85
+ );
86
+ };
87
+ var Button_default = Button;
88
+
89
+ // src/components/Badge/Badge.tsx
90
+ var import_phosphor_react = require("phosphor-react");
91
+ var import_jsx_runtime2 = require("react/jsx-runtime");
92
+ var VARIANT_ACTION_CLASSES2 = {
93
+ solid: {
94
+ error: "bg-error-background text-error-700 focus-visible:outline-none",
95
+ warning: "bg-warning text-warning-800 focus-visible:outline-none",
96
+ success: "bg-success text-success-800 focus-visible:outline-none",
97
+ info: "bg-info text-info-800 focus-visible:outline-none",
98
+ muted: "bg-background-muted text-background-800 focus-visible:outline-none"
99
+ },
100
+ outlined: {
101
+ error: "bg-error text-error-700 border border-error-300 focus-visible:outline-none",
102
+ warning: "bg-warning text-warning-800 border border-warning-300 focus-visible:outline-none",
103
+ success: "bg-success text-success-800 border border-success-300 focus-visible:outline-none",
104
+ info: "bg-info text-info-800 border border-info-300 focus-visible:outline-none",
105
+ muted: "bg-background-muted text-background-800 border border-border-300 focus-visible:outline-none"
106
+ },
107
+ exams: {
108
+ exam1: "bg-exam-1 text-info-700 focus-visible:outline-none",
109
+ exam2: "bg-exam-2 text-typography-1 focus-visible:outline-none",
110
+ exam3: "bg-exam-3 text-typography-2 focus-visible:outline-none",
111
+ exam4: "bg-exam-4 text-success-700 focus-visible:outline-none"
112
+ },
113
+ resultStatus: {
114
+ negative: "bg-error text-error-800 focus-visible:outline-none",
115
+ positive: "bg-success text-success-800 focus-visible:outline-none"
116
+ },
117
+ notification: "text-primary"
118
+ };
119
+ var SIZE_CLASSES2 = {
120
+ small: "text-2xs px-2 py-1",
121
+ medium: "text-xs px-2 py-1",
122
+ large: "text-sm px-2 py-1"
123
+ };
124
+ var SIZE_CLASSES_ICON = {
125
+ small: "size-3",
126
+ medium: "size-3.5",
127
+ large: "size-4"
128
+ };
129
+ var Badge = ({
130
+ children,
131
+ iconLeft,
132
+ iconRight,
133
+ size = "medium",
134
+ variant = "solid",
135
+ action = "error",
136
+ className = "",
137
+ notificationActive = false,
138
+ ...props
139
+ }) => {
140
+ const sizeClasses = SIZE_CLASSES2[size];
141
+ const sizeClassesIcon = SIZE_CLASSES_ICON[size];
142
+ const variantActionMap = VARIANT_ACTION_CLASSES2[variant] || {};
143
+ const variantClasses = typeof variantActionMap === "string" ? variantActionMap : variantActionMap[action] ?? variantActionMap.muted ?? "";
144
+ const baseClasses = "inline-flex items-center justify-center rounded-xs font-normal gap-1 relative";
145
+ const baseClassesIcon = "flex items-center";
146
+ if (variant === "notification") {
147
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
148
+ "div",
149
+ {
150
+ className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
151
+ ...props,
152
+ children: [
153
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_phosphor_react.Bell, { size: 24, className: "text-current", "aria-hidden": "true" }),
154
+ notificationActive && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
155
+ "span",
156
+ {
157
+ "data-testid": "notification-dot",
158
+ className: "absolute top-[5px] right-[10px] block h-2 w-2 rounded-full bg-indicator-error ring-2 ring-white"
159
+ }
160
+ )
161
+ ]
162
+ }
163
+ );
164
+ }
165
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
166
+ "div",
167
+ {
168
+ className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
169
+ ...props,
170
+ children: [
171
+ iconLeft && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: `${baseClassesIcon} ${sizeClassesIcon}`, children: iconLeft }),
172
+ children,
173
+ iconRight && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: `${baseClassesIcon} ${sizeClassesIcon}`, children: iconRight })
174
+ ]
175
+ }
176
+ );
177
+ };
178
+ var Badge_default = Badge;
179
+
180
+ // src/components/Text/Text.tsx
181
+ var import_jsx_runtime3 = require("react/jsx-runtime");
182
+ var Text = ({
183
+ children,
184
+ size = "md",
185
+ weight = "normal",
186
+ color = "text-text-950",
187
+ as,
188
+ className = "",
189
+ ...props
190
+ }) => {
191
+ let sizeClasses = "";
192
+ let weightClasses = "";
193
+ const sizeClassMap = {
194
+ "2xs": "text-2xs",
195
+ xs: "text-xs",
196
+ sm: "text-sm",
197
+ md: "text-md",
198
+ lg: "text-lg",
199
+ xl: "text-xl",
200
+ "2xl": "text-2xl",
201
+ "3xl": "text-3xl",
202
+ "4xl": "text-4xl",
203
+ "5xl": "text-5xl",
204
+ "6xl": "text-6xl"
205
+ };
206
+ sizeClasses = sizeClassMap[size] ?? sizeClassMap.md;
207
+ const weightClassMap = {
208
+ hairline: "font-hairline",
209
+ light: "font-light",
210
+ normal: "font-normal",
211
+ medium: "font-medium",
212
+ semibold: "font-semibold",
213
+ bold: "font-bold",
214
+ extrabold: "font-extrabold",
215
+ black: "font-black"
216
+ };
217
+ weightClasses = weightClassMap[weight] ?? weightClassMap.normal;
218
+ const baseClasses = "font-primary";
219
+ const Component = as ?? "p";
220
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
221
+ Component,
222
+ {
223
+ className: `${baseClasses} ${sizeClasses} ${weightClasses} ${color} ${className}`,
224
+ ...props,
225
+ children
226
+ }
227
+ );
228
+ };
229
+ var Text_default = Text;
230
+
231
+ // src/components/ProgressBar/ProgressBar.tsx
232
+ var import_jsx_runtime4 = require("react/jsx-runtime");
233
+ var SIZE_CLASSES3 = {
234
+ small: {
235
+ container: "h-1",
236
+ // 4px height (h-1 = 4px in Tailwind)
237
+ bar: "h-1",
238
+ // 4px height for the fill bar
239
+ spacing: "gap-2",
240
+ // 8px gap between label and progress bar
241
+ layout: "flex-col",
242
+ // vertical layout for small
243
+ borderRadius: "rounded-full"
244
+ // 9999px border radius
245
+ },
246
+ medium: {
247
+ container: "h-2",
248
+ // 8px height (h-2 = 8px in Tailwind)
249
+ bar: "h-2",
250
+ // 8px height for the fill bar
251
+ spacing: "gap-2",
252
+ // 8px gap between progress bar and label
253
+ layout: "flex-row items-center",
254
+ // horizontal layout for medium
255
+ borderRadius: "rounded-lg"
256
+ // 8px border radius
257
+ }
258
+ };
259
+ var VARIANT_CLASSES = {
260
+ blue: {
261
+ background: "bg-background-300",
262
+ // Background track color (#D5D4D4)
263
+ fill: "bg-primary-700"
264
+ // Blue for activity progress (#2271C4)
265
+ },
266
+ green: {
267
+ background: "bg-background-300",
268
+ // Background track color (#D5D4D4)
269
+ fill: "bg-success-200"
270
+ // Green for performance (#84D3A2)
271
+ }
272
+ };
273
+ var calculateProgressValues = (value, max) => {
274
+ const safeValue = isNaN(value) ? 0 : value;
275
+ const clampedValue = Math.max(0, Math.min(safeValue, max));
276
+ const percentage = max === 0 ? 0 : clampedValue / max * 100;
277
+ return { clampedValue, percentage };
278
+ };
279
+ var shouldShowHeader = (label, showPercentage, showHitCount) => {
280
+ return !!(label || showPercentage || showHitCount);
281
+ };
282
+ var getDisplayPriority = (showHitCount, showPercentage, label, clampedValue, max, percentage) => {
283
+ if (showHitCount) {
284
+ return {
285
+ type: "hitCount",
286
+ content: `${Math.round(clampedValue)} de ${max}`,
287
+ hasMetrics: true
288
+ };
289
+ }
290
+ if (showPercentage) {
291
+ return {
292
+ type: "percentage",
293
+ content: `${Math.round(percentage)}%`,
294
+ hasMetrics: true
295
+ };
296
+ }
297
+ return {
298
+ type: "label",
299
+ content: label,
300
+ hasMetrics: false
301
+ };
302
+ };
303
+ var getCompactLayoutConfig = ({
304
+ showPercentage,
305
+ showHitCount,
306
+ percentage,
307
+ clampedValue,
308
+ max,
309
+ label,
310
+ percentageClassName,
311
+ labelClassName
312
+ }) => {
313
+ const displayPriority = getDisplayPriority(
314
+ showHitCount,
315
+ showPercentage,
316
+ label,
317
+ clampedValue,
318
+ max,
319
+ percentage
320
+ );
321
+ return {
322
+ color: displayPriority.hasMetrics ? "text-primary-600" : "text-primary-700",
323
+ className: displayPriority.hasMetrics ? percentageClassName : labelClassName,
324
+ content: displayPriority.content
325
+ };
326
+ };
327
+ var getDefaultLayoutDisplayConfig = (size, label, showPercentage) => ({
328
+ showHeader: size === "small" && !!(label || showPercentage),
329
+ showPercentage: size === "medium" && showPercentage,
330
+ showLabel: size === "medium" && !!label && !showPercentage
331
+ // Only show label when percentage is not shown
332
+ });
333
+ var renderStackedHitCountDisplay = (showHitCount, showPercentage, clampedValue, max, percentage, percentageClassName) => {
334
+ if (!showHitCount && !showPercentage) return null;
335
+ const displayPriority = getDisplayPriority(
336
+ showHitCount,
337
+ showPercentage,
338
+ null,
339
+ // label is not relevant for stacked layout metrics display
340
+ clampedValue,
341
+ max,
342
+ percentage
343
+ );
344
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
345
+ "div",
346
+ {
347
+ className: `text-xs font-medium leading-[14px] text-right ${percentageClassName}`,
348
+ children: displayPriority.type === "hitCount" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
349
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-success-200", children: Math.round(clampedValue) }),
350
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "text-text-600", children: [
351
+ " de ",
352
+ max
353
+ ] })
354
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text_default, { size: "xs", weight: "medium", className: "text-success-200", children: [
355
+ Math.round(percentage),
356
+ "%"
357
+ ] })
358
+ }
359
+ );
360
+ };
361
+ var ProgressBarBase = ({
362
+ clampedValue,
363
+ max,
364
+ percentage,
365
+ label,
366
+ variantClasses,
367
+ containerClassName,
368
+ fillClassName
369
+ }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
370
+ "div",
371
+ {
372
+ className: `${containerClassName} ${variantClasses.background} overflow-hidden relative`,
373
+ children: [
374
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
375
+ "progress",
376
+ {
377
+ value: clampedValue,
378
+ max,
379
+ "aria-label": typeof label === "string" ? `${label}: ${Math.round(percentage)}% complete` : `Progress: ${Math.round(percentage)}% of ${max}`,
380
+ className: "absolute inset-0 w-full h-full opacity-0"
381
+ }
382
+ ),
383
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
384
+ "div",
385
+ {
386
+ className: `${fillClassName} ${variantClasses.fill} transition-all duration-300 ease-out`,
387
+ style: { width: `${percentage}%` }
388
+ }
389
+ )
390
+ ]
391
+ }
392
+ );
393
+ var StackedLayout = ({
394
+ className,
395
+ label,
396
+ showPercentage,
397
+ showHitCount,
398
+ labelClassName,
399
+ percentageClassName,
400
+ clampedValue,
401
+ max,
402
+ percentage,
403
+ variantClasses,
404
+ dimensions
405
+ }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
406
+ "div",
407
+ {
408
+ className: `flex flex-col items-start gap-2 ${dimensions.width} ${dimensions.height} ${className}`,
409
+ children: [
410
+ shouldShowHeader(label, showPercentage, showHitCount) && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex flex-row justify-between items-center w-full h-[19px]", children: [
411
+ label && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
412
+ Text_default,
413
+ {
414
+ as: "div",
415
+ size: "md",
416
+ weight: "medium",
417
+ className: `text-text-600 leading-[19px] ${labelClassName}`,
418
+ children: label
419
+ }
420
+ ),
421
+ renderStackedHitCountDisplay(
422
+ showHitCount,
423
+ showPercentage,
424
+ clampedValue,
425
+ max,
426
+ percentage,
427
+ percentageClassName
428
+ )
429
+ ] }),
430
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
431
+ ProgressBarBase,
432
+ {
433
+ clampedValue,
434
+ max,
435
+ percentage,
436
+ label,
437
+ variantClasses,
438
+ containerClassName: "w-full h-2 rounded-lg",
439
+ fillClassName: "h-2 rounded-lg shadow-hard-shadow-3"
440
+ }
441
+ )
442
+ ]
443
+ }
444
+ );
445
+ var CompactLayout = ({
446
+ className,
447
+ label,
448
+ showPercentage,
449
+ showHitCount,
450
+ labelClassName,
451
+ percentageClassName,
452
+ clampedValue,
453
+ max,
454
+ percentage,
455
+ variantClasses,
456
+ dimensions
457
+ }) => {
458
+ const {
459
+ color,
460
+ className: compactClassName,
461
+ content
462
+ } = getCompactLayoutConfig({
463
+ showPercentage,
464
+ showHitCount,
465
+ percentage,
466
+ clampedValue,
467
+ max,
468
+ label,
469
+ percentageClassName,
470
+ labelClassName
471
+ });
472
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
473
+ "div",
474
+ {
475
+ className: `flex flex-col items-start gap-1 ${dimensions.width} ${dimensions.height} ${className}`,
476
+ children: [
477
+ shouldShowHeader(label, showPercentage, showHitCount) && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
478
+ Text_default,
479
+ {
480
+ as: "div",
481
+ size: "sm",
482
+ weight: "medium",
483
+ color,
484
+ className: `leading-4 w-full ${compactClassName}`,
485
+ children: content
486
+ }
487
+ ),
488
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
489
+ ProgressBarBase,
490
+ {
491
+ clampedValue,
492
+ max,
493
+ percentage,
494
+ label,
495
+ variantClasses,
496
+ containerClassName: "w-full h-1 rounded-full",
497
+ fillClassName: "h-1 rounded-full"
498
+ }
499
+ )
500
+ ]
501
+ }
502
+ );
503
+ };
504
+ var DefaultLayout = ({
505
+ className,
506
+ size,
507
+ sizeClasses,
508
+ variantClasses,
509
+ label,
510
+ showPercentage,
511
+ labelClassName,
512
+ percentageClassName,
513
+ clampedValue,
514
+ max,
515
+ percentage
516
+ }) => {
517
+ const gapClass = size === "medium" ? "gap-2" : sizeClasses.spacing;
518
+ const progressBarClass = size === "medium" ? "flex-grow" : "w-full";
519
+ const displayConfig = getDefaultLayoutDisplayConfig(
520
+ size,
521
+ label,
522
+ showPercentage
523
+ );
524
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: `flex ${sizeClasses.layout} ${gapClass} ${className}`, children: [
525
+ displayConfig.showHeader && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex flex-row items-center justify-between w-full", children: [
526
+ label && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
527
+ Text_default,
528
+ {
529
+ as: "div",
530
+ size: "xs",
531
+ weight: "medium",
532
+ className: `text-text-950 leading-none tracking-normal text-center ${labelClassName}`,
533
+ children: label
534
+ }
535
+ ),
536
+ showPercentage && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
537
+ Text_default,
538
+ {
539
+ size: "xs",
540
+ weight: "medium",
541
+ className: `text-text-950 leading-none tracking-normal text-center ${percentageClassName}`,
542
+ children: [
543
+ Math.round(percentage),
544
+ "%"
545
+ ]
546
+ }
547
+ )
548
+ ] }),
549
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
550
+ ProgressBarBase,
551
+ {
552
+ clampedValue,
553
+ max,
554
+ percentage,
555
+ label,
556
+ variantClasses,
557
+ containerClassName: `${progressBarClass} ${sizeClasses.container} ${sizeClasses.borderRadius}`,
558
+ fillClassName: `${sizeClasses.bar} ${sizeClasses.borderRadius} shadow-hard-shadow-3`
559
+ }
560
+ ),
561
+ displayConfig.showPercentage && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
562
+ Text_default,
563
+ {
564
+ size: "xs",
565
+ weight: "medium",
566
+ className: `text-text-950 leading-none tracking-normal text-center flex-none ${percentageClassName}`,
567
+ children: [
568
+ Math.round(percentage),
569
+ "%"
570
+ ]
571
+ }
572
+ ),
573
+ displayConfig.showLabel && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
574
+ Text_default,
575
+ {
576
+ as: "div",
577
+ size: "xs",
578
+ weight: "medium",
579
+ className: `text-text-950 leading-none tracking-normal text-center flex-none ${labelClassName}`,
580
+ children: label
581
+ }
582
+ )
583
+ ] });
584
+ };
585
+ var ProgressBar = ({
586
+ value,
587
+ max = 100,
588
+ size = "medium",
589
+ variant = "blue",
590
+ layout = "default",
591
+ label,
592
+ showPercentage = false,
593
+ showHitCount = false,
594
+ className = "",
595
+ labelClassName = "",
596
+ percentageClassName = "",
597
+ stackedWidth,
598
+ stackedHeight,
599
+ compactWidth,
600
+ compactHeight
601
+ }) => {
602
+ const { clampedValue, percentage } = calculateProgressValues(value, max);
603
+ const sizeClasses = SIZE_CLASSES3[size];
604
+ const variantClasses = VARIANT_CLASSES[variant];
605
+ if (layout === "stacked") {
606
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
607
+ StackedLayout,
608
+ {
609
+ className,
610
+ label,
611
+ showPercentage,
612
+ showHitCount,
613
+ labelClassName,
614
+ percentageClassName,
615
+ clampedValue,
616
+ max,
617
+ percentage,
618
+ variantClasses,
619
+ dimensions: {
620
+ width: stackedWidth ?? "w-[380px]",
621
+ height: stackedHeight ?? "h-[35px]"
622
+ }
623
+ }
624
+ );
625
+ }
626
+ if (layout === "compact") {
627
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
628
+ CompactLayout,
629
+ {
630
+ className,
631
+ label,
632
+ showPercentage,
633
+ showHitCount,
634
+ labelClassName,
635
+ percentageClassName,
636
+ clampedValue,
637
+ max,
638
+ percentage,
639
+ variantClasses,
640
+ dimensions: {
641
+ width: compactWidth ?? "w-[131px]",
642
+ height: compactHeight ?? "h-[24px]"
643
+ }
644
+ }
645
+ );
646
+ }
647
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
648
+ DefaultLayout,
649
+ {
650
+ className,
651
+ size,
652
+ sizeClasses,
653
+ variantClasses,
654
+ label,
655
+ showPercentage,
656
+ labelClassName,
657
+ percentageClassName,
658
+ clampedValue,
659
+ max,
660
+ percentage
661
+ }
662
+ );
663
+ };
664
+ var ProgressBar_default = ProgressBar;
665
+
666
+ // src/components/Card/Card.tsx
667
+ var import_phosphor_react2 = require("phosphor-react");
668
+ var import_jsx_runtime5 = require("react/jsx-runtime");
669
+ var CARD_BASE_CLASSES = {
670
+ default: "w-full bg-background border border-border-50 rounded-xl",
671
+ compact: "w-full bg-background border border-border-50 rounded-lg",
672
+ minimal: "w-full bg-background border border-border-100 rounded-md"
673
+ };
674
+ var CARD_PADDING_CLASSES = {
675
+ none: "",
676
+ small: "p-2",
677
+ medium: "p-4",
678
+ large: "p-6"
679
+ };
680
+ var CARD_MIN_HEIGHT_CLASSES = {
681
+ none: "",
682
+ small: "min-h-16",
683
+ medium: "min-h-20",
684
+ large: "min-h-24"
685
+ };
686
+ var CARD_LAYOUT_CLASSES = {
687
+ horizontal: "flex flex-row",
688
+ vertical: "flex flex-col"
689
+ };
690
+ var CARD_CURSOR_CLASSES = {
691
+ default: "",
692
+ pointer: "cursor-pointer"
693
+ };
694
+ var CardBase = (0, import_react.forwardRef)(
695
+ ({
696
+ children,
697
+ variant = "default",
698
+ layout = "horizontal",
699
+ padding = "medium",
700
+ minHeight = "medium",
701
+ cursor = "default",
702
+ className = "",
703
+ ...props
704
+ }, ref) => {
705
+ const baseClasses = CARD_BASE_CLASSES[variant];
706
+ const paddingClasses = CARD_PADDING_CLASSES[padding];
707
+ const minHeightClasses = CARD_MIN_HEIGHT_CLASSES[minHeight];
708
+ const layoutClasses = CARD_LAYOUT_CLASSES[layout];
709
+ const cursorClasses = CARD_CURSOR_CLASSES[cursor];
710
+ const combinedClasses = [
711
+ baseClasses,
712
+ paddingClasses,
713
+ minHeightClasses,
714
+ layoutClasses,
715
+ cursorClasses,
716
+ className
717
+ ].filter(Boolean).join(" ");
718
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { ref, className: combinedClasses, ...props, children });
719
+ }
720
+ );
721
+ var ACTION_CARD_CLASSES = {
722
+ warning: "bg-warning-background",
723
+ success: "bg-success-300",
724
+ error: "bg-error-100",
725
+ info: "bg-info-background"
726
+ };
727
+ var ACTION_ICON_CLASSES = {
728
+ warning: "bg-warning-300 text-text",
729
+ success: "bg-yellow-300 text-text-950",
730
+ error: "bg-error-500 text-text",
731
+ info: "bg-info-500 text-text"
732
+ };
733
+ var ACTION_SUBTITLE_CLASSES = {
734
+ warning: "text-warning-600",
735
+ success: "text-success-700",
736
+ error: "text-error-700",
737
+ info: "text-info-700"
738
+ };
739
+ var ACTION_HEADER_CLASSES = {
740
+ warning: "text-warning-300",
741
+ success: "text-success-300",
742
+ error: "text-error-300",
743
+ info: "text-info-300"
744
+ };
745
+ var CardActivitiesResults = (0, import_react.forwardRef)(
746
+ ({
747
+ icon,
748
+ title,
749
+ subTitle,
750
+ header,
751
+ extended = false,
752
+ action = "success",
753
+ description,
754
+ className,
755
+ ...props
756
+ }, ref) => {
757
+ const actionCardClasses = ACTION_CARD_CLASSES[action];
758
+ const actionIconClasses = ACTION_ICON_CLASSES[action];
759
+ const actionSubTitleClasses = ACTION_SUBTITLE_CLASSES[action];
760
+ const actionHeaderClasses = ACTION_HEADER_CLASSES[action];
761
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
762
+ "div",
763
+ {
764
+ ref,
765
+ className: `w-full flex flex-col border border-border-50 bg-background rounded-xl ${className}`,
766
+ ...props,
767
+ children: [
768
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
769
+ "div",
770
+ {
771
+ className: `
772
+ flex flex-col gap-1 items-center justify-center p-4
773
+ ${actionCardClasses}
774
+ ${extended ? "rounded-t-xl" : "rounded-xl"}`,
775
+ children: [
776
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
777
+ "span",
778
+ {
779
+ className: `size-7.5 rounded-full flex items-center justify-center ${actionIconClasses}`,
780
+ children: icon
781
+ }
782
+ ),
783
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
784
+ Text_default,
785
+ {
786
+ size: "2xs",
787
+ weight: "medium",
788
+ className: "text-text-800 uppercase truncate",
789
+ children: title
790
+ }
791
+ ),
792
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: `text-lg font-bold truncate ${actionSubTitleClasses}`, children: subTitle })
793
+ ]
794
+ }
795
+ ),
796
+ extended && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-col items-center gap-2.5 pb-9.5 pt-2.5", children: [
797
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
798
+ "p",
799
+ {
800
+ className: `text-2xs font-medium uppercase truncate ${actionHeaderClasses}`,
801
+ children: header
802
+ }
803
+ ),
804
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Badge_default, { size: "large", action: "info", children: description })
805
+ ] })
806
+ ]
807
+ }
808
+ );
809
+ }
810
+ );
811
+ var CardQuestions = (0, import_react.forwardRef)(
812
+ ({
813
+ header,
814
+ state = "undone",
815
+ className,
816
+ onClickButton,
817
+ valueButton,
818
+ ...props
819
+ }, ref) => {
820
+ const isDone = state === "done";
821
+ const stateLabel = isDone ? "Realizado" : "N\xE3o Realizado";
822
+ const buttonLabel = isDone ? "Ver Quest\xE3o" : "Responder";
823
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
824
+ CardBase,
825
+ {
826
+ ref,
827
+ layout: "horizontal",
828
+ padding: "medium",
829
+ minHeight: "medium",
830
+ className: `justify-between gap-4 ${className}`,
831
+ ...props,
832
+ children: [
833
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("section", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
834
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "font-bold text-xs text-text-950 truncate", children: header }),
835
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-row gap-6 items-center", children: [
836
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
837
+ Badge_default,
838
+ {
839
+ size: "medium",
840
+ variant: "solid",
841
+ action: isDone ? "success" : "error",
842
+ children: stateLabel
843
+ }
844
+ ),
845
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "flex flex-row items-center gap-1 text-text-700 text-xs", children: [
846
+ isDone ? "Nota" : "Sem nota",
847
+ isDone && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Badge_default, { size: "medium", action: "success", children: "00" })
848
+ ] })
849
+ ] })
850
+ ] }),
851
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
852
+ Button_default,
853
+ {
854
+ size: "extra-small",
855
+ onClick: () => onClickButton?.(valueButton),
856
+ className: "min-w-fit",
857
+ children: buttonLabel
858
+ }
859
+ ) })
860
+ ]
861
+ }
862
+ );
863
+ }
864
+ );
865
+ var CardProgress = (0, import_react.forwardRef)(
866
+ ({
867
+ header,
868
+ subhead,
869
+ initialDate,
870
+ endDate,
871
+ progress = 0,
872
+ direction = "horizontal",
873
+ icon,
874
+ color = "#B7DFFF",
875
+ progressVariant = "blue",
876
+ showDates = true,
877
+ className,
878
+ ...props
879
+ }, ref) => {
880
+ const isHorizontal = direction === "horizontal";
881
+ const contentComponent = {
882
+ horizontal: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
883
+ showDates && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-row gap-6 items-center", children: [
884
+ initialDate && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "flex flex-row gap-1 items-center text-2xs", children: [
885
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-text-800 font-semibold", children: "In\xEDcio" }),
886
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-text-600", children: initialDate })
887
+ ] }),
888
+ endDate && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "flex flex-row gap-1 items-center text-2xs", children: [
889
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-text-800 font-semibold", children: "Fim" }),
890
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-text-600", children: endDate })
891
+ ] })
892
+ ] }),
893
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "grid grid-cols-[1fr_auto] items-center gap-2", children: [
894
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
895
+ ProgressBar_default,
896
+ {
897
+ size: "small",
898
+ value: progress,
899
+ variant: progressVariant,
900
+ "data-testid": "progress-bar"
901
+ }
902
+ ),
903
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
904
+ Text_default,
905
+ {
906
+ size: "xs",
907
+ weight: "medium",
908
+ className: `text-text-950 leading-none tracking-normal text-center flex-none`,
909
+ children: [
910
+ Math.round(progress),
911
+ "%"
912
+ ]
913
+ }
914
+ )
915
+ ] })
916
+ ] }),
917
+ vertical: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-sm text-text-800", children: subhead })
918
+ };
919
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
920
+ CardBase,
921
+ {
922
+ ref,
923
+ layout: isHorizontal ? "horizontal" : "vertical",
924
+ padding: "none",
925
+ minHeight: "medium",
926
+ cursor: "pointer",
927
+ className: `${isHorizontal ? "h-20" : ""} ${className}`,
928
+ ...props,
929
+ children: [
930
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
931
+ "div",
932
+ {
933
+ className: `
934
+ flex justify-center items-center [&>svg]:size-6 text-text-950
935
+ ${isHorizontal ? "min-w-[80px] min-h-[80px] rounded-l-xl" : "min-h-[50px] w-full rounded-t-xl"}
936
+ ${!color.startsWith("#") ? `bg-${color}` : ""}
937
+ `,
938
+ style: color.startsWith("#") ? { backgroundColor: color } : void 0,
939
+ "data-testid": "icon-container",
940
+ children: icon
941
+ }
942
+ ),
943
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
944
+ "div",
945
+ {
946
+ className: `
947
+ p-4 flex flex-col justify-between w-full h-full
948
+ ${!isHorizontal && "gap-4"}
949
+ `,
950
+ children: [
951
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text_default, { size: "sm", weight: "bold", className: "text-text-950 truncate", children: header }),
952
+ contentComponent[direction]
953
+ ]
954
+ }
955
+ )
956
+ ]
957
+ }
958
+ );
959
+ }
960
+ );
961
+ var CardTopic = (0, import_react.forwardRef)(
962
+ ({
963
+ header,
964
+ subHead,
965
+ progress,
966
+ showPercentage = false,
967
+ progressVariant = "blue",
968
+ className = "",
969
+ ...props
970
+ }, ref) => {
971
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
972
+ CardBase,
973
+ {
974
+ ref,
975
+ layout: "vertical",
976
+ padding: "small",
977
+ minHeight: "medium",
978
+ cursor: "pointer",
979
+ className: `justify-center gap-2 py-2 px-4 ${className}`,
980
+ ...props,
981
+ children: [
982
+ 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: [
983
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: text }),
984
+ index < subHead.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: "\u2022" })
985
+ ] }, `${text} - ${index}`)) }),
986
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-sm text-text-950 font-bold truncate", children: header }),
987
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "grid grid-cols-[1fr_auto] items-center gap-2", children: [
988
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
989
+ ProgressBar_default,
990
+ {
991
+ size: "small",
992
+ value: progress,
993
+ variant: progressVariant,
994
+ "data-testid": "progress-bar"
995
+ }
996
+ ),
997
+ showPercentage && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
998
+ Text_default,
999
+ {
1000
+ size: "xs",
1001
+ weight: "medium",
1002
+ className: `text-text-950 leading-none tracking-normal text-center flex-none`,
1003
+ children: [
1004
+ Math.round(progress),
1005
+ "%"
1006
+ ]
1007
+ }
1008
+ )
1009
+ ] })
1010
+ ]
1011
+ }
1012
+ );
1013
+ }
1014
+ );
1015
+ var CardPerformance = (0, import_react.forwardRef)(
1016
+ ({
1017
+ header,
1018
+ progress,
1019
+ description = "Sem dados ainda! Voc\xEA ainda n\xE3o fez um question\xE1rio neste assunto.",
1020
+ actionVariant = "button",
1021
+ progressVariant = "blue",
1022
+ labelProgress = "",
1023
+ className = "",
1024
+ onClickButton,
1025
+ valueButton,
1026
+ ...props
1027
+ }, ref) => {
1028
+ const hasProgress = progress !== void 0;
1029
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1030
+ CardBase,
1031
+ {
1032
+ ref,
1033
+ layout: "horizontal",
1034
+ padding: "medium",
1035
+ minHeight: "none",
1036
+ className: `justify-between gap-2 ${actionVariant == "caret" ? "cursor-pointer" : ""} ${className}`,
1037
+ onClick: () => actionVariant == "caret" && onClickButton?.(valueButton),
1038
+ ...props,
1039
+ children: [
1040
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "w-full flex flex-col justify-between gap-2", children: [
1041
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-row justify-between items-center gap-2", children: [
1042
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-lg font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
1043
+ actionVariant === "button" && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1044
+ Button_default,
1045
+ {
1046
+ variant: "outline",
1047
+ size: "extra-small",
1048
+ onClick: () => onClickButton?.(valueButton),
1049
+ className: "min-w-fit flex-shrink-0",
1050
+ children: "Ver Aula"
1051
+ }
1052
+ )
1053
+ ] }),
1054
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "w-full", children: hasProgress ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1055
+ ProgressBar_default,
1056
+ {
1057
+ value: progress,
1058
+ label: `${progress}% ${labelProgress}`,
1059
+ variant: progressVariant
1060
+ }
1061
+ ) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-xs text-text-600 truncate", children: description }) })
1062
+ ] }),
1063
+ actionVariant == "caret" && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1064
+ import_phosphor_react2.CaretRight,
1065
+ {
1066
+ className: "size-4.5 text-text-800 cursor-pointer",
1067
+ "data-testid": "caret-icon"
1068
+ }
1069
+ )
1070
+ ]
1071
+ }
1072
+ );
1073
+ }
1074
+ );
1075
+ var CardResults = (0, import_react.forwardRef)(
1076
+ ({
1077
+ header,
1078
+ correct_answers,
1079
+ incorrect_answers,
1080
+ icon,
1081
+ direction = "col",
1082
+ color = "#B7DFFF",
1083
+ className,
1084
+ ...props
1085
+ }, ref) => {
1086
+ const isRow = direction == "row";
1087
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1088
+ CardBase,
1089
+ {
1090
+ ref,
1091
+ layout: "horizontal",
1092
+ padding: "none",
1093
+ minHeight: "medium",
1094
+ className: `items-center pr-4 ${className}`,
1095
+ ...props,
1096
+ children: [
1097
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1098
+ "div",
1099
+ {
1100
+ className: `
1101
+ flex justify-center items-center [&>svg]:size-8 text-text-950 min-w-20 max-w-20 min-h-20 h-full rounded-l-xl
1102
+ `,
1103
+ style: {
1104
+ backgroundColor: color
1105
+ },
1106
+ children: icon
1107
+ }
1108
+ ),
1109
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1110
+ "div",
1111
+ {
1112
+ className: `
1113
+ p-4 flex justify-between w-full h-full
1114
+ ${isRow ? "flex-row items-center gap-2" : "flex-col"}
1115
+ `,
1116
+ children: [
1117
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-sm font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
1118
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "flex flex-row gap-1 items-center", children: [
1119
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1120
+ Badge_default,
1121
+ {
1122
+ action: "success",
1123
+ variant: "solid",
1124
+ size: "medium",
1125
+ iconLeft: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react2.CheckCircle, {}),
1126
+ children: [
1127
+ correct_answers,
1128
+ " Corretas"
1129
+ ]
1130
+ }
1131
+ ),
1132
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1133
+ Badge_default,
1134
+ {
1135
+ action: "error",
1136
+ variant: "solid",
1137
+ size: "medium",
1138
+ iconLeft: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react2.XCircle, {}),
1139
+ children: [
1140
+ incorrect_answers,
1141
+ " Incorretas"
1142
+ ]
1143
+ }
1144
+ )
1145
+ ] })
1146
+ ]
1147
+ }
1148
+ ),
1149
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react2.CaretRight, { className: "min-w-6 min-h-6 text-text-800 cursor-pointer" })
1150
+ ]
1151
+ }
1152
+ );
1153
+ }
1154
+ );
1155
+ var CardStatus = (0, import_react.forwardRef)(
1156
+ ({ header, className, status, ...props }, ref) => {
1157
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1158
+ CardBase,
1159
+ {
1160
+ ref,
1161
+ layout: "horizontal",
1162
+ padding: "medium",
1163
+ minHeight: "medium",
1164
+ className: `items-center ${className}`,
1165
+ ...props,
1166
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex justify-between w-full h-full flex-row items-center gap-2", children: [
1167
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-sm font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
1168
+ status && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "flex flex-row gap-1 items-center flex-shrink-0", children: [
1169
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1170
+ Badge_default,
1171
+ {
1172
+ action: status == "correct" ? "success" : "error",
1173
+ variant: "solid",
1174
+ size: "medium",
1175
+ iconLeft: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react2.CheckCircle, {}),
1176
+ children: status == "correct" ? "Correta" : "Incorreta"
1177
+ }
1178
+ ),
1179
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-sm text-text-800", children: "Respondida" })
1180
+ ] }),
1181
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react2.CaretRight, { className: "min-w-6 min-h-6 text-text-800 cursor-pointer flex-shrink-0 ml-2" })
1182
+ ] })
1183
+ }
1184
+ );
1185
+ }
1186
+ );
1187
+ var CardSettings = (0, import_react.forwardRef)(
1188
+ ({ header, className, icon, ...props }, ref) => {
1189
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1190
+ CardBase,
1191
+ {
1192
+ ref,
1193
+ layout: "horizontal",
1194
+ padding: "small",
1195
+ minHeight: "none",
1196
+ className: `border-none items-center gap-2 text-text-700 ${className}`,
1197
+ ...props,
1198
+ children: [
1199
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "[&>svg]:size-6", children: icon }),
1200
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "w-full text-sm truncate", children: header }),
1201
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react2.CaretRight, { size: 24, className: "cursor-pointer" })
1202
+ ]
1203
+ }
1204
+ );
1205
+ }
1206
+ );
1207
+ var CardSupport = (0, import_react.forwardRef)(
1208
+ ({ header, className, direction = "col", children, ...props }, ref) => {
1209
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1210
+ CardBase,
1211
+ {
1212
+ ref,
1213
+ layout: "horizontal",
1214
+ padding: "medium",
1215
+ minHeight: "none",
1216
+ className: `border-none items-center gap-2 text-text-700 ${className}`,
1217
+ ...props,
1218
+ children: [
1219
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1220
+ "div",
1221
+ {
1222
+ className: `
1223
+ w-full flex ${direction == "col" ? "flex-col" : "flex-row items-center"} gap-2
1224
+ `,
1225
+ children: [
1226
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "w-full min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-sm text-text-950 font-bold truncate", children: header }) }),
1227
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "flex flex-row gap-1", children })
1228
+ ]
1229
+ }
1230
+ ),
1231
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react2.CaretRight, { className: "text-text-800 cursor-pointer", size: 24 })
1232
+ ]
1233
+ }
1234
+ );
1235
+ }
1236
+ );
1237
+ var CardForum = (0, import_react.forwardRef)(
1238
+ ({
1239
+ title,
1240
+ content,
1241
+ comments,
1242
+ onClickComments,
1243
+ valueComments,
1244
+ onClickProfile,
1245
+ valueProfile,
1246
+ className = "",
1247
+ date,
1248
+ hour,
1249
+ ...props
1250
+ }, ref) => {
1251
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1252
+ CardBase,
1253
+ {
1254
+ ref,
1255
+ layout: "horizontal",
1256
+ padding: "medium",
1257
+ minHeight: "none",
1258
+ variant: "minimal",
1259
+ className: `w-auto h-auto gap-3 ${className}`,
1260
+ ...props,
1261
+ children: [
1262
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1263
+ "button",
1264
+ {
1265
+ type: "button",
1266
+ "aria-label": "Ver perfil",
1267
+ onClick: () => onClickProfile?.(valueProfile),
1268
+ className: "min-w-8 h-8 rounded-full bg-background-950"
1269
+ }
1270
+ ),
1271
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-col gap-2 flex-1 min-w-0", children: [
1272
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-row gap-1 items-center flex-wrap", children: [
1273
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-xs font-semibold text-primary-700 truncate", children: title }),
1274
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { className: "text-xs text-text-600", children: [
1275
+ "\u2022 ",
1276
+ date,
1277
+ " \u2022 ",
1278
+ hour
1279
+ ] })
1280
+ ] }),
1281
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-text-950 text-sm line-clamp-2 truncate", children: content }),
1282
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1283
+ "button",
1284
+ {
1285
+ type: "button",
1286
+ "aria-label": "Ver coment\xE1rios",
1287
+ onClick: () => onClickComments?.(valueComments),
1288
+ className: "text-text-600 flex flex-row gap-2 items-center",
1289
+ children: [
1290
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react2.ChatCircleText, { "aria-hidden": "true", size: 16 }),
1291
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { className: "text-xs", children: [
1292
+ comments,
1293
+ " respostas"
1294
+ ] })
1295
+ ]
1296
+ }
1297
+ )
1298
+ ] })
1299
+ ]
1300
+ }
1301
+ );
1302
+ }
1303
+ );
1304
+ var CardAudio = (0, import_react.forwardRef)(
1305
+ ({
1306
+ src,
1307
+ title,
1308
+ onPlay,
1309
+ onPause,
1310
+ onEnded,
1311
+ onAudioTimeUpdate,
1312
+ loop = false,
1313
+ preload = "metadata",
1314
+ tracks,
1315
+ className,
1316
+ ...props
1317
+ }, ref) => {
1318
+ const [isPlaying, setIsPlaying] = (0, import_react.useState)(false);
1319
+ const [currentTime, setCurrentTime] = (0, import_react.useState)(0);
1320
+ const [duration, setDuration] = (0, import_react.useState)(0);
1321
+ const [volume, setVolume] = (0, import_react.useState)(1);
1322
+ const [showVolumeControl, setShowVolumeControl] = (0, import_react.useState)(false);
1323
+ const audioRef = (0, import_react.useRef)(null);
1324
+ const formatTime = (time) => {
1325
+ const minutes = Math.floor(time / 60);
1326
+ const seconds = Math.floor(time % 60);
1327
+ return `${minutes}:${seconds.toString().padStart(2, "0")}`;
1328
+ };
1329
+ const handlePlayPause = () => {
1330
+ if (isPlaying) {
1331
+ audioRef.current?.pause();
1332
+ setIsPlaying(false);
1333
+ onPause?.();
1334
+ } else {
1335
+ audioRef.current?.play();
1336
+ setIsPlaying(true);
1337
+ onPlay?.();
1338
+ }
1339
+ };
1340
+ const handleTimeUpdate = () => {
1341
+ const current = audioRef.current?.currentTime ?? 0;
1342
+ const total = audioRef.current?.duration ?? 0;
1343
+ setCurrentTime(current);
1344
+ setDuration(total);
1345
+ onAudioTimeUpdate?.(current, total);
1346
+ };
1347
+ const handleLoadedMetadata = () => {
1348
+ setDuration(audioRef.current?.duration ?? 0);
1349
+ };
1350
+ const handleEnded = () => {
1351
+ setIsPlaying(false);
1352
+ setCurrentTime(0);
1353
+ onEnded?.();
1354
+ };
1355
+ const handleProgressClick = (e) => {
1356
+ const rect = e.currentTarget.getBoundingClientRect();
1357
+ const clickX = e.clientX - rect.left;
1358
+ const width = rect.width;
1359
+ const percentage = clickX / width;
1360
+ const newTime = percentage * duration;
1361
+ if (audioRef.current) {
1362
+ audioRef.current.currentTime = newTime;
1363
+ }
1364
+ setCurrentTime(newTime);
1365
+ };
1366
+ const handleVolumeChange = (e) => {
1367
+ const newVolume = parseFloat(e.target.value);
1368
+ setVolume(newVolume);
1369
+ if (audioRef.current) {
1370
+ audioRef.current.volume = newVolume;
1371
+ }
1372
+ };
1373
+ const toggleVolumeControl = () => {
1374
+ setShowVolumeControl(!showVolumeControl);
1375
+ };
1376
+ const getVolumeIcon = () => {
1377
+ if (volume === 0) {
1378
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react2.SpeakerSimpleX, {});
1379
+ }
1380
+ if (volume < 0.5) {
1381
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react2.SpeakerLow, {});
1382
+ }
1383
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react2.SpeakerHigh, {});
1384
+ };
1385
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1386
+ CardBase,
1387
+ {
1388
+ ref,
1389
+ layout: "horizontal",
1390
+ padding: "medium",
1391
+ minHeight: "none",
1392
+ className: `w-auto h-14 items-center gap-2 ${className}`,
1393
+ ...props,
1394
+ children: [
1395
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1396
+ "audio",
1397
+ {
1398
+ ref: audioRef,
1399
+ src,
1400
+ loop,
1401
+ preload,
1402
+ onTimeUpdate: handleTimeUpdate,
1403
+ onLoadedMetadata: handleLoadedMetadata,
1404
+ onEnded: handleEnded,
1405
+ "data-testid": "audio-element",
1406
+ "aria-label": title,
1407
+ children: tracks ? tracks.map((track) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1408
+ "track",
1409
+ {
1410
+ kind: track.kind,
1411
+ src: track.src,
1412
+ srcLang: track.srcLang,
1413
+ label: track.label,
1414
+ default: track.default
1415
+ },
1416
+ track.src
1417
+ )) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1418
+ "track",
1419
+ {
1420
+ kind: "captions",
1421
+ src: "data:text/vtt;base64,",
1422
+ srcLang: "pt",
1423
+ label: "Sem legendas dispon\xEDveis"
1424
+ }
1425
+ )
1426
+ }
1427
+ ),
1428
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1429
+ "button",
1430
+ {
1431
+ type: "button",
1432
+ onClick: handlePlayPause,
1433
+ disabled: !src,
1434
+ className: "cursor-pointer text-text-950 hover:text-primary-600 disabled:text-text-400 disabled:cursor-not-allowed",
1435
+ "aria-label": isPlaying ? "Pausar" : "Reproduzir",
1436
+ children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "w-6 h-6 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex gap-0.5", children: [
1437
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "w-1 h-4 bg-current rounded-sm" }),
1438
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "w-1 h-4 bg-current rounded-sm" })
1439
+ ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react2.Play, { size: 24 })
1440
+ }
1441
+ ),
1442
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-text-800 text-sm font-medium min-w-[2.5rem]", children: formatTime(currentTime) }),
1443
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex-1 relative", "data-testid": "progress-bar", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1444
+ "button",
1445
+ {
1446
+ type: "button",
1447
+ className: "w-full h-2 bg-border-100 rounded-full cursor-pointer",
1448
+ onClick: handleProgressClick,
1449
+ onKeyDown: (e) => {
1450
+ if (e.key === "Enter" || e.key === " ") {
1451
+ e.preventDefault();
1452
+ handleProgressClick(
1453
+ e
1454
+ );
1455
+ }
1456
+ },
1457
+ "aria-label": "Barra de progresso do \xE1udio",
1458
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1459
+ "div",
1460
+ {
1461
+ className: "h-full bg-primary-600 rounded-full transition-all duration-100",
1462
+ style: {
1463
+ width: duration > 0 ? `${currentTime / duration * 100}%` : "0%"
1464
+ }
1465
+ }
1466
+ )
1467
+ }
1468
+ ) }),
1469
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-text-800 text-sm font-medium min-w-[2.5rem]", children: formatTime(duration) }),
1470
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "relative", children: [
1471
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1472
+ "button",
1473
+ {
1474
+ type: "button",
1475
+ onClick: toggleVolumeControl,
1476
+ className: "cursor-pointer text-text-950 hover:text-primary-600",
1477
+ "aria-label": "Controle de volume",
1478
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "w-6 h-6 flex items-center justify-center", children: getVolumeIcon() })
1479
+ }
1480
+ ),
1481
+ showVolumeControl && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1482
+ "button",
1483
+ {
1484
+ type: "button",
1485
+ className: "absolute bottom-full right-0 mb-2 p-2 bg-background border border-border-100 rounded-lg shadow-lg focus:outline-none focus:ring-2 focus:ring-primary-500",
1486
+ onKeyDown: (e) => {
1487
+ if (e.key === "Escape") {
1488
+ setShowVolumeControl(false);
1489
+ }
1490
+ },
1491
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1492
+ "input",
1493
+ {
1494
+ type: "range",
1495
+ min: "0",
1496
+ max: "1",
1497
+ step: "0.1",
1498
+ value: volume,
1499
+ onChange: handleVolumeChange,
1500
+ onKeyDown: (e) => {
1501
+ if (e.key === "ArrowUp" || e.key === "ArrowRight") {
1502
+ e.preventDefault();
1503
+ const newVolume = Math.min(
1504
+ 1,
1505
+ Math.round((volume + 0.1) * 10) / 10
1506
+ );
1507
+ setVolume(newVolume);
1508
+ if (audioRef.current) audioRef.current.volume = newVolume;
1509
+ } else if (e.key === "ArrowDown" || e.key === "ArrowLeft") {
1510
+ e.preventDefault();
1511
+ const newVolume = Math.max(
1512
+ 0,
1513
+ Math.round((volume - 0.1) * 10) / 10
1514
+ );
1515
+ setVolume(newVolume);
1516
+ if (audioRef.current) audioRef.current.volume = newVolume;
1517
+ }
1518
+ },
1519
+ className: "w-20 h-2 bg-border-100 rounded-lg appearance-none cursor-pointer",
1520
+ style: {
1521
+ background: `linear-gradient(to right, #3b82f6 0%, #3b82f6 ${volume * 100}%, #e5e7eb ${volume * 100}%, #e5e7eb 100%)`
1522
+ },
1523
+ "aria-label": "Volume",
1524
+ "aria-valuenow": Math.round(volume * 100),
1525
+ "aria-valuemin": 0,
1526
+ "aria-valuemax": 100
1527
+ }
1528
+ )
1529
+ }
1530
+ )
1531
+ ] }),
1532
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1533
+ import_phosphor_react2.DotsThreeVertical,
1534
+ {
1535
+ size: 24,
1536
+ className: "text-text-950 cursor-pointer hover:text-primary-600"
1537
+ }
1538
+ )
1539
+ ]
1540
+ }
1541
+ );
1542
+ }
1543
+ );
1544
+ var SIMULADO_BACKGROUND_CLASSES = {
1545
+ enem: "bg-exam-1",
1546
+ prova: "bg-exam-2",
1547
+ simuladao: "bg-exam-3",
1548
+ vestibular: "bg-exam-4"
1549
+ };
1550
+ var CardSimulado = (0, import_react.forwardRef)(
1551
+ ({ title, duration, info, backgroundColor, className, ...props }, ref) => {
1552
+ const backgroundClass = SIMULADO_BACKGROUND_CLASSES[backgroundColor];
1553
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1554
+ CardBase,
1555
+ {
1556
+ ref,
1557
+ layout: "horizontal",
1558
+ padding: "medium",
1559
+ minHeight: "none",
1560
+ cursor: "pointer",
1561
+ className: `${backgroundClass} hover:shadow-soft-shadow-2 transition-shadow duration-200 ${className}`,
1562
+ ...props,
1563
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex justify-between items-center w-full gap-4", children: [
1564
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
1565
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text_default, { size: "lg", weight: "bold", className: "text-text-950 truncate", children: title }),
1566
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center gap-4 text-text-700", children: [
1567
+ duration && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center gap-1", children: [
1568
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react2.Clock, { size: 16, className: "flex-shrink-0" }),
1569
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text_default, { size: "sm", children: duration })
1570
+ ] }),
1571
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text_default, { size: "sm", className: "truncate", children: info })
1572
+ ] })
1573
+ ] }),
1574
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1575
+ import_phosphor_react2.CaretRight,
1576
+ {
1577
+ size: 24,
1578
+ className: "text-text-800 flex-shrink-0",
1579
+ "data-testid": "caret-icon"
1580
+ }
1581
+ )
1582
+ ] })
1583
+ }
1584
+ );
1585
+ }
1586
+ );
1587
+
1588
+ // src/components/Accordation/Accordation.tsx
1589
+ var import_phosphor_react3 = require("phosphor-react");
1590
+ var import_jsx_runtime6 = require("react/jsx-runtime");
1591
+ var CardAccordation = (0, import_react2.forwardRef)(
1592
+ ({
1593
+ title,
1594
+ children,
1595
+ className,
1596
+ defaultExpanded = false,
1597
+ onToggleExpanded,
1598
+ ...props
1599
+ }, ref) => {
1600
+ const [isExpanded, setIsExpanded] = (0, import_react2.useState)(defaultExpanded);
1601
+ const contentId = (0, import_react2.useId)();
1602
+ const handleToggle = () => {
1603
+ const newExpanded = !isExpanded;
1604
+ setIsExpanded(newExpanded);
1605
+ onToggleExpanded?.(newExpanded);
1606
+ };
1607
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1608
+ CardBase,
1609
+ {
1610
+ ref,
1611
+ layout: "vertical",
1612
+ padding: "none",
1613
+ minHeight: "none",
1614
+ className: `overflow-hidden ${className}`,
1615
+ ...props,
1616
+ children: [
1617
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1618
+ "button",
1619
+ {
1620
+ onClick: handleToggle,
1621
+ className: "w-full cursor-pointer p-4 flex items-center justify-between gap-3 text-left transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-inset",
1622
+ "aria-expanded": isExpanded,
1623
+ "aria-controls": "accordion-content",
1624
+ children: [
1625
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1626
+ Text_default,
1627
+ {
1628
+ size: "sm",
1629
+ weight: "bold",
1630
+ className: "text-text-950 truncate flex-1",
1631
+ children: title
1632
+ }
1633
+ ),
1634
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1635
+ import_phosphor_react3.CaretRight,
1636
+ {
1637
+ size: 20,
1638
+ className: `text-text-700 transition-transform duration-200 flex-shrink-0 ${isExpanded ? "rotate-90" : "rotate-0"}`,
1639
+ "data-testid": "accordion-caret"
1640
+ }
1641
+ )
1642
+ ]
1643
+ }
1644
+ ),
1645
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1646
+ "div",
1647
+ {
1648
+ id: contentId,
1649
+ className: `transition-all duration-300 ease-in-out overflow-hidden ${isExpanded ? "max-h-screen opacity-100" : "max-h-0 opacity-0"}`,
1650
+ "data-testid": "accordion-content",
1651
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "p-4 pt-0 border-border-50", children })
1652
+ }
1653
+ )
1654
+ ]
1655
+ }
1656
+ );
1657
+ }
1658
+ );
1659
+ // Annotate the CommonJS export names for ESM import in node:
1660
+ 0 && (module.exports = {
1661
+ CardAccordation
1662
+ });
1663
+ //# sourceMappingURL=index.js.map