aria-ease 1.5.8 → 1.6.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/Types.d.ts +0 -2
- package/aria-ease.d.ts +6 -7
- package/package.json +1 -1
- package/src/radio/group/updateGroupRadiosAriaAttributes.js +0 -1
- package/src/radio/group/updateGroupRadiosAriaAttributes.ts +0 -1
- package/src/radio/single/updateSingleRadioAriaAttribute.js +4 -6
- package/src/radio/single/updateSingleRadioAriaAttribute.ts +6 -6
package/Types.d.ts
CHANGED
package/aria-ease.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ declare module 'aria-ease' {
|
|
|
57
57
|
function updateGroupCheckboxesAriaAttributes(checkboxStates: CheckboxStates[], checkboxesClass: string, currentPressedCheckboxIndex: number): void;
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
|
-
* Adds screen reader accessibility to multiple radio buttons. Updates the aria attributes of the radio buttons. Radio elements must possess the
|
|
60
|
+
* Adds screen reader accessibility to multiple radio buttons. Updates the aria attributes of the radio buttons. Radio elements must possess the aria-checked attribute.
|
|
61
61
|
* @param {RadioStates[]} radioStates Array of objects containing radio buttons state information
|
|
62
62
|
* @param {string} radiosClass The shared class of all the radio buttons
|
|
63
63
|
* @param {number} currentPressedRadioIndex Index of the currently checked or unchecked radio button
|
|
@@ -65,13 +65,13 @@ declare module 'aria-ease' {
|
|
|
65
65
|
function updateGroupRadiosAriaAttributes(radioStates: RadioStates[], radiosClass: string, currentPressedRadioIndex: number): void;
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
|
-
* Adds screen reader accessibility to a single toggle element. Updates the aria attributes of the toggle element. Toggle element must possess the
|
|
69
|
-
* @param {string} togglesClass The
|
|
68
|
+
* Adds screen reader accessibility to a single toggle element. Updates the aria attributes of the toggle element. Toggle element must possess the aria-pressed attribute.
|
|
69
|
+
* @param {string} togglesClass The class of the toggle element
|
|
70
70
|
*/
|
|
71
71
|
function updateSingleToggleAriaAttribute(toggleClass: string): void
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
|
-
* Adds screen reader accessibility to toggle elements. Updates the aria attributes of the toggle elements. Toggle element must possess the
|
|
74
|
+
* Adds screen reader accessibility to toggle elements. Updates the aria attributes of the toggle elements. Toggle element must possess the aria-pressed attribute.
|
|
75
75
|
* @param {ToggleStates[]} toggleStates Array of objects containing toggle elements state information
|
|
76
76
|
* @param {string} togglesClass The shared class of all the toggle elements
|
|
77
77
|
* @param {number} currentPressedToggleIndex Index of the currently pressed or unpressed toggle element
|
|
@@ -79,11 +79,10 @@ declare module 'aria-ease' {
|
|
|
79
79
|
function updateGroupTogglesAriaAttributes(toggleStates: ToggleStates[], togglesClass: string, currentPressedToggleIndex: number): void
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
|
-
* Adds screen reader accessibility to single radio button. Updates the aria attribute of the radio button. Radio element must possess the
|
|
82
|
+
* Adds screen reader accessibility to single radio button. Updates the aria attribute of the radio button. Radio element must possess the aria-checked attribute.
|
|
83
83
|
* @param {string} radioClass The class of the radio button
|
|
84
|
-
* @param {string} updatedAriaLabel The aria label to be updated to button element
|
|
85
84
|
*/
|
|
86
|
-
function updateSingleRadioAriaAttribute(radioClass: string
|
|
85
|
+
function updateSingleRadioAriaAttribute(radioClass: string): void
|
|
87
86
|
|
|
88
87
|
export {
|
|
89
88
|
makeMenuAccessible,
|
package/package.json
CHANGED
|
@@ -18,6 +18,5 @@ export function updateGroupRadiosAriaAttributes(radioStates, radiosClass, curren
|
|
|
18
18
|
radio.setAttribute("aria-checked", 'false');
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
radio.setAttribute("aria-label", radioStates[index].checked ? radioStates[index].checkedAriaLabel : radioStates[index].uncheckedAriaLabel);
|
|
22
21
|
});
|
|
23
22
|
}
|
|
@@ -22,6 +22,5 @@ export function updateGroupRadiosAriaAttributes(radioStates: RadioStates[], radi
|
|
|
22
22
|
radio.setAttribute("aria-checked", 'false');
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
radio.setAttribute("aria-label", radioStates[index].checked ? radioStates[index].checkedAriaLabel : radioStates[index].uncheckedAriaLabel);
|
|
26
25
|
});
|
|
27
26
|
}
|
|
@@ -12,15 +12,13 @@ export function updateSingleRadioAriaAttribute(radioClass, updatedAriaLabel) {
|
|
|
12
12
|
if (!currentAriaCheckedState) {
|
|
13
13
|
throw new Error("Radio element does not have aria-checked attribute");
|
|
14
14
|
}
|
|
15
|
-
function radioChecked(
|
|
15
|
+
function radioChecked() {
|
|
16
16
|
radio.setAttribute('aria-checked', 'true');
|
|
17
|
-
radio.setAttribute('aria-label', ariaLabel);
|
|
18
17
|
}
|
|
19
|
-
function radioUnchecked(
|
|
18
|
+
function radioUnchecked() {
|
|
20
19
|
radio.setAttribute('aria-checked', 'false');
|
|
21
|
-
radio.setAttribute('aria-label', ariaLabel);
|
|
22
20
|
}
|
|
23
21
|
(currentAriaCheckedState === 'false') ?
|
|
24
|
-
radioChecked(
|
|
25
|
-
radioUnchecked(
|
|
22
|
+
radioChecked() :
|
|
23
|
+
radioUnchecked();
|
|
26
24
|
}
|
|
@@ -18,17 +18,17 @@ export function updateSingleRadioAriaAttribute(radioClass: string, updatedAriaLa
|
|
|
18
18
|
throw new Error("Radio element does not have aria-checked attribute")
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
function radioChecked(
|
|
21
|
+
function radioChecked(): void {
|
|
22
22
|
radio.setAttribute('aria-checked', 'true');
|
|
23
|
-
|
|
23
|
+
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
function radioUnchecked(
|
|
26
|
+
function radioUnchecked(): void {
|
|
27
27
|
radio.setAttribute('aria-checked', 'false');
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
(currentAriaCheckedState === 'false') ?
|
|
32
|
-
radioChecked(
|
|
33
|
-
radioUnchecked(
|
|
32
|
+
radioChecked() :
|
|
33
|
+
radioUnchecked()
|
|
34
34
|
}
|