@primer/react 38.19.0-rc.f3b0d9cc2 → 38.19.0-rc.f678a3d2b

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
@@ -4,12 +4,18 @@
4
4
 
5
5
  ### Minor Changes
6
6
 
7
- - [#7686](https://github.com/primer/react/pull/7686) [`6cd13c0`](https://github.com/primer/react/commit/6cd13c03a0293732af6d9499f1f925bf7d95d82b) Thanks [@JelloBagel](https://github.com/JelloBagel)! - StateLabel: Add new type: `archived`
8
-
9
7
  - [#7677](https://github.com/primer/react/pull/7677) [`c1a81b1`](https://github.com/primer/react/commit/c1a81b178742ba547b85a3df3ed3c27bcff6b7c5) Thanks [@TylerJDev](https://github.com/TylerJDev)! - AnchoredOverlay: Add Popover API to AnchoredOverlay (behind `primer_react_css_anchor_positioning` feature flag)
10
8
 
9
+ - [#7697](https://github.com/primer/react/pull/7697) [`990ce7b`](https://github.com/primer/react/commit/990ce7b625bcf90ef3867e93086d0c74835a9068) Thanks [@hectahertz](https://github.com/hectahertz)! - **Stack**: Add `tight` (4px) and `cozy` (12px) spacing values to `gap` and `padding` props. Add `paddingBlock` and `paddingInline` props for directional padding control.
10
+
11
11
  ### Patch Changes
12
12
 
13
+ - [#7652](https://github.com/primer/react/pull/7652) [`5d19e2b`](https://github.com/primer/react/commit/5d19e2bb5bbd444f2e82d98eef300c221863941c) Thanks [@owenniblock](https://github.com/owenniblock)! - useAnchoredPosition: recalculate overlay position when any scrollable ancestor (or the window) is scrolled.
14
+
15
+ - [#7707](https://github.com/primer/react/pull/7707) [`6431bfe`](https://github.com/primer/react/commit/6431bfecd72e24db1dfa90b02f8a42834e63843b) Thanks [@liuliu-dev](https://github.com/liuliu-dev)! - Fix anchor-name not being set on the anchor element when SelectPanel is opened in Copilot code agent.
16
+
17
+ - [#7638](https://github.com/primer/react/pull/7638) [`f04e85d`](https://github.com/primer/react/commit/f04e85df536cd6e8047f70b070bd3cf7c0961f92) Thanks [@iansan5653](https://github.com/iansan5653)! - Update internal implementations of combined refs to improve performance and add support for React 19 callback refs
18
+
13
19
  - [#7695](https://github.com/primer/react/pull/7695) [`780fc3d`](https://github.com/primer/react/commit/780fc3d7b52fd0f9b63f313af6355398180a0118) Thanks [@mattcosta7](https://github.com/mattcosta7)! - perf(ThemeProvider): Reduce unnecessary renders and effect cascades
14
20
 
15
21
  - Replace `useState` + `useEffect` SSR hydration handoff with `useSyncExternalStore` — eliminates post-hydration re-render
@@ -17,6 +23,8 @@
17
23
  - Cache `getServerHandoff` DOM read + JSON.parse per ID (runs once, not on every call)
18
24
  - Memoize context value object to prevent unnecessary re-renders of all consumers
19
25
 
26
+ - [#7706](https://github.com/primer/react/pull/7706) [`fd8910a`](https://github.com/primer/react/commit/fd8910abff851f43d19805ceaa439a9a18c4f226) Thanks [@liuliu-dev](https://github.com/liuliu-dev)! - ActionList.Item: fix inline descriptions being referenced via `aria-labelledby` instead of `aria-describedby`
27
+
20
28
  ## 38.18.0
21
29
 
22
30
  ### Minor Changes
@@ -10,7 +10,7 @@ import styles from './ActionBar.module.css.js';
10
10
  import { clsx } from 'clsx';
11
11
  import { createDescendantRegistry } from '../utils/descendant-registry.js';
12
12
  import { jsxs, jsx } from 'react/jsx-runtime';
13
- import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.js';
13
+ import { useMergedRefs } from '../hooks/useMergedRefs.js';
14
14
  import { FocusKeys } from '@primer/behaviors';
15
15
  import { ActionMenu } from '../ActionMenu/ActionMenu.js';
16
16
 
@@ -423,7 +423,7 @@ const ActionBarIconButton = /*#__PURE__*/forwardRef(({
423
423
  ...props
424
424
  }, forwardedRef) => {
425
425
  const ref = useRef(null);
426
- useRefObjectAsForwardedRef(forwardedRef, ref);
426
+ const mergedRef = useMergedRefs(ref, forwardedRef);
427
427
  const {
428
428
  size,
429
429
  isVisibleChild
@@ -453,7 +453,7 @@ const ActionBarIconButton = /*#__PURE__*/forwardRef(({
453
453
  if (!isVisibleChild(id) || groupId && !isVisibleChild(groupId)) return null;
454
454
  return /*#__PURE__*/jsx(IconButton, {
455
455
  "aria-disabled": disabled,
456
- ref: ref,
456
+ ref: mergedRef,
457
457
  size: size,
458
458
  onClick: clickHandler,
459
459
  ...props,
@@ -7,12 +7,12 @@ import { invariant } from '../utils/invariant.js';
7
7
  import { clsx } from 'clsx';
8
8
  import classes from './Heading.module.css.js';
9
9
  import { jsx } from 'react/jsx-runtime';
10
- import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.js';
10
+ import { useMergedRefs } from '../hooks/useMergedRefs.js';
11
11
  import Heading$1 from '../Heading/Heading.js';
12
12
 
13
13
  const Heading = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
14
14
  var _props$id;
15
- const $ = c(20);
15
+ const $ = c(21);
16
16
  let as;
17
17
  let children;
18
18
  let className;
@@ -45,7 +45,7 @@ const Heading = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
45
45
  }
46
46
  const visuallyHidden = t1 === undefined ? false : t1;
47
47
  const innerRef = React.useRef(null);
48
- useRefObjectAsForwardedRef(forwardedRef, innerRef);
48
+ const mergedRef = useMergedRefs(forwardedRef, innerRef);
49
49
  const {
50
50
  headingId,
51
51
  variant: listVariant
@@ -65,11 +65,11 @@ const Heading = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
65
65
  t4 = $[8];
66
66
  }
67
67
  let t5;
68
- if ($[9] !== as || $[10] !== children || $[11] !== listVariant || $[12] !== props || $[13] !== size || $[14] !== t3 || $[15] !== t4) {
68
+ if ($[9] !== as || $[10] !== children || $[11] !== listVariant || $[12] !== mergedRef || $[13] !== props || $[14] !== size || $[15] !== t3 || $[16] !== t4) {
69
69
  t5 = /*#__PURE__*/jsx(Heading$1, {
70
70
  as: as,
71
71
  variant: size,
72
- ref: innerRef,
72
+ ref: mergedRef,
73
73
  id: t3,
74
74
  className: t4,
75
75
  "data-list-variant": listVariant,
@@ -79,25 +79,26 @@ const Heading = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
79
79
  $[9] = as;
80
80
  $[10] = children;
81
81
  $[11] = listVariant;
82
- $[12] = props;
83
- $[13] = size;
84
- $[14] = t3;
85
- $[15] = t4;
86
- $[16] = t5;
82
+ $[12] = mergedRef;
83
+ $[13] = props;
84
+ $[14] = size;
85
+ $[15] = t3;
86
+ $[16] = t4;
87
+ $[17] = t5;
87
88
  } else {
88
- t5 = $[16];
89
+ t5 = $[17];
89
90
  }
90
91
  let t6;
91
- if ($[17] !== t2 || $[18] !== t5) {
92
+ if ($[18] !== t2 || $[19] !== t5) {
92
93
  t6 = /*#__PURE__*/jsx(VisuallyHidden, {
93
94
  isVisible: t2,
94
95
  children: t5
95
96
  });
96
- $[17] = t2;
97
- $[18] = t5;
98
- $[19] = t6;
97
+ $[18] = t2;
98
+ $[19] = t5;
99
+ $[20] = t6;
99
100
  } else {
100
- t6 = $[19];
101
+ t6 = $[20];
101
102
  }
102
103
  return t6;
103
104
  });