@primer/react 0.0.0-20260710171225 → 0.0.0-20260710183719
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 -1
- package/dist/ActionList/Group.js +1 -1
- package/dist/ActionList/List.js +51 -44
- package/dist/AnchoredOverlay/AnchoredOverlay.js +7 -2
- package/dist/ButtonGroup/ButtonGroup.js +28 -21
- package/dist/Checkbox/Checkbox.js +9 -3
- package/dist/Dialog/Dialog.js +10 -3
- package/dist/FeatureFlags/DefaultFeatureFlags.js +2 -1
- package/dist/FilteredActionList/FilteredActionList.js +15 -6
- package/dist/Overlay/Overlay.js +1 -1
- package/dist/PageHeader/PageHeader.js +42 -32
- package/dist/SelectPanel/SelectPanel.js +1 -1
- package/dist/TextInput/TextInput.js +9 -3
- package/dist/TooltipV2/Tooltip.js +9 -3
- package/dist/experimental/Tabs/useTabList.js +22 -15
- package/dist/experimental/index.js +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/ActionList/Group.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useId as useId$1 } from "../hooks/useId.js";
|
|
2
|
+
import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
|
|
2
3
|
import { invariant } from "../utils/invariant.js";
|
|
3
4
|
import { useSlots } from "../hooks/useSlots.js";
|
|
4
5
|
import { ListContext } from "./shared.js";
|
|
5
6
|
import ActionList_module_css_default from "./ActionList.module.css.js";
|
|
6
|
-
import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
|
|
7
7
|
import Group_module_css_default from "./Group.module.css.js";
|
|
8
8
|
import { GroupHeadingTrailingAction } from "./GroupHeadingTrailingAction.js";
|
|
9
9
|
import { GroupContext } from "./GroupContext.js";
|
package/dist/ActionList/List.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
2
|
+
import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
|
|
2
3
|
import useIsomorphicLayoutEffect from "../utils/useIsomorphicLayoutEffect.js";
|
|
3
4
|
import { useId as useId$1 } from "../hooks/useId.js";
|
|
5
|
+
import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
|
|
4
6
|
import { fixedForwardRef } from "../utils/modern-polymorphic.js";
|
|
5
7
|
import { useSlots } from "../hooks/useSlots.js";
|
|
6
8
|
import { FocusKeys, useFocusZone } from "../hooks/useFocusZone.js";
|
|
@@ -8,7 +10,6 @@ import { ActionListContainerContext } from "./ActionListContainerContext.js";
|
|
|
8
10
|
import { ListContext } from "./shared.js";
|
|
9
11
|
import { Heading } from "./Heading.js";
|
|
10
12
|
import ActionList_module_css_default from "./ActionList.module.css.js";
|
|
11
|
-
import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
|
|
12
13
|
import { c } from "react-compiler-runtime";
|
|
13
14
|
import { clsx } from "clsx";
|
|
14
15
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -16,7 +17,7 @@ import React, { useRef } from "react";
|
|
|
16
17
|
//#region src/ActionList/List.tsx
|
|
17
18
|
const UnwrappedList = (props, forwardedRef) => {
|
|
18
19
|
var _slots$heading$props$;
|
|
19
|
-
const $ = c(
|
|
20
|
+
const $ = c(40);
|
|
20
21
|
let className;
|
|
21
22
|
let restProps;
|
|
22
23
|
let role;
|
|
@@ -60,8 +61,12 @@ const UnwrappedList = (props, forwardedRef) => {
|
|
|
60
61
|
const { listRole: listRoleFromContainer, listLabelledBy, selectionVariant: containerSelectionVariant, enableFocusZone: enableFocusZoneFromContainer, container } = React.useContext(ActionListContainerContext);
|
|
61
62
|
const ariaLabelledBy = slots.heading ? (_slots$heading$props$ = slots.heading.props.id) !== null && _slots$heading$props$ !== void 0 ? _slots$heading$props$ : headingId : listLabelledBy;
|
|
62
63
|
const listRole = role || listRoleFromContainer;
|
|
63
|
-
const
|
|
64
|
-
const
|
|
64
|
+
const mergedRefEnabled = useFeatureFlag("primer_react_merged_forwarded_refs");
|
|
65
|
+
const internalRef = useRef(null);
|
|
66
|
+
const mergedRef = useMergedRefs(forwardedRef, internalRef);
|
|
67
|
+
const providedOrCreatedRef = useProvidedRefOrCreate(forwardedRef);
|
|
68
|
+
const listRef = mergedRefEnabled ? internalRef : providedOrCreatedRef;
|
|
69
|
+
const appliedRef = mergedRefEnabled ? mergedRef : providedOrCreatedRef;
|
|
65
70
|
const itemGapEnabled = useFeatureFlag("primer_react_action_list_item_gap") && container === "NavList";
|
|
66
71
|
let enableFocusZone = false;
|
|
67
72
|
if (enableFocusZoneFromContainer !== void 0) enableFocusZone = enableFocusZoneFromContainer;
|
|
@@ -80,21 +85,22 @@ const UnwrappedList = (props, forwardedRef) => {
|
|
|
80
85
|
const t5 = !enableFocusZone;
|
|
81
86
|
const t6 = listRole === "menu" || container === "SelectPanel" || container === "FilteredActionList" ? "wrap" : void 0;
|
|
82
87
|
let t7;
|
|
83
|
-
if ($[11] !==
|
|
88
|
+
if ($[11] !== listRef || $[12] !== t5 || $[13] !== t6) {
|
|
84
89
|
t7 = {
|
|
85
90
|
disabled: t5,
|
|
86
91
|
containerRef: listRef,
|
|
87
92
|
bindKeys: FocusKeys.ArrowVertical | FocusKeys.HomeAndEnd | FocusKeys.PageUpDown,
|
|
88
93
|
focusOutBehavior: t6
|
|
89
94
|
};
|
|
90
|
-
$[11] =
|
|
91
|
-
$[12] =
|
|
92
|
-
$[13] =
|
|
93
|
-
|
|
95
|
+
$[11] = listRef;
|
|
96
|
+
$[12] = t5;
|
|
97
|
+
$[13] = t6;
|
|
98
|
+
$[14] = t7;
|
|
99
|
+
} else t7 = $[14];
|
|
94
100
|
useFocusZone(t7);
|
|
95
101
|
const t8 = selectionVariant || containerSelectionVariant;
|
|
96
102
|
let t9;
|
|
97
|
-
if ($[
|
|
103
|
+
if ($[15] !== headingId || $[16] !== listRole || $[17] !== showDividers || $[18] !== t8 || $[19] !== variant) {
|
|
98
104
|
t9 = {
|
|
99
105
|
variant,
|
|
100
106
|
selectionVariant: t8,
|
|
@@ -102,16 +108,16 @@ const UnwrappedList = (props, forwardedRef) => {
|
|
|
102
108
|
role: listRole,
|
|
103
109
|
headingId
|
|
104
110
|
};
|
|
105
|
-
$[
|
|
106
|
-
$[
|
|
107
|
-
$[
|
|
108
|
-
$[
|
|
109
|
-
$[
|
|
110
|
-
$[
|
|
111
|
-
} else t9 = $[
|
|
111
|
+
$[15] = headingId;
|
|
112
|
+
$[16] = listRole;
|
|
113
|
+
$[17] = showDividers;
|
|
114
|
+
$[18] = t8;
|
|
115
|
+
$[19] = variant;
|
|
116
|
+
$[20] = t9;
|
|
117
|
+
} else t9 = $[20];
|
|
112
118
|
const listContextValue = t9;
|
|
113
119
|
let t10;
|
|
114
|
-
if ($[
|
|
120
|
+
if ($[21] !== listRef.current) {
|
|
115
121
|
t10 = () => {
|
|
116
122
|
const list = listRef.current;
|
|
117
123
|
if (!list) return;
|
|
@@ -120,24 +126,25 @@ const UnwrappedList = (props, forwardedRef) => {
|
|
|
120
126
|
if (hasMixed && current !== "true") list.setAttribute("data-mixed-descriptions", "true");
|
|
121
127
|
else if (!hasMixed && current !== null) list.removeAttribute("data-mixed-descriptions");
|
|
122
128
|
};
|
|
123
|
-
$[
|
|
124
|
-
|
|
129
|
+
$[21] = listRef.current;
|
|
130
|
+
$[22] = t10;
|
|
131
|
+
} else t10 = $[22];
|
|
125
132
|
useIsomorphicLayoutEffect(t10);
|
|
126
133
|
const t11 = slots.heading;
|
|
127
134
|
let t12;
|
|
128
|
-
if ($[
|
|
135
|
+
if ($[23] !== className) {
|
|
129
136
|
t12 = clsx(ActionList_module_css_default.ActionList, className);
|
|
130
|
-
$[
|
|
131
|
-
$[
|
|
132
|
-
} else t12 = $[
|
|
137
|
+
$[23] = className;
|
|
138
|
+
$[24] = t12;
|
|
139
|
+
} else t12 = $[24];
|
|
133
140
|
const t13 = itemGapEnabled ? "" : void 0;
|
|
134
141
|
let t14;
|
|
135
|
-
if ($[
|
|
142
|
+
if ($[25] !== Component || $[26] !== appliedRef || $[27] !== ariaLabelledBy || $[28] !== childrenWithoutSlots || $[29] !== listRole || $[30] !== restProps || $[31] !== showDividers || $[32] !== t12 || $[33] !== t13 || $[34] !== variant) {
|
|
136
143
|
t14 = /*#__PURE__*/ jsx(Component, {
|
|
137
144
|
className: t12,
|
|
138
145
|
role: listRole,
|
|
139
146
|
"aria-labelledby": ariaLabelledBy,
|
|
140
|
-
ref:
|
|
147
|
+
ref: appliedRef,
|
|
141
148
|
"data-component": "ActionList",
|
|
142
149
|
"data-dividers": showDividers,
|
|
143
150
|
"data-variant": variant,
|
|
@@ -145,29 +152,29 @@ const UnwrappedList = (props, forwardedRef) => {
|
|
|
145
152
|
...restProps,
|
|
146
153
|
children: childrenWithoutSlots
|
|
147
154
|
});
|
|
148
|
-
$[
|
|
149
|
-
$[
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
154
|
-
$[
|
|
155
|
-
$[
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
} else t14 = $[
|
|
155
|
+
$[25] = Component;
|
|
156
|
+
$[26] = appliedRef;
|
|
157
|
+
$[27] = ariaLabelledBy;
|
|
158
|
+
$[28] = childrenWithoutSlots;
|
|
159
|
+
$[29] = listRole;
|
|
160
|
+
$[30] = restProps;
|
|
161
|
+
$[31] = showDividers;
|
|
162
|
+
$[32] = t12;
|
|
163
|
+
$[33] = t13;
|
|
164
|
+
$[34] = variant;
|
|
165
|
+
$[35] = t14;
|
|
166
|
+
} else t14 = $[35];
|
|
160
167
|
let t15;
|
|
161
|
-
if ($[
|
|
168
|
+
if ($[36] !== listContextValue || $[37] !== slots.heading || $[38] !== t14) {
|
|
162
169
|
t15 = /*#__PURE__*/ jsxs(ListContext.Provider, {
|
|
163
170
|
value: listContextValue,
|
|
164
171
|
children: [t11, t14]
|
|
165
172
|
});
|
|
166
|
-
$[
|
|
167
|
-
$[
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
} else t15 = $[
|
|
173
|
+
$[36] = listContextValue;
|
|
174
|
+
$[37] = slots.heading;
|
|
175
|
+
$[38] = t14;
|
|
176
|
+
$[39] = t15;
|
|
177
|
+
} else t15 = $[39];
|
|
171
178
|
return t15;
|
|
172
179
|
};
|
|
173
180
|
const List = fixedForwardRef(UnwrappedList);
|
|
@@ -4,10 +4,10 @@ import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
|
|
|
4
4
|
import { useAnchoredPosition } from "../hooks/useAnchoredPosition.js";
|
|
5
5
|
import { useRenderForcingRef } from "../hooks/useRenderForcingRef.js";
|
|
6
6
|
import { useId as useId$1 } from "../hooks/useId.js";
|
|
7
|
+
import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
|
|
7
8
|
import { IconButton } from "../Button/IconButton.js";
|
|
8
9
|
import { useFocusTrap } from "../hooks/useFocusTrap.js";
|
|
9
10
|
import { useFocusZone } from "../hooks/useFocusZone.js";
|
|
10
|
-
import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
|
|
11
11
|
import Overlay from "../Overlay/Overlay.js";
|
|
12
12
|
import AnchoredOverlay_module_css_default from "./AnchoredOverlay.module.css.js";
|
|
13
13
|
import { widthMap } from "../Overlay/constants.js";
|
|
@@ -34,6 +34,7 @@ const AnchoredOverlay = ({ renderAnchor, anchorRef: externalAnchorRef, anchorId:
|
|
|
34
34
|
const [anchorElement, setAnchorElement] = useState(null);
|
|
35
35
|
if (anchorRef.current !== anchorElement) setAnchorElement(anchorRef.current);
|
|
36
36
|
const [overlayRef, updateOverlayRef] = useRenderForcingRef();
|
|
37
|
+
const mergedRefEnabled = useFeatureFlag("primer_react_merged_forwarded_refs");
|
|
37
38
|
const mergedOverlayRef = useMergedRefs(updateOverlayRef, overlayProps === null || overlayProps === void 0 ? void 0 : overlayProps.ref);
|
|
38
39
|
const [overlayElement, setOverlayElement] = useState(null);
|
|
39
40
|
const anchorId = useId$1(externalAnchorId);
|
|
@@ -194,7 +195,11 @@ const AnchoredOverlay = ({ renderAnchor, anchorRef: externalAnchorRef, anchorId:
|
|
|
194
195
|
...cssAnchorPositioning ? { id: popoverId } : {},
|
|
195
196
|
ref: (node) => {
|
|
196
197
|
setOverlayElement(node);
|
|
197
|
-
assignRef(mergedOverlayRef, node);
|
|
198
|
+
if (mergedRefEnabled) assignRef(mergedOverlayRef, node);
|
|
199
|
+
else {
|
|
200
|
+
if (overlayProps !== null && overlayProps !== void 0 && overlayProps.ref) assignRef(overlayProps.ref, node);
|
|
201
|
+
updateOverlayRef(node);
|
|
202
|
+
}
|
|
198
203
|
},
|
|
199
204
|
"data-anchor-position": cssAnchorPositioning,
|
|
200
205
|
"data-side": cssAnchorPositioning ? side : position === null || position === void 0 ? void 0 : position.anchorSide,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
2
|
+
import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
|
|
3
|
+
import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
|
|
2
4
|
import { FocusKeys, useFocusZone } from "../hooks/useFocusZone.js";
|
|
3
5
|
import ButtonGroup_module_css_default from "./ButtonGroup.module.css.js";
|
|
4
6
|
import { c } from "react-compiler-runtime";
|
|
@@ -7,7 +9,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
7
9
|
import React, { useRef } from "react";
|
|
8
10
|
//#region src/ButtonGroup/ButtonGroup.tsx
|
|
9
11
|
const ButtonGroup = /*#__PURE__*/ React.forwardRef(function ButtonGroup(t0, forwardRef) {
|
|
10
|
-
const $ = c(
|
|
12
|
+
const $ = c(20);
|
|
11
13
|
let children;
|
|
12
14
|
let className;
|
|
13
15
|
let rest;
|
|
@@ -29,8 +31,12 @@ const ButtonGroup = /*#__PURE__*/ React.forwardRef(function ButtonGroup(t0, forw
|
|
|
29
31
|
t1 = $[5];
|
|
30
32
|
}
|
|
31
33
|
const BaseComponent = t1 === void 0 ? "div" : t1;
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
+
const mergedRefEnabled = useFeatureFlag("primer_react_merged_forwarded_refs");
|
|
35
|
+
const internalRef = useRef(null);
|
|
36
|
+
const mergedRef = useMergedRefs(internalRef, forwardRef);
|
|
37
|
+
const providedOrCreatedRef = useProvidedRefOrCreate(forwardRef);
|
|
38
|
+
const buttonRef = mergedRefEnabled ? internalRef : providedOrCreatedRef;
|
|
39
|
+
const appliedRef = mergedRefEnabled ? mergedRef : providedOrCreatedRef;
|
|
34
40
|
let t2;
|
|
35
41
|
if ($[6] !== children) {
|
|
36
42
|
t2 = React.Children.map(children, _temp);
|
|
@@ -40,41 +46,42 @@ const ButtonGroup = /*#__PURE__*/ React.forwardRef(function ButtonGroup(t0, forw
|
|
|
40
46
|
const buttons = t2;
|
|
41
47
|
const t3 = role !== "toolbar";
|
|
42
48
|
let t4;
|
|
43
|
-
if ($[8] !== t3) {
|
|
49
|
+
if ($[8] !== buttonRef || $[9] !== t3) {
|
|
44
50
|
t4 = {
|
|
45
51
|
containerRef: buttonRef,
|
|
46
52
|
disabled: t3,
|
|
47
53
|
bindKeys: FocusKeys.ArrowHorizontal,
|
|
48
54
|
focusOutBehavior: "wrap"
|
|
49
55
|
};
|
|
50
|
-
$[8] =
|
|
51
|
-
$[9] =
|
|
52
|
-
|
|
56
|
+
$[8] = buttonRef;
|
|
57
|
+
$[9] = t3;
|
|
58
|
+
$[10] = t4;
|
|
59
|
+
} else t4 = $[10];
|
|
53
60
|
useFocusZone(t4);
|
|
54
61
|
let t5;
|
|
55
|
-
if ($[
|
|
62
|
+
if ($[11] !== className) {
|
|
56
63
|
t5 = clsx(className, ButtonGroup_module_css_default.ButtonGroup);
|
|
57
|
-
$[
|
|
58
|
-
$[
|
|
59
|
-
} else t5 = $[
|
|
64
|
+
$[11] = className;
|
|
65
|
+
$[12] = t5;
|
|
66
|
+
} else t5 = $[12];
|
|
60
67
|
let t6;
|
|
61
|
-
if ($[
|
|
68
|
+
if ($[13] !== BaseComponent || $[14] !== appliedRef || $[15] !== buttons || $[16] !== rest || $[17] !== role || $[18] !== t5) {
|
|
62
69
|
t6 = /*#__PURE__*/ jsx(BaseComponent, {
|
|
63
|
-
ref:
|
|
70
|
+
ref: appliedRef,
|
|
64
71
|
className: t5,
|
|
65
72
|
role,
|
|
66
73
|
...rest,
|
|
67
74
|
"data-component": "ButtonGroup",
|
|
68
75
|
children: buttons
|
|
69
76
|
});
|
|
70
|
-
$[
|
|
71
|
-
$[
|
|
72
|
-
$[
|
|
73
|
-
$[
|
|
74
|
-
$[
|
|
75
|
-
$[
|
|
76
|
-
$[
|
|
77
|
-
} else t6 = $[
|
|
77
|
+
$[13] = BaseComponent;
|
|
78
|
+
$[14] = appliedRef;
|
|
79
|
+
$[15] = buttons;
|
|
80
|
+
$[16] = rest;
|
|
81
|
+
$[17] = role;
|
|
82
|
+
$[18] = t5;
|
|
83
|
+
$[19] = t6;
|
|
84
|
+
} else t6 = $[19];
|
|
78
85
|
return t6;
|
|
79
86
|
});
|
|
80
87
|
ButtonGroup.displayName = "ButtonGroup";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
2
|
+
import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
|
|
2
3
|
import useIsomorphicLayoutEffect from "../utils/useIsomorphicLayoutEffect.js";
|
|
4
|
+
import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
|
|
3
5
|
import shared_module_css_default from "./shared.module.css.js";
|
|
4
6
|
import { CheckboxGroupContext } from "../CheckboxGroup/CheckboxGroupContext.js";
|
|
5
7
|
import Checkbox_module_css_default from "./Checkbox.module.css.js";
|
|
@@ -11,8 +13,12 @@ import React, { useContext, useEffect, useRef } from "react";
|
|
|
11
13
|
* An accessible, native checkbox component
|
|
12
14
|
*/
|
|
13
15
|
const Checkbox = /*#__PURE__*/ React.forwardRef(({ checked, className, defaultChecked, indeterminate, disabled, onChange, required, validationStatus, value, ["data-component"]: dataComponent, ...rest }, ref) => {
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
+
const mergedRefEnabled = useFeatureFlag("primer_react_merged_forwarded_refs");
|
|
17
|
+
const internalRef = useRef(null);
|
|
18
|
+
const mergedRef = useMergedRefs(internalRef, ref);
|
|
19
|
+
const providedOrCreatedRef = useProvidedRefOrCreate(ref);
|
|
20
|
+
const checkboxRef = mergedRefEnabled ? internalRef : providedOrCreatedRef;
|
|
21
|
+
const appliedRef = mergedRefEnabled ? mergedRef : providedOrCreatedRef;
|
|
16
22
|
const checkboxGroupContext = useContext(CheckboxGroupContext);
|
|
17
23
|
const handleOnChange = (e) => {
|
|
18
24
|
checkboxGroupContext.onChange && checkboxGroupContext.onChange(e);
|
|
@@ -25,7 +31,7 @@ const Checkbox = /*#__PURE__*/ React.forwardRef(({ checked, className, defaultCh
|
|
|
25
31
|
const inputProps = {
|
|
26
32
|
type: "checkbox",
|
|
27
33
|
disabled,
|
|
28
|
-
ref:
|
|
34
|
+
ref: appliedRef,
|
|
29
35
|
checked: indeterminate ? false : checked,
|
|
30
36
|
defaultChecked,
|
|
31
37
|
required,
|
package/dist/Dialog/Dialog.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
2
|
+
import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
|
|
2
3
|
import { useOnEscapePress } from "../hooks/useOnEscapePress.js";
|
|
3
4
|
import { useResizeObserver } from "../hooks/useResizeObserver.js";
|
|
4
5
|
import { useId as useId$1 } from "../hooks/useId.js";
|
|
6
|
+
import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
|
|
5
7
|
import { IconButton } from "../Button/IconButton.js";
|
|
6
8
|
import { ButtonComponent } from "../Button/Button.js";
|
|
7
9
|
import { useSlots } from "../hooks/useSlots.js";
|
|
@@ -243,8 +245,13 @@ const Footer = /*#__PURE__*/ React.forwardRef(function Footer({ className, ...re
|
|
|
243
245
|
Footer.displayName = "Dialog.Footer";
|
|
244
246
|
const Buttons = ({ buttons }) => {
|
|
245
247
|
var _buttons$find;
|
|
246
|
-
const
|
|
247
|
-
const
|
|
248
|
+
const mergedRefEnabled = useFeatureFlag("primer_react_merged_forwarded_refs");
|
|
249
|
+
const providedButtonRef = (_buttons$find = buttons.find((button) => button.autoFocus)) === null || _buttons$find === void 0 ? void 0 : _buttons$find.ref;
|
|
250
|
+
const internalRef = useRef(null);
|
|
251
|
+
const mergedRef = useMergedRefs(internalRef, providedButtonRef);
|
|
252
|
+
const providedOrCreatedRef = useProvidedRefOrCreate(providedButtonRef);
|
|
253
|
+
const autoFocusRef = mergedRefEnabled ? internalRef : providedOrCreatedRef;
|
|
254
|
+
const appliedRef = mergedRefEnabled ? mergedRef : providedOrCreatedRef;
|
|
248
255
|
let autoFocusCount = 0;
|
|
249
256
|
const [hasRendered, setHasRendered] = useState(0);
|
|
250
257
|
useEffect(() => {
|
|
@@ -259,7 +266,7 @@ const Buttons = ({ buttons }) => {
|
|
|
259
266
|
"data-component": "Dialog.FooterButton",
|
|
260
267
|
...buttonProps,
|
|
261
268
|
variant: buttonType === "normal" ? "default" : buttonType,
|
|
262
|
-
ref: autoFocus && autoFocusCount === 0 ? (autoFocusCount++,
|
|
269
|
+
ref: autoFocus && autoFocusCount === 0 ? (autoFocusCount++, appliedRef) : null,
|
|
263
270
|
children: content
|
|
264
271
|
}, index);
|
|
265
272
|
}) });
|
|
@@ -7,7 +7,8 @@ const DefaultFeatureFlags = FeatureFlagScope.create({
|
|
|
7
7
|
primer_react_styled_react_use_primer_theme_providers: false,
|
|
8
8
|
primer_react_action_list_group_heading_trailing_action: false,
|
|
9
9
|
primer_react_action_list_item_gap: false,
|
|
10
|
-
primer_react_timeline_list_semantics: false
|
|
10
|
+
primer_react_timeline_list_semantics: false,
|
|
11
|
+
primer_react_merged_forwarded_refs: true
|
|
11
12
|
});
|
|
12
13
|
//#endregion
|
|
13
14
|
export { DefaultFeatureFlags };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
2
2
|
import { VisuallyHidden } from "../VisuallyHidden/VisuallyHidden.js";
|
|
3
|
+
import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
|
|
3
4
|
import { useProvidedStateOrCreate } from "../hooks/useProvidedStateOrCreate.js";
|
|
4
5
|
import { useId as useId$1 } from "../hooks/useId.js";
|
|
6
|
+
import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
|
|
5
7
|
import { useFocusZone } from "../hooks/useFocusZone.js";
|
|
6
8
|
import { ActionListContainerContext } from "../ActionList/ActionListContainerContext.js";
|
|
7
9
|
import { ActionList } from "../ActionList/index.js";
|
|
@@ -34,10 +36,17 @@ function FilteredActionList({ loading = false, placeholderText, filterValue: ext
|
|
|
34
36
|
}, [onFilterChange, setInternalFilterValue]);
|
|
35
37
|
const inputAndListContainerRef = useRef(null);
|
|
36
38
|
const listRef = useRef(null);
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
39
|
+
const mergedRefEnabled = useFeatureFlag("primer_react_merged_forwarded_refs");
|
|
40
|
+
const internalScrollContainerRef = useRef(null);
|
|
41
|
+
const combinedScrollContainerRef = useMergedRefs(internalScrollContainerRef, providedScrollContainerRef);
|
|
42
|
+
const providedOrCreatedScrollContainerRef = useProvidedRefOrCreate(providedScrollContainerRef);
|
|
43
|
+
const scrollContainerRef = mergedRefEnabled ? internalScrollContainerRef : providedOrCreatedScrollContainerRef;
|
|
44
|
+
const appliedScrollContainerRef = mergedRefEnabled ? combinedScrollContainerRef : providedOrCreatedScrollContainerRef;
|
|
45
|
+
const internalInputRef = useRef(null);
|
|
46
|
+
const combinedInputRef = useMergedRefs(internalInputRef, providedInputRef);
|
|
47
|
+
const providedOrCreatedInputRef = useProvidedRefOrCreate(providedInputRef);
|
|
48
|
+
const inputRef = mergedRefEnabled ? internalInputRef : providedOrCreatedInputRef;
|
|
49
|
+
const appliedInputRef = mergedRefEnabled ? combinedInputRef : providedOrCreatedInputRef;
|
|
41
50
|
const usingRovingTabindex = _PrivateFocusManagement === "roving-tabindex";
|
|
42
51
|
const [listContainerElement, setListContainerElement] = useState(null);
|
|
43
52
|
const activeDescendantRef = useRef();
|
|
@@ -292,7 +301,7 @@ function FilteredActionList({ loading = false, placeholderText, filterValue: ext
|
|
|
292
301
|
"data-component": "FilteredActionList",
|
|
293
302
|
children: [
|
|
294
303
|
/*#__PURE__*/ jsx(FilteredActionListInput, {
|
|
295
|
-
inputRef:
|
|
304
|
+
inputRef: appliedInputRef,
|
|
296
305
|
value: filterValue,
|
|
297
306
|
onInputChange,
|
|
298
307
|
onInputKeyPress,
|
|
@@ -326,7 +335,7 @@ function FilteredActionList({ loading = false, placeholderText, filterValue: ext
|
|
|
326
335
|
})]
|
|
327
336
|
}),
|
|
328
337
|
/*#__PURE__*/ jsx("div", {
|
|
329
|
-
ref:
|
|
338
|
+
ref: appliedScrollContainerRef,
|
|
330
339
|
className: FilteredActionList_module_css_default.Container,
|
|
331
340
|
children: getBodyContent()
|
|
332
341
|
})
|
package/dist/Overlay/Overlay.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
2
2
|
import useIsomorphicLayoutEffect from "../utils/useIsomorphicLayoutEffect.js";
|
|
3
3
|
import { useOverlay } from "../hooks/useOverlay.js";
|
|
4
|
-
import Portal_default from "../Portal/index.js";
|
|
5
4
|
import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
|
|
5
|
+
import Portal_default from "../Portal/index.js";
|
|
6
6
|
import Overlay_module_css_default from "./Overlay.module.css.js";
|
|
7
7
|
import { clsx } from "clsx";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
2
|
+
import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
|
|
2
3
|
import { warning } from "../utils/warning.js";
|
|
4
|
+
import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
|
|
3
5
|
import { isResponsiveValue } from "../hooks/useResponsiveValue.js";
|
|
4
6
|
import { isSlot } from "../utils/is-slot.js";
|
|
5
7
|
import { getResponsiveAttributes } from "../internal/utils/getResponsiveAttributes.js";
|
|
@@ -24,11 +26,15 @@ const hiddenOnNarrow = {
|
|
|
24
26
|
wide: false
|
|
25
27
|
};
|
|
26
28
|
const Root = /*#__PURE__*/ React.forwardRef((t0, forwardedRef) => {
|
|
27
|
-
const $ = c(
|
|
29
|
+
const $ = c(17);
|
|
28
30
|
const { children, className, as: t1, "aria-label": ariaLabel, role, hasBorder } = t0;
|
|
29
31
|
const BaseComponent = t1 === void 0 ? "div" : t1;
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
+
const mergedRefEnabled = useFeatureFlag("primer_react_merged_forwarded_refs");
|
|
33
|
+
const internalRef = useRef(null);
|
|
34
|
+
const mergedRef = useMergedRefs(internalRef, forwardedRef);
|
|
35
|
+
const providedOrCreatedRef = useProvidedRefOrCreate(forwardedRef);
|
|
36
|
+
const rootRef = mergedRefEnabled ? internalRef : providedOrCreatedRef;
|
|
37
|
+
const appliedRef = mergedRefEnabled ? mergedRef : providedOrCreatedRef;
|
|
32
38
|
const hoistChildState = (nodes) => {
|
|
33
39
|
const result = { hasNavigation: false };
|
|
34
40
|
for (const child of React.Children.toArray(nodes)) {
|
|
@@ -55,7 +61,7 @@ const Root = /*#__PURE__*/ React.forwardRef((t0, forwardedRef) => {
|
|
|
55
61
|
const isInteractive = _temp;
|
|
56
62
|
let t2;
|
|
57
63
|
let t3;
|
|
58
|
-
if ($[0] !== children) {
|
|
64
|
+
if ($[0] !== children || $[1] !== rootRef) {
|
|
59
65
|
t2 = function validateInteractiveElementsInTitle() {
|
|
60
66
|
let hasContextArea = false;
|
|
61
67
|
let hasLeadingAction = false;
|
|
@@ -70,28 +76,29 @@ const Root = /*#__PURE__*/ React.forwardRef((t0, forwardedRef) => {
|
|
|
70
76
|
};
|
|
71
77
|
t3 = [children, rootRef];
|
|
72
78
|
$[0] = children;
|
|
73
|
-
$[1] =
|
|
74
|
-
$[2] =
|
|
79
|
+
$[1] = rootRef;
|
|
80
|
+
$[2] = t2;
|
|
81
|
+
$[3] = t3;
|
|
75
82
|
} else {
|
|
76
|
-
t2 = $[
|
|
77
|
-
t3 = $[
|
|
83
|
+
t2 = $[2];
|
|
84
|
+
t3 = $[3];
|
|
78
85
|
}
|
|
79
86
|
useEffect(t2, t3);
|
|
80
87
|
let t4;
|
|
81
|
-
if ($[
|
|
88
|
+
if ($[4] !== className) {
|
|
82
89
|
t4 = clsx(PageHeader_module_css_default.PageHeader, className);
|
|
83
|
-
$[
|
|
84
|
-
$[
|
|
85
|
-
} else t4 = $[
|
|
90
|
+
$[4] = className;
|
|
91
|
+
$[5] = t4;
|
|
92
|
+
} else t4 = $[5];
|
|
86
93
|
const t5 = "PageHeader";
|
|
87
94
|
const t6 = hasBorder ? "true" : void 0;
|
|
88
95
|
const t7 = hasNavigation ? "" : void 0;
|
|
89
96
|
const t8 = getResponsiveAttributes("title-size-variant", titleVariant);
|
|
90
97
|
const t9 = getNavHiddenDataAttributes(navigationHidden);
|
|
91
98
|
let t10;
|
|
92
|
-
if ($[
|
|
99
|
+
if ($[6] !== BaseComponent || $[7] !== appliedRef || $[8] !== ariaLabel || $[9] !== children || $[10] !== role || $[11] !== t4 || $[12] !== t6 || $[13] !== t7 || $[14] !== t8 || $[15] !== t9) {
|
|
93
100
|
t10 = /*#__PURE__*/ jsx(BaseComponent, {
|
|
94
|
-
ref:
|
|
101
|
+
ref: appliedRef,
|
|
95
102
|
className: t4,
|
|
96
103
|
"data-component": t5,
|
|
97
104
|
"data-has-border": t6,
|
|
@@ -102,18 +109,18 @@ const Root = /*#__PURE__*/ React.forwardRef((t0, forwardedRef) => {
|
|
|
102
109
|
role,
|
|
103
110
|
children
|
|
104
111
|
});
|
|
105
|
-
$[
|
|
106
|
-
$[
|
|
107
|
-
$[
|
|
108
|
-
$[
|
|
109
|
-
$[
|
|
110
|
-
$[
|
|
111
|
-
$[
|
|
112
|
-
$[
|
|
113
|
-
$[
|
|
114
|
-
$[
|
|
115
|
-
$[
|
|
116
|
-
} else t10 = $[
|
|
112
|
+
$[6] = BaseComponent;
|
|
113
|
+
$[7] = appliedRef;
|
|
114
|
+
$[8] = ariaLabel;
|
|
115
|
+
$[9] = children;
|
|
116
|
+
$[10] = role;
|
|
117
|
+
$[11] = t4;
|
|
118
|
+
$[12] = t6;
|
|
119
|
+
$[13] = t7;
|
|
120
|
+
$[14] = t8;
|
|
121
|
+
$[15] = t9;
|
|
122
|
+
$[16] = t10;
|
|
123
|
+
} else t10 = $[16];
|
|
117
124
|
return t10;
|
|
118
125
|
});
|
|
119
126
|
const ContextArea = (t0) => {
|
|
@@ -295,6 +302,9 @@ const TitleArea = /*#__PURE__*/ React.forwardRef((t0, forwardedRef) => {
|
|
|
295
302
|
const { children, className, hidden: t1, variant: t2 } = t0;
|
|
296
303
|
const hidden = t1 === void 0 ? false : t1;
|
|
297
304
|
const variant = t2 === void 0 ? "medium" : t2;
|
|
305
|
+
const mergedRefEnabled = useFeatureFlag("primer_react_merged_forwarded_refs");
|
|
306
|
+
const providedOrCreatedRef = useProvidedRefOrCreate(forwardedRef);
|
|
307
|
+
const titleAreaRef = mergedRefEnabled ? forwardedRef : providedOrCreatedRef;
|
|
298
308
|
let t3;
|
|
299
309
|
if ($[0] !== className) {
|
|
300
310
|
t3 = clsx(PageHeader_module_css_default.TitleArea, className);
|
|
@@ -314,20 +324,20 @@ const TitleArea = /*#__PURE__*/ React.forwardRef((t0, forwardedRef) => {
|
|
|
314
324
|
$[5] = t5;
|
|
315
325
|
} else t5 = $[5];
|
|
316
326
|
let t6;
|
|
317
|
-
if ($[6] !== children || $[7] !==
|
|
327
|
+
if ($[6] !== children || $[7] !== t3 || $[8] !== t4 || $[9] !== t5 || $[10] !== titleAreaRef) {
|
|
318
328
|
t6 = /*#__PURE__*/ jsx("div", {
|
|
319
329
|
className: t3,
|
|
320
|
-
ref:
|
|
330
|
+
ref: titleAreaRef,
|
|
321
331
|
"data-component": "TitleArea",
|
|
322
332
|
...t4,
|
|
323
333
|
...t5,
|
|
324
334
|
children
|
|
325
335
|
});
|
|
326
336
|
$[6] = children;
|
|
327
|
-
$[7] =
|
|
328
|
-
$[8] =
|
|
329
|
-
$[9] =
|
|
330
|
-
$[10] =
|
|
337
|
+
$[7] = t3;
|
|
338
|
+
$[8] = t4;
|
|
339
|
+
$[9] = t5;
|
|
340
|
+
$[10] = titleAreaRef;
|
|
331
341
|
$[11] = t6;
|
|
332
342
|
} else t6 = $[11];
|
|
333
343
|
return t6;
|
|
@@ -2,13 +2,13 @@ import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
|
|
|
2
2
|
import { useProvidedStateOrCreate } from "../hooks/useProvidedStateOrCreate.js";
|
|
3
3
|
import { isAlphabetKey } from "../hooks/useMnemonics.js";
|
|
4
4
|
import { useId as useId$1 } from "../hooks/useId.js";
|
|
5
|
+
import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
|
|
5
6
|
import useSafeTimeout from "../hooks/useSafeTimeout.js";
|
|
6
7
|
import { IconButton } from "../Button/IconButton.js";
|
|
7
8
|
import { LinkButton } from "../Button/LinkButton.js";
|
|
8
9
|
import { ButtonComponent } from "../Button/Button.js";
|
|
9
10
|
import { useResponsiveValue } from "../hooks/useResponsiveValue.js";
|
|
10
11
|
import Heading from "../Heading/Heading.js";
|
|
11
|
-
import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
|
|
12
12
|
import { AnchoredOverlay } from "../AnchoredOverlay/AnchoredOverlay.js";
|
|
13
13
|
import { Banner } from "../Banner/index.js";
|
|
14
14
|
import { useFormControlContext } from "../FormControl/_FormControlContext.js";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
2
|
+
import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
|
|
2
3
|
import { AriaStatus } from "../live-region/AriaStatus.js";
|
|
4
|
+
import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
|
|
3
5
|
import Text_default from "../Text/Text.js";
|
|
4
6
|
import _VisuallyHidden_module_css_default from "../_VisuallyHidden.module.css.js";
|
|
5
7
|
import VisuallyHidden from "../_VisuallyHidden.js";
|
|
@@ -18,8 +20,12 @@ import { AlertFillIcon } from "@primer/octicons-react";
|
|
|
18
20
|
const TextInput = /*#__PURE__*/ React.forwardRef(({ icon: IconComponent, leadingVisual: LeadingVisual, trailingVisual: TrailingVisual, trailingAction, block, className, contrast, disabled, loading, loaderPosition = "auto", loaderText = "Loading", monospace, validationStatus, size: sizeProp, onFocus, onBlur, variant: variantProp, width: widthProp, minWidth: minWidthProp, maxWidth: maxWidthProp, type = "text", required, characterLimit, onChange, value, defaultValue, "data-component": dataComponent, ...inputProps }, ref) => {
|
|
19
21
|
var _counter$isOverLimit;
|
|
20
22
|
const [isInputFocused, setIsInputFocused] = useState(false);
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
+
const mergedRefEnabled = useFeatureFlag("primer_react_merged_forwarded_refs");
|
|
24
|
+
const internalRef = useRef(null);
|
|
25
|
+
const mergedRef = useMergedRefs(internalRef, ref);
|
|
26
|
+
const providedOrCreatedRef = useProvidedRefOrCreate(ref);
|
|
27
|
+
const inputRef = mergedRefEnabled ? internalRef : providedOrCreatedRef;
|
|
28
|
+
const appliedRef = mergedRefEnabled ? mergedRef : providedOrCreatedRef;
|
|
23
29
|
const isControlled = value !== void 0;
|
|
24
30
|
const [uncontrolledLength, setUncontrolledLength] = useState(() => defaultValue !== void 0 ? String(defaultValue).length : 0);
|
|
25
31
|
const currentLength = isControlled ? String(value).length : uncontrolledLength;
|
|
@@ -89,7 +95,7 @@ const TextInput = /*#__PURE__*/ React.forwardRef(({ icon: IconComponent, leading
|
|
|
89
95
|
children: typeof LeadingVisual !== "string" && isValidElementType(LeadingVisual) ? /*#__PURE__*/ jsx(LeadingVisual, {}) : LeadingVisual
|
|
90
96
|
}),
|
|
91
97
|
/*#__PURE__*/ jsx(UnstyledTextInput, {
|
|
92
|
-
ref:
|
|
98
|
+
ref: appliedRef,
|
|
93
99
|
disabled,
|
|
94
100
|
onFocus: handleInputFocus,
|
|
95
101
|
onBlur: handleInputBlur,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
2
|
+
import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
|
|
2
3
|
import { useOnEscapePress } from "../hooks/useOnEscapePress.js";
|
|
3
4
|
import { useId as useId$1 } from "../hooks/useId.js";
|
|
4
5
|
import { warning } from "../utils/warning.js";
|
|
6
|
+
import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
|
|
5
7
|
import { invariant } from "../utils/invariant.js";
|
|
6
8
|
import Tooltip_module_css_default from "./Tooltip.module.css.js";
|
|
7
9
|
import VisuallyHidden from "../_VisuallyHidden.js";
|
|
@@ -80,8 +82,12 @@ const emptyKeybindingHints = [];
|
|
|
80
82
|
const Tooltip = /*#__PURE__*/ React.forwardRef(({ direction = "s", text, type = "description", children, id, className, keybindingHint = emptyKeybindingHints, delay = "short", _privateDisableTooltip = false, ...rest }, forwardedRef) => {
|
|
81
83
|
const tooltipId = useId$1(id);
|
|
82
84
|
const child = Children.only(children);
|
|
83
|
-
const
|
|
84
|
-
const
|
|
85
|
+
const mergedRefEnabled = useFeatureFlag("primer_react_merged_forwarded_refs");
|
|
86
|
+
const internalRef = useRef(null);
|
|
87
|
+
const mergedTriggerRef = useMergedRefs(internalRef, forwardedRef);
|
|
88
|
+
const providedOrCreatedRef = useProvidedRefOrCreate(forwardedRef);
|
|
89
|
+
const triggerRef = mergedRefEnabled ? internalRef : providedOrCreatedRef;
|
|
90
|
+
const appliedTriggerRef = mergedRefEnabled ? mergedTriggerRef : providedOrCreatedRef;
|
|
85
91
|
const tooltipElRef = useRef(null);
|
|
86
92
|
const [calculatedDirection, setCalculatedDirection] = useState(direction);
|
|
87
93
|
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
|
|
@@ -158,7 +164,7 @@ const Tooltip = /*#__PURE__*/ React.forwardRef(({ direction = "s", text, type =
|
|
|
158
164
|
return /*#__PURE__*/ jsx(TooltipContext.Provider, {
|
|
159
165
|
value,
|
|
160
166
|
children: /*#__PURE__*/ jsxs(Fragment, { children: [/*#__PURE__*/ React.isValidElement(child) && /*#__PURE__*/ React.cloneElement(child, {
|
|
161
|
-
ref:
|
|
167
|
+
ref: appliedTriggerRef,
|
|
162
168
|
"aria-describedby": (() => {
|
|
163
169
|
if (type !== "description") return child.props["aria-describedby"];
|
|
164
170
|
const existingDescribedBy = child.props["aria-describedby"];
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { useMergedRefs } from "../../hooks/useMergedRefs.js";
|
|
2
|
+
import { useProvidedRefOrCreate } from "../../hooks/useProvidedRefOrCreate.js";
|
|
3
|
+
import { useFeatureFlag } from "../../FeatureFlags/useFeatureFlag.js";
|
|
2
4
|
import { c } from "react-compiler-runtime";
|
|
3
5
|
import { useRef } from "react";
|
|
4
6
|
//#region src/experimental/Tabs/useTabList.ts
|
|
5
7
|
function useTabList(props) {
|
|
6
|
-
const $ = c(
|
|
8
|
+
const $ = c(9);
|
|
7
9
|
const { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-orientation": ariaOrientation } = props;
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
+
const mergedRefEnabled = useFeatureFlag("primer_react_merged_forwarded_refs");
|
|
11
|
+
const internalRef = useRef(null);
|
|
12
|
+
const mergedRef = useMergedRefs(internalRef, props.ref);
|
|
13
|
+
const providedOrCreatedRef = useProvidedRefOrCreate(props.ref);
|
|
14
|
+
const ref = mergedRefEnabled ? internalRef : providedOrCreatedRef;
|
|
15
|
+
const appliedRef = mergedRefEnabled ? mergedRef : providedOrCreatedRef;
|
|
10
16
|
let t0;
|
|
11
|
-
if ($[0] !== ariaOrientation) {
|
|
17
|
+
if ($[0] !== ariaOrientation || $[1] !== ref) {
|
|
12
18
|
t0 = (event) => {
|
|
13
19
|
const { current: tablist } = ref;
|
|
14
20
|
if (tablist === null) return;
|
|
@@ -35,27 +41,28 @@ function useTabList(props) {
|
|
|
35
41
|
}
|
|
36
42
|
};
|
|
37
43
|
$[0] = ariaOrientation;
|
|
38
|
-
$[1] =
|
|
39
|
-
|
|
44
|
+
$[1] = ref;
|
|
45
|
+
$[2] = t0;
|
|
46
|
+
} else t0 = $[2];
|
|
40
47
|
const onKeyDown = t0;
|
|
41
48
|
const t1 = ariaOrientation !== null && ariaOrientation !== void 0 ? ariaOrientation : "horizontal";
|
|
42
49
|
let t2;
|
|
43
|
-
if ($[
|
|
50
|
+
if ($[3] !== appliedRef || $[4] !== ariaLabel || $[5] !== ariaLabelledby || $[6] !== onKeyDown || $[7] !== t1) {
|
|
44
51
|
t2 = { tabListProps: {
|
|
45
|
-
ref:
|
|
52
|
+
ref: appliedRef,
|
|
46
53
|
"aria-label": ariaLabel,
|
|
47
54
|
"aria-labelledby": ariaLabelledby,
|
|
48
55
|
"aria-orientation": t1,
|
|
49
56
|
role: "tablist",
|
|
50
57
|
onKeyDown
|
|
51
58
|
} };
|
|
52
|
-
$[
|
|
53
|
-
$[
|
|
54
|
-
$[
|
|
55
|
-
$[
|
|
56
|
-
$[
|
|
57
|
-
$[
|
|
58
|
-
} else t2 = $[
|
|
59
|
+
$[3] = appliedRef;
|
|
60
|
+
$[4] = ariaLabel;
|
|
61
|
+
$[5] = ariaLabelledby;
|
|
62
|
+
$[6] = onKeyDown;
|
|
63
|
+
$[7] = t1;
|
|
64
|
+
$[8] = t2;
|
|
65
|
+
} else t2 = $[8];
|
|
59
66
|
return t2;
|
|
60
67
|
}
|
|
61
68
|
function _temp2(tab_0) {
|
|
@@ -3,6 +3,9 @@ import { Announce } from "../live-region/Announce.js";
|
|
|
3
3
|
import { AriaAlert } from "../live-region/AriaAlert.js";
|
|
4
4
|
import { AriaStatus } from "../live-region/AriaStatus.js";
|
|
5
5
|
import { ButtonBase } from "../Button/ButtonBase.js";
|
|
6
|
+
import { DefaultFeatureFlags } from "../FeatureFlags/DefaultFeatureFlags.js";
|
|
7
|
+
import { FeatureFlags } from "../FeatureFlags/FeatureFlags.js";
|
|
8
|
+
import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
|
|
6
9
|
import { KeybindingHint } from "../KeybindingHint/KeybindingHint.js";
|
|
7
10
|
import { getAccessibleKeybindingHintString } from "../KeybindingHint/utils.js";
|
|
8
11
|
import { Tooltip } from "../TooltipV2/Tooltip.js";
|
|
@@ -10,9 +13,6 @@ import { useSlots } from "../hooks/useSlots.js";
|
|
|
10
13
|
import { useOverflow } from "../hooks/useOverflow.js";
|
|
11
14
|
import { ScrollableRegion } from "../ScrollableRegion/ScrollableRegion.js";
|
|
12
15
|
import { Dialog } from "../Dialog/Dialog.js";
|
|
13
|
-
import { DefaultFeatureFlags } from "../FeatureFlags/DefaultFeatureFlags.js";
|
|
14
|
-
import { FeatureFlags } from "../FeatureFlags/FeatureFlags.js";
|
|
15
|
-
import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
|
|
16
16
|
import { Stack } from "../Stack/index.js";
|
|
17
17
|
import { SkeletonBox } from "../Skeleton/SkeletonBox.js";
|
|
18
18
|
import { FilteredActionListLoadingTypes } from "../FilteredActionList/constants.js";
|
package/package.json
CHANGED