@radix-ui/react-portal 1.2.0 → 1.2.1

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/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts", "../src/portal.tsx"],
4
- "sourcesContent": ["'use client';\nexport {\n Portal,\n //\n Root,\n} from './portal';\nexport type { PortalProps } from './portal';\n", "import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\n\n/* -------------------------------------------------------------------------------------------------\n * Portal\n * -----------------------------------------------------------------------------------------------*/\n\ntype PortalElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface PortalProps extends PrimitiveDivProps {\n /**\n * An optional container where the portaled content should be appended.\n */\n container?: Element | DocumentFragment | null | undefined;\n}\n\nconst Portal = /* @__PURE__ */ React.forwardRef<PortalElement, PortalProps>(\n function Portal(props, forwardedRef) {\n const { container: containerProp, ...portalProps } = props;\n const [mounted, setMounted] = React.useState(false);\n useLayoutEffect(() => setMounted(true), []);\n const container = containerProp || (mounted && globalThis?.document?.body);\n return container\n ? ReactDOM.createPortal(<Primitive.div {...portalProps} ref={forwardedRef} />, container)\n : null;\n },\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\nexport {\n Portal,\n //\n Portal as Root,\n};\nexport type { PortalProps };\n"],
4
+ "sourcesContent": ["'use client';\nexport {\n Portal,\n //\n Root,\n} from './portal.js';\nexport type { PortalProps } from './portal.js';\n", "import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\n\n/* -------------------------------------------------------------------------------------------------\n * Portal\n * -----------------------------------------------------------------------------------------------*/\n\ntype PortalElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface PortalProps extends PrimitiveDivProps {\n /**\n * An optional container where the portaled content should be appended.\n */\n container?: Element | DocumentFragment | null | undefined;\n}\n\nconst Portal = /* @__PURE__ */ React.forwardRef<PortalElement, PortalProps>(\n function Portal(props, forwardedRef) {\n const { container: containerProp, ...portalProps } = props;\n const [mounted, setMounted] = React.useState(false);\n useLayoutEffect(() => setMounted(true), []);\n const container = containerProp || (mounted && globalThis?.document?.body);\n return container\n ? ReactDOM.createPortal(<Primitive.div {...portalProps} ref={forwardedRef} />, container)\n : null;\n },\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\nexport {\n Portal,\n //\n Portal as Root,\n};\nexport type { PortalProps };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,eAA0B;AAC1B,6BAA0B;AAC1B,qCAAgC;AAsBF;AAP9B,IAAM,SAAyB,gBAAM;AAAA,EACnC,gCAASA,QAAO,OAAO,cAAc;AACnC,UAAM,EAAE,WAAW,eAAe,GAAG,YAAY,IAAI;AACrD,UAAM,CAAC,SAAS,UAAU,IAAU,eAAS,KAAK;AAClD,wDAAgB,MAAM,WAAW,IAAI,GAAG,CAAC,CAAC;AAC1C,UAAM,YAAY,iBAAkB,WAAW,YAAY,UAAU;AACrE,WAAO,YACM,sBAAa,4CAAC,iCAAU,KAAV,EAAe,GAAG,aAAa,KAAK,cAAc,GAAI,SAAS,IACtF;AAAA,EACN,GARA;AASF;",
6
6
  "names": ["Portal"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radix-ui/react-portal",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "license": "MIT",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./dist/index.js",
@@ -11,8 +11,8 @@
11
11
  ],
12
12
  "sideEffects": false,
13
13
  "dependencies": {
14
- "@radix-ui/react-use-layout-effect": "1.1.4",
15
- "@radix-ui/react-primitive": "2.2.0"
14
+ "@radix-ui/react-primitive": "2.2.1",
15
+ "@radix-ui/react-use-layout-effect": "1.1.5"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@types/react": "^19.3.0",
@@ -50,7 +50,8 @@
50
50
  "lint": "oxlint --max-warnings 0 src",
51
51
  "clean": "rm -rf dist",
52
52
  "reset": "rm -rf dist node_modules",
53
- "typecheck": "tsc --noEmit",
53
+ "types:check:pkg": "tsc --noEmit -p tsconfig.lib.json",
54
+ "types:check:test": "tsc --noEmit -p tsconfig.test.json",
54
55
  "build": "radix-build"
55
56
  },
56
57
  "types": "./dist/index.d.ts",