@krak-stack/registry 0.1.8 → 0.1.9

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.
@@ -0,0 +1,82 @@
1
+ import { type ReactElement, type ReactNode } from "react";
2
+ export type NotificationMenuTab = "inbox" | "archive";
3
+ export type NotificationItem = {
4
+ archivedAt?: Date | null | string | undefined;
5
+ createdAt?: Date | string | undefined;
6
+ description?: ReactNode | undefined;
7
+ href?: string | undefined;
8
+ id: string;
9
+ readAt?: Date | null | string | undefined;
10
+ timestampLabel?: string | undefined;
11
+ title: ReactNode;
12
+ };
13
+ export type NotificationMenuMessages = {
14
+ archive: string;
15
+ archiveAll: string;
16
+ archiveItem: (title: string) => string;
17
+ archived: string;
18
+ emptyArchiveDescription: string;
19
+ emptyArchiveTitle: string;
20
+ emptyInboxDescription: string;
21
+ emptyInboxTitle: string;
22
+ errorDescription: string;
23
+ errorTitle: string;
24
+ inbox: string;
25
+ loading: string;
26
+ notifications: string;
27
+ unread: (count: number) => string;
28
+ };
29
+ export declare const notificationMenuMessages: (locale?: string, overrides?: Partial<NotificationMenuMessages>) => NotificationMenuMessages;
30
+ export type NotificationMenuState = {
31
+ archivedCount: number;
32
+ open: boolean;
33
+ unreadCount: number;
34
+ };
35
+ type NotificationAction = (notificationIds: readonly string[]) => Promise<unknown> | unknown;
36
+ export type NotificationMenuProps = {
37
+ className?: string | undefined;
38
+ defaultOpen?: boolean | undefined;
39
+ error?: boolean | undefined;
40
+ isLoading?: boolean | undefined;
41
+ locale?: string | undefined;
42
+ markReadOnOpen?: boolean | undefined;
43
+ messages?: Partial<NotificationMenuMessages> | undefined;
44
+ notifications: readonly NotificationItem[];
45
+ onArchive?: NotificationAction | undefined;
46
+ onMarkRead?: NotificationAction | undefined;
47
+ onNavigate?: ((notification: NotificationItem) => void) | undefined;
48
+ onOpenChange?: ((open: boolean) => void) | undefined;
49
+ open?: boolean | undefined;
50
+ renderItem?: ((notification: NotificationItem) => ReactNode) | undefined;
51
+ renderTrigger?: ((state: NotificationMenuState) => ReactElement) | undefined;
52
+ };
53
+ export declare function NotificationMenu({ className, defaultOpen, error, isLoading, locale, markReadOnOpen, messages: messageOverrides, notifications, onArchive, onMarkRead, onNavigate, onOpenChange, open: controlledOpen, renderItem, renderTrigger, }: NotificationMenuProps): import("react").JSX.Element;
54
+ export declare function NotificationMenuTrigger({ labels, unreadCount, }: {
55
+ labels?: NotificationMenuMessages | undefined;
56
+ unreadCount: number;
57
+ }): import("react").JSX.Element;
58
+ export declare function NotificationList({ error, isLoading, labels, locale, notifications, onArchive, onNavigate, renderItem, tab, }: {
59
+ error: boolean;
60
+ isLoading: boolean;
61
+ labels: NotificationMenuMessages;
62
+ locale: string;
63
+ notifications: readonly NotificationItem[];
64
+ onArchive?: NotificationAction | undefined;
65
+ onNavigate?: ((notification: NotificationItem) => void) | undefined;
66
+ renderItem?: ((notification: NotificationItem) => ReactNode) | undefined;
67
+ tab: NotificationMenuTab;
68
+ }): import("react").JSX.Element;
69
+ export declare function NotificationListItem({ labels, locale, notification, onArchive, onNavigate, renderItem, }: {
70
+ labels: NotificationMenuMessages;
71
+ locale: string;
72
+ notification: NotificationItem;
73
+ onArchive?: NotificationAction | undefined;
74
+ onNavigate?: ((notification: NotificationItem) => void) | undefined;
75
+ renderItem?: ((notification: NotificationItem) => ReactNode) | undefined;
76
+ }): import("react").JSX.Element;
77
+ export declare function NotificationEmpty({ description, icon, title, }: {
78
+ description: string;
79
+ icon: ReactNode;
80
+ title: string;
81
+ }): import("react").JSX.Element;
82
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from "./index.js";
2
+ export * from "./client/index.js";