analytica-frontend-lib 1.0.20 → 1.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -141,7 +141,7 @@ type BaseTextProps = {
141
141
  /** Font weight variant */
142
142
  weight?: 'hairline' | 'light' | 'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold' | 'black';
143
143
  /** Color variant - white for light backgrounds, black for dark backgrounds */
144
- color?: 'white' | 'black';
144
+ color?: string;
145
145
  /** Additional CSS classes to apply */
146
146
  className?: string;
147
147
  };
@@ -162,7 +162,7 @@ type TextProps<T extends ElementType = 'p'> = BaseTextProps & {
162
162
  * @param children - The content to display
163
163
  * @param size - The text size variant (2xs, xs, sm, md, lg, xl, 2xl, 3xl, 4xl, 5xl, 6xl)
164
164
  * @param weight - The font weight variant (hairline, light, normal, medium, semibold, bold, extrabold, black)
165
- * @param color - The color variant (white, black) - adapts to theme
165
+ * @param color - The color variant - adapts to theme
166
166
  * @param as - The HTML tag to render - determines allowed attributes via TypeScript
167
167
  * @param className - Additional CSS classes
168
168
  * @param props - HTML attributes valid for the chosen tag only
@@ -170,7 +170,7 @@ type TextProps<T extends ElementType = 'p'> = BaseTextProps & {
170
170
  *
171
171
  * @example
172
172
  * ```tsx
173
- * <Text size="lg" weight="bold" color="black">
173
+ * <Text size="lg" weight="bold" color="text-info-800">
174
174
  * This is a large, bold text
175
175
  * </Text>
176
176
  *
package/dist/index.d.ts CHANGED
@@ -141,7 +141,7 @@ type BaseTextProps = {
141
141
  /** Font weight variant */
142
142
  weight?: 'hairline' | 'light' | 'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold' | 'black';
143
143
  /** Color variant - white for light backgrounds, black for dark backgrounds */
144
- color?: 'white' | 'black';
144
+ color?: string;
145
145
  /** Additional CSS classes to apply */
146
146
  className?: string;
147
147
  };
@@ -162,7 +162,7 @@ type TextProps<T extends ElementType = 'p'> = BaseTextProps & {
162
162
  * @param children - The content to display
163
163
  * @param size - The text size variant (2xs, xs, sm, md, lg, xl, 2xl, 3xl, 4xl, 5xl, 6xl)
164
164
  * @param weight - The font weight variant (hairline, light, normal, medium, semibold, bold, extrabold, black)
165
- * @param color - The color variant (white, black) - adapts to theme
165
+ * @param color - The color variant - adapts to theme
166
166
  * @param as - The HTML tag to render - determines allowed attributes via TypeScript
167
167
  * @param className - Additional CSS classes
168
168
  * @param props - HTML attributes valid for the chosen tag only
@@ -170,7 +170,7 @@ type TextProps<T extends ElementType = 'p'> = BaseTextProps & {
170
170
  *
171
171
  * @example
172
172
  * ```tsx
173
- * <Text size="lg" weight="bold" color="black">
173
+ * <Text size="lg" weight="bold" color="text-info-800">
174
174
  * This is a large, bold text
175
175
  * </Text>
176
176
  *
package/dist/index.js CHANGED
@@ -207,14 +207,13 @@ var Text = ({
207
207
  children,
208
208
  size = "md",
209
209
  weight = "normal",
210
- color = "black",
210
+ color = "text-text-950",
211
211
  as,
212
212
  className = "",
213
213
  ...props
214
214
  }) => {
215
215
  let sizeClasses = "";
216
216
  let weightClasses = "";
217
- let colorClasses = "";
218
217
  const sizeClassMap = {
219
218
  "2xs": "text-2xs",
220
219
  xs: "text-xs",
@@ -240,17 +239,12 @@ var Text = ({
240
239
  black: "font-black"
241
240
  };
242
241
  weightClasses = weightClassMap[weight] ?? weightClassMap.normal;
243
- const colorClassMap = {
244
- white: "text-text",
245
- black: "text-text-950"
246
- };
247
- colorClasses = colorClassMap[color] ?? colorClassMap.black;
248
242
  const baseClasses = "font-primary";
249
243
  const Component = as ?? "p";
250
244
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
251
245
  Component,
252
246
  {
253
- className: `${baseClasses} ${sizeClasses} ${weightClasses} ${colorClasses} ${className}`,
247
+ className: `${baseClasses} ${sizeClasses} ${weightClasses} ${color} ${className}`,
254
248
  ...props,
255
249
  children
256
250
  }
@@ -497,7 +491,6 @@ var CheckBox = (0, import_react2.forwardRef)(
497
491
  htmlFor: inputId,
498
492
  size: sizeClasses.textSize,
499
493
  weight: "normal",
500
- color: "black",
501
494
  className: `cursor-pointer select-none leading-[150%] flex items-center font-roboto ${labelClassName}`,
502
495
  children: label
503
496
  }
@@ -507,8 +500,26 @@ var CheckBox = (0, import_react2.forwardRef)(
507
500
  ]
508
501
  }
509
502
  ),
510
- errorMessage && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { size: "sm", weight: "normal", className: "mt-1.5 text-error-600", children: errorMessage }),
511
- helperText && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { size: "sm", weight: "normal", className: "mt-1.5 text-text-500", children: helperText })
503
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
504
+ Text,
505
+ {
506
+ size: "sm",
507
+ weight: "normal",
508
+ className: "mt-1.5",
509
+ color: "text-error-600",
510
+ children: errorMessage
511
+ }
512
+ ),
513
+ helperText && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
514
+ Text,
515
+ {
516
+ size: "sm",
517
+ weight: "normal",
518
+ className: "mt-1.5",
519
+ color: "text-text-500",
520
+ children: helperText
521
+ }
522
+ )
512
523
  ] });
513
524
  }
514
525
  );
package/dist/index.mjs CHANGED
@@ -156,14 +156,13 @@ var Text = ({
156
156
  children,
157
157
  size = "md",
158
158
  weight = "normal",
159
- color = "black",
159
+ color = "text-text-950",
160
160
  as,
161
161
  className = "",
162
162
  ...props
163
163
  }) => {
164
164
  let sizeClasses = "";
165
165
  let weightClasses = "";
166
- let colorClasses = "";
167
166
  const sizeClassMap = {
168
167
  "2xs": "text-2xs",
169
168
  xs: "text-xs",
@@ -189,17 +188,12 @@ var Text = ({
189
188
  black: "font-black"
190
189
  };
191
190
  weightClasses = weightClassMap[weight] ?? weightClassMap.normal;
192
- const colorClassMap = {
193
- white: "text-text",
194
- black: "text-text-950"
195
- };
196
- colorClasses = colorClassMap[color] ?? colorClassMap.black;
197
191
  const baseClasses = "font-primary";
198
192
  const Component = as ?? "p";
199
193
  return /* @__PURE__ */ jsx4(
200
194
  Component,
201
195
  {
202
- className: `${baseClasses} ${sizeClasses} ${weightClasses} ${colorClasses} ${className}`,
196
+ className: `${baseClasses} ${sizeClasses} ${weightClasses} ${color} ${className}`,
203
197
  ...props,
204
198
  children
205
199
  }
@@ -450,7 +444,6 @@ var CheckBox = forwardRef2(
450
444
  htmlFor: inputId,
451
445
  size: sizeClasses.textSize,
452
446
  weight: "normal",
453
- color: "black",
454
447
  className: `cursor-pointer select-none leading-[150%] flex items-center font-roboto ${labelClassName}`,
455
448
  children: label
456
449
  }
@@ -460,8 +453,26 @@ var CheckBox = forwardRef2(
460
453
  ]
461
454
  }
462
455
  ),
463
- errorMessage && /* @__PURE__ */ jsx6(Text, { size: "sm", weight: "normal", className: "mt-1.5 text-error-600", children: errorMessage }),
464
- helperText && !errorMessage && /* @__PURE__ */ jsx6(Text, { size: "sm", weight: "normal", className: "mt-1.5 text-text-500", children: helperText })
456
+ errorMessage && /* @__PURE__ */ jsx6(
457
+ Text,
458
+ {
459
+ size: "sm",
460
+ weight: "normal",
461
+ className: "mt-1.5",
462
+ color: "text-error-600",
463
+ children: errorMessage
464
+ }
465
+ ),
466
+ helperText && !errorMessage && /* @__PURE__ */ jsx6(
467
+ Text,
468
+ {
469
+ size: "sm",
470
+ weight: "normal",
471
+ className: "mt-1.5",
472
+ color: "text-text-500",
473
+ children: helperText
474
+ }
475
+ )
465
476
  ] });
466
477
  }
467
478
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "analytica-frontend-lib",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
4
4
  "description": "Repositório público dos componentes utilizados nas plataformas da Analytica Ensino",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "./dist/index.js",