analytica-frontend-lib 1.0.58 → 1.0.59

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.
@@ -654,6 +654,58 @@ import {
654
654
  XCircle
655
655
  } from "phosphor-react";
656
656
  import { Fragment as Fragment3, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
657
+ var CARD_BASE_CLASSES = {
658
+ default: "w-full bg-background border border-border-50 rounded-xl",
659
+ compact: "w-full bg-background border border-border-50 rounded-lg",
660
+ minimal: "w-full bg-background border border-border-100 rounded-md"
661
+ };
662
+ var CARD_PADDING_CLASSES = {
663
+ none: "",
664
+ small: "p-2",
665
+ medium: "p-4",
666
+ large: "p-6"
667
+ };
668
+ var CARD_MIN_HEIGHT_CLASSES = {
669
+ none: "",
670
+ small: "min-h-16",
671
+ medium: "min-h-20",
672
+ large: "min-h-24"
673
+ };
674
+ var CARD_LAYOUT_CLASSES = {
675
+ horizontal: "flex flex-row",
676
+ vertical: "flex flex-col"
677
+ };
678
+ var CARD_CURSOR_CLASSES = {
679
+ default: "",
680
+ pointer: "cursor-pointer"
681
+ };
682
+ var CardBase = forwardRef(
683
+ ({
684
+ children,
685
+ variant = "default",
686
+ layout = "horizontal",
687
+ padding = "medium",
688
+ minHeight = "medium",
689
+ cursor = "default",
690
+ className = "",
691
+ ...props
692
+ }, ref) => {
693
+ const baseClasses = CARD_BASE_CLASSES[variant];
694
+ const paddingClasses = CARD_PADDING_CLASSES[padding];
695
+ const minHeightClasses = CARD_MIN_HEIGHT_CLASSES[minHeight];
696
+ const layoutClasses = CARD_LAYOUT_CLASSES[layout];
697
+ const cursorClasses = CARD_CURSOR_CLASSES[cursor];
698
+ const combinedClasses = [
699
+ baseClasses,
700
+ paddingClasses,
701
+ minHeightClasses,
702
+ layoutClasses,
703
+ cursorClasses,
704
+ className
705
+ ].filter(Boolean).join(" ");
706
+ return /* @__PURE__ */ jsx5("div", { ref, className: combinedClasses, ...props, children });
707
+ }
708
+ );
657
709
  var ACTION_CARD_CLASSES = {
658
710
  warning: "bg-warning-background",
659
711
  success: "bg-success-300",
@@ -716,7 +768,7 @@ var CardActivesResults = forwardRef(
716
768
  children: icon
717
769
  }
718
770
  ),
719
- /* @__PURE__ */ jsx5("p", { className: "text-text-800 font-medium uppercase text-2xs", children: title }),
771
+ /* @__PURE__ */ jsx5(Text_default, { size: "2xs", weight: "medium", className: "text-text-800 uppercase", children: title }),
720
772
  /* @__PURE__ */ jsx5("p", { className: `text-lg font-bold ${actionSubTitleClasses}`, children: subTitle })
721
773
  ]
722
774
  }
@@ -749,13 +801,13 @@ var CardQuestions = forwardRef(
749
801
  const stateLabel = isDone ? "Realizado" : "N\xE3o Realizado";
750
802
  const buttonLabel = isDone ? "Ver Quest\xE3o" : "Responder";
751
803
  return /* @__PURE__ */ jsxs4(
752
- "div",
804
+ CardBase,
753
805
  {
754
806
  ref,
755
- className: `
756
- w-full flex flex-row justify-between rounded-xl p-4 gap-4 bg-background border border-border-50
757
- ${className}
758
- `,
807
+ layout: "horizontal",
808
+ padding: "medium",
809
+ minHeight: "medium",
810
+ className: `justify-between gap-4 ${className}`,
759
811
  ...props,
760
812
  children: [
761
813
  /* @__PURE__ */ jsxs4("section", { className: "flex flex-col gap-1", children: [
@@ -815,35 +867,48 @@ var CardProgress = forwardRef(
815
867
  /* @__PURE__ */ jsx5("p", { className: "text-text-600", children: endDate })
816
868
  ] })
817
869
  ] }),
818
- /* @__PURE__ */ jsx5(
819
- ProgressBar_default,
820
- {
821
- size: "medium",
822
- showPercentage: true,
823
- value: progress,
824
- "data-testid": "progress-bar"
825
- }
826
- )
870
+ /* @__PURE__ */ jsxs4("span", { className: "grid grid-cols-[1fr_auto] items-center gap-2", children: [
871
+ /* @__PURE__ */ jsx5(
872
+ ProgressBar_default,
873
+ {
874
+ size: "small",
875
+ value: progress,
876
+ "data-testid": "progress-bar"
877
+ }
878
+ ),
879
+ /* @__PURE__ */ jsxs4(
880
+ Text_default,
881
+ {
882
+ size: "xs",
883
+ weight: "medium",
884
+ className: `text-text-950 leading-none tracking-normal text-center flex-none`,
885
+ children: [
886
+ Math.round(progress),
887
+ "%"
888
+ ]
889
+ }
890
+ )
891
+ ] })
827
892
  ] }),
828
893
  vertical: /* @__PURE__ */ jsx5("p", { className: "text-sm text-text-800", children: subhead })
829
894
  };
830
895
  return /* @__PURE__ */ jsxs4(
831
- "div",
896
+ CardBase,
832
897
  {
833
898
  ref,
834
- className: `
835
- w-full flex border border-border-50 bg-background rounded-xl cursor-pointer
836
- ${isHorizontal ? "flex-row h-20" : "flex-col"}
837
- ${className}
838
- `,
899
+ layout: isHorizontal ? "horizontal" : "vertical",
900
+ padding: "none",
901
+ minHeight: "medium",
902
+ cursor: "pointer",
903
+ className: `${isHorizontal ? "h-20" : ""} ${className}`,
839
904
  ...props,
840
905
  children: [
841
906
  /* @__PURE__ */ jsx5(
842
907
  "div",
843
908
  {
844
909
  className: `
845
- flex justify-center items-center [&>svg]:size-8 text-text-950
846
- ${isHorizontal ? "w-20 h-full rounded-l-xl" : "min-h-[50px] w-full rounded-t-xl"}
910
+ flex justify-center items-center [&>svg]:size-6 text-text-950
911
+ ${isHorizontal ? "min-w-[80px] min-h-[80px] rounded-l-xl" : "min-h-[50px] w-full rounded-t-xl"}
847
912
  `,
848
913
  style: {
849
914
  backgroundColor: color
@@ -859,7 +924,7 @@ var CardProgress = forwardRef(
859
924
  ${!isHorizontal && "gap-4"}
860
925
  `,
861
926
  children: [
862
- /* @__PURE__ */ jsx5("p", { className: "text-xs font-bold text-text-950", children: header }),
927
+ /* @__PURE__ */ jsx5(Text_default, { size: "sm", weight: "bold", className: "text-text-950", children: header }),
863
928
  contentComponent[direction]
864
929
  ]
865
930
  }
@@ -879,18 +944,43 @@ var CardTopic = forwardRef(
879
944
  ...props
880
945
  }, ref) => {
881
946
  return /* @__PURE__ */ jsxs4(
882
- "div",
947
+ CardBase,
883
948
  {
884
949
  ref,
885
- className: `cursor-pointer w-full py-2 px-4 flex flex-col justify-center gap-2 bg-background border border-border-50 rounded-xl min-h-20 ${className}`,
950
+ layout: "vertical",
951
+ padding: "small",
952
+ minHeight: "medium",
953
+ cursor: "pointer",
954
+ className: `justify-center gap-2 py-2 px-4 ${className}`,
886
955
  ...props,
887
956
  children: [
888
957
  subHead && /* @__PURE__ */ jsx5("span", { className: "text-text-600 text-2xs flex flex-row gap-1", children: subHead.map((text, index) => /* @__PURE__ */ jsxs4(Fragment2, { children: [
889
958
  /* @__PURE__ */ jsx5("p", { children: text }),
890
959
  index < subHead.length - 1 && /* @__PURE__ */ jsx5("p", { children: "\u2022" })
891
960
  ] }, `${text} - ${index}`)) }),
892
- /* @__PURE__ */ jsx5("p", { className: "text-xs text-text-950 font-bold", children: header }),
893
- /* @__PURE__ */ jsx5(ProgressBar_default, { showPercentage, value: progress })
961
+ /* @__PURE__ */ jsx5("p", { className: "text-sm text-text-950 font-bold", children: header }),
962
+ /* @__PURE__ */ jsxs4("span", { className: "grid grid-cols-[1fr_auto] items-center gap-2", children: [
963
+ /* @__PURE__ */ jsx5(
964
+ ProgressBar_default,
965
+ {
966
+ size: "small",
967
+ value: progress,
968
+ "data-testid": "progress-bar"
969
+ }
970
+ ),
971
+ showPercentage && /* @__PURE__ */ jsxs4(
972
+ Text_default,
973
+ {
974
+ size: "xs",
975
+ weight: "medium",
976
+ className: `text-text-950 leading-none tracking-normal text-center flex-none`,
977
+ children: [
978
+ Math.round(progress),
979
+ "%"
980
+ ]
981
+ }
982
+ )
983
+ ] })
894
984
  ]
895
985
  }
896
986
  );
@@ -908,15 +998,18 @@ var CardPerformance = forwardRef(
908
998
  }, ref) => {
909
999
  const hasProgress = progress !== void 0;
910
1000
  return /* @__PURE__ */ jsxs4(
911
- "div",
1001
+ CardBase,
912
1002
  {
913
1003
  ref,
914
- className: `w-full min-h-20.5 flex flex-row justify-between p-4 gap-2 bg-background border border-border-50 ${className}`,
1004
+ layout: "horizontal",
1005
+ padding: "medium",
1006
+ minHeight: "large",
1007
+ className: `justify-between gap-2 ${className}`,
915
1008
  ...props,
916
1009
  children: [
917
1010
  /* @__PURE__ */ jsxs4("div", { className: "w-full flex flex-col justify-between gap-2", children: [
918
1011
  /* @__PURE__ */ jsxs4("div", { className: "flex flex-row justify-between items-center", children: [
919
- /* @__PURE__ */ jsx5("p", { className: "text-md font-bold text-text-950", children: header }),
1012
+ /* @__PURE__ */ jsx5("p", { className: "text-lg font-bold text-text-950", children: header }),
920
1013
  hasProgress && /* @__PURE__ */ jsx5(
921
1014
  Button_default,
922
1015
  {
@@ -955,13 +1048,13 @@ var CardResults = forwardRef(
955
1048
  }, ref) => {
956
1049
  const isRow = direction == "row";
957
1050
  return /* @__PURE__ */ jsxs4(
958
- "div",
1051
+ CardBase,
959
1052
  {
960
1053
  ref,
961
- className: `
962
- w-full flex border border-border-50 bg-background rounded-xl min-h-20 flex-row items-center pr-4
963
- ${className}
964
- `,
1054
+ layout: "horizontal",
1055
+ padding: "none",
1056
+ minHeight: "medium",
1057
+ className: `items-center pr-4 ${className}`,
965
1058
  ...props,
966
1059
  children: [
967
1060
  /* @__PURE__ */ jsx5(
@@ -984,7 +1077,7 @@ var CardResults = forwardRef(
984
1077
  ${isRow ? "flex-row items-center" : "flex-col"}
985
1078
  `,
986
1079
  children: [
987
- /* @__PURE__ */ jsx5("p", { className: "text-xs font-bold text-text-950", children: header }),
1080
+ /* @__PURE__ */ jsx5("p", { className: "text-sm font-bold text-text-950", children: header }),
988
1081
  /* @__PURE__ */ jsxs4("span", { className: "flex flex-row gap-1 items-center", children: [
989
1082
  /* @__PURE__ */ jsxs4(
990
1083
  Badge_default,
@@ -1025,13 +1118,13 @@ var CardResults = forwardRef(
1025
1118
  var CardStatus = forwardRef(
1026
1119
  ({ header, className, status, ...props }, ref) => {
1027
1120
  return /* @__PURE__ */ jsxs4(
1028
- "div",
1121
+ CardBase,
1029
1122
  {
1030
1123
  ref,
1031
- className: `
1032
- w-full flex border border-border-50 bg-background rounded-xl min-h-20 flex-row items-center pr-4
1033
- ${className}
1034
- `,
1124
+ layout: "horizontal",
1125
+ padding: "none",
1126
+ minHeight: "medium",
1127
+ className: `items-center pr-4 ${className}`,
1035
1128
  ...props,
1036
1129
  children: [
1037
1130
  /* @__PURE__ */ jsxs4(
@@ -1041,7 +1134,7 @@ var CardStatus = forwardRef(
1041
1134
  p-4 flex justify-between w-full h-full flex-row items-center
1042
1135
  `,
1043
1136
  children: [
1044
- /* @__PURE__ */ jsx5("p", { className: "text-xs font-bold text-text-950", children: header }),
1137
+ /* @__PURE__ */ jsx5("p", { className: "text-sm font-bold text-text-950", children: header }),
1045
1138
  status && /* @__PURE__ */ jsxs4("span", { className: "flex flex-row gap-1 items-center", children: [
1046
1139
  /* @__PURE__ */ jsx5(
1047
1140
  Badge_default,
@@ -1067,14 +1160,17 @@ var CardStatus = forwardRef(
1067
1160
  var CardSettings = forwardRef(
1068
1161
  ({ header, className, icon, ...props }, ref) => {
1069
1162
  return /* @__PURE__ */ jsxs4(
1070
- "div",
1163
+ CardBase,
1071
1164
  {
1072
1165
  ref,
1073
- className: `w-full p-2 flex flex-row items-center gap-2 text-text-700 bg-background rounded-xl ${className}`,
1166
+ layout: "horizontal",
1167
+ padding: "small",
1168
+ minHeight: "none",
1169
+ className: `border-none items-center gap-2 text-text-700 ${className}`,
1074
1170
  ...props,
1075
1171
  children: [
1076
1172
  /* @__PURE__ */ jsx5("span", { className: "[&>svg]:size-6", children: icon }),
1077
- /* @__PURE__ */ jsx5("p", { className: "w-full text-md", children: header }),
1173
+ /* @__PURE__ */ jsx5("p", { className: "w-full text-sm", children: header }),
1078
1174
  /* @__PURE__ */ jsx5(CaretRight, { size: 24, className: "cursor-pointer" })
1079
1175
  ]
1080
1176
  }
@@ -1084,10 +1180,13 @@ var CardSettings = forwardRef(
1084
1180
  var CardSupport = forwardRef(
1085
1181
  ({ header, className, direction = "col", children, ...props }, ref) => {
1086
1182
  return /* @__PURE__ */ jsxs4(
1087
- "div",
1183
+ CardBase,
1088
1184
  {
1089
1185
  ref,
1090
- className: `w-full p-4 flex flex-row items-center gap-2 text-text-700 bg-background rounded-xl ${className}`,
1186
+ layout: "horizontal",
1187
+ padding: "medium",
1188
+ minHeight: "none",
1189
+ className: `border-none items-center gap-2 text-text-700 ${className}`,
1091
1190
  ...props,
1092
1191
  children: [
1093
1192
  /* @__PURE__ */ jsxs4(
@@ -1097,7 +1196,7 @@ var CardSupport = forwardRef(
1097
1196
  w-full flex ${direction == "col" ? "flex-col" : "flex-row items-center"} gap-2
1098
1197
  `,
1099
1198
  children: [
1100
- /* @__PURE__ */ jsx5("span", { className: "w-full", children: /* @__PURE__ */ jsx5("p", { className: "text-xs text-text-950 font-bold", children: header }) }),
1199
+ /* @__PURE__ */ jsx5("span", { className: "w-full", children: /* @__PURE__ */ jsx5("p", { className: "text-sm text-text-950 font-bold", children: header }) }),
1101
1200
  /* @__PURE__ */ jsx5("span", { className: "flex flex-row gap-1", children })
1102
1201
  ]
1103
1202
  }
@@ -1123,10 +1222,14 @@ var CardForum = forwardRef(
1123
1222
  ...props
1124
1223
  }, ref) => {
1125
1224
  return /* @__PURE__ */ jsxs4(
1126
- "div",
1225
+ CardBase,
1127
1226
  {
1128
1227
  ref,
1129
- className: `w-auto h-auto p-4 rounded-lg flex flex-row gap-3 border border-border-100 bg-background ${className}`,
1228
+ layout: "horizontal",
1229
+ padding: "medium",
1230
+ minHeight: "none",
1231
+ variant: "minimal",
1232
+ className: `w-auto h-auto gap-3 ${className}`,
1130
1233
  ...props,
1131
1234
  children: [
1132
1235
  /* @__PURE__ */ jsx5(
@@ -1253,10 +1356,13 @@ var CardAudio = forwardRef(
1253
1356
  return /* @__PURE__ */ jsx5(SpeakerHigh, {});
1254
1357
  };
1255
1358
  return /* @__PURE__ */ jsxs4(
1256
- "div",
1359
+ CardBase,
1257
1360
  {
1258
1361
  ref,
1259
- className: `w-auto h-14 p-4 flex flex-row bg-background items-center gap-2 ${className}`,
1362
+ layout: "horizontal",
1363
+ padding: "medium",
1364
+ minHeight: "none",
1365
+ className: `w-auto h-14 items-center gap-2 border-none ${className}`,
1260
1366
  ...props,
1261
1367
  children: [
1262
1368
  /* @__PURE__ */ jsx5(
@@ -1411,6 +1517,7 @@ var CardAudio = forwardRef(
1411
1517
  export {
1412
1518
  CardActivesResults,
1413
1519
  CardAudio,
1520
+ CardBase,
1414
1521
  CardForum,
1415
1522
  CardPerformance,
1416
1523
  CardProgress,