primus-react-ui 1.0.14 → 1.1.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/README.md +40 -30
- package/dist/index.d.mts +229 -115
- package/dist/index.d.ts +229 -115
- package/dist/index.js +1294 -611
- package/dist/index.mjs +1194 -534
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,65 +1,62 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { ChartType, ChartData, ChartOptions, ChartDataset } from 'chart.js';
|
|
4
4
|
|
|
5
|
-
declare const AccountDashboard: React
|
|
5
|
+
declare const AccountDashboard: React.FC<{
|
|
6
6
|
apiUrl?: string;
|
|
7
7
|
}>;
|
|
8
8
|
|
|
9
|
-
declare const KYCVerification: React
|
|
9
|
+
declare const KYCVerification: React.FC<{
|
|
10
10
|
userId: string;
|
|
11
11
|
apiUrl?: string;
|
|
12
12
|
}>;
|
|
13
13
|
|
|
14
|
-
declare const LoanCalculator: React
|
|
14
|
+
declare const LoanCalculator: React.FC<{
|
|
15
15
|
apiUrl?: string;
|
|
16
16
|
}>;
|
|
17
17
|
|
|
18
|
-
declare const CreditScoreCard: React
|
|
18
|
+
declare const CreditScoreCard: React.FC<{
|
|
19
19
|
userId: string;
|
|
20
20
|
apiUrl?: string;
|
|
21
21
|
}>;
|
|
22
22
|
|
|
23
|
-
declare const QuoteComparison: React
|
|
23
|
+
declare const QuoteComparison: React.FC<{
|
|
24
24
|
apiUrl?: string;
|
|
25
25
|
}>;
|
|
26
26
|
|
|
27
|
-
declare const AgentDirectory: React
|
|
27
|
+
declare const AgentDirectory: React.FC<{
|
|
28
28
|
apiUrl?: string;
|
|
29
29
|
}>;
|
|
30
30
|
|
|
31
|
-
declare const FraudDetectionDashboard: React
|
|
31
|
+
declare const FraudDetectionDashboard: React.FC<{
|
|
32
32
|
apiUrl?: string;
|
|
33
33
|
}>;
|
|
34
34
|
|
|
35
|
-
declare const PremiumCalculator: React
|
|
35
|
+
declare const PremiumCalculator: React.FC<{
|
|
36
36
|
apiUrl?: string;
|
|
37
37
|
}>;
|
|
38
38
|
|
|
39
|
-
declare const AICopilot: React
|
|
39
|
+
declare const AICopilot: React.FC<{
|
|
40
40
|
apiUrl?: string;
|
|
41
41
|
}>;
|
|
42
42
|
|
|
43
|
-
declare const FileUploader: React
|
|
43
|
+
declare const FileUploader: React.FC<{
|
|
44
44
|
apiUrl?: string;
|
|
45
45
|
onUploadComplete?: (file: any) => void;
|
|
46
46
|
}>;
|
|
47
47
|
|
|
48
|
-
declare const SecurityDashboard: React
|
|
48
|
+
declare const SecurityDashboard: React.FC<{
|
|
49
49
|
apiUrl?: string;
|
|
50
50
|
}>;
|
|
51
51
|
|
|
52
|
-
type SocialProvider = 'google' | 'azure' | 'github' | 'apple' | 'microsoft' | 'facebook';
|
|
52
|
+
type SocialProvider = 'google' | 'azure' | 'auth0' | 'github' | 'apple' | 'microsoft' | 'facebook';
|
|
53
53
|
interface PrimusLoginProps {
|
|
54
54
|
/** Callback when login is successful */
|
|
55
55
|
onLogin?: (credentials: {
|
|
56
56
|
username: string;
|
|
57
57
|
password: string;
|
|
58
58
|
}) => void;
|
|
59
|
-
/**
|
|
60
|
-
* Social login providers to display
|
|
61
|
-
* @example socialProviders={['google', 'azure']}
|
|
62
|
-
*/
|
|
59
|
+
/** Social login providers to display */
|
|
63
60
|
socialProviders?: SocialProvider[];
|
|
64
61
|
/** Callback when social provider is clicked */
|
|
65
62
|
onSocialLogin?: (provider: SocialProvider) => void;
|
|
@@ -75,31 +72,15 @@ interface PrimusLoginProps {
|
|
|
75
72
|
logo?: React.ReactNode | string;
|
|
76
73
|
/** Force specific theme */
|
|
77
74
|
theme?: 'light' | 'dark';
|
|
75
|
+
/** Display variant: standalone (full-page) or embedded (compact card) */
|
|
76
|
+
variant?: 'standalone' | 'embedded';
|
|
77
|
+
/**
|
|
78
|
+
* If true, uses the PrimusAuthContext to handle login automatically.
|
|
79
|
+
* Requires component to be wrapped in <PrimusProvider>.
|
|
80
|
+
*/
|
|
81
|
+
useAuth?: boolean;
|
|
78
82
|
}
|
|
79
|
-
|
|
80
|
-
* PrimusLogin - Complete Login Component
|
|
81
|
-
*
|
|
82
|
-
* A single component that handles all login methods. Enable features via props.
|
|
83
|
-
*
|
|
84
|
-
* @example
|
|
85
|
-
* ```tsx
|
|
86
|
-
* // Basic email/password only
|
|
87
|
-
* <PrimusLogin onLogin={(creds) => console.log(creds)} />
|
|
88
|
-
*
|
|
89
|
-
* // With social providers
|
|
90
|
-
* <PrimusLogin
|
|
91
|
-
* socialProviders={['google', 'azure']}
|
|
92
|
-
* onSocialLogin={(provider) => redirectToOAuth(provider)}
|
|
93
|
-
* />
|
|
94
|
-
*
|
|
95
|
-
* // Social only (no email form)
|
|
96
|
-
* <PrimusLogin
|
|
97
|
-
* showEmailLogin={false}
|
|
98
|
-
* socialProviders={['google', 'github', 'azure']}
|
|
99
|
-
* />
|
|
100
|
-
* ```
|
|
101
|
-
*/
|
|
102
|
-
declare function PrimusLogin({ onLogin, socialProviders, onSocialLogin, authEndpoint, showEmailLogin, title, subtitle, logo, theme: themeOverride, }: PrimusLoginProps): react_jsx_runtime.JSX.Element;
|
|
83
|
+
declare function PrimusLogin({ onLogin, socialProviders, onSocialLogin, authEndpoint, showEmailLogin, title, subtitle, logo, theme: themeOverride, variant, useAuth, }: PrimusLoginProps): react_jsx_runtime.JSX.Element;
|
|
103
84
|
declare const LoginPage: typeof PrimusLogin;
|
|
104
85
|
|
|
105
86
|
interface UserProfileProps {
|
|
@@ -110,7 +91,7 @@ interface UserProfileProps {
|
|
|
110
91
|
showLogout?: boolean;
|
|
111
92
|
onLogout?: () => void;
|
|
112
93
|
}
|
|
113
|
-
declare const UserProfile: React
|
|
94
|
+
declare const UserProfile: React.FC<UserProfileProps>;
|
|
114
95
|
|
|
115
96
|
interface PrimusUser {
|
|
116
97
|
id?: string;
|
|
@@ -134,19 +115,31 @@ interface PrimusAuthContextType {
|
|
|
134
115
|
logout: () => Promise<void>;
|
|
135
116
|
token: string | null;
|
|
136
117
|
isLoading: boolean;
|
|
118
|
+
csrfCookieName?: string;
|
|
119
|
+
csrfHeaderName?: string;
|
|
137
120
|
}
|
|
138
121
|
interface PrimusProviderProps {
|
|
139
|
-
children: React
|
|
140
|
-
/** Base URL for
|
|
122
|
+
children: React.ReactNode;
|
|
123
|
+
/** Base URL for API (e.g., https://api.example.com) */
|
|
141
124
|
authority: string;
|
|
125
|
+
/** Base path for Identity Broker endpoints (default: /api/auth) */
|
|
126
|
+
authBasePath?: string;
|
|
127
|
+
/** CSRF cookie name set by the broker (default: XSRF-TOKEN) */
|
|
128
|
+
csrfCookieName?: string;
|
|
129
|
+
/** CSRF header name expected by the broker (default: X-Primus-CSRF) */
|
|
130
|
+
csrfHeaderName?: string;
|
|
131
|
+
/** Seed CSRF cookie on mount (default: true) */
|
|
132
|
+
seedCsrfOnLoad?: boolean;
|
|
142
133
|
clientId: string;
|
|
143
134
|
redirectUri?: string;
|
|
144
135
|
/** Called after successful login */
|
|
145
136
|
onLoginSuccess?: (user: PrimusUser, token: string) => void;
|
|
146
137
|
/** Called on login failure */
|
|
147
138
|
onLoginError?: (error: string) => void;
|
|
139
|
+
/** Interval in ms to ping backend to keep session alive (default: 5 min) */
|
|
140
|
+
heartbeatInterval?: number;
|
|
148
141
|
}
|
|
149
|
-
declare const PrimusProvider: React
|
|
142
|
+
declare const PrimusProvider: React.FC<PrimusProviderProps>;
|
|
150
143
|
declare const usePrimusAuth: () => PrimusAuthContextType;
|
|
151
144
|
|
|
152
145
|
type PrimusTheme = 'light' | 'dark';
|
|
@@ -207,6 +200,28 @@ declare function usePrimusTheme(): PrimusThemeContextValue;
|
|
|
207
200
|
*/
|
|
208
201
|
declare function PrimusThemeToggle(): react_jsx_runtime.JSX.Element;
|
|
209
202
|
|
|
203
|
+
interface PrimusFetchOptions extends RequestInit {
|
|
204
|
+
skipAuth?: boolean;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* A hook that returns a wrapper around the native `fetch` API.
|
|
208
|
+
*
|
|
209
|
+
* This wrapper automatically:
|
|
210
|
+
* 1. Injects `{ credentials: 'include' }` to handle cookies.
|
|
211
|
+
* 2. Injects the `X-Primus-CSRF` header by reading the `XSRF-TOKEN` cookie.
|
|
212
|
+
* 3. Intercepts 401 Unauthorized responses and handles global logout/redirects via PrimusAuthContext.
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* const { fetch } = usePrimusFetch();
|
|
216
|
+
*
|
|
217
|
+
* useEffect(() => {
|
|
218
|
+
* fetch('/api/banking/accounts').then(data => setData(data));
|
|
219
|
+
* }, []);
|
|
220
|
+
*/
|
|
221
|
+
declare function usePrimusFetch(): {
|
|
222
|
+
fetch: (input: RequestInfo | URL, init?: PrimusFetchOptions) => Promise<Response>;
|
|
223
|
+
};
|
|
224
|
+
|
|
210
225
|
interface Notification$1 {
|
|
211
226
|
id: string;
|
|
212
227
|
title: string;
|
|
@@ -235,7 +250,7 @@ interface PrimusNotificationFeedProps {
|
|
|
235
250
|
apiUrl?: string;
|
|
236
251
|
className?: string;
|
|
237
252
|
}
|
|
238
|
-
declare const PrimusNotificationFeed: React
|
|
253
|
+
declare const PrimusNotificationFeed: React.FC<PrimusNotificationFeedProps>;
|
|
239
254
|
|
|
240
255
|
interface Notification {
|
|
241
256
|
id: string;
|
|
@@ -318,7 +333,7 @@ interface CheckoutFormProps {
|
|
|
318
333
|
onSuccess?: (result: any) => void;
|
|
319
334
|
onError?: (error: string) => void;
|
|
320
335
|
}
|
|
321
|
-
declare const CheckoutForm: React
|
|
336
|
+
declare const CheckoutForm: React.FC<CheckoutFormProps>;
|
|
322
337
|
|
|
323
338
|
interface Document {
|
|
324
339
|
id: string;
|
|
@@ -333,7 +348,7 @@ interface DocumentViewerProps {
|
|
|
333
348
|
onClose?: () => void;
|
|
334
349
|
onDownload?: () => void;
|
|
335
350
|
}
|
|
336
|
-
declare const DocumentViewer: React
|
|
351
|
+
declare const DocumentViewer: React.FC<DocumentViewerProps>;
|
|
337
352
|
|
|
338
353
|
interface CreditCardProps {
|
|
339
354
|
cardHolder: string;
|
|
@@ -342,7 +357,7 @@ interface CreditCardProps {
|
|
|
342
357
|
brand?: 'visa' | 'mastercard' | 'amex';
|
|
343
358
|
variant?: 'black' | 'blue' | 'gold' | 'platinum';
|
|
344
359
|
}
|
|
345
|
-
declare const CreditCardVisual: React
|
|
360
|
+
declare const CreditCardVisual: React.FC<CreditCardProps>;
|
|
346
361
|
|
|
347
362
|
interface Transaction {
|
|
348
363
|
id: string;
|
|
@@ -357,7 +372,7 @@ interface TransactionHistoryProps {
|
|
|
357
372
|
transactions: Transaction[];
|
|
358
373
|
onTransactionClick?: (id: string) => void;
|
|
359
374
|
}
|
|
360
|
-
declare const TransactionHistory: React
|
|
375
|
+
declare const TransactionHistory: React.FC<TransactionHistoryProps>;
|
|
361
376
|
|
|
362
377
|
interface PolicyProps {
|
|
363
378
|
policyNumber: string;
|
|
@@ -367,7 +382,7 @@ interface PolicyProps {
|
|
|
367
382
|
nextPaymentDate: string;
|
|
368
383
|
premiumAmount: number;
|
|
369
384
|
}
|
|
370
|
-
declare const PolicyCard: React
|
|
385
|
+
declare const PolicyCard: React.FC<PolicyProps>;
|
|
371
386
|
|
|
372
387
|
interface ClaimStep {
|
|
373
388
|
id: string;
|
|
@@ -379,7 +394,7 @@ interface ClaimStatusTrackerProps {
|
|
|
379
394
|
claimId: string;
|
|
380
395
|
steps: ClaimStep[];
|
|
381
396
|
}
|
|
382
|
-
declare const ClaimStatusTracker: React
|
|
397
|
+
declare const ClaimStatusTracker: React.FC<ClaimStatusTrackerProps>;
|
|
383
398
|
|
|
384
399
|
interface FeatureFlag {
|
|
385
400
|
name: string;
|
|
@@ -387,27 +402,27 @@ interface FeatureFlag {
|
|
|
387
402
|
description: string;
|
|
388
403
|
rolloutPercentage?: number;
|
|
389
404
|
}
|
|
390
|
-
declare const FeatureFlagToggle: React
|
|
405
|
+
declare const FeatureFlagToggle: React.FC<{
|
|
391
406
|
apiUrl?: string;
|
|
392
407
|
}>;
|
|
393
408
|
|
|
394
|
-
declare const LogViewer: React
|
|
409
|
+
declare const LogViewer: React.FC<{
|
|
395
410
|
apiUrl?: string;
|
|
396
411
|
}>;
|
|
397
412
|
|
|
398
413
|
interface PrimusLayoutProps {
|
|
399
|
-
children: React
|
|
400
|
-
sidebar?: React
|
|
401
|
-
header?: React
|
|
414
|
+
children: React.ReactNode;
|
|
415
|
+
sidebar?: React.ReactNode;
|
|
416
|
+
header?: React.ReactNode;
|
|
402
417
|
/** Dark mode */
|
|
403
418
|
darkMode?: boolean;
|
|
404
419
|
}
|
|
405
|
-
declare const PrimusLayout: React
|
|
420
|
+
declare const PrimusLayout: React.FC<PrimusLayoutProps>;
|
|
406
421
|
|
|
407
422
|
interface SidebarItem {
|
|
408
423
|
id: string;
|
|
409
424
|
label: string;
|
|
410
|
-
icon?: React
|
|
425
|
+
icon?: React.ReactNode;
|
|
411
426
|
href?: string;
|
|
412
427
|
route?: string;
|
|
413
428
|
target?: string;
|
|
@@ -417,17 +432,17 @@ interface SidebarItem {
|
|
|
417
432
|
}
|
|
418
433
|
interface PrimusSidebarProps {
|
|
419
434
|
/** App logo or title */
|
|
420
|
-
logo?: React
|
|
435
|
+
logo?: React.ReactNode;
|
|
421
436
|
/** Navigation items */
|
|
422
437
|
items: SidebarItem[];
|
|
423
438
|
/** Footer content */
|
|
424
|
-
footer?: React
|
|
439
|
+
footer?: React.ReactNode;
|
|
425
440
|
/** Callback when item clicked */
|
|
426
441
|
onItemClick?: (item: SidebarItem) => void;
|
|
427
442
|
/** Currently active item id */
|
|
428
443
|
activeId?: string;
|
|
429
444
|
}
|
|
430
|
-
declare const PrimusSidebar: React
|
|
445
|
+
declare const PrimusSidebar: React.FC<PrimusSidebarProps>;
|
|
431
446
|
|
|
432
447
|
interface PrimusHeaderProps {
|
|
433
448
|
/** Page title */
|
|
@@ -438,7 +453,7 @@ interface PrimusHeaderProps {
|
|
|
438
453
|
href?: string;
|
|
439
454
|
}[];
|
|
440
455
|
/** Right side actions */
|
|
441
|
-
actions?: React
|
|
456
|
+
actions?: React.ReactNode;
|
|
442
457
|
/** User info/avatar */
|
|
443
458
|
user?: {
|
|
444
459
|
name: string;
|
|
@@ -448,12 +463,21 @@ interface PrimusHeaderProps {
|
|
|
448
463
|
/** On user click */
|
|
449
464
|
onUserClick?: () => void;
|
|
450
465
|
}
|
|
451
|
-
declare const PrimusHeader: React
|
|
466
|
+
declare const PrimusHeader: React.FC<PrimusHeaderProps>;
|
|
467
|
+
|
|
468
|
+
interface PrimusSectionProps {
|
|
469
|
+
title: string;
|
|
470
|
+
subtitle?: string;
|
|
471
|
+
children: React.ReactNode;
|
|
472
|
+
className?: string;
|
|
473
|
+
actions?: React.ReactNode;
|
|
474
|
+
}
|
|
475
|
+
declare const PrimusSection: React.FC<PrimusSectionProps>;
|
|
452
476
|
|
|
453
477
|
interface Column<T> {
|
|
454
478
|
key: keyof T | string;
|
|
455
479
|
header: string;
|
|
456
|
-
render?: (value: any, row: T) => React
|
|
480
|
+
render?: (value: any, row: T) => React.ReactNode;
|
|
457
481
|
sortable?: boolean;
|
|
458
482
|
width?: string;
|
|
459
483
|
}
|
|
@@ -473,7 +497,7 @@ interface PrimusDataTableProps<T> {
|
|
|
473
497
|
/** On row click */
|
|
474
498
|
onRowClick?: (row: T) => void;
|
|
475
499
|
/** Actions column renderer */
|
|
476
|
-
actions?: (row: T) => React
|
|
500
|
+
actions?: (row: T) => React.ReactNode;
|
|
477
501
|
/** Empty state message */
|
|
478
502
|
emptyMessage?: string;
|
|
479
503
|
/** Search placeholder */
|
|
@@ -498,11 +522,11 @@ interface PrimusModalProps {
|
|
|
498
522
|
open: boolean;
|
|
499
523
|
onClose: () => void;
|
|
500
524
|
title?: string;
|
|
501
|
-
children: React
|
|
502
|
-
footer?: React
|
|
525
|
+
children: React.ReactNode;
|
|
526
|
+
footer?: React.ReactNode;
|
|
503
527
|
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
504
528
|
}
|
|
505
|
-
declare const PrimusModal: React
|
|
529
|
+
declare const PrimusModal: React.FC<PrimusModalProps>;
|
|
506
530
|
|
|
507
531
|
interface StatCardProps {
|
|
508
532
|
title: string;
|
|
@@ -511,23 +535,33 @@ interface StatCardProps {
|
|
|
511
535
|
value: number;
|
|
512
536
|
type: 'increase' | 'decrease' | 'neutral';
|
|
513
537
|
};
|
|
514
|
-
icon?: React
|
|
538
|
+
icon?: React.ReactNode;
|
|
515
539
|
description?: string;
|
|
516
540
|
trend?: number[];
|
|
517
541
|
}
|
|
518
|
-
declare const PrimusStatCard: React
|
|
542
|
+
declare const PrimusStatCard: React.FC<StatCardProps>;
|
|
519
543
|
interface PrimusDashboardProps {
|
|
520
|
-
children: React
|
|
544
|
+
children: React.ReactNode;
|
|
521
545
|
title?: string;
|
|
522
546
|
subtitle?: string;
|
|
523
|
-
actions?: React
|
|
547
|
+
actions?: React.ReactNode;
|
|
524
548
|
}
|
|
525
|
-
declare const PrimusDashboard: React
|
|
549
|
+
declare const PrimusDashboard: React.FC<PrimusDashboardProps>;
|
|
526
550
|
interface DashboardGridProps {
|
|
527
|
-
children: React
|
|
551
|
+
children: React.ReactNode;
|
|
528
552
|
columns?: 1 | 2 | 3 | 4;
|
|
529
553
|
}
|
|
530
|
-
declare const DashboardGrid: React
|
|
554
|
+
declare const DashboardGrid: React.FC<DashboardGridProps>;
|
|
555
|
+
|
|
556
|
+
interface PrimusSummaryCardProps {
|
|
557
|
+
title: string;
|
|
558
|
+
subtitle?: string;
|
|
559
|
+
actionLabel?: string;
|
|
560
|
+
onAction?: () => void;
|
|
561
|
+
children?: React.ReactNode;
|
|
562
|
+
className?: string;
|
|
563
|
+
}
|
|
564
|
+
declare const PrimusSummaryCard: React.FC<PrimusSummaryCardProps>;
|
|
531
565
|
|
|
532
566
|
interface PrimusActivityItem {
|
|
533
567
|
id?: string;
|
|
@@ -543,7 +577,7 @@ interface PrimusActivityFeedProps {
|
|
|
543
577
|
groupByDate?: boolean;
|
|
544
578
|
loading?: boolean;
|
|
545
579
|
}
|
|
546
|
-
declare const PrimusActivityFeed: React
|
|
580
|
+
declare const PrimusActivityFeed: React.FC<PrimusActivityFeedProps>;
|
|
547
581
|
|
|
548
582
|
interface PrimusChartSeries {
|
|
549
583
|
name: string;
|
|
@@ -573,25 +607,25 @@ declare const PrimusChartBase: <TType extends ChartType = ChartType>({ type, dat
|
|
|
573
607
|
type PrimusLineChartProps = Omit<PrimusChartBaseProps<'line'>, 'type' | 'datasetTransform'> & {
|
|
574
608
|
options?: ChartOptions<'line'>;
|
|
575
609
|
};
|
|
576
|
-
declare const PrimusLineChart: React
|
|
610
|
+
declare const PrimusLineChart: React.FC<PrimusLineChartProps>;
|
|
577
611
|
|
|
578
612
|
type PrimusAreaChartProps = Omit<PrimusChartBaseProps<'line'>, 'type' | 'datasetTransform'> & {
|
|
579
613
|
options?: ChartOptions<'line'>;
|
|
580
614
|
};
|
|
581
|
-
declare const PrimusAreaChart: React
|
|
615
|
+
declare const PrimusAreaChart: React.FC<PrimusAreaChartProps>;
|
|
582
616
|
|
|
583
617
|
type PrimusBarChartProps = Omit<PrimusChartBaseProps<'bar'>, 'type' | 'datasetTransform'> & {
|
|
584
618
|
options?: ChartOptions<'bar'>;
|
|
585
619
|
stacked?: boolean;
|
|
586
620
|
};
|
|
587
|
-
declare const PrimusBarChart: React
|
|
621
|
+
declare const PrimusBarChart: React.FC<PrimusBarChartProps>;
|
|
588
622
|
|
|
589
623
|
type PrimusPieChartProps = Omit<PrimusChartBaseProps<'pie' | 'doughnut'>, 'type' | 'datasetTransform'> & {
|
|
590
624
|
donut?: boolean;
|
|
591
625
|
cutout?: string;
|
|
592
626
|
options?: ChartOptions<'pie' | 'doughnut'>;
|
|
593
627
|
};
|
|
594
|
-
declare const PrimusPieChart: React
|
|
628
|
+
declare const PrimusPieChart: React.FC<PrimusPieChartProps>;
|
|
595
629
|
|
|
596
630
|
interface PrimusSparklineProps {
|
|
597
631
|
series?: PrimusChartSeries[];
|
|
@@ -603,31 +637,41 @@ interface PrimusSparklineProps {
|
|
|
603
637
|
className?: string;
|
|
604
638
|
ariaLabel?: string;
|
|
605
639
|
}
|
|
606
|
-
declare const PrimusSparkline: React
|
|
640
|
+
declare const PrimusSparkline: React.FC<PrimusSparklineProps>;
|
|
607
641
|
|
|
608
|
-
interface ButtonProps extends React
|
|
642
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
609
643
|
variant?: 'primary' | 'secondary' | 'outline' | 'ghost';
|
|
610
644
|
size?: 'sm' | 'md' | 'lg';
|
|
611
645
|
color?: 'sapphire' | 'emerald' | 'ruby';
|
|
612
646
|
}
|
|
613
|
-
declare const Button: React
|
|
647
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
614
648
|
|
|
615
|
-
interface InputProps extends Omit<React
|
|
649
|
+
interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'onChange' | 'value'> {
|
|
650
|
+
value?: string | number | readonly string[];
|
|
651
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
616
652
|
label?: string;
|
|
617
653
|
error?: string;
|
|
618
|
-
startIcon?: React
|
|
619
|
-
endIcon?: React
|
|
654
|
+
startIcon?: React.ReactNode;
|
|
655
|
+
endIcon?: React.ReactNode;
|
|
620
656
|
onClear?: () => void;
|
|
657
|
+
/**
|
|
658
|
+
* Callback that emits the value directly string.
|
|
659
|
+
*/
|
|
660
|
+
onValueChange?: (value: string) => void;
|
|
621
661
|
size?: 'sm' | 'md' | 'lg';
|
|
622
662
|
loading?: boolean;
|
|
663
|
+
/**
|
|
664
|
+
* Automatically selects the input text on focus.
|
|
665
|
+
*/
|
|
666
|
+
autoSelect?: boolean;
|
|
623
667
|
}
|
|
624
|
-
declare const Input: React
|
|
668
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
625
669
|
|
|
626
|
-
interface CheckboxProps extends Omit<React
|
|
670
|
+
interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
627
671
|
label?: string;
|
|
628
672
|
error?: string;
|
|
629
673
|
}
|
|
630
|
-
declare const Checkbox: React
|
|
674
|
+
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
631
675
|
|
|
632
676
|
interface RadioGroupProps {
|
|
633
677
|
name: string;
|
|
@@ -642,7 +686,7 @@ interface RadioGroupProps {
|
|
|
642
686
|
disabled?: boolean;
|
|
643
687
|
orientation?: 'horizontal' | 'vertical';
|
|
644
688
|
}
|
|
645
|
-
declare const RadioGroup: React
|
|
689
|
+
declare const RadioGroup: React.FC<RadioGroupProps>;
|
|
646
690
|
|
|
647
691
|
interface SelectOption {
|
|
648
692
|
value: string;
|
|
@@ -660,7 +704,7 @@ interface SelectProps {
|
|
|
660
704
|
disabled?: boolean;
|
|
661
705
|
className?: string;
|
|
662
706
|
}
|
|
663
|
-
declare const Select: React
|
|
707
|
+
declare const Select: React.FC<SelectProps>;
|
|
664
708
|
|
|
665
709
|
interface ToggleProps {
|
|
666
710
|
checked?: boolean;
|
|
@@ -669,31 +713,35 @@ interface ToggleProps {
|
|
|
669
713
|
label?: string;
|
|
670
714
|
size?: 'sm' | 'md' | 'lg';
|
|
671
715
|
}
|
|
672
|
-
declare const Toggle: React
|
|
716
|
+
declare const Toggle: React.FC<ToggleProps>;
|
|
673
717
|
|
|
674
|
-
interface TextareaProps extends React
|
|
718
|
+
interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
675
719
|
label?: string;
|
|
676
720
|
error?: string;
|
|
677
721
|
resize?: 'none' | 'vertical' | 'horizontal' | 'both';
|
|
722
|
+
/**
|
|
723
|
+
* Callback that emits the value directly.
|
|
724
|
+
*/
|
|
725
|
+
onValueChange?: (value: string) => void;
|
|
678
726
|
}
|
|
679
|
-
declare const Textarea: React
|
|
727
|
+
declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
680
728
|
|
|
681
|
-
interface CardProps extends React
|
|
729
|
+
interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
682
730
|
variant?: 'default' | 'outlined' | 'elevated';
|
|
683
731
|
padding?: 'none' | 'sm' | 'md' | 'lg';
|
|
684
732
|
}
|
|
685
|
-
declare const Card: React
|
|
733
|
+
declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
|
|
686
734
|
|
|
687
|
-
interface BadgeProps extends React
|
|
735
|
+
interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
688
736
|
variant?: 'default' | 'success' | 'warning' | 'error' | 'info';
|
|
689
737
|
size?: 'sm' | 'md' | 'lg';
|
|
690
738
|
}
|
|
691
|
-
declare const Badge: React
|
|
739
|
+
declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
|
|
692
740
|
|
|
693
741
|
interface TableColumn<T = any> {
|
|
694
742
|
key: string;
|
|
695
743
|
header: string;
|
|
696
|
-
render?: (item: T) => React
|
|
744
|
+
render?: (item: T) => React.ReactNode;
|
|
697
745
|
width?: string;
|
|
698
746
|
}
|
|
699
747
|
interface TableProps<T = any> {
|
|
@@ -702,20 +750,20 @@ interface TableProps<T = any> {
|
|
|
702
750
|
striped?: boolean;
|
|
703
751
|
hoverable?: boolean;
|
|
704
752
|
bordered?: boolean;
|
|
705
|
-
style?: React
|
|
753
|
+
style?: React.CSSProperties;
|
|
706
754
|
}
|
|
707
755
|
declare function Table<T extends Record<string, any>>({ columns, data, striped, hoverable, bordered, style, }: TableProps<T>): react_jsx_runtime.JSX.Element;
|
|
708
756
|
declare namespace Table {
|
|
709
757
|
var displayName: string;
|
|
710
758
|
}
|
|
711
759
|
|
|
712
|
-
interface ContainerProps extends React
|
|
760
|
+
interface ContainerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
713
761
|
maxWidth?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full';
|
|
714
762
|
padding?: 'none' | 'sm' | 'md' | 'lg';
|
|
715
763
|
}
|
|
716
|
-
declare const Container: React
|
|
764
|
+
declare const Container: React.ForwardRefExoticComponent<ContainerProps & React.RefAttributes<HTMLDivElement>>;
|
|
717
765
|
|
|
718
|
-
interface GridProps extends React
|
|
766
|
+
interface GridProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
719
767
|
columns?: number;
|
|
720
768
|
rows?: number;
|
|
721
769
|
gap?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | string;
|
|
@@ -723,25 +771,25 @@ interface GridProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
|
723
771
|
height?: string;
|
|
724
772
|
responsive?: boolean;
|
|
725
773
|
}
|
|
726
|
-
declare const Grid: React
|
|
774
|
+
declare const Grid: React.ForwardRefExoticComponent<GridProps & React.RefAttributes<HTMLDivElement>>;
|
|
727
775
|
|
|
728
|
-
interface StackProps extends React
|
|
776
|
+
interface StackProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
729
777
|
direction?: 'horizontal' | 'vertical';
|
|
730
778
|
gap?: 'none' | 'sm' | 'md' | 'lg' | 'xl';
|
|
731
779
|
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
732
780
|
justify?: 'start' | 'center' | 'end' | 'between' | 'around';
|
|
733
781
|
}
|
|
734
|
-
declare const Stack: React
|
|
782
|
+
declare const Stack: React.ForwardRefExoticComponent<StackProps & React.RefAttributes<HTMLDivElement>>;
|
|
735
783
|
|
|
736
784
|
interface ModalProps {
|
|
737
785
|
isOpen: boolean;
|
|
738
786
|
onClose: () => void;
|
|
739
787
|
title?: string;
|
|
740
|
-
children: React
|
|
788
|
+
children: React.ReactNode;
|
|
741
789
|
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
742
790
|
closeOnOverlayClick?: boolean;
|
|
743
791
|
}
|
|
744
|
-
declare const Modal: React
|
|
792
|
+
declare const Modal: React.FC<ModalProps>;
|
|
745
793
|
|
|
746
794
|
interface PrimusDateRangeOption {
|
|
747
795
|
label: string;
|
|
@@ -761,7 +809,7 @@ interface PrimusDateRangePickerProps {
|
|
|
761
809
|
label?: string;
|
|
762
810
|
}) => void;
|
|
763
811
|
}
|
|
764
|
-
declare const PrimusDateRangePicker: React
|
|
812
|
+
declare const PrimusDateRangePicker: React.FC<PrimusDateRangePickerProps>;
|
|
765
813
|
|
|
766
814
|
type PrimusFilterType = 'select' | 'toggle' | 'search';
|
|
767
815
|
interface PrimusFilterConfig {
|
|
@@ -779,9 +827,9 @@ interface PrimusFilterBarProps {
|
|
|
779
827
|
filters: PrimusFilterConfig[];
|
|
780
828
|
activeFilters: Record<string, any>;
|
|
781
829
|
onChange?: (nextFilters: Record<string, any>) => void;
|
|
782
|
-
children?: React
|
|
830
|
+
children?: React.ReactNode;
|
|
783
831
|
}
|
|
784
|
-
declare const PrimusFilterBar: React
|
|
832
|
+
declare const PrimusFilterBar: React.FC<PrimusFilterBarProps>;
|
|
785
833
|
|
|
786
834
|
interface PrimusExportMenuProps {
|
|
787
835
|
formats?: string[];
|
|
@@ -795,7 +843,7 @@ interface PrimusExportMenuProps {
|
|
|
795
843
|
includeTables: boolean;
|
|
796
844
|
}) => void;
|
|
797
845
|
}
|
|
798
|
-
declare const PrimusExportMenu: React
|
|
846
|
+
declare const PrimusExportMenu: React.FC<PrimusExportMenuProps>;
|
|
799
847
|
|
|
800
848
|
interface PrimusSearchProps {
|
|
801
849
|
placeholder?: string;
|
|
@@ -805,6 +853,72 @@ interface PrimusSearchProps {
|
|
|
805
853
|
suggestions?: string[];
|
|
806
854
|
onSearch?: (value: string) => void;
|
|
807
855
|
}
|
|
808
|
-
declare const PrimusSearch: React
|
|
856
|
+
declare const PrimusSearch: React.FC<PrimusSearchProps>;
|
|
857
|
+
|
|
858
|
+
interface PrimusWizardProps {
|
|
859
|
+
title?: string;
|
|
860
|
+
subtitle?: string;
|
|
861
|
+
children: React.ReactNode;
|
|
862
|
+
onComplete?: () => void;
|
|
863
|
+
className?: string;
|
|
864
|
+
startStep?: number;
|
|
865
|
+
}
|
|
866
|
+
interface PrimusStepProps {
|
|
867
|
+
label: string;
|
|
868
|
+
description?: string;
|
|
869
|
+
children: React.ReactNode;
|
|
870
|
+
isValid?: boolean;
|
|
871
|
+
}
|
|
872
|
+
declare const PrimusStep: React.FC<PrimusStepProps>;
|
|
873
|
+
declare const PrimusStepper: React.FC<{
|
|
874
|
+
steps: {
|
|
875
|
+
label: string;
|
|
876
|
+
description?: string;
|
|
877
|
+
}[];
|
|
878
|
+
currentStep: number;
|
|
879
|
+
}>;
|
|
880
|
+
declare const PrimusWizard: React.FC<PrimusWizardProps>;
|
|
881
|
+
|
|
882
|
+
interface FieldProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
883
|
+
children: React.ReactNode;
|
|
884
|
+
error?: string;
|
|
885
|
+
disabled?: boolean;
|
|
886
|
+
dense?: boolean;
|
|
887
|
+
}
|
|
888
|
+
declare const Field: ({ children, error, disabled, dense, className, ...props }: FieldProps) => react_jsx_runtime.JSX.Element;
|
|
889
|
+
interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
890
|
+
required?: boolean;
|
|
891
|
+
indicator?: React.ReactNode;
|
|
892
|
+
}
|
|
893
|
+
declare const Label: ({ className, children, required, indicator, ...props }: LabelProps) => react_jsx_runtime.JSX.Element;
|
|
894
|
+
interface FieldDescriptionProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
895
|
+
}
|
|
896
|
+
declare const FieldDescription: ({ className, children, ...props }: FieldDescriptionProps) => react_jsx_runtime.JSX.Element;
|
|
897
|
+
interface FieldErrorProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
898
|
+
forceVisible?: boolean;
|
|
899
|
+
}
|
|
900
|
+
declare const FieldError: ({ className, children, forceVisible, ...props }: FieldErrorProps) => react_jsx_runtime.JSX.Element | null;
|
|
901
|
+
|
|
902
|
+
interface InputGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
903
|
+
children: React.ReactNode;
|
|
904
|
+
size?: 'sm' | 'md' | 'lg';
|
|
905
|
+
}
|
|
906
|
+
declare const InputGroup: ({ className, children, size, ...props }: InputGroupProps) => react_jsx_runtime.JSX.Element;
|
|
907
|
+
interface InputAddonProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
908
|
+
children: React.ReactNode;
|
|
909
|
+
}
|
|
910
|
+
declare const InputAddon: ({ className, children, ...props }: InputAddonProps) => react_jsx_runtime.JSX.Element;
|
|
911
|
+
|
|
912
|
+
interface PasswordInputProps extends Omit<InputProps, 'type' | 'endIcon'> {
|
|
913
|
+
}
|
|
914
|
+
declare const PasswordInput: React.ForwardRefExoticComponent<PasswordInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
915
|
+
|
|
916
|
+
interface SearchInputProps extends Omit<InputProps, 'onChange' | 'value'> {
|
|
917
|
+
value?: string;
|
|
918
|
+
onSearch?: (value: string) => void;
|
|
919
|
+
debounceMs?: number;
|
|
920
|
+
placeholder?: string;
|
|
921
|
+
}
|
|
922
|
+
declare const SearchInput: React.ForwardRefExoticComponent<SearchInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
809
923
|
|
|
810
|
-
export { AICopilot, AccountDashboard, AgentDirectory, Badge, Button, Card, Checkbox, CheckoutForm, type CheckoutFormProps, ClaimStatusTracker, type ClaimStatusTrackerProps, type ClaimStep, type Column, Container, type CreditCardProps, CreditCardVisual, CreditScoreCard, DashboardGrid, type DashboardGridProps, type Document, DocumentViewer, type DocumentViewerProps, type FeatureFlag, FeatureFlagToggle, FileUploader, FraudDetectionDashboard, Grid, Input, KYCVerification, LoanCalculator, LogViewer, LoginPage, Modal, type Notification$1 as Notification, NotificationBell, PrimusNotificationFeed as NotificationFeed, PolicyCard, type PolicyProps, PremiumCalculator, PrimusActivityFeed, type PrimusActivityFeedProps, type PrimusActivityItem, PrimusAreaChart, type PrimusAreaChartProps, Badge as PrimusBadge, PrimusBarChart, type PrimusBarChartProps, Button as PrimusButton, Card as PrimusCard, PrimusChartBase, type PrimusChartBaseProps, type PrimusChartSeries, Checkbox as PrimusCheckbox, Container as PrimusContainer, PrimusDashboard, type PrimusDashboardProps, PrimusDataTable, type PrimusDataTableProps, PrimusDateRangePicker, PrimusExportMenu, PrimusFilterBar, Grid as PrimusGrid, PrimusHeader, type PrimusHeaderProps, Input as PrimusInput, PrimusLayout, type PrimusLayoutProps, PrimusLineChart, type PrimusLineChartProps, PrimusLogin, type PrimusLoginProps, PrimusModal, Modal as PrimusModalComponent, type PrimusModalProps, type PrimusNotification, PrimusNotificationCenter, PrimusNotificationFeed, PrimusNotifications, PrimusPieChart, type PrimusPieChartProps, PrimusProvider, type PrimusProviderProps, RadioGroup as PrimusRadioGroup, PrimusSearch, Select as PrimusSelect, PrimusSidebar, type PrimusSidebarProps, PrimusSparkline, type PrimusSparklineProps, Stack as PrimusStack, PrimusStatCard, Table as PrimusTable, Textarea as PrimusTextarea, type PrimusTheme, PrimusThemeProvider, PrimusThemeToggle, Toggle as PrimusToggle, QuoteComparison, RadioGroup, SecurityDashboard, Select, type SidebarItem, type SocialProvider, Stack, type StatCardProps, Table, Textarea, Toggle, type Transaction, TransactionHistory, type TransactionHistoryProps, type UseNotificationsOptions, type UseRealtimeNotificationsOptions, UserProfile, type UserProfileProps, themeColors, useNotifications, usePrimusAuth, usePrimusTheme, useRealtimeNotifications };
|
|
924
|
+
export { AICopilot, AccountDashboard, AgentDirectory, Badge, Button, Card, Checkbox, CheckoutForm, type CheckoutFormProps, ClaimStatusTracker, type ClaimStatusTrackerProps, type ClaimStep, type Column, Container, type CreditCardProps, CreditCardVisual, CreditScoreCard, DashboardGrid, type DashboardGridProps, type Document, DocumentViewer, type DocumentViewerProps, type FeatureFlag, FeatureFlagToggle, Field, FieldDescription, FieldError, FileUploader, FraudDetectionDashboard, Grid, Input, InputAddon, InputGroup, KYCVerification, Label, LoanCalculator, LogViewer, LoginPage, Modal, type Notification$1 as Notification, NotificationBell, PrimusNotificationFeed as NotificationFeed, PasswordInput, PolicyCard, type PolicyProps, PremiumCalculator, PrimusActivityFeed, type PrimusActivityFeedProps, type PrimusActivityItem, PrimusAreaChart, type PrimusAreaChartProps, Badge as PrimusBadge, PrimusBarChart, type PrimusBarChartProps, Button as PrimusButton, Card as PrimusCard, PrimusChartBase, type PrimusChartBaseProps, type PrimusChartSeries, Checkbox as PrimusCheckbox, Container as PrimusContainer, PrimusDashboard, type PrimusDashboardProps, PrimusDataTable, type PrimusDataTableProps, PrimusDateRangePicker, PrimusExportMenu, Field as PrimusField, FieldDescription as PrimusFieldDescription, FieldError as PrimusFieldError, PrimusFilterBar, Grid as PrimusGrid, PrimusHeader, type PrimusHeaderProps, Input as PrimusInput, InputAddon as PrimusInputAddon, InputGroup as PrimusInputGroup, Label as PrimusLabel, PrimusLayout, type PrimusLayoutProps, PrimusLineChart, type PrimusLineChartProps, PrimusLogin, type PrimusLoginProps, PrimusModal, Modal as PrimusModalComponent, type PrimusModalProps, type PrimusNotification, PrimusNotificationCenter, PrimusNotificationFeed, PrimusNotifications, PasswordInput as PrimusPasswordInput, PrimusPieChart, type PrimusPieChartProps, PrimusProvider, type PrimusProviderProps, RadioGroup as PrimusRadioGroup, PrimusSearch, SearchInput as PrimusSearchInput, PrimusSection, type PrimusSectionProps, Select as PrimusSelect, PrimusSidebar, type PrimusSidebarProps, PrimusSparkline, type PrimusSparklineProps, Stack as PrimusStack, PrimusStatCard, PrimusStatCard as PrimusStatsCard, PrimusStep, type PrimusStepProps, PrimusStepper, PrimusSummaryCard, type PrimusSummaryCardProps, Table as PrimusTable, Textarea as PrimusTextarea, type PrimusTheme, PrimusThemeProvider, PrimusThemeToggle, Toggle as PrimusToggle, PrimusWizard, type PrimusWizardProps, QuoteComparison, RadioGroup, SearchInput, SecurityDashboard, Select, type SidebarItem, type SocialProvider, Stack, type StatCardProps, Table, Textarea, Toggle, type Transaction, TransactionHistory, type TransactionHistoryProps, type UseNotificationsOptions, type UseRealtimeNotificationsOptions, UserProfile, type UserProfileProps, themeColors, useNotifications, usePrimusAuth, usePrimusFetch, usePrimusTheme, useRealtimeNotifications };
|