@jmruthers/pace-core 0.5.54 → 0.5.56
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/README.md +0 -4
- package/dist/{DataTable-7FMFXA7A.js → DataTable-DJQTKX33.js} +11 -11
- package/dist/{PublicLoadingSpinner-Bq_-BeK-.d.ts → PublicLoadingSpinner-SL8WaQN7.d.ts} +2 -21
- package/dist/{api-H5A3H4IR.js → api-LUNF5O6M.js} +3 -3
- package/dist/{appConfig-BVGyuvI7.d.ts → appConfig-DjpeG6P-.d.ts} +9 -1
- package/dist/{appNameResolver-7GHF5ED2.js → appNameResolver-UURKN7NF.js} +2 -2
- package/dist/{audit-BUW3LMJB.js → audit-6TOCAMKO.js} +2 -2
- package/dist/{chunk-NRK4AIHQ.js → chunk-2DFCT6D3.js} +3 -3
- package/dist/{chunk-GIO7BFE7.js → chunk-3JKVVLD3.js} +66 -169
- package/dist/{chunk-GIO7BFE7.js.map → chunk-3JKVVLD3.js.map} +1 -1
- package/dist/{chunk-MZBUOP4P.js → chunk-5BSLGBYI.js} +4 -3
- package/dist/chunk-5BSLGBYI.js.map +1 -0
- package/dist/{chunk-I5Z3QH5X.js → chunk-66C4BSAY.js} +2 -2
- package/dist/{chunk-I5Z3QH5X.js.map → chunk-66C4BSAY.js.map} +1 -1
- package/dist/{chunk-EL2O4IUX.js → chunk-ASXSJGPW.js} +20 -24
- package/dist/{chunk-EL2O4IUX.js.map → chunk-ASXSJGPW.js.map} +1 -1
- package/dist/{chunk-7BNPOCLL.js → chunk-B2WTCLCV.js} +6 -2
- package/dist/chunk-B2WTCLCV.js.map +1 -0
- package/dist/{chunk-WJARTBCT.js → chunk-D7ARGIA3.js} +16 -7
- package/dist/chunk-D7ARGIA3.js.map +1 -0
- package/dist/{chunk-MYP2EGHX.js → chunk-GIDCWCHF.js} +21 -14
- package/dist/chunk-GIDCWCHF.js.map +1 -0
- package/dist/{chunk-MSFACPQQ.js → chunk-HYNGIE5T.js} +11 -11
- package/dist/{chunk-MSFACPQQ.js.map → chunk-HYNGIE5T.js.map} +1 -1
- package/dist/{chunk-TRIZ7IB7.js → chunk-I5GID3EX.js} +148 -288
- package/dist/chunk-I5GID3EX.js.map +1 -0
- package/dist/{chunk-GWSBHC4J.js → chunk-KLPVOPRI.js} +261 -38
- package/dist/chunk-KLPVOPRI.js.map +1 -0
- package/dist/{chunk-BC3S53OZ.js → chunk-N6XMGSGD.js} +30 -14
- package/dist/chunk-N6XMGSGD.js.map +1 -0
- package/dist/{chunk-6MTY77WU.js → chunk-QB4GXDUM.js} +3 -3
- package/dist/{chunk-YDJW5XTN.js → chunk-STT7INZR.js} +25 -1
- package/dist/chunk-STT7INZR.js.map +1 -0
- package/dist/{chunk-NYUJ4FJR.js → chunk-UETTVYKU.js} +7 -7
- package/dist/chunk-UETTVYKU.js.map +1 -0
- package/dist/{chunk-22KLBHPS.js → chunk-W66AZIOH.js} +2 -2
- package/dist/chunk-W66AZIOH.js.map +1 -0
- package/dist/{chunk-NZ655MWE.js → chunk-YEHO6FDW.js} +5 -4
- package/dist/chunk-YEHO6FDW.js.map +1 -0
- package/dist/{chunk-SS3E6QLB.js → chunk-YNUBMSMV.js} +2 -2
- package/dist/chunk-YNUBMSMV.js.map +1 -0
- package/dist/{chunk-74C6SNEC.js → chunk-ZPK5656W.js} +3 -3
- package/dist/{chunk-74C6SNEC.js.map → chunk-ZPK5656W.js.map} +1 -1
- package/dist/components.d.ts +22 -899
- package/dist/components.js +436 -3118
- package/dist/components.js.map +1 -1
- package/dist/file-reference-9xUOnwyt.d.ts +70 -0
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +10 -10
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +49 -9
- package/dist/index.js +190 -25
- package/dist/index.js.map +1 -1
- package/dist/{organisation-CO3Sh3_D.d.ts → organisation-t-vvQC3g.d.ts} +1 -8
- package/dist/providers.d.ts +2 -2
- package/dist/providers.js +5 -5
- package/dist/rbac/index.d.ts +65 -46
- package/dist/rbac/index.js +10 -12
- package/dist/styles/core.css +0 -125
- package/dist/types.d.ts +2 -1
- package/dist/types.js +3 -1
- package/dist/types.js.map +1 -1
- package/dist/{usePublicRouteParams-B2OcAsur.d.ts → usePublicRouteParams-CdoFxnJK.d.ts} +1 -1
- package/dist/utils.d.ts +3 -4
- package/dist/utils.js +44 -13
- package/dist/utils.js.map +1 -1
- package/docs/FILE_REFERENCE_SYSTEM.md +440 -0
- package/docs/INDEX.md +7 -5
- package/docs/README.md +0 -1
- package/docs/api/README.md +0 -4
- package/docs/api/classes/ErrorBoundary.md +1 -1
- package/docs/api/classes/InvalidScopeError.md +1 -1
- package/docs/api/classes/MissingUserContextError.md +1 -1
- package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
- package/docs/api/classes/PermissionDeniedError.md +2 -2
- package/docs/api/classes/PublicErrorBoundary.md +1 -1
- package/docs/api/classes/RBACAuditManager.md +12 -12
- package/docs/api/classes/RBACCache.md +1 -1
- package/docs/api/classes/RBACEngine.md +6 -6
- package/docs/api/classes/RBACError.md +1 -1
- package/docs/api/classes/RBACNotInitializedError.md +1 -1
- package/docs/api/classes/SecureSupabaseClient.md +1 -1
- package/docs/api/classes/StorageUtils.md +281 -0
- package/docs/api/interfaces/AggregateConfig.md +1 -1
- 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/DataTableAction.md +1 -1
- package/docs/api/interfaces/DataTableColumn.md +1 -1
- package/docs/api/interfaces/DataTableProps.md +1 -1
- package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
- package/docs/api/interfaces/EmptyStateConfig.md +1 -1
- package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
- package/docs/api/interfaces/EventContextType.md +1 -1
- package/docs/api/interfaces/EventLogoProps.md +1 -1
- package/docs/api/interfaces/EventProviderProps.md +1 -1
- package/docs/api/interfaces/FileSizeLimits.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 +2 -2
- package/docs/api/interfaces/NavigationContextType.md +1 -1
- 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 +1 -1
- 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 +1 -1
- package/docs/api/interfaces/PageAccessRecord.md +1 -1
- package/docs/api/interfaces/PagePermissionContextType.md +1 -1
- package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
- 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/RBACContextType.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/RBACProviderProps.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/ToastActionElement.md +1 -1
- package/docs/api/interfaces/ToastProps.md +1 -1
- package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
- package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
- 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/UserEventAccess.md +1 -1
- package/docs/api/interfaces/UserMenuProps.md +1 -1
- package/docs/api/interfaces/UserProfile.md +1 -1
- package/docs/api/modules.md +204 -200
- package/docs/api-reference/components.md +141 -163
- package/docs/api-reference/hooks.md +347 -0
- package/docs/core-concepts/rbac-system.md +69 -16
- package/docs/getting-started/examples/basic-auth-app.md +0 -1
- package/docs/implementation-guides/datatable-rbac-usage.md +12 -11
- package/docs/implementation-guides/file-upload-storage.md +733 -0
- package/docs/implementation-guides/inactivity-tracking.md +779 -0
- package/docs/implementation-guides/organisation-security.md +748 -0
- package/docs/implementation-guides/public-pages-advanced.md +1022 -0
- package/docs/migration/MIGRATION_GUIDE.md +684 -0
- package/docs/migration/README.md +13 -2
- package/docs/migration/rbac-migration.md +73 -0
- package/docs/rbac/examples/rbac-rls-integration-example.md +11 -13
- package/docs/style-guide.md +269 -1
- package/package.json +1 -1
- package/src/__tests__/TESTING_GUIDELINES.md +331 -18
- package/src/__tests__/helpers/supabaseMock.ts +99 -0
- package/src/__tests__/rbac/PagePermissionGuard.test.tsx +10 -7
- package/src/__tests__/shared.ts +6 -0
- package/src/components/DataTable/components/ActionButtons.tsx +2 -2
- package/src/components/DataTable/components/DataTableCore.tsx +2 -2
- package/src/components/DataTable/components/UnifiedTableBody.tsx +1 -1
- package/src/components/DataTable/utils/debugTools.ts +2 -2
- package/src/components/Dialog/Dialog.test.tsx +12 -2
- package/src/components/ErrorBoundary/ErrorBoundary.test.tsx +6 -6
- package/src/components/ErrorBoundary/ErrorBoundary.tsx +2 -2
- package/src/components/FileDisplay.tsx +233 -0
- package/src/components/FileUpload.tsx +176 -0
- package/src/components/Footer/Footer.test.tsx +7 -7
- package/src/components/NavigationMenu/NavigationMenu.test.tsx +13 -6
- package/src/components/OrganisationSelector/OrganisationSelector.test.tsx +30 -3
- package/src/components/OrganisationSelector/OrganisationSelector.tsx +1 -1
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.rbac.test.tsx +558 -0
- package/src/components/PublicLayout/PublicErrorBoundary.tsx +1 -1
- package/src/components/PublicLayout/PublicPageDebugger.tsx +2 -2
- package/src/components/PublicLayout/PublicPageDiagnostic.tsx +2 -2
- package/src/components/PublicLayout/PublicPageProvider.tsx +2 -2
- package/src/components/Select/Select.test.tsx +50 -15
- package/src/components/SuperAdminGuard.tsx +2 -2
- package/src/components/__tests__/SuperAdminGuard.test.tsx +559 -0
- package/src/components/index.ts +0 -183
- package/src/hooks/__tests__/useOrganisationPermissions.unit.test.tsx +2 -2
- package/src/hooks/__tests__/usePermissionCache.unit.test.ts +1 -1
- package/src/hooks/__tests__/useRBAC.unit.test.ts +191 -138
- package/src/hooks/public/usePublicEvent.ts +2 -2
- package/src/hooks/useAppConfig.ts +3 -3
- package/src/hooks/useComponentPerformance.ts +1 -1
- package/src/hooks/useDataTablePerformance.ts +1 -1
- package/src/hooks/useFileReference.ts +232 -0
- package/src/hooks/useOrganisationPermissions.test.ts +254 -344
- package/src/hooks/useOrganisationPermissions.ts +15 -7
- package/src/hooks/useOrganisationSecurity.test.ts +390 -402
- package/src/hooks/usePerformanceMonitor.ts +1 -1
- package/src/hooks/usePermissionCache.test.ts +264 -395
- package/src/hooks/usePermissionCache.ts +34 -4
- package/src/hooks/useSecureDataAccess.test.ts +486 -0
- package/src/hooks/useSecureDataAccess.ts +4 -1
- package/src/providers/InactivityProvider.tsx +2 -2
- package/src/providers/OrganisationProvider.test.simple.tsx +168 -0
- package/src/providers/OrganisationProvider.test.tsx +168 -0
- package/src/providers/OrganisationProvider.tsx +25 -31
- package/src/providers/UnifiedAuthProvider.test.simple.tsx +205 -0
- package/src/providers/UnifiedAuthProvider.test.tsx +128 -0
- package/src/providers/__tests__/InactivityProvider.test.tsx +3 -4
- package/src/providers/__tests__/OrganisationProvider.test.tsx +19 -14
- package/src/rbac/__tests__/integration.authflow.test.tsx +123 -0
- package/src/rbac/__tests__/integration.navigation.test.tsx +72 -0
- package/src/rbac/__tests__/integration.securedata.test.tsx +92 -0
- package/src/rbac/__tests__/integration.smoke.test.tsx +73 -0
- package/src/rbac/__tests__/rbac-core.test.tsx +26 -22
- package/src/rbac/__tests__/rbac-engine-core-logic.test.ts +411 -0
- package/src/rbac/__tests__/rbac-engine-simplified.test.ts +285 -0
- package/src/rbac/__tests__/rbac-functions.test.ts +655 -0
- package/src/rbac/__tests__/rbac-integration.test.ts +532 -0
- package/src/rbac/__tests__/scenarios.user-role.test.tsx +196 -0
- package/src/rbac/api.test.ts +6 -6
- package/src/rbac/api.ts +2 -2
- package/src/rbac/audit.test.ts +485 -0
- package/src/rbac/audit.ts +7 -1
- package/src/rbac/cache-invalidation.ts +318 -0
- package/src/rbac/cache.test.ts +286 -0
- package/src/rbac/components/EnhancedNavigationMenu.test.tsx +559 -0
- package/src/rbac/components/EnhancedNavigationMenu.tsx +29 -23
- package/src/rbac/components/NavigationProvider.test.tsx +449 -0
- package/src/rbac/components/PagePermissionGuard.tsx +4 -4
- package/src/rbac/components/PagePermissionProvider.test.tsx +479 -0
- package/src/rbac/components/SecureDataProvider.test.tsx +511 -0
- package/src/rbac/components/__tests__/PagePermissionGuard.race-condition.test.tsx +159 -430
- package/src/rbac/components/__tests__/PagePermissionGuard.test.tsx +4 -5
- package/src/rbac/components/__tests__/PagePermissionGuard.verification.test.tsx +112 -118
- package/src/rbac/config.test.ts +410 -0
- package/src/rbac/engine.test.simple.ts +237 -0
- package/src/rbac/engine.test.ts +233 -0
- package/src/rbac/engine.ts +37 -41
- package/src/rbac/examples/CompleteRBACExample.tsx +3 -3
- package/src/rbac/examples/EventBasedApp.tsx +4 -4
- package/src/rbac/hooks/useRBAC.simple.test.ts +16 -0
- package/src/rbac/hooks/useRBAC.test.ts +207 -455
- package/src/rbac/hooks/useRBAC.ts +30 -22
- package/src/rbac/permissions.test.ts +128 -0
- package/src/rbac/permissions.ts +56 -141
- package/src/rbac/providers/RBACProvider.tsx +1 -1
- package/src/rbac/secureClient.test.ts +444 -0
- package/src/rbac/security.test.ts +390 -0
- package/src/rbac/security.ts +1 -1
- package/src/rbac/types.test.ts +382 -0
- package/src/rbac/types.ts +2 -2
- package/src/styles/core.css +0 -125
- package/src/types/file-reference.ts +77 -0
- package/src/types/rbac-functions.ts +290 -0
- package/src/types/supabase.ts +10 -28
- package/src/types/unified.ts +4 -1
- package/src/utils/__tests__/bundleAnalysis.unit.test.ts +81 -55
- package/src/utils/__tests__/lazyLoad.unit.test.tsx +21 -12
- package/src/utils/__tests__/organisationContext.unit.test.ts +13 -7
- package/src/utils/__tests__/performanceBudgets.unit.test.ts +3 -3
- package/src/utils/__tests__/sessionTracking.unit.test.ts +32 -12
- package/src/utils/appConfig.ts +1 -1
- package/src/utils/appIdResolver.test.ts +503 -0
- package/src/utils/appIdResolver.ts +1 -1
- package/src/utils/appNameResolver.test.ts +494 -0
- package/src/utils/appNameResolver.ts +3 -2
- package/src/utils/bundleAnalysis.ts +3 -3
- package/src/utils/debugLogger.ts +1 -1
- package/src/utils/file-reference.ts +263 -0
- package/src/utils/formatDate.test.ts +2 -2
- package/src/utils/organisationContext.test.ts +340 -0
- package/src/utils/organisationContext.ts +19 -6
- package/src/utils/performanceBudgets.ts +2 -2
- package/src/utils/permissionUtils.test.ts +393 -0
- package/src/utils/permissionUtils.ts +5 -2
- package/src/utils/secureDataAccess.test.ts +715 -0
- package/src/utils/secureDataAccess.ts +21 -5
- package/src/utils/sessionTracking.ts +34 -4
- package/src/utils/storage/__tests__/helpers.unit.test.ts +328 -0
- package/src/utils/storage/__tests__/index.unit.test.ts +16 -0
- package/src/utils/storage/helpers.ts +20 -25
- package/src/utils/storage/index.ts +29 -1
- package/src/vite-env.d.ts +17 -0
- package/dist/chunk-22KLBHPS.js.map +0 -1
- package/dist/chunk-7BNPOCLL.js.map +0 -1
- package/dist/chunk-BC3S53OZ.js.map +0 -1
- package/dist/chunk-GWSBHC4J.js.map +0 -1
- package/dist/chunk-MYP2EGHX.js.map +0 -1
- package/dist/chunk-MZBUOP4P.js.map +0 -1
- package/dist/chunk-NYUJ4FJR.js.map +0 -1
- package/dist/chunk-NZ655MWE.js.map +0 -1
- package/dist/chunk-SS3E6QLB.js.map +0 -1
- package/dist/chunk-TRIZ7IB7.js.map +0 -1
- package/dist/chunk-WJARTBCT.js.map +0 -1
- package/dist/chunk-YDJW5XTN.js.map +0 -1
- package/docs/print-components/README.md +0 -258
- package/docs/print-components/api-reference.md +0 -636
- package/docs/print-components/examples/README.md +0 -204
- package/docs/print-components/examples/basic-report.tsx +0 -92
- package/docs/print-components/examples/card-catalog.tsx +0 -149
- package/docs/print-components/examples/cover-page-report.tsx +0 -163
- package/docs/print-components/quick-start.md +0 -363
- package/src/components/PrintButton/PrintButton.tsx +0 -321
- package/src/components/PrintButton/PrintButtonGroup.tsx +0 -84
- package/src/components/PrintButton/PrintToolbar.tsx +0 -94
- package/src/components/PrintButton/__tests__/PrintButton.test.tsx +0 -271
- package/src/components/PrintButton/examples/PrintButtonShowcase.tsx +0 -438
- package/src/components/PrintButton/index.ts +0 -33
- package/src/components/PrintButton/types.ts +0 -173
- package/src/components/PrintCard/PrintCard.tsx +0 -154
- package/src/components/PrintCard/PrintCardContent.tsx +0 -57
- package/src/components/PrintCard/PrintCardFooter.tsx +0 -60
- package/src/components/PrintCard/PrintCardGrid.tsx +0 -91
- package/src/components/PrintCard/PrintCardHeader.tsx +0 -78
- package/src/components/PrintCard/PrintCardImage.tsx +0 -81
- package/src/components/PrintCard/examples/PrintCardShowcase.tsx +0 -239
- package/src/components/PrintCard/index.ts +0 -34
- package/src/components/PrintCard/types.ts +0 -171
- package/src/components/PrintDataTable/PrintDataTable.tsx +0 -215
- package/src/components/PrintDataTable/PrintTableGroup.tsx +0 -90
- package/src/components/PrintDataTable/PrintTableRow.tsx +0 -76
- package/src/components/PrintDataTable/index.ts +0 -25
- package/src/components/PrintDataTable/types.ts +0 -67
- package/src/components/PrintFooter/PrintFooter.tsx +0 -183
- package/src/components/PrintFooter/PrintFooterContent.tsx +0 -71
- package/src/components/PrintFooter/PrintFooterInfo.tsx +0 -86
- package/src/components/PrintFooter/PrintPageNumber.tsx +0 -90
- package/src/components/PrintFooter/examples/PrintFooterShowcase.tsx +0 -390
- package/src/components/PrintFooter/index.ts +0 -30
- package/src/components/PrintFooter/types.ts +0 -149
- package/src/components/PrintGrid/PrintGrid.tsx +0 -180
- package/src/components/PrintGrid/PrintGridBreakpoint.tsx +0 -109
- package/src/components/PrintGrid/PrintGridContainer.tsx +0 -128
- package/src/components/PrintGrid/PrintGridItem.tsx +0 -220
- package/src/components/PrintGrid/examples/PrintGridShowcase.tsx +0 -359
- package/src/components/PrintGrid/index.ts +0 -31
- package/src/components/PrintGrid/types.ts +0 -159
- package/src/components/PrintHeader/PrintCoverHeader.tsx +0 -230
- package/src/components/PrintHeader/PrintHeader.tsx +0 -150
- package/src/components/PrintHeader/index.ts +0 -17
- package/src/components/PrintHeader/types.ts +0 -42
- package/src/components/PrintLayout/PrintLayout.tsx +0 -122
- package/src/components/PrintLayout/PrintLayoutContext.tsx +0 -66
- package/src/components/PrintLayout/PrintPageBreak.tsx +0 -52
- package/src/components/PrintLayout/examples/PrintShowcase.tsx +0 -230
- package/src/components/PrintLayout/index.ts +0 -19
- package/src/components/PrintLayout/types.ts +0 -37
- package/src/components/PrintPageBreak/PrintPageBreak.tsx +0 -120
- package/src/components/PrintPageBreak/PrintPageBreakGroup.tsx +0 -90
- package/src/components/PrintPageBreak/PrintPageBreakIndicator.tsx +0 -112
- package/src/components/PrintPageBreak/examples/PrintPageBreakShowcase.tsx +0 -279
- package/src/components/PrintPageBreak/index.ts +0 -23
- package/src/components/PrintPageBreak/types.ts +0 -94
- package/src/components/PrintSection/PrintColumn.tsx +0 -104
- package/src/components/PrintSection/PrintDivider.tsx +0 -101
- package/src/components/PrintSection/PrintSection.tsx +0 -129
- package/src/components/PrintSection/PrintSectionContent.tsx +0 -75
- package/src/components/PrintSection/PrintSectionHeader.tsx +0 -97
- package/src/components/PrintSection/examples/PrintSectionShowcase.tsx +0 -258
- package/src/components/PrintSection/index.ts +0 -33
- package/src/components/PrintSection/types.ts +0 -155
- package/src/components/PrintText/PrintText.tsx +0 -116
- package/src/components/PrintText/index.ts +0 -16
- package/src/components/PrintText/types.ts +0 -24
- package/src/rbac/__tests__/integration.test.tsx +0 -218
- package/src/utils/print/PrintDataProcessor.ts +0 -390
- package/src/utils/print/examples/PrintUtilitiesShowcase.tsx +0 -397
- package/src/utils/print/index.ts +0 -29
- package/src/utils/print/types.ts +0 -196
- package/src/utils/print/usePrintOptimization.ts +0 -272
- /package/dist/{DataTable-7FMFXA7A.js.map → DataTable-DJQTKX33.js.map} +0 -0
- /package/dist/{api-H5A3H4IR.js.map → api-LUNF5O6M.js.map} +0 -0
- /package/dist/{appNameResolver-7GHF5ED2.js.map → appNameResolver-UURKN7NF.js.map} +0 -0
- /package/dist/{audit-BUW3LMJB.js.map → audit-6TOCAMKO.js.map} +0 -0
- /package/dist/{chunk-NRK4AIHQ.js.map → chunk-2DFCT6D3.js.map} +0 -0
- /package/dist/{chunk-6MTY77WU.js.map → chunk-QB4GXDUM.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/debugLogger.ts","../src/utils/cn.ts","../src/utils/organisationContext.ts"],"sourcesContent":["/**\n * @file Debug Logger Utility\n * @package @jmruthers/pace-core\n * @module Utils/DebugLogger\n * @since 0.4.76\n */\n\n/**\n * Debug logger that respects environment settings\n * Only logs in development mode to prevent production console spam\n */\nexport class DebugLogger {\n private static isDevelopment = process.env.NODE_ENV === 'development';\n\n /**\n * Log debug information only in development mode\n */\n static log(component: string, message: string, ...args: any[]): void {\n if (this.isDevelopment) {\n console.log(`[${component}] ${message}`, ...args);\n }\n }\n\n /**\n * Log error information (always logged)\n */\n static error(component: string, message: string, ...args: any[]): void {\n console.error(`[${component}] ${message}`, ...args);\n }\n\n /**\n * Log warning information (always logged)\n */\n static warn(component: string, message: string, ...args: any[]): void {\n console.warn(`[${component}] ${message}`, ...args);\n }\n\n /**\n * Log info information only in development mode\n */\n static info(component: string, message: string, ...args: any[]): void {\n if (this.isDevelopment) {\n console.info(`[${component}] ${message}`, ...args);\n }\n }\n}\n","\nimport { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}","/**\n * @file Organisation Context Utility\n * @package @jmruthers/pace-core\n * @module Utils/OrganisationContext\n * @since 0.4.0\n *\n * Utility functions for managing organisation context in database sessions.\n * Provides fallback mechanisms for when database functions are not available.\n */\n\nimport type { SupabaseClient } from '@supabase/supabase-js';\n\n/**\n * Set organisation context in the database session\n * \n * This function attempts to set the organisation context using a database function.\n * If the function is not available, it falls back gracefully without throwing errors.\n * \n * @param supabase - Supabase client instance\n * @param organisationId - The organisation ID to set as context\n * @returns Promise that resolves when context is set (or falls back gracefully)\n */\nexport async function setOrganisationContext(\n supabase: SupabaseClient,\n organisationId: string\n): Promise<void> {\n if (!supabase || !organisationId) {\n // TODO: Replace with proper logging service integration\n return;\n }\n\n try {\n // Try to call the database function to set organisation context\n const { error } = await supabase.rpc('set_organisation_context', {\n org_id: organisationId\n });\n\n if (error) {\n // Function might not exist yet - this is expected during migration\n // Silent fail - will fall back to client-side filtering\n // TODO: Replace with proper logging service integration\n } else {\n // TODO: Replace with proper logging service integration\n }\n } catch (error) {\n // Handle any other errors gracefully\n // Silent fail - will fall back to client-side filtering\n // TODO: Replace with proper logging service integration\n }\n}\n\n/**\n * Clear organisation context from the database session\n * \n * @param supabase - Supabase client instance\n * @returns Promise that resolves when context is cleared\n */\nexport async function clearOrganisationContext(\n supabase: SupabaseClient\n): Promise<void> {\n if (!supabase) {\n // TODO: Replace with proper logging service integration\n return;\n }\n\n try {\n const { error } = await supabase.rpc('clear_organisation_context');\n \n if (error) {\n // Silent fail - function not available\n // TODO: Replace with proper logging service integration\n } else {\n // TODO: Replace with proper logging service integration\n }\n } catch (error) {\n // Silent fail - error occurred\n // TODO: Replace with proper logging service integration\n }\n}\n\n/**\n * Get current organisation context from the database session\n * \n * @param supabase - Supabase client instance\n * @returns Promise that resolves to the current organisation ID or null\n */\nexport async function getOrganisationContext(\n supabase: SupabaseClient\n): Promise<string | null> {\n if (!supabase) {\n // TODO: Replace with proper logging service integration\n return null;\n }\n\n try {\n const { data, error } = await supabase.rpc('get_organisation_context');\n \n if (error) {\n // TODO: Replace with proper logging service integration\n return null;\n }\n \n // TODO: Replace with proper logging service integration\n return data;\n } catch (error) {\n // TODO: Replace with proper logging service integration\n return null;\n }\n}\n\n/**\n * Check if organisation context functions are available in the database\n * \n * @param supabase - Supabase client instance\n * @returns Promise that resolves to true if functions are available\n */\nexport async function isOrganisationContextAvailable(\n supabase: SupabaseClient\n): Promise<boolean> {\n if (!supabase) {\n return false;\n }\n\n try {\n const { error } = await supabase.rpc('get_organisation_context');\n \n if (error) {\n return false;\n }\n \n return true;\n } catch (error) {\n return false;\n }\n} "],"mappings":";;;;;AAAA,IAWa;AAXb;AAAA;AAAA;AAWO,IAAM,cAAN,MAAkB;AAAA;AAAA;AAAA;AAAA,MAMvB,OAAO,IAAI,WAAmB,YAAoB,MAAmB;AACnE,YAAI,KAAK,eAAe;AACtB,kBAAQ,IAAI,IAAI,SAAS,KAAK,OAAO,IAAI,GAAG,IAAI;AAAA,QAClD;AAAA,MACF;AAAA;AAAA;AAAA;AAAA,MAKA,OAAO,MAAM,WAAmB,YAAoB,MAAmB;AACrE,gBAAQ,MAAM,IAAI,SAAS,KAAK,OAAO,IAAI,GAAG,IAAI;AAAA,MACpD;AAAA;AAAA;AAAA;AAAA,MAKA,OAAO,KAAK,WAAmB,YAAoB,MAAmB;AACpE,gBAAQ,KAAK,IAAI,SAAS,KAAK,OAAO,IAAI,GAAG,IAAI;AAAA,MACnD;AAAA;AAAA;AAAA;AAAA,MAKA,OAAO,KAAK,WAAmB,YAAoB,MAAmB;AACpE,YAAI,KAAK,eAAe;AACtB,kBAAQ,KAAK,IAAI,SAAS,KAAK,OAAO,IAAI,GAAG,IAAI;AAAA,QACnD;AAAA,MACF;AAAA,IACF;AAjCE,IADW,YACI,gBAAgB;AAAA;AAAA;;;ACXjC,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;AANA;AAAA;AAAA;AAAA;AAAA;;;ACsBA,eAAsB,uBACpB,UACA,gBACe;AACf,MAAI,CAAC,YAAY,CAAC,gBAAgB;AAEhC;AAAA,EACF;AAEA,MAAI;AAEF,UAAM,EAAE,MAAM,IAAI,MAAM,SAAS,IAAI,4BAA4B;AAAA,MAC/D,QAAQ;AAAA,IACV,CAAC;AAED,QAAI,OAAO;AAAA,IAIX,OAAO;AAAA,IAEP;AAAA,EACF,SAAS,OAAO;AAAA,EAIhB;AACF;AAQA,eAAsB,yBACpB,UACe;AACf,MAAI,CAAC,UAAU;AAEb;AAAA,EACF;AAEA,MAAI;AACF,UAAM,EAAE,MAAM,IAAI,MAAM,SAAS,IAAI,4BAA4B;AAEjE,QAAI,OAAO;AAAA,IAGX,OAAO;AAAA,IAEP;AAAA,EACF,SAAS,OAAO;AAAA,EAGhB;AACF;AAQA,eAAsB,uBACpB,UACwB;AACxB,MAAI,CAAC,UAAU;AAEb,WAAO;AAAA,EACT;AAEA,MAAI;AACF,UAAM,EAAE,MAAM,MAAM,IAAI,MAAM,SAAS,IAAI,0BAA0B;AAErE,QAAI,OAAO;AAET,aAAO;AAAA,IACT;AAGA,WAAO;AAAA,EACT,SAAS,OAAO;AAEd,WAAO;AAAA,EACT;AACF;AAQA,eAAsB,+BACpB,UACkB;AAClB,MAAI,CAAC,UAAU;AACb,WAAO;AAAA,EACT;AAEA,MAAI;AACF,UAAM,EAAE,MAAM,IAAI,MAAM,SAAS,IAAI,0BAA0B;AAE/D,QAAI,OAAO;AACT,aAAO;AAAA,IACT;AAEA,WAAO;AAAA,EACT,SAAS,OAAO;AACd,WAAO;AAAA,EACT;AACF;AAtIA;AAAA;AAAA;AAAA;AAAA;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/unified.ts"],"sourcesContent":["/**\n * @file Unified types for PACE Core\n * @package @jmruthers/pace-core\n * @module unified\n * @since 0.1.0\n */\n\n/**\n * @file Unified Types for DataTable\n * @package @jmruthers/pace-core\n * @module Types\n * @since 0.3.0\n */\n\n// Authentication Error Codes\nexport enum AuthErrorCode {\n UNKNOWN_ERROR = 'UNKNOWN_ERROR',\n INVALID_CREDENTIALS = 'INVALID_CREDENTIALS',\n USER_NOT_FOUND = 'USER_NOT_FOUND',\n EMAIL_NOT_CONFIRMED = 'EMAIL_NOT_CONFIRMED',\n PASSWORD_TOO_WEAK = 'PASSWORD_TOO_WEAK',\n WEAK_PASSWORD = 'WEAK_PASSWORD',\n RATE_LIMITED = 'RATE_LIMITED',\n RATE_LIMIT_EXCEEDED = 'RATE_LIMIT_EXCEEDED',\n SESSION_EXPIRED = 'SESSION_EXPIRED',\n PERMISSION_DENIED = 'PERMISSION_DENIED',\n NETWORK_ERROR = 'NETWORK_ERROR'\n}\n\n// Permission Error Codes\nexport enum PermissionErrorCode {\n INSUFFICIENT_PERMISSIONS = 'INSUFFICIENT_PERMISSIONS',\n INVALID_PERMISSION = 'INVALID_PERMISSION',\n PERMISSION_CHECK_FAILED = 'PERMISSION_CHECK_FAILED',\n ACCESS_DENIED = 'ACCESS_DENIED'\n}\n\n// Access Levels - using lowercase to match test expectations\nexport enum AccessLevel {\n NONE = 'none',\n VIEWER = 'viewer',\n PARTICIPANT = 'participant',\n EDITOR = 'editor',\n PLANNER = 'planner',\n ADMIN = 'admin',\n SUPER_ADMIN = 'super_admin',\n SUPER = 'super'\n}\n\n// Branded Types\nexport type UserId = string & { __brand: 'UserId' };\nexport type SessionToken = string & { __brand: 'SessionToken' };\nexport type PermissionString = string & { __brand: 'PermissionString' };\nexport type RequestId = string & { __brand: 'RequestId' };\n\n// Branded Type Creators\nexport function createUserId(id: string): UserId {\n return id as UserId;\n}\n\nexport function createSessionToken(token: string): SessionToken {\n return token as SessionToken;\n}\n\nexport function createPermissionString(permission: string): PermissionString {\n return permission as PermissionString;\n}\n\nexport function createRequestId(id: string): RequestId {\n return id as RequestId;\n}\n\n// Type Guards for branded types\nexport function isUserId(value: unknown): value is UserId {\n return typeof value === 'string' && value.length > 0;\n}\n\nexport function isSessionToken(value: unknown): value is SessionToken {\n return typeof value === 'string' && value.length > 0;\n}\n\nexport function isPermissionString(value: unknown): value is PermissionString {\n if (typeof value !== 'string' || value.length === 0) return false;\n // Basic validation for permission format (resource:action)\n return value.includes(':') && value.split(':').length === 2;\n}\n\nexport function isRequestId(value: unknown): value is RequestId {\n return typeof value === 'string' && value.length > 0;\n}\n\n// Permission Types\nexport type PermissionMap = Record<string, boolean>;\n\n// Permission Context\nexport interface PermissionContext {\n eventId?: string;\n appName?: string;\n userId?: string;\n}\n\n// Auth Error Interface - Define locally to avoid circular dependency\nexport interface AuthError extends Error {\n __isAuthError: true;\n name: 'AuthError';\n message: string;\n code: AuthErrorCode;\n user_message: string;\n timestamp: number;\n}\n\n// Permission Error Interface\nexport interface PermissionError extends Error {\n __isPermissionError: true;\n name: 'PermissionError';\n message: string;\n code: PermissionErrorCode;\n timestamp: number;\n}\n\n// Theme Types - Consolidated from theme.ts\nexport interface ThemeColors {\n primary: string;\n secondary: string;\n hover?: string;\n active?: string;\n bgSoft?: string;\n}\n\nexport interface EventTheme {\n mid: ThemeColors;\n light: ThemeColors;\n}\n\n// Event Types - Updated to match database schema exactly with organisation context\nexport interface Event {\n // Primary identification\n id: string;\n event_id: string;\n event_name: string;\n event_code?: string;\n \n // Organisation context - MANDATORY for security\n organisation_id: string;\n \n // Event details\n event_date?: string; // Use event_date from database for proper sorting\n event_days?: number;\n event_venue?: string;\n event_participants?: number;\n is_visible?: boolean;\n \n // Visual branding\n event_logo?: string;\n event_colours?: Record<string, unknown> | null; // JSONB field for theme colors\n event_col_d1?: string;\n event_col_d2?: string;\n event_col_m1?: string;\n event_col_m2?: string;\n event_col_l1?: string;\n event_col_l2?: string;\n \n // Additional metadata\n event_news?: string;\n event_billing?: string;\n event_catering_email?: string;\n event_email?: string;\n event_footer?: string;\n event_rounddown?: number;\n event_youthmultiplier?: number;\n event_typicalunit?: number;\n \n // Timestamps\n created_at: string;\n updated_at: string;\n created_by?: string;\n updated_by?: string;\n \n // Legacy compatibility\n name?: string; // Alias for event_name\n description?: string;\n start_date?: string; // Alias for event_date\n end_date?: string;\n theme_colors?: EventTheme;\n}\n\n// Event Context Type\nexport interface EventContextType {\n selectedEvent: Event | null;\n currentEvent: Event | null; // Added missing property\n events: Event[];\n isLoading: boolean;\n error: string | null;\n selectEvent: (event: Event) => void;\n setCurrentEvent: (event: Event | null) => void; // Added missing property\n clearSelection: () => void;\n refreshEvents: () => Promise<void>;\n createEvent: (event: Partial<Event>) => Promise<Event>;\n updateEvent: (id: string, updates: Partial<Event>) => Promise<Event>;\n deleteEvent: (id: string) => Promise<void>;\n}\n\n// RBAC Types\nexport interface UserPermissions {\n user_id: UserId;\n accessLevel: AccessLevel;\n permissions: PermissionMap;\n roles: string[];\n}\n\n// Re-export standard Supabase types for consistency\n// Note: These are the same as what's in @supabase/supabase-js\nexport interface User {\n id: string;\n email?: string;\n created_at: string;\n updated_at: string;\n email_confirmed_at?: string;\n last_sign_in_at?: string;\n user_metadata?: Record<string, unknown>;\n app_metadata?: Record<string, unknown>;\n}\n\nexport interface Session {\n access_token: string;\n refresh_token?: string;\n expires_in: number;\n expires_at: number;\n token_type: string;\n user: User;\n provider_token?: string;\n provider_refresh_token?: string;\n}\n\nexport interface DataRecord {\n id: string | number;\n [key: string]: unknown;\n}\n\nexport interface DataTableAction<T = unknown> {\n label: string;\n onClick: (row: T) => void;\n testId?: string;\n disabled?: boolean | ((row: T) => boolean);\n variant?: 'primary' | 'secondary' | 'destructive';\n}\n\nexport interface DataTableColumn<T = unknown> {\n id?: string;\n key: string;\n label: string;\n sortable?: boolean;\n filterable?: boolean;\n accessorKey?: keyof T;\n accessorFn?: (row: T) => unknown;\n cell?: (value: unknown, row: T) => React.ReactNode;\n header?: React.ReactNode;\n enableSorting?: boolean;\n enableColumnFilter?: boolean;\n enableGrouping?: boolean;\n enableHiding?: boolean;\n}\n"],"mappings":";;;;;AAwDO,SAAS,aAAa,IAAoB;AAC/C,SAAO;AACT;AAEO,SAAS,mBAAmB,OAA6B;AAC9D,SAAO;AACT;AAEO,SAAS,uBAAuB,YAAsC;AAC3E,SAAO;AACT;AAEO,SAAS,gBAAgB,IAAuB;AACrD,SAAO;AACT;AAGO,SAAS,SAAS,OAAiC;AACxD,SAAO,OAAO,UAAU,YAAY,MAAM,SAAS;AACrD;AAEO,SAAS,eAAe,OAAuC;AACpE,SAAO,OAAO,UAAU,YAAY,MAAM,SAAS;AACrD;AAEO,SAAS,mBAAmB,OAA2C;AAC5E,MAAI,OAAO,UAAU,YAAY,MAAM,WAAW,EAAG,QAAO;AAE5D,SAAO,MAAM,SAAS,GAAG,KAAK,MAAM,MAAM,GAAG,EAAE,WAAW;AAC5D;AAEO,SAAS,YAAY,OAAoC;AAC9D,SAAO,OAAO,UAAU,YAAY,MAAM,SAAS;AACrD;AAzFA,IAeY,eAeA,qBAQA;AAtCZ;AAAA;AAAA;AAeO,IAAK,gBAAL,kBAAKA,mBAAL;AACL,MAAAA,eAAA,mBAAgB;AAChB,MAAAA,eAAA,yBAAsB;AACtB,MAAAA,eAAA,oBAAiB;AACjB,MAAAA,eAAA,yBAAsB;AACtB,MAAAA,eAAA,uBAAoB;AACpB,MAAAA,eAAA,mBAAgB;AAChB,MAAAA,eAAA,kBAAe;AACf,MAAAA,eAAA,yBAAsB;AACtB,MAAAA,eAAA,qBAAkB;AAClB,MAAAA,eAAA,uBAAoB;AACpB,MAAAA,eAAA,mBAAgB;AAXN,aAAAA;AAAA,OAAA;AAeL,IAAK,sBAAL,kBAAKC,yBAAL;AACL,MAAAA,qBAAA,8BAA2B;AAC3B,MAAAA,qBAAA,wBAAqB;AACrB,MAAAA,qBAAA,6BAA0B;AAC1B,MAAAA,qBAAA,mBAAgB;AAJN,aAAAA;AAAA,OAAA;AAQL,IAAK,cAAL,kBAAKC,iBAAL;AACL,MAAAA,aAAA,UAAO;AACP,MAAAA,aAAA,YAAS;AACT,MAAAA,aAAA,iBAAc;AACd,MAAAA,aAAA,YAAS;AACT,MAAAA,aAAA,aAAU;AACV,MAAAA,aAAA,WAAQ;AACR,MAAAA,aAAA,iBAAc;AACd,MAAAA,aAAA,WAAQ;AARE,aAAAA;AAAA,OAAA;AAAA;AAAA;","names":["AuthErrorCode","PermissionErrorCode","AccessLevel"]}
|
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
# Print Components
|
|
2
|
-
|
|
3
|
-
> **🎨 Print-Optimized Layout System** | [Quick Start](./quick-start.md) | [API Reference](./api-reference.md) | [Examples](./examples/)
|
|
4
|
-
|
|
5
|
-
A comprehensive suite of print-optimized React components designed for creating professional reports, documents, and printable content. Built with print-first design principles and A4 page optimization.
|
|
6
|
-
|
|
7
|
-
## 🚀 Quick Start
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install @jmruthers/pace-core
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
```tsx
|
|
14
|
-
import {
|
|
15
|
-
PrintLayout,
|
|
16
|
-
PrintHeader,
|
|
17
|
-
PrintDataTable,
|
|
18
|
-
PrintText
|
|
19
|
-
} from '@jmruthers/pace-core';
|
|
20
|
-
|
|
21
|
-
// Import the core CSS file
|
|
22
|
-
import '@jmruthers/pace-core/styles/core.css';
|
|
23
|
-
|
|
24
|
-
function ReportPage() {
|
|
25
|
-
return (
|
|
26
|
-
<PrintLayout orientation="portrait" pageSize="A4">
|
|
27
|
-
<PrintHeader
|
|
28
|
-
title="Monthly Report"
|
|
29
|
-
branding={{
|
|
30
|
-
companyName: "Your Company",
|
|
31
|
-
projectName: "Q4 Analytics"
|
|
32
|
-
}}
|
|
33
|
-
/>
|
|
34
|
-
<PrintDataTable
|
|
35
|
-
data={reportData}
|
|
36
|
-
columns={columns}
|
|
37
|
-
title="Sales Summary"
|
|
38
|
-
/>
|
|
39
|
-
</PrintLayout>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## 📋 Overview
|
|
45
|
-
|
|
46
|
-
The print components system provides everything you need to create professional, print-optimized documents:
|
|
47
|
-
|
|
48
|
-
### **Core Components**
|
|
49
|
-
- **`PrintLayout`** - Base layout with page size and orientation control
|
|
50
|
-
- **`PrintHeader`** - Flexible headers with branding and metadata
|
|
51
|
-
- **`PrintCoverHeader`** - Cover page headers for first pages
|
|
52
|
-
- **`PrintFooter`** - Page footers with numbering and content
|
|
53
|
-
- **`PrintText`** - Print-optimized typography system
|
|
54
|
-
|
|
55
|
-
### **Data Components**
|
|
56
|
-
- **`PrintDataTable`** - Print-optimized data tables with grouping
|
|
57
|
-
- **`PrintCard`** - Flexible card layouts for content
|
|
58
|
-
- **`PrintSection`** - Content organization with columns
|
|
59
|
-
- **`PrintGrid`** - Responsive grid system
|
|
60
|
-
|
|
61
|
-
### **Utility Components**
|
|
62
|
-
- **`PrintButton`** - Print functionality with callbacks
|
|
63
|
-
- **`PrintPageBreak`** - Explicit page break controls
|
|
64
|
-
- **`PrintDivider`** - Visual separators
|
|
65
|
-
|
|
66
|
-
## 🎯 Use Cases
|
|
67
|
-
|
|
68
|
-
### **1. Business Reports**
|
|
69
|
-
Create professional reports with data tables, charts, and executive summaries.
|
|
70
|
-
|
|
71
|
-
```tsx
|
|
72
|
-
<PrintLayout orientation="landscape" pageSize="A4">
|
|
73
|
-
<PrintCoverHeader
|
|
74
|
-
title="Q4 Financial Report"
|
|
75
|
-
subtitle="Performance Analysis & Strategic Overview"
|
|
76
|
-
branding={{
|
|
77
|
-
logo: "/logo.png",
|
|
78
|
-
companyName: "Acme Corp",
|
|
79
|
-
version: "v2024.1"
|
|
80
|
-
}}
|
|
81
|
-
/>
|
|
82
|
-
<PrintDataTable
|
|
83
|
-
data={financialData}
|
|
84
|
-
columns={financialColumns}
|
|
85
|
-
grouping={{ enabled: true, groupBy: 'quarter' }}
|
|
86
|
-
/>
|
|
87
|
-
</PrintLayout>
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
### **2. Document Generation**
|
|
91
|
-
Build user guides, technical documentation, and manuals.
|
|
92
|
-
|
|
93
|
-
```tsx
|
|
94
|
-
<PrintLayout orientation="portrait" pageSize="A4">
|
|
95
|
-
<PrintHeader title="User Manual" />
|
|
96
|
-
<PrintSection title="Getting Started">
|
|
97
|
-
<PrintText variant="heading">Installation</PrintText>
|
|
98
|
-
<PrintText variant="body">
|
|
99
|
-
Follow these steps to install the application...
|
|
100
|
-
</PrintText>
|
|
101
|
-
</PrintSection>
|
|
102
|
-
<PrintPageBreak type="before" />
|
|
103
|
-
<PrintSection title="Configuration">
|
|
104
|
-
{/* More content */}
|
|
105
|
-
</PrintSection>
|
|
106
|
-
</PrintLayout>
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### **3. Card-Based Layouts**
|
|
110
|
-
Create catalogs, directories, and reference materials.
|
|
111
|
-
|
|
112
|
-
```tsx
|
|
113
|
-
<PrintGrid columns={3} printColumns={2}>
|
|
114
|
-
{products.map(product => (
|
|
115
|
-
<PrintCard
|
|
116
|
-
key={product.id}
|
|
117
|
-
title={product.name}
|
|
118
|
-
subtitle={product.category}
|
|
119
|
-
image={{ src: product.image, alt: product.name }}
|
|
120
|
-
metadata={[
|
|
121
|
-
{ label: "Price", value: product.price },
|
|
122
|
-
{ label: "Stock", value: product.stock }
|
|
123
|
-
]}
|
|
124
|
-
/>
|
|
125
|
-
))}
|
|
126
|
-
</PrintGrid>
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
## 🎨 Design System
|
|
130
|
-
|
|
131
|
-
### **Print Optimization**
|
|
132
|
-
- **A4 Page Support** - Optimized for A4 portrait and landscape
|
|
133
|
-
- **Print Media Queries** - Automatic print-specific styling
|
|
134
|
-
- **High Contrast** - Optimized colors for print readability
|
|
135
|
-
- **Page Breaks** - Intelligent page break management
|
|
136
|
-
- **Margins** - Proper print margins and safe areas
|
|
137
|
-
|
|
138
|
-
### **Typography**
|
|
139
|
-
- **Print-Optimized Fonts** - 12pt base size for readability
|
|
140
|
-
- **Consistent Hierarchy** - Heading, subheading, body, caption variants
|
|
141
|
-
- **High Contrast** - Black text on white background for print
|
|
142
|
-
|
|
143
|
-
### **Layout Principles**
|
|
144
|
-
- **Print-First Design** - Optimized for print, works on screen
|
|
145
|
-
- **Responsive Breakpoints** - Different layouts for screen vs print
|
|
146
|
-
- **Consistent Spacing** - Standardized spacing system
|
|
147
|
-
- **Clear Hierarchy** - Visual hierarchy optimized for print
|
|
148
|
-
|
|
149
|
-
## 🔧 Configuration
|
|
150
|
-
|
|
151
|
-
### **Page Sizes**
|
|
152
|
-
```tsx
|
|
153
|
-
// A4 Portrait (default)
|
|
154
|
-
<PrintLayout pageSize="A4" orientation="portrait" />
|
|
155
|
-
|
|
156
|
-
// A4 Landscape
|
|
157
|
-
<PrintLayout pageSize="A4" orientation="landscape" />
|
|
158
|
-
|
|
159
|
-
// Future: A3, A5 support
|
|
160
|
-
<PrintLayout pageSize="A3" orientation="portrait" />
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
### **Headers & Footers**
|
|
164
|
-
```tsx
|
|
165
|
-
// Different headers for first page vs subsequent pages
|
|
166
|
-
<PrintLayout
|
|
167
|
-
firstPageHeader={<PrintCoverHeader title="Annual Report" />}
|
|
168
|
-
subsequentPageHeader={<PrintHeader title="Annual Report" />}
|
|
169
|
-
>
|
|
170
|
-
{/* Content */}
|
|
171
|
-
</PrintLayout>
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
### **Print Optimization**
|
|
175
|
-
```tsx
|
|
176
|
-
// Enable print optimization (default: true)
|
|
177
|
-
<PrintDataTable
|
|
178
|
-
data={data}
|
|
179
|
-
columns={columns}
|
|
180
|
-
printOptimized={true}
|
|
181
|
-
/>
|
|
182
|
-
|
|
183
|
-
// Disable for screen-only layouts
|
|
184
|
-
<PrintCard printOptimized={false}>
|
|
185
|
-
Content
|
|
186
|
-
</PrintCard>
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
## 📚 Documentation
|
|
190
|
-
|
|
191
|
-
### **Getting Started**
|
|
192
|
-
- **[Quick Start Guide](./quick-start.md)** - 5-minute setup
|
|
193
|
-
- **[Installation Guide](./installation.md)** - Detailed setup
|
|
194
|
-
- **[Examples](./examples/)** - Complete working examples
|
|
195
|
-
|
|
196
|
-
### **Component Reference**
|
|
197
|
-
- **[API Reference](./api-reference.md)** - Complete component APIs
|
|
198
|
-
- **[Props Reference](./props-reference.md)** - Detailed prop documentation
|
|
199
|
-
- **[Type Definitions](./types.md)** - TypeScript interfaces
|
|
200
|
-
|
|
201
|
-
### **Advanced Usage**
|
|
202
|
-
- **[Customization Guide](./customization.md)** - Styling and theming
|
|
203
|
-
- **[Performance Guide](./performance.md)** - Optimization tips
|
|
204
|
-
- **[Troubleshooting](./troubleshooting.md)** - Common issues and solutions
|
|
205
|
-
|
|
206
|
-
### **Integration**
|
|
207
|
-
- **[React Integration](./react-integration.md)** - Using with React apps
|
|
208
|
-
- **[Next.js Integration](./nextjs-integration.md)** - Next.js specific setup
|
|
209
|
-
- **[Vite Integration](./vite-integration.md)** - Vite configuration
|
|
210
|
-
|
|
211
|
-
## 🎯 Best Practices
|
|
212
|
-
|
|
213
|
-
### **1. Use Print-First Design**
|
|
214
|
-
Design your layouts with print in mind, then adapt for screen.
|
|
215
|
-
|
|
216
|
-
### **2. Test Print Output**
|
|
217
|
-
Always test your layouts using browser print preview (Ctrl+P / Cmd+P).
|
|
218
|
-
|
|
219
|
-
### **3. Optimize for A4**
|
|
220
|
-
Design for A4 page size as the primary target format.
|
|
221
|
-
|
|
222
|
-
### **4. Use Semantic Components**
|
|
223
|
-
Choose the right component for your content type:
|
|
224
|
-
- `PrintDataTable` for tabular data
|
|
225
|
-
- `PrintCard` for item summaries
|
|
226
|
-
- `PrintSection` for content organization
|
|
227
|
-
|
|
228
|
-
### **5. Leverage Grouping**
|
|
229
|
-
Use data grouping for better print organization:
|
|
230
|
-
|
|
231
|
-
```tsx
|
|
232
|
-
<PrintDataTable
|
|
233
|
-
data={data}
|
|
234
|
-
columns={columns}
|
|
235
|
-
grouping={{
|
|
236
|
-
enabled: true,
|
|
237
|
-
groupBy: 'department',
|
|
238
|
-
groupHeader: (group) => <DepartmentHeader group={group} />
|
|
239
|
-
}}
|
|
240
|
-
/>
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
## 🔗 Related Documentation
|
|
244
|
-
|
|
245
|
-
- **[Main Documentation](../README.md)** - Complete pace-core documentation
|
|
246
|
-
- **[Styling Guide](../styles/README.md)** - Design system and theming
|
|
247
|
-
- **[Component Library](../api-reference/components.md)** - All available components
|
|
248
|
-
- **[Migration Guide](../migration/README.md)** - Upgrading from previous versions
|
|
249
|
-
|
|
250
|
-
## 📞 Support
|
|
251
|
-
|
|
252
|
-
- **Issues**: [GitHub Issues](https://github.com/jmruthers/pace-core/issues)
|
|
253
|
-
- **Discussions**: [GitHub Discussions](https://github.com/jmruthers/pace-core/discussions)
|
|
254
|
-
- **Documentation**: [Full Documentation](../README.md)
|
|
255
|
-
|
|
256
|
-
---
|
|
257
|
-
|
|
258
|
-
**Ready to get started?** Check out the [Quick Start Guide](./quick-start.md) to build your first print-optimized document in 5 minutes! 🚀
|