@geomak/ui 7.6.3 → 7.7.1

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
@@ -503,6 +503,10 @@ interface ModalProps {
503
503
  onCancel?: () => void;
504
504
  okText?: string;
505
505
  cancelText?: string;
506
+ /** Visual variant of the Ok button. Default `'primary'`. */
507
+ okVariant?: ButtonProps['variant'];
508
+ /** Visual variant of the Cancel button. Default `'ghost'`. */
509
+ cancelVariant?: ButtonProps['variant'];
506
510
  hasFooter?: boolean;
507
511
  title?: react__default.ReactNode;
508
512
  children?: react__default.ReactNode;
@@ -521,7 +525,7 @@ interface ModalProps {
521
525
  * Are you sure you want to delete this item?
522
526
  * </Modal>
523
527
  */
524
- declare function Modal({ width, size, open, onClose, onOk, onCancel, okText, cancelText, hasFooter, title, children, className, }: ModalProps): react_jsx_runtime.JSX.Element;
528
+ declare function Modal({ width, size, open, onClose, onOk, onCancel, okText, cancelText, okVariant, cancelVariant, hasFooter, title, children, className, }: ModalProps): react_jsx_runtime.JSX.Element;
525
529
 
526
530
  type DrawerSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
527
531
  interface DrawerProps {
@@ -542,6 +546,10 @@ interface DrawerProps {
542
546
  width?: number | string;
543
547
  okText?: string;
544
548
  cancelText?: string;
549
+ /** Visual variant of the Ok button. Default `'primary'`. */
550
+ okVariant?: ButtonProps['variant'];
551
+ /** Visual variant of the Cancel button. Default `'ghost'`. */
552
+ cancelVariant?: ButtonProps['variant'];
545
553
  onOk?: () => void;
546
554
  onCancel?: () => void;
547
555
  title?: react__default.ReactNode;
@@ -561,7 +569,7 @@ interface DrawerProps {
561
569
  * <FilterForm />
562
570
  * </Drawer>
563
571
  */
564
- declare function Drawer({ open, onClose, hasFooter, placement, size, width, okText, cancelText, onOk, onCancel, title, children, className, }: DrawerProps): react_jsx_runtime.JSX.Element;
572
+ declare function Drawer({ open, onClose, hasFooter, placement, size, width, okText, cancelText, okVariant, cancelVariant, onOk, onCancel, title, children, className, }: DrawerProps): react_jsx_runtime.JSX.Element;
565
573
 
566
574
  interface TooltipProps {
567
575
  children: react__default.ReactNode;
@@ -697,6 +705,9 @@ interface TreeNode {
697
705
  nodeData?: any;
698
706
  parentLabel?: string;
699
707
  children?: TreeNode[];
708
+ /** Leading icon. On leaves it replaces the default bullet; on parents it
709
+ * renders between the chevron and the label. */
710
+ icon?: react__default.ReactNode;
700
711
  }
701
712
  interface TreeItemClickPayload {
702
713
  isParent: boolean;
@@ -710,6 +721,9 @@ interface TreeProps {
710
721
  onNodeClick: (payload: TreeItemClickPayload) => void;
711
722
  defaultExpandAll?: boolean;
712
723
  defaultExpandedKeys?: string[];
724
+ /** Default leading icon for every leaf (instead of the bullet dot). A
725
+ * node's own `icon` takes precedence. */
726
+ leafIcon?: react__default.ReactNode;
713
727
  /** Extra classes merged onto the tree root. */
714
728
  className?: string;
715
729
  /** Inline style on the tree root. */
@@ -730,7 +744,7 @@ interface TreeProps {
730
744
  * defaultExpandAll
731
745
  * />
732
746
  */
733
- declare function Tree({ nodes, onNodeClick, defaultExpandAll, defaultExpandedKeys, className, style, }: TreeProps): react_jsx_runtime.JSX.Element;
747
+ declare function Tree({ nodes, onNodeClick, defaultExpandAll, defaultExpandedKeys, leafIcon, className, style, }: TreeProps): react_jsx_runtime.JSX.Element;
734
748
 
735
749
  type AccordionVariant = 'separated' | 'contained';
736
750
  interface AccordionProps {
@@ -2074,10 +2088,22 @@ interface ScalableContainerProps {
2074
2088
  width?: react__default.CSSProperties['width'];
2075
2089
  /** Resting height. Any CSS length / percent. Default `'auto'`. */
2076
2090
  height?: react__default.CSSProperties['height'];
2077
- /** Width when expanded. Default `'100%'` (fills parent). */
2091
+ /**
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
+ */
2097
+ 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
+ */
2103
+ targetHeight?: react__default.CSSProperties['height'];
2104
+ /** @deprecated Use `targetWidth`. */
2078
2105
  expandedWidth?: react__default.CSSProperties['width'];
2079
- /** Height when expanded. Default `'100%'`. Set a concrete value (e.g. 420)
2080
- * when the container lives in normal flow and should push siblings down. */
2106
+ /** @deprecated Use `targetHeight`. */
2081
2107
  expandedHeight?: react__default.CSSProperties['height'];
2082
2108
  /** Controlled expanded state. */
2083
2109
  expanded?: boolean;
@@ -2096,60 +2122,38 @@ interface ScalableContainerProps {
2096
2122
  * Default `'top-right'` — matches the OS-window convention.
2097
2123
  */
2098
2124
  togglePosition?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
2099
- /**
2100
- * Bounding element the expansion is allowed to grow within. When the
2101
- * container sits in size-constrained flex-item wrappers (where width /
2102
- * height 100% makes expand-in-place a no-op), providing this ref switches
2103
- * to PUSH expansion: the container's row becomes `flex-wrap: wrap` and the
2104
- * container takes the FULL parent width (`flex-basis: 100%`), so sibling
2105
- * charts reflow below it at full width — pushed, visible, and intact.
2106
- * Column levels between the container and this element get `flex-grow`
2107
- * raised so the expanded row dominates vertically too. Collapsing
2108
- * restores the wrappers' original sizing exactly. Omit for the classic
2109
- * expand-in-place behaviour.
2110
- */
2125
+ /** @deprecated No longer used — set `targetWidth`/`targetHeight` instead. */
2111
2126
  expandContainerRef?: react__default.RefObject<HTMLElement | null>;
2112
- /**
2113
- * Vertical dominance of the pushed expansion (push mode only). Default
2114
- * `3` — the expanded chart keeps expandRatio/(expandRatio+1) of its row's
2115
- * height (and its row takes expandRatio parts per sibling row), leaving
2116
- * the reflowed siblings the remainder. Raise for a more fullscreen feel,
2117
- * lower for a gentler split.
2118
- */
2127
+ /** @deprecated No longer used — set `targetWidth`/`targetHeight` instead. */
2119
2128
  expandRatio?: number;
2120
2129
  /** Extra classes merged onto the container root. */
2121
2130
  className?: string;
2122
2131
  }
2123
2132
  /**
2124
- * Container that smoothly expands on click and collapses back to its
2125
- * resting size. Reads like a macOS / Windows window resizing — subtle
2126
- * elevation shift, smooth scale, no flash of colour or harsh background
2127
- * change.
2128
- *
2129
- * Two expansion modes:
2130
- * - **In place** (default): animates the container's own width/height to
2131
- * `expandedWidth`/`expandedHeight`.
2132
- * - **Push** (`expandContainerRef` set): for containers whose resting size is
2133
- * owned by flex-item wrappers. Expanding makes the container span the FULL
2134
- * parent width (its row becomes `flex-wrap: wrap` and the wrapper takes
2135
- * `flex-basis: 100%`), with sibling charts reflowing below it at full
2136
- * width — visible and intact, not squeezed. Column levels raise `flex-grow`
2137
- * so the expanded row also dominates vertically. Collapsing restores the
2138
- * original layout exactly.
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).
2139
2144
  *
2140
2145
  * @example
2141
2146
  * ```tsx
2142
- * <ScalableContainer width={480} height={300}>
2143
- * <Chart data={metrics} />
2144
- * </ScalableContainer>
2145
- *
2146
- * // Push mode inside a flex grid:
2147
- * const sectionRef = useRef<HTMLDivElement>(null)
2148
- * <div ref={sectionRef} className="flex flex-col flex-1 min-h-0 gap-2">…
2149
- * <ScalableContainer width="100%" height="100%" expandContainerRef={sectionRef}>
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
+ * </ScalableContainer>
2152
+ *
2153
+ * </div>
2150
2154
  * ```
2151
2155
  */
2152
- declare function ScalableContainer({ width, height, expandedWidth, expandedHeight, expanded, onExpandedChange, children, assignClassOnClick, expandIcon, collapseIcon, togglePosition, expandContainerRef, expandRatio, className, }: ScalableContainerProps): react_jsx_runtime.JSX.Element;
2156
+ declare function ScalableContainer({ width, height, targetWidth, targetHeight, expandedWidth, expandedHeight, expanded, onExpandedChange, children, assignClassOnClick, expandIcon, collapseIcon, togglePosition, className, }: ScalableContainerProps): react_jsx_runtime.JSX.Element;
2153
2157
 
2154
2158
  interface GridCardItem {
2155
2159
  key: string | number;
package/dist/index.d.ts CHANGED
@@ -503,6 +503,10 @@ interface ModalProps {
503
503
  onCancel?: () => void;
504
504
  okText?: string;
505
505
  cancelText?: string;
506
+ /** Visual variant of the Ok button. Default `'primary'`. */
507
+ okVariant?: ButtonProps['variant'];
508
+ /** Visual variant of the Cancel button. Default `'ghost'`. */
509
+ cancelVariant?: ButtonProps['variant'];
506
510
  hasFooter?: boolean;
507
511
  title?: react__default.ReactNode;
508
512
  children?: react__default.ReactNode;
@@ -521,7 +525,7 @@ interface ModalProps {
521
525
  * Are you sure you want to delete this item?
522
526
  * </Modal>
523
527
  */
524
- declare function Modal({ width, size, open, onClose, onOk, onCancel, okText, cancelText, hasFooter, title, children, className, }: ModalProps): react_jsx_runtime.JSX.Element;
528
+ declare function Modal({ width, size, open, onClose, onOk, onCancel, okText, cancelText, okVariant, cancelVariant, hasFooter, title, children, className, }: ModalProps): react_jsx_runtime.JSX.Element;
525
529
 
526
530
  type DrawerSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
527
531
  interface DrawerProps {
@@ -542,6 +546,10 @@ interface DrawerProps {
542
546
  width?: number | string;
543
547
  okText?: string;
544
548
  cancelText?: string;
549
+ /** Visual variant of the Ok button. Default `'primary'`. */
550
+ okVariant?: ButtonProps['variant'];
551
+ /** Visual variant of the Cancel button. Default `'ghost'`. */
552
+ cancelVariant?: ButtonProps['variant'];
545
553
  onOk?: () => void;
546
554
  onCancel?: () => void;
547
555
  title?: react__default.ReactNode;
@@ -561,7 +569,7 @@ interface DrawerProps {
561
569
  * <FilterForm />
562
570
  * </Drawer>
563
571
  */
564
- declare function Drawer({ open, onClose, hasFooter, placement, size, width, okText, cancelText, onOk, onCancel, title, children, className, }: DrawerProps): react_jsx_runtime.JSX.Element;
572
+ declare function Drawer({ open, onClose, hasFooter, placement, size, width, okText, cancelText, okVariant, cancelVariant, onOk, onCancel, title, children, className, }: DrawerProps): react_jsx_runtime.JSX.Element;
565
573
 
566
574
  interface TooltipProps {
567
575
  children: react__default.ReactNode;
@@ -697,6 +705,9 @@ interface TreeNode {
697
705
  nodeData?: any;
698
706
  parentLabel?: string;
699
707
  children?: TreeNode[];
708
+ /** Leading icon. On leaves it replaces the default bullet; on parents it
709
+ * renders between the chevron and the label. */
710
+ icon?: react__default.ReactNode;
700
711
  }
701
712
  interface TreeItemClickPayload {
702
713
  isParent: boolean;
@@ -710,6 +721,9 @@ interface TreeProps {
710
721
  onNodeClick: (payload: TreeItemClickPayload) => void;
711
722
  defaultExpandAll?: boolean;
712
723
  defaultExpandedKeys?: string[];
724
+ /** Default leading icon for every leaf (instead of the bullet dot). A
725
+ * node's own `icon` takes precedence. */
726
+ leafIcon?: react__default.ReactNode;
713
727
  /** Extra classes merged onto the tree root. */
714
728
  className?: string;
715
729
  /** Inline style on the tree root. */
@@ -730,7 +744,7 @@ interface TreeProps {
730
744
  * defaultExpandAll
731
745
  * />
732
746
  */
733
- declare function Tree({ nodes, onNodeClick, defaultExpandAll, defaultExpandedKeys, className, style, }: TreeProps): react_jsx_runtime.JSX.Element;
747
+ declare function Tree({ nodes, onNodeClick, defaultExpandAll, defaultExpandedKeys, leafIcon, className, style, }: TreeProps): react_jsx_runtime.JSX.Element;
734
748
 
735
749
  type AccordionVariant = 'separated' | 'contained';
736
750
  interface AccordionProps {
@@ -2074,10 +2088,22 @@ interface ScalableContainerProps {
2074
2088
  width?: react__default.CSSProperties['width'];
2075
2089
  /** Resting height. Any CSS length / percent. Default `'auto'`. */
2076
2090
  height?: react__default.CSSProperties['height'];
2077
- /** Width when expanded. Default `'100%'` (fills parent). */
2091
+ /**
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
+ */
2097
+ 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
+ */
2103
+ targetHeight?: react__default.CSSProperties['height'];
2104
+ /** @deprecated Use `targetWidth`. */
2078
2105
  expandedWidth?: react__default.CSSProperties['width'];
2079
- /** Height when expanded. Default `'100%'`. Set a concrete value (e.g. 420)
2080
- * when the container lives in normal flow and should push siblings down. */
2106
+ /** @deprecated Use `targetHeight`. */
2081
2107
  expandedHeight?: react__default.CSSProperties['height'];
2082
2108
  /** Controlled expanded state. */
2083
2109
  expanded?: boolean;
@@ -2096,60 +2122,38 @@ interface ScalableContainerProps {
2096
2122
  * Default `'top-right'` — matches the OS-window convention.
2097
2123
  */
2098
2124
  togglePosition?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
2099
- /**
2100
- * Bounding element the expansion is allowed to grow within. When the
2101
- * container sits in size-constrained flex-item wrappers (where width /
2102
- * height 100% makes expand-in-place a no-op), providing this ref switches
2103
- * to PUSH expansion: the container's row becomes `flex-wrap: wrap` and the
2104
- * container takes the FULL parent width (`flex-basis: 100%`), so sibling
2105
- * charts reflow below it at full width — pushed, visible, and intact.
2106
- * Column levels between the container and this element get `flex-grow`
2107
- * raised so the expanded row dominates vertically too. Collapsing
2108
- * restores the wrappers' original sizing exactly. Omit for the classic
2109
- * expand-in-place behaviour.
2110
- */
2125
+ /** @deprecated No longer used — set `targetWidth`/`targetHeight` instead. */
2111
2126
  expandContainerRef?: react__default.RefObject<HTMLElement | null>;
2112
- /**
2113
- * Vertical dominance of the pushed expansion (push mode only). Default
2114
- * `3` — the expanded chart keeps expandRatio/(expandRatio+1) of its row's
2115
- * height (and its row takes expandRatio parts per sibling row), leaving
2116
- * the reflowed siblings the remainder. Raise for a more fullscreen feel,
2117
- * lower for a gentler split.
2118
- */
2127
+ /** @deprecated No longer used — set `targetWidth`/`targetHeight` instead. */
2119
2128
  expandRatio?: number;
2120
2129
  /** Extra classes merged onto the container root. */
2121
2130
  className?: string;
2122
2131
  }
2123
2132
  /**
2124
- * Container that smoothly expands on click and collapses back to its
2125
- * resting size. Reads like a macOS / Windows window resizing — subtle
2126
- * elevation shift, smooth scale, no flash of colour or harsh background
2127
- * change.
2128
- *
2129
- * Two expansion modes:
2130
- * - **In place** (default): animates the container's own width/height to
2131
- * `expandedWidth`/`expandedHeight`.
2132
- * - **Push** (`expandContainerRef` set): for containers whose resting size is
2133
- * owned by flex-item wrappers. Expanding makes the container span the FULL
2134
- * parent width (its row becomes `flex-wrap: wrap` and the wrapper takes
2135
- * `flex-basis: 100%`), with sibling charts reflowing below it at full
2136
- * width — visible and intact, not squeezed. Column levels raise `flex-grow`
2137
- * so the expanded row also dominates vertically. Collapsing restores the
2138
- * original layout exactly.
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).
2139
2144
  *
2140
2145
  * @example
2141
2146
  * ```tsx
2142
- * <ScalableContainer width={480} height={300}>
2143
- * <Chart data={metrics} />
2144
- * </ScalableContainer>
2145
- *
2146
- * // Push mode inside a flex grid:
2147
- * const sectionRef = useRef<HTMLDivElement>(null)
2148
- * <div ref={sectionRef} className="flex flex-col flex-1 min-h-0 gap-2">…
2149
- * <ScalableContainer width="100%" height="100%" expandContainerRef={sectionRef}>
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
+ * </ScalableContainer>
2152
+ *
2153
+ * </div>
2150
2154
  * ```
2151
2155
  */
2152
- declare function ScalableContainer({ width, height, expandedWidth, expandedHeight, expanded, onExpandedChange, children, assignClassOnClick, expandIcon, collapseIcon, togglePosition, expandContainerRef, expandRatio, className, }: ScalableContainerProps): react_jsx_runtime.JSX.Element;
2156
+ declare function ScalableContainer({ width, height, targetWidth, targetHeight, expandedWidth, expandedHeight, expanded, onExpandedChange, children, assignClassOnClick, expandIcon, collapseIcon, togglePosition, className, }: ScalableContainerProps): react_jsx_runtime.JSX.Element;
2153
2157
 
2154
2158
  interface GridCardItem {
2155
2159
  key: string | number;