impact-ui 3.7.26-alpha.1 → 3.7.26-alpha.2

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": "impact-ui",
3
- "version": "3.7.26-alpha.1",
3
+ "version": "3.7.26-alpha.2",
4
4
  "description": "Impact Analytics UI library",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -22,18 +22,18 @@ export const Sidebar = ({
22
22
  visibleModulesCount,
23
23
  }) => {
24
24
  const sidebarRef = useRef(null);
25
- const prevFocusRef = useRef(null);
25
+ // const prevFocusRef = useRef(null);
26
26
 
27
- const handleToggle = useCallback(() => {
28
- if (!isOpen) {
29
- prevFocusRef.current = document.activeElement;
30
- } else {
31
- setTimeout(() => {
32
- prevFocusRef.current?.focus();
33
- }, 0);
34
- }
35
- handleClose();
36
- }, [isOpen, handleClose]);
27
+ // const handleToggle = useCallback(() => {
28
+ // if (!isOpen) {
29
+ // prevFocusRef.current = document.activeElement;
30
+ // } else {
31
+ // setTimeout(() => {
32
+ // prevFocusRef.current?.focus();
33
+ // }, 0);
34
+ // }
35
+ // handleClose();
36
+ // }, [isOpen, handleClose]);
37
37
 
38
38
  useShortcut(
39
39
  [
@@ -41,24 +41,7 @@ export const Sidebar = ({
41
41
  keys: "mod+b",
42
42
  id: "sidebar-toggle-mod-b",
43
43
  description: "Toggle sidebar",
44
- handler: handleToggle,
45
- },
46
- {
47
- keys: "alt+s",
48
- id: "sidebar-focus-alt-s",
49
- description: "Focus sidebar navigation",
50
- handler: () => {
51
- if (!isOpen) {
52
- prevFocusRef.current = document.activeElement;
53
- handleClose();
54
- }
55
- setTimeout(() => {
56
- const firstItem = sidebarRef.current?.querySelector(
57
- "[tabindex]:not([tabindex='-1'])"
58
- );
59
- firstItem?.focus();
60
- }, 50);
61
- },
44
+ handler: () => setIsOpen(!isOpen),
62
45
  },
63
46
  {
64
47
  keys: "alt+l",
@@ -106,11 +89,11 @@ export const Sidebar = ({
106
89
  role="button"
107
90
  tabIndex={0}
108
91
  aria-label={isOpen ? "Collapse sidebar" : "Expand sidebar"}
109
- onClick={handleToggle}
92
+ onClick={handleClose}
110
93
  onKeyDown={(e) => {
111
94
  if (e.key === "Enter" || e.key === " ") {
112
95
  e.preventDefault();
113
- handleToggle();
96
+ handleClose();
114
97
  }
115
98
  }}
116
99
  >