aria-ease 1.5.5 → 1.5.6

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
@@ -23,8 +23,6 @@ interface RadioStates {
23
23
 
24
24
  interface ToggleStates {
25
25
  pressed: boolean;
26
- pressedAriaLabel: string;
27
- unpressedAriaLabel: string;
28
26
  }
29
27
 
30
28
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aria-ease",
3
- "version": "1.5.5",
3
+ "version": "1.5.6",
4
4
  "description": "Out-of-the-box accessibility utility package to develop production ready applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -12,7 +12,6 @@ export function updateGroupTogglesAriaAttributes(toggleStates, togglesClass, cur
12
12
  allToggles.forEach(function (toggle, index) {
13
13
  if (index === currentPressedToggleIndex) {
14
14
  toggle.setAttribute("aria-pressed", toggleStates[index].pressed ? 'true' : 'false');
15
- toggle.setAttribute("aria-label", toggleStates[index].pressed ? toggleStates[index].pressedAriaLabel : toggleStates[index].unpressedAriaLabel);
16
15
  }
17
16
  });
18
17
  }
@@ -17,7 +17,6 @@ export function updateGroupTogglesAriaAttributes(toggleStates: ToggleStates[], t
17
17
  allToggles.forEach((toggle, index) => {
18
18
  if (index === currentPressedToggleIndex) {
19
19
  toggle.setAttribute("aria-pressed", toggleStates[index].pressed ? 'true' : 'false');
20
- toggle.setAttribute("aria-label", toggleStates[index].pressed ? toggleStates[index].pressedAriaLabel : toggleStates[index].unpressedAriaLabel);
21
20
  }
22
21
  });
23
22
  }
@@ -3,7 +3,7 @@
3
3
  * @param {string} toggleClass The class of all the toggle element
4
4
  * @param {string} updatedAriaLabel The aria label to be updated to toggle element
5
5
  */
6
- export function updateSingleToggleAriaAttribute(toggleClass, updatedAriaLabel) {
6
+ export function updateSingleToggleAriaAttribute(toggleClass) {
7
7
  var toggle = document.querySelector(".".concat(toggleClass));
8
8
  if (!toggle) {
9
9
  throw new Error('Invalid toggle class provided.');
@@ -12,15 +12,13 @@ export function updateSingleToggleAriaAttribute(toggleClass, updatedAriaLabel) {
12
12
  if (!currentAriaPressedState) {
13
13
  throw new Error("Toggle element does not have aria-pressed attribute");
14
14
  }
15
- function togglePressed(ariaLabel) {
15
+ function togglePressed() {
16
16
  toggle.setAttribute('aria-pressed', 'true');
17
- toggle.setAttribute('aria-label', ariaLabel);
18
17
  }
19
- function toggleUnpressed(ariaLabel) {
18
+ function toggleUnpressed() {
20
19
  toggle.setAttribute('aria-pressed', 'false');
21
- toggle.setAttribute('aria-label', ariaLabel);
22
20
  }
23
21
  (currentAriaPressedState === 'false') ?
24
- togglePressed(updatedAriaLabel) :
25
- toggleUnpressed(updatedAriaLabel);
22
+ togglePressed() :
23
+ toggleUnpressed();
26
24
  }
@@ -6,7 +6,7 @@
6
6
 
7
7
  import { HTMLElement } from "../../../Types";
8
8
 
9
- export function updateSingleToggleAriaAttribute(toggleClass: string, updatedAriaLabel: string): void {
9
+ export function updateSingleToggleAriaAttribute(toggleClass: string): void {
10
10
  const toggle: HTMLElement = document.querySelector(`.${toggleClass}`) as HTMLElement;
11
11
 
12
12
  if( !toggle) {
@@ -18,17 +18,15 @@ export function updateSingleToggleAriaAttribute(toggleClass: string, updatedAria
18
18
  throw new Error("Toggle element does not have aria-pressed attribute")
19
19
  }
20
20
 
21
- function togglePressed(ariaLabel: string): void {
21
+ function togglePressed(): void {
22
22
  toggle.setAttribute('aria-pressed', 'true');
23
- toggle.setAttribute('aria-label', ariaLabel);
24
23
  }
25
24
 
26
- function toggleUnpressed(ariaLabel: string): void {
25
+ function toggleUnpressed(): void {
27
26
  toggle.setAttribute('aria-pressed', 'false');
28
- toggle.setAttribute('aria-label', ariaLabel);
29
27
  }
30
28
 
31
29
  (currentAriaPressedState === 'false') ?
32
- togglePressed(updatedAriaLabel) :
33
- toggleUnpressed(updatedAriaLabel)
30
+ togglePressed() :
31
+ toggleUnpressed()
34
32
  }