@geomak/ui 7.4.2 → 7.4.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.
package/dist/index.d.cts CHANGED
@@ -2065,19 +2065,21 @@ interface ScalableContainerProps {
2065
2065
  * Bounding element the expansion is allowed to grow within. When the
2066
2066
  * container sits in size-constrained flex-item wrappers (where width /
2067
2067
  * height 100% makes expand-in-place a no-op), providing this ref switches
2068
- * to PUSH expansion: every flex item between the container and this
2069
- * element gets its `flex-grow` raised (animated), so this container takes
2070
- * most of the space while its siblings shrink but stay visible.
2071
- * Collapsing restores the wrappers' original sizing. Omit for the classic
2068
+ * to PUSH expansion: the container's row becomes `flex-wrap: wrap` and the
2069
+ * container takes the FULL parent width (`flex-basis: 100%`), so sibling
2070
+ * charts reflow below it at full widthpushed, visible, and intact.
2071
+ * Column levels between the container and this element get `flex-grow`
2072
+ * raised so the expanded row dominates vertically too. Collapsing
2073
+ * restores the wrappers' original sizing exactly. Omit for the classic
2072
2074
  * expand-in-place behaviour.
2073
2075
  */
2074
2076
  expandContainerRef?: react__default.RefObject<HTMLElement | null>;
2075
2077
  /**
2076
- * How dominant the pushed expansion is, as a flex-grow multiplier applied
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.
2078
+ * Vertical dominance of the pushed expansion (push mode only). Default
2079
+ * `3` the expanded chart keeps expandRatio/(expandRatio+1) of its row's
2080
+ * height (and its row takes expandRatio parts per sibling row), leaving
2081
+ * the reflowed siblings the remainder. Raise for a more fullscreen feel,
2082
+ * lower for a gentler split.
2081
2083
  */
2082
2084
  expandRatio?: number;
2083
2085
  /** Extra classes merged onto the container root. */
@@ -2093,10 +2095,12 @@ interface ScalableContainerProps {
2093
2095
  * - **In place** (default): animates the container's own width/height to
2094
2096
  * `expandedWidth`/`expandedHeight`.
2095
2097
  * - **Push** (`expandContainerRef` set): for containers whose resting size is
2096
- * owned by flex-item wrappers. Expanding raises `flex-grow` on every flex
2097
- * item between the container and the bounding element, so the container
2098
- * grows to dominate the section while sibling containers shrink but remain
2099
- * visible. Collapsing restores the original layout.
2098
+ * owned by flex-item wrappers. Expanding makes the container span the FULL
2099
+ * parent width (its row becomes `flex-wrap: wrap` and the wrapper takes
2100
+ * `flex-basis: 100%`), with sibling charts reflowing below it at full
2101
+ * width — visible and intact, not squeezed. Column levels raise `flex-grow`
2102
+ * so the expanded row also dominates vertically. Collapsing restores the
2103
+ * original layout exactly.
2100
2104
  *
2101
2105
  * @example
2102
2106
  * ```tsx
package/dist/index.d.ts CHANGED
@@ -2065,19 +2065,21 @@ interface ScalableContainerProps {
2065
2065
  * Bounding element the expansion is allowed to grow within. When the
2066
2066
  * container sits in size-constrained flex-item wrappers (where width /
2067
2067
  * height 100% makes expand-in-place a no-op), providing this ref switches
2068
- * to PUSH expansion: every flex item between the container and this
2069
- * element gets its `flex-grow` raised (animated), so this container takes
2070
- * most of the space while its siblings shrink but stay visible.
2071
- * Collapsing restores the wrappers' original sizing. Omit for the classic
2068
+ * to PUSH expansion: the container's row becomes `flex-wrap: wrap` and the
2069
+ * container takes the FULL parent width (`flex-basis: 100%`), so sibling
2070
+ * charts reflow below it at full widthpushed, visible, and intact.
2071
+ * Column levels between the container and this element get `flex-grow`
2072
+ * raised so the expanded row dominates vertically too. Collapsing
2073
+ * restores the wrappers' original sizing exactly. Omit for the classic
2072
2074
  * expand-in-place behaviour.
2073
2075
  */
2074
2076
  expandContainerRef?: react__default.RefObject<HTMLElement | null>;
2075
2077
  /**
2076
- * How dominant the pushed expansion is, as a flex-grow multiplier applied
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.
2078
+ * Vertical dominance of the pushed expansion (push mode only). Default
2079
+ * `3` the expanded chart keeps expandRatio/(expandRatio+1) of its row's
2080
+ * height (and its row takes expandRatio parts per sibling row), leaving
2081
+ * the reflowed siblings the remainder. Raise for a more fullscreen feel,
2082
+ * lower for a gentler split.
2081
2083
  */
2082
2084
  expandRatio?: number;
2083
2085
  /** Extra classes merged onto the container root. */
@@ -2093,10 +2095,12 @@ interface ScalableContainerProps {
2093
2095
  * - **In place** (default): animates the container's own width/height to
2094
2096
  * `expandedWidth`/`expandedHeight`.
2095
2097
  * - **Push** (`expandContainerRef` set): for containers whose resting size is
2096
- * owned by flex-item wrappers. Expanding raises `flex-grow` on every flex
2097
- * item between the container and the bounding element, so the container
2098
- * grows to dominate the section while sibling containers shrink but remain
2099
- * visible. Collapsing restores the original layout.
2098
+ * owned by flex-item wrappers. Expanding makes the container span the FULL
2099
+ * parent width (its row becomes `flex-wrap: wrap` and the wrapper takes
2100
+ * `flex-basis: 100%`), with sibling charts reflowing below it at full
2101
+ * width — visible and intact, not squeezed. Column levels raise `flex-grow`
2102
+ * so the expanded row also dominates vertically. Collapsing restores the
2103
+ * original layout exactly.
2100
2104
  *
2101
2105
  * @example
2102
2106
  * ```tsx
package/dist/index.js CHANGED
@@ -4585,30 +4585,43 @@ function ScalableContainer({
4585
4585
  let el = containerRef.current.parentElement;
4586
4586
  while (el && el !== bound && bound.contains(el)) {
4587
4587
  const parent = el.parentElement;
4588
- if (parent && getComputedStyle(parent).display.includes("flex")) {
4588
+ const parentStyle = parent ? getComputedStyle(parent) : null;
4589
+ if (parent && parentStyle && parentStyle.display.includes("flex")) {
4589
4590
  grown.push({
4590
4591
  el,
4592
+ parent,
4591
4593
  prev: {
4592
4594
  flexGrow: el.style.flexGrow,
4593
4595
  flexBasis: el.style.flexBasis,
4594
- transition: el.style.transition
4596
+ height: el.style.height,
4597
+ transition: el.style.transition,
4598
+ parentFlexWrap: parent.style.flexWrap
4595
4599
  }
4596
4600
  });
4597
- const grow = `flex-grow ${reduced ? 0 : 0.32}s cubic-bezier(0.16, 1, 0.3, 1), flex-basis ${reduced ? 0 : 0.32}s cubic-bezier(0.16, 1, 0.3, 1)`;
4598
- el.style.transition = el.style.transition ? `${el.style.transition}, ${grow}` : grow;
4599
- el.style.flexBasis = "0%";
4600
- el.style.flexGrow = String(expandRatio);
4601
+ const t = (prop) => `${prop} ${reduced ? 0 : 0.32}s cubic-bezier(0.16, 1, 0.3, 1)`;
4602
+ const ours = `${t("flex-grow")}, ${t("flex-basis")}, ${t("height")}`;
4603
+ el.style.transition = el.style.transition ? `${el.style.transition}, ${ours}` : ours;
4604
+ if (parentStyle.flexDirection.startsWith("row")) {
4605
+ parent.style.flexWrap = "wrap";
4606
+ el.style.flexBasis = "100%";
4607
+ el.style.height = `${expandRatio / (expandRatio + 1) * 100}%`;
4608
+ } else {
4609
+ el.style.flexBasis = "0%";
4610
+ el.style.flexGrow = String(expandRatio);
4611
+ }
4601
4612
  }
4602
4613
  el = parent;
4603
4614
  }
4604
4615
  grownRef.current = grown;
4605
4616
  };
4606
4617
  const restoreAncestors = () => {
4607
- for (const { el, prev } of grownRef.current) {
4618
+ for (const { el, parent, prev } of grownRef.current) {
4608
4619
  el.style.flexGrow = prev.flexGrow;
4609
4620
  el.style.flexBasis = prev.flexBasis;
4621
+ el.style.height = prev.height;
4610
4622
  window.setTimeout(() => {
4611
4623
  el.style.transition = prev.transition;
4624
+ parent.style.flexWrap = prev.parentFlexWrap;
4612
4625
  }, reduced ? 0 : 360);
4613
4626
  }
4614
4627
  grownRef.current = [];
@@ -4621,10 +4634,12 @@ function ScalableContainer({
4621
4634
  kickResizeDuringTransition();
4622
4635
  }, [isScaled, usePush]);
4623
4636
  useEffect(() => () => {
4624
- for (const { el, prev } of grownRef.current) {
4637
+ for (const { el, parent, prev } of grownRef.current) {
4625
4638
  el.style.flexGrow = prev.flexGrow;
4626
4639
  el.style.flexBasis = prev.flexBasis;
4640
+ el.style.height = prev.height;
4627
4641
  el.style.transition = prev.transition;
4642
+ parent.style.flexWrap = prev.parentFlexWrap;
4628
4643
  }
4629
4644
  }, []);
4630
4645
  const onToggle = () => {