@jmruthers/pace-core 0.5.137 → 0.5.140

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 (132) hide show
  1. package/dist/{DataTable-6M4L6BI2.js → DataTable-JXFCA2BJ.js} +3 -3
  2. package/dist/{chunk-KYRHUBIU.js → chunk-5JMOHWDI.js} +3 -3
  3. package/dist/{chunk-BCIBECNB.js → chunk-6DXZ6V5Q.js} +2 -2
  4. package/dist/{chunk-BLCXZEYF.js → chunk-BOOI7GK2.js} +36 -10
  5. package/dist/chunk-BOOI7GK2.js.map +1 -0
  6. package/dist/{chunk-HAWZXGR2.js → chunk-TLT2ZR3L.js} +2 -2
  7. package/dist/components.js +3 -3
  8. package/dist/index.js +4 -4
  9. package/dist/rbac/index.js +2 -2
  10. package/dist/utils.d.ts +1 -1
  11. package/dist/utils.js +17 -5
  12. package/dist/utils.js.map +1 -1
  13. package/docs/api/classes/ColumnFactory.md +1 -1
  14. package/docs/api/classes/ErrorBoundary.md +1 -1
  15. package/docs/api/classes/InvalidScopeError.md +1 -1
  16. package/docs/api/classes/MissingUserContextError.md +1 -1
  17. package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
  18. package/docs/api/classes/PermissionDeniedError.md +1 -1
  19. package/docs/api/classes/PublicErrorBoundary.md +1 -1
  20. package/docs/api/classes/RBACAuditManager.md +1 -1
  21. package/docs/api/classes/RBACCache.md +1 -1
  22. package/docs/api/classes/RBACEngine.md +1 -1
  23. package/docs/api/classes/RBACError.md +1 -1
  24. package/docs/api/classes/RBACNotInitializedError.md +1 -1
  25. package/docs/api/classes/SecureSupabaseClient.md +1 -1
  26. package/docs/api/classes/StorageUtils.md +1 -1
  27. package/docs/api/enums/FileCategory.md +1 -1
  28. package/docs/api/interfaces/AggregateConfig.md +1 -1
  29. package/docs/api/interfaces/BadgeProps.md +1 -1
  30. package/docs/api/interfaces/ButtonProps.md +1 -1
  31. package/docs/api/interfaces/CardProps.md +1 -1
  32. package/docs/api/interfaces/ColorPalette.md +1 -1
  33. package/docs/api/interfaces/ColorShade.md +1 -1
  34. package/docs/api/interfaces/DataAccessRecord.md +1 -1
  35. package/docs/api/interfaces/DataRecord.md +1 -1
  36. package/docs/api/interfaces/DataTableAction.md +1 -1
  37. package/docs/api/interfaces/DataTableColumn.md +1 -1
  38. package/docs/api/interfaces/DataTableProps.md +1 -1
  39. package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
  40. package/docs/api/interfaces/EmptyStateConfig.md +1 -1
  41. package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
  42. package/docs/api/interfaces/EventAppRoleData.md +1 -1
  43. package/docs/api/interfaces/EventLogoProps.md +1 -1
  44. package/docs/api/interfaces/ExportColumn.md +1 -1
  45. package/docs/api/interfaces/ExportOptions.md +1 -1
  46. package/docs/api/interfaces/FileDisplayProps.md +1 -1
  47. package/docs/api/interfaces/FileMetadata.md +1 -1
  48. package/docs/api/interfaces/FileReference.md +1 -1
  49. package/docs/api/interfaces/FileSizeLimits.md +1 -1
  50. package/docs/api/interfaces/FileUploadOptions.md +1 -1
  51. package/docs/api/interfaces/FileUploadProps.md +1 -1
  52. package/docs/api/interfaces/FooterProps.md +1 -1
  53. package/docs/api/interfaces/GrantEventAppRoleParams.md +1 -1
  54. package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
  55. package/docs/api/interfaces/InputProps.md +1 -1
  56. package/docs/api/interfaces/LabelProps.md +1 -1
  57. package/docs/api/interfaces/LoginFormProps.md +1 -1
  58. package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
  59. package/docs/api/interfaces/NavigationContextType.md +1 -1
  60. package/docs/api/interfaces/NavigationGuardProps.md +1 -1
  61. package/docs/api/interfaces/NavigationItem.md +1 -1
  62. package/docs/api/interfaces/NavigationMenuProps.md +1 -1
  63. package/docs/api/interfaces/NavigationProviderProps.md +1 -1
  64. package/docs/api/interfaces/Organisation.md +1 -1
  65. package/docs/api/interfaces/OrganisationContextType.md +1 -1
  66. package/docs/api/interfaces/OrganisationMembership.md +1 -1
  67. package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
  68. package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
  69. package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
  70. package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
  71. package/docs/api/interfaces/PageAccessRecord.md +1 -1
  72. package/docs/api/interfaces/PagePermissionContextType.md +1 -1
  73. package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
  74. package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
  75. package/docs/api/interfaces/PaletteData.md +1 -1
  76. package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
  77. package/docs/api/interfaces/ProtectedRouteProps.md +1 -1
  78. package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
  79. package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
  80. package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
  81. package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
  82. package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
  83. package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
  84. package/docs/api/interfaces/RBACConfig.md +1 -1
  85. package/docs/api/interfaces/RBACLogger.md +1 -1
  86. package/docs/api/interfaces/RevokeEventAppRoleParams.md +1 -1
  87. package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
  88. package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
  89. package/docs/api/interfaces/RoleManagementResult.md +1 -1
  90. package/docs/api/interfaces/RouteAccessRecord.md +1 -1
  91. package/docs/api/interfaces/RouteConfig.md +1 -1
  92. package/docs/api/interfaces/SecureDataContextType.md +1 -1
  93. package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
  94. package/docs/api/interfaces/SessionRestorationLoaderProps.md +1 -1
  95. package/docs/api/interfaces/StorageConfig.md +1 -1
  96. package/docs/api/interfaces/StorageFileInfo.md +1 -1
  97. package/docs/api/interfaces/StorageFileMetadata.md +1 -1
  98. package/docs/api/interfaces/StorageListOptions.md +1 -1
  99. package/docs/api/interfaces/StorageListResult.md +1 -1
  100. package/docs/api/interfaces/StorageUploadOptions.md +1 -1
  101. package/docs/api/interfaces/StorageUploadResult.md +1 -1
  102. package/docs/api/interfaces/StorageUrlOptions.md +1 -1
  103. package/docs/api/interfaces/StyleImport.md +1 -1
  104. package/docs/api/interfaces/SwitchProps.md +1 -1
  105. package/docs/api/interfaces/ToastActionElement.md +1 -1
  106. package/docs/api/interfaces/ToastProps.md +1 -1
  107. package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
  108. package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
  109. package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
  110. package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
  111. package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
  112. package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
  113. package/docs/api/interfaces/UsePublicFileDisplayOptions.md +1 -1
  114. package/docs/api/interfaces/UsePublicFileDisplayReturn.md +1 -1
  115. package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
  116. package/docs/api/interfaces/UseResolvedScopeOptions.md +1 -1
  117. package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
  118. package/docs/api/interfaces/UserEventAccess.md +1 -1
  119. package/docs/api/interfaces/UserMenuProps.md +1 -1
  120. package/docs/api/interfaces/UserProfile.md +1 -1
  121. package/docs/api/modules.md +7 -7
  122. package/docs/getting-started/examples/basic-auth-app.md +196 -0
  123. package/docs/getting-started/examples/full-featured-app.md +616 -0
  124. package/package.json +1 -1
  125. package/src/rbac/hooks/useCan.test.ts +24 -0
  126. package/src/rbac/hooks/usePermissions.ts +49 -12
  127. package/src/utils/performance/bundleAnalysis.ts +17 -3
  128. package/dist/chunk-BLCXZEYF.js.map +0 -1
  129. /package/dist/{DataTable-6M4L6BI2.js.map → DataTable-JXFCA2BJ.js.map} +0 -0
  130. /package/dist/{chunk-KYRHUBIU.js.map → chunk-5JMOHWDI.js.map} +0 -0
  131. /package/dist/{chunk-BCIBECNB.js.map → chunk-6DXZ6V5Q.js.map} +0 -0
  132. /package/dist/{chunk-HAWZXGR2.js.map → chunk-TLT2ZR3L.js.map} +0 -0
@@ -0,0 +1,196 @@
1
+ # Basic Authentication App
2
+
3
+ A minimal PACE Core application showing just authentication and basic UI components.
4
+
5
+ ## 🎯 What This Example Shows
6
+
7
+ - Basic authentication setup
8
+ - Simple login/logout flow
9
+ - Basic dashboard with cards
10
+ - Responsive navigation
11
+ - Minimal code structure
12
+
13
+ ## 📁 Project Structure
14
+
15
+ ```
16
+ src/
17
+ ├── App.tsx # Main app with providers
18
+ ├── lib/
19
+ │ └── supabase.ts # Supabase client
20
+ ├── components/
21
+ │ ├── LoginPage.tsx # Login form
22
+ │ ├── Dashboard.tsx # Simple dashboard
23
+ │ └── Navigation.tsx # Basic navigation
24
+ └── main.tsx # App entry point
25
+ ```
26
+
27
+ ## 🚀 Implementation
28
+
29
+ ### 1. App.tsx - Main Application
30
+
31
+ ```tsx
32
+ import { UnifiedAuthProvider } from '@jmruthers/pace-core';
33
+ import { BrowserRouter, Routes, Route } from 'react-router-dom';
34
+ import { supabase } from './lib/supabase';
35
+ import { LoginPage } from './components/LoginPage';
36
+ import { Dashboard } from './components/Dashboard';
37
+
38
+ function App() {
39
+ return (
40
+ <UnifiedAuthProvider
41
+ supabaseClient={supabase}
42
+ appName="basic-auth-app"
43
+ >
44
+ <BrowserRouter>
45
+ <Routes>
46
+ <Route path="/login" element={<LoginPage />} />
47
+ <Route path="/" element={<Dashboard />} />
48
+ </Routes>
49
+ </BrowserRouter>
50
+ </UnifiedAuthProvider>
51
+ );
52
+ }
53
+
54
+ export default App;
55
+ ```
56
+
57
+ ### 2. lib/supabase.ts - Supabase Client
58
+
59
+ ```typescript
60
+ import { createClient } from '@supabase/supabase-js';
61
+
62
+ const supabaseUrl = process.env.REACT_APP_SUPABASE_URL!;
63
+ const supabaseAnonKey = process.env.REACT_APP_SUPABASE_ANON_KEY!;
64
+
65
+ export const supabase = createClient(supabaseUrl, supabaseAnonKey);
66
+ ```
67
+
68
+ ### 3. components/LoginPage.tsx - Login Form
69
+
70
+ ```tsx
71
+ import { LoginForm, Card, CardHeader, CardTitle, CardContent } from '@jmruthers/pace-core';
72
+ import { useNavigate } from 'react-router-dom';
73
+
74
+ export function LoginPage() {
75
+ const navigate = useNavigate();
76
+
77
+ const handleLoginSuccess = () => {
78
+ navigate('/');
79
+ };
80
+
81
+ return (
82
+ <div className="min-h-screen flex items-center justify-center bg-sec-50">
83
+ <Card className="w-full max-w-md">
84
+ <CardHeader>
85
+ <CardTitle className="text-center">Welcome Back</CardTitle>
86
+ </CardHeader>
87
+ <CardContent>
88
+ <LoginForm onLoginSuccess={handleLoginSuccess} />
89
+ </CardContent>
90
+ </Card>
91
+ </div>
92
+ );
93
+ }
94
+ ```
95
+
96
+ ### 4. components/Dashboard.tsx - Simple Dashboard
97
+
98
+ ```tsx
99
+ import { Card, CardHeader, CardTitle, CardContent, Button } from '@jmruthers/pace-core';
100
+ import { useUnifiedAuth } from '@jmruthers/pace-core';
101
+ import { useNavigate } from 'react-router-dom';
102
+
103
+ export function Dashboard() {
104
+ const { user, signOut } = useUnifiedAuth();
105
+ const navigate = useNavigate();
106
+
107
+ const handleSignOut = async () => {
108
+ await signOut();
109
+ navigate('/login');
110
+ };
111
+
112
+ return (
113
+ <div className="min-h-screen bg-sec-50 p-6">
114
+ <div className="max-w-4xl mx-auto">
115
+ {/* Header */}
116
+ <div className="flex justify-between items-center mb-8">
117
+ <h1 className="text-3xl font-bold text-sec-900">Dashboard</h1>
118
+ <div className="flex items-center gap-4">
119
+ <span className="text-sec-600">Welcome, {user?.email}</span>
120
+ <Button variant="outline" onClick={handleSignOut}>
121
+ Sign Out
122
+ </Button>
123
+ </div>
124
+ </div>
125
+
126
+ {/* Content Cards */}
127
+ <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
128
+ <Card>
129
+ <CardHeader>
130
+ <CardTitle>Getting Started</CardTitle>
131
+ </CardHeader>
132
+ <CardContent>
133
+ <p className="text-sec-600">
134
+ Welcome to your PACE Core application! This is a basic example showing authentication and UI components.
135
+ </p>
136
+ </CardContent>
137
+ </Card>
138
+
139
+ <Card>
140
+ <CardHeader>
141
+ <CardTitle>Next Steps</CardTitle>
142
+ </CardHeader>
143
+ <CardContent>
144
+ <p className="text-sec-600">
145
+ Explore the examples to learn about DataTables, forms, navigation, and more advanced features.
146
+ </p>
147
+ </CardContent>
148
+ </Card>
149
+
150
+ <Card>
151
+ <CardHeader>
152
+ <CardTitle>Resources</CardTitle>
153
+ </CardHeader>
154
+ <CardContent>
155
+ <p className="text-sec-600">
156
+ Check out the documentation for implementation guides, API reference, and best practices.
157
+ </p>
158
+ </CardContent>
159
+ </Card>
160
+ </div>
161
+ </div>
162
+ </div>
163
+ );
164
+ }
165
+ ```
166
+
167
+ ## 🔧 Environment Setup
168
+
169
+ Create `.env.local`:
170
+
171
+ ```bash
172
+ REACT_APP_SUPABASE_URL=https://your-project.supabase.co
173
+ REACT_APP_SUPABASE_ANON_KEY=your-anon-key-here
174
+ ```
175
+
176
+ ## 🎉 What You Get
177
+
178
+ - ✅ User authentication with Supabase
179
+ - ✅ Protected dashboard route
180
+ - ✅ Responsive UI components
181
+ - ✅ Clean, minimal code structure
182
+ - ✅ Easy to extend and customize
183
+
184
+ ## 🚀 Next Steps
185
+
186
+ - **Add more features** - Forms, data tables, navigation
187
+ - **Implement RBAC** - Role-based access control
188
+ - **Add organisation support** - Multi-tenant features
189
+ - **Explore components** - See all available UI components
190
+
191
+ ## 📚 Related Documentation
192
+
193
+ - **[Quick Start](../quick-start.md)** - Build a full-featured app
194
+ - **[Core Concepts](../core-concepts/)** - Understand authentication and RBAC
195
+ - **[API Reference](../api-reference/)** - Explore all components and hooks
196
+ - **[Implementation Guides](../implementation-guides/)** - Advanced patterns