@primer/react 0.0.0-20260220144011 → 0.0.0-20260220144103
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
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# @primer/react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-20260220144103
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- Fake entry to force publishing
|
|
8
8
|
|
|
9
|
-
- [#
|
|
9
|
+
- [#7551](https://github.com/primer/react/pull/7551) [`edb8eca`](https://github.com/primer/react/commit/edb8eca477e9bb940732bddfa83a294332f2381a) Thanks [@hectahertz](https://github.com/hectahertz)! - perf(Text): remove unnecessary useRef and useImperativeHandle hooks
|
|
10
10
|
|
|
11
11
|
## 38.13.0
|
|
12
12
|
|
package/dist/Text/Text.d.ts
CHANGED
package/dist/Text/Text.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../src/Text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../src/Text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAAkB,KAAK,gBAAgB,EAAC,MAAM,6BAA6B,CAAA;AAElF,MAAM,MAAM,SAAS,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,GAAG,MAAM,IAAI,gBAAgB,CAC7E,EAAE,EACF,MAAM,EACN;IACE,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAA;IACnD,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CACF,CAAA;yBAGa,EAAE,SAAS,KAAK,CAAC,WAAW;WAP/B,OAAO,GAAG,QAAQ,GAAG,OAAO;aAC1B,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU;gBACvC,MAAM;;WAFX,OAAO,GAAG,QAAQ,GAAG,OAAO;aAC1B,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU;gBACvC,MAAM;;;;AAetB,wBAAoC"}
|
package/dist/Text/Text.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
|
-
import React from 'react';
|
|
4
3
|
import classes from './Text.module.css.js';
|
|
5
4
|
import { fixedForwardRef } from '../utils/modern-polymorphic.js';
|
|
6
5
|
import { jsx } from 'react/jsx-runtime';
|
|
7
|
-
import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.js';
|
|
8
6
|
|
|
9
7
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
8
|
function Text(props, ref) {
|
|
11
|
-
const $ = c(
|
|
9
|
+
const $ = c(15);
|
|
12
10
|
let className;
|
|
13
11
|
let rest;
|
|
14
12
|
let size;
|
|
@@ -36,8 +34,6 @@ function Text(props, ref) {
|
|
|
36
34
|
weight = $[5];
|
|
37
35
|
}
|
|
38
36
|
const Component = t0 === undefined ? "span" : t0;
|
|
39
|
-
const innerRef = React.useRef(null);
|
|
40
|
-
useRefObjectAsForwardedRef(ref, innerRef);
|
|
41
37
|
let t1;
|
|
42
38
|
if ($[6] !== className) {
|
|
43
39
|
t1 = clsx(className, classes.Text);
|
|
@@ -47,22 +43,23 @@ function Text(props, ref) {
|
|
|
47
43
|
t1 = $[7];
|
|
48
44
|
}
|
|
49
45
|
let t2;
|
|
50
|
-
if ($[8] !== Component || $[9] !==
|
|
46
|
+
if ($[8] !== Component || $[9] !== ref || $[10] !== rest || $[11] !== size || $[12] !== t1 || $[13] !== weight) {
|
|
51
47
|
t2 = /*#__PURE__*/jsx(Component, {
|
|
52
48
|
className: t1,
|
|
53
49
|
"data-size": size,
|
|
54
50
|
"data-weight": weight,
|
|
55
51
|
...rest,
|
|
56
|
-
ref:
|
|
52
|
+
ref: ref
|
|
57
53
|
});
|
|
58
54
|
$[8] = Component;
|
|
59
|
-
$[9] =
|
|
60
|
-
$[10] =
|
|
61
|
-
$[11] =
|
|
62
|
-
$[12] =
|
|
63
|
-
$[13] =
|
|
55
|
+
$[9] = ref;
|
|
56
|
+
$[10] = rest;
|
|
57
|
+
$[11] = size;
|
|
58
|
+
$[12] = t1;
|
|
59
|
+
$[13] = weight;
|
|
60
|
+
$[14] = t2;
|
|
64
61
|
} else {
|
|
65
|
-
t2 = $[
|
|
62
|
+
t2 = $[14];
|
|
66
63
|
}
|
|
67
64
|
return t2;
|
|
68
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScrollFlash.d.ts","sourceRoot":"","sources":["../../src/hooks/useScrollFlash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,kBAAkB,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"useScrollFlash.d.ts","sourceRoot":"","sources":["../../src/hooks/useScrollFlash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,kBAAkB,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,QAe7F"}
|
|
@@ -15,13 +15,11 @@ function useScrollFlash(scrollContainerRef) {
|
|
|
15
15
|
if (!scrollContainer) {
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
24
|
-
return () => cancelAnimationFrame(id);
|
|
18
|
+
const currentScroll = scrollContainer.scrollTop;
|
|
19
|
+
const maxScroll = scrollContainer.scrollHeight;
|
|
20
|
+
const altScroll = currentScroll < Math.min(1, maxScroll) ? currentScroll + 1 : currentScroll - 1;
|
|
21
|
+
scrollContainer.scrollTop = altScroll;
|
|
22
|
+
scrollContainer.scrollTop = currentScroll;
|
|
25
23
|
};
|
|
26
24
|
t1 = [scrollContainerRef];
|
|
27
25
|
$[0] = scrollContainerRef;
|
package/package.json
CHANGED