analytica-frontend-lib 1.1.52 → 1.1.53
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/NotificationCard/index.js +171 -73
- package/dist/NotificationCard/index.js.map +1 -1
- package/dist/NotificationCard/index.mjs +171 -73
- package/dist/NotificationCard/index.mjs.map +1 -1
- package/dist/index.js +19 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -24,7 +24,7 @@ __export(NotificationCard_exports, {
|
|
|
24
24
|
default: () => NotificationCard_default
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(NotificationCard_exports);
|
|
27
|
-
var
|
|
27
|
+
var import_phosphor_react4 = require("phosphor-react");
|
|
28
28
|
var import_react6 = require("react");
|
|
29
29
|
|
|
30
30
|
// src/utils/utils.ts
|
|
@@ -805,6 +805,103 @@ var Text = ({
|
|
|
805
805
|
};
|
|
806
806
|
var Text_default = Text;
|
|
807
807
|
|
|
808
|
+
// src/components/Badge/Badge.tsx
|
|
809
|
+
var import_phosphor_react3 = require("phosphor-react");
|
|
810
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
811
|
+
var VARIANT_ACTION_CLASSES2 = {
|
|
812
|
+
solid: {
|
|
813
|
+
error: "bg-error-background text-error-700 focus-visible:outline-none",
|
|
814
|
+
warning: "bg-warning text-warning-800 focus-visible:outline-none",
|
|
815
|
+
success: "bg-success text-success-800 focus-visible:outline-none",
|
|
816
|
+
info: "bg-info text-info-800 focus-visible:outline-none",
|
|
817
|
+
muted: "bg-background-muted text-background-800 focus-visible:outline-none"
|
|
818
|
+
},
|
|
819
|
+
outlined: {
|
|
820
|
+
error: "bg-error text-error-700 border border-error-300 focus-visible:outline-none",
|
|
821
|
+
warning: "bg-warning text-warning-800 border border-warning-300 focus-visible:outline-none",
|
|
822
|
+
success: "bg-success text-success-800 border border-success-300 focus-visible:outline-none",
|
|
823
|
+
info: "bg-info text-info-800 border border-info-300 focus-visible:outline-none",
|
|
824
|
+
muted: "bg-background-muted text-background-800 border border-border-300 focus-visible:outline-none"
|
|
825
|
+
},
|
|
826
|
+
exams: {
|
|
827
|
+
exam1: "bg-exam-1 text-info-700 focus-visible:outline-none",
|
|
828
|
+
exam2: "bg-exam-2 text-typography-1 focus-visible:outline-none",
|
|
829
|
+
exam3: "bg-exam-3 text-typography-2 focus-visible:outline-none",
|
|
830
|
+
exam4: "bg-exam-4 text-success-700 focus-visible:outline-none"
|
|
831
|
+
},
|
|
832
|
+
examsOutlined: {
|
|
833
|
+
exam1: "bg-exam-1 text-info-700 border border-info-700 focus-visible:outline-none",
|
|
834
|
+
exam2: "bg-exam-2 text-typography-1 border border-typography-1 focus-visible:outline-none",
|
|
835
|
+
exam3: "bg-exam-3 text-typography-2 border border-typography-2 focus-visible:outline-none",
|
|
836
|
+
exam4: "bg-exam-4 text-success-700 border border-success-700 focus-visible:outline-none"
|
|
837
|
+
},
|
|
838
|
+
resultStatus: {
|
|
839
|
+
negative: "bg-error text-error-800 focus-visible:outline-none",
|
|
840
|
+
positive: "bg-success text-success-800 focus-visible:outline-none"
|
|
841
|
+
},
|
|
842
|
+
notification: "text-primary"
|
|
843
|
+
};
|
|
844
|
+
var SIZE_CLASSES3 = {
|
|
845
|
+
small: "text-2xs px-2 py-1",
|
|
846
|
+
medium: "text-xs px-2 py-1",
|
|
847
|
+
large: "text-sm px-2 py-1"
|
|
848
|
+
};
|
|
849
|
+
var SIZE_CLASSES_ICON = {
|
|
850
|
+
small: "size-3",
|
|
851
|
+
medium: "size-3.5",
|
|
852
|
+
large: "size-4"
|
|
853
|
+
};
|
|
854
|
+
var Badge = ({
|
|
855
|
+
children,
|
|
856
|
+
iconLeft,
|
|
857
|
+
iconRight,
|
|
858
|
+
size = "medium",
|
|
859
|
+
variant = "solid",
|
|
860
|
+
action = "error",
|
|
861
|
+
className = "",
|
|
862
|
+
notificationActive = false,
|
|
863
|
+
...props
|
|
864
|
+
}) => {
|
|
865
|
+
const sizeClasses = SIZE_CLASSES3[size];
|
|
866
|
+
const sizeClassesIcon = SIZE_CLASSES_ICON[size];
|
|
867
|
+
const variantActionMap = VARIANT_ACTION_CLASSES2[variant] || {};
|
|
868
|
+
const variantClasses = typeof variantActionMap === "string" ? variantActionMap : variantActionMap[action] ?? variantActionMap.muted ?? "";
|
|
869
|
+
const baseClasses = "inline-flex items-center justify-center rounded-xs font-normal gap-1 relative";
|
|
870
|
+
const baseClassesIcon = "flex items-center";
|
|
871
|
+
if (variant === "notification") {
|
|
872
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
873
|
+
"div",
|
|
874
|
+
{
|
|
875
|
+
className: cn(baseClasses, variantClasses, sizeClasses, className),
|
|
876
|
+
...props,
|
|
877
|
+
children: [
|
|
878
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_phosphor_react3.Bell, { size: 24, className: "text-current", "aria-hidden": "true" }),
|
|
879
|
+
notificationActive && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
880
|
+
"span",
|
|
881
|
+
{
|
|
882
|
+
"data-testid": "notification-dot",
|
|
883
|
+
className: "absolute top-[5px] right-[10px] block h-2 w-2 rounded-full bg-indicator-error ring-2 ring-white"
|
|
884
|
+
}
|
|
885
|
+
)
|
|
886
|
+
]
|
|
887
|
+
}
|
|
888
|
+
);
|
|
889
|
+
}
|
|
890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
891
|
+
"div",
|
|
892
|
+
{
|
|
893
|
+
className: cn(baseClasses, variantClasses, sizeClasses, className),
|
|
894
|
+
...props,
|
|
895
|
+
children: [
|
|
896
|
+
iconLeft && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: cn(baseClassesIcon, sizeClassesIcon), children: iconLeft }),
|
|
897
|
+
children,
|
|
898
|
+
iconRight && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: cn(baseClassesIcon, sizeClassesIcon), children: iconRight })
|
|
899
|
+
]
|
|
900
|
+
}
|
|
901
|
+
);
|
|
902
|
+
};
|
|
903
|
+
var Badge_default = Badge;
|
|
904
|
+
|
|
808
905
|
// src/hooks/useMobile.ts
|
|
809
906
|
var import_react5 = require("react");
|
|
810
907
|
var MOBILE_WIDTH = 500;
|
|
@@ -895,14 +992,14 @@ var formatTimeAgo = (date) => {
|
|
|
895
992
|
};
|
|
896
993
|
|
|
897
994
|
// src/components/NotificationCard/NotificationCard.tsx
|
|
898
|
-
var
|
|
995
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
899
996
|
var NotificationEmpty = ({
|
|
900
997
|
emptyStateImage,
|
|
901
998
|
emptyStateTitle = "Nenhuma notifica\xE7\xE3o no momento",
|
|
902
999
|
emptyStateDescription = "Voc\xEA est\xE1 em dia com todas as novidades. Volte depois para conferir atualiza\xE7\xF5es!"
|
|
903
1000
|
}) => {
|
|
904
|
-
return /* @__PURE__ */ (0,
|
|
905
|
-
emptyStateImage && /* @__PURE__ */ (0,
|
|
1001
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col items-center justify-center gap-4 p-6 w-full", children: [
|
|
1002
|
+
emptyStateImage && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w-20 h-20 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
906
1003
|
"img",
|
|
907
1004
|
{
|
|
908
1005
|
src: emptyStateImage,
|
|
@@ -912,20 +1009,27 @@ var NotificationEmpty = ({
|
|
|
912
1009
|
className: "object-contain"
|
|
913
1010
|
}
|
|
914
1011
|
) }),
|
|
915
|
-
/* @__PURE__ */ (0,
|
|
916
|
-
/* @__PURE__ */ (0,
|
|
1012
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h3", { className: "text-xl font-semibold text-text-950 text-center leading-[23px]", children: emptyStateTitle }),
|
|
1013
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-sm font-normal text-text-400 text-center max-w-[316px] leading-[21px]", children: emptyStateDescription })
|
|
917
1014
|
] });
|
|
918
1015
|
};
|
|
919
1016
|
var NotificationHeader = ({
|
|
920
1017
|
unreadCount,
|
|
921
1018
|
variant = "modal"
|
|
922
1019
|
}) => {
|
|
923
|
-
return /* @__PURE__ */ (0,
|
|
924
|
-
variant === "modal" ? /* @__PURE__ */ (0,
|
|
925
|
-
unreadCount > 0 && /* @__PURE__ */ (0,
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
1020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
1021
|
+
variant === "modal" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text_default, { size: "sm", weight: "bold", className: "text-text-950", children: "Notifica\xE7\xF5es" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h3", { className: "text-sm font-semibold text-text-950", children: "Notifica\xE7\xF5es" }),
|
|
1022
|
+
unreadCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1023
|
+
Badge_default,
|
|
1024
|
+
{
|
|
1025
|
+
variant: "solid",
|
|
1026
|
+
action: "info",
|
|
1027
|
+
size: "small",
|
|
1028
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_phosphor_react4.Bell, { size: 12, "aria-hidden": "true", focusable: "false" }),
|
|
1029
|
+
className: "border-0",
|
|
1030
|
+
children: unreadCount === 1 ? "1 n\xE3o lida" : `${unreadCount} n\xE3o lidas`
|
|
1031
|
+
}
|
|
1032
|
+
)
|
|
929
1033
|
] });
|
|
930
1034
|
};
|
|
931
1035
|
var SingleNotificationCard = ({
|
|
@@ -957,7 +1061,7 @@ var SingleNotificationCard = ({
|
|
|
957
1061
|
onNavigate();
|
|
958
1062
|
}
|
|
959
1063
|
};
|
|
960
|
-
return /* @__PURE__ */ (0,
|
|
1064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
961
1065
|
"div",
|
|
962
1066
|
{
|
|
963
1067
|
className: cn(
|
|
@@ -966,20 +1070,20 @@ var SingleNotificationCard = ({
|
|
|
966
1070
|
className
|
|
967
1071
|
),
|
|
968
1072
|
children: [
|
|
969
|
-
/* @__PURE__ */ (0,
|
|
970
|
-
!isRead && /* @__PURE__ */ (0,
|
|
971
|
-
/* @__PURE__ */ (0,
|
|
972
|
-
/* @__PURE__ */ (0,
|
|
973
|
-
/* @__PURE__ */ (0,
|
|
1073
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex items-center gap-2 w-full", children: [
|
|
1074
|
+
!isRead && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w-[7px] h-[7px] bg-info-300 rounded-full flex-shrink-0" }),
|
|
1075
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h3", { className: "font-bold text-sm leading-4 text-text-950 flex-grow", children: title }),
|
|
1076
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(DropdownMenu_default, { children: [
|
|
1077
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
974
1078
|
DropdownMenuTrigger,
|
|
975
1079
|
{
|
|
976
1080
|
className: "flex-shrink-0 inline-flex items-center justify-center font-medium bg-transparent text-text-950 cursor-pointer hover:bg-info-50 w-6 h-6 rounded-lg",
|
|
977
1081
|
"aria-label": "Menu de a\xE7\xF5es",
|
|
978
|
-
children: /* @__PURE__ */ (0,
|
|
1082
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_phosphor_react4.DotsThreeVertical, { size: 24 })
|
|
979
1083
|
}
|
|
980
1084
|
),
|
|
981
|
-
/* @__PURE__ */ (0,
|
|
982
|
-
!isRead && /* @__PURE__ */ (0,
|
|
1085
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(DropdownMenuContent, { align: "end", className: "min-w-[160px]", children: [
|
|
1086
|
+
!isRead && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
983
1087
|
DropdownMenuItem,
|
|
984
1088
|
{
|
|
985
1089
|
onClick: handleMarkAsRead,
|
|
@@ -987,14 +1091,14 @@ var SingleNotificationCard = ({
|
|
|
987
1091
|
children: "Marcar como lida"
|
|
988
1092
|
}
|
|
989
1093
|
),
|
|
990
|
-
/* @__PURE__ */ (0,
|
|
1094
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DropdownMenuItem, { onClick: handleDelete, className: "text-error-600", children: "Deletar" })
|
|
991
1095
|
] })
|
|
992
1096
|
] })
|
|
993
1097
|
] }),
|
|
994
|
-
/* @__PURE__ */ (0,
|
|
995
|
-
/* @__PURE__ */ (0,
|
|
996
|
-
/* @__PURE__ */ (0,
|
|
997
|
-
onNavigate && actionLabel && /* @__PURE__ */ (0,
|
|
1098
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-sm leading-[21px] text-text-800 w-full", children: message }),
|
|
1099
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex items-center justify-between w-full", children: [
|
|
1100
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-sm font-medium text-text-400", children: time }),
|
|
1101
|
+
onNavigate && actionLabel && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
998
1102
|
"button",
|
|
999
1103
|
{
|
|
1000
1104
|
type: "button",
|
|
@@ -1021,9 +1125,9 @@ var NotificationList = ({
|
|
|
1021
1125
|
className
|
|
1022
1126
|
}) => {
|
|
1023
1127
|
if (error) {
|
|
1024
|
-
return /* @__PURE__ */ (0,
|
|
1025
|
-
/* @__PURE__ */ (0,
|
|
1026
|
-
onRetry && /* @__PURE__ */ (0,
|
|
1128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col items-center gap-4 p-6 w-full", children: [
|
|
1129
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-sm text-error-600", children: error }),
|
|
1130
|
+
onRetry && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1027
1131
|
"button",
|
|
1028
1132
|
{
|
|
1029
1133
|
type: "button",
|
|
@@ -1035,8 +1139,8 @@ var NotificationList = ({
|
|
|
1035
1139
|
] });
|
|
1036
1140
|
}
|
|
1037
1141
|
if (loading) {
|
|
1038
|
-
return /* @__PURE__ */ (0,
|
|
1039
|
-
(skeletonId) => /* @__PURE__ */ (0,
|
|
1142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex flex-col gap-0 w-full", children: ["skeleton-first", "skeleton-second", "skeleton-third"].map(
|
|
1143
|
+
(skeletonId) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1040
1144
|
SkeletonCard,
|
|
1041
1145
|
{
|
|
1042
1146
|
className: "p-4 border-b border-border-200"
|
|
@@ -1046,11 +1150,11 @@ var NotificationList = ({
|
|
|
1046
1150
|
) });
|
|
1047
1151
|
}
|
|
1048
1152
|
if (!groupedNotifications || groupedNotifications.length === 0) {
|
|
1049
|
-
return renderEmpty ? /* @__PURE__ */ (0,
|
|
1153
|
+
return renderEmpty ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w-full", children: renderEmpty() }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(NotificationEmpty, {});
|
|
1050
1154
|
}
|
|
1051
|
-
return /* @__PURE__ */ (0,
|
|
1052
|
-
/* @__PURE__ */ (0,
|
|
1053
|
-
group.notifications.map((notification) => /* @__PURE__ */ (0,
|
|
1155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: cn("flex flex-col gap-0 w-full", className), children: groupedNotifications.map((group, idx) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col", children: [
|
|
1156
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex items-end px-4 py-6 pb-4", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h4", { className: "text-lg font-bold text-text-500 flex-grow", children: group.label }) }),
|
|
1157
|
+
group.notifications.map((notification) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1054
1158
|
SingleNotificationCard,
|
|
1055
1159
|
{
|
|
1056
1160
|
title: notification.title,
|
|
@@ -1108,7 +1212,7 @@ var NotificationCenter = ({
|
|
|
1108
1212
|
onCleanup?.();
|
|
1109
1213
|
onNavigateById?.(entityType, entityId);
|
|
1110
1214
|
};
|
|
1111
|
-
const renderEmptyState = () => /* @__PURE__ */ (0,
|
|
1215
|
+
const renderEmptyState = () => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1112
1216
|
NotificationEmpty,
|
|
1113
1217
|
{
|
|
1114
1218
|
emptyStateImage,
|
|
@@ -1117,17 +1221,17 @@ var NotificationCenter = ({
|
|
|
1117
1221
|
}
|
|
1118
1222
|
);
|
|
1119
1223
|
if (isMobile) {
|
|
1120
|
-
return /* @__PURE__ */ (0,
|
|
1121
|
-
/* @__PURE__ */ (0,
|
|
1224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1225
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1122
1226
|
IconButton_default,
|
|
1123
1227
|
{
|
|
1124
1228
|
active: isModalOpen,
|
|
1125
1229
|
onClick: handleMobileClick,
|
|
1126
|
-
icon: /* @__PURE__ */ (0,
|
|
1230
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_phosphor_react4.Bell, { size: 24, className: "text-primary" }),
|
|
1127
1231
|
className
|
|
1128
1232
|
}
|
|
1129
1233
|
),
|
|
1130
|
-
/* @__PURE__ */ (0,
|
|
1234
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1131
1235
|
Modal_default,
|
|
1132
1236
|
{
|
|
1133
1237
|
isOpen: isModalOpen,
|
|
@@ -1137,20 +1241,20 @@ var NotificationCenter = ({
|
|
|
1137
1241
|
hideCloseButton: false,
|
|
1138
1242
|
closeOnBackdropClick: true,
|
|
1139
1243
|
closeOnEscape: true,
|
|
1140
|
-
children: /* @__PURE__ */ (0,
|
|
1141
|
-
/* @__PURE__ */ (0,
|
|
1142
|
-
/* @__PURE__ */ (0,
|
|
1143
|
-
unreadCount > 0 && onMarkAllAsRead && /* @__PURE__ */ (0,
|
|
1244
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col h-full max-h-[80vh]", children: [
|
|
1245
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "px-0 pb-3 border-b border-border-200", children: [
|
|
1246
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(NotificationHeader, { unreadCount, variant: "modal" }),
|
|
1247
|
+
unreadCount > 0 && onMarkAllAsRead && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1144
1248
|
"button",
|
|
1145
1249
|
{
|
|
1146
1250
|
type: "button",
|
|
1147
1251
|
onClick: onMarkAllAsRead,
|
|
1148
|
-
className: "text-sm font-medium text-info-600 hover:text-info-700 cursor-pointer",
|
|
1252
|
+
className: "text-sm font-medium text-info-600 hover:text-info-700 cursor-pointer mt-2",
|
|
1149
1253
|
children: "Marcar todas como lidas"
|
|
1150
1254
|
}
|
|
1151
1255
|
)
|
|
1152
|
-
] })
|
|
1153
|
-
/* @__PURE__ */ (0,
|
|
1256
|
+
] }),
|
|
1257
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1154
1258
|
NotificationList,
|
|
1155
1259
|
{
|
|
1156
1260
|
groupedNotifications,
|
|
@@ -1173,14 +1277,14 @@ var NotificationCenter = ({
|
|
|
1173
1277
|
)
|
|
1174
1278
|
] });
|
|
1175
1279
|
}
|
|
1176
|
-
return /* @__PURE__ */ (0,
|
|
1177
|
-
/* @__PURE__ */ (0,
|
|
1280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(DropdownMenu_default, { children: [
|
|
1281
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DropdownMenuTrigger, { className: "text-primary cursor-pointer", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1178
1282
|
IconButton_default,
|
|
1179
1283
|
{
|
|
1180
1284
|
active: isActive,
|
|
1181
1285
|
onClick: handleDesktopClick,
|
|
1182
|
-
icon: /* @__PURE__ */ (0,
|
|
1183
|
-
|
|
1286
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1287
|
+
import_phosphor_react4.Bell,
|
|
1184
1288
|
{
|
|
1185
1289
|
size: 24,
|
|
1186
1290
|
className: isActive ? "text-primary-950" : "text-primary"
|
|
@@ -1189,32 +1293,26 @@ var NotificationCenter = ({
|
|
|
1189
1293
|
className
|
|
1190
1294
|
}
|
|
1191
1295
|
) }),
|
|
1192
|
-
/* @__PURE__ */ (0,
|
|
1296
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1193
1297
|
DropdownMenuContent,
|
|
1194
1298
|
{
|
|
1195
1299
|
className: "min-w-[320px] max-w-[400px] max-h-[500px] overflow-hidden",
|
|
1196
1300
|
side: "bottom",
|
|
1197
1301
|
align: "end",
|
|
1198
|
-
children: /* @__PURE__ */ (0,
|
|
1199
|
-
/* @__PURE__ */ (0,
|
|
1200
|
-
/* @__PURE__ */ (0,
|
|
1201
|
-
|
|
1202
|
-
{
|
|
1203
|
-
unreadCount,
|
|
1204
|
-
variant: "dropdown"
|
|
1205
|
-
}
|
|
1206
|
-
),
|
|
1207
|
-
unreadCount > 0 && onMarkAllAsRead && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1302
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col", children: [
|
|
1303
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "px-4 py-3 border-b border-border-200", children: [
|
|
1304
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(NotificationHeader, { unreadCount, variant: "dropdown" }),
|
|
1305
|
+
unreadCount > 0 && onMarkAllAsRead && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1208
1306
|
"button",
|
|
1209
1307
|
{
|
|
1210
1308
|
type: "button",
|
|
1211
1309
|
onClick: onMarkAllAsRead,
|
|
1212
|
-
className: "text-sm font-medium text-info-600 hover:text-info-700 cursor-pointer",
|
|
1310
|
+
className: "text-sm font-medium text-info-600 hover:text-info-700 cursor-pointer mt-2",
|
|
1213
1311
|
children: "Marcar todas como lidas"
|
|
1214
1312
|
}
|
|
1215
1313
|
)
|
|
1216
|
-
] })
|
|
1217
|
-
/* @__PURE__ */ (0,
|
|
1314
|
+
] }),
|
|
1315
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1218
1316
|
NotificationList,
|
|
1219
1317
|
{
|
|
1220
1318
|
groupedNotifications,
|
|
@@ -1236,7 +1334,7 @@ var NotificationCenter = ({
|
|
|
1236
1334
|
var NotificationCard = (props) => {
|
|
1237
1335
|
switch (props.mode) {
|
|
1238
1336
|
case "single":
|
|
1239
|
-
return /* @__PURE__ */ (0,
|
|
1337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1240
1338
|
SingleNotificationCard,
|
|
1241
1339
|
{
|
|
1242
1340
|
title: props.title,
|
|
@@ -1251,7 +1349,7 @@ var NotificationCard = (props) => {
|
|
|
1251
1349
|
}
|
|
1252
1350
|
);
|
|
1253
1351
|
case "list":
|
|
1254
|
-
return /* @__PURE__ */ (0,
|
|
1352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1255
1353
|
NotificationList,
|
|
1256
1354
|
{
|
|
1257
1355
|
groupedNotifications: props.groupedNotifications ?? (props.notifications ? [
|
|
@@ -1272,9 +1370,9 @@ var NotificationCard = (props) => {
|
|
|
1272
1370
|
}
|
|
1273
1371
|
);
|
|
1274
1372
|
case "center":
|
|
1275
|
-
return /* @__PURE__ */ (0,
|
|
1373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(NotificationCenter, { ...props });
|
|
1276
1374
|
default:
|
|
1277
|
-
return /* @__PURE__ */ (0,
|
|
1375
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex flex-col items-center gap-4 p-6 w-full", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-sm text-text-600", children: "Modo de notifica\xE7\xE3o n\xE3o reconhecido" }) });
|
|
1278
1376
|
}
|
|
1279
1377
|
};
|
|
1280
1378
|
var LegacyNotificationCard = (props) => {
|
|
@@ -1283,10 +1381,10 @@ var LegacyNotificationCard = (props) => {
|
|
|
1283
1381
|
mode: "center",
|
|
1284
1382
|
...props
|
|
1285
1383
|
};
|
|
1286
|
-
return /* @__PURE__ */ (0,
|
|
1384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(NotificationCenter, { ...centerProps });
|
|
1287
1385
|
}
|
|
1288
1386
|
if (props.groupedNotifications !== void 0 || props.notifications !== void 0 || props.loading || props.error) {
|
|
1289
|
-
return /* @__PURE__ */ (0,
|
|
1387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1290
1388
|
NotificationList,
|
|
1291
1389
|
{
|
|
1292
1390
|
groupedNotifications: props.groupedNotifications ?? (props.notifications ? [
|
|
@@ -1323,7 +1421,7 @@ var LegacyNotificationCard = (props) => {
|
|
|
1323
1421
|
emptyStateTitle: props.emptyStateTitle,
|
|
1324
1422
|
emptyStateDescription: props.emptyStateDescription
|
|
1325
1423
|
};
|
|
1326
|
-
return /* @__PURE__ */ (0,
|
|
1424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1327
1425
|
SingleNotificationCard,
|
|
1328
1426
|
{
|
|
1329
1427
|
title: singleProps.title,
|
|
@@ -1338,7 +1436,7 @@ var LegacyNotificationCard = (props) => {
|
|
|
1338
1436
|
}
|
|
1339
1437
|
);
|
|
1340
1438
|
}
|
|
1341
|
-
return /* @__PURE__ */ (0,
|
|
1439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex flex-col items-center gap-4 p-6 w-full", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-sm text-text-600", children: "Nenhuma notifica\xE7\xE3o configurada" }) });
|
|
1342
1440
|
};
|
|
1343
1441
|
var NotificationCard_default = NotificationCard;
|
|
1344
1442
|
// Annotate the CommonJS export names for ESM import in node:
|