accessibility-plugin-react 2.3.2 → 2.4.0

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 CHANGED
@@ -88,23 +88,24 @@ export function App() {
88
88
  Every controller is opt-in. Add only the controls that make sense for your
89
89
  site, and choose their order in JSX.
90
90
 
91
- | Controller | Effect |
92
- | ------------------------- | --------------------------------------------------------------------------------- |
93
- | `FontSizeController` | Scales eligible HTML text from 50% to 200%. |
94
- | `LineHeightController` | Scales computed line height from 50% to 200%. |
95
- | `LetterSpacingController` | Applies 0–10px letter spacing. |
96
- | `ContrastController` | Turns contrast off, reduces it, increases it, or selects a named palette. |
97
- | `SaturationController` | Reduces or increases saturation. |
98
- | `InvertColorsController` | Inverts eligible page content. |
99
- | `GrayscaleController` | Removes color while preserving the selected saturation value for later. |
100
- | `LinkHighlightController` | Highlights links or selects a link palette. |
101
- | `TextAlignController` | Restores the host alignment or forces left, center, right, or justified text. |
102
- | `HideImagesController` | Hides images and CSS background images while retaining layout. |
103
- | `HideVideosController` | Hides video elements and recognized YouTube/Vimeo embeds visually. |
104
- | `BigCursorController` | Applies a larger high-contrast cursor where supported. |
105
- | `ReadingMaskController` | Dims the page around a transparent reading window. |
106
- | `ReadingGuideController` | Follows pointer/focus with a reading guide line. |
107
- | `ResetController` | Resets display features and custom registered features without moving the widget. |
91
+ | Controller | Effect |
92
+ | ------------------------- | ---------------------------------------------------------------------------------------------------------- |
93
+ | `TextScaleController` | Stepwise reflow-safe text enlargement (1.0x, 1.125x, 1.25x, 1.5x, 2.0x) protecting forms, code, and icons. |
94
+ | `FontSizeController` | Scales eligible HTML text from 50% to 200%; supports continuous 10% steps or `stepScale` mode. |
95
+ | `LineHeightController` | Scales computed line height from 50% to 200%. |
96
+ | `LetterSpacingController` | Applies 0–10px letter spacing. |
97
+ | `ContrastController` | Turns contrast off, reduces it, increases it, or selects a named palette. |
98
+ | `SaturationController` | Reduces or increases saturation. |
99
+ | `InvertColorsController` | Inverts eligible page content. |
100
+ | `GrayscaleController` | Removes color while preserving the selected saturation value for later. |
101
+ | `LinkHighlightController` | Highlights links or selects a link palette. |
102
+ | `TextAlignController` | Restores the host alignment or forces left, center, right, or justified text. |
103
+ | `HideImagesController` | Hides images and CSS background images while retaining layout. |
104
+ | `HideVideosController` | Hides video elements and recognized YouTube/Vimeo embeds visually. |
105
+ | `BigCursorController` | Applies a larger high-contrast cursor where supported. |
106
+ | `ReadingMaskController` | Dims the page around a transparent reading window. |
107
+ | `ReadingGuideController` | Follows pointer/focus with a reading guide line. |
108
+ | `ResetController` | Resets display features and custom registered features without moving the widget. |
108
109
 
109
110
  Effects compose where appropriate. For example, contrast, saturation, invert,
110
111
  and grayscale are applied in a deterministic order. Defaults leave host styles
package/dist/index.d.mts CHANGED
@@ -331,7 +331,39 @@ declare function useAccessibility<T>(featureKey: string, defaultValue: T, option
331
331
 
332
332
  declare const AccessibilityContext: react.Context<AccessibilityContextValue | null>;
333
333
 
334
- declare function FontSizeController(): react.JSX.Element;
334
+ interface FontSizeControllerProps {
335
+ /**
336
+ * Optional custom scale steps (percentages or factors, e.g. [100, 112.5, 125, 150, 200] or [1.0, 1.125, 1.25, 1.5, 2.0]).
337
+ * If provided, the stepper snaps to the nearest configured step.
338
+ */
339
+ steps?: readonly number[];
340
+ /**
341
+ * Optional step scale mode: when true, snaps to standard WCAG reflow steps: 100%, 112.5%, 125%, 150%, 200%.
342
+ */
343
+ stepScale?: boolean;
344
+ }
345
+ declare function FontSizeController({ steps: customSteps, stepScale, }?: FontSizeControllerProps): react.JSX.Element;
346
+
347
+ interface TextScaleControllerProps {
348
+ /**
349
+ * Custom scale factor steps. Default: [1.0, 1.125, 1.25, 1.5, 2.0].
350
+ */
351
+ steps?: readonly number[];
352
+ /**
353
+ * Accessible group label and visible title. Default: "Bigger Text".
354
+ */
355
+ label?: string;
356
+ }
357
+ declare function TextScaleController({ steps, label, }?: TextScaleControllerProps): react.JSX.Element;
358
+
359
+ /**
360
+ * Reflow-safe text scale steps: 1x baseline, 1.125x subtle, 1.25x medium, 1.5x large, 2.0x maximum.
361
+ */
362
+ declare const TEXT_SCALE_STEPS: readonly [1, 1.125, 1.25, 1.5, 2];
363
+ type TextScaleStep = (typeof TEXT_SCALE_STEPS)[number];
364
+
365
+ declare const TEXT_SCALE_PROTECTED_SELECTOR: string;
366
+ declare function isProtectedFromTextScale(element: HTMLElement): boolean;
335
367
 
336
368
  declare function LineHeightController(): react.JSX.Element;
337
369
 
@@ -361,4 +393,4 @@ declare function ReadingGuideController(): react.JSX.Element;
361
393
 
362
394
  declare function ResetController(): react.JSX.Element;
363
395
 
364
- export { AccessibilityButton, type AccessibilityButtonProps, AccessibilityContext, type AccessibilityContextValue, AccessibilityList, type AccessibilityListProps, AccessibilityPlugin, type AccessibilityPluginProps, type AccessibilityPreferences, type AccessibilityState, BigCursorController, ChoiceControl, type ChoiceControlProps, type ChoiceGroup, type ChoiceOption, ContrastController, type ContrastMode, type CursorSizePreference, DEFAULT_PREFERENCES, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, FeatureCard, type FeatureCardProps, type FeatureOptions, type FeatureRegistration, type FeatureStatus, type FontFamilyPreference, FontSizeController, GrayscaleController, HideImagesController, HideVideosController, InvertColorsController, LetterSpacingController, LineHeightController, LinkHighlightController, type LocaleStrings, PROFILE_DEFINITIONS, type PluginPosition, type ProfileDefinition, type ProfilePresetId, ProfilePreviewCard, type ProfilePreviewCardProps, type ReaderMode, ReadingGuideController, ReadingMaskController, ResetController, SaturationController, type SaturationPreference, SearchCount, type SearchCountProps, StepperControl, type StepperControlProps, type StorageMode, type SupportedLocale, TextAlignController, type TextAlignPreference, ToggleControl, type ToggleControlProps, type WidgetPlacement, createInitialPreferencesState, enLocale, isRtlLocale, normalizePreferenceValue, normalizePreferences, preferencesReducer, registerLocale, resolveEffectivePreferences, resolveLocaleStrings, useAccessibility };
396
+ export { AccessibilityButton, type AccessibilityButtonProps, AccessibilityContext, type AccessibilityContextValue, AccessibilityList, type AccessibilityListProps, AccessibilityPlugin, type AccessibilityPluginProps, type AccessibilityPreferences, type AccessibilityState, BigCursorController, ChoiceControl, type ChoiceControlProps, type ChoiceGroup, type ChoiceOption, ContrastController, type ContrastMode, type CursorSizePreference, DEFAULT_PREFERENCES, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, FeatureCard, type FeatureCardProps, type FeatureOptions, type FeatureRegistration, type FeatureStatus, type FontFamilyPreference, FontSizeController, type FontSizeControllerProps, GrayscaleController, HideImagesController, HideVideosController, InvertColorsController, LetterSpacingController, LineHeightController, LinkHighlightController, type LocaleStrings, PROFILE_DEFINITIONS, type PluginPosition, type ProfileDefinition, type ProfilePresetId, ProfilePreviewCard, type ProfilePreviewCardProps, type ReaderMode, ReadingGuideController, ReadingMaskController, ResetController, SaturationController, type SaturationPreference, SearchCount, type SearchCountProps, StepperControl, type StepperControlProps, type StorageMode, type SupportedLocale, TEXT_SCALE_PROTECTED_SELECTOR, TEXT_SCALE_STEPS, TextAlignController, type TextAlignPreference, TextScaleController, type TextScaleControllerProps, type TextScaleStep, ToggleControl, type ToggleControlProps, type WidgetPlacement, createInitialPreferencesState, enLocale, isProtectedFromTextScale, isRtlLocale, normalizePreferenceValue, normalizePreferences, preferencesReducer, registerLocale, resolveEffectivePreferences, resolveLocaleStrings, useAccessibility };
package/dist/index.d.ts CHANGED
@@ -331,7 +331,39 @@ declare function useAccessibility<T>(featureKey: string, defaultValue: T, option
331
331
 
332
332
  declare const AccessibilityContext: react.Context<AccessibilityContextValue | null>;
333
333
 
334
- declare function FontSizeController(): react.JSX.Element;
334
+ interface FontSizeControllerProps {
335
+ /**
336
+ * Optional custom scale steps (percentages or factors, e.g. [100, 112.5, 125, 150, 200] or [1.0, 1.125, 1.25, 1.5, 2.0]).
337
+ * If provided, the stepper snaps to the nearest configured step.
338
+ */
339
+ steps?: readonly number[];
340
+ /**
341
+ * Optional step scale mode: when true, snaps to standard WCAG reflow steps: 100%, 112.5%, 125%, 150%, 200%.
342
+ */
343
+ stepScale?: boolean;
344
+ }
345
+ declare function FontSizeController({ steps: customSteps, stepScale, }?: FontSizeControllerProps): react.JSX.Element;
346
+
347
+ interface TextScaleControllerProps {
348
+ /**
349
+ * Custom scale factor steps. Default: [1.0, 1.125, 1.25, 1.5, 2.0].
350
+ */
351
+ steps?: readonly number[];
352
+ /**
353
+ * Accessible group label and visible title. Default: "Bigger Text".
354
+ */
355
+ label?: string;
356
+ }
357
+ declare function TextScaleController({ steps, label, }?: TextScaleControllerProps): react.JSX.Element;
358
+
359
+ /**
360
+ * Reflow-safe text scale steps: 1x baseline, 1.125x subtle, 1.25x medium, 1.5x large, 2.0x maximum.
361
+ */
362
+ declare const TEXT_SCALE_STEPS: readonly [1, 1.125, 1.25, 1.5, 2];
363
+ type TextScaleStep = (typeof TEXT_SCALE_STEPS)[number];
364
+
365
+ declare const TEXT_SCALE_PROTECTED_SELECTOR: string;
366
+ declare function isProtectedFromTextScale(element: HTMLElement): boolean;
335
367
 
336
368
  declare function LineHeightController(): react.JSX.Element;
337
369
 
@@ -361,4 +393,4 @@ declare function ReadingGuideController(): react.JSX.Element;
361
393
 
362
394
  declare function ResetController(): react.JSX.Element;
363
395
 
364
- export { AccessibilityButton, type AccessibilityButtonProps, AccessibilityContext, type AccessibilityContextValue, AccessibilityList, type AccessibilityListProps, AccessibilityPlugin, type AccessibilityPluginProps, type AccessibilityPreferences, type AccessibilityState, BigCursorController, ChoiceControl, type ChoiceControlProps, type ChoiceGroup, type ChoiceOption, ContrastController, type ContrastMode, type CursorSizePreference, DEFAULT_PREFERENCES, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, FeatureCard, type FeatureCardProps, type FeatureOptions, type FeatureRegistration, type FeatureStatus, type FontFamilyPreference, FontSizeController, GrayscaleController, HideImagesController, HideVideosController, InvertColorsController, LetterSpacingController, LineHeightController, LinkHighlightController, type LocaleStrings, PROFILE_DEFINITIONS, type PluginPosition, type ProfileDefinition, type ProfilePresetId, ProfilePreviewCard, type ProfilePreviewCardProps, type ReaderMode, ReadingGuideController, ReadingMaskController, ResetController, SaturationController, type SaturationPreference, SearchCount, type SearchCountProps, StepperControl, type StepperControlProps, type StorageMode, type SupportedLocale, TextAlignController, type TextAlignPreference, ToggleControl, type ToggleControlProps, type WidgetPlacement, createInitialPreferencesState, enLocale, isRtlLocale, normalizePreferenceValue, normalizePreferences, preferencesReducer, registerLocale, resolveEffectivePreferences, resolveLocaleStrings, useAccessibility };
396
+ export { AccessibilityButton, type AccessibilityButtonProps, AccessibilityContext, type AccessibilityContextValue, AccessibilityList, type AccessibilityListProps, AccessibilityPlugin, type AccessibilityPluginProps, type AccessibilityPreferences, type AccessibilityState, BigCursorController, ChoiceControl, type ChoiceControlProps, type ChoiceGroup, type ChoiceOption, ContrastController, type ContrastMode, type CursorSizePreference, DEFAULT_PREFERENCES, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, FeatureCard, type FeatureCardProps, type FeatureOptions, type FeatureRegistration, type FeatureStatus, type FontFamilyPreference, FontSizeController, type FontSizeControllerProps, GrayscaleController, HideImagesController, HideVideosController, InvertColorsController, LetterSpacingController, LineHeightController, LinkHighlightController, type LocaleStrings, PROFILE_DEFINITIONS, type PluginPosition, type ProfileDefinition, type ProfilePresetId, ProfilePreviewCard, type ProfilePreviewCardProps, type ReaderMode, ReadingGuideController, ReadingMaskController, ResetController, SaturationController, type SaturationPreference, SearchCount, type SearchCountProps, StepperControl, type StepperControlProps, type StorageMode, type SupportedLocale, TEXT_SCALE_PROTECTED_SELECTOR, TEXT_SCALE_STEPS, TextAlignController, type TextAlignPreference, TextScaleController, type TextScaleControllerProps, type TextScaleStep, ToggleControl, type ToggleControlProps, type WidgetPlacement, createInitialPreferencesState, enLocale, isProtectedFromTextScale, isRtlLocale, normalizePreferenceValue, normalizePreferences, preferencesReducer, registerLocale, resolveEffectivePreferences, resolveLocaleStrings, useAccessibility };