@shipengine/alchemy 2.3.2 → 2.3.3
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
1
2
|
type ElementContainerContextValue = {
|
|
2
|
-
elementContainer: HTMLDivElement
|
|
3
|
+
elementContainer: RefObject<HTMLDivElement>;
|
|
3
4
|
};
|
|
4
5
|
export type ElementContainerProviderProps = {
|
|
5
6
|
children: React.ReactNode;
|
|
@@ -11,7 +12,7 @@ export type ElementContainerProviderProps = {
|
|
|
11
12
|
* Useful for re-targetting portal-based UI that would otherwise render at React's #root, placing it outside of
|
|
12
13
|
* the Element and lacking any styles.
|
|
13
14
|
*
|
|
14
|
-
* @example <IconTooltip container={elementContainer} {...otherProps} />
|
|
15
|
+
* @example <IconTooltip container={elementContainer.current} {...otherProps} />
|
|
15
16
|
*/
|
|
16
17
|
export declare const ElementContainerProvider: ({ children, className, }: ElementContainerProviderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
17
18
|
export declare const useElementContainer: () => ElementContainerContextValue;
|
package/index.js
CHANGED
|
@@ -10055,7 +10055,7 @@ const ElementContainerProvider = ({
|
|
|
10055
10055
|
}) => {
|
|
10056
10056
|
const { scope } = useAlchemy();
|
|
10057
10057
|
const elementContainerRef = React.useRef(null);
|
|
10058
|
-
return /* @__PURE__ */ jsx(ElementContainerContext.Provider, { value: { elementContainer: elementContainerRef
|
|
10058
|
+
return /* @__PURE__ */ jsx(ElementContainerContext.Provider, { value: { elementContainer: elementContainerRef }, children: /* @__PURE__ */ jsx("div", { className: cx(scope, className), "data-testid": scope, ref: elementContainerRef, children }) });
|
|
10059
10059
|
};
|
|
10060
10060
|
const useElementContainer = () => {
|
|
10061
10061
|
const context = React.useContext(ElementContainerContext);
|
package/index.mjs
CHANGED
|
@@ -10033,7 +10033,7 @@ const ElementContainerProvider = ({
|
|
|
10033
10033
|
}) => {
|
|
10034
10034
|
const { scope } = useAlchemy();
|
|
10035
10035
|
const elementContainerRef = useRef(null);
|
|
10036
|
-
return /* @__PURE__ */ jsx(ElementContainerContext.Provider, { value: { elementContainer: elementContainerRef
|
|
10036
|
+
return /* @__PURE__ */ jsx(ElementContainerContext.Provider, { value: { elementContainer: elementContainerRef }, children: /* @__PURE__ */ jsx("div", { className: cx(scope, className), "data-testid": scope, ref: elementContainerRef, children }) });
|
|
10037
10037
|
};
|
|
10038
10038
|
const useElementContainer = () => {
|
|
10039
10039
|
const context = useContext(ElementContainerContext);
|