@primer/react 0.0.0-20260311165335 → 0.0.0-20260311170109
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,6 @@
|
|
|
1
1
|
# @primer/react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- Fake entry to force publishing
|
|
8
|
-
|
|
9
|
-
- [#7621](https://github.com/primer/react/pull/7621) [`43c0462`](https://github.com/primer/react/commit/43c0462f96db643168a9eb2bc84cd07b6acb6b90) Thanks [@hectahertz](https://github.com/hectahertz)! - Memoize SelectPanel overlayProps, focusTrapSettings, and preventBubbling to reduce allocations on re-renders
|
|
10
|
-
|
|
11
|
-
## 38.15.0
|
|
3
|
+
## 0.0.0-20260311170109
|
|
12
4
|
|
|
13
5
|
### Minor Changes
|
|
14
6
|
|
|
@@ -20,6 +12,8 @@
|
|
|
20
12
|
|
|
21
13
|
- [#7529](https://github.com/primer/react/pull/7529) [`7e108fe`](https://github.com/primer/react/commit/7e108fea1a9f92ce22f46ff1d55bfe4753d89ad8) Thanks [@liuliu-dev](https://github.com/liuliu-dev)! - Add keyboard-accessible tooltip for truncated ActionList.Description
|
|
22
14
|
|
|
15
|
+
- Fake entry to force publishing
|
|
16
|
+
|
|
23
17
|
- [#7585](https://github.com/primer/react/pull/7585) [`3dd2c78`](https://github.com/primer/react/commit/3dd2c78f768ad560ee0f37947af2c17ca8d7938c) Thanks [@iansan5653](https://github.com/iansan5653)! - - Fixes a bug where `ActionBar` menu items would be out of order if new items were mounted after the initial render
|
|
24
18
|
|
|
25
19
|
- Improves initial render performance for `ActionBar`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectPanel.d.ts","sourceRoot":"","sources":["../../src/SelectPanel/SelectPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,SAA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9 +56,6 @@ const focusZoneSettings = {
|
|
|
56
56
|
// Let FilteredActionList handle focus zone
|
|
57
57
|
disabled: true
|
|
58
58
|
};
|
|
59
|
-
const closeButtonProps = {
|
|
60
|
-
'aria-label': 'Cancel and close'
|
|
61
|
-
};
|
|
62
59
|
const areItemsEqual = (itemA, itemB) => {
|
|
63
60
|
// prefer checking equivality by item.id
|
|
64
61
|
if (typeof itemA.id !== 'undefined') return itemA.id === itemB.id;else return itemA === itemB;
|
|
@@ -540,9 +537,9 @@ function Panel({
|
|
|
540
537
|
prevOpenRef.current = open;
|
|
541
538
|
}
|
|
542
539
|
}, [open, resetSort]);
|
|
543
|
-
const focusTrapSettings =
|
|
540
|
+
const focusTrapSettings = {
|
|
544
541
|
initialFocusRef: inputRef || undefined
|
|
545
|
-
}
|
|
542
|
+
};
|
|
546
543
|
const extendedTextInputProps = useMemo(() => {
|
|
547
544
|
return {
|
|
548
545
|
className: classes.TextInput,
|
|
@@ -618,11 +615,9 @@ function Panel({
|
|
|
618
615
|
regular: 'anchored',
|
|
619
616
|
narrow: 'fullscreen'
|
|
620
617
|
} : undefined, 'anchored');
|
|
621
|
-
const preventBubbling =
|
|
622
|
-
var _overlayProps$onKeyDo;
|
|
623
|
-
overlayProps === null || overlayProps === void 0 ? void 0 : (_overlayProps$onKeyDo = overlayProps.onKeyDown) === null || _overlayProps$onKeyDo === void 0 ? void 0 : _overlayProps$onKeyDo.call(overlayProps, event);
|
|
624
|
-
|
|
618
|
+
const preventBubbling = customOnKeyDown => event => {
|
|
625
619
|
// skip if a TextInput has focus
|
|
620
|
+
customOnKeyDown === null || customOnKeyDown === void 0 ? void 0 : customOnKeyDown(event);
|
|
626
621
|
const activeElement = document.activeElement;
|
|
627
622
|
if (activeElement.tagName === 'INPUT' || activeElement.tagName === 'TEXTAREA') return;
|
|
628
623
|
|
|
@@ -637,25 +632,7 @@ function Panel({
|
|
|
637
632
|
|
|
638
633
|
// if this is a typeahead event, don't propagate outside of menu
|
|
639
634
|
event.stopPropagation();
|
|
640
|
-
}
|
|
641
|
-
const mergedOverlayProps = useMemo(() => ({
|
|
642
|
-
role: 'dialog',
|
|
643
|
-
'aria-labelledby': titleId,
|
|
644
|
-
'aria-describedby': subtitle ? subtitleId : undefined,
|
|
645
|
-
...overlayProps,
|
|
646
|
-
...(variant === 'modal' ? {
|
|
647
|
-
top: '50vh',
|
|
648
|
-
left: '50vw',
|
|
649
|
-
anchorSide: undefined
|
|
650
|
-
} : {}),
|
|
651
|
-
style: {
|
|
652
|
-
transform: variant === 'modal' ? 'translate(-50%, -50%)' : undefined,
|
|
653
|
-
...(isKeyboardVisible ? {
|
|
654
|
-
maxHeight: availablePanelHeight !== undefined ? `${availablePanelHeight}px` : 'auto'
|
|
655
|
-
} : {})
|
|
656
|
-
},
|
|
657
|
-
onKeyDown: preventBubbling
|
|
658
|
-
}), [titleId, subtitle, subtitleId, overlayProps, variant, isKeyboardVisible, availablePanelHeight, preventBubbling]);
|
|
635
|
+
};
|
|
659
636
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
660
637
|
children: [/*#__PURE__*/jsx(AnchoredOverlay, {
|
|
661
638
|
renderAnchor: renderMenuAnchor,
|
|
@@ -664,7 +641,27 @@ function Panel({
|
|
|
664
641
|
open: open,
|
|
665
642
|
onOpen: onOpen,
|
|
666
643
|
onClose: onClose,
|
|
667
|
-
overlayProps:
|
|
644
|
+
overlayProps: {
|
|
645
|
+
role: 'dialog',
|
|
646
|
+
'aria-labelledby': titleId,
|
|
647
|
+
'aria-describedby': subtitle ? subtitleId : undefined,
|
|
648
|
+
...overlayProps,
|
|
649
|
+
...(variant === 'modal' ? {
|
|
650
|
+
/* override AnchoredOverlay position */
|
|
651
|
+
top: '50vh',
|
|
652
|
+
left: '50vw',
|
|
653
|
+
anchorSide: undefined
|
|
654
|
+
} : {}),
|
|
655
|
+
style: {
|
|
656
|
+
/* override AnchoredOverlay position */
|
|
657
|
+
transform: variant === 'modal' ? 'translate(-50%, -50%)' : undefined,
|
|
658
|
+
// set maxHeight based on calculated availablePanelHeight when keyboard is visible
|
|
659
|
+
...(isKeyboardVisible ? {
|
|
660
|
+
maxHeight: availablePanelHeight !== undefined ? `${availablePanelHeight}px` : 'auto'
|
|
661
|
+
} : {})
|
|
662
|
+
},
|
|
663
|
+
onKeyDown: preventBubbling(overlayProps === null || overlayProps === void 0 ? void 0 : overlayProps.onKeyDown)
|
|
664
|
+
},
|
|
668
665
|
focusTrapSettings: focusTrapSettings,
|
|
669
666
|
focusZoneSettings: focusZoneSettings,
|
|
670
667
|
height: height,
|
|
@@ -677,7 +674,9 @@ function Panel({
|
|
|
677
674
|
pinPosition: !height,
|
|
678
675
|
className: classes.Overlay,
|
|
679
676
|
displayCloseButton: showXCloseIcon,
|
|
680
|
-
closeButtonProps:
|
|
677
|
+
closeButtonProps: {
|
|
678
|
+
'aria-label': 'Cancel and close'
|
|
679
|
+
},
|
|
681
680
|
children: /*#__PURE__*/jsxs("div", {
|
|
682
681
|
className: classes.Wrapper,
|
|
683
682
|
"data-variant": variant,
|
|
@@ -1759,7 +1759,7 @@
|
|
|
1759
1759
|
},
|
|
1760
1760
|
{
|
|
1761
1761
|
"id": "components-button-features--inactive",
|
|
1762
|
-
"code": "() => (\n <div\n style={{\n display: 'flex',\n flexDirection: 'row',\n gap: '1rem',\n }}\n >\n <VisuallyHidden id=\"inactive-state\">Inactive</VisuallyHidden>\n <Button inactive aria-describedby=\"inactive-state\">\n Default\n </Button>\n <Button variant=\"primary\" inactive aria-describedby=\"inactive-state\">\n Primary\n </Button>\n <Button variant=\"danger\" inactive aria-describedby=\"inactive-state\">\n Danger\n </Button>\n <Button variant=\"invisible\" inactive aria-describedby=\"inactive-state\">\n Invisible\n </Button>\n </div>\n)"
|
|
1762
|
+
"code": "() => (\n <div\n style={{\n display: 'flex',\n flexWrap: 'wrap',\n flexDirection: 'row',\n gap: '1rem',\n }}\n >\n <VisuallyHidden id=\"inactive-state\">Inactive</VisuallyHidden>\n <Button inactive aria-describedby=\"inactive-state\">\n Default\n </Button>\n <Button variant=\"primary\" inactive aria-describedby=\"inactive-state\">\n Primary\n </Button>\n <Button variant=\"danger\" inactive aria-describedby=\"inactive-state\">\n Danger\n </Button>\n <Button variant=\"invisible\" inactive aria-describedby=\"inactive-state\">\n Invisible\n </Button>\n </div>\n)"
|
|
1763
1763
|
},
|
|
1764
1764
|
{
|
|
1765
1765
|
"id": "components-button-features--small",
|
package/package.json
CHANGED