@jmruthers/pace-core 0.5.76 → 0.5.78

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 (447) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/{RBACService-C4udt_Zp.d.ts → AuthService-Df3IozMG.d.ts} +10 -118
  3. package/dist/{DataTable-ntgmhO2W.d.ts → DataTable-BE0OXZKQ.d.ts} +9 -2
  4. package/dist/{DataTable-4GAVPIEG.js → DataTable-ETGVF4Y5.js} +50 -13
  5. package/dist/{PublicLoadingSpinner-BiNER8F5.d.ts → PublicLoadingSpinner-CnUaz0vG.d.ts} +5 -2
  6. package/dist/{UnifiedAuthProvider-Bj6YCf7c.d.ts → UnifiedAuthProvider-B391Aqum.d.ts} +42 -45
  7. package/dist/{UnifiedAuthProvider-3NKDOSOK.js → UnifiedAuthProvider-P5SOJAQ6.js} +4 -5
  8. package/dist/{api-DDMUKIUD.js → api-KG4A2X7P.js} +9 -3
  9. package/dist/{audit-6TOCAMKO.js → audit-65VNHEV2.js} +2 -2
  10. package/dist/{chunk-K34IM5CT.js → chunk-2OGV6IRV.js} +196 -626
  11. package/dist/chunk-2OGV6IRV.js.map +1 -0
  12. package/dist/{chunk-NTNILOBC.js → chunk-5BO3MI5Y.js} +4 -4
  13. package/dist/{chunk-XLZ7U46Z.js → chunk-CVMVPYAL.js} +9 -60
  14. package/dist/chunk-CVMVPYAL.js.map +1 -0
  15. package/dist/{chunk-URUTVZ7N.js → chunk-FL4ZCQLD.js} +2 -2
  16. package/dist/{chunk-LW7MMEAQ.js → chunk-FT2M4R4F.js} +2 -2
  17. package/dist/{chunk-5BSLGBYI.js → chunk-JCQZ6LA7.js} +2 -8
  18. package/dist/{chunk-5BSLGBYI.js.map → chunk-JCQZ6LA7.js.map} +1 -1
  19. package/dist/{chunk-KHJS6VIA.js → chunk-LRQ6RBJC.js} +157 -112
  20. package/dist/chunk-LRQ6RBJC.js.map +1 -0
  21. package/dist/{chunk-WN6XJWOS.js → chunk-MNJXXD6C.js} +274 -743
  22. package/dist/chunk-MNJXXD6C.js.map +1 -0
  23. package/dist/{chunk-KK73ZB4E.js → chunk-PTR5PMPE.js} +153 -132
  24. package/dist/chunk-PTR5PMPE.js.map +1 -0
  25. package/dist/{chunk-B2WTCLCV.js → chunk-Q7APDV6H.js} +18 -8
  26. package/dist/chunk-Q7APDV6H.js.map +1 -0
  27. package/dist/{chunk-A4FUBC7B.js → chunk-QGVSOUJ2.js} +2 -4
  28. package/dist/{chunk-A4FUBC7B.js.map → chunk-QGVSOUJ2.js.map} +1 -1
  29. package/dist/{chunk-FGMFQSHX.js → chunk-S63MFSY6.js} +500 -551
  30. package/dist/chunk-S63MFSY6.js.map +1 -0
  31. package/dist/{chunk-AFGTSUAD.js → chunk-VSOKOFRF.js} +4 -4
  32. package/dist/chunk-WUXCWRL6.js +20 -0
  33. package/dist/chunk-WUXCWRL6.js.map +1 -0
  34. package/dist/{chunk-Y6TXWPJO.js → chunk-YVVGHRGI.js} +105 -31
  35. package/dist/chunk-YVVGHRGI.js.map +1 -0
  36. package/dist/{chunk-M5IWZRBT.js → chunk-ZMNXIJP4.js} +2187 -981
  37. package/dist/chunk-ZMNXIJP4.js.map +1 -0
  38. package/dist/components.d.ts +6 -6
  39. package/dist/components.js +14 -18
  40. package/dist/components.js.map +1 -1
  41. package/dist/{database-C3Szpi5J.d.ts → database-BXAfr2Y_.d.ts} +18 -0
  42. package/dist/hooks.d.ts +5 -5
  43. package/dist/hooks.js +8 -9
  44. package/dist/hooks.js.map +1 -1
  45. package/dist/index.d.ts +19 -27
  46. package/dist/index.js +21 -29
  47. package/dist/index.js.map +1 -1
  48. package/dist/{organisation-BtshODVF.d.ts → organisation-D6qRDtbF.d.ts} +1 -1
  49. package/dist/providers.d.ts +7 -21
  50. package/dist/providers.js +3 -10
  51. package/dist/rbac/index.d.ts +71 -221
  52. package/dist/rbac/index.js +15 -16
  53. package/dist/{types-CGX9Vyf5.d.ts → types-BDg1mAGG.d.ts} +36 -6
  54. package/dist/types.d.ts +3 -3
  55. package/dist/types.js +61 -18
  56. package/dist/types.js.map +1 -1
  57. package/dist/{unified-CM7T0aTK.d.ts → unified-DQ4VcT7H.d.ts} +1 -1
  58. package/dist/{usePublicRouteParams-B-CumWRc.d.ts → usePublicRouteParams-BlgwXweB.d.ts} +3 -3
  59. package/dist/utils.d.ts +2 -2
  60. package/dist/utils.js +52 -9
  61. package/dist/utils.js.map +1 -1
  62. package/docs/CONTENT_AUDIT_REPORT.md +253 -0
  63. package/docs/DOCUMENTATION_AUDIT.md +172 -0
  64. package/docs/README.md +142 -147
  65. package/docs/STYLE_GUIDE.md +37 -0
  66. package/docs/api/classes/ColumnFactory.md +17 -17
  67. package/docs/api/classes/ErrorBoundary.md +1 -1
  68. package/docs/api/classes/InvalidScopeError.md +4 -4
  69. package/docs/api/classes/MissingUserContextError.md +4 -4
  70. package/docs/api/classes/OrganisationContextRequiredError.md +4 -4
  71. package/docs/api/classes/PermissionDeniedError.md +5 -5
  72. package/docs/api/classes/PublicErrorBoundary.md +1 -1
  73. package/docs/api/classes/RBACAuditManager.md +8 -8
  74. package/docs/api/classes/RBACCache.md +35 -5
  75. package/docs/api/classes/RBACEngine.md +49 -20
  76. package/docs/api/classes/RBACError.md +4 -4
  77. package/docs/api/classes/RBACNotInitializedError.md +4 -4
  78. package/docs/api/classes/SecureSupabaseClient.md +1 -1
  79. package/docs/api/classes/StorageUtils.md +1 -1
  80. package/docs/api/enums/FileCategory.md +1 -1
  81. package/docs/api/interfaces/AggregateConfig.md +4 -4
  82. package/docs/api/interfaces/ButtonProps.md +1 -1
  83. package/docs/api/interfaces/CardProps.md +1 -1
  84. package/docs/api/interfaces/ColorPalette.md +1 -1
  85. package/docs/api/interfaces/ColorShade.md +1 -1
  86. package/docs/api/interfaces/DataAccessRecord.md +1 -1
  87. package/docs/api/interfaces/DataRecord.md +11 -0
  88. package/docs/api/interfaces/DataTableAction.md +65 -29
  89. package/docs/api/interfaces/DataTableColumn.md +36 -23
  90. package/docs/api/interfaces/DataTableProps.md +80 -38
  91. package/docs/api/interfaces/DataTableToolbarButton.md +7 -7
  92. package/docs/api/interfaces/EmptyStateConfig.md +5 -5
  93. package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
  94. package/docs/api/interfaces/EventLogoProps.md +1 -1
  95. package/docs/api/interfaces/FileDisplayProps.md +1 -1
  96. package/docs/api/interfaces/FileMetadata.md +1 -1
  97. package/docs/api/interfaces/FileReference.md +1 -1
  98. package/docs/api/interfaces/FileSizeLimits.md +1 -1
  99. package/docs/api/interfaces/FileUploadOptions.md +1 -1
  100. package/docs/api/interfaces/FileUploadProps.md +1 -1
  101. package/docs/api/interfaces/FooterProps.md +1 -1
  102. package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
  103. package/docs/api/interfaces/InputProps.md +1 -1
  104. package/docs/api/interfaces/LabelProps.md +1 -1
  105. package/docs/api/interfaces/LoginFormProps.md +1 -1
  106. package/docs/api/interfaces/NavigationAccessRecord.md +11 -11
  107. package/docs/api/interfaces/NavigationContextType.md +9 -9
  108. package/docs/api/interfaces/NavigationGuardProps.md +1 -1
  109. package/docs/api/interfaces/NavigationItem.md +1 -1
  110. package/docs/api/interfaces/NavigationMenuProps.md +1 -1
  111. package/docs/api/interfaces/NavigationProviderProps.md +7 -7
  112. package/docs/api/interfaces/Organisation.md +1 -1
  113. package/docs/api/interfaces/OrganisationContextType.md +1 -1
  114. package/docs/api/interfaces/OrganisationMembership.md +1 -1
  115. package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
  116. package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
  117. package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
  118. package/docs/api/interfaces/PaceLoginPageProps.md +16 -3
  119. package/docs/api/interfaces/PageAccessRecord.md +1 -1
  120. package/docs/api/interfaces/PagePermissionContextType.md +1 -1
  121. package/docs/api/interfaces/PagePermissionGuardProps.md +2 -2
  122. package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
  123. package/docs/api/interfaces/PaletteData.md +1 -1
  124. package/docs/api/interfaces/PermissionEnforcerProps.md +4 -4
  125. package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
  126. package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
  127. package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
  128. package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
  129. package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
  130. package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
  131. package/docs/api/interfaces/RBACConfig.md +1 -1
  132. package/docs/api/interfaces/RBACLogger.md +1 -1
  133. package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
  134. package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
  135. package/docs/api/interfaces/RouteAccessRecord.md +2 -2
  136. package/docs/api/interfaces/RouteConfig.md +2 -2
  137. package/docs/api/interfaces/SecureDataContextType.md +1 -1
  138. package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
  139. package/docs/api/interfaces/StorageConfig.md +1 -1
  140. package/docs/api/interfaces/StorageFileInfo.md +1 -1
  141. package/docs/api/interfaces/StorageFileMetadata.md +1 -1
  142. package/docs/api/interfaces/StorageListOptions.md +1 -1
  143. package/docs/api/interfaces/StorageListResult.md +1 -1
  144. package/docs/api/interfaces/StorageUploadOptions.md +1 -1
  145. package/docs/api/interfaces/StorageUploadResult.md +1 -1
  146. package/docs/api/interfaces/StorageUrlOptions.md +1 -1
  147. package/docs/api/interfaces/StyleImport.md +1 -1
  148. package/docs/api/interfaces/SwitchProps.md +1 -1
  149. package/docs/api/interfaces/ToastActionElement.md +1 -1
  150. package/docs/api/interfaces/ToastProps.md +1 -1
  151. package/docs/api/interfaces/UnifiedAuthContextType.md +94 -521
  152. package/docs/api/interfaces/UnifiedAuthProviderProps.md +16 -16
  153. package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
  154. package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
  155. package/docs/api/interfaces/UsePublicEventLogoOptions.md +1 -1
  156. package/docs/api/interfaces/UsePublicEventLogoReturn.md +1 -1
  157. package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
  158. package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
  159. package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
  160. package/docs/api/interfaces/UseResolvedScopeOptions.md +1 -1
  161. package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
  162. package/docs/api/interfaces/UserEventAccess.md +11 -11
  163. package/docs/api/interfaces/UserMenuProps.md +1 -1
  164. package/docs/api/interfaces/UserProfile.md +1 -1
  165. package/docs/api/modules.md +251 -269
  166. package/docs/api-reference/components.md +193 -0
  167. package/docs/api-reference/hooks.md +265 -0
  168. package/docs/api-reference/providers.md +6 -0
  169. package/docs/api-reference/types.md +6 -0
  170. package/docs/api-reference/utilities.md +207 -0
  171. package/docs/architecture/README.md +6 -0
  172. package/docs/{database-schema-requirements.md → architecture/database-schema-requirements.md} +6 -0
  173. package/docs/architecture/rbac-security-architecture.md +258 -0
  174. package/docs/architecture/services.md +9 -1
  175. package/docs/best-practices/README.md +6 -0
  176. package/docs/best-practices/accessibility.md +6 -0
  177. package/docs/{common-patterns.md → best-practices/common-patterns.md} +6 -0
  178. package/docs/best-practices/deployment.md +6 -0
  179. package/docs/best-practices/performance.md +475 -2
  180. package/docs/best-practices/security.md +6 -0
  181. package/docs/best-practices/testing.md +6 -0
  182. package/docs/core-concepts/authentication.md +6 -0
  183. package/docs/core-concepts/events.md +6 -0
  184. package/docs/core-concepts/organisations.md +6 -0
  185. package/docs/core-concepts/permissions.md +6 -0
  186. package/docs/core-concepts/rbac-system.md +8 -0
  187. package/docs/documentation-index.md +121 -182
  188. package/docs/{consuming-app-vite-config.md → getting-started/consuming-app-vite-config.md} +6 -0
  189. package/docs/getting-started/documentation-index.md +40 -0
  190. package/docs/getting-started/examples/README.md +878 -35
  191. package/docs/{faq.md → getting-started/faq.md} +7 -1
  192. package/docs/getting-started/installation-guide.md +6 -0
  193. package/docs/{quick-reference.md → getting-started/quick-reference.md} +6 -0
  194. package/docs/implementation-guides/app-layout.md +6 -0
  195. package/docs/implementation-guides/authentication.md +1021 -0
  196. package/docs/implementation-guides/component-styling.md +6 -0
  197. package/docs/implementation-guides/data-tables.md +1264 -2076
  198. package/docs/implementation-guides/dynamic-colors.md +6 -0
  199. package/docs/implementation-guides/event-theming-summary.md +6 -0
  200. package/docs/{file-reference-system.md → implementation-guides/file-reference-system.md} +6 -0
  201. package/docs/implementation-guides/file-upload-storage.md +6 -0
  202. package/docs/implementation-guides/forms.md +6 -0
  203. package/docs/implementation-guides/inactivity-tracking.md +6 -0
  204. package/docs/implementation-guides/navigation.md +6 -0
  205. package/docs/implementation-guides/organisation-security.md +6 -0
  206. package/docs/implementation-guides/permission-enforcement.md +6 -0
  207. package/docs/implementation-guides/public-pages-advanced.md +6 -0
  208. package/docs/implementation-guides/public-pages.md +6 -0
  209. package/docs/migration/MIGRATION_GUIDE.md +827 -351
  210. package/docs/migration/README.md +7 -1
  211. package/docs/migration/organisation-context-timing-fix.md +6 -0
  212. package/docs/migration/rbac-migration.md +44 -1
  213. package/docs/migration/service-architecture.md +6 -0
  214. package/docs/migration/v0.4.15-tailwind-scanning.md +6 -0
  215. package/docs/migration/v0.4.16-css-first-approach.md +6 -0
  216. package/docs/migration/v0.4.17-source-path-fix.md +6 -0
  217. package/docs/rbac/README-rbac-rls-integration.md +6 -0
  218. package/docs/rbac/README.md +6 -0
  219. package/docs/rbac/advanced-patterns.md +6 -0
  220. package/docs/rbac/api-reference.md +7 -1
  221. package/docs/rbac/breaking-changes-v3.md +222 -0
  222. package/docs/rbac/examples/rbac-rls-integration-example.md +6 -0
  223. package/docs/rbac/examples.md +6 -0
  224. package/docs/rbac/getting-started.md +6 -0
  225. package/docs/rbac/migration-guide.md +260 -0
  226. package/docs/rbac/quick-start.md +70 -13
  227. package/docs/rbac/rbac-rls-integration.md +6 -0
  228. package/docs/rbac/super-admin-guide.md +6 -0
  229. package/docs/rbac/troubleshooting.md +6 -0
  230. package/docs/security/README.md +6 -0
  231. package/docs/security/checklist.md +6 -0
  232. package/docs/styles/README.md +7 -1
  233. package/docs/{usage.md → styles/usage.md} +6 -0
  234. package/docs/testing/README.md +6 -0
  235. package/docs/{visual-testing.md → testing/visual-testing.md} +6 -0
  236. package/docs/troubleshooting/README.md +387 -5
  237. package/docs/troubleshooting/cake-page-permission-guard-issue-summary.md +6 -0
  238. package/docs/troubleshooting/common-issues.md +6 -0
  239. package/docs/troubleshooting/database-view-compatibility.md +6 -0
  240. package/docs/troubleshooting/organisation-context-setup.md +6 -0
  241. package/docs/troubleshooting/react-hooks-issue-analysis.md +6 -0
  242. package/docs/troubleshooting/styling-issues.md +6 -0
  243. package/docs/troubleshooting/tailwind-content-scanning.md +6 -0
  244. package/package.json +1 -1
  245. package/src/__tests__/helpers/__tests__/test-providers.test.tsx +2 -1
  246. package/src/__tests__/helpers/test-providers.tsx +3 -53
  247. package/src/components/DataTable/DataTable.test.tsx +319 -0
  248. package/src/components/DataTable/DataTable.tsx +32 -11
  249. package/src/components/DataTable/__tests__/{DataTable.comprehensive.test.tsx → DataTable.comprehensive.test.tsx.skip} +6 -4
  250. package/src/components/DataTable/__tests__/{DataTable.test.tsx → DataTable.test.tsx.skip} +6 -4
  251. package/src/components/DataTable/__tests__/DataTableCore.test.tsx +31 -9
  252. package/src/components/DataTable/__tests__/a11y.basic.test.tsx +601 -0
  253. package/src/components/DataTable/__tests__/keyboard.test.tsx +615 -0
  254. package/src/components/DataTable/__tests__/pagination.modes.test.tsx +639 -0
  255. package/src/components/DataTable/__tests__/ssr.strict-mode.test.tsx.skip +330 -0
  256. package/src/components/DataTable/components/AccessDeniedPage.tsx +2 -2
  257. package/src/components/DataTable/components/ActionButtons.tsx +88 -104
  258. package/src/components/DataTable/components/DataTableCore.tsx +309 -337
  259. package/src/components/DataTable/components/DataTableErrorBoundary.tsx +4 -2
  260. package/src/components/DataTable/components/DataTableModals.tsx +22 -1
  261. package/src/components/DataTable/components/EditableRow.tsx +69 -84
  262. package/src/components/DataTable/components/EmptyState.tsx +5 -1
  263. package/src/components/DataTable/components/ImportModal.tsx +65 -36
  264. package/src/components/DataTable/components/PaginationControls.tsx +40 -100
  265. package/src/components/DataTable/components/UnifiedTableBody.tsx +125 -148
  266. package/src/components/DataTable/context/DataTableContext.tsx +1 -1
  267. package/src/components/DataTable/core/ColumnFactory.ts +5 -0
  268. package/src/components/DataTable/examples/HierarchicalActionsExample.tsx +12 -10
  269. package/src/components/DataTable/examples/HierarchicalExample.tsx +1 -1
  270. package/src/components/DataTable/examples/InitialPageSizeExample.tsx +1 -0
  271. package/src/components/DataTable/examples/PerformanceExample.tsx +1 -0
  272. package/src/components/DataTable/hooks/__tests__/useColumnOrderPersistence.test.ts +1 -5
  273. package/src/components/DataTable/hooks/__tests__/useColumnVisibilityPersistence.test.ts +167 -0
  274. package/src/components/DataTable/hooks/index.ts +7 -0
  275. package/src/components/DataTable/hooks/useColumnOrderPersistence.ts +32 -15
  276. package/src/components/DataTable/hooks/useColumnVisibilityPersistence.ts +102 -0
  277. package/src/components/DataTable/hooks/useDataTableConfiguration.ts +89 -0
  278. package/src/components/DataTable/hooks/useDataTableDataPipeline.ts +117 -0
  279. package/src/components/DataTable/hooks/useDataTablePermissions.ts +71 -27
  280. package/src/components/DataTable/hooks/useDataTableState.ts +39 -11
  281. package/src/components/DataTable/hooks/useEffectiveColumnOrder.ts +33 -0
  282. package/src/components/DataTable/hooks/useHierarchicalState.ts +15 -1
  283. package/src/components/DataTable/hooks/useKeyboardNavigation.ts +447 -0
  284. package/src/components/DataTable/hooks/useServerSideDataEffect.ts +94 -0
  285. package/src/components/DataTable/hooks/useTableColumns.ts +10 -7
  286. package/src/components/DataTable/hooks/useTableHandlers.ts +174 -0
  287. package/src/components/DataTable/index.ts +12 -3
  288. package/src/components/DataTable/types.ts +129 -9
  289. package/src/components/DataTable/utils/__tests__/exportUtils.test.ts +159 -22
  290. package/src/components/DataTable/utils/__tests__/flexibleImport.test.ts +111 -0
  291. package/src/components/DataTable/utils/__tests__/rowUtils.test.ts +15 -29
  292. package/src/components/DataTable/utils/a11yUtils.ts +244 -0
  293. package/src/components/DataTable/utils/debugTools.ts +609 -0
  294. package/src/components/DataTable/utils/exportUtils.ts +114 -16
  295. package/src/components/DataTable/utils/flexibleImport.ts +202 -32
  296. package/src/components/DataTable/utils/hierarchicalUtils.ts +1 -1
  297. package/src/components/DataTable/utils/index.ts +2 -0
  298. package/src/components/DataTable/utils/paginationUtils.ts +350 -0
  299. package/src/components/DataTable/utils/rowUtils.ts +6 -5
  300. package/src/components/NavigationMenu/NavigationMenu.test.tsx +19 -24
  301. package/src/components/NavigationMenu/NavigationMenu.tsx +19 -8
  302. package/src/components/PaceAppLayout/__tests__/PaceAppLayout.security.test.tsx +1 -23
  303. package/src/components/PaceLoginPage/PaceLoginPage.test.tsx +56 -6
  304. package/src/components/PaceLoginPage/PaceLoginPage.tsx +137 -13
  305. package/src/components/PublicLayout/__tests__/PublicPageHeader.test.tsx +1 -1
  306. package/src/components/Select/Select.tsx +1 -0
  307. package/src/components/examples/PermissionExample.tsx +173 -0
  308. package/src/examples/CorrectPublicPageImplementation.tsx +301 -0
  309. package/src/examples/PublicEventPage.tsx +274 -0
  310. package/src/examples/PublicPageApp.tsx +308 -0
  311. package/src/examples/PublicPageUsageExample.tsx +216 -0
  312. package/src/hooks/__tests__/useOrganisationPermissions.unit.test.tsx +12 -1
  313. package/src/hooks/__tests__/useOrganisationSecurity.unit.test.tsx +129 -17
  314. package/src/hooks/__tests__/useRBAC.unit.test.ts +151 -846
  315. package/src/hooks/useOrganisationPermissions.test.ts +42 -18
  316. package/src/hooks/useOrganisationPermissions.ts +12 -6
  317. package/src/hooks/useOrganisationSecurity.test.ts +138 -85
  318. package/src/hooks/useOrganisationSecurity.ts +41 -10
  319. package/src/index.ts +0 -1
  320. package/src/providers/AuthProvider.simplified.tsx +880 -0
  321. package/src/providers/UnifiedAuthProvider.test.simple.tsx +8 -8
  322. package/src/providers/__tests__/UnifiedAuthProvider.test.tsx +29 -19
  323. package/src/providers/index.ts +0 -1
  324. package/src/providers/services/EventServiceProvider.tsx +19 -15
  325. package/src/providers/services/InactivityServiceProvider.tsx +19 -15
  326. package/src/providers/services/OrganisationServiceProvider.tsx +19 -15
  327. package/src/providers/services/UnifiedAuthProvider.tsx +156 -127
  328. package/src/providers/services/__tests__/AuthServiceProvider.integration.test.tsx +1 -1
  329. package/src/providers/services/__tests__/UnifiedAuthProvider.integration.test.tsx +3 -3
  330. package/src/rbac/README.md +1 -1
  331. package/src/rbac/__tests__/adapters.comprehensive.test.tsx +25 -27
  332. package/src/rbac/__tests__/auth-rbac-security.integration.test.tsx +313 -0
  333. package/src/rbac/__tests__/engine.comprehensive.test.ts +114 -348
  334. package/src/rbac/__tests__/rbac-engine-core-logic.test.ts +28 -110
  335. package/src/rbac/__tests__/rbac-engine-simplified.test.ts +33 -85
  336. package/src/rbac/__tests__/scenarios.user-role.test.tsx +2 -2
  337. package/src/rbac/adapters.tsx +26 -69
  338. package/src/rbac/api.test.ts +90 -27
  339. package/src/rbac/api.ts +61 -10
  340. package/src/rbac/audit.test.ts +33 -38
  341. package/src/rbac/audit.ts +21 -6
  342. package/src/rbac/cache.ts +33 -1
  343. package/src/rbac/components/NavigationGuard.tsx +11 -11
  344. package/src/rbac/components/NavigationProvider.test.tsx +11 -5
  345. package/src/rbac/components/NavigationProvider.tsx +37 -13
  346. package/src/rbac/components/PagePermissionGuard.tsx +111 -50
  347. package/src/rbac/components/PagePermissionProvider.tsx +5 -5
  348. package/src/rbac/components/PermissionEnforcer.tsx +11 -11
  349. package/src/rbac/components/RoleBasedRouter.tsx +5 -5
  350. package/src/rbac/components/SecureDataProvider.tsx +5 -5
  351. package/src/rbac/components/__tests__/NavigationGuard.test.tsx +8 -8
  352. package/src/rbac/components/__tests__/PagePermissionGuard.test.tsx +14 -14
  353. package/src/rbac/components/__tests__/PermissionEnforcer.test.tsx +12 -12
  354. package/src/rbac/components/__tests__/RoleBasedRouter.test.tsx +6 -6
  355. package/src/rbac/engine.test.simple.ts +19 -13
  356. package/src/rbac/engine.test.ts +1 -0
  357. package/src/rbac/engine.ts +330 -766
  358. package/src/rbac/errors.ts +156 -0
  359. package/src/rbac/hooks/usePermissions.ts +32 -10
  360. package/src/rbac/hooks/useRBAC.test.ts +126 -512
  361. package/src/rbac/hooks/useRBAC.ts +147 -193
  362. package/src/rbac/hooks/useResolvedScope.ts +12 -0
  363. package/src/rbac/index.ts +7 -4
  364. package/src/rbac/security.ts +109 -18
  365. package/src/rbac/types.ts +12 -1
  366. package/src/services/AuthService.ts +2 -15
  367. package/src/services/EventService.ts +43 -46
  368. package/src/services/OrganisationService.ts +51 -31
  369. package/src/services/__tests__/AuthService.test.ts +1 -1
  370. package/src/services/__tests__/EventService.test.ts +1 -1
  371. package/src/services/__tests__/OrganisationService.test.ts +1 -1
  372. package/src/services/base/BaseService.ts +8 -0
  373. package/src/styles/base.css +208 -0
  374. package/src/styles/semantic.css +24 -0
  375. package/src/types/database.generated.ts +7347 -0
  376. package/src/types/database.ts +20 -0
  377. package/src/utils/logger.ts +179 -0
  378. package/src/utils/organisationContext.ts +11 -4
  379. package/src/utils/storage/__tests__/helpers.unit.test.ts +6 -2
  380. package/dist/appNameResolver-UURKN7NF.js +0 -22
  381. package/dist/audit-6TOCAMKO.js.map +0 -1
  382. package/dist/chunk-B2WTCLCV.js.map +0 -1
  383. package/dist/chunk-FGMFQSHX.js.map +0 -1
  384. package/dist/chunk-K34IM5CT.js.map +0 -1
  385. package/dist/chunk-KHJS6VIA.js.map +0 -1
  386. package/dist/chunk-KK73ZB4E.js.map +0 -1
  387. package/dist/chunk-M5IWZRBT.js.map +0 -1
  388. package/dist/chunk-ULBI5JGB.js +0 -109
  389. package/dist/chunk-ULBI5JGB.js.map +0 -1
  390. package/dist/chunk-WN6XJWOS.js.map +0 -1
  391. package/dist/chunk-XLZ7U46Z.js.map +0 -1
  392. package/dist/chunk-Y6TXWPJO.js.map +0 -1
  393. package/docs/DOCUMENTATION_CHECKLIST.md +0 -281
  394. package/docs/TERMINOLOGY.md +0 -231
  395. package/docs/api/interfaces/RBACContextType.md +0 -468
  396. package/docs/api/interfaces/RBACProviderProps.md +0 -107
  397. package/docs/best-practices/performance-expansion.md +0 -473
  398. package/docs/breaking-changes.md +0 -179
  399. package/docs/consuming-app-example.md +0 -290
  400. package/docs/documentation-templates.md +0 -539
  401. package/docs/examples/navigation-menu-auth-fix.md +0 -344
  402. package/docs/getting-started/examples/basic-auth-app.md +0 -520
  403. package/docs/getting-started/examples/full-featured-app.md +0 -616
  404. package/docs/getting-started/quick-start.md +0 -376
  405. package/docs/implementation-guides/datatable-filtering.md +0 -313
  406. package/docs/implementation-guides/datatable-rbac-usage.md +0 -317
  407. package/docs/implementation-guides/hierarchical-datatable.md +0 -850
  408. package/docs/implementation-guides/large-datasets.md +0 -281
  409. package/docs/implementation-guides/performance.md +0 -403
  410. package/docs/migration/quick-migration-guide.md +0 -320
  411. package/docs/migration-guide.md +0 -193
  412. package/docs/migration-guides/unified-auth-provider-mandatory-timeouts.md +0 -226
  413. package/docs/performance/README.md +0 -551
  414. package/docs/style-guide.md +0 -964
  415. package/docs/troubleshooting/authentication-issues.md +0 -334
  416. package/docs/troubleshooting/debugging.md +0 -1117
  417. package/docs/troubleshooting/migration.md +0 -918
  418. package/src/__tests__/hooks/usePermissions.test.ts +0 -261
  419. package/src/components/PaceAppLayout/__tests__/PaceAppLayout.rbac.test.tsx +0 -574
  420. package/src/hooks/__tests__/ServiceHooks.test.tsx +0 -613
  421. package/src/hooks/services/__tests__/useServiceHooks.test.tsx +0 -137
  422. package/src/hooks/services/usePermissions.ts +0 -70
  423. package/src/hooks/services/useRBACService.ts +0 -30
  424. package/src/hooks/usePermissionCheck.ts +0 -150
  425. package/src/providers/__tests__/ServiceProviders.test.tsx +0 -477
  426. package/src/providers/services/RBACServiceProvider.tsx +0 -79
  427. package/src/rbac/__tests__/integration.authflow.test.tsx +0 -119
  428. package/src/rbac/__tests__/integration.navigation.test.tsx +0 -69
  429. package/src/rbac/__tests__/integration.securedata.test.tsx +0 -92
  430. package/src/rbac/__tests__/integration.smoke.test.tsx +0 -73
  431. package/src/rbac/providers/RBACProvider.tsx +0 -645
  432. package/src/rbac/providers/__tests__/RBACProvider.integration.test.tsx +0 -688
  433. package/src/rbac/providers/__tests__/RBACProvider.test.tsx +0 -1186
  434. package/src/rbac/providers/index.ts +0 -11
  435. package/src/services/RBACService.ts +0 -522
  436. package/src/services/__tests__/RBACService.test.ts +0 -492
  437. package/src/services/interfaces/IRBACService.ts +0 -62
  438. package/src/utils/appNameResolver.test 2.ts +0 -494
  439. /package/dist/{DataTable-4GAVPIEG.js.map → DataTable-ETGVF4Y5.js.map} +0 -0
  440. /package/dist/{UnifiedAuthProvider-3NKDOSOK.js.map → UnifiedAuthProvider-P5SOJAQ6.js.map} +0 -0
  441. /package/dist/{api-DDMUKIUD.js.map → api-KG4A2X7P.js.map} +0 -0
  442. /package/dist/{appNameResolver-UURKN7NF.js.map → audit-65VNHEV2.js.map} +0 -0
  443. /package/dist/{chunk-NTNILOBC.js.map → chunk-5BO3MI5Y.js.map} +0 -0
  444. /package/dist/{chunk-URUTVZ7N.js.map → chunk-FL4ZCQLD.js.map} +0 -0
  445. /package/dist/{chunk-LW7MMEAQ.js.map → chunk-FT2M4R4F.js.map} +0 -0
  446. /package/dist/{chunk-AFGTSUAD.js.map → chunk-VSOKOFRF.js.map} +0 -0
  447. /package/docs/{app.css.example → styles/app.css.example} +0 -0
@@ -1,281 +0,0 @@
1
- # PACE Core Documentation Quality Checklist
2
-
3
- > **📚 For Contributors** | [← Documentation Home](./README.md) | [Style Guide](./style-guide.md)] | [Review Report](../DOCUMENTATION_REVIEW_REPORT.md)
4
-
5
- Use this checklist when creating or updating PACE Core documentation to ensure quality and consistency.
6
-
7
- ## ✅ Pre-Writing Checklist
8
-
9
- ### Determine Documentation Type
10
-
11
- - [ ] Is this a **new feature**? → Create/update relevant guides
12
- - [ ] Is this a **breaking change**? → Update breaking-changes.md
13
- - [ ] Is this a **bug fix**? → Update troubleshooting if relevant
14
- - [ ] Is this an **API change**? → Update api-reference/
15
- - [ ] Is this a **configuration change**? → Update installation/configuration docs
16
-
17
- ### Identify Target Audience
18
-
19
- - [ ] **New users** → Getting started/quick-start
20
- - [ ] **Experienced users** → Implementation guides/API reference
21
- - [ ] **Advanced users** → Best practices/advanced patterns
22
- - [ ] **Troubleshooting** → Specific error/issue resolution
23
-
24
- ## ✅ Content Quality Checklist
25
-
26
- ### Structure
27
-
28
- - [ ] Has clear, descriptive title
29
- - [ ] Includes navigation breadcrumbs
30
- - [ ] Has table of contents (for long documents)
31
- - [ ] Uses consistent heading hierarchy (H1 → H2 → H3)
32
- - [ ] Ends with "Related" or "Next Steps" section
33
- - [ ] Includes version metadata (last updated, version)
34
-
35
- ### Writing Quality
36
-
37
- - [ ] Uses active voice ("Create" not "should be created")
38
- - [ ] Explains "why" not just "what"
39
- - [ ] Uses simple, clear language
40
- - [ ] Avoids jargon without explanation
41
- - [ ] Provides context and background
42
- - [ ] Includes realistic, working examples
43
-
44
- ### Code Examples
45
-
46
- - [ ] **Always includes imports** - Full import statements
47
- - [ ] **Always includes context** - Not just snippets
48
- - [ ] **Always explains purpose** - What it does and why
49
- - [ ] **Always handles errors** - Shows error handling
50
- - [ ] **Uses realistic data** - Meaningful variable names
51
- - [ ] **Tested and working** - Code actually runs
52
- - [ ] **Properly formatted** - Correct indentation and syntax
53
-
54
- ### Accuracy
55
-
56
- - [ ] Matches current implementation
57
- - [ ] Uses correct API signatures
58
- - [ ] References correct version numbers
59
- - [ ] Links to existing files only
60
- - [ ] No broken references
61
- - [ ] Deprecated content is marked
62
-
63
- ## ✅ Technical Checklist
64
-
65
- ### Links and References
66
-
67
- ```bash
68
- # Check for broken links
69
- grep -r "\[.*\](\./.*\.md)" your-file.md | while read line; do
70
- # Extract the link
71
- # Verify file exists
72
- # Report broken links
73
- done
74
- ```
75
-
76
- - [ ] All internal links work (relative paths)
77
- - [ ] All external links accessible
78
- - [ ] No orphan references (linking to non-existent files)
79
- - [ ] Link text is descriptive ("Installation Guide" not "here")
80
- - [ ] Uses correct markdown link syntax
81
-
82
- ### Terminology
83
-
84
- - [ ] Uses "organisation" (British spelling) consistently
85
- - [ ] Uses consistent RBAC terminology
86
- - [ ] Consistent capitalization (e.g., "PACE Core" not "pace-core")
87
- - [ ] Consistent naming for components/hooks
88
- - [ ] Abbreviations defined on first use
89
-
90
- ### Code Formatting
91
-
92
- - [ ] Proper syntax highlighting (```tsx, ```bash, etc.)
93
- - [ ] No trailing whitespace
94
- - [ ] Consistent indentation (2 spaces for TS/TSX)
95
- - [ ] Code is runnable/tested
96
- - [ ] Uses appropriate type annotations
97
-
98
- ## ✅ Specific Section Checklists
99
-
100
- ### Installation/Setup Documentation
101
-
102
- - [ ] Lists all requirements upfront
103
- - [ ] Provides command examples
104
- - [ ] Shows expected output
105
- - [ ] Includes troubleshooting section
106
- - [ ] Links to related configuration
107
-
108
- ### API Documentation
109
-
110
- - [ ] Complete parameter descriptions
111
- - [ ] Return type specifications
112
- - [ ] Usage examples
113
- - [ ] Error handling examples
114
- - [ ] Related hooks/providers listed
115
-
116
- ### Troubleshooting
117
-
118
- - [ ] Clear problem statement
119
- - [ ] Specific error messages
120
- - [ ] Step-by-step solution
121
- - [ ] Expected vs actual behavior
122
- - [ ] Links to related issues
123
-
124
- ### Breaking Changes
125
-
126
- - [ ] **Required** - Must update breaking-changes.md
127
- - [ ] Clear before/after comparison
128
- - [ ] Migration steps provided
129
- - [ ] Impact assessment included
130
- - [ ] Version information included
131
-
132
- ## ✅ Post-Writing Verification
133
-
134
- ### Automated Checks
135
-
136
- ```bash
137
- # Run these commands before committing
138
-
139
- # 1. Check for broken links
140
- npx markdown-link-check docs/**/*.md
141
-
142
- # 2. Lint markdown
143
- npx markdownlint docs/**/*.md
144
-
145
- # 3. Spell check
146
- npx cspell "docs/**/*.md"
147
-
148
- # 4. Verify all links resolve
149
- node scripts/verify-docs.js
150
- ```
151
-
152
- - [ ] No broken links (verify after changes)
153
- - [ ] All code examples formatted correctly
154
- - [ ] No typos or spelling errors
155
- - [ ] Proper grammar throughout
156
- - [ ] Consistent formatting
157
-
158
- ### Manual Review
159
-
160
- - [ ] Read through entire document
161
- - [ ] Verify all examples still work
162
- - [ ] Check that instructions are complete
163
- - [ ] Ensure navigation makes sense
164
- - [ ] Verify all referenced files exist
165
- - [ ] Add to appropriate index/nav
166
-
167
- ## ✅ File-Specific Requirements
168
-
169
- ### README Files
170
-
171
- - [ ] Single H1 heading (title)
172
- - [ ] Navigation links at top
173
- - [ ] Quick start section
174
- - [ ] Table of contents for long files
175
- - [ ] Links to related documentation
176
- - [ ] Version and date information
177
-
178
- ### API Reference
179
-
180
- - [ ] Component/hook name in H1
181
- - [ ] Import statement example
182
- - [ ] Props/parameters table
183
- - [ ] Usage examples
184
- - [ ] Related components listed
185
- - [ ] Type definitions included
186
-
187
- ### Implementation Guides
188
-
189
- - [ ] Step-by-step instructions
190
- - [ ] Code examples for each step
191
- - [ ] Common pitfalls noted
192
- - [ ] Best practices included
193
- - [ ] Related concepts linked
194
- - [ ] Troubleshooting section
195
-
196
- ### Core Concepts
197
-
198
- - [ ] Clear explanation of concept
199
- - [ ] Visual aids (diagrams, if applicable)
200
- - [ ] Real-world use cases
201
- - [ ] How it fits with other concepts
202
- - [ ] Related implementation guides
203
-
204
- ## ✅ Documentation Maintenance
205
-
206
- ### Weekly
207
-
208
- - [ ] Check for new GitHub issues that need docs
209
- - [ ] Review recent PRs for doc updates needed
210
- - [ ] Update outdated information
211
-
212
- ### Monthly
213
-
214
- - [ ] Audit all internal links
215
- - [ ] Review API reference accuracy
216
- - [ ] Update examples to match latest patterns
217
- - [ ] Check version numbers
218
-
219
- ### Quarterly
220
-
221
- - [ ] Full documentation review
222
- - [ ] Update style guide based on lessons learned
223
- - [ ] Review and improve navigation
224
- - [ ] Assess documentation gaps
225
-
226
- ## ❌ Common Mistakes to Avoid
227
-
228
- ### Don't Do This
229
-
230
- ```markdown
231
- <!-- ❌ BAD -->
232
- You can read the docs [here](./docs.md).
233
- The component accepts props and returns data.
234
- Just use this: <Button /> and it works.
235
-
236
- <!-- ✅ GOOD -->
237
- See the [Installation Guide](./installation-guide.md) for setup instructions.
238
- The Button component accepts onClick (function) and returns a button element.
239
- Use the Button component like this:
240
- ```
241
-
242
- - ❌ Don't use "here" or "this" for link text
243
- - ❌ Don't assume context - provide it
244
- - ❌ Don't skip imports in code examples
245
- - ❌ Don't link to files that don't exist
246
- - ❌ Don't use vague examples (foo, bar, baz)
247
- - ❌ Don't forget error handling in examples
248
- - ❌ Don't write in passive voice when possible
249
- - ❌ Don't omit the "why" behind recommendations
250
-
251
- ## ✅ Final Checklist Before Publishing
252
-
253
- - [ ] Content is accurate and up-to-date
254
- - [ ] All code examples tested
255
- - [ ] No broken links or references
256
- - [ ] Consistent with style guide
257
- - [ ] Added to appropriate navigation
258
- - [ ] Version metadata included
259
- - [ ] Reviewed by another contributor (if possible)
260
- - [ ] Related documentation updated
261
-
262
- ---
263
-
264
- ## 📚 Resources
265
-
266
- - [Style Guide](./style-guide.md) - Complete style and formatting guide
267
- - [Documentation Index](./documentation-index.md) - All documentation organized by topic
268
- - [Review Report](../DOCUMENTATION_REVIEW_REPORT.md) - Latest documentation review findings
269
- - [Breaking Changes](./breaking-changes.md) - Track all breaking changes
270
- - [Quick Reference](./quick-reference.md) - Common tasks at a glance
271
-
272
- ---
273
-
274
- **Need Help?**
275
-
276
- - Questions about documentation? Check the [Style Guide](./style-guide.md)
277
- - Found a bug in documentation? File an issue or submit a PR
278
- - Want to contribute? Follow this checklist and the style guide
279
-
280
- **Last Updated:** 2025-01-XX | **Version:** v0.5.65+
281
-
@@ -1,231 +0,0 @@
1
- # PACE Core Terminology Reference
2
-
3
- > **📚 Reference**: Standard Terms | [← Documentation Home](./README.md)
4
-
5
- Standard terminology and naming conventions for PACE Core documentation and code.
6
-
7
- ---
8
-
9
- **Last Updated**: 2025-02-08 | **Version**: v0.5.65+
10
-
11
- ## Purpose
12
-
13
- This document establishes consistent terminology across all PACE Core documentation, code examples, and API references. Always use these terms as specified.
14
-
15
- ## Core Terms
16
-
17
- ### Authentication & Users
18
-
19
- | Term | Usage | Example | Notes |
20
- |------|-------|---------|-------|
21
- | **user** | Lowercase noun | "the user logged in" | Generic user |
22
- | **User** | Capitalized when referring to type/class | `interface User` | TypeScript interface |
23
- | **authenticated user** | Use for logged-in users | "authenticated user session" | Preferred over "logged-in user" |
24
- | **session** | Lowercase | "user session" | Not "Session" |
25
- | **sign in / sign out** | Verb form | "sign in to your account" | Preferred over "login/logout" |
26
- | **login / logout** | Noun form | "login page", "logout button" | Only as nouns |
27
-
28
- ### Organisations & Events
29
-
30
- | Term | Usage | Example | Notes |
31
- |------|-------|---------|-------|
32
- | **organisation** | Always use "organisation" | "select organisation" | British spelling (project standard) |
33
- | **organization** | ❌ Never use | - | American spelling - not used |
34
- | **event** | Lowercase noun | "select an event" | Specific event instance |
35
- | **Event** | Capitalized for type/component | `EventProvider` | Component/type name |
36
- | **organisation context** | Lowercase | "organisation context is required" | Security context |
37
- | **organisationId** | camelCase variable | `const { organisationId } = useOrganisation()` | Property name |
38
- | **eventId** | camelCase variable | `const { eventId } = useEvent()` | Property name |
39
-
40
- ### RBAC & Permissions
41
-
42
- | Term | Usage | Example | Notes |
43
- |------|-------|---------|-------|
44
- | **RBAC** | All caps when referring to system | "the RBAC system" | Acronym |
45
- | **rbac** | Lowercase for paths/modules | `@jmruthers/pace-core/rbac` | Module path |
46
- | **permission** | Lowercase noun | "check permission" | Individual permission |
47
- | **Permission** | Capitalized for type/component | `Permission` type | TypeScript type |
48
- | **role** | Lowercase noun | "user role" | RBAC role |
49
- | **Role** | Capitalized for type | `Role` type | TypeScript type |
50
- | **scope** | Lowercase noun | "permission scope" | Security scope |
51
- | **Scope** | Capitalized for type | `Scope` type | TypeScript type |
52
-
53
- ### Components & UI
54
-
55
- | Term | Usage | Example | Notes |
56
- |------|-------|---------|-------|
57
- | **component** | Lowercase noun | "create a component" | Generic component |
58
- | **Component** | Capitalized for component name | `DataTable` component | React component |
59
- | **page** | Lowercase noun | "create a page" | Application page |
60
- | **Page** | Capitalized for component | `LoginPage` | React component |
61
- | **modal / dialog** | Use "modal" or "dialog" | "open modal" | Both terms acceptable |
62
- | **button** | Lowercase noun | "click the button" | Generic button |
63
- | **Button** | Capitalized for component | `<Button>Click</Button>` | React component |
64
-
65
- ### Data & API
66
-
67
- | Term | Usage | Example | Notes |
68
- |------|-------|---------|-------|
69
- | **data** | Lowercase noun | "fetch data" | Generic data |
70
- | **Data** | Capitalized for type | `UserData` type | TypeScript type |
71
- | **API** | All caps when referring to API | "call the API" | Acronym |
72
- | **api** | Lowercase for paths | `api/` directory | Directory path |
73
- | **RPC** | All caps when referring to RPC | "RPC function" | Acronym |
74
- | **rpc** | Lowercase for paths | `rpc/` directory | Directory path |
75
-
76
- ## Naming Conventions
77
-
78
- ### File Names
79
-
80
- | Pattern | Example | Usage |
81
- |---------|---------|-------|
82
- | **kebab-case** | `data-table.md` | Documentation files |
83
- | **camelCase** | `dataTable.tsx` | React components |
84
- | **PascalCase** | `DataTable.tsx` | Component file names |
85
- | **UPPER_SNAKE_CASE** | `API_KEY` | Environment variables |
86
-
87
- ### Variable Names
88
-
89
- | Pattern | Example | Usage |
90
- |---------|---------|-------|
91
- | **camelCase** | `userId`, `isLoading` | Variables, functions |
92
- | **PascalCase** | `UserData`, `ApiClient` | Classes, interfaces |
93
- | **UPPER_SNAKE_CASE** | `MAX_RETRIES` | Constants |
94
- | **CONSTANT_CASE** | `API_BASE_URL` | Environment constants |
95
-
96
- ### Property Names
97
-
98
- | Pattern | Example | Usage |
99
- |---------|---------|-------|
100
- | **camelCase** | `organisationId`, `appName` | Object properties |
101
- | **kebab-case** | `aria-label`, `data-testid` | HTML attributes |
102
- | **id** | Always lowercase | `id="user-123"` |
103
-
104
- ## Common Mistakes to Avoid
105
-
106
- ### ❌ Incorrect Usage
107
-
108
- ```typescript
109
- // ❌ Wrong: Mixed spelling
110
- const organizationId = getOrganisationId();
111
-
112
- // ❌ Wrong: Inconsistent capitalization
113
- function getUser(userId: string) { }
114
- class userService { }
115
-
116
- // ❌ Wrong: Inconsistent terminology
117
- function checkUserPermission() { }
118
- function validateUserAccess() { }
119
- ```
120
-
121
- ### ✅ Correct Usage
122
-
123
- ```typescript
124
- // ✅ Correct: Consistent terminology
125
- const organisationId = getOrganisationId();
126
-
127
- // ✅ Correct: Consistent capitalization
128
- function getUser(userId: string) { }
129
- class UserService { }
130
-
131
- // ✅ Correct: Consistent terminology
132
- function checkUserPermission() { }
133
- function checkUserPermission() { } // Same term used consistently
134
- ```
135
-
136
- ## Special Cases
137
-
138
- ### App vs Application
139
-
140
- - **App**: When referring to a specific application instance (e.g., "my app", "the app")
141
- - **Application**: When referring to the software concept (e.g., "application architecture", "application state")
142
- - **appName**: Always use "appName" in code (property name)
143
-
144
- ### Setup vs Set Up
145
-
146
- - **setup** (noun): "the setup process", "setup files"
147
- - **set up** (verb): "set up your environment", "I need to set up RBAC"
148
-
149
- ### Login vs Sign In
150
-
151
- - **login** (noun): "login page", "login form"
152
- - **sign in** (verb): "sign in to your account", "user must sign in"
153
- - **Sign in** (title/button): "Sign In" button text
154
-
155
- ### Props vs Properties
156
-
157
- - **props**: React component props (short form)
158
- - **properties**: Object properties in general
159
- - Both acceptable, but be consistent within a document
160
-
161
- ## Version-Specific Terms
162
-
163
- ### Current Version (v0.5.65+)
164
-
165
- - ✅ **UnifiedAuthProvider** (NOT AuthProvider)
166
- - ✅ **useUnifiedAuth** (NOT useAuth)
167
- - ✅ **requireOrganisationContext** (prop name)
168
- - ✅ **idleTimeoutMs** (prop name)
169
- - ✅ **warnBeforeMs** (prop name)
170
-
171
- ### Deprecated Terms
172
-
173
- | Old Term | New Term | Version |
174
- |----------|----------|---------|
175
- | `AuthProvider` | `UnifiedAuthProvider` | v0.5.65+ |
176
- | `useAuth` | `useUnifiedAuth` | v0.5.65+ |
177
- | `setupRBAC()` | Not needed (automatic) | v0.5.65+ |
178
-
179
- ## Documentation-Specific Terms
180
-
181
- ### Section Headings
182
-
183
- - **Overview**: Introduction to the topic
184
- - **Quick Start**: Getting started quickly
185
- - **Implementation**: How to implement
186
- - **Examples**: Code examples
187
- - **Best Practices**: Recommended patterns
188
- - **Troubleshooting**: Common issues and fixes
189
- - **API Reference**: Complete API documentation
190
-
191
- ### Navigation Terms
192
-
193
- - **← Back**: Link to previous page
194
- - **Next →**: Link to next page
195
- - **Related**: Links to related topics
196
- - **See Also**: Additional resources
197
-
198
- ## Acronyms and Abbreviations
199
-
200
- | Term | Full Form | Usage |
201
- |------|-----------|-------|
202
- | **RBAC** | Role-Based Access Control | Always spelled out first time |
203
- | **RPC** | Remote Procedure Call | Used in code context |
204
- | **API** | Application Programming Interface | Standard term |
205
- | **UI** | User Interface | Standard term |
206
- | **UX** | User Experience | Standard term |
207
- | **WCAG** | Web Content Accessibility Guidelines | Spelled out first time |
208
- | **ARIA** | Accessible Rich Internet Applications | Used in accessibility context |
209
- | **Supabase** | Supabase (product name) | Always capitalized |
210
-
211
- ## Quick Reference Checklist
212
-
213
- When writing documentation, ensure you:
214
-
215
- - [ ] Use **organisation** (British spelling), not organization
216
- - [ ] Use **sign in** (verb), not login
217
- - [ ] Use **camelCase** for variables, **PascalCase** for components
218
- - [ ] Use **lowercase** for generic terms, **Capitalized** for types/components
219
- - [ ] Be consistent within each document
220
- - [ ] Spell out acronyms first time they appear
221
- - [ ] Use standard PACE Core terms from this guide
222
-
223
- ## Related Documentation
224
-
225
- - [Style Guide](./style-guide.md)
226
- - [Documentation Templates](./documentation-templates.md)
227
- - [API Reference](./api-reference/components.md)
228
-
229
- ---
230
-
231
- **Remember**: Consistency is key to professional, maintainable documentation!