@algenium/blocks 1.2.2 → 1.3.0

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
@@ -5015,7 +5015,9 @@ function NotificationsWidget({
5015
5015
  soundType = "chime",
5016
5016
  pulseStyle = "ring",
5017
5017
  soundCooldown = 2e3,
5018
- buttonVariant = "default"
5018
+ buttonVariant = "default",
5019
+ viewAllHref,
5020
+ viewAllLabel = "View all"
5019
5021
  }) {
5020
5022
  const context = useNotificationsContext();
5021
5023
  const notifications = propNotifications ?? context?.notifications ?? [];
@@ -5260,9 +5262,19 @@ function NotificationsWidget({
5260
5262
  }
5261
5263
  ) })
5262
5264
  ] }),
5263
- sortedNotifications.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center py-8 px-4 text-center", children: [
5264
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-12 h-12 rounded-full bg-muted flex items-center justify-center mb-3", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bell, { className: "w-6 h-6 text-muted-foreground" }) }),
5265
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: emptyMessage })
5265
+ sortedNotifications.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5266
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center py-8 px-4 text-center", children: [
5267
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-12 h-12 rounded-full bg-muted flex items-center justify-center mb-3", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bell, { className: "w-6 h-6 text-muted-foreground" }) }),
5268
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: emptyMessage })
5269
+ ] }),
5270
+ viewAllHref && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center px-4 py-2 border-t border-border bg-muted/30", children: /* @__PURE__ */ jsxRuntime.jsx(
5271
+ "a",
5272
+ {
5273
+ href: viewAllHref,
5274
+ className: "text-xs text-primary hover:underline font-medium",
5275
+ children: viewAllLabel
5276
+ }
5277
+ ) })
5266
5278
  ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5267
5279
  /* @__PURE__ */ jsxRuntime.jsx(
5268
5280
  "div",
@@ -5325,7 +5337,7 @@ function NotificationsWidget({
5325
5337
  children: notification.title
5326
5338
  }
5327
5339
  ) }),
5328
- notification.message && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground line-clamp-2 mt-0.5", children: notification.message }),
5340
+ notification.message && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-0.5", children: notification.message }),
5329
5341
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] text-muted-foreground/70 mt-1", children: formatTimeAgo(notification.timestamp) })
5330
5342
  ] }),
5331
5343
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0 flex items-start gap-1 opacity-0 group-hover:opacity-100 transition-opacity", children: onDismiss && /* @__PURE__ */ jsxRuntime.jsx(
@@ -5348,25 +5360,35 @@ function NotificationsWidget({
5348
5360
  }) })
5349
5361
  }
5350
5362
  ),
5351
- (hasMore || onClearAll) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-4 py-2 border-t border-border bg-muted/30", children: [
5352
- hasMore && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-muted-foreground", children: [
5363
+ (hasMore || onClearAll || viewAllHref) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-4 py-2 border-t border-border bg-muted/30", children: [
5364
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: hasMore && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-muted-foreground", children: [
5353
5365
  "+",
5354
5366
  sortedNotifications.length - maxVisible,
5355
5367
  " more"
5356
- ] }),
5357
- onClearAll && sortedNotifications.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
5358
- Button,
5359
- {
5360
- variant: "ghost",
5361
- size: "sm",
5362
- className: "h-7 px-2 text-xs text-muted-foreground hover:text-destructive",
5363
- onClick: () => onClearAll(),
5364
- children: [
5365
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "w-3 h-3 mr-1" }),
5366
- "Clear all"
5367
- ]
5368
- }
5369
- )
5368
+ ] }) }),
5369
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
5370
+ viewAllHref && /* @__PURE__ */ jsxRuntime.jsx(
5371
+ "a",
5372
+ {
5373
+ href: viewAllHref,
5374
+ className: "text-xs text-primary hover:underline font-medium",
5375
+ children: viewAllLabel
5376
+ }
5377
+ ),
5378
+ onClearAll && sortedNotifications.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
5379
+ Button,
5380
+ {
5381
+ variant: "ghost",
5382
+ size: "sm",
5383
+ className: "h-7 px-2 text-xs text-muted-foreground hover:text-destructive",
5384
+ onClick: () => onClearAll(),
5385
+ children: [
5386
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "w-3 h-3 mr-1" }),
5387
+ "Clear all"
5388
+ ]
5389
+ }
5390
+ )
5391
+ ] })
5370
5392
  ] })
5371
5393
  ] })
5372
5394
  ]