@primer/react 0.0.0-20260311072240 → 0.0.0-20260311072247
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
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# @primer/react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-20260311072247
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- Fake entry to force publishing
|
|
8
8
|
|
|
9
|
-
- [#
|
|
9
|
+
- [#7545](https://github.com/primer/react/pull/7545) [`8a5e63a`](https://github.com/primer/react/commit/8a5e63ad1f3547ef8b6a24e6e7e5d5ca18243d6d) Thanks [@hectahertz](https://github.com/hectahertz)! - perf(TreeView): defer scrollIntoView to coalesce reflows during rapid navigation
|
|
10
10
|
|
|
11
11
|
## 38.15.0
|
|
12
12
|
|
|
@@ -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;AAO/F,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,yCAAyC,CAAA;AAQ/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,KA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,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;;;;;;;;;;;AAiOzG,wBAGE"}
|
|
@@ -51,10 +51,6 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
|
|
|
51
51
|
const [isOverLimit, setIsOverLimit] = useState(false);
|
|
52
52
|
const [screenReaderMessage, setScreenReaderMessage] = useState('');
|
|
53
53
|
const characterCounterRef = useRef(null);
|
|
54
|
-
const lastCountedLengthRef = useRef(null);
|
|
55
|
-
const lastCharacterCountRef = useRef('');
|
|
56
|
-
const lastIsOverLimitRef = useRef(false);
|
|
57
|
-
const lastScreenReaderMessageRef = useRef('');
|
|
58
54
|
|
|
59
55
|
// this class is necessary to style FilterSearch, plz no touchy!
|
|
60
56
|
const wrapperClasses = clsx(className, 'TextInput-wrapper');
|
|
@@ -88,31 +84,17 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
|
|
|
88
84
|
if (characterLimit) {
|
|
89
85
|
characterCounterRef.current = new CharacterCounter({
|
|
90
86
|
onCountUpdate: (count, overLimit, message) => {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
setCharacterCount(message);
|
|
94
|
-
}
|
|
95
|
-
if (overLimit !== lastIsOverLimitRef.current) {
|
|
96
|
-
lastIsOverLimitRef.current = overLimit;
|
|
97
|
-
setIsOverLimit(overLimit);
|
|
98
|
-
}
|
|
87
|
+
setCharacterCount(message);
|
|
88
|
+
setIsOverLimit(overLimit);
|
|
99
89
|
},
|
|
100
90
|
onScreenReaderAnnounce: message_0 => {
|
|
101
|
-
|
|
102
|
-
lastScreenReaderMessageRef.current = message_0;
|
|
103
|
-
setScreenReaderMessage(message_0);
|
|
104
|
-
}
|
|
91
|
+
setScreenReaderMessage(message_0);
|
|
105
92
|
}
|
|
106
93
|
});
|
|
107
|
-
lastCountedLengthRef.current = null;
|
|
108
94
|
return () => {
|
|
109
95
|
var _characterCounterRef$;
|
|
110
96
|
(_characterCounterRef$ = characterCounterRef.current) === null || _characterCounterRef$ === void 0 ? void 0 : _characterCounterRef$.cleanup();
|
|
111
97
|
characterCounterRef.current = null;
|
|
112
|
-
lastCountedLengthRef.current = null;
|
|
113
|
-
lastCharacterCountRef.current = '';
|
|
114
|
-
lastIsOverLimitRef.current = false;
|
|
115
|
-
lastScreenReaderMessageRef.current = '';
|
|
116
98
|
};
|
|
117
99
|
}
|
|
118
100
|
}, [characterLimit]);
|
|
@@ -121,22 +103,14 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
|
|
|
121
103
|
useEffect(() => {
|
|
122
104
|
if (characterLimit && characterCounterRef.current) {
|
|
123
105
|
const currentValue = value !== undefined ? String(value) : defaultValue !== undefined ? String(defaultValue) : '';
|
|
124
|
-
|
|
125
|
-
if (currentLength !== lastCountedLengthRef.current) {
|
|
126
|
-
lastCountedLengthRef.current = currentLength;
|
|
127
|
-
characterCounterRef.current.updateCharacterCount(currentLength, characterLimit);
|
|
128
|
-
}
|
|
106
|
+
characterCounterRef.current.updateCharacterCount(currentValue.length, characterLimit);
|
|
129
107
|
}
|
|
130
108
|
}, [value, defaultValue, characterLimit]);
|
|
131
109
|
|
|
132
110
|
// Handle input change with character counter
|
|
133
111
|
const handleInputChange = useCallback(e_2 => {
|
|
134
112
|
if (characterLimit && characterCounterRef.current) {
|
|
135
|
-
|
|
136
|
-
if (currentLength_0 !== lastCountedLengthRef.current) {
|
|
137
|
-
lastCountedLengthRef.current = currentLength_0;
|
|
138
|
-
characterCounterRef.current.updateCharacterCount(currentLength_0, characterLimit);
|
|
139
|
-
}
|
|
113
|
+
characterCounterRef.current.updateCharacterCount(e_2.target.value.length, characterLimit);
|
|
140
114
|
}
|
|
141
115
|
onChange === null || onChange === void 0 ? void 0 : onChange(e_2);
|
|
142
116
|
}, [onChange, characterLimit]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeView.d.ts","sourceRoot":"","sources":["../../src/TreeView/TreeView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,IAAI,EACV,MAAM,wBAAwB,CAAA;AAE/B,OAAO,KAA+B,MAAM,OAAO,CAAA;AAsBnD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"TreeView.d.ts","sourceRoot":"","sources":["../../src/TreeView/TreeView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,IAAI,EACV,MAAM,wBAAwB,CAAA;AAE/B,OAAO,KAA+B,MAAM,OAAO,CAAA;AAsBnD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,gBAAgB,CAAA;AA4CpD,MAAM,MAAM,aAAa,GAAG;IAC1B,YAAY,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAA;IACjD,iBAAiB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAA;IAC3D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CA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AA;CACtB,CAAA;AA2MD,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE;QAAC,UAAU,EAAE,OAAO,CAAA;KAAC,KAAK,KAAK,CAAC,SAAS,CAAC,CAAA;IAG/E,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAqED,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,wBAAwB,EAAE,CAAA;IACjC,YAAY,EAAE,MAAM,CAAA;CACrB,CAAA;AA0ED,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,EAAE,wBAAwB,EAAE,CAAA;IACjC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAwED,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;CACvB,CAAA;AA4CD,eAAO,MAAM,QAAQ;;;;;;;;CAQnB,CAAA"}
|
|
@@ -31,7 +31,8 @@ const RootContext = /*#__PURE__*/React.createContext({
|
|
|
31
31
|
announceUpdate: () => {},
|
|
32
32
|
expandedStateCache: {
|
|
33
33
|
current: new Map()
|
|
34
|
-
}
|
|
34
|
+
},
|
|
35
|
+
scrollElementIntoView: () => {}
|
|
35
36
|
});
|
|
36
37
|
const ItemContext = /*#__PURE__*/React.createContext({
|
|
37
38
|
itemId: '',
|
|
@@ -51,7 +52,7 @@ const ItemContext = /*#__PURE__*/React.createContext({
|
|
|
51
52
|
/* Size of toggle icon in pixels. */
|
|
52
53
|
const TOGGLE_ICON_SIZE = 12;
|
|
53
54
|
const Root = t0 => {
|
|
54
|
-
const $ = c(
|
|
55
|
+
const $ = c(26);
|
|
55
56
|
const {
|
|
56
57
|
"aria-label": ariaLabel,
|
|
57
58
|
"aria-labelledby": ariaLabelledby,
|
|
@@ -127,89 +128,132 @@ const Root = t0 => {
|
|
|
127
128
|
t7 = $[5];
|
|
128
129
|
}
|
|
129
130
|
useTypeahead(t7);
|
|
131
|
+
const pendingScrollRef = React.useRef(null);
|
|
132
|
+
let t8;
|
|
133
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
134
|
+
t8 = element_0 => {
|
|
135
|
+
if (!element_0) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (pendingScrollRef.current !== null) {
|
|
139
|
+
cancelAnimationFrame(pendingScrollRef.current);
|
|
140
|
+
}
|
|
141
|
+
pendingScrollRef.current = requestAnimationFrame(() => {
|
|
142
|
+
pendingScrollRef.current = null;
|
|
143
|
+
if (!element_0.isConnected) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
element_0.scrollIntoView({
|
|
147
|
+
block: "nearest",
|
|
148
|
+
inline: "nearest"
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
$[6] = t8;
|
|
153
|
+
} else {
|
|
154
|
+
t8 = $[6];
|
|
155
|
+
}
|
|
156
|
+
const scrollElementIntoView = t8;
|
|
157
|
+
let t10;
|
|
158
|
+
let t9;
|
|
159
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
160
|
+
t9 = () => () => {
|
|
161
|
+
if (pendingScrollRef.current !== null) {
|
|
162
|
+
cancelAnimationFrame(pendingScrollRef.current);
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
t10 = [];
|
|
166
|
+
$[7] = t10;
|
|
167
|
+
$[8] = t9;
|
|
168
|
+
} else {
|
|
169
|
+
t10 = $[7];
|
|
170
|
+
t9 = $[8];
|
|
171
|
+
}
|
|
172
|
+
useEffect(t9, t10);
|
|
130
173
|
const expandedStateCache = React.useRef(null);
|
|
131
174
|
if (expandedStateCache.current === null) {
|
|
132
|
-
let
|
|
133
|
-
if ($[
|
|
134
|
-
|
|
135
|
-
$[
|
|
175
|
+
let t11;
|
|
176
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
177
|
+
t11 = new Map();
|
|
178
|
+
$[9] = t11;
|
|
136
179
|
} else {
|
|
137
|
-
|
|
180
|
+
t11 = $[9];
|
|
138
181
|
}
|
|
139
|
-
expandedStateCache.current =
|
|
182
|
+
expandedStateCache.current = t11;
|
|
140
183
|
}
|
|
141
|
-
let
|
|
142
|
-
if ($[
|
|
143
|
-
|
|
184
|
+
let t11;
|
|
185
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
186
|
+
t11 = {
|
|
144
187
|
announceUpdate,
|
|
145
|
-
expandedStateCache
|
|
188
|
+
expandedStateCache,
|
|
189
|
+
scrollElementIntoView
|
|
146
190
|
};
|
|
147
|
-
$[
|
|
191
|
+
$[10] = t11;
|
|
148
192
|
} else {
|
|
149
|
-
|
|
193
|
+
t11 = $[10];
|
|
150
194
|
}
|
|
151
|
-
let
|
|
152
|
-
if ($[
|
|
153
|
-
|
|
195
|
+
let t12;
|
|
196
|
+
if ($[11] !== ariaLiveMessage) {
|
|
197
|
+
t12 = /*#__PURE__*/jsx(VisuallyHidden, {
|
|
154
198
|
children: /*#__PURE__*/jsx(AriaStatus, {
|
|
155
199
|
announceOnShow: true,
|
|
156
200
|
children: ariaLiveMessage
|
|
157
201
|
})
|
|
158
202
|
});
|
|
159
|
-
$[
|
|
160
|
-
$[
|
|
203
|
+
$[11] = ariaLiveMessage;
|
|
204
|
+
$[12] = t12;
|
|
161
205
|
} else {
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
const
|
|
165
|
-
let
|
|
166
|
-
if ($[
|
|
167
|
-
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
206
|
+
t12 = $[12];
|
|
207
|
+
}
|
|
208
|
+
const t13 = truncate || false;
|
|
209
|
+
let t14;
|
|
210
|
+
if ($[13] !== className) {
|
|
211
|
+
t14 = clsx(className, classes.TreeViewRootUlStyles);
|
|
212
|
+
$[13] = className;
|
|
213
|
+
$[14] = t14;
|
|
170
214
|
} else {
|
|
171
|
-
|
|
215
|
+
t14 = $[14];
|
|
172
216
|
}
|
|
173
|
-
let
|
|
174
|
-
if ($[
|
|
175
|
-
|
|
217
|
+
let t15;
|
|
218
|
+
if ($[15] !== ariaLabel || $[16] !== ariaLabelledby || $[17] !== children || $[18] !== flat || $[19] !== style || $[20] !== t13 || $[21] !== t14) {
|
|
219
|
+
t15 = /*#__PURE__*/jsx("ul", {
|
|
176
220
|
ref: containerRef,
|
|
177
221
|
role: "tree",
|
|
178
222
|
"aria-label": ariaLabel,
|
|
179
223
|
"aria-labelledby": ariaLabelledby,
|
|
180
224
|
"data-omit-spacer": flat,
|
|
181
|
-
"data-truncate-text":
|
|
225
|
+
"data-truncate-text": t13,
|
|
182
226
|
onMouseDown: onMouseDown,
|
|
183
|
-
className:
|
|
227
|
+
className: t14,
|
|
184
228
|
style: style,
|
|
185
229
|
children: children
|
|
186
230
|
});
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
$[
|
|
192
|
-
$[
|
|
193
|
-
$[
|
|
194
|
-
$[
|
|
231
|
+
$[15] = ariaLabel;
|
|
232
|
+
$[16] = ariaLabelledby;
|
|
233
|
+
$[17] = children;
|
|
234
|
+
$[18] = flat;
|
|
235
|
+
$[19] = style;
|
|
236
|
+
$[20] = t13;
|
|
237
|
+
$[21] = t14;
|
|
238
|
+
$[22] = t15;
|
|
195
239
|
} else {
|
|
196
|
-
|
|
240
|
+
t15 = $[22];
|
|
197
241
|
}
|
|
198
|
-
let
|
|
199
|
-
if ($[
|
|
200
|
-
|
|
201
|
-
value:
|
|
242
|
+
let t16;
|
|
243
|
+
if ($[23] !== t12 || $[24] !== t15) {
|
|
244
|
+
t16 = /*#__PURE__*/jsx(RootContext.Provider, {
|
|
245
|
+
value: t11,
|
|
202
246
|
children: /*#__PURE__*/jsxs(Fragment, {
|
|
203
|
-
children: [
|
|
247
|
+
children: [t12, t15]
|
|
204
248
|
})
|
|
205
249
|
});
|
|
206
|
-
$[
|
|
207
|
-
$[
|
|
208
|
-
$[
|
|
250
|
+
$[23] = t12;
|
|
251
|
+
$[24] = t15;
|
|
252
|
+
$[25] = t16;
|
|
209
253
|
} else {
|
|
210
|
-
|
|
254
|
+
t16 = $[25];
|
|
211
255
|
}
|
|
212
|
-
return
|
|
256
|
+
return t16;
|
|
213
257
|
};
|
|
214
258
|
Root.displayName = 'TreeView';
|
|
215
259
|
|
|
@@ -236,7 +280,8 @@ const Item = /*#__PURE__*/React.forwardRef(({
|
|
|
236
280
|
trailingVisual: TrailingVisual
|
|
237
281
|
});
|
|
238
282
|
const {
|
|
239
|
-
expandedStateCache
|
|
283
|
+
expandedStateCache,
|
|
284
|
+
scrollElementIntoView
|
|
240
285
|
} = React.useContext(RootContext);
|
|
241
286
|
const labelId = useId();
|
|
242
287
|
const leadingVisualId = useId();
|
|
@@ -357,12 +402,9 @@ const Item = /*#__PURE__*/React.forwardRef(({
|
|
|
357
402
|
"data-has-leading-action": slots.leadingAction ? true : undefined,
|
|
358
403
|
onKeyDown: handleKeyDown,
|
|
359
404
|
onFocus: event_1 => {
|
|
360
|
-
|
|
361
|
-
//
|
|
362
|
-
(
|
|
363
|
-
block: 'nearest',
|
|
364
|
-
inline: 'nearest'
|
|
365
|
-
});
|
|
405
|
+
// Defer scroll to the next animation frame so that rapid keyboard
|
|
406
|
+
// navigation (held key) coalesces into a single reflow per frame
|
|
407
|
+
scrollElementIntoView(event_1.currentTarget.firstElementChild);
|
|
366
408
|
|
|
367
409
|
// Set the focused state
|
|
368
410
|
setIsFocused(true);
|
package/package.json
CHANGED