@greatapps/common 1.1.73 → 1.1.76
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/components/layouts/NotificationsPopover.mjs +3 -3
- package/dist/components/layouts/NotificationsPopover.mjs.map +1 -1
- package/dist/components/pages/notifications/Notifications.mjs +106 -0
- package/dist/components/pages/notifications/Notifications.mjs.map +1 -0
- package/dist/components/widgets/notifications/NotificationCard.mjs +53 -0
- package/dist/components/widgets/notifications/NotificationCard.mjs.map +1 -0
- package/dist/index.mjs +28 -26
- package/dist/index.mjs.map +1 -1
- package/dist/modules/users/schema/messages.schema.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/layouts/NotificationsPopover.tsx +3 -3
- package/src/components/pages/notifications/Notifications.tsx +106 -0
- package/src/components/widgets/notifications/NotificationCard.tsx +66 -0
- package/src/index.ts +3 -2
- package/src/modules/users/schema/messages.schema.ts +1 -0
- package/dist/components/layouts/NotificationItem.mjs +0 -11
- package/dist/components/layouts/NotificationItem.mjs.map +0 -1
- package/src/components/layouts/NotificationItem.tsx +0 -26
|
@@ -5,7 +5,7 @@ import { Bell } from "lucide-react";
|
|
|
5
5
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
6
6
|
import { Popover } from "../ui/overlay/Popover";
|
|
7
7
|
import { Button } from "../ui/buttons/Button";
|
|
8
|
-
import
|
|
8
|
+
import NotificationCard from "../widgets/notifications/NotificationCard";
|
|
9
9
|
import { cn } from "../../infra/utils/clsx";
|
|
10
10
|
import { useMessages, useMarkAllMessagesAsRead } from "../../modules/users/hooks/messages.hook";
|
|
11
11
|
import { formatDistanceToNow } from "date-fns";
|
|
@@ -18,7 +18,7 @@ function NotificationsPopover({
|
|
|
18
18
|
badgeClassName = "bg-pages-400"
|
|
19
19
|
}) {
|
|
20
20
|
const [open, setOpen] = useState(false);
|
|
21
|
-
const { data: messagesData } = useMessages();
|
|
21
|
+
const { data: messagesData } = useMessages({ limit: 5 });
|
|
22
22
|
const { mutate: markAllAsRead } = useMarkAllMessagesAsRead();
|
|
23
23
|
const messages = messagesData?.data ?? [];
|
|
24
24
|
const totalUnread = messagesData?.totalUnread ?? 0;
|
|
@@ -60,7 +60,7 @@ function NotificationsPopover({
|
|
|
60
60
|
children: [
|
|
61
61
|
/* @__PURE__ */ jsx("span", { className: "paragraph-small-semibold text-gray-950 px-4", children: "\xDAltimas notifica\xE7\xF5es" }),
|
|
62
62
|
messages.length > 0 ? messages.map((message, index) => /* @__PURE__ */ jsx(
|
|
63
|
-
|
|
63
|
+
NotificationCard,
|
|
64
64
|
{
|
|
65
65
|
icon: /* @__PURE__ */ jsx(Bell, { size: 16 }),
|
|
66
66
|
iconBgColor: "bg-gray-100",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/layouts/NotificationsPopover.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { useState } from \"react\";\r\nimport { Bell } from \"lucide-react\";\r\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\r\nimport { Popover } from \"../ui/overlay/Popover\";\r\nimport { Button } from \"../ui/buttons/Button\";\r\nimport
|
|
1
|
+
{"version":3,"sources":["../../../src/components/layouts/NotificationsPopover.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { useState } from \"react\";\r\nimport { Bell } from \"lucide-react\";\r\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\r\nimport { Popover } from \"../ui/overlay/Popover\";\r\nimport { Button } from \"../ui/buttons/Button\";\r\nimport NotificationCard from \"../widgets/notifications/NotificationCard\";\r\nimport { cn } from \"../../infra/utils/clsx\";\r\nimport { useMessages, useMarkAllMessagesAsRead } from \"../../modules/users/hooks/messages.hook\";\r\nimport { formatDistanceToNow } from \"date-fns\";\r\nimport { ptBR } from \"date-fns/locale\";\r\n\r\nexport interface NotificationsPopoverProps {\r\n onViewAll?: () => void;\r\n side?: \"top\" | \"bottom\" | \"left\" | \"right\";\r\n align?: \"start\" | \"center\" | \"end\";\r\n contentClassName?: string;\r\n badgeClassName?: string;\r\n}\r\n\r\nfunction NotificationsPopover({\r\n onViewAll,\r\n side,\r\n align,\r\n contentClassName,\r\n badgeClassName = \"bg-pages-400\",\r\n}: NotificationsPopoverProps) {\r\n const [open, setOpen] = useState(false);\r\n const { data: messagesData } = useMessages({ limit: 5 });\r\n const { mutate: markAllAsRead } = useMarkAllMessagesAsRead();\r\n\r\n const messages = messagesData?.data ?? [];\r\n const totalUnread = messagesData?.totalUnread ?? 0;\r\n\r\n const handleOpenChange = (isOpen: boolean) => {\r\n setOpen(isOpen);\r\n if (isOpen && totalUnread > 0) {\r\n markAllAsRead();\r\n }\r\n };\r\n\r\n return (\r\n <Popover open={open} onOpenChange={handleOpenChange}>\r\n <PopoverPrimitive.Trigger className=\"cursor-pointer\">\r\n <div\r\n className={`relative rounded-full p-2.5 ${open ? \"bg-gray-100\" : \"hover:bg-gray-100\"}`}\r\n >\r\n <Bell size={20} className=\"text-gray-500\" />\r\n {totalUnread > 0 && (\r\n <span\r\n className={cn(\r\n \"absolute top-2 right-2 size-2.5 rounded-full\",\r\n badgeClassName,\r\n )}\r\n />\r\n )}\r\n </div>\r\n </PopoverPrimitive.Trigger>\r\n <PopoverPrimitive.Portal>\r\n <PopoverPrimitive.Content\r\n className={cn(\r\n \"absolute bottom-2 left-[26px] z-[9999] w-[308px] p-0 pt-4 bg-white rounded-2xl shadow-md border border-gray-200\",\r\n contentClassName,\r\n )}\r\n side={side}\r\n align={align}\r\n sideOffset={8}\r\n >\r\n <span className=\"paragraph-small-semibold text-gray-950 px-4\">\r\n Últimas notificações\r\n </span>\r\n\r\n {messages.length > 0 ? (\r\n messages.map((message, index) => (\r\n <NotificationCard\r\n key={message.id}\r\n icon={<Bell size={16} />}\r\n iconBgColor=\"bg-gray-100\"\r\n title={message.subject}\r\n time={formatDistanceToNow(new Date(message.datetime_add), {\r\n addSuffix: true,\r\n locale: ptBR,\r\n })}\r\n showBorder={index < messages.length - 1}\r\n />\r\n ))\r\n ) : (\r\n <div className=\"flex flex-col items-center gap-4 pt-[41.5px] pb-[33.5px]\">\r\n <div className=\"bg-gray-50 rounded-md p-2.5\">\r\n <Bell size={20} color=\"var(--color-gray-950)\" />\r\n </div>\r\n <span className=\"paragraph-small-medium text-gray-950\">\r\n Sem notificações por enquanto\r\n </span>\r\n </div>\r\n )}\r\n\r\n {onViewAll && (\r\n <Button\r\n variant=\"secondary\"\r\n className=\"h-8! mt-2 mb-4 mx-4 paragraph-small-semibold\"\r\n onClick={onViewAll}\r\n >\r\n Todas as notificações\r\n </Button>\r\n )}\r\n </PopoverPrimitive.Content>\r\n </PopoverPrimitive.Portal>\r\n </Popover>\r\n );\r\n}\r\n\r\nexport { NotificationsPopover };\r\n"],"mappings":";AA6CQ,SAGE,KAHF;AA3CR,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,YAAY,sBAAsB;AAClC,SAAS,eAAe;AACxB,SAAS,cAAc;AACvB,OAAO,sBAAsB;AAC7B,SAAS,UAAU;AACnB,SAAS,aAAa,gCAAgC;AACtD,SAAS,2BAA2B;AACpC,SAAS,YAAY;AAUrB,SAAS,qBAAqB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,iBAAiB;AACnB,GAA8B;AAC5B,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,KAAK;AACtC,QAAM,EAAE,MAAM,aAAa,IAAI,YAAY,EAAE,OAAO,EAAE,CAAC;AACvD,QAAM,EAAE,QAAQ,cAAc,IAAI,yBAAyB;AAE3D,QAAM,WAAW,cAAc,QAAQ,CAAC;AACxC,QAAM,cAAc,cAAc,eAAe;AAEjD,QAAM,mBAAmB,CAAC,WAAoB;AAC5C,YAAQ,MAAM;AACd,QAAI,UAAU,cAAc,GAAG;AAC7B,oBAAc;AAAA,IAChB;AAAA,EACF;AAEA,SACE,qBAAC,WAAQ,MAAY,cAAc,kBACjC;AAAA,wBAAC,iBAAiB,SAAjB,EAAyB,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s } from "react/jsx-runtime";
|
|
2
|
+
import { Bell, Check } from "lucide-react";
|
|
3
|
+
import { Button } from "../../ui/buttons/Button";
|
|
4
|
+
import {
|
|
5
|
+
Tabs,
|
|
6
|
+
TabsContent,
|
|
7
|
+
TabsList,
|
|
8
|
+
TabsTrigger
|
|
9
|
+
} from "../../ui/data-display/Tabs";
|
|
10
|
+
import { useMessages } from "../../../modules/users/hooks/messages.hook";
|
|
11
|
+
import NotificationCard from "../../widgets/notifications/NotificationCard";
|
|
12
|
+
import { formatDistanceToNow } from "date-fns";
|
|
13
|
+
import { ptBR } from "date-fns/locale";
|
|
14
|
+
function NotificationContent() {
|
|
15
|
+
const { data: unreadedNotifications } = useMessages({
|
|
16
|
+
page: 1,
|
|
17
|
+
limit: 10,
|
|
18
|
+
status: 1,
|
|
19
|
+
type: "notification",
|
|
20
|
+
order: "desc"
|
|
21
|
+
});
|
|
22
|
+
const { data: allNotifications } = useMessages({
|
|
23
|
+
page: 1,
|
|
24
|
+
limit: 10,
|
|
25
|
+
type: "notification",
|
|
26
|
+
order: "desc"
|
|
27
|
+
});
|
|
28
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6 lg:gap-10 px-4 py-6 lg:px-20 lg:py-14", children: [
|
|
29
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4", children: [
|
|
30
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
31
|
+
/* @__PURE__ */ jsx("h1", { className: "paragraph-xlarge-semibold lg:title-large-semibold text-gray-950", children: "Notifica\xE7\xF5es" }),
|
|
32
|
+
/* @__PURE__ */ jsx("p", { className: "paragraph-medium-regular text-gray-600 hidden lg:block", children: "Tenha controle total sobre p\xE1ginas, experi\xEAncias e convers\xF5es." })
|
|
33
|
+
] }),
|
|
34
|
+
/* @__PURE__ */ jsxs(Button, { variant: "secondary", className: "h-10! lg:h-12! shrink-0", children: [
|
|
35
|
+
/* @__PURE__ */ jsx(Check, { size: 20 }),
|
|
36
|
+
/* @__PURE__ */ jsx("span", { className: "lg:block hidden", children: "Marcar todos como lidos" }),
|
|
37
|
+
/* @__PURE__ */ jsx("span", { className: "lg:hidden", children: "Marcar como lidos" })
|
|
38
|
+
] })
|
|
39
|
+
] }),
|
|
40
|
+
/* @__PURE__ */ jsxs(
|
|
41
|
+
Tabs,
|
|
42
|
+
{
|
|
43
|
+
defaultValue: "all",
|
|
44
|
+
className: "flex flex-col w-full bg-transparent gap-6 lg:gap-8",
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ jsxs(TabsList, { className: "h-auto pb-0 bg-transparent", children: [
|
|
47
|
+
/* @__PURE__ */ jsxs(TabsTrigger, { className: "gap-2", value: "all", children: [
|
|
48
|
+
"Todas as notifica\xE7\xF5es",
|
|
49
|
+
" ",
|
|
50
|
+
/* @__PURE__ */ jsxs("span", { className: "text-gray-500", children: [
|
|
51
|
+
"(",
|
|
52
|
+
allNotifications?.data.length,
|
|
53
|
+
")"
|
|
54
|
+
] })
|
|
55
|
+
] }),
|
|
56
|
+
/* @__PURE__ */ jsxs(TabsTrigger, { className: "gap-2", value: "unreads", children: [
|
|
57
|
+
"N\xE3o lidas",
|
|
58
|
+
" ",
|
|
59
|
+
/* @__PURE__ */ jsxs("span", { className: "text-gray-500", children: [
|
|
60
|
+
"(",
|
|
61
|
+
unreadedNotifications?.data.length,
|
|
62
|
+
")"
|
|
63
|
+
] })
|
|
64
|
+
] })
|
|
65
|
+
] }),
|
|
66
|
+
/* @__PURE__ */ jsx(TabsContent, { value: "all", children: /* @__PURE__ */ jsx("div", { className: "flex flex-col border border-gray-200 rounded-lg w-full bg-white", children: allNotifications?.data.map((notification, index) => /* @__PURE__ */ jsx(
|
|
67
|
+
NotificationCard,
|
|
68
|
+
{
|
|
69
|
+
icon: /* @__PURE__ */ jsx(Bell, { size: 20, className: "text-pages-600" }),
|
|
70
|
+
iconBgColor: "bg-pages-100",
|
|
71
|
+
title: notification.subject,
|
|
72
|
+
description: notification.message,
|
|
73
|
+
time: formatDistanceToNow(new Date(notification.datetime_add), {
|
|
74
|
+
addSuffix: true,
|
|
75
|
+
locale: ptBR
|
|
76
|
+
}),
|
|
77
|
+
isUnread: notification.status === 1,
|
|
78
|
+
showBorder: index < allNotifications.data.length - 1
|
|
79
|
+
},
|
|
80
|
+
notification.id
|
|
81
|
+
)) }) }),
|
|
82
|
+
/* @__PURE__ */ jsx(TabsContent, { value: "unreads", children: /* @__PURE__ */ jsx("div", { className: "flex flex-col border border-gray-200 rounded-lg w-full bg-white", children: unreadedNotifications?.data.map((notification, index) => /* @__PURE__ */ jsx(
|
|
83
|
+
NotificationCard,
|
|
84
|
+
{
|
|
85
|
+
icon: /* @__PURE__ */ jsx(Bell, { size: 20, className: "text-pages-600" }),
|
|
86
|
+
iconBgColor: "bg-pages-100",
|
|
87
|
+
title: notification.subject,
|
|
88
|
+
description: notification.message,
|
|
89
|
+
time: formatDistanceToNow(new Date(notification.datetime_add), {
|
|
90
|
+
addSuffix: true,
|
|
91
|
+
locale: ptBR
|
|
92
|
+
}),
|
|
93
|
+
isUnread: notification.status === 1,
|
|
94
|
+
showBorder: index < unreadedNotifications.data.length - 1
|
|
95
|
+
},
|
|
96
|
+
notification.id
|
|
97
|
+
)) }) })
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
] });
|
|
102
|
+
}
|
|
103
|
+
export {
|
|
104
|
+
NotificationContent
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=Notifications.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/pages/notifications/Notifications.tsx"],"sourcesContent":["import { Bell, Check } from \"lucide-react\";\nimport { Button } from \"../../ui/buttons/Button\";\nimport {\n Tabs,\n TabsContent,\n TabsList,\n TabsTrigger,\n} from \"../../ui/data-display/Tabs\";\nimport { useMessages } from \"../../../modules/users/hooks/messages.hook\";\nimport NotificationCard from \"../../widgets/notifications/NotificationCard\";\nimport { formatDistanceToNow } from \"date-fns\";\nimport { ptBR } from \"date-fns/locale\";\n\nexport function NotificationContent() {\n const { data: unreadedNotifications } = useMessages({\n page: 1,\n limit: 10,\n status: 1,\n type: \"notification\",\n order: \"desc\",\n });\n const { data: allNotifications } = useMessages({\n page: 1,\n limit: 10,\n type: \"notification\",\n order: \"desc\",\n });\n return (\n <div className=\"flex flex-col gap-6 lg:gap-10 px-4 py-6 lg:px-20 lg:py-14\">\n <div className=\"flex items-center justify-between gap-4\">\n <div className=\"flex flex-col gap-2\">\n <h1 className=\"paragraph-xlarge-semibold lg:title-large-semibold text-gray-950\">\n Notificações\n </h1>\n <p className=\"paragraph-medium-regular text-gray-600 hidden lg:block\">\n Tenha controle total sobre páginas, experiências e conversões.\n </p>\n </div>\n <Button variant={\"secondary\"} className=\"h-10! lg:h-12! shrink-0\">\n <Check size={20} />\n <span className=\"lg:block hidden\">Marcar todos como lidos</span>\n <span className=\"lg:hidden\">Marcar como lidos</span>\n </Button>\n </div>\n <Tabs\n defaultValue=\"all\"\n className=\"flex flex-col w-full bg-transparent gap-6 lg:gap-8\"\n >\n <TabsList className=\"h-auto pb-0 bg-transparent\">\n <TabsTrigger className=\"gap-2\" value=\"all\">\n Todas as notificações{\" \"}\n <span className=\"text-gray-500\">\n ({allNotifications?.data.length})\n </span>\n </TabsTrigger>\n <TabsTrigger className=\"gap-2\" value=\"unreads\">\n Não lidas{\" \"}\n <span className=\"text-gray-500\">\n ({unreadedNotifications?.data.length})\n </span>\n </TabsTrigger>\n </TabsList>\n\n <TabsContent value=\"all\">\n <div className=\"flex flex-col border border-gray-200 rounded-lg w-full bg-white\">\n {allNotifications?.data.map((notification, index) => (\n <NotificationCard\n key={notification.id}\n icon={<Bell size={20} className=\"text-pages-600\" />}\n iconBgColor=\"bg-pages-100\"\n title={notification.subject}\n description={notification.message}\n time={formatDistanceToNow(new Date(notification.datetime_add), {\n addSuffix: true,\n locale: ptBR,\n })}\n isUnread={notification.status === 1}\n showBorder={index < allNotifications.data.length - 1}\n />\n ))}\n </div>\n </TabsContent>\n\n <TabsContent value=\"unreads\">\n <div className=\"flex flex-col border border-gray-200 rounded-lg w-full bg-white\">\n {unreadedNotifications?.data.map((notification, index) => (\n <NotificationCard\n key={notification.id}\n icon={<Bell size={20} className=\"text-pages-600\" />}\n iconBgColor=\"bg-pages-100\"\n title={notification.subject}\n description={notification.message}\n time={formatDistanceToNow(new Date(notification.datetime_add), {\n addSuffix: true,\n locale: ptBR,\n })}\n isUnread={notification.status === 1}\n showBorder={index < unreadedNotifications.data.length - 1}\n />\n ))}\n </div>\n </TabsContent>\n </Tabs>\n </div>\n );\n}\n"],"mappings":"AA8BQ,SACE,KADF;AA9BR,SAAS,MAAM,aAAa;AAC5B,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,mBAAmB;AAC5B,OAAO,sBAAsB;AAC7B,SAAS,2BAA2B;AACpC,SAAS,YAAY;AAEd,SAAS,sBAAsB;AACpC,QAAM,EAAE,MAAM,sBAAsB,IAAI,YAAY;AAAA,IAClD,MAAM;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,OAAO;AAAA,EACT,CAAC;AACD,QAAM,EAAE,MAAM,iBAAiB,IAAI,YAAY;AAAA,IAC7C,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,EACT,CAAC;AACD,SACE,qBAAC,SAAI,WAAU,6DACb;AAAA,yBAAC,SAAI,WAAU,2CACb;AAAA,2BAAC,SAAI,WAAU,uBACb;AAAA,4BAAC,QAAG,WAAU,mEAAkE,gCAEhF;AAAA,QACA,oBAAC,OAAE,WAAU,0DAAyD,qFAEtE;AAAA,SACF;AAAA,MACA,qBAAC,UAAO,SAAS,aAAa,WAAU,2BACtC;AAAA,4BAAC,SAAM,MAAM,IAAI;AAAA,QACjB,oBAAC,UAAK,WAA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ACjD,aAAY;AAAA,cACZ,OAAO,aAAa;AAAA,cACpB,aAAa,aAAa;AAAA,cAC1B,MAAM,oBAAoB,IAAI,KAAK,aAAa,YAAY,GAAG;AAAA,gBAC7D,WAAW;AAAA,gBACX,QAAQ;AAAA,cACV,CAAC;AAAA,cACD,UAAU,aAAa,WAAW;AAAA,cAClC,YAAY,QAAQ,sBAAsB,KAAK,SAAS;AAAA;AAAA,YAVnD,aAAa;AAAA,UAWpB,CACD,GACH,GACF;AAAA;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Clock } from "lucide-react";
|
|
3
|
+
import { cn } from "../../../infra/utils/clsx";
|
|
4
|
+
function NotificationCard({
|
|
5
|
+
icon,
|
|
6
|
+
iconBgColor,
|
|
7
|
+
title,
|
|
8
|
+
description,
|
|
9
|
+
time,
|
|
10
|
+
actions,
|
|
11
|
+
isUnread = false,
|
|
12
|
+
showBorder = true,
|
|
13
|
+
className
|
|
14
|
+
}) {
|
|
15
|
+
return /* @__PURE__ */ jsxs(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
className: cn(
|
|
19
|
+
"flex flex-col lg:flex-row items-start p-4 lg:p-6 gap-4 lg:gap-5 relative",
|
|
20
|
+
showBorder && "border-b border-gray-200",
|
|
21
|
+
className
|
|
22
|
+
),
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ jsx(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
className: cn(
|
|
28
|
+
"flex items-center justify-center size-10 rounded-full shrink-0",
|
|
29
|
+
iconBgColor
|
|
30
|
+
),
|
|
31
|
+
children: icon
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 flex-1", children: [
|
|
35
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
36
|
+
/* @__PURE__ */ jsx("span", { className: "paragraph-small-semibold text-gray-950", children: title }),
|
|
37
|
+
description && /* @__PURE__ */ jsx("span", { className: "paragraph-small-regular text-gray-600", children: description })
|
|
38
|
+
] }),
|
|
39
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
40
|
+
/* @__PURE__ */ jsx(Clock, { size: 14, className: "text-gray-400" }),
|
|
41
|
+
/* @__PURE__ */ jsx("span", { className: "paragraph-xsmall-medium text-gray-600", children: time })
|
|
42
|
+
] }),
|
|
43
|
+
actions && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: actions })
|
|
44
|
+
] }),
|
|
45
|
+
isUnread && /* @__PURE__ */ jsx("div", { className: "size-2 bg-pages-400 rounded-full shrink-0 mt-1" })
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
NotificationCard as default
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=NotificationCard.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/widgets/notifications/NotificationCard.tsx"],"sourcesContent":["import { Clock } from 'lucide-react';\r\nimport { ReactNode } from 'react';\r\nimport { cn } from '../../../infra/utils/clsx';\r\n\r\ntype NotificationCardProps = {\r\n icon: ReactNode;\r\n iconBgColor?: string;\r\n title: string;\r\n description?: string;\r\n time: string;\r\n actions?: ReactNode;\r\n isUnread?: boolean;\r\n showBorder?: boolean;\r\n className?: string;\r\n};\r\n\r\nexport default function NotificationCard({\r\n icon,\r\n iconBgColor,\r\n title,\r\n description,\r\n time,\r\n actions,\r\n isUnread = false,\r\n showBorder = true,\r\n className,\r\n}: NotificationCardProps) {\r\n return (\r\n <div\r\n className={cn(\r\n 'flex flex-col lg:flex-row items-start p-4 lg:p-6 gap-4 lg:gap-5 relative',\r\n showBorder && 'border-b border-gray-200',\r\n className\r\n )}\r\n >\r\n <div\r\n className={cn(\r\n 'flex items-center justify-center size-10 rounded-full shrink-0',\r\n iconBgColor\r\n )}\r\n >\r\n {icon}\r\n </div>\r\n\r\n <div className=\"flex flex-col gap-4 flex-1\">\r\n <div className=\"flex flex-col gap-1\">\r\n <span className=\"paragraph-small-semibold text-gray-950\">{title}</span>\r\n {description && (\r\n <span className=\"paragraph-small-regular text-gray-600\">{description}</span>\r\n )}\r\n </div>\r\n\r\n <div className=\"flex items-center gap-1.5\">\r\n <Clock size={14} className=\"text-gray-400\" />\r\n <span className=\"paragraph-xsmall-medium text-gray-600\">{time}</span>\r\n </div>\r\n\r\n {actions && <div className=\"flex items-center gap-2\">{actions}</div>}\r\n </div>\r\n\r\n {isUnread && <div className=\"size-2 bg-pages-400 rounded-full shrink-0 mt-1\" />}\r\n </div>\r\n );\r\n}\r\n\r\nexport type { NotificationCardProps };\r\n"],"mappings":"AAmCM,cAUE,YAVF;AAnCN,SAAS,aAAa;AAEtB,SAAS,UAAU;AAcJ,SAAR,iBAAkC;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,aAAa;AAAA,EACb;AACF,GAA0B;AACxB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,cAAc;AAAA,QACd;AAAA,MACF;AAAA,MAEA;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,WAAW;AAAA,cACT;AAAA,cACA;AAAA,YACF;AAAA,YAEC;AAAA;AAAA,QACH;AAAA,QAEA,qBAAC,SAAI,WAAU,8BACb;AAAA,+BAAC,SAAI,WAAU,uBACb;AAAA,gCAAC,UAAK,WAAU,0CAA0C,iBAAM;AAAA,YAC/D,eACC,oBAAC,UAAK,WAAU,yCAAyC,uBAAY;AAAA,aAEzE;AAAA,UAEA,qBAAC,SAAI,WAAU,6BACb;AAAA,gCAAC,SAAM,MAAM,IAAI,WAAU,iBAAgB;AAAA,YAC3C,oBAAC,UAAK,WAAU,yCAAyC,gBAAK;AAAA,aAChE;AAAA,UAEC,WAAW,oBAAC,SAAI,WAAU,2BAA2B,mBAAQ;AAAA,WAChE;AAAA,QAEC,YAAY,oBAAC,SAAI,WAAU,kDAAiD;AAAA;AAAA;AAAA,EAC/E;AAEJ;","names":[]}
|
package/dist/index.mjs
CHANGED
|
@@ -52,14 +52,15 @@ import { AppNavBar } from "./components/layouts/AppNavBar";
|
|
|
52
52
|
import { AppMobileNavBar } from "./components/layouts/AppMobileNavBar";
|
|
53
53
|
import { SideBarNavigation } from "./components/layouts/SideBarNavigation";
|
|
54
54
|
import { MdSideBarNavigation } from "./components/layouts/MdSideBarNavigation";
|
|
55
|
-
import {
|
|
55
|
+
import { default as default2 } from "./components/widgets/notifications/NotificationCard";
|
|
56
56
|
import { NotificationsPopover } from "./components/layouts/NotificationsPopover";
|
|
57
|
+
import { NotificationContent } from "./components/pages/notifications/Notifications";
|
|
57
58
|
import { UsersSelectorPopover } from "./components/layouts/UsersSelectorPopover";
|
|
58
59
|
import { ProfilePopover } from "./components/layouts/ProfilePopover";
|
|
59
60
|
import { NavBarItem } from "./components/layouts/NavBarItem";
|
|
60
61
|
import { Button, buttonVariants } from "./components/ui/buttons/Button";
|
|
61
62
|
import { CopyButton } from "./components/ui/buttons/CopyButton";
|
|
62
|
-
import { default as
|
|
63
|
+
import { default as default3 } from "./components/ui/buttons/CancelButton";
|
|
63
64
|
import {
|
|
64
65
|
Accordion,
|
|
65
66
|
AccordionItem,
|
|
@@ -104,8 +105,8 @@ import {
|
|
|
104
105
|
TabsContent
|
|
105
106
|
} from "./components/ui/data-display/Tabs";
|
|
106
107
|
import { UserAvatar } from "./components/ui/data-display/UserAvatar";
|
|
107
|
-
import { default as
|
|
108
|
-
import { default as
|
|
108
|
+
import { default as default4 } from "./components/ui/feedback/CircularProgress";
|
|
109
|
+
import { default as default5 } from "./components/ui/feedback/DefaultCircularProgress";
|
|
109
110
|
import { Progress } from "./components/ui/feedback/Progress";
|
|
110
111
|
import { LoadingOverlay } from "./components/ui/feedback/LoadingOverlay";
|
|
111
112
|
import {
|
|
@@ -187,9 +188,9 @@ import {
|
|
|
187
188
|
import { useMdSidebarStore } from "./store/useMdSidebarStore";
|
|
188
189
|
import { useModalManager } from "./store/useModalManager";
|
|
189
190
|
import { AccountSectionType } from "./enums/AccountSectionType";
|
|
190
|
-
import { default as
|
|
191
|
-
import { default as
|
|
192
|
-
import { default as
|
|
191
|
+
import { default as default6 } from "./hooks/usePasswordVisibility";
|
|
192
|
+
import { default as default7 } from "./hooks/useCountdownTimer";
|
|
193
|
+
import { default as default8 } from "./hooks/useIsMobile";
|
|
193
194
|
import {
|
|
194
195
|
formatPhone,
|
|
195
196
|
formatTimer,
|
|
@@ -206,8 +207,8 @@ import { copyToClipboard, readFromClipboard } from "./utils/browser/clipboard";
|
|
|
206
207
|
import { FormField } from "./components/ui/form/FormField";
|
|
207
208
|
import { SelectField } from "./components/ui/form/SelectField";
|
|
208
209
|
import { ComboboxField } from "./components/ui/form/ComboboxField";
|
|
209
|
-
import { default as
|
|
210
|
-
import { default as
|
|
210
|
+
import { default as default9 } from "./components/ui/form/PhoneInput";
|
|
211
|
+
import { default as default10 } from "./components/ui/form/SwitchOptionFieldWithIcon";
|
|
211
212
|
import { TextAreaField } from "./components/ui/form/TextAreaField";
|
|
212
213
|
import {
|
|
213
214
|
useUpdateAccount,
|
|
@@ -216,13 +217,13 @@ import {
|
|
|
216
217
|
useDeleteAccountUser,
|
|
217
218
|
useDeleteAccount
|
|
218
219
|
} from "./modules/accounts/hooks/useAccountManagement";
|
|
219
|
-
import { default as
|
|
220
|
+
import { default as default11 } from "./components/account/AccountModals";
|
|
220
221
|
import { useAccountModals } from "./store/useAccountModals";
|
|
221
222
|
import { ModalManager } from "./components/modals/ModalManager";
|
|
222
223
|
import { Modals } from "./components/modals/Modals";
|
|
223
|
-
import { default as
|
|
224
|
-
import { default as
|
|
225
|
-
import { default as
|
|
224
|
+
import { default as default12 } from "./components/account/TwoFactorAuthModal";
|
|
225
|
+
import { default as default13 } from "./components/account/DisableTwoFactorAuthModal";
|
|
226
|
+
import { default as default14 } from "./components/account/ConfirmGlobalPreferencesModal";
|
|
226
227
|
import { MyProfileSection } from "./components/account/sections/MyProfileSection";
|
|
227
228
|
import { PreferencesSection } from "./components/account/sections/PreferencesSection";
|
|
228
229
|
import { SecuritySection } from "./components/account/sections/SecuritySection";
|
|
@@ -242,7 +243,7 @@ export {
|
|
|
242
243
|
AccordionContent,
|
|
243
244
|
AccordionItem,
|
|
244
245
|
AccordionTrigger,
|
|
245
|
-
|
|
246
|
+
default11 as AccountModals,
|
|
246
247
|
AccountSectionType,
|
|
247
248
|
AppMobileNavBar,
|
|
248
249
|
AppNavBar,
|
|
@@ -251,7 +252,7 @@ export {
|
|
|
251
252
|
CURRENCY_OPTIONS,
|
|
252
253
|
Calendar,
|
|
253
254
|
CalendarDayButton,
|
|
254
|
-
|
|
255
|
+
default3 as CancelButton,
|
|
255
256
|
Card,
|
|
256
257
|
CardAction,
|
|
257
258
|
CardContent,
|
|
@@ -263,7 +264,7 @@ export {
|
|
|
263
264
|
ChangePasswordSection,
|
|
264
265
|
ChangePhoneModal,
|
|
265
266
|
Checkbox,
|
|
266
|
-
|
|
267
|
+
default4 as CircularProgress,
|
|
267
268
|
ComboboxField,
|
|
268
269
|
Command,
|
|
269
270
|
CommandDialog,
|
|
@@ -274,11 +275,11 @@ export {
|
|
|
274
275
|
CommandList,
|
|
275
276
|
CommandSeparator,
|
|
276
277
|
CommandShortcut,
|
|
277
|
-
|
|
278
|
+
default14 as ConfirmGlobalPreferencesModal,
|
|
278
279
|
CopyButton,
|
|
279
280
|
DatePicker,
|
|
280
281
|
DateRangePicker,
|
|
281
|
-
|
|
282
|
+
default5 as DefaultCircularProgress,
|
|
282
283
|
Dialog,
|
|
283
284
|
DialogClose,
|
|
284
285
|
DialogContent,
|
|
@@ -289,7 +290,7 @@ export {
|
|
|
289
290
|
DialogPortal,
|
|
290
291
|
DialogTitle,
|
|
291
292
|
DialogTrigger,
|
|
292
|
-
|
|
293
|
+
default13 as DisableTwoFactorAuthModal,
|
|
293
294
|
FormField,
|
|
294
295
|
GENDER_OPTIONS,
|
|
295
296
|
Input,
|
|
@@ -315,7 +316,8 @@ export {
|
|
|
315
316
|
NOTIFICATION_TYPES,
|
|
316
317
|
NavBar,
|
|
317
318
|
NavBarItem,
|
|
318
|
-
|
|
319
|
+
default2 as NotificationCard,
|
|
320
|
+
NotificationContent,
|
|
319
321
|
NotificationsPopover,
|
|
320
322
|
Pagination,
|
|
321
323
|
PaginationContent,
|
|
@@ -324,7 +326,7 @@ export {
|
|
|
324
326
|
PaginationLink,
|
|
325
327
|
PaginationNext,
|
|
326
328
|
PaginationPrevious,
|
|
327
|
-
|
|
329
|
+
default9 as PhoneInput,
|
|
328
330
|
Popover,
|
|
329
331
|
PopoverAnchor,
|
|
330
332
|
PopoverContent,
|
|
@@ -363,7 +365,7 @@ export {
|
|
|
363
365
|
SubscriptionItemSchema,
|
|
364
366
|
SubscriptionSchema,
|
|
365
367
|
Switch,
|
|
366
|
-
|
|
368
|
+
default10 as SwitchOptionFieldWithIcon,
|
|
367
369
|
TIME_FORMAT_OPTIONS,
|
|
368
370
|
Table,
|
|
369
371
|
TableBody,
|
|
@@ -384,7 +386,7 @@ export {
|
|
|
384
386
|
TooltipContent,
|
|
385
387
|
TooltipProvider,
|
|
386
388
|
TooltipTrigger,
|
|
387
|
-
|
|
389
|
+
default12 as TwoFactorAuthModal,
|
|
388
390
|
USER_QUERY_KEY,
|
|
389
391
|
UserAvatar,
|
|
390
392
|
UsersSelectorPopover,
|
|
@@ -411,17 +413,17 @@ export {
|
|
|
411
413
|
toastVariants,
|
|
412
414
|
useAccountModals,
|
|
413
415
|
useActiveSubscription,
|
|
414
|
-
|
|
416
|
+
default7 as useCountdownTimer,
|
|
415
417
|
useDeleteAccount,
|
|
416
418
|
useDeleteAccountUser,
|
|
417
419
|
useIaCredits,
|
|
418
420
|
useInvalidateUser,
|
|
419
|
-
|
|
421
|
+
default8 as useIsMobile,
|
|
420
422
|
useListAvailableUsers,
|
|
421
423
|
useListProjectUsers,
|
|
422
424
|
useMdSidebarStore,
|
|
423
425
|
useModalManager,
|
|
424
|
-
|
|
426
|
+
default6 as usePasswordVisibility,
|
|
425
427
|
useSetUserData,
|
|
426
428
|
useSubscriptions,
|
|
427
429
|
useTwoFactorVerify,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Types\nexport * from \"./modules/auth/schema\";\nexport * from \"./modules/users/schema\";\nexport * from \"./modules/whitelabel/schema\";\nexport * from \"./infra/api/types\";\n\n// Contexts\nexport * from \"./providers/query.provider\";\nexport * from \"./providers/auth.provider\";\nexport * from \"./providers/whitelabel.provider\";\n\n// Hooks\nexport {\n useListProjectUsers,\n LIST_PROJECT_USERS_QUERY_KEY,\n LIST_PROJECT_USERS_BASE_KEY,\n} from \"./modules/projects/hooks/list-project-users.hook\";\nexport {\n useListAvailableUsers,\n LIST_AVAILABLE_USERS_QUERY_KEY,\n LIST_AVAILABLE_USERS_BASE_KEY,\n} from \"./modules/projects/hooks/list-available-users.hook\";\nexport type {\n ProjectUser,\n AccountUser,\n AddRemoveProjectUsersParams,\n ListUsersParams,\n UsersPage,\n} from \"./modules/projects/types\";\nexport {\n useUserQuery,\n useUserValidateSession,\n useInvalidateUser,\n useSetUserData,\n useTwoFactorVerify,\n USER_QUERY_KEY,\n} from \"./modules/auth/hooks/useUserQuery\";\nexport {\n useSubscriptions,\n SUBSCRIPTIONS_QUERY_KEY,\n} from \"./modules/subscriptions/hooks/list-subscriptions.hook\";\nexport { useActiveSubscription } from \"./modules/subscriptions/hooks/find-active-subscription.hook\";\nexport { useIaCredits } from \"./modules/ia-credits/hooks/ia-credits.hook\";\nexport type {\n IaCreditsSummary,\n IaCreditOperation,\n} from \"./modules/ia-credits/types\";\nexport type {\n Subscription,\n SubscriptionItem,\n FindSubscriptionsParams,\n} from \"./modules/subscriptions/types\";\nexport {\n SubscriptionSchema,\n SubscriptionItemSchema,\n} from \"./modules/subscriptions/types\";\nexport { ADDON_IDS } from \"./modules/subscriptions/constants/addons.constants\";\nexport type { AddonKindEnum } from \"./modules/subscriptions/constants/addons.constants\";\n\n// Providers\nexport { QueryProvider } from \"./providers/query.provider\";\n\n// Middleware\nexport { createAuthMiddleware } from \"./middlewares/create-auth-middleware\";\nexport { createMiddlewareChain } from \"./middlewares/chain\";\nexport { continueChain, stopChain } from \"./middlewares/types\";\nexport type {\n MiddlewareFunction,\n MiddlewareConfig,\n MiddlewareResult,\n} from \"./middlewares/types\";\n\n// Utils\nexport { cn } from \"./infra/utils/clsx\";\nexport { buildQueryParams } from \"./infra/utils/params\";\nexport { parseSchema, parseResult } from \"./infra/utils/parser\";\n\n// Layout\nexport {\n MainLayout,\n MainLayoutContent,\n MainLayoutSpacer,\n MainLayoutMain,\n} from \"./components/layouts/MainLayout\";\nexport { NavBar } from \"./components/layouts/NavBar\";\nexport type { NavBarProps } from \"./components/layouts/NavBar\";\nexport { AppNavBar } from \"./components/layouts/AppNavBar\";\nexport type { AppNavBarProps } from \"./components/layouts/AppNavBar\";\nexport { AppMobileNavBar } from \"./components/layouts/AppMobileNavBar\";\nexport type { AppMobileNavBarProps } from \"./components/layouts/AppMobileNavBar\";\nexport { SideBarNavigation } from \"./components/layouts/SideBarNavigation\";\nexport { MdSideBarNavigation } from \"./components/layouts/MdSideBarNavigation\";\nexport { NotificationItem } from \"./components/layouts/NotificationItem\";\nexport type { NotificationItemProps } from \"./components/layouts/NotificationItem\";\nexport { NotificationsPopover } from \"./components/layouts/NotificationsPopover\";\nexport type { NotificationsPopoverProps } from \"./components/layouts/NotificationsPopover\";\nexport { UsersSelectorPopover } from \"./components/layouts/UsersSelectorPopover\";\nexport type { UsersSelectorPopoverProps } from \"./components/layouts/UsersSelectorPopover\";\nexport { ProfilePopover } from \"./components/layouts/ProfilePopover\";\nexport type {\n ProfilePopoverProps,\n ProfileMenuItem,\n} from \"./components/layouts/ProfilePopover\";\nexport { NavBarItem } from \"./components/layouts/NavBarItem\";\nexport type { NavBarItemProps } from \"./components/layouts/NavBarItem\";\n\n// UI - Buttons\nexport { Button, buttonVariants } from \"./components/ui/buttons/Button\";\nexport { CopyButton } from \"./components/ui/buttons/CopyButton\";\nexport { default as CancelButton } from \"./components/ui/buttons/CancelButton\";\n\n// UI - Data Display\nexport {\n Accordion,\n AccordionItem,\n AccordionTrigger,\n AccordionContent,\n} from \"./components/ui/data-display/Accordion\";\nexport { Badge, badgeVariants } from \"./components/ui/data-display/Badge\";\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardAction,\n CardDescription,\n CardContent,\n} from \"./components/ui/data-display/Card\";\nexport {\n Pagination,\n PaginationContent,\n PaginationLink,\n PaginationItem,\n PaginationPrevious,\n PaginationNext,\n PaginationEllipsis,\n} from \"./components/ui/data-display/Pagination\";\nexport { ScrollArea, ScrollBar } from \"./components/ui/data-display/ScrollArea\";\nexport { Separator } from \"./components/ui/data-display/Separator\";\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n} from \"./components/ui/data-display/Table\";\nexport {\n Tabs,\n TabsList,\n TabsTrigger,\n TabsContent,\n} from \"./components/ui/data-display/Tabs\";\nexport { UserAvatar } from \"./components/ui/data-display/UserAvatar\";\nexport type { UserAvatarProps } from \"./components/ui/data-display/UserAvatar\";\n\n// UI - Feedback\nexport { default as CircularProgress } from \"./components/ui/feedback/CircularProgress\";\nexport { default as DefaultCircularProgress } from \"./components/ui/feedback/DefaultCircularProgress\";\nexport { Progress } from \"./components/ui/feedback/Progress\";\nexport { LoadingOverlay } from \"./components/ui/feedback/LoadingOverlay\";\nexport {\n Toast,\n toastVariants,\n toastIconContainerVariants,\n} from \"./components/ui/feedback/Toast\";\nexport type { ToastProps } from \"./components/ui/feedback/Toast\";\n\n// UI - Form\nexport { Calendar, CalendarDayButton } from \"./components/ui/form/Calendar\";\nexport { Checkbox } from \"./components/ui/form/Checkbox\";\nexport { DatePicker } from \"./components/ui/form/DatePicker\";\nexport { DateRangePicker } from \"./components/ui/form/DateRangePicker\";\nexport { Input } from \"./components/ui/form/Input\";\nexport {\n InputOTP,\n InputOTPGroup,\n InputOTPSlot,\n InputOTPSeparator,\n} from \"./components/ui/form/InputOtp\";\nexport { RadioGroup, RadioGroupItem } from \"./components/ui/form/RadioGroup\";\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n} from \"./components/ui/form/Select\";\nexport { Switch } from \"./components/ui/form/Switch\";\nexport { Textarea } from \"./components/ui/form/Textarea\";\n\n// UI - Overlay\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n} from \"./components/ui/overlay/Command\";\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n} from \"./components/ui/overlay/Dialog\";\nexport {\n Popover,\n PopoverTrigger,\n PopoverContent,\n PopoverAnchor,\n} from \"./components/ui/overlay/Popover\";\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n} from \"./components/ui/overlay/Sheet\";\nexport {\n Tooltip,\n TooltipTrigger,\n TooltipContent,\n TooltipProvider,\n} from \"./components/ui/overlay/Tooltip\";\n\n// Store\nexport { useMdSidebarStore } from \"./store/useMdSidebarStore\";\nexport { useModalManager } from \"./store/useModalManager\";\nexport type { ModalData } from \"./store/useModalManager\";\n\n// Enums\nexport { AccountSectionType } from \"./enums/AccountSectionType\";\n\n// Hooks\nexport { default as usePasswordVisibility } from \"./hooks/usePasswordVisibility\";\nexport { default as useCountdownTimer } from \"./hooks/useCountdownTimer\";\nexport { default as useIsMobile } from \"./hooks/useIsMobile\";\n\n// Utils\nexport {\n formatPhone,\n formatTimer,\n formatFullName,\n formatCPF,\n formatCardNumber,\n} from \"./utils/format/masks\";\nexport { timezoneService } from \"./modules/accounts/services/timezone.service\";\nexport type { TimezoneOption } from \"./modules/accounts/services/timezone.service\";\nexport {\n buildLocaleOptions,\n LANGUAGE_OPTIONS as LOCALE_LANGUAGE_OPTIONS,\n} from \"./utils/intl/locales\";\nexport type { LocaleOption } from \"./utils/intl/locales\";\nexport { copyToClipboard, readFromClipboard } from \"./utils/browser/clipboard\";\n\n// UI - Form (new widgets)\nexport { FormField } from \"./components/ui/form/FormField\";\nexport { SelectField } from \"./components/ui/form/SelectField\";\nexport { ComboboxField } from \"./components/ui/form/ComboboxField\";\nexport type { ComboboxOption } from \"./components/ui/form/ComboboxField\";\nexport { default as PhoneInput } from \"./components/ui/form/PhoneInput\";\nexport { default as SwitchOptionFieldWithIcon } from \"./components/ui/form/SwitchOptionFieldWithIcon\";\nexport { TextAreaField } from \"./components/ui/form/TextAreaField\";\n\n// Account Module - Hooks\nexport {\n useUpdateAccount,\n useUpdateAccountUser,\n useUpdateAccountUserById,\n useDeleteAccountUser,\n useDeleteAccount,\n} from \"./modules/accounts/hooks/useAccountManagement\";\n\n// Account Types\nexport type {\n UpdateAccountRequest,\n UpdateAccountUserRequest,\n ChangePasswordRequest,\n DeleteAccountActionResult,\n DeleteUserActionResult,\n UpdateAccountActionResult,\n UpdateUserActionResult,\n TwoFactorGenerateResult,\n TwoFactorActionResult,\n ContactResetResult,\n} from \"./modules/accounts/types\";\n\nexport { default as AccountModals } from \"./components/account/AccountModals\";\nexport { useAccountModals } from \"./store/useAccountModals\";\nexport type { AccountModalsConfig } from \"./store/useAccountModals\";\n\nexport { ModalManager } from \"./components/modals/ModalManager\";\nexport { Modals } from \"./components/modals/Modals\";\n\nexport { default as TwoFactorAuthModal } from \"./components/account/TwoFactorAuthModal\";\nexport { default as DisableTwoFactorAuthModal } from \"./components/account/DisableTwoFactorAuthModal\";\nexport { default as ConfirmGlobalPreferencesModal } from \"./components/account/ConfirmGlobalPreferencesModal\";\nexport { MyProfileSection } from \"./components/account/sections/MyProfileSection\";\nexport { PreferencesSection } from \"./components/account/sections/PreferencesSection\";\nexport { SecuritySection } from \"./components/account/sections/SecuritySection\";\nexport { ChangePasswordSection } from \"./components/account/sections/ChangePasswordSection\";\nexport { ChangeEmailModal } from \"./components/account/sections/ChangeEmailModal\";\nexport { ChangePhoneModal } from \"./components/account/sections/ChangePhoneModal\";\n\n// Account Constants\nexport {\n GENDER_OPTIONS,\n CURRENCY_OPTIONS,\n TIME_FORMAT_OPTIONS,\n NOTIFICATION_TYPES,\n LANGUAGE_OPTIONS,\n} from \"./components/account/constants\";\n"],"mappings":"AACA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AAGd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,6BAA6B;AACtC,SAAS,oBAAoB;AAU7B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,iBAAiB;AAI1B,SAAS,qBAAqB;AAG9B,SAAS,4BAA4B;AACrC,SAAS,6BAA6B;AACtC,SAAS,eAAe,iBAAiB;AAQzC,SAAS,UAAU;AACnB,SAAS,wBAAwB;AACjC,SAAS,aAAa,mBAAmB;AAGzC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAAc;AAEvB,SAAS,iBAAiB;A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;AACnC,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AAGjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,oBAAAC;AAAA,OACK;","names":["default","LANGUAGE_OPTIONS"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Types\nexport * from \"./modules/auth/schema\";\nexport * from \"./modules/users/schema\";\nexport * from \"./modules/whitelabel/schema\";\nexport * from \"./infra/api/types\";\n\n// Contexts\nexport * from \"./providers/query.provider\";\nexport * from \"./providers/auth.provider\";\nexport * from \"./providers/whitelabel.provider\";\n\n// Hooks\nexport {\n useListProjectUsers,\n LIST_PROJECT_USERS_QUERY_KEY,\n LIST_PROJECT_USERS_BASE_KEY,\n} from \"./modules/projects/hooks/list-project-users.hook\";\nexport {\n useListAvailableUsers,\n LIST_AVAILABLE_USERS_QUERY_KEY,\n LIST_AVAILABLE_USERS_BASE_KEY,\n} from \"./modules/projects/hooks/list-available-users.hook\";\nexport type {\n ProjectUser,\n AccountUser,\n AddRemoveProjectUsersParams,\n ListUsersParams,\n UsersPage,\n} from \"./modules/projects/types\";\nexport {\n useUserQuery,\n useUserValidateSession,\n useInvalidateUser,\n useSetUserData,\n useTwoFactorVerify,\n USER_QUERY_KEY,\n} from \"./modules/auth/hooks/useUserQuery\";\nexport {\n useSubscriptions,\n SUBSCRIPTIONS_QUERY_KEY,\n} from \"./modules/subscriptions/hooks/list-subscriptions.hook\";\nexport { useActiveSubscription } from \"./modules/subscriptions/hooks/find-active-subscription.hook\";\nexport { useIaCredits } from \"./modules/ia-credits/hooks/ia-credits.hook\";\nexport type {\n IaCreditsSummary,\n IaCreditOperation,\n} from \"./modules/ia-credits/types\";\nexport type {\n Subscription,\n SubscriptionItem,\n FindSubscriptionsParams,\n} from \"./modules/subscriptions/types\";\nexport {\n SubscriptionSchema,\n SubscriptionItemSchema,\n} from \"./modules/subscriptions/types\";\nexport { ADDON_IDS } from \"./modules/subscriptions/constants/addons.constants\";\nexport type { AddonKindEnum } from \"./modules/subscriptions/constants/addons.constants\";\n\n// Providers\nexport { QueryProvider } from \"./providers/query.provider\";\n\n// Middleware\nexport { createAuthMiddleware } from \"./middlewares/create-auth-middleware\";\nexport { createMiddlewareChain } from \"./middlewares/chain\";\nexport { continueChain, stopChain } from \"./middlewares/types\";\nexport type {\n MiddlewareFunction,\n MiddlewareConfig,\n MiddlewareResult,\n} from \"./middlewares/types\";\n\n// Utils\nexport { cn } from \"./infra/utils/clsx\";\nexport { buildQueryParams } from \"./infra/utils/params\";\nexport { parseSchema, parseResult } from \"./infra/utils/parser\";\n\n// Layout\nexport {\n MainLayout,\n MainLayoutContent,\n MainLayoutSpacer,\n MainLayoutMain,\n} from \"./components/layouts/MainLayout\";\nexport { NavBar } from \"./components/layouts/NavBar\";\nexport type { NavBarProps } from \"./components/layouts/NavBar\";\nexport { AppNavBar } from \"./components/layouts/AppNavBar\";\nexport type { AppNavBarProps } from \"./components/layouts/AppNavBar\";\nexport { AppMobileNavBar } from \"./components/layouts/AppMobileNavBar\";\nexport type { AppMobileNavBarProps } from \"./components/layouts/AppMobileNavBar\";\nexport { SideBarNavigation } from \"./components/layouts/SideBarNavigation\";\nexport { MdSideBarNavigation } from \"./components/layouts/MdSideBarNavigation\";\nexport { default as NotificationCard } from \"./components/widgets/notifications/NotificationCard\";\nexport type { NotificationCardProps } from \"./components/widgets/notifications/NotificationCard\";\nexport { NotificationsPopover } from \"./components/layouts/NotificationsPopover\";\nexport type { NotificationsPopoverProps } from \"./components/layouts/NotificationsPopover\";\nexport { NotificationContent } from \"./components/pages/notifications/Notifications\";\nexport { UsersSelectorPopover } from \"./components/layouts/UsersSelectorPopover\";\nexport type { UsersSelectorPopoverProps } from \"./components/layouts/UsersSelectorPopover\";\nexport { ProfilePopover } from \"./components/layouts/ProfilePopover\";\nexport type {\n ProfilePopoverProps,\n ProfileMenuItem,\n} from \"./components/layouts/ProfilePopover\";\nexport { NavBarItem } from \"./components/layouts/NavBarItem\";\nexport type { NavBarItemProps } from \"./components/layouts/NavBarItem\";\n\n// UI - Buttons\nexport { Button, buttonVariants } from \"./components/ui/buttons/Button\";\nexport { CopyButton } from \"./components/ui/buttons/CopyButton\";\nexport { default as CancelButton } from \"./components/ui/buttons/CancelButton\";\n\n// UI - Data Display\nexport {\n Accordion,\n AccordionItem,\n AccordionTrigger,\n AccordionContent,\n} from \"./components/ui/data-display/Accordion\";\nexport { Badge, badgeVariants } from \"./components/ui/data-display/Badge\";\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardAction,\n CardDescription,\n CardContent,\n} from \"./components/ui/data-display/Card\";\nexport {\n Pagination,\n PaginationContent,\n PaginationLink,\n PaginationItem,\n PaginationPrevious,\n PaginationNext,\n PaginationEllipsis,\n} from \"./components/ui/data-display/Pagination\";\nexport { ScrollArea, ScrollBar } from \"./components/ui/data-display/ScrollArea\";\nexport { Separator } from \"./components/ui/data-display/Separator\";\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n} from \"./components/ui/data-display/Table\";\nexport {\n Tabs,\n TabsList,\n TabsTrigger,\n TabsContent,\n} from \"./components/ui/data-display/Tabs\";\nexport { UserAvatar } from \"./components/ui/data-display/UserAvatar\";\nexport type { UserAvatarProps } from \"./components/ui/data-display/UserAvatar\";\n\n// UI - Feedback\nexport { default as CircularProgress } from \"./components/ui/feedback/CircularProgress\";\nexport { default as DefaultCircularProgress } from \"./components/ui/feedback/DefaultCircularProgress\";\nexport { Progress } from \"./components/ui/feedback/Progress\";\nexport { LoadingOverlay } from \"./components/ui/feedback/LoadingOverlay\";\nexport {\n Toast,\n toastVariants,\n toastIconContainerVariants,\n} from \"./components/ui/feedback/Toast\";\nexport type { ToastProps } from \"./components/ui/feedback/Toast\";\n\n// UI - Form\nexport { Calendar, CalendarDayButton } from \"./components/ui/form/Calendar\";\nexport { Checkbox } from \"./components/ui/form/Checkbox\";\nexport { DatePicker } from \"./components/ui/form/DatePicker\";\nexport { DateRangePicker } from \"./components/ui/form/DateRangePicker\";\nexport { Input } from \"./components/ui/form/Input\";\nexport {\n InputOTP,\n InputOTPGroup,\n InputOTPSlot,\n InputOTPSeparator,\n} from \"./components/ui/form/InputOtp\";\nexport { RadioGroup, RadioGroupItem } from \"./components/ui/form/RadioGroup\";\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n} from \"./components/ui/form/Select\";\nexport { Switch } from \"./components/ui/form/Switch\";\nexport { Textarea } from \"./components/ui/form/Textarea\";\n\n// UI - Overlay\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n} from \"./components/ui/overlay/Command\";\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n} from \"./components/ui/overlay/Dialog\";\nexport {\n Popover,\n PopoverTrigger,\n PopoverContent,\n PopoverAnchor,\n} from \"./components/ui/overlay/Popover\";\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n} from \"./components/ui/overlay/Sheet\";\nexport {\n Tooltip,\n TooltipTrigger,\n TooltipContent,\n TooltipProvider,\n} from \"./components/ui/overlay/Tooltip\";\n\n// Store\nexport { useMdSidebarStore } from \"./store/useMdSidebarStore\";\nexport { useModalManager } from \"./store/useModalManager\";\nexport type { ModalData } from \"./store/useModalManager\";\n\n// Enums\nexport { AccountSectionType } from \"./enums/AccountSectionType\";\n\n// Hooks\nexport { default as usePasswordVisibility } from \"./hooks/usePasswordVisibility\";\nexport { default as useCountdownTimer } from \"./hooks/useCountdownTimer\";\nexport { default as useIsMobile } from \"./hooks/useIsMobile\";\n\n// Utils\nexport {\n formatPhone,\n formatTimer,\n formatFullName,\n formatCPF,\n formatCardNumber,\n} from \"./utils/format/masks\";\nexport { timezoneService } from \"./modules/accounts/services/timezone.service\";\nexport type { TimezoneOption } from \"./modules/accounts/services/timezone.service\";\nexport {\n buildLocaleOptions,\n LANGUAGE_OPTIONS as LOCALE_LANGUAGE_OPTIONS,\n} from \"./utils/intl/locales\";\nexport type { LocaleOption } from \"./utils/intl/locales\";\nexport { copyToClipboard, readFromClipboard } from \"./utils/browser/clipboard\";\n\n// UI - Form (new widgets)\nexport { FormField } from \"./components/ui/form/FormField\";\nexport { SelectField } from \"./components/ui/form/SelectField\";\nexport { ComboboxField } from \"./components/ui/form/ComboboxField\";\nexport type { ComboboxOption } from \"./components/ui/form/ComboboxField\";\nexport { default as PhoneInput } from \"./components/ui/form/PhoneInput\";\nexport { default as SwitchOptionFieldWithIcon } from \"./components/ui/form/SwitchOptionFieldWithIcon\";\nexport { TextAreaField } from \"./components/ui/form/TextAreaField\";\n\n// Account Module - Hooks\nexport {\n useUpdateAccount,\n useUpdateAccountUser,\n useUpdateAccountUserById,\n useDeleteAccountUser,\n useDeleteAccount,\n} from \"./modules/accounts/hooks/useAccountManagement\";\n\n// Account Types\nexport type {\n UpdateAccountRequest,\n UpdateAccountUserRequest,\n ChangePasswordRequest,\n DeleteAccountActionResult,\n DeleteUserActionResult,\n UpdateAccountActionResult,\n UpdateUserActionResult,\n TwoFactorGenerateResult,\n TwoFactorActionResult,\n ContactResetResult,\n} from \"./modules/accounts/types\";\n\nexport { default as AccountModals } from \"./components/account/AccountModals\";\nexport { useAccountModals } from \"./store/useAccountModals\";\nexport type { AccountModalsConfig } from \"./store/useAccountModals\";\n\nexport { ModalManager } from \"./components/modals/ModalManager\";\nexport { Modals } from \"./components/modals/Modals\";\n\nexport { default as TwoFactorAuthModal } from \"./components/account/TwoFactorAuthModal\";\nexport { default as DisableTwoFactorAuthModal } from \"./components/account/DisableTwoFactorAuthModal\";\nexport { default as ConfirmGlobalPreferencesModal } from \"./components/account/ConfirmGlobalPreferencesModal\";\nexport { MyProfileSection } from \"./components/account/sections/MyProfileSection\";\nexport { PreferencesSection } from \"./components/account/sections/PreferencesSection\";\nexport { SecuritySection } from \"./components/account/sections/SecuritySection\";\nexport { ChangePasswordSection } from \"./components/account/sections/ChangePasswordSection\";\nexport { ChangeEmailModal } from \"./components/account/sections/ChangeEmailModal\";\nexport { ChangePhoneModal } from \"./components/account/sections/ChangePhoneModal\";\n\n// Account Constants\nexport {\n GENDER_OPTIONS,\n CURRENCY_OPTIONS,\n TIME_FORMAT_OPTIONS,\n NOTIFICATION_TYPES,\n LANGUAGE_OPTIONS,\n} from \"./components/account/constants\";\n"],"mappings":"AACA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AAGd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,6BAA6B;AACtC,SAAS,oBAAoB;AAU7B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,iBAAiB;AAI1B,SAAS,qBAAqB;AAG9B,SAAS,4BAA4B;AACrC,SAAS,6BAA6B;AACtC,SAAS,eAAe,iBAAiB;AAQzC,SAAS,UAAU;AACnB,SAAS,wBAAwB;AACjC,SAAS,aAAa,mBAAmB;AAGzC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAAc;AAEvB,SAAS,iBAAiB;AAE1B,SAAS,uBAAuB;AAEhC,SAAS,yBAAyB;AAClC,SAAS,2BAA2B;AACpC,SAAoB,WAAX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S,wBAAwB;AACjC,SAAS,wBAAwB;AAGjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,oBAAAC;AAAA,OACK;","names":["default","LANGUAGE_OPTIONS"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/users/schema/messages.schema.ts"],"sourcesContent":["import { z } from 'zod';\r\n\r\nexport const MessageSchema = z.object({\r\n id: z.string(),\r\n deleted: z.number(),\r\n datetime_alt: z.string().nullable(),\r\n datetime_del: z.string().nullable(),\r\n datetime_add: z.string(),\r\n id_wl: z.number(),\r\n id_account: z.number(),\r\n id_user: z.number(),\r\n status: z.number().nullable(),\r\n type: z.string(),\r\n subject: z.string(),\r\n message: z.string(),\r\n to: z.string(),\r\n url: z.string(),\r\n});\r\n\r\nexport type Message = z.infer<typeof MessageSchema>;\r\n\r\nexport interface FindMessagesParams {\r\n id_user: number;\r\n type: string;\r\n limit: number;\r\n page: number;\r\n order: 'asc' | 'desc';\r\n}\r\n\r\nexport interface ListMessagesApiResponse {\r\n status: 0 | 1;\r\n total: number;\r\n data: Message[];\r\n totalUnread: number;\r\n message?: string;\r\n}\r\n\r\nexport interface MarkAsReadApiResponse {\r\n status: 0 | 1;\r\n message?: string;\r\n}\r\n\r\nexport interface MarkAllAsReadApiResponse {\r\n status: 0 | 1;\r\n message?: string;\r\n}\r\n"],"mappings":"AAAA,SAAS,SAAS;AAEX,MAAM,gBAAgB,EAAE,OAAO;AAAA,EACpC,IAAI,EAAE,OAAO;AAAA,EACb,SAAS,EAAE,OAAO;AAAA,EAClB,cAAc,EAAE,OAAO,EAAE,SAAS;AAAA,EAClC,cAAc,EAAE,OAAO,EAAE,SAAS;AAAA,EAClC,cAAc,EAAE,OAAO;AAAA,EACvB,OAAO,EAAE,OAAO;AAAA,EAChB,YAAY,EAAE,OAAO;AAAA,EACrB,SAAS,EAAE,OAAO;AAAA,EAClB,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,MAAM,EAAE,OAAO;AAAA,EACf,SAAS,EAAE,OAAO;AAAA,EAClB,SAAS,EAAE,OAAO;AAAA,EAClB,IAAI,EAAE,OAAO;AAAA,EACb,KAAK,EAAE,OAAO;AAChB,CAAC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/modules/users/schema/messages.schema.ts"],"sourcesContent":["import { z } from 'zod';\r\n\r\nexport const MessageSchema = z.object({\r\n id: z.string(),\r\n deleted: z.number(),\r\n datetime_alt: z.string().nullable(),\r\n datetime_del: z.string().nullable(),\r\n datetime_add: z.string(),\r\n id_wl: z.number(),\r\n id_account: z.number(),\r\n id_user: z.number(),\r\n status: z.number().nullable(),\r\n type: z.string(),\r\n subject: z.string(),\r\n message: z.string(),\r\n to: z.string(),\r\n url: z.string(),\r\n});\r\n\r\nexport type Message = z.infer<typeof MessageSchema>;\r\n\r\nexport interface FindMessagesParams {\r\n id_user: number;\r\n type: string;\r\n limit: number;\r\n page: number;\r\n status: number;\r\n order: 'asc' | 'desc';\r\n}\r\n\r\nexport interface ListMessagesApiResponse {\r\n status: 0 | 1;\r\n total: number;\r\n data: Message[];\r\n totalUnread: number;\r\n message?: string;\r\n}\r\n\r\nexport interface MarkAsReadApiResponse {\r\n status: 0 | 1;\r\n message?: string;\r\n}\r\n\r\nexport interface MarkAllAsReadApiResponse {\r\n status: 0 | 1;\r\n message?: string;\r\n}\r\n"],"mappings":"AAAA,SAAS,SAAS;AAEX,MAAM,gBAAgB,EAAE,OAAO;AAAA,EACpC,IAAI,EAAE,OAAO;AAAA,EACb,SAAS,EAAE,OAAO;AAAA,EAClB,cAAc,EAAE,OAAO,EAAE,SAAS;AAAA,EAClC,cAAc,EAAE,OAAO,EAAE,SAAS;AAAA,EAClC,cAAc,EAAE,OAAO;AAAA,EACvB,OAAO,EAAE,OAAO;AAAA,EAChB,YAAY,EAAE,OAAO;AAAA,EACrB,SAAS,EAAE,OAAO;AAAA,EAClB,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,MAAM,EAAE,OAAO;AAAA,EACf,SAAS,EAAE,OAAO;AAAA,EAClB,SAAS,EAAE,OAAO;AAAA,EAClB,IAAI,EAAE,OAAO;AAAA,EACb,KAAK,EAAE,OAAO;AAChB,CAAC;","names":[]}
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ import { Bell } from "lucide-react";
|
|
|
5
5
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
6
6
|
import { Popover } from "../ui/overlay/Popover";
|
|
7
7
|
import { Button } from "../ui/buttons/Button";
|
|
8
|
-
import
|
|
8
|
+
import NotificationCard from "../widgets/notifications/NotificationCard";
|
|
9
9
|
import { cn } from "../../infra/utils/clsx";
|
|
10
10
|
import { useMessages, useMarkAllMessagesAsRead } from "../../modules/users/hooks/messages.hook";
|
|
11
11
|
import { formatDistanceToNow } from "date-fns";
|
|
@@ -27,7 +27,7 @@ function NotificationsPopover({
|
|
|
27
27
|
badgeClassName = "bg-pages-400",
|
|
28
28
|
}: NotificationsPopoverProps) {
|
|
29
29
|
const [open, setOpen] = useState(false);
|
|
30
|
-
const { data: messagesData } = useMessages();
|
|
30
|
+
const { data: messagesData } = useMessages({ limit: 5 });
|
|
31
31
|
const { mutate: markAllAsRead } = useMarkAllMessagesAsRead();
|
|
32
32
|
|
|
33
33
|
const messages = messagesData?.data ?? [];
|
|
@@ -73,7 +73,7 @@ function NotificationsPopover({
|
|
|
73
73
|
|
|
74
74
|
{messages.length > 0 ? (
|
|
75
75
|
messages.map((message, index) => (
|
|
76
|
-
<
|
|
76
|
+
<NotificationCard
|
|
77
77
|
key={message.id}
|
|
78
78
|
icon={<Bell size={16} />}
|
|
79
79
|
iconBgColor="bg-gray-100"
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { Bell, Check } from "lucide-react";
|
|
2
|
+
import { Button } from "../../ui/buttons/Button";
|
|
3
|
+
import {
|
|
4
|
+
Tabs,
|
|
5
|
+
TabsContent,
|
|
6
|
+
TabsList,
|
|
7
|
+
TabsTrigger,
|
|
8
|
+
} from "../../ui/data-display/Tabs";
|
|
9
|
+
import { useMessages } from "../../../modules/users/hooks/messages.hook";
|
|
10
|
+
import NotificationCard from "../../widgets/notifications/NotificationCard";
|
|
11
|
+
import { formatDistanceToNow } from "date-fns";
|
|
12
|
+
import { ptBR } from "date-fns/locale";
|
|
13
|
+
|
|
14
|
+
export function NotificationContent() {
|
|
15
|
+
const { data: unreadedNotifications } = useMessages({
|
|
16
|
+
page: 1,
|
|
17
|
+
limit: 10,
|
|
18
|
+
status: 1,
|
|
19
|
+
type: "notification",
|
|
20
|
+
order: "desc",
|
|
21
|
+
});
|
|
22
|
+
const { data: allNotifications } = useMessages({
|
|
23
|
+
page: 1,
|
|
24
|
+
limit: 10,
|
|
25
|
+
type: "notification",
|
|
26
|
+
order: "desc",
|
|
27
|
+
});
|
|
28
|
+
return (
|
|
29
|
+
<div className="flex flex-col gap-6 lg:gap-10 px-4 py-6 lg:px-20 lg:py-14">
|
|
30
|
+
<div className="flex items-center justify-between gap-4">
|
|
31
|
+
<div className="flex flex-col gap-2">
|
|
32
|
+
<h1 className="paragraph-xlarge-semibold lg:title-large-semibold text-gray-950">
|
|
33
|
+
Notificações
|
|
34
|
+
</h1>
|
|
35
|
+
<p className="paragraph-medium-regular text-gray-600 hidden lg:block">
|
|
36
|
+
Tenha controle total sobre páginas, experiências e conversões.
|
|
37
|
+
</p>
|
|
38
|
+
</div>
|
|
39
|
+
<Button variant={"secondary"} className="h-10! lg:h-12! shrink-0">
|
|
40
|
+
<Check size={20} />
|
|
41
|
+
<span className="lg:block hidden">Marcar todos como lidos</span>
|
|
42
|
+
<span className="lg:hidden">Marcar como lidos</span>
|
|
43
|
+
</Button>
|
|
44
|
+
</div>
|
|
45
|
+
<Tabs
|
|
46
|
+
defaultValue="all"
|
|
47
|
+
className="flex flex-col w-full bg-transparent gap-6 lg:gap-8"
|
|
48
|
+
>
|
|
49
|
+
<TabsList className="h-auto pb-0 bg-transparent">
|
|
50
|
+
<TabsTrigger className="gap-2" value="all">
|
|
51
|
+
Todas as notificações{" "}
|
|
52
|
+
<span className="text-gray-500">
|
|
53
|
+
({allNotifications?.data.length})
|
|
54
|
+
</span>
|
|
55
|
+
</TabsTrigger>
|
|
56
|
+
<TabsTrigger className="gap-2" value="unreads">
|
|
57
|
+
Não lidas{" "}
|
|
58
|
+
<span className="text-gray-500">
|
|
59
|
+
({unreadedNotifications?.data.length})
|
|
60
|
+
</span>
|
|
61
|
+
</TabsTrigger>
|
|
62
|
+
</TabsList>
|
|
63
|
+
|
|
64
|
+
<TabsContent value="all">
|
|
65
|
+
<div className="flex flex-col border border-gray-200 rounded-lg w-full bg-white">
|
|
66
|
+
{allNotifications?.data.map((notification, index) => (
|
|
67
|
+
<NotificationCard
|
|
68
|
+
key={notification.id}
|
|
69
|
+
icon={<Bell size={20} className="text-pages-600" />}
|
|
70
|
+
iconBgColor="bg-pages-100"
|
|
71
|
+
title={notification.subject}
|
|
72
|
+
description={notification.message}
|
|
73
|
+
time={formatDistanceToNow(new Date(notification.datetime_add), {
|
|
74
|
+
addSuffix: true,
|
|
75
|
+
locale: ptBR,
|
|
76
|
+
})}
|
|
77
|
+
isUnread={notification.status === 1}
|
|
78
|
+
showBorder={index < allNotifications.data.length - 1}
|
|
79
|
+
/>
|
|
80
|
+
))}
|
|
81
|
+
</div>
|
|
82
|
+
</TabsContent>
|
|
83
|
+
|
|
84
|
+
<TabsContent value="unreads">
|
|
85
|
+
<div className="flex flex-col border border-gray-200 rounded-lg w-full bg-white">
|
|
86
|
+
{unreadedNotifications?.data.map((notification, index) => (
|
|
87
|
+
<NotificationCard
|
|
88
|
+
key={notification.id}
|
|
89
|
+
icon={<Bell size={20} className="text-pages-600" />}
|
|
90
|
+
iconBgColor="bg-pages-100"
|
|
91
|
+
title={notification.subject}
|
|
92
|
+
description={notification.message}
|
|
93
|
+
time={formatDistanceToNow(new Date(notification.datetime_add), {
|
|
94
|
+
addSuffix: true,
|
|
95
|
+
locale: ptBR,
|
|
96
|
+
})}
|
|
97
|
+
isUnread={notification.status === 1}
|
|
98
|
+
showBorder={index < unreadedNotifications.data.length - 1}
|
|
99
|
+
/>
|
|
100
|
+
))}
|
|
101
|
+
</div>
|
|
102
|
+
</TabsContent>
|
|
103
|
+
</Tabs>
|
|
104
|
+
</div>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Clock } from 'lucide-react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { cn } from '../../../infra/utils/clsx';
|
|
4
|
+
|
|
5
|
+
type NotificationCardProps = {
|
|
6
|
+
icon: ReactNode;
|
|
7
|
+
iconBgColor?: string;
|
|
8
|
+
title: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
time: string;
|
|
11
|
+
actions?: ReactNode;
|
|
12
|
+
isUnread?: boolean;
|
|
13
|
+
showBorder?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default function NotificationCard({
|
|
18
|
+
icon,
|
|
19
|
+
iconBgColor,
|
|
20
|
+
title,
|
|
21
|
+
description,
|
|
22
|
+
time,
|
|
23
|
+
actions,
|
|
24
|
+
isUnread = false,
|
|
25
|
+
showBorder = true,
|
|
26
|
+
className,
|
|
27
|
+
}: NotificationCardProps) {
|
|
28
|
+
return (
|
|
29
|
+
<div
|
|
30
|
+
className={cn(
|
|
31
|
+
'flex flex-col lg:flex-row items-start p-4 lg:p-6 gap-4 lg:gap-5 relative',
|
|
32
|
+
showBorder && 'border-b border-gray-200',
|
|
33
|
+
className
|
|
34
|
+
)}
|
|
35
|
+
>
|
|
36
|
+
<div
|
|
37
|
+
className={cn(
|
|
38
|
+
'flex items-center justify-center size-10 rounded-full shrink-0',
|
|
39
|
+
iconBgColor
|
|
40
|
+
)}
|
|
41
|
+
>
|
|
42
|
+
{icon}
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<div className="flex flex-col gap-4 flex-1">
|
|
46
|
+
<div className="flex flex-col gap-1">
|
|
47
|
+
<span className="paragraph-small-semibold text-gray-950">{title}</span>
|
|
48
|
+
{description && (
|
|
49
|
+
<span className="paragraph-small-regular text-gray-600">{description}</span>
|
|
50
|
+
)}
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<div className="flex items-center gap-1.5">
|
|
54
|
+
<Clock size={14} className="text-gray-400" />
|
|
55
|
+
<span className="paragraph-xsmall-medium text-gray-600">{time}</span>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
{actions && <div className="flex items-center gap-2">{actions}</div>}
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
{isUnread && <div className="size-2 bg-pages-400 rounded-full shrink-0 mt-1" />}
|
|
62
|
+
</div>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export type { NotificationCardProps };
|
package/src/index.ts
CHANGED
|
@@ -90,10 +90,11 @@ export { AppMobileNavBar } from "./components/layouts/AppMobileNavBar";
|
|
|
90
90
|
export type { AppMobileNavBarProps } from "./components/layouts/AppMobileNavBar";
|
|
91
91
|
export { SideBarNavigation } from "./components/layouts/SideBarNavigation";
|
|
92
92
|
export { MdSideBarNavigation } from "./components/layouts/MdSideBarNavigation";
|
|
93
|
-
export {
|
|
94
|
-
export type {
|
|
93
|
+
export { default as NotificationCard } from "./components/widgets/notifications/NotificationCard";
|
|
94
|
+
export type { NotificationCardProps } from "./components/widgets/notifications/NotificationCard";
|
|
95
95
|
export { NotificationsPopover } from "./components/layouts/NotificationsPopover";
|
|
96
96
|
export type { NotificationsPopoverProps } from "./components/layouts/NotificationsPopover";
|
|
97
|
+
export { NotificationContent } from "./components/pages/notifications/Notifications";
|
|
97
98
|
export { UsersSelectorPopover } from "./components/layouts/UsersSelectorPopover";
|
|
98
99
|
export type { UsersSelectorPopoverProps } from "./components/layouts/UsersSelectorPopover";
|
|
99
100
|
export { ProfilePopover } from "./components/layouts/ProfilePopover";
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
function NotificationItem({ icon, iconBgColor, title, time, showBorder = true }) {
|
|
3
|
-
return /* @__PURE__ */ jsx("div", { className: `flex items-center gap-3 px-4 py-5 ${showBorder ? "border-b border-gray-200" : ""}`, children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
4
|
-
/* @__PURE__ */ jsx("span", { className: "paragraph-small-semibold text-gray-950", children: title }),
|
|
5
|
-
/* @__PURE__ */ jsx("span", { className: "paragraph-xsmall-medium text-gray-500", children: time })
|
|
6
|
-
] }) });
|
|
7
|
-
}
|
|
8
|
-
export {
|
|
9
|
-
NotificationItem
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=NotificationItem.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/layouts/NotificationItem.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\r\n\r\ntype NotificationItemProps = {\r\n icon: ReactNode;\r\n iconBgColor: string;\r\n title: string;\r\n time: string;\r\n showBorder?: boolean;\r\n}\r\n\r\nfunction NotificationItem({ icon, iconBgColor, title, time, showBorder = true }: NotificationItemProps) {\r\n return (\r\n <div className={`flex items-center gap-3 px-4 py-5 ${showBorder ? 'border-b border-gray-200' : ''}`}>\r\n {/* <div className={`flex items-center justify-center rounded-full ${iconBgColor} size-10`}>\r\n {icon}\r\n </div> */}\r\n <div className=\"flex flex-col gap-1.5\">\r\n <span className=\"paragraph-small-semibold text-gray-950\">{title}</span>\r\n <span className=\"paragraph-xsmall-medium text-gray-500\">{time}</span>\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nexport { NotificationItem };\r\nexport type { NotificationItemProps };\r\n"],"mappings":"AAgBY,SACI,KADJ;AANZ,SAAS,iBAAiB,EAAE,MAAM,aAAa,OAAO,MAAM,aAAa,KAAK,GAA0B;AACpG,SACI,oBAAC,SAAI,WAAW,qCAAqC,aAAa,6BAA6B,EAAE,IAI7F,+BAAC,SAAI,WAAU,yBACX;AAAA,wBAAC,UAAK,WAAU,0CAA0C,iBAAM;AAAA,IAChE,oBAAC,UAAK,WAAU,yCAAyC,gBAAK;AAAA,KAClE,GACJ;AAER;","names":[]}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
type NotificationItemProps = {
|
|
4
|
-
icon: ReactNode;
|
|
5
|
-
iconBgColor: string;
|
|
6
|
-
title: string;
|
|
7
|
-
time: string;
|
|
8
|
-
showBorder?: boolean;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function NotificationItem({ icon, iconBgColor, title, time, showBorder = true }: NotificationItemProps) {
|
|
12
|
-
return (
|
|
13
|
-
<div className={`flex items-center gap-3 px-4 py-5 ${showBorder ? 'border-b border-gray-200' : ''}`}>
|
|
14
|
-
{/* <div className={`flex items-center justify-center rounded-full ${iconBgColor} size-10`}>
|
|
15
|
-
{icon}
|
|
16
|
-
</div> */}
|
|
17
|
-
<div className="flex flex-col gap-1.5">
|
|
18
|
-
<span className="paragraph-small-semibold text-gray-950">{title}</span>
|
|
19
|
-
<span className="paragraph-xsmall-medium text-gray-500">{time}</span>
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export { NotificationItem };
|
|
26
|
-
export type { NotificationItemProps };
|