@primer/react 0.0.0-20260303204227 → 0.0.0-20260303210348

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.
Files changed (28) hide show
  1. package/CHANGELOG.md +7 -3
  2. package/dist/ActionBar/ActionBar.d.ts.map +1 -1
  3. package/dist/ActionBar/ActionBar.js +281 -431
  4. package/dist/ActionMenu/ActionMenu.d.ts.map +1 -1
  5. package/dist/ActionMenu/ActionMenu.js +1 -9
  6. package/dist/AnchoredOverlay/AnchoredOverlay-73c1b2d1.css +2 -0
  7. package/dist/AnchoredOverlay/AnchoredOverlay-73c1b2d1.css.map +1 -0
  8. package/dist/AnchoredOverlay/AnchoredOverlay.d.ts.map +1 -1
  9. package/dist/AnchoredOverlay/AnchoredOverlay.js +9 -34
  10. package/dist/AnchoredOverlay/AnchoredOverlay.module.css.js +2 -2
  11. package/dist/FeatureFlags/DefaultFeatureFlags.d.ts.map +1 -1
  12. package/dist/FeatureFlags/DefaultFeatureFlags.js +0 -1
  13. package/dist/Overlay/Overlay-15519c09.css +2 -0
  14. package/dist/Overlay/Overlay-15519c09.css.map +1 -0
  15. package/dist/Overlay/Overlay.d.ts.map +1 -1
  16. package/dist/Overlay/Overlay.js +17 -26
  17. package/dist/Overlay/Overlay.module.css.js +1 -1
  18. package/dist/Timeline/{Timeline-116393ee.css → Timeline-19bef8c5.css} +2 -2
  19. package/dist/Timeline/{Timeline-116393ee.css.map → Timeline-19bef8c5.css.map} +1 -1
  20. package/dist/Timeline/Timeline.module.css.js +1 -1
  21. package/dist/utils/descendant-registry.d.ts +32 -0
  22. package/dist/utils/descendant-registry.d.ts.map +1 -0
  23. package/dist/utils/descendant-registry.js +222 -0
  24. package/package.json +1 -2
  25. package/dist/AnchoredOverlay/AnchoredOverlay-b61b19da.css +0 -2
  26. package/dist/AnchoredOverlay/AnchoredOverlay-b61b19da.css.map +0 -1
  27. package/dist/Overlay/Overlay-b2e98ec4.css +0 -2
  28. package/dist/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AA;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;AAO1D,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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GG;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
- if (cssAnchorPositioning && open) {
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
- const {
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: cssAnchorPositioning || position_0 ? 'visible' : 'hidden',
128
+ visibility: position_0 ? 'visible' : 'hidden',
145
129
  height: height,
146
130
  width: width,
147
- top: cssAnchorPositioning ? undefined : (position_0 === null || position_0 === void 0 ? void 0 : position_0.top) || 0,
148
- left: cssAnchorPositioning ? undefined : (position_0 === null || position_0 === void 0 ? void 0 : position_0.left) || 0,
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: cssAnchorPositioning ? undefined : position_0 === null || position_0 === void 0 ? void 0 : position_0.anchorSide,
151
- className: clsx(className, overlayClassName, cssAnchorPositioning ? classes.AnchoredOverlay : undefined),
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
- ...restOverlayProps,
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-b61b19da.css';
1
+ import './AnchoredOverlay-73c1b2d1.css';
2
2
 
3
- var classes = {"ResponsiveCloseButtonContainer":"prc-AnchoredOverlay-ResponsiveCloseButtonContainer-nuium","ResponsiveCloseButton":"prc-AnchoredOverlay-ResponsiveCloseButton-z-2rx","Wrapper":"prc-AnchoredOverlay-Wrapper-w6jU3","Anchor":"prc-AnchoredOverlay-Anchor-DWRfK","AnchoredOverlay":"prc-AnchoredOverlay-AnchoredOverlay-fYg9Z"};
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,kBAS9B,CAAA"}
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;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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kB,EAAE,gBAAgB,CAAC,CAAA;AAElE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,WAAW,EA+CnB,8BAA8B,CAAC,KAAK,EAAE,eAAe,CAAC,CAAA;AAE3D,KAAK,cAAc,GAAG;IACpB,UAAU,CAAC,EAAE,UAAU,CAAA;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;;;;;;;;;;;;;;;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"}
@@ -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(46);
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
- const t12 = cssAnchorPositioning ? "true" : "false";
274
- let t13;
275
- if ($[32] !== height || $[33] !== leftPosition || $[34] !== props || $[35] !== responsiveVariant || $[36] !== right || $[37] !== role || $[38] !== t11 || $[39] !== t12 || $[40] !== visibility || $[41] !== width) {
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] = t12;
297
- $[40] = visibility;
298
- $[41] = width;
299
- $[42] = t13;
292
+ $[39] = visibility;
293
+ $[40] = width;
294
+ $[41] = t12;
300
295
  } else {
301
- t13 = $[42];
302
- }
303
- const overlayContent = t13;
304
- if (cssAnchorPositioning) {
305
- return overlayContent;
296
+ t12 = $[41];
306
297
  }
307
- let t14;
308
- if ($[43] !== overlayContent || $[44] !== portalContainerName) {
309
- t14 = /*#__PURE__*/jsx(Portal, {
298
+ let t13;
299
+ if ($[42] !== portalContainerName || $[43] !== t12) {
300
+ t13 = /*#__PURE__*/jsx(Portal, {
310
301
  containerName: portalContainerName,
311
- children: overlayContent
302
+ children: t12
312
303
  });
313
- $[43] = overlayContent;
314
- $[44] = portalContainerName;
315
- $[45] = t14;
304
+ $[42] = portalContainerName;
305
+ $[43] = t12;
306
+ $[44] = t13;
316
307
  } else {
317
- t14 = $[45];
308
+ t13 = $[44];
318
309
  }
319
- return t14;
310
+ return t13;
320
311
  });
321
312
 
322
313
  export { BaseOverlay, Overlay as default, heightMap };
@@ -1,4 +1,4 @@
1
- import './Overlay-b2e98ec4.css';
1
+ import './Overlay-15519c09.css';
2
2
 
3
3
  var classes = {"Overlay":"prc-Overlay-Overlay-jfs-T","overlay-appear":"prc-Overlay-overlay-appear-JpFey"};
4
4
 
@@ -1,2 +1,2 @@
1
- .prc-Timeline-Timeline-awSoC{display:flex;flex-direction:column}.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar]) .prc-Timeline-TimelineItem-QwDVH:first-child{padding-top:0}:is(.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar]) .prc-Timeline-TimelineItem-QwDVH:first-child):where([data-condensed]):before{top:var(--base-size-12,.75rem)}.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar]) .prc-Timeline-TimelineItem-QwDVH:last-child{padding-bottom:0}:is(.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar]) .prc-Timeline-TimelineItem-QwDVH:last-child):where([data-condensed]):before{height:var(--base-size-12,.75rem)}.prc-Timeline-TimelineItem-QwDVH{display:flex;margin-left:var(--base-size-16,1rem);padding:var(--base-size-16,1rem) 0;position:relative}.prc-Timeline-TimelineItem-QwDVH:before{background-color:var(--borderColor-muted,var(--color-border-muted));bottom:0;content:"";display:block;left:0;position:absolute;top:0;width:2px}.prc-Timeline-TimelineItem-QwDVH:where([data-condensed]){padding-bottom:0;padding-top:var(--base-size-4,.25rem)}.prc-Timeline-TimelineItem-QwDVH:where([data-condensed]):last-child{padding-bottom:var(--base-size-16,1rem)}.prc-Timeline-TimelineItem-QwDVH:where([data-condensed]) .prc-Timeline-TimelineBadge-u0qSm{background-color:var(--bgColor-default,var(--color-canvas-default));border:0;color:var(--fgColor-muted,var(--color-fg-muted));height:16px;margin-bottom:var(--base-size-8,.5rem);margin-top:var(--base-size-8,.5rem)}.prc-Timeline-TimelineBadgeWrapper-SZw4k{position:relative;z-index:1}.prc-Timeline-TimelineBadge-u0qSm{align-items:center;background-color:var(--timelineBadge-bgColor,var(--color-timeline-badge-bg));border-color:var(--bgColor-default,var(--color-canvas-default));border-radius:50%;border-style:solid;border-width:var(--borderWidth-thick,.125rem);display:flex;flex-shrink:0;height:32px;justify-content:center;margin-left:-15px;margin-right:var(--base-size-8,.5rem);overflow:hidden;width:32px}.prc-Timeline-TimelineBadge-u0qSm,.prc-Timeline-TimelineBody-tjOtb{color:var(--fgColor-muted,var(--color-fg-muted))}.prc-Timeline-TimelineBody-tjOtb{flex:auto;font-size:var(--text-body-size-medium,.875rem);margin-top:var(--base-size-4,.25rem);max-width:100%;min-width:0}.prc-Timeline-TimelineBreak-X8eti{background-color:var(--bgColor-default,var(--color-canvas-default));border:0;border-top:var(--borderWidth-thicker,.25rem) solid var(--borderColor-default,var(--color-border-default));height:var(--base-size-24,1.5rem);margin:0;margin-bottom:calc(var(--base-size-16,1rem)*-1);margin-left:0;position:relative;z-index:1}.prc-Timeline-TimelineBreak-X8eti:has(+[data-condensed]){margin-bottom:calc(var(--base-size-12,.75rem)*-1)}
2
- /*# sourceMappingURL=Timeline-116393ee.css.map */
1
+ .prc-Timeline-Timeline-awSoC{display:flex;flex-direction:column}.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar]) .prc-Timeline-TimelineItem-QwDVH:first-child{padding-top:0}:is(.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar]) .prc-Timeline-TimelineItem-QwDVH:first-child):where([data-condensed]):before{top:var(--base-size-12,.75rem)}.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar]) .prc-Timeline-TimelineItem-QwDVH:last-child{padding-bottom:0}:is(.prc-Timeline-Timeline-awSoC:where([data-clip-sidebar]) .prc-Timeline-TimelineItem-QwDVH:last-child):where([data-condensed]):before{height:var(--base-size-12,.75rem)}.prc-Timeline-TimelineItem-QwDVH{display:flex;margin-left:var(--base-size-16,1rem);padding:var(--base-size-16,1rem) 0;position:relative}.prc-Timeline-TimelineItem-QwDVH:before{background-color:var(--borderColor-muted,var(--color-border-muted));bottom:0;content:"";display:block;left:0;position:absolute;top:0;width:2px}.prc-Timeline-TimelineItem-QwDVH:where([data-condensed]){padding-bottom:0;padding-top:var(--base-size-4,.25rem)}.prc-Timeline-TimelineItem-QwDVH:where([data-condensed]):last-child{padding-bottom:var(--base-size-16,1rem)}.prc-Timeline-TimelineItem-QwDVH:where([data-condensed]) .prc-Timeline-TimelineBadge-u0qSm{background-color:var(--bgColor-default,var(--color-canvas-default));border:0;color:var(--fgColor-muted,var(--color-fg-muted));height:16px;margin-bottom:var(--base-size-8,.5rem);margin-top:var(--base-size-8,.5rem)}.prc-Timeline-TimelineBadgeWrapper-SZw4k{position:relative;z-index:1}.prc-Timeline-TimelineBadge-u0qSm{align-items:center;background-color:var(--timelineBadge-bgColor,var(--color-timeline-badge-bg));border-color:var(--bgColor-default,var(--color-canvas-default));border-radius:50%;border-style:solid;border-width:var(--borderWidth-thick,.125rem);display:flex;flex-shrink:0;height:32px;justify-content:center;margin-left:-15px;margin-right:var(--base-size-8,.5rem);overflow:hidden;width:32px}.prc-Timeline-TimelineBadge-u0qSm,.prc-Timeline-TimelineBody-tjOtb{color:var(--fgColor-muted,var(--color-fg-muted))}.prc-Timeline-TimelineBody-tjOtb{flex:auto;font-size:var(--text-body-size-medium,.875rem);margin-top:calc(var(--base-size-4,.25rem) + 1px);max-width:100%;min-width:0}.prc-Timeline-TimelineBreak-X8eti{background-color:var(--bgColor-default,var(--color-canvas-default));border:0;border-top:var(--borderWidth-thicker,.25rem) solid var(--borderColor-default,var(--color-border-default));height:var(--base-size-24,1.5rem);margin:0;margin-bottom:calc(var(--base-size-16,1rem)*-1);margin-left:0;position:relative;z-index:1}.prc-Timeline-TimelineBreak-X8eti:has(+[data-condensed]){margin-bottom:calc(var(--base-size-12,.75rem)*-1)}
2
+ /*# sourceMappingURL=Timeline-19bef8c5.css.map */
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/Timeline/Timeline.module.css.js"],"names":[],"mappings":"AAAA,6BACE,YAAa,CACb,qBAmBF,CAhBI,qGACE,aAKF,CAHE,yIACE,8BACF,CAGF,oGACE,gBAKF,CAHE,wIACE,iCACF,CAKN,iCAEE,YAAa,CAEb,oCAAgC,CADhC,kCAA8B,CAF9B,iBAkCF,CA7BE,wCASE,mEAA0C,CAN1C,QAAS,CAIT,UAAW,CAFX,aAAc,CADd,MAAO,CAHP,iBAAkB,CAClB,KAAM,CAIN,SAIF,CAEA,yDAEE,gBAAiB,CADjB,qCAeF,CAZE,oEACE,uCACF,CAEA,2FAKE,mEAAwC,CACxC,QAAS,CAFT,gDAA2B,CAH3B,WAAY,CAEZ,sCAAiC,CADjC,mCAKF,CAIJ,yCACE,iBAAkB,CAClB,SACF,CAEA,kCAkBE,kBAAmB,CANnB,4EAA8C,CAE9C,+DAAoC,CAGpC,iBAAkB,CAFlB,kBAAmB,CACnB,6CAAsC,CAftC,YAAa,CAMb,aAAc,CAJd,WAAY,CAgBZ,sBAAuB,CAbvB,iBAAkB,CAFlB,qCAAgC,CAIhC,eAAgB,CANhB,UAkBF,CAEA,mEAbE,gDAoBF,CAPA,iCAME,SAAU,CAFV,8CAAuC,CADvC,oCAA8B,CAD9B,cAAe,CADf,WAMF,CAEA,kCAOE,mEAAwC,CACxC,QAAS,CACT,yGAAuE,CANvE,iCAA2B,CAC3B,QAAS,CACT,+CAA6C,CAC7C,aAAc,CALd,iBAAkB,CAClB,SAYF,CAHE,yDACE,iDACF","file":"Timeline-116393ee.css","sourcesContent":[".Timeline {\n display: flex;\n flex-direction: column;\n\n &:where([data-clip-sidebar]) {\n .TimelineItem:first-child {\n padding-top: 0;\n\n &:where([data-condensed])::before {\n top: var(--base-size-12);\n }\n }\n\n .TimelineItem:last-child {\n padding-bottom: 0;\n\n &:where([data-condensed])::before {\n height: var(--base-size-12);\n }\n }\n }\n}\n\n.TimelineItem {\n position: relative;\n display: flex;\n padding: var(--base-size-16) 0;\n margin-left: var(--base-size-16);\n\n &::before {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n display: block;\n width: 2px;\n content: '';\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--borderColor-muted);\n }\n\n &:where([data-condensed]) {\n padding-top: var(--base-size-4);\n padding-bottom: 0;\n\n &:last-child {\n padding-bottom: var(--base-size-16);\n }\n\n .TimelineBadge {\n height: 16px;\n margin-top: var(--base-size-8);\n margin-bottom: var(--base-size-8);\n color: var(--fgColor-muted);\n background-color: var(--bgColor-default);\n border: 0;\n }\n }\n}\n\n.TimelineBadgeWrapper {\n position: relative;\n z-index: 1;\n}\n\n.TimelineBadge {\n display: flex;\n width: 32px;\n height: 32px;\n margin-right: var(--base-size-8);\n /* stylelint-disable-next-line primer/spacing */\n margin-left: -15px;\n flex-shrink: 0;\n overflow: hidden;\n color: var(--fgColor-muted);\n\n /* TODOl not quite sure if this is the correct migration for this line */\n background-color: var(--timelineBadge-bgColor);\n /* stylelint-disable-next-line primer/colors */\n border-color: var(--bgColor-default);\n border-style: solid;\n border-width: var(--borderWidth-thick);\n border-radius: 50%;\n align-items: center;\n justify-content: center;\n}\n\n.TimelineBody {\n min-width: 0;\n max-width: 100%;\n margin-top: var(--base-size-4);\n font-size: var(--text-body-size-medium);\n color: var(--fgColor-muted);\n flex: auto;\n}\n\n.TimelineBreak {\n position: relative;\n z-index: 1;\n height: var(--base-size-24);\n margin: 0;\n margin-bottom: calc(-1 * var(--base-size-16));\n margin-left: 0;\n background-color: var(--bgColor-default);\n border: 0;\n border-top: var(--borderWidth-thicker) solid var(--borderColor-default);\n\n &:has(+ [data-condensed]) {\n margin-bottom: calc(-1 * var(--base-size-12));\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/Timeline/Timeline.module.css.js"],"names":[],"mappings":"AAAA,6BACE,YAAa,CACb,qBAmBF,CAhBI,qGACE,aAKF,CAHE,yIACE,8BACF,CAGF,oGACE,gBAKF,CAHE,wIACE,iCACF,CAKN,iCAEE,YAAa,CAEb,oCAAgC,CADhC,kCAA8B,CAF9B,iBAkCF,CA7BE,wCASE,mEAA0C,CAN1C,QAAS,CAIT,UAAW,CAFX,aAAc,CADd,MAAO,CAHP,iBAAkB,CAClB,KAAM,CAIN,SAIF,CAEA,yDAEE,gBAAiB,CADjB,qCAeF,CAZE,oEACE,uCACF,CAEA,2FAKE,mEAAwC,CACxC,QAAS,CAFT,gDAA2B,CAH3B,WAAY,CAEZ,sCAAiC,CADjC,mCAKF,CAIJ,yCACE,iBAAkB,CAClB,SACF,CAEA,kCAkBE,kBAAmB,CANnB,4EAA8C,CAE9C,+DAAoC,CAGpC,iBAAkB,CAFlB,kBAAmB,CACnB,6CAAsC,CAftC,YAAa,CAMb,aAAc,CAJd,WAAY,CAgBZ,sBAAuB,CAbvB,iBAAkB,CAFlB,qCAAgC,CAIhC,eAAgB,CANhB,UAkBF,CAEA,mEAbE,gDAqBF,CARA,iCAOE,SAAU,CAFV,8CAAuC,CADvC,gDAA0C,CAF1C,cAAe,CADf,WAOF,CAEA,kCAOE,mEAAwC,CACxC,QAAS,CACT,yGAAuE,CANvE,iCAA2B,CAC3B,QAAS,CACT,+CAA6C,CAC7C,aAAc,CALd,iBAAkB,CAClB,SAYF,CAHE,yDACE,iDACF","file":"Timeline-19bef8c5.css","sourcesContent":[".Timeline {\n display: flex;\n flex-direction: column;\n\n &:where([data-clip-sidebar]) {\n .TimelineItem:first-child {\n padding-top: 0;\n\n &:where([data-condensed])::before {\n top: var(--base-size-12);\n }\n }\n\n .TimelineItem:last-child {\n padding-bottom: 0;\n\n &:where([data-condensed])::before {\n height: var(--base-size-12);\n }\n }\n }\n}\n\n.TimelineItem {\n position: relative;\n display: flex;\n padding: var(--base-size-16) 0;\n margin-left: var(--base-size-16);\n\n &::before {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n display: block;\n width: 2px;\n content: '';\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--borderColor-muted);\n }\n\n &:where([data-condensed]) {\n padding-top: var(--base-size-4);\n padding-bottom: 0;\n\n &:last-child {\n padding-bottom: var(--base-size-16);\n }\n\n .TimelineBadge {\n height: 16px;\n margin-top: var(--base-size-8);\n margin-bottom: var(--base-size-8);\n color: var(--fgColor-muted);\n background-color: var(--bgColor-default);\n border: 0;\n }\n }\n}\n\n.TimelineBadgeWrapper {\n position: relative;\n z-index: 1;\n}\n\n.TimelineBadge {\n display: flex;\n width: 32px;\n height: 32px;\n margin-right: var(--base-size-8);\n /* stylelint-disable-next-line primer/spacing */\n margin-left: -15px;\n flex-shrink: 0;\n overflow: hidden;\n color: var(--fgColor-muted);\n\n /* TODOl not quite sure if this is the correct migration for this line */\n background-color: var(--timelineBadge-bgColor);\n /* stylelint-disable-next-line primer/colors */\n border-color: var(--bgColor-default);\n border-style: solid;\n border-width: var(--borderWidth-thick);\n border-radius: 50%;\n align-items: center;\n justify-content: center;\n}\n\n.TimelineBody {\n min-width: 0;\n max-width: 100%;\n /* stylelint-disable-next-line primer/spacing */\n margin-top: calc(var(--base-size-4) + 1px);\n font-size: var(--text-body-size-medium);\n color: var(--fgColor-muted);\n flex: auto;\n}\n\n.TimelineBreak {\n position: relative;\n z-index: 1;\n height: var(--base-size-24);\n margin: 0;\n margin-bottom: calc(-1 * var(--base-size-16));\n margin-left: 0;\n background-color: var(--bgColor-default);\n border: 0;\n border-top: var(--borderWidth-thicker) solid var(--borderColor-default);\n\n &:has(+ [data-condensed]) {\n margin-bottom: calc(-1 * var(--base-size-12));\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import './Timeline-116393ee.css';
1
+ import './Timeline-19bef8c5.css';
2
2
 
3
3
  var classes = {"Timeline":"prc-Timeline-Timeline-awSoC","TimelineItem":"prc-Timeline-TimelineItem-QwDVH","TimelineBadge":"prc-Timeline-TimelineBadge-u0qSm","TimelineBadgeWrapper":"prc-Timeline-TimelineBadgeWrapper-SZw4k","TimelineBody":"prc-Timeline-TimelineBody-tjOtb","TimelineBreak":"prc-Timeline-TimelineBreak-X8eti"};
4
4
 
@@ -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 };