@retinalabsllc/zairusjs 16.0.70 → 16.0.90

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.mjs CHANGED
@@ -302,8 +302,8 @@ var InputSpinner = () => /* @__PURE__ */ React5.createElement("svg", { className
302
302
  function AuthFormInner({
303
303
  companyName,
304
304
  workspaceLabel = "Workspace",
305
- termsUrl = "https://truhuddle.com/terms-of-service",
306
- privacyUrl = "https://truhuddle.com/privacy-policy",
305
+ termsUrl = "",
306
+ privacyUrl = "",
307
307
  requireNames = true,
308
308
  requireOrganization = true,
309
309
  useRecaptcha = false,
@@ -317,16 +317,18 @@ function AuthFormInner({
317
317
  const [mode, setMode] = useState3("LOGIN");
318
318
  const [step, setStep] = useState3("INPUT");
319
319
  const getInitialSignupStep = () => {
320
- return "INVITATION";
320
+ if (requireNames) return "NAME";
321
+ if (requireOrganization) return "ORGANIZATION";
322
+ return "EMAIL_ID";
321
323
  };
322
324
  const [signupStep, setSignupStep] = useState3(getInitialSignupStep());
323
325
  const [isSubmitting, setIsSubmitting] = useState3(false);
324
326
  const [countdown, setCountdown] = useState3(0);
325
- const [invitationCode, setInvitationCode] = useState3("");
326
327
  const [emailId, setEmailId] = useState3("");
327
328
  const [firstName, setFirstName] = useState3("");
328
329
  const [lastName, setLastName] = useState3("");
329
330
  const [orgName, setOrgName] = useState3("");
331
+ const [accountType, setAccountType] = useState3("ORGANIZATION");
330
332
  const [agreedToTerms, setAgreedToTerms] = useState3(false);
331
333
  const [userHas2FA, setUserHas2FA] = useState3(false);
332
334
  const [userHasPasskey, setUserHasPasskey] = useState3(false);
@@ -382,8 +384,8 @@ function AuthFormInner({
382
384
  email: emailId,
383
385
  firstName: mode === "SIGNUP" && requireNames ? firstName : void 0,
384
386
  lastName: mode === "SIGNUP" && requireNames ? lastName : void 0,
385
- organizationName: mode === "SIGNUP" && requireOrganization ? orgName : void 0,
386
- r_c: mode === "SIGNUP" && invitationCode.trim() ? invitationCode.trim().toUpperCase() : void 0,
387
+ organizationName: mode === "SIGNUP" && accountType === "ORGANIZATION" ? orgName.trim() : void 0,
388
+ accountType: mode === "SIGNUP" ? accountType : void 0,
387
389
  mode,
388
390
  recaptchaToken
389
391
  });
@@ -439,11 +441,7 @@ function AuthFormInner({
439
441
  }
440
442
  };
441
443
  const handleNextSignupStep = () => {
442
- if (signupStep === "INVITATION") {
443
- if (requireNames) setSignupStep("NAME");
444
- else if (requireOrganization) setSignupStep("ORGANIZATION");
445
- else setSignupStep("EMAIL_ID");
446
- } else if (signupStep === "NAME") {
444
+ if (signupStep === "NAME") {
447
445
  if (requireOrganization) setSignupStep("ORGANIZATION");
448
446
  else setSignupStep("EMAIL_ID");
449
447
  } else if (signupStep === "ORGANIZATION") {
@@ -454,9 +452,8 @@ function AuthFormInner({
454
452
  if (isSubmitting) return true;
455
453
  if (mode === "LOGIN") return emailId.length < 3;
456
454
  if (mode === "SIGNUP") {
457
- if (signupStep === "INVITATION") return invitationCode.trim().length > 0 && invitationCode.trim().length < 3;
458
455
  if (signupStep === "NAME") return firstName.trim() === "" || lastName.trim() === "";
459
- if (signupStep === "ORGANIZATION") return orgName.trim().length < 3;
456
+ if (signupStep === "ORGANIZATION") return accountType === "ORGANIZATION" ? orgName.trim().length < 3 : false;
460
457
  if (signupStep === "EMAIL_ID") return emailId.length < 3 || !agreedToTerms;
461
458
  }
462
459
  return false;
@@ -466,21 +463,26 @@ function AuthFormInner({
466
463
  setSignupStep(getInitialSignupStep());
467
464
  }, className: "text-black transition-colors ml-1" }, "Sign up")) : /* @__PURE__ */ React5.createElement(React5.Fragment, null, "Already have an account? ", /* @__PURE__ */ React5.createElement("button", { type: "button", onClick: () => setMode("LOGIN"), className: "text-black transition-colors ml-1" }, "Log in")))), /* @__PURE__ */ React5.createElement("form", { className: "space-y-6", autoComplete: "off", onSubmit: (e) => {
468
465
  e.preventDefault();
469
- if (mode === "SIGNUP" && signupStep === "INVITATION") handleNextSignupStep();
470
- else if (mode === "SIGNUP" && signupStep === "NAME") handleNextSignupStep();
466
+ if (mode === "SIGNUP" && signupStep === "NAME") handleNextSignupStep();
471
467
  else if (mode === "SIGNUP" && signupStep === "ORGANIZATION") handleNextSignupStep();
472
468
  else handleAuthRequestSubmit();
473
- } }, mode === "SIGNUP" && signupStep === "INVITATION" && /* @__PURE__ */ React5.createElement("div", { className: "flex flex-col gap-6" }, /* @__PURE__ */ React5.createElement("div", { className: "space-y-1.5 relative" }, /* @__PURE__ */ React5.createElement("label", { className: "text-[11px] text-neutral-400 tracking-[0.2em] block " }, "Referral Code"), /* @__PURE__ */ React5.createElement(
474
- "input",
469
+ } }, mode === "SIGNUP" && signupStep === "NAME" && requireNames && /* @__PURE__ */ React5.createElement("div", { className: "flex flex-col gap-6" }, /* @__PURE__ */ React5.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React5.createElement("label", { className: "text-[11px] text-neutral-400 tracking-[0.2em] block " }, "First Name"), /* @__PURE__ */ React5.createElement("input", { type: "text", value: firstName, onChange: (e) => setFirstName(cleanAlpha(e.target.value)), required: true, autoFocus: true, className: "w-full px-2 py-3 text-sm bg-transparent border-b border-neutral-200 text-black outline-none focus:border-black transition-all duration-300", placeholder: "First name" })), /* @__PURE__ */ React5.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React5.createElement("label", { className: "text-[11px] text-neutral-400 tracking-[0.2em] block " }, "Last Name"), /* @__PURE__ */ React5.createElement("input", { type: "text", value: lastName, onChange: (e) => setLastName(cleanAlpha(e.target.value)), required: true, 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", placeholder: "Last name" }))), mode === "SIGNUP" && signupStep === "ORGANIZATION" && requireOrganization && /* @__PURE__ */ React5.createElement("div", { className: "flex flex-col gap-6" }, /* @__PURE__ */ React5.createElement("div", { className: "flex bg-neutral-100 p-1 rounded-lg" }, /* @__PURE__ */ React5.createElement(
470
+ "button",
475
471
  {
476
- type: "text",
477
- value: invitationCode,
478
- onChange: (e) => setInvitationCode(e.target.value.toUpperCase().replace(/[^A-Z0-9]/g, "")),
479
- autoFocus: true,
480
- className: "w-full px-2 py-3 text-sm bg-transparent border-b border-neutral-200 text-black outline-none focus:border-black transition-all duration-300 tracking-widest",
481
- placeholder: "Referral Code (Optional)"
482
- }
483
- ))), mode === "SIGNUP" && signupStep === "NAME" && requireNames && /* @__PURE__ */ React5.createElement("div", { className: "flex flex-col gap-6" }, /* @__PURE__ */ React5.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React5.createElement("label", { className: "text-[11px] text-neutral-400 tracking-[0.2em] block " }, "First Name"), /* @__PURE__ */ React5.createElement("input", { type: "text", value: firstName, onChange: (e) => setFirstName(cleanAlpha(e.target.value)), required: true, autoFocus: true, className: "w-full px-2 py-3 text-sm bg-transparent border-b border-neutral-200 text-black outline-none focus:border-black transition-all duration-300", placeholder: "First name" })), /* @__PURE__ */ React5.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React5.createElement("label", { className: "text-[11px] text-neutral-400 tracking-[0.2em] block " }, "Last Name"), /* @__PURE__ */ React5.createElement("input", { type: "text", value: lastName, onChange: (e) => setLastName(cleanAlpha(e.target.value)), required: true, 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", placeholder: "Last name" }))), mode === "SIGNUP" && signupStep === "ORGANIZATION" && requireOrganization && /* @__PURE__ */ React5.createElement("div", { className: "flex flex-col gap-6" }, /* @__PURE__ */ React5.createElement("div", { className: "space-y-1.5 relative" }, /* @__PURE__ */ React5.createElement("label", { className: "text-[11px] text-neutral-400 tracking-[0.2em] block " }, "Organization Name"), /* @__PURE__ */ React5.createElement("input", { type: "text", value: orgName, onChange: (e) => setOrgName(cleanOrgName(e.target.value)), required: true, autoFocus: true, className: "w-full px-2 py-3 text-sm bg-transparent border-b border-neutral-200 text-black outline-none focus:border-black transition-all duration-300", placeholder: "Acme Corporation" }))), (mode === "LOGIN" || mode === "SIGNUP" && signupStep === "EMAIL_ID") && /* @__PURE__ */ React5.createElement("div", { className: "space-y-6" }, /* @__PURE__ */ React5.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React5.createElement("label", { className: "text-[11px] text-neutral-400 tracking-[0.2em] block " }, "Email ID"), /* @__PURE__ */ React5.createElement("input", { type: "email", value: emailId, onChange: (e) => setEmailId(cleanEmailId(e.target.value)), required: true, autoFocus: true, 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", placeholder: "name@company.com" })), mode === "SIGNUP" && /* @__PURE__ */ React5.createElement("div", { className: "flex items-start gap-3 mt-4" }, /* @__PURE__ */ React5.createElement("input", { type: "checkbox", id: "zairus-terms", checked: agreedToTerms, onChange: (e) => setAgreedToTerms(e.target.checked), className: "mt-0.5 w-4 h-4 bg-white border-neutral-300 rounded text-black focus:ring-black cursor-pointer", required: true }), /* @__PURE__ */ React5.createElement("label", { htmlFor: "zairus-terms", className: "text-[11px] text-neutral-500 cursor-pointer leading-snug" }, "I agree to ", companyName, "'s ", /* @__PURE__ */ React5.createElement("a", { href: termsUrl, target: "_blank", rel: "noreferrer", className: "text-black underline " }, "Terms of Service"), " and ", /* @__PURE__ */ React5.createElement("a", { href: privacyUrl, target: "_blank", rel: "noreferrer", className: "text-black underline " }, "Privacy Policy"), "."))), /* @__PURE__ */ React5.createElement(ThreeDActionButton, { type: "submit", disabled: isContinueDisabled(), isLoading: isSubmitting, className: "w-full mt-10" }, "Continue"))), step === "OTP" && /* @__PURE__ */ React5.createElement("div", { className: "animate-in fade-in duration-300" }, /* @__PURE__ */ React5.createElement("div", { className: "text-center mb-10 mt-2" }, /* @__PURE__ */ React5.createElement("h2", { className: "text-xl text-black mb-2 tracking-tight" }, "Security Check"), /* @__PURE__ */ React5.createElement("p", { className: "text-[13px] text-neutral-500" }, userHas2FA ? "Enter the code from your authenticator app." : `Enter the code sent to ${emailId}`)), /* @__PURE__ */ React5.createElement("form", { className: "space-y-8", autoComplete: "off", onSubmit: (e) => {
472
+ type: "button",
473
+ onClick: () => setAccountType("INDIVIDUAL"),
474
+ className: `flex-1 py-2 text-xs rounded-md transition-colors outline-none ${accountType === "INDIVIDUAL" ? "bg-white shadow-sm text-black" : "text-neutral-500 hover:text-black"}`
475
+ },
476
+ "Personal"
477
+ ), /* @__PURE__ */ React5.createElement(
478
+ "button",
479
+ {
480
+ type: "button",
481
+ onClick: () => setAccountType("ORGANIZATION"),
482
+ className: `flex-1 py-2 text-xs rounded-md transition-colors outline-none ${accountType === "ORGANIZATION" ? "bg-white shadow-sm text-black" : "text-neutral-500 hover:text-black"}`
483
+ },
484
+ "Organization"
485
+ )), accountType === "ORGANIZATION" && /* @__PURE__ */ React5.createElement("div", { className: "space-y-1.5 relative animate-in fade-in zoom-in-95 duration-200" }, /* @__PURE__ */ React5.createElement("label", { className: "text-[11px] text-neutral-400 tracking-[0.2em] block " }, "Organization Name"), /* @__PURE__ */ React5.createElement("input", { type: "text", value: orgName, onChange: (e) => setOrgName(cleanOrgName(e.target.value)), required: true, autoFocus: true, className: "w-full px-2 py-3 text-sm bg-transparent border-b border-neutral-200 text-black outline-none focus:border-black transition-all duration-300", placeholder: "Acme Corporation" })), accountType === "INDIVIDUAL" && /* @__PURE__ */ React5.createElement("div", { className: "py-4 text-center animate-in fade-in duration-200" }, /* @__PURE__ */ React5.createElement("p", { className: "text-[13px] text-neutral-500" }, "You are creating a personal account. You can join organizations later."))), (mode === "LOGIN" || mode === "SIGNUP" && signupStep === "EMAIL_ID") && /* @__PURE__ */ React5.createElement("div", { className: "space-y-6" }, /* @__PURE__ */ React5.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React5.createElement("label", { className: "text-[11px] text-neutral-400 tracking-[0.2em] block " }, "Email ID"), /* @__PURE__ */ React5.createElement("input", { type: "email", value: emailId, onChange: (e) => setEmailId(cleanEmailId(e.target.value)), required: true, autoFocus: true, 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", placeholder: "name@company.com" })), mode === "SIGNUP" && /* @__PURE__ */ React5.createElement("div", { className: "flex items-start gap-3 mt-4" }, /* @__PURE__ */ React5.createElement("input", { type: "checkbox", id: "zairus-terms", checked: agreedToTerms, onChange: (e) => setAgreedToTerms(e.target.checked), className: "mt-0.5 w-4 h-4 bg-white border-neutral-300 rounded text-black focus:ring-black cursor-pointer", required: true }), /* @__PURE__ */ React5.createElement("label", { htmlFor: "zairus-terms", className: "text-[11px] text-neutral-500 cursor-pointer leading-snug" }, "I agree to ", companyName, "'s ", /* @__PURE__ */ React5.createElement("a", { href: termsUrl, target: "_blank", rel: "noreferrer", className: "text-black underline " }, "Terms of Service"), " and ", /* @__PURE__ */ React5.createElement("a", { href: privacyUrl, target: "_blank", rel: "noreferrer", className: "text-black underline " }, "Privacy Policy"), "."))), /* @__PURE__ */ React5.createElement(ThreeDActionButton, { type: "submit", disabled: isContinueDisabled(), isLoading: isSubmitting, className: "w-full mt-10" }, "Continue"))), step === "OTP" && /* @__PURE__ */ React5.createElement("div", { className: "animate-in fade-in duration-300" }, /* @__PURE__ */ React5.createElement("div", { className: "text-center mb-10 mt-2" }, /* @__PURE__ */ React5.createElement("h2", { className: "text-xl text-black mb-2 tracking-tight" }, "Security Check"), /* @__PURE__ */ React5.createElement("p", { className: "text-[13px] text-neutral-500" }, userHas2FA ? "Enter the code from your authenticator app." : `Enter the code sent to ${emailId}`)), /* @__PURE__ */ React5.createElement("form", { className: "space-y-8", autoComplete: "off", onSubmit: (e) => {
484
486
  e.preventDefault();
485
487
  verifyOtpCode(otp.join(""));
486
488
  } }, /* @__PURE__ */ React5.createElement("div", { className: "flex justify-between gap-2", onPaste: handlePaste }, otp.map((digit, index) => /* @__PURE__ */ React5.createElement(
@@ -505,9 +507,9 @@ function AuthFormInner({
505
507
  {
506
508
  onClick: triggerPasskeyLogin,
507
509
  disabled: isSubmitting,
508
- className: "w-full py-2.5 rounded-full text-black border border-neutral-200 hover:bg-neutral-50 text-xs tracking-wide transition-colors outline-none disabled:opacity-50"
510
+ className: "w-full py-2.5 rounded-full text-black border border-neutral-200 hover:bg-neutral-50 text-xs tracking-wide transition-colors outline-none disabled:opacity-50"
509
511
  },
510
- "Use Passkey / Biometrics"
512
+ "Use Passkey Biometrics"
511
513
  ))))));
512
514
  }
513
515
  var PipleAuth = (props) => {
@@ -4468,6 +4470,388 @@ var UniversalBuyCryptoPage = ({
4468
4470
  );
4469
4471
  }))))));
4470
4472
  };
4473
+
4474
+ // src/components/UniversalDepartmentsPage.tsx
4475
+ import React46 from "react";
4476
+ import { HugeiconsIcon as HugeiconsIcon32 } from "@hugeicons/react";
4477
+ import { ArrowLeft01Icon as ArrowLeft01Icon13, ArrowRight01Icon as ArrowRight01Icon9, Loading03Icon as Loading03Icon20 } from "@hugeicons/core-free-icons";
4478
+ var formatMembersCount = (num) => {
4479
+ if (num >= 1e6) return (num / 1e6).toFixed(1) + "m";
4480
+ if (num >= 1e3) return (num / 1e3).toFixed(1) + "k";
4481
+ return num.toString();
4482
+ };
4483
+ var PageSpinner6 = () => /* @__PURE__ */ React46.createElement("div", { className: "flex justify-center items-center py-12" }, /* @__PURE__ */ React46.createElement(HugeiconsIcon32, { icon: Loading03Icon20, size: 32, className: "animate-spin mb-4 text-black" }));
4484
+ var UniversalDepartmentsPage = ({
4485
+ headerTitle,
4486
+ headerDescription,
4487
+ departments,
4488
+ isLoading,
4489
+ currentPage,
4490
+ totalPages,
4491
+ onPageChange,
4492
+ onDepartmentClick
4493
+ }) => {
4494
+ 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 sm:flex-row sm:items-start justify-between gap-4" }, /* @__PURE__ */ React46.createElement("div", null, /* @__PURE__ */ React46.createElement("h1", { className: "text-black text-xl mb-1 tracking-tight" }, headerTitle), headerDescription && /* @__PURE__ */ React46.createElement("p", { className: "text-[12px] text-neutral-500" }, headerDescription))), /* @__PURE__ */ React46.createElement("div", { className: "w-full overflow-hidden" }, 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(
4495
+ "div",
4496
+ {
4497
+ key: dept.id,
4498
+ onClick: () => onDepartmentClick(dept.id),
4499
+ 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"
4500
+ },
4501
+ /* @__PURE__ */ React46.createElement("p", { className: "text-[14px] text-black tracking-tight truncate" }, dept.name),
4502
+ /* @__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(
4503
+ "img",
4504
+ {
4505
+ src: src || "https://storage.googleapis.com/retina-cloud-v2/assets/images/avatar.avif",
4506
+ alt: "Member",
4507
+ className: "w-full h-full object-cover"
4508
+ }
4509
+ )))), 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"))
4510
+ ))), /* @__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(
4511
+ "button",
4512
+ {
4513
+ onClick: () => onPageChange(currentPage - 1),
4514
+ disabled: currentPage <= 1 || isLoading,
4515
+ 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"
4516
+ },
4517
+ /* @__PURE__ */ React46.createElement(HugeiconsIcon32, { icon: ArrowLeft01Icon13, size: 14 })
4518
+ ), /* @__PURE__ */ React46.createElement(
4519
+ "button",
4520
+ {
4521
+ onClick: () => onPageChange(currentPage + 1),
4522
+ disabled: currentPage >= totalPages || isLoading || totalPages === 0,
4523
+ 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"
4524
+ },
4525
+ /* @__PURE__ */ React46.createElement(HugeiconsIcon32, { icon: ArrowRight01Icon9, size: 14 })
4526
+ )))))));
4527
+ };
4528
+
4529
+ // src/components/UniversalMembersPage.tsx
4530
+ import React47, { useState as useState32, useEffect as useEffect18, useRef as useRef12 } from "react";
4531
+ import { HugeiconsIcon as HugeiconsIcon33 } from "@hugeicons/react";
4532
+ import toast12 from "react-hot-toast";
4533
+ import {
4534
+ ArrowLeft01Icon as ArrowLeft01Icon14,
4535
+ ArrowRight01Icon as ArrowRight01Icon10,
4536
+ Loading03Icon as Loading03Icon21,
4537
+ Search01Icon as Search01Icon3,
4538
+ SearchList02Icon as SearchList02Icon2,
4539
+ ListSettingIcon as ListSettingIcon2
4540
+ } from "@hugeicons/core-free-icons";
4541
+ var MemberAvatar = ({ src, status }) => {
4542
+ const [loaded, setLoaded] = useState32(false);
4543
+ const [error, setError] = useState32(false);
4544
+ const defaultAvatar = "https://storage.googleapis.com/retina-cloud-v2/assets/images/avatar.avif";
4545
+ const finalSrc = error || !src ? defaultAvatar : src;
4546
+ const getStatusColor = () => {
4547
+ switch (status?.toUpperCase()) {
4548
+ case "ACTIVE":
4549
+ return "bg-emerald-500";
4550
+ case "BUSY":
4551
+ return "bg-amber-500";
4552
+ case "OFFLINE":
4553
+ return "bg-rose-500";
4554
+ case "AWAY":
4555
+ return "bg-neutral-400";
4556
+ default:
4557
+ return "bg-neutral-200";
4558
+ }
4559
+ };
4560
+ return /* @__PURE__ */ React47.createElement("div", { className: "relative w-10 h-10 shrink-0" }, /* @__PURE__ */ React47.createElement("div", { className: "w-full h-full rounded-lg bg-neutral-100 flex items-center justify-center overflow-hidden border border-neutral-200" }, !loaded && !error && /* @__PURE__ */ React47.createElement(HugeiconsIcon33, { icon: Loading03Icon21, className: "animate-spin text-neutral-400 absolute", size: 14 }), /* @__PURE__ */ React47.createElement(
4561
+ "img",
4562
+ {
4563
+ src: finalSrc,
4564
+ alt: "Member Avatar",
4565
+ className: `w-full h-full object-cover transition-opacity duration-300 ${loaded || error ? "opacity-100" : "opacity-0"}`,
4566
+ onLoad: () => setLoaded(true),
4567
+ onError: () => setError(true)
4568
+ }
4569
+ )), /* @__PURE__ */ React47.createElement("div", { className: `absolute -bottom-1 -right-1 w-3.5 h-3.5 rounded-full border-2 border-white z-10 ${getStatusColor()}` }));
4570
+ };
4571
+ var PageSpinner7 = () => /* @__PURE__ */ React47.createElement("div", { className: "flex justify-center items-center py-12" }, /* @__PURE__ */ React47.createElement(HugeiconsIcon33, { icon: Loading03Icon21, size: 32, className: "animate-spin mb-4 text-black" }));
4572
+ var UniversalMembersPage = ({
4573
+ headerTitle,
4574
+ headerDescription,
4575
+ members,
4576
+ isLoading,
4577
+ currentPage,
4578
+ totalPages,
4579
+ onPageChange,
4580
+ searchQuery,
4581
+ onSearchChange,
4582
+ activeStatusFilter,
4583
+ onStatusFilterChange,
4584
+ activeRoleFilter,
4585
+ onRoleFilterChange,
4586
+ actionButtonText,
4587
+ hideAction = false,
4588
+ onRemoveMember
4589
+ }) => {
4590
+ const [expandedId, setExpandedId] = useState32(null);
4591
+ const [memberToRemove, setMemberToRemove] = useState32(null);
4592
+ const [isRemoving, setIsRemoving] = useState32(false);
4593
+ const [localSearchQuery, setLocalSearchQuery] = useState32(searchQuery);
4594
+ const [isTyping, setIsTyping] = useState32(false);
4595
+ const [isStatusModalOpen, setIsStatusModalOpen] = useState32(false);
4596
+ const [isRoleModalOpen, setIsRoleModalOpen] = useState32(false);
4597
+ const statusDropdownRef = useRef12(null);
4598
+ const roleDropdownRef = useRef12(null);
4599
+ useEffect18(() => {
4600
+ function handleClickOutside(event) {
4601
+ if (statusDropdownRef.current && !statusDropdownRef.current.contains(event.target)) {
4602
+ setIsStatusModalOpen(false);
4603
+ }
4604
+ if (roleDropdownRef.current && !roleDropdownRef.current.contains(event.target)) {
4605
+ setIsRoleModalOpen(false);
4606
+ }
4607
+ }
4608
+ document.addEventListener("mousedown", handleClickOutside);
4609
+ return () => document.removeEventListener("mousedown", handleClickOutside);
4610
+ }, []);
4611
+ useEffect18(() => {
4612
+ setIsTyping(true);
4613
+ const handler = setTimeout(() => {
4614
+ onSearchChange(localSearchQuery);
4615
+ setIsTyping(false);
4616
+ }, 600);
4617
+ return () => clearTimeout(handler);
4618
+ }, [localSearchQuery, onSearchChange]);
4619
+ useEffect18(() => {
4620
+ if (searchQuery === "" && localSearchQuery !== "") {
4621
+ setLocalSearchQuery("");
4622
+ }
4623
+ }, [searchQuery]);
4624
+ const handleConfirmRemove = async () => {
4625
+ if (!memberToRemove) return;
4626
+ setIsRemoving(true);
4627
+ try {
4628
+ await onRemoveMember(memberToRemove.id);
4629
+ toast12.success("Member removed successfully.");
4630
+ setExpandedId(null);
4631
+ setMemberToRemove(null);
4632
+ } catch (error) {
4633
+ toast12.error("Failed to remove member.");
4634
+ } finally {
4635
+ setIsRemoving(false);
4636
+ }
4637
+ };
4638
+ const isListLoading = isLoading || isTyping;
4639
+ return /* @__PURE__ */ React47.createElement("div", { className: "w-full max-w-3xl mx-auto flex flex-col animate-in fade-in duration-300" }, /* @__PURE__ */ React47.createElement(ManagedToaster, null), /* @__PURE__ */ React47.createElement(
4640
+ ConfirmationDialog,
4641
+ {
4642
+ isOpen: !!memberToRemove,
4643
+ title: "Remove Member",
4644
+ message: `Are you sure you want to remove ${memberToRemove?.name}? This action cannot be undone.`,
4645
+ confirmText: "Remove",
4646
+ cancelText: "Cancel",
4647
+ isProcessing: isRemoving,
4648
+ isDestructive: true,
4649
+ onClose: () => setMemberToRemove(null),
4650
+ onConfirm: handleConfirmRemove
4651
+ }
4652
+ ), /* @__PURE__ */ React47.createElement("div", { className: "flex flex-row flex-nowrap mb-4 items-center justify-between gap-4 w-full" }, /* @__PURE__ */ React47.createElement("div", { className: "relative flex-1 min-w-0 max-w-full" }, /* @__PURE__ */ React47.createElement("div", { className: "absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none" }, /* @__PURE__ */ React47.createElement(HugeiconsIcon33, { icon: Search01Icon3, size: 16, className: "text-neutral-400" })), /* @__PURE__ */ React47.createElement(
4653
+ "input",
4654
+ {
4655
+ type: "text",
4656
+ placeholder: "Search members...",
4657
+ value: localSearchQuery,
4658
+ onChange: (e) => setLocalSearchQuery(e.target.value),
4659
+ 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"
4660
+ }
4661
+ )), /* @__PURE__ */ React47.createElement("div", { className: "flex items-center gap-3 w-auto pb-0 shrink-0" }, /* @__PURE__ */ React47.createElement(
4662
+ "button",
4663
+ {
4664
+ onClick: () => setIsStatusModalOpen(true),
4665
+ className: "flex items-center justify-center bg-white w-9 h-9 rounded-full text-neutral-500 hover:text-black transition-colors outline-none"
4666
+ },
4667
+ /* @__PURE__ */ React47.createElement(HugeiconsIcon33, { icon: SearchList02Icon2, size: 16 })
4668
+ ), /* @__PURE__ */ React47.createElement(
4669
+ "button",
4670
+ {
4671
+ onClick: () => setIsRoleModalOpen(true),
4672
+ className: "flex items-center justify-center bg-white w-9 h-9 rounded-full text-neutral-500 hover:text-black transition-colors outline-none"
4673
+ },
4674
+ /* @__PURE__ */ React47.createElement(HugeiconsIcon33, { icon: ListSettingIcon2, size: 16 })
4675
+ ))), /* @__PURE__ */ React47.createElement("div", { className: "flex flex-col gap-8 p-6 rounded-2xl bg-white w-full" }, /* @__PURE__ */ React47.createElement("div", { className: "flex flex-col sm:flex-row sm:items-start justify-between gap-4" }, /* @__PURE__ */ React47.createElement("div", null, /* @__PURE__ */ React47.createElement("h1", { className: "text-black text-xl mb-1 tracking-tight" }, headerTitle), headerDescription && /* @__PURE__ */ React47.createElement("p", { className: "text-[12px] text-neutral-500" }, headerDescription))), /* @__PURE__ */ React47.createElement("div", { className: "w-full overflow-hidden" }, isListLoading ? /* @__PURE__ */ React47.createElement(PageSpinner7, null) : /* @__PURE__ */ React47.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ React47.createElement("div", null, members.length === 0 ? /* @__PURE__ */ React47.createElement("p", { className: "text-[12px] text-neutral-400 py-6 text-center" }, "No members found") : members.map((member) => /* @__PURE__ */ React47.createElement(React47.Fragment, { key: member.id }, expandedId === member.id ? /* @__PURE__ */ React47.createElement("div", { className: "flex flex-col p-5 bg-neutral-50 rounded-xl animate-in fade-in zoom-in-95 duration-200 gap-5 my-2" }, /* @__PURE__ */ React47.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React47.createElement(MemberAvatar, { src: member.avatarUrl, status: member.status }), /* @__PURE__ */ React47.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ React47.createElement("span", { className: "text-[14px] text-black tracking-tight truncate" }, member.name), /* @__PURE__ */ React47.createElement("span", { className: "text-[12px] text-neutral-500 capitalize" }, member.role.toLowerCase()))), member.departmentName && /* @__PURE__ */ React47.createElement("div", { className: "pt-3 border-t border-neutral-200" }, /* @__PURE__ */ React47.createElement("span", { className: "text-[10px] tracking-[0.2em] text-neutral-400 block mb-1" }, "Department"), /* @__PURE__ */ React47.createElement("span", { className: "text-[13px] text-black truncate block" }, member.departmentName)), /* @__PURE__ */ React47.createElement("div", { className: "flex gap-3 pt-2" }, !hideAction && /* @__PURE__ */ React47.createElement(
4676
+ "button",
4677
+ {
4678
+ onClick: () => setMemberToRemove(member),
4679
+ className: "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"
4680
+ },
4681
+ actionButtonText
4682
+ ), /* @__PURE__ */ React47.createElement(
4683
+ "button",
4684
+ {
4685
+ onClick: () => setExpandedId(null),
4686
+ className: "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"
4687
+ },
4688
+ "Close"
4689
+ ))) : /* @__PURE__ */ React47.createElement(
4690
+ "div",
4691
+ {
4692
+ onClick: () => setExpandedId(member.id),
4693
+ 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"
4694
+ },
4695
+ /* @__PURE__ */ React47.createElement("div", { className: "flex items-center gap-4 min-w-0 flex-1" }, /* @__PURE__ */ React47.createElement(MemberAvatar, { src: member.avatarUrl, status: member.status }), /* @__PURE__ */ React47.createElement("div", { className: "min-w-0 flex-1 flex flex-col gap-0.5" }, /* @__PURE__ */ React47.createElement("p", { className: "text-[13px] text-black truncate" }, member.name), /* @__PURE__ */ React47.createElement("p", { className: "text-[11px] text-neutral-500 capitalize truncate" }, member.role.toLowerCase())))
4696
+ )))), /* @__PURE__ */ React47.createElement("div", { className: "flex items-center justify-between pt-6 mt-2" }, /* @__PURE__ */ React47.createElement("span", { className: "text-[11px] text-neutral-400 tracking-[0.2em]" }, "Page ", currentPage, " of ", totalPages === 0 ? 1 : totalPages), /* @__PURE__ */ React47.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React47.createElement(
4697
+ "button",
4698
+ {
4699
+ onClick: () => onPageChange(currentPage - 1),
4700
+ disabled: currentPage <= 1 || isListLoading,
4701
+ 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"
4702
+ },
4703
+ /* @__PURE__ */ React47.createElement(HugeiconsIcon33, { icon: ArrowLeft01Icon14, size: 14 })
4704
+ ), /* @__PURE__ */ React47.createElement(
4705
+ "button",
4706
+ {
4707
+ onClick: () => onPageChange(currentPage + 1),
4708
+ disabled: currentPage >= totalPages || isListLoading || totalPages === 0,
4709
+ 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"
4710
+ },
4711
+ /* @__PURE__ */ React47.createElement(HugeiconsIcon33, { icon: ArrowRight01Icon10, size: 14 })
4712
+ )))))), isStatusModalOpen && /* @__PURE__ */ React47.createElement("div", { className: "fixed inset-0 z-110 flex items-center justify-center p-4" }, /* @__PURE__ */ React47.createElement("div", { className: "absolute inset-0 bg-black/40", onClick: () => setIsStatusModalOpen(false) }), /* @__PURE__ */ React47.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__ */ React47.createElement("div", { className: "p-6 text-center w-full mb-2" }, /* @__PURE__ */ React47.createElement("h3", { className: "text-[14px] text-black tracking-tight" }, "Status Filter")), /* @__PURE__ */ React47.createElement("div", { className: "w-full flex flex-col pl-2 pr-2 gap-1" }, ["ALL", "ACTIVE", "BUSY", "OFFLINE", "AWAY"].map((option) => /* @__PURE__ */ React47.createElement(
4713
+ "button",
4714
+ {
4715
+ key: option,
4716
+ onClick: () => {
4717
+ onStatusFilterChange(option);
4718
+ setIsStatusModalOpen(false);
4719
+ },
4720
+ 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"}`
4721
+ },
4722
+ /* @__PURE__ */ React47.createElement("span", { className: "truncate pr-2 capitalize" }, option.toLowerCase())
4723
+ ))), /* @__PURE__ */ React47.createElement("div", { className: "w-full flex mt-2" }, /* @__PURE__ */ React47.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__ */ React47.createElement("div", { className: "fixed inset-0 z-110 flex items-center justify-center p-4" }, /* @__PURE__ */ React47.createElement("div", { className: "absolute inset-0 bg-black/40", onClick: () => setIsRoleModalOpen(false) }), /* @__PURE__ */ React47.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__ */ React47.createElement("div", { className: "p-6 text-center w-full mb-2" }, /* @__PURE__ */ React47.createElement("h3", { className: "text-[14px] text-black tracking-tight" }, "Role Filter")), /* @__PURE__ */ React47.createElement("div", { className: "w-full flex flex-col pl-2 pr-2 gap-1" }, ["ALL", "ADMIN", "MANAGER", "MEMBER", "GUEST"].map((option) => /* @__PURE__ */ React47.createElement(
4724
+ "button",
4725
+ {
4726
+ key: option,
4727
+ onClick: () => {
4728
+ onRoleFilterChange(option);
4729
+ setIsRoleModalOpen(false);
4730
+ },
4731
+ 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"}`
4732
+ },
4733
+ /* @__PURE__ */ React47.createElement("span", { className: "truncate pr-2 capitalize" }, option.toLowerCase())
4734
+ ))), /* @__PURE__ */ React47.createElement("div", { className: "w-full flex mt-2" }, /* @__PURE__ */ React47.createElement("button", { onClick: () => setIsRoleModalOpen(false), className: "w-full py-4 text-[13px] text-neutral-500 hover:text-black transition-colors outline-none" }, "Cancel")))));
4735
+ };
4736
+
4737
+ // src/components/UniversalHome2.tsx
4738
+ import React48, { useState as useState33 } from "react";
4739
+ import { useRouter as useRouter3 } from "next/navigation";
4740
+ import { HugeiconsIcon as HugeiconsIcon34 } from "@hugeicons/react";
4741
+ import {
4742
+ Loading03Icon as Loading03Icon22,
4743
+ Notification01Icon as Notification01Icon2,
4744
+ ArrowLeft01Icon as ArrowLeft01Icon15,
4745
+ ArrowRight01Icon as ArrowRight01Icon11,
4746
+ CancelCircleIcon as CancelCircleIcon9,
4747
+ ArrowUpRight01Icon as ArrowUpRight01Icon3
4748
+ } from "@hugeicons/core-free-icons";
4749
+ var UniversalHome2 = ({
4750
+ fullName = "",
4751
+ avatarSrc,
4752
+ createHuddleAction,
4753
+ joinHuddleAction,
4754
+ notifications = [],
4755
+ notificationPage = 1,
4756
+ notificationTotalPages = 1,
4757
+ isNotifsLoading = false,
4758
+ onNotificationPageChange,
4759
+ onNotificationClick,
4760
+ formatNotifDate,
4761
+ customContent,
4762
+ departmentsProps
4763
+ }) => {
4764
+ const [isAvatarLoaded, setIsAvatarLoaded] = useState33(false);
4765
+ const [showNotifDialog, setShowNotifDialog] = useState33(false);
4766
+ const [selectedNotif, setSelectedNotif] = useState33(null);
4767
+ const router = useRouter3();
4768
+ const fallbackAvatarUrl = "https://storage.googleapis.com/retina-cloud-v2/assets/images/avatar.avif";
4769
+ const finalAvatarSrc = avatarSrc || fallbackAvatarUrl;
4770
+ const hasUnreadNotifs = notifications.some((n) => !n.isRead);
4771
+ 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: () => router.push("/app/account/me") }, /* @__PURE__ */ React48.createElement("div", { className: "relative w-full h-full rounded-lg overflow-hidden bg-neutral-100 flex items-center justify-center border border-neutral-200" }, !isAvatarLoaded && /* @__PURE__ */ React48.createElement("div", { className: "absolute inset-0 flex items-center justify-center z-10 bg-neutral-100" }, /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: Loading03Icon22, size: 16, className: "animate-spin text-black" })), /* @__PURE__ */ React48.createElement(
4772
+ "img",
4773
+ {
4774
+ src: finalAvatarSrc,
4775
+ alt: "User Avatar",
4776
+ onLoad: () => setIsAvatarLoaded(true),
4777
+ className: `w-full h-full object-cover transition-opacity duration-300 ${isAvatarLoaded ? "opacity-100" : "opacity-0"}`
4778
+ }
4779
+ ))), /* @__PURE__ */ React48.createElement(
4780
+ "button",
4781
+ {
4782
+ onClick: () => {
4783
+ setShowNotifDialog(true);
4784
+ setSelectedNotif(null);
4785
+ },
4786
+ className: "relative w-10 h-10 flex items-center justify-center rounded-full bg-white outline-none hover:bg-neutral-50 transition-colors"
4787
+ },
4788
+ /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: Notification01Icon2, size: 20, className: "text-black" }),
4789
+ hasUnreadNotifs && /* @__PURE__ */ React48.createElement("span", { className: "absolute top-2.5 right-2.5 w-2 h-2 bg-red-500 rounded-full border border-white" })
4790
+ )), /* @__PURE__ */ React48.createElement("div", { className: "w-full pb-6 flex flex-col gap-4" }, /* @__PURE__ */ React48.createElement("div", { className: "grid grid-cols-2 gap-2" }, /* @__PURE__ */ React48.createElement(
4791
+ "div",
4792
+ {
4793
+ onClick: createHuddleAction?.onClick,
4794
+ className: "bg-[#143731] rounded-2xl p-5 relative overflow-hidden flex flex-col h-32 sm:h-36 cursor-pointer hover:opacity-90 transition-opacity"
4795
+ },
4796
+ /* @__PURE__ */ React48.createElement("div", { className: "relative z-10 flex flex-col h-full justify-between" }, /* @__PURE__ */ React48.createElement("p", { className: "text-[15px] sm:text-[15px] text-white leading-tight" }, "Create", /* @__PURE__ */ React48.createElement("br", null), /* @__PURE__ */ React48.createElement("span", { className: "text-white/70" }, "Huddle")), /* @__PURE__ */ React48.createElement("div", { className: "w-8 h-8 rounded-full bg-white/10 flex items-center justify-center" }, /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: ArrowUpRight01Icon3, size: 16, className: "text-white" }))),
4797
+ /* @__PURE__ */ React48.createElement(
4798
+ "img",
4799
+ {
4800
+ src: "https://storage.googleapis.com/retina-cloud-v2/assets/images/cal_a.avif",
4801
+ alt: "Create Huddle",
4802
+ className: "absolute bottom-4 right-2 translate-x-1/4 translate-y-1/2 w-32 h-auto object-contain z-0 pointer-events-none drop-shadow-md"
4803
+ }
4804
+ )
4805
+ ), /* @__PURE__ */ React48.createElement(
4806
+ "div",
4807
+ {
4808
+ onClick: joinHuddleAction?.onClick,
4809
+ className: "bg-[#ceff8a] rounded-2xl p-5 relative overflow-hidden flex flex-col h-32 sm:h-36 cursor-pointer hover:opacity-90 transition-opacity"
4810
+ },
4811
+ /* @__PURE__ */ React48.createElement("div", { className: "relative z-10 flex flex-col h-full justify-between" }, /* @__PURE__ */ React48.createElement("p", { className: "text-[15px] sm:text-[15px] text-black leading-tight" }, "Join", /* @__PURE__ */ React48.createElement("br", null), /* @__PURE__ */ React48.createElement("span", { className: "text-black/60" }, "Huddle")), /* @__PURE__ */ React48.createElement("div", { className: "w-8 h-8 rounded-full bg-black/5 flex items-center justify-center" }, /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: ArrowRight01Icon11, size: 16, className: "text-black" }))),
4812
+ /* @__PURE__ */ React48.createElement(
4813
+ "img",
4814
+ {
4815
+ src: "https://storage.googleapis.com/retina-cloud-v2/assets/images/cam_a.avif",
4816
+ alt: "Join Huddle",
4817
+ className: "absolute bottom-4 right-2 translate-x-1/4 translate-y-1/2 w-32 h-auto object-contain z-0 pointer-events-none drop-shadow-md"
4818
+ }
4819
+ )
4820
+ ))), customContent && /* @__PURE__ */ React48.createElement("div", { className: "w-full" }, customContent), /* @__PURE__ */ React48.createElement("div", { className: "w-full mt-2" }, /* @__PURE__ */ React48.createElement(
4821
+ UniversalDepartmentsPage,
4822
+ {
4823
+ ...departmentsProps
4824
+ }
4825
+ )), 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), className: "text-neutral-400 hover:text-black transition-colors outline-none flex items-center gap-2 text-[11px] tracking-widest" }, /* @__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), 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" }, 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)) : /* @__PURE__ */ React48.createElement("div", { className: "flex flex-col divide-y divide-neutral-50/50" }, notifications?.length === 0 && !isNotifsLoading ? /* @__PURE__ */ React48.createElement("div", { className: "p-8 text-center text-xs text-neutral-400" }, "You have no notifications.") : notifications?.map((notif) => /* @__PURE__ */ React48.createElement(
4826
+ "div",
4827
+ {
4828
+ key: notif.id,
4829
+ onClick: () => {
4830
+ setSelectedNotif(notif);
4831
+ onNotificationClick?.(notif);
4832
+ },
4833
+ className: `p-3 flex items-start gap-3 rounded-xl cursor-pointer transition-colors ${isNotifsLoading ? "opacity-50 pointer-events-none" : "hover:bg-neutral-50"}`
4834
+ },
4835
+ /* @__PURE__ */ React48.createElement("div", { className: "mt-1.5 shrink-0" }, !notif.isRead ? /* @__PURE__ */ React48.createElement("div", { className: "w-1.5 h-1.5 bg-red-500 rounded-full" }) : /* @__PURE__ */ React48.createElement("div", { className: "w-1.5 h-1.5 bg-transparent" })),
4836
+ /* @__PURE__ */ React48.createElement("div", { className: "flex-1 min-w-0 text-left" }, /* @__PURE__ */ React48.createElement("h5", { className: `text-[12px] truncate ${notif.isRead ? "text-neutral-500" : "text-black"}` }, notif.title), /* @__PURE__ */ React48.createElement("p", { className: "text-[11px] text-neutral-400 truncate mt-0.5" }, notif.message), /* @__PURE__ */ React48.createElement("span", { className: "text-[9px] text-neutral-400 tracking-widest mt-2 block" }, formatNotifDate(notif.createdAt)))
4837
+ )))), !selectedNotif && /* @__PURE__ */ React48.createElement("div", { className: "p-4 flex items-center justify-between shrink-0" }, /* @__PURE__ */ React48.createElement("span", { className: "text-[10px] text-neutral-400 tracking-widest" }, "Page ", notificationPage, " of ", notificationTotalPages === 0 ? 1 : notificationTotalPages), /* @__PURE__ */ React48.createElement("div", { className: "flex gap-1" }, /* @__PURE__ */ React48.createElement(
4838
+ "button",
4839
+ {
4840
+ disabled: notificationPage <= 1 || isNotifsLoading,
4841
+ onClick: () => onNotificationPageChange?.(notificationPage - 1),
4842
+ className: "w-7 h-7 flex items-center justify-center rounded-full bg-white border border-neutral-200 text-neutral-600 disabled:opacity-30 outline-none hover:bg-neutral-50 transition-colors"
4843
+ },
4844
+ /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: ArrowLeft01Icon15, size: 12 })
4845
+ ), /* @__PURE__ */ React48.createElement(
4846
+ "button",
4847
+ {
4848
+ disabled: notificationPage >= notificationTotalPages || notificationTotalPages === 0 || isNotifsLoading,
4849
+ onClick: () => onNotificationPageChange?.(notificationPage + 1),
4850
+ className: "w-7 h-7 flex items-center justify-center rounded-full bg-white border border-neutral-200 text-neutral-600 disabled:opacity-30 outline-none hover:bg-neutral-50 transition-colors"
4851
+ },
4852
+ /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: ArrowRight01Icon11, size: 12 })
4853
+ ))))));
4854
+ };
4471
4855
  export {
4472
4856
  AppBento2,
4473
4857
  CardInfoDialog,
@@ -4502,8 +4886,11 @@ export {
4502
4886
  UniversalBuyCryptoPage,
4503
4887
  UniversalCardActionPage,
4504
4888
  UniversalCardPage,
4889
+ UniversalDepartmentsPage,
4505
4890
  UniversalErrorView,
4891
+ UniversalHome2,
4506
4892
  UniversalHomeView,
4893
+ UniversalMembersPage,
4507
4894
  UniversalOrganizationPage,
4508
4895
  UniversalProfilePage,
4509
4896
  UniversalProfileSettings,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@retinalabsllc/zairusjs",
3
- "version": "16.0.70",
3
+ "version": "16.0.90",
4
4
  "description": "A perceptive, Ai data driven Next.js UI component library.",
5
5
  "author": "Retina Labs Company",
6
6
  "license": "MIT",