analytica-frontend-lib 1.0.83 → 1.0.85

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 (143) hide show
  1. package/dist/Accordation/index.js +163 -74
  2. package/dist/Accordation/index.js.map +1 -1
  3. package/dist/Accordation/index.mjs +163 -74
  4. package/dist/Accordation/index.mjs.map +1 -1
  5. package/dist/Alert/index.js +32 -32
  6. package/dist/Alert/index.js.map +1 -1
  7. package/dist/Alert/index.mjs +32 -32
  8. package/dist/Alert/index.mjs.map +1 -1
  9. package/dist/AlertDialog/index.js +13 -2
  10. package/dist/AlertDialog/index.js.map +1 -1
  11. package/dist/AlertDialog/index.mjs +13 -2
  12. package/dist/AlertDialog/index.mjs.map +1 -1
  13. package/dist/Alternative/index.js +86 -25
  14. package/dist/Alternative/index.js.map +1 -1
  15. package/dist/Alternative/index.mjs +86 -25
  16. package/dist/Alternative/index.mjs.map +1 -1
  17. package/dist/Badge/index.js +13 -4
  18. package/dist/Badge/index.js.map +1 -1
  19. package/dist/Badge/index.mjs +13 -4
  20. package/dist/Badge/index.mjs.map +1 -1
  21. package/dist/Button/index.js +10 -1
  22. package/dist/Button/index.js.map +1 -1
  23. package/dist/Button/index.mjs +8 -1
  24. package/dist/Button/index.mjs.map +1 -1
  25. package/dist/Calendar/index.js +11 -2
  26. package/dist/Calendar/index.js.map +1 -1
  27. package/dist/Calendar/index.mjs +11 -2
  28. package/dist/Calendar/index.mjs.map +1 -1
  29. package/dist/Card/index.js +154 -71
  30. package/dist/Card/index.js.map +1 -1
  31. package/dist/Card/index.mjs +154 -71
  32. package/dist/Card/index.mjs.map +1 -1
  33. package/dist/CheckBox/index.js +28 -5
  34. package/dist/CheckBox/index.js.map +1 -1
  35. package/dist/CheckBox/index.mjs +28 -5
  36. package/dist/CheckBox/index.mjs.map +1 -1
  37. package/dist/Chips/index.js +10 -1
  38. package/dist/Chips/index.js.map +1 -1
  39. package/dist/Chips/index.mjs +10 -1
  40. package/dist/Chips/index.mjs.map +1 -1
  41. package/dist/Divider/index.js +10 -1
  42. package/dist/Divider/index.js.map +1 -1
  43. package/dist/Divider/index.mjs +8 -1
  44. package/dist/Divider/index.mjs.map +1 -1
  45. package/dist/DropdownMenu/index.js +18 -22
  46. package/dist/DropdownMenu/index.js.map +1 -1
  47. package/dist/DropdownMenu/index.mjs +18 -22
  48. package/dist/DropdownMenu/index.mjs.map +1 -1
  49. package/dist/IconButton/index.js +10 -1
  50. package/dist/IconButton/index.js.map +1 -1
  51. package/dist/IconButton/index.mjs +10 -1
  52. package/dist/IconButton/index.mjs.map +1 -1
  53. package/dist/IconRoundedButton/index.js +10 -1
  54. package/dist/IconRoundedButton/index.js.map +1 -1
  55. package/dist/IconRoundedButton/index.mjs +8 -1
  56. package/dist/IconRoundedButton/index.mjs.map +1 -1
  57. package/dist/Menu/index.js +22 -10
  58. package/dist/Menu/index.js.map +1 -1
  59. package/dist/Menu/index.mjs +22 -10
  60. package/dist/Menu/index.mjs.map +1 -1
  61. package/dist/Modal/index.js +15 -1
  62. package/dist/Modal/index.js.map +1 -1
  63. package/dist/Modal/index.mjs +15 -1
  64. package/dist/Modal/index.mjs.map +1 -1
  65. package/dist/NavButton/index.js +10 -1
  66. package/dist/NavButton/index.js.map +1 -1
  67. package/dist/NavButton/index.mjs +10 -1
  68. package/dist/NavButton/index.mjs.map +1 -1
  69. package/dist/NotFound/index.js +13 -3
  70. package/dist/NotFound/index.js.map +1 -1
  71. package/dist/NotFound/index.mjs +13 -3
  72. package/dist/NotFound/index.mjs.map +1 -1
  73. package/dist/ProgressBar/index.js +63 -15
  74. package/dist/ProgressBar/index.js.map +1 -1
  75. package/dist/ProgressBar/index.mjs +63 -15
  76. package/dist/ProgressBar/index.mjs.map +1 -1
  77. package/dist/ProgressCircle/index.js +34 -7
  78. package/dist/ProgressCircle/index.js.map +1 -1
  79. package/dist/ProgressCircle/index.mjs +34 -7
  80. package/dist/ProgressCircle/index.mjs.map +1 -1
  81. package/dist/Quiz/index.d.mts +25 -2
  82. package/dist/Quiz/index.d.ts +25 -2
  83. package/dist/Quiz/index.js +972 -260
  84. package/dist/Quiz/index.js.map +1 -1
  85. package/dist/Quiz/index.mjs +968 -261
  86. package/dist/Quiz/index.mjs.map +1 -1
  87. package/dist/Quiz/useQuizStore/index.d.mts +44 -12
  88. package/dist/Quiz/useQuizStore/index.d.ts +44 -12
  89. package/dist/Quiz/useQuizStore/index.js +206 -85
  90. package/dist/Quiz/useQuizStore/index.js.map +1 -1
  91. package/dist/Quiz/useQuizStore/index.mjs +203 -85
  92. package/dist/Quiz/useQuizStore/index.mjs.map +1 -1
  93. package/dist/Radio/index.js +36 -6
  94. package/dist/Radio/index.js.map +1 -1
  95. package/dist/Radio/index.mjs +36 -6
  96. package/dist/Radio/index.mjs.map +1 -1
  97. package/dist/Select/index.js +20 -4
  98. package/dist/Select/index.js.map +1 -1
  99. package/dist/Select/index.mjs +20 -4
  100. package/dist/Select/index.mjs.map +1 -1
  101. package/dist/SelectionButton/index.js +10 -1
  102. package/dist/SelectionButton/index.js.map +1 -1
  103. package/dist/SelectionButton/index.mjs +10 -1
  104. package/dist/SelectionButton/index.mjs.map +1 -1
  105. package/dist/Skeleton/index.js +18 -6
  106. package/dist/Skeleton/index.js.map +1 -1
  107. package/dist/Skeleton/index.mjs +18 -6
  108. package/dist/Skeleton/index.mjs.map +1 -1
  109. package/dist/Stepper/index.js +27 -18
  110. package/dist/Stepper/index.js.map +1 -1
  111. package/dist/Stepper/index.mjs +27 -18
  112. package/dist/Stepper/index.mjs.map +1 -1
  113. package/dist/Table/index.js +37 -13
  114. package/dist/Table/index.js.map +1 -1
  115. package/dist/Table/index.mjs +37 -13
  116. package/dist/Table/index.mjs.map +1 -1
  117. package/dist/Text/index.js +10 -1
  118. package/dist/Text/index.js.map +1 -1
  119. package/dist/Text/index.mjs +8 -1
  120. package/dist/Text/index.mjs.map +1 -1
  121. package/dist/TextArea/index.js +17 -3
  122. package/dist/TextArea/index.js.map +1 -1
  123. package/dist/TextArea/index.mjs +17 -3
  124. package/dist/TextArea/index.mjs.map +1 -1
  125. package/dist/Toast/Toaster/index.js +15 -1
  126. package/dist/Toast/Toaster/index.js.map +1 -1
  127. package/dist/Toast/Toaster/index.mjs +15 -1
  128. package/dist/Toast/Toaster/index.mjs.map +1 -1
  129. package/dist/Toast/index.js +15 -1
  130. package/dist/Toast/index.js.map +1 -1
  131. package/dist/Toast/index.mjs +15 -1
  132. package/dist/Toast/index.mjs.map +1 -1
  133. package/dist/index.css +8 -9
  134. package/dist/index.css.map +1 -1
  135. package/dist/index.d.mts +1 -1
  136. package/dist/index.d.ts +1 -1
  137. package/dist/index.js +903 -325
  138. package/dist/index.js.map +1 -1
  139. package/dist/index.mjs +901 -326
  140. package/dist/index.mjs.map +1 -1
  141. package/dist/styles.css +8 -9
  142. package/dist/styles.css.map +1 -1
  143. package/package.json +3 -1
@@ -25,6 +25,13 @@ __export(Alert_exports, {
25
25
  module.exports = __toCommonJS(Alert_exports);
26
26
  var import_phosphor_react = require("phosphor-react");
27
27
 
28
+ // src/utils/utils.ts
29
+ var import_clsx = require("clsx");
30
+ var import_tailwind_merge = require("tailwind-merge");
31
+ function cn(...inputs) {
32
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
33
+ }
34
+
28
35
  // src/components/Text/Text.tsx
29
36
  var import_jsx_runtime = require("react/jsx-runtime");
30
37
  var Text = ({
@@ -68,7 +75,7 @@ var Text = ({
68
75
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
69
76
  Component,
70
77
  {
71
- className: `${baseClasses} ${sizeClasses} ${weightClasses} ${color} ${className}`,
78
+ className: cn(baseClasses, sizeClasses, weightClasses, color, className),
72
79
  ...props,
73
80
  children
74
81
  }
@@ -121,37 +128,30 @@ var Alert = ({
121
128
  const variantColor = COLOR_CLASSES[action];
122
129
  const variantIcon = ICONS[action];
123
130
  const hasHeading = Boolean(title);
124
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
125
- "div",
126
- {
127
- className: `${baseClasses} ${variantClasses} ${className ?? ""}`,
128
- ...props,
129
- children: [
130
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: `mt-0.5 ${variantColor}`, children: variantIcon }),
131
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
132
- hasHeading && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
133
- Text_default,
134
- {
135
- size: "md",
136
- weight: "medium",
137
- color: variantColor,
138
- className: "mb-0.5",
139
- children: title
140
- }
141
- ),
142
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
143
- Text_default,
144
- {
145
- size: hasHeading ? "sm" : "md",
146
- weight: "normal",
147
- color: !hasHeading ? variantColor : "text-text-700",
148
- children: description
149
- }
150
- )
151
- ] })
152
- ]
153
- }
154
- );
131
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: cn(baseClasses, variantClasses, className), ...props, children: [
132
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: cn("mt-0.5", variantColor), children: variantIcon }),
133
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
134
+ hasHeading && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
135
+ Text_default,
136
+ {
137
+ size: "md",
138
+ weight: "medium",
139
+ color: variantColor,
140
+ className: "mb-0.5",
141
+ children: title
142
+ }
143
+ ),
144
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
145
+ Text_default,
146
+ {
147
+ size: hasHeading ? "sm" : "md",
148
+ weight: "normal",
149
+ color: !hasHeading ? variantColor : "text-text-700",
150
+ children: description
151
+ }
152
+ )
153
+ ] })
154
+ ] });
155
155
  };
156
156
  var Alert_default = Alert;
157
157
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/Alert/Alert.tsx","../../src/components/Text/Text.tsx"],"sourcesContent":["import { HTMLAttributes } from 'react';\nimport { CheckCircle, Info, WarningCircle, XCircle } from 'phosphor-react';\nimport Text from '../Text/Text';\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\n className={`${baseClasses} ${variantClasses} ${className ?? ''}`}\n {...props}\n >\n <span className={`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 { ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';\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={`${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;;;ACyHtD;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,Q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cAAc,MAAM,MAAM;AAChC,QAAM,aAAa,QAAQ,KAAK;AAEhC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,WAAW,IAAI,cAAc,IAAI,aAAa,EAAE;AAAA,MAC7D,GAAG;AAAA,MAEJ;AAAA,qDAAC,UAAK,WAAW,UAAU,YAAY,IAAK,uBAAY;AAAA,QACxD,8CAAC,SACE;AAAA,wBACC;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,QAAO;AAAA,cACP,OAAO;AAAA,cACP,WAAU;AAAA,cAET;AAAA;AAAA,UACH;AAAA,UAEF;AAAA,YAAC;AAAA;AAAA,cACC,MAAM,aAAa,OAAO;AAAA,cAC1B,QAAO;AAAA,cACP,OAAO,CAAC,aAAa,eAAe;AAAA,cAEnC;AAAA;AAAA,UACH;AAAA,WACF;AAAA;AAAA;AAAA,EACF;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","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,MAEH;AAAA;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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,6 +1,13 @@
1
1
  // src/components/Alert/Alert.tsx
2
2
  import { CheckCircle, Info, WarningCircle, XCircle } from "phosphor-react";
3
3
 
4
+ // src/utils/utils.ts
5
+ import { clsx } from "clsx";
6
+ import { twMerge } from "tailwind-merge";
7
+ function cn(...inputs) {
8
+ return twMerge(clsx(inputs));
9
+ }
10
+
4
11
  // src/components/Text/Text.tsx
5
12
  import { jsx } from "react/jsx-runtime";
6
13
  var Text = ({
@@ -44,7 +51,7 @@ var Text = ({
44
51
  return /* @__PURE__ */ jsx(
45
52
  Component,
46
53
  {
47
- className: `${baseClasses} ${sizeClasses} ${weightClasses} ${color} ${className}`,
54
+ className: cn(baseClasses, sizeClasses, weightClasses, color, className),
48
55
  ...props,
49
56
  children
50
57
  }
@@ -97,37 +104,30 @@ var Alert = ({
97
104
  const variantColor = COLOR_CLASSES[action];
98
105
  const variantIcon = ICONS[action];
99
106
  const hasHeading = Boolean(title);
100
- return /* @__PURE__ */ jsxs(
101
- "div",
102
- {
103
- className: `${baseClasses} ${variantClasses} ${className ?? ""}`,
104
- ...props,
105
- children: [
106
- /* @__PURE__ */ jsx2("span", { className: `mt-0.5 ${variantColor}`, children: variantIcon }),
107
- /* @__PURE__ */ jsxs("div", { children: [
108
- hasHeading && /* @__PURE__ */ jsx2(
109
- Text_default,
110
- {
111
- size: "md",
112
- weight: "medium",
113
- color: variantColor,
114
- className: "mb-0.5",
115
- children: title
116
- }
117
- ),
118
- /* @__PURE__ */ jsx2(
119
- Text_default,
120
- {
121
- size: hasHeading ? "sm" : "md",
122
- weight: "normal",
123
- color: !hasHeading ? variantColor : "text-text-700",
124
- children: description
125
- }
126
- )
127
- ] })
128
- ]
129
- }
130
- );
107
+ return /* @__PURE__ */ jsxs("div", { className: cn(baseClasses, variantClasses, className), ...props, children: [
108
+ /* @__PURE__ */ jsx2("span", { className: cn("mt-0.5", variantColor), children: variantIcon }),
109
+ /* @__PURE__ */ jsxs("div", { children: [
110
+ hasHeading && /* @__PURE__ */ jsx2(
111
+ Text_default,
112
+ {
113
+ size: "md",
114
+ weight: "medium",
115
+ color: variantColor,
116
+ className: "mb-0.5",
117
+ children: title
118
+ }
119
+ ),
120
+ /* @__PURE__ */ jsx2(
121
+ Text_default,
122
+ {
123
+ size: hasHeading ? "sm" : "md",
124
+ weight: "normal",
125
+ color: !hasHeading ? variantColor : "text-text-700",
126
+ children: description
127
+ }
128
+ )
129
+ ] })
130
+ ] });
131
131
  };
132
132
  var Alert_default = Alert;
133
133
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/Alert/Alert.tsx","../../src/components/Text/Text.tsx"],"sourcesContent":["import { HTMLAttributes } from 'react';\nimport { CheckCircle, Info, WarningCircle, XCircle } from 'phosphor-react';\nimport Text from '../Text/Text';\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\n className={`${baseClasses} ${variantClasses} ${className ?? ''}`}\n {...props}\n >\n <span className={`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 { ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';\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={`${baseClasses} ${sizeClasses} ${weightClasses} ${color} ${className}`}\n {...props}\n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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","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,g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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"]}
@@ -25,6 +25,13 @@ __export(AlertDialog_exports, {
25
25
  module.exports = __toCommonJS(AlertDialog_exports);
26
26
  var import_react = require("react");
27
27
 
28
+ // src/utils/utils.ts
29
+ var import_clsx = require("clsx");
30
+ var import_tailwind_merge = require("tailwind-merge");
31
+ function cn(...inputs) {
32
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
33
+ }
34
+
28
35
  // src/components/Button/Button.tsx
29
36
  var import_jsx_runtime = require("react/jsx-runtime");
30
37
  var VARIANT_ACTION_CLASSES = {
@@ -69,7 +76,7 @@ var Button = ({
69
76
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
70
77
  "button",
71
78
  {
72
- className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
79
+ className: cn(baseClasses, variantClasses, sizeClasses, className),
73
80
  disabled,
74
81
  type,
75
82
  ...props,
@@ -160,7 +167,11 @@ var AlertDialog = (0, import_react.forwardRef)(
160
167
  "div",
161
168
  {
162
169
  ref,
163
- className: `bg-background border border-border-100 rounded-lg shadow-lg p-6 m-3 ${sizeClasses} ${className}`,
170
+ className: cn(
171
+ "bg-background border border-border-100 rounded-lg shadow-lg p-6 m-3",
172
+ sizeClasses,
173
+ className
174
+ ),
164
175
  ...props,
165
176
  children: [
166
177
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/AlertDialog/AlertDialog.tsx","../../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';\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={`bg-background border border-border-100 rounded-lg shadow-lg p-6 m-3 ${sizeClasses} ${className}`}\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 { ButtonHTMLAttributes, ReactNode } from 'react';\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={`${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\">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;AAAA,QACC,WAAU;AAAA,QACV,SAAS;AAAA,QACT,WAAW;AAAA,QACX,eAAY;AAAA,QAGZ;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,WAAW,uEAAuE,WAAW,IAAI,SAAS;AAAA,YACzG,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","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;A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 import {
4
4
  useEffect
5
5
  } from "react";
6
6
 
7
+ // src/utils/utils.ts
8
+ import { clsx } from "clsx";
9
+ import { twMerge } from "tailwind-merge";
10
+ function cn(...inputs) {
11
+ return twMerge(clsx(inputs));
12
+ }
13
+
7
14
  // src/components/Button/Button.tsx
8
15
  import { jsx, jsxs } from "react/jsx-runtime";
9
16
  var VARIANT_ACTION_CLASSES = {
@@ -48,7 +55,7 @@ var Button = ({
48
55
  return /* @__PURE__ */ jsxs(
49
56
  "button",
50
57
  {
51
- className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
58
+ className: cn(baseClasses, variantClasses, sizeClasses, className),
52
59
  disabled,
53
60
  type,
54
61
  ...props,
@@ -139,7 +146,11 @@ var AlertDialog = forwardRef(
139
146
  "div",
140
147
  {
141
148
  ref,
142
- className: `bg-background border border-border-100 rounded-lg shadow-lg p-6 m-3 ${sizeClasses} ${className}`,
149
+ className: cn(
150
+ "bg-background border border-border-100 rounded-lg shadow-lg p-6 m-3",
151
+ sizeClasses,
152
+ className
153
+ ),
143
154
  ...props,
144
155
  children: [
145
156
  /* @__PURE__ */ jsx2(
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/AlertDialog/AlertDialog.tsx","../../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';\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={`bg-background border border-border-100 rounded-lg shadow-lg p-6 m-3 ${sizeClasses} ${className}`}\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 { ButtonHTMLAttributes, ReactNode } from 'react';\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={`${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;;;ACiGH,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;AAE7D,QAAM,cACJ;AAEF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,WAAW,IAAI,cAAc,IAAI,WAAW,IAAI,SAAS;AAAA,MACvE;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MAEH;AAAA,oBAAY,oBAAC,UAAK,WAAU,0BAA0B,oBAAS;AAAA,QAC/D;AAAA,QACA,aAAa,oBAAC,UAAK,WAAU,0BAA0B,qBAAU;AAAA;AAAA;AAAA,EACpE;AAEJ;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,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,gBAAAF,KAAA,YAEG,oBACC,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,SAAS;AAAA,QACT,WAAW;AAAA,QACX,eAAY;AAAA,QAGZ,0BAAAC;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,WAAW,uEAAuE,WAAW,IAAI,SAAS;AAAA,YACzG,GAAG;AAAA,YAEJ;AAAA,8BAAAD;AAAA,gBAAC;AAAA;AAAA,kBACC,IAAG;AAAA,kBACH,WAAU;AAAA,kBAET;AAAA;AAAA,cACH;AAAA,cACA,gBAAAA;AAAA,gBAAC;AAAA;AAAA,kBACC,IAAG;AAAA,kBACH,WAAU;AAAA,kBAET;AAAA;AAAA,cACH;AAAA,cAEA,gBAAAC,MAAC,SAAI,WAAU,qDACb;AAAA,gCAAAD,KAAC,kBAAO,SAAQ,WAAU,MAAK,SAAQ,SAAS,cAC7C,6BACH;AAAA,gBAEA,gBAAAA;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":["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","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,SAA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