@jmruthers/pace-core 0.6.5 → 0.6.7

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 (473) hide show
  1. package/CHANGELOG.md +104 -0
  2. package/README.md +5 -403
  3. package/audit-tool/00-dependencies.cjs +394 -0
  4. package/audit-tool/audits/01-pace-core-compliance.cjs +556 -0
  5. package/audit-tool/audits/02-project-structure.cjs +255 -0
  6. package/audit-tool/audits/03-architecture.cjs +196 -0
  7. package/audit-tool/audits/04-code-quality.cjs +149 -0
  8. package/audit-tool/audits/05-styling.cjs +224 -0
  9. package/audit-tool/audits/06-security-rbac.cjs +544 -0
  10. package/audit-tool/audits/07-api-tech-stack.cjs +301 -0
  11. package/audit-tool/audits/08-testing-documentation.cjs +202 -0
  12. package/audit-tool/audits/09-operations.cjs +208 -0
  13. package/audit-tool/index.cjs +291 -0
  14. package/audit-tool/utils/code-utils.cjs +218 -0
  15. package/audit-tool/utils/file-utils.cjs +230 -0
  16. package/audit-tool/utils/report-utils.cjs +241 -0
  17. package/core-usage-manifest.json +93 -0
  18. package/cursor-rules/00-standards-overview.mdc +156 -0
  19. package/cursor-rules/01-pace-core-compliance.mdc +586 -0
  20. package/cursor-rules/02-project-structure.mdc +42 -4
  21. package/cursor-rules/{03-solid-principles.mdc → 03-architecture.mdc} +126 -10
  22. package/cursor-rules/04-code-quality.mdc +419 -0
  23. package/cursor-rules/{08-markup-quality.mdc → 05-styling.mdc} +104 -34
  24. package/cursor-rules/06-security-rbac.mdc +518 -0
  25. package/cursor-rules/07-api-tech-stack.mdc +377 -0
  26. package/cursor-rules/08-testing-documentation.mdc +324 -0
  27. package/cursor-rules/09-operations.mdc +365 -0
  28. package/dist/{AuthService-Cb34EQs3.d.ts → AuthService-DmfO5rGS.d.ts} +10 -0
  29. package/dist/DataTable-7PMH7XN7.js +15 -0
  30. package/dist/{DataTable-BMRU8a1j.d.ts → DataTable-DRUIgtUH.d.ts} +1 -1
  31. package/dist/{PublicPageProvider-QTFVrL-Z.d.ts → PublicPageProvider-DlsCaR5v.d.ts} +33 -72
  32. package/dist/UnifiedAuthProvider-ZT6TIGM7.js +7 -0
  33. package/dist/api-Y4MQWOFW.js +4 -0
  34. package/dist/audit-MYQXYZFU.js +3 -0
  35. package/dist/{chunk-DGUM43GV.js → chunk-3RG5ZIWI.js} +1 -4
  36. package/dist/{chunk-QXHPKYJV.js → chunk-4SXLQIZO.js} +1 -26
  37. package/dist/{chunk-UPPMRMYG.js → chunk-5X4QLXRG.js} +73 -151
  38. package/dist/chunk-6F3IILHI.js +62 -0
  39. package/dist/{chunk-E66EQZE6.js → chunk-6GLLNA6U.js} +3 -9
  40. package/dist/{chunk-ZSAAAMVR.js → chunk-6QYDGKQY.js} +1 -4
  41. package/dist/{chunk-FMUCXFII.js → chunk-7ILTDCL2.js} +9 -5
  42. package/dist/{chunk-M43Y4SSO.js → chunk-A3W6LW53.js} +15 -13
  43. package/dist/{chunk-63FOKYGO.js → chunk-AHU7G2R5.js} +2 -11
  44. package/dist/{chunk-HU2C6SSC.js → chunk-BM4CQ5P3.js} +606 -559
  45. package/dist/chunk-C7NSAPTL.js +1 -0
  46. package/dist/{chunk-J36DSWQK.js → chunk-FEJLJNWA.js} +7 -41
  47. package/dist/{chunk-IHB5DR3H.js → chunk-FTCRZOG2.js} +188 -387
  48. package/dist/{chunk-G37KK66H.js → chunk-FYHN4DD5.js} +60 -19
  49. package/dist/chunk-GHYHJTYV.js +994 -0
  50. package/dist/{chunk-VBXEHIUJ.js → chunk-HF6O3O37.js} +6 -88
  51. package/dist/{chunk-FFQEQTNW.js → chunk-IUBRCBSY.js} +134 -45
  52. package/dist/{chunk-6COVEUS7.js → chunk-JGWDVX64.js} +983 -1034
  53. package/dist/{chunk-RGAWHO7N.js → chunk-L4XMVJKY.js} +77 -222
  54. package/dist/chunk-MBADTM7L.js +64 -0
  55. package/dist/{chunk-M7MPQISP.js → chunk-OJ4SKRSV.js} +3 -16
  56. package/dist/{chunk-IVOFDYWT.js → chunk-Q7Q7V5NV.js} +2109 -1604
  57. package/dist/{chunk-JGRYX5UX.js → chunk-S7DKJPLT.js} +29 -58
  58. package/dist/{chunk-PWLANIRT.js → chunk-TTRFSOKR.js} +1 -7
  59. package/dist/{chunk-5DRSZLL2.js → chunk-UH3NTO3F.js} +1 -6
  60. package/dist/{chunk-NTM7ZSB6.js → chunk-VBCS3DUA.js} +261 -168
  61. package/dist/{chunk-EFN2EIMK.js → chunk-ZFYPMX46.js} +271 -87
  62. package/dist/{chunk-L4OXEN46.js → chunk-ZKAWKYT4.js} +10 -24
  63. package/dist/components.d.ts +7 -5
  64. package/dist/components.js +46 -257
  65. package/dist/{database.generated-CzIvgcPu.d.ts → database.generated-CcnC_DRc.d.ts} +4795 -3691
  66. package/dist/eslint-rules/index.cjs +35 -0
  67. package/{src/eslint-rules/pace-core-compliance.cjs → dist/eslint-rules/rules/01-pace-core-compliance.cjs} +234 -235
  68. package/dist/eslint-rules/rules/04-code-quality.cjs +290 -0
  69. package/dist/eslint-rules/rules/05-styling.cjs +61 -0
  70. package/dist/eslint-rules/rules/06-security-rbac.cjs +806 -0
  71. package/dist/eslint-rules/rules/07-api-tech-stack.cjs +263 -0
  72. package/dist/eslint-rules/rules/08-testing.cjs +94 -0
  73. package/dist/eslint-rules/utils/helpers.cjs +42 -0
  74. package/dist/eslint-rules/utils/manifest-loader.cjs +75 -0
  75. package/dist/hooks.d.ts +6 -6
  76. package/dist/hooks.js +62 -172
  77. package/dist/icons/index.d.ts +1 -0
  78. package/dist/icons/index.js +1 -0
  79. package/dist/index.d.ts +12 -11
  80. package/dist/index.js +67 -660
  81. package/dist/providers.d.ts +2 -2
  82. package/dist/providers.js +8 -35
  83. package/dist/rbac/eslint-rules.d.ts +46 -44
  84. package/dist/rbac/eslint-rules.js +7 -4
  85. package/dist/rbac/index.d.ts +109 -586
  86. package/dist/rbac/index.js +14 -207
  87. package/dist/styles/index.js +2 -12
  88. package/dist/theming/runtime.d.ts +14 -1
  89. package/dist/theming/runtime.js +3 -19
  90. package/dist/{timezone-CHhWg6b4.d.ts → timezone-BZe_eUxx.d.ts} +175 -1
  91. package/dist/{types-CkbwOr4Y.d.ts → types-DXstZpNI.d.ts} +4 -17
  92. package/dist/types-t9H8qKRw.d.ts +55 -0
  93. package/dist/types.d.ts +1 -1
  94. package/dist/types.js +7 -94
  95. package/dist/{usePublicRouteParams-ClnV4tnv.d.ts → usePublicRouteParams-MamNgwqe.d.ts} +20 -20
  96. package/dist/utils.d.ts +24 -117
  97. package/dist/utils.js +54 -392
  98. package/docs/README.md +17 -7
  99. package/docs/api/README.md +4 -402
  100. package/docs/api/modules.md +301 -871
  101. package/docs/api-reference/components.md +21 -21
  102. package/docs/api-reference/deprecated.md +31 -6
  103. package/docs/api-reference/hooks.md +80 -80
  104. package/docs/api-reference/rpc-functions.md +78 -3
  105. package/docs/api-reference/types.md +1 -1
  106. package/docs/api-reference/utilities.md +1 -1
  107. package/docs/architecture/README.md +1 -1
  108. package/docs/core-concepts/events.md +3 -3
  109. package/docs/core-concepts/organisations.md +6 -6
  110. package/docs/core-concepts/permissions.md +6 -6
  111. package/docs/documentation-index.md +12 -18
  112. package/docs/getting-started/cursor-rules.md +3 -23
  113. package/docs/getting-started/dependencies.md +650 -0
  114. package/docs/getting-started/documentation-index.md +1 -1
  115. package/docs/getting-started/examples/README.md +4 -4
  116. package/docs/getting-started/examples/full-featured-app.md +1 -1
  117. package/docs/getting-started/faq.md +2 -2
  118. package/docs/getting-started/installation-guide.md +20 -7
  119. package/docs/getting-started/quick-reference.md +4 -4
  120. package/docs/getting-started/quick-start.md +23 -12
  121. package/docs/implementation-guides/authentication.md +15 -15
  122. package/docs/implementation-guides/component-styling.md +1 -1
  123. package/docs/implementation-guides/data-tables.md +126 -33
  124. package/docs/implementation-guides/datatable-rbac-usage.md +1 -1
  125. package/docs/implementation-guides/dynamic-colors.md +3 -3
  126. package/docs/implementation-guides/file-upload-storage.md +2 -2
  127. package/docs/implementation-guides/hierarchical-datatable.md +40 -60
  128. package/docs/implementation-guides/inactivity-tracking.md +3 -3
  129. package/docs/implementation-guides/large-datasets.md +3 -2
  130. package/docs/implementation-guides/organisation-security.md +2 -2
  131. package/docs/implementation-guides/performance.md +2 -2
  132. package/docs/implementation-guides/permission-enforcement.md +5 -1
  133. package/docs/migration/V0.3.44_organisation-context-timing-fix.md +1 -1
  134. package/docs/migration/V0.4.0_rbac-migration.md +6 -6
  135. package/docs/rbac/MIGRATION_GUIDE.md +819 -0
  136. package/docs/rbac/RBAC_CONTRACT.md +724 -0
  137. package/docs/rbac/README.md +17 -8
  138. package/docs/rbac/advanced-patterns.md +6 -6
  139. package/docs/rbac/api-reference.md +20 -20
  140. package/docs/rbac/edge-functions-guide.md +376 -0
  141. package/docs/rbac/event-based-apps.md +3 -3
  142. package/docs/rbac/examples.md +41 -41
  143. package/docs/rbac/getting-started.md +37 -37
  144. package/docs/rbac/performance.md +1 -1
  145. package/docs/rbac/quick-start.md +52 -52
  146. package/docs/rbac/secure-client-protection.md +1 -35
  147. package/docs/rbac/troubleshooting.md +1 -1
  148. package/docs/security/README.md +5 -5
  149. package/docs/standards/0-standards-overview.md +220 -0
  150. package/docs/standards/1-pace-core-compliance-standards.md +986 -0
  151. package/docs/standards/2-project-structure-standards.md +949 -0
  152. package/docs/standards/3-architecture-standards.md +606 -0
  153. package/docs/standards/4-code-quality-standards.md +728 -0
  154. package/docs/standards/5-styling-standards.md +348 -0
  155. package/docs/standards/{07-rbac-and-rls-standard.md → 6-security-rbac-standards.md} +269 -66
  156. package/docs/standards/7-api-tech-stack-standards.md +662 -0
  157. package/docs/standards/8-testing-documentation-standards.md +401 -0
  158. package/docs/standards/9-operations-standards.md +1102 -0
  159. package/docs/standards/README.md +185 -57
  160. package/docs/troubleshooting/README.md +4 -4
  161. package/docs/troubleshooting/common-issues.md +2 -2
  162. package/docs/troubleshooting/debugging.md +9 -9
  163. package/docs/troubleshooting/migration.md +4 -4
  164. package/docs/troubleshooting/organisation-context-setup.md +42 -19
  165. package/eslint-config-pace-core.cjs +33 -6
  166. package/package.json +35 -23
  167. package/scripts/install-cursor-rules.cjs +25 -6
  168. package/scripts/install-eslint-config.cjs +284 -0
  169. package/src/__tests__/fixtures/supabase.ts +1 -1
  170. package/src/__tests__/helpers/__tests__/component-test-utils.test.tsx +3 -3
  171. package/src/__tests__/helpers/__tests__/optimized-test-setup.test.ts +1 -1
  172. package/src/__tests__/helpers/__tests__/supabaseMock.test.ts +1 -1
  173. package/src/__tests__/helpers/__tests__/test-providers.test.tsx +2 -2
  174. package/src/__tests__/helpers/__tests__/test-utils.test.tsx +13 -13
  175. package/src/__tests__/helpers/component-test-utils.tsx +1 -1
  176. package/src/__tests__/helpers/supabaseMock.ts +2 -2
  177. package/src/__tests__/integration/UserProfile.test.tsx +14 -14
  178. package/src/__tests__/public-recipe-view.test.ts +38 -9
  179. package/src/__tests__/rbac/PagePermissionGuard.test.tsx +6 -6
  180. package/src/__tests__/templates/accessibility.test.template.tsx +9 -9
  181. package/src/__tests__/templates/component.test.template.tsx +18 -15
  182. package/src/components/Button/Button.tsx +5 -1
  183. package/src/components/Calendar/Calendar.tsx +201 -47
  184. package/src/components/ContextSelector/ContextSelector.tsx +106 -119
  185. package/src/components/DataTable/AUDIT_REPORT.md +293 -0
  186. package/src/components/DataTable/__tests__/DataTableCore.test.tsx +10 -2
  187. package/src/components/DataTable/__tests__/a11y.basic.test.tsx +10 -4
  188. package/src/components/DataTable/__tests__/test-utils/sharedTestUtils.tsx +9 -9
  189. package/src/components/DataTable/components/ColumnFilter.tsx +63 -74
  190. package/src/components/DataTable/components/ColumnVisibilityDropdown.tsx +43 -41
  191. package/src/components/DataTable/components/DataTableCore.tsx +186 -13
  192. package/src/components/DataTable/components/DataTableErrorBoundary.tsx +9 -11
  193. package/src/components/DataTable/components/DataTableLayout.tsx +35 -21
  194. package/src/components/DataTable/components/EditFields.tsx +23 -3
  195. package/src/components/DataTable/components/EditableRow.tsx +12 -9
  196. package/src/components/DataTable/components/EmptyState.tsx +10 -9
  197. package/src/components/DataTable/components/FilterRow.tsx +2 -4
  198. package/src/components/DataTable/components/ImportModal.tsx +124 -126
  199. package/src/components/DataTable/components/LoadingState.tsx +5 -6
  200. package/src/components/DataTable/components/RowComponent.tsx +12 -0
  201. package/src/components/DataTable/components/SortIndicator.tsx +50 -0
  202. package/src/components/DataTable/components/__tests__/COVERAGE_NOTE.md +4 -4
  203. package/src/components/DataTable/components/__tests__/ColumnFilter.test.tsx +23 -82
  204. package/src/components/DataTable/components/__tests__/DataTableErrorBoundary.test.tsx +37 -9
  205. package/src/components/DataTable/components/__tests__/EmptyState.test.tsx +7 -4
  206. package/src/components/DataTable/components/__tests__/FilterRow.test.tsx +12 -4
  207. package/src/components/DataTable/components/__tests__/LoadingState.test.tsx +41 -27
  208. package/src/components/DataTable/components/hooks/usePermissionTracking.ts +0 -4
  209. package/src/components/DataTable/components/index.ts +2 -1
  210. package/src/components/DataTable/hooks/__tests__/useDataTableState.test.ts +51 -47
  211. package/src/components/DataTable/hooks/useDataTablePermissions.ts +24 -21
  212. package/src/components/DataTable/hooks/useDataTableState.ts +125 -9
  213. package/src/components/DataTable/hooks/useTableColumns.ts +40 -2
  214. package/src/components/DataTable/hooks/useTableHandlers.ts +11 -0
  215. package/src/components/DataTable/types.ts +5 -18
  216. package/src/components/DataTable/utils/a11yUtils.ts +17 -0
  217. package/src/components/DatePickerWithTimezone/DatePickerWithTimezone.test.tsx +2 -1
  218. package/src/components/DatePickerWithTimezone/DatePickerWithTimezone.tsx +11 -15
  219. package/src/components/DateTimeField/DateTimeField.tsx +10 -9
  220. package/src/components/Dialog/Dialog.test.tsx +128 -104
  221. package/src/components/Dialog/Dialog.tsx +742 -24
  222. package/src/components/ErrorBoundary/ErrorBoundary.tsx +77 -79
  223. package/src/components/FileDisplay/FileDisplay.test.tsx +4 -2
  224. package/src/components/FileDisplay/FileDisplay.tsx +23 -17
  225. package/src/components/FileUpload/FileUpload.test.tsx +52 -14
  226. package/src/components/FileUpload/FileUpload.tsx +112 -130
  227. package/src/components/Form/Form.test.tsx +6 -8
  228. package/src/components/Form/Form.tsx +365 -4
  229. package/src/components/NavigationMenu/NavigationMenu.test.tsx +14 -13
  230. package/src/components/NavigationMenu/useNavigationFiltering.ts +11 -21
  231. package/src/components/PaceAppLayout/PaceAppLayout.test.tsx +6 -4
  232. package/src/components/PaceAppLayout/PaceAppLayout.tsx +11 -15
  233. package/src/components/PaceLoginPage/PaceLoginPage.test.tsx +108 -61
  234. package/src/components/PaceLoginPage/PaceLoginPage.tsx +27 -3
  235. package/src/components/Progress/Progress.tsx +2 -4
  236. package/src/components/ProtectedRoute/ProtectedRoute.tsx +8 -8
  237. package/src/components/Select/Select.tsx +109 -98
  238. package/src/components/Select/types.ts +4 -1
  239. package/src/components/UserMenu/UserMenu.tsx +9 -6
  240. package/src/hooks/__tests__/ServiceHooks.test.tsx +16 -16
  241. package/src/hooks/__tests__/hooks.integration.test.tsx +55 -57
  242. package/src/hooks/__tests__/useAppConfig.unit.test.ts +129 -67
  243. package/src/hooks/__tests__/useFocusTrap.unit.test.tsx +97 -97
  244. package/src/hooks/__tests__/usePublicEvent.simple.test.ts +149 -67
  245. package/src/hooks/__tests__/usePublicEvent.test.ts +149 -79
  246. package/src/hooks/__tests__/usePublicEvent.unit.test.ts +158 -109
  247. package/src/hooks/__tests__/useSessionDraft.test.ts +163 -0
  248. package/src/hooks/__tests__/useSessionRestoration.unit.test.tsx +10 -5
  249. package/src/hooks/public/usePublicEvent.ts +67 -195
  250. package/src/hooks/public/usePublicEventLogo.test.ts +70 -17
  251. package/src/hooks/public/usePublicEventLogo.ts +24 -14
  252. package/src/hooks/public/usePublicFileDisplay.ts +2 -2
  253. package/src/hooks/public/usePublicRouteParams.ts +5 -5
  254. package/src/hooks/useAppConfig.ts +28 -26
  255. package/src/hooks/useEventTheme.test.ts +217 -239
  256. package/src/hooks/useEventTheme.ts +16 -28
  257. package/src/hooks/useFileDisplay.ts +2 -2
  258. package/src/hooks/useOrganisationPermissions.ts +5 -7
  259. package/src/hooks/useQueryCache.ts +0 -1
  260. package/src/hooks/useSessionDraft.ts +380 -0
  261. package/src/hooks/useSessionRestoration.ts +3 -1
  262. package/src/icons/index.ts +27 -0
  263. package/src/index.ts +5 -0
  264. package/src/providers/OrganisationProvider.tsx +23 -14
  265. package/src/providers/UnifiedAuthProvider.smoke.test.tsx +21 -21
  266. package/src/providers/__tests__/AuthProvider.test.tsx +21 -21
  267. package/src/providers/__tests__/EventProvider.test.tsx +61 -61
  268. package/src/providers/__tests__/InactivityProvider.test.tsx +56 -56
  269. package/src/providers/__tests__/OrganisationProvider.test.tsx +75 -75
  270. package/src/providers/__tests__/ProviderLifecycle.test.tsx +37 -37
  271. package/src/providers/__tests__/UnifiedAuthProvider.test.tsx +103 -103
  272. package/src/providers/services/EventServiceProvider.tsx +1 -24
  273. package/src/providers/services/UnifiedAuthProvider.tsx +5 -48
  274. package/src/providers/services/__tests__/AuthServiceProvider.integration.test.tsx +7 -7
  275. package/src/providers/services/__tests__/UnifiedAuthProvider.integration.test.tsx +13 -10
  276. package/src/rbac/__tests__/adapters.comprehensive.test.tsx +7 -457
  277. package/src/rbac/__tests__/auth-rbac.e2e.test.tsx +33 -7
  278. package/src/rbac/adapters.tsx +7 -295
  279. package/src/rbac/api.test.ts +44 -56
  280. package/src/rbac/api.ts +10 -17
  281. package/src/rbac/cache-invalidation.ts +0 -1
  282. package/src/rbac/compliance/index.ts +10 -0
  283. package/src/rbac/compliance/pattern-detector.ts +553 -0
  284. package/src/rbac/compliance/runtime-compliance.ts +22 -0
  285. package/src/rbac/components/AccessDenied.tsx +150 -0
  286. package/src/rbac/components/NavigationGuard.tsx +12 -20
  287. package/src/rbac/components/PagePermissionGuard.tsx +4 -24
  288. package/src/rbac/components/__tests__/NavigationGuard.test.tsx +21 -8
  289. package/src/rbac/components/index.ts +3 -41
  290. package/src/rbac/eslint-rules.js +1 -1
  291. package/src/rbac/hooks/index.ts +0 -3
  292. package/src/rbac/hooks/permissions/index.ts +0 -3
  293. package/src/rbac/hooks/permissions/useAccessLevel.ts +4 -8
  294. package/src/rbac/hooks/usePermissions.ts +0 -3
  295. package/src/rbac/hooks/useResolvedScope.test.ts +57 -47
  296. package/src/rbac/hooks/useResolvedScope.ts +58 -140
  297. package/src/rbac/hooks/useResourcePermissions.test.ts +124 -38
  298. package/src/rbac/hooks/useResourcePermissions.ts +139 -48
  299. package/src/rbac/hooks/useRoleManagement.test.ts +65 -22
  300. package/src/rbac/hooks/useRoleManagement.ts +147 -19
  301. package/src/rbac/hooks/useSecureSupabase.ts +4 -8
  302. package/src/rbac/index.ts +7 -9
  303. package/src/rbac/utils/contextValidator.ts +9 -7
  304. package/src/services/AuthService.ts +130 -18
  305. package/src/services/EventService.ts +4 -97
  306. package/src/services/InactivityService.ts +16 -0
  307. package/src/services/OrganisationService.ts +7 -44
  308. package/src/services/__tests__/OrganisationService.test.ts +26 -8
  309. package/src/services/base/BaseService.ts +0 -3
  310. package/src/styles/core.css +7 -0
  311. package/src/theming/__tests__/parseEventColours.test.ts +9 -3
  312. package/src/theming/parseEventColours.ts +22 -10
  313. package/src/types/database.generated.ts +4733 -3809
  314. package/src/utils/__tests__/lazyLoad.unit.test.tsx +42 -39
  315. package/src/utils/__tests__/organisationContext.unit.test.ts +9 -10
  316. package/src/utils/context/organisationContext.test.ts +13 -28
  317. package/src/utils/context/organisationContext.ts +21 -52
  318. package/src/utils/dynamic/dynamicUtils.ts +1 -1
  319. package/src/utils/file-reference/index.ts +39 -15
  320. package/src/utils/formatting/formatDateTime.test.ts +3 -2
  321. package/src/utils/google-places/loadGoogleMapsScript.ts +29 -4
  322. package/src/utils/index.ts +4 -1
  323. package/src/utils/persistence/__tests__/keyDerivation.test.ts +135 -0
  324. package/src/utils/persistence/__tests__/sensitiveFieldDetection.test.ts +123 -0
  325. package/src/utils/persistence/keyDerivation.ts +304 -0
  326. package/src/utils/persistence/sensitiveFieldDetection.ts +212 -0
  327. package/src/utils/security/secureStorage.ts +5 -5
  328. package/src/utils/storage/README.md +1 -1
  329. package/src/utils/storage/helpers.ts +3 -3
  330. package/src/utils/supabase/createBaseClient.ts +147 -0
  331. package/src/utils/timezone/timezone.test.ts +1 -2
  332. package/src/utils/timezone/timezone.ts +1 -1
  333. package/src/utils/validation/csrf.ts +4 -4
  334. package/cursor-rules/00-pace-core-compliance.mdc +0 -331
  335. package/cursor-rules/01-standards-compliance.mdc +0 -244
  336. package/cursor-rules/04-testing-standards.mdc +0 -268
  337. package/cursor-rules/05-bug-reports-and-features.mdc +0 -246
  338. package/cursor-rules/06-code-quality.mdc +0 -309
  339. package/cursor-rules/07-tech-stack-compliance.mdc +0 -214
  340. package/cursor-rules/CHANGELOG.md +0 -119
  341. package/cursor-rules/README.md +0 -192
  342. package/dist/DataTable-AOVNCPTX.js +0 -175
  343. package/dist/DataTable-AOVNCPTX.js.map +0 -1
  344. package/dist/UnifiedAuthProvider-4SBX4LU5.js +0 -18
  345. package/dist/UnifiedAuthProvider-4SBX4LU5.js.map +0 -1
  346. package/dist/api-O6HTBX5Y.js +0 -52
  347. package/dist/api-O6HTBX5Y.js.map +0 -1
  348. package/dist/audit-V53FV5AG.js +0 -17
  349. package/dist/audit-V53FV5AG.js.map +0 -1
  350. package/dist/chunk-5DRSZLL2.js.map +0 -1
  351. package/dist/chunk-63FOKYGO.js.map +0 -1
  352. package/dist/chunk-6COVEUS7.js.map +0 -1
  353. package/dist/chunk-AFVQODI2.js +0 -263
  354. package/dist/chunk-AFVQODI2.js.map +0 -1
  355. package/dist/chunk-DGUM43GV.js.map +0 -1
  356. package/dist/chunk-E66EQZE6.js.map +0 -1
  357. package/dist/chunk-EFN2EIMK.js.map +0 -1
  358. package/dist/chunk-FFQEQTNW.js.map +0 -1
  359. package/dist/chunk-FMUCXFII.js.map +0 -1
  360. package/dist/chunk-G37KK66H.js.map +0 -1
  361. package/dist/chunk-G7QEZTYQ.js +0 -2053
  362. package/dist/chunk-G7QEZTYQ.js.map +0 -1
  363. package/dist/chunk-HU2C6SSC.js.map +0 -1
  364. package/dist/chunk-IHB5DR3H.js.map +0 -1
  365. package/dist/chunk-IVOFDYWT.js.map +0 -1
  366. package/dist/chunk-J36DSWQK.js.map +0 -1
  367. package/dist/chunk-JGRYX5UX.js.map +0 -1
  368. package/dist/chunk-KQCRWDSA.js +0 -1
  369. package/dist/chunk-KQCRWDSA.js.map +0 -1
  370. package/dist/chunk-L4OXEN46.js.map +0 -1
  371. package/dist/chunk-LMC26NLJ.js +0 -84
  372. package/dist/chunk-LMC26NLJ.js.map +0 -1
  373. package/dist/chunk-M43Y4SSO.js.map +0 -1
  374. package/dist/chunk-M7MPQISP.js.map +0 -1
  375. package/dist/chunk-NTM7ZSB6.js.map +0 -1
  376. package/dist/chunk-PWLANIRT.js.map +0 -1
  377. package/dist/chunk-QXHPKYJV.js.map +0 -1
  378. package/dist/chunk-RGAWHO7N.js.map +0 -1
  379. package/dist/chunk-UPPMRMYG.js.map +0 -1
  380. package/dist/chunk-VBXEHIUJ.js.map +0 -1
  381. package/dist/chunk-ZSAAAMVR.js.map +0 -1
  382. package/dist/components.js.map +0 -1
  383. package/dist/contextValidator-5OGXSPKS.js +0 -9
  384. package/dist/contextValidator-5OGXSPKS.js.map +0 -1
  385. package/dist/eslint-rules/pace-core-compliance.cjs +0 -510
  386. package/dist/hooks.js.map +0 -1
  387. package/dist/index.js.map +0 -1
  388. package/dist/providers.js.map +0 -1
  389. package/dist/rbac/eslint-rules.js.map +0 -1
  390. package/dist/rbac/index.js.map +0 -1
  391. package/dist/styles/index.js.map +0 -1
  392. package/dist/theming/runtime.js.map +0 -1
  393. package/dist/types.js.map +0 -1
  394. package/dist/utils.js.map +0 -1
  395. package/docs/best-practices/README.md +0 -472
  396. package/docs/best-practices/accessibility.md +0 -601
  397. package/docs/best-practices/common-patterns.md +0 -516
  398. package/docs/best-practices/deployment.md +0 -1103
  399. package/docs/best-practices/performance.md +0 -1328
  400. package/docs/best-practices/security.md +0 -940
  401. package/docs/best-practices/testing.md +0 -1034
  402. package/docs/rbac/compliance/compliance-guide.md +0 -544
  403. package/docs/standards/01-architecture-standard.md +0 -44
  404. package/docs/standards/02-api-and-rpc-standard.md +0 -39
  405. package/docs/standards/03-component-standard.md +0 -32
  406. package/docs/standards/04-code-style-standard.md +0 -32
  407. package/docs/standards/05-security-standard.md +0 -44
  408. package/docs/standards/06-testing-and-docs-standard.md +0 -29
  409. package/docs/standards/pace-core-compliance.md +0 -432
  410. package/scripts/audit/core/checks/accessibility.cjs +0 -197
  411. package/scripts/audit/core/checks/api-usage.cjs +0 -191
  412. package/scripts/audit/core/checks/bundle.cjs +0 -142
  413. package/scripts/audit/core/checks/compliance.cjs +0 -2706
  414. package/scripts/audit/core/checks/config.cjs +0 -54
  415. package/scripts/audit/core/checks/coverage.cjs +0 -84
  416. package/scripts/audit/core/checks/dependencies.cjs +0 -994
  417. package/scripts/audit/core/checks/documentation.cjs +0 -268
  418. package/scripts/audit/core/checks/environment.cjs +0 -116
  419. package/scripts/audit/core/checks/error-handling.cjs +0 -340
  420. package/scripts/audit/core/checks/forms.cjs +0 -172
  421. package/scripts/audit/core/checks/heuristics.cjs +0 -68
  422. package/scripts/audit/core/checks/hooks.cjs +0 -334
  423. package/scripts/audit/core/checks/imports.cjs +0 -244
  424. package/scripts/audit/core/checks/performance.cjs +0 -325
  425. package/scripts/audit/core/checks/routes.cjs +0 -117
  426. package/scripts/audit/core/checks/state.cjs +0 -130
  427. package/scripts/audit/core/checks/structure.cjs +0 -65
  428. package/scripts/audit/core/checks/style.cjs +0 -584
  429. package/scripts/audit/core/checks/testing.cjs +0 -122
  430. package/scripts/audit/core/checks/typescript.cjs +0 -61
  431. package/scripts/audit/core/scanner.cjs +0 -199
  432. package/scripts/audit/core/utils.cjs +0 -137
  433. package/scripts/audit/index.cjs +0 -223
  434. package/scripts/audit/reporters/console.cjs +0 -151
  435. package/scripts/audit/reporters/json.cjs +0 -54
  436. package/scripts/audit/reporters/markdown.cjs +0 -124
  437. package/scripts/audit-consuming-app.cjs +0 -86
  438. package/src/components/DataTable/components/DataTableBody.tsx +0 -454
  439. package/src/components/DataTable/components/DraggableColumnHeader.tsx +0 -156
  440. package/src/components/DataTable/components/ExpandButton.tsx +0 -113
  441. package/src/components/DataTable/components/GroupHeader.tsx +0 -54
  442. package/src/components/DataTable/components/ViewRowModal.tsx +0 -68
  443. package/src/components/DataTable/components/VirtualizedDataTable.tsx +0 -525
  444. package/src/components/DataTable/components/__tests__/ExpandButton.test.tsx +0 -462
  445. package/src/components/DataTable/components/__tests__/GroupHeader.test.tsx +0 -393
  446. package/src/components/DataTable/components/__tests__/ViewRowModal.test.tsx +0 -476
  447. package/src/components/DataTable/components/__tests__/VirtualizedDataTable.test.tsx +0 -128
  448. package/src/components/DataTable/core/DataTableContext.tsx +0 -216
  449. package/src/components/DataTable/core/__tests__/DataTableContext.test.tsx +0 -136
  450. package/src/components/DataTable/hooks/__tests__/useColumnReordering.test.ts +0 -570
  451. package/src/components/DataTable/hooks/useColumnReordering.ts +0 -123
  452. package/src/components/DataTable/utils/debugTools.ts +0 -514
  453. package/src/eslint-rules/pace-core-compliance.js +0 -638
  454. package/src/rbac/components/EnhancedNavigationMenu.test.tsx +0 -555
  455. package/src/rbac/components/EnhancedNavigationMenu.tsx +0 -293
  456. package/src/rbac/components/NavigationProvider.test.tsx +0 -481
  457. package/src/rbac/components/NavigationProvider.tsx +0 -345
  458. package/src/rbac/components/PagePermissionProvider.test.tsx +0 -476
  459. package/src/rbac/components/PagePermissionProvider.tsx +0 -279
  460. package/src/rbac/components/PermissionEnforcer.tsx +0 -312
  461. package/src/rbac/components/RoleBasedRouter.tsx +0 -440
  462. package/src/rbac/components/SecureDataProvider.test.tsx +0 -543
  463. package/src/rbac/components/SecureDataProvider.tsx +0 -339
  464. package/src/rbac/components/__tests__/EnhancedNavigationMenu.test.tsx +0 -620
  465. package/src/rbac/components/__tests__/NavigationProvider.test.tsx +0 -726
  466. package/src/rbac/components/__tests__/PagePermissionProvider.test.tsx +0 -661
  467. package/src/rbac/components/__tests__/PermissionEnforcer.test.tsx +0 -881
  468. package/src/rbac/components/__tests__/RoleBasedRouter.test.tsx +0 -783
  469. package/src/rbac/components/__tests__/SecureDataProvider.fixed.test.tsx +0 -645
  470. package/src/rbac/components/__tests__/SecureDataProvider.test.tsx +0 -659
  471. package/src/rbac/hooks/permissions/useCachedPermissions.ts +0 -79
  472. package/src/rbac/hooks/permissions/useHasAllPermissions.ts +0 -90
  473. package/src/rbac/hooks/permissions/useHasAnyPermission.ts +0 -90
@@ -0,0 +1,365 @@
1
+ ---
2
+ description: Enforce error handling patterns, performance optimization, and CI/CD integration patterns
3
+ globs: ["src/**/*.{ts,tsx,js,jsx}", "supabase/migrations/**/*.sql", ".github/workflows/**/*.{yml,yaml}", "package.json"]
4
+ alwaysApply: false
5
+ paceCoreVersion: "0.6.x"
6
+ rulesVersion: "2025-01-28"
7
+ ---
8
+ # Operations Standards Guide
9
+
10
+ **📚 Human-Readable Standard**: See [9-operations-standards.md](../../packages/core/docs/standards/9-operations-standards.md) for complete documentation.
11
+
12
+ This guide enforces error handling patterns, performance optimization strategies, and CI/CD integration patterns.
13
+
14
+ ## AI Agent Instructions
15
+
16
+ **When writing or modifying code, ALWAYS:**
17
+ 1. **Use type-safe errors** - Never use `any` for errors, always use type guards or Result types
18
+ 2. **Never expose internals** - User-facing errors must be friendly, never show SQL, stack traces, or file paths
19
+ 3. **Log with context** - Always log errors with context, but never log sensitive data (passwords, tokens, PII)
20
+ 4. **Memoize expensive operations** - Use `useMemo` for expensive computations, `useCallback` for stable references
21
+ 5. **Avoid new objects in render** - Never create new objects/arrays in render, memoize them with `useMemo`
22
+ 6. **Use helper functions in RLS** - Always use STABLE SECURITY DEFINER helper functions, never subqueries
23
+ 7. **Provide recovery paths** - When possible, provide retry logic or fallback values
24
+
25
+ **Decision Tree: Error Handling**
26
+ ```
27
+ 1. What type of error is this?
28
+ ├─ API Error → Use ApiResult shape, user-friendly message
29
+ ├─ Validation Error → Use Zod errors, field-specific messages
30
+ ├─ Network Error → Retry logic, connection message
31
+ └─ Unknown Error → Generic user message, detailed log
32
+
33
+ 2. Should user see this error?
34
+ ├─ YES → User-friendly message (no internals)
35
+ └─ NO → Log only, show generic message
36
+
37
+ 3. Can we recover?
38
+ ├─ YES → Retry logic or fallback value
39
+ └─ NO → Show error, allow user to retry
40
+ ```
41
+
42
+ **Decision Tree: Performance**
43
+ ```
44
+ 1. Is this expensive computation?
45
+ ├─ YES → Use useMemo
46
+ └─ NO → Don't memoize (overhead not worth it)
47
+
48
+ 2. Is this function passed as prop?
49
+ ├─ YES → Use useCallback
50
+ └─ NO → Regular function is fine
51
+
52
+ 3. Is this creating new object/array in render?
53
+ ├─ YES → Memoize with useMemo
54
+ └─ NO → Continue
55
+ ```
56
+
57
+ ## Error Handling Patterns
58
+
59
+ ### MUST: Use Type-Safe Error Handling
60
+
61
+ **MUST use type guards or Result types, NEVER use `any`:**
62
+
63
+ ```tsx
64
+ // ❌ WRONG: Using any
65
+ catch (error: any) {
66
+ console.log(error.message);
67
+ }
68
+
69
+ // ✅ CORRECT: Type guard
70
+ function isApiError(error: unknown): error is ApiError {
71
+ return typeof error === 'object' && error !== null && 'ok' in error && (error as ApiError).ok === false;
72
+ }
73
+ catch (error) {
74
+ if (isApiError(error)) {
75
+ handleApiError(error);
76
+ } else {
77
+ handleUnknownError(error);
78
+ }
79
+ }
80
+
81
+ // ✅ CORRECT: Result type
82
+ type Result<T> = { ok: true; data: T } | { ok: false; error: ApiError };
83
+ const result = await fetchData();
84
+ if (result.ok) {
85
+ useData(result.data);
86
+ } else {
87
+ showError(result.error.message);
88
+ }
89
+ ```
90
+
91
+ ### MUST: Never Expose Internal Details
92
+
93
+ **MUST NOT expose SQL, stack traces, file paths, or internal errors to users:**
94
+
95
+ ```tsx
96
+ // ❌ WRONG: Exposing internal details
97
+ toast.error(error.message); // May contain SQL, stack traces
98
+
99
+ // ✅ CORRECT: User-friendly message
100
+ toast.error('Unable to save changes. Please try again.');
101
+ logger.error('Save failed', { error: error.message, context: 'saveUser' });
102
+ ```
103
+
104
+ ### MUST: Use Consistent Error Shapes
105
+
106
+ **MUST use ApiResult shape for API errors:**
107
+
108
+ ```tsx
109
+ // ✅ CORRECT: Consistent error shape
110
+ type ApiError = {
111
+ ok: false;
112
+ error: {
113
+ code: string;
114
+ message: string; // User-friendly
115
+ details?: object; // Non-sensitive context
116
+ };
117
+ };
118
+ ```
119
+
120
+ ### MUST: Log Errors with Context
121
+
122
+ **MUST log errors with context, but NEVER log sensitive data:**
123
+
124
+ ```tsx
125
+ // ✅ CORRECT: Log with context, no sensitive data
126
+ logger.error('Failed to save user', {
127
+ userId: user.id,
128
+ operation: 'updateUser',
129
+ errorCode: error.code,
130
+ });
131
+
132
+ // ❌ WRONG: Logging sensitive data
133
+ logger.error('Failed to save user', {
134
+ password: user.password, // NEVER
135
+ token: authToken, // NEVER
136
+ });
137
+ ```
138
+
139
+ ### SHOULD: Provide Recovery Paths
140
+
141
+ **SHOULD provide retry logic or fallback values when appropriate:**
142
+
143
+ ```tsx
144
+ // ✅ CORRECT: Retry with exponential backoff
145
+ async function fetchWithRetry<T>(fn: () => Promise<Result<T>>, maxRetries = 3): Promise<Result<T>> {
146
+ for (let attempt = 0; attempt < maxRetries; attempt++) {
147
+ const result = await fn();
148
+ if (result.ok) return result;
149
+ if (result.error.code?.startsWith('4')) return result; // Don't retry 4xx
150
+ await new Promise(resolve => setTimeout(resolve, Math.pow(2, attempt) * 1000));
151
+ }
152
+ return { ok: false, error: { code: 'MAX_RETRIES', message: 'Operation failed after retries' } };
153
+ }
154
+ ```
155
+
156
+ ## Performance Optimization Patterns
157
+
158
+ ### MUST: Optimize React Re-renders
159
+
160
+ **MUST use memoization for expensive computations and stable references:**
161
+
162
+ ```tsx
163
+ // ✅ CORRECT - Memoize expensive computation
164
+ const expensiveValue = useMemo(() => computeExpensiveValue(data), [data]);
165
+
166
+ // ✅ CORRECT - Stable callback reference
167
+ const handleClick = useCallback(() => doSomething(id), [id]);
168
+
169
+ // ✅ CORRECT - Memoize component
170
+ const ExpensiveComponent = React.memo(({ data }) => <div>{/* ... */}</div>);
171
+ ```
172
+
173
+ ### MUST: Avoid Creating New Objects in Render
174
+
175
+ **MUST NOT create new objects/arrays in render:**
176
+
177
+ ```tsx
178
+ // ❌ WRONG - New object on every render
179
+ function Component({ items }) {
180
+ const config = { items, enabled: true };
181
+ return <Child config={config} />;
182
+ }
183
+
184
+ // ✅ CORRECT - Memoize object
185
+ function Component({ items }) {
186
+ const config = useMemo(() => ({ items, enabled: true }), [items]);
187
+ return <Child config={config} />;
188
+ }
189
+ ```
190
+
191
+ ### MUST: Use Helper Functions in RLS Policies
192
+
193
+ **MUST use STABLE SECURITY DEFINER helper functions (never subqueries):**
194
+
195
+ ```sql
196
+ -- ✅ CORRECT - Helper function (evaluated once)
197
+ CREATE POLICY "rbac_select_users" ON users FOR SELECT USING (
198
+ check_user_organisation_access(organisation_id)
199
+ );
200
+
201
+ -- ❌ WRONG - Subquery (N+1 performance issue)
202
+ CREATE POLICY "rbac_select_users" ON users FOR SELECT USING (
203
+ organisation_id IN (SELECT organisation_id FROM organisation_memberships WHERE user_id = auth.uid())
204
+ );
205
+ ```
206
+
207
+ ### SHOULD: Lazy Load Heavy Components
208
+
209
+ **SHOULD lazy load heavy components:**
210
+
211
+ ```tsx
212
+ // ✅ CORRECT - Lazy load
213
+ import { lazy, Suspense } from 'react';
214
+ const HeavyComponent = lazy(() => import('./HeavyComponent'));
215
+ <Suspense fallback={<Loading />}><HeavyComponent /></Suspense>
216
+ ```
217
+
218
+ ### SHOULD: Configure TanStack Query Cache
219
+
220
+ **SHOULD configure appropriate cache times:**
221
+
222
+ ```tsx
223
+ // ✅ CORRECT - Configure cache
224
+ const queryClient = new QueryClient({
225
+ defaultOptions: {
226
+ queries: {
227
+ staleTime: 5 * 60 * 1000,
228
+ cacheTime: 10 * 60 * 1000,
229
+ retry: 1,
230
+ refetchOnWindowFocus: false,
231
+ },
232
+ },
233
+ });
234
+ ```
235
+
236
+ ## CI/CD Integration Patterns
237
+
238
+ ### MUST: Include Required CI Checks
239
+
240
+ **MUST run these checks in every CI pipeline:**
241
+
242
+ ```yaml
243
+ # ✅ CORRECT - Required checks
244
+ jobs:
245
+ quality-checks:
246
+ steps:
247
+ - name: Lint
248
+ run: npm run lint
249
+ - name: Type check
250
+ run: npx tsc --noEmit
251
+ - name: Run tests
252
+ run: npm run test
253
+ - name: Build
254
+ run: npm run build
255
+ ```
256
+
257
+ ### MUST: Have Required Scripts
258
+
259
+ **MUST have these scripts in package.json:**
260
+
261
+ ```json
262
+ // ✅ CORRECT - Required scripts
263
+ {
264
+ "scripts": {
265
+ "lint": "eslint .",
266
+ "type-check": "tsc --noEmit",
267
+ "test": "vitest run",
268
+ "build": "vite build"
269
+ }
270
+ }
271
+ ```
272
+
273
+ ### MUST: Use Secrets for Sensitive Data
274
+
275
+ **MUST NOT commit secrets to repository:**
276
+
277
+ ```yaml
278
+ # ✅ CORRECT - Use secrets
279
+ env:
280
+ SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
281
+ VITE_SUPABASE_ANON_KEY: ${{ secrets.VITE_SUPABASE_ANON_KEY }}
282
+
283
+ # ❌ WRONG - Hardcoded secrets
284
+ env:
285
+ SUPABASE_URL: "https://hardcoded-url.supabase.co"
286
+ ```
287
+
288
+ ### SHOULD: Deploy to Staging First
289
+
290
+ **SHOULD deploy to staging before production:**
291
+
292
+ ```yaml
293
+ # ✅ CORRECT - Staging first
294
+ deploy-staging:
295
+ if: github.ref == 'refs/heads/develop'
296
+ environment: staging
297
+
298
+ deploy-production:
299
+ needs: deploy-staging
300
+ if: github.ref == 'refs/heads/main'
301
+ environment: production
302
+ ```
303
+
304
+ ## Common Mistakes to Avoid
305
+
306
+ **When writing code, NEVER:**
307
+ 1. **Use `any` for errors** - Always use type guards or Result types
308
+ ```tsx
309
+ // ❌ WRONG
310
+ catch (error: any) {
311
+ toast.error(error.message);
312
+ }
313
+
314
+ // ✅ CORRECT
315
+ catch (error: unknown) {
316
+ if (isApiError(error)) {
317
+ toast.error(error.error.message);
318
+ } else {
319
+ toast.error('An unexpected error occurred');
320
+ }
321
+ }
322
+ ```
323
+
324
+ 2. **Expose internal details in errors** - Always use user-friendly messages
325
+ 3. **Create new objects in render** - Always memoize with useMemo
326
+ 4. **Skip memoization for expensive operations** - Always use useMemo/useCallback
327
+ 5. **Use subqueries in RLS policies** - Always use STABLE SECURITY DEFINER helper functions
328
+ 6. **Log sensitive data** - Never log passwords, tokens, or PII
329
+
330
+ ## Operations Checklist
331
+
332
+ Before committing, verify:
333
+
334
+ **Error Handling:**
335
+ - [ ] Type-safe error handling (no `any`)
336
+ - [ ] User-friendly error messages (no internals)
337
+ - [ ] Errors logged with context (no sensitive data)
338
+ - [ ] Recovery paths provided when possible
339
+ - [ ] Consistent error shapes used
340
+
341
+ **Performance:**
342
+ - [ ] Expensive computations memoized
343
+ - [ ] Callbacks stable with useCallback
344
+ - [ ] Components memoized when appropriate
345
+ - [ ] No new objects/arrays in render
346
+ - [ ] Heavy components lazy loaded
347
+ - [ ] RLS policies use helper functions
348
+ - [ ] TanStack Query configured properly
349
+
350
+ **CI/CD:**
351
+ - [ ] Lint check configured
352
+ - [ ] Type check configured
353
+ - [ ] Tests run in CI
354
+ - [ ] Build succeeds in CI
355
+ - [ ] Environment variables set as secrets
356
+ - [ ] Staging deployment configured
357
+ - [ ] Production deployment configured
358
+
359
+ ## Reference
360
+
361
+ **Note**: CI/CD configuration validation and performance metric thresholds are handled by CI/audit tool. See [9-operations-standards.md](../../packages/core/docs/standards/9-operations-standards.md) for complete enforcement details.
362
+
363
+ - Error Handling: [9-operations-standards.md](../../packages/core/docs/standards/9-operations-standards.md#error-handling-patterns)
364
+ - Performance: [9-operations-standards.md](../../packages/core/docs/standards/9-operations-standards.md#performance-optimization)
365
+ - CI/CD: [9-operations-standards.md](../../packages/core/docs/standards/9-operations-standards.md#cicd-integration)
@@ -477,6 +477,7 @@ declare class AuthService extends BaseService implements IAuthService {
477
477
  private appName;
478
478
  private errorHandler;
479
479
  private unhandledRejectionHandler;
480
+ private wasAuthenticatedRef;
480
481
  constructor(supabaseClient: SupabaseClient, appName?: string);
481
482
  getInstanceId(): number;
482
483
  getUser(): User | null;
@@ -499,6 +500,15 @@ declare class AuthService extends BaseService implements IAuthService {
499
500
  private startSessionRestoration;
500
501
  private finishSessionRestoration;
501
502
  private clearRestorationTimeout;
503
+ /**
504
+ * Clear pace-core persistence entries from sessionStorage
505
+ * This includes dialog, form, and datatable persistence
506
+ *
507
+ * @param userId - Optional user ID to clear only that user's persistence.
508
+ * If not provided, clears all pace-core persistence (for user changes).
509
+ * @param clearUnscoped - If true, also clears old unscoped keys (without :user: prefix)
510
+ */
511
+ private clearPersistenceOnLogin;
502
512
  private setupAuthStateListener;
503
513
  private restoreSession;
504
514
  /**
@@ -0,0 +1,15 @@
1
+ export { ActionButtons, BulkOperationsDropdown, ColumnFactory, ColumnVisibilityDropdown, DataTable, DataTableCore, DataTableErrorBoundary, DataTableModals, DataTableToolbar, EditableRow, EmptyState, EnhancedPaginationControls, GroupingDropdown, ImportModal, LoadingState, PaginationControls, SortIndicator, UnifiedTableBody, announce, announceBulkOperation, announceFilterChange, announceLoadingState, announcePaginationChange, announceSearchResults, announceSelectionChange, announceSortChange, average, calculateAllDepths, calculateAllIndentation, calculateIndentation, calculateOptimalPageSize, cleanupLiveRegion, count, createHierarchicalStructure, defaultDataTableFeatures, exportToCSV, exportToCSVWithTableRows, generateCSVContent, getAriaSortState, getAriaSortValue, getCellRenderer, getColumnHeaderText, getHierarchicalSortConfig, getPageSizeOptions, getPaginationBinding, getRowDepth, getRowDescription, getRowIdSafe, getSortButtonLabel, groupHierarchicalData, hasValidRowId, initializeLiveRegion, isHierarchicalSortableColumn, max, min, normalizeDataTableFeatures, shouldShowColumnForRow, sortHierarchicalDataByStructure, sortHierarchicalDataWithSorting, sum, validateHierarchicalData, validatePaginationConfig } from './chunk-Q7Q7V5NV.js';
2
+ import './chunk-BM4CQ5P3.js';
3
+ export { CircuitBreaker, DEFAULT_FALLBACK_CONFIG, DataChunkManager, DataTableError, DataTableErrorType, ErrorRecoveryManager, MemoryMonitor, SearchIndex, VisibilityTracker, chunkData, debounce, determinePaginationMode, getOptimalPageSizeOptions, safeExecute, throttle, useDataTablePerformance } from './chunk-S7DKJPLT.js';
4
+ import './chunk-VBCS3DUA.js';
5
+ import './chunk-C7NSAPTL.js';
6
+ import './chunk-FTCRZOG2.js';
7
+ import './chunk-ZFYPMX46.js';
8
+ import './chunk-AHU7G2R5.js';
9
+ import './chunk-4SXLQIZO.js';
10
+ import './chunk-A3W6LW53.js';
11
+ import './chunk-OJ4SKRSV.js';
12
+ import './chunk-7ILTDCL2.js';
13
+ import './chunk-HF6O3O37.js';
14
+ import './chunk-TTRFSOKR.js';
15
+ import './chunk-3RG5ZIWI.js';
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { d as DataRecord, D as DataTableColumn, e as DataTableRBACConfig, f as DataTableFeatureConfig, H as HierarchicalConfig, g as PerformanceConfig, S as ServerSideConfig, h as PaginationMode, C as ChunkingConfig, i as SearchIndexConfig, j as ExportOptions, G as GetRowId, E as EmptyStateConfig, c as AggregateConfig, a as DataTableAction } from './types-CkbwOr4Y.js';
2
+ import { d as DataRecord, D as DataTableColumn, e as DataTableRBACConfig, f as DataTableFeatureConfig, H as HierarchicalConfig, g as PerformanceConfig, S as ServerSideConfig, h as PaginationMode, C as ChunkingConfig, i as SearchIndexConfig, j as ExportOptions, G as GetRowId, E as EmptyStateConfig, c as AggregateConfig, a as DataTableAction } from './types-DXstZpNI.js';
3
3
  import React__default from 'react';
4
4
 
5
5
  /**
@@ -1,7 +1,7 @@
1
1
  import * as React$1 from 'react';
2
2
  import React__default, { ReactNode, Component } from 'react';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
- import { P as ParsedAddress, A as AutocompleteOptions } from './types-CkbwOr4Y.js';
4
+ import { P as ParsedAddress, A as AutocompleteOptions } from './types-DXstZpNI.js';
5
5
  import * as LabelPrimitive from '@radix-ui/react-label';
6
6
  import { F as FileCategory, e as FileUploadResult, U as UploadProgress, c as FileUploadOptions, a as FileReference } from './file-reference-BavO2eQj.js';
7
7
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
@@ -12,8 +12,8 @@ import * as ToastPrimitives from '@radix-ui/react-toast';
12
12
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
13
13
  import { FieldValues, DefaultValues, SubmitHandler, SubmitErrorHandler, UseFormReturn, FieldPath, ControllerRenderProps, ControllerFieldState, UseFormStateReturn } from 'react-hook-form';
14
14
  import { z } from 'zod';
15
+ import { N as NavigationMenuProps, a as NavigationItem } from './types-t9H8qKRw.js';
15
16
  import { User, SupabaseClient, createClient } from '@supabase/supabase-js';
16
- import { P as Permission, A as AccessLevel } from './types-BeoeWV5I.js';
17
17
  import { O as Organisation, E as Event } from './event-CW5YB_2p.js';
18
18
 
19
19
  /**
@@ -912,10 +912,12 @@ interface DialogContentProps extends React$1.HTMLAttributes<HTMLDialogElement> {
912
912
  minHeight?: string;
913
913
  /** Minimum width in CSS units */
914
914
  minWidth?: string;
915
- /** Dialog title for accessibility (sets native title attribute) */
915
+ /** Dialog title - sets native title attribute and aria-labelledby */
916
916
  title?: string;
917
- /** Dialog description for accessibility (sets aria-description attribute) */
917
+ /** Dialog description - sets native aria-description attribute */
918
918
  description?: string;
919
+ /** Whether to persist open state across tab switches */
920
+ persistOpenState?: boolean;
919
921
  }
920
922
  /**
921
923
  * Props for the DialogPortal component
@@ -924,12 +926,6 @@ interface DialogContentProps extends React$1.HTMLAttributes<HTMLDialogElement> {
924
926
  interface DialogPortalProps {
925
927
  children: React$1.ReactNode;
926
928
  }
927
- /**
928
- * Props for the DialogClose component
929
- * @public
930
- */
931
- interface DialogCloseProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
932
- }
933
929
  /**
934
930
  * Props for the DialogHeader component (semantic header element)
935
931
  * @public
@@ -1006,6 +1002,20 @@ declare const DialogPortal: React$1.FC<DialogPortalProps>;
1006
1002
  * @returns JSX.Element - The semantic dialog content with overlay and optional close button
1007
1003
  */
1008
1004
  declare const DialogContent: React$1.ForwardRefExoticComponent<DialogContentProps & React$1.RefAttributes<HTMLDialogElement>>;
1005
+ /**
1006
+ * Props for the DialogClose component
1007
+ * @public
1008
+ */
1009
+ interface DialogCloseProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
1010
+ }
1011
+ /**
1012
+ * Props for the DialogClose component
1013
+ * @public
1014
+ */
1015
+ interface DialogCloseProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
1016
+ /** Whether to merge props with child element instead of rendering a button */
1017
+ asChild?: boolean;
1018
+ }
1009
1019
  /**
1010
1020
  * DialogClose component
1011
1021
  * Button to close the dialog
@@ -1067,10 +1077,11 @@ interface UseSelectStateProps {
1067
1077
  /**
1068
1078
  * Props for the Select root component.
1069
1079
  */
1070
- interface SelectProps extends Omit<React$1.HTMLAttributes<HTMLFormElement>, "onChange" | "onKeyDown" | "onFocus" | "onBlur"> {
1080
+ interface SelectProps extends Omit<React$1.HTMLAttributes<HTMLFieldSetElement>, "onChange" | "onKeyDown" | "onFocus" | "onBlur"> {
1071
1081
  children: React$1.ReactNode;
1072
1082
  className?: string;
1073
1083
  direction?: SelectDirection;
1084
+ showCheckmark?: boolean;
1074
1085
  }
1075
1086
  /**
1076
1087
  * Props for the SelectTrigger component.
@@ -1106,6 +1117,7 @@ interface SelectItemProps {
1106
1117
  disabled?: boolean;
1107
1118
  className?: string;
1108
1119
  onClick?: (e: React$1.MouseEvent) => void;
1120
+ showCheckmark?: boolean;
1109
1121
  }
1110
1122
 
1111
1123
  /**
@@ -1127,10 +1139,10 @@ interface SelectItemProps {
1127
1139
  * Provides select dropdown functionality with search, keyboard navigation, and accessibility.
1128
1140
  *
1129
1141
  * @param props - Select configuration
1130
- * @param ref - Forwarded ref to the form element
1142
+ * @param ref - Forwarded ref to the fieldset element
1131
1143
  * @returns The rendered select component
1132
1144
  */
1133
- declare const Select: React$1.ForwardRefExoticComponent<SelectProps & UseSelectStateProps & React$1.RefAttributes<HTMLFormElement>>;
1145
+ declare const Select: React$1.ForwardRefExoticComponent<SelectProps & UseSelectStateProps & React$1.RefAttributes<HTMLFieldSetElement>>;
1134
1146
  /**
1135
1147
  * Select trigger button component.
1136
1148
  * Opens/closes the select dropdown and displays the selected value.
@@ -1169,39 +1181,39 @@ declare const SelectContent: React$1.ForwardRefExoticComponent<SelectContentProp
1169
1181
  declare const SelectItem: React$1.ForwardRefExoticComponent<SelectItemProps & React$1.RefAttributes<HTMLLIElement>>;
1170
1182
  /**
1171
1183
  * Select group component.
1172
- * Groups related select items together.
1184
+ * Groups related select items together using a nested list structure.
1173
1185
  *
1174
1186
  * @param props - Select group configuration
1175
- * @param ref - Forwarded ref to the div element
1187
+ * @param ref - Forwarded ref to the ul element
1176
1188
  * @returns The rendered select group
1177
1189
  */
1178
1190
  declare const SelectGroup: React$1.ForwardRefExoticComponent<{
1179
1191
  children: React$1.ReactNode;
1180
1192
  className?: string;
1181
- } & React$1.RefAttributes<HTMLDivElement>>;
1193
+ } & React$1.RefAttributes<HTMLUListElement>>;
1182
1194
  /**
1183
1195
  * Select label component.
1184
1196
  * Provides a label for a group of select items.
1185
1197
  *
1186
1198
  * @param props - Select label configuration
1187
- * @param ref - Forwarded ref to the div element
1199
+ * @param ref - Forwarded ref to the li element
1188
1200
  * @returns The rendered select label
1189
1201
  */
1190
1202
  declare const SelectLabel: React$1.ForwardRefExoticComponent<{
1191
1203
  children: React$1.ReactNode;
1192
1204
  className?: string;
1193
- } & React$1.RefAttributes<HTMLDivElement>>;
1205
+ } & React$1.RefAttributes<HTMLLIElement>>;
1194
1206
  /**
1195
1207
  * Select separator component.
1196
1208
  * Provides visual separation between groups of select items.
1197
1209
  *
1198
1210
  * @param props - Select separator configuration
1199
- * @param ref - Forwarded ref to the div element
1211
+ * @param ref - Forwarded ref to the hr element
1200
1212
  * @returns The rendered select separator
1201
1213
  */
1202
1214
  declare const SelectSeparator: React$1.ForwardRefExoticComponent<{
1203
1215
  className?: string;
1204
- } & React$1.RefAttributes<HTMLDivElement>>;
1216
+ } & React$1.RefAttributes<HTMLHRElement>>;
1205
1217
 
1206
1218
  /**
1207
1219
  * @file Tabs Component System
@@ -2041,57 +2053,6 @@ interface LoginFormProps {
2041
2053
  */
2042
2054
  declare const LoginForm: React__default.NamedExoticComponent<LoginFormProps>;
2043
2055
 
2044
- /**
2045
- * Navigation mode type
2046
- */
2047
- type NavigationMode = "dropdown" | "hierarchical";
2048
- /**
2049
- * Navigation item metadata
2050
- */
2051
- interface NavigationItemMeta {
2052
- hidden?: boolean;
2053
- [key: string]: unknown;
2054
- }
2055
- /**
2056
- * Navigation item interface
2057
- */
2058
- interface NavigationItem {
2059
- id: string;
2060
- label: string;
2061
- href?: string;
2062
- icon?: string;
2063
- children?: NavigationItem[];
2064
- permissions?: (Permission | string)[];
2065
- roles?: string[];
2066
- accessLevel?: AccessLevel | string;
2067
- meta?: NavigationItemMeta;
2068
- pageId?: string;
2069
- }
2070
- /**
2071
- * Navigation menu component props
2072
- */
2073
- interface NavigationMenuProps extends React$1.HTMLAttributes<HTMLDivElement> {
2074
- items: NavigationItem[];
2075
- mode?: NavigationMode;
2076
- currentPath?: string;
2077
- onNavigate?: (item: NavigationItem) => void;
2078
- className?: string;
2079
- disabled?: boolean;
2080
- buttonText?: string;
2081
- showIcons?: boolean;
2082
- navigationLabel?: string;
2083
- strictMode?: boolean;
2084
- auditLog?: boolean;
2085
- onNavigationAccessDenied?: (item: NavigationItem) => void;
2086
- onStrictModeViolation?: (item: NavigationItem, reason: string) => void;
2087
- /**
2088
- * If true, indicates that items have already been filtered by the parent component (e.g., PaceAppLayout).
2089
- * When true, NavigationMenu will skip expensive permission checks and trust the provided items.
2090
- * This significantly improves performance when items are pre-filtered.
2091
- */
2092
- itemsPreFiltered?: boolean;
2093
- }
2094
-
2095
2056
  /**
2096
2057
  * @file Unified Navigation Menu Component
2097
2058
  * @package @jmruthers/pace-core
@@ -4177,4 +4138,4 @@ declare function usePublicPageContext(): PublicPageContextType;
4177
4138
  */
4178
4139
  declare function useIsPublicPage(): boolean;
4179
4140
 
4180
- export { type DialogContentProps as $, AddressField as A, Button as B, Card as C, TableHeader as D, TableBody as E, TableCaption as F, TableCell as G, TableFooter as H, Input as I, TableHead as J, TableRow as K, Label as L, Dialog as M, DialogPortal as N, DialogTrigger as O, Progress as P, DialogClose as Q, DialogContent as R, Switch as S, Textarea as T, DialogHeader as U, DialogBody as V, DialogFooter as W, DialogTitle as X, DialogDescription as Y, type DialogProps as Z, type DialogTriggerProps as _, type ButtonProps as a, SessionRestorationLoader as a$, type DialogPortalProps as a0, type DialogCloseProps as a1, type DialogHeaderProps as a2, type DialogFooterProps as a3, type DialogBodyProps as a4, type DialogSize as a5, Select as a6, SelectGroup as a7, SelectValue as a8, SelectTrigger as a9, TooltipContent as aA, TooltipProvider as aB, TooltipRoot as aC, Form as aD, FormField as aE, type FormProps as aF, type FormFieldProps as aG, LoginForm as aH, type LoginFormProps as aI, Header as aJ, Footer as aK, type FooterProps as aL, ProtectedRoute as aM, type ProtectedRouteProps as aN, NavigationMenu as aO, type NavigationMenuProps as aP, type NavigationItem as aQ, ContextSelector as aR, type ContextSelectorProps as aS, UserMenu as aT, ErrorBoundary as aU, ErrorBoundaryProvider as aV, type ErrorBoundaryProps as aW, type ErrorBoundaryState as aX, type ErrorBoundaryProviderProps as aY, type GlobalErrorHandler as aZ, LoadingSpinner as a_, SelectContent as aa, SelectLabel as ab, SelectItem as ac, SelectSeparator as ad, Tabs as ae, TabsList as af, TabsTrigger as ag, TabsContent as ah, type TabsProps as ai, type TabsListProps as aj, type TabsTriggerProps as ak, type TabsContentProps as al, Calendar as am, type CalendarProps as an, Toast as ao, Toaster as ap, ToastAction as aq, ToastProvider as ar, ToastViewport as as, ToastTitle as at, ToastDescription as au, ToastClose as av, type ToastActionElement as aw, type ToastProps as ax, Tooltip as ay, TooltipTrigger as az, CardHeader as b, type SessionRestorationLoaderProps as b0, FileUpload as b1, type FileUploadProps as b2, FileDisplay as b3, type FileDisplayProps as b4, useFileReference as b5, useFileReferenceForRecord as b6, useFileReferenceById as b7, useFilesByCategory as b8, type UseFileReferenceOptions as b9, type UseFileReferenceReturn as ba, type UseFileReferenceForRecordReturn as bb, PublicPageLayout as bc, PublicPageHeader as bd, PublicPageFooter as be, PublicPageProvider as bf, usePublicPageContext as bg, useIsPublicPage as bh, type PublicPageLayoutProps as bi, type PublicPageHeaderProps as bj, type PublicPageFooterProps as bk, type PaceAppLayoutProps as bl, PaceAppLayout as bm, type PaceLoginPageProps as bn, PaceLoginPage as bo, type NavigationMode as bp, type UserMenuProps as bq, PasswordChangeForm as br, CardFooter as c, CardTitle as d, CardDescription as e, CardContent as f, CardActions as g, type CardProps as h, type CardActionsProps as i, type InputProps as j, type AddressFieldProps as k, type AddressFieldRef as l, type LabelProps as m, type TextareaProps as n, Alert as o, AlertTitle as p, AlertDescription as q, Avatar as r, type AvatarProps as s, Badge as t, type BadgeProps as u, type BadgeVariant as v, Checkbox as w, type SwitchProps as x, type ProgressProps as y, Table as z };
4141
+ export { type DialogContentProps as $, AddressField as A, Button as B, Card as C, TableHeader as D, TableBody as E, TableCaption as F, TableCell as G, TableFooter as H, Input as I, TableHead as J, TableRow as K, Label as L, Dialog as M, DialogPortal as N, DialogTrigger as O, Progress as P, DialogClose as Q, DialogContent as R, Switch as S, Textarea as T, DialogHeader as U, DialogBody as V, DialogFooter as W, DialogTitle as X, DialogDescription as Y, type DialogProps as Z, type DialogTriggerProps as _, type ButtonProps as a, FileUpload as a$, type DialogPortalProps as a0, type DialogCloseProps as a1, type DialogHeaderProps as a2, type DialogFooterProps as a3, type DialogBodyProps as a4, type DialogSize as a5, Select as a6, SelectGroup as a7, SelectValue as a8, SelectTrigger as a9, TooltipContent as aA, TooltipProvider as aB, TooltipRoot as aC, Form as aD, FormField as aE, type FormProps as aF, type FormFieldProps as aG, LoginForm as aH, type LoginFormProps as aI, Header as aJ, Footer as aK, type FooterProps as aL, ProtectedRoute as aM, type ProtectedRouteProps as aN, NavigationMenu as aO, ContextSelector as aP, type ContextSelectorProps as aQ, UserMenu as aR, ErrorBoundary as aS, ErrorBoundaryProvider as aT, type ErrorBoundaryProps as aU, type ErrorBoundaryState as aV, type ErrorBoundaryProviderProps as aW, type GlobalErrorHandler as aX, LoadingSpinner as aY, SessionRestorationLoader as aZ, type SessionRestorationLoaderProps as a_, SelectContent as aa, SelectLabel as ab, SelectItem as ac, SelectSeparator as ad, Tabs as ae, TabsList as af, TabsTrigger as ag, TabsContent as ah, type TabsProps as ai, type TabsListProps as aj, type TabsTriggerProps as ak, type TabsContentProps as al, Calendar as am, type CalendarProps as an, Toast as ao, Toaster as ap, ToastAction as aq, ToastProvider as ar, ToastViewport as as, ToastTitle as at, ToastDescription as au, ToastClose as av, type ToastActionElement as aw, type ToastProps as ax, Tooltip as ay, TooltipTrigger as az, CardHeader as b, type FileUploadProps as b0, FileDisplay as b1, type FileDisplayProps as b2, useFileReference as b3, useFileReferenceForRecord as b4, useFileReferenceById as b5, useFilesByCategory as b6, type UseFileReferenceOptions as b7, type UseFileReferenceReturn as b8, type UseFileReferenceForRecordReturn as b9, PublicPageLayout as ba, PublicPageHeader as bb, PublicPageFooter as bc, PublicPageProvider as bd, usePublicPageContext as be, useIsPublicPage as bf, type PublicPageLayoutProps as bg, type PublicPageHeaderProps as bh, type PublicPageFooterProps as bi, type PaceAppLayoutProps as bj, PaceAppLayout as bk, type PaceLoginPageProps as bl, PaceLoginPage as bm, type UserMenuProps as bn, PasswordChangeForm as bo, CardFooter as c, CardTitle as d, CardDescription as e, CardContent as f, CardActions as g, type CardProps as h, type CardActionsProps as i, type InputProps as j, type AddressFieldProps as k, type AddressFieldRef as l, type LabelProps as m, type TextareaProps as n, Alert as o, AlertTitle as p, AlertDescription as q, Avatar as r, type AvatarProps as s, Badge as t, type BadgeProps as u, type BadgeVariant as v, Checkbox as w, type SwitchProps as x, type ProgressProps as y, Table as z };
@@ -0,0 +1,7 @@
1
+ export { UnifiedAuthContext, UnifiedAuthProvider, useUnifiedAuth } from './chunk-FTCRZOG2.js';
2
+ import './chunk-ZFYPMX46.js';
3
+ import './chunk-AHU7G2R5.js';
4
+ import './chunk-4SXLQIZO.js';
5
+ import './chunk-HF6O3O37.js';
6
+ import './chunk-TTRFSOKR.js';
7
+ import './chunk-3RG5ZIWI.js';
@@ -0,0 +1,4 @@
1
+ export { OrganisationContextRequiredError, clearCache, getAccessLevel, getPageScopeType, getPermissionMap, getRoleContext, hasAllPermissions, hasAnyPermission, invalidateAppCache, invalidateEventCache, invalidateOrganisationCache, invalidateUserCache, isEventAdmin, isOrganisationAdmin, isPermitted, isPermittedCached, isRBACInitialized, isSuperAdmin, resolveAppContext, setupRBAC } from './chunk-ZFYPMX46.js';
2
+ import './chunk-AHU7G2R5.js';
3
+ import './chunk-TTRFSOKR.js';
4
+ import './chunk-3RG5ZIWI.js';
@@ -0,0 +1,3 @@
1
+ export { RBACAuditManager, createAuditManager, emitAuditEvent, getGlobalAuditManager, setGlobalAuditManager } from './chunk-AHU7G2R5.js';
2
+ import './chunk-TTRFSOKR.js';
3
+ import './chunk-3RG5ZIWI.js';
@@ -5,7 +5,4 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
5
5
  throw Error('Dynamic require of "' + x + '" is not supported');
6
6
  });
7
7
 
8
- export {
9
- __require
10
- };
11
- //# sourceMappingURL=chunk-DGUM43GV.js.map
8
+ export { __require };