@algenium/blocks 1.2.0 → 1.2.1-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 +41 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +41 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -5014,7 +5014,8 @@ function NotificationsWidget({
|
|
|
5014
5014
|
showPulse = true,
|
|
5015
5015
|
soundType = "chime",
|
|
5016
5016
|
pulseStyle = "ring",
|
|
5017
|
-
soundCooldown = 2e3
|
|
5017
|
+
soundCooldown = 2e3,
|
|
5018
|
+
buttonVariant = "default"
|
|
5018
5019
|
}) {
|
|
5019
5020
|
const context = useNotificationsContext();
|
|
5020
5021
|
const notifications = propNotifications ?? context?.notifications ?? [];
|
|
@@ -5192,8 +5193,8 @@ function NotificationsWidget({
|
|
|
5192
5193
|
framerMotion.motion.button,
|
|
5193
5194
|
{
|
|
5194
5195
|
className: cn(
|
|
5195
|
-
"relative inline-flex items-center justify-center rounded-lg",
|
|
5196
|
-
"bg-muted/50 border border-border/50 hover:bg-muted/70
|
|
5196
|
+
"relative inline-flex items-center justify-center rounded-lg transition-colors",
|
|
5197
|
+
buttonVariant === "ghost" ? "hover:bg-accent hover:text-accent-foreground" : "bg-muted/50 border border-border/50 hover:bg-muted/70",
|
|
5197
5198
|
styles.button,
|
|
5198
5199
|
className
|
|
5199
5200
|
),
|
|
@@ -6146,7 +6147,8 @@ function ChatSidebarProvider({
|
|
|
6146
6147
|
if (conv && conv.rooms.length === 1) {
|
|
6147
6148
|
setActiveRoomId(conv.rooms[0].id);
|
|
6148
6149
|
setView("chat");
|
|
6149
|
-
} else
|
|
6150
|
+
} else {
|
|
6151
|
+
setActiveRoomId(null);
|
|
6150
6152
|
setView("list");
|
|
6151
6153
|
}
|
|
6152
6154
|
}
|
|
@@ -6807,6 +6809,7 @@ function ChatSidebar({
|
|
|
6807
6809
|
labels = {},
|
|
6808
6810
|
roleLabel,
|
|
6809
6811
|
roomTypeLabel,
|
|
6812
|
+
mobileTopOffset,
|
|
6810
6813
|
className
|
|
6811
6814
|
}) {
|
|
6812
6815
|
const {
|
|
@@ -6820,17 +6823,37 @@ function ChatSidebar({
|
|
|
6820
6823
|
selectRoom,
|
|
6821
6824
|
back
|
|
6822
6825
|
} = useChatSidebar();
|
|
6826
|
+
React2.useEffect(() => {
|
|
6827
|
+
if (!isOpen || typeof window === "undefined") return;
|
|
6828
|
+
const mq = window.matchMedia("(max-width: 767px)");
|
|
6829
|
+
const apply = () => {
|
|
6830
|
+
if (mq.matches) document.body.style.overflow = "hidden";
|
|
6831
|
+
else document.body.style.overflow = "";
|
|
6832
|
+
};
|
|
6833
|
+
apply();
|
|
6834
|
+
mq.addEventListener("change", apply);
|
|
6835
|
+
return () => {
|
|
6836
|
+
mq.removeEventListener("change", apply);
|
|
6837
|
+
document.body.style.overflow = "";
|
|
6838
|
+
};
|
|
6839
|
+
}, [isOpen]);
|
|
6823
6840
|
if (!isOpen) return null;
|
|
6824
6841
|
const getRoomTypeLabel = (type) => {
|
|
6825
6842
|
if (roomTypeLabel) return roomTypeLabel(type);
|
|
6826
6843
|
return roomTypeLabels[type] ?? type;
|
|
6827
6844
|
};
|
|
6828
6845
|
const activeConversation = activeCaseId ? conversations.find((c) => c.caseId === activeCaseId) : null;
|
|
6829
|
-
|
|
6846
|
+
const cssVars = {
|
|
6847
|
+
"--sidebar-top": mobileTopOffset ?? "0px"
|
|
6848
|
+
};
|
|
6849
|
+
const panel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
6830
6850
|
"div",
|
|
6831
6851
|
{
|
|
6852
|
+
style: cssVars,
|
|
6832
6853
|
className: cn(
|
|
6833
|
-
"flex h-
|
|
6854
|
+
"flex min-h-0 flex-col bg-background",
|
|
6855
|
+
"fixed top-[var(--sidebar-top)] right-0 bottom-0 left-0 z-[100] w-full max-w-none border-0 shadow-none",
|
|
6856
|
+
"md:relative md:inset-auto md:z-auto md:h-full md:w-[360px] md:max-w-[360px] md:shrink-0 md:border-l md:shadow-none xl:w-[400px] xl:max-w-[400px]",
|
|
6834
6857
|
className
|
|
6835
6858
|
),
|
|
6836
6859
|
children: view === "list" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -6925,6 +6948,18 @@ function ChatSidebar({
|
|
|
6925
6948
|
] })
|
|
6926
6949
|
}
|
|
6927
6950
|
);
|
|
6951
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6952
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6953
|
+
"div",
|
|
6954
|
+
{
|
|
6955
|
+
style: cssVars,
|
|
6956
|
+
className: "fixed top-[var(--sidebar-top)] right-0 bottom-0 left-0 z-[90] bg-black/50 md:hidden",
|
|
6957
|
+
"aria-hidden": true,
|
|
6958
|
+
onClick: close
|
|
6959
|
+
}
|
|
6960
|
+
),
|
|
6961
|
+
panel
|
|
6962
|
+
] });
|
|
6928
6963
|
}
|
|
6929
6964
|
function formatRelativeTime(dateStr) {
|
|
6930
6965
|
const date = new Date(dateStr);
|