@jmruthers/pace-core 0.5.74 → 0.5.76

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 (369) hide show
  1. package/dist/DataTable-4GAVPIEG.js +120 -0
  2. package/dist/{PublicLoadingSpinner-DLpF5bbs.d.ts → PublicLoadingSpinner-BiNER8F5.d.ts} +30 -19
  3. package/dist/RBACService-C4udt_Zp.d.ts +528 -0
  4. package/dist/{UnifiedAuthProvider-K4NRGXL4.js → UnifiedAuthProvider-3NKDOSOK.js} +6 -4
  5. package/dist/UnifiedAuthProvider-Bj6YCf7c.d.ts +113 -0
  6. package/dist/chunk-5F3NDPJV.js +232 -0
  7. package/dist/chunk-5F3NDPJV.js.map +1 -0
  8. package/dist/chunk-A4FUBC7B.js +17 -0
  9. package/dist/chunk-A4FUBC7B.js.map +1 -0
  10. package/dist/{chunk-SMJZMKYN.js → chunk-A6HBIY5P.js} +2 -11
  11. package/dist/{chunk-SMJZMKYN.js.map → chunk-A6HBIY5P.js.map} +1 -1
  12. package/dist/{chunk-LVQ26TCN.js → chunk-AFGTSUAD.js} +43 -127
  13. package/dist/chunk-AFGTSUAD.js.map +1 -0
  14. package/dist/{chunk-BKVGJVUR.js → chunk-K34IM5CT.js} +497 -33
  15. package/dist/chunk-K34IM5CT.js.map +1 -0
  16. package/dist/{chunk-UJMCGBLS.js → chunk-KHJS6VIA.js} +203 -41
  17. package/dist/chunk-KHJS6VIA.js.map +1 -0
  18. package/dist/{chunk-ORSMVXO2.js → chunk-KK73ZB4E.js} +9 -14
  19. package/dist/chunk-KK73ZB4E.js.map +1 -0
  20. package/dist/{chunk-VKOCWWVY.js → chunk-L3RV2ALE.js} +1 -6
  21. package/dist/{chunk-VKOCWWVY.js.map → chunk-L3RV2ALE.js.map} +1 -1
  22. package/dist/chunk-LW7MMEAQ.js +59 -0
  23. package/dist/chunk-LW7MMEAQ.js.map +1 -0
  24. package/dist/{chunk-IHMMNKNA.js → chunk-M5IWZRBT.js} +5118 -1864
  25. package/dist/chunk-M5IWZRBT.js.map +1 -0
  26. package/dist/{chunk-DG5Z55HH.js → chunk-NTNILOBC.js} +7 -9
  27. package/dist/chunk-NTNILOBC.js.map +1 -0
  28. package/dist/chunk-PYUXFQJ3.js +11 -0
  29. package/dist/chunk-PYUXFQJ3.js.map +1 -0
  30. package/dist/chunk-URUTVZ7N.js +27 -0
  31. package/dist/chunk-URUTVZ7N.js.map +1 -0
  32. package/dist/chunk-WN6XJWOS.js +2468 -0
  33. package/dist/chunk-WN6XJWOS.js.map +1 -0
  34. package/dist/{chunk-3SP4P7NS.js → chunk-XLZ7U46Z.js} +59 -1
  35. package/dist/chunk-XLZ7U46Z.js.map +1 -0
  36. package/dist/{chunk-H2TNUICK.js → chunk-Y6TXWPJO.js} +50 -50
  37. package/dist/chunk-Y6TXWPJO.js.map +1 -0
  38. package/dist/{chunk-YNUBMSMV.js → chunk-YCKPEMJA.js} +186 -263
  39. package/dist/chunk-YCKPEMJA.js.map +1 -0
  40. package/dist/components.d.ts +4 -5
  41. package/dist/components.js +35 -41
  42. package/dist/components.js.map +1 -1
  43. package/dist/hooks.d.ts +20 -43
  44. package/dist/hooks.js +13 -12
  45. package/dist/hooks.js.map +1 -1
  46. package/dist/index.d.ts +156 -10
  47. package/dist/index.js +193 -96
  48. package/dist/index.js.map +1 -1
  49. package/dist/{organisation-t-vvQC3g.d.ts → organisation-BtshODVF.d.ts} +4 -3
  50. package/dist/providers.d.ts +27 -38
  51. package/dist/providers.js +33 -23
  52. package/dist/rbac/index.d.ts +114 -5
  53. package/dist/rbac/index.js +15 -15
  54. package/dist/styles/index.js +2 -2
  55. package/dist/theming/runtime.js +1 -3
  56. package/dist/types.d.ts +3 -3
  57. package/dist/types.js +1 -1
  58. package/dist/types.js.map +1 -1
  59. package/dist/{unified-CMPjE_fv.d.ts → unified-CM7T0aTK.d.ts} +1 -1
  60. package/dist/useInactivityTracker-MRUU55XI.js +10 -0
  61. package/dist/{usePublicRouteParams-Ua1Vz-HG.d.ts → usePublicRouteParams-B-CumWRc.d.ts} +3 -3
  62. package/dist/utils.js +7 -9
  63. package/dist/utils.js.map +1 -1
  64. package/dist/validation.d.ts +1 -1
  65. package/docs/TERMINOLOGY.md +231 -0
  66. package/docs/api/classes/ColumnFactory.md +1 -1
  67. package/docs/api/classes/ErrorBoundary.md +1 -1
  68. package/docs/api/classes/InvalidScopeError.md +1 -1
  69. package/docs/api/classes/MissingUserContextError.md +1 -1
  70. package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
  71. package/docs/api/classes/PermissionDeniedError.md +1 -1
  72. package/docs/api/classes/PublicErrorBoundary.md +1 -1
  73. package/docs/api/classes/RBACAuditManager.md +1 -1
  74. package/docs/api/classes/RBACCache.md +1 -1
  75. package/docs/api/classes/RBACEngine.md +1 -1
  76. package/docs/api/classes/RBACError.md +1 -1
  77. package/docs/api/classes/RBACNotInitializedError.md +1 -1
  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 +1 -1
  82. package/docs/api/interfaces/ButtonProps.md +3 -3
  83. package/docs/api/interfaces/CardProps.md +2 -2
  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/DataTableAction.md +1 -1
  88. package/docs/api/interfaces/DataTableColumn.md +1 -1
  89. package/docs/api/interfaces/DataTableProps.md +1 -1
  90. package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
  91. package/docs/api/interfaces/EmptyStateConfig.md +1 -1
  92. package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
  93. package/docs/api/interfaces/EventLogoProps.md +2 -2
  94. package/docs/api/interfaces/FileDisplayProps.md +1 -1
  95. package/docs/api/interfaces/FileMetadata.md +1 -1
  96. package/docs/api/interfaces/FileReference.md +1 -1
  97. package/docs/api/interfaces/FileSizeLimits.md +1 -1
  98. package/docs/api/interfaces/FileUploadOptions.md +1 -1
  99. package/docs/api/interfaces/FileUploadProps.md +1 -1
  100. package/docs/api/interfaces/FooterProps.md +1 -1
  101. package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
  102. package/docs/api/interfaces/InputProps.md +2 -2
  103. package/docs/api/interfaces/LabelProps.md +1 -1
  104. package/docs/api/interfaces/LoginFormProps.md +1 -1
  105. package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
  106. package/docs/api/interfaces/NavigationContextType.md +1 -1
  107. package/docs/api/interfaces/NavigationGuardProps.md +1 -1
  108. package/docs/api/interfaces/NavigationItem.md +1 -1
  109. package/docs/api/interfaces/NavigationMenuProps.md +1 -1
  110. package/docs/api/interfaces/NavigationProviderProps.md +1 -1
  111. package/docs/api/interfaces/Organisation.md +1 -1
  112. package/docs/api/interfaces/OrganisationContextType.md +28 -17
  113. package/docs/api/interfaces/OrganisationMembership.md +1 -1
  114. package/docs/api/interfaces/OrganisationProviderProps.md +2 -2
  115. package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
  116. package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
  117. package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
  118. package/docs/api/interfaces/PageAccessRecord.md +1 -1
  119. package/docs/api/interfaces/PagePermissionContextType.md +1 -1
  120. package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
  121. package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
  122. package/docs/api/interfaces/PaletteData.md +1 -1
  123. package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
  124. package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
  125. package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
  126. package/docs/api/interfaces/PublicLoadingSpinnerProps.md +2 -2
  127. package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
  128. package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
  129. package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
  130. package/docs/api/interfaces/RBACConfig.md +1 -1
  131. package/docs/api/interfaces/RBACContextType.md +5 -11
  132. package/docs/api/interfaces/RBACLogger.md +1 -1
  133. package/docs/api/interfaces/RBACProviderProps.md +1 -1
  134. package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
  135. package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
  136. package/docs/api/interfaces/RouteAccessRecord.md +1 -1
  137. package/docs/api/interfaces/RouteConfig.md +1 -1
  138. package/docs/api/interfaces/SecureDataContextType.md +1 -1
  139. package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
  140. package/docs/api/interfaces/StorageConfig.md +1 -1
  141. package/docs/api/interfaces/StorageFileInfo.md +1 -1
  142. package/docs/api/interfaces/StorageFileMetadata.md +1 -1
  143. package/docs/api/interfaces/StorageListOptions.md +1 -1
  144. package/docs/api/interfaces/StorageListResult.md +1 -1
  145. package/docs/api/interfaces/StorageUploadOptions.md +1 -1
  146. package/docs/api/interfaces/StorageUploadResult.md +1 -1
  147. package/docs/api/interfaces/StorageUrlOptions.md +1 -1
  148. package/docs/api/interfaces/StyleImport.md +1 -1
  149. package/docs/api/interfaces/SwitchProps.md +1 -1
  150. package/docs/api/interfaces/ToastActionElement.md +1 -1
  151. package/docs/api/interfaces/ToastProps.md +1 -1
  152. package/docs/api/interfaces/UnifiedAuthContextType.md +524 -440
  153. package/docs/api/interfaces/UnifiedAuthProviderProps.md +14 -14
  154. package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
  155. package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
  156. package/docs/api/interfaces/UsePublicEventLogoOptions.md +1 -1
  157. package/docs/api/interfaces/UsePublicEventLogoReturn.md +1 -1
  158. package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
  159. package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
  160. package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
  161. package/docs/api/interfaces/UseResolvedScopeOptions.md +47 -0
  162. package/docs/api/interfaces/UseResolvedScopeReturn.md +47 -0
  163. package/docs/api/interfaces/UserEventAccess.md +11 -11
  164. package/docs/api/interfaces/UserMenuProps.md +1 -1
  165. package/docs/api/interfaces/UserProfile.md +1 -1
  166. package/docs/api/modules.md +234 -61
  167. package/docs/api-reference/providers.md +26 -7
  168. package/docs/architecture/services.md +30 -32
  169. package/docs/best-practices/README.md +20 -0
  170. package/docs/best-practices/accessibility.md +566 -0
  171. package/docs/best-practices/performance-expansion.md +473 -0
  172. package/docs/breaking-changes.md +2 -5
  173. package/docs/core-concepts/authentication.md +15 -7
  174. package/docs/documentation-index.md +1 -1
  175. package/docs/documentation-templates.md +539 -0
  176. package/docs/getting-started/quick-start.md +16 -66
  177. package/docs/implementation-guides/component-styling.md +410 -0
  178. package/docs/implementation-guides/data-tables.md +1 -1
  179. package/docs/migration/service-architecture.md +121 -260
  180. package/docs/rbac/README-rbac-rls-integration.md +48 -38
  181. package/docs/style-guide.md +39 -0
  182. package/{src/rbac/examples → examples/RBAC}/CompleteRBACExample.tsx +3 -2
  183. package/{src/rbac/examples → examples/RBAC}/EventBasedApp.tsx +5 -4
  184. package/{src/components/examples → examples/RBAC}/PermissionExample.tsx +7 -6
  185. package/examples/RBAC/__tests__/PermissionExample.test.tsx +150 -0
  186. package/examples/RBAC/index.ts +13 -0
  187. package/examples/README.md +37 -0
  188. package/examples/index.ts +22 -0
  189. package/{src/examples → examples/public-pages}/CorrectPublicPageImplementation.tsx +1 -1
  190. package/{src/examples → examples/public-pages}/PublicEventPage.tsx +1 -1
  191. package/{src/examples → examples/public-pages}/PublicPageApp.tsx +1 -1
  192. package/{src/examples → examples/public-pages}/PublicPageUsageExample.tsx +1 -1
  193. package/examples/public-pages/__tests__/PublicPageUsageExample.test.tsx +159 -0
  194. package/examples/public-pages/index.ts +14 -0
  195. package/package.json +22 -18
  196. package/src/__tests__/TEST_GUIDE_CURSOR.md +940 -9
  197. package/src/__tests__/helpers/README.md +255 -0
  198. package/src/__tests__/helpers/index.ts +62 -0
  199. package/src/__tests__/helpers/supabaseMock.ts +75 -5
  200. package/src/__tests__/rbac/PagePermissionGuard.test.tsx +6 -8
  201. package/src/components/DataTable/__tests__/DataTable.default-state.test.tsx +17 -6
  202. package/src/components/DataTable/__tests__/DataTableCore.test.tsx +73 -9
  203. package/src/components/DataTable/components/DataTableCore.tsx +280 -475
  204. package/src/components/DataTable/components/UnifiedTableBody.tsx +120 -153
  205. package/src/components/DataTable/components/__tests__/COVERAGE_NOTE.md +55 -0
  206. package/src/components/DataTable/components/index.ts +1 -2
  207. package/src/components/DataTable/context/__tests__/DataTableContext.test.tsx +208 -275
  208. package/src/components/DataTable/core/__tests__/ColumnFactory.test.ts +254 -0
  209. package/src/components/DataTable/core/index.ts +1 -8
  210. package/src/components/DataTable/examples/__tests__/HierarchicalExample.test.tsx +45 -0
  211. package/src/components/DataTable/examples/__tests__/PerformanceExample.test.tsx +117 -0
  212. package/src/components/DataTable/hooks/__tests__/useColumnOrderPersistence.test.ts +525 -0
  213. package/src/components/DataTable/hooks/__tests__/useColumnReordering.test.ts +570 -0
  214. package/src/components/DataTable/hooks/__tests__/useHierarchicalState.test.ts +214 -0
  215. package/src/components/DataTable/hooks/__tests__/useTableColumns.test.ts +224 -0
  216. package/src/components/DataTable/hooks/index.ts +6 -0
  217. package/src/components/DataTable/hooks/useColumnReordering.ts +1 -0
  218. package/src/components/DataTable/hooks/useDataTablePermissions.ts +149 -0
  219. package/src/components/DataTable/hooks/useDataTableState.ts +12 -6
  220. package/src/components/DataTable/hooks/useHierarchicalState.ts +26 -8
  221. package/src/components/DataTable/hooks/useTableColumns.ts +153 -0
  222. package/src/components/DataTable/index.ts +1 -9
  223. package/src/components/DataTable/utils/__tests__/COVERAGE_NOTE.md +89 -0
  224. package/src/components/DataTable/utils/__tests__/exportUtils.test.ts +3 -6
  225. package/src/components/DataTable/utils/__tests__/flexibleImport.test.ts +462 -0
  226. package/src/components/DataTable/utils/__tests__/hierarchicalSorting.test.ts +247 -0
  227. package/src/components/DataTable/utils/__tests__/hierarchicalUtils.test.ts +8 -6
  228. package/src/components/DataTable/utils/__tests__/performanceUtils.test.ts +466 -0
  229. package/src/components/DataTable/utils/__tests__/rowUtils.test.ts +265 -0
  230. package/src/components/DataTable/utils/errorHandling.ts +52 -460
  231. package/src/components/DataTable/utils/exportUtils.ts +46 -15
  232. package/src/components/DataTable/utils/hierarchicalSorting.ts +50 -3
  233. package/src/components/DataTable/utils/hierarchicalUtils.ts +167 -34
  234. package/src/components/DataTable/utils/index.ts +5 -0
  235. package/src/components/DataTable/utils/rowUtils.ts +68 -0
  236. package/src/components/Dialog/examples/__tests__/HtmlDialogExample.test.tsx +71 -0
  237. package/src/components/Dialog/examples/__tests__/SimpleHtmlTest.test.tsx +122 -0
  238. package/src/components/EventSelector/EventSelector.test.tsx +672 -0
  239. package/src/components/EventSelector/EventSelector.tsx +1 -1
  240. package/src/components/Header/Header.test.tsx +35 -1
  241. package/src/components/Header/Header.tsx +3 -1
  242. package/src/components/Label/__tests__/Label.test.tsx +434 -0
  243. package/src/components/OrganisationSelector/OrganisationSelector.tsx +3 -3
  244. package/src/components/PaceAppLayout/__tests__/PaceAppLayout.rbac.test.tsx +24 -4
  245. package/src/components/PaceLoginPage/PaceLoginPage.test.tsx +3 -2
  246. package/src/components/PublicLayout/__tests__/PublicPageContextChecker.test.tsx +190 -0
  247. package/src/components/PublicLayout/__tests__/PublicPageDebugger.test.tsx +185 -0
  248. package/src/components/PublicLayout/__tests__/PublicPageProvider.test.tsx +313 -0
  249. package/src/components/Select/Select.test.tsx +143 -120
  250. package/src/components/Select/Select.tsx +47 -212
  251. package/src/components/Select/hooks.ts +36 -1
  252. package/src/components/Select/index.ts +2 -1
  253. package/src/hooks/__tests__/useFocusManagement.unit.test.ts +220 -0
  254. package/src/hooks/__tests__/useIsMobile.unit.test.ts +117 -0
  255. package/src/hooks/__tests__/useKeyboardShortcuts.unit.test.ts +295 -0
  256. package/src/hooks/__tests__/useOrganisationSecurity.unit.test.tsx +29 -19
  257. package/src/hooks/__tests__/useRBAC.unit.test.ts +7 -3
  258. package/src/hooks/__tests__/useSecureDataAccess.unit.test.tsx +115 -19
  259. package/src/hooks/services/__tests__/useServiceHooks.test.tsx +137 -0
  260. package/src/hooks/useEventTheme.test.ts +350 -0
  261. package/src/hooks/useEventTheme.ts +1 -1
  262. package/src/hooks/useEvents.ts +61 -0
  263. package/src/hooks/useOrganisationSecurity.test.ts +4 -4
  264. package/src/hooks/useOrganisationSecurity.ts +2 -2
  265. package/src/hooks/useOrganisations.ts +64 -0
  266. package/src/hooks/useSecureDataAccess.test.ts +37 -30
  267. package/src/hooks/useSecureDataAccess.ts +2 -2
  268. package/src/index.ts +18 -3
  269. package/src/providers/AuthProvider.tsx +8 -292
  270. package/src/providers/EventProvider.tsx +15 -425
  271. package/src/providers/InactivityProvider.tsx +8 -231
  272. package/src/providers/OrganisationProvider.test.simple.tsx +3 -2
  273. package/src/providers/OrganisationProvider.tsx +11 -890
  274. package/src/providers/UnifiedAuthProvider.tsx +8 -320
  275. package/src/providers/__tests__/AuthProvider.test.tsx +18 -17
  276. package/src/providers/__tests__/EventProvider.test.tsx +253 -2
  277. package/src/providers/__tests__/InactivityProvider.test-helper.tsx +65 -0
  278. package/src/providers/__tests__/InactivityProvider.test.tsx +46 -114
  279. package/src/providers/__tests__/OrganisationProvider.test.tsx +313 -3
  280. package/src/providers/__tests__/ProviderLifecycle.test.tsx +341 -0
  281. package/src/providers/__tests__/UnifiedAuthProvider.test.tsx +383 -2
  282. package/src/providers/index.ts +8 -7
  283. package/src/providers/services/EventServiceProvider.tsx +3 -0
  284. package/src/providers/services/UnifiedAuthProvider.tsx +3 -0
  285. package/src/rbac/hooks/__tests__/usePermissions.integration.test.ts +437 -0
  286. package/src/rbac/hooks/index.ts +2 -0
  287. package/src/rbac/hooks/usePermissions.test.ts +296 -0
  288. package/src/rbac/hooks/useRBAC.test.ts +9 -5
  289. package/src/rbac/hooks/useRBAC.ts +3 -3
  290. package/src/rbac/hooks/useResolvedScope.ts +232 -0
  291. package/src/rbac/providers/__tests__/RBACProvider.integration.test.tsx +688 -0
  292. package/src/rbac/providers/__tests__/RBACProvider.test.tsx +507 -0
  293. package/src/services/AuthService.ts +19 -4
  294. package/src/services/__tests__/AuthService.test.ts +288 -0
  295. package/src/services/__tests__/InactivityService.lifecycle.test.ts +411 -0
  296. package/src/services/__tests__/OrganisationService.pagination.test.ts +375 -0
  297. package/src/styles/core.css +2 -0
  298. package/src/types/__tests__/README.md +114 -0
  299. package/src/types/__tests__/guards.test.ts +246 -0
  300. package/src/types/__tests__/validation.test.ts +731 -0
  301. package/src/types/guards.ts +1 -0
  302. package/src/types/organisation.ts +3 -2
  303. package/src/utils/__tests__/file-reference.test.ts +383 -0
  304. package/src/utils/__tests__/performanceBenchmark.test.ts +175 -0
  305. package/src/utils/appNameResolver.test.ts +54 -0
  306. package/src/validation/__tests__/csrf.unit.test.ts +63 -0
  307. package/src/validation/__tests__/passwordSchema.unit.test.ts +105 -0
  308. package/src/validation/__tests__/sanitization.unit.test.ts +250 -0
  309. package/src/validation/__tests__/schemaUtils.unit.test.ts +451 -0
  310. package/src/validation/__tests__/user.unit.test.ts +440 -0
  311. package/dist/DataTable-2QR5TER5.js +0 -102
  312. package/dist/RBACProvider-BO4ilsQB.d.ts +0 -63
  313. package/dist/UnifiedAuthProvider-D02AMXgO.d.ts +0 -103
  314. package/dist/chunk-3SP4P7NS.js.map +0 -1
  315. package/dist/chunk-B5LK25HV.js +0 -953
  316. package/dist/chunk-B5LK25HV.js.map +0 -1
  317. package/dist/chunk-BKVGJVUR.js.map +0 -1
  318. package/dist/chunk-C5Q5LRU5.js +0 -5691
  319. package/dist/chunk-C5Q5LRU5.js.map +0 -1
  320. package/dist/chunk-CDDYJCYU.js +0 -79
  321. package/dist/chunk-CDDYJCYU.js.map +0 -1
  322. package/dist/chunk-DG5Z55HH.js.map +0 -1
  323. package/dist/chunk-H2TNUICK.js.map +0 -1
  324. package/dist/chunk-IHMMNKNA.js.map +0 -1
  325. package/dist/chunk-LVQ26TCN.js.map +0 -1
  326. package/dist/chunk-ORSMVXO2.js.map +0 -1
  327. package/dist/chunk-TYHR5X4W.js +0 -33
  328. package/dist/chunk-TYHR5X4W.js.map +0 -1
  329. package/dist/chunk-UJMCGBLS.js.map +0 -1
  330. package/dist/chunk-V6BHACCH.js +0 -17
  331. package/dist/chunk-V6BHACCH.js.map +0 -1
  332. package/dist/chunk-YNUBMSMV.js.map +0 -1
  333. package/dist/eventContext-BBA42P6G.js +0 -14
  334. package/dist/rbac/cli/policy-manager.js +0 -278
  335. package/dist/rbac/cli/policy-manager.js.map +0 -1
  336. package/docs/api/interfaces/EventContextType.md +0 -96
  337. package/docs/api/interfaces/EventProviderProps.md +0 -19
  338. package/docs/documentation-style-checklist.md +0 -294
  339. package/src/components/DataTable/components/DataTableBody.tsx +0 -488
  340. package/src/components/DataTable/components/DraggableColumnHeader.tsx +0 -144
  341. package/src/components/DataTable/components/VirtualizedDataTable.tsx +0 -515
  342. package/src/components/DataTable/core/ActionManager.ts +0 -235
  343. package/src/components/DataTable/core/ColumnManager.ts +0 -205
  344. package/src/components/DataTable/core/DataManager.ts +0 -188
  345. package/src/components/DataTable/core/DataTableContext.tsx +0 -181
  346. package/src/components/DataTable/core/LocalDataAdapter.ts +0 -264
  347. package/src/components/DataTable/core/PluginRegistry.ts +0 -229
  348. package/src/components/DataTable/core/StateManager.ts +0 -311
  349. package/src/components/DataTable/core/__tests__/ActionManager.test.ts +0 -634
  350. package/src/components/DataTable/core/__tests__/DataManager.test.ts +0 -519
  351. package/src/components/DataTable/core/__tests__/StateManager.test.ts +0 -714
  352. package/src/components/DataTable/core/interfaces.ts +0 -338
  353. package/src/components/DataTable/utils/debugTools.ts +0 -583
  354. package/src/components/Select/Select.bug-test.tsx +0 -69
  355. package/src/components/Select/Select.refactored.tsx +0 -497
  356. package/src/providers/OrganisationProvider.test.tsx +0 -164
  357. package/src/providers/UnifiedAuthProvider.test.tsx +0 -124
  358. package/src/providers/__tests__/AuthProvider.test.tsx.backup +0 -771
  359. package/src/providers/__tests__/EventProvider.test.tsx.backup +0 -824
  360. package/src/providers/__tests__/OrganisationProvider.test.tsx.backup +0 -820
  361. package/src/providers/__tests__/UnifiedAuthProvider.test.tsx.backup +0 -911
  362. package/src/providers/__tests__/UnifiedAuthProvider.test.tsx.backup2 +0 -166
  363. package/src/rbac/cli/__tests__/policy-manager.test.ts +0 -339
  364. package/src/rbac/cli/policy-manager.ts +0 -443
  365. package/dist/{DataTable-2QR5TER5.js.map → DataTable-4GAVPIEG.js.map} +0 -0
  366. package/dist/{UnifiedAuthProvider-K4NRGXL4.js.map → UnifiedAuthProvider-3NKDOSOK.js.map} +0 -0
  367. package/dist/{eventContext-BBA42P6G.js.map → useInactivityTracker-MRUU55XI.js.map} +0 -0
  368. package/dist/{validation-PM_iOaTI.d.ts → validation-D8VcbTzC.d.ts} +2 -2
  369. /package/src/utils/{appNameResolver.test.ts.backup → appNameResolver.test 2.ts} +0 -0
@@ -16,6 +16,26 @@ Comprehensive best practices for building secure, performant, and maintainable a
16
16
  - [Accessibility](#-accessibility)
17
17
  - [Maintenance](#-maintenance)
18
18
 
19
+ ## Core Topics
20
+
21
+ ### Security
22
+ - [**Security Best Practices**](./security.md) - Security guidelines and secure coding patterns
23
+
24
+ ### Accessibility
25
+ - [**Accessibility Guide**](./accessibility.md) - WCAG compliance and inclusive design
26
+
27
+ ### Performance
28
+ - [**Performance Optimization**](./performance.md) - Basic optimization strategies
29
+ - [**Advanced Performance**](./performance-expansion.md) - Advanced optimization techniques
30
+
31
+ ### Testing
32
+ - [**Testing Best Practices**](./testing.md) - Testing strategies and patterns
33
+
34
+ ### Deployment
35
+ - [**Deployment Guide**](./deployment.md) - Production deployment guidelines
36
+
37
+ ---
38
+
19
39
  ## 🔒 Security Best Practices
20
40
 
21
41
  ### Authentication & Authorization
@@ -0,0 +1,566 @@
1
+ # Best Practices: Accessibility
2
+
3
+ > **📚 Best Practices**: Accessibility & WCAG Compliance | [← Back](./README.md) | [Implementation Guides](../implementation-guides/README.md)
4
+
5
+ Accessibility best practices for creating inclusive PACE Core applications that work for all users.
6
+
7
+ ---
8
+
9
+ **Last Updated**: 2025-02-08 | **Version**: v0.5.65+
10
+
11
+ ## Overview
12
+
13
+ PACE Core components are designed with accessibility in mind, following WCAG 2.1 AA standards. This guide helps you build accessible applications using PACE Core components.
14
+
15
+ ## Core Principles
16
+
17
+ ### Principle 1: Semantic HTML
18
+
19
+ **Why**: Screen readers rely on semantic HTML to understand page structure and content meaning.
20
+
21
+ **Implementation**:
22
+ ```tsx
23
+ // ✅ Good - Use semantic HTML
24
+ import { Button } from '@jmruthers/pace-core';
25
+
26
+ function MyComponent() {
27
+ return (
28
+ <main>
29
+ <h1>Page Title</h1>
30
+ <section>
31
+ <h2>Section Title</h2>
32
+ <p>Content here</p>
33
+ </section>
34
+ <Button aria-label="Submit form">Submit</Button>
35
+ </main>
36
+ );
37
+ }
38
+ ```
39
+
40
+ **Avoid**:
41
+ ```tsx
42
+ // ❌ Bad - Overuse of divs
43
+ <div>
44
+ <div className="title">Page Title</div>
45
+ <div>
46
+ <div className="section">Content</div>
47
+ </div>
48
+ </div>
49
+ ```
50
+
51
+ ### Principle 2: Keyboard Navigation
52
+
53
+ **Why**: Users who cannot use a mouse or prefer keyboard navigation must be able to access all interactive elements.
54
+
55
+ **Implementation**:
56
+ ```tsx
57
+ import { Button, DataTable } from '@jmruthers/pace-core';
58
+
59
+ // PACE Core components handle keyboard navigation automatically
60
+ function AccessibleTable() {
61
+ return (
62
+ <DataTable
63
+ data={data}
64
+ columns={columns}
65
+ features={{
66
+ // Keyboard navigation enabled by default
67
+ pagination: true,
68
+ sorting: true,
69
+ }}
70
+ />
71
+ );
72
+ }
73
+ ```
74
+
75
+ ### Principle 3: ARIA Labels and Roles
76
+
77
+ **Why**: Provide clear context for screen readers when visible text isn't sufficient.
78
+
79
+ **Implementation**:
80
+ ```tsx
81
+ import { Button, Icon } from '@jmruthers/pace-core';
82
+
83
+ function ActionButton({ onDelete }) {
84
+ return (
85
+ <Button
86
+ onClick={onDelete}
87
+ aria-label="Delete user"
88
+ aria-describedby="delete-help-text"
89
+ >
90
+ <Icon name="trash" aria-hidden="true" />
91
+ Delete
92
+ </Button>
93
+ );
94
+ }
95
+ ```
96
+
97
+ **Avoid**:
98
+ ```tsx
99
+ // ❌ Bad - Icon without label
100
+ <Button onClick={onDelete}>
101
+ <Icon name="trash" />
102
+ </Button>
103
+ ```
104
+
105
+ ## PACE Core Component Accessibility Features
106
+
107
+ ### DataTable Component
108
+
109
+ **Built-in accessibility**:
110
+ - ✅ Keyboard navigation (Tab, Enter, Arrow keys)
111
+ - ✅ ARIA roles and labels
112
+ - ✅ Screen reader announcements
113
+ - ✅ Focus management
114
+
115
+ **Example**:
116
+ ```tsx
117
+ import { DataTable } from '@jmruthers/pace-core';
118
+
119
+ function AccessibleDataTable() {
120
+ return (
121
+ <DataTable
122
+ data={data}
123
+ columns={columns}
124
+ aria-label="User data table"
125
+ features={{
126
+ search: true,
127
+ pagination: true,
128
+ }}
129
+ />
130
+ );
131
+ }
132
+ ```
133
+
134
+ ### Button Component
135
+
136
+ **Built-in accessibility**:
137
+ - ✅ Keyboard focusable
138
+ - ✅ Proper focus indicators
139
+ - ✅ ARIA attributes support
140
+
141
+ **Example**:
142
+ ```tsx
143
+ import { Button } from '@jmruthers/pace-core';
144
+
145
+ function AccessibleButton() {
146
+ return (
147
+ <Button
148
+ aria-label="Close dialog"
149
+ aria-describedby="close-help"
150
+ >
151
+ Close
152
+ <span id="close-help" className="sr-only">
153
+ Closes the current dialog
154
+ </span>
155
+ </Button>
156
+ );
157
+ }
158
+ ```
159
+
160
+ ### Form Components
161
+
162
+ **Built-in accessibility**:
163
+ - ✅ Label associations
164
+ - ✅ Error announcements
165
+ - ✅ Required field indicators
166
+ - ✅ Validation feedback
167
+
168
+ **Example**:
169
+ ```tsx
170
+ import { Input, Label, FormError } from '@jmruthers/pace-core';
171
+
172
+ function AccessibleForm() {
173
+ return (
174
+ <form aria-labelledby="form-title">
175
+ <h2 id="form-title">User Information</h2>
176
+
177
+ <div>
178
+ <Label htmlFor="email">Email Address</Label>
179
+ <Input
180
+ id="email"
181
+ type="email"
182
+ required
183
+ aria-required="true"
184
+ aria-describedby="email-error"
185
+ />
186
+ <FormError id="email-error" role="alert">
187
+ Please enter a valid email
188
+ </FormError>
189
+ </div>
190
+ </form>
191
+ );
192
+ }
193
+ ```
194
+
195
+ ### Dialog/Modal Components
196
+
197
+ **Built-in accessibility**:
198
+ - ✅ Focus trap management
199
+ - ✅ ESC key support
200
+ - ✅ ARIA roles and properties
201
+ - ✅ Screen reader announcements
202
+
203
+ **Example**:
204
+ ```tsx
205
+ import { Dialog, DialogTrigger, DialogContent } from '@jmruthers/pace-core';
206
+
207
+ function AccessibleDialog() {
208
+ return (
209
+ <Dialog>
210
+ <DialogTrigger aria-label="Open user settings">
211
+ Settings
212
+ </DialogTrigger>
213
+ <DialogContent
214
+ aria-labelledby="dialog-title"
215
+ aria-describedby="dialog-description"
216
+ >
217
+ <h2 id="dialog-title">User Settings</h2>
218
+ <p id="dialog-description">
219
+ Configure your account preferences
220
+ </p>
221
+ {/* Dialog content */}
222
+ </DialogContent>
223
+ </Dialog>
224
+ );
225
+ }
226
+ ```
227
+
228
+ ## Common Patterns
229
+
230
+ ### Pattern 1: Loading States with Announcements
231
+
232
+ **Use when**: Data is loading asynchronously
233
+
234
+ **Example**:
235
+ ```tsx
236
+ import { useUnifiedAuth } from '@jmruthers/pace-core';
237
+
238
+ function AccessibleUserProfile() {
239
+ const { user, loading, error } = useUnifiedAuth();
240
+
241
+ return (
242
+ <div role="status" aria-live="polite">
243
+ {loading && (
244
+ <div aria-busy="true">
245
+ <span className="sr-only">Loading user data</span>
246
+ Loading...
247
+ </div>
248
+ )}
249
+ {error && (
250
+ <div role="alert">
251
+ <span className="sr-only">Error loading user data</span>
252
+ Error: {error.message}
253
+ </div>
254
+ )}
255
+ {user && (
256
+ <div>
257
+ <h1>Welcome, {user.email}</h1>
258
+ </div>
259
+ )}
260
+ </div>
261
+ );
262
+ }
263
+ ```
264
+
265
+ ### Pattern 2: Skip Links
266
+
267
+ **Use when**: Creating long pages with repetitive navigation
268
+
269
+ **Example**:
270
+ ```tsx
271
+ function AccessibleLayout() {
272
+ return (
273
+ <div>
274
+ {/* Skip link */}
275
+ <a href="#main-content" className="skip-link">
276
+ Skip to main content
277
+ </a>
278
+
279
+ <Navigation />
280
+
281
+ <main id="main-content" tabIndex="-1">
282
+ <h1>Main Content</h1>
283
+ </main>
284
+
285
+ <Footer />
286
+ </div>
287
+ );
288
+ }
289
+ ```
290
+
291
+ ### Pattern 3: Focus Management
292
+
293
+ **Use when**: Opening modals or changing page context
294
+
295
+ **Example**:
296
+ ```tsx
297
+ import { useEffect, useRef } from 'react';
298
+ import { Dialog, DialogContent } from '@jmruthers/pace-core';
299
+
300
+ function AccessibleDialog({ isOpen, onClose }) {
301
+ const titleRef = useRef<HTMLHeadingElement>(null);
302
+
303
+ useEffect(() => {
304
+ if (isOpen && titleRef.current) {
305
+ // Focus the dialog title when it opens
306
+ titleRef.current.focus();
307
+ }
308
+ }, [isOpen]);
309
+
310
+ return (
311
+ <Dialog isOpen={isOpen} onClose={onClose}>
312
+ <DialogContent
313
+ aria-labelledby="dialog-title"
314
+ role="dialog"
315
+ aria-modal="true"
316
+ >
317
+ <h2 id="dialog-title" ref={titleRef} tabIndex={-1}>
318
+ Important Information
319
+ </h2>
320
+ {/* Dialog content */}
321
+ </DialogContent>
322
+ </Dialog>
323
+ );
324
+ }
325
+ ```
326
+
327
+ ### Pattern 4: Error Messages
328
+
329
+ **Use when**: Form validation errors or error states
330
+
331
+ **Example**:
332
+ ```tsx
333
+ import { Input, FormError } from '@jmruthers/pace-core';
334
+
335
+ function AccessibleForm() {
336
+ const [email, setEmail] = useState('');
337
+ const [error, setError] = useState('');
338
+
339
+ return (
340
+ <div>
341
+ <Label htmlFor="email">Email</Label>
342
+ <Input
343
+ id="email"
344
+ type="email"
345
+ value={email}
346
+ onChange={(e) => setEmail(e.target.value)}
347
+ aria-invalid={!!error}
348
+ aria-describedby={error ? "email-error" : undefined}
349
+ />
350
+ {error && (
351
+ <FormError id="email-error" role="alert">
352
+ {error}
353
+ </FormError>
354
+ )}
355
+ </div>
356
+ );
357
+ }
358
+ ```
359
+
360
+ ## Advanced Usage
361
+
362
+ ### Custom Accessibility Attributes
363
+
364
+ When PACE Core components need additional accessibility attributes:
365
+
366
+ ```tsx
367
+ import { Button, DataTable } from '@jmruthers/pace-core';
368
+
369
+ function AdvancedAccessibility() {
370
+ return (
371
+ <>
372
+ {/* Custom ARIA attributes */}
373
+ <Button
374
+ aria-label="Save changes"
375
+ aria-describedby="save-status"
376
+ aria-busy={isSaving}
377
+ >
378
+ Save
379
+ </Button>
380
+ <span id="save-status" className="sr-only">
381
+ {isSaving ? 'Saving' : 'Save'}
382
+ </span>
383
+
384
+ {/* DataTable with custom accessibility */}
385
+ <DataTable
386
+ data={data}
387
+ columns={columns}
388
+ aria-label="User management table"
389
+ aria-describedby="table-description"
390
+ />
391
+ <p id="table-description" className="sr-only">
392
+ Interactive table for managing users with sorting and filtering
393
+ </p>
394
+ </>
395
+ );
396
+ }
397
+ ```
398
+
399
+ ### Screen Reader Only Content
400
+
401
+ Use the `.sr-only` class for content that should only be visible to screen readers:
402
+
403
+ ```tsx
404
+ function ScreenReaderExample() {
405
+ return (
406
+ <Button aria-label="Download file">
407
+ <Icon name="download" aria-hidden="true" />
408
+ Download
409
+ <span className="sr-only">PDF document</span>
410
+ </Button>
411
+ );
412
+ }
413
+ ```
414
+
415
+ ### Live Regions for Dynamic Content
416
+
417
+ Use live regions for dynamic content updates:
418
+
419
+ ```tsx
420
+ import { useUnifiedAuth } from '@jmruthers/pace-core';
421
+
422
+ function LiveRegionExample() {
423
+ const { user } = useUnifiedAuth();
424
+
425
+ return (
426
+ <div role="region" aria-live="polite" aria-label="User status">
427
+ {user && (
428
+ <p>
429
+ Logged in as {user.email}
430
+ </p>
431
+ )}
432
+ </div>
433
+ );
434
+ }
435
+ ```
436
+
437
+ ## Testing Accessibility
438
+
439
+ ### Manual Testing Checklist
440
+
441
+ - [ ] **Keyboard Navigation**: All interactive elements accessible via keyboard
442
+ - [ ] **Focus Indicators**: Visible focus indicators on all interactive elements
443
+ - [ ] **Screen Reader**: Test with screen reader (NVDA, JAWS, VoiceOver)
444
+ - [ ] **Color Contrast**: Meet WCAG AA contrast ratios (4.5:1 for text, 3:1 for UI)
445
+ - [ ] **ARIA Labels**: All icons and images have appropriate labels
446
+ - [ ] **Semantic HTML**: Using proper HTML elements
447
+ - [ ] **Error Messages**: Properly associated with form fields
448
+
449
+ ### Automated Testing Tools
450
+
451
+ **Recommended tools**:
452
+ - **axe DevTools**: Browser extension for accessibility testing
453
+ - **WAVE**: Web accessibility evaluation tool
454
+ - **Lighthouse**: Accessibility auditing
455
+ - **Pa11y**: Command-line accessibility testing
456
+
457
+ **Example setup**:
458
+ ```bash
459
+ # Install Pa11y
460
+ npm install -g pa11y
461
+
462
+ # Run accessibility tests
463
+ pa11y http://localhost:3000
464
+ ```
465
+
466
+ ### Color Contrast
467
+
468
+ Ensure text meets contrast requirements:
469
+
470
+ ```tsx
471
+ // ✅ Good contrast
472
+ <p className="text-sec-800 bg-sec-50">
473
+ High contrast text
474
+ </p>
475
+
476
+ // ❌ Poor contrast
477
+ <p className="text-sec-300 bg-sec-400">
478
+ Low contrast text (hard to read)
479
+ </p>
480
+ ```
481
+
482
+ ## Common Issues and Solutions
483
+
484
+ ### Issue 1: Missing Focus Indicators
485
+
486
+ **Problem**: Interactive elements don't show visible focus state
487
+
488
+ **Solution**: Use PACE Core components which include focus styles, or add custom focus styles
489
+
490
+ ```css
491
+ /* Custom focus styles */
492
+ button:focus-visible {
493
+ outline: 2px solid var(--color-main-600);
494
+ outline-offset: 2px;
495
+ }
496
+ ```
497
+
498
+ ### Issue 2: Missing Alt Text
499
+
500
+ **Problem**: Images without alt text
501
+
502
+ **Solution**: Always provide meaningful alt text
503
+
504
+ ```tsx
505
+ // ✅ Good
506
+ <img src="user-avatar.jpg" alt="User profile picture" />
507
+
508
+ // ❌ Bad
509
+ <img src="user-avatar.jpg" />
510
+ ```
511
+
512
+ ### Issue 3: Form Labels Not Associated
513
+
514
+ **Problem**: Input fields without associated labels
515
+
516
+ **Solution**: Use proper label associations
517
+
518
+ ```tsx
519
+ // ✅ Good
520
+ <Label htmlFor="email">Email</Label>
521
+ <Input id="email" type="email" />
522
+
523
+ // ❌ Bad
524
+ <div>Email</div>
525
+ <Input type="email" />
526
+ ```
527
+
528
+ ## WCAG Compliance
529
+
530
+ ### Level AA Compliance
531
+
532
+ PACE Core components are designed to meet WCAG 2.1 Level AA standards:
533
+
534
+ - ✅ **Perceivable**: All information must be perceivable to users
535
+ - ✅ **Operable**: Interface components must be operable
536
+ - ✅ **Understandable**: Information and UI operation must be understandable
537
+ - ✅ **Robust**: Content must be robust enough to work with assistive technologies
538
+
539
+ ### Compliance Checklist
540
+
541
+ - [ ] **Color Contrast**: All text meets 4.5:1 contrast ratio
542
+ - [ ] **Keyboard Access**: All functionality available via keyboard
543
+ - [ ] **Focus Indicators**: Visible focus on all interactive elements
544
+ - [ ] **ARIA Labels**: Proper labels for all icons and images
545
+ - [ ] **Semantic HTML**: Using appropriate HTML elements
546
+ - [ ] **Error Messages**: Properly announced to screen readers
547
+ - [ ] **Live Regions**: Dynamic content properly announced
548
+
549
+ ## Related Documentation
550
+
551
+ - [Component API Reference](../api-reference/components.md)
552
+ - [Form Implementation Guide](../implementation-guides/forms.md)
553
+ - [DataTable Guide](../implementation-guides/data-tables.md)
554
+ - [Security Best Practices](./security.md)
555
+ - [Testing Best Practices](./testing.md)
556
+
557
+ ## Additional Resources
558
+
559
+ - [WCAG 2.1 Guidelines](https://www.w3.org/WAI/WCAG21/quickref/)
560
+ - [ARIA Authoring Practices](https://www.w3.org/WAI/ARIA/apg/)
561
+ - [WebAIM Resources](https://webaim.org/)
562
+ - [MDN Accessibility Guide](https://developer.mozilla.org/en-US/docs/Web/Accessibility)
563
+
564
+ ---
565
+
566
+ **Next Steps**: Review your application's accessibility, implement missing ARIA attributes, and test with screen readers.