@jmruthers/pace-core 0.5.140 → 0.5.141
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/{DataTable-JXFCA2BJ.js → DataTable-EGIN2NKK.js} +3 -3
- package/dist/{EventLogo-rFL_kRjk.d.ts → EventLogo-B3V3otev.d.ts} +307 -1
- package/dist/{chunk-BOOI7GK2.js → chunk-3R472UXR.js} +117 -1
- package/dist/chunk-3R472UXR.js.map +1 -0
- package/dist/{chunk-5JMOHWDI.js → chunk-ALUN6O3G.js} +492 -324
- package/dist/chunk-ALUN6O3G.js.map +1 -0
- package/dist/{chunk-6DXZ6V5Q.js → chunk-PZV3XZKJ.js} +2 -2
- package/dist/{chunk-TLT2ZR3L.js → chunk-WKTQM2IC.js} +2 -2
- package/dist/components.d.ts +3 -1
- package/dist/components.js +15 -3
- package/dist/components.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +18 -4
- package/dist/index.js.map +1 -1
- package/dist/rbac/index.d.ts +94 -1
- package/dist/rbac/index.js +4 -2
- package/dist/utils.js +1 -1
- package/docs/api/README.md +2 -2
- package/docs/api/classes/ColumnFactory.md +1 -1
- package/docs/api/classes/ErrorBoundary.md +1 -1
- package/docs/api/classes/InvalidScopeError.md +1 -1
- package/docs/api/classes/MissingUserContextError.md +1 -1
- package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
- package/docs/api/classes/PermissionDeniedError.md +1 -1
- package/docs/api/classes/PublicErrorBoundary.md +1 -1
- package/docs/api/classes/RBACAuditManager.md +1 -1
- package/docs/api/classes/RBACCache.md +1 -1
- package/docs/api/classes/RBACEngine.md +1 -1
- package/docs/api/classes/RBACError.md +1 -1
- package/docs/api/classes/RBACNotInitializedError.md +1 -1
- package/docs/api/classes/SecureSupabaseClient.md +1 -1
- package/docs/api/classes/StorageUtils.md +1 -1
- package/docs/api/enums/FileCategory.md +1 -1
- package/docs/api/interfaces/AggregateConfig.md +1 -1
- package/docs/api/interfaces/BadgeProps.md +1 -1
- package/docs/api/interfaces/ButtonProps.md +1 -1
- package/docs/api/interfaces/CalendarProps.md +40 -0
- package/docs/api/interfaces/CardProps.md +1 -1
- package/docs/api/interfaces/ColorPalette.md +1 -1
- package/docs/api/interfaces/ColorShade.md +1 -1
- package/docs/api/interfaces/DataAccessRecord.md +1 -1
- package/docs/api/interfaces/DataRecord.md +1 -1
- package/docs/api/interfaces/DataTableAction.md +1 -1
- package/docs/api/interfaces/DataTableColumn.md +1 -1
- package/docs/api/interfaces/DataTableProps.md +1 -1
- package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
- package/docs/api/interfaces/EmptyStateConfig.md +1 -1
- package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
- package/docs/api/interfaces/EventAppRoleData.md +1 -1
- package/docs/api/interfaces/EventLogoProps.md +1 -1
- package/docs/api/interfaces/ExportColumn.md +1 -1
- package/docs/api/interfaces/ExportOptions.md +1 -1
- package/docs/api/interfaces/FileDisplayProps.md +1 -1
- package/docs/api/interfaces/FileMetadata.md +1 -1
- package/docs/api/interfaces/FileReference.md +1 -1
- package/docs/api/interfaces/FileSizeLimits.md +1 -1
- package/docs/api/interfaces/FileUploadOptions.md +1 -1
- package/docs/api/interfaces/FileUploadProps.md +1 -1
- package/docs/api/interfaces/FooterProps.md +1 -1
- package/docs/api/interfaces/GrantEventAppRoleParams.md +1 -1
- package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
- package/docs/api/interfaces/InputProps.md +1 -1
- package/docs/api/interfaces/LabelProps.md +1 -1
- package/docs/api/interfaces/LoginFormProps.md +1 -1
- package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
- package/docs/api/interfaces/NavigationContextType.md +1 -1
- package/docs/api/interfaces/NavigationGuardProps.md +1 -1
- package/docs/api/interfaces/NavigationItem.md +1 -1
- package/docs/api/interfaces/NavigationMenuProps.md +1 -1
- package/docs/api/interfaces/NavigationProviderProps.md +1 -1
- package/docs/api/interfaces/Organisation.md +1 -1
- package/docs/api/interfaces/OrganisationContextType.md +1 -1
- package/docs/api/interfaces/OrganisationMembership.md +1 -1
- package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
- package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
- package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
- package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
- package/docs/api/interfaces/PageAccessRecord.md +1 -1
- package/docs/api/interfaces/PagePermissionContextType.md +1 -1
- package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
- package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
- package/docs/api/interfaces/PaletteData.md +1 -1
- package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
- package/docs/api/interfaces/ProtectedRouteProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
- package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
- package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
- package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
- package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
- package/docs/api/interfaces/RBACConfig.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/ResourcePermissions.md +155 -0
- package/docs/api/interfaces/RevokeEventAppRoleParams.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
- package/docs/api/interfaces/RoleManagementResult.md +1 -1
- package/docs/api/interfaces/RouteAccessRecord.md +1 -1
- package/docs/api/interfaces/RouteConfig.md +1 -1
- package/docs/api/interfaces/SecureDataContextType.md +1 -1
- package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
- package/docs/api/interfaces/SessionRestorationLoaderProps.md +1 -1
- package/docs/api/interfaces/StorageConfig.md +1 -1
- package/docs/api/interfaces/StorageFileInfo.md +1 -1
- package/docs/api/interfaces/StorageFileMetadata.md +1 -1
- package/docs/api/interfaces/StorageListOptions.md +1 -1
- package/docs/api/interfaces/StorageListResult.md +1 -1
- package/docs/api/interfaces/StorageUploadOptions.md +1 -1
- package/docs/api/interfaces/StorageUploadResult.md +1 -1
- package/docs/api/interfaces/StorageUrlOptions.md +1 -1
- package/docs/api/interfaces/StyleImport.md +1 -1
- package/docs/api/interfaces/SwitchProps.md +1 -1
- package/docs/api/interfaces/TabsContentProps.md +9 -0
- package/docs/api/interfaces/TabsListProps.md +9 -0
- package/docs/api/interfaces/TabsProps.md +9 -0
- package/docs/api/interfaces/TabsTriggerProps.md +9 -0
- package/docs/api/interfaces/TextareaProps.md +53 -0
- package/docs/api/interfaces/ToastActionElement.md +1 -1
- package/docs/api/interfaces/ToastProps.md +1 -1
- package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
- package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
- package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
- package/docs/api/interfaces/UsePublicFileDisplayOptions.md +1 -1
- package/docs/api/interfaces/UsePublicFileDisplayReturn.md +1 -1
- package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeOptions.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
- package/docs/api/interfaces/UseResourcePermissionsOptions.md +34 -0
- package/docs/api/interfaces/UserEventAccess.md +1 -1
- package/docs/api/interfaces/UserMenuProps.md +1 -1
- package/docs/api/interfaces/UserProfile.md +1 -1
- package/docs/api/modules.md +289 -2
- package/package.json +3 -1
- package/src/components/Calendar/Calendar.test.tsx +338 -0
- package/src/components/Calendar/Calendar.tsx +192 -0
- package/src/components/Calendar/index.ts +10 -0
- package/src/components/Tabs/Tabs.test.tsx +439 -0
- package/src/components/Tabs/Tabs.tsx +202 -0
- package/src/components/Tabs/index.ts +10 -0
- package/src/components/Textarea/Textarea.test.tsx +269 -0
- package/src/components/Textarea/Textarea.tsx +133 -0
- package/src/components/Textarea/index.ts +10 -0
- package/src/components/index.ts +11 -0
- package/src/index.ts +11 -0
- package/src/rbac/hooks/index.ts +2 -0
- package/src/rbac/hooks/useResourcePermissions.test.ts +633 -0
- package/src/rbac/hooks/useResourcePermissions.ts +235 -0
- package/dist/chunk-5JMOHWDI.js.map +0 -1
- package/dist/chunk-BOOI7GK2.js.map +0 -1
- /package/dist/{DataTable-JXFCA2BJ.js.map → DataTable-EGIN2NKK.js.map} +0 -0
- /package/dist/{chunk-6DXZ6V5Q.js.map → chunk-PZV3XZKJ.js.map} +0 -0
- /package/dist/{chunk-TLT2ZR3L.js.map → chunk-WKTQM2IC.js.map} +0 -0
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-
|
|
64
|
-
import "./chunk-
|
|
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-
|
|
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
|
|
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-
|
|
971
|
+
//# sourceMappingURL=chunk-3R472UXR.js.map
|