@primer/react 0.0.0-20260324184905 → 0.0.0-20260324193322
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 +1 -3
- package/dist/ActionBar/ActionBar.js +3 -3
- package/dist/ActionList/Heading.js +16 -17
- package/dist/ActionList/List.d.ts.map +1 -1
- package/dist/ActionList/List.js +41 -41
- package/dist/AnchoredOverlay/AnchoredOverlay.d.ts.map +1 -1
- package/dist/AnchoredOverlay/AnchoredOverlay.js +3 -13
- package/dist/Autocomplete/AutocompleteInput.js +3 -3
- package/dist/Autocomplete/AutocompleteOverlay.js +3 -3
- package/dist/Button/ButtonBase.d.ts.map +1 -1
- package/dist/Button/ButtonBase.js +4 -3
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +23 -23
- package/dist/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/Checkbox/Checkbox.js +5 -5
- package/dist/Dialog/Dialog.js +8 -9
- package/dist/FilteredActionList/FilteredActionList.d.ts.map +1 -1
- package/dist/FilteredActionList/FilteredActionList.js +8 -8
- package/dist/Heading/Heading.js +3 -3
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +4 -3
- package/dist/Overlay/Overlay.js +20 -21
- package/dist/PageHeader/PageHeader.d.ts.map +1 -1
- package/dist/PageHeader/PageHeader.js +30 -31
- package/dist/PageLayout/PageLayout.js +5 -5
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +5 -6
- package/dist/TextInputWithTokens/TextInputWithTokens.js +90 -91
- package/dist/TooltipV2/Tooltip.d.ts.map +1 -1
- package/dist/TooltipV2/Tooltip.js +4 -4
- package/dist/deprecated/DialogV1/Dialog.js +9 -10
- package/dist/experimental/Tabs/Tabs.d.ts +1 -1
- package/dist/experimental/Tabs/Tabs.d.ts.map +1 -1
- package/dist/experimental/Tabs/Tabs.js +16 -16
- package/dist/hooks/useProvidedRefOrCreate.d.ts +7 -10
- package/dist/hooks/useProvidedRefOrCreate.d.ts.map +1 -1
- package/dist/hooks/useProvidedRefOrCreate.js +10 -10
- package/package.json +1 -1
|
@@ -4,7 +4,6 @@ import { useCallback, useRef, useState, useEffect, useMemo, forwardRef } from 'r
|
|
|
4
4
|
import { ActionList } from '../ActionList/index.js';
|
|
5
5
|
import { useFocusZone } from '../hooks/useFocusZone.js';
|
|
6
6
|
import { useId } from '../hooks/useId.js';
|
|
7
|
-
import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
|
|
8
7
|
import { useProvidedStateOrCreate } from '../hooks/useProvidedStateOrCreate.js';
|
|
9
8
|
import useScrollFlash from '../hooks/useScrollFlash.js';
|
|
10
9
|
import { FilteredActionListLoadingTypes, FilteredActionListBodyLoader } from './FilteredActionListLoaders.js';
|
|
@@ -15,6 +14,7 @@ import { useAnnouncements } from './useAnnouncements.js';
|
|
|
15
14
|
import { clsx } from 'clsx';
|
|
16
15
|
import { useVirtualizer } from '@tanstack/react-virtual';
|
|
17
16
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
17
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
18
18
|
import TextInput from '../TextInput/TextInput.js';
|
|
19
19
|
import { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden.js';
|
|
20
20
|
import Checkbox from '../Checkbox/Checkbox.js';
|
|
@@ -73,8 +73,10 @@ function FilteredActionList({
|
|
|
73
73
|
}, [onFilterChange, setInternalFilterValue]);
|
|
74
74
|
const inputAndListContainerRef = useRef(null);
|
|
75
75
|
const listRef = useRef(null);
|
|
76
|
-
const scrollContainerRef =
|
|
77
|
-
const
|
|
76
|
+
const scrollContainerRef = useRef(null);
|
|
77
|
+
const combinedScrollContainerRef = useMergedRefs(scrollContainerRef, providedScrollContainerRef);
|
|
78
|
+
const inputRef = useRef(null);
|
|
79
|
+
const combinedInputRef = useMergedRefs(inputRef, providedInputRef);
|
|
78
80
|
const usingRovingTabindex = _PrivateFocusManagement === 'roving-tabindex';
|
|
79
81
|
const [listContainerElement, setListContainerElement] = useState(null);
|
|
80
82
|
const activeDescendantRef = useRef();
|
|
@@ -387,10 +389,8 @@ function FilteredActionList({
|
|
|
387
389
|
"data-testid": "filtered-action-list",
|
|
388
390
|
children: [/*#__PURE__*/jsx("div", {
|
|
389
391
|
className: classes.Header,
|
|
390
|
-
children: /*#__PURE__*/jsx(TextInput
|
|
391
|
-
|
|
392
|
-
, {
|
|
393
|
-
ref: inputRef,
|
|
392
|
+
children: /*#__PURE__*/jsx(TextInput, {
|
|
393
|
+
ref: combinedInputRef,
|
|
394
394
|
block: true,
|
|
395
395
|
width: "auto",
|
|
396
396
|
color: "fg.default",
|
|
@@ -429,7 +429,7 @@ function FilteredActionList({
|
|
|
429
429
|
children: selectAllLabelText
|
|
430
430
|
})]
|
|
431
431
|
}), /*#__PURE__*/jsx("div", {
|
|
432
|
-
ref:
|
|
432
|
+
ref: combinedScrollContainerRef,
|
|
433
433
|
className: classes.Container,
|
|
434
434
|
children: getBodyContent()
|
|
435
435
|
})]
|
package/dist/Heading/Heading.js
CHANGED
|
@@ -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 {
|
|
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
|
-
|
|
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:
|
|
34
|
+
ref: innerRef
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
37
|
Heading.displayName = 'Heading';
|
package/dist/Link/Link.d.ts.map
CHANGED
|
@@ -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,
|
|
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 {
|
|
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
|
-
|
|
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
|
-
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
|
+
ref: innerRef
|
|
40
41
|
});
|
|
41
42
|
};
|
|
42
43
|
UnwrappedLink.displayName = "UnwrappedLink";
|
package/dist/Overlay/Overlay.js
CHANGED
|
@@ -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 {
|
|
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(
|
|
119
|
+
const $ = c(48);
|
|
120
120
|
let anchorSide;
|
|
121
121
|
let ignoreClickRefs;
|
|
122
122
|
let initialFocusRef;
|
|
@@ -199,7 +199,7 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
199
199
|
const cssAnchorPositioning = useFeatureFlag("primer_react_css_anchor_positioning");
|
|
200
200
|
const featureFlagMaxHeightClampToViewport = useFeatureFlag("primer_react_overlay_max_height_clamp_to_viewport");
|
|
201
201
|
const overlayRef = useRef(null);
|
|
202
|
-
|
|
202
|
+
useRefObjectAsForwardedRef(forwardedRef, overlayRef);
|
|
203
203
|
let t6;
|
|
204
204
|
if ($[18] !== ignoreClickRefs || $[19] !== initialFocusRef || $[20] !== onClickOutside || $[21] !== onEscape || $[22] !== preventFocusOnOpen || $[23] !== returnFocusRef) {
|
|
205
205
|
t6 = {
|
|
@@ -282,12 +282,12 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
282
282
|
t12 = $[33];
|
|
283
283
|
}
|
|
284
284
|
let t13;
|
|
285
|
-
if ($[34] !== height || $[35] !== leftPosition || $[36] !==
|
|
285
|
+
if ($[34] !== height || $[35] !== leftPosition || $[36] !== props || $[37] !== responsiveVariant || $[38] !== right || $[39] !== role || $[40] !== t11 || $[41] !== t12 || $[42] !== visibility || $[43] !== width) {
|
|
286
286
|
t13 = /*#__PURE__*/jsx(BaseOverlay, {
|
|
287
287
|
role: role,
|
|
288
288
|
width: width,
|
|
289
289
|
"data-reflow-container": t11,
|
|
290
|
-
ref:
|
|
290
|
+
ref: overlayRef,
|
|
291
291
|
left: leftPosition,
|
|
292
292
|
right: right,
|
|
293
293
|
height: height,
|
|
@@ -298,34 +298,33 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
298
298
|
});
|
|
299
299
|
$[34] = height;
|
|
300
300
|
$[35] = leftPosition;
|
|
301
|
-
$[36] =
|
|
302
|
-
$[37] =
|
|
303
|
-
$[38] =
|
|
304
|
-
$[39] =
|
|
305
|
-
$[40] =
|
|
306
|
-
$[41] =
|
|
307
|
-
$[42] =
|
|
308
|
-
$[43] =
|
|
309
|
-
$[44] =
|
|
310
|
-
$[45] = t13;
|
|
301
|
+
$[36] = props;
|
|
302
|
+
$[37] = responsiveVariant;
|
|
303
|
+
$[38] = right;
|
|
304
|
+
$[39] = role;
|
|
305
|
+
$[40] = t11;
|
|
306
|
+
$[41] = t12;
|
|
307
|
+
$[42] = visibility;
|
|
308
|
+
$[43] = width;
|
|
309
|
+
$[44] = t13;
|
|
311
310
|
} else {
|
|
312
|
-
t13 = $[
|
|
311
|
+
t13 = $[44];
|
|
313
312
|
}
|
|
314
313
|
const overlayContent = t13;
|
|
315
314
|
if (cssAnchorPositioning) {
|
|
316
315
|
return overlayContent;
|
|
317
316
|
}
|
|
318
317
|
let t14;
|
|
319
|
-
if ($[
|
|
318
|
+
if ($[45] !== overlayContent || $[46] !== portalContainerName) {
|
|
320
319
|
t14 = /*#__PURE__*/jsx(Portal, {
|
|
321
320
|
containerName: portalContainerName,
|
|
322
321
|
children: overlayContent
|
|
323
322
|
});
|
|
324
|
-
$[
|
|
325
|
-
$[
|
|
326
|
-
$[
|
|
323
|
+
$[45] = overlayContent;
|
|
324
|
+
$[46] = portalContainerName;
|
|
325
|
+
$[47] = t14;
|
|
327
326
|
} else {
|
|
328
|
-
t14 = $[
|
|
327
|
+
t14 = $[47];
|
|
329
328
|
}
|
|
330
329
|
return t14;
|
|
331
330
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../src/PageHeader/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../src/PageHeader/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAA;AAC9C,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAIhE,OAAO,KAAK,EAAC,SAAS,IAAI,aAAa,EAAC,MAAM,SAAS,CAAA;AAIvD,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAI/F,OAAO,KAAK,EAAC,QAAQ,EAAE,gBAAgB,EAAC,MAAM,gBAAgB,CAAA;AAO9D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAA;CAC5C,CAAA;AAkBD,MAAM,MAAM,eAAe,GAAG;IAC5B,YAAY,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAA;IACjD,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,QAAQ,GAAG,KAAK,CAAA;IACzC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AA2FD,KAAK,SAAS,GAAG,IAAI,CACnB,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,GAAG,aAAa,EAC7D,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAC1G,GAAG;IACF,YAAY,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAA;CAClD,CAAA;AACD,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAAA;AAuDpF,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,eAAe,CAAC,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC,CAAA;CAC7F,GAAG,iBAAiB,CAAA;AAoErB,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;CAC7C,GAAG,iBAAiB,CAAA;AAiDrB,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAA;AAmBrE,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,CAAC,EAAE,KAAK,GAAG,KAAK,CAAA;IAClB,YAAY,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAA;IACjD,iBAAiB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAA;CAC5D,GAAG,iBAAiB,CAAA;AAsFrB,eAAO,MAAM,UAAU;;;;;;;;;;;;+CA3GiC,YAAY;;;CA0HlE,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
|
-
import React, { useEffect } from 'react';
|
|
2
|
+
import React, { useRef, useEffect } from 'react';
|
|
3
3
|
import { isResponsiveValue } from '../hooks/useResponsiveValue.js';
|
|
4
4
|
import { ArrowLeftIcon } from '@primer/octicons-react';
|
|
5
5
|
import { getResponsiveAttributes } from '../internal/utils/getResponsiveAttributes.js';
|
|
@@ -9,7 +9,7 @@ import { clsx } from 'clsx';
|
|
|
9
9
|
import classes from './PageHeader.module.css.js';
|
|
10
10
|
import { isSlot } from '../utils/is-slot.js';
|
|
11
11
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
12
|
-
import {
|
|
12
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
13
13
|
import Heading from '../Heading/Heading.js';
|
|
14
14
|
import Link from '../Link/Link.js';
|
|
15
15
|
|
|
@@ -31,7 +31,7 @@ const hiddenOnNarrow = {
|
|
|
31
31
|
// -----------------------------------------------------------------------------
|
|
32
32
|
|
|
33
33
|
const Root = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
34
|
-
const $ = c(
|
|
34
|
+
const $ = c(13);
|
|
35
35
|
const {
|
|
36
36
|
children,
|
|
37
37
|
className,
|
|
@@ -41,11 +41,12 @@ const Root = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
41
41
|
hasBorder
|
|
42
42
|
} = t0;
|
|
43
43
|
const BaseComponent = t1 === undefined ? "div" : t1;
|
|
44
|
-
const rootRef =
|
|
44
|
+
const rootRef = useRef(null);
|
|
45
|
+
const mergedRef = useMergedRefs(rootRef, forwardedRef);
|
|
45
46
|
const isInteractive = _temp;
|
|
46
47
|
let t2;
|
|
47
48
|
let t3;
|
|
48
|
-
if ($[0] !== children
|
|
49
|
+
if ($[0] !== children) {
|
|
49
50
|
t2 = function validateInteractiveElementsInTitle() {
|
|
50
51
|
if (!(process.env.NODE_ENV !== "production")) {
|
|
51
52
|
return;
|
|
@@ -72,43 +73,42 @@ const Root = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
72
73
|
};
|
|
73
74
|
t3 = [children, rootRef];
|
|
74
75
|
$[0] = children;
|
|
75
|
-
$[1] =
|
|
76
|
-
$[2] =
|
|
77
|
-
$[3] = t3;
|
|
76
|
+
$[1] = t2;
|
|
77
|
+
$[2] = t3;
|
|
78
78
|
} else {
|
|
79
|
-
t2 = $[
|
|
80
|
-
t3 = $[
|
|
79
|
+
t2 = $[1];
|
|
80
|
+
t3 = $[2];
|
|
81
81
|
}
|
|
82
82
|
useEffect(t2, t3);
|
|
83
83
|
let t4;
|
|
84
|
-
if ($[
|
|
84
|
+
if ($[3] !== className) {
|
|
85
85
|
t4 = clsx(classes.PageHeader, className);
|
|
86
|
-
$[
|
|
87
|
-
$[
|
|
86
|
+
$[3] = className;
|
|
87
|
+
$[4] = t4;
|
|
88
88
|
} else {
|
|
89
|
-
t4 = $[
|
|
89
|
+
t4 = $[4];
|
|
90
90
|
}
|
|
91
91
|
const t5 = hasBorder ? "true" : undefined;
|
|
92
92
|
let t6;
|
|
93
|
-
if ($[
|
|
93
|
+
if ($[5] !== BaseComponent || $[6] !== ariaLabel || $[7] !== children || $[8] !== mergedRef || $[9] !== role || $[10] !== t4 || $[11] !== t5) {
|
|
94
94
|
t6 = /*#__PURE__*/jsx(BaseComponent, {
|
|
95
|
-
ref:
|
|
95
|
+
ref: mergedRef,
|
|
96
96
|
className: t4,
|
|
97
97
|
"data-has-border": t5,
|
|
98
98
|
"aria-label": ariaLabel,
|
|
99
99
|
role: role,
|
|
100
100
|
children: children
|
|
101
101
|
});
|
|
102
|
-
$[
|
|
103
|
-
$[
|
|
104
|
-
$[
|
|
102
|
+
$[5] = BaseComponent;
|
|
103
|
+
$[6] = ariaLabel;
|
|
104
|
+
$[7] = children;
|
|
105
|
+
$[8] = mergedRef;
|
|
105
106
|
$[9] = role;
|
|
106
|
-
$[10] =
|
|
107
|
-
$[11] =
|
|
108
|
-
$[12] =
|
|
109
|
-
$[13] = t6;
|
|
107
|
+
$[10] = t4;
|
|
108
|
+
$[11] = t5;
|
|
109
|
+
$[12] = t6;
|
|
110
110
|
} else {
|
|
111
|
-
t6 = $[
|
|
111
|
+
t6 = $[12];
|
|
112
112
|
}
|
|
113
113
|
return t6;
|
|
114
114
|
});
|
|
@@ -334,7 +334,6 @@ const TitleArea = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
334
334
|
} = t0;
|
|
335
335
|
const hidden = t1 === undefined ? false : t1;
|
|
336
336
|
const variant = t2 === undefined ? "medium" : t2;
|
|
337
|
-
const titleAreaRef = useProvidedRefOrCreate(forwardedRef);
|
|
338
337
|
let t3;
|
|
339
338
|
if ($[0] !== className) {
|
|
340
339
|
t3 = clsx(classes.TitleArea, className);
|
|
@@ -360,20 +359,20 @@ const TitleArea = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
360
359
|
t5 = $[5];
|
|
361
360
|
}
|
|
362
361
|
let t6;
|
|
363
|
-
if ($[6] !== children || $[7] !==
|
|
362
|
+
if ($[6] !== children || $[7] !== forwardedRef || $[8] !== t3 || $[9] !== t4 || $[10] !== t5) {
|
|
364
363
|
t6 = /*#__PURE__*/jsx("div", {
|
|
365
364
|
className: t3,
|
|
366
|
-
ref:
|
|
365
|
+
ref: forwardedRef,
|
|
367
366
|
"data-component": "TitleArea",
|
|
368
367
|
...t4,
|
|
369
368
|
...t5,
|
|
370
369
|
children: children
|
|
371
370
|
});
|
|
372
371
|
$[6] = children;
|
|
373
|
-
$[7] =
|
|
374
|
-
$[8] =
|
|
375
|
-
$[9] =
|
|
376
|
-
$[10] =
|
|
372
|
+
$[7] = forwardedRef;
|
|
373
|
+
$[8] = t3;
|
|
374
|
+
$[9] = t4;
|
|
375
|
+
$[10] = t5;
|
|
377
376
|
$[11] = t6;
|
|
378
377
|
} else {
|
|
379
378
|
t6 = $[11];
|
|
@@ -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 {
|
|
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
|
-
|
|
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:
|
|
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
|
-
|
|
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:
|
|
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
|
,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../src/TextInput/TextInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAwD,MAAM,OAAO,CAAA;AAE5E,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../src/TextInput/TextInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAwD,MAAM,OAAO,CAAA;AAE5E,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAM/F,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,yCAAyC,CAAA;AAS/E,MAAM,MAAM,4BAA4B,GAAG;IACzC,uEAAuE;IACvE,IAAI,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;IACxB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;;;QAKI;IACJ,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAAA;IAChD,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,SAAS,CAAA;IACnD;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,SAAS,CAAA;IACpD;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,CAAA;IACvE;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,GAAG,OAAO,CACT,IAAI,CACF,kBAAkB,EAChB,OAAO,GACP,UAAU,GACV,UAAU,GACV,WAAW,GACX,OAAO,GACP,UAAU,GACV,UAAU,GACV,SAAS,GACT,MAAM,GACN,kBAAkB,CACrB,CACF,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,4BAA4B,CAAC,CAAA;;;;;;;;;;;AA+PzG,wBAGE"}
|
|
@@ -10,7 +10,7 @@ import UnstyledTextInput from '../internal/components/UnstyledTextInput.js';
|
|
|
10
10
|
import VisuallyHidden from '../_VisuallyHidden.js';
|
|
11
11
|
import { CharacterCounter } from '../utils/character-counter.js';
|
|
12
12
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
13
|
-
import {
|
|
13
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
14
14
|
import Text from '../Text/Text.js';
|
|
15
15
|
|
|
16
16
|
// using forwardRef is important so that other components can autofocus the input
|
|
@@ -46,7 +46,8 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
|
|
|
46
46
|
...inputProps
|
|
47
47
|
}, ref) => {
|
|
48
48
|
const [isInputFocused, setIsInputFocused] = useState(false);
|
|
49
|
-
const inputRef =
|
|
49
|
+
const inputRef = useRef(null);
|
|
50
|
+
const mergedRef = useMergedRefs(inputRef, ref);
|
|
50
51
|
const [characterCount, setCharacterCount] = useState('');
|
|
51
52
|
const [isOverLimit, setIsOverLimit] = useState(false);
|
|
52
53
|
const [screenReaderMessage, setScreenReaderMessage] = useState('');
|
|
@@ -170,10 +171,8 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
|
|
|
170
171
|
hasLoadingIndicator: typeof loading === 'boolean',
|
|
171
172
|
id: leadingVisualId,
|
|
172
173
|
children: typeof LeadingVisual !== 'string' && isValidElementType(LeadingVisual) ? /*#__PURE__*/jsx(LeadingVisual, {}) : LeadingVisual
|
|
173
|
-
}), /*#__PURE__*/jsx(UnstyledTextInput
|
|
174
|
-
|
|
175
|
-
, {
|
|
176
|
-
ref: inputRef,
|
|
174
|
+
}), /*#__PURE__*/jsx(UnstyledTextInput, {
|
|
175
|
+
ref: mergedRef,
|
|
177
176
|
disabled: disabled,
|
|
178
177
|
onFocus: handleInputFocus,
|
|
179
178
|
onBlur: handleInputBlur,
|