@primer/react 0.0.0-20260220144739 → 0.0.0-20260220145113
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 -1
- package/dist/Text/Text.d.ts +1 -1
- package/dist/Text/Text.d.ts.map +1 -1
- package/dist/Text/Text.js +10 -13
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @primer/react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-20260220145113
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
- [#7547](https://github.com/primer/react/pull/7547) [`4943d67`](https://github.com/primer/react/commit/4943d671ddb590461e59f9745e6093d47e770f7a) Thanks [@hectahertz](https://github.com/hectahertz)! - perf(useScrollFlash): defer scroll read/write to requestAnimationFrame to avoid forced reflow
|
|
12
12
|
|
|
13
|
+
- [#7551](https://github.com/primer/react/pull/7551) [`2fbfc49`](https://github.com/primer/react/commit/2fbfc49fad6f11edc51850e32e9c0b2ade8ca1f1) Thanks [@hectahertz](https://github.com/hectahertz)! - perf(Text): remove unnecessary useRef and useImperativeHandle hooks
|
|
14
|
+
|
|
13
15
|
- [#7553](https://github.com/primer/react/pull/7553) [`6225ba2`](https://github.com/primer/react/commit/6225ba231cfdbe6ef7fa41dd62734d5a970bdc7d) Thanks [@hectahertz](https://github.com/hectahertz)! - perf(useRefObjectAsForwardedRef): add dependency array to useImperativeHandle
|
|
14
16
|
|
|
15
17
|
## 38.13.0
|
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
|
}
|
package/package.json
CHANGED