analytica-frontend-lib 1.2.44 → 1.2.45

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 (134) hide show
  1. package/dist/Accordation/index.js.map +1 -1
  2. package/dist/Accordation/index.mjs.map +1 -1
  3. package/dist/ActivityCardQuestionBanks/index.js.map +1 -1
  4. package/dist/ActivityCardQuestionBanks/index.mjs.map +1 -1
  5. package/dist/ActivityCardQuestionPreview/index.js.map +1 -1
  6. package/dist/ActivityCardQuestionPreview/index.mjs.map +1 -1
  7. package/dist/ActivityDetails/index.d.ts.map +1 -1
  8. package/dist/ActivityDetails/index.js +59 -50
  9. package/dist/ActivityDetails/index.js.map +1 -1
  10. package/dist/ActivityDetails/index.mjs +59 -50
  11. package/dist/ActivityDetails/index.mjs.map +1 -1
  12. package/dist/ActivityFilters/index.js.map +1 -1
  13. package/dist/ActivityFilters/index.mjs.map +1 -1
  14. package/dist/ActivityPreview/index.js.map +1 -1
  15. package/dist/ActivityPreview/index.mjs.map +1 -1
  16. package/dist/Alert/index.js.map +1 -1
  17. package/dist/Alert/index.mjs.map +1 -1
  18. package/dist/AlertDialog/index.js.map +1 -1
  19. package/dist/AlertDialog/index.mjs.map +1 -1
  20. package/dist/AlertManager/index.js.map +1 -1
  21. package/dist/AlertManager/index.mjs.map +1 -1
  22. package/dist/AlertManagerView/index.js.map +1 -1
  23. package/dist/AlertManagerView/index.mjs.map +1 -1
  24. package/dist/Alternative/index.js.map +1 -1
  25. package/dist/Alternative/index.mjs.map +1 -1
  26. package/dist/Badge/index.js.map +1 -1
  27. package/dist/Badge/index.mjs.map +1 -1
  28. package/dist/BreadcrumbMenu/index.js.map +1 -1
  29. package/dist/BreadcrumbMenu/index.mjs.map +1 -1
  30. package/dist/Button/index.js.map +1 -1
  31. package/dist/Button/index.mjs.map +1 -1
  32. package/dist/Calendar/index.js.map +1 -1
  33. package/dist/Calendar/index.mjs.map +1 -1
  34. package/dist/Card/index.js.map +1 -1
  35. package/dist/Card/index.mjs.map +1 -1
  36. package/dist/CheckBox/index.js.map +1 -1
  37. package/dist/CheckBox/index.mjs.map +1 -1
  38. package/dist/Chips/index.js.map +1 -1
  39. package/dist/Chips/index.mjs.map +1 -1
  40. package/dist/CorrectActivityModal/index.js.map +1 -1
  41. package/dist/CorrectActivityModal/index.mjs.map +1 -1
  42. package/dist/Divider/index.js.map +1 -1
  43. package/dist/Divider/index.mjs.map +1 -1
  44. package/dist/DownloadButton/index.js.map +1 -1
  45. package/dist/DownloadButton/index.mjs.map +1 -1
  46. package/dist/DropdownMenu/index.js.map +1 -1
  47. package/dist/DropdownMenu/index.mjs.map +1 -1
  48. package/dist/EmptyState/index.js.map +1 -1
  49. package/dist/EmptyState/index.mjs.map +1 -1
  50. package/dist/FileAttachment/index.js.map +1 -1
  51. package/dist/FileAttachment/index.mjs.map +1 -1
  52. package/dist/IconButton/index.js.map +1 -1
  53. package/dist/IconButton/index.mjs.map +1 -1
  54. package/dist/IconRoundedButton/index.js.map +1 -1
  55. package/dist/IconRoundedButton/index.mjs.map +1 -1
  56. package/dist/LatexRenderer/index.js.map +1 -1
  57. package/dist/LatexRenderer/index.mjs.map +1 -1
  58. package/dist/Menu/index.js.map +1 -1
  59. package/dist/Menu/index.mjs.map +1 -1
  60. package/dist/Modal/index.js.map +1 -1
  61. package/dist/Modal/index.mjs.map +1 -1
  62. package/dist/MultipleChoice/index.js.map +1 -1
  63. package/dist/MultipleChoice/index.mjs.map +1 -1
  64. package/dist/NavButton/index.js.map +1 -1
  65. package/dist/NavButton/index.mjs.map +1 -1
  66. package/dist/NoSearchResult/index.js.map +1 -1
  67. package/dist/NoSearchResult/index.mjs.map +1 -1
  68. package/dist/NotFound/index.js.map +1 -1
  69. package/dist/NotFound/index.mjs.map +1 -1
  70. package/dist/NotificationCard/index.js.map +1 -1
  71. package/dist/NotificationCard/index.mjs.map +1 -1
  72. package/dist/ProgressBar/index.js.map +1 -1
  73. package/dist/ProgressBar/index.mjs.map +1 -1
  74. package/dist/ProgressCircle/index.js.map +1 -1
  75. package/dist/ProgressCircle/index.mjs.map +1 -1
  76. package/dist/Quiz/index.js.map +1 -1
  77. package/dist/Quiz/index.mjs.map +1 -1
  78. package/dist/Radio/index.js.map +1 -1
  79. package/dist/Radio/index.mjs.map +1 -1
  80. package/dist/Search/index.js.map +1 -1
  81. package/dist/Search/index.mjs.map +1 -1
  82. package/dist/Select/index.js.map +1 -1
  83. package/dist/Select/index.mjs.map +1 -1
  84. package/dist/SelectionButton/index.js.map +1 -1
  85. package/dist/SelectionButton/index.mjs.map +1 -1
  86. package/dist/SendActivityModal/index.js.map +1 -1
  87. package/dist/SendActivityModal/index.mjs.map +1 -1
  88. package/dist/Skeleton/index.js.map +1 -1
  89. package/dist/Skeleton/index.mjs.map +1 -1
  90. package/dist/StatisticsCard/index.js.map +1 -1
  91. package/dist/StatisticsCard/index.mjs.map +1 -1
  92. package/dist/Stepper/index.js.map +1 -1
  93. package/dist/Stepper/index.mjs.map +1 -1
  94. package/dist/Support/TicketModal/index.js.map +1 -1
  95. package/dist/Support/TicketModal/index.mjs.map +1 -1
  96. package/dist/Support/index.js.map +1 -1
  97. package/dist/Support/index.mjs.map +1 -1
  98. package/dist/Table/TablePagination/index.js.map +1 -1
  99. package/dist/Table/TablePagination/index.mjs.map +1 -1
  100. package/dist/Table/index.js.map +1 -1
  101. package/dist/Table/index.mjs.map +1 -1
  102. package/dist/TableProvider/index.js.map +1 -1
  103. package/dist/TableProvider/index.mjs.map +1 -1
  104. package/dist/Text/index.js.map +1 -1
  105. package/dist/Text/index.mjs.map +1 -1
  106. package/dist/TextArea/index.js.map +1 -1
  107. package/dist/TextArea/index.mjs.map +1 -1
  108. package/dist/ThemeToggle/index.js.map +1 -1
  109. package/dist/ThemeToggle/index.mjs.map +1 -1
  110. package/dist/Toast/Toaster/index.js.map +1 -1
  111. package/dist/Toast/Toaster/index.mjs.map +1 -1
  112. package/dist/Toast/index.js.map +1 -1
  113. package/dist/Toast/index.mjs.map +1 -1
  114. package/dist/VideoPlayer/index.js.map +1 -1
  115. package/dist/VideoPlayer/index.mjs.map +1 -1
  116. package/dist/Whiteboard/index.js.map +1 -1
  117. package/dist/Whiteboard/index.mjs.map +1 -1
  118. package/dist/index.d.ts +2 -1
  119. package/dist/index.d.ts.map +1 -1
  120. package/dist/index.js +62 -55
  121. package/dist/index.js.map +1 -1
  122. package/dist/index.mjs +62 -55
  123. package/dist/index.mjs.map +1 -1
  124. package/dist/types/activityDetails.d.ts +0 -24
  125. package/dist/types/activityDetails.d.ts.map +1 -1
  126. package/dist/utils/activityDetailsUtils.d.ts +30 -0
  127. package/dist/utils/activityDetailsUtils.d.ts.map +1 -0
  128. package/dist/utils/index.d.ts +1 -0
  129. package/dist/utils/index.d.ts.map +1 -1
  130. package/dist/utils/index.js +65 -0
  131. package/dist/utils/index.js.map +1 -1
  132. package/dist/utils/index.mjs +61 -0
  133. package/dist/utils/index.mjs.map +1 -1
  134. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/Alert/Alert.tsx","../../src/utils/utils.ts","../../src/components/Text/Text.tsx"],"sourcesContent":["import { HTMLAttributes } from 'react';\nimport { CheckCircle, Info, WarningCircle, XCircle } from 'phosphor-react';\nimport Text from '../Text/Text';\nimport { cn } from '../../utils/utils';\n\ntype AlertProps = {\n title?: string;\n description: string;\n variant?: 'solid' | 'outline';\n action?: 'default' | 'info' | 'success' | 'warning' | 'error';\n className?: string;\n} & HTMLAttributes<HTMLDivElement>;\n\nconst VARIANT_ACTION_CLASSES = {\n solid: {\n default: 'bg-background-50 border-transparent',\n info: 'bg-info border-transparent',\n success: 'bg-success border-transparent',\n warning: 'bg-warning border-transparent',\n error: 'bg-error border-transparent',\n },\n outline: {\n default: 'bg-background border border-border-100',\n info: 'bg-background border border-border-100',\n success: 'bg-background border border-border-100',\n warning: 'bg-background border border-border-100',\n error: 'bg-background border border-border-100',\n },\n} as const;\n\nconst COLOR_CLASSES = {\n default: 'text-text-950',\n info: 'text-info-800',\n success: 'text-success-800',\n warning: 'text-warning-800',\n error: 'text-error-800',\n} as const;\n\nconst ICONS = {\n default: <CheckCircle size={18} />,\n info: <Info size={18} />,\n success: <CheckCircle size={18} />,\n warning: <WarningCircle size={18} />,\n error: <XCircle size={18} />,\n} as const;\n\nconst Alert = ({\n variant = 'solid',\n title,\n description,\n action = 'default',\n className,\n ...props\n}: AlertProps) => {\n const baseClasses =\n 'alert-wrapper flex items-start gap-2 w-[384px] py-3 px-4 font-inherit rounded-md';\n const variantClasses = VARIANT_ACTION_CLASSES[variant][action];\n const variantColor = COLOR_CLASSES[action];\n const variantIcon = ICONS[action];\n const hasHeading = Boolean(title);\n\n return (\n <div className={cn(baseClasses, variantClasses, className)} {...props}>\n <span className={cn('mt-0.5', variantColor)}>{variantIcon}</span>\n <div>\n {hasHeading && (\n <Text\n size=\"md\"\n weight=\"medium\"\n color={variantColor}\n className=\"mb-0.5\"\n >\n {title}\n </Text>\n )}\n <Text\n size={hasHeading ? 'sm' : 'md'}\n weight=\"normal\"\n color={!hasHeading ? variantColor : 'text-text-700'}\n >\n {description}\n </Text>\n </div>\n </div>\n );\n};\n\nexport default Alert;\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} from './activityFilters';\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;AACA,4BAA0D;;;ACD1D,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACsHI;AA/CJ,IAAM,OAAO,CAA8B;AAAA,E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AA,EACZ,SAAS,6CAAC,qCAAY,MAAM,IAAI;AAAA,EAChC,MAAM,6CAAC,8BAAK,MAAM,IAAI;AAAA,EACtB,SAAS,6CAAC,qCAAY,MAAM,IAAI;AAAA,EAChC,SAAS,6CAAC,uCAAc,MAAM,IAAI;AAAA,EAClC,OAAO,6CAAC,iCAAQ,MAAM,IAAI;AAC5B;AAEA,IAAM,QAAQ,CAAC;AAAA,EACb,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA,GAAG;AACL,MAAkB;AAChB,QAAM,cACJ;AACF,QAAM,iBAAiB,uBAAuB,OAAO,EAAE,MAAM;AAC7D,QAAM,eAAe,cAAc,MAAM;AACzC,QAAM,cAAc,MAAM,MAAM;AAChC,QAAM,aAAa,QAAQ,KAAK;AAEhC,SACE,8CAAC,SAAI,WAAW,GAAG,aAAa,gBAAgB,SAAS,GAAI,GAAG,OAC9D;AAAA,iDAAC,UAAK,WAAW,GAAG,UAAU,YAAY,GAAI,uBAAY;AAAA,IAC1D,8CAAC,SACE;AAAA,oBACC;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,QAAO;AAAA,UACP,OAAO;AAAA,UACP,WAAU;AAAA,UAET;AAAA;AAAA,MACH;AAAA,MAEF;AAAA,QAAC;AAAA;AAAA,UACC,MAAM,aAAa,OAAO;AAAA,UAC1B,QAAO;AAAA,UACP,OAAO,CAAC,aAAa,eAAe;AAAA,UAEnC;AAAA;AAAA,MACH;AAAA,OACF;AAAA,KACF;AAEJ;AAEA,IAAO,gBAAQ;","names":["import_jsx_runtime"]}
1
+ {"version":3,"sources":["../../src/components/Alert/Alert.tsx","../../src/utils/utils.ts","../../src/components/Text/Text.tsx"],"sourcesContent":["import { HTMLAttributes } from 'react';\nimport { CheckCircle, Info, WarningCircle, XCircle } from 'phosphor-react';\nimport Text from '../Text/Text';\nimport { cn } from '../../utils/utils';\n\ntype AlertProps = {\n title?: string;\n description: string;\n variant?: 'solid' | 'outline';\n action?: 'default' | 'info' | 'success' | 'warning' | 'error';\n className?: string;\n} & HTMLAttributes<HTMLDivElement>;\n\nconst VARIANT_ACTION_CLASSES = {\n solid: {\n default: 'bg-background-50 border-transparent',\n info: 'bg-info border-transparent',\n success: 'bg-success border-transparent',\n warning: 'bg-warning border-transparent',\n error: 'bg-error border-transparent',\n },\n outline: {\n default: 'bg-background border border-border-100',\n info: 'bg-background border border-border-100',\n success: 'bg-background border border-border-100',\n warning: 'bg-background border border-border-100',\n error: 'bg-background border border-border-100',\n },\n} as const;\n\nconst COLOR_CLASSES = {\n default: 'text-text-950',\n info: 'text-info-800',\n success: 'text-success-800',\n warning: 'text-warning-800',\n error: 'text-error-800',\n} as const;\n\nconst ICONS = {\n default: <CheckCircle size={18} />,\n info: <Info size={18} />,\n success: <CheckCircle size={18} />,\n warning: <WarningCircle size={18} />,\n error: <XCircle size={18} />,\n} as const;\n\nconst Alert = ({\n variant = 'solid',\n title,\n description,\n action = 'default',\n className,\n ...props\n}: AlertProps) => {\n const baseClasses =\n 'alert-wrapper flex items-start gap-2 w-[384px] py-3 px-4 font-inherit rounded-md';\n const variantClasses = VARIANT_ACTION_CLASSES[variant][action];\n const variantColor = COLOR_CLASSES[action];\n const variantIcon = ICONS[action];\n const hasHeading = Boolean(title);\n\n return (\n <div className={cn(baseClasses, variantClasses, className)} {...props}>\n <span className={cn('mt-0.5', variantColor)}>{variantIcon}</span>\n <div>\n {hasHeading && (\n <Text\n size=\"md\"\n weight=\"medium\"\n color={variantColor}\n className=\"mb-0.5\"\n >\n {title}\n </Text>\n )}\n <Text\n size={hasHeading ? 'sm' : 'md'}\n weight=\"normal\"\n color={!hasHeading ? variantColor : 'text-text-700'}\n >\n {description}\n </Text>\n </div>\n </div>\n );\n};\n\nexport default Alert;\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} from './activityFilters';\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;AACA,4BAA0D;;;ACD1D,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,MA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AA;AAAA,MACH;AAAA,MAEF;AAAA,QAAC;AAAA;AAAA,UACC,MAAM,aAAa,OAAO;AAAA,UAC1B,QAAO;AAAA,UACP,OAAO,CAAC,aAAa,eAAe;AAAA,UAEnC;AAAA;AAAA,MACH;AAAA,OACF;AAAA,KACF;AAEJ;AAEA,IAAO,gBAAQ;","names":["import_jsx_runtime"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/Alert/Alert.tsx","../../src/utils/utils.ts","../../src/components/Text/Text.tsx"],"sourcesContent":["import { HTMLAttributes } from 'react';\nimport { CheckCircle, Info, WarningCircle, XCircle } from 'phosphor-react';\nimport Text from '../Text/Text';\nimport { cn } from '../../utils/utils';\n\ntype AlertProps = {\n title?: string;\n description: string;\n variant?: 'solid' | 'outline';\n action?: 'default' | 'info' | 'success' | 'warning' | 'error';\n className?: string;\n} & HTMLAttributes<HTMLDivElement>;\n\nconst VARIANT_ACTION_CLASSES = {\n solid: {\n default: 'bg-background-50 border-transparent',\n info: 'bg-info border-transparent',\n success: 'bg-success border-transparent',\n warning: 'bg-warning border-transparent',\n error: 'bg-error border-transparent',\n },\n outline: {\n default: 'bg-background border border-border-100',\n info: 'bg-background border border-border-100',\n success: 'bg-background border border-border-100',\n warning: 'bg-background border border-border-100',\n error: 'bg-background border border-border-100',\n },\n} as const;\n\nconst COLOR_CLASSES = {\n default: 'text-text-950',\n info: 'text-info-800',\n success: 'text-success-800',\n warning: 'text-warning-800',\n error: 'text-error-800',\n} as const;\n\nconst ICONS = {\n default: <CheckCircle size={18} />,\n info: <Info size={18} />,\n success: <CheckCircle size={18} />,\n warning: <WarningCircle size={18} />,\n error: <XCircle size={18} />,\n} as const;\n\nconst Alert = ({\n variant = 'solid',\n title,\n description,\n action = 'default',\n className,\n ...props\n}: AlertProps) => {\n const baseClasses =\n 'alert-wrapper flex items-start gap-2 w-[384px] py-3 px-4 font-inherit rounded-md';\n const variantClasses = VARIANT_ACTION_CLASSES[variant][action];\n const variantColor = COLOR_CLASSES[action];\n const variantIcon = ICONS[action];\n const hasHeading = Boolean(title);\n\n return (\n <div className={cn(baseClasses, variantClasses, className)} {...props}>\n <span className={cn('mt-0.5', variantColor)}>{variantIcon}</span>\n <div>\n {hasHeading && (\n <Text\n size=\"md\"\n weight=\"medium\"\n color={variantColor}\n className=\"mb-0.5\"\n >\n {title}\n </Text>\n )}\n <Text\n size={hasHeading ? 'sm' : 'md'}\n weight=\"normal\"\n color={!hasHeading ? variantColor : 'text-text-700'}\n >\n {description}\n </Text>\n </div>\n </div>\n );\n};\n\nexport default Alert;\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} from './activityFilters';\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":";AACA,SAAS,aAAa,MAAM,eAAe,eAAe;;;ACD1D,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,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;AA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M,iBAAiB,uBAAuB,OAAO,EAAE,MAAM;AAC7D,QAAM,eAAe,cAAc,MAAM;AACzC,QAAM,cAAc,MAAM,MAAM;AAChC,QAAM,aAAa,QAAQ,KAAK;AAEhC,SACE,qBAAC,SAAI,WAAW,GAAG,aAAa,gBAAgB,SAAS,GAAI,GAAG,OAC9D;AAAA,oBAAAA,KAAC,UAAK,WAAW,GAAG,UAAU,YAAY,GAAI,uBAAY;AAAA,IAC1D,qBAAC,SACE;AAAA,oBACC,gBAAAA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,QAAO;AAAA,UACP,OAAO;AAAA,UACP,WAAU;AAAA,UAET;AAAA;AAAA,MACH;AAAA,MAEF,gBAAAA;AAAA,QAAC;AAAA;AAAA,UACC,MAAM,aAAa,OAAO;AAAA,UAC1B,QAAO;AAAA,UACP,OAAO,CAAC,aAAa,eAAe;AAAA,UAEnC;AAAA;AAAA,MACH;AAAA,OACF;AAAA,KACF;AAEJ;AAEA,IAAO,gBAAQ;","names":["jsx"]}
1
+ {"version":3,"sources":["../../src/components/Alert/Alert.tsx","../../src/utils/utils.ts","../../src/components/Text/Text.tsx"],"sourcesContent":["import { HTMLAttributes } from 'react';\nimport { CheckCircle, Info, WarningCircle, XCircle } from 'phosphor-react';\nimport Text from '../Text/Text';\nimport { cn } from '../../utils/utils';\n\ntype AlertProps = {\n title?: string;\n description: string;\n variant?: 'solid' | 'outline';\n action?: 'default' | 'info' | 'success' | 'warning' | 'error';\n className?: string;\n} & HTMLAttributes<HTMLDivElement>;\n\nconst VARIANT_ACTION_CLASSES = {\n solid: {\n default: 'bg-background-50 border-transparent',\n info: 'bg-info border-transparent',\n success: 'bg-success border-transparent',\n warning: 'bg-warning border-transparent',\n error: 'bg-error border-transparent',\n },\n outline: {\n default: 'bg-background border border-border-100',\n info: 'bg-background border border-border-100',\n success: 'bg-background border border-border-100',\n warning: 'bg-background border border-border-100',\n error: 'bg-background border border-border-100',\n },\n} as const;\n\nconst COLOR_CLASSES = {\n default: 'text-text-950',\n info: 'text-info-800',\n success: 'text-success-800',\n warning: 'text-warning-800',\n error: 'text-error-800',\n} as const;\n\nconst ICONS = {\n default: <CheckCircle size={18} />,\n info: <Info size={18} />,\n success: <CheckCircle size={18} />,\n warning: <WarningCircle size={18} />,\n error: <XCircle size={18} />,\n} as const;\n\nconst Alert = ({\n variant = 'solid',\n title,\n description,\n action = 'default',\n className,\n ...props\n}: AlertProps) => {\n const baseClasses =\n 'alert-wrapper flex items-start gap-2 w-[384px] py-3 px-4 font-inherit rounded-md';\n const variantClasses = VARIANT_ACTION_CLASSES[variant][action];\n const variantColor = COLOR_CLASSES[action];\n const variantIcon = ICONS[action];\n const hasHeading = Boolean(title);\n\n return (\n <div className={cn(baseClasses, variantClasses, className)} {...props}>\n <span className={cn('mt-0.5', variantColor)}>{variantIcon}</span>\n <div>\n {hasHeading && (\n <Text\n size=\"md\"\n weight=\"medium\"\n color={variantColor}\n className=\"mb-0.5\"\n >\n {title}\n </Text>\n )}\n <Text\n size={hasHeading ? 'sm' : 'md'}\n weight=\"normal\"\n color={!hasHeading ? variantColor : 'text-text-700'}\n >\n {description}\n </Text>\n </div>\n </div>\n );\n};\n\nexport default Alert;\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} from './activityFilters';\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":";AACA,SAAS,aAAa,MAAM,eAAe,eAAe;;;ACD1D,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAA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AAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACT;AAEA,IAAM,QAAQ;AAAA,EACZ,SAAS,gBAAAA,KAAC,eAAY,MAAM,IAAI;AAAA,EAChC,MAAM,gBAAAA,KAAC,QAAK,MAAM,IAAI;AAAA,EACtB,SAAS,gBAAAA,KAAC,eAAY,MAAM,IAAI;AAAA,EAChC,SAAS,gBAAAA,KAAC,iBAAc,MAAM,IAAI;AAAA,EAClC,OAAO,gBAAAA,KAAC,WAAQ,MAAM,IAAI;AAC5B;AAEA,IAAM,QAAQ,CAAC;AAAA,EACb,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA,GAAG;AACL,MAAkB;AAChB,QAAM,cACJ;AACF,QAAM,iBAAiB,uBAAuB,OAAO,EAAE,MAAM;AAC7D,QAAM,eAAe,cAAc,MAAM;AACzC,QAAM,cAAc,MAAM,MAAM;AAChC,QAAM,aAAa,QAAQ,KAAK;AAEhC,SACE,qBAAC,SAAI,WAAW,GAAG,aAAa,gBAAgB,SAAS,GAAI,GAAG,OAC9D;AAAA,oBAAAA,KAAC,UAAK,WAAW,GAAG,UAAU,YAAY,GAAI,uBAAY;AAAA,IAC1D,qBAAC,SACE;AAAA,oBACC,gBAAAA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,QAAO;AAAA,UACP,OAAO;AAAA,UACP,WAAU;AAAA,UAET;AAAA;AAAA,MACH;AAAA,MAEF,gBAAAA;AAAA,QAAC;AAAA;AAAA,UACC,MAAM,aAAa,OAAO;AAAA,UAC1B,QAAO;AAAA,UACP,OAAO,CAAC,aAAa,eAAe;AAAA,UAEnC;AAAA;AAAA,MACH;AAAA,OACF;AAAA,KACF;AAEJ;AAEA,IAAO,gBAAQ;","names":["jsx"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/AlertDialog/AlertDialog.tsx","../../src/utils/utils.ts","../../src/components/Button/Button.tsx"],"sourcesContent":["import {\n forwardRef,\n HTMLAttributes,\n useEffect,\n MouseEvent,\n KeyboardEvent,\n} from 'react';\nimport Button from '../Button/Button';\nimport { cn } from '../../utils/utils';\n\n/**\n * Lookup table for size classes\n */\nconst SIZE_CLASSES = {\n 'extra-small': 'w-screen max-w-[324px]',\n small: 'w-screen max-w-[378px]',\n medium: 'w-screen max-w-[459px]',\n large: 'w-screen max-w-[578px]',\n 'extra-large': 'w-screen max-w-[912px]',\n} as const;\n\ninterface AlertDialogProps extends HTMLAttributes<HTMLDivElement> {\n /** Title of the alert dialog */\n title: string;\n /** Whether the alert dialog is open (controlled mode) */\n isOpen: boolean;\n /** Function called when the alert dialog is opened or closed (controlled mode) */\n onChangeOpen: (open: boolean) => void;\n /** Whether clicking the backdrop should close the alert dialog */\n closeOnBackdropClick?: boolean;\n /** Whether pressing Escape should close the alert dialog */\n closeOnEscape?: boolean;\n /** Additional CSS classes for the alert dialog content */\n className?: string;\n /** Function called when submit button is clicked */\n onSubmit?: (value?: unknown) => void;\n /** Value to pass to onSubmit function */\n submitValue?: unknown;\n /** Function called when cancel button is clicked */\n onCancel?: (value?: unknown) => void;\n /** Value to pass to onCancel function */\n cancelValue?: unknown;\n /** Description of the alert dialog */\n description: string;\n /** Label of the cancel button */\n cancelButtonLabel?: string;\n /** Label of the submit button */\n submitButtonLabel?: string;\n /** Size of the alert dialog */\n size?: 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';\n}\n\nconst AlertDialog = forwardRef<HTMLDivElement, AlertDialogProps>(\n (\n {\n description,\n cancelButtonLabel = 'Cancelar',\n submitButtonLabel = 'Deletar',\n title,\n isOpen,\n closeOnBackdropClick = true,\n closeOnEscape = true,\n className = '',\n onSubmit,\n onChangeOpen,\n submitValue,\n onCancel,\n cancelValue,\n size = 'medium',\n ...props\n },\n ref\n ) => {\n // Handle escape key\n useEffect(() => {\n if (!isOpen || !closeOnEscape) return;\n\n const handleEscape = (event: globalThis.KeyboardEvent) => {\n if (event.key === 'Escape') {\n onChangeOpen(false);\n }\n };\n\n document.addEventListener('keydown', handleEscape);\n return () => document.removeEventListener('keydown', handleEscape);\n }, [isOpen, closeOnEscape]);\n\n // Prevent body scroll when modal is open\n useEffect(() => {\n if (isOpen) {\n document.body.style.overflow = 'hidden';\n } else {\n document.body.style.overflow = 'unset';\n }\n\n return () => {\n document.body.style.overflow = 'unset';\n };\n }, [isOpen]);\n\n const handleBackdropClick = (event: MouseEvent<HTMLDivElement>) => {\n if (event.target === event.currentTarget && closeOnBackdropClick) {\n onChangeOpen(false);\n }\n };\n\n const handleBackdropKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape' && closeOnEscape) {\n onChangeOpen(false);\n }\n };\n\n const handleSubmit = () => {\n onChangeOpen(false);\n onSubmit?.(submitValue);\n };\n\n const handleCancel = () => {\n onChangeOpen(false);\n onCancel?.(cancelValue);\n };\n\n const sizeClasses = SIZE_CLASSES[size];\n\n return (\n <>\n {/* Alert Dialog Overlay */}\n {isOpen && (\n <div\n className=\"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm\"\n onClick={handleBackdropClick}\n onKeyDown={handleBackdropKeyDown}\n data-testid=\"alert-dialog-overlay\"\n >\n {/* Alert Dialog Content */}\n <div\n ref={ref}\n className={cn(\n 'bg-background border border-border-100 rounded-lg shadow-lg p-6 m-3',\n sizeClasses,\n className\n )}\n {...props}\n >\n <h2\n id=\"alert-dialog-title\"\n className=\"pb-3 text-xl font-semibold text-text-950\"\n >\n {title}\n </h2>\n <p\n id=\"alert-dialog-description\"\n className=\"text-text-700 text-sm\"\n >\n {description}\n </p>\n\n <div className=\"flex flex-row items-center justify-end pt-4 gap-3\">\n <Button variant=\"outline\" size=\"small\" onClick={handleCancel}>\n {cancelButtonLabel}\n </Button>\n\n <Button\n variant=\"solid\"\n size=\"small\"\n action=\"negative\"\n onClick={handleSubmit}\n >\n {submitButtonLabel}\n </Button>\n </div>\n </div>\n </div>\n )}\n </>\n );\n }\n);\n\nAlertDialog.displayName = 'AlertDialog';\n\nexport { AlertDialog };\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} from './activityFilters';\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 { ButtonHTMLAttributes, ReactNode } from 'react';\nimport { cn } from '../../utils/utils';\n\n/**\n * Lookup table for variant and action class combinations\n */\nconst VARIANT_ACTION_CLASSES = {\n solid: {\n primary:\n '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',\n positive:\n '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',\n negative:\n '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',\n },\n outline: {\n primary:\n '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',\n positive:\n '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',\n negative:\n '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',\n },\n link: {\n primary:\n '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',\n positive:\n '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',\n negative:\n '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',\n },\n} as const;\n\n/**\n * Lookup table for size classes\n */\nconst SIZE_CLASSES = {\n 'extra-small': 'text-xs px-3.5 py-2',\n small: 'text-sm px-4 py-2.5',\n medium: 'text-md px-5 py-2.5',\n large: 'text-lg px-6 py-3',\n 'extra-large': 'text-lg px-7 py-3.5',\n} as const;\n\n/**\n * Button component props interface\n */\ntype ButtonProps = {\n /** Content to be displayed inside the button */\n children: ReactNode;\n /** Ícone à esquerda do texto */\n iconLeft?: ReactNode;\n /** Ícone à direita do texto */\n iconRight?: ReactNode;\n /** Size of the button */\n size?: 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';\n /** Visual variant of the button */\n variant?: 'solid' | 'outline' | 'link';\n /** Action type of the button */\n action?: 'primary' | 'positive' | 'negative';\n /** Additional CSS classes to apply */\n className?: string;\n} & ButtonHTMLAttributes<HTMLButtonElement>;\n\n/**\n * Button component for Analytica Ensino platforms\n *\n * A flexible button component with multiple variants, sizes and actions.\n *\n * @param children - The content to display inside the button\n * @param size - The size variant (extra-small, small, medium, large, extra-large)\n * @param variant - The visual style variant (solid, outline, link)\n * @param action - The action type (primary, positive, negative)\n * @param className - Additional CSS classes\n * @param props - All other standard button HTML attributes\n * @returns A styled button element\n *\n * @example\n * ```tsx\n * <Button variant=\"solid\" action=\"primary\" size=\"medium\" onClick={() => console.log('clicked')}>\n * Click me\n * </Button>\n * ```\n */\nconst Button = ({\n children,\n iconLeft,\n iconRight,\n size = 'medium',\n variant = 'solid',\n action = 'primary',\n className = '',\n disabled,\n type = 'button',\n ...props\n}: ButtonProps) => {\n // Get classes from lookup tables\n const sizeClasses = SIZE_CLASSES[size];\n const variantClasses = VARIANT_ACTION_CLASSES[variant][action];\n\n const baseClasses =\n 'inline-flex items-center justify-center rounded-full cursor-pointer font-medium';\n\n return (\n <button\n className={cn(baseClasses, variantClasses, sizeClasses, className)}\n disabled={disabled}\n type={type}\n {...props}\n >\n {iconLeft && <span className=\"mr-2 flex items-center\">{iconLeft}</span>}\n {children}\n {iconRight && <span className=\"ml-2 flex items-center\">{iconRight}</span>}\n </button>\n );\n};\n\nexport default Button;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAMO;;;ACNP,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACmGI;AAlGJ,IAAM,yBAAyB;AAAA,EAC7B,OAAO;AAAA,IACL,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AAAA,EACA,SAAS;AAAA,IACP,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AAAA,EACA,MAAM;AAAA,IACJ,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AACF;AAKA,IAAM,eAAe;AAAA,EACnB,eAAe;AAAA,EACf,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,eAAe;AACjB;AA0CA,IAAM,SAAS,CAAC;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,UAAU;AAAA,EACV,SAAS;AAAA,EACT,YAAY;AAAA,EACZ;AAAA,EACA,OAAO;AAAA,EACP,GAAG;AACL,MAAmB;AAEjB,QAAM,cAAc,aAAa,IAAI;AACrC,QAAM,iBAAiB,uBAAuB,OAAO,EAAE,MAAM;AAE7D,QAAM,cACJ;AAEF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,aAAa,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AAsB;AAChE,qBAAa,KAAK;AAAA,MACpB;AAAA,IACF;AAEA,UAAM,wBAAwB,CAAC,UAAyC;AACtE,UAAI,MAAM,QAAQ,YAAY,eAAe;AAC3C,qBAAa,KAAK;AAAA,MACpB;AAAA,IACF;AAEA,UAAM,eAAe,MAAM;AACzB,mBAAa,KAAK;AAClB,iBAAW,WAAW;AAAA,IACxB;AAEA,UAAM,eAAe,MAAM;AACzB,mBAAa,KAAK;AAClB,iBAAW,WAAW;AAAA,IACxB;AAEA,UAAM,cAAcA,cAAa,IAAI;AAErC,WACE,6EAEG,oBACC;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,SAAS;AAAA,QACT,WAAW;AAAA,QACX,eAAY;AAAA,QAGZ;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,WAAW;AAAA,cACT;AAAA,cACA;AAAA,cACA;AAAA,YACF;AAAA,YACC,GAAG;AAAA,YAEJ;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACC,IAAG;AAAA,kBACH,WAAU;AAAA,kBAET;AAAA;AAAA,cACH;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACC,IAAG;AAAA,kBACH,WAAU;AAAA,kBAET;AAAA;AAAA,cACH;AAAA,cAEA,8CAAC,SAAI,WAAU,qDACb;AAAA,6DAAC,kBAAO,SAAQ,WAAU,MAAK,SAAQ,SAAS,cAC7C,6BACH;AAAA,gBAEA;AAAA,kBAAC;AAAA;AAAA,oBACC,SAAQ;AAAA,oBACR,MAAK;AAAA,oBACL,QAAO;AAAA,oBACP,SAAS;AAAA,oBAER;AAAA;AAAA,gBACH;AAAA,iBACF;AAAA;AAAA;AAAA,QACF;AAAA;AAAA,IACF,GAEJ;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;","names":["import_jsx_runtime","SIZE_CLASSES"]}
1
+ {"version":3,"sources":["../../src/components/AlertDialog/AlertDialog.tsx","../../src/utils/utils.ts","../../src/components/Button/Button.tsx"],"sourcesContent":["import {\n forwardRef,\n HTMLAttributes,\n useEffect,\n MouseEvent,\n KeyboardEvent,\n} from 'react';\nimport Button from '../Button/Button';\nimport { cn } from '../../utils/utils';\n\n/**\n * Lookup table for size classes\n */\nconst SIZE_CLASSES = {\n 'extra-small': 'w-screen max-w-[324px]',\n small: 'w-screen max-w-[378px]',\n medium: 'w-screen max-w-[459px]',\n large: 'w-screen max-w-[578px]',\n 'extra-large': 'w-screen max-w-[912px]',\n} as const;\n\ninterface AlertDialogProps extends HTMLAttributes<HTMLDivElement> {\n /** Title of the alert dialog */\n title: string;\n /** Whether the alert dialog is open (controlled mode) */\n isOpen: boolean;\n /** Function called when the alert dialog is opened or closed (controlled mode) */\n onChangeOpen: (open: boolean) => void;\n /** Whether clicking the backdrop should close the alert dialog */\n closeOnBackdropClick?: boolean;\n /** Whether pressing Escape should close the alert dialog */\n closeOnEscape?: boolean;\n /** Additional CSS classes for the alert dialog content */\n className?: string;\n /** Function called when submit button is clicked */\n onSubmit?: (value?: unknown) => void;\n /** Value to pass to onSubmit function */\n submitValue?: unknown;\n /** Function called when cancel button is clicked */\n onCancel?: (value?: unknown) => void;\n /** Value to pass to onCancel function */\n cancelValue?: unknown;\n /** Description of the alert dialog */\n description: string;\n /** Label of the cancel button */\n cancelButtonLabel?: string;\n /** Label of the submit button */\n submitButtonLabel?: string;\n /** Size of the alert dialog */\n size?: 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';\n}\n\nconst AlertDialog = forwardRef<HTMLDivElement, AlertDialogProps>(\n (\n {\n description,\n cancelButtonLabel = 'Cancelar',\n submitButtonLabel = 'Deletar',\n title,\n isOpen,\n closeOnBackdropClick = true,\n closeOnEscape = true,\n className = '',\n onSubmit,\n onChangeOpen,\n submitValue,\n onCancel,\n cancelValue,\n size = 'medium',\n ...props\n },\n ref\n ) => {\n // Handle escape key\n useEffect(() => {\n if (!isOpen || !closeOnEscape) return;\n\n const handleEscape = (event: globalThis.KeyboardEvent) => {\n if (event.key === 'Escape') {\n onChangeOpen(false);\n }\n };\n\n document.addEventListener('keydown', handleEscape);\n return () => document.removeEventListener('keydown', handleEscape);\n }, [isOpen, closeOnEscape]);\n\n // Prevent body scroll when modal is open\n useEffect(() => {\n if (isOpen) {\n document.body.style.overflow = 'hidden';\n } else {\n document.body.style.overflow = 'unset';\n }\n\n return () => {\n document.body.style.overflow = 'unset';\n };\n }, [isOpen]);\n\n const handleBackdropClick = (event: MouseEvent<HTMLDivElement>) => {\n if (event.target === event.currentTarget && closeOnBackdropClick) {\n onChangeOpen(false);\n }\n };\n\n const handleBackdropKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape' && closeOnEscape) {\n onChangeOpen(false);\n }\n };\n\n const handleSubmit = () => {\n onChangeOpen(false);\n onSubmit?.(submitValue);\n };\n\n const handleCancel = () => {\n onChangeOpen(false);\n onCancel?.(cancelValue);\n };\n\n const sizeClasses = SIZE_CLASSES[size];\n\n return (\n <>\n {/* Alert Dialog Overlay */}\n {isOpen && (\n <div\n className=\"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm\"\n onClick={handleBackdropClick}\n onKeyDown={handleBackdropKeyDown}\n data-testid=\"alert-dialog-overlay\"\n >\n {/* Alert Dialog Content */}\n <div\n ref={ref}\n className={cn(\n 'bg-background border border-border-100 rounded-lg shadow-lg p-6 m-3',\n sizeClasses,\n className\n )}\n {...props}\n >\n <h2\n id=\"alert-dialog-title\"\n className=\"pb-3 text-xl font-semibold text-text-950\"\n >\n {title}\n </h2>\n <p\n id=\"alert-dialog-description\"\n className=\"text-text-700 text-sm\"\n >\n {description}\n </p>\n\n <div className=\"flex flex-row items-center justify-end pt-4 gap-3\">\n <Button variant=\"outline\" size=\"small\" onClick={handleCancel}>\n {cancelButtonLabel}\n </Button>\n\n <Button\n variant=\"solid\"\n size=\"small\"\n action=\"negative\"\n onClick={handleSubmit}\n >\n {submitButtonLabel}\n </Button>\n </div>\n </div>\n </div>\n )}\n </>\n );\n }\n);\n\nAlertDialog.displayName = 'AlertDialog';\n\nexport { AlertDialog };\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} from './activityFilters';\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 { ButtonHTMLAttributes, ReactNode } from 'react';\nimport { cn } from '../../utils/utils';\n\n/**\n * Lookup table for variant and action class combinations\n */\nconst VARIANT_ACTION_CLASSES = {\n solid: {\n primary:\n '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',\n positive:\n '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',\n negative:\n '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',\n },\n outline: {\n primary:\n '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',\n positive:\n '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',\n negative:\n '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',\n },\n link: {\n primary:\n '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',\n positive:\n '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',\n negative:\n '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',\n },\n} as const;\n\n/**\n * Lookup table for size classes\n */\nconst SIZE_CLASSES = {\n 'extra-small': 'text-xs px-3.5 py-2',\n small: 'text-sm px-4 py-2.5',\n medium: 'text-md px-5 py-2.5',\n large: 'text-lg px-6 py-3',\n 'extra-large': 'text-lg px-7 py-3.5',\n} as const;\n\n/**\n * Button component props interface\n */\ntype ButtonProps = {\n /** Content to be displayed inside the button */\n children: ReactNode;\n /** Ícone à esquerda do texto */\n iconLeft?: ReactNode;\n /** Ícone à direita do texto */\n iconRight?: ReactNode;\n /** Size of the button */\n size?: 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';\n /** Visual variant of the button */\n variant?: 'solid' | 'outline' | 'link';\n /** Action type of the button */\n action?: 'primary' | 'positive' | 'negative';\n /** Additional CSS classes to apply */\n className?: string;\n} & ButtonHTMLAttributes<HTMLButtonElement>;\n\n/**\n * Button component for Analytica Ensino platforms\n *\n * A flexible button component with multiple variants, sizes and actions.\n *\n * @param children - The content to display inside the button\n * @param size - The size variant (extra-small, small, medium, large, extra-large)\n * @param variant - The visual style variant (solid, outline, link)\n * @param action - The action type (primary, positive, negative)\n * @param className - Additional CSS classes\n * @param props - All other standard button HTML attributes\n * @returns A styled button element\n *\n * @example\n * ```tsx\n * <Button variant=\"solid\" action=\"primary\" size=\"medium\" onClick={() => console.log('clicked')}>\n * Click me\n * </Button>\n * ```\n */\nconst Button = ({\n children,\n iconLeft,\n iconRight,\n size = 'medium',\n variant = 'solid',\n action = 'primary',\n className = '',\n disabled,\n type = 'button',\n ...props\n}: ButtonProps) => {\n // Get classes from lookup tables\n const sizeClasses = SIZE_CLASSES[size];\n const variantClasses = VARIANT_ACTION_CLASSES[variant][action];\n\n const baseClasses =\n 'inline-flex items-center justify-center rounded-full cursor-pointer font-medium';\n\n return (\n <button\n className={cn(baseClasses, variantClasses, sizeClasses, className)}\n disabled={disabled}\n type={type}\n {...props}\n >\n {iconLeft && <span className=\"mr-2 flex items-center\">{iconLeft}</span>}\n {children}\n {iconRight && <span className=\"ml-2 flex items-center\">{iconRight}</span>}\n </button>\n );\n};\n\nexport default Button;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAMO;;;ACNP,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACmGI;AAlGJ,IAAM,yBAAyB;AAAA,EAC7B,OAAO;AAAA,IACL,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AAAA,EACA,SAAS;AAAA,IACP,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AAAA,EACA,MAAM;AAAA,IACJ,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AACF;AAKA,IAAM,eAAe;AAAA,EACnB,eAAe;AAAA,EACf,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,eAAe;AACjB;AA0CA,IAAM,SAAS,CAAC;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,UAAU;AAAA,EACV,SAAS;AAAA,EACT,YAAY;AAAA,EACZ;AAAA,EACA,OAAO;AAAA,EACP,GAAG;AACL,MAAmB;AAEjB,QAAM,cAAc,aAAa,IAAI;AACrC,QAAM,iBAAiB,uBAAuB,OAAO,EAAE,MAAM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
- {"version":3,"sources":["../../src/components/AlertDialog/AlertDialog.tsx","../../src/utils/utils.ts","../../src/components/Button/Button.tsx"],"sourcesContent":["import {\n forwardRef,\n HTMLAttributes,\n useEffect,\n MouseEvent,\n KeyboardEvent,\n} from 'react';\nimport Button from '../Button/Button';\nimport { cn } from '../../utils/utils';\n\n/**\n * Lookup table for size classes\n */\nconst SIZE_CLASSES = {\n 'extra-small': 'w-screen max-w-[324px]',\n small: 'w-screen max-w-[378px]',\n medium: 'w-screen max-w-[459px]',\n large: 'w-screen max-w-[578px]',\n 'extra-large': 'w-screen max-w-[912px]',\n} as const;\n\ninterface AlertDialogProps extends HTMLAttributes<HTMLDivElement> {\n /** Title of the alert dialog */\n title: string;\n /** Whether the alert dialog is open (controlled mode) */\n isOpen: boolean;\n /** Function called when the alert dialog is opened or closed (controlled mode) */\n onChangeOpen: (open: boolean) => void;\n /** Whether clicking the backdrop should close the alert dialog */\n closeOnBackdropClick?: boolean;\n /** Whether pressing Escape should close the alert dialog */\n closeOnEscape?: boolean;\n /** Additional CSS classes for the alert dialog content */\n className?: string;\n /** Function called when submit button is clicked */\n onSubmit?: (value?: unknown) => void;\n /** Value to pass to onSubmit function */\n submitValue?: unknown;\n /** Function called when cancel button is clicked */\n onCancel?: (value?: unknown) => void;\n /** Value to pass to onCancel function */\n cancelValue?: unknown;\n /** Description of the alert dialog */\n description: string;\n /** Label of the cancel button */\n cancelButtonLabel?: string;\n /** Label of the submit button */\n submitButtonLabel?: string;\n /** Size of the alert dialog */\n size?: 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';\n}\n\nconst AlertDialog = forwardRef<HTMLDivElement, AlertDialogProps>(\n (\n {\n description,\n cancelButtonLabel = 'Cancelar',\n submitButtonLabel = 'Deletar',\n title,\n isOpen,\n closeOnBackdropClick = true,\n closeOnEscape = true,\n className = '',\n onSubmit,\n onChangeOpen,\n submitValue,\n onCancel,\n cancelValue,\n size = 'medium',\n ...props\n },\n ref\n ) => {\n // Handle escape key\n useEffect(() => {\n if (!isOpen || !closeOnEscape) return;\n\n const handleEscape = (event: globalThis.KeyboardEvent) => {\n if (event.key === 'Escape') {\n onChangeOpen(false);\n }\n };\n\n document.addEventListener('keydown', handleEscape);\n return () => document.removeEventListener('keydown', handleEscape);\n }, [isOpen, closeOnEscape]);\n\n // Prevent body scroll when modal is open\n useEffect(() => {\n if (isOpen) {\n document.body.style.overflow = 'hidden';\n } else {\n document.body.style.overflow = 'unset';\n }\n\n return () => {\n document.body.style.overflow = 'unset';\n };\n }, [isOpen]);\n\n const handleBackdropClick = (event: MouseEvent<HTMLDivElement>) => {\n if (event.target === event.currentTarget && closeOnBackdropClick) {\n onChangeOpen(false);\n }\n };\n\n const handleBackdropKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape' && closeOnEscape) {\n onChangeOpen(false);\n }\n };\n\n const handleSubmit = () => {\n onChangeOpen(false);\n onSubmit?.(submitValue);\n };\n\n const handleCancel = () => {\n onChangeOpen(false);\n onCancel?.(cancelValue);\n };\n\n const sizeClasses = SIZE_CLASSES[size];\n\n return (\n <>\n {/* Alert Dialog Overlay */}\n {isOpen && (\n <div\n className=\"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm\"\n onClick={handleBackdropClick}\n onKeyDown={handleBackdropKeyDown}\n data-testid=\"alert-dialog-overlay\"\n >\n {/* Alert Dialog Content */}\n <div\n ref={ref}\n className={cn(\n 'bg-background border border-border-100 rounded-lg shadow-lg p-6 m-3',\n sizeClasses,\n className\n )}\n {...props}\n >\n <h2\n id=\"alert-dialog-title\"\n className=\"pb-3 text-xl font-semibold text-text-950\"\n >\n {title}\n </h2>\n <p\n id=\"alert-dialog-description\"\n className=\"text-text-700 text-sm\"\n >\n {description}\n </p>\n\n <div className=\"flex flex-row items-center justify-end pt-4 gap-3\">\n <Button variant=\"outline\" size=\"small\" onClick={handleCancel}>\n {cancelButtonLabel}\n </Button>\n\n <Button\n variant=\"solid\"\n size=\"small\"\n action=\"negative\"\n onClick={handleSubmit}\n >\n {submitButtonLabel}\n </Button>\n </div>\n </div>\n </div>\n )}\n </>\n );\n }\n);\n\nAlertDialog.displayName = 'AlertDialog';\n\nexport { AlertDialog };\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} from './activityFilters';\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 { ButtonHTMLAttributes, ReactNode } from 'react';\nimport { cn } from '../../utils/utils';\n\n/**\n * Lookup table for variant and action class combinations\n */\nconst VARIANT_ACTION_CLASSES = {\n solid: {\n primary:\n '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',\n positive:\n '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',\n negative:\n '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',\n },\n outline: {\n primary:\n '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',\n positive:\n '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',\n negative:\n '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',\n },\n link: {\n primary:\n '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',\n positive:\n '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',\n negative:\n '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',\n },\n} as const;\n\n/**\n * Lookup table for size classes\n */\nconst SIZE_CLASSES = {\n 'extra-small': 'text-xs px-3.5 py-2',\n small: 'text-sm px-4 py-2.5',\n medium: 'text-md px-5 py-2.5',\n large: 'text-lg px-6 py-3',\n 'extra-large': 'text-lg px-7 py-3.5',\n} as const;\n\n/**\n * Button component props interface\n */\ntype ButtonProps = {\n /** Content to be displayed inside the button */\n children: ReactNode;\n /** Ícone à esquerda do texto */\n iconLeft?: ReactNode;\n /** Ícone à direita do texto */\n iconRight?: ReactNode;\n /** Size of the button */\n size?: 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';\n /** Visual variant of the button */\n variant?: 'solid' | 'outline' | 'link';\n /** Action type of the button */\n action?: 'primary' | 'positive' | 'negative';\n /** Additional CSS classes to apply */\n className?: string;\n} & ButtonHTMLAttributes<HTMLButtonElement>;\n\n/**\n * Button component for Analytica Ensino platforms\n *\n * A flexible button component with multiple variants, sizes and actions.\n *\n * @param children - The content to display inside the button\n * @param size - The size variant (extra-small, small, medium, large, extra-large)\n * @param variant - The visual style variant (solid, outline, link)\n * @param action - The action type (primary, positive, negative)\n * @param className - Additional CSS classes\n * @param props - All other standard button HTML attributes\n * @returns A styled button element\n *\n * @example\n * ```tsx\n * <Button variant=\"solid\" action=\"primary\" size=\"medium\" onClick={() => console.log('clicked')}>\n * Click me\n * </Button>\n * ```\n */\nconst Button = ({\n children,\n iconLeft,\n iconRight,\n size = 'medium',\n variant = 'solid',\n action = 'primary',\n className = '',\n disabled,\n type = 'button',\n ...props\n}: ButtonProps) => {\n // Get classes from lookup tables\n const sizeClasses = SIZE_CLASSES[size];\n const variantClasses = VARIANT_ACTION_CLASSES[variant][action];\n\n const baseClasses =\n 'inline-flex items-center justify-center rounded-full cursor-pointer font-medium';\n\n return (\n <button\n className={cn(baseClasses, variantClasses, sizeClasses, className)}\n disabled={disabled}\n type={type}\n {...props}\n >\n {iconLeft && <span className=\"mr-2 flex items-center\">{iconLeft}</span>}\n {children}\n {iconRight && <span className=\"ml-2 flex items-center\">{iconRight}</span>}\n </button>\n );\n};\n\nexport default Button;\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EAEA;AAAA,OAGK;;;ACNP,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACmGI,SAMe,KANf;AAlGJ,IAAM,yBAAyB;AAAA,EAC7B,OAAO;AAAA,IACL,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AAAA,EACA,SAAS;AAAA,IACP,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AAAA,EACA,MAAM;AAAA,IACJ,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AACF;AAKA,IAAM,eAAe;AAAA,EACnB,eAAe;AAAA,EACf,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,eAAe;AACjB;AA0CA,IAAM,SAAS,CAAC;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,UAAU;AAAA,EACV,SAAS;AAAA,EACT,YAAY;AAAA,EACZ;AAAA,EACA,OAAO;AAAA,EACP,GAAG;AACL,MAAmB;AAEjB,QAAM,cAAc,aAAa,IAAI;AACrC,QAAM,iBAAiB,uBAAuB,OAAO,EAAE,MAAM;A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;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;","names":["jsx","jsxs","SIZE_CLASSES"]}
1
+ {"version":3,"sources":["../../src/components/AlertDialog/AlertDialog.tsx","../../src/utils/utils.ts","../../src/components/Button/Button.tsx"],"sourcesContent":["import {\n forwardRef,\n HTMLAttributes,\n useEffect,\n MouseEvent,\n KeyboardEvent,\n} from 'react';\nimport Button from '../Button/Button';\nimport { cn } from '../../utils/utils';\n\n/**\n * Lookup table for size classes\n */\nconst SIZE_CLASSES = {\n 'extra-small': 'w-screen max-w-[324px]',\n small: 'w-screen max-w-[378px]',\n medium: 'w-screen max-w-[459px]',\n large: 'w-screen max-w-[578px]',\n 'extra-large': 'w-screen max-w-[912px]',\n} as const;\n\ninterface AlertDialogProps extends HTMLAttributes<HTMLDivElement> {\n /** Title of the alert dialog */\n title: string;\n /** Whether the alert dialog is open (controlled mode) */\n isOpen: boolean;\n /** Function called when the alert dialog is opened or closed (controlled mode) */\n onChangeOpen: (open: boolean) => void;\n /** Whether clicking the backdrop should close the alert dialog */\n closeOnBackdropClick?: boolean;\n /** Whether pressing Escape should close the alert dialog */\n closeOnEscape?: boolean;\n /** Additional CSS classes for the alert dialog content */\n className?: string;\n /** Function called when submit button is clicked */\n onSubmit?: (value?: unknown) => void;\n /** Value to pass to onSubmit function */\n submitValue?: unknown;\n /** Function called when cancel button is clicked */\n onCancel?: (value?: unknown) => void;\n /** Value to pass to onCancel function */\n cancelValue?: unknown;\n /** Description of the alert dialog */\n description: string;\n /** Label of the cancel button */\n cancelButtonLabel?: string;\n /** Label of the submit button */\n submitButtonLabel?: string;\n /** Size of the alert dialog */\n size?: 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';\n}\n\nconst AlertDialog = forwardRef<HTMLDivElement, AlertDialogProps>(\n (\n {\n description,\n cancelButtonLabel = 'Cancelar',\n submitButtonLabel = 'Deletar',\n title,\n isOpen,\n closeOnBackdropClick = true,\n closeOnEscape = true,\n className = '',\n onSubmit,\n onChangeOpen,\n submitValue,\n onCancel,\n cancelValue,\n size = 'medium',\n ...props\n },\n ref\n ) => {\n // Handle escape key\n useEffect(() => {\n if (!isOpen || !closeOnEscape) return;\n\n const handleEscape = (event: globalThis.KeyboardEvent) => {\n if (event.key === 'Escape') {\n onChangeOpen(false);\n }\n };\n\n document.addEventListener('keydown', handleEscape);\n return () => document.removeEventListener('keydown', handleEscape);\n }, [isOpen, closeOnEscape]);\n\n // Prevent body scroll when modal is open\n useEffect(() => {\n if (isOpen) {\n document.body.style.overflow = 'hidden';\n } else {\n document.body.style.overflow = 'unset';\n }\n\n return () => {\n document.body.style.overflow = 'unset';\n };\n }, [isOpen]);\n\n const handleBackdropClick = (event: MouseEvent<HTMLDivElement>) => {\n if (event.target === event.currentTarget && closeOnBackdropClick) {\n onChangeOpen(false);\n }\n };\n\n const handleBackdropKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape' && closeOnEscape) {\n onChangeOpen(false);\n }\n };\n\n const handleSubmit = () => {\n onChangeOpen(false);\n onSubmit?.(submitValue);\n };\n\n const handleCancel = () => {\n onChangeOpen(false);\n onCancel?.(cancelValue);\n };\n\n const sizeClasses = SIZE_CLASSES[size];\n\n return (\n <>\n {/* Alert Dialog Overlay */}\n {isOpen && (\n <div\n className=\"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm\"\n onClick={handleBackdropClick}\n onKeyDown={handleBackdropKeyDown}\n data-testid=\"alert-dialog-overlay\"\n >\n {/* Alert Dialog Content */}\n <div\n ref={ref}\n className={cn(\n 'bg-background border border-border-100 rounded-lg shadow-lg p-6 m-3',\n sizeClasses,\n className\n )}\n {...props}\n >\n <h2\n id=\"alert-dialog-title\"\n className=\"pb-3 text-xl font-semibold text-text-950\"\n >\n {title}\n </h2>\n <p\n id=\"alert-dialog-description\"\n className=\"text-text-700 text-sm\"\n >\n {description}\n </p>\n\n <div className=\"flex flex-row items-center justify-end pt-4 gap-3\">\n <Button variant=\"outline\" size=\"small\" onClick={handleCancel}>\n {cancelButtonLabel}\n </Button>\n\n <Button\n variant=\"solid\"\n size=\"small\"\n action=\"negative\"\n onClick={handleSubmit}\n >\n {submitButtonLabel}\n </Button>\n </div>\n </div>\n </div>\n )}\n </>\n );\n }\n);\n\nAlertDialog.displayName = 'AlertDialog';\n\nexport { AlertDialog };\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} from './activityFilters';\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 { ButtonHTMLAttributes, ReactNode } from 'react';\nimport { cn } from '../../utils/utils';\n\n/**\n * Lookup table for variant and action class combinations\n */\nconst VARIANT_ACTION_CLASSES = {\n solid: {\n primary:\n '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',\n positive:\n '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',\n negative:\n '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',\n },\n outline: {\n primary:\n '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',\n positive:\n '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',\n negative:\n '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',\n },\n link: {\n primary:\n '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',\n positive:\n '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',\n negative:\n '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',\n },\n} as const;\n\n/**\n * Lookup table for size classes\n */\nconst SIZE_CLASSES = {\n 'extra-small': 'text-xs px-3.5 py-2',\n small: 'text-sm px-4 py-2.5',\n medium: 'text-md px-5 py-2.5',\n large: 'text-lg px-6 py-3',\n 'extra-large': 'text-lg px-7 py-3.5',\n} as const;\n\n/**\n * Button component props interface\n */\ntype ButtonProps = {\n /** Content to be displayed inside the button */\n children: ReactNode;\n /** Ícone à esquerda do texto */\n iconLeft?: ReactNode;\n /** Ícone à direita do texto */\n iconRight?: ReactNode;\n /** Size of the button */\n size?: 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';\n /** Visual variant of the button */\n variant?: 'solid' | 'outline' | 'link';\n /** Action type of the button */\n action?: 'primary' | 'positive' | 'negative';\n /** Additional CSS classes to apply */\n className?: string;\n} & ButtonHTMLAttributes<HTMLButtonElement>;\n\n/**\n * Button component for Analytica Ensino platforms\n *\n * A flexible button component with multiple variants, sizes and actions.\n *\n * @param children - The content to display inside the button\n * @param size - The size variant (extra-small, small, medium, large, extra-large)\n * @param variant - The visual style variant (solid, outline, link)\n * @param action - The action type (primary, positive, negative)\n * @param className - Additional CSS classes\n * @param props - All other standard button HTML attributes\n * @returns A styled button element\n *\n * @example\n * ```tsx\n * <Button variant=\"solid\" action=\"primary\" size=\"medium\" onClick={() => console.log('clicked')}>\n * Click me\n * </Button>\n * ```\n */\nconst Button = ({\n children,\n iconLeft,\n iconRight,\n size = 'medium',\n variant = 'solid',\n action = 'primary',\n className = '',\n disabled,\n type = 'button',\n ...props\n}: ButtonProps) => {\n // Get classes from lookup tables\n const sizeClasses = SIZE_CLASSES[size];\n const variantClasses = VARIANT_ACTION_CLASSES[variant][action];\n\n const baseClasses =\n 'inline-flex items-center justify-center rounded-full cursor-pointer font-medium';\n\n return (\n <button\n className={cn(baseClasses, variantClasses, sizeClasses, className)}\n disabled={disabled}\n type={type}\n {...props}\n >\n {iconLeft && <span className=\"mr-2 flex items-center\">{iconLeft}</span>}\n {children}\n {iconRight && <span className=\"ml-2 flex items-center\">{iconRight}</span>}\n </button>\n );\n};\n\nexport default Button;\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EAEA;AAAA,OAGK;;;ACNP,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACmGI,SAMe,KANf;AAlGJ,IAAM,yBAAyB;AAAA,EAC7B,OAAO;AAAA,IACL,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AAAA,EACA,SAAS;AAAA,IACP,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AAAA,EACA,MAAM;AAAA,IACJ,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AACF;AAKA,IAAM,eAAe;AAAA,EACnB,eAAe;AAAA,EACf,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,eAAe;AACjB;AA0CA,IAAM,SAAS,CAAC;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,UAAU;AAAA,EACV,SA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