@primer/react 0.0.0-20260413151131 → 0.0.0-20260413205308
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 +23 -5
- package/dist/ActionBar/ActionBar.js +3 -3
- package/dist/ActionList/{ActionList-8b212f46.css → ActionList-e35e912e.css} +2 -2
- package/dist/ActionList/ActionList-e35e912e.css.map +1 -0
- package/dist/ActionList/ActionList.module.css.js +1 -1
- package/dist/ActionList/Heading.js +16 -17
- package/dist/ActionMenu/ActionMenu-c4e2a589.css +2 -0
- package/dist/ActionMenu/ActionMenu-c4e2a589.css.map +1 -0
- package/dist/ActionMenu/ActionMenu.d.ts.map +1 -1
- package/dist/ActionMenu/ActionMenu.js +0 -5
- package/dist/ActionMenu/ActionMenu.module.css.js +1 -1
- package/dist/AnchoredOverlay/{AnchoredOverlay-0cb96b2b.css → AnchoredOverlay-acde1a0a.css} +1 -1
- package/dist/AnchoredOverlay/AnchoredOverlay-acde1a0a.css.map +1 -0
- 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 +4 -3
- package/dist/Card/Card-65d85331.css +2 -0
- package/dist/Card/Card-65d85331.css.map +1 -0
- package/dist/Card/Card.d.ts +96 -0
- package/dist/Card/Card.d.ts.map +1 -0
- package/dist/Card/Card.js +485 -0
- package/dist/Card/Card.module.css.js +5 -0
- package/dist/Card/index.d.ts +31 -0
- package/dist/Card/index.d.ts.map +1 -0
- package/dist/Card/index.js +12 -0
- package/dist/DataTable/index.d.ts +4 -8
- package/dist/DataTable/index.d.ts.map +1 -1
- package/dist/DataTable/index.js +1 -0
- package/dist/Dialog/Dialog.js +3 -3
- package/dist/FeatureFlags/DefaultFeatureFlags.d.ts.map +1 -1
- package/dist/FeatureFlags/DefaultFeatureFlags.js +1 -3
- package/dist/Heading/Heading.js +3 -3
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +4 -3
- package/dist/Overlay/Overlay-a3634131.css +2 -0
- package/dist/Overlay/Overlay-a3634131.css.map +1 -0
- package/dist/Overlay/Overlay.d.ts +1 -0
- package/dist/Overlay/Overlay.d.ts.map +1 -1
- package/dist/Overlay/Overlay.js +99 -85
- package/dist/Overlay/Overlay.module.css.js +1 -1
- package/dist/PageLayout/PageLayout.js +5 -5
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +3 -6
- package/dist/TextInputWithTokens/TextInputWithTokens.js +90 -91
- package/dist/Token/IssueLabelToken-10cfada5.css +2 -0
- package/dist/Token/{IssueLabelToken-ea9392ab.css.map → IssueLabelToken-10cfada5.css.map} +1 -1
- package/dist/Token/IssueLabelToken.module.css.js +1 -1
- package/dist/Token/_TokenTextContainer-55ce2de3.css +2 -0
- package/dist/Token/_TokenTextContainer-55ce2de3.css.map +1 -0
- package/dist/Token/_TokenTextContainer.module.css.js +1 -1
- package/dist/deprecated/DialogV1/Dialog.js +9 -10
- package/dist/experimental/index.d.ts +2 -0
- package/dist/experimental/index.d.ts.map +1 -1
- package/dist/experimental/index.js +1 -0
- package/dist/hooks/useMergedRefs.d.ts +4 -4
- package/dist/hooks/useMergedRefs.js +4 -4
- package/generated/components.json +91 -0
- package/package.json +2 -2
- package/dist/ActionList/ActionList-8b212f46.css.map +0 -1
- package/dist/ActionMenu/ActionMenu-58362ca7.css +0 -2
- package/dist/ActionMenu/ActionMenu-58362ca7.css.map +0 -1
- package/dist/AnchoredOverlay/AnchoredOverlay-0cb96b2b.css.map +0 -1
- package/dist/Overlay/Overlay-af89f3ff.css +0 -2
- package/dist/Overlay/Overlay-af89f3ff.css.map +0 -1
- package/dist/Token/IssueLabelToken-ea9392ab.css +0 -2
- package/dist/Token/_TokenTextContainer-24678fbc.css +0 -2
- package/dist/Token/_TokenTextContainer-24678fbc.css.map +0 -1
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 { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.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
|
+
useRefObjectAsForwardedRef(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: dialogRef,
|
|
209
209
|
role: role,
|
|
210
210
|
"aria-labelledby": dialogLabelId,
|
|
211
211
|
"aria-describedby": dialogDescriptionId,
|
|
@@ -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,kBAM9B,CAAA"}
|
|
@@ -5,9 +5,7 @@ const DefaultFeatureFlags = FeatureFlagScope.create({
|
|
|
5
5
|
primer_react_css_anchor_positioning: false,
|
|
6
6
|
primer_react_select_panel_fullscreen_on_narrow: false,
|
|
7
7
|
primer_react_select_panel_order_selected_at_top: false,
|
|
8
|
-
primer_react_select_panel_remove_active_descendant: false
|
|
9
|
-
primer_react_spinner_synchronize_animations: false,
|
|
10
|
-
primer_react_overlay_max_height_clamp_to_viewport: false
|
|
8
|
+
primer_react_select_panel_remove_active_descendant: false
|
|
11
9
|
});
|
|
12
10
|
|
|
13
11
|
export { DefaultFeatureFlags };
|
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 { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.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
|
+
useRefObjectAsForwardedRef(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: innerRef
|
|
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,sBAyC3B,CAAA;AAID,QAAA,MAAM,IAAI,IA/CoB,EAAE,SAAS,KAAK,CAAC,WAAW;;;;CA+CM,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 { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.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
|
+
useRefObjectAsForwardedRef(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,7 +37,8 @@ const UnwrappedLink = (props, ref) => {
|
|
|
37
37
|
"data-inline": inline,
|
|
38
38
|
"data-hover-color": hoverColor,
|
|
39
39
|
...restProps,
|
|
40
|
-
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
|
+
ref: innerRef
|
|
41
42
|
});
|
|
42
43
|
};
|
|
43
44
|
UnwrappedLink.displayName = "UnwrappedLink";
|
|
@@ -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);box-shadow:var(--shadow-floating-small,var(--color-overlay-shadow));height:auto;max-height:100vh;max-width:calc(100vw - 2rem);min-width:192px;overflow:auto;position:absolute;width:auto}.prc-Overlay-Overlay-jfs-T:not([data-anchor-position]):not([data-variant=modal]),.prc-Overlay-Overlay-jfs-T[data-anchor-position=false]{bottom:var(--bottom,auto);right:var(--right,auto)}@media screen and (max-width:calc(48rem - 0.02px)){[data-responsive=fullscreen]:is(.prc-Overlay-Overlay-jfs-T[data-anchor-position=false],.prc-Overlay-Overlay-jfs-T:not([data-anchor-position]):not([data-variant=modal])):not([data-variant]){left:0;top:0}}:is(.prc-Overlay-Overlay-jfs-T[data-anchor-position=false],.prc-Overlay-Overlay-jfs-T:not([data-anchor-position]):not([data-variant=modal])):not([data-variant]){left:var(--left,auto);top:var(--top,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:min(192px,100vh)}@supports (height:100dvh){.prc-Overlay-Overlay-jfs-T:where([data-max-height-xsmall]){max-height:min(192px,100dvh)}}.prc-Overlay-Overlay-jfs-T:where([data-max-height-small]){max-height:min(256px,100vh)}@supports (height:100dvh){.prc-Overlay-Overlay-jfs-T:where([data-max-height-small]){max-height:min(256px,100dvh)}}.prc-Overlay-Overlay-jfs-T:where([data-max-height-medium]){max-height:min(320px,100vh)}@supports (height:100dvh){.prc-Overlay-Overlay-jfs-T:where([data-max-height-medium]){max-height:min(320px,100dvh)}}.prc-Overlay-Overlay-jfs-T:where([data-max-height-large]){max-height:min(432px,100vh)}@supports (height:100dvh){.prc-Overlay-Overlay-jfs-T:where([data-max-height-large]){max-height:min(432px,100dvh)}}.prc-Overlay-Overlay-jfs-T:where([data-max-height-xlarge]){max-height:min(600px,100vh)}@supports (height:100dvh){.prc-Overlay-Overlay-jfs-T:where([data-max-height-xlarge]){max-height:min(600px,100dvh)}}.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}.prc-Overlay-Overlay-jfs-T[popover]{border:0;inset:auto;margin:0;max-width:none;padding:0}@media screen and (max-width:calc(48rem - 0.02px)){.prc-Overlay-Overlay-jfs-T:where([data-responsive=fullscreen]),.prc-Overlay-Overlay-jfs-T[data-responsive=fullscreen][data-anchor-position]{border-radius:unset;height:100vh;left:0;margin:0;max-height:none;max-width:none;padding-bottom:env(safe-area-inset-bottom);position:fixed;top:0;width:100vw}@supports (height:100dvh){.prc-Overlay-Overlay-jfs-T:where([data-responsive=fullscreen]),.prc-Overlay-Overlay-jfs-T[data-responsive=fullscreen][data-anchor-position]{height:100dvh}}}@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-a3634131.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,CACxC,mEAAwC,CALxC,WAAY,CACZ,gBAAiB,CAJjB,4BAA6B,CAE7B,eAAgB,CAGhB,aAAc,CANd,iBAAkB,CAElB,UAiOF,CAxNE,wIAKE,yBAA2B,CAF3B,uBAkBF,CAZI,mDADF,6LAGI,MAAO,CADP,KAGJ,CADE,CAGF,iKAIE,qBAAuB,CAFvB,mBAGF,CAGF,iCACE,YACF,CAEA,8BAvCF,2BAyCI,6BA2LJ,CA1LE,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,2BAKF,CAHE,0BAHF,2DAII,4BAEJ,CADE,CAGF,0DACE,2BAKF,CAHE,0BAHF,0DAII,4BAEJ,CADE,CAGF,2DACE,2BAKF,CAHE,0BAHF,2DAII,4BAEJ,CADE,CAGF,0DACE,2BAKF,CAHE,0BAHF,0DAII,4BAEJ,CADE,CAGF,2DACE,2BAKF,CAHE,0BAHF,2DAII,4BAEJ,CADE,CAGF,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,CAEA,oCAIE,QAAS,CAHT,UAAW,CACX,QAAS,CAGT,cAAe,CAFf,SAGF,CAIE,mDAFF,4IAWI,mBAAoB,CAHpB,YAAa,CAHb,MAAO,CAKP,QAAS,CADT,eAAgB,CAFhB,cAAe,CAMf,0CAA2C,CAV3C,cAAe,CACf,KAAM,CAEN,WAcJ,CALI,0BAfJ,4IAiBM,aAGN,CAFI,CACF,CAGF,0BAEE,4DACE,aACF,CACF,CAGF,8CACE,2BACE,wEACF,CACF","file":"Overlay-a3634131.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\n &[data-anchor-position='false'],\n &:not([data-anchor-position]):not([data-variant='modal']) {\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 /* stylelint-disable-next-line selector-max-specificity */\n &[data-responsive='fullscreen']:not([data-variant]) {\n @media screen and (--viewportRange-narrow) {\n top: 0;\n left: 0;\n }\n }\n\n &:not([data-variant]) {\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 }\n }\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: min(192px, 100vh);\n\n @supports (height: 100dvh) {\n max-height: min(192px, 100dvh);\n }\n }\n\n &:where([data-max-height-small]) {\n max-height: min(256px, 100vh);\n\n @supports (height: 100dvh) {\n max-height: min(256px, 100dvh);\n }\n }\n\n &:where([data-max-height-medium]) {\n max-height: min(320px, 100vh);\n\n @supports (height: 100dvh) {\n max-height: min(320px, 100dvh);\n }\n }\n\n &:where([data-max-height-large]) {\n max-height: min(432px, 100vh);\n\n @supports (height: 100dvh) {\n max-height: min(432px, 100dvh);\n }\n }\n\n &:where([data-max-height-xlarge]) {\n max-height: min(600px, 100vh);\n\n @supports (height: 100dvh) {\n max-height: min(600px, 100dvh);\n }\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 &[popover] {\n inset: auto;\n margin: 0;\n padding: 0;\n border: 0;\n max-width: none;\n }\n\n &:where([data-responsive='fullscreen']),\n &[data-responsive='fullscreen'][data-anchor-position] {\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 /* stylelint-disable-next-line primer/spacing */\n padding-bottom: env(safe-area-inset-bottom);\n\n @supports (height: 100dvh) {\n /* fix for mobile safari (100vh clips the screen with the toolbar) */\n height: 100dvh;\n }\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,CAAC,OAAO,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;IAC5D,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC,OAAO,QAAQ,EAAE,MAAM,CAAC,CAAA;IAC9C,UAAU,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;IACjC,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAA;IACnD,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC5B,CAAA;AAED,eAAO,MAAM,SAAS;;;;;;;;;CASrB,CAAA;AAED,eAAO,MAAM,QAAQ;;;;;;;CAOpB,CAAA;AAiBD,KAAK,gBAAgB,GAAG;IACtB,UAAU,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;IACjC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAA;IAC1C,GAAG,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;IAChC,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;IAClC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;IACpC,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;IACtC,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,iBAAiB,CAAC,EAAE,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"Overlay.d.ts","sourceRoot":"","sources":["../../src/Overlay/Overlay.tsx"],"names":[],"mappings":"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"}
|
package/dist/Overlay/Overlay.js
CHANGED
|
@@ -2,7 +2,7 @@ import { c } from 'react-compiler-runtime';
|
|
|
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 { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.js';
|
|
6
6
|
import classes from './Overlay.module.css.js';
|
|
7
7
|
import { clsx } from 'clsx';
|
|
8
8
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -124,7 +124,7 @@ const BaseOverlay = /*#__PURE__*/React.forwardRef(({
|
|
|
124
124
|
|
|
125
125
|
*/
|
|
126
126
|
const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
127
|
-
const $ = c(
|
|
127
|
+
const $ = c(51);
|
|
128
128
|
let _PrivateDisablePortal;
|
|
129
129
|
let anchorSide;
|
|
130
130
|
let ignoreClickRefs;
|
|
@@ -132,6 +132,7 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
132
132
|
let left;
|
|
133
133
|
let onClickOutside;
|
|
134
134
|
let onEscape;
|
|
135
|
+
let popover;
|
|
135
136
|
let portalContainerName;
|
|
136
137
|
let preventFocusOnOpen;
|
|
137
138
|
let props;
|
|
@@ -162,6 +163,7 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
162
163
|
visibility: t4,
|
|
163
164
|
width: t5,
|
|
164
165
|
responsiveVariant,
|
|
166
|
+
popover,
|
|
165
167
|
...props
|
|
166
168
|
} = t0);
|
|
167
169
|
$[0] = t0;
|
|
@@ -172,17 +174,18 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
172
174
|
$[5] = left;
|
|
173
175
|
$[6] = onClickOutside;
|
|
174
176
|
$[7] = onEscape;
|
|
175
|
-
$[8] =
|
|
176
|
-
$[9] =
|
|
177
|
-
$[10] =
|
|
178
|
-
$[11] =
|
|
179
|
-
$[12] =
|
|
180
|
-
$[13] =
|
|
181
|
-
$[14] =
|
|
182
|
-
$[15] =
|
|
183
|
-
$[16] =
|
|
184
|
-
$[17] =
|
|
185
|
-
$[18] =
|
|
177
|
+
$[8] = popover;
|
|
178
|
+
$[9] = portalContainerName;
|
|
179
|
+
$[10] = preventFocusOnOpen;
|
|
180
|
+
$[11] = props;
|
|
181
|
+
$[12] = responsiveVariant;
|
|
182
|
+
$[13] = returnFocusRef;
|
|
183
|
+
$[14] = right;
|
|
184
|
+
$[15] = t1;
|
|
185
|
+
$[16] = t2;
|
|
186
|
+
$[17] = t3;
|
|
187
|
+
$[18] = t4;
|
|
188
|
+
$[19] = t5;
|
|
186
189
|
} else {
|
|
187
190
|
_PrivateDisablePortal = $[1];
|
|
188
191
|
anchorSide = $[2];
|
|
@@ -191,29 +194,29 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
191
194
|
left = $[5];
|
|
192
195
|
onClickOutside = $[6];
|
|
193
196
|
onEscape = $[7];
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
197
|
+
popover = $[8];
|
|
198
|
+
portalContainerName = $[9];
|
|
199
|
+
preventFocusOnOpen = $[10];
|
|
200
|
+
props = $[11];
|
|
201
|
+
responsiveVariant = $[12];
|
|
202
|
+
returnFocusRef = $[13];
|
|
203
|
+
right = $[14];
|
|
204
|
+
t1 = $[15];
|
|
205
|
+
t2 = $[16];
|
|
206
|
+
t3 = $[17];
|
|
207
|
+
t4 = $[18];
|
|
208
|
+
t5 = $[19];
|
|
205
209
|
}
|
|
206
210
|
const height = t1 === undefined ? "auto" : t1;
|
|
207
211
|
const preventOverflow = t2 === undefined ? true : t2;
|
|
208
212
|
const role = t3 === undefined ? "none" : t3;
|
|
209
213
|
const visibility = t4 === undefined ? "visible" : t4;
|
|
210
214
|
const width = t5 === undefined ? "auto" : t5;
|
|
211
|
-
const featureFlagMaxHeightClampToViewport = useFeatureFlag("primer_react_overlay_max_height_clamp_to_viewport");
|
|
212
215
|
const overlayRef = useRef(null);
|
|
213
|
-
|
|
216
|
+
useRefObjectAsForwardedRef(forwardedRef, overlayRef);
|
|
214
217
|
const cssAnchorPositioning = useFeatureFlag("primer_react_css_anchor_positioning");
|
|
215
218
|
let t6;
|
|
216
|
-
if ($[
|
|
219
|
+
if ($[20] !== ignoreClickRefs || $[21] !== initialFocusRef || $[22] !== onClickOutside || $[23] !== onEscape || $[24] !== preventFocusOnOpen || $[25] !== returnFocusRef) {
|
|
217
220
|
t6 = {
|
|
218
221
|
overlayRef,
|
|
219
222
|
returnFocusRef,
|
|
@@ -223,20 +226,20 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
223
226
|
initialFocusRef,
|
|
224
227
|
preventFocusOnOpen
|
|
225
228
|
};
|
|
226
|
-
$[
|
|
227
|
-
$[
|
|
228
|
-
$[
|
|
229
|
-
$[
|
|
230
|
-
$[
|
|
231
|
-
$[
|
|
232
|
-
$[
|
|
229
|
+
$[20] = ignoreClickRefs;
|
|
230
|
+
$[21] = initialFocusRef;
|
|
231
|
+
$[22] = onClickOutside;
|
|
232
|
+
$[23] = onEscape;
|
|
233
|
+
$[24] = preventFocusOnOpen;
|
|
234
|
+
$[25] = returnFocusRef;
|
|
235
|
+
$[26] = t6;
|
|
233
236
|
} else {
|
|
234
|
-
t6 = $[
|
|
237
|
+
t6 = $[26];
|
|
235
238
|
}
|
|
236
239
|
useOverlay(t6);
|
|
237
240
|
let t7;
|
|
238
241
|
let t8;
|
|
239
|
-
if ($[
|
|
242
|
+
if ($[27] !== height) {
|
|
240
243
|
t7 = () => {
|
|
241
244
|
var _overlayRef$current;
|
|
242
245
|
if (height === "initial" && (_overlayRef$current = overlayRef.current) !== null && _overlayRef$current !== void 0 && _overlayRef$current.clientHeight) {
|
|
@@ -244,17 +247,17 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
244
247
|
}
|
|
245
248
|
};
|
|
246
249
|
t8 = [height];
|
|
247
|
-
$[
|
|
248
|
-
$[
|
|
249
|
-
$[
|
|
250
|
+
$[27] = height;
|
|
251
|
+
$[28] = t7;
|
|
252
|
+
$[29] = t8;
|
|
250
253
|
} else {
|
|
251
|
-
t7 = $[
|
|
252
|
-
t8 = $[
|
|
254
|
+
t7 = $[28];
|
|
255
|
+
t8 = $[29];
|
|
253
256
|
}
|
|
254
257
|
useEffect(t7, t8);
|
|
255
258
|
let t10;
|
|
256
259
|
let t9;
|
|
257
|
-
if ($[
|
|
260
|
+
if ($[30] !== anchorSide || $[31] !== visibility) {
|
|
258
261
|
t9 = () => {
|
|
259
262
|
var _overlayRef$current2;
|
|
260
263
|
const {
|
|
@@ -272,74 +275,85 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
272
275
|
});
|
|
273
276
|
};
|
|
274
277
|
t10 = [anchorSide, 8, "cubic-bezier(0.33, 1, 0.68, 1)", visibility];
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
277
|
-
$[
|
|
278
|
-
$[
|
|
278
|
+
$[30] = anchorSide;
|
|
279
|
+
$[31] = visibility;
|
|
280
|
+
$[32] = t10;
|
|
281
|
+
$[33] = t9;
|
|
279
282
|
} else {
|
|
280
|
-
t10 = $[
|
|
281
|
-
t9 = $[
|
|
283
|
+
t10 = $[32];
|
|
284
|
+
t9 = $[33];
|
|
282
285
|
}
|
|
283
286
|
useIsomorphicLayoutEffect(t9, t10);
|
|
284
|
-
|
|
285
|
-
const t11 = !preventOverflow ? true : undefined;
|
|
287
|
+
let t11;
|
|
286
288
|
let t12;
|
|
287
|
-
if ($[
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
289
|
+
if ($[34] !== popover) {
|
|
290
|
+
t11 = () => {
|
|
291
|
+
if (!popover || !overlayRef.current) {
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
try {
|
|
295
|
+
if (!overlayRef.current.matches(":popover-open")) {
|
|
296
|
+
overlayRef.current.showPopover();
|
|
297
|
+
}
|
|
298
|
+
} catch {}
|
|
299
|
+
};
|
|
300
|
+
t12 = [popover];
|
|
301
|
+
$[34] = popover;
|
|
302
|
+
$[35] = t11;
|
|
303
|
+
$[36] = t12;
|
|
293
304
|
} else {
|
|
294
|
-
|
|
305
|
+
t11 = $[35];
|
|
306
|
+
t12 = $[36];
|
|
295
307
|
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
308
|
+
useIsomorphicLayoutEffect(t11, t12);
|
|
309
|
+
const leftPosition = left === undefined && right === undefined ? 0 : left;
|
|
310
|
+
const t13 = !preventOverflow ? true : undefined;
|
|
311
|
+
let t14;
|
|
312
|
+
if ($[37] !== height || $[38] !== leftPosition || $[39] !== popover || $[40] !== props || $[41] !== responsiveVariant || $[42] !== right || $[43] !== role || $[44] !== t13 || $[45] !== visibility || $[46] !== width) {
|
|
313
|
+
t14 = /*#__PURE__*/jsx(BaseOverlay, {
|
|
299
314
|
role: role,
|
|
300
315
|
width: width,
|
|
301
|
-
"data-reflow-container":
|
|
302
|
-
ref:
|
|
316
|
+
"data-reflow-container": t13,
|
|
317
|
+
ref: overlayRef,
|
|
303
318
|
left: leftPosition,
|
|
304
319
|
right: right,
|
|
305
320
|
height: height,
|
|
306
321
|
visibility: visibility,
|
|
307
322
|
"data-responsive": responsiveVariant,
|
|
308
|
-
|
|
323
|
+
popover: popover,
|
|
309
324
|
...props
|
|
310
325
|
});
|
|
311
|
-
$[
|
|
312
|
-
$[
|
|
313
|
-
$[
|
|
314
|
-
$[
|
|
315
|
-
$[
|
|
316
|
-
$[
|
|
317
|
-
$[
|
|
318
|
-
$[
|
|
319
|
-
$[
|
|
320
|
-
$[
|
|
321
|
-
$[
|
|
322
|
-
$[46] = t13;
|
|
326
|
+
$[37] = height;
|
|
327
|
+
$[38] = leftPosition;
|
|
328
|
+
$[39] = popover;
|
|
329
|
+
$[40] = props;
|
|
330
|
+
$[41] = responsiveVariant;
|
|
331
|
+
$[42] = right;
|
|
332
|
+
$[43] = role;
|
|
333
|
+
$[44] = t13;
|
|
334
|
+
$[45] = visibility;
|
|
335
|
+
$[46] = width;
|
|
336
|
+
$[47] = t14;
|
|
323
337
|
} else {
|
|
324
|
-
|
|
338
|
+
t14 = $[47];
|
|
325
339
|
}
|
|
326
|
-
const overlayContent =
|
|
340
|
+
const overlayContent = t14;
|
|
327
341
|
if (_PrivateDisablePortal && cssAnchorPositioning) {
|
|
328
342
|
return overlayContent;
|
|
329
343
|
}
|
|
330
|
-
let
|
|
331
|
-
if ($[
|
|
332
|
-
|
|
344
|
+
let t15;
|
|
345
|
+
if ($[48] !== overlayContent || $[49] !== portalContainerName) {
|
|
346
|
+
t15 = /*#__PURE__*/jsx(Portal, {
|
|
333
347
|
containerName: portalContainerName,
|
|
334
348
|
children: overlayContent
|
|
335
349
|
});
|
|
336
|
-
$[
|
|
337
|
-
$[
|
|
338
|
-
$[
|
|
350
|
+
$[48] = overlayContent;
|
|
351
|
+
$[49] = portalContainerName;
|
|
352
|
+
$[50] = t15;
|
|
339
353
|
} else {
|
|
340
|
-
|
|
354
|
+
t15 = $[50];
|
|
341
355
|
}
|
|
342
|
-
return
|
|
356
|
+
return t15;
|
|
343
357
|
});
|
|
344
358
|
|
|
345
359
|
export { BaseOverlay, Overlay as default, heightMap, widthMap };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useRef, memo } from 'react';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
3
|
import { useId } from '../hooks/useId.js';
|
|
4
|
-
import {
|
|
4
|
+
import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.js';
|
|
5
5
|
import { isResponsiveValue } from '../hooks/useResponsiveValue.js';
|
|
6
6
|
import { useSlots } from '../hooks/useSlots.js';
|
|
7
7
|
import { useOverflow } from '../hooks/useOverflow.js';
|
|
@@ -581,7 +581,7 @@ const Pane = /*#__PURE__*/React.forwardRef(({
|
|
|
581
581
|
onResizeEnd,
|
|
582
582
|
currentWidth: controlledWidth
|
|
583
583
|
});
|
|
584
|
-
|
|
584
|
+
useRefObjectAsForwardedRef(forwardRef, paneRef);
|
|
585
585
|
const hasOverflow = useOverflow(paneRef);
|
|
586
586
|
const paneId = useId(id);
|
|
587
587
|
const labelProp = {};
|
|
@@ -615,7 +615,7 @@ const Pane = /*#__PURE__*/React.forwardRef(({
|
|
|
615
615
|
},
|
|
616
616
|
position: positionProp
|
|
617
617
|
}), /*#__PURE__*/jsx("div", {
|
|
618
|
-
ref:
|
|
618
|
+
ref: paneRef
|
|
619
619
|
// Suppress hydration mismatch for --pane-width when localStorage
|
|
620
620
|
// provides a width that differs from the server-rendered default.
|
|
621
621
|
// Not needed when onResizeEnd is provided (localStorage isn't read).
|
|
@@ -785,7 +785,7 @@ const Sidebar = /*#__PURE__*/React.forwardRef(({
|
|
|
785
785
|
contentWrapperRef: sidebarContentWrapperRef,
|
|
786
786
|
constrainToViewport: true
|
|
787
787
|
});
|
|
788
|
-
|
|
788
|
+
useRefObjectAsForwardedRef(forwardRef, sidebarRef);
|
|
789
789
|
const hasOverflow = useOverflow(sidebarRef);
|
|
790
790
|
const sidebarId = useId(id);
|
|
791
791
|
const labelProp = {};
|
|
@@ -824,7 +824,7 @@ const Sidebar = /*#__PURE__*/React.forwardRef(({
|
|
|
824
824
|
getDefaultWidth: getDefaultWidth,
|
|
825
825
|
saveWidth: saveWidth
|
|
826
826
|
}), /*#__PURE__*/jsx("div", {
|
|
827
|
-
ref:
|
|
827
|
+
ref: sidebarRef
|
|
828
828
|
// Suppress hydration mismatch for --pane-width when localStorage
|
|
829
829
|
// provides a width that differs from the server-rendered default.
|
|
830
830
|
,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../src/Spinner/Spinner.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../src/Spinner/Spinner.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,4BAA4B,CAAA;AAOlE,QAAA,MAAM,OAAO;;;;CAIZ,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,gDAAgD;IAChD,IAAI,CAAC,EAAE,MAAM,OAAO,OAAO,CAAA;IAC3B,0KAA0K;IAC1K,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,wCAAwC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B,4MAA4M;IAC5M,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;CAC5C,GAAG,kBAAkB,CAAA;AAEtB,iBAAS,OAAO,CAAC,EACf,IAAI,EAAE,OAAkB,EACxB,MAAkB,EAClB,YAAY,EAAE,SAAS,EACvB,SAAS,EACT,KAAK,EACL,KAAa,EACb,GAAG,KAAK,EACT,EAAE,YAAY,4BA+Dd;kBAvEQ,OAAO;;;AAwFhB,eAAe,OAAO,CAAA"}
|
package/dist/Spinner/Spinner.js
CHANGED
|
@@ -4,7 +4,6 @@ import { useState, useEffect } from 'react';
|
|
|
4
4
|
import classes from './Spinner.module.css.js';
|
|
5
5
|
import { useMedia } from '../hooks/useMedia.js';
|
|
6
6
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
|
-
import { useFeatureFlag } from '../FeatureFlags/useFeatureFlag.js';
|
|
8
7
|
import { useId } from '../hooks/useId.js';
|
|
9
8
|
import { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden.js';
|
|
10
9
|
|
|
@@ -54,7 +53,6 @@ function Spinner(t0) {
|
|
|
54
53
|
const sizeKey = t1 === undefined ? "medium" : t1;
|
|
55
54
|
const srText = t2 === undefined ? "Loading" : t2;
|
|
56
55
|
const delay = t3 === undefined ? false : t3;
|
|
57
|
-
const syncAnimationsEnabled = useFeatureFlag("primer_react_spinner_synchronize_animations");
|
|
58
56
|
const noMotionPreference = useMedia("(prefers-reduced-motion: no-preference)", false);
|
|
59
57
|
const size = sizeMap[sizeKey];
|
|
60
58
|
const hasHiddenLabel = srText !== null && ariaLabel === undefined;
|
|
@@ -102,14 +100,13 @@ function Spinner(t0) {
|
|
|
102
100
|
if (!isVisible) {
|
|
103
101
|
return null;
|
|
104
102
|
}
|
|
105
|
-
const shouldSync = syncAnimationsEnabled && noMotionPreference;
|
|
106
103
|
let t8;
|
|
107
|
-
if ($[13] !==
|
|
108
|
-
t8 =
|
|
104
|
+
if ($[13] !== noMotionPreference || $[14] !== style || $[15] !== syncDelay) {
|
|
105
|
+
t8 = noMotionPreference ? {
|
|
109
106
|
...style,
|
|
110
107
|
animationDelay: `${syncDelay}ms`
|
|
111
108
|
} : style;
|
|
112
|
-
$[13] =
|
|
109
|
+
$[13] = noMotionPreference;
|
|
113
110
|
$[14] = style;
|
|
114
111
|
$[15] = syncDelay;
|
|
115
112
|
$[16] = t8;
|