aria-ease 1.6.1 → 2.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aria-ease",
3
- "version": "1.6.1",
3
+ "version": "2.0.0",
4
4
  "description": "Out-of-the-box accessibility utility package to develop production ready applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -3,7 +3,7 @@
3
3
  * @param {string} radioClass The class of the radio button
4
4
  * @param {string} updatedAriaLabel The aria label to be updated to button element
5
5
  */
6
- export function updateSingleRadioAriaAttribute(radioClass) {
6
+ export function updateSingleRadioAriaAttribute(radioClass, updatedAriaLabel) {
7
7
  var radio = document.querySelector(".".concat(radioClass));
8
8
  if (!radio) {
9
9
  throw new Error('Invalid radio button class provided.');
@@ -6,15 +6,15 @@
6
6
 
7
7
  import { HTMLElement } from "../../../Types";
8
8
 
9
- export function updateSingleRadioAriaAttribute(radioClass: string): void {
9
+ export function updateSingleRadioAriaAttribute(radioClass: string, updatedAriaLabel: string): void {
10
10
  const radio: HTMLElement = document.querySelector(`.${radioClass}`) as HTMLElement;
11
11
 
12
- if (!radio) {
13
- throw new Error('Invalid radio button class provided.');
12
+ if( !radio) {
13
+ throw new Error('Invalid radio button class provided.');
14
14
  }
15
15
 
16
16
  const currentAriaCheckedState: string = radio.getAttribute('aria-checked') as string
17
- if (!currentAriaCheckedState) {
17
+ if(!currentAriaCheckedState) {
18
18
  throw new Error("Radio element does not have aria-checked attribute")
19
19
  }
20
20