@primer/react 0.0.0-20260324184905 → 0.0.0-20260324190422
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/ActionMenu/ActionMenu.d.ts.map +1 -1
- package/dist/ActionMenu/ActionMenu.js +10 -7
- package/dist/AnchoredOverlay/AnchoredOverlay.d.ts +2 -2
- package/dist/AnchoredOverlay/AnchoredOverlay.d.ts.map +1 -1
- package/dist/AnchoredOverlay/AnchoredOverlay.js +7 -17
- 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/SelectPanel/SelectPanel.d.ts.map +1 -1
- package/dist/SelectPanel/SelectPanel.js +4 -3
- 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/ActionMenu.d.ts.map +1 -1
- package/dist/deprecated/ActionMenu.js +8 -7
- package/dist/deprecated/DialogV1/Dialog.js +9 -10
- package/dist/experimental/SelectPanel2/SelectPanel.d.ts.map +1 -1
- package/dist/experimental/SelectPanel2/SelectPanel.js +5 -5
- 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/useAnchoredPosition.js +1 -1
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @primer/react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-20260324190422
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -15,8 +15,6 @@
|
|
|
15
15
|
|
|
16
16
|
### Patch Changes
|
|
17
17
|
|
|
18
|
-
- [#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
|
|
19
|
-
|
|
20
18
|
- Fake entry to force publishing
|
|
21
19
|
|
|
22
20
|
- [#7510](https://github.com/primer/react/pull/7510) [`8fa988b`](https://github.com/primer/react/commit/8fa988ba613117874657af722ef6de768b0e0eb8) Thanks [@francinelucca](https://github.com/francinelucca)! - chore: ensure max-height does not surpass viewport height in Overlay, ActionMenu under feature flag
|
|
@@ -10,7 +10,7 @@ import styles from './ActionBar.module.css.js';
|
|
|
10
10
|
import { clsx } from 'clsx';
|
|
11
11
|
import { createDescendantRegistry } from '../utils/descendant-registry.js';
|
|
12
12
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
13
|
-
import {
|
|
13
|
+
import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.js';
|
|
14
14
|
import { FocusKeys } from '@primer/behaviors';
|
|
15
15
|
import { ActionMenu } from '../ActionMenu/ActionMenu.js';
|
|
16
16
|
|
|
@@ -423,7 +423,7 @@ const ActionBarIconButton = /*#__PURE__*/forwardRef(({
|
|
|
423
423
|
...props
|
|
424
424
|
}, forwardedRef) => {
|
|
425
425
|
const ref = useRef(null);
|
|
426
|
-
|
|
426
|
+
useRefObjectAsForwardedRef(forwardedRef, ref);
|
|
427
427
|
const {
|
|
428
428
|
size,
|
|
429
429
|
isVisibleChild
|
|
@@ -453,7 +453,7 @@ const ActionBarIconButton = /*#__PURE__*/forwardRef(({
|
|
|
453
453
|
if (!isVisibleChild(id) || groupId && !isVisibleChild(groupId)) return null;
|
|
454
454
|
return /*#__PURE__*/jsx(IconButton, {
|
|
455
455
|
"aria-disabled": disabled,
|
|
456
|
-
ref:
|
|
456
|
+
ref: ref,
|
|
457
457
|
size: size,
|
|
458
458
|
onClick: clickHandler,
|
|
459
459
|
...props,
|
|
@@ -7,12 +7,12 @@ import { invariant } from '../utils/invariant.js';
|
|
|
7
7
|
import { clsx } from 'clsx';
|
|
8
8
|
import classes from './Heading.module.css.js';
|
|
9
9
|
import { jsx } from 'react/jsx-runtime';
|
|
10
|
-
import {
|
|
10
|
+
import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.js';
|
|
11
11
|
import Heading$1 from '../Heading/Heading.js';
|
|
12
12
|
|
|
13
13
|
const Heading = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
14
14
|
var _props$id;
|
|
15
|
-
const $ = c(
|
|
15
|
+
const $ = c(20);
|
|
16
16
|
let as;
|
|
17
17
|
let children;
|
|
18
18
|
let className;
|
|
@@ -45,7 +45,7 @@ const Heading = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
45
45
|
}
|
|
46
46
|
const visuallyHidden = t1 === undefined ? false : t1;
|
|
47
47
|
const innerRef = React.useRef(null);
|
|
48
|
-
|
|
48
|
+
useRefObjectAsForwardedRef(forwardedRef, innerRef);
|
|
49
49
|
const {
|
|
50
50
|
headingId,
|
|
51
51
|
variant: listVariant
|
|
@@ -65,11 +65,11 @@ const Heading = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
65
65
|
t4 = $[8];
|
|
66
66
|
}
|
|
67
67
|
let t5;
|
|
68
|
-
if ($[9] !== as || $[10] !== children || $[11] !== listVariant || $[12] !==
|
|
68
|
+
if ($[9] !== as || $[10] !== children || $[11] !== listVariant || $[12] !== props || $[13] !== size || $[14] !== t3 || $[15] !== t4) {
|
|
69
69
|
t5 = /*#__PURE__*/jsx(Heading$1, {
|
|
70
70
|
as: as,
|
|
71
71
|
variant: size,
|
|
72
|
-
ref:
|
|
72
|
+
ref: innerRef,
|
|
73
73
|
id: t3,
|
|
74
74
|
className: t4,
|
|
75
75
|
"data-list-variant": listVariant,
|
|
@@ -79,26 +79,25 @@ const Heading = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
79
79
|
$[9] = as;
|
|
80
80
|
$[10] = children;
|
|
81
81
|
$[11] = listVariant;
|
|
82
|
-
$[12] =
|
|
83
|
-
$[13] =
|
|
84
|
-
$[14] =
|
|
85
|
-
$[15] =
|
|
86
|
-
$[16] =
|
|
87
|
-
$[17] = t5;
|
|
82
|
+
$[12] = props;
|
|
83
|
+
$[13] = size;
|
|
84
|
+
$[14] = t3;
|
|
85
|
+
$[15] = t4;
|
|
86
|
+
$[16] = t5;
|
|
88
87
|
} else {
|
|
89
|
-
t5 = $[
|
|
88
|
+
t5 = $[16];
|
|
90
89
|
}
|
|
91
90
|
let t6;
|
|
92
|
-
if ($[
|
|
91
|
+
if ($[17] !== t2 || $[18] !== t5) {
|
|
93
92
|
t6 = /*#__PURE__*/jsx(VisuallyHidden, {
|
|
94
93
|
isVisible: t2,
|
|
95
94
|
children: t5
|
|
96
95
|
});
|
|
97
|
-
$[
|
|
98
|
-
$[
|
|
99
|
-
$[
|
|
96
|
+
$[17] = t2;
|
|
97
|
+
$[18] = t5;
|
|
98
|
+
$[19] = t6;
|
|
100
99
|
} else {
|
|
101
|
-
t6 = $[
|
|
100
|
+
t6 = $[19];
|
|
102
101
|
}
|
|
103
102
|
return t6;
|
|
104
103
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/ActionList/List.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/ActionList/List.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAA;AAuF7C,QAAA,MAAM,IAAI,GA3Ea,EAAE,SAAS,KAAK,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;oDA2ER,CAAA;AAI3C,OAAO,EAAC,IAAI,EAAC,CAAA"}
|
package/dist/ActionList/List.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useRef } from 'react';
|
|
3
3
|
import { fixedForwardRef } from '../utils/modern-polymorphic.js';
|
|
4
4
|
import { ActionListContainerContext } from './ActionListContainerContext.js';
|
|
5
5
|
import { useSlots } from '../hooks/useSlots.js';
|
|
@@ -10,12 +10,12 @@ import { useFocusZone } from '../hooks/useFocusZone.js';
|
|
|
10
10
|
import { clsx } from 'clsx';
|
|
11
11
|
import classes from './ActionList.module.css.js';
|
|
12
12
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
13
|
-
import {
|
|
13
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
14
14
|
import { FocusKeys } from '@primer/behaviors';
|
|
15
15
|
|
|
16
16
|
const UnwrappedList = (props, forwardedRef) => {
|
|
17
17
|
var _slots$heading$props$;
|
|
18
|
-
const $ = c(
|
|
18
|
+
const $ = c(36);
|
|
19
19
|
let className;
|
|
20
20
|
let restProps;
|
|
21
21
|
let role;
|
|
@@ -78,7 +78,8 @@ const UnwrappedList = (props, forwardedRef) => {
|
|
|
78
78
|
} = React.useContext(ActionListContainerContext);
|
|
79
79
|
const ariaLabelledBy = slots.heading ? (_slots$heading$props$ = slots.heading.props.id) !== null && _slots$heading$props$ !== void 0 ? _slots$heading$props$ : headingId : listLabelledBy;
|
|
80
80
|
const listRole = role || listRoleFromContainer;
|
|
81
|
-
const listRef =
|
|
81
|
+
const listRef = useRef(null);
|
|
82
|
+
const mergedRef = useMergedRefs(forwardedRef, listRef);
|
|
82
83
|
let enableFocusZone = false;
|
|
83
84
|
if (enableFocusZoneFromContainer !== undefined) {
|
|
84
85
|
enableFocusZone = enableFocusZoneFromContainer;
|
|
@@ -97,24 +98,23 @@ const UnwrappedList = (props, forwardedRef) => {
|
|
|
97
98
|
const t5 = !enableFocusZone;
|
|
98
99
|
const t6 = listRole === "menu" || container === "SelectPanel" || container === "FilteredActionList" ? "wrap" : undefined;
|
|
99
100
|
let t7;
|
|
100
|
-
if ($[11] !==
|
|
101
|
+
if ($[11] !== t5 || $[12] !== t6) {
|
|
101
102
|
t7 = {
|
|
102
103
|
disabled: t5,
|
|
103
104
|
containerRef: listRef,
|
|
104
105
|
bindKeys: FocusKeys.ArrowVertical | FocusKeys.HomeAndEnd | FocusKeys.PageUpDown,
|
|
105
106
|
focusOutBehavior: t6
|
|
106
107
|
};
|
|
107
|
-
$[11] =
|
|
108
|
-
$[12] =
|
|
109
|
-
$[13] =
|
|
110
|
-
$[14] = t7;
|
|
108
|
+
$[11] = t5;
|
|
109
|
+
$[12] = t6;
|
|
110
|
+
$[13] = t7;
|
|
111
111
|
} else {
|
|
112
|
-
t7 = $[
|
|
112
|
+
t7 = $[13];
|
|
113
113
|
}
|
|
114
114
|
useFocusZone(t7);
|
|
115
115
|
const t8 = selectionVariant || containerSelectionVariant;
|
|
116
116
|
let t9;
|
|
117
|
-
if ($[
|
|
117
|
+
if ($[14] !== headingId || $[15] !== listRole || $[16] !== showDividers || $[17] !== t8 || $[18] !== variant) {
|
|
118
118
|
t9 = {
|
|
119
119
|
variant,
|
|
120
120
|
selectionVariant: t8,
|
|
@@ -122,62 +122,62 @@ const UnwrappedList = (props, forwardedRef) => {
|
|
|
122
122
|
role: listRole,
|
|
123
123
|
headingId
|
|
124
124
|
};
|
|
125
|
-
$[
|
|
126
|
-
$[
|
|
127
|
-
$[
|
|
128
|
-
$[
|
|
129
|
-
$[
|
|
130
|
-
$[
|
|
125
|
+
$[14] = headingId;
|
|
126
|
+
$[15] = listRole;
|
|
127
|
+
$[16] = showDividers;
|
|
128
|
+
$[17] = t8;
|
|
129
|
+
$[18] = variant;
|
|
130
|
+
$[19] = t9;
|
|
131
131
|
} else {
|
|
132
|
-
t9 = $[
|
|
132
|
+
t9 = $[19];
|
|
133
133
|
}
|
|
134
134
|
const listContextValue = t9;
|
|
135
135
|
const t10 = slots.heading;
|
|
136
136
|
let t11;
|
|
137
|
-
if ($[
|
|
137
|
+
if ($[20] !== className) {
|
|
138
138
|
t11 = clsx(classes.ActionList, className);
|
|
139
|
-
$[
|
|
140
|
-
$[
|
|
139
|
+
$[20] = className;
|
|
140
|
+
$[21] = t11;
|
|
141
141
|
} else {
|
|
142
|
-
t11 = $[
|
|
142
|
+
t11 = $[21];
|
|
143
143
|
}
|
|
144
144
|
let t12;
|
|
145
|
-
if ($[
|
|
145
|
+
if ($[22] !== Component || $[23] !== ariaLabelledBy || $[24] !== childrenWithoutSlots || $[25] !== listRole || $[26] !== mergedRef || $[27] !== restProps || $[28] !== showDividers || $[29] !== t11 || $[30] !== variant) {
|
|
146
146
|
t12 = /*#__PURE__*/jsx(Component, {
|
|
147
147
|
className: t11,
|
|
148
148
|
role: listRole,
|
|
149
149
|
"aria-labelledby": ariaLabelledBy,
|
|
150
|
-
ref:
|
|
150
|
+
ref: mergedRef,
|
|
151
151
|
"data-dividers": showDividers,
|
|
152
152
|
"data-variant": variant,
|
|
153
153
|
...restProps,
|
|
154
154
|
children: childrenWithoutSlots
|
|
155
155
|
});
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
160
|
-
$[
|
|
161
|
-
$[
|
|
162
|
-
$[
|
|
163
|
-
$[
|
|
164
|
-
$[
|
|
165
|
-
$[
|
|
156
|
+
$[22] = Component;
|
|
157
|
+
$[23] = ariaLabelledBy;
|
|
158
|
+
$[24] = childrenWithoutSlots;
|
|
159
|
+
$[25] = listRole;
|
|
160
|
+
$[26] = mergedRef;
|
|
161
|
+
$[27] = restProps;
|
|
162
|
+
$[28] = showDividers;
|
|
163
|
+
$[29] = t11;
|
|
164
|
+
$[30] = variant;
|
|
165
|
+
$[31] = t12;
|
|
166
166
|
} else {
|
|
167
|
-
t12 = $[
|
|
167
|
+
t12 = $[31];
|
|
168
168
|
}
|
|
169
169
|
let t13;
|
|
170
|
-
if ($[
|
|
170
|
+
if ($[32] !== listContextValue || $[33] !== slots.heading || $[34] !== t12) {
|
|
171
171
|
t13 = /*#__PURE__*/jsxs(ListContext.Provider, {
|
|
172
172
|
value: listContextValue,
|
|
173
173
|
children: [t10, t12]
|
|
174
174
|
});
|
|
175
|
-
$[
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
175
|
+
$[32] = listContextValue;
|
|
176
|
+
$[33] = slots.heading;
|
|
177
|
+
$[34] = t12;
|
|
178
|
+
$[35] = t13;
|
|
179
179
|
} else {
|
|
180
|
-
t13 = $[
|
|
180
|
+
t13 = $[35];
|
|
181
181
|
}
|
|
182
182
|
return t13;
|
|
183
183
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionMenu.d.ts","sourceRoot":"","sources":["../../src/ActionMenu/ActionMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ActionMenu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,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAA;AA2DxH,6CAA6C;AAC7C,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAAA;AAe/C,KAAK,gBAAgB,GAAG,OAAO,CAAC,YAAY,CAAC,GAC3C,IAAI,CAAC,oBAAoB,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,mBAAmB,CAAC,GAAG;IAC/E;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,gBAAgB,CAAC,EAAE,CAAC,EAAC,QAAQ,EAAC,EAAE;QAAC,QAAQ,EAAE,cAAc,CAAA;KAAC,KAAK,IAAI,CAAA;CACpE,CAAA;AAsHH,eAAO,MAAM,UAAU;;;kBAnMP,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC;aAC5B,MAAM;;;;CAkM4E,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useContext, useState, useEffect, useCallback, useMemo } from 'react';
|
|
1
|
+
import React, { useContext, useRef, useState, useEffect, useCallback, useMemo } from 'react';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
3
|
import { ChevronRightIcon, TriangleDownIcon } from '@primer/octicons-react';
|
|
4
4
|
import { Divider } from '../ActionList/Divider.js';
|
|
@@ -11,7 +11,7 @@ import { isSlot } from '../utils/is-slot.js';
|
|
|
11
11
|
import { DialogContext } from '../Dialog/Dialog.js';
|
|
12
12
|
import { jsx } from 'react/jsx-runtime';
|
|
13
13
|
import { useProvidedStateOrCreate } from '../hooks/useProvidedStateOrCreate.js';
|
|
14
|
-
import {
|
|
14
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
15
15
|
import { useMenuKeyboardNavigation } from '../hooks/useMenuKeyboardNavigation.js';
|
|
16
16
|
import { useFeatureFlag } from '../FeatureFlags/useFeatureFlag.js';
|
|
17
17
|
import { AnchoredOverlay } from '../AnchoredOverlay/AnchoredOverlay.js';
|
|
@@ -76,7 +76,8 @@ const Menu = ({
|
|
|
76
76
|
}, [setCombinedOpenState, parentMenuContext, open, isNarrow]);
|
|
77
77
|
const menuButtonChild = React.Children.toArray(children).find(child => /*#__PURE__*/React.isValidElement(child) && (child.type === MenuButton || child.type === Anchor || isSlot(child, Anchor) || isSlot(child, MenuButton)));
|
|
78
78
|
const menuButtonChildId = /*#__PURE__*/React.isValidElement(menuButtonChild) ? menuButtonChild.props.id : undefined;
|
|
79
|
-
const anchorRef =
|
|
79
|
+
const anchorRef = useRef(null);
|
|
80
|
+
const mergedRef = useMergedRefs(anchorRef, externalAnchorRef);
|
|
80
81
|
const anchorId = useId(menuButtonChildId);
|
|
81
82
|
let renderAnchor = null;
|
|
82
83
|
// 🚨 Hack for good API!
|
|
@@ -97,7 +98,7 @@ const Menu = ({
|
|
|
97
98
|
}, anchorChildren.props));
|
|
98
99
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
99
100
|
children: triggerButton,
|
|
100
|
-
ref:
|
|
101
|
+
ref: mergedRef
|
|
101
102
|
});
|
|
102
103
|
};
|
|
103
104
|
}
|
|
@@ -119,7 +120,7 @@ const Menu = ({
|
|
|
119
120
|
});
|
|
120
121
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
121
122
|
children: tooltip,
|
|
122
|
-
ref:
|
|
123
|
+
ref: mergedRef
|
|
123
124
|
});
|
|
124
125
|
};
|
|
125
126
|
}
|
|
@@ -226,7 +227,7 @@ const Overlay = ({
|
|
|
226
227
|
// we typecast anchorRef as required instead of optional
|
|
227
228
|
// because we know that we're setting it in context in Menu
|
|
228
229
|
const {
|
|
229
|
-
anchorRef,
|
|
230
|
+
anchorRef: contextAnchorRef,
|
|
230
231
|
renderAnchor,
|
|
231
232
|
anchorId,
|
|
232
233
|
open,
|
|
@@ -234,6 +235,8 @@ const Overlay = ({
|
|
|
234
235
|
onClose,
|
|
235
236
|
isSubmenu = false
|
|
236
237
|
} = React.useContext(MenuContext);
|
|
238
|
+
const anchorRef = useRef(null);
|
|
239
|
+
const mergedAnchorRef = useMergedRefs(anchorRef, contextAnchorRef);
|
|
237
240
|
const containerRef = React.useRef(null);
|
|
238
241
|
const isNarrow = useResponsiveValue({
|
|
239
242
|
narrow: true
|
|
@@ -268,7 +271,7 @@ const Overlay = ({
|
|
|
268
271
|
const featureFlagMaxHeightClampToViewport = useFeatureFlag('primer_react_overlay_max_height_clamp_to_viewport');
|
|
269
272
|
const isInsideDialog = useContext(DialogContext) !== undefined;
|
|
270
273
|
return /*#__PURE__*/jsx(AnchoredOverlay, {
|
|
271
|
-
anchorRef:
|
|
274
|
+
anchorRef: mergedAnchorRef,
|
|
272
275
|
renderAnchor: renderAnchor,
|
|
273
276
|
anchorId: anchorId,
|
|
274
277
|
open: open,
|
|
@@ -15,7 +15,7 @@ interface AnchoredOverlayPropsWithAnchor {
|
|
|
15
15
|
/**
|
|
16
16
|
* An override to the internal ref that will be spread on to the renderAnchor
|
|
17
17
|
*/
|
|
18
|
-
anchorRef?: React.
|
|
18
|
+
anchorRef?: React.Ref<HTMLElement | null>;
|
|
19
19
|
/**
|
|
20
20
|
* An override to the internal id that will be spread on to the renderAnchor
|
|
21
21
|
*/
|
|
@@ -31,7 +31,7 @@ interface AnchoredOverlayPropsWithoutAnchor {
|
|
|
31
31
|
* An override to the internal renderAnchor ref that will be used to position the overlay.
|
|
32
32
|
* When renderAnchor is null this can be used to make an anchor that is detached from ActionMenu.
|
|
33
33
|
*/
|
|
34
|
-
anchorRef: React.
|
|
34
|
+
anchorRef: React.Ref<HTMLElement | null>;
|
|
35
35
|
/**
|
|
36
36
|
* An override to the internal id that will be spread on to the renderAnchor
|
|
37
37
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnchoredOverlay.d.ts","sourceRoot":"","sources":["../../src/AnchoredOverlay/AnchoredOverlay.tsx"],"names":[],"mappings":"AAA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C,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAA;IAElD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,YAAY,CAAC,CAAA;IAChE;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,EAAC,QAAQ,EAAC,EAAE;QAAC,QAAQ,EAAE,cAAc,CAAA;KAAC,KAAK,IAAI,CAAA;IACnE;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;CAC5C;AAED,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,GACzD,CAAC,8BAA8B,GAAG,iCAAiC,CAAC,GACpE,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,MAAM,GAAG,cAAc,GAAG,iBAAiB,GAAG,mBAAmB,CAAC,CAAC,CAAA;AAoB9G;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CA+KnF,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useRef, useCallback, useEffect } from 'react';
|
|
2
2
|
import { useFocusTrap } from '../hooks/useFocusTrap.js';
|
|
3
3
|
import { useFocusZone } from '../hooks/useFocusZone.js';
|
|
4
4
|
import { useId } from '../hooks/useId.js';
|
|
@@ -8,7 +8,7 @@ import classes from './AnchoredOverlay.module.css.js';
|
|
|
8
8
|
import { clsx } from 'clsx';
|
|
9
9
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
10
10
|
import { useFeatureFlag } from '../FeatureFlags/useFeatureFlag.js';
|
|
11
|
-
import {
|
|
11
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
12
12
|
import { useRenderForcingRef } from '../hooks/useRenderForcingRef.js';
|
|
13
13
|
import { useAnchoredPosition } from '../hooks/useAnchoredPosition.js';
|
|
14
14
|
import Overlay from '../Overlay/Overlay.js';
|
|
@@ -60,8 +60,10 @@ const AnchoredOverlay = ({
|
|
|
60
60
|
closeButtonProps = defaultCloseButtonProps
|
|
61
61
|
}) => {
|
|
62
62
|
const cssAnchorPositioning = useFeatureFlag('primer_react_css_anchor_positioning');
|
|
63
|
-
const anchorRef =
|
|
63
|
+
const anchorRef = useRef(null);
|
|
64
|
+
const mergedRef = useMergedRefs(anchorRef, externalAnchorRef);
|
|
64
65
|
const [overlayRef, updateOverlayRef] = useRenderForcingRef();
|
|
66
|
+
const mergedOverlayRef = useMergedRefs(updateOverlayRef, overlayProps === null || overlayProps === void 0 ? void 0 : overlayProps.ref);
|
|
65
67
|
const anchorId = useId(externalAnchorId);
|
|
66
68
|
const onClickOutside = useCallback(() => onClose === null || onClose === void 0 ? void 0 : onClose('click-outside'), [onClose]);
|
|
67
69
|
const onEscape = useCallback(() => onClose === null || onClose === void 0 ? void 0 : onClose('escape'), [onClose]);
|
|
@@ -133,7 +135,7 @@ const AnchoredOverlay = ({
|
|
|
133
135
|
} = overlayProps || {};
|
|
134
136
|
const innerContent = /*#__PURE__*/jsxs(Fragment, {
|
|
135
137
|
children: [renderAnchor && renderAnchor({
|
|
136
|
-
ref:
|
|
138
|
+
ref: mergedRef,
|
|
137
139
|
id: anchorId,
|
|
138
140
|
'aria-haspopup': 'true',
|
|
139
141
|
'aria-expanded': open,
|
|
@@ -160,12 +162,7 @@ const AnchoredOverlay = ({
|
|
|
160
162
|
preventOverflow: preventOverflow,
|
|
161
163
|
"data-component": "AnchoredOverlay",
|
|
162
164
|
...restOverlayProps,
|
|
163
|
-
ref:
|
|
164
|
-
if (overlayProps !== null && overlayProps !== void 0 && overlayProps.ref) {
|
|
165
|
-
assignRef(overlayProps.ref, node);
|
|
166
|
-
}
|
|
167
|
-
updateOverlayRef(node);
|
|
168
|
-
},
|
|
165
|
+
ref: mergedOverlayRef,
|
|
169
166
|
"data-anchor-position": cssAnchorPositioning,
|
|
170
167
|
"data-side": cssAnchorPositioning ? side : position_0 === null || position_0 === void 0 ? void 0 : position_0.anchorSide,
|
|
171
168
|
children: [showXIcon ? /*#__PURE__*/jsx("div", {
|
|
@@ -198,13 +195,6 @@ const AnchoredOverlay = ({
|
|
|
198
195
|
}
|
|
199
196
|
return innerContent;
|
|
200
197
|
};
|
|
201
|
-
function assignRef(ref, value) {
|
|
202
|
-
if (typeof ref === 'function') {
|
|
203
|
-
ref(value);
|
|
204
|
-
} else if (ref) {
|
|
205
|
-
ref.current = value;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
198
|
AnchoredOverlay.displayName = 'AnchoredOverlay';
|
|
209
199
|
|
|
210
200
|
export { AnchoredOverlay };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useContext, useState, useCallback, useEffect } from 'react';
|
|
2
2
|
import { AutocompleteContext, AutocompleteInputContext } from './AutocompleteContext.js';
|
|
3
|
-
import {
|
|
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
|
-
|
|
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:
|
|
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 {
|
|
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
|
-
|
|
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:
|
|
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),
|
|
@@ -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,
|
|
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 {
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["../../src/ButtonGroup/ButtonGroup.tsx"],"names":[],"mappings":"AAAA,OAAc,
|
|
1
|
+
{"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["../../src/ButtonGroup/ButtonGroup.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAS,KAAK,iBAAiB,EAAC,MAAM,OAAO,CAAA;AAK3D,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAE/F,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;IAC/C,4BAA4B;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAC,CAAA;AAEF,QAAA,MAAM,WAAW,EAoBX,8BAA8B,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAA;AAI7D,eAAe,WAAW,CAAA"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useRef } from 'react';
|
|
3
3
|
import classes from './ButtonGroup.module.css.js';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { useFocusZone } from '../hooks/useFocusZone.js';
|
|
6
6
|
import { jsx } from 'react/jsx-runtime';
|
|
7
|
-
import {
|
|
7
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
8
8
|
import { FocusKeys } from '@primer/behaviors';
|
|
9
9
|
|
|
10
10
|
const ButtonGroup = /*#__PURE__*/React.forwardRef(function ButtonGroup(t0, forwardRef) {
|
|
11
|
-
const $ = c(
|
|
11
|
+
const $ = c(19);
|
|
12
12
|
let children;
|
|
13
13
|
let className;
|
|
14
14
|
let rest;
|
|
@@ -45,49 +45,49 @@ const ButtonGroup = /*#__PURE__*/React.forwardRef(function ButtonGroup(t0, forwa
|
|
|
45
45
|
t2 = $[7];
|
|
46
46
|
}
|
|
47
47
|
const buttons = t2;
|
|
48
|
-
const buttonRef =
|
|
48
|
+
const buttonRef = useRef(null);
|
|
49
|
+
const mergedRef = useMergedRefs(buttonRef, forwardRef);
|
|
49
50
|
const t3 = role !== "toolbar";
|
|
50
51
|
let t4;
|
|
51
|
-
if ($[8] !==
|
|
52
|
+
if ($[8] !== t3) {
|
|
52
53
|
t4 = {
|
|
53
54
|
containerRef: buttonRef,
|
|
54
55
|
disabled: t3,
|
|
55
56
|
bindKeys: FocusKeys.ArrowHorizontal,
|
|
56
57
|
focusOutBehavior: "wrap"
|
|
57
58
|
};
|
|
58
|
-
$[8] =
|
|
59
|
-
$[9] =
|
|
60
|
-
$[10] = t4;
|
|
59
|
+
$[8] = t3;
|
|
60
|
+
$[9] = t4;
|
|
61
61
|
} else {
|
|
62
|
-
t4 = $[
|
|
62
|
+
t4 = $[9];
|
|
63
63
|
}
|
|
64
64
|
useFocusZone(t4);
|
|
65
65
|
let t5;
|
|
66
|
-
if ($[
|
|
66
|
+
if ($[10] !== className) {
|
|
67
67
|
t5 = clsx(className, classes.ButtonGroup);
|
|
68
|
-
$[
|
|
69
|
-
$[
|
|
68
|
+
$[10] = className;
|
|
69
|
+
$[11] = t5;
|
|
70
70
|
} else {
|
|
71
|
-
t5 = $[
|
|
71
|
+
t5 = $[11];
|
|
72
72
|
}
|
|
73
73
|
let t6;
|
|
74
|
-
if ($[
|
|
74
|
+
if ($[12] !== BaseComponent || $[13] !== buttons || $[14] !== mergedRef || $[15] !== rest || $[16] !== role || $[17] !== t5) {
|
|
75
75
|
t6 = /*#__PURE__*/jsx(BaseComponent, {
|
|
76
|
-
ref:
|
|
76
|
+
ref: mergedRef,
|
|
77
77
|
className: t5,
|
|
78
78
|
role: role,
|
|
79
79
|
...rest,
|
|
80
80
|
children: buttons
|
|
81
81
|
});
|
|
82
|
-
$[
|
|
83
|
-
$[
|
|
84
|
-
$[
|
|
85
|
-
$[
|
|
86
|
-
$[
|
|
87
|
-
$[
|
|
88
|
-
$[
|
|
82
|
+
$[12] = BaseComponent;
|
|
83
|
+
$[13] = buttons;
|
|
84
|
+
$[14] = mergedRef;
|
|
85
|
+
$[15] = rest;
|
|
86
|
+
$[16] = role;
|
|
87
|
+
$[17] = t5;
|
|
88
|
+
$[18] = t6;
|
|
89
89
|
} else {
|
|
90
|
-
t6 = $[
|
|
90
|
+
t6 = $[18];
|
|
91
91
|
}
|
|
92
92
|
return t6;
|
|
93
93
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../src/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../src/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAKZ,KAAK,mBAAmB,EAEzB,MAAM,OAAO,CAAA;AAEd,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,qCAAqC,CAAA;AAI7E,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAA;AAElD,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAA;IACvC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;IACvC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,GAAG,OAAO,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC,CAAA;AAE3D;;GAEG;AACH,QAAA,MAAM,QAAQ,qGAiDb,CAAA;wBAK0B,cAAc,CAAC,OAAO,QAAQ,CAAC;AAA1D,wBAA0D"}
|