@retinalabsllc/zairusjs 16.1.2 → 16.1.30
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 +50 -1
- package/dist/index.d.ts +50 -1
- package/dist/index.js +515 -15
- package/dist/index.mjs +543 -35
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -527,7 +527,7 @@ function AuthFormInner({
|
|
|
527
527
|
onKeyDown: (e) => {
|
|
528
528
|
if (e.key === "Backspace" && !otp[index] && index > 0) inputRefs.current[index - 1]?.focus();
|
|
529
529
|
},
|
|
530
|
-
className: "w-10 h-
|
|
530
|
+
className: "w-10 h-10 text-center text-sm bg-transparent border-b-2 border-neutral-200 text-black outline-none focus:border-black transition-all duration-300"
|
|
531
531
|
}
|
|
532
532
|
))), /* @__PURE__ */ React5.createElement("div", { className: "flex flex-col gap-4" }, /* @__PURE__ */ React5.createElement(ThreeDActionButton, { type: "submit", disabled: otp.join("").length < 6, isLoading: isSubmitting, className: "w-full" }, "Verify Code"), !userHas2FA && /* @__PURE__ */ React5.createElement(
|
|
533
533
|
"button",
|
|
@@ -4508,7 +4508,8 @@ var UniversalBuyCryptoPage = ({
|
|
|
4508
4508
|
};
|
|
4509
4509
|
|
|
4510
4510
|
// src/components/UniversalDepartmentsPage.tsx
|
|
4511
|
-
import React46 from "react";
|
|
4511
|
+
import React46, { useState as useState32 } from "react";
|
|
4512
|
+
import toast12 from "react-hot-toast";
|
|
4512
4513
|
import { HugeiconsIcon as HugeiconsIcon32 } from "@hugeicons/react";
|
|
4513
4514
|
import { ArrowLeft01Icon as ArrowLeft01Icon13, ArrowRight01Icon as ArrowRight01Icon9, Loading03Icon as Loading03Icon20 } from "@hugeicons/core-free-icons";
|
|
4514
4515
|
var formatMembersCount = (num) => {
|
|
@@ -4525,16 +4526,74 @@ var UniversalDepartmentsPage = ({
|
|
|
4525
4526
|
currentPage,
|
|
4526
4527
|
totalPages,
|
|
4527
4528
|
onPageChange,
|
|
4528
|
-
onDepartmentClick
|
|
4529
|
+
onDepartmentClick,
|
|
4530
|
+
onCreateDepartment
|
|
4529
4531
|
}) => {
|
|
4530
|
-
|
|
4532
|
+
const [isCreateMode, setIsCreateMode] = useState32(false);
|
|
4533
|
+
const [deptName, setDeptName] = useState32("");
|
|
4534
|
+
const [isCreating, setIsCreating] = useState32(false);
|
|
4535
|
+
const handleCreateSubmit = async (e) => {
|
|
4536
|
+
e.preventDefault();
|
|
4537
|
+
if (deptName.length < 2 || isCreating || !onCreateDepartment) return;
|
|
4538
|
+
setIsCreating(true);
|
|
4539
|
+
try {
|
|
4540
|
+
await onCreateDepartment(deptName);
|
|
4541
|
+
setDeptName("");
|
|
4542
|
+
setIsCreateMode(false);
|
|
4543
|
+
} catch (error) {
|
|
4544
|
+
toast12.error(error.message || "Failed to create department.");
|
|
4545
|
+
} finally {
|
|
4546
|
+
setIsCreating(false);
|
|
4547
|
+
}
|
|
4548
|
+
};
|
|
4549
|
+
return /* @__PURE__ */ React46.createElement("div", { className: "w-full max-w-3xl mx-auto flex flex-col animate-in fade-in duration-300" }, /* @__PURE__ */ React46.createElement("div", { className: "flex flex-col gap-8 p-6 rounded-2xl bg-white w-full" }, /* @__PURE__ */ React46.createElement("div", { className: "flex flex-col gap-1" }, /* @__PURE__ */ React46.createElement("div", { className: "flex flex-row items-center justify-between gap-4" }, /* @__PURE__ */ React46.createElement("h2", { className: "text-black text-xl tracking-tight" }, isCreateMode ? "Create Department" : headerTitle), !isCreateMode && onCreateDepartment && /* @__PURE__ */ React46.createElement(
|
|
4550
|
+
"button",
|
|
4551
|
+
{
|
|
4552
|
+
onClick: () => setIsCreateMode(true),
|
|
4553
|
+
className: "shrink-0 px-4 py-1.5 border border-neutral-200 text-black text-[12px] tracking-wide rounded-full hover:bg-neutral-50 transition-colors outline-none"
|
|
4554
|
+
},
|
|
4555
|
+
"Create new"
|
|
4556
|
+
)), !isCreateMode && headerDescription && /* @__PURE__ */ React46.createElement("p", { className: "text-[12px] text-neutral-500" }, headerDescription)), /* @__PURE__ */ React46.createElement("div", { className: "w-full overflow-hidden" }, isCreateMode ? /* @__PURE__ */ React46.createElement("form", { onSubmit: handleCreateSubmit, className: "flex flex-col gap-8 animate-in fade-in duration-300 mt-2" }, /* @__PURE__ */ React46.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React46.createElement("label", { className: "text-[11px] text-neutral-400 tracking-[0.2em] block" }, "Department Name"), /* @__PURE__ */ React46.createElement(
|
|
4557
|
+
"input",
|
|
4558
|
+
{
|
|
4559
|
+
type: "text",
|
|
4560
|
+
value: deptName,
|
|
4561
|
+
onChange: (e) => setDeptName(e.target.value),
|
|
4562
|
+
required: true,
|
|
4563
|
+
autoFocus: true,
|
|
4564
|
+
maxLength: 50,
|
|
4565
|
+
className: "w-full px-2 py-3 bg-transparent text-sm border-b border-neutral-200 text-black outline-none focus:border-black transition-all duration-300",
|
|
4566
|
+
placeholder: "e.g. Engineering, Marketing..."
|
|
4567
|
+
}
|
|
4568
|
+
)), /* @__PURE__ */ React46.createElement("div", { className: "flex flex-col gap-3" }, /* @__PURE__ */ React46.createElement(
|
|
4569
|
+
ThreeDActionButton,
|
|
4570
|
+
{
|
|
4571
|
+
type: "submit",
|
|
4572
|
+
disabled: deptName.length < 2 || isCreating,
|
|
4573
|
+
isLoading: isCreating,
|
|
4574
|
+
className: "w-full"
|
|
4575
|
+
},
|
|
4576
|
+
"Create Department"
|
|
4577
|
+
), /* @__PURE__ */ React46.createElement(
|
|
4578
|
+
"button",
|
|
4579
|
+
{
|
|
4580
|
+
type: "button",
|
|
4581
|
+
onClick: () => {
|
|
4582
|
+
setIsCreateMode(false);
|
|
4583
|
+
setDeptName("");
|
|
4584
|
+
},
|
|
4585
|
+
disabled: isCreating,
|
|
4586
|
+
className: "w-full flex items-center justify-center py-2.5 rounded-full border border-neutral-200 text-black hover:bg-neutral-50 transition-colors outline-none text-xs tracking-wide"
|
|
4587
|
+
},
|
|
4588
|
+
"Cancel"
|
|
4589
|
+
))) : isLoading ? /* @__PURE__ */ React46.createElement(PageSpinner6, null) : /* @__PURE__ */ React46.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ React46.createElement("div", null, departments.length === 0 ? /* @__PURE__ */ React46.createElement("p", { className: "text-[12px] text-neutral-400 py-6 text-center" }, "No departments available") : departments.map((dept) => /* @__PURE__ */ React46.createElement(
|
|
4531
4590
|
"div",
|
|
4532
4591
|
{
|
|
4533
4592
|
key: dept.id,
|
|
4534
4593
|
onClick: () => onDepartmentClick(dept.id),
|
|
4535
4594
|
className: "flex flex-col py-4 hover:bg-neutral-50 transition-colors cursor-pointer group min-w-0 px-3 -mx-3 rounded-xl gap-2"
|
|
4536
4595
|
},
|
|
4537
|
-
/* @__PURE__ */ React46.createElement("p", { className: "text-[
|
|
4596
|
+
/* @__PURE__ */ React46.createElement("p", { className: "text-[12px] text-black tracking-tight truncate" }, dept.name),
|
|
4538
4597
|
/* @__PURE__ */ React46.createElement("div", { className: "flex items-center gap-3 min-w-0" }, dept.avatars && dept.avatars.length > 0 && /* @__PURE__ */ React46.createElement("div", { className: "flex items-center -space-x-2 shrink-0" }, dept.avatars.slice(0, 4).map((src, idx) => /* @__PURE__ */ React46.createElement("div", { key: idx, className: "w-7 h-7 rounded-lg border-2 border-white bg-neutral-100 overflow-hidden shrink-0" }, /* @__PURE__ */ React46.createElement(
|
|
4539
4598
|
"img",
|
|
4540
4599
|
{
|
|
@@ -4543,7 +4602,7 @@ var UniversalDepartmentsPage = ({
|
|
|
4543
4602
|
className: "w-full h-full object-cover"
|
|
4544
4603
|
}
|
|
4545
4604
|
)))), dept.totalMembers > 0 ? /* @__PURE__ */ React46.createElement("span", { className: "text-[11px] text-neutral-500 truncate block" }, formatMembersCount(dept.totalMembers), " ", dept.totalMembers > 4 ? "+" : "") : /* @__PURE__ */ React46.createElement("span", { className: "text-[11px] text-neutral-400 truncate block" }, "Empty"))
|
|
4546
|
-
))), /* @__PURE__ */ React46.createElement("div", { className: "flex items-center justify-between pt-6 mt-2" }, /* @__PURE__ */ React46.createElement("span", { className: "text-[11px] text-neutral-400 tracking-[0.2em]" }, "Page ", currentPage, " of ", totalPages === 0 ? 1 : totalPages), /* @__PURE__ */ React46.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React46.createElement(
|
|
4605
|
+
))), /* @__PURE__ */ React46.createElement("div", { className: "flex items-center justify-between pt-6 mt-2 " }, /* @__PURE__ */ React46.createElement("span", { className: "text-[11px] text-neutral-400 tracking-[0.2em]" }, "Page ", currentPage, " of ", totalPages === 0 ? 1 : totalPages), /* @__PURE__ */ React46.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React46.createElement(
|
|
4547
4606
|
"button",
|
|
4548
4607
|
{
|
|
4549
4608
|
onClick: () => onPageChange(currentPage - 1),
|
|
@@ -4563,9 +4622,9 @@ var UniversalDepartmentsPage = ({
|
|
|
4563
4622
|
};
|
|
4564
4623
|
|
|
4565
4624
|
// src/components/UniversalMembersPage.tsx
|
|
4566
|
-
import React47, { useState as
|
|
4625
|
+
import React47, { useState as useState33, useEffect as useEffect18, useRef as useRef12 } from "react";
|
|
4567
4626
|
import { HugeiconsIcon as HugeiconsIcon33 } from "@hugeicons/react";
|
|
4568
|
-
import
|
|
4627
|
+
import toast13 from "react-hot-toast";
|
|
4569
4628
|
import {
|
|
4570
4629
|
ArrowLeft01Icon as ArrowLeft01Icon14,
|
|
4571
4630
|
ArrowRight01Icon as ArrowRight01Icon10,
|
|
@@ -4575,8 +4634,8 @@ import {
|
|
|
4575
4634
|
ListSettingIcon as ListSettingIcon2
|
|
4576
4635
|
} from "@hugeicons/core-free-icons";
|
|
4577
4636
|
var MemberAvatar = ({ src, status }) => {
|
|
4578
|
-
const [loaded, setLoaded] =
|
|
4579
|
-
const [error, setError] =
|
|
4637
|
+
const [loaded, setLoaded] = useState33(false);
|
|
4638
|
+
const [error, setError] = useState33(false);
|
|
4580
4639
|
const defaultAvatar = "https://storage.googleapis.com/retina-cloud-v2/assets/images/avatar.avif";
|
|
4581
4640
|
const finalSrc = error || !src ? defaultAvatar : src;
|
|
4582
4641
|
const getStatusColor = () => {
|
|
@@ -4624,16 +4683,16 @@ var UniversalMembersPage = ({
|
|
|
4624
4683
|
onRemoveMember,
|
|
4625
4684
|
onInviteMember
|
|
4626
4685
|
}) => {
|
|
4627
|
-
const [expandedId, setExpandedId] =
|
|
4628
|
-
const [memberToRemove, setMemberToRemove] =
|
|
4629
|
-
const [isRemoving, setIsRemoving] =
|
|
4630
|
-
const [isInviteMode, setIsInviteMode] =
|
|
4631
|
-
const [inviteEmail, setInviteEmail] =
|
|
4632
|
-
const [isInviting, setIsInviting] =
|
|
4633
|
-
const [localSearchQuery, setLocalSearchQuery] =
|
|
4634
|
-
const [isTyping, setIsTyping] =
|
|
4635
|
-
const [isStatusModalOpen, setIsStatusModalOpen] =
|
|
4636
|
-
const [isRoleModalOpen, setIsRoleModalOpen] =
|
|
4686
|
+
const [expandedId, setExpandedId] = useState33(null);
|
|
4687
|
+
const [memberToRemove, setMemberToRemove] = useState33(null);
|
|
4688
|
+
const [isRemoving, setIsRemoving] = useState33(false);
|
|
4689
|
+
const [isInviteMode, setIsInviteMode] = useState33(false);
|
|
4690
|
+
const [inviteEmail, setInviteEmail] = useState33("");
|
|
4691
|
+
const [isInviting, setIsInviting] = useState33(false);
|
|
4692
|
+
const [localSearchQuery, setLocalSearchQuery] = useState33(searchQuery);
|
|
4693
|
+
const [isTyping, setIsTyping] = useState33(false);
|
|
4694
|
+
const [isStatusModalOpen, setIsStatusModalOpen] = useState33(false);
|
|
4695
|
+
const [isRoleModalOpen, setIsRoleModalOpen] = useState33(false);
|
|
4637
4696
|
const statusDropdownRef = useRef12(null);
|
|
4638
4697
|
const roleDropdownRef = useRef12(null);
|
|
4639
4698
|
const cleanEmailId = (val) => val.toLowerCase().replace(/[^a-z0-9@._-]/g, "");
|
|
@@ -4667,11 +4726,11 @@ var UniversalMembersPage = ({
|
|
|
4667
4726
|
setIsRemoving(true);
|
|
4668
4727
|
try {
|
|
4669
4728
|
await onRemoveMember(memberToRemove.id);
|
|
4670
|
-
|
|
4729
|
+
toast13.success("Member removed successfully.");
|
|
4671
4730
|
setExpandedId(null);
|
|
4672
4731
|
setMemberToRemove(null);
|
|
4673
4732
|
} catch (error) {
|
|
4674
|
-
|
|
4733
|
+
toast13.error("Failed to remove member.");
|
|
4675
4734
|
} finally {
|
|
4676
4735
|
setIsRemoving(false);
|
|
4677
4736
|
}
|
|
@@ -4685,7 +4744,7 @@ var UniversalMembersPage = ({
|
|
|
4685
4744
|
setInviteEmail("");
|
|
4686
4745
|
setIsInviteMode(false);
|
|
4687
4746
|
} catch (error) {
|
|
4688
|
-
|
|
4747
|
+
toast13.error(error.message || "Failed to send invitation.");
|
|
4689
4748
|
} finally {
|
|
4690
4749
|
setIsInviting(false);
|
|
4691
4750
|
}
|
|
@@ -4829,10 +4888,10 @@ var UniversalMembersPage = ({
|
|
|
4829
4888
|
};
|
|
4830
4889
|
|
|
4831
4890
|
// src/components/UniversalHome2.tsx
|
|
4832
|
-
import React48, { useState as
|
|
4891
|
+
import React48, { useState as useState34 } from "react";
|
|
4833
4892
|
import { useRouter as useRouter3 } from "next/navigation";
|
|
4834
4893
|
import { HugeiconsIcon as HugeiconsIcon34 } from "@hugeicons/react";
|
|
4835
|
-
import
|
|
4894
|
+
import toast14 from "react-hot-toast";
|
|
4836
4895
|
import {
|
|
4837
4896
|
Loading03Icon as Loading03Icon22,
|
|
4838
4897
|
Notification01Icon as Notification01Icon2,
|
|
@@ -4840,11 +4899,14 @@ import {
|
|
|
4840
4899
|
ArrowRight01Icon as ArrowRight01Icon11,
|
|
4841
4900
|
CancelCircleIcon as CancelCircleIcon9,
|
|
4842
4901
|
ArrowUpRight01Icon as ArrowUpRight01Icon3,
|
|
4843
|
-
|
|
4902
|
+
Settings03Icon
|
|
4844
4903
|
} from "@hugeicons/core-free-icons";
|
|
4845
4904
|
var UniversalHome2 = ({
|
|
4846
4905
|
avatarSrc,
|
|
4847
4906
|
userStatus = "ACTIVE",
|
|
4907
|
+
organizations = [],
|
|
4908
|
+
activeOrgId,
|
|
4909
|
+
onOrganizationSelect,
|
|
4848
4910
|
barIcons = [],
|
|
4849
4911
|
createHuddleAction,
|
|
4850
4912
|
joinHuddleAction,
|
|
@@ -4859,10 +4921,11 @@ var UniversalHome2 = ({
|
|
|
4859
4921
|
customContent,
|
|
4860
4922
|
departmentsProps
|
|
4861
4923
|
}) => {
|
|
4862
|
-
const [isAvatarLoaded, setIsAvatarLoaded] =
|
|
4863
|
-
const [showNotifDialog, setShowNotifDialog] =
|
|
4864
|
-
const [
|
|
4865
|
-
const [
|
|
4924
|
+
const [isAvatarLoaded, setIsAvatarLoaded] = useState34(false);
|
|
4925
|
+
const [showNotifDialog, setShowNotifDialog] = useState34(false);
|
|
4926
|
+
const [showOrgSwitcher, setShowOrgSwitcher] = useState34(false);
|
|
4927
|
+
const [selectedNotif, setSelectedNotif] = useState34(null);
|
|
4928
|
+
const [isResolving, setIsResolving] = useState34(false);
|
|
4866
4929
|
const router = useRouter3();
|
|
4867
4930
|
const fallbackAvatarUrl = "https://storage.googleapis.com/retina-cloud-v2/assets/images/avatar.avif";
|
|
4868
4931
|
const finalAvatarSrc = avatarSrc || fallbackAvatarUrl;
|
|
@@ -4889,12 +4952,12 @@ var UniversalHome2 = ({
|
|
|
4889
4952
|
setShowNotifDialog(false);
|
|
4890
4953
|
setSelectedNotif(null);
|
|
4891
4954
|
} catch (error) {
|
|
4892
|
-
|
|
4955
|
+
toast14.error("Failed to process invitation");
|
|
4893
4956
|
} finally {
|
|
4894
4957
|
setIsResolving(false);
|
|
4895
4958
|
}
|
|
4896
4959
|
};
|
|
4897
|
-
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("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: () =>
|
|
4960
|
+
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("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(
|
|
4898
4961
|
"img",
|
|
4899
4962
|
{
|
|
4900
4963
|
src: finalAvatarSrc,
|
|
@@ -4902,13 +4965,13 @@ var UniversalHome2 = ({
|
|
|
4902
4965
|
onLoad: () => setIsAvatarLoaded(true),
|
|
4903
4966
|
className: `w-full h-full object-cover transition-opacity duration-300 ${isAvatarLoaded ? "opacity-100" : "opacity-0"}`
|
|
4904
4967
|
}
|
|
4905
|
-
))), /* @__PURE__ */ React48.createElement("div", { className: "flex
|
|
4968
|
+
))), /* @__PURE__ */ React48.createElement("div", { className: "flex items-center gap-2 shrink-0" }, /* @__PURE__ */ React48.createElement(
|
|
4906
4969
|
"button",
|
|
4907
4970
|
{
|
|
4908
4971
|
onClick: () => router.push("/app/settings"),
|
|
4909
4972
|
className: "relative w-10 h-10 flex items-center justify-center rounded-full bg-white outline-none hover:bg-neutral-50 transition-colors"
|
|
4910
4973
|
},
|
|
4911
|
-
/* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon:
|
|
4974
|
+
/* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: Settings03Icon, size: 20, className: "text-black" })
|
|
4912
4975
|
), /* @__PURE__ */ React48.createElement(
|
|
4913
4976
|
"button",
|
|
4914
4977
|
{
|
|
@@ -4955,7 +5018,19 @@ var UniversalHome2 = ({
|
|
|
4955
5018
|
{
|
|
4956
5019
|
...departmentsProps
|
|
4957
5020
|
}
|
|
4958
|
-
)),
|
|
5021
|
+
)), 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 border-b border-neutral-100" }, /* @__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: CancelCircleIcon9, 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(
|
|
5022
|
+
"button",
|
|
5023
|
+
{
|
|
5024
|
+
key: org.id,
|
|
5025
|
+
onClick: () => {
|
|
5026
|
+
onOrganizationSelect?.(org.id);
|
|
5027
|
+
setShowOrgSwitcher(false);
|
|
5028
|
+
},
|
|
5029
|
+
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"}`
|
|
5030
|
+
},
|
|
5031
|
+
/* @__PURE__ */ React48.createElement("span", { className: `text-[13px] tracking-tight ${activeOrgId === org.id ? "text-black " : "text-neutral-600"}` }, org.name),
|
|
5032
|
+
activeOrgId === org.id && /* @__PURE__ */ React48.createElement("div", { className: "w-2 h-2 rounded-full bg-emerald-500" })
|
|
5033
|
+
)))))), 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: CancelCircleIcon9, 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(
|
|
4959
5034
|
"button",
|
|
4960
5035
|
{
|
|
4961
5036
|
onClick: () => handleResolve("ACCEPTED"),
|
|
@@ -5001,6 +5076,438 @@ var UniversalHome2 = ({
|
|
|
5001
5076
|
/* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: ArrowRight01Icon11, size: 12 })
|
|
5002
5077
|
))))));
|
|
5003
5078
|
};
|
|
5079
|
+
|
|
5080
|
+
// src/components/UniversalSettings.tsx
|
|
5081
|
+
import React49, { useState as useState35, useEffect as useEffect19, useRef as useRef13 } from "react";
|
|
5082
|
+
import toast15 from "react-hot-toast";
|
|
5083
|
+
import { HugeiconsIcon as HugeiconsIcon35 } from "@hugeicons/react";
|
|
5084
|
+
import {
|
|
5085
|
+
ArrowLeft01Icon as ArrowLeft01Icon16,
|
|
5086
|
+
ArrowRight01Icon as ArrowRight01Icon12,
|
|
5087
|
+
Loading03Icon as Loading03Icon23,
|
|
5088
|
+
Search01Icon as Search01Icon4,
|
|
5089
|
+
SearchList02Icon as SearchList02Icon3,
|
|
5090
|
+
ListSettingIcon as ListSettingIcon3,
|
|
5091
|
+
CircleLock02Icon as CircleLock02Icon3,
|
|
5092
|
+
Coins01Icon
|
|
5093
|
+
} from "@hugeicons/core-free-icons";
|
|
5094
|
+
var MemberAvatar2 = ({ src, status, sizeClass = "w-10 h-10" }) => {
|
|
5095
|
+
const [loaded, setLoaded] = useState35(false);
|
|
5096
|
+
const [error, setError] = useState35(false);
|
|
5097
|
+
const defaultAvatar = "https://storage.googleapis.com/retina-cloud-v2/assets/images/avatar.avif";
|
|
5098
|
+
const finalSrc = error || !src ? defaultAvatar : src;
|
|
5099
|
+
const getStatusColor = () => {
|
|
5100
|
+
switch (status?.toUpperCase()) {
|
|
5101
|
+
case "ACTIVE":
|
|
5102
|
+
return "bg-emerald-500";
|
|
5103
|
+
case "BUSY":
|
|
5104
|
+
return "bg-amber-500";
|
|
5105
|
+
case "OFFLINE":
|
|
5106
|
+
return "bg-rose-500";
|
|
5107
|
+
case "AWAY":
|
|
5108
|
+
return "bg-neutral-400";
|
|
5109
|
+
default:
|
|
5110
|
+
return "bg-neutral-200";
|
|
5111
|
+
}
|
|
5112
|
+
};
|
|
5113
|
+
return /* @__PURE__ */ React49.createElement("div", { className: `relative shrink-0 ${sizeClass}` }, /* @__PURE__ */ React49.createElement("div", { className: "w-full h-full rounded-lg bg-neutral-100 flex items-center justify-center overflow-hidden" }, !loaded && !error && /* @__PURE__ */ React49.createElement(HugeiconsIcon35, { icon: Loading03Icon23, className: "animate-spin text-neutral-400 absolute", size: 14 }), /* @__PURE__ */ React49.createElement(
|
|
5114
|
+
"img",
|
|
5115
|
+
{
|
|
5116
|
+
src: finalSrc,
|
|
5117
|
+
alt: "Member Avatar",
|
|
5118
|
+
className: `w-full h-full object-cover transition-opacity duration-300 ${loaded || error ? "opacity-100" : "opacity-0"}`,
|
|
5119
|
+
onLoad: () => setLoaded(true),
|
|
5120
|
+
onError: () => setError(true)
|
|
5121
|
+
}
|
|
5122
|
+
)), /* @__PURE__ */ React49.createElement("div", { className: `absolute -bottom-1 -right-1 w-3.5 h-3.5 rounded-full border-2 border-white z-10 ${getStatusColor()}` }));
|
|
5123
|
+
};
|
|
5124
|
+
var PageSpinner8 = () => /* @__PURE__ */ React49.createElement("div", { className: "flex justify-center items-center py-12" }, /* @__PURE__ */ React49.createElement(HugeiconsIcon35, { icon: Loading03Icon23, size: 32, className: "animate-spin mb-4 text-black" }));
|
|
5125
|
+
var InputSpinner3 = () => /* @__PURE__ */ React49.createElement("svg", { className: "animate-spin h-4 w-4 text-neutral-400", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24" }, /* @__PURE__ */ React49.createElement("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /* @__PURE__ */ React49.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" }));
|
|
5126
|
+
var UniversalSettings = ({
|
|
5127
|
+
accountType,
|
|
5128
|
+
userRole,
|
|
5129
|
+
members = [],
|
|
5130
|
+
isMembersLoading = false,
|
|
5131
|
+
membersCurrentPage = 1,
|
|
5132
|
+
membersTotalPages = 1,
|
|
5133
|
+
onMembersPageChange = () => {
|
|
5134
|
+
},
|
|
5135
|
+
membersSearchQuery = "",
|
|
5136
|
+
onMembersSearchChange = () => {
|
|
5137
|
+
},
|
|
5138
|
+
activeStatusFilter = "ALL",
|
|
5139
|
+
onStatusFilterChange = () => {
|
|
5140
|
+
},
|
|
5141
|
+
activeRoleFilter = "ALL",
|
|
5142
|
+
onRoleFilterChange = () => {
|
|
5143
|
+
},
|
|
5144
|
+
onRemoveMember,
|
|
5145
|
+
onInviteMember,
|
|
5146
|
+
initialDisplayName,
|
|
5147
|
+
initialSlug,
|
|
5148
|
+
slugPrefixUrl = "https://truhuddle.com/company/",
|
|
5149
|
+
onSaveAccount,
|
|
5150
|
+
onCheckSlugAvailability,
|
|
5151
|
+
aiCredits,
|
|
5152
|
+
isBillingLoading = false,
|
|
5153
|
+
onTopUp,
|
|
5154
|
+
onBack
|
|
5155
|
+
}) => {
|
|
5156
|
+
const onBackHandler = onBack ?? (() => {
|
|
5157
|
+
if (typeof window !== "undefined") window.history.back();
|
|
5158
|
+
});
|
|
5159
|
+
const [activeTab, setActiveTab] = useState35(accountType === "ORGANIZATION" ? "MEMBERS" : "ACCOUNT");
|
|
5160
|
+
useEffect19(() => {
|
|
5161
|
+
if (accountType === "INDIVIDUAL" && activeTab === "MEMBERS") {
|
|
5162
|
+
setActiveTab("ACCOUNT");
|
|
5163
|
+
}
|
|
5164
|
+
}, [accountType, activeTab]);
|
|
5165
|
+
const [expandedId, setExpandedId] = useState35(null);
|
|
5166
|
+
const [memberToRemove, setMemberToRemove] = useState35(null);
|
|
5167
|
+
const [isRemoving, setIsRemoving] = useState35(false);
|
|
5168
|
+
const [isInviteMode, setIsInviteMode] = useState35(false);
|
|
5169
|
+
const [inviteEmail, setInviteEmail] = useState35("");
|
|
5170
|
+
const [isInviting, setIsInviting] = useState35(false);
|
|
5171
|
+
const [localSearchQuery, setLocalSearchQuery] = useState35(membersSearchQuery);
|
|
5172
|
+
const [isTyping, setIsTyping] = useState35(false);
|
|
5173
|
+
const [isStatusModalOpen, setIsStatusModalOpen] = useState35(false);
|
|
5174
|
+
const [isRoleModalOpen, setIsRoleModalOpen] = useState35(false);
|
|
5175
|
+
const statusDropdownRef = useRef13(null);
|
|
5176
|
+
const roleDropdownRef = useRef13(null);
|
|
5177
|
+
const [displayName, setDisplayName] = useState35(initialDisplayName);
|
|
5178
|
+
const [slug, setSlug] = useState35(initialSlug);
|
|
5179
|
+
const [isCheckingSlug, setIsCheckingSlug] = useState35(false);
|
|
5180
|
+
const [slugAvailable, setSlugAvailable] = useState35(null);
|
|
5181
|
+
const [isSavingAccount, setIsSavingAccount] = useState35(false);
|
|
5182
|
+
const isAccountReadOnly = accountType === "ORGANIZATION" && userRole !== "ADMIN" && userRole !== "MANAGER";
|
|
5183
|
+
const cleanEmailId = (val) => val.toLowerCase().replace(/[^a-z0-9@._-]/g, "");
|
|
5184
|
+
useEffect19(() => {
|
|
5185
|
+
function handleClickOutside(event) {
|
|
5186
|
+
if (statusDropdownRef.current && !statusDropdownRef.current.contains(event.target)) setIsStatusModalOpen(false);
|
|
5187
|
+
if (roleDropdownRef.current && !roleDropdownRef.current.contains(event.target)) setIsRoleModalOpen(false);
|
|
5188
|
+
}
|
|
5189
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
5190
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
5191
|
+
}, []);
|
|
5192
|
+
useEffect19(() => {
|
|
5193
|
+
if (activeTab !== "MEMBERS") return;
|
|
5194
|
+
setIsTyping(true);
|
|
5195
|
+
const handler = setTimeout(() => {
|
|
5196
|
+
onMembersSearchChange(localSearchQuery);
|
|
5197
|
+
setIsTyping(false);
|
|
5198
|
+
}, 600);
|
|
5199
|
+
return () => clearTimeout(handler);
|
|
5200
|
+
}, [localSearchQuery, onMembersSearchChange, activeTab]);
|
|
5201
|
+
const handleConfirmRemove = async () => {
|
|
5202
|
+
if (!memberToRemove || !onRemoveMember) return;
|
|
5203
|
+
setIsRemoving(true);
|
|
5204
|
+
try {
|
|
5205
|
+
await onRemoveMember(memberToRemove.id);
|
|
5206
|
+
toast15.success("Member removed successfully.");
|
|
5207
|
+
setExpandedId(null);
|
|
5208
|
+
setMemberToRemove(null);
|
|
5209
|
+
} catch (error) {
|
|
5210
|
+
toast15.error("Failed to remove member.");
|
|
5211
|
+
} finally {
|
|
5212
|
+
setIsRemoving(false);
|
|
5213
|
+
}
|
|
5214
|
+
};
|
|
5215
|
+
const handleInviteSubmit = async (e) => {
|
|
5216
|
+
e.preventDefault();
|
|
5217
|
+
if (inviteEmail.length < 5 || isInviting || !onInviteMember) return;
|
|
5218
|
+
setIsInviting(true);
|
|
5219
|
+
try {
|
|
5220
|
+
await onInviteMember(inviteEmail);
|
|
5221
|
+
setInviteEmail("");
|
|
5222
|
+
setIsInviteMode(false);
|
|
5223
|
+
} catch (error) {
|
|
5224
|
+
toast15.error(error.message || "Failed to send invitation.");
|
|
5225
|
+
} finally {
|
|
5226
|
+
setIsInviting(false);
|
|
5227
|
+
}
|
|
5228
|
+
};
|
|
5229
|
+
const activeExpandedMember = expandedId ? members.find((m) => m.id === expandedId) : null;
|
|
5230
|
+
useEffect19(() => {
|
|
5231
|
+
setDisplayName(initialDisplayName || "");
|
|
5232
|
+
setSlug(initialSlug || "");
|
|
5233
|
+
}, [initialDisplayName, initialSlug]);
|
|
5234
|
+
const handleDisplayNameChange = (val) => setDisplayName(val.replace(/[^a-zA-Z0-9\s-]/g, "").substring(0, 50));
|
|
5235
|
+
const handleSlugChange = (val) => setSlug(val.toLowerCase().replace(/[^a-z0-9-]/g, "").replace(/-+/g, "-").substring(0, 50));
|
|
5236
|
+
useEffect19(() => {
|
|
5237
|
+
if (!slug || slug === initialSlug) {
|
|
5238
|
+
setSlugAvailable(null);
|
|
5239
|
+
setIsCheckingSlug(false);
|
|
5240
|
+
return;
|
|
5241
|
+
}
|
|
5242
|
+
if (slug.length < 3) {
|
|
5243
|
+
setSlugAvailable(false);
|
|
5244
|
+
setIsCheckingSlug(false);
|
|
5245
|
+
return;
|
|
5246
|
+
}
|
|
5247
|
+
setIsCheckingSlug(true);
|
|
5248
|
+
setSlugAvailable(null);
|
|
5249
|
+
const checkTimer = setTimeout(async () => {
|
|
5250
|
+
try {
|
|
5251
|
+
if (onCheckSlugAvailability) {
|
|
5252
|
+
const res = await onCheckSlugAvailability(slug);
|
|
5253
|
+
setSlugAvailable(res.available);
|
|
5254
|
+
}
|
|
5255
|
+
} catch (error) {
|
|
5256
|
+
setSlugAvailable(null);
|
|
5257
|
+
} finally {
|
|
5258
|
+
setIsCheckingSlug(false);
|
|
5259
|
+
}
|
|
5260
|
+
}, 1500);
|
|
5261
|
+
return () => clearTimeout(checkTimer);
|
|
5262
|
+
}, [slug, initialSlug, onCheckSlugAvailability]);
|
|
5263
|
+
const handleSaveAccount = async (e) => {
|
|
5264
|
+
e.preventDefault();
|
|
5265
|
+
if (isSavingAccount || isCheckingSlug || isAccountReadOnly || !onSaveAccount) return;
|
|
5266
|
+
if (slug !== initialSlug && slugAvailable === false) {
|
|
5267
|
+
toast15.error("Please select an available address handle.");
|
|
5268
|
+
return;
|
|
5269
|
+
}
|
|
5270
|
+
setIsSavingAccount(true);
|
|
5271
|
+
try {
|
|
5272
|
+
const payload = {
|
|
5273
|
+
displayName: displayName !== initialDisplayName ? displayName : void 0,
|
|
5274
|
+
slug: slug !== initialSlug ? slug : void 0
|
|
5275
|
+
};
|
|
5276
|
+
const res = await onSaveAccount(payload);
|
|
5277
|
+
if (res.success) {
|
|
5278
|
+
toast15.success("Profile updated successfully.");
|
|
5279
|
+
} else {
|
|
5280
|
+
toast15.error(res.error || "Failed to update profile.");
|
|
5281
|
+
}
|
|
5282
|
+
} catch (error) {
|
|
5283
|
+
toast15.error("Service unavailable. Try again later.");
|
|
5284
|
+
} finally {
|
|
5285
|
+
setIsSavingAccount(false);
|
|
5286
|
+
}
|
|
5287
|
+
};
|
|
5288
|
+
const hasAccountChanges = displayName !== initialDisplayName || slug !== initialSlug;
|
|
5289
|
+
const isAccountSaveDisabled = isSavingAccount || isAccountReadOnly || isCheckingSlug || !hasAccountChanges || displayName.length < 3 || slug.length < 3 || slug !== initialSlug && slugAvailable === false;
|
|
5290
|
+
return /* @__PURE__ */ React49.createElement("div", { className: "w-full max-w-3xl mx-auto flex flex-col animate-in fade-in duration-300" }, /* @__PURE__ */ React49.createElement(ManagedToaster, null), /* @__PURE__ */ React49.createElement("div", { className: "mb-6 flex w-full items-center px-1" }, /* @__PURE__ */ React49.createElement("button", { onClick: onBackHandler, className: "flex items-center gap-2 text-neutral-500 hover:text-black transition-colors text-[13px] outline-none" }, /* @__PURE__ */ React49.createElement(HugeiconsIcon35, { icon: ArrowLeft01Icon16, size: 16 }), " Back")), /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col gap-1 mb-8 px-1" }, /* @__PURE__ */ React49.createElement("h1", { className: "text-black text-xl tracking-tight" }, "System Settings"), /* @__PURE__ */ React49.createElement("p", { className: "text-xs text-neutral-500" }, "Manage your workspace identity, team configurations, and AI billing parameters.")), /* @__PURE__ */ React49.createElement("div", { className: "flex items-center gap-6 border-b border-neutral-200 mb-6 overflow-x-auto custom-scrollbar px-1" }, accountType === "ORGANIZATION" && /* @__PURE__ */ React49.createElement(
|
|
5291
|
+
"button",
|
|
5292
|
+
{
|
|
5293
|
+
onClick: () => {
|
|
5294
|
+
setActiveTab("MEMBERS");
|
|
5295
|
+
setExpandedId(null);
|
|
5296
|
+
setIsInviteMode(false);
|
|
5297
|
+
},
|
|
5298
|
+
className: `pb-3 text-[13px] tracking-wide outline-none transition-colors border-b-2 whitespace-nowrap ${activeTab === "MEMBERS" ? "border-black text-black" : "border-transparent text-neutral-500 hover:text-black"}`
|
|
5299
|
+
},
|
|
5300
|
+
"Members"
|
|
5301
|
+
), /* @__PURE__ */ React49.createElement(
|
|
5302
|
+
"button",
|
|
5303
|
+
{
|
|
5304
|
+
onClick: () => setActiveTab("ACCOUNT"),
|
|
5305
|
+
className: `pb-3 text-[13px] tracking-wide outline-none transition-colors border-b-2 whitespace-nowrap ${activeTab === "ACCOUNT" ? "border-black text-black" : "border-transparent text-neutral-500 hover:text-black"}`
|
|
5306
|
+
},
|
|
5307
|
+
"Account Profile"
|
|
5308
|
+
), /* @__PURE__ */ React49.createElement(
|
|
5309
|
+
"button",
|
|
5310
|
+
{
|
|
5311
|
+
onClick: () => setActiveTab("BILLING"),
|
|
5312
|
+
className: `pb-3 text-[13px] tracking-wide outline-none transition-colors border-b-2 whitespace-nowrap ${activeTab === "BILLING" ? "border-black text-black" : "border-transparent text-neutral-500 hover:text-black"}`
|
|
5313
|
+
},
|
|
5314
|
+
"Billing"
|
|
5315
|
+
)), activeTab === "MEMBERS" && accountType === "ORGANIZATION" && /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col animate-in fade-in duration-300" }, /* @__PURE__ */ React49.createElement(
|
|
5316
|
+
ConfirmationDialog,
|
|
5317
|
+
{
|
|
5318
|
+
isOpen: !!memberToRemove,
|
|
5319
|
+
title: "Remove Member",
|
|
5320
|
+
message: `Are you sure you want to remove ${memberToRemove?.name}? This action cannot be undone.`,
|
|
5321
|
+
confirmText: "Remove",
|
|
5322
|
+
cancelText: "Cancel",
|
|
5323
|
+
isProcessing: isRemoving,
|
|
5324
|
+
isDestructive: true,
|
|
5325
|
+
onClose: () => setMemberToRemove(null),
|
|
5326
|
+
onConfirm: handleConfirmRemove
|
|
5327
|
+
}
|
|
5328
|
+
), !isInviteMode && !activeExpandedMember && /* @__PURE__ */ React49.createElement("div", { className: "flex flex-row flex-nowrap mb-4 items-center justify-between gap-4 w-full px-1" }, /* @__PURE__ */ React49.createElement("div", { className: "relative flex-1 min-w-0 max-w-full" }, /* @__PURE__ */ React49.createElement("div", { className: "absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none" }, /* @__PURE__ */ React49.createElement(HugeiconsIcon35, { icon: Search01Icon4, size: 16, className: "text-neutral-400" })), /* @__PURE__ */ React49.createElement(
|
|
5329
|
+
"input",
|
|
5330
|
+
{
|
|
5331
|
+
type: "text",
|
|
5332
|
+
placeholder: "Search members...",
|
|
5333
|
+
value: localSearchQuery,
|
|
5334
|
+
onChange: (e) => setLocalSearchQuery(e.target.value),
|
|
5335
|
+
className: "w-full pl-10 pr-4 py-2 bg-white rounded-full text-[13px] text-black placeholder-neutral-400 outline-none transition-colors focus:border-black"
|
|
5336
|
+
}
|
|
5337
|
+
)), /* @__PURE__ */ React49.createElement("div", { className: "flex items-center gap-3 w-auto pb-0 shrink-0" }, /* @__PURE__ */ React49.createElement(
|
|
5338
|
+
"button",
|
|
5339
|
+
{
|
|
5340
|
+
onClick: () => setIsStatusModalOpen(true),
|
|
5341
|
+
className: "flex items-center justify-center bg-white w-9 h-9 rounded-full text-neutral-500 hover:text-black transition-colors outline-none"
|
|
5342
|
+
},
|
|
5343
|
+
/* @__PURE__ */ React49.createElement(HugeiconsIcon35, { icon: SearchList02Icon3, size: 16 })
|
|
5344
|
+
), /* @__PURE__ */ React49.createElement(
|
|
5345
|
+
"button",
|
|
5346
|
+
{
|
|
5347
|
+
onClick: () => setIsRoleModalOpen(true),
|
|
5348
|
+
className: "flex items-center justify-center bg-white w-9 h-9 rounded-full text-neutral-500 hover:text-black transition-colors outline-none"
|
|
5349
|
+
},
|
|
5350
|
+
/* @__PURE__ */ React49.createElement(HugeiconsIcon35, { icon: ListSettingIcon3, size: 16 })
|
|
5351
|
+
))), /* @__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 border-t border-neutral-100" }, !isAccountReadOnly && /* @__PURE__ */ React49.createElement(
|
|
5352
|
+
"button",
|
|
5353
|
+
{
|
|
5354
|
+
onClick: () => setMemberToRemove(activeExpandedMember),
|
|
5355
|
+
className: "w-full sm:flex-1 py-2.5 bg-white border border-rose-200 text-rose-600 hover:bg-rose-50 rounded-full text-[12px] tracking-wide transition-colors outline-none"
|
|
5356
|
+
},
|
|
5357
|
+
"Remove Access"
|
|
5358
|
+
), /* @__PURE__ */ React49.createElement(
|
|
5359
|
+
"button",
|
|
5360
|
+
{
|
|
5361
|
+
onClick: () => setExpandedId(null),
|
|
5362
|
+
className: "w-full sm:flex-1 py-2.5 bg-white border border-neutral-200 text-black hover:bg-neutral-100 rounded-full text-[12px] tracking-wide transition-colors outline-none"
|
|
5363
|
+
},
|
|
5364
|
+
"Close Profile"
|
|
5365
|
+
))) : (
|
|
5366
|
+
// Standard List & Invite Header
|
|
5367
|
+
/* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col gap-1" }, /* @__PURE__ */ React49.createElement("div", { className: "flex flex-row items-center justify-between gap-4" }, /* @__PURE__ */ React49.createElement("h2", { className: "text-black text-xl tracking-tight" }, isInviteMode ? "Add Member" : "Team Directory"), !isInviteMode && !isAccountReadOnly && /* @__PURE__ */ React49.createElement(
|
|
5368
|
+
"button",
|
|
5369
|
+
{
|
|
5370
|
+
onClick: () => setIsInviteMode(true),
|
|
5371
|
+
className: "shrink-0 px-4 py-1.5 border border-neutral-200 text-black text-[12px] tracking-wide rounded-full hover:bg-neutral-50 transition-colors outline-none"
|
|
5372
|
+
},
|
|
5373
|
+
"Invite Team"
|
|
5374
|
+
)), !isInviteMode && /* @__PURE__ */ React49.createElement("p", { className: "text-[12px] text-neutral-500" }, "Manage members and access controls across your organization.")), /* @__PURE__ */ React49.createElement("div", { className: "w-full overflow-hidden" }, isInviteMode ? /* @__PURE__ */ React49.createElement("form", { onSubmit: handleInviteSubmit, className: "flex flex-col gap-8 animate-in fade-in duration-300" }, /* @__PURE__ */ React49.createElement("div", { className: "space-y-1.5 mt-2" }, /* @__PURE__ */ React49.createElement("label", { className: "text-[11px] text-neutral-400 tracking-[0.2em] block" }, "Email Address"), /* @__PURE__ */ React49.createElement(
|
|
5375
|
+
"input",
|
|
5376
|
+
{
|
|
5377
|
+
type: "email",
|
|
5378
|
+
value: inviteEmail,
|
|
5379
|
+
onChange: (e) => setInviteEmail(cleanEmailId(e.target.value)),
|
|
5380
|
+
required: true,
|
|
5381
|
+
autoFocus: true,
|
|
5382
|
+
className: "w-full px-2 py-3 bg-transparent text-sm border-b border-neutral-200 text-black outline-none focus:border-black transition-all duration-300",
|
|
5383
|
+
placeholder: "name@company.com"
|
|
5384
|
+
}
|
|
5385
|
+
)), /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col gap-3" }, /* @__PURE__ */ React49.createElement(
|
|
5386
|
+
ThreeDActionButton,
|
|
5387
|
+
{
|
|
5388
|
+
type: "submit",
|
|
5389
|
+
disabled: inviteEmail.length < 5 || isInviting,
|
|
5390
|
+
isLoading: isInviting,
|
|
5391
|
+
className: "w-full"
|
|
5392
|
+
},
|
|
5393
|
+
"Send Invitation"
|
|
5394
|
+
), /* @__PURE__ */ React49.createElement(
|
|
5395
|
+
"button",
|
|
5396
|
+
{
|
|
5397
|
+
type: "button",
|
|
5398
|
+
onClick: () => {
|
|
5399
|
+
setIsInviteMode(false);
|
|
5400
|
+
setInviteEmail("");
|
|
5401
|
+
},
|
|
5402
|
+
disabled: isInviting,
|
|
5403
|
+
className: "w-full flex items-center justify-center py-2.5 rounded-full border border-neutral-200 text-black hover:bg-neutral-50 transition-colors outline-none text-xs tracking-wide"
|
|
5404
|
+
},
|
|
5405
|
+
"Cancel"
|
|
5406
|
+
))) : isMembersLoading || isTyping ? /* @__PURE__ */ React49.createElement(PageSpinner8, null) : /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col min-w-0 animate-in fade-in duration-300" }, /* @__PURE__ */ React49.createElement("div", null, members.length === 0 ? /* @__PURE__ */ React49.createElement("p", { className: "text-[12px] text-neutral-400 py-6 text-center" }, "No members found") : members.map((member) => /* @__PURE__ */ React49.createElement(
|
|
5407
|
+
"div",
|
|
5408
|
+
{
|
|
5409
|
+
key: member.id,
|
|
5410
|
+
onClick: () => setExpandedId(member.id),
|
|
5411
|
+
className: "flex items-center justify-between py-3 hover:bg-neutral-50 transition-colors cursor-pointer group min-w-0 px-3 -mx-3 rounded-xl"
|
|
5412
|
+
},
|
|
5413
|
+
/* @__PURE__ */ React49.createElement("div", { className: "flex items-center gap-4 min-w-0 flex-1" }, /* @__PURE__ */ React49.createElement(MemberAvatar2, { src: member.avatarUrl, status: member.status }), /* @__PURE__ */ React49.createElement("div", { className: "min-w-0 flex-1 flex flex-col gap-0.5" }, /* @__PURE__ */ React49.createElement("p", { className: "text-[13px] text-black truncate" }, member.name), /* @__PURE__ */ React49.createElement("p", { className: "text-[11px] text-neutral-500 capitalize truncate" }, member.role.toLowerCase())))
|
|
5414
|
+
))), /* @__PURE__ */ React49.createElement("div", { className: "flex items-center justify-between pt-6 mt-2 " }, /* @__PURE__ */ React49.createElement("span", { className: "text-[11px] text-neutral-400 tracking-[0.2em]" }, "Page ", membersCurrentPage, " of ", membersTotalPages === 0 ? 1 : membersTotalPages), /* @__PURE__ */ React49.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React49.createElement(
|
|
5415
|
+
"button",
|
|
5416
|
+
{
|
|
5417
|
+
onClick: () => onMembersPageChange(membersCurrentPage - 1),
|
|
5418
|
+
disabled: membersCurrentPage <= 1 || isMembersLoading,
|
|
5419
|
+
className: "p-2 bg-white border border-neutral-200 rounded-full text-black hover:bg-neutral-50 disabled:opacity-30 disabled:cursor-not-allowed transition-all outline-none"
|
|
5420
|
+
},
|
|
5421
|
+
/* @__PURE__ */ React49.createElement(HugeiconsIcon35, { icon: ArrowLeft01Icon16, size: 14 })
|
|
5422
|
+
), /* @__PURE__ */ React49.createElement(
|
|
5423
|
+
"button",
|
|
5424
|
+
{
|
|
5425
|
+
onClick: () => onMembersPageChange(membersCurrentPage + 1),
|
|
5426
|
+
disabled: membersCurrentPage >= membersTotalPages || isMembersLoading || membersTotalPages === 0,
|
|
5427
|
+
className: "p-2 bg-white border border-neutral-200 rounded-full text-black hover:bg-neutral-50 disabled:opacity-30 disabled:cursor-not-allowed transition-all outline-none"
|
|
5428
|
+
},
|
|
5429
|
+
/* @__PURE__ */ React49.createElement(HugeiconsIcon35, { icon: ArrowRight01Icon12, size: 14 })
|
|
5430
|
+
))))))
|
|
5431
|
+
)), isStatusModalOpen && /* @__PURE__ */ React49.createElement("div", { className: "fixed inset-0 z-110 flex items-center justify-center p-4" }, /* @__PURE__ */ React49.createElement("div", { className: "absolute inset-0 bg-black/40", onClick: () => setIsStatusModalOpen(false) }), /* @__PURE__ */ React49.createElement("div", { ref: statusDropdownRef, className: "relative w-72 bg-white shadow-2xl rounded-2xl flex flex-col items-center overflow-hidden animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ React49.createElement("div", { className: "p-6 text-center w-full mb-2" }, /* @__PURE__ */ React49.createElement("h3", { className: "text-[14px] text-black tracking-tight" }, "Status Filter")), /* @__PURE__ */ React49.createElement("div", { className: "w-full flex flex-col pl-2 pr-2 gap-1" }, ["ALL", "ACTIVE", "BUSY", "OFFLINE", "AWAY"].map((option) => /* @__PURE__ */ React49.createElement(
|
|
5432
|
+
"button",
|
|
5433
|
+
{
|
|
5434
|
+
key: option,
|
|
5435
|
+
onClick: () => {
|
|
5436
|
+
onStatusFilterChange(option);
|
|
5437
|
+
setIsStatusModalOpen(false);
|
|
5438
|
+
},
|
|
5439
|
+
className: `text-left px-4 py-3 text-[11px] tracking-wide transition-colors rounded-full flex items-center justify-between outline-none ${activeStatusFilter === option ? "bg-neutral-100 text-black" : "text-neutral-500 hover:bg-neutral-50 hover:text-black"}`
|
|
5440
|
+
},
|
|
5441
|
+
/* @__PURE__ */ React49.createElement("span", { className: "truncate pr-2 capitalize" }, option.toLowerCase())
|
|
5442
|
+
))), /* @__PURE__ */ React49.createElement("div", { className: "w-full flex mt-2" }, /* @__PURE__ */ React49.createElement("button", { onClick: () => setIsStatusModalOpen(false), className: "w-full py-4 text-[13px] text-neutral-500 hover:text-black transition-colors outline-none" }, "Cancel")))), isRoleModalOpen && /* @__PURE__ */ React49.createElement("div", { className: "fixed inset-0 z-110 flex items-center justify-center p-4" }, /* @__PURE__ */ React49.createElement("div", { className: "absolute inset-0 bg-black/40", onClick: () => setIsRoleModalOpen(false) }), /* @__PURE__ */ React49.createElement("div", { ref: roleDropdownRef, className: "relative w-72 bg-white shadow-2xl rounded-2xl flex flex-col items-center overflow-hidden animate-in zoom-in-95 duration-200" }, /* @__PURE__ */ React49.createElement("div", { className: "p-6 text-center w-full mb-2" }, /* @__PURE__ */ React49.createElement("h3", { className: "text-[14px] text-black tracking-tight" }, "Role Filter")), /* @__PURE__ */ React49.createElement("div", { className: "w-full flex flex-col pl-2 pr-2 gap-1" }, ["ALL", "ADMIN", "MANAGER", "MEMBER", "GUEST"].map((option) => /* @__PURE__ */ React49.createElement(
|
|
5443
|
+
"button",
|
|
5444
|
+
{
|
|
5445
|
+
key: option,
|
|
5446
|
+
onClick: () => {
|
|
5447
|
+
onRoleFilterChange(option);
|
|
5448
|
+
setIsRoleModalOpen(false);
|
|
5449
|
+
},
|
|
5450
|
+
className: `text-left px-4 py-3 text-[11px] tracking-wide transition-colors rounded-full flex items-center justify-between outline-none ${activeRoleFilter === option ? "bg-neutral-100 text-black" : "text-neutral-500 hover:bg-neutral-50 hover:text-black"}`
|
|
5451
|
+
},
|
|
5452
|
+
/* @__PURE__ */ React49.createElement("span", { className: "truncate pr-2 capitalize" }, option.toLowerCase())
|
|
5453
|
+
))), /* @__PURE__ */ React49.createElement("div", { className: "w-full flex mt-2" }, /* @__PURE__ */ React49.createElement("button", { onClick: () => setIsRoleModalOpen(false), className: "w-full py-4 text-[13px] text-neutral-500 hover:text-black transition-colors outline-none" }, "Cancel"))))), activeTab === "ACCOUNT" && /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col gap-8 animate-in rounded-2xl p-6 bg-white fade-in duration-300" }, /* @__PURE__ */ React49.createElement("div", { className: "flex items-start justify-between gap-4" }, /* @__PURE__ */ React49.createElement("div", null, /* @__PURE__ */ React49.createElement("h2", { className: "text-black text-xl mb-1 tracking-tight" }, "Public Profile"), /* @__PURE__ */ React49.createElement("p", { className: "text-xs text-neutral-500" }, "Manage your workspace identifiers and structural configuration details.")), isAccountReadOnly && /* @__PURE__ */ React49.createElement("span", { className: "p-2 w-9 h-9 bg-neutral-100 text-neutral-400 rounded-full shrink-0" }, /* @__PURE__ */ React49.createElement(HugeiconsIcon35, { icon: CircleLock02Icon3, size: 18, className: "text-current" }))), /* @__PURE__ */ React49.createElement("div", { className: "w-full max-w-5xl" }, /* @__PURE__ */ React49.createElement("form", { className: "flex flex-col gap-8", onSubmit: handleSaveAccount, autoComplete: "off" }, /* @__PURE__ */ React49.createElement(
|
|
5454
|
+
TextInput,
|
|
5455
|
+
{
|
|
5456
|
+
label: "Display Name",
|
|
5457
|
+
value: displayName,
|
|
5458
|
+
onChange: handleDisplayNameChange,
|
|
5459
|
+
disabled: isAccountReadOnly || isSavingAccount,
|
|
5460
|
+
placeholder: "Sovereign User",
|
|
5461
|
+
maxLength: 50
|
|
5462
|
+
}
|
|
5463
|
+
), /* @__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(
|
|
5464
|
+
"input",
|
|
5465
|
+
{
|
|
5466
|
+
type: "text",
|
|
5467
|
+
value: slug,
|
|
5468
|
+
disabled: isAccountReadOnly || isSavingAccount,
|
|
5469
|
+
onChange: (e) => handleSlugChange(e.target.value),
|
|
5470
|
+
spellCheck: "false",
|
|
5471
|
+
autoComplete: "off",
|
|
5472
|
+
className: "w-full pr-10 pl-0 py-3 text-sm bg-transparent text-black outline-none disabled:opacity-50 disabled:cursor-not-allowed",
|
|
5473
|
+
placeholder: "workspace-handle"
|
|
5474
|
+
}
|
|
5475
|
+
), /* @__PURE__ */ React49.createElement("div", { className: "absolute right-2 top-1/2 -translate-y-1/2" }, isCheckingSlug && /* @__PURE__ */ React49.createElement(InputSpinner3, null), !isCheckingSlug && !isAccountReadOnly && slug !== initialSlug && slug.length >= 3 && slugAvailable === false && /* @__PURE__ */ React49.createElement("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-full bg-red-100" }, /* @__PURE__ */ React49.createElement("svg", { className: "w-2 h-2 text-red-600", viewBox: "0 0 20 20", fill: "currentColor" }, /* @__PURE__ */ React49.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 && !isAccountReadOnly && slug !== initialSlug && slug.length >= 3 && slugAvailable === true && /* @__PURE__ */ React49.createElement("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-full bg-green-100" }, /* @__PURE__ */ React49.createElement("svg", { className: "w-2 h-2 text-green-600", viewBox: "0 0 20 20", fill: "currentColor" }, /* @__PURE__ */ React49.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__ */ React49.createElement("div", { className: "pt-8 mt-2 flex items-center gap-4" }, /* @__PURE__ */ React49.createElement(
|
|
5476
|
+
ThreeDActionButton,
|
|
5477
|
+
{
|
|
5478
|
+
type: "submit",
|
|
5479
|
+
disabled: isAccountSaveDisabled,
|
|
5480
|
+
isLoading: isSavingAccount,
|
|
5481
|
+
className: "min-w-32"
|
|
5482
|
+
},
|
|
5483
|
+
"Save Changes"
|
|
5484
|
+
), hasAccountChanges && !isSavingAccount && !isAccountReadOnly && /* @__PURE__ */ React49.createElement(
|
|
5485
|
+
"button",
|
|
5486
|
+
{
|
|
5487
|
+
type: "button",
|
|
5488
|
+
onClick: () => {
|
|
5489
|
+
setDisplayName(initialDisplayName);
|
|
5490
|
+
setSlug(initialSlug);
|
|
5491
|
+
},
|
|
5492
|
+
className: "text-[11px] tracking-widest text-neutral-400 hover:text-black transition-colors outline-none"
|
|
5493
|
+
},
|
|
5494
|
+
"Cancel"
|
|
5495
|
+
))))), activeTab === "BILLING" && /* @__PURE__ */ React49.createElement("div", { className: "flex flex-col animate-in fade-in duration-300" }, /* @__PURE__ */ React49.createElement("div", { className: "bg-[#143731] rounded-3xl p-6 relative overflow-hidden flex flex-col w-full mt-2" }, /* @__PURE__ */ React49.createElement("div", { className: "relative z-10 flex flex-col items-start w-full" }, /* @__PURE__ */ React49.createElement("p", { className: "text-[11px] text-white leading-tight mb-1" }, /* @__PURE__ */ React49.createElement("span", { className: "text-white/60" }, "AI Credits Balance")), isBillingLoading ? /* @__PURE__ */ React49.createElement("div", { className: "h-8 w-32 bg-white/10 animate-pulse rounded mt-2" }) : /* @__PURE__ */ React49.createElement("div", { className: "flex items-center gap-2 mt-1" }, /* @__PURE__ */ React49.createElement(HugeiconsIcon35, { icon: Coins01Icon, size: 24, className: "text-white" }), /* @__PURE__ */ React49.createElement("span", { className: "text-2xl text-white tracking-tight" }, aiCredits)), /* @__PURE__ */ React49.createElement("div", { className: "mt-8 w-full " }, /* @__PURE__ */ React49.createElement(
|
|
5496
|
+
"button",
|
|
5497
|
+
{
|
|
5498
|
+
onClick: onTopUp,
|
|
5499
|
+
className: "px-6 py-2.5 rounded-full border border-white/50 bg-transparent text-white/50 text-[12px] tracking-wide transition-colors outline-none hover:bg-white/10 hover:text-white hover:border-white"
|
|
5500
|
+
},
|
|
5501
|
+
"Top Up Credits"
|
|
5502
|
+
))), /* @__PURE__ */ React49.createElement(
|
|
5503
|
+
"img",
|
|
5504
|
+
{
|
|
5505
|
+
src: "https://storage.googleapis.com/retina-cloud-v2/assets/images/save_box.avif",
|
|
5506
|
+
alt: "Credits",
|
|
5507
|
+
className: "absolute bottom-2 right-2 translate-x-1/4 translate-y-1/2 w-32 h-auto object-contain z-0 pointer-events-none drop-shadow-md opacity-50"
|
|
5508
|
+
}
|
|
5509
|
+
)), /* @__PURE__ */ React49.createElement("div", { className: "mt-4 px-1" }, /* @__PURE__ */ React49.createElement("p", { className: "text-[11px] text-neutral-500 leading-relaxed max-w-lg" }, "AI credits are consumed when generating intelligent summaries, transcriptions, and automated huddle insights. Additional credits are billed dynamically to your primary payment method."))));
|
|
5510
|
+
};
|
|
5004
5511
|
export {
|
|
5005
5512
|
AppBento2,
|
|
5006
5513
|
CardInfoDialog,
|
|
@@ -5046,6 +5553,7 @@ export {
|
|
|
5046
5553
|
UniversalReferralPage,
|
|
5047
5554
|
UniversalRewardPage,
|
|
5048
5555
|
UniversalSecurityPage,
|
|
5556
|
+
UniversalSettings,
|
|
5049
5557
|
UniversalSidebar,
|
|
5050
5558
|
UniversalTransactionPage,
|
|
5051
5559
|
UniversalVerificationPage,
|