@radix-ui/react-portal 1.0.2 → 1.0.3-rc.10

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.
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ import * as Radix from "@radix-ui/react-primitive";
3
+ import { Primitive } from "@radix-ui/react-primitive";
4
+ type PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;
5
+ export interface PortalProps extends PrimitiveDivProps {
6
+ container?: HTMLElement | null;
7
+ }
8
+ export const Portal: React.ForwardRefExoticComponent<PortalProps & React.RefAttributes<HTMLDivElement>>;
9
+ export const Root: React.ForwardRefExoticComponent<PortalProps & React.RefAttributes<HTMLDivElement>>;
10
+
11
+ //# sourceMappingURL=index.d.ts.map
@@ -26,4 +26,4 @@ const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ $7SXl2$forwardRe
26
26
 
27
27
 
28
28
  export {$f1701beae083dbae$export$602eac185826482c as Portal, $f1701beae083dbae$export$be92b6f5f03c0fe9 as Root};
29
- //# sourceMappingURL=index.module.js.map
29
+ //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"mappings":";;;;;A;;;;ACMA;;oGAEA,CAEA,MAAMK,iCAAW,GAAG,QAApB,AAAA;AAQA,MAAML,yCAAM,GAAA,aAAGE,CAAAA,iBAAA,CAA6C,CAACK,KAAD,EAAQC,YAAR,GAAyB;IAAA,IAAA,oBAAA,AAAA;IACnF,MAAM,aAAEC,SAAS,GAAGC,UAAH,KAAA,IAAA,IAAGA,UAAH,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,AAAA,CAAA,oBAAA,GAAGA,UAAU,CAAEC,QAAf,CAAA,KAAA,IAAA,IAAA,oBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAG,oBAAA,CAAsBC,IAApC,GAA0C,GAAGC,WAAH,EAA1C,GAA6DN,KAAnE,AAAM;IACN,OAAOE,SAAS,GAAA,aACZN,CAAAA,eAAQ,CAACW,YAAT,CAAA,aAAsB,CAAA,oBAAA,CAAC,gBAAD,CAAW,GAAX,EAAA,oCAAA,CAAA,EAAA,EAAmBD,WAAnB,EAD1B;QAC0D,GAAG,EAAEL,YAAL;KAAhC,CAAA,CAAtB,EAA6EC,SAA7E,CADY,GAEZ,IAFJ,CAC0B;CAHb,CAAf,AAKC;AAED,aAAA,CAAA,MAAA,CAAA,MAAA,CAAA,yCAAA,EAAA;IAAA,WAAA,EAAA,iCAAA;CAAA,CAAA,CAAA;AAEA,oGAAA,CAEA,MAAMR,yCAAI,GAAGD,yCAAb,AAAA;;AD7BA","sources":["packages/react/portal/src/index.ts","packages/react/portal/src/Portal.tsx"],"sourcesContent":["export {\n Portal,\n //\n Root,\n} from './Portal';\nexport type { PortalProps } from './Portal';\n","import * as React from 'react';\nimport ReactDOM from 'react-dom';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type * as Radix from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Portal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'Portal';\n\ntype PortalElement = React.ElementRef<typeof Primitive.div>;\ntype PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface PortalProps extends PrimitiveDivProps {\n container?: HTMLElement | null;\n}\n\nconst Portal = React.forwardRef<PortalElement, PortalProps>((props, forwardedRef) => {\n const { container = globalThis?.document?.body, ...portalProps } = props;\n return container\n ? ReactDOM.createPortal(<Primitive.div {...portalProps} ref={forwardedRef} />, container)\n : null;\n});\n\nPortal.displayName = PORTAL_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Portal;\n\nexport {\n Portal,\n //\n Root,\n};\nexport type { PortalProps };\n"],"names":["Portal","Root","React","ReactDOM","Primitive","PORTAL_NAME","forwardRef","props","forwardedRef","container","globalThis","document","body","portalProps","createPortal"],"version":3,"file":"index.module.js.map"}
1
+ {"mappings":";;;;;A;;;;ACMA;;oGAEA,CAEA,MAAMK,iCAAW,GAAG,QAApB,AAAA;AAQA,MAAML,yCAAM,GAAA,aAAGE,CAAAA,iBAAA,CAA6C,CAACK,KAAD,EAAQC,YAAR,GAAyB;IAAA,IAAA,oBAAA,AAAA;IACnF,MAAM,aAAEC,SAAS,GAAGC,UAAH,KAAA,IAAA,IAAGA,UAAH,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,AAAA,CAAA,oBAAA,GAAGA,UAAU,CAAEC,QAAf,CAAA,KAAA,IAAA,IAAA,oBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAG,oBAAA,CAAsBC,IAApC,GAA0C,GAAGC,WAAH,EAA1C,GAA6DN,KAAnE,AAAM;IACN,OAAOE,SAAS,GAAA,aACZN,CAAAA,eAAQ,CAACW,YAAT,CAAA,aAAsB,CAAA,oBAAA,CAAC,gBAAD,CAAW,GAAX,EAAA,oCAAA,CAAA,EAAA,EAAmBD,WAAnB,EAD1B;QAC0D,GAAG,EAAEL,YAAL;KAAhC,CAAA,CAAtB,EAA6EC,SAA7E,CADY,GAEZ,IAFJ,CAC0B;CAHb,CAAf,AAKC;AAED,aAAA,CAAA,MAAA,CAAA,MAAA,CAAA,yCAAA,EAAA;IAAA,WAAA,EAAA,iCAAA;CAAA,CAAA,CAAA;AAEA,oGAAA,CAEA,MAAMR,yCAAI,GAAGD,yCAAb,AAAA;;AD7BA","sources":["packages/react/portal/src/index.ts","packages/react/portal/src/Portal.tsx"],"sourcesContent":["export {\n Portal,\n //\n Root,\n} from './Portal';\nexport type { PortalProps } from './Portal';\n","import * as React from 'react';\nimport ReactDOM from 'react-dom';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type * as Radix from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Portal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'Portal';\n\ntype PortalElement = React.ElementRef<typeof Primitive.div>;\ntype PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface PortalProps extends PrimitiveDivProps {\n container?: HTMLElement | null;\n}\n\nconst Portal = React.forwardRef<PortalElement, PortalProps>((props, forwardedRef) => {\n const { container = globalThis?.document?.body, ...portalProps } = props;\n return container\n ? ReactDOM.createPortal(<Primitive.div {...portalProps} ref={forwardedRef} />, container)\n : null;\n});\n\nPortal.displayName = PORTAL_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Portal;\n\nexport {\n Portal,\n //\n Root,\n};\nexport type { PortalProps };\n"],"names":["Portal","Root","React","ReactDOM","Primitive","PORTAL_NAME","forwardRef","props","forwardedRef","container","globalThis","document","body","portalProps","createPortal"],"version":3,"file":"index.mjs.map"}
package/package.json CHANGED
@@ -1,11 +1,23 @@
1
1
  {
2
2
  "name": "@radix-ui/react-portal",
3
- "version": "1.0.2",
3
+ "version": "1.0.3-rc.10",
4
4
  "license": "MIT",
5
- "source": "src/index.ts",
6
- "main": "dist/index.js",
7
- "module": "dist/index.module.js",
8
- "types": "dist/index.d.ts",
5
+ "exports": {
6
+ ".": {
7
+ "import": {
8
+ "types": "./dist/index.d.mts",
9
+ "default": "./dist/index.mjs"
10
+ },
11
+ "require": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.js"
14
+ }
15
+ }
16
+ },
17
+ "source": "./src/index.ts",
18
+ "main": "./dist/index.js",
19
+ "module": "./dist/index.mjs",
20
+ "types": "./dist/index.d.ts",
9
21
  "files": [
10
22
  "dist",
11
23
  "README.md"
@@ -17,12 +29,22 @@
17
29
  },
18
30
  "dependencies": {
19
31
  "@babel/runtime": "^7.13.10",
20
- "@radix-ui/react-primitive": "1.0.2"
32
+ "@radix-ui/react-primitive": "1.0.3-rc.10"
21
33
  },
22
34
  "peerDependencies": {
35
+ "@types/react": "*",
36
+ "@types/react-dom": "*",
23
37
  "react": "^16.8 || ^17.0 || ^18.0",
24
38
  "react-dom": "^16.8 || ^17.0 || ^18.0"
25
39
  },
40
+ "peerDependenciesMeta": {
41
+ "@types/react": {
42
+ "optional": true
43
+ },
44
+ "@types/react-dom": {
45
+ "optional": true
46
+ }
47
+ },
26
48
  "homepage": "https://radix-ui.com/primitives",
27
49
  "repository": {
28
50
  "type": "git",
@@ -30,5 +52,6 @@
30
52
  },
31
53
  "bugs": {
32
54
  "url": "https://github.com/radix-ui/primitives/issues"
33
- }
55
+ },
56
+ "stableVersion": "1.0.2"
34
57
  }