@primer/react 38.26.1-rc.6a367a51e → 38.27.0-rc.040f4cc18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/CHANGELOG.md +19 -1
  2. package/dist/Dialog/Dialog.d.ts +1 -0
  3. package/dist/Dialog/Dialog.d.ts.map +1 -1
  4. package/dist/Dialog/Dialog.js +16 -2
  5. package/dist/KeybindingHint/KeybindingHint.d.ts +6 -1
  6. package/dist/KeybindingHint/KeybindingHint.d.ts.map +1 -1
  7. package/dist/KeybindingHint/KeybindingHint.js +6 -2
  8. package/dist/KeybindingHint/components/Chord.d.ts +2 -1
  9. package/dist/KeybindingHint/components/Chord.d.ts.map +1 -1
  10. package/dist/KeybindingHint/components/Chord.js +1 -1
  11. package/dist/KeybindingHint/components/Key.js +10 -10
  12. package/dist/KeybindingHint/components/Sequence.d.ts +2 -1
  13. package/dist/KeybindingHint/components/Sequence.d.ts.map +1 -1
  14. package/dist/KeybindingHint/components/Sequence.js +2 -2
  15. package/dist/KeybindingHint/key-names.d.ts +4 -3
  16. package/dist/KeybindingHint/key-names.d.ts.map +1 -1
  17. package/dist/KeybindingHint/key-names.js +15 -14
  18. package/dist/KeybindingHint/platform.d.ts +22 -0
  19. package/dist/KeybindingHint/platform.d.ts.map +1 -0
  20. package/dist/KeybindingHint/platform.js +61 -0
  21. package/dist/PageLayout/PageLayout.d.ts +24 -6
  22. package/dist/PageLayout/PageLayout.d.ts.map +1 -1
  23. package/dist/PageLayout/PageLayout.js +7 -2
  24. package/dist/Text/{Text-ca7603b7.css → Text-d649cda5.css} +2 -2
  25. package/dist/Text/Text-d649cda5.css.map +1 -0
  26. package/dist/Text/Text.d.ts +3 -0
  27. package/dist/Text/Text.d.ts.map +1 -1
  28. package/dist/Text/Text.js +20 -14
  29. package/dist/Text/Text.module.css.js +1 -1
  30. package/dist/Timeline/Timeline.d.ts +2 -1
  31. package/dist/Timeline/Timeline.d.ts.map +1 -1
  32. package/dist/TooltipV2/Tooltip.d.ts.map +1 -1
  33. package/dist/TooltipV2/Tooltip.js +3 -3
  34. package/dist/TreeView/TreeView-1bf45a33.css +2 -0
  35. package/dist/TreeView/TreeView-1bf45a33.css.map +1 -0
  36. package/dist/TreeView/TreeView.d.ts.map +1 -1
  37. package/dist/TreeView/TreeView.js +25 -12
  38. package/dist/TreeView/TreeView.module.css.js +2 -2
  39. package/generated/components.json +57 -10
  40. package/package.json +1 -1
  41. package/dist/Text/Text-ca7603b7.css.map +0 -1
  42. package/dist/TreeView/TreeView-0fe09f34.css +0 -2
  43. package/dist/TreeView/TreeView-0fe09f34.css.map +0 -1
  44. package/dist/hooks/useIsMacOS.js +0 -32
package/CHANGELOG.md CHANGED
@@ -1,11 +1,29 @@
1
1
  # @primer/react
2
2
 
3
- ## 38.26.1
3
+ ## 38.27.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#7900](https://github.com/primer/react/pull/7900) [`49a546f`](https://github.com/primer/react/commit/49a546fcb3901c139a3abe8f1daea7b5f3427f5d) Thanks [@mattcosta7](https://github.com/mattcosta7)! - `PageLayout.Sidebar` (and `SplitPageLayout.Sidebar`): add controlled-width support via `currentWidth` + `onResizeEnd`, matching the discriminated-union API already on `PageLayout.Pane`. The underlying `usePaneWidth` hook already supported these options; this wires them through the component's prop surface. Existing usage is unchanged — the props are opt-in and the uncontrolled (default or `widthStorageKey`-backed) behavior is preserved exactly.
8
+
9
+ - [#7906](https://github.com/primer/react/pull/7906) [`adc5299`](https://github.com/primer/react/commit/adc5299f3d98519119fb9547e50dd2985fc96174) Thanks [@jonrohan](https://github.com/jonrohan)! - Text: Add `whiteSpace` prop to control the CSS `white-space` property
4
10
 
5
11
  ### Patch Changes
6
12
 
13
+ - [#7915](https://github.com/primer/react/pull/7915) [`f58e448`](https://github.com/primer/react/commit/f58e448961df15e28b4a69950de84d478e2664af) Thanks [@jonrohan](https://github.com/jonrohan)! - Dialog: Fix `Escape` key not closing the dialog on the first keypress when the close button is focused
14
+
15
+ - [#7908](https://github.com/primer/react/pull/7908) [`e9a2254`](https://github.com/primer/react/commit/e9a225421df61e7fa62da1b2796972122d266d36) Thanks [@jonrohan](https://github.com/jonrohan)! - `KeybindingHint`: display the `Meta` key correctly on platforms other than macOS and Windows. The `Meta`, `Alt`, and `Mod` keys are now resolved based on the detected platform: Apple platforms (macOS and iOS) show `⌘`/`⌥`, Windows shows `Win`, and all other platforms show `Meta`/`Alt`.
16
+
7
17
  - [#7894](https://github.com/primer/react/pull/7894) [`af4541d`](https://github.com/primer/react/commit/af4541d991c6e583dbf510bd0a0699f244ea00b2) Thanks [@mattcosta7](https://github.com/mattcosta7)! - ActionList: Replace `:has(...)` selectors on `ActionList.Item`, `InactiveButtonWrap`, and `TrailingActionButton` with JS-derived data attributes (`data-has-trailing-action`, `data-trailing-action-loading`, `data-position`, `data-has-label`). Reduces style-recalculation cost on lists that render many items. No visual or behavioral changes.
8
18
 
19
+ - [#7899](https://github.com/primer/react/pull/7899) [`9659ce7`](https://github.com/primer/react/commit/9659ce767760d85c033e43e7e8ecdfdfb452dcb1) Thanks [@mattcosta7](https://github.com/mattcosta7)! - `TreeView`: make rows safer to use with `contain: paint` / `content-visibility: auto` and reduce style-recalc cost on hover/focus in large trees. No visual or layout changes; all changes are either invisible at the default rendering or behind an opt-in CSS containment property the consumer sets.
20
+
21
+ - The current-item indicator (positioned at `left: -8px` of the row container) was being clipped when a consumer applied `contain: paint` to the `<li>` or when the documented `containIntrinsicSize` prop on `TreeView.Item` triggered `content-visibility: auto` on the row container — including for `current` items. Both `.TreeViewItem` and `.TreeViewItemContainer` now declare `overflow-clip-margin: var(--base-size-8)`, which extends the paint-clip edge by 8px on the side the indicator paints. The property is a no-op when no paint containment is active, so default rendering is byte-identical.
22
+ - Skeleton-row hover suppression no longer relies on `:has(.TreeViewItemSkeleton)`, which forced subtree invalidation on every row. `LoadingItem` now communicates with the placeholder `Item` via a module-private context that emits a positive `data-loading` attribute on the `<li>`, and the CSS selector targets that directly. No new public prop.
23
+ - Nesting indicator lines no longer use a root-scope `:hover`/`:focus-within` descendant selector. Color is driven by an inherited `--tree-line-color` custom property set on the root `<ul>`, so a hover or focus change inside the tree updates one property on one element instead of re-matching `.TreeViewItemLevelLine` selectors against every level line in the tree.
24
+ - Fixed a unitless `outline-offset: -2` in the forced-colors focus-ring fallback that browsers were silently dropping (so forced-colors users now actually get a focus indicator on tree items).
25
+ - `.TreeViewItemContainer`'s `grid-template-columns` now declares the `trailingAction` column explicitly (`auto`) so it matches the 5-area `grid-template-areas` declaration (previously the trailing column was implicit `auto`).
26
+
9
27
  ## 38.26.0
10
28
 
11
29
  ### Minor Changes
@@ -170,6 +170,7 @@ export declare const Dialog: React.ForwardRefExoticComponent<DialogProps & {
170
170
  }>>;
171
171
  CloseButton: React.FC<React.PropsWithChildren<{
172
172
  onClose: () => void;
173
+ onKeyDown?: React.KeyboardEventHandler;
173
174
  }>>;
174
175
  };
175
176
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA2C,KAAK,aAAa,EAAsB,MAAM,OAAO,CAAA;AAC9G,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,WAAW,CAAA;AAU1C,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAChE,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAgB/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,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,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,eAAe,CAAC,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,YAAY,GAAG,QAAQ,CAAC,CAAA;IAE/G;;;;;OAKG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAA;IAEnC;;;OAGG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IAEpD;;OAEG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IAErD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACpD;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAA;IAErB;;;OAGG;IACH,mBAAmB,EAAE,MAAM,CAAA;CAC5B;AAGD,QAAA,MAAM,SAAS;;;;CAIL,CAAA;AAEV,QAAA,MAAM,QAAQ;;;;;CAKJ,CAAA;AAEV,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,QAAQ,GAAG,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAA;AAC5F,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,SAAS,CAAA;AAoEjD,eAAO,MAAM,aAAa,mCAAqD,CAAA;AAmS/E,eAAO,MAAM,MAAM;;;;;;;;;iBA9EuC,iBAAiB,EAAE;;;iBAoCf,MAAM,IAAI;oBAAc,KAAK,CAAC,oBAAoB;;CAkD9G,CAAA"}
@@ -36,6 +36,17 @@ const DefaultHeader = ({
36
36
  const onCloseClick = useCallback(() => {
37
37
  onClose('close-button');
38
38
  }, [onClose]);
39
+ const onCloseKeyDown = useCallback(event => {
40
+ if (event.key === 'Escape') {
41
+ // When the close button is focused its tooltip is open, and the
42
+ // tooltip's own Escape handler (registered on `document`) would
43
+ // otherwise swallow this keypress. Handle Escape here and stop it from
44
+ // reaching the document-level handler so the dialog closes on the first
45
+ // press while keeping the tooltip fully functional.
46
+ event.stopPropagation();
47
+ onClose('escape');
48
+ }
49
+ }, [onClose]);
39
50
  return /*#__PURE__*/jsx(Dialog.Header, {
40
51
  children: /*#__PURE__*/jsxs("div", {
41
52
  className: classes.HeaderInner,
@@ -49,7 +60,8 @@ const DefaultHeader = ({
49
60
  children: subtitle
50
61
  })]
51
62
  }), /*#__PURE__*/jsx(Dialog.CloseButton, {
52
- onClose: onCloseClick
63
+ onClose: onCloseClick,
64
+ onKeyDown: onCloseKeyDown
53
65
  })]
54
66
  })
55
67
  });
@@ -348,12 +360,14 @@ const Buttons = ({
348
360
  });
349
361
  };
350
362
  const CloseButton = ({
351
- onClose
363
+ onClose,
364
+ onKeyDown
352
365
  }) => {
353
366
  return /*#__PURE__*/jsx(IconButton, {
354
367
  icon: XIcon,
355
368
  "aria-label": "Close",
356
369
  onClick: onClose,
370
+ onKeyDown: onKeyDown,
357
371
  variant: "invisible",
358
372
  "data-component": "Dialog.CloseButton"
359
373
  });
@@ -1,4 +1,5 @@
1
1
  import type { KeybindingHintProps } from './props';
2
+ import type { Platform } from './platform';
2
3
  /** Indicates the presence of an available keybinding. */
3
4
  export declare const KeybindingHint: import("react").MemoExoticComponent<({ className, ...props }: KeybindingHintProps) => import("react").JSX.Element>;
4
5
  /**
@@ -8,6 +9,10 @@ export declare const KeybindingHint: import("react").MemoExoticComponent<({ clas
8
9
  *
9
10
  * NOTE that this string should _only_ be used when building `aria-label` or `aria-description` props (never rendered
10
11
  * visibly) and should nearly always also be paired with a visible hint for sighted users.
12
+ *
13
+ * The `platform` argument controls how platform-specific keys (such as `Meta`, `Alt`, and `Mod`) are named. For
14
+ * backwards compatibility, a `boolean` may be passed instead, where `true` is treated as `'apple'` and `false` as
15
+ * `'other'`.
11
16
  */
12
- export declare const getAccessibleKeybindingHintString: (sequence: string, isMacOS: boolean) => string;
17
+ export declare const getAccessibleKeybindingHintString: (sequence: string, platform: Platform | boolean) => string;
13
18
  //# sourceMappingURL=KeybindingHint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"KeybindingHint.d.ts","sourceRoot":"","sources":["../../src/KeybindingHint/KeybindingHint.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,SAAS,CAAA;AAoBhD,yDAAyD;AAEzD,eAAO,MAAM,cAAc,gEAAgC,mBAAmB,iCAI5E,CAAA;AAGF;;;;;;;GAOG;AACH,eAAO,MAAM,iCAAiC,gDAA2B,CAAA"}
1
+ {"version":3,"file":"KeybindingHint.d.ts","sourceRoot":"","sources":["../../src/KeybindingHint/KeybindingHint.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,SAAS,CAAA;AAEhD,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AAmBxC,yDAAyD;AAEzD,eAAO,MAAM,cAAc,gEAAgC,mBAAmB,iCAI5E,CAAA;AAGF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iCAAiC,GAAI,UAAU,MAAM,EAAE,UAAU,QAAQ,GAAG,OAAO,WACe,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { c } from 'react-compiler-runtime';
2
2
  import { memo } from 'react';
3
- import { accessibleSequenceString, Sequence } from './components/Sequence.js';
3
+ import { Sequence, accessibleSequenceString } from './components/Sequence.js';
4
4
  import classes from './KeybindingHint.module.css.js';
5
5
  import { clsx } from 'clsx';
6
6
  import { jsx } from 'react/jsx-runtime';
@@ -89,7 +89,11 @@ KeybindingHint.displayName = 'KeybindingHint';
89
89
  *
90
90
  * NOTE that this string should _only_ be used when building `aria-label` or `aria-description` props (never rendered
91
91
  * visibly) and should nearly always also be paired with a visible hint for sighted users.
92
+ *
93
+ * The `platform` argument controls how platform-specific keys (such as `Meta`, `Alt`, and `Mod`) are named. For
94
+ * backwards compatibility, a `boolean` may be passed instead, where `true` is treated as `'apple'` and `false` as
95
+ * `'other'`.
92
96
  */
93
- const getAccessibleKeybindingHintString = accessibleSequenceString;
97
+ const getAccessibleKeybindingHintString = (sequence, platform) => accessibleSequenceString(sequence, typeof platform === 'boolean' ? platform ? 'apple' : 'other' : platform);
94
98
 
95
99
  export { KeybindingHint, getAccessibleKeybindingHintString };
@@ -1,5 +1,6 @@
1
1
  import type { KeybindingHintProps } from '../props';
2
+ import type { Platform } from '../platform';
2
3
  export declare const Chord: ({ keys, format, variant, size }: KeybindingHintProps) => import("react").JSX.Element;
3
4
  /** Plain string version of `Chord` for use in `aria` string attributes. */
4
- export declare const accessibleChordString: (chord: string, isMacOS: boolean) => string;
5
+ export declare const accessibleChordString: (chord: string, platform: Platform) => string;
5
6
  //# sourceMappingURL=Chord.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chord.d.ts","sourceRoot":"","sources":["../../../src/KeybindingHint/components/Chord.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAA;AA+BjD,eAAO,MAAM,KAAK,GAAI,iCAAmE,mBAAmB,gCAsB3G,CAAA;AAED,2EAA2E;AAC3E,eAAO,MAAM,qBAAqB,GAAI,OAAO,MAAM,EAAE,SAAS,OAAO,WAGvD,CAAA"}
1
+ {"version":3,"file":"Chord.d.ts","sourceRoot":"","sources":["../../../src/KeybindingHint/components/Chord.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAA;AAGjD,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAA;AA6BzC,eAAO,MAAM,KAAK,GAAI,iCAAmE,mBAAmB,gCAsB3G,CAAA;AAED,2EAA2E;AAC3E,eAAO,MAAM,qBAAqB,GAAI,OAAO,MAAM,EAAE,UAAU,QAAQ,WAGzD,CAAA"}
@@ -96,6 +96,6 @@ const Chord = t0 => {
96
96
  };
97
97
 
98
98
  /** Plain string version of `Chord` for use in `aria` string attributes. */
99
- const accessibleChordString = (chord, isMacOS) => splitChord(chord).map(key => accessibleKeyName(key, isMacOS)).join(' ');
99
+ const accessibleChordString = (chord, platform) => splitChord(chord).map(key => accessibleKeyName(key, platform)).join(' ');
100
100
 
101
101
  export { Chord, accessibleChordString };
@@ -1,7 +1,7 @@
1
1
  import { c } from 'react-compiler-runtime';
2
2
  import VisuallyHidden from '../../_VisuallyHidden.js';
3
3
  import { accessibleKeyName, condensedKeyName, fullKeyName } from '../key-names.js';
4
- import { useIsMacOS } from '../../hooks/useIsMacOS.js';
4
+ import { usePlatform } from '../platform.js';
5
5
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
6
6
 
7
7
  /** Renders a single key with accessible alternative text. */
@@ -11,12 +11,12 @@ const Key = t0 => {
11
11
  name,
12
12
  format
13
13
  } = t0;
14
- const isMacOS = useIsMacOS();
14
+ const platform = usePlatform();
15
15
  let t1;
16
- if ($[0] !== isMacOS || $[1] !== name) {
17
- t1 = accessibleKeyName(name, isMacOS);
18
- $[0] = isMacOS;
19
- $[1] = name;
16
+ if ($[0] !== name || $[1] !== platform) {
17
+ t1 = accessibleKeyName(name, platform);
18
+ $[0] = name;
19
+ $[1] = platform;
20
20
  $[2] = t1;
21
21
  } else {
22
22
  t1 = $[2];
@@ -32,11 +32,11 @@ const Key = t0 => {
32
32
  t2 = $[4];
33
33
  }
34
34
  let t3;
35
- if ($[5] !== format || $[6] !== isMacOS || $[7] !== name) {
36
- t3 = format === "condensed" ? condensedKeyName(name, isMacOS) : fullKeyName(name, isMacOS);
35
+ if ($[5] !== format || $[6] !== name || $[7] !== platform) {
36
+ t3 = format === "condensed" ? condensedKeyName(name, platform) : fullKeyName(name, platform);
37
37
  $[5] = format;
38
- $[6] = isMacOS;
39
- $[7] = name;
38
+ $[6] = name;
39
+ $[7] = platform;
40
40
  $[8] = t3;
41
41
  } else {
42
42
  t3 = $[8];
@@ -1,5 +1,6 @@
1
1
  import type { KeybindingHintProps } from '../props';
2
+ import type { Platform } from '../platform';
2
3
  export declare const Sequence: ({ keys, ...chordProps }: KeybindingHintProps) => import("react").JSX.Element[];
3
4
  /** Plain string version of `Sequence` for use in `aria` string attributes. */
4
- export declare const accessibleSequenceString: (sequence: string, isMacOS: boolean) => string;
5
+ export declare const accessibleSequenceString: (sequence: string, platform: Platform) => string;
5
6
  //# sourceMappingURL=Sequence.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Sequence.d.ts","sourceRoot":"","sources":["../../../src/KeybindingHint/components/Sequence.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAA;AAMjD,eAAO,MAAM,QAAQ,GAAI,yBAAuB,mBAAmB,kCAa/D,CAAA;AAEJ,8EAA8E;AAC9E,eAAO,MAAM,wBAAwB,GAAI,UAAU,MAAM,EAAE,SAAS,OAAO,WAGxD,CAAA"}
1
+ {"version":3,"file":"Sequence.d.ts","sourceRoot":"","sources":["../../../src/KeybindingHint/components/Sequence.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,UAAU,CAAA;AAGjD,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAA;AAIzC,eAAO,MAAM,QAAQ,GAAI,yBAAuB,mBAAmB,kCAa/D,CAAA;AAEJ,8EAA8E;AAC9E,eAAO,MAAM,wBAAwB,GAAI,UAAU,MAAM,EAAE,UAAU,QAAQ,WAG1D,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { Fragment } from 'react';
2
2
  import VisuallyHidden from '../../_VisuallyHidden.js';
3
- import { accessibleChordString, Chord } from './Chord.js';
3
+ import { Chord, accessibleChordString } from './Chord.js';
4
4
  import { jsxs, Fragment as Fragment$1, jsx } from 'react/jsx-runtime';
5
5
 
6
6
  const splitSequence = sequence => sequence.split(' ');
@@ -21,6 +21,6 @@ const Sequence = ({
21
21
  }, i));
22
22
 
23
23
  /** Plain string version of `Sequence` for use in `aria` string attributes. */
24
- const accessibleSequenceString = (sequence, isMacOS) => splitSequence(sequence).map(chord => accessibleChordString(chord, isMacOS)).join(' then ');
24
+ const accessibleSequenceString = (sequence, platform) => splitSequence(sequence).map(chord => accessibleChordString(chord, platform)).join(' then ');
25
25
 
26
26
  export { Sequence, accessibleSequenceString };
@@ -1,16 +1,17 @@
1
+ import type { Platform } from './platform';
1
2
  /**
2
3
  * Short-form iconic versions of keys. These should be intuitive (not archaic) and match icons on keyboards.
3
4
  */
4
- export declare const condensedKeyName: (key: string, isMacOS: boolean) => string;
5
+ export declare const condensedKeyName: (key: string, platform: Platform) => string;
5
6
  /**
6
7
  * Specific key displays for 'full' format. We still do show some icons (ie punctuation)
7
8
  * because that's more intuitive, but for the rest of keys we show the standard key name.
8
9
  */
9
- export declare const fullKeyName: (key: string, isMacOS: boolean) => string;
10
+ export declare const fullKeyName: (key: string, platform: Platform) => string;
10
11
  /**
11
12
  * Accessible key names intended to be read by a screen reader. This prevents screen
12
13
  * readers from expressing punctuation in speech, ie, reading a long pause instead of the
13
14
  * word "period".
14
15
  */
15
- export declare const accessibleKeyName: (key: string, isMacOS: boolean) => string;
16
+ export declare const accessibleKeyName: (key: string, platform: Platform) => string;
16
17
  //# sourceMappingURL=key-names.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"key-names.d.ts","sourceRoot":"","sources":["../../src/KeybindingHint/key-names.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,KAAK,MAAM,EAAE,SAAS,OAAO,WAwBlC,CAAA;AAE5B;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,EAAE,SAAS,OAAO,WAa7B,CAAA;AAE5B;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,KAAK,MAAM,EAAE,SAAS,OAAO,WAmDjC,CAAA"}
1
+ {"version":3,"file":"key-names.d.ts","sourceRoot":"","sources":["../../src/KeybindingHint/key-names.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AAUxC;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,KAAK,MAAM,EAAE,UAAU,QAAQ,WAwBpC,CAAA;AAE5B;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,EAAE,UAAU,QAAQ,WAc/B,CAAA;AAE5B;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,KAAK,MAAM,EAAE,UAAU,QAAQ,WAmDnC,CAAA"}
@@ -12,15 +12,15 @@ const capitalize = ([first, ...rest]) => {
12
12
  /**
13
13
  * Short-form iconic versions of keys. These should be intuitive (not archaic) and match icons on keyboards.
14
14
  */
15
- const condensedKeyName = (key, isMacOS) => {
15
+ const condensedKeyName = (key, platform) => {
16
16
  var _alt$control$shift$me;
17
17
  return (_alt$control$shift$me = {
18
- alt: isMacOS ? '⌥' : 'Alt',
18
+ alt: platform === 'apple' ? '⌥' : 'Alt',
19
19
  // the alt key _is_ the option key on MacOS - in the browser there is no "option" key
20
20
  control: '⌃',
21
21
  shift: '⇧',
22
- meta: isMacOS ? '⌘' : 'Win',
23
- mod: isMacOS ? '⌘' : '⌃',
22
+ meta: platform === 'apple' ? '⌘' : platform === 'windows' ? 'Win' : 'Meta',
23
+ mod: platform === 'apple' ? '⌘' : '⌃',
24
24
  pageup: 'PgUp',
25
25
  pagedown: 'PgDn',
26
26
  arrowup: '↑',
@@ -47,11 +47,12 @@ const condensedKeyName = (key, isMacOS) => {
47
47
  * Specific key displays for 'full' format. We still do show some icons (ie punctuation)
48
48
  * because that's more intuitive, but for the rest of keys we show the standard key name.
49
49
  */
50
- const fullKeyName = (key, isMacOS) => {
51
- var _alt$mod$$pageup$pag;
52
- return (_alt$mod$$pageup$pag = {
53
- alt: isMacOS ? 'Option' : 'Alt',
54
- mod: isMacOS ? 'Command' : 'Control',
50
+ const fullKeyName = (key, platform) => {
51
+ var _alt$meta$mod$$pageu;
52
+ return (_alt$meta$mod$$pageu = {
53
+ alt: platform === 'apple' ? 'Option' : 'Alt',
54
+ meta: platform === 'apple' ? 'Command' : platform === 'windows' ? 'Windows' : 'Meta',
55
+ mod: platform === 'apple' ? 'Command' : 'Control',
55
56
  '+': 'Plus',
56
57
  pageup: 'Page Up',
57
58
  pagedown: 'Page Down',
@@ -61,7 +62,7 @@ const fullKeyName = (key, isMacOS) => {
61
62
  arrowright: 'Right Arrow',
62
63
  capslock: 'Caps Lock',
63
64
  printscreen: 'Print Screen'
64
- }[key]) !== null && _alt$mod$$pageup$pag !== void 0 ? _alt$mod$$pageup$pag : capitalize(key);
65
+ }[key]) !== null && _alt$meta$mod$$pageu !== void 0 ? _alt$meta$mod$$pageu : capitalize(key);
65
66
  };
66
67
 
67
68
  /**
@@ -69,12 +70,12 @@ const fullKeyName = (key, isMacOS) => {
69
70
  * readers from expressing punctuation in speech, ie, reading a long pause instead of the
70
71
  * word "period".
71
72
  */
72
- const accessibleKeyName = (key, isMacOS) => {
73
+ const accessibleKeyName = (key, platform) => {
73
74
  var _alt$meta$mod$pageup$;
74
75
  return (_alt$meta$mod$pageup$ = {
75
- alt: isMacOS ? 'option' : 'alt',
76
- meta: isMacOS ? 'command' : 'Windows',
77
- mod: isMacOS ? 'command' : 'control',
76
+ alt: platform === 'apple' ? 'option' : 'alt',
77
+ meta: platform === 'apple' ? 'command' : platform === 'windows' ? 'Windows' : 'meta',
78
+ mod: platform === 'apple' ? 'command' : 'control',
78
79
  // Screen readers may not be able to pronounce concatenated words - this provides a better experience
79
80
  pageup: 'page up',
80
81
  pagedown: 'page down',
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The platform categories that affect how keyboard shortcut keys are displayed.
3
+ *
4
+ * - `apple`: Apple platforms (macOS and iOS/iPadOS), which use the Command and Option keys.
5
+ * - `windows`: Windows, which uses the Windows (Meta) key.
6
+ * - `other`: Any other platform (e.g. Linux, Android), where the Meta key does not map to a
7
+ * consistent label.
8
+ */
9
+ export type Platform = 'apple' | 'windows' | 'other';
10
+ export declare const PlatformOverrideProvider: import("react").Provider<Platform | null>;
11
+ /**
12
+ * SSR-safe hook for determining the current platform category used when displaying
13
+ * keyboard shortcut keys.
14
+ *
15
+ * Mirrors the approach of `useIsMacOS`: on the client it reads the real value immediately,
16
+ * and on the server it returns a safe default (`'other'`).
17
+ *
18
+ * If a `PlatformOverrideProvider` is present with a non-null value, that value is used
19
+ * instead of the detected platform.
20
+ */
21
+ export declare function usePlatform(): Platform;
22
+ //# sourceMappingURL=platform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/KeybindingHint/platform.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAA;AAkCpD,eAAO,MAAM,wBAAwB,2CAAmC,CAAA;AAExE;;;;;;;;;GASG;AACH,wBAAgB,WAAW,IAAI,QAAQ,CAItC"}
@@ -0,0 +1,61 @@
1
+ import { isMacOS } from '@primer/behaviors/utils';
2
+ import { useContext, useSyncExternalStore, createContext } from 'react';
3
+
4
+ /**
5
+ * The platform categories that affect how keyboard shortcut keys are displayed.
6
+ *
7
+ * - `apple`: Apple platforms (macOS and iOS/iPadOS), which use the Command and Option keys.
8
+ * - `windows`: Windows, which uses the Windows (Meta) key.
9
+ * - `other`: Any other platform (e.g. Linux, Android), where the Meta key does not map to a
10
+ * consistent label.
11
+ */
12
+
13
+ // No-op. The platform never changes at runtime, so there is nothing to
14
+ // subscribe to. Hoisted to avoid creating a new function on every call.
15
+ const subscribe = () => () => {};
16
+
17
+ /** SSR-unsafe detection of iOS/iPadOS (in addition to macOS, which is detected separately). */
18
+ const ssrUnsafeIsIOS = () => {
19
+ if (typeof navigator === 'undefined') return false;
20
+ return /iphone|ipad|ipod/i.test(navigator.platform) || /iphone|ipad|ipod/i.test(navigator.userAgent);
21
+ };
22
+
23
+ /** SSR-unsafe detection of Windows. */
24
+ const ssrUnsafeIsWindows = () => {
25
+ if (typeof navigator === 'undefined') return false;
26
+ return /^win/i.test(navigator.platform);
27
+ };
28
+ const getSnapshot = () => {
29
+ if (isMacOS() || ssrUnsafeIsIOS()) return 'apple';
30
+ if (ssrUnsafeIsWindows()) return 'windows';
31
+ return 'other';
32
+ };
33
+
34
+ // Safe default for SSR since we can't detect the platform on the server.
35
+ const getServerSnapshot = () => 'other';
36
+
37
+ /**
38
+ * Allows overriding the detected platform. This is primarily intended for testing and
39
+ * Storybook, where we want to preview how keyboard hints render on platforms other than the
40
+ * one actually running. A `null` value (the default) means "use the detected platform".
41
+ */
42
+ const PlatformOverrideContext = /*#__PURE__*/createContext(null);
43
+ PlatformOverrideContext.Provider;
44
+
45
+ /**
46
+ * SSR-safe hook for determining the current platform category used when displaying
47
+ * keyboard shortcut keys.
48
+ *
49
+ * Mirrors the approach of `useIsMacOS`: on the client it reads the real value immediately,
50
+ * and on the server it returns a safe default (`'other'`).
51
+ *
52
+ * If a `PlatformOverrideProvider` is present with a non-null value, that value is used
53
+ * instead of the detected platform.
54
+ */
55
+ function usePlatform() {
56
+ const override = useContext(PlatformOverrideContext);
57
+ const detected = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
58
+ return override !== null && override !== void 0 ? override : detected;
59
+ }
60
+
61
+ export { usePlatform };
@@ -160,7 +160,7 @@ export type PageLayoutPaneProps = PageLayoutPaneBaseProps & ({
160
160
  currentWidth?: never;
161
161
  });
162
162
  declare const Pane: React.ForwardRefExoticComponent<React.PropsWithChildren<PageLayoutPaneProps> & React.RefAttributes<HTMLDivElement>>;
163
- export type PageLayoutSidebarProps = {
163
+ export type PageLayoutSidebarBaseProps = {
164
164
  /**
165
165
  * A unique label for the sidebar region
166
166
  */
@@ -175,7 +175,10 @@ export type PageLayoutSidebarProps = {
175
175
  */
176
176
  position?: 'start' | 'end';
177
177
  /**
178
- * Width configuration for the sidebar
178
+ * Width configuration for the sidebar.
179
+ *
180
+ * When `resizable` is enabled, this defines the default width and constraints
181
+ * (min/max bounds for dragging). Use `currentWidth` to control the displayed width.
179
182
  */
180
183
  width?: PaneWidth | CustomWidthOptions;
181
184
  /**
@@ -190,7 +193,7 @@ export type PageLayoutSidebarProps = {
190
193
  resizable?: boolean;
191
194
  /**
192
195
  * localStorage key used to persist the sidebar width across sessions.
193
- * Only applies when `resizable` is `true`.
196
+ * Only applies when `resizable` is `true` and no `onResizeEnd` callback is provided.
194
197
  * When omitted, localStorage is not used.
195
198
  */
196
199
  widthStorageKey?: string;
@@ -226,9 +229,24 @@ export type PageLayoutSidebarProps = {
226
229
  className?: string;
227
230
  style?: React.CSSProperties;
228
231
  };
229
- declare const Sidebar: React.ForwardRefExoticComponent<PageLayoutSidebarProps & {
230
- children?: React.ReactNode | undefined;
231
- } & React.RefAttributes<HTMLDivElement>>;
232
+ export type PageLayoutSidebarProps = PageLayoutSidebarBaseProps & ({
233
+ /**
234
+ * Callback fired when a resize operation ends (drag release or keyboard key up).
235
+ * When provided, this callback is used instead of localStorage persistence.
236
+ */
237
+ onResizeEnd: (width: number) => void;
238
+ /**
239
+ * Current/controlled width value in pixels.
240
+ * When provided, this is used as the current sidebar width instead of internal state.
241
+ * The `width` prop still defines the default used when resetting (e.g., double-click).
242
+ * Pass `undefined` when the persisted value has not loaded yet (e.g., async fetch).
243
+ */
244
+ currentWidth: number | undefined;
245
+ } | {
246
+ onResizeEnd?: never;
247
+ currentWidth?: never;
248
+ });
249
+ declare const Sidebar: React.ForwardRefExoticComponent<React.PropsWithChildren<PageLayoutSidebarProps> & React.RefAttributes<HTMLDivElement>>;
232
250
  export type PageLayoutFooterProps = {
233
251
  /**
234
252
  * A unique label for the rendered contentinfo landmark
@@ -1 +1 @@
1
- {"version":3,"file":"PageLayout.d.ts","sourceRoot":"","sources":["../../src/PageLayout/PageLayout.tsx"],"names":[],"mappings":"AAAA,O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;IAClC;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAA;IAEjD;;OAEG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAA;IAC3D,OAAO,CAAC,EAAE,MAAM,OAAO,WAAW,CAAA;IAClC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,eAAe,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAA;IACxF;;;;;;;;;;;;;OAaG;IACH,iBAAiB,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAA;IAC1D,MAAM,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAA;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC5B,CAAA;AA6DD,eAAO,MAAM,UAAU;;;UAGP,cAAc,CAAC,OAAO,IAAI,CAAC;aACrB,cAAc,CAAC,OAAO,OAAO,CAAC;;CAElD,CAAA"}
@@ -742,6 +742,8 @@ const Sidebar = /*#__PURE__*/React.forwardRef(({
742
742
  position = 'start',
743
743
  width = 'medium',
744
744
  minWidth = 256,
745
+ currentWidth: controlledWidth,
746
+ onResizeEnd,
745
747
  padding = 'none',
746
748
  resizable = false,
747
749
  widthStorageKey,
@@ -783,7 +785,9 @@ const Sidebar = /*#__PURE__*/React.forwardRef(({
783
785
  paneRef: sidebarRef,
784
786
  handleRef,
785
787
  contentWrapperRef: sidebarContentWrapperRef,
786
- constrainToViewport: true
788
+ constrainToViewport: true,
789
+ onResizeEnd,
790
+ currentWidth: controlledWidth
787
791
  });
788
792
  const mergedSidebarRef = useMergedRefs(forwardRef, sidebarRef);
789
793
  const hasOverflow = useOverflow(sidebarRef);
@@ -827,8 +831,9 @@ const Sidebar = /*#__PURE__*/React.forwardRef(({
827
831
  ref: mergedSidebarRef
828
832
  // Suppress hydration mismatch for --pane-width when localStorage
829
833
  // provides a width that differs from the server-rendered default.
834
+ // Not needed when onResizeEnd is provided (localStorage isn't read).
830
835
  ,
831
- suppressHydrationWarning: resizable === true && !!widthStorageKey,
836
+ suppressHydrationWarning: resizable === true && !!widthStorageKey && !onResizeEnd,
832
837
  ...(hasOverflow ? overflowProps : {}),
833
838
  ...labelProp,
834
839
  ...(id && {
@@ -1,2 +1,2 @@
1
- .prc-Text-Text-9mHv3:where([data-size=small]){font-size:var(--text-body-size-small,.75rem);line-height:var(--text-body-lineHeight-small,1.625)}.prc-Text-Text-9mHv3:where([data-size=medium]){font-size:var(--text-body-size-medium,.875rem);line-height:var(--text-body-lineHeight-medium,1.5)}.prc-Text-Text-9mHv3:where([data-size=large]){font-size:var(--text-body-size-large,1rem);line-height:var(--text-body-lineHeight-large,1.5)}.prc-Text-Text-9mHv3:where([data-weight=light]){font-weight:var(--base-text-weight-light,300)}.prc-Text-Text-9mHv3:where([data-weight=normal]){font-weight:var(--base-text-weight-normal,400)}.prc-Text-Text-9mHv3:where([data-weight=medium]){font-weight:var(--base-text-weight-medium,500)}.prc-Text-Text-9mHv3:where([data-weight=semibold]){font-weight:var(--base-text-weight-semibold,600)}
2
- /*# sourceMappingURL=Text-ca7603b7.css.map */
1
+ .prc-Text-Text-9mHv3:where([data-size=small]){font-size:var(--text-body-size-small,.75rem);line-height:var(--text-body-lineHeight-small,1.625)}.prc-Text-Text-9mHv3:where([data-size=medium]){font-size:var(--text-body-size-medium,.875rem);line-height:var(--text-body-lineHeight-medium,1.5)}.prc-Text-Text-9mHv3:where([data-size=large]){font-size:var(--text-body-size-large,1rem);line-height:var(--text-body-lineHeight-large,1.5)}.prc-Text-Text-9mHv3:where([data-weight=light]){font-weight:var(--base-text-weight-light,300)}.prc-Text-Text-9mHv3:where([data-weight=normal]){font-weight:var(--base-text-weight-normal,400)}.prc-Text-Text-9mHv3:where([data-weight=medium]){font-weight:var(--base-text-weight-medium,500)}.prc-Text-Text-9mHv3:where([data-weight=semibold]){font-weight:var(--base-text-weight-semibold,600)}.prc-Text-Text-9mHv3:where([data-white-space=pre]){white-space:pre}.prc-Text-Text-9mHv3:where([data-white-space=normal]){white-space:normal}.prc-Text-Text-9mHv3:where([data-white-space=nowrap]){white-space:nowrap}.prc-Text-Text-9mHv3:where([data-white-space=pre-wrap]){white-space:pre-wrap}.prc-Text-Text-9mHv3:where([data-white-space=pre-line]){white-space:pre-line}
2
+ /*# sourceMappingURL=Text-d649cda5.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/Text/Text.module.css.js"],"names":[],"mappings":"AACE,8CACE,4CAAsC,CACtC,mDACF,CAEA,+CACE,8CAAuC,CACvC,kDACF,CAEA,8CACE,0CAAsC,CACtC,iDACF,CAEA,gDACE,6CACF,CAEA,iDACE,8CACF,CAEA,iDACE,8CACF,CAEA,mDACE,gDACF,CAEA,mDACE,eACF,CAEA,sDACE,kBACF,CAEA,sDACE,kBACF,CAEA,wDACE,oBACF,CAEA,wDACE,oBACF","file":"Text-d649cda5.css","sourcesContent":[".Text {\n &:where([data-size='small']) {\n font-size: var(--text-body-size-small);\n line-height: var(--text-body-lineHeight-small);\n }\n\n &:where([data-size='medium']) {\n font-size: var(--text-body-size-medium);\n line-height: var(--text-body-lineHeight-medium);\n }\n\n &:where([data-size='large']) {\n font-size: var(--text-body-size-large);\n line-height: var(--text-body-lineHeight-large);\n }\n\n &:where([data-weight='light']) {\n font-weight: var(--base-text-weight-light);\n }\n\n &:where([data-weight='normal']) {\n font-weight: var(--base-text-weight-normal);\n }\n\n &:where([data-weight='medium']) {\n font-weight: var(--base-text-weight-medium);\n }\n\n &:where([data-weight='semibold']) {\n font-weight: var(--base-text-weight-semibold);\n }\n\n &:where([data-white-space='pre']) {\n white-space: pre;\n }\n\n &:where([data-white-space='normal']) {\n white-space: normal;\n }\n\n &:where([data-white-space='nowrap']) {\n white-space: nowrap;\n }\n\n &:where([data-white-space='pre-wrap']) {\n white-space: pre-wrap;\n }\n\n &:where([data-white-space='pre-line']) {\n white-space: pre-line;\n }\n}\n"]}
@@ -3,15 +3,18 @@ import { type PolymorphicProps } from '../utils/modern-polymorphic';
3
3
  export type TextProps<As extends React.ElementType = 'span'> = PolymorphicProps<As, 'span', {
4
4
  size?: 'large' | 'medium' | 'small';
5
5
  weight?: 'light' | 'normal' | 'medium' | 'semibold';
6
+ whiteSpace?: 'pre' | 'normal' | 'nowrap' | 'pre-wrap' | 'pre-line';
6
7
  className?: string;
7
8
  }>;
8
9
  declare const _default: <As extends React.ElementType>(props: (React.ComponentPropsWithRef<React.ElementType extends As ? "span" : As> & {
9
10
  size?: "large" | "medium" | "small";
10
11
  weight?: "light" | "normal" | "medium" | "semibold";
12
+ whiteSpace?: "pre" | "normal" | "nowrap" | "pre-wrap" | "pre-line";
11
13
  className?: string;
12
14
  } extends infer T ? T extends React.ComponentPropsWithRef<React.ElementType extends As ? "span" : As> & {
13
15
  size?: "large" | "medium" | "small";
14
16
  weight?: "light" | "normal" | "medium" | "semibold";
17
+ whiteSpace?: "pre" | "normal" | "nowrap" | "pre-wrap" | "pre-line";
15
18
  className?: string;
16
19
  } ? T extends unknown ? Omit<T, "as"> : never : never : never) & {
17
20
  as?: As | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../src/Text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAAkB,KAAK,gBAAgB,EAAC,MAAM,6BAA6B,CAAA;AAElF,MAAM,MAAM,SAAS,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,GAAG,MAAM,IAAI,gBAAgB,CAC7E,EAAE,EACF,MAAM,EACN;IACE,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU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