@easypost/easy-ui 1.0.0-alpha.97 → 1.0.0-alpha.98
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/CHANGELOG.md +6 -0
- package/Modal/context.d.ts.map +1 -1
- package/Modal/index.js +0 -14
- package/Modal/index.mjs +1 -15
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/Modal/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/Modal/context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACL,aAAa,EACb,SAAS,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/Modal/context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACL,aAAa,EACb,SAAS,EAKV,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAC7C,UAAU,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAC5C,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IACnC,oBAAoB,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IAChD,oBAAoB,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;CACjD,CAAC;AAEF,KAAK,uBAAuB,GAAG;IAC7B,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,mBAAmB,CAAC;IAC3B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,qBAAqB,EAAE,CAAC,kBAAkB,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9D,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC1C,uBAAuB,EACvB,OAAO,GAAG,eAAe,CAC1B,GAAG;IACF,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,YAAY,wCAA+C,CAAC;AAEzE,eAAO,MAAM,eAAe,wBAM3B,CAAC;AAEF,eAAO,MAAM,mBAAmB,+CACqB,CAAC;AAEtD,eAAO,MAAM,sBAAsB,+BAMlC,CAAC;AAEF,eAAO,MAAM,eAAe,2BAG3B,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EACL,aAAa,EACb,QAAQ,GACT,EAAE,yBAAyB,qBAU3B"}
|
package/Modal/index.js
CHANGED
|
@@ -66,7 +66,6 @@ const useModalTrigger = () => {
|
|
|
66
66
|
return modalTriggerContext.state;
|
|
67
67
|
};
|
|
68
68
|
function ModalTriggerProvider({ state, isDismissable, children }) {
|
|
69
|
-
const parentContext = React.useContext(ModalTriggerContext);
|
|
70
69
|
const [hasOpenNestedModal, setHasOpenNestedModal] = React.useState(false);
|
|
71
70
|
const context = React.useMemo(() => {
|
|
72
71
|
return {
|
|
@@ -76,19 +75,6 @@ function ModalTriggerProvider({ state, isDismissable, children }) {
|
|
|
76
75
|
isDismissable
|
|
77
76
|
};
|
|
78
77
|
}, [hasOpenNestedModal, state, isDismissable]);
|
|
79
|
-
React.useLayoutEffect(() => {
|
|
80
|
-
if (parentContext && state.isOpen && !parentContext.hasOpenNestedModal) {
|
|
81
|
-
parentContext.setHasOpenNestedModal(true);
|
|
82
|
-
}
|
|
83
|
-
if (parentContext && !state.isOpen && parentContext.hasOpenNestedModal) {
|
|
84
|
-
parentContext.setHasOpenNestedModal(false);
|
|
85
|
-
}
|
|
86
|
-
return () => {
|
|
87
|
-
if (parentContext && parentContext.hasOpenNestedModal) {
|
|
88
|
-
parentContext.setHasOpenNestedModal(false);
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
}, [parentContext, state.isOpen]);
|
|
92
78
|
return React.createElement(ModalTriggerContext.Provider, {
|
|
93
79
|
value: context
|
|
94
80
|
}, children);
|
package/Modal/index.mjs
CHANGED
|
@@ -29,7 +29,7 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
}
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
|
-
import React__default, { createContext,
|
|
32
|
+
import React__default, { createContext, useState, useMemo, useContext, cloneElement, useRef } from "react";
|
|
33
33
|
import { classNames, variationName } from "../utilities/css.mjs";
|
|
34
34
|
import { useScrollbar } from "../utilities/useScrollbar.mjs";
|
|
35
35
|
import { B as Button } from "../__chunks__/Button-BUkrUXzg.mjs";
|
|
@@ -64,7 +64,6 @@ const useModalTrigger = () => {
|
|
|
64
64
|
return modalTriggerContext.state;
|
|
65
65
|
};
|
|
66
66
|
function ModalTriggerProvider({ state, isDismissable, children }) {
|
|
67
|
-
const parentContext = useContext(ModalTriggerContext);
|
|
68
67
|
const [hasOpenNestedModal, setHasOpenNestedModal] = useState(false);
|
|
69
68
|
const context = useMemo(() => {
|
|
70
69
|
return {
|
|
@@ -74,19 +73,6 @@ function ModalTriggerProvider({ state, isDismissable, children }) {
|
|
|
74
73
|
isDismissable
|
|
75
74
|
};
|
|
76
75
|
}, [hasOpenNestedModal, state, isDismissable]);
|
|
77
|
-
useLayoutEffect(() => {
|
|
78
|
-
if (parentContext && state.isOpen && !parentContext.hasOpenNestedModal) {
|
|
79
|
-
parentContext.setHasOpenNestedModal(true);
|
|
80
|
-
}
|
|
81
|
-
if (parentContext && !state.isOpen && parentContext.hasOpenNestedModal) {
|
|
82
|
-
parentContext.setHasOpenNestedModal(false);
|
|
83
|
-
}
|
|
84
|
-
return () => {
|
|
85
|
-
if (parentContext && parentContext.hasOpenNestedModal) {
|
|
86
|
-
parentContext.setHasOpenNestedModal(false);
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
}, [parentContext, state.isOpen]);
|
|
90
76
|
return React__default.createElement(ModalTriggerContext.Provider, {
|
|
91
77
|
value: context
|
|
92
78
|
}, children);
|