@primer/react 0.0.0-20260410005014 → 0.0.0-20260410023003
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 -13
- package/dist/ActionBar/ActionBar.js +3 -3
- package/dist/ActionList/Heading.js +17 -16
- package/dist/AnchoredOverlay/AnchoredOverlay-0cb96b2b.css +2 -0
- package/dist/AnchoredOverlay/AnchoredOverlay-0cb96b2b.css.map +1 -0
- package/dist/AnchoredOverlay/AnchoredOverlay.d.ts.map +1 -1
- package/dist/AnchoredOverlay/AnchoredOverlay.js +39 -20
- package/dist/AnchoredOverlay/AnchoredOverlay.module.css.js +1 -1
- package/dist/Autocomplete/AutocompleteInput.js +3 -3
- package/dist/Autocomplete/AutocompleteOverlay.js +3 -3
- package/dist/Button/ButtonBase.d.ts.map +1 -1
- package/dist/Button/ButtonBase.js +3 -4
- package/dist/DataTable/index.d.ts +8 -4
- package/dist/DataTable/index.d.ts.map +1 -1
- package/dist/DataTable/index.js +0 -1
- package/dist/Dialog/Dialog.js +3 -3
- package/dist/Heading/Heading.js +3 -3
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +3 -4
- package/dist/Overlay/Overlay.d.ts +1 -1
- package/dist/Overlay/Overlay.d.ts.map +1 -1
- package/dist/Overlay/Overlay.js +30 -21
- package/dist/PageLayout/PageLayout.js +5 -5
- package/dist/TextInputWithTokens/TextInputWithTokens.js +91 -90
- package/dist/deprecated/DialogV1/Dialog.js +10 -9
- package/dist/experimental/index.d.ts +0 -2
- package/dist/experimental/index.d.ts.map +1 -1
- package/dist/experimental/index.js +0 -1
- package/dist/hooks/useMergedRefs.d.ts +4 -4
- package/dist/hooks/useMergedRefs.js +4 -4
- package/generated/components.json +0 -91
- package/package.json +1 -2
- package/dist/AnchoredOverlay/AnchoredOverlay-647c7065.css +0 -2
- package/dist/AnchoredOverlay/AnchoredOverlay-647c7065.css.map +0 -1
- package/dist/Card/Card-65d85331.css +0 -2
- package/dist/Card/Card-65d85331.css.map +0 -1
- package/dist/Card/Card.d.ts +0 -96
- package/dist/Card/Card.d.ts.map +0 -1
- package/dist/Card/Card.js +0 -485
- package/dist/Card/Card.module.css.js +0 -5
- package/dist/Card/index.d.ts +0 -31
- package/dist/Card/index.d.ts.map +0 -1
- package/dist/Card/index.js +0 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
# @primer/react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
4
|
-
|
|
5
|
-
### Minor Changes
|
|
6
|
-
|
|
7
|
-
- [#7723](https://github.com/primer/react/pull/7723) [`ec6c88f`](https://github.com/primer/react/commit/ec6c88fe3eb3ef349500617c90378712f802376d) Thanks [@liuliu-dev](https://github.com/liuliu-dev)! - Add Card component with subcomponents: Card.Icon, Card.Image, Card.Heading, Card.Description, Card.Menu, and Card.Metadata
|
|
8
|
-
|
|
9
|
-
### Patch Changes
|
|
10
|
-
|
|
11
|
-
- [#7738](https://github.com/primer/react/pull/7738) [`f5f2869`](https://github.com/primer/react/commit/f5f28691d9e5c9f8495e8c592635d2b616f7cb49) Thanks [@francinelucca](https://github.com/francinelucca)! - ActionMenu, Table: Fix component mutation issue where `Object.assign` was modifying original `@primer/react` components. Now uses wrapper components to avoid side effects.
|
|
12
|
-
|
|
13
|
-
- Fake entry to force publishing
|
|
14
|
-
|
|
15
|
-
## 38.19.0
|
|
3
|
+
## 0.0.0-20260410023003
|
|
16
4
|
|
|
17
5
|
### Minor Changes
|
|
18
6
|
|
|
@@ -26,6 +14,10 @@
|
|
|
26
14
|
|
|
27
15
|
- [#7707](https://github.com/primer/react/pull/7707) [`6431bfe`](https://github.com/primer/react/commit/6431bfecd72e24db1dfa90b02f8a42834e63843b) Thanks [@liuliu-dev](https://github.com/liuliu-dev)! - Fix anchor-name not being set on the anchor element when SelectPanel is opened in Copilot code agent.
|
|
28
16
|
|
|
17
|
+
- [#7638](https://github.com/primer/react/pull/7638) [`f04e85d`](https://github.com/primer/react/commit/f04e85df536cd6e8047f70b070bd3cf7c0961f92) Thanks [@iansan5653](https://github.com/iansan5653)! - Update internal implementations of combined refs to improve performance and add support for React 19 callback refs
|
|
18
|
+
|
|
19
|
+
- Fake entry to force publishing
|
|
20
|
+
|
|
29
21
|
- [#7633](https://github.com/primer/react/pull/7633) [`a107d39`](https://github.com/primer/react/commit/a107d398e0574b5f8085485c96b27a168061eb50) Thanks [@copilot-swe-agent](https://github.com/apps/copilot-swe-agent)! - Graduate `primer_react_css_has_selector_perf` feature flag: the CSS `:has()` performance optimization (`body[data-dialog-scroll-disabled]`) is now the default behavior for Dialog scroll disabling
|
|
30
22
|
|
|
31
23
|
- [#7695](https://github.com/primer/react/pull/7695) [`780fc3d`](https://github.com/primer/react/commit/780fc3d7b52fd0f9b63f313af6355398180a0118) Thanks [@mattcosta7](https://github.com/mattcosta7)! - perf(ThemeProvider): Reduce unnecessary renders and effect cascades
|
|
@@ -10,7 +10,7 @@ import styles from './ActionBar.module.css.js';
|
|
|
10
10
|
import { clsx } from 'clsx';
|
|
11
11
|
import { createDescendantRegistry } from '../utils/descendant-registry.js';
|
|
12
12
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
13
|
-
import {
|
|
13
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
14
14
|
import { FocusKeys } from '@primer/behaviors';
|
|
15
15
|
import { ActionMenu } from '../ActionMenu/ActionMenu.js';
|
|
16
16
|
|
|
@@ -423,7 +423,7 @@ const ActionBarIconButton = /*#__PURE__*/forwardRef(({
|
|
|
423
423
|
...props
|
|
424
424
|
}, forwardedRef) => {
|
|
425
425
|
const ref = useRef(null);
|
|
426
|
-
|
|
426
|
+
const mergedRef = useMergedRefs(ref, forwardedRef);
|
|
427
427
|
const {
|
|
428
428
|
size,
|
|
429
429
|
isVisibleChild
|
|
@@ -453,7 +453,7 @@ const ActionBarIconButton = /*#__PURE__*/forwardRef(({
|
|
|
453
453
|
if (!isVisibleChild(id) || groupId && !isVisibleChild(groupId)) return null;
|
|
454
454
|
return /*#__PURE__*/jsx(IconButton, {
|
|
455
455
|
"aria-disabled": disabled,
|
|
456
|
-
ref:
|
|
456
|
+
ref: mergedRef,
|
|
457
457
|
size: size,
|
|
458
458
|
onClick: clickHandler,
|
|
459
459
|
...props,
|
|
@@ -7,12 +7,12 @@ import { invariant } from '../utils/invariant.js';
|
|
|
7
7
|
import { clsx } from 'clsx';
|
|
8
8
|
import classes from './Heading.module.css.js';
|
|
9
9
|
import { jsx } from 'react/jsx-runtime';
|
|
10
|
-
import {
|
|
10
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
11
11
|
import Heading$1 from '../Heading/Heading.js';
|
|
12
12
|
|
|
13
13
|
const Heading = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
14
14
|
var _props$id;
|
|
15
|
-
const $ = c(
|
|
15
|
+
const $ = c(21);
|
|
16
16
|
let as;
|
|
17
17
|
let children;
|
|
18
18
|
let className;
|
|
@@ -45,7 +45,7 @@ const Heading = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
45
45
|
}
|
|
46
46
|
const visuallyHidden = t1 === undefined ? false : t1;
|
|
47
47
|
const innerRef = React.useRef(null);
|
|
48
|
-
|
|
48
|
+
const mergedRef = useMergedRefs(forwardedRef, innerRef);
|
|
49
49
|
const {
|
|
50
50
|
headingId,
|
|
51
51
|
variant: listVariant
|
|
@@ -65,11 +65,11 @@ const Heading = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
65
65
|
t4 = $[8];
|
|
66
66
|
}
|
|
67
67
|
let t5;
|
|
68
|
-
if ($[9] !== as || $[10] !== children || $[11] !== listVariant || $[12] !==
|
|
68
|
+
if ($[9] !== as || $[10] !== children || $[11] !== listVariant || $[12] !== mergedRef || $[13] !== props || $[14] !== size || $[15] !== t3 || $[16] !== t4) {
|
|
69
69
|
t5 = /*#__PURE__*/jsx(Heading$1, {
|
|
70
70
|
as: as,
|
|
71
71
|
variant: size,
|
|
72
|
-
ref:
|
|
72
|
+
ref: mergedRef,
|
|
73
73
|
id: t3,
|
|
74
74
|
className: t4,
|
|
75
75
|
"data-list-variant": listVariant,
|
|
@@ -79,25 +79,26 @@ const Heading = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
79
79
|
$[9] = as;
|
|
80
80
|
$[10] = children;
|
|
81
81
|
$[11] = listVariant;
|
|
82
|
-
$[12] =
|
|
83
|
-
$[13] =
|
|
84
|
-
$[14] =
|
|
85
|
-
$[15] =
|
|
86
|
-
$[16] =
|
|
82
|
+
$[12] = mergedRef;
|
|
83
|
+
$[13] = props;
|
|
84
|
+
$[14] = size;
|
|
85
|
+
$[15] = t3;
|
|
86
|
+
$[16] = t4;
|
|
87
|
+
$[17] = t5;
|
|
87
88
|
} else {
|
|
88
|
-
t5 = $[
|
|
89
|
+
t5 = $[17];
|
|
89
90
|
}
|
|
90
91
|
let t6;
|
|
91
|
-
if ($[
|
|
92
|
+
if ($[18] !== t2 || $[19] !== t5) {
|
|
92
93
|
t6 = /*#__PURE__*/jsx(VisuallyHidden, {
|
|
93
94
|
isVisible: t2,
|
|
94
95
|
children: t5
|
|
95
96
|
});
|
|
96
|
-
$[
|
|
97
|
-
$[
|
|
98
|
-
$[
|
|
97
|
+
$[18] = t2;
|
|
98
|
+
$[19] = t5;
|
|
99
|
+
$[20] = t6;
|
|
99
100
|
} else {
|
|
100
|
-
t6 = $[
|
|
101
|
+
t6 = $[20];
|
|
101
102
|
}
|
|
102
103
|
return t6;
|
|
103
104
|
});
|
|
@@ -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-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-bottom][data-align=left]{left:auto;right:calc(anchor(right) - var(--anchored-overlay-anchor-offset-left))}.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-top][data-align=left]{left:auto;right:anchor(right)}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[data-side=outside-left]{margin-right:var(--base-size-4,.25rem);right:anchor(left);top:anchor(top);position-try-fallbacks:flip-inline,flip-block,flip-start,--outside-left-to-bottom}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[data-side=outside-right]{left:anchor(right);margin-left:var(--base-size-4,.25rem);top:anchor(top);position-try-fallbacks:flip-inline,flip-block,flip-start,--outside-right-to-bottom}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[data-side=outside-right][data-align=right]{left:calc(anchor(right) - var(--anchored-overlay-anchor-offset-right))}@position-try --outside-left-to-bottom{margin:0;right:anchor(right);top:calc(anchor(bottom) + var(--base-size-4,.25rem));width:auto}@position-try --outside-right-to-bottom{left:anchor(left);margin:0;top:calc(anchor(bottom) + var(--base-size-4,.25rem));width:auto}
|
|
2
|
+
/*# sourceMappingURL=AnchoredOverlay-0cb96b2b.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,WAkDF,CA/CE,oDAIE,QAAS,CAHT,UAAW,CACX,QAAS,CAGT,cAAe,CAFf,SAGF,CAEA,qEAGE,iBAAkB,CADlB,oDAOF,CAJE,sFACE,SAAU,CACV,sEACF,CAGF,kEAEE,kBAAmB,CACnB,iBAAkB,CAFlB,uCAQF,CAJE,mFACE,SAAU,CACV,mBACF,CAGF,mEAGE,sCAAgC,CAFhC,kBAAmB,CACnB,eAAgB,CAEhB,iFACF,CAEA,oEACE,kBAAmB,CAEnB,qCAA+B,CAD/B,eAAgB,CAEhB,kFAKF,CAHE,sFACE,sEACF,CAIJ,uCAGE,QAAS,CAFT,mBAAoB,CACpB,oDAA8C,CAE9C,UACF,CAEA,wCACE,iBAAkB,CAElB,QAAS,CADT,oDAA8C,CAE9C,UACF","file":"AnchoredOverlay-0cb96b2b.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-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 &[data-align='left'] {\n left: auto;\n right: calc(anchor(right) - var(--anchored-overlay-anchor-offset-left));\n }\n }\n\n &[data-side='outside-top'] {\n margin-bottom: var(--base-size-4);\n bottom: anchor(top);\n left: anchor(left);\n\n &[data-align='left'] {\n left: auto;\n right: anchor(right);\n }\n }\n\n &[data-side='outside-left'] {\n right: anchor(left);\n top: anchor(top);\n margin-right: var(--base-size-4);\n position-try-fallbacks: flip-inline, flip-block, flip-start, --outside-left-to-bottom;\n }\n\n &[data-side='outside-right'] {\n left: anchor(right);\n top: anchor(top);\n margin-left: var(--base-size-4);\n position-try-fallbacks: flip-inline, flip-block, flip-start, --outside-right-to-bottom;\n\n &[data-align='right'] {\n left: calc(anchor(right) - var(--anchored-overlay-anchor-offset-right));\n }\n }\n}\n\n@position-try --outside-left-to-bottom {\n right: anchor(right);\n top: calc(anchor(bottom) + var(--base-size-4));\n margin: 0;\n width: auto;\n}\n\n@position-try --outside-right-to-bottom {\n left: anchor(left);\n top: calc(anchor(bottom) + var(--base-size-4));\n margin: 0;\n width: auto;\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;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;
|
|
1
|
+
{"version":3,"file":"AnchoredOverlay.d.ts","sourceRoot":"","sources":["../../src/AnchoredOverlay/AnchoredOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,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,oBAAoB,CAAC,CAqOnF,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useRef, useCallback, useEffect } from 'react';
|
|
2
2
|
import useIsomorphicLayoutEffect from '../utils/useIsomorphicLayoutEffect.js';
|
|
3
3
|
import { useFocusTrap } from '../hooks/useFocusTrap.js';
|
|
4
4
|
import { useFocusZone } from '../hooks/useFocusZone.js';
|
|
@@ -7,23 +7,13 @@ import { IconButton } from '../Button/IconButton.js';
|
|
|
7
7
|
import { XIcon } from '@primer/octicons-react';
|
|
8
8
|
import classes from './AnchoredOverlay.module.css.js';
|
|
9
9
|
import { clsx } from 'clsx';
|
|
10
|
+
import Overlay, { widthMap } from '../Overlay/Overlay.js';
|
|
10
11
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
11
12
|
import { useFeatureFlag } from '../FeatureFlags/useFeatureFlag.js';
|
|
12
13
|
import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
|
|
13
14
|
import { useRenderForcingRef } from '../hooks/useRenderForcingRef.js';
|
|
14
15
|
import { useAnchoredPosition } from '../hooks/useAnchoredPosition.js';
|
|
15
|
-
import Overlay from '../Overlay/Overlay.js';
|
|
16
16
|
|
|
17
|
-
const applyAnchorPositioningPolyfill = async () => {
|
|
18
|
-
if (typeof window !== 'undefined' && !('anchorName' in document.documentElement.style)) {
|
|
19
|
-
try {
|
|
20
|
-
await import('@oddbird/css-anchor-positioning');
|
|
21
|
-
} catch (e) {
|
|
22
|
-
// eslint-disable-next-line no-console
|
|
23
|
-
console.warn('Failed to load CSS anchor positioning polyfill:', e);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
17
|
const defaultVariant = {
|
|
28
18
|
regular: 'anchored',
|
|
29
19
|
narrow: 'anchored'
|
|
@@ -60,7 +50,9 @@ const AnchoredOverlay = ({
|
|
|
60
50
|
displayCloseButton = true,
|
|
61
51
|
closeButtonProps = defaultCloseButtonProps
|
|
62
52
|
}) => {
|
|
63
|
-
const
|
|
53
|
+
const cssAnchorPositioningFlag = useFeatureFlag('primer_react_css_anchor_positioning');
|
|
54
|
+
const supportsNativeCSSAnchorPositioning = useRef(false);
|
|
55
|
+
const cssAnchorPositioning = cssAnchorPositioningFlag && supportsNativeCSSAnchorPositioning.current;
|
|
64
56
|
const anchorRef = useProvidedRefOrCreate(externalAnchorRef);
|
|
65
57
|
const [overlayRef, updateOverlayRef] = useRenderForcingRef();
|
|
66
58
|
const anchorId = useId(externalAnchorId);
|
|
@@ -109,17 +101,14 @@ const AnchoredOverlay = ({
|
|
|
109
101
|
displayInViewport,
|
|
110
102
|
onPositionChange: positionChange
|
|
111
103
|
}, [overlayRef.current]);
|
|
112
|
-
const hasLoadedAnchorPositioningPolyfill = useRef(false);
|
|
113
104
|
useEffect(() => {
|
|
105
|
+
supportsNativeCSSAnchorPositioning.current = 'anchorName' in document.documentElement.style;
|
|
106
|
+
|
|
114
107
|
// ensure overlay ref gets cleared when closed, so position can reset between closing/re-opening
|
|
115
108
|
if (!open && overlayRef.current) {
|
|
116
109
|
updateOverlayRef(null);
|
|
117
110
|
}
|
|
118
|
-
|
|
119
|
-
applyAnchorPositioningPolyfill();
|
|
120
|
-
hasLoadedAnchorPositioningPolyfill.current = true;
|
|
121
|
-
}
|
|
122
|
-
}, [open, overlayRef, updateOverlayRef, cssAnchorPositioning]);
|
|
111
|
+
}, [open, overlayRef, updateOverlayRef]);
|
|
123
112
|
useFocusZone({
|
|
124
113
|
containerRef: overlayRef,
|
|
125
114
|
disabled: !open || !position_0,
|
|
@@ -155,6 +144,22 @@ const AnchoredOverlay = ({
|
|
|
155
144
|
const currentOverlay = overlayRef.current;
|
|
156
145
|
if (!cssAnchorPositioning || !open || !currentOverlay) return;
|
|
157
146
|
currentOverlay.style.setProperty('position-anchor', `--anchored-overlay-anchor-${id}`);
|
|
147
|
+
const anchorElement = anchorRef.current;
|
|
148
|
+
if (anchorElement) {
|
|
149
|
+
const overlayWidth = width ? parseInt(widthMap[width]) : null;
|
|
150
|
+
const result = getDefaultPosition(anchorElement, overlayWidth);
|
|
151
|
+
if (result) {
|
|
152
|
+
const {
|
|
153
|
+
leftOffset,
|
|
154
|
+
rightOffset
|
|
155
|
+
} = result;
|
|
156
|
+
const align_0 = leftOffset > 0 ? 'left' : rightOffset > 0 ? 'right' : null;
|
|
157
|
+
if (align_0) {
|
|
158
|
+
currentOverlay.setAttribute('data-align', align_0);
|
|
159
|
+
currentOverlay.style.setProperty(`--anchored-overlay-anchor-offset-${align_0}`, `${result[`${align_0}Offset`]}px`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
158
163
|
try {
|
|
159
164
|
if (!currentOverlay.matches(':popover-open')) {
|
|
160
165
|
currentOverlay.showPopover();
|
|
@@ -162,7 +167,7 @@ const AnchoredOverlay = ({
|
|
|
162
167
|
} catch {
|
|
163
168
|
// Ignore if popover is already showing or not supported
|
|
164
169
|
}
|
|
165
|
-
}, [cssAnchorPositioning, open, overlayElement, id, overlayRef]);
|
|
170
|
+
}, [cssAnchorPositioning, open, overlayElement, id, overlayRef, anchorRef, width]);
|
|
166
171
|
const showXIcon = onClose && variant.narrow === 'fullscreen' && displayCloseButton;
|
|
167
172
|
const XButtonAriaLabelledBy = closeButtonProps['aria-labelledby'];
|
|
168
173
|
const XButtonAriaLabel = closeButtonProps['aria-label'];
|
|
@@ -238,6 +243,20 @@ const AnchoredOverlay = ({
|
|
|
238
243
|
}) : null]
|
|
239
244
|
});
|
|
240
245
|
};
|
|
246
|
+
function getDefaultPosition(anchorElement, overlayWidth) {
|
|
247
|
+
const rect = anchorElement.getBoundingClientRect();
|
|
248
|
+
const vw = window.innerWidth;
|
|
249
|
+
if (!overlayWidth || rect.left >= overlayWidth) return null;
|
|
250
|
+
const horizontal = vw - rect.right >= rect.left ? 'right' : 'left';
|
|
251
|
+
const viewportMargin = 8;
|
|
252
|
+
const leftOffset = Math.max(0, overlayWidth - rect.right + viewportMargin);
|
|
253
|
+
const rightOffset = Math.max(0, rect.right + overlayWidth - vw + viewportMargin);
|
|
254
|
+
return {
|
|
255
|
+
horizontal,
|
|
256
|
+
leftOffset,
|
|
257
|
+
rightOffset
|
|
258
|
+
};
|
|
259
|
+
}
|
|
241
260
|
function assignRef(ref, value) {
|
|
242
261
|
if (typeof ref === 'function') {
|
|
243
262
|
ref(value);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './AnchoredOverlay-
|
|
1
|
+
import './AnchoredOverlay-0cb96b2b.css';
|
|
2
2
|
|
|
3
3
|
var classes = {"ResponsiveCloseButtonContainer":"prc-AnchoredOverlay-ResponsiveCloseButtonContainer-nuium","ResponsiveCloseButton":"prc-AnchoredOverlay-ResponsiveCloseButton-z-2rx","AnchoredOverlay":"prc-AnchoredOverlay-AnchoredOverlay-fYg9Z"};
|
|
4
4
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useContext, useState, useCallback, useEffect } from 'react';
|
|
2
2
|
import { AutocompleteContext, AutocompleteInputContext } from './AutocompleteContext.js';
|
|
3
|
-
import {
|
|
3
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
4
4
|
import useSafeTimeout from '../hooks/useSafeTimeout.js';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
import TextInput from '../TextInput/TextInput.js';
|
|
@@ -36,7 +36,7 @@ const AutocompleteInput = /*#__PURE__*/React.forwardRef(({
|
|
|
36
36
|
inputValue = '',
|
|
37
37
|
isMenuDirectlyActivated
|
|
38
38
|
} = inputContext;
|
|
39
|
-
|
|
39
|
+
const mergedRef = useMergedRefs(forwardedRef, inputRef);
|
|
40
40
|
const [highlightRemainingText, setHighlightRemainingText] = useState(true);
|
|
41
41
|
const {
|
|
42
42
|
safeSetTimeout
|
|
@@ -130,7 +130,7 @@ const AutocompleteInput = /*#__PURE__*/React.forwardRef(({
|
|
|
130
130
|
onKeyDown: handleInputKeyDown,
|
|
131
131
|
onKeyPress: onInputKeyPress,
|
|
132
132
|
onKeyUp: handleInputKeyUp,
|
|
133
|
-
ref:
|
|
133
|
+
ref: mergedRef,
|
|
134
134
|
"aria-controls": `${id}-listbox`,
|
|
135
135
|
"aria-autocomplete": "both",
|
|
136
136
|
role: "combobox",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContext, useRef, useEffect, useCallback } from 'react';
|
|
2
2
|
import { AutocompleteContext } from './AutocompleteContext.js';
|
|
3
|
-
import {
|
|
3
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
4
4
|
import VisuallyHidden from '../_VisuallyHidden.js';
|
|
5
5
|
import classes from './AutocompleteOverlay.module.css.js';
|
|
6
6
|
import { clsx } from 'clsx';
|
|
@@ -48,7 +48,7 @@ function AutocompleteOverlay({
|
|
|
48
48
|
align: 'start',
|
|
49
49
|
anchorElementRef: computedAnchorRef
|
|
50
50
|
}, [showMenu, selectedItemLength]);
|
|
51
|
-
|
|
51
|
+
const mergedRef = useMergedRefs(scrollContainerRef, floatingElementRef);
|
|
52
52
|
const closeOptionList = useCallback(() => {
|
|
53
53
|
setShowMenu(false);
|
|
54
54
|
}, [setShowMenu]);
|
|
@@ -60,7 +60,7 @@ function AutocompleteOverlay({
|
|
|
60
60
|
preventFocusOnOpen: true,
|
|
61
61
|
onClickOutside: closeOptionList,
|
|
62
62
|
onEscape: closeOptionList,
|
|
63
|
-
ref:
|
|
63
|
+
ref: mergedRef,
|
|
64
64
|
top: position === null || position === void 0 ? void 0 : position.top,
|
|
65
65
|
left: position === null || position === void 0 ? void 0 : position.left,
|
|
66
66
|
className: clsx(classes.Overlay, className),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonBase.d.ts","sourceRoot":"","sources":["../../src/Button/ButtonBase.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAC/F,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,SAAS,CAAA;AA2BxC,QAAA,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"ButtonBase.d.ts","sourceRoot":"","sources":["../../src/Button/ButtonBase.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAC/F,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,SAAS,CAAA;AA2BxC,QAAA,MAAM,UAAU,EA0JV,8BAA8B,CAAC,QAAQ,GAAG,GAAG,EAAE,WAAW,CAAC,CAAA;AAEjE,OAAO,EAAC,UAAU,EAAC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
3
3
|
import { ConditionalWrapper } from '../internal/components/ConditionalWrapper.js';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import classes from './ButtonBase.module.css.js';
|
|
@@ -46,7 +46,7 @@ const ButtonBase = /*#__PURE__*/forwardRef(({
|
|
|
46
46
|
...rest
|
|
47
47
|
} = props;
|
|
48
48
|
const innerRef = React.useRef(null);
|
|
49
|
-
|
|
49
|
+
const combinedRefs = useMergedRefs(forwardedRef, innerRef);
|
|
50
50
|
const uuid = useId(id);
|
|
51
51
|
const loadingAnnouncementID = `${uuid}-loading-announcement`;
|
|
52
52
|
|
|
@@ -74,8 +74,7 @@ const ButtonBase = /*#__PURE__*/forwardRef(({
|
|
|
74
74
|
children: [/*#__PURE__*/jsx(Component, {
|
|
75
75
|
"aria-disabled": loading ? true : undefined,
|
|
76
76
|
...rest,
|
|
77
|
-
|
|
78
|
-
ref: innerRef,
|
|
77
|
+
ref: combinedRefs,
|
|
79
78
|
className: clsx(classes.ButtonBase, className),
|
|
80
79
|
"data-block": block ? 'block' : null,
|
|
81
80
|
"data-inactive": inactive ? true : undefined,
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { DataTable } from './DataTable';
|
|
2
2
|
import { ErrorDialog } from './ErrorDialog';
|
|
3
|
-
import {
|
|
3
|
+
import { TableHead, TableBody, TableRow, TableHeader, TableCell, TableCellPlaceholder, TableContainer, TableSubtitle, TableActions, TableDivider, TableSkeleton } from './Table';
|
|
4
4
|
import { Pagination } from './Pagination';
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
declare const Table: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, "ref"> & {
|
|
6
|
+
'aria-describedby'?: string;
|
|
7
|
+
'aria-labelledby'?: string;
|
|
8
|
+
gridTemplateColumns?: React.CSSProperties["gridTemplateColumns"];
|
|
9
|
+
cellPadding?: "condensed" | "normal" | "spacious";
|
|
10
|
+
} & import("react").RefAttributes<HTMLTableElement>> & {
|
|
7
11
|
Container: typeof TableContainer;
|
|
8
|
-
Title:
|
|
12
|
+
Title: import("react").ForwardRefExoticComponent<Omit<import("./Table").TableTitleProps, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
9
13
|
Subtitle: typeof TableSubtitle;
|
|
10
14
|
Actions: typeof TableActions;
|
|
11
15
|
Divider: typeof TableDivider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/DataTable/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAA;AACrC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAA;AACzC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/DataTable/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAA;AACrC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAA;AACzC,OAAO,EAEL,SAAS,EACT,SAAS,EACT,QAAQ,EACR,WAAW,EACX,SAAS,EACT,oBAAoB,EACpB,cAAc,EAEd,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,aAAa,EACd,MAAM,SAAS,CAAA;AAChB,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAA;AAEvC,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;CAeT,CAAA;AAEF,OAAO,EAAC,SAAS,EAAE,KAAK,EAAC,CAAA;AACzB,YAAY,EAAC,cAAc,EAAC,MAAM,aAAa,CAAA;AAC/C,YAAY,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,SAAS,CAAA;AAChB,OAAO,EAAC,kBAAkB,EAAC,MAAM,UAAU,CAAA;AAC3C,YAAY,EAAC,MAAM,EAAE,aAAa,EAAE,WAAW,EAAC,MAAM,UAAU,CAAA;AAChE,YAAY,EAAC,SAAS,EAAC,MAAM,OAAO,CAAA;AACpC,YAAY,EAAC,WAAW,EAAC,MAAM,SAAS,CAAA"}
|
package/dist/DataTable/index.js
CHANGED
package/dist/Dialog/Dialog.js
CHANGED
|
@@ -6,7 +6,7 @@ import { XIcon } from '@primer/octicons-react';
|
|
|
6
6
|
import { useFocusZone } from '../hooks/useFocusZone.js';
|
|
7
7
|
import { FocusKeys } from '@primer/behaviors';
|
|
8
8
|
import { Portal } from '../Portal/Portal.js';
|
|
9
|
-
import {
|
|
9
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
10
10
|
import { useId } from '../hooks/useId.js';
|
|
11
11
|
import classes from './Dialog.module.css.js';
|
|
12
12
|
import { clsx } from 'clsx';
|
|
@@ -131,7 +131,7 @@ const _Dialog = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
131
131
|
footer: Dialog.Footer
|
|
132
132
|
});
|
|
133
133
|
const dialogRef = useRef(null);
|
|
134
|
-
|
|
134
|
+
const mergedRef = useMergedRefs(forwardedRef, dialogRef);
|
|
135
135
|
const backdropRef = useRef(null);
|
|
136
136
|
useFocusTrap({
|
|
137
137
|
containerRef: dialogRef,
|
|
@@ -205,7 +205,7 @@ const _Dialog = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
205
205
|
setLastMouseDownIsBackdrop(e.target === e.currentTarget);
|
|
206
206
|
},
|
|
207
207
|
children: /*#__PURE__*/jsxs("div", {
|
|
208
|
-
ref:
|
|
208
|
+
ref: mergedRef,
|
|
209
209
|
role: role,
|
|
210
210
|
"aria-labelledby": dialogLabelId,
|
|
211
211
|
"aria-describedby": dialogDescriptionId,
|
package/dist/Heading/Heading.js
CHANGED
|
@@ -2,7 +2,7 @@ import { clsx } from 'clsx';
|
|
|
2
2
|
import React, { forwardRef, useEffect } from 'react';
|
|
3
3
|
import classes from './Heading.module.css.js';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
|
-
import {
|
|
5
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
6
6
|
|
|
7
7
|
const Heading = /*#__PURE__*/forwardRef(({
|
|
8
8
|
as: Component = 'h2',
|
|
@@ -11,7 +11,7 @@ const Heading = /*#__PURE__*/forwardRef(({
|
|
|
11
11
|
...props
|
|
12
12
|
}, forwardedRef) => {
|
|
13
13
|
const innerRef = React.useRef(null);
|
|
14
|
-
|
|
14
|
+
const mergedRef = useMergedRefs(forwardedRef, innerRef);
|
|
15
15
|
if (process.env.NODE_ENV !== "production") {
|
|
16
16
|
/**
|
|
17
17
|
* The Linter yells because it thinks this conditionally calls an effect,
|
|
@@ -31,7 +31,7 @@ const Heading = /*#__PURE__*/forwardRef(({
|
|
|
31
31
|
className: clsx(className, classes.Heading),
|
|
32
32
|
"data-variant": variant,
|
|
33
33
|
...props,
|
|
34
|
-
ref:
|
|
34
|
+
ref: mergedRef
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
37
|
Heading.displayName = 'Heading';
|
package/dist/Link/Link.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/Link/Link.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAY,KAAK,YAAY,EAAkB,MAAM,OAAO,CAAA;AAG1E,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAC,KAAK,gBAAgB,EAAkB,MAAM,6BAA6B,CAAA;AAElF,KAAK,eAAe,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,GAAG,GAAG,IAAI;IACzD,EAAE,CAAC,EAAE,EAAE,CAAA;IACP,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,EAAE,SAAS,KAAK,CAAC,WAAW,GAAG,GAAG,EAC9D,OAAO,gBAAgB,CAAC,EAAE,EAAE,GAAG,EAAE,eAAe,CAAC,EACjD,KAAK,YAAY,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/Link/Link.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAY,KAAK,YAAY,EAAkB,MAAM,OAAO,CAAA;AAG1E,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAC,KAAK,gBAAgB,EAAkB,MAAM,6BAA6B,CAAA;AAElF,KAAK,eAAe,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,GAAG,GAAG,IAAI;IACzD,EAAE,CAAC,EAAE,EAAE,CAAA;IACP,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,EAAE,SAAS,KAAK,CAAC,WAAW,GAAG,GAAG,EAC9D,OAAO,gBAAgB,CAAC,EAAE,EAAE,GAAG,EAAE,eAAe,CAAC,EACjD,KAAK,YAAY,CAAC,OAAO,CAAC,sBAwC3B,CAAA;AAID,QAAA,MAAM,IAAI,IA9CoB,EAAE,SAAS,KAAK,CAAC,WAAW;;;;CA8CM,CAAA;AAEhE,MAAM,MAAM,SAAS,GAAG,cAAc,CAAC,OAAO,IAAI,CAAC,CAAA;AACnD,eAAe,IAAI,CAAA"}
|
package/dist/Link/Link.js
CHANGED
|
@@ -3,7 +3,7 @@ import React, { useEffect } from 'react';
|
|
|
3
3
|
import classes from './Link.module.css.js';
|
|
4
4
|
import { fixedForwardRef } from '../utils/modern-polymorphic.js';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
|
-
import {
|
|
6
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
7
7
|
|
|
8
8
|
const UnwrappedLink = (props, ref) => {
|
|
9
9
|
const {
|
|
@@ -15,7 +15,7 @@ const UnwrappedLink = (props, ref) => {
|
|
|
15
15
|
...restProps
|
|
16
16
|
} = props;
|
|
17
17
|
const innerRef = React.useRef(null);
|
|
18
|
-
|
|
18
|
+
const mergedRef = useMergedRefs(ref, innerRef);
|
|
19
19
|
if (process.env.NODE_ENV !== "production") {
|
|
20
20
|
/**
|
|
21
21
|
* The Linter yells because it thinks this conditionally calls an effect,
|
|
@@ -37,8 +37,7 @@ const UnwrappedLink = (props, ref) => {
|
|
|
37
37
|
"data-inline": inline,
|
|
38
38
|
"data-hover-color": hoverColor,
|
|
39
39
|
...restProps,
|
|
40
|
-
|
|
41
|
-
ref: innerRef
|
|
40
|
+
ref: mergedRef
|
|
42
41
|
});
|
|
43
42
|
};
|
|
44
43
|
UnwrappedLink.displayName = "UnwrappedLink";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Over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
2
2
|
import React, { useRef, useEffect } from 'react';
|
|
3
3
|
import useIsomorphicLayoutEffect from '../utils/useIsomorphicLayoutEffect.js';
|
|
4
4
|
import { Portal } from '../Portal/Portal.js';
|
|
5
|
-
import {
|
|
5
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
6
6
|
import classes from './Overlay.module.css.js';
|
|
7
7
|
import { clsx } from 'clsx';
|
|
8
8
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -20,6 +20,14 @@ const heightMap = {
|
|
|
20
20
|
// Passing 'initial' initially applies 'auto'
|
|
21
21
|
'fit-content': 'fit-content'
|
|
22
22
|
};
|
|
23
|
+
const widthMap = {
|
|
24
|
+
small: '256px',
|
|
25
|
+
medium: '320px',
|
|
26
|
+
large: '480px',
|
|
27
|
+
xlarge: '640px',
|
|
28
|
+
xxlarge: '960px',
|
|
29
|
+
auto: 'auto'
|
|
30
|
+
};
|
|
23
31
|
const animationDuration = 200;
|
|
24
32
|
function getSlideAnimationStartingVector(anchorSide) {
|
|
25
33
|
if (anchorSide !== null && anchorSide !== void 0 && anchorSide.endsWith('bottom')) {
|
|
@@ -116,7 +124,7 @@ const BaseOverlay = /*#__PURE__*/React.forwardRef(({
|
|
|
116
124
|
|
|
117
125
|
*/
|
|
118
126
|
const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
119
|
-
const $ = c(
|
|
127
|
+
const $ = c(50);
|
|
120
128
|
let _PrivateDisablePortal;
|
|
121
129
|
let anchorSide;
|
|
122
130
|
let ignoreClickRefs;
|
|
@@ -202,7 +210,7 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
202
210
|
const width = t5 === undefined ? "auto" : t5;
|
|
203
211
|
const featureFlagMaxHeightClampToViewport = useFeatureFlag("primer_react_overlay_max_height_clamp_to_viewport");
|
|
204
212
|
const overlayRef = useRef(null);
|
|
205
|
-
|
|
213
|
+
const mergedRef = useMergedRefs(forwardedRef, overlayRef);
|
|
206
214
|
const cssAnchorPositioning = useFeatureFlag("primer_react_css_anchor_positioning");
|
|
207
215
|
let t6;
|
|
208
216
|
if ($[19] !== ignoreClickRefs || $[20] !== initialFocusRef || $[21] !== onClickOutside || $[22] !== onEscape || $[23] !== preventFocusOnOpen || $[24] !== returnFocusRef) {
|
|
@@ -286,12 +294,12 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
286
294
|
t12 = $[34];
|
|
287
295
|
}
|
|
288
296
|
let t13;
|
|
289
|
-
if ($[35] !== height || $[36] !== leftPosition || $[37] !==
|
|
297
|
+
if ($[35] !== height || $[36] !== leftPosition || $[37] !== mergedRef || $[38] !== props || $[39] !== responsiveVariant || $[40] !== right || $[41] !== role || $[42] !== t11 || $[43] !== t12 || $[44] !== visibility || $[45] !== width) {
|
|
290
298
|
t13 = /*#__PURE__*/jsx(BaseOverlay, {
|
|
291
299
|
role: role,
|
|
292
300
|
width: width,
|
|
293
301
|
"data-reflow-container": t11,
|
|
294
|
-
ref:
|
|
302
|
+
ref: mergedRef,
|
|
295
303
|
left: leftPosition,
|
|
296
304
|
right: right,
|
|
297
305
|
height: height,
|
|
@@ -302,35 +310,36 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
302
310
|
});
|
|
303
311
|
$[35] = height;
|
|
304
312
|
$[36] = leftPosition;
|
|
305
|
-
$[37] =
|
|
306
|
-
$[38] =
|
|
307
|
-
$[39] =
|
|
308
|
-
$[40] =
|
|
309
|
-
$[41] =
|
|
310
|
-
$[42] =
|
|
311
|
-
$[43] =
|
|
312
|
-
$[44] =
|
|
313
|
-
$[45] =
|
|
313
|
+
$[37] = mergedRef;
|
|
314
|
+
$[38] = props;
|
|
315
|
+
$[39] = responsiveVariant;
|
|
316
|
+
$[40] = right;
|
|
317
|
+
$[41] = role;
|
|
318
|
+
$[42] = t11;
|
|
319
|
+
$[43] = t12;
|
|
320
|
+
$[44] = visibility;
|
|
321
|
+
$[45] = width;
|
|
322
|
+
$[46] = t13;
|
|
314
323
|
} else {
|
|
315
|
-
t13 = $[
|
|
324
|
+
t13 = $[46];
|
|
316
325
|
}
|
|
317
326
|
const overlayContent = t13;
|
|
318
327
|
if (_PrivateDisablePortal && cssAnchorPositioning) {
|
|
319
328
|
return overlayContent;
|
|
320
329
|
}
|
|
321
330
|
let t14;
|
|
322
|
-
if ($[
|
|
331
|
+
if ($[47] !== overlayContent || $[48] !== portalContainerName) {
|
|
323
332
|
t14 = /*#__PURE__*/jsx(Portal, {
|
|
324
333
|
containerName: portalContainerName,
|
|
325
334
|
children: overlayContent
|
|
326
335
|
});
|
|
327
|
-
$[
|
|
328
|
-
$[
|
|
329
|
-
$[
|
|
336
|
+
$[47] = overlayContent;
|
|
337
|
+
$[48] = portalContainerName;
|
|
338
|
+
$[49] = t14;
|
|
330
339
|
} else {
|
|
331
|
-
t14 = $[
|
|
340
|
+
t14 = $[49];
|
|
332
341
|
}
|
|
333
342
|
return t14;
|
|
334
343
|
});
|
|
335
344
|
|
|
336
|
-
export { BaseOverlay, Overlay as default, heightMap };
|
|
345
|
+
export { BaseOverlay, Overlay as default, heightMap, widthMap };
|