@jmruthers/pace-core 0.5.63 → 0.5.66

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.
Files changed (123) hide show
  1. package/dist/{DataTable-7BER7PDS.js → DataTable-MFUXNGPR.js} +2 -2
  2. package/dist/{DataTable-D15XipLZ.d.ts → DataTable-ntgmhO2W.d.ts} +1 -1
  3. package/dist/{chunk-S66AJVI2.js → chunk-4HQ5BOVZ.js} +97 -27
  4. package/dist/chunk-4HQ5BOVZ.js.map +1 -0
  5. package/dist/{chunk-2LPYEFXI.js → chunk-PSE2XO4L.js} +2 -2
  6. package/dist/components.d.ts +2 -2
  7. package/dist/components.js +2 -2
  8. package/dist/hooks.d.ts +1 -1
  9. package/dist/index.d.ts +90 -4
  10. package/dist/index.js +4 -2
  11. package/dist/index.js.map +1 -1
  12. package/dist/{types-E5WSpEtz.d.ts → types-CGX9Vyf5.d.ts} +8 -0
  13. package/dist/types.js.map +1 -1
  14. package/dist/utils.d.ts +2 -2
  15. package/dist/utils.js +1 -1
  16. package/docs/api/classes/ColumnFactory.md +243 -0
  17. package/docs/api/classes/ErrorBoundary.md +1 -1
  18. package/docs/api/classes/InvalidScopeError.md +1 -1
  19. package/docs/api/classes/MissingUserContextError.md +1 -1
  20. package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
  21. package/docs/api/classes/PermissionDeniedError.md +1 -1
  22. package/docs/api/classes/PublicErrorBoundary.md +1 -1
  23. package/docs/api/classes/RBACAuditManager.md +1 -1
  24. package/docs/api/classes/RBACCache.md +1 -1
  25. package/docs/api/classes/RBACEngine.md +1 -1
  26. package/docs/api/classes/RBACError.md +1 -1
  27. package/docs/api/classes/RBACNotInitializedError.md +1 -1
  28. package/docs/api/classes/SecureSupabaseClient.md +1 -1
  29. package/docs/api/classes/StorageUtils.md +1 -1
  30. package/docs/api/interfaces/AggregateConfig.md +4 -4
  31. package/docs/api/interfaces/ButtonProps.md +1 -1
  32. package/docs/api/interfaces/CardProps.md +1 -1
  33. package/docs/api/interfaces/ColorPalette.md +1 -1
  34. package/docs/api/interfaces/ColorShade.md +1 -1
  35. package/docs/api/interfaces/DataAccessRecord.md +1 -1
  36. package/docs/api/interfaces/DataTableAction.md +14 -14
  37. package/docs/api/interfaces/DataTableColumn.md +21 -21
  38. package/docs/api/interfaces/DataTableProps.md +1 -1
  39. package/docs/api/interfaces/DataTableToolbarButton.md +7 -7
  40. package/docs/api/interfaces/EmptyStateConfig.md +5 -5
  41. package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
  42. package/docs/api/interfaces/EventContextType.md +1 -1
  43. package/docs/api/interfaces/EventLogoProps.md +1 -1
  44. package/docs/api/interfaces/EventProviderProps.md +1 -1
  45. package/docs/api/interfaces/FileSizeLimits.md +1 -1
  46. package/docs/api/interfaces/FileUploadProps.md +1 -1
  47. package/docs/api/interfaces/FooterProps.md +1 -1
  48. package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
  49. package/docs/api/interfaces/InputProps.md +1 -1
  50. package/docs/api/interfaces/LabelProps.md +1 -1
  51. package/docs/api/interfaces/LoginFormProps.md +1 -1
  52. package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
  53. package/docs/api/interfaces/NavigationContextType.md +1 -1
  54. package/docs/api/interfaces/NavigationGuardProps.md +1 -1
  55. package/docs/api/interfaces/NavigationItem.md +1 -1
  56. package/docs/api/interfaces/NavigationMenuProps.md +1 -1
  57. package/docs/api/interfaces/NavigationProviderProps.md +1 -1
  58. package/docs/api/interfaces/Organisation.md +1 -1
  59. package/docs/api/interfaces/OrganisationContextType.md +1 -1
  60. package/docs/api/interfaces/OrganisationMembership.md +1 -1
  61. package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
  62. package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
  63. package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
  64. package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
  65. package/docs/api/interfaces/PageAccessRecord.md +1 -1
  66. package/docs/api/interfaces/PagePermissionContextType.md +1 -1
  67. package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
  68. package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
  69. package/docs/api/interfaces/PaletteData.md +1 -1
  70. package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
  71. package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
  72. package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
  73. package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
  74. package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
  75. package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
  76. package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
  77. package/docs/api/interfaces/RBACConfig.md +1 -1
  78. package/docs/api/interfaces/RBACContextType.md +1 -1
  79. package/docs/api/interfaces/RBACLogger.md +1 -1
  80. package/docs/api/interfaces/RBACProviderProps.md +1 -1
  81. package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
  82. package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
  83. package/docs/api/interfaces/RouteAccessRecord.md +1 -1
  84. package/docs/api/interfaces/RouteConfig.md +1 -1
  85. package/docs/api/interfaces/SecureDataContextType.md +1 -1
  86. package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
  87. package/docs/api/interfaces/StorageConfig.md +1 -1
  88. package/docs/api/interfaces/StorageFileInfo.md +1 -1
  89. package/docs/api/interfaces/StorageFileMetadata.md +1 -1
  90. package/docs/api/interfaces/StorageListOptions.md +1 -1
  91. package/docs/api/interfaces/StorageListResult.md +1 -1
  92. package/docs/api/interfaces/StorageUploadOptions.md +1 -1
  93. package/docs/api/interfaces/StorageUploadResult.md +1 -1
  94. package/docs/api/interfaces/StorageUrlOptions.md +1 -1
  95. package/docs/api/interfaces/StyleImport.md +1 -1
  96. package/docs/api/interfaces/ToastActionElement.md +1 -1
  97. package/docs/api/interfaces/ToastProps.md +1 -1
  98. package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
  99. package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
  100. package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
  101. package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
  102. package/docs/api/interfaces/UsePublicEventLogoOptions.md +1 -1
  103. package/docs/api/interfaces/UsePublicEventLogoReturn.md +1 -1
  104. package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
  105. package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
  106. package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
  107. package/docs/api/interfaces/UserEventAccess.md +1 -1
  108. package/docs/api/interfaces/UserMenuProps.md +1 -1
  109. package/docs/api/interfaces/UserProfile.md +1 -1
  110. package/docs/api/modules.md +5 -4
  111. package/package.json +1 -1
  112. package/src/components/DataTable/components/DataTableBody.tsx +27 -11
  113. package/src/components/DataTable/components/DataTableCore.tsx +13 -13
  114. package/src/components/DataTable/components/EditableRow.tsx +46 -28
  115. package/src/components/DataTable/components/UnifiedTableBody.tsx +86 -38
  116. package/src/components/DataTable/components/VirtualizedDataTable.tsx +5 -3
  117. package/src/components/DataTable/core/ColumnFactory.ts +4 -0
  118. package/src/components/DataTable/types.ts +10 -0
  119. package/src/index.ts +2 -1
  120. package/src/types/index.ts +2 -0
  121. package/dist/chunk-S66AJVI2.js.map +0 -1
  122. /package/dist/{DataTable-7BER7PDS.js.map → DataTable-MFUXNGPR.js.map} +0 -0
  123. /package/dist/{chunk-2LPYEFXI.js.map → chunk-PSE2XO4L.js.map} +0 -0
@@ -15,7 +15,7 @@ import {
15
15
  SelectSeparator,
16
16
  SelectTrigger,
17
17
  SelectValue
18
- } from "./chunk-S66AJVI2.js";
18
+ } from "./chunk-4HQ5BOVZ.js";
19
19
  import {
20
20
  isPermitted
21
21
  } from "./chunk-NHR52QAQ.js";
@@ -3149,4 +3149,4 @@ export {
3149
3149
  PublicPageDiagnostic,
3150
3150
  PublicPageContextChecker
3151
3151
  };
3152
- //# sourceMappingURL=chunk-2LPYEFXI.js.map
3152
+ //# sourceMappingURL=chunk-PSE2XO4L.js.map
@@ -1,8 +1,8 @@
1
1
  export { b as UnifiedAuthContextType, U as UnifiedAuthProvider, a as UnifiedAuthProviderProps, u as useUnifiedAuth } from './UnifiedAuthProvider-CQNiemcB.js';
2
2
  export { A as Alert, r as AlertDescription, q as AlertTitle, s as Avatar, u as AvatarFallback, t as AvatarImage, B as Button, g as ButtonProps, C as Card, m as CardActions, b3 as CardActionsProps, l as CardContent, k as CardDescription, i as CardFooter, h as CardHeader, n as CardProps, j as CardTitle, v as Checkbox, aU as DefaultPublicErrorFallback, D as Dialog, H as DialogBody, z as DialogClose, E as DialogContent, b6 as DialogContentProps, M as DialogDescription, bb as DialogDescriptionProps, J as DialogFooter, b9 as DialogFooterProps, G as DialogHeader, b8 as DialogHeaderProps, x as DialogOverlay, b7 as DialogOverlayProps, w as DialogPortal, b4 as DialogProps, bc as DialogSize, K as DialogTitle, ba as DialogTitleProps, y as DialogTrigger, b5 as DialogTriggerProps, ap as ErrorBoundary, bf as ErrorBoundaryProps, bg as ErrorBoundaryState, aP as EventLogo, aQ as EventLogoCompact, aR as EventLogoLarge, a$ as EventLogoProps, ar as EventSelector, ae as Footer, af as FooterProps, aa as Form, bd as FormProps, ad as Header, I as Input, o as InputProps, L as Label, p as LabelProps, aq as LoadingSpinner, ab as LoginForm, ac as LoginFormProps, ai as NavigationItem, ag as NavigationMenu, ah as NavigationMenuProps, as as OrganisationSelector, be as OrganisationSelectorProps, al as PaceAppLayout, am as PaceAppLayoutProps, an as PaceLoginPage, ao as PaceLoginPageProps, at as PasswordResetForm, P as Progress, aS as PublicErrorBoundary, b0 as PublicErrorBoundaryProps, b1 as PublicErrorBoundaryState, aX as PublicLoadingSkeleton, aV as PublicLoadingSpinner, aW as PublicLoadingSpinnerFullPage, b2 as PublicLoadingSpinnerProps, aO as PublicPageContextChecker, aM as PublicPageDebugger, aN as PublicPageDiagnostic, aL as PublicPageFooter, a_ as PublicPageFooterProps, aH as PublicPageHeader, aZ as PublicPageHeaderProps, aF as PublicPageLayout, aY as PublicPageLayoutProps, aI as PublicPageProvider, N as Select, T as SelectContent, O as SelectGroup, V as SelectItem, U as SelectLabel, W as SelectSeparator, R as SelectTrigger, Q as SelectValue, aw as Table, ay as TableBody, az as TableCaption, aA as TableCell, aB as TableFooter, aC as TableHead, ax as TableHeader, aD as TableRow, X as Toast, Z as ToastAction, a3 as ToastActionElement, a2 as ToastClose, a1 as ToastDescription, a4 as ToastProps, _ as ToastProvider, a0 as ToastTitle, $ as ToastViewport, Y as Toaster, a5 as Tooltip, a7 as TooltipContent, a8 as TooltipProvider, a9 as TooltipRoot, a6 as TooltipTrigger, bh as UseStorageOptions, bi as UseStorageReturn, aj as UserMenu, aT as useErrorBoundary, av as useFileUpload, aK as useIsPublicPage, aG as usePublicPageContext, aJ as usePublicPageProviderContext, au as useStorage } from './PublicLoadingSpinner-CXJ-W9wZ.js';
3
3
  export { u as useToast } from './useToast-Bm6TnSK-.js';
4
- export { D as DataTable, a as DataTableProps } from './DataTable-D15XipLZ.js';
5
- export { A as AggregateConfig, D as DataRecord, f as DataTableAction, a as DataTableColumn, g as DataTableToolbarButton, E as EmptyStateConfig, G as GetRowId } from './types-E5WSpEtz.js';
4
+ export { D as DataTable, a as DataTableProps } from './DataTable-ntgmhO2W.js';
5
+ export { A as AggregateConfig, D as DataRecord, f as DataTableAction, a as DataTableColumn, g as DataTableToolbarButton, E as EmptyStateConfig, G as GetRowId } from './types-CGX9Vyf5.js';
6
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
7
  import React__default from 'react';
8
8
  import { FieldValues, FieldPath, UseFormReturn } from 'react-hook-form';
@@ -53,7 +53,7 @@ import {
53
53
  useFileUpload,
54
54
  usePublicPageContext as usePublicPageContext2,
55
55
  useStorage
56
- } from "./chunk-2LPYEFXI.js";
56
+ } from "./chunk-PSE2XO4L.js";
57
57
  import {
58
58
  Alert,
59
59
  AlertDescription,
@@ -76,7 +76,7 @@ import {
76
76
  SelectSeparator,
77
77
  SelectTrigger,
78
78
  SelectValue
79
- } from "./chunk-S66AJVI2.js";
79
+ } from "./chunk-4HQ5BOVZ.js";
80
80
  import {
81
81
  useRBAC
82
82
  } from "./chunk-C7GUF747.js";
package/dist/hooks.d.ts CHANGED
@@ -5,7 +5,7 @@ export { O as OrganisationSecurityHook, r as UseAppConfigReturn, q as UseOrganis
5
5
  import * as react_hook_form from 'react-hook-form';
6
6
  import { z } from 'zod';
7
7
  export { u as useComponentPerformance } from './useComponentPerformance-DE9l5RkL.js';
8
- import { d as PaginationMode, D as DataRecord, P as PerformanceConfig, S as ServerSideConfig, C as ChunkingConfig, e as SearchIndexConfig, h as ServerSideParams, i as ServerSideResponse } from './types-E5WSpEtz.js';
8
+ import { d as PaginationMode, D as DataRecord, P as PerformanceConfig, S as ServerSideConfig, C as ChunkingConfig, e as SearchIndexConfig, h as ServerSideParams, i as ServerSideResponse } from './types-CGX9Vyf5.js';
9
9
  import './organisation-t-vvQC3g.js';
10
10
  import './unified-CMPjE_fv.js';
11
11
  import '@supabase/supabase-js';
package/dist/index.d.ts CHANGED
@@ -7,8 +7,10 @@ export { R as RBACContextType, a as RBACProvider, b as RBACProviderProps, U as U
7
7
  import { F as FileSizeLimits, S as StorageConfig, a as StorageUploadOptions, b as StorageFileMetadata, c as StorageUploadResult, d as StorageUrlOptions, e as StorageListOptions, f as StorageListResult } from './PublicLoadingSpinner-CXJ-W9wZ.js';
8
8
  export { A as Alert, r as AlertDescription, q as AlertTitle, s as Avatar, u as AvatarFallback, t as AvatarImage, B as Button, g as ButtonProps, C as Card, m as CardActions, l as CardContent, k as CardDescription, i as CardFooter, h as CardHeader, n as CardProps, j as CardTitle, v as Checkbox, aU as DefaultPublicErrorFallback, D as Dialog, H as DialogBody, z as DialogClose, E as DialogContent, M as DialogDescription, J as DialogFooter, G as DialogHeader, x as DialogOverlay, w as DialogPortal, K as DialogTitle, y as DialogTrigger, ap as ErrorBoundary, aP as EventLogo, aQ as EventLogoCompact, aR as EventLogoLarge, a$ as EventLogoProps, ar as EventSelector, ae as Footer, af as FooterProps, aa as Form, ad as Header, I as Input, o as InputProps, L as Label, p as LabelProps, aq as LoadingSpinner, ab as LoginForm, ac as LoginFormProps, ai as NavigationItem, ag as NavigationMenu, ah as NavigationMenuProps, as as OrganisationSelector, al as PaceAppLayout, am as PaceAppLayoutProps, an as PaceLoginPage, ao as PaceLoginPageProps, at as PasswordResetForm, P as Progress, aS as PublicErrorBoundary, b0 as PublicErrorBoundaryProps, b1 as PublicErrorBoundaryState, aX as PublicLoadingSkeleton, aV as PublicLoadingSpinner, aW as PublicLoadingSpinnerFullPage, b2 as PublicLoadingSpinnerProps, aO as PublicPageContextChecker, aM as PublicPageDebugger, aN as PublicPageDiagnostic, aL as PublicPageFooter, a_ as PublicPageFooterProps, aH as PublicPageHeader, aZ as PublicPageHeaderProps, aF as PublicPageLayout, aY as PublicPageLayoutProps, aI as PublicPageProvider, N as Select, T as SelectContent, O as SelectGroup, V as SelectItem, U as SelectLabel, W as SelectSeparator, R as SelectTrigger, Q as SelectValue, aE as StorageFileInfo, aw as Table, ay as TableBody, az as TableCaption, aA as TableCell, aB as TableFooter, aC as TableHead, ax as TableHeader, aD as TableRow, X as Toast, Z as ToastAction, a3 as ToastActionElement, a2 as ToastClose, a1 as ToastDescription, a4 as ToastProps, _ as ToastProvider, a0 as ToastTitle, $ as ToastViewport, Y as Toaster, a5 as Tooltip, a7 as TooltipContent, a8 as TooltipProvider, a9 as TooltipRoot, a6 as TooltipTrigger, aj as UserMenu, ak as UserMenuProps, aT as useErrorBoundary, av as useFileUpload, aK as useIsPublicPage, aG as usePublicPageContext, aJ as usePublicPageProviderContext, au as useStorage } from './PublicLoadingSpinner-CXJ-W9wZ.js';
9
9
  export { u as useToast } from './useToast-Bm6TnSK-.js';
10
- export { D as DataTable, a as DataTableProps } from './DataTable-D15XipLZ.js';
11
- export { A as AggregateConfig, D as DataRecord, f as DataTableAction, a as DataTableColumn, g as DataTableToolbarButton, E as EmptyStateConfig, G as GetRowId } from './types-E5WSpEtz.js';
10
+ export { D as DataTable, a as DataTableProps } from './DataTable-ntgmhO2W.js';
11
+ import { D as DataRecord, f as DataTableAction } from './types-CGX9Vyf5.js';
12
+ export { A as AggregateConfig, a as DataTableColumn, g as DataTableToolbarButton, E as EmptyStateConfig, G as GetRowId } from './types-CGX9Vyf5.js';
13
+ import { ColumnDef } from '@tanstack/react-table';
12
14
  export { o as UsePublicEventLogoOptions, n as UsePublicEventLogoReturn, m as UsePublicEventOptions, U as UsePublicEventReturn, p as UsePublicRouteParamsReturn, d as clearPublicEventCache, f as clearPublicLogoCache, l as extractEventCodeFromPath, k as generatePublicRoutePath, g as getPublicEventCacheStats, h as getPublicLogoCacheStats, b as useAppConfig, u as useOrganisationPermissions, a as useOrganisationSecurity, c as usePublicEvent, j as usePublicEventCode, e as usePublicEventLogo, i as usePublicRouteParams } from './usePublicRouteParams-CdoFxnJK.js';
13
15
  export { a as cn, c as createSecureDataAccess, j as formatCompactNumber, e as formatCurrency, f as formatDate, k as formatFileSize, h as formatNumber, i as formatPercent, g as getAppConfig, d as getCurrentAppId, b as getCurrentAppName, s as setAppConfig } from './formatting-BfDeV-ja.js';
14
16
  import React__default from 'react';
@@ -26,7 +28,6 @@ import '@radix-ui/react-toast';
26
28
  import '@radix-ui/react-tooltip';
27
29
  import 'react-hook-form';
28
30
  import 'zod';
29
- import '@tanstack/react-table';
30
31
  import 'clsx';
31
32
 
32
33
  /**
@@ -185,6 +186,91 @@ declare function useInactivityTracker({ idleTimeoutMs, // 30 minutes
185
186
  warnBeforeMs, // 1 minute
186
187
  onIdle, onWarning, onActivity, enabled, storageKey, channelName }?: UseInactivityTrackerOptions): UseInactivityTrackerReturn;
187
188
 
189
+ /**
190
+ * @file Column Factory
191
+ * @package @jmruthers/pace-core
192
+ * @module Components/DataTable/Architecture/Factories
193
+ * @since 0.3.0
194
+ */
195
+
196
+ interface TextColumnOptions {
197
+ label?: string;
198
+ sortable?: boolean;
199
+ filterable?: boolean;
200
+ groupable?: boolean;
201
+ hideable?: boolean;
202
+ render?: (value: any) => React.ReactNode;
203
+ footer?: React.ReactNode;
204
+ size?: number;
205
+ minSize?: number;
206
+ maxSize?: number;
207
+ }
208
+ interface NumberColumnOptions extends TextColumnOptions {
209
+ format?: (value: number) => string;
210
+ }
211
+ interface DateColumnOptions extends TextColumnOptions {
212
+ format?: (date: Date) => string;
213
+ locale?: string;
214
+ dateOptions?: Intl.DateTimeFormatOptions;
215
+ }
216
+ interface BooleanColumnOptions extends TextColumnOptions {
217
+ render?: (value: boolean) => React.ReactNode;
218
+ }
219
+ interface ActionColumnOptions {
220
+ header?: string;
221
+ render?: (row: DataRecord, actions: DataTableAction<DataRecord>[]) => React.ReactNode;
222
+ size?: number;
223
+ minSize?: number;
224
+ maxSize?: number;
225
+ }
226
+ interface CustomColumnOptions<TData extends DataRecord> {
227
+ header?: string;
228
+ cell?: (info: any) => React.ReactNode;
229
+ enableSorting?: boolean;
230
+ enableColumnFilter?: boolean;
231
+ enableGrouping?: boolean;
232
+ enableHiding?: boolean;
233
+ footer?: React.ReactNode;
234
+ size?: number;
235
+ minSize?: number;
236
+ maxSize?: number;
237
+ }
238
+ interface ColumnConfig<TData extends DataRecord> {
239
+ key: keyof TData | string;
240
+ type: 'text' | 'number' | 'date' | 'boolean' | 'custom';
241
+ options?: TextColumnOptions | NumberColumnOptions | DateColumnOptions | BooleanColumnOptions | CustomColumnOptions<TData>;
242
+ }
243
+ declare class ColumnFactory<TData extends DataRecord = DataRecord> {
244
+ /**
245
+ * Create a text column
246
+ */
247
+ static createTextColumn<TData extends DataRecord>(key: keyof TData | string, options?: TextColumnOptions): ColumnDef<TData>;
248
+ /**
249
+ * Create a number column
250
+ */
251
+ static createNumberColumn<TData extends DataRecord>(key: keyof TData | string, options?: NumberColumnOptions): ColumnDef<TData>;
252
+ /**
253
+ * Create a date column
254
+ */
255
+ static createDateColumn<TData extends DataRecord>(key: keyof TData | string, options?: DateColumnOptions): ColumnDef<TData>;
256
+ /**
257
+ * Create a boolean column
258
+ */
259
+ static createBooleanColumn<TData extends DataRecord>(key: keyof TData | string, options?: BooleanColumnOptions): ColumnDef<TData>;
260
+ /**
261
+ * Create an action column
262
+ */
263
+ static createActionColumn<TData extends DataRecord>(actions: DataTableAction<TData>[], options?: ActionColumnOptions): ColumnDef<TData>;
264
+ /**
265
+ * Create a custom column
266
+ */
267
+ static createCustomColumn<TData extends DataRecord>(key: keyof TData | string, options?: CustomColumnOptions<TData>): ColumnDef<TData>;
268
+ /**
269
+ * Create columns from simple configuration
270
+ */
271
+ static createColumnsFromConfig<TData extends DataRecord>(config: ColumnConfig<TData>[]): ColumnDef<TData>[];
272
+ }
273
+
188
274
  /**
189
275
  * @file Password Change Form Component
190
276
  * @package @jmruthers/pace-core
@@ -421,4 +507,4 @@ declare class StorageUtils {
421
507
  static archiveFile: typeof archiveFile;
422
508
  }
423
509
 
424
- export { APP_PATH_MAPPING, DEFAULT_FILE_SIZE_LIMIT, FILE_SIZE_LIMITS, FileSizeLimits, FileUpload, type FileUploadProps, InactivityWarningModal, type InactivityWarningModalProps, PasswordChangeForm, STORAGE_CONFIG, StorageConfig, StorageFileMetadata, StorageListOptions, StorageListResult, StorageUploadOptions, StorageUploadResult, StorageUrlOptions, StorageUtils, type UseInactivityTrackerOptions, type UseInactivityTrackerReturn, archiveFile, deleteFile, extractFileMetadata, generateFilePath, generateUniqueFileName, getFileSizeLimit, getPublicUrl, getSignedUrl, listFiles, uploadFile, useInactivityTracker, validateFileSize };
510
+ export { APP_PATH_MAPPING, ColumnFactory, DEFAULT_FILE_SIZE_LIMIT, DataRecord, DataTableAction, FILE_SIZE_LIMITS, FileSizeLimits, FileUpload, type FileUploadProps, InactivityWarningModal, type InactivityWarningModalProps, PasswordChangeForm, STORAGE_CONFIG, StorageConfig, StorageFileMetadata, StorageListOptions, StorageListResult, StorageUploadOptions, StorageUploadResult, StorageUrlOptions, StorageUtils, type UseInactivityTrackerOptions, type UseInactivityTrackerReturn, archiveFile, deleteFile, extractFileMetadata, generateFilePath, generateUniqueFileName, getFileSizeLimit, getPublicUrl, getSignedUrl, listFiles, uploadFile, useInactivityTracker, validateFileSize };
package/dist/index.js CHANGED
@@ -99,7 +99,7 @@ import {
99
99
  usePublicPageContext as usePublicPageContext2,
100
100
  useStorage,
101
101
  validateFileSize
102
- } from "./chunk-2LPYEFXI.js";
102
+ } from "./chunk-PSE2XO4L.js";
103
103
  import {
104
104
  Alert,
105
105
  AlertDescription,
@@ -112,6 +112,7 @@ import {
112
112
  CardHeader,
113
113
  CardTitle,
114
114
  Checkbox,
115
+ ColumnFactory,
115
116
  DataTable,
116
117
  Input,
117
118
  Select,
@@ -122,7 +123,7 @@ import {
122
123
  SelectSeparator,
123
124
  SelectTrigger,
124
125
  SelectValue
125
- } from "./chunk-S66AJVI2.js";
126
+ } from "./chunk-4HQ5BOVZ.js";
126
127
  import {
127
128
  useAccessLevel,
128
129
  useCachedPermissions,
@@ -680,6 +681,7 @@ export {
680
681
  CardHeader,
681
682
  CardTitle,
682
683
  Checkbox,
684
+ ColumnFactory,
683
685
  DEFAULT_FILE_SIZE_LIMIT,
684
686
  DataTable,
685
687
  DefaultPublicErrorFallback,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/utils/secureDataAccess.ts","../src/components/FileUpload/FileUpload.tsx"],"sourcesContent":["/**\n * @file Complete Component Library Export\n * @package @jmruthers/pace-core\n * @module Core\n * @since 0.1.0\n * \n * This file exports the primary components, hooks, and utilities from the PACE Core library.\n * It is the main entry point for developers using the library.\n * \n * @example\n * // Import common components\n * import { Button, Card, useUnifiedAuth } from '@jmruthers/pace-core';\n * \n * // For specialized components, use the complete library import:\n * import { Dialog, NavigationMenu } from '@jmruthers/pace-core/components';\n */\n\n// AUTHENTICATION & AUTHORIZATION\nexport { UnifiedAuthProvider, useUnifiedAuth } from './providers/UnifiedAuthProvider';\nexport type { UnifiedAuthProviderProps, UnifiedAuthContextType, UserEventAccess } from './providers/UnifiedAuthProvider';\nexport { EventProvider, useEvents } from './providers/EventProvider';\nexport type { EventProviderProps, EventContextType } from './providers/EventProvider';\nexport { OrganisationProvider, useOrganisations } from './providers/OrganisationProvider';\nexport type { \n Organisation, \n OrganisationMembership, \n OrganisationContextType, \n OrganisationProviderProps,\n OrganisationSecurityError \n} from './types/organisation';\n\n// INACTIVITY TRACKING\nexport { InactivityWarningModal } from './components/InactivityWarningModal/InactivityWarningModal';\nexport type { InactivityWarningModalProps } from './components/InactivityWarningModal/InactivityWarningModal';\nexport { useInactivityTracker } from './hooks/useInactivityTracker';\nexport type { UseInactivityTrackerOptions, UseInactivityTrackerReturn } from './hooks/useInactivityTracker';\n\n// RBAC SYSTEM - Consolidated RBAC module\nexport * from './rbac';\n\n// BASIC UI COMPONENTS\nexport { Button } from './components/Button/Button';\nexport type { ButtonProps } from './components/Button/Button';\n\nexport { \n Card, \n CardHeader, \n CardFooter, \n CardTitle, \n CardDescription, \n CardContent,\n CardActions\n} from './components/Card/Card';\nexport type { CardProps } from './components/Card/Card';\n\nexport { Input } from './components/Input/Input';\nexport type { InputProps } from './components/Input/Input';\nexport { Label } from './components/Label/Label';\nexport type { LabelProps } from './components/Label/Label';\n\nexport { Alert, AlertTitle, AlertDescription } from './components/Alert/Alert';\nexport { Avatar, AvatarImage, AvatarFallback } from './components/Avatar/Avatar';\n\nexport { Checkbox } from './components/Checkbox/Checkbox';\nexport { Progress } from './components/Progress/Progress';\n\n// ADVANCED UI COMPONENTS\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogTrigger,\n DialogClose,\n DialogContent,\n DialogHeader,\n DialogBody,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n} from './components/Dialog/Dialog';\n\n// Dropdown Menu exports\n// DropdownMenu components have been merged into Select components\n\n// Select exports\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n} from './components/Select';\n\n// Modal functionality is provided by Dialog components\n\nexport {\n Toast,\n Toaster,\n ToastAction,\n ToastProvider,\n ToastViewport,\n ToastTitle,\n ToastDescription,\n ToastClose,\n} from './components/Toast/Toast';\nexport { useToast } from './hooks/useToast';\nexport type { ToastActionElement, ToastProps } from './components/Toast/Toast';\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider, TooltipRoot } from './components/Tooltip/Tooltip';\n\n// DATA DISPLAY COMPONENTS\nexport {\n DataTable,\n type DataTableProps,\n type DataTableColumn,\n type DataTableAction,\n type DataTableToolbarButton,\n type AggregateConfig,\n type EmptyStateConfig,\n type GetRowId\n} from './components/DataTable';\n\n// Re-export types from DataTable types\nexport type { DataRecord } from './components/DataTable/types';\n\n// FORM COMPONENTS\nexport { Form } from './components/Form/Form';\nexport { LoginForm } from './components/LoginForm/LoginForm';\nexport type { LoginFormProps } from './components/LoginForm/LoginForm';\n\n// LAYOUT COMPONENTS\nexport { Header } from './components/Header/Header';\nexport { Footer } from './components/Footer/Footer';\nexport type { FooterProps } from './components/Footer/Footer';\n\n// NAVIGATION COMPONENTS\nexport { NavigationMenu } from './components/NavigationMenu/NavigationMenu';\nexport type { NavigationMenuProps, NavigationItem } from './components/NavigationMenu/types';\nexport { UserMenu } from './components/UserMenu/UserMenu';\nexport type { UserMenuProps } from './components/UserMenu/UserMenu';\n\n// Reusable Page/Layout Components\nexport { PaceAppLayout } from './components/PaceAppLayout/PaceAppLayout';\nexport type { PaceAppLayoutProps } from './components/PaceAppLayout/PaceAppLayout';\nexport { PaceLoginPage } from './components/PaceLoginPage/PaceLoginPage';\nexport type { PaceLoginPageProps } from './components/PaceLoginPage/PaceLoginPage';\n\n// UTILITY COMPONENTS\nexport { ErrorBoundary } from './components/ErrorBoundary/ErrorBoundary';\nexport { LoadingSpinner } from './components/LoadingSpinner/LoadingSpinner';\n\n// EVENT MANAGEMENT\nexport { EventSelector } from './components/EventSelector/EventSelector';\n\n// ORGANISATION MANAGEMENT\nexport { OrganisationSelector } from './components/OrganisationSelector/OrganisationSelector';\nexport { useOrganisationPermissions } from './hooks/useOrganisationPermissions';\nexport { useOrganisationSecurity } from './hooks/useOrganisationSecurity';\nexport { createSecureDataAccess } from './utils/secureDataAccess';\n\n// TYPES\nexport type { UserProfile } from './types/organisation';\n\n// AUTHENTICATION FORMS\nexport { PasswordResetForm } from './components/PasswordReset/PasswordResetForm';\nexport { PasswordChangeForm } from './components/PasswordReset/PasswordChangeForm';\n\n// UTILS & HOOKS\nexport { useAppConfig } from './hooks/useAppConfig';\nexport { cn } from './utils/cn';\nexport { setAppConfig, getAppConfig, getCurrentAppName, getCurrentAppId } from './utils/appConfig';\n\n// FORMATTING UTILITIES\nexport { \n formatDate, \n formatCurrency, \n formatNumber,\n formatPercent,\n formatCompactNumber,\n formatFileSize\n} from './utils/formatting';\n\n// STORAGE UTILITIES\nexport { FileUpload } from './components/FileUpload/FileUpload';\nexport type { FileUploadProps } from './components/FileUpload/FileUpload';\nexport { useStorage, useFileUpload } from './hooks/useStorage';\nexport * from './utils/storage';\n\n// Table components\nexport {\n Table,\n TableHeader,\n TableBody,\n TableCaption,\n TableCell,\n TableFooter,\n TableHead,\n TableRow,\n} from './components/Table/Table';\n\n// STYLES\nexport * from './styles';\n\n// PUBLIC PAGES\nexport * from './hooks/public';\nexport * from './components/PublicLayout';\n","/**\n * @file Secure Data Access Utility\n * @package @jmruthers/pace-core\n * @module Utils/SecureDataAccess\n * @since 0.4.0\n *\n * Secure data access utilities that enforce organisation context for all database operations.\n * Prevents data leakage between organisations and ensures proper access validation.\n */\n\nimport type { SupabaseClient } from '@supabase/supabase-js';\n\n// Generic database record type\nexport interface DatabaseRecord {\n id: string;\n organisation_id: string;\n [key: string]: unknown;\n}\n\n// Generic data for insert/update operations\nexport interface DatabaseData {\n [key: string]: unknown;\n}\n\n// Generic filters for queries\nexport interface DatabaseFilters {\n [key: string]: unknown;\n}\n\n// Secure query options\nexport interface SecureQueryOptions {\n table: string;\n select: string;\n organisationId: string;\n filters?: DatabaseFilters;\n orderBy?: string;\n limit?: number;\n offset?: number;\n}\n\nexport interface SecureDataAccess {\n // Secure query methods\n secureQuery: <T extends DatabaseRecord = DatabaseRecord>(options: SecureQueryOptions) => Promise<T[]>;\n secureSingleQuery: <T extends DatabaseRecord = DatabaseRecord>(options: SecureQueryOptions) => Promise<T | null>;\n \n // Secure mutation methods\n secureInsert: <T extends DatabaseRecord = DatabaseRecord>(table: string, data: DatabaseData, organisationId: string) => Promise<T | null>;\n secureUpdate: <T extends DatabaseRecord = DatabaseRecord>(table: string, data: DatabaseData, filters: DatabaseFilters, organisationId: string) => Promise<T | null>;\n secureDelete: (table: string, filters: DatabaseFilters, organisationId: string) => Promise<boolean>;\n \n // Organisation-scoped queries\n queryByOrganisation: <T extends DatabaseRecord = DatabaseRecord>(table: string, select: string, organisationId: string, filters?: DatabaseFilters) => Promise<T[]>;\n \n // Validation helpers\n validateOrganisationContext: (organisationId: string) => void;\n ensureOrganisationColumn: (table: string) => boolean;\n}\n\nexport interface SecureQueryBuilder {\n table: string;\n select: string;\n organisationId: string;\n filters?: DatabaseFilters;\n orderBy?: string;\n limit?: number;\n offset?: number;\n}\n\n/**\n * Create a secure data access instance\n * @param supabase - Supabase client instance\n * @param organisationId - Current organisation context\n * @param isSuperAdmin - Whether user has super admin privileges\n * @returns Secure data access utilities\n */\nexport const createSecureDataAccess = (\n supabase: SupabaseClient,\n organisationId: string,\n isSuperAdmin: boolean = false\n): SecureDataAccess => {\n \n // Validate organisation context\n const validateOrganisationContext = (orgId: string): void => {\n if (!orgId) {\n throw new Error('Organisation context is required for secure data access');\n }\n \n if (!isSuperAdmin && !orgId) {\n throw new Error('Organisation context is mandatory for non-super admin users');\n }\n };\n\n // Check if table has organisation_id column\n const ensureOrganisationColumn = (table: string): boolean => {\n // This is a simplified check - in production you might want to cache this\n const tablesWithOrganisation = [\n 'event', 'organisation_settings',\n 'rbac_event_app_roles', 'rbac_organisation_roles',\n // SECURITY: Phase 2 additions - complete organisation table mapping\n 'organisation_audit_log', 'organisation_invitations', 'organisation_app_access',\n // SECURITY: Emergency additions for Phase 1 fixes\n 'cake_meal', 'cake_mealtype', 'pace_person', 'pace_member',\n // SECURITY: Phase 3A additions - medical and personal data\n 'medi_profile', 'medi_condition', 'medi_diet', 'medi_action_plan', 'medi_profile_versions',\n 'pace_consent', 'pace_contact', 'pace_id_documents', 'pace_qualifications',\n 'form_responses', 'form_response_values', 'forms',\n // SECURITY: Phase 3B additions - remaining critical tables\n 'invoice', 'line_item', 'credit_balance', 'payment_method',\n 'form_contexts', 'form_field_config', 'form_fields',\n 'cake_delivery', 'cake_diettype', 'cake_diner', 'cake_dish', 'cake_item', \n 'cake_logistics', 'cake_mealplan', 'cake_package', 'cake_recipe', 'cake_supplier', \n 'cake_supply', 'cake_unit', 'event_app_access', 'base_application', 'base_questions'\n ];\n \n return tablesWithOrganisation.includes(table);\n };\n\n // Build secure query with organisation context\n const buildSecureQuery = (options: SecureQueryBuilder) => {\n const { table, select, organisationId: orgId, filters, orderBy, limit, offset } = options;\n \n validateOrganisationContext(orgId);\n \n let query = supabase\n .from(table)\n .select(select);\n \n // Add organisation filter (unless super admin)\n if (!isSuperAdmin && ensureOrganisationColumn(table)) {\n query = query.eq('organisation_id', orgId);\n }\n \n // Add additional filters\n if (filters) {\n Object.entries(filters).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n // Handle qualified column names (e.g., 'users.role')\n const columnName = key.includes('.') ? key.split('.').pop()! : key;\n query = query.eq(columnName, value);\n }\n });\n }\n \n // Add ordering\n if (orderBy) {\n // Only use the column name, not a qualified name\n const orderByColumn = orderBy.split('.').pop();\n if (orderByColumn) {\n query = query.order(orderByColumn);\n }\n }\n \n // Add pagination\n if (limit) {\n query = query.limit(limit);\n }\n \n if (offset) {\n query = query.range(offset, offset + (limit || 10) - 1);\n }\n \n return query;\n };\n\n // Secure query for multiple results\n const secureQuery = async <T extends DatabaseRecord = DatabaseRecord>(options: SecureQueryOptions): Promise<T[]> => {\n const { table, select, organisationId: orgId, filters, orderBy, limit, offset } = options;\n \n try {\n const query = buildSecureQuery({\n table,\n select,\n organisationId: orgId,\n filters,\n orderBy,\n limit,\n offset\n });\n \n const { data, error } = await query;\n \n if (error) {\n throw error;\n }\n \n // Ensure data is an array and not an error type\n if (Array.isArray(data)) {\n return data as unknown as T[];\n }\n \n return [];\n } catch (error) {\n throw error;\n }\n };\n\n // Secure query for single result\n const secureSingleQuery = async <T extends DatabaseRecord = DatabaseRecord>(options: SecureQueryOptions): Promise<T | null> => {\n const { table, select, organisationId: orgId, filters, orderBy, limit, offset } = options;\n \n try {\n const query = buildSecureQuery({\n table,\n select,\n organisationId: orgId,\n filters,\n orderBy,\n limit,\n offset\n });\n \n const { data, error } = await query.single();\n \n if (error) {\n if (error.code === 'PGRST116') {\n // No rows returned\n return null;\n }\n throw error;\n }\n \n // Ensure data is not an error type\n if (data && typeof data === 'object' && !('code' in data)) {\n return data as unknown as T;\n }\n \n return null;\n } catch (error) {\n throw error;\n }\n };\n\n // Secure insert with organisation context\n const secureInsert = async <T extends DatabaseRecord = DatabaseRecord>(\n table: string, \n data: DatabaseData, \n organisationId: string\n ): Promise<T | null> => {\n validateOrganisationContext(organisationId);\n \n try {\n const insertData = {\n ...data,\n organisation_id: organisationId\n };\n \n const { data: result, error } = await supabase\n .from(table)\n .insert(insertData)\n .select()\n .single();\n \n if (error) {\n throw error;\n }\n \n return result;\n } catch (error) {\n throw error;\n }\n };\n\n // Secure update with organisation context\n const secureUpdate = async <T extends DatabaseRecord = DatabaseRecord>(\n table: string, \n data: DatabaseData, \n filters: DatabaseFilters, \n organisationId: string\n ): Promise<T | null> => {\n validateOrganisationContext(organisationId);\n \n try {\n let query = supabase\n .from(table)\n .update(data);\n \n // Add organisation filter (unless super admin)\n if (!isSuperAdmin && ensureOrganisationColumn(table)) {\n query = query.eq('organisation_id', organisationId);\n }\n \n // Add additional filters\n if (filters) {\n Object.entries(filters).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n query = query.eq(key, value);\n }\n });\n }\n \n const { data: result, error } = await query.select().single();\n \n if (error) {\n throw error;\n }\n \n return result;\n } catch (error) {\n throw error;\n }\n };\n\n // Secure delete with organisation context\n const secureDelete = async (\n table: string, \n filters: DatabaseFilters, \n organisationId: string\n ): Promise<boolean> => {\n validateOrganisationContext(organisationId);\n \n try {\n let query = supabase\n .from(table)\n .delete();\n \n // Add organisation filter (unless super admin)\n if (!isSuperAdmin && ensureOrganisationColumn(table)) {\n query = query.eq('organisation_id', organisationId);\n }\n \n // Add additional filters\n if (filters) {\n Object.entries(filters).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n query = query.eq(key, value);\n }\n });\n }\n \n const { error } = await query;\n \n if (error) {\n throw error;\n }\n \n return true;\n } catch (error) {\n throw error;\n }\n };\n\n // Organisation-scoped query helper\n const queryByOrganisation = async <T extends DatabaseRecord = DatabaseRecord>(\n table: string, \n select: string, \n organisationId: string, \n filters?: DatabaseFilters\n ): Promise<T[]> => {\n return secureQuery<T>({\n table,\n select,\n organisationId,\n filters\n });\n };\n\n return {\n secureQuery,\n secureSingleQuery,\n secureInsert,\n secureUpdate,\n secureDelete,\n queryByOrganisation,\n validateOrganisationContext,\n ensureOrganisationColumn\n };\n};\n\n/**\n * Hook for secure data access\n * @returns Secure data access utilities\n */\nexport const useSecureDataAccess = (): SecureDataAccess => {\n // This would typically get the context from providers\n // For now, we'll create a placeholder that can be used with explicit parameters\n throw new Error('useSecureDataAccess must be used with explicit parameters. Use createSecureDataAccess instead.');\n}; ","/**\n * File upload component with app-segregated storage\n */\n\nimport React, { useCallback, useState } from 'react';\nimport { SupabaseClient } from '@supabase/supabase-js';\nimport { validateFileSize, formatFileSize } from '../../utils/storage';\nimport { useFileUpload } from '../../hooks/useStorage';\nimport { Button } from '../Button/Button';\nimport { Progress } from '../Progress/Progress';\nimport { Alert } from '../Alert/Alert';\n\nexport interface FileUploadProps {\n supabase: SupabaseClient;\n appName: string;\n orgId: string;\n onUploadComplete?: (result: { success: boolean; path?: string; error?: string }) => void;\n onUploadStart?: () => void;\n accept?: string;\n maxSize?: number;\n multiple?: boolean;\n disabled?: boolean;\n className?: string;\n children?: React.ReactNode;\n}\n\nexport function FileUpload({\n supabase,\n appName,\n orgId,\n onUploadComplete,\n onUploadStart,\n accept = '*/*',\n maxSize,\n multiple = false,\n disabled = false,\n className = '',\n children\n}: FileUploadProps) {\n const [dragActive, setDragActive] = useState(false);\n const [selectedFiles, setSelectedFiles] = useState<File[]>([]);\n const [validationErrors, setValidationErrors] = useState<string[]>([]);\n\n const { uploadWithProgress, uploadProgress, isUploading, uploadError } = useFileUpload({\n supabase,\n appName,\n orgId\n });\n\n // Validate files\n const validateFiles = useCallback((files: File[]): string[] => {\n const errors: string[] = [];\n\n files.forEach((file, index) => {\n // Check file size\n const sizeValidation = validateFileSize(file);\n if (!sizeValidation.isValid) {\n errors.push(`File ${index + 1}: ${sizeValidation.error}`);\n }\n\n // Check custom max size\n if (maxSize && file.size > maxSize) {\n const fileMB = Math.round(file.size / (1024 * 1024));\n const maxMB = Math.round(maxSize / (1024 * 1024));\n errors.push(`File ${index + 1}: Size (${fileMB}MB) exceeds limit (${maxMB}MB)`);\n }\n });\n\n return errors;\n }, [maxSize]);\n\n // Handle file selection\n const handleFileSelect = useCallback((files: FileList | null) => {\n if (!files) return;\n\n const fileArray = Array.from(files);\n const errors = validateFiles(fileArray);\n\n setValidationErrors(errors);\n setSelectedFiles(fileArray);\n }, [validateFiles]);\n\n // Handle drag events\n const handleDrag = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n if (e.type === 'dragenter' || e.type === 'dragover') {\n setDragActive(true);\n } else if (e.type === 'dragleave') {\n setDragActive(false);\n }\n }, []);\n\n const handleDrop = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setDragActive(false);\n\n if (disabled) return;\n\n const files = e.dataTransfer.files;\n handleFileSelect(files);\n }, [disabled, handleFileSelect]);\n\n // Handle file input change\n const handleFileInputChange = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\n handleFileSelect(e.target.files);\n }, [handleFileSelect]);\n\n // Handle upload\n const handleUpload = useCallback(async () => {\n if (selectedFiles.length === 0 || validationErrors.length > 0) return;\n\n onUploadStart?.();\n\n for (const file of selectedFiles) {\n const result = await uploadWithProgress(file);\n onUploadComplete?.(result);\n }\n\n // Reset selection\n setSelectedFiles([]);\n setValidationErrors([]);\n }, [selectedFiles, validationErrors, uploadWithProgress, onUploadComplete, onUploadStart]);\n\n // Handle clear\n const handleClear = useCallback(() => {\n setSelectedFiles([]);\n setValidationErrors([]);\n }, []);\n\n const canUpload = selectedFiles.length > 0 && validationErrors.length === 0 && !isUploading && !disabled;\n\n return (\n <div className={`file-upload ${className}`}>\n {/* Drop zone */}\n <div\n className={`file-upload__dropzone ${\n dragActive ? 'file-upload__dropzone--active' : ''\n } ${disabled ? 'file-upload__dropzone--disabled' : ''}`}\n onDragEnter={handleDrag}\n onDragLeave={handleDrag}\n onDragOver={handleDrag}\n onDrop={handleDrop}\n >\n <input\n type=\"file\"\n accept={accept}\n multiple={multiple}\n onChange={handleFileInputChange}\n disabled={disabled}\n className=\"file-upload__input\"\n />\n \n {children || (\n <div className=\"file-upload__content\">\n <p className=\"file-upload__text\">\n {dragActive ? 'Drop files here' : 'Drag and drop files here or click to select'}\n </p>\n <Button\n type=\"button\"\n variant=\"outline\"\n disabled={disabled}\n onClick={() => (document.querySelector('.file-upload__input') as HTMLInputElement)?.click()}\n >\n Select Files\n </Button>\n </div>\n )}\n </div>\n\n {/* Selected files */}\n {selectedFiles.length > 0 && (\n <div className=\"file-upload__files\">\n <h4 className=\"file-upload__files-title\">Selected Files:</h4>\n <ul className=\"file-upload__files-list\">\n {selectedFiles.map((file, index) => (\n <li key={index} className=\"file-upload__file-item\">\n <span className=\"file-upload__file-name\">{file.name}</span>\n <span className=\"file-upload__file-size\">{formatFileSize(file.size)}</span>\n </li>\n ))}\n </ul>\n </div>\n )}\n\n {/* Validation errors */}\n {validationErrors.length > 0 && (\n <Alert variant=\"destructive\" className=\"file-upload__errors\">\n <ul>\n {validationErrors.map((error, index) => (\n <li key={index}>{error}</li>\n ))}\n </ul>\n </Alert>\n )}\n\n {/* Upload progress */}\n {isUploading && (\n <div className=\"file-upload__progress\">\n <Progress value={uploadProgress} max={100} />\n <p className=\"file-upload__progress-text\">\n Uploading... {uploadProgress}%\n </p>\n </div>\n )}\n\n {/* Upload error */}\n {uploadError && (\n <Alert variant=\"destructive\" className=\"file-upload__error\">\n {uploadError}\n </Alert>\n )}\n\n {/* Actions */}\n {selectedFiles.length > 0 && (\n <div className=\"file-upload__actions\">\n <Button\n onClick={handleUpload}\n disabled={!canUpload}\n className=\"file-upload__upload-btn\"\n >\n {isUploading ? 'Uploading...' : `Upload ${selectedFiles.length} file${selectedFiles.length > 1 ? 's' : ''}`}\n </Button>\n <Button\n variant=\"outline\"\n onClick={handleClear}\n disabled={isUploading}\n className=\"file-upload__clear-btn\"\n >\n Clear\n </Button>\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA;AAEA;AAEA;AAUA;AAEA;AAOA;AA0BA;AA4CA;;;ACpCO,IAAM,yBAAyB,CACpC,UACA,gBACA,eAAwB,UACH;AAGrB,QAAM,8BAA8B,CAAC,UAAwB;AAC3D,QAAI,CAAC,OA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AAA,UACV,WAAU;AAAA,UACX;AAAA;AAAA,MAED;AAAA,OACF;AAAA,KAEJ;AAEJ;","names":["organisationId","formatFileSize"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/utils/secureDataAccess.ts","../src/components/FileUpload/FileUpload.tsx"],"sourcesContent":["/**\n * @file Complete Component Library Export\n * @package @jmruthers/pace-core\n * @module Core\n * @since 0.1.0\n * \n * This file exports the primary components, hooks, and utilities from the PACE Core library.\n * It is the main entry point for developers using the library.\n * \n * @example\n * // Import common components\n * import { Button, Card, useUnifiedAuth } from '@jmruthers/pace-core';\n * \n * // For specialized components, use the complete library import:\n * import { Dialog, NavigationMenu } from '@jmruthers/pace-core/components';\n */\n\n// AUTHENTICATION & AUTHORIZATION\nexport { UnifiedAuthProvider, useUnifiedAuth } from './providers/UnifiedAuthProvider';\nexport type { UnifiedAuthProviderProps, UnifiedAuthContextType, UserEventAccess } from './providers/UnifiedAuthProvider';\nexport { EventProvider, useEvents } from './providers/EventProvider';\nexport type { EventProviderProps, EventContextType } from './providers/EventProvider';\nexport { OrganisationProvider, useOrganisations } from './providers/OrganisationProvider';\nexport type { \n Organisation, \n OrganisationMembership, \n OrganisationContextType, \n OrganisationProviderProps,\n OrganisationSecurityError \n} from './types/organisation';\n\n// INACTIVITY TRACKING\nexport { InactivityWarningModal } from './components/InactivityWarningModal/InactivityWarningModal';\nexport type { InactivityWarningModalProps } from './components/InactivityWarningModal/InactivityWarningModal';\nexport { useInactivityTracker } from './hooks/useInactivityTracker';\nexport type { UseInactivityTrackerOptions, UseInactivityTrackerReturn } from './hooks/useInactivityTracker';\n\n// RBAC SYSTEM - Consolidated RBAC module\nexport * from './rbac';\n\n// BASIC UI COMPONENTS\nexport { Button } from './components/Button/Button';\nexport type { ButtonProps } from './components/Button/Button';\n\nexport { \n Card, \n CardHeader, \n CardFooter, \n CardTitle, \n CardDescription, \n CardContent,\n CardActions\n} from './components/Card/Card';\nexport type { CardProps } from './components/Card/Card';\n\nexport { Input } from './components/Input/Input';\nexport type { InputProps } from './components/Input/Input';\nexport { Label } from './components/Label/Label';\nexport type { LabelProps } from './components/Label/Label';\n\nexport { Alert, AlertTitle, AlertDescription } from './components/Alert/Alert';\nexport { Avatar, AvatarImage, AvatarFallback } from './components/Avatar/Avatar';\n\nexport { Checkbox } from './components/Checkbox/Checkbox';\nexport { Progress } from './components/Progress/Progress';\n\n// ADVANCED UI COMPONENTS\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogTrigger,\n DialogClose,\n DialogContent,\n DialogHeader,\n DialogBody,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n} from './components/Dialog/Dialog';\n\n// Dropdown Menu exports\n// DropdownMenu components have been merged into Select components\n\n// Select exports\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n} from './components/Select';\n\n// Modal functionality is provided by Dialog components\n\nexport {\n Toast,\n Toaster,\n ToastAction,\n ToastProvider,\n ToastViewport,\n ToastTitle,\n ToastDescription,\n ToastClose,\n} from './components/Toast/Toast';\nexport { useToast } from './hooks/useToast';\nexport type { ToastActionElement, ToastProps } from './components/Toast/Toast';\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider, TooltipRoot } from './components/Tooltip/Tooltip';\n\n// DATA DISPLAY COMPONENTS\nexport {\n DataTable,\n type DataTableProps,\n type DataTableColumn,\n type DataTableAction,\n type DataTableToolbarButton,\n type AggregateConfig,\n type EmptyStateConfig,\n type GetRowId,\n ColumnFactory\n} from './components/DataTable';\n\n// Re-export types from DataTable types\nexport type { DataRecord } from './components/DataTable/types';\n\n// FORM COMPONENTS\nexport { Form } from './components/Form/Form';\nexport { LoginForm } from './components/LoginForm/LoginForm';\nexport type { LoginFormProps } from './components/LoginForm/LoginForm';\n\n// LAYOUT COMPONENTS\nexport { Header } from './components/Header/Header';\nexport { Footer } from './components/Footer/Footer';\nexport type { FooterProps } from './components/Footer/Footer';\n\n// NAVIGATION COMPONENTS\nexport { NavigationMenu } from './components/NavigationMenu/NavigationMenu';\nexport type { NavigationMenuProps, NavigationItem } from './components/NavigationMenu/types';\nexport { UserMenu } from './components/UserMenu/UserMenu';\nexport type { UserMenuProps } from './components/UserMenu/UserMenu';\n\n// Reusable Page/Layout Components\nexport { PaceAppLayout } from './components/PaceAppLayout/PaceAppLayout';\nexport type { PaceAppLayoutProps } from './components/PaceAppLayout/PaceAppLayout';\nexport { PaceLoginPage } from './components/PaceLoginPage/PaceLoginPage';\nexport type { PaceLoginPageProps } from './components/PaceLoginPage/PaceLoginPage';\n\n// UTILITY COMPONENTS\nexport { ErrorBoundary } from './components/ErrorBoundary/ErrorBoundary';\nexport { LoadingSpinner } from './components/LoadingSpinner/LoadingSpinner';\n\n// EVENT MANAGEMENT\nexport { EventSelector } from './components/EventSelector/EventSelector';\n\n// ORGANISATION MANAGEMENT\nexport { OrganisationSelector } from './components/OrganisationSelector/OrganisationSelector';\nexport { useOrganisationPermissions } from './hooks/useOrganisationPermissions';\nexport { useOrganisationSecurity } from './hooks/useOrganisationSecurity';\nexport { createSecureDataAccess } from './utils/secureDataAccess';\n\n// TYPES\nexport type { UserProfile } from './types/organisation';\n\n// AUTHENTICATION FORMS\nexport { PasswordResetForm } from './components/PasswordReset/PasswordResetForm';\nexport { PasswordChangeForm } from './components/PasswordReset/PasswordChangeForm';\n\n// UTILS & HOOKS\nexport { useAppConfig } from './hooks/useAppConfig';\nexport { cn } from './utils/cn';\nexport { setAppConfig, getAppConfig, getCurrentAppName, getCurrentAppId } from './utils/appConfig';\n\n// FORMATTING UTILITIES\nexport { \n formatDate, \n formatCurrency, \n formatNumber,\n formatPercent,\n formatCompactNumber,\n formatFileSize\n} from './utils/formatting';\n\n// STORAGE UTILITIES\nexport { FileUpload } from './components/FileUpload/FileUpload';\nexport type { FileUploadProps } from './components/FileUpload/FileUpload';\nexport { useStorage, useFileUpload } from './hooks/useStorage';\nexport * from './utils/storage';\n\n// Table components\nexport {\n Table,\n TableHeader,\n TableBody,\n TableCaption,\n TableCell,\n TableFooter,\n TableHead,\n TableRow,\n} from './components/Table/Table';\n\n// STYLES\nexport * from './styles';\n\n// PUBLIC PAGES\nexport * from './hooks/public';\nexport * from './components/PublicLayout';\n","/**\n * @file Secure Data Access Utility\n * @package @jmruthers/pace-core\n * @module Utils/SecureDataAccess\n * @since 0.4.0\n *\n * Secure data access utilities that enforce organisation context for all database operations.\n * Prevents data leakage between organisations and ensures proper access validation.\n */\n\nimport type { SupabaseClient } from '@supabase/supabase-js';\n\n// Generic database record type\nexport interface DatabaseRecord {\n id: string;\n organisation_id: string;\n [key: string]: unknown;\n}\n\n// Generic data for insert/update operations\nexport interface DatabaseData {\n [key: string]: unknown;\n}\n\n// Generic filters for queries\nexport interface DatabaseFilters {\n [key: string]: unknown;\n}\n\n// Secure query options\nexport interface SecureQueryOptions {\n table: string;\n select: string;\n organisationId: string;\n filters?: DatabaseFilters;\n orderBy?: string;\n limit?: number;\n offset?: number;\n}\n\nexport interface SecureDataAccess {\n // Secure query methods\n secureQuery: <T extends DatabaseRecord = DatabaseRecord>(options: SecureQueryOptions) => Promise<T[]>;\n secureSingleQuery: <T extends DatabaseRecord = DatabaseRecord>(options: SecureQueryOptions) => Promise<T | null>;\n \n // Secure mutation methods\n secureInsert: <T extends DatabaseRecord = DatabaseRecord>(table: string, data: DatabaseData, organisationId: string) => Promise<T | null>;\n secureUpdate: <T extends DatabaseRecord = DatabaseRecord>(table: string, data: DatabaseData, filters: DatabaseFilters, organisationId: string) => Promise<T | null>;\n secureDelete: (table: string, filters: DatabaseFilters, organisationId: string) => Promise<boolean>;\n \n // Organisation-scoped queries\n queryByOrganisation: <T extends DatabaseRecord = DatabaseRecord>(table: string, select: string, organisationId: string, filters?: DatabaseFilters) => Promise<T[]>;\n \n // Validation helpers\n validateOrganisationContext: (organisationId: string) => void;\n ensureOrganisationColumn: (table: string) => boolean;\n}\n\nexport interface SecureQueryBuilder {\n table: string;\n select: string;\n organisationId: string;\n filters?: DatabaseFilters;\n orderBy?: string;\n limit?: number;\n offset?: number;\n}\n\n/**\n * Create a secure data access instance\n * @param supabase - Supabase client instance\n * @param organisationId - Current organisation context\n * @param isSuperAdmin - Whether user has super admin privileges\n * @returns Secure data access utilities\n */\nexport const createSecureDataAccess = (\n supabase: SupabaseClient,\n organisationId: string,\n isSuperAdmin: boolean = false\n): SecureDataAccess => {\n \n // Validate organisation context\n const validateOrganisationContext = (orgId: string): void => {\n if (!orgId) {\n throw new Error('Organisation context is required for secure data access');\n }\n \n if (!isSuperAdmin && !orgId) {\n throw new Error('Organisation context is mandatory for non-super admin users');\n }\n };\n\n // Check if table has organisation_id column\n const ensureOrganisationColumn = (table: string): boolean => {\n // This is a simplified check - in production you might want to cache this\n const tablesWithOrganisation = [\n 'event', 'organisation_settings',\n 'rbac_event_app_roles', 'rbac_organisation_roles',\n // SECURITY: Phase 2 additions - complete organisation table mapping\n 'organisation_audit_log', 'organisation_invitations', 'organisation_app_access',\n // SECURITY: Emergency additions for Phase 1 fixes\n 'cake_meal', 'cake_mealtype', 'pace_person', 'pace_member',\n // SECURITY: Phase 3A additions - medical and personal data\n 'medi_profile', 'medi_condition', 'medi_diet', 'medi_action_plan', 'medi_profile_versions',\n 'pace_consent', 'pace_contact', 'pace_id_documents', 'pace_qualifications',\n 'form_responses', 'form_response_values', 'forms',\n // SECURITY: Phase 3B additions - remaining critical tables\n 'invoice', 'line_item', 'credit_balance', 'payment_method',\n 'form_contexts', 'form_field_config', 'form_fields',\n 'cake_delivery', 'cake_diettype', 'cake_diner', 'cake_dish', 'cake_item', \n 'cake_logistics', 'cake_mealplan', 'cake_package', 'cake_recipe', 'cake_supplier', \n 'cake_supply', 'cake_unit', 'event_app_access', 'base_application', 'base_questions'\n ];\n \n return tablesWithOrganisation.includes(table);\n };\n\n // Build secure query with organisation context\n const buildSecureQuery = (options: SecureQueryBuilder) => {\n const { table, select, organisationId: orgId, filters, orderBy, limit, offset } = options;\n \n validateOrganisationContext(orgId);\n \n let query = supabase\n .from(table)\n .select(select);\n \n // Add organisation filter (unless super admin)\n if (!isSuperAdmin && ensureOrganisationColumn(table)) {\n query = query.eq('organisation_id', orgId);\n }\n \n // Add additional filters\n if (filters) {\n Object.entries(filters).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n // Handle qualified column names (e.g., 'users.role')\n const columnName = key.includes('.') ? key.split('.').pop()! : key;\n query = query.eq(columnName, value);\n }\n });\n }\n \n // Add ordering\n if (orderBy) {\n // Only use the column name, not a qualified name\n const orderByColumn = orderBy.split('.').pop();\n if (orderByColumn) {\n query = query.order(orderByColumn);\n }\n }\n \n // Add pagination\n if (limit) {\n query = query.limit(limit);\n }\n \n if (offset) {\n query = query.range(offset, offset + (limit || 10) - 1);\n }\n \n return query;\n };\n\n // Secure query for multiple results\n const secureQuery = async <T extends DatabaseRecord = DatabaseRecord>(options: SecureQueryOptions): Promise<T[]> => {\n const { table, select, organisationId: orgId, filters, orderBy, limit, offset } = options;\n \n try {\n const query = buildSecureQuery({\n table,\n select,\n organisationId: orgId,\n filters,\n orderBy,\n limit,\n offset\n });\n \n const { data, error } = await query;\n \n if (error) {\n throw error;\n }\n \n // Ensure data is an array and not an error type\n if (Array.isArray(data)) {\n return data as unknown as T[];\n }\n \n return [];\n } catch (error) {\n throw error;\n }\n };\n\n // Secure query for single result\n const secureSingleQuery = async <T extends DatabaseRecord = DatabaseRecord>(options: SecureQueryOptions): Promise<T | null> => {\n const { table, select, organisationId: orgId, filters, orderBy, limit, offset } = options;\n \n try {\n const query = buildSecureQuery({\n table,\n select,\n organisationId: orgId,\n filters,\n orderBy,\n limit,\n offset\n });\n \n const { data, error } = await query.single();\n \n if (error) {\n if (error.code === 'PGRST116') {\n // No rows returned\n return null;\n }\n throw error;\n }\n \n // Ensure data is not an error type\n if (data && typeof data === 'object' && !('code' in data)) {\n return data as unknown as T;\n }\n \n return null;\n } catch (error) {\n throw error;\n }\n };\n\n // Secure insert with organisation context\n const secureInsert = async <T extends DatabaseRecord = DatabaseRecord>(\n table: string, \n data: DatabaseData, \n organisationId: string\n ): Promise<T | null> => {\n validateOrganisationContext(organisationId);\n \n try {\n const insertData = {\n ...data,\n organisation_id: organisationId\n };\n \n const { data: result, error } = await supabase\n .from(table)\n .insert(insertData)\n .select()\n .single();\n \n if (error) {\n throw error;\n }\n \n return result;\n } catch (error) {\n throw error;\n }\n };\n\n // Secure update with organisation context\n const secureUpdate = async <T extends DatabaseRecord = DatabaseRecord>(\n table: string, \n data: DatabaseData, \n filters: DatabaseFilters, \n organisationId: string\n ): Promise<T | null> => {\n validateOrganisationContext(organisationId);\n \n try {\n let query = supabase\n .from(table)\n .update(data);\n \n // Add organisation filter (unless super admin)\n if (!isSuperAdmin && ensureOrganisationColumn(table)) {\n query = query.eq('organisation_id', organisationId);\n }\n \n // Add additional filters\n if (filters) {\n Object.entries(filters).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n query = query.eq(key, value);\n }\n });\n }\n \n const { data: result, error } = await query.select().single();\n \n if (error) {\n throw error;\n }\n \n return result;\n } catch (error) {\n throw error;\n }\n };\n\n // Secure delete with organisation context\n const secureDelete = async (\n table: string, \n filters: DatabaseFilters, \n organisationId: string\n ): Promise<boolean> => {\n validateOrganisationContext(organisationId);\n \n try {\n let query = supabase\n .from(table)\n .delete();\n \n // Add organisation filter (unless super admin)\n if (!isSuperAdmin && ensureOrganisationColumn(table)) {\n query = query.eq('organisation_id', organisationId);\n }\n \n // Add additional filters\n if (filters) {\n Object.entries(filters).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n query = query.eq(key, value);\n }\n });\n }\n \n const { error } = await query;\n \n if (error) {\n throw error;\n }\n \n return true;\n } catch (error) {\n throw error;\n }\n };\n\n // Organisation-scoped query helper\n const queryByOrganisation = async <T extends DatabaseRecord = DatabaseRecord>(\n table: string, \n select: string, \n organisationId: string, \n filters?: DatabaseFilters\n ): Promise<T[]> => {\n return secureQuery<T>({\n table,\n select,\n organisationId,\n filters\n });\n };\n\n return {\n secureQuery,\n secureSingleQuery,\n secureInsert,\n secureUpdate,\n secureDelete,\n queryByOrganisation,\n validateOrganisationContext,\n ensureOrganisationColumn\n };\n};\n\n/**\n * Hook for secure data access\n * @returns Secure data access utilities\n */\nexport const useSecureDataAccess = (): SecureDataAccess => {\n // This would typically get the context from providers\n // For now, we'll create a placeholder that can be used with explicit parameters\n throw new Error('useSecureDataAccess must be used with explicit parameters. Use createSecureDataAccess instead.');\n}; ","/**\n * File upload component with app-segregated storage\n */\n\nimport React, { useCallback, useState } from 'react';\nimport { SupabaseClient } from '@supabase/supabase-js';\nimport { validateFileSize, formatFileSize } from '../../utils/storage';\nimport { useFileUpload } from '../../hooks/useStorage';\nimport { Button } from '../Button/Button';\nimport { Progress } from '../Progress/Progress';\nimport { Alert } from '../Alert/Alert';\n\nexport interface FileUploadProps {\n supabase: SupabaseClient;\n appName: string;\n orgId: string;\n onUploadComplete?: (result: { success: boolean; path?: string; error?: string }) => void;\n onUploadStart?: () => void;\n accept?: string;\n maxSize?: number;\n multiple?: boolean;\n disabled?: boolean;\n className?: string;\n children?: React.ReactNode;\n}\n\nexport function FileUpload({\n supabase,\n appName,\n orgId,\n onUploadComplete,\n onUploadStart,\n accept = '*/*',\n maxSize,\n multiple = false,\n disabled = false,\n className = '',\n children\n}: FileUploadProps) {\n const [dragActive, setDragActive] = useState(false);\n const [selectedFiles, setSelectedFiles] = useState<File[]>([]);\n const [validationErrors, setValidationErrors] = useState<string[]>([]);\n\n const { uploadWithProgress, uploadProgress, isUploading, uploadError } = useFileUpload({\n supabase,\n appName,\n orgId\n });\n\n // Validate files\n const validateFiles = useCallback((files: File[]): string[] => {\n const errors: string[] = [];\n\n files.forEach((file, index) => {\n // Check file size\n const sizeValidation = validateFileSize(file);\n if (!sizeValidation.isValid) {\n errors.push(`File ${index + 1}: ${sizeValidation.error}`);\n }\n\n // Check custom max size\n if (maxSize && file.size > maxSize) {\n const fileMB = Math.round(file.size / (1024 * 1024));\n const maxMB = Math.round(maxSize / (1024 * 1024));\n errors.push(`File ${index + 1}: Size (${fileMB}MB) exceeds limit (${maxMB}MB)`);\n }\n });\n\n return errors;\n }, [maxSize]);\n\n // Handle file selection\n const handleFileSelect = useCallback((files: FileList | null) => {\n if (!files) return;\n\n const fileArray = Array.from(files);\n const errors = validateFiles(fileArray);\n\n setValidationErrors(errors);\n setSelectedFiles(fileArray);\n }, [validateFiles]);\n\n // Handle drag events\n const handleDrag = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n if (e.type === 'dragenter' || e.type === 'dragover') {\n setDragActive(true);\n } else if (e.type === 'dragleave') {\n setDragActive(false);\n }\n }, []);\n\n const handleDrop = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setDragActive(false);\n\n if (disabled) return;\n\n const files = e.dataTransfer.files;\n handleFileSelect(files);\n }, [disabled, handleFileSelect]);\n\n // Handle file input change\n const handleFileInputChange = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\n handleFileSelect(e.target.files);\n }, [handleFileSelect]);\n\n // Handle upload\n const handleUpload = useCallback(async () => {\n if (selectedFiles.length === 0 || validationErrors.length > 0) return;\n\n onUploadStart?.();\n\n for (const file of selectedFiles) {\n const result = await uploadWithProgress(file);\n onUploadComplete?.(result);\n }\n\n // Reset selection\n setSelectedFiles([]);\n setValidationErrors([]);\n }, [selectedFiles, validationErrors, uploadWithProgress, onUploadComplete, onUploadStart]);\n\n // Handle clear\n const handleClear = useCallback(() => {\n setSelectedFiles([]);\n setValidationErrors([]);\n }, []);\n\n const canUpload = selectedFiles.length > 0 && validationErrors.length === 0 && !isUploading && !disabled;\n\n return (\n <div className={`file-upload ${className}`}>\n {/* Drop zone */}\n <div\n className={`file-upload__dropzone ${\n dragActive ? 'file-upload__dropzone--active' : ''\n } ${disabled ? 'file-upload__dropzone--disabled' : ''}`}\n onDragEnter={handleDrag}\n onDragLeave={handleDrag}\n onDragOver={handleDrag}\n onDrop={handleDrop}\n >\n <input\n type=\"file\"\n accept={accept}\n multiple={multiple}\n onChange={handleFileInputChange}\n disabled={disabled}\n className=\"file-upload__input\"\n />\n \n {children || (\n <div className=\"file-upload__content\">\n <p className=\"file-upload__text\">\n {dragActive ? 'Drop files here' : 'Drag and drop files here or click to select'}\n </p>\n <Button\n type=\"button\"\n variant=\"outline\"\n disabled={disabled}\n onClick={() => (document.querySelector('.file-upload__input') as HTMLInputElement)?.click()}\n >\n Select Files\n </Button>\n </div>\n )}\n </div>\n\n {/* Selected files */}\n {selectedFiles.length > 0 && (\n <div className=\"file-upload__files\">\n <h4 className=\"file-upload__files-title\">Selected Files:</h4>\n <ul className=\"file-upload__files-list\">\n {selectedFiles.map((file, index) => (\n <li key={index} className=\"file-upload__file-item\">\n <span className=\"file-upload__file-name\">{file.name}</span>\n <span className=\"file-upload__file-size\">{formatFileSize(file.size)}</span>\n </li>\n ))}\n </ul>\n </div>\n )}\n\n {/* Validation errors */}\n {validationErrors.length > 0 && (\n <Alert variant=\"destructive\" className=\"file-upload__errors\">\n <ul>\n {validationErrors.map((error, index) => (\n <li key={index}>{error}</li>\n ))}\n </ul>\n </Alert>\n )}\n\n {/* Upload progress */}\n {isUploading && (\n <div className=\"file-upload__progress\">\n <Progress value={uploadProgress} max={100} />\n <p className=\"file-upload__progress-text\">\n Uploading... {uploadProgress}%\n </p>\n </div>\n )}\n\n {/* Upload error */}\n {uploadError && (\n <Alert variant=\"destructive\" className=\"file-upload__error\">\n {uploadError}\n </Alert>\n )}\n\n {/* Actions */}\n {selectedFiles.length > 0 && (\n <div className=\"file-upload__actions\">\n <Button\n onClick={handleUpload}\n disabled={!canUpload}\n className=\"file-upload__upload-btn\"\n >\n {isUploading ? 'Uploading...' : `Upload ${selectedFiles.length} file${selectedFiles.length > 1 ? 's' : ''}`}\n </Button>\n <Button\n variant=\"outline\"\n onClick={handleClear}\n disabled={isUploading}\n className=\"file-upload__clear-btn\"\n >\n Clear\n </Button>\n </div>\n )}\n </div>\n );\n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BAAgB,KAAK,KAAK;AAAA,MAC3C,qBAAC,OAAE,WAAU,8BAA6B;AAAA;AAAA,QAC1B;AAAA,QAAe;AAAA,SAC/B;AAAA,OACF;AAAA,IAID,eACC,oBAAC,SAAM,SAAQ,eAAc,WAAU,sBACpC,uBACH;AAAA,IAID,cAAc,SAAS,KACtB,qBAAC,SAAI,WAAU,wBACb;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,SAAS;AAAA,UACT,UAAU,CAAC;AAAA,UACX,WAAU;AAAA,UAET,wBAAc,iBAAiB,UAAU,cAAc,MAAM,QAAQ,cAAc,SAAS,IAAI,MAAM,EAAE;AAAA;AAAA,MAC3G;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,SAAQ;AAAA,UACR,SAAS;AAAA,UACT,UAAU;AAAA,UACV,WAAU;AAAA,UACX;AAAA;AAAA,MAED;AAAA,OACF;AAAA,KAEJ;AAEJ;","names":["organisationId","formatFileSize"]}
@@ -8,6 +8,14 @@ import { ColumnDef, SortingState, ColumnFiltersState, GroupingState } from '@tan
8
8
  * @since 0.2.0
9
9
  */
10
10
 
11
+ declare module '@tanstack/react-table' {
12
+ interface ColumnMeta<TData, TValue> {
13
+ /** Text alignment for the column content */
14
+ align?: 'left' | 'right' | 'center';
15
+ /** Column type for styling purposes */
16
+ type?: 'text' | 'number' | 'date' | 'boolean' | 'custom';
17
+ }
18
+ }
11
19
  /**
12
20
  * Generic data record type - all DataTable data must extend this
13
21
  */
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types/index.ts","../src/types/guards.ts"],"sourcesContent":["/**\n * @file Types Module Exports\n * @package @jmruthers/pace-core\n * @module Types\n * @since 0.1.0\n * \n * Complete collection of type definitions for the PACE Core library.\n * Use this import path when you need access to types not included in the main export.\n * \n * @example\n * // Specialized type imports\n * import { User, Event, AccessLevel } from '@jmruthers/pace-core/types';\n * \n * // For common types, prefer the main export:\n * import { ButtonProps, CardProps } from '@jmruthers/pace-core';\n */\n\n// Core type exports\nexport * from './unified';\nexport * from './supabase';\nexport * from './database';\nexport * from './guards';\nexport * from './validation';\nexport * from './theme';\nexport * from './security';\n","\n/**\n * @file Type Guards\n */\n\nimport { AuthErrorCode, User, Session } from './unified';\n\nexport function isAuthErrorCode(code: string): code is AuthErrorCode {\n return Object.values(AuthErrorCode).includes(code as AuthErrorCode);\n}\n\nexport function isUser(obj: unknown): obj is User {\n const candidate = obj as Partial<User> | null | undefined;\n return (\n candidate != null &&\n typeof candidate === 'object' &&\n typeof candidate.id === 'string' &&\n typeof candidate.created_at === 'string'\n );\n}\n\nexport function isSession(obj: unknown): obj is Session {\n const candidate = obj as Partial<Session> | null | undefined;\n return (\n candidate != null &&\n typeof candidate === 'object' &&\n typeof candidate.access_token === 'string' &&\n typeof candidate.user === 'object'\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA;;;ACbA;AAEO,SAAS,gBAAgB,MAAqC;AACnE,SAAO,OAAO,OAAO,aAAa,EAAE,SAAS,IAAqB;AACpE;AAEO,SAAS,OAAO,KAA2B;AAChD,QAAM,YAAY;AAClB,SACE,aAAa,QACb,OAAO,cAAc,YACrB,OAAO,UAAU,OAAO,YACxB,OAAO,UAAU,eAAe;AAEpC;AAEO,SAAS,UAAU,KAA8B;AACtD,QAAM,YAAY;AAClB,SACE,aAAa,QACb,OAAO,cAAc,YACrB,OAAO,UAAU,iBAAiB,YAClC,OAAO,UAAU,SAAS;AAE9B;","names":[]}
1
+ {"version":3,"sources":["../src/types/index.ts","../src/types/guards.ts"],"sourcesContent":["/**\n * @file Types Module Exports\n * @package @jmruthers/pace-core\n * @module Types\n * @since 0.1.0\n * \n * Complete collection of type definitions for the PACE Core library.\n * Use this import path when you need access to types not included in the main export.\n * \n * @example\n * // Specialized type imports\n * import { User, Event, AccessLevel } from '@jmruthers/pace-core/types';\n * \n * // For common types, prefer the main export:\n * import { ButtonProps, CardProps } from '@jmruthers/pace-core';\n */\n\n// Core type exports\nexport * from './unified';\nexport * from './supabase';\nexport * from './database';\nexport * from './guards';\nexport * from './validation';\nexport * from './theme';\nexport * from './security';\n\n// Type declarations are handled via module augmentation in individual files\n","\n/**\n * @file Type Guards\n */\n\nimport { AuthErrorCode, User, Session } from './unified';\n\nexport function isAuthErrorCode(code: string): code is AuthErrorCode {\n return Object.values(AuthErrorCode).includes(code as AuthErrorCode);\n}\n\nexport function isUser(obj: unknown): obj is User {\n const candidate = obj as Partial<User> | null | undefined;\n return (\n candidate != null &&\n typeof candidate === 'object' &&\n typeof candidate.id === 'string' &&\n typeof candidate.created_at === 'string'\n );\n}\n\nexport function isSession(obj: unknown): obj is Session {\n const candidate = obj as Partial<Session> | null | undefined;\n return (\n candidate != null &&\n typeof candidate === 'object' &&\n typeof candidate.access_token === 'string' &&\n typeof candidate.user === 'object'\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA;;;ACbA;AAEO,SAAS,gBAAgB,MAAqC;AACnE,SAAO,OAAO,OAAO,aAAa,EAAE,SAAS,IAAqB;AACpE;AAEO,SAAS,OAAO,KAA2B;AAChD,QAAM,YAAY;AAClB,SACE,aAAa,QACb,OAAO,cAAc,YACrB,OAAO,UAAU,OAAO,YACxB,OAAO,UAAU,eAAe;AAEpC;AAEO,SAAS,UAAU,KAA8B;AACtD,QAAM,YAAY;AAClB,SACE,aAAa,QACb,OAAO,cAAc,YACrB,OAAO,UAAU,iBAAiB,YAClC,OAAO,UAAU,SAAS;AAE9B;","names":[]}
package/dist/utils.d.ts CHANGED
@@ -2,12 +2,12 @@ export { A as AppConfig, S as SecureDataAccess, a as cn, j as formatCompactNumbe
2
2
  import { z } from 'zod';
3
3
  export { u as useComponentPerformance } from './useComponentPerformance-DE9l5RkL.js';
4
4
  import * as date_fns from 'date-fns';
5
- import { D as DataTable } from './DataTable-D15XipLZ.js';
5
+ import { D as DataTable } from './DataTable-ntgmhO2W.js';
6
6
  import React__default, { ComponentType } from 'react';
7
+ import './types-CGX9Vyf5.js';
7
8
  import { SupabaseClient } from '@supabase/supabase-js';
8
9
  import 'clsx';
9
10
  import 'react/jsx-runtime';
10
- import './types-E5WSpEtz.js';
11
11
  import '@tanstack/react-table';
12
12
 
13
13
  /**
package/dist/utils.js CHANGED
@@ -551,7 +551,7 @@ function createLazyComponent(importFn, componentName, options = {}) {
551
551
  return WrappedComponent;
552
552
  }
553
553
  var LazyDataTable = createLazyComponent(
554
- () => import("./DataTable-7BER7PDS.js").then((module) => ({ default: module.DataTable })),
554
+ () => import("./DataTable-MFUXNGPR.js").then((module) => ({ default: module.DataTable })),
555
555
  "DataTable"
556
556
  );
557
557