@jmruthers/pace-core 0.5.139 → 0.5.141

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/README.md +2 -2
  2. package/dist/{DataTable-JXFCA2BJ.js → DataTable-EGIN2NKK.js} +3 -3
  3. package/dist/{EventLogo-rFL_kRjk.d.ts → EventLogo-B3V3otev.d.ts} +307 -1
  4. package/dist/{chunk-BOOI7GK2.js → chunk-3R472UXR.js} +117 -1
  5. package/dist/chunk-3R472UXR.js.map +1 -0
  6. package/dist/{chunk-5JMOHWDI.js → chunk-ALUN6O3G.js} +492 -324
  7. package/dist/chunk-ALUN6O3G.js.map +1 -0
  8. package/dist/{chunk-6DXZ6V5Q.js → chunk-PZV3XZKJ.js} +2 -2
  9. package/dist/{chunk-TLT2ZR3L.js → chunk-WKTQM2IC.js} +2 -2
  10. package/dist/components.d.ts +3 -1
  11. package/dist/components.js +15 -3
  12. package/dist/components.js.map +1 -1
  13. package/dist/index.d.ts +4 -2
  14. package/dist/index.js +18 -4
  15. package/dist/index.js.map +1 -1
  16. package/dist/rbac/index.d.ts +94 -1
  17. package/dist/rbac/index.js +4 -2
  18. package/dist/utils.d.ts +1 -1
  19. package/dist/utils.js +17 -5
  20. package/dist/utils.js.map +1 -1
  21. package/docs/api/README.md +2 -2
  22. package/docs/api/classes/ColumnFactory.md +1 -1
  23. package/docs/api/classes/ErrorBoundary.md +1 -1
  24. package/docs/api/classes/InvalidScopeError.md +1 -1
  25. package/docs/api/classes/MissingUserContextError.md +1 -1
  26. package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
  27. package/docs/api/classes/PermissionDeniedError.md +1 -1
  28. package/docs/api/classes/PublicErrorBoundary.md +1 -1
  29. package/docs/api/classes/RBACAuditManager.md +1 -1
  30. package/docs/api/classes/RBACCache.md +1 -1
  31. package/docs/api/classes/RBACEngine.md +1 -1
  32. package/docs/api/classes/RBACError.md +1 -1
  33. package/docs/api/classes/RBACNotInitializedError.md +1 -1
  34. package/docs/api/classes/SecureSupabaseClient.md +1 -1
  35. package/docs/api/classes/StorageUtils.md +1 -1
  36. package/docs/api/enums/FileCategory.md +1 -1
  37. package/docs/api/interfaces/AggregateConfig.md +1 -1
  38. package/docs/api/interfaces/BadgeProps.md +1 -1
  39. package/docs/api/interfaces/ButtonProps.md +1 -1
  40. package/docs/api/interfaces/CalendarProps.md +40 -0
  41. package/docs/api/interfaces/CardProps.md +1 -1
  42. package/docs/api/interfaces/ColorPalette.md +1 -1
  43. package/docs/api/interfaces/ColorShade.md +1 -1
  44. package/docs/api/interfaces/DataAccessRecord.md +1 -1
  45. package/docs/api/interfaces/DataRecord.md +1 -1
  46. package/docs/api/interfaces/DataTableAction.md +1 -1
  47. package/docs/api/interfaces/DataTableColumn.md +1 -1
  48. package/docs/api/interfaces/DataTableProps.md +1 -1
  49. package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
  50. package/docs/api/interfaces/EmptyStateConfig.md +1 -1
  51. package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
  52. package/docs/api/interfaces/EventAppRoleData.md +1 -1
  53. package/docs/api/interfaces/EventLogoProps.md +1 -1
  54. package/docs/api/interfaces/ExportColumn.md +1 -1
  55. package/docs/api/interfaces/ExportOptions.md +1 -1
  56. package/docs/api/interfaces/FileDisplayProps.md +1 -1
  57. package/docs/api/interfaces/FileMetadata.md +1 -1
  58. package/docs/api/interfaces/FileReference.md +1 -1
  59. package/docs/api/interfaces/FileSizeLimits.md +1 -1
  60. package/docs/api/interfaces/FileUploadOptions.md +1 -1
  61. package/docs/api/interfaces/FileUploadProps.md +1 -1
  62. package/docs/api/interfaces/FooterProps.md +1 -1
  63. package/docs/api/interfaces/GrantEventAppRoleParams.md +1 -1
  64. package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
  65. package/docs/api/interfaces/InputProps.md +1 -1
  66. package/docs/api/interfaces/LabelProps.md +1 -1
  67. package/docs/api/interfaces/LoginFormProps.md +1 -1
  68. package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
  69. package/docs/api/interfaces/NavigationContextType.md +1 -1
  70. package/docs/api/interfaces/NavigationGuardProps.md +1 -1
  71. package/docs/api/interfaces/NavigationItem.md +1 -1
  72. package/docs/api/interfaces/NavigationMenuProps.md +1 -1
  73. package/docs/api/interfaces/NavigationProviderProps.md +1 -1
  74. package/docs/api/interfaces/Organisation.md +1 -1
  75. package/docs/api/interfaces/OrganisationContextType.md +1 -1
  76. package/docs/api/interfaces/OrganisationMembership.md +1 -1
  77. package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
  78. package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
  79. package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
  80. package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
  81. package/docs/api/interfaces/PageAccessRecord.md +1 -1
  82. package/docs/api/interfaces/PagePermissionContextType.md +1 -1
  83. package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
  84. package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
  85. package/docs/api/interfaces/PaletteData.md +1 -1
  86. package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
  87. package/docs/api/interfaces/ProtectedRouteProps.md +1 -1
  88. package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
  89. package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
  90. package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
  91. package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
  92. package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
  93. package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
  94. package/docs/api/interfaces/RBACConfig.md +1 -1
  95. package/docs/api/interfaces/RBACLogger.md +1 -1
  96. package/docs/api/interfaces/ResourcePermissions.md +155 -0
  97. package/docs/api/interfaces/RevokeEventAppRoleParams.md +1 -1
  98. package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
  99. package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
  100. package/docs/api/interfaces/RoleManagementResult.md +1 -1
  101. package/docs/api/interfaces/RouteAccessRecord.md +1 -1
  102. package/docs/api/interfaces/RouteConfig.md +1 -1
  103. package/docs/api/interfaces/SecureDataContextType.md +1 -1
  104. package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
  105. package/docs/api/interfaces/SessionRestorationLoaderProps.md +1 -1
  106. package/docs/api/interfaces/StorageConfig.md +1 -1
  107. package/docs/api/interfaces/StorageFileInfo.md +1 -1
  108. package/docs/api/interfaces/StorageFileMetadata.md +1 -1
  109. package/docs/api/interfaces/StorageListOptions.md +1 -1
  110. package/docs/api/interfaces/StorageListResult.md +1 -1
  111. package/docs/api/interfaces/StorageUploadOptions.md +1 -1
  112. package/docs/api/interfaces/StorageUploadResult.md +1 -1
  113. package/docs/api/interfaces/StorageUrlOptions.md +1 -1
  114. package/docs/api/interfaces/StyleImport.md +1 -1
  115. package/docs/api/interfaces/SwitchProps.md +1 -1
  116. package/docs/api/interfaces/TabsContentProps.md +9 -0
  117. package/docs/api/interfaces/TabsListProps.md +9 -0
  118. package/docs/api/interfaces/TabsProps.md +9 -0
  119. package/docs/api/interfaces/TabsTriggerProps.md +9 -0
  120. package/docs/api/interfaces/TextareaProps.md +53 -0
  121. package/docs/api/interfaces/ToastActionElement.md +1 -1
  122. package/docs/api/interfaces/ToastProps.md +1 -1
  123. package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
  124. package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
  125. package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
  126. package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
  127. package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
  128. package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
  129. package/docs/api/interfaces/UsePublicFileDisplayOptions.md +1 -1
  130. package/docs/api/interfaces/UsePublicFileDisplayReturn.md +1 -1
  131. package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
  132. package/docs/api/interfaces/UseResolvedScopeOptions.md +1 -1
  133. package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
  134. package/docs/api/interfaces/UseResourcePermissionsOptions.md +34 -0
  135. package/docs/api/interfaces/UserEventAccess.md +1 -1
  136. package/docs/api/interfaces/UserMenuProps.md +1 -1
  137. package/docs/api/interfaces/UserProfile.md +1 -1
  138. package/docs/api/modules.md +289 -2
  139. package/docs/getting-started/examples/basic-auth-app.md +196 -0
  140. package/docs/getting-started/examples/full-featured-app.md +616 -0
  141. package/package.json +3 -1
  142. package/src/components/Calendar/Calendar.test.tsx +338 -0
  143. package/src/components/Calendar/Calendar.tsx +192 -0
  144. package/src/components/Calendar/index.ts +10 -0
  145. package/src/components/Tabs/Tabs.test.tsx +439 -0
  146. package/src/components/Tabs/Tabs.tsx +202 -0
  147. package/src/components/Tabs/index.ts +10 -0
  148. package/src/components/Textarea/Textarea.test.tsx +269 -0
  149. package/src/components/Textarea/Textarea.tsx +133 -0
  150. package/src/components/Textarea/index.ts +10 -0
  151. package/src/components/index.ts +11 -0
  152. package/src/index.ts +11 -0
  153. package/src/rbac/hooks/index.ts +2 -0
  154. package/src/rbac/hooks/useResourcePermissions.test.ts +633 -0
  155. package/src/rbac/hooks/useResourcePermissions.ts +235 -0
  156. package/src/utils/performance/bundleAnalysis.ts +17 -3
  157. package/dist/chunk-5JMOHWDI.js.map +0 -1
  158. package/dist/chunk-BOOI7GK2.js.map +0 -1
  159. /package/dist/{DataTable-JXFCA2BJ.js.map → DataTable-EGIN2NKK.js.map} +0 -0
  160. /package/dist/{chunk-6DXZ6V5Q.js.map → chunk-PZV3XZKJ.js.map} +0 -0
  161. /package/dist/{chunk-TLT2ZR3L.js.map → chunk-WKTQM2IC.js.map} +0 -0
package/README.md CHANGED
@@ -303,8 +303,8 @@ import {
303
303
  ```
304
304
 
305
305
  **Available from main export:**
306
- - **Basic UI**: Button, Card, Input, Label, Alert, Avatar, Checkbox, Progress
307
- - **Advanced UI**: Dialog (with HTML content), DropdownMenu, Select, Toast, Tooltip
306
+ - **Basic UI**: Button, Card, Input, Textarea, Label, Alert, Avatar, Checkbox, Progress
307
+ - **Advanced UI**: Dialog (with HTML content), DropdownMenu, Select, Toast, Tooltip, Tabs, Calendar
308
308
  - **Data Display**: DataTable (with hierarchical actions & expand/collapse all), Table
309
309
  - **Forms**: Form, LoginForm
310
310
  - **Layout**: PaceAppLayout, Header, Footer, NavigationMenu
@@ -60,8 +60,8 @@ import {
60
60
  sum,
61
61
  validateHierarchicalData,
62
62
  validatePaginationConfig
63
- } from "./chunk-TLT2ZR3L.js";
64
- import "./chunk-BOOI7GK2.js";
63
+ } from "./chunk-WKTQM2IC.js";
64
+ import "./chunk-3R472UXR.js";
65
65
  import "./chunk-BVYWGZVV.js";
66
66
  import "./chunk-SBVILCCA.js";
67
67
  import {
@@ -170,4 +170,4 @@ export {
170
170
  validateHierarchicalData,
171
171
  validatePaginationConfig
172
172
  };
173
- //# sourceMappingURL=DataTable-JXFCA2BJ.js.map
173
+ //# sourceMappingURL=DataTable-EGIN2NKK.js.map
@@ -7,6 +7,8 @@ import * as SwitchPrimitive from '@radix-ui/react-switch';
7
7
  import * as ProgressPrimitive from '@radix-ui/react-progress';
8
8
  import * as react_jsx_runtime from 'react/jsx-runtime';
9
9
  import * as DialogPrimitive from '@radix-ui/react-dialog';
10
+ import * as TabsPrimitive from '@radix-ui/react-tabs';
11
+ import { DayPickerProps } from 'react-day-picker';
10
12
  import * as ToastPrimitives from '@radix-ui/react-toast';
11
13
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
12
14
  import { FieldValues, DefaultValues, SubmitHandler, SubmitErrorHandler, UseFormReturn } from 'react-hook-form';
@@ -328,6 +330,92 @@ interface LabelProps extends React.ComponentPropsWithoutRef<typeof LabelPrimitiv
328
330
  */
329
331
  declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLLabelElement>>;
330
332
 
333
+ /**
334
+ * @file Textarea Component
335
+ * @package @jmruthers/pace-core
336
+ * @module Textarea
337
+ * @since 0.5.141
338
+ *
339
+ * A multi-line text input component with consistent styling matching the Input component.
340
+ * Provides flexible, accessible textarea component with consistent styling and behavior.
341
+ *
342
+ * Features:
343
+ * - Multiple textarea variants (default, destructive)
344
+ * - Multiple textarea sizes (sm, md, lg)
345
+ * - Error state styling
346
+ * - Forwarded ref support
347
+ * - Consistent styling with Input component
348
+ *
349
+ * @example
350
+ * ```tsx
351
+ * // Basic textarea
352
+ * <Textarea placeholder="Enter your message..." />
353
+ *
354
+ * // Textarea with variants and sizes
355
+ * <Textarea
356
+ * variant="destructive"
357
+ * size="lg"
358
+ * placeholder="Error textarea"
359
+ * />
360
+ *
361
+ * // Textarea with error state
362
+ * <Textarea
363
+ * placeholder="Comments"
364
+ * error={true}
365
+ * />
366
+ * ```
367
+ *
368
+ * @accessibility
369
+ * - Proper ARIA attributes and roles
370
+ * - Keyboard navigation support
371
+ * - Screen reader friendly
372
+ * - Focus management
373
+ */
374
+
375
+ interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
376
+ /**
377
+ * Textarea variant style
378
+ */
379
+ variant?: 'default' | 'destructive';
380
+ /**
381
+ * Textarea size
382
+ */
383
+ size?: 'sm' | 'md' | 'lg';
384
+ /**
385
+ * Error state for styling
386
+ */
387
+ error?: boolean;
388
+ }
389
+ /**
390
+ * Textarea component
391
+ * A flexible, accessible textarea component with multiple variants and sizes.
392
+ * Matches the Input component API and styling for consistency.
393
+ *
394
+ * @param props - Textarea configuration and styling
395
+ * @param ref - Forwarded ref to the textarea element
396
+ * @returns JSX.Element - The rendered textarea element
397
+ *
398
+ * @example
399
+ * ```tsx
400
+ * // Basic textarea
401
+ * <Textarea placeholder="Enter your message..." />
402
+ *
403
+ * // Textarea with error state
404
+ * <Textarea
405
+ * placeholder="Comments"
406
+ * error={true}
407
+ * />
408
+ *
409
+ * // Large textarea with destructive variant
410
+ * <Textarea
411
+ * variant="destructive"
412
+ * size="lg"
413
+ * placeholder="Error textarea"
414
+ * />
415
+ * ```
416
+ */
417
+ declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
418
+
331
419
  /**
332
420
  * @file Alert Component Suite
333
421
  * @package @jmruthers/pace-core
@@ -1008,6 +1096,224 @@ declare const SelectSeparator: React.ForwardRefExoticComponent<{
1008
1096
  className?: string;
1009
1097
  } & React.RefAttributes<HTMLDivElement>>;
1010
1098
 
1099
+ /**
1100
+ * @file Tabs Component System
1101
+ * @package @jmruthers/pace-core
1102
+ * @module Components/Tabs
1103
+ * @since 0.5.141
1104
+ *
1105
+ * A comprehensive tabs component system built on top of Radix UI primitives.
1106
+ * Provides accessible tabbed interfaces with keyboard navigation and ARIA support.
1107
+ *
1108
+ * Features:
1109
+ * - Controlled and uncontrolled modes
1110
+ * - Keyboard navigation (arrow keys)
1111
+ * - Accessible ARIA attributes
1112
+ * - Customizable styling via className
1113
+ * - Support for icons in triggers
1114
+ * - Compound component pattern
1115
+ *
1116
+ * @example
1117
+ * ```tsx
1118
+ * // Basic tabs
1119
+ * <Tabs defaultValue="tab1">
1120
+ * <TabsList>
1121
+ * <TabsTrigger value="tab1">Tab 1</TabsTrigger>
1122
+ * <TabsTrigger value="tab2">Tab 2</TabsTrigger>
1123
+ * </TabsList>
1124
+ * <TabsContent value="tab1">Content 1</TabsContent>
1125
+ * <TabsContent value="tab2">Content 2</TabsContent>
1126
+ * </Tabs>
1127
+ *
1128
+ * // Controlled tabs
1129
+ * <Tabs value={activeTab} onValueChange={setActiveTab}>
1130
+ * <TabsList>
1131
+ * <TabsTrigger value="transport">
1132
+ * <Plane size={16} /> Transport
1133
+ * </TabsTrigger>
1134
+ * <TabsTrigger value="accommodation">
1135
+ * <Building size={16} /> Accommodation
1136
+ * </TabsTrigger>
1137
+ * </TabsList>
1138
+ * <TabsContent value="transport">
1139
+ * <TransportPlanningView />
1140
+ * </TabsContent>
1141
+ * <TabsContent value="accommodation">
1142
+ * <AccommodationPlanningView />
1143
+ * </TabsContent>
1144
+ * </Tabs>
1145
+ * ```
1146
+ *
1147
+ * @accessibility
1148
+ * - WCAG 2.1 AA compliant
1149
+ * - Keyboard navigation (Arrow keys, Home, End)
1150
+ * - Screen reader support with proper ARIA attributes
1151
+ * - Focus management
1152
+ * - Tab panel association
1153
+ */
1154
+
1155
+ interface TabsProps extends TabsPrimitive.TabsProps {
1156
+ }
1157
+ /**
1158
+ * Tabs root component
1159
+ * Provides the context for tab navigation and state management
1160
+ *
1161
+ * @component
1162
+ * @example
1163
+ * ```tsx
1164
+ * <Tabs defaultValue="tab1">
1165
+ * <TabsList>...</TabsList>
1166
+ * <TabsContent value="tab1">...</TabsContent>
1167
+ * </Tabs>
1168
+ * ```
1169
+ */
1170
+ declare const Tabs: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>>;
1171
+ interface TabsListProps extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.List> {
1172
+ }
1173
+ /**
1174
+ * TabsList component
1175
+ * Container for tab triggers
1176
+ *
1177
+ * @component
1178
+ * @example
1179
+ * ```tsx
1180
+ * <TabsList>
1181
+ * <TabsTrigger value="tab1">Tab 1</TabsTrigger>
1182
+ * <TabsTrigger value="tab2">Tab 2</TabsTrigger>
1183
+ * </TabsList>
1184
+ * ```
1185
+ */
1186
+ declare const TabsList: React.ForwardRefExoticComponent<TabsListProps & React.RefAttributes<HTMLDivElement>>;
1187
+ interface TabsTriggerProps extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger> {
1188
+ }
1189
+ /**
1190
+ * TabsTrigger component
1191
+ * Individual tab button that activates a tab panel
1192
+ *
1193
+ * @component
1194
+ * @example
1195
+ * ```tsx
1196
+ * <TabsTrigger value="tab1">Tab 1</TabsTrigger>
1197
+ *
1198
+ * // With icon
1199
+ * <TabsTrigger value="transport">
1200
+ * <Plane size={16} /> Transport
1201
+ * </TabsTrigger>
1202
+ * ```
1203
+ */
1204
+ declare const TabsTrigger: React.ForwardRefExoticComponent<TabsTriggerProps & React.RefAttributes<HTMLButtonElement>>;
1205
+ interface TabsContentProps extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content> {
1206
+ }
1207
+ /**
1208
+ * TabsContent component
1209
+ * Container for tab panel content
1210
+ *
1211
+ * @component
1212
+ * @example
1213
+ * ```tsx
1214
+ * <TabsContent value="tab1">
1215
+ * <div>Content for tab 1</div>
1216
+ * </TabsContent>
1217
+ * ```
1218
+ */
1219
+ declare const TabsContent: React.ForwardRefExoticComponent<TabsContentProps & React.RefAttributes<HTMLDivElement>>;
1220
+
1221
+ /**
1222
+ * @file Calendar Component
1223
+ * @package @jmruthers/pace-core
1224
+ * @module Components/Calendar
1225
+ * @since 0.5.141
1226
+ *
1227
+ * A date picker calendar component built on react-day-picker.
1228
+ * Provides accessible date selection with keyboard navigation and ARIA support.
1229
+ *
1230
+ * Features:
1231
+ * - Single, range, and multiple date selection modes
1232
+ * - Date disabling (past dates, weekends, etc.)
1233
+ * - Localization support
1234
+ * - Keyboard navigation
1235
+ * - Accessible date selection
1236
+ * - Customizable styling
1237
+ *
1238
+ * @example
1239
+ * ```tsx
1240
+ * // Single date selection
1241
+ * <Calendar
1242
+ * mode="single"
1243
+ * selected={date}
1244
+ * onSelect={setDate}
1245
+ * />
1246
+ *
1247
+ * // Date range selection
1248
+ * <Calendar
1249
+ * mode="range"
1250
+ * selected={dateRange}
1251
+ * onSelect={setDateRange}
1252
+ * />
1253
+ *
1254
+ * // Multiple date selection
1255
+ * <Calendar
1256
+ * mode="multiple"
1257
+ * selected={dates}
1258
+ * onSelect={setDates}
1259
+ * />
1260
+ *
1261
+ * // With disabled dates
1262
+ * <Calendar
1263
+ * mode="single"
1264
+ * selected={date}
1265
+ * onSelect={setDate}
1266
+ * disabled={(date) => date < new Date()}
1267
+ * />
1268
+ * ```
1269
+ *
1270
+ * @accessibility
1271
+ * - WCAG 2.1 AA compliant
1272
+ * - Keyboard navigation (Arrow keys, Page Up/Down, Home, End)
1273
+ * - Screen reader support with proper ARIA attributes
1274
+ * - Focus management
1275
+ * - Date announcements
1276
+ */
1277
+
1278
+ interface CalendarProps extends Omit<DayPickerProps, 'className' | 'classNames' | 'styles'> {
1279
+ /**
1280
+ * Additional CSS classes to apply to the calendar wrapper
1281
+ */
1282
+ className?: string;
1283
+ /**
1284
+ * Custom classNames for DayPicker sub-components
1285
+ */
1286
+ classNames?: DayPickerProps['classNames'];
1287
+ }
1288
+ /**
1289
+ * Calendar component
1290
+ * A flexible, accessible calendar component for date selection.
1291
+ * Built on react-day-picker with pace-core styling.
1292
+ *
1293
+ * @param props - Calendar configuration and styling
1294
+ * @param ref - Forwarded ref (not used directly, but maintained for API consistency)
1295
+ * @returns JSX.Element - The rendered calendar element
1296
+ *
1297
+ * @example
1298
+ * ```tsx
1299
+ * // Single date selection
1300
+ * <Calendar
1301
+ * mode="single"
1302
+ * selected={date}
1303
+ * onSelect={setDate}
1304
+ * />
1305
+ *
1306
+ * // With disabled dates
1307
+ * <Calendar
1308
+ * mode="single"
1309
+ * selected={date}
1310
+ * onSelect={setDate}
1311
+ * disabled={(date) => date < new Date()}
1312
+ * />
1313
+ * ```
1314
+ */
1315
+ declare const Calendar: React.ForwardRefExoticComponent<CalendarProps & React.RefAttributes<HTMLDivElement>>;
1316
+
1011
1317
  declare const ToastProvider: React.FC<ToastPrimitives.ToastProviderProps>;
1012
1318
  /**
1013
1319
  * ToastViewport component
@@ -3588,4 +3894,4 @@ declare function EventLogoCompact(props: EventLogoProps): react_jsx_runtime.JSX.
3588
3894
  */
3589
3895
  declare function EventLogoLarge(props: EventLogoProps): react_jsx_runtime.JSX.Element;
3590
3896
 
3591
- export { type DialogTitleProps as $, Alert as A, Button as B, Card as C, TableHead as D, TableRow as E, Dialog as F, DialogPortal as G, DialogOverlay as H, Input as I, DialogTrigger as J, DialogClose as K, Label as L, DialogContent as M, DialogHeader as N, DialogBody as O, Progress as P, DialogFooter as Q, DialogTitle as R, Switch as S, Table as T, DialogDescription as U, type DialogProps as V, type DialogTriggerProps as W, type DialogContentProps as X, type DialogOverlayProps as Y, type DialogHeaderProps as Z, type DialogFooterProps as _, type ButtonProps as a, useIsPublicPage as a$, type DialogDescriptionProps as a0, type DialogSize as a1, Select as a2, SelectGroup as a3, SelectValue as a4, SelectTrigger as a5, SelectContent as a6, SelectLabel as a7, SelectItem as a8, SelectSeparator as a9, type NavigationItem as aA, OrganisationSelector as aB, type OrganisationSelectorProps as aC, UserMenu as aD, ErrorBoundary as aE, type ErrorBoundaryProps as aF, type ErrorBoundaryState as aG, LoadingSpinner as aH, SessionRestorationLoader as aI, type SessionRestorationLoaderProps as aJ, EventSelector as aK, FileUpload as aL, type FileUploadProps as aM, FileDisplay as aN, type FileDisplayProps as aO, useFileReference as aP, useFileReferenceForRecord as aQ, useFileReferenceById as aR, useFilesByCategory as aS, type UseFileReferenceOptions as aT, type UseFileReferenceReturn as aU, type UseFileReferenceForRecordReturn as aV, PublicPageLayout as aW, usePublicPageContext$1 as aX, PublicPageHeader as aY, PublicPageProvider as aZ, usePublicPageContext as a_, Toast as aa, Toaster as ab, ToastAction as ac, ToastProvider as ad, ToastViewport as ae, ToastTitle as af, ToastDescription as ag, ToastClose as ah, type ToastActionElement as ai, type ToastProps as aj, Tooltip as ak, TooltipTrigger as al, TooltipContent as am, TooltipProvider as an, TooltipRoot as ao, Form as ap, type FormProps as aq, LoginForm as ar, type LoginFormProps as as, Header as at, Footer as au, type FooterProps as av, ProtectedRoute as aw, type ProtectedRouteProps as ax, NavigationMenu as ay, type NavigationMenuProps as az, CardHeader as b, PublicPageFooter as b0, PublicPageContextChecker as b1, PublicErrorBoundary as b2, useErrorBoundary as b3, DefaultPublicErrorFallback as b4, PublicLoadingSpinner as b5, PublicLoadingSpinnerFullPage as b6, PublicLoadingSkeleton as b7, EventLogo as b8, EventLogoCompact as b9, EventLogoLarge as ba, type EventLogoProps as bb, type PublicPageLayoutProps as bc, type PublicPageHeaderProps as bd, type PublicPageFooterProps as be, type PublicErrorBoundaryProps as bf, type PublicErrorBoundaryState as bg, type PublicLoadingSpinnerProps as bh, type PaceAppLayoutProps as bi, PaceAppLayout as bj, type PaceLoginPageProps as bk, PaceLoginPage as bl, type UserMenuProps as bm, CardFooter as c, CardTitle as d, CardDescription as e, CardContent as f, CardActions as g, type CardProps as h, type CardActionsProps as i, type InputProps as j, type LabelProps as k, AlertTitle as l, AlertDescription as m, Avatar as n, AvatarImage as o, AvatarFallback as p, Badge as q, type BadgeProps as r, type BadgeVariant as s, Checkbox as t, type SwitchProps as u, TableHeader as v, TableBody as w, TableCaption as x, TableCell as y, TableFooter as z };
3897
+ export { type DialogHeaderProps as $, Alert as A, Button as B, Card as C, TableCell as D, TableFooter as E, TableHead as F, TableRow as G, Dialog as H, Input as I, DialogPortal as J, DialogOverlay as K, Label as L, DialogTrigger as M, DialogClose as N, DialogContent as O, Progress as P, DialogHeader as Q, DialogBody as R, Switch as S, Textarea as T, DialogFooter as U, DialogTitle as V, DialogDescription as W, type DialogProps as X, type DialogTriggerProps as Y, type DialogContentProps as Z, type DialogOverlayProps as _, type ButtonProps as a, useFileReference as a$, type DialogFooterProps as a0, type DialogTitleProps as a1, type DialogDescriptionProps as a2, type DialogSize as a3, Select as a4, SelectGroup as a5, SelectValue as a6, SelectTrigger as a7, SelectContent as a8, SelectLabel as a9, TooltipRoot as aA, Form as aB, type FormProps as aC, LoginForm as aD, type LoginFormProps as aE, Header as aF, Footer as aG, type FooterProps as aH, ProtectedRoute as aI, type ProtectedRouteProps as aJ, NavigationMenu as aK, type NavigationMenuProps as aL, type NavigationItem as aM, OrganisationSelector as aN, type OrganisationSelectorProps as aO, UserMenu as aP, ErrorBoundary as aQ, type ErrorBoundaryProps as aR, type ErrorBoundaryState as aS, LoadingSpinner as aT, SessionRestorationLoader as aU, type SessionRestorationLoaderProps as aV, EventSelector as aW, FileUpload as aX, type FileUploadProps as aY, FileDisplay as aZ, type FileDisplayProps as a_, SelectItem as aa, SelectSeparator as ab, Tabs as ac, TabsList as ad, TabsTrigger as ae, TabsContent as af, type TabsProps as ag, type TabsListProps as ah, type TabsTriggerProps as ai, type TabsContentProps as aj, Calendar as ak, type CalendarProps as al, Toast as am, Toaster as an, ToastAction as ao, ToastProvider as ap, ToastViewport as aq, ToastTitle as ar, ToastDescription as as, ToastClose as at, type ToastActionElement as au, type ToastProps as av, Tooltip as aw, TooltipTrigger as ax, TooltipContent as ay, TooltipProvider as az, CardHeader as b, useFileReferenceForRecord as b0, useFileReferenceById as b1, useFilesByCategory as b2, type UseFileReferenceOptions as b3, type UseFileReferenceReturn as b4, type UseFileReferenceForRecordReturn as b5, PublicPageLayout as b6, usePublicPageContext$1 as b7, PublicPageHeader as b8, PublicPageProvider as b9, usePublicPageContext as ba, useIsPublicPage as bb, PublicPageFooter as bc, PublicPageContextChecker as bd, PublicErrorBoundary as be, useErrorBoundary as bf, DefaultPublicErrorFallback as bg, PublicLoadingSpinner as bh, PublicLoadingSpinnerFullPage as bi, PublicLoadingSkeleton as bj, EventLogo as bk, EventLogoCompact as bl, EventLogoLarge as bm, type EventLogoProps as bn, type PublicPageLayoutProps as bo, type PublicPageHeaderProps as bp, type PublicPageFooterProps as bq, type PublicErrorBoundaryProps as br, type PublicErrorBoundaryState as bs, type PublicLoadingSpinnerProps as bt, type PaceAppLayoutProps as bu, PaceAppLayout as bv, type PaceLoginPageProps as bw, PaceLoginPage as bx, type UserMenuProps as by, CardFooter as c, CardTitle as d, CardDescription as e, CardContent as f, CardActions as g, type CardProps as h, type CardActionsProps as i, type InputProps as j, type LabelProps as k, type TextareaProps as l, AlertTitle as m, AlertDescription as n, Avatar as o, AvatarImage as p, AvatarFallback as q, Badge as r, type BadgeProps as s, type BadgeVariant as t, Checkbox as u, type SwitchProps as v, Table as w, TableHeader as x, TableBody as y, TableCaption as z };
@@ -714,6 +714,121 @@ function useCachedPermissions(userId, scope) {
714
714
  }), [permissions, isLoading, error, invalidateCache, fetchCachedPermissions]);
715
715
  }
716
716
 
717
+ // src/rbac/hooks/useResourcePermissions.ts
718
+ init_UnifiedAuthProvider();
719
+ init_useOrganisations();
720
+ import { useMemo as useMemo3 } from "react";
721
+ function useResourcePermissions(resource, options = {}) {
722
+ const { enableRead = false, requireScope = true } = options;
723
+ const { user, supabase } = useUnifiedAuth();
724
+ const { selectedOrganisation } = useOrganisations();
725
+ let selectedEvent = null;
726
+ try {
727
+ const eventsContext = useEvents();
728
+ selectedEvent = eventsContext.selectedEvent;
729
+ } catch (error2) {
730
+ }
731
+ const { resolvedScope, isLoading: scopeLoading, error: scopeError } = useResolvedScope({
732
+ supabase,
733
+ selectedOrganisationId: selectedOrganisation?.id || null,
734
+ selectedEventId: selectedEvent?.event_id || null
735
+ });
736
+ const scope = resolvedScope || {
737
+ organisationId: selectedOrganisation?.id || "",
738
+ eventId: selectedEvent?.event_id || void 0,
739
+ appId: void 0
740
+ };
741
+ const { can: canCreateResult, isLoading: createLoading, error: createError } = useCan(
742
+ user?.id || "",
743
+ scope,
744
+ `create:${resource}`,
745
+ void 0,
746
+ // pageId
747
+ true
748
+ // useCache
749
+ );
750
+ const { can: canUpdateResult, isLoading: updateLoading, error: updateError } = useCan(
751
+ user?.id || "",
752
+ scope,
753
+ `update:${resource}`,
754
+ void 0,
755
+ // pageId
756
+ true
757
+ // useCache
758
+ );
759
+ const { can: canDeleteResult, isLoading: deleteLoading, error: deleteError } = useCan(
760
+ user?.id || "",
761
+ scope,
762
+ `delete:${resource}`,
763
+ void 0,
764
+ // pageId
765
+ true
766
+ // useCache
767
+ );
768
+ const { can: canReadResult, isLoading: readLoading, error: readError } = useCan(
769
+ user?.id || "",
770
+ scope,
771
+ `read:${resource}`,
772
+ void 0,
773
+ // pageId
774
+ true
775
+ // useCache
776
+ );
777
+ const isLoading = useMemo3(() => {
778
+ return scopeLoading || createLoading || updateLoading || deleteLoading || enableRead && readLoading;
779
+ }, [scopeLoading, createLoading, updateLoading, deleteLoading, readLoading, enableRead]);
780
+ const error = useMemo3(() => {
781
+ if (scopeError) return scopeError;
782
+ if (createError) return createError;
783
+ if (updateError) return updateError;
784
+ if (deleteError) return deleteError;
785
+ if (enableRead && readError) return readError;
786
+ return null;
787
+ }, [scopeError, createError, updateError, deleteError, readError, enableRead]);
788
+ return useMemo3(() => ({
789
+ canCreate: (res) => {
790
+ if (res !== resource) {
791
+ return false;
792
+ }
793
+ return canCreateResult;
794
+ },
795
+ canUpdate: (res) => {
796
+ if (res !== resource) {
797
+ return false;
798
+ }
799
+ return canUpdateResult;
800
+ },
801
+ canDelete: (res) => {
802
+ if (res !== resource) {
803
+ return false;
804
+ }
805
+ return canDeleteResult;
806
+ },
807
+ canRead: (res) => {
808
+ if (!enableRead) {
809
+ return true;
810
+ }
811
+ if (res !== resource) {
812
+ return false;
813
+ }
814
+ return canReadResult;
815
+ },
816
+ scope,
817
+ isLoading,
818
+ error
819
+ }), [
820
+ resource,
821
+ canCreateResult,
822
+ canUpdateResult,
823
+ canDeleteResult,
824
+ canReadResult,
825
+ enableRead,
826
+ scope,
827
+ isLoading,
828
+ error
829
+ ]);
830
+ }
831
+
717
832
  // src/rbac/hooks/useRoleManagement.ts
718
833
  init_UnifiedAuthProvider();
719
834
  import { useState as useState4, useCallback as useCallback3 } from "react";
@@ -850,6 +965,7 @@ export {
850
965
  useHasAnyPermission,
851
966
  useHasAllPermissions,
852
967
  useCachedPermissions,
968
+ useResourcePermissions,
853
969
  useRoleManagement
854
970
  };
855
- //# sourceMappingURL=chunk-BOOI7GK2.js.map
971
+ //# sourceMappingURL=chunk-3R472UXR.js.map