@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 +43 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +43 -21
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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(
|
|
5236
|
-
/* @__PURE__ */
|
|
5237
|
-
|
|
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
|
|
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
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
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
|
]
|