@applicaster/zapp-react-native-utils 13.0.5 → 13.0.6-alpha.9045435588
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/appUtils/accessibilityManager/index.ts +34 -2
- package/index.d.ts +3 -0
- package/package.json +2 -2
|
@@ -143,12 +143,15 @@ export class AccessibilityManager {
|
|
|
143
143
|
|
|
144
144
|
if (!buttonConfig) {
|
|
145
145
|
return {
|
|
146
|
+
accessible: true,
|
|
146
147
|
accessibilityLabel: buttonName,
|
|
147
148
|
accessibilityHint: `Press button to perform action on ${buttonName}`,
|
|
148
149
|
"aria-label": buttonName,
|
|
149
150
|
"aria-description": `Press button to perform action on ${buttonName}`,
|
|
150
151
|
accessibilityRole: "button" as AccessibilityRole,
|
|
151
152
|
"aria-role": "button",
|
|
153
|
+
role: "button",
|
|
154
|
+
tabindex: 0,
|
|
152
155
|
};
|
|
153
156
|
}
|
|
154
157
|
|
|
@@ -162,23 +165,52 @@ export class AccessibilityManager {
|
|
|
162
165
|
`Press button to perform action on ${buttonName}`;
|
|
163
166
|
|
|
164
167
|
return {
|
|
168
|
+
accessible: true,
|
|
165
169
|
accessibilityLabel: label,
|
|
166
170
|
accessibilityHint: hint,
|
|
167
171
|
"aria-label": label,
|
|
168
172
|
"aria-description": hint,
|
|
169
173
|
accessibilityRole: "button" as AccessibilityRole,
|
|
170
174
|
"aria-role": "button",
|
|
175
|
+
role: "button",
|
|
176
|
+
tabindex: 0,
|
|
171
177
|
};
|
|
172
178
|
}
|
|
173
179
|
|
|
174
180
|
public getInputAccessibilityProps(inputName: string): AccessibilityProps {
|
|
175
181
|
return {
|
|
182
|
+
accessible: true,
|
|
176
183
|
accessibilityLabel: inputName,
|
|
177
184
|
accessibilityHint: `Enter text into ${inputName}`,
|
|
178
185
|
"aria-label": inputName,
|
|
179
186
|
"aria-description": `Enter text into ${inputName}`,
|
|
180
|
-
accessibilityRole: "
|
|
181
|
-
"aria-role": "
|
|
187
|
+
accessibilityRole: "text" as AccessibilityRole,
|
|
188
|
+
"aria-role": "text",
|
|
189
|
+
role: "text",
|
|
190
|
+
tabindex: 0,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Extracts accessibility props from component props and returns them as HTML attributes
|
|
196
|
+
* @param props - Component props containing accessibility properties
|
|
197
|
+
* @returns Object with accessibility HTML attributes
|
|
198
|
+
*/
|
|
199
|
+
public getWebAccessibilityProps(props: any): AccessibilityProps {
|
|
200
|
+
const {
|
|
201
|
+
"aria-label": ariaLabel,
|
|
202
|
+
"aria-description": ariaDescription,
|
|
203
|
+
"aria-role": ariaRole,
|
|
204
|
+
role,
|
|
205
|
+
tabindex,
|
|
206
|
+
} = props;
|
|
207
|
+
|
|
208
|
+
return {
|
|
209
|
+
"aria-label": ariaLabel,
|
|
210
|
+
"aria-description": ariaDescription,
|
|
211
|
+
"aria-role": ariaRole,
|
|
212
|
+
role: role || ariaRole,
|
|
213
|
+
tabindex,
|
|
182
214
|
};
|
|
183
215
|
}
|
|
184
216
|
|
package/index.d.ts
CHANGED
|
@@ -139,10 +139,13 @@ declare type AccessibilityState = {
|
|
|
139
139
|
};
|
|
140
140
|
|
|
141
141
|
declare type AccessibilityProps = {
|
|
142
|
+
accessible?: boolean;
|
|
142
143
|
accessibilityLabel?: string;
|
|
143
144
|
accessibilityHint?: string;
|
|
144
145
|
"aria-label"?: string;
|
|
145
146
|
"aria-description"?: string;
|
|
146
147
|
accessibilityRole?: string;
|
|
147
148
|
"aria-role"?: string;
|
|
149
|
+
role?: string;
|
|
150
|
+
tabindex?: number;
|
|
148
151
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-utils",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.6-alpha.9045435588",
|
|
4
4
|
"description": "Applicaster Zapp React Native utilities package",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@applicaster/applicaster-types": "13.0.
|
|
30
|
+
"@applicaster/applicaster-types": "13.0.6-alpha.9045435588",
|
|
31
31
|
"buffer": "^5.2.1",
|
|
32
32
|
"camelize": "^1.0.0",
|
|
33
33
|
"dayjs": "^1.11.10",
|