@jmruthers/pace-core 0.5.76 → 0.5.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/{RBACService-C4udt_Zp.d.ts → AuthService-Df3IozMG.d.ts} +10 -118
- package/dist/{DataTable-ntgmhO2W.d.ts → DataTable-BE0OXZKQ.d.ts} +9 -2
- package/dist/{DataTable-4GAVPIEG.js → DataTable-ETGVF4Y5.js} +50 -13
- package/dist/{PublicLoadingSpinner-BiNER8F5.d.ts → PublicLoadingSpinner-CnUaz0vG.d.ts} +5 -2
- package/dist/{UnifiedAuthProvider-Bj6YCf7c.d.ts → UnifiedAuthProvider-B391Aqum.d.ts} +42 -45
- package/dist/{UnifiedAuthProvider-3NKDOSOK.js → UnifiedAuthProvider-P5SOJAQ6.js} +4 -5
- package/dist/{api-DDMUKIUD.js → api-KG4A2X7P.js} +9 -3
- package/dist/{audit-6TOCAMKO.js → audit-65VNHEV2.js} +2 -2
- package/dist/{chunk-K34IM5CT.js → chunk-2OGV6IRV.js} +196 -626
- package/dist/chunk-2OGV6IRV.js.map +1 -0
- package/dist/{chunk-NTNILOBC.js → chunk-5BO3MI5Y.js} +4 -4
- package/dist/{chunk-XLZ7U46Z.js → chunk-CVMVPYAL.js} +9 -60
- package/dist/chunk-CVMVPYAL.js.map +1 -0
- package/dist/{chunk-URUTVZ7N.js → chunk-FL4ZCQLD.js} +2 -2
- package/dist/{chunk-LW7MMEAQ.js → chunk-FT2M4R4F.js} +2 -2
- package/dist/{chunk-5BSLGBYI.js → chunk-JCQZ6LA7.js} +2 -8
- package/dist/{chunk-5BSLGBYI.js.map → chunk-JCQZ6LA7.js.map} +1 -1
- package/dist/{chunk-KHJS6VIA.js → chunk-LRQ6RBJC.js} +157 -112
- package/dist/chunk-LRQ6RBJC.js.map +1 -0
- package/dist/{chunk-WN6XJWOS.js → chunk-MNJXXD6C.js} +274 -743
- package/dist/chunk-MNJXXD6C.js.map +1 -0
- package/dist/{chunk-KK73ZB4E.js → chunk-PTR5PMPE.js} +153 -132
- package/dist/chunk-PTR5PMPE.js.map +1 -0
- package/dist/{chunk-B2WTCLCV.js → chunk-Q7APDV6H.js} +18 -8
- package/dist/chunk-Q7APDV6H.js.map +1 -0
- package/dist/{chunk-A4FUBC7B.js → chunk-QGVSOUJ2.js} +2 -4
- package/dist/{chunk-A4FUBC7B.js.map → chunk-QGVSOUJ2.js.map} +1 -1
- package/dist/{chunk-FGMFQSHX.js → chunk-S63MFSY6.js} +500 -551
- package/dist/chunk-S63MFSY6.js.map +1 -0
- package/dist/{chunk-AFGTSUAD.js → chunk-VSOKOFRF.js} +4 -4
- package/dist/chunk-WUXCWRL6.js +20 -0
- package/dist/chunk-WUXCWRL6.js.map +1 -0
- package/dist/{chunk-Y6TXWPJO.js → chunk-YVVGHRGI.js} +105 -31
- package/dist/chunk-YVVGHRGI.js.map +1 -0
- package/dist/{chunk-M5IWZRBT.js → chunk-ZMNXIJP4.js} +2187 -981
- package/dist/chunk-ZMNXIJP4.js.map +1 -0
- package/dist/components.d.ts +6 -6
- package/dist/components.js +14 -18
- package/dist/components.js.map +1 -1
- package/dist/{database-C3Szpi5J.d.ts → database-BXAfr2Y_.d.ts} +18 -0
- package/dist/hooks.d.ts +5 -5
- package/dist/hooks.js +8 -9
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +19 -27
- package/dist/index.js +21 -29
- package/dist/index.js.map +1 -1
- package/dist/{organisation-BtshODVF.d.ts → organisation-D6qRDtbF.d.ts} +1 -1
- package/dist/providers.d.ts +7 -21
- package/dist/providers.js +3 -10
- package/dist/rbac/index.d.ts +71 -221
- package/dist/rbac/index.js +15 -16
- package/dist/{types-CGX9Vyf5.d.ts → types-BDg1mAGG.d.ts} +36 -6
- package/dist/types.d.ts +3 -3
- package/dist/types.js +61 -18
- package/dist/types.js.map +1 -1
- package/dist/{unified-CM7T0aTK.d.ts → unified-DQ4VcT7H.d.ts} +1 -1
- package/dist/{usePublicRouteParams-B-CumWRc.d.ts → usePublicRouteParams-BlgwXweB.d.ts} +3 -3
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +52 -9
- package/dist/utils.js.map +1 -1
- package/docs/CONTENT_AUDIT_REPORT.md +253 -0
- package/docs/DOCUMENTATION_AUDIT.md +172 -0
- package/docs/README.md +142 -147
- package/docs/STYLE_GUIDE.md +37 -0
- package/docs/api/classes/ColumnFactory.md +17 -17
- package/docs/api/classes/ErrorBoundary.md +1 -1
- package/docs/api/classes/InvalidScopeError.md +4 -4
- package/docs/api/classes/MissingUserContextError.md +4 -4
- package/docs/api/classes/OrganisationContextRequiredError.md +4 -4
- package/docs/api/classes/PermissionDeniedError.md +5 -5
- package/docs/api/classes/PublicErrorBoundary.md +1 -1
- package/docs/api/classes/RBACAuditManager.md +8 -8
- package/docs/api/classes/RBACCache.md +35 -5
- package/docs/api/classes/RBACEngine.md +49 -20
- package/docs/api/classes/RBACError.md +4 -4
- package/docs/api/classes/RBACNotInitializedError.md +4 -4
- package/docs/api/classes/SecureSupabaseClient.md +1 -1
- package/docs/api/classes/StorageUtils.md +1 -1
- package/docs/api/enums/FileCategory.md +1 -1
- package/docs/api/interfaces/AggregateConfig.md +4 -4
- package/docs/api/interfaces/ButtonProps.md +1 -1
- package/docs/api/interfaces/CardProps.md +1 -1
- package/docs/api/interfaces/ColorPalette.md +1 -1
- package/docs/api/interfaces/ColorShade.md +1 -1
- package/docs/api/interfaces/DataAccessRecord.md +1 -1
- package/docs/api/interfaces/DataRecord.md +11 -0
- package/docs/api/interfaces/DataTableAction.md +65 -29
- package/docs/api/interfaces/DataTableColumn.md +36 -23
- package/docs/api/interfaces/DataTableProps.md +80 -38
- package/docs/api/interfaces/DataTableToolbarButton.md +7 -7
- package/docs/api/interfaces/EmptyStateConfig.md +5 -5
- package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
- package/docs/api/interfaces/EventLogoProps.md +1 -1
- package/docs/api/interfaces/FileDisplayProps.md +1 -1
- package/docs/api/interfaces/FileMetadata.md +1 -1
- package/docs/api/interfaces/FileReference.md +1 -1
- package/docs/api/interfaces/FileSizeLimits.md +1 -1
- package/docs/api/interfaces/FileUploadOptions.md +1 -1
- package/docs/api/interfaces/FileUploadProps.md +1 -1
- package/docs/api/interfaces/FooterProps.md +1 -1
- package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
- package/docs/api/interfaces/InputProps.md +1 -1
- package/docs/api/interfaces/LabelProps.md +1 -1
- package/docs/api/interfaces/LoginFormProps.md +1 -1
- package/docs/api/interfaces/NavigationAccessRecord.md +11 -11
- package/docs/api/interfaces/NavigationContextType.md +9 -9
- package/docs/api/interfaces/NavigationGuardProps.md +1 -1
- package/docs/api/interfaces/NavigationItem.md +1 -1
- package/docs/api/interfaces/NavigationMenuProps.md +1 -1
- package/docs/api/interfaces/NavigationProviderProps.md +7 -7
- package/docs/api/interfaces/Organisation.md +1 -1
- package/docs/api/interfaces/OrganisationContextType.md +1 -1
- package/docs/api/interfaces/OrganisationMembership.md +1 -1
- package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
- package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
- package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
- package/docs/api/interfaces/PaceLoginPageProps.md +16 -3
- package/docs/api/interfaces/PageAccessRecord.md +1 -1
- package/docs/api/interfaces/PagePermissionContextType.md +1 -1
- package/docs/api/interfaces/PagePermissionGuardProps.md +2 -2
- package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
- package/docs/api/interfaces/PaletteData.md +1 -1
- package/docs/api/interfaces/PermissionEnforcerProps.md +4 -4
- package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
- package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
- package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
- package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
- package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
- package/docs/api/interfaces/RBACConfig.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
- package/docs/api/interfaces/RouteAccessRecord.md +2 -2
- package/docs/api/interfaces/RouteConfig.md +2 -2
- package/docs/api/interfaces/SecureDataContextType.md +1 -1
- package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
- package/docs/api/interfaces/StorageConfig.md +1 -1
- package/docs/api/interfaces/StorageFileInfo.md +1 -1
- package/docs/api/interfaces/StorageFileMetadata.md +1 -1
- package/docs/api/interfaces/StorageListOptions.md +1 -1
- package/docs/api/interfaces/StorageListResult.md +1 -1
- package/docs/api/interfaces/StorageUploadOptions.md +1 -1
- package/docs/api/interfaces/StorageUploadResult.md +1 -1
- package/docs/api/interfaces/StorageUrlOptions.md +1 -1
- package/docs/api/interfaces/StyleImport.md +1 -1
- package/docs/api/interfaces/SwitchProps.md +1 -1
- package/docs/api/interfaces/ToastActionElement.md +1 -1
- package/docs/api/interfaces/ToastProps.md +1 -1
- package/docs/api/interfaces/UnifiedAuthContextType.md +94 -521
- package/docs/api/interfaces/UnifiedAuthProviderProps.md +16 -16
- package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
- package/docs/api/interfaces/UsePublicEventLogoOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventLogoReturn.md +1 -1
- package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
- package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeOptions.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
- package/docs/api/interfaces/UserEventAccess.md +11 -11
- package/docs/api/interfaces/UserMenuProps.md +1 -1
- package/docs/api/interfaces/UserProfile.md +1 -1
- package/docs/api/modules.md +251 -269
- package/docs/api-reference/components.md +193 -0
- package/docs/api-reference/hooks.md +265 -0
- package/docs/api-reference/providers.md +6 -0
- package/docs/api-reference/types.md +6 -0
- package/docs/api-reference/utilities.md +207 -0
- package/docs/architecture/README.md +6 -0
- package/docs/{database-schema-requirements.md → architecture/database-schema-requirements.md} +6 -0
- package/docs/architecture/rbac-security-architecture.md +258 -0
- package/docs/architecture/services.md +9 -1
- package/docs/best-practices/README.md +6 -0
- package/docs/best-practices/accessibility.md +6 -0
- package/docs/{common-patterns.md → best-practices/common-patterns.md} +6 -0
- package/docs/best-practices/deployment.md +6 -0
- package/docs/best-practices/performance.md +475 -2
- package/docs/best-practices/security.md +6 -0
- package/docs/best-practices/testing.md +6 -0
- package/docs/core-concepts/authentication.md +6 -0
- package/docs/core-concepts/events.md +6 -0
- package/docs/core-concepts/organisations.md +6 -0
- package/docs/core-concepts/permissions.md +6 -0
- package/docs/core-concepts/rbac-system.md +8 -0
- package/docs/documentation-index.md +121 -182
- package/docs/{consuming-app-vite-config.md → getting-started/consuming-app-vite-config.md} +6 -0
- package/docs/getting-started/documentation-index.md +40 -0
- package/docs/getting-started/examples/README.md +878 -35
- package/docs/{faq.md → getting-started/faq.md} +7 -1
- package/docs/getting-started/installation-guide.md +6 -0
- package/docs/{quick-reference.md → getting-started/quick-reference.md} +6 -0
- package/docs/implementation-guides/app-layout.md +6 -0
- package/docs/implementation-guides/authentication.md +1021 -0
- package/docs/implementation-guides/component-styling.md +6 -0
- package/docs/implementation-guides/data-tables.md +1264 -2076
- package/docs/implementation-guides/dynamic-colors.md +6 -0
- package/docs/implementation-guides/event-theming-summary.md +6 -0
- package/docs/{file-reference-system.md → implementation-guides/file-reference-system.md} +6 -0
- package/docs/implementation-guides/file-upload-storage.md +6 -0
- package/docs/implementation-guides/forms.md +6 -0
- package/docs/implementation-guides/inactivity-tracking.md +6 -0
- package/docs/implementation-guides/navigation.md +6 -0
- package/docs/implementation-guides/organisation-security.md +6 -0
- package/docs/implementation-guides/permission-enforcement.md +6 -0
- package/docs/implementation-guides/public-pages-advanced.md +6 -0
- package/docs/implementation-guides/public-pages.md +6 -0
- package/docs/migration/MIGRATION_GUIDE.md +827 -351
- package/docs/migration/README.md +7 -1
- package/docs/migration/organisation-context-timing-fix.md +6 -0
- package/docs/migration/rbac-migration.md +44 -1
- package/docs/migration/service-architecture.md +6 -0
- package/docs/migration/v0.4.15-tailwind-scanning.md +6 -0
- package/docs/migration/v0.4.16-css-first-approach.md +6 -0
- package/docs/migration/v0.4.17-source-path-fix.md +6 -0
- package/docs/rbac/README-rbac-rls-integration.md +6 -0
- package/docs/rbac/README.md +6 -0
- package/docs/rbac/advanced-patterns.md +6 -0
- package/docs/rbac/api-reference.md +7 -1
- package/docs/rbac/breaking-changes-v3.md +222 -0
- package/docs/rbac/examples/rbac-rls-integration-example.md +6 -0
- package/docs/rbac/examples.md +6 -0
- package/docs/rbac/getting-started.md +6 -0
- package/docs/rbac/migration-guide.md +260 -0
- package/docs/rbac/quick-start.md +70 -13
- package/docs/rbac/rbac-rls-integration.md +6 -0
- package/docs/rbac/super-admin-guide.md +6 -0
- package/docs/rbac/troubleshooting.md +6 -0
- package/docs/security/README.md +6 -0
- package/docs/security/checklist.md +6 -0
- package/docs/styles/README.md +7 -1
- package/docs/{usage.md → styles/usage.md} +6 -0
- package/docs/testing/README.md +6 -0
- package/docs/{visual-testing.md → testing/visual-testing.md} +6 -0
- package/docs/troubleshooting/README.md +387 -5
- package/docs/troubleshooting/cake-page-permission-guard-issue-summary.md +6 -0
- package/docs/troubleshooting/common-issues.md +6 -0
- package/docs/troubleshooting/database-view-compatibility.md +6 -0
- package/docs/troubleshooting/organisation-context-setup.md +6 -0
- package/docs/troubleshooting/react-hooks-issue-analysis.md +6 -0
- package/docs/troubleshooting/styling-issues.md +6 -0
- package/docs/troubleshooting/tailwind-content-scanning.md +6 -0
- package/package.json +1 -1
- package/src/__tests__/helpers/__tests__/test-providers.test.tsx +2 -1
- package/src/__tests__/helpers/test-providers.tsx +3 -53
- package/src/components/DataTable/DataTable.test.tsx +319 -0
- package/src/components/DataTable/DataTable.tsx +32 -11
- package/src/components/DataTable/__tests__/{DataTable.comprehensive.test.tsx → DataTable.comprehensive.test.tsx.skip} +6 -4
- package/src/components/DataTable/__tests__/{DataTable.test.tsx → DataTable.test.tsx.skip} +6 -4
- package/src/components/DataTable/__tests__/DataTableCore.test.tsx +31 -9
- package/src/components/DataTable/__tests__/a11y.basic.test.tsx +601 -0
- package/src/components/DataTable/__tests__/keyboard.test.tsx +615 -0
- package/src/components/DataTable/__tests__/pagination.modes.test.tsx +639 -0
- package/src/components/DataTable/__tests__/ssr.strict-mode.test.tsx.skip +330 -0
- package/src/components/DataTable/components/AccessDeniedPage.tsx +2 -2
- package/src/components/DataTable/components/ActionButtons.tsx +88 -104
- package/src/components/DataTable/components/DataTableCore.tsx +309 -337
- package/src/components/DataTable/components/DataTableErrorBoundary.tsx +4 -2
- package/src/components/DataTable/components/DataTableModals.tsx +22 -1
- package/src/components/DataTable/components/EditableRow.tsx +69 -84
- package/src/components/DataTable/components/EmptyState.tsx +5 -1
- package/src/components/DataTable/components/ImportModal.tsx +65 -36
- package/src/components/DataTable/components/PaginationControls.tsx +40 -100
- package/src/components/DataTable/components/UnifiedTableBody.tsx +125 -148
- package/src/components/DataTable/context/DataTableContext.tsx +1 -1
- package/src/components/DataTable/core/ColumnFactory.ts +5 -0
- package/src/components/DataTable/examples/HierarchicalActionsExample.tsx +12 -10
- package/src/components/DataTable/examples/HierarchicalExample.tsx +1 -1
- package/src/components/DataTable/examples/InitialPageSizeExample.tsx +1 -0
- package/src/components/DataTable/examples/PerformanceExample.tsx +1 -0
- package/src/components/DataTable/hooks/__tests__/useColumnOrderPersistence.test.ts +1 -5
- package/src/components/DataTable/hooks/__tests__/useColumnVisibilityPersistence.test.ts +167 -0
- package/src/components/DataTable/hooks/index.ts +7 -0
- package/src/components/DataTable/hooks/useColumnOrderPersistence.ts +32 -15
- package/src/components/DataTable/hooks/useColumnVisibilityPersistence.ts +102 -0
- package/src/components/DataTable/hooks/useDataTableConfiguration.ts +89 -0
- package/src/components/DataTable/hooks/useDataTableDataPipeline.ts +117 -0
- package/src/components/DataTable/hooks/useDataTablePermissions.ts +71 -27
- package/src/components/DataTable/hooks/useDataTableState.ts +39 -11
- package/src/components/DataTable/hooks/useEffectiveColumnOrder.ts +33 -0
- package/src/components/DataTable/hooks/useHierarchicalState.ts +15 -1
- package/src/components/DataTable/hooks/useKeyboardNavigation.ts +447 -0
- package/src/components/DataTable/hooks/useServerSideDataEffect.ts +94 -0
- package/src/components/DataTable/hooks/useTableColumns.ts +10 -7
- package/src/components/DataTable/hooks/useTableHandlers.ts +174 -0
- package/src/components/DataTable/index.ts +12 -3
- package/src/components/DataTable/types.ts +129 -9
- package/src/components/DataTable/utils/__tests__/exportUtils.test.ts +159 -22
- package/src/components/DataTable/utils/__tests__/flexibleImport.test.ts +111 -0
- package/src/components/DataTable/utils/__tests__/rowUtils.test.ts +15 -29
- package/src/components/DataTable/utils/a11yUtils.ts +244 -0
- package/src/components/DataTable/utils/debugTools.ts +609 -0
- package/src/components/DataTable/utils/exportUtils.ts +114 -16
- package/src/components/DataTable/utils/flexibleImport.ts +202 -32
- package/src/components/DataTable/utils/hierarchicalUtils.ts +1 -1
- package/src/components/DataTable/utils/index.ts +2 -0
- package/src/components/DataTable/utils/paginationUtils.ts +350 -0
- package/src/components/DataTable/utils/rowUtils.ts +6 -5
- package/src/components/NavigationMenu/NavigationMenu.test.tsx +19 -24
- package/src/components/NavigationMenu/NavigationMenu.tsx +19 -8
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.security.test.tsx +1 -23
- package/src/components/PaceLoginPage/PaceLoginPage.test.tsx +56 -6
- package/src/components/PaceLoginPage/PaceLoginPage.tsx +137 -13
- package/src/components/PublicLayout/__tests__/PublicPageHeader.test.tsx +1 -1
- package/src/components/Select/Select.tsx +1 -0
- package/src/components/examples/PermissionExample.tsx +173 -0
- package/src/examples/CorrectPublicPageImplementation.tsx +301 -0
- package/src/examples/PublicEventPage.tsx +274 -0
- package/src/examples/PublicPageApp.tsx +308 -0
- package/src/examples/PublicPageUsageExample.tsx +216 -0
- package/src/hooks/__tests__/useOrganisationPermissions.unit.test.tsx +12 -1
- package/src/hooks/__tests__/useOrganisationSecurity.unit.test.tsx +129 -17
- package/src/hooks/__tests__/useRBAC.unit.test.ts +151 -846
- package/src/hooks/useOrganisationPermissions.test.ts +42 -18
- package/src/hooks/useOrganisationPermissions.ts +12 -6
- package/src/hooks/useOrganisationSecurity.test.ts +138 -85
- package/src/hooks/useOrganisationSecurity.ts +41 -10
- package/src/index.ts +0 -1
- package/src/providers/AuthProvider.simplified.tsx +880 -0
- package/src/providers/UnifiedAuthProvider.test.simple.tsx +8 -8
- package/src/providers/__tests__/UnifiedAuthProvider.test.tsx +29 -19
- package/src/providers/index.ts +0 -1
- package/src/providers/services/EventServiceProvider.tsx +19 -15
- package/src/providers/services/InactivityServiceProvider.tsx +19 -15
- package/src/providers/services/OrganisationServiceProvider.tsx +19 -15
- package/src/providers/services/UnifiedAuthProvider.tsx +156 -127
- package/src/providers/services/__tests__/AuthServiceProvider.integration.test.tsx +1 -1
- package/src/providers/services/__tests__/UnifiedAuthProvider.integration.test.tsx +3 -3
- package/src/rbac/README.md +1 -1
- package/src/rbac/__tests__/adapters.comprehensive.test.tsx +25 -27
- package/src/rbac/__tests__/auth-rbac-security.integration.test.tsx +313 -0
- package/src/rbac/__tests__/engine.comprehensive.test.ts +114 -348
- package/src/rbac/__tests__/rbac-engine-core-logic.test.ts +28 -110
- package/src/rbac/__tests__/rbac-engine-simplified.test.ts +33 -85
- package/src/rbac/__tests__/scenarios.user-role.test.tsx +2 -2
- package/src/rbac/adapters.tsx +26 -69
- package/src/rbac/api.test.ts +90 -27
- package/src/rbac/api.ts +61 -10
- package/src/rbac/audit.test.ts +33 -38
- package/src/rbac/audit.ts +21 -6
- package/src/rbac/cache.ts +33 -1
- package/src/rbac/components/NavigationGuard.tsx +11 -11
- package/src/rbac/components/NavigationProvider.test.tsx +11 -5
- package/src/rbac/components/NavigationProvider.tsx +37 -13
- package/src/rbac/components/PagePermissionGuard.tsx +111 -50
- package/src/rbac/components/PagePermissionProvider.tsx +5 -5
- package/src/rbac/components/PermissionEnforcer.tsx +11 -11
- package/src/rbac/components/RoleBasedRouter.tsx +5 -5
- package/src/rbac/components/SecureDataProvider.tsx +5 -5
- package/src/rbac/components/__tests__/NavigationGuard.test.tsx +8 -8
- package/src/rbac/components/__tests__/PagePermissionGuard.test.tsx +14 -14
- package/src/rbac/components/__tests__/PermissionEnforcer.test.tsx +12 -12
- package/src/rbac/components/__tests__/RoleBasedRouter.test.tsx +6 -6
- package/src/rbac/engine.test.simple.ts +19 -13
- package/src/rbac/engine.test.ts +1 -0
- package/src/rbac/engine.ts +330 -766
- package/src/rbac/errors.ts +156 -0
- package/src/rbac/hooks/usePermissions.ts +32 -10
- package/src/rbac/hooks/useRBAC.test.ts +126 -512
- package/src/rbac/hooks/useRBAC.ts +147 -193
- package/src/rbac/hooks/useResolvedScope.ts +12 -0
- package/src/rbac/index.ts +7 -4
- package/src/rbac/security.ts +109 -18
- package/src/rbac/types.ts +12 -1
- package/src/services/AuthService.ts +2 -15
- package/src/services/EventService.ts +43 -46
- package/src/services/OrganisationService.ts +51 -31
- package/src/services/__tests__/AuthService.test.ts +1 -1
- package/src/services/__tests__/EventService.test.ts +1 -1
- package/src/services/__tests__/OrganisationService.test.ts +1 -1
- package/src/services/base/BaseService.ts +8 -0
- package/src/styles/base.css +208 -0
- package/src/styles/semantic.css +24 -0
- package/src/types/database.generated.ts +7347 -0
- package/src/types/database.ts +20 -0
- package/src/utils/logger.ts +179 -0
- package/src/utils/organisationContext.ts +11 -4
- package/src/utils/storage/__tests__/helpers.unit.test.ts +6 -2
- package/dist/appNameResolver-UURKN7NF.js +0 -22
- package/dist/audit-6TOCAMKO.js.map +0 -1
- package/dist/chunk-B2WTCLCV.js.map +0 -1
- package/dist/chunk-FGMFQSHX.js.map +0 -1
- package/dist/chunk-K34IM5CT.js.map +0 -1
- package/dist/chunk-KHJS6VIA.js.map +0 -1
- package/dist/chunk-KK73ZB4E.js.map +0 -1
- package/dist/chunk-M5IWZRBT.js.map +0 -1
- package/dist/chunk-ULBI5JGB.js +0 -109
- package/dist/chunk-ULBI5JGB.js.map +0 -1
- package/dist/chunk-WN6XJWOS.js.map +0 -1
- package/dist/chunk-XLZ7U46Z.js.map +0 -1
- package/dist/chunk-Y6TXWPJO.js.map +0 -1
- package/docs/DOCUMENTATION_CHECKLIST.md +0 -281
- package/docs/TERMINOLOGY.md +0 -231
- package/docs/api/interfaces/RBACContextType.md +0 -468
- package/docs/api/interfaces/RBACProviderProps.md +0 -107
- package/docs/best-practices/performance-expansion.md +0 -473
- package/docs/breaking-changes.md +0 -179
- package/docs/consuming-app-example.md +0 -290
- package/docs/documentation-templates.md +0 -539
- package/docs/examples/navigation-menu-auth-fix.md +0 -344
- package/docs/getting-started/examples/basic-auth-app.md +0 -520
- package/docs/getting-started/examples/full-featured-app.md +0 -616
- package/docs/getting-started/quick-start.md +0 -376
- package/docs/implementation-guides/datatable-filtering.md +0 -313
- package/docs/implementation-guides/datatable-rbac-usage.md +0 -317
- package/docs/implementation-guides/hierarchical-datatable.md +0 -850
- package/docs/implementation-guides/large-datasets.md +0 -281
- package/docs/implementation-guides/performance.md +0 -403
- package/docs/migration/quick-migration-guide.md +0 -320
- package/docs/migration-guide.md +0 -193
- package/docs/migration-guides/unified-auth-provider-mandatory-timeouts.md +0 -226
- package/docs/performance/README.md +0 -551
- package/docs/style-guide.md +0 -964
- package/docs/troubleshooting/authentication-issues.md +0 -334
- package/docs/troubleshooting/debugging.md +0 -1117
- package/docs/troubleshooting/migration.md +0 -918
- package/src/__tests__/hooks/usePermissions.test.ts +0 -261
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.rbac.test.tsx +0 -574
- package/src/hooks/__tests__/ServiceHooks.test.tsx +0 -613
- package/src/hooks/services/__tests__/useServiceHooks.test.tsx +0 -137
- package/src/hooks/services/usePermissions.ts +0 -70
- package/src/hooks/services/useRBACService.ts +0 -30
- package/src/hooks/usePermissionCheck.ts +0 -150
- package/src/providers/__tests__/ServiceProviders.test.tsx +0 -477
- package/src/providers/services/RBACServiceProvider.tsx +0 -79
- package/src/rbac/__tests__/integration.authflow.test.tsx +0 -119
- package/src/rbac/__tests__/integration.navigation.test.tsx +0 -69
- package/src/rbac/__tests__/integration.securedata.test.tsx +0 -92
- package/src/rbac/__tests__/integration.smoke.test.tsx +0 -73
- package/src/rbac/providers/RBACProvider.tsx +0 -645
- package/src/rbac/providers/__tests__/RBACProvider.integration.test.tsx +0 -688
- package/src/rbac/providers/__tests__/RBACProvider.test.tsx +0 -1186
- package/src/rbac/providers/index.ts +0 -11
- package/src/services/RBACService.ts +0 -522
- package/src/services/__tests__/RBACService.test.ts +0 -492
- package/src/services/interfaces/IRBACService.ts +0 -62
- package/src/utils/appNameResolver.test 2.ts +0 -494
- /package/dist/{DataTable-4GAVPIEG.js.map → DataTable-ETGVF4Y5.js.map} +0 -0
- /package/dist/{UnifiedAuthProvider-3NKDOSOK.js.map → UnifiedAuthProvider-P5SOJAQ6.js.map} +0 -0
- /package/dist/{api-DDMUKIUD.js.map → api-KG4A2X7P.js.map} +0 -0
- /package/dist/{appNameResolver-UURKN7NF.js.map → audit-65VNHEV2.js.map} +0 -0
- /package/dist/{chunk-NTNILOBC.js.map → chunk-5BO3MI5Y.js.map} +0 -0
- /package/dist/{chunk-URUTVZ7N.js.map → chunk-FL4ZCQLD.js.map} +0 -0
- /package/dist/{chunk-LW7MMEAQ.js.map → chunk-FT2M4R4F.js.map} +0 -0
- /package/dist/{chunk-AFGTSUAD.js.map → chunk-VSOKOFRF.js.map} +0 -0
- /package/docs/{app.css.example → styles/app.css.example} +0 -0
package/dist/components.d.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { A as Alert, m as AlertDescription, l as AlertTitle, n as Avatar, p as AvatarFallback, o as AvatarImage, B as Button, a as ButtonProps, C as Card, g as CardActions, i as CardActionsProps, f as CardContent, e as CardDescription, c as CardFooter, b as CardHeader, h as CardProps, d as CardTitle, q as Checkbox, b3 as DefaultPublicErrorFallback, D as Dialog, K as DialogBody, G as DialogClose, H as DialogContent, U as DialogContentProps, O as DialogDescription, Z as DialogDescriptionProps, M as DialogFooter, X as DialogFooterProps, J as DialogHeader, W as DialogHeaderProps, E as DialogOverlay, V as DialogOverlayProps, z as DialogPortal, Q as DialogProps, _ as DialogSize, N as DialogTitle, Y as DialogTitleProps, F as DialogTrigger, R as DialogTriggerProps, az as ErrorBoundary, aA as ErrorBoundaryProps, aB as ErrorBoundaryState, a_ as EventLogo, a$ as EventLogoCompact, b0 as EventLogoLarge, ba as EventLogoProps, aD as EventSelector, aF as FileDisplay, aG as FileDisplayProps, ar as Footer, as as FooterProps, am as Form, an as FormProps, aq as Header, I as Input, j as InputProps, L as Label, k as LabelProps, aC as LoadingSpinner, ao as LoginForm, ap as LoginFormProps, av as NavigationItem, at as NavigationMenu, au as NavigationMenuProps, aw as OrganisationSelector, ax as OrganisationSelectorProps, bf as PaceAppLayout, be as PaceAppLayoutProps, bh as PaceLoginPage, bg as PaceLoginPageProps, aE as PasswordResetForm, P as Progress, b1 as PublicErrorBoundary, bb as PublicErrorBoundaryProps, bc as PublicErrorBoundaryState, b6 as PublicLoadingSkeleton, b4 as PublicLoadingSpinner, b5 as PublicLoadingSpinnerFullPage, bd as PublicLoadingSpinnerProps, aZ as PublicPageContextChecker, aX as PublicPageDebugger, aY as PublicPageDiagnostic, aW as PublicPageFooter, b9 as PublicPageFooterProps, aS as PublicPageHeader, b8 as PublicPageHeaderProps, aQ as PublicPageLayout, b7 as PublicPageLayoutProps, aT as PublicPageProvider, $ as Select, a3 as SelectContent, a0 as SelectGroup, a5 as SelectItem, a4 as SelectLabel, a6 as SelectSeparator, a2 as SelectTrigger, a1 as SelectValue, S as Switch, r as SwitchProps, T as Table, t as TableBody, u as TableCaption, v as TableCell, w as TableFooter, x as TableHead, s as TableHeader, y as TableRow, a7 as Toast, a9 as ToastAction, af as ToastActionElement, ae as ToastClose, ad as ToastDescription, ag as ToastProps, aa as ToastProvider, ac as ToastTitle, ab as ToastViewport, a8 as Toaster, ah as Tooltip, aj as TooltipContent, ak as TooltipProvider, al as TooltipRoot, ai as TooltipTrigger, aP as UseFileReferenceForRecordReturn, aN as UseFileReferenceOptions, aO as UseFileReferenceReturn, aJ as UseStorageOptions, aK as UseStorageReturn, ay as UserMenu, b2 as useErrorBoundary, aL as useFileReference, aM as useFileReferenceForRecord, aI as useFileUpload, aV as useIsPublicPage, aR as usePublicPageContext, aU as usePublicPageProviderContext, aH as useStorage } from './PublicLoadingSpinner-
|
|
1
|
+
export { a as UnifiedAuthContextType, c as UnifiedAuthProvider, b as UnifiedAuthProviderProps, u as useUnifiedAuth } from './UnifiedAuthProvider-B391Aqum.js';
|
|
2
|
+
export { A as Alert, m as AlertDescription, l as AlertTitle, n as Avatar, p as AvatarFallback, o as AvatarImage, B as Button, a as ButtonProps, C as Card, g as CardActions, i as CardActionsProps, f as CardContent, e as CardDescription, c as CardFooter, b as CardHeader, h as CardProps, d as CardTitle, q as Checkbox, b3 as DefaultPublicErrorFallback, D as Dialog, K as DialogBody, G as DialogClose, H as DialogContent, U as DialogContentProps, O as DialogDescription, Z as DialogDescriptionProps, M as DialogFooter, X as DialogFooterProps, J as DialogHeader, W as DialogHeaderProps, E as DialogOverlay, V as DialogOverlayProps, z as DialogPortal, Q as DialogProps, _ as DialogSize, N as DialogTitle, Y as DialogTitleProps, F as DialogTrigger, R as DialogTriggerProps, az as ErrorBoundary, aA as ErrorBoundaryProps, aB as ErrorBoundaryState, a_ as EventLogo, a$ as EventLogoCompact, b0 as EventLogoLarge, ba as EventLogoProps, aD as EventSelector, aF as FileDisplay, aG as FileDisplayProps, ar as Footer, as as FooterProps, am as Form, an as FormProps, aq as Header, I as Input, j as InputProps, L as Label, k as LabelProps, aC as LoadingSpinner, ao as LoginForm, ap as LoginFormProps, av as NavigationItem, at as NavigationMenu, au as NavigationMenuProps, aw as OrganisationSelector, ax as OrganisationSelectorProps, bf as PaceAppLayout, be as PaceAppLayoutProps, bh as PaceLoginPage, bg as PaceLoginPageProps, aE as PasswordResetForm, P as Progress, b1 as PublicErrorBoundary, bb as PublicErrorBoundaryProps, bc as PublicErrorBoundaryState, b6 as PublicLoadingSkeleton, b4 as PublicLoadingSpinner, b5 as PublicLoadingSpinnerFullPage, bd as PublicLoadingSpinnerProps, aZ as PublicPageContextChecker, aX as PublicPageDebugger, aY as PublicPageDiagnostic, aW as PublicPageFooter, b9 as PublicPageFooterProps, aS as PublicPageHeader, b8 as PublicPageHeaderProps, aQ as PublicPageLayout, b7 as PublicPageLayoutProps, aT as PublicPageProvider, $ as Select, a3 as SelectContent, a0 as SelectGroup, a5 as SelectItem, a4 as SelectLabel, a6 as SelectSeparator, a2 as SelectTrigger, a1 as SelectValue, S as Switch, r as SwitchProps, T as Table, t as TableBody, u as TableCaption, v as TableCell, w as TableFooter, x as TableHead, s as TableHeader, y as TableRow, a7 as Toast, a9 as ToastAction, af as ToastActionElement, ae as ToastClose, ad as ToastDescription, ag as ToastProps, aa as ToastProvider, ac as ToastTitle, ab as ToastViewport, a8 as Toaster, ah as Tooltip, aj as TooltipContent, ak as TooltipProvider, al as TooltipRoot, ai as TooltipTrigger, aP as UseFileReferenceForRecordReturn, aN as UseFileReferenceOptions, aO as UseFileReferenceReturn, aJ as UseStorageOptions, aK as UseStorageReturn, ay as UserMenu, b2 as useErrorBoundary, aL as useFileReference, aM as useFileReferenceForRecord, aI as useFileUpload, aV as useIsPublicPage, aR as usePublicPageContext, aU as usePublicPageProviderContext, aH as useStorage } from './PublicLoadingSpinner-CnUaz0vG.js';
|
|
3
3
|
export { u as useToast } from './useToast-Bm6TnSK-.js';
|
|
4
|
-
export { D as DataTable, a as DataTableProps } from './DataTable-
|
|
5
|
-
export { A as AggregateConfig, D as DataRecord, f as DataTableAction, a as DataTableColumn, g as DataTableToolbarButton, E as EmptyStateConfig, G as GetRowId } from './types-
|
|
4
|
+
export { D as DataTable, a as DataTableProps } from './DataTable-BE0OXZKQ.js';
|
|
5
|
+
export { A as AggregateConfig, D as DataRecord, f as DataTableAction, a as DataTableColumn, g as DataTableToolbarButton, E as EmptyStateConfig, G as GetRowId } from './types-BDg1mAGG.js';
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
7
|
import React__default from 'react';
|
|
8
8
|
import { FieldValues, FieldPath, UseFormReturn } from 'react-hook-form';
|
|
9
9
|
import { b as FileCategory } from './file-reference-9xUOnwyt.js';
|
|
10
10
|
export { a as FileMetadata, F as FileReference, c as FileUploadOptions } from './file-reference-9xUOnwyt.js';
|
|
11
11
|
import { SupabaseClient } from '@supabase/supabase-js';
|
|
12
|
+
import './organisation-D6qRDtbF.js';
|
|
13
|
+
import './unified-DQ4VcT7H.js';
|
|
12
14
|
import '@radix-ui/react-label';
|
|
13
15
|
import '@radix-ui/react-avatar';
|
|
14
16
|
import '@radix-ui/react-checkbox';
|
|
@@ -18,8 +20,6 @@ import '@radix-ui/react-dialog';
|
|
|
18
20
|
import '@radix-ui/react-toast';
|
|
19
21
|
import '@radix-ui/react-tooltip';
|
|
20
22
|
import 'zod';
|
|
21
|
-
import './unified-CM7T0aTK.js';
|
|
22
|
-
import './organisation-BtshODVF.js';
|
|
23
23
|
import '@tanstack/react-table';
|
|
24
24
|
|
|
25
25
|
interface FormFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> {
|
package/dist/components.js
CHANGED
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
useFileUpload,
|
|
52
52
|
usePublicPageContext as usePublicPageContext2,
|
|
53
53
|
useStorage
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-YVVGHRGI.js";
|
|
55
55
|
import {
|
|
56
56
|
Alert,
|
|
57
57
|
AlertDescription,
|
|
@@ -91,12 +91,12 @@ import {
|
|
|
91
91
|
TooltipProvider,
|
|
92
92
|
TooltipRoot,
|
|
93
93
|
TooltipTrigger
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-ZMNXIJP4.js";
|
|
95
95
|
import {
|
|
96
96
|
useRBAC
|
|
97
|
-
} from "./chunk-
|
|
98
|
-
import "./chunk-
|
|
99
|
-
import "./chunk-
|
|
97
|
+
} from "./chunk-LRQ6RBJC.js";
|
|
98
|
+
import "./chunk-S63MFSY6.js";
|
|
99
|
+
import "./chunk-Q7APDV6H.js";
|
|
100
100
|
import {
|
|
101
101
|
DefaultPublicErrorFallback,
|
|
102
102
|
PublicErrorBoundary,
|
|
@@ -104,32 +104,31 @@ import {
|
|
|
104
104
|
useErrorBoundary,
|
|
105
105
|
useIsPublicPage,
|
|
106
106
|
usePublicPageContext
|
|
107
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-VSOKOFRF.js";
|
|
108
108
|
import {
|
|
109
109
|
useToast
|
|
110
110
|
} from "./chunk-YCKPEMJA.js";
|
|
111
|
-
import "./chunk-
|
|
111
|
+
import "./chunk-FT2M4R4F.js";
|
|
112
112
|
import {
|
|
113
113
|
init_UnifiedAuthProvider
|
|
114
|
-
} from "./chunk-
|
|
115
|
-
import "./chunk-
|
|
114
|
+
} from "./chunk-FL4ZCQLD.js";
|
|
115
|
+
import "./chunk-QGVSOUJ2.js";
|
|
116
116
|
import {
|
|
117
117
|
UnifiedAuthProvider,
|
|
118
118
|
useUnifiedAuth
|
|
119
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-MNJXXD6C.js";
|
|
120
120
|
import {
|
|
121
|
-
FileCategory
|
|
122
|
-
|
|
123
|
-
} from "./chunk-ULBI5JGB.js";
|
|
121
|
+
FileCategory
|
|
122
|
+
} from "./chunk-WUXCWRL6.js";
|
|
124
123
|
import {
|
|
125
124
|
LoadingSpinner
|
|
126
125
|
} from "./chunk-CDQ3PX7L.js";
|
|
127
126
|
import {
|
|
128
127
|
cn
|
|
129
128
|
} from "./chunk-PYUXFQJ3.js";
|
|
130
|
-
import "./chunk-
|
|
129
|
+
import "./chunk-JCQZ6LA7.js";
|
|
131
130
|
import "./chunk-O3NWNXDY.js";
|
|
132
|
-
import "./chunk-
|
|
131
|
+
import "./chunk-CVMVPYAL.js";
|
|
133
132
|
import "./chunk-PLDDJCW6.js";
|
|
134
133
|
|
|
135
134
|
// src/components/index.ts
|
|
@@ -503,9 +502,6 @@ function FileUpload({
|
|
|
503
502
|
}
|
|
504
503
|
);
|
|
505
504
|
}
|
|
506
|
-
|
|
507
|
-
// src/components/index.ts
|
|
508
|
-
init_file_reference();
|
|
509
505
|
export {
|
|
510
506
|
Alert,
|
|
511
507
|
AlertDescription,
|
package/dist/components.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/index.ts","../src/components/Form/FormField.tsx","../src/components/Form/FormErrorSummary.tsx","../src/components/Form/FormLiveRegion.tsx","../src/components/Form/FormFieldset.tsx","../src/components/SuperAdminGuard.tsx","../src/components/FileUpload.tsx"],"sourcesContent":["/**\n * @file Complete Components Library Export\n * @package @jmruthers/pace-core\n * @module Components\n * @since 0.1.0\n * \n * This file exports ALL components, providers, and utilities in the PACE Core library.\n * Use this import path when you need access to specialized components not included in the main export.\n * \n * @example\n * // Complete library access\n * import { Dialog, NavigationMenu } from '@jmruthers/pace-core/components';\n * \n * // For common components, prefer the main export:\n * import { Button, Card } from '@jmruthers/pace-core';\n */\n\n// ============================================================================\n// AUTHENTICATION & AUTHORIZATION\n// ============================================================================\n\n// Unified auth provider (replaces individual providers)\nexport { UnifiedAuthProvider, useUnifiedAuth } from '../providers/UnifiedAuthProvider';\nexport type { UnifiedAuthProviderProps, UnifiedAuthContextType } from '../providers/UnifiedAuthProvider';\n\n// ============================================================================\n// BASIC UI COMPONENTS\n// ============================================================================\n\nexport { Button } from './Button';\nexport type { ButtonProps } from './Button';\n\nexport { \n Card, \n CardHeader, \n CardFooter, \n CardTitle, \n CardDescription, \n CardContent,\n CardActions\n} from './Card';\nexport type { CardProps, CardActionsProps } from './Card';\n\nexport { Input } from './Input';\nexport type { InputProps } from './Input';\nexport { Label } from './Label';\nexport type { LabelProps } from './Label';\n\nexport { Alert, AlertTitle, AlertDescription } from './Alert';\nexport { Avatar, AvatarImage, AvatarFallback } from './Avatar';\n\nexport { Checkbox } from './Checkbox';\nexport { Switch } from './Switch';\nexport type { SwitchProps } from './Switch';\nexport { Progress } from './Progress';\n\n// Table components\nexport {\n Table,\n TableHeader,\n TableBody,\n TableCaption,\n TableCell,\n TableFooter,\n TableHead,\n TableRow,\n} from './Table/Table';\n\n// ============================================================================\n// ADVANCED UI COMPONENTS\n// ============================================================================\n\n// Dialog exports\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogTrigger,\n DialogClose,\n DialogContent,\n DialogHeader,\n DialogBody,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n} from './Dialog/Dialog';\nexport type {\n DialogProps,\n DialogTriggerProps,\n DialogContentProps,\n DialogOverlayProps,\n DialogHeaderProps,\n DialogFooterProps,\n DialogTitleProps,\n DialogDescriptionProps,\n DialogSize\n} from './Dialog/Dialog';\n\n// Dropdown Menu exports\n// DropdownMenu components have been merged into Select components\n\n// Select exports (includes all dropdown functionality)\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n} from './Select';\n\n// Toast exports\nexport {\n Toast,\n Toaster,\n ToastAction,\n ToastProvider,\n ToastViewport,\n ToastTitle,\n ToastDescription,\n ToastClose,\n} from './Toast';\nexport type { ToastActionElement, ToastProps } from './Toast';\n\n// Tooltip exports\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider, TooltipRoot } from './Tooltip';\n\n// ============================================================================\n// DATA DISPLAY COMPONENTS\n// ============================================================================\n\nexport {\n DataTable,\n type DataTableProps,\n type DataTableColumn,\n type DataTableAction,\n type DataTableToolbarButton,\n type AggregateConfig,\n type EmptyStateConfig,\n type GetRowId\n} from './DataTable';\n\n// Re-export types from DataTable types\nexport type { DataRecord } from './DataTable/types';\n\n// ============================================================================\n// FORM COMPONENTS\n// ============================================================================\n\nexport { \n Form, \n FormField, \n FormErrorSummary, \n FormLiveRegion, \n FormFieldset \n} from './Form';\nexport type { \n FormProps, \n FormFieldProps, \n FormErrorSummaryProps, \n FormLiveRegionProps, \n FormFieldsetProps \n} from './Form';\n\n// LoginForm - ensure it's exported\nexport { LoginForm } from './LoginForm';\nexport type { LoginFormProps } from './LoginForm';\n\n// ============================================================================\n// LAYOUT COMPONENTS\n// ============================================================================\n\nexport { Header } from './Header';\nexport { Footer } from './Footer';\nexport type { FooterProps } from './Footer';\n\n// Public Layout Components\nexport * from './PublicLayout';\n\n// ============================================================================\n// SECURITY COMPONENTS\n// ============================================================================\n\n// Super Admin Guard components\nexport { \n SuperAdminGuard, \n SuperAdminBadge, \n SuperAdminDebugPanel \n} from './SuperAdminGuard';\nexport type { SuperAdminGuardProps } from './SuperAdminGuard';\n\n// Removed: Protected and AdminGuard components (unused)\n\n// ============================================================================\n// NAVIGATION COMPONENTS\n// ============================================================================\n\nexport {\n NavigationMenu,\n} from './NavigationMenu';\nexport type { NavigationMenuProps, NavigationItem } from './NavigationMenu';\n\nexport { OrganisationSelector } from './OrganisationSelector';\nexport type { OrganisationSelectorProps } from './OrganisationSelector';\n\nexport { UserMenu } from './UserMenu';\n\n// Reusable Page/Layout Components\nexport * from './PaceAppLayout';\nexport * from './PaceLoginPage';\n\n// ============================================================================\n// UTILITY COMPONENTS\n// ============================================================================\n\nexport { ErrorBoundary } from './ErrorBoundary';\nexport type { ErrorBoundaryProps, ErrorBoundaryState } from './ErrorBoundary';\nexport { LoadingSpinner } from './LoadingSpinner';\n\n// ============================================================================\n// EVENT MANAGEMENT\n// ============================================================================\n\nexport { EventSelector } from './EventSelector';\n\n// ============================================================================\n// AUTHENTICATION FORMS\n// ============================================================================\n\n// Password Component exports\nexport { PasswordResetForm } from './PasswordReset';\n\n// ============================================================================\n// STORAGE COMPONENTS\n// ============================================================================\n\nexport { FileUpload } from './FileUpload';\nexport type { FileUploadProps } from './FileUpload';\n\nexport { FileDisplay } from './FileDisplay';\nexport type { FileDisplayProps } from './FileDisplay';\n\n\n// ============================================================================\n// TYPES\n// ============================================================================\n\nexport { FileCategory } from '../types/file-reference';\nexport type { FileReference, FileMetadata, FileUploadOptions } from '../types/file-reference';\n\n// ============================================================================\n// HOOKS\n// ============================================================================\n\nexport { useStorage, useFileUpload } from '../hooks/useStorage';\nexport type { UseStorageOptions, UseStorageReturn } from '../hooks/useStorage';\n\nexport { useFileReference, useFileReferenceForRecord } from '../hooks/useFileReference';\nexport type { UseFileReferenceOptions, UseFileReferenceReturn, UseFileReferenceForRecordReturn } from '../hooks/useFileReference';\n\nexport { useToast } from '../hooks/useToast';\n\n// RBAC Components - Use the new RBAC system\n// For RBAC functionality, import from @jmruthers/pace-core/rbac\n// export { PermissionGuard, AccessLevelGuard } from '@jmruthers/pace-core/rbac';\n","/**\n * @file FormField Component\n * @package @jmruthers/pace-core\n * @module Components/Form\n * @since 0.1.0\n *\n * A flexible form field component that integrates with React Hook Form and provides\n * built-in validation, error handling, and accessibility features.\n *\n * Features:\n * - React Hook Form integration with Controller\n * - Built-in validation with error display\n * - Accessible labels and error messages\n * - Custom render function support\n * - TypeScript support with generic field paths\n * - Consistent styling with error states\n * - Test ID support for testing\n * - Flexible input types and props\n *\n * @example\n * ```tsx\n * // Basic text field\n * <FormField\n * name=\"username\"\n * label=\"Username\"\n * placeholder=\"Enter your username\"\n * validation={{ required: true }}\n * />\n * \n * // Email field with custom validation\n * <FormField\n * name=\"email\"\n * label=\"Email Address\"\n * type=\"email\"\n * validation={{\n * required: true,\n * pattern: {\n * value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}$/i,\n * message: \"Invalid email address\"\n * }\n * }}\n * />\n * \n * // Custom render function\n * <FormField\n * name=\"avatar\"\n * label=\"Profile Picture\"\n * render={({ field }) => (\n * <input\n * {...field}\n * type=\"file\"\n * accept=\"image/*\"\n * className=\"file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-sec-50 file:text-sec-700 hover:file:bg-sec-100\"\n * />\n * )}\n * />\n * \n * // With test ID for testing\n * <FormField\n * name=\"password\"\n * label=\"Password\"\n * type=\"password\"\n * data-testid=\"password-field\"\n * validation={{\n * required: true,\n * minLength: {\n * value: 8,\n * message: \"Password must be at least 8 characters\"\n * }\n * }}\n * />\n * ```\n *\n * @accessibility\n * - Proper label association with htmlFor\n * - Error messages with role=\"alert\"\n * - Required field indicators\n * - Focus management\n * - Screen reader friendly error announcements\n * - Keyboard navigation support\n *\n * @dependencies\n * - react-hook-form - Form integration\n * - React 18+ - Hooks and context\n * - Tailwind CSS - Styling\n */\n\nimport React from 'react';\nimport { useFormContext, Controller, FieldPath, FieldValues } from 'react-hook-form';\nimport { cn } from '../../utils/cn';\nimport { Label } from '../Label';\n\nexport interface FormFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> {\n /**\n * Field name\n */\n name: TName;\n \n /**\n * Field label\n */\n label?: string;\n \n /**\n * Field type\n */\n type?: string;\n \n /**\n * Placeholder text\n */\n placeholder?: string;\n \n /**\n * Additional props for the input\n */\n inputProps?: React.InputHTMLAttributes<HTMLInputElement>;\n \n /**\n * Validation rules\n */\n validation?: {\n required?: boolean;\n pattern?: {\n value: RegExp;\n message: string;\n };\n minLength?: {\n value: number;\n message: string;\n };\n maxLength?: {\n value: number;\n message: string;\n };\n };\n \n /**\n * Custom render function\n */\n render?: ({ field }: { field: any }) => React.ReactElement;\n \n /**\n * Test ID\n */\n 'data-testid'?: string;\n \n /**\n * Class name\n */\n className?: string;\n}\n\n/**\n * FormField component for React Hook Form integration\n * \n * @template TFieldValues - The type of form field values\n * @template TName - The type of the field name (must be a valid field path)\n * @param props - Form field configuration and validation\n * @returns JSX.Element - The rendered form field with validation\n * \n * @example\n * ```tsx\n * <FormField\n * name=\"email\"\n * label=\"Email\"\n * type=\"email\"\n * validation={{\n * required: true,\n * pattern: {\n * value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}$/i,\n * message: \"Please enter a valid email address\"\n * }\n * }}\n * />\n * ```\n */\nexport function FormField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n name,\n label,\n type = \"text\",\n placeholder,\n inputProps,\n validation,\n render,\n 'data-testid': testId,\n className,\n}: FormFieldProps<TFieldValues, TName>) {\n const { control, formState: { errors } } = useFormContext<TFieldValues>();\n const fieldError = errors[name];\n\n // Safely extract error message\n const errorMessage = fieldError && typeof fieldError === 'object' && 'message' in fieldError \n ? String(fieldError.message) \n : undefined;\n\n return (\n <div className={cn(\"space-y-2\", className)}>\n {label && (\n <Label htmlFor={name}>\n {label}\n {validation?.required && (\n <span className=\"text-destructive ml-1\" aria-label=\"required\">\n *\n </span>\n )}\n </Label>\n )}\n \n <Controller\n name={name}\n control={control}\n rules={validation}\n render={({ field }) => {\n if (render) {\n return render({ field });\n }\n \n return (\n <input\n {...field}\n id={name}\n type={type}\n placeholder={placeholder}\n data-testid={testId}\n className={cn(\n \"flex h-10 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\",\n fieldError && \"border-destructive focus-visible:ring-destructive\"\n )}\n {...inputProps}\n />\n );\n }}\n />\n \n {errorMessage && (\n <p className=\"text-destructive\" role=\"alert\">\n {errorMessage}\n </p>\n )}\n </div>\n );\n}\n","\n/**\n * @file FormErrorSummary Component\n * @package @jmruthers/pace-core\n * @module Components/Form\n * @since 0.1.0\n *\n * A form error summary component that displays validation errors in a user-friendly format.\n * Provides a centralized location for users to see all form errors at once.\n *\n * Features:\n * - Displays all form errors in one place\n * - Configurable error display format\n * - Optional field name display\n * - Accessible error presentation\n * - Consistent styling with Alert component\n * - Automatic error filtering\n * - Responsive design\n *\n * @example\n * ```tsx\n * // Basic error summary\n * <FormErrorSummary errors={formErrors} />\n * \n * // With custom title\n * <FormErrorSummary \n * errors={formErrors}\n * title=\"Please correct the following issues:\"\n * />\n * \n * // Show field names with errors\n * <FormErrorSummary \n * errors={formErrors}\n * showFieldNames={true}\n * />\n * \n * // In a form with React Hook Form\n * const { formState: { errors } } = useForm();\n * \n * <Form onSubmit={handleSubmit}>\n * <FormField name=\"email\" label=\"Email\" />\n * <FormField name=\"password\" label=\"Password\" />\n * <FormErrorSummary errors={errors} />\n * <Button type=\"submit\">Submit</Button>\n * </Form>\n * ```\n *\n * @accessibility\n * - Uses Alert component for consistent accessibility\n * - Proper heading hierarchy with h3\n * - List structure for error items\n * - Screen reader friendly error announcements\n * - High contrast support via Alert component\n *\n * @dependencies\n * - Alert component for consistent styling\n * - React 18+ - Component framework\n * - Tailwind CSS - Styling\n */\n\nimport { Alert } from '../Alert';\n\nexport interface FormErrorSummaryProps {\n /** Form validation errors object */\n errors?: Record<string, any>;\n /** Title displayed above the error list */\n title?: string;\n /** Whether to show field names alongside error messages */\n showFieldNames?: boolean;\n}\n\n/**\n * FormErrorSummary component for displaying form validation errors\n * \n * This component provides a user-friendly way to display all form errors\n * in one centralized location, improving the user experience by making\n * it clear what needs to be fixed.\n * \n * @param props - Component configuration\n * @param props.errors - Form validation errors object\n * @param props.title - Title displayed above the error list\n * @param props.showFieldNames - Whether to show field names with errors\n * @returns JSX.Element - The rendered error summary or null if no errors\n */\nexport function FormErrorSummary({ \n errors = {}, \n title = \"Please fix the following errors:\",\n showFieldNames = false \n}: FormErrorSummaryProps) {\n const errorEntries = Object.entries(errors).filter(([, value]) => Boolean(value));\n\n if (errorEntries.length === 0) {\n return null;\n }\n\n return (\n <Alert variant=\"destructive\" className=\"mb-4\">\n <div>\n <h3>{title}</h3>\n <ul className=\"list-disc list-inside space-y-1\">\n {errorEntries.map(([field, error], index) => {\n const message = typeof error === 'object' && error.message ? error.message : String(error);\n return (\n <li key={index} className=\"text-sm\">\n {showFieldNames ? `${field}: ${message}` : message}\n </li>\n );\n })}\n </ul>\n </div>\n </Alert>\n );\n}\n","/**\n * @file FormLiveRegion Component\n * @package @jmruthers/pace-core\n * @module Components/Form\n * @since 0.1.0\n *\n * An accessible live region component for form validation announcements.\n * Provides real-time feedback to screen readers about form validation states\n * and error messages, improving accessibility for users with assistive technologies.\n *\n * Features:\n * - Real-time form validation announcements\n * - Configurable politeness levels (polite/assertive)\n * - Customizable delay timing\n * - Field-level and form-level announcements\n * - Success message customization\n * - Automatic error counting and field identification\n * - Accessibility compliant with ARIA live regions\n * - Integration with React Hook Form\n *\n * @example\n * ```tsx\n * // Basic live region\n * const { control, formState } = useForm();\n * \n * <Form onSubmit={handleSubmit}>\n * <FormField name=\"email\" label=\"Email\" />\n * <FormField name=\"password\" label=\"Password\" />\n * <FormLiveRegion form={{ control, formState }} />\n * <Button type=\"submit\">Submit</Button>\n * </Form>\n * \n * // With custom configuration\n * <FormLiveRegion\n * form={{ control, formState }}\n * politeness=\"assertive\"\n * delay={1000}\n * successMessage=\"Your form was submitted successfully!\"\n * enableFieldAnnouncements={true}\n * />\n * \n * // In a complex form\n * function ComplexForm() {\n * const methods = useForm({\n * defaultValues: { name: '', email: '', message: '' }\n * });\n * \n * return (\n * <FormProvider {...methods}>\n * <form onSubmit={methods.handleSubmit(onSubmit)}>\n * <FormField name=\"name\" label=\"Name\" />\n * <FormField name=\"email\" label=\"Email\" />\n * <FormField name=\"message\" label=\"Message\" />\n * <FormLiveRegion \n * form={methods}\n * politeness=\"polite\"\n * delay={300}\n * />\n * <Button type=\"submit\">Send Message</Button>\n * </form>\n * </FormProvider>\n * );\n * }\n * ```\n *\n * @accessibility\n * - ARIA live region for screen reader announcements\n * - Configurable politeness levels for different message types\n * - Automatic error counting and field identification\n * - Non-intrusive validation feedback\n * - WCAG 2.1 AA compliant\n * - Screen reader friendly error announcements\n *\n * @dependencies\n * - react-hook-form - Form state management\n * - React 18+ - Hooks and effects\n * - Tailwind CSS - Styling\n */\n\nimport React, { useEffect, useState } from 'react';\nimport { UseFormReturn, FieldValues } from 'react-hook-form';\nimport { cn } from '../../utils/cn';\n\n/**\n * Props for the FormLiveRegion component\n */\nexport interface FormLiveRegionProps<T extends FieldValues> {\n /** React Hook Form instance */\n form: UseFormReturn<T>;\n /** ARIA live region politeness level */\n politeness?: 'polite' | 'assertive';\n /** Delay before announcing messages (in ms) */\n delay?: number;\n /** Custom success message */\n successMessage?: string;\n /** Custom class name */\n className?: string;\n /** Enable field-level validation announcements */\n enableFieldAnnouncements?: boolean;\n}\n\n/**\n * FormLiveRegion component for accessible form validation announcements\n */\nexport function FormLiveRegion<T extends FieldValues>({\n form,\n politeness = 'polite',\n delay = 500,\n successMessage = 'Form submitted successfully',\n className,\n enableFieldAnnouncements = true\n}: FormLiveRegionProps<T>): React.ReactElement {\n const [message, setMessage] = useState<string>('');\n const { formState } = form;\n\n // Handle form-level announcements\n useEffect(() => {\n let timeoutId: NodeJS.Timeout;\n\n if (formState.isSubmitting) {\n setMessage('Submitting form...');\n } else if (formState.isSubmitSuccessful) {\n timeoutId = setTimeout(() => {\n setMessage(successMessage);\n }, delay);\n } else if (formState.errors && Object.keys(formState.errors).length > 0) {\n const errorCount = Object.keys(formState.errors).length;\n const errorFields = Object.keys(formState.errors).join(', ');\n setMessage(`Form has ${errorCount} error${errorCount === 1 ? '' : 's'} in: ${errorFields}`);\n } else if (formState.isValid && formState.isDirty) {\n setMessage('Form is valid');\n } else {\n setMessage('');\n }\n\n return () => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n };\n }, [formState, delay, successMessage]);\n\n // Handle field-level announcements\n useEffect(() => {\n if (!enableFieldAnnouncements) return;\n\n let timeoutId: NodeJS.Timeout;\n \n const fieldErrors = formState.errors;\n const touchedFields = formState.touchedFields;\n \n // Find newly touched fields with errors\n const newErrors = Object.keys(fieldErrors).filter(field => {\n // Type-safe access to touchedFields\n const touchedField = touchedFields as Record<string, boolean>;\n return touchedField[field] && fieldErrors[field as keyof typeof fieldErrors];\n });\n\n if (newErrors.length > 0) {\n timeoutId = setTimeout(() => {\n const errorField = newErrors[0];\n const errorData = fieldErrors[errorField as keyof typeof fieldErrors];\n const errorMessage = errorData?.message;\n if (errorMessage) {\n setMessage(`${errorField}: ${errorMessage}`);\n }\n }, delay);\n }\n\n return () => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n };\n }, [formState.errors, formState.touchedFields, enableFieldAnnouncements, delay]);\n\n if (!message) {\n return <></>;\n }\n\n return (\n <div\n role=\"status\"\n aria-live={politeness}\n aria-atomic=\"true\"\n className={cn('sr-only', className)}\n style={{\n position: 'absolute',\n left: '-10000px',\n width: '1px',\n height: '1px',\n overflow: 'hidden'\n }}\n >\n {message}\n </div>\n );\n}\n","/**\n * @file FormFieldset Component\n * @package @jmruthers/pace-core\n * @module Components/Form\n * @since 0.1.0\n *\n * A form fieldset component that groups related form fields together with a legend\n * and optional description. Provides semantic structure and accessibility for form sections.\n *\n * Features:\n * - Semantic fieldset grouping for related form fields\n * - Accessible legend with required indicator\n * - Optional description text with proper ARIA association\n * - Consistent styling with design system\n * - Forwarded ref support\n * - Customizable styling via className\n * - Required field indication\n * - Responsive design\n *\n * @example\n * ```tsx\n * // Basic fieldset\n * <FormFieldset legend=\"Personal Information\">\n * <FormField name=\"firstName\" label=\"First Name\" />\n * <FormField name=\"lastName\" label=\"Last Name\" />\n * <FormField name=\"email\" label=\"Email\" />\n * </FormFieldset>\n * \n * // Fieldset with description\n * <FormFieldset \n * legend=\"Contact Details\" \n * description=\"We'll use this information to contact you about your order\"\n * >\n * <FormField name=\"phone\" label=\"Phone Number\" />\n * <FormField name=\"address\" label=\"Address\" />\n * </FormFieldset>\n * \n * // Required fieldset\n * <FormFieldset \n * legend=\"Account Settings\" \n * required={true}\n * description=\"These settings are required for account creation\"\n * >\n * <FormField name=\"username\" label=\"Username\" required />\n * <FormField name=\"password\" label=\"Password\" type=\"password\" required />\n * </FormFieldset>\n * \n * // With custom styling\n * <FormFieldset \n * legend=\"Preferences\"\n * className=\"bg-sec-50 border-sec-200\"\n * >\n * <FormField name=\"newsletter\" label=\"Subscribe to newsletter\" type=\"checkbox\" />\n * <FormField name=\"notifications\" label=\"Enable notifications\" type=\"checkbox\" />\n * </FormFieldset>\n * ```\n *\n * @accessibility\n * - Proper semantic HTML with fieldset and legend\n * - ARIA describedby association for descriptions\n * - Required field indication with asterisk\n * - Screen reader friendly structure\n * - Keyboard navigation support\n * - WCAG 2.1 AA compliant\n *\n * @dependencies\n * - React 18+ - Component framework and hooks\n * - Tailwind CSS - Styling\n * - cn utility - Class name merging\n */\n\nimport React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport interface FormFieldsetProps extends React.FieldsetHTMLAttributes<HTMLFieldSetElement> {\n /** The legend text for the fieldset */\n legend: string;\n /** Optional description text below the legend */\n description?: string;\n /** Whether the fieldset contains required fields */\n required?: boolean;\n /** Form fields to group within the fieldset */\n children: React.ReactNode;\n}\n\n/**\n * FormFieldset component for grouping related form fields\n * \n * This component provides semantic grouping for form fields with proper\n * accessibility support and consistent styling. Use it to organize\n * related form inputs into logical sections.\n * \n * @param props - Component configuration\n * @param props.legend - The legend text for the fieldset\n * @param props.description - Optional description text\n * @param props.required - Whether the fieldset contains required fields\n * @param props.children - Form fields to group\n * @param ref - Forwarded ref to the fieldset element\n * @returns JSX.Element - The rendered fieldset with legend and fields\n */\nexport const FormFieldset = React.forwardRef<HTMLFieldSetElement, FormFieldsetProps>(\n ({ legend, description, required, className, children, ...props }, ref) => {\n const descriptionId = React.useId();\n \n return (\n <fieldset\n ref={ref}\n className={cn(\"space-y-4 border border-input rounded-lg p-4\", className)}\n aria-describedby={description ? descriptionId : undefined}\n {...props}\n >\n <legend className=\"px-2\">\n {legend}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </legend>\n {description && (\n <p id={descriptionId} className=\"text-muted-foreground\">\n {description}\n </p>\n )}\n {children}\n </fieldset>\n );\n }\n);\n\nFormFieldset.displayName = \"FormFieldset\";\n","/**\n * Super Admin Guard Component\n * @package @jmruthers/pace-core\n * @module Components/SuperAdminGuard\n * @since 1.0.0\n * \n * A reusable component for protecting content that should only be visible to super admins.\n */\n\nimport React from 'react';\nimport { useRBAC } from '../rbac/hooks/useRBAC';\n\nexport interface SuperAdminGuardProps {\n children: React.ReactNode;\n fallback?: React.ReactNode;\n showDebugInfo?: boolean;\n}\n\n/**\n * Super Admin Guard Component\n * \n * Renders children only if the current user is a super admin.\n * Provides a fallback for non-super admin users.\n * \n * @param children - Content to render for super admins\n * @param fallback - Content to render for non-super admins (optional)\n * @param showDebugInfo - Whether to show debug information (optional)\n */\nexport function SuperAdminGuard({ \n children, \n fallback = null, \n showDebugInfo = false \n}: SuperAdminGuardProps) {\n const { isSuperAdmin, hasGlobalPermission, isLoading } = useRBAC();\n\n // Show loading state\n if (isLoading) {\n return (\n <div className=\"super-admin-guard-loading\">\n <div className=\"loading-spinner\" />\n <span>Checking permissions...</span>\n </div>\n );\n }\n\n // Show debug info if enabled\n if (showDebugInfo) {\n console.log('[SuperAdminGuard] Debug Info:', {\n isSuperAdmin,\n isLoading\n });\n }\n\n // Render children for super admins\n if (isSuperAdmin) {\n return (\n <div className=\"super-admin-content\">\n {children}\n </div>\n );\n }\n\n // Render fallback for non-super admins\n return (\n <div className=\"super-admin-fallback\">\n {fallback}\n </div>\n );\n}\n\n/**\n * Super Admin Badge Component\n * \n * Shows a visual indicator when the current user is a super admin.\n */\nexport function SuperAdminBadge() {\n const { isSuperAdmin } = useRBAC();\n\n if (!isSuperAdmin) {\n return null;\n }\n\n return (\n <div className=\"super-admin-badge\">\n <span className=\"badge-text\">SUPER ADMIN</span>\n </div>\n );\n}\n\n/**\n * Super Admin Debug Panel\n * \n * Shows debug information about the current user's permissions.\n * Only visible to super admins and in development mode.\n */\nexport function SuperAdminDebugPanel() {\n const { isSuperAdmin, isLoading } = useRBAC();\n\n // Only show in development or for super admins\n if (import.meta.env.MODE !== 'development' && !isSuperAdmin) {\n return null;\n }\n\n return (\n <div className=\"super-admin-debug-panel\">\n <h4>Super Admin Debug Info</h4>\n <div className=\"debug-info\">\n <p><strong>Is Super Admin:</strong> {isSuperAdmin ? 'Yes' : 'No'}</p>\n <p><strong>Is Loading:</strong> {isLoading ? 'Yes' : 'No'}</p>\n <p><strong>Environment:</strong> {import.meta.env.MODE}</p>\n </div>\n </div>\n );\n}\n\nexport default SuperAdminGuard;\n","// File Upload Component\n// Provides a file upload interface using the file reference system\n\nimport React, { useState, useCallback, useRef } from 'react';\nimport { SupabaseClient } from '@supabase/supabase-js';\nimport { FileCategory } from '../types/file-reference';\nimport { useFileReference } from '../hooks/useFileReference';\n\nexport interface FileUploadProps {\n supabase: SupabaseClient;\n table_name: string;\n record_id: string;\n organisation_id: string;\n app_id: string;\n category: FileCategory;\n accept?: string;\n maxSize?: number;\n multiple?: boolean;\n disabled?: boolean;\n className?: string;\n onUploadSuccess?: (result: any) => void;\n onUploadError?: (error: string) => void;\n children?: React.ReactNode;\n}\n\nexport function FileUpload({\n supabase,\n table_name,\n record_id,\n organisation_id,\n app_id,\n category,\n accept = '*/*',\n maxSize = 10 * 1024 * 1024, // 10MB default\n multiple = false,\n disabled = false,\n className = '',\n onUploadSuccess,\n onUploadError,\n children\n}: FileUploadProps) {\n const [isDragging, setIsDragging] = useState(false);\n const fileInputRef = useRef<HTMLInputElement>(null);\n const { uploadFile, isLoading, error } = useFileReference(supabase);\n\n const handleFileSelect = useCallback(async (files: FileList | null) => {\n if (!files || files.length === 0) return;\n\n const fileArray = Array.from(files);\n \n // Validate file sizes\n const oversizedFiles = fileArray.filter(file => file.size > maxSize);\n if (oversizedFiles.length > 0) {\n const errorMessage = `Files exceed maximum size of ${Math.round(maxSize / 1024 / 1024)}MB: ${oversizedFiles.map(f => f.name).join(', ')}`;\n onUploadError?.(errorMessage);\n return;\n }\n\n // Upload files\n for (const file of fileArray) {\n try {\n const result = await uploadFile({\n table_name,\n record_id,\n organisation_id,\n app_id,\n category,\n is_public: false\n }, file);\n\n if (result) {\n onUploadSuccess?.(result);\n } else {\n onUploadError?.('Upload failed');\n }\n } catch (err) {\n const errorMessage = err instanceof Error ? err.message : 'Upload failed';\n onUploadError?.(errorMessage);\n }\n }\n }, [uploadFile, table_name, record_id, organisation_id, app_id, category, maxSize, onUploadSuccess, onUploadError]);\n\n const handleDragOver = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n if (!disabled) {\n setIsDragging(true);\n }\n }, [disabled]);\n\n const handleDragLeave = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragging(false);\n }, []);\n\n const handleDrop = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragging(false);\n \n if (disabled) return;\n \n const files = e.dataTransfer.files;\n handleFileSelect(files);\n }, [disabled, handleFileSelect]);\n\n const handleFileInputChange = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\n handleFileSelect(e.target.files);\n // Reset input value to allow re-uploading the same file\n if (e.target) {\n e.target.value = '';\n }\n }, [handleFileSelect]);\n\n const handleClick = useCallback(() => {\n if (!disabled && fileInputRef.current) {\n fileInputRef.current.click();\n }\n }, [disabled]);\n\n const dragClasses = isDragging ? 'border-main-500 bg-main-50' : 'border-sec-300 hover:border-sec-400';\n const disabledClasses = disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer hover:bg-sec-50';\n\n return (\n <div\n className={`relative border-2 border-dashed rounded-lg p-6 text-center transition-colors ${dragClasses} ${disabledClasses} ${className}`}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n onDrop={handleDrop}\n onClick={handleClick}\n >\n <input\n ref={fileInputRef}\n type=\"file\"\n accept={accept}\n multiple={multiple}\n onChange={handleFileInputChange}\n className=\"hidden\"\n disabled={disabled}\n />\n \n {children || (\n <div className=\"space-y-2\">\n <div className=\"text-sec-600\">\n {isDragging ? (\n 'Drop files here...'\n ) : (\n <>\n <span className=\"font-medium\">Click to upload</span>\n {' '}or drag and drop\n </>\n )}\n </div>\n <div className=\"text-sm text-sec-500\">\n {accept !== '*/*' && `Accepted formats: ${accept}`}\n {maxSize && ` • Max size: ${Math.round(maxSize / 1024 / 1024)}MB`}\n {multiple && ' • Multiple files allowed'}\n </div>\n </div>\n )}\n \n {isLoading && (\n <div className=\"absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center\">\n <div className=\"animate-spin rounded-full h-8 w-8 border-b-2 border-main-500\"></div>\n </div>\n )}\n \n {error && (\n <div className=\"mt-2 text-sm text-acc-600\">\n {error}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA;;;ACkEA,SAAS,gBAAgB,kBAA0C;AAqH3D,SAGI,KAHJ;AAzBD,SAAS,UAGd;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf;AACF,GAAwC;AACtC,QAAM,EAAE,SAAS,WAAW,EAAE,OAAO,EAAE,IAAI,eAA6B;AACxE,QAAM,aAAa,OAAO,IAAI;AAG9B,QAAM,eAAe,cAAc,OAAO,eAAe,YAAY,aAAa,aAC9E,OAAO,WAAW,OAAO,IACzB;AAEJ,SACE,qBAAC,SAAI,WAAW,GAAG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AAC,QAAQ,CAAC;AAEb,QAAM,cAAc,aAAa,+BAA+B;AAChE,QAAM,kBAAkB,WAAW,kCAAkC;AAErE,SACE,gBAAAD;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,gFAAgF,WAAW,IAAI,eAAe,IAAI,SAAS;AAAA,MACtI,YAAY;AAAA,MACZ,aAAa;AAAA,MACb,QAAQ;AAAA,MACR,SAAS;AAAA,MAET;AAAA,wBAAAD;AAAA,UAAC;AAAA;AAAA,YACC,KAAK;AAAA,YACL,MAAK;AAAA,YACL;AAAA,YACA;AAAA,YACA,UAAU;AAAA,YACV,WAAU;AAAA,YACV;AAAA;AAAA,QACF;AAAA,QAEC,YACC,gBAAAC,MAAC,SAAI,WAAU,aACb;AAAA,0BAAAD,KAAC,SAAI,WAAU,gBACZ,uBACC,uBAEA,gBAAAC,MAAAF,WAAA,EACE;AAAA,4BAAAC,KAAC,UAAK,WAAU,eAAc,6BAAe;AAAA,YAC5C;AAAA,YAAI;AAAA,aACP,GAEJ;AAAA,UACA,gBAAAC,MAAC,SAAI,WAAU,wBACZ;AAAA,uBAAW,SAAS,qBAAqB,MAAM;AAAA,YAC/C,WAAW,qBAAgB,KAAK,MAAM,UAAU,OAAO,IAAI,CAAC;AAAA,YAC5D,YAAY;AAAA,aACf;AAAA,WACF;AAAA,QAGD,aACC,gBAAAD,KAAC,SAAI,WAAU,4EACb,0BAAAA,KAAC,SAAI,WAAU,gEAA+D,GAChF;AAAA,QAGD,SACC,gBAAAA,KAAC,SAAI,WAAU,6BACZ,iBACH;AAAA;AAAA;AAAA,EAEJ;AAEJ;;;AN0EA;","names":["jsx","jsxs","jsx","React","jsx","jsxs","React","jsx","jsxs","useState","Fragment","jsx","jsxs","useState"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/index.ts","../src/components/Form/FormField.tsx","../src/components/Form/FormErrorSummary.tsx","../src/components/Form/FormLiveRegion.tsx","../src/components/Form/FormFieldset.tsx","../src/components/SuperAdminGuard.tsx","../src/components/FileUpload.tsx"],"sourcesContent":["/**\n * @file Complete Components Library Export\n * @package @jmruthers/pace-core\n * @module Components\n * @since 0.1.0\n * \n * This file exports ALL components, providers, and utilities in the PACE Core library.\n * Use this import path when you need access to specialized components not included in the main export.\n * \n * @example\n * // Complete library access\n * import { Dialog, NavigationMenu } from '@jmruthers/pace-core/components';\n * \n * // For common components, prefer the main export:\n * import { Button, Card } from '@jmruthers/pace-core';\n */\n\n// ============================================================================\n// AUTHENTICATION & AUTHORIZATION\n// ============================================================================\n\n// Unified auth provider (replaces individual providers)\nexport { UnifiedAuthProvider, useUnifiedAuth } from '../providers/UnifiedAuthProvider';\nexport type { UnifiedAuthProviderProps, UnifiedAuthContextType } from '../providers/UnifiedAuthProvider';\n\n// ============================================================================\n// BASIC UI COMPONENTS\n// ============================================================================\n\nexport { Button } from './Button';\nexport type { ButtonProps } from './Button';\n\nexport { \n Card, \n CardHeader, \n CardFooter, \n CardTitle, \n CardDescription, \n CardContent,\n CardActions\n} from './Card';\nexport type { CardProps, CardActionsProps } from './Card';\n\nexport { Input } from './Input';\nexport type { InputProps } from './Input';\nexport { Label } from './Label';\nexport type { LabelProps } from './Label';\n\nexport { Alert, AlertTitle, AlertDescription } from './Alert';\nexport { Avatar, AvatarImage, AvatarFallback } from './Avatar';\n\nexport { Checkbox } from './Checkbox';\nexport { Switch } from './Switch';\nexport type { SwitchProps } from './Switch';\nexport { Progress } from './Progress';\n\n// Table components\nexport {\n Table,\n TableHeader,\n TableBody,\n TableCaption,\n TableCell,\n TableFooter,\n TableHead,\n TableRow,\n} from './Table/Table';\n\n// ============================================================================\n// ADVANCED UI COMPONENTS\n// ============================================================================\n\n// Dialog exports\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogTrigger,\n DialogClose,\n DialogContent,\n DialogHeader,\n DialogBody,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n} from './Dialog/Dialog';\nexport type {\n DialogProps,\n DialogTriggerProps,\n DialogContentProps,\n DialogOverlayProps,\n DialogHeaderProps,\n DialogFooterProps,\n DialogTitleProps,\n DialogDescriptionProps,\n DialogSize\n} from './Dialog/Dialog';\n\n// Dropdown Menu exports\n// DropdownMenu components have been merged into Select components\n\n// Select exports (includes all dropdown functionality)\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n} from './Select';\n\n// Toast exports\nexport {\n Toast,\n Toaster,\n ToastAction,\n ToastProvider,\n ToastViewport,\n ToastTitle,\n ToastDescription,\n ToastClose,\n} from './Toast';\nexport type { ToastActionElement, ToastProps } from './Toast';\n\n// Tooltip exports\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider, TooltipRoot } from './Tooltip';\n\n// ============================================================================\n// DATA DISPLAY COMPONENTS\n// ============================================================================\n\nexport {\n DataTable,\n type DataTableProps,\n type DataTableColumn,\n type DataTableAction,\n type DataTableToolbarButton,\n type AggregateConfig,\n type EmptyStateConfig,\n type GetRowId\n} from './DataTable';\n\n// Re-export types from DataTable types\nexport type { DataRecord } from './DataTable/types';\n\n// ============================================================================\n// FORM COMPONENTS\n// ============================================================================\n\nexport { \n Form, \n FormField, \n FormErrorSummary, \n FormLiveRegion, \n FormFieldset \n} from './Form';\nexport type { \n FormProps, \n FormFieldProps, \n FormErrorSummaryProps, \n FormLiveRegionProps, \n FormFieldsetProps \n} from './Form';\n\n// LoginForm - ensure it's exported\nexport { LoginForm } from './LoginForm';\nexport type { LoginFormProps } from './LoginForm';\n\n// ============================================================================\n// LAYOUT COMPONENTS\n// ============================================================================\n\nexport { Header } from './Header';\nexport { Footer } from './Footer';\nexport type { FooterProps } from './Footer';\n\n// Public Layout Components\nexport * from './PublicLayout';\n\n// ============================================================================\n// SECURITY COMPONENTS\n// ============================================================================\n\n// Super Admin Guard components\nexport { \n SuperAdminGuard, \n SuperAdminBadge, \n SuperAdminDebugPanel \n} from './SuperAdminGuard';\nexport type { SuperAdminGuardProps } from './SuperAdminGuard';\n\n// Removed: Protected and AdminGuard components (unused)\n\n// ============================================================================\n// NAVIGATION COMPONENTS\n// ============================================================================\n\nexport {\n NavigationMenu,\n} from './NavigationMenu';\nexport type { NavigationMenuProps, NavigationItem } from './NavigationMenu';\n\nexport { OrganisationSelector } from './OrganisationSelector';\nexport type { OrganisationSelectorProps } from './OrganisationSelector';\n\nexport { UserMenu } from './UserMenu';\n\n// Reusable Page/Layout Components\nexport * from './PaceAppLayout';\nexport * from './PaceLoginPage';\n\n// ============================================================================\n// UTILITY COMPONENTS\n// ============================================================================\n\nexport { ErrorBoundary } from './ErrorBoundary';\nexport type { ErrorBoundaryProps, ErrorBoundaryState } from './ErrorBoundary';\nexport { LoadingSpinner } from './LoadingSpinner';\n\n// ============================================================================\n// EVENT MANAGEMENT\n// ============================================================================\n\nexport { EventSelector } from './EventSelector';\n\n// ============================================================================\n// AUTHENTICATION FORMS\n// ============================================================================\n\n// Password Component exports\nexport { PasswordResetForm } from './PasswordReset';\n\n// ============================================================================\n// STORAGE COMPONENTS\n// ============================================================================\n\nexport { FileUpload } from './FileUpload';\nexport type { FileUploadProps } from './FileUpload';\n\nexport { FileDisplay } from './FileDisplay';\nexport type { FileDisplayProps } from './FileDisplay';\n\n\n// ============================================================================\n// TYPES\n// ============================================================================\n\nexport { FileCategory } from '../types/file-reference';\nexport type { FileReference, FileMetadata, FileUploadOptions } from '../types/file-reference';\n\n// ============================================================================\n// HOOKS\n// ============================================================================\n\nexport { useStorage, useFileUpload } from '../hooks/useStorage';\nexport type { UseStorageOptions, UseStorageReturn } from '../hooks/useStorage';\n\nexport { useFileReference, useFileReferenceForRecord } from '../hooks/useFileReference';\nexport type { UseFileReferenceOptions, UseFileReferenceReturn, UseFileReferenceForRecordReturn } from '../hooks/useFileReference';\n\nexport { useToast } from '../hooks/useToast';\n\n// RBAC Components - Use the new RBAC system\n// For RBAC functionality, import from @jmruthers/pace-core/rbac\n// export { PermissionGuard, AccessLevelGuard } from '@jmruthers/pace-core/rbac';\n","/**\n * @file FormField Component\n * @package @jmruthers/pace-core\n * @module Components/Form\n * @since 0.1.0\n *\n * A flexible form field component that integrates with React Hook Form and provides\n * built-in validation, error handling, and accessibility features.\n *\n * Features:\n * - React Hook Form integration with Controller\n * - Built-in validation with error display\n * - Accessible labels and error messages\n * - Custom render function support\n * - TypeScript support with generic field paths\n * - Consistent styling with error states\n * - Test ID support for testing\n * - Flexible input types and props\n *\n * @example\n * ```tsx\n * // Basic text field\n * <FormField\n * name=\"username\"\n * label=\"Username\"\n * placeholder=\"Enter your username\"\n * validation={{ required: true }}\n * />\n * \n * // Email field with custom validation\n * <FormField\n * name=\"email\"\n * label=\"Email Address\"\n * type=\"email\"\n * validation={{\n * required: true,\n * pattern: {\n * value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}$/i,\n * message: \"Invalid email address\"\n * }\n * }}\n * />\n * \n * // Custom render function\n * <FormField\n * name=\"avatar\"\n * label=\"Profile Picture\"\n * render={({ field }) => (\n * <input\n * {...field}\n * type=\"file\"\n * accept=\"image/*\"\n * className=\"file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-sec-50 file:text-sec-700 hover:file:bg-sec-100\"\n * />\n * )}\n * />\n * \n * // With test ID for testing\n * <FormField\n * name=\"password\"\n * label=\"Password\"\n * type=\"password\"\n * data-testid=\"password-field\"\n * validation={{\n * required: true,\n * minLength: {\n * value: 8,\n * message: \"Password must be at least 8 characters\"\n * }\n * }}\n * />\n * ```\n *\n * @accessibility\n * - Proper label association with htmlFor\n * - Error messages with role=\"alert\"\n * - Required field indicators\n * - Focus management\n * - Screen reader friendly error announcements\n * - Keyboard navigation support\n *\n * @dependencies\n * - react-hook-form - Form integration\n * - React 18+ - Hooks and context\n * - Tailwind CSS - Styling\n */\n\nimport React from 'react';\nimport { useFormContext, Controller, FieldPath, FieldValues } from 'react-hook-form';\nimport { cn } from '../../utils/cn';\nimport { Label } from '../Label';\n\nexport interface FormFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> {\n /**\n * Field name\n */\n name: TName;\n \n /**\n * Field label\n */\n label?: string;\n \n /**\n * Field type\n */\n type?: string;\n \n /**\n * Placeholder text\n */\n placeholder?: string;\n \n /**\n * Additional props for the input\n */\n inputProps?: React.InputHTMLAttributes<HTMLInputElement>;\n \n /**\n * Validation rules\n */\n validation?: {\n required?: boolean;\n pattern?: {\n value: RegExp;\n message: string;\n };\n minLength?: {\n value: number;\n message: string;\n };\n maxLength?: {\n value: number;\n message: string;\n };\n };\n \n /**\n * Custom render function\n */\n render?: ({ field }: { field: any }) => React.ReactElement;\n \n /**\n * Test ID\n */\n 'data-testid'?: string;\n \n /**\n * Class name\n */\n className?: string;\n}\n\n/**\n * FormField component for React Hook Form integration\n * \n * @template TFieldValues - The type of form field values\n * @template TName - The type of the field name (must be a valid field path)\n * @param props - Form field configuration and validation\n * @returns JSX.Element - The rendered form field with validation\n * \n * @example\n * ```tsx\n * <FormField\n * name=\"email\"\n * label=\"Email\"\n * type=\"email\"\n * validation={{\n * required: true,\n * pattern: {\n * value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}$/i,\n * message: \"Please enter a valid email address\"\n * }\n * }}\n * />\n * ```\n */\nexport function FormField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n name,\n label,\n type = \"text\",\n placeholder,\n inputProps,\n validation,\n render,\n 'data-testid': testId,\n className,\n}: FormFieldProps<TFieldValues, TName>) {\n const { control, formState: { errors } } = useFormContext<TFieldValues>();\n const fieldError = errors[name];\n\n // Safely extract error message\n const errorMessage = fieldError && typeof fieldError === 'object' && 'message' in fieldError \n ? String(fieldError.message) \n : undefined;\n\n return (\n <div className={cn(\"space-y-2\", className)}>\n {label && (\n <Label htmlFor={name}>\n {label}\n {validation?.required && (\n <span className=\"text-destructive ml-1\" aria-label=\"required\">\n *\n </span>\n )}\n </Label>\n )}\n \n <Controller\n name={name}\n control={control}\n rules={validation}\n render={({ field }) => {\n if (render) {\n return render({ field });\n }\n \n return (\n <input\n {...field}\n id={name}\n type={type}\n placeholder={placeholder}\n data-testid={testId}\n className={cn(\n \"flex h-10 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\",\n fieldError && \"border-destructive focus-visible:ring-destructive\"\n )}\n {...inputProps}\n />\n );\n }}\n />\n \n {errorMessage && (\n <p className=\"text-destructive\" role=\"alert\">\n {errorMessage}\n </p>\n )}\n </div>\n );\n}\n","\n/**\n * @file FormErrorSummary Component\n * @package @jmruthers/pace-core\n * @module Components/Form\n * @since 0.1.0\n *\n * A form error summary component that displays validation errors in a user-friendly format.\n * Provides a centralized location for users to see all form errors at once.\n *\n * Features:\n * - Displays all form errors in one place\n * - Configurable error display format\n * - Optional field name display\n * - Accessible error presentation\n * - Consistent styling with Alert component\n * - Automatic error filtering\n * - Responsive design\n *\n * @example\n * ```tsx\n * // Basic error summary\n * <FormErrorSummary errors={formErrors} />\n * \n * // With custom title\n * <FormErrorSummary \n * errors={formErrors}\n * title=\"Please correct the following issues:\"\n * />\n * \n * // Show field names with errors\n * <FormErrorSummary \n * errors={formErrors}\n * showFieldNames={true}\n * />\n * \n * // In a form with React Hook Form\n * const { formState: { errors } } = useForm();\n * \n * <Form onSubmit={handleSubmit}>\n * <FormField name=\"email\" label=\"Email\" />\n * <FormField name=\"password\" label=\"Password\" />\n * <FormErrorSummary errors={errors} />\n * <Button type=\"submit\">Submit</Button>\n * </Form>\n * ```\n *\n * @accessibility\n * - Uses Alert component for consistent accessibility\n * - Proper heading hierarchy with h3\n * - List structure for error items\n * - Screen reader friendly error announcements\n * - High contrast support via Alert component\n *\n * @dependencies\n * - Alert component for consistent styling\n * - React 18+ - Component framework\n * - Tailwind CSS - Styling\n */\n\nimport { Alert } from '../Alert';\n\nexport interface FormErrorSummaryProps {\n /** Form validation errors object */\n errors?: Record<string, any>;\n /** Title displayed above the error list */\n title?: string;\n /** Whether to show field names alongside error messages */\n showFieldNames?: boolean;\n}\n\n/**\n * FormErrorSummary component for displaying form validation errors\n * \n * This component provides a user-friendly way to display all form errors\n * in one centralized location, improving the user experience by making\n * it clear what needs to be fixed.\n * \n * @param props - Component configuration\n * @param props.errors - Form validation errors object\n * @param props.title - Title displayed above the error list\n * @param props.showFieldNames - Whether to show field names with errors\n * @returns JSX.Element - The rendered error summary or null if no errors\n */\nexport function FormErrorSummary({ \n errors = {}, \n title = \"Please fix the following errors:\",\n showFieldNames = false \n}: FormErrorSummaryProps) {\n const errorEntries = Object.entries(errors).filter(([, value]) => Boolean(value));\n\n if (errorEntries.length === 0) {\n return null;\n }\n\n return (\n <Alert variant=\"destructive\" className=\"mb-4\">\n <div>\n <h3>{title}</h3>\n <ul className=\"list-disc list-inside space-y-1\">\n {errorEntries.map(([field, error], index) => {\n const message = typeof error === 'object' && error.message ? error.message : String(error);\n return (\n <li key={index} className=\"text-sm\">\n {showFieldNames ? `${field}: ${message}` : message}\n </li>\n );\n })}\n </ul>\n </div>\n </Alert>\n );\n}\n","/**\n * @file FormLiveRegion Component\n * @package @jmruthers/pace-core\n * @module Components/Form\n * @since 0.1.0\n *\n * An accessible live region component for form validation announcements.\n * Provides real-time feedback to screen readers about form validation states\n * and error messages, improving accessibility for users with assistive technologies.\n *\n * Features:\n * - Real-time form validation announcements\n * - Configurable politeness levels (polite/assertive)\n * - Customizable delay timing\n * - Field-level and form-level announcements\n * - Success message customization\n * - Automatic error counting and field identification\n * - Accessibility compliant with ARIA live regions\n * - Integration with React Hook Form\n *\n * @example\n * ```tsx\n * // Basic live region\n * const { control, formState } = useForm();\n * \n * <Form onSubmit={handleSubmit}>\n * <FormField name=\"email\" label=\"Email\" />\n * <FormField name=\"password\" label=\"Password\" />\n * <FormLiveRegion form={{ control, formState }} />\n * <Button type=\"submit\">Submit</Button>\n * </Form>\n * \n * // With custom configuration\n * <FormLiveRegion\n * form={{ control, formState }}\n * politeness=\"assertive\"\n * delay={1000}\n * successMessage=\"Your form was submitted successfully!\"\n * enableFieldAnnouncements={true}\n * />\n * \n * // In a complex form\n * function ComplexForm() {\n * const methods = useForm({\n * defaultValues: { name: '', email: '', message: '' }\n * });\n * \n * return (\n * <FormProvider {...methods}>\n * <form onSubmit={methods.handleSubmit(onSubmit)}>\n * <FormField name=\"name\" label=\"Name\" />\n * <FormField name=\"email\" label=\"Email\" />\n * <FormField name=\"message\" label=\"Message\" />\n * <FormLiveRegion \n * form={methods}\n * politeness=\"polite\"\n * delay={300}\n * />\n * <Button type=\"submit\">Send Message</Button>\n * </form>\n * </FormProvider>\n * );\n * }\n * ```\n *\n * @accessibility\n * - ARIA live region for screen reader announcements\n * - Configurable politeness levels for different message types\n * - Automatic error counting and field identification\n * - Non-intrusive validation feedback\n * - WCAG 2.1 AA compliant\n * - Screen reader friendly error announcements\n *\n * @dependencies\n * - react-hook-form - Form state management\n * - React 18+ - Hooks and effects\n * - Tailwind CSS - Styling\n */\n\nimport React, { useEffect, useState } from 'react';\nimport { UseFormReturn, FieldValues } from 'react-hook-form';\nimport { cn } from '../../utils/cn';\n\n/**\n * Props for the FormLiveRegion component\n */\nexport interface FormLiveRegionProps<T extends FieldValues> {\n /** React Hook Form instance */\n form: UseFormReturn<T>;\n /** ARIA live region politeness level */\n politeness?: 'polite' | 'assertive';\n /** Delay before announcing messages (in ms) */\n delay?: number;\n /** Custom success message */\n successMessage?: string;\n /** Custom class name */\n className?: string;\n /** Enable field-level validation announcements */\n enableFieldAnnouncements?: boolean;\n}\n\n/**\n * FormLiveRegion component for accessible form validation announcements\n */\nexport function FormLiveRegion<T extends FieldValues>({\n form,\n politeness = 'polite',\n delay = 500,\n successMessage = 'Form submitted successfully',\n className,\n enableFieldAnnouncements = true\n}: FormLiveRegionProps<T>): React.ReactElement {\n const [message, setMessage] = useState<string>('');\n const { formState } = form;\n\n // Handle form-level announcements\n useEffect(() => {\n let timeoutId: NodeJS.Timeout;\n\n if (formState.isSubmitting) {\n setMessage('Submitting form...');\n } else if (formState.isSubmitSuccessful) {\n timeoutId = setTimeout(() => {\n setMessage(successMessage);\n }, delay);\n } else if (formState.errors && Object.keys(formState.errors).length > 0) {\n const errorCount = Object.keys(formState.errors).length;\n const errorFields = Object.keys(formState.errors).join(', ');\n setMessage(`Form has ${errorCount} error${errorCount === 1 ? '' : 's'} in: ${errorFields}`);\n } else if (formState.isValid && formState.isDirty) {\n setMessage('Form is valid');\n } else {\n setMessage('');\n }\n\n return () => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n };\n }, [formState, delay, successMessage]);\n\n // Handle field-level announcements\n useEffect(() => {\n if (!enableFieldAnnouncements) return;\n\n let timeoutId: NodeJS.Timeout;\n \n const fieldErrors = formState.errors;\n const touchedFields = formState.touchedFields;\n \n // Find newly touched fields with errors\n const newErrors = Object.keys(fieldErrors).filter(field => {\n // Type-safe access to touchedFields\n const touchedField = touchedFields as Record<string, boolean>;\n return touchedField[field] && fieldErrors[field as keyof typeof fieldErrors];\n });\n\n if (newErrors.length > 0) {\n timeoutId = setTimeout(() => {\n const errorField = newErrors[0];\n const errorData = fieldErrors[errorField as keyof typeof fieldErrors];\n const errorMessage = errorData?.message;\n if (errorMessage) {\n setMessage(`${errorField}: ${errorMessage}`);\n }\n }, delay);\n }\n\n return () => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n };\n }, [formState.errors, formState.touchedFields, enableFieldAnnouncements, delay]);\n\n if (!message) {\n return <></>;\n }\n\n return (\n <div\n role=\"status\"\n aria-live={politeness}\n aria-atomic=\"true\"\n className={cn('sr-only', className)}\n style={{\n position: 'absolute',\n left: '-10000px',\n width: '1px',\n height: '1px',\n overflow: 'hidden'\n }}\n >\n {message}\n </div>\n );\n}\n","/**\n * @file FormFieldset Component\n * @package @jmruthers/pace-core\n * @module Components/Form\n * @since 0.1.0\n *\n * A form fieldset component that groups related form fields together with a legend\n * and optional description. Provides semantic structure and accessibility for form sections.\n *\n * Features:\n * - Semantic fieldset grouping for related form fields\n * - Accessible legend with required indicator\n * - Optional description text with proper ARIA association\n * - Consistent styling with design system\n * - Forwarded ref support\n * - Customizable styling via className\n * - Required field indication\n * - Responsive design\n *\n * @example\n * ```tsx\n * // Basic fieldset\n * <FormFieldset legend=\"Personal Information\">\n * <FormField name=\"firstName\" label=\"First Name\" />\n * <FormField name=\"lastName\" label=\"Last Name\" />\n * <FormField name=\"email\" label=\"Email\" />\n * </FormFieldset>\n * \n * // Fieldset with description\n * <FormFieldset \n * legend=\"Contact Details\" \n * description=\"We'll use this information to contact you about your order\"\n * >\n * <FormField name=\"phone\" label=\"Phone Number\" />\n * <FormField name=\"address\" label=\"Address\" />\n * </FormFieldset>\n * \n * // Required fieldset\n * <FormFieldset \n * legend=\"Account Settings\" \n * required={true}\n * description=\"These settings are required for account creation\"\n * >\n * <FormField name=\"username\" label=\"Username\" required />\n * <FormField name=\"password\" label=\"Password\" type=\"password\" required />\n * </FormFieldset>\n * \n * // With custom styling\n * <FormFieldset \n * legend=\"Preferences\"\n * className=\"bg-sec-50 border-sec-200\"\n * >\n * <FormField name=\"newsletter\" label=\"Subscribe to newsletter\" type=\"checkbox\" />\n * <FormField name=\"notifications\" label=\"Enable notifications\" type=\"checkbox\" />\n * </FormFieldset>\n * ```\n *\n * @accessibility\n * - Proper semantic HTML with fieldset and legend\n * - ARIA describedby association for descriptions\n * - Required field indication with asterisk\n * - Screen reader friendly structure\n * - Keyboard navigation support\n * - WCAG 2.1 AA compliant\n *\n * @dependencies\n * - React 18+ - Component framework and hooks\n * - Tailwind CSS - Styling\n * - cn utility - Class name merging\n */\n\nimport React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport interface FormFieldsetProps extends React.FieldsetHTMLAttributes<HTMLFieldSetElement> {\n /** The legend text for the fieldset */\n legend: string;\n /** Optional description text below the legend */\n description?: string;\n /** Whether the fieldset contains required fields */\n required?: boolean;\n /** Form fields to group within the fieldset */\n children: React.ReactNode;\n}\n\n/**\n * FormFieldset component for grouping related form fields\n * \n * This component provides semantic grouping for form fields with proper\n * accessibility support and consistent styling. Use it to organize\n * related form inputs into logical sections.\n * \n * @param props - Component configuration\n * @param props.legend - The legend text for the fieldset\n * @param props.description - Optional description text\n * @param props.required - Whether the fieldset contains required fields\n * @param props.children - Form fields to group\n * @param ref - Forwarded ref to the fieldset element\n * @returns JSX.Element - The rendered fieldset with legend and fields\n */\nexport const FormFieldset = React.forwardRef<HTMLFieldSetElement, FormFieldsetProps>(\n ({ legend, description, required, className, children, ...props }, ref) => {\n const descriptionId = React.useId();\n \n return (\n <fieldset\n ref={ref}\n className={cn(\"space-y-4 border border-input rounded-lg p-4\", className)}\n aria-describedby={description ? descriptionId : undefined}\n {...props}\n >\n <legend className=\"px-2\">\n {legend}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </legend>\n {description && (\n <p id={descriptionId} className=\"text-muted-foreground\">\n {description}\n </p>\n )}\n {children}\n </fieldset>\n );\n }\n);\n\nFormFieldset.displayName = \"FormFieldset\";\n","/**\n * Super Admin Guard Component\n * @package @jmruthers/pace-core\n * @module Components/SuperAdminGuard\n * @since 1.0.0\n * \n * A reusable component for protecting content that should only be visible to super admins.\n */\n\nimport React from 'react';\nimport { useRBAC } from '../rbac/hooks/useRBAC';\n\nexport interface SuperAdminGuardProps {\n children: React.ReactNode;\n fallback?: React.ReactNode;\n showDebugInfo?: boolean;\n}\n\n/**\n * Super Admin Guard Component\n * \n * Renders children only if the current user is a super admin.\n * Provides a fallback for non-super admin users.\n * \n * @param children - Content to render for super admins\n * @param fallback - Content to render for non-super admins (optional)\n * @param showDebugInfo - Whether to show debug information (optional)\n */\nexport function SuperAdminGuard({ \n children, \n fallback = null, \n showDebugInfo = false \n}: SuperAdminGuardProps) {\n const { isSuperAdmin, hasGlobalPermission, isLoading } = useRBAC();\n\n // Show loading state\n if (isLoading) {\n return (\n <div className=\"super-admin-guard-loading\">\n <div className=\"loading-spinner\" />\n <span>Checking permissions...</span>\n </div>\n );\n }\n\n // Show debug info if enabled\n if (showDebugInfo) {\n console.log('[SuperAdminGuard] Debug Info:', {\n isSuperAdmin,\n isLoading\n });\n }\n\n // Render children for super admins\n if (isSuperAdmin) {\n return (\n <div className=\"super-admin-content\">\n {children}\n </div>\n );\n }\n\n // Render fallback for non-super admins\n return (\n <div className=\"super-admin-fallback\">\n {fallback}\n </div>\n );\n}\n\n/**\n * Super Admin Badge Component\n * \n * Shows a visual indicator when the current user is a super admin.\n */\nexport function SuperAdminBadge() {\n const { isSuperAdmin } = useRBAC();\n\n if (!isSuperAdmin) {\n return null;\n }\n\n return (\n <div className=\"super-admin-badge\">\n <span className=\"badge-text\">SUPER ADMIN</span>\n </div>\n );\n}\n\n/**\n * Super Admin Debug Panel\n * \n * Shows debug information about the current user's permissions.\n * Only visible to super admins and in development mode.\n */\nexport function SuperAdminDebugPanel() {\n const { isSuperAdmin, isLoading } = useRBAC();\n\n // Only show in development or for super admins\n if (import.meta.env.MODE !== 'development' && !isSuperAdmin) {\n return null;\n }\n\n return (\n <div className=\"super-admin-debug-panel\">\n <h4>Super Admin Debug Info</h4>\n <div className=\"debug-info\">\n <p><strong>Is Super Admin:</strong> {isSuperAdmin ? 'Yes' : 'No'}</p>\n <p><strong>Is Loading:</strong> {isLoading ? 'Yes' : 'No'}</p>\n <p><strong>Environment:</strong> {import.meta.env.MODE}</p>\n </div>\n </div>\n );\n}\n\nexport default SuperAdminGuard;\n","// File Upload Component\n// Provides a file upload interface using the file reference system\n\nimport React, { useState, useCallback, useRef } from 'react';\nimport { SupabaseClient } from '@supabase/supabase-js';\nimport { FileCategory } from '../types/file-reference';\nimport { useFileReference } from '../hooks/useFileReference';\n\nexport interface FileUploadProps {\n supabase: SupabaseClient;\n table_name: string;\n record_id: string;\n organisation_id: string;\n app_id: string;\n category: FileCategory;\n accept?: string;\n maxSize?: number;\n multiple?: boolean;\n disabled?: boolean;\n className?: string;\n onUploadSuccess?: (result: any) => void;\n onUploadError?: (error: string) => void;\n children?: React.ReactNode;\n}\n\nexport function FileUpload({\n supabase,\n table_name,\n record_id,\n organisation_id,\n app_id,\n category,\n accept = '*/*',\n maxSize = 10 * 1024 * 1024, // 10MB default\n multiple = false,\n disabled = false,\n className = '',\n onUploadSuccess,\n onUploadError,\n children\n}: FileUploadProps) {\n const [isDragging, setIsDragging] = useState(false);\n const fileInputRef = useRef<HTMLInputElement>(null);\n const { uploadFile, isLoading, error } = useFileReference(supabase);\n\n const handleFileSelect = useCallback(async (files: FileList | null) => {\n if (!files || files.length === 0) return;\n\n const fileArray = Array.from(files);\n \n // Validate file sizes\n const oversizedFiles = fileArray.filter(file => file.size > maxSize);\n if (oversizedFiles.length > 0) {\n const errorMessage = `Files exceed maximum size of ${Math.round(maxSize / 1024 / 1024)}MB: ${oversizedFiles.map(f => f.name).join(', ')}`;\n onUploadError?.(errorMessage);\n return;\n }\n\n // Upload files\n for (const file of fileArray) {\n try {\n const result = await uploadFile({\n table_name,\n record_id,\n organisation_id,\n app_id,\n category,\n is_public: false\n }, file);\n\n if (result) {\n onUploadSuccess?.(result);\n } else {\n onUploadError?.('Upload failed');\n }\n } catch (err) {\n const errorMessage = err instanceof Error ? err.message : 'Upload failed';\n onUploadError?.(errorMessage);\n }\n }\n }, [uploadFile, table_name, record_id, organisation_id, app_id, category, maxSize, onUploadSuccess, onUploadError]);\n\n const handleDragOver = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n if (!disabled) {\n setIsDragging(true);\n }\n }, [disabled]);\n\n const handleDragLeave = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragging(false);\n }, []);\n\n const handleDrop = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragging(false);\n \n if (disabled) return;\n \n const files = e.dataTransfer.files;\n handleFileSelect(files);\n }, [disabled, handleFileSelect]);\n\n const handleFileInputChange = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\n handleFileSelect(e.target.files);\n // Reset input value to allow re-uploading the same file\n if (e.target) {\n e.target.value = '';\n }\n }, [handleFileSelect]);\n\n const handleClick = useCallback(() => {\n if (!disabled && fileInputRef.current) {\n fileInputRef.current.click();\n }\n }, [disabled]);\n\n const dragClasses = isDragging ? 'border-main-500 bg-main-50' : 'border-sec-300 hover:border-sec-400';\n const disabledClasses = disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer hover:bg-sec-50';\n\n return (\n <div\n className={`relative border-2 border-dashed rounded-lg p-6 text-center transition-colors ${dragClasses} ${disabledClasses} ${className}`}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n onDrop={handleDrop}\n onClick={handleClick}\n >\n <input\n ref={fileInputRef}\n type=\"file\"\n accept={accept}\n multiple={multiple}\n onChange={handleFileInputChange}\n className=\"hidden\"\n disabled={disabled}\n />\n \n {children || (\n <div className=\"space-y-2\">\n <div className=\"text-sec-600\">\n {isDragging ? (\n 'Drop files here...'\n ) : (\n <>\n <span className=\"font-medium\">Click to upload</span>\n {' '}or drag and drop\n </>\n )}\n </div>\n <div className=\"text-sm text-sec-500\">\n {accept !== '*/*' && `Accepted formats: ${accept}`}\n {maxSize && ` • Max size: ${Math.round(maxSize / 1024 / 1024)}MB`}\n {multiple && ' • Multiple files allowed'}\n </div>\n </div>\n )}\n \n {isLoading && (\n <div className=\"absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center\">\n <div className=\"animate-spin rounded-full h-8 w-8 border-b-2 border-main-500\"></div>\n </div>\n )}\n \n {error && (\n <div className=\"mt-2 text-sm text-acc-600\">\n {error}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,IAAI,CAAC;AAAA,YAC5D,YAAY;AAAA,aACf;AAAA,WACF;AAAA,QAGD,aACC,gBAAAD,KAAC,SAAI,WAAU,4EACb,0BAAAA,KAAC,SAAI,WAAU,gEAA+D,GAChF;AAAA,QAGD,SACC,gBAAAA,KAAC,SAAI,WAAU,6BACZ,iBACH;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":["jsx","jsxs","jsx","React","jsx","jsxs","React","jsx","jsxs","useState","Fragment","jsx","jsxs","useState"]}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Database type definitions for Supabase
|
|
3
|
+
*
|
|
4
|
+
* NOTE: This file is manually maintained and synced with the generated types.
|
|
5
|
+
* The generated file (database.generated.ts) is created by running:
|
|
6
|
+
*
|
|
7
|
+
* npx supabase gen types typescript --project-id <project-id> > src/types/database.generated.ts
|
|
8
|
+
*
|
|
9
|
+
* For production use, prefer the generated types which are always in sync with the database schema.
|
|
3
10
|
*/
|
|
4
11
|
interface Database {
|
|
5
12
|
public: {
|
|
@@ -463,6 +470,17 @@ interface Database {
|
|
|
463
470
|
organisation_id: string;
|
|
464
471
|
}[];
|
|
465
472
|
};
|
|
473
|
+
rbac_check_permission_simplified: {
|
|
474
|
+
Args: {
|
|
475
|
+
p_user_id: string;
|
|
476
|
+
p_permission: string;
|
|
477
|
+
p_organisation_id?: string;
|
|
478
|
+
p_event_id?: string;
|
|
479
|
+
p_app_id?: string;
|
|
480
|
+
p_page_id?: string;
|
|
481
|
+
};
|
|
482
|
+
Returns: boolean;
|
|
483
|
+
};
|
|
466
484
|
};
|
|
467
485
|
};
|
|
468
486
|
}
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export { u as useToast } from './useToast-Bm6TnSK-.js';
|
|
2
|
-
export { O as OrganisationSecurityHook, d as UseAppConfigReturn, U as UseOrganisationPermissionsReturn, r as UsePublicEventLogoOptions, q as UsePublicEventLogoReturn, p as UsePublicEventOptions, o as UsePublicEventReturn, s as UsePublicRouteParamsReturn, f as clearPublicEventCache, i as clearPublicLogoCache, n as extractEventCodeFromPath, m as generatePublicRoutePath, g as getPublicEventCacheStats, j as getPublicLogoCacheStats, c as useAppConfig, u as useEventTheme, a as useOrganisationPermissions, b as useOrganisationSecurity, e as usePublicEvent, l as usePublicEventCode, h as usePublicEventLogo, k as usePublicRouteParams } from './usePublicRouteParams-
|
|
2
|
+
export { O as OrganisationSecurityHook, d as UseAppConfigReturn, U as UseOrganisationPermissionsReturn, r as UsePublicEventLogoOptions, q as UsePublicEventLogoReturn, p as UsePublicEventOptions, o as UsePublicEventReturn, s as UsePublicRouteParamsReturn, f as clearPublicEventCache, i as clearPublicLogoCache, n as extractEventCodeFromPath, m as generatePublicRoutePath, g as getPublicEventCacheStats, j as getPublicLogoCacheStats, c as useAppConfig, u as useEventTheme, a as useOrganisationPermissions, b as useOrganisationSecurity, e as usePublicEvent, l as usePublicEventCode, h as usePublicEventLogo, k as usePublicRouteParams } from './usePublicRouteParams-BlgwXweB.js';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
4
|
import { SortingState, ColumnFiltersState, ExpandedState } from '@tanstack/react-table';
|
|
5
5
|
import * as react_hook_form from 'react-hook-form';
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
export { u as useComponentPerformance } from './useComponentPerformance-DE9l5RkL.js';
|
|
8
|
-
import { D as DataRecord, P as PerformanceConfig, S as ServerSideConfig, C as ChunkingConfig, e as SearchIndexConfig, d as PaginationMode, h as ServerSideParams, i as ServerSideResponse } from './types-
|
|
9
|
-
import './organisation-
|
|
10
|
-
import './unified-
|
|
8
|
+
import { D as DataRecord, P as PerformanceConfig, S as ServerSideConfig, C as ChunkingConfig, e as SearchIndexConfig, d as PaginationMode, h as ServerSideParams, i as ServerSideResponse } from './types-BDg1mAGG.js';
|
|
9
|
+
import './organisation-D6qRDtbF.js';
|
|
10
|
+
import './unified-DQ4VcT7H.js';
|
|
11
11
|
import '@supabase/supabase-js';
|
|
12
|
-
import './database-
|
|
12
|
+
import './database-BXAfr2Y_.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @file Error Handling Stubs
|
package/dist/hooks.js
CHANGED
|
@@ -9,25 +9,24 @@ import {
|
|
|
9
9
|
usePublicEvent,
|
|
10
10
|
usePublicEventCode,
|
|
11
11
|
usePublicRouteParams
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-PTR5PMPE.js";
|
|
13
13
|
import {
|
|
14
14
|
useSecureDataAccess
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-5BO3MI5Y.js";
|
|
16
16
|
import {
|
|
17
17
|
clearPublicLogoCache,
|
|
18
18
|
getPublicLogoCacheStats,
|
|
19
19
|
useAppConfig,
|
|
20
20
|
usePublicEventLogo
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-VSOKOFRF.js";
|
|
22
22
|
import {
|
|
23
23
|
useDataTablePerformance,
|
|
24
24
|
useToast
|
|
25
25
|
} from "./chunk-YCKPEMJA.js";
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-ULBI5JGB.js";
|
|
26
|
+
import "./chunk-FT2M4R4F.js";
|
|
27
|
+
import "./chunk-FL4ZCQLD.js";
|
|
28
|
+
import "./chunk-QGVSOUJ2.js";
|
|
29
|
+
import "./chunk-MNJXXD6C.js";
|
|
31
30
|
import {
|
|
32
31
|
useComponentPerformance
|
|
33
32
|
} from "./chunk-66C4BSAY.js";
|
|
@@ -35,7 +34,7 @@ import {
|
|
|
35
34
|
PERFORMANCE_BUDGETS,
|
|
36
35
|
performanceBudgetMonitor
|
|
37
36
|
} from "./chunk-O3NWNXDY.js";
|
|
38
|
-
import "./chunk-
|
|
37
|
+
import "./chunk-CVMVPYAL.js";
|
|
39
38
|
import "./chunk-A6HBIY5P.js";
|
|
40
39
|
import "./chunk-PLDDJCW6.js";
|
|
41
40
|
|