@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.
@@ -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
- // https://adxlv.computer/projects/flash-scrollers/
9
- useEffect(() => {
10
- const scrollContainer = scrollContainerRef.current;
11
- if (!scrollContainer) {
12
- return;
13
- }
14
-
15
- // Defer to the next frame to avoid forcing a synchronous reflow
16
- // when the effect runs immediately after React commits DOM changes.
17
- const id = requestAnimationFrame(() => {
18
- const currentScroll = scrollContainer.scrollTop;
19
- const altScroll = currentScroll < 1 ? currentScroll + 1 : currentScroll - 1;
20
- scrollContainer.scrollTop = altScroll;
21
- scrollContainer.scrollTop = currentScroll;
22
- });
23
- return () => cancelAnimationFrame(id);
24
- }, [scrollContainerRef]);
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@primer/react",
3
3
  "type": "module",
4
- "version": "0.0.0-20260223174439",
4
+ "version": "0.0.0-20260223175050",
5
5
  "description": "An implementation of GitHub's Primer Design System using React",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",