@jmruthers/pace-core 0.5.66 → 0.5.67

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 (112) hide show
  1. package/dist/{PublicLoadingSpinner-CXJ-W9wZ.d.ts → PublicLoadingSpinner-DdKXTkCZ.d.ts} +94 -1
  2. package/dist/{chunk-PSE2XO4L.js → chunk-ZB6AEA7I.js} +308 -260
  3. package/dist/chunk-ZB6AEA7I.js.map +1 -0
  4. package/dist/components.d.ts +2 -1
  5. package/dist/components.js +3 -1
  6. package/dist/components.js.map +1 -1
  7. package/dist/index.d.ts +3 -2
  8. package/dist/index.js +3 -1
  9. package/dist/index.js.map +1 -1
  10. package/docs/api/classes/ColumnFactory.md +1 -1
  11. package/docs/api/classes/ErrorBoundary.md +1 -1
  12. package/docs/api/classes/InvalidScopeError.md +1 -1
  13. package/docs/api/classes/MissingUserContextError.md +1 -1
  14. package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
  15. package/docs/api/classes/PermissionDeniedError.md +1 -1
  16. package/docs/api/classes/PublicErrorBoundary.md +1 -1
  17. package/docs/api/classes/RBACAuditManager.md +1 -1
  18. package/docs/api/classes/RBACCache.md +1 -1
  19. package/docs/api/classes/RBACEngine.md +1 -1
  20. package/docs/api/classes/RBACError.md +1 -1
  21. package/docs/api/classes/RBACNotInitializedError.md +1 -1
  22. package/docs/api/classes/SecureSupabaseClient.md +1 -1
  23. package/docs/api/classes/StorageUtils.md +1 -1
  24. package/docs/api/interfaces/AggregateConfig.md +1 -1
  25. package/docs/api/interfaces/ButtonProps.md +1 -1
  26. package/docs/api/interfaces/CardProps.md +1 -1
  27. package/docs/api/interfaces/ColorPalette.md +1 -1
  28. package/docs/api/interfaces/ColorShade.md +1 -1
  29. package/docs/api/interfaces/DataAccessRecord.md +1 -1
  30. package/docs/api/interfaces/DataTableAction.md +1 -1
  31. package/docs/api/interfaces/DataTableColumn.md +1 -1
  32. package/docs/api/interfaces/DataTableProps.md +1 -1
  33. package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
  34. package/docs/api/interfaces/EmptyStateConfig.md +1 -1
  35. package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
  36. package/docs/api/interfaces/EventContextType.md +1 -1
  37. package/docs/api/interfaces/EventLogoProps.md +1 -1
  38. package/docs/api/interfaces/EventProviderProps.md +1 -1
  39. package/docs/api/interfaces/FileSizeLimits.md +1 -1
  40. package/docs/api/interfaces/FileUploadProps.md +1 -1
  41. package/docs/api/interfaces/FooterProps.md +1 -1
  42. package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
  43. package/docs/api/interfaces/InputProps.md +1 -1
  44. package/docs/api/interfaces/LabelProps.md +1 -1
  45. package/docs/api/interfaces/LoginFormProps.md +1 -1
  46. package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
  47. package/docs/api/interfaces/NavigationContextType.md +1 -1
  48. package/docs/api/interfaces/NavigationGuardProps.md +1 -1
  49. package/docs/api/interfaces/NavigationItem.md +1 -1
  50. package/docs/api/interfaces/NavigationMenuProps.md +1 -1
  51. package/docs/api/interfaces/NavigationProviderProps.md +1 -1
  52. package/docs/api/interfaces/Organisation.md +1 -1
  53. package/docs/api/interfaces/OrganisationContextType.md +1 -1
  54. package/docs/api/interfaces/OrganisationMembership.md +1 -1
  55. package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
  56. package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
  57. package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
  58. package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
  59. package/docs/api/interfaces/PageAccessRecord.md +1 -1
  60. package/docs/api/interfaces/PagePermissionContextType.md +1 -1
  61. package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
  62. package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
  63. package/docs/api/interfaces/PaletteData.md +1 -1
  64. package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
  65. package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
  66. package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
  67. package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
  68. package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
  69. package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
  70. package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
  71. package/docs/api/interfaces/RBACConfig.md +1 -1
  72. package/docs/api/interfaces/RBACContextType.md +1 -1
  73. package/docs/api/interfaces/RBACLogger.md +1 -1
  74. package/docs/api/interfaces/RBACProviderProps.md +1 -1
  75. package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
  76. package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
  77. package/docs/api/interfaces/RouteAccessRecord.md +1 -1
  78. package/docs/api/interfaces/RouteConfig.md +1 -1
  79. package/docs/api/interfaces/SecureDataContextType.md +1 -1
  80. package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
  81. package/docs/api/interfaces/StorageConfig.md +1 -1
  82. package/docs/api/interfaces/StorageFileInfo.md +1 -1
  83. package/docs/api/interfaces/StorageFileMetadata.md +1 -1
  84. package/docs/api/interfaces/StorageListOptions.md +1 -1
  85. package/docs/api/interfaces/StorageListResult.md +1 -1
  86. package/docs/api/interfaces/StorageUploadOptions.md +1 -1
  87. package/docs/api/interfaces/StorageUploadResult.md +1 -1
  88. package/docs/api/interfaces/StorageUrlOptions.md +1 -1
  89. package/docs/api/interfaces/StyleImport.md +1 -1
  90. package/docs/api/interfaces/SwitchProps.md +34 -0
  91. package/docs/api/interfaces/ToastActionElement.md +1 -1
  92. package/docs/api/interfaces/ToastProps.md +1 -1
  93. package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
  94. package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
  95. package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
  96. package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
  97. package/docs/api/interfaces/UsePublicEventLogoOptions.md +1 -1
  98. package/docs/api/interfaces/UsePublicEventLogoReturn.md +1 -1
  99. package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
  100. package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
  101. package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
  102. package/docs/api/interfaces/UserEventAccess.md +1 -1
  103. package/docs/api/interfaces/UserMenuProps.md +1 -1
  104. package/docs/api/interfaces/UserProfile.md +1 -1
  105. package/docs/api/modules.md +36 -2
  106. package/package.json +2 -1
  107. package/src/components/Switch/Switch.test.tsx +438 -0
  108. package/src/components/Switch/Switch.tsx +140 -0
  109. package/src/components/Switch/index.ts +9 -0
  110. package/src/components/index.ts +2 -0
  111. package/src/index.ts +2 -0
  112. package/dist/chunk-PSE2XO4L.js.map +0 -1
@@ -3,6 +3,7 @@ import React__default, { Component, ReactNode, ErrorInfo } from 'react';
3
3
  import * as LabelPrimitive from '@radix-ui/react-label';
4
4
  import * as AvatarPrimitive from '@radix-ui/react-avatar';
5
5
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
6
+ import * as SwitchPrimitive from '@radix-ui/react-switch';
6
7
  import * as ProgressPrimitive from '@radix-ui/react-progress';
7
8
  import * as react_jsx_runtime from 'react/jsx-runtime';
8
9
  import * as DialogPrimitive from '@radix-ui/react-dialog';
@@ -468,6 +469,98 @@ declare const AvatarFallback: React.ForwardRefExoticComponent<Omit<AvatarPrimiti
468
469
 
469
470
  declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
470
471
 
472
+ /**
473
+ * @file Switch Component
474
+ * @package @jmruthers/pace-core
475
+ * @module Components/Switch
476
+ * @since 0.5.67
477
+ *
478
+ * A toggle switch component built on Radix UI primitives.
479
+ * Provides an accessible, keyboard-navigable switch for boolean states.
480
+ *
481
+ * Features:
482
+ * - WCAG 2.1 AA compliant
483
+ * - Keyboard navigation (Space/Enter)
484
+ * - Focus visible indicators
485
+ * - Disabled state support
486
+ * - Smooth animations
487
+ * - Tailwind v4 compatible
488
+ * - Theme-aware colors
489
+ *
490
+ * @example
491
+ * ```tsx
492
+ * import { Switch } from '@jmruthers/pace-core';
493
+ *
494
+ * function Example() {
495
+ * const [checked, setChecked] = React.useState(false);
496
+ *
497
+ * return (
498
+ * <div className="flex items-center gap-2">
499
+ * <Switch
500
+ * checked={checked}
501
+ * onCheckedChange={setChecked}
502
+ * id="notifications"
503
+ * />
504
+ * <label htmlFor="notifications">
505
+ * Enable notifications
506
+ * </label>
507
+ * </div>
508
+ * );
509
+ * }
510
+ * ```
511
+ *
512
+ * @example With Form
513
+ * ```tsx
514
+ * import { Switch, Label } from '@jmruthers/pace-core';
515
+ *
516
+ * function FormExample() {
517
+ * return (
518
+ * <div className="flex items-center gap-2">
519
+ * <Switch id="terms" />
520
+ * <Label htmlFor="terms">
521
+ * I agree to the terms and conditions
522
+ * </Label>
523
+ * </div>
524
+ * );
525
+ * }
526
+ * ```
527
+ *
528
+ * @example Disabled State
529
+ * ```tsx
530
+ * <Switch disabled checked />
531
+ * ```
532
+ *
533
+ * @accessibility
534
+ * - Uses Radix UI's accessible switch primitive
535
+ * - Proper keyboard navigation (Space to toggle)
536
+ * - Screen reader announcements for state changes
537
+ * - Focus visible styles for keyboard users
538
+ * - ARIA attributes handled automatically
539
+ */
540
+
541
+ /**
542
+ * Switch component props
543
+ * Extends all props from Radix UI Switch.Root
544
+ */
545
+ interface SwitchProps extends React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root> {
546
+ /**
547
+ * Additional CSS classes to apply to the switch
548
+ */
549
+ className?: string;
550
+ }
551
+ /**
552
+ * Switch component
553
+ *
554
+ * A toggle switch for boolean states. Built on Radix UI for accessibility.
555
+ *
556
+ * @component
557
+ * @example
558
+ * ```tsx
559
+ * <Switch checked={isEnabled} onCheckedChange={setIsEnabled} />
560
+ * ```
561
+ */
562
+ declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLButtonElement>>;
563
+
471
564
  /**
472
565
  * @file Progress Component
473
566
  * @package @jmruthers/pace-core
@@ -3384,4 +3477,4 @@ declare function PublicLoadingSkeleton({ lines, className }: {
3384
3477
  className?: string;
3385
3478
  }): react_jsx_runtime.JSX.Element;
3386
3479
 
3387
- export { ToastViewport as $, Alert as A, Button as B, Card as C, Dialog as D, DialogContent as E, type FileSizeLimits as F, DialogHeader as G, DialogBody as H, Input as I, DialogFooter as J, DialogTitle as K, Label as L, DialogDescription as M, Select as N, SelectGroup as O, Progress as P, SelectValue as Q, SelectTrigger as R, type StorageConfig as S, SelectContent as T, SelectLabel as U, SelectItem as V, SelectSeparator as W, Toast as X, Toaster as Y, ToastAction as Z, ToastProvider as _, type StorageUploadOptions as a, type EventLogoProps as a$, ToastTitle as a0, ToastDescription as a1, ToastClose as a2, type ToastActionElement as a3, type ToastProps as a4, Tooltip as a5, TooltipTrigger as a6, TooltipContent as a7, TooltipProvider as a8, TooltipRoot as a9, TableCell as aA, TableFooter as aB, TableHead as aC, TableRow as aD, type StorageFileInfo as aE, PublicPageLayout as aF, usePublicPageContext$1 as aG, PublicPageHeader as aH, PublicPageProvider as aI, usePublicPageContext as aJ, useIsPublicPage as aK, PublicPageFooter as aL, PublicPageDebugger as aM, PublicPageDiagnostic as aN, PublicPageContextChecker as aO, EventLogo as aP, EventLogoCompact as aQ, EventLogoLarge as aR, PublicErrorBoundary as aS, useErrorBoundary as aT, DefaultPublicErrorFallback as aU, PublicLoadingSpinner as aV, PublicLoadingSpinnerFullPage as aW, PublicLoadingSkeleton as aX, type PublicPageLayoutProps as aY, type PublicPageHeaderProps as aZ, type PublicPageFooterProps as a_, Form as aa, LoginForm as ab, type LoginFormProps as ac, Header as ad, Footer as ae, type FooterProps as af, NavigationMenu as ag, type NavigationMenuProps as ah, type NavigationItem as ai, UserMenu as aj, type UserMenuProps as ak, PaceAppLayout as al, type PaceAppLayoutProps as am, PaceLoginPage as an, type PaceLoginPageProps as ao, ErrorBoundary as ap, LoadingSpinner as aq, EventSelector as ar, OrganisationSelector as as, PasswordResetForm as at, useStorage as au, useFileUpload as av, Table as aw, TableHeader as ax, TableBody as ay, TableCaption as az, type StorageFileMetadata as b, type PublicErrorBoundaryProps as b0, type PublicErrorBoundaryState as b1, type PublicLoadingSpinnerProps as b2, type CardActionsProps as b3, type DialogProps as b4, type DialogTriggerProps as b5, type DialogContentProps as b6, type DialogOverlayProps as b7, type DialogHeaderProps as b8, type DialogFooterProps as b9, type DialogTitleProps as ba, type DialogDescriptionProps as bb, type DialogSize as bc, type FormProps as bd, type OrganisationSelectorProps as be, type ErrorBoundaryProps as bf, type ErrorBoundaryState as bg, type UseStorageOptions as bh, type UseStorageReturn as bi, type StorageUploadResult as c, type StorageUrlOptions as d, type StorageListOptions as e, type StorageListResult as f, type ButtonProps as g, CardHeader as h, CardFooter as i, CardTitle as j, CardDescription as k, CardContent as l, CardActions as m, type CardProps as n, type InputProps as o, type LabelProps as p, AlertTitle as q, AlertDescription as r, Avatar as s, AvatarImage as t, AvatarFallback as u, Checkbox as v, DialogPortal as w, DialogOverlay as x, DialogTrigger as y, DialogClose as z };
3480
+ export { ToastAction as $, Alert as A, Button as B, Card as C, Dialog as D, DialogTrigger as E, type FileSizeLimits as F, DialogClose as G, DialogContent as H, Input as I, DialogHeader as J, DialogBody as K, Label as L, DialogFooter as M, DialogTitle as N, DialogDescription as O, Progress as P, Select as Q, SelectGroup as R, type StorageConfig as S, SelectValue as T, SelectTrigger as U, SelectContent as V, SelectLabel as W, SelectItem as X, SelectSeparator as Y, Toast as Z, Toaster as _, type StorageUploadOptions as a, type PublicPageHeaderProps as a$, ToastProvider as a0, ToastViewport as a1, ToastTitle as a2, ToastDescription as a3, ToastClose as a4, type ToastActionElement as a5, type ToastProps as a6, Tooltip as a7, TooltipTrigger as a8, TooltipContent as a9, TableBody as aA, TableCaption as aB, TableCell as aC, TableFooter as aD, TableHead as aE, TableRow as aF, type StorageFileInfo as aG, PublicPageLayout as aH, usePublicPageContext$1 as aI, PublicPageHeader as aJ, PublicPageProvider as aK, usePublicPageContext as aL, useIsPublicPage as aM, PublicPageFooter as aN, PublicPageDebugger as aO, PublicPageDiagnostic as aP, PublicPageContextChecker as aQ, EventLogo as aR, EventLogoCompact as aS, EventLogoLarge as aT, PublicErrorBoundary as aU, useErrorBoundary as aV, DefaultPublicErrorFallback as aW, PublicLoadingSpinner as aX, PublicLoadingSpinnerFullPage as aY, PublicLoadingSkeleton as aZ, type PublicPageLayoutProps as a_, TooltipProvider as aa, TooltipRoot as ab, Form as ac, LoginForm as ad, type LoginFormProps as ae, Header as af, Footer as ag, type FooterProps as ah, NavigationMenu as ai, type NavigationMenuProps as aj, type NavigationItem as ak, UserMenu as al, type UserMenuProps as am, PaceAppLayout as an, type PaceAppLayoutProps as ao, PaceLoginPage as ap, type PaceLoginPageProps as aq, ErrorBoundary as ar, LoadingSpinner as as, EventSelector as at, OrganisationSelector as au, PasswordResetForm as av, useStorage as aw, useFileUpload as ax, Table as ay, TableHeader as az, type StorageFileMetadata as b, type PublicPageFooterProps as b0, type EventLogoProps as b1, type PublicErrorBoundaryProps as b2, type PublicErrorBoundaryState as b3, type PublicLoadingSpinnerProps as b4, type CardActionsProps as b5, type DialogProps as b6, type DialogTriggerProps as b7, type DialogContentProps as b8, type DialogOverlayProps as b9, type DialogHeaderProps as ba, type DialogFooterProps as bb, type DialogTitleProps as bc, type DialogDescriptionProps as bd, type DialogSize as be, type FormProps as bf, type OrganisationSelectorProps as bg, type ErrorBoundaryProps as bh, type ErrorBoundaryState as bi, type UseStorageOptions as bj, type UseStorageReturn as bk, type StorageUploadResult as c, type StorageUrlOptions as d, type StorageListOptions as e, type StorageListResult as f, type ButtonProps as g, CardHeader as h, CardFooter as i, CardTitle as j, CardDescription as k, CardContent as l, CardActions as m, type CardProps as n, type InputProps as o, type LabelProps as p, AlertTitle as q, AlertDescription as r, Avatar as s, AvatarImage as t, AvatarFallback as u, Checkbox as v, Switch as w, type SwitchProps as x, DialogPortal as y, DialogOverlay as z };