@jmruthers/pace-core 0.5.191 → 0.6.1

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 (380) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +7 -1
  3. package/cursor-rules/00-pace-core-compliance.mdc +372 -0
  4. package/cursor-rules/01-standards-compliance.mdc +275 -0
  5. package/cursor-rules/02-project-structure.mdc +200 -0
  6. package/cursor-rules/03-solid-principles.mdc +341 -0
  7. package/cursor-rules/04-testing-standards.mdc +315 -0
  8. package/cursor-rules/05-bug-reports-and-features.mdc +246 -0
  9. package/cursor-rules/06-code-quality.mdc +392 -0
  10. package/cursor-rules/07-tech-stack-compliance.mdc +309 -0
  11. package/cursor-rules/CHANGELOG.md +101 -0
  12. package/cursor-rules/README.md +191 -0
  13. package/dist/{AuthService-CbP_utw2.d.ts → AuthService-DjnJHDtC.d.ts} +1 -0
  14. package/dist/{DataTable-Be6dH_dR.d.ts → DataTable-CH1U5Tpy.d.ts} +1 -1
  15. package/dist/{DataTable-WKRZD47S.js → DataTable-DQ7RSOHE.js} +8 -7
  16. package/dist/{PublicPageProvider-ULXC_u6U.d.ts → PublicPageProvider-ce4xlHYA.d.ts} +37 -156
  17. package/dist/{UnifiedAuthProvider-BYA9qB-o.d.ts → UnifiedAuthProvider-185Ih4dj.d.ts} +2 -0
  18. package/dist/{UnifiedAuthProvider-FTSG5XH7.js → UnifiedAuthProvider-ATAP5UTR.js} +3 -3
  19. package/dist/{api-IHKALJZD.js → api-N774RPUA.js} +2 -2
  20. package/dist/{chunk-6C4YBBJM.js → chunk-3QRJFVBR.js} +1 -1
  21. package/dist/chunk-3QRJFVBR.js.map +1 -0
  22. package/dist/{chunk-OETXORNB.js → chunk-3XTALGJF.js} +211 -136
  23. package/dist/chunk-3XTALGJF.js.map +1 -0
  24. package/dist/{chunk-6TQDD426.js → chunk-4N5C5XZU.js} +47 -228
  25. package/dist/chunk-4N5C5XZU.js.map +1 -0
  26. package/dist/{chunk-LOMZXPSN.js → chunk-4ZC4GX36.js} +47 -74
  27. package/dist/chunk-4ZC4GX36.js.map +1 -0
  28. package/dist/{chunk-6LTQQAT6.js → chunk-BYFSK72L.js} +357 -158
  29. package/dist/chunk-BYFSK72L.js.map +1 -0
  30. package/dist/{chunk-XYXSXPUK.js → chunk-EXUD6RNJ.js} +50 -10
  31. package/dist/chunk-EXUD6RNJ.js.map +1 -0
  32. package/dist/{chunk-VKB2CO4Z.js → chunk-GLK6VM3F.js} +244 -249
  33. package/dist/chunk-GLK6VM3F.js.map +1 -0
  34. package/dist/{chunk-HW3OVDUF.js → chunk-J36DSWQK.js} +1 -1
  35. package/dist/{chunk-HW3OVDUF.js.map → chunk-J36DSWQK.js.map} +1 -1
  36. package/dist/{chunk-XNYQOL3Z.js → chunk-JBKQ3SAO.js} +9 -18
  37. package/dist/chunk-JBKQ3SAO.js.map +1 -0
  38. package/dist/{chunk-ROXMHMY2.js → chunk-KNC55RTG.js} +13 -3
  39. package/dist/{chunk-ROXMHMY2.js.map → chunk-KNC55RTG.js.map} +1 -1
  40. package/dist/{chunk-QWWZ5CAQ.js → chunk-LXQLPRQ2.js} +2 -2
  41. package/dist/{chunk-ULHIJK66.js → chunk-T33XF5ZC.js} +255 -140
  42. package/dist/chunk-T33XF5ZC.js.map +1 -0
  43. package/dist/{chunk-VRGWKHDB.js → chunk-XM25TVIE.js} +100 -33
  44. package/dist/chunk-XM25TVIE.js.map +1 -0
  45. package/dist/components.d.ts +4 -4
  46. package/dist/components.js +9 -9
  47. package/dist/hooks.d.ts +6 -6
  48. package/dist/hooks.js +20 -25
  49. package/dist/hooks.js.map +1 -1
  50. package/dist/index.d.ts +11 -11
  51. package/dist/index.js +18 -21
  52. package/dist/index.js.map +1 -1
  53. package/dist/providers.d.ts +3 -3
  54. package/dist/providers.js +2 -2
  55. package/dist/rbac/index.d.ts +2 -20
  56. package/dist/rbac/index.js +7 -9
  57. package/dist/{usePublicRouteParams-TZe0gy-4.d.ts → usePublicRouteParams-BJAlWfuJ.d.ts} +3 -3
  58. package/dist/{useToast-C8gR5ir4.d.ts → useToast-AyaT-x7p.d.ts} +2 -2
  59. package/dist/utils.d.ts +1 -1
  60. package/dist/utils.js +3 -3
  61. package/docs/api/classes/ColumnFactory.md +1 -1
  62. package/docs/api/classes/ErrorBoundary.md +1 -1
  63. package/docs/api/classes/InvalidScopeError.md +1 -1
  64. package/docs/api/classes/Logger.md +1 -1
  65. package/docs/api/classes/MissingUserContextError.md +1 -1
  66. package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
  67. package/docs/api/classes/PermissionDeniedError.md +2 -2
  68. package/docs/api/classes/RBACAuditManager.md +2 -2
  69. package/docs/api/classes/RBACCache.md +1 -1
  70. package/docs/api/classes/RBACEngine.md +2 -2
  71. package/docs/api/classes/RBACError.md +1 -1
  72. package/docs/api/classes/RBACNotInitializedError.md +1 -1
  73. package/docs/api/classes/SecureSupabaseClient.md +10 -10
  74. package/docs/api/classes/StorageUtils.md +1 -1
  75. package/docs/api/enums/FileCategory.md +1 -1
  76. package/docs/api/enums/LogLevel.md +1 -1
  77. package/docs/api/enums/RBACErrorCode.md +1 -1
  78. package/docs/api/enums/RPCFunction.md +1 -1
  79. package/docs/api/interfaces/AddressFieldProps.md +1 -1
  80. package/docs/api/interfaces/AddressFieldRef.md +1 -1
  81. package/docs/api/interfaces/AggregateConfig.md +1 -1
  82. package/docs/api/interfaces/AutocompleteOptions.md +1 -1
  83. package/docs/api/interfaces/AvatarProps.md +1 -1
  84. package/docs/api/interfaces/BadgeProps.md +1 -1
  85. package/docs/api/interfaces/ButtonProps.md +1 -1
  86. package/docs/api/interfaces/CalendarProps.md +1 -1
  87. package/docs/api/interfaces/CardProps.md +1 -1
  88. package/docs/api/interfaces/ColorPalette.md +1 -1
  89. package/docs/api/interfaces/ColorShade.md +1 -1
  90. package/docs/api/interfaces/ComplianceResult.md +1 -1
  91. package/docs/api/interfaces/DataAccessRecord.md +1 -1
  92. package/docs/api/interfaces/DataRecord.md +1 -1
  93. package/docs/api/interfaces/DataTableAction.md +1 -1
  94. package/docs/api/interfaces/DataTableColumn.md +1 -1
  95. package/docs/api/interfaces/DataTableProps.md +1 -1
  96. package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
  97. package/docs/api/interfaces/DatabaseComplianceResult.md +1 -1
  98. package/docs/api/interfaces/DatabaseIssue.md +1 -1
  99. package/docs/api/interfaces/EmptyStateConfig.md +1 -1
  100. package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
  101. package/docs/api/interfaces/EventAppRoleData.md +1 -1
  102. package/docs/api/interfaces/ExportColumn.md +1 -1
  103. package/docs/api/interfaces/ExportOptions.md +1 -1
  104. package/docs/api/interfaces/FileDisplayProps.md +24 -11
  105. package/docs/api/interfaces/FileMetadata.md +1 -1
  106. package/docs/api/interfaces/FileReference.md +1 -1
  107. package/docs/api/interfaces/FileSizeLimits.md +1 -1
  108. package/docs/api/interfaces/FileUploadOptions.md +1 -1
  109. package/docs/api/interfaces/FileUploadProps.md +1 -1
  110. package/docs/api/interfaces/FooterProps.md +1 -1
  111. package/docs/api/interfaces/FormFieldProps.md +1 -1
  112. package/docs/api/interfaces/FormProps.md +1 -1
  113. package/docs/api/interfaces/GrantEventAppRoleParams.md +1 -1
  114. package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
  115. package/docs/api/interfaces/InputProps.md +1 -1
  116. package/docs/api/interfaces/LabelProps.md +1 -1
  117. package/docs/api/interfaces/LoggerConfig.md +1 -1
  118. package/docs/api/interfaces/LoginFormProps.md +1 -1
  119. package/docs/api/interfaces/NavigationAccessRecord.md +2 -2
  120. package/docs/api/interfaces/NavigationContextType.md +1 -1
  121. package/docs/api/interfaces/NavigationGuardProps.md +1 -1
  122. package/docs/api/interfaces/NavigationItem.md +1 -1
  123. package/docs/api/interfaces/NavigationMenuProps.md +1 -1
  124. package/docs/api/interfaces/NavigationProviderProps.md +1 -1
  125. package/docs/api/interfaces/Organisation.md +1 -1
  126. package/docs/api/interfaces/OrganisationContextType.md +1 -1
  127. package/docs/api/interfaces/OrganisationMembership.md +1 -1
  128. package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
  129. package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
  130. package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
  131. package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
  132. package/docs/api/interfaces/PageAccessRecord.md +1 -1
  133. package/docs/api/interfaces/PagePermissionContextType.md +1 -1
  134. package/docs/api/interfaces/PagePermissionGuardProps.md +2 -2
  135. package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
  136. package/docs/api/interfaces/PaletteData.md +1 -1
  137. package/docs/api/interfaces/ParsedAddress.md +1 -1
  138. package/docs/api/interfaces/PermissionEnforcerProps.md +4 -4
  139. package/docs/api/interfaces/ProgressProps.md +1 -1
  140. package/docs/api/interfaces/ProtectedRouteProps.md +1 -1
  141. package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
  142. package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
  143. package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
  144. package/docs/api/interfaces/QuickFix.md +1 -1
  145. package/docs/api/interfaces/RBACAccessValidateParams.md +1 -1
  146. package/docs/api/interfaces/RBACAccessValidateResult.md +1 -1
  147. package/docs/api/interfaces/RBACAuditLogParams.md +1 -1
  148. package/docs/api/interfaces/RBACAuditLogResult.md +1 -1
  149. package/docs/api/interfaces/RBACConfig.md +2 -2
  150. package/docs/api/interfaces/RBACContext.md +1 -1
  151. package/docs/api/interfaces/RBACLogger.md +1 -1
  152. package/docs/api/interfaces/RBACPageAccessCheckParams.md +1 -1
  153. package/docs/api/interfaces/RBACPerformanceMetrics.md +1 -1
  154. package/docs/api/interfaces/RBACPermissionCheckParams.md +1 -1
  155. package/docs/api/interfaces/RBACPermissionCheckResult.md +2 -2
  156. package/docs/api/interfaces/RBACPermissionsGetParams.md +1 -1
  157. package/docs/api/interfaces/RBACPermissionsGetResult.md +1 -1
  158. package/docs/api/interfaces/RBACResult.md +1 -1
  159. package/docs/api/interfaces/RBACRoleGrantParams.md +2 -2
  160. package/docs/api/interfaces/RBACRoleGrantResult.md +1 -1
  161. package/docs/api/interfaces/RBACRoleRevokeParams.md +2 -2
  162. package/docs/api/interfaces/RBACRoleRevokeResult.md +1 -1
  163. package/docs/api/interfaces/RBACRoleValidateParams.md +2 -2
  164. package/docs/api/interfaces/RBACRoleValidateResult.md +1 -1
  165. package/docs/api/interfaces/RBACRolesListParams.md +1 -1
  166. package/docs/api/interfaces/RBACRolesListResult.md +2 -2
  167. package/docs/api/interfaces/RBACSessionTrackParams.md +1 -1
  168. package/docs/api/interfaces/RBACSessionTrackResult.md +1 -1
  169. package/docs/api/interfaces/ResourcePermissions.md +1 -1
  170. package/docs/api/interfaces/RevokeEventAppRoleParams.md +1 -1
  171. package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
  172. package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
  173. package/docs/api/interfaces/RoleManagementResult.md +1 -1
  174. package/docs/api/interfaces/RouteAccessRecord.md +2 -2
  175. package/docs/api/interfaces/RouteConfig.md +2 -2
  176. package/docs/api/interfaces/RuntimeComplianceResult.md +1 -1
  177. package/docs/api/interfaces/SecureDataContextType.md +1 -1
  178. package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
  179. package/docs/api/interfaces/SessionRestorationLoaderProps.md +1 -1
  180. package/docs/api/interfaces/SetupIssue.md +1 -1
  181. package/docs/api/interfaces/StorageConfig.md +1 -1
  182. package/docs/api/interfaces/StorageFileInfo.md +1 -1
  183. package/docs/api/interfaces/StorageFileMetadata.md +1 -1
  184. package/docs/api/interfaces/StorageListOptions.md +1 -1
  185. package/docs/api/interfaces/StorageListResult.md +1 -1
  186. package/docs/api/interfaces/StorageUploadOptions.md +1 -1
  187. package/docs/api/interfaces/StorageUploadResult.md +1 -1
  188. package/docs/api/interfaces/StorageUrlOptions.md +1 -1
  189. package/docs/api/interfaces/StyleImport.md +1 -1
  190. package/docs/api/interfaces/SwitchProps.md +1 -1
  191. package/docs/api/interfaces/TabsContentProps.md +1 -1
  192. package/docs/api/interfaces/TabsListProps.md +1 -1
  193. package/docs/api/interfaces/TabsProps.md +1 -1
  194. package/docs/api/interfaces/TabsTriggerProps.md +1 -1
  195. package/docs/api/interfaces/TextareaProps.md +1 -1
  196. package/docs/api/interfaces/ToastActionElement.md +1 -1
  197. package/docs/api/interfaces/ToastProps.md +1 -1
  198. package/docs/api/interfaces/UnifiedAuthContextType.md +60 -38
  199. package/docs/api/interfaces/UnifiedAuthProviderProps.md +13 -13
  200. package/docs/api/interfaces/UseFormDialogOptions.md +1 -1
  201. package/docs/api/interfaces/UseFormDialogReturn.md +1 -1
  202. package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
  203. package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
  204. package/docs/api/interfaces/UsePublicEventLogoOptions.md +2 -2
  205. package/docs/api/interfaces/UsePublicEventLogoReturn.md +1 -1
  206. package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
  207. package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
  208. package/docs/api/interfaces/UsePublicFileDisplayOptions.md +2 -2
  209. package/docs/api/interfaces/UsePublicFileDisplayReturn.md +1 -1
  210. package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
  211. package/docs/api/interfaces/UseResolvedScopeOptions.md +2 -2
  212. package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
  213. package/docs/api/interfaces/UseResourcePermissionsOptions.md +1 -1
  214. package/docs/api/interfaces/UserEventAccess.md +1 -1
  215. package/docs/api/interfaces/UserMenuProps.md +1 -1
  216. package/docs/api/interfaces/UserProfile.md +1 -1
  217. package/docs/api/modules.md +194 -209
  218. package/docs/getting-started/cursor-rules.md +262 -0
  219. package/docs/getting-started/installation-guide.md +6 -1
  220. package/docs/getting-started/quick-start.md +6 -1
  221. package/docs/migration/MIGRATION_GUIDE.md +4 -4
  222. package/docs/migration/REACT_19_MIGRATION.md +227 -0
  223. package/docs/migration/database-changes-december-2025.md +2 -1
  224. package/docs/rbac/event-based-apps.md +124 -6
  225. package/docs/standards/README.md +39 -0
  226. package/docs/troubleshooting/migration.md +4 -4
  227. package/examples/PublicPages/PublicEventPage.tsx +1 -1
  228. package/package.json +11 -6
  229. package/scripts/audit-consuming-app.cjs +961 -0
  230. package/scripts/check-pace-core-compliance.cjs +315 -61
  231. package/scripts/install-cursor-rules.cjs +236 -0
  232. package/src/__tests__/helpers/test-providers.tsx +1 -1
  233. package/src/__tests__/helpers/test-utils.tsx +1 -1
  234. package/src/__tests__/rls-policies.test.ts +3 -1
  235. package/src/components/Badge/Badge.tsx +2 -4
  236. package/src/components/Button/Button.tsx +5 -4
  237. package/src/components/Calendar/Calendar.tsx +1 -1
  238. package/src/components/DataTable/DataTable.test.tsx +57 -93
  239. package/src/components/DataTable/DataTable.tsx +2 -2
  240. package/src/components/DataTable/__tests__/DataTable.default-state.test.tsx +172 -45
  241. package/src/components/DataTable/__tests__/DataTable.grouping-aggregation.test.tsx +121 -28
  242. package/src/components/DataTable/__tests__/DataTableCore.test-setup.ts +9 -8
  243. package/src/components/DataTable/__tests__/DataTableCore.test.tsx +20 -52
  244. package/src/components/DataTable/__tests__/a11y.basic.test.tsx +170 -34
  245. package/src/components/DataTable/__tests__/keyboard.test.tsx +75 -12
  246. package/src/components/DataTable/__tests__/pagination.modes.test.tsx +88 -16
  247. package/src/components/DataTable/__tests__/ssr.strict-mode.test.tsx +12 -12
  248. package/src/components/DataTable/components/AccessDeniedPage.tsx +1 -1
  249. package/src/components/DataTable/components/BulkOperationsDropdown.tsx +1 -1
  250. package/src/components/DataTable/components/DataTableCore.tsx +4 -7
  251. package/src/components/DataTable/components/DataTableModals.tsx +1 -1
  252. package/src/components/DataTable/components/EditableRow.tsx +1 -1
  253. package/src/components/DataTable/components/UnifiedTableBody.tsx +86 -17
  254. package/src/components/DataTable/components/__tests__/DataTableModals.test.tsx +23 -23
  255. package/src/components/DataTable/components/__tests__/EditableRow.test.tsx +11 -11
  256. package/src/components/DataTable/components/__tests__/ExpandButton.test.tsx +36 -36
  257. package/src/components/DataTable/components/__tests__/GroupHeader.test.tsx +27 -27
  258. package/src/components/DataTable/components/__tests__/ImportModal.test.tsx +39 -39
  259. package/src/components/DataTable/components/__tests__/UnifiedTableBody.test.tsx +33 -33
  260. package/src/components/DataTable/components/__tests__/ViewRowModal.test.tsx +29 -29
  261. package/src/components/DataTable/hooks/useColumnReordering.ts +2 -2
  262. package/src/components/DataTable/hooks/useDataTablePermissions.ts +75 -10
  263. package/src/components/DataTable/hooks/useKeyboardNavigation.ts +2 -2
  264. package/src/components/DatePickerWithTimezone/DatePickerWithTimezone.test.tsx +8 -14
  265. package/src/components/Dialog/Dialog.tsx +6 -5
  266. package/src/components/ErrorBoundary/ErrorBoundary.tsx +1 -1
  267. package/src/components/EventSelector/EventSelector.tsx +1 -1
  268. package/src/components/FileDisplay/FileDisplay.test.tsx +4 -3
  269. package/src/components/FileDisplay/FileDisplay.tsx +16 -4
  270. package/src/components/Footer/Footer.tsx +1 -1
  271. package/src/components/Form/Form.test.tsx +36 -15
  272. package/src/components/Form/Form.tsx +30 -26
  273. package/src/components/Header/Header.tsx +1 -1
  274. package/src/components/InactivityWarningModal/InactivityWarningModal.test.tsx +40 -40
  275. package/src/components/InactivityWarningModal/InactivityWarningModal.tsx +1 -1
  276. package/src/components/Input/Input.tsx +28 -30
  277. package/src/components/Label/Label.tsx +1 -1
  278. package/src/components/LoadingSpinner/LoadingSpinner.tsx +1 -1
  279. package/src/components/LoginForm/LoginForm.test.tsx +42 -42
  280. package/src/components/LoginForm/LoginForm.tsx +8 -8
  281. package/src/components/NavigationMenu/NavigationMenu.test.tsx +6 -4
  282. package/src/components/NavigationMenu/NavigationMenu.tsx +2 -11
  283. package/src/components/OrganisationSelector/OrganisationSelector.tsx +0 -1
  284. package/src/components/PaceAppLayout/PaceAppLayout.performance.test.tsx +1 -1
  285. package/src/components/PaceAppLayout/PaceAppLayout.test.tsx +75 -52
  286. package/src/components/PaceAppLayout/PaceAppLayout.tsx +98 -69
  287. package/src/components/PaceAppLayout/README.md +1 -1
  288. package/src/components/PaceLoginPage/PaceLoginPage.tsx +1 -8
  289. package/src/components/PasswordChange/PasswordChangeForm.test.tsx +33 -33
  290. package/src/components/PasswordChange/PasswordChangeForm.tsx +1 -1
  291. package/src/components/Progress/Progress.tsx +1 -1
  292. package/src/components/ProtectedRoute/ProtectedRoute.test.tsx +5 -9
  293. package/src/components/ProtectedRoute/ProtectedRoute.tsx +0 -1
  294. package/src/components/PublicLayout/PublicPageLayout.tsx +1 -1
  295. package/src/components/PublicLayout/PublicPageProvider.tsx +0 -1
  296. package/src/components/Select/Select.tsx +33 -22
  297. package/src/components/SessionRestorationLoader/SessionRestorationLoader.tsx +1 -1
  298. package/src/components/Table/Table.tsx +1 -1
  299. package/src/components/Textarea/Textarea.tsx +27 -29
  300. package/src/components/Toast/Toast.tsx +1 -1
  301. package/src/components/Tooltip/Tooltip.tsx +1 -1
  302. package/src/components/UserMenu/UserMenu.tsx +1 -1
  303. package/src/hooks/__tests__/hooks.integration.test.tsx +80 -55
  304. package/src/hooks/__tests__/useSecureDataAccess.unit.test.tsx +14 -7
  305. package/src/hooks/__tests__/useStorage.unit.test.ts +36 -36
  306. package/src/hooks/public/usePublicEvent.ts +1 -1
  307. package/src/hooks/public/usePublicEventLogo.ts +1 -1
  308. package/src/hooks/public/usePublicRouteParams.ts +1 -1
  309. package/src/hooks/services/useAuthService.ts +21 -3
  310. package/src/hooks/services/useEventService.ts +21 -3
  311. package/src/hooks/services/useInactivityService.ts +21 -3
  312. package/src/hooks/services/useOrganisationService.ts +21 -3
  313. package/src/hooks/useDataTableState.ts +8 -18
  314. package/src/hooks/useFileDisplay.ts +10 -17
  315. package/src/hooks/useFocusManagement.ts +2 -2
  316. package/src/hooks/useFocusTrap.ts +4 -4
  317. package/src/hooks/useFormDialog.ts +8 -7
  318. package/src/hooks/useInactivityTracker.ts +1 -1
  319. package/src/hooks/usePermissionCache.ts +1 -1
  320. package/src/hooks/useSecureDataAccess.test.ts +16 -9
  321. package/src/hooks/useSecureDataAccess.ts +22 -6
  322. package/src/hooks/useToast.ts +2 -2
  323. package/src/providers/__tests__/OrganisationProvider.test.tsx +57 -13
  324. package/src/providers/__tests__/ProviderLifecycle.test.tsx +21 -6
  325. package/src/providers/__tests__/UnifiedAuthProvider.test.tsx +10 -10
  326. package/src/providers/services/EventServiceProvider.tsx +0 -8
  327. package/src/providers/services/UnifiedAuthProvider.tsx +196 -46
  328. package/src/providers/services/__tests__/AuthServiceProvider.integration.test.tsx +13 -3
  329. package/src/rbac/__tests__/adapters.comprehensive.test.tsx +34 -40
  330. package/src/rbac/__tests__/isSuperAdmin.real.test.ts +82 -0
  331. package/src/rbac/adapters.tsx +3 -22
  332. package/src/rbac/api.test.ts +2 -2
  333. package/src/rbac/api.ts +7 -1
  334. package/src/rbac/components/EnhancedNavigationMenu.tsx +3 -16
  335. package/src/rbac/components/NavigationGuard.tsx +2 -11
  336. package/src/rbac/components/NavigationProvider.tsx +1 -2
  337. package/src/rbac/components/PagePermissionGuard.tsx +1 -1
  338. package/src/rbac/components/PagePermissionProvider.tsx +1 -1
  339. package/src/rbac/components/PermissionEnforcer.tsx +46 -13
  340. package/src/rbac/components/RoleBasedRouter.tsx +1 -1
  341. package/src/rbac/components/SecureDataProvider.tsx +1 -2
  342. package/src/rbac/components/__tests__/EnhancedNavigationMenu.test.tsx +7 -43
  343. package/src/rbac/components/__tests__/NavigationGuard.test.tsx +4 -11
  344. package/src/rbac/components/__tests__/NavigationProvider.test.tsx +3 -3
  345. package/src/rbac/components/__tests__/SecureDataProvider.fixed.test.tsx +1 -1
  346. package/src/rbac/components/__tests__/SecureDataProvider.test.tsx +1 -1
  347. package/src/rbac/engine.ts +14 -2
  348. package/src/rbac/hooks/index.ts +0 -3
  349. package/src/rbac/hooks/usePermissions.ts +51 -11
  350. package/src/rbac/hooks/useRBAC.ts +3 -13
  351. package/src/rbac/hooks/useResolvedScope.test.ts +75 -54
  352. package/src/rbac/hooks/useResolvedScope.ts +58 -33
  353. package/src/rbac/hooks/useSecureSupabase.ts +4 -9
  354. package/src/rbac/secureClient.ts +43 -0
  355. package/src/services/EventService.ts +4 -57
  356. package/src/services/InactivityService.ts +127 -34
  357. package/src/services/OrganisationService.ts +68 -10
  358. package/src/utils/security/secureDataAccess.test.ts +31 -20
  359. package/src/utils/security/secureDataAccess.ts +4 -3
  360. package/dist/chunk-6C4YBBJM.js.map +0 -1
  361. package/dist/chunk-6LTQQAT6.js.map +0 -1
  362. package/dist/chunk-6TQDD426.js.map +0 -1
  363. package/dist/chunk-LOMZXPSN.js.map +0 -1
  364. package/dist/chunk-OETXORNB.js.map +0 -1
  365. package/dist/chunk-ULHIJK66.js.map +0 -1
  366. package/dist/chunk-VKB2CO4Z.js.map +0 -1
  367. package/dist/chunk-VRGWKHDB.js.map +0 -1
  368. package/dist/chunk-XNYQOL3Z.js.map +0 -1
  369. package/dist/chunk-XYXSXPUK.js.map +0 -1
  370. package/scripts/check-pace-core-compliance.js +0 -512
  371. package/src/rbac/hooks/useSuperAdminBypass.ts +0 -126
  372. package/src/utils/context/superAdminOverride.ts +0 -58
  373. /package/dist/{DataTable-WKRZD47S.js.map → DataTable-DQ7RSOHE.js.map} +0 -0
  374. /package/dist/{UnifiedAuthProvider-FTSG5XH7.js.map → UnifiedAuthProvider-ATAP5UTR.js.map} +0 -0
  375. /package/dist/{api-IHKALJZD.js.map → api-N774RPUA.js.map} +0 -0
  376. /package/dist/{chunk-QWWZ5CAQ.js.map → chunk-LXQLPRQ2.js.map} +0 -0
  377. /package/examples/{rbac → RBAC}/CompleteRBACExample.tsx +0 -0
  378. /package/examples/{rbac → RBAC}/EventBasedApp.tsx +0 -0
  379. /package/examples/{rbac → RBAC}/PermissionExample.tsx +0 -0
  380. /package/examples/{rbac → RBAC}/index.ts +0 -0
@@ -1,16 +1,19 @@
1
1
  import {
2
2
  useCan
3
- } from "./chunk-VRGWKHDB.js";
3
+ } from "./chunk-XM25TVIE.js";
4
4
  import {
5
5
  toast,
6
6
  useDataTablePerformance
7
- } from "./chunk-6C4YBBJM.js";
7
+ } from "./chunk-3QRJFVBR.js";
8
8
  import {
9
9
  useResolvedScope
10
- } from "./chunk-OETXORNB.js";
10
+ } from "./chunk-3XTALGJF.js";
11
11
  import {
12
12
  useUnifiedAuth
13
- } from "./chunk-6LTQQAT6.js";
13
+ } from "./chunk-BYFSK72L.js";
14
+ import {
15
+ isSuperAdmin
16
+ } from "./chunk-KNC55RTG.js";
14
17
  import {
15
18
  cn,
16
19
  renderSafeHtml
@@ -5508,7 +5511,7 @@ var require_lodash = __commonJS({
5508
5511
  import React21 from "react";
5509
5512
 
5510
5513
  // src/components/DataTable/components/DataTableCore.tsx
5511
- import React20, { useMemo as useMemo14, useCallback as useCallback10, useEffect as useEffect11, useRef as useRef6 } from "react";
5514
+ import React20, { useMemo as useMemo14, useCallback as useCallback9, useEffect as useEffect12, useRef as useRef6 } from "react";
5512
5515
  import { useReactTable } from "@tanstack/react-table";
5513
5516
  import { Edit, Trash, ChevronUp as ChevronUp2, ChevronDown as ChevronDown3, ChevronsUpDown } from "lucide-react";
5514
5517
 
@@ -5647,6 +5650,21 @@ var getTableCellClasses = (options = {}) => {
5647
5650
  className
5648
5651
  );
5649
5652
  };
5653
+ var getTableRowClasses = (options = {}) => {
5654
+ const { isSelected = false, isVirtualized = false, className } = options;
5655
+ if (isVirtualized) {
5656
+ return cn(
5657
+ tableStyles.rowHover,
5658
+ isSelected && tableStyles.rowSelected,
5659
+ className
5660
+ );
5661
+ }
5662
+ return cn(
5663
+ tableStyles.row,
5664
+ isSelected && tableStyles.rowSelected,
5665
+ className
5666
+ );
5667
+ };
5650
5668
  var getTableClasses = (options = {}) => {
5651
5669
  const { isFixed = false, variant = "default", className } = options;
5652
5670
  if (isFixed) {
@@ -5672,34 +5690,32 @@ var getTableClasses = (options = {}) => {
5672
5690
  // src/components/Input/Input.tsx
5673
5691
  import * as React3 from "react";
5674
5692
  import { jsx as jsx3 } from "react/jsx-runtime";
5675
- var Input = React3.forwardRef(
5676
- ({ className, variant = "default", size = "md", error, type, ...props }, ref) => {
5677
- return /* @__PURE__ */ jsx3(
5678
- "input",
5679
- {
5680
- type,
5681
- className: cn(
5682
- // Base styles
5683
- "flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
5684
- // Variant styles
5685
- {
5686
- "border-input": variant === "default" && !error,
5687
- "border-destructive focus-visible:ring-destructive": variant === "destructive" || error
5688
- },
5689
- // Size styles
5690
- {
5691
- "h-8 px-2 py-1 text-xs": size === "sm",
5692
- "h-9 px-3 py-2 text-sm": size === "md",
5693
- "h-10 px-4 py-3 text-base": size === "lg"
5694
- },
5695
- className
5696
- ),
5697
- ref,
5698
- ...props
5699
- }
5700
- );
5701
- }
5702
- );
5693
+ function Input({ className, variant = "default", size = "md", error, type, ref, ...props }) {
5694
+ return /* @__PURE__ */ jsx3(
5695
+ "input",
5696
+ {
5697
+ type,
5698
+ className: cn(
5699
+ // Base styles
5700
+ "flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
5701
+ // Variant styles
5702
+ {
5703
+ "border-input": variant === "default" && !error,
5704
+ "border-destructive focus-visible:ring-destructive": variant === "destructive" || error
5705
+ },
5706
+ // Size styles
5707
+ {
5708
+ "h-8 px-2 py-1 text-xs": size === "sm",
5709
+ "h-9 px-3 py-2 text-sm": size === "md",
5710
+ "h-10 px-4 py-3 text-base": size === "lg"
5711
+ },
5712
+ className
5713
+ ),
5714
+ ref,
5715
+ ...props
5716
+ }
5717
+ );
5718
+ }
5703
5719
  Input.displayName = "Input";
5704
5720
  var InputGroup = React3.forwardRef(
5705
5721
  ({ className, children, orientation = "vertical", spacing = "md", ...props }, ref) => {
@@ -5878,17 +5894,18 @@ var useSelectSearch = ({
5878
5894
  const filterChildren = (nodes) => {
5879
5895
  return React4.Children.map(nodes, (child) => {
5880
5896
  if (!React4.isValidElement(child)) return child;
5881
- const isSelectItem = child.props && (child.props["data-testid"] === "select-item" || child.props.value !== void 0);
5897
+ const childProps = child.props;
5898
+ const isSelectItem = childProps && (childProps["data-testid"] === "select-item" || childProps.value !== void 0);
5882
5899
  if (isSelectItem) {
5883
- const childText = React4.Children.toArray(child.props.children).join(" ").toLowerCase();
5900
+ const childText = React4.Children.toArray(childProps.children).join(" ").toLowerCase();
5884
5901
  const searchLower = searchTerm.toLowerCase();
5885
5902
  if (childText.includes(searchLower)) {
5886
5903
  return child;
5887
5904
  }
5888
5905
  return null;
5889
5906
  }
5890
- if (child.props.children) {
5891
- const filteredChildChildren = filterChildren(child.props.children);
5907
+ if (childProps.children) {
5908
+ const filteredChildChildren = filterChildren(childProps.children);
5892
5909
  if (React4.Children.count(filteredChildChildren) > 0) {
5893
5910
  return React4.cloneElement(child, {}, filteredChildChildren);
5894
5911
  }
@@ -6042,7 +6059,7 @@ var SelectTrigger = React4.forwardRef(
6042
6059
  ({ children, className, variant = "outline", size = "default", asChild = false, ...props }, ref) => {
6043
6060
  const { open, disabled, value, actions, direction = "down" } = useSelectContext();
6044
6061
  const opensUpward = direction === "up";
6045
- const handleClickRef = React4.useRef();
6062
+ const handleClickRef = React4.useRef(void 0);
6046
6063
  const handleClick = React4.useCallback((e) => {
6047
6064
  if (disabled) {
6048
6065
  e.preventDefault();
@@ -6101,10 +6118,15 @@ var SelectTrigger = React4.forwardRef(
6101
6118
  ...props
6102
6119
  };
6103
6120
  if (asChild) {
6104
- const childChildren = React4.Children.toArray(children.props.children);
6105
- const hasChevron = childChildren.some(
6106
- (child) => React4.isValidElement(child) && (child.type === ChevronDown || child.type === "svg" && child.props["data-testid"] === "chevron-down" || typeof child === "object" && "type" in child && typeof child.type === "function" && child.type.name === "ChevronDown")
6107
- );
6121
+ const childElement = children;
6122
+ const childChildren = React4.Children.toArray(childElement.props.children);
6123
+ const hasChevron = childChildren.some((child) => {
6124
+ if (React4.isValidElement(child)) {
6125
+ const childProps = child.props;
6126
+ return child.type === ChevronDown || child.type === "svg" && childProps["data-testid"] === "chevron-down" || typeof child === "object" && "type" in child && typeof child.type === "function" && child.type.name === "ChevronDown";
6127
+ }
6128
+ return false;
6129
+ });
6108
6130
  const childClassName = children.props.className;
6109
6131
  const mergedClassName = cn(
6110
6132
  triggerProps.className,
@@ -6300,8 +6322,11 @@ var SelectItem = React4.forwardRef(
6300
6322
  const getTextContent = (children2) => {
6301
6323
  if (typeof children2 === "string") return children2;
6302
6324
  if (typeof children2 === "number") return children2.toString();
6303
- if (React4.isValidElement(children2) && children2.props.children) {
6304
- return getTextContent(children2.props.children);
6325
+ if (React4.isValidElement(children2)) {
6326
+ const props = children2.props;
6327
+ if (props.children) {
6328
+ return getTextContent(props.children);
6329
+ }
6305
6330
  }
6306
6331
  if (Array.isArray(children2)) {
6307
6332
  return children2.map(getTextContent).join("");
@@ -7086,7 +7111,7 @@ function SelectEditField({
7086
7111
  onChange,
7087
7112
  className
7088
7113
  }) {
7089
- const logger2 = React9.useMemo(() => createLogger("SelectEditField"), []);
7114
+ const logger2 = createLogger("SelectEditField");
7090
7115
  const isSearchable = columnDef.selectSearchable !== false;
7091
7116
  const isCreatable = columnDef.creatable === true;
7092
7117
  const selectRef = React9.useRef(null);
@@ -7616,7 +7641,7 @@ function SelectEditField2({
7616
7641
  placeholder,
7617
7642
  onChange
7618
7643
  }) {
7619
- const logger2 = React10.useMemo(() => createLogger("SelectEditField"), []);
7644
+ const logger2 = createLogger("SelectEditField");
7620
7645
  const isSearchable = columnDef.selectSearchable !== false;
7621
7646
  const isCreatable = columnDef.creatable === true;
7622
7647
  const selectRef = React10.useRef(null);
@@ -7857,12 +7882,14 @@ var RowComponent = React10.memo(({
7857
7882
  }) => {
7858
7883
  const rowRef = useRef2(null);
7859
7884
  const firstInputRef = useRef2(null);
7860
- const logger2 = React10.useMemo(() => createLogger("RowComponent"), []);
7885
+ const logger2 = createLogger("RowComponent");
7861
7886
  const rowId = getRowIdSafe(row.original, row.index, getRowId);
7862
7887
  const hierarchicalRow = row.original;
7863
7888
  const isHierarchical = hierarchical?.enabled && hierarchicalRow?.isParent !== void 0;
7864
7889
  const isParent = isHierarchical && hierarchicalRow.isParent;
7865
7890
  const isChild = isHierarchical && !hierarchicalRow.isParent;
7891
+ const visibleCells = row.getVisibleCells();
7892
+ const isSelected = typeof row.getIsSelected === "function" ? row.getIsSelected() : false;
7866
7893
  useEffect2(() => {
7867
7894
  if (isEditing && firstInputRef.current) {
7868
7895
  firstInputRef.current.focus();
@@ -7895,9 +7922,8 @@ var RowComponent = React10.memo(({
7895
7922
  const groupValue = row.getValue(grouping[0]);
7896
7923
  const subRowsCount = row.subRows?.length || 0;
7897
7924
  const isExpanded = row.getIsExpanded();
7898
- const visibleCells2 = row.getVisibleCells();
7899
7925
  const childRows = row.subRows?.map((subRow) => subRow.original) || [];
7900
- return /* @__PURE__ */ jsx14("tr", { className: "bg-sec-50 hover:bg-sec-100", style, children: visibleCells2.map((cell, cellIndex) => {
7926
+ return /* @__PURE__ */ jsx14("tr", { className: "bg-sec-50 hover:bg-sec-100", style, children: visibleCells.map((cell, cellIndex) => {
7901
7927
  const columnDef = cell.column.columnDef;
7902
7928
  const isGroupingColumn = cellIndex === 0 || grouping.includes(cell.column.id || "");
7903
7929
  if (isGroupingColumn && cellIndex === 0) {
@@ -8006,11 +8032,20 @@ var RowComponent = React10.memo(({
8006
8032
  }
8007
8033
  );
8008
8034
  }
8009
- const visibleCells = row.getVisibleCells();
8010
- const allCells = row.getAllCells ? row.getAllCells() : [];
8011
8035
  const indentSize = hierarchical?.indentSize || 24;
8012
- const indentation = isChild && hierarchical?.state ? calculateIndentation(hierarchicalRow, [], indentSize) : 0;
8013
- const rowClassName = isHierarchical ? isParent ? hierarchical?.parentRowClassName || "bg-main-50 hover:bg-main-100 font-medium" : hierarchical?.childRowClassName || "bg-sec-25 hover:bg-sec-50" : "";
8036
+ const indentation = React10.useMemo(() => {
8037
+ return isChild && hierarchical?.state ? calculateIndentation(hierarchicalRow, [], indentSize) : 0;
8038
+ }, [isChild, hierarchical?.state, hierarchicalRow, indentSize]);
8039
+ const rowClassName = React10.useMemo(() => {
8040
+ if (isHierarchical) {
8041
+ const hierarchicalClass = isParent ? hierarchical?.parentRowClassName || "bg-main-50 hover:bg-main-100 font-medium" : hierarchical?.childRowClassName || "bg-sec-25 hover:bg-sec-50";
8042
+ return cn(
8043
+ getTableRowClasses({ isSelected, isVirtualized: false }),
8044
+ hierarchicalClass
8045
+ );
8046
+ }
8047
+ return getTableRowClasses({ isSelected, isVirtualized: false });
8048
+ }, [isHierarchical, isParent, isSelected, hierarchical]);
8014
8049
  return /* @__PURE__ */ jsx14(
8015
8050
  "tr",
8016
8051
  {
@@ -8021,7 +8056,7 @@ var RowComponent = React10.memo(({
8021
8056
  ...isChild && indentation > 0 ? { paddingLeft: `${indentation}px` } : {}
8022
8057
  },
8023
8058
  className: rowClassName,
8024
- "aria-selected": typeof row.getIsSelected === "function" ? row.getIsSelected() ? "true" : "false" : "false",
8059
+ "aria-selected": isSelected ? "true" : "false",
8025
8060
  children: visibleCells.map((cell, cellIndex) => {
8026
8061
  const isFirstCell = cellIndex === 0;
8027
8062
  const shouldShowExpansionButton = isHierarchical && isParent && isFirstCell && hierarchical?.state;
@@ -8078,7 +8113,43 @@ var RowComponent = React10.memo(({
8078
8113
  );
8079
8114
  });
8080
8115
  RowComponent.displayName = "RowComponent";
8081
- var MemoizedRow = RowComponent;
8116
+ var areRowPropsEqual = (prevProps, nextProps) => {
8117
+ if (prevProps.row.id !== nextProps.row.id || prevProps.row.index !== nextProps.row.index) {
8118
+ return false;
8119
+ }
8120
+ if (prevProps.isEditing !== nextProps.isEditing) {
8121
+ return false;
8122
+ }
8123
+ if (prevProps.editingRowId !== nextProps.editingRowId) {
8124
+ return false;
8125
+ }
8126
+ if (prevProps.style !== nextProps.style) {
8127
+ if (!prevProps.style || !nextProps.style) {
8128
+ return false;
8129
+ }
8130
+ const prevStyle = prevProps.style;
8131
+ const nextStyle = nextProps.style;
8132
+ const styleKeys = /* @__PURE__ */ new Set([...Object.keys(prevStyle), ...Object.keys(nextStyle)]);
8133
+ for (const key of styleKeys) {
8134
+ if (prevStyle[key] !== nextStyle[key]) {
8135
+ return false;
8136
+ }
8137
+ }
8138
+ }
8139
+ if (prevProps.grouping.length !== nextProps.grouping.length || prevProps.grouping.some((id, i) => id !== nextProps.grouping[i])) {
8140
+ return false;
8141
+ }
8142
+ if (prevProps.hierarchical?.enabled !== nextProps.hierarchical?.enabled) {
8143
+ return false;
8144
+ }
8145
+ const prevSelected = typeof prevProps.row.getIsSelected === "function" ? prevProps.row.getIsSelected() : false;
8146
+ const nextSelected = typeof nextProps.row.getIsSelected === "function" ? nextProps.row.getIsSelected() : false;
8147
+ if (prevSelected !== nextSelected) {
8148
+ return false;
8149
+ }
8150
+ return true;
8151
+ };
8152
+ var MemoizedRow = React10.memo(RowComponent, areRowPropsEqual);
8082
8153
  function UnifiedTableBody({
8083
8154
  table,
8084
8155
  isCreating,
@@ -8107,7 +8178,7 @@ function UnifiedTableBody({
8107
8178
  rbac,
8108
8179
  permissions
8109
8180
  }) {
8110
- const logger2 = React10.useMemo(() => createLogger("UnifiedTableBody"), []);
8181
+ const logger2 = createLogger("UnifiedTableBody");
8111
8182
  const headerRef = useRef2(null);
8112
8183
  const bodyRef = useRef2(null);
8113
8184
  const parentRef = useRef2(null);
@@ -8684,7 +8755,7 @@ function LoadingState() {
8684
8755
  }
8685
8756
 
8686
8757
  // src/components/DataTable/components/DataTableModals.tsx
8687
- import React15, { useEffect as useEffect5 } from "react";
8758
+ import { useEffect as useEffect5 } from "react";
8688
8759
 
8689
8760
  // src/components/DataTable/components/ImportModal.tsx
8690
8761
  import { useState as useState4, useRef as useRef3, useEffect as useEffect4 } from "react";
@@ -8812,16 +8883,16 @@ var DialogContent = React12.forwardRef(({
8812
8883
  minWidth,
8813
8884
  enableScrolling
8814
8885
  });
8815
- const handleEscapeKeyDown = React12.useCallback((event) => {
8886
+ const handleEscapeKeyDown = (event) => {
8816
8887
  if (preventCloseOnEscape) {
8817
8888
  event.preventDefault();
8818
8889
  }
8819
- }, [preventCloseOnEscape]);
8820
- const handlePointerDownOutside = React12.useCallback((event) => {
8890
+ };
8891
+ const handlePointerDownOutside = (event) => {
8821
8892
  if (preventCloseOnOutsideClick) {
8822
8893
  event.preventDefault();
8823
8894
  }
8824
- }, [preventCloseOnOutsideClick]);
8895
+ };
8825
8896
  const mergedStyle = React12.useMemo(() => {
8826
8897
  if (Object.keys(smartDimensions).length === 0) {
8827
8898
  return style;
@@ -9403,7 +9474,7 @@ function DataTableModals({
9403
9474
  onStoreFocus,
9404
9475
  onRestoreFocus
9405
9476
  }) {
9406
- const logger2 = React15.useMemo(() => createLogger("DataTableModals"), []);
9477
+ const logger2 = createLogger("DataTableModals");
9407
9478
  useEffect5(() => {
9408
9479
  if (showImportModal) {
9409
9480
  onStoreFocus?.();
@@ -9630,7 +9701,7 @@ var DataTableErrorBoundary = class extends Component {
9630
9701
  };
9631
9702
 
9632
9703
  // src/components/DataTable/hooks/useColumnOrderPersistence.ts
9633
- import { useState as useState5, useEffect as useEffect6, useCallback as useCallback3 } from "react";
9704
+ import { useState as useState5, useEffect as useEffect6, useCallback as useCallback2 } from "react";
9634
9705
  function useColumnOrderPersistence({
9635
9706
  tableId,
9636
9707
  defaultOrder = [],
@@ -9664,7 +9735,7 @@ function useColumnOrderPersistence({
9664
9735
  setIsLoaded(true);
9665
9736
  }
9666
9737
  }, [enablePersistence, finalStorageKey, storageKey, tableId]);
9667
- const saveColumnOrder = useCallback3((newOrder) => {
9738
+ const saveColumnOrder = useCallback2((newOrder) => {
9668
9739
  if (!enablePersistence || typeof window === "undefined") return;
9669
9740
  if (!storageKey && !tableId) return;
9670
9741
  try {
@@ -9673,11 +9744,11 @@ function useColumnOrderPersistence({
9673
9744
  logger2.warn("Failed to save column order to localStorage:", error);
9674
9745
  }
9675
9746
  }, [enablePersistence, finalStorageKey, storageKey, tableId]);
9676
- const updateColumnOrder = useCallback3((newOrder) => {
9747
+ const updateColumnOrder = useCallback2((newOrder) => {
9677
9748
  setColumnOrder(newOrder);
9678
9749
  saveColumnOrder(newOrder);
9679
9750
  }, [saveColumnOrder]);
9680
- const resetColumnOrder = useCallback3(() => {
9751
+ const resetColumnOrder = useCallback2(() => {
9681
9752
  setColumnOrder(defaultOrder);
9682
9753
  if (enablePersistence && (storageKey || tableId) && typeof window !== "undefined") {
9683
9754
  try {
@@ -9687,7 +9758,7 @@ function useColumnOrderPersistence({
9687
9758
  }
9688
9759
  }
9689
9760
  }, [defaultOrder, enablePersistence, finalStorageKey, storageKey, tableId]);
9690
- const clearAllPreferences = useCallback3(() => {
9761
+ const clearAllPreferences = useCallback2(() => {
9691
9762
  if (!enablePersistence || typeof window === "undefined") return;
9692
9763
  try {
9693
9764
  const keys = Object.keys(localStorage);
@@ -9710,7 +9781,7 @@ function useColumnOrderPersistence({
9710
9781
  }
9711
9782
 
9712
9783
  // src/components/DataTable/hooks/useColumnVisibilityPersistence.ts
9713
- import { useState as useState6, useEffect as useEffect7, useCallback as useCallback4 } from "react";
9784
+ import { useState as useState6, useEffect as useEffect7, useCallback as useCallback3 } from "react";
9714
9785
  function useColumnVisibilityPersistence({
9715
9786
  tableId,
9716
9787
  defaultVisibility = {},
@@ -9740,7 +9811,7 @@ function useColumnVisibilityPersistence({
9740
9811
  setIsLoaded(true);
9741
9812
  }
9742
9813
  }, [enablePersistence, finalStorageKey]);
9743
- const saveColumnVisibility = useCallback4((newVisibility) => {
9814
+ const saveColumnVisibility = useCallback3((newVisibility) => {
9744
9815
  if (!enablePersistence || typeof window === "undefined") return;
9745
9816
  try {
9746
9817
  localStorage.setItem(finalStorageKey, JSON.stringify(newVisibility));
@@ -9748,11 +9819,11 @@ function useColumnVisibilityPersistence({
9748
9819
  logger2.warn("Failed to save column visibility to localStorage:", error);
9749
9820
  }
9750
9821
  }, [enablePersistence, finalStorageKey]);
9751
- const updateColumnVisibility = useCallback4((newVisibility) => {
9822
+ const updateColumnVisibility = useCallback3((newVisibility) => {
9752
9823
  setColumnVisibility(newVisibility);
9753
9824
  saveColumnVisibility(newVisibility);
9754
9825
  }, [saveColumnVisibility]);
9755
- const resetColumnVisibility = useCallback4(() => {
9826
+ const resetColumnVisibility = useCallback3(() => {
9756
9827
  setColumnVisibility(defaultVisibility);
9757
9828
  if (enablePersistence && typeof window !== "undefined") {
9758
9829
  try {
@@ -9762,7 +9833,7 @@ function useColumnVisibilityPersistence({
9762
9833
  }
9763
9834
  }
9764
9835
  }, [defaultVisibility, enablePersistence, finalStorageKey]);
9765
- const clearAllPreferences = useCallback4(() => {
9836
+ const clearAllPreferences = useCallback3(() => {
9766
9837
  if (!enablePersistence || typeof window === "undefined") return;
9767
9838
  try {
9768
9839
  const keys = Object.keys(localStorage);
@@ -9785,7 +9856,7 @@ function useColumnVisibilityPersistence({
9785
9856
  }
9786
9857
 
9787
9858
  // src/components/DataTable/hooks/useDataTableState.ts
9788
- import { useReducer, useCallback as useCallback5, useMemo as useMemo6 } from "react";
9859
+ import { useReducer, useCallback as useCallback4, useMemo as useMemo6 } from "react";
9789
9860
  function dataTableReducer(state, action) {
9790
9861
  switch (action.type) {
9791
9862
  case "SET_SORTING":
@@ -9921,7 +9992,7 @@ function useDataTableState({
9921
9992
  hasFilters: state.columnFilters.length > 0 || state.searchQuery !== "",
9922
9993
  canClearFilters: state.columnFilters.length > 0 || state.searchQuery !== ""
9923
9994
  }), [state]);
9924
- const clearFilters = useCallback5(() => {
9995
+ const clearFilters = useCallback4(() => {
9925
9996
  dispatch({ type: "SET_COLUMN_FILTERS", payload: [] });
9926
9997
  dispatch({ type: "SET_SEARCH_QUERY", payload: "" });
9927
9998
  }, []);
@@ -9937,7 +10008,7 @@ function useDataTableState({
9937
10008
  import { useMemo as useMemo8 } from "react";
9938
10009
 
9939
10010
  // src/components/DataTable/hooks/useHierarchicalState.ts
9940
- import { useState as useState7, useCallback as useCallback6, useMemo as useMemo7, useEffect as useEffect8 } from "react";
10011
+ import { useState as useState7, useCallback as useCallback5, useMemo as useMemo7, useEffect as useEffect8 } from "react";
9941
10012
  function useHierarchicalState(data, config) {
9942
10013
  const initialExpandedState = useMemo7(() => {
9943
10014
  if (!config?.defaultExpanded) {
@@ -9999,7 +10070,7 @@ function useHierarchicalState(data, config) {
9999
10070
  }
10000
10071
  return visible;
10001
10072
  }, [data, expandedRows, parentChildMap]);
10002
- const toggleRow = useCallback6((rowId) => {
10073
+ const toggleRow = useCallback5((rowId) => {
10003
10074
  setExpandedRows((prev) => {
10004
10075
  const newSet = new Set(prev);
10005
10076
  if (newSet.has(rowId)) {
@@ -10013,32 +10084,32 @@ function useHierarchicalState(data, config) {
10013
10084
  return newSet;
10014
10085
  });
10015
10086
  }, [config]);
10016
- const expandAll = useCallback6(() => {
10087
+ const expandAll = useCallback5(() => {
10017
10088
  const parentIds = data.filter((row) => row.isParent).map((row) => row.id);
10018
10089
  setExpandedRows(new Set(parentIds));
10019
10090
  if (config?.onExpandedChange) {
10020
10091
  config.onExpandedChange(parentIds);
10021
10092
  }
10022
10093
  }, [data, config]);
10023
- const collapseAll = useCallback6(() => {
10094
+ const collapseAll = useCallback5(() => {
10024
10095
  setExpandedRows(/* @__PURE__ */ new Set());
10025
10096
  if (config?.onExpandedChange) {
10026
10097
  config.onExpandedChange([]);
10027
10098
  }
10028
10099
  }, [config]);
10029
- const isExpanded = useCallback6((rowId) => {
10100
+ const isExpanded = useCallback5((rowId) => {
10030
10101
  return expandedRows.has(rowId);
10031
10102
  }, [expandedRows]);
10032
- const hasChildren = useCallback6((rowId) => {
10103
+ const hasChildren = useCallback5((rowId) => {
10033
10104
  return parentChildMap.has(rowId) && (parentChildMap.get(rowId)?.length || 0) > 0;
10034
10105
  }, [parentChildMap]);
10035
- const getChildrenCount = useCallback6((rowId) => {
10106
+ const getChildrenCount = useCallback5((rowId) => {
10036
10107
  return parentChildMap.get(rowId)?.length || 0;
10037
10108
  }, [parentChildMap]);
10038
- const getExpandedIds = useCallback6(() => {
10109
+ const getExpandedIds = useCallback5(() => {
10039
10110
  return Array.from(expandedRows);
10040
10111
  }, [expandedRows]);
10041
- const setExpandedIds = useCallback6((ids) => {
10112
+ const setExpandedIds = useCallback5((ids) => {
10042
10113
  setExpandedRows(new Set(ids));
10043
10114
  }, []);
10044
10115
  return {
@@ -10219,7 +10290,7 @@ function useDataTableDataPipeline({
10219
10290
  }
10220
10291
 
10221
10292
  // src/components/DataTable/hooks/useServerSideDataEffect.ts
10222
- import { useCallback as useCallback7, useEffect as useEffect9 } from "react";
10293
+ import { useCallback as useCallback6, useEffect as useEffect9 } from "react";
10223
10294
  function useServerSideDataEffect({
10224
10295
  finalPaginationMode,
10225
10296
  serverSide,
@@ -10232,7 +10303,7 @@ function useServerSideDataEffect({
10232
10303
  fetchServerData,
10233
10304
  cleanup
10234
10305
  }) {
10235
- const handleServerSideChange = useCallback7(async () => {
10306
+ const handleServerSideChange = useCallback6(async () => {
10236
10307
  if (finalPaginationMode !== "server" || !serverSide) {
10237
10308
  return;
10238
10309
  }
@@ -10299,7 +10370,7 @@ function useEffectiveColumnOrder({
10299
10370
  }
10300
10371
 
10301
10372
  // src/components/DataTable/hooks/useTableHandlers.ts
10302
- import { useCallback as useCallback8, useMemo as useMemo10 } from "react";
10373
+ import { useCallback as useCallback7, useMemo as useMemo10 } from "react";
10303
10374
  function useTableHandlers({
10304
10375
  state,
10305
10376
  stateSnapshot,
@@ -10313,15 +10384,15 @@ function useTableHandlers({
10313
10384
  updateColumnOrder,
10314
10385
  onLayoutChange
10315
10386
  }) {
10316
- const handleSortingChange = useCallback8((updaterOrValue) => {
10387
+ const handleSortingChange = useCallback7((updaterOrValue) => {
10317
10388
  const nextValue = typeof updaterOrValue === "function" ? updaterOrValue(stateSnapshot.sorting) : updaterOrValue;
10318
10389
  actions.setSorting(nextValue);
10319
10390
  }, [actions, stateSnapshot.sorting]);
10320
- const handleColumnFiltersChange = useCallback8((updaterOrValue) => {
10391
+ const handleColumnFiltersChange = useCallback7((updaterOrValue) => {
10321
10392
  const nextValue = typeof updaterOrValue === "function" ? updaterOrValue(stateSnapshot.columnFilters) : updaterOrValue;
10322
10393
  actions.setColumnFilters(nextValue);
10323
10394
  }, [actions, stateSnapshot.columnFilters]);
10324
- const handleColumnVisibilityChange = useCallback8((updaterOrValue) => {
10395
+ const handleColumnVisibilityChange = useCallback7((updaterOrValue) => {
10325
10396
  const nextValue = typeof updaterOrValue === "function" ? updaterOrValue(stateSnapshot.columnVisibility) : updaterOrValue;
10326
10397
  actions.setColumnVisibility(nextValue);
10327
10398
  if (canPersistVisibility) {
@@ -10332,7 +10403,7 @@ function useTableHandlers({
10332
10403
  columnVisibility: nextValue
10333
10404
  });
10334
10405
  }, [actions, stateSnapshot.columnVisibility, canPersistVisibility, updateSavedColumnVisibility, onLayoutChange, effectiveColumnOrder]);
10335
- const handleRowSelectionChange = useCallback8((updaterOrValue) => {
10406
+ const handleRowSelectionChange = useCallback7((updaterOrValue) => {
10336
10407
  const currentSelection = selection ?? state.rowSelection;
10337
10408
  const nextSelection = typeof updaterOrValue === "function" ? updaterOrValue(currentSelection) : updaterOrValue;
10338
10409
  if (selection === void 0) {
@@ -10342,19 +10413,19 @@ function useTableHandlers({
10342
10413
  }
10343
10414
  onRowSelectionChange?.(nextSelection);
10344
10415
  }, [actions, selection, state.rowSelection, onRowSelectionChange]);
10345
- const handleGroupingChange = useCallback8((updaterOrValue) => {
10416
+ const handleGroupingChange = useCallback7((updaterOrValue) => {
10346
10417
  const nextValue = typeof updaterOrValue === "function" ? updaterOrValue(stateSnapshot.grouping) : updaterOrValue;
10347
10418
  actions.setGrouping(nextValue);
10348
10419
  }, [actions, stateSnapshot.grouping]);
10349
- const handleExpandedChange = useCallback8((updaterOrValue) => {
10420
+ const handleExpandedChange = useCallback7((updaterOrValue) => {
10350
10421
  const nextValue = typeof updaterOrValue === "function" ? updaterOrValue(stateSnapshot.expanded) : updaterOrValue;
10351
10422
  actions.setExpanded(nextValue);
10352
10423
  }, [actions, stateSnapshot.expanded]);
10353
- const handlePaginationChange = useCallback8((updaterOrValue) => {
10424
+ const handlePaginationChange = useCallback7((updaterOrValue) => {
10354
10425
  const nextValue = typeof updaterOrValue === "function" ? updaterOrValue(stateSnapshot.pagination) : updaterOrValue;
10355
10426
  actions.setPagination(nextValue);
10356
10427
  }, [actions, stateSnapshot.pagination]);
10357
- const handleColumnOrderChange = useCallback8((updaterOrValue) => {
10428
+ const handleColumnOrderChange = useCallback7((updaterOrValue) => {
10358
10429
  const nextValue = typeof updaterOrValue === "function" ? updaterOrValue(stateSnapshot.columnOrder) : updaterOrValue;
10359
10430
  const normalizedOrder = nextValue.includes("select") ? ["select", ...nextValue.filter((id) => id !== "select")] : nextValue;
10360
10431
  actions.setColumnOrder(normalizedOrder);
@@ -10898,7 +10969,7 @@ function exportToCSV(data, columns, filename = "download.csv", options = {}) {
10898
10969
  }
10899
10970
 
10900
10971
  // src/components/DataTable/hooks/useDataTablePermissions.ts
10901
- import { useMemo as useMemo12, useRef as useRef4 } from "react";
10972
+ import { useMemo as useMemo12, useRef as useRef4, useState as useState8, useEffect as useEffect10 } from "react";
10902
10973
 
10903
10974
  // src/components/DataTable/types.ts
10904
10975
  var defaultDataTableFeatures = {
@@ -10930,6 +11001,28 @@ function useDataTablePermissions(rbac, features = {}) {
10930
11001
  const logger2 = createLogger("DataTablePermissions");
10931
11002
  const authResult = useUnifiedAuth();
10932
11003
  const user = authResult.user;
11004
+ const [isSuperAdminUser, setIsSuperAdminUser] = useState8(false);
11005
+ const [isCheckingSuperAdmin, setIsCheckingSuperAdmin] = useState8(false);
11006
+ useEffect10(() => {
11007
+ const checkSuperAdminStatus = async () => {
11008
+ if (!user?.id) {
11009
+ setIsSuperAdminUser(false);
11010
+ setIsCheckingSuperAdmin(false);
11011
+ return;
11012
+ }
11013
+ setIsCheckingSuperAdmin(true);
11014
+ try {
11015
+ const superAdminStatus = await isSuperAdmin(user.id);
11016
+ setIsSuperAdminUser(superAdminStatus);
11017
+ } catch (error) {
11018
+ logger2.error("useDataTablePermissions", "Error checking super admin status", { userId: user?.id, error });
11019
+ setIsSuperAdminUser(false);
11020
+ } finally {
11021
+ setIsCheckingSuperAdmin(false);
11022
+ }
11023
+ };
11024
+ checkSuperAdminStatus();
11025
+ }, [user?.id, logger2]);
10933
11026
  const pageId = rbac?.pageId;
10934
11027
  const pageName = rbac?.pageName;
10935
11028
  if (!pageId && !pageName) {
@@ -10974,16 +11067,38 @@ function useDataTablePermissions(rbac, features = {}) {
10974
11067
  const updatePermission = `update:page.${effectivePageId}`;
10975
11068
  const deletePermission = `delete:page.${effectivePageId}`;
10976
11069
  const consistentScope = effectiveScope || { organisationId: void 0, eventId: void 0, appId: void 0 };
10977
- const permissions = {
10978
- canRead: useCan(userId, consistentScope, readPermission, effectivePageId, true),
10979
- canCreate: useCan(userId, consistentScope, createPermission, effectivePageId, true),
10980
- canUpdate: useCan(userId, consistentScope, updatePermission, effectivePageId, true),
10981
- canDelete: useCan(userId, consistentScope, deletePermission, effectivePageId, true),
10982
- canExport: useCan(userId, consistentScope, readPermission, effectivePageId, true),
10983
- // Use read permission for export
10984
- canImport: useCan(userId, consistentScope, createPermission, effectivePageId, true)
10985
- // Use create permission for import
10986
- };
11070
+ const canReadResult = useCan(userId, consistentScope, readPermission, effectivePageId, true);
11071
+ const canCreateResult = useCan(userId, consistentScope, createPermission, effectivePageId, true);
11072
+ const canUpdateResult = useCan(userId, consistentScope, updatePermission, effectivePageId, true);
11073
+ const canDeleteResult = useCan(userId, consistentScope, deletePermission, effectivePageId, true);
11074
+ const canExportResult = useCan(userId, consistentScope, readPermission, effectivePageId, true);
11075
+ const canImportResult = useCan(userId, consistentScope, createPermission, effectivePageId, true);
11076
+ const permissions = useMemo12(() => {
11077
+ const createSuperAdminAwarePermission = (result) => ({
11078
+ can: isSuperAdminUser ? true : result.can,
11079
+ // Show loading if super admin check is in progress OR if the underlying permission check is loading
11080
+ isLoading: isCheckingSuperAdmin || result.isLoading,
11081
+ error: result.error,
11082
+ refetch: result.refetch
11083
+ });
11084
+ return {
11085
+ canRead: createSuperAdminAwarePermission(canReadResult),
11086
+ canCreate: createSuperAdminAwarePermission(canCreateResult),
11087
+ canUpdate: createSuperAdminAwarePermission(canUpdateResult),
11088
+ canDelete: createSuperAdminAwarePermission(canDeleteResult),
11089
+ canExport: createSuperAdminAwarePermission(canExportResult),
11090
+ canImport: createSuperAdminAwarePermission(canImportResult)
11091
+ };
11092
+ }, [
11093
+ isSuperAdminUser,
11094
+ isCheckingSuperAdmin,
11095
+ canReadResult,
11096
+ canCreateResult,
11097
+ canUpdateResult,
11098
+ canDeleteResult,
11099
+ canExportResult,
11100
+ canImportResult
11101
+ ]);
10987
11102
  const normalizedFeatures = useMemo12(
10988
11103
  () => normalizeDataTableFeatures(features),
10989
11104
  [features]
@@ -11407,7 +11522,7 @@ function getRowDescription(rowIndex, totalRows, isSelected = false, isEditing =
11407
11522
  }
11408
11523
 
11409
11524
  // src/components/DataTable/hooks/useKeyboardNavigation.ts
11410
- import { useCallback as useCallback9, useEffect as useEffect10, useRef as useRef5, useState as useState8 } from "react";
11525
+ import { useCallback as useCallback8, useEffect as useEffect11, useRef as useRef5, useState as useState9 } from "react";
11411
11526
  function useKeyboardNavigation(rowCount, columnCount, options = {}) {
11412
11527
  const {
11413
11528
  enabled = true,
@@ -11417,7 +11532,7 @@ function useKeyboardNavigation(rowCount, columnCount, options = {}) {
11417
11532
  onFocusChange,
11418
11533
  tableRef: externalTableRef
11419
11534
  } = options;
11420
- const [state, setState] = useState8({
11535
+ const [state, setState] = useState9({
11421
11536
  focusedRowIndex: 0,
11422
11537
  focusedColumnIndex: 0,
11423
11538
  isNavigating: false
@@ -11425,8 +11540,8 @@ function useKeyboardNavigation(rowCount, columnCount, options = {}) {
11425
11540
  const internalTableRef = useRef5(null);
11426
11541
  const tableRef = externalTableRef || internalTableRef;
11427
11542
  const storedFocusRef = useRef5(null);
11428
- const navigationTimeoutRef = useRef5();
11429
- const getCellElement = useCallback9((rowIndex, columnIndex) => {
11543
+ const navigationTimeoutRef = useRef5(void 0);
11544
+ const getCellElement = useCallback8((rowIndex, columnIndex) => {
11430
11545
  if (!tableRef.current) return null;
11431
11546
  const tbody = tableRef.current.querySelector("tbody");
11432
11547
  if (!tbody) return null;
@@ -11436,7 +11551,7 @@ function useKeyboardNavigation(rowCount, columnCount, options = {}) {
11436
11551
  const cells = row.querySelectorAll('td[role="cell"], th[role="columnheader"]');
11437
11552
  return cells[columnIndex] || null;
11438
11553
  }, []);
11439
- const getHeaderElement = useCallback9((columnIndex) => {
11554
+ const getHeaderElement = useCallback8((columnIndex) => {
11440
11555
  if (!tableRef.current) return null;
11441
11556
  const thead = tableRef.current.querySelector("thead");
11442
11557
  if (!thead) return null;
@@ -11445,7 +11560,7 @@ function useKeyboardNavigation(rowCount, columnCount, options = {}) {
11445
11560
  const headers = headerRow.querySelectorAll('th[role="columnheader"]');
11446
11561
  return headers[columnIndex] || null;
11447
11562
  }, []);
11448
- const focusCell = useCallback9((rowIndex, columnIndex) => {
11563
+ const focusCell = useCallback8((rowIndex, columnIndex) => {
11449
11564
  if (!enabled) return;
11450
11565
  const clampedRowIndex = Math.max(0, Math.min(rowIndex, rowCount - 1));
11451
11566
  const clampedColumnIndex = Math.max(0, Math.min(columnIndex, columnCount - 1));
@@ -11464,7 +11579,7 @@ function useKeyboardNavigation(rowCount, columnCount, options = {}) {
11464
11579
  announce(`Row ${clampedRowIndex + 1}, Column ${clampedColumnIndex + 1}`);
11465
11580
  }
11466
11581
  }, [enabled, rowCount, columnCount, getCellElement, onFocusChange, announceNavigation]);
11467
- const focusNext = useCallback9(() => {
11582
+ const focusNext = useCallback8(() => {
11468
11583
  const { focusedRowIndex, focusedColumnIndex } = state;
11469
11584
  if (focusedColumnIndex < columnCount - 1) {
11470
11585
  focusCell(focusedRowIndex, focusedColumnIndex + 1);
@@ -11472,7 +11587,7 @@ function useKeyboardNavigation(rowCount, columnCount, options = {}) {
11472
11587
  focusCell(focusedRowIndex + 1, 0);
11473
11588
  }
11474
11589
  }, [state, columnCount, rowCount, focusCell]);
11475
- const focusPrevious = useCallback9(() => {
11590
+ const focusPrevious = useCallback8(() => {
11476
11591
  const { focusedRowIndex, focusedColumnIndex } = state;
11477
11592
  if (focusedColumnIndex > 0) {
11478
11593
  focusCell(focusedRowIndex, focusedColumnIndex - 1);
@@ -11480,37 +11595,37 @@ function useKeyboardNavigation(rowCount, columnCount, options = {}) {
11480
11595
  focusCell(focusedRowIndex - 1, columnCount - 1);
11481
11596
  }
11482
11597
  }, [state, columnCount, focusCell]);
11483
- const focusUp = useCallback9(() => {
11598
+ const focusUp = useCallback8(() => {
11484
11599
  const { focusedRowIndex, focusedColumnIndex } = state;
11485
11600
  if (focusedRowIndex > 0) {
11486
11601
  focusCell(focusedRowIndex - 1, focusedColumnIndex);
11487
11602
  }
11488
11603
  }, [state, focusCell]);
11489
- const focusDown = useCallback9(() => {
11604
+ const focusDown = useCallback8(() => {
11490
11605
  const { focusedRowIndex, focusedColumnIndex } = state;
11491
11606
  if (focusedRowIndex < rowCount - 1) {
11492
11607
  focusCell(focusedRowIndex + 1, focusedColumnIndex);
11493
11608
  }
11494
11609
  }, [state, rowCount, focusCell]);
11495
- const focusRowStart = useCallback9(() => {
11610
+ const focusRowStart = useCallback8(() => {
11496
11611
  const { focusedRowIndex } = state;
11497
11612
  focusCell(focusedRowIndex, 0);
11498
11613
  }, [state, focusCell]);
11499
- const focusRowEnd = useCallback9(() => {
11614
+ const focusRowEnd = useCallback8(() => {
11500
11615
  const { focusedRowIndex } = state;
11501
11616
  focusCell(focusedRowIndex, columnCount - 1);
11502
11617
  }, [state, columnCount, focusCell]);
11503
- const focusTableStart = useCallback9(() => {
11618
+ const focusTableStart = useCallback8(() => {
11504
11619
  focusCell(0, 0);
11505
11620
  }, [focusCell]);
11506
- const focusTableEnd = useCallback9(() => {
11621
+ const focusTableEnd = useCallback8(() => {
11507
11622
  focusCell(rowCount - 1, columnCount - 1);
11508
11623
  }, [rowCount, columnCount, focusCell]);
11509
- const getCellTabIndex = useCallback9((rowIndex, columnIndex) => {
11624
+ const getCellTabIndex = useCallback8((rowIndex, columnIndex) => {
11510
11625
  if (!enabled) return -1;
11511
11626
  return state.focusedRowIndex === rowIndex && state.focusedColumnIndex === columnIndex ? 0 : -1;
11512
11627
  }, [enabled, state.focusedRowIndex, state.focusedColumnIndex]);
11513
- const getCellKeyboardHandlers = useCallback9((rowIndex, columnIndex) => {
11628
+ const getCellKeyboardHandlers = useCallback8((rowIndex, columnIndex) => {
11514
11629
  const onKeyDown = (event) => {
11515
11630
  if (!enabled) return;
11516
11631
  switch (event.key) {
@@ -11590,7 +11705,7 @@ function useKeyboardNavigation(rowCount, columnCount, options = {}) {
11590
11705
  };
11591
11706
  return { onKeyDown, onFocus, onBlur };
11592
11707
  }, [enabled, focusNext, focusPrevious, focusUp, focusDown, focusRowStart, focusRowEnd, focusTableStart, focusTableEnd, onFocusChange]);
11593
- const getHeaderKeyboardHandlers = useCallback9((columnIndex, onSort) => {
11708
+ const getHeaderKeyboardHandlers = useCallback8((columnIndex, onSort) => {
11594
11709
  const onKeyDown = (event) => {
11595
11710
  if (!enabled) return;
11596
11711
  switch (event.key) {
@@ -11648,27 +11763,27 @@ function useKeyboardNavigation(rowCount, columnCount, options = {}) {
11648
11763
  };
11649
11764
  return { onKeyDown, onFocus };
11650
11765
  }, [enabled, getHeaderElement, columnCount, supportsColumnReorder, supportsColumnResize]);
11651
- const resetFocus = useCallback9(() => {
11766
+ const resetFocus = useCallback8(() => {
11652
11767
  setState({
11653
11768
  focusedRowIndex: 0,
11654
11769
  focusedColumnIndex: 0,
11655
11770
  isNavigating: false
11656
11771
  });
11657
11772
  }, []);
11658
- const storeFocus = useCallback9(() => {
11773
+ const storeFocus = useCallback8(() => {
11659
11774
  storedFocusRef.current = {
11660
11775
  rowIndex: state.focusedRowIndex,
11661
11776
  columnIndex: state.focusedColumnIndex
11662
11777
  };
11663
11778
  }, [state.focusedRowIndex, state.focusedColumnIndex]);
11664
- const restoreFocus = useCallback9(() => {
11779
+ const restoreFocus = useCallback8(() => {
11665
11780
  if (storedFocusRef.current) {
11666
11781
  const { rowIndex, columnIndex } = storedFocusRef.current;
11667
11782
  focusCell(rowIndex, columnIndex);
11668
11783
  storedFocusRef.current = null;
11669
11784
  }
11670
11785
  }, [focusCell]);
11671
- useEffect10(() => {
11786
+ useEffect11(() => {
11672
11787
  return () => {
11673
11788
  if (navigationTimeoutRef.current) {
11674
11789
  clearTimeout(navigationTimeoutRef.current);
@@ -11764,7 +11879,7 @@ function DataTableInternal(props) {
11764
11879
  storageKey,
11765
11880
  onLayoutChange
11766
11881
  } = props;
11767
- const logger2 = React20.useMemo(() => createLogger("DataTableCore"), []);
11882
+ const logger2 = createLogger("DataTableCore");
11768
11883
  const authResult = useUnifiedAuth();
11769
11884
  const user = authResult.user;
11770
11885
  const requestedFeatures = useMemo14(
@@ -11801,21 +11916,21 @@ function DataTableInternal(props) {
11801
11916
  defaultSorting: defaultSorting || [],
11802
11917
  defaultGrouping: defaultGrouping || []
11803
11918
  });
11804
- useEffect11(() => {
11919
+ useEffect12(() => {
11805
11920
  if (secureFeatures.columnVisibility && isColumnVisibilityLoaded && Object.keys(initialColumnVisibility).length > 0) {
11806
11921
  stateActions.setColumnVisibility(initialColumnVisibility);
11807
11922
  }
11808
11923
  }, [secureFeatures.columnVisibility, isColumnVisibilityLoaded, initialColumnVisibility, stateActions]);
11809
- useEffect11(() => {
11924
+ useEffect12(() => {
11810
11925
  initializeLiveRegion();
11811
11926
  }, []);
11812
11927
  const rowSelection = selection !== void 0 ? selection : state.rowSelection;
11813
- const resolvedGetRowId = useCallback10(
11928
+ const resolvedGetRowId = useCallback9(
11814
11929
  (row, index) => getRowIdSafe(row, index, getRowId),
11815
11930
  [getRowId]
11816
11931
  );
11817
11932
  const hasInitializedExpansion = useRef6(false);
11818
- useEffect11(() => {
11933
+ useEffect12(() => {
11819
11934
  if (!hasInitializedExpansion.current && defaultGrouping && defaultGrouping.length > 0) {
11820
11935
  stateActions.setExpanded(true);
11821
11936
  hasInitializedExpansion.current = true;
@@ -11868,7 +11983,7 @@ function DataTableInternal(props) {
11868
11983
  );
11869
11984
  const lastFocusedElementRef = useRef6(null);
11870
11985
  const wasImportModalOpenRef = useRef6(false);
11871
- useEffect11(() => {
11986
+ useEffect12(() => {
11872
11987
  if (state.showImportModal) {
11873
11988
  wasImportModalOpenRef.current = true;
11874
11989
  keyboardNavigation.storeFocus();
@@ -11877,7 +11992,7 @@ function DataTableInternal(props) {
11877
11992
  }
11878
11993
  }
11879
11994
  }, [state.showImportModal, keyboardNavigation]);
11880
- useEffect11(() => {
11995
+ useEffect12(() => {
11881
11996
  if (!state.showImportModal) {
11882
11997
  if (!wasImportModalOpenRef.current) {
11883
11998
  return;
@@ -11908,7 +12023,7 @@ function DataTableInternal(props) {
11908
12023
  finalPaginationMode,
11909
12024
  serverData
11910
12025
  });
11911
- useEffect11(() => {
12026
+ useEffect12(() => {
11912
12027
  if (!hierarchicalValidation.isValid) {
11913
12028
  logger2.error("Hierarchical data validation failed:", hierarchicalValidation.errors);
11914
12029
  }
@@ -11923,13 +12038,13 @@ function DataTableInternal(props) {
11923
12038
  enablePersistence: secureFeatures.columnReordering,
11924
12039
  storageKey
11925
12040
  });
11926
- useEffect11(() => {
12041
+ useEffect12(() => {
11927
12042
  if (secureFeatures.columnReordering && isColumnOrderLoaded && savedColumnOrder && savedColumnOrder.length > 0) {
11928
12043
  const normalizedOrder = secureFeatures.selection && savedColumnOrder.includes("select") ? ["select", ...savedColumnOrder.filter((id) => id !== "select")] : savedColumnOrder;
11929
12044
  stateActions.setColumnOrder(normalizedOrder);
11930
12045
  }
11931
12046
  }, [secureFeatures.columnReordering, secureFeatures.selection, isColumnOrderLoaded, savedColumnOrder, stateActions]);
11932
- useEffect11(() => {
12047
+ useEffect12(() => {
11933
12048
  if (secureFeatures.selection && state.columnOrder.includes("select") && state.columnOrder[0] !== "select") {
11934
12049
  const normalizedOrder = ["select", ...state.columnOrder.filter((id) => id !== "select")];
11935
12050
  stateActions.setColumnOrder(normalizedOrder);
@@ -11964,7 +12079,7 @@ function DataTableInternal(props) {
11964
12079
  }
11965
12080
  return state.pagination.pageSize;
11966
12081
  }, [state.pagination.pageSize, validatedInitialPageSize, secureFeatures.pagination, finalPageSizeOptions]);
11967
- useEffect11(() => {
12082
+ useEffect12(() => {
11968
12083
  if (secureFeatures.pagination && finalPageSizeOptions.length > 0) {
11969
12084
  const needsFix = !finalPageSizeOptions.includes(state.pagination.pageSize);
11970
12085
  const currentPageSize = effectivePageSize || validatedInitialPageSize;
@@ -11989,7 +12104,7 @@ function DataTableInternal(props) {
11989
12104
  finalDataCount
11990
12105
  ]);
11991
12106
  const isLoading = externalIsLoading || performanceLoading;
11992
- const handleSearch = useCallback10((value) => {
12107
+ const handleSearch = useCallback9((value) => {
11993
12108
  stateActions.setSearchQuery(value);
11994
12109
  setSearchQuery(value);
11995
12110
  if (secureFeatures.pagination) {
@@ -12521,7 +12636,7 @@ function DataTableCore(props) {
12521
12636
  // src/components/DataTable/DataTable.tsx
12522
12637
  import { jsx as jsx26 } from "react/jsx-runtime";
12523
12638
  function DataTable(props) {
12524
- const logger2 = React21.useMemo(() => createLogger("DataTable"), []);
12639
+ const logger2 = createLogger("DataTable");
12525
12640
  const { features, ...rest } = props;
12526
12641
  const normalizedFeatures = React21.useMemo(
12527
12642
  () => normalizeDataTableFeatures(features),
@@ -12804,4 +12919,4 @@ lodash/lodash.js:
12804
12919
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
12805
12920
  *)
12806
12921
  */
12807
- //# sourceMappingURL=chunk-ULHIJK66.js.map
12922
+ //# sourceMappingURL=chunk-T33XF5ZC.js.map