@primer/react 0.0.0-20260317202557 → 0.0.0-20260317220318

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +7 -8
  2. package/dist/Autocomplete/AutocompleteInput.js +3 -3
  3. package/dist/Autocomplete/AutocompleteOverlay.js +3 -3
  4. package/dist/Banner/Banner.js +1 -1
  5. package/dist/Button/ButtonBase.d.ts.map +1 -1
  6. package/dist/Button/ButtonBase.js +4 -3
  7. package/dist/Details/Details.js +1 -1
  8. package/dist/Dialog/Dialog.js +3 -3
  9. package/dist/Heading/Heading.js +3 -3
  10. package/dist/Link/Link.d.ts.map +1 -1
  11. package/dist/Link/Link.js +4 -3
  12. package/dist/Overlay/Overlay.js +19 -20
  13. package/dist/PageLayout/PageLayout.js +5 -5
  14. package/dist/TextInputWithTokens/TextInputWithTokens.js +90 -91
  15. package/dist/Timeline/Timeline-4d67684a.css +2 -0
  16. package/dist/Timeline/Timeline-4d67684a.css.map +1 -0
  17. package/dist/Timeline/Timeline.d.ts +1 -1
  18. package/dist/Timeline/Timeline.d.ts.map +1 -1
  19. package/dist/Timeline/Timeline.js +27 -14
  20. package/dist/Timeline/Timeline.module.css.js +1 -1
  21. package/dist/deprecated/DialogV1/Dialog.js +9 -10
  22. package/dist/hooks/index.d.ts +0 -1
  23. package/dist/hooks/index.d.ts.map +1 -1
  24. package/dist/hooks/useProvidedRefOrCreate.d.ts +0 -12
  25. package/dist/hooks/useProvidedRefOrCreate.d.ts.map +1 -1
  26. package/dist/hooks/useProvidedRefOrCreate.js +0 -12
  27. package/dist/hooks/useRefObjectAsForwardedRef.d.ts +0 -12
  28. package/dist/hooks/useRefObjectAsForwardedRef.d.ts.map +1 -1
  29. package/dist/hooks/useRefObjectAsForwardedRef.js +0 -12
  30. package/dist/index.d.ts +0 -1
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +0 -1
  33. package/dist/internal/hooks/useMergedRefs.d.ts +2 -0
  34. package/dist/internal/hooks/useMergedRefs.d.ts.map +1 -0
  35. package/dist/internal/hooks/useMergedRefs.js +16 -0
  36. package/generated/components.json +10 -2
  37. package/generated/hooks.json +0 -22
  38. package/package.json +1 -1
  39. package/dist/Timeline/Timeline-19bef8c5.css +0 -2
  40. package/dist/Timeline/Timeline-19bef8c5.css.map +0 -1
  41. package/dist/hooks/useMergedRefs.d.ts +0 -51
  42. package/dist/hooks/useMergedRefs.d.ts.map +0 -1
  43. package/dist/hooks/useMergedRefs.js +0 -86
package/CHANGELOG.md CHANGED
@@ -1,21 +1,20 @@
1
1
  # @primer/react
2
2
 
3
- ## 0.0.0-20260317202557
3
+ ## 0.0.0-20260317220318
4
4
 
5
5
  ### Minor Changes
6
6
 
7
- - [#7638](https://github.com/primer/react/pull/7638) [`973f184`](https://github.com/primer/react/commit/973f184c7ed18526c786404376c11f2df71f2e54) Thanks [@iansan5653](https://github.com/iansan5653)! - - New: Exposes new `useMergedRefs` hook that can merge two refs into a single combined ref
7
+ - [#7662](https://github.com/primer/react/pull/7662) [`65aae79`](https://github.com/primer/react/commit/65aae796f40cfa462e1f49944e553515787b3c6b) Thanks [@copilot-swe-agent](https://github.com/apps/copilot-swe-agent)! - Timeline: Update `clipSidebar` prop to accept `'start'`, `'end'`, or `'both'` in addition to `boolean`. Use `'start'` to only clip the top, `'end'` to only clip the bottom, or `'both'`/`true` to clip both ends.
8
8
 
9
- - Deprecates `useRefObjectAsForwardedRef`; see doc comment for migration instructions
10
- - Deprecates `useProvidedRefOrCreate`; see doc comment for migration instructions
9
+ ### Patch Changes
11
10
 
12
- - [#7661](https://github.com/primer/react/pull/7661) [`dceb79c`](https://github.com/primer/react/commit/dceb79c5e0f8ab5c25bbc9727bc3207fb77d520e) Thanks [@TylerJDev](https://github.com/TylerJDev)! - AnchoredOverlay: Add CSS Anchor Positioning to `AnchoredOverlay` (under a feature flag)
11
+ - Fake entry to force publishing
13
12
 
14
- ### Patch Changes
13
+ ## 38.16.0
15
14
 
16
- - [#7645](https://github.com/primer/react/pull/7645) [`bdb0e39`](https://github.com/primer/react/commit/bdb0e39d56bfb13ab3e321622402369251cc3207) Thanks [@copilot-swe-agent](https://github.com/apps/copilot-swe-agent)! - Update internal implementations of combined refs to improve performance and add support for React 19 callback refs
15
+ ### Minor Changes
17
16
 
18
- - Fake entry to force publishing
17
+ - [#7661](https://github.com/primer/react/pull/7661) [`dceb79c`](https://github.com/primer/react/commit/dceb79c5e0f8ab5c25bbc9727bc3207fb77d520e) Thanks [@TylerJDev](https://github.com/TylerJDev)! - AnchoredOverlay: Add CSS Anchor Positioning to `AnchoredOverlay` (under a feature flag)
19
18
 
20
19
  ## 38.15.1
21
20
 
@@ -1,6 +1,6 @@
1
1
  import React, { useContext, useState, useCallback, useEffect } from 'react';
2
2
  import { AutocompleteContext, AutocompleteInputContext } from './AutocompleteContext.js';
3
- import { useMergedRefs } from '../hooks/useMergedRefs.js';
3
+ import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.js';
4
4
  import useSafeTimeout from '../hooks/useSafeTimeout.js';
5
5
  import { jsx } from 'react/jsx-runtime';
6
6
  import TextInput from '../TextInput/TextInput.js';
@@ -36,7 +36,7 @@ const AutocompleteInput = /*#__PURE__*/React.forwardRef(({
36
36
  inputValue = '',
37
37
  isMenuDirectlyActivated
38
38
  } = inputContext;
39
- const mergedRef = useMergedRefs(forwardedRef, inputRef);
39
+ useRefObjectAsForwardedRef(forwardedRef, inputRef);
40
40
  const [highlightRemainingText, setHighlightRemainingText] = useState(true);
41
41
  const {
42
42
  safeSetTimeout
@@ -130,7 +130,7 @@ const AutocompleteInput = /*#__PURE__*/React.forwardRef(({
130
130
  onKeyDown: handleInputKeyDown,
131
131
  onKeyPress: onInputKeyPress,
132
132
  onKeyUp: handleInputKeyUp,
133
- ref: mergedRef,
133
+ ref: inputRef,
134
134
  "aria-controls": `${id}-listbox`,
135
135
  "aria-autocomplete": "both",
136
136
  role: "combobox",
@@ -1,6 +1,6 @@
1
1
  import { useContext, useRef, useEffect, useCallback } from 'react';
2
2
  import { AutocompleteContext } from './AutocompleteContext.js';
3
- import { useMergedRefs } from '../hooks/useMergedRefs.js';
3
+ import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.js';
4
4
  import VisuallyHidden from '../_VisuallyHidden.js';
5
5
  import classes from './AutocompleteOverlay.module.css.js';
6
6
  import { clsx } from 'clsx';
@@ -48,7 +48,7 @@ function AutocompleteOverlay({
48
48
  align: 'start',
49
49
  anchorElementRef: computedAnchorRef
50
50
  }, [showMenu, selectedItemLength]);
51
- const mergedRef = useMergedRefs(scrollContainerRef, floatingElementRef);
51
+ useRefObjectAsForwardedRef(scrollContainerRef, floatingElementRef);
52
52
  const closeOptionList = useCallback(() => {
53
53
  setShowMenu(false);
54
54
  }, [setShowMenu]);
@@ -60,7 +60,7 @@ function AutocompleteOverlay({
60
60
  preventFocusOnOpen: true,
61
61
  onClickOutside: closeOptionList,
62
62
  onEscape: closeOptionList,
63
- ref: mergedRef,
63
+ ref: floatingElementRef,
64
64
  top: position === null || position === void 0 ? void 0 : position.top,
65
65
  left: position === null || position === void 0 ? void 0 : position.left,
66
66
  className: clsx(classes.Overlay, className),
@@ -3,7 +3,7 @@ import React, { useEffect, forwardRef } from 'react';
3
3
  import { XIcon, AlertIcon, InfoIcon, CheckCircleIcon, StopIcon } from '@primer/octicons-react';
4
4
  import { IconButton } from '../Button/IconButton.js';
5
5
  import { ButtonComponent } from '../Button/Button.js';
6
- import { useMergedRefs } from '../hooks/useMergedRefs.js';
6
+ import { useMergedRefs } from '../internal/hooks/useMergedRefs.js';
7
7
  import { useId } from '../hooks/useId.js';
8
8
  import classes from './Banner.module.css.js';
9
9
  import { jsx, jsxs } from 'react/jsx-runtime';
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonBase.d.ts","sourceRoot":"","sources":["../../src/Button/ButtonBase.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAC/F,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,SAAS,CAAA;AA2BxC,QAAA,MAAM,UAAU,EA0JV,8BAA8B,CAAC,QAAQ,GAAG,GAAG,EAAE,WAAW,CAAC,CAAA;AAEjE,OAAO,EAAC,UAAU,EAAC,CAAA"}
1
+ {"version":3,"file":"ButtonBase.d.ts","sourceRoot":"","sources":["../../src/Button/ButtonBase.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAC/F,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,SAAS,CAAA;AA2BxC,QAAA,MAAM,UAAU,EA2JV,8BAA8B,CAAC,QAAQ,GAAG,GAAG,EAAE,WAAW,CAAC,CAAA;AAEjE,OAAO,EAAC,UAAU,EAAC,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import React, { forwardRef } from 'react';
2
- import { useMergedRefs } from '../hooks/useMergedRefs.js';
2
+ import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.js';
3
3
  import { ConditionalWrapper } from '../internal/components/ConditionalWrapper.js';
4
4
  import { clsx } from 'clsx';
5
5
  import classes from './ButtonBase.module.css.js';
@@ -46,7 +46,7 @@ const ButtonBase = /*#__PURE__*/forwardRef(({
46
46
  ...rest
47
47
  } = props;
48
48
  const innerRef = React.useRef(null);
49
- const combinedRefs = useMergedRefs(forwardedRef, innerRef);
49
+ useRefObjectAsForwardedRef(forwardedRef, innerRef);
50
50
  const uuid = useId(id);
51
51
  const loadingAnnouncementID = `${uuid}-loading-announcement`;
52
52
 
@@ -74,7 +74,8 @@ const ButtonBase = /*#__PURE__*/forwardRef(({
74
74
  children: [/*#__PURE__*/jsx(Component, {
75
75
  "aria-disabled": loading ? true : undefined,
76
76
  ...rest,
77
- ref: combinedRefs,
77
+ // @ts-ignore temporary disable as we migrate to css modules, until we remove PolymorphicForwardRefComponent
78
+ ref: innerRef,
78
79
  className: clsx(classes.ButtonBase, className),
79
80
  "data-block": block ? 'block' : null,
80
81
  "data-inactive": inactive ? true : undefined,
@@ -3,7 +3,7 @@ import React, { useEffect } from 'react';
3
3
  import { warning } from '../utils/warning.js';
4
4
  import { clsx } from 'clsx';
5
5
  import classes from './Details.module.css.js';
6
- import { useMergedRefs } from '../hooks/useMergedRefs.js';
6
+ import { useMergedRefs } from '../internal/hooks/useMergedRefs.js';
7
7
  import { jsx } from 'react/jsx-runtime';
8
8
 
9
9
  const Root = /*#__PURE__*/React.forwardRef(
@@ -6,7 +6,7 @@ import { XIcon } from '@primer/octicons-react';
6
6
  import { useFocusZone } from '../hooks/useFocusZone.js';
7
7
  import { FocusKeys } from '@primer/behaviors';
8
8
  import { Portal } from '../Portal/Portal.js';
9
- import { useMergedRefs } from '../hooks/useMergedRefs.js';
9
+ import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.js';
10
10
  import { useId } from '../hooks/useId.js';
11
11
  import classes from './Dialog.module.css.js';
12
12
  import { clsx } from 'clsx';
@@ -127,7 +127,7 @@ const _Dialog = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
127
127
  footer: Dialog.Footer
128
128
  });
129
129
  const dialogRef = useRef(null);
130
- const mergedRef = useMergedRefs(forwardedRef, dialogRef);
130
+ useRefObjectAsForwardedRef(forwardedRef, dialogRef);
131
131
  const backdropRef = useRef(null);
132
132
  useFocusTrap({
133
133
  containerRef: dialogRef,
@@ -190,7 +190,7 @@ const _Dialog = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
190
190
  setLastMouseDownIsBackdrop(e.target === e.currentTarget);
191
191
  },
192
192
  children: /*#__PURE__*/jsxs("div", {
193
- ref: mergedRef,
193
+ ref: dialogRef,
194
194
  role: role,
195
195
  "aria-labelledby": dialogLabelId,
196
196
  "aria-describedby": dialogDescriptionId,
@@ -2,7 +2,7 @@ import { clsx } from 'clsx';
2
2
  import React, { forwardRef, useEffect } from 'react';
3
3
  import classes from './Heading.module.css.js';
4
4
  import { jsx } from 'react/jsx-runtime';
5
- import { useMergedRefs } from '../hooks/useMergedRefs.js';
5
+ import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.js';
6
6
 
7
7
  const Heading = /*#__PURE__*/forwardRef(({
8
8
  as: Component = 'h2',
@@ -11,7 +11,7 @@ const Heading = /*#__PURE__*/forwardRef(({
11
11
  ...props
12
12
  }, forwardedRef) => {
13
13
  const innerRef = React.useRef(null);
14
- const mergedRef = useMergedRefs(forwardedRef, innerRef);
14
+ useRefObjectAsForwardedRef(forwardedRef, innerRef);
15
15
  if (process.env.NODE_ENV !== "production") {
16
16
  /**
17
17
  * The Linter yells because it thinks this conditionally calls an effect,
@@ -31,7 +31,7 @@ const Heading = /*#__PURE__*/forwardRef(({
31
31
  className: clsx(className, classes.Heading),
32
32
  "data-variant": variant,
33
33
  ...props,
34
- ref: mergedRef
34
+ ref: innerRef
35
35
  });
36
36
  });
37
37
  Heading.displayName = 'Heading';
@@ -1 +1 @@
1
- {"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/Link/Link.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAY,KAAK,YAAY,EAAkB,MAAM,OAAO,CAAA;AAG1E,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAC,KAAK,gBAAgB,EAAkB,MAAM,6BAA6B,CAAA;AAElF,KAAK,eAAe,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,GAAG,GAAG,IAAI;IACzD,EAAE,CAAC,EAAE,EAAE,CAAA;IACP,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,EAAE,SAAS,KAAK,CAAC,WAAW,GAAG,GAAG,EAC9D,OAAO,gBAAgB,CAAC,EAAE,EAAE,GAAG,EAAE,eAAe,CAAC,EACjD,KAAK,YAAY,CAAC,OAAO,CAAC,sBAwC3B,CAAA;AAID,QAAA,MAAM,IAAI,IA9CoB,EAAE,SAAS,KAAK,CAAC,WAAW;;;;CA8CM,CAAA;AAEhE,MAAM,MAAM,SAAS,GAAG,cAAc,CAAC,OAAO,IAAI,CAAC,CAAA;AACnD,eAAe,IAAI,CAAA"}
1
+ {"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/Link/Link.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAY,KAAK,YAAY,EAAkB,MAAM,OAAO,CAAA;AAG1E,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAC,KAAK,gBAAgB,EAAkB,MAAM,6BAA6B,CAAA;AAElF,KAAK,eAAe,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,GAAG,GAAG,IAAI;IACzD,EAAE,CAAC,EAAE,EAAE,CAAA;IACP,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,EAAE,SAAS,KAAK,CAAC,WAAW,GAAG,GAAG,EAC9D,OAAO,gBAAgB,CAAC,EAAE,EAAE,GAAG,EAAE,eAAe,CAAC,EACjD,KAAK,YAAY,CAAC,OAAO,CAAC,sBAyC3B,CAAA;AAID,QAAA,MAAM,IAAI,IA/CoB,EAAE,SAAS,KAAK,CAAC,WAAW;;;;CA+CM,CAAA;AAEhE,MAAM,MAAM,SAAS,GAAG,cAAc,CAAC,OAAO,IAAI,CAAC,CAAA;AACnD,eAAe,IAAI,CAAA"}
package/dist/Link/Link.js CHANGED
@@ -3,7 +3,7 @@ import React, { useEffect } from 'react';
3
3
  import classes from './Link.module.css.js';
4
4
  import { fixedForwardRef } from '../utils/modern-polymorphic.js';
5
5
  import { jsx } from 'react/jsx-runtime';
6
- import { useMergedRefs } from '../hooks/useMergedRefs.js';
6
+ import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.js';
7
7
 
8
8
  const UnwrappedLink = (props, ref) => {
9
9
  const {
@@ -14,7 +14,7 @@ const UnwrappedLink = (props, ref) => {
14
14
  ...restProps
15
15
  } = props;
16
16
  const innerRef = React.useRef(null);
17
- const mergedRef = useMergedRefs(ref, innerRef);
17
+ useRefObjectAsForwardedRef(ref, innerRef);
18
18
  if (process.env.NODE_ENV !== "production") {
19
19
  /**
20
20
  * The Linter yells because it thinks this conditionally calls an effect,
@@ -36,7 +36,8 @@ const UnwrappedLink = (props, ref) => {
36
36
  "data-inline": inline,
37
37
  "data-hover-color": hoverColor,
38
38
  ...restProps,
39
- ref: mergedRef
39
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
40
+ ref: innerRef
40
41
  });
41
42
  };
42
43
  UnwrappedLink.displayName = "UnwrappedLink";
@@ -2,7 +2,7 @@ import { c } from 'react-compiler-runtime';
2
2
  import React, { useRef, useEffect } from 'react';
3
3
  import useIsomorphicLayoutEffect from '../utils/useIsomorphicLayoutEffect.js';
4
4
  import { Portal } from '../Portal/Portal.js';
5
- import { useMergedRefs } from '../hooks/useMergedRefs.js';
5
+ import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.js';
6
6
  import classes from './Overlay.module.css.js';
7
7
  import { clsx } from 'clsx';
8
8
  import { jsx } from 'react/jsx-runtime';
@@ -116,7 +116,7 @@ const BaseOverlay = /*#__PURE__*/React.forwardRef(({
116
116
 
117
117
  */
118
118
  const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
119
- const $ = c(46);
119
+ const $ = c(45);
120
120
  let anchorSide;
121
121
  let ignoreClickRefs;
122
122
  let initialFocusRef;
@@ -198,7 +198,7 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
198
198
  const width = t5 === undefined ? "auto" : t5;
199
199
  const cssAnchorPositioning = useFeatureFlag("primer_react_css_anchor_positioning");
200
200
  const overlayRef = useRef(null);
201
- const mergedRef = useMergedRefs(forwardedRef, overlayRef);
201
+ useRefObjectAsForwardedRef(forwardedRef, overlayRef);
202
202
  let t6;
203
203
  if ($[18] !== ignoreClickRefs || $[19] !== initialFocusRef || $[20] !== onClickOutside || $[21] !== onEscape || $[22] !== preventFocusOnOpen || $[23] !== returnFocusRef) {
204
204
  t6 = {
@@ -271,12 +271,12 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
271
271
  const leftPosition = left === undefined && right === undefined ? 0 : left;
272
272
  const t11 = !preventOverflow ? true : undefined;
273
273
  let t12;
274
- if ($[32] !== height || $[33] !== leftPosition || $[34] !== mergedRef || $[35] !== props || $[36] !== responsiveVariant || $[37] !== right || $[38] !== role || $[39] !== t11 || $[40] !== visibility || $[41] !== width) {
274
+ if ($[32] !== height || $[33] !== leftPosition || $[34] !== props || $[35] !== responsiveVariant || $[36] !== right || $[37] !== role || $[38] !== t11 || $[39] !== visibility || $[40] !== width) {
275
275
  t12 = /*#__PURE__*/jsx(BaseOverlay, {
276
276
  role: role,
277
277
  width: width,
278
278
  "data-reflow-container": t11,
279
- ref: mergedRef,
279
+ ref: overlayRef,
280
280
  left: leftPosition,
281
281
  right: right,
282
282
  height: height,
@@ -286,33 +286,32 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
286
286
  });
287
287
  $[32] = height;
288
288
  $[33] = leftPosition;
289
- $[34] = mergedRef;
290
- $[35] = props;
291
- $[36] = responsiveVariant;
292
- $[37] = right;
293
- $[38] = role;
294
- $[39] = t11;
295
- $[40] = visibility;
296
- $[41] = width;
297
- $[42] = t12;
289
+ $[34] = props;
290
+ $[35] = responsiveVariant;
291
+ $[36] = right;
292
+ $[37] = role;
293
+ $[38] = t11;
294
+ $[39] = visibility;
295
+ $[40] = width;
296
+ $[41] = t12;
298
297
  } else {
299
- t12 = $[42];
298
+ t12 = $[41];
300
299
  }
301
300
  const overlayContent = t12;
302
301
  if (cssAnchorPositioning) {
303
302
  return overlayContent;
304
303
  }
305
304
  let t13;
306
- if ($[43] !== overlayContent || $[44] !== portalContainerName) {
305
+ if ($[42] !== overlayContent || $[43] !== portalContainerName) {
307
306
  t13 = /*#__PURE__*/jsx(Portal, {
308
307
  containerName: portalContainerName,
309
308
  children: overlayContent
310
309
  });
311
- $[43] = overlayContent;
312
- $[44] = portalContainerName;
313
- $[45] = t13;
310
+ $[42] = overlayContent;
311
+ $[43] = portalContainerName;
312
+ $[44] = t13;
314
313
  } else {
315
- t13 = $[45];
314
+ t13 = $[44];
316
315
  }
317
316
  return t13;
318
317
  });
@@ -1,7 +1,7 @@
1
1
  import React, { useRef, memo } from 'react';
2
2
  import { clsx } from 'clsx';
3
3
  import { useId } from '../hooks/useId.js';
4
- import { useMergedRefs } from '../hooks/useMergedRefs.js';
4
+ import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.js';
5
5
  import { isResponsiveValue } from '../hooks/useResponsiveValue.js';
6
6
  import { useSlots } from '../hooks/useSlots.js';
7
7
  import { useOverflow } from '../hooks/useOverflow.js';
@@ -581,7 +581,7 @@ const Pane = /*#__PURE__*/React.forwardRef(({
581
581
  onResizeEnd,
582
582
  currentWidth: controlledWidth
583
583
  });
584
- const mergedRef = useMergedRefs(forwardRef, paneRef);
584
+ useRefObjectAsForwardedRef(forwardRef, paneRef);
585
585
  const hasOverflow = useOverflow(paneRef);
586
586
  const paneId = useId(id);
587
587
  const labelProp = {};
@@ -615,7 +615,7 @@ const Pane = /*#__PURE__*/React.forwardRef(({
615
615
  },
616
616
  position: positionProp
617
617
  }), /*#__PURE__*/jsx("div", {
618
- ref: mergedRef
618
+ ref: paneRef
619
619
  // Suppress hydration mismatch for --pane-width when localStorage
620
620
  // provides a width that differs from the server-rendered default.
621
621
  // Not needed when onResizeEnd is provided (localStorage isn't read).
@@ -785,7 +785,7 @@ const Sidebar = /*#__PURE__*/React.forwardRef(({
785
785
  contentWrapperRef: sidebarContentWrapperRef,
786
786
  constrainToViewport: true
787
787
  });
788
- const mergedRef = useMergedRefs(forwardRef, sidebarRef);
788
+ useRefObjectAsForwardedRef(forwardRef, sidebarRef);
789
789
  const hasOverflow = useOverflow(sidebarRef);
790
790
  const sidebarId = useId(id);
791
791
  const labelProp = {};
@@ -824,7 +824,7 @@ const Sidebar = /*#__PURE__*/React.forwardRef(({
824
824
  getDefaultWidth: getDefaultWidth,
825
825
  saveWidth: saveWidth
826
826
  }), /*#__PURE__*/jsx("div", {
827
- ref: mergedRef
827
+ ref: sidebarRef
828
828
  // Suppress hydration mismatch for --pane-width when localStorage
829
829
  // provides a width that differs from the server-rendered default.
830
830
  ,
@@ -3,7 +3,7 @@ import { FocusKeys } from '@primer/behaviors';
3
3
  import { isFocusable } from '@primer/behaviors/utils';
4
4
  import React, { useRef, useState } from 'react';
5
5
  import { isValidElementType } from 'react-is';
6
- import { useMergedRefs } from '../hooks/useMergedRefs.js';
6
+ import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.js';
7
7
  import { useFocusZone } from '../hooks/useFocusZone.js';
8
8
  import { useId } from '../hooks/useId.js';
9
9
  import Token from '../Token/Token.js';
@@ -25,7 +25,7 @@ const overflowCountClassMap = {
25
25
 
26
26
  // using forwardRef is important so that other components (ex. Autocomplete) can use the ref
27
27
  function TextInputWithTokensInnerComponent(t0, forwardedRef) {
28
- const $ = c(152);
28
+ const $ = c(151);
29
29
  let IconComponent;
30
30
  let LeadingVisual;
31
31
  let TrailingVisual;
@@ -165,7 +165,7 @@ function TextInputWithTokensInnerComponent(t0, forwardedRef) {
165
165
  }
166
166
  const ref = useRef(null);
167
167
  const selectedValuesDescriptionId = useId();
168
- const mergedRef = useMergedRefs(forwardedRef, ref);
168
+ useRefObjectAsForwardedRef(forwardedRef, ref);
169
169
  const [selectedTokenIndex, setSelectedTokenIndex] = useState();
170
170
  const [tokensAreTruncated, setTokensAreTruncated] = useState(Boolean(visibleTokenCount));
171
171
  let t6;
@@ -455,9 +455,9 @@ function TextInputWithTokensInnerComponent(t0, forwardedRef) {
455
455
  const t32 = validationStatus === "error" ? "true" : "false";
456
456
  const t33 = ariaDescribedBy || undefined;
457
457
  let t34;
458
- if ($[80] !== disabled || $[81] !== handleInputBlur || $[82] !== handleInputFocus || $[83] !== handleInputKeyDown || $[84] !== inputPropsRest || $[85] !== mergedRef || $[86] !== role || $[87] !== t32 || $[88] !== t33) {
458
+ if ($[80] !== disabled || $[81] !== handleInputBlur || $[82] !== handleInputFocus || $[83] !== handleInputKeyDown || $[84] !== inputPropsRest || $[85] !== role || $[86] !== t32 || $[87] !== t33) {
459
459
  t34 = /*#__PURE__*/jsx(UnstyledTextInput, {
460
- ref: mergedRef,
460
+ ref: ref,
461
461
  disabled: disabled,
462
462
  onFocus: handleInputFocus,
463
463
  onBlur: handleInputBlur,
@@ -474,43 +474,42 @@ function TextInputWithTokensInnerComponent(t0, forwardedRef) {
474
474
  $[82] = handleInputFocus;
475
475
  $[83] = handleInputKeyDown;
476
476
  $[84] = inputPropsRest;
477
- $[85] = mergedRef;
478
- $[86] = role;
479
- $[87] = t32;
480
- $[88] = t33;
481
- $[89] = t34;
477
+ $[85] = role;
478
+ $[86] = t32;
479
+ $[87] = t33;
480
+ $[88] = t34;
482
481
  } else {
483
- t34 = $[89];
482
+ t34 = $[88];
484
483
  }
485
484
  let t35;
486
- if ($[90] !== selectedValuesDescription || $[91] !== selectedValuesDescriptionId || $[92] !== shouldExposeSelectedValuesDescription) {
485
+ if ($[89] !== selectedValuesDescription || $[90] !== selectedValuesDescriptionId || $[91] !== shouldExposeSelectedValuesDescription) {
487
486
  t35 = shouldExposeSelectedValuesDescription ? /*#__PURE__*/jsx(VisuallyHidden, {
488
487
  id: selectedValuesDescriptionId,
489
488
  children: selectedValuesDescription
490
489
  }) : null;
491
- $[90] = selectedValuesDescription;
492
- $[91] = selectedValuesDescriptionId;
493
- $[92] = shouldExposeSelectedValuesDescription;
494
- $[93] = t35;
490
+ $[89] = selectedValuesDescription;
491
+ $[90] = selectedValuesDescriptionId;
492
+ $[91] = shouldExposeSelectedValuesDescription;
493
+ $[92] = t35;
495
494
  } else {
496
- t35 = $[93];
495
+ t35 = $[92];
497
496
  }
498
497
  let t36;
499
- if ($[94] !== t34 || $[95] !== t35) {
498
+ if ($[93] !== t34 || $[94] !== t35) {
500
499
  t36 = /*#__PURE__*/jsxs("div", {
501
500
  className: styles.InputWrapper,
502
501
  children: [t34, t35]
503
502
  });
504
- $[94] = t34;
505
- $[95] = t35;
506
- $[96] = t36;
503
+ $[93] = t34;
504
+ $[94] = t35;
505
+ $[95] = t36;
507
506
  } else {
508
- t36 = $[96];
507
+ t36 = $[95];
509
508
  }
510
509
  let t37;
511
- if ($[97] !== TokenComponent || $[98] !== disabled || $[99] !== handleTokenBlur || $[100] !== handleTokenFocus || $[101] !== handleTokenRemove || $[102] !== hideTokenRemoveButtons || $[103] !== selectedTokenIndex || $[104] !== size || $[105] !== visibleTokens) {
510
+ if ($[96] !== TokenComponent || $[97] !== disabled || $[98] !== handleTokenBlur || $[99] !== handleTokenFocus || $[100] !== handleTokenRemove || $[101] !== hideTokenRemoveButtons || $[102] !== selectedTokenIndex || $[103] !== size || $[104] !== visibleTokens) {
512
511
  let t38;
513
- if ($[107] !== TokenComponent || $[108] !== disabled || $[109] !== handleTokenBlur || $[110] !== handleTokenFocus || $[111] !== handleTokenRemove || $[112] !== hideTokenRemoveButtons || $[113] !== selectedTokenIndex || $[114] !== size) {
512
+ if ($[106] !== TokenComponent || $[107] !== disabled || $[108] !== handleTokenBlur || $[109] !== handleTokenFocus || $[110] !== handleTokenRemove || $[111] !== hideTokenRemoveButtons || $[112] !== selectedTokenIndex || $[113] !== size) {
514
513
  t38 = (t39, i) => {
515
514
  const {
516
515
  id,
@@ -532,89 +531,89 @@ function TextInputWithTokensInnerComponent(t0, forwardedRef) {
532
531
  ...tokenRest
533
532
  }, id);
534
533
  };
535
- $[107] = TokenComponent;
536
- $[108] = disabled;
537
- $[109] = handleTokenBlur;
538
- $[110] = handleTokenFocus;
539
- $[111] = handleTokenRemove;
540
- $[112] = hideTokenRemoveButtons;
541
- $[113] = selectedTokenIndex;
542
- $[114] = size;
543
- $[115] = t38;
534
+ $[106] = TokenComponent;
535
+ $[107] = disabled;
536
+ $[108] = handleTokenBlur;
537
+ $[109] = handleTokenFocus;
538
+ $[110] = handleTokenRemove;
539
+ $[111] = hideTokenRemoveButtons;
540
+ $[112] = selectedTokenIndex;
541
+ $[113] = size;
542
+ $[114] = t38;
544
543
  } else {
545
- t38 = $[115];
544
+ t38 = $[114];
546
545
  }
547
546
  t37 = visibleTokens.map(t38);
548
- $[97] = TokenComponent;
549
- $[98] = disabled;
550
- $[99] = handleTokenBlur;
551
- $[100] = handleTokenFocus;
552
- $[101] = handleTokenRemove;
553
- $[102] = hideTokenRemoveButtons;
554
- $[103] = selectedTokenIndex;
555
- $[104] = size;
556
- $[105] = visibleTokens;
557
- $[106] = t37;
547
+ $[96] = TokenComponent;
548
+ $[97] = disabled;
549
+ $[98] = handleTokenBlur;
550
+ $[99] = handleTokenFocus;
551
+ $[100] = handleTokenRemove;
552
+ $[101] = hideTokenRemoveButtons;
553
+ $[102] = selectedTokenIndex;
554
+ $[103] = size;
555
+ $[104] = visibleTokens;
556
+ $[105] = t37;
558
557
  } else {
559
- t37 = $[106];
558
+ t37 = $[105];
560
559
  }
561
560
  let t38;
562
- if ($[116] !== size || $[117] !== tokens.length || $[118] !== tokensAreTruncated || $[119] !== visibleTokens.length) {
561
+ if ($[115] !== size || $[116] !== tokens.length || $[117] !== tokensAreTruncated || $[118] !== visibleTokens.length) {
563
562
  t38 = tokensAreTruncated && tokens.length - visibleTokens.length ? /*#__PURE__*/jsxs(Text, {
564
563
  className: overflowCountClassMap[size],
565
564
  children: ["+", tokens.length - visibleTokens.length]
566
565
  }) : null;
567
- $[116] = size;
568
- $[117] = tokens.length;
569
- $[118] = tokensAreTruncated;
570
- $[119] = visibleTokens.length;
571
- $[120] = t38;
566
+ $[115] = size;
567
+ $[116] = tokens.length;
568
+ $[117] = tokensAreTruncated;
569
+ $[118] = visibleTokens.length;
570
+ $[119] = t38;
572
571
  } else {
573
- t38 = $[120];
572
+ t38 = $[119];
574
573
  }
575
574
  let t39;
576
- if ($[121] !== preventTokenWrapping || $[122] !== t31 || $[123] !== t36 || $[124] !== t37 || $[125] !== t38) {
575
+ if ($[120] !== preventTokenWrapping || $[121] !== t31 || $[122] !== t36 || $[123] !== t37 || $[124] !== t38) {
577
576
  t39 = /*#__PURE__*/jsxs("div", {
578
577
  ref: t31,
579
578
  className: styles.Container,
580
579
  "data-prevent-token-wrapping": preventTokenWrapping,
581
580
  children: [t36, t37, t38]
582
581
  });
583
- $[121] = preventTokenWrapping;
584
- $[122] = t31;
585
- $[123] = t36;
586
- $[124] = t37;
587
- $[125] = t38;
588
- $[126] = t39;
582
+ $[120] = preventTokenWrapping;
583
+ $[121] = t31;
584
+ $[122] = t36;
585
+ $[123] = t37;
586
+ $[124] = t38;
587
+ $[125] = t39;
589
588
  } else {
590
- t39 = $[126];
589
+ t39 = $[125];
591
590
  }
592
591
  const t40 = typeof loading === "boolean";
593
592
  let t41;
594
- if ($[127] !== TrailingVisual) {
593
+ if ($[126] !== TrailingVisual) {
595
594
  t41 = typeof TrailingVisual !== "string" && isValidElementType(TrailingVisual) ? /*#__PURE__*/jsx(TrailingVisual, {}) : TrailingVisual;
596
- $[127] = TrailingVisual;
597
- $[128] = t41;
595
+ $[126] = TrailingVisual;
596
+ $[127] = t41;
598
597
  } else {
599
- t41 = $[128];
598
+ t41 = $[127];
600
599
  }
601
600
  let t42;
602
- if ($[129] !== showTrailingLoadingIndicator || $[130] !== t40 || $[131] !== t41) {
601
+ if ($[128] !== showTrailingLoadingIndicator || $[129] !== t40 || $[130] !== t41) {
603
602
  t42 = /*#__PURE__*/jsx(TextInputInnerVisualSlot, {
604
603
  hasLoadingIndicator: t40,
605
604
  visualPosition: "trailing",
606
605
  showLoadingIndicator: showTrailingLoadingIndicator,
607
606
  children: t41
608
607
  });
609
- $[129] = showTrailingLoadingIndicator;
610
- $[130] = t40;
611
- $[131] = t41;
612
- $[132] = t42;
608
+ $[128] = showTrailingLoadingIndicator;
609
+ $[129] = t40;
610
+ $[130] = t41;
611
+ $[131] = t42;
613
612
  } else {
614
- t42 = $[132];
613
+ t42 = $[131];
615
614
  }
616
615
  let t43;
617
- if ($[133] !== block || $[134] !== contrast || $[135] !== disabled || $[136] !== maxWidthProp || $[137] !== minWidthProp || $[138] !== t21 || $[139] !== t22 || $[140] !== t23 || $[141] !== t24 || $[142] !== t25 || $[143] !== t26 || $[144] !== t27 || $[145] !== t30 || $[146] !== t39 || $[147] !== t42 || $[148] !== validationStatus || $[149] !== variantProp || $[150] !== widthProp) {
616
+ if ($[132] !== block || $[133] !== contrast || $[134] !== disabled || $[135] !== maxWidthProp || $[136] !== minWidthProp || $[137] !== t21 || $[138] !== t22 || $[139] !== t23 || $[140] !== t24 || $[141] !== t25 || $[142] !== t26 || $[143] !== t27 || $[144] !== t30 || $[145] !== t39 || $[146] !== t42 || $[147] !== validationStatus || $[148] !== variantProp || $[149] !== widthProp) {
618
617
  t43 = /*#__PURE__*/jsxs(TextInputWrapper, {
619
618
  block: block,
620
619
  contrast: contrast,
@@ -633,27 +632,27 @@ function TextInputWithTokensInnerComponent(t0, forwardedRef) {
633
632
  style: t26,
634
633
  children: [t27, t30, t39, t42]
635
634
  });
636
- $[133] = block;
637
- $[134] = contrast;
638
- $[135] = disabled;
639
- $[136] = maxWidthProp;
640
- $[137] = minWidthProp;
641
- $[138] = t21;
642
- $[139] = t22;
643
- $[140] = t23;
644
- $[141] = t24;
645
- $[142] = t25;
646
- $[143] = t26;
647
- $[144] = t27;
648
- $[145] = t30;
649
- $[146] = t39;
650
- $[147] = t42;
651
- $[148] = validationStatus;
652
- $[149] = variantProp;
653
- $[150] = widthProp;
654
- $[151] = t43;
635
+ $[132] = block;
636
+ $[133] = contrast;
637
+ $[134] = disabled;
638
+ $[135] = maxWidthProp;
639
+ $[136] = minWidthProp;
640
+ $[137] = t21;
641
+ $[138] = t22;
642
+ $[139] = t23;
643
+ $[140] = t24;
644
+ $[141] = t25;
645
+ $[142] = t26;
646
+ $[143] = t27;
647
+ $[144] = t30;
648
+ $[145] = t39;
649
+ $[146] = t42;
650
+ $[147] = validationStatus;
651
+ $[148] = variantProp;
652
+ $[149] = widthProp;
653
+ $[150] = t43;
655
654
  } else {
656
- t43 = $[151];
655
+ t43 = $[150];
657
656
  }
658
657
  return t43;
659
658
  }