primus-saas-react 1.0.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.
Files changed (49) hide show
  1. package/DEMO.md +68 -0
  2. package/INTEGRATION.md +702 -0
  3. package/README.md +82 -0
  4. package/build_log.txt +0 -0
  5. package/dist/index.d.mts +446 -0
  6. package/dist/index.d.ts +446 -0
  7. package/dist/index.js +2513 -0
  8. package/dist/index.mjs +2445 -0
  9. package/package.json +37 -0
  10. package/postcss.config.js +6 -0
  11. package/src/components/ai/AICopilot.tsx +88 -0
  12. package/src/components/auth/PrimusLogin.tsx +149 -0
  13. package/src/components/auth/UserProfile.tsx +26 -0
  14. package/src/components/banking/accounts/AccountDashboard.tsx +67 -0
  15. package/src/components/banking/cards/CreditCardVisual.tsx +67 -0
  16. package/src/components/banking/credit/CreditScoreCard.tsx +80 -0
  17. package/src/components/banking/kyc/KYCVerification.tsx +76 -0
  18. package/src/components/banking/loans/LoanCalculator.tsx +106 -0
  19. package/src/components/banking/transactions/TransactionHistory.tsx +74 -0
  20. package/src/components/crud/PrimusDataTable.tsx +220 -0
  21. package/src/components/crud/PrimusModal.tsx +68 -0
  22. package/src/components/dashboard/PrimusDashboard.tsx +145 -0
  23. package/src/components/documents/DocumentViewer.tsx +107 -0
  24. package/src/components/featureflags/FeatureFlagToggle.tsx +64 -0
  25. package/src/components/insurance/agents/AgentDirectory.tsx +72 -0
  26. package/src/components/insurance/claims/ClaimStatusTracker.tsx +78 -0
  27. package/src/components/insurance/fraud/FraudDetectionDashboard.tsx +68 -0
  28. package/src/components/insurance/policies/PolicyCard.tsx +77 -0
  29. package/src/components/insurance/premium/PremiumCalculator.tsx +104 -0
  30. package/src/components/insurance/quotes/QuoteComparison.tsx +75 -0
  31. package/src/components/layout/PrimusHeader.tsx +75 -0
  32. package/src/components/layout/PrimusLayout.tsx +47 -0
  33. package/src/components/layout/PrimusSidebar.tsx +102 -0
  34. package/src/components/logging/LogViewer.tsx +90 -0
  35. package/src/components/notifications/NotificationFeed.tsx +106 -0
  36. package/src/components/notifications/PrimusNotificationCenter.tsx +282 -0
  37. package/src/components/payments/CheckoutForm.tsx +167 -0
  38. package/src/components/security/SecurityDashboard.tsx +83 -0
  39. package/src/components/shared/Button.tsx +36 -0
  40. package/src/components/shared/Input.tsx +36 -0
  41. package/src/components/storage/FileUploader.tsx +79 -0
  42. package/src/context/PrimusProvider.tsx +147 -0
  43. package/src/context/PrimusThemeProvider.tsx +160 -0
  44. package/src/hooks/useNotifications.ts +58 -0
  45. package/src/hooks/usePrimusAuth.ts +3 -0
  46. package/src/hooks/useRealtimeNotifications.ts +114 -0
  47. package/src/index.ts +42 -0
  48. package/tailwind.config.js +18 -0
  49. package/tsconfig.json +28 -0
package/DEMO.md ADDED
@@ -0,0 +1,68 @@
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
+ ```