accessibility-plugin-react 2.2.1 → 2.3.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/dist/index.d.mts +120 -1
- package/dist/index.d.ts +120 -1
- package/dist/index.js +516 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +508 -1
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +299 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -113,6 +113,125 @@ declare function registerLocale(code: string, strings: LocaleStrings): void;
|
|
|
113
113
|
declare function isRtlLocale(localeProp?: string): boolean;
|
|
114
114
|
declare function resolveLocaleStrings(localeProp?: string): LocaleStrings;
|
|
115
115
|
|
|
116
|
+
interface ToggleControlProps {
|
|
117
|
+
id?: string;
|
|
118
|
+
label: ReactNode;
|
|
119
|
+
checked: boolean;
|
|
120
|
+
onChange: (checked: boolean) => void;
|
|
121
|
+
disabled?: boolean;
|
|
122
|
+
unavailable?: boolean;
|
|
123
|
+
unavailableReason?: string;
|
|
124
|
+
name?: string;
|
|
125
|
+
description?: string;
|
|
126
|
+
largeControls?: boolean;
|
|
127
|
+
className?: string;
|
|
128
|
+
style?: CSSProperties;
|
|
129
|
+
}
|
|
130
|
+
declare function ToggleControl({ id, label, checked, onChange, disabled, unavailable, unavailableReason, name, description, largeControls, className, style, }: ToggleControlProps): react.JSX.Element;
|
|
131
|
+
|
|
132
|
+
interface ChoiceOption<T extends string | number> {
|
|
133
|
+
label: string;
|
|
134
|
+
value: T;
|
|
135
|
+
description?: string;
|
|
136
|
+
disabled?: boolean;
|
|
137
|
+
badge?: string;
|
|
138
|
+
}
|
|
139
|
+
interface ChoiceGroup<T extends string | number> {
|
|
140
|
+
label: string;
|
|
141
|
+
options: ChoiceOption<T>[];
|
|
142
|
+
}
|
|
143
|
+
interface ChoiceControlProps<T extends string | number> {
|
|
144
|
+
id?: string;
|
|
145
|
+
label: string;
|
|
146
|
+
value: T;
|
|
147
|
+
options?: ChoiceOption<T>[];
|
|
148
|
+
groups?: ChoiceGroup<T>[];
|
|
149
|
+
onChange: (value: T) => void;
|
|
150
|
+
disabled?: boolean;
|
|
151
|
+
largeControls?: boolean;
|
|
152
|
+
className?: string;
|
|
153
|
+
style?: CSSProperties;
|
|
154
|
+
orientation?: "horizontal" | "vertical";
|
|
155
|
+
}
|
|
156
|
+
declare function ChoiceControl<T extends string | number>({ id, label, value, options, groups, onChange, disabled, largeControls, className, style, orientation, }: ChoiceControlProps<T>): react.JSX.Element;
|
|
157
|
+
|
|
158
|
+
interface StepperControlProps {
|
|
159
|
+
id?: string;
|
|
160
|
+
label: string;
|
|
161
|
+
value: number;
|
|
162
|
+
min: number;
|
|
163
|
+
max: number;
|
|
164
|
+
step: number;
|
|
165
|
+
unit?: string;
|
|
166
|
+
formatValue?: (val: number) => string;
|
|
167
|
+
onChange: (value: number) => void;
|
|
168
|
+
showSlider?: boolean;
|
|
169
|
+
disabled?: boolean;
|
|
170
|
+
largeControls?: boolean;
|
|
171
|
+
className?: string;
|
|
172
|
+
style?: CSSProperties;
|
|
173
|
+
}
|
|
174
|
+
declare function StepperControl({ id, label, value, min, max, step, unit, formatValue, onChange, showSlider, disabled, largeControls, className, style, }: StepperControlProps): react.JSX.Element;
|
|
175
|
+
|
|
176
|
+
type FeatureStatus = "idle" | "active" | "error" | "unavailable" | "permission-required";
|
|
177
|
+
interface FeatureCardProps {
|
|
178
|
+
id?: string;
|
|
179
|
+
featureKey?: string;
|
|
180
|
+
icon?: ReactNode;
|
|
181
|
+
title: ReactNode;
|
|
182
|
+
description?: ReactNode;
|
|
183
|
+
statusBadge?: string;
|
|
184
|
+
status?: FeatureStatus;
|
|
185
|
+
errorMessage?: string;
|
|
186
|
+
unavailableMessage?: string;
|
|
187
|
+
permissionMessage?: string;
|
|
188
|
+
onRequestPermission?: () => void;
|
|
189
|
+
children: ReactNode;
|
|
190
|
+
className?: string;
|
|
191
|
+
style?: CSSProperties;
|
|
192
|
+
largeControls?: boolean;
|
|
193
|
+
}
|
|
194
|
+
declare function FeatureCard({ id, featureKey, icon, title, description, statusBadge, status, errorMessage, unavailableMessage, permissionMessage, onRequestPermission, children, className, style, largeControls, }: FeatureCardProps): react.JSX.Element;
|
|
195
|
+
|
|
196
|
+
interface SearchCountProps {
|
|
197
|
+
totalCount: number;
|
|
198
|
+
matchedCount: number;
|
|
199
|
+
query?: string;
|
|
200
|
+
className?: string;
|
|
201
|
+
style?: CSSProperties;
|
|
202
|
+
}
|
|
203
|
+
declare function SearchCount({ totalCount, matchedCount, query, className, style, }: SearchCountProps): react.JSX.Element;
|
|
204
|
+
interface EmptyStateProps {
|
|
205
|
+
title?: string;
|
|
206
|
+
description?: string;
|
|
207
|
+
actionLabel?: string;
|
|
208
|
+
onAction?: () => void;
|
|
209
|
+
icon?: ReactNode;
|
|
210
|
+
className?: string;
|
|
211
|
+
style?: CSSProperties;
|
|
212
|
+
}
|
|
213
|
+
declare function EmptyState({ title, description, actionLabel, onAction, icon, className, style, }: EmptyStateProps): react.JSX.Element;
|
|
214
|
+
interface ErrorStateProps {
|
|
215
|
+
title?: string;
|
|
216
|
+
message: string;
|
|
217
|
+
onRetry?: () => void;
|
|
218
|
+
retryLabel?: string;
|
|
219
|
+
className?: string;
|
|
220
|
+
style?: CSSProperties;
|
|
221
|
+
}
|
|
222
|
+
declare function ErrorState({ title, message, onRetry, retryLabel, className, style, }: ErrorStateProps): react.JSX.Element;
|
|
223
|
+
|
|
224
|
+
interface ProfilePreviewCardProps {
|
|
225
|
+
profile: ProfileDefinition;
|
|
226
|
+
isActive: boolean;
|
|
227
|
+
onApply: (profile: ProfileDefinition) => void;
|
|
228
|
+
onRevert: () => void;
|
|
229
|
+
largeControls?: boolean;
|
|
230
|
+
className?: string;
|
|
231
|
+
style?: CSSProperties;
|
|
232
|
+
}
|
|
233
|
+
declare function ProfilePreviewCard({ profile, isActive, onApply, onRevert, largeControls, className, style, }: ProfilePreviewCardProps): react.JSX.Element;
|
|
234
|
+
|
|
116
235
|
interface AccessibilityState {
|
|
117
236
|
isOpen: boolean;
|
|
118
237
|
features: Record<string, unknown>;
|
|
@@ -242,4 +361,4 @@ declare function ReadingGuideController(): react.JSX.Element;
|
|
|
242
361
|
|
|
243
362
|
declare function ResetController(): react.JSX.Element;
|
|
244
363
|
|
|
245
|
-
export { AccessibilityButton, type AccessibilityButtonProps, AccessibilityContext, type AccessibilityContextValue, AccessibilityList, type AccessibilityListProps, AccessibilityPlugin, type AccessibilityPluginProps, type AccessibilityPreferences, type AccessibilityState, BigCursorController, ContrastController, type ContrastMode, type CursorSizePreference, DEFAULT_PREFERENCES, type FeatureOptions, type FeatureRegistration, type FontFamilyPreference, FontSizeController, GrayscaleController, HideImagesController, HideVideosController, InvertColorsController, LetterSpacingController, LineHeightController, LinkHighlightController, type LocaleStrings, PROFILE_DEFINITIONS, type PluginPosition, type ProfileDefinition, type ProfilePresetId, type ReaderMode, ReadingGuideController, ReadingMaskController, ResetController, SaturationController, type SaturationPreference, type StorageMode, type SupportedLocale, TextAlignController, type TextAlignPreference, type WidgetPlacement, createInitialPreferencesState, enLocale, isRtlLocale, normalizePreferenceValue, normalizePreferences, preferencesReducer, registerLocale, resolveEffectivePreferences, resolveLocaleStrings, useAccessibility };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -113,6 +113,125 @@ declare function registerLocale(code: string, strings: LocaleStrings): void;
|
|
|
113
113
|
declare function isRtlLocale(localeProp?: string): boolean;
|
|
114
114
|
declare function resolveLocaleStrings(localeProp?: string): LocaleStrings;
|
|
115
115
|
|
|
116
|
+
interface ToggleControlProps {
|
|
117
|
+
id?: string;
|
|
118
|
+
label: ReactNode;
|
|
119
|
+
checked: boolean;
|
|
120
|
+
onChange: (checked: boolean) => void;
|
|
121
|
+
disabled?: boolean;
|
|
122
|
+
unavailable?: boolean;
|
|
123
|
+
unavailableReason?: string;
|
|
124
|
+
name?: string;
|
|
125
|
+
description?: string;
|
|
126
|
+
largeControls?: boolean;
|
|
127
|
+
className?: string;
|
|
128
|
+
style?: CSSProperties;
|
|
129
|
+
}
|
|
130
|
+
declare function ToggleControl({ id, label, checked, onChange, disabled, unavailable, unavailableReason, name, description, largeControls, className, style, }: ToggleControlProps): react.JSX.Element;
|
|
131
|
+
|
|
132
|
+
interface ChoiceOption<T extends string | number> {
|
|
133
|
+
label: string;
|
|
134
|
+
value: T;
|
|
135
|
+
description?: string;
|
|
136
|
+
disabled?: boolean;
|
|
137
|
+
badge?: string;
|
|
138
|
+
}
|
|
139
|
+
interface ChoiceGroup<T extends string | number> {
|
|
140
|
+
label: string;
|
|
141
|
+
options: ChoiceOption<T>[];
|
|
142
|
+
}
|
|
143
|
+
interface ChoiceControlProps<T extends string | number> {
|
|
144
|
+
id?: string;
|
|
145
|
+
label: string;
|
|
146
|
+
value: T;
|
|
147
|
+
options?: ChoiceOption<T>[];
|
|
148
|
+
groups?: ChoiceGroup<T>[];
|
|
149
|
+
onChange: (value: T) => void;
|
|
150
|
+
disabled?: boolean;
|
|
151
|
+
largeControls?: boolean;
|
|
152
|
+
className?: string;
|
|
153
|
+
style?: CSSProperties;
|
|
154
|
+
orientation?: "horizontal" | "vertical";
|
|
155
|
+
}
|
|
156
|
+
declare function ChoiceControl<T extends string | number>({ id, label, value, options, groups, onChange, disabled, largeControls, className, style, orientation, }: ChoiceControlProps<T>): react.JSX.Element;
|
|
157
|
+
|
|
158
|
+
interface StepperControlProps {
|
|
159
|
+
id?: string;
|
|
160
|
+
label: string;
|
|
161
|
+
value: number;
|
|
162
|
+
min: number;
|
|
163
|
+
max: number;
|
|
164
|
+
step: number;
|
|
165
|
+
unit?: string;
|
|
166
|
+
formatValue?: (val: number) => string;
|
|
167
|
+
onChange: (value: number) => void;
|
|
168
|
+
showSlider?: boolean;
|
|
169
|
+
disabled?: boolean;
|
|
170
|
+
largeControls?: boolean;
|
|
171
|
+
className?: string;
|
|
172
|
+
style?: CSSProperties;
|
|
173
|
+
}
|
|
174
|
+
declare function StepperControl({ id, label, value, min, max, step, unit, formatValue, onChange, showSlider, disabled, largeControls, className, style, }: StepperControlProps): react.JSX.Element;
|
|
175
|
+
|
|
176
|
+
type FeatureStatus = "idle" | "active" | "error" | "unavailable" | "permission-required";
|
|
177
|
+
interface FeatureCardProps {
|
|
178
|
+
id?: string;
|
|
179
|
+
featureKey?: string;
|
|
180
|
+
icon?: ReactNode;
|
|
181
|
+
title: ReactNode;
|
|
182
|
+
description?: ReactNode;
|
|
183
|
+
statusBadge?: string;
|
|
184
|
+
status?: FeatureStatus;
|
|
185
|
+
errorMessage?: string;
|
|
186
|
+
unavailableMessage?: string;
|
|
187
|
+
permissionMessage?: string;
|
|
188
|
+
onRequestPermission?: () => void;
|
|
189
|
+
children: ReactNode;
|
|
190
|
+
className?: string;
|
|
191
|
+
style?: CSSProperties;
|
|
192
|
+
largeControls?: boolean;
|
|
193
|
+
}
|
|
194
|
+
declare function FeatureCard({ id, featureKey, icon, title, description, statusBadge, status, errorMessage, unavailableMessage, permissionMessage, onRequestPermission, children, className, style, largeControls, }: FeatureCardProps): react.JSX.Element;
|
|
195
|
+
|
|
196
|
+
interface SearchCountProps {
|
|
197
|
+
totalCount: number;
|
|
198
|
+
matchedCount: number;
|
|
199
|
+
query?: string;
|
|
200
|
+
className?: string;
|
|
201
|
+
style?: CSSProperties;
|
|
202
|
+
}
|
|
203
|
+
declare function SearchCount({ totalCount, matchedCount, query, className, style, }: SearchCountProps): react.JSX.Element;
|
|
204
|
+
interface EmptyStateProps {
|
|
205
|
+
title?: string;
|
|
206
|
+
description?: string;
|
|
207
|
+
actionLabel?: string;
|
|
208
|
+
onAction?: () => void;
|
|
209
|
+
icon?: ReactNode;
|
|
210
|
+
className?: string;
|
|
211
|
+
style?: CSSProperties;
|
|
212
|
+
}
|
|
213
|
+
declare function EmptyState({ title, description, actionLabel, onAction, icon, className, style, }: EmptyStateProps): react.JSX.Element;
|
|
214
|
+
interface ErrorStateProps {
|
|
215
|
+
title?: string;
|
|
216
|
+
message: string;
|
|
217
|
+
onRetry?: () => void;
|
|
218
|
+
retryLabel?: string;
|
|
219
|
+
className?: string;
|
|
220
|
+
style?: CSSProperties;
|
|
221
|
+
}
|
|
222
|
+
declare function ErrorState({ title, message, onRetry, retryLabel, className, style, }: ErrorStateProps): react.JSX.Element;
|
|
223
|
+
|
|
224
|
+
interface ProfilePreviewCardProps {
|
|
225
|
+
profile: ProfileDefinition;
|
|
226
|
+
isActive: boolean;
|
|
227
|
+
onApply: (profile: ProfileDefinition) => void;
|
|
228
|
+
onRevert: () => void;
|
|
229
|
+
largeControls?: boolean;
|
|
230
|
+
className?: string;
|
|
231
|
+
style?: CSSProperties;
|
|
232
|
+
}
|
|
233
|
+
declare function ProfilePreviewCard({ profile, isActive, onApply, onRevert, largeControls, className, style, }: ProfilePreviewCardProps): react.JSX.Element;
|
|
234
|
+
|
|
116
235
|
interface AccessibilityState {
|
|
117
236
|
isOpen: boolean;
|
|
118
237
|
features: Record<string, unknown>;
|
|
@@ -242,4 +361,4 @@ declare function ReadingGuideController(): react.JSX.Element;
|
|
|
242
361
|
|
|
243
362
|
declare function ResetController(): react.JSX.Element;
|
|
244
363
|
|
|
245
|
-
export { AccessibilityButton, type AccessibilityButtonProps, AccessibilityContext, type AccessibilityContextValue, AccessibilityList, type AccessibilityListProps, AccessibilityPlugin, type AccessibilityPluginProps, type AccessibilityPreferences, type AccessibilityState, BigCursorController, ContrastController, type ContrastMode, type CursorSizePreference, DEFAULT_PREFERENCES, type FeatureOptions, type FeatureRegistration, type FontFamilyPreference, FontSizeController, GrayscaleController, HideImagesController, HideVideosController, InvertColorsController, LetterSpacingController, LineHeightController, LinkHighlightController, type LocaleStrings, PROFILE_DEFINITIONS, type PluginPosition, type ProfileDefinition, type ProfilePresetId, type ReaderMode, ReadingGuideController, ReadingMaskController, ResetController, SaturationController, type SaturationPreference, type StorageMode, type SupportedLocale, TextAlignController, type TextAlignPreference, type WidgetPlacement, createInitialPreferencesState, enLocale, isRtlLocale, normalizePreferenceValue, normalizePreferences, preferencesReducer, registerLocale, resolveEffectivePreferences, resolveLocaleStrings, useAccessibility };
|
|
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 };
|