@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
|
@@ -1,320 +0,0 @@
|
|
|
1
|
-
# Quick Migration Guide
|
|
2
|
-
|
|
3
|
-
> **🚀 Fast Track Migration** | [Full Migration Guide](./README.md) | [Breaking Changes](./breaking-changes.md)
|
|
4
|
-
|
|
5
|
-
Quick migration guide for common PACE Core upgrade scenarios. For detailed migration instructions, see the [Full Migration Guide](./README.md).
|
|
6
|
-
|
|
7
|
-
## 🎯 Quick Migration Checklist
|
|
8
|
-
|
|
9
|
-
### Before You Start
|
|
10
|
-
- [ ] **Backup your project** - Always backup before major updates
|
|
11
|
-
- [ ] **Check current version** - `npm list @jmruthers/pace-core`
|
|
12
|
-
- [ ] **Review changelog** - Check for breaking changes
|
|
13
|
-
- [ ] **Test in development** - Never migrate directly in production
|
|
14
|
-
|
|
15
|
-
### Common Migration Scenarios
|
|
16
|
-
|
|
17
|
-
## 📦 Package Updates
|
|
18
|
-
|
|
19
|
-
### Minor Version Updates (e.g., v0.4.16 → v0.4.17)
|
|
20
|
-
|
|
21
|
-
**Usually safe, but check for:**
|
|
22
|
-
- New features
|
|
23
|
-
- Bug fixes
|
|
24
|
-
- Performance improvements
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
# Update to latest
|
|
28
|
-
npm update @jmruthers/pace-core
|
|
29
|
-
|
|
30
|
-
# Or specific version
|
|
31
|
-
npm install @jmruthers/pace-core@0.4.17
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
**What to check:**
|
|
35
|
-
- [ ] App still builds successfully
|
|
36
|
-
- [ ] No console errors
|
|
37
|
-
- [ ] Components render correctly
|
|
38
|
-
- [ ] Authentication still works
|
|
39
|
-
|
|
40
|
-
### Major Version Updates (e.g., v0.x → v1.x)
|
|
41
|
-
|
|
42
|
-
**Requires more attention:**
|
|
43
|
-
- Breaking API changes
|
|
44
|
-
- New required props
|
|
45
|
-
- Deprecated features
|
|
46
|
-
- Configuration changes
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
# Check what's new
|
|
50
|
-
npm info @jmruthers/pace-core versions --json
|
|
51
|
-
|
|
52
|
-
# Update to latest
|
|
53
|
-
npm install @jmruthers/pace-core@latest
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
**What to check:**
|
|
57
|
-
- [ ] Review [Breaking Changes](./breaking-changes.md)
|
|
58
|
-
- [ ] Update import statements
|
|
59
|
-
- [ ] Fix deprecated API usage
|
|
60
|
-
- [ ] Update configuration files
|
|
61
|
-
- [ ] Test all functionality
|
|
62
|
-
|
|
63
|
-
## 🔧 Configuration Updates
|
|
64
|
-
|
|
65
|
-
### Tailwind v4 Migration
|
|
66
|
-
|
|
67
|
-
**From v0.4.15 to v0.4.16+ (CSS-First Approach):**
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
# Remove old dependencies
|
|
71
|
-
npm uninstall tailwindcss postcss autoprefixer
|
|
72
|
-
|
|
73
|
-
# Install new dependencies
|
|
74
|
-
npm install @tailwindcss/vite tailwindcss@^4.0.0
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
**Update vite.config.ts:**
|
|
78
|
-
```ts
|
|
79
|
-
// Before (v0.4.15)
|
|
80
|
-
import tailwindcss from '@tailwindcss/vite'
|
|
81
|
-
export default defineConfig({
|
|
82
|
-
plugins: [
|
|
83
|
-
react(),
|
|
84
|
-
tailwindcss({
|
|
85
|
-
content: [
|
|
86
|
-
'./src/**/*.{js,ts,jsx,tsx}',
|
|
87
|
-
'./node_modules/@jmruthers/pace-core/src/**/*.{js,ts,jsx,tsx}'
|
|
88
|
-
]
|
|
89
|
-
})
|
|
90
|
-
],
|
|
91
|
-
})
|
|
92
|
-
|
|
93
|
-
// After (v0.4.16+)
|
|
94
|
-
import tailwindcss from '@tailwindcss/vite'
|
|
95
|
-
export default defineConfig({
|
|
96
|
-
plugins: [
|
|
97
|
-
react(),
|
|
98
|
-
tailwindcss({
|
|
99
|
-
content: [
|
|
100
|
-
'./src/**/*.{js,ts,jsx,tsx}' // Only app files, pace-core scanned via @source
|
|
101
|
-
]
|
|
102
|
-
})
|
|
103
|
-
],
|
|
104
|
-
})
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
**Update CSS imports:**
|
|
108
|
-
```tsx
|
|
109
|
-
// Before
|
|
110
|
-
import '@jmruthers/pace-core/src/styles/core.css';
|
|
111
|
-
|
|
112
|
-
// After
|
|
113
|
-
import '@jmruthers/pace-core/src/styles/core.css';
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### Source Path Fix (v0.4.17+)
|
|
117
|
-
|
|
118
|
-
**Critical fix for @source directive paths:**
|
|
119
|
-
|
|
120
|
-
```ts
|
|
121
|
-
// vite.config.ts
|
|
122
|
-
import tailwindcss from '@tailwindcss/vite'
|
|
123
|
-
export default defineConfig({
|
|
124
|
-
plugins: [
|
|
125
|
-
react(),
|
|
126
|
-
tailwindcss({
|
|
127
|
-
content: [
|
|
128
|
-
'./src/**/*.{js,ts,jsx,tsx}',
|
|
129
|
-
'./node_modules/@jmruthers/pace-core/**/*.{js,ts,jsx,tsx}'
|
|
130
|
-
]
|
|
131
|
-
})
|
|
132
|
-
],
|
|
133
|
-
})
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
## 🔄 API Changes
|
|
137
|
-
|
|
138
|
-
### Component Props
|
|
139
|
-
|
|
140
|
-
**Common prop changes:**
|
|
141
|
-
|
|
142
|
-
```tsx
|
|
143
|
-
// Before (v0.x)
|
|
144
|
-
<DataTable
|
|
145
|
-
data={data}
|
|
146
|
-
columns={columns}
|
|
147
|
-
enableSearch={true}
|
|
148
|
-
enablePagination={true}
|
|
149
|
-
/>
|
|
150
|
-
|
|
151
|
-
// After (v1.x)
|
|
152
|
-
<DataTable
|
|
153
|
-
data={data}
|
|
154
|
-
columns={columns}
|
|
155
|
-
features={{
|
|
156
|
-
search: true,
|
|
157
|
-
pagination: true,
|
|
158
|
-
sorting: true,
|
|
159
|
-
filtering: true
|
|
160
|
-
}}
|
|
161
|
-
/>
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
### Hook Changes
|
|
165
|
-
|
|
166
|
-
**RBAC hooks moved to separate module:**
|
|
167
|
-
|
|
168
|
-
```tsx
|
|
169
|
-
// Before
|
|
170
|
-
import { useCan, usePermissions } from '@jmruthers/pace-core';
|
|
171
|
-
|
|
172
|
-
// After
|
|
173
|
-
import { useCan, usePermissions } from '@jmruthers/pace-core/rbac';
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
### Import Changes
|
|
177
|
-
|
|
178
|
-
**Consolidated imports:**
|
|
179
|
-
|
|
180
|
-
```tsx
|
|
181
|
-
// Before
|
|
182
|
-
import { Button } from '@jmruthers/pace-core/components';
|
|
183
|
-
import { useUnifiedAuth } from '@jmruthers/pace-core/hooks';
|
|
184
|
-
|
|
185
|
-
// After
|
|
186
|
-
import { Button, useUnifiedAuth } from '@jmruthers/pace-core';
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
## 🐛 Common Migration Issues
|
|
190
|
-
|
|
191
|
-
### Styling Issues
|
|
192
|
-
|
|
193
|
-
**Problem**: Components appear unstyled after update
|
|
194
|
-
|
|
195
|
-
**Solution**:
|
|
196
|
-
```tsx
|
|
197
|
-
// Ensure CSS import is first
|
|
198
|
-
import '@jmruthers/pace-core/src/styles/core.css';
|
|
199
|
-
import { Button } from '@jmruthers/pace-core';
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
### Build Errors
|
|
203
|
-
|
|
204
|
-
**Problem**: Build fails with Tailwind errors
|
|
205
|
-
|
|
206
|
-
**Solution**:
|
|
207
|
-
```bash
|
|
208
|
-
# Clear all caches
|
|
209
|
-
rm -rf node_modules package-lock.json
|
|
210
|
-
npm install
|
|
211
|
-
|
|
212
|
-
# Check Tailwind config
|
|
213
|
-
npm run build -- --debug
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
### TypeScript Errors
|
|
217
|
-
|
|
218
|
-
**Problem**: Type errors after update
|
|
219
|
-
|
|
220
|
-
**Solution**:
|
|
221
|
-
```bash
|
|
222
|
-
# Update TypeScript types
|
|
223
|
-
npm install @types/react@latest @types/react-dom@latest
|
|
224
|
-
|
|
225
|
-
# Regenerate types
|
|
226
|
-
npm run type-check
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
### Authentication Issues
|
|
230
|
-
|
|
231
|
-
**Problem**: Login not working after update
|
|
232
|
-
|
|
233
|
-
**Solution**:
|
|
234
|
-
```tsx
|
|
235
|
-
// Check provider hierarchy
|
|
236
|
-
<UnifiedAuthProvider supabaseClient={supabase} appName="my-app">
|
|
237
|
-
<OrganisationProvider>
|
|
238
|
-
<EventProvider>
|
|
239
|
-
<YourApp />
|
|
240
|
-
</EventProvider>
|
|
241
|
-
</OrganisationProvider>
|
|
242
|
-
</UnifiedAuthProvider>
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
## ✅ Post-Migration Testing
|
|
246
|
-
|
|
247
|
-
### Essential Tests
|
|
248
|
-
- [ ] **Build succeeds** - `npm run build`
|
|
249
|
-
- [ ] **App starts** - `npm run dev`
|
|
250
|
-
- [ ] **Authentication works** - Login/logout
|
|
251
|
-
- [ ] **Components render** - All UI components display
|
|
252
|
-
- [ ] **Permissions work** - RBAC functions correctly
|
|
253
|
-
- [ ] **Forms work** - Form validation and submission
|
|
254
|
-
- [ ] **Data tables work** - CRUD operations
|
|
255
|
-
- [ ] **Styling correct** - No visual regressions
|
|
256
|
-
|
|
257
|
-
### Performance Tests
|
|
258
|
-
- [ ] **Bundle size** - Check for size increases
|
|
259
|
-
- [ ] **Load time** - Measure initial load
|
|
260
|
-
- [ ] **Runtime performance** - Check for slowdowns
|
|
261
|
-
- [ ] **Memory usage** - Monitor for leaks
|
|
262
|
-
|
|
263
|
-
### Browser Tests
|
|
264
|
-
- [ ] **Chrome** - Latest version
|
|
265
|
-
- [ ] **Firefox** - Latest version
|
|
266
|
-
- [ ] **Safari** - Latest version
|
|
267
|
-
- [ ] **Mobile browsers** - iOS Safari, Chrome Mobile
|
|
268
|
-
|
|
269
|
-
## 🆘 Getting Help
|
|
270
|
-
|
|
271
|
-
### If Migration Fails
|
|
272
|
-
|
|
273
|
-
1. **Check the logs** - Look for specific error messages
|
|
274
|
-
2. **Revert changes** - Go back to working version
|
|
275
|
-
3. **Check documentation** - Look for migration guides
|
|
276
|
-
4. **Search issues** - Check GitHub issues
|
|
277
|
-
5. **Ask for help** - Create detailed issue report
|
|
278
|
-
|
|
279
|
-
### Debug Information
|
|
280
|
-
|
|
281
|
-
When asking for help, include:
|
|
282
|
-
|
|
283
|
-
```bash
|
|
284
|
-
# Version information
|
|
285
|
-
npm list @jmruthers/pace-core
|
|
286
|
-
node --version
|
|
287
|
-
npm --version
|
|
288
|
-
|
|
289
|
-
# Build output
|
|
290
|
-
npm run build 2>&1 | tee build.log
|
|
291
|
-
|
|
292
|
-
# Error details
|
|
293
|
-
# Include full error messages and stack traces
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
### Emergency Rollback
|
|
297
|
-
|
|
298
|
-
```bash
|
|
299
|
-
# Rollback to previous version
|
|
300
|
-
npm install @jmruthers/pace-core@0.4.16
|
|
301
|
-
|
|
302
|
-
# Or specific working version
|
|
303
|
-
npm install @jmruthers/pace-core@0.4.15
|
|
304
|
-
|
|
305
|
-
# Clear caches
|
|
306
|
-
rm -rf node_modules package-lock.json
|
|
307
|
-
npm install
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
## 📚 Additional Resources
|
|
311
|
-
|
|
312
|
-
- **[Full Migration Guide](./README.md)** - Detailed migration instructions
|
|
313
|
-
- **[Breaking Changes](./breaking-changes.md)** - Complete list of breaking changes
|
|
314
|
-
- **[Changelog](../CHANGELOG.md)** - Version history and changes
|
|
315
|
-
- **[Troubleshooting](../troubleshooting/README.md)** - Common issues and solutions
|
|
316
|
-
- **[GitHub Issues](https://github.com/jmruthers/pace-core/issues)** - Report bugs and get help
|
|
317
|
-
|
|
318
|
-
---
|
|
319
|
-
|
|
320
|
-
**Remember**: Always test migrations in a development environment first!
|
package/docs/migration-guide.md
DELETED
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
# Migration Guide: Two-File CSS Architecture
|
|
2
|
-
|
|
3
|
-
This guide explains how to migrate your consuming app to use the new two-file CSS architecture with Tailwind v4 and native utilities.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
The new architecture uses:
|
|
8
|
-
- **2 CSS files**: core.css from pace-core + app.css in each consuming app
|
|
9
|
-
- **App-specific palettes**: Each app defines its own main/sec/acc color palettes
|
|
10
|
-
- **Native utilities**: Use standard Tailwind classes (bg-main-600, text-sec-700)
|
|
11
|
-
- **No CVA**: Components use native Tailwind utilities, not class-variance-authority
|
|
12
|
-
- **App-controlled scanning**: Each app handles its own Tailwind content scanning
|
|
13
|
-
|
|
14
|
-
This provides maximum flexibility while maintaining consistency through the semantic token system.
|
|
15
|
-
|
|
16
|
-
## Migration Steps
|
|
17
|
-
|
|
18
|
-
### 1. Create Your App CSS File
|
|
19
|
-
|
|
20
|
-
Create `src/app.css` in your consuming app with your brand colors and source directives:
|
|
21
|
-
|
|
22
|
-
```css
|
|
23
|
-
@import "tailwindcss";
|
|
24
|
-
|
|
25
|
-
/* @source directives for Tailwind v4 content scanning */
|
|
26
|
-
@source "./src/**/*.{js,ts,jsx,tsx}";
|
|
27
|
-
@source "./node_modules/@jmruthers/pace-core/src/**/*.{js,ts,jsx,tsx}";
|
|
28
|
-
@source "./node_modules/@jmruthers/pace-core/src/components/**/*.{js,ts,jsx,tsx}";
|
|
29
|
-
@source "./node_modules/@jmruthers/pace-core/src/providers/**/*.{js,ts,jsx,tsx}";
|
|
30
|
-
@source "./node_modules/@jmruthers/pace-core/src/hooks/**/*.{js,ts,jsx,tsx}";
|
|
31
|
-
@source "./node_modules/@jmruthers/pace-core/src/utils/**/*.{js,ts,jsx,tsx}";
|
|
32
|
-
@source "./node_modules/@jmruthers/pace-core/src/types/**/*.{js,ts,jsx,tsx}";
|
|
33
|
-
@source "./node_modules/@jmruthers/pace-core/src/validation/**/*.{js,ts,jsx,tsx}";
|
|
34
|
-
@source "./node_modules/@jmruthers/pace-core/src/rbac/**/*.{js,ts,jsx,tsx}";
|
|
35
|
-
|
|
36
|
-
/* Define your brand color palettes */
|
|
37
|
-
@theme static {
|
|
38
|
-
/* Your main, secondary, and accent color palettes here */
|
|
39
|
-
/* See the styling guide for the complete structure */
|
|
40
|
-
}
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### 2. Update Your Imports
|
|
44
|
-
|
|
45
|
-
Replace old style imports with the new two-file system:
|
|
46
|
-
|
|
47
|
-
```tsx
|
|
48
|
-
// OLD - Remove these imports
|
|
49
|
-
// import '@jmruthers/pace-core/styles';
|
|
50
|
-
// import '@jmruthers/pace-core/styles/tokens';
|
|
51
|
-
// import '@jmruthers/pace-core/styles/components';
|
|
52
|
-
// import '@jmruthers/pace-core/styles/base.css';
|
|
53
|
-
// import '@jmruthers/pace-core/styles/theme.css';
|
|
54
|
-
|
|
55
|
-
// NEW - Import both CSS files in the correct order
|
|
56
|
-
import '@jmruthers/pace-core/src/styles/core.css'; // Import core first
|
|
57
|
-
import './app.css'; // Import app-specific colors second
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### 3. Define Your Color Palettes
|
|
61
|
-
|
|
62
|
-
**Required!** Each app must define its own color palettes in `app.css`:
|
|
63
|
-
|
|
64
|
-
- **Main palette**: Your primary brand color (50-950 shades)
|
|
65
|
-
- **Secondary palette**: Your supporting color (50-950 shades)
|
|
66
|
-
- **Accent palette**: Your highlight color (50-950 shades)
|
|
67
|
-
|
|
68
|
-
All utilities like `bg-main-600`, `text-sec-700`, `border-acc-500` will use your brand colors.
|
|
69
|
-
|
|
70
|
-
### 4. Update Your Component Classes
|
|
71
|
-
|
|
72
|
-
Replace old app-* classes with new native utilities:
|
|
73
|
-
|
|
74
|
-
```tsx
|
|
75
|
-
// OLD - Remove these classes
|
|
76
|
-
// <div className="bg-main-500 text-main-50">
|
|
77
|
-
// <Button className="bg-sec-600 hover:bg-sec-700">
|
|
78
|
-
|
|
79
|
-
// NEW - Use native utilities
|
|
80
|
-
<div className="bg-main-500 text-main-50">
|
|
81
|
-
<Button className="bg-sec-600 hover:bg-sec-700">
|
|
82
|
-
Click me
|
|
83
|
-
</Button>
|
|
84
|
-
</div>
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### 4. Configure Tailwind v4
|
|
88
|
-
|
|
89
|
-
Update your build configuration:
|
|
90
|
-
|
|
91
|
-
```tsx
|
|
92
|
-
// vite.config.ts
|
|
93
|
-
import { defineConfig } from 'vite'
|
|
94
|
-
import react from '@vitejs/plugin-react'
|
|
95
|
-
import tailwindcss from '@tailwindcss/vite'
|
|
96
|
-
|
|
97
|
-
export default defineConfig({
|
|
98
|
-
plugins: [react(), tailwindcss()],
|
|
99
|
-
})
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
### 5. Test Your Migration
|
|
103
|
-
|
|
104
|
-
1. **Verify imports**: Ensure the core CSS file is imported
|
|
105
|
-
2. **Check colors**: Verify the built-in color palettes work correctly
|
|
106
|
-
3. **Test components**: Ensure all components render correctly
|
|
107
|
-
4. **Check scanning**: Verify Tailwind automatically detects utility classes
|
|
108
|
-
|
|
109
|
-
## What Changed
|
|
110
|
-
|
|
111
|
-
### Before (Old System)
|
|
112
|
-
- Complex CSS structure with multiple files
|
|
113
|
-
- App-specific color palette files
|
|
114
|
-
- Manual Tailwind configuration
|
|
115
|
-
- Complex theming system
|
|
116
|
-
|
|
117
|
-
### After (New System)
|
|
118
|
-
- Clean single-file CSS structure
|
|
119
|
-
- Built-in color palettes
|
|
120
|
-
- Automatic file scanning with @source directives
|
|
121
|
-
- Native Tailwind utilities
|
|
122
|
-
|
|
123
|
-
## Benefits
|
|
124
|
-
|
|
125
|
-
1. **Simpler**: Only 1 CSS file to import
|
|
126
|
-
2. **Faster**: Native Tailwind utilities are optimized
|
|
127
|
-
3. **Cleaner**: No additional configuration needed
|
|
128
|
-
4. **Automatic**: Tailwind scans all source files through build tool configuration
|
|
129
|
-
5. **Future-proof**: Easy to maintain and extend
|
|
130
|
-
|
|
131
|
-
## Support
|
|
132
|
-
|
|
133
|
-
If you encounter issues during migration:
|
|
134
|
-
|
|
135
|
-
1. Check the [troubleshooting guide](../styles/README.md#troubleshooting)
|
|
136
|
-
2. Review the [usage guide](../usage.md) for complete examples
|
|
137
|
-
3. Open an issue on our GitHub repository
|
|
138
|
-
import tailwindcss from '@tailwindcss/vite'
|
|
139
|
-
|
|
140
|
-
export default defineConfig({
|
|
141
|
-
plugins: [
|
|
142
|
-
react(),
|
|
143
|
-
tailwindcss() // No theme configuration needed - it's in your CSS
|
|
144
|
-
],
|
|
145
|
-
})
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
## What You Get
|
|
149
|
-
|
|
150
|
-
### From Your App (`src/app.css`)
|
|
151
|
-
- ✅ Your specific brand colors
|
|
152
|
-
- ✅ App-specific gradients and custom styles
|
|
153
|
-
- ✅ Control over your visual identity
|
|
154
|
-
|
|
155
|
-
### From PACE Core Package
|
|
156
|
-
- ✅ All component styles (DataTable, buttons, etc.)
|
|
157
|
-
- ✅ Base element styles (h1-h6, p, a, etc.)
|
|
158
|
-
- ✅ Font definitions and loading
|
|
159
|
-
- ✅ Utility classes
|
|
160
|
-
- ✅ Semantic color mappings
|
|
161
|
-
- ✅ Automatic updates when the package is updated
|
|
162
|
-
|
|
163
|
-
## Benefits
|
|
164
|
-
|
|
165
|
-
1. **Brand Consistency**: Each app maintains its own visual identity
|
|
166
|
-
2. **Easy Updates**: Package updates automatically improve your components
|
|
167
|
-
3. **No Conflicts**: App colors can't accidentally override component styles
|
|
168
|
-
4. **Maintainable**: Color changes only need to be made in one file
|
|
169
|
-
5. **Future-Proof**: New features and improvements come automatically
|
|
170
|
-
|
|
171
|
-
## Color Customization
|
|
172
|
-
|
|
173
|
-
To customize your app's colors, simply update the `--color-main-*`, `--color-sec-*`, and `--color-acc-*` variables in your `src/app.css` file. The semantic color mappings will automatically use your new colors throughout the application.
|
|
174
|
-
|
|
175
|
-
## Troubleshooting
|
|
176
|
-
|
|
177
|
-
### Colors Not Updating
|
|
178
|
-
- Ensure your `src/app.css` is imported in your main entry point
|
|
179
|
-
- Check that the color variables are defined in the `@theme static` block
|
|
180
|
-
- Verify that the semantic mappings in `@theme inline` are referencing your color variables
|
|
181
|
-
|
|
182
|
-
### Styles Not Loading
|
|
183
|
-
- Make sure you're importing the core CSS file in your app's entry point:
|
|
184
|
-
```tsx
|
|
185
|
-
import './app.css'; // Your app's color palette (must come first)
|
|
186
|
-
import '@jmruthers/pace-core/src/styles/core.css';
|
|
187
|
-
```
|
|
188
|
-
- Check that Tailwind CSS v4 is properly configured
|
|
189
|
-
- Ensure your Vite configuration includes the `@tailwindcss/vite` plugin
|
|
190
|
-
|
|
191
|
-
### Font Issues
|
|
192
|
-
- The package includes embedded fonts, so no additional font loading is needed
|
|
193
|
-
- If you want to use different fonts, update the `--font-*` variables in your `@theme` block
|