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 CHANGED
@@ -17,8 +17,6 @@ interface CheckboxStates {
17
17
 
18
18
  interface RadioStates {
19
19
  checked: boolean;
20
- checkedAriaLabel: string;
21
- uncheckedAriaLabel: string;
22
20
  }
23
21
 
24
22
  interface ToggleStates {
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 following aria attributes; aria-checked and aria-label.
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 following aria attributes; aria-pressed and aria-label.
69
- * @param {string} togglesClass The shared class of all the toggle elements
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 following aria attributes; aria-pressed and aria-label.
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 following aria attributes; aria-checked and aria-label.
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, updatedAriaLabel: string): void
85
+ function updateSingleRadioAriaAttribute(radioClass: string): void
87
86
 
88
87
  export {
89
88
  makeMenuAccessible,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aria-ease",
3
- "version": "1.5.8",
3
+ "version": "1.6.0",
4
4
  "description": "Out-of-the-box accessibility utility package to develop production ready applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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(ariaLabel) {
15
+ function radioChecked() {
16
16
  radio.setAttribute('aria-checked', 'true');
17
- radio.setAttribute('aria-label', ariaLabel);
18
17
  }
19
- function radioUnchecked(ariaLabel) {
18
+ function radioUnchecked() {
20
19
  radio.setAttribute('aria-checked', 'false');
21
- radio.setAttribute('aria-label', ariaLabel);
22
20
  }
23
21
  (currentAriaCheckedState === 'false') ?
24
- radioChecked(updatedAriaLabel) :
25
- radioUnchecked(updatedAriaLabel);
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(ariaLabel: string): void {
21
+ function radioChecked(): void {
22
22
  radio.setAttribute('aria-checked', 'true');
23
- radio.setAttribute('aria-label', ariaLabel);
23
+
24
24
  }
25
25
 
26
- function radioUnchecked(ariaLabel: string): void {
26
+ function radioUnchecked(): void {
27
27
  radio.setAttribute('aria-checked', 'false');
28
- radio.setAttribute('aria-label', ariaLabel);
28
+
29
29
  }
30
30
 
31
31
  (currentAriaCheckedState === 'false') ?
32
- radioChecked(updatedAriaLabel) :
33
- radioUnchecked(updatedAriaLabel)
32
+ radioChecked() :
33
+ radioUnchecked()
34
34
  }