@mateosuarezdev/react-ui 1.0.29 → 1.0.30

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, }: {
@@ -863,4 +901,67 @@ export declare const useRipple: <T extends HTMLElement>(enabled?: boolean, contr
863
901
  styles: CSSProperties;
864
902
  };
865
903
 
904
+ export declare function useScroller<T extends HTMLElement>({ id, showScrollbar, onRefresh, bounceBackDuration, isolate, onScroll, }: UseScrollerProps): UseScrollerReturn<T>;
905
+
906
+ export declare interface UseScrollerProps {
907
+ id?: string;
908
+ showScrollbar?: boolean;
909
+ onRefresh?: () => Promise<void>;
910
+ bounceBackDuration?: number;
911
+ /**
912
+ * When to use isolate: true
913
+ * ✅ Page/Route level scrollers with absolute positioning
914
+ * ✅ When implementing the native mobile stack navigation pattern
915
+ * ✅ When you need to prevent z-index conflicts between different "pages"
916
+ * When to use isolate: false (default)
917
+ * ✅ Nested scrollers within a page (like a scrollable section)
918
+ * ✅ Modal/dialog content scrollers
919
+ * ✅ Dropdown/popover scrollers
920
+ * ✅ Any scroller where child elements need to participate in parent stacking contexts (e.g., tooltips, dropdowns that need to escape)
921
+ */
922
+ isolate?: boolean;
923
+ onScroll?: (currentY: number) => void;
924
+ }
925
+
926
+ export declare interface UseScrollerReturn<T extends HTMLElement> {
927
+ container: {
928
+ props: {
929
+ id?: string;
930
+ ref: default_2.RefObject<T | null>;
931
+ key: string;
932
+ };
933
+ /**
934
+ * Base className to extend from
935
+ * <div {...container.props} className={container.classNames}></div>
936
+ */
937
+ classNames: string;
938
+ };
939
+ content: {
940
+ props: {
941
+ ref: default_2.RefObject<T | null>;
942
+ };
943
+ /**
944
+ * Base styles to extend from
945
+ * <div {...content.props} style={container.styles}></div>
946
+ */
947
+ styles: default_2.CSSProperties;
948
+ };
949
+ pullToRefresh: {
950
+ props: {
951
+ ref: default_2.RefObject<T | null>;
952
+ };
953
+ styles: default_2.CSSProperties;
954
+ };
955
+ scrollbar: {
956
+ props: {
957
+ ref: default_2.RefObject<T | null>;
958
+ };
959
+ };
960
+ refreshing: boolean;
961
+ updateMaxScroll: () => void;
962
+ rubberBandEffect: (y: number) => number;
963
+ updateScrollbarPosition: () => void;
964
+ setPosition: (y: number) => void;
965
+ }
966
+
866
967
  export { }