analytica-frontend-lib 1.0.46 → 1.0.48

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.mjs CHANGED
@@ -974,29 +974,21 @@ import {
974
974
  import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
975
975
  var SIZE_CLASSES5 = {
976
976
  small: {
977
- container: "w-72",
978
- // 288px width
979
977
  textarea: "h-24 text-sm",
980
978
  // 96px height, 14px font
981
979
  textSize: "sm"
982
980
  },
983
981
  medium: {
984
- container: "w-72",
985
- // 288px width
986
982
  textarea: "h-24 text-base",
987
983
  // 96px height, 16px font
988
984
  textSize: "md"
989
985
  },
990
986
  large: {
991
- container: "w-72",
992
- // 288px width
993
987
  textarea: "h-24 text-lg",
994
988
  // 96px height, 18px font
995
989
  textSize: "lg"
996
990
  },
997
991
  extraLarge: {
998
- container: "w-72",
999
- // 288px width
1000
992
  textarea: "h-24 text-xl",
1001
993
  // 96px height, 20px font
1002
994
  textSize: "xl"
@@ -1066,7 +1058,7 @@ var TextArea = forwardRef7(
1066
1058
  const sizeClasses = SIZE_CLASSES5[size];
1067
1059
  const stateClasses = STATE_CLASSES3[currentState];
1068
1060
  const textareaClasses = `${BASE_TEXTAREA_CLASSES} ${sizeClasses.textarea} ${stateClasses.base} ${stateClasses.hover} ${stateClasses.focus} ${className}`;
1069
- return /* @__PURE__ */ jsxs9("div", { className: `flex flex-col ${sizeClasses.container}`, children: [
1061
+ return /* @__PURE__ */ jsxs9("div", { className: `flex flex-col`, children: [
1070
1062
  label && /* @__PURE__ */ jsx12(
1071
1063
  Text_default,
1072
1064
  {
@@ -2899,40 +2891,33 @@ var Modal = ({
2899
2891
  if (!isOpen) return null;
2900
2892
  const sizeClasses = SIZE_CLASSES10[size];
2901
2893
  const baseClasses = "bg-background rounded-3xl shadow-hard-shadow-2 border border-border-100 w-full mx-4";
2902
- const modalClasses = `${baseClasses} ${sizeClasses} ${className}`;
2894
+ const dialogResetClasses = "p-0 m-0 border-none outline-none max-h-none static";
2895
+ const modalClasses = `${baseClasses} ${sizeClasses} ${dialogResetClasses} ${className}`;
2903
2896
  return /* @__PURE__ */ jsx22(
2904
2897
  "div",
2905
2898
  {
2906
2899
  className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-xs",
2907
2900
  onClick: handleBackdropClick,
2908
2901
  onKeyDown: handleBackdropKeyDown,
2909
- role: "none",
2910
- "aria-hidden": "true",
2911
- children: /* @__PURE__ */ jsxs17(
2912
- "div",
2913
- {
2914
- className: modalClasses,
2915
- role: "dialog",
2916
- "aria-modal": "true",
2917
- "aria-labelledby": "modal-title",
2918
- children: [
2919
- /* @__PURE__ */ jsxs17("div", { className: "flex items-center justify-between px-6 py-6", children: [
2920
- /* @__PURE__ */ jsx22("h2", { id: "modal-title", className: "text-lg font-semibold text-text-950", children: title }),
2921
- !hideCloseButton && /* @__PURE__ */ jsx22(
2922
- "button",
2923
- {
2924
- onClick: onClose,
2925
- className: "p-1 text-text-500 hover:text-text-700 hover:bg-background-50 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-indicator-info focus:ring-offset-2",
2926
- "aria-label": "Fechar modal",
2927
- children: /* @__PURE__ */ jsx22(X2, { size: 18 })
2928
- }
2929
- )
2930
- ] }),
2931
- /* @__PURE__ */ jsx22("div", { className: "px-6 pb-6", children: /* @__PURE__ */ jsx22("div", { className: "text-text-500 font-normal text-sm leading-6", children }) }),
2932
- footer && /* @__PURE__ */ jsx22("div", { className: "flex justify-end gap-3 px-6 pb-6", children: footer })
2933
- ]
2934
- }
2935
- )
2902
+ role: "button",
2903
+ tabIndex: closeOnBackdropClick ? 0 : -1,
2904
+ "aria-label": "Fechar modal clicando no fundo",
2905
+ children: /* @__PURE__ */ jsxs17("dialog", { className: modalClasses, "aria-labelledby": "modal-title", open: true, children: [
2906
+ /* @__PURE__ */ jsxs17("div", { className: "flex items-center justify-between px-6 py-6", children: [
2907
+ /* @__PURE__ */ jsx22("h2", { id: "modal-title", className: "text-lg font-semibold text-text-950", children: title }),
2908
+ !hideCloseButton && /* @__PURE__ */ jsx22(
2909
+ "button",
2910
+ {
2911
+ onClick: onClose,
2912
+ className: "p-1 text-text-500 hover:text-text-700 hover:bg-background-50 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-indicator-info focus:ring-offset-2",
2913
+ "aria-label": "Fechar modal",
2914
+ children: /* @__PURE__ */ jsx22(X2, { size: 18 })
2915
+ }
2916
+ )
2917
+ ] }),
2918
+ /* @__PURE__ */ jsx22("div", { className: "px-6 pb-6", children: /* @__PURE__ */ jsx22("div", { className: "text-text-500 font-normal text-sm leading-6", children }) }),
2919
+ footer && /* @__PURE__ */ jsx22("div", { className: "flex justify-end gap-3 px-6 pb-6", children: footer })
2920
+ ] })
2936
2921
  }
2937
2922
  );
2938
2923
  };
@@ -3332,9 +3317,9 @@ import {
3332
3317
  import { CaretDown, Check as Check4 } from "phosphor-react";
3333
3318
  import { Fragment as Fragment3, jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
3334
3319
  var VARIANT_CLASSES4 = {
3335
- outlined: "border-2 rounded-sm focus:border-primary-950",
3336
- underlined: "border-b-2 focus:border-primary-950",
3337
- rounded: "border-2 rounded-4xl focus:border-primary-950"
3320
+ outlined: "border rounded-sm focus:border-primary-950",
3321
+ underlined: "border-b focus:border-primary-950",
3322
+ rounded: "border rounded-4xl focus:border-primary-950"
3338
3323
  };
3339
3324
  var SIZE_CLASSES11 = {
3340
3325
  small: "text-sm",
@@ -3508,7 +3493,7 @@ var SelectTrigger = forwardRef10(
3508
3493
  ref,
3509
3494
  className: `
3510
3495
  flex h-9 min-w-[220px] w-full items-center justify-between border-border-300 px-3 py-2
3511
- ${invalid && "border-indicator-error text-text-600"}
3496
+ ${invalid && `${variant == "underlined" ? "border-b-2" : "border-2"} border-indicator-error text-text-600`}
3512
3497
  ${disabled ? "cursor-not-allowed text-text-400 pointer-events-none opacity-50" : "cursor-pointer hover:bg-background-50 focus:bg-accent focus:text-accent-foreground hover:bg-accent hover:text-accent-foreground"}
3513
3498
  ${!invalid && !disabled ? "text-text-700" : ""}
3514
3499
  ${variantClasses}
@@ -3704,6 +3689,9 @@ var MenuItem = forwardRef11(
3704
3689
  if (["Enter", " "].includes(e.key)) handleClick(e);
3705
3690
  },
3706
3691
  tabIndex: disabled ? -1 : 0,
3692
+ onMouseDown: (e) => {
3693
+ e.preventDefault();
3694
+ },
3707
3695
  ...props
3708
3696
  };
3709
3697
  const variants = {
@@ -3788,7 +3776,12 @@ var Menu_default = Menu;
3788
3776
 
3789
3777
  // src/components/Card/Card.tsx
3790
3778
  import { forwardRef as forwardRef12, Fragment as Fragment4 } from "react";
3791
- import { CaretRight as CaretRight2, CheckCircle as CheckCircle3, XCircle as XCircle2 } from "phosphor-react";
3779
+ import {
3780
+ CaretRight as CaretRight2,
3781
+ ChatCircleText,
3782
+ CheckCircle as CheckCircle3,
3783
+ XCircle as XCircle2
3784
+ } from "phosphor-react";
3792
3785
  import { Fragment as Fragment5, jsx as jsx26, jsxs as jsxs21 } from "react/jsx-runtime";
3793
3786
  var ACTION_CARD_CLASSES = {
3794
3787
  warning: "bg-warning-background",
@@ -3912,7 +3905,14 @@ var CardQuestions = forwardRef12(
3912
3905
  ] })
3913
3906
  ] })
3914
3907
  ] }),
3915
- /* @__PURE__ */ jsx26(Button_default, { size: "extra-small", onClick: () => onClickButton?.(valueButton), children: buttonLabel })
3908
+ /* @__PURE__ */ jsx26("span", { children: /* @__PURE__ */ jsx26(
3909
+ Button_default,
3910
+ {
3911
+ size: "extra-small",
3912
+ onClick: () => onClickButton?.(valueButton),
3913
+ children: buttonLabel
3914
+ }
3915
+ ) })
3916
3916
  ]
3917
3917
  }
3918
3918
  );
@@ -4040,7 +4040,7 @@ var CardPerformance = forwardRef12(
4040
4040
  "div",
4041
4041
  {
4042
4042
  ref,
4043
- className: `w-full h-20.5 flex flex-row justify-between p-4 gap-2 bg-background border border-border-50 ${className}`,
4043
+ className: `w-full min-h-20.5 flex flex-row justify-between p-4 gap-2 bg-background border border-border-50 ${className}`,
4044
4044
  ...props,
4045
4045
  children: [
4046
4046
  /* @__PURE__ */ jsxs21("div", { className: "w-full flex flex-col justify-between gap-2", children: [
@@ -4061,7 +4061,7 @@ var CardPerformance = forwardRef12(
4061
4061
  !hasProgress && /* @__PURE__ */ jsx26(
4062
4062
  CaretRight2,
4063
4063
  {
4064
- className: "size-4.5",
4064
+ className: "size-4.5 text-text-800",
4065
4065
  "data-testid": "caret-icon",
4066
4066
  onClick: () => onClickButton?.(valueButton)
4067
4067
  }
@@ -4145,7 +4145,7 @@ var CardResults = forwardRef12(
4145
4145
  ]
4146
4146
  }
4147
4147
  ),
4148
- /* @__PURE__ */ jsx26(CaretRight2, { className: "min-w-6 min-h-6" })
4148
+ /* @__PURE__ */ jsx26(CaretRight2, { className: "min-w-6 min-h-6 text-text-800" })
4149
4149
  ]
4150
4150
  }
4151
4151
  );
@@ -4187,7 +4187,114 @@ var CardStatus = forwardRef12(
4187
4187
  ]
4188
4188
  }
4189
4189
  ),
4190
- /* @__PURE__ */ jsx26(CaretRight2, { className: "min-w-6 min-h-6" })
4190
+ /* @__PURE__ */ jsx26(CaretRight2, { className: "min-w-6 min-h-6 text-text-800" })
4191
+ ]
4192
+ }
4193
+ );
4194
+ }
4195
+ );
4196
+ var CardSettings = forwardRef12(
4197
+ ({ header, className, icon, ...props }, ref) => {
4198
+ return /* @__PURE__ */ jsxs21(
4199
+ "div",
4200
+ {
4201
+ ref,
4202
+ className: `w-full p-2 flex flex-row items-center gap-2 text-text-700 bg-background rounded-xl ${className}`,
4203
+ ...props,
4204
+ children: [
4205
+ /* @__PURE__ */ jsx26("span", { className: "[&>svg]:size-6", children: icon }),
4206
+ /* @__PURE__ */ jsx26("p", { className: "w-full text-md", children: header }),
4207
+ /* @__PURE__ */ jsx26(CaretRight2, { size: 24 })
4208
+ ]
4209
+ }
4210
+ );
4211
+ }
4212
+ );
4213
+ var CardSupport = forwardRef12(
4214
+ ({ header, className, direction = "col", children, ...props }, ref) => {
4215
+ return /* @__PURE__ */ jsxs21(
4216
+ "div",
4217
+ {
4218
+ ref,
4219
+ className: `w-full p-4 flex flex-row items-center gap-2 text-text-700 bg-background rounded-xl ${className}`,
4220
+ ...props,
4221
+ children: [
4222
+ /* @__PURE__ */ jsxs21(
4223
+ "div",
4224
+ {
4225
+ className: `
4226
+ w-full flex ${direction == "col" ? "flex-col" : "flex-row items-center"} gap-2
4227
+ `,
4228
+ children: [
4229
+ /* @__PURE__ */ jsx26("span", { className: "w-full", children: /* @__PURE__ */ jsx26("p", { className: "text-xs text-text-950 font-bold", children: header }) }),
4230
+ /* @__PURE__ */ jsx26("span", { className: "flex flex-row gap-1", children })
4231
+ ]
4232
+ }
4233
+ ),
4234
+ /* @__PURE__ */ jsx26(CaretRight2, { className: "text-text-800", size: 24 })
4235
+ ]
4236
+ }
4237
+ );
4238
+ }
4239
+ );
4240
+ var CardForum = forwardRef12(
4241
+ ({
4242
+ title,
4243
+ content,
4244
+ comments,
4245
+ onClickComments,
4246
+ valueComments,
4247
+ onClickProfile,
4248
+ valueProfile,
4249
+ className = "",
4250
+ date,
4251
+ hour,
4252
+ ...props
4253
+ }, ref) => {
4254
+ return /* @__PURE__ */ jsxs21(
4255
+ "div",
4256
+ {
4257
+ ref,
4258
+ className: `w-auto h-auto p-4 rounded-lg flex flex-row gap-3 border border-border-100 bg-background ${className}`,
4259
+ ...props,
4260
+ children: [
4261
+ /* @__PURE__ */ jsx26(
4262
+ "button",
4263
+ {
4264
+ type: "button",
4265
+ "aria-label": "Ver perfil",
4266
+ onClick: () => onClickProfile?.(valueProfile),
4267
+ className: "min-w-8 h-8 rounded-full bg-background-950"
4268
+ }
4269
+ ),
4270
+ /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-2 flex-1", children: [
4271
+ /* @__PURE__ */ jsxs21("div", { className: "flex flex-row gap-1 items-center flex-wrap", children: [
4272
+ /* @__PURE__ */ jsx26("p", { className: "text-xs font-semibold text-primary-700 truncate", children: title }),
4273
+ /* @__PURE__ */ jsxs21("p", { className: "text-xs text-text-600", children: [
4274
+ "\u2022 ",
4275
+ date,
4276
+ " \u2022 ",
4277
+ hour
4278
+ ] })
4279
+ ] }),
4280
+ /* @__PURE__ */ jsx26("p", { className: "text-text-950 text-sm line-clamp-2", children: content }),
4281
+ /* @__PURE__ */ jsxs21(
4282
+ "button",
4283
+ {
4284
+ type: "button",
4285
+ "aria-label": "Ver coment\xE1rios",
4286
+ onClick: () => onClickComments?.(valueComments),
4287
+ className: "text-text-600 flex flex-row gap-2 items-center",
4288
+ children: [
4289
+ /* @__PURE__ */ jsx26(ChatCircleText, { "aria-hidden": "true", size: 16 }),
4290
+ /* @__PURE__ */ jsxs21("p", { className: "text-xs", children: [
4291
+ comments,
4292
+ " respostas"
4293
+ ] })
4294
+ ]
4295
+ }
4296
+ )
4297
+ ] })
4191
4298
  ]
4192
4299
  }
4193
4300
  );