aria-ease 1.3.7 → 1.3.8

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
@@ -10,7 +10,7 @@ interface AccordionStates {
10
10
  }
11
11
 
12
12
  interface CheckboxStates {
13
- pressed: boolean;
13
+ checked: boolean;
14
14
  checkedAriaLabel: string;
15
15
  uncheckedAriaLabel: string;
16
16
  }
package/aria-ease.d.ts CHANGED
@@ -43,7 +43,7 @@ declare module 'aria-ease' {
43
43
  function updateAccordionTriggerAriaAttributes(accordionStates: AccordionStates[], accordionsClass: string, currentClickedTriggerIndex: number): void;
44
44
 
45
45
  /**
46
- * Adds screen reader accessibility to checkboxes. Updates the aria attributes of the checkbox. Checkbox element must possess the following aria attributes; aria-pressed and aria-label.
46
+ * Adds screen reader accessibility to checkboxes. Updates the aria attributes of the checkbox. Checkbox element must possess the following aria attributes; aria-checked and aria-label.
47
47
  * @param {CheckboxStates[]} checkboxStates Array of objects containing checkboxes state information
48
48
  * @param {string} checkboxesClass The shared class of all the checkboxes
49
49
  * @param {number} currentPressedCheckboxIndex Index of the currently checked or unchecked checkbox
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aria-ease",
3
- "version": "1.3.7",
3
+ "version": "1.3.8",
4
4
  "description": "Out-of-the-box accessibility utility package to develop production ready applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Adds screen reader accessibility to checkboxes. Updates the aria attributes of the checkbox. Checkbox element must possess the following aria attributes; aria-pressed and aria-label.
2
+ * Adds screen reader accessibility to checkboxes. Updates the aria attributes of the checkbox. Checkbox element must possess the following aria attributes; aria-checked and aria-label.
3
3
  * @param {CheckboxStates[]} checkboxStates Array of objects containing checkboxes state information
4
4
  * @param {string} checkboxesClass The shared class of all the checkboxes
5
5
  * @param {number} currentPressedCheckboxIndex Index of the currently checked or unchecked checkbox
@@ -11,8 +11,8 @@ export function updateCheckboxAriaAttributes(checkboxStates, checkboxesClass, cu
11
11
  }
12
12
  allCheckboxes.forEach(function (checkbox, index) {
13
13
  if (index === currentPressedCheckboxIndex) {
14
- checkbox.setAttribute("aria-pressed", checkboxStates[index].pressed ? 'true' : 'false');
15
- checkbox.setAttribute("aria-label", checkboxStates[index].pressed ? checkboxStates[index].checkedAriaLabel : checkboxStates[index].uncheckedAriaLabel);
14
+ checkbox.setAttribute("aria-checked", checkboxStates[index].checked ? 'true' : 'false');
15
+ checkbox.setAttribute("aria-label", checkboxStates[index].checked ? checkboxStates[index].checkedAriaLabel : checkboxStates[index].uncheckedAriaLabel);
16
16
  }
17
17
  });
18
18
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Adds screen reader accessibility to checkboxes. Updates the aria attributes of the checkbox. Checkbox element must possess the following aria attributes; aria-pressed and aria-label.
2
+ * Adds screen reader accessibility to checkboxes. Updates the aria attributes of the checkbox. Checkbox element must possess the following aria attributes; aria-checked and aria-label.
3
3
  * @param {CheckboxStates[]} checkboxStates Array of objects containing checkboxes state information
4
4
  * @param {string} checkboxesClass The shared class of all the checkboxes
5
5
  * @param {number} currentPressedCheckboxIndex Index of the currently checked or unchecked checkbox
@@ -16,8 +16,8 @@ export function updateCheckboxAriaAttributes(checkboxStates: CheckboxStates[], c
16
16
 
17
17
  allCheckboxes.forEach((checkbox, index) => {
18
18
  if (index === currentPressedCheckboxIndex) {
19
- checkbox.setAttribute("aria-pressed", checkboxStates[index].pressed ? 'true' : 'false');
20
- checkbox.setAttribute("aria-label", checkboxStates[index].pressed ? checkboxStates[index].checkedAriaLabel : checkboxStates[index].uncheckedAriaLabel);
19
+ checkbox.setAttribute("aria-checked", checkboxStates[index].checked ? 'true' : 'false');
20
+ checkbox.setAttribute("aria-label", checkboxStates[index].checked ? checkboxStates[index].checkedAriaLabel : checkboxStates[index].uncheckedAriaLabel);
21
21
  }
22
22
  });
23
23
  }