@algenium/blocks 1.2.1 → 1.3.0-rc.1

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.cts CHANGED
@@ -406,8 +406,12 @@ interface NotificationsWidgetProps {
406
406
  soundCooldown?: number;
407
407
  /** "ghost" renders a borderless button matching other ghost icon buttons. */
408
408
  buttonVariant?: "default" | "ghost";
409
+ /** URL to navigate to when "View all" is clicked in the footer. */
410
+ viewAllHref?: string;
411
+ /** Label for the "View all" link. Default: "View all" */
412
+ viewAllLabel?: string;
409
413
  }
410
- declare function NotificationsWidget({ notifications: propNotifications, onMarkAsRead: propOnMarkAsRead, onMarkAllAsRead: propOnMarkAllAsRead, onDismiss: propOnDismiss, onClearAll: propOnClearAll, onNotificationClick: propOnNotificationClick, size, maxVisible, playSound, soundUrl, className, emptyMessage, title, dotColor, showPulse, soundType, pulseStyle, soundCooldown, buttonVariant, }: NotificationsWidgetProps): react_jsx_runtime.JSX.Element;
414
+ declare function NotificationsWidget({ notifications: propNotifications, onMarkAsRead: propOnMarkAsRead, onMarkAllAsRead: propOnMarkAllAsRead, onDismiss: propOnDismiss, onClearAll: propOnClearAll, onNotificationClick: propOnNotificationClick, size, maxVisible, playSound, soundUrl, className, emptyMessage, title, dotColor, showPulse, soundType, pulseStyle, soundCooldown, buttonVariant, viewAllHref, viewAllLabel, }: NotificationsWidgetProps): react_jsx_runtime.JSX.Element;
411
415
 
412
416
  interface CalendarWidgetLabels {
413
417
  title?: string;
package/dist/index.d.ts CHANGED
@@ -406,8 +406,12 @@ interface NotificationsWidgetProps {
406
406
  soundCooldown?: number;
407
407
  /** "ghost" renders a borderless button matching other ghost icon buttons. */
408
408
  buttonVariant?: "default" | "ghost";
409
+ /** URL to navigate to when "View all" is clicked in the footer. */
410
+ viewAllHref?: string;
411
+ /** Label for the "View all" link. Default: "View all" */
412
+ viewAllLabel?: string;
409
413
  }
410
- declare function NotificationsWidget({ notifications: propNotifications, onMarkAsRead: propOnMarkAsRead, onMarkAllAsRead: propOnMarkAllAsRead, onDismiss: propOnDismiss, onClearAll: propOnClearAll, onNotificationClick: propOnNotificationClick, size, maxVisible, playSound, soundUrl, className, emptyMessage, title, dotColor, showPulse, soundType, pulseStyle, soundCooldown, buttonVariant, }: NotificationsWidgetProps): react_jsx_runtime.JSX.Element;
414
+ declare function NotificationsWidget({ notifications: propNotifications, onMarkAsRead: propOnMarkAsRead, onMarkAllAsRead: propOnMarkAllAsRead, onDismiss: propOnDismiss, onClearAll: propOnClearAll, onNotificationClick: propOnNotificationClick, size, maxVisible, playSound, soundUrl, className, emptyMessage, title, dotColor, showPulse, soundType, pulseStyle, soundCooldown, buttonVariant, viewAllHref, viewAllLabel, }: NotificationsWidgetProps): react_jsx_runtime.JSX.Element;
411
415
 
412
416
  interface CalendarWidgetLabels {
413
417
  title?: string;
package/dist/index.js CHANGED
@@ -4987,7 +4987,9 @@ function NotificationsWidget({
4987
4987
  soundType = "chime",
4988
4988
  pulseStyle = "ring",
4989
4989
  soundCooldown = 2e3,
4990
- buttonVariant = "default"
4990
+ buttonVariant = "default",
4991
+ viewAllHref,
4992
+ viewAllLabel = "View all"
4991
4993
  }) {
4992
4994
  const context = useNotificationsContext();
4993
4995
  const notifications = propNotifications ?? context?.notifications ?? [];
@@ -5232,9 +5234,19 @@ function NotificationsWidget({
5232
5234
  }
5233
5235
  ) })
5234
5236
  ] }),
5235
- sortedNotifications.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center py-8 px-4 text-center", children: [
5236
- /* @__PURE__ */ jsx("div", { className: "w-12 h-12 rounded-full bg-muted flex items-center justify-center mb-3", children: /* @__PURE__ */ jsx(Bell, { className: "w-6 h-6 text-muted-foreground" }) }),
5237
- /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: emptyMessage })
5237
+ sortedNotifications.length === 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
5238
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center py-8 px-4 text-center", children: [
5239
+ /* @__PURE__ */ jsx("div", { className: "w-12 h-12 rounded-full bg-muted flex items-center justify-center mb-3", children: /* @__PURE__ */ jsx(Bell, { className: "w-6 h-6 text-muted-foreground" }) }),
5240
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: emptyMessage })
5241
+ ] }),
5242
+ viewAllHref && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center px-4 py-2 border-t border-border bg-muted/30", children: /* @__PURE__ */ jsx(
5243
+ "a",
5244
+ {
5245
+ href: viewAllHref,
5246
+ className: "text-xs text-primary hover:underline font-medium",
5247
+ children: viewAllLabel
5248
+ }
5249
+ ) })
5238
5250
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
5239
5251
  /* @__PURE__ */ jsx(
5240
5252
  "div",
@@ -5297,7 +5309,7 @@ function NotificationsWidget({
5297
5309
  children: notification.title
5298
5310
  }
5299
5311
  ) }),
5300
- notification.message && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground line-clamp-2 mt-0.5", children: notification.message }),
5312
+ notification.message && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-0.5", children: notification.message }),
5301
5313
  /* @__PURE__ */ jsx("p", { className: "text-[10px] text-muted-foreground/70 mt-1", children: formatTimeAgo(notification.timestamp) })
5302
5314
  ] }),
5303
5315
  /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 flex items-start gap-1 opacity-0 group-hover:opacity-100 transition-opacity", children: onDismiss && /* @__PURE__ */ jsx(
@@ -5320,25 +5332,35 @@ function NotificationsWidget({
5320
5332
  }) })
5321
5333
  }
5322
5334
  ),
5323
- (hasMore || onClearAll) && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-2 border-t border-border bg-muted/30", children: [
5324
- hasMore && /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground", children: [
5335
+ (hasMore || onClearAll || viewAllHref) && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-2 border-t border-border bg-muted/30", children: [
5336
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: hasMore && /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground", children: [
5325
5337
  "+",
5326
5338
  sortedNotifications.length - maxVisible,
5327
5339
  " more"
5328
- ] }),
5329
- onClearAll && sortedNotifications.length > 0 && /* @__PURE__ */ jsxs(
5330
- Button,
5331
- {
5332
- variant: "ghost",
5333
- size: "sm",
5334
- className: "h-7 px-2 text-xs text-muted-foreground hover:text-destructive",
5335
- onClick: () => onClearAll(),
5336
- children: [
5337
- /* @__PURE__ */ jsx(Trash2, { className: "w-3 h-3 mr-1" }),
5338
- "Clear all"
5339
- ]
5340
- }
5341
- )
5340
+ ] }) }),
5341
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
5342
+ viewAllHref && /* @__PURE__ */ jsx(
5343
+ "a",
5344
+ {
5345
+ href: viewAllHref,
5346
+ className: "text-xs text-primary hover:underline font-medium",
5347
+ children: viewAllLabel
5348
+ }
5349
+ ),
5350
+ onClearAll && sortedNotifications.length > 0 && /* @__PURE__ */ jsxs(
5351
+ Button,
5352
+ {
5353
+ variant: "ghost",
5354
+ size: "sm",
5355
+ className: "h-7 px-2 text-xs text-muted-foreground hover:text-destructive",
5356
+ onClick: () => onClearAll(),
5357
+ children: [
5358
+ /* @__PURE__ */ jsx(Trash2, { className: "w-3 h-3 mr-1" }),
5359
+ "Clear all"
5360
+ ]
5361
+ }
5362
+ )
5363
+ ] })
5342
5364
  ] })
5343
5365
  ] })
5344
5366
  ]
@@ -6797,7 +6819,7 @@ function ChatSidebar({
6797
6819
  } = useChatSidebar();
6798
6820
  useEffect(() => {
6799
6821
  if (!isOpen || typeof window === "undefined") return;
6800
- const mq = window.matchMedia("(max-width: 639px)");
6822
+ const mq = window.matchMedia("(max-width: 767px)");
6801
6823
  const apply = () => {
6802
6824
  if (mq.matches) document.body.style.overflow = "hidden";
6803
6825
  else document.body.style.overflow = "";
@@ -6825,7 +6847,7 @@ function ChatSidebar({
6825
6847
  className: cn(
6826
6848
  "flex min-h-0 flex-col bg-background",
6827
6849
  "fixed top-[var(--sidebar-top)] right-0 bottom-0 left-0 z-[100] w-full max-w-none border-0 shadow-none",
6828
- "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]",
6850
+ "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]",
6829
6851
  className
6830
6852
  ),
6831
6853
  children: view === "list" ? /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -6925,7 +6947,7 @@ function ChatSidebar({
6925
6947
  "div",
6926
6948
  {
6927
6949
  style: cssVars,
6928
- className: "fixed top-[var(--sidebar-top)] right-0 bottom-0 left-0 z-[90] bg-black/50 sm:hidden",
6950
+ className: "fixed top-[var(--sidebar-top)] right-0 bottom-0 left-0 z-[90] bg-black/50 md:hidden",
6929
6951
  "aria-hidden": true,
6930
6952
  onClick: close
6931
6953
  }