@primer/react 38.33.1-rc.c5a377690 → 38.34.0-rc.55c90c21a
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 +5 -1
- package/dist/NavList/NavList.d.ts +1 -0
- package/dist/NavList/NavList.js +39 -28
- package/generated/components.json +6 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# @primer/react
|
|
2
2
|
|
|
3
|
-
## 38.
|
|
3
|
+
## 38.34.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#8086](https://github.com/primer/react/pull/8086) [`81d4174`](https://github.com/primer/react/commit/81d4174150b37da95db23480574ddf8db5b20ca4) Thanks [@TylerJDev](https://github.com/TylerJDev)! - Add a `hideDivider` prop to `NavList.Group` so consumers can opt out of rendering the divider before a group.
|
|
4
8
|
|
|
5
9
|
### Patch Changes
|
|
6
10
|
|
package/dist/NavList/NavList.js
CHANGED
|
@@ -375,57 +375,68 @@ Divider.displayName = "NavList.Divider";
|
|
|
375
375
|
const TrailingAction = ActionList.TrailingAction;
|
|
376
376
|
TrailingAction.displayName = "NavList.TrailingAction";
|
|
377
377
|
const Group = (t0) => {
|
|
378
|
-
const $ = c(
|
|
378
|
+
const $ = c(19);
|
|
379
379
|
let children;
|
|
380
|
+
let hideDivider;
|
|
380
381
|
let props;
|
|
381
382
|
let title;
|
|
382
383
|
if ($[0] !== t0) {
|
|
383
|
-
({title, children, ...props} = t0);
|
|
384
|
+
({title, children, hideDivider, ...props} = t0);
|
|
384
385
|
$[0] = t0;
|
|
385
386
|
$[1] = children;
|
|
386
|
-
$[2] =
|
|
387
|
-
$[3] =
|
|
387
|
+
$[2] = hideDivider;
|
|
388
|
+
$[3] = props;
|
|
389
|
+
$[4] = title;
|
|
388
390
|
} else {
|
|
389
391
|
children = $[1];
|
|
390
|
-
|
|
391
|
-
|
|
392
|
+
hideDivider = $[2];
|
|
393
|
+
props = $[3];
|
|
394
|
+
title = $[4];
|
|
392
395
|
}
|
|
393
396
|
const headingLevel = React.useContext(NavListHeadingLevelContext);
|
|
394
397
|
let t1;
|
|
395
|
-
if ($[
|
|
398
|
+
if ($[5] !== headingLevel) {
|
|
396
399
|
t1 = headingLevel ? levelToHeadingTag(headingLevel + 1) : "h3";
|
|
397
|
-
$[
|
|
398
|
-
$[
|
|
399
|
-
} else t1 = $[
|
|
400
|
+
$[5] = headingLevel;
|
|
401
|
+
$[6] = t1;
|
|
402
|
+
} else t1 = $[6];
|
|
400
403
|
const groupHeadingAs = t1;
|
|
401
404
|
let t2;
|
|
402
|
-
if ($[
|
|
403
|
-
t2 = /*#__PURE__*/ jsx(ActionList.Divider, {});
|
|
404
|
-
$[
|
|
405
|
-
|
|
405
|
+
if ($[7] !== hideDivider) {
|
|
406
|
+
t2 = !hideDivider && /*#__PURE__*/ jsx(ActionList.Divider, {});
|
|
407
|
+
$[7] = hideDivider;
|
|
408
|
+
$[8] = t2;
|
|
409
|
+
} else t2 = $[8];
|
|
406
410
|
let t3;
|
|
407
|
-
if ($[
|
|
411
|
+
if ($[9] !== groupHeadingAs || $[10] !== title) {
|
|
408
412
|
t3 = title ? /*#__PURE__*/ jsx(ActionList.GroupHeading, {
|
|
409
413
|
as: groupHeadingAs,
|
|
410
414
|
"data-component": "ActionList.GroupHeading",
|
|
411
415
|
children: title
|
|
412
416
|
}) : null;
|
|
413
|
-
$[
|
|
414
|
-
$[
|
|
415
|
-
$[
|
|
416
|
-
} else t3 = $[
|
|
417
|
+
$[9] = groupHeadingAs;
|
|
418
|
+
$[10] = title;
|
|
419
|
+
$[11] = t3;
|
|
420
|
+
} else t3 = $[11];
|
|
417
421
|
let t4;
|
|
418
|
-
if ($[
|
|
419
|
-
t4 = /*#__PURE__*/ jsxs(
|
|
422
|
+
if ($[12] !== children || $[13] !== props || $[14] !== t3) {
|
|
423
|
+
t4 = /*#__PURE__*/ jsxs(ActionList.Group, {
|
|
420
424
|
...props,
|
|
421
425
|
children: [t3, children]
|
|
422
|
-
})
|
|
423
|
-
$[
|
|
424
|
-
$[
|
|
425
|
-
$[
|
|
426
|
-
$[
|
|
427
|
-
} else t4 = $[
|
|
428
|
-
|
|
426
|
+
});
|
|
427
|
+
$[12] = children;
|
|
428
|
+
$[13] = props;
|
|
429
|
+
$[14] = t3;
|
|
430
|
+
$[15] = t4;
|
|
431
|
+
} else t4 = $[15];
|
|
432
|
+
let t5;
|
|
433
|
+
if ($[16] !== t2 || $[17] !== t4) {
|
|
434
|
+
t5 = /*#__PURE__*/ jsxs(Fragment, { children: [t2, t4] });
|
|
435
|
+
$[16] = t2;
|
|
436
|
+
$[17] = t4;
|
|
437
|
+
$[18] = t5;
|
|
438
|
+
} else t5 = $[18];
|
|
439
|
+
return t5;
|
|
429
440
|
};
|
|
430
441
|
const GroupExpand = /*#__PURE__*/ React.forwardRef((t0, forwardedRef) => {
|
|
431
442
|
const $ = c(23);
|
|
@@ -4341,6 +4341,12 @@
|
|
|
4341
4341
|
"type": "string",
|
|
4342
4342
|
"description": "The text that gets rendered as the group's heading. Alternatively, you can pass the `NavList.GroupHeading` component as a child of `NavList.Group`.\nIf both `title` and `NavList.GroupHeading` are passed, `NavList.GroupHeading` will be rendered as the heading."
|
|
4343
4343
|
},
|
|
4344
|
+
{
|
|
4345
|
+
"name": "hideDivider",
|
|
4346
|
+
"type": "boolean",
|
|
4347
|
+
"defaultValue": "false",
|
|
4348
|
+
"description": "Whether to hide the divider that is rendered before the group."
|
|
4349
|
+
},
|
|
4344
4350
|
{
|
|
4345
4351
|
"name": "ref",
|
|
4346
4352
|
"type": "React.RefObject<HTMLElement>"
|
package/package.json
CHANGED