@mateosuarezdev/react-ui 1.0.29 → 1.0.31

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.ts CHANGED
@@ -19,6 +19,7 @@ import { ForwardRefExoticComponent } from 'react';
19
19
  import { InputHTMLAttributes } from 'react';
20
20
  import { JSX } from 'react/jsx-runtime';
21
21
  import { Locale } from 'date-fns';
22
+ import { MotionValue } from 'motion/react';
22
23
  import { MouseEventHandler } from 'react';
23
24
  import { ReactNode } from 'react';
24
25
  import { ReactPortal } from 'react';
@@ -201,6 +202,34 @@ export declare const DateTimePicker: () => JSX.Element;
201
202
  */
202
203
  export declare function debounce<T extends (...args: any[]) => any>(func: T, delay?: number): (...args: Parameters<T>) => void;
203
204
 
205
+ /**
206
+ * ElasticHeader - Creates a pull-to-zoom effect on scroll
207
+ *
208
+ * When the user scrolls/pulls down past the top of the page (negative scrollY),
209
+ * this component scales up and translates the element to create a natural
210
+ * "stretchy" parallax effect commonly seen in mobile apps.
211
+ *
212
+ * The scaling factor is proportional to the element's height - pulling the full
213
+ * height of the element will result in 2x scale (doubled size).
214
+ *
215
+ * @example
216
+ * const y = useMotionValue(0);
217
+ *
218
+ * <ElasticHeader scrollY={y} height={300} className="header-image">
219
+ * <img src="profile.jpg" />
220
+ * </ElasticHeader>
221
+ */
222
+ export declare const ElasticHeader: ({ scrollY, height, className, children, }: {
223
+ scrollY: MotionValue<number>;
224
+ /**
225
+ * Height of the element in pixels
226
+ * defaults to 300
227
+ */
228
+ height: number;
229
+ className?: string;
230
+ children?: React.ReactNode;
231
+ }) => JSX.Element;
232
+
204
233
  /**
205
234
  * Extracts only the dirty fields from form data
206
235
  * @param data The complete form data
@@ -447,6 +476,11 @@ declare type OverflowInfo = {
447
476
  export declare const PageScroller: default_2.FC<PageScrollerProps>;
448
477
 
449
478
  declare interface PageScrollerProps {
479
+ /**
480
+ * Scroller or page/route specific id
481
+ * can be get from const { id } = useRoute() in my routers
482
+ */
483
+ id: string;
450
484
  tabPage?: boolean;
451
485
  /**
452
486
  * If to position the outer page element as absolute
@@ -462,6 +496,10 @@ declare interface PageScrollerProps {
462
496
  contentClassName?: string;
463
497
  bounceBackDuration?: number;
464
498
  showScrollbar?: boolean;
499
+ /**
500
+ * Custom MotionValue to track externally
501
+ */
502
+ onScroll?: (currentY: number) => void;
465
503
  }
466
504
 
467
505
  export declare const PageTitle: ({ title, description, size, descriptionClassName, className, }: {
@@ -642,9 +680,11 @@ declare type SpinnerProps = {
642
680
  spinnerClassName?: string;
643
681
  };
644
682
 
645
- export declare const SuperModal: ({ title, description, showHeader, mode, onReplace, className, contentClassName, children, }: SuperModalProps) => JSX.Element;
683
+ export declare const SuperModal: ({ id, prevPath, title, description, showHeader, mode, onReplace, className, contentClassName, children, }: SuperModalProps) => JSX.Element;
646
684
 
647
685
  declare type SuperModalProps = {
686
+ id: string;
687
+ prevPath: string;
648
688
  title?: string;
649
689
  description?: string;
650
690
  showHeader?: boolean;
@@ -863,4 +903,67 @@ export declare const useRipple: <T extends HTMLElement>(enabled?: boolean, contr
863
903
  styles: CSSProperties;
864
904
  };
865
905
 
906
+ export declare function useScroller<T extends HTMLElement>({ id, showScrollbar, onRefresh, bounceBackDuration, isolate, onScroll, }: UseScrollerProps): UseScrollerReturn<T>;
907
+
908
+ export declare interface UseScrollerProps {
909
+ id?: string;
910
+ showScrollbar?: boolean;
911
+ onRefresh?: () => Promise<void>;
912
+ bounceBackDuration?: number;
913
+ /**
914
+ * When to use isolate: true
915
+ * ✅ Page/Route level scrollers with absolute positioning
916
+ * ✅ When implementing the native mobile stack navigation pattern
917
+ * ✅ When you need to prevent z-index conflicts between different "pages"
918
+ * When to use isolate: false (default)
919
+ * ✅ Nested scrollers within a page (like a scrollable section)
920
+ * ✅ Modal/dialog content scrollers
921
+ * ✅ Dropdown/popover scrollers
922
+ * ✅ Any scroller where child elements need to participate in parent stacking contexts (e.g., tooltips, dropdowns that need to escape)
923
+ */
924
+ isolate?: boolean;
925
+ onScroll?: (currentY: number) => void;
926
+ }
927
+
928
+ export declare interface UseScrollerReturn<T extends HTMLElement> {
929
+ container: {
930
+ props: {
931
+ id?: string;
932
+ ref: default_2.RefObject<T | null>;
933
+ key: string;
934
+ };
935
+ /**
936
+ * Base className to extend from
937
+ * <div {...container.props} className={container.classNames}></div>
938
+ */
939
+ classNames: string;
940
+ };
941
+ content: {
942
+ props: {
943
+ ref: default_2.RefObject<T | null>;
944
+ };
945
+ /**
946
+ * Base styles to extend from
947
+ * <div {...content.props} style={container.styles}></div>
948
+ */
949
+ styles: default_2.CSSProperties;
950
+ };
951
+ pullToRefresh: {
952
+ props: {
953
+ ref: default_2.RefObject<T | null>;
954
+ };
955
+ styles: default_2.CSSProperties;
956
+ };
957
+ scrollbar: {
958
+ props: {
959
+ ref: default_2.RefObject<T | null>;
960
+ };
961
+ };
962
+ refreshing: boolean;
963
+ updateMaxScroll: () => void;
964
+ rubberBandEffect: (y: number) => number;
965
+ updateScrollbarPosition: () => void;
966
+ setPosition: (y: number) => void;
967
+ }
968
+
866
969
  export { }