@primer/react 0.0.0-20260707200444 → 0.0.0-20260707201514
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-
|
|
3
|
+
## 0.0.0-20260707201514
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
|
|
22
22
|
- [#8115](https://github.com/primer/react/pull/8115) [`07c530a`](https://github.com/primer/react/commit/07c530a1686ef16b68b2f2fe692b7a3327bdc02b) Thanks [@mattcosta7](https://github.com/mattcosta7)! - Improve rendering performance in Safari by removing expensive `:has()` selectors from ActionList/NavList, Breadcrumbs, SelectPanel, and SegmentedControl. No visual or API changes.
|
|
23
23
|
|
|
24
|
-
- [#
|
|
24
|
+
- [#8025](https://github.com/primer/react/pull/8025) [`5abc62f`](https://github.com/primer/react/commit/5abc62f90cac33cd67396d78f01bf91b703db45c) Thanks [@mattcosta7](https://github.com/mattcosta7)! - SelectPanel: Reset the single-select modal's intermediate selection during render instead of in an effect, avoiding an extra re-render when the panel opens or the selection changes.
|
|
25
25
|
|
|
26
|
-
- [#
|
|
26
|
+
- [#8035](https://github.com/primer/react/pull/8035) [`723f4d6`](https://github.com/primer/react/commit/723f4d6db12710e2b94f56b945a937158fcbb127) Thanks [@mattcosta7](https://github.com/mattcosta7)! - UnderlineNav, ActionBar: Detect item overflow with a single shared IntersectionObserver per component instead of one observer per item, reducing observer churn during resize. No public API changes.
|
|
27
27
|
|
|
28
28
|
## 38.31.0
|
|
29
29
|
|
|
@@ -99,13 +99,20 @@ function Panel({ open, onOpenChange, renderAnchor = defaultRenderAnchor, anchorR
|
|
|
99
99
|
const selectedValueId = id ? `${id}-selected-value` : void 0;
|
|
100
100
|
const isSingleSelectModal = variant === "modal" && !isMultiSelectVariant(selected);
|
|
101
101
|
const [intermediateSelected, setIntermediateSelected] = useState(isSingleSelectModal ? selected : void 0);
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}, [
|
|
105
|
-
isSingleSelectModal,
|
|
102
|
+
const nextIntermediateSelected = isSingleSelectModal ? selected : void 0;
|
|
103
|
+
const [intermediateSelectedResetKey, setIntermediateSelectedResetKey] = useState({
|
|
106
104
|
open,
|
|
107
|
-
selected
|
|
108
|
-
|
|
105
|
+
selected,
|
|
106
|
+
isSingleSelectModal
|
|
107
|
+
});
|
|
108
|
+
if (intermediateSelectedResetKey.open !== open || intermediateSelectedResetKey.selected !== selected || intermediateSelectedResetKey.isSingleSelectModal !== isSingleSelectModal) {
|
|
109
|
+
setIntermediateSelectedResetKey({
|
|
110
|
+
open,
|
|
111
|
+
selected,
|
|
112
|
+
isSingleSelectModal
|
|
113
|
+
});
|
|
114
|
+
if (intermediateSelected !== nextIntermediateSelected) setIntermediateSelected(nextIntermediateSelected);
|
|
115
|
+
}
|
|
109
116
|
const onListContainerRefChanged = useCallback((node) => {
|
|
110
117
|
setListContainerElement(node);
|
|
111
118
|
if (!node && needsNoItemsAnnouncement) setNeedsNoItemsAnnouncement(false);
|
|
@@ -1,44 +1,40 @@
|
|
|
1
1
|
import ValidationAnimationContainer_module_css_default from "./ValidationAnimationContainer.module.css.js";
|
|
2
2
|
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { useState } from "react";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
5
|
//#region src/internal/components/ValidationAnimationContainer.tsx
|
|
6
6
|
const ValidationAnimationContainer = (t0) => {
|
|
7
|
-
const $ = c(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
let show;
|
|
11
|
-
let style;
|
|
12
|
-
if ($[0] !== t0) {
|
|
13
|
-
({show, children, style, ...rest} = t0);
|
|
14
|
-
$[0] = t0;
|
|
15
|
-
$[1] = children;
|
|
16
|
-
$[2] = rest;
|
|
17
|
-
$[3] = show;
|
|
18
|
-
$[4] = style;
|
|
19
|
-
} else {
|
|
20
|
-
children = $[1];
|
|
21
|
-
rest = $[2];
|
|
22
|
-
show = $[3];
|
|
23
|
-
style = $[4];
|
|
24
|
-
}
|
|
25
|
-
const [shouldRender, setRender] = useState(Boolean(show));
|
|
26
|
-
if (show && !shouldRender) setRender(true);
|
|
7
|
+
const $ = c(10);
|
|
8
|
+
const { show, children } = t0;
|
|
9
|
+
const [shouldRender, setRender] = useState(show);
|
|
27
10
|
let t1;
|
|
28
|
-
|
|
11
|
+
let t2;
|
|
12
|
+
if ($[0] !== show) {
|
|
29
13
|
t1 = () => {
|
|
14
|
+
if (show) setRender(true);
|
|
15
|
+
};
|
|
16
|
+
t2 = [show];
|
|
17
|
+
$[0] = show;
|
|
18
|
+
$[1] = t1;
|
|
19
|
+
$[2] = t2;
|
|
20
|
+
} else {
|
|
21
|
+
t1 = $[1];
|
|
22
|
+
t2 = $[2];
|
|
23
|
+
}
|
|
24
|
+
useEffect(t1, t2);
|
|
25
|
+
let t3;
|
|
26
|
+
if ($[3] !== show) {
|
|
27
|
+
t3 = () => {
|
|
30
28
|
if (!show) setRender(false);
|
|
31
29
|
};
|
|
32
|
-
$[
|
|
33
|
-
$[
|
|
34
|
-
} else
|
|
35
|
-
const onAnimationEnd =
|
|
36
|
-
let
|
|
37
|
-
if ($[
|
|
38
|
-
|
|
39
|
-
...rest,
|
|
30
|
+
$[3] = show;
|
|
31
|
+
$[4] = t3;
|
|
32
|
+
} else t3 = $[4];
|
|
33
|
+
const onAnimationEnd = t3;
|
|
34
|
+
let t4;
|
|
35
|
+
if ($[5] !== children || $[6] !== onAnimationEnd || $[7] !== shouldRender || $[8] !== show) {
|
|
36
|
+
t4 = shouldRender ? /*#__PURE__*/ jsx("div", {
|
|
40
37
|
style: {
|
|
41
|
-
...style,
|
|
42
38
|
height: show ? "auto" : 0,
|
|
43
39
|
overflow: "hidden"
|
|
44
40
|
},
|
|
@@ -49,15 +45,13 @@ const ValidationAnimationContainer = (t0) => {
|
|
|
49
45
|
children
|
|
50
46
|
})
|
|
51
47
|
}) : null;
|
|
52
|
-
$[
|
|
53
|
-
$[
|
|
54
|
-
$[
|
|
55
|
-
$[
|
|
56
|
-
$[
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
} else t2 = $[13];
|
|
60
|
-
return t2;
|
|
48
|
+
$[5] = children;
|
|
49
|
+
$[6] = onAnimationEnd;
|
|
50
|
+
$[7] = shouldRender;
|
|
51
|
+
$[8] = show;
|
|
52
|
+
$[9] = t4;
|
|
53
|
+
} else t4 = $[9];
|
|
54
|
+
return t4;
|
|
61
55
|
};
|
|
62
56
|
//#endregion
|
|
63
57
|
export { ValidationAnimationContainer as default };
|
package/package.json
CHANGED