@primer/react 38.6.3-rc.445c1cb34 → 38.6.3-rc.6132a8cdc

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.

Potentially problematic release.


This version of @primer/react might be problematic. Click here for more details.

Files changed (40) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/ActionBar/ActionBar.d.ts +8 -0
  3. package/dist/ActionBar/ActionBar.d.ts.map +1 -1
  4. package/dist/ActionBar/ActionBar.js +83 -53
  5. package/dist/ActionBar/index.d.ts +1 -0
  6. package/dist/ActionBar/index.d.ts.map +1 -1
  7. package/dist/{BaseStyles-79fd37c4.css → BaseStyles-7e59cc50.css} +2 -2
  8. package/dist/BaseStyles-7e59cc50.css.map +1 -0
  9. package/dist/BaseStyles.module.css.js +1 -1
  10. package/dist/Dialog/{Dialog-1a61e61a.css → Dialog-92b5e3b7.css} +2 -2
  11. package/dist/Dialog/Dialog-92b5e3b7.css.map +1 -0
  12. package/dist/Dialog/Dialog.d.ts.map +1 -1
  13. package/dist/Dialog/Dialog.js +21 -5
  14. package/dist/Dialog/Dialog.module.css.js +1 -1
  15. package/dist/FeatureFlags/DefaultFeatureFlags.d.ts.map +1 -1
  16. package/dist/FeatureFlags/DefaultFeatureFlags.js +1 -0
  17. package/dist/FeatureFlags/FeatureFlags.d.ts +6 -0
  18. package/dist/FeatureFlags/FeatureFlags.d.ts.map +1 -1
  19. package/dist/FeatureFlags/FeatureFlags.js +41 -32
  20. package/dist/PageLayout/{PageLayout-c092f3db.css → PageLayout-51007c87.css} +2 -2
  21. package/dist/PageLayout/PageLayout-51007c87.css.map +1 -0
  22. package/dist/PageLayout/PageLayout.d.ts.map +1 -1
  23. package/dist/PageLayout/PageLayout.js +399 -313
  24. package/dist/PageLayout/PageLayout.module.css.js +1 -1
  25. package/dist/PageLayout/paneUtils.d.ts +11 -0
  26. package/dist/PageLayout/paneUtils.d.ts.map +1 -0
  27. package/dist/PageLayout/paneUtils.js +34 -0
  28. package/dist/PageLayout/usePaneWidth.d.ts +2 -1
  29. package/dist/PageLayout/usePaneWidth.d.ts.map +1 -1
  30. package/dist/PageLayout/usePaneWidth.js +56 -44
  31. package/dist/ToggleSwitch/ToggleSwitch-40bab513.css +2 -0
  32. package/dist/ToggleSwitch/ToggleSwitch-40bab513.css.map +1 -0
  33. package/dist/ToggleSwitch/ToggleSwitch.module.css.js +1 -1
  34. package/generated/components.json +6 -0
  35. package/package.json +1 -1
  36. package/dist/BaseStyles-79fd37c4.css.map +0 -1
  37. package/dist/Dialog/Dialog-1a61e61a.css.map +0 -1
  38. package/dist/PageLayout/PageLayout-c092f3db.css.map +0 -1
  39. package/dist/ToggleSwitch/ToggleSwitch-d1bd60b0.css +0 -2
  40. package/dist/ToggleSwitch/ToggleSwitch-d1bd60b0.css.map +0 -1
package/CHANGELOG.md CHANGED
@@ -6,17 +6,47 @@
6
6
 
7
7
  - [#7354](https://github.com/primer/react/pull/7354) [`efbebdf`](https://github.com/primer/react/commit/efbebdf6589bf454ab78f17c83dc84ce88145e7b) Thanks [@llastflowers](https://github.com/llastflowers)! - update SelectPanel Multi Select Modal story
8
8
 
9
+ - [#7349](https://github.com/primer/react/pull/7349) [`713d5a5`](https://github.com/primer/react/commit/713d5a5c5616e005cf8e939f33f8526210d3d634) Thanks [@mattcosta7](https://github.com/mattcosta7)! - PageLayout: Optimize drag/resize performance with inline styles and new optimizations
10
+
11
+ **Refactored:**
12
+
13
+ - Use direct attribute selectors (`.Pane[data-dragging='true']`) instead of descendant selectors for CSS containment (O(1) vs O(n) selector matching)
14
+ - Extract optimization utilities to `paneUtils.ts`
15
+ - Apply drag handle visual feedback via inline styles and CSS variables
16
+
17
+ **Added:**
18
+
19
+ - `content-visibility: auto` during drag/resize to skip off-screen content rendering
20
+ - rAF throttle for drag updates (one update per frame, latest position wins)
21
+ - Containment during window resize (parity with drag)
22
+
23
+ These changes improve style recalculation performance on large DOMs (100k+ nodes) by eliminating descendant selector traversal.
24
+
9
25
  - [#7337](https://github.com/primer/react/pull/7337) [`de970d6`](https://github.com/primer/react/commit/de970d6682f4e9a3aa5e3c637e0245da2a7a9d84) Thanks [@mattcosta7](https://github.com/mattcosta7)! - perf(Autocomplete): Split context to reduce unnecessary re-renders
10
26
 
11
27
  Split AutocompleteContext into separate contexts for static values, setters, and dynamic state.
12
28
  Components now subscribe only to the context slices they need, reducing re-renders.
13
29
 
30
+ - [#7325](https://github.com/primer/react/pull/7325) [`cc7e10e`](https://github.com/primer/react/commit/cc7e10e7c0bee7ef9694ca94928446f704ada552) Thanks [@mattcosta7](https://github.com/mattcosta7)! - perf(BaseStyles): Remove expensive :has([data-color-mode]) selectors
31
+
32
+ Remove `:has([data-color-mode])` selectors that scanned the entire DOM on every style recalculation.
33
+ Input color-scheme is already handled by global selectors in the codebase.
34
+
35
+ - [#7329](https://github.com/primer/react/pull/7329) [`501a41f`](https://github.com/primer/react/commit/501a41fc44e5c0edfca69af022676e0d26e1a1a0) Thanks [@mattcosta7](https://github.com/mattcosta7)! - perf(Dialog): Add feature flag for CSS :has() selector performance optimization
36
+
37
+ - Add `primer_react_css_has_selector_perf` feature flag (default: false)
38
+ - When flag is OFF: uses legacy `body:has(.Dialog.DisableScroll)` selector
39
+ - When flag is ON: uses optimized direct `body[data-dialog-scroll-disabled]` data attribute with ref counting
40
+ - Enables gradual rollout and easy rollback of performance optimization
41
+
14
42
  - [#7342](https://github.com/primer/react/pull/7342) [`a8b42b2`](https://github.com/primer/react/commit/a8b42b2e4cff9575eae8df897e64c1ca67ee180a) Thanks [@mattcosta7](https://github.com/mattcosta7)! - perf(hasInteractiveNodes): Optimize with combined selector and early attribute checks
15
43
 
16
44
  - Use combined querySelectorAll selector instead of recursive traversal
17
45
  - Check attribute-based states (disabled, hidden, inert) before getComputedStyle
18
46
  - Only call getComputedStyle when CSS-based visibility check is needed
19
47
 
48
+ - [#7399](https://github.com/primer/react/pull/7399) [`06c8320`](https://github.com/primer/react/commit/06c83203cd3f200b337aa34618174934317494e2) Thanks [@TylerJDev](https://github.com/TylerJDev)! - ToggleSwitch: Adds `overflow: hidden` to `.StatusTextItem` when hidden
49
+
20
50
  ## 38.6.2
21
51
 
22
52
  ### Patch Changes
@@ -84,6 +84,10 @@ export type ActionBarMenuProps = {
84
84
  * If 'none' is provided, no icon will be shown in the overflow menu.
85
85
  */
86
86
  overflowIcon?: ActionBarIconButtonProps['icon'] | 'none';
87
+ /**
88
+ * Target element to return focus to when the menu is closed.
89
+ */
90
+ returnFocusRef?: React.RefObject<HTMLElement>;
87
91
  } & IconButtonProps;
88
92
  export declare const ActionBar: React.FC<React.PropsWithChildren<ActionBarProps>>;
89
93
  export declare const ActionBarIconButton: React.ForwardRefExoticComponent<ActionBarIconButtonProps & React.RefAttributes<unknown>>;
@@ -101,6 +105,10 @@ export declare const ActionBarMenu: React.ForwardRefExoticComponent<{
101
105
  * If 'none' is provided, no icon will be shown in the overflow menu.
102
106
  */
103
107
  overflowIcon?: ActionBarIconButtonProps["icon"] | "none";
108
+ /**
109
+ * Target element to return focus to when the menu is closed.
110
+ */
111
+ returnFocusRef?: React.RefObject<HTMLElement>;
104
112
  } & {
105
113
  'aria-label': string;
106
114
  'aria-labelledby'?: undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"ActionBar.d.ts","sourceRoot":"","sources":["../../src/ActionBar/ActionBar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAyD,MAAM,OAAO,CAAA;AAE7E,OAAO,EAAa,KAAK,mBAAmB,EAAC,MAAM,eAAe,CAAA;AAOlE,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,WAAW,CAAA;AAoD9C,KAAK,IAAI,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;AAExC,KAAK,SAAS,GACV;IACE,wDAAwD;IACxD,YAAY,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAA;IAChD,iBAAiB,CAAC,EAAE,SAAS,CAAA;CAC9B,GACD;IACE,YAAY,CAAC,EAAE,S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AM,CAAA;IACxD;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;CAC9C,GAAG,eAAe,CAAA;AAgInB,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAgNvE,CAAA;AAED,eAAO,MAAM,mBAAmB,0FAqD/B,CAAA;AAMD,eAAO,MAAM,cAAc;;iCA6BzB,CAAA;AAEF,eAAO,MAAM,aAAa;IA1bxB,2CAA2C;kBAC7B,MAAM;IACpB,+BAA+B;UACzB,wBAAwB,CAAC,MAAM,CAAC;WAC/B,sBAAsB,EAAE;IAC/B;;;OAGG;mBACY,wBAAwB,CAAC,MAAM,CAAC,GAAG,MAAM;IACxD;;OAEG;qBACc,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC;;;;;;;;;;;wGA6d9C,CAAA;AAED,eAAO,MAAM,eAAe,gCAoB3B,CAAA"}
@@ -373,7 +373,8 @@ const ActionBar = props => {
373
373
  const menuItems = menuItem.items;
374
374
  const {
375
375
  icon: Icon_0,
376
- label: label_0
376
+ label: label_0,
377
+ returnFocusRef
377
378
  } = menuItem;
378
379
  return /*#__PURE__*/jsxs(ActionMenu, {
379
380
  children: [/*#__PURE__*/jsx(ActionMenu.Anchor, {
@@ -383,6 +384,9 @@ const ActionBar = props => {
383
384
  }) : null, label_0]
384
385
  })
385
386
  }), /*#__PURE__*/jsx(ActionMenu.Overlay, {
387
+ ...(returnFocusRef && {
388
+ returnFocusRef
389
+ }),
386
390
  children: /*#__PURE__*/jsx(ActionList, {
387
391
  children: menuItems.map(_temp3)
388
392
  })
@@ -691,18 +695,20 @@ const ActionBarGroup = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
691
695
  return t5;
692
696
  });
693
697
  const ActionBarMenu = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
694
- const $ = c(35);
698
+ const $ = c(42);
695
699
  let ariaLabel;
696
700
  let icon;
697
701
  let items;
698
702
  let overflowIcon;
699
703
  let props;
704
+ let returnFocusRef;
700
705
  if ($[0] !== t0) {
701
706
  ({
702
707
  "aria-label": ariaLabel,
703
708
  icon,
704
709
  overflowIcon,
705
710
  items,
711
+ returnFocusRef,
706
712
  ...props
707
713
  } = t0);
708
714
  $[0] = t0;
@@ -711,12 +717,14 @@ const ActionBarMenu = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
711
717
  $[3] = items;
712
718
  $[4] = overflowIcon;
713
719
  $[5] = props;
720
+ $[6] = returnFocusRef;
714
721
  } else {
715
722
  ariaLabel = $[1];
716
723
  icon = $[2];
717
724
  items = $[3];
718
725
  overflowIcon = $[4];
719
726
  props = $[5];
727
+ returnFocusRef = $[6];
720
728
  }
721
729
  const backupRef = useRef(null);
722
730
  const ref = forwardedRef !== null && forwardedRef !== void 0 ? forwardedRef : backupRef;
@@ -729,7 +737,7 @@ const ActionBarMenu = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
729
737
  const [menuOpen, setMenuOpen] = useState(false);
730
738
  const widthRef = useRef();
731
739
  let t1;
732
- if ($[6] !== ariaLabel || $[7] !== icon || $[8] !== id || $[9] !== items || $[10] !== overflowIcon || $[11] !== ref || $[12] !== registerChild || $[13] !== unregisterChild) {
740
+ if ($[7] !== ariaLabel || $[8] !== icon || $[9] !== id || $[10] !== items || $[11] !== overflowIcon || $[12] !== ref || $[13] !== registerChild || $[14] !== returnFocusRef || $[15] !== unregisterChild) {
733
741
  t1 = () => {
734
742
  var _ref$current3;
735
743
  const width = (_ref$current3 = ref.current) === null || _ref$current3 === void 0 ? void 0 : _ref$current3.getBoundingClientRect().width;
@@ -744,43 +752,45 @@ const ActionBarMenu = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
744
752
  width: widthRef.current,
745
753
  label: ariaLabel,
746
754
  icon: overflowIcon ? overflowIcon : icon,
755
+ returnFocusRef,
747
756
  items
748
757
  });
749
758
  return () => {
750
759
  unregisterChild(id);
751
760
  };
752
761
  };
753
- $[6] = ariaLabel;
754
- $[7] = icon;
755
- $[8] = id;
756
- $[9] = items;
757
- $[10] = overflowIcon;
758
- $[11] = ref;
759
- $[12] = registerChild;
760
- $[13] = unregisterChild;
761
- $[14] = t1;
762
- } else {
763
- t1 = $[14];
762
+ $[7] = ariaLabel;
763
+ $[8] = icon;
764
+ $[9] = id;
765
+ $[10] = items;
766
+ $[11] = overflowIcon;
767
+ $[12] = ref;
768
+ $[13] = registerChild;
769
+ $[14] = returnFocusRef;
770
+ $[15] = unregisterChild;
771
+ $[16] = t1;
772
+ } else {
773
+ t1 = $[16];
764
774
  }
765
775
  let t2;
766
- if ($[15] !== ariaLabel || $[16] !== icon || $[17] !== items || $[18] !== overflowIcon || $[19] !== registerChild || $[20] !== unregisterChild) {
776
+ if ($[17] !== ariaLabel || $[18] !== icon || $[19] !== items || $[20] !== overflowIcon || $[21] !== registerChild || $[22] !== unregisterChild) {
767
777
  t2 = [registerChild, unregisterChild, ariaLabel, overflowIcon, icon, items];
768
- $[15] = ariaLabel;
769
- $[16] = icon;
770
- $[17] = items;
771
- $[18] = overflowIcon;
772
- $[19] = registerChild;
773
- $[20] = unregisterChild;
774
- $[21] = t2;
778
+ $[17] = ariaLabel;
779
+ $[18] = icon;
780
+ $[19] = items;
781
+ $[20] = overflowIcon;
782
+ $[21] = registerChild;
783
+ $[22] = unregisterChild;
784
+ $[23] = t2;
775
785
  } else {
776
- t2 = $[21];
786
+ t2 = $[23];
777
787
  }
778
788
  useIsomorphicLayoutEffect(t1, t2);
779
789
  if (!isVisibleChild(id)) {
780
790
  return null;
781
791
  }
782
792
  let t3;
783
- if ($[22] !== ariaLabel || $[23] !== icon || $[24] !== props) {
793
+ if ($[24] !== ariaLabel || $[25] !== icon || $[26] !== props) {
784
794
  t3 = /*#__PURE__*/jsx(ActionMenu.Anchor, {
785
795
  children: /*#__PURE__*/jsx(IconButton, {
786
796
  variant: "invisible",
@@ -789,50 +799,70 @@ const ActionBarMenu = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
789
799
  ...props
790
800
  })
791
801
  });
792
- $[22] = ariaLabel;
793
- $[23] = icon;
794
- $[24] = props;
795
- $[25] = t3;
802
+ $[24] = ariaLabel;
803
+ $[25] = icon;
804
+ $[26] = props;
805
+ $[27] = t3;
796
806
  } else {
797
- t3 = $[25];
807
+ t3 = $[27];
798
808
  }
799
809
  let t4;
800
- if ($[26] !== items) {
801
- t4 = items.map(_temp4);
802
- $[26] = items;
803
- $[27] = t4;
810
+ if ($[28] !== returnFocusRef) {
811
+ t4 = returnFocusRef && {
812
+ returnFocusRef
813
+ };
814
+ $[28] = returnFocusRef;
815
+ $[29] = t4;
804
816
  } else {
805
- t4 = $[27];
817
+ t4 = $[29];
806
818
  }
807
819
  let t5;
808
- if ($[28] !== t4) {
809
- t5 = /*#__PURE__*/jsx(ActionMenu.Overlay, {
810
- children: /*#__PURE__*/jsx(ActionList, {
811
- children: t4
812
- })
813
- });
814
- $[28] = t4;
815
- $[29] = t5;
820
+ if ($[30] !== items) {
821
+ t5 = items.map(_temp4);
822
+ $[30] = items;
823
+ $[31] = t5;
816
824
  } else {
817
- t5 = $[29];
825
+ t5 = $[31];
818
826
  }
819
827
  let t6;
820
- if ($[30] !== menuOpen || $[31] !== ref || $[32] !== t3 || $[33] !== t5) {
821
- t6 = /*#__PURE__*/jsxs(ActionMenu, {
828
+ if ($[32] !== t5) {
829
+ t6 = /*#__PURE__*/jsx(ActionList, {
830
+ children: t5
831
+ });
832
+ $[32] = t5;
833
+ $[33] = t6;
834
+ } else {
835
+ t6 = $[33];
836
+ }
837
+ let t7;
838
+ if ($[34] !== t4 || $[35] !== t6) {
839
+ t7 = /*#__PURE__*/jsx(ActionMenu.Overlay, {
840
+ ...t4,
841
+ children: t6
842
+ });
843
+ $[34] = t4;
844
+ $[35] = t6;
845
+ $[36] = t7;
846
+ } else {
847
+ t7 = $[36];
848
+ }
849
+ let t8;
850
+ if ($[37] !== menuOpen || $[38] !== ref || $[39] !== t3 || $[40] !== t7) {
851
+ t8 = /*#__PURE__*/jsxs(ActionMenu, {
822
852
  anchorRef: ref,
823
853
  open: menuOpen,
824
854
  onOpenChange: setMenuOpen,
825
- children: [t3, t5]
855
+ children: [t3, t7]
826
856
  });
827
- $[30] = menuOpen;
828
- $[31] = ref;
829
- $[32] = t3;
830
- $[33] = t5;
831
- $[34] = t6;
857
+ $[37] = menuOpen;
858
+ $[38] = ref;
859
+ $[39] = t3;
860
+ $[40] = t7;
861
+ $[41] = t8;
832
862
  } else {
833
- t6 = $[34];
863
+ t8 = $[41];
834
864
  }
835
- return t6;
865
+ return t8;
836
866
  });
837
867
  const VerticalDivider = () => {
838
868
  const $ = c(8);
@@ -10,6 +10,7 @@ declare const ActionBar: import("react").FC<import("react").PropsWithChildren<im
10
10
  icon: import("./ActionBar").ActionBarIconButtonProps["icon"];
11
11
  items: import("./ActionBar").ActionBarMenuItemProps[];
12
12
  overflowIcon?: import("./ActionBar").ActionBarIconButtonProps["icon"] | "none";
13
+ returnFocusRef?: React.RefObject<HTMLElement>;
13
14
  } & {
14
15
  'aria-label': string;
15
16
  'aria-labelledby'?: undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ActionBar/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAC,cAAc,EAAE,kBAAkB,EAAE,sBAAsB,EAAC,MAAM,aAAa,CAAA;AAE3F,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;CAKb,CAAA;AAEF,eAAe,SAAS,CAAA;AACxB,OAAO,EAAC,SAAS,EAAC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ActionBar/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAC,cAAc,EAAE,kBAAkB,EAAE,sBAAsB,EAAC,MAAM,aAAa,CAAA;AAE3F,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;CAKb,CAAA;AAEF,eAAe,SAAS,CAAA;AACxB,OAAO,EAAC,SAAS,EAAC,CAAA"}
@@ -1,2 +1,2 @@
1
- *{box-sizing:border-box}body{margin:0}table{border-collapse:collapse}[data-color-mode=light] input{--csstools-color-scheme--light:initial;color-scheme:light}[data-color-mode=dark] input{--csstools-color-scheme--light: ;color-scheme:dark}@media (prefers-color-scheme:light){[data-color-mode=auto][data-light-theme*=light]{--csstools-color-scheme--light:initial;color-scheme:light}}@media (prefers-color-scheme:dark){[data-color-mode=auto][data-dark-theme*=dark]{--csstools-color-scheme--light: ;color-scheme:dark}}[role=button]:focus:not(:focus-visible):not(.focus-visible),[role=tabpanel][tabindex="0"]:focus:not(:focus-visible):not(.focus-visible),a:focus:not(:focus-visible):not(.focus-visible),button:focus:not(:focus-visible):not(.focus-visible),summary:focus:not(:focus-visible):not(.focus-visible){box-shadow:none;outline:none}[tabindex="0"]:focus:not(:focus-visible):not(.focus-visible),details-dialog:focus:not(:focus-visible):not(.focus-visible){outline:none}.prc-src-BaseStyles-aopSS{color:var(--BaseStyles-fgColor,var(--fgColor-default,var(--color-fg-default)));font-family:var(--BaseStyles-fontFamily,var(--fontStack-system,-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"));line-height:var(--BaseStyles-lineHeight,1.5)}input .prc-src-BaseStyles-aopSS:has([data-color-mode=light]){--csstools-color-scheme--light:initial;color-scheme:light}input .prc-src-BaseStyles-aopSS:has([data-color-mode=dark]){--csstools-color-scheme--light: ;color-scheme:dark}.prc-src-BaseStyles-aopSS :where(a:not([class*=prc-]):not([class*=PRC-]):not([class*=Primer_Brand__])){color:var(--fgColor-accent,var(--color-accent-fg));-webkit-text-decoration:none;text-decoration:none}:is(.prc-src-BaseStyles-aopSS :where(a:not([class*=prc-]):not([class*=PRC-]):not([class*=Primer_Brand__]))):hover{-webkit-text-decoration:underline;text-decoration:underline}
2
- /*# sourceMappingURL=BaseStyles-79fd37c4.css.map */
1
+ *{box-sizing:border-box}body{margin:0}table{border-collapse:collapse}[data-color-mode=light] input{--csstools-color-scheme--light:initial;color-scheme:light}[data-color-mode=dark] input{--csstools-color-scheme--light: ;color-scheme:dark}@media (prefers-color-scheme:light){[data-color-mode=auto][data-light-theme*=light]{--csstools-color-scheme--light:initial;color-scheme:light}}@media (prefers-color-scheme:dark){[data-color-mode=auto][data-dark-theme*=dark]{--csstools-color-scheme--light: ;color-scheme:dark}}[role=button]:focus:not(:focus-visible):not(.focus-visible),[role=tabpanel][tabindex="0"]:focus:not(:focus-visible):not(.focus-visible),a:focus:not(:focus-visible):not(.focus-visible),button:focus:not(:focus-visible):not(.focus-visible),summary:focus:not(:focus-visible):not(.focus-visible){box-shadow:none;outline:none}[tabindex="0"]:focus:not(:focus-visible):not(.focus-visible),details-dialog:focus:not(:focus-visible):not(.focus-visible){outline:none}.prc-src-BaseStyles-aopSS{color:var(--BaseStyles-fgColor,var(--fgColor-default,var(--color-fg-default)));font-family:var(--BaseStyles-fontFamily,var(--fontStack-system,-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"));line-height:var(--BaseStyles-lineHeight,1.5)}.prc-src-BaseStyles-aopSS :where(a:not([class*=prc-]):not([class*=PRC-]):not([class*=Primer_Brand__])){color:var(--fgColor-accent,var(--color-accent-fg));-webkit-text-decoration:none;text-decoration:none}:is(.prc-src-BaseStyles-aopSS :where(a:not([class*=prc-]):not([class*=PRC-]):not([class*=Primer_Brand__]))):hover{-webkit-text-decoration:underline;text-decoration:underline}
2
+ /*# sourceMappingURL=BaseStyles-7e59cc50.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["src/BaseStyles.module.css.js"],"names":[],"mappings":"AAMA,EACE,qBACF,CAEA,KACE,QACF,CAEA,MAEE,wBACF,CAEA,8BACE,sCAAmB,CAAnB,kBACF,CAEA,6BACE,gCAAkB,CAAlB,iBACF,CAEA,oCACE,gDACE,sCAAmB,CAAnB,kBACF,CACF,CAEA,mCACE,8CACE,gCAAkB,CAAlB,iBACF,CACF,CAEA,mSAME,eAAgB,CADhB,YAEF,CAEA,0HAEE,YACF,CAIA,0BAKE,8EAAwD,CAJxD,wLAAkE,CAElE,4CAoBF,CARE,uGACE,kDAAoD,CACpD,4BAAqB,CAArB,oBAKF,CAHE,kHACE,iCAA0B,CAA1B,yBACF","file":"BaseStyles-7e59cc50.css","sourcesContent":["/* stylelint-disable selector-max-specificity */\n/* stylelint-disable selector-type-no-unknown */\n\n/* -------------------------------- \n * Global Styles \n *--------------------------------- */\n* {\n box-sizing: border-box;\n}\n\nbody {\n margin: 0;\n}\n\ntable {\n /* stylelint-disable-next-line primer/borders */\n border-collapse: collapse;\n}\n\n[data-color-mode='light'] input {\n color-scheme: light;\n}\n\n[data-color-mode='dark'] input {\n color-scheme: dark;\n}\n\n@media (prefers-color-scheme: light) {\n [data-color-mode='auto'][data-light-theme*='light'] {\n color-scheme: light;\n }\n}\n\n@media (prefers-color-scheme: dark) {\n [data-color-mode='auto'][data-dark-theme*='dark'] {\n color-scheme: dark;\n }\n}\n\n[role='button']:focus:not(:focus-visible):not(:global(.focus-visible)),\n[role='tabpanel'][tabindex='0']:focus:not(:focus-visible):not(:global(.focus-visible)),\nbutton:focus:not(:focus-visible):not(:global(.focus-visible)),\nsummary:focus:not(:focus-visible):not(:global(.focus-visible)),\na:focus:not(:focus-visible):not(:global(.focus-visible)) {\n outline: none;\n box-shadow: none;\n}\n\n[tabindex='0']:focus:not(:focus-visible):not(:global(.focus-visible)),\ndetails-dialog:focus:not(:focus-visible):not(:global(.focus-visible)) {\n outline: none;\n}\n\n/* -------------------------------------------------------------------------- */\n\n.BaseStyles {\n font-family: var(--BaseStyles-fontFamily, var(--fontStack-system));\n /* stylelint-disable-next-line primer/typography */\n line-height: var(--BaseStyles-lineHeight, 1.5);\n /* stylelint-disable-next-line primer/colors */\n color: var(--BaseStyles-fgColor, var(--fgColor-default));\n\n /*\n * PERFORMANCE: Removed :has([data-color-mode]) selectors that scanned entire DOM.\n * Input color-scheme is already handled by global selectors above:\n * [data-color-mode='light'] input { color-scheme: light; }\n * [data-color-mode='dark'] input { color-scheme: dark; }\n */\n\n /* Low-specificity default link styling */\n :where(a:not([class*='prc-']):not([class*='PRC-']):not([class*='Primer_Brand__'])) {\n color: var(--fgColor-accent, var(--color-accent-fg));\n text-decoration: none;\n\n &:hover {\n text-decoration: underline;\n }\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import './BaseStyles-79fd37c4.css';
1
+ import './BaseStyles-7e59cc50.css';
2
2
 
3
3
  var classes = {"BaseStyles":"prc-src-BaseStyles-aopSS"};
4
4
 
@@ -1,2 +1,2 @@
1
- @property --prc-dialog-scrollgutter{initial-value:0;inherits:false;syntax:"<length>"}@keyframes prc-Dialog-dialog-backdrop-appear-tCG2K{0%{opacity:0}to{opacity:1}}@keyframes prc-Dialog-Overlay--motion-scaleFade-mE6-C{0%{opacity:0;transform:scale(.5)}to{opacity:1;transform:scale(1)}}@keyframes prc-Dialog-Overlay--motion-slideUp-tPElO{0%{transform:translateY(100%)}}@keyframes prc-Dialog-Overlay--motion-slideInRight-BR-CZ{0%{transform:translateX(-100%)}}@keyframes prc-Dialog-Overlay--motion-slideInLeft-ISmQZ{0%{transform:translateX(100%)}}@keyframes prc-Dialog-detect-scroll-b3i8Q{0%,to{--can-scroll:1}}.prc-Dialog-Backdrop-5Nt2U{animation:prc-Dialog-dialog-backdrop-appear-tCG2K .2s cubic-bezier(.33,1,.68,1);background-color:var(--overlay-backdrop-bgColor,var(--color-overlay-backdrop));bottom:0;display:flex;left:0;position:fixed;right:0;top:0}.prc-Dialog-Backdrop-5Nt2U,.prc-Dialog-Backdrop-5Nt2U[data-position-regular=center]{align-items:center;justify-content:center}.prc-Dialog-Backdrop-5Nt2U[data-position-regular=left]{align-items:center;justify-content:flex-start}.prc-Dialog-Backdrop-5Nt2U[data-position-regular=right]{align-items:center;justify-content:flex-end}@media (max-width:767px){.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=center]{align-items:center;justify-content:center}.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=bottom]{align-items:end;justify-content:center}}.prc-Dialog-Dialog-G8cDF{background-color:var(--overlay-bgColor,var(--color-canvas-overlay));border-radius:var(--borderRadius-large,.75rem);border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));box-shadow:var(--shadow-floating-small,var(--color-overlay-shadow));display:flex;flex-direction:column;height:auto;max-height:calc(100dvh - 64px);max-width:calc(100dvw - 64px);min-width:296px;opacity:1;width:640px}.prc-Dialog-Dialog-G8cDF:where([data-width=small]){width:296px}.prc-Dialog-Dialog-G8cDF:where([data-width=medium]){width:320px}.prc-Dialog-Dialog-G8cDF:where([data-width=large]){width:480px}.prc-Dialog-Dialog-G8cDF:where([data-height=small]){height:480px}.prc-Dialog-Dialog-G8cDF:where([data-height=large]){height:640px}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=center]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem))}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=center]{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=left]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-left-radius:0;border-top-left-radius:0;height:100dvh;max-height:unset}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=left]{animation:prc-Dialog-Overlay--motion-slideInRight-BR-CZ .25s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=right]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-right-radius:0;border-top-right-radius:0;height:100dvh;max-height:unset}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=right]{animation:prc-Dialog-Overlay--motion-slideInLeft-ISmQZ .25s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}@media (max-width:767px){.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));height:auto;width:640px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=small]){width:296px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=medium]){width:320px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=large]){width:480px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-height=small]){height:480px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-height=large]){height:640px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=bottom]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-left-radius:0;border-bottom-right-radius:0;height:auto;max-height:calc(100dvh - 64px);max-width:100dvw;width:100dvw}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-narrow=bottom]{animation:prc-Dialog-Overlay--motion-slideUp-tPElO .25s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-narrow=fullscreen]{border-radius:unset!important;flex-grow:1;height:100%;max-height:100dvh;max-width:100dvw;width:100%}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-narrow=fullscreen]{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}}body:has(.prc-Dialog-Dialog-G8cDF.prc-Dialog-DisableScroll-UkWFM){overflow:hidden!important;padding-right:var(--prc-dialog-scrollgutter)!important}.prc-Dialog-DialogOverflowWrapper-JvHzz{flex-grow:1}.prc-Dialog-Dialog-G8cDF:has(.prc-Dialog-Footer-PMeQk){--can-scroll:0}.prc-Dialog-Dialog-G8cDF:has(.prc-Dialog-Footer-PMeQk) .prc-Dialog-DialogOverflowWrapper-JvHzz{animation:prc-Dialog-detect-scroll-b3i8Q;border-bottom:var(--borderWidth-default,.0625rem) solid var(--borderColor-default,var(--color-border-default));animation-timeline:scroll(self)}@supports (animation-timeline:scroll(self)){.prc-Dialog-Dialog-G8cDF:has(.prc-Dialog-Footer-PMeQk) .prc-Dialog-DialogOverflowWrapper-JvHzz{border-bottom:calc(var(--borderWidth-thin,.0625rem)*var(--can-scroll)) solid var(--borderColor-default,var(--color-border-default))}}.prc-Dialog-Header-f7Me-{box-shadow:0 1px 0 var(--borderColor-default,var(--color-border-default));flex-shrink:0;max-height:35vh;overflow-y:auto;padding:var(--base-size-8,.5rem);z-index:1}.prc-Dialog-HeaderInner-H-fFY{display:flex}.prc-Dialog-HeaderContent-mjAsn{display:flex;flex-direction:column;flex-grow:1;padding-block:var(--base-size-6,.375rem);padding-inline:var(--base-size-8,.5rem)}.prc-Dialog-Title-M-iPn{font-size:var(--text-body-size-medium,.875rem);font-weight:var(--text-title-weight-large,600);margin:0}.prc-Dialog-Subtitle-aBFSq{color:var(--fgColor-muted,var(--color-fg-muted));font-size:var(--text-body-size-small,.75rem);font-weight:var(--base-text-weight-normal,400);margin:0;margin-top:var(--base-size-4,.25rem)}.prc-Dialog-Body-bB903{flex-grow:1;overflow:auto}.prc-Dialog-Body-bB903,.prc-Dialog-Footer-PMeQk{padding:var(--base-size-16,1rem)}.prc-Dialog-Footer-PMeQk{display:flex;flex-flow:wrap;flex-shrink:0;gap:var(--base-size-8,.5rem);justify-content:flex-end;z-index:1}@media (max-height:325px){.prc-Dialog-Footer-PMeQk{flex-direction:row;flex-wrap:nowrap;justify-content:unset;overflow-x:scroll}}
2
- /*# sourceMappingURL=Dialog-1a61e61a.css.map */
1
+ @property --prc-dialog-scrollgutter{initial-value:0;inherits:false;syntax:"<length>"}@keyframes prc-Dialog-dialog-backdrop-appear-tCG2K{0%{opacity:0}to{opacity:1}}@keyframes prc-Dialog-Overlay--motion-scaleFade-mE6-C{0%{opacity:0;transform:scale(.5)}to{opacity:1;transform:scale(1)}}@keyframes prc-Dialog-Overlay--motion-slideUp-tPElO{0%{transform:translateY(100%)}}@keyframes prc-Dialog-Overlay--motion-slideInRight-BR-CZ{0%{transform:translateX(-100%)}}@keyframes prc-Dialog-Overlay--motion-slideInLeft-ISmQZ{0%{transform:translateX(100%)}}@keyframes prc-Dialog-detect-scroll-b3i8Q{0%,to{--can-scroll:1}}.prc-Dialog-Backdrop-5Nt2U{animation:prc-Dialog-dialog-backdrop-appear-tCG2K .2s cubic-bezier(.33,1,.68,1);background-color:var(--overlay-backdrop-bgColor,var(--color-overlay-backdrop));bottom:0;display:flex;left:0;position:fixed;right:0;top:0}.prc-Dialog-Backdrop-5Nt2U,.prc-Dialog-Backdrop-5Nt2U[data-position-regular=center]{align-items:center;justify-content:center}.prc-Dialog-Backdrop-5Nt2U[data-position-regular=left]{align-items:center;justify-content:flex-start}.prc-Dialog-Backdrop-5Nt2U[data-position-regular=right]{align-items:center;justify-content:flex-end}@media (max-width:767px){.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=center]{align-items:center;justify-content:center}.prc-Dialog-Backdrop-5Nt2U[data-position-narrow=bottom]{align-items:end;justify-content:center}}.prc-Dialog-Dialog-G8cDF{background-color:var(--overlay-bgColor,var(--color-canvas-overlay));border-radius:var(--borderRadius-large,.75rem);border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));box-shadow:var(--shadow-floating-small,var(--color-overlay-shadow));display:flex;flex-direction:column;height:auto;max-height:calc(100dvh - 64px);max-width:calc(100dvw - 64px);min-width:296px;opacity:1;width:640px}.prc-Dialog-Dialog-G8cDF:where([data-width=small]){width:296px}.prc-Dialog-Dialog-G8cDF:where([data-width=medium]){width:320px}.prc-Dialog-Dialog-G8cDF:where([data-width=large]){width:480px}.prc-Dialog-Dialog-G8cDF:where([data-height=small]){height:480px}.prc-Dialog-Dialog-G8cDF:where([data-height=large]){height:640px}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=center]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem))}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=center]{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=left]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-left-radius:0;border-top-left-radius:0;height:100dvh;max-height:unset}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=left]{animation:prc-Dialog-Overlay--motion-slideInRight-BR-CZ .25s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-regular=right]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-right-radius:0;border-top-right-radius:0;height:100dvh;max-height:unset}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-regular=right]{animation:prc-Dialog-Overlay--motion-slideInLeft-ISmQZ .25s cubic-bezier(.33,1,.68,1) 0s 1 normal none running}}@media (max-width:767px){.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));height:auto;width:640px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=small]){width:296px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=medium]){width:320px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-width=large]){width:480px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-height=small]){height:480px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=center]:where([data-height=large]){height:640px}.prc-Dialog-Dialog-G8cDF[data-position-narrow=bottom]{border-radius:var(--borderRadius-large,var(--borderRadius-large,.75rem));border-bottom-left-radius:0;border-bottom-right-radius:0;height:auto;max-height:calc(100dvh - 64px);max-width:100dvw;width:100dvw}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-narrow=bottom]{animation:prc-Dialog-Overlay--motion-slideUp-tPElO .25s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}.prc-Dialog-Dialog-G8cDF[data-position-narrow=fullscreen]{border-radius:unset!important;flex-grow:1;height:100%;max-height:100dvh;max-width:100dvw;width:100%}@media screen and (prefers-reduced-motion:no-preference){.prc-Dialog-Dialog-G8cDF[data-position-narrow=fullscreen]{animation:prc-Dialog-Overlay--motion-scaleFade-mE6-C .2s cubic-bezier(.33,1,.68,1) 1ms 1 normal none running}}}body:not([data-dialog-scroll-optimized]):has(.prc-Dialog-Dialog-G8cDF.prc-Dialog-DisableScroll-UkWFM){overflow:hidden!important;padding-right:var(--prc-dialog-scrollgutter)!important}body[data-dialog-scroll-disabled]{overflow:hidden!important;padding-right:var(--prc-dialog-scrollgutter)!important}.prc-Dialog-DialogOverflowWrapper-JvHzz{flex-grow:1}.prc-Dialog-Dialog-G8cDF:has(.prc-Dialog-Footer-PMeQk){--can-scroll:0}.prc-Dialog-Dialog-G8cDF:has(.prc-Dialog-Footer-PMeQk) .prc-Dialog-DialogOverflowWrapper-JvHzz{animation:prc-Dialog-detect-scroll-b3i8Q;border-bottom:var(--borderWidth-default,.0625rem) solid var(--borderColor-default,var(--color-border-default));animation-timeline:scroll(self)}@supports (animation-timeline:scroll(self)){.prc-Dialog-Dialog-G8cDF:has(.prc-Dialog-Footer-PMeQk) .prc-Dialog-DialogOverflowWrapper-JvHzz{border-bottom:calc(var(--borderWidth-thin,.0625rem)*var(--can-scroll)) solid var(--borderColor-default,var(--color-border-default))}}.prc-Dialog-Header-f7Me-{box-shadow:0 1px 0 var(--borderColor-default,var(--color-border-default));flex-shrink:0;max-height:35vh;overflow-y:auto;padding:var(--base-size-8,.5rem);z-index:1}.prc-Dialog-HeaderInner-H-fFY{display:flex}.prc-Dialog-HeaderContent-mjAsn{display:flex;flex-direction:column;flex-grow:1;padding-block:var(--base-size-6,.375rem);padding-inline:var(--base-size-8,.5rem)}.prc-Dialog-Title-M-iPn{font-size:var(--text-body-size-medium,.875rem);font-weight:var(--text-title-weight-large,600);margin:0}.prc-Dialog-Subtitle-aBFSq{color:var(--fgColor-muted,var(--color-fg-muted));font-size:var(--text-body-size-small,.75rem);font-weight:var(--base-text-weight-normal,400);margin:0;margin-top:var(--base-size-4,.25rem)}.prc-Dialog-Body-bB903{flex-grow:1;overflow:auto}.prc-Dialog-Body-bB903,.prc-Dialog-Footer-PMeQk{padding:var(--base-size-16,1rem)}.prc-Dialog-Footer-PMeQk{display:flex;flex-flow:wrap;flex-shrink:0;gap:var(--base-size-8,.5rem);justify-content:flex-end;z-index:1}@media (max-height:325px){.prc-Dialog-Footer-PMeQk{flex-direction:row;flex-wrap:nowrap;justify-content:unset;overflow-x:scroll}}
2
+ /*# sourceMappingURL=Dialog-92b5e3b7.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/Dialog/Dialog.module.css.js"],"names":[],"mappings":"AAOA,oCACE,eAAgB,CAChB,cAAe,CACf,iBACF,CAEA,mDACE,GACE,SACF,CAEA,GACE,SACF,CACF,CAEA,sDACE,GACE,SAAU,CACV,mBACF,CAEA,GACE,SAAU,CACV,kBACF,CACF,CAEA,oDACE,GACE,0BACF,CACF,CAEA,yDACE,GACE,2BACF,CACF,CAEA,wDACE,GACE,0BACF,CACF,CAGA,0CACE,MAEE,cACF,CACF,CAEA,2BAQE,+EAAsE,CADtE,8EAAiD,CAHjD,QAAS,CAET,YAAa,CADb,MAAO,CAJP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,kCAGE,yBAA2B,CAD3B,sDAEF,CAEA,wCACE,WACF,CAQA,uDACE,cAYF,CAVE,+FAGE,wCAAwB,CADxB,8GAA0E,CAE1E,+BAKF,CAHE,4CANF,+FAOI,mIAEJ,CADE,CAIJ,yBAME,yEAA8C,CAC9C,aAAc,CALd,eAAgB,CAEhB,eAAgB,CADhB,gCAA2B,CAF3B,SAOF,CAEA,8BACE,YACF,CAEA,gCACE,YAAa,CAGb,qBAAsB,CACtB,WAAY,CAFZ,wCAAiC,CADjC,uCAIF,CAEA,wBAEE,8CAAuC,CACvC,8CAA2C,CAF3C,QAGF,CAEA,2BAKE,gDAA2B,CAF3B,4CAAsC,CACtC,8CAA2C,CAH3C,QAAS,CACT,oCAIF,CAEA,uBAGE,WAAY,CADZ,aAEF,CAEA,gDALE,gCAoBF,CAfA,yBAEE,YAAa,CACb,cAAe,CAIf,aAAc,CADd,4BAAuB,CAFvB,wBAAyB,CAHzB,SAcF,CANE,0BATF,yBAYI,kBAAmB,CAFnB,gBAAiB,CAGjB,qBAAsB,CAFtB,iBAIJ,CADE","file":"Dialog-92b5e3b7.css","sourcesContent":["/* The --prc-dialog-scrollgutter property is used only on the body element to\n * simulate scrollbar-gutter:stable. This property is not and should not\n * be used elsewhere in the DOM. There is a performance penalty to\n * setting inherited properties which can cause a large style recalc to\n * occur, so it benefits us to prevent inheritance for this property.\n * See https://web.dev/blog/at-property-performance\n */\n@property --prc-dialog-scrollgutter {\n initial-value: 0;\n inherits: false;\n syntax: '<length>';\n}\n\n@keyframes dialog-backdrop-appear {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n@keyframes Overlay--motion-scaleFade {\n 0% {\n opacity: 0;\n transform: scale(0.5);\n }\n\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n}\n\n@keyframes Overlay--motion-slideUp {\n from {\n transform: translateY(100%);\n }\n}\n\n@keyframes Overlay--motion-slideInRight {\n from {\n transform: translateX(-100%);\n }\n}\n\n@keyframes Overlay--motion-slideInLeft {\n from {\n transform: translateX(100%);\n }\n}\n\n/* Used to determine whether there should be a border between the body and footer */\n@keyframes detect-scroll {\n from,\n to {\n --can-scroll: 1;\n }\n}\n\n.Backdrop {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n display: flex;\n background-color: var(--overlay-backdrop-bgColor);\n animation: dialog-backdrop-appear 200ms cubic-bezier(0.33, 1, 0.68, 1);\n align-items: center;\n justify-content: center;\n\n &[data-position-regular='center'] {\n align-items: center;\n justify-content: center;\n }\n\n &[data-position-regular='left'] {\n align-items: center;\n justify-content: flex-start;\n }\n\n &[data-position-regular='right'] {\n align-items: center;\n justify-content: flex-end;\n }\n\n @media (max-width: 767px) {\n &[data-position-narrow='center'] {\n align-items: center;\n justify-content: center;\n }\n\n &[data-position-narrow='bottom'] {\n align-items: end;\n justify-content: center;\n }\n }\n}\n\n.Dialog {\n display: flex;\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 640px;\n min-width: 296px;\n max-width: calc(100dvw - 64px);\n height: auto;\n max-height: calc(100dvh - 64px);\n flex-direction: column;\n background-color: var(--overlay-bgColor);\n border-radius: var(--borderRadius-large);\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n box-shadow: var(--shadow-floating-small);\n opacity: 1;\n\n &:where([data-width='small']) {\n width: 296px;\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-height='small']) {\n height: 480px;\n }\n\n &:where([data-height='large']) {\n height: 640px;\n }\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-scaleFade 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n\n &[data-position-regular='center'] {\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-scaleFade 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n }\n\n &[data-position-regular='left'] {\n height: 100dvh;\n max-height: unset;\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-slideInRight 0.25s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n }\n\n &[data-position-regular='right'] {\n height: 100dvh;\n max-height: unset;\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-slideInLeft 0.25s cubic-bezier(0.33, 1, 0.68, 1) 0s 1 normal none running;\n }\n }\n\n @media (max-width: 767px) {\n &[data-position-narrow='center'] {\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 640px;\n height: auto;\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n\n &:where([data-width='small']) {\n width: 296px;\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-height='small']) {\n height: 480px;\n }\n\n &:where([data-height='large']) {\n height: 640px;\n }\n }\n\n &[data-position-narrow='bottom'] {\n width: 100dvw;\n max-width: 100dvw;\n height: auto;\n max-height: calc(100dvh - 64px);\n border-radius: var(--borderRadius-large, var(--borderRadius-large));\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-slideUp 0.25s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n }\n\n &[data-position-narrow='fullscreen'] {\n width: 100%;\n max-width: 100dvw;\n height: 100%;\n max-height: 100dvh;\n border-radius: unset !important;\n flex-grow: 1;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: Overlay--motion-scaleFade 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;\n }\n }\n }\n}\n\n/* DisableScroll class is added to Dialog when scroll should be disabled on body */\n.DisableScroll {\n /* This class is used as a selector target for the legacy :has() CSS selector */\n}\n\n/*\n * LEGACY: Scoped :has() selector with negation guard\n * Only evaluates when data-dialog-scroll-optimized is NOT present on body.\n * When the attribute IS present (flag ON), browser skips :has() evaluation\n * because the :not() check fails first (O(1) attribute lookup).\n */\nbody:not([data-dialog-scroll-optimized]):has(.Dialog.DisableScroll) {\n /* stylelint-disable-next-line primer/spacing */\n padding-right: var(--prc-dialog-scrollgutter) !important;\n overflow: hidden !important;\n}\n\n/*\n * PERFORMANCE OPTIMIZATION: Direct attribute on body - O(1) lookup\n * Active when primer_react_css_has_selector_perf flag is ON\n */\n/* stylelint-disable-next-line selector-no-qualifying-type */\nbody[data-dialog-scroll-disabled] {\n /* stylelint-disable-next-line primer/spacing */\n padding-right: var(--prc-dialog-scrollgutter) !important;\n overflow: hidden !important;\n}\n\n.DialogOverflowWrapper {\n flex-grow: 1;\n}\n\n/*\nAdd a border between the body and footer if:\n- the dialog has a footer\n- the dialog has a body that can scroll\n- the browser supports the `animation-timeline` property and its `scroll()` function\n*/\n.Dialog:has(.Footer) {\n --can-scroll: 0;\n\n .DialogOverflowWrapper {\n /* If the browser does not support the `animation-timeline` property, always show a border */\n border-bottom: var(--borderWidth-default) solid var(--borderColor-default);\n animation: detect-scroll;\n animation-timeline: scroll(self);\n\n @supports (animation-timeline: scroll(self)) {\n border-bottom: calc(var(--borderWidth-thin) * var(--can-scroll)) solid var(--borderColor-default);\n }\n }\n}\n\n.Header {\n z-index: 1;\n max-height: 35vh;\n padding: var(--base-size-8);\n overflow-y: auto;\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: 0 1px 0 var(--borderColor-default);\n flex-shrink: 0;\n}\n\n.HeaderInner {\n display: flex;\n}\n\n.HeaderContent {\n display: flex;\n padding-inline: var(--base-size-8);\n padding-block: var(--base-size-6);\n flex-direction: column;\n flex-grow: 1;\n}\n\n.Title {\n margin: 0; /* override default margin */\n font-size: var(--text-body-size-medium);\n font-weight: var(--text-title-weight-large);\n}\n\n.Subtitle {\n margin: 0; /* override default margin */\n margin-top: var(--base-size-4);\n font-size: var(--text-body-size-small);\n font-weight: var(--base-text-weight-normal);\n color: var(--fgColor-muted);\n}\n\n.Body {\n padding: var(--base-size-16);\n overflow: auto;\n flex-grow: 1;\n}\n\n.Footer {\n z-index: 1;\n display: flex;\n flex-flow: wrap;\n justify-content: flex-end;\n padding: var(--base-size-16);\n gap: var(--base-size-8);\n flex-shrink: 0;\n\n @media (max-height: 325px) {\n flex-wrap: nowrap;\n overflow-x: scroll;\n flex-direction: row;\n justify-content: unset;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAA;AAC1F,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,WAAW,CAAA;AAW1C,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAChE,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAQ/F;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,GAAG;IAC7D;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAA;IAExD;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,SAAS,CAAA;IAExB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;;OAGG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;CAChD,CAAA;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,KAAK,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A,MAAM,SAAS;;;;CAIL,CAAA;AAGV,QAAA,MAAM,QAAQ;;;;;CAKJ,CAAA;AAEV,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,QAAQ,CAAA;AAC/C,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,SAAS,CAAA;AA+RjD,eAAO,MAAM,MAAM;;;;;;;;;;iBAhEuC,iBAAiB,EAAE;;;iBAkCf,MAAM,IAAI;;CAuCtE,CAAA"}
@@ -216,13 +216,29 @@ const _Dialog = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
216
216
  event.preventDefault();
217
217
  }, [onClose]);
218
218
  React.useEffect(() => {
219
- var _dialogRef$current;
220
219
  const scrollbarWidth = window.innerWidth - document.body.clientWidth;
221
- // If the dialog is rendered, we add a class to the dialog element to disable
222
- (_dialogRef$current = dialogRef.current) === null || _dialogRef$current === void 0 ? void 0 : _dialogRef$current.classList.add(classes.DisableScroll);
223
- // and set a CSS variable to the scrollbar width so that the dialog can
224
- // account for the scrollbar width when calculating its width.
220
+ const dialog = dialogRef.current;
221
+ const usePerfOptimization = document.body.hasAttribute('data-dialog-scroll-optimized');
222
+
223
+ // Add DisableScroll class to this dialog (for legacy :has() selector path)
224
+ dialog === null || dialog === void 0 ? void 0 : dialog.classList.add(classes.DisableScroll);
225
225
  document.body.style.setProperty('--prc-dialog-scrollgutter', `${scrollbarWidth}px`);
226
+ if (usePerfOptimization) {
227
+ // Optimized path: set attribute on body for direct CSS targeting
228
+ document.body.setAttribute('data-dialog-scroll-disabled', '');
229
+ }
230
+ // Legacy path: no action needed - CSS :has(.Dialog.DisableScroll) handles it
231
+
232
+ return () => {
233
+ dialog === null || dialog === void 0 ? void 0 : dialog.classList.remove(classes.DisableScroll);
234
+ const remainingDialogs = document.querySelectorAll(`.${classes.DisableScroll}`);
235
+ if (remainingDialogs.length === 0) {
236
+ document.body.style.removeProperty('--prc-dialog-scrollgutter');
237
+ if (usePerfOptimization) {
238
+ document.body.removeAttribute('data-dialog-scroll-disabled');
239
+ }
240
+ }
241
+ };
226
242
  }, []);
227
243
  const header = (_slots$header = slots.header) !== null && _slots$header !== void 0 ? _slots$header : (renderHeader !== null && renderHeader !== void 0 ? renderHeader : DefaultHeader)(defaultedProps);
228
244
  const body = (_slots$body = slots.body) !== null && _slots$body !== void 0 ? _slots$body : (renderBody !== null && renderBody !== void 0 ? renderBody : DefaultBody)({
@@ -1,4 +1,4 @@
1
- import './Dialog-1a61e61a.css';
1
+ import './Dialog-92b5e3b7.css';
2
2
 
3
3
  var classes = {"Backdrop":"prc-Dialog-Backdrop-5Nt2U","dialog-backdrop-appear":"prc-Dialog-dialog-backdrop-appear-tCG2K","Dialog":"prc-Dialog-Dialog-G8cDF","Overlay--motion-scaleFade":"prc-Dialog-Overlay--motion-scaleFade-mE6-C","Overlay--motion-slideInRight":"prc-Dialog-Overlay--motion-slideInRight-BR-CZ","Overlay--motion-slideInLeft":"prc-Dialog-Overlay--motion-slideInLeft-ISmQZ","Overlay--motion-slideUp":"prc-Dialog-Overlay--motion-slideUp-tPElO","DisableScroll":"prc-Dialog-DisableScroll-UkWFM","DialogOverflowWrapper":"prc-Dialog-DialogOverflowWrapper-JvHzz","Footer":"prc-Dialog-Footer-PMeQk","detect-scroll":"prc-Dialog-detect-scroll-b3i8Q","Header":"prc-Dialog-Header-f7Me-","HeaderInner":"prc-Dialog-HeaderInner-H-fFY","HeaderContent":"prc-Dialog-HeaderContent-mjAsn","Title":"prc-Dialog-Title-M-iPn","Subtitle":"prc-Dialog-Subtitle-aBFSq","Body":"prc-Dialog-Body-bB903"};
4
4
 
@@ -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,kBAQ9B,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,kBAS9B,CAAA"}
@@ -3,6 +3,7 @@ import { FeatureFlagScope } from './FeatureFlagScope.js';
3
3
  const DefaultFeatureFlags = FeatureFlagScope.create({
4
4
  primer_react_action_list_item_as_button: false,
5
5
  primer_react_breadcrumbs_overflow_menu: false,
6
+ primer_react_css_has_selector_perf: false,
6
7
  primer_react_overlay_overflow: false,
7
8
  primer_react_select_panel_fullscreen_on_narrow: false,
8
9
  primer_react_select_panel_order_selected_at_top: false,
@@ -3,5 +3,11 @@ import { type FeatureFlags } from './FeatureFlagScope';
3
3
  export type FeatureFlagsProps = React.PropsWithChildren<{
4
4
  flags: FeatureFlags;
5
5
  }>;
6
+ /**
7
+ * Reset the ref count for testing purposes only.
8
+ *
9
+ * @internal - Not part of the public API. Only exported for test isolation.
10
+ */
11
+ export declare function __resetDialogScrollOptimizedCount(): void;
6
12
  export declare function FeatureFlags({ children, flags }: FeatureFlagsProps): React.JSX.Element;
7
13
  //# sourceMappingURL=FeatureFlags.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FeatureFlags.d.ts","sourceRoot":"","sources":["../../src/FeatureFlags/FeatureFlags.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAAmB,KAAK,YAAY,EAAC,MAAM,oBAAoB,CAAA;AAEtE,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,iBAAiB,CAAC;IACtD,KAAK,EAAE,YAAY,CAAA;CACpB,CAAC,CAAA;AAEF,wBAAgB,YAAY,CAAC,EAAC,QAAQ,EAAE,KAAK,EAAC,EAAE,iBAAiB,qBAOhE"}
1
+ {"version":3,"file":"FeatureFlags.d.ts","sourceRoot":"","sources":["../../src/FeatureFlags/FeatureFlags.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAAmB,KAAK,YAAY,EAAC,MAAM,oBAAoB,CAAA;AAGtE,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,iBAAiB,CAAC;IACtD,KAAK,EAAE,YAAY,CAAA;CACpB,CAAC,CAAA;AAcF;;;;GAIG;AACH,wBAAgB,iCAAiC,IAAI,IAAI,CAGxD;AAED,wBAAgB,YAAY,CAAC,EAAC,QAAQ,EAAE,KAAK,EAAC,EAAE,iBAAiB,qBAyBhE"}
@@ -1,40 +1,49 @@
1
- import { c } from 'react-compiler-runtime';
2
- import { useContext } from 'react';
1
+ import { useContext, useMemo } from 'react';
3
2
  import { FeatureFlagContext } from './FeatureFlagContext.js';
4
3
  import { FeatureFlagScope } from './FeatureFlagScope.js';
4
+ import useIsomorphicLayoutEffect from '../utils/useIsomorphicLayoutEffect.js';
5
5
  import { jsx } from 'react/jsx-runtime';
6
6
 
7
- function FeatureFlags(t0) {
8
- const $ = c(6);
9
- const {
10
- children,
11
- flags
12
- } = t0;
7
+ /**
8
+ * Ref count for data-dialog-scroll-optimized attribute management.
9
+ *
10
+ * NOTE: This is temporary infrastructure while we feature flag the CSS :has()
11
+ * performance optimization (primer_react_css_has_selector_perf). Once the flag
12
+ * is removed and the optimization is the default behavior, this ref counting
13
+ * can be removed - the attribute can simply always be present.
14
+ *
15
+ * @internal - Not part of the public API
16
+ */
17
+ let dialogScrollOptimizedCount = 0;
18
+ function FeatureFlags({
19
+ children,
20
+ flags
21
+ }) {
13
22
  const parentFeatureFlags = useContext(FeatureFlagContext);
14
- let t1;
15
- if ($[0] !== flags || $[1] !== parentFeatureFlags) {
16
- t1 = FeatureFlagScope.merge(parentFeatureFlags, FeatureFlagScope.create(flags));
17
- $[0] = flags;
18
- $[1] = parentFeatureFlags;
19
- $[2] = t1;
20
- } else {
21
- t1 = $[2];
22
- }
23
- const scope = t1;
24
- const value = scope;
25
- let t2;
26
- if ($[3] !== children || $[4] !== value) {
27
- t2 = /*#__PURE__*/jsx(FeatureFlagContext.Provider, {
28
- value: value,
29
- children: children
30
- });
31
- $[3] = children;
32
- $[4] = value;
33
- $[5] = t2;
34
- } else {
35
- t2 = $[5];
36
- }
37
- return t2;
23
+ const value = useMemo(() => {
24
+ const scope = FeatureFlagScope.merge(parentFeatureFlags, FeatureFlagScope.create(flags));
25
+ return scope;
26
+ }, [parentFeatureFlags, flags]);
27
+ const isOptimizationEnabled = value.enabled('primer_react_css_has_selector_perf');
28
+
29
+ // Set body attribute for CSS :has() optimization when flag is enabled
30
+ useIsomorphicLayoutEffect(() => {
31
+ if (isOptimizationEnabled) {
32
+ dialogScrollOptimizedCount++;
33
+ document.body.setAttribute('data-dialog-scroll-optimized', '');
34
+ return () => {
35
+ dialogScrollOptimizedCount--;
36
+ if (dialogScrollOptimizedCount === 0) {
37
+ document.body.removeAttribute('data-dialog-scroll-optimized');
38
+ }
39
+ };
40
+ }
41
+ }, [isOptimizationEnabled]);
42
+ return /*#__PURE__*/jsx(FeatureFlagContext.Provider, {
43
+ value: value,
44
+ children: children
45
+ });
38
46
  }
47
+ FeatureFlags.displayName = "FeatureFlags";
39
48
 
40
49
  export { FeatureFlags };