@algenium/blocks 1.2.0-rc.1 → 1.2.0-rc.2

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.js CHANGED
@@ -6118,7 +6118,8 @@ function ChatSidebarProvider({
6118
6118
  if (conv && conv.rooms.length === 1) {
6119
6119
  setActiveRoomId(conv.rooms[0].id);
6120
6120
  setView("chat");
6121
- } else if (conv && conv.rooms.length > 1) {
6121
+ } else {
6122
+ setActiveRoomId(null);
6122
6123
  setView("list");
6123
6124
  }
6124
6125
  }
@@ -6792,17 +6793,35 @@ function ChatSidebar({
6792
6793
  selectRoom,
6793
6794
  back
6794
6795
  } = useChatSidebar();
6796
+ useEffect(() => {
6797
+ if (!isOpen || typeof window === "undefined") return;
6798
+ const mq = window.matchMedia("(max-width: 639px)");
6799
+ const apply = () => {
6800
+ if (mq.matches) document.body.style.overflow = "hidden";
6801
+ else document.body.style.overflow = "";
6802
+ };
6803
+ apply();
6804
+ mq.addEventListener("change", apply);
6805
+ return () => {
6806
+ mq.removeEventListener("change", apply);
6807
+ document.body.style.overflow = "";
6808
+ };
6809
+ }, [isOpen]);
6795
6810
  if (!isOpen) return null;
6796
6811
  const getRoomTypeLabel = (type) => {
6797
6812
  if (roomTypeLabel) return roomTypeLabel(type);
6798
6813
  return roomTypeLabels[type] ?? type;
6799
6814
  };
6800
6815
  const activeConversation = activeCaseId ? conversations.find((c) => c.caseId === activeCaseId) : null;
6801
- return /* @__PURE__ */ jsx(
6816
+ const panel = /* @__PURE__ */ jsx(
6802
6817
  "div",
6803
6818
  {
6804
6819
  className: cn(
6805
- "flex h-full w-[360px] flex-col border-l bg-background xl:w-[400px]",
6820
+ "flex min-h-0 flex-col bg-background",
6821
+ // Below sm (~640px): fullscreen overlay drawer above sticky app headers (often z-50)
6822
+ "fixed inset-0 z-[100] w-full max-w-none border-0 shadow-none",
6823
+ // sm+: docked right sidebar in the app shell flex row
6824
+ "sm:relative sm:inset-auto sm:z-auto sm:h-full sm:w-[360px] sm:max-w-[360px] sm:shrink-0 sm:border-l sm:shadow-none xl:w-[400px] xl:max-w-[400px]",
6806
6825
  className
6807
6826
  ),
6808
6827
  children: view === "list" ? /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -6897,6 +6916,17 @@ function ChatSidebar({
6897
6916
  ] })
6898
6917
  }
6899
6918
  );
6919
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
6920
+ /* @__PURE__ */ jsx(
6921
+ "div",
6922
+ {
6923
+ className: "fixed inset-0 z-[90] bg-black/50 sm:hidden",
6924
+ "aria-hidden": true,
6925
+ onClick: close
6926
+ }
6927
+ ),
6928
+ panel
6929
+ ] });
6900
6930
  }
6901
6931
  function formatRelativeTime(dateStr) {
6902
6932
  const date = new Date(dateStr);