@primer/react 0.0.0-20260324221644 → 0.0.0-20260325005348
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 +2 -2
- package/dist/AnchoredOverlay/AnchoredOverlay-0f6f45b5.css +2 -0
- package/dist/AnchoredOverlay/AnchoredOverlay-0f6f45b5.css.map +1 -0
- package/dist/AnchoredOverlay/AnchoredOverlay.d.ts.map +1 -1
- package/dist/AnchoredOverlay/AnchoredOverlay.js +10 -49
- package/dist/AnchoredOverlay/AnchoredOverlay.module.css.js +2 -2
- package/dist/Overlay/Overlay.d.ts +0 -2
- package/dist/Overlay/Overlay.d.ts.map +1 -1
- package/dist/Overlay/Overlay.js +79 -83
- package/dist/SelectPanel/SelectPanel.d.ts +2 -2
- package/dist/SelectPanel/SelectPanel.d.ts.map +1 -1
- package/dist/SelectPanel/SelectPanel.js +2 -0
- package/generated/components.json +6 -0
- package/package.json +1 -1
- package/dist/AnchoredOverlay/AnchoredOverlay-647c7065.css +0 -2
- package/dist/AnchoredOverlay/AnchoredOverlay-647c7065.css.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @primer/react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-20260325005348
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
- [#7623](https://github.com/primer/react/pull/7623) [`42847d1`](https://github.com/primer/react/commit/42847d1bb943c2db6d2309dfd604e8d3ab55d387) Thanks [@copilot-swe-agent](https://github.com/apps/copilot-swe-agent)! - `IconButton`: `keybindingHint` now accepts `string[]` in addition to `string`. Multiple hints are rendered joined with "or".
|
|
15
15
|
|
|
16
|
-
- [#
|
|
16
|
+
- [#7699](https://github.com/primer/react/pull/7699) [`fd4a28d`](https://github.com/primer/react/commit/fd4a28d757fc1d52c85b5abcc6793d0b41ebc1f8) Thanks [@francinelucca](https://github.com/francinelucca)! - SelectPanel: Add `displayInViewport` prop
|
|
17
17
|
|
|
18
18
|
### Patch Changes
|
|
19
19
|
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.prc-AnchoredOverlay-ResponsiveCloseButtonContainer-nuium{position:relative}.prc-AnchoredOverlay-ResponsiveCloseButton-z-2rx{display:none;position:absolute;right:var(--base-size-8,.5rem);top:var(--base-size-8,.5rem)}@media screen and (max-width:calc(48rem - 0.02px)){.prc-AnchoredOverlay-ResponsiveCloseButton-z-2rx{display:inline-grid}}.prc-AnchoredOverlay-Wrapper-w6jU3{anchor-scope:--anchored-overlay-anchor}.prc-AnchoredOverlay-Anchor-DWRfK{anchor-name:--anchored-overlay-anchor}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z{position-anchor:--anchored-overlay-anchor;position-try-fallbacks:flip-block,flip-inline,flip-block flip-inline;position-visibility:anchors-visible;position:fixed;z-index:100}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[data-side=outside-bottom]{left:anchor(left);top:calc(anchor(bottom) + var(--base-size-4,.25rem))}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[data-side=outside-top]{bottom:anchor(top);left:anchor(left);margin-bottom:var(--base-size-4,.25rem)}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[data-side=outside-left]{margin-right:var(--base-size-4,.25rem);right:anchor(left);top:anchor(top)}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[data-side=outside-right]{left:anchor(right);margin-left:var(--base-size-4,.25rem);top:anchor(top)}
|
|
2
|
+
/*# sourceMappingURL=AnchoredOverlay-0f6f45b5.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/AnchoredOverlay/AnchoredOverlay.module.css.js"],"names":[],"mappings":"AAAA,0DACE,iBACF,CAEA,iDAIE,YAAa,CAHb,iBAAkB,CAElB,8BAAyB,CADzB,4BAOF,CAHE,mDANF,iDAOI,mBAEJ,CADE,CAGF,mCACE,sCACF,CAEA,kCAEE,qCACF,CAEA,2CAEE,yCAA0C,CAC1C,oEAGwB,CACxB,mCAAoC,CAEpC,cAAe,CADf,WA0BF,CAvBE,qEAGE,iBAAkB,CADlB,oDAEF,CAEA,kEAEE,kBAAmB,CACnB,iBAAkB,CAFlB,uCAGF,CAEA,mEAGE,sCAAgC,CAFhC,kBAAmB,CACnB,eAEF,CAEA,oEACE,kBAAmB,CAEnB,qCAA+B,CAD/B,eAEF","file":"AnchoredOverlay-0f6f45b5.css","sourcesContent":[".ResponsiveCloseButtonContainer {\n position: relative;\n}\n\n.ResponsiveCloseButton {\n position: absolute;\n top: var(--base-size-8);\n right: var(--base-size-8);\n display: none;\n\n @media screen and (--viewportRange-narrow) {\n display: inline-grid;\n }\n}\n\n.Wrapper {\n anchor-scope: --anchored-overlay-anchor;\n}\n\n.Anchor {\n /* Anchor name, this is currently tied to `renderAnchor` */\n anchor-name: --anchored-overlay-anchor;\n}\n\n.AnchoredOverlay {\n /* Anchor position, this is currently tied to `<Overlay>` */\n position-anchor: --anchored-overlay-anchor;\n position-try-fallbacks:\n flip-block,\n flip-inline,\n flip-block flip-inline;\n position-visibility: anchors-visible;\n z-index: 100;\n position: fixed;\n\n &[data-side='outside-bottom'] {\n /* stylelint-disable primer/spacing */\n top: calc(anchor(bottom) + var(--base-size-4));\n left: anchor(left);\n }\n\n &[data-side='outside-top'] {\n margin-bottom: var(--base-size-4);\n bottom: anchor(top);\n left: anchor(left);\n }\n\n &[data-side='outside-left'] {\n right: anchor(left);\n top: anchor(top);\n margin-right: var(--base-size-4);\n }\n\n &[data-side='outside-right'] {\n left: anchor(right);\n top: anchor(top);\n margin-left: var(--base-size-4);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnchoredOverlay.d.ts","sourceRoot":"","sources":["../../src/AnchoredOverlay/AnchoredOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,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O,CAAC,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,MAAM,GAAG,cAAc,GAAG,iBAAiB,GAAG,mBAAmB,CAAC,CAAC,CAAA;AAoB9G;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CAgLnF,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useCallback, useRef, useEffect } from 'react';
|
|
2
|
-
import useIsomorphicLayoutEffect from '../utils/useIsomorphicLayoutEffect.js';
|
|
3
2
|
import { useFocusTrap } from '../hooks/useFocusTrap.js';
|
|
4
3
|
import { useFocusZone } from '../hooks/useFocusZone.js';
|
|
5
4
|
import { useId } from '../hooks/useId.js';
|
|
@@ -78,17 +77,12 @@ const AnchoredOverlay = ({
|
|
|
78
77
|
if (event_0.defaultPrevented || event_0.button !== 0) {
|
|
79
78
|
return;
|
|
80
79
|
}
|
|
81
|
-
// Prevent the browser's native popovertarget toggle so React
|
|
82
|
-
// stays the single source of truth for popover visibility.
|
|
83
|
-
if (cssAnchorPositioning) {
|
|
84
|
-
event_0.preventDefault();
|
|
85
|
-
}
|
|
86
80
|
if (!open) {
|
|
87
81
|
onOpen === null || onOpen === void 0 ? void 0 : onOpen('anchor-click');
|
|
88
82
|
} else {
|
|
89
83
|
onClose === null || onClose === void 0 ? void 0 : onClose('anchor-click');
|
|
90
84
|
}
|
|
91
|
-
}, [open, onOpen, onClose
|
|
85
|
+
}, [open, onOpen, onClose]);
|
|
92
86
|
const positionChange = position => {
|
|
93
87
|
if (onPositionChange && position) {
|
|
94
88
|
onPositionChange({
|
|
@@ -130,48 +124,14 @@ const AnchoredOverlay = ({
|
|
|
130
124
|
disabled: !open || !position_0,
|
|
131
125
|
...focusTrapSettings
|
|
132
126
|
});
|
|
133
|
-
const popoverId = useId();
|
|
134
|
-
const id = popoverId.replaceAll(':', '_'); // popoverId can contain colons which are invalid in CSS custom property names, so we replace them with underscores
|
|
135
|
-
|
|
136
|
-
useEffect(() => {
|
|
137
|
-
if (!cssAnchorPositioning || !anchorRef.current) return;
|
|
138
|
-
const anchor = anchorRef.current;
|
|
139
|
-
const overlay = overlayRef.current;
|
|
140
|
-
anchor.style.setProperty('anchor-name', `--anchored-overlay-anchor-${id}`);
|
|
141
|
-
return () => {
|
|
142
|
-
anchor.style.removeProperty('anchor-name');
|
|
143
|
-
if (overlay) {
|
|
144
|
-
overlay.style.removeProperty('position-anchor');
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
}, [cssAnchorPositioning, anchorRef, overlayRef, id]);
|
|
148
|
-
|
|
149
|
-
// Track the overlay element so we can re-run the effect when it changes.
|
|
150
|
-
// This is necessary when using a Portal, as React re-renders can replace
|
|
151
|
-
// the DOM node, causing the popover to lose its :popover-open state.
|
|
152
|
-
const overlayElement = overlayRef.current;
|
|
153
|
-
useIsomorphicLayoutEffect(() => {
|
|
154
|
-
// Read ref inside effect to get the value after child refs are attached
|
|
155
|
-
const currentOverlay = overlayRef.current;
|
|
156
|
-
if (!cssAnchorPositioning || !open || !currentOverlay) return;
|
|
157
|
-
currentOverlay.style.setProperty('position-anchor', `--anchored-overlay-anchor-${id}`);
|
|
158
|
-
try {
|
|
159
|
-
if (!currentOverlay.matches(':popover-open')) {
|
|
160
|
-
currentOverlay.showPopover();
|
|
161
|
-
}
|
|
162
|
-
} catch {
|
|
163
|
-
// Ignore if popover is already showing or not supported
|
|
164
|
-
}
|
|
165
|
-
}, [cssAnchorPositioning, open, overlayElement, id, overlayRef]);
|
|
166
127
|
const showXIcon = onClose && variant.narrow === 'fullscreen' && displayCloseButton;
|
|
167
128
|
const XButtonAriaLabelledBy = closeButtonProps['aria-labelledby'];
|
|
168
129
|
const XButtonAriaLabel = closeButtonProps['aria-label'];
|
|
169
130
|
const {
|
|
170
131
|
className: overlayClassName,
|
|
171
|
-
disablePortal,
|
|
172
132
|
...restOverlayProps
|
|
173
133
|
} = overlayProps || {};
|
|
174
|
-
|
|
134
|
+
const innerContent = /*#__PURE__*/jsxs(Fragment, {
|
|
175
135
|
children: [renderAnchor && renderAnchor({
|
|
176
136
|
ref: anchorRef,
|
|
177
137
|
id: anchorId,
|
|
@@ -181,8 +141,7 @@ const AnchoredOverlay = ({
|
|
|
181
141
|
onClick: onAnchorClick,
|
|
182
142
|
onKeyDown: onAnchorKeyDown,
|
|
183
143
|
...(cssAnchorPositioning ? {
|
|
184
|
-
|
|
185
|
-
popoverTarget: popoverId
|
|
144
|
+
className: classes.Anchor
|
|
186
145
|
} : {})
|
|
187
146
|
}), open ? /*#__PURE__*/jsxs(Overlay, {
|
|
188
147
|
returnFocusRef: anchorRef,
|
|
@@ -200,12 +159,7 @@ const AnchoredOverlay = ({
|
|
|
200
159
|
className: clsx(className, overlayClassName, cssAnchorPositioning ? classes.AnchoredOverlay : undefined),
|
|
201
160
|
preventOverflow: preventOverflow,
|
|
202
161
|
"data-component": "AnchoredOverlay",
|
|
203
|
-
disablePortal: disablePortal,
|
|
204
|
-
...(cssAnchorPositioning ? {
|
|
205
|
-
popover: 'manual'
|
|
206
|
-
} : {}),
|
|
207
162
|
...restOverlayProps,
|
|
208
|
-
id: cssAnchorPositioning ? popoverId : undefined,
|
|
209
163
|
ref: node => {
|
|
210
164
|
if (overlayProps !== null && overlayProps !== void 0 && overlayProps.ref) {
|
|
211
165
|
assignRef(overlayProps.ref, node);
|
|
@@ -236,6 +190,13 @@ const AnchoredOverlay = ({
|
|
|
236
190
|
}) : null, children]
|
|
237
191
|
}) : null]
|
|
238
192
|
});
|
|
193
|
+
if (cssAnchorPositioning) {
|
|
194
|
+
return /*#__PURE__*/jsx("div", {
|
|
195
|
+
className: classes.Wrapper,
|
|
196
|
+
children: innerContent
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
return innerContent;
|
|
239
200
|
};
|
|
240
201
|
function assignRef(ref, value) {
|
|
241
202
|
if (typeof ref === 'function') {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import './AnchoredOverlay-
|
|
1
|
+
import './AnchoredOverlay-0f6f45b5.css';
|
|
2
2
|
|
|
3
|
-
var classes = {"ResponsiveCloseButtonContainer":"prc-AnchoredOverlay-ResponsiveCloseButtonContainer-nuium","ResponsiveCloseButton":"prc-AnchoredOverlay-ResponsiveCloseButton-z-2rx","AnchoredOverlay":"prc-AnchoredOverlay-AnchoredOverlay-fYg9Z"};
|
|
3
|
+
var classes = {"ResponsiveCloseButtonContainer":"prc-AnchoredOverlay-ResponsiveCloseButtonContainer-nuium","ResponsiveCloseButton":"prc-AnchoredOverlay-ResponsiveCloseButton-z-2rx","Wrapper":"prc-AnchoredOverlay-Wrapper-w6jU3","Anchor":"prc-AnchoredOverlay-Anchor-DWRfK","AnchoredOverlay":"prc-AnchoredOverlay-AnchoredOverlay-fYg9Z"};
|
|
4
4
|
|
|
5
5
|
export { classes as default };
|
|
@@ -61,7 +61,6 @@ type OwnOverlayProps = Merge<StyledOverlayProps, BaseOverlayProps>;
|
|
|
61
61
|
export declare const BaseOverlay: PolymorphicForwardRefComponent<"div", OwnOverlayProps>;
|
|
62
62
|
type ContainerProps = {
|
|
63
63
|
anchorSide?: AnchorSide;
|
|
64
|
-
disablePortal?: boolean;
|
|
65
64
|
ignoreClickRefs?: React.RefObject<HTMLElement | null>[];
|
|
66
65
|
initialFocusRef?: React.RefObject<HTMLElement | null>;
|
|
67
66
|
onClickOutside: (e: TouchOrMouseEvent) => void;
|
|
@@ -74,7 +73,6 @@ type ContainerProps = {
|
|
|
74
73
|
type internalOverlayProps = Merge<OwnOverlayProps, ContainerProps>;
|
|
75
74
|
/**
|
|
76
75
|
* @param anchorSide If provided, the Overlay will slide into position from the side of the anchor with a brief animation
|
|
77
|
-
* @param disablePortal Optional. If true, the Overlay will not be rendered in a Portal. Defaults to false. When using CSS anchor positioning, popovers render in the browser's top layer which already escapes stacking contexts, so a Portal is not strictly necessary but still useful for style isolation.
|
|
78
76
|
* @param height Sets the height of the `Overlay`, pick from our set list of heights, or pass `auto` to automatically set the height based on the content of the `Overlay`, or pass `initial` to set the height based on the initial content of the `Overlay` (i.e. ignoring content changes). `xsmall` corresponds to `192px`, `small` corresponds to `256px`, `medium` corresponds to `320px`, `large` corresponds to `432px`, `xlarge` corresponds to `600px`.
|
|
79
77
|
* @param ignoreClickRefs Optional. An array of ref objects to ignore clicks on in the `onOutsideClick` behavior. This is often used to ignore clicking on the element that toggles the open/closed state for the `Overlay` to prevent the `Overlay` from being toggled twice.
|
|
80
78
|
* @param initialFocusRef Optional. Ref for the element to focus when the `Overlay` is opened. If nothing is provided, the first focusable element in the `Overlay` body is focused.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Overlay.d.ts","sourceRoot":"","sources":["../../src/Overlay/Overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,qBAAqB,EAAe,MAAM,OAAO,CAAA;AAC9D,OAAO,KAA0B,MAAM,OAAO,CAAA;AAE9C,OAAO,KAAK,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,gBAAgB,CAAA;AACnD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAA;AAI/C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAK/F,KAAK,kBAAkB,GAAG;IACxB,KAAK,CAAC,EAAE,MAAM,OAAO,QAAQ,CAAA;IAC7B,MAAM,CAAC,EAAE,MAAM,OAAO,SAAS,CAAA;IAC/B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC,OAAO,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;IAC5D,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC,OAAO,QAAQ,EAAE,MAAM,CAAC,CAAA;IAC9C,UAAU,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;IACjC,QAAQ,CAAC,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|
package/dist/Overlay/Overlay.js
CHANGED
|
@@ -101,7 +101,6 @@ const BaseOverlay = /*#__PURE__*/React.forwardRef(({
|
|
|
101
101
|
});
|
|
102
102
|
/**
|
|
103
103
|
* @param anchorSide If provided, the Overlay will slide into position from the side of the anchor with a brief animation
|
|
104
|
-
* @param disablePortal Optional. If true, the Overlay will not be rendered in a Portal. Defaults to false. When using CSS anchor positioning, popovers render in the browser's top layer which already escapes stacking contexts, so a Portal is not strictly necessary but still useful for style isolation.
|
|
105
104
|
* @param height Sets the height of the `Overlay`, pick from our set list of heights, or pass `auto` to automatically set the height based on the content of the `Overlay`, or pass `initial` to set the height based on the initial content of the `Overlay` (i.e. ignoring content changes). `xsmall` corresponds to `192px`, `small` corresponds to `256px`, `medium` corresponds to `320px`, `large` corresponds to `432px`, `xlarge` corresponds to `600px`.
|
|
106
105
|
* @param ignoreClickRefs Optional. An array of ref objects to ignore clicks on in the `onOutsideClick` behavior. This is often used to ignore clicking on the element that toggles the open/closed state for the `Overlay` to prevent the `Overlay` from being toggled twice.
|
|
107
106
|
* @param initialFocusRef Optional. Ref for the element to focus when the `Overlay` is opened. If nothing is provided, the first focusable element in the `Overlay` body is focused.
|
|
@@ -117,9 +116,8 @@ const BaseOverlay = /*#__PURE__*/React.forwardRef(({
|
|
|
117
116
|
|
|
118
117
|
*/
|
|
119
118
|
const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
120
|
-
const $ = c(
|
|
119
|
+
const $ = c(48);
|
|
121
120
|
let anchorSide;
|
|
122
|
-
let disablePortal;
|
|
123
121
|
let ignoreClickRefs;
|
|
124
122
|
let initialFocusRef;
|
|
125
123
|
let left;
|
|
@@ -139,7 +137,6 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
139
137
|
if ($[0] !== t0) {
|
|
140
138
|
({
|
|
141
139
|
anchorSide,
|
|
142
|
-
disablePortal,
|
|
143
140
|
height: t1,
|
|
144
141
|
ignoreClickRefs,
|
|
145
142
|
initialFocusRef,
|
|
@@ -159,53 +156,52 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
159
156
|
} = t0);
|
|
160
157
|
$[0] = t0;
|
|
161
158
|
$[1] = anchorSide;
|
|
162
|
-
$[2] =
|
|
163
|
-
$[3] =
|
|
164
|
-
$[4] =
|
|
165
|
-
$[5] =
|
|
166
|
-
$[6] =
|
|
167
|
-
$[7] =
|
|
168
|
-
$[8] =
|
|
169
|
-
$[9] =
|
|
170
|
-
$[10] =
|
|
171
|
-
$[11] =
|
|
172
|
-
$[12] =
|
|
173
|
-
$[13] =
|
|
174
|
-
$[14] =
|
|
175
|
-
$[15] =
|
|
176
|
-
$[16] =
|
|
177
|
-
$[17] =
|
|
178
|
-
$[18] = t5;
|
|
159
|
+
$[2] = ignoreClickRefs;
|
|
160
|
+
$[3] = initialFocusRef;
|
|
161
|
+
$[4] = left;
|
|
162
|
+
$[5] = onClickOutside;
|
|
163
|
+
$[6] = onEscape;
|
|
164
|
+
$[7] = portalContainerName;
|
|
165
|
+
$[8] = preventFocusOnOpen;
|
|
166
|
+
$[9] = props;
|
|
167
|
+
$[10] = responsiveVariant;
|
|
168
|
+
$[11] = returnFocusRef;
|
|
169
|
+
$[12] = right;
|
|
170
|
+
$[13] = t1;
|
|
171
|
+
$[14] = t2;
|
|
172
|
+
$[15] = t3;
|
|
173
|
+
$[16] = t4;
|
|
174
|
+
$[17] = t5;
|
|
179
175
|
} else {
|
|
180
176
|
anchorSide = $[1];
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
t5 = $[18];
|
|
177
|
+
ignoreClickRefs = $[2];
|
|
178
|
+
initialFocusRef = $[3];
|
|
179
|
+
left = $[4];
|
|
180
|
+
onClickOutside = $[5];
|
|
181
|
+
onEscape = $[6];
|
|
182
|
+
portalContainerName = $[7];
|
|
183
|
+
preventFocusOnOpen = $[8];
|
|
184
|
+
props = $[9];
|
|
185
|
+
responsiveVariant = $[10];
|
|
186
|
+
returnFocusRef = $[11];
|
|
187
|
+
right = $[12];
|
|
188
|
+
t1 = $[13];
|
|
189
|
+
t2 = $[14];
|
|
190
|
+
t3 = $[15];
|
|
191
|
+
t4 = $[16];
|
|
192
|
+
t5 = $[17];
|
|
198
193
|
}
|
|
199
194
|
const height = t1 === undefined ? "auto" : t1;
|
|
200
195
|
const preventOverflow = t2 === undefined ? true : t2;
|
|
201
196
|
const role = t3 === undefined ? "none" : t3;
|
|
202
197
|
const visibility = t4 === undefined ? "visible" : t4;
|
|
203
198
|
const width = t5 === undefined ? "auto" : t5;
|
|
199
|
+
const cssAnchorPositioning = useFeatureFlag("primer_react_css_anchor_positioning");
|
|
204
200
|
const featureFlagMaxHeightClampToViewport = useFeatureFlag("primer_react_overlay_max_height_clamp_to_viewport");
|
|
205
201
|
const overlayRef = useRef(null);
|
|
206
202
|
useRefObjectAsForwardedRef(forwardedRef, overlayRef);
|
|
207
203
|
let t6;
|
|
208
|
-
if ($[
|
|
204
|
+
if ($[18] !== ignoreClickRefs || $[19] !== initialFocusRef || $[20] !== onClickOutside || $[21] !== onEscape || $[22] !== preventFocusOnOpen || $[23] !== returnFocusRef) {
|
|
209
205
|
t6 = {
|
|
210
206
|
overlayRef,
|
|
211
207
|
returnFocusRef,
|
|
@@ -215,20 +211,20 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
215
211
|
initialFocusRef,
|
|
216
212
|
preventFocusOnOpen
|
|
217
213
|
};
|
|
218
|
-
$[
|
|
219
|
-
$[
|
|
220
|
-
$[
|
|
221
|
-
$[
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
214
|
+
$[18] = ignoreClickRefs;
|
|
215
|
+
$[19] = initialFocusRef;
|
|
216
|
+
$[20] = onClickOutside;
|
|
217
|
+
$[21] = onEscape;
|
|
218
|
+
$[22] = preventFocusOnOpen;
|
|
219
|
+
$[23] = returnFocusRef;
|
|
220
|
+
$[24] = t6;
|
|
225
221
|
} else {
|
|
226
|
-
t6 = $[
|
|
222
|
+
t6 = $[24];
|
|
227
223
|
}
|
|
228
224
|
useOverlay(t6);
|
|
229
225
|
let t7;
|
|
230
226
|
let t8;
|
|
231
|
-
if ($[
|
|
227
|
+
if ($[25] !== height) {
|
|
232
228
|
t7 = () => {
|
|
233
229
|
var _overlayRef$current;
|
|
234
230
|
if (height === "initial" && (_overlayRef$current = overlayRef.current) !== null && _overlayRef$current !== void 0 && _overlayRef$current.clientHeight) {
|
|
@@ -236,17 +232,17 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
236
232
|
}
|
|
237
233
|
};
|
|
238
234
|
t8 = [height];
|
|
239
|
-
$[
|
|
240
|
-
$[
|
|
241
|
-
$[
|
|
235
|
+
$[25] = height;
|
|
236
|
+
$[26] = t7;
|
|
237
|
+
$[27] = t8;
|
|
242
238
|
} else {
|
|
243
|
-
t7 = $[
|
|
244
|
-
t8 = $[
|
|
239
|
+
t7 = $[26];
|
|
240
|
+
t8 = $[27];
|
|
245
241
|
}
|
|
246
242
|
useEffect(t7, t8);
|
|
247
243
|
let t10;
|
|
248
244
|
let t9;
|
|
249
|
-
if ($[
|
|
245
|
+
if ($[28] !== anchorSide || $[29] !== visibility) {
|
|
250
246
|
t9 = () => {
|
|
251
247
|
var _overlayRef$current2;
|
|
252
248
|
const {
|
|
@@ -264,29 +260,29 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
264
260
|
});
|
|
265
261
|
};
|
|
266
262
|
t10 = [anchorSide, 8, "cubic-bezier(0.33, 1, 0.68, 1)", visibility];
|
|
267
|
-
$[
|
|
268
|
-
$[
|
|
269
|
-
$[
|
|
270
|
-
$[
|
|
263
|
+
$[28] = anchorSide;
|
|
264
|
+
$[29] = visibility;
|
|
265
|
+
$[30] = t10;
|
|
266
|
+
$[31] = t9;
|
|
271
267
|
} else {
|
|
272
|
-
t10 = $[
|
|
273
|
-
t9 = $[
|
|
268
|
+
t10 = $[30];
|
|
269
|
+
t9 = $[31];
|
|
274
270
|
}
|
|
275
271
|
useIsomorphicLayoutEffect(t9, t10);
|
|
276
272
|
const leftPosition = left === undefined && right === undefined ? 0 : left;
|
|
277
273
|
const t11 = !preventOverflow ? true : undefined;
|
|
278
274
|
let t12;
|
|
279
|
-
if ($[
|
|
275
|
+
if ($[32] !== featureFlagMaxHeightClampToViewport) {
|
|
280
276
|
t12 = featureFlagMaxHeightClampToViewport ? {
|
|
281
277
|
"data-max-height-clamp-to-viewport": ""
|
|
282
278
|
} : {};
|
|
283
|
-
$[
|
|
284
|
-
$[
|
|
279
|
+
$[32] = featureFlagMaxHeightClampToViewport;
|
|
280
|
+
$[33] = t12;
|
|
285
281
|
} else {
|
|
286
|
-
t12 = $[
|
|
282
|
+
t12 = $[33];
|
|
287
283
|
}
|
|
288
284
|
let t13;
|
|
289
|
-
if ($[
|
|
285
|
+
if ($[34] !== height || $[35] !== leftPosition || $[36] !== props || $[37] !== responsiveVariant || $[38] !== right || $[39] !== role || $[40] !== t11 || $[41] !== t12 || $[42] !== visibility || $[43] !== width) {
|
|
290
286
|
t13 = /*#__PURE__*/jsx(BaseOverlay, {
|
|
291
287
|
role: role,
|
|
292
288
|
width: width,
|
|
@@ -300,35 +296,35 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
300
296
|
...t12,
|
|
301
297
|
...props
|
|
302
298
|
});
|
|
303
|
-
$[
|
|
304
|
-
$[
|
|
305
|
-
$[
|
|
306
|
-
$[
|
|
307
|
-
$[
|
|
308
|
-
$[
|
|
309
|
-
$[
|
|
310
|
-
$[
|
|
311
|
-
$[
|
|
312
|
-
$[
|
|
313
|
-
$[
|
|
299
|
+
$[34] = height;
|
|
300
|
+
$[35] = leftPosition;
|
|
301
|
+
$[36] = props;
|
|
302
|
+
$[37] = responsiveVariant;
|
|
303
|
+
$[38] = right;
|
|
304
|
+
$[39] = role;
|
|
305
|
+
$[40] = t11;
|
|
306
|
+
$[41] = t12;
|
|
307
|
+
$[42] = visibility;
|
|
308
|
+
$[43] = width;
|
|
309
|
+
$[44] = t13;
|
|
314
310
|
} else {
|
|
315
|
-
t13 = $[
|
|
311
|
+
t13 = $[44];
|
|
316
312
|
}
|
|
317
313
|
const overlayContent = t13;
|
|
318
|
-
if (
|
|
314
|
+
if (cssAnchorPositioning) {
|
|
319
315
|
return overlayContent;
|
|
320
316
|
}
|
|
321
317
|
let t14;
|
|
322
|
-
if ($[
|
|
318
|
+
if ($[45] !== overlayContent || $[46] !== portalContainerName) {
|
|
323
319
|
t14 = /*#__PURE__*/jsx(Portal, {
|
|
324
320
|
containerName: portalContainerName,
|
|
325
321
|
children: overlayContent
|
|
326
322
|
});
|
|
327
|
-
$[
|
|
328
|
-
$[
|
|
329
|
-
$[
|
|
323
|
+
$[45] = overlayContent;
|
|
324
|
+
$[46] = portalContainerName;
|
|
325
|
+
$[47] = t14;
|
|
330
326
|
} else {
|
|
331
|
-
t14 = $[
|
|
327
|
+
t14 = $[47];
|
|
332
328
|
}
|
|
333
329
|
return t14;
|
|
334
330
|
});
|
|
@@ -63,8 +63,8 @@ type SelectPanelVariantProps = {
|
|
|
63
63
|
variant: 'modal';
|
|
64
64
|
onCancel: () => void;
|
|
65
65
|
};
|
|
66
|
-
export type SelectPanelProps = SelectPanelBaseProps & Omit<FilteredActionListProps, 'selectionVariant' | 'variant' | 'message'> & Pick<AnchoredOverlayProps, 'open' | 'height' | 'width' | 'align'> & AnchoredOverlayWrapperAnchorProps & (SelectPanelSingleSelection | SelectPanelMultiSelection) & SelectPanelVariantProps;
|
|
67
|
-
declare function Panel({ open, onOpenChange, renderAnchor, anchorRef: externalAnchorRef, placeholder, placeholderText, inputLabel, selected, title, subtitle, onSelectedChange, filterValue: externalFilterValue, onFilterChange: externalOnFilterChange, items, footer, textInputProps, overlayProps, loading, initialLoadingType, className, height, width, id, message, notice, onCancel, variant, secondaryAction, showSelectedOptionsFirst, disableFullscreenOnNarrow, align, showSelectAll, focusPrependedElements, virtualized, ...listProps }: SelectPanelProps): JSX.Element;
|
|
66
|
+
export type SelectPanelProps = SelectPanelBaseProps & Omit<FilteredActionListProps, 'selectionVariant' | 'variant' | 'message'> & Pick<AnchoredOverlayProps, 'open' | 'height' | 'width' | 'align' | 'displayInViewport'> & AnchoredOverlayWrapperAnchorProps & (SelectPanelSingleSelection | SelectPanelMultiSelection) & SelectPanelVariantProps;
|
|
67
|
+
declare function Panel({ open, onOpenChange, renderAnchor, anchorRef: externalAnchorRef, placeholder, placeholderText, inputLabel, selected, title, subtitle, onSelectedChange, filterValue: externalFilterValue, onFilterChange: externalOnFilterChange, items, footer, textInputProps, overlayProps, loading, initialLoadingType, className, height, width, id, message, notice, onCancel, variant, secondaryAction, showSelectedOptionsFirst, disableFullscreenOnNarrow, align, showSelectAll, focusPrependedElements, virtualized, displayInViewport, ...listProps }: SelectPanelProps): JSX.Element;
|
|
68
68
|
declare const SecondaryButton: React.FC<ButtonProps>;
|
|
69
69
|
declare const SecondaryLink: React.FC<LinkButtonProps & ButtonProps>;
|
|
70
70
|
export declare const SelectPanel: typeof Panel & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectPanel.d.ts","sourceRoot":"","sources":["../../src/SelectPanel/SelectPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,SAAS,EAAC,MAAM,wBAAwB,CAAA;AAC1F,OAAO,KAAK,EAAE,EAAoD,KAAK,GAAG,EAAC,MAAM,OAAO,CAAA;AACxF,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,oBAAoB,CAAA;AAE5D,OAAO,KAAK,EAAC,iCAAiC,EAAC,MAAM,oCAAo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
|
|
114
114
|
focusPrependedElements,
|
|
115
115
|
virtualized,
|
|
116
|
+
displayInViewport,
|
|
116
117
|
...listProps
|
|
117
118
|
}) {
|
|
118
119
|
var _listProps$groupMetad;
|
|
@@ -678,6 +679,7 @@ function Panel({
|
|
|
678
679
|
className: classes.Overlay,
|
|
679
680
|
displayCloseButton: showXCloseIcon,
|
|
680
681
|
closeButtonProps: closeButtonProps,
|
|
682
|
+
displayInViewport: displayInViewport,
|
|
681
683
|
children: /*#__PURE__*/jsxs("div", {
|
|
682
684
|
className: classes.Wrapper,
|
|
683
685
|
"data-variant": variant,
|
|
@@ -6430,6 +6430,12 @@
|
|
|
6430
6430
|
"type": "boolean",
|
|
6431
6431
|
"defaultValue": "false",
|
|
6432
6432
|
"description": "If true, enables client-side list virtualization. Only the visible items plus a small overscan buffer are rendered in the DOM, dramatically improving performance for large lists. Recommended for lists with more than 100 items. Has no effect when `groupMetadata` is provided."
|
|
6433
|
+
},
|
|
6434
|
+
{
|
|
6435
|
+
"name": "displayInViewport",
|
|
6436
|
+
"type": "boolean",
|
|
6437
|
+
"defaultValue": "false",
|
|
6438
|
+
"description": "If true, the panel will attempt to fit entirely into the visible viewport, without having to scroll."
|
|
6433
6439
|
}
|
|
6434
6440
|
],
|
|
6435
6441
|
"subcomponents": []
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
.prc-AnchoredOverlay-ResponsiveCloseButtonContainer-nuium{position:relative}.prc-AnchoredOverlay-ResponsiveCloseButton-z-2rx{display:none;position:absolute;right:var(--base-size-8,.5rem);top:var(--base-size-8,.5rem)}@media screen and (max-width:calc(48rem - 0.02px)){.prc-AnchoredOverlay-ResponsiveCloseButton-z-2rx{display:inline-grid}}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z{position-try-fallbacks:flip-block,flip-inline,flip-block flip-inline;position-visibility:anchors-visible;position:fixed!important;z-index:100}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[popover]{border:0;inset:auto;margin:0;max-height:none;max-width:none;padding:0}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[data-side=outside-bottom]{left:anchor(left);top:calc(anchor(bottom) + var(--base-size-4,.25rem))}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[data-side=outside-top]{bottom:anchor(top);left:anchor(left);margin-bottom:var(--base-size-4,.25rem)}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[data-side=outside-left]{margin-right:var(--base-size-4,.25rem);right:anchor(left);top:anchor(top)}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[data-side=outside-right]{left:anchor(right);margin-left:var(--base-size-4,.25rem);top:anchor(top)}
|
|
2
|
-
/*# sourceMappingURL=AnchoredOverlay-647c7065.css.map */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/AnchoredOverlay/AnchoredOverlay.module.css.js"],"names":[],"mappings":"AAAA,0DACE,iBACF,CAEA,iDAIE,YAAa,CAHb,iBAAkB,CAElB,8BAAyB,CADzB,4BAOF,CAHE,mDANF,iDAOI,mBAEJ,CADE,CAGF,2CACE,oEAGwB,CACxB,mCAAoC,CAEpC,wBAA0B,CAD1B,WAmCF,CAhCE,oDAIE,QAAS,CAHT,UAAW,CACX,QAAS,CAGT,eAAgB,CAChB,cAAe,CAHf,SAIF,CAEA,qEAGE,iBAAkB,CADlB,oDAEF,CAEA,kEAEE,kBAAmB,CACnB,iBAAkB,CAFlB,uCAGF,CAEA,mEAGE,sCAAgC,CAFhC,kBAAmB,CACnB,eAEF,CAEA,oEACE,kBAAmB,CAEnB,qCAA+B,CAD/B,eAEF","file":"AnchoredOverlay-647c7065.css","sourcesContent":[".ResponsiveCloseButtonContainer {\n position: relative;\n}\n\n.ResponsiveCloseButton {\n position: absolute;\n top: var(--base-size-8);\n right: var(--base-size-8);\n display: none;\n\n @media screen and (--viewportRange-narrow) {\n display: inline-grid;\n }\n}\n\n.AnchoredOverlay {\n position-try-fallbacks:\n flip-block,\n flip-inline,\n flip-block flip-inline;\n position-visibility: anchors-visible;\n z-index: 100;\n position: fixed !important;\n\n &[popover] {\n inset: auto;\n margin: 0;\n padding: 0;\n border: 0;\n max-height: none;\n max-width: none;\n }\n\n &[data-side='outside-bottom'] {\n /* stylelint-disable primer/spacing */\n top: calc(anchor(bottom) + var(--base-size-4));\n left: anchor(left);\n }\n\n &[data-side='outside-top'] {\n margin-bottom: var(--base-size-4);\n bottom: anchor(top);\n left: anchor(left);\n }\n\n &[data-side='outside-left'] {\n right: anchor(left);\n top: anchor(top);\n margin-right: var(--base-size-4);\n }\n\n &[data-side='outside-right'] {\n left: anchor(right);\n top: anchor(top);\n margin-left: var(--base-size-4);\n }\n}\n"]}
|