@geomak/ui 7.4.1 → 7.4.2
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.cjs +15 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/dist/styles.css +10 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4596,7 +4596,7 @@ function ScalableContainer({
|
|
|
4596
4596
|
collapseIcon,
|
|
4597
4597
|
togglePosition = "top-right",
|
|
4598
4598
|
expandContainerRef,
|
|
4599
|
-
expandRatio =
|
|
4599
|
+
expandRatio = 3,
|
|
4600
4600
|
className = ""
|
|
4601
4601
|
}) {
|
|
4602
4602
|
const containerRef = React30.useRef(null);
|
|
@@ -4606,6 +4606,15 @@ function ScalableContainer({
|
|
|
4606
4606
|
const usePush = expandContainerRef != null;
|
|
4607
4607
|
const grownRef = React30.useRef([]);
|
|
4608
4608
|
const prevScaled = React30.useRef(isScaled);
|
|
4609
|
+
const kickResizeDuringTransition = () => {
|
|
4610
|
+
if (typeof window === "undefined") return;
|
|
4611
|
+
const kick = () => window.dispatchEvent(new Event("resize"));
|
|
4612
|
+
const interval = window.setInterval(kick, 80);
|
|
4613
|
+
window.setTimeout(() => {
|
|
4614
|
+
window.clearInterval(interval);
|
|
4615
|
+
kick();
|
|
4616
|
+
}, reduced ? 0 : 400);
|
|
4617
|
+
};
|
|
4609
4618
|
const growAncestors = () => {
|
|
4610
4619
|
const bound = expandContainerRef?.current;
|
|
4611
4620
|
if (!bound || !containerRef.current) return;
|
|
@@ -4646,6 +4655,7 @@ function ScalableContainer({
|
|
|
4646
4655
|
prevScaled.current = isScaled;
|
|
4647
4656
|
if (isScaled) growAncestors();
|
|
4648
4657
|
else restoreAncestors();
|
|
4658
|
+
kickResizeDuringTransition();
|
|
4649
4659
|
}, [isScaled, usePush]);
|
|
4650
4660
|
React30.useEffect(() => () => {
|
|
4651
4661
|
for (const { el, prev } of grownRef.current) {
|
|
@@ -4670,6 +4680,10 @@ function ScalableContainer({
|
|
|
4670
4680
|
framerMotion.motion.div,
|
|
4671
4681
|
{
|
|
4672
4682
|
ref: containerRef,
|
|
4683
|
+
style: {
|
|
4684
|
+
width: isScaled && !usePush ? expandedWidth : width,
|
|
4685
|
+
height: isScaled && !usePush ? expandedHeight : height
|
|
4686
|
+
},
|
|
4673
4687
|
animate: {
|
|
4674
4688
|
// Push mode keeps the container filling its (now growing)
|
|
4675
4689
|
// wrapper — the wrapper's flex-grow does the work.
|