@yamada-ui/portal
Advanced tools
Comparing version 0.0.0-dev-20230716195657 to 0.0.0-dev-20230718011629
@@ -39,6 +39,3 @@ "use strict"; | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var DefaultPortal = ({ | ||
appendToParentPortal, | ||
children | ||
}) => { | ||
var DefaultPortal = ({ appendToParentPortal, children }) => { | ||
const [node, setNode] = (0, import_react.useState)(null); | ||
@@ -66,3 +63,6 @@ const el = (0, import_react.useRef)(null); | ||
}, [node]); | ||
return el.current ? (0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(PortalProvider, { value: el.current, children }), el.current) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { ref: (el2) => el2 ? setNode(el2) : void 0 }); | ||
return el.current ? (0, import_react_dom.createPortal)( | ||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(PortalProvider, { value: el.current, children }), | ||
el.current | ||
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { ref: (el2) => el2 ? setNode(el2) : void 0 }); | ||
}; | ||
@@ -69,0 +69,0 @@ // Annotate the CommonJS export names for ESM import in node: |
@@ -31,4 +31,14 @@ "use strict"; | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var Portal = ({ containerRef, appendToParentPortal = true, children }) => { | ||
return containerRef ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ContainerPortal, { containerRef, ...{ children } }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DefaultPortal, { appendToParentPortal, ...{ children } }); | ||
var Portal = ({ | ||
containerRef, | ||
appendToParentPortal = true, | ||
children | ||
}) => { | ||
return containerRef ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ContainerPortal, { containerRef, ...{ children } }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)( | ||
DefaultPortal, | ||
{ | ||
appendToParentPortal, | ||
...{ children } | ||
} | ||
); | ||
}; | ||
@@ -52,6 +62,3 @@ Portal.className = "ui-portal"; | ||
var import_jsx_runtime2 = require("react/jsx-runtime"); | ||
var DefaultPortal = ({ | ||
appendToParentPortal, | ||
children | ||
}) => { | ||
var DefaultPortal = ({ appendToParentPortal, children }) => { | ||
const [node, setNode] = (0, import_react.useState)(null); | ||
@@ -79,3 +86,6 @@ const el = (0, import_react.useRef)(null); | ||
}, [node]); | ||
return el.current ? (0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PortalProvider, { value: el.current, children }), el.current) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { ref: (el2) => el2 ? setNode(el2) : void 0 }); | ||
return el.current ? (0, import_react_dom.createPortal)( | ||
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PortalProvider, { value: el.current, children }), | ||
el.current | ||
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { ref: (el2) => el2 ? setNode(el2) : void 0 }); | ||
}; | ||
@@ -82,0 +92,0 @@ |
@@ -23,3 +23,3 @@ import * as react_jsx_runtime from 'react/jsx-runtime'; | ||
declare const Portal: { | ||
({ containerRef, appendToParentPortal, children }: PortalProps): react_jsx_runtime.JSX.Element; | ||
({ containerRef, appendToParentPortal, children, }: PortalProps): react_jsx_runtime.JSX.Element; | ||
className: string; | ||
@@ -26,0 +26,0 @@ selector: string; |
@@ -41,6 +41,3 @@ "use strict"; | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var DefaultPortal = ({ | ||
appendToParentPortal, | ||
children | ||
}) => { | ||
var DefaultPortal = ({ appendToParentPortal, children }) => { | ||
const [node, setNode] = (0, import_react.useState)(null); | ||
@@ -68,3 +65,6 @@ const el = (0, import_react.useRef)(null); | ||
}, [node]); | ||
return el.current ? (0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(PortalProvider, { value: el.current, children }), el.current) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { ref: (el2) => el2 ? setNode(el2) : void 0 }); | ||
return el.current ? (0, import_react_dom.createPortal)( | ||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(PortalProvider, { value: el.current, children }), | ||
el.current | ||
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { ref: (el2) => el2 ? setNode(el2) : void 0 }); | ||
}; | ||
@@ -111,4 +111,14 @@ | ||
var import_jsx_runtime3 = require("react/jsx-runtime"); | ||
var Portal = ({ containerRef, appendToParentPortal = true, children }) => { | ||
return containerRef ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ContainerPortal, { containerRef, ...{ children } }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(DefaultPortal, { appendToParentPortal, ...{ children } }); | ||
var Portal = ({ | ||
containerRef, | ||
appendToParentPortal = true, | ||
children | ||
}) => { | ||
return containerRef ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ContainerPortal, { containerRef, ...{ children } }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)( | ||
DefaultPortal, | ||
{ | ||
appendToParentPortal, | ||
...{ children } | ||
} | ||
); | ||
}; | ||
@@ -115,0 +125,0 @@ Portal.className = "ui-portal"; |
{ | ||
"name": "@yamada-ui/portal", | ||
"version": "0.0.0-dev-20230716195657", | ||
"version": "0.0.0-dev-20230718011629", | ||
"description": "Yamada UI portal component", | ||
@@ -38,3 +38,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@yamada-ui/utils": "0.0.0-dev-20230716195657" | ||
"@yamada-ui/utils": "0.0.0-dev-20230718011629" | ||
}, | ||
@@ -41,0 +41,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
26017
630
+ Added@yamada-ui/utils@0.0.0-dev-20230718011629(transitive)
- Removed@yamada-ui/utils@0.0.0-dev-20230716195657(transitive)