primus-saas-react 1.0.2 → 1.0.4

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.
Files changed (47) hide show
  1. package/dist/index.js +9 -1
  2. package/dist/index.mjs +9 -1
  3. package/dist/styles.css +568 -0
  4. package/package.json +8 -2
  5. package/DEMO.md +0 -68
  6. package/INTEGRATION.md +0 -702
  7. package/build_log.txt +0 -0
  8. package/postcss.config.js +0 -6
  9. package/src/components/ai/AICopilot.tsx +0 -88
  10. package/src/components/auth/PrimusLogin.tsx +0 -298
  11. package/src/components/auth/UserProfile.tsx +0 -26
  12. package/src/components/banking/accounts/AccountDashboard.tsx +0 -67
  13. package/src/components/banking/cards/CreditCardVisual.tsx +0 -67
  14. package/src/components/banking/credit/CreditScoreCard.tsx +0 -80
  15. package/src/components/banking/kyc/KYCVerification.tsx +0 -76
  16. package/src/components/banking/loans/LoanCalculator.tsx +0 -106
  17. package/src/components/banking/transactions/TransactionHistory.tsx +0 -74
  18. package/src/components/crud/PrimusDataTable.tsx +0 -220
  19. package/src/components/crud/PrimusModal.tsx +0 -68
  20. package/src/components/dashboard/PrimusDashboard.tsx +0 -145
  21. package/src/components/documents/DocumentViewer.tsx +0 -107
  22. package/src/components/featureflags/FeatureFlagToggle.tsx +0 -64
  23. package/src/components/insurance/agents/AgentDirectory.tsx +0 -72
  24. package/src/components/insurance/claims/ClaimStatusTracker.tsx +0 -78
  25. package/src/components/insurance/fraud/FraudDetectionDashboard.tsx +0 -68
  26. package/src/components/insurance/policies/PolicyCard.tsx +0 -77
  27. package/src/components/insurance/premium/PremiumCalculator.tsx +0 -104
  28. package/src/components/insurance/quotes/QuoteComparison.tsx +0 -75
  29. package/src/components/layout/PrimusHeader.tsx +0 -75
  30. package/src/components/layout/PrimusLayout.tsx +0 -47
  31. package/src/components/layout/PrimusSidebar.tsx +0 -102
  32. package/src/components/logging/LogViewer.tsx +0 -90
  33. package/src/components/notifications/NotificationFeed.tsx +0 -106
  34. package/src/components/notifications/PrimusNotificationCenter.tsx +0 -282
  35. package/src/components/payments/CheckoutForm.tsx +0 -167
  36. package/src/components/security/SecurityDashboard.tsx +0 -83
  37. package/src/components/shared/Button.tsx +0 -36
  38. package/src/components/shared/Input.tsx +0 -36
  39. package/src/components/storage/FileUploader.tsx +0 -79
  40. package/src/context/PrimusProvider.tsx +0 -147
  41. package/src/context/PrimusThemeProvider.tsx +0 -160
  42. package/src/hooks/useNotifications.ts +0 -58
  43. package/src/hooks/usePrimusAuth.ts +0 -3
  44. package/src/hooks/useRealtimeNotifications.ts +0 -114
  45. package/src/index.ts +0 -42
  46. package/tailwind.config.js +0 -18
  47. package/tsconfig.json +0 -28
package/dist/index.js CHANGED
@@ -1189,7 +1189,15 @@ var PrimusProvider = ({
1189
1189
  var usePrimusAuth = () => {
1190
1190
  const context = (0, import_react14.useContext)(PrimusAuthContext);
1191
1191
  if (context === void 0) {
1192
- throw new Error("usePrimusAuth must be used within a PrimusProvider");
1192
+ return {
1193
+ isAuthenticated: false,
1194
+ user: null,
1195
+ login: async () => ({ success: false, error: "PrimusProvider not configured" }),
1196
+ logout: async () => {
1197
+ },
1198
+ token: null,
1199
+ isLoading: false
1200
+ };
1193
1201
  }
1194
1202
  return context;
1195
1203
  };
package/dist/index.mjs CHANGED
@@ -1113,7 +1113,15 @@ var PrimusProvider = ({
1113
1113
  var usePrimusAuth = () => {
1114
1114
  const context = useContext2(PrimusAuthContext);
1115
1115
  if (context === void 0) {
1116
- throw new Error("usePrimusAuth must be used within a PrimusProvider");
1116
+ return {
1117
+ isAuthenticated: false,
1118
+ user: null,
1119
+ login: async () => ({ success: false, error: "PrimusProvider not configured" }),
1120
+ logout: async () => {
1121
+ },
1122
+ token: null,
1123
+ isLoading: false
1124
+ };
1117
1125
  }
1118
1126
  return context;
1119
1127
  };
@@ -0,0 +1,568 @@
1
+ /* Primus SaaS React - Bundled Styles */
2
+ /* Import this file: import 'primus-saas-react/dist/styles.css' */
3
+
4
+ /* Base resets */
5
+ *,
6
+ *::before,
7
+ *::after {
8
+ box-sizing: border-box;
9
+ }
10
+
11
+ /* Animation utilities */
12
+ @keyframes pulse {
13
+ 50% {
14
+ opacity: .5;
15
+ }
16
+ }
17
+
18
+ @keyframes spin {
19
+ to {
20
+ transform: rotate(360deg);
21
+ }
22
+ }
23
+
24
+ @keyframes ping {
25
+
26
+ 75%,
27
+ 100% {
28
+ transform: scale(2);
29
+ opacity: 0;
30
+ }
31
+ }
32
+
33
+ @keyframes fadeIn {
34
+ from {
35
+ opacity: 0;
36
+ }
37
+
38
+ to {
39
+ opacity: 1;
40
+ }
41
+ }
42
+
43
+ @keyframes slideIn {
44
+ from {
45
+ transform: translateY(-10px);
46
+ opacity: 0;
47
+ }
48
+
49
+ to {
50
+ transform: translateY(0);
51
+ opacity: 1;
52
+ }
53
+ }
54
+
55
+ .animate-pulse {
56
+ animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
57
+ }
58
+
59
+ .animate-spin {
60
+ animation: spin 1s linear infinite;
61
+ }
62
+
63
+ .animate-ping {
64
+ animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
65
+ }
66
+
67
+ /* Layout */
68
+ .min-h-screen {
69
+ min-height: 100vh;
70
+ }
71
+
72
+ .flex {
73
+ display: flex;
74
+ }
75
+
76
+ .inline-flex {
77
+ display: inline-flex;
78
+ }
79
+
80
+ .grid {
81
+ display: grid;
82
+ }
83
+
84
+ .hidden {
85
+ display: none;
86
+ }
87
+
88
+ .block {
89
+ display: block;
90
+ }
91
+
92
+ .items-center {
93
+ align-items: center;
94
+ }
95
+
96
+ .justify-center {
97
+ justify-content: center;
98
+ }
99
+
100
+ .justify-between {
101
+ justify-content: space-between;
102
+ }
103
+
104
+ .flex-col {
105
+ flex-direction: column;
106
+ }
107
+
108
+ .gap-2 {
109
+ gap: 0.5rem;
110
+ }
111
+
112
+ .gap-3 {
113
+ gap: 0.75rem;
114
+ }
115
+
116
+ .gap-4 {
117
+ gap: 1rem;
118
+ }
119
+
120
+ .space-y-2>*+* {
121
+ margin-top: 0.5rem;
122
+ }
123
+
124
+ .space-y-3>*+* {
125
+ margin-top: 0.75rem;
126
+ }
127
+
128
+ .space-y-4>*+* {
129
+ margin-top: 1rem;
130
+ }
131
+
132
+ /* Sizing */
133
+ .w-full {
134
+ width: 100%;
135
+ }
136
+
137
+ .max-w-md {
138
+ max-width: 28rem;
139
+ }
140
+
141
+ .h-5 {
142
+ height: 1.25rem;
143
+ }
144
+
145
+ .w-5 {
146
+ width: 1.25rem;
147
+ }
148
+
149
+ .h-12 {
150
+ height: 3rem;
151
+ }
152
+
153
+ .w-12 {
154
+ width: 3rem;
155
+ }
156
+
157
+ /* Spacing */
158
+ .p-2 {
159
+ padding: 0.5rem;
160
+ }
161
+
162
+ .p-3 {
163
+ padding: 0.75rem;
164
+ }
165
+
166
+ .p-4 {
167
+ padding: 1rem;
168
+ }
169
+
170
+ .p-8 {
171
+ padding: 2rem;
172
+ }
173
+
174
+ .px-4 {
175
+ padding-left: 1rem;
176
+ padding-right: 1rem;
177
+ }
178
+
179
+ .py-2 {
180
+ padding-top: 0.5rem;
181
+ padding-bottom: 0.5rem;
182
+ }
183
+
184
+ .py-2\.5 {
185
+ padding-top: 0.625rem;
186
+ padding-bottom: 0.625rem;
187
+ }
188
+
189
+ .mb-4 {
190
+ margin-bottom: 1rem;
191
+ }
192
+
193
+ .mb-6 {
194
+ margin-bottom: 1.5rem;
195
+ }
196
+
197
+ .mb-8 {
198
+ margin-bottom: 2rem;
199
+ }
200
+
201
+ .mt-2 {
202
+ margin-top: 0.5rem;
203
+ }
204
+
205
+ .mt-4 {
206
+ margin-top: 1rem;
207
+ }
208
+
209
+ .mt-6 {
210
+ margin-top: 1.5rem;
211
+ }
212
+
213
+ .mx-auto {
214
+ margin-left: auto;
215
+ margin-right: auto;
216
+ }
217
+
218
+ .ml-1 {
219
+ margin-left: 0.25rem;
220
+ }
221
+
222
+ .my-6 {
223
+ margin-top: 1.5rem;
224
+ margin-bottom: 1.5rem;
225
+ }
226
+
227
+ /* Typography */
228
+ .text-center {
229
+ text-align: center;
230
+ }
231
+
232
+ .text-xs {
233
+ font-size: 0.75rem;
234
+ line-height: 1rem;
235
+ }
236
+
237
+ .text-sm {
238
+ font-size: 0.875rem;
239
+ line-height: 1.25rem;
240
+ }
241
+
242
+ .text-lg {
243
+ font-size: 1.125rem;
244
+ line-height: 1.75rem;
245
+ }
246
+
247
+ .text-xl {
248
+ font-size: 1.25rem;
249
+ line-height: 1.75rem;
250
+ }
251
+
252
+ .text-2xl {
253
+ font-size: 1.5rem;
254
+ line-height: 2rem;
255
+ }
256
+
257
+ .font-medium {
258
+ font-weight: 500;
259
+ }
260
+
261
+ .font-semibold {
262
+ font-weight: 600;
263
+ }
264
+
265
+ .font-bold {
266
+ font-weight: 700;
267
+ }
268
+
269
+ .tracking-tight {
270
+ letter-spacing: -0.025em;
271
+ }
272
+
273
+ .uppercase {
274
+ text-transform: uppercase;
275
+ }
276
+
277
+ /* Colors */
278
+ .text-white {
279
+ color: #ffffff;
280
+ }
281
+
282
+ .text-gray-400 {
283
+ color: #9ca3af;
284
+ }
285
+
286
+ .text-gray-500 {
287
+ color: #6b7280;
288
+ }
289
+
290
+ .text-gray-600 {
291
+ color: #4b5563;
292
+ }
293
+
294
+ .text-gray-700 {
295
+ color: #374151;
296
+ }
297
+
298
+ .text-gray-900 {
299
+ color: #111827;
300
+ }
301
+
302
+ .text-violet-600 {
303
+ color: #7c3aed;
304
+ }
305
+
306
+ .text-blue-600 {
307
+ color: #2563eb;
308
+ }
309
+
310
+ .bg-white {
311
+ background-color: #ffffff;
312
+ }
313
+
314
+ .bg-gray-50 {
315
+ background-color: #f9fafb;
316
+ }
317
+
318
+ .bg-gray-100 {
319
+ background-color: #f3f4f6;
320
+ }
321
+
322
+ .bg-gray-900 {
323
+ background-color: #111827;
324
+ }
325
+
326
+ .bg-violet-600 {
327
+ background-color: #7c3aed;
328
+ }
329
+
330
+ .bg-blue-600 {
331
+ background-color: #2563eb;
332
+ }
333
+
334
+ .bg-black {
335
+ background-color: #000000;
336
+ }
337
+
338
+ .bg-gradient-to-br {
339
+ background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
340
+ }
341
+
342
+ .bg-gradient-to-r {
343
+ background-image: linear-gradient(to right, var(--tw-gradient-stops));
344
+ }
345
+
346
+ .from-gray-50 {
347
+ --tw-gradient-from: #f9fafb;
348
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent);
349
+ }
350
+
351
+ .from-violet-600 {
352
+ --tw-gradient-from: #7c3aed;
353
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent);
354
+ }
355
+
356
+ .via-white {
357
+ --tw-gradient-stops: var(--tw-gradient-from), #ffffff, var(--tw-gradient-to, transparent);
358
+ }
359
+
360
+ .to-violet-50 {
361
+ --tw-gradient-to: #f5f3ff;
362
+ }
363
+
364
+ .to-purple-600 {
365
+ --tw-gradient-to: #9333ea;
366
+ }
367
+
368
+ /* Borders */
369
+ .border {
370
+ border-width: 1px;
371
+ }
372
+
373
+ .border-t {
374
+ border-top-width: 1px;
375
+ }
376
+
377
+ .border-gray-200 {
378
+ border-color: #e5e7eb;
379
+ }
380
+
381
+ .border-gray-300 {
382
+ border-color: #d1d5db;
383
+ }
384
+
385
+ .rounded {
386
+ border-radius: 0.25rem;
387
+ }
388
+
389
+ .rounded-lg {
390
+ border-radius: 0.5rem;
391
+ }
392
+
393
+ .rounded-xl {
394
+ border-radius: 0.75rem;
395
+ }
396
+
397
+ .rounded-2xl {
398
+ border-radius: 1rem;
399
+ }
400
+
401
+ .rounded-full {
402
+ border-radius: 9999px;
403
+ }
404
+
405
+ /* Shadows */
406
+ .shadow-lg {
407
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
408
+ }
409
+
410
+ .shadow-xl {
411
+ box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
412
+ }
413
+
414
+ .shadow-violet-500\/20 {
415
+ box-shadow: 0 10px 15px -3px rgba(124, 58, 237, 0.2);
416
+ }
417
+
418
+ /* Effects */
419
+ .backdrop-blur-xl {
420
+ backdrop-filter: blur(24px);
421
+ }
422
+
423
+ .opacity-90 {
424
+ opacity: 0.9;
425
+ }
426
+
427
+ .opacity-50 {
428
+ opacity: 0.5;
429
+ }
430
+
431
+ /* Transitions */
432
+ .transition-all {
433
+ transition-property: all;
434
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
435
+ transition-duration: 150ms;
436
+ }
437
+
438
+ .transition-colors {
439
+ transition-property: color, background-color, border-color;
440
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
441
+ transition-duration: 150ms;
442
+ }
443
+
444
+ .transition-opacity {
445
+ transition-property: opacity;
446
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
447
+ transition-duration: 150ms;
448
+ }
449
+
450
+ .duration-200 {
451
+ transition-duration: 200ms;
452
+ }
453
+
454
+ /* Interactive */
455
+ .cursor-pointer {
456
+ cursor: pointer;
457
+ }
458
+
459
+ .disabled\:opacity-50:disabled {
460
+ opacity: 0.5;
461
+ }
462
+
463
+ .hover\:bg-gray-50:hover {
464
+ background-color: #f9fafb;
465
+ }
466
+
467
+ .hover\:bg-gray-100:hover {
468
+ background-color: #f3f4f6;
469
+ }
470
+
471
+ .hover\:bg-violet-500:hover {
472
+ background-color: #8b5cf6;
473
+ }
474
+
475
+ .hover\:opacity-90:hover {
476
+ opacity: 0.9;
477
+ }
478
+
479
+ .focus\:outline-none:focus {
480
+ outline: 2px solid transparent;
481
+ outline-offset: 2px;
482
+ }
483
+
484
+ .focus\:ring-1:focus {
485
+ box-shadow: 0 0 0 1px var(--tw-ring-color);
486
+ }
487
+
488
+ .focus\:ring-violet-500:focus {
489
+ --tw-ring-color: #8b5cf6;
490
+ }
491
+
492
+ .focus\:border-violet-500:focus {
493
+ border-color: #8b5cf6;
494
+ }
495
+
496
+ /* Position */
497
+ .relative {
498
+ position: relative;
499
+ }
500
+
501
+ .absolute {
502
+ position: absolute;
503
+ }
504
+
505
+ .inset-0 {
506
+ top: 0;
507
+ right: 0;
508
+ bottom: 0;
509
+ left: 0;
510
+ }
511
+
512
+ .z-10 {
513
+ z-index: 10;
514
+ }
515
+
516
+ /* Placeholder */
517
+ .placeholder\:text-gray-400::placeholder {
518
+ color: #9ca3af;
519
+ }
520
+
521
+ /* Social button specific colors */
522
+ .\!bg-\[\#0078D4\] {
523
+ background-color: #0078D4 !important;
524
+ }
525
+
526
+ .\!bg-\[\#1877F2\] {
527
+ background-color: #1877F2 !important;
528
+ }
529
+
530
+ .bg-\[\#0078D4\] {
531
+ background-color: #0078D4;
532
+ }
533
+
534
+ .bg-\[\#006CBD\] {
535
+ background-color: #006CBD;
536
+ }
537
+
538
+ .bg-\[\#1877F2\] {
539
+ background-color: #1877F2;
540
+ }
541
+
542
+ .bg-\[\#166FE5\] {
543
+ background-color: #166FE5;
544
+ }
545
+
546
+ .border-\[\#0078D4\] {
547
+ border-color: #0078D4;
548
+ }
549
+
550
+ .border-\[\#1877F2\] {
551
+ border-color: #1877F2;
552
+ }
553
+
554
+ .hover\:bg-\[\#006CBD\]:hover {
555
+ background-color: #006CBD;
556
+ }
557
+
558
+ .hover\:bg-\[\#166FE5\]:hover {
559
+ background-color: #166FE5;
560
+ }
561
+
562
+ .hover\:bg-gray-800:hover {
563
+ background-color: #1f2937;
564
+ }
565
+
566
+ .hover\:bg-gray-900:hover {
567
+ background-color: #111827;
568
+ }
package/package.json CHANGED
@@ -1,11 +1,17 @@
1
1
  {
2
2
  "name": "primus-saas-react",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Premium React UI Elements for Primus SaaS Framework",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
8
- "sideEffects": false,
8
+ "style": "dist/styles.css",
9
+ "sideEffects": [
10
+ "*.css"
11
+ ],
12
+ "files": [
13
+ "dist"
14
+ ],
9
15
  "scripts": {
10
16
  "build": "tsup src/index.ts --format cjs,esm --dts",
11
17
  "lint": "eslint src/",
package/DEMO.md DELETED
@@ -1,68 +0,0 @@
1
- # Primus Authentication Demo - One-Click Launch
2
-
3
- ## Prerequisites
4
- - Node.js 18+
5
- - .NET 8 SDK
6
-
7
- ## Quick Start
8
-
9
- ### 1. Start Backend (Terminal 1)
10
- ```powershell
11
- cd examples/LiveDemoApi
12
- dotnet run
13
- ```
14
- Backend runs at: http://localhost:5221
15
-
16
- ### 2. Start UI Gallery (Terminal 2)
17
- ```powershell
18
- cd test-apps/ui-gallery
19
- npm run dev
20
- ```
21
- Frontend runs at: http://localhost:5173
22
-
23
- ## Demo Flow
24
-
25
- 1. Open http://localhost:5173
26
- 2. Click **"Platform"** tab
27
- 3. Use the **PrimusLogin** component:
28
- - Email: `demo@primus.local`
29
- - Password: `PrimusDemo123!`
30
- 4. Click **Sign in**
31
-
32
- The component will call the real backend API at `/auth/local` and authenticate.
33
-
34
- ## What's Happening
35
-
36
- ```
37
- ┌─────────────────┐ POST /auth/local ┌─────────────────┐
38
- │ PrimusLogin │ ───────────────────────> │ LiveDemoApi │
39
- │ (React UI) │ │ (.NET 8) │
40
- │ │ <───────────────────── │ │
41
- │ │ { access_token } │ PrimusSaaS │
42
- └─────────────────┘ │ Identity SDK │
43
- └─────────────────┘
44
- ```
45
-
46
- ## API Endpoints
47
-
48
- | Endpoint | Method | Description |
49
- |----------|--------|-------------|
50
- | `/auth/local` | POST | Email/password login |
51
- | `/auth/auth0` | POST | Auth0 token |
52
- | `/auth/azure` | POST | Azure AD token |
53
- | `/whoami` | GET | Get current user (requires Bearer token) |
54
-
55
- ## Configuration
56
-
57
- In your app, wrap with `PrimusProvider`:
58
-
59
- ```tsx
60
- <PrimusProvider
61
- authority="http://localhost:5221" // Your API URL
62
- clientId="demo"
63
- onLoginSuccess={(user, token) => console.log('Logged in!', user)}
64
- onLoginError={(error) => console.error('Failed:', error)}
65
- >
66
- <PrimusLogin allowSocial onSuccess={() => navigate('/dashboard')} />
67
- </PrimusProvider>
68
- ```