analytica-frontend-lib 1.2.86 → 1.2.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ActivitiesHistory/index.js.map +1 -1
- package/dist/ActivitiesHistory/index.mjs.map +1 -1
- package/dist/NotificationCard/index.js +1 -1
- package/dist/NotificationCard/index.js.map +1 -1
- package/dist/NotificationCard/index.mjs +1 -1
- package/dist/NotificationCard/index.mjs.map +1 -1
- package/dist/QuestionsData/index.d.ts +26 -1
- package/dist/QuestionsData/index.d.ts.map +1 -1
- package/dist/QuestionsData/index.js.map +1 -1
- package/dist/QuestionsData/index.mjs.map +1 -1
- package/dist/RecommendedLessonsHistory/index.d.ts +1 -1
- package/dist/RecommendedLessonsHistory/index.d.ts.map +1 -1
- package/dist/RecommendedLessonsHistory/index.js +148 -142
- package/dist/RecommendedLessonsHistory/index.js.map +1 -1
- package/dist/RecommendedLessonsHistory/index.mjs +147 -141
- package/dist/RecommendedLessonsHistory/index.mjs.map +1 -1
- package/dist/StudentRanking/index.d.ts +33 -9
- package/dist/StudentRanking/index.d.ts.map +1 -1
- package/dist/StudentRanking/index.js.map +1 -1
- package/dist/StudentRanking/index.mjs.map +1 -1
- package/dist/hooks/useActivitiesHistory/index.js.map +1 -1
- package/dist/hooks/useActivitiesHistory/index.mjs.map +1 -1
- package/dist/hooks/useNotifications.d.ts +2 -2
- package/dist/hooks/useNotifications.d.ts.map +1 -1
- package/dist/hooks/useQuestionsData.d.ts +218 -0
- package/dist/hooks/useQuestionsData.d.ts.map +1 -0
- package/dist/hooks/useRecommendedClassDrafts/index.d.ts +57 -0
- package/dist/hooks/useRecommendedClassDrafts/index.d.ts.map +1 -0
- package/dist/hooks/{useGoalDrafts → useRecommendedClassDrafts}/index.js +40 -40
- package/dist/hooks/useRecommendedClassDrafts/index.js.map +1 -0
- package/dist/hooks/{useGoalDrafts → useRecommendedClassDrafts}/index.mjs +33 -33
- package/dist/hooks/useRecommendedClassDrafts/index.mjs.map +1 -0
- package/dist/hooks/useRecommendedClassDrafts.d.ts +57 -0
- package/dist/hooks/useRecommendedClassDrafts.d.ts.map +1 -0
- package/dist/hooks/{useGoalModels.d.ts → useRecommendedClassModels.d.ts} +32 -32
- package/dist/hooks/useRecommendedClassModels.d.ts.map +1 -0
- package/dist/hooks/useRecommendedLessonDetails.d.ts +44 -44
- package/dist/hooks/useRecommendedLessonDetails.d.ts.map +1 -1
- package/dist/hooks/useRecommendedLessons/index.d.ts +35 -35
- package/dist/hooks/useRecommendedLessons/index.d.ts.map +1 -1
- package/dist/hooks/useRecommendedLessons/index.js +41 -41
- package/dist/hooks/useRecommendedLessons/index.js.map +1 -1
- package/dist/hooks/useRecommendedLessons/index.mjs +37 -37
- package/dist/hooks/useRecommendedLessons/index.mjs.map +1 -1
- package/dist/hooks/useRecommendedLessons.d.ts +35 -35
- package/dist/hooks/useRecommendedLessons.d.ts.map +1 -1
- package/dist/hooks/useRecommendedLessonsPage/index.d.ts +21 -21
- package/dist/hooks/useRecommendedLessonsPage/index.d.ts.map +1 -1
- package/dist/hooks/useRecommendedLessonsPage/index.js +39 -33
- package/dist/hooks/useRecommendedLessonsPage/index.js.map +1 -1
- package/dist/hooks/useRecommendedLessonsPage/index.mjs +39 -33
- package/dist/hooks/useRecommendedLessonsPage/index.mjs.map +1 -1
- package/dist/hooks/useRecommendedLessonsPage.d.ts +21 -21
- package/dist/hooks/useRecommendedLessonsPage.d.ts.map +1 -1
- package/dist/hooks/useStudentsHighlight.d.ts +275 -0
- package/dist/hooks/useStudentsHighlight.d.ts.map +1 -0
- package/dist/index.d.ts +15 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +570 -351
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +516 -308
- package/dist/index.mjs.map +1 -1
- package/dist/store/notificationStore.d.ts.map +1 -1
- package/dist/types/activitiesHistory/index.js.map +1 -1
- package/dist/types/activitiesHistory/index.mjs.map +1 -1
- package/dist/types/common.d.ts +2 -2
- package/dist/types/notifications.d.ts +5 -5
- package/dist/types/notifications.d.ts.map +1 -1
- package/dist/types/recommendedLessons/index.d.ts +112 -112
- package/dist/types/recommendedLessons/index.d.ts.map +1 -1
- package/dist/types/recommendedLessons/index.js +25 -25
- package/dist/types/recommendedLessons/index.js.map +1 -1
- package/dist/types/recommendedLessons/index.mjs +17 -17
- package/dist/types/recommendedLessons/index.mjs.map +1 -1
- package/dist/types/recommendedLessons.d.ts +112 -112
- package/dist/types/recommendedLessons.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/hooks/useGoalDrafts/index.d.ts +0 -57
- package/dist/hooks/useGoalDrafts/index.d.ts.map +0 -1
- package/dist/hooks/useGoalDrafts/index.js.map +0 -1
- package/dist/hooks/useGoalDrafts/index.mjs.map +0 -1
- package/dist/hooks/useGoalDrafts.d.ts +0 -57
- package/dist/hooks/useGoalDrafts.d.ts.map +0 -1
- package/dist/hooks/useGoalModels.d.ts.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* Data structure for questions statistics
|
|
3
|
+
* Data structure for questions statistics.
|
|
4
|
+
* Compatible with useQuestionsData hook output (hook data can be passed directly).
|
|
4
5
|
*/
|
|
5
6
|
export interface QuestionsDataItem {
|
|
6
7
|
/** Total number of questions answered */
|
|
@@ -33,6 +34,7 @@ export interface QuestionsDataProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
33
34
|
*
|
|
34
35
|
* @example
|
|
35
36
|
* ```tsx
|
|
37
|
+
* // Basic usage with static data
|
|
36
38
|
* <QuestionsData
|
|
37
39
|
* title="Dados de questões"
|
|
38
40
|
* data={{
|
|
@@ -44,6 +46,29 @@ export interface QuestionsDataProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
44
46
|
* showEmBranco
|
|
45
47
|
* />
|
|
46
48
|
* ```
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```tsx
|
|
52
|
+
* // Usage with useQuestionsData hook (direct usage - no transformation needed)
|
|
53
|
+
* const fetchQuestionsData = async (filters) => {
|
|
54
|
+
* const response = await api.get('/performance/questions-data', { params: filters });
|
|
55
|
+
* return response.data;
|
|
56
|
+
* };
|
|
57
|
+
*
|
|
58
|
+
* const useQuestionsData = createUseQuestionsData(fetchQuestionsData);
|
|
59
|
+
*
|
|
60
|
+
* function MyComponent() {
|
|
61
|
+
* const { data, loading, fetchQuestionsData } = useQuestionsData();
|
|
62
|
+
*
|
|
63
|
+
* useEffect(() => {
|
|
64
|
+
* fetchQuestionsData({ period: '30_DAYS' });
|
|
65
|
+
* }, [fetchQuestionsData]);
|
|
66
|
+
*
|
|
67
|
+
* if (loading || !data) return <Skeleton />;
|
|
68
|
+
*
|
|
69
|
+
* return <QuestionsData data={data} showEmBranco />;
|
|
70
|
+
* }
|
|
71
|
+
* ```
|
|
47
72
|
*/
|
|
48
73
|
export declare const QuestionsData: ({ title, data, showEmBranco, maxValue, chartHeight, className, ...props }: QuestionsDataProps) => import("react/jsx-runtime").JSX.Element;
|
|
49
74
|
export default QuestionsData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionsData.d.ts","sourceRoot":"","sources":["../../../src/components/QuestionsData/QuestionsData.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAIvC
|
|
1
|
+
{"version":3,"file":"QuestionsData.d.ts","sourceRoot":"","sources":["../../../src/components/QuestionsData/QuestionsData.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAIvC;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACxE,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,IAAI,EAAE,iBAAiB,CAAC;IACxB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAwJD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,eAAO,MAAM,aAAa,GAAI,2EAQ3B,kBAAkB,4CA8GpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/QuestionsData/QuestionsData.tsx","../../src/utils/utils.ts","../../src/components/Text/Text.tsx"],"sourcesContent":["import { HTMLAttributes } from 'react';\nimport Text from '../Text/Text';\nimport { cn } from '../../utils/utils';\n\n/**\n * Data structure for questions statistics\n */\nexport interface QuestionsDataItem {\n /** Total number of questions answered */\n total: number;\n /** Number of correct answers */\n corretas: number;\n /** Number of incorrect answers */\n incorretas: number;\n /** Number of blank (unanswered) questions */\n emBranco?: number;\n}\n\n/**\n * Props for the QuestionsData component\n */\nexport interface QuestionsDataProps extends HTMLAttributes<HTMLDivElement> {\n /** Card title */\n title?: string;\n /** Question statistics data */\n data: QuestionsDataItem;\n /** Whether to show blank questions bar */\n showEmBranco?: boolean;\n /** Maximum value for the chart scale (defaults to total) */\n maxValue?: number;\n /** Height of the chart area in pixels */\n chartHeight?: number;\n}\n\n/**\n * Bar item configuration\n */\ninterface BarItemConfig {\n key: string;\n label: string;\n legendLabel: string;\n value: number;\n colorClass: string;\n}\n\n/**\n * Color classes for bars and legend dots using design system tokens\n */\nconst BAR_COLORS = {\n total: 'bg-info-600',\n corretas: 'bg-success-200',\n incorretas: 'bg-warning-400',\n emBranco: 'bg-background-300',\n} as const;\n\n/**\n * Calculate Y-axis tick values based on max value\n */\nconst calculateYAxisTicks = (maxValue: number): number[] => {\n if (maxValue <= 0) return [0];\n\n // Round up to nearest \"nice\" number for the max tick\n const niceMax = Math.ceil(maxValue / 10) * 10;\n\n // Generate 5 ticks including 0 and max\n const step = niceMax / 4;\n return [\n niceMax,\n Math.round(step * 3),\n Math.round(step * 2),\n Math.round(step),\n 0,\n ];\n};\n\n/**\n * Legend item component\n */\nconst LegendItem = ({ color, label }: { color: string; label: string }) => (\n <div className=\"flex flex-row items-center gap-2\">\n <div className={cn('w-2 h-2 rounded-full', color)} />\n <Text size=\"xs\" weight=\"medium\" className=\"text-text-600\">\n {label}\n </Text>\n </div>\n);\n\n/**\n * Individual vertical bar component\n */\nconst DataBar = ({\n label,\n value,\n maxValue,\n colorClass,\n chartHeight,\n}: {\n label: string;\n value: number;\n maxValue: number;\n colorClass: string;\n chartHeight: number;\n}) => {\n const percentage = maxValue === 0 ? 0 : (value / maxValue) * 100;\n const barHeight = (percentage / 100) * chartHeight;\n\n return (\n <div className=\"flex flex-col items-center gap-2 flex-1\">\n {/* Bar container */}\n <div\n className=\"w-full flex items-end justify-center\"\n style={{ height: chartHeight }}\n >\n <div\n className={cn(\n 'w-16 rounded-lg transition-all duration-300',\n colorClass\n )}\n style={{ height: `${barHeight}px` }}\n />\n </div>\n\n {/* Label */}\n <Text size=\"xs\" weight=\"medium\" className=\"text-text-600 text-center\">\n {label}\n </Text>\n </div>\n );\n};\n\n/**\n * Grid lines component for the chart background\n */\nconst GridLines = ({\n ticks,\n chartHeight,\n}: {\n ticks: number[];\n chartHeight: number;\n}) => {\n return (\n <div\n className=\"absolute inset-0 flex flex-col justify-between pointer-events-none\"\n style={{ height: chartHeight }}\n >\n {ticks.map((tick, index) => (\n <div\n key={`${tick}-${index}`}\n className=\"w-full border-t border-dashed border-border-200\"\n style={{ marginTop: index === 0 ? 0 : undefined }}\n />\n ))}\n </div>\n );\n};\n\n/**\n * Y-Axis component\n */\nconst YAxis = ({\n ticks,\n chartHeight,\n}: {\n ticks: number[];\n chartHeight: number;\n}) => (\n <div\n className=\"flex flex-col justify-between items-end pr-3\"\n style={{ height: chartHeight }}\n aria-hidden=\"true\"\n >\n {ticks.map((tick, index) => (\n <Text\n key={`${tick}-${index}`}\n size=\"xs\"\n weight=\"medium\"\n className=\"text-text-500\"\n >\n {tick}\n </Text>\n ))}\n </div>\n);\n\n/**\n * QuestionsData component - displays a vertical bar chart showing\n * question statistics (total, correct, incorrect, and optionally blank).\n *\n * @example\n * ```tsx\n * <QuestionsData\n * title=\"Dados de questões\"\n * data={{\n * total: 120,\n * corretas: 80,\n * incorretas: 30,\n * emBranco: 10,\n * }}\n * showEmBranco\n * />\n * ```\n */\nexport const QuestionsData = ({\n title = 'Dados de questões',\n data,\n showEmBranco = false,\n maxValue,\n chartHeight = 180,\n className,\n ...props\n}: QuestionsDataProps) => {\n // Calculate the maximum value for the scale\n const chartMaxValue = maxValue ?? data.total;\n\n // Calculate Y-axis ticks\n const yAxisTicks = calculateYAxisTicks(chartMaxValue);\n const adjustedMaxValue = yAxisTicks[0]; // Use the nice max for calculations\n\n // Build accessible chart description\n const blankSuffix =\n showEmBranco && data.emBranco !== undefined\n ? `, ${data.emBranco} em branco`\n : '';\n const chartDescription = `Gráfico de barras mostrando ${data.total} questões respondidas, ${data.corretas} corretas, ${data.incorretas} incorretas${blankSuffix}`;\n\n // Build bar items configuration\n const barItems: BarItemConfig[] = [\n {\n key: 'total',\n label: 'Total',\n legendLabel: 'Total de questões respondidas',\n value: data.total,\n colorClass: BAR_COLORS.total,\n },\n {\n key: 'corretas',\n label: 'Corretas',\n legendLabel: 'Questões corretas',\n value: data.corretas,\n colorClass: BAR_COLORS.corretas,\n },\n {\n key: 'incorretas',\n label: 'Incorretas',\n legendLabel: 'Questões incorretas',\n value: data.incorretas,\n colorClass: BAR_COLORS.incorretas,\n },\n ];\n\n // Add blank questions bar if enabled\n if (showEmBranco && data.emBranco !== undefined) {\n barItems.push({\n key: 'emBranco',\n label: 'Em branco',\n legendLabel: 'Questões em branco',\n value: data.emBranco,\n colorClass: BAR_COLORS.emBranco,\n });\n }\n\n return (\n <div\n className={cn(\n 'flex flex-col p-5 gap-4 bg-background border border-border-50 rounded-xl',\n className\n )}\n {...props}\n >\n {/* Header */}\n <Text\n as=\"h3\"\n size=\"lg\"\n weight=\"bold\"\n className=\"text-text-950 tracking-[0.2px]\"\n >\n {title}\n </Text>\n\n {/* Legend */}\n <div className=\"flex flex-row flex-wrap gap-x-6 gap-y-2 mb-4\">\n {barItems.map((item) => (\n <LegendItem\n key={item.key}\n color={BAR_COLORS[item.key as keyof typeof BAR_COLORS]}\n label={item.legendLabel}\n />\n ))}\n </div>\n\n {/* Chart */}\n <div className=\"flex flex-row\" aria-label={chartDescription}>\n {/* Y-Axis */}\n <YAxis ticks={yAxisTicks} chartHeight={chartHeight} />\n\n {/* Spacer between Y-axis and chart */}\n <div className=\"w-4\" />\n\n {/* Chart area with grid and bars */}\n <div className=\"flex-1 relative\">\n {/* Grid lines */}\n <GridLines ticks={yAxisTicks} chartHeight={chartHeight} />\n\n {/* Bars */}\n <div className=\"flex flex-row flex-1 gap-4 relative z-10\">\n {barItems.map((item) => (\n <DataBar\n key={item.key}\n label={item.label}\n value={item.value}\n maxValue={adjustedMaxValue}\n colorClass={item.colorClass}\n chartHeight={chartHeight}\n />\n ))}\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default QuestionsData;\n","import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport { syncDropdownState } from './dropdown';\nexport {\n getSelectedIdsFromCategories,\n toggleArrayItem,\n toggleSingleValue,\n areFiltersEqual,\n} from './activityFilters';\nexport {\n mapQuestionTypeToEnum,\n mapQuestionTypeToEnumRequired,\n} from './questionTypeUtils';\nexport {\n getStatusBadgeConfig,\n formatTimeSpent,\n formatQuestionNumbers,\n formatDateToBrazilian,\n} from './activityDetailsUtils';\n\n/**\n * Retorna a cor hexadecimal com opacidade 0.3 (4d) se não estiver em dark mode.\n * Se estiver em dark mode, retorna a cor original.\n *\n * @param hexColor - Cor hexadecimal (ex: \"#0066b8\" ou \"0066b8\")\n * @param isDark - booleano indicando se está em dark mode\n * @returns string - cor hexadecimal com opacidade se necessário\n */\nexport function getSubjectColorWithOpacity(\n hexColor: string | undefined,\n isDark: boolean\n): string | undefined {\n if (!hexColor) return undefined;\n // Remove o '#' se existir\n let color = hexColor.replace(/^#/, '').toLowerCase();\n\n if (isDark) {\n // Se está em dark mode, sempre remove opacidade se existir\n if (color.length === 8) {\n color = color.slice(0, 6);\n }\n return `#${color}`;\n } else {\n // Se não está em dark mode (light mode)\n let resultColor: string;\n if (color.length === 6) {\n // Adiciona opacidade 0.3 (4D) para cores de 6 dígitos\n resultColor = `#${color}4d`;\n } else if (color.length === 8) {\n // Já tem opacidade, retorna como está\n resultColor = `#${color}`;\n } else {\n // Para outros tamanhos (3, 4, 5 dígitos), retorna como está\n resultColor = `#${color}`;\n }\n return resultColor;\n }\n}\n","import { ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';\nimport { cn } from '../../utils/utils';\n\n/**\n * Base text component props\n */\ntype BaseTextProps = {\n /** Content to be displayed */\n children?: ReactNode;\n /** Text size variant */\n size?:\n | '2xs'\n | 'xs'\n | 'sm'\n | 'md'\n | 'lg'\n | 'xl'\n | '2xl'\n | '3xl'\n | '4xl'\n | '5xl'\n | '6xl';\n /** Font weight variant */\n weight?:\n | 'hairline'\n | 'light'\n | 'normal'\n | 'medium'\n | 'semibold'\n | 'bold'\n | 'extrabold'\n | 'black';\n /** Color variant - white for light backgrounds, black for dark backgrounds */\n color?: string;\n /** Additional CSS classes to apply */\n className?: string;\n};\n\n/**\n * Polymorphic text component props that ensures type safety based on the 'as' prop\n */\ntype TextProps<T extends ElementType = 'p'> = BaseTextProps & {\n /** HTML tag to render */\n as?: T;\n} & Omit<ComponentPropsWithoutRef<T>, keyof BaseTextProps>;\n\n/**\n * Text component for Analytica Ensino platforms\n *\n * A flexible polymorphic text component with multiple sizes, weights, and colors.\n * Automatically adapts to dark and light themes with full type safety.\n *\n * @param children - The content to display\n * @param size - The text size variant (2xs, xs, sm, md, lg, xl, 2xl, 3xl, 4xl, 5xl, 6xl)\n * @param weight - The font weight variant (hairline, light, normal, medium, semibold, bold, extrabold, black)\n * @param color - The color variant - adapts to theme\n * @param as - The HTML tag to render - determines allowed attributes via TypeScript\n * @param className - Additional CSS classes\n * @param props - HTML attributes valid for the chosen tag only\n * @returns A styled text element with type-safe attributes\n *\n * @example\n * ```tsx\n * <Text size=\"lg\" weight=\"bold\" color=\"text-info-800\">\n * This is a large, bold text\n * </Text>\n *\n * <Text as=\"a\" href=\"/link\" target=\"_blank\">\n * Link with type-safe anchor attributes\n * </Text>\n *\n * <Text as=\"button\" onClick={handleClick} disabled>\n * Button with type-safe button attributes\n * </Text>\n * ```\n */\nconst Text = <T extends ElementType = 'p'>({\n children,\n size = 'md',\n weight = 'normal',\n color = 'text-text-950',\n as,\n className = '',\n ...props\n}: TextProps<T>) => {\n let sizeClasses = '';\n let weightClasses = '';\n\n // Text size classes mapping\n const sizeClassMap = {\n '2xs': 'text-2xs',\n xs: 'text-xs',\n sm: 'text-sm',\n md: 'text-md',\n lg: 'text-lg',\n xl: 'text-xl',\n '2xl': 'text-2xl',\n '3xl': 'text-3xl',\n '4xl': 'text-4xl',\n '5xl': 'text-5xl',\n '6xl': 'text-6xl',\n } as const;\n\n sizeClasses = sizeClassMap[size] ?? sizeClassMap.md;\n\n // Font weight classes mapping\n const weightClassMap = {\n hairline: 'font-hairline',\n light: 'font-light',\n normal: 'font-normal',\n medium: 'font-medium',\n semibold: 'font-semibold',\n bold: 'font-bold',\n extrabold: 'font-extrabold',\n black: 'font-black',\n } as const;\n\n weightClasses = weightClassMap[weight] ?? weightClassMap.normal;\n\n const baseClasses = 'font-primary';\n const Component = as ?? ('p' as ElementType);\n\n return (\n <Component\n className={cn(baseClasses, sizeClasses, weightClasses, color, className)}\n {...props}\n >\n {children}\n </Component>\n );\n};\n\nexport default Text;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACsHI;AA/CJ,IAAM,OAAO,CAA8B;AAAA,EACzC;AAAA,EACA,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR;AAAA,EACA,YAAY;AAAA,EACZ,GAAG;AACL,MAAoB;AAClB,MAAI,cAAc;AAClB,MAAI,gBAAgB;AAGpB,QAAM,eAAe;AAAA,IACnB,OAAO;AAAA,IACP,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,OAAO;AAAA,IACP,OAAO;AAAA,IACP,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAEA,gBAAc,aAAa,IAAI,KAAK,aAAa;AAGjD,QAAM,iBAAiB;AAAA,IACrB,UAAU;AAAA,IACV,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,MAAM;AAAA,IACN,WAAW;AAAA,IACX,OAAO;AAAA,EACT;AAEA,kBAAgB,eAAe,MAAM,KAAK,eAAe;AAEzD,QAAM,cAAc;AACpB,QAAM,YAAY,MAAO;AAEzB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,aAAa,aAAa,eAAe,OAAO,SAAS;AAAA,MACtE,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AAEA,IAAO,eAAQ;;;AFrDb,IAAAA,sBAAA;AA/BF,IAAM,aAAa;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A;AAAA,EACF;AAEJ;AAEA,IAAO,wBAAQ;","names":["import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/QuestionsData/QuestionsData.tsx","../../src/utils/utils.ts","../../src/components/Text/Text.tsx"],"sourcesContent":["import { HTMLAttributes } from 'react';\nimport Text from '../Text/Text';\nimport { cn } from '../../utils/utils';\n\n/**\n * Data structure for questions statistics.\n * Compatible with useQuestionsData hook output (hook data can be passed directly).\n */\nexport interface QuestionsDataItem {\n /** Total number of questions answered */\n total: number;\n /** Number of correct answers */\n corretas: number;\n /** Number of incorrect answers */\n incorretas: number;\n /** Number of blank (unanswered) questions */\n emBranco?: number;\n}\n\n/**\n * Props for the QuestionsData component\n */\nexport interface QuestionsDataProps extends HTMLAttributes<HTMLDivElement> {\n /** Card title */\n title?: string;\n /** Question statistics data */\n data: QuestionsDataItem;\n /** Whether to show blank questions bar */\n showEmBranco?: boolean;\n /** Maximum value for the chart scale (defaults to total) */\n maxValue?: number;\n /** Height of the chart area in pixels */\n chartHeight?: number;\n}\n\n/**\n * Bar item configuration\n */\ninterface BarItemConfig {\n key: string;\n label: string;\n legendLabel: string;\n value: number;\n colorClass: string;\n}\n\n/**\n * Color classes for bars and legend dots using design system tokens\n */\nconst BAR_COLORS = {\n total: 'bg-info-600',\n corretas: 'bg-success-200',\n incorretas: 'bg-warning-400',\n emBranco: 'bg-background-300',\n} as const;\n\n/**\n * Calculate Y-axis tick values based on max value\n */\nconst calculateYAxisTicks = (maxValue: number): number[] => {\n if (maxValue <= 0) return [0];\n\n // Round up to nearest \"nice\" number for the max tick\n const niceMax = Math.ceil(maxValue / 10) * 10;\n\n // Generate 5 ticks including 0 and max\n const step = niceMax / 4;\n return [\n niceMax,\n Math.round(step * 3),\n Math.round(step * 2),\n Math.round(step),\n 0,\n ];\n};\n\n/**\n * Legend item component\n */\nconst LegendItem = ({ color, label }: { color: string; label: string }) => (\n <div className=\"flex flex-row items-center gap-2\">\n <div className={cn('w-2 h-2 rounded-full', color)} />\n <Text size=\"xs\" weight=\"medium\" className=\"text-text-600\">\n {label}\n </Text>\n </div>\n);\n\n/**\n * Individual vertical bar component\n */\nconst DataBar = ({\n label,\n value,\n maxValue,\n colorClass,\n chartHeight,\n}: {\n label: string;\n value: number;\n maxValue: number;\n colorClass: string;\n chartHeight: number;\n}) => {\n const percentage = maxValue === 0 ? 0 : (value / maxValue) * 100;\n const barHeight = (percentage / 100) * chartHeight;\n\n return (\n <div className=\"flex flex-col items-center gap-2 flex-1\">\n {/* Bar container */}\n <div\n className=\"w-full flex items-end justify-center\"\n style={{ height: chartHeight }}\n >\n <div\n className={cn(\n 'w-16 rounded-lg transition-all duration-300',\n colorClass\n )}\n style={{ height: `${barHeight}px` }}\n />\n </div>\n\n {/* Label */}\n <Text size=\"xs\" weight=\"medium\" className=\"text-text-600 text-center\">\n {label}\n </Text>\n </div>\n );\n};\n\n/**\n * Grid lines component for the chart background\n */\nconst GridLines = ({\n ticks,\n chartHeight,\n}: {\n ticks: number[];\n chartHeight: number;\n}) => {\n return (\n <div\n className=\"absolute inset-0 flex flex-col justify-between pointer-events-none\"\n style={{ height: chartHeight }}\n >\n {ticks.map((tick, index) => (\n <div\n key={`${tick}-${index}`}\n className=\"w-full border-t border-dashed border-border-200\"\n style={{ marginTop: index === 0 ? 0 : undefined }}\n />\n ))}\n </div>\n );\n};\n\n/**\n * Y-Axis component\n */\nconst YAxis = ({\n ticks,\n chartHeight,\n}: {\n ticks: number[];\n chartHeight: number;\n}) => (\n <div\n className=\"flex flex-col justify-between items-end pr-3\"\n style={{ height: chartHeight }}\n aria-hidden=\"true\"\n >\n {ticks.map((tick, index) => (\n <Text\n key={`${tick}-${index}`}\n size=\"xs\"\n weight=\"medium\"\n className=\"text-text-500\"\n >\n {tick}\n </Text>\n ))}\n </div>\n);\n\n/**\n * QuestionsData component - displays a vertical bar chart showing\n * question statistics (total, correct, incorrect, and optionally blank).\n *\n * @example\n * ```tsx\n * // Basic usage with static data\n * <QuestionsData\n * title=\"Dados de questões\"\n * data={{\n * total: 120,\n * corretas: 80,\n * incorretas: 30,\n * emBranco: 10,\n * }}\n * showEmBranco\n * />\n * ```\n *\n * @example\n * ```tsx\n * // Usage with useQuestionsData hook (direct usage - no transformation needed)\n * const fetchQuestionsData = async (filters) => {\n * const response = await api.get('/performance/questions-data', { params: filters });\n * return response.data;\n * };\n *\n * const useQuestionsData = createUseQuestionsData(fetchQuestionsData);\n *\n * function MyComponent() {\n * const { data, loading, fetchQuestionsData } = useQuestionsData();\n *\n * useEffect(() => {\n * fetchQuestionsData({ period: '30_DAYS' });\n * }, [fetchQuestionsData]);\n *\n * if (loading || !data) return <Skeleton />;\n *\n * return <QuestionsData data={data} showEmBranco />;\n * }\n * ```\n */\nexport const QuestionsData = ({\n title = 'Dados de questões',\n data,\n showEmBranco = false,\n maxValue,\n chartHeight = 180,\n className,\n ...props\n}: QuestionsDataProps) => {\n // Calculate the maximum value for the scale\n const chartMaxValue = maxValue ?? data.total;\n\n // Calculate Y-axis ticks\n const yAxisTicks = calculateYAxisTicks(chartMaxValue);\n const adjustedMaxValue = yAxisTicks[0]; // Use the nice max for calculations\n\n // Build accessible chart description\n const blankSuffix =\n showEmBranco && data.emBranco !== undefined\n ? `, ${data.emBranco} em branco`\n : '';\n const chartDescription = `Gráfico de barras mostrando ${data.total} questões respondidas, ${data.corretas} corretas, ${data.incorretas} incorretas${blankSuffix}`;\n\n // Build bar items configuration\n const barItems: BarItemConfig[] = [\n {\n key: 'total',\n label: 'Total',\n legendLabel: 'Total de questões respondidas',\n value: data.total,\n colorClass: BAR_COLORS.total,\n },\n {\n key: 'corretas',\n label: 'Corretas',\n legendLabel: 'Questões corretas',\n value: data.corretas,\n colorClass: BAR_COLORS.corretas,\n },\n {\n key: 'incorretas',\n label: 'Incorretas',\n legendLabel: 'Questões incorretas',\n value: data.incorretas,\n colorClass: BAR_COLORS.incorretas,\n },\n ];\n\n // Add blank questions bar if enabled\n if (showEmBranco && data.emBranco !== undefined) {\n barItems.push({\n key: 'emBranco',\n label: 'Em branco',\n legendLabel: 'Questões em branco',\n value: data.emBranco,\n colorClass: BAR_COLORS.emBranco,\n });\n }\n\n return (\n <div\n className={cn(\n 'flex flex-col p-5 gap-4 bg-background border border-border-50 rounded-xl',\n className\n )}\n {...props}\n >\n {/* Header */}\n <Text\n as=\"h3\"\n size=\"lg\"\n weight=\"bold\"\n className=\"text-text-950 tracking-[0.2px]\"\n >\n {title}\n </Text>\n\n {/* Legend */}\n <div className=\"flex flex-row flex-wrap gap-x-6 gap-y-2 mb-4\">\n {barItems.map((item) => (\n <LegendItem\n key={item.key}\n color={BAR_COLORS[item.key as keyof typeof BAR_COLORS]}\n label={item.legendLabel}\n />\n ))}\n </div>\n\n {/* Chart */}\n <div className=\"flex flex-row\" aria-label={chartDescription}>\n {/* Y-Axis */}\n <YAxis ticks={yAxisTicks} chartHeight={chartHeight} />\n\n {/* Spacer between Y-axis and chart */}\n <div className=\"w-4\" />\n\n {/* Chart area with grid and bars */}\n <div className=\"flex-1 relative\">\n {/* Grid lines */}\n <GridLines ticks={yAxisTicks} chartHeight={chartHeight} />\n\n {/* Bars */}\n <div className=\"flex flex-row flex-1 gap-4 relative z-10\">\n {barItems.map((item) => (\n <DataBar\n key={item.key}\n label={item.label}\n value={item.value}\n maxValue={adjustedMaxValue}\n colorClass={item.colorClass}\n chartHeight={chartHeight}\n />\n ))}\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default QuestionsData;\n","import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport { syncDropdownState } from './dropdown';\nexport {\n getSelectedIdsFromCategories,\n toggleArrayItem,\n toggleSingleValue,\n areFiltersEqual,\n} from './activityFilters';\nexport {\n mapQuestionTypeToEnum,\n mapQuestionTypeToEnumRequired,\n} from './questionTypeUtils';\nexport {\n getStatusBadgeConfig,\n formatTimeSpent,\n formatQuestionNumbers,\n formatDateToBrazilian,\n} from './activityDetailsUtils';\n\n/**\n * Retorna a cor hexadecimal com opacidade 0.3 (4d) se não estiver em dark mode.\n * Se estiver em dark mode, retorna a cor original.\n *\n * @param hexColor - Cor hexadecimal (ex: \"#0066b8\" ou \"0066b8\")\n * @param isDark - booleano indicando se está em dark mode\n * @returns string - cor hexadecimal com opacidade se necessário\n */\nexport function getSubjectColorWithOpacity(\n hexColor: string | undefined,\n isDark: boolean\n): string | undefined {\n if (!hexColor) return undefined;\n // Remove o '#' se existir\n let color = hexColor.replace(/^#/, '').toLowerCase();\n\n if (isDark) {\n // Se está em dark mode, sempre remove opacidade se existir\n if (color.length === 8) {\n color = color.slice(0, 6);\n }\n return `#${color}`;\n } else {\n // Se não está em dark mode (light mode)\n let resultColor: string;\n if (color.length === 6) {\n // Adiciona opacidade 0.3 (4D) para cores de 6 dígitos\n resultColor = `#${color}4d`;\n } else if (color.length === 8) {\n // Já tem opacidade, retorna como está\n resultColor = `#${color}`;\n } else {\n // Para outros tamanhos (3, 4, 5 dígitos), retorna como está\n resultColor = `#${color}`;\n }\n return resultColor;\n }\n}\n","import { ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';\nimport { cn } from '../../utils/utils';\n\n/**\n * Base text component props\n */\ntype BaseTextProps = {\n /** Content to be displayed */\n children?: ReactNode;\n /** Text size variant */\n size?:\n | '2xs'\n | 'xs'\n | 'sm'\n | 'md'\n | 'lg'\n | 'xl'\n | '2xl'\n | '3xl'\n | '4xl'\n | '5xl'\n | '6xl';\n /** Font weight variant */\n weight?:\n | 'hairline'\n | 'light'\n | 'normal'\n | 'medium'\n | 'semibold'\n | 'bold'\n | 'extrabold'\n | 'black';\n /** Color variant - white for light backgrounds, black for dark backgrounds */\n color?: string;\n /** Additional CSS classes to apply */\n className?: string;\n};\n\n/**\n * Polymorphic text component props that ensures type safety based on the 'as' prop\n */\ntype TextProps<T extends ElementType = 'p'> = BaseTextProps & {\n /** HTML tag to render */\n as?: T;\n} & Omit<ComponentPropsWithoutRef<T>, keyof BaseTextProps>;\n\n/**\n * Text component for Analytica Ensino platforms\n *\n * A flexible polymorphic text component with multiple sizes, weights, and colors.\n * Automatically adapts to dark and light themes with full type safety.\n *\n * @param children - The content to display\n * @param size - The text size variant (2xs, xs, sm, md, lg, xl, 2xl, 3xl, 4xl, 5xl, 6xl)\n * @param weight - The font weight variant (hairline, light, normal, medium, semibold, bold, extrabold, black)\n * @param color - The color variant - adapts to theme\n * @param as - The HTML tag to render - determines allowed attributes via TypeScript\n * @param className - Additional CSS classes\n * @param props - HTML attributes valid for the chosen tag only\n * @returns A styled text element with type-safe attributes\n *\n * @example\n * ```tsx\n * <Text size=\"lg\" weight=\"bold\" color=\"text-info-800\">\n * This is a large, bold text\n * </Text>\n *\n * <Text as=\"a\" href=\"/link\" target=\"_blank\">\n * Link with type-safe anchor attributes\n * </Text>\n *\n * <Text as=\"button\" onClick={handleClick} disabled>\n * Button with type-safe button attributes\n * </Text>\n * ```\n */\nconst Text = <T extends ElementType = 'p'>({\n children,\n size = 'md',\n weight = 'normal',\n color = 'text-text-950',\n as,\n className = '',\n ...props\n}: TextProps<T>) => {\n let sizeClasses = '';\n let weightClasses = '';\n\n // Text size classes mapping\n const sizeClassMap = {\n '2xs': 'text-2xs',\n xs: 'text-xs',\n sm: 'text-sm',\n md: 'text-md',\n lg: 'text-lg',\n xl: 'text-xl',\n '2xl': 'text-2xl',\n '3xl': 'text-3xl',\n '4xl': 'text-4xl',\n '5xl': 'text-5xl',\n '6xl': 'text-6xl',\n } as const;\n\n sizeClasses = sizeClassMap[size] ?? sizeClassMap.md;\n\n // Font weight classes mapping\n const weightClassMap = {\n hairline: 'font-hairline',\n light: 'font-light',\n normal: 'font-normal',\n medium: 'font-medium',\n semibold: 'font-semibold',\n bold: 'font-bold',\n extrabold: 'font-extrabold',\n black: 'font-black',\n } as const;\n\n weightClasses = weightClassMap[weight] ?? weightClassMap.normal;\n\n const baseClasses = 'font-primary';\n const Component = as ?? ('p' as ElementType);\n\n return (\n <Component\n className={cn(baseClasses, sizeClasses, weightClasses, color, className)}\n {...props}\n >\n {children}\n </Component>\n );\n};\n\nexport default Text;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACsHI;AA/CJ,IAAM,OAAO,CAA8B;AAAA,EACzC;AAAA,EACA,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR;AAAA,EACA,YAAY;AAAA,EACZ,GAAG;AACL,MAAoB;AAClB,MAAI,cAAc;AAClB,MAAI,gBAAgB;AAGpB,QAAM,eAAe;AAAA,IACnB,OAAO;AAAA,IACP,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,OAAO;AAAA,IACP,OAAO;AAAA,IACP,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAEA,gBAAc,aAAa,IAAI,KAAK,aAAa;AAGjD,QAAM,iBAAiB;AAAA,IACrB,UAAU;AAAA,IACV,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,MAAM;AAAA,IACN,WAAW;AAAA,IACX,OAAO;AAAA,EACT;AAEA,kBAAgB,eAAe,MAAM,KAAK,eAAe;AAEzD,QAAM,cAAc;AACpB,QAAM,YAAY,MAAO;AAEzB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,aAAa,aAAa,eAAe,OAAO,SAAS;AAAA,MACtE,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AAEA,IAAO,eAAQ;;;AFpDb,IAAAA,sBAAA;AA/BF,IAAM,aAAa;AAAA,EACjB,OAAO;AAAA,EACP,UAAU;AAAA,EAC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":["import_jsx_runtime"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/utils.ts","../../src/components/Text/Text.tsx","../../src/components/QuestionsData/QuestionsData.tsx"],"sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport { syncDropdownState } from './dropdown';\nexport {\n getSelectedIdsFromCategories,\n toggleArrayItem,\n toggleSingleValue,\n areFiltersEqual,\n} from './activityFilters';\nexport {\n mapQuestionTypeToEnum,\n mapQuestionTypeToEnumRequired,\n} from './questionTypeUtils';\nexport {\n getStatusBadgeConfig,\n formatTimeSpent,\n formatQuestionNumbers,\n formatDateToBrazilian,\n} from './activityDetailsUtils';\n\n/**\n * Retorna a cor hexadecimal com opacidade 0.3 (4d) se não estiver em dark mode.\n * Se estiver em dark mode, retorna a cor original.\n *\n * @param hexColor - Cor hexadecimal (ex: \"#0066b8\" ou \"0066b8\")\n * @param isDark - booleano indicando se está em dark mode\n * @returns string - cor hexadecimal com opacidade se necessário\n */\nexport function getSubjectColorWithOpacity(\n hexColor: string | undefined,\n isDark: boolean\n): string | undefined {\n if (!hexColor) return undefined;\n // Remove o '#' se existir\n let color = hexColor.replace(/^#/, '').toLowerCase();\n\n if (isDark) {\n // Se está em dark mode, sempre remove opacidade se existir\n if (color.length === 8) {\n color = color.slice(0, 6);\n }\n return `#${color}`;\n } else {\n // Se não está em dark mode (light mode)\n let resultColor: string;\n if (color.length === 6) {\n // Adiciona opacidade 0.3 (4D) para cores de 6 dígitos\n resultColor = `#${color}4d`;\n } else if (color.length === 8) {\n // Já tem opacidade, retorna como está\n resultColor = `#${color}`;\n } else {\n // Para outros tamanhos (3, 4, 5 dígitos), retorna como está\n resultColor = `#${color}`;\n }\n return resultColor;\n }\n}\n","import { ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';\nimport { cn } from '../../utils/utils';\n\n/**\n * Base text component props\n */\ntype BaseTextProps = {\n /** Content to be displayed */\n children?: ReactNode;\n /** Text size variant */\n size?:\n | '2xs'\n | 'xs'\n | 'sm'\n | 'md'\n | 'lg'\n | 'xl'\n | '2xl'\n | '3xl'\n | '4xl'\n | '5xl'\n | '6xl';\n /** Font weight variant */\n weight?:\n | 'hairline'\n | 'light'\n | 'normal'\n | 'medium'\n | 'semibold'\n | 'bold'\n | 'extrabold'\n | 'black';\n /** Color variant - white for light backgrounds, black for dark backgrounds */\n color?: string;\n /** Additional CSS classes to apply */\n className?: string;\n};\n\n/**\n * Polymorphic text component props that ensures type safety based on the 'as' prop\n */\ntype TextProps<T extends ElementType = 'p'> = BaseTextProps & {\n /** HTML tag to render */\n as?: T;\n} & Omit<ComponentPropsWithoutRef<T>, keyof BaseTextProps>;\n\n/**\n * Text component for Analytica Ensino platforms\n *\n * A flexible polymorphic text component with multiple sizes, weights, and colors.\n * Automatically adapts to dark and light themes with full type safety.\n *\n * @param children - The content to display\n * @param size - The text size variant (2xs, xs, sm, md, lg, xl, 2xl, 3xl, 4xl, 5xl, 6xl)\n * @param weight - The font weight variant (hairline, light, normal, medium, semibold, bold, extrabold, black)\n * @param color - The color variant - adapts to theme\n * @param as - The HTML tag to render - determines allowed attributes via TypeScript\n * @param className - Additional CSS classes\n * @param props - HTML attributes valid for the chosen tag only\n * @returns A styled text element with type-safe attributes\n *\n * @example\n * ```tsx\n * <Text size=\"lg\" weight=\"bold\" color=\"text-info-800\">\n * This is a large, bold text\n * </Text>\n *\n * <Text as=\"a\" href=\"/link\" target=\"_blank\">\n * Link with type-safe anchor attributes\n * </Text>\n *\n * <Text as=\"button\" onClick={handleClick} disabled>\n * Button with type-safe button attributes\n * </Text>\n * ```\n */\nconst Text = <T extends ElementType = 'p'>({\n children,\n size = 'md',\n weight = 'normal',\n color = 'text-text-950',\n as,\n className = '',\n ...props\n}: TextProps<T>) => {\n let sizeClasses = '';\n let weightClasses = '';\n\n // Text size classes mapping\n const sizeClassMap = {\n '2xs': 'text-2xs',\n xs: 'text-xs',\n sm: 'text-sm',\n md: 'text-md',\n lg: 'text-lg',\n xl: 'text-xl',\n '2xl': 'text-2xl',\n '3xl': 'text-3xl',\n '4xl': 'text-4xl',\n '5xl': 'text-5xl',\n '6xl': 'text-6xl',\n } as const;\n\n sizeClasses = sizeClassMap[size] ?? sizeClassMap.md;\n\n // Font weight classes mapping\n const weightClassMap = {\n hairline: 'font-hairline',\n light: 'font-light',\n normal: 'font-normal',\n medium: 'font-medium',\n semibold: 'font-semibold',\n bold: 'font-bold',\n extrabold: 'font-extrabold',\n black: 'font-black',\n } as const;\n\n weightClasses = weightClassMap[weight] ?? weightClassMap.normal;\n\n const baseClasses = 'font-primary';\n const Component = as ?? ('p' as ElementType);\n\n return (\n <Component\n className={cn(baseClasses, sizeClasses, weightClasses, color, className)}\n {...props}\n >\n {children}\n </Component>\n );\n};\n\nexport default Text;\n","import { HTMLAttributes } from 'react';\nimport Text from '../Text/Text';\nimport { cn } from '../../utils/utils';\n\n/**\n * Data structure for questions statistics\n */\nexport interface QuestionsDataItem {\n /** Total number of questions answered */\n total: number;\n /** Number of correct answers */\n corretas: number;\n /** Number of incorrect answers */\n incorretas: number;\n /** Number of blank (unanswered) questions */\n emBranco?: number;\n}\n\n/**\n * Props for the QuestionsData component\n */\nexport interface QuestionsDataProps extends HTMLAttributes<HTMLDivElement> {\n /** Card title */\n title?: string;\n /** Question statistics data */\n data: QuestionsDataItem;\n /** Whether to show blank questions bar */\n showEmBranco?: boolean;\n /** Maximum value for the chart scale (defaults to total) */\n maxValue?: number;\n /** Height of the chart area in pixels */\n chartHeight?: number;\n}\n\n/**\n * Bar item configuration\n */\ninterface BarItemConfig {\n key: string;\n label: string;\n legendLabel: string;\n value: number;\n colorClass: string;\n}\n\n/**\n * Color classes for bars and legend dots using design system tokens\n */\nconst BAR_COLORS = {\n total: 'bg-info-600',\n corretas: 'bg-success-200',\n incorretas: 'bg-warning-400',\n emBranco: 'bg-background-300',\n} as const;\n\n/**\n * Calculate Y-axis tick values based on max value\n */\nconst calculateYAxisTicks = (maxValue: number): number[] => {\n if (maxValue <= 0) return [0];\n\n // Round up to nearest \"nice\" number for the max tick\n const niceMax = Math.ceil(maxValue / 10) * 10;\n\n // Generate 5 ticks including 0 and max\n const step = niceMax / 4;\n return [\n niceMax,\n Math.round(step * 3),\n Math.round(step * 2),\n Math.round(step),\n 0,\n ];\n};\n\n/**\n * Legend item component\n */\nconst LegendItem = ({ color, label }: { color: string; label: string }) => (\n <div className=\"flex flex-row items-center gap-2\">\n <div className={cn('w-2 h-2 rounded-full', color)} />\n <Text size=\"xs\" weight=\"medium\" className=\"text-text-600\">\n {label}\n </Text>\n </div>\n);\n\n/**\n * Individual vertical bar component\n */\nconst DataBar = ({\n label,\n value,\n maxValue,\n colorClass,\n chartHeight,\n}: {\n label: string;\n value: number;\n maxValue: number;\n colorClass: string;\n chartHeight: number;\n}) => {\n const percentage = maxValue === 0 ? 0 : (value / maxValue) * 100;\n const barHeight = (percentage / 100) * chartHeight;\n\n return (\n <div className=\"flex flex-col items-center gap-2 flex-1\">\n {/* Bar container */}\n <div\n className=\"w-full flex items-end justify-center\"\n style={{ height: chartHeight }}\n >\n <div\n className={cn(\n 'w-16 rounded-lg transition-all duration-300',\n colorClass\n )}\n style={{ height: `${barHeight}px` }}\n />\n </div>\n\n {/* Label */}\n <Text size=\"xs\" weight=\"medium\" className=\"text-text-600 text-center\">\n {label}\n </Text>\n </div>\n );\n};\n\n/**\n * Grid lines component for the chart background\n */\nconst GridLines = ({\n ticks,\n chartHeight,\n}: {\n ticks: number[];\n chartHeight: number;\n}) => {\n return (\n <div\n className=\"absolute inset-0 flex flex-col justify-between pointer-events-none\"\n style={{ height: chartHeight }}\n >\n {ticks.map((tick, index) => (\n <div\n key={`${tick}-${index}`}\n className=\"w-full border-t border-dashed border-border-200\"\n style={{ marginTop: index === 0 ? 0 : undefined }}\n />\n ))}\n </div>\n );\n};\n\n/**\n * Y-Axis component\n */\nconst YAxis = ({\n ticks,\n chartHeight,\n}: {\n ticks: number[];\n chartHeight: number;\n}) => (\n <div\n className=\"flex flex-col justify-between items-end pr-3\"\n style={{ height: chartHeight }}\n aria-hidden=\"true\"\n >\n {ticks.map((tick, index) => (\n <Text\n key={`${tick}-${index}`}\n size=\"xs\"\n weight=\"medium\"\n className=\"text-text-500\"\n >\n {tick}\n </Text>\n ))}\n </div>\n);\n\n/**\n * QuestionsData component - displays a vertical bar chart showing\n * question statistics (total, correct, incorrect, and optionally blank).\n *\n * @example\n * ```tsx\n * <QuestionsData\n * title=\"Dados de questões\"\n * data={{\n * total: 120,\n * corretas: 80,\n * incorretas: 30,\n * emBranco: 10,\n * }}\n * showEmBranco\n * />\n * ```\n */\nexport const QuestionsData = ({\n title = 'Dados de questões',\n data,\n showEmBranco = false,\n maxValue,\n chartHeight = 180,\n className,\n ...props\n}: QuestionsDataProps) => {\n // Calculate the maximum value for the scale\n const chartMaxValue = maxValue ?? data.total;\n\n // Calculate Y-axis ticks\n const yAxisTicks = calculateYAxisTicks(chartMaxValue);\n const adjustedMaxValue = yAxisTicks[0]; // Use the nice max for calculations\n\n // Build accessible chart description\n const blankSuffix =\n showEmBranco && data.emBranco !== undefined\n ? `, ${data.emBranco} em branco`\n : '';\n const chartDescription = `Gráfico de barras mostrando ${data.total} questões respondidas, ${data.corretas} corretas, ${data.incorretas} incorretas${blankSuffix}`;\n\n // Build bar items configuration\n const barItems: BarItemConfig[] = [\n {\n key: 'total',\n label: 'Total',\n legendLabel: 'Total de questões respondidas',\n value: data.total,\n colorClass: BAR_COLORS.total,\n },\n {\n key: 'corretas',\n label: 'Corretas',\n legendLabel: 'Questões corretas',\n value: data.corretas,\n colorClass: BAR_COLORS.corretas,\n },\n {\n key: 'incorretas',\n label: 'Incorretas',\n legendLabel: 'Questões incorretas',\n value: data.incorretas,\n colorClass: BAR_COLORS.incorretas,\n },\n ];\n\n // Add blank questions bar if enabled\n if (showEmBranco && data.emBranco !== undefined) {\n barItems.push({\n key: 'emBranco',\n label: 'Em branco',\n legendLabel: 'Questões em branco',\n value: data.emBranco,\n colorClass: BAR_COLORS.emBranco,\n });\n }\n\n return (\n <div\n className={cn(\n 'flex flex-col p-5 gap-4 bg-background border border-border-50 rounded-xl',\n className\n )}\n {...props}\n >\n {/* Header */}\n <Text\n as=\"h3\"\n size=\"lg\"\n weight=\"bold\"\n className=\"text-text-950 tracking-[0.2px]\"\n >\n {title}\n </Text>\n\n {/* Legend */}\n <div className=\"flex flex-row flex-wrap gap-x-6 gap-y-2 mb-4\">\n {barItems.map((item) => (\n <LegendItem\n key={item.key}\n color={BAR_COLORS[item.key as keyof typeof BAR_COLORS]}\n label={item.legendLabel}\n />\n ))}\n </div>\n\n {/* Chart */}\n <div className=\"flex flex-row\" aria-label={chartDescription}>\n {/* Y-Axis */}\n <YAxis ticks={yAxisTicks} chartHeight={chartHeight} />\n\n {/* Spacer between Y-axis and chart */}\n <div className=\"w-4\" />\n\n {/* Chart area with grid and bars */}\n <div className=\"flex-1 relative\">\n {/* Grid lines */}\n <GridLines ticks={yAxisTicks} chartHeight={chartHeight} />\n\n {/* Bars */}\n <div className=\"flex flex-row flex-1 gap-4 relative z-10\">\n {barItems.map((item) => (\n <DataBar\n key={item.key}\n label={item.label}\n value={item.value}\n maxValue={adjustedMaxValue}\n colorClass={item.colorClass}\n chartHeight={chartHeight}\n />\n ))}\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default QuestionsData;\n"],"mappings":";AAAA,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACsHI;AA/CJ,IAAM,OAAO,CAA8B;AAAA,EACzC;AAAA,EACA,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR;AAAA,EACA,YAAY;AAAA,EACZ,GAAG;AACL,MAAoB;AAClB,MAAI,cAAc;AAClB,MAAI,gBAAgB;AAGpB,Q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,wBAAAA;AAAA,UAAC;AAAA;AAAA,YACC,IAAG;AAAA,YACH,MAAK;AAAA,YACL,QAAO;AAAA,YACP,WAAU;AAAA,YAET;AAAA;AAAA,QACH;AAAA,QAGA,gBAAAA,KAAC,SAAI,WAAU,gDACZ,mBAAS,IAAI,CAAC,SACb,gBAAAA;AAAA,UAAC;AAAA;AAAA,YAEC,OAAO,WAAW,KAAK,GAA8B;AAAA,YACrD,OAAO,KAAK;AAAA;AAAA,UAFP,KAAK;AAAA,QAGZ,CACD,GACH;AAAA,QAGA,qBAAC,SAAI,WAAU,iBAAgB,cAAY,kBAEzC;AAAA,0BAAAA,KAAC,SAAM,OAAO,YAAY,aAA0B;AAAA,UAGpD,gBAAAA,KAAC,SAAI,WAAU,OAAM;AAAA,UAGrB,qBAAC,SAAI,WAAU,mBAEb;AAAA,4BAAAA,KAAC,aAAU,OAAO,YAAY,aAA0B;AAAA,YAGxD,gBAAAA,KAAC,SAAI,WAAU,4CACZ,mBAAS,IAAI,CAAC,SACb,gBAAAA;AAAA,cAAC;AAAA;AAAA,gBAEC,OAAO,KAAK;AAAA,gBACZ,OAAO,KAAK;AAAA,gBACZ,UAAU;AAAA,gBACV,YAAY,KAAK;AAAA,gBACjB;AAAA;AAAA,cALK,KAAK;AAAA,YAMZ,CACD,GACH;AAAA,aACF;AAAA,WACF;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,wBAAQ;","names":["jsx"]}
|
|
1
|
+
{"version":3,"sources":["../../src/utils/utils.ts","../../src/components/Text/Text.tsx","../../src/components/QuestionsData/QuestionsData.tsx"],"sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport { syncDropdownState } from './dropdown';\nexport {\n getSelectedIdsFromCategories,\n toggleArrayItem,\n toggleSingleValue,\n areFiltersEqual,\n} from './activityFilters';\nexport {\n mapQuestionTypeToEnum,\n mapQuestionTypeToEnumRequired,\n} from './questionTypeUtils';\nexport {\n getStatusBadgeConfig,\n formatTimeSpent,\n formatQuestionNumbers,\n formatDateToBrazilian,\n} from './activityDetailsUtils';\n\n/**\n * Retorna a cor hexadecimal com opacidade 0.3 (4d) se não estiver em dark mode.\n * Se estiver em dark mode, retorna a cor original.\n *\n * @param hexColor - Cor hexadecimal (ex: \"#0066b8\" ou \"0066b8\")\n * @param isDark - booleano indicando se está em dark mode\n * @returns string - cor hexadecimal com opacidade se necessário\n */\nexport function getSubjectColorWithOpacity(\n hexColor: string | undefined,\n isDark: boolean\n): string | undefined {\n if (!hexColor) return undefined;\n // Remove o '#' se existir\n let color = hexColor.replace(/^#/, '').toLowerCase();\n\n if (isDark) {\n // Se está em dark mode, sempre remove opacidade se existir\n if (color.length === 8) {\n color = color.slice(0, 6);\n }\n return `#${color}`;\n } else {\n // Se não está em dark mode (light mode)\n let resultColor: string;\n if (color.length === 6) {\n // Adiciona opacidade 0.3 (4D) para cores de 6 dígitos\n resultColor = `#${color}4d`;\n } else if (color.length === 8) {\n // Já tem opacidade, retorna como está\n resultColor = `#${color}`;\n } else {\n // Para outros tamanhos (3, 4, 5 dígitos), retorna como está\n resultColor = `#${color}`;\n }\n return resultColor;\n }\n}\n","import { ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';\nimport { cn } from '../../utils/utils';\n\n/**\n * Base text component props\n */\ntype BaseTextProps = {\n /** Content to be displayed */\n children?: ReactNode;\n /** Text size variant */\n size?:\n | '2xs'\n | 'xs'\n | 'sm'\n | 'md'\n | 'lg'\n | 'xl'\n | '2xl'\n | '3xl'\n | '4xl'\n | '5xl'\n | '6xl';\n /** Font weight variant */\n weight?:\n | 'hairline'\n | 'light'\n | 'normal'\n | 'medium'\n | 'semibold'\n | 'bold'\n | 'extrabold'\n | 'black';\n /** Color variant - white for light backgrounds, black for dark backgrounds */\n color?: string;\n /** Additional CSS classes to apply */\n className?: string;\n};\n\n/**\n * Polymorphic text component props that ensures type safety based on the 'as' prop\n */\ntype TextProps<T extends ElementType = 'p'> = BaseTextProps & {\n /** HTML tag to render */\n as?: T;\n} & Omit<ComponentPropsWithoutRef<T>, keyof BaseTextProps>;\n\n/**\n * Text component for Analytica Ensino platforms\n *\n * A flexible polymorphic text component with multiple sizes, weights, and colors.\n * Automatically adapts to dark and light themes with full type safety.\n *\n * @param children - The content to display\n * @param size - The text size variant (2xs, xs, sm, md, lg, xl, 2xl, 3xl, 4xl, 5xl, 6xl)\n * @param weight - The font weight variant (hairline, light, normal, medium, semibold, bold, extrabold, black)\n * @param color - The color variant - adapts to theme\n * @param as - The HTML tag to render - determines allowed attributes via TypeScript\n * @param className - Additional CSS classes\n * @param props - HTML attributes valid for the chosen tag only\n * @returns A styled text element with type-safe attributes\n *\n * @example\n * ```tsx\n * <Text size=\"lg\" weight=\"bold\" color=\"text-info-800\">\n * This is a large, bold text\n * </Text>\n *\n * <Text as=\"a\" href=\"/link\" target=\"_blank\">\n * Link with type-safe anchor attributes\n * </Text>\n *\n * <Text as=\"button\" onClick={handleClick} disabled>\n * Button with type-safe button attributes\n * </Text>\n * ```\n */\nconst Text = <T extends ElementType = 'p'>({\n children,\n size = 'md',\n weight = 'normal',\n color = 'text-text-950',\n as,\n className = '',\n ...props\n}: TextProps<T>) => {\n let sizeClasses = '';\n let weightClasses = '';\n\n // Text size classes mapping\n const sizeClassMap = {\n '2xs': 'text-2xs',\n xs: 'text-xs',\n sm: 'text-sm',\n md: 'text-md',\n lg: 'text-lg',\n xl: 'text-xl',\n '2xl': 'text-2xl',\n '3xl': 'text-3xl',\n '4xl': 'text-4xl',\n '5xl': 'text-5xl',\n '6xl': 'text-6xl',\n } as const;\n\n sizeClasses = sizeClassMap[size] ?? sizeClassMap.md;\n\n // Font weight classes mapping\n const weightClassMap = {\n hairline: 'font-hairline',\n light: 'font-light',\n normal: 'font-normal',\n medium: 'font-medium',\n semibold: 'font-semibold',\n bold: 'font-bold',\n extrabold: 'font-extrabold',\n black: 'font-black',\n } as const;\n\n weightClasses = weightClassMap[weight] ?? weightClassMap.normal;\n\n const baseClasses = 'font-primary';\n const Component = as ?? ('p' as ElementType);\n\n return (\n <Component\n className={cn(baseClasses, sizeClasses, weightClasses, color, className)}\n {...props}\n >\n {children}\n </Component>\n );\n};\n\nexport default Text;\n","import { HTMLAttributes } from 'react';\nimport Text from '../Text/Text';\nimport { cn } from '../../utils/utils';\n\n/**\n * Data structure for questions statistics.\n * Compatible with useQuestionsData hook output (hook data can be passed directly).\n */\nexport interface QuestionsDataItem {\n /** Total number of questions answered */\n total: number;\n /** Number of correct answers */\n corretas: number;\n /** Number of incorrect answers */\n incorretas: number;\n /** Number of blank (unanswered) questions */\n emBranco?: number;\n}\n\n/**\n * Props for the QuestionsData component\n */\nexport interface QuestionsDataProps extends HTMLAttributes<HTMLDivElement> {\n /** Card title */\n title?: string;\n /** Question statistics data */\n data: QuestionsDataItem;\n /** Whether to show blank questions bar */\n showEmBranco?: boolean;\n /** Maximum value for the chart scale (defaults to total) */\n maxValue?: number;\n /** Height of the chart area in pixels */\n chartHeight?: number;\n}\n\n/**\n * Bar item configuration\n */\ninterface BarItemConfig {\n key: string;\n label: string;\n legendLabel: string;\n value: number;\n colorClass: string;\n}\n\n/**\n * Color classes for bars and legend dots using design system tokens\n */\nconst BAR_COLORS = {\n total: 'bg-info-600',\n corretas: 'bg-success-200',\n incorretas: 'bg-warning-400',\n emBranco: 'bg-background-300',\n} as const;\n\n/**\n * Calculate Y-axis tick values based on max value\n */\nconst calculateYAxisTicks = (maxValue: number): number[] => {\n if (maxValue <= 0) return [0];\n\n // Round up to nearest \"nice\" number for the max tick\n const niceMax = Math.ceil(maxValue / 10) * 10;\n\n // Generate 5 ticks including 0 and max\n const step = niceMax / 4;\n return [\n niceMax,\n Math.round(step * 3),\n Math.round(step * 2),\n Math.round(step),\n 0,\n ];\n};\n\n/**\n * Legend item component\n */\nconst LegendItem = ({ color, label }: { color: string; label: string }) => (\n <div className=\"flex flex-row items-center gap-2\">\n <div className={cn('w-2 h-2 rounded-full', color)} />\n <Text size=\"xs\" weight=\"medium\" className=\"text-text-600\">\n {label}\n </Text>\n </div>\n);\n\n/**\n * Individual vertical bar component\n */\nconst DataBar = ({\n label,\n value,\n maxValue,\n colorClass,\n chartHeight,\n}: {\n label: string;\n value: number;\n maxValue: number;\n colorClass: string;\n chartHeight: number;\n}) => {\n const percentage = maxValue === 0 ? 0 : (value / maxValue) * 100;\n const barHeight = (percentage / 100) * chartHeight;\n\n return (\n <div className=\"flex flex-col items-center gap-2 flex-1\">\n {/* Bar container */}\n <div\n className=\"w-full flex items-end justify-center\"\n style={{ height: chartHeight }}\n >\n <div\n className={cn(\n 'w-16 rounded-lg transition-all duration-300',\n colorClass\n )}\n style={{ height: `${barHeight}px` }}\n />\n </div>\n\n {/* Label */}\n <Text size=\"xs\" weight=\"medium\" className=\"text-text-600 text-center\">\n {label}\n </Text>\n </div>\n );\n};\n\n/**\n * Grid lines component for the chart background\n */\nconst GridLines = ({\n ticks,\n chartHeight,\n}: {\n ticks: number[];\n chartHeight: number;\n}) => {\n return (\n <div\n className=\"absolute inset-0 flex flex-col justify-between pointer-events-none\"\n style={{ height: chartHeight }}\n >\n {ticks.map((tick, index) => (\n <div\n key={`${tick}-${index}`}\n className=\"w-full border-t border-dashed border-border-200\"\n style={{ marginTop: index === 0 ? 0 : undefined }}\n />\n ))}\n </div>\n );\n};\n\n/**\n * Y-Axis component\n */\nconst YAxis = ({\n ticks,\n chartHeight,\n}: {\n ticks: number[];\n chartHeight: number;\n}) => (\n <div\n className=\"flex flex-col justify-between items-end pr-3\"\n style={{ height: chartHeight }}\n aria-hidden=\"true\"\n >\n {ticks.map((tick, index) => (\n <Text\n key={`${tick}-${index}`}\n size=\"xs\"\n weight=\"medium\"\n className=\"text-text-500\"\n >\n {tick}\n </Text>\n ))}\n </div>\n);\n\n/**\n * QuestionsData component - displays a vertical bar chart showing\n * question statistics (total, correct, incorrect, and optionally blank).\n *\n * @example\n * ```tsx\n * // Basic usage with static data\n * <QuestionsData\n * title=\"Dados de questões\"\n * data={{\n * total: 120,\n * corretas: 80,\n * incorretas: 30,\n * emBranco: 10,\n * }}\n * showEmBranco\n * />\n * ```\n *\n * @example\n * ```tsx\n * // Usage with useQuestionsData hook (direct usage - no transformation needed)\n * const fetchQuestionsData = async (filters) => {\n * const response = await api.get('/performance/questions-data', { params: filters });\n * return response.data;\n * };\n *\n * const useQuestionsData = createUseQuestionsData(fetchQuestionsData);\n *\n * function MyComponent() {\n * const { data, loading, fetchQuestionsData } = useQuestionsData();\n *\n * useEffect(() => {\n * fetchQuestionsData({ period: '30_DAYS' });\n * }, [fetchQuestionsData]);\n *\n * if (loading || !data) return <Skeleton />;\n *\n * return <QuestionsData data={data} showEmBranco />;\n * }\n * ```\n */\nexport const QuestionsData = ({\n title = 'Dados de questões',\n data,\n showEmBranco = false,\n maxValue,\n chartHeight = 180,\n className,\n ...props\n}: QuestionsDataProps) => {\n // Calculate the maximum value for the scale\n const chartMaxValue = maxValue ?? data.total;\n\n // Calculate Y-axis ticks\n const yAxisTicks = calculateYAxisTicks(chartMaxValue);\n const adjustedMaxValue = yAxisTicks[0]; // Use the nice max for calculations\n\n // Build accessible chart description\n const blankSuffix =\n showEmBranco && data.emBranco !== undefined\n ? `, ${data.emBranco} em branco`\n : '';\n const chartDescription = `Gráfico de barras mostrando ${data.total} questões respondidas, ${data.corretas} corretas, ${data.incorretas} incorretas${blankSuffix}`;\n\n // Build bar items configuration\n const barItems: BarItemConfig[] = [\n {\n key: 'total',\n label: 'Total',\n legendLabel: 'Total de questões respondidas',\n value: data.total,\n colorClass: BAR_COLORS.total,\n },\n {\n key: 'corretas',\n label: 'Corretas',\n legendLabel: 'Questões corretas',\n value: data.corretas,\n colorClass: BAR_COLORS.corretas,\n },\n {\n key: 'incorretas',\n label: 'Incorretas',\n legendLabel: 'Questões incorretas',\n value: data.incorretas,\n colorClass: BAR_COLORS.incorretas,\n },\n ];\n\n // Add blank questions bar if enabled\n if (showEmBranco && data.emBranco !== undefined) {\n barItems.push({\n key: 'emBranco',\n label: 'Em branco',\n legendLabel: 'Questões em branco',\n value: data.emBranco,\n colorClass: BAR_COLORS.emBranco,\n });\n }\n\n return (\n <div\n className={cn(\n 'flex flex-col p-5 gap-4 bg-background border border-border-50 rounded-xl',\n className\n )}\n {...props}\n >\n {/* Header */}\n <Text\n as=\"h3\"\n size=\"lg\"\n weight=\"bold\"\n className=\"text-text-950 tracking-[0.2px]\"\n >\n {title}\n </Text>\n\n {/* Legend */}\n <div className=\"flex flex-row flex-wrap gap-x-6 gap-y-2 mb-4\">\n {barItems.map((item) => (\n <LegendItem\n key={item.key}\n color={BAR_COLORS[item.key as keyof typeof BAR_COLORS]}\n label={item.legendLabel}\n />\n ))}\n </div>\n\n {/* Chart */}\n <div className=\"flex flex-row\" aria-label={chartDescription}>\n {/* Y-Axis */}\n <YAxis ticks={yAxisTicks} chartHeight={chartHeight} />\n\n {/* Spacer between Y-axis and chart */}\n <div className=\"w-4\" />\n\n {/* Chart area with grid and bars */}\n <div className=\"flex-1 relative\">\n {/* Grid lines */}\n <GridLines ticks={yAxisTicks} chartHeight={chartHeight} />\n\n {/* Bars */}\n <div className=\"flex flex-row flex-1 gap-4 relative z-10\">\n {barItems.map((item) => (\n <DataBar\n key={item.key}\n label={item.label}\n value={item.value}\n maxValue={adjustedMaxValue}\n colorClass={item.colorClass}\n chartHeight={chartHeight}\n />\n ))}\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default QuestionsData;\n"],"mappings":";AAAA,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACsHI;AA/CJ,IAAM,OAAO,CAA8B;AAAA,EACzC;AAAA,EACA,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR;AAAA,EACA,YAAY;AAAA,EACZ,GAAG;AACL,MAAoB;AAClB,MAAI,cAAc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,MACC,GAAG;AAAA,MAGJ;AAAA,wBAAAA;AAAA,UAAC;AAAA;AAAA,YACC,IAAG;AAAA,YACH,MAAK;AAAA,YACL,QAAO;AAAA,YACP,WAAU;AAAA,YAET;AAAA;AAAA,QACH;AAAA,QAGA,gBAAAA,KAAC,SAAI,WAAU,gDACZ,mBAAS,IAAI,CAAC,SACb,gBAAAA;AAAA,UAAC;AAAA;AAAA,YAEC,OAAO,WAAW,KAAK,GAA8B;AAAA,YACrD,OAAO,KAAK;AAAA;AAAA,UAFP,KAAK;AAAA,QAGZ,CACD,GACH;AAAA,QAGA,qBAAC,SAAI,WAAU,iBAAgB,cAAY,kBAEzC;AAAA,0BAAAA,KAAC,SAAM,OAAO,YAAY,aAA0B;AAAA,UAGpD,gBAAAA,KAAC,SAAI,WAAU,OAAM;AAAA,UAGrB,qBAAC,SAAI,WAAU,mBAEb;AAAA,4BAAAA,KAAC,aAAU,OAAO,YAAY,aAA0B;AAAA,YAGxD,gBAAAA,KAAC,SAAI,WAAU,4CACZ,mBAAS,IAAI,CAAC,SACb,gBAAAA;AAAA,cAAC;AAAA;AAAA,gBAEC,OAAO,KAAK;AAAA,gBACZ,OAAO,KAAK;AAAA,gBACZ,UAAU;AAAA,gBACV,YAAY,KAAK;AAAA,gBACjB;AAAA;AAAA,cALK,KAAK;AAAA,YAMZ,CACD,GACH;AAAA,aACF;AAAA,WACF;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,wBAAQ;","names":["jsx"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { RecommendedLessonsHistory, default,
|
|
1
|
+
export { RecommendedLessonsHistory, default, RecommendedClassPageTab, type RecommendedLessonsHistoryProps, } from './RecommendedLessonsHistory';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/RecommendedLessonsHistory/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,OAAO,EACP,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/RecommendedLessonsHistory/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,OAAO,EACP,uBAAuB,EACvB,KAAK,8BAA8B,GACpC,MAAM,6BAA6B,CAAC"}
|