@primer/react 0.0.0-20260223174439 → 0.0.0-20260223175050
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/CHANGELOG.md +3 -5
- package/dist/Autocomplete/Autocomplete.js +159 -76
- package/dist/Autocomplete/AutocompleteMenu.js +333 -128
- package/dist/Autocomplete/AutocompleteOverlay.js +130 -49
- package/dist/Banner/Banner.js +238 -64
- package/dist/Checkbox/Checkbox.js +163 -55
- package/dist/Dialog/Dialog.js +347 -105
- package/dist/PageLayout/PageLayout.js +1560 -622
- package/dist/SelectPanel/SelectPanel.d.ts.map +1 -1
- package/dist/SelectPanel/SelectPanel.js +32 -82
- package/dist/TreeView/useRovingTabIndex.d.ts +14 -0
- package/dist/TreeView/useRovingTabIndex.d.ts.map +1 -1
- package/dist/TreeView/useRovingTabIndex.js +94 -16
- package/dist/UnderlineNav/UnderlineNavItem.js +149 -56
- package/dist/experimental/SelectPanel2/SelectPanel.js +593 -209
- package/dist/hooks/useScrollFlash.js +27 -17
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { c } from 'react-compiler-runtime';
|
|
1
2
|
import { useEffect } from 'react';
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -5,23 +6,32 @@ import { useEffect } from 'react';
|
|
|
5
6
|
* @param scrollContainerRef The ref of the scrollable content
|
|
6
7
|
*/
|
|
7
8
|
function useScrollFlash(scrollContainerRef) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
9
|
+
const $ = c(3);
|
|
10
|
+
let t0;
|
|
11
|
+
let t1;
|
|
12
|
+
if ($[0] !== scrollContainerRef) {
|
|
13
|
+
t0 = () => {
|
|
14
|
+
const scrollContainer = scrollContainerRef.current;
|
|
15
|
+
if (!scrollContainer) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const id = requestAnimationFrame(() => {
|
|
19
|
+
const currentScroll = scrollContainer.scrollTop;
|
|
20
|
+
const altScroll = currentScroll < 1 ? currentScroll + 1 : currentScroll - 1;
|
|
21
|
+
scrollContainer.scrollTop = altScroll;
|
|
22
|
+
scrollContainer.scrollTop = currentScroll;
|
|
23
|
+
});
|
|
24
|
+
return () => cancelAnimationFrame(id);
|
|
25
|
+
};
|
|
26
|
+
t1 = [scrollContainerRef];
|
|
27
|
+
$[0] = scrollContainerRef;
|
|
28
|
+
$[1] = t0;
|
|
29
|
+
$[2] = t1;
|
|
30
|
+
} else {
|
|
31
|
+
t0 = $[1];
|
|
32
|
+
t1 = $[2];
|
|
33
|
+
}
|
|
34
|
+
useEffect(t0, t1);
|
|
25
35
|
}
|
|
26
36
|
|
|
27
37
|
export { useScrollFlash as default };
|
package/package.json
CHANGED