@retinalabsllc/zairusjs 21.2.2 → 21.2.3
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 +9 -4
- package/dist/index.d.ts +9 -4
- package/dist/index.js +160 -131
- package/dist/index.mjs +189 -164
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -606,7 +606,7 @@ var ReusableOptions = ({
|
|
|
606
606
|
const filteredOptions = options.filter(
|
|
607
607
|
(opt) => opt.toLowerCase().includes(searchQuery.toLowerCase())
|
|
608
608
|
);
|
|
609
|
-
return /* @__PURE__ */ React8.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React8.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: onClose }), /* @__PURE__ */ React8.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 max-h-[80vh]" }, /* @__PURE__ */ React8.createElement("div", { className: "flex items-center justify-between p-5 shrink-0
|
|
609
|
+
return /* @__PURE__ */ React8.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React8.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: onClose }), /* @__PURE__ */ React8.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 max-h-[80vh]" }, /* @__PURE__ */ React8.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, /* @__PURE__ */ React8.createElement("h3", { className: "text-lg text-black tracking-tight" }, title), /* @__PURE__ */ React8.createElement("button", { onClick: onClose, className: "text-stone-400 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ React8.createElement(HugeiconsIcon4, { icon: CancelCircleIcon, size: 18 }))), showSearch && /* @__PURE__ */ React8.createElement("div", { className: "p-4 shrink-0" }, /* @__PURE__ */ React8.createElement("div", { className: "relative w-full" }, /* @__PURE__ */ React8.createElement("div", { className: "absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none" }, /* @__PURE__ */ React8.createElement(HugeiconsIcon4, { icon: Search01Icon, size: 16, className: "text-stone-400" })), /* @__PURE__ */ React8.createElement(
|
|
610
610
|
"input",
|
|
611
611
|
{
|
|
612
612
|
type: "text",
|
|
@@ -621,15 +621,19 @@ var ReusableOptions = ({
|
|
|
621
621
|
"button",
|
|
622
622
|
{
|
|
623
623
|
key: opt,
|
|
624
|
-
onClick: () =>
|
|
625
|
-
onSelect(opt);
|
|
626
|
-
onClose();
|
|
627
|
-
},
|
|
624
|
+
onClick: () => onSelect(opt),
|
|
628
625
|
className: `w-full text-left p-4 text-xs tracking-tight rounded-full transition-colors outline-none ${isSelected ? "text-[#d97757] bg-[#d97757]/10" : "text-stone-600 hover:bg-stone-50/50"}`
|
|
629
626
|
},
|
|
630
627
|
opt.charAt(0).toUpperCase() + opt.slice(1).toLowerCase()
|
|
631
628
|
);
|
|
632
|
-
}))
|
|
629
|
+
})), /* @__PURE__ */ React8.createElement("div", { className: "p-4 flex items-center justify-end shrink-0 bg-white " }, /* @__PURE__ */ React8.createElement(
|
|
630
|
+
"button",
|
|
631
|
+
{
|
|
632
|
+
onClick: onClose,
|
|
633
|
+
className: "text-[#d97757] outline-none text-sm tracking-wide hover:opacity-80 transition-opacity"
|
|
634
|
+
},
|
|
635
|
+
"Done"
|
|
636
|
+
))));
|
|
633
637
|
};
|
|
634
638
|
|
|
635
639
|
// src/components/CalendarPicker.tsx
|
|
@@ -6473,9 +6477,31 @@ import {
|
|
|
6473
6477
|
ArrowRight01Icon as ArrowRight01Icon17,
|
|
6474
6478
|
CancelCircleIcon as CancelCircleIcon14,
|
|
6475
6479
|
ArrowUpRight01Icon as ArrowUpRight01Icon4,
|
|
6476
|
-
Robot01Icon as Robot01Icon2
|
|
6480
|
+
Robot01Icon as Robot01Icon2,
|
|
6481
|
+
Logout01Icon as Logout01Icon2
|
|
6477
6482
|
} from "@hugeicons/core-free-icons";
|
|
6483
|
+
var OrgAvatar3 = ({ src, sizeClass = "w-10 h-10" }) => {
|
|
6484
|
+
const [loaded, setLoaded] = useState40(false);
|
|
6485
|
+
const [error, setError] = useState40(false);
|
|
6486
|
+
const defaultAvatar = "https://storage.googleapis.com/retina-cloud-v2/assets/images/office_a.avif";
|
|
6487
|
+
const finalSrc = error || !src ? defaultAvatar : src;
|
|
6488
|
+
return /* @__PURE__ */ React56.createElement("div", { className: `relative shrink-0 ${sizeClass}` }, /* @__PURE__ */ React56.createElement("div", { className: "w-full h-full rounded-lg bg-stone-100 flex items-center justify-center overflow-hidden" }, !loaded && !error && /* @__PURE__ */ React56.createElement(HugeiconsIcon42, { icon: Loading03Icon30, className: "animate-spin text-stone-400 absolute", size: 14 }), /* @__PURE__ */ React56.createElement(
|
|
6489
|
+
"img",
|
|
6490
|
+
{
|
|
6491
|
+
src: finalSrc,
|
|
6492
|
+
alt: "Workspace Avatar",
|
|
6493
|
+
className: `w-full h-full object-cover transition-opacity duration-300 ${loaded || error ? "opacity-100" : "opacity-0"}`,
|
|
6494
|
+
onLoad: () => setLoaded(true),
|
|
6495
|
+
onError: () => setError(true)
|
|
6496
|
+
}
|
|
6497
|
+
)));
|
|
6498
|
+
};
|
|
6478
6499
|
var UniversalHome3 = ({
|
|
6500
|
+
avatarSrc,
|
|
6501
|
+
organizations = [],
|
|
6502
|
+
activeOrgId,
|
|
6503
|
+
onOrganizationSelect,
|
|
6504
|
+
onLogout,
|
|
6479
6505
|
createApplicationAction,
|
|
6480
6506
|
checkApplicationAction,
|
|
6481
6507
|
notifications = [],
|
|
@@ -6489,10 +6515,16 @@ var UniversalHome3 = ({
|
|
|
6489
6515
|
customContent,
|
|
6490
6516
|
applicationsProps
|
|
6491
6517
|
}) => {
|
|
6518
|
+
const [isAvatarLoaded, setIsAvatarLoaded] = useState40(false);
|
|
6519
|
+
const [showOrgSwitcher, setShowOrgSwitcher] = useState40(false);
|
|
6492
6520
|
const [showNotifDialog, setShowNotifDialog] = useState40(false);
|
|
6493
6521
|
const [selectedNotif, setSelectedNotif] = useState40(null);
|
|
6494
6522
|
const [isResolving, setIsResolving] = useState40(false);
|
|
6523
|
+
const [showLogoutConfirm, setShowLogoutConfirm] = useState40(false);
|
|
6524
|
+
const [isLoggingOut, setIsLoggingOut] = useState40(false);
|
|
6495
6525
|
const router = useRouter5();
|
|
6526
|
+
const fallbackAvatarUrl = "https://storage.googleapis.com/retina-cloud-v2/assets/images/avatar.avif";
|
|
6527
|
+
const finalAvatarSrc = avatarSrc || fallbackAvatarUrl;
|
|
6496
6528
|
const hasUnreadNotifs = notifications.some((n) => !n.isRead);
|
|
6497
6529
|
const handleResolve = async (resolution) => {
|
|
6498
6530
|
if (!onResolveInvite || !selectedNotif) return;
|
|
@@ -6505,7 +6537,39 @@ var UniversalHome3 = ({
|
|
|
6505
6537
|
setIsResolving(false);
|
|
6506
6538
|
}
|
|
6507
6539
|
};
|
|
6508
|
-
|
|
6540
|
+
const confirmLogout = async () => {
|
|
6541
|
+
setIsLoggingOut(true);
|
|
6542
|
+
try {
|
|
6543
|
+
if (onLogout) await onLogout();
|
|
6544
|
+
} catch (e) {
|
|
6545
|
+
toast17.error("Failed to log out cleanly.");
|
|
6546
|
+
} finally {
|
|
6547
|
+
setIsLoggingOut(false);
|
|
6548
|
+
setShowLogoutConfirm(false);
|
|
6549
|
+
}
|
|
6550
|
+
};
|
|
6551
|
+
return /* @__PURE__ */ React56.createElement("div", { className: "w-full max-w-4xl mx-auto flex flex-col animate-in fade-in duration-300 relative" }, /* @__PURE__ */ React56.createElement(
|
|
6552
|
+
ConfirmationDialog,
|
|
6553
|
+
{
|
|
6554
|
+
isOpen: showLogoutConfirm,
|
|
6555
|
+
title: "Log Out",
|
|
6556
|
+
message: "Are you sure you want to log out of your workspace?",
|
|
6557
|
+
confirmText: "Log Out",
|
|
6558
|
+
cancelText: "Cancel",
|
|
6559
|
+
isProcessing: isLoggingOut,
|
|
6560
|
+
isDestructive: true,
|
|
6561
|
+
onClose: () => setShowLogoutConfirm(false),
|
|
6562
|
+
onConfirm: confirmLogout
|
|
6563
|
+
}
|
|
6564
|
+
), /* @__PURE__ */ React56.createElement("div", { className: "flex items-center justify-between w-full pb-4" }, /* @__PURE__ */ React56.createElement("div", { className: "w-10 h-10 shrink-0 cursor-pointer", onClick: () => setShowOrgSwitcher(true) }, /* @__PURE__ */ React56.createElement("div", { className: "relative w-full h-full rounded-lg overflow-hidden bg-white flex items-center justify-center" }, !isAvatarLoaded && /* @__PURE__ */ React56.createElement("div", { className: "absolute inset-0 flex items-center justify-center z-10 bg-white" }, /* @__PURE__ */ React56.createElement(HugeiconsIcon42, { icon: Loading03Icon30, size: 16, className: "animate-spin text-black" })), /* @__PURE__ */ React56.createElement(
|
|
6565
|
+
"img",
|
|
6566
|
+
{
|
|
6567
|
+
src: finalAvatarSrc,
|
|
6568
|
+
alt: "User Avatar",
|
|
6569
|
+
onLoad: () => setIsAvatarLoaded(true),
|
|
6570
|
+
className: `w-full h-full object-cover transition-opacity duration-300 ${isAvatarLoaded ? "opacity-100" : "opacity-0"}`
|
|
6571
|
+
}
|
|
6572
|
+
))), /* @__PURE__ */ React56.createElement("div", { className: "flex items-center gap-2 shrink-0" }, /* @__PURE__ */ React56.createElement(
|
|
6509
6573
|
"button",
|
|
6510
6574
|
{
|
|
6511
6575
|
onClick: () => router.push("/app/ai"),
|
|
@@ -6558,7 +6622,31 @@ var UniversalHome3 = ({
|
|
|
6558
6622
|
{
|
|
6559
6623
|
...applicationsProps
|
|
6560
6624
|
}
|
|
6561
|
-
)),
|
|
6625
|
+
)), showOrgSwitcher && /* @__PURE__ */ React56.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React56.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowOrgSwitcher(false) }), /* @__PURE__ */ React56.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 max-h-[80vh] h-auto" }, /* @__PURE__ */ React56.createElement("div", { className: "flex items-center justify-between p-5 shrink-0 " }, /* @__PURE__ */ React56.createElement("h3", { className: "text-sm text-black tracking-tight" }, "Switch Workspace"), /* @__PURE__ */ React56.createElement("button", { onClick: () => setShowOrgSwitcher(false), className: "text-stone-400 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ React56.createElement(HugeiconsIcon42, { icon: CancelCircleIcon14, size: 18 }))), /* @__PURE__ */ React56.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-2" }, /* @__PURE__ */ React56.createElement("div", { className: "flex flex-col" }, organizations?.length === 0 ? /* @__PURE__ */ React56.createElement("div", { className: "p-8 text-center text-xs text-stone-400" }, "No organizations found.") : organizations?.map((org) => /* @__PURE__ */ React56.createElement(
|
|
6626
|
+
"button",
|
|
6627
|
+
{
|
|
6628
|
+
key: org.id,
|
|
6629
|
+
onClick: () => {
|
|
6630
|
+
onOrganizationSelect?.(org.id);
|
|
6631
|
+
setShowOrgSwitcher(false);
|
|
6632
|
+
},
|
|
6633
|
+
className: `p-4 flex items-center justify-between gap-3 cursor-pointer outline-none transition-colors border-b border-stone-50 last:border-0 ${activeOrgId === org.id ? "bg-stone-50" : "hover:bg-stone-50/50"}`
|
|
6634
|
+
},
|
|
6635
|
+
/* @__PURE__ */ React56.createElement(OrgAvatar3, { src: org.avatarUrl }),
|
|
6636
|
+
/* @__PURE__ */ React56.createElement("div", { className: "flex flex-col items-start min-w-0 flex-1" }, /* @__PURE__ */ React56.createElement("span", { className: `text-sm tracking-tight truncate w-full text-left ${activeOrgId === org.id ? "text-black " : "text-stone-600"}` }, org.name), /* @__PURE__ */ React56.createElement("span", { className: "text-xs text-stone-500 capitalize truncate w-full text-left mt-0.5" }, org.role?.toLowerCase() || "Member")),
|
|
6637
|
+
activeOrgId === org.id && /* @__PURE__ */ React56.createElement("div", { className: "w-2 h-2 rounded-full bg-[#d97757] shrink-0" })
|
|
6638
|
+
)))), /* @__PURE__ */ React56.createElement("div", { className: "p-4 shrink-0" }, /* @__PURE__ */ React56.createElement(
|
|
6639
|
+
"button",
|
|
6640
|
+
{
|
|
6641
|
+
onClick: () => {
|
|
6642
|
+
setShowOrgSwitcher(false);
|
|
6643
|
+
setShowLogoutConfirm(true);
|
|
6644
|
+
},
|
|
6645
|
+
className: "w-full py-2.5 flex items-center justify-center gap-2 rounded-full border border-stone-200 text-stone-600 hover:bg-stone-100 transition-colors outline-none text-xs tracking-wide"
|
|
6646
|
+
},
|
|
6647
|
+
/* @__PURE__ */ React56.createElement(HugeiconsIcon42, { icon: Logout01Icon2, size: 15 }),
|
|
6648
|
+
"Log Out"
|
|
6649
|
+
)))), showNotifDialog && /* @__PURE__ */ React56.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React56.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowNotifDialog(false) }), /* @__PURE__ */ React56.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 max-h-[80vh] h-auto" }, /* @__PURE__ */ React56.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, selectedNotif ? /* @__PURE__ */ React56.createElement("button", { onClick: () => setSelectedNotif(null), disabled: isResolving, className: "text-[#d97757] hover:text-[#d97757] transition-colors outline-none flex items-center gap-2 text-xs tracking-widest disabled:opacity-50" }, /* @__PURE__ */ React56.createElement(HugeiconsIcon42, { icon: ArrowLeft01Icon22, size: 14 }), " Back") : /* @__PURE__ */ React56.createElement("h3", { className: "text-sm text-black tracking-tight flex items-center gap-2" }, "Notifications"), /* @__PURE__ */ React56.createElement("button", { onClick: () => setShowNotifDialog(false), disabled: isResolving, className: "text-stone-400 hover:text-black transition-colors outline-none disabled:opacity-50" }, /* @__PURE__ */ React56.createElement(HugeiconsIcon42, { icon: CancelCircleIcon14, size: 18 }))), /* @__PURE__ */ React56.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-2 relative" }, isNotifsLoading && !selectedNotif && /* @__PURE__ */ React56.createElement("div", { className: "absolute inset-0 z-10 flex items-center justify-center" }, /* @__PURE__ */ React56.createElement(HugeiconsIcon42, { icon: Loading03Icon30, size: 28, className: "animate-spin text-black" })), selectedNotif ? /* @__PURE__ */ React56.createElement("div", { className: "p-4 text-left" }, selectedNotif.type === "HUDDLE_INVITE" && selectedNotif.meta_json?.action === "RESOLVE_INVITE" && selectedNotif.meta_json?.completed ? /* @__PURE__ */ React56.createElement("div", { className: "" }) : /* @__PURE__ */ React56.createElement("h4", { className: "text-sm text-black mb-1" }, selectedNotif.title), /* @__PURE__ */ React56.createElement("span", { className: "text-xs text-stone-400 tracking-widest mb-4 block" }, formatNotifDate(selectedNotif.createdAt)), /* @__PURE__ */ React56.createElement("p", { className: "text-xs text-stone-600 leading-relaxed whitespace-pre-wrap" }, selectedNotif.message), selectedNotif.type === "HUDDLE_INVITE" && selectedNotif.meta_json?.action === "RESOLVE_INVITE" && /* @__PURE__ */ React56.createElement("div", { className: `mt-8 flex gap-3 pt-6 ${selectedNotif.meta_json?.completed ? "opacity-40 pointer-events-none cursor-not-allowed" : ""}` }, /* @__PURE__ */ React56.createElement(
|
|
6562
6650
|
"button",
|
|
6563
6651
|
{
|
|
6564
6652
|
onClick: () => handleResolve("ACCEPTED"),
|
|
@@ -6606,47 +6694,24 @@ var UniversalHome3 = ({
|
|
|
6606
6694
|
};
|
|
6607
6695
|
|
|
6608
6696
|
// src/components/RootSidebar.tsx
|
|
6609
|
-
import React57, { useState as useState41
|
|
6697
|
+
import React57, { useState as useState41 } from "react";
|
|
6610
6698
|
import Link10 from "next/link";
|
|
6611
6699
|
import { HugeiconsIcon as HugeiconsIcon43 } from "@hugeicons/react";
|
|
6612
6700
|
import {
|
|
6613
|
-
|
|
6614
|
-
CancelCircleIcon as CancelCircleIcon15,
|
|
6615
|
-
UserIcon as UserIcon3,
|
|
6616
|
-
CheckmarkCircle01Icon as CheckmarkCircle01Icon2,
|
|
6617
|
-
LogoutCircle02Icon as LogoutCircle02Icon3,
|
|
6618
|
-
Loading03Icon as Loading03Icon31
|
|
6701
|
+
LogoutCircle02Icon as LogoutCircle02Icon3
|
|
6619
6702
|
} from "@hugeicons/core-free-icons";
|
|
6620
6703
|
function RootSidebar({
|
|
6621
6704
|
NavItem2s,
|
|
6622
6705
|
currentPath,
|
|
6623
|
-
isMobileOpen,
|
|
6624
|
-
closeMobile,
|
|
6625
|
-
openMobile,
|
|
6626
6706
|
onNavClick,
|
|
6627
|
-
avatarSrc,
|
|
6628
|
-
title = "App",
|
|
6629
|
-
subtitle,
|
|
6630
|
-
homeUrl = "/app",
|
|
6631
|
-
showWorkspaceSwitcher = false,
|
|
6632
|
-
workspaces = [],
|
|
6633
|
-
activeWorkspaceId,
|
|
6634
|
-
onSwitchWorkspace,
|
|
6635
6707
|
showLogoutAction = false,
|
|
6636
6708
|
onLogout
|
|
6637
6709
|
}) {
|
|
6638
|
-
const [isCollapsed, setIsCollapsed] = useState41(false);
|
|
6639
|
-
const [isAvatarLoaded, setIsAvatarLoaded] = useState41(false);
|
|
6640
|
-
const [showSwitcherDialog, setShowSwitcherDialog] = useState41(false);
|
|
6641
6710
|
const [showLogoutDialog, setShowLogoutDialog] = useState41(false);
|
|
6642
6711
|
const [isLoggingOut, setIsLoggingOut] = useState41(false);
|
|
6643
|
-
|
|
6644
|
-
if (isMobileOpen) {
|
|
6645
|
-
closeMobile();
|
|
6646
|
-
}
|
|
6647
|
-
}, [currentPath]);
|
|
6712
|
+
const [isSheetOpen, setIsSheetOpen] = useState41(false);
|
|
6648
6713
|
const hasActiveMatch = NavItem2s.some(
|
|
6649
|
-
(item) => item.path === "/
|
|
6714
|
+
(item) => item.path === "/" || item.path === "/app" ? currentPath === "/" || currentPath === "/app" : currentPath === item.path || currentPath?.startsWith(`${item.path}/`)
|
|
6650
6715
|
);
|
|
6651
6716
|
const handleLogoutInitiation = async () => {
|
|
6652
6717
|
if (isLoggingOut || !onLogout) return;
|
|
@@ -6658,152 +6723,113 @@ function RootSidebar({
|
|
|
6658
6723
|
setShowLogoutDialog(false);
|
|
6659
6724
|
}
|
|
6660
6725
|
};
|
|
6661
|
-
|
|
6662
|
-
|
|
6726
|
+
return /* @__PURE__ */ React57.createElement(React57.Fragment, null, /* @__PURE__ */ React57.createElement("aside", { className: "hidden md:flex fixed top-0 left-0 h-screen w-20 flex-col z-40 overflow-y-auto custom-scrollbar" }, /* @__PURE__ */ React57.createElement("div", { className: "h-24 shrink-0" }), /* @__PURE__ */ React57.createElement("nav", { className: "flex-1 flex flex-col gap-3 px-2" }, NavItem2s.map((item, index) => {
|
|
6727
|
+
const isExactOrSubMatch = item.path === "/" || item.path === "/app" ? currentPath === "/" || currentPath === "/app" : currentPath === item.path || currentPath?.startsWith(`${item.path}/`);
|
|
6728
|
+
const isCurrentRoute = isExactOrSubMatch || !hasActiveMatch && index === 0;
|
|
6729
|
+
return /* @__PURE__ */ React57.createElement(
|
|
6730
|
+
Link10,
|
|
6731
|
+
{
|
|
6732
|
+
key: item.name,
|
|
6733
|
+
href: item.path,
|
|
6734
|
+
onClick: (e) => onNavClick ? onNavClick(e, item.path) : void 0,
|
|
6735
|
+
className: `flex items-center justify-center w-12 h-12 mx-auto rounded-full transition-all outline-none group shrink-0 ${isCurrentRoute ? "bg-[#ffffff] text-[#d97757]" : "text-stone-500 hover:text-black hover:bg-white/50"}`,
|
|
6736
|
+
title: item.name
|
|
6737
|
+
},
|
|
6738
|
+
/* @__PURE__ */ React57.createElement(
|
|
6739
|
+
HugeiconsIcon43,
|
|
6740
|
+
{
|
|
6741
|
+
icon: item.icon,
|
|
6742
|
+
size: 20,
|
|
6743
|
+
className: `shrink-0 transition-colors ${isCurrentRoute ? "text-[#d97757]" : "text-stone-400 group-hover:text-black"}`
|
|
6744
|
+
}
|
|
6745
|
+
)
|
|
6746
|
+
);
|
|
6747
|
+
})), /* @__PURE__ */ React57.createElement("div", { className: "p-4 shrink-0 flex flex-col items-center gap-2 mb-4" }, showLogoutAction && /* @__PURE__ */ React57.createElement(
|
|
6663
6748
|
"button",
|
|
6664
6749
|
{
|
|
6665
|
-
onClick:
|
|
6666
|
-
className: "
|
|
6667
|
-
|
|
6750
|
+
onClick: () => setShowLogoutDialog(true),
|
|
6751
|
+
className: "w-12 h-12 rounded-full flex items-center justify-center text-stone-600 hover:bg-white/50 transition-all outline-none",
|
|
6752
|
+
title: "Log Out"
|
|
6668
6753
|
},
|
|
6669
|
-
/* @__PURE__ */ React57.createElement(
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6754
|
+
/* @__PURE__ */ React57.createElement(HugeiconsIcon43, { icon: LogoutCircle02Icon3, size: 20 })
|
|
6755
|
+
))), !isSheetOpen && /* @__PURE__ */ React57.createElement(
|
|
6756
|
+
"button",
|
|
6757
|
+
{
|
|
6758
|
+
onClick: () => setIsSheetOpen(true),
|
|
6759
|
+
className: "md:hidden fixed bottom-6 left-1/2 -translate-x-1/2 z-40 bg-black text-white px-8 py-3.5 rounded-2xl shadow-xl flex items-center justify-center text-sm tracking-wide outline-none active:scale-95 transition-transform"
|
|
6760
|
+
},
|
|
6761
|
+
"Open Menu"
|
|
6677
6762
|
), /* @__PURE__ */ React57.createElement(
|
|
6678
6763
|
"div",
|
|
6679
6764
|
{
|
|
6680
|
-
className: `fixed inset-0 bg-black/40
|
|
6681
|
-
onClick:
|
|
6765
|
+
className: `md:hidden fixed inset-0 bg-black/40 z-50 transition-opacity duration-300 ${isSheetOpen ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"}`,
|
|
6766
|
+
onClick: () => setIsSheetOpen(false)
|
|
6682
6767
|
}
|
|
6683
6768
|
), /* @__PURE__ */ React57.createElement(
|
|
6684
|
-
"
|
|
6769
|
+
"div",
|
|
6685
6770
|
{
|
|
6686
|
-
className: `
|
|
6687
|
-
fixed md:sticky top-0 left-0 h-dvh bg-[#212121]
|
|
6688
|
-
transition-all duration-300 ease-in-out shrink-0 flex flex-col z-100 md:z-10
|
|
6689
|
-
${isMobileOpen ? "translate-x-0" : "translate-x-[-120%] md:translate-x-0"}
|
|
6690
|
-
${isCollapsed ? "md:w-16 w-64" : "w-64"}
|
|
6691
|
-
`
|
|
6771
|
+
className: `md:hidden fixed bottom-0 left-0 right-0 bg-white rounded-t-3xl z-50 flex flex-col overflow-hidden transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] ${isSheetOpen ? "translate-y-0" : "translate-y-full"}`
|
|
6692
6772
|
},
|
|
6693
|
-
/* @__PURE__ */ React57.createElement("div", { className:
|
|
6694
|
-
|
|
6695
|
-
{
|
|
6696
|
-
src: finalAvatarSrc,
|
|
6697
|
-
alt: "User Avatar",
|
|
6698
|
-
onLoad: () => setIsAvatarLoaded(true),
|
|
6699
|
-
className: `w-full h-full object-cover transition-opacity duration-300 ${isAvatarLoaded ? "opacity-100" : "opacity-0"}`
|
|
6700
|
-
}
|
|
6701
|
-
)), (!isCollapsed || isMobileOpen) && /* @__PURE__ */ React57.createElement("div", { className: "flex flex-col justify-center min-w-0" }, /* @__PURE__ */ React57.createElement("span", { className: "text-[13px] font-serif text-white leading-none truncate max-w-32.5 tracking-wide mb-1 group-hover:opacity-80 transition-opacity" }, title), subtitle && /* @__PURE__ */ React57.createElement("span", { className: "text-[9px] text-neutral-400 truncate max-w-32.5 tracking-[0.2em] leading-none uppercase" }, subtitle))), (!isCollapsed || isMobileOpen) && /* @__PURE__ */ React57.createElement("div", { className: "md:hidden flex shrink-0" }, /* @__PURE__ */ React57.createElement(
|
|
6702
|
-
"button",
|
|
6703
|
-
{
|
|
6704
|
-
onClick: closeMobile,
|
|
6705
|
-
className: "text-neutral-400 hover:text-white transition-colors outline-none",
|
|
6706
|
-
"aria-label": "Close Menu"
|
|
6707
|
-
},
|
|
6708
|
-
/* @__PURE__ */ React57.createElement(HugeiconsIcon43, { icon: CancelCircleIcon15, size: 24 })
|
|
6709
|
-
))),
|
|
6710
|
-
/* @__PURE__ */ React57.createElement("nav", { className: "flex-1 py-2 flex flex-col gap-1.5 px-3 overflow-y-auto custom-scrollbar" }, NavItem2s.map((item, index) => {
|
|
6711
|
-
const isExactOrSubMatch = item.path === "/applications" || item.path === "/app" ? currentPath === item.path : currentPath === item.path || currentPath?.startsWith(`${item.path}/`);
|
|
6773
|
+
/* @__PURE__ */ React57.createElement("div", { className: "w-full flex justify-center py-4 shrink-0", onClick: () => setIsSheetOpen(false) }, /* @__PURE__ */ React57.createElement("div", { className: "w-12 h-1.5 bg-stone-200 rounded-full" })),
|
|
6774
|
+
/* @__PURE__ */ React57.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar px-4 pb-8 flex flex-col gap-2 max-h-[70vh]" }, NavItem2s.map((item, index) => {
|
|
6775
|
+
const isExactOrSubMatch = item.path === "/" || item.path === "/app" ? currentPath === "/" || currentPath === "/app" : currentPath === item.path || currentPath?.startsWith(`${item.path}/`);
|
|
6712
6776
|
const isCurrentRoute = isExactOrSubMatch || !hasActiveMatch && index === 0;
|
|
6713
6777
|
return /* @__PURE__ */ React57.createElement(
|
|
6714
6778
|
Link10,
|
|
6715
6779
|
{
|
|
6716
6780
|
key: item.name,
|
|
6717
6781
|
href: item.path,
|
|
6718
|
-
onClick: (e) =>
|
|
6719
|
-
|
|
6720
|
-
|
|
6782
|
+
onClick: (e) => {
|
|
6783
|
+
if (onNavClick) onNavClick(e, item.path);
|
|
6784
|
+
setIsSheetOpen(false);
|
|
6785
|
+
},
|
|
6786
|
+
className: `flex items-center gap-4 px-5 py-4 rounded-2xl transition-colors outline-none ${isCurrentRoute ? "bg-[#fff5f2] text-[#d97757]" : "text-stone-600 hover:bg-stone-50"}`
|
|
6721
6787
|
},
|
|
6722
6788
|
/* @__PURE__ */ React57.createElement(
|
|
6723
6789
|
HugeiconsIcon43,
|
|
6724
6790
|
{
|
|
6725
6791
|
icon: item.icon,
|
|
6726
|
-
size:
|
|
6727
|
-
className:
|
|
6792
|
+
size: 20,
|
|
6793
|
+
className: isCurrentRoute ? "text-[#d97757]" : "text-stone-400"
|
|
6728
6794
|
}
|
|
6729
6795
|
),
|
|
6730
|
-
|
|
6796
|
+
/* @__PURE__ */ React57.createElement("span", { className: "text-sm tracking-wide" }, item.name)
|
|
6731
6797
|
);
|
|
6732
|
-
})
|
|
6733
|
-
/* @__PURE__ */ React57.createElement("div", { className: "p-4 shrink-0 flex flex-col gap-2" }, (showWorkspaceSwitcher || showLogoutAction) && /* @__PURE__ */ React57.createElement("div", { className: `flex gap-2 px-1 pb-2 ${isCollapsed && !isMobileOpen ? "flex-col items-center" : "flex-row items-center"}` }, showWorkspaceSwitcher && workspaces && workspaces.length > 0 && /* @__PURE__ */ React57.createElement(
|
|
6734
|
-
"button",
|
|
6735
|
-
{
|
|
6736
|
-
onClick: () => setShowSwitcherDialog(true),
|
|
6737
|
-
className: "w-8 h-8 shrink-0 rounded-full bg-white/5 flex items-center justify-center text-neutral-400 hover:text-white hover:bg-white/10 transition-all outline-none",
|
|
6738
|
-
title: "Switch Workspace"
|
|
6739
|
-
},
|
|
6740
|
-
/* @__PURE__ */ React57.createElement(HugeiconsIcon43, { icon: UserIcon3, size: 16 })
|
|
6741
|
-
), showLogoutAction && /* @__PURE__ */ React57.createElement(
|
|
6742
|
-
"button",
|
|
6743
|
-
{
|
|
6744
|
-
onClick: () => setShowLogoutDialog(true),
|
|
6745
|
-
className: "w-8 h-8 shrink-0 rounded-full bg-white/5 flex items-center justify-center text-neutral-400 hover:text-white hover:bg-white/10 transition-all outline-none",
|
|
6746
|
-
title: "Secure Logout"
|
|
6747
|
-
},
|
|
6748
|
-
/* @__PURE__ */ React57.createElement(HugeiconsIcon43, { icon: LogoutCircle02Icon3, size: 16 })
|
|
6749
|
-
)), /* @__PURE__ */ React57.createElement("div", { className: "hidden md:block border-t border-white/5 pt-2" }, /* @__PURE__ */ React57.createElement(
|
|
6798
|
+
}), showLogoutAction && /* @__PURE__ */ React57.createElement("div", { className: "mt-2 pt-4 border-t border-stone-100" }, /* @__PURE__ */ React57.createElement(
|
|
6750
6799
|
"button",
|
|
6751
6800
|
{
|
|
6752
|
-
onClick: () =>
|
|
6753
|
-
|
|
6801
|
+
onClick: () => {
|
|
6802
|
+
setIsSheetOpen(false);
|
|
6803
|
+
setShowLogoutDialog(true);
|
|
6804
|
+
},
|
|
6805
|
+
className: "w-full flex items-center gap-4 px-5 py-4 rounded-2xl transition-colors outline-none text-red-600 hover:bg-red-50"
|
|
6754
6806
|
},
|
|
6755
|
-
/* @__PURE__ */ React57.createElement(HugeiconsIcon43, { icon:
|
|
6756
|
-
|
|
6807
|
+
/* @__PURE__ */ React57.createElement(HugeiconsIcon43, { icon: LogoutCircle02Icon3, size: 20, className: "text-red-500" }),
|
|
6808
|
+
/* @__PURE__ */ React57.createElement("span", { className: "text-sm tracking-wide" }, "Log Out")
|
|
6757
6809
|
)))
|
|
6758
|
-
),
|
|
6759
|
-
"div",
|
|
6760
|
-
{
|
|
6761
|
-
className: "absolute inset-0 bg-black/30",
|
|
6762
|
-
onClick: () => setShowSwitcherDialog(false)
|
|
6763
|
-
}
|
|
6764
|
-
), /* @__PURE__ */ React57.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" }, /* @__PURE__ */ React57.createElement("div", { className: "p-5 text-center w-full" }, /* @__PURE__ */ React57.createElement("h3", { className: " font-serif text-[17px] text-black tracking-tight mb-1" }, "Switch Workspace"), /* @__PURE__ */ React57.createElement("p", { className: "text-[11px] text-neutral-500 leading-snug" }, "Select an organization to switch your current context.")), /* @__PURE__ */ React57.createElement("div", { className: "max-h-75 overflow-y-auto w-full custom-scrollbar" }, workspaces.map((org) => /* @__PURE__ */ React57.createElement(
|
|
6765
|
-
"button",
|
|
6766
|
-
{
|
|
6767
|
-
key: org.id,
|
|
6768
|
-
onClick: () => {
|
|
6769
|
-
if (onSwitchWorkspace) onSwitchWorkspace(org.id);
|
|
6770
|
-
setShowSwitcherDialog(false);
|
|
6771
|
-
},
|
|
6772
|
-
className: "w-full text-left px-5 py-4 flex items-center justify-between hover:bg-neutral-50 transition-colors group outline-none last:border-0"
|
|
6773
|
-
},
|
|
6774
|
-
/* @__PURE__ */ React57.createElement("div", { className: "flex flex-col truncate pr-4" }, /* @__PURE__ */ React57.createElement("span", { className: `text-[13px] truncate ${activeWorkspaceId === org.id ? "text-black" : "text-neutral-600 group-hover:text-black"}` }, org.name), /* @__PURE__ */ React57.createElement("span", { className: "text-[9px] text-neutral-400 tracking-[0.2em] mt-1 uppercase" }, "Role: ", org.role)),
|
|
6775
|
-
activeWorkspaceId === org.id && /* @__PURE__ */ React57.createElement(HugeiconsIcon43, { icon: CheckmarkCircle01Icon2, size: 16, className: "text-black shrink-0" })
|
|
6776
|
-
))), /* @__PURE__ */ React57.createElement("div", { className: "w-full flex mt-auto" }, /* @__PURE__ */ React57.createElement(
|
|
6777
|
-
"button",
|
|
6778
|
-
{
|
|
6779
|
-
onClick: () => setShowSwitcherDialog(false),
|
|
6780
|
-
className: "w-full py-3.5 text-[13px] text-neutral-600 hover:bg-neutral-50 transition-colors outline-none"
|
|
6781
|
-
},
|
|
6782
|
-
"Cancel"
|
|
6783
|
-
)))), /* @__PURE__ */ React57.createElement(
|
|
6810
|
+
), showLogoutAction && /* @__PURE__ */ React57.createElement(
|
|
6784
6811
|
ConfirmationDialog,
|
|
6785
6812
|
{
|
|
6786
|
-
isOpen: showLogoutDialog
|
|
6813
|
+
isOpen: showLogoutDialog,
|
|
6787
6814
|
title: "Secure Logout",
|
|
6788
6815
|
message: "Are you sure you want to log out? You will need to authenticate to return.",
|
|
6789
6816
|
confirmText: "Log Out",
|
|
6790
|
-
cancelText: "Cancel",
|
|
6791
|
-
isProcessing: isLoggingOut,
|
|
6792
6817
|
isDestructive: true,
|
|
6793
|
-
|
|
6818
|
+
isProcessing: isLoggingOut,
|
|
6819
|
+
onClose: () => setShowLogoutDialog(false),
|
|
6794
6820
|
onConfirm: handleLogoutInitiation
|
|
6795
6821
|
}
|
|
6796
6822
|
));
|
|
6797
6823
|
}
|
|
6798
6824
|
|
|
6799
6825
|
// src/components/UniversalSettings2.tsx
|
|
6800
|
-
import React58, { useState as useState42, useEffect as
|
|
6826
|
+
import React58, { useState as useState42, useEffect as useEffect23, useRef as useRef17 } from "react";
|
|
6801
6827
|
import toast18 from "react-hot-toast";
|
|
6802
6828
|
import { HugeiconsIcon as HugeiconsIcon44 } from "@hugeicons/react";
|
|
6803
6829
|
import {
|
|
6804
6830
|
ArrowLeft01Icon as ArrowLeft01Icon23,
|
|
6805
6831
|
ArrowRight01Icon as ArrowRight01Icon18,
|
|
6806
|
-
Loading03Icon as
|
|
6832
|
+
Loading03Icon as Loading03Icon31,
|
|
6807
6833
|
CircleLock02Icon as CircleLock02Icon5,
|
|
6808
6834
|
CloudUploadIcon as CloudUploadIcon2
|
|
6809
6835
|
} from "@hugeicons/core-free-icons";
|
|
@@ -6826,14 +6852,14 @@ var MemberAvatar5 = ({ src, status, sizeClass = "w-10 h-10" }) => {
|
|
|
6826
6852
|
return "bg-stone-200";
|
|
6827
6853
|
}
|
|
6828
6854
|
};
|
|
6829
|
-
return /* @__PURE__ */ React58.createElement("div", { className: `relative shrink-0 ${sizeClass}` }, /* @__PURE__ */ React58.createElement("div", { className: "w-full h-full rounded-lg bg-stone-100 flex items-center justify-center overflow-hidden" }, !loaded && !error && /* @__PURE__ */ React58.createElement(HugeiconsIcon44, { icon:
|
|
6855
|
+
return /* @__PURE__ */ React58.createElement("div", { className: `relative shrink-0 ${sizeClass}` }, /* @__PURE__ */ React58.createElement("div", { className: "w-full h-full rounded-lg bg-stone-100 flex items-center justify-center overflow-hidden" }, !loaded && !error && /* @__PURE__ */ React58.createElement(HugeiconsIcon44, { icon: Loading03Icon31, className: "animate-spin text-stone-400 absolute", size: 14 }), /* @__PURE__ */ React58.createElement("img", { src: finalSrc, alt: "Member", className: `w-full h-full object-cover transition-opacity duration-300 ${loaded || error ? "opacity-100" : "opacity-0"}`, onLoad: () => setLoaded(true), onError: () => setError(true) })), /* @__PURE__ */ React58.createElement("div", { className: `absolute -bottom-1 -right-1 w-3.5 h-3.5 rounded-full border-2 border-white z-10 ${getStatusColor()}` }));
|
|
6830
6856
|
};
|
|
6831
|
-
var
|
|
6857
|
+
var OrgAvatar4 = ({ src, sizeClass = "w-10 h-10" }) => {
|
|
6832
6858
|
const [loaded, setLoaded] = useState42(false);
|
|
6833
6859
|
const [error, setError] = useState42(false);
|
|
6834
6860
|
const defaultAvatar = "https://storage.googleapis.com/retina-cloud-v2/assets/images/office_a.avif";
|
|
6835
6861
|
const finalSrc = error || !src ? defaultAvatar : src;
|
|
6836
|
-
return /* @__PURE__ */ React58.createElement("div", { className: `relative shrink-0 ${sizeClass}` }, /* @__PURE__ */ React58.createElement("div", { className: "w-full h-full rounded-lg bg-stone-100 flex items-center justify-center overflow-hidden" }, !loaded && !error && /* @__PURE__ */ React58.createElement(HugeiconsIcon44, { icon:
|
|
6862
|
+
return /* @__PURE__ */ React58.createElement("div", { className: `relative shrink-0 ${sizeClass}` }, /* @__PURE__ */ React58.createElement("div", { className: "w-full h-full rounded-lg bg-stone-100 flex items-center justify-center overflow-hidden" }, !loaded && !error && /* @__PURE__ */ React58.createElement(HugeiconsIcon44, { icon: Loading03Icon31, className: "animate-spin text-stone-400 absolute", size: 14 }), /* @__PURE__ */ React58.createElement(
|
|
6837
6863
|
"img",
|
|
6838
6864
|
{
|
|
6839
6865
|
src: finalSrc,
|
|
@@ -6844,7 +6870,7 @@ var OrgAvatar3 = ({ src, sizeClass = "w-10 h-10" }) => {
|
|
|
6844
6870
|
}
|
|
6845
6871
|
)));
|
|
6846
6872
|
};
|
|
6847
|
-
var PageSpinner10 = () => /* @__PURE__ */ React58.createElement("div", { className: "flex justify-center items-center py-12" }, /* @__PURE__ */ React58.createElement(HugeiconsIcon44, { icon:
|
|
6873
|
+
var PageSpinner10 = () => /* @__PURE__ */ React58.createElement("div", { className: "flex justify-center items-center py-12" }, /* @__PURE__ */ React58.createElement(HugeiconsIcon44, { icon: Loading03Icon31, size: 32, className: "animate-spin mb-4 text-black" }));
|
|
6848
6874
|
var InputSpinner4 = () => /* @__PURE__ */ React58.createElement("svg", { className: "animate-spin h-4 w-4 text-stone-400", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24" }, /* @__PURE__ */ React58.createElement("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /* @__PURE__ */ React58.createElement("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" }));
|
|
6849
6875
|
var UniversalSettings2 = ({
|
|
6850
6876
|
accountType,
|
|
@@ -6915,7 +6941,7 @@ var UniversalSettings2 = ({
|
|
|
6915
6941
|
const [pendingUserAvatar, setPendingUserAvatar] = useState42(null);
|
|
6916
6942
|
const [isUploadingOrgAvatar, setIsUploadingOrgAvatar] = useState42(false);
|
|
6917
6943
|
const [isUploadingUserAvatar, setIsUploadingUserAvatar] = useState42(false);
|
|
6918
|
-
|
|
6944
|
+
useEffect23(() => {
|
|
6919
6945
|
setOrgName(initialOrgName || "");
|
|
6920
6946
|
setOrgSlug(initialOrgSlug || "");
|
|
6921
6947
|
setOrgAvatarUrl(initialOrgAvatarUrl || "");
|
|
@@ -6950,7 +6976,7 @@ var UniversalSettings2 = ({
|
|
|
6950
6976
|
}
|
|
6951
6977
|
e.target.value = "";
|
|
6952
6978
|
};
|
|
6953
|
-
|
|
6979
|
+
useEffect23(() => {
|
|
6954
6980
|
if (activeTab !== "MEMBERS") return;
|
|
6955
6981
|
if (isFirstSearchMount.current) {
|
|
6956
6982
|
isFirstSearchMount.current = false;
|
|
@@ -7007,7 +7033,7 @@ var UniversalSettings2 = ({
|
|
|
7007
7033
|
}
|
|
7008
7034
|
};
|
|
7009
7035
|
const activeExpandedMember = expandedId ? members.find((m) => m.id === expandedId) : null;
|
|
7010
|
-
|
|
7036
|
+
useEffect23(() => {
|
|
7011
7037
|
if (!isOrg || !orgSlug || orgSlug === initialOrgSlug) {
|
|
7012
7038
|
setSlugAvailable(null);
|
|
7013
7039
|
setIsCheckingSlug(false);
|
|
@@ -7150,7 +7176,7 @@ var UniversalSettings2 = ({
|
|
|
7150
7176
|
},
|
|
7151
7177
|
/* @__PURE__ */ React58.createElement(HugeiconsIcon44, { icon: ArrowLeft01Icon23, size: 16 }),
|
|
7152
7178
|
" Back"
|
|
7153
|
-
)), /* @__PURE__ */ React58.createElement("div", { className: "flex flex-col gap-1 mb-8" }, /* @__PURE__ */ React58.createElement("h2", { className: "text-black text-xl tracking-tight" }, "Member Profile"), /* @__PURE__ */ React58.createElement("p", { className: "text-xs text-stone-500" }, "View and manage this member's access privileges.")), /* @__PURE__ */ React58.createElement("div", { className: "flex items-center gap-4 mb-4" }, /* @__PURE__ */ React58.createElement(MemberAvatar5, { src: activeExpandedMember.avatarUrl, status: activeExpandedMember.status, sizeClass: "w-14 h-14" }), /* @__PURE__ */ React58.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ React58.createElement("span", { className: "text-sm text-black tracking-tight truncate" }, activeExpandedMember.fullName), /* @__PURE__ */ React58.createElement("div", { className: "flex items-center gap-2 mt-0.5" }, /* @__PURE__ */ React58.createElement("span", { className: "text-xs text-stone-500 capitalize" }, activeExpandedMember.role.toLowerCase()), canManage && (isUpdatingRole ? /* @__PURE__ */ React58.createElement(HugeiconsIcon44, { icon:
|
|
7179
|
+
)), /* @__PURE__ */ React58.createElement("div", { className: "flex flex-col gap-1 mb-8" }, /* @__PURE__ */ React58.createElement("h2", { className: "text-black text-xl tracking-tight" }, "Member Profile"), /* @__PURE__ */ React58.createElement("p", { className: "text-xs text-stone-500" }, "View and manage this member's access privileges.")), /* @__PURE__ */ React58.createElement("div", { className: "flex items-center gap-4 mb-4" }, /* @__PURE__ */ React58.createElement(MemberAvatar5, { src: activeExpandedMember.avatarUrl, status: activeExpandedMember.status, sizeClass: "w-14 h-14" }), /* @__PURE__ */ React58.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ React58.createElement("span", { className: "text-sm text-black tracking-tight truncate" }, activeExpandedMember.fullName), /* @__PURE__ */ React58.createElement("div", { className: "flex items-center gap-2 mt-0.5" }, /* @__PURE__ */ React58.createElement("span", { className: "text-xs text-stone-500 capitalize" }, activeExpandedMember.role.toLowerCase()), canManage && (isUpdatingRole ? /* @__PURE__ */ React58.createElement(HugeiconsIcon44, { icon: Loading03Icon31, size: 12, className: "animate-spin text-stone-400 ml-1" }) : /* @__PURE__ */ React58.createElement(React58.Fragment, null, /* @__PURE__ */ React58.createElement("span", { className: "text-stone-300 text-xs px-0.5" }, "\u2022"), /* @__PURE__ */ React58.createElement("button", { onClick: () => setRoleEditTarget(activeExpandedMember), className: "text-xs text-[#d97757] hover:underline outline-none" }, "Edit"), /* @__PURE__ */ React58.createElement("span", { className: "text-stone-300 text-xs px-0.5" }, "\u2022"), /* @__PURE__ */ React58.createElement(
|
|
7154
7180
|
"button",
|
|
7155
7181
|
{
|
|
7156
7182
|
onClick: () => setMemberToRemove(activeExpandedMember),
|
|
@@ -7161,12 +7187,12 @@ var UniversalSettings2 = ({
|
|
|
7161
7187
|
))))))) : /* @__PURE__ */ React58.createElement(React58.Fragment, null, /* @__PURE__ */ React58.createElement("div", { className: "flex flex-col gap-1" }, /* @__PURE__ */ React58.createElement("div", { className: "flex flex-row items-center justify-between gap-4" }, /* @__PURE__ */ React58.createElement("h2", { className: "text-black text-xl tracking-tight" }, isInviteMode ? "Add Member" : "Team Directory"), !isInviteMode && canManage && /* @__PURE__ */ React58.createElement("button", { onClick: () => setIsInviteMode(true), className: "shrink-0 px-4 py-1.5 border border-stone-200 text-black text-xs tracking-wide rounded-full hover:bg-stone-50 transition-colors outline-none" }, "Invite Team")), !isInviteMode && /* @__PURE__ */ React58.createElement("p", { className: "text-xs text-stone-500" }, "Manage members and access controls across your organization.")), /* @__PURE__ */ React58.createElement("div", { className: "w-full overflow-hidden" }, isInviteMode ? /* @__PURE__ */ React58.createElement("form", { onSubmit: handleInviteSubmit, className: "flex flex-col gap-8 animate-in fade-in duration-300" }, /* @__PURE__ */ React58.createElement("div", { className: "space-y-1.5 mt-2" }, /* @__PURE__ */ React58.createElement("label", { className: "text-xs text-stone-400 tracking-[0.2em] block" }, "Email Address"), /* @__PURE__ */ React58.createElement("input", { type: "email", value: inviteEmail, onChange: (e) => setInviteEmail(cleanEmailId(e.target.value)), required: true, autoFocus: true, className: "w-full px-2 py-3 bg-transparent text-sm border-b border-stone-200 text-black outline-none focus:border-black transition-all duration-300", placeholder: "name@company.com" })), /* @__PURE__ */ React58.createElement("div", { className: "flex flex-col gap-3" }, /* @__PURE__ */ React58.createElement(ThreeDActionButton, { type: "submit", disabled: inviteEmail.length < 5 || isInviting, isLoading: isInviting, className: "w-full" }, "Send Invitation"), /* @__PURE__ */ React58.createElement("button", { type: "button", onClick: () => {
|
|
7162
7188
|
setIsInviteMode(false);
|
|
7163
7189
|
setInviteEmail("");
|
|
7164
|
-
}, disabled: isInviting, className: "w-full flex items-center justify-center py-2.5 rounded-full border border-stone-200 text-black hover:bg-stone-50 transition-colors outline-none text-xs tracking-wide" }, "Cancel"))) : isMembersLoading || isTyping ? /* @__PURE__ */ React58.createElement(PageSpinner10, null) : /* @__PURE__ */ React58.createElement("div", { className: "flex flex-col min-w-0 animate-in fade-in duration-300" }, /* @__PURE__ */ React58.createElement("div", null, members.length === 0 ? /* @__PURE__ */ React58.createElement("p", { className: "text-xs text-stone-400 py-6 text-center" }, "No members found") : members.map((member) => /* @__PURE__ */ React58.createElement("div", { key: member.id, onClick: () => setExpandedId(member.id), className: "flex items-center justify-between py-3 hover:bg-stone-50 transition-colors cursor-pointer group min-w-0 px-3 -mx-3 rounded-xl" }, /* @__PURE__ */ React58.createElement("div", { className: "flex items-center gap-4 min-w-0 flex-1" }, /* @__PURE__ */ React58.createElement(MemberAvatar5, { src: member.avatarUrl, status: member.status }), /* @__PURE__ */ React58.createElement("div", { className: "min-w-0 flex-1 flex flex-col gap-0.5" }, /* @__PURE__ */ React58.createElement("p", { className: "text-sm text-black truncate" }, member.fullName), /* @__PURE__ */ React58.createElement("p", { className: "text-xs text-stone-500 capitalize truncate" }, member.role.toLowerCase())))))), /* @__PURE__ */ React58.createElement("div", { className: "flex items-center justify-between pt-6 mt-2 " }, /* @__PURE__ */ React58.createElement("span", { className: "text-xs text-stone-400 tracking-[0.2em]" }, "Page ", membersCurrentPage, " of ", membersTotalPages === 0 ? 1 : membersTotalPages), /* @__PURE__ */ React58.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React58.createElement("button", { onClick: () => onMembersPageChange(membersCurrentPage - 1), disabled: membersCurrentPage <= 1 || isMembersLoading, className: "p-2 bg-white border border-stone-200 rounded-full text-black hover:bg-stone-50 disabled:opacity-30 disabled:cursor-not-allowed transition-all outline-none" }, /* @__PURE__ */ React58.createElement(HugeiconsIcon44, { icon: ArrowLeft01Icon23, size: 14 })), /* @__PURE__ */ React58.createElement("button", { onClick: () => onMembersPageChange(membersCurrentPage + 1), disabled: membersCurrentPage >= membersTotalPages || isMembersLoading || membersTotalPages === 0, className: "p-2 bg-white border border-stone-200 rounded-full text-black hover:bg-stone-50 disabled:opacity-30 disabled:cursor-not-allowed transition-all outline-none" }, /* @__PURE__ */ React58.createElement(HugeiconsIcon44, { icon: ArrowRight01Icon18, size: 14 })))))))), /* @__PURE__ */ React58.createElement(ReusableOptions, { isOpen: !!roleEditTarget, onClose: () => setRoleEditTarget(null), title: "Modify Access Role", options: ["ADMIN", "MANAGER", "MEMBER"], selectedOption: roleEditTarget?.role || "", onSelect: handleRoleUpdate })), activeTab === "ORGANIZATION" && isOrg && /* @__PURE__ */ React58.createElement("div", { className: "flex flex-col gap-8 animate-in rounded-2xl p-6 bg-white fade-in duration-300" }, /* @__PURE__ */ React58.createElement("div", { className: "flex items-start justify-between gap-4" }, /* @__PURE__ */ React58.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React58.createElement("div", { className: "relative group cursor-pointer shrink-0", onClick: () => canManage && !isSavingOrg ? orgFileInputRef.current?.click() : void 0 }, /* @__PURE__ */ React58.createElement(
|
|
7190
|
+
}, disabled: isInviting, className: "w-full flex items-center justify-center py-2.5 rounded-full border border-stone-200 text-black hover:bg-stone-50 transition-colors outline-none text-xs tracking-wide" }, "Cancel"))) : isMembersLoading || isTyping ? /* @__PURE__ */ React58.createElement(PageSpinner10, null) : /* @__PURE__ */ React58.createElement("div", { className: "flex flex-col min-w-0 animate-in fade-in duration-300" }, /* @__PURE__ */ React58.createElement("div", null, members.length === 0 ? /* @__PURE__ */ React58.createElement("p", { className: "text-xs text-stone-400 py-6 text-center" }, "No members found") : members.map((member) => /* @__PURE__ */ React58.createElement("div", { key: member.id, onClick: () => setExpandedId(member.id), className: "flex items-center justify-between py-3 hover:bg-stone-50 transition-colors cursor-pointer group min-w-0 px-3 -mx-3 rounded-xl" }, /* @__PURE__ */ React58.createElement("div", { className: "flex items-center gap-4 min-w-0 flex-1" }, /* @__PURE__ */ React58.createElement(MemberAvatar5, { src: member.avatarUrl, status: member.status }), /* @__PURE__ */ React58.createElement("div", { className: "min-w-0 flex-1 flex flex-col gap-0.5" }, /* @__PURE__ */ React58.createElement("p", { className: "text-sm text-black truncate" }, member.fullName), /* @__PURE__ */ React58.createElement("p", { className: "text-xs text-stone-500 capitalize truncate" }, member.role.toLowerCase())))))), /* @__PURE__ */ React58.createElement("div", { className: "flex items-center justify-between pt-6 mt-2 " }, /* @__PURE__ */ React58.createElement("span", { className: "text-xs text-stone-400 tracking-[0.2em]" }, "Page ", membersCurrentPage, " of ", membersTotalPages === 0 ? 1 : membersTotalPages), /* @__PURE__ */ React58.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React58.createElement("button", { onClick: () => onMembersPageChange(membersCurrentPage - 1), disabled: membersCurrentPage <= 1 || isMembersLoading, className: "p-2 bg-white border border-stone-200 rounded-full text-black hover:bg-stone-50 disabled:opacity-30 disabled:cursor-not-allowed transition-all outline-none" }, /* @__PURE__ */ React58.createElement(HugeiconsIcon44, { icon: ArrowLeft01Icon23, size: 14 })), /* @__PURE__ */ React58.createElement("button", { onClick: () => onMembersPageChange(membersCurrentPage + 1), disabled: membersCurrentPage >= membersTotalPages || isMembersLoading || membersTotalPages === 0, className: "p-2 bg-white border border-stone-200 rounded-full text-black hover:bg-stone-50 disabled:opacity-30 disabled:cursor-not-allowed transition-all outline-none" }, /* @__PURE__ */ React58.createElement(HugeiconsIcon44, { icon: ArrowRight01Icon18, size: 14 })))))))), /* @__PURE__ */ React58.createElement(ReusableOptions, { isOpen: !!roleEditTarget, onClose: () => setRoleEditTarget(null), title: "Modify Access Role", options: ["ADMIN", "MANAGER", "MEMBER"], selectedOption: roleEditTarget?.role || "", onSelect: handleRoleUpdate })), activeTab === "ORGANIZATION" && isOrg && /* @__PURE__ */ React58.createElement("div", { className: "flex flex-col gap-8 animate-in rounded-2xl p-6 bg-white fade-in duration-300" }, /* @__PURE__ */ React58.createElement("div", { className: "flex items-start justify-between gap-4" }, /* @__PURE__ */ React58.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React58.createElement("div", { className: "relative group cursor-pointer shrink-0", onClick: () => canManage && !isSavingOrg ? orgFileInputRef.current?.click() : void 0 }, /* @__PURE__ */ React58.createElement(OrgAvatar4, { src: orgAvatarUrl, sizeClass: "w-14 h-14" }), canManage && /* @__PURE__ */ React58.createElement("div", { className: "absolute -bottom-1 -right-1 w-6 h-6 bg-white border border-stone-200 rounded-full flex items-center justify-center text-stone-500 group-hover:text-black transition-colors z-10" }, isUploadingOrgAvatar ? /* @__PURE__ */ React58.createElement(HugeiconsIcon44, { icon: Loading03Icon31, size: 12, className: "animate-spin" }) : /* @__PURE__ */ React58.createElement(HugeiconsIcon44, { icon: CloudUploadIcon2, size: 14 })), /* @__PURE__ */ React58.createElement("input", { type: "file", ref: orgFileInputRef, className: "hidden", accept: ".png, .jpg, .jpeg", onChange: (e) => handleFileSelect(e, "ORGANIZATION") })), /* @__PURE__ */ React58.createElement("div", null, /* @__PURE__ */ React58.createElement("h2", { className: "text-black text-xl mb-1 tracking-tight" }, "Workspace Details"), /* @__PURE__ */ React58.createElement("p", { className: "text-xs text-stone-500" }, "Manage your organizational identity and handles."))), !canManage && /* @__PURE__ */ React58.createElement("span", { className: "p-2 w-9 h-9 bg-stone-100 text-stone-400 rounded-full shrink-0" }, /* @__PURE__ */ React58.createElement(HugeiconsIcon44, { icon: CircleLock02Icon5, size: 18, className: "text-current" }))), /* @__PURE__ */ React58.createElement("form", { className: "flex flex-col gap-8 w-full max-w-5xl", onSubmit: handleSaveOrganization, autoComplete: "off" }, /* @__PURE__ */ React58.createElement(TextInput, { label: "Workspace Name", value: orgName, onChange: handleOrgNameChange, disabled: !canManage || isSavingOrg, placeholder: "Acme Corporation", maxLength: 50 }), /* @__PURE__ */ React58.createElement("div", { className: "space-y-1.5 relative w-full" }, /* @__PURE__ */ React58.createElement("label", { className: "text-xs text-stone-400 tracking-[0.2em] block" }, "Workspace Handle"), /* @__PURE__ */ React58.createElement("div", { className: "flex items-center relative w-full border-b border-stone-200 focus-within:border-black transition-all duration-300 overflow-hidden" }, /* @__PURE__ */ React58.createElement("input", { type: "text", value: orgSlug, disabled: !canManage || isSavingOrg, onChange: (e) => handleOrgSlugChange(e.target.value), spellCheck: "false", autoComplete: "off", className: "w-full pr-10 pl-0 py-3 text-sm bg-transparent text-black outline-none disabled:opacity-50 disabled:cursor-not-allowed", placeholder: "workspace-handle" }), /* @__PURE__ */ React58.createElement("div", { className: "absolute right-2 top-1/2 -translate-y-1/2" }, isCheckingSlug && /* @__PURE__ */ React58.createElement(InputSpinner4, null), !isCheckingSlug && canManage && orgSlug !== initialOrgSlug && orgSlug.length >= 3 && slugAvailable === false && /* @__PURE__ */ React58.createElement("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-full bg-[#d97757]/10" }, /* @__PURE__ */ React58.createElement("svg", { className: "w-2 h-2 text-[#d97757]", viewBox: "0 0 20 20", fill: "currentColor" }, /* @__PURE__ */ React58.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" }))), !isCheckingSlug && canManage && orgSlug !== initialOrgSlug && orgSlug.length >= 3 && slugAvailable === true && /* @__PURE__ */ React58.createElement("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-full bg-green-100" }, /* @__PURE__ */ React58.createElement("svg", { className: "w-2 h-2 text-green-600", viewBox: "0 0 20 20", fill: "currentColor" }, /* @__PURE__ */ React58.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M16.707 5.293a1 1 0 00-1.414 0L8 12.586 4.707 9.293a1 1 0 10-1.414 1.414l4 4a1 1 0 001.414 0l8-8a1 1 0 000-1.414z" })))))), /* @__PURE__ */ React58.createElement("div", { className: "pt-8 mt-2 flex items-center gap-4" }, /* @__PURE__ */ React58.createElement(ThreeDActionButton, { type: "submit", disabled: isOrgSaveDisabled, isLoading: isSavingOrg, className: "min-w-32" }, "Save Changes"), hasOrgChanges && !isSavingOrg && canManage && /* @__PURE__ */ React58.createElement("button", { type: "button", onClick: () => {
|
|
7165
7191
|
setOrgName(initialOrgName || "");
|
|
7166
7192
|
setOrgSlug(initialOrgSlug || "");
|
|
7167
7193
|
setOrgAvatarUrl(initialOrgAvatarUrl || "");
|
|
7168
7194
|
setPendingOrgAvatar(null);
|
|
7169
|
-
}, className: "text-xs tracking-widest text-stone-400 hover:text-black transition-colors outline-none" }, "Cancel")))), activeTab === "ACCOUNT" && /* @__PURE__ */ React58.createElement("div", { className: "flex flex-col gap-6 animate-in fade-in duration-300" }, /* @__PURE__ */ React58.createElement("div", { className: "flex flex-col gap-8 rounded-2xl p-6 bg-white w-full" }, /* @__PURE__ */ React58.createElement("div", { className: "flex items-start justify-between gap-4" }, /* @__PURE__ */ React58.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React58.createElement("div", { className: "relative group cursor-pointer shrink-0", onClick: () => !isSavingProfile ? userFileInputRef.current?.click() : void 0 }, /* @__PURE__ */ React58.createElement(MemberAvatar5, { src: avatarUrl, status: "ACTIVE", sizeClass: "w-14 h-14" }), /* @__PURE__ */ React58.createElement("div", { className: "absolute -bottom-1 -right-1 w-6 h-6 bg-white border border-stone-200 rounded-full flex items-center justify-center text-stone-500 group-hover:text-black transition-colors z-20" }, isUploadingUserAvatar ? /* @__PURE__ */ React58.createElement(HugeiconsIcon44, { icon:
|
|
7195
|
+
}, className: "text-xs tracking-widest text-stone-400 hover:text-black transition-colors outline-none" }, "Cancel")))), activeTab === "ACCOUNT" && /* @__PURE__ */ React58.createElement("div", { className: "flex flex-col gap-6 animate-in fade-in duration-300" }, /* @__PURE__ */ React58.createElement("div", { className: "flex flex-col gap-8 rounded-2xl p-6 bg-white w-full" }, /* @__PURE__ */ React58.createElement("div", { className: "flex items-start justify-between gap-4" }, /* @__PURE__ */ React58.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React58.createElement("div", { className: "relative group cursor-pointer shrink-0", onClick: () => !isSavingProfile ? userFileInputRef.current?.click() : void 0 }, /* @__PURE__ */ React58.createElement(MemberAvatar5, { src: avatarUrl, status: "ACTIVE", sizeClass: "w-14 h-14" }), /* @__PURE__ */ React58.createElement("div", { className: "absolute -bottom-1 -right-1 w-6 h-6 bg-white border border-stone-200 rounded-full flex items-center justify-center text-stone-500 group-hover:text-black transition-colors z-20" }, isUploadingUserAvatar ? /* @__PURE__ */ React58.createElement(HugeiconsIcon44, { icon: Loading03Icon31, size: 12, className: "animate-spin" }) : /* @__PURE__ */ React58.createElement(HugeiconsIcon44, { icon: CloudUploadIcon2, size: 14 })), /* @__PURE__ */ React58.createElement("input", { type: "file", ref: userFileInputRef, className: "hidden", accept: ".png, .jpg, .jpeg", onChange: (e) => handleFileSelect(e, "USER") })), /* @__PURE__ */ React58.createElement("div", null, /* @__PURE__ */ React58.createElement("h2", { className: "text-black text-xl mb-1 tracking-tight" }, "Personal Identity"), /* @__PURE__ */ React58.createElement("p", { className: "text-xs text-stone-500" }, "Update your system display name and contact email.")))), /* @__PURE__ */ React58.createElement("form", { className: "flex flex-col gap-6 w-full max-w-5xl", onSubmit: handleSaveProfile, autoComplete: "off" }, /* @__PURE__ */ React58.createElement("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-6" }, /* @__PURE__ */ React58.createElement(TextInput, { label: "First Name", value: firstName, onChange: (v) => setFirstName(v.replace(/[^a-zA-Z\s-]/g, "").substring(0, 50)), disabled: isSavingProfile, placeholder: "First name", maxLength: 50 }), /* @__PURE__ */ React58.createElement(TextInput, { label: "Last Name", value: lastName, onChange: (v) => setLastName(v.replace(/[^a-zA-Z\s-]/g, "").substring(0, 50)), disabled: isSavingProfile, placeholder: "Last name", maxLength: 50 })), /* @__PURE__ */ React58.createElement("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-6" }, /* @__PURE__ */ React58.createElement(TextInput, { label: "Job Title", value: jobTitle, onChange: (v) => setJobTitle(v.substring(0, 50)), disabled: isSavingProfile, placeholder: "e.g. HR Manager, CEO", maxLength: 50 }), /* @__PURE__ */ React58.createElement("div", { className: "space-y-1.5 w-full" }, /* @__PURE__ */ React58.createElement("label", { className: "text-xs text-stone-400 tracking-[0.2em] block" }, "Email Address"), /* @__PURE__ */ React58.createElement("input", { type: "email", value: initialEmail, disabled: true, className: "w-full pb-3 pt-3 text-sm bg-transparent text-stone-400 border-b border-stone-200 outline-none cursor-not-allowed" }))), /* @__PURE__ */ React58.createElement("div", { className: "space-y-1.5 w-full" }, /* @__PURE__ */ React58.createElement("label", { className: "text-xs text-stone-400 tracking-[0.2em] block" }, "About Me"), /* @__PURE__ */ React58.createElement(
|
|
7170
7196
|
"textarea",
|
|
7171
7197
|
{
|
|
7172
7198
|
value: description,
|
|
@@ -7180,7 +7206,7 @@ var UniversalSettings2 = ({
|
|
|
7180
7206
|
};
|
|
7181
7207
|
|
|
7182
7208
|
// src/components/UniversalDeveloperSettings.tsx
|
|
7183
|
-
import React59, { useState as useState43, useEffect as
|
|
7209
|
+
import React59, { useState as useState43, useEffect as useEffect24 } from "react";
|
|
7184
7210
|
import { toast as toast19 } from "react-hot-toast";
|
|
7185
7211
|
var UniversalDeveloperSettings = ({
|
|
7186
7212
|
initialPublicKey,
|
|
@@ -7194,7 +7220,7 @@ var UniversalDeveloperSettings = ({
|
|
|
7194
7220
|
const [isGenerating, setIsGenerating] = useState43(false);
|
|
7195
7221
|
const [isSavingWebhook, setIsSavingWebhook] = useState43(false);
|
|
7196
7222
|
const [isRollModalOpen, setIsRollModalOpen] = useState43(false);
|
|
7197
|
-
|
|
7223
|
+
useEffect24(() => {
|
|
7198
7224
|
setPublicKey(initialPublicKey || "");
|
|
7199
7225
|
setWebhookUrl(initialWebhookUrl || "");
|
|
7200
7226
|
}, [initialPublicKey, initialWebhookUrl]);
|
|
@@ -7322,8 +7348,8 @@ AUDDITUR_SECRET_KEY="${secKey}"
|
|
|
7322
7348
|
import React60, { useState as useState44, useRef as useRef18 } from "react";
|
|
7323
7349
|
import { HugeiconsIcon as HugeiconsIcon45 } from "@hugeicons/react";
|
|
7324
7350
|
import {
|
|
7325
|
-
Search01Icon as
|
|
7326
|
-
SearchList02Icon as
|
|
7351
|
+
Search01Icon as Search01Icon9,
|
|
7352
|
+
SearchList02Icon as SearchList02Icon4
|
|
7327
7353
|
} from "@hugeicons/core-free-icons";
|
|
7328
7354
|
var UniversalApplicationPage2 = ({
|
|
7329
7355
|
userRole = "MEMBER",
|
|
@@ -7357,10 +7383,9 @@ var UniversalApplicationPage2 = ({
|
|
|
7357
7383
|
"COMPLETED",
|
|
7358
7384
|
"PENDING",
|
|
7359
7385
|
"REJECTED",
|
|
7360
|
-
"QUERIED"
|
|
7361
|
-
"AWAITING_PAYMENT"
|
|
7386
|
+
"QUERIED"
|
|
7362
7387
|
];
|
|
7363
|
-
return /* @__PURE__ */ React60.createElement("div", { className: "w-full max-w-4xl mx-auto flex flex-col animate-in fade-in duration-300 relative" }, /* @__PURE__ */ React60.createElement("div", { className: "flex flex-col gap-1 mb-8 px-1" }, /* @__PURE__ */ React60.createElement("div", { className: "flex items-center" }, /* @__PURE__ */ React60.createElement("h1", { className: "text-black text-xl tracking-tight" }, "Applications Directory")), /* @__PURE__ */ React60.createElement("p", { className: "text-xs text-stone-500" }, "Search, filter, and track all your organizational applications.")), /* @__PURE__ */ React60.createElement("div", { className: "flex flex-row flex-nowrap mb-2 items-center justify-between gap-4 w-full px-1" }, /* @__PURE__ */ React60.createElement("div", { className: "relative flex-1 min-w-0 max-w-full" }, /* @__PURE__ */ React60.createElement("div", { className: "absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none" }, /* @__PURE__ */ React60.createElement(HugeiconsIcon45, { icon:
|
|
7388
|
+
return /* @__PURE__ */ React60.createElement("div", { className: "w-full max-w-4xl mx-auto flex flex-col animate-in fade-in duration-300 relative" }, /* @__PURE__ */ React60.createElement("div", { className: "flex flex-col gap-1 mb-8 px-1" }, /* @__PURE__ */ React60.createElement("div", { className: "flex items-center" }, /* @__PURE__ */ React60.createElement("h1", { className: "text-black text-xl tracking-tight" }, "Applications Directory")), /* @__PURE__ */ React60.createElement("p", { className: "text-xs text-stone-500" }, "Search, filter, and track all your organizational applications.")), /* @__PURE__ */ React60.createElement("div", { className: "flex flex-row flex-nowrap mb-2 items-center justify-between gap-4 w-full px-1" }, /* @__PURE__ */ React60.createElement("div", { className: "relative flex-1 min-w-0 max-w-full" }, /* @__PURE__ */ React60.createElement("div", { className: "absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none" }, /* @__PURE__ */ React60.createElement(HugeiconsIcon45, { icon: Search01Icon9, size: 16, className: "text-stone-400" })), /* @__PURE__ */ React60.createElement(
|
|
7364
7389
|
"input",
|
|
7365
7390
|
{
|
|
7366
7391
|
type: "text",
|
|
@@ -7375,7 +7400,7 @@ var UniversalApplicationPage2 = ({
|
|
|
7375
7400
|
onClick: () => setShowStatusModal(true),
|
|
7376
7401
|
className: "flex items-center justify-center bg-white shadow-[0_2px_10px_rgba(0,0,0,0.02)] w-10 h-10 rounded-full text-stone-500 hover:text-black transition-colors outline-none relative"
|
|
7377
7402
|
},
|
|
7378
|
-
/* @__PURE__ */ React60.createElement(HugeiconsIcon45, { icon:
|
|
7403
|
+
/* @__PURE__ */ React60.createElement(HugeiconsIcon45, { icon: SearchList02Icon4, size: 18 }),
|
|
7379
7404
|
activeStatusFilter !== "ALL" && /* @__PURE__ */ React60.createElement("span", { className: "absolute top-2 right-2 w-2 h-2 bg-[#d97757] rounded-full border border-white" })
|
|
7380
7405
|
))), /* @__PURE__ */ React60.createElement("div", { className: "w-full mt-2" }, /* @__PURE__ */ React60.createElement(
|
|
7381
7406
|
UniversalApplicationsPage,
|
|
@@ -7447,25 +7472,25 @@ var UniversalApplicationDetails = ({
|
|
|
7447
7472
|
};
|
|
7448
7473
|
|
|
7449
7474
|
// src/components/UniversalCreateApplication.tsx
|
|
7450
|
-
import React62, { useState as useState46, useRef as useRef19, useEffect as
|
|
7475
|
+
import React62, { useState as useState46, useRef as useRef19, useEffect as useEffect25 } from "react";
|
|
7451
7476
|
import toast20 from "react-hot-toast";
|
|
7452
7477
|
import { HugeiconsIcon as HugeiconsIcon47 } from "@hugeicons/react";
|
|
7453
7478
|
import {
|
|
7454
7479
|
ArrowLeft01Icon as ArrowLeft01Icon25,
|
|
7455
7480
|
ArrowRight01Icon as ArrowRight01Icon19,
|
|
7456
|
-
Loading03Icon as
|
|
7457
|
-
Search01Icon as
|
|
7481
|
+
Loading03Icon as Loading03Icon32,
|
|
7482
|
+
Search01Icon as Search01Icon10,
|
|
7458
7483
|
CircleLock02Icon as CircleLock02Icon6,
|
|
7459
7484
|
CheckmarkCircle02Icon as CheckmarkCircle02Icon2,
|
|
7460
7485
|
Building03Icon,
|
|
7461
7486
|
File02Icon,
|
|
7462
|
-
Tick02Icon as
|
|
7487
|
+
Tick02Icon as Tick02Icon5
|
|
7463
7488
|
} from "@hugeicons/core-free-icons";
|
|
7464
7489
|
var MemberAvatar6 = ({ src, sizeClass = "w-10 h-10" }) => {
|
|
7465
7490
|
const [loaded, setLoaded] = useState46(false);
|
|
7466
7491
|
const [error, setError] = useState46(false);
|
|
7467
7492
|
const defaultAvatar = "https://storage.googleapis.com/retina-cloud-v2/assets/images/avatar.avif";
|
|
7468
|
-
return /* @__PURE__ */ React62.createElement("div", { className: `relative shrink-0 ${sizeClass}` }, /* @__PURE__ */ React62.createElement("div", { className: "w-full h-full rounded-lg bg-stone-100 flex items-center justify-center overflow-hidden" }, !loaded && !error && /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon:
|
|
7493
|
+
return /* @__PURE__ */ React62.createElement("div", { className: `relative shrink-0 ${sizeClass}` }, /* @__PURE__ */ React62.createElement("div", { className: "w-full h-full rounded-lg bg-stone-100 flex items-center justify-center overflow-hidden" }, !loaded && !error && /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: Loading03Icon32, className: "animate-spin text-stone-400 absolute", size: 14 }), /* @__PURE__ */ React62.createElement("img", { src: error || !src ? defaultAvatar : src, alt: "Avatar", className: `w-full h-full object-cover transition-opacity duration-300 ${loaded || error ? "opacity-100" : "opacity-0"}`, onLoad: () => setLoaded(true), onError: () => setError(true) })));
|
|
7469
7494
|
};
|
|
7470
7495
|
var UniversalCreateApplication = ({
|
|
7471
7496
|
onBackHref,
|
|
@@ -7491,7 +7516,7 @@ var UniversalCreateApplication = ({
|
|
|
7491
7516
|
const [creationMode, setCreationMode] = useState46("EXISTING");
|
|
7492
7517
|
const defaultTypeKey = applicationTypesMeta.length > 0 ? applicationTypesMeta[0].key : "";
|
|
7493
7518
|
const [selectedTypeKey, setSelectedTypeKey] = useState46(defaultTypeKey);
|
|
7494
|
-
|
|
7519
|
+
useEffect25(() => {
|
|
7495
7520
|
if (!selectedTypeKey && applicationTypesMeta.length > 0) {
|
|
7496
7521
|
setSelectedTypeKey(applicationTypesMeta[0].key);
|
|
7497
7522
|
}
|
|
@@ -7583,11 +7608,11 @@ var UniversalCreateApplication = ({
|
|
|
7583
7608
|
/* @__PURE__ */ React62.createElement("div", { className: "flex items-center justify-between gap-2" }, /* @__PURE__ */ React62.createElement("h4", { className: "text-xs text-black" }, item.label), isSelected && /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: CheckmarkCircle02Icon2, size: 16, className: "text-[#d97757] shrink-0" })),
|
|
7584
7609
|
/* @__PURE__ */ React62.createElement("p", { className: "text-[11px] text-stone-500 mt-1 leading-relaxed whitespace-normal wrap-break-word" }, item.desc)
|
|
7585
7610
|
);
|
|
7586
|
-
})))), showCompaniesModal && canManage && /* @__PURE__ */ React62.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React62.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowCompaniesModal(false) }), /* @__PURE__ */ React62.createElement("div", { className: "relative w-full max-w-md bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 h-[80vh]" }, /* @__PURE__ */ React62.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, /* @__PURE__ */ React62.createElement("h3", { className: "text-sm text-black tracking-tight" }, "Select Company"), /* @__PURE__ */ React62.createElement("button", { onClick: () => setShowCompaniesModal(false), className: "text-[#d97757] outline-none text-sm" }, "Done")), /* @__PURE__ */ React62.createElement("div", { className: "p-4 shrink-0" }, /* @__PURE__ */ React62.createElement("div", { className: "relative w-full" }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon:
|
|
7611
|
+
})))), showCompaniesModal && canManage && /* @__PURE__ */ React62.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React62.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowCompaniesModal(false) }), /* @__PURE__ */ React62.createElement("div", { className: "relative w-full max-w-md bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 h-[80vh]" }, /* @__PURE__ */ React62.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, /* @__PURE__ */ React62.createElement("h3", { className: "text-sm text-black tracking-tight" }, "Select Company"), /* @__PURE__ */ React62.createElement("button", { onClick: () => setShowCompaniesModal(false), className: "text-[#d97757] outline-none text-sm" }, "Done")), /* @__PURE__ */ React62.createElement("div", { className: "p-4 shrink-0" }, /* @__PURE__ */ React62.createElement("div", { className: "relative w-full" }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: Search01Icon10, size: 16, className: "text-stone-400 absolute left-4 top-1/2 -translate-y-1/2 pointer-events-none" }), /* @__PURE__ */ React62.createElement("input", { type: "text", placeholder: "Search companies...", value: localCompSearch, onChange: handleCompSearch, className: "w-full pl-10 pr-4 py-2.5 bg-stone-100 rounded-full focus:border-[#d97757] border border-transparent text-sm text-black outline-none focus:bg-stone-50 transition-colors" }))), /* @__PURE__ */ React62.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-2" }, isCompaniesLoading ? /* @__PURE__ */ React62.createElement("div", { className: "absolute inset-0 flex items-center justify-center" }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: Loading03Icon32, size: 28, className: "animate-spin text-black" })) : companies.length === 0 ? /* @__PURE__ */ React62.createElement("div", { className: "p-8 text-center text-xs text-stone-400" }, "No companies available.") : companies.map((comp) => /* @__PURE__ */ React62.createElement("div", { key: comp.id, onClick: () => {
|
|
7587
7612
|
setSelectedCompanyId(comp.id);
|
|
7588
|
-
}, className: "flex items-center justify-between p-3 rounded-xl cursor-pointer hover:bg-stone-50 transition-colors" }, /* @__PURE__ */ React62.createElement("div", { className: "flex flex-col min-w-0 flex-1 pl-2" }, /* @__PURE__ */ React62.createElement("span", { className: "text-sm text-black truncate" }, comp.name), /* @__PURE__ */ React62.createElement("div", { className: "flex items-center gap-2 mt-0.5" }, /* @__PURE__ */ React62.createElement("span", { className: "text-[10px] text-stone-500 tracking-widest uppercase" }, "Applications: ", comp.applicationsCount || 0), comp.isPrivate && /* @__PURE__ */ React62.createElement("span", { className: "text-[10px] text-[#d97757] tracking-widest uppercase" }, "Private"))), selectedCompanyId === comp.id && /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: CheckmarkCircle02Icon2, size: 16, className: "text-[#d97757] mr-2" })))), /* @__PURE__ */ React62.createElement("div", { className: "p-4 flex items-center justify-between shrink-0 bg-white" }, /* @__PURE__ */ React62.createElement("span", { className: "text-xs text-stone-400 tracking-widest" }, "Page ", companiesCurrentPage, " of ", companiesTotalPages || 1), /* @__PURE__ */ React62.createElement("div", { className: "flex gap-1" }, /* @__PURE__ */ React62.createElement("button", { disabled: companiesCurrentPage <= 1 || isCompaniesLoading, onClick: () => onCompaniesPageChange(companiesCurrentPage - 1), className: "w-7 h-7 flex items-center justify-center rounded-full bg-white border border-stone-200 text-stone-600 disabled:opacity-30 outline-none hover:bg-stone-50" }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: ArrowLeft01Icon25, size: 12 })), /* @__PURE__ */ React62.createElement("button", { disabled: companiesCurrentPage >= companiesTotalPages || isCompaniesLoading, onClick: () => onCompaniesPageChange(companiesCurrentPage + 1), className: "w-7 h-7 flex items-center justify-center rounded-full bg-white border border-stone-200 text-stone-600 disabled:opacity-30 outline-none hover:bg-stone-50" }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: ArrowRight01Icon19, size: 12 })))))), showMembersModal && canManage && /* @__PURE__ */ React62.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React62.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowMembersModal(false) }), /* @__PURE__ */ React62.createElement("div", { className: "relative w-full max-w-md bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 h-[80vh]" }, /* @__PURE__ */ React62.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, /* @__PURE__ */ React62.createElement("h3", { className: "text-sm text-black tracking-tight" }, "Assign Members"), /* @__PURE__ */ React62.createElement("button", { onClick: () => setShowMembersModal(false), className: "text-[#d97757] outline-none text-sm" }, "Done")), /* @__PURE__ */ React62.createElement("div", { className: "p-4 shrink-0" }, /* @__PURE__ */ React62.createElement("div", { className: "relative w-full" }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon:
|
|
7613
|
+
}, className: "flex items-center justify-between p-3 rounded-xl cursor-pointer hover:bg-stone-50 transition-colors" }, /* @__PURE__ */ React62.createElement("div", { className: "flex flex-col min-w-0 flex-1 pl-2" }, /* @__PURE__ */ React62.createElement("span", { className: "text-sm text-black truncate" }, comp.name), /* @__PURE__ */ React62.createElement("div", { className: "flex items-center gap-2 mt-0.5" }, /* @__PURE__ */ React62.createElement("span", { className: "text-[10px] text-stone-500 tracking-widest uppercase" }, "Applications: ", comp.applicationsCount || 0), comp.isPrivate && /* @__PURE__ */ React62.createElement("span", { className: "text-[10px] text-[#d97757] tracking-widest uppercase" }, "Private"))), selectedCompanyId === comp.id && /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: CheckmarkCircle02Icon2, size: 16, className: "text-[#d97757] mr-2" })))), /* @__PURE__ */ React62.createElement("div", { className: "p-4 flex items-center justify-between shrink-0 bg-white" }, /* @__PURE__ */ React62.createElement("span", { className: "text-xs text-stone-400 tracking-widest" }, "Page ", companiesCurrentPage, " of ", companiesTotalPages || 1), /* @__PURE__ */ React62.createElement("div", { className: "flex gap-1" }, /* @__PURE__ */ React62.createElement("button", { disabled: companiesCurrentPage <= 1 || isCompaniesLoading, onClick: () => onCompaniesPageChange(companiesCurrentPage - 1), className: "w-7 h-7 flex items-center justify-center rounded-full bg-white border border-stone-200 text-stone-600 disabled:opacity-30 outline-none hover:bg-stone-50" }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: ArrowLeft01Icon25, size: 12 })), /* @__PURE__ */ React62.createElement("button", { disabled: companiesCurrentPage >= companiesTotalPages || isCompaniesLoading, onClick: () => onCompaniesPageChange(companiesCurrentPage + 1), className: "w-7 h-7 flex items-center justify-center rounded-full bg-white border border-stone-200 text-stone-600 disabled:opacity-30 outline-none hover:bg-stone-50" }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: ArrowRight01Icon19, size: 12 })))))), showMembersModal && canManage && /* @__PURE__ */ React62.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React62.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowMembersModal(false) }), /* @__PURE__ */ React62.createElement("div", { className: "relative w-full max-w-md bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 h-[80vh]" }, /* @__PURE__ */ React62.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, /* @__PURE__ */ React62.createElement("h3", { className: "text-sm text-black tracking-tight" }, "Assign Members"), /* @__PURE__ */ React62.createElement("button", { onClick: () => setShowMembersModal(false), className: "text-[#d97757] outline-none text-sm" }, "Done")), /* @__PURE__ */ React62.createElement("div", { className: "p-4 shrink-0" }, /* @__PURE__ */ React62.createElement("div", { className: "relative w-full" }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: Search01Icon10, size: 16, className: "text-stone-400 absolute left-4 top-1/2 -translate-y-1/2 pointer-events-none" }), /* @__PURE__ */ React62.createElement("input", { type: "text", placeholder: "Search team...", value: localMemSearch, onChange: handleMemSearch, className: "w-full pl-10 pr-4 py-2.5 bg-stone-100 rounded-full focus:border-[#d97757] border border-transparent text-sm text-black outline-none focus:bg-stone-50 transition-colors" }))), /* @__PURE__ */ React62.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-2" }, isMembersLoading ? /* @__PURE__ */ React62.createElement("div", { className: "absolute inset-0 flex items-center justify-center" }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: Loading03Icon32, size: 28, className: "animate-spin text-black" })) : members.length === 0 ? /* @__PURE__ */ React62.createElement("div", { className: "p-8 text-center text-xs text-stone-400" }, "No members found.") : members.map((member) => {
|
|
7589
7614
|
const isChecked = selectedParticipants.has(member.userId);
|
|
7590
|
-
return /* @__PURE__ */ React62.createElement("div", { key: member.id, onClick: () => toggleParticipant(member.userId), className: "flex items-center justify-between p-3 rounded-xl cursor-pointer hover:bg-stone-50 transition-colors select-none" }, /* @__PURE__ */ React62.createElement("div", { className: "flex items-center gap-3 min-w-0 flex-1" }, /* @__PURE__ */ React62.createElement(MemberAvatar6, { src: member.avatarUrl, sizeClass: "w-9 h-9" }), /* @__PURE__ */ React62.createElement("div", { className: "flex flex-col min-w-0 flex-1" }, /* @__PURE__ */ React62.createElement("span", { className: "text-sm text-black truncate" }, member.fullName), /* @__PURE__ */ React62.createElement("span", { className: "text-xs text-stone-400 capitalize truncate" }, member.role.toLowerCase()))), /* @__PURE__ */ React62.createElement("div", { className: "shrink-0 pl-3" }, /* @__PURE__ */ React62.createElement("div", { className: `w-5 h-5 rounded-full flex items-center justify-center transition-colors ${isChecked ? "bg-[#d97757]" : "border border-stone-300 bg-white"}` }, isChecked && /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon:
|
|
7615
|
+
return /* @__PURE__ */ React62.createElement("div", { key: member.id, onClick: () => toggleParticipant(member.userId), className: "flex items-center justify-between p-3 rounded-xl cursor-pointer hover:bg-stone-50 transition-colors select-none" }, /* @__PURE__ */ React62.createElement("div", { className: "flex items-center gap-3 min-w-0 flex-1" }, /* @__PURE__ */ React62.createElement(MemberAvatar6, { src: member.avatarUrl, sizeClass: "w-9 h-9" }), /* @__PURE__ */ React62.createElement("div", { className: "flex flex-col min-w-0 flex-1" }, /* @__PURE__ */ React62.createElement("span", { className: "text-sm text-black truncate" }, member.fullName), /* @__PURE__ */ React62.createElement("span", { className: "text-xs text-stone-400 capitalize truncate" }, member.role.toLowerCase()))), /* @__PURE__ */ React62.createElement("div", { className: "shrink-0 pl-3" }, /* @__PURE__ */ React62.createElement("div", { className: `w-5 h-5 rounded-full flex items-center justify-center transition-colors ${isChecked ? "bg-[#d97757]" : "border border-stone-300 bg-white"}` }, isChecked && /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: Tick02Icon5, size: 14, className: "text-white" }))));
|
|
7591
7616
|
})), /* @__PURE__ */ React62.createElement("div", { className: "p-4 flex items-center justify-between shrink-0 bg-white" }, /* @__PURE__ */ React62.createElement("span", { className: "text-xs text-stone-400 tracking-widest" }, "Page ", membersCurrentPage, " of ", membersTotalPages || 1), /* @__PURE__ */ React62.createElement("div", { className: "flex gap-1" }, /* @__PURE__ */ React62.createElement("button", { disabled: membersCurrentPage <= 1 || isMembersLoading, onClick: () => onMembersPageChange(membersCurrentPage - 1), className: "w-7 h-7 flex items-center justify-center rounded-full bg-white border border-stone-200 text-stone-600 disabled:opacity-30 outline-none hover:bg-stone-50" }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: ArrowLeft01Icon25, size: 12 })), /* @__PURE__ */ React62.createElement("button", { disabled: membersCurrentPage >= membersTotalPages || isMembersLoading, onClick: () => onMembersPageChange(membersCurrentPage + 1), className: "w-7 h-7 flex items-center justify-center rounded-full bg-white border border-stone-200 text-stone-600 disabled:opacity-30 outline-none hover:bg-stone-50" }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: ArrowRight01Icon19, size: 12 })))))));
|
|
7592
7617
|
};
|
|
7593
7618
|
export {
|