@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.cjs CHANGED
@@ -6146,7 +6146,8 @@ function ChatSidebarProvider({
6146
6146
  if (conv && conv.rooms.length === 1) {
6147
6147
  setActiveRoomId(conv.rooms[0].id);
6148
6148
  setView("chat");
6149
- } else if (conv && conv.rooms.length > 1) {
6149
+ } else {
6150
+ setActiveRoomId(null);
6150
6151
  setView("list");
6151
6152
  }
6152
6153
  }
@@ -6820,17 +6821,35 @@ function ChatSidebar({
6820
6821
  selectRoom,
6821
6822
  back
6822
6823
  } = useChatSidebar();
6824
+ React2.useEffect(() => {
6825
+ if (!isOpen || typeof window === "undefined") return;
6826
+ const mq = window.matchMedia("(max-width: 639px)");
6827
+ const apply = () => {
6828
+ if (mq.matches) document.body.style.overflow = "hidden";
6829
+ else document.body.style.overflow = "";
6830
+ };
6831
+ apply();
6832
+ mq.addEventListener("change", apply);
6833
+ return () => {
6834
+ mq.removeEventListener("change", apply);
6835
+ document.body.style.overflow = "";
6836
+ };
6837
+ }, [isOpen]);
6823
6838
  if (!isOpen) return null;
6824
6839
  const getRoomTypeLabel = (type) => {
6825
6840
  if (roomTypeLabel) return roomTypeLabel(type);
6826
6841
  return roomTypeLabels[type] ?? type;
6827
6842
  };
6828
6843
  const activeConversation = activeCaseId ? conversations.find((c) => c.caseId === activeCaseId) : null;
6829
- return /* @__PURE__ */ jsxRuntime.jsx(
6844
+ const panel = /* @__PURE__ */ jsxRuntime.jsx(
6830
6845
  "div",
6831
6846
  {
6832
6847
  className: cn(
6833
- "flex h-full w-[360px] flex-col border-l bg-background xl:w-[400px]",
6848
+ "flex min-h-0 flex-col bg-background",
6849
+ // Below sm (~640px): fullscreen overlay drawer above sticky app headers (often z-50)
6850
+ "fixed inset-0 z-[100] w-full max-w-none border-0 shadow-none",
6851
+ // sm+: docked right sidebar in the app shell flex row
6852
+ "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]",
6834
6853
  className
6835
6854
  ),
6836
6855
  children: view === "list" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -6925,6 +6944,17 @@ function ChatSidebar({
6925
6944
  ] })
6926
6945
  }
6927
6946
  );
6947
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
6948
+ /* @__PURE__ */ jsxRuntime.jsx(
6949
+ "div",
6950
+ {
6951
+ className: "fixed inset-0 z-[90] bg-black/50 sm:hidden",
6952
+ "aria-hidden": true,
6953
+ onClick: close
6954
+ }
6955
+ ),
6956
+ panel
6957
+ ] });
6928
6958
  }
6929
6959
  function formatRelativeTime(dateStr) {
6930
6960
  const date = new Date(dateStr);