@geomak/ui 7.7.3 → 7.7.4

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
@@ -2084,22 +2084,22 @@ interface ListProps {
2084
2084
  declare function List({ items, onItemClick, activeKey, density, className, style, }: ListProps): react_jsx_runtime.JSX.Element;
2085
2085
 
2086
2086
  interface ScalableContainerProps {
2087
- /** Resting width. Any CSS length / percent. Default `'100%'`. */
2087
+ /**
2088
+ * Resting width. Optional — when omitted, the resting size is left to your
2089
+ * own `className` / parent layout (so the container can sit in a fluid grid
2090
+ * sized by `w-[…]` classes). Only set this if you want an inline width.
2091
+ */
2088
2092
  width?: react__default.CSSProperties['width'];
2089
- /** Resting height. Any CSS length / percent. Default `'auto'`. */
2093
+ /** Resting height. Optional see {@link ScalableContainerProps.width}. */
2090
2094
  height?: react__default.CSSProperties['height'];
2091
2095
  /**
2092
- * Width when expanded. A concrete value (e.g. `900` or `'60rem'`) makes the
2093
- * container grow even when its resting width is `'100%'` inside a flex/grid
2094
- * cell. Falls back to {@link ScalableContainerProps.expandedWidth}, then
2095
- * `'100%'`.
2096
+ * Width when expanded. Default `'100%'`. Use `'100%'` to span the full row
2097
+ * of a flex/grid so the container pushes its neighbours onto the next
2098
+ * row(s); a concrete value (e.g. `900`) grows it to that exact width.
2096
2099
  */
2097
2100
  targetWidth?: react__default.CSSProperties['width'];
2098
- /**
2099
- * Height when expanded. A concrete value (e.g. `600`) lets the container
2100
- * grow taller and push whatever sits below it further down. Falls back to
2101
- * {@link ScalableContainerProps.expandedHeight}, then `'100%'`.
2102
- */
2101
+ /** Height when expanded. Default `'100%'`. A concrete value (e.g. `580`)
2102
+ * grows the container taller and pushes whatever follows further down. */
2103
2103
  targetHeight?: react__default.CSSProperties['height'];
2104
2104
  /** @deprecated Use `targetWidth`. */
2105
2105
  expandedWidth?: react__default.CSSProperties['width'];
@@ -2130,24 +2130,31 @@ interface ScalableContainerProps {
2130
2130
  className?: string;
2131
2131
  }
2132
2132
  /**
2133
- * Container that smoothly grows to a target size on click and collapses back.
2134
- * Reads like an OS window resize — subtle elevation lift, smooth scale, no
2135
- * colour change.
2136
- *
2137
- * Expansion grows the container's OWN box to `targetWidth` × `targetHeight` and
2138
- * makes it `flex-none` while expanded, so it holds that size and simply pushes
2139
- * its neighbours along the flow they keep their own dimensions and reflow
2140
- * (e.g. wrap onto the next row / move down) rather than being squeezed. Nothing
2141
- * on sibling elements is mutated, so layouts restore exactly on collapse. For
2142
- * neighbours to reflow *below*, give the parent room to wrap (e.g. a
2143
- * `flex flex-wrap` row, or block/auto-rows-grid flow).
2133
+ * Container that grows to a target size on click and collapses back. Reads like
2134
+ * an OS window resize — subtle elevation lift, smooth size transition.
2135
+ *
2136
+ * **Resting size comes from your layout, not from props.** Leave `width`/`height`
2137
+ * unset and size the container with your own `className` (e.g. a fluid grid:
2138
+ * `w-full lg:w-[calc(50%-6px)]`). Only when expanded does the container write an
2139
+ * inline `width`/`height` (= `targetWidth`/`targetHeight`) and go `flex: none`,
2140
+ * so it grows to that size and simply **pushes its neighbours along the flow** —
2141
+ * they keep their own dimensions and reflow (wrap / move down). On collapse the
2142
+ * inline sizing is removed and your className layout takes back over. No sibling
2143
+ * styles are ever touched.
2144
+ *
2145
+ * For neighbours to reflow *below* the expanded one, the parent must be able to
2146
+ * wrap — a `flex flex-wrap` row is the simplest; with `targetWidth="100%"` the
2147
+ * expanded item takes a full row and everything after it moves down.
2144
2148
  *
2145
2149
  * @example
2146
2150
  * ```tsx
2147
- * // In a flex-wrap chart grid — expands to a concrete size and pushes the rest down.
2148
- * <div className="flex flex-wrap gap-2">
2149
- * <ScalableContainer width="100%" height={240} targetWidth="100%" targetHeight={520}>
2150
- * <Chart data={metrics} />
2151
+ * <div className="flex flex-wrap gap-3">
2152
+ * <ScalableContainer
2153
+ * className="w-full lg:w-[calc(50%-6px)]" // resting size — your grid
2154
+ * height={300} // resting height
2155
+ * targetWidth="100%" targetHeight={580} // expanded size
2156
+ * >
2157
+ * <Chart … />
2151
2158
  * </ScalableContainer>
2152
2159
  * …
2153
2160
  * </div>
package/dist/index.d.ts CHANGED
@@ -2084,22 +2084,22 @@ interface ListProps {
2084
2084
  declare function List({ items, onItemClick, activeKey, density, className, style, }: ListProps): react_jsx_runtime.JSX.Element;
2085
2085
 
2086
2086
  interface ScalableContainerProps {
2087
- /** Resting width. Any CSS length / percent. Default `'100%'`. */
2087
+ /**
2088
+ * Resting width. Optional — when omitted, the resting size is left to your
2089
+ * own `className` / parent layout (so the container can sit in a fluid grid
2090
+ * sized by `w-[…]` classes). Only set this if you want an inline width.
2091
+ */
2088
2092
  width?: react__default.CSSProperties['width'];
2089
- /** Resting height. Any CSS length / percent. Default `'auto'`. */
2093
+ /** Resting height. Optional see {@link ScalableContainerProps.width}. */
2090
2094
  height?: react__default.CSSProperties['height'];
2091
2095
  /**
2092
- * Width when expanded. A concrete value (e.g. `900` or `'60rem'`) makes the
2093
- * container grow even when its resting width is `'100%'` inside a flex/grid
2094
- * cell. Falls back to {@link ScalableContainerProps.expandedWidth}, then
2095
- * `'100%'`.
2096
+ * Width when expanded. Default `'100%'`. Use `'100%'` to span the full row
2097
+ * of a flex/grid so the container pushes its neighbours onto the next
2098
+ * row(s); a concrete value (e.g. `900`) grows it to that exact width.
2096
2099
  */
2097
2100
  targetWidth?: react__default.CSSProperties['width'];
2098
- /**
2099
- * Height when expanded. A concrete value (e.g. `600`) lets the container
2100
- * grow taller and push whatever sits below it further down. Falls back to
2101
- * {@link ScalableContainerProps.expandedHeight}, then `'100%'`.
2102
- */
2101
+ /** Height when expanded. Default `'100%'`. A concrete value (e.g. `580`)
2102
+ * grows the container taller and pushes whatever follows further down. */
2103
2103
  targetHeight?: react__default.CSSProperties['height'];
2104
2104
  /** @deprecated Use `targetWidth`. */
2105
2105
  expandedWidth?: react__default.CSSProperties['width'];
@@ -2130,24 +2130,31 @@ interface ScalableContainerProps {
2130
2130
  className?: string;
2131
2131
  }
2132
2132
  /**
2133
- * Container that smoothly grows to a target size on click and collapses back.
2134
- * Reads like an OS window resize — subtle elevation lift, smooth scale, no
2135
- * colour change.
2136
- *
2137
- * Expansion grows the container's OWN box to `targetWidth` × `targetHeight` and
2138
- * makes it `flex-none` while expanded, so it holds that size and simply pushes
2139
- * its neighbours along the flow they keep their own dimensions and reflow
2140
- * (e.g. wrap onto the next row / move down) rather than being squeezed. Nothing
2141
- * on sibling elements is mutated, so layouts restore exactly on collapse. For
2142
- * neighbours to reflow *below*, give the parent room to wrap (e.g. a
2143
- * `flex flex-wrap` row, or block/auto-rows-grid flow).
2133
+ * Container that grows to a target size on click and collapses back. Reads like
2134
+ * an OS window resize — subtle elevation lift, smooth size transition.
2135
+ *
2136
+ * **Resting size comes from your layout, not from props.** Leave `width`/`height`
2137
+ * unset and size the container with your own `className` (e.g. a fluid grid:
2138
+ * `w-full lg:w-[calc(50%-6px)]`). Only when expanded does the container write an
2139
+ * inline `width`/`height` (= `targetWidth`/`targetHeight`) and go `flex: none`,
2140
+ * so it grows to that size and simply **pushes its neighbours along the flow** —
2141
+ * they keep their own dimensions and reflow (wrap / move down). On collapse the
2142
+ * inline sizing is removed and your className layout takes back over. No sibling
2143
+ * styles are ever touched.
2144
+ *
2145
+ * For neighbours to reflow *below* the expanded one, the parent must be able to
2146
+ * wrap — a `flex flex-wrap` row is the simplest; with `targetWidth="100%"` the
2147
+ * expanded item takes a full row and everything after it moves down.
2144
2148
  *
2145
2149
  * @example
2146
2150
  * ```tsx
2147
- * // In a flex-wrap chart grid — expands to a concrete size and pushes the rest down.
2148
- * <div className="flex flex-wrap gap-2">
2149
- * <ScalableContainer width="100%" height={240} targetWidth="100%" targetHeight={520}>
2150
- * <Chart data={metrics} />
2151
+ * <div className="flex flex-wrap gap-3">
2152
+ * <ScalableContainer
2153
+ * className="w-full lg:w-[calc(50%-6px)]" // resting size — your grid
2154
+ * height={300} // resting height
2155
+ * targetWidth="100%" targetHeight={580} // expanded size
2156
+ * >
2157
+ * <Chart … />
2151
2158
  * </ScalableContainer>
2152
2159
  * …
2153
2160
  * </div>
package/dist/index.js CHANGED
@@ -4655,8 +4655,8 @@ var TOGGLE_POSITION_CLASS = {
4655
4655
  "bottom-right": "bottom-2 right-2"
4656
4656
  };
4657
4657
  function ScalableContainer({
4658
- width = "100%",
4659
- height = "auto",
4658
+ width,
4659
+ height,
4660
4660
  targetWidth,
4661
4661
  targetHeight,
4662
4662
  expandedWidth = "100%",
@@ -4705,25 +4705,20 @@ function ScalableContainer({
4705
4705
  };
4706
4706
  const wrapperClass = isScaled ? assignClassOnClick : void 0;
4707
4707
  return /* @__PURE__ */ jsxs(
4708
- motion.div,
4708
+ "div",
4709
4709
  {
4710
4710
  ref: containerRef,
4711
4711
  style: {
4712
4712
  width: isScaled ? expandW : width,
4713
4713
  height: isScaled ? expandH : height,
4714
- flex: isScaled ? "none" : void 0
4715
- },
4716
- animate: { width: isScaled ? expandW : width, height: isScaled ? expandH : height },
4717
- transition: reduced ? { duration: 0 } : {
4718
- width: { type: "tween", duration: 0.32, ease: [0.16, 1, 0.3, 1] },
4719
- height: { type: "tween", duration: 0.32, ease: [0.16, 1, 0.3, 1] }
4714
+ ...isScaled ? { flex: "none" } : null
4720
4715
  },
4721
4716
  className: cx(
4722
4717
  "relative rounded-lg overflow-hidden",
4718
+ "transition-[width,height,box-shadow] duration-[320ms] ease-[cubic-bezier(0.16,1,0.3,1)] motion-reduce:transition-none",
4723
4719
  // OS-window aesthetic: subtle elevation at rest, lifted shadow +
4724
4720
  // raised stacking when expanded so it sits above neighbours.
4725
4721
  isScaled ? "z-raised shadow-2xl" : "shadow-md",
4726
- "transition-shadow duration-300",
4727
4722
  className
4728
4723
  ),
4729
4724
  children: [