@primer/react 0.0.0-20260615171201 → 0.0.0-20260615210040
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 +8 -2
- package/dist/TreeView/TreeView.d.ts.map +1 -1
- package/dist/TreeView/TreeView.js +109 -100
- 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-20260615210040
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -9,7 +9,13 @@
|
|
|
9
9
|
- [#7897](https://github.com/primer/react/pull/7897) [`dea9ea7`](https://github.com/primer/react/commit/dea9ea7908d3d9fe935c42311952fa5cbd7a17e4) Thanks [@liuliu-dev](https://github.com/liuliu-dev)! - Add support for the `as` prop on `TreeView.Item`. This enables rendering the
|
|
10
10
|
treeitem as a different element (e.g. `as="a"` for native anchors, or a custom
|
|
11
11
|
router-link component) while preserving all existing keyboard, focus, and ARIA
|
|
12
|
-
behavior.
|
|
12
|
+
behavior.
|
|
13
|
+
|
|
14
|
+
When `as` is omitted, the existing markup is unchanged: an `<li>` is rendered
|
|
15
|
+
as the `role="treeitem"` element. When `as` is provided, the polymorphic
|
|
16
|
+
element is rendered as the treeitem and is wrapped in an `<li role="none">`
|
|
17
|
+
so the markup remains valid (a `<ul role="tree">` may only directly contain
|
|
18
|
+
`<li>` elements).
|
|
13
19
|
|
|
14
20
|
### Patch Changes
|
|
15
21
|
|
|
@@ -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,EAA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C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,KAAK,CAAC,EAAE,YAAY,CAAA;IACpB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAgND,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;YAhwBlB,EAAE,SAAS,KAAK,CAAC,WAAW;;;;;;;;;;;CAwwB7B,CAAA"}
|
|
@@ -292,12 +292,14 @@ const ItemImpl = fixedForwardRef(({
|
|
|
292
292
|
as: Component,
|
|
293
293
|
...restProps
|
|
294
294
|
}, ref) => {
|
|
295
|
-
//
|
|
296
|
-
//
|
|
297
|
-
//
|
|
298
|
-
//
|
|
299
|
-
// to
|
|
295
|
+
// When `as` is provided, we render the polymorphic element as the
|
|
296
|
+
// `role="treeitem"` and wrap it in an `<li role="none">` so the markup
|
|
297
|
+
// remains valid (a `<ul role="tree">` may only directly contain `<li>`
|
|
298
|
+
// elements). When `as` is not provided we render an `<li>` directly as
|
|
299
|
+
// the treeitem to preserve the historical DOM shape and ref typing for
|
|
300
|
+
// existing consumers.
|
|
300
301
|
const ItemElement = Component !== null && Component !== void 0 ? Component : 'li';
|
|
302
|
+
const isPolymorphic = Component !== undefined;
|
|
301
303
|
const [slots, rest] = useSlots(children, {
|
|
302
304
|
leadingAction: LeadingAction,
|
|
303
305
|
leadingVisual: LeadingVisual,
|
|
@@ -397,6 +399,104 @@ const ItemImpl = fixedForwardRef(({
|
|
|
397
399
|
const ariaDescribedByIds = [slots.leadingVisual ? leadingVisualId : null, slots.trailingVisual ? trailingVisualId : null].filter(Boolean);
|
|
398
400
|
const shortcut = `Shift+${platform === 'apple' ? 'Meta' : 'Control'}+U`;
|
|
399
401
|
const trailingActionShortcutText = `Press (${getAccessibleKeybindingHintString(shortcut, platform)}) for more actions.`;
|
|
402
|
+
const itemElement =
|
|
403
|
+
/*#__PURE__*/
|
|
404
|
+
// @ts-ignore Box doesn't have type support for `ref` used in combination with `as`
|
|
405
|
+
jsxs(ItemElement, {
|
|
406
|
+
className: clsx('PRIVATE_TreeView-item', className, classes.TreeViewItem),
|
|
407
|
+
ref: ref,
|
|
408
|
+
tabIndex: 0,
|
|
409
|
+
id: itemId,
|
|
410
|
+
role: "treeitem",
|
|
411
|
+
"aria-label": secondaryActions ? ariaLabel ? `${ariaLabel}. ${trailingActionShortcutText}` : undefined : ariaLabel,
|
|
412
|
+
"aria-labelledby": ariaLabel ? undefined : `${ariaLabelledby || labelId} ${secondaryActions ? trailingActionId : ''}`.trim(),
|
|
413
|
+
"aria-describedby": ariaDescribedByIds.length ? ariaDescribedByIds.join(' ') : undefined,
|
|
414
|
+
"aria-level": level,
|
|
415
|
+
"aria-expanded": isSubTreeEmpty && (!isExpanded || !hasSubTree) || expanded === null ? undefined : isExpanded,
|
|
416
|
+
"aria-current": isCurrentItem ? 'true' : undefined,
|
|
417
|
+
"aria-selected": isFocused ? 'true' : 'false',
|
|
418
|
+
"data-has-leading-action": slots.leadingAction ? true : undefined,
|
|
419
|
+
"data-loading": isLoadingPlaceholder ? true : undefined,
|
|
420
|
+
onKeyDown: handleKeyDown,
|
|
421
|
+
onFocus: event => {
|
|
422
|
+
// Defer scroll to the next animation frame so that rapid keyboard
|
|
423
|
+
// navigation (held key) coalesces into a single reflow per frame
|
|
424
|
+
scrollElementIntoView(event.currentTarget.firstElementChild);
|
|
425
|
+
|
|
426
|
+
// Set the focused state
|
|
427
|
+
setIsFocused(true);
|
|
428
|
+
|
|
429
|
+
// Prevent focus event from bubbling up to parent items
|
|
430
|
+
event.stopPropagation();
|
|
431
|
+
},
|
|
432
|
+
onBlur: () => setIsFocused(false),
|
|
433
|
+
onClick: event => {
|
|
434
|
+
if (onSelect) {
|
|
435
|
+
onSelect(event);
|
|
436
|
+
} else {
|
|
437
|
+
toggle(event);
|
|
438
|
+
}
|
|
439
|
+
event.stopPropagation();
|
|
440
|
+
},
|
|
441
|
+
onAuxClick: event => {
|
|
442
|
+
if (onSelect && event.button === 1) {
|
|
443
|
+
onSelect(event);
|
|
444
|
+
}
|
|
445
|
+
event.stopPropagation();
|
|
446
|
+
},
|
|
447
|
+
...restProps,
|
|
448
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
449
|
+
className: clsx('PRIVATE_TreeView-item-container', classes.TreeViewItemContainer),
|
|
450
|
+
style: {
|
|
451
|
+
// @ts-ignore CSS custom property
|
|
452
|
+
'--level': level,
|
|
453
|
+
contentVisibility: containIntrinsicSize ? 'auto' : undefined,
|
|
454
|
+
containIntrinsicSize
|
|
455
|
+
},
|
|
456
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
457
|
+
style: {
|
|
458
|
+
gridArea: 'spacer',
|
|
459
|
+
display: 'flex'
|
|
460
|
+
},
|
|
461
|
+
children: /*#__PURE__*/jsx(LevelIndicatorLines, {
|
|
462
|
+
level: level
|
|
463
|
+
})
|
|
464
|
+
}), slots.leadingAction, hasSubTree ?
|
|
465
|
+
/*#__PURE__*/
|
|
466
|
+
// This lint rule is disabled due to the guidelines in the `TreeView` api docs.
|
|
467
|
+
// https://github.com/github/primer/blob/main/apis/tree-view-api.md#the-expandcollapse-chevron-toggle
|
|
468
|
+
// This has specific advice that the chevron be available only to pointer event.
|
|
469
|
+
// If they take up a button role, they become unnecessary and numerous tab stops.
|
|
470
|
+
jsx("div", {
|
|
471
|
+
className: clsx('PRIVATE_TreeView-item-toggle', onSelect && 'PRIVATE_TreeView-item-toggle--hover', level === 1 && 'PRIVATE_TreeView-item-toggle--end', classes.TreeViewItemToggle, classes.TreeViewItemToggleHover, classes.TreeViewItemToggleEnd),
|
|
472
|
+
onClick: event => {
|
|
473
|
+
if (onSelect) {
|
|
474
|
+
toggle(event);
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
children: isExpanded ? /*#__PURE__*/jsx(ChevronDownIcon, {
|
|
478
|
+
size: TOGGLE_ICON_SIZE
|
|
479
|
+
}) : /*#__PURE__*/jsx(ChevronRightIcon, {
|
|
480
|
+
size: TOGGLE_ICON_SIZE
|
|
481
|
+
})
|
|
482
|
+
}) : null, /*#__PURE__*/jsxs("div", {
|
|
483
|
+
id: labelId,
|
|
484
|
+
className: clsx('PRIVATE_TreeView-item-content', classes.TreeViewItemContent),
|
|
485
|
+
children: [slots.leadingVisual, /*#__PURE__*/jsx("span", {
|
|
486
|
+
className: clsx('PRIVATE_TreeView-item-content-text', classes.TreeViewItemContentText),
|
|
487
|
+
children: childrenWithoutSubTree
|
|
488
|
+
}), slots.trailingVisual]
|
|
489
|
+
}), secondaryActions ? /*#__PURE__*/jsxs(Fragment, {
|
|
490
|
+
children: [/*#__PURE__*/jsx(TrailingAction, {
|
|
491
|
+
items: secondaryActions,
|
|
492
|
+
shortcutText: trailingActionShortcutText
|
|
493
|
+
}), actionCommandPressed ? /*#__PURE__*/jsx(ActionDialog, {
|
|
494
|
+
items: secondaryActions,
|
|
495
|
+
onClose: () => setActionCommandPressed(false)
|
|
496
|
+
}) : null]
|
|
497
|
+
}) : null]
|
|
498
|
+
}), subTree]
|
|
499
|
+
});
|
|
400
500
|
return /*#__PURE__*/jsx(ItemContext.Provider, {
|
|
401
501
|
value: {
|
|
402
502
|
itemId,
|
|
@@ -409,101 +509,10 @@ const ItemImpl = fixedForwardRef(({
|
|
|
409
509
|
trailingVisualId,
|
|
410
510
|
trailingActionId
|
|
411
511
|
},
|
|
412
|
-
children: /*#__PURE__*/
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
id: itemId,
|
|
417
|
-
role: "treeitem",
|
|
418
|
-
"aria-label": secondaryActions ? ariaLabel ? `${ariaLabel}. ${trailingActionShortcutText}` : undefined : ariaLabel,
|
|
419
|
-
"aria-labelledby": ariaLabel ? undefined : `${ariaLabelledby || labelId} ${secondaryActions ? trailingActionId : ''}`.trim(),
|
|
420
|
-
"aria-describedby": ariaDescribedByIds.length ? ariaDescribedByIds.join(' ') : undefined,
|
|
421
|
-
"aria-level": level,
|
|
422
|
-
"aria-expanded": isSubTreeEmpty && (!isExpanded || !hasSubTree) || expanded === null ? undefined : isExpanded,
|
|
423
|
-
"aria-current": isCurrentItem ? 'true' : undefined,
|
|
424
|
-
"aria-selected": isFocused ? 'true' : 'false',
|
|
425
|
-
"data-has-leading-action": slots.leadingAction ? true : undefined,
|
|
426
|
-
"data-loading": isLoadingPlaceholder ? true : undefined,
|
|
427
|
-
onKeyDown: handleKeyDown,
|
|
428
|
-
onFocus: event => {
|
|
429
|
-
// Defer scroll to the next animation frame so that rapid keyboard
|
|
430
|
-
// navigation (held key) coalesces into a single reflow per frame
|
|
431
|
-
scrollElementIntoView(event.currentTarget.firstElementChild);
|
|
432
|
-
|
|
433
|
-
// Set the focused state
|
|
434
|
-
setIsFocused(true);
|
|
435
|
-
|
|
436
|
-
// Prevent focus event from bubbling up to parent items
|
|
437
|
-
event.stopPropagation();
|
|
438
|
-
},
|
|
439
|
-
onBlur: () => setIsFocused(false),
|
|
440
|
-
onClick: event => {
|
|
441
|
-
if (onSelect) {
|
|
442
|
-
onSelect(event);
|
|
443
|
-
} else {
|
|
444
|
-
toggle(event);
|
|
445
|
-
}
|
|
446
|
-
event.stopPropagation();
|
|
447
|
-
},
|
|
448
|
-
onAuxClick: event => {
|
|
449
|
-
if (onSelect && event.button === 1) {
|
|
450
|
-
onSelect(event);
|
|
451
|
-
}
|
|
452
|
-
event.stopPropagation();
|
|
453
|
-
},
|
|
454
|
-
...restProps,
|
|
455
|
-
children: [/*#__PURE__*/jsxs("div", {
|
|
456
|
-
className: clsx('PRIVATE_TreeView-item-container', classes.TreeViewItemContainer),
|
|
457
|
-
style: {
|
|
458
|
-
// @ts-ignore CSS custom property
|
|
459
|
-
'--level': level,
|
|
460
|
-
contentVisibility: containIntrinsicSize ? 'auto' : undefined,
|
|
461
|
-
containIntrinsicSize
|
|
462
|
-
},
|
|
463
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
464
|
-
style: {
|
|
465
|
-
gridArea: 'spacer',
|
|
466
|
-
display: 'flex'
|
|
467
|
-
},
|
|
468
|
-
children: /*#__PURE__*/jsx(LevelIndicatorLines, {
|
|
469
|
-
level: level
|
|
470
|
-
})
|
|
471
|
-
}), slots.leadingAction, hasSubTree ?
|
|
472
|
-
/*#__PURE__*/
|
|
473
|
-
// This lint rule is disabled due to the guidelines in the `TreeView` api docs.
|
|
474
|
-
// https://github.com/github/primer/blob/main/apis/tree-view-api.md#the-expandcollapse-chevron-toggle
|
|
475
|
-
// This has specific advice that the chevron be available only to pointer event.
|
|
476
|
-
// If they take up a button role, they become unnecessary and numerous tab stops.
|
|
477
|
-
jsx("div", {
|
|
478
|
-
className: clsx('PRIVATE_TreeView-item-toggle', onSelect && 'PRIVATE_TreeView-item-toggle--hover', level === 1 && 'PRIVATE_TreeView-item-toggle--end', classes.TreeViewItemToggle, classes.TreeViewItemToggleHover, classes.TreeViewItemToggleEnd),
|
|
479
|
-
onClick: event => {
|
|
480
|
-
if (onSelect) {
|
|
481
|
-
toggle(event);
|
|
482
|
-
}
|
|
483
|
-
},
|
|
484
|
-
children: isExpanded ? /*#__PURE__*/jsx(ChevronDownIcon, {
|
|
485
|
-
size: TOGGLE_ICON_SIZE
|
|
486
|
-
}) : /*#__PURE__*/jsx(ChevronRightIcon, {
|
|
487
|
-
size: TOGGLE_ICON_SIZE
|
|
488
|
-
})
|
|
489
|
-
}) : null, /*#__PURE__*/jsxs("div", {
|
|
490
|
-
id: labelId,
|
|
491
|
-
className: clsx('PRIVATE_TreeView-item-content', classes.TreeViewItemContent),
|
|
492
|
-
children: [slots.leadingVisual, /*#__PURE__*/jsx("span", {
|
|
493
|
-
className: clsx('PRIVATE_TreeView-item-content-text', classes.TreeViewItemContentText),
|
|
494
|
-
children: childrenWithoutSubTree
|
|
495
|
-
}), slots.trailingVisual]
|
|
496
|
-
}), secondaryActions ? /*#__PURE__*/jsxs(Fragment, {
|
|
497
|
-
children: [/*#__PURE__*/jsx(TrailingAction, {
|
|
498
|
-
items: secondaryActions,
|
|
499
|
-
shortcutText: trailingActionShortcutText
|
|
500
|
-
}), actionCommandPressed ? /*#__PURE__*/jsx(ActionDialog, {
|
|
501
|
-
items: secondaryActions,
|
|
502
|
-
onClose: () => setActionCommandPressed(false)
|
|
503
|
-
}) : null]
|
|
504
|
-
}) : null]
|
|
505
|
-
}), subTree]
|
|
506
|
-
})
|
|
512
|
+
children: isPolymorphic ? /*#__PURE__*/jsx("li", {
|
|
513
|
+
role: "none",
|
|
514
|
+
children: itemElement
|
|
515
|
+
}) : itemElement
|
|
507
516
|
});
|
|
508
517
|
});
|
|
509
518
|
const Item = Object.assign(ItemImpl, {
|
package/package.json
CHANGED