@primer/react 0.0.0-20260220145113 → 0.0.0-20260220145222
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 -9
- package/dist/Autocomplete/Autocomplete.js +159 -76
- package/dist/Autocomplete/AutocompleteMenu.js +333 -128
- package/dist/Autocomplete/AutocompleteOverlay.js +130 -49
- package/dist/Banner/Banner.js +238 -64
- package/dist/Button/Button.js +34 -11
- package/dist/Button/IconButton.js +140 -51
- package/dist/Button/LinkButton.js +39 -11
- package/dist/Checkbox/Checkbox.js +163 -55
- package/dist/Dialog/Dialog.js +347 -105
- package/dist/PageLayout/PageLayout.js +1560 -622
- package/dist/Text/Text.d.ts +1 -1
- package/dist/Text/Text.d.ts.map +1 -1
- package/dist/Text/Text.js +13 -10
- package/dist/UnderlineNav/UnderlineNavItem.js +149 -56
- package/dist/experimental/SelectPanel2/SelectPanel.js +593 -209
- package/dist/hooks/useRefObjectAsForwardedRef.d.ts.map +1 -1
- package/dist/hooks/useRefObjectAsForwardedRef.js +2 -10
- package/dist/hooks/useScrollFlash.d.ts.map +1 -1
- package/dist/hooks/useScrollFlash.js +22 -14
- package/dist/hooks/useSlots.d.ts +6 -50
- package/dist/hooks/useSlots.d.ts.map +1 -1
- package/dist/hooks/useSlots.js +36 -114
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
# @primer/react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-20260220145222
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- Fake entry to force publishing
|
|
8
8
|
|
|
9
|
-
- [#7555](https://github.com/primer/react/pull/7555) [`64c2243`](https://github.com/primer/react/commit/64c2243d07fc580a5565493b917b27081ef6a191) Thanks [@hectahertz](https://github.com/hectahertz)! - perf(useSlots): short-circuit iteration and skip filled slots
|
|
10
|
-
|
|
11
|
-
- [#7547](https://github.com/primer/react/pull/7547) [`4943d67`](https://github.com/primer/react/commit/4943d671ddb590461e59f9745e6093d47e770f7a) Thanks [@hectahertz](https://github.com/hectahertz)! - perf(useScrollFlash): defer scroll read/write to requestAnimationFrame to avoid forced reflow
|
|
12
|
-
|
|
13
|
-
- [#7551](https://github.com/primer/react/pull/7551) [`2fbfc49`](https://github.com/primer/react/commit/2fbfc49fad6f11edc51850e32e9c0b2ade8ca1f1) Thanks [@hectahertz](https://github.com/hectahertz)! - perf(Text): remove unnecessary useRef and useImperativeHandle hooks
|
|
14
|
-
|
|
15
|
-
- [#7553](https://github.com/primer/react/pull/7553) [`6225ba2`](https://github.com/primer/react/commit/6225ba231cfdbe6ef7fa41dd62734d5a970bdc7d) Thanks [@hectahertz](https://github.com/hectahertz)! - perf(useRefObjectAsForwardedRef): add dependency array to useImperativeHandle
|
|
16
|
-
|
|
17
9
|
## 38.13.0
|
|
18
10
|
|
|
19
11
|
### Minor Changes
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { c } from 'react-compiler-runtime';
|
|
2
|
+
import { useRef, useReducer, useDeferredValue } from 'react';
|
|
3
|
+
import { AutocompleteContext, AutocompleteDeferredInputContext, AutocompleteInputContext } from './AutocompleteContext.js';
|
|
3
4
|
import AutocompleteInput from './AutocompleteInput.js';
|
|
4
5
|
import AutocompleteMenu from './AutocompleteMenu.js';
|
|
5
6
|
import AutocompleteOverlay from './AutocompleteOverlay.js';
|
|
@@ -48,10 +49,12 @@ const reducer = (state, action) => {
|
|
|
48
49
|
return state;
|
|
49
50
|
}
|
|
50
51
|
};
|
|
51
|
-
const Autocomplete =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
const Autocomplete = t0 => {
|
|
53
|
+
const $ = c(24);
|
|
54
|
+
const {
|
|
55
|
+
children,
|
|
56
|
+
id: idProp
|
|
57
|
+
} = t0;
|
|
55
58
|
const activeDescendantRef = useRef(null);
|
|
56
59
|
const scrollContainerRef = useRef(null);
|
|
57
60
|
const inputRef = useRef(null);
|
|
@@ -63,80 +66,160 @@ const Autocomplete = ({
|
|
|
63
66
|
isMenuDirectlyActivated,
|
|
64
67
|
selectedItemLength
|
|
65
68
|
} = state;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
69
|
+
let t1;
|
|
70
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
71
|
+
t1 = value => {
|
|
72
|
+
dispatch({
|
|
73
|
+
type: "inputValue",
|
|
74
|
+
payload: value
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
$[0] = t1;
|
|
78
|
+
} else {
|
|
79
|
+
t1 = $[0];
|
|
80
|
+
}
|
|
81
|
+
const setInputValue = t1;
|
|
82
|
+
let t2;
|
|
83
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
84
|
+
t2 = value_0 => {
|
|
85
|
+
dispatch({
|
|
86
|
+
type: "showMenu",
|
|
87
|
+
payload: value_0
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
$[1] = t2;
|
|
91
|
+
} else {
|
|
92
|
+
t2 = $[1];
|
|
93
|
+
}
|
|
94
|
+
const setShowMenu = t2;
|
|
95
|
+
let t3;
|
|
96
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
97
|
+
t3 = value_1 => {
|
|
98
|
+
dispatch({
|
|
99
|
+
type: "autocompleteSuggestion",
|
|
100
|
+
payload: value_1
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
$[2] = t3;
|
|
104
|
+
} else {
|
|
105
|
+
t3 = $[2];
|
|
106
|
+
}
|
|
107
|
+
const setAutocompleteSuggestion = t3;
|
|
108
|
+
let t4;
|
|
109
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
110
|
+
t4 = value_2 => {
|
|
111
|
+
dispatch({
|
|
112
|
+
type: "isMenuDirectlyActivated",
|
|
113
|
+
payload: value_2
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
$[3] = t4;
|
|
117
|
+
} else {
|
|
118
|
+
t4 = $[3];
|
|
119
|
+
}
|
|
120
|
+
const setIsMenuDirectlyActivated = t4;
|
|
121
|
+
let t5;
|
|
122
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
123
|
+
t5 = value_3 => {
|
|
124
|
+
dispatch({
|
|
125
|
+
type: "selectedItemLength",
|
|
126
|
+
payload: value_3
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
$[4] = t5;
|
|
130
|
+
} else {
|
|
131
|
+
t5 = $[4];
|
|
132
|
+
}
|
|
133
|
+
const setSelectedItemLength = t5;
|
|
96
134
|
const id = useId(idProp);
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
135
|
+
let t6;
|
|
136
|
+
if ($[5] !== id || $[6] !== selectedItemLength || $[7] !== showMenu) {
|
|
137
|
+
t6 = {
|
|
138
|
+
activeDescendantRef,
|
|
139
|
+
id,
|
|
140
|
+
inputRef,
|
|
141
|
+
scrollContainerRef,
|
|
142
|
+
selectedItemLength,
|
|
143
|
+
setAutocompleteSuggestion,
|
|
144
|
+
setInputValue,
|
|
145
|
+
setIsMenuDirectlyActivated,
|
|
146
|
+
setShowMenu,
|
|
147
|
+
setSelectedItemLength,
|
|
148
|
+
showMenu
|
|
149
|
+
};
|
|
150
|
+
$[5] = id;
|
|
151
|
+
$[6] = selectedItemLength;
|
|
152
|
+
$[7] = showMenu;
|
|
153
|
+
$[8] = t6;
|
|
154
|
+
} else {
|
|
155
|
+
t6 = $[8];
|
|
156
|
+
}
|
|
157
|
+
const autocompleteContextValue = t6;
|
|
158
|
+
let t7;
|
|
159
|
+
if ($[9] !== autocompleteSuggestion || $[10] !== inputValue || $[11] !== isMenuDirectlyActivated) {
|
|
160
|
+
t7 = {
|
|
161
|
+
autocompleteSuggestion,
|
|
162
|
+
inputValue,
|
|
163
|
+
isMenuDirectlyActivated
|
|
164
|
+
};
|
|
165
|
+
$[9] = autocompleteSuggestion;
|
|
166
|
+
$[10] = inputValue;
|
|
167
|
+
$[11] = isMenuDirectlyActivated;
|
|
168
|
+
$[12] = t7;
|
|
169
|
+
} else {
|
|
170
|
+
t7 = $[12];
|
|
171
|
+
}
|
|
172
|
+
const autocompleteInputContextValue = t7;
|
|
124
173
|
const deferredInputValue = useDeferredValue(inputValue);
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
174
|
+
let t8;
|
|
175
|
+
if ($[13] !== deferredInputValue) {
|
|
176
|
+
t8 = {
|
|
177
|
+
deferredInputValue
|
|
178
|
+
};
|
|
179
|
+
$[13] = deferredInputValue;
|
|
180
|
+
$[14] = t8;
|
|
181
|
+
} else {
|
|
182
|
+
t8 = $[14];
|
|
183
|
+
}
|
|
184
|
+
const autocompleteDeferredInputContextValue = t8;
|
|
185
|
+
let t9;
|
|
186
|
+
if ($[15] !== autocompleteDeferredInputContextValue || $[16] !== children) {
|
|
187
|
+
t9 = /*#__PURE__*/jsx(AutocompleteDeferredInputContext.Provider, {
|
|
188
|
+
value: autocompleteDeferredInputContextValue,
|
|
189
|
+
children: children
|
|
190
|
+
});
|
|
191
|
+
$[15] = autocompleteDeferredInputContextValue;
|
|
192
|
+
$[16] = children;
|
|
193
|
+
$[17] = t9;
|
|
194
|
+
} else {
|
|
195
|
+
t9 = $[17];
|
|
196
|
+
}
|
|
197
|
+
let t10;
|
|
198
|
+
if ($[18] !== autocompleteInputContextValue || $[19] !== t9) {
|
|
199
|
+
t10 = /*#__PURE__*/jsx(AutocompleteInputContext.Provider, {
|
|
131
200
|
value: autocompleteInputContextValue,
|
|
132
|
-
children:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
201
|
+
children: t9
|
|
202
|
+
});
|
|
203
|
+
$[18] = autocompleteInputContextValue;
|
|
204
|
+
$[19] = t9;
|
|
205
|
+
$[20] = t10;
|
|
206
|
+
} else {
|
|
207
|
+
t10 = $[20];
|
|
208
|
+
}
|
|
209
|
+
let t11;
|
|
210
|
+
if ($[21] !== autocompleteContextValue || $[22] !== t10) {
|
|
211
|
+
t11 = /*#__PURE__*/jsx(AutocompleteContext.Provider, {
|
|
212
|
+
value: autocompleteContextValue,
|
|
213
|
+
children: t10
|
|
214
|
+
});
|
|
215
|
+
$[21] = autocompleteContextValue;
|
|
216
|
+
$[22] = t10;
|
|
217
|
+
$[23] = t11;
|
|
218
|
+
} else {
|
|
219
|
+
t11 = $[23];
|
|
220
|
+
}
|
|
221
|
+
return t11;
|
|
138
222
|
};
|
|
139
|
-
Autocomplete.displayName = "Autocomplete";
|
|
140
223
|
var Autocomplete$1 = Object.assign(Autocomplete, {
|
|
141
224
|
__SLOT__: Symbol('Autocomplete'),
|
|
142
225
|
Context: AutocompleteContext,
|