accessibility-plugin-react 2.7.0 → 2.8.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 +3 -0
- package/dist/index.d.mts +27 -1
- package/dist/index.d.ts +27 -1
- package/dist/index.js +514 -354
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +409 -253
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +54 -0
- package/docs/API.md +3 -3
- package/docs/BUILD_AND_RELEASE_PLAN.md +1 -1
- package/docs/FEATURES.md +3 -0
- package/docs/LINKS_AND_FOCUS.md +65 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -277,6 +277,9 @@ See [troubleshooting](docs/TROUBLESHOOTING.md) before filing an issue.
|
|
|
277
277
|
|
|
278
278
|
- [API reference](docs/API.md)
|
|
279
279
|
- [Feature behavior and bounds](docs/FEATURES.md)
|
|
280
|
+
- [Link highlighting, focus visibility, and landmark skip links](docs/LINKS_AND_FOCUS.md)
|
|
281
|
+
- [Contrast modes and forced-colors protection](docs/CONTRAST.md)
|
|
282
|
+
- [Legible and dyslexia font stacks](docs/FONTS.md)
|
|
280
283
|
- [Installation and Next.js](docs/INSTALLATION.md)
|
|
281
284
|
- [Content Security Policy (CSP) guidance](docs/CSP.md)
|
|
282
285
|
- [Custom features](docs/CUSTOM_FEATURES.md)
|
package/dist/index.d.mts
CHANGED
|
@@ -82,6 +82,7 @@ interface LocaleStrings {
|
|
|
82
82
|
description: string;
|
|
83
83
|
closeLabel: string;
|
|
84
84
|
skipToActions: string;
|
|
85
|
+
skipToMain?: string;
|
|
85
86
|
toolsLabel: string;
|
|
86
87
|
quickActionsLabel: string;
|
|
87
88
|
resetLabel: string;
|
|
@@ -326,6 +327,23 @@ declare function AccessibilityButton({ icon, draggable, title, description, clas
|
|
|
326
327
|
|
|
327
328
|
declare function AccessibilityList(props: AccessibilityListProps): react.JSX.Element;
|
|
328
329
|
|
|
330
|
+
/**
|
|
331
|
+
* Searches the host document for an authentic main landmark:
|
|
332
|
+
* native `<main>` element or element with explicit `role="main"`.
|
|
333
|
+
* Returns null if no authentic main landmark exists.
|
|
334
|
+
*/
|
|
335
|
+
declare function findMainLandmark(): HTMLElement | null;
|
|
336
|
+
interface SkipToMainLinkProps {
|
|
337
|
+
className?: string;
|
|
338
|
+
label?: string;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Accessible Skip to Main Content link.
|
|
342
|
+
* Only renders when a real `<main>` or `[role="main"]` landmark exists in the document,
|
|
343
|
+
* preventing broken or unreachable skip links in partial views or embedded layouts.
|
|
344
|
+
*/
|
|
345
|
+
declare function SkipToMainLink({ className, label }: SkipToMainLinkProps): react.JSX.Element | null;
|
|
346
|
+
|
|
329
347
|
declare function useAccessibility<T>(featureKey: string, defaultValue: T, options?: FeatureOptions<T>): {
|
|
330
348
|
value: T;
|
|
331
349
|
setValue: (next: T) => void;
|
|
@@ -479,6 +497,14 @@ declare function ReadingMaskController(): react.JSX.Element;
|
|
|
479
497
|
|
|
480
498
|
declare function ReadingGuideController(): react.JSX.Element;
|
|
481
499
|
|
|
500
|
+
/**
|
|
501
|
+
* Controller to toggle enhanced focus visibility.
|
|
502
|
+
* Provides high-contrast, multi-layer focus outlines for keyboard navigation,
|
|
503
|
+
* preserving disabled states and yielding to native operating system high contrast themes.
|
|
504
|
+
*/
|
|
505
|
+
declare function HighlightFocusController(): react.JSX.Element;
|
|
506
|
+
declare const FocusHighlightController: typeof HighlightFocusController;
|
|
507
|
+
|
|
482
508
|
declare function ResetController(): react.JSX.Element;
|
|
483
509
|
|
|
484
|
-
export { AccessibilityButton, type AccessibilityButtonProps, AccessibilityContext, type AccessibilityContextValue, AccessibilityList, type AccessibilityListProps, AccessibilityPlugin, type AccessibilityPluginProps, type AccessibilityPreferences, type AccessibilityState, BigCursorController, 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, 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, FontFamilyController, type FontFamilyPreference, type FontFamilyPreset, FontSizeController, type FontSizeControllerProps, GrayscaleController, HideImagesController, HideVideosController, InvertColorsController, LEGIBLE_FONT_STACK, LINE_HEIGHT_RATIOS, LINE_HEIGHT_STEPS, LetterSpacingController, type LetterSpacingControllerProps, LineHeightController, type LineHeightControllerProps, LinkHighlightController, type LocaleStrings, PROFILE_DEFINITIONS, ParagraphSpacingController, type ParagraphSpacingControllerProps, type PluginPosition, type ProfileDefinition, type ProfilePresetId, ProfilePreviewCard, type ProfilePreviewCardProps, type ReaderMode, ReadingGuideController, ReadingMaskController, ResetController, SaturationController, type SaturationPreference, type ScriptSpacingConstraints, SearchCount, type SearchCountProps, 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, getScriptSpacingConstraints, isForcedColorsActive, isProtectedFromContrast, isProtectedFromFontFamily, isProtectedFromTextAlign, isProtectedFromTextScale, isProtectedFromTextSpacing, isRtlLocale, normalizePreferenceValue, normalizePreferences, preferencesReducer, registerLocale, resolveEffectivePreferences, resolveLocaleStrings, useAccessibility };
|
|
510
|
+
export { AccessibilityButton, type AccessibilityButtonProps, AccessibilityContext, type AccessibilityContextValue, AccessibilityList, type AccessibilityListProps, AccessibilityPlugin, type AccessibilityPluginProps, type AccessibilityPreferences, type AccessibilityState, BigCursorController, 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, 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, HideImagesController, HideVideosController, HighlightFocusController, InvertColorsController, LEGIBLE_FONT_STACK, LINE_HEIGHT_RATIOS, LINE_HEIGHT_STEPS, LetterSpacingController, type LetterSpacingControllerProps, LineHeightController, type LineHeightControllerProps, LinkHighlightController, type LocaleStrings, PROFILE_DEFINITIONS, ParagraphSpacingController, type ParagraphSpacingControllerProps, type PluginPosition, type ProfileDefinition, type ProfilePresetId, ProfilePreviewCard, type ProfilePreviewCardProps, type ReaderMode, ReadingGuideController, ReadingMaskController, 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, isForcedColorsActive, isProtectedFromContrast, isProtectedFromFontFamily, isProtectedFromTextAlign, isProtectedFromTextScale, isProtectedFromTextSpacing, isRtlLocale, normalizePreferenceValue, normalizePreferences, preferencesReducer, registerLocale, resolveEffectivePreferences, resolveLocaleStrings, useAccessibility };
|
package/dist/index.d.ts
CHANGED
|
@@ -82,6 +82,7 @@ interface LocaleStrings {
|
|
|
82
82
|
description: string;
|
|
83
83
|
closeLabel: string;
|
|
84
84
|
skipToActions: string;
|
|
85
|
+
skipToMain?: string;
|
|
85
86
|
toolsLabel: string;
|
|
86
87
|
quickActionsLabel: string;
|
|
87
88
|
resetLabel: string;
|
|
@@ -326,6 +327,23 @@ declare function AccessibilityButton({ icon, draggable, title, description, clas
|
|
|
326
327
|
|
|
327
328
|
declare function AccessibilityList(props: AccessibilityListProps): react.JSX.Element;
|
|
328
329
|
|
|
330
|
+
/**
|
|
331
|
+
* Searches the host document for an authentic main landmark:
|
|
332
|
+
* native `<main>` element or element with explicit `role="main"`.
|
|
333
|
+
* Returns null if no authentic main landmark exists.
|
|
334
|
+
*/
|
|
335
|
+
declare function findMainLandmark(): HTMLElement | null;
|
|
336
|
+
interface SkipToMainLinkProps {
|
|
337
|
+
className?: string;
|
|
338
|
+
label?: string;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Accessible Skip to Main Content link.
|
|
342
|
+
* Only renders when a real `<main>` or `[role="main"]` landmark exists in the document,
|
|
343
|
+
* preventing broken or unreachable skip links in partial views or embedded layouts.
|
|
344
|
+
*/
|
|
345
|
+
declare function SkipToMainLink({ className, label }: SkipToMainLinkProps): react.JSX.Element | null;
|
|
346
|
+
|
|
329
347
|
declare function useAccessibility<T>(featureKey: string, defaultValue: T, options?: FeatureOptions<T>): {
|
|
330
348
|
value: T;
|
|
331
349
|
setValue: (next: T) => void;
|
|
@@ -479,6 +497,14 @@ declare function ReadingMaskController(): react.JSX.Element;
|
|
|
479
497
|
|
|
480
498
|
declare function ReadingGuideController(): react.JSX.Element;
|
|
481
499
|
|
|
500
|
+
/**
|
|
501
|
+
* Controller to toggle enhanced focus visibility.
|
|
502
|
+
* Provides high-contrast, multi-layer focus outlines for keyboard navigation,
|
|
503
|
+
* preserving disabled states and yielding to native operating system high contrast themes.
|
|
504
|
+
*/
|
|
505
|
+
declare function HighlightFocusController(): react.JSX.Element;
|
|
506
|
+
declare const FocusHighlightController: typeof HighlightFocusController;
|
|
507
|
+
|
|
482
508
|
declare function ResetController(): react.JSX.Element;
|
|
483
509
|
|
|
484
|
-
export { AccessibilityButton, type AccessibilityButtonProps, AccessibilityContext, type AccessibilityContextValue, AccessibilityList, type AccessibilityListProps, AccessibilityPlugin, type AccessibilityPluginProps, type AccessibilityPreferences, type AccessibilityState, BigCursorController, 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, 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, FontFamilyController, type FontFamilyPreference, type FontFamilyPreset, FontSizeController, type FontSizeControllerProps, GrayscaleController, HideImagesController, HideVideosController, InvertColorsController, LEGIBLE_FONT_STACK, LINE_HEIGHT_RATIOS, LINE_HEIGHT_STEPS, LetterSpacingController, type LetterSpacingControllerProps, LineHeightController, type LineHeightControllerProps, LinkHighlightController, type LocaleStrings, PROFILE_DEFINITIONS, ParagraphSpacingController, type ParagraphSpacingControllerProps, type PluginPosition, type ProfileDefinition, type ProfilePresetId, ProfilePreviewCard, type ProfilePreviewCardProps, type ReaderMode, ReadingGuideController, ReadingMaskController, ResetController, SaturationController, type SaturationPreference, type ScriptSpacingConstraints, SearchCount, type SearchCountProps, 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, getScriptSpacingConstraints, isForcedColorsActive, isProtectedFromContrast, isProtectedFromFontFamily, isProtectedFromTextAlign, isProtectedFromTextScale, isProtectedFromTextSpacing, isRtlLocale, normalizePreferenceValue, normalizePreferences, preferencesReducer, registerLocale, resolveEffectivePreferences, resolveLocaleStrings, useAccessibility };
|
|
510
|
+
export { AccessibilityButton, type AccessibilityButtonProps, AccessibilityContext, type AccessibilityContextValue, AccessibilityList, type AccessibilityListProps, AccessibilityPlugin, type AccessibilityPluginProps, type AccessibilityPreferences, type AccessibilityState, BigCursorController, 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, 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, HideImagesController, HideVideosController, HighlightFocusController, InvertColorsController, LEGIBLE_FONT_STACK, LINE_HEIGHT_RATIOS, LINE_HEIGHT_STEPS, LetterSpacingController, type LetterSpacingControllerProps, LineHeightController, type LineHeightControllerProps, LinkHighlightController, type LocaleStrings, PROFILE_DEFINITIONS, ParagraphSpacingController, type ParagraphSpacingControllerProps, type PluginPosition, type ProfileDefinition, type ProfilePresetId, ProfilePreviewCard, type ProfilePreviewCardProps, type ReaderMode, ReadingGuideController, ReadingMaskController, 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, isForcedColorsActive, isProtectedFromContrast, isProtectedFromFontFamily, isProtectedFromTextAlign, isProtectedFromTextScale, isProtectedFromTextSpacing, isRtlLocale, normalizePreferenceValue, normalizePreferences, preferencesReducer, registerLocale, resolveEffectivePreferences, resolveLocaleStrings, useAccessibility };
|