@primer/react 0.0.0-20260218171929 → 0.0.0-20260218180138

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,6 +1,6 @@
1
1
  # @primer/react
2
2
 
3
- ## 0.0.0-20260218171929
3
+ ## 0.0.0-20260218180138
4
4
 
5
5
  ### Minor Changes
6
6
 
@@ -8,12 +8,22 @@
8
8
 
9
9
  ### Patch Changes
10
10
 
11
+ - [#7537](https://github.com/primer/react/pull/7537) [`4fd987c`](https://github.com/primer/react/commit/4fd987c4194f51dc7e66f16895542a1e4678bde7) Thanks [@hectahertz](https://github.com/hectahertz)! - perf(ActionList): enable React Compiler
12
+
13
+ - [#7546](https://github.com/primer/react/pull/7546) [`86d6897`](https://github.com/primer/react/commit/86d68971a602be6c99535eb01227bf48dd87cfdc) Thanks [@hectahertz](https://github.com/hectahertz)! - perf(Announce): skip getComputedStyle when there is no text content to announce
14
+
11
15
  - [#7504](https://github.com/primer/react/pull/7504) [`d91e78e`](https://github.com/primer/react/commit/d91e78e8d1e69915222354b95d09d93d269dbd8b) Thanks [@TylerJDev](https://github.com/TylerJDev)! - UnderlineNav: Adds `overflow: hidden` when the "More" button isn't present
12
16
 
13
- - [#7526](https://github.com/primer/react/pull/7526) [`98f1732`](https://github.com/primer/react/commit/98f1732118432573aec01d4181bf11200d2a1b0c) Thanks [@hectahertz](https://github.com/hectahertz)! - Add `content-visibility: auto` to ActionList items to improve rendering performance for large lists by allowing the browser to skip layout and paint for off-screen items.
17
+ - [#7526](https://github.com/primer/react/pull/7526) [`0c2358a`](https://github.com/primer/react/commit/0c2358aa12a409f7cbcf15ce4fd41cbb9eee4b6c) Thanks [@hectahertz](https://github.com/hectahertz)! - Add `content-visibility: auto` to ActionList items to improve rendering performance for large lists by allowing the browser to skip layout and paint for off-screen items.
14
18
 
15
19
  - Fake entry to force publishing
16
20
 
21
+ - [#7498](https://github.com/primer/react/pull/7498) [`0c19492`](https://github.com/primer/react/commit/0c19492ec6fea2b35746307dd0cf8f3ab0746d99) Thanks [@hectahertz](https://github.com/hectahertz)! - Remove render phase setStates on SelectPanel
22
+
23
+ - [#7548](https://github.com/primer/react/pull/7548) [`d4b32c3`](https://github.com/primer/react/commit/d4b32c3672d3d5421711324654c1028527dcdf38) Thanks [@hectahertz](https://github.com/hectahertz)! - perf(useIsMacOS): replace useState+useEffect with useSyncExternalStore to eliminate unnecessary re-render
24
+
25
+ - [#7497](https://github.com/primer/react/pull/7497) [`0b696cc`](https://github.com/primer/react/commit/0b696cc75435b01aacc15e81396fe26e5901c01b) Thanks [@hectahertz](https://github.com/hectahertz)! - Improve SelectPanel performance
26
+
17
27
  ## 38.12.0
18
28
 
19
29
  ### Minor Changes
@@ -1,3 +1,4 @@
1
+ import { c } from 'react-compiler-runtime';
1
2
  import React from 'react';
2
3
  import { ItemContext } from './shared.js';
3
4
  import classes from './ActionList.module.css.js';
@@ -5,48 +6,125 @@ import { clsx } from 'clsx';
5
6
  import { jsx } from 'react/jsx-runtime';
6
7
  import Truncate from '../Truncate/Truncate.js';
7
8
 
8
- const Description = ({
9
- variant = 'inline',
10
- className,
11
- truncate,
12
- style,
13
- ...props
14
- }) => {
9
+ const Description = t0 => {
10
+ const $ = c(26);
11
+ let className;
12
+ let props;
13
+ let style;
14
+ let t1;
15
+ let truncate;
16
+ if ($[0] !== t0) {
17
+ ({
18
+ variant: t1,
19
+ className,
20
+ truncate,
21
+ style,
22
+ ...props
23
+ } = t0);
24
+ $[0] = t0;
25
+ $[1] = className;
26
+ $[2] = props;
27
+ $[3] = style;
28
+ $[4] = t1;
29
+ $[5] = truncate;
30
+ } else {
31
+ className = $[1];
32
+ props = $[2];
33
+ style = $[3];
34
+ t1 = $[4];
35
+ truncate = $[5];
36
+ }
37
+ const variant = t1 === undefined ? "inline" : t1;
15
38
  const {
16
39
  blockDescriptionId,
17
40
  inlineDescriptionId
18
41
  } = React.useContext(ItemContext);
19
42
  const containerRef = React.useRef(null);
20
- const [computedTitle, setComputedTitle] = React.useState('');
21
-
22
- // Extract text content from rendered DOM for tooltip
23
- React.useEffect(() => {
24
- if (truncate && containerRef.current) {
25
- const textContent = containerRef.current.textContent || '';
26
- setComputedTitle(textContent);
43
+ const [computedTitle, setComputedTitle] = React.useState("");
44
+ let t2;
45
+ if ($[6] !== truncate) {
46
+ t2 = () => {
47
+ if (truncate && containerRef.current) {
48
+ const textContent = containerRef.current.textContent || "";
49
+ setComputedTitle(textContent);
50
+ }
51
+ };
52
+ $[6] = truncate;
53
+ $[7] = t2;
54
+ } else {
55
+ t2 = $[7];
56
+ }
57
+ let t3;
58
+ if ($[8] !== props.children || $[9] !== truncate) {
59
+ t3 = [truncate, props.children];
60
+ $[8] = props.children;
61
+ $[9] = truncate;
62
+ $[10] = t3;
63
+ } else {
64
+ t3 = $[10];
65
+ }
66
+ React.useEffect(t2, t3);
67
+ const effectiveTitle = typeof props.children === "string" ? props.children : computedTitle;
68
+ if (variant === "block" || !truncate) {
69
+ const t4 = variant === "block" ? blockDescriptionId : inlineDescriptionId;
70
+ let t5;
71
+ if ($[11] !== className) {
72
+ t5 = clsx(className, classes.Description);
73
+ $[11] = className;
74
+ $[12] = t5;
75
+ } else {
76
+ t5 = $[12];
77
+ }
78
+ let t6;
79
+ if ($[13] !== props.children || $[14] !== style || $[15] !== t4 || $[16] !== t5) {
80
+ t6 = /*#__PURE__*/jsx("span", {
81
+ id: t4,
82
+ className: t5,
83
+ style: style,
84
+ "data-component": "ActionList.Description",
85
+ children: props.children
86
+ });
87
+ $[13] = props.children;
88
+ $[14] = style;
89
+ $[15] = t4;
90
+ $[16] = t5;
91
+ $[17] = t6;
92
+ } else {
93
+ t6 = $[17];
27
94
  }
28
- }, [truncate, props.children]);
29
- const effectiveTitle = typeof props.children === 'string' ? props.children : computedTitle;
30
- if (variant === 'block' || !truncate) {
31
- return /*#__PURE__*/jsx("span", {
32
- id: variant === 'block' ? blockDescriptionId : inlineDescriptionId,
33
- className: clsx(className, classes.Description),
34
- style: style,
35
- "data-component": "ActionList.Description",
36
- children: props.children
37
- });
95
+ return t6;
38
96
  } else {
39
- return /*#__PURE__*/jsx(Truncate, {
40
- ref: containerRef,
41
- id: inlineDescriptionId,
42
- className: clsx(className, classes.Description),
43
- style: style,
44
- title: effectiveTitle,
45
- inline: true,
46
- maxWidth: "100%",
47
- "data-component": "ActionList.Description",
48
- children: props.children
49
- });
97
+ let t4;
98
+ if ($[18] !== className) {
99
+ t4 = clsx(className, classes.Description);
100
+ $[18] = className;
101
+ $[19] = t4;
102
+ } else {
103
+ t4 = $[19];
104
+ }
105
+ let t5;
106
+ if ($[20] !== effectiveTitle || $[21] !== inlineDescriptionId || $[22] !== props.children || $[23] !== style || $[24] !== t4) {
107
+ t5 = /*#__PURE__*/jsx(Truncate, {
108
+ ref: containerRef,
109
+ id: inlineDescriptionId,
110
+ className: t4,
111
+ style: style,
112
+ title: effectiveTitle,
113
+ inline: true,
114
+ maxWidth: "100%",
115
+ "data-component": "ActionList.Description",
116
+ children: props.children
117
+ });
118
+ $[20] = effectiveTitle;
119
+ $[21] = inlineDescriptionId;
120
+ $[22] = props.children;
121
+ $[23] = style;
122
+ $[24] = t4;
123
+ $[25] = t5;
124
+ } else {
125
+ t5 = $[25];
126
+ }
127
+ return t5;
50
128
  }
51
129
  };
52
130
  Description.__SLOT__ = Symbol('ActionList.Description');
@@ -1,3 +1,4 @@
1
+ import { c } from 'react-compiler-runtime';
1
2
  import { clsx } from 'clsx';
2
3
  import classes from './ActionList.module.css.js';
3
4
  import { jsx } from 'react/jsx-runtime';
@@ -5,18 +6,36 @@ import { jsx } from 'react/jsx-runtime';
5
6
  /**
6
7
  * Visually separates `Items` or `Groups` in an `ActionList`.
7
8
  */
8
- const Divider = ({
9
- className,
10
- style
11
- }) => {
12
- return /*#__PURE__*/jsx("li", {
13
- className: clsx(className, classes.Divider),
14
- style: style,
15
- "aria-hidden": "true",
16
- "data-component": "ActionList.Divider"
17
- });
9
+ const Divider = t0 => {
10
+ const $ = c(5);
11
+ const {
12
+ className,
13
+ style
14
+ } = t0;
15
+ let t1;
16
+ if ($[0] !== className) {
17
+ t1 = clsx(className, classes.Divider);
18
+ $[0] = className;
19
+ $[1] = t1;
20
+ } else {
21
+ t1 = $[1];
22
+ }
23
+ let t2;
24
+ if ($[2] !== style || $[3] !== t1) {
25
+ t2 = /*#__PURE__*/jsx("li", {
26
+ className: t1,
27
+ style: style,
28
+ "aria-hidden": "true",
29
+ "data-component": "ActionList.Divider"
30
+ });
31
+ $[2] = style;
32
+ $[3] = t1;
33
+ $[4] = t2;
34
+ } else {
35
+ t2 = $[4];
36
+ }
37
+ return t2;
18
38
  };
19
- Divider.displayName = "Divider";
20
39
  Divider.__SLOT__ = Symbol('ActionList.Divider');
21
40
 
22
41
  export { Divider };