@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.d.cts CHANGED
@@ -2074,9 +2074,10 @@ interface ScalableContainerProps {
2074
2074
  expandContainerRef?: react__default.RefObject<HTMLElement | null>;
2075
2075
  /**
2076
2076
  * How dominant the pushed expansion is, as a flex-grow multiplier applied
2077
- * to the container's wrappers (push mode only). Default `5` — i.e. the
2078
- * expanded container takes roughly 5 parts for every 1 part a sibling
2079
- * keeps. Raise for a more fullscreen feel, lower for a gentler split.
2077
+ * to the container's wrappers (push mode only). Default `3` — i.e. the
2078
+ * expanded container takes roughly 3 parts for every 1 part a sibling
2079
+ * keeps, leaving the siblings enough room to stay legible. Raise for a
2080
+ * more fullscreen feel, lower for a gentler split.
2080
2081
  */
2081
2082
  expandRatio?: number;
2082
2083
  /** Extra classes merged onto the container root. */
package/dist/index.d.ts CHANGED
@@ -2074,9 +2074,10 @@ interface ScalableContainerProps {
2074
2074
  expandContainerRef?: react__default.RefObject<HTMLElement | null>;
2075
2075
  /**
2076
2076
  * How dominant the pushed expansion is, as a flex-grow multiplier applied
2077
- * to the container's wrappers (push mode only). Default `5` — i.e. the
2078
- * expanded container takes roughly 5 parts for every 1 part a sibling
2079
- * keeps. Raise for a more fullscreen feel, lower for a gentler split.
2077
+ * to the container's wrappers (push mode only). Default `3` — i.e. the
2078
+ * expanded container takes roughly 3 parts for every 1 part a sibling
2079
+ * keeps, leaving the siblings enough room to stay legible. Raise for a
2080
+ * more fullscreen feel, lower for a gentler split.
2080
2081
  */
2081
2082
  expandRatio?: number;
2082
2083
  /** Extra classes merged onto the container root. */
package/dist/index.js CHANGED
@@ -4559,7 +4559,7 @@ function ScalableContainer({
4559
4559
  collapseIcon,
4560
4560
  togglePosition = "top-right",
4561
4561
  expandContainerRef,
4562
- expandRatio = 5,
4562
+ expandRatio = 3,
4563
4563
  className = ""
4564
4564
  }) {
4565
4565
  const containerRef = useRef(null);
@@ -4569,6 +4569,15 @@ function ScalableContainer({
4569
4569
  const usePush = expandContainerRef != null;
4570
4570
  const grownRef = useRef([]);
4571
4571
  const prevScaled = useRef(isScaled);
4572
+ const kickResizeDuringTransition = () => {
4573
+ if (typeof window === "undefined") return;
4574
+ const kick = () => window.dispatchEvent(new Event("resize"));
4575
+ const interval = window.setInterval(kick, 80);
4576
+ window.setTimeout(() => {
4577
+ window.clearInterval(interval);
4578
+ kick();
4579
+ }, reduced ? 0 : 400);
4580
+ };
4572
4581
  const growAncestors = () => {
4573
4582
  const bound = expandContainerRef?.current;
4574
4583
  if (!bound || !containerRef.current) return;
@@ -4609,6 +4618,7 @@ function ScalableContainer({
4609
4618
  prevScaled.current = isScaled;
4610
4619
  if (isScaled) growAncestors();
4611
4620
  else restoreAncestors();
4621
+ kickResizeDuringTransition();
4612
4622
  }, [isScaled, usePush]);
4613
4623
  useEffect(() => () => {
4614
4624
  for (const { el, prev } of grownRef.current) {
@@ -4633,6 +4643,10 @@ function ScalableContainer({
4633
4643
  motion.div,
4634
4644
  {
4635
4645
  ref: containerRef,
4646
+ style: {
4647
+ width: isScaled && !usePush ? expandedWidth : width,
4648
+ height: isScaled && !usePush ? expandedHeight : height
4649
+ },
4636
4650
  animate: {
4637
4651
  // Push mode keeps the container filling its (now growing)
4638
4652
  // wrapper — the wrapper's flex-grow does the work.