@primer/react 0.0.0-20260331214404 → 0.0.0-20260401022752
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,14 +1,14 @@
|
|
|
1
1
|
# @primer/react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-20260401022752
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
-
- [#7677](https://github.com/primer/react/pull/7677) [`
|
|
7
|
+
- [#7677](https://github.com/primer/react/pull/7677) [`c1a81b1`](https://github.com/primer/react/commit/c1a81b178742ba547b85a3df3ed3c27bcff6b7c5) Thanks [@TylerJDev](https://github.com/TylerJDev)! - AnchoredOverlay: Add Popover API to AnchoredOverlay (behind `primer_react_css_anchor_positioning` feature flag)
|
|
8
8
|
|
|
9
9
|
### Patch Changes
|
|
10
10
|
|
|
11
|
-
- [#
|
|
11
|
+
- [#7721](https://github.com/primer/react/pull/7721) [`c90d0f8`](https://github.com/primer/react/commit/c90d0f83896b9a1fb4752060527884878a10c5ad) Thanks [@francinelucca](https://github.com/francinelucca)! - ActionBar: Fixed flickering on initial render by applying visibility:hidden during initial width calculations. This prevents items from briefly appearing and then disappearing on slower devices.
|
|
12
12
|
|
|
13
13
|
- [#7638](https://github.com/primer/react/pull/7638) [`f04e85d`](https://github.com/primer/react/commit/f04e85df536cd6e8047f70b070bd3cf7c0961f92) Thanks [@iansan5653](https://github.com/iansan5653)! - Update internal implementations of combined refs to improve performance and add support for React 19 callback refs
|
|
14
14
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionBar.d.ts","sourceRoot":"","sources":["../../src/ActionBar/ActionBar.tsx"],"names":[],"mappings":"AACA,OAAO,KAA2D,MAAM,OAAO,CAAA;AAE/E,OAAO,EAAa,KAAK,mBAAmB,EAAC,MAAM,eAAe,CAAA;AAKlE,OAAO,KAAK,EAAC,e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,MAAM,CAAA;IACxD;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;CAC9C,GAAG,eAAe,CAAA;AAkInB,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAgLvE,CAAA;AAUD,eAAO,MAAM,mBAAmB,0FAgD/B,CAAA;AAMD,eAAO,MAAM,cAAc;;iCAgBzB,CAAA;AAEF,eAAO,MAAM,aAAa;IAlZxB,2CAA2C;kBAC7B,MAAM;IACpB,+BAA+B;UACzB,wBAAwB,CAAC,MAAM,CAAC;WAC/B,sBAAsB,EAAE;IAC/B;;;OAGG;mBACY,wBAAwB,CAAC,MAAM,CAAC,GAAG,MAAM;IACxD;;OAEG;qBACc,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC;;;;;;;;;;;wGA6a9C,CAAA;AAED,eAAO,MAAM,eAAe,gCAY3B,CAAA"}
|
|
@@ -133,7 +133,7 @@ const getMenuItems = (navWidth, moreMenuWidth, childRegistry, hasActiveMenu, gap
|
|
|
133
133
|
}
|
|
134
134
|
};
|
|
135
135
|
const ActionBar = props => {
|
|
136
|
-
const $ = c(
|
|
136
|
+
const $ = c(41);
|
|
137
137
|
const {
|
|
138
138
|
size: t0,
|
|
139
139
|
children,
|
|
@@ -150,6 +150,7 @@ const ActionBar = props => {
|
|
|
150
150
|
const [computedGap, setComputedGap] = useState(ACTIONBAR_ITEM_GAP);
|
|
151
151
|
const [childRegistry, setChildRegistry] = ActionBarItemsRegistry.useRegistryState();
|
|
152
152
|
const [menuItemIds, setMenuItemIds] = useState(_temp);
|
|
153
|
+
const [isInitialRender, setIsInitialRender] = useState(true);
|
|
153
154
|
const navRef = useRef(null);
|
|
154
155
|
let t3;
|
|
155
156
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
@@ -189,6 +190,7 @@ const ActionBar = props => {
|
|
|
189
190
|
if (newMenuItemIds) {
|
|
190
191
|
setMenuItemIds(newMenuItemIds);
|
|
191
192
|
}
|
|
193
|
+
setIsInitialRender(false);
|
|
192
194
|
}
|
|
193
195
|
};
|
|
194
196
|
$[3] = childRegistry;
|
|
@@ -257,20 +259,30 @@ const ActionBar = props => {
|
|
|
257
259
|
t9 = $[16];
|
|
258
260
|
}
|
|
259
261
|
let t10;
|
|
260
|
-
if ($[17] !==
|
|
261
|
-
t10 =
|
|
262
|
+
if ($[17] !== isInitialRender) {
|
|
263
|
+
t10 = isInitialRender ? {
|
|
264
|
+
visibility: "hidden"
|
|
265
|
+
} : undefined;
|
|
266
|
+
$[17] = isInitialRender;
|
|
267
|
+
$[18] = t10;
|
|
268
|
+
} else {
|
|
269
|
+
t10 = $[18];
|
|
270
|
+
}
|
|
271
|
+
let t11;
|
|
272
|
+
if ($[19] !== children || $[20] !== setChildRegistry) {
|
|
273
|
+
t11 = /*#__PURE__*/jsx(ActionBarItemsRegistry.Provider, {
|
|
262
274
|
setRegistry: setChildRegistry,
|
|
263
275
|
children: children
|
|
264
276
|
});
|
|
265
|
-
$[
|
|
266
|
-
$[
|
|
267
|
-
$[
|
|
277
|
+
$[19] = children;
|
|
278
|
+
$[20] = setChildRegistry;
|
|
279
|
+
$[21] = t11;
|
|
268
280
|
} else {
|
|
269
|
-
|
|
281
|
+
t11 = $[21];
|
|
270
282
|
}
|
|
271
|
-
let
|
|
272
|
-
if ($[
|
|
273
|
-
|
|
283
|
+
let t12;
|
|
284
|
+
if ($[22] !== ariaLabel || $[23] !== childRegistry || $[24] !== groupedItems || $[25] !== menuItemIds) {
|
|
285
|
+
t12 = menuItemIds.size > 0 && /*#__PURE__*/jsxs(ActionMenu, {
|
|
274
286
|
children: [/*#__PURE__*/jsx(ActionMenu.Anchor, {
|
|
275
287
|
children: /*#__PURE__*/jsx(IconButton, {
|
|
276
288
|
variant: "invisible",
|
|
@@ -339,62 +351,64 @@ const ActionBar = props => {
|
|
|
339
351
|
})
|
|
340
352
|
})]
|
|
341
353
|
});
|
|
342
|
-
$[
|
|
343
|
-
$[
|
|
344
|
-
$[
|
|
345
|
-
$[
|
|
346
|
-
$[
|
|
354
|
+
$[22] = ariaLabel;
|
|
355
|
+
$[23] = childRegistry;
|
|
356
|
+
$[24] = groupedItems;
|
|
357
|
+
$[25] = menuItemIds;
|
|
358
|
+
$[26] = t12;
|
|
347
359
|
} else {
|
|
348
|
-
|
|
360
|
+
t12 = $[26];
|
|
349
361
|
}
|
|
350
|
-
let
|
|
351
|
-
if ($[
|
|
352
|
-
|
|
362
|
+
let t13;
|
|
363
|
+
if ($[27] !== ariaLabel || $[28] !== ariaLabelledBy || $[29] !== gap || $[30] !== t10 || $[31] !== t11 || $[32] !== t12) {
|
|
364
|
+
t13 = /*#__PURE__*/jsxs("div", {
|
|
353
365
|
ref: listRef,
|
|
354
366
|
role: "toolbar",
|
|
355
367
|
className: styles.List,
|
|
356
368
|
"aria-label": ariaLabel,
|
|
357
369
|
"aria-labelledby": ariaLabelledBy,
|
|
358
370
|
"data-gap": gap,
|
|
359
|
-
|
|
371
|
+
style: t10,
|
|
372
|
+
children: [t11, t12]
|
|
360
373
|
});
|
|
361
|
-
$[
|
|
362
|
-
$[
|
|
363
|
-
$[
|
|
364
|
-
$[
|
|
365
|
-
$[
|
|
366
|
-
$[
|
|
374
|
+
$[27] = ariaLabel;
|
|
375
|
+
$[28] = ariaLabelledBy;
|
|
376
|
+
$[29] = gap;
|
|
377
|
+
$[30] = t10;
|
|
378
|
+
$[31] = t11;
|
|
379
|
+
$[32] = t12;
|
|
380
|
+
$[33] = t13;
|
|
367
381
|
} else {
|
|
368
|
-
|
|
382
|
+
t13 = $[33];
|
|
369
383
|
}
|
|
370
|
-
let
|
|
371
|
-
if ($[
|
|
372
|
-
|
|
384
|
+
let t14;
|
|
385
|
+
if ($[34] !== flush || $[35] !== t13 || $[36] !== t9) {
|
|
386
|
+
t14 = /*#__PURE__*/jsx("div", {
|
|
373
387
|
ref: navRef,
|
|
374
388
|
className: t9,
|
|
375
389
|
"data-flush": flush,
|
|
376
|
-
children: t12
|
|
377
|
-
});
|
|
378
|
-
$[31] = flush;
|
|
379
|
-
$[32] = t12;
|
|
380
|
-
$[33] = t9;
|
|
381
|
-
$[34] = t13;
|
|
382
|
-
} else {
|
|
383
|
-
t13 = $[34];
|
|
384
|
-
}
|
|
385
|
-
let t14;
|
|
386
|
-
if ($[35] !== t13 || $[36] !== t8) {
|
|
387
|
-
t14 = /*#__PURE__*/jsx(ActionBarContext.Provider, {
|
|
388
|
-
value: t8,
|
|
389
390
|
children: t13
|
|
390
391
|
});
|
|
392
|
+
$[34] = flush;
|
|
391
393
|
$[35] = t13;
|
|
392
|
-
$[36] =
|
|
394
|
+
$[36] = t9;
|
|
393
395
|
$[37] = t14;
|
|
394
396
|
} else {
|
|
395
397
|
t14 = $[37];
|
|
396
398
|
}
|
|
397
|
-
|
|
399
|
+
let t15;
|
|
400
|
+
if ($[38] !== t14 || $[39] !== t8) {
|
|
401
|
+
t15 = /*#__PURE__*/jsx(ActionBarContext.Provider, {
|
|
402
|
+
value: t8,
|
|
403
|
+
children: t14
|
|
404
|
+
});
|
|
405
|
+
$[38] = t14;
|
|
406
|
+
$[39] = t8;
|
|
407
|
+
$[40] = t15;
|
|
408
|
+
} else {
|
|
409
|
+
t15 = $[40];
|
|
410
|
+
}
|
|
411
|
+
return t15;
|
|
398
412
|
};
|
|
399
413
|
function useWidth(ref) {
|
|
400
414
|
const $ = c(3);
|
|
@@ -144,7 +144,7 @@ const AnchoredOverlay = ({
|
|
|
144
144
|
overlay.style.removeProperty('position-anchor');
|
|
145
145
|
}
|
|
146
146
|
};
|
|
147
|
-
}, [cssAnchorPositioning, anchorRef, overlayRef, id
|
|
147
|
+
}, [cssAnchorPositioning, anchorRef, overlayRef, id]);
|
|
148
148
|
|
|
149
149
|
// Track the overlay element so we can re-run the effect when it changes.
|
|
150
150
|
// The overlay unmounts when closed, so each open creates a new DOM node -
|
package/package.json
CHANGED