@jmruthers/pace-core 0.6.6 → 0.6.7
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/{scripts/audit/audit-dependencies.cjs → audit-tool/00-dependencies.cjs} +12 -13
- package/audit-tool/audits/01-pace-core-compliance.cjs +556 -0
- package/audit-tool/audits/02-project-structure.cjs +255 -0
- package/audit-tool/audits/03-architecture.cjs +196 -0
- package/audit-tool/audits/04-code-quality.cjs +149 -0
- package/audit-tool/audits/05-styling.cjs +224 -0
- package/audit-tool/audits/06-security-rbac.cjs +544 -0
- package/audit-tool/audits/07-api-tech-stack.cjs +301 -0
- package/audit-tool/audits/08-testing-documentation.cjs +202 -0
- package/audit-tool/audits/09-operations.cjs +208 -0
- package/audit-tool/index.cjs +291 -0
- package/audit-tool/utils/code-utils.cjs +218 -0
- package/audit-tool/utils/file-utils.cjs +230 -0
- package/audit-tool/utils/report-utils.cjs +241 -0
- package/cursor-rules/00-standards-overview.mdc +156 -0
- package/cursor-rules/{00-pace-core-compliance.mdc → 01-pace-core-compliance.mdc} +187 -34
- package/cursor-rules/02-project-structure.mdc +37 -5
- package/cursor-rules/{03-solid-principles.mdc → 03-architecture.mdc} +125 -11
- package/cursor-rules/04-code-quality.mdc +419 -0
- package/cursor-rules/{08-markup-quality.mdc → 05-styling.mdc} +55 -10
- package/cursor-rules/{09-rbac-compliance.mdc → 06-security-rbac.mdc} +62 -6
- package/cursor-rules/07-api-tech-stack.mdc +377 -0
- package/cursor-rules/08-testing-documentation.mdc +324 -0
- package/cursor-rules/09-operations.mdc +365 -0
- package/dist/DataTable-7PMH7XN7.js +15 -0
- package/dist/{DataTable-2N_tqbfq.d.ts → DataTable-DRUIgtUH.d.ts} +1 -1
- package/dist/{PublicPageProvider-BBH6Vqg7.d.ts → PublicPageProvider-DlsCaR5v.d.ts} +26 -16
- package/dist/{chunk-FENMYN2U.js → chunk-5X4QLXRG.js} +1 -3
- package/dist/{chunk-4T7OBVTU.js → chunk-6F3IILHI.js} +1 -1
- package/dist/{chunk-SD6WQY43.js → chunk-7ILTDCL2.js} +9 -1
- package/dist/{chunk-3QC3KRHK.js → chunk-A3W6LW53.js} +16 -1
- package/dist/{chunk-7TYHROIV.js → chunk-BM4CQ5P3.js} +50 -8
- package/dist/{chunk-2HGJFNAH.js → chunk-FEJLJNWA.js} +1 -15
- package/dist/{chunk-OHIK3MIO.js → chunk-GHYHJTYV.js} +2 -2
- package/dist/{chunk-UIYSCEV7.js → chunk-IUBRCBSY.js} +1 -1
- package/dist/{chunk-LAZMKTTF.js → chunk-JGWDVX64.js} +281 -347
- package/dist/{chunk-MAGBIDNS.js → chunk-L4XMVJKY.js} +2 -2
- package/dist/{chunk-A55DK444.js → chunk-OJ4SKRSV.js} +1 -7
- package/dist/{chunk-ZS5VO5JB.js → chunk-Q7Q7V5NV.js} +406 -451
- package/dist/{chunk-3O3WHILE.js → chunk-VBCS3DUA.js} +236 -60
- package/dist/{chunk-BVP2BCJF.js → chunk-ZKAWKYT4.js} +8 -8
- package/dist/components.d.ts +5 -4
- package/dist/components.js +27 -32
- package/dist/eslint-rules/index.cjs +22 -9
- package/{src/eslint-rules/rules/compliance.cjs → dist/eslint-rules/rules/01-pace-core-compliance.cjs} +184 -23
- package/dist/eslint-rules/rules/04-code-quality.cjs +290 -0
- package/dist/eslint-rules/rules/05-styling.cjs +61 -0
- package/dist/eslint-rules/rules/{rbac.cjs → 06-security-rbac.cjs} +26 -10
- package/dist/eslint-rules/rules/07-api-tech-stack.cjs +263 -0
- package/dist/eslint-rules/rules/08-testing.cjs +94 -0
- package/dist/hooks.d.ts +5 -5
- package/dist/hooks.js +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +18 -17
- package/dist/rbac/index.js +6 -6
- package/dist/theming/runtime.d.ts +14 -1
- package/dist/theming/runtime.js +1 -1
- package/dist/{types-B-K_5VnO.d.ts → types-DXstZpNI.d.ts} +0 -17
- package/dist/{usePublicRouteParams-COZ28Mvq.d.ts → usePublicRouteParams-MamNgwqe.d.ts} +19 -19
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +8 -8
- package/docs/README.md +1 -1
- package/docs/api/modules.md +47 -31
- package/docs/api-reference/components.md +18 -20
- package/docs/api-reference/hooks.md +80 -80
- package/docs/api-reference/types.md +1 -1
- package/docs/api-reference/utilities.md +1 -1
- package/docs/architecture/README.md +1 -1
- package/docs/core-concepts/events.md +3 -3
- package/docs/core-concepts/organisations.md +6 -6
- package/docs/core-concepts/permissions.md +6 -6
- package/docs/documentation-index.md +12 -18
- package/docs/getting-started/documentation-index.md +1 -1
- package/docs/getting-started/examples/README.md +4 -4
- package/docs/getting-started/examples/full-featured-app.md +1 -1
- package/docs/getting-started/faq.md +2 -2
- package/docs/getting-started/quick-reference.md +4 -4
- package/docs/implementation-guides/authentication.md +15 -15
- package/docs/implementation-guides/component-styling.md +1 -1
- package/docs/implementation-guides/data-tables.md +126 -33
- package/docs/implementation-guides/datatable-rbac-usage.md +1 -1
- package/docs/implementation-guides/dynamic-colors.md +3 -3
- package/docs/implementation-guides/file-upload-storage.md +2 -2
- package/docs/implementation-guides/hierarchical-datatable.md +40 -60
- package/docs/implementation-guides/inactivity-tracking.md +3 -3
- package/docs/implementation-guides/large-datasets.md +3 -2
- package/docs/implementation-guides/organisation-security.md +2 -2
- package/docs/implementation-guides/performance.md +2 -2
- package/docs/implementation-guides/permission-enforcement.md +1 -1
- package/docs/migration/V0.3.44_organisation-context-timing-fix.md +1 -1
- package/docs/migration/V0.4.0_rbac-migration.md +6 -6
- package/docs/rbac/README.md +5 -5
- package/docs/rbac/advanced-patterns.md +6 -6
- package/docs/rbac/api-reference.md +20 -20
- package/docs/rbac/event-based-apps.md +3 -3
- package/docs/rbac/examples.md +41 -41
- package/docs/rbac/getting-started.md +37 -37
- package/docs/rbac/performance.md +1 -1
- package/docs/rbac/quick-start.md +52 -52
- package/docs/rbac/secure-client-protection.md +1 -1
- package/docs/rbac/troubleshooting.md +1 -1
- package/docs/security/README.md +5 -5
- package/docs/standards/0-standards-overview.md +220 -0
- package/docs/standards/{00-pace-core-compliance.md → 1-pace-core-compliance-standards.md} +204 -185
- package/docs/standards/{02-project-structure.md → 2-project-structure-standards.md} +11 -47
- package/docs/standards/3-architecture-standards.md +606 -0
- package/docs/standards/4-code-quality-standards.md +728 -0
- package/docs/standards/{08-markup-quality.md → 5-styling-standards.md} +12 -9
- package/docs/standards/{09-rbac-compliance.md → 6-security-rbac-standards.md} +126 -18
- package/docs/standards/7-api-tech-stack-standards.md +662 -0
- package/docs/standards/8-testing-documentation-standards.md +401 -0
- package/docs/standards/9-operations-standards.md +1102 -0
- package/docs/standards/README.md +203 -104
- package/docs/troubleshooting/README.md +4 -4
- package/docs/troubleshooting/common-issues.md +2 -2
- package/docs/troubleshooting/debugging.md +9 -9
- package/docs/troubleshooting/migration.md +4 -4
- package/eslint-config-pace-core.cjs +21 -10
- package/package.json +6 -5
- package/scripts/install-cursor-rules.cjs +11 -243
- package/scripts/install-eslint-config.cjs +284 -0
- package/src/__tests__/helpers/__tests__/component-test-utils.test.tsx +2 -2
- package/src/__tests__/helpers/__tests__/test-providers.test.tsx +2 -2
- package/src/__tests__/helpers/__tests__/test-utils.test.tsx +10 -10
- package/src/__tests__/integration/UserProfile.test.tsx +14 -14
- package/src/__tests__/rbac/PagePermissionGuard.test.tsx +6 -6
- package/src/__tests__/templates/accessibility.test.template.tsx +9 -9
- package/src/__tests__/templates/component.test.template.tsx +18 -15
- package/src/components/Calendar/Calendar.tsx +201 -47
- package/src/components/ContextSelector/ContextSelector.tsx +137 -153
- package/src/components/DataTable/AUDIT_REPORT.md +293 -0
- package/src/components/DataTable/__tests__/DataTableCore.test.tsx +10 -2
- package/src/components/DataTable/__tests__/a11y.basic.test.tsx +10 -4
- package/src/components/DataTable/__tests__/test-utils/sharedTestUtils.tsx +9 -9
- package/src/components/DataTable/components/ColumnFilter.tsx +63 -74
- package/src/components/DataTable/components/ColumnVisibilityDropdown.tsx +43 -41
- package/src/components/DataTable/components/DataTableErrorBoundary.tsx +9 -11
- package/src/components/DataTable/components/DataTableLayout.tsx +5 -16
- package/src/components/DataTable/components/EditableRow.tsx +5 -7
- package/src/components/DataTable/components/EmptyState.tsx +10 -9
- package/src/components/DataTable/components/FilterRow.tsx +2 -4
- package/src/components/DataTable/components/ImportModal.tsx +124 -126
- package/src/components/DataTable/components/LoadingState.tsx +5 -6
- package/src/components/DataTable/components/SortIndicator.tsx +50 -0
- package/src/components/DataTable/components/__tests__/COVERAGE_NOTE.md +4 -4
- package/src/components/DataTable/components/__tests__/ColumnFilter.test.tsx +23 -82
- package/src/components/DataTable/components/__tests__/DataTableErrorBoundary.test.tsx +37 -9
- package/src/components/DataTable/components/__tests__/EmptyState.test.tsx +7 -4
- package/src/components/DataTable/components/__tests__/FilterRow.test.tsx +12 -4
- package/src/components/DataTable/components/__tests__/LoadingState.test.tsx +41 -27
- package/src/components/DataTable/components/index.ts +2 -1
- package/src/components/DataTable/types.ts +0 -18
- package/src/components/DataTable/utils/a11yUtils.ts +17 -0
- package/src/components/DatePickerWithTimezone/DatePickerWithTimezone.test.tsx +2 -1
- package/src/components/DatePickerWithTimezone/DatePickerWithTimezone.tsx +11 -15
- package/src/components/DateTimeField/DateTimeField.tsx +7 -8
- package/src/components/Dialog/Dialog.test.tsx +1 -0
- package/src/components/Dialog/Dialog.tsx +25 -8
- package/src/components/ErrorBoundary/ErrorBoundary.tsx +77 -79
- package/src/components/FileUpload/FileUpload.test.tsx +52 -14
- package/src/components/FileUpload/FileUpload.tsx +112 -130
- package/src/components/Progress/Progress.tsx +2 -4
- package/src/components/ProtectedRoute/ProtectedRoute.tsx +8 -8
- package/src/components/Select/Select.tsx +86 -77
- package/src/components/Select/types.ts +3 -0
- package/src/hooks/__tests__/ServiceHooks.test.tsx +16 -16
- package/src/hooks/__tests__/hooks.integration.test.tsx +49 -49
- package/src/hooks/__tests__/useFocusTrap.unit.test.tsx +97 -97
- package/src/hooks/public/usePublicEvent.ts +5 -5
- package/src/hooks/public/usePublicEventLogo.ts +5 -5
- package/src/hooks/public/usePublicFileDisplay.ts +2 -2
- package/src/hooks/public/usePublicRouteParams.ts +5 -5
- package/src/hooks/useAppConfig.ts +2 -2
- package/src/hooks/useEventTheme.test.ts +7 -7
- package/src/hooks/useEventTheme.ts +1 -4
- package/src/hooks/useFileDisplay.ts +2 -2
- package/src/providers/UnifiedAuthProvider.smoke.test.tsx +21 -21
- package/src/providers/__tests__/AuthProvider.test.tsx +21 -21
- package/src/providers/__tests__/EventProvider.test.tsx +61 -61
- package/src/providers/__tests__/InactivityProvider.test.tsx +56 -56
- package/src/providers/__tests__/OrganisationProvider.test.tsx +75 -75
- package/src/providers/__tests__/ProviderLifecycle.test.tsx +37 -37
- package/src/providers/__tests__/UnifiedAuthProvider.test.tsx +103 -103
- package/src/providers/services/__tests__/AuthServiceProvider.integration.test.tsx +7 -7
- package/src/providers/services/__tests__/UnifiedAuthProvider.integration.test.tsx +10 -10
- package/src/styles/core.css +7 -0
- package/src/theming/__tests__/parseEventColours.test.ts +9 -3
- package/src/theming/parseEventColours.ts +22 -10
- package/src/utils/__tests__/lazyLoad.unit.test.tsx +42 -39
- package/src/utils/storage/README.md +1 -1
- package/cursor-rules/01-standards-compliance.mdc +0 -285
- package/cursor-rules/04-testing-standards.mdc +0 -270
- package/cursor-rules/05-bug-reports-and-features.mdc +0 -248
- package/cursor-rules/06-code-quality.mdc +0 -311
- package/cursor-rules/07-tech-stack-compliance.mdc +0 -216
- package/cursor-rules/10-error-handling-patterns.mdc +0 -179
- package/cursor-rules/11-performance-optimization.mdc +0 -169
- package/cursor-rules/12-ci-cd-integration.mdc +0 -150
- package/dist/DataTable-LRJL4IRV.js +0 -15
- package/dist/eslint-rules/rules/compliance.cjs +0 -348
- package/dist/eslint-rules/rules/components.cjs +0 -113
- package/dist/eslint-rules/rules/imports.cjs +0 -102
- package/docs/best-practices/README.md +0 -472
- package/docs/best-practices/accessibility.md +0 -604
- package/docs/best-practices/common-patterns.md +0 -516
- package/docs/best-practices/deployment.md +0 -1103
- package/docs/best-practices/performance.md +0 -1328
- package/docs/best-practices/security.md +0 -940
- package/docs/best-practices/testing.md +0 -1034
- package/docs/rbac/compliance/compliance-guide.md +0 -544
- package/docs/standards/01-standards-compliance.md +0 -188
- package/docs/standards/03-solid-principles.md +0 -39
- package/docs/standards/04-testing-standards.md +0 -36
- package/docs/standards/05-bug-reports-and-features.md +0 -27
- package/docs/standards/06-code-quality.md +0 -34
- package/docs/standards/07-tech-stack-compliance.md +0 -30
- package/docs/standards/10-error-handling-patterns.md +0 -401
- package/docs/standards/11-performance-optimization.md +0 -348
- package/docs/standards/12-ci-cd-integration.md +0 -370
- package/docs/standards/ALIGNMENT_REVIEW_SUMMARY.md +0 -192
- package/scripts/audit/audit-compliance.cjs +0 -1295
- package/scripts/audit/audit-components.cjs +0 -260
- package/scripts/audit/audit-rbac.cjs +0 -954
- package/scripts/audit/audit-standards.cjs +0 -1268
- package/scripts/audit/index.cjs +0 -1927
- package/src/components/DataTable/components/DataTableBody.tsx +0 -478
- package/src/components/DataTable/components/DraggableColumnHeader.tsx +0 -156
- package/src/components/DataTable/components/ExpandButton.tsx +0 -113
- package/src/components/DataTable/components/GroupHeader.tsx +0 -54
- package/src/components/DataTable/components/ViewRowModal.tsx +0 -68
- package/src/components/DataTable/components/VirtualizedDataTable.tsx +0 -525
- package/src/components/DataTable/components/__tests__/ExpandButton.test.tsx +0 -462
- package/src/components/DataTable/components/__tests__/GroupHeader.test.tsx +0 -393
- package/src/components/DataTable/components/__tests__/ViewRowModal.test.tsx +0 -476
- package/src/components/DataTable/components/__tests__/VirtualizedDataTable.test.tsx +0 -128
- package/src/components/DataTable/core/DataTableContext.tsx +0 -216
- package/src/components/DataTable/core/__tests__/DataTableContext.test.tsx +0 -136
- package/src/components/DataTable/hooks/__tests__/useColumnReordering.test.ts +0 -570
- package/src/components/DataTable/hooks/useColumnReordering.ts +0 -123
- package/src/components/DataTable/utils/debugTools.ts +0 -514
- package/src/eslint-rules/index.cjs +0 -22
- package/src/eslint-rules/rules/components.cjs +0 -113
- package/src/eslint-rules/rules/imports.cjs +0 -102
- package/src/eslint-rules/rules/rbac.cjs +0 -790
- package/src/eslint-rules/utils/helpers.cjs +0 -42
- package/src/eslint-rules/utils/manifest-loader.cjs +0 -75
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
import { AccessDenied } from './chunk-
|
|
2
|
-
import { Input, Dialog, DialogContent, DialogHeader, DialogBody, DialogFooter,
|
|
3
|
-
import { Button, useRBAC, useResolvedScope, usePermissions, useEvents, useCan } from './chunk-
|
|
4
|
-
import { useAddressAutocomplete, createFileReferenceService, uploadFileWithReference, usePublicFileDisplay, useFileDisplay, getPublicUrl, getSignedUrl, generateFileUrlsBatch, useEventTheme, usePreventTabReload } from './chunk-
|
|
5
|
-
import { clearPalette } from './chunk-
|
|
1
|
+
import { AccessDenied } from './chunk-6F3IILHI.js';
|
|
2
|
+
import { Input, Dialog, DialogContent, DialogHeader, DialogBody, DialogFooter, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, Alert, AlertDescription, Label, SelectLabel, SelectSeparator, DialogTitle, deriveFormKey, useSessionDraft, filterSensitiveFields, isSensitiveField, SelectGroup, AlertTitle, Progress } from './chunk-Q7Q7V5NV.js';
|
|
3
|
+
import { Button, useRBAC, useResolvedScope, usePermissions, useEvents, useCan } from './chunk-BM4CQ5P3.js';
|
|
4
|
+
import { useAddressAutocomplete, createFileReferenceService, uploadFileWithReference, usePublicFileDisplay, useFileDisplay, getPublicUrl, getSignedUrl, generateFileUrlsBatch, useEventTheme, usePreventTabReload } from './chunk-5X4QLXRG.js';
|
|
5
|
+
import { clearPalette } from './chunk-ZKAWKYT4.js';
|
|
6
6
|
import { useToast } from './chunk-S7DKJPLT.js';
|
|
7
|
-
import { useIsPublicPage, PublicPageContext, useAppConfig, ErrorBoundary } from './chunk-
|
|
7
|
+
import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, useIsPublicPage, PublicPageContext, useAppConfig, ErrorBoundary } from './chunk-VBCS3DUA.js';
|
|
8
8
|
import { useUnifiedAuth, useOrganisations, UnifiedAuthContext, EventServiceContext, useSessionRestoration } from './chunk-FTCRZOG2.js';
|
|
9
9
|
import { EventContextRequiredError, OrganisationContextRequiredError, isSuperAdmin } from './chunk-ZFYPMX46.js';
|
|
10
10
|
import { assertAppId } from './chunk-4SXLQIZO.js';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { getAppId } from './chunk-FEJLJNWA.js';
|
|
12
|
+
import { LoadingSpinner } from './chunk-A3W6LW53.js';
|
|
13
|
+
import { getCurrentAppName } from './chunk-OJ4SKRSV.js';
|
|
14
|
+
import { cn } from './chunk-7ILTDCL2.js';
|
|
13
15
|
import { createLogger, logger } from './chunk-TTRFSOKR.js';
|
|
14
|
-
import * as
|
|
15
|
-
import
|
|
16
|
+
import * as React6 from 'react';
|
|
17
|
+
import React6__default, { useState, useRef, useMemo, useCallback, useEffect, useContext } from 'react';
|
|
16
18
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
17
|
-
import
|
|
18
|
-
import { FileText, ExternalLink, X, ChevronDown, KeyRound, LogOut, Calendar as Calendar$1, Building2, AlertCircle, RefreshCw } from 'lucide-react';
|
|
19
|
+
import { FileText, ExternalLink, X, ChevronDown, KeyRound, LogOut, AlertCircle, RefreshCw, Calendar as Calendar$1, Building2, File, Check } from 'lucide-react';
|
|
19
20
|
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
20
21
|
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
21
22
|
import { useDayPicker, DayPicker } from 'react-day-picker';
|
|
22
23
|
import { enAU } from 'date-fns/locale';
|
|
24
|
+
import { format } from 'date-fns';
|
|
23
25
|
import * as ToastPrimitives from '@radix-ui/react-toast';
|
|
24
26
|
import { useForm, useWatch, FormProvider, useFormContext, Controller } from 'react-hook-form';
|
|
25
27
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
26
28
|
import { useLocation, Link, useNavigate, Outlet, Navigate } from 'react-router-dom';
|
|
27
29
|
|
|
28
|
-
var AddressField =
|
|
30
|
+
var AddressField = React6.forwardRef(
|
|
29
31
|
({
|
|
30
32
|
apiKey,
|
|
31
33
|
value: controlledValue,
|
|
@@ -44,13 +46,13 @@ var AddressField = React7.forwardRef(
|
|
|
44
46
|
cacheTTL,
|
|
45
47
|
...props
|
|
46
48
|
}, ref) => {
|
|
47
|
-
const [internalValue, setInternalValue] =
|
|
48
|
-
const [isOpen, setIsOpen] =
|
|
49
|
-
const [selectedIndex, setSelectedIndex] =
|
|
50
|
-
const [inputFocused, setInputFocused] =
|
|
51
|
-
const inputRef =
|
|
52
|
-
const suggestionsRef =
|
|
53
|
-
const containerRef =
|
|
49
|
+
const [internalValue, setInternalValue] = React6.useState(defaultValue);
|
|
50
|
+
const [isOpen, setIsOpen] = React6.useState(false);
|
|
51
|
+
const [selectedIndex, setSelectedIndex] = React6.useState(-1);
|
|
52
|
+
const [inputFocused, setInputFocused] = React6.useState(false);
|
|
53
|
+
const inputRef = React6.useRef(null);
|
|
54
|
+
const suggestionsRef = React6.useRef(null);
|
|
55
|
+
const containerRef = React6.useRef(null);
|
|
54
56
|
const value = controlledValue !== void 0 ? controlledValue : internalValue;
|
|
55
57
|
const { suggestions, isLoading, error: autocompleteError, selectAddress, clearSuggestions } = useAddressAutocomplete(apiKey, value, {
|
|
56
58
|
autocompleteOptions,
|
|
@@ -58,14 +60,14 @@ var AddressField = React7.forwardRef(
|
|
|
58
60
|
cacheEnabled,
|
|
59
61
|
cacheTTL
|
|
60
62
|
});
|
|
61
|
-
|
|
63
|
+
React6.useEffect(() => {
|
|
62
64
|
if (suggestions.length > 0 && inputFocused && value.trim()) {
|
|
63
65
|
setIsOpen(true);
|
|
64
66
|
} else if (suggestions.length === 0 || !value.trim()) {
|
|
65
67
|
setIsOpen(false);
|
|
66
68
|
}
|
|
67
69
|
}, [suggestions, inputFocused, value]);
|
|
68
|
-
const handleInputChange =
|
|
70
|
+
const handleInputChange = React6.useCallback(
|
|
69
71
|
(e) => {
|
|
70
72
|
const newValue = e.target.value;
|
|
71
73
|
if (controlledValue === void 0) {
|
|
@@ -80,7 +82,7 @@ var AddressField = React7.forwardRef(
|
|
|
80
82
|
},
|
|
81
83
|
[controlledValue, onInputChange, onChange, clearSuggestions]
|
|
82
84
|
);
|
|
83
|
-
const handleSelectAddress =
|
|
85
|
+
const handleSelectAddress = React6.useCallback(
|
|
84
86
|
async (placeId) => {
|
|
85
87
|
setIsOpen(false);
|
|
86
88
|
setSelectedIndex(-1);
|
|
@@ -97,7 +99,7 @@ var AddressField = React7.forwardRef(
|
|
|
97
99
|
},
|
|
98
100
|
[selectAddress, onChange, onInputChange, controlledValue]
|
|
99
101
|
);
|
|
100
|
-
const handleKeyDown =
|
|
102
|
+
const handleKeyDown = React6.useCallback(
|
|
101
103
|
(e) => {
|
|
102
104
|
if (!isOpen || suggestions.length === 0) {
|
|
103
105
|
if (e.key === "Escape") {
|
|
@@ -135,13 +137,13 @@ var AddressField = React7.forwardRef(
|
|
|
135
137
|
},
|
|
136
138
|
[isOpen, suggestions, selectedIndex, handleSelectAddress]
|
|
137
139
|
);
|
|
138
|
-
const handleFocus =
|
|
140
|
+
const handleFocus = React6.useCallback(() => {
|
|
139
141
|
setInputFocused(true);
|
|
140
142
|
if (suggestions.length > 0 && value.trim()) {
|
|
141
143
|
setIsOpen(true);
|
|
142
144
|
}
|
|
143
145
|
}, [suggestions, value]);
|
|
144
|
-
const handleBlur =
|
|
146
|
+
const handleBlur = React6.useCallback(
|
|
145
147
|
(e) => {
|
|
146
148
|
setTimeout(() => {
|
|
147
149
|
if (!containerRef.current?.contains(document.activeElement)) {
|
|
@@ -153,7 +155,7 @@ var AddressField = React7.forwardRef(
|
|
|
153
155
|
},
|
|
154
156
|
[]
|
|
155
157
|
);
|
|
156
|
-
|
|
158
|
+
React6.useEffect(() => {
|
|
157
159
|
const handleClickOutside = (event) => {
|
|
158
160
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
159
161
|
setIsOpen(false);
|
|
@@ -167,8 +169,8 @@ var AddressField = React7.forwardRef(
|
|
|
167
169
|
};
|
|
168
170
|
}
|
|
169
171
|
}, [isOpen]);
|
|
170
|
-
const suggestionsId =
|
|
171
|
-
|
|
172
|
+
const suggestionsId = React6.useId();
|
|
173
|
+
React6.useEffect(() => {
|
|
172
174
|
if (selectedIndex >= 0) {
|
|
173
175
|
const selectedItem = document.getElementById(
|
|
174
176
|
`${suggestionsId}-item-${selectedIndex}`
|
|
@@ -178,7 +180,7 @@ var AddressField = React7.forwardRef(
|
|
|
178
180
|
}
|
|
179
181
|
}
|
|
180
182
|
}, [selectedIndex, suggestionsId]);
|
|
181
|
-
|
|
183
|
+
React6.useImperativeHandle(ref, () => inputRef.current);
|
|
182
184
|
const hasError = error || !!autocompleteError;
|
|
183
185
|
return /* @__PURE__ */ jsxs("form", { ref: containerRef, className: cn("relative w-full", className), children: [
|
|
184
186
|
/* @__PURE__ */ jsx(
|
|
@@ -218,7 +220,7 @@ var AddressField = React7.forwardRef(
|
|
|
218
220
|
"list-none p-0 m-0"
|
|
219
221
|
),
|
|
220
222
|
"data-testid": "address-suggestions",
|
|
221
|
-
children: suggestions.map((suggestion, index) => /* @__PURE__ */ jsxs(
|
|
223
|
+
children: suggestions.map((suggestion, index) => /* @__PURE__ */ jsxs(React6.Fragment, { children: [
|
|
222
224
|
/* @__PURE__ */ jsx(
|
|
223
225
|
"dt",
|
|
224
226
|
{
|
|
@@ -247,65 +249,6 @@ var AddressField = React7.forwardRef(
|
|
|
247
249
|
}
|
|
248
250
|
);
|
|
249
251
|
AddressField.displayName = "AddressField";
|
|
250
|
-
var getLabelClasses = () => {
|
|
251
|
-
return "font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70";
|
|
252
|
-
};
|
|
253
|
-
var Label = React7.forwardRef(({
|
|
254
|
-
className,
|
|
255
|
-
required = false,
|
|
256
|
-
requiredIndicator,
|
|
257
|
-
hideRequiredIndicator = false,
|
|
258
|
-
helperText,
|
|
259
|
-
helperTextClassName,
|
|
260
|
-
error,
|
|
261
|
-
errorClassName,
|
|
262
|
-
children,
|
|
263
|
-
htmlFor,
|
|
264
|
-
...props
|
|
265
|
-
}, ref) => {
|
|
266
|
-
const hasError = !!error;
|
|
267
|
-
const showHelperText = helperText && !hasError;
|
|
268
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
269
|
-
/* @__PURE__ */ jsxs(
|
|
270
|
-
LabelPrimitive.Root,
|
|
271
|
-
{
|
|
272
|
-
ref,
|
|
273
|
-
className: cn(
|
|
274
|
-
getLabelClasses(),
|
|
275
|
-
hasError && "text-destructive",
|
|
276
|
-
className
|
|
277
|
-
),
|
|
278
|
-
htmlFor,
|
|
279
|
-
...props,
|
|
280
|
-
children: [
|
|
281
|
-
children,
|
|
282
|
-
required && /* @__PURE__ */ jsx(
|
|
283
|
-
"span",
|
|
284
|
-
{
|
|
285
|
-
"aria-label": "required",
|
|
286
|
-
className: cn(
|
|
287
|
-
"text-destructive ml-1",
|
|
288
|
-
hideRequiredIndicator && "sr-only"
|
|
289
|
-
),
|
|
290
|
-
children: requiredIndicator || "*"
|
|
291
|
-
}
|
|
292
|
-
)
|
|
293
|
-
]
|
|
294
|
-
}
|
|
295
|
-
),
|
|
296
|
-
showHelperText && /* @__PURE__ */ jsx("p", { className: cn("text-muted-foreground", helperTextClassName), children: helperText }),
|
|
297
|
-
hasError && /* @__PURE__ */ jsx(
|
|
298
|
-
"p",
|
|
299
|
-
{
|
|
300
|
-
role: "alert",
|
|
301
|
-
"aria-live": "polite",
|
|
302
|
-
className: cn("text-destructive", errorClassName),
|
|
303
|
-
children: error
|
|
304
|
-
}
|
|
305
|
-
)
|
|
306
|
-
] });
|
|
307
|
-
});
|
|
308
|
-
Label.displayName = LabelPrimitive.Root.displayName;
|
|
309
252
|
function Textarea({ className, variant = "default", size = "md", error, ref, ...props }) {
|
|
310
253
|
return /* @__PURE__ */ jsx(
|
|
311
254
|
"textarea",
|
|
@@ -426,7 +369,7 @@ function defaultGenerateFallbackText(fileName) {
|
|
|
426
369
|
if (words.length === 0) return "FL";
|
|
427
370
|
return words.map((word) => word.charAt(0).toUpperCase()).join("").substring(0, 3);
|
|
428
371
|
}
|
|
429
|
-
var FileDisplayContent =
|
|
372
|
+
var FileDisplayContent = React6__default.memo(function FileDisplayContent2({
|
|
430
373
|
isLoading,
|
|
431
374
|
error,
|
|
432
375
|
fileUrl,
|
|
@@ -1449,7 +1392,7 @@ var sizeClasses = {
|
|
|
1449
1392
|
xl: "size-16 text-xl",
|
|
1450
1393
|
"2xl": "size-20 text-2xl"
|
|
1451
1394
|
};
|
|
1452
|
-
var Avatar =
|
|
1395
|
+
var Avatar = React6.forwardRef(
|
|
1453
1396
|
({
|
|
1454
1397
|
table_name,
|
|
1455
1398
|
record_id,
|
|
@@ -1463,7 +1406,7 @@ var Avatar = React7.forwardRef(
|
|
|
1463
1406
|
size = "md",
|
|
1464
1407
|
...props
|
|
1465
1408
|
}, ref) => {
|
|
1466
|
-
const [imageError, setImageError] =
|
|
1409
|
+
const [imageError, setImageError] = React6.useState(false);
|
|
1467
1410
|
const { supabase } = useUnifiedAuth();
|
|
1468
1411
|
const canFetchFileId = Boolean(fileId && organisation_id && supabase);
|
|
1469
1412
|
const { fileReference, fileUrl: fileIdUrl, isLoading: fileIdLoading } = useFileReferenceById(
|
|
@@ -1480,10 +1423,10 @@ var Avatar = React7.forwardRef(
|
|
|
1480
1423
|
const fallbackClasses = "size-full grid place-items-center text-center text-sec-50 bg-sec-500";
|
|
1481
1424
|
const imageClasses = "object-cover size-full";
|
|
1482
1425
|
const containerClasses = cn(baseClasses, className);
|
|
1483
|
-
const handleImageError =
|
|
1426
|
+
const handleImageError = React6.useCallback(() => {
|
|
1484
1427
|
setImageError(true);
|
|
1485
1428
|
}, []);
|
|
1486
|
-
|
|
1429
|
+
React6.useEffect(() => {
|
|
1487
1430
|
if (src) {
|
|
1488
1431
|
setImageError(false);
|
|
1489
1432
|
}
|
|
@@ -1632,7 +1575,7 @@ function Badge({ className, variant = "solid-main-normal", ref, ...props }) {
|
|
|
1632
1575
|
);
|
|
1633
1576
|
}
|
|
1634
1577
|
Badge.displayName = "Badge";
|
|
1635
|
-
var Switch =
|
|
1578
|
+
var Switch = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1636
1579
|
SwitchPrimitive.Root,
|
|
1637
1580
|
{
|
|
1638
1581
|
className: cn(
|
|
@@ -1673,9 +1616,9 @@ var Switch = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
1673
1616
|
}
|
|
1674
1617
|
));
|
|
1675
1618
|
Switch.displayName = SwitchPrimitive.Root.displayName;
|
|
1676
|
-
var Tabs =
|
|
1619
|
+
var Tabs = React6.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(TabsPrimitive.Root, { asChild: true, ...props, children: /* @__PURE__ */ jsx("section", { ref, className, children }) }));
|
|
1677
1620
|
Tabs.displayName = TabsPrimitive.Root.displayName || "Tabs";
|
|
1678
|
-
var TabsList =
|
|
1621
|
+
var TabsList = React6.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(TabsPrimitive.List, { asChild: true, ...props, children: /* @__PURE__ */ jsx(
|
|
1679
1622
|
"nav",
|
|
1680
1623
|
{
|
|
1681
1624
|
ref,
|
|
@@ -1687,7 +1630,7 @@ var TabsList = React7.forwardRef(({ className, children, ...props }, ref) => /*
|
|
|
1687
1630
|
}
|
|
1688
1631
|
) }));
|
|
1689
1632
|
TabsList.displayName = TabsPrimitive.List.displayName || "TabsList";
|
|
1690
|
-
var TabsTrigger =
|
|
1633
|
+
var TabsTrigger = React6.forwardRef(({ className, variant, size, children, ...props }, ref) => {
|
|
1691
1634
|
return /* @__PURE__ */ jsx(TabsPrimitive.Trigger, { asChild: true, ...props, children: /* @__PURE__ */ jsx(
|
|
1692
1635
|
Button,
|
|
1693
1636
|
{
|
|
@@ -1706,7 +1649,7 @@ var TabsTrigger = React7.forwardRef(({ className, variant, size, children, ...pr
|
|
|
1706
1649
|
) });
|
|
1707
1650
|
});
|
|
1708
1651
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName || "TabsTrigger";
|
|
1709
|
-
var TabsContent =
|
|
1652
|
+
var TabsContent = React6.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(TabsPrimitive.Content, { asChild: true, ...props, children: /* @__PURE__ */ jsx(
|
|
1710
1653
|
"aside",
|
|
1711
1654
|
{
|
|
1712
1655
|
ref,
|
|
@@ -1728,10 +1671,10 @@ var assignToRef = (ref, value) => {
|
|
|
1728
1671
|
}
|
|
1729
1672
|
ref.current = value;
|
|
1730
1673
|
};
|
|
1731
|
-
var Calendar =
|
|
1732
|
-
({ className, classNames, mode, components, locale, month: controlledMonth, onMonthChange: controlledOnMonthChange, onSelect, ...props }, ref) => {
|
|
1733
|
-
const tableRef =
|
|
1734
|
-
const setForwardedRef =
|
|
1674
|
+
var Calendar = React6.forwardRef(
|
|
1675
|
+
({ className, classNames, mode, components, locale, month: controlledMonth, onMonthChange: controlledOnMonthChange, onSelect, captionLayout, startMonth, endMonth, ...props }, ref) => {
|
|
1676
|
+
const tableRef = React6.useRef(null);
|
|
1677
|
+
const setForwardedRef = React6.useCallback(
|
|
1735
1678
|
(node) => {
|
|
1736
1679
|
tableRef.current = node;
|
|
1737
1680
|
if (!ref) {
|
|
@@ -1745,14 +1688,14 @@ var Calendar = React7.forwardRef(
|
|
|
1745
1688
|
},
|
|
1746
1689
|
[ref]
|
|
1747
1690
|
);
|
|
1748
|
-
const rootPropsRef =
|
|
1691
|
+
const rootPropsRef = React6.useRef(null);
|
|
1749
1692
|
const selected = props.selected;
|
|
1750
1693
|
const isMonthControlled = controlledMonth !== void 0;
|
|
1751
|
-
const [internalMonth, setInternalMonth] =
|
|
1694
|
+
const [internalMonth, setInternalMonth] = React6.useState(() => {
|
|
1752
1695
|
const now = /* @__PURE__ */ new Date();
|
|
1753
1696
|
return new Date(now.getFullYear(), now.getMonth(), 1);
|
|
1754
1697
|
});
|
|
1755
|
-
const month =
|
|
1698
|
+
const month = React6.useMemo(() => {
|
|
1756
1699
|
const monthToUse = isMonthControlled ? controlledMonth : internalMonth;
|
|
1757
1700
|
if (!monthToUse) {
|
|
1758
1701
|
const now = /* @__PURE__ */ new Date();
|
|
@@ -1761,16 +1704,16 @@ var Calendar = React7.forwardRef(
|
|
|
1761
1704
|
const normalized = new Date(monthToUse.getFullYear(), monthToUse.getMonth(), 1);
|
|
1762
1705
|
return normalized;
|
|
1763
1706
|
}, [isMonthControlled, controlledMonth, internalMonth]);
|
|
1764
|
-
const handleMonthChange =
|
|
1707
|
+
const handleMonthChange = React6.useCallback((newMonth) => {
|
|
1765
1708
|
if (!isMonthControlled) {
|
|
1766
1709
|
setInternalMonth(newMonth);
|
|
1767
1710
|
}
|
|
1768
1711
|
controlledOnMonthChange?.(newMonth);
|
|
1769
1712
|
}, [isMonthControlled, controlledOnMonthChange]);
|
|
1770
|
-
const wrappedHandleMonthChange =
|
|
1713
|
+
const wrappedHandleMonthChange = React6.useCallback((newMonth) => {
|
|
1771
1714
|
handleMonthChange(newMonth);
|
|
1772
1715
|
}, [handleMonthChange]);
|
|
1773
|
-
const CustomRoot =
|
|
1716
|
+
const CustomRoot = React6.memo(({ children, rootRef: dayPickerRootRef, ...rootProps }) => {
|
|
1774
1717
|
const {
|
|
1775
1718
|
className: rootClassName,
|
|
1776
1719
|
style: rootStyle,
|
|
@@ -1786,29 +1729,100 @@ var Calendar = React7.forwardRef(
|
|
|
1786
1729
|
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
1787
1730
|
});
|
|
1788
1731
|
CustomRoot.displayName = "CustomRoot";
|
|
1789
|
-
const CustomMonths =
|
|
1790
|
-
|
|
1732
|
+
const CustomMonths = React6.memo(({ children }) => {
|
|
1733
|
+
const childrenArray = React6.Children.toArray(children);
|
|
1734
|
+
const filteredChildren = childrenArray.filter((child) => {
|
|
1735
|
+
if (!React6.isValidElement(child)) return true;
|
|
1736
|
+
const childType = child.type;
|
|
1737
|
+
const displayName = childType?.displayName || childType?.name;
|
|
1738
|
+
if (displayName === "MonthCaption" || displayName === "Dropdown" || displayName === "DropdownMonth" || displayName === "DropdownYear" || typeof childType === "string" && childType.includes("dropdown")) {
|
|
1739
|
+
return false;
|
|
1740
|
+
}
|
|
1741
|
+
if (childType === "div") {
|
|
1742
|
+
const childProps = child.props;
|
|
1743
|
+
if (childProps?.children) {
|
|
1744
|
+
const childChildren = React6.Children.toArray(childProps.children);
|
|
1745
|
+
const hasCaptionSpan = childChildren.some((cc) => {
|
|
1746
|
+
if (!React6.isValidElement(cc) || cc.type !== "span") return false;
|
|
1747
|
+
const spanProps = cc.props;
|
|
1748
|
+
return spanProps?.role === "status" && spanProps?.["aria-live"] === "polite";
|
|
1749
|
+
});
|
|
1750
|
+
if (hasCaptionSpan) {
|
|
1751
|
+
return false;
|
|
1752
|
+
}
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
return true;
|
|
1756
|
+
});
|
|
1757
|
+
return /* @__PURE__ */ jsx(Fragment, { children: filteredChildren });
|
|
1791
1758
|
});
|
|
1792
1759
|
CustomMonths.displayName = "CustomMonths";
|
|
1793
|
-
const CustomMonthGrid =
|
|
1760
|
+
const CustomMonthGrid = React6.forwardRef((props2, forwardedRef) => {
|
|
1794
1761
|
return /* @__PURE__ */ jsx("table", { ref: forwardedRef, ...props2 });
|
|
1795
1762
|
});
|
|
1796
1763
|
CustomMonthGrid.displayName = "CustomMonthGrid";
|
|
1797
|
-
const
|
|
1764
|
+
const CustomMonthCaption = React6.memo(({ displayMonth, startMonth: captionStartMonth, endMonth: captionEndMonth, locale: captionLocale }) => {
|
|
1765
|
+
const { goToMonth } = useDayPicker();
|
|
1766
|
+
const calendarLocale = captionLocale || enAU;
|
|
1767
|
+
const fromDate = captionStartMonth || new Date(1900, 0);
|
|
1768
|
+
const toDate = captionEndMonth || new Date(2100, 11);
|
|
1769
|
+
const monthOptions = React6.useMemo(() => {
|
|
1770
|
+
const months = [];
|
|
1771
|
+
for (let i = 0; i < 12; i++) {
|
|
1772
|
+
const monthDate = new Date(displayMonth.getFullYear(), i, 1);
|
|
1773
|
+
const label = format(monthDate, "MMMM", { locale: calendarLocale });
|
|
1774
|
+
months.push({ value: i.toString(), label });
|
|
1775
|
+
}
|
|
1776
|
+
return months;
|
|
1777
|
+
}, [calendarLocale, displayMonth]);
|
|
1778
|
+
const yearOptions = React6.useMemo(() => {
|
|
1779
|
+
const years = [];
|
|
1780
|
+
const startYear = fromDate.getFullYear();
|
|
1781
|
+
const endYear = toDate.getFullYear();
|
|
1782
|
+
for (let year = startYear; year <= endYear; year++) {
|
|
1783
|
+
years.push({ value: year.toString(), label: year.toString() });
|
|
1784
|
+
}
|
|
1785
|
+
return years;
|
|
1786
|
+
}, [fromDate, toDate]);
|
|
1787
|
+
const currentMonth = displayMonth.getMonth();
|
|
1788
|
+
const currentYear = displayMonth.getFullYear();
|
|
1789
|
+
const handleMonthChange2 = React6.useCallback((value) => {
|
|
1790
|
+
const newMonth = parseInt(value, 10);
|
|
1791
|
+
const newDate = new Date(currentYear, newMonth, 1);
|
|
1792
|
+
goToMonth(newDate);
|
|
1793
|
+
}, [currentYear, goToMonth]);
|
|
1794
|
+
const handleYearChange = React6.useCallback((value) => {
|
|
1795
|
+
const newYear = parseInt(value, 10);
|
|
1796
|
+
const newDate = new Date(newYear, currentMonth, 1);
|
|
1797
|
+
goToMonth(newDate);
|
|
1798
|
+
}, [currentMonth, goToMonth]);
|
|
1799
|
+
return /* @__PURE__ */ jsxs("nav", { className: "relative flex items-center justify-center gap-2", children: [
|
|
1800
|
+
/* @__PURE__ */ jsxs(Select, { value: currentMonth.toString(), onValueChange: handleMonthChange2, children: [
|
|
1801
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: "w-auto min-w-[120px]", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
1802
|
+
/* @__PURE__ */ jsx(SelectContent, { children: monthOptions.map((option) => /* @__PURE__ */ jsx(SelectItem, { value: option.value, children: option.label }, option.value)) })
|
|
1803
|
+
] }),
|
|
1804
|
+
/* @__PURE__ */ jsxs(Select, { value: currentYear.toString(), onValueChange: handleYearChange, children: [
|
|
1805
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: "w-auto min-w-[100px]", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
1806
|
+
/* @__PURE__ */ jsx(SelectContent, { children: yearOptions.map((option) => /* @__PURE__ */ jsx(SelectItem, { value: option.value, children: option.label }, option.value)) })
|
|
1807
|
+
] })
|
|
1808
|
+
] });
|
|
1809
|
+
});
|
|
1810
|
+
CustomMonthCaption.displayName = "CustomMonthCaption";
|
|
1811
|
+
const CustomMonth = React6.memo(({ calendarMonth, displayIndex, className: className2, children, captionLayout: monthCaptionLayout, startMonth: monthStartMonth, endMonth: monthEndMonth }) => {
|
|
1798
1812
|
const { formatters, components: components2, labels, classNames: classNames2, previousMonth, nextMonth, goToMonth } = useDayPicker();
|
|
1799
1813
|
const caption = formatters.formatCaption(calendarMonth.date, {});
|
|
1800
1814
|
const Chevron = components2?.Chevron;
|
|
1801
|
-
const childrenArray =
|
|
1815
|
+
const childrenArray = React6.Children.toArray(children);
|
|
1802
1816
|
const monthGridIndex = childrenArray.findIndex((child) => {
|
|
1803
|
-
if (!
|
|
1817
|
+
if (!React6.isValidElement(child)) return false;
|
|
1804
1818
|
const childType = child.type;
|
|
1805
1819
|
return typeof childType === "function" && childType.displayName === "MonthGrid" || child.type === "table";
|
|
1806
1820
|
});
|
|
1807
1821
|
return /* @__PURE__ */ jsx(Fragment, { children: childrenArray.map((child, index) => {
|
|
1808
|
-
if (
|
|
1822
|
+
if (React6.isValidElement(child) && child.type?.displayName === "MonthCaption") {
|
|
1809
1823
|
return null;
|
|
1810
1824
|
}
|
|
1811
|
-
if (index === monthGridIndex &&
|
|
1825
|
+
if (index === monthGridIndex && React6.isValidElement(child)) {
|
|
1812
1826
|
const monthGridChild = child;
|
|
1813
1827
|
const applyRootProps = displayIndex === 0 && index === monthGridIndex;
|
|
1814
1828
|
const storedRootProps = applyRootProps ? rootPropsRef.current : null;
|
|
@@ -1858,7 +1872,8 @@ var Calendar = React7.forwardRef(
|
|
|
1858
1872
|
}
|
|
1859
1873
|
assignToRef(monthGridElement.ref, node);
|
|
1860
1874
|
} : void 0;
|
|
1861
|
-
|
|
1875
|
+
const isDropdownLayout = monthCaptionLayout === "dropdown";
|
|
1876
|
+
return React6.cloneElement(
|
|
1862
1877
|
monthGridElement,
|
|
1863
1878
|
{
|
|
1864
1879
|
key: child.key ?? `month-grid-${displayIndex}`,
|
|
@@ -1866,7 +1881,15 @@ var Calendar = React7.forwardRef(
|
|
|
1866
1881
|
...mergedRef ? { ref: mergedRef } : {}
|
|
1867
1882
|
},
|
|
1868
1883
|
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1869
|
-
/* @__PURE__ */ jsx("caption", { className: "relative", children: /* @__PURE__ */
|
|
1884
|
+
/* @__PURE__ */ jsx("caption", { className: "relative", children: isDropdownLayout ? /* @__PURE__ */ jsx(
|
|
1885
|
+
CustomMonthCaption,
|
|
1886
|
+
{
|
|
1887
|
+
displayMonth: calendarMonth.date,
|
|
1888
|
+
startMonth: monthStartMonth,
|
|
1889
|
+
endMonth: monthEndMonth,
|
|
1890
|
+
locale
|
|
1891
|
+
}
|
|
1892
|
+
) : /* @__PURE__ */ jsxs("nav", { className: "relative flex items-center justify-center gap-1", children: [
|
|
1870
1893
|
/* @__PURE__ */ jsx(
|
|
1871
1894
|
"button",
|
|
1872
1895
|
{
|
|
@@ -1913,24 +1936,40 @@ var Calendar = React7.forwardRef(
|
|
|
1913
1936
|
] })
|
|
1914
1937
|
);
|
|
1915
1938
|
}
|
|
1916
|
-
return
|
|
1939
|
+
return React6.isValidElement(child) ? React6.cloneElement(child, { key: child.key ?? `calendar-child-${index}` }) : child;
|
|
1917
1940
|
}) });
|
|
1918
1941
|
});
|
|
1919
1942
|
CustomMonth.displayName = "CustomMonth";
|
|
1920
|
-
const CustomWeekdays =
|
|
1943
|
+
const CustomWeekdays = React6.memo(({ className: className2, children, ...props2 }) => {
|
|
1921
1944
|
return /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { className: cn("text-xs text-sec-500", className2), ...props2, children }) });
|
|
1922
1945
|
});
|
|
1923
1946
|
CustomWeekdays.displayName = "CustomWeekdays";
|
|
1924
|
-
const
|
|
1947
|
+
const CustomMonthWithProps = React6.useCallback((props2) => {
|
|
1948
|
+
return /* @__PURE__ */ jsx(
|
|
1949
|
+
CustomMonth,
|
|
1950
|
+
{
|
|
1951
|
+
...props2,
|
|
1952
|
+
captionLayout,
|
|
1953
|
+
startMonth,
|
|
1954
|
+
endMonth
|
|
1955
|
+
}
|
|
1956
|
+
);
|
|
1957
|
+
}, [captionLayout, startMonth, endMonth]);
|
|
1958
|
+
const CustomMonthCaptionWrapper = React6.memo((_props) => {
|
|
1959
|
+
return null;
|
|
1960
|
+
});
|
|
1961
|
+
CustomMonthCaptionWrapper.displayName = "CustomMonthCaptionWrapper";
|
|
1962
|
+
const defaultComponents = React6.useMemo(() => ({
|
|
1925
1963
|
Root: CustomRoot,
|
|
1926
1964
|
Months: CustomMonths,
|
|
1927
|
-
Month:
|
|
1965
|
+
Month: CustomMonthWithProps,
|
|
1928
1966
|
MonthGrid: CustomMonthGrid,
|
|
1929
|
-
// MonthCaption is
|
|
1967
|
+
// MonthCaption returns null - actual caption is rendered in CustomMonth inside <caption>
|
|
1968
|
+
MonthCaption: CustomMonthCaptionWrapper,
|
|
1930
1969
|
Weekdays: CustomWeekdays,
|
|
1931
1970
|
// Spread user components AFTER ours so ours take precedence
|
|
1932
1971
|
...components || {}
|
|
1933
|
-
}), [components, CustomRoot, CustomMonths,
|
|
1972
|
+
}), [components, CustomRoot, CustomMonths, CustomMonthWithProps, CustomMonthCaptionWrapper, CustomWeekdays]);
|
|
1934
1973
|
return /* @__PURE__ */ jsx(
|
|
1935
1974
|
DayPicker,
|
|
1936
1975
|
{
|
|
@@ -2008,7 +2047,7 @@ var Calendar = React7.forwardRef(
|
|
|
2008
2047
|
);
|
|
2009
2048
|
Calendar.displayName = "Calendar";
|
|
2010
2049
|
var ToastProvider = ToastPrimitives.Provider;
|
|
2011
|
-
var ToastViewport =
|
|
2050
|
+
var ToastViewport = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2012
2051
|
ToastPrimitives.Viewport,
|
|
2013
2052
|
{
|
|
2014
2053
|
ref,
|
|
@@ -2021,7 +2060,7 @@ var ToastViewport = React7.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
2021
2060
|
}
|
|
2022
2061
|
));
|
|
2023
2062
|
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
|
2024
|
-
var Toast =
|
|
2063
|
+
var Toast = React6.forwardRef(({ className, ...props }, ref) => {
|
|
2025
2064
|
return /* @__PURE__ */ jsx(
|
|
2026
2065
|
ToastPrimitives.Root,
|
|
2027
2066
|
{
|
|
@@ -2036,7 +2075,7 @@ var Toast = React7.forwardRef(({ className, ...props }, ref) => {
|
|
|
2036
2075
|
);
|
|
2037
2076
|
});
|
|
2038
2077
|
Toast.displayName = ToastPrimitives.Root.displayName;
|
|
2039
|
-
var ToastAction =
|
|
2078
|
+
var ToastAction = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2040
2079
|
ToastPrimitives.Action,
|
|
2041
2080
|
{
|
|
2042
2081
|
ref,
|
|
@@ -2049,7 +2088,7 @@ var ToastAction = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
2049
2088
|
}
|
|
2050
2089
|
));
|
|
2051
2090
|
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
|
2052
|
-
var ToastClose =
|
|
2091
|
+
var ToastClose = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2053
2092
|
ToastPrimitives.Close,
|
|
2054
2093
|
{
|
|
2055
2094
|
ref,
|
|
@@ -2064,7 +2103,7 @@ var ToastClose = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
2064
2103
|
}
|
|
2065
2104
|
));
|
|
2066
2105
|
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
|
2067
|
-
var ToastTitle =
|
|
2106
|
+
var ToastTitle = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2068
2107
|
ToastPrimitives.Title,
|
|
2069
2108
|
{
|
|
2070
2109
|
ref,
|
|
@@ -2074,7 +2113,7 @@ var ToastTitle = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
2074
2113
|
}
|
|
2075
2114
|
));
|
|
2076
2115
|
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
|
2077
|
-
var ToastDescription =
|
|
2116
|
+
var ToastDescription = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2078
2117
|
ToastPrimitives.Description,
|
|
2079
2118
|
{
|
|
2080
2119
|
ref,
|
|
@@ -2438,7 +2477,7 @@ function FormField({
|
|
|
2438
2477
|
)
|
|
2439
2478
|
] });
|
|
2440
2479
|
}
|
|
2441
|
-
var LoginForm =
|
|
2480
|
+
var LoginForm = React6__default.memo(({
|
|
2442
2481
|
onSignIn,
|
|
2443
2482
|
onSuccess,
|
|
2444
2483
|
onError,
|
|
@@ -2578,36 +2617,6 @@ function ContextSelector({
|
|
|
2578
2617
|
}
|
|
2579
2618
|
return "";
|
|
2580
2619
|
}, [showOrganisations, showEvents, selectedOrganisation?.id, selectedEvent]);
|
|
2581
|
-
const displayValue = useMemo(() => {
|
|
2582
|
-
if (showEvents && selectedEvent) {
|
|
2583
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2584
|
-
/* @__PURE__ */ jsx(Calendar$1, { className: "size-4 flex-shrink-0" }),
|
|
2585
|
-
/* @__PURE__ */ jsx("span", { className: "truncate", children: selectedEvent.event_name })
|
|
2586
|
-
] });
|
|
2587
|
-
}
|
|
2588
|
-
if (showOrganisations && selectedOrganisation) {
|
|
2589
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2590
|
-
/* @__PURE__ */ jsx(Building2, { className: "size-4 flex-shrink-0" }),
|
|
2591
|
-
/* @__PURE__ */ jsx("span", { className: "truncate", children: selectedOrganisation.display_name })
|
|
2592
|
-
] });
|
|
2593
|
-
}
|
|
2594
|
-
return null;
|
|
2595
|
-
}, [showOrganisations, showEvents, selectedOrganisation, selectedEvent]);
|
|
2596
|
-
const effectivePlaceholder = useMemo(() => {
|
|
2597
|
-
if (placeholder !== "Select organisation or event") {
|
|
2598
|
-
return placeholder;
|
|
2599
|
-
}
|
|
2600
|
-
if (showOrganisations && showEvents) {
|
|
2601
|
-
return "Select organisation or event";
|
|
2602
|
-
}
|
|
2603
|
-
if (showOrganisations) {
|
|
2604
|
-
return "Select organisation";
|
|
2605
|
-
}
|
|
2606
|
-
if (showEvents) {
|
|
2607
|
-
return "Select event";
|
|
2608
|
-
}
|
|
2609
|
-
return placeholder;
|
|
2610
|
-
}, [placeholder, showOrganisations, showEvents]);
|
|
2611
2620
|
const handleValueChange = (value) => {
|
|
2612
2621
|
if (disabled || isLoading) return;
|
|
2613
2622
|
if (value.startsWith("org:") && showOrganisations) {
|
|
@@ -2638,8 +2647,9 @@ function ContextSelector({
|
|
|
2638
2647
|
};
|
|
2639
2648
|
if (isLoading && !hasItems) {
|
|
2640
2649
|
const loadingText = compact ? "Loading..." : showOrganisations && showEvents ? "Loading organisations and events..." : showOrganisations ? "Loading organisations..." : "Loading events...";
|
|
2641
|
-
return /* @__PURE__ */ jsxs("
|
|
2650
|
+
return /* @__PURE__ */ jsxs("p", { className, children: [
|
|
2642
2651
|
/* @__PURE__ */ jsx(LoadingSpinner, { size: "sm" }),
|
|
2652
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
2643
2653
|
/* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: loadingText })
|
|
2644
2654
|
] });
|
|
2645
2655
|
}
|
|
@@ -2651,11 +2661,9 @@ function ContextSelector({
|
|
|
2651
2661
|
if (showEvents && eventError) {
|
|
2652
2662
|
errorMessages.push(`Failed to load events: ${eventError.message}`);
|
|
2653
2663
|
}
|
|
2654
|
-
return /* @__PURE__ */ jsxs("
|
|
2655
|
-
/* @__PURE__ */
|
|
2656
|
-
|
|
2657
|
-
/* @__PURE__ */ jsx(AlertDescription, { children: errorMessages.join(" ") })
|
|
2658
|
-
] }),
|
|
2664
|
+
return /* @__PURE__ */ jsxs(Alert, { variant: "destructive", className: `space-y-2 ${className}`, children: [
|
|
2665
|
+
/* @__PURE__ */ jsx(AlertCircle, { className: "size-4" }),
|
|
2666
|
+
/* @__PURE__ */ jsx(AlertDescription, { children: errorMessages.join(" ") }),
|
|
2659
2667
|
showRetryButton && /* @__PURE__ */ jsxs(
|
|
2660
2668
|
Button,
|
|
2661
2669
|
{
|
|
@@ -2675,11 +2683,9 @@ function ContextSelector({
|
|
|
2675
2683
|
if (!hasItems) {
|
|
2676
2684
|
if (showNoItemsMessage) {
|
|
2677
2685
|
const noItemsText = showOrganisations && showEvents ? "No organisations or events available. Please contact your administrator." : showOrganisations ? "No organisations available. Please contact your administrator." : "No events available. Please contact your administrator.";
|
|
2678
|
-
return /* @__PURE__ */ jsxs(
|
|
2679
|
-
/* @__PURE__ */
|
|
2680
|
-
|
|
2681
|
-
/* @__PURE__ */ jsx(AlertDescription, { children: noItemsText })
|
|
2682
|
-
] }),
|
|
2686
|
+
return /* @__PURE__ */ jsxs(Alert, { className: `space-y-2 ${className}`, children: [
|
|
2687
|
+
/* @__PURE__ */ jsx(AlertCircle, { className: "size-4" }),
|
|
2688
|
+
/* @__PURE__ */ jsx(AlertDescription, { children: noItemsText }),
|
|
2683
2689
|
showRetryButton && /* @__PURE__ */ jsxs(
|
|
2684
2690
|
Button,
|
|
2685
2691
|
{
|
|
@@ -2698,12 +2704,44 @@ function ContextSelector({
|
|
|
2698
2704
|
}
|
|
2699
2705
|
return null;
|
|
2700
2706
|
}
|
|
2701
|
-
|
|
2707
|
+
const displayValue = useMemo(() => {
|
|
2708
|
+
if (showEvents && selectedEvent) {
|
|
2709
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2710
|
+
/* @__PURE__ */ jsx(Calendar$1, { className: "inline-block size-4 mr-2" }),
|
|
2711
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: selectedEvent.event_name })
|
|
2712
|
+
] });
|
|
2713
|
+
}
|
|
2714
|
+
if (showOrganisations && selectedOrganisation) {
|
|
2715
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2716
|
+
/* @__PURE__ */ jsx(Building2, { className: "inline-block size-4 mr-2" }),
|
|
2717
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: selectedOrganisation.display_name })
|
|
2718
|
+
] });
|
|
2719
|
+
}
|
|
2720
|
+
return null;
|
|
2721
|
+
}, [showOrganisations, showEvents, selectedOrganisation, selectedEvent]);
|
|
2722
|
+
const effectivePlaceholder = useMemo(() => {
|
|
2723
|
+
if (placeholder !== "Select organisation or event") {
|
|
2724
|
+
return placeholder;
|
|
2725
|
+
}
|
|
2726
|
+
if (showOrganisations && showEvents) {
|
|
2727
|
+
return "Select organisation or event";
|
|
2728
|
+
}
|
|
2729
|
+
if (showOrganisations) {
|
|
2730
|
+
return "Select organisation";
|
|
2731
|
+
}
|
|
2732
|
+
if (showEvents) {
|
|
2733
|
+
return "Select event";
|
|
2734
|
+
}
|
|
2735
|
+
return placeholder;
|
|
2736
|
+
}, [placeholder, showOrganisations, showEvents]);
|
|
2737
|
+
return /* @__PURE__ */ jsxs(
|
|
2702
2738
|
Select,
|
|
2703
2739
|
{
|
|
2704
2740
|
value: currentValue,
|
|
2705
2741
|
onValueChange: handleValueChange,
|
|
2706
2742
|
disabled: disabled || isLoading,
|
|
2743
|
+
className,
|
|
2744
|
+
"data-testid": "context-selector",
|
|
2707
2745
|
children: [
|
|
2708
2746
|
/* @__PURE__ */ jsx(
|
|
2709
2747
|
SelectTrigger,
|
|
@@ -2717,17 +2755,16 @@ function ContextSelector({
|
|
|
2717
2755
|
showOrganisations && organisations && organisations.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2718
2756
|
/* @__PURE__ */ jsxs(SelectGroup, { children: [
|
|
2719
2757
|
/* @__PURE__ */ jsx(SelectLabel, { children: "Organisations" }),
|
|
2720
|
-
organisations.map((org) => /* @__PURE__ */
|
|
2758
|
+
organisations.map((org) => /* @__PURE__ */ jsxs(
|
|
2721
2759
|
SelectItem,
|
|
2722
2760
|
{
|
|
2723
2761
|
value: `org:${org.id}`,
|
|
2724
|
-
children:
|
|
2725
|
-
/* @__PURE__ */ jsx(Building2, { className: "size-4" }),
|
|
2726
|
-
/* @__PURE__ */
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
] })
|
|
2762
|
+
children: [
|
|
2763
|
+
/* @__PURE__ */ jsx(Building2, { className: "inline-block size-4 mr-2" }),
|
|
2764
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium", children: org.display_name }),
|
|
2765
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
2766
|
+
!compact && org.description && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: org.description })
|
|
2767
|
+
]
|
|
2731
2768
|
},
|
|
2732
2769
|
org.id
|
|
2733
2770
|
))
|
|
@@ -2736,17 +2773,16 @@ function ContextSelector({
|
|
|
2736
2773
|
] }),
|
|
2737
2774
|
showEvents && events && events.length > 0 && /* @__PURE__ */ jsxs(SelectGroup, { children: [
|
|
2738
2775
|
/* @__PURE__ */ jsx(SelectLabel, { children: "Events" }),
|
|
2739
|
-
events.map((event) => /* @__PURE__ */
|
|
2776
|
+
events.map((event) => /* @__PURE__ */ jsxs(
|
|
2740
2777
|
SelectItem,
|
|
2741
2778
|
{
|
|
2742
2779
|
value: `event:${event.event_id || event.id}`,
|
|
2743
|
-
children:
|
|
2744
|
-
/* @__PURE__ */ jsx(Calendar$1, { className: "size-4" }),
|
|
2745
|
-
/* @__PURE__ */
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
] })
|
|
2780
|
+
children: [
|
|
2781
|
+
/* @__PURE__ */ jsx(Calendar$1, { className: " inline-block size-4 mr-2" }),
|
|
2782
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium", children: event.event_name }),
|
|
2783
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
2784
|
+
!compact && event.event_date && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: new Date(event.event_date).toLocaleDateString() })
|
|
2785
|
+
]
|
|
2750
2786
|
},
|
|
2751
2787
|
event.event_id || event.id
|
|
2752
2788
|
))
|
|
@@ -2754,7 +2790,7 @@ function ContextSelector({
|
|
|
2754
2790
|
] })
|
|
2755
2791
|
]
|
|
2756
2792
|
}
|
|
2757
|
-
)
|
|
2793
|
+
);
|
|
2758
2794
|
}
|
|
2759
2795
|
function PasswordChangeForm({ onSubmit, onSuccess, className }) {
|
|
2760
2796
|
const [newPassword, setNewPassword] = useState("");
|
|
@@ -2830,7 +2866,7 @@ function PasswordChangeForm({ onSubmit, onSuccess, className }) {
|
|
|
2830
2866
|
)
|
|
2831
2867
|
] });
|
|
2832
2868
|
}
|
|
2833
|
-
var UserMenu =
|
|
2869
|
+
var UserMenu = React6__default.memo(function UserMenu2({
|
|
2834
2870
|
user,
|
|
2835
2871
|
onSignOut,
|
|
2836
2872
|
onChangePassword,
|
|
@@ -2912,7 +2948,7 @@ var UserMenu = React7__default.memo(function UserMenu2({
|
|
|
2912
2948
|
] }) })
|
|
2913
2949
|
] });
|
|
2914
2950
|
});
|
|
2915
|
-
var UserMenuLoading =
|
|
2951
|
+
var UserMenuLoading = React6__default.memo(function UserMenuLoading2() {
|
|
2916
2952
|
return /* @__PURE__ */ jsxs(
|
|
2917
2953
|
Button,
|
|
2918
2954
|
{
|
|
@@ -2935,8 +2971,8 @@ function useNavigationFiltering({
|
|
|
2935
2971
|
itemsPreFiltered = false,
|
|
2936
2972
|
auditLog = true
|
|
2937
2973
|
}) {
|
|
2938
|
-
const [resolvedAppId, setResolvedAppId] =
|
|
2939
|
-
const previousFilteredItemsRef =
|
|
2974
|
+
const [resolvedAppId, setResolvedAppId] = React6.useState(void 0);
|
|
2975
|
+
const previousFilteredItemsRef = React6.useRef([]);
|
|
2940
2976
|
const authContext = useUnifiedAuth();
|
|
2941
2977
|
const rbacContext = useRBAC();
|
|
2942
2978
|
const eventLoadingRaw = authContext?.eventLoading;
|
|
@@ -2951,7 +2987,7 @@ function useNavigationFiltering({
|
|
|
2951
2987
|
selectedEventId: itemsPreFiltered ? null : selectedEvent?.event_id || null,
|
|
2952
2988
|
selectedEventOrganisationId: itemsPreFiltered ? null : selectedEvent?.organisation_id || null
|
|
2953
2989
|
});
|
|
2954
|
-
|
|
2990
|
+
React6.useEffect(() => {
|
|
2955
2991
|
if (!scopeLoading && !resolvedScope?.appId && selectedOrganisation?.id && authContext?.appName && authContext?.user?.id && !resolvedAppId) {
|
|
2956
2992
|
if (!authContext.user || !authContext.appName) {
|
|
2957
2993
|
return;
|
|
@@ -2979,7 +3015,7 @@ function useNavigationFiltering({
|
|
|
2979
3015
|
authContext?.user?.id,
|
|
2980
3016
|
resolvedAppId
|
|
2981
3017
|
]);
|
|
2982
|
-
const effectiveScope =
|
|
3018
|
+
const effectiveScope = React6.useMemo(() => {
|
|
2983
3019
|
if (resolvedScope?.organisationId) {
|
|
2984
3020
|
return resolvedScope;
|
|
2985
3021
|
}
|
|
@@ -2994,7 +3030,7 @@ function useNavigationFiltering({
|
|
|
2994
3030
|
return null;
|
|
2995
3031
|
}, [resolvedScope, selectedOrganisation?.id, selectedEvent?.event_id, resolvedAppId]);
|
|
2996
3032
|
const scopeKey = effectiveScope ? `${effectiveScope.organisationId || ""}-${effectiveScope.eventId || ""}-${effectiveScope.appId || ""}` : "empty";
|
|
2997
|
-
const stableScope =
|
|
3033
|
+
const stableScope = React6.useMemo(() => {
|
|
2998
3034
|
if (effectiveScope?.organisationId) {
|
|
2999
3035
|
return {
|
|
3000
3036
|
organisationId: effectiveScope.organisationId,
|
|
@@ -3020,7 +3056,7 @@ function useNavigationFiltering({
|
|
|
3020
3056
|
itemsPreFiltered ? void 0 : stableScope.eventId,
|
|
3021
3057
|
itemsPreFiltered ? void 0 : stableScope.appId
|
|
3022
3058
|
);
|
|
3023
|
-
const filteredItems =
|
|
3059
|
+
const filteredItems = React6.useMemo(() => {
|
|
3024
3060
|
if (itemsPreFiltered && items && items.length > 0) {
|
|
3025
3061
|
const visibleItems = (items || []).filter((item) => !item.meta?.hidden);
|
|
3026
3062
|
previousFilteredItemsRef.current = visibleItems;
|
|
@@ -3199,7 +3235,7 @@ function useNavigationFiltering({
|
|
|
3199
3235
|
hasAnyPermission: hasAnyPermission || null
|
|
3200
3236
|
};
|
|
3201
3237
|
}
|
|
3202
|
-
var NavigationMenu =
|
|
3238
|
+
var NavigationMenu = React6.forwardRef(({
|
|
3203
3239
|
items,
|
|
3204
3240
|
mode = "dropdown",
|
|
3205
3241
|
currentPath,
|
|
@@ -3217,8 +3253,8 @@ var NavigationMenu = React7.forwardRef(({
|
|
|
3217
3253
|
itemsPreFiltered = false,
|
|
3218
3254
|
...props
|
|
3219
3255
|
}, ref) => {
|
|
3220
|
-
const [expandedItems, setExpandedItems] =
|
|
3221
|
-
const buttonRef =
|
|
3256
|
+
const [expandedItems, setExpandedItems] = React6.useState(/* @__PURE__ */ new Set());
|
|
3257
|
+
const buttonRef = React6.useRef(null);
|
|
3222
3258
|
const { authContext, rbacContext, filteredItems, permissionMap, hasAnyPermission } = useNavigationFiltering({ items, itemsPreFiltered, auditLog });
|
|
3223
3259
|
const handleHierarchicalKeyDown = (event, item) => {
|
|
3224
3260
|
switch (event.key) {
|
|
@@ -3360,7 +3396,7 @@ var NavigationMenu = React7.forwardRef(({
|
|
|
3360
3396
|
id: `submenu-${item.id}`,
|
|
3361
3397
|
role: "menu",
|
|
3362
3398
|
"aria-label": `${item.label} submenu`,
|
|
3363
|
-
children: item.children.map((child) => /* @__PURE__ */ jsx(
|
|
3399
|
+
children: item.children.map((child) => /* @__PURE__ */ jsx(React6.Fragment, { children: renderHierarchicalItem(child, level + 1) }, child.id))
|
|
3364
3400
|
}
|
|
3365
3401
|
)
|
|
3366
3402
|
] }) : /* @__PURE__ */ jsx(
|
|
@@ -3422,7 +3458,7 @@ var NavigationMenu = React7.forwardRef(({
|
|
|
3422
3458
|
className,
|
|
3423
3459
|
"aria-label": navigationLabel,
|
|
3424
3460
|
...props,
|
|
3425
|
-
children: /* @__PURE__ */ jsx("ul", { role: "menubar", children: filteredItems.map((item) => /* @__PURE__ */ jsx(
|
|
3461
|
+
children: /* @__PURE__ */ jsx("ul", { role: "menubar", children: filteredItems.map((item) => /* @__PURE__ */ jsx(React6.Fragment, { children: renderHierarchicalItem(item, 0) }, item.id)) })
|
|
3426
3462
|
}
|
|
3427
3463
|
);
|
|
3428
3464
|
});
|
|
@@ -3545,7 +3581,7 @@ var FooterComponent = ({
|
|
|
3545
3581
|
] }) });
|
|
3546
3582
|
};
|
|
3547
3583
|
FooterComponent.displayName = "Footer";
|
|
3548
|
-
var Footer =
|
|
3584
|
+
var Footer = React6__default.memo(FooterComponent);
|
|
3549
3585
|
Footer.displayName = "Footer";
|
|
3550
3586
|
var EMPTY_PAGE_ID_MAPPING = {};
|
|
3551
3587
|
var EMPTY_ROUTE_PERMISSIONS = {};
|
|
@@ -4311,7 +4347,7 @@ function ProtectedRoute({
|
|
|
4311
4347
|
return /* @__PURE__ */ jsx(Outlet, {});
|
|
4312
4348
|
}
|
|
4313
4349
|
if (isLoading && !sessionRestoration.hasTimedOut) {
|
|
4314
|
-
return loadingFallback || /* @__PURE__ */ jsx("
|
|
4350
|
+
return loadingFallback || /* @__PURE__ */ jsx("main", { className: "grid place-items-center size-full", children: /* @__PURE__ */ jsx(LoadingSpinner, {}) });
|
|
4315
4351
|
}
|
|
4316
4352
|
if (!isAuthenticated) {
|
|
4317
4353
|
if (sessionRestoration.hasTimedOut || sessionRestoration.restorationError) {
|
|
@@ -4326,13 +4362,13 @@ function ProtectedRoute({
|
|
|
4326
4362
|
}
|
|
4327
4363
|
const isTabVisible = typeof document !== "undefined" && !document.hidden;
|
|
4328
4364
|
if (tabJustBecameVisibleRef.current || isTabVisible && wasAuthenticatedRef.current && isLoading) {
|
|
4329
|
-
return loadingFallback || /* @__PURE__ */ jsx("
|
|
4365
|
+
return loadingFallback || /* @__PURE__ */ jsx("main", { className: "grid place-items-center size-full", children: /* @__PURE__ */ jsx(LoadingSpinner, {}) });
|
|
4330
4366
|
}
|
|
4331
4367
|
if (shouldRedirect) {
|
|
4332
4368
|
return /* @__PURE__ */ jsx(Navigate, { to: loginPath, replace: true });
|
|
4333
4369
|
}
|
|
4334
4370
|
if (isLoading) {
|
|
4335
|
-
return loadingFallback || /* @__PURE__ */ jsx("
|
|
4371
|
+
return loadingFallback || /* @__PURE__ */ jsx("main", { className: "grid place-items-center size-full", children: /* @__PURE__ */ jsx(LoadingSpinner, {}) });
|
|
4336
4372
|
}
|
|
4337
4373
|
return /* @__PURE__ */ jsx(Navigate, { to: loginPath, replace: true });
|
|
4338
4374
|
}
|
|
@@ -4340,7 +4376,7 @@ function ProtectedRoute({
|
|
|
4340
4376
|
return /* @__PURE__ */ jsx(Outlet, {});
|
|
4341
4377
|
}
|
|
4342
4378
|
if (!events || events.length === 0) {
|
|
4343
|
-
return noEventsFallback || /* @__PURE__ */ jsx("
|
|
4379
|
+
return noEventsFallback || /* @__PURE__ */ jsx("main", { className: "grid place-items-center text-center min-h-screen p-8", children: /* @__PURE__ */ jsxs(Alert, { variant: "destructive", className: "max-w-md", children: [
|
|
4344
4380
|
/* @__PURE__ */ jsx(AlertTitle, { children: "No Events Available" }),
|
|
4345
4381
|
/* @__PURE__ */ jsx(AlertDescription, { children: "You don't have access to any events. Please contact your administrator if you believe this is an error." })
|
|
4346
4382
|
] }) });
|
|
@@ -4689,9 +4725,9 @@ function FileUpload({
|
|
|
4689
4725
|
};
|
|
4690
4726
|
const dragClasses = isDragging ? "border-main-500 bg-main-50" : "border-sec-300 hover:border-sec-400";
|
|
4691
4727
|
const disabledClasses = isDisabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:bg-sec-50";
|
|
4692
|
-
return /* @__PURE__ */ jsxs(
|
|
4728
|
+
return /* @__PURE__ */ jsxs(Card, { className, children: [
|
|
4693
4729
|
/* @__PURE__ */ jsxs(
|
|
4694
|
-
|
|
4730
|
+
CardHeader,
|
|
4695
4731
|
{
|
|
4696
4732
|
role: "button",
|
|
4697
4733
|
tabIndex: isDisabled ? -1 : 0,
|
|
@@ -4709,7 +4745,7 @@ function FileUpload({
|
|
|
4709
4745
|
}
|
|
4710
4746
|
} : void 0,
|
|
4711
4747
|
children: [
|
|
4712
|
-
children || /* @__PURE__ */ jsxs(
|
|
4748
|
+
children || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4713
4749
|
/* @__PURE__ */ jsx(
|
|
4714
4750
|
"input",
|
|
4715
4751
|
{
|
|
@@ -4724,64 +4760,58 @@ function FileUpload({
|
|
|
4724
4760
|
"aria-label": accept ? `Upload file${multiple ? "s" : ""} (${accept})` : `Upload file${multiple ? "s" : ""}`
|
|
4725
4761
|
}
|
|
4726
4762
|
),
|
|
4727
|
-
/* @__PURE__ */ jsx("
|
|
4728
|
-
|
|
4763
|
+
/* @__PURE__ */ jsx("p", { className: "text-sec-600", children: isResolvingAppId ? "Resolving app configuration..." : isDragging ? "Drop files here..." : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4764
|
+
"Click to upload",
|
|
4729
4765
|
" ",
|
|
4730
4766
|
"or drag and drop"
|
|
4731
4767
|
] }) }),
|
|
4732
|
-
/* @__PURE__ */ jsxs("
|
|
4768
|
+
/* @__PURE__ */ jsxs("p", { className: "text-sm text-sec-500", children: [
|
|
4733
4769
|
!isResolvingAppId && accept !== "*/*" && `Accepted formats: ${accept}`,
|
|
4734
4770
|
!isResolvingAppId && maxSize && ` \u2022 Max size: ${Math.round(maxSize / 1024 / 1024)}MB`,
|
|
4735
4771
|
!isResolvingAppId && multiple && " \u2022 Multiple files allowed"
|
|
4736
4772
|
] })
|
|
4737
4773
|
] }),
|
|
4738
|
-
isUploading && !showProgress && /* @__PURE__ */ jsx(
|
|
4739
|
-
"div",
|
|
4740
|
-
{
|
|
4741
|
-
className: "absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center",
|
|
4742
|
-
role: "status",
|
|
4743
|
-
"aria-live": "polite",
|
|
4744
|
-
"aria-label": "Uploading file",
|
|
4745
|
-
children: /* @__PURE__ */ jsx("div", { className: "animate-spin rounded-full size-8 border-b-2 border-main-500", "aria-hidden": "true" })
|
|
4746
|
-
}
|
|
4747
|
-
)
|
|
4774
|
+
isUploading && !showProgress && /* @__PURE__ */ jsx(LoadingSpinner, { size: "lg", className: "text-main-500" })
|
|
4748
4775
|
]
|
|
4749
4776
|
}
|
|
4750
4777
|
),
|
|
4751
|
-
showProgress && uploadStates.size > 0 && /* @__PURE__ */ jsx(
|
|
4778
|
+
showProgress && uploadStates.size > 0 && /* @__PURE__ */ jsx(CardContent, { children: Array.from(uploadStates.entries()).map(([fileId, uploadState]) => {
|
|
4752
4779
|
const { file, progress, preview, result } = uploadState;
|
|
4753
4780
|
const isError = progress.status === "error";
|
|
4754
4781
|
const isCompleted = progress.status === "completed";
|
|
4755
4782
|
const isUploading2 = progress.status === "uploading" || progress.status === "processing";
|
|
4756
4783
|
return /* @__PURE__ */ jsxs(
|
|
4757
|
-
|
|
4784
|
+
Card,
|
|
4758
4785
|
{
|
|
4759
|
-
className: `
|
|
4786
|
+
className: `grid grid-cols-[auto_1fr_auto] items-center gap-3 ${isError ? "bg-acc-50 border-acc-200" : isCompleted ? "bg-success-50 border-success-200" : "bg-sec-50 border-sec-200"}`,
|
|
4760
4787
|
children: [
|
|
4761
|
-
/* @__PURE__ */ jsx(
|
|
4788
|
+
/* @__PURE__ */ jsx(CardHeader, { className: "p-0", children: preview ? /* @__PURE__ */ jsx(
|
|
4762
4789
|
"img",
|
|
4763
4790
|
{
|
|
4764
4791
|
src: preview,
|
|
4765
4792
|
alt: file.name,
|
|
4766
|
-
className: "
|
|
4793
|
+
className: "size-12 object-cover rounded"
|
|
4767
4794
|
}
|
|
4768
|
-
) : /* @__PURE__ */ jsx(
|
|
4769
|
-
/* @__PURE__ */ jsxs(
|
|
4770
|
-
/* @__PURE__ */ jsx(
|
|
4771
|
-
/* @__PURE__ */ jsxs(
|
|
4795
|
+
) : /* @__PURE__ */ jsx(File, { className: "size-12 text-sec-600" }) }),
|
|
4796
|
+
/* @__PURE__ */ jsxs(CardContent, { className: "p-0 min-w-0", children: [
|
|
4797
|
+
/* @__PURE__ */ jsx(CardTitle, { className: "text-base truncate", children: file.name }),
|
|
4798
|
+
/* @__PURE__ */ jsxs(CardDescription, { children: [
|
|
4772
4799
|
formatFileSize(file.size),
|
|
4773
4800
|
isCompleted && result && " \u2022 Uploaded",
|
|
4774
4801
|
isError && progress.error && ` \u2022 ${progress.error}`
|
|
4775
4802
|
] }),
|
|
4776
|
-
showProgress && (isUploading2 || isError) && /* @__PURE__ */ jsxs(
|
|
4777
|
-
/* @__PURE__ */ jsx(
|
|
4778
|
-
|
|
4803
|
+
showProgress && (isUploading2 || isError) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4804
|
+
/* @__PURE__ */ jsx(
|
|
4805
|
+
Progress,
|
|
4779
4806
|
{
|
|
4780
|
-
|
|
4781
|
-
|
|
4807
|
+
value: progress.percentage,
|
|
4808
|
+
max: 100,
|
|
4809
|
+
style: {
|
|
4810
|
+
accentColor: isError ? "var(--color-acc-500)" : "var(--color-main-500)"
|
|
4811
|
+
}
|
|
4782
4812
|
}
|
|
4783
|
-
)
|
|
4784
|
-
isUploading2 && /* @__PURE__ */ jsxs("
|
|
4813
|
+
),
|
|
4814
|
+
isUploading2 && /* @__PURE__ */ jsxs("p", { children: [
|
|
4785
4815
|
progress.percentage,
|
|
4786
4816
|
"% \u2022 ",
|
|
4787
4817
|
formatFileSize(progress.loaded),
|
|
@@ -4790,118 +4820,22 @@ function FileUpload({
|
|
|
4790
4820
|
] })
|
|
4791
4821
|
] })
|
|
4792
4822
|
] }),
|
|
4793
|
-
/* @__PURE__ */ jsxs(
|
|
4794
|
-
isCompleted && /* @__PURE__ */ jsx(
|
|
4795
|
-
isError && /* @__PURE__ */ jsx(
|
|
4796
|
-
isUploading2 && /* @__PURE__ */ jsx(
|
|
4797
|
-
"div",
|
|
4798
|
-
{
|
|
4799
|
-
className: "animate-spin rounded-full size-5 border-b-2 border-main-500",
|
|
4800
|
-
role: "status",
|
|
4801
|
-
"aria-label": "Uploading",
|
|
4802
|
-
"aria-hidden": "true"
|
|
4803
|
-
}
|
|
4804
|
-
)
|
|
4823
|
+
/* @__PURE__ */ jsxs(CardFooter, { className: "p-0", children: [
|
|
4824
|
+
isCompleted && /* @__PURE__ */ jsx(Check, { className: "text-success-500 size-5" }),
|
|
4825
|
+
isError && /* @__PURE__ */ jsx(X, { className: "text-acc-500 size-5" }),
|
|
4826
|
+
isUploading2 && /* @__PURE__ */ jsx(LoadingSpinner, { size: "sm", className: "text-main-500" })
|
|
4805
4827
|
] })
|
|
4806
4828
|
]
|
|
4807
4829
|
},
|
|
4808
4830
|
fileId
|
|
4809
4831
|
);
|
|
4810
4832
|
}) }),
|
|
4811
|
-
appIdError && /* @__PURE__ */
|
|
4812
|
-
"
|
|
4813
|
-
{
|
|
4814
|
-
|
|
4815
|
-
role: "alert",
|
|
4816
|
-
"aria-live": "assertive",
|
|
4817
|
-
children: appIdError
|
|
4818
|
-
}
|
|
4819
|
-
),
|
|
4820
|
-
error && /* @__PURE__ */ jsx(
|
|
4821
|
-
"div",
|
|
4822
|
-
{
|
|
4823
|
-
className: "p-3 bg-acc-50 border border-acc-200 rounded-lg text-sm text-acc-600",
|
|
4824
|
-
role: "alert",
|
|
4825
|
-
"aria-live": "assertive",
|
|
4826
|
-
children: error
|
|
4827
|
-
}
|
|
4828
|
-
)
|
|
4833
|
+
(appIdError || error) && /* @__PURE__ */ jsxs(CardFooter, { children: [
|
|
4834
|
+
appIdError && /* @__PURE__ */ jsx("p", { className: "grid place-items-center text-center size-full", role: "alert", "aria-live": "assertive", children: appIdError }),
|
|
4835
|
+
error && /* @__PURE__ */ jsx("p", { className: "grid place-items-center text-center size-full", role: "alert", "aria-live": "assertive", children: error })
|
|
4836
|
+
] })
|
|
4829
4837
|
] });
|
|
4830
4838
|
}
|
|
4831
|
-
var Table = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4832
|
-
"table",
|
|
4833
|
-
{
|
|
4834
|
-
ref,
|
|
4835
|
-
className: cn("w-full caption-bottom text-sm", className),
|
|
4836
|
-
...props
|
|
4837
|
-
}
|
|
4838
|
-
));
|
|
4839
|
-
Table.displayName = "Table";
|
|
4840
|
-
var TableHeader = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
4841
|
-
TableHeader.displayName = "TableHeader";
|
|
4842
|
-
var TableBody = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4843
|
-
"tbody",
|
|
4844
|
-
{
|
|
4845
|
-
ref,
|
|
4846
|
-
className: cn("[&_tr:last-child]:border-0", className),
|
|
4847
|
-
...props
|
|
4848
|
-
}
|
|
4849
|
-
));
|
|
4850
|
-
TableBody.displayName = "TableBody";
|
|
4851
|
-
var TableFooter = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4852
|
-
"tfoot",
|
|
4853
|
-
{
|
|
4854
|
-
ref,
|
|
4855
|
-
className: cn(
|
|
4856
|
-
"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
|
|
4857
|
-
className
|
|
4858
|
-
),
|
|
4859
|
-
...props
|
|
4860
|
-
}
|
|
4861
|
-
));
|
|
4862
|
-
TableFooter.displayName = "TableFooter";
|
|
4863
|
-
var TableRow = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4864
|
-
"tr",
|
|
4865
|
-
{
|
|
4866
|
-
ref,
|
|
4867
|
-
className: cn(
|
|
4868
|
-
"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
|
|
4869
|
-
className
|
|
4870
|
-
),
|
|
4871
|
-
...props
|
|
4872
|
-
}
|
|
4873
|
-
));
|
|
4874
|
-
TableRow.displayName = "TableRow";
|
|
4875
|
-
var TableHead = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4876
|
-
"th",
|
|
4877
|
-
{
|
|
4878
|
-
ref,
|
|
4879
|
-
className: cn(
|
|
4880
|
-
"h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
|
|
4881
|
-
className
|
|
4882
|
-
),
|
|
4883
|
-
...props
|
|
4884
|
-
}
|
|
4885
|
-
));
|
|
4886
|
-
TableHead.displayName = "TableHead";
|
|
4887
|
-
var TableCell = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4888
|
-
"td",
|
|
4889
|
-
{
|
|
4890
|
-
ref,
|
|
4891
|
-
className: cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className),
|
|
4892
|
-
...props
|
|
4893
|
-
}
|
|
4894
|
-
));
|
|
4895
|
-
TableCell.displayName = "TableCell";
|
|
4896
|
-
var TableCaption = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4897
|
-
"caption",
|
|
4898
|
-
{
|
|
4899
|
-
ref,
|
|
4900
|
-
className: cn("mt-4 text-sm text-muted-foreground", className),
|
|
4901
|
-
...props
|
|
4902
|
-
}
|
|
4903
|
-
));
|
|
4904
|
-
TableCaption.displayName = "TableCaption";
|
|
4905
4839
|
function PublicPageHeader({
|
|
4906
4840
|
event,
|
|
4907
4841
|
eventCode,
|
|
@@ -5039,4 +4973,4 @@ function PublicPageLayout({
|
|
|
5039
4973
|
] }) });
|
|
5040
4974
|
}
|
|
5041
4975
|
|
|
5042
|
-
export { AddressField, Avatar, Badge, Calendar, ContextSelector, FileDisplay, FileUpload, Footer, Form, FormField, Header,
|
|
4976
|
+
export { AddressField, Avatar, Badge, Calendar, ContextSelector, FileDisplay, FileUpload, Footer, Form, FormField, Header, LoginForm, NavigationMenu, PaceAppLayout, PaceLoginPage, PasswordChangeForm, ProtectedRoute, PublicPageFooter, PublicPageHeader, PublicPageLayout, SessionRestorationLoader, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, UserMenu, useFileReference, useFileReferenceById, useFileReferenceForRecord, useFilesByCategory };
|