accessibility-plugin-react 2.12.0 → 2.13.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
@@ -108,6 +108,7 @@ site, and choose their order in JSX.
108
108
  | `BigCursorController` | Applies a 40px high-contrast SVG pointer; capability-aware (requires `(pointer: fine)`). |
109
109
  | `ReadingMaskController` | Adjustable transparent reading window (40–400px, default 100px); pointer-transparent; follows pointer, touch, and focus. |
110
110
  | `ReadingGuideController` | 4px pointer-transparent guide ruler; never blocks clicks/selection; follows pointer, touch, and focus. |
111
+ | `TooltipsController` / `AccessibleTooltipsController` | Accessible tooltips for authored descriptions (`aria-description`, `aria-describedby`, `alt`, etc.) with WCAG 1.4.13. |
111
112
  | `ResetController` | Resets display features and custom registered features without moving the widget. |
112
113
 
113
114
  Effects compose where appropriate. For example, contrast, saturation, invert,
package/dist/index.d.mts CHANGED
@@ -457,6 +457,13 @@ declare function isFunctionalOrMeaningfulImage(el: Element): boolean;
457
457
  */
458
458
  declare function isEligibleDecorativeImage(el: Element): boolean;
459
459
  declare function nudgeReadingAid(feature: "readingGuide" | "readingMask", delta: number): void;
460
+ /**
461
+ * Extracts authored accessible description from an element.
462
+ * Respects author intent, protects private/sensitive fields, and avoids redundant tooltips.
463
+ */
464
+ declare function getAuthoredDescription(element: Element): string | null;
465
+ declare function positionTooltip(tooltip: HTMLElement, target: Element): void;
466
+ declare function enableAccessibleTooltips(): () => void;
460
467
 
461
468
  interface LineHeightControllerProps {
462
469
  /**
@@ -551,6 +558,20 @@ declare const FocusHighlightController: typeof HighlightFocusController;
551
558
  */
552
559
  declare function ReduceMotionController(): react.JSX.Element;
553
560
 
561
+ interface TooltipsControllerProps {
562
+ className?: string;
563
+ label?: string;
564
+ description?: string;
565
+ }
566
+ /**
567
+ * Controller to toggle accessible tooltips for authored descriptions.
568
+ * Displays meaningful alt text, aria-labels, and descriptions on pointer hover and keyboard focus
569
+ * without overwriting semantics, inventing text, or disclosing private fields.
570
+ * Conforms to WCAG 2.1 SC 1.4.13 (Dismissible with Escape, Hoverable, and Persistent).
571
+ */
572
+ declare function TooltipsController({ className, label, description, }: TooltipsControllerProps): react.JSX.Element;
573
+ declare const AccessibleTooltipsController: typeof TooltipsController;
574
+
554
575
  declare function ResetController(): react.JSX.Element;
555
576
 
556
- export { AccessibilityButton, type AccessibilityButtonProps, AccessibilityContext, type AccessibilityContextValue, AccessibilityList, type AccessibilityListProps, AccessibilityPlugin, type AccessibilityPluginProps, type AccessibilityPreferences, type AccessibilityState, BigCursorController, type BigCursorControllerProps, CONTRAST_MODES, CONTRAST_PALETTES, CONTRAST_PROTECTED_SELECTOR, ChoiceControl, type ChoiceControlProps, type ChoiceGroup, type ChoiceOption, ContrastController, type ContrastMode, ContrastModeController, type ContrastModeValue, type ContrastPalette, type CursorSizePreference, DEFAULT_PREFERENCES, DEFAULT_READING_MASK_HEIGHT, DYSLEXIA_FONT_STACK, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, FONT_FAMILY_PRESETS, FONT_FAMILY_PROTECTED_SELECTOR, FeatureCard, type FeatureCardProps, type FeatureOptions, type FeatureRegistration, type FeatureStatus, FocusHighlightController, FontFamilyController, type FontFamilyPreference, type FontFamilyPreset, FontSizeController, type FontSizeControllerProps, GrayscaleController, HideDecorativeImagesController, HideImagesController, type HideImagesControllerProps, HideVideosController, HighlightFocusController, InvertColorsController, LEGIBLE_FONT_STACK, LINE_HEIGHT_RATIOS, LINE_HEIGHT_STEPS, LetterSpacingController, type LetterSpacingControllerProps, LineHeightController, type LineHeightControllerProps, LinkHighlightController, type LocaleStrings, MAX_READING_MASK_HEIGHT, MIN_READING_MASK_HEIGHT, PROFILE_DEFINITIONS, ParagraphSpacingController, type ParagraphSpacingControllerProps, type PluginPosition, type ProfileDefinition, type ProfilePresetId, ProfilePreviewCard, type ProfilePreviewCardProps, READING_MASK_HEIGHT_PRESETS, type ReaderMode, ReadingGuideController, type ReadingGuideControllerProps, ReadingMaskController, type ReadingMaskControllerProps, ReduceMotionController, ResetController, SaturationController, type SaturationPreference, type ScriptSpacingConstraints, SearchCount, type SearchCountProps, SkipToMainLink, type SkipToMainLinkProps, StepperControl, type StepperControlProps, type StorageMode, type SupportedLocale, TEXT_ALIGN_BLOCK_SELECTOR, TEXT_SCALE_PROTECTED_SELECTOR, TEXT_SCALE_STEPS, TEXT_SPACING_EXCLUDED_SELECTOR, TextAlignController, type TextAlignPreference, TextScaleController, type TextScaleControllerProps, type TextScaleStep, ToggleControl, type ToggleControlProps, type WidgetPlacement, WordSpacingController, type WordSpacingControllerProps, createInitialPreferencesState, enLocale, findMainLandmark, getScriptSpacingConstraints, hasFinePointer, isEligibleDecorativeImage, isForcedColorsActive, isFunctionalOrMeaningfulImage, isProtectedFromContrast, isProtectedFromFontFamily, isProtectedFromTextAlign, isProtectedFromTextScale, isProtectedFromTextSpacing, isReducedMotionActive, isRtlLocale, normalizePreferenceValue, normalizePreferences, nudgeReadingAid, preferencesReducer, registerLocale, resolveEffectivePreferences, resolveLocaleStrings, subscribeFinePointer, subscribeForcedColors, subscribeReducedMotion, useAccessibility };
577
+ export { AccessibilityButton, type AccessibilityButtonProps, AccessibilityContext, type AccessibilityContextValue, AccessibilityList, type AccessibilityListProps, AccessibilityPlugin, type AccessibilityPluginProps, type AccessibilityPreferences, type AccessibilityState, AccessibleTooltipsController, BigCursorController, type BigCursorControllerProps, CONTRAST_MODES, CONTRAST_PALETTES, CONTRAST_PROTECTED_SELECTOR, ChoiceControl, type ChoiceControlProps, type ChoiceGroup, type ChoiceOption, ContrastController, type ContrastMode, ContrastModeController, type ContrastModeValue, type ContrastPalette, type CursorSizePreference, DEFAULT_PREFERENCES, DEFAULT_READING_MASK_HEIGHT, DYSLEXIA_FONT_STACK, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, FONT_FAMILY_PRESETS, FONT_FAMILY_PROTECTED_SELECTOR, FeatureCard, type FeatureCardProps, type FeatureOptions, type FeatureRegistration, type FeatureStatus, FocusHighlightController, FontFamilyController, type FontFamilyPreference, type FontFamilyPreset, FontSizeController, type FontSizeControllerProps, GrayscaleController, HideDecorativeImagesController, HideImagesController, type HideImagesControllerProps, HideVideosController, HighlightFocusController, InvertColorsController, LEGIBLE_FONT_STACK, LINE_HEIGHT_RATIOS, LINE_HEIGHT_STEPS, LetterSpacingController, type LetterSpacingControllerProps, LineHeightController, type LineHeightControllerProps, LinkHighlightController, type LocaleStrings, MAX_READING_MASK_HEIGHT, MIN_READING_MASK_HEIGHT, PROFILE_DEFINITIONS, ParagraphSpacingController, type ParagraphSpacingControllerProps, type PluginPosition, type ProfileDefinition, type ProfilePresetId, ProfilePreviewCard, type ProfilePreviewCardProps, READING_MASK_HEIGHT_PRESETS, type ReaderMode, ReadingGuideController, type ReadingGuideControllerProps, ReadingMaskController, type ReadingMaskControllerProps, ReduceMotionController, ResetController, SaturationController, type SaturationPreference, type ScriptSpacingConstraints, SearchCount, type SearchCountProps, SkipToMainLink, type SkipToMainLinkProps, StepperControl, type StepperControlProps, type StorageMode, type SupportedLocale, TEXT_ALIGN_BLOCK_SELECTOR, TEXT_SCALE_PROTECTED_SELECTOR, TEXT_SCALE_STEPS, TEXT_SPACING_EXCLUDED_SELECTOR, TextAlignController, type TextAlignPreference, TextScaleController, type TextScaleControllerProps, type TextScaleStep, ToggleControl, type ToggleControlProps, TooltipsController, type TooltipsControllerProps, type WidgetPlacement, WordSpacingController, type WordSpacingControllerProps, createInitialPreferencesState, enLocale, enableAccessibleTooltips, findMainLandmark, getAuthoredDescription, getScriptSpacingConstraints, hasFinePointer, isEligibleDecorativeImage, isForcedColorsActive, isFunctionalOrMeaningfulImage, isProtectedFromContrast, isProtectedFromFontFamily, isProtectedFromTextAlign, isProtectedFromTextScale, isProtectedFromTextSpacing, isReducedMotionActive, isRtlLocale, normalizePreferenceValue, normalizePreferences, nudgeReadingAid, positionTooltip, preferencesReducer, registerLocale, resolveEffectivePreferences, resolveLocaleStrings, subscribeFinePointer, subscribeForcedColors, subscribeReducedMotion, useAccessibility };
package/dist/index.d.ts CHANGED
@@ -457,6 +457,13 @@ declare function isFunctionalOrMeaningfulImage(el: Element): boolean;
457
457
  */
458
458
  declare function isEligibleDecorativeImage(el: Element): boolean;
459
459
  declare function nudgeReadingAid(feature: "readingGuide" | "readingMask", delta: number): void;
460
+ /**
461
+ * Extracts authored accessible description from an element.
462
+ * Respects author intent, protects private/sensitive fields, and avoids redundant tooltips.
463
+ */
464
+ declare function getAuthoredDescription(element: Element): string | null;
465
+ declare function positionTooltip(tooltip: HTMLElement, target: Element): void;
466
+ declare function enableAccessibleTooltips(): () => void;
460
467
 
461
468
  interface LineHeightControllerProps {
462
469
  /**
@@ -551,6 +558,20 @@ declare const FocusHighlightController: typeof HighlightFocusController;
551
558
  */
552
559
  declare function ReduceMotionController(): react.JSX.Element;
553
560
 
561
+ interface TooltipsControllerProps {
562
+ className?: string;
563
+ label?: string;
564
+ description?: string;
565
+ }
566
+ /**
567
+ * Controller to toggle accessible tooltips for authored descriptions.
568
+ * Displays meaningful alt text, aria-labels, and descriptions on pointer hover and keyboard focus
569
+ * without overwriting semantics, inventing text, or disclosing private fields.
570
+ * Conforms to WCAG 2.1 SC 1.4.13 (Dismissible with Escape, Hoverable, and Persistent).
571
+ */
572
+ declare function TooltipsController({ className, label, description, }: TooltipsControllerProps): react.JSX.Element;
573
+ declare const AccessibleTooltipsController: typeof TooltipsController;
574
+
554
575
  declare function ResetController(): react.JSX.Element;
555
576
 
556
- export { AccessibilityButton, type AccessibilityButtonProps, AccessibilityContext, type AccessibilityContextValue, AccessibilityList, type AccessibilityListProps, AccessibilityPlugin, type AccessibilityPluginProps, type AccessibilityPreferences, type AccessibilityState, BigCursorController, type BigCursorControllerProps, CONTRAST_MODES, CONTRAST_PALETTES, CONTRAST_PROTECTED_SELECTOR, ChoiceControl, type ChoiceControlProps, type ChoiceGroup, type ChoiceOption, ContrastController, type ContrastMode, ContrastModeController, type ContrastModeValue, type ContrastPalette, type CursorSizePreference, DEFAULT_PREFERENCES, DEFAULT_READING_MASK_HEIGHT, DYSLEXIA_FONT_STACK, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, FONT_FAMILY_PRESETS, FONT_FAMILY_PROTECTED_SELECTOR, FeatureCard, type FeatureCardProps, type FeatureOptions, type FeatureRegistration, type FeatureStatus, FocusHighlightController, FontFamilyController, type FontFamilyPreference, type FontFamilyPreset, FontSizeController, type FontSizeControllerProps, GrayscaleController, HideDecorativeImagesController, HideImagesController, type HideImagesControllerProps, HideVideosController, HighlightFocusController, InvertColorsController, LEGIBLE_FONT_STACK, LINE_HEIGHT_RATIOS, LINE_HEIGHT_STEPS, LetterSpacingController, type LetterSpacingControllerProps, LineHeightController, type LineHeightControllerProps, LinkHighlightController, type LocaleStrings, MAX_READING_MASK_HEIGHT, MIN_READING_MASK_HEIGHT, PROFILE_DEFINITIONS, ParagraphSpacingController, type ParagraphSpacingControllerProps, type PluginPosition, type ProfileDefinition, type ProfilePresetId, ProfilePreviewCard, type ProfilePreviewCardProps, READING_MASK_HEIGHT_PRESETS, type ReaderMode, ReadingGuideController, type ReadingGuideControllerProps, ReadingMaskController, type ReadingMaskControllerProps, ReduceMotionController, ResetController, SaturationController, type SaturationPreference, type ScriptSpacingConstraints, SearchCount, type SearchCountProps, SkipToMainLink, type SkipToMainLinkProps, StepperControl, type StepperControlProps, type StorageMode, type SupportedLocale, TEXT_ALIGN_BLOCK_SELECTOR, TEXT_SCALE_PROTECTED_SELECTOR, TEXT_SCALE_STEPS, TEXT_SPACING_EXCLUDED_SELECTOR, TextAlignController, type TextAlignPreference, TextScaleController, type TextScaleControllerProps, type TextScaleStep, ToggleControl, type ToggleControlProps, type WidgetPlacement, WordSpacingController, type WordSpacingControllerProps, createInitialPreferencesState, enLocale, findMainLandmark, getScriptSpacingConstraints, hasFinePointer, isEligibleDecorativeImage, isForcedColorsActive, isFunctionalOrMeaningfulImage, isProtectedFromContrast, isProtectedFromFontFamily, isProtectedFromTextAlign, isProtectedFromTextScale, isProtectedFromTextSpacing, isReducedMotionActive, isRtlLocale, normalizePreferenceValue, normalizePreferences, nudgeReadingAid, preferencesReducer, registerLocale, resolveEffectivePreferences, resolveLocaleStrings, subscribeFinePointer, subscribeForcedColors, subscribeReducedMotion, useAccessibility };
577
+ export { AccessibilityButton, type AccessibilityButtonProps, AccessibilityContext, type AccessibilityContextValue, AccessibilityList, type AccessibilityListProps, AccessibilityPlugin, type AccessibilityPluginProps, type AccessibilityPreferences, type AccessibilityState, AccessibleTooltipsController, BigCursorController, type BigCursorControllerProps, CONTRAST_MODES, CONTRAST_PALETTES, CONTRAST_PROTECTED_SELECTOR, ChoiceControl, type ChoiceControlProps, type ChoiceGroup, type ChoiceOption, ContrastController, type ContrastMode, ContrastModeController, type ContrastModeValue, type ContrastPalette, type CursorSizePreference, DEFAULT_PREFERENCES, DEFAULT_READING_MASK_HEIGHT, DYSLEXIA_FONT_STACK, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, FONT_FAMILY_PRESETS, FONT_FAMILY_PROTECTED_SELECTOR, FeatureCard, type FeatureCardProps, type FeatureOptions, type FeatureRegistration, type FeatureStatus, FocusHighlightController, FontFamilyController, type FontFamilyPreference, type FontFamilyPreset, FontSizeController, type FontSizeControllerProps, GrayscaleController, HideDecorativeImagesController, HideImagesController, type HideImagesControllerProps, HideVideosController, HighlightFocusController, InvertColorsController, LEGIBLE_FONT_STACK, LINE_HEIGHT_RATIOS, LINE_HEIGHT_STEPS, LetterSpacingController, type LetterSpacingControllerProps, LineHeightController, type LineHeightControllerProps, LinkHighlightController, type LocaleStrings, MAX_READING_MASK_HEIGHT, MIN_READING_MASK_HEIGHT, PROFILE_DEFINITIONS, ParagraphSpacingController, type ParagraphSpacingControllerProps, type PluginPosition, type ProfileDefinition, type ProfilePresetId, ProfilePreviewCard, type ProfilePreviewCardProps, READING_MASK_HEIGHT_PRESETS, type ReaderMode, ReadingGuideController, type ReadingGuideControllerProps, ReadingMaskController, type ReadingMaskControllerProps, ReduceMotionController, ResetController, SaturationController, type SaturationPreference, type ScriptSpacingConstraints, SearchCount, type SearchCountProps, SkipToMainLink, type SkipToMainLinkProps, StepperControl, type StepperControlProps, type StorageMode, type SupportedLocale, TEXT_ALIGN_BLOCK_SELECTOR, TEXT_SCALE_PROTECTED_SELECTOR, TEXT_SCALE_STEPS, TEXT_SPACING_EXCLUDED_SELECTOR, TextAlignController, type TextAlignPreference, TextScaleController, type TextScaleControllerProps, type TextScaleStep, ToggleControl, type ToggleControlProps, TooltipsController, type TooltipsControllerProps, type WidgetPlacement, WordSpacingController, type WordSpacingControllerProps, createInitialPreferencesState, enLocale, enableAccessibleTooltips, findMainLandmark, getAuthoredDescription, getScriptSpacingConstraints, hasFinePointer, isEligibleDecorativeImage, isForcedColorsActive, isFunctionalOrMeaningfulImage, isProtectedFromContrast, isProtectedFromFontFamily, isProtectedFromTextAlign, isProtectedFromTextScale, isProtectedFromTextSpacing, isReducedMotionActive, isRtlLocale, normalizePreferenceValue, normalizePreferences, nudgeReadingAid, positionTooltip, preferencesReducer, registerLocale, resolveEffectivePreferences, resolveLocaleStrings, subscribeFinePointer, subscribeForcedColors, subscribeReducedMotion, useAccessibility };