primus-react-ui 1.0.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,485 @@
1
+ import React$1, { ReactNode } from 'react';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+
4
+ declare const AccountDashboard: React$1.FC<{
5
+ apiUrl?: string;
6
+ }>;
7
+
8
+ declare const KYCVerification: React$1.FC<{
9
+ userId: string;
10
+ apiUrl?: string;
11
+ }>;
12
+
13
+ declare const LoanCalculator: React$1.FC<{
14
+ apiUrl?: string;
15
+ }>;
16
+
17
+ declare const CreditScoreCard: React$1.FC<{
18
+ userId: string;
19
+ apiUrl?: string;
20
+ }>;
21
+
22
+ declare const QuoteComparison: React$1.FC<{
23
+ apiUrl?: string;
24
+ }>;
25
+
26
+ declare const AgentDirectory: React$1.FC<{
27
+ apiUrl?: string;
28
+ }>;
29
+
30
+ declare const FraudDetectionDashboard: React$1.FC<{
31
+ apiUrl?: string;
32
+ }>;
33
+
34
+ declare const PremiumCalculator: React$1.FC<{
35
+ apiUrl?: string;
36
+ }>;
37
+
38
+ declare const AICopilot: React$1.FC<{
39
+ apiUrl?: string;
40
+ }>;
41
+
42
+ declare const FileUploader: React$1.FC<{
43
+ apiUrl?: string;
44
+ onUploadComplete?: (file: any) => void;
45
+ }>;
46
+
47
+ declare const SecurityDashboard: React$1.FC<{
48
+ apiUrl?: string;
49
+ }>;
50
+
51
+ type SocialProvider = 'google' | 'azure' | 'github' | 'apple' | 'microsoft' | 'facebook';
52
+ interface PrimusLoginProps {
53
+ /** Callback when login is successful */
54
+ onLogin?: (credentials: {
55
+ username: string;
56
+ password: string;
57
+ }) => void;
58
+ /**
59
+ * Social login providers to display
60
+ * @example socialProviders={['google', 'azure']}
61
+ */
62
+ socialProviders?: SocialProvider[];
63
+ /** Callback when social provider is clicked */
64
+ onSocialLogin?: (provider: SocialProvider) => void;
65
+ /** OAuth endpoint base URL (default: /api/auth) */
66
+ authEndpoint?: string;
67
+ /** Show email/password form (default: true) */
68
+ showEmailLogin?: boolean;
69
+ /** App title displayed above form */
70
+ title?: string;
71
+ /** Subtitle/description text */
72
+ subtitle?: string;
73
+ /** Logo element or URL */
74
+ logo?: React.ReactNode | string;
75
+ /** Force specific theme */
76
+ theme?: 'light' | 'dark';
77
+ }
78
+ /**
79
+ * PrimusLogin - Complete Login Component
80
+ *
81
+ * A single component that handles all login methods. Enable features via props.
82
+ *
83
+ * @example
84
+ * ```tsx
85
+ * // Basic email/password only
86
+ * <PrimusLogin onLogin={(creds) => console.log(creds)} />
87
+ *
88
+ * // With social providers
89
+ * <PrimusLogin
90
+ * socialProviders={['google', 'azure']}
91
+ * onSocialLogin={(provider) => redirectToOAuth(provider)}
92
+ * />
93
+ *
94
+ * // Social only (no email form)
95
+ * <PrimusLogin
96
+ * showEmailLogin={false}
97
+ * socialProviders={['google', 'github', 'azure']}
98
+ * />
99
+ * ```
100
+ */
101
+ declare function PrimusLogin({ onLogin, socialProviders, onSocialLogin, authEndpoint, showEmailLogin, title, subtitle, logo, theme: themeOverride, }: PrimusLoginProps): react_jsx_runtime.JSX.Element;
102
+ declare const LoginPage: typeof PrimusLogin;
103
+
104
+ declare const UserProfile: React$1.FC;
105
+
106
+ interface PrimusUser {
107
+ id?: string;
108
+ name: string;
109
+ email: string;
110
+ roles?: string[];
111
+ claims?: Record<string, any>;
112
+ }
113
+ interface PrimusAuthContextType {
114
+ isAuthenticated: boolean;
115
+ user: PrimusUser | null;
116
+ login: (credentials: {
117
+ email: string;
118
+ password: string;
119
+ } | {
120
+ provider: 'auth0' | 'azure' | 'google' | 'github';
121
+ }) => Promise<{
122
+ success: boolean;
123
+ error?: string;
124
+ }>;
125
+ logout: () => Promise<void>;
126
+ token: string | null;
127
+ isLoading: boolean;
128
+ }
129
+ interface PrimusProviderProps {
130
+ children: React$1.ReactNode;
131
+ /** Base URL for authentication API (e.g., http://localhost:5221) */
132
+ authority: string;
133
+ clientId: string;
134
+ redirectUri?: string;
135
+ /** Called after successful login */
136
+ onLoginSuccess?: (user: PrimusUser, token: string) => void;
137
+ /** Called on login failure */
138
+ onLoginError?: (error: string) => void;
139
+ }
140
+ declare const PrimusProvider: React$1.FC<PrimusProviderProps>;
141
+ declare const usePrimusAuth: () => PrimusAuthContextType;
142
+
143
+ type PrimusTheme = 'light' | 'dark';
144
+ interface ThemeColors {
145
+ bg: string;
146
+ bgSecondary: string;
147
+ bgTertiary: string;
148
+ bgHover: string;
149
+ border: string;
150
+ borderSecondary: string;
151
+ text: string;
152
+ textSecondary: string;
153
+ textMuted: string;
154
+ accent: string;
155
+ accentHover: string;
156
+ accentText: string;
157
+ badge: string;
158
+ success: string;
159
+ warning: string;
160
+ error: string;
161
+ info: string;
162
+ }
163
+ declare const themeColors: Record<PrimusTheme, ThemeColors>;
164
+ interface PrimusThemeContextValue {
165
+ theme: PrimusTheme;
166
+ colors: ThemeColors;
167
+ setTheme: (theme: PrimusTheme) => void;
168
+ toggleTheme: () => void;
169
+ }
170
+ interface PrimusThemeProviderProps {
171
+ children: ReactNode;
172
+ defaultTheme?: PrimusTheme;
173
+ }
174
+ /**
175
+ * PrimusThemeProvider - Global Theme Context for Primus UI Components
176
+ *
177
+ * Wrap your app with this provider to enable consistent theming across all Primus components.
178
+ *
179
+ * @example
180
+ * ```tsx
181
+ * <PrimusThemeProvider defaultTheme="dark">
182
+ * <App />
183
+ * </PrimusThemeProvider>
184
+ * ```
185
+ */
186
+ declare function PrimusThemeProvider({ children, defaultTheme }: PrimusThemeProviderProps): react_jsx_runtime.JSX.Element;
187
+ /**
188
+ * usePrimusTheme - Hook to access the current Primus theme
189
+ *
190
+ * @example
191
+ * ```tsx
192
+ * const { theme, colors, toggleTheme } = usePrimusTheme();
193
+ * ```
194
+ */
195
+ declare function usePrimusTheme(): PrimusThemeContextValue;
196
+ /**
197
+ * PrimusThemeToggle - A button to toggle between light and dark themes
198
+ */
199
+ declare function PrimusThemeToggle(): react_jsx_runtime.JSX.Element;
200
+
201
+ declare const NotificationFeed: React$1.FC;
202
+
203
+ interface PrimusNotificationCenterProps {
204
+ /** Override the theme from context (optional) */
205
+ theme?: PrimusTheme;
206
+ /** Custom API URL (optional) */
207
+ apiUrl?: string;
208
+ }
209
+ /**
210
+ * PrimusNotificationCenter - Enterprise Notification Component
211
+ *
212
+ * Features:
213
+ * - Automatic theme inheritance from PrimusThemeProvider
214
+ * - Bell icon with animated badge
215
+ * - Admin panel for sending notifications
216
+ * - Real-time polling (3 second intervals)
217
+ * - Type-specific icons and colors
218
+ *
219
+ * @example
220
+ * ```tsx
221
+ * // With theme provider (recommended)
222
+ * <PrimusThemeProvider defaultTheme="dark">
223
+ * <PrimusNotificationCenter />
224
+ * </PrimusThemeProvider>
225
+ *
226
+ * // With manual override
227
+ * <PrimusNotificationCenter theme="light" />
228
+ * ```
229
+ */
230
+ declare function PrimusNotificationCenter({ theme: themeOverride, apiUrl }: PrimusNotificationCenterProps): react_jsx_runtime.JSX.Element;
231
+ declare const NotificationBell: typeof PrimusNotificationCenter;
232
+ declare const PrimusNotifications: typeof PrimusNotificationCenter;
233
+
234
+ interface Notification {
235
+ id: string;
236
+ title: string;
237
+ message: string;
238
+ type: 'info' | 'success' | 'warning' | 'error';
239
+ timestamp: string;
240
+ read: boolean;
241
+ }
242
+ declare const useNotifications: (apiUrl?: string) => {
243
+ notifications: Notification[];
244
+ unreadCount: number;
245
+ loading: boolean;
246
+ markAsRead: (id: string) => void;
247
+ markAllAsRead: () => void;
248
+ refresh: () => Promise<void>;
249
+ };
250
+
251
+ interface PrimusNotification {
252
+ id: string;
253
+ title: string;
254
+ message: string;
255
+ type: 'info' | 'success' | 'warning' | 'error';
256
+ timestamp: string;
257
+ read: boolean;
258
+ }
259
+ interface UseRealtimeNotificationsOptions {
260
+ apiUrl: string;
261
+ pollInterval?: number;
262
+ userId?: string;
263
+ }
264
+ /**
265
+ * Hook for managing real-time notifications from Primus Backend.
266
+ * Supports both polling and SignalR (when available).
267
+ */
268
+ declare const useRealtimeNotifications: (options: UseRealtimeNotificationsOptions) => {
269
+ notifications: PrimusNotification[];
270
+ unreadCount: number;
271
+ loading: boolean;
272
+ error: string | null;
273
+ sendNotification: (title: string, message: string, type?: "info" | "success" | "warning" | "error") => Promise<boolean>;
274
+ markAsRead: (id: string) => Promise<void>;
275
+ markAllAsRead: () => Promise<void>;
276
+ deleteNotification: (id: string) => Promise<void>;
277
+ refresh: () => Promise<void>;
278
+ };
279
+
280
+ interface CheckoutFormProps {
281
+ amount: number;
282
+ currency?: string;
283
+ apiUrl?: string;
284
+ onSuccess?: (result: any) => void;
285
+ onError?: (error: string) => void;
286
+ }
287
+ declare const CheckoutForm: React$1.FC<CheckoutFormProps>;
288
+
289
+ interface Document {
290
+ id: string;
291
+ name: string;
292
+ type: 'pdf' | 'image' | 'text';
293
+ url: string;
294
+ size?: string;
295
+ date?: string;
296
+ }
297
+ interface DocumentViewerProps {
298
+ document: Document;
299
+ onClose?: () => void;
300
+ onDownload?: () => void;
301
+ }
302
+ declare const DocumentViewer: React$1.FC<DocumentViewerProps>;
303
+
304
+ interface CreditCardProps {
305
+ cardHolder: string;
306
+ last4: string;
307
+ expiry: string;
308
+ brand?: 'visa' | 'mastercard' | 'amex';
309
+ variant?: 'black' | 'blue' | 'gold' | 'platinum';
310
+ }
311
+ declare const CreditCardVisual: React$1.FC<CreditCardProps>;
312
+
313
+ interface Transaction {
314
+ id: string;
315
+ description: string;
316
+ amount: number;
317
+ date: string;
318
+ type: 'credit' | 'debit';
319
+ category?: 'shopping' | 'transfer' | 'food' | 'other';
320
+ status?: 'pending' | 'completed' | 'failed';
321
+ }
322
+ interface TransactionHistoryProps {
323
+ transactions: Transaction[];
324
+ onTransactionClick?: (id: string) => void;
325
+ }
326
+ declare const TransactionHistory: React$1.FC<TransactionHistoryProps>;
327
+
328
+ interface PolicyProps {
329
+ policyNumber: string;
330
+ type: string;
331
+ status: 'active' | 'expired' | 'pending';
332
+ coverageAmount: number;
333
+ nextPaymentDate: string;
334
+ premiumAmount: number;
335
+ }
336
+ declare const PolicyCard: React$1.FC<PolicyProps>;
337
+
338
+ interface ClaimStep {
339
+ id: string;
340
+ label: string;
341
+ status: 'completed' | 'current' | 'upcoming';
342
+ date?: string;
343
+ }
344
+ interface ClaimStatusTrackerProps {
345
+ claimId: string;
346
+ steps: ClaimStep[];
347
+ }
348
+ declare const ClaimStatusTracker: React$1.FC<ClaimStatusTrackerProps>;
349
+
350
+ interface FeatureFlag {
351
+ name: string;
352
+ enabled: boolean;
353
+ description: string;
354
+ rolloutPercentage?: number;
355
+ }
356
+ declare const FeatureFlagToggle: React$1.FC<{
357
+ apiUrl?: string;
358
+ }>;
359
+
360
+ declare const LogViewer: React$1.FC<{
361
+ apiUrl?: string;
362
+ }>;
363
+
364
+ interface PrimusLayoutProps {
365
+ children: React$1.ReactNode;
366
+ sidebar?: React$1.ReactNode;
367
+ header?: React$1.ReactNode;
368
+ /** Dark mode */
369
+ darkMode?: boolean;
370
+ }
371
+ declare const PrimusLayout: React$1.FC<PrimusLayoutProps>;
372
+
373
+ interface SidebarItem {
374
+ id: string;
375
+ label: string;
376
+ icon?: React$1.ReactNode;
377
+ href?: string;
378
+ onClick?: () => void;
379
+ active?: boolean;
380
+ badge?: string | number;
381
+ }
382
+ interface PrimusSidebarProps {
383
+ /** App logo or title */
384
+ logo?: React$1.ReactNode;
385
+ /** Navigation items */
386
+ items: SidebarItem[];
387
+ /** Footer content */
388
+ footer?: React$1.ReactNode;
389
+ /** Callback when item clicked */
390
+ onItemClick?: (item: SidebarItem) => void;
391
+ /** Currently active item id */
392
+ activeId?: string;
393
+ }
394
+ declare const PrimusSidebar: React$1.FC<PrimusSidebarProps>;
395
+
396
+ interface PrimusHeaderProps {
397
+ /** Page title */
398
+ title?: string;
399
+ /** Breadcrumb items */
400
+ breadcrumbs?: {
401
+ label: string;
402
+ href?: string;
403
+ }[];
404
+ /** Right side actions */
405
+ actions?: React$1.ReactNode;
406
+ /** User info/avatar */
407
+ user?: {
408
+ name: string;
409
+ email?: string;
410
+ avatar?: string;
411
+ };
412
+ /** On user click */
413
+ onUserClick?: () => void;
414
+ }
415
+ declare const PrimusHeader: React$1.FC<PrimusHeaderProps>;
416
+
417
+ interface Column<T> {
418
+ key: keyof T | string;
419
+ header: string;
420
+ render?: (value: any, row: T) => React$1.ReactNode;
421
+ sortable?: boolean;
422
+ width?: string;
423
+ }
424
+ interface PrimusDataTableProps<T> {
425
+ data: T[];
426
+ columns: Column<T>[];
427
+ /** Row key field */
428
+ rowKey: keyof T;
429
+ /** Loading state */
430
+ loading?: boolean;
431
+ /** Enable row selection */
432
+ selectable?: boolean;
433
+ /** Selected row keys */
434
+ selectedKeys?: (string | number)[];
435
+ /** On selection change */
436
+ onSelectionChange?: (keys: (string | number)[]) => void;
437
+ /** On row click */
438
+ onRowClick?: (row: T) => void;
439
+ /** Actions column renderer */
440
+ actions?: (row: T) => React$1.ReactNode;
441
+ /** Empty state message */
442
+ emptyMessage?: string;
443
+ /** Search placeholder */
444
+ searchPlaceholder?: string;
445
+ /** Enable search */
446
+ searchable?: boolean;
447
+ }
448
+ declare function PrimusDataTable<T extends Record<string, any>>({ data, columns, rowKey, loading, selectable, selectedKeys, onSelectionChange, onRowClick, actions, emptyMessage, searchPlaceholder, searchable, }: PrimusDataTableProps<T>): react_jsx_runtime.JSX.Element;
449
+
450
+ interface PrimusModalProps {
451
+ open: boolean;
452
+ onClose: () => void;
453
+ title?: string;
454
+ children: React$1.ReactNode;
455
+ footer?: React$1.ReactNode;
456
+ size?: 'sm' | 'md' | 'lg' | 'xl';
457
+ }
458
+ declare const PrimusModal: React$1.FC<PrimusModalProps>;
459
+
460
+ interface StatCardProps {
461
+ title: string;
462
+ value: string | number;
463
+ change?: {
464
+ value: number;
465
+ type: 'increase' | 'decrease' | 'neutral';
466
+ };
467
+ icon?: React$1.ReactNode;
468
+ description?: string;
469
+ trend?: number[];
470
+ }
471
+ declare const PrimusStatCard: React$1.FC<StatCardProps>;
472
+ interface PrimusDashboardProps {
473
+ children: React$1.ReactNode;
474
+ title?: string;
475
+ subtitle?: string;
476
+ actions?: React$1.ReactNode;
477
+ }
478
+ declare const PrimusDashboard: React$1.FC<PrimusDashboardProps>;
479
+ interface DashboardGridProps {
480
+ children: React$1.ReactNode;
481
+ columns?: 1 | 2 | 3 | 4;
482
+ }
483
+ declare const DashboardGrid: React$1.FC<DashboardGridProps>;
484
+
485
+ export { AICopilot, AccountDashboard, AgentDirectory, CheckoutForm, type CheckoutFormProps, ClaimStatusTracker, type ClaimStatusTrackerProps, type ClaimStep, type Column, type CreditCardProps, CreditCardVisual, CreditScoreCard, DashboardGrid, type DashboardGridProps, type Document, DocumentViewer, type DocumentViewerProps, type FeatureFlag, FeatureFlagToggle, FileUploader, FraudDetectionDashboard, KYCVerification, LoanCalculator, LogViewer, LoginPage, type Notification, NotificationBell, NotificationFeed, PolicyCard, type PolicyProps, PremiumCalculator, PrimusDashboard, type PrimusDashboardProps, PrimusDataTable, type PrimusDataTableProps, PrimusHeader, type PrimusHeaderProps, PrimusLayout, type PrimusLayoutProps, PrimusLogin, type PrimusLoginProps, PrimusModal, type PrimusModalProps, type PrimusNotification, PrimusNotificationCenter, PrimusNotifications, PrimusProvider, type PrimusProviderProps, PrimusSidebar, type PrimusSidebarProps, PrimusStatCard, type PrimusTheme, PrimusThemeProvider, PrimusThemeToggle, QuoteComparison, SecurityDashboard, type SidebarItem, type SocialProvider, type StatCardProps, type Transaction, TransactionHistory, type TransactionHistoryProps, type UseRealtimeNotificationsOptions, UserProfile, themeColors, useNotifications, usePrimusAuth, usePrimusTheme, useRealtimeNotifications };