@retinalabsllc/zairusjs 16.1.45 → 16.1.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +49 -12
- package/dist/index.mjs +51 -13
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1060,6 +1060,7 @@ interface UniversalHome2Props {
|
|
|
1060
1060
|
formatNotifDate: (date: string | Date) => string;
|
|
1061
1061
|
customContent?: React.ReactNode;
|
|
1062
1062
|
departmentsProps: UniversalDepartmentsPageProps;
|
|
1063
|
+
onLogout?: () => Promise<void>;
|
|
1063
1064
|
}
|
|
1064
1065
|
declare const UniversalHome2: React.FC<UniversalHome2Props>;
|
|
1065
1066
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1060,6 +1060,7 @@ interface UniversalHome2Props {
|
|
|
1060
1060
|
formatNotifDate: (date: string | Date) => string;
|
|
1061
1061
|
customContent?: React.ReactNode;
|
|
1062
1062
|
departmentsProps: UniversalDepartmentsPageProps;
|
|
1063
|
+
onLogout?: () => Promise<void>;
|
|
1063
1064
|
}
|
|
1064
1065
|
declare const UniversalHome2: React.FC<UniversalHome2Props>;
|
|
1065
1066
|
|
package/dist/index.js
CHANGED
|
@@ -4901,13 +4901,16 @@ var UniversalHome2 = ({
|
|
|
4901
4901
|
onResolveInvite,
|
|
4902
4902
|
formatNotifDate,
|
|
4903
4903
|
customContent,
|
|
4904
|
-
departmentsProps
|
|
4904
|
+
departmentsProps,
|
|
4905
|
+
onLogout
|
|
4905
4906
|
}) => {
|
|
4906
4907
|
const [isAvatarLoaded, setIsAvatarLoaded] = (0, import_react81.useState)(false);
|
|
4907
4908
|
const [showNotifDialog, setShowNotifDialog] = (0, import_react81.useState)(false);
|
|
4908
4909
|
const [showOrgSwitcher, setShowOrgSwitcher] = (0, import_react81.useState)(false);
|
|
4909
4910
|
const [selectedNotif, setSelectedNotif] = (0, import_react81.useState)(null);
|
|
4910
4911
|
const [isResolving, setIsResolving] = (0, import_react81.useState)(false);
|
|
4912
|
+
const [showLogoutConfirm, setShowLogoutConfirm] = (0, import_react81.useState)(false);
|
|
4913
|
+
const [isLoggingOut, setIsLoggingOut] = (0, import_react81.useState)(false);
|
|
4911
4914
|
const router = (0, import_navigation6.useRouter)();
|
|
4912
4915
|
const fallbackAvatarUrl = "https://storage.googleapis.com/retina-cloud-v2/assets/images/avatar.avif";
|
|
4913
4916
|
const finalAvatarSrc = avatarSrc || fallbackAvatarUrl;
|
|
@@ -4939,7 +4942,31 @@ var UniversalHome2 = ({
|
|
|
4939
4942
|
setIsResolving(false);
|
|
4940
4943
|
}
|
|
4941
4944
|
};
|
|
4942
|
-
|
|
4945
|
+
const confirmLogout = async () => {
|
|
4946
|
+
setIsLoggingOut(true);
|
|
4947
|
+
try {
|
|
4948
|
+
if (onLogout) await onLogout();
|
|
4949
|
+
} catch (e) {
|
|
4950
|
+
import_react_hot_toast15.default.error("Failed to log out cleanly.");
|
|
4951
|
+
} finally {
|
|
4952
|
+
setIsLoggingOut(false);
|
|
4953
|
+
setShowLogoutConfirm(false);
|
|
4954
|
+
}
|
|
4955
|
+
};
|
|
4956
|
+
return /* @__PURE__ */ import_react81.default.createElement("div", { className: "w-full max-w-3xl mx-auto flex flex-col animate-in fade-in duration-300 relative" }, /* @__PURE__ */ import_react81.default.createElement(
|
|
4957
|
+
ConfirmationDialog,
|
|
4958
|
+
{
|
|
4959
|
+
isOpen: showLogoutConfirm,
|
|
4960
|
+
title: "Log Out",
|
|
4961
|
+
message: "Are you sure you want to log out of TruHuddle?",
|
|
4962
|
+
confirmText: "Log Out",
|
|
4963
|
+
cancelText: "Cancel",
|
|
4964
|
+
isProcessing: isLoggingOut,
|
|
4965
|
+
isDestructive: true,
|
|
4966
|
+
onClose: () => setShowLogoutConfirm(false),
|
|
4967
|
+
onConfirm: confirmLogout
|
|
4968
|
+
}
|
|
4969
|
+
), /* @__PURE__ */ import_react81.default.createElement("div", { className: "flex items-center justify-between w-full pb-4" }, /* @__PURE__ */ import_react81.default.createElement("div", { className: "w-10 h-10 shrink-0 cursor-pointer", onClick: () => setShowOrgSwitcher(true) }, /* @__PURE__ */ import_react81.default.createElement("div", { className: "relative w-full h-full rounded-lg overflow-hidden bg-white flex items-center justify-center" }, !isAvatarLoaded && /* @__PURE__ */ import_react81.default.createElement("div", { className: "absolute inset-0 flex items-center justify-center z-10 bg-white" }, /* @__PURE__ */ import_react81.default.createElement(import_react82.HugeiconsIcon, { icon: import_core_free_icons29.Loading03Icon, size: 16, className: "animate-spin text-black" })), /* @__PURE__ */ import_react81.default.createElement(
|
|
4943
4970
|
"img",
|
|
4944
4971
|
{
|
|
4945
4972
|
src: finalAvatarSrc,
|
|
@@ -4947,7 +4974,7 @@ var UniversalHome2 = ({
|
|
|
4947
4974
|
onLoad: () => setIsAvatarLoaded(true),
|
|
4948
4975
|
className: `w-full h-full object-cover transition-opacity duration-300 ${isAvatarLoaded ? "opacity-100" : "opacity-0"}`
|
|
4949
4976
|
}
|
|
4950
|
-
))), /* @__PURE__ */ import_react81.default.createElement("div", { className: "flex items-center gap-2 shrink-0" }, /* @__PURE__ */ import_react81.default.createElement(
|
|
4977
|
+
))), /* @__PURE__ */ import_react81.default.createElement("div", { className: "flex-1 h-10 bg-black rounded-full mx-3 flex items-center justify-between px-4" }, /* @__PURE__ */ import_react81.default.createElement("div", { className: "flex items-center gap-3" }, barIcons.map((item, idx) => /* @__PURE__ */ import_react81.default.createElement("button", { key: idx, onClick: item.onClick, className: "outline-none hover:opacity-70 transition-opacity flex items-center justify-center" }, /* @__PURE__ */ import_react81.default.createElement(import_react82.HugeiconsIcon, { icon: item.icon, size: 16, color: item.color || "white" })))), /* @__PURE__ */ import_react81.default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ import_react81.default.createElement("span", { className: "text-white text-[11px] tracking-widest" }, getDisplayStatus()), /* @__PURE__ */ import_react81.default.createElement("div", { className: `w-2 h-2 rounded-full ${getStatusColor()}` }))), /* @__PURE__ */ import_react81.default.createElement("div", { className: "flex items-center gap-2 shrink-0" }, /* @__PURE__ */ import_react81.default.createElement(
|
|
4951
4978
|
"button",
|
|
4952
4979
|
{
|
|
4953
4980
|
onClick: () => router.push("/app/settings"),
|
|
@@ -5000,7 +5027,7 @@ var UniversalHome2 = ({
|
|
|
5000
5027
|
{
|
|
5001
5028
|
...departmentsProps
|
|
5002
5029
|
}
|
|
5003
|
-
)), showOrgSwitcher && /* @__PURE__ */ import_react81.default.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ import_react81.default.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowOrgSwitcher(false) }), /* @__PURE__ */ import_react81.default.createElement("div", { className: "relative w-full max-w-sm bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 h-auto max-h-[80vh]" }, /* @__PURE__ */ import_react81.default.createElement("div", { className: "flex items-center justify-between p-5 shrink-0
|
|
5030
|
+
)), showOrgSwitcher && /* @__PURE__ */ import_react81.default.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ import_react81.default.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowOrgSwitcher(false) }), /* @__PURE__ */ import_react81.default.createElement("div", { className: "relative w-full max-w-sm bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 h-auto max-h-[80vh]" }, /* @__PURE__ */ import_react81.default.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, /* @__PURE__ */ import_react81.default.createElement("h3", { className: "text-[15px] text-black tracking-tight" }, "Switch Workspace"), /* @__PURE__ */ import_react81.default.createElement("button", { onClick: () => setShowOrgSwitcher(false), className: "text-neutral-400 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ import_react81.default.createElement(import_react82.HugeiconsIcon, { icon: import_core_free_icons29.CancelCircleIcon, size: 18 }))), /* @__PURE__ */ import_react81.default.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-2" }, /* @__PURE__ */ import_react81.default.createElement("div", { className: "flex flex-col" }, organizations?.length === 0 ? /* @__PURE__ */ import_react81.default.createElement("div", { className: "p-8 text-center text-xs text-neutral-400" }, "No organizations found.") : organizations?.map((org) => /* @__PURE__ */ import_react81.default.createElement(
|
|
5004
5031
|
"button",
|
|
5005
5032
|
{
|
|
5006
5033
|
key: org.id,
|
|
@@ -5008,16 +5035,27 @@ var UniversalHome2 = ({
|
|
|
5008
5035
|
onOrganizationSelect?.(org.id);
|
|
5009
5036
|
setShowOrgSwitcher(false);
|
|
5010
5037
|
},
|
|
5011
|
-
className: `p-4 flex items-center justify-between gap-3 cursor-pointer outline-none transition-colors last:border-0 ${activeOrgId === org.id ? "bg-neutral-50" : "hover:bg-neutral-50/50"}`
|
|
5038
|
+
className: `p-4 flex items-center justify-between gap-3 cursor-pointer outline-none transition-colors border-b border-neutral-50 last:border-0 ${activeOrgId === org.id ? "bg-neutral-50" : "hover:bg-neutral-50/50"}`
|
|
5012
5039
|
},
|
|
5013
|
-
/* @__PURE__ */ import_react81.default.createElement("span", { className: `text-[13px] tracking-tight ${activeOrgId === org.id ? "text-black
|
|
5040
|
+
/* @__PURE__ */ import_react81.default.createElement("span", { className: `text-[13px] tracking-tight ${activeOrgId === org.id ? "text-black" : "text-neutral-600"}` }, org.name),
|
|
5014
5041
|
activeOrgId === org.id && /* @__PURE__ */ import_react81.default.createElement("div", { className: "w-2 h-2 rounded-full bg-emerald-500" })
|
|
5015
|
-
))))
|
|
5042
|
+
)))), /* @__PURE__ */ import_react81.default.createElement("div", { className: "p-4 0 shrink-0" }, /* @__PURE__ */ import_react81.default.createElement(
|
|
5043
|
+
"button",
|
|
5044
|
+
{
|
|
5045
|
+
onClick: () => {
|
|
5046
|
+
setShowOrgSwitcher(false);
|
|
5047
|
+
setShowLogoutConfirm(true);
|
|
5048
|
+
},
|
|
5049
|
+
className: "w-full py-3 flex items-center justify-center gap-2 rounded-full bg-rose-50 text-rose-600 hover:bg-rose-100 transition-colors outline-none text-[13px] tracking-wide"
|
|
5050
|
+
},
|
|
5051
|
+
/* @__PURE__ */ import_react81.default.createElement(import_react82.HugeiconsIcon, { icon: import_core_free_icons29.Logout01Icon, size: 16 }),
|
|
5052
|
+
"Log Out"
|
|
5053
|
+
)))), showNotifDialog && /* @__PURE__ */ import_react81.default.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ import_react81.default.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowNotifDialog(false) }), /* @__PURE__ */ import_react81.default.createElement("div", { className: "relative w-full max-w-sm bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 h-[80vh]" }, /* @__PURE__ */ import_react81.default.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, selectedNotif ? /* @__PURE__ */ import_react81.default.createElement("button", { onClick: () => setSelectedNotif(null), disabled: isResolving, className: "text-neutral-400 hover:text-black transition-colors outline-none flex items-center gap-2 text-[11px] tracking-widest disabled:opacity-50" }, /* @__PURE__ */ import_react81.default.createElement(import_react82.HugeiconsIcon, { icon: import_core_free_icons29.ArrowLeft01Icon, size: 14 }), " Back") : /* @__PURE__ */ import_react81.default.createElement("h3", { className: "text-[15px] text-black tracking-tight flex items-center gap-2" }, "Notifications", isNotifsLoading && /* @__PURE__ */ import_react81.default.createElement(import_react82.HugeiconsIcon, { icon: import_core_free_icons29.Loading03Icon, size: 14, className: "animate-spin text-neutral-400" })), /* @__PURE__ */ import_react81.default.createElement("button", { onClick: () => setShowNotifDialog(false), disabled: isResolving, className: "text-neutral-400 hover:text-black transition-colors outline-none disabled:opacity-50" }, /* @__PURE__ */ import_react81.default.createElement(import_react82.HugeiconsIcon, { icon: import_core_free_icons29.CancelCircleIcon, size: 18 }))), /* @__PURE__ */ import_react81.default.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-2" }, selectedNotif ? /* @__PURE__ */ import_react81.default.createElement("div", { className: "p-4 text-left" }, /* @__PURE__ */ import_react81.default.createElement("h4", { className: "text-[14px] text-black mb-1" }, selectedNotif.title), /* @__PURE__ */ import_react81.default.createElement("span", { className: "text-[10px] text-neutral-400 tracking-widest mb-4 block" }, formatNotifDate(selectedNotif.createdAt)), /* @__PURE__ */ import_react81.default.createElement("p", { className: "text-[12px] text-neutral-600 leading-relaxed whitespace-pre-wrap" }, selectedNotif.message), selectedNotif.type === "HUDDLE_INVITE" && selectedNotif.meta_json?.action === "RESOLVE_INVITE" && /* @__PURE__ */ import_react81.default.createElement("div", { className: "mt-8 flex gap-3 pt-6 border-t border-neutral-100" }, /* @__PURE__ */ import_react81.default.createElement(
|
|
5016
5054
|
"button",
|
|
5017
5055
|
{
|
|
5018
5056
|
onClick: () => handleResolve("ACCEPTED"),
|
|
5019
5057
|
disabled: isResolving,
|
|
5020
|
-
className: "flex-1 py-
|
|
5058
|
+
className: "flex-1 py-2.5 rounded-full bg-black text-white text-[12px] tracking-wide transition-all outline-none hover:bg-neutral-800 flex justify-center items-center disabled:opacity-50"
|
|
5021
5059
|
},
|
|
5022
5060
|
isResolving ? /* @__PURE__ */ import_react81.default.createElement(import_react82.HugeiconsIcon, { icon: import_core_free_icons29.Loading03Icon, className: "animate-spin", size: 16 }) : "Accept"
|
|
5023
5061
|
), /* @__PURE__ */ import_react81.default.createElement(
|
|
@@ -5025,7 +5063,7 @@ var UniversalHome2 = ({
|
|
|
5025
5063
|
{
|
|
5026
5064
|
onClick: () => handleResolve("REJECTED"),
|
|
5027
5065
|
disabled: isResolving,
|
|
5028
|
-
className: "flex-1 py-
|
|
5066
|
+
className: "flex-1 py-2.5 rounded-full bg-white border border-neutral-200 text-black text-[12px] tracking-wide transition-all outline-none hover:bg-neutral-50 flex justify-center items-center disabled:opacity-50"
|
|
5029
5067
|
},
|
|
5030
5068
|
"Reject"
|
|
5031
5069
|
))) : /* @__PURE__ */ import_react81.default.createElement("div", { className: "flex flex-col divide-y divide-neutral-50/50" }, notifications?.length === 0 && !isNotifsLoading ? /* @__PURE__ */ import_react81.default.createElement("div", { className: "p-8 text-center text-xs text-neutral-400" }, "You have no notifications.") : notifications?.map((notif) => /* @__PURE__ */ import_react81.default.createElement(
|
|
@@ -5118,7 +5156,6 @@ var UniversalSettings = ({
|
|
|
5118
5156
|
onInviteMember,
|
|
5119
5157
|
initialDisplayName,
|
|
5120
5158
|
initialSlug,
|
|
5121
|
-
slugPrefixUrl = "https://truhuddle.com/company/",
|
|
5122
5159
|
onSaveAccount,
|
|
5123
5160
|
onCheckSlugAvailability,
|
|
5124
5161
|
aiCredits,
|
|
@@ -5321,7 +5358,7 @@ var UniversalSettings = ({
|
|
|
5321
5358
|
className: "flex items-center justify-center bg-white w-9 h-9 rounded-full text-neutral-500 hover:text-black transition-colors outline-none"
|
|
5322
5359
|
},
|
|
5323
5360
|
/* @__PURE__ */ import_react83.default.createElement(import_react84.HugeiconsIcon, { icon: import_core_free_icons30.ListSettingIcon, size: 16 })
|
|
5324
|
-
))), /* @__PURE__ */ import_react83.default.createElement("div", { className: "flex flex-col gap-8 p-6 rounded-2xl bg-white w-full" }, activeExpandedMember ? /* @__PURE__ */ import_react83.default.createElement("div", { className: "flex flex-col animate-in fade-in zoom-in-95 duration-300 w-full" }, /* @__PURE__ */ import_react83.default.createElement("div", { className: "flex flex-col gap-1 mb-8" }, /* @__PURE__ */ import_react83.default.createElement("h2", { className: "text-black text-xl tracking-tight" }, "Member Profile"), /* @__PURE__ */ import_react83.default.createElement("p", { className: "text-[12px] text-neutral-500" }, "View and manage this member's access privileges.")), /* @__PURE__ */ import_react83.default.createElement("div", { className: "flex items-center gap-4 mb-8" }, /* @__PURE__ */ import_react83.default.createElement(MemberAvatar2, { src: activeExpandedMember.avatarUrl, status: activeExpandedMember.status, sizeClass: "w-14 h-14" }), /* @__PURE__ */ import_react83.default.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ import_react83.default.createElement("span", { className: "text-sm text-black tracking-tight truncate" }, activeExpandedMember.name), /* @__PURE__ */ import_react83.default.createElement("span", { className: "text-[12px] text-neutral-500 capitalize" }, activeExpandedMember.role.toLowerCase()))), activeExpandedMember.departmentName && /* @__PURE__ */ import_react83.default.createElement("div", { className: "mb-8" }, /* @__PURE__ */ import_react83.default.createElement("span", { className: "text-[11px] tracking-[0.2em] text-neutral-400 block mb-1" }, "Assigned Department"), /* @__PURE__ */ import_react83.default.createElement("span", { className: "text-[12px] text-black truncate block" }, activeExpandedMember.departmentName)), /* @__PURE__ */ import_react83.default.createElement("div", { className: "flex flex-col sm:flex-row gap-3 pt-6
|
|
5361
|
+
))), /* @__PURE__ */ import_react83.default.createElement("div", { className: "flex flex-col gap-8 p-6 rounded-2xl bg-white w-full" }, activeExpandedMember ? /* @__PURE__ */ import_react83.default.createElement("div", { className: "flex flex-col animate-in fade-in zoom-in-95 duration-300 w-full" }, /* @__PURE__ */ import_react83.default.createElement("div", { className: "flex flex-col gap-1 mb-8" }, /* @__PURE__ */ import_react83.default.createElement("h2", { className: "text-black text-xl tracking-tight" }, "Member Profile"), /* @__PURE__ */ import_react83.default.createElement("p", { className: "text-[12px] text-neutral-500" }, "View and manage this member's access privileges.")), /* @__PURE__ */ import_react83.default.createElement("div", { className: "flex items-center gap-4 mb-8" }, /* @__PURE__ */ import_react83.default.createElement(MemberAvatar2, { src: activeExpandedMember.avatarUrl, status: activeExpandedMember.status, sizeClass: "w-14 h-14" }), /* @__PURE__ */ import_react83.default.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ import_react83.default.createElement("span", { className: "text-sm text-black tracking-tight truncate" }, activeExpandedMember.name), /* @__PURE__ */ import_react83.default.createElement("span", { className: "text-[12px] text-neutral-500 capitalize" }, activeExpandedMember.role.toLowerCase()))), activeExpandedMember.departmentName && /* @__PURE__ */ import_react83.default.createElement("div", { className: "mb-8" }, /* @__PURE__ */ import_react83.default.createElement("span", { className: "text-[11px] tracking-[0.2em] text-neutral-400 block mb-1" }, "Assigned Department"), /* @__PURE__ */ import_react83.default.createElement("span", { className: "text-[12px] text-black truncate block" }, activeExpandedMember.departmentName)), /* @__PURE__ */ import_react83.default.createElement("div", { className: "flex flex-col sm:flex-row gap-3 pt-6" }, !isAccountReadOnly && /* @__PURE__ */ import_react83.default.createElement(
|
|
5325
5362
|
"button",
|
|
5326
5363
|
{
|
|
5327
5364
|
onClick: () => setMemberToRemove(activeExpandedMember),
|
|
@@ -5433,7 +5470,7 @@ var UniversalSettings = ({
|
|
|
5433
5470
|
placeholder: "Sovereign User",
|
|
5434
5471
|
maxLength: 50
|
|
5435
5472
|
}
|
|
5436
|
-
), /* @__PURE__ */ import_react83.default.createElement("div", { className: "space-y-1.5 relative w-full" }, /* @__PURE__ */ import_react83.default.createElement("label", { className: "text-[11px] text-neutral-400 tracking-[0.2em] block" }, "Workspace Handle"), /* @__PURE__ */ import_react83.default.createElement("div", { className: "flex items-center relative w-full border-b border-neutral-200 focus-within:border-black transition-all duration-300 overflow-hidden" }, /* @__PURE__ */ import_react83.default.createElement(
|
|
5473
|
+
), accountType === "ORGANIZATION" && /* @__PURE__ */ import_react83.default.createElement("div", { className: "space-y-1.5 relative w-full" }, /* @__PURE__ */ import_react83.default.createElement("label", { className: "text-[11px] text-neutral-400 tracking-[0.2em] block" }, "Workspace Handle"), /* @__PURE__ */ import_react83.default.createElement("div", { className: "flex items-center relative w-full border-b border-neutral-200 focus-within:border-black transition-all duration-300 overflow-hidden" }, /* @__PURE__ */ import_react83.default.createElement(
|
|
5437
5474
|
"input",
|
|
5438
5475
|
{
|
|
5439
5476
|
type: "text",
|
package/dist/index.mjs
CHANGED
|
@@ -4914,7 +4914,8 @@ import {
|
|
|
4914
4914
|
ArrowRight01Icon as ArrowRight01Icon11,
|
|
4915
4915
|
CancelCircleIcon as CancelCircleIcon10,
|
|
4916
4916
|
ArrowUpRight01Icon as ArrowUpRight01Icon3,
|
|
4917
|
-
Settings03Icon
|
|
4917
|
+
Settings03Icon,
|
|
4918
|
+
Logout01Icon
|
|
4918
4919
|
} from "@hugeicons/core-free-icons";
|
|
4919
4920
|
var UniversalHome2 = ({
|
|
4920
4921
|
avatarSrc,
|
|
@@ -4934,13 +4935,16 @@ var UniversalHome2 = ({
|
|
|
4934
4935
|
onResolveInvite,
|
|
4935
4936
|
formatNotifDate,
|
|
4936
4937
|
customContent,
|
|
4937
|
-
departmentsProps
|
|
4938
|
+
departmentsProps,
|
|
4939
|
+
onLogout
|
|
4938
4940
|
}) => {
|
|
4939
4941
|
const [isAvatarLoaded, setIsAvatarLoaded] = useState34(false);
|
|
4940
4942
|
const [showNotifDialog, setShowNotifDialog] = useState34(false);
|
|
4941
4943
|
const [showOrgSwitcher, setShowOrgSwitcher] = useState34(false);
|
|
4942
4944
|
const [selectedNotif, setSelectedNotif] = useState34(null);
|
|
4943
4945
|
const [isResolving, setIsResolving] = useState34(false);
|
|
4946
|
+
const [showLogoutConfirm, setShowLogoutConfirm] = useState34(false);
|
|
4947
|
+
const [isLoggingOut, setIsLoggingOut] = useState34(false);
|
|
4944
4948
|
const router = useRouter3();
|
|
4945
4949
|
const fallbackAvatarUrl = "https://storage.googleapis.com/retina-cloud-v2/assets/images/avatar.avif";
|
|
4946
4950
|
const finalAvatarSrc = avatarSrc || fallbackAvatarUrl;
|
|
@@ -4972,7 +4976,31 @@ var UniversalHome2 = ({
|
|
|
4972
4976
|
setIsResolving(false);
|
|
4973
4977
|
}
|
|
4974
4978
|
};
|
|
4975
|
-
|
|
4979
|
+
const confirmLogout = async () => {
|
|
4980
|
+
setIsLoggingOut(true);
|
|
4981
|
+
try {
|
|
4982
|
+
if (onLogout) await onLogout();
|
|
4983
|
+
} catch (e) {
|
|
4984
|
+
toast14.error("Failed to log out cleanly.");
|
|
4985
|
+
} finally {
|
|
4986
|
+
setIsLoggingOut(false);
|
|
4987
|
+
setShowLogoutConfirm(false);
|
|
4988
|
+
}
|
|
4989
|
+
};
|
|
4990
|
+
return /* @__PURE__ */ React48.createElement("div", { className: "w-full max-w-3xl mx-auto flex flex-col animate-in fade-in duration-300 relative" }, /* @__PURE__ */ React48.createElement(
|
|
4991
|
+
ConfirmationDialog,
|
|
4992
|
+
{
|
|
4993
|
+
isOpen: showLogoutConfirm,
|
|
4994
|
+
title: "Log Out",
|
|
4995
|
+
message: "Are you sure you want to log out of TruHuddle?",
|
|
4996
|
+
confirmText: "Log Out",
|
|
4997
|
+
cancelText: "Cancel",
|
|
4998
|
+
isProcessing: isLoggingOut,
|
|
4999
|
+
isDestructive: true,
|
|
5000
|
+
onClose: () => setShowLogoutConfirm(false),
|
|
5001
|
+
onConfirm: confirmLogout
|
|
5002
|
+
}
|
|
5003
|
+
), /* @__PURE__ */ React48.createElement("div", { className: "flex items-center justify-between w-full pb-4" }, /* @__PURE__ */ React48.createElement("div", { className: "w-10 h-10 shrink-0 cursor-pointer", onClick: () => setShowOrgSwitcher(true) }, /* @__PURE__ */ React48.createElement("div", { className: "relative w-full h-full rounded-lg overflow-hidden bg-white flex items-center justify-center" }, !isAvatarLoaded && /* @__PURE__ */ React48.createElement("div", { className: "absolute inset-0 flex items-center justify-center z-10 bg-white" }, /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: Loading03Icon22, size: 16, className: "animate-spin text-black" })), /* @__PURE__ */ React48.createElement(
|
|
4976
5004
|
"img",
|
|
4977
5005
|
{
|
|
4978
5006
|
src: finalAvatarSrc,
|
|
@@ -4980,7 +5008,7 @@ var UniversalHome2 = ({
|
|
|
4980
5008
|
onLoad: () => setIsAvatarLoaded(true),
|
|
4981
5009
|
className: `w-full h-full object-cover transition-opacity duration-300 ${isAvatarLoaded ? "opacity-100" : "opacity-0"}`
|
|
4982
5010
|
}
|
|
4983
|
-
))), /* @__PURE__ */ React48.createElement("div", { className: "flex items-center gap-2 shrink-0" }, /* @__PURE__ */ React48.createElement(
|
|
5011
|
+
))), /* @__PURE__ */ React48.createElement("div", { className: "flex-1 h-10 bg-black rounded-full mx-3 flex items-center justify-between px-4" }, /* @__PURE__ */ React48.createElement("div", { className: "flex items-center gap-3" }, barIcons.map((item, idx) => /* @__PURE__ */ React48.createElement("button", { key: idx, onClick: item.onClick, className: "outline-none hover:opacity-70 transition-opacity flex items-center justify-center" }, /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: item.icon, size: 16, color: item.color || "white" })))), /* @__PURE__ */ React48.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React48.createElement("span", { className: "text-white text-[11px] tracking-widest" }, getDisplayStatus()), /* @__PURE__ */ React48.createElement("div", { className: `w-2 h-2 rounded-full ${getStatusColor()}` }))), /* @__PURE__ */ React48.createElement("div", { className: "flex items-center gap-2 shrink-0" }, /* @__PURE__ */ React48.createElement(
|
|
4984
5012
|
"button",
|
|
4985
5013
|
{
|
|
4986
5014
|
onClick: () => router.push("/app/settings"),
|
|
@@ -5033,7 +5061,7 @@ var UniversalHome2 = ({
|
|
|
5033
5061
|
{
|
|
5034
5062
|
...departmentsProps
|
|
5035
5063
|
}
|
|
5036
|
-
)), showOrgSwitcher && /* @__PURE__ */ React48.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React48.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowOrgSwitcher(false) }), /* @__PURE__ */ React48.createElement("div", { className: "relative w-full max-w-sm bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 h-auto max-h-[80vh]" }, /* @__PURE__ */ React48.createElement("div", { className: "flex items-center justify-between p-5 shrink-0
|
|
5064
|
+
)), showOrgSwitcher && /* @__PURE__ */ React48.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React48.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowOrgSwitcher(false) }), /* @__PURE__ */ React48.createElement("div", { className: "relative w-full max-w-sm bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 h-auto max-h-[80vh]" }, /* @__PURE__ */ React48.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, /* @__PURE__ */ React48.createElement("h3", { className: "text-[15px] text-black tracking-tight" }, "Switch Workspace"), /* @__PURE__ */ React48.createElement("button", { onClick: () => setShowOrgSwitcher(false), className: "text-neutral-400 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: CancelCircleIcon10, size: 18 }))), /* @__PURE__ */ React48.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-2" }, /* @__PURE__ */ React48.createElement("div", { className: "flex flex-col" }, organizations?.length === 0 ? /* @__PURE__ */ React48.createElement("div", { className: "p-8 text-center text-xs text-neutral-400" }, "No organizations found.") : organizations?.map((org) => /* @__PURE__ */ React48.createElement(
|
|
5037
5065
|
"button",
|
|
5038
5066
|
{
|
|
5039
5067
|
key: org.id,
|
|
@@ -5041,16 +5069,27 @@ var UniversalHome2 = ({
|
|
|
5041
5069
|
onOrganizationSelect?.(org.id);
|
|
5042
5070
|
setShowOrgSwitcher(false);
|
|
5043
5071
|
},
|
|
5044
|
-
className: `p-4 flex items-center justify-between gap-3 cursor-pointer outline-none transition-colors last:border-0 ${activeOrgId === org.id ? "bg-neutral-50" : "hover:bg-neutral-50/50"}`
|
|
5072
|
+
className: `p-4 flex items-center justify-between gap-3 cursor-pointer outline-none transition-colors border-b border-neutral-50 last:border-0 ${activeOrgId === org.id ? "bg-neutral-50" : "hover:bg-neutral-50/50"}`
|
|
5045
5073
|
},
|
|
5046
|
-
/* @__PURE__ */ React48.createElement("span", { className: `text-[13px] tracking-tight ${activeOrgId === org.id ? "text-black
|
|
5074
|
+
/* @__PURE__ */ React48.createElement("span", { className: `text-[13px] tracking-tight ${activeOrgId === org.id ? "text-black" : "text-neutral-600"}` }, org.name),
|
|
5047
5075
|
activeOrgId === org.id && /* @__PURE__ */ React48.createElement("div", { className: "w-2 h-2 rounded-full bg-emerald-500" })
|
|
5048
|
-
))))
|
|
5076
|
+
)))), /* @__PURE__ */ React48.createElement("div", { className: "p-4 0 shrink-0" }, /* @__PURE__ */ React48.createElement(
|
|
5077
|
+
"button",
|
|
5078
|
+
{
|
|
5079
|
+
onClick: () => {
|
|
5080
|
+
setShowOrgSwitcher(false);
|
|
5081
|
+
setShowLogoutConfirm(true);
|
|
5082
|
+
},
|
|
5083
|
+
className: "w-full py-3 flex items-center justify-center gap-2 rounded-full bg-rose-50 text-rose-600 hover:bg-rose-100 transition-colors outline-none text-[13px] tracking-wide"
|
|
5084
|
+
},
|
|
5085
|
+
/* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: Logout01Icon, size: 16 }),
|
|
5086
|
+
"Log Out"
|
|
5087
|
+
)))), showNotifDialog && /* @__PURE__ */ React48.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React48.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowNotifDialog(false) }), /* @__PURE__ */ React48.createElement("div", { className: "relative w-full max-w-sm bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 h-[80vh]" }, /* @__PURE__ */ React48.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, selectedNotif ? /* @__PURE__ */ React48.createElement("button", { onClick: () => setSelectedNotif(null), disabled: isResolving, className: "text-neutral-400 hover:text-black transition-colors outline-none flex items-center gap-2 text-[11px] tracking-widest disabled:opacity-50" }, /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: ArrowLeft01Icon15, size: 14 }), " Back") : /* @__PURE__ */ React48.createElement("h3", { className: "text-[15px] text-black tracking-tight flex items-center gap-2" }, "Notifications", isNotifsLoading && /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: Loading03Icon22, size: 14, className: "animate-spin text-neutral-400" })), /* @__PURE__ */ React48.createElement("button", { onClick: () => setShowNotifDialog(false), disabled: isResolving, className: "text-neutral-400 hover:text-black transition-colors outline-none disabled:opacity-50" }, /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: CancelCircleIcon10, size: 18 }))), /* @__PURE__ */ React48.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-2" }, selectedNotif ? /* @__PURE__ */ React48.createElement("div", { className: "p-4 text-left" }, /* @__PURE__ */ React48.createElement("h4", { className: "text-[14px] text-black mb-1" }, selectedNotif.title), /* @__PURE__ */ React48.createElement("span", { className: "text-[10px] text-neutral-400 tracking-widest mb-4 block" }, formatNotifDate(selectedNotif.createdAt)), /* @__PURE__ */ React48.createElement("p", { className: "text-[12px] text-neutral-600 leading-relaxed whitespace-pre-wrap" }, selectedNotif.message), selectedNotif.type === "HUDDLE_INVITE" && selectedNotif.meta_json?.action === "RESOLVE_INVITE" && /* @__PURE__ */ React48.createElement("div", { className: "mt-8 flex gap-3 pt-6 border-t border-neutral-100" }, /* @__PURE__ */ React48.createElement(
|
|
5049
5088
|
"button",
|
|
5050
5089
|
{
|
|
5051
5090
|
onClick: () => handleResolve("ACCEPTED"),
|
|
5052
5091
|
disabled: isResolving,
|
|
5053
|
-
className: "flex-1 py-
|
|
5092
|
+
className: "flex-1 py-2.5 rounded-full bg-black text-white text-[12px] tracking-wide transition-all outline-none hover:bg-neutral-800 flex justify-center items-center disabled:opacity-50"
|
|
5054
5093
|
},
|
|
5055
5094
|
isResolving ? /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: Loading03Icon22, className: "animate-spin", size: 16 }) : "Accept"
|
|
5056
5095
|
), /* @__PURE__ */ React48.createElement(
|
|
@@ -5058,7 +5097,7 @@ var UniversalHome2 = ({
|
|
|
5058
5097
|
{
|
|
5059
5098
|
onClick: () => handleResolve("REJECTED"),
|
|
5060
5099
|
disabled: isResolving,
|
|
5061
|
-
className: "flex-1 py-
|
|
5100
|
+
className: "flex-1 py-2.5 rounded-full bg-white border border-neutral-200 text-black text-[12px] tracking-wide transition-all outline-none hover:bg-neutral-50 flex justify-center items-center disabled:opacity-50"
|
|
5062
5101
|
},
|
|
5063
5102
|
"Reject"
|
|
5064
5103
|
))) : /* @__PURE__ */ React48.createElement("div", { className: "flex flex-col divide-y divide-neutral-50/50" }, notifications?.length === 0 && !isNotifsLoading ? /* @__PURE__ */ React48.createElement("div", { className: "p-8 text-center text-xs text-neutral-400" }, "You have no notifications.") : notifications?.map((notif) => /* @__PURE__ */ React48.createElement(
|
|
@@ -5160,7 +5199,6 @@ var UniversalSettings = ({
|
|
|
5160
5199
|
onInviteMember,
|
|
5161
5200
|
initialDisplayName,
|
|
5162
5201
|
initialSlug,
|
|
5163
|
-
slugPrefixUrl = "https://truhuddle.com/company/",
|
|
5164
5202
|
onSaveAccount,
|
|
5165
5203
|
onCheckSlugAvailability,
|
|
5166
5204
|
aiCredits,
|
|
@@ -5363,7 +5401,7 @@ var UniversalSettings = ({
|
|
|
5363
5401
|
className: "flex items-center justify-center bg-white w-9 h-9 rounded-full text-neutral-500 hover:text-black transition-colors outline-none"
|
|
5364
5402
|
},
|
|
5365
5403
|
/* @__PURE__ */ React49.createElement(HugeiconsIcon35, { icon: ListSettingIcon3, size: 16 })
|
|
5366
|
-
))), /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col gap-8 p-6 rounded-2xl bg-white w-full" }, activeExpandedMember ? /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col animate-in fade-in zoom-in-95 duration-300 w-full" }, /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col gap-1 mb-8" }, /* @__PURE__ */ React49.createElement("h2", { className: "text-black text-xl tracking-tight" }, "Member Profile"), /* @__PURE__ */ React49.createElement("p", { className: "text-[12px] text-neutral-500" }, "View and manage this member's access privileges.")), /* @__PURE__ */ React49.createElement("div", { className: "flex items-center gap-4 mb-8" }, /* @__PURE__ */ React49.createElement(MemberAvatar2, { src: activeExpandedMember.avatarUrl, status: activeExpandedMember.status, sizeClass: "w-14 h-14" }), /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ React49.createElement("span", { className: "text-sm text-black tracking-tight truncate" }, activeExpandedMember.name), /* @__PURE__ */ React49.createElement("span", { className: "text-[12px] text-neutral-500 capitalize" }, activeExpandedMember.role.toLowerCase()))), activeExpandedMember.departmentName && /* @__PURE__ */ React49.createElement("div", { className: "mb-8" }, /* @__PURE__ */ React49.createElement("span", { className: "text-[11px] tracking-[0.2em] text-neutral-400 block mb-1" }, "Assigned Department"), /* @__PURE__ */ React49.createElement("span", { className: "text-[12px] text-black truncate block" }, activeExpandedMember.departmentName)), /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col sm:flex-row gap-3 pt-6
|
|
5404
|
+
))), /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col gap-8 p-6 rounded-2xl bg-white w-full" }, activeExpandedMember ? /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col animate-in fade-in zoom-in-95 duration-300 w-full" }, /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col gap-1 mb-8" }, /* @__PURE__ */ React49.createElement("h2", { className: "text-black text-xl tracking-tight" }, "Member Profile"), /* @__PURE__ */ React49.createElement("p", { className: "text-[12px] text-neutral-500" }, "View and manage this member's access privileges.")), /* @__PURE__ */ React49.createElement("div", { className: "flex items-center gap-4 mb-8" }, /* @__PURE__ */ React49.createElement(MemberAvatar2, { src: activeExpandedMember.avatarUrl, status: activeExpandedMember.status, sizeClass: "w-14 h-14" }), /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ React49.createElement("span", { className: "text-sm text-black tracking-tight truncate" }, activeExpandedMember.name), /* @__PURE__ */ React49.createElement("span", { className: "text-[12px] text-neutral-500 capitalize" }, activeExpandedMember.role.toLowerCase()))), activeExpandedMember.departmentName && /* @__PURE__ */ React49.createElement("div", { className: "mb-8" }, /* @__PURE__ */ React49.createElement("span", { className: "text-[11px] tracking-[0.2em] text-neutral-400 block mb-1" }, "Assigned Department"), /* @__PURE__ */ React49.createElement("span", { className: "text-[12px] text-black truncate block" }, activeExpandedMember.departmentName)), /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col sm:flex-row gap-3 pt-6" }, !isAccountReadOnly && /* @__PURE__ */ React49.createElement(
|
|
5367
5405
|
"button",
|
|
5368
5406
|
{
|
|
5369
5407
|
onClick: () => setMemberToRemove(activeExpandedMember),
|
|
@@ -5475,7 +5513,7 @@ var UniversalSettings = ({
|
|
|
5475
5513
|
placeholder: "Sovereign User",
|
|
5476
5514
|
maxLength: 50
|
|
5477
5515
|
}
|
|
5478
|
-
), /* @__PURE__ */ React49.createElement("div", { className: "space-y-1.5 relative w-full" }, /* @__PURE__ */ React49.createElement("label", { className: "text-[11px] text-neutral-400 tracking-[0.2em] block" }, "Workspace Handle"), /* @__PURE__ */ React49.createElement("div", { className: "flex items-center relative w-full border-b border-neutral-200 focus-within:border-black transition-all duration-300 overflow-hidden" }, /* @__PURE__ */ React49.createElement(
|
|
5516
|
+
), accountType === "ORGANIZATION" && /* @__PURE__ */ React49.createElement("div", { className: "space-y-1.5 relative w-full" }, /* @__PURE__ */ React49.createElement("label", { className: "text-[11px] text-neutral-400 tracking-[0.2em] block" }, "Workspace Handle"), /* @__PURE__ */ React49.createElement("div", { className: "flex items-center relative w-full border-b border-neutral-200 focus-within:border-black transition-all duration-300 overflow-hidden" }, /* @__PURE__ */ React49.createElement(
|
|
5479
5517
|
"input",
|
|
5480
5518
|
{
|
|
5481
5519
|
type: "text",
|