aria-ease 1.1.5 → 1.1.7

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.
Files changed (2) hide show
  1. package/README.md +7 -6
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -59,24 +59,25 @@ export default App
59
59
 
60
60
  Add accessibility to tab: tab can be tabs, interactive sliders and carousels e.t.c. Basically any component that is permanently displayed and has a list of related interractive children items. The function creates a focus trap within the tab and the focus can be navigated using the arrow keys.
61
61
 
62
- The makeTabAccessible function takes two string arguments; the id of the tab main div, and the class name of the children item of the div. The function should be called when any of the interractive children item (e.g button) of the tab is clicked. The clicked button gets focused and the focus can be navigated using the arrow keys.
62
+ The makeTabAccessible function takes two string arguments; the id of the tab main div, and the class name of the children item of the div. The function should be called on page render, so the event listeners get activated. On click of a button, the clicked button gets focused and the focus can be navigated using the arrow keys.
63
63
 
64
64
  #### Usage
65
65
 
66
66
  ```
67
+ import { useEffect } from 'react'
67
68
  import { makeTabAccessible } from "aria-ease"
68
69
 
69
70
  const App = () => {
70
- const handleTabButtonClick = (): void => {
71
+ useEffect(() => {
71
72
  makeTabAccessible('custom-tab', 'custom-tab-item')
72
- }
73
+ },[])
73
74
 
74
75
  return (
75
76
  <div>
76
77
  <div id="custom-tab">
77
- <button className="custom-tab-item" onClick={handleTabButtonClick}>One</button>
78
- <button className="custom-tab-item" onClick={handleTabButtonClick}>Two</button>
79
- <button className="custom-tab-item" onClick={handleTabButtonClick}>Three</button>
78
+ <button className="custom-tab-item">One</button>
79
+ <button className="custom-tab-item">Two</button>
80
+ <button className="custom-tab-item">Three</button>
80
81
  </div>
81
82
  </div>
82
83
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aria-ease",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "description": "Out of the box utility accessibility package to develop production ready applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {