@jmruthers/pace-core 0.6.9 → 0.6.11
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 +21 -0
- package/audit-tool/00-dependencies.cjs +46 -13
- package/audit-tool/audits/01-pace-core-compliance.cjs +96 -21
- package/audit-tool/audits/02-project-structure.cjs +74 -2
- package/audit-tool/audits/03-architecture.cjs +220 -20
- package/audit-tool/audits/04-code-quality.cjs +95 -3
- package/audit-tool/audits/05-styling.cjs +19 -7
- package/audit-tool/audits/06-security-rbac.cjs +214 -25
- package/audit-tool/audits/07-api-tech-stack.cjs +31 -15
- package/audit-tool/audits/08-testing-documentation.cjs +11 -3
- package/audit-tool/audits/09-operations.cjs +19 -7
- package/audit-tool/index.cjs +22 -11
- package/audit-tool/utils/report-utils.cjs +4 -0
- package/cursor-rules/01-pace-core-compliance.mdc +1 -0
- package/cursor-rules/02-project-structure.mdc +3 -26
- package/cursor-rules/03-architecture.mdc +3 -1
- package/cursor-rules/04-code-quality.mdc +1 -0
- package/cursor-rules/05-styling.mdc +120 -8
- package/cursor-rules/06-security-rbac.mdc +126 -2
- package/cursor-rules/07-api-tech-stack.mdc +1 -0
- package/cursor-rules/08-testing-documentation.mdc +1 -0
- package/cursor-rules/09-operations.mdc +1 -0
- package/dist/DataTable-EFYP2QLE.js +16 -0
- package/dist/InactivityServiceProvider-BbxwwDz1.d.ts +308 -0
- package/dist/UnifiedAuthProvider-Bkt_tzdS.d.ts +183 -0
- package/dist/api-BZR2CYXL.js +5 -0
- package/dist/api-result-USV1Czr-.d.ts +51 -0
- package/dist/assets/app-icons/admin_favicon.svg +462 -0
- package/dist/assets/app-icons/base_favicon.svg +85 -0
- package/dist/assets/app-icons/cake_favicon.svg +68 -0
- package/dist/assets/app-icons/core_favicon.svg +256 -0
- package/dist/assets/app-icons/gear_favicon.svg +91 -0
- package/dist/assets/app-icons/medi_favicon.svg +92 -0
- package/dist/assets/app-icons/mint_favicon.svg +83 -0
- package/dist/assets/app-icons/pace_favicon.svg +49 -0
- package/dist/assets/app-icons/pump_favicon.svg +68 -0
- package/dist/assets/app-icons/seed_favicon.svg +91 -0
- package/dist/assets/app-icons/team_favicon.svg +67 -0
- package/dist/assets/app-icons/trac_favicon.svg +112 -0
- package/dist/assets/app-icons/trip_favicon.svg +102 -0
- package/dist/audit-HI2DHUVU.js +4 -0
- package/dist/auth-JvdRVaud.d.ts +49 -0
- package/dist/chunk-2DL2WSOE.js +327 -0
- package/dist/chunk-2OEVOGGR.js +9598 -0
- package/dist/chunk-44CNXN4P.js +15 -0
- package/dist/chunk-4R3T5ENU.js +2943 -0
- package/dist/chunk-7A6IMHH2.js +2321 -0
- package/dist/chunk-BTHN5MKC.js +121 -0
- package/dist/chunk-CU2BU2MQ.js +2 -0
- package/dist/chunk-D6BMFMQZ.js +200 -0
- package/dist/chunk-DDMPHZ3D.js +58 -0
- package/dist/chunk-ENLXB7GP.js +721 -0
- package/dist/chunk-J2KQK6DG.js +2159 -0
- package/dist/chunk-KJXRL3XE.js +6434 -0
- package/dist/chunk-L5LFKKLJ.js +61 -0
- package/dist/chunk-PCSHBLPB.js +811 -0
- package/dist/chunk-QRYSEPHB.js +429 -0
- package/dist/chunk-RMLY6KB5.js +187 -0
- package/dist/chunk-SACF5YSM.js +31 -0
- package/dist/chunk-UZNAFKGW.js +125 -0
- package/dist/chunk-V7FTM2LU.js +1080 -0
- package/dist/chunk-WY6Y7KC3.js +264 -0
- package/dist/chunk-XOJME5T7.js +407 -0
- package/dist/chunk-XPFVT3GN.js +492 -0
- package/dist/chunk-YFTFFJIV.js +529 -0
- package/dist/chunk-YYTWKVHO.js +1334 -0
- package/dist/components.d.ts +12 -89
- package/dist/components.js +23 -55
- package/dist/database.generated-qkdoiVrJ.d.ts +9441 -0
- package/dist/eslint-rules/index.cjs +3 -0
- package/dist/eslint-rules/rules/03-architecture.cjs +74 -0
- package/dist/eslint-rules/rules/05-styling.cjs +507 -0
- package/dist/eslint-rules/rules/06-security-rbac.cjs +84 -0
- package/dist/event-BfCox3N2.d.ts +265 -0
- package/dist/file-reference-DU1hcawx.d.ts +164 -0
- package/dist/functions-DH45k8ec.d.ts +208 -0
- package/dist/hooks.d.ts +28 -14
- package/dist/hooks.js +90 -56
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +1 -0
- package/dist/index.d.ts +392 -155
- package/dist/index.js +337 -347
- package/dist/pagination-BW1mqywp.d.ts +201 -0
- package/dist/papaparseLoader-WG2UXQ22.js +7 -0
- package/dist/providers.d.ts +29 -14
- package/dist/providers.js +7 -5
- package/dist/rbac/eslint-rules.js +2 -2
- package/dist/rbac/index.d.ts +180 -351
- package/dist/rbac/index.js +13 -11
- package/dist/theming/runtime.d.ts +28 -5
- package/dist/theming/runtime.js +2 -2
- package/dist/timezone-BTWWXKVY.d.ts +696 -0
- package/dist/types-BE2sEHKd.d.ts +55 -0
- package/dist/types-CvOPXWWZ.d.ts +111 -0
- package/dist/types-Dr8sNhER.d.ts +50 -0
- package/dist/types.d.ts +20 -13
- package/dist/types.js +1 -0
- package/dist/usePublicPageContext-B91dGYW1.d.ts +4367 -0
- package/dist/usePublicRouteParams-BgV6VhMi.d.ts +946 -0
- package/dist/utils.d.ts +338 -156
- package/dist/utils.js +78 -60
- package/dist/validation-g5n0hDkh.d.ts +177 -0
- package/docs/api/modules.md +1226 -1094
- package/docs/api-reference/components.md +5 -5
- package/docs/api-reference/rpc-functions.md +12 -3
- package/docs/core-concepts/rbac-system.md +8 -0
- package/docs/getting-started/cursor-rules.md +17 -20
- package/docs/getting-started/dependencies.md +1 -1
- package/docs/getting-started/setup.md +235 -0
- package/docs/implementation-guides/authentication.md +27 -0
- package/docs/implementation-guides/data-tables.md +365 -10
- package/docs/migration/ApiResult-migration.md +25 -0
- package/docs/rbac/RBAC_CONTRACT.md +0 -12
- package/docs/rbac/api-reference.md +33 -31
- package/docs/standards/0-standards-overview.md +50 -15
- package/docs/standards/1-pace-core-compliance-standards.md +62 -57
- package/docs/standards/2-project-structure-standards.md +45 -90
- package/docs/standards/3-architecture-standards.md +41 -1
- package/docs/standards/4-code-quality-standards.md +26 -6
- package/docs/standards/5-styling-standards.md +35 -1
- package/docs/standards/6-security-rbac-standards.md +288 -7
- package/docs/standards/7-api-tech-stack-standards.md +116 -17
- package/docs/standards/8-testing-documentation-standards.md +31 -0
- package/docs/standards/9-operations-standards.md +19 -0
- package/docs/standards/README.md +20 -201
- package/docs/testing/README.md +10 -0
- package/docs/testing/test-setup-for-consumers.md +916 -0
- package/docs/troubleshooting/common-issues.md +17 -1
- package/docs/troubleshooting/organisation-context-setup.md +8 -0
- package/docs/troubleshooting/print-event-name-css-variable-analysis.md +217 -0
- package/eslint-config-pace-core.cjs +24 -0
- package/package.json +14 -20
- package/scripts/build-docs.js +180 -0
- package/scripts/setup.cjs +536 -0
- package/scripts/validate.cjs +480 -0
- package/src/__mocks__/lucide-react.ts +0 -2
- package/src/__tests__/helpers/component-test-utils.test.tsx +260 -0
- package/src/__tests__/helpers/optimized-test-setup.test.ts +224 -0
- package/src/__tests__/helpers/supabaseMock.test.ts +273 -0
- package/src/__tests__/helpers/test-providers.test.tsx +99 -0
- package/src/__tests__/helpers/test-providers.tsx +37 -39
- package/src/__tests__/helpers/test-utils.test.tsx +447 -0
- package/src/__tests__/helpers/timer-utils.test.ts +371 -0
- package/src/assets/app-icons/admin_favicon.svg +462 -0
- package/src/assets/app-icons/base_favicon.svg +85 -0
- package/src/assets/app-icons/cake_favicon.svg +68 -0
- package/src/assets/app-icons/core_favicon.svg +256 -0
- package/src/assets/app-icons/gear_favicon.svg +91 -0
- package/src/assets/app-icons/index.test.ts +304 -0
- package/src/assets/app-icons/index.ts +83 -0
- package/src/assets/app-icons/medi_favicon.svg +92 -0
- package/src/assets/app-icons/mint_favicon.svg +83 -0
- package/src/assets/app-icons/pace_favicon.svg +49 -0
- package/src/assets/app-icons/pump_favicon.svg +68 -0
- package/src/assets/app-icons/seed_favicon.svg +91 -0
- package/src/assets/app-icons/team_favicon.svg +67 -0
- package/src/assets/app-icons/trac_favicon.svg +112 -0
- package/src/assets/app-icons/trip_favicon.svg +102 -0
- package/src/components/AddressField/AddressField.test.tsx +379 -4
- package/src/components/AddressField/AddressField.tsx +239 -213
- package/src/components/AddressField/types.ts +2 -2
- package/src/components/Alert/Alert.test.tsx +35 -25
- package/src/components/Alert/Alert.tsx +8 -8
- package/src/components/AppSwitcher/AppSwitcher.test.tsx +1250 -0
- package/src/components/AppSwitcher/AppSwitcher.tsx +315 -0
- package/src/components/Avatar/Avatar.test.tsx +11 -1
- package/src/components/Avatar/Avatar.tsx +3 -2
- package/src/components/Badge/Badge.test.tsx +11 -1
- package/src/components/Button/Button.test.tsx +13 -3
- package/src/components/Button/Button.tsx +1 -1
- package/src/components/Calendar/Calendar.test.tsx +523 -131
- package/src/components/Calendar/Calendar.tsx +107 -488
- package/src/components/Card/Card.test.tsx +384 -258
- package/src/components/Card/Card.tsx +19 -10
- package/src/components/Checkbox/Checkbox.test.tsx +58 -174
- package/src/components/ContextSelector/ContextSelector.internals.tsx +204 -0
- package/src/components/ContextSelector/ContextSelector.test.tsx +360 -0
- package/src/components/ContextSelector/ContextSelector.tsx +66 -280
- package/src/components/ContextSelector/ContextSelector.types.ts +35 -0
- package/src/components/ContextSelector/useContextSelectorState.tsx +195 -0
- package/src/components/DataTable/AUDIT_REPORT.md +59 -44
- package/src/components/DataTable/DataTable.comprehensive.test.tsx +759 -0
- package/src/components/DataTable/DataTable.default-state.test.tsx +524 -0
- package/src/components/DataTable/DataTable.export.test.tsx +705 -0
- package/src/components/DataTable/DataTable.grouping-aggregation.test.tsx +658 -0
- package/src/components/DataTable/DataTable.hooks.test.tsx +192 -0
- package/src/components/DataTable/DataTable.select-label-display.test.tsx +485 -0
- package/src/components/DataTable/DataTable.test.tsx +787 -416
- package/src/components/DataTable/DataTable.tsx +14 -14
- package/src/components/DataTable/DataTableCore.integration.test.tsx +458 -0
- package/src/components/DataTable/DataTableCore.test-setup.ts +221 -0
- package/src/components/DataTable/DataTableCore.test.tsx +970 -0
- package/src/components/DataTable/README.md +155 -0
- package/src/components/DataTable/TESTING.md +101 -0
- package/src/components/DataTable/a11y.basic.test.tsx +788 -0
- package/src/components/DataTable/components/DataTableCore.tsx +126 -894
- package/src/components/DataTable/components/GroupingDropdown.test.tsx +621 -0
- package/src/components/DataTable/components/GroupingDropdown.tsx +2 -3
- package/src/components/DataTable/components/ImportModal.tsx +82 -408
- package/src/components/DataTable/components/ImportModalFileSection.tsx +148 -0
- package/src/components/DataTable/context/DataTableContext.test.tsx +328 -0
- package/src/components/DataTable/context/DataTableContext.tsx +13 -13
- package/src/components/DataTable/core/ColumnFactory.test.ts +403 -0
- package/src/components/DataTable/core/ColumnFactory.ts +3 -3
- package/src/components/DataTable/hooks/useColumnOrderPersistence.test.ts +516 -0
- package/src/components/DataTable/hooks/useColumnOrderPersistence.ts +12 -9
- package/src/components/DataTable/hooks/useColumnVisibilityPersistence.test.ts +256 -0
- package/src/components/DataTable/hooks/useColumnVisibilityPersistence.ts +12 -9
- package/src/components/DataTable/hooks/useDataTableConfiguration.test.ts +297 -0
- package/src/components/DataTable/hooks/useDataTableConfiguration.ts +15 -3
- package/src/components/DataTable/hooks/useDataTableDataPipeline.test.ts +270 -0
- package/src/components/DataTable/hooks/useDataTableDeletionBatching.test.ts +127 -0
- package/src/components/DataTable/hooks/useDataTableDeletionBatching.ts +106 -0
- package/src/components/DataTable/hooks/useDataTableEffectiveActions.test.ts +461 -0
- package/src/components/DataTable/hooks/useDataTableEffectiveActions.ts +238 -0
- package/src/components/DataTable/hooks/useDataTableLayoutHandlers.test.ts +296 -0
- package/src/components/DataTable/hooks/useDataTableLayoutHandlers.ts +175 -0
- package/src/components/DataTable/hooks/useDataTablePaginationSync.test.ts +203 -0
- package/src/components/DataTable/hooks/useDataTablePaginationSync.ts +109 -0
- package/src/components/DataTable/hooks/useDataTablePermissions.test.ts +280 -0
- package/src/components/DataTable/hooks/useDataTablePermissions.ts +81 -260
- package/src/components/DataTable/hooks/useDataTablePipeline.test.tsx +219 -0
- package/src/components/DataTable/hooks/useDataTablePipeline.tsx +239 -0
- package/src/components/DataTable/hooks/useDataTableRenderGuard.test.tsx +316 -0
- package/src/components/DataTable/hooks/useDataTableRenderGuard.tsx +195 -0
- package/src/components/DataTable/hooks/useDataTableScope.test.ts +110 -0
- package/src/components/DataTable/hooks/useDataTableScope.ts +123 -0
- package/src/components/DataTable/hooks/useDataTableState.test.ts +733 -0
- package/src/components/DataTable/hooks/useDataTableState.ts +161 -114
- package/src/components/DataTable/hooks/useDataTableStateAndPersistence.test.ts +277 -0
- package/src/components/DataTable/hooks/useDataTableStateAndPersistence.ts +222 -0
- package/src/components/DataTable/hooks/useDataTableSuperAdmin.test.ts +93 -0
- package/src/components/DataTable/hooks/useDataTableSuperAdmin.ts +86 -0
- package/src/components/DataTable/hooks/useDataTableTableInstance.test.ts +185 -0
- package/src/components/DataTable/hooks/useDataTableTableInstance.ts +178 -0
- package/src/components/DataTable/hooks/useEffectiveColumnOrder.test.ts +183 -0
- package/src/components/DataTable/hooks/useHierarchicalState.test.ts +294 -0
- package/src/components/DataTable/hooks/useImportModalFocus.test.ts +184 -0
- package/src/components/DataTable/hooks/useImportModalFocus.ts +53 -0
- package/src/components/DataTable/hooks/useImportModalState.test.ts +390 -0
- package/src/components/DataTable/hooks/useImportModalState.ts +345 -0
- package/src/components/DataTable/hooks/useKeyboardNavigation.test.ts +787 -0
- package/src/components/DataTable/hooks/useKeyboardNavigation.ts +311 -271
- package/src/components/DataTable/hooks/usePermissionTracking.test.ts +381 -0
- package/src/components/DataTable/hooks/usePermissionTracking.ts +122 -0
- package/src/components/DataTable/hooks/useServerSideDataEffect.test.ts +258 -0
- package/src/components/DataTable/hooks/useServerSideDataEffect.ts +27 -4
- package/src/components/DataTable/hooks/useTableColumns.test.ts +499 -0
- package/src/components/DataTable/hooks/useTableColumns.ts +15 -39
- package/src/components/DataTable/hooks/useTableHandlers.test.ts +461 -0
- package/src/components/DataTable/hooks/useTableHandlers.ts +13 -22
- package/src/components/DataTable/index.ts +28 -5
- package/src/components/DataTable/keyboard.test.tsx +734 -0
- package/src/components/DataTable/mocks/MockRBACProvider.tsx +66 -0
- package/src/components/DataTable/pagination.modes.test.tsx +728 -0
- package/src/components/DataTable/ssr.strict-mode.test.tsx +319 -0
- package/src/components/DataTable/styles.test.ts +379 -0
- package/src/components/DataTable/styles.ts +0 -1
- package/src/components/DataTable/test-utils/MockDataTableComponents.tsx +55 -0
- package/src/components/DataTable/test-utils/dataFactories.ts +103 -0
- package/src/components/DataTable/test-utils/featureConfig.ts +10 -0
- package/src/components/DataTable/test-utils/sharedTestUtils.ts +419 -0
- package/src/components/DataTable/test-utils.ts +94 -0
- package/src/components/DataTable/types/actions.ts +71 -0
- package/src/components/DataTable/types/base.ts +39 -0
- package/src/components/DataTable/types/columns.ts +125 -0
- package/src/components/DataTable/types/export.ts +32 -0
- package/src/components/DataTable/types/features.ts +81 -0
- package/src/components/DataTable/types/hierarchical.ts +44 -0
- package/src/components/DataTable/types/index.ts +43 -0
- package/src/components/DataTable/types/pagination.ts +85 -0
- package/src/components/DataTable/types/performance.ts +47 -0
- package/src/components/DataTable/types/props.ts +62 -0
- package/src/components/DataTable/types/rbac.ts +45 -0
- package/src/components/DataTable/ui/layout/DataTableCore.test.tsx +1194 -0
- package/src/components/DataTable/ui/layout/DataTableCore.tsx +345 -0
- package/src/components/DataTable/ui/layout/DataTableErrorBoundary.test.tsx +438 -0
- package/src/components/DataTable/ui/layout/DataTableErrorBoundary.tsx +225 -0
- package/src/components/DataTable/ui/layout/DataTableLayout.test.tsx +1352 -0
- package/src/components/DataTable/ui/layout/DataTableLayout.tsx +661 -0
- package/src/components/DataTable/ui/modals/BulkDeleteConfirmDialog.test.tsx +91 -0
- package/src/components/DataTable/ui/modals/BulkDeleteConfirmDialog.tsx +43 -0
- package/src/components/DataTable/ui/modals/DataTableModals.test.tsx +749 -0
- package/src/components/DataTable/ui/modals/DataTableModals.tsx +341 -0
- package/src/components/DataTable/ui/modals/ImportModal.test.tsx +1834 -0
- package/src/components/DataTable/ui/modals/ImportModal.tsx +197 -0
- package/src/components/DataTable/ui/modals/ImportModalFailedRowsSection.tsx +60 -0
- package/src/components/DataTable/ui/modals/ImportModalFileSection.tsx +148 -0
- package/src/components/DataTable/ui/modals/ImportModalPreviewSection.tsx +60 -0
- package/src/components/DataTable/ui/modals/ImportModalSummarySection.tsx +59 -0
- package/src/components/DataTable/ui/modals/importModalPersistence.ts +73 -0
- package/src/components/DataTable/ui/shared/AccessDeniedPage.test.tsx +245 -0
- package/src/components/DataTable/ui/shared/AccessDeniedPage.tsx +159 -0
- package/src/components/DataTable/ui/shared/ActionButtons.test.tsx +921 -0
- package/src/components/DataTable/ui/shared/ActionButtons.tsx +195 -0
- package/src/components/DataTable/ui/shared/ColumnFilter.test.tsx +497 -0
- package/src/components/DataTable/ui/shared/ColumnFilter.tsx +113 -0
- package/src/components/DataTable/ui/shared/PaginationControls.test.tsx +451 -0
- package/src/components/DataTable/ui/shared/PaginationControls.tsx +291 -0
- package/src/components/DataTable/ui/shared/SortIndicator.test.tsx +135 -0
- package/src/components/DataTable/ui/shared/SortIndicator.tsx +50 -0
- package/src/components/DataTable/ui/table/EditFields.test.tsx +526 -0
- package/src/components/DataTable/ui/table/EditFields.tsx +355 -0
- package/src/components/DataTable/ui/table/EditableRow.test.tsx +1003 -0
- package/src/components/DataTable/ui/table/EditableRow.tsx +444 -0
- package/src/components/DataTable/ui/table/EmptyState.test.tsx +360 -0
- package/src/components/DataTable/ui/table/EmptyState.tsx +74 -0
- package/src/components/DataTable/ui/table/FilterRow.test.tsx +416 -0
- package/src/components/DataTable/ui/table/FilterRow.tsx +148 -0
- package/src/components/DataTable/ui/table/LoadingState.test.tsx +77 -0
- package/src/components/DataTable/ui/table/LoadingState.tsx +17 -0
- package/src/components/DataTable/ui/table/RowComponent.test.tsx +1024 -0
- package/src/components/DataTable/ui/table/RowComponent.tsx +429 -0
- package/src/components/DataTable/ui/table/UnifiedTableBody.test.tsx +1273 -0
- package/src/components/DataTable/ui/table/UnifiedTableBody.tsx +440 -0
- package/src/components/DataTable/ui/table/cellValueUtils.test.ts +453 -0
- package/src/components/DataTable/ui/table/cellValueUtils.ts +40 -0
- package/src/components/DataTable/ui/toolbar/BulkOperationsDropdown.test.tsx +551 -0
- package/src/components/DataTable/ui/toolbar/BulkOperationsDropdown.tsx +160 -0
- package/src/components/DataTable/ui/toolbar/ColumnVisibilityDropdown.test.tsx +751 -0
- package/src/components/DataTable/ui/toolbar/ColumnVisibilityDropdown.tsx +114 -0
- package/src/components/DataTable/ui/toolbar/DataTableToolbar.test.tsx +629 -0
- package/src/components/DataTable/ui/toolbar/DataTableToolbar.tsx +271 -0
- package/src/components/DataTable/ui/toolbar/GroupingDropdown.test.tsx +621 -0
- package/src/components/DataTable/ui/toolbar/GroupingDropdown.tsx +107 -0
- package/src/components/DataTable/utils/a11yUtils.test.ts +548 -0
- package/src/components/DataTable/utils/a11yUtils.ts +1 -1
- package/src/components/DataTable/utils/aggregationUtils.test.ts +288 -0
- package/src/components/DataTable/utils/aggregationUtils.ts +5 -5
- package/src/components/DataTable/utils/columnUtils.test.ts +94 -0
- package/src/components/DataTable/utils/csvParse.test.ts +74 -0
- package/src/components/DataTable/utils/csvParse.ts +65 -0
- package/src/components/DataTable/utils/errorHandling.test.ts +209 -0
- package/src/components/DataTable/utils/errorHandling.ts +3 -1
- package/src/components/DataTable/utils/exportUtils.test.ts +954 -0
- package/src/components/DataTable/utils/exportUtils.ts +1 -1
- package/src/components/DataTable/utils/flexibleImport.test.ts +573 -0
- package/src/components/DataTable/utils/flexibleImport.ts +3 -186
- package/src/components/DataTable/utils/hierarchicalSorting.test.ts +235 -0
- package/src/components/DataTable/utils/hierarchicalSorting.ts +3 -3
- package/src/components/DataTable/utils/hierarchicalUtils.test.ts +586 -0
- package/src/components/DataTable/utils/importDateParser.test.ts +162 -0
- package/src/components/DataTable/utils/importDateParser.ts +114 -0
- package/src/components/DataTable/utils/importValueParser.test.ts +138 -0
- package/src/components/DataTable/utils/importValueParser.ts +91 -0
- package/src/components/DataTable/utils/paginationUtils.test.ts +593 -0
- package/src/components/DataTable/utils/paginationUtils.ts +7 -4
- package/src/components/DataTable/utils/performanceUtils.test.ts +470 -0
- package/src/components/DataTable/utils/performanceUtils.ts +1 -1
- package/src/components/DataTable/utils/rowUtils.test.ts +235 -0
- package/src/components/DataTable/utils/selectFieldUtils.test.ts +271 -0
- package/src/components/DataTable/utils/selectFieldUtils.ts +97 -67
- package/src/components/DatePickerWithTimezone/DatePickerWithTimezone.test.tsx +18 -25
- package/src/components/DatePickerWithTimezone/DatePickerWithTimezone.tsx +1 -1
- package/src/components/DateTimeField/DateTimeField.test.tsx +3 -16
- package/src/components/DateTimeField/DateTimeField.tsx +1 -1
- package/src/components/Dialog/Dialog.test-utils.ts +49 -0
- package/src/components/Dialog/Dialog.test.tsx +2865 -458
- package/src/components/Dialog/Dialog.tsx +183 -986
- package/src/components/Dialog/dialogLock.test.ts +238 -0
- package/src/components/Dialog/dialogLock.ts +98 -0
- package/src/components/Dialog/index.ts +2 -0
- package/src/components/Dialog/useDialogDimensions.test.ts +163 -0
- package/src/components/Dialog/useDialogDimensions.ts +140 -0
- package/src/components/Dialog/useDialogLifecycle.test.ts +358 -0
- package/src/components/Dialog/useDialogLifecycle.ts +135 -0
- package/src/components/Dialog/useDialogPersistence.test.ts +381 -0
- package/src/components/Dialog/useDialogPersistence.ts +357 -0
- package/src/components/ErrorBoundary/ErrorBoundary.test.tsx +2 -62
- package/src/components/ErrorBoundary/ErrorBoundaryContext.context.ts +17 -0
- package/src/components/ErrorBoundary/ErrorBoundaryContext.tsx +2 -45
- package/src/components/ErrorBoundary/ErrorBoundaryContext.types.ts +41 -0
- package/src/components/ErrorBoundary/index.ts +3 -4
- package/src/components/ErrorBoundary/useErrorBoundaryContext.ts +20 -0
- package/src/components/FileDisplay/FileDisplay.test.tsx +479 -247
- package/src/components/FileDisplay/FileDisplay.tsx +29 -659
- package/src/components/FileDisplay/FileDisplayContent.test.tsx +395 -0
- package/src/components/FileDisplay/FileDisplayContent.tsx +242 -0
- package/src/components/FileDisplay/FileDisplayDeleteConfirmDialog.test.tsx +74 -0
- package/src/components/FileDisplay/FileDisplayDeleteConfirmDialog.tsx +38 -0
- package/src/components/FileDisplay/FileDisplayEmptyView.test.tsx +33 -0
- package/src/components/FileDisplay/FileDisplayEmptyView.tsx +33 -0
- package/src/components/FileDisplay/FileDisplayErrorView.test.tsx +71 -0
- package/src/components/FileDisplay/FileDisplayErrorView.tsx +50 -0
- package/src/components/FileDisplay/FileDisplayLoadingFallbackView.test.tsx +22 -0
- package/src/components/FileDisplay/FileDisplayLoadingFallbackView.tsx +22 -0
- package/src/components/FileDisplay/FileDisplayLoadingView.test.tsx +21 -0
- package/src/components/FileDisplay/FileDisplayLoadingView.tsx +23 -0
- package/src/components/FileDisplay/FileDisplayMultipleFilesView.test.tsx +101 -0
- package/src/components/FileDisplay/FileDisplayMultipleFilesView.tsx +109 -0
- package/src/components/FileDisplay/FileDisplaySingleDocumentLinkView.test.tsx +58 -0
- package/src/components/FileDisplay/FileDisplaySingleDocumentLinkView.tsx +48 -0
- package/src/components/FileDisplay/FileDisplaySingleFileWithActionsView.test.tsx +111 -0
- package/src/components/FileDisplay/FileDisplaySingleFileWithActionsView.tsx +270 -0
- package/src/components/FileDisplay/FileDisplaySingleImageView.test.tsx +78 -0
- package/src/components/FileDisplay/FileDisplaySingleImageView.tsx +67 -0
- package/src/components/FileDisplay/fallbackUtils.test.ts +50 -0
- package/src/components/FileDisplay/fallbackUtils.ts +44 -0
- package/src/components/FileDisplay/fetchFileDisplayData.ts +24 -0
- package/src/components/FileDisplay/fetchFileDisplayData.unit.test.ts +183 -0
- package/src/components/FileDisplay/fileDisplayUtils.test.ts +58 -0
- package/src/components/FileDisplay/fileDisplayUtils.ts +24 -0
- package/src/components/FileDisplay/index.tsx +1 -1
- package/src/components/FileDisplay/useFileDisplay.test.ts +538 -0
- package/src/components/FileDisplay/useFileDisplay.ts +515 -0
- package/src/components/FileDisplay/useFileDisplay.unit.test.ts +1438 -0
- package/src/components/FileDisplay/useFileDisplayData.ts +126 -0
- package/src/components/FileDisplay/usePublicFileDisplay.test.ts +729 -0
- package/src/components/FileDisplay/usePublicFileDisplay.ts +579 -0
- package/src/components/FileUpload/FileUpload.test.tsx +69 -27
- package/src/components/FileUpload/FileUpload.tsx +112 -527
- package/src/components/FileUpload/FileUploadDropZone.tsx +112 -0
- package/src/components/FileUpload/FileUploadProgressItem.tsx +86 -0
- package/src/components/FileUpload/FileUploadProgressList.tsx +40 -0
- package/src/components/FileUpload/index.tsx +1 -1
- package/src/components/FileUpload/useFileUploadManager.test.ts +308 -0
- package/src/components/FileUpload/useFileUploadManager.ts +454 -0
- package/src/components/FileUpload/useResolvedAppId.test.ts +102 -0
- package/src/components/FileUpload/useResolvedAppId.ts +77 -0
- package/src/components/Footer/Footer.test.tsx +15 -382
- package/src/components/Footer/Footer.tsx +8 -125
- package/src/components/Form/Form.test.tsx +425 -88
- package/src/components/Form/Form.tsx +91 -299
- package/src/components/Form/useFormPersistence.ts +257 -0
- package/src/components/Header/Header.test.tsx +653 -163
- package/src/components/Header/Header.tsx +62 -44
- package/src/components/InactivityWarningModal/InactivityWarningModal.test.tsx +35 -76
- package/src/components/Input/Input.test.tsx +34 -120
- package/src/components/Input/Input.tsx +1 -1
- package/src/components/Label/Label.test.tsx +46 -45
- package/src/components/LoadingSpinner/LoadingSpinner.test.tsx +8 -11
- package/src/components/LoginForm/LoginForm.test.tsx +0 -1
- package/src/components/NavigationMenu/HierarchicalNavItem.tsx +104 -0
- package/src/components/NavigationMenu/NavigationMenu.test.tsx +2422 -102
- package/src/components/NavigationMenu/NavigationMenu.tsx +62 -362
- package/src/components/NavigationMenu/index.ts +6 -1
- package/src/components/NavigationMenu/navigationPermissionHelper.ts +188 -0
- package/src/components/NavigationMenu/useNavigationFiltering.test.ts +1949 -0
- package/src/components/NavigationMenu/useNavigationFiltering.ts +199 -308
- package/src/components/NavigationMenu/useNavigationScope.ts +125 -0
- package/src/components/PaceAppLayout/PaceAppLayout.edge-cases.test.tsx +1322 -0
- package/src/components/PaceAppLayout/PaceAppLayout.integration.test.tsx +50 -49
- package/src/components/PaceAppLayout/PaceAppLayout.performance.test.tsx +81 -38
- package/src/components/PaceAppLayout/PaceAppLayout.security.test.tsx +103 -85
- package/src/components/PaceAppLayout/PaceAppLayout.test.tsx +774 -44
- package/src/components/PaceAppLayout/PaceAppLayout.tsx +282 -764
- package/src/components/PaceAppLayout/README.md +0 -9
- package/src/components/PaceAppLayout/test-setup.tsx +15 -9
- package/src/components/PaceAppLayout/useFilteredNavItems.ts +304 -0
- package/src/components/PaceAppLayout/usePaceAppLayoutConfig.ts +142 -0
- package/src/components/PaceAppLayout/usePaceAppLayoutGate.tsx +150 -0
- package/src/components/PaceAppLayout/usePaceAppLayoutPermissions.ts +162 -0
- package/src/components/PaceAppLayout/usePaceAppLayoutScope.ts +79 -0
- package/src/components/PaceAppLayout/useRoleBasedRouteAccess.ts +157 -0
- package/src/components/PaceAppLayout/useSuperAdminFallback.ts +58 -0
- package/src/components/PaceLoginPage/PaceLoginPage.test.tsx +782 -20
- package/src/components/PaceLoginPage/PaceLoginPage.tsx +33 -125
- package/src/components/PaceLoginPage/useLoginAppAccess.ts +153 -0
- package/src/components/PasswordChange/PasswordChangeForm.test.tsx +1 -1
- package/src/components/Progress/Progress.test.tsx +127 -1
- package/src/components/Progress/Progress.tsx +1 -2
- package/src/components/ProtectedRoute/ProtectedRoute.test.tsx +1196 -4
- package/src/components/ProtectedRoute/ProtectedRoute.tsx +29 -217
- package/src/components/ProtectedRoute/useProtectedRouteState.ts +128 -0
- package/src/components/ProtectedRoute/useVisibilityRedirectGrace.ts +89 -0
- package/src/components/PublicLayout/PublicLayout.test.tsx +1640 -38
- package/src/components/PublicLayout/PublicPageContext.ts +28 -0
- package/src/components/PublicLayout/PublicPageLayout.tsx +134 -75
- package/src/components/PublicLayout/PublicPageProvider.tsx +7 -42
- package/src/components/PublicLayout/usePublicPageContext.ts +36 -0
- package/src/components/Select/Select.test.tsx +45 -8
- package/src/components/Select/Select.tsx +57 -40
- package/src/components/Select/context.test.tsx +56 -0
- package/src/components/Select/text.test.tsx +104 -0
- package/src/components/Select/text.ts +26 -0
- package/src/components/Select/types.ts +3 -0
- package/src/components/Select/useSelectEvents.test.ts +279 -0
- package/src/components/Select/useSelectEvents.ts +87 -0
- package/src/components/Select/useSelectSearch.test.tsx +295 -0
- package/src/components/Select/useSelectSearch.ts +91 -0
- package/src/components/Select/useSelectState.test.ts +268 -0
- package/src/components/Select/useSelectState.ts +104 -0
- package/src/components/SessionRestorationLoader/SessionRestorationLoader.test.tsx +28 -112
- package/src/components/Switch/Switch.test.tsx +57 -153
- package/src/components/Table/Table.test.tsx +395 -317
- package/src/components/Tabs/Tabs.test.tsx +270 -0
- package/src/components/Tabs/Tabs.tsx +4 -4
- package/src/components/Textarea/Textarea.test.tsx +11 -38
- package/src/components/Toast/Toast.test.tsx +425 -496
- package/src/components/Tooltip/Tooltip.test.tsx +4 -21
- package/src/components/UserMenu/UserMenu.test.tsx +1 -21
- package/src/components/UserMenu/UserMenu.tsx +0 -1
- package/src/components/index.test.ts +346 -0
- package/src/components/index.ts +12 -1
- package/src/constants/performance.test.ts +91 -0
- package/src/hooks/ServiceHooks.test.tsx +725 -0
- package/src/hooks/hooks.integration.test.tsx +608 -0
- package/src/hooks/index.ts +18 -3
- package/src/hooks/index.unit.test.ts +220 -0
- package/src/hooks/public/usePublicEvent.test.ts +304 -0
- package/src/hooks/public/usePublicEvent.ts +11 -11
- package/src/hooks/public/usePublicEventLogo.test.ts +655 -120
- package/src/hooks/public/usePublicEventLogo.ts +2 -2
- package/src/hooks/public/usePublicRouteParams.test.ts +595 -0
- package/src/hooks/public/usePublicRouteParams.ts +2 -2
- package/src/hooks/services/useAuth.ts +9 -7
- package/src/hooks/services/useAuthService.ts +1 -1
- package/src/hooks/services/useEventService.ts +1 -1
- package/src/hooks/useAccessibleApps.test.ts +400 -0
- package/src/hooks/useAccessibleApps.ts +264 -0
- package/src/hooks/useAddressAutocomplete.test.ts +170 -47
- package/src/hooks/useAddressAutocomplete.ts +109 -81
- package/src/hooks/useApiFetch.unit.test.ts +111 -0
- package/src/hooks/useAppConfig.ts +13 -3
- package/src/hooks/useAppConfig.unit.test.ts +712 -0
- package/src/hooks/useComponentPerformance.unit.test.tsx +314 -0
- package/src/hooks/useDataTablePerformance.ts +111 -130
- package/src/hooks/useDataTablePerformance.unit.test.ts +720 -0
- package/src/hooks/useDataTableState.test.ts +170 -0
- package/src/hooks/useDataTableState.ts +5 -5
- package/src/hooks/useDebounce.unit.test.ts +157 -0
- package/src/hooks/useEventTheme.test.ts +70 -18
- package/src/hooks/useEventTheme.ts +50 -22
- package/src/hooks/useEvents.ts +49 -2
- package/src/hooks/useEvents.unit.test.ts +227 -0
- package/src/hooks/useFileReference.test.ts +388 -107
- package/src/hooks/useFileReference.ts +184 -179
- package/src/hooks/useFileUrl.ts +1 -1
- package/src/hooks/useFileUrl.unit.test.ts +686 -0
- package/src/hooks/useFileUrlCache.test.ts +319 -0
- package/src/hooks/useFileUrlCache.ts +5 -2
- package/src/hooks/useFocusManagement.unit.test.ts +604 -0
- package/src/hooks/useFocusTrap.unit.test.tsx +613 -0
- package/src/hooks/useFormDialog.test.ts +307 -0
- package/src/hooks/useFormDialog.ts +2 -2
- package/src/hooks/useInactivityTracker.ts +141 -134
- package/src/hooks/useInactivityTracker.unit.test.ts +446 -0
- package/src/hooks/useIsMobile.unit.test.ts +317 -0
- package/src/hooks/useIsPrint.ts +62 -0
- package/src/hooks/useIsPrint.unit.test.ts +545 -0
- package/src/hooks/useKeyboardShortcuts.unit.test.ts +907 -0
- package/src/hooks/useOrganisationPermissions.test.ts +1 -2
- package/src/hooks/useOrganisationPermissions.ts +1 -4
- package/src/hooks/useOrganisationPermissions.unit.test.tsx +293 -0
- package/src/hooks/useOrganisationSecurity.test.ts +4 -33
- package/src/hooks/useOrganisationSecurity.ts +192 -203
- package/src/hooks/useOrganisationSecurity.unit.test.tsx +959 -0
- package/src/hooks/useOrganisations.ts +1 -1
- package/src/hooks/useOrganisations.unit.test.ts +369 -0
- package/src/hooks/usePerformanceMonitor.ts +1 -1
- package/src/hooks/usePerformanceMonitor.unit.test.ts +693 -0
- package/src/hooks/usePermissionCache.test.ts +298 -329
- package/src/hooks/usePermissionCache.ts +277 -276
- package/src/hooks/usePreventTabReload.test.ts +307 -0
- package/src/hooks/usePublicEvent.simple.test.ts +794 -0
- package/src/hooks/usePublicEvent.test.ts +670 -0
- package/src/hooks/usePublicEvent.unit.test.ts +638 -0
- package/src/hooks/usePublicFileDisplay.test.ts +948 -0
- package/src/hooks/usePublicRouteParams.unit.test.ts +442 -0
- package/src/hooks/useQueryCache.test.ts +391 -0
- package/src/hooks/useQueryCache.ts +7 -9
- package/src/hooks/useRBAC.unit.test.ts +253 -0
- package/src/hooks/useSessionDraft.test.ts +556 -0
- package/src/hooks/useSessionDraft.ts +14 -11
- package/src/hooks/useSessionRestoration.ts +1 -1
- package/src/hooks/useSessionRestoration.unit.test.tsx +381 -0
- package/src/hooks/useStorage.ts +94 -54
- package/src/hooks/useStorage.unit.test.ts +684 -0
- package/src/hooks/useToast.test.ts +413 -0
- package/src/hooks/useToast.ts +2 -2
- package/src/hooks/useToast.unit.test.tsx +481 -0
- package/src/hooks/useZodForm.ts +3 -3
- package/src/hooks/useZodForm.unit.test.tsx +191 -0
- package/src/icons/index.test.ts +133 -0
- package/src/icons/index.ts +3 -1
- package/src/index.test.ts +528 -0
- package/src/index.ts +56 -9
- package/src/providers/AuthProvider.test.tsx +218 -0
- package/src/providers/EventProvider.test.tsx +487 -0
- package/src/providers/InactivityProvider.test-helper.tsx +40 -0
- package/src/providers/InactivityProvider.test.tsx +421 -0
- package/src/providers/ProviderLifecycle.test.tsx +308 -0
- package/src/providers/UnifiedAuthProvider.smoke.test.tsx +7 -12
- package/src/providers/UnifiedAuthProvider.test.tsx +503 -0
- package/src/providers/index.test.ts +138 -0
- package/src/providers/services/AuthServiceContext.ts +27 -0
- package/src/providers/services/AuthServiceProvider.integration.test.tsx +229 -0
- package/src/providers/services/AuthServiceProvider.test.tsx +638 -0
- package/src/providers/services/AuthServiceProvider.tsx +81 -20
- package/src/providers/services/EventServiceContext.ts +25 -0
- package/src/providers/services/EventServiceProvider.test.tsx +839 -0
- package/src/providers/services/EventServiceProvider.tsx +11 -20
- package/src/providers/services/InactivityServiceContext.ts +25 -0
- package/src/providers/services/InactivityServiceProvider.test.tsx +662 -0
- package/src/providers/services/InactivityServiceProvider.tsx +7 -17
- package/src/providers/services/OrganisationServiceContext.ts +25 -0
- package/src/providers/services/OrganisationServiceProvider.test.tsx +440 -0
- package/src/providers/services/OrganisationServiceProvider.tsx +7 -17
- package/src/providers/services/UnifiedAuthContext.ts +102 -0
- package/src/providers/services/UnifiedAuthProvider.advanced.test.tsx +434 -0
- package/src/providers/services/UnifiedAuthProvider.appId.test.tsx +408 -0
- package/src/providers/services/UnifiedAuthProvider.integration.test.tsx +304 -0
- package/src/providers/services/UnifiedAuthProvider.test.tsx +212 -0
- package/src/providers/services/UnifiedAuthProvider.tsx +147 -497
- package/src/providers/services/contexts.test.tsx +281 -0
- package/src/providers/services/useUnifiedAuth.test.tsx +251 -0
- package/src/providers/services/useUnifiedAuth.ts +29 -0
- package/src/providers/services/useUnifiedAuthContextValue.ts +279 -0
- package/src/providers/useInactivity.test-helper.ts +27 -0
- package/src/rbac/README.md +5 -5
- package/src/rbac/adapters.comprehensive.test.tsx +429 -0
- package/src/rbac/adapters.test.tsx +654 -0
- package/src/rbac/adapters.tsx +53 -38
- package/src/rbac/api.test.ts +986 -259
- package/src/rbac/api.ts +260 -216
- package/src/rbac/audit-batched.test.ts +550 -0
- package/src/rbac/audit-batched.ts +5 -4
- package/src/rbac/audit.test.ts +225 -28
- package/src/rbac/audit.ts +26 -18
- package/src/rbac/auth-rbac-security.integration.test.tsx +300 -0
- package/src/rbac/auth-rbac.e2e.test.tsx +510 -0
- package/src/rbac/cache-invalidation.test.ts +715 -0
- package/src/rbac/cache-invalidation.ts +18 -15
- package/src/rbac/cache.test.ts +123 -63
- package/src/rbac/cache.ts +3 -4
- package/src/rbac/components/AccessDenied.test.tsx +324 -0
- package/src/rbac/components/AccessDenied.tsx +20 -18
- package/src/rbac/components/NavigationGuard.test.tsx +1148 -0
- package/src/rbac/components/NavigationGuard.tsx +10 -8
- package/src/rbac/components/PagePermissionGuard.guard.test.tsx +236 -0
- package/src/rbac/components/PagePermissionGuard.performance.test.tsx +252 -0
- package/src/rbac/components/PagePermissionGuard.race-condition.test.tsx +243 -0
- package/src/rbac/components/PagePermissionGuard.test.tsx +1430 -0
- package/src/rbac/components/PagePermissionGuard.tsx +188 -381
- package/src/rbac/components/PagePermissionGuard.verification.test.tsx +185 -0
- package/src/rbac/config.test.ts +131 -48
- package/src/rbac/config.ts +69 -26
- package/src/rbac/docs/event-based-apps.md +26 -13
- package/src/rbac/engine.comprehensive.test.ts +808 -0
- package/src/rbac/engine.test.ts +974 -130
- package/src/rbac/engine.ts +53 -13
- package/src/rbac/errors.test.ts +99 -87
- package/src/rbac/errors.ts +89 -55
- package/src/rbac/eslint-rules.js +2 -2
- package/src/rbac/hooks/permissions/runPermissionCheck.ts +77 -0
- package/src/rbac/hooks/permissions/useAccessLevel.test.ts +622 -0
- package/src/rbac/hooks/permissions/useAccessLevel.ts +23 -14
- package/src/rbac/hooks/permissions/useCan.test.ts +798 -0
- package/src/rbac/hooks/permissions/useCan.ts +173 -253
- package/src/rbac/hooks/permissions/useMultiplePermissions.test.ts +843 -0
- package/src/rbac/hooks/permissions/useMultiplePermissions.ts +63 -10
- package/src/rbac/hooks/permissions/usePermissions.test.ts +543 -0
- package/src/rbac/hooks/permissions/usePermissions.ts +50 -78
- package/src/rbac/hooks/useCan.test.ts +348 -32
- package/src/rbac/hooks/usePageAccessLogging.ts +160 -0
- package/src/rbac/hooks/usePageGuardScope.ts +117 -0
- package/src/rbac/hooks/usePagePermissionCheck.ts +67 -0
- package/src/rbac/hooks/usePermissions.integration.test.ts +427 -0
- package/src/rbac/hooks/usePermissions.stability.test.ts +268 -0
- package/src/rbac/hooks/usePermissions.test.ts +459 -33
- package/src/rbac/hooks/usePermissions.ts +5 -7
- package/src/rbac/hooks/useRBAC.test.ts +1784 -21
- package/src/rbac/hooks/useRBAC.ts +148 -88
- package/src/rbac/hooks/useResolvedScope.test.ts +442 -5
- package/src/rbac/hooks/useResolvedScope.ts +4 -1
- package/src/rbac/hooks/useResourcePermissions.test.ts +561 -24
- package/src/rbac/hooks/useResourcePermissions.ts +76 -140
- package/src/rbac/hooks/useResourcePermissionsSuperAdmin.ts +67 -0
- package/src/rbac/hooks/useRoleManagement.test.ts +634 -61
- package/src/rbac/hooks/useRoleManagement.ts +158 -586
- package/src/rbac/hooks/useSecureSupabase.test.ts +1179 -0
- package/src/rbac/hooks/useSecureSupabase.ts +21 -14
- package/src/rbac/hooks/useSuperAdminCheck.ts +80 -0
- package/src/rbac/index.test.ts +107 -0
- package/src/rbac/index.ts +32 -32
- package/src/rbac/performance.test.ts +451 -0
- package/src/rbac/permissions.test.ts +149 -68
- package/src/rbac/permissions.ts +0 -3
- package/src/rbac/rbac-core.test.tsx +276 -0
- package/src/rbac/rbac-engine-core-logic.test.ts +387 -0
- package/src/rbac/rbac-engine-simplified.test.ts +252 -0
- package/src/rbac/rbac-functions.test.ts +703 -0
- package/src/rbac/rbac-integration.test.ts +523 -0
- package/src/rbac/rbac-role-isolation.test.ts +456 -0
- package/src/rbac/request-deduplication.test.ts +352 -0
- package/src/rbac/request-deduplication.ts +5 -4
- package/src/rbac/scenarios.user-role.test.tsx +271 -0
- package/src/rbac/secureClient.test.ts +499 -115
- package/src/rbac/secureClient.ts +54 -28
- package/src/rbac/security.test.ts +448 -44
- package/src/rbac/security.ts +7 -6
- package/src/rbac/types/roleManagement.ts +66 -0
- package/src/rbac/types.test.ts +236 -0
- package/src/rbac/types.ts +7 -5
- package/src/rbac/utils/clientSecurity.test.ts +192 -0
- package/src/rbac/utils/clientSecurity.ts +6 -4
- package/src/rbac/utils/contextValidator.test.ts +126 -0
- package/src/rbac/utils/contextValidator.ts +6 -3
- package/src/rbac/utils/deep-equal.test.ts +76 -0
- package/src/rbac/utils/eventContext.test.ts +401 -0
- package/src/rbac/utils/eventContext.ts +38 -34
- package/src/rbac/utils/fetchPermissionMap.ts +13 -0
- package/src/rbac/utils/permissionMapHelpers.ts +34 -0
- package/src/rbac/utils/roleManagementRpc.ts +303 -0
- package/src/services/AuthService.edge-cases.test.ts +746 -0
- package/src/services/AuthService.restoreSession.test.ts +59 -0
- package/src/services/AuthService.test.ts +1362 -0
- package/src/services/AuthService.ts +197 -216
- package/src/services/BaseService.edge-cases.test.ts +506 -0
- package/src/services/BaseService.test.ts +363 -0
- package/src/services/EventService.edge-cases.test.ts +636 -0
- package/src/services/EventService.eventColours.test.ts +64 -0
- package/src/services/EventService.test.ts +1250 -0
- package/src/services/EventService.ts +244 -315
- package/src/services/InactivityService.edge-cases.test.ts +492 -0
- package/src/services/InactivityService.lifecycle.test.ts +406 -0
- package/src/services/InactivityService.test.ts +829 -0
- package/src/services/InactivityService.ts +172 -213
- package/src/services/OrganisationService.edge-cases.test.ts +633 -0
- package/src/services/OrganisationService.pagination.test.ts +409 -0
- package/src/services/OrganisationService.test.ts +1579 -0
- package/src/services/OrganisationService.ts +186 -257
- package/src/services/base/BaseService.test.ts +214 -0
- package/src/services/interfaces/IAuthService.test.ts +184 -0
- package/src/services/interfaces/IAuthService.ts +10 -9
- package/src/services/interfaces/IEventService.test.ts +176 -0
- package/src/services/interfaces/IInactivityService.test.ts +183 -0
- package/src/services/interfaces/IOrganisationService.test.ts +207 -0
- package/src/services/interfaces/IOrganisationService.ts +0 -1
- package/src/styles/core.css +244 -12
- package/src/theming/parseEventColours.test.ts +321 -0
- package/src/theming/parseEventColours.ts +18 -9
- package/src/theming/runtime.test.ts +495 -0
- package/src/theming/runtime.ts +72 -7
- package/src/types/api-result.ts +53 -0
- package/src/types/auth.ts +0 -1
- package/src/types/core.test.ts +397 -0
- package/src/types/database-generated.test.ts +78 -0
- package/src/types/database.generated.ts +45 -10
- package/src/types/event.ts +39 -19
- package/src/types/file-reference.test.ts +351 -0
- package/src/types/file-reference.ts +37 -12
- package/src/types/guards.test.ts +246 -0
- package/src/types/index.test.ts +265 -0
- package/src/types/index.ts +3 -0
- package/src/types/organisation.roles.test.ts +55 -0
- package/src/types/organisation.test.ts +1105 -0
- package/src/types/organisation.ts +15 -15
- package/src/types/rpc-responses.ts +33 -0
- package/src/types/supabase.ts +14 -6
- package/src/types/theme.test.ts +830 -0
- package/src/types/type-validation.test.ts +526 -0
- package/src/types/validation.test.ts +729 -0
- package/src/types/vitest-globals.d.ts +1 -1
- package/src/utils/app/appConfig.test.ts +235 -0
- package/src/utils/app/appIdResolver.test.ts +252 -57
- package/src/utils/app/appIdResolver.ts +31 -20
- package/src/utils/app/appNameResolver.test.ts +18 -10
- package/src/utils/app/appNameResolver.ts +11 -9
- package/src/utils/app/appPortMap.test.ts +125 -0
- package/src/utils/app/appPortMap.ts +51 -0
- package/src/utils/app/buildAppUrl.test.ts +273 -0
- package/src/utils/app/buildAppUrl.ts +114 -0
- package/src/utils/appConfig.unit.test.ts +55 -0
- package/src/utils/audit/audit.test.ts +354 -39
- package/src/utils/audit.unit.test.ts +69 -0
- package/src/utils/auth-utils.unit.test.ts +69 -0
- package/src/utils/bundleAnalysis.unit.test.ts +326 -0
- package/src/utils/cn.unit.test.ts +34 -0
- package/src/utils/context/organisationContext.test.ts +115 -95
- package/src/utils/context/organisationContext.ts +32 -43
- package/src/utils/context/sessionTracking.test.ts +354 -0
- package/src/utils/core/cn.test.ts +66 -0
- package/src/utils/core/debugLogger.test.ts +113 -0
- package/src/utils/core/debugLogger.ts +15 -8
- package/src/utils/core/logger.test.ts +217 -0
- package/src/utils/core/logger.ts +20 -16
- package/src/utils/core/mergeRefs.ts +24 -0
- package/src/utils/debugLogger.test.ts +417 -0
- package/src/utils/device/deviceFingerprint.test.ts +8 -5
- package/src/utils/device/deviceFingerprint.ts +3 -3
- package/src/utils/deviceFingerprint.unit.test.ts +818 -0
- package/src/utils/dynamic/createLazyComponent.tsx +46 -0
- package/src/utils/dynamic/dynamicUtils.test.ts +185 -0
- package/src/utils/dynamic/dynamicUtils.ts +6 -6
- package/src/utils/dynamic/lazyLoad.test.tsx +156 -0
- package/src/utils/dynamic/lazyLoad.tsx +8 -36
- package/src/utils/dynamic/papaparseLoader.ts +7 -0
- package/src/utils/dynamicUtils.unit.test.ts +331 -0
- package/src/utils/file-reference/file-reference.test.ts +1238 -0
- package/src/utils/file-reference/index.ts +330 -348
- package/src/utils/formatDate.unit.test.ts +109 -0
- package/src/utils/formatting/formatDate.test.ts +22 -148
- package/src/utils/formatting/formatDateTime.test.ts +41 -119
- package/src/utils/formatting/formatDateTimeTimezone.test.ts +41 -85
- package/src/utils/formatting/formatNumber.test.ts +259 -0
- package/src/utils/formatting/formatTime.test.ts +36 -128
- package/src/utils/formatting/formatting.ts +1 -1
- package/src/utils/formatting.unit.test.ts +99 -0
- package/src/utils/google-places/googlePlacesUtils.test.ts +127 -36
- package/src/utils/google-places/googlePlacesUtils.ts +67 -86
- package/src/utils/google-places/loadGoogleMapsScript.test.ts +68 -8
- package/src/utils/google-places/loadGoogleMapsScript.ts +140 -118
- package/src/utils/index.ts +52 -11
- package/src/utils/index.unit.test.ts +251 -0
- package/src/utils/lazyLoad.unit.test.tsx +319 -0
- package/src/utils/location/location.test.ts +19 -116
- package/src/utils/logger.unit.test.ts +398 -0
- package/src/utils/organisationContext.unit.test.ts +180 -0
- package/src/utils/performance/bundleAnalysis.test.ts +148 -0
- package/src/utils/performance/bundleAnalysis.ts +16 -22
- package/src/utils/performance/performanceBenchmark.test.ts +251 -0
- package/src/utils/performance/performanceBenchmark.ts +12 -4
- package/src/utils/performance/performanceBudgets.test.ts +241 -0
- package/src/utils/performance/performanceBudgets.ts +9 -6
- package/src/utils/performanceBenchmark.test.ts +174 -0
- package/src/utils/performanceBudgets.unit.test.ts +288 -0
- package/src/utils/permissionTypes.unit.test.ts +250 -0
- package/src/utils/permissionUtils.unit.test.ts +362 -0
- package/src/utils/permissions/permissionTypes.test.ts +149 -0
- package/src/utils/permissions/permissionUtils.test.ts +20 -42
- package/src/utils/persistence/keyDerivation.test.ts +306 -0
- package/src/utils/persistence/sensitiveFieldDetection.test.ts +271 -0
- package/src/utils/persistence/sensitiveFieldDetection.ts +2 -2
- package/src/utils/request-deduplication.test.ts +349 -0
- package/src/utils/request-deduplication.ts +6 -4
- package/src/utils/sanitization.unit.test.ts +346 -0
- package/src/utils/schemaUtils.unit.test.ts +441 -0
- package/src/utils/secureDataAccess.unit.test.ts +334 -0
- package/src/utils/secureErrors.unit.test.ts +390 -0
- package/src/utils/secureStorage.unit.test.ts +289 -0
- package/src/utils/security/auth-utils.ts +38 -27
- package/src/utils/security/secureDataAccess.test.ts +22 -191
- package/src/utils/security/secureDataAccess.ts +241 -281
- package/src/utils/security/secureErrors.test.ts +163 -0
- package/src/utils/security/secureStorage.test.ts +156 -0
- package/src/utils/security/secureStorage.ts +1 -1
- package/src/utils/security/security.test.ts +212 -0
- package/src/utils/security/security.ts +15 -18
- package/src/utils/security/securityMonitor.test.ts +90 -0
- package/src/utils/security/securityMonitor.ts +1 -1
- package/src/utils/security.unit.test.ts +155 -0
- package/src/utils/securityMonitor.unit.test.ts +276 -0
- package/src/utils/sessionTracking.unit.test.ts +218 -0
- package/src/utils/storage/config.unit.test.ts +239 -0
- package/src/utils/storage/helpers.test.ts +769 -456
- package/src/utils/storage/helpers.ts +174 -253
- package/src/utils/storage/index.unit.test.ts +68 -0
- package/src/utils/storage/storageUtils.ts +32 -0
- package/src/utils/storage/types.ts +9 -2
- package/src/utils/supabase/createBaseClient.test.ts +201 -0
- package/src/utils/supabase/createBaseClient.ts +2 -1
- package/src/utils/timezone/timezone.test.ts +26 -44
- package/src/utils/timezone.test.ts +345 -0
- package/src/utils/validation/common.test.ts +115 -0
- package/src/utils/validation/csrf.test.ts +198 -0
- package/src/utils/validation/csrf.ts +42 -41
- package/src/utils/validation/htmlSanitization.ts +27 -31
- package/src/utils/validation/htmlSanitization.unit.test.ts +618 -0
- package/src/utils/validation/passwordSchema.test.ts +164 -0
- package/src/utils/validation/schema.test.ts +127 -0
- package/src/utils/validation/schema.ts +6 -3
- package/src/utils/validation/sqlInjectionProtection.test.ts +165 -0
- package/src/utils/validation/sqlInjectionProtection.ts +2 -2
- package/src/utils/validation/user.test.ts +173 -0
- package/src/utils/validation/validation.test.ts +197 -0
- package/src/utils/validation/validationUtils.test.ts +294 -0
- package/src/utils/validation.unit.test.ts +307 -0
- package/src/utils/validationUtils.unit.test.ts +558 -0
- package/src/vite-env.d.ts +6 -0
- package/dist/AuthService-DmfO5rGS.d.ts +0 -524
- package/dist/DataTable-DRUIgtUH.d.ts +0 -166
- package/dist/DataTable-SOAFXIWY.js +0 -15
- package/dist/PublicPageProvider-CIGSujI2.d.ts +0 -4147
- package/dist/UnifiedAuthProvider-7SNDOWYD.js +0 -7
- package/dist/UnifiedAuthProvider-CKvHP1MK.d.ts +0 -139
- package/dist/api-7P7DI652.js +0 -4
- package/dist/audit-MYQXYZFU.js +0 -3
- package/dist/auth-BZOJqrdd.d.ts +0 -49
- package/dist/chunk-4DDCYDQ3.js +0 -544
- package/dist/chunk-5HNSDQWH.js +0 -5046
- package/dist/chunk-5W2A3DRC.js +0 -164
- package/dist/chunk-6GLLNA6U.js +0 -31
- package/dist/chunk-7ILTDCL2.js +0 -80
- package/dist/chunk-A3W6LW53.js +0 -70
- package/dist/chunk-AHU7G2R5.js +0 -423
- package/dist/chunk-C7ZQ5O4C.js +0 -481
- package/dist/chunk-EF2UGZWY.js +0 -611
- package/dist/chunk-FEJLJNWA.js +0 -181
- package/dist/chunk-FYHN4DD5.js +0 -415
- package/dist/chunk-GS5672WG.js +0 -2003
- package/dist/chunk-HF6O3O37.js +0 -187
- package/dist/chunk-J2U36LHD.js +0 -8517
- package/dist/chunk-LX6U42O3.js +0 -2177
- package/dist/chunk-MPBLMWVR.js +0 -2161
- package/dist/chunk-OJ4SKRSV.js +0 -105
- package/dist/chunk-S6ZQKDY6.js +0 -62
- package/dist/chunk-S7DKJPLT.js +0 -699
- package/dist/chunk-T5CVK4R3.js +0 -2816
- package/dist/chunk-TTRFSOKR.js +0 -121
- package/dist/chunk-Z2FNRKF3.js +0 -994
- package/dist/database.generated-DT8JTZiP.d.ts +0 -9406
- package/dist/event-CW5YB_2p.d.ts +0 -239
- package/dist/file-reference-BavO2eQj.d.ts +0 -148
- package/dist/functions-lBy5L2ry.d.ts +0 -208
- package/dist/timezone-0AyangqX.d.ts +0 -697
- package/dist/types-BeoeWV5I.d.ts +0 -110
- package/dist/types-DXstZpNI.d.ts +0 -614
- package/dist/types-t9H8qKRw.d.ts +0 -55
- package/dist/usePublicRouteParams-DQLrDqDb.d.ts +0 -876
- package/dist/useToast-AyaT-x7p.d.ts +0 -68
- package/dist/validation-643vUDZW.d.ts +0 -177
- package/scripts/build-docs-incremental.js +0 -179
- package/scripts/eslint-audit.cjs +0 -123
- package/scripts/generate-docs.js +0 -157
- package/scripts/install-cursor-rules.cjs +0 -255
- package/scripts/install-eslint-config.cjs +0 -349
- package/scripts/setup-build-cache.js +0 -73
- package/scripts/validate-pre-publish.js +0 -145
- package/src/__tests__/helpers/__tests__/component-test-utils.test.tsx +0 -260
- package/src/__tests__/helpers/__tests__/optimized-test-setup.test.ts +0 -224
- package/src/__tests__/helpers/__tests__/supabaseMock.test.ts +0 -273
- package/src/__tests__/helpers/__tests__/test-providers.test.tsx +0 -99
- package/src/__tests__/helpers/__tests__/test-utils.test.tsx +0 -448
- package/src/__tests__/helpers/__tests__/timer-utils.test.ts +0 -371
- package/src/__tests__/hooks/usePermissions.test.ts +0 -268
- package/src/__tests__/integration/UserProfile.test.tsx +0 -124
- package/src/__tests__/public-recipe-view.test.ts +0 -228
- package/src/__tests__/rbac/PagePermissionGuard.test.tsx +0 -220
- package/src/__tests__/rls-policies.test.ts +0 -471
- package/src/components/DataTable/__tests__/DataTable.comprehensive.test.tsx +0 -759
- package/src/components/DataTable/__tests__/DataTable.default-state.test.tsx +0 -524
- package/src/components/DataTable/__tests__/DataTable.export.test.tsx +0 -705
- package/src/components/DataTable/__tests__/DataTable.grouping-aggregation.test.tsx +0 -658
- package/src/components/DataTable/__tests__/DataTable.hooks.test.tsx +0 -192
- package/src/components/DataTable/__tests__/DataTable.select-label-display.test.tsx +0 -483
- package/src/components/DataTable/__tests__/DataTable.test.tsx +0 -876
- package/src/components/DataTable/__tests__/DataTableCore.test-setup.ts +0 -220
- package/src/components/DataTable/__tests__/DataTableCore.test.tsx +0 -1474
- package/src/components/DataTable/__tests__/README.md +0 -145
- package/src/components/DataTable/__tests__/a11y.basic.test.tsx +0 -788
- package/src/components/DataTable/__tests__/keyboard.test.tsx +0 -756
- package/src/components/DataTable/__tests__/mocks/MockRBACProvider.tsx +0 -66
- package/src/components/DataTable/__tests__/pagination.modes.test.tsx +0 -730
- package/src/components/DataTable/__tests__/ssr.strict-mode.test.tsx +0 -325
- package/src/components/DataTable/__tests__/styles.test.ts +0 -382
- package/src/components/DataTable/__tests__/test-utils/dataFactories.ts +0 -103
- package/src/components/DataTable/__tests__/test-utils/sharedTestUtils.tsx +0 -380
- package/src/components/DataTable/__tests__/test-utils.ts +0 -94
- package/src/components/DataTable/components/AccessDeniedPage.tsx +0 -159
- package/src/components/DataTable/components/ActionButtons.tsx +0 -190
- package/src/components/DataTable/components/BulkOperationsDropdown.tsx +0 -160
- package/src/components/DataTable/components/ColumnFilter.tsx +0 -118
- package/src/components/DataTable/components/ColumnVisibilityDropdown.tsx +0 -114
- package/src/components/DataTable/components/DataTableErrorBoundary.tsx +0 -225
- package/src/components/DataTable/components/DataTableLayout.tsx +0 -573
- package/src/components/DataTable/components/DataTableModals.tsx +0 -245
- package/src/components/DataTable/components/DataTableToolbar.tsx +0 -271
- package/src/components/DataTable/components/EditFields.tsx +0 -327
- package/src/components/DataTable/components/EditableRow.tsx +0 -462
- package/src/components/DataTable/components/EmptyState.tsx +0 -79
- package/src/components/DataTable/components/FilterRow.tsx +0 -141
- package/src/components/DataTable/components/LoadingState.tsx +0 -17
- package/src/components/DataTable/components/PaginationControls.tsx +0 -289
- package/src/components/DataTable/components/RowComponent.tsx +0 -403
- package/src/components/DataTable/components/SortIndicator.tsx +0 -50
- package/src/components/DataTable/components/UnifiedTableBody.tsx +0 -355
- package/src/components/DataTable/components/__tests__/AccessDeniedPage.test.tsx +0 -657
- package/src/components/DataTable/components/__tests__/ActionButtons.test.tsx +0 -913
- package/src/components/DataTable/components/__tests__/BulkOperationsDropdown.test.tsx +0 -572
- package/src/components/DataTable/components/__tests__/ColumnFilter.test.tsx +0 -612
- package/src/components/DataTable/components/__tests__/ColumnVisibilityDropdown.test.tsx +0 -708
- package/src/components/DataTable/components/__tests__/DataTableErrorBoundary.test.tsx +0 -479
- package/src/components/DataTable/components/__tests__/DataTableModals.test.tsx +0 -475
- package/src/components/DataTable/components/__tests__/DataTableToolbar.test.tsx +0 -157
- package/src/components/DataTable/components/__tests__/EditableRow.test.tsx +0 -1061
- package/src/components/DataTable/components/__tests__/EmptyState.test.tsx +0 -437
- package/src/components/DataTable/components/__tests__/FilterRow.test.tsx +0 -474
- package/src/components/DataTable/components/__tests__/GroupingDropdown.test.tsx +0 -617
- package/src/components/DataTable/components/__tests__/ImportModal.test.tsx +0 -1093
- package/src/components/DataTable/components/__tests__/LoadingState.test.tsx +0 -139
- package/src/components/DataTable/components/__tests__/PaginationControls.test.tsx +0 -519
- package/src/components/DataTable/components/__tests__/UnifiedTableBody.test.tsx +0 -1004
- package/src/components/DataTable/components/cellValueUtils.ts +0 -40
- package/src/components/DataTable/components/hooks/useImportModalFocus.ts +0 -53
- package/src/components/DataTable/components/hooks/usePermissionTracking.ts +0 -122
- package/src/components/DataTable/components/index.ts +0 -16
- package/src/components/DataTable/context/__tests__/DataTableContext.test.tsx +0 -342
- package/src/components/DataTable/core/ActionManager.ts +0 -235
- package/src/components/DataTable/core/ColumnManager.ts +0 -205
- package/src/components/DataTable/core/DataManager.ts +0 -188
- package/src/components/DataTable/core/LocalDataAdapter.ts +0 -274
- package/src/components/DataTable/core/PluginRegistry.ts +0 -229
- package/src/components/DataTable/core/StateManager.ts +0 -312
- package/src/components/DataTable/core/__tests__/ActionManager.test.ts +0 -123
- package/src/components/DataTable/core/__tests__/ColumnFactory.test.ts +0 -305
- package/src/components/DataTable/core/__tests__/ColumnManager.test.ts +0 -84
- package/src/components/DataTable/core/__tests__/DataManager.test.ts +0 -115
- package/src/components/DataTable/core/__tests__/LocalDataAdapter.test.ts +0 -100
- package/src/components/DataTable/core/__tests__/PluginRegistry.test.ts +0 -120
- package/src/components/DataTable/core/__tests__/StateManager.test.ts +0 -104
- package/src/components/DataTable/core/index.ts +0 -1
- package/src/components/DataTable/core/interfaces.ts +0 -338
- package/src/components/DataTable/hooks/__tests__/useColumnOrderPersistence.test.ts +0 -521
- package/src/components/DataTable/hooks/__tests__/useColumnVisibilityPersistence.test.ts +0 -167
- package/src/components/DataTable/hooks/__tests__/useDataTableConfiguration.test.ts +0 -124
- package/src/components/DataTable/hooks/__tests__/useDataTableDataPipeline.test.ts +0 -117
- package/src/components/DataTable/hooks/__tests__/useDataTablePermissions.test.ts +0 -102
- package/src/components/DataTable/hooks/__tests__/useDataTableState.test.ts +0 -596
- package/src/components/DataTable/hooks/__tests__/useEffectiveColumnOrder.test.ts +0 -53
- package/src/components/DataTable/hooks/__tests__/useHierarchicalState.test.ts +0 -214
- package/src/components/DataTable/hooks/__tests__/useTableColumns.test.ts +0 -448
- package/src/components/DataTable/hooks/index.ts +0 -13
- package/src/components/DataTable/types.ts +0 -761
- package/src/components/DataTable/utils/__tests__/a11yUtils.test.ts +0 -612
- package/src/components/DataTable/utils/__tests__/columnUtils.test.ts +0 -94
- package/src/components/DataTable/utils/__tests__/errorHandling.test.ts +0 -266
- package/src/components/DataTable/utils/__tests__/exportUtils.test.ts +0 -954
- package/src/components/DataTable/utils/__tests__/flexibleImport.test.ts +0 -573
- package/src/components/DataTable/utils/__tests__/hierarchicalSorting.test.ts +0 -247
- package/src/components/DataTable/utils/__tests__/hierarchicalUtils.test.ts +0 -570
- package/src/components/DataTable/utils/__tests__/performanceUtils.test.ts +0 -470
- package/src/components/DataTable/utils/__tests__/rowUtils.test.ts +0 -251
- package/src/components/DataTable/utils/__tests__/selectFieldUtils.test.ts +0 -207
- package/src/components/DataTable/utils/index.ts +0 -10
- package/src/components/PublicLayout/index.ts +0 -32
- package/src/components/Select/hooks/useSelectEvents.ts +0 -87
- package/src/components/Select/hooks/useSelectSearch.ts +0 -91
- package/src/components/Select/hooks/useSelectState.ts +0 -104
- package/src/components/Select/utils/text.ts +0 -26
- package/src/hooks/__tests__/ServiceHooks.test.tsx +0 -615
- package/src/hooks/__tests__/hooks.integration.test.tsx +0 -607
- package/src/hooks/__tests__/index.unit.test.ts +0 -220
- package/src/hooks/__tests__/useApiFetch.unit.test.ts +0 -111
- package/src/hooks/__tests__/useAppConfig.unit.test.ts +0 -347
- package/src/hooks/__tests__/useComponentPerformance.unit.test.tsx +0 -144
- package/src/hooks/__tests__/useDataTablePerformance.unit.test.ts +0 -776
- package/src/hooks/__tests__/useDataTableState.test.ts +0 -76
- package/src/hooks/__tests__/useDebounce.unit.test.ts +0 -82
- package/src/hooks/__tests__/useEvents.unit.test.ts +0 -252
- package/src/hooks/__tests__/useFileDisplay.unit.test.ts +0 -1112
- package/src/hooks/__tests__/useFileUrl.unit.test.ts +0 -916
- package/src/hooks/__tests__/useFileUrlCache.test.ts +0 -129
- package/src/hooks/__tests__/useFocusManagement.unit.test.ts +0 -230
- package/src/hooks/__tests__/useFocusTrap.unit.test.tsx +0 -828
- package/src/hooks/__tests__/useFormDialog.test.ts +0 -478
- package/src/hooks/__tests__/useInactivityTracker.unit.test.ts +0 -446
- package/src/hooks/__tests__/useIsMobile.unit.test.ts +0 -317
- package/src/hooks/__tests__/useKeyboardShortcuts.unit.test.ts +0 -910
- package/src/hooks/__tests__/useOrganisationPermissions.unit.test.tsx +0 -294
- package/src/hooks/__tests__/useOrganisationSecurity.unit.test.tsx +0 -961
- package/src/hooks/__tests__/useOrganisations.unit.test.ts +0 -369
- package/src/hooks/__tests__/usePerformanceMonitor.unit.test.ts +0 -694
- package/src/hooks/__tests__/usePermissionCache.simple.test.ts +0 -192
- package/src/hooks/__tests__/usePermissionCache.unit.test.ts +0 -741
- package/src/hooks/__tests__/usePreventTabReload.test.ts +0 -88
- package/src/hooks/__tests__/usePublicEvent.simple.test.ts +0 -785
- package/src/hooks/__tests__/usePublicEvent.test.ts +0 -678
- package/src/hooks/__tests__/usePublicEvent.unit.test.ts +0 -630
- package/src/hooks/__tests__/usePublicFileDisplay.test.ts +0 -951
- package/src/hooks/__tests__/usePublicRouteParams.unit.test.ts +0 -443
- package/src/hooks/__tests__/useQueryCache.test.ts +0 -144
- package/src/hooks/__tests__/useRBAC.unit.test.ts +0 -236
- package/src/hooks/__tests__/useSessionDraft.test.ts +0 -163
- package/src/hooks/__tests__/useSessionRestoration.unit.test.tsx +0 -390
- package/src/hooks/__tests__/useStorage.unit.test.ts +0 -751
- package/src/hooks/__tests__/useToast.unit.test.tsx +0 -481
- package/src/hooks/__tests__/useZodForm.unit.test.tsx +0 -37
- package/src/hooks/public/index.ts +0 -36
- package/src/hooks/public/usePublicFileDisplay.ts +0 -504
- package/src/hooks/useFileDisplay.ts +0 -715
- package/src/providers/OrganisationProvider.tsx +0 -92
- package/src/providers/__tests__/AuthProvider.test.tsx +0 -287
- package/src/providers/__tests__/EventProvider.test.tsx +0 -551
- package/src/providers/__tests__/InactivityProvider.test-helper.tsx +0 -65
- package/src/providers/__tests__/InactivityProvider.test.tsx +0 -572
- package/src/providers/__tests__/OrganisationProvider.test.tsx +0 -617
- package/src/providers/__tests__/ProviderLifecycle.test.tsx +0 -424
- package/src/providers/__tests__/UnifiedAuthProvider.test.tsx +0 -596
- package/src/providers/services/__tests__/AuthServiceProvider.integration.test.tsx +0 -263
- package/src/providers/services/__tests__/UnifiedAuthProvider.integration.test.tsx +0 -294
- package/src/rbac/__tests__/adapters.comprehensive.test.tsx +0 -434
- package/src/rbac/__tests__/auth-rbac-security.integration.test.tsx +0 -313
- package/src/rbac/__tests__/auth-rbac.e2e.test.tsx +0 -486
- package/src/rbac/__tests__/cache-invalidation.test.ts +0 -399
- package/src/rbac/__tests__/engine.comprehensive.test.ts +0 -813
- package/src/rbac/__tests__/isSuperAdmin.real.test.ts +0 -82
- package/src/rbac/__tests__/rbac-core.test.tsx +0 -276
- package/src/rbac/__tests__/rbac-engine-core-logic.test.ts +0 -392
- package/src/rbac/__tests__/rbac-engine-simplified.test.ts +0 -258
- package/src/rbac/__tests__/rbac-functions.test.ts +0 -647
- package/src/rbac/__tests__/rbac-integration.test.ts +0 -524
- package/src/rbac/__tests__/rbac-role-isolation.test.ts +0 -456
- package/src/rbac/__tests__/scenarios.user-role.test.tsx +0 -282
- package/src/rbac/audit-enhanced.ts +0 -384
- package/src/rbac/compliance/database-validator.ts +0 -165
- package/src/rbac/compliance/index.ts +0 -48
- package/src/rbac/compliance/pattern-detector.ts +0 -553
- package/src/rbac/compliance/quick-fix-suggestions.ts +0 -209
- package/src/rbac/compliance/runtime-compliance.ts +0 -99
- package/src/rbac/compliance/setup-validator.ts +0 -131
- package/src/rbac/components/__tests__/NavigationGuard.test.tsx +0 -975
- package/src/rbac/components/__tests__/PagePermissionGuard.performance.test.tsx +0 -248
- package/src/rbac/components/__tests__/PagePermissionGuard.race-condition.test.tsx +0 -242
- package/src/rbac/components/__tests__/PagePermissionGuard.test.tsx +0 -1107
- package/src/rbac/components/__tests__/PagePermissionGuard.verification.test.tsx +0 -184
- package/src/rbac/components/index.ts +0 -26
- package/src/rbac/hooks/__tests__/usePermissions.integration.test.ts +0 -432
- package/src/rbac/hooks/__tests__/useSecureSupabase.test.ts +0 -579
- package/src/rbac/hooks/index.ts +0 -34
- package/src/rbac/hooks/permissions/index.ts +0 -4
- package/src/rbac/hooks/useRBAC.simple.test.ts +0 -95
- package/src/rbac/utils/__tests__/contextValidator.test.ts +0 -128
- package/src/rbac/utils/__tests__/deep-equal.test.ts +0 -53
- package/src/rbac/utils/__tests__/eventContext.test.ts +0 -433
- package/src/rbac/utils/__tests__/eventContext.unit.test.ts +0 -490
- package/src/services/__tests__/AuthService.restoreSession.test.ts +0 -39
- package/src/services/__tests__/AuthService.test.ts +0 -1332
- package/src/services/__tests__/BaseService.test.ts +0 -314
- package/src/services/__tests__/EventService.eventColours.test.ts +0 -76
- package/src/services/__tests__/EventService.test.ts +0 -1025
- package/src/services/__tests__/InactivityService.lifecycle.test.ts +0 -411
- package/src/services/__tests__/InactivityService.test.ts +0 -654
- package/src/services/__tests__/OrganisationService.pagination.test.ts +0 -409
- package/src/services/__tests__/OrganisationService.test.ts +0 -1176
- package/src/theming/__tests__/parseEventColours.test.ts +0 -321
- package/src/theming/__tests__/runtime.test.ts +0 -569
- package/src/types/__tests__/file-reference.test.ts +0 -447
- package/src/types/__tests__/guards.test.ts +0 -246
- package/src/types/__tests__/organisation.roles.test.ts +0 -55
- package/src/types/__tests__/organisation.test.ts +0 -1133
- package/src/types/__tests__/theme.test.ts +0 -830
- package/src/types/__tests__/type-validation.test.ts +0 -526
- package/src/types/__tests__/validation.test.ts +0 -731
- package/src/utils/__tests__/appConfig.unit.test.ts +0 -55
- package/src/utils/__tests__/audit.unit.test.ts +0 -69
- package/src/utils/__tests__/auth-utils.unit.test.ts +0 -70
- package/src/utils/__tests__/bundleAnalysis.unit.test.ts +0 -339
- package/src/utils/__tests__/cn.unit.test.ts +0 -34
- package/src/utils/__tests__/debugLogger.test.ts +0 -417
- package/src/utils/__tests__/deviceFingerprint.unit.test.ts +0 -818
- package/src/utils/__tests__/dynamicUtils.unit.test.ts +0 -318
- package/src/utils/__tests__/formatDate.unit.test.ts +0 -109
- package/src/utils/__tests__/formatting.unit.test.ts +0 -99
- package/src/utils/__tests__/index.unit.test.ts +0 -251
- package/src/utils/__tests__/lazyLoad.unit.test.tsx +0 -321
- package/src/utils/__tests__/logger.unit.test.ts +0 -398
- package/src/utils/__tests__/organisationContext.unit.test.ts +0 -191
- package/src/utils/__tests__/performanceBenchmark.test.ts +0 -175
- package/src/utils/__tests__/performanceBudgets.unit.test.ts +0 -253
- package/src/utils/__tests__/permissionTypes.unit.test.ts +0 -250
- package/src/utils/__tests__/permissionUtils.unit.test.ts +0 -362
- package/src/utils/__tests__/sanitization.unit.test.ts +0 -346
- package/src/utils/__tests__/schemaUtils.unit.test.ts +0 -441
- package/src/utils/__tests__/secureDataAccess.unit.test.ts +0 -335
- package/src/utils/__tests__/secureErrors.unit.test.ts +0 -390
- package/src/utils/__tests__/secureStorage.unit.test.ts +0 -289
- package/src/utils/__tests__/security.unit.test.ts +0 -149
- package/src/utils/__tests__/securityMonitor.unit.test.ts +0 -276
- package/src/utils/__tests__/sessionTracking.unit.test.ts +0 -218
- package/src/utils/__tests__/timezone.test.ts +0 -345
- package/src/utils/__tests__/validation.unit.test.ts +0 -308
- package/src/utils/__tests__/validationUtils.unit.test.ts +0 -555
- package/src/utils/app/appNameResolver.simple.test.ts +0 -212
- package/src/utils/file-reference/__tests__/file-reference.test.ts +0 -875
- package/src/utils/google-places/index.ts +0 -26
- package/src/utils/location/index.ts +0 -16
- package/src/utils/persistence/__tests__/keyDerivation.test.ts +0 -135
- package/src/utils/persistence/__tests__/sensitiveFieldDetection.test.ts +0 -123
- package/src/utils/storage/__tests__/helpers.unit.test.ts +0 -332
- package/src/utils/storage/__tests__/index.unit.test.ts +0 -16
- package/src/utils/storage/index.ts +0 -67
- package/src/utils/timezone/index.ts +0 -17
- package/src/utils/validation/__tests__/csrf.test.ts +0 -105
- package/src/utils/validation/__tests__/htmlSanitization.unit.test.ts +0 -598
- package/src/utils/validation/__tests__/sqlInjectionProtection.test.ts +0 -92
- package/src/utils/validation/__tests__/validationUtils.test.ts +0 -72
- package/src/utils/validation/index.ts +0 -73
- /package/src/components/DataTable/{components/__tests__ → ui}/COVERAGE_NOTE.md +0 -0
- /package/src/components/DataTable/utils/{__tests__/COVERAGE_NOTE.md → COVERAGE_NOTE.md} +0 -0
- /package/src/providers/{__tests__/README.md → README.md} +0 -0
- /package/src/types/{__tests__/README.md → README.md} +0 -0
|
@@ -1,4147 +0,0 @@
|
|
|
1
|
-
import * as React$1 from 'react';
|
|
2
|
-
import React__default, { ReactNode, Component } from 'react';
|
|
3
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
-
import { P as ParsedAddress, A as AutocompleteOptions } from './types-DXstZpNI.js';
|
|
5
|
-
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
6
|
-
import { F as FileCategory, e as FileUploadResult, U as UploadProgress, c as FileUploadOptions, a as FileReference } from './file-reference-BavO2eQj.js';
|
|
7
|
-
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
8
|
-
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
9
|
-
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
10
|
-
import { DayPickerProps, DateRange } from 'react-day-picker';
|
|
11
|
-
import * as ToastPrimitives from '@radix-ui/react-toast';
|
|
12
|
-
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
13
|
-
import { FieldValues, DefaultValues, SubmitHandler, SubmitErrorHandler, UseFormReturn, FieldPath, ControllerRenderProps, ControllerFieldState, UseFormStateReturn } from 'react-hook-form';
|
|
14
|
-
import { z } from 'zod';
|
|
15
|
-
import { N as NavigationMenuProps, a as NavigationItem } from './types-t9H8qKRw.js';
|
|
16
|
-
import { User, SupabaseClient, createClient } from '@supabase/supabase-js';
|
|
17
|
-
import { O as Organisation, E as Event } from './event-CW5YB_2p.js';
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Button component props
|
|
21
|
-
* Extends standard HTML button attributes with button-specific styling and behavior options.
|
|
22
|
-
*
|
|
23
|
-
* @interface ButtonProps
|
|
24
|
-
*/
|
|
25
|
-
/**
|
|
26
|
-
* Props for the Button component.
|
|
27
|
-
* Extends standard button HTML attributes.
|
|
28
|
-
*/
|
|
29
|
-
interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
30
|
-
/** Visual variant of the button */
|
|
31
|
-
variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link';
|
|
32
|
-
/** Size of the button */
|
|
33
|
-
size?: 'default' | 'sm' | 'lg' | 'icon';
|
|
34
|
-
/** Whether to render as a different element using Radix Slot */
|
|
35
|
-
asChild?: boolean;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Button Component
|
|
39
|
-
* A flexible, accessible button component with multiple variants and sizes.
|
|
40
|
-
*
|
|
41
|
-
* @component
|
|
42
|
-
* @example
|
|
43
|
-
* ```tsx
|
|
44
|
-
* // Basic button
|
|
45
|
-
* <Button>Click me</Button>
|
|
46
|
-
*
|
|
47
|
-
* // Button with variant and size
|
|
48
|
-
* <Button variant="destructive" size="lg">Delete</Button>
|
|
49
|
-
*
|
|
50
|
-
* // Button as child (composition)
|
|
51
|
-
* <Button asChild>
|
|
52
|
-
* <Link href="/dashboard">Go to Dashboard</Link>
|
|
53
|
-
* </Button>
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* @file Card Component Suite
|
|
60
|
-
* @package @jmruthers/pace-core
|
|
61
|
-
* @module Components
|
|
62
|
-
* @since 0.1.0
|
|
63
|
-
*
|
|
64
|
-
* A flexible card component suite for displaying content with consistent styling.
|
|
65
|
-
* Includes Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, CardActions, and HoverCard variants.
|
|
66
|
-
* Uses semantic HTML elements for better accessibility and structure.
|
|
67
|
-
*
|
|
68
|
-
* Features:
|
|
69
|
-
* - Semantic HTML structure (article, header, main, footer, etc.)
|
|
70
|
-
* - Modular card structure (header, content, footer, actions, etc.)
|
|
71
|
-
* - CardContent uses main element for primary content (accessible when nested)
|
|
72
|
-
* - Consistent padding, border, and shadow
|
|
73
|
-
* - Responsive and accessible
|
|
74
|
-
* - HoverCard for popover-style cards
|
|
75
|
-
* - Proper heading hierarchy and semantic elements
|
|
76
|
-
*
|
|
77
|
-
* @example
|
|
78
|
-
* ```tsx
|
|
79
|
-
* // Basic card with semantic HTML structure
|
|
80
|
-
* <Card>
|
|
81
|
-
* <CardHeader>
|
|
82
|
-
* <CardTitle>Article Title</CardTitle>
|
|
83
|
-
* <CardDescription>Brief description of the article content</CardDescription>
|
|
84
|
-
* </CardHeader>
|
|
85
|
-
* <CardContent>
|
|
86
|
-
* <p>Main content goes here with proper semantic structure.</p>
|
|
87
|
-
* <p>Additional paragraphs and content.</p>
|
|
88
|
-
* </CardContent>
|
|
89
|
-
* <CardFooter>
|
|
90
|
-
* <CardActions>
|
|
91
|
-
* <Button>Primary Action</Button>
|
|
92
|
-
* <Button variant="outline">Secondary Action</Button>
|
|
93
|
-
* </CardActions>
|
|
94
|
-
* </CardFooter>
|
|
95
|
-
* </Card>
|
|
96
|
-
*
|
|
97
|
-
* // Semantic HTML structure:
|
|
98
|
-
* // - Card: <article> element for self-contained content
|
|
99
|
-
* // - CardHeader: <header> element for card heading area
|
|
100
|
-
* // - CardContent: <main> element for primary card content
|
|
101
|
-
* // - CardFooter: <footer> element for card footer area
|
|
102
|
-
* // - CardActions: <nav> element for action buttons
|
|
103
|
-
*
|
|
104
|
-
* // HoverCard usage with semantic structure
|
|
105
|
-
* <HoverCard>
|
|
106
|
-
* <HoverCardTrigger>Hover me</HoverCardTrigger>
|
|
107
|
-
* <HoverCardContent>
|
|
108
|
-
* <p>Popover content with semantic elements</p>
|
|
109
|
-
* </HoverCardContent>
|
|
110
|
-
* </HoverCard>
|
|
111
|
-
* ```
|
|
112
|
-
*
|
|
113
|
-
* @accessibility
|
|
114
|
-
* - Uses semantic HTML structure (article, header, main, footer, nav)
|
|
115
|
-
* - Focusable and keyboard accessible
|
|
116
|
-
* - Proper heading hierarchy for screen readers
|
|
117
|
-
* - HoverCard supports mouse and keyboard interaction
|
|
118
|
-
* - Screen reader friendly with semantic landmarks
|
|
119
|
-
*/
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Props for the Card component.
|
|
123
|
-
* Extends standard HTML attributes for semantic HTML elements.
|
|
124
|
-
*/
|
|
125
|
-
interface CardProps extends React$1.HTMLAttributes<HTMLElement> {
|
|
126
|
-
/** Visual variant of the card */
|
|
127
|
-
variant?: 'default' | 'outline' | 'ghost';
|
|
128
|
-
/** Size of the card */
|
|
129
|
-
size?: 'default' | 'sm' | 'lg';
|
|
130
|
-
/** Whether the card should appear as a clickable link with hover effects */
|
|
131
|
-
isLink?: boolean;
|
|
132
|
-
/** Path or URL to navigate to when the card is clicked */
|
|
133
|
-
link?: string;
|
|
134
|
-
}
|
|
135
|
-
declare const Card: React$1.ForwardRefExoticComponent<CardProps & React$1.RefAttributes<HTMLElement>>;
|
|
136
|
-
declare const CardHeader: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLElement> & React$1.RefAttributes<HTMLElement>>;
|
|
137
|
-
declare const CardTitle: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLHeadingElement> & React$1.RefAttributes<HTMLHeadingElement>>;
|
|
138
|
-
declare const CardDescription: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLParagraphElement> & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
139
|
-
declare const CardContent: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLElement> & React$1.RefAttributes<HTMLElement>>;
|
|
140
|
-
declare const CardFooter: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLElement> & React$1.RefAttributes<HTMLElement>>;
|
|
141
|
-
declare const CardActions: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLElement> & React$1.RefAttributes<HTMLElement>>;
|
|
142
|
-
type CardActionsProps = React$1.HTMLAttributes<HTMLElement>;
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Props for the Input component.
|
|
146
|
-
* Extends standard input HTML attributes.
|
|
147
|
-
*/
|
|
148
|
-
interface InputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
149
|
-
/**
|
|
150
|
-
* Input variant style
|
|
151
|
-
*/
|
|
152
|
-
variant?: 'default' | 'destructive';
|
|
153
|
-
/**
|
|
154
|
-
* Input size
|
|
155
|
-
*/
|
|
156
|
-
size?: 'sm' | 'md' | 'lg';
|
|
157
|
-
/**
|
|
158
|
-
* Error state for styling
|
|
159
|
-
*/
|
|
160
|
-
error?: boolean;
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Input component
|
|
164
|
-
* A flexible, accessible input component with multiple variants and sizes
|
|
165
|
-
*
|
|
166
|
-
* @param props - Input configuration and styling
|
|
167
|
-
* @param ref - Forwarded ref to the input element
|
|
168
|
-
* @returns JSX.Element - The rendered input element
|
|
169
|
-
*
|
|
170
|
-
* @example
|
|
171
|
-
* ```tsx
|
|
172
|
-
* // Basic input
|
|
173
|
-
* <Input placeholder="Enter your name" />
|
|
174
|
-
*
|
|
175
|
-
* // Input with error state
|
|
176
|
-
* <Input
|
|
177
|
-
* placeholder="Email"
|
|
178
|
-
* type="email"
|
|
179
|
-
* error={true}
|
|
180
|
-
* />
|
|
181
|
-
*
|
|
182
|
-
* // Large input with destructive variant
|
|
183
|
-
* <Input
|
|
184
|
-
* variant="destructive"
|
|
185
|
-
* size="lg"
|
|
186
|
-
* placeholder="Error input"
|
|
187
|
-
* />
|
|
188
|
-
* ```
|
|
189
|
-
*/
|
|
190
|
-
declare function Input({ className, variant, size, error, type, ref, ...props }: InputProps & {
|
|
191
|
-
ref?: React$1.Ref<HTMLInputElement>;
|
|
192
|
-
}): react_jsx_runtime.JSX.Element;
|
|
193
|
-
declare namespace Input {
|
|
194
|
-
var displayName: string;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* @file AddressField Component Types
|
|
199
|
-
* @package @jmruthers/pace-core
|
|
200
|
-
* @module Components/AddressField
|
|
201
|
-
* @since 0.1.0
|
|
202
|
-
*/
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Props for AddressField component
|
|
206
|
-
*/
|
|
207
|
-
interface AddressFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value' | 'defaultValue' | 'size'> {
|
|
208
|
-
/** Google Places API key (required) */
|
|
209
|
-
apiKey: string;
|
|
210
|
-
/** Controlled input value */
|
|
211
|
-
value?: string;
|
|
212
|
-
/** Uncontrolled default value */
|
|
213
|
-
defaultValue?: string;
|
|
214
|
-
/** Callback when address is selected */
|
|
215
|
-
onChange?: (address: ParsedAddress | null) => void;
|
|
216
|
-
/** Callback when input value changes */
|
|
217
|
-
onInputChange?: (value: string) => void;
|
|
218
|
-
/** Placeholder text */
|
|
219
|
-
placeholder?: string;
|
|
220
|
-
/** Error state styling */
|
|
221
|
-
error?: boolean;
|
|
222
|
-
/** Disabled state */
|
|
223
|
-
disabled?: boolean;
|
|
224
|
-
/** Input size */
|
|
225
|
-
size?: 'sm' | 'md' | 'lg';
|
|
226
|
-
/** Input variant */
|
|
227
|
-
variant?: 'default' | 'destructive';
|
|
228
|
-
/** Google Places API autocomplete options */
|
|
229
|
-
autocompleteOptions?: AutocompleteOptions;
|
|
230
|
-
/** Debounce delay in milliseconds */
|
|
231
|
-
debounceDelay?: number;
|
|
232
|
-
/** Enable caching (default: true) */
|
|
233
|
-
cacheEnabled?: boolean;
|
|
234
|
-
/** Cache TTL configuration */
|
|
235
|
-
cacheTTL?: {
|
|
236
|
-
/** Autocomplete cache TTL in seconds */
|
|
237
|
-
autocomplete?: number;
|
|
238
|
-
/** Place details cache TTL in seconds */
|
|
239
|
-
placeDetails?: number;
|
|
240
|
-
};
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* Ref type for AddressField component
|
|
244
|
-
*/
|
|
245
|
-
interface AddressFieldRef {
|
|
246
|
-
/** Focus the input */
|
|
247
|
-
focus: () => void;
|
|
248
|
-
/** Blur the input */
|
|
249
|
-
blur: () => void;
|
|
250
|
-
/** Get current input value */
|
|
251
|
-
getValue: () => string;
|
|
252
|
-
/** Clear the input and suggestions */
|
|
253
|
-
clear: () => void;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* @file AddressField Component
|
|
258
|
-
* @package @jmruthers/pace-core
|
|
259
|
-
* @module Components/AddressField
|
|
260
|
-
* @since 0.1.0
|
|
261
|
-
*
|
|
262
|
-
* Address input field with Google Places API autocomplete.
|
|
263
|
-
* Provides address suggestions, keyboard navigation, and accessibility.
|
|
264
|
-
*
|
|
265
|
-
* Features:
|
|
266
|
-
* - Google Places API autocomplete integration
|
|
267
|
-
* - Debounced input with caching
|
|
268
|
-
* - Keyboard navigation (Arrow keys, Enter, Escape)
|
|
269
|
-
* - Accessible ARIA attributes
|
|
270
|
-
* - Semantic HTML (description list for suggestions)
|
|
271
|
-
* - Loading and error states
|
|
272
|
-
* - place_id storage for later retrieval
|
|
273
|
-
*
|
|
274
|
-
* @accessibility
|
|
275
|
-
* - Uses semantic HTML: `<dl>`, `<dt>`, `<dd>` for address suggestions
|
|
276
|
-
* - Proper ARIA attributes for combobox pattern
|
|
277
|
-
* - Keyboard navigation support
|
|
278
|
-
* - Screen reader friendly
|
|
279
|
-
*/
|
|
280
|
-
|
|
281
|
-
/**
|
|
282
|
-
* AddressField component
|
|
283
|
-
*
|
|
284
|
-
* A production-ready address input field with Google Places API autocomplete.
|
|
285
|
-
* Returns structured address data including place_id for later retrieval.
|
|
286
|
-
*
|
|
287
|
-
* @param props - AddressField configuration
|
|
288
|
-
* @param ref - Forwarded ref for imperative access
|
|
289
|
-
* @returns JSX.Element - The rendered address field
|
|
290
|
-
*
|
|
291
|
-
* @example
|
|
292
|
-
* ```tsx
|
|
293
|
-
* <AddressField
|
|
294
|
-
* apiKey={apiKey}
|
|
295
|
-
* onChange={(address) => {
|
|
296
|
-
* // address includes place_id, full_address, lat, lng, etc.
|
|
297
|
-
* console.log(address.place_id);
|
|
298
|
-
* }}
|
|
299
|
-
* placeholder="Enter your address"
|
|
300
|
-
* />
|
|
301
|
-
* ```
|
|
302
|
-
*/
|
|
303
|
-
declare const AddressField: React$1.ForwardRefExoticComponent<AddressFieldProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
* @file Label Component
|
|
307
|
-
* @package @jmruthers/pace-core
|
|
308
|
-
* @module Components/Label
|
|
309
|
-
* @since 0.1.0
|
|
310
|
-
*
|
|
311
|
-
* An accessible label component built on top of Radix UI primitives.
|
|
312
|
-
* Provides form labels with helper text, error states, and required indicators.
|
|
313
|
-
*
|
|
314
|
-
* Features:
|
|
315
|
-
* - Proper label association with form controls
|
|
316
|
-
* - Required field indicators
|
|
317
|
-
* - Helper text support
|
|
318
|
-
* - Error state display
|
|
319
|
-
* - Customizable styling
|
|
320
|
-
* - Screen reader friendly
|
|
321
|
-
* - Keyboard accessible
|
|
322
|
-
*
|
|
323
|
-
* @example
|
|
324
|
-
* ```tsx
|
|
325
|
-
* // Basic label
|
|
326
|
-
* <Label htmlFor="email">Email Address</Label>
|
|
327
|
-
* <Input id="email" type="email" />
|
|
328
|
-
*
|
|
329
|
-
* // Label with required indicator
|
|
330
|
-
* <Label htmlFor="name" required>
|
|
331
|
-
* Full Name
|
|
332
|
-
* </Label>
|
|
333
|
-
* <Input id="name" />
|
|
334
|
-
*
|
|
335
|
-
* // Label with helper text
|
|
336
|
-
* <Label
|
|
337
|
-
* htmlFor="password"
|
|
338
|
-
* required
|
|
339
|
-
* helperText="Must be at least 8 characters"
|
|
340
|
-
* >
|
|
341
|
-
* Password
|
|
342
|
-
* </Label>
|
|
343
|
-
* <Input id="password" type="password" />
|
|
344
|
-
*
|
|
345
|
-
* // Label with error state
|
|
346
|
-
* <Label
|
|
347
|
-
* htmlFor="email"
|
|
348
|
-
* error="Please enter a valid email address"
|
|
349
|
-
* >
|
|
350
|
-
* Email Address
|
|
351
|
-
* </Label>
|
|
352
|
-
* <Input id="email" type="email" />
|
|
353
|
-
*
|
|
354
|
-
* // Custom required indicator
|
|
355
|
-
* <Label
|
|
356
|
-
* htmlFor="terms"
|
|
357
|
-
* required
|
|
358
|
-
* requiredIndicator="(required)"
|
|
359
|
-
* >
|
|
360
|
-
* Accept Terms
|
|
361
|
-
* </Label>
|
|
362
|
-
* <Checkbox id="terms" />
|
|
363
|
-
* ```
|
|
364
|
-
*
|
|
365
|
-
* @accessibility
|
|
366
|
-
* - WCAG 2.1 AA compliant
|
|
367
|
-
* - Proper label association with htmlFor
|
|
368
|
-
* - Screen reader announcements for errors
|
|
369
|
-
* - Required field indicators for screen readers
|
|
370
|
-
* - Error messages with role="alert"
|
|
371
|
-
* - High contrast support
|
|
372
|
-
*
|
|
373
|
-
* @dependencies
|
|
374
|
-
* - @radix-ui/react-label - Core label functionality
|
|
375
|
-
* - React 19+ - Hooks and refs
|
|
376
|
-
* - Tailwind CSS - Styling
|
|
377
|
-
*/
|
|
378
|
-
|
|
379
|
-
/**
|
|
380
|
-
* Props for the Label component
|
|
381
|
-
*/
|
|
382
|
-
interface LabelProps extends React$1.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> {
|
|
383
|
-
/** Whether the field is required */
|
|
384
|
-
required?: boolean;
|
|
385
|
-
/** Custom required indicator (default: '*') */
|
|
386
|
-
requiredIndicator?: React$1.ReactNode;
|
|
387
|
-
/** Whether to hide the required indicator visually */
|
|
388
|
-
hideRequiredIndicator?: boolean;
|
|
389
|
-
/** Helper text to display below the label */
|
|
390
|
-
helperText?: string;
|
|
391
|
-
/** CSS classes for helper text styling */
|
|
392
|
-
helperTextClassName?: string;
|
|
393
|
-
/** Error message to display */
|
|
394
|
-
error?: string;
|
|
395
|
-
/** CSS classes for error message styling */
|
|
396
|
-
errorClassName?: string;
|
|
397
|
-
}
|
|
398
|
-
/**
|
|
399
|
-
* Label component
|
|
400
|
-
* An accessible label with helper text and error state support
|
|
401
|
-
*
|
|
402
|
-
* @param props - Label configuration and styling
|
|
403
|
-
* @param ref - Forwarded ref to the label element
|
|
404
|
-
* @returns JSX.Element - The rendered label with optional helper text and errors
|
|
405
|
-
*
|
|
406
|
-
* @example
|
|
407
|
-
* ```tsx
|
|
408
|
-
* <Label htmlFor="email" required helperText="We'll never share your email">
|
|
409
|
-
* Email Address
|
|
410
|
-
* </Label>
|
|
411
|
-
* ```
|
|
412
|
-
*/
|
|
413
|
-
declare const Label: React$1.ForwardRefExoticComponent<LabelProps & React$1.RefAttributes<HTMLLabelElement>>;
|
|
414
|
-
|
|
415
|
-
interface TextareaProps extends React$1.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
416
|
-
/**
|
|
417
|
-
* Textarea variant style
|
|
418
|
-
*/
|
|
419
|
-
variant?: 'default' | 'destructive';
|
|
420
|
-
/**
|
|
421
|
-
* Textarea size
|
|
422
|
-
*/
|
|
423
|
-
size?: 'sm' | 'md' | 'lg';
|
|
424
|
-
/**
|
|
425
|
-
* Error state for styling
|
|
426
|
-
*/
|
|
427
|
-
error?: boolean;
|
|
428
|
-
}
|
|
429
|
-
/**
|
|
430
|
-
* Textarea component
|
|
431
|
-
* A flexible, accessible textarea component with multiple variants and sizes.
|
|
432
|
-
* Matches the Input component API and styling for consistency.
|
|
433
|
-
*
|
|
434
|
-
* @param props - Textarea configuration and styling
|
|
435
|
-
* @param ref - Forwarded ref to the textarea element
|
|
436
|
-
* @returns JSX.Element - The rendered textarea element
|
|
437
|
-
*
|
|
438
|
-
* @example
|
|
439
|
-
* ```tsx
|
|
440
|
-
* // Basic textarea
|
|
441
|
-
* <Textarea placeholder="Enter your message..." />
|
|
442
|
-
*
|
|
443
|
-
* // Textarea with error state
|
|
444
|
-
* <Textarea
|
|
445
|
-
* placeholder="Comments"
|
|
446
|
-
* error={true}
|
|
447
|
-
* />
|
|
448
|
-
*
|
|
449
|
-
* // Large textarea with destructive variant
|
|
450
|
-
* <Textarea
|
|
451
|
-
* variant="destructive"
|
|
452
|
-
* size="lg"
|
|
453
|
-
* placeholder="Error textarea"
|
|
454
|
-
* />
|
|
455
|
-
* ```
|
|
456
|
-
*/
|
|
457
|
-
declare function Textarea({ className, variant, size, error, ref, ...props }: TextareaProps & {
|
|
458
|
-
ref?: React$1.Ref<HTMLTextAreaElement>;
|
|
459
|
-
}): react_jsx_runtime.JSX.Element;
|
|
460
|
-
declare namespace Textarea {
|
|
461
|
-
var displayName: string;
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
/**
|
|
465
|
-
* @file Alert Component Suite
|
|
466
|
-
* @package @jmruthers/pace-core
|
|
467
|
-
* @module Components
|
|
468
|
-
* @since 0.1.0
|
|
469
|
-
*
|
|
470
|
-
* A flexible and accessible alert component for displaying important messages.
|
|
471
|
-
* Includes Alert, AlertTitle, and AlertDescription subcomponents.
|
|
472
|
-
*
|
|
473
|
-
* Features:
|
|
474
|
-
* - Multiple visual variants (default, destructive, inline)
|
|
475
|
-
* - Title and description support
|
|
476
|
-
* - Semantic HTML: renders as `<p>` element with `role="alert"` (default) or custom role
|
|
477
|
-
* - Keyboard and screen reader accessible
|
|
478
|
-
* - Composable with icons and actions
|
|
479
|
-
* - Inline variant for lightweight text formatting
|
|
480
|
-
*
|
|
481
|
-
* @example
|
|
482
|
-
* ```tsx
|
|
483
|
-
* // Basic alert (renders as <p role="alert"> with <h5> title and <p> description)
|
|
484
|
-
* <Alert>
|
|
485
|
-
* <AlertTitle>Success</AlertTitle>
|
|
486
|
-
* <AlertDescription>Your changes have been saved.</AlertDescription>
|
|
487
|
-
* </Alert>
|
|
488
|
-
*
|
|
489
|
-
* // Destructive alert with icon (renders as <p role="alert"> with <h5> title and <p> description)
|
|
490
|
-
* <Alert variant="destructive">
|
|
491
|
-
* <ErrorIcon />
|
|
492
|
-
* <AlertTitle>Error</AlertTitle>
|
|
493
|
-
* <AlertDescription>Something went wrong.</AlertDescription>
|
|
494
|
-
* </Alert>
|
|
495
|
-
*
|
|
496
|
-
* // Status message (renders as <p role="status"> for informational messages)
|
|
497
|
-
* <Alert role="status" aria-live="polite">
|
|
498
|
-
* <AlertTitle>No data available</AlertTitle>
|
|
499
|
-
* <AlertDescription>Get started by adding your first entry.</AlertDescription>
|
|
500
|
-
* </Alert>
|
|
501
|
-
*
|
|
502
|
-
* // Inline alert (renders as React.Fragment with <strong> title and <span> description)
|
|
503
|
-
* <Alert variant="inline">
|
|
504
|
-
* <AlertTitle>Note:</AlertTitle>
|
|
505
|
-
* <AlertDescription>This is an inline message.</AlertDescription>
|
|
506
|
-
* </Alert>
|
|
507
|
-
* ```
|
|
508
|
-
*
|
|
509
|
-
* @accessibility
|
|
510
|
-
* - Uses semantic HTML: `<p>` element with `role="alert"` (default) for screen reader announcements
|
|
511
|
-
* - Can be customized with `role="status"` for informational messages
|
|
512
|
-
* - Title and description are semantically structured
|
|
513
|
-
* - Supports keyboard navigation and focus
|
|
514
|
-
*/
|
|
515
|
-
|
|
516
|
-
declare const Alert: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLParagraphElement> & {
|
|
517
|
-
variant?: "default" | "destructive" | "inline";
|
|
518
|
-
role?: string;
|
|
519
|
-
} & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
520
|
-
declare const AlertTitle: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLHeadingElement> & React$1.RefAttributes<HTMLHeadingElement>>;
|
|
521
|
-
declare const AlertDescription: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLParagraphElement> & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
522
|
-
|
|
523
|
-
/**
|
|
524
|
-
* @file Avatar Component
|
|
525
|
-
* @package @jmruthers/pace-core
|
|
526
|
-
* @module Components
|
|
527
|
-
* @since 0.1.0
|
|
528
|
-
*
|
|
529
|
-
* A simple and accessible avatar component for displaying user profile images or initials.
|
|
530
|
-
* Supports three approaches for image display:
|
|
531
|
-
* - File reference props (uses FileDisplay for Supabase storage)
|
|
532
|
-
* - File ID (uses file reference lookup)
|
|
533
|
-
* - Direct URL (simple img tag for public images)
|
|
534
|
-
*
|
|
535
|
-
* Features:
|
|
536
|
-
* - Circular avatar display
|
|
537
|
-
* - Image, fallback, and initials support
|
|
538
|
-
* - Customizable size and style
|
|
539
|
-
* - Keyboard and screen reader accessible
|
|
540
|
-
* - Graceful fallback for missing images
|
|
541
|
-
*
|
|
542
|
-
* @example
|
|
543
|
-
* ```tsx
|
|
544
|
-
* // Avatar with direct URL
|
|
545
|
-
* <Avatar
|
|
546
|
-
* src="/user.jpg"
|
|
547
|
-
* alt="User"
|
|
548
|
-
* fallback="AB"
|
|
549
|
-
* />
|
|
550
|
-
*
|
|
551
|
-
* // Avatar with file reference props
|
|
552
|
-
* <Avatar
|
|
553
|
-
* table_name="user_profiles"
|
|
554
|
-
* record_id={userId}
|
|
555
|
-
* organisation_id={orgId}
|
|
556
|
-
* category={FileCategory.PROFILE_PHOTOS}
|
|
557
|
-
* fallback="JD"
|
|
558
|
-
* />
|
|
559
|
-
*
|
|
560
|
-
* // Avatar with file ID
|
|
561
|
-
* <Avatar
|
|
562
|
-
* fileId={fileReferenceId}
|
|
563
|
-
* organisation_id={orgId}
|
|
564
|
-
* fallback="JD"
|
|
565
|
-
* />
|
|
566
|
-
*
|
|
567
|
-
* // Avatar with fallback only
|
|
568
|
-
* <Avatar fallback="JD" />
|
|
569
|
-
* ```
|
|
570
|
-
*
|
|
571
|
-
* @accessibility
|
|
572
|
-
* - Uses alt text for images
|
|
573
|
-
* - Fallback content is accessible to screen readers
|
|
574
|
-
* - Keyboard focusable and navigable
|
|
575
|
-
*/
|
|
576
|
-
|
|
577
|
-
interface AvatarProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
578
|
-
table_name?: string;
|
|
579
|
-
record_id?: string;
|
|
580
|
-
organisation_id?: string;
|
|
581
|
-
category?: FileCategory;
|
|
582
|
-
fileId?: string;
|
|
583
|
-
src?: string;
|
|
584
|
-
alt?: string;
|
|
585
|
-
fallback: string;
|
|
586
|
-
className?: string;
|
|
587
|
-
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
588
|
-
}
|
|
589
|
-
/**
|
|
590
|
-
* Avatar component for displaying user profile images or initials
|
|
591
|
-
*/
|
|
592
|
-
declare const Avatar: React$1.ForwardRefExoticComponent<AvatarProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
593
|
-
|
|
594
|
-
/**
|
|
595
|
-
* Badge variant type
|
|
596
|
-
* Defines the visual style, color palette, and shade intensity of the badge.
|
|
597
|
-
* Format: {style}-{color}-{shade}
|
|
598
|
-
* - style: 'solid' | 'outline' | 'soft'
|
|
599
|
-
* - color: 'main' | 'sec' | 'acc'
|
|
600
|
-
* - shade: 'muted' | 'normal' | 'strong'
|
|
601
|
-
*/
|
|
602
|
-
type BadgeVariant = 'solid-main-muted' | 'solid-main-normal' | 'solid-main-strong' | 'solid-sec-muted' | 'solid-sec-normal' | 'solid-sec-strong' | 'solid-acc-muted' | 'solid-acc-normal' | 'solid-acc-strong' | 'outline-main-muted' | 'outline-main-normal' | 'outline-main-strong' | 'outline-sec-muted' | 'outline-sec-normal' | 'outline-sec-strong' | 'outline-acc-muted' | 'outline-acc-normal' | 'outline-acc-strong' | 'soft-main-muted' | 'soft-main-normal' | 'soft-main-strong' | 'soft-sec-muted' | 'soft-sec-normal' | 'soft-sec-strong' | 'soft-acc-muted' | 'soft-acc-normal' | 'soft-acc-strong';
|
|
603
|
-
/**
|
|
604
|
-
* Badge component props
|
|
605
|
-
* Extends standard HTML span attributes with badge-specific styling options.
|
|
606
|
-
*
|
|
607
|
-
* @interface BadgeProps
|
|
608
|
-
*/
|
|
609
|
-
interface BadgeProps extends React$1.HTMLAttributes<HTMLSpanElement> {
|
|
610
|
-
/** Visual variant of the badge (style-color-shade) */
|
|
611
|
-
variant?: BadgeVariant;
|
|
612
|
-
}
|
|
613
|
-
/**
|
|
614
|
-
* Badge Component
|
|
615
|
-
* A small, non-interactive visual label for displaying concise information.
|
|
616
|
-
*
|
|
617
|
-
* @component
|
|
618
|
-
* @example
|
|
619
|
-
* ```tsx
|
|
620
|
-
* // Default variant
|
|
621
|
-
* <Badge>New</Badge>
|
|
622
|
-
*
|
|
623
|
-
* // Specific variant
|
|
624
|
-
* <Badge variant="solid-main-normal">Active</Badge>
|
|
625
|
-
*
|
|
626
|
-
* // Outline variant
|
|
627
|
-
* <Badge variant="outline-sec-muted">Pending</Badge>
|
|
628
|
-
*
|
|
629
|
-
* // Soft variant
|
|
630
|
-
* <Badge variant="soft-acc-strong">Featured</Badge>
|
|
631
|
-
* ```
|
|
632
|
-
*/
|
|
633
|
-
declare function Badge({ className, variant, ref, ...props }: BadgeProps & {
|
|
634
|
-
ref?: React$1.Ref<HTMLSpanElement>;
|
|
635
|
-
}): react_jsx_runtime.JSX.Element;
|
|
636
|
-
declare namespace Badge {
|
|
637
|
-
var displayName: string;
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
/**
|
|
641
|
-
* @file Checkbox Component
|
|
642
|
-
* @package @jmruthers/pace-core
|
|
643
|
-
* @module Components
|
|
644
|
-
* @since 0.1.0
|
|
645
|
-
*
|
|
646
|
-
* An accessible checkbox component built on top of Radix UI's Checkbox primitive.
|
|
647
|
-
* Provides a customizable checkbox input with proper keyboard and screen reader support.
|
|
648
|
-
*
|
|
649
|
-
* Features:
|
|
650
|
-
* - Customizable styling via className
|
|
651
|
-
* - Built-in focus and hover states
|
|
652
|
-
* - Disabled state support
|
|
653
|
-
* - Checked state indicator
|
|
654
|
-
* - Full keyboard navigation
|
|
655
|
-
* - Screen reader support
|
|
656
|
-
*
|
|
657
|
-
* @example
|
|
658
|
-
* ```tsx
|
|
659
|
-
* // Basic usage
|
|
660
|
-
* <Checkbox />
|
|
661
|
-
*
|
|
662
|
-
* // With label
|
|
663
|
-
* <>
|
|
664
|
-
* <Checkbox id="terms" />
|
|
665
|
-
* <label htmlFor="terms">Accept terms and conditions</label>
|
|
666
|
-
* </>
|
|
667
|
-
*
|
|
668
|
-
* // Disabled state
|
|
669
|
-
* <Checkbox disabled />
|
|
670
|
-
*
|
|
671
|
-
* // Controlled component
|
|
672
|
-
* const [checked, setChecked] = React.useState(false);
|
|
673
|
-
* <Checkbox
|
|
674
|
-
* checked={checked}
|
|
675
|
-
* onCheckedChange={setChecked}
|
|
676
|
-
* />
|
|
677
|
-
* ```
|
|
678
|
-
*
|
|
679
|
-
* @accessibility
|
|
680
|
-
* - Uses Radix UI's accessible checkbox primitive
|
|
681
|
-
* - Proper keyboard navigation (Space to toggle)
|
|
682
|
-
* - Screen reader announcements for state changes
|
|
683
|
-
* - Focus visible styles for keyboard users
|
|
684
|
-
* - ARIA attributes handled automatically
|
|
685
|
-
*/
|
|
686
|
-
|
|
687
|
-
declare const Checkbox: React$1.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
688
|
-
|
|
689
|
-
/**
|
|
690
|
-
* @file Switch Component
|
|
691
|
-
* @package @jmruthers/pace-core
|
|
692
|
-
* @module Components/Switch
|
|
693
|
-
* @since 0.5.67
|
|
694
|
-
*
|
|
695
|
-
* A toggle switch component built on Radix UI primitives.
|
|
696
|
-
* Provides an accessible, keyboard-navigable switch for boolean states.
|
|
697
|
-
*
|
|
698
|
-
* Features:
|
|
699
|
-
* - WCAG 2.1 AA compliant
|
|
700
|
-
* - Keyboard navigation (Space/Enter)
|
|
701
|
-
* - Focus visible indicators
|
|
702
|
-
* - Disabled state support
|
|
703
|
-
* - Smooth animations
|
|
704
|
-
* - Tailwind v4 compatible
|
|
705
|
-
* - Theme-aware colors
|
|
706
|
-
*
|
|
707
|
-
* @example
|
|
708
|
-
* ```tsx
|
|
709
|
-
* import { Switch } from '@jmruthers/pace-core';
|
|
710
|
-
*
|
|
711
|
-
* function Example() {
|
|
712
|
-
* const [checked, setChecked] = React.useState(false);
|
|
713
|
-
*
|
|
714
|
-
* return (
|
|
715
|
-
* <>
|
|
716
|
-
* <Switch
|
|
717
|
-
* checked={checked}
|
|
718
|
-
* onCheckedChange={setChecked}
|
|
719
|
-
* id="notifications"
|
|
720
|
-
* />
|
|
721
|
-
* <label htmlFor="notifications">
|
|
722
|
-
* Enable notifications
|
|
723
|
-
* </label>
|
|
724
|
-
* </>
|
|
725
|
-
* );
|
|
726
|
-
* }
|
|
727
|
-
* ```
|
|
728
|
-
*
|
|
729
|
-
* @example With Form
|
|
730
|
-
* ```tsx
|
|
731
|
-
* import { Switch, Label } from '@jmruthers/pace-core';
|
|
732
|
-
*
|
|
733
|
-
* function FormExample() {
|
|
734
|
-
* return (
|
|
735
|
-
* <>
|
|
736
|
-
* <Switch id="terms" />
|
|
737
|
-
* <Label htmlFor="terms">
|
|
738
|
-
* I agree to the terms and conditions
|
|
739
|
-
* </Label>
|
|
740
|
-
* </>
|
|
741
|
-
* );
|
|
742
|
-
* }
|
|
743
|
-
* ```
|
|
744
|
-
*
|
|
745
|
-
* @example Disabled State
|
|
746
|
-
* ```tsx
|
|
747
|
-
* <Switch disabled checked />
|
|
748
|
-
* ```
|
|
749
|
-
*
|
|
750
|
-
* @accessibility
|
|
751
|
-
* - Uses Radix UI's accessible switch primitive
|
|
752
|
-
* - Proper keyboard navigation (Space to toggle)
|
|
753
|
-
* - Screen reader announcements for state changes
|
|
754
|
-
* - Focus visible styles for keyboard users
|
|
755
|
-
* - ARIA attributes handled automatically
|
|
756
|
-
*/
|
|
757
|
-
|
|
758
|
-
/**
|
|
759
|
-
* Switch component props
|
|
760
|
-
* Extends all props from Radix UI Switch.Root
|
|
761
|
-
*/
|
|
762
|
-
interface SwitchProps extends React$1.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root> {
|
|
763
|
-
/**
|
|
764
|
-
* Additional CSS classes to apply to the switch
|
|
765
|
-
*/
|
|
766
|
-
className?: string;
|
|
767
|
-
}
|
|
768
|
-
/**
|
|
769
|
-
* Switch component
|
|
770
|
-
*
|
|
771
|
-
* A toggle switch for boolean states. Built on Radix UI for accessibility.
|
|
772
|
-
*
|
|
773
|
-
* @component
|
|
774
|
-
* @example
|
|
775
|
-
* ```tsx
|
|
776
|
-
* <Switch checked={isEnabled} onCheckedChange={setIsEnabled} />
|
|
777
|
-
* ```
|
|
778
|
-
*/
|
|
779
|
-
declare const Switch: React$1.ForwardRefExoticComponent<SwitchProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
780
|
-
|
|
781
|
-
/**
|
|
782
|
-
* @file Progress Component
|
|
783
|
-
* @package @jmruthers/pace-core
|
|
784
|
-
* @module Components/Progress
|
|
785
|
-
* @since 0.1.0
|
|
786
|
-
*
|
|
787
|
-
* An accessible progress bar component built on the native HTML `<progress>` element.
|
|
788
|
-
* Provides smooth animations and proper ARIA attributes for screen readers.
|
|
789
|
-
*
|
|
790
|
-
* Features:
|
|
791
|
-
* - Smooth progress animations
|
|
792
|
-
* - Customizable value and max range
|
|
793
|
-
* - Native accessibility support (role="progressbar" automatically applied)
|
|
794
|
-
* - Customizable styling and appearance
|
|
795
|
-
* - Responsive design
|
|
796
|
-
* - Indeterminate state support
|
|
797
|
-
*
|
|
798
|
-
* @example
|
|
799
|
-
* ```tsx
|
|
800
|
-
* // Basic progress bar
|
|
801
|
-
* <Progress value={50} />
|
|
802
|
-
*
|
|
803
|
-
* // Progress with custom max value
|
|
804
|
-
* <Progress value={7} max={10} />
|
|
805
|
-
*
|
|
806
|
-
* // Progress with custom styling
|
|
807
|
-
* <Progress
|
|
808
|
-
* value={75}
|
|
809
|
-
* className="h-4 bg-sec-200"
|
|
810
|
-
* />
|
|
811
|
-
*
|
|
812
|
-
* // Animated progress (controlled)
|
|
813
|
-
* const [progress, setProgress] = useState(0);
|
|
814
|
-
*
|
|
815
|
-
* useEffect(() => {
|
|
816
|
-
* const timer = setInterval(() => {
|
|
817
|
-
* setProgress(prev => prev >= 100 ? 0 : prev + 10);
|
|
818
|
-
* }, 1000);
|
|
819
|
-
* return () => clearInterval(timer);
|
|
820
|
-
* }, []);
|
|
821
|
-
*
|
|
822
|
-
* <Progress value={progress} />
|
|
823
|
-
*
|
|
824
|
-
* // Indeterminate progress (no value)
|
|
825
|
-
* <Progress />
|
|
826
|
-
* ```
|
|
827
|
-
*
|
|
828
|
-
* @accessibility
|
|
829
|
-
* - WCAG 2.1 AA compliant
|
|
830
|
-
* - Native `<progress>` element provides role="progressbar" automatically
|
|
831
|
-
* - Screen reader announcements for progress changes
|
|
832
|
-
* - High contrast support
|
|
833
|
-
*
|
|
834
|
-
* @performance
|
|
835
|
-
* - CSS transitions for smooth animations
|
|
836
|
-
* - Efficient re-rendering
|
|
837
|
-
* - Minimal DOM structure (native HTML element)
|
|
838
|
-
*
|
|
839
|
-
* @dependencies
|
|
840
|
-
* - React 19+ - Hooks and refs
|
|
841
|
-
* - Tailwind CSS - Styling
|
|
842
|
-
*/
|
|
843
|
-
|
|
844
|
-
/**
|
|
845
|
-
* Props for the Progress component
|
|
846
|
-
*/
|
|
847
|
-
interface ProgressProps extends React$1.HTMLAttributes<HTMLProgressElement> {
|
|
848
|
-
/** Current progress value (0 to max). Omit for indeterminate state. */
|
|
849
|
-
value?: number;
|
|
850
|
-
/** Maximum progress value (default: 100) */
|
|
851
|
-
max?: number;
|
|
852
|
-
}
|
|
853
|
-
/**
|
|
854
|
-
* Progress component
|
|
855
|
-
* An accessible progress bar with smooth animations using native HTML `<progress>` element
|
|
856
|
-
*
|
|
857
|
-
* @param props - Progress configuration and styling
|
|
858
|
-
* @param ref - Forwarded ref to the progress element
|
|
859
|
-
* @returns JSX.Element - The rendered progress bar
|
|
860
|
-
*
|
|
861
|
-
* @example
|
|
862
|
-
* ```tsx
|
|
863
|
-
* <Progress value={75} max={100} />
|
|
864
|
-
* ```
|
|
865
|
-
*/
|
|
866
|
-
declare const Progress: React$1.ForwardRefExoticComponent<ProgressProps & React$1.RefAttributes<HTMLProgressElement>>;
|
|
867
|
-
|
|
868
|
-
/**
|
|
869
|
-
* Dialog size variants
|
|
870
|
-
* @public
|
|
871
|
-
*/
|
|
872
|
-
type DialogSize = 'sm' | 'md' | 'lg' | 'xl' | 'full' | 'auto';
|
|
873
|
-
/**
|
|
874
|
-
* Props for the Dialog root component
|
|
875
|
-
* @public
|
|
876
|
-
*/
|
|
877
|
-
interface DialogProps {
|
|
878
|
-
children: React$1.ReactNode;
|
|
879
|
-
open?: boolean;
|
|
880
|
-
defaultOpen?: boolean;
|
|
881
|
-
onOpenChange?: (open: boolean) => void;
|
|
882
|
-
}
|
|
883
|
-
/**
|
|
884
|
-
* Props for the DialogTrigger component
|
|
885
|
-
* @public
|
|
886
|
-
*/
|
|
887
|
-
interface DialogTriggerProps {
|
|
888
|
-
children: React$1.ReactNode;
|
|
889
|
-
asChild?: boolean;
|
|
890
|
-
className?: string;
|
|
891
|
-
onClick?: (e: React$1.MouseEvent) => void;
|
|
892
|
-
}
|
|
893
|
-
/**
|
|
894
|
-
* Enhanced props for the DialogContent component with size variants and customization
|
|
895
|
-
* Uses semantic HTML dialog element
|
|
896
|
-
* @public
|
|
897
|
-
*/
|
|
898
|
-
interface DialogContentProps extends React$1.HTMLAttributes<HTMLDialogElement> {
|
|
899
|
-
/** Dialog size variant */
|
|
900
|
-
size?: DialogSize;
|
|
901
|
-
/** Whether to show the close button */
|
|
902
|
-
showCloseButton?: boolean;
|
|
903
|
-
/** Whether to prevent closing on escape key */
|
|
904
|
-
preventCloseOnEscape?: boolean;
|
|
905
|
-
/** Whether to prevent closing on outside click */
|
|
906
|
-
preventCloseOnOutsideClick?: boolean;
|
|
907
|
-
/** Maximum height as percentage of viewport height (0-100) */
|
|
908
|
-
maxHeightPercent?: number;
|
|
909
|
-
/** Maximum width as percentage of viewport width (0-100) */
|
|
910
|
-
maxWidthPercent?: number;
|
|
911
|
-
/** Enable smart scrolling with sticky header/footer */
|
|
912
|
-
enableScrolling?: boolean;
|
|
913
|
-
/** Custom max height in CSS units (overrides maxHeightPercent) */
|
|
914
|
-
maxHeight?: string;
|
|
915
|
-
/** Custom max width in CSS units (overrides maxWidthPercent and size) */
|
|
916
|
-
maxWidth?: string;
|
|
917
|
-
/** Minimum height in CSS units */
|
|
918
|
-
minHeight?: string;
|
|
919
|
-
/** Minimum width in CSS units */
|
|
920
|
-
minWidth?: string;
|
|
921
|
-
/** Dialog title - sets native title attribute and aria-labelledby */
|
|
922
|
-
title?: string;
|
|
923
|
-
/** Dialog description - sets native aria-description attribute */
|
|
924
|
-
description?: string;
|
|
925
|
-
/** Whether to persist open state across tab switches */
|
|
926
|
-
persistOpenState?: boolean;
|
|
927
|
-
}
|
|
928
|
-
/**
|
|
929
|
-
* Props for the DialogPortal component
|
|
930
|
-
* @public
|
|
931
|
-
*/
|
|
932
|
-
interface DialogPortalProps {
|
|
933
|
-
children: React$1.ReactNode;
|
|
934
|
-
}
|
|
935
|
-
/**
|
|
936
|
-
* Props for the DialogHeader component (semantic header element)
|
|
937
|
-
* @public
|
|
938
|
-
*/
|
|
939
|
-
interface DialogHeaderProps extends React$1.HTMLAttributes<HTMLElement> {
|
|
940
|
-
/** Whether this header should be sticky when scrolling is enabled */
|
|
941
|
-
sticky?: boolean;
|
|
942
|
-
}
|
|
943
|
-
/**
|
|
944
|
-
* Props for the DialogFooter component (semantic footer element)
|
|
945
|
-
* @public
|
|
946
|
-
*/
|
|
947
|
-
interface DialogFooterProps extends React$1.HTMLAttributes<HTMLElement> {
|
|
948
|
-
/** Whether this footer should be sticky when scrolling is enabled */
|
|
949
|
-
sticky?: boolean;
|
|
950
|
-
}
|
|
951
|
-
/**
|
|
952
|
-
* Props for the DialogBody component (semantic main element)
|
|
953
|
-
* @public
|
|
954
|
-
*/
|
|
955
|
-
interface DialogBodyProps extends React$1.HTMLAttributes<HTMLElement> {
|
|
956
|
-
/** Custom max height for the scrollable area */
|
|
957
|
-
maxHeight?: string;
|
|
958
|
-
/** HTML content to render (will be sanitized for security) */
|
|
959
|
-
htmlContent?: string;
|
|
960
|
-
/** Whether to allow HTML content rendering (default: true) */
|
|
961
|
-
allowHtml?: boolean;
|
|
962
|
-
/** Whether to use strict HTML sanitization (default: true) */
|
|
963
|
-
strictSanitization?: boolean;
|
|
964
|
-
/** Whether to log HTML sanitization warnings to console (default: false) */
|
|
965
|
-
logWarnings?: boolean;
|
|
966
|
-
}
|
|
967
|
-
/**
|
|
968
|
-
* Props for the DialogTitle component
|
|
969
|
-
* @public
|
|
970
|
-
*/
|
|
971
|
-
interface DialogTitleProps extends React$1.HTMLAttributes<HTMLHeadingElement> {
|
|
972
|
-
/** HTML content to render as title (will be sanitized for security) */
|
|
973
|
-
htmlContent?: string;
|
|
974
|
-
/** Whether to allow HTML content rendering (default: true) */
|
|
975
|
-
allowHtml?: boolean;
|
|
976
|
-
}
|
|
977
|
-
/**
|
|
978
|
-
* Props for the DialogDescription component
|
|
979
|
-
* @public
|
|
980
|
-
*/
|
|
981
|
-
interface DialogDescriptionProps extends React$1.HTMLAttributes<HTMLParagraphElement> {
|
|
982
|
-
/** HTML content to render as description (will be sanitized for security) */
|
|
983
|
-
htmlContent?: string;
|
|
984
|
-
/** Whether to allow HTML content rendering (default: true) */
|
|
985
|
-
allowHtml?: boolean;
|
|
986
|
-
}
|
|
987
|
-
/**
|
|
988
|
-
* Dialog root component
|
|
989
|
-
* Provides context for dialog state management
|
|
990
|
-
*/
|
|
991
|
-
declare const Dialog: React$1.NamedExoticComponent<DialogProps>;
|
|
992
|
-
/**
|
|
993
|
-
* DialogTrigger component
|
|
994
|
-
* Opens the dialog when clicked
|
|
995
|
-
*/
|
|
996
|
-
declare const DialogTrigger: React$1.ForwardRefExoticComponent<DialogTriggerProps & React$1.RefAttributes<HTMLElement>>;
|
|
997
|
-
/**
|
|
998
|
-
* DialogPortal component
|
|
999
|
-
* Portals dialog content to document.body
|
|
1000
|
-
*/
|
|
1001
|
-
declare const DialogPortal: React$1.FC<DialogPortalProps>;
|
|
1002
|
-
/**
|
|
1003
|
-
* DialogContent component
|
|
1004
|
-
* The main content container using semantic HTML <dialog> element with enhanced features
|
|
1005
|
-
*
|
|
1006
|
-
* @param props - Content configuration and styling
|
|
1007
|
-
* @param ref - Forwarded ref to the dialog element
|
|
1008
|
-
* @returns JSX.Element - The semantic dialog content with overlay and optional close button
|
|
1009
|
-
*/
|
|
1010
|
-
declare const DialogContent: React$1.ForwardRefExoticComponent<DialogContentProps & React$1.RefAttributes<HTMLDialogElement>>;
|
|
1011
|
-
/**
|
|
1012
|
-
* Props for the DialogClose component
|
|
1013
|
-
* @public
|
|
1014
|
-
*/
|
|
1015
|
-
interface DialogCloseProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
1016
|
-
}
|
|
1017
|
-
/**
|
|
1018
|
-
* Props for the DialogClose component
|
|
1019
|
-
* @public
|
|
1020
|
-
*/
|
|
1021
|
-
interface DialogCloseProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
1022
|
-
/** Whether to merge props with child element instead of rendering a button */
|
|
1023
|
-
asChild?: boolean;
|
|
1024
|
-
}
|
|
1025
|
-
/**
|
|
1026
|
-
* DialogClose component
|
|
1027
|
-
* Button to close the dialog
|
|
1028
|
-
*/
|
|
1029
|
-
declare const DialogClose: React$1.ForwardRefExoticComponent<DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1030
|
-
/**
|
|
1031
|
-
* DialogHeader component
|
|
1032
|
-
* Semantic header container for dialog title and description with optional sticky behavior
|
|
1033
|
-
*/
|
|
1034
|
-
declare const DialogHeader: {
|
|
1035
|
-
({ className, sticky, ...props }: DialogHeaderProps): react_jsx_runtime.JSX.Element;
|
|
1036
|
-
displayName: string;
|
|
1037
|
-
};
|
|
1038
|
-
/**
|
|
1039
|
-
* DialogBody component
|
|
1040
|
-
* Semantic main content area for dialog body content with scrollable functionality
|
|
1041
|
-
*/
|
|
1042
|
-
declare const DialogBody: {
|
|
1043
|
-
({ className, maxHeight, style, htmlContent, allowHtml, strictSanitization, logWarnings, children, ...props }: DialogBodyProps): react_jsx_runtime.JSX.Element;
|
|
1044
|
-
displayName: string;
|
|
1045
|
-
};
|
|
1046
|
-
/**
|
|
1047
|
-
* DialogFooter component
|
|
1048
|
-
* Semantic footer container for dialog action buttons with optional sticky behavior
|
|
1049
|
-
*/
|
|
1050
|
-
declare const DialogFooter: {
|
|
1051
|
-
({ className, sticky, ...props }: DialogFooterProps): react_jsx_runtime.JSX.Element;
|
|
1052
|
-
displayName: string;
|
|
1053
|
-
};
|
|
1054
|
-
/**
|
|
1055
|
-
* DialogTitle component
|
|
1056
|
-
* Title element with ARIA support
|
|
1057
|
-
*/
|
|
1058
|
-
declare const DialogTitle: React$1.ForwardRefExoticComponent<DialogTitleProps & React$1.RefAttributes<HTMLHeadingElement>>;
|
|
1059
|
-
/**
|
|
1060
|
-
* DialogDescription component
|
|
1061
|
-
* Description element with ARIA support
|
|
1062
|
-
*/
|
|
1063
|
-
declare const DialogDescription: React$1.ForwardRefExoticComponent<DialogDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
1064
|
-
|
|
1065
|
-
/**
|
|
1066
|
-
* Direction for Select dropdown opening.
|
|
1067
|
-
* Controls whether the dropdown opens upward or downward.
|
|
1068
|
-
*/
|
|
1069
|
-
type SelectDirection = "up" | "down";
|
|
1070
|
-
/**
|
|
1071
|
-
* Props for the useSelectState hook.
|
|
1072
|
-
*/
|
|
1073
|
-
interface UseSelectStateProps {
|
|
1074
|
-
value?: string;
|
|
1075
|
-
defaultValue?: string;
|
|
1076
|
-
selectedText?: string;
|
|
1077
|
-
open?: boolean;
|
|
1078
|
-
defaultOpen?: boolean;
|
|
1079
|
-
disabled?: boolean;
|
|
1080
|
-
onValueChange?: (value: string) => void;
|
|
1081
|
-
onOpenChange?: (open: boolean) => void;
|
|
1082
|
-
}
|
|
1083
|
-
/**
|
|
1084
|
-
* Props for the Select root component.
|
|
1085
|
-
*/
|
|
1086
|
-
interface SelectProps extends Omit<React$1.HTMLAttributes<HTMLFieldSetElement>, "onChange" | "onKeyDown" | "onFocus" | "onBlur"> {
|
|
1087
|
-
children: React$1.ReactNode;
|
|
1088
|
-
className?: string;
|
|
1089
|
-
direction?: SelectDirection;
|
|
1090
|
-
showCheckmark?: boolean;
|
|
1091
|
-
}
|
|
1092
|
-
/**
|
|
1093
|
-
* Props for the SelectTrigger component.
|
|
1094
|
-
*/
|
|
1095
|
-
interface SelectTriggerProps extends Omit<ButtonProps, "onClick" | "onKeyDown"> {
|
|
1096
|
-
children: React$1.ReactNode;
|
|
1097
|
-
asChild?: boolean;
|
|
1098
|
-
}
|
|
1099
|
-
/**
|
|
1100
|
-
* Props for the SelectValue component.
|
|
1101
|
-
*/
|
|
1102
|
-
interface SelectValueProps {
|
|
1103
|
-
placeholder?: string;
|
|
1104
|
-
children?: React$1.ReactNode;
|
|
1105
|
-
}
|
|
1106
|
-
/**
|
|
1107
|
-
* Props for the SelectContent component.
|
|
1108
|
-
*/
|
|
1109
|
-
interface SelectContentProps {
|
|
1110
|
-
children: React$1.ReactNode;
|
|
1111
|
-
className?: string;
|
|
1112
|
-
searchable?: boolean;
|
|
1113
|
-
searchPlaceholder?: string;
|
|
1114
|
-
maxHeight?: string;
|
|
1115
|
-
style?: React$1.CSSProperties;
|
|
1116
|
-
}
|
|
1117
|
-
/**
|
|
1118
|
-
* Props for the SelectItem component.
|
|
1119
|
-
*/
|
|
1120
|
-
interface SelectItemProps {
|
|
1121
|
-
value: string;
|
|
1122
|
-
children: React$1.ReactNode;
|
|
1123
|
-
disabled?: boolean;
|
|
1124
|
-
className?: string;
|
|
1125
|
-
onClick?: (e: React$1.MouseEvent) => void;
|
|
1126
|
-
showCheckmark?: boolean;
|
|
1127
|
-
}
|
|
1128
|
-
|
|
1129
|
-
/**
|
|
1130
|
-
* @file Select Component - Refactored SOLID Implementation
|
|
1131
|
-
* @package @jmruthers/pace-core
|
|
1132
|
-
* @module Components/Select
|
|
1133
|
-
* @since 0.4.0
|
|
1134
|
-
*
|
|
1135
|
-
* Refactored Select component following SOLID principles:
|
|
1136
|
-
* - Single Responsibility: Each component has one clear purpose
|
|
1137
|
-
* - Open/Closed: Easy to extend without modification
|
|
1138
|
-
* - Liskov Substitution: Components can be substituted
|
|
1139
|
-
* - Interface Segregation: Small, focused interfaces
|
|
1140
|
-
* - Dependency Inversion: Depends on abstractions, not concretions
|
|
1141
|
-
*/
|
|
1142
|
-
|
|
1143
|
-
/**
|
|
1144
|
-
* Select component root.
|
|
1145
|
-
* Provides select dropdown functionality with search, keyboard navigation, and accessibility.
|
|
1146
|
-
*
|
|
1147
|
-
* @param props - Select configuration
|
|
1148
|
-
* @param ref - Forwarded ref to the fieldset element
|
|
1149
|
-
* @returns The rendered select component
|
|
1150
|
-
*/
|
|
1151
|
-
declare const Select: React$1.ForwardRefExoticComponent<SelectProps & UseSelectStateProps & React$1.RefAttributes<HTMLFieldSetElement>>;
|
|
1152
|
-
/**
|
|
1153
|
-
* Select trigger button component.
|
|
1154
|
-
* Opens/closes the select dropdown and displays the selected value.
|
|
1155
|
-
*
|
|
1156
|
-
* @param props - Select trigger configuration
|
|
1157
|
-
* @param ref - Forwarded ref to the button element
|
|
1158
|
-
* @returns The rendered select trigger
|
|
1159
|
-
*/
|
|
1160
|
-
declare const SelectTrigger: React$1.ForwardRefExoticComponent<SelectTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1161
|
-
/**
|
|
1162
|
-
* Select value display component.
|
|
1163
|
-
* Shows the selected value or placeholder text.
|
|
1164
|
-
*
|
|
1165
|
-
* @param props - Select value configuration
|
|
1166
|
-
* @param ref - Forwarded ref to the span element
|
|
1167
|
-
* @returns The rendered select value display
|
|
1168
|
-
*/
|
|
1169
|
-
declare const SelectValue: React$1.ForwardRefExoticComponent<SelectValueProps & React$1.RefAttributes<HTMLSpanElement>>;
|
|
1170
|
-
/**
|
|
1171
|
-
* Select content/dropdown component.
|
|
1172
|
-
* Contains the list of selectable options.
|
|
1173
|
-
*
|
|
1174
|
-
* @param props - Select content configuration
|
|
1175
|
-
* @param ref - Forwarded ref to the list element
|
|
1176
|
-
* @returns The rendered select content
|
|
1177
|
-
*/
|
|
1178
|
-
declare const SelectContent: React$1.ForwardRefExoticComponent<SelectContentProps & React$1.RefAttributes<HTMLUListElement>>;
|
|
1179
|
-
/**
|
|
1180
|
-
* Select item component.
|
|
1181
|
-
* Represents a single selectable option in the dropdown.
|
|
1182
|
-
*
|
|
1183
|
-
* @param props - Select item configuration
|
|
1184
|
-
* @param ref - Forwarded ref to the list item element
|
|
1185
|
-
* @returns The rendered select item
|
|
1186
|
-
*/
|
|
1187
|
-
declare const SelectItem: React$1.ForwardRefExoticComponent<SelectItemProps & React$1.RefAttributes<HTMLLIElement>>;
|
|
1188
|
-
/**
|
|
1189
|
-
* Select group component.
|
|
1190
|
-
* Groups related select items together using a nested list structure.
|
|
1191
|
-
*
|
|
1192
|
-
* @param props - Select group configuration
|
|
1193
|
-
* @param ref - Forwarded ref to the ul element
|
|
1194
|
-
* @returns The rendered select group
|
|
1195
|
-
*/
|
|
1196
|
-
declare const SelectGroup: React$1.ForwardRefExoticComponent<{
|
|
1197
|
-
children: React$1.ReactNode;
|
|
1198
|
-
className?: string;
|
|
1199
|
-
} & React$1.RefAttributes<HTMLUListElement>>;
|
|
1200
|
-
/**
|
|
1201
|
-
* Select label component.
|
|
1202
|
-
* Provides a label for a group of select items.
|
|
1203
|
-
*
|
|
1204
|
-
* @param props - Select label configuration
|
|
1205
|
-
* @param ref - Forwarded ref to the li element
|
|
1206
|
-
* @returns The rendered select label
|
|
1207
|
-
*/
|
|
1208
|
-
declare const SelectLabel: React$1.ForwardRefExoticComponent<{
|
|
1209
|
-
children: React$1.ReactNode;
|
|
1210
|
-
className?: string;
|
|
1211
|
-
} & React$1.RefAttributes<HTMLLIElement>>;
|
|
1212
|
-
/**
|
|
1213
|
-
* Select separator component.
|
|
1214
|
-
* Provides visual separation between groups of select items.
|
|
1215
|
-
*
|
|
1216
|
-
* @param props - Select separator configuration
|
|
1217
|
-
* @param ref - Forwarded ref to the hr element
|
|
1218
|
-
* @returns The rendered select separator
|
|
1219
|
-
*/
|
|
1220
|
-
declare const SelectSeparator: React$1.ForwardRefExoticComponent<{
|
|
1221
|
-
className?: string;
|
|
1222
|
-
} & React$1.RefAttributes<HTMLHRElement>>;
|
|
1223
|
-
|
|
1224
|
-
/**
|
|
1225
|
-
* @file Tabs Component System
|
|
1226
|
-
* @package @jmruthers/pace-core
|
|
1227
|
-
* @module Components/Tabs
|
|
1228
|
-
* @since 0.5.141
|
|
1229
|
-
*
|
|
1230
|
-
* A comprehensive tabs component system built on top of Radix UI primitives.
|
|
1231
|
-
* Provides accessible tabbed interfaces with keyboard navigation and ARIA support.
|
|
1232
|
-
*
|
|
1233
|
-
* Features:
|
|
1234
|
-
* - Controlled and uncontrolled modes
|
|
1235
|
-
* - Keyboard navigation (arrow keys)
|
|
1236
|
-
* - Accessible ARIA attributes
|
|
1237
|
-
* - Customizable styling via className
|
|
1238
|
-
* - Support for icons in triggers
|
|
1239
|
-
* - Compound component pattern
|
|
1240
|
-
*
|
|
1241
|
-
* @example
|
|
1242
|
-
* ```tsx
|
|
1243
|
-
* // Basic tabs
|
|
1244
|
-
* <Tabs defaultValue="tab1">
|
|
1245
|
-
* <TabsList>
|
|
1246
|
-
* <TabsTrigger value="tab1">Tab 1</TabsTrigger>
|
|
1247
|
-
* <TabsTrigger value="tab2">Tab 2</TabsTrigger>
|
|
1248
|
-
* </TabsList>
|
|
1249
|
-
* <TabsContent value="tab1">Content 1</TabsContent>
|
|
1250
|
-
* <TabsContent value="tab2">Content 2</TabsContent>
|
|
1251
|
-
* </Tabs>
|
|
1252
|
-
*
|
|
1253
|
-
* // Controlled tabs
|
|
1254
|
-
* <Tabs value={activeTab} onValueChange={setActiveTab}>
|
|
1255
|
-
* <TabsList>
|
|
1256
|
-
* <TabsTrigger value="transport">
|
|
1257
|
-
* <Plane size={16} /> Transport
|
|
1258
|
-
* </TabsTrigger>
|
|
1259
|
-
* <TabsTrigger value="accommodation">
|
|
1260
|
-
* <Building size={16} /> Accommodation
|
|
1261
|
-
* </TabsTrigger>
|
|
1262
|
-
* </TabsList>
|
|
1263
|
-
* <TabsContent value="transport">
|
|
1264
|
-
* <TransportPlanningView />
|
|
1265
|
-
* </TabsContent>
|
|
1266
|
-
* <TabsContent value="accommodation">
|
|
1267
|
-
* <AccommodationPlanningView />
|
|
1268
|
-
* </TabsContent>
|
|
1269
|
-
* </Tabs>
|
|
1270
|
-
* ```
|
|
1271
|
-
*
|
|
1272
|
-
* @accessibility
|
|
1273
|
-
* - WCAG 2.1 AA compliant
|
|
1274
|
-
* - Keyboard navigation (Arrow keys, Home, End)
|
|
1275
|
-
* - Screen reader support with proper ARIA attributes
|
|
1276
|
-
* - Focus management
|
|
1277
|
-
* - Tab panel association
|
|
1278
|
-
*/
|
|
1279
|
-
|
|
1280
|
-
interface TabsProps extends TabsPrimitive.TabsProps {
|
|
1281
|
-
}
|
|
1282
|
-
/**
|
|
1283
|
-
* Tabs root component
|
|
1284
|
-
* Provides the context for tab navigation and state management
|
|
1285
|
-
*
|
|
1286
|
-
* @component
|
|
1287
|
-
* @example
|
|
1288
|
-
* ```tsx
|
|
1289
|
-
* <Tabs defaultValue="tab1">
|
|
1290
|
-
* <TabsList>...</TabsList>
|
|
1291
|
-
* <TabsContent value="tab1">...</TabsContent>
|
|
1292
|
-
* </Tabs>
|
|
1293
|
-
* ```
|
|
1294
|
-
*/
|
|
1295
|
-
declare const Tabs: React$1.ForwardRefExoticComponent<TabsProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1296
|
-
interface TabsListProps extends React$1.ComponentPropsWithoutRef<typeof TabsPrimitive.List> {
|
|
1297
|
-
}
|
|
1298
|
-
/**
|
|
1299
|
-
* TabsList component
|
|
1300
|
-
* Container for tab triggers
|
|
1301
|
-
*
|
|
1302
|
-
* @component
|
|
1303
|
-
* @example
|
|
1304
|
-
* ```tsx
|
|
1305
|
-
* <TabsList>
|
|
1306
|
-
* <TabsTrigger value="tab1">Tab 1</TabsTrigger>
|
|
1307
|
-
* <TabsTrigger value="tab2">Tab 2</TabsTrigger>
|
|
1308
|
-
* </TabsList>
|
|
1309
|
-
* ```
|
|
1310
|
-
*/
|
|
1311
|
-
declare const TabsList: React$1.ForwardRefExoticComponent<TabsListProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1312
|
-
interface TabsTriggerProps extends Omit<React$1.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>, 'asChild'>, Pick<ButtonProps, 'variant' | 'size'> {
|
|
1313
|
-
}
|
|
1314
|
-
/**
|
|
1315
|
-
* TabsTrigger component
|
|
1316
|
-
* Individual tab button that activates a tab panel
|
|
1317
|
-
*
|
|
1318
|
-
* Uses Button component internally, allowing Button props (variant, size) to be passed through.
|
|
1319
|
-
*
|
|
1320
|
-
* @component
|
|
1321
|
-
* @example
|
|
1322
|
-
* ```tsx
|
|
1323
|
-
* <TabsTrigger value="tab1">Tab 1</TabsTrigger>
|
|
1324
|
-
*
|
|
1325
|
-
* // With icon
|
|
1326
|
-
* <TabsTrigger value="transport">
|
|
1327
|
-
* <Plane size={16} /> Transport
|
|
1328
|
-
* </TabsTrigger>
|
|
1329
|
-
*
|
|
1330
|
-
* // With Button variant
|
|
1331
|
-
* <TabsTrigger value="tab1" variant="outline" size="sm">
|
|
1332
|
-
* Tab 1
|
|
1333
|
-
* </TabsTrigger>
|
|
1334
|
-
* ```
|
|
1335
|
-
*/
|
|
1336
|
-
declare const TabsTrigger: React$1.ForwardRefExoticComponent<TabsTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1337
|
-
interface TabsContentProps extends React$1.ComponentPropsWithoutRef<typeof TabsPrimitive.Content> {
|
|
1338
|
-
}
|
|
1339
|
-
/**
|
|
1340
|
-
* TabsContent component
|
|
1341
|
-
* Container for tab panel content
|
|
1342
|
-
*
|
|
1343
|
-
* @component
|
|
1344
|
-
* @example
|
|
1345
|
-
* ```tsx
|
|
1346
|
-
* <TabsContent value="tab1">
|
|
1347
|
-
* <section>Content for tab 1</section>
|
|
1348
|
-
* </TabsContent>
|
|
1349
|
-
* ```
|
|
1350
|
-
*/
|
|
1351
|
-
declare const TabsContent: React$1.ForwardRefExoticComponent<TabsContentProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1352
|
-
|
|
1353
|
-
/**
|
|
1354
|
-
* @file Calendar Component
|
|
1355
|
-
* @package @jmruthers/pace-core
|
|
1356
|
-
* @module Components/Calendar
|
|
1357
|
-
* @since 0.5.141
|
|
1358
|
-
*
|
|
1359
|
-
* A date picker calendar component built on react-day-picker.
|
|
1360
|
-
* Provides accessible date selection with keyboard navigation and ARIA support.
|
|
1361
|
-
*
|
|
1362
|
-
* Features:
|
|
1363
|
-
* - Single, range, and multiple date selection modes
|
|
1364
|
-
* - Date disabling (past dates, weekends, etc.)
|
|
1365
|
-
* - Localization support (defaults to Australian locale with Monday as first day of week)
|
|
1366
|
-
* - Keyboard navigation
|
|
1367
|
-
* - Accessible date selection
|
|
1368
|
-
* - Customizable styling
|
|
1369
|
-
*
|
|
1370
|
-
* @example
|
|
1371
|
-
* ```tsx
|
|
1372
|
-
* // Single date selection
|
|
1373
|
-
* <Calendar
|
|
1374
|
-
* mode="single"
|
|
1375
|
-
* selected={date}
|
|
1376
|
-
* onSelect={setDate}
|
|
1377
|
-
* />
|
|
1378
|
-
*
|
|
1379
|
-
* // Date range selection
|
|
1380
|
-
* <Calendar
|
|
1381
|
-
* mode="range"
|
|
1382
|
-
* selected={dateRange}
|
|
1383
|
-
* onSelect={setDateRange}
|
|
1384
|
-
* />
|
|
1385
|
-
*
|
|
1386
|
-
* // Multiple date selection
|
|
1387
|
-
* <Calendar
|
|
1388
|
-
* mode="multiple"
|
|
1389
|
-
* selected={dates}
|
|
1390
|
-
* onSelect={setDates}
|
|
1391
|
-
* />
|
|
1392
|
-
*
|
|
1393
|
-
* // With disabled dates
|
|
1394
|
-
* <Calendar
|
|
1395
|
-
* mode="single"
|
|
1396
|
-
* selected={date}
|
|
1397
|
-
* onSelect={setDate}
|
|
1398
|
-
* disabled={(date) => date < new Date()}
|
|
1399
|
-
* />
|
|
1400
|
-
* ```
|
|
1401
|
-
*
|
|
1402
|
-
* @accessibility
|
|
1403
|
-
* - WCAG 2.1 AA compliant
|
|
1404
|
-
* - Keyboard navigation (Arrow keys, Page Up/Down, Home, End)
|
|
1405
|
-
* - Screen reader support with proper ARIA attributes
|
|
1406
|
-
* - Focus management
|
|
1407
|
-
* - Date announcements
|
|
1408
|
-
*/
|
|
1409
|
-
|
|
1410
|
-
/**
|
|
1411
|
-
* Props for the Calendar component.
|
|
1412
|
-
* Extends DayPickerProps with pace-core specific customizations.
|
|
1413
|
-
*/
|
|
1414
|
-
interface CalendarProps extends Omit<DayPickerProps, 'className' | 'classNames' | 'styles' | 'onSelect'> {
|
|
1415
|
-
/**
|
|
1416
|
-
* Additional CSS classes to apply to the calendar table
|
|
1417
|
-
*/
|
|
1418
|
-
className?: string;
|
|
1419
|
-
/**
|
|
1420
|
-
* Custom classNames for DayPicker sub-components
|
|
1421
|
-
*/
|
|
1422
|
-
classNames?: DayPickerProps['classNames'];
|
|
1423
|
-
/**
|
|
1424
|
-
* Currently selected value; mirrors DayPicker's `selected` prop so callers
|
|
1425
|
-
* can control the selection state.
|
|
1426
|
-
*/
|
|
1427
|
-
selected?: Date | Date[] | DateRange | undefined;
|
|
1428
|
-
/**
|
|
1429
|
-
* Date selection handler. Signature depends on mode:
|
|
1430
|
-
* - mode="single": (date: Date | undefined) => void
|
|
1431
|
-
* - mode="range": (range: { from: Date; to?: Date } | undefined) => void
|
|
1432
|
-
* - mode="multiple": (dates: Date[]) => void
|
|
1433
|
-
*/
|
|
1434
|
-
onSelect?: ((date: Date | undefined) => void) | ((range: {
|
|
1435
|
-
from: Date;
|
|
1436
|
-
to?: Date;
|
|
1437
|
-
} | undefined) => void) | ((dates: Date[]) => void);
|
|
1438
|
-
}
|
|
1439
|
-
/**
|
|
1440
|
-
* Calendar component
|
|
1441
|
-
* A flexible, accessible calendar component for date selection.
|
|
1442
|
-
* Built on react-day-picker with pace-core styling.
|
|
1443
|
-
*
|
|
1444
|
-
* Defaults to Australian locale (en-AU) with Monday as the first day of the week.
|
|
1445
|
-
* The locale can be overridden by passing a `locale` prop.
|
|
1446
|
-
*
|
|
1447
|
-
* Month navigation is automatically managed internally when `month` and `onMonthChange` props
|
|
1448
|
-
* are not provided. The displayed month will sync with the selected date when available,
|
|
1449
|
-
* or default to the current month. Navigation buttons (prev/next) work automatically.
|
|
1450
|
-
*
|
|
1451
|
-
* For controlled month state, pass `month` and `onMonthChange` props.
|
|
1452
|
-
*
|
|
1453
|
-
* @param props - Calendar configuration and styling
|
|
1454
|
-
* @param ref - Forwarded ref (not used directly, but maintained for API consistency)
|
|
1455
|
-
* @returns JSX.Element - The rendered calendar element
|
|
1456
|
-
*
|
|
1457
|
-
* @example
|
|
1458
|
-
* ```tsx
|
|
1459
|
-
* // Single date selection (uses default Australian locale)
|
|
1460
|
-
* <Calendar
|
|
1461
|
-
* mode="single"
|
|
1462
|
-
* selected={date}
|
|
1463
|
-
* onSelect={setDate}
|
|
1464
|
-
* />
|
|
1465
|
-
*
|
|
1466
|
-
* // With disabled dates
|
|
1467
|
-
* <Calendar
|
|
1468
|
-
* mode="single"
|
|
1469
|
-
* selected={date}
|
|
1470
|
-
* onSelect={setDate}
|
|
1471
|
-
* disabled={(date) => date < new Date()}
|
|
1472
|
-
* />
|
|
1473
|
-
*
|
|
1474
|
-
* // Override locale (e.g., US locale with Sunday as first day)
|
|
1475
|
-
* import { enUS } from 'date-fns/locale';
|
|
1476
|
-
* <Calendar
|
|
1477
|
-
* mode="single"
|
|
1478
|
-
* selected={date}
|
|
1479
|
-
* onSelect={setDate}
|
|
1480
|
-
* locale={enUS}
|
|
1481
|
-
* />
|
|
1482
|
-
*
|
|
1483
|
-
* // Controlled month state (optional - month is auto-managed if not provided)
|
|
1484
|
-
* const [month, setMonth] = useState(new Date());
|
|
1485
|
-
* <Calendar
|
|
1486
|
-
* mode="single"
|
|
1487
|
-
* selected={date}
|
|
1488
|
-
* onSelect={setDate}
|
|
1489
|
-
* month={month}
|
|
1490
|
-
* onMonthChange={setMonth}
|
|
1491
|
-
* />
|
|
1492
|
-
* ```
|
|
1493
|
-
*/
|
|
1494
|
-
declare const Calendar: React$1.ForwardRefExoticComponent<CalendarProps & React$1.RefAttributes<HTMLTableElement>>;
|
|
1495
|
-
|
|
1496
|
-
declare const ToastProvider: React$1.FC<ToastPrimitives.ToastProviderProps>;
|
|
1497
|
-
/**
|
|
1498
|
-
* ToastViewport component
|
|
1499
|
-
* Container for all toast notifications with customizable positioning
|
|
1500
|
-
*
|
|
1501
|
-
* @param props - Viewport configuration and styling
|
|
1502
|
-
* @param ref - Forwarded ref to the viewport element
|
|
1503
|
-
* @returns JSX.Element - The toast viewport container
|
|
1504
|
-
*/
|
|
1505
|
-
declare const ToastViewport: React$1.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastViewportProps & React$1.RefAttributes<HTMLOListElement>, "ref"> & React$1.RefAttributes<HTMLOListElement>>;
|
|
1506
|
-
/**
|
|
1507
|
-
* Toast component
|
|
1508
|
-
* The main toast notification component with animations and interactions
|
|
1509
|
-
*
|
|
1510
|
-
* @param props - Toast configuration and content
|
|
1511
|
-
* @param ref - Forwarded ref to the toast element
|
|
1512
|
-
* @returns JSX.Element - The rendered toast notification
|
|
1513
|
-
*
|
|
1514
|
-
* @example
|
|
1515
|
-
* ```tsx
|
|
1516
|
-
* <Toast>
|
|
1517
|
-
* <ToastTitle>Success!</ToastTitle>
|
|
1518
|
-
* <ToastDescription>Your changes have been saved.</ToastDescription>
|
|
1519
|
-
* <ToastClose />
|
|
1520
|
-
* </Toast>
|
|
1521
|
-
* ```
|
|
1522
|
-
*/
|
|
1523
|
-
declare const Toast: React$1.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React$1.RefAttributes<HTMLLIElement>, "ref"> & React$1.RefAttributes<HTMLLIElement>>;
|
|
1524
|
-
/**
|
|
1525
|
-
* ToastAction component
|
|
1526
|
-
* Action button within a toast notification
|
|
1527
|
-
*
|
|
1528
|
-
* @param props - Action button configuration
|
|
1529
|
-
* @param ref - Forwarded ref to the action button
|
|
1530
|
-
* @returns JSX.Element - The action button element
|
|
1531
|
-
*
|
|
1532
|
-
* @example
|
|
1533
|
-
* ```tsx
|
|
1534
|
-
* <ToastAction altText="Undo changes">Undo</ToastAction>
|
|
1535
|
-
* ```
|
|
1536
|
-
*/
|
|
1537
|
-
declare const ToastAction: React$1.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastActionProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1538
|
-
/**
|
|
1539
|
-
* ToastClose component
|
|
1540
|
-
* Close button for dismissing toast notifications
|
|
1541
|
-
*
|
|
1542
|
-
* @param props - Close button configuration
|
|
1543
|
-
* @param ref - Forwarded ref to the close button
|
|
1544
|
-
* @returns JSX.Element - The close button with X icon
|
|
1545
|
-
*
|
|
1546
|
-
* @example
|
|
1547
|
-
* ```tsx
|
|
1548
|
-
* <ToastClose />
|
|
1549
|
-
* ```
|
|
1550
|
-
*/
|
|
1551
|
-
declare const ToastClose: React$1.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastCloseProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1552
|
-
/**
|
|
1553
|
-
* ToastTitle component
|
|
1554
|
-
* Title text for toast notifications
|
|
1555
|
-
*
|
|
1556
|
-
* @param props - Title configuration and styling
|
|
1557
|
-
* @param ref - Forwarded ref to the title element
|
|
1558
|
-
* @returns JSX.Element - The toast title
|
|
1559
|
-
*
|
|
1560
|
-
* @example
|
|
1561
|
-
* ```tsx
|
|
1562
|
-
* <ToastTitle>Success!</ToastTitle>
|
|
1563
|
-
* ```
|
|
1564
|
-
*/
|
|
1565
|
-
declare const ToastTitle: React$1.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastTitleProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1566
|
-
/**
|
|
1567
|
-
* ToastDescription component
|
|
1568
|
-
* Description text for toast notifications
|
|
1569
|
-
*
|
|
1570
|
-
* @param props - Description configuration and styling
|
|
1571
|
-
* @param ref - Forwarded ref to the description element
|
|
1572
|
-
* @returns JSX.Element - The toast description
|
|
1573
|
-
*
|
|
1574
|
-
* @example
|
|
1575
|
-
* ```tsx
|
|
1576
|
-
* <ToastDescription>Your changes have been saved successfully.</ToastDescription>
|
|
1577
|
-
* ```
|
|
1578
|
-
*/
|
|
1579
|
-
declare const ToastDescription: React$1.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastDescriptionProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1580
|
-
interface ToastProps extends React$1.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> {
|
|
1581
|
-
}
|
|
1582
|
-
/**
|
|
1583
|
-
* Type for toast action elements.
|
|
1584
|
-
* Represents a React element that can be used as a toast action button.
|
|
1585
|
-
*/
|
|
1586
|
-
interface ToastActionElement extends React$1.ReactElement<typeof ToastAction> {
|
|
1587
|
-
}
|
|
1588
|
-
/**
|
|
1589
|
-
* Toaster component
|
|
1590
|
-
* Container component that renders actual toast notifications
|
|
1591
|
-
* Should be placed at the root of your application
|
|
1592
|
-
*
|
|
1593
|
-
* @returns JSX.Element - The toast provider with viewport and rendered toasts
|
|
1594
|
-
*
|
|
1595
|
-
* @example
|
|
1596
|
-
* ```tsx
|
|
1597
|
-
* function App() {
|
|
1598
|
-
* return (
|
|
1599
|
-
* <ToastProvider>
|
|
1600
|
-
* <YourApp />
|
|
1601
|
-
* <Toaster />
|
|
1602
|
-
* </ToastProvider>
|
|
1603
|
-
* );
|
|
1604
|
-
* }
|
|
1605
|
-
* ```
|
|
1606
|
-
*/
|
|
1607
|
-
declare function Toaster(): react_jsx_runtime.JSX.Element;
|
|
1608
|
-
|
|
1609
|
-
/**
|
|
1610
|
-
* @file Tooltip Component System
|
|
1611
|
-
* @package @jmruthers/pace-core
|
|
1612
|
-
* @module Components/Tooltip
|
|
1613
|
-
* @since 0.1.0
|
|
1614
|
-
*
|
|
1615
|
-
* A comprehensive tooltip component system built on top of Radix UI primitives.
|
|
1616
|
-
* Provides accessible tooltips with customizable positioning and animations.
|
|
1617
|
-
*
|
|
1618
|
-
* Features:
|
|
1619
|
-
* - Multiple positioning options (top, bottom, left, right)
|
|
1620
|
-
* - Customizable delay duration
|
|
1621
|
-
* - Smooth animations and transitions
|
|
1622
|
-
* - Keyboard and mouse interaction
|
|
1623
|
-
* - Screen reader support
|
|
1624
|
-
* - Responsive design
|
|
1625
|
-
* - Customizable styling
|
|
1626
|
-
* - Focus management
|
|
1627
|
-
*
|
|
1628
|
-
* @example
|
|
1629
|
-
* ```tsx
|
|
1630
|
-
* // Basic tooltip
|
|
1631
|
-
* <Tooltip content="This is a helpful tooltip">
|
|
1632
|
-
* <Button>Hover me</Button>
|
|
1633
|
-
* </Tooltip>
|
|
1634
|
-
*
|
|
1635
|
-
* // Tooltip with custom delay
|
|
1636
|
-
* <Tooltip content="Custom delay" delayDuration={500}>
|
|
1637
|
-
* <IconButton icon={<Info />} />
|
|
1638
|
-
* </Tooltip>
|
|
1639
|
-
*
|
|
1640
|
-
* // Advanced tooltip with custom content
|
|
1641
|
-
* <TooltipProvider>
|
|
1642
|
-
* <TooltipRoot>
|
|
1643
|
-
* <TooltipTrigger asChild>
|
|
1644
|
-
* <Button>Advanced Tooltip</Button>
|
|
1645
|
-
* </TooltipTrigger>
|
|
1646
|
-
* <TooltipContent side="top" className="bg-main-500 text-main-50">
|
|
1647
|
-
* <section className="space-y-1">
|
|
1648
|
-
* <p className="font-semibold">Advanced Tooltip</p>
|
|
1649
|
-
* <p className="text-xs">With custom styling</p>
|
|
1650
|
-
* </section>
|
|
1651
|
-
* </TooltipContent>
|
|
1652
|
-
* </TooltipRoot>
|
|
1653
|
-
* </TooltipProvider>
|
|
1654
|
-
*
|
|
1655
|
-
* // Tooltip on disabled element
|
|
1656
|
-
* <Tooltip content="This feature is coming soon">
|
|
1657
|
-
* <Button disabled>Coming Soon</Button>
|
|
1658
|
-
* </Tooltip>
|
|
1659
|
-
* ```
|
|
1660
|
-
*
|
|
1661
|
-
* @accessibility
|
|
1662
|
-
* - WCAG 2.1 AA compliant
|
|
1663
|
-
* - Proper ARIA attributes and roles
|
|
1664
|
-
* - Keyboard navigation support
|
|
1665
|
-
* - Screen reader announcements
|
|
1666
|
-
* - Focus management
|
|
1667
|
-
* - High contrast support
|
|
1668
|
-
* - Reduced motion support
|
|
1669
|
-
*
|
|
1670
|
-
* @performance
|
|
1671
|
-
* - Efficient positioning calculations
|
|
1672
|
-
* - Optimized animations
|
|
1673
|
-
* - Memory leak prevention
|
|
1674
|
-
* - Lazy rendering
|
|
1675
|
-
*
|
|
1676
|
-
* @dependencies
|
|
1677
|
-
* - @radix-ui/react-tooltip - Core tooltip functionality
|
|
1678
|
-
* - React 19+ - Hooks and refs
|
|
1679
|
-
* - Tailwind CSS - Styling and animations
|
|
1680
|
-
*/
|
|
1681
|
-
|
|
1682
|
-
declare const TooltipProvider: React$1.FC<TooltipPrimitive.TooltipProviderProps>;
|
|
1683
|
-
declare const TooltipRoot: React$1.FC<TooltipPrimitive.TooltipProps>;
|
|
1684
|
-
declare const TooltipTrigger: React$1.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1685
|
-
/**
|
|
1686
|
-
* TooltipContent component
|
|
1687
|
-
* The content container for tooltip information
|
|
1688
|
-
*
|
|
1689
|
-
* @param props - Content configuration and styling
|
|
1690
|
-
* @param ref - Forwarded ref to the content element
|
|
1691
|
-
* @returns JSX.Element - The tooltip content container
|
|
1692
|
-
*
|
|
1693
|
-
* @example
|
|
1694
|
-
* ```tsx
|
|
1695
|
-
* <TooltipContent side="top" className="bg-main-500">
|
|
1696
|
-
* Custom tooltip content
|
|
1697
|
-
* </TooltipContent>
|
|
1698
|
-
* ```
|
|
1699
|
-
*/
|
|
1700
|
-
declare const TooltipContent: React$1.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1701
|
-
/**
|
|
1702
|
-
* Props for the simplified Tooltip component
|
|
1703
|
-
*/
|
|
1704
|
-
interface TooltipProps {
|
|
1705
|
-
/** The element that triggers the tooltip */
|
|
1706
|
-
children: React$1.ReactNode;
|
|
1707
|
-
/** The content to display in the tooltip */
|
|
1708
|
-
content: React$1.ReactNode;
|
|
1709
|
-
/** Delay before showing the tooltip (in milliseconds) */
|
|
1710
|
-
delayDuration?: number;
|
|
1711
|
-
}
|
|
1712
|
-
/**
|
|
1713
|
-
* Tooltip component
|
|
1714
|
-
* A simplified tooltip component for easy usage
|
|
1715
|
-
*
|
|
1716
|
-
* @param props - Tooltip configuration
|
|
1717
|
-
* @param ref - Forwarded ref to the trigger element
|
|
1718
|
-
* @returns JSX.Element - The tooltip with trigger and content
|
|
1719
|
-
*
|
|
1720
|
-
* @example
|
|
1721
|
-
* ```tsx
|
|
1722
|
-
* <Tooltip content="This is a helpful tooltip">
|
|
1723
|
-
* <Button>Hover me</Button>
|
|
1724
|
-
* </Tooltip>
|
|
1725
|
-
* ```
|
|
1726
|
-
*/
|
|
1727
|
-
declare const Tooltip: React$1.ForwardRefExoticComponent<TooltipProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1728
|
-
|
|
1729
|
-
/**
|
|
1730
|
-
* Props for the Form component
|
|
1731
|
-
*/
|
|
1732
|
-
interface FormProps<TFieldValues extends FieldValues = FieldValues> {
|
|
1733
|
-
/**
|
|
1734
|
-
* Form schema for validation
|
|
1735
|
-
*/
|
|
1736
|
-
schema?: z.ZodType<TFieldValues>;
|
|
1737
|
-
/**
|
|
1738
|
-
* Default values for the form
|
|
1739
|
-
*/
|
|
1740
|
-
defaultValues?: DefaultValues<TFieldValues>;
|
|
1741
|
-
/**
|
|
1742
|
-
* Handler called when form is submitted successfully
|
|
1743
|
-
*/
|
|
1744
|
-
onSubmit: SubmitHandler<TFieldValues>;
|
|
1745
|
-
/**
|
|
1746
|
-
* Handler called when form submission has errors
|
|
1747
|
-
*/
|
|
1748
|
-
onError?: SubmitErrorHandler<TFieldValues>;
|
|
1749
|
-
/**
|
|
1750
|
-
* Form mode for react-hook-form
|
|
1751
|
-
* @default "onSubmit"
|
|
1752
|
-
*/
|
|
1753
|
-
mode?: "onSubmit" | "onChange" | "onBlur" | "onTouched" | "all";
|
|
1754
|
-
/**
|
|
1755
|
-
* Children components or render function
|
|
1756
|
-
*/
|
|
1757
|
-
children: React__default.ReactNode | ((methods: UseFormReturn<TFieldValues>) => React__default.ReactNode);
|
|
1758
|
-
/**
|
|
1759
|
-
* Class name for the form
|
|
1760
|
-
*/
|
|
1761
|
-
className?: string;
|
|
1762
|
-
}
|
|
1763
|
-
/**
|
|
1764
|
-
* Form component with validation and React Hook Form integration
|
|
1765
|
-
*
|
|
1766
|
-
* @template TFieldValues - The type of form field values
|
|
1767
|
-
* @param props - Form configuration and handlers
|
|
1768
|
-
* @returns JSX.Element - The rendered form with FormProvider context
|
|
1769
|
-
*
|
|
1770
|
-
* @example
|
|
1771
|
-
* ```tsx
|
|
1772
|
-
* <Form
|
|
1773
|
-
* schema={userSchema}
|
|
1774
|
-
* defaultValues={{ name: "", email: "" }}
|
|
1775
|
-
* onSubmit={handleSubmit}
|
|
1776
|
-
* mode="onBlur"
|
|
1777
|
-
* >
|
|
1778
|
-
* <FormField name="name" label="Name" />
|
|
1779
|
-
* <FormField name="email" label="Email" />
|
|
1780
|
-
* <Button type="submit">Submit</Button>
|
|
1781
|
-
* </Form>
|
|
1782
|
-
* ```
|
|
1783
|
-
*/
|
|
1784
|
-
declare function Form<TFieldValues extends FieldValues = FieldValues>({ schema, defaultValues, onSubmit, onError, mode, children, className, }: FormProps<TFieldValues>): react_jsx_runtime.JSX.Element;
|
|
1785
|
-
/**
|
|
1786
|
-
* Props for the FormField component
|
|
1787
|
-
*/
|
|
1788
|
-
interface FormFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> {
|
|
1789
|
-
/**
|
|
1790
|
-
* Field name
|
|
1791
|
-
*/
|
|
1792
|
-
name: TName;
|
|
1793
|
-
/**
|
|
1794
|
-
* Field label
|
|
1795
|
-
*/
|
|
1796
|
-
label?: string;
|
|
1797
|
-
/**
|
|
1798
|
-
* Field type
|
|
1799
|
-
*/
|
|
1800
|
-
type?: string;
|
|
1801
|
-
/**
|
|
1802
|
-
* Placeholder text
|
|
1803
|
-
*/
|
|
1804
|
-
placeholder?: string;
|
|
1805
|
-
/**
|
|
1806
|
-
* Additional props for the input
|
|
1807
|
-
*/
|
|
1808
|
-
inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
|
|
1809
|
-
/**
|
|
1810
|
-
* Validation rules
|
|
1811
|
-
*/
|
|
1812
|
-
validation?: {
|
|
1813
|
-
required?: boolean;
|
|
1814
|
-
pattern?: {
|
|
1815
|
-
value: RegExp;
|
|
1816
|
-
message: string;
|
|
1817
|
-
};
|
|
1818
|
-
minLength?: {
|
|
1819
|
-
value: number;
|
|
1820
|
-
message: string;
|
|
1821
|
-
};
|
|
1822
|
-
maxLength?: {
|
|
1823
|
-
value: number;
|
|
1824
|
-
message: string;
|
|
1825
|
-
};
|
|
1826
|
-
};
|
|
1827
|
-
/**
|
|
1828
|
-
* Custom render function
|
|
1829
|
-
*/
|
|
1830
|
-
render?: (props: {
|
|
1831
|
-
field: ControllerRenderProps<TFieldValues, TName>;
|
|
1832
|
-
fieldState: ControllerFieldState;
|
|
1833
|
-
formState: UseFormStateReturn<TFieldValues>;
|
|
1834
|
-
}) => React__default.ReactElement<any>;
|
|
1835
|
-
/**
|
|
1836
|
-
* Test ID
|
|
1837
|
-
*/
|
|
1838
|
-
'data-testid'?: string;
|
|
1839
|
-
/**
|
|
1840
|
-
* Class name
|
|
1841
|
-
*/
|
|
1842
|
-
className?: string;
|
|
1843
|
-
}
|
|
1844
|
-
/**
|
|
1845
|
-
* FormField component for React Hook Form integration
|
|
1846
|
-
*
|
|
1847
|
-
* A flexible form field component that integrates with React Hook Form and provides
|
|
1848
|
-
* built-in validation, error handling, and accessibility features.
|
|
1849
|
-
*
|
|
1850
|
-
* Features:
|
|
1851
|
-
* - React Hook Form integration with Controller
|
|
1852
|
-
* - Built-in validation with error display
|
|
1853
|
-
* - Accessible labels and error messages
|
|
1854
|
-
* - Custom render function support
|
|
1855
|
-
* - TypeScript support with generic field paths
|
|
1856
|
-
* - Consistent styling with error states
|
|
1857
|
-
* - Test ID support for testing
|
|
1858
|
-
* - Flexible input types and props
|
|
1859
|
-
*
|
|
1860
|
-
* @template TFieldValues - The type of form field values
|
|
1861
|
-
* @template TName - The type of the field name (must be a valid field path)
|
|
1862
|
-
* @param props - Form field configuration and validation
|
|
1863
|
-
* @returns JSX.Element - The rendered form field with validation
|
|
1864
|
-
*
|
|
1865
|
-
* @example
|
|
1866
|
-
* ```tsx
|
|
1867
|
-
* // Basic text field
|
|
1868
|
-
* <FormField
|
|
1869
|
-
* name="username"
|
|
1870
|
-
* label="Username"
|
|
1871
|
-
* placeholder="Enter your username"
|
|
1872
|
-
* validation={{ required: true }}
|
|
1873
|
-
* />
|
|
1874
|
-
*
|
|
1875
|
-
* // Email field with custom validation
|
|
1876
|
-
* <FormField
|
|
1877
|
-
* name="email"
|
|
1878
|
-
* label="Email Address"
|
|
1879
|
-
* type="email"
|
|
1880
|
-
* validation={{
|
|
1881
|
-
* required: true,
|
|
1882
|
-
* pattern: {
|
|
1883
|
-
* value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,
|
|
1884
|
-
* message: "Invalid email address"
|
|
1885
|
-
* }
|
|
1886
|
-
* }}
|
|
1887
|
-
* />
|
|
1888
|
-
*
|
|
1889
|
-
* // Custom render function
|
|
1890
|
-
* <FormField
|
|
1891
|
-
* name="avatar"
|
|
1892
|
-
* label="Profile Picture"
|
|
1893
|
-
* render={({ field }) => (
|
|
1894
|
-
* <input
|
|
1895
|
-
* {...field}
|
|
1896
|
-
* type="file"
|
|
1897
|
-
* accept="image/*"
|
|
1898
|
-
* />
|
|
1899
|
-
* )}
|
|
1900
|
-
* />
|
|
1901
|
-
* ```
|
|
1902
|
-
*
|
|
1903
|
-
* @accessibility
|
|
1904
|
-
* - Proper label association with htmlFor
|
|
1905
|
-
* - Error messages with role="alert"
|
|
1906
|
-
* - Required field indicators
|
|
1907
|
-
* - Focus management
|
|
1908
|
-
* - Screen reader friendly error announcements
|
|
1909
|
-
* - Keyboard navigation support
|
|
1910
|
-
*/
|
|
1911
|
-
declare function FormField<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, type, placeholder, inputProps, validation, render, 'data-testid': testId, className, }: FormFieldProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
|
|
1912
|
-
|
|
1913
|
-
/**
|
|
1914
|
-
* @file LoginForm Component
|
|
1915
|
-
* @package @jmruthers/pace-core
|
|
1916
|
-
* @module Components/LoginForm
|
|
1917
|
-
* @since 0.1.0
|
|
1918
|
-
*
|
|
1919
|
-
* A comprehensive login form component with built-in validation, error handling,
|
|
1920
|
-
* and loading states for user authentication.
|
|
1921
|
-
*
|
|
1922
|
-
* Features:
|
|
1923
|
-
* - Email and password validation
|
|
1924
|
-
* - Loading states with disabled form
|
|
1925
|
-
* - Error handling and display
|
|
1926
|
-
* - Customizable branding and messaging
|
|
1927
|
-
* - Sign-up link integration
|
|
1928
|
-
* - Performance optimized with React.memo
|
|
1929
|
-
* - Accessibility compliant
|
|
1930
|
-
* - Responsive design
|
|
1931
|
-
* - Form validation
|
|
1932
|
-
* - Success and error callbacks
|
|
1933
|
-
*
|
|
1934
|
-
* @example
|
|
1935
|
-
* ```tsx
|
|
1936
|
-
* // Basic login form
|
|
1937
|
-
* <LoginForm
|
|
1938
|
-
* onSignIn={async (data) => {
|
|
1939
|
-
* await signIn(data.email, data.password);
|
|
1940
|
-
* }}
|
|
1941
|
-
* onSuccess={() => navigate('/dashboard')}
|
|
1942
|
-
* onError={(error) => console.error('Login failed:', error)}
|
|
1943
|
-
* />
|
|
1944
|
-
*
|
|
1945
|
-
* // Login form with custom branding
|
|
1946
|
-
* <LoginForm
|
|
1947
|
-
* appName="My Application"
|
|
1948
|
-
* title="Welcome Back"
|
|
1949
|
-
* subtitle="Please sign in to access your account"
|
|
1950
|
-
* onSignIn={handleSignIn}
|
|
1951
|
-
* onSuccess={handleSuccess}
|
|
1952
|
-
* onError={handleError}
|
|
1953
|
-
* />
|
|
1954
|
-
*
|
|
1955
|
-
* // Login form with sign-up integration
|
|
1956
|
-
* <LoginForm
|
|
1957
|
-
* appName="My App"
|
|
1958
|
-
* showSignUp={true}
|
|
1959
|
-
* onSignUp={() => navigate('/signup')}
|
|
1960
|
-
* onSignIn={handleSignIn}
|
|
1961
|
-
* isLoading={isAuthenticating}
|
|
1962
|
-
* />
|
|
1963
|
-
*
|
|
1964
|
-
* // Login form with custom error handling
|
|
1965
|
-
* <LoginForm
|
|
1966
|
-
* onSignIn={async (data) => {
|
|
1967
|
-
* try {
|
|
1968
|
-
* const result = await authService.signIn(data);
|
|
1969
|
-
* if (result.success) {
|
|
1970
|
-
* onSuccess();
|
|
1971
|
-
* } else {
|
|
1972
|
-
* throw new Error(result.error);
|
|
1973
|
-
* }
|
|
1974
|
-
* } catch (error) {
|
|
1975
|
-
* onError(error);
|
|
1976
|
-
* }
|
|
1977
|
-
* }}
|
|
1978
|
-
* onSuccess={() => {
|
|
1979
|
-
* toast.success('Successfully signed in!');
|
|
1980
|
-
* navigate('/dashboard');
|
|
1981
|
-
* }}
|
|
1982
|
-
* onError={(error) => {
|
|
1983
|
-
* toast.error(`Sign in failed: ${error.message}`);
|
|
1984
|
-
* }}
|
|
1985
|
-
* />
|
|
1986
|
-
* ```
|
|
1987
|
-
*
|
|
1988
|
-
* @accessibility
|
|
1989
|
-
* - WCAG 2.1 AA compliant
|
|
1990
|
-
* - Proper form labels and associations
|
|
1991
|
-
* - Screen reader friendly error messages
|
|
1992
|
-
* - Keyboard navigation support
|
|
1993
|
-
* - Focus management
|
|
1994
|
-
* - High contrast support
|
|
1995
|
-
* - Clear error identification
|
|
1996
|
-
*
|
|
1997
|
-
* @performance
|
|
1998
|
-
* - React.memo for efficient re-rendering
|
|
1999
|
-
* - useCallback for stable event handlers
|
|
2000
|
-
* - useMemo for computed values
|
|
2001
|
-
* - Minimal re-renders
|
|
2002
|
-
*
|
|
2003
|
-
* @dependencies
|
|
2004
|
-
* - React 19+ - Hooks and memo
|
|
2005
|
-
* - Button component
|
|
2006
|
-
* - Input component
|
|
2007
|
-
* - Label component
|
|
2008
|
-
* - Card components
|
|
2009
|
-
* - Alert component
|
|
2010
|
-
* - Tailwind CSS - Styling
|
|
2011
|
-
*/
|
|
2012
|
-
|
|
2013
|
-
/**
|
|
2014
|
-
* Props for the LoginForm component.
|
|
2015
|
-
* Configures login form behavior, validation, and callbacks.
|
|
2016
|
-
*/
|
|
2017
|
-
interface LoginFormProps {
|
|
2018
|
-
/** Callback invoked when the form is submitted */
|
|
2019
|
-
onSignIn: (data: {
|
|
2020
|
-
email: string;
|
|
2021
|
-
password: string;
|
|
2022
|
-
}) => Promise<void>;
|
|
2023
|
-
/** Callback invoked on successful sign-in */
|
|
2024
|
-
onSuccess?: () => void;
|
|
2025
|
-
/** Callback invoked if sign-in fails */
|
|
2026
|
-
onError?: (error: Error) => void;
|
|
2027
|
-
/** Show loading spinner and disable form while true */
|
|
2028
|
-
isLoading?: boolean;
|
|
2029
|
-
/** Application name for display in the form */
|
|
2030
|
-
appName?: string;
|
|
2031
|
-
/** Custom title for the form */
|
|
2032
|
-
title?: string;
|
|
2033
|
-
/** Custom subtitle for the form */
|
|
2034
|
-
subtitle?: string;
|
|
2035
|
-
/** Show a sign-up link or button */
|
|
2036
|
-
showSignUp?: boolean;
|
|
2037
|
-
/** Optional callback for sign-up button */
|
|
2038
|
-
onSignUp?: () => void;
|
|
2039
|
-
/** Additional CSS classes */
|
|
2040
|
-
className?: string;
|
|
2041
|
-
}
|
|
2042
|
-
/**
|
|
2043
|
-
* LoginForm component that provides a ready-to-use authentication form for user sign-in.
|
|
2044
|
-
* It supports validation, loading state, error handling, and can be customized via props.
|
|
2045
|
-
* Now includes performance optimizations and onSignUp support.
|
|
2046
|
-
*
|
|
2047
|
-
* @param props - Login form configuration and handlers
|
|
2048
|
-
* @returns JSX.Element - The rendered login form
|
|
2049
|
-
*
|
|
2050
|
-
* @example
|
|
2051
|
-
* ```tsx
|
|
2052
|
-
* <LoginForm
|
|
2053
|
-
* onSignIn={handleSignIn}
|
|
2054
|
-
* onSuccess={() => navigate('/dashboard')}
|
|
2055
|
-
* onError={(error) => toast.error(error.message)}
|
|
2056
|
-
* isLoading={isAuthenticating}
|
|
2057
|
-
* />
|
|
2058
|
-
* ```
|
|
2059
|
-
*/
|
|
2060
|
-
declare const LoginForm: React__default.NamedExoticComponent<LoginFormProps>;
|
|
2061
|
-
|
|
2062
|
-
/**
|
|
2063
|
-
* @file Unified Navigation Menu Component
|
|
2064
|
-
* @package @jmruthers/pace-core
|
|
2065
|
-
* @module Navigation
|
|
2066
|
-
* @since 0.1.0
|
|
2067
|
-
*
|
|
2068
|
-
* A flexible navigation menu component that supports both dropdown and hierarchical modes.
|
|
2069
|
-
*
|
|
2070
|
-
* Features:
|
|
2071
|
-
* - Dropdown mode: Menu button that opens a dropdown list
|
|
2072
|
-
* - Hierarchical mode: Expandable tree navigation with nested items
|
|
2073
|
-
* - Icon support for navigation items
|
|
2074
|
-
* - Current page highlighting
|
|
2075
|
-
* - Keyboard navigation support
|
|
2076
|
-
* - Accessible design with proper ARIA attributes
|
|
2077
|
-
* - Click outside to close (dropdown mode)
|
|
2078
|
-
* - Recursive rendering for nested items (hierarchical mode)
|
|
2079
|
-
*
|
|
2080
|
-
* @example
|
|
2081
|
-
* Basic dropdown navigation (most common use case):
|
|
2082
|
-
* ```tsx
|
|
2083
|
-
* import { NavigationMenu } from '@jmruthers/pace-core';
|
|
2084
|
-
* import { useNavigate, useLocation } from 'react-router-dom';
|
|
2085
|
-
*
|
|
2086
|
-
* function AppNavigation() {
|
|
2087
|
-
* const navigate = useNavigate();
|
|
2088
|
-
* const location = useLocation();
|
|
2089
|
-
*
|
|
2090
|
-
* const navItems = [
|
|
2091
|
-
* { id: 'home', label: 'Home', href: '/', icon: 'Home' },
|
|
2092
|
-
* { id: 'dashboard', label: 'Dashboard', href: '/dashboard', icon: 'LayoutDashboard' },
|
|
2093
|
-
* { id: 'reports', label: 'Reports', href: '/reports', icon: 'FileText' },
|
|
2094
|
-
* { id: 'settings', label: 'Settings', href: '/settings', icon: 'Settings' }
|
|
2095
|
-
* ];
|
|
2096
|
-
*
|
|
2097
|
-
* return (
|
|
2098
|
-
* <NavigationMenu
|
|
2099
|
-
* items={navItems}
|
|
2100
|
-
* mode="dropdown"
|
|
2101
|
-
* currentPath={location.pathname}
|
|
2102
|
-
* onNavigate={(item) => navigate(item.href)}
|
|
2103
|
-
* buttonText="Main Menu"
|
|
2104
|
-
* showIcons={true}
|
|
2105
|
-
* />
|
|
2106
|
-
* );
|
|
2107
|
-
* }
|
|
2108
|
-
*
|
|
2109
|
-
* @example
|
|
2110
|
-
* Hierarchical navigation with nested items:
|
|
2111
|
-
* ```tsx
|
|
2112
|
-
* import { NavigationMenu } from '@jmruthers/pace-core';
|
|
2113
|
-
*
|
|
2114
|
-
* function SidebarNavigation() {
|
|
2115
|
-
* const hierarchicalItems = [
|
|
2116
|
-
* {
|
|
2117
|
-
* id: 'user-management',
|
|
2118
|
-
* label: 'User Management',
|
|
2119
|
-
* icon: 'Users',
|
|
2120
|
-
* children: [
|
|
2121
|
-
* { id: 'users-list', label: 'All Users', href: '/users' },
|
|
2122
|
-
* { id: 'users-create', label: 'Create User', href: '/users/create' },
|
|
2123
|
-
* { id: 'user-roles', label: 'User Roles', href: '/users/roles' }
|
|
2124
|
-
* ]
|
|
2125
|
-
* },
|
|
2126
|
-
* {
|
|
2127
|
-
* id: 'reports',
|
|
2128
|
-
* label: 'Reports',
|
|
2129
|
-
* icon: 'BarChart',
|
|
2130
|
-
* children: [
|
|
2131
|
-
* { id: 'sales-reports', label: 'Sales Reports', href: '/reports/sales' },
|
|
2132
|
-
* { id: 'user-reports', label: 'User Reports', href: '/reports/users' }
|
|
2133
|
-
* ]
|
|
2134
|
-
* },
|
|
2135
|
-
* { id: 'settings', label: 'Settings', href: '/settings', icon: 'Settings' }
|
|
2136
|
-
* ];
|
|
2137
|
-
*
|
|
2138
|
-
* return (
|
|
2139
|
-
* <NavigationMenu
|
|
2140
|
-
* items={hierarchicalItems}
|
|
2141
|
-
* mode="hierarchical"
|
|
2142
|
-
* currentPath={window.location.pathname}
|
|
2143
|
-
* onNavigate={(item) => {
|
|
2144
|
-
* if (item.href) {
|
|
2145
|
-
* window.location.href = item.href;
|
|
2146
|
-
* }
|
|
2147
|
-
* }}
|
|
2148
|
-
* className="w-64 bg-sec-50 p-4"
|
|
2149
|
-
* />
|
|
2150
|
-
* );
|
|
2151
|
-
* }
|
|
2152
|
-
* ```
|
|
2153
|
-
*
|
|
2154
|
-
* @example
|
|
2155
|
-
* Integration with React Router and authentication:
|
|
2156
|
-
* ```tsx
|
|
2157
|
-
* import { NavigationMenu } from '@jmruthers/pace-core';
|
|
2158
|
-
* import { useNavigate, useLocation } from 'react-router-dom';
|
|
2159
|
-
* import { useUnifiedAuth } from '@jmruthers/pace-core/providers';
|
|
2160
|
-
*
|
|
2161
|
-
* function AuthenticatedNavigation() {
|
|
2162
|
-
* const navigate = useNavigate();
|
|
2163
|
-
* const location = useLocation();
|
|
2164
|
-
* const { hasRole, hasPermission } = useUnifiedAuth();
|
|
2165
|
-
*
|
|
2166
|
-
* // Build navigation items based on user permissions
|
|
2167
|
-
* const navItems = [
|
|
2168
|
-
* { id: 'dashboard', label: 'Dashboard', href: '/dashboard', icon: 'LayoutDashboard' },
|
|
2169
|
-
* ...(hasPermission('meals:read') ? [
|
|
2170
|
-
* { id: 'meals', label: 'Meals', href: '/meals', icon: 'UtensilsCrossed' }
|
|
2171
|
-
* ] : []),
|
|
2172
|
-
* ...(hasRole('admin') ? [
|
|
2173
|
-
* { id: 'admin', label: 'Admin Panel', href: '/admin', icon: 'Shield' }
|
|
2174
|
-
* ] : []),
|
|
2175
|
-
* { id: 'profile', label: 'Profile', href: '/profile', icon: 'User' }
|
|
2176
|
-
* ];
|
|
2177
|
-
*
|
|
2178
|
-
* return (
|
|
2179
|
-
* <NavigationMenu
|
|
2180
|
-
* items={navItems}
|
|
2181
|
-
* mode="dropdown"
|
|
2182
|
-
* currentPath={location.pathname}
|
|
2183
|
-
* onNavigate={(item) => navigate(item.href)}
|
|
2184
|
-
* buttonText="Navigation"
|
|
2185
|
-
* navigationLabel="Main application navigation"
|
|
2186
|
-
* />
|
|
2187
|
-
* );
|
|
2188
|
-
* }
|
|
2189
|
-
* ```
|
|
2190
|
-
*
|
|
2191
|
-
* @example
|
|
2192
|
-
* ```tsx
|
|
2193
|
-
* // Custom navigation with external links and actions
|
|
2194
|
-
* import { NavigationMenu } from '@jmruthers/pace-core';
|
|
2195
|
-
*
|
|
2196
|
-
* function CustomNavigation() {
|
|
2197
|
-
* const handleNavigation = (item) => {
|
|
2198
|
-
* if (item.id === 'logout') {
|
|
2199
|
-
* // Handle logout action
|
|
2200
|
-
* handleLogout();
|
|
2201
|
-
* } else if (item.href?.startsWith('http')) {
|
|
2202
|
-
* // Handle external links
|
|
2203
|
-
* window.open(item.href, '_blank');
|
|
2204
|
-
* } else if (item.href) {
|
|
2205
|
-
* // Handle internal navigation
|
|
2206
|
-
* navigate(item.href);
|
|
2207
|
-
* }
|
|
2208
|
-
* };
|
|
2209
|
-
*
|
|
2210
|
-
* const navItems = [
|
|
2211
|
-
* { id: 'home', label: 'Home', href: '/', icon: 'Home' },
|
|
2212
|
-
* { id: 'help', label: 'Help Center', href: 'https://help.example.com', icon: 'HelpCircle' },
|
|
2213
|
-
* { id: 'logout', label: 'Sign Out', icon: 'LogOut' } // No href for actions
|
|
2214
|
-
* ];
|
|
2215
|
-
*
|
|
2216
|
-
* return (
|
|
2217
|
-
* <NavigationMenu
|
|
2218
|
-
* items={navItems}
|
|
2219
|
-
* mode="dropdown"
|
|
2220
|
-
* onNavigate={handleNavigation}
|
|
2221
|
-
* buttonText="Menu"
|
|
2222
|
-
* disabled={false}
|
|
2223
|
-
* />
|
|
2224
|
-
* );
|
|
2225
|
-
* }
|
|
2226
|
-
* ```
|
|
2227
|
-
*
|
|
2228
|
-
* @accessibility
|
|
2229
|
-
* - WCAG 2.1 AA compliant navigation structure
|
|
2230
|
-
* - Proper ARIA attributes for screen readers
|
|
2231
|
-
* - Keyboard navigation with Enter, Space, and Escape keys
|
|
2232
|
-
* - Focus management for dropdown menus
|
|
2233
|
-
* - Semantic HTML structure with nav, menu, and menuitem roles
|
|
2234
|
-
* - Clear visual indicators for active/current page
|
|
2235
|
-
*
|
|
2236
|
-
* @performance
|
|
2237
|
-
* - Lightweight component with minimal re-renders
|
|
2238
|
-
* - Efficient click outside detection
|
|
2239
|
-
* - Optimized keyboard event handling
|
|
2240
|
-
* - Memory cleanup for event listeners
|
|
2241
|
-
*
|
|
2242
|
-
* @styling
|
|
2243
|
-
* - Uses Tailwind CSS for consistent styling
|
|
2244
|
-
* - Supports custom className for additional styling
|
|
2245
|
-
* - Responsive design considerations
|
|
2246
|
-
*
|
|
2247
|
-
* @dependencies
|
|
2248
|
-
* - React 19+ - Component framework and hooks
|
|
2249
|
-
* - Lucide React - Icon components
|
|
2250
|
-
* - Radix UI - Dropdown menu primitives
|
|
2251
|
-
* - React Router (optional) - For navigation handling
|
|
2252
|
-
* - Tailwind CSS - Styling system
|
|
2253
|
-
*/
|
|
2254
|
-
|
|
2255
|
-
/**
|
|
2256
|
-
* Unified NavigationMenu component that supports both dropdown and hierarchical navigation modes.
|
|
2257
|
-
*
|
|
2258
|
-
* A flexible navigation menu component with support for icons, current page highlighting,
|
|
2259
|
-
* keyboard navigation, and nested menu items.
|
|
2260
|
-
*
|
|
2261
|
-
* Features:
|
|
2262
|
-
* - Dropdown mode: Menu button that opens a dropdown list
|
|
2263
|
-
* - Hierarchical mode: Expandable tree navigation with nested items
|
|
2264
|
-
* - Icon support for navigation items
|
|
2265
|
-
* - Current page highlighting
|
|
2266
|
-
* - Keyboard navigation support (Enter, Space, Escape)
|
|
2267
|
-
* - Accessible design with proper ARIA attributes
|
|
2268
|
-
* - Click outside to close (dropdown mode)
|
|
2269
|
-
* - Recursive rendering for nested items (hierarchical mode)
|
|
2270
|
-
*
|
|
2271
|
-
* @example
|
|
2272
|
-
* Basic dropdown navigation (most common use case):
|
|
2273
|
-
* ```tsx
|
|
2274
|
-
* import { NavigationMenu } from '@jmruthers/pace-core';
|
|
2275
|
-
* import { useNavigate, useLocation } from 'react-router-dom';
|
|
2276
|
-
*
|
|
2277
|
-
* function AppNavigation() {
|
|
2278
|
-
* const navigate = useNavigate();
|
|
2279
|
-
* const location = useLocation();
|
|
2280
|
-
*
|
|
2281
|
-
* const navItems = [
|
|
2282
|
-
* { id: 'home', label: 'Home', href: '/', icon: 'Home' },
|
|
2283
|
-
* { id: 'dashboard', label: 'Dashboard', href: '/dashboard', icon: 'LayoutDashboard' },
|
|
2284
|
-
* { id: 'reports', label: 'Reports', href: '/reports', icon: 'FileText' },
|
|
2285
|
-
* { id: 'settings', label: 'Settings', href: '/settings', icon: 'Settings' }
|
|
2286
|
-
* ];
|
|
2287
|
-
*
|
|
2288
|
-
* return (
|
|
2289
|
-
* <NavigationMenu
|
|
2290
|
-
* items={navItems}
|
|
2291
|
-
* mode="dropdown"
|
|
2292
|
-
* currentPath={location.pathname}
|
|
2293
|
-
* onNavigate={(item) => navigate(item.href)}
|
|
2294
|
-
* buttonText="Main Menu"
|
|
2295
|
-
* showIcons={true}
|
|
2296
|
-
* />
|
|
2297
|
-
* );
|
|
2298
|
-
* }
|
|
2299
|
-
* ```
|
|
2300
|
-
*
|
|
2301
|
-
* @example
|
|
2302
|
-
* Hierarchical navigation with nested items:
|
|
2303
|
-
* ```tsx
|
|
2304
|
-
* import { NavigationMenu } from '@jmruthers/pace-core';
|
|
2305
|
-
*
|
|
2306
|
-
* function SidebarNavigation() {
|
|
2307
|
-
* const hierarchicalItems = [
|
|
2308
|
-
* {
|
|
2309
|
-
* id: 'user-management',
|
|
2310
|
-
* label: 'User Management',
|
|
2311
|
-
* icon: 'Users',
|
|
2312
|
-
* children: [
|
|
2313
|
-
* { id: 'users-list', label: 'All Users', href: '/users' },
|
|
2314
|
-
* { id: 'users-create', label: 'Create User', href: '/users/create' },
|
|
2315
|
-
* { id: 'user-roles', label: 'User Roles', href: '/users/roles' }
|
|
2316
|
-
* ]
|
|
2317
|
-
* },
|
|
2318
|
-
* {
|
|
2319
|
-
* id: 'reports',
|
|
2320
|
-
* label: 'Reports',
|
|
2321
|
-
* icon: 'BarChart',
|
|
2322
|
-
* children: [
|
|
2323
|
-
* { id: 'sales-reports', label: 'Sales Reports', href: '/reports/sales' },
|
|
2324
|
-
* { id: 'user-reports', label: 'User Reports', href: '/reports/users' }
|
|
2325
|
-
* ]
|
|
2326
|
-
* },
|
|
2327
|
-
* { id: 'settings', label: 'Settings', href: '/settings', icon: 'Settings' }
|
|
2328
|
-
* ];
|
|
2329
|
-
*
|
|
2330
|
-
* return (
|
|
2331
|
-
* <NavigationMenu
|
|
2332
|
-
* items={hierarchicalItems}
|
|
2333
|
-
* mode="hierarchical"
|
|
2334
|
-
* currentPath={window.location.pathname}
|
|
2335
|
-
* onNavigate={(item) => {
|
|
2336
|
-
* if (item.href) {
|
|
2337
|
-
* window.location.href = item.href;
|
|
2338
|
-
* }
|
|
2339
|
-
* }}
|
|
2340
|
-
* className="w-64 bg-sec-50 p-4"
|
|
2341
|
-
* />
|
|
2342
|
-
* );
|
|
2343
|
-
* }
|
|
2344
|
-
* ```
|
|
2345
|
-
*
|
|
2346
|
-
* @example
|
|
2347
|
-
* Integration with React Router and authentication:
|
|
2348
|
-
* ```tsx
|
|
2349
|
-
* import { NavigationMenu } from '@jmruthers/pace-core';
|
|
2350
|
-
* import { useNavigate, useLocation } from 'react-router-dom';
|
|
2351
|
-
* import { useUnifiedAuth } from '@jmruthers/pace-core/providers';
|
|
2352
|
-
*
|
|
2353
|
-
* function AuthenticatedNavigation() {
|
|
2354
|
-
* const navigate = useNavigate();
|
|
2355
|
-
* const location = useLocation();
|
|
2356
|
-
* const { hasRole, hasPermission } = useUnifiedAuth();
|
|
2357
|
-
*
|
|
2358
|
-
* // Build navigation items with permission requirements
|
|
2359
|
-
* const navItems = [
|
|
2360
|
-
* {
|
|
2361
|
-
* id: 'dashboard',
|
|
2362
|
-
* label: 'Dashboard',
|
|
2363
|
-
* href: '/dashboard',
|
|
2364
|
-
* icon: 'LayoutDashboard',
|
|
2365
|
-
* permissions: ['dashboard:read']
|
|
2366
|
-
* },
|
|
2367
|
-
* {
|
|
2368
|
-
* id: 'meals',
|
|
2369
|
-
* label: 'Meals',
|
|
2370
|
-
* href: '/meals',
|
|
2371
|
-
* icon: 'UtensilsCrossed',
|
|
2372
|
-
* permissions: ['meals:read']
|
|
2373
|
-
* },
|
|
2374
|
-
* {
|
|
2375
|
-
* id: 'admin',
|
|
2376
|
-
* label: 'Admin Panel',
|
|
2377
|
-
* href: '/admin',
|
|
2378
|
-
* icon: 'Shield',
|
|
2379
|
-
* roles: ['admin', 'super_admin']
|
|
2380
|
-
* },
|
|
2381
|
-
* {
|
|
2382
|
-
* id: 'profile',
|
|
2383
|
-
* label: 'Profile',
|
|
2384
|
-
* href: '/profile',
|
|
2385
|
-
* icon: 'User'
|
|
2386
|
-
* }
|
|
2387
|
-
* ];
|
|
2388
|
-
*
|
|
2389
|
-
* return (
|
|
2390
|
-
* <NavigationMenu
|
|
2391
|
-
* items={navItems}
|
|
2392
|
-
* mode="dropdown"
|
|
2393
|
-
* currentPath={location.pathname}
|
|
2394
|
-
* onNavigate={(item) => navigate(item.href)}
|
|
2395
|
-
* buttonText="Navigation"
|
|
2396
|
-
* navigationLabel="Main application navigation"
|
|
2397
|
-
* // Permission filtering is always enabled - no prop needed
|
|
2398
|
-
* auditLog={true}
|
|
2399
|
-
* />
|
|
2400
|
-
* );
|
|
2401
|
-
* }
|
|
2402
|
-
* ```
|
|
2403
|
-
*
|
|
2404
|
-
* @example
|
|
2405
|
-
* Custom navigation with external links and actions:
|
|
2406
|
-
* ```tsx
|
|
2407
|
-
* import { NavigationMenu } from '@jmruthers/pace-core';
|
|
2408
|
-
*
|
|
2409
|
-
* function CustomNavigation() {
|
|
2410
|
-
* const handleNavigation = (item) => {
|
|
2411
|
-
* if (item.id === 'logout') {
|
|
2412
|
-
* // Handle logout action
|
|
2413
|
-
* handleLogout();
|
|
2414
|
-
* } else if (item.href?.startsWith('http')) {
|
|
2415
|
-
* // Handle external links
|
|
2416
|
-
* window.open(item.href, '_blank');
|
|
2417
|
-
* } else if (item.href) {
|
|
2418
|
-
* // Handle internal navigation
|
|
2419
|
-
* navigate(item.href);
|
|
2420
|
-
* }
|
|
2421
|
-
* };
|
|
2422
|
-
*
|
|
2423
|
-
* const navItems = [
|
|
2424
|
-
* { id: 'home', label: 'Home', href: '/', icon: 'Home' },
|
|
2425
|
-
* { id: 'help', label: 'Help Center', href: 'https://help.example.com', icon: 'HelpCircle' },
|
|
2426
|
-
* { id: 'logout', label: 'Sign Out', icon: 'LogOut' } // No href for actions
|
|
2427
|
-
* ];
|
|
2428
|
-
*
|
|
2429
|
-
* return (
|
|
2430
|
-
* <NavigationMenu
|
|
2431
|
-
* items={navItems}
|
|
2432
|
-
* mode="dropdown"
|
|
2433
|
-
* onNavigate={handleNavigation}
|
|
2434
|
-
* buttonText="Menu"
|
|
2435
|
-
* disabled={false}
|
|
2436
|
-
* />
|
|
2437
|
-
* );
|
|
2438
|
-
* }
|
|
2439
|
-
* ```
|
|
2440
|
-
*
|
|
2441
|
-
* @param props - NavigationMenu component props including items, mode, navigation handlers, and styling options
|
|
2442
|
-
* @returns React element with navigation menu functionality
|
|
2443
|
-
*
|
|
2444
|
-
* @since 0.1.0
|
|
2445
|
-
*/
|
|
2446
|
-
declare const NavigationMenu: React$1.ForwardRefExoticComponent<NavigationMenuProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
2447
|
-
|
|
2448
|
-
/**
|
|
2449
|
-
* @file Password Change Form Component
|
|
2450
|
-
* @package @jmruthers/pace-core
|
|
2451
|
-
* @module Components/PasswordChange
|
|
2452
|
-
* @since 0.1.0
|
|
2453
|
-
*
|
|
2454
|
-
* A secure password change form component with validation, confirmation matching,
|
|
2455
|
-
* and proper error handling for updating user passwords.
|
|
2456
|
-
*
|
|
2457
|
-
* Features:
|
|
2458
|
-
* - Password strength validation (minimum 8 characters)
|
|
2459
|
-
* - Password confirmation matching
|
|
2460
|
-
* - Loading states with disabled form
|
|
2461
|
-
* - Error handling and display
|
|
2462
|
-
* - Accessibility compliant
|
|
2463
|
-
* - Responsive design
|
|
2464
|
-
* - Form validation
|
|
2465
|
-
* - Secure password input
|
|
2466
|
-
* - Success and error callbacks
|
|
2467
|
-
*
|
|
2468
|
-
* @example
|
|
2469
|
-
* ```tsx
|
|
2470
|
-
* // Basic password change form
|
|
2471
|
-
* <PasswordChangeForm
|
|
2472
|
-
* onSubmit={async (values) => {
|
|
2473
|
-
* try {
|
|
2474
|
-
* await updatePassword(values.newPassword);
|
|
2475
|
-
* toast.success('Password updated successfully!');
|
|
2476
|
-
* return {};
|
|
2477
|
-
* } catch (error) {
|
|
2478
|
-
* return { error: { message: error.message } };
|
|
2479
|
-
* }
|
|
2480
|
-
* }}
|
|
2481
|
-
* />
|
|
2482
|
-
*
|
|
2483
|
-
* // Password change form with custom styling
|
|
2484
|
-
* <PasswordChangeForm
|
|
2485
|
-
* className="max-w-md mx-auto p-6 bg-main-50 rounded-lg shadow-md"
|
|
2486
|
-
* onSubmit={async (values) => {
|
|
2487
|
-
* const result = await authService.changePassword(values.newPassword);
|
|
2488
|
-
* if (result.success) {
|
|
2489
|
-
* navigate('/profile');
|
|
2490
|
-
* return {};
|
|
2491
|
-
* } else {
|
|
2492
|
-
* return { error: { message: result.error } };
|
|
2493
|
-
* }
|
|
2494
|
-
* }}
|
|
2495
|
-
* />
|
|
2496
|
-
*
|
|
2497
|
-
* // Password change form in a modal with onSuccess callback
|
|
2498
|
-
* <Modal isOpen={showPasswordChange} onClose={() => setShowPasswordChange(false)}>
|
|
2499
|
-
* <ModalContent>
|
|
2500
|
-
* <ModalHeader>
|
|
2501
|
-
* <ModalTitle>Change Password</ModalTitle>
|
|
2502
|
-
* </ModalHeader>
|
|
2503
|
-
* <ModalBody>
|
|
2504
|
-
* <PasswordChangeForm
|
|
2505
|
-
* onSubmit={async (values) => {
|
|
2506
|
-
* const result = await changePassword(values.newPassword);
|
|
2507
|
-
* if (result.success) {
|
|
2508
|
-
* return {};
|
|
2509
|
-
* } else {
|
|
2510
|
-
* return { error: { message: result.error } };
|
|
2511
|
-
* }
|
|
2512
|
-
* }}
|
|
2513
|
-
* onSuccess={() => {
|
|
2514
|
-
* setShowPasswordChange(false);
|
|
2515
|
-
* toast.success('Password changed successfully');
|
|
2516
|
-
* }}
|
|
2517
|
-
* />
|
|
2518
|
-
* </ModalBody>
|
|
2519
|
-
* </ModalContent>
|
|
2520
|
-
* </Modal>
|
|
2521
|
-
* ```
|
|
2522
|
-
*
|
|
2523
|
-
* @accessibility
|
|
2524
|
-
* - WCAG 2.1 AA compliant
|
|
2525
|
-
* - Proper form labels and associations
|
|
2526
|
-
* - Screen reader friendly error messages
|
|
2527
|
-
* - Keyboard navigation support
|
|
2528
|
-
* - Focus management
|
|
2529
|
-
* - High contrast support
|
|
2530
|
-
* - Clear error identification
|
|
2531
|
-
* - Role="alert" for error announcements
|
|
2532
|
-
* - Password field security
|
|
2533
|
-
*
|
|
2534
|
-
* @security
|
|
2535
|
-
* - Password strength validation
|
|
2536
|
-
* - Secure password input fields
|
|
2537
|
-
* - Confirmation matching
|
|
2538
|
-
* - No password logging
|
|
2539
|
-
* - Proper error handling
|
|
2540
|
-
*
|
|
2541
|
-
* @dependencies
|
|
2542
|
-
* - React 19+ - Hooks and state
|
|
2543
|
-
* - Button component
|
|
2544
|
-
* - Input component
|
|
2545
|
-
* - Label component
|
|
2546
|
-
* - Tailwind CSS - Styling
|
|
2547
|
-
*/
|
|
2548
|
-
/**
|
|
2549
|
-
* Form values for password change.
|
|
2550
|
-
*/
|
|
2551
|
-
interface PasswordChangeFormValues {
|
|
2552
|
-
newPassword: string;
|
|
2553
|
-
confirmPassword: string;
|
|
2554
|
-
}
|
|
2555
|
-
/**
|
|
2556
|
-
* Error structure for password change form.
|
|
2557
|
-
*/
|
|
2558
|
-
interface PasswordChangeFormError {
|
|
2559
|
-
message?: string;
|
|
2560
|
-
code?: string;
|
|
2561
|
-
}
|
|
2562
|
-
/**
|
|
2563
|
-
* Props for the PasswordChangeForm component.
|
|
2564
|
-
*/
|
|
2565
|
-
interface PasswordChangeFormProps {
|
|
2566
|
-
onSubmit: (values: PasswordChangeFormValues) => Promise<{
|
|
2567
|
-
error?: PasswordChangeFormError;
|
|
2568
|
-
}>;
|
|
2569
|
-
onSuccess?: () => void;
|
|
2570
|
-
className?: string;
|
|
2571
|
-
}
|
|
2572
|
-
declare function PasswordChangeForm({ onSubmit, onSuccess, className }: PasswordChangeFormProps): react_jsx_runtime.JSX.Element;
|
|
2573
|
-
|
|
2574
|
-
/**
|
|
2575
|
-
* Props for the Header component
|
|
2576
|
-
*/
|
|
2577
|
-
interface HeaderProps {
|
|
2578
|
-
/** URL to the app logo image */
|
|
2579
|
-
logoUrl?: string;
|
|
2580
|
-
/** Alt text for the logo */
|
|
2581
|
-
logoAlt?: string;
|
|
2582
|
-
/** Custom logo component (overrides logoUrl) */
|
|
2583
|
-
logo?: React__default.ReactNode;
|
|
2584
|
-
/** Navigation items for the menu - uses NavigationItem interface */
|
|
2585
|
-
navItems?: NavigationItem[];
|
|
2586
|
-
/** Current user for the user menu */
|
|
2587
|
-
user?: User | null;
|
|
2588
|
-
/** Sign out handler for user menu */
|
|
2589
|
-
onSignOut?: () => Promise<void>;
|
|
2590
|
-
/** Password change handler for user menu */
|
|
2591
|
-
onChangePassword?: (newPassword: string, confirmPassword: string) => Promise<{
|
|
2592
|
-
error?: PasswordChangeFormError;
|
|
2593
|
-
}>;
|
|
2594
|
-
/** Additional actions to display (will be placed between event selector and user menu) */
|
|
2595
|
-
actions?: React__default.ReactNode;
|
|
2596
|
-
/** Custom user menu component (overrides default UserMenu) */
|
|
2597
|
-
userMenu?: React__default.ReactNode;
|
|
2598
|
-
/** Custom className */
|
|
2599
|
-
className?: string;
|
|
2600
|
-
/** Show/hide context selector (unified org/event selector) - default: true */
|
|
2601
|
-
showContextSelector?: boolean;
|
|
2602
|
-
/** Show organisations in context selector - default: true */
|
|
2603
|
-
showOrganisations?: boolean;
|
|
2604
|
-
/** Show events in context selector - default: true */
|
|
2605
|
-
showEvents?: boolean;
|
|
2606
|
-
/** Show/hide user menu */
|
|
2607
|
-
showUserMenu?: boolean;
|
|
2608
|
-
/** Current path for navigation highlighting */
|
|
2609
|
-
currentPath?: string;
|
|
2610
|
-
/** Custom navigation handler */
|
|
2611
|
-
onNavigate?: (item: NavigationItem) => void;
|
|
2612
|
-
/** URL to navigate to when logo is clicked (e.g., '/dashboard') */
|
|
2613
|
-
logoHref?: string;
|
|
2614
|
-
}
|
|
2615
|
-
/**
|
|
2616
|
-
* Header component for application layouts with comprehensive navigation, user management,
|
|
2617
|
-
* and customizable branding support.
|
|
2618
|
-
*
|
|
2619
|
-
* A flexible header component that supports various configurations including custom logos,
|
|
2620
|
-
* navigation menus, user authentication, event selection, and custom actions.
|
|
2621
|
-
*
|
|
2622
|
-
* **Logo Display:** When used via PaceAppLayout, the logo URL is automatically constructed
|
|
2623
|
-
* from the appName prop as `/${appName.toLowerCase()}_logo_wide.svg`. The appName should
|
|
2624
|
-
* come from an APP_NAME constant declared in your App.tsx file to ensure consistency across
|
|
2625
|
-
* authenticated and public pages.
|
|
2626
|
-
*
|
|
2627
|
-
* Features:
|
|
2628
|
-
* - Customizable logo (URL or custom component)
|
|
2629
|
-
* - Clickable logo that automatically routes to dashboard (configurable via logoHref)
|
|
2630
|
-
* - Navigation menu integration with highlighting
|
|
2631
|
-
* - User menu with authentication and password management
|
|
2632
|
-
* - Event selector for multi-tenant applications
|
|
2633
|
-
* - Custom actions support
|
|
2634
|
-
* - Responsive design with mobile considerations
|
|
2635
|
-
* - Accessibility compliant with proper ARIA attributes
|
|
2636
|
-
* - Backdrop blur effects for modern UI
|
|
2637
|
-
* - Flexible layout with configurable sections
|
|
2638
|
-
*
|
|
2639
|
-
* @example
|
|
2640
|
-
* Basic header with logo and navigation (logo routes to /dashboard when clicked):
|
|
2641
|
-
* ```tsx
|
|
2642
|
-
* import { Header } from '@jmruthers/pace-core';
|
|
2643
|
-
* import { useNavigate, useLocation } from 'react-router-dom';
|
|
2644
|
-
*
|
|
2645
|
-
* function AppHeader() {
|
|
2646
|
-
* const navigate = useNavigate();
|
|
2647
|
-
* const location = useLocation();
|
|
2648
|
-
*
|
|
2649
|
-
* const navItems = [
|
|
2650
|
-
* { id: 'dashboard', label: 'Dashboard', href: '/dashboard' },
|
|
2651
|
-
* { id: 'meals', label: 'Meals', href: '/meals' },
|
|
2652
|
-
* { id: 'settings', label: 'Settings', href: '/settings' }
|
|
2653
|
-
* ];
|
|
2654
|
-
*
|
|
2655
|
-
* return (
|
|
2656
|
-
* <Header
|
|
2657
|
-
* logoUrl="/company-logo.svg"
|
|
2658
|
-
* logoAlt="My Company"
|
|
2659
|
-
* logoHref="/dashboard"
|
|
2660
|
-
* navItems={navItems}
|
|
2661
|
-
* currentPath={location.pathname}
|
|
2662
|
-
* onNavigate={(item) => navigate(item.href)}
|
|
2663
|
-
* user={currentUser}
|
|
2664
|
-
* onSignOut={handleSignOut}
|
|
2665
|
-
* />
|
|
2666
|
-
* );
|
|
2667
|
-
* }
|
|
2668
|
-
* ```
|
|
2669
|
-
*
|
|
2670
|
-
* @example
|
|
2671
|
-
* Header with custom actions:
|
|
2672
|
-
* ```tsx
|
|
2673
|
-
* import { Header, Button } from '@jmruthers/pace-core';
|
|
2674
|
-
*
|
|
2675
|
-
* function HeaderWithActions() {
|
|
2676
|
-
* const customActions = (
|
|
2677
|
-
* <>
|
|
2678
|
-
* <Button variant="outline" size="sm">Export</Button>
|
|
2679
|
-
* <Button size="sm">New Item</Button>
|
|
2680
|
-
* </>
|
|
2681
|
-
* );
|
|
2682
|
-
*
|
|
2683
|
-
* return (
|
|
2684
|
-
* <Header
|
|
2685
|
-
* logoUrl="/logo.svg"
|
|
2686
|
-
* navItems={navigationItems}
|
|
2687
|
-
* actions={customActions}
|
|
2688
|
-
* user={currentUser}
|
|
2689
|
-
* onSignOut={handleSignOut}
|
|
2690
|
-
* />
|
|
2691
|
-
* );
|
|
2692
|
-
* }
|
|
2693
|
-
* ```
|
|
2694
|
-
*
|
|
2695
|
-
* @example
|
|
2696
|
-
* Minimal header configuration:
|
|
2697
|
-
* ```tsx
|
|
2698
|
-
* function MinimalHeader() {
|
|
2699
|
-
* return (
|
|
2700
|
-
* <Header
|
|
2701
|
-
* logoUrl="/simple-logo.svg"
|
|
2702
|
-
* logoAlt="Simple App"
|
|
2703
|
-
* showContextSelector={false}
|
|
2704
|
-
* user={currentUser}
|
|
2705
|
-
* onSignOut={handleSignOut}
|
|
2706
|
-
* />
|
|
2707
|
-
* );
|
|
2708
|
-
* }
|
|
2709
|
-
* ```
|
|
2710
|
-
*
|
|
2711
|
-
* @param props - Header configuration including logo, navigation, user settings, and custom content
|
|
2712
|
-
* @returns React element with complete header functionality
|
|
2713
|
-
*
|
|
2714
|
-
* @since 0.1.0
|
|
2715
|
-
*/
|
|
2716
|
-
/**
|
|
2717
|
-
* Header component for application layouts.
|
|
2718
|
-
* Provides navigation, user menu, organisation/event selectors, and customizable branding.
|
|
2719
|
-
*
|
|
2720
|
-
* @param props - Header configuration
|
|
2721
|
-
* @returns The rendered header
|
|
2722
|
-
*/
|
|
2723
|
-
declare function Header({ logoUrl, logoAlt, logo, navItems, user, onSignOut, onChangePassword, actions, userMenu, className, showContextSelector, showOrganisations, showEvents, showUserMenu, currentPath, onNavigate, logoHref }: HeaderProps): react_jsx_runtime.JSX.Element;
|
|
2724
|
-
|
|
2725
|
-
/**
|
|
2726
|
-
* @file Footer Component
|
|
2727
|
-
* @package @jmruthers/pace-core
|
|
2728
|
-
* @module Components/Footer
|
|
2729
|
-
* @since 0.1.0
|
|
2730
|
-
*
|
|
2731
|
-
* A flexible footer component for application layouts with copyright information,
|
|
2732
|
-
* navigation links, and customizable content.
|
|
2733
|
-
*
|
|
2734
|
-
* Features:
|
|
2735
|
-
* - Copyright information with automatic year generation
|
|
2736
|
-
* - Customizable company name and branding
|
|
2737
|
-
* - Optional navigation links
|
|
2738
|
-
* - Logo display support
|
|
2739
|
-
* - Custom footer content via children
|
|
2740
|
-
* - Responsive design
|
|
2741
|
-
* - Accessibility compliant
|
|
2742
|
-
* - Flexible layout options
|
|
2743
|
-
* - Consistent styling with design system
|
|
2744
|
-
*
|
|
2745
|
-
* @example
|
|
2746
|
-
* ```tsx
|
|
2747
|
-
* // Basic footer with default copyright
|
|
2748
|
-
* <Footer />
|
|
2749
|
-
*
|
|
2750
|
-
* // Footer with custom company name and year
|
|
2751
|
-
* <Footer
|
|
2752
|
-
* companyName="My Company Inc."
|
|
2753
|
-
* year={2024}
|
|
2754
|
-
* />
|
|
2755
|
-
*
|
|
2756
|
-
* // Footer with navigation links
|
|
2757
|
-
* <Footer
|
|
2758
|
-
* companyName="My Company"
|
|
2759
|
-
* links={[
|
|
2760
|
-
* { label: 'Privacy Policy', href: '/privacy' },
|
|
2761
|
-
* { label: 'Terms of Service', href: '/terms' },
|
|
2762
|
-
* { label: 'Contact', href: '/contact' }
|
|
2763
|
-
* ]}
|
|
2764
|
-
* />
|
|
2765
|
-
*
|
|
2766
|
-
* // Footer with logo and custom copyright
|
|
2767
|
-
* <Footer
|
|
2768
|
-
* logo="/logo.svg"
|
|
2769
|
-
* copyright="© 2024 My Company. All rights reserved."
|
|
2770
|
-
* />
|
|
2771
|
-
*
|
|
2772
|
-
* // Footer with custom content
|
|
2773
|
-
* <Footer companyName="My Company">
|
|
2774
|
-
* <section className="grid grid-cols-1 md:grid-cols-3 gap-8 mb-8">
|
|
2775
|
-
* <section>
|
|
2776
|
-
* <h3 className="font-semibold mb-2">About Us</h3>
|
|
2777
|
-
* <p className="text-sm text-muted-foreground">
|
|
2778
|
-
* We provide innovative solutions for modern businesses.
|
|
2779
|
-
* </p>
|
|
2780
|
-
* </section>
|
|
2781
|
-
* <section>
|
|
2782
|
-
* <h3 className="font-semibold mb-2">Contact</h3>
|
|
2783
|
-
* <p className="text-sm text-muted-foreground">
|
|
2784
|
-
* Email: info@mycompany.com<br />
|
|
2785
|
-
* Phone: (555) 123-4567
|
|
2786
|
-
* </p>
|
|
2787
|
-
* </section>
|
|
2788
|
-
* <section>
|
|
2789
|
-
* <h3 className="font-semibold mb-2">Follow Us</h3>
|
|
2790
|
-
* <nav className="flex gap-2">
|
|
2791
|
-
* <a href="#" className="text-muted-foreground hover:text-foreground">Twitter</a>
|
|
2792
|
-
* <a href="#" className="text-muted-foreground hover:text-foreground">LinkedIn</a>
|
|
2793
|
-
* </nav>
|
|
2794
|
-
* </section>
|
|
2795
|
-
* </section>
|
|
2796
|
-
* </Footer>
|
|
2797
|
-
* ```
|
|
2798
|
-
*
|
|
2799
|
-
* @accessibility
|
|
2800
|
-
* - WCAG 2.1 AA compliant
|
|
2801
|
-
* - Proper semantic HTML with role="contentinfo"
|
|
2802
|
-
* - Screen reader friendly navigation
|
|
2803
|
-
* - Keyboard navigation support
|
|
2804
|
-
* - High contrast support
|
|
2805
|
-
* - Clear link identification
|
|
2806
|
-
*
|
|
2807
|
-
* @dependencies
|
|
2808
|
-
* - React 19+ - Component framework
|
|
2809
|
-
* - Tailwind CSS - Styling
|
|
2810
|
-
*/
|
|
2811
|
-
|
|
2812
|
-
/**
|
|
2813
|
-
* Props for the Footer component.
|
|
2814
|
-
*/
|
|
2815
|
-
interface FooterProps {
|
|
2816
|
-
/**
|
|
2817
|
-
* Company or organization name
|
|
2818
|
-
*/
|
|
2819
|
-
companyName?: string;
|
|
2820
|
-
/**
|
|
2821
|
-
* Current year or custom year for copyright
|
|
2822
|
-
* @default current year
|
|
2823
|
-
*/
|
|
2824
|
-
year?: number;
|
|
2825
|
-
/**
|
|
2826
|
-
* Optional array of navigation links to display
|
|
2827
|
-
*/
|
|
2828
|
-
links?: Array<{
|
|
2829
|
-
label: string;
|
|
2830
|
-
href: string;
|
|
2831
|
-
}>;
|
|
2832
|
-
/**
|
|
2833
|
-
* Optional CSS class name
|
|
2834
|
-
*/
|
|
2835
|
-
className?: string;
|
|
2836
|
-
/**
|
|
2837
|
-
* Logo image URL (from UI version)
|
|
2838
|
-
*/
|
|
2839
|
-
logo?: string;
|
|
2840
|
-
/**
|
|
2841
|
-
* Copyright text (from UI version)
|
|
2842
|
-
*/
|
|
2843
|
-
copyright?: string;
|
|
2844
|
-
/**
|
|
2845
|
-
* Footer content - children to render inside footer
|
|
2846
|
-
*/
|
|
2847
|
-
children?: React__default.ReactNode;
|
|
2848
|
-
}
|
|
2849
|
-
declare const Footer: React__default.NamedExoticComponent<FooterProps>;
|
|
2850
|
-
|
|
2851
|
-
/**
|
|
2852
|
-
* @file User Menu Component
|
|
2853
|
-
* @package @jmruthers/pace-core
|
|
2854
|
-
* @module Components/UserMenu
|
|
2855
|
-
* @since 0.1.0
|
|
2856
|
-
*
|
|
2857
|
-
* A comprehensive user menu component that displays user information and provides
|
|
2858
|
-
* access to user-specific actions like password changes and sign out.
|
|
2859
|
-
*
|
|
2860
|
-
* Features:
|
|
2861
|
-
* - User avatar and display name
|
|
2862
|
-
* - Dropdown menu with user actions
|
|
2863
|
-
* - Password change functionality
|
|
2864
|
-
* - Sign out capability
|
|
2865
|
-
* - Loading state component
|
|
2866
|
-
* - Responsive design
|
|
2867
|
-
* - Accessibility compliant
|
|
2868
|
-
* - Performance optimized with React.memo
|
|
2869
|
-
* - Integration with Supabase User
|
|
2870
|
-
* - Customizable styling
|
|
2871
|
-
*
|
|
2872
|
-
* @example
|
|
2873
|
-
* ```tsx
|
|
2874
|
-
* // Basic user menu
|
|
2875
|
-
* <UserMenu
|
|
2876
|
-
* user={currentUser}
|
|
2877
|
-
* onSignOut={async () => {
|
|
2878
|
-
* await signOut();
|
|
2879
|
-
* navigate('/login');
|
|
2880
|
-
* }}
|
|
2881
|
-
* onChangePassword={async (newPassword, confirmPassword) => {
|
|
2882
|
-
* try {
|
|
2883
|
-
* await updatePassword(newPassword);
|
|
2884
|
-
* toast.success('Password updated successfully!');
|
|
2885
|
-
* return {};
|
|
2886
|
-
* } catch (error) {
|
|
2887
|
-
* return { error: { message: error.message } };
|
|
2888
|
-
* }
|
|
2889
|
-
* }}
|
|
2890
|
-
* />
|
|
2891
|
-
*
|
|
2892
|
-
* // User menu without avatar
|
|
2893
|
-
* <UserMenu
|
|
2894
|
-
* user={currentUser}
|
|
2895
|
-
* showAvatar={false}
|
|
2896
|
-
* onSignOut={handleSignOut}
|
|
2897
|
-
* onChangePassword={handlePasswordChange}
|
|
2898
|
-
* />
|
|
2899
|
-
*
|
|
2900
|
-
* // User menu with loading state
|
|
2901
|
-
* {isLoading ? (
|
|
2902
|
-
* <UserMenu.Loading />
|
|
2903
|
-
* ) : (
|
|
2904
|
-
* <UserMenu
|
|
2905
|
-
* user={user}
|
|
2906
|
-
* onSignOut={handleSignOut}
|
|
2907
|
-
* onChangePassword={handlePasswordChange}
|
|
2908
|
-
* />
|
|
2909
|
-
* )}
|
|
2910
|
-
*
|
|
2911
|
-
* // User menu in header
|
|
2912
|
-
* <Header>
|
|
2913
|
-
* <nav className="flex items-center gap-4">
|
|
2914
|
-
* <Navigation />
|
|
2915
|
-
* <UserMenu
|
|
2916
|
-
* user={user}
|
|
2917
|
-
* onSignOut={handleSignOut}
|
|
2918
|
-
* onChangePassword={handlePasswordChange}
|
|
2919
|
-
* className="ml-auto"
|
|
2920
|
-
* />
|
|
2921
|
-
* </nav>
|
|
2922
|
-
* </Header>
|
|
2923
|
-
* ```
|
|
2924
|
-
*
|
|
2925
|
-
* @accessibility
|
|
2926
|
-
* - WCAG 2.1 AA compliant
|
|
2927
|
-
* - Proper ARIA labels and roles
|
|
2928
|
-
* - Keyboard navigation support
|
|
2929
|
-
* - Focus management
|
|
2930
|
-
* - Screen reader friendly
|
|
2931
|
-
* - High contrast support
|
|
2932
|
-
* - Loading state announcements
|
|
2933
|
-
* - Clear action identification
|
|
2934
|
-
*
|
|
2935
|
-
* @performance
|
|
2936
|
-
* - React.memo for efficient re-rendering
|
|
2937
|
-
* - useCallback for stable event handlers
|
|
2938
|
-
* - useMemo for computed values
|
|
2939
|
-
* - Minimal re-renders
|
|
2940
|
-
* - Optimized avatar rendering
|
|
2941
|
-
*
|
|
2942
|
-
* @dependencies
|
|
2943
|
-
* - React 19+ - Hooks and memo
|
|
2944
|
-
* - @supabase/supabase-js - User type
|
|
2945
|
-
* - lucide-react - Icons
|
|
2946
|
-
* - DropdownMenu components
|
|
2947
|
-
* - Dialog components
|
|
2948
|
-
* - PasswordChangeForm component
|
|
2949
|
-
* - Avatar component
|
|
2950
|
-
* - Button component
|
|
2951
|
-
* - Tailwind CSS - Styling
|
|
2952
|
-
*/
|
|
2953
|
-
|
|
2954
|
-
/**
|
|
2955
|
-
* Props for the UserMenu component.
|
|
2956
|
-
*/
|
|
2957
|
-
interface UserMenuProps {
|
|
2958
|
-
user: User | null;
|
|
2959
|
-
onSignOut?: () => Promise<void>;
|
|
2960
|
-
onChangePassword?: (newPassword: string, confirmPassword: string) => Promise<{
|
|
2961
|
-
error?: PasswordChangeFormError;
|
|
2962
|
-
}>;
|
|
2963
|
-
className?: string;
|
|
2964
|
-
showAvatar?: boolean;
|
|
2965
|
-
}
|
|
2966
|
-
declare const UserMenu: React__default.NamedExoticComponent<UserMenuProps>;
|
|
2967
|
-
|
|
2968
|
-
type Operation = 'read' | 'create' | 'update' | 'delete' | 'manage';
|
|
2969
|
-
/**
|
|
2970
|
-
* Props for the PaceAppLayout component.
|
|
2971
|
-
* Configures the application layout including navigation, header, and footer.
|
|
2972
|
-
*/
|
|
2973
|
-
interface PaceAppLayoutProps {
|
|
2974
|
-
/** The name of the application to be displayed in the header. */
|
|
2975
|
-
appName: string;
|
|
2976
|
-
/** Optional navigation items for the header menu. If not provided, uses default navigation. */
|
|
2977
|
-
navItems?: NavigationItem[];
|
|
2978
|
-
/** Show/hide unified context selector (shows all accessible orgs and events) - default: true */
|
|
2979
|
-
showContextSelector?: boolean;
|
|
2980
|
-
/** Show organisations in context selector - default: true */
|
|
2981
|
-
showOrganisations?: boolean;
|
|
2982
|
-
/** Show events in context selector - default: true */
|
|
2983
|
-
showEvents?: boolean;
|
|
2984
|
-
/** Custom actions to display in the header (between event selector and user menu) */
|
|
2985
|
-
headerActions?: React__default.ReactNode;
|
|
2986
|
-
/** Custom logo component (overrides default logo) */
|
|
2987
|
-
customLogo?: React__default.ReactNode;
|
|
2988
|
-
/** URL to navigate to when logo is clicked (defaults to '/dashboard') */
|
|
2989
|
-
logoHref?: string;
|
|
2990
|
-
/** Custom user menu component (overrides default user menu) */
|
|
2991
|
-
customUserMenu?: React__default.ReactNode;
|
|
2992
|
-
/** Custom className for the header */
|
|
2993
|
-
headerClassName?: string;
|
|
2994
|
-
/** Show/hide user menu */
|
|
2995
|
-
showUserMenu?: boolean;
|
|
2996
|
-
/** Enable layout-level permission enforcement */
|
|
2997
|
-
enforcePermissions?: boolean;
|
|
2998
|
-
/** Default permission to check for all routes (when enforcePermissions is true) */
|
|
2999
|
-
defaultPermission?: Operation;
|
|
3000
|
-
/** Route-specific permissions mapping */
|
|
3001
|
-
routePermissions?: Record<string, Operation>;
|
|
3002
|
-
/** Fallback component to show when user lacks permission */
|
|
3003
|
-
permissionFallback?: React__default.ReactNode;
|
|
3004
|
-
/** Custom permission page ID mapping */
|
|
3005
|
-
pageIdMapping?: Record<string, string>;
|
|
3006
|
-
/** Enable strict mode to prevent bypassing permission checks (default: true) */
|
|
3007
|
-
strictMode?: boolean;
|
|
3008
|
-
/** Enable page-level permission enforcement (default: false) */
|
|
3009
|
-
enforcePagePermissions?: boolean;
|
|
3010
|
-
/** Default page permission fallback component */
|
|
3011
|
-
pagePermissionFallback?: React__default.ReactNode;
|
|
3012
|
-
/** Enable audit logging for all permission checks (default: true) */
|
|
3013
|
-
auditLog?: boolean;
|
|
3014
|
-
/** Callback when page access is denied */
|
|
3015
|
-
onPageAccessDenied?: (pageName: string, operation: string) => void;
|
|
3016
|
-
/** Callback when strict mode violation occurs */
|
|
3017
|
-
onStrictModeViolation?: (pageName: string, operation: string) => void;
|
|
3018
|
-
/** Enable role-based routing (default: false) */
|
|
3019
|
-
roleBasedRouting?: boolean;
|
|
3020
|
-
/** Route configuration for role-based routing */
|
|
3021
|
-
routeConfig?: Array<{
|
|
3022
|
-
path: string;
|
|
3023
|
-
component: React__default.ComponentType;
|
|
3024
|
-
permissions: string[];
|
|
3025
|
-
roles?: string[];
|
|
3026
|
-
accessLevel?: string;
|
|
3027
|
-
pageId?: string;
|
|
3028
|
-
strictMode?: boolean;
|
|
3029
|
-
meta?: {
|
|
3030
|
-
title?: string;
|
|
3031
|
-
description?: string;
|
|
3032
|
-
requiresAuth?: boolean;
|
|
3033
|
-
hidden?: boolean;
|
|
3034
|
-
};
|
|
3035
|
-
}>;
|
|
3036
|
-
/** Fallback route for unauthorized access */
|
|
3037
|
-
fallbackRoute?: string;
|
|
3038
|
-
/** Callback when route access is denied */
|
|
3039
|
-
onRouteAccessDenied?: (route: string, reason: string) => void;
|
|
3040
|
-
/** Callback when route strict mode violation occurs */
|
|
3041
|
-
onRouteStrictModeViolation?: (route: string, reason: string) => void;
|
|
3042
|
-
}
|
|
3043
|
-
/**
|
|
3044
|
-
* A consistent layout component for all PACE suite applications that provides a standard
|
|
3045
|
-
* structure with header, main content area, and footer.
|
|
3046
|
-
*
|
|
3047
|
-
* NEW: This component now includes layout-level permission enforcement to ensure
|
|
3048
|
-
* consuming apps can't forget to implement permission checks on individual pages.
|
|
3049
|
-
*
|
|
3050
|
-
* This component is designed to work with React Router's nested routing pattern using
|
|
3051
|
-
* Outlet to render child routes. It provides integrated authentication, navigation,
|
|
3052
|
-
* and user management functionality.
|
|
3053
|
-
*
|
|
3054
|
-
* **Super Admin Access:** When `enforcePermissions={true}`, PaceAppLayout automatically
|
|
3055
|
-
* checks if the user is a super admin before enforcing permissions. Super admins bypass
|
|
3056
|
-
* all permission checks and can access any route without violations. The component extracts
|
|
3057
|
-
* base page names from route paths (e.g., `/organisation/scouts-victoria` → `"organisation"`)
|
|
3058
|
-
* for permission checking, which can be overridden using `pageIdMapping`.
|
|
3059
|
-
*
|
|
3060
|
-
* **Important:** The appName prop should use an APP_NAME constant declared in your App.tsx
|
|
3061
|
-
* file. This ensures consistency with public pages (via PublicPageProvider) which should
|
|
3062
|
-
* also receive the same APP_NAME constant. The logo URL is automatically constructed as
|
|
3063
|
-
* `/${appName.toLowerCase()}_logo_wide.svg` from the public folder.
|
|
3064
|
-
*
|
|
3065
|
-
* Features:
|
|
3066
|
-
* - React Router v6 integration with nested routing
|
|
3067
|
-
* - Unified authentication integration
|
|
3068
|
-
* - Consistent header with navigation and user menu
|
|
3069
|
-
* - Flexible main content area with Outlet
|
|
3070
|
-
* - Footer with application branding
|
|
3071
|
-
* - User sign-out and password change functionality
|
|
3072
|
-
* - Responsive design and accessibility compliant
|
|
3073
|
-
* - Layout-level permission enforcement
|
|
3074
|
-
* - Permission-based navigation filtering
|
|
3075
|
-
* - Automatic page permission validation
|
|
3076
|
-
* - Super admin bypass (super admins automatically bypass all permission checks)
|
|
3077
|
-
*
|
|
3078
|
-
* @example
|
|
3079
|
-
* Basic React Router setup with permission enforcement (RECOMMENDED):
|
|
3080
|
-
* ```tsx
|
|
3081
|
-
* import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
|
|
3082
|
-
* import { UnifiedAuthProvider } from '@jmruthers/pace-core/providers';
|
|
3083
|
-
* import { PaceAppLayout, PaceLoginPage, PublicPageApp } from '@jmruthers/pace-core';
|
|
3084
|
-
*
|
|
3085
|
-
* const APP_NAME = 'CORE';
|
|
3086
|
-
*
|
|
3087
|
-
* function App() {
|
|
3088
|
-
* return (
|
|
3089
|
-
* <UnifiedAuthProvider supabaseClient={supabase} appName={APP_NAME}>
|
|
3090
|
-
* <Router>
|
|
3091
|
-
* <Routes>
|
|
3092
|
-
* <Route path="/login" element={<PaceLoginPage appName={APP_NAME} />} />
|
|
3093
|
-
* <Route path="/events/*" element={<PublicPageApp appName={APP_NAME} />} />
|
|
3094
|
-
* <Route path="/" element={
|
|
3095
|
-
* <PaceAppLayout
|
|
3096
|
-
* appName={APP_NAME}
|
|
3097
|
-
* enforcePermissions={true}
|
|
3098
|
-
* defaultPermission="read"
|
|
3099
|
-
* />
|
|
3100
|
-
* }>
|
|
3101
|
-
* <Route index element={<HomePage />} />
|
|
3102
|
-
* <Route path="dashboard" element={<DashboardPage />} />
|
|
3103
|
-
* <Route path="meals" element={<MealsPage />} />
|
|
3104
|
-
* </Route>
|
|
3105
|
-
* </Routes>
|
|
3106
|
-
* </Router>
|
|
3107
|
-
* </UnifiedAuthProvider>
|
|
3108
|
-
* );
|
|
3109
|
-
* }
|
|
3110
|
-
* ```
|
|
3111
|
-
*
|
|
3112
|
-
*
|
|
3113
|
-
* @example
|
|
3114
|
-
* Custom navigation items with permission filtering (works independently of route enforcement):
|
|
3115
|
-
* ```tsx
|
|
3116
|
-
* import { NavigationItem } from '@jmruthers/pace-core';
|
|
3117
|
-
*
|
|
3118
|
-
* function App() {
|
|
3119
|
-
* const customNavItems: NavigationItem[] = [
|
|
3120
|
-
* { id: 'components', label: 'Components', href: '/components', icon: 'Component' },
|
|
3121
|
-
* { id: 'styles', label: 'Styles', href: '/styles', icon: 'Palette' },
|
|
3122
|
-
* { id: 'meals', label: 'Meals', href: '/meals', icon: 'UtensilsCrossed' }
|
|
3123
|
-
* ];
|
|
3124
|
-
*
|
|
3125
|
-
* return (
|
|
3126
|
-
* <Router>
|
|
3127
|
-
* <Routes>
|
|
3128
|
-
* <Route path="/" element={
|
|
3129
|
-
* <PaceAppLayout
|
|
3130
|
-
* appName="My Custom App"
|
|
3131
|
-
* navItems={customNavItems}
|
|
3132
|
-
* // Permission filtering is always enabled - no prop needed
|
|
3133
|
-
* routePermissions={{
|
|
3134
|
-
* '/components': 'read',
|
|
3135
|
-
* '/styles': 'read',
|
|
3136
|
-
* '/meals': 'read'
|
|
3137
|
-
* }}
|
|
3138
|
-
* // Optionally enable route-level enforcement (separate from navigation filtering)
|
|
3139
|
-
* // enforcePermissions={true}
|
|
3140
|
-
* />
|
|
3141
|
-
* }>
|
|
3142
|
-
* <Route path="components" element={<ComponentsPage />} />
|
|
3143
|
-
* <Route path="styles" element={<StylesPage />} />
|
|
3144
|
-
* <Route path="meals" element={<MealsPage />} />
|
|
3145
|
-
* </Route>
|
|
3146
|
-
* </Routes>
|
|
3147
|
-
* </Router>
|
|
3148
|
-
* );
|
|
3149
|
-
* }
|
|
3150
|
-
* ```
|
|
3151
|
-
*
|
|
3152
|
-
* @example
|
|
3153
|
-
* Route-specific permissions with custom page IDs:
|
|
3154
|
-
* ```tsx
|
|
3155
|
-
* function AdminApp() {
|
|
3156
|
-
* return (
|
|
3157
|
-
* <Router>
|
|
3158
|
-
* <Routes>
|
|
3159
|
-
* <Route path="/" element={
|
|
3160
|
-
* <PaceAppLayout
|
|
3161
|
-
* appName="Admin Panel"
|
|
3162
|
-
* enforcePermissions={true}
|
|
3163
|
-
* routePermissions={{
|
|
3164
|
-
* '/dashboard': 'read',
|
|
3165
|
-
* '/user-management': 'read',
|
|
3166
|
-
* '/system-settings': 'update'
|
|
3167
|
-
* }}
|
|
3168
|
-
* pageIdMapping={{
|
|
3169
|
-
* '/dashboard': 'dashboard',
|
|
3170
|
-
* '/user-management': 'user-management',
|
|
3171
|
-
* '/system-settings': 'system-admin'
|
|
3172
|
-
* }}
|
|
3173
|
-
* permissionFallback={<AccessDeniedPage />}
|
|
3174
|
-
* />
|
|
3175
|
-
* }>
|
|
3176
|
-
* <Route path="dashboard" element={<DashboardPage />} />
|
|
3177
|
-
* <Route path="user-management" element={<UserManagementPage />} />
|
|
3178
|
-
* <Route path="system-settings" element={<SystemSettingsPage />} />
|
|
3179
|
-
* </Route>
|
|
3180
|
-
* </Routes>
|
|
3181
|
-
* </Router>
|
|
3182
|
-
* );
|
|
3183
|
-
* }
|
|
3184
|
-
* ```
|
|
3185
|
-
*
|
|
3186
|
-
* @param props - Layout configuration including app name for branding and permission settings
|
|
3187
|
-
* @returns React element with complete application layout structure and permission enforcement
|
|
3188
|
-
*
|
|
3189
|
-
* @since 0.1.0
|
|
3190
|
-
*/
|
|
3191
|
-
declare function PaceAppLayout({ appName, navItems, showContextSelector, showOrganisations, showEvents, headerActions, customLogo, logoHref, customUserMenu, headerClassName, showUserMenu, enforcePermissions, defaultPermission, routePermissions, permissionFallback, pageIdMapping, strictMode, enforcePagePermissions, pagePermissionFallback, auditLog, onPageAccessDenied, onStrictModeViolation, roleBasedRouting, routeConfig, fallbackRoute, onRouteAccessDenied, onRouteStrictModeViolation }: PaceAppLayoutProps): react_jsx_runtime.JSX.Element;
|
|
3192
|
-
|
|
3193
|
-
/**
|
|
3194
|
-
* @file PACE Login Page Component
|
|
3195
|
-
* @package @jmruthers/pace-core
|
|
3196
|
-
* @module Components/PaceLoginPage
|
|
3197
|
-
* @since 0.1.0
|
|
3198
|
-
*
|
|
3199
|
-
* A comprehensive login page component that provides a consistent authentication
|
|
3200
|
-
* experience for all PACE suite applications with role-based redirection and
|
|
3201
|
-
* enhanced error handling.
|
|
3202
|
-
*
|
|
3203
|
-
* Features:
|
|
3204
|
-
* - Consistent login page layout
|
|
3205
|
-
* - Unified authentication integration
|
|
3206
|
-
* - Role-based automatic redirection (admin users)
|
|
3207
|
-
* - Manual redirection for all successful logins
|
|
3208
|
-
* - Customizable app branding
|
|
3209
|
-
* - Configurable redirect paths
|
|
3210
|
-
* - Enhanced error handling and display
|
|
3211
|
-
* - Dual loading state management (auth + form)
|
|
3212
|
-
* - Navigation error recovery
|
|
3213
|
-
* - Responsive design
|
|
3214
|
-
* - Accessibility compliant
|
|
3215
|
-
* - Integration with LoginForm
|
|
3216
|
-
* - React Router navigation
|
|
3217
|
-
* - Centered layout design
|
|
3218
|
-
* - Error persistence and display
|
|
3219
|
-
*
|
|
3220
|
-
* @example
|
|
3221
|
-
* ```tsx
|
|
3222
|
-
* // Basic login page
|
|
3223
|
-
* <PaceLoginPage appName="My Application" />
|
|
3224
|
-
*
|
|
3225
|
-
* // Login page with custom redirect
|
|
3226
|
-
* <PaceLoginPage
|
|
3227
|
-
* appName="Dashboard App"
|
|
3228
|
-
* onSuccessRedirectPath="/dashboard"
|
|
3229
|
-
* />
|
|
3230
|
-
*
|
|
3231
|
-
* // Login page in router setup
|
|
3232
|
-
* <Router>
|
|
3233
|
-
* <Routes>
|
|
3234
|
-
* <Route path="/login" element={
|
|
3235
|
-
* <PaceLoginPage
|
|
3236
|
-
* appName="My App"
|
|
3237
|
-
* onSuccessRedirectPath="/home"
|
|
3238
|
-
* />
|
|
3239
|
-
* } />
|
|
3240
|
-
* <Route path="/home" element={<HomePage />} />
|
|
3241
|
-
* </Routes>
|
|
3242
|
-
* </Router>
|
|
3243
|
-
*
|
|
3244
|
-
* // Login page with authentication provider
|
|
3245
|
-
* <UnifiedAuthProvider supabaseClient={supabase} appName="My App">
|
|
3246
|
-
* <Router>
|
|
3247
|
-
* <Routes>
|
|
3248
|
-
* <Route path="/login" element={
|
|
3249
|
-
* <PaceLoginPage appName="My Application" />
|
|
3250
|
-
* } />
|
|
3251
|
-
* <Route path="/" element={<PaceAppLayout appName="My Application" />}>
|
|
3252
|
-
* <Route index element={<HomePage />} />
|
|
3253
|
-
* </Route>
|
|
3254
|
-
* </Routes>
|
|
3255
|
-
* </Router>
|
|
3256
|
-
* </UnifiedAuthProvider>
|
|
3257
|
-
*
|
|
3258
|
-
* // Login page with role-based access control
|
|
3259
|
-
* function App() {
|
|
3260
|
-
* return (
|
|
3261
|
-
* <UnifiedAuthProvider supabaseClient={supabase} appName="Admin Portal">
|
|
3262
|
-
* <Router>
|
|
3263
|
-
* <Routes>
|
|
3264
|
-
* <Route path="/login" element={
|
|
3265
|
-
* <PaceLoginPage
|
|
3266
|
-
* appName="Admin Portal"
|
|
3267
|
-
* onSuccessRedirectPath="/admin/dashboard"
|
|
3268
|
-
* />
|
|
3269
|
-
* } />
|
|
3270
|
-
* <Route path="/admin/*" element={<AdminRoutes />} />
|
|
3271
|
-
* </Routes>
|
|
3272
|
-
* </Router>
|
|
3273
|
-
* </UnifiedAuthProvider>
|
|
3274
|
-
* );
|
|
3275
|
-
* }
|
|
3276
|
-
* ```
|
|
3277
|
-
*
|
|
3278
|
-
* @accessibility
|
|
3279
|
-
* - WCAG 2.1 AA compliant
|
|
3280
|
-
* - Proper semantic HTML structure
|
|
3281
|
-
* - Screen reader friendly
|
|
3282
|
-
* - Keyboard navigation support
|
|
3283
|
-
* - Focus management
|
|
3284
|
-
* - High contrast support
|
|
3285
|
-
* - Clear page hierarchy
|
|
3286
|
-
* - Accessible form elements
|
|
3287
|
-
* - Error announcements
|
|
3288
|
-
*
|
|
3289
|
-
* @routing
|
|
3290
|
-
* - React Router v6 integration
|
|
3291
|
-
* - Automatic navigation on success
|
|
3292
|
-
* - Role-based redirect logic (admin users)
|
|
3293
|
-
* - Configurable redirect paths
|
|
3294
|
-
* - Replace navigation for login flow
|
|
3295
|
-
* - Navigation error handling
|
|
3296
|
-
*
|
|
3297
|
-
* @authentication
|
|
3298
|
-
* - Integration with UnifiedAuthProvider
|
|
3299
|
-
* - Role detection via hasRole('admin')
|
|
3300
|
-
* - Loading state management
|
|
3301
|
-
* - Error state handling
|
|
3302
|
-
* - Session validation
|
|
3303
|
-
* - Automatic redirect prevention loops
|
|
3304
|
-
*
|
|
3305
|
-
* @dependencies
|
|
3306
|
-
* - React 19+ - Hooks and effects
|
|
3307
|
-
* - React Router v6 - Navigation
|
|
3308
|
-
* - UnifiedAuthProvider - Authentication
|
|
3309
|
-
* - LoginForm component
|
|
3310
|
-
* - Button component
|
|
3311
|
-
* - Input component
|
|
3312
|
-
* - Label component
|
|
3313
|
-
* - Tailwind CSS - Styling
|
|
3314
|
-
*/
|
|
3315
|
-
|
|
3316
|
-
/**
|
|
3317
|
-
* Props for the PaceLoginPage component.
|
|
3318
|
-
*/
|
|
3319
|
-
interface PaceLoginPageProps {
|
|
3320
|
-
/** The name of the application to be displayed on the login form. */
|
|
3321
|
-
appName: string;
|
|
3322
|
-
/** The path to redirect to upon successful login. Defaults to `/`. */
|
|
3323
|
-
onSuccessRedirectPath?: string;
|
|
3324
|
-
/** Whether to check app access using RBAC. Defaults to false. */
|
|
3325
|
-
requireAppAccess?: boolean;
|
|
3326
|
-
}
|
|
3327
|
-
/**
|
|
3328
|
-
* A consistent, reusable login page for all PACE suite applications.
|
|
3329
|
-
* It handles the sign-in logic with role-based automatic redirection for admin users,
|
|
3330
|
-
* enhanced error handling, and dual loading state management.
|
|
3331
|
-
*
|
|
3332
|
-
* Recent enhancements:
|
|
3333
|
-
* - Role-based redirection: Admin users are automatically redirected
|
|
3334
|
-
* - RBAC-based app access control: Checks if user has permission to access the app
|
|
3335
|
-
* - Enhanced error handling with navigation error recovery
|
|
3336
|
-
* - Dual loading states: auth loading + form submission loading
|
|
3337
|
-
* - Error persistence: Auth errors are displayed below the form
|
|
3338
|
-
* - Navigation safety: Try-catch blocks prevent navigation errors
|
|
3339
|
-
*
|
|
3340
|
-
* @param props - Login page configuration including app name and redirect path
|
|
3341
|
-
* @returns JSX.Element - The rendered login page with enhanced functionality
|
|
3342
|
-
*
|
|
3343
|
-
* @example
|
|
3344
|
-
* ```tsx
|
|
3345
|
-
* <PaceLoginPage
|
|
3346
|
-
* appName="My Application"
|
|
3347
|
-
* onSuccessRedirectPath="/dashboard"
|
|
3348
|
-
* />
|
|
3349
|
-
* ```
|
|
3350
|
-
*/
|
|
3351
|
-
declare const PaceLoginPage: React__default.FC<PaceLoginPageProps>;
|
|
3352
|
-
|
|
3353
|
-
/**
|
|
3354
|
-
* Props for the ProtectedRoute component.
|
|
3355
|
-
*/
|
|
3356
|
-
interface ProtectedRouteProps {
|
|
3357
|
-
/**
|
|
3358
|
-
* Whether an event is required for routes inside this component.
|
|
3359
|
-
* When true, routes will only render if an event is selected or can be selected.
|
|
3360
|
-
* When false, routes render regardless of event state.
|
|
3361
|
-
* @default true
|
|
3362
|
-
*/
|
|
3363
|
-
requireEvent?: boolean;
|
|
3364
|
-
/**
|
|
3365
|
-
* Custom component to render when no events are available.
|
|
3366
|
-
* If not provided, a default message is shown.
|
|
3367
|
-
*/
|
|
3368
|
-
noEventsFallback?: React__default.ReactNode;
|
|
3369
|
-
/**
|
|
3370
|
-
* Custom component to render while events are loading.
|
|
3371
|
-
* If not provided, a default loading spinner is shown.
|
|
3372
|
-
*/
|
|
3373
|
-
loadingFallback?: React__default.ReactNode;
|
|
3374
|
-
/**
|
|
3375
|
-
* Login redirect path when user is not authenticated.
|
|
3376
|
-
* @default '/login'
|
|
3377
|
-
*/
|
|
3378
|
-
loginPath?: string;
|
|
3379
|
-
}
|
|
3380
|
-
/**
|
|
3381
|
-
* ProtectedRoute component that handles authentication and optional event selection.
|
|
3382
|
-
*
|
|
3383
|
-
* This component solves the chicken-and-egg problem where apps check for `selectedEvent`
|
|
3384
|
-
* before rendering, which blocks the event selector (typically in the header) from being visible.
|
|
3385
|
-
*
|
|
3386
|
-
* Strategy:
|
|
3387
|
-
* 1. Check authentication first - redirect to login if not authenticated
|
|
3388
|
-
* 2. Allow rendering during event loading - prevents blocking UI
|
|
3389
|
-
* 3. If events exist but none selected - allow rendering so selector is visible
|
|
3390
|
-
* 4. If no events available - show error message
|
|
3391
|
-
* 5. Individual pages should handle "no selected event" state gracefully
|
|
3392
|
-
*
|
|
3393
|
-
* @param props - Configuration for route protection
|
|
3394
|
-
* @returns React element with route protection logic
|
|
3395
|
-
*/
|
|
3396
|
-
declare function ProtectedRoute({ requireEvent, noEventsFallback, loadingFallback, loginPath }: ProtectedRouteProps): string | number | bigint | true | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element;
|
|
3397
|
-
|
|
3398
|
-
/**
|
|
3399
|
-
* State interface for the ErrorBoundary component
|
|
3400
|
-
* @public
|
|
3401
|
-
*/
|
|
3402
|
-
interface ErrorBoundaryState {
|
|
3403
|
-
/** Whether an error has been caught */
|
|
3404
|
-
hasError: boolean;
|
|
3405
|
-
/** The error that was caught */
|
|
3406
|
-
error?: Error;
|
|
3407
|
-
/** Additional error information from React */
|
|
3408
|
-
errorInfo?: React__default.ErrorInfo;
|
|
3409
|
-
/** Unique identifier for the error */
|
|
3410
|
-
errorId?: string;
|
|
3411
|
-
/** Number of retry attempts made */
|
|
3412
|
-
retryCount: number;
|
|
3413
|
-
}
|
|
3414
|
-
/**
|
|
3415
|
-
* Props interface for the ErrorBoundary component
|
|
3416
|
-
* @public
|
|
3417
|
-
*/
|
|
3418
|
-
interface ErrorBoundaryProps {
|
|
3419
|
-
/** Child components to wrap with error boundary */
|
|
3420
|
-
children: ReactNode;
|
|
3421
|
-
/** Name of the component for error reporting */
|
|
3422
|
-
componentName?: string;
|
|
3423
|
-
/** Custom fallback UI to display when error occurs */
|
|
3424
|
-
fallback?: ReactNode;
|
|
3425
|
-
/** Callback function called when an error is caught */
|
|
3426
|
-
onError?: (error: Error, errorInfo: React__default.ErrorInfo, errorId: string) => void;
|
|
3427
|
-
/** Maximum number of retry attempts */
|
|
3428
|
-
maxRetries?: number;
|
|
3429
|
-
/** Whether to enable retry functionality */
|
|
3430
|
-
enableRetry?: boolean;
|
|
3431
|
-
/** Whether to enable error reporting */
|
|
3432
|
-
enableReporting?: boolean;
|
|
3433
|
-
/** Internal: Global error handler from context (not part of public API) */
|
|
3434
|
-
_globalErrorHandler?: (error: Error, errorInfo: React__default.ErrorInfo, errorId: string, componentName: string) => void;
|
|
3435
|
-
}
|
|
3436
|
-
/**
|
|
3437
|
-
* ErrorBoundary component
|
|
3438
|
-
* Catches JavaScript errors in child components and provides fallback UI
|
|
3439
|
-
*
|
|
3440
|
-
* @example
|
|
3441
|
-
* ```tsx
|
|
3442
|
-
* <ErrorBoundary
|
|
3443
|
-
* componentName="MyComponent"
|
|
3444
|
-
* maxRetries={3}
|
|
3445
|
-
* onError={(error, errorInfo, errorId) => {
|
|
3446
|
-
* console.log('Error caught:', errorId);
|
|
3447
|
-
* }}
|
|
3448
|
-
* >
|
|
3449
|
-
* <MyComponent />
|
|
3450
|
-
* </ErrorBoundary>
|
|
3451
|
-
* ```
|
|
3452
|
-
*/
|
|
3453
|
-
declare class ErrorBoundary$1 extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
3454
|
-
private retryTimeoutId;
|
|
3455
|
-
constructor(props: ErrorBoundaryProps);
|
|
3456
|
-
static getDerivedStateFromError(error: Error): Partial<ErrorBoundaryState>;
|
|
3457
|
-
componentDidCatch(error: Error, errorInfo: React__default.ErrorInfo): void;
|
|
3458
|
-
private reportError;
|
|
3459
|
-
private handleRetry;
|
|
3460
|
-
componentWillUnmount(): void;
|
|
3461
|
-
render(): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
3462
|
-
}
|
|
3463
|
-
|
|
3464
|
-
/**
|
|
3465
|
-
* Type definition for the global error handler function
|
|
3466
|
-
* @public
|
|
3467
|
-
*/
|
|
3468
|
-
type GlobalErrorHandler = (error: Error, errorInfo: React__default.ErrorInfo, errorId: string, componentName: string) => void;
|
|
3469
|
-
/**
|
|
3470
|
-
* Props for ErrorBoundaryProvider component
|
|
3471
|
-
* @public
|
|
3472
|
-
*/
|
|
3473
|
-
interface ErrorBoundaryProviderProps {
|
|
3474
|
-
/** Children to wrap with the provider */
|
|
3475
|
-
children: ReactNode;
|
|
3476
|
-
/** Global error handler that will be used by all ErrorBoundary instances unless overridden */
|
|
3477
|
-
defaultErrorHandler?: GlobalErrorHandler;
|
|
3478
|
-
}
|
|
3479
|
-
/**
|
|
3480
|
-
* Provider component for ErrorBoundary global error handler configuration
|
|
3481
|
-
*
|
|
3482
|
-
* Wrap your application with this provider to set a default error handler that will
|
|
3483
|
-
* be used by all ErrorBoundary instances unless they provide their own onError prop.
|
|
3484
|
-
*
|
|
3485
|
-
* @example
|
|
3486
|
-
* ```tsx
|
|
3487
|
-
* <ErrorBoundaryProvider
|
|
3488
|
-
* defaultErrorHandler={(error, errorInfo, errorId, componentName) => {
|
|
3489
|
-
* errorTracking.captureException(error, {
|
|
3490
|
-
* componentStack: errorInfo.componentStack,
|
|
3491
|
-
* errorBoundary: true,
|
|
3492
|
-
* errorId,
|
|
3493
|
-
* componentName,
|
|
3494
|
-
* });
|
|
3495
|
-
* }}
|
|
3496
|
-
* >
|
|
3497
|
-
* <App />
|
|
3498
|
-
* </ErrorBoundaryProvider>
|
|
3499
|
-
* ```
|
|
3500
|
-
*
|
|
3501
|
-
* @public
|
|
3502
|
-
*/
|
|
3503
|
-
/**
|
|
3504
|
-
* Error boundary provider component.
|
|
3505
|
-
* Provides global error handling configuration to child ErrorBoundary components.
|
|
3506
|
-
*
|
|
3507
|
-
* @param props - Error boundary provider configuration
|
|
3508
|
-
* @returns The error boundary provider
|
|
3509
|
-
*/
|
|
3510
|
-
declare function ErrorBoundaryProvider({ children, defaultErrorHandler, }: ErrorBoundaryProviderProps): react_jsx_runtime.JSX.Element;
|
|
3511
|
-
|
|
3512
|
-
/**
|
|
3513
|
-
* @file Error Boundary exports
|
|
3514
|
-
*/
|
|
3515
|
-
|
|
3516
|
-
/**
|
|
3517
|
-
* ErrorBoundary component with automatic context support
|
|
3518
|
-
* This wrapper automatically uses the global error handler from ErrorBoundaryProvider
|
|
3519
|
-
* if no onError prop is provided.
|
|
3520
|
-
*/
|
|
3521
|
-
declare const ErrorBoundary: React__default.ForwardRefExoticComponent<Omit<ErrorBoundaryProps, "_globalErrorHandler"> & React__default.RefAttributes<ErrorBoundary$1>>;
|
|
3522
|
-
|
|
3523
|
-
/**
|
|
3524
|
-
* @file LoadingSpinner Component
|
|
3525
|
-
* @package @jmruthers/pace-core
|
|
3526
|
-
* @module Components/LoadingSpinner
|
|
3527
|
-
* @since 0.1.0
|
|
3528
|
-
*
|
|
3529
|
-
* A simple, accessible loading spinner component for indicating loading states.
|
|
3530
|
-
* Provides smooth animations with reduced motion support for accessibility.
|
|
3531
|
-
*
|
|
3532
|
-
* Features:
|
|
3533
|
-
* - Multiple size variants (sm, md, lg)
|
|
3534
|
-
* - Smooth CSS animations
|
|
3535
|
-
* - Reduced motion support for accessibility
|
|
3536
|
-
* - Screen reader friendly with proper ARIA attributes
|
|
3537
|
-
* - Customizable styling
|
|
3538
|
-
* - Lightweight and performant
|
|
3539
|
-
*
|
|
3540
|
-
* @example
|
|
3541
|
-
* ```tsx
|
|
3542
|
-
* // Basic loading spinner
|
|
3543
|
-
* <LoadingSpinner />
|
|
3544
|
-
*
|
|
3545
|
-
* // Different sizes
|
|
3546
|
-
* <LoadingSpinner size="sm" />
|
|
3547
|
-
* <LoadingSpinner size="md" />
|
|
3548
|
-
* <LoadingSpinner size="lg" />
|
|
3549
|
-
*
|
|
3550
|
-
* // With custom styling
|
|
3551
|
-
* <LoadingSpinner
|
|
3552
|
-
* size="lg"
|
|
3553
|
-
* className="text-main-500"
|
|
3554
|
-
* />
|
|
3555
|
-
*
|
|
3556
|
-
* // In a button
|
|
3557
|
-
* <Button disabled>
|
|
3558
|
-
* <LoadingSpinner size="sm" className="mr-2" />
|
|
3559
|
-
* Loading...
|
|
3560
|
-
* </Button>
|
|
3561
|
-
* ```
|
|
3562
|
-
*
|
|
3563
|
-
* @accessibility
|
|
3564
|
-
* - WCAG 2.1 AA compliant
|
|
3565
|
-
* - Proper ARIA role="status"
|
|
3566
|
-
* - Screen reader announcement with "Loading..." text
|
|
3567
|
-
* - Reduced motion support for users with vestibular disorders
|
|
3568
|
-
* - High contrast support
|
|
3569
|
-
*
|
|
3570
|
-
* @performance
|
|
3571
|
-
* - CSS-only animations for optimal performance
|
|
3572
|
-
* - No JavaScript dependencies
|
|
3573
|
-
* - Minimal DOM structure
|
|
3574
|
-
* - Efficient rendering
|
|
3575
|
-
*
|
|
3576
|
-
* @dependencies
|
|
3577
|
-
* - React 19+ - Component framework
|
|
3578
|
-
* - Tailwind CSS - Styling and animations
|
|
3579
|
-
*/
|
|
3580
|
-
|
|
3581
|
-
/**
|
|
3582
|
-
* Props for the LoadingSpinner component
|
|
3583
|
-
*/
|
|
3584
|
-
interface LoadingSpinnerProps {
|
|
3585
|
-
/** Size variant of the spinner */
|
|
3586
|
-
size?: 'sm' | 'md' | 'lg';
|
|
3587
|
-
/** Additional CSS classes for styling */
|
|
3588
|
-
className?: string;
|
|
3589
|
-
}
|
|
3590
|
-
/**
|
|
3591
|
-
* LoadingSpinner component
|
|
3592
|
-
* A simple, accessible loading spinner for indicating loading states
|
|
3593
|
-
*
|
|
3594
|
-
* @param props - Spinner configuration and styling
|
|
3595
|
-
* @returns JSX.Element - The rendered loading spinner
|
|
3596
|
-
*
|
|
3597
|
-
* @example
|
|
3598
|
-
* ```tsx
|
|
3599
|
-
* <LoadingSpinner size="lg" className="text-main-500" />
|
|
3600
|
-
* ```
|
|
3601
|
-
*/
|
|
3602
|
-
declare const LoadingSpinner: React__default.FC<LoadingSpinnerProps>;
|
|
3603
|
-
|
|
3604
|
-
/**
|
|
3605
|
-
* @file SessionRestorationLoader Component
|
|
3606
|
-
* @package @jmruthers/pace-core
|
|
3607
|
-
* @module Components/SessionRestorationLoader
|
|
3608
|
-
* @since 0.1.0
|
|
3609
|
-
*
|
|
3610
|
-
* Displays a consistent loading state while the authentication service
|
|
3611
|
-
* restores the Supabase session from persistent storage.
|
|
3612
|
-
*
|
|
3613
|
-
* Features:
|
|
3614
|
-
* - Full-screen loading state
|
|
3615
|
-
* - Accessible with proper ARIA attributes
|
|
3616
|
-
* - Screen reader friendly
|
|
3617
|
-
* - Customizable message
|
|
3618
|
-
* - Uses LoadingSpinner component
|
|
3619
|
-
*
|
|
3620
|
-
* @example
|
|
3621
|
-
* ```tsx
|
|
3622
|
-
* // Basic usage
|
|
3623
|
-
* <SessionRestorationLoader />
|
|
3624
|
-
*
|
|
3625
|
-
* // With custom message
|
|
3626
|
-
* <SessionRestorationLoader message="Restoring your session..." />
|
|
3627
|
-
* ```
|
|
3628
|
-
*
|
|
3629
|
-
* @accessibility
|
|
3630
|
-
* - WCAG 2.1 AA compliant
|
|
3631
|
-
* - Proper ARIA role="status"
|
|
3632
|
-
* - Screen reader announcement
|
|
3633
|
-
* - High contrast support
|
|
3634
|
-
*
|
|
3635
|
-
* @dependencies
|
|
3636
|
-
* - React 19+ - Component framework
|
|
3637
|
-
* - LoadingSpinner - Spinner component
|
|
3638
|
-
* - Tailwind CSS - Styling
|
|
3639
|
-
*/
|
|
3640
|
-
|
|
3641
|
-
interface SessionRestorationLoaderProps {
|
|
3642
|
-
/** Customise the status message displayed under the spinner */
|
|
3643
|
-
message?: string;
|
|
3644
|
-
/** Additional CSS classes for styling */
|
|
3645
|
-
className?: string;
|
|
3646
|
-
}
|
|
3647
|
-
declare const SessionRestorationLoader: React__default.FC<SessionRestorationLoaderProps>;
|
|
3648
|
-
|
|
3649
|
-
/**
|
|
3650
|
-
* Props for the ContextSelector component.
|
|
3651
|
-
*/
|
|
3652
|
-
interface ContextSelectorProps {
|
|
3653
|
-
/** Placeholder text for the dropdown */
|
|
3654
|
-
placeholder?: string;
|
|
3655
|
-
/** Additional CSS classes */
|
|
3656
|
-
className?: string;
|
|
3657
|
-
/** Callback fired when an organisation is selected */
|
|
3658
|
-
onOrganisationSelect?: (org: Organisation) => void;
|
|
3659
|
-
/** Callback fired when an event is selected */
|
|
3660
|
-
onEventSelect?: (event: Event) => void;
|
|
3661
|
-
/** Show friendly message when no items available */
|
|
3662
|
-
showNoItemsMessage?: boolean;
|
|
3663
|
-
/** Show retry button on errors */
|
|
3664
|
-
showRetryButton?: boolean;
|
|
3665
|
-
/** Compact display mode */
|
|
3666
|
-
compact?: boolean;
|
|
3667
|
-
/** Disabled state */
|
|
3668
|
-
disabled?: boolean;
|
|
3669
|
-
/** Show organisations section (default: true) */
|
|
3670
|
-
showOrganisations?: boolean;
|
|
3671
|
-
/** Show events section (default: true) */
|
|
3672
|
-
showEvents?: boolean;
|
|
3673
|
-
}
|
|
3674
|
-
/**
|
|
3675
|
-
* ContextSelector component for selecting organisations or events
|
|
3676
|
-
*
|
|
3677
|
-
* This is the unified intelligent selector that shows all organisations and events
|
|
3678
|
-
* a user can access. It automatically determines what to show based on the user's
|
|
3679
|
-
* roles and permissions - no need to configure separate org/event selectors.
|
|
3680
|
-
*
|
|
3681
|
-
* The selector intelligently shows:
|
|
3682
|
-
* - All organisations the user has access to (via organisation roles)
|
|
3683
|
-
* - All events the user has access to (via event-app roles or organisation membership)
|
|
3684
|
-
* - Everything for super admins
|
|
3685
|
-
*
|
|
3686
|
-
* @component
|
|
3687
|
-
* @example
|
|
3688
|
-
* <ContextSelector
|
|
3689
|
-
* onOrganisationSelect={(org) => switchOrganisation(org)}
|
|
3690
|
-
* onEventSelect={(event) => setSelectedEvent(event)}
|
|
3691
|
-
* />
|
|
3692
|
-
*/
|
|
3693
|
-
declare function ContextSelector({ placeholder, className, onOrganisationSelect, onEventSelect, showNoItemsMessage, showRetryButton, compact, disabled, showOrganisations, showEvents }: ContextSelectorProps): react_jsx_runtime.JSX.Element | null;
|
|
3694
|
-
|
|
3695
|
-
/**
|
|
3696
|
-
* Props for the FileUpload component.
|
|
3697
|
-
* Configures file upload behavior including storage location, validation, and callbacks.
|
|
3698
|
-
*/
|
|
3699
|
-
interface FileUploadProps {
|
|
3700
|
-
supabase: SupabaseClient;
|
|
3701
|
-
table_name: string;
|
|
3702
|
-
record_id: string;
|
|
3703
|
-
organisation_id?: string | null;
|
|
3704
|
-
userId?: string;
|
|
3705
|
-
app_id?: string;
|
|
3706
|
-
category: FileCategory;
|
|
3707
|
-
folder: string;
|
|
3708
|
-
pageContext: string;
|
|
3709
|
-
event_id?: string;
|
|
3710
|
-
accept?: string;
|
|
3711
|
-
maxSize?: number;
|
|
3712
|
-
multiple?: boolean;
|
|
3713
|
-
disabled?: boolean;
|
|
3714
|
-
isPublic?: boolean;
|
|
3715
|
-
className?: string;
|
|
3716
|
-
showPreview?: boolean;
|
|
3717
|
-
showProgress?: boolean;
|
|
3718
|
-
onUploadSuccess?: (result: FileUploadResult) => void;
|
|
3719
|
-
onUploadError?: (error: string, file?: File) => void;
|
|
3720
|
-
onProgress?: (progress: UploadProgress) => void;
|
|
3721
|
-
children?: React__default.ReactNode;
|
|
3722
|
-
}
|
|
3723
|
-
declare function FileUpload({ supabase, table_name, record_id, organisation_id, userId, app_id, category, folder, pageContext, event_id, accept, maxSize, // 10MB default
|
|
3724
|
-
multiple, disabled, isPublic, className, showPreview, showProgress, onUploadSuccess, onUploadError, onProgress, children }: FileUploadProps): react_jsx_runtime.JSX.Element;
|
|
3725
|
-
|
|
3726
|
-
interface FileDisplayProps {
|
|
3727
|
-
table_name: string;
|
|
3728
|
-
record_id: string;
|
|
3729
|
-
/**
|
|
3730
|
-
* Optional organisation ID. When not provided (undefined), the component will automatically
|
|
3731
|
-
* search for files in both user-scoped (organisation_id = null) and organisation-scoped contexts.
|
|
3732
|
-
* If both types of files exist, organisation-scoped files are preferred.
|
|
3733
|
-
* When explicitly set to null, only user-scoped files are searched.
|
|
3734
|
-
*/
|
|
3735
|
-
organisation_id?: string;
|
|
3736
|
-
category?: FileCategory;
|
|
3737
|
-
/** Display only a single file instead of all files. Uses first file (prefers images) from all files, without category filtering */
|
|
3738
|
-
displayOnly?: boolean;
|
|
3739
|
-
showDelete?: boolean;
|
|
3740
|
-
className?: string;
|
|
3741
|
-
/** Classes to apply to the first child element of <figure> (img, p, or other elements) */
|
|
3742
|
-
imgClassName?: string;
|
|
3743
|
-
children?: React__default.ReactNode;
|
|
3744
|
-
/** Custom loading component to render during data fetching */
|
|
3745
|
-
loadingComponent?: React__default.ComponentType;
|
|
3746
|
-
/** Custom error component to render when an error occurs */
|
|
3747
|
-
errorComponent?: React__default.ComponentType<{
|
|
3748
|
-
error: Error | string | null;
|
|
3749
|
-
retry?: () => void;
|
|
3750
|
-
}>;
|
|
3751
|
-
/** Whether to show fallback UI when no file is available or image fails to load */
|
|
3752
|
-
showFallback?: boolean;
|
|
3753
|
-
/** Custom function to generate fallback text from file name or other context */
|
|
3754
|
-
generateFallbackText?: (fileName?: string) => string;
|
|
3755
|
-
/** Explicit fallback text to display (overrides generateFallbackText) */
|
|
3756
|
-
fallbackText?: string;
|
|
3757
|
-
/** Source text to use for generating fallback text (overrides filename) */
|
|
3758
|
-
fallbackSourceText?: string;
|
|
3759
|
-
/** Size variant for fallback display (only applies when showFallback is true) */
|
|
3760
|
-
fallbackSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
3761
|
-
/**
|
|
3762
|
-
* Enable children rendering in displayOnly mode. When true, uses standard display path
|
|
3763
|
-
* (with children support) even if showDelete is false. The delete button will only appear
|
|
3764
|
-
* if showDelete is also true.
|
|
3765
|
-
*/
|
|
3766
|
-
enableChildren?: boolean;
|
|
3767
|
-
/** Whether to show metadata (filename, filesize, mimetype) in figcaption. Defaults to true. */
|
|
3768
|
-
showMetadata?: boolean;
|
|
3769
|
-
}
|
|
3770
|
-
/**
|
|
3771
|
-
* Component for displaying file references with context-awareness
|
|
3772
|
-
*
|
|
3773
|
-
* This component is context-aware and automatically detects whether it's being used
|
|
3774
|
-
* in a public or authenticated context. It fetches and displays files from storage.
|
|
3775
|
-
*
|
|
3776
|
-
* The component automatically detects context and uses:
|
|
3777
|
-
* - PublicPageProvider context for public pages
|
|
3778
|
-
* - UnifiedAuthProvider context for authenticated pages
|
|
3779
|
-
*
|
|
3780
|
-
* @param props - File display configuration
|
|
3781
|
-
* @param props.displayOnly - Display only a single file instead of all files. Uses first file (prefers images) from all files, without category filtering. When true:
|
|
3782
|
-
* - **Image files**: Renders a simplified image-only display without metadata or wrapper divs
|
|
3783
|
-
* - **Non-image files** (PDFs, Word docs, Excel files, etc.): Renders as clickable links that open in a new tab with document icon, filename, and external link icon. Links include proper security attributes (`rel="noopener noreferrer"`) and accessibility features (ARIA labels, keyboard navigation, visible focus states)
|
|
3784
|
-
* - If `showDelete={true}`, uses standard wrapper behavior instead of simplified display
|
|
3785
|
-
* @param props.category - Optional category filter. When specified, only displays files matching this category and uses single file display variant.
|
|
3786
|
-
* @returns React element with file display
|
|
3787
|
-
*/
|
|
3788
|
-
/**
|
|
3789
|
-
* File display component.
|
|
3790
|
-
* Renders files from the file reference system with support for previews, downloads, and public/private access.
|
|
3791
|
-
*
|
|
3792
|
-
* @param props - File display configuration
|
|
3793
|
-
* @returns The rendered file display
|
|
3794
|
-
*/
|
|
3795
|
-
declare function FileDisplay({ table_name, record_id, organisation_id, category, displayOnly, showDelete, className, imgClassName, children, loadingComponent, errorComponent, showFallback, generateFallbackText, fallbackText, fallbackSourceText, fallbackSize, enableChildren, showMetadata }: FileDisplayProps): react_jsx_runtime.JSX.Element;
|
|
3796
|
-
|
|
3797
|
-
/**
|
|
3798
|
-
* Hook for managing file references.
|
|
3799
|
-
* Provides file upload, retrieval, and URL generation functionality.
|
|
3800
|
-
*
|
|
3801
|
-
* @param supabase - Supabase client instance
|
|
3802
|
-
* @returns File reference service with upload, get, and URL methods
|
|
3803
|
-
*/
|
|
3804
|
-
declare function useFileReference(supabase: SupabaseClient): {
|
|
3805
|
-
isLoading: boolean;
|
|
3806
|
-
error: string | null;
|
|
3807
|
-
uploadFile: (options: FileUploadOptions, file: File) => Promise<FileUploadResult | null>;
|
|
3808
|
-
getFileReference: (table_name: string, record_id: string, organisation_id: string) => Promise<FileReference | null>;
|
|
3809
|
-
getFileReferenceById: (id: string, organisation_id: string) => Promise<FileReference | null>;
|
|
3810
|
-
getFileUrl: (table_name: string, record_id: string, organisation_id: string) => Promise<string | null>;
|
|
3811
|
-
getSignedUrl: (table_name: string, record_id: string, organisation_id: string, expires_in?: number) => Promise<string | null>;
|
|
3812
|
-
updateFileReference: (id: string, updates: Partial<FileReference>) => Promise<FileReference | null>;
|
|
3813
|
-
deleteFileReference: (table_name: string, record_id: string, organisation_id: string, delete_file?: boolean) => Promise<boolean>;
|
|
3814
|
-
listFileReferences: (table_name: string, record_id: string, organisation_id: string) => Promise<FileReference[]>;
|
|
3815
|
-
getFilesByCategory: (table_name: string, record_id: string, category: FileCategory, organisation_id: string) => Promise<FileReference[]>;
|
|
3816
|
-
getFileCount: (table_name: string, record_id: string, organisation_id: string) => Promise<number>;
|
|
3817
|
-
clearError: () => void;
|
|
3818
|
-
};
|
|
3819
|
-
declare function useFileReferenceForRecord(supabase: SupabaseClient, table_name: string, record_id: string, organisation_id: string): {
|
|
3820
|
-
isLoading: boolean;
|
|
3821
|
-
error: string | null;
|
|
3822
|
-
fileUrl: string | null;
|
|
3823
|
-
fileReference: FileReference | null;
|
|
3824
|
-
fileReferences: FileReference[];
|
|
3825
|
-
fileCount: number;
|
|
3826
|
-
loadFileReference: () => Promise<FileReference | null>;
|
|
3827
|
-
loadFileUrl: () => Promise<string | null>;
|
|
3828
|
-
loadFileReferences: () => Promise<FileReference[]>;
|
|
3829
|
-
loadFileCount: () => Promise<number>;
|
|
3830
|
-
deleteFile: (delete_file?: boolean) => Promise<boolean>;
|
|
3831
|
-
updateFileReference: (id: string, updates: Partial<FileReference>) => Promise<FileReference | null>;
|
|
3832
|
-
clearError: () => void;
|
|
3833
|
-
};
|
|
3834
|
-
/**
|
|
3835
|
-
* Hook for getting a file reference by ID
|
|
3836
|
-
*/
|
|
3837
|
-
declare function useFileReferenceById(supabase: SupabaseClient, fileReferenceId: string | null, organisationId: string | null): {
|
|
3838
|
-
isLoading: boolean;
|
|
3839
|
-
error: string | null;
|
|
3840
|
-
fileReference: FileReference | null;
|
|
3841
|
-
fileUrl: string | null;
|
|
3842
|
-
loadFileReference: () => Promise<FileReference | null>;
|
|
3843
|
-
clearError: () => void;
|
|
3844
|
-
};
|
|
3845
|
-
/**
|
|
3846
|
-
* Convenience hook for getting files by category with automatic URL loading.
|
|
3847
|
-
*
|
|
3848
|
-
* This hook wraps useFileReference().getFilesByCategory and automatically:
|
|
3849
|
-
* - Loads file references filtered by category
|
|
3850
|
-
* - Generates URLs for all files (public URLs for public files, signed URLs for private files)
|
|
3851
|
-
* - Manages state for fileReferences and fileUrls
|
|
3852
|
-
* - Auto-refetches when table_name, record_id, category, or organisation_id changes
|
|
3853
|
-
*
|
|
3854
|
-
* Use this hook when you need files by category with their URLs ready to display.
|
|
3855
|
-
* For more control, use useFileReference() directly and manage URLs yourself.
|
|
3856
|
-
*/
|
|
3857
|
-
declare function useFilesByCategory(supabase: SupabaseClient, table_name: string, record_id: string, category: FileCategory | null, organisation_id: string | null): {
|
|
3858
|
-
isLoading: boolean;
|
|
3859
|
-
error: string | null;
|
|
3860
|
-
fileReferences: FileReference[];
|
|
3861
|
-
fileUrls: Map<string, string>;
|
|
3862
|
-
loadFiles: () => Promise<FileReference[]>;
|
|
3863
|
-
clearError: () => void;
|
|
3864
|
-
};
|
|
3865
|
-
type UseFileReferenceOptions = {
|
|
3866
|
-
table_name: string;
|
|
3867
|
-
record_id: string;
|
|
3868
|
-
organisation_id: string;
|
|
3869
|
-
};
|
|
3870
|
-
/**
|
|
3871
|
-
* Return value of the useFileReference hook.
|
|
3872
|
-
*/
|
|
3873
|
-
type UseFileReferenceReturn = {
|
|
3874
|
-
isLoading: boolean;
|
|
3875
|
-
error: string | null;
|
|
3876
|
-
uploadFile: (options: FileUploadOptions, file: File) => Promise<FileUploadResult | null>;
|
|
3877
|
-
getFileReference: (table_name: string, record_id: string, organisation_id: string) => Promise<FileReference | null>;
|
|
3878
|
-
getFileUrl: (table_name: string, record_id: string, organisation_id: string) => Promise<string | null>;
|
|
3879
|
-
getSignedUrl: (table_name: string, record_id: string, organisation_id: string, expires_in?: number) => Promise<string | null>;
|
|
3880
|
-
updateFileReference: (id: string, updates: Partial<FileReference>) => Promise<FileReference | null>;
|
|
3881
|
-
deleteFileReference: (table_name: string, record_id: string, organisation_id: string, delete_file?: boolean) => Promise<boolean>;
|
|
3882
|
-
listFileReferences: (table_name: string, record_id: string, organisation_id: string) => Promise<FileReference[]>;
|
|
3883
|
-
getFileCount: (table_name: string, record_id: string, organisation_id: string) => Promise<number>;
|
|
3884
|
-
clearError: () => void;
|
|
3885
|
-
};
|
|
3886
|
-
/**
|
|
3887
|
-
* Return value of the useFileReferenceForRecord hook.
|
|
3888
|
-
*/
|
|
3889
|
-
type UseFileReferenceForRecordReturn = {
|
|
3890
|
-
isLoading: boolean;
|
|
3891
|
-
error: string | null;
|
|
3892
|
-
fileUrl: string | null;
|
|
3893
|
-
fileReference: FileReference | null;
|
|
3894
|
-
fileReferences: FileReference[];
|
|
3895
|
-
fileCount: number;
|
|
3896
|
-
loadFileReference: () => Promise<FileReference | null>;
|
|
3897
|
-
loadFileUrl: () => Promise<string | null>;
|
|
3898
|
-
loadFileReferences: () => Promise<FileReference[]>;
|
|
3899
|
-
loadFileCount: () => Promise<number>;
|
|
3900
|
-
deleteFile: (delete_file?: boolean) => Promise<boolean>;
|
|
3901
|
-
updateFileReference: (id: string, updates: Partial<FileReference>) => Promise<FileReference | null>;
|
|
3902
|
-
clearError: () => void;
|
|
3903
|
-
};
|
|
3904
|
-
|
|
3905
|
-
/**
|
|
3906
|
-
* @file Table Component System
|
|
3907
|
-
* @package @jmruthers/pace-core
|
|
3908
|
-
* @module Components/Table
|
|
3909
|
-
* @since 0.1.0
|
|
3910
|
-
*
|
|
3911
|
-
* A comprehensive table component system for displaying tabular data.
|
|
3912
|
-
* Provides accessible table components with consistent styling and behavior.
|
|
3913
|
-
*
|
|
3914
|
-
* Features:
|
|
3915
|
-
* - Semantic HTML table structure
|
|
3916
|
-
* - Consistent styling and spacing
|
|
3917
|
-
* - Hover states and transitions
|
|
3918
|
-
* - Responsive design
|
|
3919
|
-
* - Accessibility compliant
|
|
3920
|
-
* - Customizable styling
|
|
3921
|
-
* - Checkbox support
|
|
3922
|
-
* - Caption support
|
|
3923
|
-
*
|
|
3924
|
-
* @example
|
|
3925
|
-
* ```tsx
|
|
3926
|
-
* // Basic table
|
|
3927
|
-
* <Table>
|
|
3928
|
-
* <TableCaption>A list of your recent invoices.</TableCaption>
|
|
3929
|
-
* <TableHeader>
|
|
3930
|
-
* <TableRow>
|
|
3931
|
-
* <TableHead>Invoice</TableHead>
|
|
3932
|
-
* <TableHead>Status</TableHead>
|
|
3933
|
-
* <TableHead>Method</TableHead>
|
|
3934
|
-
* <TableHead>Amount</TableHead>
|
|
3935
|
-
* </TableRow>
|
|
3936
|
-
* </TableHeader>
|
|
3937
|
-
* <TableBody>
|
|
3938
|
-
* <TableRow>
|
|
3939
|
-
* <TableCell>INV001</TableCell>
|
|
3940
|
-
* <TableCell>Paid</TableCell>
|
|
3941
|
-
* <TableCell>Credit Card</TableCell>
|
|
3942
|
-
* <TableCell>$250.00</TableCell>
|
|
3943
|
-
* </TableRow>
|
|
3944
|
-
* <TableRow>
|
|
3945
|
-
* <TableCell>INV002</TableCell>
|
|
3946
|
-
* <TableCell>Pending</TableCell>
|
|
3947
|
-
* <TableCell>PayPal</TableCell>
|
|
3948
|
-
* <TableCell>$150.00</TableCell>
|
|
3949
|
-
* </TableRow>
|
|
3950
|
-
* </TableBody>
|
|
3951
|
-
* <TableFooter>
|
|
3952
|
-
* <TableRow>
|
|
3953
|
-
* <TableCell colSpan={3}>Total</TableCell>
|
|
3954
|
-
* <TableCell>$400.00</TableCell>
|
|
3955
|
-
* </TableRow>
|
|
3956
|
-
* </TableFooter>
|
|
3957
|
-
* </Table>
|
|
3958
|
-
*
|
|
3959
|
-
* // Table with checkboxes
|
|
3960
|
-
* <Table>
|
|
3961
|
-
* <TableHeader>
|
|
3962
|
-
* <TableRow>
|
|
3963
|
-
* <TableHead className="w-12">
|
|
3964
|
-
* <Checkbox />
|
|
3965
|
-
* </TableHead>
|
|
3966
|
-
* <TableHead>Name</TableHead>
|
|
3967
|
-
* <TableHead>Email</TableHead>
|
|
3968
|
-
* </TableRow>
|
|
3969
|
-
* </TableHeader>
|
|
3970
|
-
* <TableBody>
|
|
3971
|
-
* <TableRow>
|
|
3972
|
-
* <TableCell>
|
|
3973
|
-
* <Checkbox />
|
|
3974
|
-
* </TableCell>
|
|
3975
|
-
* <TableCell>John Doe</TableCell>
|
|
3976
|
-
* <TableCell>john@example.com</TableCell>
|
|
3977
|
-
* </TableRow>
|
|
3978
|
-
* </TableBody>
|
|
3979
|
-
* </Table>
|
|
3980
|
-
* ```
|
|
3981
|
-
*
|
|
3982
|
-
* @accessibility
|
|
3983
|
-
* - WCAG 2.1 AA compliant
|
|
3984
|
-
* - Proper table semantics
|
|
3985
|
-
* - Screen reader support
|
|
3986
|
-
* - Keyboard navigation
|
|
3987
|
-
* - Focus management
|
|
3988
|
-
* - High contrast support
|
|
3989
|
-
* - Caption for table description
|
|
3990
|
-
*
|
|
3991
|
-
* @dependencies
|
|
3992
|
-
* - React 19+ - Hooks and refs
|
|
3993
|
-
* - Tailwind CSS - Styling
|
|
3994
|
-
*/
|
|
3995
|
-
|
|
3996
|
-
/**
|
|
3997
|
-
* Table component
|
|
3998
|
-
* The main table container with semantic HTML structure
|
|
3999
|
-
*
|
|
4000
|
-
* @param props - Table configuration and styling
|
|
4001
|
-
* @param ref - Forwarded ref to the table element
|
|
4002
|
-
* @returns JSX.Element - The rendered table element
|
|
4003
|
-
*
|
|
4004
|
-
* @example
|
|
4005
|
-
* ```tsx
|
|
4006
|
-
* <Table>
|
|
4007
|
-
* <TableHeader>...</TableHeader>
|
|
4008
|
-
* <TableBody>...</TableBody>
|
|
4009
|
-
* </Table>
|
|
4010
|
-
* ```
|
|
4011
|
-
*/
|
|
4012
|
-
declare const Table: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableElement> & React$1.RefAttributes<HTMLTableElement>>;
|
|
4013
|
-
declare const TableHeader: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableSectionElement> & React$1.RefAttributes<HTMLTableSectionElement>>;
|
|
4014
|
-
declare const TableBody: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableSectionElement> & React$1.RefAttributes<HTMLTableSectionElement>>;
|
|
4015
|
-
declare const TableFooter: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableSectionElement> & React$1.RefAttributes<HTMLTableSectionElement>>;
|
|
4016
|
-
declare const TableRow: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableRowElement> & React$1.RefAttributes<HTMLTableRowElement>>;
|
|
4017
|
-
declare const TableHead: React$1.ForwardRefExoticComponent<React$1.ThHTMLAttributes<HTMLTableCellElement> & React$1.RefAttributes<HTMLTableCellElement>>;
|
|
4018
|
-
declare const TableCell: React$1.ForwardRefExoticComponent<React$1.TdHTMLAttributes<HTMLTableCellElement> & React$1.RefAttributes<HTMLTableCellElement>>;
|
|
4019
|
-
declare const TableCaption: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableCaptionElement> & React$1.RefAttributes<HTMLTableCaptionElement>>;
|
|
4020
|
-
|
|
4021
|
-
interface PublicPageLayoutProps {
|
|
4022
|
-
/** The event code for this public page */
|
|
4023
|
-
eventCode: string;
|
|
4024
|
-
/** Child components to render */
|
|
4025
|
-
children: ReactNode;
|
|
4026
|
-
/** Optional event data - if not provided, will be fetched by parent component */
|
|
4027
|
-
event?: Event | null;
|
|
4028
|
-
/** Loading state - if true, shows loading spinner */
|
|
4029
|
-
isLoading?: boolean;
|
|
4030
|
-
/** Error state - if provided, shows error message */
|
|
4031
|
-
error?: Error | null;
|
|
4032
|
-
/** Function to retry loading event data */
|
|
4033
|
-
refetch?: () => Promise<void> | void;
|
|
4034
|
-
/** Whether to show the footer (default: true) */
|
|
4035
|
-
showFooter?: boolean;
|
|
4036
|
-
/** Custom error fallback component */
|
|
4037
|
-
errorFallback?: React__default.ComponentType<{
|
|
4038
|
-
error: Error;
|
|
4039
|
-
retry: () => void;
|
|
4040
|
-
}>;
|
|
4041
|
-
/** Custom loading fallback component */
|
|
4042
|
-
loadingFallback?: React__default.ComponentType;
|
|
4043
|
-
/** Custom header component */
|
|
4044
|
-
customHeader?: ReactNode;
|
|
4045
|
-
/** Custom footer component */
|
|
4046
|
-
customFooter?: ReactNode;
|
|
4047
|
-
/** Whether to show event validation errors (default: true) */
|
|
4048
|
-
showValidationErrors?: boolean;
|
|
4049
|
-
/** Custom loading message */
|
|
4050
|
-
loadingMessage?: string;
|
|
4051
|
-
}
|
|
4052
|
-
interface PublicPageHeaderProps {
|
|
4053
|
-
/** The event data for this public page */
|
|
4054
|
-
event?: Event;
|
|
4055
|
-
/** The event code for this public page */
|
|
4056
|
-
eventCode: string;
|
|
4057
|
-
/** Optional page title */
|
|
4058
|
-
title?: string;
|
|
4059
|
-
/** Optional page description */
|
|
4060
|
-
description?: string;
|
|
4061
|
-
/** Whether to show the event logo (default: true) */
|
|
4062
|
-
showEventLogo?: boolean;
|
|
4063
|
-
/** Whether to show the app logo (default: true) */
|
|
4064
|
-
showAppLogo?: boolean;
|
|
4065
|
-
/** Custom CSS classes for the header */
|
|
4066
|
-
className?: string;
|
|
4067
|
-
/** Custom content to display in the header */
|
|
4068
|
-
children?: ReactNode;
|
|
4069
|
-
/** Custom event logo component */
|
|
4070
|
-
customEventLogo?: ReactNode;
|
|
4071
|
-
}
|
|
4072
|
-
declare function PublicPageHeader({ event, eventCode, title, description, showEventLogo, showAppLogo, className, children, customEventLogo }: PublicPageHeaderProps): react_jsx_runtime.JSX.Element;
|
|
4073
|
-
interface PublicPageFooterProps {
|
|
4074
|
-
/** The event data for this public page */
|
|
4075
|
-
event: Event;
|
|
4076
|
-
/** Company or organization name */
|
|
4077
|
-
companyName?: string;
|
|
4078
|
-
/** Current year or custom year for copyright */
|
|
4079
|
-
year?: number;
|
|
4080
|
-
/** Optional array of navigation links to display */
|
|
4081
|
-
links?: Array<{
|
|
4082
|
-
label: string;
|
|
4083
|
-
href: string;
|
|
4084
|
-
}>;
|
|
4085
|
-
/** Optional CSS class name */
|
|
4086
|
-
className?: string;
|
|
4087
|
-
/** Logo image URL */
|
|
4088
|
-
logo?: string;
|
|
4089
|
-
/** Copyright text */
|
|
4090
|
-
copyright?: string;
|
|
4091
|
-
/** Footer content - children to render inside footer */
|
|
4092
|
-
children?: React__default.ReactNode;
|
|
4093
|
-
}
|
|
4094
|
-
declare function PublicPageFooter({ event, companyName, year, links, className, logo, copyright, children }: PublicPageFooterProps): react_jsx_runtime.JSX.Element;
|
|
4095
|
-
/**
|
|
4096
|
-
* Layout component for public pages that don't require authentication
|
|
4097
|
-
*
|
|
4098
|
-
* This component provides a consistent structure for public event pages
|
|
4099
|
-
* with event-specific branding, error handling, and loading states.
|
|
4100
|
-
*
|
|
4101
|
-
* Automatically applies event colors from the event's event_colours field
|
|
4102
|
-
* when an event is provided, ensuring consistent theming across public pages.
|
|
4103
|
-
*
|
|
4104
|
-
* @param props - Layout configuration and content
|
|
4105
|
-
* @returns React element with complete public page layout
|
|
4106
|
-
*/
|
|
4107
|
-
declare function PublicPageLayout({ eventCode, children, event, isLoading, error, refetch, showFooter, errorFallback: ErrorFallback, loadingFallback: LoadingFallback, customHeader, customFooter, showValidationErrors, loadingMessage }: PublicPageLayoutProps): react_jsx_runtime.JSX.Element;
|
|
4108
|
-
|
|
4109
|
-
interface PublicPageContextType {
|
|
4110
|
-
isPublicPage: true;
|
|
4111
|
-
supabase: ReturnType<typeof createClient<Database>> | null;
|
|
4112
|
-
appName: string | null;
|
|
4113
|
-
environment: {
|
|
4114
|
-
supabaseUrl: string | null;
|
|
4115
|
-
supabaseKey: string | null;
|
|
4116
|
-
};
|
|
4117
|
-
}
|
|
4118
|
-
interface PublicPageProviderProps {
|
|
4119
|
-
children: ReactNode;
|
|
4120
|
-
/** Application name for logo display and branding. Should match the APP_NAME constant used in App.tsx */
|
|
4121
|
-
appName?: string;
|
|
4122
|
-
}
|
|
4123
|
-
/**
|
|
4124
|
-
* Provider for public pages that completely isolates them from authentication context
|
|
4125
|
-
*
|
|
4126
|
-
* This provider:
|
|
4127
|
-
* - Does not initialize any authentication providers
|
|
4128
|
-
* - Provides environment variables for public data access
|
|
4129
|
-
* - Includes error boundary for graceful error handling
|
|
4130
|
-
* - Is completely separate from the main app context
|
|
4131
|
-
* - Provides appName for consistent logo display
|
|
4132
|
-
*/
|
|
4133
|
-
declare function PublicPageProvider({ children, appName }: PublicPageProviderProps): react_jsx_runtime.JSX.Element;
|
|
4134
|
-
/**
|
|
4135
|
-
* Hook to access public page context
|
|
4136
|
-
*
|
|
4137
|
-
* @returns Public page context with environment variables
|
|
4138
|
-
*/
|
|
4139
|
-
declare function usePublicPageContext(): PublicPageContextType;
|
|
4140
|
-
/**
|
|
4141
|
-
* Hook to check if we're in a public page context
|
|
4142
|
-
*
|
|
4143
|
-
* @returns True if we're in a public page context
|
|
4144
|
-
*/
|
|
4145
|
-
declare function useIsPublicPage(): boolean;
|
|
4146
|
-
|
|
4147
|
-
export { type DialogContentProps as $, AddressField as A, Button as B, Card as C, TableHeader as D, TableBody as E, TableCaption as F, TableCell as G, TableFooter as H, Input as I, TableHead as J, TableRow as K, Label as L, Dialog as M, DialogPortal as N, DialogTrigger as O, Progress as P, DialogClose as Q, DialogContent as R, Switch as S, Textarea as T, DialogHeader as U, DialogBody as V, DialogFooter as W, DialogTitle as X, DialogDescription as Y, type DialogProps as Z, type DialogTriggerProps as _, type ButtonProps as a, FileUpload as a$, type DialogPortalProps as a0, type DialogCloseProps as a1, type DialogHeaderProps as a2, type DialogFooterProps as a3, type DialogBodyProps as a4, type DialogSize as a5, Select as a6, SelectGroup as a7, SelectValue as a8, SelectTrigger as a9, TooltipContent as aA, TooltipProvider as aB, TooltipRoot as aC, Form as aD, FormField as aE, type FormProps as aF, type FormFieldProps as aG, LoginForm as aH, type LoginFormProps as aI, Header as aJ, Footer as aK, type FooterProps as aL, ProtectedRoute as aM, type ProtectedRouteProps as aN, NavigationMenu as aO, ContextSelector as aP, type ContextSelectorProps as aQ, UserMenu as aR, ErrorBoundary as aS, ErrorBoundaryProvider as aT, type ErrorBoundaryProps as aU, type ErrorBoundaryState as aV, type ErrorBoundaryProviderProps as aW, type GlobalErrorHandler as aX, LoadingSpinner as aY, SessionRestorationLoader as aZ, type SessionRestorationLoaderProps as a_, SelectContent as aa, SelectLabel as ab, SelectItem as ac, SelectSeparator as ad, Tabs as ae, TabsList as af, TabsTrigger as ag, TabsContent as ah, type TabsProps as ai, type TabsListProps as aj, type TabsTriggerProps as ak, type TabsContentProps as al, Calendar as am, type CalendarProps as an, Toast as ao, Toaster as ap, ToastAction as aq, ToastProvider as ar, ToastViewport as as, ToastTitle as at, ToastDescription as au, ToastClose as av, type ToastActionElement as aw, type ToastProps as ax, Tooltip as ay, TooltipTrigger as az, CardHeader as b, type FileUploadProps as b0, FileDisplay as b1, type FileDisplayProps as b2, useFileReference as b3, useFileReferenceForRecord as b4, useFileReferenceById as b5, useFilesByCategory as b6, type UseFileReferenceOptions as b7, type UseFileReferenceReturn as b8, type UseFileReferenceForRecordReturn as b9, PublicPageLayout as ba, PublicPageHeader as bb, PublicPageFooter as bc, PublicPageProvider as bd, usePublicPageContext as be, useIsPublicPage as bf, type PublicPageLayoutProps as bg, type PublicPageHeaderProps as bh, type PublicPageFooterProps as bi, type PaceAppLayoutProps as bj, PaceAppLayout as bk, type PaceLoginPageProps as bl, PaceLoginPage as bm, type UserMenuProps as bn, PasswordChangeForm as bo, CardFooter as c, CardTitle as d, CardDescription as e, CardContent as f, CardActions as g, type CardProps as h, type CardActionsProps as i, type InputProps as j, type AddressFieldProps as k, type AddressFieldRef as l, type LabelProps as m, type TextareaProps as n, Alert as o, AlertTitle as p, AlertDescription as q, Avatar as r, type AvatarProps as s, Badge as t, type BadgeProps as u, type BadgeVariant as v, Checkbox as w, type SwitchProps as x, type ProgressProps as y, Table as z };
|