@primer/react 0.0.0-20260303181613 → 0.0.0-20260303182827
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 +7 -3
- package/dist/ActionBar/ActionBar.d.ts.map +1 -1
- package/dist/ActionBar/ActionBar.js +281 -431
- package/dist/ActionList/{ActionList-d0ad7f0b.css → ActionList-8b212f46.css} +2 -2
- package/dist/ActionList/{ActionList-d0ad7f0b.css.map → ActionList-8b212f46.css.map} +1 -1
- package/dist/ActionList/ActionList.module.css.js +1 -1
- package/dist/ActionList/Description.d.ts.map +1 -1
- package/dist/ActionList/Description.js +67 -40
- package/dist/ActionList/Item.d.ts.map +1 -1
- package/dist/ActionList/Item.js +95 -51
- package/dist/ActionList/shared.d.ts +1 -0
- package/dist/ActionList/shared.d.ts.map +1 -1
- package/dist/ActionMenu/ActionMenu.d.ts.map +1 -1
- package/dist/ActionMenu/ActionMenu.js +1 -9
- package/dist/AnchoredOverlay/AnchoredOverlay-73c1b2d1.css +2 -0
- package/dist/AnchoredOverlay/AnchoredOverlay-73c1b2d1.css.map +1 -0
- package/dist/AnchoredOverlay/AnchoredOverlay.d.ts.map +1 -1
- package/dist/AnchoredOverlay/AnchoredOverlay.js +9 -34
- package/dist/AnchoredOverlay/AnchoredOverlay.module.css.js +2 -2
- package/dist/FeatureFlags/DefaultFeatureFlags.d.ts.map +1 -1
- package/dist/FeatureFlags/DefaultFeatureFlags.js +0 -1
- package/dist/Overlay/Overlay-15519c09.css +2 -0
- package/dist/Overlay/Overlay-15519c09.css.map +1 -0
- package/dist/Overlay/Overlay.d.ts.map +1 -1
- package/dist/Overlay/Overlay.js +17 -26
- package/dist/Overlay/Overlay.module.css.js +1 -1
- package/dist/utils/descendant-registry.d.ts +32 -0
- package/dist/utils/descendant-registry.d.ts.map +1 -0
- package/dist/utils/descendant-registry.js +222 -0
- package/package.json +1 -2
- package/dist/AnchoredOverlay/AnchoredOverlay-b61b19da.css +0 -2
- package/dist/AnchoredOverlay/AnchoredOverlay-b61b19da.css.map +0 -1
- package/dist/Overlay/Overlay-51d24fee.css +0 -2
- package/dist/Overlay/Overlay-51d24fee.css.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/ActionList/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,6BAA6B,CAAA;AAIjE,KAAK,yBAAyB,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,GAAG,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,GAAG,KAAK,CAAA;AAE/E,MAAM,MAAM,mBAAmB,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,GAAG,IAAI,IAAI,yBAAyB,CAC9F,gBAAgB,CAAC,EAAE,EAAE,IAAI,CAAC,CAC3B,GAAG;IACF;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,KAAK,IAAI,CAAA;IAC5F;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;IAC9B,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAA;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IACX;;;O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AA;CACpC,GAAG,IAAI,CAAC,oBAAoB,EAAE,WAAW,CAAC,CAAA;AAsI3C,MAAM,MAAM,qBAAqB,GAAG;IAAC,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAA;AA0DxH,6CAA6C;AAC7C,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAAA;AAe/C,KAAK,gBAAgB,GAAG,OAAO,CAAC,YAAY,CAAC,GAC3C,IAAI,CAAC,oBAAoB,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,mBAAmB,CAAC,GAAG;IAC/E;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,gBAAgB,CAAC,EAAE,CAAC,EAAC,QAAQ,EAAC,EAAE;QAAC,QAAQ,EAAE,cAAc,CAAA;KAAC,KAAK,IAAI,CAAA;CACpE,CAAA;AAgHH,eAAO,MAAM,UAAU;;;kBA5LP,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC;aAC5B,MAAM;;;;CA2L4E,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { useContext, useState, useEffect, useCallback, useMemo } from 'react';
|
|
2
|
-
import { clsx } from 'clsx';
|
|
3
2
|
import { ChevronRightIcon, TriangleDownIcon } from '@primer/octicons-react';
|
|
4
3
|
import { Divider } from '../ActionList/Divider.js';
|
|
5
4
|
import { ActionListContainerContext } from '../ActionList/ActionListContainerContext.js';
|
|
@@ -44,9 +43,6 @@ const mergeAnchorHandlers = (anchorProps, buttonProps) => {
|
|
|
44
43
|
};
|
|
45
44
|
mergedAnchorProps.onKeyDown = mergedOnAnchorKeyDown;
|
|
46
45
|
}
|
|
47
|
-
if (buttonProps.className) {
|
|
48
|
-
mergedAnchorProps.className = clsx(anchorProps.className, buttonProps.className);
|
|
49
|
-
}
|
|
50
46
|
return mergedAnchorProps;
|
|
51
47
|
};
|
|
52
48
|
const Menu = ({
|
|
@@ -124,10 +120,7 @@ const Menu = ({
|
|
|
124
120
|
};
|
|
125
121
|
}
|
|
126
122
|
} else {
|
|
127
|
-
renderAnchor = anchorProps => /*#__PURE__*/React.cloneElement(child,
|
|
128
|
-
...anchorProps,
|
|
129
|
-
className: clsx(anchorProps.className, child.props.className)
|
|
130
|
-
});
|
|
123
|
+
renderAnchor = anchorProps => /*#__PURE__*/React.cloneElement(child, anchorProps);
|
|
131
124
|
}
|
|
132
125
|
return null;
|
|
133
126
|
} else if (child.type === MenuButton || isSlot(child, MenuButton)) {
|
|
@@ -188,7 +181,6 @@ const Anchor = /*#__PURE__*/React.forwardRef(({
|
|
|
188
181
|
children: /*#__PURE__*/React.cloneElement(child, {
|
|
189
182
|
...anchorProps,
|
|
190
183
|
ref: anchorRef,
|
|
191
|
-
className: clsx(anchorProps.className, child.props.className),
|
|
192
184
|
onClick: onButtonClick,
|
|
193
185
|
onKeyDown: onButtonKeyDown
|
|
194
186
|
})
|
|
@@ -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}}
|
|
2
|
+
/*# sourceMappingURL=AnchoredOverlay-73c1b2d1.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","file":"AnchoredOverlay-73c1b2d1.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"]}
|
|
@@ -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,EAAyB,KAAK,GAAG,EAAC,MAAM,OAAO,CAAA;AACtD,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,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAyB,KAAK,GAAG,EAAC,MAAM,OAAO,CAAA;AACtD,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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BAAiB,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAA;IAElD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,YAAY,CAAC,CAAA;IAChE;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,EAAC,QAAQ,EAAC,EAAE;QAAC,QAAQ,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;AAS9G;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CA6JnF,CAAA"}
|
|
@@ -4,21 +4,14 @@ import { useFocusZone } from '../hooks/useFocusZone.js';
|
|
|
4
4
|
import { useId } from '../hooks/useId.js';
|
|
5
5
|
import { IconButton } from '../Button/IconButton.js';
|
|
6
6
|
import { XIcon } from '@primer/octicons-react';
|
|
7
|
-
import polyfill from '@oddbird/css-anchor-positioning/fn';
|
|
8
7
|
import classes from './AnchoredOverlay.module.css.js';
|
|
9
8
|
import { clsx } from 'clsx';
|
|
10
9
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
11
|
-
import { useFeatureFlag } from '../FeatureFlags/useFeatureFlag.js';
|
|
12
10
|
import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
|
|
13
11
|
import { useRenderForcingRef } from '../hooks/useRenderForcingRef.js';
|
|
14
12
|
import { useAnchoredPosition } from '../hooks/useAnchoredPosition.js';
|
|
15
13
|
import Overlay from '../Overlay/Overlay.js';
|
|
16
14
|
|
|
17
|
-
const applyAnchorPositioningPolyfill = () => {
|
|
18
|
-
if (typeof window !== 'undefined' && !('anchorName' in document.documentElement.style)) {
|
|
19
|
-
polyfill();
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
15
|
const defaultVariant = {
|
|
23
16
|
regular: 'anchored',
|
|
24
17
|
narrow: 'anchored'
|
|
@@ -55,7 +48,6 @@ const AnchoredOverlay = ({
|
|
|
55
48
|
displayCloseButton = true,
|
|
56
49
|
closeButtonProps = defaultCloseButtonProps
|
|
57
50
|
}) => {
|
|
58
|
-
const cssAnchorPositioning = useFeatureFlag('primer_react_css_anchor_positioning');
|
|
59
51
|
const anchorRef = useProvidedRefOrCreate(externalAnchorRef);
|
|
60
52
|
const [overlayRef, updateOverlayRef] = useRenderForcingRef();
|
|
61
53
|
const anchorId = useId(externalAnchorId);
|
|
@@ -104,10 +96,7 @@ const AnchoredOverlay = ({
|
|
|
104
96
|
if (!open && overlayRef.current) {
|
|
105
97
|
updateOverlayRef(null);
|
|
106
98
|
}
|
|
107
|
-
|
|
108
|
-
applyAnchorPositioningPolyfill();
|
|
109
|
-
}
|
|
110
|
-
}, [open, overlayRef, updateOverlayRef, cssAnchorPositioning]);
|
|
99
|
+
}, [open, overlayRef, updateOverlayRef]);
|
|
111
100
|
useFocusZone({
|
|
112
101
|
containerRef: overlayRef,
|
|
113
102
|
disabled: !open || !position_0,
|
|
@@ -121,11 +110,7 @@ const AnchoredOverlay = ({
|
|
|
121
110
|
const showXIcon = onClose && variant.narrow === 'fullscreen' && displayCloseButton;
|
|
122
111
|
const XButtonAriaLabelledBy = closeButtonProps['aria-labelledby'];
|
|
123
112
|
const XButtonAriaLabel = closeButtonProps['aria-label'];
|
|
124
|
-
|
|
125
|
-
className: overlayClassName,
|
|
126
|
-
...restOverlayProps
|
|
127
|
-
} = overlayProps || {};
|
|
128
|
-
const innerContent = /*#__PURE__*/jsxs(Fragment, {
|
|
113
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
129
114
|
children: [renderAnchor && renderAnchor({
|
|
130
115
|
ref: anchorRef,
|
|
131
116
|
id: anchorId,
|
|
@@ -133,33 +118,30 @@ const AnchoredOverlay = ({
|
|
|
133
118
|
'aria-expanded': open,
|
|
134
119
|
tabIndex: 0,
|
|
135
120
|
onClick: onAnchorClick,
|
|
136
|
-
onKeyDown: onAnchorKeyDown
|
|
137
|
-
className: classes.Anchor
|
|
121
|
+
onKeyDown: onAnchorKeyDown
|
|
138
122
|
}), open ? /*#__PURE__*/jsxs(Overlay, {
|
|
139
123
|
returnFocusRef: anchorRef,
|
|
140
124
|
onClickOutside: onClickOutside,
|
|
141
125
|
ignoreClickRefs: [anchorRef],
|
|
142
126
|
onEscape: onEscape,
|
|
143
127
|
role: "none",
|
|
144
|
-
visibility:
|
|
128
|
+
visibility: position_0 ? 'visible' : 'hidden',
|
|
145
129
|
height: height,
|
|
146
130
|
width: width,
|
|
147
|
-
top:
|
|
148
|
-
left:
|
|
131
|
+
top: (position_0 === null || position_0 === void 0 ? void 0 : position_0.top) || 0,
|
|
132
|
+
left: (position_0 === null || position_0 === void 0 ? void 0 : position_0.left) || 0,
|
|
149
133
|
responsiveVariant: variant.narrow === 'fullscreen' ? 'fullscreen' : undefined,
|
|
150
|
-
anchorSide:
|
|
151
|
-
className:
|
|
134
|
+
anchorSide: position_0 === null || position_0 === void 0 ? void 0 : position_0.anchorSide,
|
|
135
|
+
className: className,
|
|
152
136
|
preventOverflow: preventOverflow,
|
|
153
137
|
"data-component": "AnchoredOverlay",
|
|
154
|
-
...
|
|
138
|
+
...overlayProps,
|
|
155
139
|
ref: node => {
|
|
156
140
|
if (overlayProps !== null && overlayProps !== void 0 && overlayProps.ref) {
|
|
157
141
|
assignRef(overlayProps.ref, node);
|
|
158
142
|
}
|
|
159
143
|
updateOverlayRef(node);
|
|
160
144
|
},
|
|
161
|
-
"data-anchor-position": cssAnchorPositioning,
|
|
162
|
-
"data-side": position_0 === null || position_0 === void 0 ? void 0 : position_0.anchorSide,
|
|
163
145
|
children: [showXIcon ? /*#__PURE__*/jsx("div", {
|
|
164
146
|
className: classes.ResponsiveCloseButtonContainer,
|
|
165
147
|
children: /*#__PURE__*/jsx(IconButton, {
|
|
@@ -182,13 +164,6 @@ const AnchoredOverlay = ({
|
|
|
182
164
|
}) : null, children]
|
|
183
165
|
}) : null]
|
|
184
166
|
});
|
|
185
|
-
if (cssAnchorPositioning) {
|
|
186
|
-
return /*#__PURE__*/jsx("div", {
|
|
187
|
-
className: classes.Wrapper,
|
|
188
|
-
children: innerContent
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
return innerContent;
|
|
192
167
|
};
|
|
193
168
|
function assignRef(ref, value) {
|
|
194
169
|
if (typeof ref === 'function') {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import './AnchoredOverlay-
|
|
1
|
+
import './AnchoredOverlay-73c1b2d1.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"};
|
|
4
4
|
|
|
5
5
|
export { classes as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultFeatureFlags.d.ts","sourceRoot":"","sources":["../../src/FeatureFlags/DefaultFeatureFlags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAA;AAEnD,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"DefaultFeatureFlags.d.ts","sourceRoot":"","sources":["../../src/FeatureFlags/DefaultFeatureFlags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAA;AAEnD,eAAO,MAAM,mBAAmB,kBAQ9B,CAAA"}
|
|
@@ -2,7 +2,6 @@ import { FeatureFlagScope } from './FeatureFlagScope.js';
|
|
|
2
2
|
|
|
3
3
|
const DefaultFeatureFlags = FeatureFlagScope.create({
|
|
4
4
|
primer_react_breadcrumbs_overflow_menu: false,
|
|
5
|
-
primer_react_css_anchor_positioning: false,
|
|
6
5
|
primer_react_css_has_selector_perf: false,
|
|
7
6
|
primer_react_select_panel_fullscreen_on_narrow: false,
|
|
8
7
|
primer_react_select_panel_order_selected_at_top: false,
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
@keyframes prc-Overlay-overlay-appear-JpFey{0%{opacity:0}to{opacity:1}}.prc-Overlay-Overlay-jfs-T{background-color:var(--overlay-bgColor,var(--color-canvas-overlay));border-radius:var(--borderRadius-large,.75rem);bottom:var(--bottom,auto);box-shadow:var(--shadow-floating-small,var(--color-overlay-shadow));height:auto;left:var(--left,auto);max-height:100vh;max-width:calc(100vw - 2rem);min-width:192px;overflow:auto;position:absolute;right:var(--right,auto);top:var(--top,auto);width:auto}.prc-Overlay-Overlay-jfs-T:focus{outline:none}@media (forced-colors:active){.prc-Overlay-Overlay-jfs-T{outline:1px solid transparent}}.prc-Overlay-Overlay-jfs-T:where([data-reflow-container=true]){max-width:calc(100vw - 2rem)}.prc-Overlay-Overlay-jfs-T:where([data-overflow-auto]){overflow:auto}.prc-Overlay-Overlay-jfs-T:where([data-overflow-hidden]){overflow:hidden}.prc-Overlay-Overlay-jfs-T:where([data-overflow-scroll]){overflow:scroll}.prc-Overlay-Overlay-jfs-T:where([data-overflow-visible]){overflow:visible}.prc-Overlay-Overlay-jfs-T:where([data-height-xsmall]){height:192px}.prc-Overlay-Overlay-jfs-T:where([data-height-small]){height:256px}.prc-Overlay-Overlay-jfs-T:where([data-height-medium]){height:320px}.prc-Overlay-Overlay-jfs-T:where([data-height-large]){height:432px}.prc-Overlay-Overlay-jfs-T:where([data-height-xlarge]){height:600px}.prc-Overlay-Overlay-jfs-T:where([data-height-auto]),.prc-Overlay-Overlay-jfs-T:where([data-height-initial]){height:auto}.prc-Overlay-Overlay-jfs-T:where([data-height-fit-content]){height:-moz-fit-content;height:fit-content}.prc-Overlay-Overlay-jfs-T:where([data-max-height-xsmall]){max-height:192px}.prc-Overlay-Overlay-jfs-T:where([data-max-height-small]){max-height:256px}.prc-Overlay-Overlay-jfs-T:where([data-max-height-medium]){max-height:320px}.prc-Overlay-Overlay-jfs-T:where([data-max-height-large]){max-height:432px}.prc-Overlay-Overlay-jfs-T:where([data-max-height-xlarge]){max-height:600px}.prc-Overlay-Overlay-jfs-T:where([data-max-height-fit-content]){max-height:-moz-fit-content;max-height:fit-content}.prc-Overlay-Overlay-jfs-T:where([data-width-small]){width:256px}.prc-Overlay-Overlay-jfs-T:where([data-width-medium]){width:320px}.prc-Overlay-Overlay-jfs-T:where([data-width-large]){width:480px}.prc-Overlay-Overlay-jfs-T:where([data-width-xlarge]){width:640px}.prc-Overlay-Overlay-jfs-T:where([data-width-xxlarge]){width:960px}.prc-Overlay-Overlay-jfs-T:where([data-width-auto]){width:auto}.prc-Overlay-Overlay-jfs-T:where([data-max-width-small]){max-width:256px}.prc-Overlay-Overlay-jfs-T:where([data-max-width-medium]){max-width:320px}.prc-Overlay-Overlay-jfs-T:where([data-max-width-large]){max-width:480px}.prc-Overlay-Overlay-jfs-T:where([data-max-width-xlarge]){max-width:640px}.prc-Overlay-Overlay-jfs-T:where([data-max-width-xxlarge]){max-width:960px}.prc-Overlay-Overlay-jfs-T:where([data-visibility-visible]){visibility:visible}.prc-Overlay-Overlay-jfs-T:where([data-visibility-hidden]){visibility:hidden}@media screen and (max-width:calc(48rem - 0.02px)){.prc-Overlay-Overlay-jfs-T:where([data-responsive=fullscreen]){border-radius:unset;height:100vh;left:0;margin:0;max-height:none;max-width:none;position:fixed;top:0;width:100vw}}@supports (height:100dvh){.prc-Overlay-Overlay-jfs-T:where([data-variant=fullscreen]){height:100dvh}}@media (prefers-reduced-motion:no-preference){.prc-Overlay-Overlay-jfs-T{animation:prc-Overlay-overlay-appear-JpFey .2s cubic-bezier(.33,1,.68,1)}}
|
|
2
|
+
/*# sourceMappingURL=Overlay-15519c09.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Overlay/Overlay.module.css.js"],"names":[],"mappings":"AAAA,4CACE,GACE,SACF,CAEA,GACE,SACF,CACF,CAEA,2BAQE,mEAAwC,CACxC,8CAAwC,CASxC,yBAA2B,CAR3B,mEAAwC,CALxC,WAAY,CASZ,qBAAuB,CARvB,gBAAiB,CAJjB,4BAA6B,CAE7B,eAAgB,CAGhB,aAAc,CANd,iBAAkB,CAelB,uBAAyB,CAJzB,mBAAqB,CATrB,UA8KF,CA7JE,iCACE,YACF,CAEA,8BAxBF,2BA0BI,6BAuJJ,CAtJE,CAEA,+DACE,4BACF,CAEA,uDACE,aACF,CAEA,yDACE,eACF,CAEA,yDACE,eACF,CAEA,0DACE,gBACF,CAEA,uDACE,YACF,CAEA,sDACE,YACF,CAEA,uDACE,YACF,CAEA,sDACE,YACF,CAEA,uDACE,YACF,CAEA,6GAEE,WACF,CAEA,4DACE,uBAAmB,CAAnB,kBACF,CAEA,2DACE,gBACF,CAEA,0DACE,gBACF,CAEA,2DACE,gBACF,CAEA,0DACE,gBACF,CAEA,2DACE,gBACF,CAEA,gEACE,2BAAuB,CAAvB,sBACF,CAEA,qDACE,WACF,CAEA,sDACE,WACF,CAEA,qDAEE,WACF,CAEA,sDAEE,WACF,CAEA,uDAEE,WACF,CAEA,oDACE,UACF,CAEA,yDACE,eACF,CAEA,0DACE,eACF,CAEA,yDACE,eACF,CAEA,0DACE,eACF,CAEA,2DACE,eACF,CAEA,4DACE,kBACF,CAEA,2DACE,iBACF,CAGE,mDADF,+DAUI,mBAAoB,CAHpB,YAAa,CAHb,MAAO,CAKP,QAAS,CADT,eAAgB,CAFhB,cAAe,CAJf,cAAe,CACf,KAAM,CAEN,WAOJ,CADE,CAGF,0BAEE,4DACE,aACF,CACF,CAGF,8CACE,2BACE,wEACF,CACF","file":"Overlay-15519c09.css","sourcesContent":["@keyframes overlay-appear {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.Overlay {\n position: absolute;\n max-width: calc(100vw - 2rem);\n width: auto;\n min-width: 192px;\n height: auto;\n max-height: 100vh;\n overflow: auto;\n background-color: var(--overlay-bgColor);\n border-radius: var(--borderRadius-large);\n box-shadow: var(--shadow-floating-small);\n /* stylelint-disable-next-line primer/spacing */\n top: var(--top, auto);\n /* stylelint-disable-next-line primer/spacing */\n left: var(--left, auto);\n /* stylelint-disable-next-line primer/spacing */\n right: var(--right, auto);\n /* stylelint-disable-next-line primer/spacing */\n bottom: var(--bottom, auto);\n\n &:focus {\n outline: none;\n }\n\n @media (forced-colors: active) {\n /* Support for Windows high contrast https://sarahmhigley.com/writing/whcm-quick-tips */\n outline: solid 1px transparent;\n }\n\n &:where([data-reflow-container='true']) {\n max-width: calc(100vw - 2rem);\n }\n\n &:where([data-overflow-auto]) {\n overflow: auto;\n }\n\n &:where([data-overflow-hidden]) {\n overflow: hidden;\n }\n\n &:where([data-overflow-scroll]) {\n overflow: scroll;\n }\n\n &:where([data-overflow-visible]) {\n overflow: visible;\n }\n\n &:where([data-height-xsmall]) {\n height: 192px;\n }\n\n &:where([data-height-small]) {\n height: 256px;\n }\n\n &:where([data-height-medium]) {\n height: 320px;\n }\n\n &:where([data-height-large]) {\n height: 432px;\n }\n\n &:where([data-height-xlarge]) {\n height: 600px;\n }\n\n &:where([data-height-auto]),\n &:where([data-height-initial]) {\n height: auto;\n }\n\n &:where([data-height-fit-content]) {\n height: fit-content;\n }\n\n &:where([data-max-height-xsmall]) {\n max-height: 192px;\n }\n\n &:where([data-max-height-small]) {\n max-height: 256px;\n }\n\n &:where([data-max-height-medium]) {\n max-height: 320px;\n }\n\n &:where([data-max-height-large]) {\n max-height: 432px;\n }\n\n &:where([data-max-height-xlarge]) {\n max-height: 600px;\n }\n\n &:where([data-max-height-fit-content]) {\n max-height: fit-content;\n }\n\n &:where([data-width-small]) {\n width: 256px;\n }\n\n &:where([data-width-medium]) {\n width: 320px;\n }\n\n &:where([data-width-large]) {\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 480px;\n }\n\n &:where([data-width-xlarge]) {\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 640px;\n }\n\n &:where([data-width-xxlarge]) {\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 960px;\n }\n\n &:where([data-width-auto]) {\n width: auto;\n }\n\n &:where([data-max-width-small]) {\n max-width: 256px;\n }\n\n &:where([data-max-width-medium]) {\n max-width: 320px;\n }\n\n &:where([data-max-width-large]) {\n max-width: 480px;\n }\n\n &:where([data-max-width-xlarge]) {\n max-width: 640px;\n }\n\n &:where([data-max-width-xxlarge]) {\n max-width: 960px;\n }\n\n &:where([data-visibility-visible]) {\n visibility: visible;\n }\n\n &:where([data-visibility-hidden]) {\n visibility: hidden;\n }\n\n &:where([data-responsive='fullscreen']) {\n @media screen and (--viewportRange-narrow) {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n max-width: none;\n height: 100vh;\n max-height: none;\n margin: 0;\n border-radius: unset;\n }\n }\n\n @supports (height: 100dvh) {\n /* fix for mobile safari (100vh clips the screen with the toolbar) */\n &:where([data-variant='fullscreen']) {\n height: 100dvh;\n }\n }\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .Overlay {\n animation: overlay-appear 200ms cubic-bezier(0.33, 1, 0.68, 1);\n }\n}\n"]}
|
|
@@ -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;
|
|
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;AAI/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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AAA;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;;;;;;;;;;;;;;;GAeG;AACH,QAAA,MAAM,OAAO,EAiFR,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
|
@@ -6,7 +6,6 @@ import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.
|
|
|
6
6
|
import classes from './Overlay.module.css.js';
|
|
7
7
|
import { clsx } from 'clsx';
|
|
8
8
|
import { jsx } from 'react/jsx-runtime';
|
|
9
|
-
import { useFeatureFlag } from '../FeatureFlags/useFeatureFlag.js';
|
|
10
9
|
import { useOverlay } from '../hooks/useOverlay.js';
|
|
11
10
|
|
|
12
11
|
const heightMap = {
|
|
@@ -116,7 +115,7 @@ const BaseOverlay = /*#__PURE__*/React.forwardRef(({
|
|
|
116
115
|
|
|
117
116
|
*/
|
|
118
117
|
const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
119
|
-
const $ = c(
|
|
118
|
+
const $ = c(45);
|
|
120
119
|
let anchorSide;
|
|
121
120
|
let ignoreClickRefs;
|
|
122
121
|
let initialFocusRef;
|
|
@@ -196,7 +195,6 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
196
195
|
const role = t3 === undefined ? "none" : t3;
|
|
197
196
|
const visibility = t4 === undefined ? "visible" : t4;
|
|
198
197
|
const width = t5 === undefined ? "auto" : t5;
|
|
199
|
-
const cssAnchorPositioning = useFeatureFlag("primer_react_css_anchor_positioning");
|
|
200
198
|
const overlayRef = useRef(null);
|
|
201
199
|
useRefObjectAsForwardedRef(forwardedRef, overlayRef);
|
|
202
200
|
let t6;
|
|
@@ -270,10 +268,9 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
270
268
|
useIsomorphicLayoutEffect(t9, t10);
|
|
271
269
|
const leftPosition = left === undefined && right === undefined ? 0 : left;
|
|
272
270
|
const t11 = !preventOverflow ? true : undefined;
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
t13 = /*#__PURE__*/jsx(BaseOverlay, {
|
|
271
|
+
let t12;
|
|
272
|
+
if ($[32] !== height || $[33] !== leftPosition || $[34] !== props || $[35] !== responsiveVariant || $[36] !== right || $[37] !== role || $[38] !== t11 || $[39] !== visibility || $[40] !== width) {
|
|
273
|
+
t12 = /*#__PURE__*/jsx(BaseOverlay, {
|
|
277
274
|
role: role,
|
|
278
275
|
width: width,
|
|
279
276
|
"data-reflow-container": t11,
|
|
@@ -283,7 +280,6 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
283
280
|
height: height,
|
|
284
281
|
visibility: visibility,
|
|
285
282
|
"data-responsive": responsiveVariant,
|
|
286
|
-
"data-anchor-position": t12,
|
|
287
283
|
...props
|
|
288
284
|
});
|
|
289
285
|
$[32] = height;
|
|
@@ -293,30 +289,25 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
293
289
|
$[36] = right;
|
|
294
290
|
$[37] = role;
|
|
295
291
|
$[38] = t11;
|
|
296
|
-
$[39] =
|
|
297
|
-
$[40] =
|
|
298
|
-
$[41] =
|
|
299
|
-
$[42] = t13;
|
|
292
|
+
$[39] = visibility;
|
|
293
|
+
$[40] = width;
|
|
294
|
+
$[41] = t12;
|
|
300
295
|
} else {
|
|
301
|
-
|
|
302
|
-
}
|
|
303
|
-
const overlayContent = t13;
|
|
304
|
-
if (cssAnchorPositioning) {
|
|
305
|
-
return overlayContent;
|
|
296
|
+
t12 = $[41];
|
|
306
297
|
}
|
|
307
|
-
let
|
|
308
|
-
if ($[
|
|
309
|
-
|
|
298
|
+
let t13;
|
|
299
|
+
if ($[42] !== portalContainerName || $[43] !== t12) {
|
|
300
|
+
t13 = /*#__PURE__*/jsx(Portal, {
|
|
310
301
|
containerName: portalContainerName,
|
|
311
|
-
children:
|
|
302
|
+
children: t12
|
|
312
303
|
});
|
|
313
|
-
$[
|
|
314
|
-
$[
|
|
315
|
-
$[
|
|
304
|
+
$[42] = portalContainerName;
|
|
305
|
+
$[43] = t12;
|
|
306
|
+
$[44] = t13;
|
|
316
307
|
} else {
|
|
317
|
-
|
|
308
|
+
t13 = $[44];
|
|
318
309
|
}
|
|
319
|
-
return
|
|
310
|
+
return t13;
|
|
320
311
|
});
|
|
321
312
|
|
|
322
313
|
export { BaseOverlay, Overlay as default, heightMap };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type Dispatch, type ReactNode } from 'react';
|
|
2
|
+
export interface ProviderProps<T> {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
/** State setter from `useRegistryState`. */
|
|
5
|
+
setRegistry: Dispatch<React.SetStateAction<ReadonlyMap<string, T> | undefined>>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Create a "descendant registry" for a component. This allows a parent to store and track an ordered registry of
|
|
9
|
+
* child components, even if they are deeply nested in the tree. For example, a menu component can use this to track
|
|
10
|
+
* every menu item inside of it, including menu items inside of fragments and subcomponents. The order of the resulting
|
|
11
|
+
* `Map` will match the render order in the React tree.
|
|
12
|
+
*
|
|
13
|
+
* Usage:
|
|
14
|
+
* 1. Create a registry at the file level in a similar manner to creating a new React context. Set `T` to the data type
|
|
15
|
+
* of the registry - this can be anything **except** a function.
|
|
16
|
+
* 2. In the parent component, instantiate the registry state via `useRegistryState`. Then wrap `children` in the
|
|
17
|
+
* registry context `Provider` with `setRegistry` set to the state setter function.
|
|
18
|
+
* 3. Register child components via `useRegisterDescendant` or `useRegisterDescendantCallback`.
|
|
19
|
+
* 4. Access the registered data using the value from `useRegistryState`. This will be a map of `string` to `T`, where
|
|
20
|
+
* the string key is a unique and stable identifier for each component which can be used as a `key` if necessary.
|
|
21
|
+
*
|
|
22
|
+
* @note Note that this pattern is not SSR compatible. It won't raise errors or hydration mismatches, but the
|
|
23
|
+
* registry will not be available during SSR. The registry is built during the effect phase, so it will be populated
|
|
24
|
+
* after hydration on the client. The initial `undefined` value can be used to safely show loading UI during SSR/initial
|
|
25
|
+
* render if necessary.
|
|
26
|
+
*/
|
|
27
|
+
export declare function createDescendantRegistry<T>(): {
|
|
28
|
+
Provider: ({ children, setRegistry }: ProviderProps<T>) => import("react").JSX.Element;
|
|
29
|
+
useRegistryState: () => [ReadonlyMap<string, T> | undefined, Dispatch<import("react").SetStateAction<ReadonlyMap<string, T> | undefined>>];
|
|
30
|
+
useRegisterDescendant: (value: T) => string;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=descendant-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descendant-registry.d.ts","sourceRoot":"","sources":["../../src/utils/descendant-registry.tsx"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,QAAQ,EACb,KAAK,SAAS,EACf,MAAM,OAAO,CAAA;AAGd,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B,QAAQ,EAAE,SAAS,CAAA;IACnB,4CAA4C;IAC5C,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAA;CAChF;AAQD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,wBAAwB,CAAC,CAAC;0CAgCG,aAAa,CAAC,CAAC,CAAC;;mCAfrB,CAAC;EA8FxC"}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { c } from 'react-compiler-runtime';
|
|
2
|
+
import { useContext, useId, useEffect, useState, useRef, useReducer, createContext } from 'react';
|
|
3
|
+
import useIsomorphicLayoutEffect from './useIsomorphicLayoutEffect.js';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Create a "descendant registry" for a component. This allows a parent to store and track an ordered registry of
|
|
8
|
+
* child components, even if they are deeply nested in the tree. For example, a menu component can use this to track
|
|
9
|
+
* every menu item inside of it, including menu items inside of fragments and subcomponents. The order of the resulting
|
|
10
|
+
* `Map` will match the render order in the React tree.
|
|
11
|
+
*
|
|
12
|
+
* Usage:
|
|
13
|
+
* 1. Create a registry at the file level in a similar manner to creating a new React context. Set `T` to the data type
|
|
14
|
+
* of the registry - this can be anything **except** a function.
|
|
15
|
+
* 2. In the parent component, instantiate the registry state via `useRegistryState`. Then wrap `children` in the
|
|
16
|
+
* registry context `Provider` with `setRegistry` set to the state setter function.
|
|
17
|
+
* 3. Register child components via `useRegisterDescendant` or `useRegisterDescendantCallback`.
|
|
18
|
+
* 4. Access the registered data using the value from `useRegistryState`. This will be a map of `string` to `T`, where
|
|
19
|
+
* the string key is a unique and stable identifier for each component which can be used as a `key` if necessary.
|
|
20
|
+
*
|
|
21
|
+
* @note Note that this pattern is not SSR compatible. It won't raise errors or hydration mismatches, but the
|
|
22
|
+
* registry will not be available during SSR. The registry is built during the effect phase, so it will be populated
|
|
23
|
+
* after hydration on the client. The initial `undefined` value can be used to safely show loading UI during SSR/initial
|
|
24
|
+
* render if necessary.
|
|
25
|
+
*/
|
|
26
|
+
function createDescendantRegistry() {
|
|
27
|
+
const Context = /*#__PURE__*/createContext({
|
|
28
|
+
register: () => () => {},
|
|
29
|
+
updateValue: () => {},
|
|
30
|
+
key: -1
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Instantiate descendant registry state. The initial value will be `undefined`, indicating that the registry hasn't
|
|
35
|
+
* been built yet.
|
|
36
|
+
*/
|
|
37
|
+
function useRegistryState() {
|
|
38
|
+
return useState();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Register a descendant component with the registry. */
|
|
42
|
+
function useRegisterDescendant(value) {
|
|
43
|
+
const $ = c(16);
|
|
44
|
+
const {
|
|
45
|
+
register,
|
|
46
|
+
updateValue,
|
|
47
|
+
key
|
|
48
|
+
} = useContext(Context);
|
|
49
|
+
const id = useId();
|
|
50
|
+
let t0;
|
|
51
|
+
if ($[0] !== id || $[1] !== register) {
|
|
52
|
+
t0 = () => register(id);
|
|
53
|
+
$[0] = id;
|
|
54
|
+
$[1] = register;
|
|
55
|
+
$[2] = t0;
|
|
56
|
+
} else {
|
|
57
|
+
t0 = $[2];
|
|
58
|
+
}
|
|
59
|
+
let t1;
|
|
60
|
+
if ($[3] !== id || $[4] !== key || $[5] !== register) {
|
|
61
|
+
t1 = [register, id, key];
|
|
62
|
+
$[3] = id;
|
|
63
|
+
$[4] = key;
|
|
64
|
+
$[5] = register;
|
|
65
|
+
$[6] = t1;
|
|
66
|
+
} else {
|
|
67
|
+
t1 = $[6];
|
|
68
|
+
}
|
|
69
|
+
useEffect(t0, t1);
|
|
70
|
+
let t2;
|
|
71
|
+
if ($[7] !== id || $[8] !== updateValue || $[9] !== value) {
|
|
72
|
+
t2 = () => updateValue(id, value);
|
|
73
|
+
$[7] = id;
|
|
74
|
+
$[8] = updateValue;
|
|
75
|
+
$[9] = value;
|
|
76
|
+
$[10] = t2;
|
|
77
|
+
} else {
|
|
78
|
+
t2 = $[10];
|
|
79
|
+
}
|
|
80
|
+
let t3;
|
|
81
|
+
if ($[11] !== id || $[12] !== key || $[13] !== updateValue || $[14] !== value) {
|
|
82
|
+
t3 = [updateValue, id, value, key];
|
|
83
|
+
$[11] = id;
|
|
84
|
+
$[12] = key;
|
|
85
|
+
$[13] = updateValue;
|
|
86
|
+
$[14] = value;
|
|
87
|
+
$[15] = t3;
|
|
88
|
+
} else {
|
|
89
|
+
t3 = $[15];
|
|
90
|
+
}
|
|
91
|
+
useEffect(t2, t3);
|
|
92
|
+
return id;
|
|
93
|
+
}
|
|
94
|
+
const unsetValue = Symbol('unset');
|
|
95
|
+
|
|
96
|
+
/** Provide context for registering descendant components. This only needs to wrap `children`. */
|
|
97
|
+
function Provider(t0) {
|
|
98
|
+
const $ = c(14);
|
|
99
|
+
const {
|
|
100
|
+
children,
|
|
101
|
+
setRegistry
|
|
102
|
+
} = t0;
|
|
103
|
+
const workingRegistryRef = useRef("queued");
|
|
104
|
+
const [key, rebuildRegistry] = useReducer(_temp, 0);
|
|
105
|
+
let t1;
|
|
106
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
107
|
+
t1 = function instantiateNewRegistry() {
|
|
108
|
+
if (workingRegistryRef.current === "queued") {
|
|
109
|
+
workingRegistryRef.current = new Map();
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
$[0] = t1;
|
|
113
|
+
} else {
|
|
114
|
+
t1 = $[0];
|
|
115
|
+
}
|
|
116
|
+
useIsomorphicLayoutEffect(t1);
|
|
117
|
+
let t2;
|
|
118
|
+
if ($[1] !== setRegistry) {
|
|
119
|
+
t2 = id => {
|
|
120
|
+
if (workingRegistryRef.current instanceof Map) {
|
|
121
|
+
workingRegistryRef.current.set(id, unsetValue);
|
|
122
|
+
} else {
|
|
123
|
+
if (workingRegistryRef.current === "idle") {
|
|
124
|
+
workingRegistryRef.current = "queued";
|
|
125
|
+
rebuildRegistry();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return function unregister() {
|
|
129
|
+
if (workingRegistryRef.current instanceof Map) {
|
|
130
|
+
workingRegistryRef.current.delete(id);
|
|
131
|
+
} else {
|
|
132
|
+
if (workingRegistryRef.current === "idle") {
|
|
133
|
+
setRegistry(prev_0 => {
|
|
134
|
+
const copy = new Map(prev_0);
|
|
135
|
+
copy.delete(id);
|
|
136
|
+
return copy;
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
$[1] = setRegistry;
|
|
143
|
+
$[2] = t2;
|
|
144
|
+
} else {
|
|
145
|
+
t2 = $[2];
|
|
146
|
+
}
|
|
147
|
+
const register = t2;
|
|
148
|
+
let t3;
|
|
149
|
+
if ($[3] !== setRegistry) {
|
|
150
|
+
t3 = (id_0, value) => {
|
|
151
|
+
if (workingRegistryRef.current instanceof Map) {
|
|
152
|
+
workingRegistryRef.current.set(id_0, value);
|
|
153
|
+
} else {
|
|
154
|
+
if (workingRegistryRef.current === "idle") {
|
|
155
|
+
setRegistry(prev_1 => new Map(prev_1).set(id_0, value));
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
$[3] = setRegistry;
|
|
160
|
+
$[4] = t3;
|
|
161
|
+
} else {
|
|
162
|
+
t3 = $[4];
|
|
163
|
+
}
|
|
164
|
+
const updateValue = t3;
|
|
165
|
+
let t4;
|
|
166
|
+
if ($[5] !== setRegistry) {
|
|
167
|
+
t4 = function commitWorkingRegistry() {
|
|
168
|
+
if (workingRegistryRef.current instanceof Map) {
|
|
169
|
+
const setEntries = Array.from(workingRegistryRef.current.entries()).filter(_temp2);
|
|
170
|
+
setRegistry(new Map(setEntries));
|
|
171
|
+
workingRegistryRef.current = "idle";
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
$[5] = setRegistry;
|
|
175
|
+
$[6] = t4;
|
|
176
|
+
} else {
|
|
177
|
+
t4 = $[6];
|
|
178
|
+
}
|
|
179
|
+
useEffect(t4);
|
|
180
|
+
let t5;
|
|
181
|
+
if ($[7] !== key || $[8] !== register || $[9] !== updateValue) {
|
|
182
|
+
t5 = {
|
|
183
|
+
register,
|
|
184
|
+
updateValue,
|
|
185
|
+
key
|
|
186
|
+
};
|
|
187
|
+
$[7] = key;
|
|
188
|
+
$[8] = register;
|
|
189
|
+
$[9] = updateValue;
|
|
190
|
+
$[10] = t5;
|
|
191
|
+
} else {
|
|
192
|
+
t5 = $[10];
|
|
193
|
+
}
|
|
194
|
+
const contextValue = t5;
|
|
195
|
+
let t6;
|
|
196
|
+
if ($[11] !== children || $[12] !== contextValue) {
|
|
197
|
+
t6 = /*#__PURE__*/jsx(Context.Provider, {
|
|
198
|
+
value: contextValue,
|
|
199
|
+
children: children
|
|
200
|
+
});
|
|
201
|
+
$[11] = children;
|
|
202
|
+
$[12] = contextValue;
|
|
203
|
+
$[13] = t6;
|
|
204
|
+
} else {
|
|
205
|
+
t6 = $[13];
|
|
206
|
+
}
|
|
207
|
+
return t6;
|
|
208
|
+
}
|
|
209
|
+
function _temp2(entry) {
|
|
210
|
+
return entry[1] !== unsetValue;
|
|
211
|
+
}
|
|
212
|
+
function _temp(prev) {
|
|
213
|
+
return prev + 1;
|
|
214
|
+
}
|
|
215
|
+
return {
|
|
216
|
+
Provider,
|
|
217
|
+
useRegistryState,
|
|
218
|
+
useRegisterDescendant
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export { createDescendantRegistry };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primer/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.0-
|
|
4
|
+
"version": "0.0.0-20260303182827",
|
|
5
5
|
"description": "An implementation of GitHub's Primer Design System using React",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -78,7 +78,6 @@
|
|
|
78
78
|
"@github/relative-time-element": "^4.5.0",
|
|
79
79
|
"@github/tab-container-element": "^4.8.2",
|
|
80
80
|
"@lit-labs/react": "1.2.1",
|
|
81
|
-
"@oddbird/css-anchor-positioning": "^0.9.0",
|
|
82
81
|
"@oddbird/popover-polyfill": "^0.5.2",
|
|
83
82
|
"@primer/behaviors": "^1.10.2",
|
|
84
83
|
"@primer/live-region-element": "^0.7.1",
|
|
@@ -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);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-b61b19da.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,WAyBF,CAtBE,qEAGE,iBAAkB,CADlB,oDAEF,CAEA,kEAEE,kBAAmB,CADnB,uCAEF,CAEA,mEAGE,sCAAgC,CAFhC,kBAAmB,CACnB,eAEF,CAEA,oEACE,kBAAmB,CAEnB,qCAA+B,CAD/B,eAEF","file":"AnchoredOverlay-b61b19da.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 }\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"]}
|