@radix-ui/react-portal 1.1.18 → 1.2.0-rc.1791406557805

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.d.mts CHANGED
@@ -6,7 +6,7 @@ interface PortalProps extends PrimitiveDivProps {
6
6
  /**
7
7
  * An optional container where the portaled content should be appended.
8
8
  */
9
- container?: Element | DocumentFragment | null;
9
+ container?: Element | DocumentFragment | null | undefined;
10
10
  }
11
11
  declare const Portal: React.ForwardRefExoticComponent<PortalProps & React.RefAttributes<HTMLDivElement>>;
12
12
 
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ interface PortalProps extends PrimitiveDivProps {
6
6
  /**
7
7
  * An optional container where the portaled content should be appended.
8
8
  */
9
- container?: Element | DocumentFragment | null;
9
+ container?: Element | DocumentFragment | null | undefined;
10
10
  }
11
11
  declare const Portal: React.ForwardRefExoticComponent<PortalProps & React.RefAttributes<HTMLDivElement>>;
12
12
 
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;\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';\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"],
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
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/portal.tsx"],
4
- "sourcesContent": ["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;\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": ["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,YAAY,WAAW;AACvB,YAAY,cAAc;AAC1B,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;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,oBAAgB,MAAM,WAAW,IAAI,GAAG,CAAC,CAAC;AAC1C,UAAM,YAAY,iBAAkB,WAAW,YAAY,UAAU;AACrE,WAAO,YACM,sBAAa,oBAAC,UAAU,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.1.18",
3
+ "version": "1.2.0-rc.1791406557805",
4
4
  "license": "MIT",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./dist/index.js",
@@ -11,7 +11,7 @@
11
11
  ],
12
12
  "sideEffects": false,
13
13
  "dependencies": {
14
- "@radix-ui/react-primitive": "2.1.11",
14
+ "@radix-ui/react-primitive": "2.2.0-rc.1791406557805",
15
15
  "@radix-ui/react-use-layout-effect": "1.1.4"
16
16
  },
17
17
  "devDependencies": {
@@ -20,8 +20,8 @@
20
20
  "react": "^19.2.8",
21
21
  "react-dom": "^19.2.8",
22
22
  "typescript": "^5.9.3",
23
- "@repo/builder": "0.0.0",
24
- "@repo/typescript-config": "0.0.0"
23
+ "@repo/typescript-config": "0.0.0",
24
+ "@repo/builder": "0.0.0"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "@types/react": "*",