@jmruthers/pace-core 0.5.139 → 0.5.141
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/{DataTable-JXFCA2BJ.js → DataTable-EGIN2NKK.js} +3 -3
- package/dist/{EventLogo-rFL_kRjk.d.ts → EventLogo-B3V3otev.d.ts} +307 -1
- package/dist/{chunk-BOOI7GK2.js → chunk-3R472UXR.js} +117 -1
- package/dist/chunk-3R472UXR.js.map +1 -0
- package/dist/{chunk-5JMOHWDI.js → chunk-ALUN6O3G.js} +492 -324
- package/dist/chunk-ALUN6O3G.js.map +1 -0
- package/dist/{chunk-6DXZ6V5Q.js → chunk-PZV3XZKJ.js} +2 -2
- package/dist/{chunk-TLT2ZR3L.js → chunk-WKTQM2IC.js} +2 -2
- package/dist/components.d.ts +3 -1
- package/dist/components.js +15 -3
- package/dist/components.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +18 -4
- package/dist/index.js.map +1 -1
- package/dist/rbac/index.d.ts +94 -1
- package/dist/rbac/index.js +4 -2
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +17 -5
- package/dist/utils.js.map +1 -1
- package/docs/api/README.md +2 -2
- package/docs/api/classes/ColumnFactory.md +1 -1
- package/docs/api/classes/ErrorBoundary.md +1 -1
- package/docs/api/classes/InvalidScopeError.md +1 -1
- package/docs/api/classes/MissingUserContextError.md +1 -1
- package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
- package/docs/api/classes/PermissionDeniedError.md +1 -1
- package/docs/api/classes/PublicErrorBoundary.md +1 -1
- package/docs/api/classes/RBACAuditManager.md +1 -1
- package/docs/api/classes/RBACCache.md +1 -1
- package/docs/api/classes/RBACEngine.md +1 -1
- package/docs/api/classes/RBACError.md +1 -1
- package/docs/api/classes/RBACNotInitializedError.md +1 -1
- package/docs/api/classes/SecureSupabaseClient.md +1 -1
- package/docs/api/classes/StorageUtils.md +1 -1
- package/docs/api/enums/FileCategory.md +1 -1
- package/docs/api/interfaces/AggregateConfig.md +1 -1
- package/docs/api/interfaces/BadgeProps.md +1 -1
- package/docs/api/interfaces/ButtonProps.md +1 -1
- package/docs/api/interfaces/CalendarProps.md +40 -0
- package/docs/api/interfaces/CardProps.md +1 -1
- package/docs/api/interfaces/ColorPalette.md +1 -1
- package/docs/api/interfaces/ColorShade.md +1 -1
- package/docs/api/interfaces/DataAccessRecord.md +1 -1
- package/docs/api/interfaces/DataRecord.md +1 -1
- package/docs/api/interfaces/DataTableAction.md +1 -1
- package/docs/api/interfaces/DataTableColumn.md +1 -1
- package/docs/api/interfaces/DataTableProps.md +1 -1
- package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
- package/docs/api/interfaces/EmptyStateConfig.md +1 -1
- package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
- package/docs/api/interfaces/EventAppRoleData.md +1 -1
- package/docs/api/interfaces/EventLogoProps.md +1 -1
- package/docs/api/interfaces/ExportColumn.md +1 -1
- package/docs/api/interfaces/ExportOptions.md +1 -1
- package/docs/api/interfaces/FileDisplayProps.md +1 -1
- package/docs/api/interfaces/FileMetadata.md +1 -1
- package/docs/api/interfaces/FileReference.md +1 -1
- package/docs/api/interfaces/FileSizeLimits.md +1 -1
- package/docs/api/interfaces/FileUploadOptions.md +1 -1
- package/docs/api/interfaces/FileUploadProps.md +1 -1
- package/docs/api/interfaces/FooterProps.md +1 -1
- package/docs/api/interfaces/GrantEventAppRoleParams.md +1 -1
- package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
- package/docs/api/interfaces/InputProps.md +1 -1
- package/docs/api/interfaces/LabelProps.md +1 -1
- package/docs/api/interfaces/LoginFormProps.md +1 -1
- package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
- package/docs/api/interfaces/NavigationContextType.md +1 -1
- package/docs/api/interfaces/NavigationGuardProps.md +1 -1
- package/docs/api/interfaces/NavigationItem.md +1 -1
- package/docs/api/interfaces/NavigationMenuProps.md +1 -1
- package/docs/api/interfaces/NavigationProviderProps.md +1 -1
- package/docs/api/interfaces/Organisation.md +1 -1
- package/docs/api/interfaces/OrganisationContextType.md +1 -1
- package/docs/api/interfaces/OrganisationMembership.md +1 -1
- package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
- package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
- package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
- package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
- package/docs/api/interfaces/PageAccessRecord.md +1 -1
- package/docs/api/interfaces/PagePermissionContextType.md +1 -1
- package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
- package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
- package/docs/api/interfaces/PaletteData.md +1 -1
- package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
- package/docs/api/interfaces/ProtectedRouteProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
- package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
- package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
- package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
- package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
- package/docs/api/interfaces/RBACConfig.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/ResourcePermissions.md +155 -0
- package/docs/api/interfaces/RevokeEventAppRoleParams.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
- package/docs/api/interfaces/RoleManagementResult.md +1 -1
- package/docs/api/interfaces/RouteAccessRecord.md +1 -1
- package/docs/api/interfaces/RouteConfig.md +1 -1
- package/docs/api/interfaces/SecureDataContextType.md +1 -1
- package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
- package/docs/api/interfaces/SessionRestorationLoaderProps.md +1 -1
- package/docs/api/interfaces/StorageConfig.md +1 -1
- package/docs/api/interfaces/StorageFileInfo.md +1 -1
- package/docs/api/interfaces/StorageFileMetadata.md +1 -1
- package/docs/api/interfaces/StorageListOptions.md +1 -1
- package/docs/api/interfaces/StorageListResult.md +1 -1
- package/docs/api/interfaces/StorageUploadOptions.md +1 -1
- package/docs/api/interfaces/StorageUploadResult.md +1 -1
- package/docs/api/interfaces/StorageUrlOptions.md +1 -1
- package/docs/api/interfaces/StyleImport.md +1 -1
- package/docs/api/interfaces/SwitchProps.md +1 -1
- package/docs/api/interfaces/TabsContentProps.md +9 -0
- package/docs/api/interfaces/TabsListProps.md +9 -0
- package/docs/api/interfaces/TabsProps.md +9 -0
- package/docs/api/interfaces/TabsTriggerProps.md +9 -0
- package/docs/api/interfaces/TextareaProps.md +53 -0
- package/docs/api/interfaces/ToastActionElement.md +1 -1
- package/docs/api/interfaces/ToastProps.md +1 -1
- package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
- package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
- package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
- package/docs/api/interfaces/UsePublicFileDisplayOptions.md +1 -1
- package/docs/api/interfaces/UsePublicFileDisplayReturn.md +1 -1
- package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeOptions.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
- package/docs/api/interfaces/UseResourcePermissionsOptions.md +34 -0
- package/docs/api/interfaces/UserEventAccess.md +1 -1
- package/docs/api/interfaces/UserMenuProps.md +1 -1
- package/docs/api/interfaces/UserProfile.md +1 -1
- package/docs/api/modules.md +289 -2
- package/docs/getting-started/examples/basic-auth-app.md +196 -0
- package/docs/getting-started/examples/full-featured-app.md +616 -0
- package/package.json +3 -1
- package/src/components/Calendar/Calendar.test.tsx +338 -0
- package/src/components/Calendar/Calendar.tsx +192 -0
- package/src/components/Calendar/index.ts +10 -0
- package/src/components/Tabs/Tabs.test.tsx +439 -0
- package/src/components/Tabs/Tabs.tsx +202 -0
- package/src/components/Tabs/index.ts +10 -0
- package/src/components/Textarea/Textarea.test.tsx +269 -0
- package/src/components/Textarea/Textarea.tsx +133 -0
- package/src/components/Textarea/index.ts +10 -0
- package/src/components/index.ts +11 -0
- package/src/index.ts +11 -0
- package/src/rbac/hooks/index.ts +2 -0
- package/src/rbac/hooks/useResourcePermissions.test.ts +633 -0
- package/src/rbac/hooks/useResourcePermissions.ts +235 -0
- package/src/utils/performance/bundleAnalysis.ts +17 -3
- package/dist/chunk-5JMOHWDI.js.map +0 -1
- package/dist/chunk-BOOI7GK2.js.map +0 -1
- /package/dist/{DataTable-JXFCA2BJ.js.map → DataTable-EGIN2NKK.js.map} +0 -0
- /package/dist/{chunk-6DXZ6V5Q.js.map → chunk-PZV3XZKJ.js.map} +0 -0
- /package/dist/{chunk-TLT2ZR3L.js.map → chunk-WKTQM2IC.js.map} +0 -0
|
@@ -25,13 +25,13 @@ import {
|
|
|
25
25
|
SelectSeparator,
|
|
26
26
|
SelectTrigger,
|
|
27
27
|
SelectValue
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-WKTQM2IC.js";
|
|
29
29
|
import {
|
|
30
30
|
useCan,
|
|
31
31
|
usePermissions,
|
|
32
32
|
useRBAC,
|
|
33
33
|
useResolvedScope
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-3R472UXR.js";
|
|
35
35
|
import {
|
|
36
36
|
isSuperAdmin
|
|
37
37
|
} from "./chunk-BVYWGZVV.js";
|
|
@@ -179,11 +179,43 @@ var Label = React.forwardRef(({
|
|
|
179
179
|
});
|
|
180
180
|
Label.displayName = LabelPrimitive.Root.displayName;
|
|
181
181
|
|
|
182
|
-
// src/components/
|
|
182
|
+
// src/components/Textarea/Textarea.tsx
|
|
183
183
|
import * as React2 from "react";
|
|
184
|
-
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
185
184
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
186
|
-
var
|
|
185
|
+
var Textarea = React2.forwardRef(
|
|
186
|
+
({ className, variant = "default", size = "md", error, ...props }, ref) => {
|
|
187
|
+
return /* @__PURE__ */ jsx2(
|
|
188
|
+
"textarea",
|
|
189
|
+
{
|
|
190
|
+
className: cn(
|
|
191
|
+
// Base styles (matching Input component)
|
|
192
|
+
"flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
193
|
+
// Variant styles
|
|
194
|
+
{
|
|
195
|
+
"border-input": variant === "default" && !error,
|
|
196
|
+
"border-destructive focus-visible:ring-destructive": variant === "destructive" || error
|
|
197
|
+
},
|
|
198
|
+
// Size styles
|
|
199
|
+
{
|
|
200
|
+
"min-h-[60px] px-2 py-1 text-xs": size === "sm",
|
|
201
|
+
"min-h-[80px] px-3 py-2 text-sm": size === "md",
|
|
202
|
+
"min-h-[100px] px-4 py-3 text-base": size === "lg"
|
|
203
|
+
},
|
|
204
|
+
className
|
|
205
|
+
),
|
|
206
|
+
ref,
|
|
207
|
+
...props
|
|
208
|
+
}
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
);
|
|
212
|
+
Textarea.displayName = "Textarea";
|
|
213
|
+
|
|
214
|
+
// src/components/Avatar/Avatar.tsx
|
|
215
|
+
import * as React3 from "react";
|
|
216
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
217
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
218
|
+
var Avatar = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
187
219
|
AvatarPrimitive.Root,
|
|
188
220
|
{
|
|
189
221
|
ref,
|
|
@@ -195,7 +227,7 @@ var Avatar = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
195
227
|
}
|
|
196
228
|
));
|
|
197
229
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
198
|
-
var AvatarImage =
|
|
230
|
+
var AvatarImage = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
199
231
|
AvatarPrimitive.Image,
|
|
200
232
|
{
|
|
201
233
|
ref,
|
|
@@ -204,7 +236,7 @@ var AvatarImage = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
204
236
|
}
|
|
205
237
|
));
|
|
206
238
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
207
|
-
var AvatarFallback =
|
|
239
|
+
var AvatarFallback = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
|
|
208
240
|
AvatarPrimitive.Fallback,
|
|
209
241
|
{
|
|
210
242
|
ref,
|
|
@@ -218,8 +250,8 @@ var AvatarFallback = React2.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
218
250
|
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
219
251
|
|
|
220
252
|
// src/components/Badge/Badge.tsx
|
|
221
|
-
import * as
|
|
222
|
-
import { jsx as
|
|
253
|
+
import * as React4 from "react";
|
|
254
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
223
255
|
var shadeConfig = {
|
|
224
256
|
muted: {
|
|
225
257
|
bg: 200,
|
|
@@ -283,7 +315,7 @@ function getBadgeClasses(variant = "solid-main-normal") {
|
|
|
283
315
|
const baseClasses = "inline-flex text-balance items-center rounded-2xl px-3 py-1 text-xs font-medium transition-colors box-border";
|
|
284
316
|
return `${baseClasses} ${variantClassesMap[variant]}`;
|
|
285
317
|
}
|
|
286
|
-
var Badge =
|
|
318
|
+
var Badge = React4.forwardRef(
|
|
287
319
|
({ className, variant = "solid-main-normal", ...props }, ref) => {
|
|
288
320
|
const isSoftVariant = variant.startsWith("soft-");
|
|
289
321
|
if (isSoftVariant) {
|
|
@@ -293,7 +325,7 @@ var Badge = React3.forwardRef(
|
|
|
293
325
|
const classesWithoutShadows = variantClasses.replace(/\bshadow-badge-soft\b/g, "").replace(/\bshadow-\w+-\d+\b/g, "").replace(/\s+/g, " ").trim();
|
|
294
326
|
const mergedClasses = cn(classesWithoutShadows, className);
|
|
295
327
|
const finalClasses = `${mergedClasses} shadow-badge-soft ${shadowColorClass}`.trim();
|
|
296
|
-
return /* @__PURE__ */
|
|
328
|
+
return /* @__PURE__ */ jsx4(
|
|
297
329
|
"span",
|
|
298
330
|
{
|
|
299
331
|
ref,
|
|
@@ -302,7 +334,7 @@ var Badge = React3.forwardRef(
|
|
|
302
334
|
}
|
|
303
335
|
);
|
|
304
336
|
}
|
|
305
|
-
return /* @__PURE__ */
|
|
337
|
+
return /* @__PURE__ */ jsx4(
|
|
306
338
|
"span",
|
|
307
339
|
{
|
|
308
340
|
ref,
|
|
@@ -315,10 +347,10 @@ var Badge = React3.forwardRef(
|
|
|
315
347
|
Badge.displayName = "Badge";
|
|
316
348
|
|
|
317
349
|
// src/components/Switch/Switch.tsx
|
|
318
|
-
import * as
|
|
350
|
+
import * as React5 from "react";
|
|
319
351
|
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
320
|
-
import { jsx as
|
|
321
|
-
var Switch =
|
|
352
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
353
|
+
var Switch = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
|
|
322
354
|
SwitchPrimitive.Root,
|
|
323
355
|
{
|
|
324
356
|
className: cn(
|
|
@@ -340,7 +372,7 @@ var Switch = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
340
372
|
),
|
|
341
373
|
...props,
|
|
342
374
|
ref,
|
|
343
|
-
children: /* @__PURE__ */
|
|
375
|
+
children: /* @__PURE__ */ jsx5(
|
|
344
376
|
SwitchPrimitive.Thumb,
|
|
345
377
|
{
|
|
346
378
|
className: cn(
|
|
@@ -360,13 +392,143 @@ var Switch = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
360
392
|
));
|
|
361
393
|
Switch.displayName = SwitchPrimitive.Root.displayName;
|
|
362
394
|
|
|
395
|
+
// src/components/Tabs/Tabs.tsx
|
|
396
|
+
import * as React6 from "react";
|
|
397
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
398
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
399
|
+
var Tabs = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx6(TabsPrimitive.Root, { ref, ...props }));
|
|
400
|
+
Tabs.displayName = TabsPrimitive.Root.displayName || "Tabs";
|
|
401
|
+
var TabsList = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx6(
|
|
402
|
+
TabsPrimitive.List,
|
|
403
|
+
{
|
|
404
|
+
ref,
|
|
405
|
+
className: cn(
|
|
406
|
+
"inline-flex h-10 items-center justify-center rounded-md bg-sec-100 p-1 text-sec-600",
|
|
407
|
+
className
|
|
408
|
+
),
|
|
409
|
+
...props
|
|
410
|
+
}
|
|
411
|
+
));
|
|
412
|
+
TabsList.displayName = TabsPrimitive.List.displayName || "TabsList";
|
|
413
|
+
var TabsTrigger = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx6(
|
|
414
|
+
TabsPrimitive.Trigger,
|
|
415
|
+
{
|
|
416
|
+
ref,
|
|
417
|
+
className: cn(
|
|
418
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-main-600 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
419
|
+
"data-[state=active]:bg-background data-[state=active]:text-main-600 data-[state=active]:shadow-sm",
|
|
420
|
+
"data-[state=inactive]:text-sec-600 data-[state=inactive]:hover:text-main-600",
|
|
421
|
+
className
|
|
422
|
+
),
|
|
423
|
+
...props
|
|
424
|
+
}
|
|
425
|
+
));
|
|
426
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName || "TabsTrigger";
|
|
427
|
+
var TabsContent = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx6(
|
|
428
|
+
TabsPrimitive.Content,
|
|
429
|
+
{
|
|
430
|
+
ref,
|
|
431
|
+
className: cn(
|
|
432
|
+
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-main-600 focus-visible:ring-offset-2",
|
|
433
|
+
className
|
|
434
|
+
),
|
|
435
|
+
...props
|
|
436
|
+
}
|
|
437
|
+
));
|
|
438
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName || "TabsContent";
|
|
439
|
+
|
|
440
|
+
// src/components/Calendar/Calendar.tsx
|
|
441
|
+
import * as React7 from "react";
|
|
442
|
+
import { DayPicker } from "react-day-picker";
|
|
443
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
444
|
+
var Calendar = React7.forwardRef(
|
|
445
|
+
({ className, classNames, mode, ...props }, ref) => {
|
|
446
|
+
return /* @__PURE__ */ jsx7("div", { ref, className: cn("p-3", className), children: /* @__PURE__ */ jsx7(
|
|
447
|
+
DayPicker,
|
|
448
|
+
{
|
|
449
|
+
mode,
|
|
450
|
+
className: "rounded-md border border-sec-200 bg-background",
|
|
451
|
+
classNames: {
|
|
452
|
+
months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
|
|
453
|
+
month: "space-y-4",
|
|
454
|
+
caption: "flex justify-center pt-1 relative items-center",
|
|
455
|
+
caption_label: "text-sm font-medium",
|
|
456
|
+
nav: "space-x-1 flex items-center",
|
|
457
|
+
nav_button: cn(
|
|
458
|
+
"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",
|
|
459
|
+
"border border-input hover:bg-acc-100",
|
|
460
|
+
"inline-flex items-center justify-center rounded-md",
|
|
461
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-main-600 focus-visible:ring-offset-2"
|
|
462
|
+
),
|
|
463
|
+
nav_button_previous: "absolute left-1",
|
|
464
|
+
nav_button_next: "absolute right-1",
|
|
465
|
+
table: "w-full border-collapse space-y-1",
|
|
466
|
+
head_row: "flex",
|
|
467
|
+
head_cell: "text-sec-600 rounded-md w-9 font-normal text-[0.8rem]",
|
|
468
|
+
row: "flex w-full mt-2",
|
|
469
|
+
cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-acc-50/50 [&:has([aria-selected])]:bg-acc-100 first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
|
|
470
|
+
day: cn(
|
|
471
|
+
"h-9 w-9 p-0 font-normal aria-selected:opacity-100",
|
|
472
|
+
"hover:bg-acc-100 hover:text-main-600",
|
|
473
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-main-600 focus-visible:ring-offset-2",
|
|
474
|
+
"inline-flex items-center justify-center rounded-md"
|
|
475
|
+
),
|
|
476
|
+
day_range_end: "day-range-end",
|
|
477
|
+
day_selected: "bg-main-600 text-main-50 hover:bg-main-600 hover:text-main-50 focus:bg-main-600 focus:text-main-50",
|
|
478
|
+
day_today: "bg-sec-100 text-main-600 font-semibold",
|
|
479
|
+
day_outside: "day-outside text-sec-400 opacity-50 aria-selected:bg-acc-50/50 aria-selected:text-sec-400 aria-selected:opacity-30",
|
|
480
|
+
day_disabled: "text-sec-400 opacity-50 cursor-not-allowed",
|
|
481
|
+
day_range_middle: "aria-selected:bg-acc-100 aria-selected:text-main-600",
|
|
482
|
+
day_hidden: "invisible",
|
|
483
|
+
...classNames
|
|
484
|
+
},
|
|
485
|
+
components: {
|
|
486
|
+
IconLeft: ({ ...props2 }) => /* @__PURE__ */ jsx7(
|
|
487
|
+
"svg",
|
|
488
|
+
{
|
|
489
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
490
|
+
viewBox: "0 0 24 24",
|
|
491
|
+
fill: "none",
|
|
492
|
+
stroke: "currentColor",
|
|
493
|
+
strokeWidth: "2",
|
|
494
|
+
strokeLinecap: "round",
|
|
495
|
+
strokeLinejoin: "round",
|
|
496
|
+
className: "h-4 w-4",
|
|
497
|
+
...props2,
|
|
498
|
+
children: /* @__PURE__ */ jsx7("path", { d: "m15 18-6-6 6-6" })
|
|
499
|
+
}
|
|
500
|
+
),
|
|
501
|
+
IconRight: ({ ...props2 }) => /* @__PURE__ */ jsx7(
|
|
502
|
+
"svg",
|
|
503
|
+
{
|
|
504
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
505
|
+
viewBox: "0 0 24 24",
|
|
506
|
+
fill: "none",
|
|
507
|
+
stroke: "currentColor",
|
|
508
|
+
strokeWidth: "2",
|
|
509
|
+
strokeLinecap: "round",
|
|
510
|
+
strokeLinejoin: "round",
|
|
511
|
+
className: "h-4 w-4",
|
|
512
|
+
...props2,
|
|
513
|
+
children: /* @__PURE__ */ jsx7("path", { d: "m9 18 6-6-6-6" })
|
|
514
|
+
}
|
|
515
|
+
),
|
|
516
|
+
...props.components
|
|
517
|
+
},
|
|
518
|
+
...props
|
|
519
|
+
}
|
|
520
|
+
) });
|
|
521
|
+
}
|
|
522
|
+
);
|
|
523
|
+
Calendar.displayName = "Calendar";
|
|
524
|
+
|
|
363
525
|
// src/components/Toast/Toast.tsx
|
|
364
|
-
import * as
|
|
526
|
+
import * as React8 from "react";
|
|
365
527
|
import * as ToastPrimitives from "@radix-ui/react-toast";
|
|
366
528
|
import { X } from "lucide-react";
|
|
367
|
-
import { jsx as
|
|
529
|
+
import { jsx as jsx8, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
368
530
|
var ToastProvider = ToastPrimitives.Provider;
|
|
369
|
-
var ToastViewport =
|
|
531
|
+
var ToastViewport = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
370
532
|
ToastPrimitives.Viewport,
|
|
371
533
|
{
|
|
372
534
|
ref,
|
|
@@ -379,8 +541,8 @@ var ToastViewport = React5.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
379
541
|
}
|
|
380
542
|
));
|
|
381
543
|
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
|
382
|
-
var Toast =
|
|
383
|
-
return /* @__PURE__ */
|
|
544
|
+
var Toast = React8.forwardRef(({ className, ...props }, ref) => {
|
|
545
|
+
return /* @__PURE__ */ jsx8(
|
|
384
546
|
ToastPrimitives.Root,
|
|
385
547
|
{
|
|
386
548
|
ref,
|
|
@@ -394,7 +556,7 @@ var Toast = React5.forwardRef(({ className, ...props }, ref) => {
|
|
|
394
556
|
);
|
|
395
557
|
});
|
|
396
558
|
Toast.displayName = ToastPrimitives.Root.displayName;
|
|
397
|
-
var ToastAction =
|
|
559
|
+
var ToastAction = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
398
560
|
ToastPrimitives.Action,
|
|
399
561
|
{
|
|
400
562
|
ref,
|
|
@@ -407,7 +569,7 @@ var ToastAction = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
407
569
|
}
|
|
408
570
|
));
|
|
409
571
|
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
|
410
|
-
var ToastClose =
|
|
572
|
+
var ToastClose = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
411
573
|
ToastPrimitives.Close,
|
|
412
574
|
{
|
|
413
575
|
ref,
|
|
@@ -418,11 +580,11 @@ var ToastClose = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
418
580
|
),
|
|
419
581
|
"toast-close": "",
|
|
420
582
|
...props,
|
|
421
|
-
children: /* @__PURE__ */
|
|
583
|
+
children: /* @__PURE__ */ jsx8(X, { className: "h-4 w-4" })
|
|
422
584
|
}
|
|
423
585
|
));
|
|
424
586
|
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
|
425
|
-
var ToastTitle =
|
|
587
|
+
var ToastTitle = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
426
588
|
ToastPrimitives.Title,
|
|
427
589
|
{
|
|
428
590
|
ref,
|
|
@@ -432,7 +594,7 @@ var ToastTitle = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
432
594
|
}
|
|
433
595
|
));
|
|
434
596
|
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
|
435
|
-
var ToastDescription =
|
|
597
|
+
var ToastDescription = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
436
598
|
ToastPrimitives.Description,
|
|
437
599
|
{
|
|
438
600
|
ref,
|
|
@@ -445,14 +607,14 @@ ToastDescription.displayName = ToastPrimitives.Description.displayName;
|
|
|
445
607
|
function Toaster() {
|
|
446
608
|
const { toasts } = useToast();
|
|
447
609
|
return /* @__PURE__ */ jsxs2(ToastProvider, { "data-testid": "toast-provider", children: [
|
|
448
|
-
/* @__PURE__ */
|
|
610
|
+
/* @__PURE__ */ jsx8(ToastViewport, {}),
|
|
449
611
|
toasts.map((toast) => {
|
|
450
612
|
const { id, title, description, action, dismiss, duration, ...toastProps } = toast;
|
|
451
613
|
return /* @__PURE__ */ jsxs2(Toast, { ...toastProps, duration, children: [
|
|
452
|
-
title && /* @__PURE__ */
|
|
453
|
-
description && /* @__PURE__ */
|
|
614
|
+
title && /* @__PURE__ */ jsx8(ToastTitle, { children: title }),
|
|
615
|
+
description && /* @__PURE__ */ jsx8(ToastDescription, { children: description }),
|
|
454
616
|
action && action,
|
|
455
|
-
/* @__PURE__ */
|
|
617
|
+
/* @__PURE__ */ jsx8(ToastClose, { onClick: dismiss })
|
|
456
618
|
] }, id);
|
|
457
619
|
})
|
|
458
620
|
] });
|
|
@@ -461,7 +623,7 @@ function Toaster() {
|
|
|
461
623
|
// src/components/Form/Form.tsx
|
|
462
624
|
import { useForm, FormProvider } from "react-hook-form";
|
|
463
625
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
464
|
-
import { jsx as
|
|
626
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
465
627
|
function Form({
|
|
466
628
|
schema,
|
|
467
629
|
defaultValues,
|
|
@@ -477,13 +639,13 @@ function Form({
|
|
|
477
639
|
mode
|
|
478
640
|
});
|
|
479
641
|
const handleSubmit = methods.handleSubmit(onSubmit, onError);
|
|
480
|
-
return /* @__PURE__ */
|
|
642
|
+
return /* @__PURE__ */ jsx9(FormProvider, { ...methods, children: /* @__PURE__ */ jsx9("form", { onSubmit: handleSubmit, className: cn("space-y-4", className), children: typeof children === "function" ? children(methods) : children }) });
|
|
481
643
|
}
|
|
482
644
|
|
|
483
645
|
// src/components/LoginForm/LoginForm.tsx
|
|
484
|
-
import
|
|
485
|
-
import { jsx as
|
|
486
|
-
var LoginForm =
|
|
646
|
+
import React9, { useState, useCallback, useMemo } from "react";
|
|
647
|
+
import { jsx as jsx10, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
648
|
+
var LoginForm = React9.memo(({
|
|
487
649
|
onSignIn,
|
|
488
650
|
onSuccess,
|
|
489
651
|
onError,
|
|
@@ -524,15 +686,15 @@ var LoginForm = React6.memo(({
|
|
|
524
686
|
}, [onSignUp]);
|
|
525
687
|
const displayTitle = useMemo(() => title || (appName ? `Sign in to ${appName}` : "Sign In"), [title, appName]);
|
|
526
688
|
const displaySubtitle = useMemo(() => subtitle || "Enter your credentials to continue.", [subtitle]);
|
|
527
|
-
return /* @__PURE__ */
|
|
689
|
+
return /* @__PURE__ */ jsx10(Card, { className: cn("w-full max-w-md mx-auto", className), children: /* @__PURE__ */ jsxs3("form", { onSubmit: handleSubmit, "data-testid": "login-form", children: [
|
|
528
690
|
/* @__PURE__ */ jsxs3(CardHeader, { className: "space-y-1", children: [
|
|
529
|
-
/* @__PURE__ */
|
|
530
|
-
/* @__PURE__ */
|
|
691
|
+
/* @__PURE__ */ jsx10(CardTitle, { className: "text-2xl text-center", children: displayTitle }),
|
|
692
|
+
/* @__PURE__ */ jsx10(CardDescription, { className: "text-center", children: displaySubtitle })
|
|
531
693
|
] }),
|
|
532
694
|
/* @__PURE__ */ jsxs3(CardContent, { className: "space-y-4", children: [
|
|
533
|
-
error && /* @__PURE__ */
|
|
534
|
-
/* @__PURE__ */
|
|
535
|
-
/* @__PURE__ */
|
|
695
|
+
error && /* @__PURE__ */ jsx10(Alert, { variant: "destructive", children: /* @__PURE__ */ jsx10(AlertDescription, { children: error }) }),
|
|
696
|
+
/* @__PURE__ */ jsx10(Label, { htmlFor: "email", children: "Email" }),
|
|
697
|
+
/* @__PURE__ */ jsx10(
|
|
536
698
|
Input,
|
|
537
699
|
{
|
|
538
700
|
id: "email",
|
|
@@ -544,8 +706,8 @@ var LoginForm = React6.memo(({
|
|
|
544
706
|
disabled: isLoading
|
|
545
707
|
}
|
|
546
708
|
),
|
|
547
|
-
/* @__PURE__ */
|
|
548
|
-
/* @__PURE__ */
|
|
709
|
+
/* @__PURE__ */ jsx10(Label, { htmlFor: "password", children: "Password" }),
|
|
710
|
+
/* @__PURE__ */ jsx10(
|
|
549
711
|
Input,
|
|
550
712
|
{
|
|
551
713
|
id: "password",
|
|
@@ -559,7 +721,7 @@ var LoginForm = React6.memo(({
|
|
|
559
721
|
)
|
|
560
722
|
] }),
|
|
561
723
|
/* @__PURE__ */ jsxs3(CardFooter, { className: "flex flex-col space-y-4", children: [
|
|
562
|
-
/* @__PURE__ */
|
|
724
|
+
/* @__PURE__ */ jsx10(
|
|
563
725
|
Button,
|
|
564
726
|
{
|
|
565
727
|
type: "submit",
|
|
@@ -568,7 +730,7 @@ var LoginForm = React6.memo(({
|
|
|
568
730
|
children: isLoading ? "Signing in..." : "Sign In"
|
|
569
731
|
}
|
|
570
732
|
),
|
|
571
|
-
showSignUp && (onSignUp ? /* @__PURE__ */
|
|
733
|
+
showSignUp && (onSignUp ? /* @__PURE__ */ jsx10("div", { className: "text-sm text-center text-muted-foreground", children: /* @__PURE__ */ jsx10(
|
|
572
734
|
"button",
|
|
573
735
|
{
|
|
574
736
|
type: "button",
|
|
@@ -579,17 +741,17 @@ var LoginForm = React6.memo(({
|
|
|
579
741
|
) }) : /* @__PURE__ */ jsxs3("p", { className: "text-center text-muted-foreground", children: [
|
|
580
742
|
"Don't have an account?",
|
|
581
743
|
" ",
|
|
582
|
-
/* @__PURE__ */
|
|
744
|
+
/* @__PURE__ */ jsx10("a", { href: "/signup", className: "text-primary hover:underline", children: "Sign up" })
|
|
583
745
|
] }))
|
|
584
746
|
] })
|
|
585
747
|
] }) });
|
|
586
748
|
});
|
|
587
749
|
|
|
588
750
|
// src/components/EventSelector/EventSelector.tsx
|
|
589
|
-
import { RefreshCw, AlertCircle, Lock, Calendar, Star } from "lucide-react";
|
|
751
|
+
import { RefreshCw, AlertCircle, Lock, Calendar as Calendar2, Star } from "lucide-react";
|
|
590
752
|
init_logger();
|
|
591
753
|
import { useEffect, useMemo as useMemo2 } from "react";
|
|
592
|
-
import { jsx as
|
|
754
|
+
import { jsx as jsx11, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
593
755
|
function EventSelector({
|
|
594
756
|
placeholder = "Select an event",
|
|
595
757
|
className,
|
|
@@ -685,15 +847,15 @@ function EventSelector({
|
|
|
685
847
|
}, [events, selectedEvent, setSelectedEvent, onEventChange, isLoading]);
|
|
686
848
|
if (isLoading) {
|
|
687
849
|
return /* @__PURE__ */ jsxs4("div", { className: `flex items-center gap-2 ${className}`, children: [
|
|
688
|
-
/* @__PURE__ */
|
|
689
|
-
/* @__PURE__ */
|
|
850
|
+
/* @__PURE__ */ jsx11(LoadingSpinner, { size: "sm" }),
|
|
851
|
+
/* @__PURE__ */ jsx11("span", { className: "text-sm text-muted-foreground", children: "Loading events..." })
|
|
690
852
|
] });
|
|
691
853
|
}
|
|
692
854
|
if (error) {
|
|
693
|
-
return /* @__PURE__ */
|
|
694
|
-
/* @__PURE__ */
|
|
855
|
+
return /* @__PURE__ */ jsx11("div", { className, children: /* @__PURE__ */ jsxs4(Alert, { variant: "destructive", children: [
|
|
856
|
+
/* @__PURE__ */ jsx11(Lock, { className: "h-4 w-4" }),
|
|
695
857
|
/* @__PURE__ */ jsxs4(AlertDescription, { className: "flex items-center justify-between", children: [
|
|
696
|
-
/* @__PURE__ */
|
|
858
|
+
/* @__PURE__ */ jsx11("span", { children: error.message }),
|
|
697
859
|
showRetryButton && /* @__PURE__ */ jsxs4(
|
|
698
860
|
Button,
|
|
699
861
|
{
|
|
@@ -702,7 +864,7 @@ function EventSelector({
|
|
|
702
864
|
onClick: handleRetry,
|
|
703
865
|
className: "ml-2",
|
|
704
866
|
children: [
|
|
705
|
-
/* @__PURE__ */
|
|
867
|
+
/* @__PURE__ */ jsx11(RefreshCw, { className: "h-3 w-3 mr-1" }),
|
|
706
868
|
"Retry"
|
|
707
869
|
]
|
|
708
870
|
}
|
|
@@ -712,10 +874,10 @@ function EventSelector({
|
|
|
712
874
|
}
|
|
713
875
|
if (events.length === 0) {
|
|
714
876
|
if (showNoEventsMessage) {
|
|
715
|
-
return /* @__PURE__ */
|
|
716
|
-
/* @__PURE__ */
|
|
877
|
+
return /* @__PURE__ */ jsx11("div", { className, children: /* @__PURE__ */ jsxs4(Alert, { variant: "inline", children: [
|
|
878
|
+
/* @__PURE__ */ jsx11(AlertCircle, { className: "h-4 w-4 text-acc-700" }),
|
|
717
879
|
/* @__PURE__ */ jsxs4(AlertDescription, { className: "flex items-center justify-between", children: [
|
|
718
|
-
/* @__PURE__ */
|
|
880
|
+
/* @__PURE__ */ jsx11("span", { children: "No events available." }),
|
|
719
881
|
showRetryButton && /* @__PURE__ */ jsxs4(
|
|
720
882
|
Button,
|
|
721
883
|
{
|
|
@@ -724,7 +886,7 @@ function EventSelector({
|
|
|
724
886
|
onClick: handleRetry,
|
|
725
887
|
className: "ml-2",
|
|
726
888
|
children: [
|
|
727
|
-
/* @__PURE__ */
|
|
889
|
+
/* @__PURE__ */ jsx11(RefreshCw, { className: "h-3 w-3 mr-1" }),
|
|
728
890
|
"Refresh"
|
|
729
891
|
]
|
|
730
892
|
}
|
|
@@ -741,34 +903,34 @@ function EventSelector({
|
|
|
741
903
|
onValueChange: handleValueChange,
|
|
742
904
|
className,
|
|
743
905
|
children: [
|
|
744
|
-
/* @__PURE__ */
|
|
745
|
-
/* @__PURE__ */
|
|
746
|
-
/* @__PURE__ */
|
|
906
|
+
/* @__PURE__ */ jsx11(SelectTrigger, { className: "text-left", variant: "outline", children: /* @__PURE__ */ jsx11(SelectValue, { placeholder, children: selectedEvent && /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
|
|
907
|
+
/* @__PURE__ */ jsx11(Calendar2, { className: "h-4 w-4 flex-shrink-0" }),
|
|
908
|
+
/* @__PURE__ */ jsx11("span", { className: "truncate", children: selectedEvent.event_name || selectedEvent.name }),
|
|
747
909
|
selectedEvent.event_date && /* @__PURE__ */ jsxs4("span", { className: "text-xs text-muted-foreground flex-shrink-0", children: [
|
|
748
910
|
"(",
|
|
749
911
|
formatEventDate(selectedEvent.event_date),
|
|
750
912
|
")"
|
|
751
913
|
] })
|
|
752
914
|
] }) }) }),
|
|
753
|
-
/* @__PURE__ */
|
|
915
|
+
/* @__PURE__ */ jsx11(SelectContent, { children: sortedEvents.map((event) => {
|
|
754
916
|
const isNext = isNextEvent(event);
|
|
755
917
|
const isSelected = selectedEvent && (selectedEvent.event_id === event.event_id || selectedEvent.id === event.id);
|
|
756
|
-
return /* @__PURE__ */
|
|
918
|
+
return /* @__PURE__ */ jsx11(
|
|
757
919
|
SelectItem,
|
|
758
920
|
{
|
|
759
921
|
value: event.event_id || event.id,
|
|
760
922
|
className: "flex items-center justify-between",
|
|
761
923
|
children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2 w-full", children: [
|
|
762
|
-
showNextEventIndicator && isNext && /* @__PURE__ */
|
|
924
|
+
showNextEventIndicator && isNext && /* @__PURE__ */ jsx11(Star, { className: "h-3 w-3 text-acc-500" }),
|
|
763
925
|
/* @__PURE__ */ jsxs4("div", { className: "flex-1", children: [
|
|
764
926
|
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
|
|
765
|
-
/* @__PURE__ */
|
|
766
|
-
isSelected && /* @__PURE__ */
|
|
927
|
+
/* @__PURE__ */ jsx11("span", { className: isSelected ? "font-semibold" : "", children: event.event_name || event.name }),
|
|
928
|
+
isSelected && /* @__PURE__ */ jsx11("span", { className: "text-xs bg-primary text-primary-foreground px-1 rounded", children: "Current" })
|
|
767
929
|
] }),
|
|
768
930
|
showEventDetails && event.event_date && /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
769
|
-
/* @__PURE__ */
|
|
770
|
-
/* @__PURE__ */
|
|
771
|
-
showNextEventIndicator && isNext && /* @__PURE__ */
|
|
931
|
+
/* @__PURE__ */ jsx11(Calendar2, { className: "h-3 w-3" }),
|
|
932
|
+
/* @__PURE__ */ jsx11("span", { children: formatEventDate(event.event_date) }),
|
|
933
|
+
showNextEventIndicator && isNext && /* @__PURE__ */ jsx11("span", { className: "text-acc-600 font-medium", children: "(Next)" })
|
|
772
934
|
] }),
|
|
773
935
|
showEventDetails && event.event_venue && /* @__PURE__ */ jsxs4("div", { className: "text-xs text-muted-foreground", children: [
|
|
774
936
|
"\u{1F4CD} ",
|
|
@@ -787,7 +949,7 @@ function EventSelector({
|
|
|
787
949
|
|
|
788
950
|
// src/components/PasswordReset/PasswordChangeForm.tsx
|
|
789
951
|
import { useState as useState2 } from "react";
|
|
790
|
-
import { jsx as
|
|
952
|
+
import { jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
791
953
|
function PasswordChangeForm({ onSubmit, className }) {
|
|
792
954
|
const [newPassword, setNewPassword] = useState2("");
|
|
793
955
|
const [confirmPassword, setConfirmPassword] = useState2("");
|
|
@@ -817,10 +979,10 @@ function PasswordChangeForm({ onSubmit, className }) {
|
|
|
817
979
|
}
|
|
818
980
|
};
|
|
819
981
|
return /* @__PURE__ */ jsxs5("form", { onSubmit: handleSubmit, className: cn("space-y-4", className), children: [
|
|
820
|
-
error && /* @__PURE__ */
|
|
982
|
+
error && /* @__PURE__ */ jsx12("div", { role: "alert", children: error }),
|
|
821
983
|
/* @__PURE__ */ jsxs5("div", { className: "space-y-2", children: [
|
|
822
|
-
/* @__PURE__ */
|
|
823
|
-
/* @__PURE__ */
|
|
984
|
+
/* @__PURE__ */ jsx12(Label, { htmlFor: "new-password", children: "New Password" }),
|
|
985
|
+
/* @__PURE__ */ jsx12(
|
|
824
986
|
Input,
|
|
825
987
|
{
|
|
826
988
|
id: "new-password",
|
|
@@ -833,8 +995,8 @@ function PasswordChangeForm({ onSubmit, className }) {
|
|
|
833
995
|
)
|
|
834
996
|
] }),
|
|
835
997
|
/* @__PURE__ */ jsxs5("div", { className: "space-y-2", children: [
|
|
836
|
-
/* @__PURE__ */
|
|
837
|
-
/* @__PURE__ */
|
|
998
|
+
/* @__PURE__ */ jsx12(Label, { htmlFor: "confirm-password", children: "Confirm Password" }),
|
|
999
|
+
/* @__PURE__ */ jsx12(
|
|
838
1000
|
Input,
|
|
839
1001
|
{
|
|
840
1002
|
id: "confirm-password",
|
|
@@ -846,7 +1008,7 @@ function PasswordChangeForm({ onSubmit, className }) {
|
|
|
846
1008
|
}
|
|
847
1009
|
)
|
|
848
1010
|
] }),
|
|
849
|
-
/* @__PURE__ */
|
|
1011
|
+
/* @__PURE__ */ jsx12(
|
|
850
1012
|
Button,
|
|
851
1013
|
{
|
|
852
1014
|
type: "submit",
|
|
@@ -859,10 +1021,10 @@ function PasswordChangeForm({ onSubmit, className }) {
|
|
|
859
1021
|
}
|
|
860
1022
|
|
|
861
1023
|
// src/components/UserMenu/UserMenu.tsx
|
|
862
|
-
import
|
|
1024
|
+
import React11, { useCallback as useCallback2, useMemo as useMemo3, useState as useState3 } from "react";
|
|
863
1025
|
import { ChevronDown, LogOut, KeyRound } from "lucide-react";
|
|
864
|
-
import { jsx as
|
|
865
|
-
var UserMenu =
|
|
1026
|
+
import { jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1027
|
+
var UserMenu = React11.memo(function UserMenu2({
|
|
866
1028
|
user,
|
|
867
1029
|
onSignOut,
|
|
868
1030
|
onChangePassword,
|
|
@@ -887,34 +1049,34 @@ var UserMenu = React8.memo(function UserMenu2({
|
|
|
887
1049
|
}
|
|
888
1050
|
return /* @__PURE__ */ jsxs6(Dialog, { open: isPasswordDialogOpen, onOpenChange: setPasswordDialogOpen, children: [
|
|
889
1051
|
/* @__PURE__ */ jsxs6(Select, { className, children: [
|
|
890
|
-
/* @__PURE__ */
|
|
1052
|
+
/* @__PURE__ */ jsx13(SelectTrigger, { asChild: true, children: /* @__PURE__ */ jsxs6(Button, { variant: "outline", className: "flex items-center gap-2", "aria-label": userInfo.displayName, children: [
|
|
891
1053
|
showAvatar && /* @__PURE__ */ jsxs6(Avatar, { className: "size-7", children: [
|
|
892
|
-
/* @__PURE__ */
|
|
893
|
-
/* @__PURE__ */
|
|
1054
|
+
/* @__PURE__ */ jsx13(AvatarImage, { src: userInfo.avatarUrl, alt: userInfo.displayName }),
|
|
1055
|
+
/* @__PURE__ */ jsx13(AvatarFallback, { children: userInfo.initial })
|
|
894
1056
|
] }),
|
|
895
|
-
/* @__PURE__ */
|
|
896
|
-
/* @__PURE__ */
|
|
1057
|
+
/* @__PURE__ */ jsx13("span", { children: userInfo.displayName }),
|
|
1058
|
+
/* @__PURE__ */ jsx13(ChevronDown, { className: "h-4 w-4" })
|
|
897
1059
|
] }) }),
|
|
898
1060
|
/* @__PURE__ */ jsxs6(SelectContent, { children: [
|
|
899
|
-
/* @__PURE__ */
|
|
900
|
-
/* @__PURE__ */
|
|
901
|
-
/* @__PURE__ */
|
|
1061
|
+
/* @__PURE__ */ jsx13(SelectLabel, { className: "font-normal", children: /* @__PURE__ */ jsxs6("div", { className: "flex flex-col space-y-1", children: [
|
|
1062
|
+
/* @__PURE__ */ jsx13("p", { className: "font-medium", children: userInfo.displayName }),
|
|
1063
|
+
/* @__PURE__ */ jsx13("p", { className: "text-muted-foreground", children: userInfo.email })
|
|
902
1064
|
] }) }),
|
|
903
|
-
/* @__PURE__ */
|
|
904
|
-
/* @__PURE__ */
|
|
905
|
-
/* @__PURE__ */
|
|
906
|
-
/* @__PURE__ */
|
|
1065
|
+
/* @__PURE__ */ jsx13(SelectSeparator, {}),
|
|
1066
|
+
/* @__PURE__ */ jsx13(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsxs6(SelectItem, { value: "change-password", children: [
|
|
1067
|
+
/* @__PURE__ */ jsx13(KeyRound, { className: "mr-2 h-4 w-4" }),
|
|
1068
|
+
/* @__PURE__ */ jsx13("span", { children: "Change Password" })
|
|
907
1069
|
] }) }),
|
|
908
1070
|
/* @__PURE__ */ jsxs6(SelectItem, { value: "sign-out", onClick: handleSignOut, children: [
|
|
909
|
-
/* @__PURE__ */
|
|
910
|
-
/* @__PURE__ */
|
|
1071
|
+
/* @__PURE__ */ jsx13(LogOut, { className: "mr-2 h-4 w-4" }),
|
|
1072
|
+
/* @__PURE__ */ jsx13("span", { children: "Sign out" })
|
|
911
1073
|
] })
|
|
912
1074
|
] })
|
|
913
1075
|
] }),
|
|
914
|
-
/* @__PURE__ */
|
|
1076
|
+
/* @__PURE__ */ jsx13(DialogOverlay, {}),
|
|
915
1077
|
/* @__PURE__ */ jsxs6(DialogContent, { className, children: [
|
|
916
|
-
/* @__PURE__ */
|
|
917
|
-
/* @__PURE__ */
|
|
1078
|
+
/* @__PURE__ */ jsx13(DialogHeader, { children: /* @__PURE__ */ jsx13(DialogTitle, { children: "Change Password" }) }),
|
|
1079
|
+
/* @__PURE__ */ jsx13(
|
|
918
1080
|
PasswordChangeForm,
|
|
919
1081
|
{
|
|
920
1082
|
onSubmit: async ({ newPassword, confirmPassword }) => {
|
|
@@ -932,7 +1094,7 @@ var UserMenu = React8.memo(function UserMenu2({
|
|
|
932
1094
|
] })
|
|
933
1095
|
] });
|
|
934
1096
|
});
|
|
935
|
-
var UserMenuLoading =
|
|
1097
|
+
var UserMenuLoading = React11.memo(function UserMenuLoading2() {
|
|
936
1098
|
return /* @__PURE__ */ jsxs6("div", { className: "relative inline-block text-left", children: [
|
|
937
1099
|
/* @__PURE__ */ jsxs6(
|
|
938
1100
|
"button",
|
|
@@ -941,24 +1103,24 @@ var UserMenuLoading = React8.memo(function UserMenuLoading2() {
|
|
|
941
1103
|
disabled: true,
|
|
942
1104
|
className: "flex items-center space-x-2 px-3 py-2 text-sm font-medium text-muted-foreground bg-muted border border-input rounded-md",
|
|
943
1105
|
children: [
|
|
944
|
-
/* @__PURE__ */
|
|
945
|
-
/* @__PURE__ */
|
|
946
|
-
/* @__PURE__ */
|
|
1106
|
+
/* @__PURE__ */ jsx13("div", { className: "w-6 h-6 rounded-full bg-muted animate-pulse" }),
|
|
1107
|
+
/* @__PURE__ */ jsx13("span", { className: "truncate max-w-[150px]", children: "Loading..." }),
|
|
1108
|
+
/* @__PURE__ */ jsx13(ChevronDown, { className: "w-4 h-4 text-muted-foreground" })
|
|
947
1109
|
]
|
|
948
1110
|
}
|
|
949
1111
|
),
|
|
950
|
-
/* @__PURE__ */
|
|
1112
|
+
/* @__PURE__ */ jsx13("div", { role: "status", "aria-label": "Loading user menu", "aria-live": "polite", className: "w-6 h-6 rounded-full bg-muted animate-pulse" })
|
|
951
1113
|
] });
|
|
952
1114
|
});
|
|
953
1115
|
UserMenu.Loading = UserMenuLoading;
|
|
954
1116
|
|
|
955
1117
|
// src/components/NavigationMenu/NavigationMenu.tsx
|
|
956
|
-
import * as
|
|
1118
|
+
import * as React12 from "react";
|
|
957
1119
|
import { ChevronDown as ChevronDown2 } from "lucide-react";
|
|
958
1120
|
init_UnifiedAuthProvider2();
|
|
959
1121
|
init_logger();
|
|
960
|
-
import { jsx as
|
|
961
|
-
var NavigationMenu =
|
|
1122
|
+
import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1123
|
+
var NavigationMenu = React12.forwardRef(({
|
|
962
1124
|
items,
|
|
963
1125
|
mode = "dropdown",
|
|
964
1126
|
currentPath,
|
|
@@ -976,8 +1138,8 @@ var NavigationMenu = React9.forwardRef(({
|
|
|
976
1138
|
filterByPermissions = true,
|
|
977
1139
|
...props
|
|
978
1140
|
}, ref) => {
|
|
979
|
-
const [expandedItems, setExpandedItems] =
|
|
980
|
-
const buttonRef =
|
|
1141
|
+
const [expandedItems, setExpandedItems] = React12.useState(/* @__PURE__ */ new Set());
|
|
1142
|
+
const buttonRef = React12.useRef(null);
|
|
981
1143
|
let authContext = null;
|
|
982
1144
|
try {
|
|
983
1145
|
authContext = useUnifiedAuth();
|
|
@@ -998,7 +1160,7 @@ var NavigationMenu = React9.forwardRef(({
|
|
|
998
1160
|
selectedOrganisationId: selectedOrganisation?.id || null,
|
|
999
1161
|
selectedEventId: selectedEvent?.event_id || null
|
|
1000
1162
|
});
|
|
1001
|
-
const stableScopeRef =
|
|
1163
|
+
const stableScopeRef = React12.useRef({
|
|
1002
1164
|
organisationId: "",
|
|
1003
1165
|
eventId: void 0,
|
|
1004
1166
|
appId: void 0
|
|
@@ -1029,8 +1191,8 @@ var NavigationMenu = React9.forwardRef(({
|
|
|
1029
1191
|
userId,
|
|
1030
1192
|
stableScope
|
|
1031
1193
|
);
|
|
1032
|
-
const previousFilteredItemsRef =
|
|
1033
|
-
const filteredItems =
|
|
1194
|
+
const previousFilteredItemsRef = React12.useRef([]);
|
|
1195
|
+
const filteredItems = React12.useMemo(() => {
|
|
1034
1196
|
if (filterByPermissions) {
|
|
1035
1197
|
if (!authContext || !rbacContext || scopeLoading || !resolvedScope?.organisationId) {
|
|
1036
1198
|
return [];
|
|
@@ -1169,7 +1331,7 @@ var NavigationMenu = React9.forwardRef(({
|
|
|
1169
1331
|
resolvedScope,
|
|
1170
1332
|
auditLog
|
|
1171
1333
|
]);
|
|
1172
|
-
|
|
1334
|
+
React12.useEffect(() => {
|
|
1173
1335
|
if (auditLog && authContext) {
|
|
1174
1336
|
logger.debug("NavigationMenu", "Navigation access attempt:", {
|
|
1175
1337
|
itemId: "navigation-menu",
|
|
@@ -1303,7 +1465,7 @@ var NavigationMenu = React9.forwardRef(({
|
|
|
1303
1465
|
const hasChildren = item.children && item.children.length > 0;
|
|
1304
1466
|
const isExpanded = expandedItems.has(item.id);
|
|
1305
1467
|
const itemIsActive = isActiveItem(item);
|
|
1306
|
-
return /* @__PURE__ */
|
|
1468
|
+
return /* @__PURE__ */ jsx14("li", { role: "none", children: hasChildren ? /* @__PURE__ */ jsxs7("div", { children: [
|
|
1307
1469
|
/* @__PURE__ */ jsxs7(
|
|
1308
1470
|
"button",
|
|
1309
1471
|
{
|
|
@@ -1313,21 +1475,21 @@ var NavigationMenu = React9.forwardRef(({
|
|
|
1313
1475
|
"aria-controls": `submenu-${item.id}`,
|
|
1314
1476
|
"aria-current": itemIsActive ? "page" : void 0,
|
|
1315
1477
|
children: [
|
|
1316
|
-
/* @__PURE__ */
|
|
1317
|
-
/* @__PURE__ */
|
|
1478
|
+
/* @__PURE__ */ jsx14("span", { children: item.label }),
|
|
1479
|
+
/* @__PURE__ */ jsx14(ChevronDown2, { "aria-hidden": "true" })
|
|
1318
1480
|
]
|
|
1319
1481
|
}
|
|
1320
1482
|
),
|
|
1321
|
-
isExpanded && item.children && /* @__PURE__ */
|
|
1483
|
+
isExpanded && item.children && /* @__PURE__ */ jsx14(
|
|
1322
1484
|
"ul",
|
|
1323
1485
|
{
|
|
1324
1486
|
id: `submenu-${item.id}`,
|
|
1325
1487
|
role: "menu",
|
|
1326
1488
|
"aria-label": `${item.label} submenu`,
|
|
1327
|
-
children: item.children.map((child) => /* @__PURE__ */
|
|
1489
|
+
children: item.children.map((child) => /* @__PURE__ */ jsx14(React12.Fragment, { children: renderHierarchicalItem(child, level + 1) }, child.id))
|
|
1328
1490
|
}
|
|
1329
1491
|
)
|
|
1330
|
-
] }) : /* @__PURE__ */
|
|
1492
|
+
] }) : /* @__PURE__ */ jsx14(
|
|
1331
1493
|
"a",
|
|
1332
1494
|
{
|
|
1333
1495
|
href: item.href || "#",
|
|
@@ -1352,19 +1514,19 @@ var NavigationMenu = React9.forwardRef(({
|
|
|
1352
1514
|
className,
|
|
1353
1515
|
"data-testid": "navigation-menu-root",
|
|
1354
1516
|
children: [
|
|
1355
|
-
/* @__PURE__ */
|
|
1517
|
+
/* @__PURE__ */ jsx14(
|
|
1356
1518
|
SelectTrigger,
|
|
1357
1519
|
{
|
|
1358
1520
|
ref: buttonRef,
|
|
1359
1521
|
disabled,
|
|
1360
1522
|
"aria-label": buttonText,
|
|
1361
1523
|
"data-testid": "navigation-menu-trigger",
|
|
1362
|
-
children: /* @__PURE__ */
|
|
1524
|
+
children: /* @__PURE__ */ jsx14(SelectValue, { placeholder: buttonText })
|
|
1363
1525
|
}
|
|
1364
1526
|
),
|
|
1365
|
-
/* @__PURE__ */
|
|
1527
|
+
/* @__PURE__ */ jsx14(SelectContent, { children: filteredItems.map((item) => {
|
|
1366
1528
|
const isActive = isActiveItem(item);
|
|
1367
|
-
return /* @__PURE__ */
|
|
1529
|
+
return /* @__PURE__ */ jsx14(
|
|
1368
1530
|
SelectItem,
|
|
1369
1531
|
{
|
|
1370
1532
|
value: item.id,
|
|
@@ -1379,14 +1541,14 @@ var NavigationMenu = React9.forwardRef(({
|
|
|
1379
1541
|
}
|
|
1380
1542
|
);
|
|
1381
1543
|
}
|
|
1382
|
-
return /* @__PURE__ */
|
|
1544
|
+
return /* @__PURE__ */ jsx14(
|
|
1383
1545
|
"nav",
|
|
1384
1546
|
{
|
|
1385
1547
|
ref,
|
|
1386
1548
|
className,
|
|
1387
1549
|
"aria-label": navigationLabel,
|
|
1388
1550
|
...props,
|
|
1389
|
-
children: /* @__PURE__ */
|
|
1551
|
+
children: /* @__PURE__ */ jsx14("ul", { role: "menubar", children: filteredItems.map((item) => /* @__PURE__ */ jsx14(React12.Fragment, { children: renderHierarchicalItem(item, 0) }, item.id)) })
|
|
1390
1552
|
}
|
|
1391
1553
|
);
|
|
1392
1554
|
});
|
|
@@ -1394,7 +1556,7 @@ NavigationMenu.displayName = "NavigationMenu";
|
|
|
1394
1556
|
|
|
1395
1557
|
// src/components/Header/Header.tsx
|
|
1396
1558
|
import { Link } from "react-router-dom";
|
|
1397
|
-
import { jsx as
|
|
1559
|
+
import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1398
1560
|
function Header({
|
|
1399
1561
|
logoUrl,
|
|
1400
1562
|
logoAlt = "Logo",
|
|
@@ -1412,32 +1574,32 @@ function Header({
|
|
|
1412
1574
|
onNavigate,
|
|
1413
1575
|
logoHref
|
|
1414
1576
|
}) {
|
|
1415
|
-
return /* @__PURE__ */
|
|
1577
|
+
return /* @__PURE__ */ jsx15("header", { className: cn(
|
|
1416
1578
|
"w-full border-b border-main-200 h-16 shadow-sm bg-main-100 ",
|
|
1417
1579
|
className
|
|
1418
1580
|
), role: "banner", children: /* @__PURE__ */ jsxs8("nav", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto grid grid-cols-[auto_auto_1fr_auto] gap-4 h-full items-center", children: [
|
|
1419
|
-
logo ? logoHref ? /* @__PURE__ */
|
|
1581
|
+
logo ? logoHref ? /* @__PURE__ */ jsx15(Link, { to: logoHref, className: "cursor-pointer hover:opacity-80 transition-opacity", children: logo }) : logo : logoUrl ? logoHref ? /* @__PURE__ */ jsx15(Link, { to: logoHref, className: "cursor-pointer hover:opacity-80 transition-opacity", children: /* @__PURE__ */ jsx15(
|
|
1420
1582
|
"img",
|
|
1421
1583
|
{
|
|
1422
1584
|
src: logoUrl,
|
|
1423
1585
|
alt: logoAlt || "Logo",
|
|
1424
1586
|
className: "h-[2.15rem] w-auto max-w-[200px] object-contain rounded-md shadow-md bg-transparent"
|
|
1425
1587
|
}
|
|
1426
|
-
) }) : /* @__PURE__ */
|
|
1588
|
+
) }) : /* @__PURE__ */ jsx15(
|
|
1427
1589
|
"img",
|
|
1428
1590
|
{
|
|
1429
1591
|
src: logoUrl,
|
|
1430
1592
|
alt: logoAlt || "Logo",
|
|
1431
1593
|
className: "h-[2.15rem] w-auto max-w-[200px] object-contain rounded-md shadow-md bg-transparent"
|
|
1432
1594
|
}
|
|
1433
|
-
) : logoHref ? /* @__PURE__ */
|
|
1595
|
+
) : logoHref ? /* @__PURE__ */ jsx15(Link, { to: logoHref, className: "cursor-pointer hover:opacity-80 transition-opacity", children: /* @__PURE__ */ jsx15(
|
|
1434
1596
|
"img",
|
|
1435
1597
|
{
|
|
1436
1598
|
src: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' fill='%23000'/%3E%3Ctext x='16' y='20' text-anchor='middle' fill='white' font-family='Arial' font-size='14' font-weight='bold'%3EL%3C/text%3E%3C/svg%3E",
|
|
1437
1599
|
alt: logoAlt || "Logo",
|
|
1438
1600
|
className: "h-8 w-8 shadow-md"
|
|
1439
1601
|
}
|
|
1440
|
-
) }) : /* @__PURE__ */
|
|
1602
|
+
) }) : /* @__PURE__ */ jsx15(
|
|
1441
1603
|
"img",
|
|
1442
1604
|
{
|
|
1443
1605
|
src: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' fill='%23000'/%3E%3Ctext x='16' y='20' text-anchor='middle' fill='white' font-family='Arial' font-size='14' font-weight='bold'%3EL%3C/text%3E%3C/svg%3E",
|
|
@@ -1445,7 +1607,7 @@ function Header({
|
|
|
1445
1607
|
className: "h-8 w-8 shadow-md"
|
|
1446
1608
|
}
|
|
1447
1609
|
),
|
|
1448
|
-
navItems && navItems.length > 0 && /* @__PURE__ */
|
|
1610
|
+
navItems && navItems.length > 0 && /* @__PURE__ */ jsx15(
|
|
1449
1611
|
NavigationMenu,
|
|
1450
1612
|
{
|
|
1451
1613
|
items: navItems,
|
|
@@ -1455,16 +1617,16 @@ function Header({
|
|
|
1455
1617
|
className: "w-48"
|
|
1456
1618
|
}
|
|
1457
1619
|
),
|
|
1458
|
-
showEventSelector ? /* @__PURE__ */
|
|
1620
|
+
showEventSelector ? /* @__PURE__ */ jsx15(
|
|
1459
1621
|
EventSelector,
|
|
1460
1622
|
{
|
|
1461
1623
|
placeholder: "Select event",
|
|
1462
1624
|
className: "justify-self-end w-96",
|
|
1463
1625
|
"data-testid": "event-selector"
|
|
1464
1626
|
}
|
|
1465
|
-
) : /* @__PURE__ */
|
|
1627
|
+
) : /* @__PURE__ */ jsx15("del", { className: "justify-self-end invisible", children: "Event Selector N/A" }),
|
|
1466
1628
|
actions,
|
|
1467
|
-
showUserMenu && (userMenu ? userMenu : /* @__PURE__ */
|
|
1629
|
+
showUserMenu && (userMenu ? userMenu : /* @__PURE__ */ jsx15(
|
|
1468
1630
|
UserMenu,
|
|
1469
1631
|
{
|
|
1470
1632
|
user: user || null,
|
|
@@ -1477,8 +1639,8 @@ function Header({
|
|
|
1477
1639
|
}
|
|
1478
1640
|
|
|
1479
1641
|
// src/components/Footer/Footer.tsx
|
|
1480
|
-
import
|
|
1481
|
-
import { Fragment as Fragment3, jsx as
|
|
1642
|
+
import React13 from "react";
|
|
1643
|
+
import { Fragment as Fragment3, jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1482
1644
|
var FooterComponent = ({
|
|
1483
1645
|
companyName = "Solvera Solutions Pty Ltd",
|
|
1484
1646
|
year = (/* @__PURE__ */ new Date()).getFullYear(),
|
|
@@ -1489,15 +1651,15 @@ var FooterComponent = ({
|
|
|
1489
1651
|
children
|
|
1490
1652
|
}) => {
|
|
1491
1653
|
const copyrightText = copyright || `\xA9 Copyright 2022\u2013${year} all rights reserved, ${companyName}.`;
|
|
1492
|
-
return /* @__PURE__ */
|
|
1493
|
-
logo && /* @__PURE__ */
|
|
1494
|
-
children && /* @__PURE__ */
|
|
1495
|
-
/* @__PURE__ */
|
|
1496
|
-
links && links.length > 0 && /* @__PURE__ */
|
|
1654
|
+
return /* @__PURE__ */ jsx16("footer", { className: cn("mt-8 py-6 flex justify-center border-t border-border bg-main-100", className), children: /* @__PURE__ */ jsxs9("section", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto text-center", children: [
|
|
1655
|
+
logo && /* @__PURE__ */ jsx16("img", { src: logo, alt: "Logo", className: "h-8 w-auto" }),
|
|
1656
|
+
children && /* @__PURE__ */ jsx16(Fragment3, { children }),
|
|
1657
|
+
/* @__PURE__ */ jsx16("span", { className: "text-muted-foreground", children: copyrightText }),
|
|
1658
|
+
links && links.length > 0 && /* @__PURE__ */ jsx16("ul", { className: "flex gap-4 mt-2 md:mt-0", children: links.map((link, index) => /* @__PURE__ */ jsx16("li", { children: /* @__PURE__ */ jsx16("a", { href: link.href, className: "text-muted-foreground hover:text-foreground", children: link.label }) }, index)) })
|
|
1497
1659
|
] }) });
|
|
1498
1660
|
};
|
|
1499
1661
|
FooterComponent.displayName = "Footer";
|
|
1500
|
-
var Footer =
|
|
1662
|
+
var Footer = React13.memo(FooterComponent);
|
|
1501
1663
|
Footer.displayName = "Footer";
|
|
1502
1664
|
|
|
1503
1665
|
// src/components/PaceAppLayout/PaceAppLayout.tsx
|
|
@@ -1506,7 +1668,7 @@ init_useOrganisations();
|
|
|
1506
1668
|
import { useState as useState5, useEffect as useEffect3, useMemo as useMemo5 } from "react";
|
|
1507
1669
|
import { Outlet, useNavigate, useLocation } from "react-router-dom";
|
|
1508
1670
|
init_logger();
|
|
1509
|
-
import { Fragment as Fragment4, jsx as
|
|
1671
|
+
import { Fragment as Fragment4, jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1510
1672
|
var EMPTY_PAGE_ID_MAPPING = {};
|
|
1511
1673
|
var EMPTY_ROUTE_PERMISSIONS = {};
|
|
1512
1674
|
function PaceAppLayout({
|
|
@@ -1795,31 +1957,31 @@ function PaceAppLayout({
|
|
|
1795
1957
|
return result || { error: null };
|
|
1796
1958
|
};
|
|
1797
1959
|
if (enforcePermissions && (isCheckingSuperAdmin || isCheckingPermission)) {
|
|
1798
|
-
return /* @__PURE__ */
|
|
1799
|
-
/* @__PURE__ */
|
|
1800
|
-
/* @__PURE__ */
|
|
1960
|
+
return /* @__PURE__ */ jsx17("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs10("div", { className: "text-center", children: [
|
|
1961
|
+
/* @__PURE__ */ jsx17("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-sec-900 mx-auto mb-4" }),
|
|
1962
|
+
/* @__PURE__ */ jsx17("p", { className: "text-sec-600", children: "Checking permissions..." })
|
|
1801
1963
|
] }) });
|
|
1802
1964
|
}
|
|
1803
1965
|
if (enforcePermissions && permissionError && !isSuperAdminUser) {
|
|
1804
|
-
return /* @__PURE__ */
|
|
1805
|
-
/* @__PURE__ */
|
|
1806
|
-
/* @__PURE__ */
|
|
1807
|
-
/* @__PURE__ */
|
|
1966
|
+
return /* @__PURE__ */ jsx17("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs10("div", { className: "text-center", children: [
|
|
1967
|
+
/* @__PURE__ */ jsx17("h2", { className: "text-xl font-semibold text-acc-600 mb-2", children: "Permission Error" }),
|
|
1968
|
+
/* @__PURE__ */ jsx17("p", { className: "text-sec-600 mb-4", children: permissionError.message }),
|
|
1969
|
+
/* @__PURE__ */ jsx17(Button, { onClick: () => navigate("/"), children: "Go Home" })
|
|
1808
1970
|
] }) });
|
|
1809
1971
|
}
|
|
1810
1972
|
if (enforcePermissions && hasPermission === false && !isCheckingSuperAdmin && !isSuperAdminUser) {
|
|
1811
1973
|
if (enforcePagePermissions && pagePermissionFallback) {
|
|
1812
|
-
return /* @__PURE__ */
|
|
1974
|
+
return /* @__PURE__ */ jsx17(Fragment4, { children: pagePermissionFallback });
|
|
1813
1975
|
}
|
|
1814
1976
|
if (permissionFallback) {
|
|
1815
|
-
return /* @__PURE__ */
|
|
1977
|
+
return /* @__PURE__ */ jsx17(Fragment4, { children: permissionFallback });
|
|
1816
1978
|
}
|
|
1817
|
-
return /* @__PURE__ */
|
|
1818
|
-
/* @__PURE__ */
|
|
1819
|
-
/* @__PURE__ */
|
|
1979
|
+
return /* @__PURE__ */ jsx17("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs10("div", { className: "text-center", children: [
|
|
1980
|
+
/* @__PURE__ */ jsx17("h2", { className: "text-xl font-semibold text-acc-600 mb-2", children: "Access Denied" }),
|
|
1981
|
+
/* @__PURE__ */ jsx17("p", { className: "text-sec-600 mb-4", children: "You don't have permission to access this page." }),
|
|
1820
1982
|
/* @__PURE__ */ jsxs10("div", { className: "flex gap-2 justify-center", children: [
|
|
1821
|
-
/* @__PURE__ */
|
|
1822
|
-
/* @__PURE__ */
|
|
1983
|
+
/* @__PURE__ */ jsx17(Button, { onClick: () => navigate("/"), children: "Go Home" }),
|
|
1984
|
+
/* @__PURE__ */ jsx17(
|
|
1823
1985
|
Button,
|
|
1824
1986
|
{
|
|
1825
1987
|
variant: "outline",
|
|
@@ -1834,7 +1996,7 @@ function PaceAppLayout({
|
|
|
1834
1996
|
] }) });
|
|
1835
1997
|
}
|
|
1836
1998
|
return /* @__PURE__ */ jsxs10(Fragment4, { children: [
|
|
1837
|
-
/* @__PURE__ */
|
|
1999
|
+
/* @__PURE__ */ jsx17(
|
|
1838
2000
|
Header,
|
|
1839
2001
|
{
|
|
1840
2002
|
logo: customLogo || void 0,
|
|
@@ -1858,8 +2020,8 @@ function PaceAppLayout({
|
|
|
1858
2020
|
className: headerClassName || "sticky top-0 z-[40] w-full"
|
|
1859
2021
|
}
|
|
1860
2022
|
),
|
|
1861
|
-
/* @__PURE__ */
|
|
1862
|
-
/* @__PURE__ */
|
|
2023
|
+
/* @__PURE__ */ jsx17("main", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children: /* @__PURE__ */ jsx17(Outlet, {}) }),
|
|
2024
|
+
/* @__PURE__ */ jsx17(Footer, {})
|
|
1863
2025
|
] });
|
|
1864
2026
|
}
|
|
1865
2027
|
|
|
@@ -1868,7 +2030,7 @@ import { useEffect as useEffect4, useState as useState6, useContext } from "reac
|
|
|
1868
2030
|
import { useNavigate as useNavigate2, useLocation as useLocation2 } from "react-router-dom";
|
|
1869
2031
|
init_EventServiceProvider();
|
|
1870
2032
|
init_logger();
|
|
1871
|
-
import { jsx as
|
|
2033
|
+
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1872
2034
|
var PaceLoginPage = ({
|
|
1873
2035
|
appName = "Pace",
|
|
1874
2036
|
onSuccessRedirectPath = "/user-dashboard",
|
|
@@ -2000,7 +2162,7 @@ var PaceLoginPage = ({
|
|
|
2000
2162
|
}
|
|
2001
2163
|
};
|
|
2002
2164
|
return /* @__PURE__ */ jsxs11("main", { className: "min-h-screen grid mx-auto w-fit content-center justify-items-center gap-y-8", "aria-label": `${appName} Login Page`, children: [
|
|
2003
|
-
/* @__PURE__ */
|
|
2165
|
+
/* @__PURE__ */ jsx18(
|
|
2004
2166
|
"img",
|
|
2005
2167
|
{
|
|
2006
2168
|
src: `/${appName.toLowerCase()}_logo_square.svg`,
|
|
@@ -2008,7 +2170,7 @@ var PaceLoginPage = ({
|
|
|
2008
2170
|
className: "h-48"
|
|
2009
2171
|
}
|
|
2010
2172
|
),
|
|
2011
|
-
/* @__PURE__ */
|
|
2173
|
+
/* @__PURE__ */ jsx18(
|
|
2012
2174
|
LoginForm,
|
|
2013
2175
|
{
|
|
2014
2176
|
className: "w-md",
|
|
@@ -2022,15 +2184,15 @@ var PaceLoginPage = ({
|
|
|
2022
2184
|
),
|
|
2023
2185
|
(() => {
|
|
2024
2186
|
const benign = !!(authError && (authError.name === "AuthSessionMissingError" || /Auth session missing/i.test(authError.message)));
|
|
2025
|
-
return authError && !benign ? /* @__PURE__ */
|
|
2187
|
+
return authError && !benign ? /* @__PURE__ */ jsx18("em", { className: "mt-4 text-destructive text-center", children: authError.message }) : null;
|
|
2026
2188
|
})(),
|
|
2027
|
-
accessError && /* @__PURE__ */
|
|
2028
|
-
isCheckingAccess && /* @__PURE__ */
|
|
2189
|
+
accessError && /* @__PURE__ */ jsx18("em", { className: "mt-4 text-destructive text-center", children: accessError }),
|
|
2190
|
+
isCheckingAccess && /* @__PURE__ */ jsx18("em", { className: "mt-4 text-muted-foreground text-center", children: "Checking permissions..." })
|
|
2029
2191
|
] });
|
|
2030
2192
|
};
|
|
2031
2193
|
|
|
2032
2194
|
// src/components/SessionRestorationLoader/SessionRestorationLoader.tsx
|
|
2033
|
-
import { jsx as
|
|
2195
|
+
import { jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2034
2196
|
var SessionRestorationLoader = ({
|
|
2035
2197
|
message = "Restoring session..."
|
|
2036
2198
|
}) => {
|
|
@@ -2050,8 +2212,8 @@ var SessionRestorationLoader = ({
|
|
|
2050
2212
|
background: "var(--background, transparent)"
|
|
2051
2213
|
},
|
|
2052
2214
|
children: [
|
|
2053
|
-
/* @__PURE__ */
|
|
2054
|
-
/* @__PURE__ */
|
|
2215
|
+
/* @__PURE__ */ jsx19(LoadingSpinner, { size: "lg" }),
|
|
2216
|
+
/* @__PURE__ */ jsx19(
|
|
2055
2217
|
"div",
|
|
2056
2218
|
{
|
|
2057
2219
|
style: {
|
|
@@ -2072,7 +2234,7 @@ init_useSessionRestoration();
|
|
|
2072
2234
|
import { useMemo as useMemo6 } from "react";
|
|
2073
2235
|
import { Navigate, Outlet as Outlet2 } from "react-router-dom";
|
|
2074
2236
|
init_logger();
|
|
2075
|
-
import { jsx as
|
|
2237
|
+
import { jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2076
2238
|
function ProtectedRoute({
|
|
2077
2239
|
requireEvent = true,
|
|
2078
2240
|
allowSuperAdminBypass = false,
|
|
@@ -2092,13 +2254,13 @@ function ProtectedRoute({
|
|
|
2092
2254
|
sessionRestoration.hasTimedOut
|
|
2093
2255
|
]);
|
|
2094
2256
|
if (isRestoringSession) {
|
|
2095
|
-
return /* @__PURE__ */
|
|
2257
|
+
return /* @__PURE__ */ jsx20(SessionRestorationLoader, {});
|
|
2096
2258
|
}
|
|
2097
2259
|
if (requireEvent && eventLoading) {
|
|
2098
|
-
return /* @__PURE__ */
|
|
2260
|
+
return /* @__PURE__ */ jsx20(Outlet2, {});
|
|
2099
2261
|
}
|
|
2100
2262
|
if (authLoading && !sessionRestoration.hasTimedOut) {
|
|
2101
|
-
return loadingFallback || /* @__PURE__ */
|
|
2263
|
+
return loadingFallback || /* @__PURE__ */ jsx20("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100vh" }, children: /* @__PURE__ */ jsx20(LoadingSpinner, {}) });
|
|
2102
2264
|
}
|
|
2103
2265
|
if (!isAuthenticated) {
|
|
2104
2266
|
if (sessionRestoration.hasTimedOut || sessionRestoration.restorationError) {
|
|
@@ -2107,28 +2269,28 @@ function ProtectedRoute({
|
|
|
2107
2269
|
error: sessionRestoration.restorationError?.message
|
|
2108
2270
|
});
|
|
2109
2271
|
}
|
|
2110
|
-
return /* @__PURE__ */
|
|
2272
|
+
return /* @__PURE__ */ jsx20(Navigate, { to: loginPath, replace: true });
|
|
2111
2273
|
}
|
|
2112
2274
|
if (!requireEvent) {
|
|
2113
|
-
return /* @__PURE__ */
|
|
2275
|
+
return /* @__PURE__ */ jsx20(Outlet2, {});
|
|
2114
2276
|
}
|
|
2115
2277
|
if (!events || events.length === 0) {
|
|
2116
|
-
return noEventsFallback || /* @__PURE__ */
|
|
2117
|
-
/* @__PURE__ */
|
|
2118
|
-
/* @__PURE__ */
|
|
2278
|
+
return noEventsFallback || /* @__PURE__ */ jsx20("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "100vh", padding: "2rem" }, children: /* @__PURE__ */ jsxs13(Alert, { variant: "destructive", className: "max-w-md", children: [
|
|
2279
|
+
/* @__PURE__ */ jsx20(AlertTitle, { children: "No Events Available" }),
|
|
2280
|
+
/* @__PURE__ */ jsx20(AlertDescription, { children: "You don't have access to any events. Please contact your administrator if you believe this is an error." })
|
|
2119
2281
|
] }) });
|
|
2120
2282
|
}
|
|
2121
2283
|
if (!selectedEvent) {
|
|
2122
2284
|
logger.debug("ProtectedRoute", "Events available but none selected - allowing render so selector is visible");
|
|
2123
|
-
return /* @__PURE__ */
|
|
2285
|
+
return /* @__PURE__ */ jsx20(Outlet2, {});
|
|
2124
2286
|
}
|
|
2125
|
-
return /* @__PURE__ */
|
|
2287
|
+
return /* @__PURE__ */ jsx20(Outlet2, {});
|
|
2126
2288
|
}
|
|
2127
2289
|
|
|
2128
2290
|
// src/components/ErrorBoundary/ErrorBoundary.tsx
|
|
2129
2291
|
import { Component } from "react";
|
|
2130
2292
|
init_logger();
|
|
2131
|
-
import { jsx as
|
|
2293
|
+
import { jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2132
2294
|
var ErrorBoundary = class extends Component {
|
|
2133
2295
|
constructor(props) {
|
|
2134
2296
|
super(props);
|
|
@@ -2201,20 +2363,20 @@ var ErrorBoundary = class extends Component {
|
|
|
2201
2363
|
if (fallback) {
|
|
2202
2364
|
return fallback;
|
|
2203
2365
|
}
|
|
2204
|
-
return /* @__PURE__ */
|
|
2366
|
+
return /* @__PURE__ */ jsx21(
|
|
2205
2367
|
"div",
|
|
2206
2368
|
{
|
|
2207
2369
|
role: "alert",
|
|
2208
2370
|
className: "p-6 bg-destructive/10 border border-destructive/20 rounded-lg",
|
|
2209
2371
|
"data-error-boundary": errorId,
|
|
2210
2372
|
children: /* @__PURE__ */ jsxs14("div", { className: "flex items-start gap-3", children: [
|
|
2211
|
-
/* @__PURE__ */
|
|
2373
|
+
/* @__PURE__ */ jsx21("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx21("svg", { className: "w-5 h-5 text-destructive", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx21("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z", clipRule: "evenodd" }) }) }),
|
|
2212
2374
|
/* @__PURE__ */ jsxs14("div", { className: "flex-1 min-w-0", children: [
|
|
2213
2375
|
/* @__PURE__ */ jsxs14("h3", { className: "text-destructive", children: [
|
|
2214
2376
|
"Error in ",
|
|
2215
2377
|
componentName
|
|
2216
2378
|
] }),
|
|
2217
|
-
/* @__PURE__ */
|
|
2379
|
+
/* @__PURE__ */ jsx21("p", { className: "text-destructive/80", children: this.state.error?.message || "An unexpected error occurred." }),
|
|
2218
2380
|
enableRetry && retryCount < maxRetries && /* @__PURE__ */ jsxs14("div", { className: "flex gap-3 mb-4", children: [
|
|
2219
2381
|
/* @__PURE__ */ jsxs14(
|
|
2220
2382
|
"button",
|
|
@@ -2230,7 +2392,7 @@ var ErrorBoundary = class extends Component {
|
|
|
2230
2392
|
]
|
|
2231
2393
|
}
|
|
2232
2394
|
),
|
|
2233
|
-
/* @__PURE__ */
|
|
2395
|
+
/* @__PURE__ */ jsx21(
|
|
2234
2396
|
"button",
|
|
2235
2397
|
{
|
|
2236
2398
|
onClick: () => window.location.reload(),
|
|
@@ -2240,8 +2402,8 @@ var ErrorBoundary = class extends Component {
|
|
|
2240
2402
|
)
|
|
2241
2403
|
] }),
|
|
2242
2404
|
retryCount >= maxRetries && /* @__PURE__ */ jsxs14("div", { className: "mb-4 p-3 bg-acc-50 border border-acc-200 rounded-md", children: [
|
|
2243
|
-
/* @__PURE__ */
|
|
2244
|
-
/* @__PURE__ */
|
|
2405
|
+
/* @__PURE__ */ jsx21("p", { className: "text-acc-800", children: "Maximum retry attempts reached. Please reload the page or contact support." }),
|
|
2406
|
+
/* @__PURE__ */ jsx21(
|
|
2245
2407
|
"button",
|
|
2246
2408
|
{
|
|
2247
2409
|
onClick: () => window.location.reload(),
|
|
@@ -2251,7 +2413,7 @@ var ErrorBoundary = class extends Component {
|
|
|
2251
2413
|
)
|
|
2252
2414
|
] }),
|
|
2253
2415
|
import.meta.env.MODE === "development" && this.state.error && /* @__PURE__ */ jsxs14("details", { className: "text-sm text-destructive/70", children: [
|
|
2254
|
-
/* @__PURE__ */
|
|
2416
|
+
/* @__PURE__ */ jsx21("summary", { className: "cursor-pointer font-medium mb-2", children: "Error Details (Development)" }),
|
|
2255
2417
|
/* @__PURE__ */ jsxs14("div", { className: "bg-destructive/5 p-3 rounded border", children: [
|
|
2256
2418
|
/* @__PURE__ */ jsxs14("p", { className: "font-mono", children: [
|
|
2257
2419
|
"Error ID: ",
|
|
@@ -2277,7 +2439,7 @@ import { useState as useState7, useCallback as useCallback4 } from "react";
|
|
|
2277
2439
|
init_OrganisationProvider();
|
|
2278
2440
|
init_logger();
|
|
2279
2441
|
import { RefreshCw as RefreshCw2, AlertCircle as AlertCircle2, Building2, Shield } from "lucide-react";
|
|
2280
|
-
import { jsx as
|
|
2442
|
+
import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2281
2443
|
function OrganisationSelector({
|
|
2282
2444
|
placeholder = "Select organisation",
|
|
2283
2445
|
className,
|
|
@@ -2342,14 +2504,14 @@ function OrganisationSelector({
|
|
|
2342
2504
|
}, [refreshOrganisations]);
|
|
2343
2505
|
if (orgLoading) {
|
|
2344
2506
|
return /* @__PURE__ */ jsxs15("div", { className: `flex items-center gap-2 ${className}`, children: [
|
|
2345
|
-
/* @__PURE__ */
|
|
2346
|
-
/* @__PURE__ */
|
|
2507
|
+
/* @__PURE__ */ jsx22(LoadingSpinner, { size: "sm" }),
|
|
2508
|
+
/* @__PURE__ */ jsx22("span", { className: "text-sm text-muted-foreground", children: compact ? "Loading..." : "Loading organisations..." })
|
|
2347
2509
|
] });
|
|
2348
2510
|
}
|
|
2349
2511
|
if (orgError) {
|
|
2350
2512
|
return /* @__PURE__ */ jsxs15("div", { className: `space-y-2 ${className}`, children: [
|
|
2351
2513
|
/* @__PURE__ */ jsxs15(Alert, { variant: "destructive", children: [
|
|
2352
|
-
/* @__PURE__ */
|
|
2514
|
+
/* @__PURE__ */ jsx22(AlertCircle2, { className: "h-4 w-4" }),
|
|
2353
2515
|
/* @__PURE__ */ jsxs15(AlertDescription, { children: [
|
|
2354
2516
|
"Failed to load organisations: ",
|
|
2355
2517
|
orgError.message
|
|
@@ -2364,7 +2526,7 @@ function OrganisationSelector({
|
|
|
2364
2526
|
disabled: isLoading,
|
|
2365
2527
|
className: "w-full",
|
|
2366
2528
|
children: [
|
|
2367
|
-
/* @__PURE__ */
|
|
2529
|
+
/* @__PURE__ */ jsx22(RefreshCw2, { className: `h-4 w-4 mr-2 ${isLoading ? "animate-spin" : ""}` }),
|
|
2368
2530
|
"Retry"
|
|
2369
2531
|
]
|
|
2370
2532
|
}
|
|
@@ -2375,8 +2537,8 @@ function OrganisationSelector({
|
|
|
2375
2537
|
if (showNoOrganisationsMessage) {
|
|
2376
2538
|
return /* @__PURE__ */ jsxs15("div", { className: `space-y-2 ${className}`, children: [
|
|
2377
2539
|
/* @__PURE__ */ jsxs15(Alert, { children: [
|
|
2378
|
-
/* @__PURE__ */
|
|
2379
|
-
/* @__PURE__ */
|
|
2540
|
+
/* @__PURE__ */ jsx22(Building2, { className: "h-4 w-4" }),
|
|
2541
|
+
/* @__PURE__ */ jsx22(AlertDescription, { children: "No organisations available. Please contact your administrator to be added to an organisation." })
|
|
2380
2542
|
] }),
|
|
2381
2543
|
showRetryButton && /* @__PURE__ */ jsxs15(
|
|
2382
2544
|
Button,
|
|
@@ -2387,7 +2549,7 @@ function OrganisationSelector({
|
|
|
2387
2549
|
disabled: isLoading,
|
|
2388
2550
|
className: "w-full",
|
|
2389
2551
|
children: [
|
|
2390
|
-
/* @__PURE__ */
|
|
2552
|
+
/* @__PURE__ */ jsx22(RefreshCw2, { className: `h-4 w-4 mr-2 ${isLoading ? "animate-spin" : ""}` }),
|
|
2391
2553
|
"Check Again"
|
|
2392
2554
|
]
|
|
2393
2555
|
}
|
|
@@ -2397,8 +2559,8 @@ function OrganisationSelector({
|
|
|
2397
2559
|
return null;
|
|
2398
2560
|
}
|
|
2399
2561
|
const switchErrorDisplay = switchError && /* @__PURE__ */ jsxs15(Alert, { variant: "destructive", className: "mt-2", children: [
|
|
2400
|
-
/* @__PURE__ */
|
|
2401
|
-
/* @__PURE__ */
|
|
2562
|
+
/* @__PURE__ */ jsx22(AlertCircle2, { className: "h-4 w-4" }),
|
|
2563
|
+
/* @__PURE__ */ jsx22(AlertDescription, { children: switchError })
|
|
2402
2564
|
] });
|
|
2403
2565
|
return /* @__PURE__ */ jsxs15("div", { className: `space-y-2 ${className}`, children: [
|
|
2404
2566
|
/* @__PURE__ */ jsxs15(
|
|
@@ -2408,14 +2570,14 @@ function OrganisationSelector({
|
|
|
2408
2570
|
onValueChange: handleOrganisationChange,
|
|
2409
2571
|
disabled: disabled || isLoading || !selectedOrganisation,
|
|
2410
2572
|
children: [
|
|
2411
|
-
/* @__PURE__ */
|
|
2412
|
-
isLoading ? /* @__PURE__ */
|
|
2413
|
-
/* @__PURE__ */
|
|
2573
|
+
/* @__PURE__ */ jsx22(SelectTrigger, { className: `${isLoading ? "opacity-50" : ""}`, children: /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
|
|
2574
|
+
isLoading ? /* @__PURE__ */ jsx22(LoadingSpinner, { size: "sm" }) : /* @__PURE__ */ jsx22(Building2, { className: "h-4 w-4 text-muted-foreground" }),
|
|
2575
|
+
/* @__PURE__ */ jsx22(SelectValue, { placeholder })
|
|
2414
2576
|
] }) }),
|
|
2415
|
-
/* @__PURE__ */
|
|
2577
|
+
/* @__PURE__ */ jsx22(SelectContent, { children: organisations.map((org) => {
|
|
2416
2578
|
const userRole = getUserRole(org.id);
|
|
2417
2579
|
const hasAccess = validateOrganisationAccess(org.id);
|
|
2418
|
-
return /* @__PURE__ */
|
|
2580
|
+
return /* @__PURE__ */ jsx22(
|
|
2419
2581
|
SelectItem,
|
|
2420
2582
|
{
|
|
2421
2583
|
value: org.id,
|
|
@@ -2423,15 +2585,15 @@ function OrganisationSelector({
|
|
|
2423
2585
|
className: !hasAccess ? "opacity-50" : "",
|
|
2424
2586
|
children: /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between w-full", children: [
|
|
2425
2587
|
/* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
|
|
2426
|
-
/* @__PURE__ */
|
|
2588
|
+
/* @__PURE__ */ jsx22(Building2, { className: "h-4 w-4" }),
|
|
2427
2589
|
/* @__PURE__ */ jsxs15("div", { className: "flex flex-col", children: [
|
|
2428
|
-
/* @__PURE__ */
|
|
2429
|
-
!compact && org.description && /* @__PURE__ */
|
|
2590
|
+
/* @__PURE__ */ jsx22("span", { className: "font-medium", children: org.display_name }),
|
|
2591
|
+
!compact && org.description && /* @__PURE__ */ jsx22("span", { className: "text-xs text-muted-foreground truncate max-w-40", children: org.description })
|
|
2430
2592
|
] })
|
|
2431
2593
|
] }),
|
|
2432
2594
|
showRole && /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-1 ml-4", children: [
|
|
2433
|
-
/* @__PURE__ */
|
|
2434
|
-
/* @__PURE__ */
|
|
2595
|
+
/* @__PURE__ */ jsx22(Shield, { className: "h-3 w-3 text-muted-foreground" }),
|
|
2596
|
+
/* @__PURE__ */ jsx22("span", { className: "text-xs text-muted-foreground capitalize", children: userRole?.replace("_", " ") || "No Role" })
|
|
2435
2597
|
] })
|
|
2436
2598
|
] })
|
|
2437
2599
|
},
|
|
@@ -2786,7 +2948,7 @@ function useFilesByCategory(supabase, table_name, record_id, category, organisat
|
|
|
2786
2948
|
|
|
2787
2949
|
// src/components/FileUpload/FileUpload.tsx
|
|
2788
2950
|
import { useState as useState9, useCallback as useCallback6, useRef as useRef3, useEffect as useEffect6, useMemo as useMemo8 } from "react";
|
|
2789
|
-
import { Fragment as Fragment5, jsx as
|
|
2951
|
+
import { Fragment as Fragment5, jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2790
2952
|
function FileUpload({
|
|
2791
2953
|
supabase,
|
|
2792
2954
|
table_name,
|
|
@@ -3119,7 +3281,7 @@ function FileUpload({
|
|
|
3119
3281
|
onClick: !isDisabled ? handleClick : void 0,
|
|
3120
3282
|
children: [
|
|
3121
3283
|
children || /* @__PURE__ */ jsxs16("div", { className: "space-y-2", children: [
|
|
3122
|
-
/* @__PURE__ */
|
|
3284
|
+
/* @__PURE__ */ jsx23(
|
|
3123
3285
|
"input",
|
|
3124
3286
|
{
|
|
3125
3287
|
ref: fileInputRef,
|
|
@@ -3132,8 +3294,8 @@ function FileUpload({
|
|
|
3132
3294
|
"data-testid": "file-input"
|
|
3133
3295
|
}
|
|
3134
3296
|
),
|
|
3135
|
-
/* @__PURE__ */
|
|
3136
|
-
/* @__PURE__ */
|
|
3297
|
+
/* @__PURE__ */ jsx23("div", { className: "text-sec-600", children: isResolvingAppId ? "Resolving app configuration..." : isDragging ? "Drop files here..." : /* @__PURE__ */ jsxs16(Fragment5, { children: [
|
|
3298
|
+
/* @__PURE__ */ jsx23("span", { className: "font-medium", children: "Click to upload" }),
|
|
3137
3299
|
" ",
|
|
3138
3300
|
"or drag and drop"
|
|
3139
3301
|
] }) }),
|
|
@@ -3143,11 +3305,11 @@ function FileUpload({
|
|
|
3143
3305
|
!isResolvingAppId && multiple && " \u2022 Multiple files allowed"
|
|
3144
3306
|
] })
|
|
3145
3307
|
] }),
|
|
3146
|
-
isUploading && !showProgress && /* @__PURE__ */
|
|
3308
|
+
isUploading && !showProgress && /* @__PURE__ */ jsx23("div", { className: "absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center", children: /* @__PURE__ */ jsx23("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-main-500" }) })
|
|
3147
3309
|
]
|
|
3148
3310
|
}
|
|
3149
3311
|
),
|
|
3150
|
-
showProgress && uploadStates.size > 0 && /* @__PURE__ */
|
|
3312
|
+
showProgress && uploadStates.size > 0 && /* @__PURE__ */ jsx23("div", { className: "space-y-2", children: Array.from(uploadStates.entries()).map(([fileId, uploadState]) => {
|
|
3151
3313
|
const { file, progress, preview, result } = uploadState;
|
|
3152
3314
|
const isError = progress.status === "error";
|
|
3153
3315
|
const isCompleted = progress.status === "completed";
|
|
@@ -3157,23 +3319,23 @@ function FileUpload({
|
|
|
3157
3319
|
{
|
|
3158
3320
|
className: `flex items-center space-x-3 p-3 rounded-lg border ${isError ? "bg-acc-50 border-acc-200" : isCompleted ? "bg-success-50 border-success-200" : "bg-sec-50 border-sec-200"}`,
|
|
3159
3321
|
children: [
|
|
3160
|
-
/* @__PURE__ */
|
|
3322
|
+
/* @__PURE__ */ jsx23("div", { className: "flex-shrink-0", children: preview ? /* @__PURE__ */ jsx23(
|
|
3161
3323
|
"img",
|
|
3162
3324
|
{
|
|
3163
3325
|
src: preview,
|
|
3164
3326
|
alt: file.name,
|
|
3165
3327
|
className: "w-12 h-12 object-cover rounded"
|
|
3166
3328
|
}
|
|
3167
|
-
) : /* @__PURE__ */
|
|
3329
|
+
) : /* @__PURE__ */ jsx23("div", { className: "w-12 h-12 flex items-center justify-center bg-sec-200 rounded", children: /* @__PURE__ */ jsx23("span", { className: "text-2xl", children: "\u{1F4C4}" }) }) }),
|
|
3168
3330
|
/* @__PURE__ */ jsxs16("div", { className: "flex-1 min-w-0", children: [
|
|
3169
|
-
/* @__PURE__ */
|
|
3331
|
+
/* @__PURE__ */ jsx23("div", { className: "font-medium text-sec-900 truncate", children: file.name }),
|
|
3170
3332
|
/* @__PURE__ */ jsxs16("div", { className: "text-sm text-sec-500", children: [
|
|
3171
3333
|
formatFileSize(file.size),
|
|
3172
3334
|
isCompleted && result && " \u2022 Uploaded",
|
|
3173
3335
|
isError && progress.error && ` \u2022 ${progress.error}`
|
|
3174
3336
|
] }),
|
|
3175
3337
|
showProgress && (isUploading2 || isError) && /* @__PURE__ */ jsxs16("div", { className: "mt-2", children: [
|
|
3176
|
-
/* @__PURE__ */
|
|
3338
|
+
/* @__PURE__ */ jsx23("div", { className: "w-full bg-sec-200 rounded-full h-2", children: /* @__PURE__ */ jsx23(
|
|
3177
3339
|
"div",
|
|
3178
3340
|
{
|
|
3179
3341
|
className: `h-2 rounded-full transition-all duration-300 ${isError ? "bg-acc-500" : "bg-main-500"}`,
|
|
@@ -3190,17 +3352,17 @@ function FileUpload({
|
|
|
3190
3352
|
] })
|
|
3191
3353
|
] }),
|
|
3192
3354
|
/* @__PURE__ */ jsxs16("div", { className: "flex-shrink-0", children: [
|
|
3193
|
-
isCompleted && /* @__PURE__ */
|
|
3194
|
-
isError && /* @__PURE__ */
|
|
3195
|
-
isUploading2 && /* @__PURE__ */
|
|
3355
|
+
isCompleted && /* @__PURE__ */ jsx23("span", { className: "text-success-500 text-xl", children: "\u2713" }),
|
|
3356
|
+
isError && /* @__PURE__ */ jsx23("span", { className: "text-acc-500 text-xl", children: "\u2715" }),
|
|
3357
|
+
isUploading2 && /* @__PURE__ */ jsx23("div", { className: "animate-spin rounded-full h-5 w-5 border-b-2 border-main-500" })
|
|
3196
3358
|
] })
|
|
3197
3359
|
]
|
|
3198
3360
|
},
|
|
3199
3361
|
fileId
|
|
3200
3362
|
);
|
|
3201
3363
|
}) }),
|
|
3202
|
-
appIdError && /* @__PURE__ */
|
|
3203
|
-
error && /* @__PURE__ */
|
|
3364
|
+
appIdError && /* @__PURE__ */ jsx23("div", { className: "p-3 bg-acc-50 border border-acc-200 rounded-lg text-sm text-acc-600", children: appIdError }),
|
|
3365
|
+
error && /* @__PURE__ */ jsx23("div", { className: "p-3 bg-acc-50 border border-acc-200 rounded-lg text-sm text-acc-600", children: error })
|
|
3204
3366
|
] });
|
|
3205
3367
|
}
|
|
3206
3368
|
|
|
@@ -3282,7 +3444,7 @@ function useFileUrl(fileReference, options) {
|
|
|
3282
3444
|
// src/components/FileDisplay/FileDisplay.tsx
|
|
3283
3445
|
init_UnifiedAuthProvider();
|
|
3284
3446
|
init_logger();
|
|
3285
|
-
import { Fragment as Fragment6, jsx as
|
|
3447
|
+
import { Fragment as Fragment6, jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3286
3448
|
var fallbackSizeClasses = {
|
|
3287
3449
|
xs: "h-4 w-4 text-xs",
|
|
3288
3450
|
sm: "h-6 w-6 text-sm",
|
|
@@ -3389,17 +3551,17 @@ function FileDisplayContent({
|
|
|
3389
3551
|
};
|
|
3390
3552
|
if (error) {
|
|
3391
3553
|
if (ErrorComponent) {
|
|
3392
|
-
return /* @__PURE__ */
|
|
3554
|
+
return /* @__PURE__ */ jsx24(ErrorComponent, { error, retry: clearError });
|
|
3393
3555
|
}
|
|
3394
3556
|
if (showFallback) {
|
|
3395
|
-
return /* @__PURE__ */
|
|
3557
|
+
return /* @__PURE__ */ jsx24("div", { className: fallbackClasses, title: "File unavailable", children: computedFallbackText });
|
|
3396
3558
|
}
|
|
3397
3559
|
return /* @__PURE__ */ jsxs17("div", { className: `p-4 bg-acc-50 border border-acc-200 rounded-lg ${className}`, children: [
|
|
3398
3560
|
/* @__PURE__ */ jsxs17("div", { className: "text-acc-600", children: [
|
|
3399
3561
|
"Error loading file: ",
|
|
3400
3562
|
error instanceof Error ? error.message : String(error)
|
|
3401
3563
|
] }),
|
|
3402
|
-
clearError && /* @__PURE__ */
|
|
3564
|
+
clearError && /* @__PURE__ */ jsx24(
|
|
3403
3565
|
"button",
|
|
3404
3566
|
{
|
|
3405
3567
|
onClick: clearError,
|
|
@@ -3429,20 +3591,20 @@ function FileDisplayContent({
|
|
|
3429
3591
|
}
|
|
3430
3592
|
if (isLoading) {
|
|
3431
3593
|
if (LoadingComponent) {
|
|
3432
|
-
return /* @__PURE__ */
|
|
3594
|
+
return /* @__PURE__ */ jsx24(LoadingComponent, {});
|
|
3433
3595
|
}
|
|
3434
|
-
return /* @__PURE__ */
|
|
3596
|
+
return /* @__PURE__ */ jsx24("div", { className: `flex items-center justify-center p-4 ${className}`, children: /* @__PURE__ */ jsx24("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-main-500" }) });
|
|
3435
3597
|
}
|
|
3436
3598
|
if ((category || displayOnly) && fileReference) {
|
|
3437
3599
|
const isImage = fileReference.file_metadata.fileType?.startsWith("image/");
|
|
3438
3600
|
if (displayOnly && isImage && !showDelete) {
|
|
3439
3601
|
if (imageError && showFallback) {
|
|
3440
|
-
return /* @__PURE__ */
|
|
3602
|
+
return /* @__PURE__ */ jsx24("div", { className: fallbackClasses, title: fileReference.file_metadata.fileName || "File", children: computedFallbackText });
|
|
3441
3603
|
}
|
|
3442
3604
|
if (!fileUrl) {
|
|
3443
|
-
return /* @__PURE__ */
|
|
3605
|
+
return /* @__PURE__ */ jsx24("div", { className: `bg-sec-100 rounded animate-pulse ${className || "max-w-full h-48"}`, children: /* @__PURE__ */ jsx24("div", { className: "w-full h-full flex items-center justify-center", children: /* @__PURE__ */ jsx24("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-main-500" }) }) });
|
|
3444
3606
|
}
|
|
3445
|
-
return /* @__PURE__ */
|
|
3607
|
+
return /* @__PURE__ */ jsx24(
|
|
3446
3608
|
"img",
|
|
3447
3609
|
{
|
|
3448
3610
|
src: fileUrl,
|
|
@@ -3453,11 +3615,11 @@ function FileDisplayContent({
|
|
|
3453
3615
|
);
|
|
3454
3616
|
}
|
|
3455
3617
|
if (displayOnly && showFallback && (!fileUrl || imageError || !isImage)) {
|
|
3456
|
-
return /* @__PURE__ */
|
|
3618
|
+
return /* @__PURE__ */ jsx24("div", { className: fallbackClasses, title: fileReference.file_metadata.fileName || "File", children: computedFallbackText });
|
|
3457
3619
|
}
|
|
3458
3620
|
return /* @__PURE__ */ jsxs17("div", { className: `space-y-2 ${className}`, children: [
|
|
3459
3621
|
isImage && fileUrl && !imageError ? /* @__PURE__ */ jsxs17("div", { className: "relative", children: [
|
|
3460
|
-
/* @__PURE__ */
|
|
3622
|
+
/* @__PURE__ */ jsx24(
|
|
3461
3623
|
"img",
|
|
3462
3624
|
{
|
|
3463
3625
|
src: fileUrl,
|
|
@@ -3467,7 +3629,7 @@ function FileDisplayContent({
|
|
|
3467
3629
|
}
|
|
3468
3630
|
),
|
|
3469
3631
|
showDelete && /* @__PURE__ */ jsxs17(Fragment6, { children: [
|
|
3470
|
-
/* @__PURE__ */
|
|
3632
|
+
/* @__PURE__ */ jsx24(
|
|
3471
3633
|
"button",
|
|
3472
3634
|
{
|
|
3473
3635
|
onClick: handleDeleteClick,
|
|
@@ -3477,29 +3639,29 @@ function FileDisplayContent({
|
|
|
3477
3639
|
children: "\xD7"
|
|
3478
3640
|
}
|
|
3479
3641
|
),
|
|
3480
|
-
/* @__PURE__ */
|
|
3481
|
-
/* @__PURE__ */
|
|
3482
|
-
/* @__PURE__ */
|
|
3642
|
+
/* @__PURE__ */ jsx24(Dialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */ jsxs17(DialogContent, { size: "sm", children: [
|
|
3643
|
+
/* @__PURE__ */ jsx24(DialogHeader, { children: /* @__PURE__ */ jsx24(DialogTitle, { children: "Confirm Delete" }) }),
|
|
3644
|
+
/* @__PURE__ */ jsx24(DialogBody, { children: /* @__PURE__ */ jsx24("p", { children: "Are you sure you want to delete this file? This action cannot be undone." }) }),
|
|
3483
3645
|
/* @__PURE__ */ jsxs17(DialogFooter, { children: [
|
|
3484
|
-
/* @__PURE__ */
|
|
3485
|
-
/* @__PURE__ */
|
|
3646
|
+
/* @__PURE__ */ jsx24(Button, { variant: "outline", onClick: () => setDeleteDialogOpen(false), children: "Cancel" }),
|
|
3647
|
+
/* @__PURE__ */ jsx24(Button, { variant: "destructive", onClick: handleDeleteConfirm, children: "Delete" })
|
|
3486
3648
|
] })
|
|
3487
3649
|
] }) })
|
|
3488
3650
|
] })
|
|
3489
3651
|
] }) : isImage && imageError && showFallback ? (
|
|
3490
3652
|
// Show fallback when image fails to load and fallback is enabled
|
|
3491
|
-
/* @__PURE__ */
|
|
3653
|
+
/* @__PURE__ */ jsx24("div", { className: fallbackClasses, title: fileReference.file_metadata.fileName || "File", children: computedFallbackText })
|
|
3492
3654
|
) : /* @__PURE__ */ jsxs17("div", { className: "flex items-center space-x-3 p-3 bg-sec-50 rounded-lg border border-sec-200", children: [
|
|
3493
|
-
/* @__PURE__ */
|
|
3655
|
+
/* @__PURE__ */ jsx24("span", { className: "text-2xl", children: getFileIcon(fileReference.file_metadata.fileType || "") }),
|
|
3494
3656
|
/* @__PURE__ */ jsxs17("div", { className: "flex-1 min-w-0", children: [
|
|
3495
|
-
/* @__PURE__ */
|
|
3657
|
+
/* @__PURE__ */ jsx24("div", { className: "font-medium text-sec-900 truncate", children: fileReference.file_metadata.fileName || "Unknown file" }),
|
|
3496
3658
|
/* @__PURE__ */ jsxs17("div", { className: "text-sm text-sec-500", children: [
|
|
3497
3659
|
fileReference.file_metadata.fileSize && formatFileSize(fileReference.file_metadata.fileSize),
|
|
3498
3660
|
fileReference.file_metadata.fileType && ` \u2022 ${fileReference.file_metadata.fileType}`
|
|
3499
3661
|
] })
|
|
3500
3662
|
] }),
|
|
3501
3663
|
showDelete && /* @__PURE__ */ jsxs17(Fragment6, { children: [
|
|
3502
|
-
/* @__PURE__ */
|
|
3664
|
+
/* @__PURE__ */ jsx24(
|
|
3503
3665
|
"button",
|
|
3504
3666
|
{
|
|
3505
3667
|
onClick: handleDeleteClick,
|
|
@@ -3509,12 +3671,12 @@ function FileDisplayContent({
|
|
|
3509
3671
|
children: "\xD7"
|
|
3510
3672
|
}
|
|
3511
3673
|
),
|
|
3512
|
-
/* @__PURE__ */
|
|
3513
|
-
/* @__PURE__ */
|
|
3514
|
-
/* @__PURE__ */
|
|
3674
|
+
/* @__PURE__ */ jsx24(Dialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */ jsxs17(DialogContent, { size: "sm", children: [
|
|
3675
|
+
/* @__PURE__ */ jsx24(DialogHeader, { children: /* @__PURE__ */ jsx24(DialogTitle, { children: "Confirm Delete" }) }),
|
|
3676
|
+
/* @__PURE__ */ jsx24(DialogBody, { children: /* @__PURE__ */ jsx24("p", { children: "Are you sure you want to delete this file? This action cannot be undone." }) }),
|
|
3515
3677
|
/* @__PURE__ */ jsxs17(DialogFooter, { children: [
|
|
3516
|
-
/* @__PURE__ */
|
|
3517
|
-
/* @__PURE__ */
|
|
3678
|
+
/* @__PURE__ */ jsx24(Button, { variant: "outline", onClick: () => setDeleteDialogOpen(false), children: "Cancel" }),
|
|
3679
|
+
/* @__PURE__ */ jsx24(Button, { variant: "destructive", onClick: handleDeleteConfirm, children: "Delete" })
|
|
3518
3680
|
] })
|
|
3519
3681
|
] }) })
|
|
3520
3682
|
] })
|
|
@@ -3528,7 +3690,7 @@ function FileDisplayContent({
|
|
|
3528
3690
|
const fileUrl2 = internalFileUrls.get(fileRef.id) || null;
|
|
3529
3691
|
const canDownload = !isImage && fileUrl2;
|
|
3530
3692
|
return /* @__PURE__ */ jsxs17("div", { className: "flex items-center space-x-3 p-3 bg-sec-50 rounded-lg border border-sec-200", children: [
|
|
3531
|
-
isImage && fileUrl2 ? /* @__PURE__ */
|
|
3693
|
+
isImage && fileUrl2 ? /* @__PURE__ */ jsx24(
|
|
3532
3694
|
"img",
|
|
3533
3695
|
{
|
|
3534
3696
|
src: fileUrl2,
|
|
@@ -3536,9 +3698,9 @@ function FileDisplayContent({
|
|
|
3536
3698
|
className: "w-12 h-12 object-cover rounded",
|
|
3537
3699
|
onError: handleImageError
|
|
3538
3700
|
}
|
|
3539
|
-
) : /* @__PURE__ */
|
|
3701
|
+
) : /* @__PURE__ */ jsx24("span", { className: "text-2xl", children: getFileIcon(fileRef.file_metadata.fileType || "") }),
|
|
3540
3702
|
/* @__PURE__ */ jsxs17("div", { className: "flex-1 min-w-0", children: [
|
|
3541
|
-
/* @__PURE__ */
|
|
3703
|
+
/* @__PURE__ */ jsx24("div", { className: "font-medium text-sec-900 truncate", children: fileRef.file_metadata.fileName || "Unknown file" }),
|
|
3542
3704
|
/* @__PURE__ */ jsxs17("div", { className: "text-sm text-sec-500", children: [
|
|
3543
3705
|
fileRef.file_metadata.fileSize && formatFileSize(fileRef.file_metadata.fileSize),
|
|
3544
3706
|
fileRef.file_metadata.fileType && ` \u2022 ${fileRef.file_metadata.fileType}`,
|
|
@@ -3546,7 +3708,7 @@ function FileDisplayContent({
|
|
|
3546
3708
|
] })
|
|
3547
3709
|
] }),
|
|
3548
3710
|
/* @__PURE__ */ jsxs17("div", { className: "flex items-center space-x-2", children: [
|
|
3549
|
-
canDownload && /* @__PURE__ */
|
|
3711
|
+
canDownload && /* @__PURE__ */ jsx24(
|
|
3550
3712
|
"a",
|
|
3551
3713
|
{
|
|
3552
3714
|
href: fileRef.file_path,
|
|
@@ -3556,7 +3718,7 @@ function FileDisplayContent({
|
|
|
3556
3718
|
children: "\u2193"
|
|
3557
3719
|
}
|
|
3558
3720
|
),
|
|
3559
|
-
showDelete && onDelete && /* @__PURE__ */
|
|
3721
|
+
showDelete && onDelete && /* @__PURE__ */ jsx24(
|
|
3560
3722
|
"button",
|
|
3561
3723
|
{
|
|
3562
3724
|
onClick: handleDeleteClick,
|
|
@@ -3592,7 +3754,7 @@ function FileDisplayPublic({
|
|
|
3592
3754
|
const supabase = publicPageContext?.supabase ?? null;
|
|
3593
3755
|
if (!supabase) {
|
|
3594
3756
|
if (showFallback) {
|
|
3595
|
-
return /* @__PURE__ */
|
|
3757
|
+
return /* @__PURE__ */ jsx24(
|
|
3596
3758
|
FileDisplayContent,
|
|
3597
3759
|
{
|
|
3598
3760
|
isLoading: false,
|
|
@@ -3618,7 +3780,7 @@ function FileDisplayPublic({
|
|
|
3618
3780
|
}
|
|
3619
3781
|
);
|
|
3620
3782
|
}
|
|
3621
|
-
return /* @__PURE__ */
|
|
3783
|
+
return /* @__PURE__ */ jsx24("div", { className: `text-sec-500 text-center p-4 ${className}`, children: "Supabase client not available in public context" });
|
|
3622
3784
|
}
|
|
3623
3785
|
const {
|
|
3624
3786
|
fileUrl,
|
|
@@ -3662,7 +3824,7 @@ function FileDisplayPublic({
|
|
|
3662
3824
|
finalFileCount = 1;
|
|
3663
3825
|
finalFileUrl = fileUrls.get(targetFile.id) || null;
|
|
3664
3826
|
}
|
|
3665
|
-
return /* @__PURE__ */
|
|
3827
|
+
return /* @__PURE__ */ jsx24(
|
|
3666
3828
|
FileDisplayContent,
|
|
3667
3829
|
{
|
|
3668
3830
|
isLoading,
|
|
@@ -3706,7 +3868,7 @@ function FileDisplayAuthenticated({
|
|
|
3706
3868
|
}) {
|
|
3707
3869
|
const { supabase } = useUnifiedAuth();
|
|
3708
3870
|
if (!supabase) {
|
|
3709
|
-
return /* @__PURE__ */
|
|
3871
|
+
return /* @__PURE__ */ jsx24("div", { className: `text-sec-500 text-center p-4 ${className}`, children: "Supabase client not available in authenticated context" });
|
|
3710
3872
|
}
|
|
3711
3873
|
const {
|
|
3712
3874
|
fileUrl,
|
|
@@ -3764,7 +3926,7 @@ function FileDisplayAuthenticated({
|
|
|
3764
3926
|
finalError = error || displayOnlyFileUrlHook.error;
|
|
3765
3927
|
}
|
|
3766
3928
|
}
|
|
3767
|
-
return /* @__PURE__ */
|
|
3929
|
+
return /* @__PURE__ */ jsx24(
|
|
3768
3930
|
FileDisplayContent,
|
|
3769
3931
|
{
|
|
3770
3932
|
isLoading: finalIsLoading,
|
|
@@ -3809,7 +3971,7 @@ function FileDisplay({
|
|
|
3809
3971
|
}) {
|
|
3810
3972
|
const isPublicPage = useIsPublicPage();
|
|
3811
3973
|
if (isPublicPage) {
|
|
3812
|
-
return /* @__PURE__ */
|
|
3974
|
+
return /* @__PURE__ */ jsx24(
|
|
3813
3975
|
FileDisplayPublic,
|
|
3814
3976
|
{
|
|
3815
3977
|
table_name,
|
|
@@ -3829,7 +3991,7 @@ function FileDisplay({
|
|
|
3829
3991
|
}
|
|
3830
3992
|
);
|
|
3831
3993
|
}
|
|
3832
|
-
return /* @__PURE__ */
|
|
3994
|
+
return /* @__PURE__ */ jsx24(
|
|
3833
3995
|
FileDisplayAuthenticated,
|
|
3834
3996
|
{
|
|
3835
3997
|
table_name,
|
|
@@ -3851,9 +4013,9 @@ function FileDisplay({
|
|
|
3851
4013
|
}
|
|
3852
4014
|
|
|
3853
4015
|
// src/components/Table/Table.tsx
|
|
3854
|
-
import * as
|
|
3855
|
-
import { jsx as
|
|
3856
|
-
var Table =
|
|
4016
|
+
import * as React21 from "react";
|
|
4017
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
4018
|
+
var Table = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx25(
|
|
3857
4019
|
"table",
|
|
3858
4020
|
{
|
|
3859
4021
|
ref,
|
|
@@ -3862,9 +4024,9 @@ var Table = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
3862
4024
|
}
|
|
3863
4025
|
));
|
|
3864
4026
|
Table.displayName = "Table";
|
|
3865
|
-
var TableHeader =
|
|
4027
|
+
var TableHeader = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx25("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
3866
4028
|
TableHeader.displayName = "TableHeader";
|
|
3867
|
-
var TableBody =
|
|
4029
|
+
var TableBody = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx25(
|
|
3868
4030
|
"tbody",
|
|
3869
4031
|
{
|
|
3870
4032
|
ref,
|
|
@@ -3873,7 +4035,7 @@ var TableBody = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
3873
4035
|
}
|
|
3874
4036
|
));
|
|
3875
4037
|
TableBody.displayName = "TableBody";
|
|
3876
|
-
var TableFooter =
|
|
4038
|
+
var TableFooter = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx25(
|
|
3877
4039
|
"tfoot",
|
|
3878
4040
|
{
|
|
3879
4041
|
ref,
|
|
@@ -3885,7 +4047,7 @@ var TableFooter = React18.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
3885
4047
|
}
|
|
3886
4048
|
));
|
|
3887
4049
|
TableFooter.displayName = "TableFooter";
|
|
3888
|
-
var TableRow =
|
|
4050
|
+
var TableRow = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx25(
|
|
3889
4051
|
"tr",
|
|
3890
4052
|
{
|
|
3891
4053
|
ref,
|
|
@@ -3897,7 +4059,7 @@ var TableRow = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
3897
4059
|
}
|
|
3898
4060
|
));
|
|
3899
4061
|
TableRow.displayName = "TableRow";
|
|
3900
|
-
var TableHead =
|
|
4062
|
+
var TableHead = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx25(
|
|
3901
4063
|
"th",
|
|
3902
4064
|
{
|
|
3903
4065
|
ref,
|
|
@@ -3909,7 +4071,7 @@ var TableHead = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
3909
4071
|
}
|
|
3910
4072
|
));
|
|
3911
4073
|
TableHead.displayName = "TableHead";
|
|
3912
|
-
var TableCell =
|
|
4074
|
+
var TableCell = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx25(
|
|
3913
4075
|
"td",
|
|
3914
4076
|
{
|
|
3915
4077
|
ref,
|
|
@@ -3918,7 +4080,7 @@ var TableCell = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
3918
4080
|
}
|
|
3919
4081
|
));
|
|
3920
4082
|
TableCell.displayName = "TableCell";
|
|
3921
|
-
var TableCaption =
|
|
4083
|
+
var TableCaption = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx25(
|
|
3922
4084
|
"caption",
|
|
3923
4085
|
{
|
|
3924
4086
|
ref,
|
|
@@ -3929,7 +4091,7 @@ var TableCaption = React18.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
3929
4091
|
TableCaption.displayName = "TableCaption";
|
|
3930
4092
|
|
|
3931
4093
|
// src/components/PublicLayout/PublicPageHeader.tsx
|
|
3932
|
-
import { Fragment as Fragment7, jsx as
|
|
4094
|
+
import { Fragment as Fragment7, jsx as jsx26, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3933
4095
|
function PublicPageHeader({
|
|
3934
4096
|
event,
|
|
3935
4097
|
eventCode,
|
|
@@ -3946,7 +4108,7 @@ function PublicPageHeader({
|
|
|
3946
4108
|
"w-full px-[max(0rem,calc((100vw-var(--app-width))/2-0.5rem))] grid grid-cols-[auto_1fr_auto] place-items-center gap-2",
|
|
3947
4109
|
className
|
|
3948
4110
|
), children: [
|
|
3949
|
-
showAppLogo && appName && /* @__PURE__ */
|
|
4111
|
+
showAppLogo && appName && /* @__PURE__ */ jsx26(
|
|
3950
4112
|
"img",
|
|
3951
4113
|
{
|
|
3952
4114
|
className: "ml-4 max-w-36 object-contain row-span-2",
|
|
@@ -3955,8 +4117,8 @@ function PublicPageHeader({
|
|
|
3955
4117
|
}
|
|
3956
4118
|
),
|
|
3957
4119
|
event && /* @__PURE__ */ jsxs18(Fragment7, { children: [
|
|
3958
|
-
/* @__PURE__ */
|
|
3959
|
-
showEventLogo && event && /* @__PURE__ */
|
|
4120
|
+
/* @__PURE__ */ jsx26("h1", { children: event.event_name }),
|
|
4121
|
+
showEventLogo && event && /* @__PURE__ */ jsx26(Fragment7, { children: customEventLogo || /* @__PURE__ */ jsx26(Fragment7, { children: /* @__PURE__ */ jsx26(
|
|
3960
4122
|
FileDisplay,
|
|
3961
4123
|
{
|
|
3962
4124
|
table_name: "event",
|
|
@@ -3973,18 +4135,18 @@ function PublicPageHeader({
|
|
|
3973
4135
|
}
|
|
3974
4136
|
}
|
|
3975
4137
|
) }) }),
|
|
3976
|
-
event.event_venue && /* @__PURE__ */
|
|
4138
|
+
event.event_venue && /* @__PURE__ */ jsx26("h4", { children: event.event_venue })
|
|
3977
4139
|
] }),
|
|
3978
4140
|
title && /* @__PURE__ */ jsxs18(Fragment7, { children: [
|
|
3979
|
-
/* @__PURE__ */
|
|
3980
|
-
description && /* @__PURE__ */
|
|
4141
|
+
/* @__PURE__ */ jsx26("h1", { children: title }),
|
|
4142
|
+
description && /* @__PURE__ */ jsx26("p", { className: "text-lg text-sec-600 max-w-3xl mx-auto", children: description })
|
|
3981
4143
|
] }),
|
|
3982
|
-
children && /* @__PURE__ */
|
|
4144
|
+
children && /* @__PURE__ */ jsx26(Fragment7, { children })
|
|
3983
4145
|
] });
|
|
3984
4146
|
}
|
|
3985
4147
|
|
|
3986
4148
|
// src/components/PublicLayout/PublicPageFooter.tsx
|
|
3987
|
-
import { Fragment as Fragment8, jsx as
|
|
4149
|
+
import { Fragment as Fragment8, jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3988
4150
|
function PublicPageFooter({
|
|
3989
4151
|
event,
|
|
3990
4152
|
companyName = "Solvera Solutions Pty Ltd",
|
|
@@ -3996,16 +4158,16 @@ function PublicPageFooter({
|
|
|
3996
4158
|
children
|
|
3997
4159
|
}) {
|
|
3998
4160
|
const copyrightText = copyright || `\xA9 Copyright 2022\u2013${year} all rights reserved, ${companyName}.`;
|
|
3999
|
-
return /* @__PURE__ */
|
|
4000
|
-
logo && /* @__PURE__ */
|
|
4001
|
-
children && /* @__PURE__ */
|
|
4002
|
-
/* @__PURE__ */
|
|
4003
|
-
links && links.length > 0 && /* @__PURE__ */
|
|
4161
|
+
return /* @__PURE__ */ jsx27("footer", { className: cn("mt-8 py-6 flex justify-center", className), children: /* @__PURE__ */ jsxs19("section", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto text-center", children: [
|
|
4162
|
+
logo && /* @__PURE__ */ jsx27("img", { src: logo, alt: "Logo", className: "h-8 w-auto" }),
|
|
4163
|
+
children && /* @__PURE__ */ jsx27(Fragment8, { children }),
|
|
4164
|
+
/* @__PURE__ */ jsx27("span", { className: "text-muted-foreground", children: copyrightText }),
|
|
4165
|
+
links && links.length > 0 && /* @__PURE__ */ jsx27("ul", { className: "flex gap-4 mt-2 md:mt-0", children: links.map((link, index) => /* @__PURE__ */ jsx27("li", { children: /* @__PURE__ */ jsx27("a", { href: link.href, className: "text-muted-foreground hover:text-foreground", children: link.label }) }, index)) })
|
|
4004
4166
|
] }) });
|
|
4005
4167
|
}
|
|
4006
4168
|
|
|
4007
4169
|
// src/components/PublicLayout/PublicLoadingSpinner.tsx
|
|
4008
|
-
import { jsx as
|
|
4170
|
+
import { jsx as jsx28, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4009
4171
|
var sizeClasses = {
|
|
4010
4172
|
sm: "h-4 w-4",
|
|
4011
4173
|
md: "h-8 w-8",
|
|
@@ -4023,7 +4185,7 @@ function PublicLoadingSpinner({
|
|
|
4023
4185
|
const sizeClass = sizeClasses[size];
|
|
4024
4186
|
const displayMessage = customMessage || message;
|
|
4025
4187
|
const content = /* @__PURE__ */ jsxs20("div", { className: cn("flex flex-col items-center", className), children: [
|
|
4026
|
-
showLogo && /* @__PURE__ */
|
|
4188
|
+
showLogo && /* @__PURE__ */ jsx28("div", { className: "mb-4", children: /* @__PURE__ */ jsx28(
|
|
4027
4189
|
"img",
|
|
4028
4190
|
{
|
|
4029
4191
|
className: "h-8 w-auto",
|
|
@@ -4032,7 +4194,7 @@ function PublicLoadingSpinner({
|
|
|
4032
4194
|
}
|
|
4033
4195
|
) }),
|
|
4034
4196
|
/* @__PURE__ */ jsxs20("div", { className: "relative", children: [
|
|
4035
|
-
/* @__PURE__ */
|
|
4197
|
+
/* @__PURE__ */ jsx28(
|
|
4036
4198
|
"div",
|
|
4037
4199
|
{
|
|
4038
4200
|
className: cn(
|
|
@@ -4043,12 +4205,12 @@ function PublicLoadingSpinner({
|
|
|
4043
4205
|
"aria-label": "Loading"
|
|
4044
4206
|
}
|
|
4045
4207
|
),
|
|
4046
|
-
/* @__PURE__ */
|
|
4208
|
+
/* @__PURE__ */ jsx28("span", { className: "sr-only", children: displayMessage })
|
|
4047
4209
|
] }),
|
|
4048
|
-
displayMessage && /* @__PURE__ */
|
|
4210
|
+
displayMessage && /* @__PURE__ */ jsx28("p", { className: "mt-4 text-sm text-sec-600 text-center", children: displayMessage })
|
|
4049
4211
|
] });
|
|
4050
4212
|
if (centered) {
|
|
4051
|
-
return /* @__PURE__ */
|
|
4213
|
+
return /* @__PURE__ */ jsx28("div", { className: "min-h-screen bg-background flex items-center justify-center", children: /* @__PURE__ */ jsx28("div", { className: "max-w-md mx-auto px-4", children: content }) });
|
|
4052
4214
|
}
|
|
4053
4215
|
return content;
|
|
4054
4216
|
}
|
|
@@ -4057,11 +4219,11 @@ function PublicLoadingSpinnerFullPage({
|
|
|
4057
4219
|
eventName,
|
|
4058
4220
|
className = ""
|
|
4059
4221
|
}) {
|
|
4060
|
-
return /* @__PURE__ */
|
|
4222
|
+
return /* @__PURE__ */ jsx28("div", { className: cn(
|
|
4061
4223
|
"min-h-screen bg-background flex items-center justify-center",
|
|
4062
4224
|
className
|
|
4063
4225
|
), children: /* @__PURE__ */ jsxs20("div", { className: "max-w-md mx-auto text-center px-4", children: [
|
|
4064
|
-
/* @__PURE__ */
|
|
4226
|
+
/* @__PURE__ */ jsx28("div", { className: "mb-8", children: /* @__PURE__ */ jsx28(
|
|
4065
4227
|
"img",
|
|
4066
4228
|
{
|
|
4067
4229
|
className: "h-12 w-auto mx-auto",
|
|
@@ -4069,8 +4231,8 @@ function PublicLoadingSpinnerFullPage({
|
|
|
4069
4231
|
alt: "PACE Core"
|
|
4070
4232
|
}
|
|
4071
4233
|
) }),
|
|
4072
|
-
eventName && /* @__PURE__ */
|
|
4073
|
-
/* @__PURE__ */
|
|
4234
|
+
eventName && /* @__PURE__ */ jsx28("h1", { className: "text-2xl font-bold text-sec-900 mb-4", children: eventName }),
|
|
4235
|
+
/* @__PURE__ */ jsx28("div", { className: "relative mb-6", children: /* @__PURE__ */ jsx28(
|
|
4074
4236
|
"div",
|
|
4075
4237
|
{
|
|
4076
4238
|
className: "h-12 w-12 border-4 border-sec-200 border-t-main-600 rounded-full animate-spin mx-auto",
|
|
@@ -4078,11 +4240,11 @@ function PublicLoadingSpinnerFullPage({
|
|
|
4078
4240
|
"aria-label": "Loading"
|
|
4079
4241
|
}
|
|
4080
4242
|
) }),
|
|
4081
|
-
/* @__PURE__ */
|
|
4243
|
+
/* @__PURE__ */ jsx28("p", { className: "text-lg text-sec-600", children: message }),
|
|
4082
4244
|
/* @__PURE__ */ jsxs20("div", { className: "mt-4 flex justify-center space-x-1", children: [
|
|
4083
|
-
/* @__PURE__ */
|
|
4084
|
-
/* @__PURE__ */
|
|
4085
|
-
/* @__PURE__ */
|
|
4245
|
+
/* @__PURE__ */ jsx28("div", { className: "h-2 w-2 bg-main-600 rounded-full animate-bounce", style: { animationDelay: "0ms" } }),
|
|
4246
|
+
/* @__PURE__ */ jsx28("div", { className: "h-2 w-2 bg-main-600 rounded-full animate-bounce", style: { animationDelay: "150ms" } }),
|
|
4247
|
+
/* @__PURE__ */ jsx28("div", { className: "h-2 w-2 bg-main-600 rounded-full animate-bounce", style: { animationDelay: "300ms" } })
|
|
4086
4248
|
] })
|
|
4087
4249
|
] }) });
|
|
4088
4250
|
}
|
|
@@ -4090,7 +4252,7 @@ function PublicLoadingSkeleton({
|
|
|
4090
4252
|
lines = 3,
|
|
4091
4253
|
className = ""
|
|
4092
4254
|
}) {
|
|
4093
|
-
return /* @__PURE__ */
|
|
4255
|
+
return /* @__PURE__ */ jsx28("div", { className: cn("animate-pulse", className), children: Array.from({ length: lines }).map((_, index) => /* @__PURE__ */ jsx28(
|
|
4094
4256
|
"div",
|
|
4095
4257
|
{
|
|
4096
4258
|
className: cn(
|
|
@@ -4103,7 +4265,7 @@ function PublicLoadingSkeleton({
|
|
|
4103
4265
|
}
|
|
4104
4266
|
|
|
4105
4267
|
// src/components/PublicLayout/PublicPageLayout.tsx
|
|
4106
|
-
import { Fragment as Fragment9, jsx as
|
|
4268
|
+
import { Fragment as Fragment9, jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4107
4269
|
function PublicPageLayout({
|
|
4108
4270
|
eventCode,
|
|
4109
4271
|
children,
|
|
@@ -4125,7 +4287,7 @@ function PublicPageLayout({
|
|
|
4125
4287
|
});
|
|
4126
4288
|
if (isLoading) {
|
|
4127
4289
|
if (LoadingFallback === PublicLoadingSpinner) {
|
|
4128
|
-
return /* @__PURE__ */
|
|
4290
|
+
return /* @__PURE__ */ jsx29(
|
|
4129
4291
|
PublicLoadingSpinner,
|
|
4130
4292
|
{
|
|
4131
4293
|
className: "items-center justify-center",
|
|
@@ -4133,39 +4295,39 @@ function PublicPageLayout({
|
|
|
4133
4295
|
}
|
|
4134
4296
|
);
|
|
4135
4297
|
}
|
|
4136
|
-
return /* @__PURE__ */
|
|
4298
|
+
return /* @__PURE__ */ jsx29(LoadingFallback, {});
|
|
4137
4299
|
}
|
|
4138
4300
|
if (error && showValidationErrors) {
|
|
4139
4301
|
if (ErrorFallback) {
|
|
4140
|
-
return /* @__PURE__ */
|
|
4302
|
+
return /* @__PURE__ */ jsx29(ErrorFallback, { error, retry: handleRefetch });
|
|
4141
4303
|
}
|
|
4142
4304
|
return /* @__PURE__ */ jsxs21("main", { className: "flex flex-col items-center justify-center px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children: [
|
|
4143
|
-
/* @__PURE__ */
|
|
4305
|
+
/* @__PURE__ */ jsx29("h1", { children: "Event Not Found" }),
|
|
4144
4306
|
/* @__PURE__ */ jsxs21("p", { children: [
|
|
4145
4307
|
'The event code "',
|
|
4146
4308
|
eventCode,
|
|
4147
4309
|
'" is invalid or the event is not available for public viewing.'
|
|
4148
4310
|
] }),
|
|
4149
|
-
/* @__PURE__ */
|
|
4311
|
+
/* @__PURE__ */ jsx29(Button, { onClick: handleRefetch, children: "Try Again" })
|
|
4150
4312
|
] });
|
|
4151
4313
|
}
|
|
4152
4314
|
if (!event && showValidationErrors) {
|
|
4153
4315
|
return /* @__PURE__ */ jsxs21("main", { className: "flex flex-col items-center justify-center px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children: [
|
|
4154
|
-
/* @__PURE__ */
|
|
4155
|
-
/* @__PURE__ */
|
|
4156
|
-
handleRefetch && /* @__PURE__ */
|
|
4316
|
+
/* @__PURE__ */ jsx29("h1", { children: "Event Not Available" }),
|
|
4317
|
+
/* @__PURE__ */ jsx29("p", { children: "This event is not available for public viewing." }),
|
|
4318
|
+
handleRefetch && /* @__PURE__ */ jsx29(Button, { onClick: handleRefetch, children: "Try Again" })
|
|
4157
4319
|
] });
|
|
4158
4320
|
}
|
|
4159
|
-
return /* @__PURE__ */
|
|
4160
|
-
customHeader || /* @__PURE__ */
|
|
4321
|
+
return /* @__PURE__ */ jsx29(PublicErrorBoundary, { children: /* @__PURE__ */ jsxs21(Fragment9, { children: [
|
|
4322
|
+
customHeader || /* @__PURE__ */ jsx29(
|
|
4161
4323
|
PublicPageHeader,
|
|
4162
4324
|
{
|
|
4163
4325
|
event: event || void 0,
|
|
4164
4326
|
eventCode
|
|
4165
4327
|
}
|
|
4166
4328
|
),
|
|
4167
|
-
/* @__PURE__ */
|
|
4168
|
-
showFooter && event && (customFooter || /* @__PURE__ */
|
|
4329
|
+
/* @__PURE__ */ jsx29("main", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children }),
|
|
4330
|
+
showFooter && event && (customFooter || /* @__PURE__ */ jsx29(PublicPageFooter, { event }))
|
|
4169
4331
|
] }) });
|
|
4170
4332
|
}
|
|
4171
4333
|
function usePublicPageContext2() {
|
|
@@ -4184,7 +4346,7 @@ function usePublicPageContext2() {
|
|
|
4184
4346
|
// src/components/PublicLayout/PublicPageContextChecker.tsx
|
|
4185
4347
|
import { useEffect as useEffect9 } from "react";
|
|
4186
4348
|
init_logger();
|
|
4187
|
-
import { jsx as
|
|
4349
|
+
import { jsx as jsx30, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4188
4350
|
function PublicPageContextChecker({ enabled = true, label = "PublicPage" }) {
|
|
4189
4351
|
const isDebugEnabled = import.meta.env.MODE === "development" && import.meta.env.VITE_ENABLE_DEBUG_LOGS === "true" || import.meta.env.MODE === "test" || import.meta.env.VITEST === true || typeof process !== "undefined" && false;
|
|
4190
4352
|
if (!isDebugEnabled || !enabled) {
|
|
@@ -4252,15 +4414,15 @@ function PublicPageContextChecker({ enabled = true, label = "PublicPage" }) {
|
|
|
4252
4414
|
borderRadius: "0 0 8px 0",
|
|
4253
4415
|
border: "2px solid #dc2626"
|
|
4254
4416
|
}, children: [
|
|
4255
|
-
/* @__PURE__ */
|
|
4256
|
-
/* @__PURE__ */
|
|
4257
|
-
/* @__PURE__ */
|
|
4417
|
+
/* @__PURE__ */ jsx30("div", { style: { fontWeight: "bold", marginBottom: "8px" }, children: "\u{1F6A8} PUBLIC PAGE CONTEXT CHECK" }),
|
|
4418
|
+
/* @__PURE__ */ jsx30("div", { children: "Check console for authentication context analysis" }),
|
|
4419
|
+
/* @__PURE__ */ jsx30("div", { style: { marginTop: "8px", fontSize: "10px", opacity: 0.9 }, children: "If you see \u274C errors in console, your public page is inside auth context!" })
|
|
4258
4420
|
] });
|
|
4259
4421
|
}
|
|
4260
4422
|
|
|
4261
4423
|
// src/components/PublicLayout/EventLogo.tsx
|
|
4262
|
-
import
|
|
4263
|
-
import { jsx as
|
|
4424
|
+
import React23 from "react";
|
|
4425
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
4264
4426
|
function defaultGenerateFallbackText2(eventName) {
|
|
4265
4427
|
if (!eventName) return "EV";
|
|
4266
4428
|
return eventName.split(" ").map((word) => word.charAt(0).toUpperCase()).join("").substring(0, 3);
|
|
@@ -4278,20 +4440,20 @@ function EventLogo({
|
|
|
4278
4440
|
loadingComponent: LoadingComponent,
|
|
4279
4441
|
errorComponent: ErrorComponent
|
|
4280
4442
|
}) {
|
|
4281
|
-
const adaptedGenerateFallbackText =
|
|
4443
|
+
const adaptedGenerateFallbackText = React23.useCallback(
|
|
4282
4444
|
(fileName) => {
|
|
4283
4445
|
return generateFallbackText(eventName || fileName || "");
|
|
4284
4446
|
},
|
|
4285
4447
|
[eventName, generateFallbackText]
|
|
4286
4448
|
);
|
|
4287
|
-
const adaptedErrorComponent = ErrorComponent ?
|
|
4449
|
+
const adaptedErrorComponent = ErrorComponent ? React23.useCallback(
|
|
4288
4450
|
({ error }) => {
|
|
4289
4451
|
const errorObj = error instanceof Error ? error : new Error(String(error || "Unknown error"));
|
|
4290
|
-
return /* @__PURE__ */
|
|
4452
|
+
return /* @__PURE__ */ jsx31(ErrorComponent, { error: errorObj });
|
|
4291
4453
|
},
|
|
4292
4454
|
[ErrorComponent]
|
|
4293
4455
|
) : void 0;
|
|
4294
|
-
return /* @__PURE__ */
|
|
4456
|
+
return /* @__PURE__ */ jsx31(
|
|
4295
4457
|
FileDisplay,
|
|
4296
4458
|
{
|
|
4297
4459
|
table_name: "event",
|
|
@@ -4309,7 +4471,7 @@ function EventLogo({
|
|
|
4309
4471
|
);
|
|
4310
4472
|
}
|
|
4311
4473
|
function EventLogoCompact(props) {
|
|
4312
|
-
return /* @__PURE__ */
|
|
4474
|
+
return /* @__PURE__ */ jsx31(
|
|
4313
4475
|
EventLogo,
|
|
4314
4476
|
{
|
|
4315
4477
|
...props,
|
|
@@ -4319,7 +4481,7 @@ function EventLogoCompact(props) {
|
|
|
4319
4481
|
);
|
|
4320
4482
|
}
|
|
4321
4483
|
function EventLogoLarge(props) {
|
|
4322
|
-
return /* @__PURE__ */
|
|
4484
|
+
return /* @__PURE__ */ jsx31(
|
|
4323
4485
|
EventLogo,
|
|
4324
4486
|
{
|
|
4325
4487
|
...props,
|
|
@@ -4332,11 +4494,17 @@ function EventLogoLarge(props) {
|
|
|
4332
4494
|
export {
|
|
4333
4495
|
init_EventProvider,
|
|
4334
4496
|
Label,
|
|
4497
|
+
Textarea,
|
|
4335
4498
|
Avatar,
|
|
4336
4499
|
AvatarImage,
|
|
4337
4500
|
AvatarFallback,
|
|
4338
4501
|
Badge,
|
|
4339
4502
|
Switch,
|
|
4503
|
+
Tabs,
|
|
4504
|
+
TabsList,
|
|
4505
|
+
TabsTrigger,
|
|
4506
|
+
TabsContent,
|
|
4507
|
+
Calendar,
|
|
4340
4508
|
ToastProvider,
|
|
4341
4509
|
ToastViewport,
|
|
4342
4510
|
Toast,
|
|
@@ -4385,4 +4553,4 @@ export {
|
|
|
4385
4553
|
EventLogoCompact,
|
|
4386
4554
|
EventLogoLarge
|
|
4387
4555
|
};
|
|
4388
|
-
//# sourceMappingURL=chunk-
|
|
4556
|
+
//# sourceMappingURL=chunk-ALUN6O3G.js.map
|