@jmruthers/pace-core 0.2.4
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 +202 -0
- package/README.md +299 -0
- package/dist/DataTable-BHlzyKZP.d.ts +116 -0
- package/dist/DataTable-GEY5U7OI.js +100 -0
- package/dist/DataTable-GEY5U7OI.js.map +1 -0
- package/dist/PublicLoadingSpinner-DztrzuJr.d.ts +3430 -0
- package/dist/UnifiedAuthProvider-w66zSCUf.d.ts +160 -0
- package/dist/api-GZHIDA4X.js +41 -0
- package/dist/api-GZHIDA4X.js.map +1 -0
- package/dist/appConfig-BVGyuvI7.d.ts +71 -0
- package/dist/appNameResolver-7GHF5ED2.js +22 -0
- package/dist/appNameResolver-7GHF5ED2.js.map +1 -0
- package/dist/audit-BUW3LMJB.js +16 -0
- package/dist/audit-BUW3LMJB.js.map +1 -0
- package/dist/chunk-22KLBHPS.js +29 -0
- package/dist/chunk-22KLBHPS.js.map +1 -0
- package/dist/chunk-24MKLB7U.js +81 -0
- package/dist/chunk-24MKLB7U.js.map +1 -0
- package/dist/chunk-2MKP6IYD.js +388 -0
- package/dist/chunk-2MKP6IYD.js.map +1 -0
- package/dist/chunk-2V3Y6YBC.js +114 -0
- package/dist/chunk-2V3Y6YBC.js.map +1 -0
- package/dist/chunk-5CDJCTOO.js +190 -0
- package/dist/chunk-5CDJCTOO.js.map +1 -0
- package/dist/chunk-6ZQVSHKL.js +1345 -0
- package/dist/chunk-6ZQVSHKL.js.map +1 -0
- package/dist/chunk-74C6SNEC.js +77 -0
- package/dist/chunk-74C6SNEC.js.map +1 -0
- package/dist/chunk-7BNPOCLL.js +178 -0
- package/dist/chunk-7BNPOCLL.js.map +1 -0
- package/dist/chunk-7JL3T7BO.js +3344 -0
- package/dist/chunk-7JL3T7BO.js.map +1 -0
- package/dist/chunk-CDQ3PX7L.js +18 -0
- package/dist/chunk-CDQ3PX7L.js.map +1 -0
- package/dist/chunk-DY5E3AT7.js +1734 -0
- package/dist/chunk-DY5E3AT7.js.map +1 -0
- package/dist/chunk-ETEJVKYK.js +6032 -0
- package/dist/chunk-ETEJVKYK.js.map +1 -0
- package/dist/chunk-I5Z3QH5X.js +32 -0
- package/dist/chunk-I5Z3QH5X.js.map +1 -0
- package/dist/chunk-MZBUOP4P.js +119 -0
- package/dist/chunk-MZBUOP4P.js.map +1 -0
- package/dist/chunk-N2EUGZRW.js +98 -0
- package/dist/chunk-N2EUGZRW.js.map +1 -0
- package/dist/chunk-NQ4TOOO6.js +20 -0
- package/dist/chunk-NQ4TOOO6.js.map +1 -0
- package/dist/chunk-OHXGNT3K.js +21 -0
- package/dist/chunk-OHXGNT3K.js.map +1 -0
- package/dist/chunk-OKXMUYIB.js +522 -0
- package/dist/chunk-OKXMUYIB.js.map +1 -0
- package/dist/chunk-PFRRIDYA.js +382 -0
- package/dist/chunk-PFRRIDYA.js.map +1 -0
- package/dist/chunk-PLDDJCW6.js +49 -0
- package/dist/chunk-PLDDJCW6.js.map +1 -0
- package/dist/chunk-SS3E6QLB.js +695 -0
- package/dist/chunk-SS3E6QLB.js.map +1 -0
- package/dist/chunk-TMRLB2LA.js +326 -0
- package/dist/chunk-TMRLB2LA.js.map +1 -0
- package/dist/chunk-WYB6MBZA.js +5533 -0
- package/dist/chunk-WYB6MBZA.js.map +1 -0
- package/dist/chunk-YDJW5XTN.js +84 -0
- package/dist/chunk-YDJW5XTN.js.map +1 -0
- package/dist/components.d.ts +1308 -0
- package/dist/components.js +3759 -0
- package/dist/components.js.map +1 -0
- package/dist/database-C3Szpi5J.d.ts +470 -0
- package/dist/hooks.d.ts +449 -0
- package/dist/hooks.js +612 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.d.ts +385 -0
- package/dist/index.js +569 -0
- package/dist/index.js.map +1 -0
- package/dist/organisation-CO3Sh3_D.d.ts +99 -0
- package/dist/providers.d.ts +45 -0
- package/dist/providers.js +36 -0
- package/dist/providers.js.map +1 -0
- package/dist/rbac/eslint-rules.d.ts +52 -0
- package/dist/rbac/eslint-rules.js +252 -0
- package/dist/rbac/eslint-rules.js.map +1 -0
- package/dist/rbac/index.d.ts +1918 -0
- package/dist/rbac/index.js +2212 -0
- package/dist/rbac/index.js.map +1 -0
- package/dist/styles/core.css +401 -0
- package/dist/styles/fonts/georama-italic.woff2 +0 -0
- package/dist/styles/fonts/georama.woff2 +0 -0
- package/dist/styles/fonts/open-sans-italic.woff2 +0 -0
- package/dist/styles/fonts/open-sans.woff2 +0 -0
- package/dist/styles/fonts/reddit-mono.woff2 +0 -0
- package/dist/styles/index.d.ts +36 -0
- package/dist/styles/index.js +24 -0
- package/dist/styles/index.js.map +1 -0
- package/dist/theming/runtime.d.ts +73 -0
- package/dist/theming/runtime.js +16 -0
- package/dist/theming/runtime.js.map +1 -0
- package/dist/types-CInEi-ng.d.ts +316 -0
- package/dist/types.d.ts +196 -0
- package/dist/types.js +83 -0
- package/dist/types.js.map +1 -0
- package/dist/unified-CM7T0aTK.d.ts +198 -0
- package/dist/useComponentPerformance-DE9l5RkL.d.ts +11 -0
- package/dist/usePublicRouteParams-B6i0KtXW.d.ts +477 -0
- package/dist/utils.d.ts +639 -0
- package/dist/utils.js +1103 -0
- package/dist/utils.js.map +1 -0
- package/dist/validation-PM_iOaTI.d.ts +159 -0
- package/dist/validation.d.ts +138 -0
- package/dist/validation.js +477 -0
- package/dist/validation.js.map +1 -0
- package/docs/INDEX.md +192 -0
- package/docs/README.md +165 -0
- package/docs/api/.nojekyll +1 -0
- package/docs/api/README.md +301 -0
- package/docs/api/classes/ErrorBoundary.md +144 -0
- package/docs/api/classes/PublicErrorBoundary.md +132 -0
- package/docs/api/interfaces/AggregateConfig.md +43 -0
- package/docs/api/interfaces/ButtonProps.md +53 -0
- package/docs/api/interfaces/CardProps.md +40 -0
- package/docs/api/interfaces/ColorPalette.md +7 -0
- package/docs/api/interfaces/ColorShade.md +41 -0
- package/docs/api/interfaces/DataTableAction.md +200 -0
- package/docs/api/interfaces/DataTableColumn.md +300 -0
- package/docs/api/interfaces/DataTableProps.md +517 -0
- package/docs/api/interfaces/DataTableToolbarButton.md +96 -0
- package/docs/api/interfaces/EmptyStateConfig.md +61 -0
- package/docs/api/interfaces/EventContextType.md +96 -0
- package/docs/api/interfaces/EventLogoProps.md +152 -0
- package/docs/api/interfaces/EventProviderProps.md +19 -0
- package/docs/api/interfaces/FileSizeLimits.md +7 -0
- package/docs/api/interfaces/FileUploadProps.md +154 -0
- package/docs/api/interfaces/FooterProps.md +105 -0
- package/docs/api/interfaces/InactivityWarningModalProps.md +115 -0
- package/docs/api/interfaces/InputProps.md +53 -0
- package/docs/api/interfaces/LabelProps.md +107 -0
- package/docs/api/interfaces/LoginFormProps.md +184 -0
- package/docs/api/interfaces/NavigationItem.md +176 -0
- package/docs/api/interfaces/NavigationMenuProps.md +236 -0
- package/docs/api/interfaces/Organisation.md +140 -0
- package/docs/api/interfaces/OrganisationContextType.md +377 -0
- package/docs/api/interfaces/OrganisationMembership.md +140 -0
- package/docs/api/interfaces/OrganisationProviderProps.md +19 -0
- package/docs/api/interfaces/OrganisationSecurityError.md +62 -0
- package/docs/api/interfaces/PaceAppLayoutProps.md +393 -0
- package/docs/api/interfaces/PaceLoginPageProps.md +34 -0
- package/docs/api/interfaces/PaletteData.md +41 -0
- package/docs/api/interfaces/PublicErrorBoundaryProps.md +94 -0
- package/docs/api/interfaces/PublicErrorBoundaryState.md +68 -0
- package/docs/api/interfaces/PublicLoadingSpinnerProps.md +86 -0
- package/docs/api/interfaces/PublicPageFooterProps.md +112 -0
- package/docs/api/interfaces/PublicPageHeaderProps.md +138 -0
- package/docs/api/interfaces/PublicPageLayoutProps.md +138 -0
- package/docs/api/interfaces/StorageConfig.md +41 -0
- package/docs/api/interfaces/StorageFileInfo.md +74 -0
- package/docs/api/interfaces/StorageFileMetadata.md +140 -0
- package/docs/api/interfaces/StorageListOptions.md +86 -0
- package/docs/api/interfaces/StorageListResult.md +41 -0
- package/docs/api/interfaces/StorageUploadOptions.md +88 -0
- package/docs/api/interfaces/StorageUploadResult.md +63 -0
- package/docs/api/interfaces/StorageUrlOptions.md +47 -0
- package/docs/api/interfaces/StyleImport.md +19 -0
- package/docs/api/interfaces/ToastActionElement.md +9 -0
- package/docs/api/interfaces/ToastProps.md +9 -0
- package/docs/api/interfaces/UnifiedAuthContextType.md +1108 -0
- package/docs/api/interfaces/UnifiedAuthProviderProps.md +171 -0
- package/docs/api/interfaces/UseInactivityTrackerOptions.md +136 -0
- package/docs/api/interfaces/UseInactivityTrackerReturn.md +123 -0
- package/docs/api/interfaces/UsePublicEventLogoOptions.md +87 -0
- package/docs/api/interfaces/UsePublicEventLogoReturn.md +81 -0
- package/docs/api/interfaces/UsePublicEventOptions.md +34 -0
- package/docs/api/interfaces/UsePublicEventReturn.md +68 -0
- package/docs/api/interfaces/UsePublicRouteParamsReturn.md +94 -0
- package/docs/api/interfaces/UserEventAccess.md +118 -0
- package/docs/api/interfaces/UserMenuProps.md +86 -0
- package/docs/api/interfaces/UserProfile.md +63 -0
- package/docs/api/modules.md +4153 -0
- package/docs/api-reference/components.md +1623 -0
- package/docs/api-reference/hooks.md +627 -0
- package/docs/api-reference/providers.md +487 -0
- package/docs/api-reference/types.md +1005 -0
- package/docs/api-reference/utilities.md +1104 -0
- package/docs/app.css.example +53 -0
- package/docs/architecture/README.md +577 -0
- package/docs/best-practices/README.md +400 -0
- package/docs/best-practices/deployment.md +1042 -0
- package/docs/best-practices/performance.md +789 -0
- package/docs/best-practices/security.md +881 -0
- package/docs/best-practices/testing.md +981 -0
- package/docs/consuming-app-example.md +290 -0
- package/docs/consuming-app-vite-config.md +233 -0
- package/docs/core-concepts/authentication.md +98 -0
- package/docs/core-concepts/events.md +756 -0
- package/docs/core-concepts/organisations.md +790 -0
- package/docs/core-concepts/permissions.md +729 -0
- package/docs/core-concepts/rbac-system.md +233 -0
- package/docs/database-schema-requirements.md +172 -0
- package/docs/documentation-style-checklist.md +294 -0
- package/docs/examples/navigation-menu-auth-fix.md +344 -0
- package/docs/getting-started/examples/README.md +106 -0
- package/docs/getting-started/examples/basic-auth-app.md +521 -0
- package/docs/getting-started/examples/full-featured-app.md +616 -0
- package/docs/getting-started/installation.md +269 -0
- package/docs/getting-started/quick-start.md +401 -0
- package/docs/implementation-guides/app-layout.md +983 -0
- package/docs/implementation-guides/data-tables.md +1898 -0
- package/docs/implementation-guides/dynamic-colors.md +195 -0
- package/docs/implementation-guides/forms.md +578 -0
- package/docs/implementation-guides/hierarchical-datatable.md +850 -0
- package/docs/implementation-guides/large-datasets.md +281 -0
- package/docs/implementation-guides/navigation.md +844 -0
- package/docs/implementation-guides/performance.md +403 -0
- package/docs/implementation-guides/permission-enforcement.md +764 -0
- package/docs/implementation-guides/public-pages.md +752 -0
- package/docs/migration/README.md +493 -0
- package/docs/migration/organisation-context-timing-fix.md +217 -0
- package/docs/migration/quick-migration-guide.md +320 -0
- package/docs/migration/rbac-migration.md +571 -0
- package/docs/migration/v0.4.15-tailwind-scanning.md +272 -0
- package/docs/migration/v0.4.16-css-first-approach.md +306 -0
- package/docs/migration/v0.4.17-source-path-fix.md +229 -0
- package/docs/migration-guide.md +168 -0
- package/docs/performance/README.md +551 -0
- package/docs/print-components/README.md +258 -0
- package/docs/print-components/api-reference.md +636 -0
- package/docs/print-components/examples/README.md +204 -0
- package/docs/print-components/examples/basic-report.tsx +92 -0
- package/docs/print-components/examples/card-catalog.tsx +149 -0
- package/docs/print-components/examples/cover-page-report.tsx +163 -0
- package/docs/print-components/quick-start.md +363 -0
- package/docs/quick-reference.md +576 -0
- package/docs/rbac/README.md +265 -0
- package/docs/rbac/advanced-patterns.md +776 -0
- package/docs/rbac/api-reference.md +1033 -0
- package/docs/rbac/examples.md +883 -0
- package/docs/rbac/getting-started.md +679 -0
- package/docs/rbac/quick-start.md +619 -0
- package/docs/rbac/super-admin-guide.md +592 -0
- package/docs/rbac/troubleshooting.md +316 -0
- package/docs/security/README.md +680 -0
- package/docs/security/checklist.md +343 -0
- package/docs/style-guide.md +522 -0
- package/docs/styles/README.md +319 -0
- package/docs/testing/README.md +874 -0
- package/docs/troubleshooting/README.md +497 -0
- package/docs/troubleshooting/common-issues.md +1563 -0
- package/docs/troubleshooting/database-view-compatibility.md +119 -0
- package/docs/troubleshooting/debugging.md +1117 -0
- package/docs/troubleshooting/migration.md +918 -0
- package/docs/troubleshooting/organisation-context-setup.md +277 -0
- package/docs/troubleshooting/react-hooks-issue-analysis.md +166 -0
- package/docs/troubleshooting/styling-issues.md +219 -0
- package/docs/troubleshooting/tailwind-content-scanning.md +213 -0
- package/docs/usage.md +175 -0
- package/docs/visual-testing.md +114 -0
- package/package.json +211 -0
- package/src/__mocks__/lucide-react.ts +181 -0
- package/src/__tests__/README.md +404 -0
- package/src/__tests__/debug-provider.unit.test.tsx +67 -0
- package/src/__tests__/e2e/workflows.test.tsx +373 -0
- package/src/__tests__/hybridPermissions.unit.test.tsx +474 -0
- package/src/__tests__/index.integration.test.ts +491 -0
- package/src/__tests__/mocks/MockAuthProvider-standalone.tsx +47 -0
- package/src/__tests__/mocks/MockAuthProvider.tsx +63 -0
- package/src/__tests__/mocks/enhancedSupabaseMock.ts +252 -0
- package/src/__tests__/mocks/index.test.ts +23 -0
- package/src/__tests__/mocks/index.ts +16 -0
- package/src/__tests__/mocks/mockAuth.ts +155 -0
- package/src/__tests__/mocks/mockSupabase.ts +83 -0
- package/src/__tests__/mocks/mockSupabaseClient.ts +63 -0
- package/src/__tests__/mocks/providers.tsx +22 -0
- package/src/__tests__/patterns/__tests__/testPatterns.test.ts +394 -0
- package/src/__tests__/patterns/testPatterns.ts +124 -0
- package/src/__tests__/performance/componentPerformance.performance.test.ts +27 -0
- package/src/__tests__/performance/index.ts +24 -0
- package/src/__tests__/performance/performanceValidation.performance.test.ts +15 -0
- package/src/__tests__/security/security.unit.test.tsx +7 -0
- package/src/__tests__/security/securityValidation.security.test.tsx +153 -0
- package/src/__tests__/setup.ts +259 -0
- package/src/__tests__/setupTests.d.ts +1 -0
- package/src/__tests__/shared/componentTestUtils.tsx +475 -0
- package/src/__tests__/shared/errorHandlingTestUtils.ts +107 -0
- package/src/__tests__/shared/index.ts +81 -0
- package/src/__tests__/shared/integrationTestUtils.tsx +375 -0
- package/src/__tests__/shared/performanceTestUtils.tsx +476 -0
- package/src/__tests__/shared/testUtils.optimized.tsx +627 -0
- package/src/__tests__/simple.test.tsx +20 -0
- package/src/__tests__/templates/accessibility.test.template.tsx +279 -0
- package/src/__tests__/templates/component.test.template.tsx +122 -0
- package/src/__tests__/templates/integration.test.template.tsx +199 -0
- package/src/__tests__/test-utils/dataFactories.ts +60 -0
- package/src/__tests__/test-utils/index.ts +6 -0
- package/src/__tests__/typeSafety.unit.test.ts +65 -0
- package/src/__tests__/unifiedAuth.unit.test.tsx +151 -0
- package/src/__tests__/utils/accessibilityHelpers.ts +254 -0
- package/src/__tests__/utils/assertions.ts +50 -0
- package/src/__tests__/utils/deterministicHelpers.ts +31 -0
- package/src/__tests__/utils/edgeCaseConfig.test.ts +75 -0
- package/src/__tests__/utils/edgeCaseConfig.ts +98 -0
- package/src/__tests__/utils/mockHelpers.ts +149 -0
- package/src/__tests__/utils/mockLoader.ts +101 -0
- package/src/__tests__/utils/performanceHelpers.ts +55 -0
- package/src/__tests__/utils/performanceTestHelpers.ts +68 -0
- package/src/__tests__/utils/testDataFactories.ts +28 -0
- package/src/__tests__/utils/testIsolation.ts +67 -0
- package/src/__tests__/utils/visualTestHelpers.ts +20 -0
- package/src/__tests__/visual/__snapshots__/componentSnapshots.visual.test.tsx.snap +68 -0
- package/src/__tests__/visual/__snapshots__/componentVisuals.visual.test.tsx.snap +14 -0
- package/src/__tests__/visual/__snapshots__/visualRegression.test.tsx.snap +217 -0
- package/src/__tests__/visual/__snapshots__/visualRegression.visual.test.tsx.snap +24 -0
- package/src/__tests__/visual/componentSnapshots.visual.test.tsx +33 -0
- package/src/__tests__/visual/componentVisuals.visual.test.tsx +12 -0
- package/src/__tests__/visual/visualRegression.visual.test.tsx +20 -0
- package/src/components/Alert/Alert.tsx +134 -0
- package/src/components/Alert/__tests__/Alert.unit.test.tsx +381 -0
- package/src/components/Alert/index.ts +2 -0
- package/src/components/Avatar/Avatar.tsx +84 -0
- package/src/components/Avatar/__tests__/Avatar.unit.test.tsx +232 -0
- package/src/components/Avatar/index.ts +2 -0
- package/src/components/Button/Button.tsx +270 -0
- package/src/components/Button/__tests__/Button.accessibility.test.tsx +131 -0
- package/src/components/Button/__tests__/Button.comprehensive.test.tsx +721 -0
- package/src/components/Button/__tests__/Button.unit.test.tsx +189 -0
- package/src/components/Button/__tests__/EventSelector.integration.test.tsx +285 -0
- package/src/components/Button/index.ts +2 -0
- package/src/components/Card/Card.tsx +271 -0
- package/src/components/Card/__tests__/Card.accessibility.test.tsx +394 -0
- package/src/components/Card/__tests__/Card.comprehensive.test.tsx +599 -0
- package/src/components/Card/__tests__/Card.integration.test.tsx +673 -0
- package/src/components/Card/__tests__/Card.performance.test.tsx +546 -0
- package/src/components/Card/__tests__/Card.unit.test.tsx +330 -0
- package/src/components/Card/__tests__/Card.visual.test.tsx +599 -0
- package/src/components/Card/__tests__/README.md +211 -0
- package/src/components/Card/index.ts +1 -0
- package/src/components/Checkbox/Checkbox.tsx +75 -0
- package/src/components/Checkbox/__mocks__/Checkbox.tsx +2 -0
- package/src/components/Checkbox/__tests__/Checkbox.unit.test.tsx +520 -0
- package/src/components/Checkbox/index.ts +2 -0
- package/src/components/DataTable/DataTable.tsx +440 -0
- package/src/components/DataTable/__tests__/DataTable.autoSizing.test.tsx +526 -0
- package/src/components/DataTable/__tests__/DataTable.errorHandling.test.tsx +259 -0
- package/src/components/DataTable/__tests__/DataTable.hierarchical.test.tsx +675 -0
- package/src/components/DataTable/__tests__/DataTable.infinite-loop.test.tsx +324 -0
- package/src/components/DataTable/__tests__/DataTable.integration.test.tsx +724 -0
- package/src/components/DataTable/__tests__/DataTable.performance.test.tsx +597 -0
- package/src/components/DataTable/__tests__/DataTable.permissions.test.tsx +306 -0
- package/src/components/DataTable/__tests__/DataTable.regressionFixes.test.tsx +546 -0
- package/src/components/DataTable/__tests__/DataTable.selection.controlled.test.tsx +386 -0
- package/src/components/DataTable/__tests__/DataTable.selection.test.tsx +338 -0
- package/src/components/DataTable/__tests__/DataTable.userWorkflows.test.tsx +310 -0
- package/src/components/DataTable/__tests__/DataTable.workflowValidation.test.tsx +489 -0
- package/src/components/DataTable/__tests__/DataTable.workflows.test.tsx +701 -0
- package/src/components/DataTable/__tests__/README.md +136 -0
- package/src/components/DataTable/__tests__/mocks/MockRBACProvider.tsx +66 -0
- package/src/components/DataTable/__tests__/performance-regression.test.tsx +788 -0
- package/src/components/DataTable/__tests__/performance.test.tsx +365 -0
- package/src/components/DataTable/__tests__/test-utils/dataFactories.ts +103 -0
- package/src/components/DataTable/__tests__/test-utils/sharedTestUtils.tsx +382 -0
- package/src/components/DataTable/__tests__/test-utils.ts +94 -0
- package/src/components/DataTable/components/ActionButtons.tsx +177 -0
- package/src/components/DataTable/components/BulkOperationsDropdown.tsx +160 -0
- package/src/components/DataTable/components/ColumnFilter.tsx +114 -0
- package/src/components/DataTable/components/ColumnVisibilityDropdown.tsx +100 -0
- package/src/components/DataTable/components/DataTableBody.tsx +462 -0
- package/src/components/DataTable/components/DataTableCore.tsx +869 -0
- package/src/components/DataTable/components/DataTableErrorBoundary.tsx +214 -0
- package/src/components/DataTable/components/DataTableHeader.tsx +31 -0
- package/src/components/DataTable/components/DataTableModals.tsx +87 -0
- package/src/components/DataTable/components/DataTableToolbar.tsx +251 -0
- package/src/components/DataTable/components/DraggableColumnHeader.tsx +148 -0
- package/src/components/DataTable/components/EditableRow.tsx +160 -0
- package/src/components/DataTable/components/EmptyState.tsx +64 -0
- package/src/components/DataTable/components/ExpandButton.tsx +113 -0
- package/src/components/DataTable/components/FilterRow.tsx +101 -0
- package/src/components/DataTable/components/GroupHeader.tsx +42 -0
- package/src/components/DataTable/components/GroupingDropdown.tsx +96 -0
- package/src/components/DataTable/components/ImportModal.tsx +345 -0
- package/src/components/DataTable/components/LoadingState.tsx +12 -0
- package/src/components/DataTable/components/PaginationControls.tsx +332 -0
- package/src/components/DataTable/components/UnifiedTableBody.tsx +911 -0
- package/src/components/DataTable/components/ViewRowModal.tsx +68 -0
- package/src/components/DataTable/components/VirtualizedDataTable.tsx +593 -0
- package/src/components/DataTable/components/__tests__/ActionButtons.unit.test.tsx +150 -0
- package/src/components/DataTable/components/__tests__/BulkOperationsDropdown.test.tsx +224 -0
- package/src/components/DataTable/components/__tests__/ColumnVisibilityDropdown.unit.test.tsx +244 -0
- package/src/components/DataTable/components/__tests__/DataTable.accessibility.test.tsx +523 -0
- package/src/components/DataTable/components/__tests__/DataTable.integration.test.tsx +401 -0
- package/src/components/DataTable/components/__tests__/DataTable.performance.test.tsx +161 -0
- package/src/components/DataTable/components/__tests__/DataTable.real.test.tsx +251 -0
- package/src/components/DataTable/components/__tests__/DataTable.security.test.tsx +172 -0
- package/src/components/DataTable/components/__tests__/DataTable.unit.test.tsx +290 -0
- package/src/components/DataTable/components/__tests__/DataTableBody.unit.test.tsx +147 -0
- package/src/components/DataTable/components/__tests__/DataTableErrorBoundary.unit.test.tsx +182 -0
- package/src/components/DataTable/components/__tests__/DataTableHeader.unit.test.tsx +143 -0
- package/src/components/DataTable/components/__tests__/DataTableModals.unit.test.tsx +123 -0
- package/src/components/DataTable/components/__tests__/EditableRow.unit.test.tsx +660 -0
- package/src/components/DataTable/components/__tests__/EmptyState.unit.test.tsx +256 -0
- package/src/components/DataTable/components/__tests__/ExpandButton.test.tsx +498 -0
- package/src/components/DataTable/components/__tests__/FilterRow.unit.test.tsx +112 -0
- package/src/components/DataTable/components/__tests__/FilteringToggle.unit.test.tsx +130 -0
- package/src/components/DataTable/components/__tests__/GroupHeader.unit.test.tsx +172 -0
- package/src/components/DataTable/components/__tests__/GroupingDropdown.unit.test.tsx +222 -0
- package/src/components/DataTable/components/__tests__/ImportModal.unit.test.tsx +780 -0
- package/src/components/DataTable/components/__tests__/LoadingState.unit.test.tsx +65 -0
- package/src/components/DataTable/components/__tests__/PaginationControls.unit.test.tsx +634 -0
- package/src/components/DataTable/components/__tests__/StateComponents.unit.test.tsx +48 -0
- package/src/components/DataTable/components/__tests__/UnifiedTableBody.hierarchical.test.tsx +541 -0
- package/src/components/DataTable/components/__tests__/ViewRowModal.unit.test.tsx +228 -0
- package/src/components/DataTable/components/__tests__/VirtualizedDataTable.unit.test.tsx +568 -0
- package/src/components/DataTable/components/index.ts +17 -0
- package/src/components/DataTable/context/DataTableContext.tsx +97 -0
- package/src/components/DataTable/core/ActionManager.ts +235 -0
- package/src/components/DataTable/core/ColumnFactory.ts +268 -0
- package/src/components/DataTable/core/ColumnManager.ts +205 -0
- package/src/components/DataTable/core/DataManager.ts +188 -0
- package/src/components/DataTable/core/DataTableContext.tsx +182 -0
- package/src/components/DataTable/core/LocalDataAdapter.ts +264 -0
- package/src/components/DataTable/core/PluginRegistry.ts +229 -0
- package/src/components/DataTable/core/StateManager.ts +311 -0
- package/src/components/DataTable/core/__tests__/ActionManager.unit.test.ts +405 -0
- package/src/components/DataTable/core/__tests__/ArchitectureIntegration.unit.test.tsx +445 -0
- package/src/components/DataTable/core/__tests__/ColumnFactory.unit.test.ts +288 -0
- package/src/components/DataTable/core/__tests__/ColumnManager.unit.test.ts +623 -0
- package/src/components/DataTable/core/__tests__/DataManager.unit.test.ts +431 -0
- package/src/components/DataTable/core/__tests__/DataTableContext.unit.test.tsx +433 -0
- package/src/components/DataTable/core/__tests__/LocalDataAdapter.unit.test.ts +422 -0
- package/src/components/DataTable/core/__tests__/PluginRegistry.unit.test.tsx +207 -0
- package/src/components/DataTable/core/__tests__/StateManager.unit.test.ts +278 -0
- package/src/components/DataTable/core/index.ts +8 -0
- package/src/components/DataTable/core/interfaces.ts +338 -0
- package/src/components/DataTable/examples/AutoSizingExample.tsx +180 -0
- package/src/components/DataTable/examples/ColumnSizingComparison.tsx +235 -0
- package/src/components/DataTable/examples/HierarchicalActionsExample.tsx +418 -0
- package/src/components/DataTable/examples/HierarchicalExample.tsx +472 -0
- package/src/components/DataTable/examples/InitialPageSizeExample.tsx +173 -0
- package/src/components/DataTable/examples/PerformanceExample.tsx +502 -0
- package/src/components/DataTable/examples/__tests__/PerformanceExample.unit.test.tsx +281 -0
- package/src/components/DataTable/hooks/__tests__/useColumnOrderPersistence.unit.test.ts +407 -0
- package/src/components/DataTable/hooks/__tests__/useColumnReordering.unit.test.ts +679 -0
- package/src/components/DataTable/hooks/useColumnOrderPersistence.ts +95 -0
- package/src/components/DataTable/hooks/useColumnReordering.ts +110 -0
- package/src/components/DataTable/hooks/useDataTableState.ts +325 -0
- package/src/components/DataTable/hooks/useHierarchicalState.ts +174 -0
- package/src/components/DataTable/index.ts +70 -0
- package/src/components/DataTable/styles.ts +171 -0
- package/src/components/DataTable/types.ts +475 -0
- package/src/components/DataTable/utils/__tests__/columnSizing.test.ts +237 -0
- package/src/components/DataTable/utils/__tests__/debugTools.unit.test.ts +267 -0
- package/src/components/DataTable/utils/__tests__/errorHandling.unit.test.ts +467 -0
- package/src/components/DataTable/utils/__tests__/exportUtils.unit.test.ts +380 -0
- package/src/components/DataTable/utils/__tests__/flexibleImport.unit.test.ts +233 -0
- package/src/components/DataTable/utils/__tests__/performanceUtils.unit.test.ts +414 -0
- package/src/components/DataTable/utils/columnSizing.ts +125 -0
- package/src/components/DataTable/utils/debugTools.ts +583 -0
- package/src/components/DataTable/utils/errorHandling.ts +494 -0
- package/src/components/DataTable/utils/exportUtils.ts +126 -0
- package/src/components/DataTable/utils/flexibleImport.ts +510 -0
- package/src/components/DataTable/utils/hierarchicalSorting.ts +151 -0
- package/src/components/DataTable/utils/hierarchicalUtils.ts +218 -0
- package/src/components/DataTable/utils/index.ts +1 -0
- package/src/components/DataTable/utils/performanceUtils.ts +351 -0
- package/src/components/Dialog/Dialog.tsx +782 -0
- package/src/components/Dialog/README.md +804 -0
- package/src/components/Dialog/__tests__/Dialog.accessibility.test.tsx +521 -0
- package/src/components/Dialog/__tests__/Dialog.auto-size.example.tsx +157 -0
- package/src/components/Dialog/__tests__/Dialog.enhanced.test.tsx +538 -0
- package/src/components/Dialog/__tests__/Dialog.unit.test.tsx +1373 -0
- package/src/components/Dialog/examples/BasicHtmlTest.tsx +55 -0
- package/src/components/Dialog/examples/DebugHtmlExample.tsx +68 -0
- package/src/components/Dialog/examples/HtmlDialogExample.tsx +202 -0
- package/src/components/Dialog/examples/SimpleHtmlTest.tsx +61 -0
- package/src/components/Dialog/examples/SmartDialogExample.tsx +322 -0
- package/src/components/Dialog/examples/__tests__/SmartDialogExample.unit.test.tsx +151 -0
- package/src/components/Dialog/index.ts +12 -0
- package/src/components/Dialog/utils/__tests__/safeHtml.unit.test.ts +611 -0
- package/src/components/Dialog/utils/safeHtml.ts +185 -0
- package/src/components/ErrorBoundary/ErrorBoundary.tsx +312 -0
- package/src/components/ErrorBoundary/__tests__/ErrorBoundary.accessibility.test.tsx +517 -0
- package/src/components/ErrorBoundary/__tests__/ErrorBoundary.integration.test.tsx +572 -0
- package/src/components/ErrorBoundary/__tests__/ErrorBoundary.unit.test.tsx +579 -0
- package/src/components/ErrorBoundary/index.ts +8 -0
- package/src/components/EventSelector/EventSelector.tsx +360 -0
- package/src/components/EventSelector/__tests__/EventSelector.test.tsx +528 -0
- package/src/components/EventSelector/index.ts +3 -0
- package/src/components/EventSelector/types.ts +79 -0
- package/src/components/FileUpload/FileUpload.example.tsx +218 -0
- package/src/components/FileUpload/FileUpload.tsx +237 -0
- package/src/components/FileUpload/__tests__/FileUpload.integration.test.tsx +992 -0
- package/src/components/FileUpload/__tests__/FileUpload.real.test.tsx +927 -0
- package/src/components/FileUpload/__tests__/FileUpload.test.tsx +855 -0
- package/src/components/FileUpload/__tests__/FileUpload.unit.test.tsx +1311 -0
- package/src/components/FileUpload/__tests__/FileUpload.unmocked.test.tsx +937 -0
- package/src/components/FileUpload/index.ts +6 -0
- package/src/components/Footer/Footer.tsx +197 -0
- package/src/components/Footer/__tests__/Footer.accessibility.test.tsx +359 -0
- package/src/components/Footer/__tests__/Footer.integration.test.tsx +353 -0
- package/src/components/Footer/__tests__/Footer.performance.test.tsx +309 -0
- package/src/components/Footer/__tests__/Footer.unit.test.tsx +309 -0
- package/src/components/Footer/__tests__/Footer.visual.test.tsx +335 -0
- package/src/components/Footer/index.ts +17 -0
- package/src/components/Form/Form.tsx +166 -0
- package/src/components/Form/FormErrorSummary.tsx +113 -0
- package/src/components/Form/FormField.tsx +249 -0
- package/src/components/Form/FormFieldset.tsx +127 -0
- package/src/components/Form/FormLiveRegion.tsx +198 -0
- package/src/components/Form/__tests__/Form.accessibility.test.tsx +820 -0
- package/src/components/Form/__tests__/Form.unit.test.tsx +305 -0
- package/src/components/Form/__tests__/FormErrorSummary.unit.test.tsx +285 -0
- package/src/components/Form/__tests__/FormFieldset.unit.test.tsx +241 -0
- package/src/components/Form/index.ts +26 -0
- package/src/components/Header/Header.tsx +301 -0
- package/src/components/Header/__tests__/Header.accessibility.test.tsx +382 -0
- package/src/components/Header/__tests__/Header.comprehensive.test.tsx +509 -0
- package/src/components/Header/__tests__/Header.unit.test.tsx +335 -0
- package/src/components/Header/index.ts +4 -0
- package/src/components/InactivityWarningModal/InactivityWarningModal.test.tsx +196 -0
- package/src/components/InactivityWarningModal/InactivityWarningModal.tsx +164 -0
- package/src/components/InactivityWarningModal/__tests__/InactivityWarningModal.unit.test.tsx +224 -0
- package/src/components/InactivityWarningModal/index.ts +9 -0
- package/src/components/Input/Input.tsx +201 -0
- package/src/components/Input/__mocks__/Input.tsx +2 -0
- package/src/components/Input/__tests__/Input.accessibility.test.tsx +632 -0
- package/src/components/Input/__tests__/Input.unit.test.tsx +1121 -0
- package/src/components/Input/index.ts +9 -0
- package/src/components/Label/Label.tsx +186 -0
- package/src/components/Label/__tests__/Label.accessibility.test.tsx +239 -0
- package/src/components/Label/__tests__/Label.unit.test.tsx +331 -0
- package/src/components/Label/index.ts +2 -0
- package/src/components/LoadingSpinner/LoadingSpinner.tsx +98 -0
- package/src/components/LoadingSpinner/__tests__/LoadingSpinner.accessibility.test.tsx +116 -0
- package/src/components/LoadingSpinner/__tests__/LoadingSpinner.unit.test.tsx +144 -0
- package/src/components/LoadingSpinner/index.ts +3 -0
- package/src/components/LoginForm/LoginForm.tsx +273 -0
- package/src/components/LoginForm/__tests__/LoginForm.accessibility.test.tsx +201 -0
- package/src/components/LoginForm/__tests__/LoginForm.unit.test.tsx +119 -0
- package/src/components/LoginForm/index.ts +3 -0
- package/src/components/NavigationMenu/NavigationMenu.tsx +698 -0
- package/src/components/NavigationMenu/__tests__/NavigationMenu.accessibility.test.tsx +378 -0
- package/src/components/NavigationMenu/__tests__/NavigationMenu.enhanced.test.tsx +768 -0
- package/src/components/NavigationMenu/__tests__/NavigationMenu.integration.test.tsx +576 -0
- package/src/components/NavigationMenu/__tests__/NavigationMenu.performance.test.tsx +585 -0
- package/src/components/NavigationMenu/__tests__/NavigationMenu.real.component.test.tsx +783 -0
- package/src/components/NavigationMenu/__tests__/NavigationMenu.security.enhanced.test.tsx +810 -0
- package/src/components/NavigationMenu/__tests__/NavigationMenu.security.test.tsx +494 -0
- package/src/components/NavigationMenu/__tests__/NavigationMenu.unit.test.tsx +331 -0
- package/src/components/NavigationMenu/__tests__/NavigationMenu.userWorkflows.test.tsx +347 -0
- package/src/components/NavigationMenu/__tests__/NavigationMenu.workflows.test.tsx +584 -0
- package/src/components/NavigationMenu/index.ts +10 -0
- package/src/components/NavigationMenu/types.ts +85 -0
- package/src/components/OrganisationSelector/OrganisationSelector.tsx +304 -0
- package/src/components/OrganisationSelector/__tests__/OrganisationSelector.unit.test.tsx +664 -0
- package/src/components/OrganisationSelector/index.ts +9 -0
- package/src/components/PaceAppLayout/PaceAppLayout.tsx +699 -0
- package/src/components/PaceAppLayout/README.md +278 -0
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.accessibility.test.tsx +288 -0
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.integration.test.tsx +889 -0
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.performance.test.tsx +629 -0
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.security.test.tsx +782 -0
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.unit.test.tsx +904 -0
- package/src/components/PaceAppLayout/index.ts +1 -0
- package/src/components/PaceLoginPage/PaceLoginPage.tsx +221 -0
- package/src/components/PaceLoginPage/__tests__/PaceLoginPage.accessibility.test.tsx +463 -0
- package/src/components/PaceLoginPage/__tests__/PaceLoginPage.integration.test.tsx +586 -0
- package/src/components/PaceLoginPage/__tests__/PaceLoginPage.unit.test.tsx +533 -0
- package/src/components/PaceLoginPage/index.ts +1 -0
- package/src/components/PasswordReset/PasswordChangeForm.tsx +186 -0
- package/src/components/PasswordReset/PasswordResetForm.tsx +201 -0
- package/src/components/PasswordReset/__tests__/PasswordChangeForm.accessibility.test.tsx +408 -0
- package/src/components/PasswordReset/__tests__/PasswordChangeForm.unit.test.tsx +561 -0
- package/src/components/PasswordReset/__tests__/PasswordReset.integration.test.tsx +304 -0
- package/src/components/PasswordReset/__tests__/PasswordResetForm.accessibility.test.tsx +20 -0
- package/src/components/PasswordReset/__tests__/PasswordResetForm.unit.test.tsx +523 -0
- package/src/components/PasswordReset/__tests__/__mocks__/UnifiedAuthProvider.ts +29 -0
- package/src/components/PasswordReset/index.ts +4 -0
- package/src/components/Print/__tests__/Print.comprehensive.test.tsx +331 -0
- package/src/components/PrintButton/PrintButton.tsx +321 -0
- package/src/components/PrintButton/PrintButtonGroup.tsx +84 -0
- package/src/components/PrintButton/PrintToolbar.tsx +94 -0
- package/src/components/PrintButton/__tests__/PrintButton.unit.test.tsx +429 -0
- package/src/components/PrintButton/__tests__/PrintButtonGroup.unit.test.tsx +277 -0
- package/src/components/PrintButton/__tests__/PrintToolbar.unit.test.tsx +264 -0
- package/src/components/PrintButton/examples/PrintButtonShowcase.tsx +438 -0
- package/src/components/PrintButton/index.ts +33 -0
- package/src/components/PrintButton/types.ts +173 -0
- package/src/components/PrintCard/PrintCard.tsx +154 -0
- package/src/components/PrintCard/PrintCardContent.tsx +57 -0
- package/src/components/PrintCard/PrintCardFooter.tsx +60 -0
- package/src/components/PrintCard/PrintCardGrid.tsx +91 -0
- package/src/components/PrintCard/PrintCardHeader.tsx +78 -0
- package/src/components/PrintCard/PrintCardImage.tsx +81 -0
- package/src/components/PrintCard/__tests__/PrintCard.unit.test.tsx +233 -0
- package/src/components/PrintCard/__tests__/PrintCardContent.test.tsx +284 -0
- package/src/components/PrintCard/__tests__/PrintCardGrid.unit.test.tsx +214 -0
- package/src/components/PrintCard/__tests__/PrintCardImage.unit.test.tsx +264 -0
- package/src/components/PrintCard/examples/PrintCardShowcase.tsx +239 -0
- package/src/components/PrintCard/index.ts +34 -0
- package/src/components/PrintCard/types.ts +171 -0
- package/src/components/PrintDataTable/PrintDataTable.tsx +215 -0
- package/src/components/PrintDataTable/PrintTableGroup.tsx +90 -0
- package/src/components/PrintDataTable/PrintTableRow.tsx +76 -0
- package/src/components/PrintDataTable/__tests__/PrintDataTable.unit.test.tsx +361 -0
- package/src/components/PrintDataTable/__tests__/PrintTableGroup.unit.test.tsx +314 -0
- package/src/components/PrintDataTable/__tests__/PrintTableRow.unit.test.tsx +362 -0
- package/src/components/PrintDataTable/index.ts +25 -0
- package/src/components/PrintDataTable/types.ts +67 -0
- package/src/components/PrintFooter/PrintFooter.tsx +183 -0
- package/src/components/PrintFooter/PrintFooterContent.tsx +71 -0
- package/src/components/PrintFooter/PrintFooterInfo.tsx +86 -0
- package/src/components/PrintFooter/PrintPageNumber.tsx +90 -0
- package/src/components/PrintFooter/__tests__/PrintFooter.unit.test.tsx +500 -0
- package/src/components/PrintFooter/__tests__/PrintFooterContent.unit.test.tsx +321 -0
- package/src/components/PrintFooter/__tests__/PrintFooterInfo.unit.test.tsx +335 -0
- package/src/components/PrintFooter/__tests__/PrintPageNumber.unit.test.tsx +340 -0
- package/src/components/PrintFooter/examples/PrintFooterShowcase.tsx +390 -0
- package/src/components/PrintFooter/index.ts +30 -0
- package/src/components/PrintFooter/types.ts +149 -0
- package/src/components/PrintGrid/PrintGrid.tsx +180 -0
- package/src/components/PrintGrid/PrintGridBreakpoint.tsx +109 -0
- package/src/components/PrintGrid/PrintGridContainer.tsx +128 -0
- package/src/components/PrintGrid/PrintGridItem.tsx +220 -0
- package/src/components/PrintGrid/__tests__/PrintGrid.unit.test.tsx +340 -0
- package/src/components/PrintGrid/__tests__/PrintGridBreakpoint.unit.test.tsx +261 -0
- package/src/components/PrintGrid/__tests__/PrintGridContainer.unit.test.tsx +338 -0
- package/src/components/PrintGrid/__tests__/PrintGridItem.unit.test.tsx +338 -0
- package/src/components/PrintGrid/examples/PrintGridShowcase.tsx +359 -0
- package/src/components/PrintGrid/index.ts +31 -0
- package/src/components/PrintGrid/types.ts +159 -0
- package/src/components/PrintHeader/PrintCoverHeader.tsx +230 -0
- package/src/components/PrintHeader/PrintHeader.tsx +150 -0
- package/src/components/PrintHeader/__tests__/PrintCoverHeader.unit.test.tsx +309 -0
- package/src/components/PrintHeader/__tests__/PrintHeader.unit.test.tsx +202 -0
- package/src/components/PrintHeader/index.ts +17 -0
- package/src/components/PrintHeader/types.ts +42 -0
- package/src/components/PrintLayout/PrintLayout.tsx +122 -0
- package/src/components/PrintLayout/PrintLayoutContext.tsx +66 -0
- package/src/components/PrintLayout/PrintPageBreak.tsx +52 -0
- package/src/components/PrintLayout/__tests__/PrintLayout.unit.test.tsx +238 -0
- package/src/components/PrintLayout/examples/PrintShowcase.tsx +230 -0
- package/src/components/PrintLayout/index.ts +19 -0
- package/src/components/PrintLayout/types.ts +37 -0
- package/src/components/PrintPageBreak/PrintPageBreak.tsx +120 -0
- package/src/components/PrintPageBreak/PrintPageBreakGroup.tsx +90 -0
- package/src/components/PrintPageBreak/PrintPageBreakIndicator.tsx +112 -0
- package/src/components/PrintPageBreak/__tests__/PrintPageBreak.unit.test.tsx +263 -0
- package/src/components/PrintPageBreak/__tests__/PrintPageBreakGroup.unit.test.tsx +239 -0
- package/src/components/PrintPageBreak/__tests__/PrintPageBreakIndicator.unit.test.tsx +235 -0
- package/src/components/PrintPageBreak/examples/PrintPageBreakShowcase.tsx +279 -0
- package/src/components/PrintPageBreak/index.ts +23 -0
- package/src/components/PrintPageBreak/types.ts +94 -0
- package/src/components/PrintSection/PrintColumn.tsx +104 -0
- package/src/components/PrintSection/PrintDivider.tsx +101 -0
- package/src/components/PrintSection/PrintSection.tsx +129 -0
- package/src/components/PrintSection/PrintSectionContent.tsx +75 -0
- package/src/components/PrintSection/PrintSectionHeader.tsx +97 -0
- package/src/components/PrintSection/__tests__/PrintColumn.unit.test.tsx +385 -0
- package/src/components/PrintSection/__tests__/PrintDivider.unit.test.tsx +373 -0
- package/src/components/PrintSection/__tests__/PrintSection.unit.test.tsx +390 -0
- package/src/components/PrintSection/__tests__/PrintSectionContent.unit.test.tsx +321 -0
- package/src/components/PrintSection/__tests__/PrintSectionHeader.unit.test.tsx +334 -0
- package/src/components/PrintSection/examples/PrintSectionShowcase.tsx +258 -0
- package/src/components/PrintSection/index.ts +33 -0
- package/src/components/PrintSection/types.ts +155 -0
- package/src/components/PrintText/PrintText.tsx +116 -0
- package/src/components/PrintText/__tests__/PrintText.unit.test.tsx +351 -0
- package/src/components/PrintText/index.ts +16 -0
- package/src/components/PrintText/types.ts +24 -0
- package/src/components/Progress/Progress.tsx +116 -0
- package/src/components/Progress/__tests__/Progress.accessibility.test.tsx +240 -0
- package/src/components/Progress/__tests__/Progress.unit.test.tsx +242 -0
- package/src/components/Progress/index.ts +3 -0
- package/src/components/PublicLayout/EventLogo.tsx +287 -0
- package/src/components/PublicLayout/PublicErrorBoundary.tsx +279 -0
- package/src/components/PublicLayout/PublicLoadingSpinner.tsx +208 -0
- package/src/components/PublicLayout/PublicPageContextChecker.tsx +130 -0
- package/src/components/PublicLayout/PublicPageDebugger.tsx +104 -0
- package/src/components/PublicLayout/PublicPageDiagnostic.tsx +162 -0
- package/src/components/PublicLayout/PublicPageFooter.tsx +124 -0
- package/src/components/PublicLayout/PublicPageHeader.tsx +178 -0
- package/src/components/PublicLayout/PublicPageLayout.tsx +232 -0
- package/src/components/PublicLayout/PublicPageProvider.tsx +137 -0
- package/src/components/PublicLayout/__tests__/EventLogo.test.tsx +761 -0
- package/src/components/PublicLayout/__tests__/PublicErrorBoundary.simplified.test.tsx +228 -0
- package/src/components/PublicLayout/__tests__/PublicErrorBoundary.test.tsx +228 -0
- package/src/components/PublicLayout/__tests__/PublicLoadingSpinner.test.tsx +459 -0
- package/src/components/PublicLayout/__tests__/PublicPageFooter.test.tsx +362 -0
- package/src/components/PublicLayout/__tests__/PublicPageHeader.test.tsx +522 -0
- package/src/components/PublicLayout/__tests__/PublicPageLayout.test.tsx +599 -0
- package/src/components/PublicLayout/__tests__/PublicPageProvider.test.tsx +513 -0
- package/src/components/PublicLayout/index.ts +51 -0
- package/src/components/RBAC/PagePermissionGuard.tsx +274 -0
- package/src/components/RBAC/RBACGuard.tsx +143 -0
- package/src/components/RBAC/RBACProvider.tsx +186 -0
- package/src/components/RBAC/RoleBasedContent.tsx +129 -0
- package/src/components/RBAC/__tests__/PagePermissionGuard.unit.test.tsx +674 -0
- package/src/components/RBAC/__tests__/RBAC.integration.test.tsx +573 -0
- package/src/components/RBAC/__tests__/RBACGuard.unit.test.tsx +467 -0
- package/src/components/RBAC/__tests__/RBACProvider.accessibility.test.tsx +475 -0
- package/src/components/RBAC/__tests__/RBACProvider.advanced.test.tsx +569 -0
- package/src/components/RBAC/__tests__/RBACProvider.integration.test.tsx +352 -0
- package/src/components/RBAC/__tests__/RBACProvider.unit.test.tsx +128 -0
- package/src/components/RBAC/__tests__/RoleBasedContent.unit.test.tsx +657 -0
- package/src/components/RBAC/index.ts +23 -0
- package/src/components/Select/Select.tsx +654 -0
- package/src/components/Select/__tests__/SearchableSelect.unit.test.tsx +437 -0
- package/src/components/Select/__tests__/Select.accessibility.test.tsx +1202 -0
- package/src/components/Select/__tests__/Select.actual.test.tsx +774 -0
- package/src/components/Select/__tests__/Select.comprehensive.test.tsx +837 -0
- package/src/components/Select/__tests__/Select.enhanced.test.tsx +1101 -0
- package/src/components/Select/__tests__/Select.integration.test.tsx +772 -0
- package/src/components/Select/__tests__/Select.performance.test.tsx +695 -0
- package/src/components/Select/__tests__/Select.real-world.test.tsx +1046 -0
- package/src/components/Select/__tests__/Select.search-algorithms.test.tsx +968 -0
- package/src/components/Select/__tests__/Select.unit.test.tsx +647 -0
- package/src/components/Select/__tests__/Select.utils.test.tsx +890 -0
- package/src/components/Select/index.ts +1 -0
- package/src/components/SuperAdminGuard.tsx +116 -0
- package/src/components/Table/Table.tsx +222 -0
- package/src/components/Table/__tests__/Table.accessibility.test.tsx +233 -0
- package/src/components/Table/__tests__/Table.unit.test.tsx +235 -0
- package/src/components/Table/index.ts +11 -0
- package/src/components/Toast/Toast.tsx +339 -0
- package/src/components/Toast/__tests__/Toast.accessibility.test.tsx +238 -0
- package/src/components/Toast/__tests__/Toast.integration.test.tsx +699 -0
- package/src/components/Toast/__tests__/Toast.unit.test.tsx +750 -0
- package/src/components/Toast/index.ts +14 -0
- package/src/components/Tooltip/Tooltip.tsx +167 -0
- package/src/components/Tooltip/__tests__/Tooltip.accessibility.test.tsx +121 -0
- package/src/components/Tooltip/__tests__/Tooltip.unit.test.tsx +185 -0
- package/src/components/Tooltip/index.ts +7 -0
- package/src/components/UserMenu/UserMenu.tsx +243 -0
- package/src/components/UserMenu/__tests__/UserMenu.accessibility.test.tsx +139 -0
- package/src/components/UserMenu/__tests__/UserMenu.integration.test.tsx +188 -0
- package/src/components/UserMenu/__tests__/UserMenu.unit.test.tsx +458 -0
- package/src/components/UserMenu/index.ts +3 -0
- package/src/components/__tests__/EdgeCaseTesting.enhanced.test.tsx +523 -0
- package/src/components/__tests__/ErrorTesting.enhanced.test.tsx +455 -0
- package/src/components/__tests__/SuperAdminGuard.test.tsx +456 -0
- package/src/components/__tests__/SuperAdminGuard.unit.test.tsx +456 -0
- package/src/components/examples/PermissionExample.tsx +150 -0
- package/src/components/examples/__tests__/PermissionExample.unit.test.tsx +360 -0
- package/src/components/index.ts +434 -0
- package/src/components.ts +19 -0
- package/src/constants/performance.ts +14 -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/fonts/georama-italic.woff2 +0 -0
- package/src/fonts/georama.woff2 +0 -0
- package/src/fonts/open-sans-italic.woff2 +0 -0
- package/src/fonts/open-sans.woff2 +0 -0
- package/src/fonts/reddit-mono.woff2 +0 -0
- package/src/hooks/__tests__/hooks.integration.test.tsx +575 -0
- package/src/hooks/__tests__/useApiFetch.unit.test.ts +115 -0
- package/src/hooks/__tests__/useComponentPerformance.unit.test.tsx +133 -0
- package/src/hooks/__tests__/useDebounce.unit.test.ts +82 -0
- package/src/hooks/__tests__/useFocusTrap.unit.test.tsx +293 -0
- package/src/hooks/__tests__/useInactivityTracker.unit.test.ts +385 -0
- package/src/hooks/__tests__/useOrganisationPermissions.unit.test.tsx +286 -0
- package/src/hooks/__tests__/useOrganisationSecurity.unit.test.tsx +838 -0
- package/src/hooks/__tests__/usePermissionCache.unit.test.ts +627 -0
- package/src/hooks/__tests__/useRBAC.unit.test.ts +903 -0
- package/src/hooks/__tests__/useSecureDataAccess.unit.test.tsx +537 -0
- package/src/hooks/__tests__/useToast.unit.test.tsx +62 -0
- package/src/hooks/__tests__/useZodForm.unit.test.tsx +37 -0
- package/src/hooks/index.ts +56 -0
- package/src/hooks/public/__tests__/usePublicEvent.test.tsx +397 -0
- package/src/hooks/public/__tests__/usePublicEventLogo.test.tsx +690 -0
- package/src/hooks/public/__tests__/usePublicRouteParams.test.tsx +449 -0
- package/src/hooks/public/index.ts +34 -0
- package/src/hooks/public/usePublicEvent.ts +261 -0
- package/src/hooks/public/usePublicEventLogo.ts +285 -0
- package/src/hooks/public/usePublicRouteParams.ts +259 -0
- package/src/hooks/useAppConfig.ts +94 -0
- package/src/hooks/useComponentPerformance.ts +39 -0
- package/src/hooks/useDataTablePerformance.ts +387 -0
- package/src/hooks/useDataTableState.ts +110 -0
- package/src/hooks/useDebounce.ts +18 -0
- package/src/hooks/useFocusManagement.ts +161 -0
- package/src/hooks/useFocusTrap.ts +155 -0
- package/src/hooks/useInactivityTracker.ts +372 -0
- package/src/hooks/useIsMobile.ts +42 -0
- package/src/hooks/useKeyboardShortcuts.ts +237 -0
- package/src/hooks/useOrganisationPermissions.ts +208 -0
- package/src/hooks/useOrganisationSecurity.ts +262 -0
- package/src/hooks/usePerformanceMonitor.ts +128 -0
- package/src/hooks/usePermissionCache.ts +455 -0
- package/src/hooks/useRBAC.ts +262 -0
- package/src/hooks/useSecureDataAccess.ts +586 -0
- package/src/hooks/useStorage.ts +274 -0
- package/src/hooks/useToast.ts +242 -0
- package/src/hooks/useZodForm.ts +28 -0
- package/src/index.ts +200 -0
- package/src/providers/AuthProvider.tsx +369 -0
- package/src/providers/EventProvider.tsx +324 -0
- package/src/providers/InactivityProvider.tsx +238 -0
- package/src/providers/OrganisationProvider.tsx +588 -0
- package/src/providers/RBACProvider.tsx +622 -0
- package/src/providers/UnifiedAuthProvider.tsx +327 -0
- package/src/providers/__tests__/EventProvider.unit.test.tsx +768 -0
- package/src/providers/__tests__/OrganisationProvider.basic.test.tsx +116 -0
- package/src/providers/__tests__/OrganisationProvider.unit.test.tsx +1312 -0
- package/src/providers/__tests__/UnifiedAuthProvider.inactivity.test.tsx +601 -0
- package/src/providers/__tests__/UnifiedAuthProvider.unit.test.tsx +675 -0
- package/src/providers/__tests__/index.unit.test.ts +78 -0
- package/src/providers/index.ts +15 -0
- package/src/rbac/README.md +885 -0
- package/src/rbac/__tests__/PagePermissionGuard.test.tsx +673 -0
- package/src/rbac/__tests__/README.md +170 -0
- package/src/rbac/__tests__/RoleBasedRouter.test.tsx +709 -0
- package/src/rbac/__tests__/TestContext.tsx +72 -0
- package/src/rbac/__tests__/__mocks__/cache.ts +144 -0
- package/src/rbac/__tests__/__mocks__/supabase.ts +152 -0
- package/src/rbac/__tests__/adapters-hooks-comprehensive.test.tsx +782 -0
- package/src/rbac/__tests__/adapters-hooks.test.tsx +561 -0
- package/src/rbac/__tests__/adapters.comprehensive.test.tsx +963 -0
- package/src/rbac/__tests__/adapters.test.tsx +444 -0
- package/src/rbac/__tests__/api.test.ts +620 -0
- package/src/rbac/__tests__/audit-observability-comprehensive.test.ts +792 -0
- package/src/rbac/__tests__/audit-observability.test.ts +549 -0
- package/src/rbac/__tests__/audit.test.ts +616 -0
- package/src/rbac/__tests__/build-contract-compliance-simple.test.ts +230 -0
- package/src/rbac/__tests__/cache-invalidation-comprehensive.test.ts +889 -0
- package/src/rbac/__tests__/cache-invalidation.test.ts +457 -0
- package/src/rbac/__tests__/cache.test.ts +458 -0
- package/src/rbac/__tests__/components-navigation-guard.enhanced.test.tsx +859 -0
- package/src/rbac/__tests__/components-navigation-guard.test.tsx +895 -0
- package/src/rbac/__tests__/components-navigation-provider.test.tsx +692 -0
- package/src/rbac/__tests__/components-page-permission-guard.test.tsx +673 -0
- package/src/rbac/__tests__/components-page-permission-provider.test.tsx +614 -0
- package/src/rbac/__tests__/components-permission-enforcer.enhanced.fixed.test.tsx +836 -0
- package/src/rbac/__tests__/components-permission-enforcer.enhanced.test.tsx +837 -0
- package/src/rbac/__tests__/components-permission-enforcer.test.tsx +825 -0
- package/src/rbac/__tests__/components-role-based-router.test.tsx +709 -0
- package/src/rbac/__tests__/components-secure-data-provider.test.tsx +607 -0
- package/src/rbac/__tests__/config.test.ts +583 -0
- package/src/rbac/__tests__/core-logic-unit.test.ts +190 -0
- package/src/rbac/__tests__/core-permission-logic-comprehensive.test.ts +1467 -0
- package/src/rbac/__tests__/core-permission-logic-fixed.test.ts +151 -0
- package/src/rbac/__tests__/core-permission-logic-simple.test.ts +968 -0
- package/src/rbac/__tests__/core-permission-logic.test.ts +966 -0
- package/src/rbac/__tests__/edge-cases-comprehensive.test.ts +988 -0
- package/src/rbac/__tests__/edge-cases.test.ts +654 -0
- package/src/rbac/__tests__/engine.test.ts +361 -0
- package/src/rbac/__tests__/engine.unit.test.ts +361 -0
- package/src/rbac/__tests__/hooks.enhanced.test.tsx +979 -0
- package/src/rbac/__tests__/hooks.fixed.test.tsx +475 -0
- package/src/rbac/__tests__/hooks.test.tsx +385 -0
- package/src/rbac/__tests__/index.test.ts +269 -0
- package/src/rbac/__tests__/integration.enhanced.test.tsx +824 -0
- package/src/rbac/__tests__/page-permission-guard-super-admin.test.tsx +261 -0
- package/src/rbac/__tests__/performance.enhanced.test.tsx +724 -0
- package/src/rbac/__tests__/permissions.test.ts +383 -0
- package/src/rbac/__tests__/requires-event.test.ts +330 -0
- package/src/rbac/__tests__/scope-isolation-comprehensive.test.ts +1349 -0
- package/src/rbac/__tests__/scope-isolation.test.ts +755 -0
- package/src/rbac/__tests__/secure-client-rls-comprehensive.test.ts +592 -0
- package/src/rbac/__tests__/secure-client-rls.test.ts +377 -0
- package/src/rbac/__tests__/security.test.ts +296 -0
- package/src/rbac/__tests__/setup.ts +228 -0
- package/src/rbac/__tests__/test-utils-enhanced.tsx +400 -0
- package/src/rbac/__tests__/types.test.ts +685 -0
- package/src/rbac/adapters.tsx +726 -0
- package/src/rbac/api.ts +337 -0
- package/src/rbac/audit-enhanced.ts +339 -0
- package/src/rbac/audit.ts +338 -0
- package/src/rbac/cache.ts +213 -0
- package/src/rbac/components/EnhancedNavigationMenu.tsx +294 -0
- package/src/rbac/components/NavigationGuard.tsx +294 -0
- package/src/rbac/components/NavigationProvider.tsx +314 -0
- package/src/rbac/components/PagePermissionGuard.tsx +430 -0
- package/src/rbac/components/PagePermissionProvider.tsx +274 -0
- package/src/rbac/components/PermissionEnforcer.tsx +307 -0
- package/src/rbac/components/RoleBasedRouter.tsx +425 -0
- package/src/rbac/components/SecureDataProvider.tsx +319 -0
- package/src/rbac/components/__tests__/EnhancedNavigationMenu.test.tsx +631 -0
- package/src/rbac/components/__tests__/NavigationProvider.test.tsx +667 -0
- package/src/rbac/components/__tests__/PagePermissionProvider.test.tsx +647 -0
- package/src/rbac/components/__tests__/SecureDataProvider.test.tsx +496 -0
- package/src/rbac/components/index.ts +64 -0
- package/src/rbac/config.ts +133 -0
- package/src/rbac/docs/event-based-apps.md +285 -0
- package/src/rbac/engine.ts +1026 -0
- package/src/rbac/eslint-rules.js +285 -0
- package/src/rbac/examples/CompleteRBACExample.tsx +323 -0
- package/src/rbac/examples/EventBasedApp.tsx +238 -0
- package/src/rbac/hooks.ts +555 -0
- package/src/rbac/index.ts +114 -0
- package/src/rbac/permissions.ts +293 -0
- package/src/rbac/secureClient.ts +244 -0
- package/src/rbac/security.ts +346 -0
- package/src/rbac/testing/__tests__/index.test.tsx +342 -0
- package/src/rbac/testing/index.tsx +340 -0
- package/src/rbac/types.ts +341 -0
- package/src/rbac/utils/__tests__/eventContext.test.ts +428 -0
- package/src/rbac/utils/__tests__/eventContext.unit.test.ts +428 -0
- package/src/rbac/utils/eventContext.ts +83 -0
- package/src/styles/__tests__/styles.unit.test.ts +164 -0
- package/src/styles/core.css +401 -0
- package/src/styles/index.ts +51 -0
- package/src/test-dom-cleanup.test.tsx +38 -0
- package/src/theming/__tests__/README.md +335 -0
- package/src/theming/__tests__/runtime.accessibility.test.ts +474 -0
- package/src/theming/__tests__/runtime.error.test.ts +616 -0
- package/src/theming/__tests__/runtime.integration.test.ts +376 -0
- package/src/theming/__tests__/runtime.performance.test.ts +411 -0
- package/src/theming/__tests__/runtime.unit.test.ts +470 -0
- package/src/theming/runtime.ts +187 -0
- package/src/types/__tests__/database.unit.test.ts +489 -0
- package/src/types/__tests__/guards.unit.test.ts +146 -0
- package/src/types/__tests__/index.unit.test.ts +77 -0
- package/src/types/__tests__/organisation.unit.test.ts +713 -0
- package/src/types/__tests__/rbac.unit.test.ts +621 -0
- package/src/types/__tests__/security.unit.test.ts +347 -0
- package/src/types/__tests__/supabase.unit.test.ts +658 -0
- package/src/types/__tests__/theme.unit.test.ts +218 -0
- package/src/types/__tests__/unified.unit.test.ts +537 -0
- package/src/types/__tests__/validation.unit.test.ts +616 -0
- package/src/types/database.ts +472 -0
- package/src/types/guards.ts +30 -0
- package/src/types/index.ts +25 -0
- package/src/types/organisation.ts +184 -0
- package/src/types/security.ts +70 -0
- package/src/types/supabase.ts +166 -0
- package/src/types/theme.ts +6 -0
- package/src/types/unified.ts +262 -0
- package/src/types/validation.ts +164 -0
- package/src/types/vitest-globals.d.ts +43 -0
- package/src/utils/__mocks__/supabaseMock.ts +75 -0
- package/src/utils/__mocks__/supabaseMock.tsx +198 -0
- package/src/utils/__tests__/appConfig.unit.test.ts +55 -0
- package/src/utils/__tests__/appNameResolver.unit.test.ts +137 -0
- package/src/utils/__tests__/audit.unit.test.ts +69 -0
- package/src/utils/__tests__/auth-utils.unit.test.ts +70 -0
- package/src/utils/__tests__/bundleAnalysis.unit.test.ts +317 -0
- package/src/utils/__tests__/cn.unit.test.ts +34 -0
- package/src/utils/__tests__/deviceFingerprint.unit.test.ts +480 -0
- package/src/utils/__tests__/dynamicUtils.unit.test.ts +322 -0
- package/src/utils/__tests__/formatDate.unit.test.ts +109 -0
- package/src/utils/__tests__/formatting.unit.test.ts +66 -0
- package/src/utils/__tests__/index.unit.test.ts +251 -0
- package/src/utils/__tests__/lazyLoad.unit.test.tsx +309 -0
- package/src/utils/__tests__/organisationContext.unit.test.ts +192 -0
- package/src/utils/__tests__/performanceBudgets.unit.test.ts +259 -0
- package/src/utils/__tests__/permissionTypes.unit.test.ts +250 -0
- package/src/utils/__tests__/permissionUtils.unit.test.ts +362 -0
- package/src/utils/__tests__/sanitization.unit.test.ts +346 -0
- package/src/utils/__tests__/schemaUtils.unit.test.ts +441 -0
- package/src/utils/__tests__/secureDataAccess.unit.test.ts +334 -0
- package/src/utils/__tests__/secureErrors.unit.test.ts +377 -0
- package/src/utils/__tests__/secureStorage.unit.test.ts +293 -0
- package/src/utils/__tests__/security.unit.test.ts +127 -0
- package/src/utils/__tests__/securityMonitor.unit.test.ts +280 -0
- package/src/utils/__tests__/sessionTracking.unit.test.ts +370 -0
- package/src/utils/__tests__/validation.unit.test.ts +84 -0
- package/src/utils/__tests__/validationUtils.unit.test.ts +571 -0
- package/src/utils/appConfig.ts +47 -0
- package/src/utils/appIdResolver.ts +130 -0
- package/src/utils/appNameResolver.ts +190 -0
- package/src/utils/audit.ts +127 -0
- package/src/utils/auth-utils.ts +96 -0
- package/src/utils/bundleAnalysis.ts +129 -0
- package/src/utils/cn.ts +7 -0
- package/src/utils/debugLogger.ts +46 -0
- package/src/utils/deviceFingerprint.ts +215 -0
- package/src/utils/dynamicUtils.ts +105 -0
- package/src/utils/formatting.ts +77 -0
- package/src/utils/index.ts +145 -0
- package/src/utils/lazyLoad.tsx +44 -0
- package/src/utils/organisationContext.ts +135 -0
- package/src/utils/performanceBenchmark.ts +64 -0
- package/src/utils/performanceBudgets.ts +111 -0
- package/src/utils/permissionTypes.ts +37 -0
- package/src/utils/permissionUtils.ts +31 -0
- package/src/utils/print/PrintDataProcessor.ts +390 -0
- package/src/utils/print/__tests__/PrintDataProcessor.unit.test.ts +219 -0
- package/src/utils/print/__tests__/usePrintOptimization.unit.test.tsx +353 -0
- package/src/utils/print/examples/PrintUtilitiesShowcase.tsx +397 -0
- package/src/utils/print/index.ts +29 -0
- package/src/utils/print/types.ts +196 -0
- package/src/utils/print/usePrintOptimization.ts +272 -0
- package/src/utils/sanitization.ts +264 -0
- package/src/utils/schemaUtils.ts +37 -0
- package/src/utils/secureDataAccess.ts +361 -0
- package/src/utils/secureErrors.ts +79 -0
- package/src/utils/secureStorage.ts +244 -0
- package/src/utils/security.ts +156 -0
- package/src/utils/securityMonitor.ts +45 -0
- package/src/utils/sessionTracking.ts +170 -0
- package/src/utils/storage/README.md +348 -0
- package/src/utils/storage/__tests__/config.unit.test.ts +206 -0
- package/src/utils/storage/__tests__/helpers.unit.test.ts +646 -0
- package/src/utils/storage/__tests__/index.unit.test.ts +167 -0
- package/src/utils/storage/__tests__/types.unit.test.ts +441 -0
- package/src/utils/storage/config.ts +100 -0
- package/src/utils/storage/helpers.ts +359 -0
- package/src/utils/storage/index.ts +36 -0
- package/src/utils/storage/types.ts +90 -0
- package/src/utils/validation.ts +111 -0
- package/src/utils/validationUtils.ts +120 -0
- package/src/validation/__tests__/common.unit.test.ts +101 -0
- package/src/validation/__tests__/csrf.unit.test.ts +302 -0
- package/src/validation/__tests__/passwordSchema.unit.test.ts +98 -0
- package/src/validation/__tests__/sqlInjectionProtection.unit.test.ts +466 -0
- package/src/validation/common.ts +53 -0
- package/src/validation/csrf.ts +214 -0
- package/src/validation/index.ts +43 -0
- package/src/validation/passwordSchema.ts +125 -0
- package/src/validation/sanitization.ts +96 -0
- package/src/validation/schemaUtils.ts +42 -0
- package/src/validation/sqlInjectionProtection.ts +242 -0
- package/src/validation/user.ts +34 -0
|
@@ -0,0 +1,3759 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Avatar,
|
|
3
|
+
AvatarFallback,
|
|
4
|
+
AvatarImage,
|
|
5
|
+
Card,
|
|
6
|
+
CardActions,
|
|
7
|
+
CardContent,
|
|
8
|
+
CardDescription,
|
|
9
|
+
CardFooter,
|
|
10
|
+
CardHeader,
|
|
11
|
+
CardTitle,
|
|
12
|
+
ErrorBoundary,
|
|
13
|
+
EventLogo,
|
|
14
|
+
EventLogoCompact,
|
|
15
|
+
EventLogoLarge,
|
|
16
|
+
EventSelector,
|
|
17
|
+
FileUpload,
|
|
18
|
+
Footer,
|
|
19
|
+
Form,
|
|
20
|
+
Header,
|
|
21
|
+
Label,
|
|
22
|
+
LoginForm,
|
|
23
|
+
NavigationMenu,
|
|
24
|
+
OrganisationSelector,
|
|
25
|
+
PaceAppLayout,
|
|
26
|
+
PaceLoginPage,
|
|
27
|
+
PasswordResetForm,
|
|
28
|
+
Progress,
|
|
29
|
+
PublicLoadingSkeleton,
|
|
30
|
+
PublicLoadingSpinner,
|
|
31
|
+
PublicLoadingSpinnerFullPage,
|
|
32
|
+
PublicPageContextChecker,
|
|
33
|
+
PublicPageDebugger,
|
|
34
|
+
PublicPageDiagnostic,
|
|
35
|
+
PublicPageFooter,
|
|
36
|
+
PublicPageHeader,
|
|
37
|
+
PublicPageLayout,
|
|
38
|
+
Toast,
|
|
39
|
+
ToastAction,
|
|
40
|
+
ToastClose,
|
|
41
|
+
ToastDescription,
|
|
42
|
+
ToastProvider,
|
|
43
|
+
ToastTitle,
|
|
44
|
+
ToastViewport,
|
|
45
|
+
Toaster,
|
|
46
|
+
UserMenu,
|
|
47
|
+
useFileUpload,
|
|
48
|
+
usePublicPageContext as usePublicPageContext2,
|
|
49
|
+
useStorage,
|
|
50
|
+
useToast
|
|
51
|
+
} from "./chunk-7JL3T7BO.js";
|
|
52
|
+
import {
|
|
53
|
+
Alert,
|
|
54
|
+
AlertDescription,
|
|
55
|
+
AlertTitle,
|
|
56
|
+
Checkbox,
|
|
57
|
+
DataTable,
|
|
58
|
+
Input,
|
|
59
|
+
Select,
|
|
60
|
+
SelectContent,
|
|
61
|
+
SelectGroup,
|
|
62
|
+
SelectItem,
|
|
63
|
+
SelectLabel,
|
|
64
|
+
SelectSeparator,
|
|
65
|
+
SelectTrigger,
|
|
66
|
+
SelectValue,
|
|
67
|
+
Table,
|
|
68
|
+
TableBody,
|
|
69
|
+
TableCaption,
|
|
70
|
+
TableCell,
|
|
71
|
+
TableFooter,
|
|
72
|
+
TableHead,
|
|
73
|
+
TableHeader,
|
|
74
|
+
TableRow
|
|
75
|
+
} from "./chunk-WYB6MBZA.js";
|
|
76
|
+
import "./chunk-6ZQVSHKL.js";
|
|
77
|
+
import "./chunk-7BNPOCLL.js";
|
|
78
|
+
import {
|
|
79
|
+
init_EventProvider,
|
|
80
|
+
useEvents
|
|
81
|
+
} from "./chunk-TMRLB2LA.js";
|
|
82
|
+
import {
|
|
83
|
+
DefaultPublicErrorFallback,
|
|
84
|
+
PublicErrorBoundary,
|
|
85
|
+
PublicPageProvider,
|
|
86
|
+
useErrorBoundary,
|
|
87
|
+
useIsPublicPage,
|
|
88
|
+
usePublicPageContext
|
|
89
|
+
} from "./chunk-2MKP6IYD.js";
|
|
90
|
+
import "./chunk-SS3E6QLB.js";
|
|
91
|
+
import {
|
|
92
|
+
UnifiedAuthProvider,
|
|
93
|
+
init_OrganisationProvider,
|
|
94
|
+
init_UnifiedAuthProvider,
|
|
95
|
+
useOrganisations,
|
|
96
|
+
useUnifiedAuth
|
|
97
|
+
} from "./chunk-DY5E3AT7.js";
|
|
98
|
+
import {
|
|
99
|
+
Button,
|
|
100
|
+
Dialog,
|
|
101
|
+
DialogBody,
|
|
102
|
+
DialogClose,
|
|
103
|
+
DialogContent,
|
|
104
|
+
DialogDescription,
|
|
105
|
+
DialogFooter,
|
|
106
|
+
DialogHeader,
|
|
107
|
+
DialogOverlay,
|
|
108
|
+
DialogPortal,
|
|
109
|
+
DialogTitle,
|
|
110
|
+
DialogTrigger,
|
|
111
|
+
Tooltip,
|
|
112
|
+
TooltipContent,
|
|
113
|
+
TooltipProvider,
|
|
114
|
+
TooltipRoot,
|
|
115
|
+
TooltipTrigger,
|
|
116
|
+
init_Dialog,
|
|
117
|
+
init_Tooltip2 as init_Tooltip
|
|
118
|
+
} from "./chunk-ETEJVKYK.js";
|
|
119
|
+
import "./chunk-YDJW5XTN.js";
|
|
120
|
+
import {
|
|
121
|
+
LoadingSpinner
|
|
122
|
+
} from "./chunk-CDQ3PX7L.js";
|
|
123
|
+
import "./chunk-74C6SNEC.js";
|
|
124
|
+
import "./chunk-2V3Y6YBC.js";
|
|
125
|
+
import {
|
|
126
|
+
cn,
|
|
127
|
+
init_cn
|
|
128
|
+
} from "./chunk-OHXGNT3K.js";
|
|
129
|
+
import "./chunk-PLDDJCW6.js";
|
|
130
|
+
|
|
131
|
+
// src/components/index.ts
|
|
132
|
+
init_UnifiedAuthProvider();
|
|
133
|
+
init_Dialog();
|
|
134
|
+
init_Tooltip();
|
|
135
|
+
|
|
136
|
+
// src/components/Form/FormField.tsx
|
|
137
|
+
init_cn();
|
|
138
|
+
import { useFormContext, Controller } from "react-hook-form";
|
|
139
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
140
|
+
function FormField({
|
|
141
|
+
name,
|
|
142
|
+
label,
|
|
143
|
+
type = "text",
|
|
144
|
+
placeholder,
|
|
145
|
+
inputProps,
|
|
146
|
+
validation,
|
|
147
|
+
render,
|
|
148
|
+
"data-testid": testId,
|
|
149
|
+
className
|
|
150
|
+
}) {
|
|
151
|
+
const { control, formState: { errors } } = useFormContext();
|
|
152
|
+
const fieldError = errors[name];
|
|
153
|
+
const errorMessage = fieldError && typeof fieldError === "object" && "message" in fieldError ? String(fieldError.message) : void 0;
|
|
154
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("space-y-2", className), children: [
|
|
155
|
+
label && /* @__PURE__ */ jsxs(Label, { htmlFor: name, children: [
|
|
156
|
+
label,
|
|
157
|
+
validation?.required && /* @__PURE__ */ jsx("span", { className: "text-destructive ml-1", "aria-label": "required", children: "*" })
|
|
158
|
+
] }),
|
|
159
|
+
/* @__PURE__ */ jsx(
|
|
160
|
+
Controller,
|
|
161
|
+
{
|
|
162
|
+
name,
|
|
163
|
+
control,
|
|
164
|
+
rules: validation,
|
|
165
|
+
render: ({ field }) => {
|
|
166
|
+
if (render) {
|
|
167
|
+
return render({ field });
|
|
168
|
+
}
|
|
169
|
+
return /* @__PURE__ */ jsx(
|
|
170
|
+
"input",
|
|
171
|
+
{
|
|
172
|
+
...field,
|
|
173
|
+
id: name,
|
|
174
|
+
type,
|
|
175
|
+
placeholder,
|
|
176
|
+
"data-testid": testId,
|
|
177
|
+
className: cn(
|
|
178
|
+
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
179
|
+
fieldError && "border-destructive focus-visible:ring-destructive"
|
|
180
|
+
),
|
|
181
|
+
...inputProps
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
),
|
|
187
|
+
errorMessage && /* @__PURE__ */ jsx("p", { className: "text-destructive", role: "alert", children: errorMessage })
|
|
188
|
+
] });
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// src/components/Form/FormErrorSummary.tsx
|
|
192
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
193
|
+
function FormErrorSummary({
|
|
194
|
+
errors = {},
|
|
195
|
+
title = "Please fix the following errors:",
|
|
196
|
+
showFieldNames = false
|
|
197
|
+
}) {
|
|
198
|
+
const errorEntries = Object.entries(errors).filter(([, value]) => Boolean(value));
|
|
199
|
+
if (errorEntries.length === 0) {
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
return /* @__PURE__ */ jsx2(Alert, { variant: "destructive", className: "mb-4", children: /* @__PURE__ */ jsxs2("div", { children: [
|
|
203
|
+
/* @__PURE__ */ jsx2("h3", { children: title }),
|
|
204
|
+
/* @__PURE__ */ jsx2("ul", { className: "list-disc list-inside space-y-1", children: errorEntries.map(([field, error], index) => {
|
|
205
|
+
const message = typeof error === "object" && error.message ? error.message : String(error);
|
|
206
|
+
return /* @__PURE__ */ jsx2("li", { className: "text-sm", children: showFieldNames ? `${field}: ${message}` : message }, index);
|
|
207
|
+
}) })
|
|
208
|
+
] }) });
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// src/components/Form/FormLiveRegion.tsx
|
|
212
|
+
init_cn();
|
|
213
|
+
import { useEffect, useState } from "react";
|
|
214
|
+
import { Fragment, jsx as jsx3 } from "react/jsx-runtime";
|
|
215
|
+
function FormLiveRegion({
|
|
216
|
+
form,
|
|
217
|
+
politeness = "polite",
|
|
218
|
+
delay = 500,
|
|
219
|
+
successMessage = "Form submitted successfully",
|
|
220
|
+
className,
|
|
221
|
+
enableFieldAnnouncements = true
|
|
222
|
+
}) {
|
|
223
|
+
const [message, setMessage] = useState("");
|
|
224
|
+
const { formState } = form;
|
|
225
|
+
useEffect(() => {
|
|
226
|
+
let timeoutId;
|
|
227
|
+
if (formState.isSubmitting) {
|
|
228
|
+
setMessage("Submitting form...");
|
|
229
|
+
} else if (formState.isSubmitSuccessful) {
|
|
230
|
+
timeoutId = setTimeout(() => {
|
|
231
|
+
setMessage(successMessage);
|
|
232
|
+
}, delay);
|
|
233
|
+
} else if (formState.errors && Object.keys(formState.errors).length > 0) {
|
|
234
|
+
const errorCount = Object.keys(formState.errors).length;
|
|
235
|
+
const errorFields = Object.keys(formState.errors).join(", ");
|
|
236
|
+
setMessage(`Form has ${errorCount} error${errorCount === 1 ? "" : "s"} in: ${errorFields}`);
|
|
237
|
+
} else if (formState.isValid && formState.isDirty) {
|
|
238
|
+
setMessage("Form is valid");
|
|
239
|
+
} else {
|
|
240
|
+
setMessage("");
|
|
241
|
+
}
|
|
242
|
+
return () => {
|
|
243
|
+
if (timeoutId) {
|
|
244
|
+
clearTimeout(timeoutId);
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
}, [formState, delay, successMessage]);
|
|
248
|
+
useEffect(() => {
|
|
249
|
+
if (!enableFieldAnnouncements) return;
|
|
250
|
+
let timeoutId;
|
|
251
|
+
const fieldErrors = formState.errors;
|
|
252
|
+
const touchedFields = formState.touchedFields;
|
|
253
|
+
const newErrors = Object.keys(fieldErrors).filter((field) => {
|
|
254
|
+
const touchedField = touchedFields;
|
|
255
|
+
return touchedField[field] && fieldErrors[field];
|
|
256
|
+
});
|
|
257
|
+
if (newErrors.length > 0) {
|
|
258
|
+
timeoutId = setTimeout(() => {
|
|
259
|
+
const errorField = newErrors[0];
|
|
260
|
+
const errorData = fieldErrors[errorField];
|
|
261
|
+
const errorMessage = errorData?.message;
|
|
262
|
+
if (errorMessage) {
|
|
263
|
+
setMessage(`${errorField}: ${errorMessage}`);
|
|
264
|
+
}
|
|
265
|
+
}, delay);
|
|
266
|
+
}
|
|
267
|
+
return () => {
|
|
268
|
+
if (timeoutId) {
|
|
269
|
+
clearTimeout(timeoutId);
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
}, [formState.errors, formState.touchedFields, enableFieldAnnouncements, delay]);
|
|
273
|
+
if (!message) {
|
|
274
|
+
return /* @__PURE__ */ jsx3(Fragment, {});
|
|
275
|
+
}
|
|
276
|
+
return /* @__PURE__ */ jsx3(
|
|
277
|
+
"div",
|
|
278
|
+
{
|
|
279
|
+
role: "status",
|
|
280
|
+
"aria-live": politeness,
|
|
281
|
+
"aria-atomic": "true",
|
|
282
|
+
className: cn("sr-only", className),
|
|
283
|
+
style: {
|
|
284
|
+
position: "absolute",
|
|
285
|
+
left: "-10000px",
|
|
286
|
+
width: "1px",
|
|
287
|
+
height: "1px",
|
|
288
|
+
overflow: "hidden"
|
|
289
|
+
},
|
|
290
|
+
children: message
|
|
291
|
+
}
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// src/components/Form/FormFieldset.tsx
|
|
296
|
+
init_cn();
|
|
297
|
+
import React2 from "react";
|
|
298
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
299
|
+
var FormFieldset = React2.forwardRef(
|
|
300
|
+
({ legend, description, required, className, children, ...props }, ref) => {
|
|
301
|
+
const descriptionId = React2.useId();
|
|
302
|
+
return /* @__PURE__ */ jsxs3(
|
|
303
|
+
"fieldset",
|
|
304
|
+
{
|
|
305
|
+
ref,
|
|
306
|
+
className: cn("space-y-4 border border-input rounded-lg p-4", className),
|
|
307
|
+
"aria-describedby": description ? descriptionId : void 0,
|
|
308
|
+
...props,
|
|
309
|
+
children: [
|
|
310
|
+
/* @__PURE__ */ jsxs3("legend", { className: "px-2", children: [
|
|
311
|
+
legend,
|
|
312
|
+
required && /* @__PURE__ */ jsx4("span", { className: "text-destructive ml-1", children: "*" })
|
|
313
|
+
] }),
|
|
314
|
+
description && /* @__PURE__ */ jsx4("p", { id: descriptionId, className: "text-muted-foreground", children: description }),
|
|
315
|
+
children
|
|
316
|
+
]
|
|
317
|
+
}
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
);
|
|
321
|
+
FormFieldset.displayName = "FormFieldset";
|
|
322
|
+
|
|
323
|
+
// src/hooks/useRBAC.ts
|
|
324
|
+
init_UnifiedAuthProvider();
|
|
325
|
+
init_OrganisationProvider();
|
|
326
|
+
init_EventProvider();
|
|
327
|
+
import { useState as useState2, useEffect as useEffect2, useCallback, useMemo } from "react";
|
|
328
|
+
function useRBAC(pageId) {
|
|
329
|
+
const { user, session, supabase, appName } = useUnifiedAuth();
|
|
330
|
+
const { selectedOrganisation } = useOrganisations();
|
|
331
|
+
let selectedEvent = null;
|
|
332
|
+
try {
|
|
333
|
+
const eventsContext = useEvents();
|
|
334
|
+
selectedEvent = eventsContext.selectedEvent;
|
|
335
|
+
} catch (error2) {
|
|
336
|
+
console.debug("useRBAC: EventProvider not available, continuing without event context");
|
|
337
|
+
}
|
|
338
|
+
const [globalRole, setGlobalRole] = useState2(null);
|
|
339
|
+
const [organisationRole, setOrganisationRole] = useState2(null);
|
|
340
|
+
const [eventAppRole, setEventAppRole] = useState2(null);
|
|
341
|
+
const [permissions, setPermissions] = useState2([]);
|
|
342
|
+
const [isLoading, setIsLoading] = useState2(false);
|
|
343
|
+
const [error, setError] = useState2(null);
|
|
344
|
+
const loadRBACContext = useCallback(async () => {
|
|
345
|
+
if (!user || !session || !supabase || !appName) {
|
|
346
|
+
console.log("[useRBAC] Missing required dependencies, clearing RBAC state");
|
|
347
|
+
setGlobalRole(null);
|
|
348
|
+
setOrganisationRole(null);
|
|
349
|
+
setEventAppRole(null);
|
|
350
|
+
setPermissions([]);
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
setIsLoading(true);
|
|
354
|
+
setError(null);
|
|
355
|
+
try {
|
|
356
|
+
const { data: appData, error: appError } = await supabase.from("rbac_apps").select("id").eq("name", appName).eq("is_active", true).single();
|
|
357
|
+
if (appError || !appData) {
|
|
358
|
+
console.warn("App not found or inactive:", appName);
|
|
359
|
+
setIsLoading(false);
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
const { data, error: rpcError } = await supabase.rpc("get_rbac_permissions", {
|
|
363
|
+
p_user_id: user.id,
|
|
364
|
+
p_app_id: appData.id,
|
|
365
|
+
p_event_id: selectedEvent?.event_id || null,
|
|
366
|
+
p_organisation_id: selectedOrganisation?.id || null,
|
|
367
|
+
p_page_id: pageId || null
|
|
368
|
+
});
|
|
369
|
+
if (rpcError) {
|
|
370
|
+
throw new Error(`Failed to load RBAC permissions: ${rpcError.message}`);
|
|
371
|
+
}
|
|
372
|
+
if (data) {
|
|
373
|
+
const globalPerms = data.filter((p) => p.permission_type === "all_permissions");
|
|
374
|
+
const orgPerms = data.filter((p) => p.permission_type === "organisation_access");
|
|
375
|
+
const eventPerms = data.filter((p) => p.permission_type === "event_app_access");
|
|
376
|
+
setGlobalRole(globalPerms.length > 0 ? "super_admin" : null);
|
|
377
|
+
setOrganisationRole(orgPerms.length > 0 ? orgPerms[0].role_name : null);
|
|
378
|
+
setEventAppRole(eventPerms.length > 0 ? eventPerms[0].role_name : null);
|
|
379
|
+
setPermissions(data);
|
|
380
|
+
} else {
|
|
381
|
+
setPermissions([]);
|
|
382
|
+
}
|
|
383
|
+
} catch (err) {
|
|
384
|
+
console.error("RBAC Context Loading Error:", err);
|
|
385
|
+
setError(err instanceof Error ? err : new Error("Unknown error loading RBAC context"));
|
|
386
|
+
setPermissions([]);
|
|
387
|
+
} finally {
|
|
388
|
+
setIsLoading(false);
|
|
389
|
+
}
|
|
390
|
+
}, [user?.id, session, supabase, appName, selectedEvent?.event_id, selectedOrganisation?.id, pageId]);
|
|
391
|
+
const hasPermission = useCallback(async (operation, targetPageId) => {
|
|
392
|
+
if (!user || !session || !supabase || !appName) return false;
|
|
393
|
+
if (globalRole === "super_admin") {
|
|
394
|
+
return true;
|
|
395
|
+
}
|
|
396
|
+
try {
|
|
397
|
+
const { data: appData, error: appError } = await supabase.from("rbac_apps").select("id").eq("name", appName).eq("is_active", true).single();
|
|
398
|
+
if (appError || !appData) {
|
|
399
|
+
console.warn("App not found or inactive:", appName);
|
|
400
|
+
return false;
|
|
401
|
+
}
|
|
402
|
+
const { data, error: error2 } = await supabase.rpc("check_page_permission", {
|
|
403
|
+
p_user_id: user.id,
|
|
404
|
+
p_app_id: appData.id,
|
|
405
|
+
p_page_id: targetPageId || pageId || "default",
|
|
406
|
+
p_operation: operation,
|
|
407
|
+
p_event_id: selectedEvent?.event_id,
|
|
408
|
+
p_organisation_id: selectedOrganisation?.id
|
|
409
|
+
});
|
|
410
|
+
if (error2) {
|
|
411
|
+
console.error("Permission check failed:", error2);
|
|
412
|
+
return false;
|
|
413
|
+
}
|
|
414
|
+
return data === true;
|
|
415
|
+
} catch (err) {
|
|
416
|
+
console.error("Permission check error:", err);
|
|
417
|
+
return false;
|
|
418
|
+
}
|
|
419
|
+
}, [user, supabase, appName, selectedEvent, selectedOrganisation, pageId, globalRole]);
|
|
420
|
+
const hasGlobalPermission = useCallback((permission) => {
|
|
421
|
+
if (globalRole === "super_admin") {
|
|
422
|
+
return true;
|
|
423
|
+
}
|
|
424
|
+
if (permission === "super_admin") {
|
|
425
|
+
return globalRole === "super_admin";
|
|
426
|
+
}
|
|
427
|
+
if (permission === "org_admin") {
|
|
428
|
+
return organisationRole === "org_admin" || globalRole === "super_admin";
|
|
429
|
+
}
|
|
430
|
+
return false;
|
|
431
|
+
}, [globalRole, organisationRole]);
|
|
432
|
+
const isSuperAdmin = useMemo(() => globalRole === "super_admin", [globalRole]);
|
|
433
|
+
const isOrgAdmin = useMemo(() => organisationRole === "org_admin", [organisationRole]);
|
|
434
|
+
const isEventAdmin = useMemo(() => eventAppRole === "event_admin", [eventAppRole]);
|
|
435
|
+
const canManageOrganisation = useMemo(
|
|
436
|
+
() => isSuperAdmin || isOrgAdmin,
|
|
437
|
+
[isSuperAdmin, isOrgAdmin]
|
|
438
|
+
);
|
|
439
|
+
const canManageEvent = useMemo(
|
|
440
|
+
() => isSuperAdmin || isEventAdmin,
|
|
441
|
+
[isSuperAdmin, isEventAdmin]
|
|
442
|
+
);
|
|
443
|
+
useEffect2(() => {
|
|
444
|
+
loadRBACContext();
|
|
445
|
+
}, [loadRBACContext]);
|
|
446
|
+
return {
|
|
447
|
+
user,
|
|
448
|
+
// Add user to the returned context
|
|
449
|
+
globalRole,
|
|
450
|
+
organisationRole,
|
|
451
|
+
eventAppRole,
|
|
452
|
+
hasPermission,
|
|
453
|
+
hasGlobalPermission,
|
|
454
|
+
isSuperAdmin,
|
|
455
|
+
isOrgAdmin,
|
|
456
|
+
isEventAdmin,
|
|
457
|
+
canManageOrganisation,
|
|
458
|
+
canManageEvent,
|
|
459
|
+
isLoading,
|
|
460
|
+
error
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
// src/components/SuperAdminGuard.tsx
|
|
465
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
466
|
+
function SuperAdminGuard({
|
|
467
|
+
children,
|
|
468
|
+
fallback = null,
|
|
469
|
+
showDebugInfo = false
|
|
470
|
+
}) {
|
|
471
|
+
const { isSuperAdmin, hasGlobalPermission, isLoading } = useRBAC();
|
|
472
|
+
if (isLoading) {
|
|
473
|
+
return /* @__PURE__ */ jsxs4("div", { className: "super-admin-guard-loading", children: [
|
|
474
|
+
/* @__PURE__ */ jsx5("div", { className: "loading-spinner" }),
|
|
475
|
+
/* @__PURE__ */ jsx5("span", { children: "Checking permissions..." })
|
|
476
|
+
] });
|
|
477
|
+
}
|
|
478
|
+
if (showDebugInfo) {
|
|
479
|
+
console.log("[SuperAdminGuard] Debug Info:", {
|
|
480
|
+
isSuperAdmin,
|
|
481
|
+
isLoading
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
if (isSuperAdmin) {
|
|
485
|
+
return /* @__PURE__ */ jsx5("div", { className: "super-admin-content", children });
|
|
486
|
+
}
|
|
487
|
+
return /* @__PURE__ */ jsx5("div", { className: "super-admin-fallback", children: fallback });
|
|
488
|
+
}
|
|
489
|
+
function SuperAdminBadge() {
|
|
490
|
+
const { isSuperAdmin } = useRBAC();
|
|
491
|
+
if (!isSuperAdmin) {
|
|
492
|
+
return null;
|
|
493
|
+
}
|
|
494
|
+
return /* @__PURE__ */ jsx5("div", { className: "super-admin-badge", children: /* @__PURE__ */ jsx5("span", { className: "badge-text", children: "SUPER ADMIN" }) });
|
|
495
|
+
}
|
|
496
|
+
function SuperAdminDebugPanel() {
|
|
497
|
+
const { isSuperAdmin, isLoading } = useRBAC();
|
|
498
|
+
if (!isSuperAdmin) {
|
|
499
|
+
return null;
|
|
500
|
+
}
|
|
501
|
+
return /* @__PURE__ */ jsxs4("div", { className: "super-admin-debug-panel", children: [
|
|
502
|
+
/* @__PURE__ */ jsx5("h4", { children: "Super Admin Debug Info" }),
|
|
503
|
+
/* @__PURE__ */ jsxs4("div", { className: "debug-info", children: [
|
|
504
|
+
/* @__PURE__ */ jsxs4("p", { children: [
|
|
505
|
+
/* @__PURE__ */ jsx5("strong", { children: "Is Super Admin:" }),
|
|
506
|
+
" ",
|
|
507
|
+
isSuperAdmin ? "Yes" : "No"
|
|
508
|
+
] }),
|
|
509
|
+
/* @__PURE__ */ jsxs4("p", { children: [
|
|
510
|
+
/* @__PURE__ */ jsx5("strong", { children: "Is Loading:" }),
|
|
511
|
+
" ",
|
|
512
|
+
isLoading ? "Yes" : "No"
|
|
513
|
+
] }),
|
|
514
|
+
/* @__PURE__ */ jsxs4("p", { children: [
|
|
515
|
+
/* @__PURE__ */ jsx5("strong", { children: "Environment:" }),
|
|
516
|
+
" ",
|
|
517
|
+
"production"
|
|
518
|
+
] })
|
|
519
|
+
] })
|
|
520
|
+
] });
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
// src/components/PrintLayout/PrintLayout.tsx
|
|
524
|
+
init_cn();
|
|
525
|
+
|
|
526
|
+
// src/components/PrintLayout/PrintLayoutContext.tsx
|
|
527
|
+
import { createContext, useContext, useState as useState3, useEffect as useEffect3 } from "react";
|
|
528
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
529
|
+
var PrintLayoutContext = createContext(void 0);
|
|
530
|
+
function PrintLayoutProvider({
|
|
531
|
+
children,
|
|
532
|
+
pageSize,
|
|
533
|
+
orientation,
|
|
534
|
+
hasFirstPageHeader,
|
|
535
|
+
hasSubsequentPageHeader
|
|
536
|
+
}) {
|
|
537
|
+
const [isFirstPage, setIsFirstPage] = useState3(true);
|
|
538
|
+
useEffect3(() => {
|
|
539
|
+
const handleResize = () => {
|
|
540
|
+
setIsFirstPage(true);
|
|
541
|
+
};
|
|
542
|
+
window.addEventListener("resize", handleResize);
|
|
543
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
544
|
+
}, []);
|
|
545
|
+
const value = {
|
|
546
|
+
isFirstPage,
|
|
547
|
+
pageSize,
|
|
548
|
+
orientation,
|
|
549
|
+
hasFirstPageHeader,
|
|
550
|
+
hasSubsequentPageHeader
|
|
551
|
+
};
|
|
552
|
+
return /* @__PURE__ */ jsx6(PrintLayoutContext.Provider, { value, children });
|
|
553
|
+
}
|
|
554
|
+
function usePrintLayout() {
|
|
555
|
+
const context = useContext(PrintLayoutContext);
|
|
556
|
+
if (context === void 0) {
|
|
557
|
+
throw new Error("usePrintLayout must be used within a PrintLayoutProvider");
|
|
558
|
+
}
|
|
559
|
+
return context;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
// src/components/PrintLayout/PrintLayout.tsx
|
|
563
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
564
|
+
function PrintLayout({
|
|
565
|
+
children,
|
|
566
|
+
orientation = "portrait",
|
|
567
|
+
pageSize = "A4",
|
|
568
|
+
showHeader = true,
|
|
569
|
+
showFooter = true,
|
|
570
|
+
firstPageHeader,
|
|
571
|
+
subsequentPageHeader,
|
|
572
|
+
className,
|
|
573
|
+
...props
|
|
574
|
+
}) {
|
|
575
|
+
const hasFirstPageHeader = Boolean(firstPageHeader);
|
|
576
|
+
const hasSubsequentPageHeader = Boolean(subsequentPageHeader);
|
|
577
|
+
const getPageSizeClass = () => {
|
|
578
|
+
if (pageSize === "A4") {
|
|
579
|
+
return orientation === "landscape" ? "print-a4-landscape" : "print-a4-portrait";
|
|
580
|
+
}
|
|
581
|
+
return "print-a4-portrait";
|
|
582
|
+
};
|
|
583
|
+
const getHeaderClass = () => {
|
|
584
|
+
if (hasFirstPageHeader && hasSubsequentPageHeader) {
|
|
585
|
+
return "print-first-page-header print-subsequent-header";
|
|
586
|
+
}
|
|
587
|
+
if (hasFirstPageHeader) {
|
|
588
|
+
return "print-first-page-header";
|
|
589
|
+
}
|
|
590
|
+
if (hasSubsequentPageHeader) {
|
|
591
|
+
return "print-subsequent-header";
|
|
592
|
+
}
|
|
593
|
+
return "";
|
|
594
|
+
};
|
|
595
|
+
return /* @__PURE__ */ jsx7(
|
|
596
|
+
PrintLayoutProvider,
|
|
597
|
+
{
|
|
598
|
+
pageSize,
|
|
599
|
+
orientation,
|
|
600
|
+
hasFirstPageHeader,
|
|
601
|
+
hasSubsequentPageHeader,
|
|
602
|
+
children: /* @__PURE__ */ jsxs5(
|
|
603
|
+
"div",
|
|
604
|
+
{
|
|
605
|
+
className: cn(
|
|
606
|
+
"print-layout",
|
|
607
|
+
getPageSizeClass(),
|
|
608
|
+
getHeaderClass(),
|
|
609
|
+
className
|
|
610
|
+
),
|
|
611
|
+
...props,
|
|
612
|
+
children: [
|
|
613
|
+
hasFirstPageHeader && /* @__PURE__ */ jsx7("div", { className: "print-first-page-only", children: firstPageHeader }),
|
|
614
|
+
hasSubsequentPageHeader && /* @__PURE__ */ jsx7("div", { className: "print-subsequent-pages-only", children: subsequentPageHeader }),
|
|
615
|
+
/* @__PURE__ */ jsx7("div", { className: "print-text", children })
|
|
616
|
+
]
|
|
617
|
+
}
|
|
618
|
+
)
|
|
619
|
+
}
|
|
620
|
+
);
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
// src/components/PrintHeader/PrintHeader.tsx
|
|
624
|
+
init_cn();
|
|
625
|
+
|
|
626
|
+
// src/components/PrintText/PrintText.tsx
|
|
627
|
+
init_cn();
|
|
628
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
629
|
+
function PrintText({
|
|
630
|
+
children,
|
|
631
|
+
variant = "body",
|
|
632
|
+
weight = "normal",
|
|
633
|
+
color = "primary",
|
|
634
|
+
printOptimized = true,
|
|
635
|
+
className,
|
|
636
|
+
as: Component = "p",
|
|
637
|
+
...props
|
|
638
|
+
}) {
|
|
639
|
+
const getVariantClasses = (variant2) => {
|
|
640
|
+
const baseClasses = "print-text";
|
|
641
|
+
switch (variant2) {
|
|
642
|
+
case "heading":
|
|
643
|
+
return cn(baseClasses, "text-2xl leading-tight");
|
|
644
|
+
case "subheading":
|
|
645
|
+
return cn(baseClasses, "text-xl leading-snug");
|
|
646
|
+
case "body":
|
|
647
|
+
return cn(baseClasses, "text-base leading-relaxed");
|
|
648
|
+
case "caption":
|
|
649
|
+
return cn(baseClasses, "text-sm leading-normal");
|
|
650
|
+
case "small":
|
|
651
|
+
return cn(baseClasses, "text-xs leading-tight");
|
|
652
|
+
default:
|
|
653
|
+
return baseClasses;
|
|
654
|
+
}
|
|
655
|
+
};
|
|
656
|
+
const getWeightClasses = (weight2) => {
|
|
657
|
+
switch (weight2) {
|
|
658
|
+
case "normal":
|
|
659
|
+
return "font-normal";
|
|
660
|
+
case "medium":
|
|
661
|
+
return "font-medium";
|
|
662
|
+
case "semibold":
|
|
663
|
+
return "font-semibold";
|
|
664
|
+
case "bold":
|
|
665
|
+
return "font-bold";
|
|
666
|
+
default:
|
|
667
|
+
return "font-normal";
|
|
668
|
+
}
|
|
669
|
+
};
|
|
670
|
+
const getColorClasses = (color2) => {
|
|
671
|
+
switch (color2) {
|
|
672
|
+
case "primary":
|
|
673
|
+
return "text-foreground";
|
|
674
|
+
case "secondary":
|
|
675
|
+
return "text-secondary-foreground";
|
|
676
|
+
case "muted":
|
|
677
|
+
return "text-muted-foreground";
|
|
678
|
+
case "accent":
|
|
679
|
+
return "text-accent-foreground";
|
|
680
|
+
default:
|
|
681
|
+
return "text-foreground";
|
|
682
|
+
}
|
|
683
|
+
};
|
|
684
|
+
const getPrintOptimizedClasses = () => {
|
|
685
|
+
if (!printOptimized) return "";
|
|
686
|
+
return cn(
|
|
687
|
+
"print-text",
|
|
688
|
+
// Print-specific font sizing
|
|
689
|
+
"print:text-sm print:leading-tight",
|
|
690
|
+
// High contrast for print
|
|
691
|
+
"print:text-black print:bg-white"
|
|
692
|
+
);
|
|
693
|
+
};
|
|
694
|
+
return /* @__PURE__ */ jsx8(
|
|
695
|
+
Component,
|
|
696
|
+
{
|
|
697
|
+
className: cn(
|
|
698
|
+
getVariantClasses(variant),
|
|
699
|
+
getWeightClasses(weight),
|
|
700
|
+
getColorClasses(color),
|
|
701
|
+
getPrintOptimizedClasses(),
|
|
702
|
+
className
|
|
703
|
+
),
|
|
704
|
+
...props,
|
|
705
|
+
children
|
|
706
|
+
}
|
|
707
|
+
);
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
// src/components/PrintHeader/PrintHeader.tsx
|
|
711
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
712
|
+
function PrintHeader({
|
|
713
|
+
title,
|
|
714
|
+
subtitle,
|
|
715
|
+
branding,
|
|
716
|
+
metadata = [],
|
|
717
|
+
printDate = true,
|
|
718
|
+
className
|
|
719
|
+
}) {
|
|
720
|
+
const formatPrintDate = () => {
|
|
721
|
+
return (/* @__PURE__ */ new Date()).toLocaleDateString("en-AU", {
|
|
722
|
+
year: "numeric",
|
|
723
|
+
month: "long",
|
|
724
|
+
day: "numeric"
|
|
725
|
+
});
|
|
726
|
+
};
|
|
727
|
+
const renderBranding = (branding2) => {
|
|
728
|
+
const { logo, companyName, projectName, version, tagline } = branding2;
|
|
729
|
+
return /* @__PURE__ */ jsxs6("div", { className: "flex items-center space-x-4 mb-4", children: [
|
|
730
|
+
logo && /* @__PURE__ */ jsx9(
|
|
731
|
+
"img",
|
|
732
|
+
{
|
|
733
|
+
src: logo,
|
|
734
|
+
alt: companyName || "Company Logo",
|
|
735
|
+
className: "h-8 w-auto print:h-6"
|
|
736
|
+
}
|
|
737
|
+
),
|
|
738
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex-1", children: [
|
|
739
|
+
companyName && /* @__PURE__ */ jsx9(PrintText, { variant: "subheading", weight: "semibold", className: "mb-1", children: companyName }),
|
|
740
|
+
projectName && /* @__PURE__ */ jsx9(PrintText, { variant: "body", color: "muted", className: "mb-1", children: projectName }),
|
|
741
|
+
version && /* @__PURE__ */ jsx9(PrintText, { variant: "small", color: "muted", children: version }),
|
|
742
|
+
tagline && /* @__PURE__ */ jsx9(PrintText, { variant: "small", color: "muted", className: "italic", children: tagline })
|
|
743
|
+
] })
|
|
744
|
+
] });
|
|
745
|
+
};
|
|
746
|
+
const renderMetadata = (metadata2) => {
|
|
747
|
+
if (metadata2.length === 0) return null;
|
|
748
|
+
return /* @__PURE__ */ jsx9("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 mb-4", children: metadata2.map((item, index) => /* @__PURE__ */ jsxs6("div", { className: "flex items-center space-x-2", children: [
|
|
749
|
+
item.icon && /* @__PURE__ */ jsx9(item.icon, { className: "h-4 w-4 text-muted-foreground print:h-3 print:w-3" }),
|
|
750
|
+
/* @__PURE__ */ jsxs6("div", { children: [
|
|
751
|
+
/* @__PURE__ */ jsx9(PrintText, { variant: "small", color: "muted", className: "block", children: item.label }),
|
|
752
|
+
/* @__PURE__ */ jsx9(PrintText, { variant: "body", weight: "medium", className: "block", children: item.value })
|
|
753
|
+
] })
|
|
754
|
+
] }, index)) });
|
|
755
|
+
};
|
|
756
|
+
return /* @__PURE__ */ jsxs6("header", { className: cn("print-header border-b border-border pb-4 mb-6", className), children: [
|
|
757
|
+
branding && renderBranding(branding),
|
|
758
|
+
/* @__PURE__ */ jsxs6("div", { className: "mb-4", children: [
|
|
759
|
+
/* @__PURE__ */ jsx9(PrintText, { variant: "heading", className: "mb-2", children: title }),
|
|
760
|
+
subtitle && /* @__PURE__ */ jsx9(PrintText, { variant: "subheading", color: "muted", children: subtitle })
|
|
761
|
+
] }),
|
|
762
|
+
metadata.length > 0 && renderMetadata(metadata),
|
|
763
|
+
printDate && /* @__PURE__ */ jsx9("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxs6(PrintText, { variant: "small", color: "muted", children: [
|
|
764
|
+
"Printed on ",
|
|
765
|
+
formatPrintDate()
|
|
766
|
+
] }) })
|
|
767
|
+
] });
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
// src/components/PrintHeader/PrintCoverHeader.tsx
|
|
771
|
+
init_cn();
|
|
772
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
773
|
+
function PrintCoverHeader({
|
|
774
|
+
title,
|
|
775
|
+
subtitle,
|
|
776
|
+
branding,
|
|
777
|
+
metadata = [],
|
|
778
|
+
printDate = true,
|
|
779
|
+
coverStyle = true,
|
|
780
|
+
logoSize = "medium",
|
|
781
|
+
titleSize = "large",
|
|
782
|
+
showDivider = false,
|
|
783
|
+
backgroundImage,
|
|
784
|
+
backgroundColor,
|
|
785
|
+
className
|
|
786
|
+
}) {
|
|
787
|
+
const formatPrintDate = () => {
|
|
788
|
+
return (/* @__PURE__ */ new Date()).toLocaleDateString("en-AU", {
|
|
789
|
+
year: "numeric",
|
|
790
|
+
month: "long",
|
|
791
|
+
day: "numeric"
|
|
792
|
+
});
|
|
793
|
+
};
|
|
794
|
+
const getLogoSizeClasses = (size) => {
|
|
795
|
+
switch (size) {
|
|
796
|
+
case "small":
|
|
797
|
+
return "h-16 w-auto print:h-12";
|
|
798
|
+
case "medium":
|
|
799
|
+
return "h-24 w-auto print:h-20";
|
|
800
|
+
case "large":
|
|
801
|
+
return "h-32 w-auto print:h-24";
|
|
802
|
+
default:
|
|
803
|
+
return "h-24 w-auto print:h-20";
|
|
804
|
+
}
|
|
805
|
+
};
|
|
806
|
+
const getTitleSizeClasses = (size) => {
|
|
807
|
+
switch (size) {
|
|
808
|
+
case "small":
|
|
809
|
+
return "text-3xl print:text-2xl";
|
|
810
|
+
case "medium":
|
|
811
|
+
return "text-4xl print:text-3xl";
|
|
812
|
+
case "large":
|
|
813
|
+
return "text-5xl print:text-4xl";
|
|
814
|
+
case "xl":
|
|
815
|
+
return "text-6xl print:text-5xl";
|
|
816
|
+
default:
|
|
817
|
+
return "text-4xl print:text-3xl";
|
|
818
|
+
}
|
|
819
|
+
};
|
|
820
|
+
const getBackgroundStyle = () => {
|
|
821
|
+
const style = {};
|
|
822
|
+
if (backgroundImage) {
|
|
823
|
+
style.backgroundImage = `url(${backgroundImage})`;
|
|
824
|
+
style.backgroundSize = "cover";
|
|
825
|
+
style.backgroundPosition = "center";
|
|
826
|
+
style.backgroundRepeat = "no-repeat";
|
|
827
|
+
}
|
|
828
|
+
if (backgroundColor) {
|
|
829
|
+
style.backgroundColor = backgroundColor;
|
|
830
|
+
}
|
|
831
|
+
return style;
|
|
832
|
+
};
|
|
833
|
+
const renderBranding = () => {
|
|
834
|
+
if (!branding) return null;
|
|
835
|
+
const { logo, companyName, projectName, version, tagline } = branding;
|
|
836
|
+
return /* @__PURE__ */ jsxs7("div", { className: "flex flex-col items-center text-center mb-8", children: [
|
|
837
|
+
logo && /* @__PURE__ */ jsx10(
|
|
838
|
+
"img",
|
|
839
|
+
{
|
|
840
|
+
src: logo,
|
|
841
|
+
alt: companyName || "Company Logo",
|
|
842
|
+
className: cn(
|
|
843
|
+
getLogoSizeClasses(logoSize),
|
|
844
|
+
"mb-4"
|
|
845
|
+
)
|
|
846
|
+
}
|
|
847
|
+
),
|
|
848
|
+
companyName && /* @__PURE__ */ jsx10(PrintText, { variant: "subheading", weight: "semibold", className: "mb-2", children: companyName }),
|
|
849
|
+
projectName && /* @__PURE__ */ jsx10(PrintText, { variant: "body", color: "muted", className: "mb-2", children: projectName }),
|
|
850
|
+
version && /* @__PURE__ */ jsx10(PrintText, { variant: "small", color: "muted", className: "mb-2", children: version }),
|
|
851
|
+
tagline && /* @__PURE__ */ jsx10(PrintText, { variant: "small", color: "muted", className: "italic", children: tagline })
|
|
852
|
+
] });
|
|
853
|
+
};
|
|
854
|
+
const renderMetadata = () => {
|
|
855
|
+
if (metadata.length === 0) return null;
|
|
856
|
+
return /* @__PURE__ */ jsx10("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-6 mb-8", children: metadata.map((item, index) => /* @__PURE__ */ jsxs7("div", { className: "flex items-center space-x-3", children: [
|
|
857
|
+
item.icon && /* @__PURE__ */ jsx10(item.icon, { className: "h-5 w-5 text-muted-foreground print:h-4 print:w-4" }),
|
|
858
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
859
|
+
/* @__PURE__ */ jsx10(PrintText, { variant: "small", color: "muted", className: "block", children: item.label }),
|
|
860
|
+
/* @__PURE__ */ jsx10(PrintText, { variant: "body", weight: "medium", className: "block", children: item.value })
|
|
861
|
+
] })
|
|
862
|
+
] }, index)) });
|
|
863
|
+
};
|
|
864
|
+
return /* @__PURE__ */ jsxs7(
|
|
865
|
+
"header",
|
|
866
|
+
{
|
|
867
|
+
className: cn(
|
|
868
|
+
"print-cover-header min-h-[400px] flex flex-col justify-center px-8 py-12",
|
|
869
|
+
"print:min-h-[300px] print:px-6 print:py-8",
|
|
870
|
+
className
|
|
871
|
+
),
|
|
872
|
+
style: getBackgroundStyle(),
|
|
873
|
+
children: [
|
|
874
|
+
renderBranding(),
|
|
875
|
+
/* @__PURE__ */ jsxs7("div", { className: "text-center mb-8", children: [
|
|
876
|
+
/* @__PURE__ */ jsx10(
|
|
877
|
+
PrintText,
|
|
878
|
+
{
|
|
879
|
+
variant: "heading",
|
|
880
|
+
className: cn(
|
|
881
|
+
"mb-4",
|
|
882
|
+
getTitleSizeClasses(titleSize)
|
|
883
|
+
),
|
|
884
|
+
children: title
|
|
885
|
+
}
|
|
886
|
+
),
|
|
887
|
+
subtitle && /* @__PURE__ */ jsx10(PrintText, { variant: "subheading", color: "muted", className: "max-w-3xl mx-auto", children: subtitle })
|
|
888
|
+
] }),
|
|
889
|
+
showDivider && /* @__PURE__ */ jsx10("div", { className: "w-24 h-1 bg-primary mx-auto mb-8" }),
|
|
890
|
+
renderMetadata(),
|
|
891
|
+
printDate && /* @__PURE__ */ jsx10("div", { className: "flex justify-center mt-auto", children: /* @__PURE__ */ jsxs7(PrintText, { variant: "small", color: "muted", children: [
|
|
892
|
+
"Printed on ",
|
|
893
|
+
formatPrintDate()
|
|
894
|
+
] }) })
|
|
895
|
+
]
|
|
896
|
+
}
|
|
897
|
+
);
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
// src/components/PrintDataTable/PrintDataTable.tsx
|
|
901
|
+
init_cn();
|
|
902
|
+
|
|
903
|
+
// src/components/PrintDataTable/PrintTableGroup.tsx
|
|
904
|
+
init_cn();
|
|
905
|
+
|
|
906
|
+
// src/components/PrintDataTable/PrintTableRow.tsx
|
|
907
|
+
init_cn();
|
|
908
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
909
|
+
function PrintTableRow({
|
|
910
|
+
row,
|
|
911
|
+
columns,
|
|
912
|
+
styling = {
|
|
913
|
+
headerStyle: "solid",
|
|
914
|
+
rowStyle: "striped",
|
|
915
|
+
cellPadding: "normal"
|
|
916
|
+
},
|
|
917
|
+
printOptimized = true,
|
|
918
|
+
isEven = false
|
|
919
|
+
}) {
|
|
920
|
+
const getRowClasses = () => {
|
|
921
|
+
const baseClasses = "border-b border-border";
|
|
922
|
+
switch (styling.rowStyle) {
|
|
923
|
+
case "striped":
|
|
924
|
+
return cn(baseClasses, isEven ? "bg-muted/30" : "bg-background");
|
|
925
|
+
case "solid":
|
|
926
|
+
return cn(baseClasses, "bg-background");
|
|
927
|
+
case "bordered":
|
|
928
|
+
return cn(baseClasses, "border border-border bg-background");
|
|
929
|
+
default:
|
|
930
|
+
return baseClasses;
|
|
931
|
+
}
|
|
932
|
+
};
|
|
933
|
+
const getCellPaddingClasses = () => {
|
|
934
|
+
switch (styling.cellPadding) {
|
|
935
|
+
case "compact":
|
|
936
|
+
return "px-2 py-1 print:px-1 print:py-0.5";
|
|
937
|
+
case "spacious":
|
|
938
|
+
return "px-6 py-4 print:px-4 print:py-2";
|
|
939
|
+
case "normal":
|
|
940
|
+
default:
|
|
941
|
+
return "px-4 py-2 print:px-2 print:py-1";
|
|
942
|
+
}
|
|
943
|
+
};
|
|
944
|
+
return /* @__PURE__ */ jsx11("tr", { className: getRowClasses(), children: columns.map((column) => /* @__PURE__ */ jsx11(
|
|
945
|
+
"td",
|
|
946
|
+
{
|
|
947
|
+
className: cn(
|
|
948
|
+
getCellPaddingClasses(),
|
|
949
|
+
"text-left",
|
|
950
|
+
column.align === "center" && "text-center",
|
|
951
|
+
column.align === "right" && "text-right",
|
|
952
|
+
column.printBreak === "avoid" && "print-break-avoid"
|
|
953
|
+
),
|
|
954
|
+
children: /* @__PURE__ */ jsx11(PrintText, { variant: "small", children: column.render ? column.render(row[column.key], row) : row[column.key] ?? "" })
|
|
955
|
+
},
|
|
956
|
+
column.key
|
|
957
|
+
)) });
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
// src/components/PrintDataTable/PrintTableGroup.tsx
|
|
961
|
+
import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
962
|
+
function PrintTableGroup({
|
|
963
|
+
groupKey,
|
|
964
|
+
groupData,
|
|
965
|
+
columns,
|
|
966
|
+
groupHeader,
|
|
967
|
+
styling = {
|
|
968
|
+
headerStyle: "solid",
|
|
969
|
+
rowStyle: "striped",
|
|
970
|
+
cellPadding: "normal"
|
|
971
|
+
},
|
|
972
|
+
printOptimized = true
|
|
973
|
+
}) {
|
|
974
|
+
const getGroupHeaderClasses = () => {
|
|
975
|
+
const baseClasses = "bg-muted text-muted-foreground font-semibold";
|
|
976
|
+
if (printOptimized) {
|
|
977
|
+
return cn(
|
|
978
|
+
baseClasses,
|
|
979
|
+
"print:bg-gray-100 print:text-black print:font-bold"
|
|
980
|
+
);
|
|
981
|
+
}
|
|
982
|
+
return baseClasses;
|
|
983
|
+
};
|
|
984
|
+
const getCellPaddingClasses = () => {
|
|
985
|
+
switch (styling.cellPadding) {
|
|
986
|
+
case "compact":
|
|
987
|
+
return "px-2 py-1 print:px-1 print:py-0.5";
|
|
988
|
+
case "spacious":
|
|
989
|
+
return "px-6 py-4 print:px-4 print:py-2";
|
|
990
|
+
case "normal":
|
|
991
|
+
default:
|
|
992
|
+
return "px-4 py-2 print:px-2 print:py-1";
|
|
993
|
+
}
|
|
994
|
+
};
|
|
995
|
+
return /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
996
|
+
/* @__PURE__ */ jsx12("tr", { className: getGroupHeaderClasses(), children: /* @__PURE__ */ jsx12(
|
|
997
|
+
"td",
|
|
998
|
+
{
|
|
999
|
+
colSpan: columns.length,
|
|
1000
|
+
className: cn(
|
|
1001
|
+
getCellPaddingClasses(),
|
|
1002
|
+
"print-break-avoid"
|
|
1003
|
+
),
|
|
1004
|
+
children: groupHeader ? groupHeader(groupKey) : /* @__PURE__ */ jsx12(PrintText, { variant: "small", weight: "semibold", children: groupKey })
|
|
1005
|
+
}
|
|
1006
|
+
) }),
|
|
1007
|
+
groupData.map((row, index) => /* @__PURE__ */ jsx12(
|
|
1008
|
+
PrintTableRow,
|
|
1009
|
+
{
|
|
1010
|
+
row,
|
|
1011
|
+
columns,
|
|
1012
|
+
styling,
|
|
1013
|
+
printOptimized,
|
|
1014
|
+
isEven: index % 2 === 0
|
|
1015
|
+
},
|
|
1016
|
+
index
|
|
1017
|
+
))
|
|
1018
|
+
] });
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
// src/components/PrintDataTable/PrintDataTable.tsx
|
|
1022
|
+
import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1023
|
+
function PrintDataTable({
|
|
1024
|
+
data,
|
|
1025
|
+
columns,
|
|
1026
|
+
title,
|
|
1027
|
+
showTitle = true,
|
|
1028
|
+
grouping,
|
|
1029
|
+
styling = {
|
|
1030
|
+
headerStyle: "solid",
|
|
1031
|
+
rowStyle: "striped",
|
|
1032
|
+
cellPadding: "normal"
|
|
1033
|
+
},
|
|
1034
|
+
printOptimized = true,
|
|
1035
|
+
className,
|
|
1036
|
+
...props
|
|
1037
|
+
}) {
|
|
1038
|
+
const getTableClasses = () => {
|
|
1039
|
+
const baseClasses = "w-full border-collapse";
|
|
1040
|
+
if (printOptimized) {
|
|
1041
|
+
return cn(
|
|
1042
|
+
baseClasses,
|
|
1043
|
+
"print:text-xs print:leading-tight",
|
|
1044
|
+
"print:border-black print:border-solid"
|
|
1045
|
+
);
|
|
1046
|
+
}
|
|
1047
|
+
return baseClasses;
|
|
1048
|
+
};
|
|
1049
|
+
const getHeaderClasses = () => {
|
|
1050
|
+
const baseClasses = "text-left font-semibold";
|
|
1051
|
+
switch (styling.headerStyle) {
|
|
1052
|
+
case "solid":
|
|
1053
|
+
return cn(baseClasses, "bg-primary text-primary-foreground");
|
|
1054
|
+
case "outline":
|
|
1055
|
+
return cn(baseClasses, "border-2 border-primary text-primary");
|
|
1056
|
+
default:
|
|
1057
|
+
return baseClasses;
|
|
1058
|
+
}
|
|
1059
|
+
};
|
|
1060
|
+
const getRowClasses = (isEven) => {
|
|
1061
|
+
const baseClasses = "border-b border-border";
|
|
1062
|
+
switch (styling.rowStyle) {
|
|
1063
|
+
case "striped":
|
|
1064
|
+
return cn(baseClasses, isEven ? "bg-muted/30" : "bg-background");
|
|
1065
|
+
case "solid":
|
|
1066
|
+
return cn(baseClasses, "bg-background");
|
|
1067
|
+
case "bordered":
|
|
1068
|
+
return cn(baseClasses, "border border-border bg-background");
|
|
1069
|
+
default:
|
|
1070
|
+
return baseClasses;
|
|
1071
|
+
}
|
|
1072
|
+
};
|
|
1073
|
+
const getCellPaddingClasses = () => {
|
|
1074
|
+
switch (styling.cellPadding) {
|
|
1075
|
+
case "compact":
|
|
1076
|
+
return "px-2 py-1 print:px-1 print:py-0.5";
|
|
1077
|
+
case "spacious":
|
|
1078
|
+
return "px-6 py-4 print:px-4 print:py-2";
|
|
1079
|
+
case "normal":
|
|
1080
|
+
default:
|
|
1081
|
+
return "px-4 py-2 print:px-2 print:py-1";
|
|
1082
|
+
}
|
|
1083
|
+
};
|
|
1084
|
+
const renderTableHeader = () => /* @__PURE__ */ jsx13("thead", { children: /* @__PURE__ */ jsx13("tr", { className: getHeaderClasses(), children: columns.map((column) => /* @__PURE__ */ jsx13(
|
|
1085
|
+
"th",
|
|
1086
|
+
{
|
|
1087
|
+
className: cn(
|
|
1088
|
+
getCellPaddingClasses(),
|
|
1089
|
+
"text-left",
|
|
1090
|
+
column.align === "center" && "text-center",
|
|
1091
|
+
column.align === "right" && "text-right",
|
|
1092
|
+
column.printBreak === "avoid" && "print-break-avoid",
|
|
1093
|
+
column.printBreak === "always" && "print-break-before"
|
|
1094
|
+
),
|
|
1095
|
+
style: { width: column.width },
|
|
1096
|
+
children: /* @__PURE__ */ jsx13(PrintText, { variant: "small", weight: "semibold", children: column.header })
|
|
1097
|
+
},
|
|
1098
|
+
column.key
|
|
1099
|
+
)) }) });
|
|
1100
|
+
const renderTableBody = () => {
|
|
1101
|
+
if (grouping?.enabled) {
|
|
1102
|
+
const groupedData = groupDataByField(data, grouping.groupBy);
|
|
1103
|
+
return /* @__PURE__ */ jsx13("tbody", { children: Object.entries(groupedData).map(([groupKey, groupData], groupIndex) => /* @__PURE__ */ jsx13(
|
|
1104
|
+
PrintTableGroup,
|
|
1105
|
+
{
|
|
1106
|
+
groupKey,
|
|
1107
|
+
groupData,
|
|
1108
|
+
columns,
|
|
1109
|
+
groupHeader: grouping.groupHeader,
|
|
1110
|
+
styling,
|
|
1111
|
+
printOptimized
|
|
1112
|
+
},
|
|
1113
|
+
groupKey
|
|
1114
|
+
)) });
|
|
1115
|
+
}
|
|
1116
|
+
return /* @__PURE__ */ jsx13("tbody", { children: data.map((row, index) => /* @__PURE__ */ jsx13(
|
|
1117
|
+
"tr",
|
|
1118
|
+
{
|
|
1119
|
+
className: getRowClasses(index % 2 === 0),
|
|
1120
|
+
children: columns.map((column) => /* @__PURE__ */ jsx13(
|
|
1121
|
+
"td",
|
|
1122
|
+
{
|
|
1123
|
+
className: cn(
|
|
1124
|
+
getCellPaddingClasses(),
|
|
1125
|
+
"text-left",
|
|
1126
|
+
column.align === "center" && "text-center",
|
|
1127
|
+
column.align === "right" && "text-right",
|
|
1128
|
+
column.printBreak === "avoid" && "print-break-avoid"
|
|
1129
|
+
),
|
|
1130
|
+
children: /* @__PURE__ */ jsx13(PrintText, { variant: "small", children: column.render ? column.render(row[column.key], row) : row[column.key] })
|
|
1131
|
+
},
|
|
1132
|
+
column.key
|
|
1133
|
+
))
|
|
1134
|
+
},
|
|
1135
|
+
index
|
|
1136
|
+
)) });
|
|
1137
|
+
};
|
|
1138
|
+
return /* @__PURE__ */ jsxs9("div", { className: cn("print-data-table", className), ...props, children: [
|
|
1139
|
+
title && showTitle && /* @__PURE__ */ jsx13("div", { className: "mb-4", children: /* @__PURE__ */ jsx13(PrintText, { variant: "subheading", weight: "semibold", children: title }) }),
|
|
1140
|
+
/* @__PURE__ */ jsx13("div", { className: "overflow-x-auto print:overflow-visible", children: /* @__PURE__ */ jsxs9("table", { className: getTableClasses(), children: [
|
|
1141
|
+
renderTableHeader(),
|
|
1142
|
+
renderTableBody()
|
|
1143
|
+
] }) })
|
|
1144
|
+
] });
|
|
1145
|
+
}
|
|
1146
|
+
function groupDataByField(data, field) {
|
|
1147
|
+
return data.reduce((groups, item) => {
|
|
1148
|
+
const key = item[field] || "Unknown";
|
|
1149
|
+
if (!groups[key]) {
|
|
1150
|
+
groups[key] = [];
|
|
1151
|
+
}
|
|
1152
|
+
groups[key].push(item);
|
|
1153
|
+
return groups;
|
|
1154
|
+
}, {});
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
// src/components/PrintCard/PrintCard.tsx
|
|
1158
|
+
init_cn();
|
|
1159
|
+
import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1160
|
+
function PrintCard({
|
|
1161
|
+
children,
|
|
1162
|
+
title,
|
|
1163
|
+
subtitle,
|
|
1164
|
+
variant = "default",
|
|
1165
|
+
size = "md",
|
|
1166
|
+
layout = "vertical",
|
|
1167
|
+
showBorder = true,
|
|
1168
|
+
backgroundColor = "white",
|
|
1169
|
+
textColor = "primary",
|
|
1170
|
+
printOptimized = true,
|
|
1171
|
+
className,
|
|
1172
|
+
...props
|
|
1173
|
+
}) {
|
|
1174
|
+
const getVariantClasses = (variant2) => {
|
|
1175
|
+
switch (variant2) {
|
|
1176
|
+
case "outlined":
|
|
1177
|
+
return "border-2 border-border bg-transparent";
|
|
1178
|
+
case "filled":
|
|
1179
|
+
return "border-0 bg-muted";
|
|
1180
|
+
case "elevated":
|
|
1181
|
+
return "shadow-lg border-0 bg-background";
|
|
1182
|
+
default:
|
|
1183
|
+
return "border border-border bg-background";
|
|
1184
|
+
}
|
|
1185
|
+
};
|
|
1186
|
+
const getSizeClasses = (size2) => {
|
|
1187
|
+
switch (size2) {
|
|
1188
|
+
case "sm":
|
|
1189
|
+
return "p-3";
|
|
1190
|
+
case "lg":
|
|
1191
|
+
return "p-6";
|
|
1192
|
+
case "xl":
|
|
1193
|
+
return "p-8";
|
|
1194
|
+
default:
|
|
1195
|
+
return "p-4";
|
|
1196
|
+
}
|
|
1197
|
+
};
|
|
1198
|
+
const getLayoutClasses = (layout2) => {
|
|
1199
|
+
switch (layout2) {
|
|
1200
|
+
case "horizontal":
|
|
1201
|
+
return "flex-row items-center";
|
|
1202
|
+
case "compact":
|
|
1203
|
+
return "p-2";
|
|
1204
|
+
default:
|
|
1205
|
+
return "flex-col";
|
|
1206
|
+
}
|
|
1207
|
+
};
|
|
1208
|
+
const getBackgroundClasses = (backgroundColor2, variant2) => {
|
|
1209
|
+
if (variant2 === "outlined" && backgroundColor2 === "white") {
|
|
1210
|
+
return "bg-transparent";
|
|
1211
|
+
}
|
|
1212
|
+
switch (backgroundColor2) {
|
|
1213
|
+
case "gray":
|
|
1214
|
+
return "bg-muted";
|
|
1215
|
+
case "primary":
|
|
1216
|
+
return "bg-primary text-primary-foreground";
|
|
1217
|
+
case "secondary":
|
|
1218
|
+
return "bg-secondary text-secondary-foreground";
|
|
1219
|
+
case "accent":
|
|
1220
|
+
return "bg-accent text-accent-foreground";
|
|
1221
|
+
default:
|
|
1222
|
+
return "";
|
|
1223
|
+
}
|
|
1224
|
+
};
|
|
1225
|
+
const getTextColorClasses = (textColor2, backgroundColor2) => {
|
|
1226
|
+
if (backgroundColor2 === "primary") {
|
|
1227
|
+
return "text-primary-foreground";
|
|
1228
|
+
}
|
|
1229
|
+
if (backgroundColor2 === "secondary") {
|
|
1230
|
+
return "text-secondary-foreground";
|
|
1231
|
+
}
|
|
1232
|
+
if (backgroundColor2 === "accent") {
|
|
1233
|
+
return "text-accent-foreground";
|
|
1234
|
+
}
|
|
1235
|
+
switch (textColor2) {
|
|
1236
|
+
case "secondary":
|
|
1237
|
+
return "text-secondary-foreground";
|
|
1238
|
+
case "muted":
|
|
1239
|
+
return "text-muted-foreground";
|
|
1240
|
+
case "accent":
|
|
1241
|
+
return "text-accent-foreground";
|
|
1242
|
+
case "destructive":
|
|
1243
|
+
return "text-destructive-foreground";
|
|
1244
|
+
default:
|
|
1245
|
+
return "text-foreground";
|
|
1246
|
+
}
|
|
1247
|
+
};
|
|
1248
|
+
const getPrintOptimizedClasses = () => {
|
|
1249
|
+
if (!printOptimized) return "";
|
|
1250
|
+
return cn(
|
|
1251
|
+
"print:break-inside-avoid",
|
|
1252
|
+
"print:shadow-none",
|
|
1253
|
+
"print:border-black",
|
|
1254
|
+
"print:bg-white",
|
|
1255
|
+
"print:text-black"
|
|
1256
|
+
);
|
|
1257
|
+
};
|
|
1258
|
+
return /* @__PURE__ */ jsxs10(
|
|
1259
|
+
"div",
|
|
1260
|
+
{
|
|
1261
|
+
className: cn(
|
|
1262
|
+
"print-card",
|
|
1263
|
+
"flex",
|
|
1264
|
+
"rounded-lg",
|
|
1265
|
+
getVariantClasses(variant),
|
|
1266
|
+
getBackgroundClasses(backgroundColor, variant),
|
|
1267
|
+
getTextColorClasses(textColor, backgroundColor),
|
|
1268
|
+
getSizeClasses(size),
|
|
1269
|
+
getLayoutClasses(layout),
|
|
1270
|
+
getPrintOptimizedClasses(),
|
|
1271
|
+
className
|
|
1272
|
+
),
|
|
1273
|
+
...props,
|
|
1274
|
+
children: [
|
|
1275
|
+
title && /* @__PURE__ */ jsxs10("div", { className: "mb-2", children: [
|
|
1276
|
+
/* @__PURE__ */ jsx14(PrintText, { variant: "heading", weight: "semibold", children: title }),
|
|
1277
|
+
subtitle && /* @__PURE__ */ jsx14(PrintText, { variant: "caption", color: "muted", className: "mt-1", children: subtitle })
|
|
1278
|
+
] }),
|
|
1279
|
+
children
|
|
1280
|
+
]
|
|
1281
|
+
}
|
|
1282
|
+
);
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
// src/components/PrintCard/PrintCardHeader.tsx
|
|
1286
|
+
init_cn();
|
|
1287
|
+
import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1288
|
+
function PrintCardHeader({
|
|
1289
|
+
children,
|
|
1290
|
+
title,
|
|
1291
|
+
subtitle,
|
|
1292
|
+
actions,
|
|
1293
|
+
align = "left",
|
|
1294
|
+
printOptimized = true,
|
|
1295
|
+
className,
|
|
1296
|
+
...props
|
|
1297
|
+
}) {
|
|
1298
|
+
const getAlignmentClasses = (align2) => {
|
|
1299
|
+
switch (align2) {
|
|
1300
|
+
case "center":
|
|
1301
|
+
return "text-center";
|
|
1302
|
+
case "right":
|
|
1303
|
+
return "text-right";
|
|
1304
|
+
default:
|
|
1305
|
+
return "text-left";
|
|
1306
|
+
}
|
|
1307
|
+
};
|
|
1308
|
+
const getPrintOptimizedClasses = () => {
|
|
1309
|
+
if (!printOptimized) return "";
|
|
1310
|
+
return cn(
|
|
1311
|
+
"print:break-after-avoid",
|
|
1312
|
+
"print:mb-2"
|
|
1313
|
+
);
|
|
1314
|
+
};
|
|
1315
|
+
return /* @__PURE__ */ jsxs11(
|
|
1316
|
+
"div",
|
|
1317
|
+
{
|
|
1318
|
+
className: cn(
|
|
1319
|
+
"print-card-header",
|
|
1320
|
+
"flex",
|
|
1321
|
+
"items-center",
|
|
1322
|
+
"justify-between",
|
|
1323
|
+
"mb-4",
|
|
1324
|
+
getAlignmentClasses(align),
|
|
1325
|
+
getPrintOptimizedClasses(),
|
|
1326
|
+
className
|
|
1327
|
+
),
|
|
1328
|
+
...props,
|
|
1329
|
+
children: [
|
|
1330
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex-1", children: [
|
|
1331
|
+
title && /* @__PURE__ */ jsx15(PrintText, { variant: "heading", weight: "semibold", children: title }),
|
|
1332
|
+
subtitle && /* @__PURE__ */ jsx15(PrintText, { variant: "caption", color: "muted", className: "mt-1", children: subtitle }),
|
|
1333
|
+
children
|
|
1334
|
+
] }),
|
|
1335
|
+
actions && /* @__PURE__ */ jsx15("div", { className: "ml-4 flex-shrink-0", children: actions })
|
|
1336
|
+
]
|
|
1337
|
+
}
|
|
1338
|
+
);
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
// src/components/PrintCard/PrintCardContent.tsx
|
|
1342
|
+
init_cn();
|
|
1343
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1344
|
+
function PrintCardContent({
|
|
1345
|
+
children,
|
|
1346
|
+
padding = "md",
|
|
1347
|
+
printOptimized = true,
|
|
1348
|
+
className,
|
|
1349
|
+
...props
|
|
1350
|
+
}) {
|
|
1351
|
+
const getPaddingClasses = (padding2) => {
|
|
1352
|
+
switch (padding2) {
|
|
1353
|
+
case "none":
|
|
1354
|
+
return "p-0";
|
|
1355
|
+
case "sm":
|
|
1356
|
+
return "p-2";
|
|
1357
|
+
case "lg":
|
|
1358
|
+
return "p-6";
|
|
1359
|
+
default:
|
|
1360
|
+
return "p-4";
|
|
1361
|
+
}
|
|
1362
|
+
};
|
|
1363
|
+
const getPrintOptimizedClasses = () => {
|
|
1364
|
+
if (!printOptimized) return "";
|
|
1365
|
+
return cn(
|
|
1366
|
+
"print:break-inside-avoid",
|
|
1367
|
+
"print:text-sm",
|
|
1368
|
+
"print:leading-tight"
|
|
1369
|
+
);
|
|
1370
|
+
};
|
|
1371
|
+
return /* @__PURE__ */ jsx16(
|
|
1372
|
+
"div",
|
|
1373
|
+
{
|
|
1374
|
+
"data-testid": "print-card-content",
|
|
1375
|
+
className: cn(
|
|
1376
|
+
"print-card-content",
|
|
1377
|
+
getPaddingClasses(padding),
|
|
1378
|
+
getPrintOptimizedClasses(),
|
|
1379
|
+
className
|
|
1380
|
+
),
|
|
1381
|
+
...props,
|
|
1382
|
+
children
|
|
1383
|
+
}
|
|
1384
|
+
);
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
// src/components/PrintCard/PrintCardFooter.tsx
|
|
1388
|
+
init_cn();
|
|
1389
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1390
|
+
function PrintCardFooter({
|
|
1391
|
+
children,
|
|
1392
|
+
align = "left",
|
|
1393
|
+
printOptimized = true,
|
|
1394
|
+
className,
|
|
1395
|
+
...props
|
|
1396
|
+
}) {
|
|
1397
|
+
const getAlignmentClasses = (align2) => {
|
|
1398
|
+
switch (align2) {
|
|
1399
|
+
case "center":
|
|
1400
|
+
return "text-center";
|
|
1401
|
+
case "right":
|
|
1402
|
+
return "text-right";
|
|
1403
|
+
default:
|
|
1404
|
+
return "text-left";
|
|
1405
|
+
}
|
|
1406
|
+
};
|
|
1407
|
+
const getPrintOptimizedClasses = () => {
|
|
1408
|
+
if (!printOptimized) return "";
|
|
1409
|
+
return cn(
|
|
1410
|
+
"print:break-before-avoid",
|
|
1411
|
+
"print:mt-2",
|
|
1412
|
+
"print:pt-2",
|
|
1413
|
+
"print:border-t",
|
|
1414
|
+
"print:border-gray-300"
|
|
1415
|
+
);
|
|
1416
|
+
};
|
|
1417
|
+
return /* @__PURE__ */ jsx17(
|
|
1418
|
+
"div",
|
|
1419
|
+
{
|
|
1420
|
+
className: cn(
|
|
1421
|
+
"print-card-footer",
|
|
1422
|
+
"mt-4",
|
|
1423
|
+
"pt-4",
|
|
1424
|
+
"border-t",
|
|
1425
|
+
"border-border",
|
|
1426
|
+
getAlignmentClasses(align),
|
|
1427
|
+
getPrintOptimizedClasses(),
|
|
1428
|
+
className
|
|
1429
|
+
),
|
|
1430
|
+
...props,
|
|
1431
|
+
children
|
|
1432
|
+
}
|
|
1433
|
+
);
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
// src/components/PrintCard/PrintCardImage.tsx
|
|
1437
|
+
init_cn();
|
|
1438
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1439
|
+
function PrintCardImage({
|
|
1440
|
+
src,
|
|
1441
|
+
alt,
|
|
1442
|
+
width,
|
|
1443
|
+
height,
|
|
1444
|
+
aspectRatio = "auto",
|
|
1445
|
+
objectFit = "cover",
|
|
1446
|
+
printOptimized = true,
|
|
1447
|
+
className,
|
|
1448
|
+
...props
|
|
1449
|
+
}) {
|
|
1450
|
+
const getAspectRatioClasses = (aspectRatio2) => {
|
|
1451
|
+
switch (aspectRatio2) {
|
|
1452
|
+
case "square":
|
|
1453
|
+
return "aspect-square";
|
|
1454
|
+
case "portrait":
|
|
1455
|
+
return "aspect-[3/4]";
|
|
1456
|
+
case "landscape":
|
|
1457
|
+
return "aspect-[4/3]";
|
|
1458
|
+
default:
|
|
1459
|
+
return "";
|
|
1460
|
+
}
|
|
1461
|
+
};
|
|
1462
|
+
const getObjectFitClasses = (objectFit2) => {
|
|
1463
|
+
switch (objectFit2) {
|
|
1464
|
+
case "contain":
|
|
1465
|
+
return "object-contain";
|
|
1466
|
+
case "fill":
|
|
1467
|
+
return "object-fill";
|
|
1468
|
+
case "none":
|
|
1469
|
+
return "object-none";
|
|
1470
|
+
case "scale-down":
|
|
1471
|
+
return "object-scale-down";
|
|
1472
|
+
default:
|
|
1473
|
+
return "object-cover";
|
|
1474
|
+
}
|
|
1475
|
+
};
|
|
1476
|
+
const getPrintOptimizedClasses = () => {
|
|
1477
|
+
if (!printOptimized) return "";
|
|
1478
|
+
return cn(
|
|
1479
|
+
"print:max-w-full",
|
|
1480
|
+
"print:h-auto",
|
|
1481
|
+
"print:break-inside-avoid"
|
|
1482
|
+
);
|
|
1483
|
+
};
|
|
1484
|
+
return /* @__PURE__ */ jsx18(
|
|
1485
|
+
"img",
|
|
1486
|
+
{
|
|
1487
|
+
src,
|
|
1488
|
+
alt,
|
|
1489
|
+
width,
|
|
1490
|
+
height,
|
|
1491
|
+
className: cn(
|
|
1492
|
+
"print-card-image",
|
|
1493
|
+
"w-full",
|
|
1494
|
+
"h-auto",
|
|
1495
|
+
"rounded-md",
|
|
1496
|
+
getAspectRatioClasses(aspectRatio),
|
|
1497
|
+
getObjectFitClasses(objectFit),
|
|
1498
|
+
getPrintOptimizedClasses(),
|
|
1499
|
+
className
|
|
1500
|
+
),
|
|
1501
|
+
...props
|
|
1502
|
+
}
|
|
1503
|
+
);
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
// src/components/PrintCard/PrintCardGrid.tsx
|
|
1507
|
+
init_cn();
|
|
1508
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1509
|
+
function PrintCardGrid({
|
|
1510
|
+
children,
|
|
1511
|
+
columns = 3,
|
|
1512
|
+
gap = "md",
|
|
1513
|
+
rowGap = "md",
|
|
1514
|
+
printOptimized = true,
|
|
1515
|
+
className,
|
|
1516
|
+
...props
|
|
1517
|
+
}) {
|
|
1518
|
+
const getColumnClasses = (columns2) => {
|
|
1519
|
+
switch (columns2) {
|
|
1520
|
+
case 1:
|
|
1521
|
+
return "grid-cols-1";
|
|
1522
|
+
case 2:
|
|
1523
|
+
return "grid-cols-2";
|
|
1524
|
+
case 4:
|
|
1525
|
+
return "grid-cols-4";
|
|
1526
|
+
case 5:
|
|
1527
|
+
return "grid-cols-5";
|
|
1528
|
+
case 6:
|
|
1529
|
+
return "grid-cols-6";
|
|
1530
|
+
default:
|
|
1531
|
+
return "grid-cols-3";
|
|
1532
|
+
}
|
|
1533
|
+
};
|
|
1534
|
+
const getGapClasses = (gap2) => {
|
|
1535
|
+
switch (gap2) {
|
|
1536
|
+
case "sm":
|
|
1537
|
+
return "gap-2";
|
|
1538
|
+
case "lg":
|
|
1539
|
+
return "gap-6";
|
|
1540
|
+
case "xl":
|
|
1541
|
+
return "gap-8";
|
|
1542
|
+
default:
|
|
1543
|
+
return "gap-4";
|
|
1544
|
+
}
|
|
1545
|
+
};
|
|
1546
|
+
const getRowGapClasses = (rowGap2) => {
|
|
1547
|
+
switch (rowGap2) {
|
|
1548
|
+
case "sm":
|
|
1549
|
+
return "gap-y-2";
|
|
1550
|
+
case "lg":
|
|
1551
|
+
return "gap-y-6";
|
|
1552
|
+
case "xl":
|
|
1553
|
+
return "gap-y-8";
|
|
1554
|
+
default:
|
|
1555
|
+
return "gap-y-4";
|
|
1556
|
+
}
|
|
1557
|
+
};
|
|
1558
|
+
const getPrintOptimizedClasses = () => {
|
|
1559
|
+
if (!printOptimized) return "";
|
|
1560
|
+
return cn(
|
|
1561
|
+
"print:grid-cols-2",
|
|
1562
|
+
"print:gap-2",
|
|
1563
|
+
"print:break-inside-avoid"
|
|
1564
|
+
);
|
|
1565
|
+
};
|
|
1566
|
+
return /* @__PURE__ */ jsx19(
|
|
1567
|
+
"div",
|
|
1568
|
+
{
|
|
1569
|
+
className: cn(
|
|
1570
|
+
"print-card-grid",
|
|
1571
|
+
"grid",
|
|
1572
|
+
getColumnClasses(columns),
|
|
1573
|
+
getGapClasses(gap),
|
|
1574
|
+
getRowGapClasses(rowGap),
|
|
1575
|
+
getPrintOptimizedClasses(),
|
|
1576
|
+
className
|
|
1577
|
+
),
|
|
1578
|
+
...props,
|
|
1579
|
+
children
|
|
1580
|
+
}
|
|
1581
|
+
);
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
// src/components/PrintSection/PrintSection.tsx
|
|
1585
|
+
init_cn();
|
|
1586
|
+
import { jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1587
|
+
function PrintSection({
|
|
1588
|
+
children,
|
|
1589
|
+
title,
|
|
1590
|
+
subtitle,
|
|
1591
|
+
layout = "single",
|
|
1592
|
+
gap = "md",
|
|
1593
|
+
spacing = "md",
|
|
1594
|
+
showBorder = false,
|
|
1595
|
+
background = "transparent",
|
|
1596
|
+
printOptimized = true,
|
|
1597
|
+
className,
|
|
1598
|
+
...props
|
|
1599
|
+
}) {
|
|
1600
|
+
const getLayoutClasses = (layout2) => {
|
|
1601
|
+
switch (layout2) {
|
|
1602
|
+
case "two-column":
|
|
1603
|
+
return "grid grid-cols-2";
|
|
1604
|
+
case "three-column":
|
|
1605
|
+
return "grid grid-cols-3";
|
|
1606
|
+
case "four-column":
|
|
1607
|
+
return "grid grid-cols-4";
|
|
1608
|
+
default:
|
|
1609
|
+
return "block";
|
|
1610
|
+
}
|
|
1611
|
+
};
|
|
1612
|
+
const getGapClasses = (gap2) => {
|
|
1613
|
+
switch (gap2) {
|
|
1614
|
+
case "sm":
|
|
1615
|
+
return "gap-2";
|
|
1616
|
+
case "lg":
|
|
1617
|
+
return "gap-6";
|
|
1618
|
+
case "xl":
|
|
1619
|
+
return "gap-8";
|
|
1620
|
+
default:
|
|
1621
|
+
return "gap-4";
|
|
1622
|
+
}
|
|
1623
|
+
};
|
|
1624
|
+
const getSpacingClasses = (spacing2) => {
|
|
1625
|
+
switch (spacing2) {
|
|
1626
|
+
case "none":
|
|
1627
|
+
return "py-0";
|
|
1628
|
+
case "sm":
|
|
1629
|
+
return "py-2";
|
|
1630
|
+
case "lg":
|
|
1631
|
+
return "py-6";
|
|
1632
|
+
case "xl":
|
|
1633
|
+
return "py-8";
|
|
1634
|
+
default:
|
|
1635
|
+
return "py-4";
|
|
1636
|
+
}
|
|
1637
|
+
};
|
|
1638
|
+
const getBackgroundClasses = (background2) => {
|
|
1639
|
+
switch (background2) {
|
|
1640
|
+
case "white":
|
|
1641
|
+
return "bg-background";
|
|
1642
|
+
case "gray":
|
|
1643
|
+
return "bg-muted";
|
|
1644
|
+
case "primary":
|
|
1645
|
+
return "bg-primary text-primary-foreground";
|
|
1646
|
+
case "secondary":
|
|
1647
|
+
return "bg-secondary text-secondary-foreground";
|
|
1648
|
+
default:
|
|
1649
|
+
return "bg-transparent";
|
|
1650
|
+
}
|
|
1651
|
+
};
|
|
1652
|
+
const getBorderClasses = () => {
|
|
1653
|
+
if (!showBorder) return "";
|
|
1654
|
+
return "border border-border rounded-lg p-4";
|
|
1655
|
+
};
|
|
1656
|
+
const getPrintOptimizedClasses = () => {
|
|
1657
|
+
if (!printOptimized) return "";
|
|
1658
|
+
return cn(
|
|
1659
|
+
"print:break-inside-avoid",
|
|
1660
|
+
"print:mb-4",
|
|
1661
|
+
"print:border-black",
|
|
1662
|
+
"print:bg-white",
|
|
1663
|
+
"print:text-black"
|
|
1664
|
+
);
|
|
1665
|
+
};
|
|
1666
|
+
return /* @__PURE__ */ jsxs12(
|
|
1667
|
+
"section",
|
|
1668
|
+
{
|
|
1669
|
+
className: cn(
|
|
1670
|
+
"print-section",
|
|
1671
|
+
getLayoutClasses(layout),
|
|
1672
|
+
getGapClasses(gap),
|
|
1673
|
+
getSpacingClasses(spacing),
|
|
1674
|
+
getBackgroundClasses(background),
|
|
1675
|
+
getBorderClasses(),
|
|
1676
|
+
getPrintOptimizedClasses(),
|
|
1677
|
+
className
|
|
1678
|
+
),
|
|
1679
|
+
...props,
|
|
1680
|
+
children: [
|
|
1681
|
+
title && /* @__PURE__ */ jsxs12("div", { className: "mb-4", children: [
|
|
1682
|
+
/* @__PURE__ */ jsx20(PrintText, { variant: "heading", weight: "semibold", children: title }),
|
|
1683
|
+
subtitle && /* @__PURE__ */ jsx20(PrintText, { variant: "caption", color: "muted", className: "mt-1", children: subtitle })
|
|
1684
|
+
] }),
|
|
1685
|
+
children
|
|
1686
|
+
]
|
|
1687
|
+
}
|
|
1688
|
+
);
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
// src/components/PrintSection/PrintSectionHeader.tsx
|
|
1692
|
+
init_cn();
|
|
1693
|
+
import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1694
|
+
function PrintSectionHeader({
|
|
1695
|
+
children,
|
|
1696
|
+
title,
|
|
1697
|
+
subtitle,
|
|
1698
|
+
level = 2,
|
|
1699
|
+
align = "left",
|
|
1700
|
+
showDivider = false,
|
|
1701
|
+
printOptimized = true,
|
|
1702
|
+
className,
|
|
1703
|
+
...props
|
|
1704
|
+
}) {
|
|
1705
|
+
const getAlignmentClasses = (align2) => {
|
|
1706
|
+
switch (align2) {
|
|
1707
|
+
case "center":
|
|
1708
|
+
return "text-center";
|
|
1709
|
+
case "right":
|
|
1710
|
+
return "text-right";
|
|
1711
|
+
default:
|
|
1712
|
+
return "text-left";
|
|
1713
|
+
}
|
|
1714
|
+
};
|
|
1715
|
+
const getDividerClasses = () => {
|
|
1716
|
+
if (!showDivider) return "";
|
|
1717
|
+
return "border-b border-border pb-2 mb-4";
|
|
1718
|
+
};
|
|
1719
|
+
const getPrintOptimizedClasses = () => {
|
|
1720
|
+
if (!printOptimized) return "";
|
|
1721
|
+
return cn(
|
|
1722
|
+
"print:break-after-avoid",
|
|
1723
|
+
"print:mb-2",
|
|
1724
|
+
"print:border-black"
|
|
1725
|
+
);
|
|
1726
|
+
};
|
|
1727
|
+
const getHeadingVariant = (level2) => {
|
|
1728
|
+
switch (level2) {
|
|
1729
|
+
case 1:
|
|
1730
|
+
return "heading";
|
|
1731
|
+
case 2:
|
|
1732
|
+
return "heading";
|
|
1733
|
+
case 3:
|
|
1734
|
+
return "subheading";
|
|
1735
|
+
case 4:
|
|
1736
|
+
return "subheading";
|
|
1737
|
+
case 5:
|
|
1738
|
+
return "body";
|
|
1739
|
+
case 6:
|
|
1740
|
+
return "body";
|
|
1741
|
+
default:
|
|
1742
|
+
return "heading";
|
|
1743
|
+
}
|
|
1744
|
+
};
|
|
1745
|
+
const HeadingTag = `h${level}`;
|
|
1746
|
+
return /* @__PURE__ */ jsxs13(
|
|
1747
|
+
HeadingTag,
|
|
1748
|
+
{
|
|
1749
|
+
className: cn(
|
|
1750
|
+
"print-section-header",
|
|
1751
|
+
"mb-4",
|
|
1752
|
+
getAlignmentClasses(align),
|
|
1753
|
+
getDividerClasses(),
|
|
1754
|
+
getPrintOptimizedClasses(),
|
|
1755
|
+
className
|
|
1756
|
+
),
|
|
1757
|
+
...props,
|
|
1758
|
+
children: [
|
|
1759
|
+
title && /* @__PURE__ */ jsx21(PrintText, { variant: getHeadingVariant(level), weight: "semibold", children: title }),
|
|
1760
|
+
subtitle && /* @__PURE__ */ jsx21(PrintText, { variant: "caption", color: "muted", className: "mt-1", children: subtitle }),
|
|
1761
|
+
children
|
|
1762
|
+
]
|
|
1763
|
+
}
|
|
1764
|
+
);
|
|
1765
|
+
}
|
|
1766
|
+
|
|
1767
|
+
// src/components/PrintSection/PrintSectionContent.tsx
|
|
1768
|
+
init_cn();
|
|
1769
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1770
|
+
function PrintSectionContent({
|
|
1771
|
+
children,
|
|
1772
|
+
padding = "md",
|
|
1773
|
+
background = "transparent",
|
|
1774
|
+
printOptimized = true,
|
|
1775
|
+
className,
|
|
1776
|
+
...props
|
|
1777
|
+
}) {
|
|
1778
|
+
const getPaddingClasses = (padding2) => {
|
|
1779
|
+
switch (padding2) {
|
|
1780
|
+
case "none":
|
|
1781
|
+
return "p-0";
|
|
1782
|
+
case "sm":
|
|
1783
|
+
return "p-2";
|
|
1784
|
+
case "lg":
|
|
1785
|
+
return "p-6";
|
|
1786
|
+
default:
|
|
1787
|
+
return "p-4";
|
|
1788
|
+
}
|
|
1789
|
+
};
|
|
1790
|
+
const getBackgroundClasses = (background2) => {
|
|
1791
|
+
switch (background2) {
|
|
1792
|
+
case "white":
|
|
1793
|
+
return "bg-background";
|
|
1794
|
+
case "gray":
|
|
1795
|
+
return "bg-muted";
|
|
1796
|
+
case "primary":
|
|
1797
|
+
return "bg-primary text-primary-foreground";
|
|
1798
|
+
case "secondary":
|
|
1799
|
+
return "bg-secondary text-secondary-foreground";
|
|
1800
|
+
default:
|
|
1801
|
+
return "bg-transparent";
|
|
1802
|
+
}
|
|
1803
|
+
};
|
|
1804
|
+
const getPrintOptimizedClasses = () => {
|
|
1805
|
+
if (!printOptimized) return "";
|
|
1806
|
+
return cn(
|
|
1807
|
+
"print:break-inside-avoid",
|
|
1808
|
+
"print:text-sm",
|
|
1809
|
+
"print:leading-tight",
|
|
1810
|
+
"print:bg-white",
|
|
1811
|
+
"print:text-black"
|
|
1812
|
+
);
|
|
1813
|
+
};
|
|
1814
|
+
return /* @__PURE__ */ jsx22(
|
|
1815
|
+
"div",
|
|
1816
|
+
{
|
|
1817
|
+
className: cn(
|
|
1818
|
+
"print-section-content",
|
|
1819
|
+
getPaddingClasses(padding),
|
|
1820
|
+
getBackgroundClasses(background),
|
|
1821
|
+
getPrintOptimizedClasses(),
|
|
1822
|
+
className
|
|
1823
|
+
),
|
|
1824
|
+
...props,
|
|
1825
|
+
children
|
|
1826
|
+
}
|
|
1827
|
+
);
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1830
|
+
// src/components/PrintSection/PrintColumn.tsx
|
|
1831
|
+
init_cn();
|
|
1832
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1833
|
+
function PrintColumn({
|
|
1834
|
+
children,
|
|
1835
|
+
width = "auto",
|
|
1836
|
+
align = "left",
|
|
1837
|
+
verticalAlign = "top",
|
|
1838
|
+
padding = "md",
|
|
1839
|
+
printOptimized = true,
|
|
1840
|
+
className,
|
|
1841
|
+
...props
|
|
1842
|
+
}) {
|
|
1843
|
+
const getWidthClasses = (width2) => {
|
|
1844
|
+
switch (width2) {
|
|
1845
|
+
case "1/2":
|
|
1846
|
+
return "col-span-1";
|
|
1847
|
+
case "1/3":
|
|
1848
|
+
return "col-span-1";
|
|
1849
|
+
case "2/3":
|
|
1850
|
+
return "col-span-2";
|
|
1851
|
+
case "1/4":
|
|
1852
|
+
return "col-span-1";
|
|
1853
|
+
case "3/4":
|
|
1854
|
+
return "col-span-3";
|
|
1855
|
+
case "full":
|
|
1856
|
+
return "col-span-full";
|
|
1857
|
+
default:
|
|
1858
|
+
return "";
|
|
1859
|
+
}
|
|
1860
|
+
};
|
|
1861
|
+
const getAlignmentClasses = (align2) => {
|
|
1862
|
+
switch (align2) {
|
|
1863
|
+
case "center":
|
|
1864
|
+
return "text-center";
|
|
1865
|
+
case "right":
|
|
1866
|
+
return "text-right";
|
|
1867
|
+
default:
|
|
1868
|
+
return "text-left";
|
|
1869
|
+
}
|
|
1870
|
+
};
|
|
1871
|
+
const getVerticalAlignmentClasses = (verticalAlign2) => {
|
|
1872
|
+
switch (verticalAlign2) {
|
|
1873
|
+
case "middle":
|
|
1874
|
+
return "flex items-center";
|
|
1875
|
+
case "bottom":
|
|
1876
|
+
return "flex items-end";
|
|
1877
|
+
default:
|
|
1878
|
+
return "flex items-start";
|
|
1879
|
+
}
|
|
1880
|
+
};
|
|
1881
|
+
const getPaddingClasses = (padding2) => {
|
|
1882
|
+
switch (padding2) {
|
|
1883
|
+
case "none":
|
|
1884
|
+
return "p-0";
|
|
1885
|
+
case "sm":
|
|
1886
|
+
return "p-2";
|
|
1887
|
+
case "lg":
|
|
1888
|
+
return "p-6";
|
|
1889
|
+
default:
|
|
1890
|
+
return "p-4";
|
|
1891
|
+
}
|
|
1892
|
+
};
|
|
1893
|
+
const getPrintOptimizedClasses = () => {
|
|
1894
|
+
if (!printOptimized) return "";
|
|
1895
|
+
return cn(
|
|
1896
|
+
"print:break-inside-avoid",
|
|
1897
|
+
"print:mb-2",
|
|
1898
|
+
"print:text-sm",
|
|
1899
|
+
"print:leading-tight"
|
|
1900
|
+
);
|
|
1901
|
+
};
|
|
1902
|
+
return /* @__PURE__ */ jsx23(
|
|
1903
|
+
"div",
|
|
1904
|
+
{
|
|
1905
|
+
className: cn(
|
|
1906
|
+
"print-column",
|
|
1907
|
+
getWidthClasses(width),
|
|
1908
|
+
getAlignmentClasses(align),
|
|
1909
|
+
getVerticalAlignmentClasses(verticalAlign),
|
|
1910
|
+
getPaddingClasses(padding),
|
|
1911
|
+
getPrintOptimizedClasses(),
|
|
1912
|
+
className
|
|
1913
|
+
),
|
|
1914
|
+
...props,
|
|
1915
|
+
children
|
|
1916
|
+
}
|
|
1917
|
+
);
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
// src/components/PrintSection/PrintDivider.tsx
|
|
1921
|
+
init_cn();
|
|
1922
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1923
|
+
function PrintDivider({
|
|
1924
|
+
style = "solid",
|
|
1925
|
+
color = "default",
|
|
1926
|
+
thickness = "thin",
|
|
1927
|
+
spacing = "md",
|
|
1928
|
+
printOptimized = true,
|
|
1929
|
+
className,
|
|
1930
|
+
...props
|
|
1931
|
+
}) {
|
|
1932
|
+
const getStyleClasses = (style2) => {
|
|
1933
|
+
switch (style2) {
|
|
1934
|
+
case "dashed":
|
|
1935
|
+
return "border-dashed";
|
|
1936
|
+
case "dotted":
|
|
1937
|
+
return "border-dotted";
|
|
1938
|
+
case "thick":
|
|
1939
|
+
return "border-solid border-4";
|
|
1940
|
+
default:
|
|
1941
|
+
return "border-solid";
|
|
1942
|
+
}
|
|
1943
|
+
};
|
|
1944
|
+
const getColorClasses = (color2) => {
|
|
1945
|
+
switch (color2) {
|
|
1946
|
+
case "muted":
|
|
1947
|
+
return "border-muted-foreground";
|
|
1948
|
+
case "primary":
|
|
1949
|
+
return "border-primary";
|
|
1950
|
+
case "secondary":
|
|
1951
|
+
return "border-secondary";
|
|
1952
|
+
case "accent":
|
|
1953
|
+
return "border-accent";
|
|
1954
|
+
default:
|
|
1955
|
+
return "border-border";
|
|
1956
|
+
}
|
|
1957
|
+
};
|
|
1958
|
+
const getThicknessClasses = (thickness2, style2) => {
|
|
1959
|
+
if (style2 === "thick") return "";
|
|
1960
|
+
switch (thickness2) {
|
|
1961
|
+
case "medium":
|
|
1962
|
+
return "border-2";
|
|
1963
|
+
case "thick":
|
|
1964
|
+
return "border-4";
|
|
1965
|
+
default:
|
|
1966
|
+
return "border";
|
|
1967
|
+
}
|
|
1968
|
+
};
|
|
1969
|
+
const getSpacingClasses = (spacing2) => {
|
|
1970
|
+
switch (spacing2) {
|
|
1971
|
+
case "none":
|
|
1972
|
+
return "my-0";
|
|
1973
|
+
case "sm":
|
|
1974
|
+
return "my-2";
|
|
1975
|
+
case "lg":
|
|
1976
|
+
return "my-6";
|
|
1977
|
+
default:
|
|
1978
|
+
return "my-4";
|
|
1979
|
+
}
|
|
1980
|
+
};
|
|
1981
|
+
const getPrintOptimizedClasses = () => {
|
|
1982
|
+
if (!printOptimized) return "";
|
|
1983
|
+
return cn(
|
|
1984
|
+
"print:border-black",
|
|
1985
|
+
"print:break-inside-avoid"
|
|
1986
|
+
);
|
|
1987
|
+
};
|
|
1988
|
+
return /* @__PURE__ */ jsx24(
|
|
1989
|
+
"hr",
|
|
1990
|
+
{
|
|
1991
|
+
className: cn(
|
|
1992
|
+
"print-divider",
|
|
1993
|
+
"border-t",
|
|
1994
|
+
getStyleClasses(style),
|
|
1995
|
+
getColorClasses(color),
|
|
1996
|
+
getThicknessClasses(thickness, style),
|
|
1997
|
+
getSpacingClasses(spacing),
|
|
1998
|
+
getPrintOptimizedClasses(),
|
|
1999
|
+
className
|
|
2000
|
+
),
|
|
2001
|
+
...props
|
|
2002
|
+
}
|
|
2003
|
+
);
|
|
2004
|
+
}
|
|
2005
|
+
|
|
2006
|
+
// src/components/PrintButton/PrintButton.tsx
|
|
2007
|
+
init_cn();
|
|
2008
|
+
import { useState as useState4 } from "react";
|
|
2009
|
+
import { jsx as jsx25, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2010
|
+
function PrintButton({
|
|
2011
|
+
children,
|
|
2012
|
+
variant = "primary",
|
|
2013
|
+
size = "md",
|
|
2014
|
+
shape = "default",
|
|
2015
|
+
state = "default",
|
|
2016
|
+
printFunction = "print",
|
|
2017
|
+
printSelector,
|
|
2018
|
+
printOptions = {},
|
|
2019
|
+
onClick,
|
|
2020
|
+
onPrint,
|
|
2021
|
+
onPrintStart,
|
|
2022
|
+
onPrintEnd,
|
|
2023
|
+
showIcon = true,
|
|
2024
|
+
icon,
|
|
2025
|
+
iconPosition = "left",
|
|
2026
|
+
fullWidth = false,
|
|
2027
|
+
printOptimized = true,
|
|
2028
|
+
className,
|
|
2029
|
+
...props
|
|
2030
|
+
}) {
|
|
2031
|
+
const [isPrinting, setIsPrinting] = useState4(false);
|
|
2032
|
+
const getVariantClasses = (variant2) => {
|
|
2033
|
+
switch (variant2) {
|
|
2034
|
+
case "secondary":
|
|
2035
|
+
return "bg-secondary text-secondary-foreground hover:bg-secondary/80";
|
|
2036
|
+
case "outline":
|
|
2037
|
+
return "border border-input bg-background hover:bg-accent hover:text-accent-foreground";
|
|
2038
|
+
case "ghost":
|
|
2039
|
+
return "hover:bg-accent hover:text-accent-foreground";
|
|
2040
|
+
case "destructive":
|
|
2041
|
+
return "bg-destructive text-destructive-foreground hover:bg-destructive/90";
|
|
2042
|
+
default:
|
|
2043
|
+
return "bg-primary text-primary-foreground hover:bg-primary/90";
|
|
2044
|
+
}
|
|
2045
|
+
};
|
|
2046
|
+
const getSizeClasses = (size2) => {
|
|
2047
|
+
switch (size2) {
|
|
2048
|
+
case "sm":
|
|
2049
|
+
return "h-8 px-3 text-xs";
|
|
2050
|
+
case "lg":
|
|
2051
|
+
return "h-12 px-8 text-base";
|
|
2052
|
+
case "xl":
|
|
2053
|
+
return "h-14 px-10 text-lg";
|
|
2054
|
+
default:
|
|
2055
|
+
return "h-10 px-4 text-sm";
|
|
2056
|
+
}
|
|
2057
|
+
};
|
|
2058
|
+
const getShapeClasses = (shape2) => {
|
|
2059
|
+
switch (shape2) {
|
|
2060
|
+
case "rounded":
|
|
2061
|
+
return "rounded-lg";
|
|
2062
|
+
case "pill":
|
|
2063
|
+
return "rounded-full";
|
|
2064
|
+
case "square":
|
|
2065
|
+
return "rounded-none";
|
|
2066
|
+
default:
|
|
2067
|
+
return "rounded-md";
|
|
2068
|
+
}
|
|
2069
|
+
};
|
|
2070
|
+
const getStateClasses = (state2) => {
|
|
2071
|
+
switch (state2) {
|
|
2072
|
+
case "loading":
|
|
2073
|
+
return "opacity-50 cursor-not-allowed";
|
|
2074
|
+
case "disabled":
|
|
2075
|
+
return "opacity-50 cursor-not-allowed pointer-events-none";
|
|
2076
|
+
default:
|
|
2077
|
+
return "cursor-pointer";
|
|
2078
|
+
}
|
|
2079
|
+
};
|
|
2080
|
+
const getPrintOptimizedClasses = () => {
|
|
2081
|
+
if (!printOptimized) return "";
|
|
2082
|
+
return cn(
|
|
2083
|
+
"print:hidden",
|
|
2084
|
+
"print:opacity-0",
|
|
2085
|
+
"print:pointer-events-none"
|
|
2086
|
+
);
|
|
2087
|
+
};
|
|
2088
|
+
const getDefaultIcon = () => {
|
|
2089
|
+
if (icon) return icon;
|
|
2090
|
+
switch (printFunction) {
|
|
2091
|
+
case "printSelection":
|
|
2092
|
+
return "\u{1F4C4}";
|
|
2093
|
+
case "printPage":
|
|
2094
|
+
return "\u{1F4C3}";
|
|
2095
|
+
case "printElement":
|
|
2096
|
+
return "\u{1F3AF}";
|
|
2097
|
+
default:
|
|
2098
|
+
return "\u{1F5A8}\uFE0F";
|
|
2099
|
+
}
|
|
2100
|
+
};
|
|
2101
|
+
const handlePrint = async () => {
|
|
2102
|
+
if (isPrinting || state === "disabled" || state === "loading") return;
|
|
2103
|
+
setIsPrinting(true);
|
|
2104
|
+
onPrintStart?.();
|
|
2105
|
+
try {
|
|
2106
|
+
switch (printFunction) {
|
|
2107
|
+
case "print":
|
|
2108
|
+
await printDocument(printOptions);
|
|
2109
|
+
break;
|
|
2110
|
+
case "printSelection":
|
|
2111
|
+
if (printSelector) {
|
|
2112
|
+
await printSelection(printSelector, printOptions);
|
|
2113
|
+
}
|
|
2114
|
+
break;
|
|
2115
|
+
case "printPage":
|
|
2116
|
+
await printPage(printOptions);
|
|
2117
|
+
break;
|
|
2118
|
+
case "printElement":
|
|
2119
|
+
if (printSelector) {
|
|
2120
|
+
await printElement(printSelector, printOptions);
|
|
2121
|
+
}
|
|
2122
|
+
break;
|
|
2123
|
+
}
|
|
2124
|
+
onPrint?.(true);
|
|
2125
|
+
} catch (error) {
|
|
2126
|
+
onPrint?.(false, error);
|
|
2127
|
+
} finally {
|
|
2128
|
+
setIsPrinting(false);
|
|
2129
|
+
onPrintEnd?.();
|
|
2130
|
+
}
|
|
2131
|
+
};
|
|
2132
|
+
const handleClick = (event) => {
|
|
2133
|
+
if (printFunction) {
|
|
2134
|
+
event.preventDefault();
|
|
2135
|
+
handlePrint();
|
|
2136
|
+
}
|
|
2137
|
+
onClick?.(event);
|
|
2138
|
+
};
|
|
2139
|
+
const isDisabled = state === "disabled" || state === "loading" || isPrinting;
|
|
2140
|
+
return /* @__PURE__ */ jsxs14(
|
|
2141
|
+
"button",
|
|
2142
|
+
{
|
|
2143
|
+
type: "button",
|
|
2144
|
+
className: cn(
|
|
2145
|
+
"print-button",
|
|
2146
|
+
"inline-flex",
|
|
2147
|
+
"items-center",
|
|
2148
|
+
"justify-center",
|
|
2149
|
+
"whitespace-nowrap",
|
|
2150
|
+
"font-medium",
|
|
2151
|
+
"ring-offset-background",
|
|
2152
|
+
"transition-colors",
|
|
2153
|
+
"focus-visible:outline-none",
|
|
2154
|
+
"focus-visible:ring-2",
|
|
2155
|
+
"focus-visible:ring-ring",
|
|
2156
|
+
"focus-visible:ring-offset-2",
|
|
2157
|
+
"disabled:pointer-events-none",
|
|
2158
|
+
"disabled:opacity-50",
|
|
2159
|
+
getVariantClasses(variant),
|
|
2160
|
+
getSizeClasses(size),
|
|
2161
|
+
getShapeClasses(shape),
|
|
2162
|
+
getStateClasses(state),
|
|
2163
|
+
fullWidth && "w-full",
|
|
2164
|
+
getPrintOptimizedClasses(),
|
|
2165
|
+
className
|
|
2166
|
+
),
|
|
2167
|
+
disabled: isDisabled,
|
|
2168
|
+
onClick: handleClick,
|
|
2169
|
+
...props,
|
|
2170
|
+
children: [
|
|
2171
|
+
showIcon && iconPosition === "left" && /* @__PURE__ */ jsx25("span", { className: "mr-2", children: getDefaultIcon() }),
|
|
2172
|
+
children,
|
|
2173
|
+
showIcon && iconPosition === "right" && /* @__PURE__ */ jsx25("span", { className: "ml-2", children: getDefaultIcon() })
|
|
2174
|
+
]
|
|
2175
|
+
}
|
|
2176
|
+
);
|
|
2177
|
+
}
|
|
2178
|
+
async function printDocument(options) {
|
|
2179
|
+
return new Promise((resolve, reject) => {
|
|
2180
|
+
try {
|
|
2181
|
+
if (options.stylesheetUrl) {
|
|
2182
|
+
const link = document.createElement("link");
|
|
2183
|
+
link.rel = "stylesheet";
|
|
2184
|
+
link.href = options.stylesheetUrl;
|
|
2185
|
+
link.media = options.mediaQuery || "print";
|
|
2186
|
+
document.head.appendChild(link);
|
|
2187
|
+
}
|
|
2188
|
+
const printWindow = window.open("", "_blank");
|
|
2189
|
+
if (!printWindow) {
|
|
2190
|
+
reject(new Error("Unable to open print window"));
|
|
2191
|
+
return;
|
|
2192
|
+
}
|
|
2193
|
+
printWindow.document.write(`
|
|
2194
|
+
<html>
|
|
2195
|
+
<head>
|
|
2196
|
+
<title>${options.title || "Print Document"}</title>
|
|
2197
|
+
<style>
|
|
2198
|
+
@page {
|
|
2199
|
+
margin: ${options.margins?.top || "0.5in"} ${options.margins?.right || "0.5in"} ${options.margins?.bottom || "0.5in"} ${options.margins?.left || "0.5in"};
|
|
2200
|
+
size: ${options.orientation === "landscape" ? "A4 landscape" : "A4 portrait"};
|
|
2201
|
+
}
|
|
2202
|
+
body {
|
|
2203
|
+
font-family: Arial, sans-serif;
|
|
2204
|
+
line-height: 1.4;
|
|
2205
|
+
color: #000;
|
|
2206
|
+
background: #fff;
|
|
2207
|
+
}
|
|
2208
|
+
@media print {
|
|
2209
|
+
* { -webkit-print-color-adjust: ${options.colorAdjust || "exact"}; }
|
|
2210
|
+
}
|
|
2211
|
+
</style>
|
|
2212
|
+
</head>
|
|
2213
|
+
<body>
|
|
2214
|
+
${document.documentElement.outerHTML}
|
|
2215
|
+
</body>
|
|
2216
|
+
</html>
|
|
2217
|
+
`);
|
|
2218
|
+
printWindow.document.close();
|
|
2219
|
+
printWindow.focus();
|
|
2220
|
+
printWindow.print();
|
|
2221
|
+
printWindow.close();
|
|
2222
|
+
resolve();
|
|
2223
|
+
} catch (error) {
|
|
2224
|
+
reject(error);
|
|
2225
|
+
}
|
|
2226
|
+
});
|
|
2227
|
+
}
|
|
2228
|
+
async function printSelection(selector, options) {
|
|
2229
|
+
const element = document.querySelector(selector);
|
|
2230
|
+
if (!element) {
|
|
2231
|
+
throw new Error(`Element with selector "${selector}" not found`);
|
|
2232
|
+
}
|
|
2233
|
+
return printElement(selector, options);
|
|
2234
|
+
}
|
|
2235
|
+
async function printPage(options) {
|
|
2236
|
+
return printDocument(options);
|
|
2237
|
+
}
|
|
2238
|
+
async function printElement(selector, options) {
|
|
2239
|
+
const element = document.querySelector(selector);
|
|
2240
|
+
if (!element) {
|
|
2241
|
+
throw new Error(`Element with selector "${selector}" not found`);
|
|
2242
|
+
}
|
|
2243
|
+
return new Promise((resolve, reject) => {
|
|
2244
|
+
try {
|
|
2245
|
+
const printWindow = window.open("", "_blank");
|
|
2246
|
+
if (!printWindow) {
|
|
2247
|
+
reject(new Error("Unable to open print window"));
|
|
2248
|
+
return;
|
|
2249
|
+
}
|
|
2250
|
+
printWindow.document.write(`
|
|
2251
|
+
<html>
|
|
2252
|
+
<head>
|
|
2253
|
+
<title>${options.title || "Print Element"}</title>
|
|
2254
|
+
<style>
|
|
2255
|
+
@page {
|
|
2256
|
+
margin: ${options.margins?.top || "0.5in"} ${options.margins?.right || "0.5in"} ${options.margins?.bottom || "0.5in"} ${options.margins?.left || "0.5in"};
|
|
2257
|
+
size: ${options.orientation === "landscape" ? "A4 landscape" : "A4 portrait"};
|
|
2258
|
+
}
|
|
2259
|
+
body {
|
|
2260
|
+
font-family: Arial, sans-serif;
|
|
2261
|
+
line-height: 1.4;
|
|
2262
|
+
color: #000;
|
|
2263
|
+
background: #fff;
|
|
2264
|
+
}
|
|
2265
|
+
@media print {
|
|
2266
|
+
* { -webkit-print-color-adjust: ${options.colorAdjust || "exact"}; }
|
|
2267
|
+
}
|
|
2268
|
+
</style>
|
|
2269
|
+
</head>
|
|
2270
|
+
<body>
|
|
2271
|
+
${element.outerHTML}
|
|
2272
|
+
</body>
|
|
2273
|
+
</html>
|
|
2274
|
+
`);
|
|
2275
|
+
printWindow.document.close();
|
|
2276
|
+
printWindow.focus();
|
|
2277
|
+
printWindow.print();
|
|
2278
|
+
printWindow.close();
|
|
2279
|
+
resolve();
|
|
2280
|
+
} catch (error) {
|
|
2281
|
+
reject(error);
|
|
2282
|
+
}
|
|
2283
|
+
});
|
|
2284
|
+
}
|
|
2285
|
+
|
|
2286
|
+
// src/components/PrintButton/PrintButtonGroup.tsx
|
|
2287
|
+
init_cn();
|
|
2288
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
2289
|
+
function PrintButtonGroup({
|
|
2290
|
+
children,
|
|
2291
|
+
orientation = "horizontal",
|
|
2292
|
+
spacing = "md",
|
|
2293
|
+
align = "left",
|
|
2294
|
+
printOptimized = true,
|
|
2295
|
+
className,
|
|
2296
|
+
...props
|
|
2297
|
+
}) {
|
|
2298
|
+
const getOrientationClasses = (orientation2) => {
|
|
2299
|
+
switch (orientation2) {
|
|
2300
|
+
case "vertical":
|
|
2301
|
+
return "flex-col";
|
|
2302
|
+
default:
|
|
2303
|
+
return "flex-row";
|
|
2304
|
+
}
|
|
2305
|
+
};
|
|
2306
|
+
const getSpacingClasses = (spacing2) => {
|
|
2307
|
+
switch (spacing2) {
|
|
2308
|
+
case "none":
|
|
2309
|
+
return "gap-0";
|
|
2310
|
+
case "sm":
|
|
2311
|
+
return "gap-2";
|
|
2312
|
+
case "lg":
|
|
2313
|
+
return "gap-6";
|
|
2314
|
+
default:
|
|
2315
|
+
return "gap-4";
|
|
2316
|
+
}
|
|
2317
|
+
};
|
|
2318
|
+
const getAlignmentClasses = (align2) => {
|
|
2319
|
+
switch (align2) {
|
|
2320
|
+
case "center":
|
|
2321
|
+
return "justify-center";
|
|
2322
|
+
case "right":
|
|
2323
|
+
return "justify-end";
|
|
2324
|
+
case "stretch":
|
|
2325
|
+
return "justify-stretch";
|
|
2326
|
+
default:
|
|
2327
|
+
return "justify-start";
|
|
2328
|
+
}
|
|
2329
|
+
};
|
|
2330
|
+
const getPrintOptimizedClasses = () => {
|
|
2331
|
+
if (!printOptimized) return "";
|
|
2332
|
+
return cn(
|
|
2333
|
+
"print:hidden",
|
|
2334
|
+
"print:opacity-0",
|
|
2335
|
+
"print:pointer-events-none"
|
|
2336
|
+
);
|
|
2337
|
+
};
|
|
2338
|
+
return /* @__PURE__ */ jsx26(
|
|
2339
|
+
"div",
|
|
2340
|
+
{
|
|
2341
|
+
className: cn(
|
|
2342
|
+
"print-button-group",
|
|
2343
|
+
"flex",
|
|
2344
|
+
"items-center",
|
|
2345
|
+
getOrientationClasses(orientation),
|
|
2346
|
+
getSpacingClasses(spacing),
|
|
2347
|
+
getAlignmentClasses(align),
|
|
2348
|
+
getPrintOptimizedClasses(),
|
|
2349
|
+
className
|
|
2350
|
+
),
|
|
2351
|
+
...props,
|
|
2352
|
+
children
|
|
2353
|
+
}
|
|
2354
|
+
);
|
|
2355
|
+
}
|
|
2356
|
+
|
|
2357
|
+
// src/components/PrintButton/PrintToolbar.tsx
|
|
2358
|
+
init_cn();
|
|
2359
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
2360
|
+
function PrintToolbar({
|
|
2361
|
+
children,
|
|
2362
|
+
position = "top",
|
|
2363
|
+
align = "left",
|
|
2364
|
+
showOnPrint = false,
|
|
2365
|
+
printOptimized = true,
|
|
2366
|
+
className,
|
|
2367
|
+
...props
|
|
2368
|
+
}) {
|
|
2369
|
+
const getPositionClasses = (position2) => {
|
|
2370
|
+
switch (position2) {
|
|
2371
|
+
case "bottom":
|
|
2372
|
+
return "fixed bottom-0 left-0 right-0";
|
|
2373
|
+
case "fixed":
|
|
2374
|
+
return "fixed top-4 right-4";
|
|
2375
|
+
default:
|
|
2376
|
+
return "relative";
|
|
2377
|
+
}
|
|
2378
|
+
};
|
|
2379
|
+
const getAlignmentClasses = (align2) => {
|
|
2380
|
+
switch (align2) {
|
|
2381
|
+
case "center":
|
|
2382
|
+
return "justify-center";
|
|
2383
|
+
case "right":
|
|
2384
|
+
return "justify-end";
|
|
2385
|
+
default:
|
|
2386
|
+
return "justify-start";
|
|
2387
|
+
}
|
|
2388
|
+
};
|
|
2389
|
+
const getPrintOptimizedClasses = () => {
|
|
2390
|
+
if (!printOptimized) return "";
|
|
2391
|
+
if (showOnPrint) {
|
|
2392
|
+
return cn(
|
|
2393
|
+
"print:block",
|
|
2394
|
+
"print:opacity-100",
|
|
2395
|
+
"print:pointer-events-auto"
|
|
2396
|
+
);
|
|
2397
|
+
} else {
|
|
2398
|
+
return cn(
|
|
2399
|
+
"print:hidden",
|
|
2400
|
+
"print:opacity-0",
|
|
2401
|
+
"print:pointer-events-none"
|
|
2402
|
+
);
|
|
2403
|
+
}
|
|
2404
|
+
};
|
|
2405
|
+
const getZIndexClasses = () => {
|
|
2406
|
+
if (position === "fixed" || position === "bottom") {
|
|
2407
|
+
return "z-50";
|
|
2408
|
+
}
|
|
2409
|
+
return "";
|
|
2410
|
+
};
|
|
2411
|
+
return /* @__PURE__ */ jsx27(
|
|
2412
|
+
"div",
|
|
2413
|
+
{
|
|
2414
|
+
className: cn(
|
|
2415
|
+
"print-toolbar",
|
|
2416
|
+
"flex",
|
|
2417
|
+
"items-center",
|
|
2418
|
+
"gap-2",
|
|
2419
|
+
"p-4",
|
|
2420
|
+
"bg-background",
|
|
2421
|
+
"border",
|
|
2422
|
+
"border-border",
|
|
2423
|
+
"rounded-lg",
|
|
2424
|
+
"shadow-lg",
|
|
2425
|
+
getPositionClasses(position),
|
|
2426
|
+
getAlignmentClasses(align),
|
|
2427
|
+
getZIndexClasses(),
|
|
2428
|
+
getPrintOptimizedClasses(),
|
|
2429
|
+
className
|
|
2430
|
+
),
|
|
2431
|
+
...props,
|
|
2432
|
+
children
|
|
2433
|
+
}
|
|
2434
|
+
);
|
|
2435
|
+
}
|
|
2436
|
+
|
|
2437
|
+
// src/components/PrintGrid/PrintGrid.tsx
|
|
2438
|
+
init_cn();
|
|
2439
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
2440
|
+
function PrintGrid({
|
|
2441
|
+
children,
|
|
2442
|
+
columns = 12,
|
|
2443
|
+
gap = "md",
|
|
2444
|
+
rowGap,
|
|
2445
|
+
columnGap,
|
|
2446
|
+
align = "stretch",
|
|
2447
|
+
justify = "start",
|
|
2448
|
+
printColumns,
|
|
2449
|
+
printGap,
|
|
2450
|
+
printRowGap,
|
|
2451
|
+
printColumnGap,
|
|
2452
|
+
printOptimized = true,
|
|
2453
|
+
className,
|
|
2454
|
+
...props
|
|
2455
|
+
}) {
|
|
2456
|
+
const getColumnsClasses = (cols) => {
|
|
2457
|
+
switch (cols) {
|
|
2458
|
+
case 1:
|
|
2459
|
+
return "grid-cols-1";
|
|
2460
|
+
case 2:
|
|
2461
|
+
return "grid-cols-2";
|
|
2462
|
+
case 3:
|
|
2463
|
+
return "grid-cols-3";
|
|
2464
|
+
case 4:
|
|
2465
|
+
return "grid-cols-4";
|
|
2466
|
+
case 5:
|
|
2467
|
+
return "grid-cols-5";
|
|
2468
|
+
case 6:
|
|
2469
|
+
return "grid-cols-6";
|
|
2470
|
+
case 12:
|
|
2471
|
+
return "grid-cols-12";
|
|
2472
|
+
default:
|
|
2473
|
+
return "grid-cols-12";
|
|
2474
|
+
}
|
|
2475
|
+
};
|
|
2476
|
+
const getGapClasses = (gap2) => {
|
|
2477
|
+
switch (gap2) {
|
|
2478
|
+
case "none":
|
|
2479
|
+
return "gap-0";
|
|
2480
|
+
case "sm":
|
|
2481
|
+
return "gap-2";
|
|
2482
|
+
case "lg":
|
|
2483
|
+
return "gap-6";
|
|
2484
|
+
case "xl":
|
|
2485
|
+
return "gap-8";
|
|
2486
|
+
default:
|
|
2487
|
+
return "gap-4";
|
|
2488
|
+
}
|
|
2489
|
+
};
|
|
2490
|
+
const getRowGapClasses = (gap2) => {
|
|
2491
|
+
switch (gap2) {
|
|
2492
|
+
case "none":
|
|
2493
|
+
return "gap-y-0";
|
|
2494
|
+
case "sm":
|
|
2495
|
+
return "gap-y-2";
|
|
2496
|
+
case "lg":
|
|
2497
|
+
return "gap-y-6";
|
|
2498
|
+
case "xl":
|
|
2499
|
+
return "gap-y-8";
|
|
2500
|
+
default:
|
|
2501
|
+
return "gap-y-4";
|
|
2502
|
+
}
|
|
2503
|
+
};
|
|
2504
|
+
const getColumnGapClasses = (gap2) => {
|
|
2505
|
+
switch (gap2) {
|
|
2506
|
+
case "none":
|
|
2507
|
+
return "gap-x-0";
|
|
2508
|
+
case "sm":
|
|
2509
|
+
return "gap-x-2";
|
|
2510
|
+
case "lg":
|
|
2511
|
+
return "gap-x-6";
|
|
2512
|
+
case "xl":
|
|
2513
|
+
return "gap-x-8";
|
|
2514
|
+
default:
|
|
2515
|
+
return "gap-x-4";
|
|
2516
|
+
}
|
|
2517
|
+
};
|
|
2518
|
+
const getAlignmentClasses = (align2) => {
|
|
2519
|
+
switch (align2) {
|
|
2520
|
+
case "start":
|
|
2521
|
+
return "items-start";
|
|
2522
|
+
case "center":
|
|
2523
|
+
return "items-center";
|
|
2524
|
+
case "end":
|
|
2525
|
+
return "items-end";
|
|
2526
|
+
default:
|
|
2527
|
+
return "items-stretch";
|
|
2528
|
+
}
|
|
2529
|
+
};
|
|
2530
|
+
const getJustifyClasses = (justify2) => {
|
|
2531
|
+
switch (justify2) {
|
|
2532
|
+
case "center":
|
|
2533
|
+
return "justify-center";
|
|
2534
|
+
case "end":
|
|
2535
|
+
return "justify-end";
|
|
2536
|
+
case "between":
|
|
2537
|
+
return "justify-between";
|
|
2538
|
+
case "around":
|
|
2539
|
+
return "justify-around";
|
|
2540
|
+
case "evenly":
|
|
2541
|
+
return "justify-evenly";
|
|
2542
|
+
default:
|
|
2543
|
+
return "justify-start";
|
|
2544
|
+
}
|
|
2545
|
+
};
|
|
2546
|
+
const getPrintOptimizedClasses = () => {
|
|
2547
|
+
if (!printOptimized) return "";
|
|
2548
|
+
return cn(
|
|
2549
|
+
"print:break-inside-avoid",
|
|
2550
|
+
"print:mb-4"
|
|
2551
|
+
);
|
|
2552
|
+
};
|
|
2553
|
+
const getPrintColumnsClasses = () => {
|
|
2554
|
+
if (!printColumns) return "";
|
|
2555
|
+
return cn(
|
|
2556
|
+
"print:grid",
|
|
2557
|
+
`print:${getColumnsClasses(printColumns)}`
|
|
2558
|
+
);
|
|
2559
|
+
};
|
|
2560
|
+
const getPrintGapClasses = () => {
|
|
2561
|
+
if (!printGap) return "";
|
|
2562
|
+
return `print:${getGapClasses(printGap)}`;
|
|
2563
|
+
};
|
|
2564
|
+
const getPrintRowGapClasses = () => {
|
|
2565
|
+
if (!printRowGap) return "";
|
|
2566
|
+
return `print:${getRowGapClasses(printRowGap)}`;
|
|
2567
|
+
};
|
|
2568
|
+
const getPrintColumnGapClasses = () => {
|
|
2569
|
+
if (!printColumnGap) return "";
|
|
2570
|
+
return `print:${getColumnGapClasses(printColumnGap)}`;
|
|
2571
|
+
};
|
|
2572
|
+
return /* @__PURE__ */ jsx28(
|
|
2573
|
+
"div",
|
|
2574
|
+
{
|
|
2575
|
+
className: cn(
|
|
2576
|
+
"print-grid",
|
|
2577
|
+
"grid",
|
|
2578
|
+
getColumnsClasses(columns),
|
|
2579
|
+
getGapClasses(gap),
|
|
2580
|
+
rowGap && getRowGapClasses(rowGap),
|
|
2581
|
+
columnGap && getColumnGapClasses(columnGap),
|
|
2582
|
+
getAlignmentClasses(align),
|
|
2583
|
+
getJustifyClasses(justify),
|
|
2584
|
+
getPrintOptimizedClasses(),
|
|
2585
|
+
getPrintColumnsClasses(),
|
|
2586
|
+
getPrintGapClasses(),
|
|
2587
|
+
getPrintRowGapClasses(),
|
|
2588
|
+
getPrintColumnGapClasses(),
|
|
2589
|
+
className
|
|
2590
|
+
),
|
|
2591
|
+
...props,
|
|
2592
|
+
children
|
|
2593
|
+
}
|
|
2594
|
+
);
|
|
2595
|
+
}
|
|
2596
|
+
|
|
2597
|
+
// src/components/PrintGrid/PrintGridItem.tsx
|
|
2598
|
+
init_cn();
|
|
2599
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
2600
|
+
function PrintGridItem({
|
|
2601
|
+
children,
|
|
2602
|
+
colSpan = 1,
|
|
2603
|
+
rowSpan = 1,
|
|
2604
|
+
colStart,
|
|
2605
|
+
rowStart,
|
|
2606
|
+
align = "stretch",
|
|
2607
|
+
justify = "start",
|
|
2608
|
+
printColSpan,
|
|
2609
|
+
printRowSpan,
|
|
2610
|
+
printColStart,
|
|
2611
|
+
printRowStart,
|
|
2612
|
+
printOptimized = true,
|
|
2613
|
+
className,
|
|
2614
|
+
...props
|
|
2615
|
+
}) {
|
|
2616
|
+
const getColSpanClasses = (span) => {
|
|
2617
|
+
if (span === "full") return "col-span-full";
|
|
2618
|
+
switch (span) {
|
|
2619
|
+
case 1:
|
|
2620
|
+
return "col-span-1";
|
|
2621
|
+
case 2:
|
|
2622
|
+
return "col-span-2";
|
|
2623
|
+
case 3:
|
|
2624
|
+
return "col-span-3";
|
|
2625
|
+
case 4:
|
|
2626
|
+
return "col-span-4";
|
|
2627
|
+
case 5:
|
|
2628
|
+
return "col-span-5";
|
|
2629
|
+
case 6:
|
|
2630
|
+
return "col-span-6";
|
|
2631
|
+
case 12:
|
|
2632
|
+
return "col-span-12";
|
|
2633
|
+
default:
|
|
2634
|
+
return "col-span-1";
|
|
2635
|
+
}
|
|
2636
|
+
};
|
|
2637
|
+
const getRowSpanClasses = (span) => {
|
|
2638
|
+
if (span === "full") return "row-span-full";
|
|
2639
|
+
switch (span) {
|
|
2640
|
+
case 1:
|
|
2641
|
+
return "row-span-1";
|
|
2642
|
+
case 2:
|
|
2643
|
+
return "row-span-2";
|
|
2644
|
+
case 3:
|
|
2645
|
+
return "row-span-3";
|
|
2646
|
+
case 4:
|
|
2647
|
+
return "row-span-4";
|
|
2648
|
+
case 5:
|
|
2649
|
+
return "row-span-5";
|
|
2650
|
+
case 6:
|
|
2651
|
+
return "row-span-6";
|
|
2652
|
+
default:
|
|
2653
|
+
return "row-span-1";
|
|
2654
|
+
}
|
|
2655
|
+
};
|
|
2656
|
+
const getColStartClasses = (start) => {
|
|
2657
|
+
if (start === "auto") return "col-start-auto";
|
|
2658
|
+
switch (start) {
|
|
2659
|
+
case 1:
|
|
2660
|
+
return "col-start-1";
|
|
2661
|
+
case 2:
|
|
2662
|
+
return "col-start-2";
|
|
2663
|
+
case 3:
|
|
2664
|
+
return "col-start-3";
|
|
2665
|
+
case 4:
|
|
2666
|
+
return "col-start-4";
|
|
2667
|
+
case 5:
|
|
2668
|
+
return "col-start-5";
|
|
2669
|
+
case 6:
|
|
2670
|
+
return "col-start-6";
|
|
2671
|
+
case 7:
|
|
2672
|
+
return "col-start-7";
|
|
2673
|
+
case 8:
|
|
2674
|
+
return "col-start-8";
|
|
2675
|
+
case 9:
|
|
2676
|
+
return "col-start-9";
|
|
2677
|
+
case 10:
|
|
2678
|
+
return "col-start-10";
|
|
2679
|
+
case 11:
|
|
2680
|
+
return "col-start-11";
|
|
2681
|
+
case 12:
|
|
2682
|
+
return "col-start-12";
|
|
2683
|
+
case 13:
|
|
2684
|
+
return "col-start-13";
|
|
2685
|
+
default:
|
|
2686
|
+
return "col-start-auto";
|
|
2687
|
+
}
|
|
2688
|
+
};
|
|
2689
|
+
const getRowStartClasses = (start) => {
|
|
2690
|
+
if (start === "auto") return "row-start-auto";
|
|
2691
|
+
switch (start) {
|
|
2692
|
+
case 1:
|
|
2693
|
+
return "row-start-1";
|
|
2694
|
+
case 2:
|
|
2695
|
+
return "row-start-2";
|
|
2696
|
+
case 3:
|
|
2697
|
+
return "row-start-3";
|
|
2698
|
+
case 4:
|
|
2699
|
+
return "row-start-4";
|
|
2700
|
+
case 5:
|
|
2701
|
+
return "row-start-5";
|
|
2702
|
+
case 6:
|
|
2703
|
+
return "row-start-6";
|
|
2704
|
+
case 7:
|
|
2705
|
+
return "row-start-7";
|
|
2706
|
+
case 8:
|
|
2707
|
+
return "row-start-8";
|
|
2708
|
+
case 9:
|
|
2709
|
+
return "row-start-9";
|
|
2710
|
+
case 10:
|
|
2711
|
+
return "row-start-10";
|
|
2712
|
+
case 11:
|
|
2713
|
+
return "row-start-11";
|
|
2714
|
+
case 12:
|
|
2715
|
+
return "row-start-12";
|
|
2716
|
+
case 13:
|
|
2717
|
+
return "row-start-13";
|
|
2718
|
+
default:
|
|
2719
|
+
return "row-start-auto";
|
|
2720
|
+
}
|
|
2721
|
+
};
|
|
2722
|
+
const getAlignmentClasses = (align2) => {
|
|
2723
|
+
switch (align2) {
|
|
2724
|
+
case "start":
|
|
2725
|
+
return "self-start";
|
|
2726
|
+
case "center":
|
|
2727
|
+
return "self-center";
|
|
2728
|
+
case "end":
|
|
2729
|
+
return "self-end";
|
|
2730
|
+
default:
|
|
2731
|
+
return "self-stretch";
|
|
2732
|
+
}
|
|
2733
|
+
};
|
|
2734
|
+
const getJustifyClasses = (justify2) => {
|
|
2735
|
+
switch (justify2) {
|
|
2736
|
+
case "center":
|
|
2737
|
+
return "justify-self-center";
|
|
2738
|
+
case "end":
|
|
2739
|
+
return "justify-self-end";
|
|
2740
|
+
case "stretch":
|
|
2741
|
+
return "justify-self-stretch";
|
|
2742
|
+
default:
|
|
2743
|
+
return "justify-self-start";
|
|
2744
|
+
}
|
|
2745
|
+
};
|
|
2746
|
+
const getPrintOptimizedClasses = () => {
|
|
2747
|
+
if (!printOptimized) return "";
|
|
2748
|
+
return cn(
|
|
2749
|
+
"print:break-inside-avoid",
|
|
2750
|
+
"print:mb-2"
|
|
2751
|
+
);
|
|
2752
|
+
};
|
|
2753
|
+
const getPrintColSpanClasses = () => {
|
|
2754
|
+
if (!printColSpan) return "";
|
|
2755
|
+
return `print:${getColSpanClasses(printColSpan)}`;
|
|
2756
|
+
};
|
|
2757
|
+
const getPrintRowSpanClasses = () => {
|
|
2758
|
+
if (!printRowSpan) return "";
|
|
2759
|
+
return `print:${getRowSpanClasses(printRowSpan)}`;
|
|
2760
|
+
};
|
|
2761
|
+
const getPrintColStartClasses = () => {
|
|
2762
|
+
if (!printColStart) return "";
|
|
2763
|
+
return `print:${getColStartClasses(printColStart)}`;
|
|
2764
|
+
};
|
|
2765
|
+
const getPrintRowStartClasses = () => {
|
|
2766
|
+
if (!printRowStart) return "";
|
|
2767
|
+
return `print:${getRowStartClasses(printRowStart)}`;
|
|
2768
|
+
};
|
|
2769
|
+
return /* @__PURE__ */ jsx29(
|
|
2770
|
+
"div",
|
|
2771
|
+
{
|
|
2772
|
+
className: cn(
|
|
2773
|
+
"print-grid-item",
|
|
2774
|
+
getColSpanClasses(colSpan),
|
|
2775
|
+
getRowSpanClasses(rowSpan),
|
|
2776
|
+
colStart && getColStartClasses(colStart),
|
|
2777
|
+
rowStart && getRowStartClasses(rowStart),
|
|
2778
|
+
getAlignmentClasses(align),
|
|
2779
|
+
getJustifyClasses(justify),
|
|
2780
|
+
getPrintOptimizedClasses(),
|
|
2781
|
+
getPrintColSpanClasses(),
|
|
2782
|
+
getPrintRowSpanClasses(),
|
|
2783
|
+
getPrintColStartClasses(),
|
|
2784
|
+
getPrintRowStartClasses(),
|
|
2785
|
+
className
|
|
2786
|
+
),
|
|
2787
|
+
...props,
|
|
2788
|
+
children
|
|
2789
|
+
}
|
|
2790
|
+
);
|
|
2791
|
+
}
|
|
2792
|
+
|
|
2793
|
+
// src/components/PrintGrid/PrintGridContainer.tsx
|
|
2794
|
+
init_cn();
|
|
2795
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
2796
|
+
function PrintGridContainer({
|
|
2797
|
+
children,
|
|
2798
|
+
maxWidth = "full",
|
|
2799
|
+
padding = "md",
|
|
2800
|
+
margin = "none",
|
|
2801
|
+
background = "transparent",
|
|
2802
|
+
printOptimized = true,
|
|
2803
|
+
className,
|
|
2804
|
+
...props
|
|
2805
|
+
}) {
|
|
2806
|
+
const getMaxWidthClasses = (maxWidth2) => {
|
|
2807
|
+
switch (maxWidth2) {
|
|
2808
|
+
case "sm":
|
|
2809
|
+
return "max-w-sm";
|
|
2810
|
+
case "md":
|
|
2811
|
+
return "max-w-md";
|
|
2812
|
+
case "lg":
|
|
2813
|
+
return "max-w-lg";
|
|
2814
|
+
case "xl":
|
|
2815
|
+
return "max-w-xl";
|
|
2816
|
+
case "2xl":
|
|
2817
|
+
return "max-w-2xl";
|
|
2818
|
+
case "3xl":
|
|
2819
|
+
return "max-w-3xl";
|
|
2820
|
+
case "4xl":
|
|
2821
|
+
return "max-w-4xl";
|
|
2822
|
+
case "5xl":
|
|
2823
|
+
return "max-w-5xl";
|
|
2824
|
+
case "6xl":
|
|
2825
|
+
return "max-w-6xl";
|
|
2826
|
+
case "7xl":
|
|
2827
|
+
return "max-w-7xl";
|
|
2828
|
+
case "full":
|
|
2829
|
+
return "max-w-full";
|
|
2830
|
+
default:
|
|
2831
|
+
return "max-w-full";
|
|
2832
|
+
}
|
|
2833
|
+
};
|
|
2834
|
+
const getPaddingClasses = (padding2) => {
|
|
2835
|
+
switch (padding2) {
|
|
2836
|
+
case "none":
|
|
2837
|
+
return "p-0";
|
|
2838
|
+
case "sm":
|
|
2839
|
+
return "p-2";
|
|
2840
|
+
case "lg":
|
|
2841
|
+
return "p-6";
|
|
2842
|
+
case "xl":
|
|
2843
|
+
return "p-8";
|
|
2844
|
+
default:
|
|
2845
|
+
return "p-4";
|
|
2846
|
+
}
|
|
2847
|
+
};
|
|
2848
|
+
const getMarginClasses = (margin2) => {
|
|
2849
|
+
switch (margin2) {
|
|
2850
|
+
case "none":
|
|
2851
|
+
return "m-0";
|
|
2852
|
+
case "sm":
|
|
2853
|
+
return "m-2";
|
|
2854
|
+
case "md":
|
|
2855
|
+
return "m-4";
|
|
2856
|
+
case "lg":
|
|
2857
|
+
return "m-6";
|
|
2858
|
+
case "xl":
|
|
2859
|
+
return "m-8";
|
|
2860
|
+
case "auto":
|
|
2861
|
+
return "mx-auto";
|
|
2862
|
+
default:
|
|
2863
|
+
return "m-0";
|
|
2864
|
+
}
|
|
2865
|
+
};
|
|
2866
|
+
const getBackgroundClasses = (background2) => {
|
|
2867
|
+
switch (background2) {
|
|
2868
|
+
case "white":
|
|
2869
|
+
return "bg-background";
|
|
2870
|
+
case "gray":
|
|
2871
|
+
return "bg-muted";
|
|
2872
|
+
case "primary":
|
|
2873
|
+
return "bg-primary text-primary-foreground";
|
|
2874
|
+
case "secondary":
|
|
2875
|
+
return "bg-secondary text-secondary-foreground";
|
|
2876
|
+
default:
|
|
2877
|
+
return "bg-transparent";
|
|
2878
|
+
}
|
|
2879
|
+
};
|
|
2880
|
+
const getPrintOptimizedClasses = () => {
|
|
2881
|
+
if (!printOptimized) return "";
|
|
2882
|
+
return cn(
|
|
2883
|
+
"print:max-w-full",
|
|
2884
|
+
"print:break-inside-avoid",
|
|
2885
|
+
"print:mb-4"
|
|
2886
|
+
);
|
|
2887
|
+
};
|
|
2888
|
+
return /* @__PURE__ */ jsx30(
|
|
2889
|
+
"div",
|
|
2890
|
+
{
|
|
2891
|
+
className: cn(
|
|
2892
|
+
"print-grid-container",
|
|
2893
|
+
"w-full",
|
|
2894
|
+
getMaxWidthClasses(maxWidth),
|
|
2895
|
+
getPaddingClasses(padding),
|
|
2896
|
+
getMarginClasses(margin),
|
|
2897
|
+
getBackgroundClasses(background),
|
|
2898
|
+
getPrintOptimizedClasses(),
|
|
2899
|
+
className
|
|
2900
|
+
),
|
|
2901
|
+
...props,
|
|
2902
|
+
children
|
|
2903
|
+
}
|
|
2904
|
+
);
|
|
2905
|
+
}
|
|
2906
|
+
|
|
2907
|
+
// src/components/PrintGrid/PrintGridBreakpoint.tsx
|
|
2908
|
+
init_cn();
|
|
2909
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2910
|
+
function PrintGridBreakpoint({
|
|
2911
|
+
children,
|
|
2912
|
+
size = "md",
|
|
2913
|
+
columns = 12,
|
|
2914
|
+
gap = "md",
|
|
2915
|
+
printOptimized = true,
|
|
2916
|
+
className,
|
|
2917
|
+
...props
|
|
2918
|
+
}) {
|
|
2919
|
+
const getSizeClasses = (size2) => {
|
|
2920
|
+
switch (size2) {
|
|
2921
|
+
case "sm":
|
|
2922
|
+
return "sm:";
|
|
2923
|
+
case "md":
|
|
2924
|
+
return "md:";
|
|
2925
|
+
case "lg":
|
|
2926
|
+
return "lg:";
|
|
2927
|
+
case "xl":
|
|
2928
|
+
return "xl:";
|
|
2929
|
+
case "2xl":
|
|
2930
|
+
return "2xl:";
|
|
2931
|
+
default:
|
|
2932
|
+
return "md:";
|
|
2933
|
+
}
|
|
2934
|
+
};
|
|
2935
|
+
const getColumnsClasses = (cols) => {
|
|
2936
|
+
switch (cols) {
|
|
2937
|
+
case 1:
|
|
2938
|
+
return "grid-cols-1";
|
|
2939
|
+
case 2:
|
|
2940
|
+
return "grid-cols-2";
|
|
2941
|
+
case 3:
|
|
2942
|
+
return "grid-cols-3";
|
|
2943
|
+
case 4:
|
|
2944
|
+
return "grid-cols-4";
|
|
2945
|
+
case 5:
|
|
2946
|
+
return "grid-cols-5";
|
|
2947
|
+
case 6:
|
|
2948
|
+
return "grid-cols-6";
|
|
2949
|
+
case 12:
|
|
2950
|
+
return "grid-cols-12";
|
|
2951
|
+
default:
|
|
2952
|
+
return "grid-cols-12";
|
|
2953
|
+
}
|
|
2954
|
+
};
|
|
2955
|
+
const getGapClasses = (gap2) => {
|
|
2956
|
+
switch (gap2) {
|
|
2957
|
+
case "none":
|
|
2958
|
+
return "gap-0";
|
|
2959
|
+
case "sm":
|
|
2960
|
+
return "gap-2";
|
|
2961
|
+
case "lg":
|
|
2962
|
+
return "gap-6";
|
|
2963
|
+
case "xl":
|
|
2964
|
+
return "gap-8";
|
|
2965
|
+
default:
|
|
2966
|
+
return "gap-4";
|
|
2967
|
+
}
|
|
2968
|
+
};
|
|
2969
|
+
const getPrintOptimizedClasses = () => {
|
|
2970
|
+
if (!printOptimized) return "";
|
|
2971
|
+
return cn(
|
|
2972
|
+
"print:break-inside-avoid",
|
|
2973
|
+
"print:mb-4"
|
|
2974
|
+
);
|
|
2975
|
+
};
|
|
2976
|
+
const getResponsiveClasses = () => {
|
|
2977
|
+
const sizePrefix = getSizeClasses(size);
|
|
2978
|
+
const columnsClass = getColumnsClasses(columns);
|
|
2979
|
+
const gapClass = getGapClasses(gap);
|
|
2980
|
+
return cn(
|
|
2981
|
+
`${sizePrefix}grid`,
|
|
2982
|
+
`${sizePrefix}${columnsClass}`,
|
|
2983
|
+
`${sizePrefix}${gapClass}`
|
|
2984
|
+
);
|
|
2985
|
+
};
|
|
2986
|
+
return /* @__PURE__ */ jsx31(
|
|
2987
|
+
"div",
|
|
2988
|
+
{
|
|
2989
|
+
className: cn(
|
|
2990
|
+
"print-grid-breakpoint",
|
|
2991
|
+
getResponsiveClasses(),
|
|
2992
|
+
getPrintOptimizedClasses(),
|
|
2993
|
+
className
|
|
2994
|
+
),
|
|
2995
|
+
...props,
|
|
2996
|
+
children
|
|
2997
|
+
}
|
|
2998
|
+
);
|
|
2999
|
+
}
|
|
3000
|
+
|
|
3001
|
+
// src/components/PrintFooter/PrintFooter.tsx
|
|
3002
|
+
init_cn();
|
|
3003
|
+
|
|
3004
|
+
// src/components/PrintFooter/PrintPageNumber.tsx
|
|
3005
|
+
init_cn();
|
|
3006
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
3007
|
+
function PrintPageNumber({
|
|
3008
|
+
children,
|
|
3009
|
+
format = "1",
|
|
3010
|
+
template,
|
|
3011
|
+
position = "right",
|
|
3012
|
+
showTotal = false,
|
|
3013
|
+
currentPage = 1,
|
|
3014
|
+
totalPages = 1,
|
|
3015
|
+
printOptimized = true,
|
|
3016
|
+
className,
|
|
3017
|
+
...props
|
|
3018
|
+
}) {
|
|
3019
|
+
const getPositionClasses = (position2) => {
|
|
3020
|
+
switch (position2) {
|
|
3021
|
+
case "left":
|
|
3022
|
+
return "justify-start";
|
|
3023
|
+
case "center":
|
|
3024
|
+
return "justify-center";
|
|
3025
|
+
default:
|
|
3026
|
+
return "justify-end";
|
|
3027
|
+
}
|
|
3028
|
+
};
|
|
3029
|
+
const getPrintOptimizedClasses = () => {
|
|
3030
|
+
if (!printOptimized) return "";
|
|
3031
|
+
return cn(
|
|
3032
|
+
"print:break-inside-avoid",
|
|
3033
|
+
"print:text-sm",
|
|
3034
|
+
"print:font-medium"
|
|
3035
|
+
);
|
|
3036
|
+
};
|
|
3037
|
+
const formatPageNumber = () => {
|
|
3038
|
+
if (template) {
|
|
3039
|
+
return template.replace("{current}", currentPage.toString()).replace("{total}", totalPages.toString()).replace("{page}", currentPage.toString());
|
|
3040
|
+
}
|
|
3041
|
+
switch (format) {
|
|
3042
|
+
case "1 of 5":
|
|
3043
|
+
return `${currentPage} of ${totalPages}`;
|
|
3044
|
+
case "Page 1":
|
|
3045
|
+
return `Page ${currentPage}`;
|
|
3046
|
+
case "Page 1 of 5":
|
|
3047
|
+
return `Page ${currentPage} of ${totalPages}`;
|
|
3048
|
+
case "1/5":
|
|
3049
|
+
return `${currentPage}/${totalPages}`;
|
|
3050
|
+
case "custom":
|
|
3051
|
+
return template || currentPage.toString();
|
|
3052
|
+
default:
|
|
3053
|
+
return currentPage.toString();
|
|
3054
|
+
}
|
|
3055
|
+
};
|
|
3056
|
+
return /* @__PURE__ */ jsx32(
|
|
3057
|
+
"div",
|
|
3058
|
+
{
|
|
3059
|
+
className: cn(
|
|
3060
|
+
"print-page-number",
|
|
3061
|
+
"flex",
|
|
3062
|
+
"items-center",
|
|
3063
|
+
getPositionClasses(position),
|
|
3064
|
+
getPrintOptimizedClasses(),
|
|
3065
|
+
className
|
|
3066
|
+
),
|
|
3067
|
+
...props,
|
|
3068
|
+
children: children || /* @__PURE__ */ jsx32(PrintText, { variant: "small", color: "muted", children: formatPageNumber() })
|
|
3069
|
+
}
|
|
3070
|
+
);
|
|
3071
|
+
}
|
|
3072
|
+
|
|
3073
|
+
// src/components/PrintFooter/PrintFooter.tsx
|
|
3074
|
+
import { jsx as jsx33, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3075
|
+
function PrintFooter({
|
|
3076
|
+
children,
|
|
3077
|
+
text,
|
|
3078
|
+
position = "relative",
|
|
3079
|
+
align = "center",
|
|
3080
|
+
showPageNumbers = false,
|
|
3081
|
+
pageNumberFormat = "1",
|
|
3082
|
+
pageNumberTemplate,
|
|
3083
|
+
pageNumberPosition = "right",
|
|
3084
|
+
showTotalPages = false,
|
|
3085
|
+
background = "transparent",
|
|
3086
|
+
showBorder = false,
|
|
3087
|
+
padding = "md",
|
|
3088
|
+
margin = "none",
|
|
3089
|
+
height = "auto",
|
|
3090
|
+
printOptimized = true,
|
|
3091
|
+
className,
|
|
3092
|
+
...props
|
|
3093
|
+
}) {
|
|
3094
|
+
const getPositionClasses = (position2) => {
|
|
3095
|
+
switch (position2) {
|
|
3096
|
+
case "fixed":
|
|
3097
|
+
return "fixed bottom-0 left-0 right-0";
|
|
3098
|
+
case "absolute":
|
|
3099
|
+
return "absolute bottom-0 left-0 right-0";
|
|
3100
|
+
case "sticky":
|
|
3101
|
+
return "sticky bottom-0";
|
|
3102
|
+
default:
|
|
3103
|
+
return "relative";
|
|
3104
|
+
}
|
|
3105
|
+
};
|
|
3106
|
+
const getAlignmentClasses = (align2) => {
|
|
3107
|
+
switch (align2) {
|
|
3108
|
+
case "left":
|
|
3109
|
+
return "justify-start";
|
|
3110
|
+
case "center":
|
|
3111
|
+
return "justify-center";
|
|
3112
|
+
case "right":
|
|
3113
|
+
return "justify-end";
|
|
3114
|
+
case "between":
|
|
3115
|
+
return "justify-between";
|
|
3116
|
+
case "around":
|
|
3117
|
+
return "justify-around";
|
|
3118
|
+
case "evenly":
|
|
3119
|
+
return "justify-evenly";
|
|
3120
|
+
default:
|
|
3121
|
+
return "justify-center";
|
|
3122
|
+
}
|
|
3123
|
+
};
|
|
3124
|
+
const getBackgroundClasses = (background2) => {
|
|
3125
|
+
switch (background2) {
|
|
3126
|
+
case "white":
|
|
3127
|
+
return "bg-background";
|
|
3128
|
+
case "gray":
|
|
3129
|
+
return "bg-muted";
|
|
3130
|
+
case "primary":
|
|
3131
|
+
return "bg-primary text-primary-foreground";
|
|
3132
|
+
case "secondary":
|
|
3133
|
+
return "bg-secondary text-secondary-foreground";
|
|
3134
|
+
default:
|
|
3135
|
+
return "bg-transparent";
|
|
3136
|
+
}
|
|
3137
|
+
};
|
|
3138
|
+
const getPaddingClasses = (padding2) => {
|
|
3139
|
+
switch (padding2) {
|
|
3140
|
+
case "none":
|
|
3141
|
+
return "p-0";
|
|
3142
|
+
case "sm":
|
|
3143
|
+
return "p-2";
|
|
3144
|
+
case "lg":
|
|
3145
|
+
return "p-6";
|
|
3146
|
+
case "xl":
|
|
3147
|
+
return "p-8";
|
|
3148
|
+
default:
|
|
3149
|
+
return "p-4";
|
|
3150
|
+
}
|
|
3151
|
+
};
|
|
3152
|
+
const getMarginClasses = (margin2) => {
|
|
3153
|
+
switch (margin2) {
|
|
3154
|
+
case "none":
|
|
3155
|
+
return "m-0";
|
|
3156
|
+
case "sm":
|
|
3157
|
+
return "m-2";
|
|
3158
|
+
case "md":
|
|
3159
|
+
return "m-4";
|
|
3160
|
+
case "lg":
|
|
3161
|
+
return "m-6";
|
|
3162
|
+
case "xl":
|
|
3163
|
+
return "m-8";
|
|
3164
|
+
default:
|
|
3165
|
+
return "m-0";
|
|
3166
|
+
}
|
|
3167
|
+
};
|
|
3168
|
+
const getHeightClasses = (height2) => {
|
|
3169
|
+
switch (height2) {
|
|
3170
|
+
case "sm":
|
|
3171
|
+
return "h-8";
|
|
3172
|
+
case "md":
|
|
3173
|
+
return "h-12";
|
|
3174
|
+
case "lg":
|
|
3175
|
+
return "h-16";
|
|
3176
|
+
case "xl":
|
|
3177
|
+
return "h-20";
|
|
3178
|
+
default:
|
|
3179
|
+
return "h-auto";
|
|
3180
|
+
}
|
|
3181
|
+
};
|
|
3182
|
+
const getPrintOptimizedClasses = () => {
|
|
3183
|
+
if (!printOptimized) return "";
|
|
3184
|
+
return cn(
|
|
3185
|
+
"print:break-inside-avoid",
|
|
3186
|
+
"print:mb-4",
|
|
3187
|
+
"print:border-black",
|
|
3188
|
+
"print:bg-white",
|
|
3189
|
+
"print:text-black"
|
|
3190
|
+
);
|
|
3191
|
+
};
|
|
3192
|
+
const getBorderClasses = () => {
|
|
3193
|
+
if (!showBorder) return "";
|
|
3194
|
+
return "border-t border-border";
|
|
3195
|
+
};
|
|
3196
|
+
return /* @__PURE__ */ jsxs15(
|
|
3197
|
+
"footer",
|
|
3198
|
+
{
|
|
3199
|
+
className: cn(
|
|
3200
|
+
"print-footer",
|
|
3201
|
+
"flex",
|
|
3202
|
+
"items-center",
|
|
3203
|
+
"w-full",
|
|
3204
|
+
getPositionClasses(position),
|
|
3205
|
+
getAlignmentClasses(align),
|
|
3206
|
+
getBackgroundClasses(background),
|
|
3207
|
+
getPaddingClasses(padding),
|
|
3208
|
+
getMarginClasses(margin),
|
|
3209
|
+
getHeightClasses(height),
|
|
3210
|
+
getBorderClasses(),
|
|
3211
|
+
getPrintOptimizedClasses(),
|
|
3212
|
+
className
|
|
3213
|
+
),
|
|
3214
|
+
...props,
|
|
3215
|
+
children: [
|
|
3216
|
+
text && /* @__PURE__ */ jsx33(PrintText, { variant: "small", color: "muted", children: text }),
|
|
3217
|
+
children,
|
|
3218
|
+
showPageNumbers && /* @__PURE__ */ jsx33(
|
|
3219
|
+
PrintPageNumber,
|
|
3220
|
+
{
|
|
3221
|
+
format: pageNumberFormat,
|
|
3222
|
+
template: pageNumberTemplate,
|
|
3223
|
+
position: pageNumberPosition,
|
|
3224
|
+
showTotal: showTotalPages,
|
|
3225
|
+
printOptimized
|
|
3226
|
+
}
|
|
3227
|
+
)
|
|
3228
|
+
]
|
|
3229
|
+
}
|
|
3230
|
+
);
|
|
3231
|
+
}
|
|
3232
|
+
|
|
3233
|
+
// src/components/PrintFooter/PrintFooterContent.tsx
|
|
3234
|
+
init_cn();
|
|
3235
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
3236
|
+
function PrintFooterContent({
|
|
3237
|
+
children,
|
|
3238
|
+
align = "left",
|
|
3239
|
+
padding = "none",
|
|
3240
|
+
printOptimized = true,
|
|
3241
|
+
className,
|
|
3242
|
+
...props
|
|
3243
|
+
}) {
|
|
3244
|
+
const getAlignmentClasses = (align2) => {
|
|
3245
|
+
switch (align2) {
|
|
3246
|
+
case "center":
|
|
3247
|
+
return "text-center";
|
|
3248
|
+
case "right":
|
|
3249
|
+
return "text-right";
|
|
3250
|
+
default:
|
|
3251
|
+
return "text-left";
|
|
3252
|
+
}
|
|
3253
|
+
};
|
|
3254
|
+
const getPaddingClasses = (padding2) => {
|
|
3255
|
+
switch (padding2) {
|
|
3256
|
+
case "none":
|
|
3257
|
+
return "p-0";
|
|
3258
|
+
case "sm":
|
|
3259
|
+
return "p-2";
|
|
3260
|
+
case "lg":
|
|
3261
|
+
return "p-6";
|
|
3262
|
+
case "xl":
|
|
3263
|
+
return "p-8";
|
|
3264
|
+
default:
|
|
3265
|
+
return "p-4";
|
|
3266
|
+
}
|
|
3267
|
+
};
|
|
3268
|
+
const getPrintOptimizedClasses = () => {
|
|
3269
|
+
if (!printOptimized) return "";
|
|
3270
|
+
return cn(
|
|
3271
|
+
"print:break-inside-avoid",
|
|
3272
|
+
"print:text-sm",
|
|
3273
|
+
"print:leading-tight"
|
|
3274
|
+
);
|
|
3275
|
+
};
|
|
3276
|
+
return /* @__PURE__ */ jsx34(
|
|
3277
|
+
"div",
|
|
3278
|
+
{
|
|
3279
|
+
className: cn(
|
|
3280
|
+
"print-footer-content",
|
|
3281
|
+
getAlignmentClasses(align),
|
|
3282
|
+
getPaddingClasses(padding),
|
|
3283
|
+
getPrintOptimizedClasses(),
|
|
3284
|
+
className
|
|
3285
|
+
),
|
|
3286
|
+
...props,
|
|
3287
|
+
children
|
|
3288
|
+
}
|
|
3289
|
+
);
|
|
3290
|
+
}
|
|
3291
|
+
|
|
3292
|
+
// src/components/PrintFooter/PrintFooterInfo.tsx
|
|
3293
|
+
init_cn();
|
|
3294
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
3295
|
+
function PrintFooterInfo({
|
|
3296
|
+
children,
|
|
3297
|
+
align = "left",
|
|
3298
|
+
background = "transparent",
|
|
3299
|
+
showBorder = false,
|
|
3300
|
+
printOptimized = true,
|
|
3301
|
+
className,
|
|
3302
|
+
...props
|
|
3303
|
+
}) {
|
|
3304
|
+
const getAlignmentClasses = (align2) => {
|
|
3305
|
+
switch (align2) {
|
|
3306
|
+
case "center":
|
|
3307
|
+
return "text-center";
|
|
3308
|
+
case "right":
|
|
3309
|
+
return "text-right";
|
|
3310
|
+
default:
|
|
3311
|
+
return "text-left";
|
|
3312
|
+
}
|
|
3313
|
+
};
|
|
3314
|
+
const getBackgroundClasses = (background2) => {
|
|
3315
|
+
switch (background2) {
|
|
3316
|
+
case "white":
|
|
3317
|
+
return "bg-background";
|
|
3318
|
+
case "gray":
|
|
3319
|
+
return "bg-muted";
|
|
3320
|
+
case "primary":
|
|
3321
|
+
return "bg-primary text-primary-foreground";
|
|
3322
|
+
case "secondary":
|
|
3323
|
+
return "bg-secondary text-secondary-foreground";
|
|
3324
|
+
default:
|
|
3325
|
+
return "bg-transparent";
|
|
3326
|
+
}
|
|
3327
|
+
};
|
|
3328
|
+
const getBorderClasses = () => {
|
|
3329
|
+
if (!showBorder) return "";
|
|
3330
|
+
return "border border-border rounded";
|
|
3331
|
+
};
|
|
3332
|
+
const getPrintOptimizedClasses = () => {
|
|
3333
|
+
if (!printOptimized) return "";
|
|
3334
|
+
return cn(
|
|
3335
|
+
"print:break-inside-avoid",
|
|
3336
|
+
"print:text-sm",
|
|
3337
|
+
"print:leading-tight",
|
|
3338
|
+
"print:border-black",
|
|
3339
|
+
"print:bg-white",
|
|
3340
|
+
"print:text-black"
|
|
3341
|
+
);
|
|
3342
|
+
};
|
|
3343
|
+
return /* @__PURE__ */ jsx35(
|
|
3344
|
+
"div",
|
|
3345
|
+
{
|
|
3346
|
+
className: cn(
|
|
3347
|
+
"print-footer-info",
|
|
3348
|
+
"p-3",
|
|
3349
|
+
"rounded",
|
|
3350
|
+
getAlignmentClasses(align),
|
|
3351
|
+
getBackgroundClasses(background),
|
|
3352
|
+
getBorderClasses(),
|
|
3353
|
+
getPrintOptimizedClasses(),
|
|
3354
|
+
className
|
|
3355
|
+
),
|
|
3356
|
+
...props,
|
|
3357
|
+
children: /* @__PURE__ */ jsx35(PrintText, { variant: "small", color: "muted", children })
|
|
3358
|
+
}
|
|
3359
|
+
);
|
|
3360
|
+
}
|
|
3361
|
+
|
|
3362
|
+
// src/components/PrintPageBreak/PrintPageBreak.tsx
|
|
3363
|
+
init_cn();
|
|
3364
|
+
|
|
3365
|
+
// src/components/PrintPageBreak/PrintPageBreakIndicator.tsx
|
|
3366
|
+
init_cn();
|
|
3367
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
3368
|
+
function PrintPageBreakIndicator({
|
|
3369
|
+
children,
|
|
3370
|
+
type = "line",
|
|
3371
|
+
color = "default",
|
|
3372
|
+
size = "md",
|
|
3373
|
+
printOptimized = true,
|
|
3374
|
+
className,
|
|
3375
|
+
...props
|
|
3376
|
+
}) {
|
|
3377
|
+
const getTypeClasses = () => {
|
|
3378
|
+
switch (type) {
|
|
3379
|
+
case "dotted":
|
|
3380
|
+
return "border-dotted";
|
|
3381
|
+
case "dashed":
|
|
3382
|
+
return "border-dashed";
|
|
3383
|
+
case "text":
|
|
3384
|
+
return "text-center";
|
|
3385
|
+
case "icon":
|
|
3386
|
+
return "text-center";
|
|
3387
|
+
default:
|
|
3388
|
+
return "border-solid";
|
|
3389
|
+
}
|
|
3390
|
+
};
|
|
3391
|
+
const getColorClasses = () => {
|
|
3392
|
+
switch (color) {
|
|
3393
|
+
case "primary":
|
|
3394
|
+
return "border-primary text-primary";
|
|
3395
|
+
case "secondary":
|
|
3396
|
+
return "border-secondary text-secondary";
|
|
3397
|
+
case "muted":
|
|
3398
|
+
return "border-muted-foreground text-muted-foreground";
|
|
3399
|
+
case "accent":
|
|
3400
|
+
return "border-accent text-accent";
|
|
3401
|
+
default:
|
|
3402
|
+
return "border-border text-foreground";
|
|
3403
|
+
}
|
|
3404
|
+
};
|
|
3405
|
+
const getSizeClasses = () => {
|
|
3406
|
+
switch (size) {
|
|
3407
|
+
case "sm":
|
|
3408
|
+
return "h-1 text-xs";
|
|
3409
|
+
case "lg":
|
|
3410
|
+
return "h-3 text-lg";
|
|
3411
|
+
default:
|
|
3412
|
+
return "h-2 text-sm";
|
|
3413
|
+
}
|
|
3414
|
+
};
|
|
3415
|
+
const getPrintOptimizedClasses = () => {
|
|
3416
|
+
if (!printOptimized) return "";
|
|
3417
|
+
return cn(
|
|
3418
|
+
"print:border-black",
|
|
3419
|
+
"print:text-black"
|
|
3420
|
+
);
|
|
3421
|
+
};
|
|
3422
|
+
const renderContent = () => {
|
|
3423
|
+
if (children) {
|
|
3424
|
+
return children;
|
|
3425
|
+
}
|
|
3426
|
+
switch (type) {
|
|
3427
|
+
case "text":
|
|
3428
|
+
return "--- Page Break ---";
|
|
3429
|
+
case "icon":
|
|
3430
|
+
return "\u{1F4C4}";
|
|
3431
|
+
case "line":
|
|
3432
|
+
return "--- Page Break ---";
|
|
3433
|
+
default:
|
|
3434
|
+
return "--- Page Break ---";
|
|
3435
|
+
}
|
|
3436
|
+
};
|
|
3437
|
+
const isLineType = type === "line" || type === "dotted" || type === "dashed";
|
|
3438
|
+
return /* @__PURE__ */ jsx36(
|
|
3439
|
+
"div",
|
|
3440
|
+
{
|
|
3441
|
+
className: cn(
|
|
3442
|
+
"print-page-break-indicator",
|
|
3443
|
+
"flex",
|
|
3444
|
+
"items-center",
|
|
3445
|
+
"justify-center",
|
|
3446
|
+
"w-full",
|
|
3447
|
+
getTypeClasses(),
|
|
3448
|
+
getColorClasses(),
|
|
3449
|
+
getSizeClasses(),
|
|
3450
|
+
isLineType && "border-t",
|
|
3451
|
+
getPrintOptimizedClasses(),
|
|
3452
|
+
className
|
|
3453
|
+
),
|
|
3454
|
+
...props,
|
|
3455
|
+
children: renderContent()
|
|
3456
|
+
}
|
|
3457
|
+
);
|
|
3458
|
+
}
|
|
3459
|
+
|
|
3460
|
+
// src/components/PrintPageBreak/PrintPageBreak.tsx
|
|
3461
|
+
import { jsx as jsx37, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3462
|
+
function PrintPageBreak({
|
|
3463
|
+
type = "auto",
|
|
3464
|
+
strength = "normal",
|
|
3465
|
+
showIndicator = false,
|
|
3466
|
+
indicator,
|
|
3467
|
+
label,
|
|
3468
|
+
description,
|
|
3469
|
+
printOptimized = true,
|
|
3470
|
+
className,
|
|
3471
|
+
...props
|
|
3472
|
+
}) {
|
|
3473
|
+
const getBreakClass = () => {
|
|
3474
|
+
const baseClass = "print-page-break";
|
|
3475
|
+
switch (type) {
|
|
3476
|
+
case "before":
|
|
3477
|
+
return cn(baseClass, "print-break-before");
|
|
3478
|
+
case "after":
|
|
3479
|
+
return cn(baseClass, "print-break-after");
|
|
3480
|
+
case "avoid":
|
|
3481
|
+
return cn(baseClass, "print-break-avoid");
|
|
3482
|
+
case "always":
|
|
3483
|
+
return cn(baseClass, "print-break-before print-break-after");
|
|
3484
|
+
case "left":
|
|
3485
|
+
return cn(baseClass, "print-break-before", "print:page-break-before:left");
|
|
3486
|
+
case "right":
|
|
3487
|
+
return cn(baseClass, "print-break-before", "print:page-break-before:right");
|
|
3488
|
+
default:
|
|
3489
|
+
return baseClass;
|
|
3490
|
+
}
|
|
3491
|
+
};
|
|
3492
|
+
const getStrengthClass = () => {
|
|
3493
|
+
switch (strength) {
|
|
3494
|
+
case "weak":
|
|
3495
|
+
return "print:page-break-inside:avoid";
|
|
3496
|
+
case "strong":
|
|
3497
|
+
return "print:page-break-inside:avoid print:break-inside-avoid";
|
|
3498
|
+
default:
|
|
3499
|
+
return "";
|
|
3500
|
+
}
|
|
3501
|
+
};
|
|
3502
|
+
const getPrintOptimizedClasses = () => {
|
|
3503
|
+
if (!printOptimized) return "";
|
|
3504
|
+
return cn(
|
|
3505
|
+
"print:break-inside-avoid",
|
|
3506
|
+
"print:mb-4"
|
|
3507
|
+
);
|
|
3508
|
+
};
|
|
3509
|
+
const renderIndicator = () => {
|
|
3510
|
+
if (!showIndicator) return null;
|
|
3511
|
+
if (indicator) {
|
|
3512
|
+
return indicator;
|
|
3513
|
+
}
|
|
3514
|
+
return /* @__PURE__ */ jsx37(
|
|
3515
|
+
PrintPageBreakIndicator,
|
|
3516
|
+
{
|
|
3517
|
+
type: "line",
|
|
3518
|
+
color: "muted",
|
|
3519
|
+
size: "md",
|
|
3520
|
+
printOptimized
|
|
3521
|
+
}
|
|
3522
|
+
);
|
|
3523
|
+
};
|
|
3524
|
+
const renderLabel = () => {
|
|
3525
|
+
if (!label) return null;
|
|
3526
|
+
return /* @__PURE__ */ jsx37(PrintText, { variant: "small", color: "muted", className: "text-center", children: label });
|
|
3527
|
+
};
|
|
3528
|
+
const renderDescription = () => {
|
|
3529
|
+
if (!description) return null;
|
|
3530
|
+
return /* @__PURE__ */ jsx37(PrintText, { variant: "small", color: "muted", className: "text-center mt-1", children: description });
|
|
3531
|
+
};
|
|
3532
|
+
return /* @__PURE__ */ jsxs16(
|
|
3533
|
+
"div",
|
|
3534
|
+
{
|
|
3535
|
+
className: cn(
|
|
3536
|
+
getBreakClass(),
|
|
3537
|
+
getStrengthClass(),
|
|
3538
|
+
getPrintOptimizedClasses(),
|
|
3539
|
+
className
|
|
3540
|
+
),
|
|
3541
|
+
"aria-hidden": "true",
|
|
3542
|
+
...props,
|
|
3543
|
+
children: [
|
|
3544
|
+
renderIndicator(),
|
|
3545
|
+
renderLabel(),
|
|
3546
|
+
renderDescription()
|
|
3547
|
+
]
|
|
3548
|
+
}
|
|
3549
|
+
);
|
|
3550
|
+
}
|
|
3551
|
+
|
|
3552
|
+
// src/components/PrintPageBreak/PrintPageBreakGroup.tsx
|
|
3553
|
+
init_cn();
|
|
3554
|
+
import { jsx as jsx38, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3555
|
+
function PrintPageBreakGroup({
|
|
3556
|
+
children,
|
|
3557
|
+
type = "auto",
|
|
3558
|
+
strength = "normal",
|
|
3559
|
+
label,
|
|
3560
|
+
description,
|
|
3561
|
+
printOptimized = true,
|
|
3562
|
+
className,
|
|
3563
|
+
...props
|
|
3564
|
+
}) {
|
|
3565
|
+
const getBreakClass = () => {
|
|
3566
|
+
const baseClass = "print-page-break-group";
|
|
3567
|
+
switch (type) {
|
|
3568
|
+
case "before":
|
|
3569
|
+
return cn(baseClass, "print-break-before");
|
|
3570
|
+
case "after":
|
|
3571
|
+
return cn(baseClass, "print-break-after");
|
|
3572
|
+
case "avoid":
|
|
3573
|
+
return cn(baseClass, "print-break-avoid");
|
|
3574
|
+
case "always":
|
|
3575
|
+
return cn(baseClass, "print-break-before print-break-after");
|
|
3576
|
+
case "left":
|
|
3577
|
+
return cn(baseClass, "print-break-before", "print:page-break-before:left");
|
|
3578
|
+
case "right":
|
|
3579
|
+
return cn(baseClass, "print-break-before", "print:page-break-before:right");
|
|
3580
|
+
default:
|
|
3581
|
+
return baseClass;
|
|
3582
|
+
}
|
|
3583
|
+
};
|
|
3584
|
+
const getStrengthClass = () => {
|
|
3585
|
+
switch (strength) {
|
|
3586
|
+
case "weak":
|
|
3587
|
+
return "print:page-break-inside:avoid";
|
|
3588
|
+
case "strong":
|
|
3589
|
+
return "print:page-break-inside:avoid print:break-inside-avoid";
|
|
3590
|
+
default:
|
|
3591
|
+
return "";
|
|
3592
|
+
}
|
|
3593
|
+
};
|
|
3594
|
+
const getPrintOptimizedClasses = () => {
|
|
3595
|
+
if (!printOptimized) return "";
|
|
3596
|
+
return cn(
|
|
3597
|
+
"print:break-inside-avoid",
|
|
3598
|
+
"print:mb-4"
|
|
3599
|
+
);
|
|
3600
|
+
};
|
|
3601
|
+
return /* @__PURE__ */ jsxs17(
|
|
3602
|
+
"div",
|
|
3603
|
+
{
|
|
3604
|
+
className: cn(
|
|
3605
|
+
getBreakClass(),
|
|
3606
|
+
getStrengthClass(),
|
|
3607
|
+
getPrintOptimizedClasses(),
|
|
3608
|
+
className
|
|
3609
|
+
),
|
|
3610
|
+
...props,
|
|
3611
|
+
children: [
|
|
3612
|
+
label && /* @__PURE__ */ jsx38(PrintText, { variant: "small", color: "muted", className: "mb-2", children: label }),
|
|
3613
|
+
children,
|
|
3614
|
+
description && /* @__PURE__ */ jsx38(PrintText, { variant: "small", color: "muted", className: "mt-2", children: description })
|
|
3615
|
+
]
|
|
3616
|
+
}
|
|
3617
|
+
);
|
|
3618
|
+
}
|
|
3619
|
+
export {
|
|
3620
|
+
Alert,
|
|
3621
|
+
AlertDescription,
|
|
3622
|
+
AlertTitle,
|
|
3623
|
+
Avatar,
|
|
3624
|
+
AvatarFallback,
|
|
3625
|
+
AvatarImage,
|
|
3626
|
+
Button,
|
|
3627
|
+
Card,
|
|
3628
|
+
CardActions,
|
|
3629
|
+
CardContent,
|
|
3630
|
+
CardDescription,
|
|
3631
|
+
CardFooter,
|
|
3632
|
+
CardHeader,
|
|
3633
|
+
CardTitle,
|
|
3634
|
+
Checkbox,
|
|
3635
|
+
DataTable,
|
|
3636
|
+
DefaultPublicErrorFallback,
|
|
3637
|
+
Dialog,
|
|
3638
|
+
DialogBody,
|
|
3639
|
+
DialogClose,
|
|
3640
|
+
DialogContent,
|
|
3641
|
+
DialogDescription,
|
|
3642
|
+
DialogFooter,
|
|
3643
|
+
DialogHeader,
|
|
3644
|
+
DialogOverlay,
|
|
3645
|
+
DialogPortal,
|
|
3646
|
+
DialogTitle,
|
|
3647
|
+
DialogTrigger,
|
|
3648
|
+
ErrorBoundary,
|
|
3649
|
+
EventLogo,
|
|
3650
|
+
EventLogoCompact,
|
|
3651
|
+
EventLogoLarge,
|
|
3652
|
+
EventSelector,
|
|
3653
|
+
FileUpload,
|
|
3654
|
+
Footer,
|
|
3655
|
+
Form,
|
|
3656
|
+
FormErrorSummary,
|
|
3657
|
+
FormField,
|
|
3658
|
+
FormFieldset,
|
|
3659
|
+
FormLiveRegion,
|
|
3660
|
+
Header,
|
|
3661
|
+
Input,
|
|
3662
|
+
Label,
|
|
3663
|
+
LoadingSpinner,
|
|
3664
|
+
LoginForm,
|
|
3665
|
+
NavigationMenu,
|
|
3666
|
+
OrganisationSelector,
|
|
3667
|
+
PaceAppLayout,
|
|
3668
|
+
PaceLoginPage,
|
|
3669
|
+
PasswordResetForm,
|
|
3670
|
+
PrintButton,
|
|
3671
|
+
PrintButtonGroup,
|
|
3672
|
+
PrintCard,
|
|
3673
|
+
PrintCardContent,
|
|
3674
|
+
PrintCardFooter,
|
|
3675
|
+
PrintCardGrid,
|
|
3676
|
+
PrintCardHeader,
|
|
3677
|
+
PrintCardImage,
|
|
3678
|
+
PrintColumn,
|
|
3679
|
+
PrintCoverHeader,
|
|
3680
|
+
PrintDataTable,
|
|
3681
|
+
PrintDivider,
|
|
3682
|
+
PrintFooter,
|
|
3683
|
+
PrintFooterContent,
|
|
3684
|
+
PrintFooterInfo,
|
|
3685
|
+
PrintGrid,
|
|
3686
|
+
PrintGridBreakpoint,
|
|
3687
|
+
PrintGridContainer,
|
|
3688
|
+
PrintGridItem,
|
|
3689
|
+
PrintHeader,
|
|
3690
|
+
PrintLayout,
|
|
3691
|
+
PrintLayoutProvider,
|
|
3692
|
+
PrintPageBreak,
|
|
3693
|
+
PrintPageBreakGroup,
|
|
3694
|
+
PrintPageBreakIndicator,
|
|
3695
|
+
PrintPageNumber,
|
|
3696
|
+
PrintSection,
|
|
3697
|
+
PrintSectionContent,
|
|
3698
|
+
PrintSectionHeader,
|
|
3699
|
+
PrintTableGroup,
|
|
3700
|
+
PrintTableRow,
|
|
3701
|
+
PrintText,
|
|
3702
|
+
PrintToolbar,
|
|
3703
|
+
Progress,
|
|
3704
|
+
PublicErrorBoundary,
|
|
3705
|
+
PublicLoadingSkeleton,
|
|
3706
|
+
PublicLoadingSpinner,
|
|
3707
|
+
PublicLoadingSpinnerFullPage,
|
|
3708
|
+
PublicPageContextChecker,
|
|
3709
|
+
PublicPageDebugger,
|
|
3710
|
+
PublicPageDiagnostic,
|
|
3711
|
+
PublicPageFooter,
|
|
3712
|
+
PublicPageHeader,
|
|
3713
|
+
PublicPageLayout,
|
|
3714
|
+
PublicPageProvider,
|
|
3715
|
+
Select,
|
|
3716
|
+
SelectContent,
|
|
3717
|
+
SelectGroup,
|
|
3718
|
+
SelectItem,
|
|
3719
|
+
SelectLabel,
|
|
3720
|
+
SelectSeparator,
|
|
3721
|
+
SelectTrigger,
|
|
3722
|
+
SelectValue,
|
|
3723
|
+
SuperAdminBadge,
|
|
3724
|
+
SuperAdminDebugPanel,
|
|
3725
|
+
SuperAdminGuard,
|
|
3726
|
+
Table,
|
|
3727
|
+
TableBody,
|
|
3728
|
+
TableCaption,
|
|
3729
|
+
TableCell,
|
|
3730
|
+
TableFooter,
|
|
3731
|
+
TableHead,
|
|
3732
|
+
TableHeader,
|
|
3733
|
+
TableRow,
|
|
3734
|
+
Toast,
|
|
3735
|
+
ToastAction,
|
|
3736
|
+
ToastClose,
|
|
3737
|
+
ToastDescription,
|
|
3738
|
+
ToastProvider,
|
|
3739
|
+
ToastTitle,
|
|
3740
|
+
ToastViewport,
|
|
3741
|
+
Toaster,
|
|
3742
|
+
Tooltip,
|
|
3743
|
+
TooltipContent,
|
|
3744
|
+
TooltipProvider,
|
|
3745
|
+
TooltipRoot,
|
|
3746
|
+
TooltipTrigger,
|
|
3747
|
+
UnifiedAuthProvider,
|
|
3748
|
+
UserMenu,
|
|
3749
|
+
useErrorBoundary,
|
|
3750
|
+
useFileUpload,
|
|
3751
|
+
useIsPublicPage,
|
|
3752
|
+
usePrintLayout,
|
|
3753
|
+
usePublicPageContext2 as usePublicPageContext,
|
|
3754
|
+
usePublicPageContext as usePublicPageProviderContext,
|
|
3755
|
+
useStorage,
|
|
3756
|
+
useToast,
|
|
3757
|
+
useUnifiedAuth
|
|
3758
|
+
};
|
|
3759
|
+
//# sourceMappingURL=components.js.map
|