@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.
- package/dist/{PublicLoadingSpinner-CXJ-W9wZ.d.ts → PublicLoadingSpinner-DdKXTkCZ.d.ts} +94 -1
- package/dist/{chunk-PSE2XO4L.js → chunk-ZB6AEA7I.js} +308 -260
- package/dist/chunk-ZB6AEA7I.js.map +1 -0
- package/dist/components.d.ts +2 -1
- package/dist/components.js +3 -1
- package/dist/components.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- 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/interfaces/AggregateConfig.md +1 -1
- package/docs/api/interfaces/ButtonProps.md +1 -1
- 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/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/EventContextType.md +1 -1
- package/docs/api/interfaces/EventLogoProps.md +1 -1
- package/docs/api/interfaces/EventProviderProps.md +1 -1
- package/docs/api/interfaces/FileSizeLimits.md +1 -1
- package/docs/api/interfaces/FileUploadProps.md +1 -1
- package/docs/api/interfaces/FooterProps.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/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/RBACContextType.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/RBACProviderProps.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterProps.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/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 +34 -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/UsePublicEventLogoOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventLogoReturn.md +1 -1
- package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
- package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
- 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 +36 -2
- package/package.json +2 -1
- package/src/components/Switch/Switch.test.tsx +438 -0
- package/src/components/Switch/Switch.tsx +140 -0
- package/src/components/Switch/index.ts +9 -0
- package/src/components/index.ts +2 -0
- package/src/index.ts +2 -0
- 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 {
|
|
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 };
|