@primer/react 0.0.0-20260325141253 → 0.0.0-20260325145613
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 -7
- package/dist/AnchoredOverlay/AnchoredOverlay-647c7065.css +2 -0
- package/dist/AnchoredOverlay/AnchoredOverlay-647c7065.css.map +1 -0
- package/dist/AnchoredOverlay/AnchoredOverlay.d.ts.map +1 -1
- package/dist/AnchoredOverlay/AnchoredOverlay.js +51 -10
- package/dist/AnchoredOverlay/AnchoredOverlay.module.css.js +2 -2
- package/dist/Overlay/Overlay.d.ts +2 -0
- package/dist/Overlay/Overlay.d.ts.map +1 -1
- package/dist/Overlay/Overlay.js +83 -79
- package/package.json +1 -1
- package/dist/AnchoredOverlay/AnchoredOverlay-0f6f45b5.css +0 -2
- package/dist/AnchoredOverlay/AnchoredOverlay-0f6f45b5.css.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +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
|
-
## 38.17.0
|
|
3
|
+
## 0.0.0-20260325145613
|
|
10
4
|
|
|
11
5
|
### Minor Changes
|
|
12
6
|
|
|
@@ -19,8 +13,12 @@
|
|
|
19
13
|
|
|
20
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".
|
|
21
15
|
|
|
16
|
+
- [#7677](https://github.com/primer/react/pull/7677) [`2d29a81`](https://github.com/primer/react/commit/2d29a815894fdcf07130567de616f821d872f02e) Thanks [@TylerJDev](https://github.com/TylerJDev)! - AnchoredOverlay: Add Popover API to AnchoredOverlay (behind `primer_react_css_anchor_positioning` feature flag)
|
|
17
|
+
|
|
22
18
|
### Patch Changes
|
|
23
19
|
|
|
20
|
+
- Fake entry to force publishing
|
|
21
|
+
|
|
24
22
|
- [#7510](https://github.com/primer/react/pull/7510) [`8fa988b`](https://github.com/primer/react/commit/8fa988ba613117874657af722ef6de768b0e0eb8) Thanks [@francinelucca](https://github.com/francinelucca)! - chore: ensure max-height does not surpass viewport height in Overlay, ActionMenu under feature flag
|
|
25
23
|
|
|
26
24
|
- [#7682](https://github.com/primer/react/pull/7682) [`8aed331`](https://github.com/primer/react/commit/8aed331f9dcb8c51d86bf531f7e331a6ccd23d9a) Thanks [@llastflowers](https://github.com/llastflowers)! - Update CheckboxOrRadioGroup.tsx to add `required` announcement
|
|
@@ -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-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 */
|
|
@@ -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,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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnchoredOverlay.d.ts","sourceRoot":"","sources":["../../src/AnchoredOverlay/AnchoredOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAiC,KAAK,GAAG,EAAC,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"AnchoredOverlay.d.ts","sourceRoot":"","sources":["../../src/AnchoredOverlay/AnchoredOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAiC,KAAK,GAAG,EAAC,MAAM,OAAO,CAAA;AAE9D,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,YAAY,CAAA;AAE5C,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,uBAAuB,CAAA;AAEhE,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,uBAAuB,CAAA;AAIhE,OAAO,KAAK,EAAC,cAAc,EAAE,gBAAgB,EAAC,MAAM,mBAAmB,CAAA;AACvE,OAAO,EAAC,KAAK,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAChE,OAAO,EAAa,KAAK,eAAe,EAAC,MAAM,WAAW,CAAA;AAM1D,UAAU,8BAA8B;IACtC;;;OAGG;IACH,YAAY,EAAE,CAAC,CAAC,SAAS,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,YAAY,GAAG,iBAAiB,CAAC,EAChG,KAAK,EAAE,CAAC,KACL,GAAG,CAAC,OAAO,CAAA;IAEhB;;OAEG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IAE/C;;OAEG;IACH,QAAQ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EAAE,cAAc,CAAA;KAAC,KAAK,IAAI,CAAA;IACnE;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;CAC5C;AAED,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,GACzD,CAAC,8BAA8B,GAAG,iCAAiC,CAAC,GACpE,OAAO,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,CAwNnF,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useCallback, useRef, useEffect } from 'react';
|
|
2
|
+
import useIsomorphicLayoutEffect from '../utils/useIsomorphicLayoutEffect.js';
|
|
2
3
|
import { useFocusTrap } from '../hooks/useFocusTrap.js';
|
|
3
4
|
import { useFocusZone } from '../hooks/useFocusZone.js';
|
|
4
5
|
import { useId } from '../hooks/useId.js';
|
|
@@ -77,12 +78,17 @@ const AnchoredOverlay = ({
|
|
|
77
78
|
if (event_0.defaultPrevented || event_0.button !== 0) {
|
|
78
79
|
return;
|
|
79
80
|
}
|
|
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
|
+
}
|
|
80
86
|
if (!open) {
|
|
81
87
|
onOpen === null || onOpen === void 0 ? void 0 : onOpen('anchor-click');
|
|
82
88
|
} else {
|
|
83
89
|
onClose === null || onClose === void 0 ? void 0 : onClose('anchor-click');
|
|
84
90
|
}
|
|
85
|
-
}, [open, onOpen, onClose]);
|
|
91
|
+
}, [open, onOpen, onClose, cssAnchorPositioning]);
|
|
86
92
|
const positionChange = position => {
|
|
87
93
|
if (onPositionChange && position) {
|
|
88
94
|
onPositionChange({
|
|
@@ -124,14 +130,48 @@ const AnchoredOverlay = ({
|
|
|
124
130
|
disabled: !open || !position_0,
|
|
125
131
|
...focusTrapSettings
|
|
126
132
|
});
|
|
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]);
|
|
127
166
|
const showXIcon = onClose && variant.narrow === 'fullscreen' && displayCloseButton;
|
|
128
167
|
const XButtonAriaLabelledBy = closeButtonProps['aria-labelledby'];
|
|
129
168
|
const XButtonAriaLabel = closeButtonProps['aria-label'];
|
|
130
169
|
const {
|
|
131
170
|
className: overlayClassName,
|
|
171
|
+
disablePortal,
|
|
132
172
|
...restOverlayProps
|
|
133
173
|
} = overlayProps || {};
|
|
134
|
-
|
|
174
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
135
175
|
children: [renderAnchor && renderAnchor({
|
|
136
176
|
ref: anchorRef,
|
|
137
177
|
id: anchorId,
|
|
@@ -141,7 +181,8 @@ const AnchoredOverlay = ({
|
|
|
141
181
|
onClick: onAnchorClick,
|
|
142
182
|
onKeyDown: onAnchorKeyDown,
|
|
143
183
|
...(cssAnchorPositioning ? {
|
|
144
|
-
|
|
184
|
+
'data-anchor': '',
|
|
185
|
+
popoverTarget: popoverId
|
|
145
186
|
} : {})
|
|
146
187
|
}), open ? /*#__PURE__*/jsxs(Overlay, {
|
|
147
188
|
returnFocusRef: anchorRef,
|
|
@@ -159,7 +200,14 @@ const AnchoredOverlay = ({
|
|
|
159
200
|
className: clsx(className, overlayClassName, cssAnchorPositioning ? classes.AnchoredOverlay : undefined),
|
|
160
201
|
preventOverflow: preventOverflow,
|
|
161
202
|
"data-component": "AnchoredOverlay",
|
|
203
|
+
disablePortal: disablePortal,
|
|
204
|
+
...(cssAnchorPositioning ? {
|
|
205
|
+
popover: 'manual'
|
|
206
|
+
} : {}),
|
|
162
207
|
...restOverlayProps,
|
|
208
|
+
...(cssAnchorPositioning ? {
|
|
209
|
+
id: popoverId
|
|
210
|
+
} : {}),
|
|
163
211
|
ref: node => {
|
|
164
212
|
if (overlayProps !== null && overlayProps !== void 0 && overlayProps.ref) {
|
|
165
213
|
assignRef(overlayProps.ref, node);
|
|
@@ -190,13 +238,6 @@ const AnchoredOverlay = ({
|
|
|
190
238
|
}) : null, children]
|
|
191
239
|
}) : null]
|
|
192
240
|
});
|
|
193
|
-
if (cssAnchorPositioning) {
|
|
194
|
-
return /*#__PURE__*/jsx("div", {
|
|
195
|
-
className: classes.Wrapper,
|
|
196
|
-
children: innerContent
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
return innerContent;
|
|
200
241
|
};
|
|
201
242
|
function assignRef(ref, value) {
|
|
202
243
|
if (typeof ref === 'function') {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import './AnchoredOverlay-
|
|
1
|
+
import './AnchoredOverlay-647c7065.css';
|
|
2
2
|
|
|
3
|
-
var classes = {"ResponsiveCloseButtonContainer":"prc-AnchoredOverlay-ResponsiveCloseButtonContainer-nuium","ResponsiveCloseButton":"prc-AnchoredOverlay-ResponsiveCloseButton-z-2rx","
|
|
3
|
+
var classes = {"ResponsiveCloseButtonContainer":"prc-AnchoredOverlay-ResponsiveCloseButtonContainer-nuium","ResponsiveCloseButton":"prc-AnchoredOverlay-ResponsiveCloseButton-z-2rx","AnchoredOverlay":"prc-AnchoredOverlay-AnchoredOverlay-fYg9Z"};
|
|
4
4
|
|
|
5
5
|
export { classes as default };
|
|
@@ -61,6 +61,7 @@ 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;
|
|
64
65
|
ignoreClickRefs?: React.RefObject<HTMLElement | null>[];
|
|
65
66
|
initialFocusRef?: React.RefObject<HTMLElement | null>;
|
|
66
67
|
onClickOutside: (e: TouchOrMouseEvent) => void;
|
|
@@ -73,6 +74,7 @@ type ContainerProps = {
|
|
|
73
74
|
type internalOverlayProps = Merge<OwnOverlayProps, ContainerProps>;
|
|
74
75
|
/**
|
|
75
76
|
* @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.
|
|
76
78
|
* @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`.
|
|
77
79
|
* @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.
|
|
78
80
|
* @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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A;IACvB,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,CAAA;IACvD,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IACrD,cAAc,EAAE,CAAC,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAA;IAC9C,QAAQ,EAAE,CAAC,CAAC,EAAE,aAAa,KAAK,IAAI,CAAA;IACpC,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;CACpD,CAAA;AAED,KAAK,oBAAoB,GAAG,KAAK,CAAC,eAAe,EAAE,cAAc,CAAC,CAAA;AAElE;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,OAAO,EA8FR,8BAA8B,CAAC,KAAK,EAAE,oBAAoB,CAAC,CAAA;AAEhE,MAAM,MAAM,YAAY,GAAG,qBAAqB,CAAC,OAAO,OAAO,CAAC,CAAA;AAEhE,eAAe,OAAO,CAAA"}
|
package/dist/Overlay/Overlay.js
CHANGED
|
@@ -101,6 +101,7 @@ 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.
|
|
104
105
|
* @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`.
|
|
105
106
|
* @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.
|
|
106
107
|
* @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.
|
|
@@ -116,8 +117,9 @@ const BaseOverlay = /*#__PURE__*/React.forwardRef(({
|
|
|
116
117
|
|
|
117
118
|
*/
|
|
118
119
|
const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
119
|
-
const $ = c(
|
|
120
|
+
const $ = c(49);
|
|
120
121
|
let anchorSide;
|
|
122
|
+
let disablePortal;
|
|
121
123
|
let ignoreClickRefs;
|
|
122
124
|
let initialFocusRef;
|
|
123
125
|
let left;
|
|
@@ -137,6 +139,7 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
137
139
|
if ($[0] !== t0) {
|
|
138
140
|
({
|
|
139
141
|
anchorSide,
|
|
142
|
+
disablePortal,
|
|
140
143
|
height: t1,
|
|
141
144
|
ignoreClickRefs,
|
|
142
145
|
initialFocusRef,
|
|
@@ -156,52 +159,53 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
156
159
|
} = t0);
|
|
157
160
|
$[0] = t0;
|
|
158
161
|
$[1] = anchorSide;
|
|
159
|
-
$[2] =
|
|
160
|
-
$[3] =
|
|
161
|
-
$[4] =
|
|
162
|
-
$[5] =
|
|
163
|
-
$[6] =
|
|
164
|
-
$[7] =
|
|
165
|
-
$[8] =
|
|
166
|
-
$[9] =
|
|
167
|
-
$[10] =
|
|
168
|
-
$[11] =
|
|
169
|
-
$[12] =
|
|
170
|
-
$[13] =
|
|
171
|
-
$[14] =
|
|
172
|
-
$[15] =
|
|
173
|
-
$[16] =
|
|
174
|
-
$[17] =
|
|
162
|
+
$[2] = disablePortal;
|
|
163
|
+
$[3] = ignoreClickRefs;
|
|
164
|
+
$[4] = initialFocusRef;
|
|
165
|
+
$[5] = left;
|
|
166
|
+
$[6] = onClickOutside;
|
|
167
|
+
$[7] = onEscape;
|
|
168
|
+
$[8] = portalContainerName;
|
|
169
|
+
$[9] = preventFocusOnOpen;
|
|
170
|
+
$[10] = props;
|
|
171
|
+
$[11] = responsiveVariant;
|
|
172
|
+
$[12] = returnFocusRef;
|
|
173
|
+
$[13] = right;
|
|
174
|
+
$[14] = t1;
|
|
175
|
+
$[15] = t2;
|
|
176
|
+
$[16] = t3;
|
|
177
|
+
$[17] = t4;
|
|
178
|
+
$[18] = t5;
|
|
175
179
|
} else {
|
|
176
180
|
anchorSide = $[1];
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
181
|
+
disablePortal = $[2];
|
|
182
|
+
ignoreClickRefs = $[3];
|
|
183
|
+
initialFocusRef = $[4];
|
|
184
|
+
left = $[5];
|
|
185
|
+
onClickOutside = $[6];
|
|
186
|
+
onEscape = $[7];
|
|
187
|
+
portalContainerName = $[8];
|
|
188
|
+
preventFocusOnOpen = $[9];
|
|
189
|
+
props = $[10];
|
|
190
|
+
responsiveVariant = $[11];
|
|
191
|
+
returnFocusRef = $[12];
|
|
192
|
+
right = $[13];
|
|
193
|
+
t1 = $[14];
|
|
194
|
+
t2 = $[15];
|
|
195
|
+
t3 = $[16];
|
|
196
|
+
t4 = $[17];
|
|
197
|
+
t5 = $[18];
|
|
193
198
|
}
|
|
194
199
|
const height = t1 === undefined ? "auto" : t1;
|
|
195
200
|
const preventOverflow = t2 === undefined ? true : t2;
|
|
196
201
|
const role = t3 === undefined ? "none" : t3;
|
|
197
202
|
const visibility = t4 === undefined ? "visible" : t4;
|
|
198
203
|
const width = t5 === undefined ? "auto" : t5;
|
|
199
|
-
const cssAnchorPositioning = useFeatureFlag("primer_react_css_anchor_positioning");
|
|
200
204
|
const featureFlagMaxHeightClampToViewport = useFeatureFlag("primer_react_overlay_max_height_clamp_to_viewport");
|
|
201
205
|
const overlayRef = useRef(null);
|
|
202
206
|
useRefObjectAsForwardedRef(forwardedRef, overlayRef);
|
|
203
207
|
let t6;
|
|
204
|
-
if ($[
|
|
208
|
+
if ($[19] !== ignoreClickRefs || $[20] !== initialFocusRef || $[21] !== onClickOutside || $[22] !== onEscape || $[23] !== preventFocusOnOpen || $[24] !== returnFocusRef) {
|
|
205
209
|
t6 = {
|
|
206
210
|
overlayRef,
|
|
207
211
|
returnFocusRef,
|
|
@@ -211,20 +215,20 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
211
215
|
initialFocusRef,
|
|
212
216
|
preventFocusOnOpen
|
|
213
217
|
};
|
|
214
|
-
$[
|
|
215
|
-
$[
|
|
216
|
-
$[
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
219
|
-
$[
|
|
220
|
-
$[
|
|
218
|
+
$[19] = ignoreClickRefs;
|
|
219
|
+
$[20] = initialFocusRef;
|
|
220
|
+
$[21] = onClickOutside;
|
|
221
|
+
$[22] = onEscape;
|
|
222
|
+
$[23] = preventFocusOnOpen;
|
|
223
|
+
$[24] = returnFocusRef;
|
|
224
|
+
$[25] = t6;
|
|
221
225
|
} else {
|
|
222
|
-
t6 = $[
|
|
226
|
+
t6 = $[25];
|
|
223
227
|
}
|
|
224
228
|
useOverlay(t6);
|
|
225
229
|
let t7;
|
|
226
230
|
let t8;
|
|
227
|
-
if ($[
|
|
231
|
+
if ($[26] !== height) {
|
|
228
232
|
t7 = () => {
|
|
229
233
|
var _overlayRef$current;
|
|
230
234
|
if (height === "initial" && (_overlayRef$current = overlayRef.current) !== null && _overlayRef$current !== void 0 && _overlayRef$current.clientHeight) {
|
|
@@ -232,17 +236,17 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
232
236
|
}
|
|
233
237
|
};
|
|
234
238
|
t8 = [height];
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
239
|
+
$[26] = height;
|
|
240
|
+
$[27] = t7;
|
|
241
|
+
$[28] = t8;
|
|
238
242
|
} else {
|
|
239
|
-
t7 = $[
|
|
240
|
-
t8 = $[
|
|
243
|
+
t7 = $[27];
|
|
244
|
+
t8 = $[28];
|
|
241
245
|
}
|
|
242
246
|
useEffect(t7, t8);
|
|
243
247
|
let t10;
|
|
244
248
|
let t9;
|
|
245
|
-
if ($[
|
|
249
|
+
if ($[29] !== anchorSide || $[30] !== visibility) {
|
|
246
250
|
t9 = () => {
|
|
247
251
|
var _overlayRef$current2;
|
|
248
252
|
const {
|
|
@@ -260,29 +264,29 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
260
264
|
});
|
|
261
265
|
};
|
|
262
266
|
t10 = [anchorSide, 8, "cubic-bezier(0.33, 1, 0.68, 1)", visibility];
|
|
263
|
-
$[
|
|
264
|
-
$[
|
|
265
|
-
$[
|
|
266
|
-
$[
|
|
267
|
+
$[29] = anchorSide;
|
|
268
|
+
$[30] = visibility;
|
|
269
|
+
$[31] = t10;
|
|
270
|
+
$[32] = t9;
|
|
267
271
|
} else {
|
|
268
|
-
t10 = $[
|
|
269
|
-
t9 = $[
|
|
272
|
+
t10 = $[31];
|
|
273
|
+
t9 = $[32];
|
|
270
274
|
}
|
|
271
275
|
useIsomorphicLayoutEffect(t9, t10);
|
|
272
276
|
const leftPosition = left === undefined && right === undefined ? 0 : left;
|
|
273
277
|
const t11 = !preventOverflow ? true : undefined;
|
|
274
278
|
let t12;
|
|
275
|
-
if ($[
|
|
279
|
+
if ($[33] !== featureFlagMaxHeightClampToViewport) {
|
|
276
280
|
t12 = featureFlagMaxHeightClampToViewport ? {
|
|
277
281
|
"data-max-height-clamp-to-viewport": ""
|
|
278
282
|
} : {};
|
|
279
|
-
$[
|
|
280
|
-
$[
|
|
283
|
+
$[33] = featureFlagMaxHeightClampToViewport;
|
|
284
|
+
$[34] = t12;
|
|
281
285
|
} else {
|
|
282
|
-
t12 = $[
|
|
286
|
+
t12 = $[34];
|
|
283
287
|
}
|
|
284
288
|
let t13;
|
|
285
|
-
if ($[
|
|
289
|
+
if ($[35] !== height || $[36] !== leftPosition || $[37] !== props || $[38] !== responsiveVariant || $[39] !== right || $[40] !== role || $[41] !== t11 || $[42] !== t12 || $[43] !== visibility || $[44] !== width) {
|
|
286
290
|
t13 = /*#__PURE__*/jsx(BaseOverlay, {
|
|
287
291
|
role: role,
|
|
288
292
|
width: width,
|
|
@@ -296,35 +300,35 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
296
300
|
...t12,
|
|
297
301
|
...props
|
|
298
302
|
});
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
301
|
-
$[
|
|
302
|
-
$[
|
|
303
|
-
$[
|
|
304
|
-
$[
|
|
305
|
-
$[
|
|
306
|
-
$[
|
|
307
|
-
$[
|
|
308
|
-
$[
|
|
309
|
-
$[
|
|
303
|
+
$[35] = height;
|
|
304
|
+
$[36] = leftPosition;
|
|
305
|
+
$[37] = props;
|
|
306
|
+
$[38] = responsiveVariant;
|
|
307
|
+
$[39] = right;
|
|
308
|
+
$[40] = role;
|
|
309
|
+
$[41] = t11;
|
|
310
|
+
$[42] = t12;
|
|
311
|
+
$[43] = visibility;
|
|
312
|
+
$[44] = width;
|
|
313
|
+
$[45] = t13;
|
|
310
314
|
} else {
|
|
311
|
-
t13 = $[
|
|
315
|
+
t13 = $[45];
|
|
312
316
|
}
|
|
313
317
|
const overlayContent = t13;
|
|
314
|
-
if (
|
|
318
|
+
if (disablePortal) {
|
|
315
319
|
return overlayContent;
|
|
316
320
|
}
|
|
317
321
|
let t14;
|
|
318
|
-
if ($[
|
|
322
|
+
if ($[46] !== overlayContent || $[47] !== portalContainerName) {
|
|
319
323
|
t14 = /*#__PURE__*/jsx(Portal, {
|
|
320
324
|
containerName: portalContainerName,
|
|
321
325
|
children: overlayContent
|
|
322
326
|
});
|
|
323
|
-
$[
|
|
324
|
-
$[
|
|
325
|
-
$[
|
|
327
|
+
$[46] = overlayContent;
|
|
328
|
+
$[47] = portalContainerName;
|
|
329
|
+
$[48] = t14;
|
|
326
330
|
} else {
|
|
327
|
-
t14 = $[
|
|
331
|
+
t14 = $[48];
|
|
328
332
|
}
|
|
329
333
|
return t14;
|
|
330
334
|
});
|
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-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 */
|
|
@@ -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,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"]}
|