@primer/react 0.0.0-20260623152624 → 0.0.0-20260623155122

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,9 +1,11 @@
1
1
  # @primer/react
2
2
 
3
- ## 0.0.0-20260623152624
3
+ ## 0.0.0-20260623155122
4
4
 
5
5
  ### Patch Changes
6
6
 
7
+ - [#7935](https://github.com/primer/react/pull/7935) [`5b3c806`](https://github.com/primer/react/commit/5b3c806305cfa09d33d42fc2957d55105725ea3b) Thanks [@copilot-swe-agent](https://github.com/apps/copilot-swe-agent)! - ConfirmationDialog: `useConfirm`/`confirm` now removes its host element from `document.body` after the dialog is closed, and uses a fresh host element per call, so the empty container no longer lingers or leaks into other components and tests
8
+
7
9
  - [#8005](https://github.com/primer/react/pull/8005) [`5d24be4`](https://github.com/primer/react/commit/5d24be483f2fdfa305970907984d04522e2aa13c) Thanks [@copilot-swe-agent](https://github.com/apps/copilot-swe-agent)! - Derive `AutocompleteMenu` close-time re-sorting and `LabelGroup` numeric truncation during render instead of in effects, removing redundant render passes. No public API or visual changes.
8
10
 
9
11
  - [#8001](https://github.com/primer/react/pull/8001) [`4e6cf0d`](https://github.com/primer/react/commit/4e6cf0d1715e0371169b291be7a503f2d15f7bc5) Thanks [@mattcosta7](https://github.com/mattcosta7)! - Derive state during render instead of in effects for `useMedia`, `ToggleSwitch`, `SelectPanel`, and the internal validation animation container, removing redundant render passes. Note: `useMedia` now returns the live `matchMedia` value on the first client render; `defaultState` is only used for the SSR/hydration snapshot (no public API changes).
@@ -1 +1 @@
1
- {"version":3,"file":"useConfirm.d.ts","sourceRoot":"","sources":["../../src/ConfirmationDialog/useConfirm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAGxC,OAAO,EAAqB,KAAK,uBAAuB,EAAC,MAAM,sBAAsB,CAAA;AAIrF,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,uBAAuB,EAAE,SAAS,CAAC,GAAG;IAAC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAA;CAAC,CAAA;AA0BlG;;;;GAIG;AACH,wBAAgB,UAAU,cACa,cAAc,sBAIpD"}
1
+ {"version":3,"file":"useConfirm.d.ts","sourceRoot":"","sources":["../../src/ConfirmationDialog/useConfirm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAGxC,OAAO,EAAqB,KAAK,uBAAuB,EAAC,MAAM,sBAAsB,CAAA;AAErF,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,uBAAuB,EAAE,SAAS,CAAC,GAAG;IAAC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAA;CAAC,CAAA;AAuBlG;;;;GAIG;AACH,wBAAgB,UAAU,cACa,cAAc,sBAIpD"}
@@ -3,23 +3,19 @@ import { createRoot } from 'react-dom/client';
3
3
  import BaseStyles from '../BaseStyles.js';
4
4
  import { ConfirmationDialog } from './ConfirmationDialog.js';
5
5
 
6
- let hostElement = null;
7
6
  async function confirm(options) {
8
7
  const {
9
8
  content,
10
9
  ...confirmationDialogProps
11
10
  } = options;
12
11
  return new Promise(resolve => {
13
- hostElement ||= document.createElement('div');
14
- if (!hostElement.isConnected) document.body.append(hostElement);
12
+ const hostElement = document.createElement('div');
13
+ document.body.append(hostElement);
15
14
  const root = createRoot(hostElement);
16
15
  const onClose = gesture => {
17
16
  root.unmount();
18
- if (gesture === 'confirm') {
19
- resolve(true);
20
- } else {
21
- resolve(false);
22
- }
17
+ hostElement.remove();
18
+ resolve(gesture === 'confirm');
23
19
  };
24
20
  root.render(/*#__PURE__*/React.createElement(BaseStyles, null, /*#__PURE__*/React.createElement(ConfirmationDialog, {
25
21
  ...confirmationDialogProps,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@primer/react",
3
3
  "type": "module",
4
- "version": "0.0.0-20260623152624",
4
+ "version": "0.0.0-20260623155122",
5
5
  "description": "An implementation of GitHub's Primer Design System using React",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",