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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/components/NotificationCard/NotificationCard.tsx
|
|
2
|
-
import { DotsThreeVertical, Bell } from "phosphor-react";
|
|
2
|
+
import { DotsThreeVertical, Bell as Bell2 } from "phosphor-react";
|
|
3
3
|
import { useState as useState3, useEffect as useEffect4 } from "react";
|
|
4
4
|
|
|
5
5
|
// src/utils/utils.ts
|
|
@@ -788,6 +788,103 @@ var Text = ({
|
|
|
788
788
|
};
|
|
789
789
|
var Text_default = Text;
|
|
790
790
|
|
|
791
|
+
// src/components/Badge/Badge.tsx
|
|
792
|
+
import { Bell } from "phosphor-react";
|
|
793
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
794
|
+
var VARIANT_ACTION_CLASSES2 = {
|
|
795
|
+
solid: {
|
|
796
|
+
error: "bg-error-background text-error-700 focus-visible:outline-none",
|
|
797
|
+
warning: "bg-warning text-warning-800 focus-visible:outline-none",
|
|
798
|
+
success: "bg-success text-success-800 focus-visible:outline-none",
|
|
799
|
+
info: "bg-info text-info-800 focus-visible:outline-none",
|
|
800
|
+
muted: "bg-background-muted text-background-800 focus-visible:outline-none"
|
|
801
|
+
},
|
|
802
|
+
outlined: {
|
|
803
|
+
error: "bg-error text-error-700 border border-error-300 focus-visible:outline-none",
|
|
804
|
+
warning: "bg-warning text-warning-800 border border-warning-300 focus-visible:outline-none",
|
|
805
|
+
success: "bg-success text-success-800 border border-success-300 focus-visible:outline-none",
|
|
806
|
+
info: "bg-info text-info-800 border border-info-300 focus-visible:outline-none",
|
|
807
|
+
muted: "bg-background-muted text-background-800 border border-border-300 focus-visible:outline-none"
|
|
808
|
+
},
|
|
809
|
+
exams: {
|
|
810
|
+
exam1: "bg-exam-1 text-info-700 focus-visible:outline-none",
|
|
811
|
+
exam2: "bg-exam-2 text-typography-1 focus-visible:outline-none",
|
|
812
|
+
exam3: "bg-exam-3 text-typography-2 focus-visible:outline-none",
|
|
813
|
+
exam4: "bg-exam-4 text-success-700 focus-visible:outline-none"
|
|
814
|
+
},
|
|
815
|
+
examsOutlined: {
|
|
816
|
+
exam1: "bg-exam-1 text-info-700 border border-info-700 focus-visible:outline-none",
|
|
817
|
+
exam2: "bg-exam-2 text-typography-1 border border-typography-1 focus-visible:outline-none",
|
|
818
|
+
exam3: "bg-exam-3 text-typography-2 border border-typography-2 focus-visible:outline-none",
|
|
819
|
+
exam4: "bg-exam-4 text-success-700 border border-success-700 focus-visible:outline-none"
|
|
820
|
+
},
|
|
821
|
+
resultStatus: {
|
|
822
|
+
negative: "bg-error text-error-800 focus-visible:outline-none",
|
|
823
|
+
positive: "bg-success text-success-800 focus-visible:outline-none"
|
|
824
|
+
},
|
|
825
|
+
notification: "text-primary"
|
|
826
|
+
};
|
|
827
|
+
var SIZE_CLASSES3 = {
|
|
828
|
+
small: "text-2xs px-2 py-1",
|
|
829
|
+
medium: "text-xs px-2 py-1",
|
|
830
|
+
large: "text-sm px-2 py-1"
|
|
831
|
+
};
|
|
832
|
+
var SIZE_CLASSES_ICON = {
|
|
833
|
+
small: "size-3",
|
|
834
|
+
medium: "size-3.5",
|
|
835
|
+
large: "size-4"
|
|
836
|
+
};
|
|
837
|
+
var Badge = ({
|
|
838
|
+
children,
|
|
839
|
+
iconLeft,
|
|
840
|
+
iconRight,
|
|
841
|
+
size = "medium",
|
|
842
|
+
variant = "solid",
|
|
843
|
+
action = "error",
|
|
844
|
+
className = "",
|
|
845
|
+
notificationActive = false,
|
|
846
|
+
...props
|
|
847
|
+
}) => {
|
|
848
|
+
const sizeClasses = SIZE_CLASSES3[size];
|
|
849
|
+
const sizeClassesIcon = SIZE_CLASSES_ICON[size];
|
|
850
|
+
const variantActionMap = VARIANT_ACTION_CLASSES2[variant] || {};
|
|
851
|
+
const variantClasses = typeof variantActionMap === "string" ? variantActionMap : variantActionMap[action] ?? variantActionMap.muted ?? "";
|
|
852
|
+
const baseClasses = "inline-flex items-center justify-center rounded-xs font-normal gap-1 relative";
|
|
853
|
+
const baseClassesIcon = "flex items-center";
|
|
854
|
+
if (variant === "notification") {
|
|
855
|
+
return /* @__PURE__ */ jsxs5(
|
|
856
|
+
"div",
|
|
857
|
+
{
|
|
858
|
+
className: cn(baseClasses, variantClasses, sizeClasses, className),
|
|
859
|
+
...props,
|
|
860
|
+
children: [
|
|
861
|
+
/* @__PURE__ */ jsx7(Bell, { size: 24, className: "text-current", "aria-hidden": "true" }),
|
|
862
|
+
notificationActive && /* @__PURE__ */ jsx7(
|
|
863
|
+
"span",
|
|
864
|
+
{
|
|
865
|
+
"data-testid": "notification-dot",
|
|
866
|
+
className: "absolute top-[5px] right-[10px] block h-2 w-2 rounded-full bg-indicator-error ring-2 ring-white"
|
|
867
|
+
}
|
|
868
|
+
)
|
|
869
|
+
]
|
|
870
|
+
}
|
|
871
|
+
);
|
|
872
|
+
}
|
|
873
|
+
return /* @__PURE__ */ jsxs5(
|
|
874
|
+
"div",
|
|
875
|
+
{
|
|
876
|
+
className: cn(baseClasses, variantClasses, sizeClasses, className),
|
|
877
|
+
...props,
|
|
878
|
+
children: [
|
|
879
|
+
iconLeft && /* @__PURE__ */ jsx7("span", { className: cn(baseClassesIcon, sizeClassesIcon), children: iconLeft }),
|
|
880
|
+
children,
|
|
881
|
+
iconRight && /* @__PURE__ */ jsx7("span", { className: cn(baseClassesIcon, sizeClassesIcon), children: iconRight })
|
|
882
|
+
]
|
|
883
|
+
}
|
|
884
|
+
);
|
|
885
|
+
};
|
|
886
|
+
var Badge_default = Badge;
|
|
887
|
+
|
|
791
888
|
// src/hooks/useMobile.ts
|
|
792
889
|
import { useState as useState2, useEffect as useEffect3 } from "react";
|
|
793
890
|
var MOBILE_WIDTH = 500;
|
|
@@ -878,14 +975,14 @@ var formatTimeAgo = (date) => {
|
|
|
878
975
|
};
|
|
879
976
|
|
|
880
977
|
// src/components/NotificationCard/NotificationCard.tsx
|
|
881
|
-
import { Fragment, jsx as
|
|
978
|
+
import { Fragment, jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
882
979
|
var NotificationEmpty = ({
|
|
883
980
|
emptyStateImage,
|
|
884
981
|
emptyStateTitle = "Nenhuma notifica\xE7\xE3o no momento",
|
|
885
982
|
emptyStateDescription = "Voc\xEA est\xE1 em dia com todas as novidades. Volte depois para conferir atualiza\xE7\xF5es!"
|
|
886
983
|
}) => {
|
|
887
|
-
return /* @__PURE__ */
|
|
888
|
-
emptyStateImage && /* @__PURE__ */
|
|
984
|
+
return /* @__PURE__ */ jsxs6("div", { className: "flex flex-col items-center justify-center gap-4 p-6 w-full", children: [
|
|
985
|
+
emptyStateImage && /* @__PURE__ */ jsx8("div", { className: "w-20 h-20 flex items-center justify-center", children: /* @__PURE__ */ jsx8(
|
|
889
986
|
"img",
|
|
890
987
|
{
|
|
891
988
|
src: emptyStateImage,
|
|
@@ -895,20 +992,27 @@ var NotificationEmpty = ({
|
|
|
895
992
|
className: "object-contain"
|
|
896
993
|
}
|
|
897
994
|
) }),
|
|
898
|
-
/* @__PURE__ */
|
|
899
|
-
/* @__PURE__ */
|
|
995
|
+
/* @__PURE__ */ jsx8("h3", { className: "text-xl font-semibold text-text-950 text-center leading-[23px]", children: emptyStateTitle }),
|
|
996
|
+
/* @__PURE__ */ jsx8("p", { className: "text-sm font-normal text-text-400 text-center max-w-[316px] leading-[21px]", children: emptyStateDescription })
|
|
900
997
|
] });
|
|
901
998
|
};
|
|
902
999
|
var NotificationHeader = ({
|
|
903
1000
|
unreadCount,
|
|
904
1001
|
variant = "modal"
|
|
905
1002
|
}) => {
|
|
906
|
-
return /* @__PURE__ */
|
|
907
|
-
variant === "modal" ? /* @__PURE__ */
|
|
908
|
-
unreadCount > 0 && /* @__PURE__ */
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
1003
|
+
return /* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between gap-2", children: [
|
|
1004
|
+
variant === "modal" ? /* @__PURE__ */ jsx8(Text_default, { size: "sm", weight: "bold", className: "text-text-950", children: "Notifica\xE7\xF5es" }) : /* @__PURE__ */ jsx8("h3", { className: "text-sm font-semibold text-text-950", children: "Notifica\xE7\xF5es" }),
|
|
1005
|
+
unreadCount > 0 && /* @__PURE__ */ jsx8(
|
|
1006
|
+
Badge_default,
|
|
1007
|
+
{
|
|
1008
|
+
variant: "solid",
|
|
1009
|
+
action: "info",
|
|
1010
|
+
size: "small",
|
|
1011
|
+
iconLeft: /* @__PURE__ */ jsx8(Bell2, { size: 12, "aria-hidden": "true", focusable: "false" }),
|
|
1012
|
+
className: "border-0",
|
|
1013
|
+
children: unreadCount === 1 ? "1 n\xE3o lida" : `${unreadCount} n\xE3o lidas`
|
|
1014
|
+
}
|
|
1015
|
+
)
|
|
912
1016
|
] });
|
|
913
1017
|
};
|
|
914
1018
|
var SingleNotificationCard = ({
|
|
@@ -940,7 +1044,7 @@ var SingleNotificationCard = ({
|
|
|
940
1044
|
onNavigate();
|
|
941
1045
|
}
|
|
942
1046
|
};
|
|
943
|
-
return /* @__PURE__ */
|
|
1047
|
+
return /* @__PURE__ */ jsxs6(
|
|
944
1048
|
"div",
|
|
945
1049
|
{
|
|
946
1050
|
className: cn(
|
|
@@ -949,20 +1053,20 @@ var SingleNotificationCard = ({
|
|
|
949
1053
|
className
|
|
950
1054
|
),
|
|
951
1055
|
children: [
|
|
952
|
-
/* @__PURE__ */
|
|
953
|
-
!isRead && /* @__PURE__ */
|
|
954
|
-
/* @__PURE__ */
|
|
955
|
-
/* @__PURE__ */
|
|
956
|
-
/* @__PURE__ */
|
|
1056
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-2 w-full", children: [
|
|
1057
|
+
!isRead && /* @__PURE__ */ jsx8("div", { className: "w-[7px] h-[7px] bg-info-300 rounded-full flex-shrink-0" }),
|
|
1058
|
+
/* @__PURE__ */ jsx8("h3", { className: "font-bold text-sm leading-4 text-text-950 flex-grow", children: title }),
|
|
1059
|
+
/* @__PURE__ */ jsxs6(DropdownMenu_default, { children: [
|
|
1060
|
+
/* @__PURE__ */ jsx8(
|
|
957
1061
|
DropdownMenuTrigger,
|
|
958
1062
|
{
|
|
959
1063
|
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",
|
|
960
1064
|
"aria-label": "Menu de a\xE7\xF5es",
|
|
961
|
-
children: /* @__PURE__ */
|
|
1065
|
+
children: /* @__PURE__ */ jsx8(DotsThreeVertical, { size: 24 })
|
|
962
1066
|
}
|
|
963
1067
|
),
|
|
964
|
-
/* @__PURE__ */
|
|
965
|
-
!isRead && /* @__PURE__ */
|
|
1068
|
+
/* @__PURE__ */ jsxs6(DropdownMenuContent, { align: "end", className: "min-w-[160px]", children: [
|
|
1069
|
+
!isRead && /* @__PURE__ */ jsx8(
|
|
966
1070
|
DropdownMenuItem,
|
|
967
1071
|
{
|
|
968
1072
|
onClick: handleMarkAsRead,
|
|
@@ -970,14 +1074,14 @@ var SingleNotificationCard = ({
|
|
|
970
1074
|
children: "Marcar como lida"
|
|
971
1075
|
}
|
|
972
1076
|
),
|
|
973
|
-
/* @__PURE__ */
|
|
1077
|
+
/* @__PURE__ */ jsx8(DropdownMenuItem, { onClick: handleDelete, className: "text-error-600", children: "Deletar" })
|
|
974
1078
|
] })
|
|
975
1079
|
] })
|
|
976
1080
|
] }),
|
|
977
|
-
/* @__PURE__ */
|
|
978
|
-
/* @__PURE__ */
|
|
979
|
-
/* @__PURE__ */
|
|
980
|
-
onNavigate && actionLabel && /* @__PURE__ */
|
|
1081
|
+
/* @__PURE__ */ jsx8("p", { className: "text-sm leading-[21px] text-text-800 w-full", children: message }),
|
|
1082
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between w-full", children: [
|
|
1083
|
+
/* @__PURE__ */ jsx8("span", { className: "text-sm font-medium text-text-400", children: time }),
|
|
1084
|
+
onNavigate && actionLabel && /* @__PURE__ */ jsx8(
|
|
981
1085
|
"button",
|
|
982
1086
|
{
|
|
983
1087
|
type: "button",
|
|
@@ -1004,9 +1108,9 @@ var NotificationList = ({
|
|
|
1004
1108
|
className
|
|
1005
1109
|
}) => {
|
|
1006
1110
|
if (error) {
|
|
1007
|
-
return /* @__PURE__ */
|
|
1008
|
-
/* @__PURE__ */
|
|
1009
|
-
onRetry && /* @__PURE__ */
|
|
1111
|
+
return /* @__PURE__ */ jsxs6("div", { className: "flex flex-col items-center gap-4 p-6 w-full", children: [
|
|
1112
|
+
/* @__PURE__ */ jsx8("p", { className: "text-sm text-error-600", children: error }),
|
|
1113
|
+
onRetry && /* @__PURE__ */ jsx8(
|
|
1010
1114
|
"button",
|
|
1011
1115
|
{
|
|
1012
1116
|
type: "button",
|
|
@@ -1018,8 +1122,8 @@ var NotificationList = ({
|
|
|
1018
1122
|
] });
|
|
1019
1123
|
}
|
|
1020
1124
|
if (loading) {
|
|
1021
|
-
return /* @__PURE__ */
|
|
1022
|
-
(skeletonId) => /* @__PURE__ */
|
|
1125
|
+
return /* @__PURE__ */ jsx8("div", { className: "flex flex-col gap-0 w-full", children: ["skeleton-first", "skeleton-second", "skeleton-third"].map(
|
|
1126
|
+
(skeletonId) => /* @__PURE__ */ jsx8(
|
|
1023
1127
|
SkeletonCard,
|
|
1024
1128
|
{
|
|
1025
1129
|
className: "p-4 border-b border-border-200"
|
|
@@ -1029,11 +1133,11 @@ var NotificationList = ({
|
|
|
1029
1133
|
) });
|
|
1030
1134
|
}
|
|
1031
1135
|
if (!groupedNotifications || groupedNotifications.length === 0) {
|
|
1032
|
-
return renderEmpty ? /* @__PURE__ */
|
|
1136
|
+
return renderEmpty ? /* @__PURE__ */ jsx8("div", { className: "w-full", children: renderEmpty() }) : /* @__PURE__ */ jsx8(NotificationEmpty, {});
|
|
1033
1137
|
}
|
|
1034
|
-
return /* @__PURE__ */
|
|
1035
|
-
/* @__PURE__ */
|
|
1036
|
-
group.notifications.map((notification) => /* @__PURE__ */
|
|
1138
|
+
return /* @__PURE__ */ jsx8("div", { className: cn("flex flex-col gap-0 w-full", className), children: groupedNotifications.map((group, idx) => /* @__PURE__ */ jsxs6("div", { className: "flex flex-col", children: [
|
|
1139
|
+
/* @__PURE__ */ jsx8("div", { className: "flex items-end px-4 py-6 pb-4", children: /* @__PURE__ */ jsx8("h4", { className: "text-lg font-bold text-text-500 flex-grow", children: group.label }) }),
|
|
1140
|
+
group.notifications.map((notification) => /* @__PURE__ */ jsx8(
|
|
1037
1141
|
SingleNotificationCard,
|
|
1038
1142
|
{
|
|
1039
1143
|
title: notification.title,
|
|
@@ -1091,7 +1195,7 @@ var NotificationCenter = ({
|
|
|
1091
1195
|
onCleanup?.();
|
|
1092
1196
|
onNavigateById?.(entityType, entityId);
|
|
1093
1197
|
};
|
|
1094
|
-
const renderEmptyState = () => /* @__PURE__ */
|
|
1198
|
+
const renderEmptyState = () => /* @__PURE__ */ jsx8(
|
|
1095
1199
|
NotificationEmpty,
|
|
1096
1200
|
{
|
|
1097
1201
|
emptyStateImage,
|
|
@@ -1100,17 +1204,17 @@ var NotificationCenter = ({
|
|
|
1100
1204
|
}
|
|
1101
1205
|
);
|
|
1102
1206
|
if (isMobile) {
|
|
1103
|
-
return /* @__PURE__ */
|
|
1104
|
-
/* @__PURE__ */
|
|
1207
|
+
return /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
1208
|
+
/* @__PURE__ */ jsx8(
|
|
1105
1209
|
IconButton_default,
|
|
1106
1210
|
{
|
|
1107
1211
|
active: isModalOpen,
|
|
1108
1212
|
onClick: handleMobileClick,
|
|
1109
|
-
icon: /* @__PURE__ */
|
|
1213
|
+
icon: /* @__PURE__ */ jsx8(Bell2, { size: 24, className: "text-primary" }),
|
|
1110
1214
|
className
|
|
1111
1215
|
}
|
|
1112
1216
|
),
|
|
1113
|
-
/* @__PURE__ */
|
|
1217
|
+
/* @__PURE__ */ jsx8(
|
|
1114
1218
|
Modal_default,
|
|
1115
1219
|
{
|
|
1116
1220
|
isOpen: isModalOpen,
|
|
@@ -1120,20 +1224,20 @@ var NotificationCenter = ({
|
|
|
1120
1224
|
hideCloseButton: false,
|
|
1121
1225
|
closeOnBackdropClick: true,
|
|
1122
1226
|
closeOnEscape: true,
|
|
1123
|
-
children: /* @__PURE__ */
|
|
1124
|
-
/* @__PURE__ */
|
|
1125
|
-
/* @__PURE__ */
|
|
1126
|
-
unreadCount > 0 && onMarkAllAsRead && /* @__PURE__ */
|
|
1227
|
+
children: /* @__PURE__ */ jsxs6("div", { className: "flex flex-col h-full max-h-[80vh]", children: [
|
|
1228
|
+
/* @__PURE__ */ jsxs6("div", { className: "px-0 pb-3 border-b border-border-200", children: [
|
|
1229
|
+
/* @__PURE__ */ jsx8(NotificationHeader, { unreadCount, variant: "modal" }),
|
|
1230
|
+
unreadCount > 0 && onMarkAllAsRead && /* @__PURE__ */ jsx8(
|
|
1127
1231
|
"button",
|
|
1128
1232
|
{
|
|
1129
1233
|
type: "button",
|
|
1130
1234
|
onClick: onMarkAllAsRead,
|
|
1131
|
-
className: "text-sm font-medium text-info-600 hover:text-info-700 cursor-pointer",
|
|
1235
|
+
className: "text-sm font-medium text-info-600 hover:text-info-700 cursor-pointer mt-2",
|
|
1132
1236
|
children: "Marcar todas como lidas"
|
|
1133
1237
|
}
|
|
1134
1238
|
)
|
|
1135
|
-
] })
|
|
1136
|
-
/* @__PURE__ */
|
|
1239
|
+
] }),
|
|
1240
|
+
/* @__PURE__ */ jsx8("div", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsx8(
|
|
1137
1241
|
NotificationList,
|
|
1138
1242
|
{
|
|
1139
1243
|
groupedNotifications,
|
|
@@ -1156,14 +1260,14 @@ var NotificationCenter = ({
|
|
|
1156
1260
|
)
|
|
1157
1261
|
] });
|
|
1158
1262
|
}
|
|
1159
|
-
return /* @__PURE__ */
|
|
1160
|
-
/* @__PURE__ */
|
|
1263
|
+
return /* @__PURE__ */ jsxs6(DropdownMenu_default, { children: [
|
|
1264
|
+
/* @__PURE__ */ jsx8(DropdownMenuTrigger, { className: "text-primary cursor-pointer", children: /* @__PURE__ */ jsx8(
|
|
1161
1265
|
IconButton_default,
|
|
1162
1266
|
{
|
|
1163
1267
|
active: isActive,
|
|
1164
1268
|
onClick: handleDesktopClick,
|
|
1165
|
-
icon: /* @__PURE__ */
|
|
1166
|
-
|
|
1269
|
+
icon: /* @__PURE__ */ jsx8(
|
|
1270
|
+
Bell2,
|
|
1167
1271
|
{
|
|
1168
1272
|
size: 24,
|
|
1169
1273
|
className: isActive ? "text-primary-950" : "text-primary"
|
|
@@ -1172,32 +1276,26 @@ var NotificationCenter = ({
|
|
|
1172
1276
|
className
|
|
1173
1277
|
}
|
|
1174
1278
|
) }),
|
|
1175
|
-
/* @__PURE__ */
|
|
1279
|
+
/* @__PURE__ */ jsx8(
|
|
1176
1280
|
DropdownMenuContent,
|
|
1177
1281
|
{
|
|
1178
1282
|
className: "min-w-[320px] max-w-[400px] max-h-[500px] overflow-hidden",
|
|
1179
1283
|
side: "bottom",
|
|
1180
1284
|
align: "end",
|
|
1181
|
-
children: /* @__PURE__ */
|
|
1182
|
-
/* @__PURE__ */
|
|
1183
|
-
/* @__PURE__ */
|
|
1184
|
-
|
|
1185
|
-
{
|
|
1186
|
-
unreadCount,
|
|
1187
|
-
variant: "dropdown"
|
|
1188
|
-
}
|
|
1189
|
-
),
|
|
1190
|
-
unreadCount > 0 && onMarkAllAsRead && /* @__PURE__ */ jsx7(
|
|
1285
|
+
children: /* @__PURE__ */ jsxs6("div", { className: "flex flex-col", children: [
|
|
1286
|
+
/* @__PURE__ */ jsxs6("div", { className: "px-4 py-3 border-b border-border-200", children: [
|
|
1287
|
+
/* @__PURE__ */ jsx8(NotificationHeader, { unreadCount, variant: "dropdown" }),
|
|
1288
|
+
unreadCount > 0 && onMarkAllAsRead && /* @__PURE__ */ jsx8(
|
|
1191
1289
|
"button",
|
|
1192
1290
|
{
|
|
1193
1291
|
type: "button",
|
|
1194
1292
|
onClick: onMarkAllAsRead,
|
|
1195
|
-
className: "text-sm font-medium text-info-600 hover:text-info-700 cursor-pointer",
|
|
1293
|
+
className: "text-sm font-medium text-info-600 hover:text-info-700 cursor-pointer mt-2",
|
|
1196
1294
|
children: "Marcar todas como lidas"
|
|
1197
1295
|
}
|
|
1198
1296
|
)
|
|
1199
|
-
] })
|
|
1200
|
-
/* @__PURE__ */
|
|
1297
|
+
] }),
|
|
1298
|
+
/* @__PURE__ */ jsx8("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ jsx8(
|
|
1201
1299
|
NotificationList,
|
|
1202
1300
|
{
|
|
1203
1301
|
groupedNotifications,
|
|
@@ -1219,7 +1317,7 @@ var NotificationCenter = ({
|
|
|
1219
1317
|
var NotificationCard = (props) => {
|
|
1220
1318
|
switch (props.mode) {
|
|
1221
1319
|
case "single":
|
|
1222
|
-
return /* @__PURE__ */
|
|
1320
|
+
return /* @__PURE__ */ jsx8(
|
|
1223
1321
|
SingleNotificationCard,
|
|
1224
1322
|
{
|
|
1225
1323
|
title: props.title,
|
|
@@ -1234,7 +1332,7 @@ var NotificationCard = (props) => {
|
|
|
1234
1332
|
}
|
|
1235
1333
|
);
|
|
1236
1334
|
case "list":
|
|
1237
|
-
return /* @__PURE__ */
|
|
1335
|
+
return /* @__PURE__ */ jsx8(
|
|
1238
1336
|
NotificationList,
|
|
1239
1337
|
{
|
|
1240
1338
|
groupedNotifications: props.groupedNotifications ?? (props.notifications ? [
|
|
@@ -1255,9 +1353,9 @@ var NotificationCard = (props) => {
|
|
|
1255
1353
|
}
|
|
1256
1354
|
);
|
|
1257
1355
|
case "center":
|
|
1258
|
-
return /* @__PURE__ */
|
|
1356
|
+
return /* @__PURE__ */ jsx8(NotificationCenter, { ...props });
|
|
1259
1357
|
default:
|
|
1260
|
-
return /* @__PURE__ */
|
|
1358
|
+
return /* @__PURE__ */ jsx8("div", { className: "flex flex-col items-center gap-4 p-6 w-full", children: /* @__PURE__ */ jsx8("p", { className: "text-sm text-text-600", children: "Modo de notifica\xE7\xE3o n\xE3o reconhecido" }) });
|
|
1261
1359
|
}
|
|
1262
1360
|
};
|
|
1263
1361
|
var LegacyNotificationCard = (props) => {
|
|
@@ -1266,10 +1364,10 @@ var LegacyNotificationCard = (props) => {
|
|
|
1266
1364
|
mode: "center",
|
|
1267
1365
|
...props
|
|
1268
1366
|
};
|
|
1269
|
-
return /* @__PURE__ */
|
|
1367
|
+
return /* @__PURE__ */ jsx8(NotificationCenter, { ...centerProps });
|
|
1270
1368
|
}
|
|
1271
1369
|
if (props.groupedNotifications !== void 0 || props.notifications !== void 0 || props.loading || props.error) {
|
|
1272
|
-
return /* @__PURE__ */
|
|
1370
|
+
return /* @__PURE__ */ jsx8(
|
|
1273
1371
|
NotificationList,
|
|
1274
1372
|
{
|
|
1275
1373
|
groupedNotifications: props.groupedNotifications ?? (props.notifications ? [
|
|
@@ -1306,7 +1404,7 @@ var LegacyNotificationCard = (props) => {
|
|
|
1306
1404
|
emptyStateTitle: props.emptyStateTitle,
|
|
1307
1405
|
emptyStateDescription: props.emptyStateDescription
|
|
1308
1406
|
};
|
|
1309
|
-
return /* @__PURE__ */
|
|
1407
|
+
return /* @__PURE__ */ jsx8(
|
|
1310
1408
|
SingleNotificationCard,
|
|
1311
1409
|
{
|
|
1312
1410
|
title: singleProps.title,
|
|
@@ -1321,7 +1419,7 @@ var LegacyNotificationCard = (props) => {
|
|
|
1321
1419
|
}
|
|
1322
1420
|
);
|
|
1323
1421
|
}
|
|
1324
|
-
return /* @__PURE__ */
|
|
1422
|
+
return /* @__PURE__ */ jsx8("div", { className: "flex flex-col items-center gap-4 p-6 w-full", children: /* @__PURE__ */ jsx8("p", { className: "text-sm text-text-600", children: "Nenhuma notifica\xE7\xE3o configurada" }) });
|
|
1325
1423
|
};
|
|
1326
1424
|
var NotificationCard_default = NotificationCard;
|
|
1327
1425
|
export {
|