@jmruthers/pace-core 0.5.184 → 0.5.186

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 (319) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +60 -1
  3. package/core-usage-manifest.json +312 -0
  4. package/dist/{DataTable-QAB34V6K.js → DataTable-IX2NBUTP.js} +6 -6
  5. package/dist/{DataTable-Bz8ffqyA.d.ts → DataTable-Z9NLVJh0.d.ts} +1 -1
  6. package/dist/{index-Bl--n7-T.d.ts → PublicPageProvider-DIzEzwKl.d.ts} +23 -10
  7. package/dist/{UnifiedAuthProvider-7F6T4B6K.js → UnifiedAuthProvider-A4BCQRJY.js} +4 -2
  8. package/dist/{UnifiedAuthProvider-F86d7dSi.d.ts → UnifiedAuthProvider-BG0AL5eE.d.ts} +2 -1
  9. package/dist/{api-ROMBCNKU.js → api-BMFCXVQX.js} +2 -2
  10. package/dist/{chunk-RA3JUFMW.js → chunk-445GEP27.js} +154 -4
  11. package/dist/{chunk-RA3JUFMW.js.map → chunk-445GEP27.js.map} +1 -1
  12. package/dist/{chunk-W22JP75J.js → chunk-DAGICKHT.js} +9 -7
  13. package/dist/chunk-DAGICKHT.js.map +1 -0
  14. package/dist/{chunk-FUEYYMX5.js → chunk-FXFJRTKI.js} +24 -3
  15. package/dist/chunk-FXFJRTKI.js.map +1 -0
  16. package/dist/{chunk-CSOFYHAG.js → chunk-GRIQLQ52.js} +374 -60
  17. package/dist/chunk-GRIQLQ52.js.map +1 -0
  18. package/dist/{chunk-NQPMQGS2.js → chunk-HDCUMOOI.js} +497 -399
  19. package/dist/chunk-HDCUMOOI.js.map +1 -0
  20. package/dist/chunk-HESYZWZW.js +388 -0
  21. package/dist/chunk-HESYZWZW.js.map +1 -0
  22. package/dist/{chunk-QUVSNGIP.js → chunk-HGPQUCBC.js} +34 -9
  23. package/dist/{chunk-QUVSNGIP.js.map → chunk-HGPQUCBC.js.map} +1 -1
  24. package/dist/{chunk-PWAHJW4G.js → chunk-OALXJH4Y.js} +86 -33
  25. package/dist/chunk-OALXJH4Y.js.map +1 -0
  26. package/dist/{chunk-MI7HBHN3.js → chunk-TC7D3CR3.js} +89 -9
  27. package/dist/chunk-TC7D3CR3.js.map +1 -0
  28. package/dist/chunk-THRPYOFK.js +215 -0
  29. package/dist/chunk-THRPYOFK.js.map +1 -0
  30. package/dist/{chunk-M7W4CP3M.js → chunk-U6WNSFX5.js} +2 -1
  31. package/dist/chunk-U6WNSFX5.js.map +1 -0
  32. package/dist/{chunk-UHNYIBXL.js → chunk-UQWSHFVX.js} +1 -1
  33. package/dist/chunk-UQWSHFVX.js.map +1 -0
  34. package/dist/{chunk-QCDXODCA.js → chunk-XAUHJD3L.js} +2 -2
  35. package/dist/components.d.ts +182 -6
  36. package/dist/components.js +157 -11
  37. package/dist/components.js.map +1 -1
  38. package/dist/{database.generated-CBmg2950.d.ts → database.generated-DI89OQeI.d.ts} +63 -9
  39. package/dist/eslint-rules/pace-core-compliance.cjs +406 -0
  40. package/dist/{file-reference-D06mEEWW.d.ts → file-reference-PRTSLxKx.d.ts} +10 -1
  41. package/dist/hooks.d.ts +52 -15
  42. package/dist/hooks.js +12 -22
  43. package/dist/hooks.js.map +1 -1
  44. package/dist/index.d.ts +12 -12
  45. package/dist/index.js +82 -18
  46. package/dist/index.js.map +1 -1
  47. package/dist/providers.d.ts +1 -1
  48. package/dist/providers.js +3 -1
  49. package/dist/rbac/index.d.ts +206 -15
  50. package/dist/rbac/index.js +28 -6
  51. package/dist/timezone-_pgH8qrY.d.ts +530 -0
  52. package/dist/{types-_x1f4QBF.d.ts → types-DUyCRSTj.d.ts} +1 -1
  53. package/dist/types.d.ts +2 -2
  54. package/dist/types.js +1 -1
  55. package/dist/{usePublicRouteParams-JJczomYq.d.ts → usePublicRouteParams-D71QLlg4.d.ts} +114 -3
  56. package/dist/utils.d.ts +110 -152
  57. package/dist/utils.js +128 -138
  58. package/dist/utils.js.map +1 -1
  59. package/docs/api/README.md +60 -1
  60. package/docs/api/classes/ColumnFactory.md +1 -1
  61. package/docs/api/classes/ErrorBoundary.md +1 -1
  62. package/docs/api/classes/InvalidScopeError.md +1 -1
  63. package/docs/api/classes/Logger.md +178 -0
  64. package/docs/api/classes/MissingUserContextError.md +1 -1
  65. package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
  66. package/docs/api/classes/PermissionDeniedError.md +1 -1
  67. package/docs/api/classes/RBACAuditManager.md +2 -2
  68. package/docs/api/classes/RBACCache.md +1 -1
  69. package/docs/api/classes/RBACEngine.md +2 -2
  70. package/docs/api/classes/RBACError.md +1 -1
  71. package/docs/api/classes/RBACNotInitializedError.md +1 -1
  72. package/docs/api/classes/SecureSupabaseClient.md +5 -5
  73. package/docs/api/classes/StorageUtils.md +1 -1
  74. package/docs/api/enums/FileCategory.md +1 -1
  75. package/docs/api/enums/LogLevel.md +54 -0
  76. package/docs/api/enums/RBACErrorCode.md +1 -1
  77. package/docs/api/enums/RPCFunction.md +1 -1
  78. package/docs/api/interfaces/AggregateConfig.md +1 -1
  79. package/docs/api/interfaces/BadgeProps.md +1 -1
  80. package/docs/api/interfaces/ButtonProps.md +1 -1
  81. package/docs/api/interfaces/CalendarProps.md +18 -2
  82. package/docs/api/interfaces/CardProps.md +1 -1
  83. package/docs/api/interfaces/ColorPalette.md +1 -1
  84. package/docs/api/interfaces/ColorShade.md +1 -1
  85. package/docs/api/interfaces/ComplianceResult.md +30 -0
  86. package/docs/api/interfaces/DataAccessRecord.md +1 -1
  87. package/docs/api/interfaces/DataRecord.md +1 -1
  88. package/docs/api/interfaces/DataTableAction.md +1 -1
  89. package/docs/api/interfaces/DataTableColumn.md +1 -1
  90. package/docs/api/interfaces/DataTableProps.md +1 -1
  91. package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
  92. package/docs/api/interfaces/DatabaseComplianceResult.md +85 -0
  93. package/docs/api/interfaces/DatabaseIssue.md +41 -0
  94. package/docs/api/interfaces/EmptyStateConfig.md +1 -1
  95. package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
  96. package/docs/api/interfaces/EventAppRoleData.md +6 -6
  97. package/docs/api/interfaces/ExportColumn.md +1 -1
  98. package/docs/api/interfaces/ExportOptions.md +1 -1
  99. package/docs/api/interfaces/FileDisplayProps.md +1 -1
  100. package/docs/api/interfaces/FileMetadata.md +1 -1
  101. package/docs/api/interfaces/FileReference.md +1 -1
  102. package/docs/api/interfaces/FileSizeLimits.md +1 -1
  103. package/docs/api/interfaces/FileUploadOptions.md +48 -8
  104. package/docs/api/interfaces/FileUploadProps.md +46 -13
  105. package/docs/api/interfaces/FooterProps.md +1 -1
  106. package/docs/api/interfaces/FormFieldProps.md +1 -1
  107. package/docs/api/interfaces/FormProps.md +1 -1
  108. package/docs/api/interfaces/GrantEventAppRoleParams.md +9 -9
  109. package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
  110. package/docs/api/interfaces/InputProps.md +1 -1
  111. package/docs/api/interfaces/LabelProps.md +1 -1
  112. package/docs/api/interfaces/LoggerConfig.md +62 -0
  113. package/docs/api/interfaces/LoginFormProps.md +1 -1
  114. package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
  115. package/docs/api/interfaces/NavigationContextType.md +1 -1
  116. package/docs/api/interfaces/NavigationGuardProps.md +1 -1
  117. package/docs/api/interfaces/NavigationItem.md +1 -1
  118. package/docs/api/interfaces/NavigationMenuProps.md +1 -1
  119. package/docs/api/interfaces/NavigationProviderProps.md +1 -1
  120. package/docs/api/interfaces/Organisation.md +1 -1
  121. package/docs/api/interfaces/OrganisationContextType.md +1 -1
  122. package/docs/api/interfaces/OrganisationMembership.md +1 -1
  123. package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
  124. package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
  125. package/docs/api/interfaces/PaceAppLayoutProps.md +36 -23
  126. package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
  127. package/docs/api/interfaces/PageAccessRecord.md +1 -1
  128. package/docs/api/interfaces/PagePermissionContextType.md +1 -1
  129. package/docs/api/interfaces/PagePermissionGuardProps.md +11 -11
  130. package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
  131. package/docs/api/interfaces/PaletteData.md +1 -1
  132. package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
  133. package/docs/api/interfaces/ProgressProps.md +1 -1
  134. package/docs/api/interfaces/ProtectedRouteProps.md +6 -6
  135. package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
  136. package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
  137. package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
  138. package/docs/api/interfaces/QuickFix.md +52 -0
  139. package/docs/api/interfaces/RBACAccessValidateParams.md +1 -1
  140. package/docs/api/interfaces/RBACAccessValidateResult.md +1 -1
  141. package/docs/api/interfaces/RBACAuditLogParams.md +1 -1
  142. package/docs/api/interfaces/RBACAuditLogResult.md +1 -1
  143. package/docs/api/interfaces/RBACConfig.md +4 -4
  144. package/docs/api/interfaces/RBACContext.md +1 -1
  145. package/docs/api/interfaces/RBACLogger.md +1 -1
  146. package/docs/api/interfaces/RBACPageAccessCheckParams.md +1 -1
  147. package/docs/api/interfaces/RBACPermissionCheckParams.md +1 -1
  148. package/docs/api/interfaces/RBACPermissionCheckResult.md +1 -1
  149. package/docs/api/interfaces/RBACPermissionsGetParams.md +1 -1
  150. package/docs/api/interfaces/RBACPermissionsGetResult.md +1 -1
  151. package/docs/api/interfaces/RBACResult.md +1 -1
  152. package/docs/api/interfaces/RBACRoleGrantParams.md +1 -1
  153. package/docs/api/interfaces/RBACRoleGrantResult.md +1 -1
  154. package/docs/api/interfaces/RBACRoleRevokeParams.md +1 -1
  155. package/docs/api/interfaces/RBACRoleRevokeResult.md +1 -1
  156. package/docs/api/interfaces/RBACRoleValidateParams.md +1 -1
  157. package/docs/api/interfaces/RBACRoleValidateResult.md +1 -1
  158. package/docs/api/interfaces/RBACRolesListParams.md +1 -1
  159. package/docs/api/interfaces/RBACRolesListResult.md +1 -1
  160. package/docs/api/interfaces/RBACSessionTrackParams.md +1 -1
  161. package/docs/api/interfaces/RBACSessionTrackResult.md +1 -1
  162. package/docs/api/interfaces/ResourcePermissions.md +1 -1
  163. package/docs/api/interfaces/RevokeEventAppRoleParams.md +7 -7
  164. package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
  165. package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
  166. package/docs/api/interfaces/RoleManagementResult.md +5 -5
  167. package/docs/api/interfaces/RouteAccessRecord.md +1 -1
  168. package/docs/api/interfaces/RouteConfig.md +1 -1
  169. package/docs/api/interfaces/RuntimeComplianceResult.md +55 -0
  170. package/docs/api/interfaces/SecureDataContextType.md +1 -1
  171. package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
  172. package/docs/api/interfaces/SessionRestorationLoaderProps.md +1 -1
  173. package/docs/api/interfaces/SetupIssue.md +41 -0
  174. package/docs/api/interfaces/StorageConfig.md +1 -1
  175. package/docs/api/interfaces/StorageFileInfo.md +1 -1
  176. package/docs/api/interfaces/StorageFileMetadata.md +1 -1
  177. package/docs/api/interfaces/StorageListOptions.md +1 -1
  178. package/docs/api/interfaces/StorageListResult.md +1 -1
  179. package/docs/api/interfaces/StorageUploadOptions.md +1 -1
  180. package/docs/api/interfaces/StorageUploadResult.md +1 -1
  181. package/docs/api/interfaces/StorageUrlOptions.md +1 -1
  182. package/docs/api/interfaces/StyleImport.md +1 -1
  183. package/docs/api/interfaces/SwitchProps.md +1 -1
  184. package/docs/api/interfaces/TabsContentProps.md +1 -1
  185. package/docs/api/interfaces/TabsListProps.md +1 -1
  186. package/docs/api/interfaces/TabsProps.md +1 -1
  187. package/docs/api/interfaces/TabsTriggerProps.md +1 -1
  188. package/docs/api/interfaces/TextareaProps.md +1 -1
  189. package/docs/api/interfaces/ToastActionElement.md +1 -1
  190. package/docs/api/interfaces/ToastProps.md +1 -1
  191. package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
  192. package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
  193. package/docs/api/interfaces/UseFormDialogOptions.md +62 -0
  194. package/docs/api/interfaces/UseFormDialogReturn.md +117 -0
  195. package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
  196. package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
  197. package/docs/api/interfaces/UsePublicEventLogoOptions.md +2 -2
  198. package/docs/api/interfaces/UsePublicEventLogoReturn.md +1 -1
  199. package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
  200. package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
  201. package/docs/api/interfaces/UsePublicFileDisplayOptions.md +2 -2
  202. package/docs/api/interfaces/UsePublicFileDisplayReturn.md +1 -1
  203. package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
  204. package/docs/api/interfaces/UseResolvedScopeOptions.md +2 -2
  205. package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
  206. package/docs/api/interfaces/UseResourcePermissionsOptions.md +1 -1
  207. package/docs/api/interfaces/UserEventAccess.md +1 -1
  208. package/docs/api/interfaces/UserMenuProps.md +1 -1
  209. package/docs/api/interfaces/UserProfile.md +1 -1
  210. package/docs/api/modules.md +746 -50
  211. package/docs/api-reference/components.md +26 -12
  212. package/docs/api-reference/hooks.md +111 -0
  213. package/docs/api-reference/rpc-functions.md +1 -1
  214. package/docs/api-reference/utilities.md +184 -0
  215. package/docs/getting-started/installation-guide.md +75 -16
  216. package/docs/getting-started/quick-start.md +61 -11
  217. package/docs/implementation-guides/authentication.md +88 -12
  218. package/docs/implementation-guides/file-reference-system.md +26 -3
  219. package/docs/implementation-guides/file-upload-storage.md +30 -1
  220. package/docs/rbac/README.md +1 -0
  221. package/docs/rbac/compliance/compliance-guide.md +544 -0
  222. package/docs/rbac/getting-started.md +158 -33
  223. package/docs/standards/pace-core-compliance.md +432 -0
  224. package/eslint-config-pace-core.cjs +93 -0
  225. package/package.json +15 -3
  226. package/scripts/analyze-bundle.js +232 -0
  227. package/scripts/build-css.js +56 -0
  228. package/scripts/build-docs-incremental.js +1015 -0
  229. package/scripts/check-pace-core-compliance.cjs +2353 -0
  230. package/scripts/check-pace-core-compliance.js +512 -0
  231. package/scripts/generate-docs.js +157 -0
  232. package/scripts/setup-build-cache.js +73 -0
  233. package/scripts/utils/command-runner.js +131 -0
  234. package/scripts/utils/env.js +33 -0
  235. package/scripts/utils/index.js +10 -0
  236. package/scripts/utils/logger.js +88 -0
  237. package/scripts/utils/path-helpers.js +37 -0
  238. package/scripts/validate-formats.js +133 -0
  239. package/scripts/validate-master.js +155 -0
  240. package/scripts/validate-pre-publish.js +140 -0
  241. package/scripts/validate-theme.js +142 -0
  242. package/src/components/Calendar/Calendar.tsx +8 -1
  243. package/src/components/Card/Card.tsx +47 -8
  244. package/src/components/DatePickerWithTimezone/DatePickerWithTimezone.test.tsx +314 -0
  245. package/src/components/DatePickerWithTimezone/DatePickerWithTimezone.tsx +126 -0
  246. package/src/components/DatePickerWithTimezone/README.md +135 -0
  247. package/src/components/DatePickerWithTimezone/index.ts +10 -0
  248. package/src/components/DateTimeField/DateTimeField.test.tsx +358 -0
  249. package/src/components/DateTimeField/DateTimeField.tsx +232 -0
  250. package/src/components/DateTimeField/README.md +148 -0
  251. package/src/components/DateTimeField/index.ts +10 -0
  252. package/src/components/FileUpload/FileUpload.test.tsx +2 -0
  253. package/src/components/FileUpload/FileUpload.tsx +10 -1
  254. package/src/components/Header/Header.test.tsx +47 -18
  255. package/src/components/Header/Header.tsx +22 -7
  256. package/src/components/PaceAppLayout/PaceAppLayout.tsx +29 -20
  257. package/src/components/PaceAppLayout/README.md +9 -0
  258. package/src/components/ProtectedRoute/ProtectedRoute.test.tsx +37 -8
  259. package/src/components/ProtectedRoute/ProtectedRoute.tsx +146 -5
  260. package/src/components/index.ts +8 -0
  261. package/src/eslint-rules/pace-core-compliance.cjs +406 -0
  262. package/src/eslint-rules/pace-core-compliance.js +640 -0
  263. package/src/hooks/__tests__/useFormDialog.test.ts +478 -0
  264. package/src/hooks/index.ts +5 -0
  265. package/src/hooks/useFileReference.test.ts +2 -0
  266. package/src/hooks/useFormDialog.ts +147 -0
  267. package/src/hooks/usePreventTabReload.ts +106 -0
  268. package/src/hooks/useSecureDataAccess.ts +2 -2
  269. package/src/index.ts +27 -0
  270. package/src/providers/services/OrganisationServiceProvider.tsx +6 -5
  271. package/src/providers/services/UnifiedAuthProvider.tsx +24 -3
  272. package/src/rbac/__tests__/rbac-role-isolation.test.ts +456 -0
  273. package/src/rbac/__tests__/scenarios.user-role.test.tsx +3 -0
  274. package/src/rbac/compliance/database-validator.ts +165 -0
  275. package/src/rbac/compliance/index.ts +38 -0
  276. package/src/rbac/compliance/quick-fix-suggestions.ts +209 -0
  277. package/src/rbac/compliance/runtime-compliance.ts +77 -0
  278. package/src/rbac/compliance/setup-validator.ts +131 -0
  279. package/src/rbac/components/PagePermissionGuard.tsx +8 -64
  280. package/src/rbac/components/__tests__/PagePermissionGuard.test.tsx +35 -21
  281. package/src/rbac/docs/event-based-apps.md +285 -0
  282. package/src/rbac/errors.ts +11 -0
  283. package/src/rbac/hooks/useRoleManagement.ts +292 -12
  284. package/src/rbac/index.ts +30 -0
  285. package/src/services/OrganisationService.ts +4 -0
  286. package/src/styles/core.css +5 -5
  287. package/src/types/database.generated.ts +63 -9
  288. package/src/types/file-reference.ts +9 -0
  289. package/src/utils/__tests__/timezone.test.ts +345 -0
  290. package/src/utils/file-reference/__tests__/file-reference.test.ts +60 -4
  291. package/src/utils/file-reference/index.ts +13 -2
  292. package/src/utils/formatting/formatDateTimeTimezone.test.ts +167 -0
  293. package/src/utils/formatting/formatting.ts +179 -0
  294. package/src/utils/index.ts +27 -1
  295. package/src/utils/location/index.ts +16 -0
  296. package/src/utils/location/location.test.ts +286 -0
  297. package/src/utils/location/location.ts +175 -0
  298. package/src/utils/security/secureDataAccess.ts +1 -1
  299. package/src/utils/storage/helpers.ts +68 -0
  300. package/src/utils/timezone/index.ts +17 -0
  301. package/src/utils/timezone/timezone.test.ts +349 -0
  302. package/src/utils/timezone/timezone.ts +281 -0
  303. package/dist/chunk-CSOFYHAG.js.map +0 -1
  304. package/dist/chunk-FUEYYMX5.js.map +0 -1
  305. package/dist/chunk-HKIT6O7W.js +0 -198
  306. package/dist/chunk-HKIT6O7W.js.map +0 -1
  307. package/dist/chunk-KUEN3HFB.js +0 -94
  308. package/dist/chunk-KUEN3HFB.js.map +0 -1
  309. package/dist/chunk-M7W4CP3M.js.map +0 -1
  310. package/dist/chunk-MI7HBHN3.js.map +0 -1
  311. package/dist/chunk-NQPMQGS2.js.map +0 -1
  312. package/dist/chunk-PWAHJW4G.js.map +0 -1
  313. package/dist/chunk-UHNYIBXL.js.map +0 -1
  314. package/dist/chunk-W22JP75J.js.map +0 -1
  315. package/dist/formatting-5wETwiGF.d.ts +0 -162
  316. /package/dist/{DataTable-QAB34V6K.js.map → DataTable-IX2NBUTP.js.map} +0 -0
  317. /package/dist/{UnifiedAuthProvider-7F6T4B6K.js.map → UnifiedAuthProvider-A4BCQRJY.js.map} +0 -0
  318. /package/dist/{api-ROMBCNKU.js.map → api-BMFCXVQX.js.map} +0 -0
  319. /package/dist/{chunk-QCDXODCA.js.map → chunk-XAUHJD3L.js.map} +0 -0
@@ -1,10 +1,10 @@
1
- export { a as UnifiedAuthContextType, c as UnifiedAuthProvider, b as UnifiedAuthProviderProps, u as useUnifiedAuth } from './UnifiedAuthProvider-F86d7dSi.js';
2
- export { A as Alert, m as AlertDescription, l as AlertTitle, n as Avatar, p as AvatarFallback, o as AvatarImage, q as Badge, r as BadgeProps, s as BadgeVariant, B as Button, a as ButtonProps, a3 as Calendar, a4 as CalendarProps, C as Card, g as CardActions, bc as CardActionsProps, f as CardContent, e as CardDescription, c as CardFooter, b as CardHeader, h as CardProps, d as CardTitle, t as Checkbox, D as Dialog, G as DialogBody, z as DialogClose, E as DialogContent, bf as DialogContentProps, K as DialogDescription, bk as DialogDescriptionProps, H as DialogFooter, bi as DialogFooterProps, F as DialogHeader, bh as DialogHeaderProps, x as DialogOverlay, bg as DialogOverlayProps, w as DialogPortal, bd as DialogProps, bl as DialogSize, J as DialogTitle, bj as DialogTitleProps, y as DialogTrigger, be as DialogTriggerProps, aF as ErrorBoundary, bn as ErrorBoundaryProps, bo as ErrorBoundaryState, aJ as EventSelector, aO as FileDisplay, aP as FileDisplayProps, aM as FileUpload, aN as FileUploadProps, ar as Footer, as as FooterProps, ak as Form, al as FormField, an as FormFieldProps, am as FormProps, aq as Header, I as Input, i as InputProps, L as Label, j as LabelProps, aG as LoadingSpinner, ao as LoginForm, ap as LoginFormProps, av as NavigationItem, at as NavigationMenu, au as NavigationMenuProps, aK as OrganisationSelector, bm as OrganisationSelectorProps, az as PaceAppLayout, aA as PaceAppLayoutProps, aB as PaceLoginPage, aC as PaceLoginPageProps, P as Progress, v as ProgressProps, aD as ProtectedRoute, aE as ProtectedRouteProps, b5 as PublicPageFooter, bb as PublicPageFooterProps, b4 as PublicPageHeader, ba as PublicPageHeaderProps, b3 as PublicPageLayout, b9 as PublicPageLayoutProps, b6 as PublicPageProvider, M as Select, R as SelectContent, N as SelectGroup, V as SelectItem, U as SelectLabel, W as SelectSeparator, Q as SelectTrigger, O as SelectValue, aH as SessionRestorationLoader, aI as SessionRestorationLoaderProps, S as Switch, u as SwitchProps, aX as Table, aZ as TableBody, a_ as TableCaption, a$ as TableCell, b0 as TableFooter, b1 as TableHead, aY as TableHeader, b2 as TableRow, X as Tabs, _ as TabsContent, a2 as TabsContentProps, Y as TabsList, a0 as TabsListProps, $ as TabsProps, Z as TabsTrigger, a1 as TabsTriggerProps, T as Textarea, k as TextareaProps, a5 as Toast, a7 as ToastAction, ad as ToastActionElement, ac as ToastClose, ab as ToastDescription, ae as ToastProps, a8 as ToastProvider, aa as ToastTitle, a9 as ToastViewport, a6 as Toaster, af as Tooltip, ah as TooltipContent, ai as TooltipProvider, aj as TooltipRoot, ag as TooltipTrigger, aW as UseFileReferenceForRecordReturn, aU as UseFileReferenceOptions, aV as UseFileReferenceReturn, ax as UserMenu, aQ as useFileReference, aS as useFileReferenceById, aR as useFileReferenceForRecord, aT as useFilesByCategory, b8 as useIsPublicPage, b7 as usePublicPageContext } from './index-Bl--n7-T.js';
1
+ export { a as UnifiedAuthContextType, d as UnifiedAuthProvider, c as UnifiedAuthProviderProps, u as useUnifiedAuth } from './UnifiedAuthProvider-BG0AL5eE.js';
2
+ export { A as Alert, n as AlertDescription, m as AlertTitle, o as Avatar, q as AvatarFallback, p as AvatarImage, r as Badge, s as BadgeProps, t as BadgeVariant, B as Button, a as ButtonProps, al as Calendar, am as CalendarProps, C as Card, g as CardActions, i as CardActionsProps, f as CardContent, e as CardDescription, c as CardFooter, b as CardHeader, h as CardProps, d as CardTitle, u as Checkbox, J as Dialog, U as DialogBody, O as DialogClose, Q as DialogContent, _ as DialogContentProps, X as DialogDescription, a3 as DialogDescriptionProps, V as DialogFooter, a1 as DialogFooterProps, R as DialogHeader, a0 as DialogHeaderProps, M as DialogOverlay, $ as DialogOverlayProps, K as DialogPortal, Y as DialogProps, a4 as DialogSize, W as DialogTitle, a2 as DialogTitleProps, N as DialogTrigger, Z as DialogTriggerProps, aT as ErrorBoundary, aU as ErrorBoundaryProps, aV as ErrorBoundaryState, aZ as EventSelector, b0 as FileDisplay, b1 as FileDisplayProps, a_ as FileUpload, a$ as FileUploadProps, aJ as Footer, aK as FooterProps, aC as Form, aD as FormField, aF as FormFieldProps, aE as FormProps, aI as Header, I as Input, j as InputProps, L as Label, k as LabelProps, aW as LoadingSpinner, aG as LoginForm, aH as LoginFormProps, aP as NavigationItem, aN as NavigationMenu, aO as NavigationMenuProps, aQ as OrganisationSelector, aR as OrganisationSelectorProps, bj as PaceAppLayout, bi as PaceAppLayoutProps, bl as PaceLoginPage, bk as PaceLoginPageProps, P as Progress, w as ProgressProps, aL as ProtectedRoute, aM as ProtectedRouteProps, bb as PublicPageFooter, bh as PublicPageFooterProps, ba as PublicPageHeader, bg as PublicPageHeaderProps, b9 as PublicPageLayout, bf as PublicPageLayoutProps, bc as PublicPageProvider, a5 as Select, a9 as SelectContent, a6 as SelectGroup, ab as SelectItem, aa as SelectLabel, ac as SelectSeparator, a8 as SelectTrigger, a7 as SelectValue, aX as SessionRestorationLoader, aY as SessionRestorationLoaderProps, S as Switch, v as SwitchProps, x as Table, z as TableBody, D as TableCaption, E as TableCell, F as TableFooter, G as TableHead, y as TableHeader, H as TableRow, ad as Tabs, ag as TabsContent, ak as TabsContentProps, ae as TabsList, ai as TabsListProps, ah as TabsProps, af as TabsTrigger, aj as TabsTriggerProps, T as Textarea, l as TextareaProps, an as Toast, ap as ToastAction, av as ToastActionElement, au as ToastClose, at as ToastDescription, aw as ToastProps, aq as ToastProvider, as as ToastTitle, ar as ToastViewport, ao as Toaster, ax as Tooltip, az as TooltipContent, aA as TooltipProvider, aB as TooltipRoot, ay as TooltipTrigger, b8 as UseFileReferenceForRecordReturn, b6 as UseFileReferenceOptions, b7 as UseFileReferenceReturn, aS as UserMenu, b2 as useFileReference, b4 as useFileReferenceById, b3 as useFileReferenceForRecord, b5 as useFilesByCategory, be as useIsPublicPage, bd as usePublicPageContext } from './PublicPageProvider-DIzEzwKl.js';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
4
  export { u as useToast } from './useToast-C8gR5ir4.js';
4
- export { D as DataTable, a as DataTableProps } from './DataTable-Bz8ffqyA.js';
5
- export { A as AggregateConfig, D as DataRecord, g as DataTableAction, a as DataTableColumn, j as DataTableToolbarButton, f as EmptyStateConfig, G as GetRowId } from './types-_x1f4QBF.js';
6
- export { b as FileCategory, a as FileMetadata, F as FileReference, c as FileUploadOptions } from './file-reference-D06mEEWW.js';
7
- import 'react/jsx-runtime';
5
+ export { D as DataTable, a as DataTableProps } from './DataTable-Z9NLVJh0.js';
6
+ export { A as AggregateConfig, c as DataRecord, a as DataTableAction, D as DataTableColumn, b as DataTableToolbarButton, E as EmptyStateConfig, G as GetRowId } from './types-DUyCRSTj.js';
7
+ export { F as FileCategory, b as FileMetadata, a as FileReference, c as FileUploadOptions } from './file-reference-PRTSLxKx.js';
8
8
  import 'react';
9
9
  import '@supabase/supabase-js';
10
10
  import './event-CW5YB_2p.js';
@@ -24,3 +24,179 @@ import 'react-hook-form';
24
24
  import 'zod';
25
25
  import './types-UU913iLA.js';
26
26
  import '@tanstack/react-table';
27
+
28
+ /**
29
+ * @file DateTimeField Component
30
+ * @package @jmruthers/pace-core
31
+ * @module Components/DateTimeField
32
+ * @since 0.1.0
33
+ *
34
+ * Form input component for datetime values with timezone support.
35
+ * Handles UTC ↔ timezone conversion automatically.
36
+ *
37
+ * Features:
38
+ * - Automatic UTC ↔ timezone conversion
39
+ * - Prevents unwanted conversions during user editing
40
+ * - Shows timezone information when not UTC
41
+ * - Supports both ISO string and Date object values
42
+ * - Uses native datetime-local input type
43
+ * - Accessible form field with proper labels
44
+ *
45
+ * @example
46
+ * ```tsx
47
+ * import { DateTimeField } from '@jmruthers/pace-core/components';
48
+ * import { useState } from 'react';
49
+ *
50
+ * function EventForm() {
51
+ * const [startTime, setStartTime] = useState<string>();
52
+ *
53
+ * return (
54
+ * <DateTimeField
55
+ * label="Start Time"
56
+ * value={startTime}
57
+ * onChange={setStartTime}
58
+ * timezone="America/New_York"
59
+ * required
60
+ * />
61
+ * );
62
+ * }
63
+ * ```
64
+ *
65
+ * @accessibility
66
+ * - Proper label association with htmlFor
67
+ * - Required field indicators
68
+ * - Screen reader friendly
69
+ * - Keyboard navigation support
70
+ * - Focus management
71
+ */
72
+ /**
73
+ * Props for the DateTimeField component
74
+ */
75
+ interface DateTimeFieldProps {
76
+ /**
77
+ * Field label
78
+ */
79
+ label: string;
80
+ /**
81
+ * UTC date value (ISO string, Date object, or undefined)
82
+ */
83
+ value: string | Date | undefined;
84
+ /**
85
+ * Change handler that receives UTC value (ISO string or Date object)
86
+ */
87
+ onChange: (value: string | Date | undefined) => void;
88
+ /**
89
+ * Target timezone for display (default: 'UTC')
90
+ */
91
+ timezone?: string;
92
+ /**
93
+ * Whether the field is required
94
+ */
95
+ required?: boolean;
96
+ /**
97
+ * Additional CSS classes
98
+ */
99
+ className?: string;
100
+ /**
101
+ * If true, onChange returns Date object instead of ISO string
102
+ */
103
+ returnAsDate?: boolean;
104
+ /**
105
+ * Input id (auto-generated if not provided)
106
+ */
107
+ id?: string;
108
+ /**
109
+ * Helper text to display below the label
110
+ */
111
+ helperText?: string;
112
+ /**
113
+ * Error message to display
114
+ */
115
+ error?: string;
116
+ }
117
+ /**
118
+ * DateTimeField component
119
+ * Form input for datetime values with automatic timezone conversion
120
+ *
121
+ * @param props - DateTimeField configuration
122
+ * @returns JSX.Element - The rendered datetime field
123
+ */
124
+ declare function DateTimeField({ label, value, onChange, timezone, required, className, returnAsDate, id, helperText, error }: DateTimeFieldProps): react_jsx_runtime.JSX.Element;
125
+
126
+ /**
127
+ * @file DatePickerWithTimezone Component
128
+ * @package @jmruthers/pace-core
129
+ * @module Components/DatePickerWithTimezone
130
+ * @since 0.1.0
131
+ *
132
+ * Date picker component that displays timezone information alongside the calendar.
133
+ * Provides a calendar interface with timezone context for date selection.
134
+ *
135
+ * Features:
136
+ * - Calendar date selection
137
+ * - Timezone display (shows "Local" when matches user timezone)
138
+ * - Optional "Done" button
139
+ * - Accessible date selection
140
+ * - Keyboard navigation support
141
+ *
142
+ * @example
143
+ * ```tsx
144
+ * import { DatePickerWithTimezone } from '@jmruthers/pace-core/components';
145
+ * import { useState } from 'react';
146
+ *
147
+ * function DateSelector() {
148
+ * const [date, setDate] = useState<Date>();
149
+ *
150
+ * return (
151
+ * <DatePickerWithTimezone
152
+ * selected={date}
153
+ * onSelect={setDate}
154
+ * timezone="America/New_York"
155
+ * onDone={() => console.log('Date selected')}
156
+ * />
157
+ * );
158
+ * }
159
+ * ```
160
+ *
161
+ * @accessibility
162
+ * - WCAG 2.1 AA compliant
163
+ * - Keyboard navigation support
164
+ * - Screen reader friendly
165
+ * - Focus management
166
+ * - Proper ARIA attributes
167
+ */
168
+ /**
169
+ * Props for the DatePickerWithTimezone component
170
+ */
171
+ interface DatePickerWithTimezoneProps {
172
+ /**
173
+ * Currently selected date
174
+ */
175
+ selected?: Date;
176
+ /**
177
+ * Date selection handler
178
+ */
179
+ onSelect: (date: Date | undefined) => void;
180
+ /**
181
+ * Optional callback when "Done" button is clicked
182
+ */
183
+ onDone?: () => void;
184
+ /**
185
+ * Timezone to display (defaults to user's timezone)
186
+ */
187
+ timezone?: string;
188
+ /**
189
+ * Additional CSS classes
190
+ */
191
+ className?: string;
192
+ }
193
+ /**
194
+ * DatePickerWithTimezone component
195
+ * Date picker with timezone information display
196
+ *
197
+ * @param props - DatePickerWithTimezone configuration
198
+ * @returns JSX.Element - The rendered date picker with timezone
199
+ */
200
+ declare function DatePickerWithTimezone({ selected, onSelect, onDone, timezone, className }: DatePickerWithTimezoneProps): react_jsx_runtime.JSX.Element;
201
+
202
+ export { DatePickerWithTimezone, type DatePickerWithTimezoneProps, DateTimeField, type DateTimeFieldProps };
@@ -49,7 +49,7 @@ import {
49
49
  useFileReferenceById,
50
50
  useFileReferenceForRecord,
51
51
  useFilesByCategory
52
- } from "./chunk-NQPMQGS2.js";
52
+ } from "./chunk-HDCUMOOI.js";
53
53
  import {
54
54
  Alert,
55
55
  AlertDescription,
@@ -90,39 +90,183 @@ import {
90
90
  TooltipProvider,
91
91
  TooltipRoot,
92
92
  TooltipTrigger
93
- } from "./chunk-QUVSNGIP.js";
94
- import "./chunk-RA3JUFMW.js";
95
- import "./chunk-M7W4CP3M.js";
93
+ } from "./chunk-HGPQUCBC.js";
94
+ import "./chunk-445GEP27.js";
95
+ import "./chunk-U6WNSFX5.js";
96
96
  import "./chunk-FSFQFJCU.js";
97
97
  import {
98
98
  ErrorBoundary,
99
99
  PublicPageProvider,
100
100
  useIsPublicPage,
101
101
  usePublicPageContext
102
- } from "./chunk-MI7HBHN3.js";
102
+ } from "./chunk-TC7D3CR3.js";
103
103
  import {
104
104
  useToast
105
105
  } from "./chunk-6C4YBBJM.js";
106
- import "./chunk-QCDXODCA.js";
106
+ import "./chunk-XAUHJD3L.js";
107
107
  import "./chunk-KQCRWDSA.js";
108
108
  import {
109
109
  UnifiedAuthProvider,
110
110
  useUnifiedAuth
111
- } from "./chunk-FUEYYMX5.js";
111
+ } from "./chunk-FXFJRTKI.js";
112
112
  import {
113
113
  FileCategory
114
- } from "./chunk-UHNYIBXL.js";
114
+ } from "./chunk-UQWSHFVX.js";
115
115
  import "./chunk-QXHPKYJV.js";
116
116
  import {
117
- LoadingSpinner
118
- } from "./chunk-KUEN3HFB.js";
119
- import "./chunk-R77UEZ4E.js";
117
+ LoadingSpinner,
118
+ fromZonedTime,
119
+ getUserTimeZone,
120
+ toZonedTime
121
+ } from "./chunk-THRPYOFK.js";
122
+ import {
123
+ cn
124
+ } from "./chunk-R77UEZ4E.js";
120
125
  import "./chunk-F2IMUDXZ.js";
121
126
  import "./chunk-FMUCXFII.js";
122
127
  import "./chunk-VBXEHIUJ.js";
123
128
  import "./chunk-SQGMNID3.js";
124
129
  import "./chunk-PWLANIRT.js";
125
130
  import "./chunk-7D4SUZUM.js";
131
+
132
+ // src/components/DateTimeField/DateTimeField.tsx
133
+ import * as React from "react";
134
+ import { format, parse } from "date-fns";
135
+ import { jsx, jsxs } from "react/jsx-runtime";
136
+ function DateTimeField({
137
+ label,
138
+ value,
139
+ onChange,
140
+ timezone = "UTC",
141
+ required = false,
142
+ className,
143
+ returnAsDate = false,
144
+ id,
145
+ helperText,
146
+ error
147
+ }) {
148
+ const [isEditing, setIsEditing] = React.useState(false);
149
+ const inputRef = React.useRef(null);
150
+ const fieldId = id || `datetime-field-${React.useId()}`;
151
+ const getDisplayValue = React.useCallback(() => {
152
+ if (!value) {
153
+ return "";
154
+ }
155
+ try {
156
+ let dateObj;
157
+ if (typeof value === "string") {
158
+ dateObj = new Date(value);
159
+ } else {
160
+ dateObj = value;
161
+ }
162
+ if (!dateObj || isNaN(dateObj.getTime())) {
163
+ return "";
164
+ }
165
+ const zonedDate = toZonedTime(dateObj, timezone);
166
+ return format(zonedDate, "yyyy-MM-dd'T'HH:mm");
167
+ } catch {
168
+ return "";
169
+ }
170
+ }, [value, timezone]);
171
+ const displayValue = isEditing ? void 0 : getDisplayValue();
172
+ const handleChange = React.useCallback((e) => {
173
+ setIsEditing(true);
174
+ const inputValue = e.target.value;
175
+ if (!inputValue) {
176
+ onChange(void 0);
177
+ return;
178
+ }
179
+ try {
180
+ const localDate = parse(inputValue, "yyyy-MM-dd'T'HH:mm", /* @__PURE__ */ new Date());
181
+ if (isNaN(localDate.getTime())) {
182
+ onChange(void 0);
183
+ return;
184
+ }
185
+ const utcDate = fromZonedTime(localDate, timezone);
186
+ if (returnAsDate) {
187
+ onChange(utcDate);
188
+ } else {
189
+ onChange(utcDate.toISOString());
190
+ }
191
+ } catch {
192
+ onChange(void 0);
193
+ }
194
+ }, [timezone, returnAsDate, onChange]);
195
+ const handleBlur = React.useCallback(() => {
196
+ setIsEditing(false);
197
+ }, []);
198
+ const getTimezoneDisplay = React.useCallback(() => {
199
+ if (timezone === "UTC") {
200
+ return "";
201
+ }
202
+ const userTz = getUserTimeZone();
203
+ if (timezone === userTz) {
204
+ return "Local";
205
+ }
206
+ return timezone;
207
+ }, [timezone]);
208
+ const timezoneDisplay = getTimezoneDisplay();
209
+ return /* @__PURE__ */ jsxs("div", { className: cn("space-y-2", className), children: [
210
+ /* @__PURE__ */ jsx(Label, { htmlFor: fieldId, required, helperText, error, children: label }),
211
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
212
+ /* @__PURE__ */ jsx(
213
+ Input,
214
+ {
215
+ ref: inputRef,
216
+ id: fieldId,
217
+ type: "datetime-local",
218
+ value: displayValue,
219
+ onChange: handleChange,
220
+ onBlur: handleBlur,
221
+ required,
222
+ error: !!error,
223
+ className: "w-full"
224
+ }
225
+ ),
226
+ timezoneDisplay && /* @__PURE__ */ jsx("span", { className: "absolute right-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground pointer-events-none", children: timezoneDisplay })
227
+ ] })
228
+ ] });
229
+ }
230
+
231
+ // src/components/DatePickerWithTimezone/DatePickerWithTimezone.tsx
232
+ import { Clock } from "lucide-react";
233
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
234
+ function DatePickerWithTimezone({
235
+ selected,
236
+ onSelect,
237
+ onDone,
238
+ timezone,
239
+ className
240
+ }) {
241
+ const userTimezone = getUserTimeZone();
242
+ const displayTimezone = timezone || userTimezone;
243
+ const timezoneDisplay = displayTimezone === userTimezone ? "Local" : displayTimezone;
244
+ return /* @__PURE__ */ jsxs2("div", { className: cn("flex flex-col", className), children: [
245
+ /* @__PURE__ */ jsx2("div", { className: "p-3", children: /* @__PURE__ */ jsx2(
246
+ Calendar,
247
+ {
248
+ mode: "single",
249
+ selected,
250
+ onSelect,
251
+ initialFocus: true,
252
+ captionLayout: "dropdown-buttons",
253
+ fromYear: 1900,
254
+ toYear: 2100,
255
+ className: "p-0"
256
+ }
257
+ ) }),
258
+ /* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between border-t border-border px-3 py-2", children: [
259
+ /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
260
+ /* @__PURE__ */ jsx2(Clock, { className: "h-4 w-4", "aria-hidden": "true" }),
261
+ /* @__PURE__ */ jsxs2("span", { children: [
262
+ "Timezone: ",
263
+ /* @__PURE__ */ jsx2("span", { "aria-label": `Timezone ${timezoneDisplay}`, children: timezoneDisplay })
264
+ ] })
265
+ ] }),
266
+ onDone && /* @__PURE__ */ jsx2(Button, { onClick: onDone, size: "sm", className: "h-8", children: "Done" })
267
+ ] })
268
+ ] });
269
+ }
126
270
  export {
127
271
  Alert,
128
272
  AlertDescription,
@@ -142,6 +286,8 @@ export {
142
286
  CardTitle,
143
287
  Checkbox,
144
288
  DataTable,
289
+ DatePickerWithTimezone,
290
+ DateTimeField,
145
291
  Dialog,
146
292
  DialogBody,
147
293
  DialogClose,
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../src/components/DateTimeField/DateTimeField.tsx","../src/components/DatePickerWithTimezone/DatePickerWithTimezone.tsx"],"sourcesContent":["/**\n * @file DateTimeField Component\n * @package @jmruthers/pace-core\n * @module Components/DateTimeField\n * @since 0.1.0\n *\n * Form input component for datetime values with timezone support.\n * Handles UTC ↔ timezone conversion automatically.\n *\n * Features:\n * - Automatic UTC ↔ timezone conversion\n * - Prevents unwanted conversions during user editing\n * - Shows timezone information when not UTC\n * - Supports both ISO string and Date object values\n * - Uses native datetime-local input type\n * - Accessible form field with proper labels\n *\n * @example\n * ```tsx\n * import { DateTimeField } from '@jmruthers/pace-core/components';\n * import { useState } from 'react';\n *\n * function EventForm() {\n * const [startTime, setStartTime] = useState<string>();\n *\n * return (\n * <DateTimeField\n * label=\"Start Time\"\n * value={startTime}\n * onChange={setStartTime}\n * timezone=\"America/New_York\"\n * required\n * />\n * );\n * }\n * ```\n *\n * @accessibility\n * - Proper label association with htmlFor\n * - Required field indicators\n * - Screen reader friendly\n * - Keyboard navigation support\n * - Focus management\n */\n\nimport * as React from 'react';\nimport { format, parse } from 'date-fns';\nimport { Label } from '../Label';\nimport { Input } from '../Input';\nimport { cn } from '../../utils/core/cn';\nimport { toZonedTime, fromZonedTime, getUserTimeZone } from '../../utils/timezone';\n\n/**\n * Props for the DateTimeField component\n */\nexport interface DateTimeFieldProps {\n /**\n * Field label\n */\n label: string;\n /**\n * UTC date value (ISO string, Date object, or undefined)\n */\n value: string | Date | undefined;\n /**\n * Change handler that receives UTC value (ISO string or Date object)\n */\n onChange: (value: string | Date | undefined) => void;\n /**\n * Target timezone for display (default: 'UTC')\n */\n timezone?: string;\n /**\n * Whether the field is required\n */\n required?: boolean;\n /**\n * Additional CSS classes\n */\n className?: string;\n /**\n * If true, onChange returns Date object instead of ISO string\n */\n returnAsDate?: boolean;\n /**\n * Input id (auto-generated if not provided)\n */\n id?: string;\n /**\n * Helper text to display below the label\n */\n helperText?: string;\n /**\n * Error message to display\n */\n error?: string;\n}\n\n/**\n * DateTimeField component\n * Form input for datetime values with automatic timezone conversion\n *\n * @param props - DateTimeField configuration\n * @returns JSX.Element - The rendered datetime field\n */\nexport function DateTimeField({\n label,\n value,\n onChange,\n timezone = 'UTC',\n required = false,\n className,\n returnAsDate = false,\n id,\n helperText,\n error\n}: DateTimeFieldProps) {\n const [isEditing, setIsEditing] = React.useState(false);\n const inputRef = React.useRef<HTMLInputElement>(null);\n const fieldId = id || `datetime-field-${React.useId()}`;\n\n // Convert UTC value to timezone for display\n const getDisplayValue = React.useCallback((): string => {\n if (!value) {\n return '';\n }\n\n try {\n let dateObj: Date;\n if (typeof value === 'string') {\n dateObj = new Date(value);\n } else {\n dateObj = value;\n }\n\n if (!dateObj || isNaN(dateObj.getTime())) {\n return '';\n }\n\n // Convert UTC to timezone\n const zonedDate = toZonedTime(dateObj, timezone);\n\n // Format for datetime-local input (YYYY-MM-DDTHH:mm)\n return format(zonedDate, \"yyyy-MM-dd'T'HH:mm\");\n } catch {\n return '';\n }\n }, [value, timezone]);\n\n const displayValue = isEditing ? undefined : getDisplayValue();\n\n // Handle input change\n const handleChange = React.useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\n setIsEditing(true);\n const inputValue = e.target.value;\n\n if (!inputValue) {\n onChange(undefined);\n return;\n }\n\n try {\n // Parse the datetime-local value (in timezone)\n const localDate = parse(inputValue, \"yyyy-MM-dd'T'HH:mm\", new Date());\n\n if (isNaN(localDate.getTime())) {\n onChange(undefined);\n return;\n }\n\n // Convert from timezone to UTC\n const utcDate = fromZonedTime(localDate, timezone);\n\n // Return as ISO string or Date object\n if (returnAsDate) {\n onChange(utcDate);\n } else {\n onChange(utcDate.toISOString());\n }\n } catch {\n onChange(undefined);\n }\n }, [timezone, returnAsDate, onChange]);\n\n // Handle blur to stop editing mode\n const handleBlur = React.useCallback(() => {\n setIsEditing(false);\n }, []);\n\n // Get timezone display text\n const getTimezoneDisplay = React.useCallback((): string => {\n if (timezone === 'UTC') {\n return '';\n }\n\n const userTz = getUserTimeZone();\n if (timezone === userTz) {\n return 'Local';\n }\n\n return timezone;\n }, [timezone]);\n\n const timezoneDisplay = getTimezoneDisplay();\n\n return (\n <div className={cn('space-y-2', className)}>\n <Label htmlFor={fieldId} required={required} helperText={helperText} error={error}>\n {label}\n </Label>\n <div className=\"relative\">\n <Input\n ref={inputRef}\n id={fieldId}\n type=\"datetime-local\"\n value={displayValue}\n onChange={handleChange}\n onBlur={handleBlur}\n required={required}\n error={!!error}\n className=\"w-full\"\n />\n {timezoneDisplay && (\n <span className=\"absolute right-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground pointer-events-none\">\n {timezoneDisplay}\n </span>\n )}\n </div>\n </div>\n );\n}\n\n","/**\n * @file DatePickerWithTimezone Component\n * @package @jmruthers/pace-core\n * @module Components/DatePickerWithTimezone\n * @since 0.1.0\n *\n * Date picker component that displays timezone information alongside the calendar.\n * Provides a calendar interface with timezone context for date selection.\n *\n * Features:\n * - Calendar date selection\n * - Timezone display (shows \"Local\" when matches user timezone)\n * - Optional \"Done\" button\n * - Accessible date selection\n * - Keyboard navigation support\n *\n * @example\n * ```tsx\n * import { DatePickerWithTimezone } from '@jmruthers/pace-core/components';\n * import { useState } from 'react';\n *\n * function DateSelector() {\n * const [date, setDate] = useState<Date>();\n *\n * return (\n * <DatePickerWithTimezone\n * selected={date}\n * onSelect={setDate}\n * timezone=\"America/New_York\"\n * onDone={() => console.log('Date selected')}\n * />\n * );\n * }\n * ```\n *\n * @accessibility\n * - WCAG 2.1 AA compliant\n * - Keyboard navigation support\n * - Screen reader friendly\n * - Focus management\n * - Proper ARIA attributes\n */\n\nimport * as React from 'react';\nimport { Calendar } from '../Calendar';\nimport { Button } from '../Button';\nimport { Clock } from 'lucide-react';\nimport { getUserTimeZone } from '../../utils/timezone';\nimport { cn } from '../../utils/core/cn';\n\n/**\n * Props for the DatePickerWithTimezone component\n */\nexport interface DatePickerWithTimezoneProps {\n /**\n * Currently selected date\n */\n selected?: Date;\n /**\n * Date selection handler\n */\n onSelect: (date: Date | undefined) => void;\n /**\n * Optional callback when \"Done\" button is clicked\n */\n onDone?: () => void;\n /**\n * Timezone to display (defaults to user's timezone)\n */\n timezone?: string;\n /**\n * Additional CSS classes\n */\n className?: string;\n}\n\n/**\n * DatePickerWithTimezone component\n * Date picker with timezone information display\n *\n * @param props - DatePickerWithTimezone configuration\n * @returns JSX.Element - The rendered date picker with timezone\n */\nexport function DatePickerWithTimezone({\n selected,\n onSelect,\n onDone,\n timezone,\n className\n}: DatePickerWithTimezoneProps) {\n const userTimezone = getUserTimeZone();\n const displayTimezone = timezone || userTimezone;\n const timezoneDisplay = displayTimezone === userTimezone ? 'Local' : displayTimezone;\n\n return (\n <div className={cn('flex flex-col', className)}>\n <div className=\"p-3\">\n <Calendar\n mode=\"single\"\n selected={selected}\n onSelect={onSelect}\n initialFocus\n captionLayout=\"dropdown-buttons\"\n fromYear={1900}\n toYear={2100}\n className=\"p-0\"\n />\n </div>\n\n <div className=\"flex items-center justify-between border-t border-border px-3 py-2\">\n <div className=\"flex items-center gap-2 text-sm text-muted-foreground\">\n <Clock className=\"h-4 w-4\" aria-hidden=\"true\" />\n <span>\n Timezone: <span aria-label={`Timezone ${timezoneDisplay}`}>{timezoneDisplay}</span>\n </span>\n </div>\n {onDone && (\n <Button onClick={onDone} size=\"sm\" className=\"h-8\">\n Done\n </Button>\n )}\n </div>\n </div>\n );\n}\n\n"],"mappings":"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","names":["jsx","jsxs"]}
@@ -3307,13 +3307,13 @@ type Database = {
3307
3307
  }
3308
3308
  ];
3309
3309
  };
3310
- pace_id_documents: {
3310
+ pace_identification: {
3311
3311
  Row: {
3312
3312
  created_at: string | null;
3313
3313
  document_number: string | null;
3314
- document_type: string;
3315
3314
  expiry_date: string | null;
3316
3315
  id: string;
3316
+ identification_type_id: number | null;
3317
3317
  issue_city: string | null;
3318
3318
  issue_country: string | null;
3319
3319
  issue_date: string | null;
@@ -3326,9 +3326,9 @@ type Database = {
3326
3326
  Insert: {
3327
3327
  created_at?: string | null;
3328
3328
  document_number?: string | null;
3329
- document_type: string;
3330
3329
  expiry_date?: string | null;
3331
3330
  id?: string;
3331
+ identification_type_id?: number | null;
3332
3332
  issue_city?: string | null;
3333
3333
  issue_country?: string | null;
3334
3334
  issue_date?: string | null;
@@ -3341,9 +3341,9 @@ type Database = {
3341
3341
  Update: {
3342
3342
  created_at?: string | null;
3343
3343
  document_number?: string | null;
3344
- document_type?: string;
3345
3344
  expiry_date?: string | null;
3346
3345
  id?: string;
3346
+ identification_type_id?: number | null;
3347
3347
  issue_city?: string | null;
3348
3348
  issue_country?: string | null;
3349
3349
  issue_date?: string | null;
@@ -3355,14 +3355,21 @@ type Database = {
3355
3355
  };
3356
3356
  Relationships: [
3357
3357
  {
3358
- foreignKeyName: "fk_pace_id_documents_organisation_id";
3358
+ foreignKeyName: "fk_pace_identification_organisation_id";
3359
3359
  columns: ["organisation_id"];
3360
3360
  isOneToOne: false;
3361
3361
  referencedRelation: "organisations";
3362
3362
  referencedColumns: ["id"];
3363
3363
  },
3364
3364
  {
3365
- foreignKeyName: "identification_documents_member_id_fkey";
3365
+ foreignKeyName: "fk_pace_identification_type_id";
3366
+ columns: ["identification_type_id"];
3367
+ isOneToOne: false;
3368
+ referencedRelation: "pace_identification_type";
3369
+ referencedColumns: ["id"];
3370
+ },
3371
+ {
3372
+ foreignKeyName: "pace_identification_member_id_fkey";
3366
3373
  columns: ["member_id"];
3367
3374
  isOneToOne: false;
3368
3375
  referencedRelation: "pace_member";
@@ -3370,6 +3377,53 @@ type Database = {
3370
3377
  }
3371
3378
  ];
3372
3379
  };
3380
+ pace_identification_type: {
3381
+ Row: {
3382
+ created_at: string | null;
3383
+ created_by: string | null;
3384
+ description: string | null;
3385
+ id: number;
3386
+ is_active: boolean | null;
3387
+ name: string;
3388
+ organisation_id: string;
3389
+ sort_order: number | null;
3390
+ updated_at: string | null;
3391
+ updated_by: string | null;
3392
+ };
3393
+ Insert: {
3394
+ created_at?: string | null;
3395
+ created_by?: string | null;
3396
+ description?: string | null;
3397
+ id?: never;
3398
+ is_active?: boolean | null;
3399
+ name: string;
3400
+ organisation_id: string;
3401
+ sort_order?: number | null;
3402
+ updated_at?: string | null;
3403
+ updated_by?: string | null;
3404
+ };
3405
+ Update: {
3406
+ created_at?: string | null;
3407
+ created_by?: string | null;
3408
+ description?: string | null;
3409
+ id?: never;
3410
+ is_active?: boolean | null;
3411
+ name?: string;
3412
+ organisation_id?: string;
3413
+ sort_order?: number | null;
3414
+ updated_at?: string | null;
3415
+ updated_by?: string | null;
3416
+ };
3417
+ Relationships: [
3418
+ {
3419
+ foreignKeyName: "pace_identification_type_organisation_id_fkey";
3420
+ columns: ["organisation_id"];
3421
+ isOneToOne: false;
3422
+ referencedRelation: "organisations";
3423
+ referencedColumns: ["id"];
3424
+ }
3425
+ ];
3426
+ };
3373
3427
  pace_member: {
3374
3428
  Row: {
3375
3429
  address_id: string | null;
@@ -3839,7 +3893,7 @@ type Database = {
3839
3893
  }
3840
3894
  ];
3841
3895
  };
3842
- pace_qualifications: {
3896
+ pace_qualification: {
3843
3897
  Row: {
3844
3898
  created_at: string | null;
3845
3899
  credential_id: string | null;
@@ -3881,14 +3935,14 @@ type Database = {
3881
3935
  };
3882
3936
  Relationships: [
3883
3937
  {
3884
- foreignKeyName: "fk_pace_qualifications_organisation_id";
3938
+ foreignKeyName: "fk_pace_qualification_organisation_id";
3885
3939
  columns: ["organisation_id"];
3886
3940
  isOneToOne: false;
3887
3941
  referencedRelation: "organisations";
3888
3942
  referencedColumns: ["id"];
3889
3943
  },
3890
3944
  {
3891
- foreignKeyName: "qualifications_member_id_fkey";
3945
+ foreignKeyName: "pace_qualification_member_id_fkey";
3892
3946
  columns: ["member_id"];
3893
3947
  isOneToOne: false;
3894
3948
  referencedRelation: "pace_member";