@mateosuarezdev/react-ui 1.0.53 → 1.0.55

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
@@ -13,10 +13,12 @@ import { ClassValue } from 'clsx';
13
13
  import { ComponentPropsWithoutRef } from 'react';
14
14
  import { CSSProperties } from 'react';
15
15
  import { default as default_2 } from 'react';
16
+ import { DetailedHTMLProps } from 'react';
16
17
  import { EventEmitter as EventEmitter_2 } from '@mateosuarezdev/event-emitter';
17
18
  import { FieldErrors } from 'react-hook-form';
18
19
  import { FieldValues } from 'react-hook-form';
19
20
  import { ForwardRefExoticComponent } from 'react';
21
+ import { ImgHTMLAttributes } from 'react';
20
22
  import { InputHTMLAttributes } from 'react';
21
23
  import { JSX } from 'react/jsx-runtime';
22
24
  import { Locale } from 'date-fns';
@@ -423,6 +425,47 @@ declare type KeyMapping = {
423
425
  [key: string]: (event: KeyboardEvent) => void;
424
426
  };
425
427
 
428
+ /**
429
+ * LazyImage - Just the img element with lazy loading
430
+ * Use this when you want to provide your own wrapper
431
+ */
432
+ export declare const LazyImage: ForwardRefExoticComponent<Omit<Omit<DetailedHTMLProps<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "ref">, "src"> & {
433
+ src: string;
434
+ alt: string;
435
+ /** Load image immediately without waiting for viewport */
436
+ eager?: boolean;
437
+ /** Intersection Observer root margin (e.g., '50px' to load before entering viewport) */
438
+ rootMargin?: string;
439
+ /** Intersection Observer threshold */
440
+ threshold?: number;
441
+ /** Disable fade-in animation */
442
+ noFade?: boolean;
443
+ } & RefAttributes<HTMLImageElement>>;
444
+
445
+ /**
446
+ * LazyImageWrapped - Img element with a wrapper div
447
+ * Includes placeholder background and supports children overlays
448
+ */
449
+ export declare const LazyImageWrapped: ForwardRefExoticComponent<Omit<Omit<DetailedHTMLProps<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "ref">, "src"> & {
450
+ src: string;
451
+ alt: string;
452
+ /** Load image immediately without waiting for viewport */
453
+ eager?: boolean;
454
+ /** Intersection Observer root margin (e.g., '50px' to load before entering viewport) */
455
+ rootMargin?: string;
456
+ /** Intersection Observer threshold */
457
+ threshold?: number;
458
+ /** Disable fade-in animation */
459
+ noFade?: boolean;
460
+ } & {
461
+ /** Custom className for the wrapper div */
462
+ wrapperClassName?: string;
463
+ /** Custom className for the img element */
464
+ imageClassName?: string;
465
+ /** Optional children to render inside the wrapper */
466
+ children?: React.ReactNode;
467
+ } & RefAttributes<HTMLImageElement>>;
468
+
426
469
  export declare const List: ({ lightSolid, className, children, ...others }: {
427
470
  lightSolid?: boolean;
428
471
  className?: string;
@@ -439,6 +482,14 @@ export declare const ListItem: ({ onClick, lightSolid, className, children, }: {
439
482
  children: React.ReactNode;
440
483
  }) => JSX.Element;
441
484
 
485
+ declare interface LongPressOptions {
486
+ onLongPress?: (e: any) => void;
487
+ onTap?: (e: any) => void;
488
+ threshold?: number;
489
+ startDelay?: number;
490
+ moveThreshold?: number;
491
+ }
492
+
442
493
  declare interface ModalsContextType {
443
494
  add: (id: string) => void;
444
495
  remove: (id: string) => void;
@@ -924,6 +975,8 @@ declare type UseKeyListenerOptions = {
924
975
  */
925
976
  export declare const useLargeScreen: () => boolean;
926
977
 
978
+ export declare function useLongPress<T extends HTMLElement>({ onLongPress, onTap, threshold, startDelay, moveThreshold, }?: LongPressOptions): RefObject<T | null>;
979
+
927
980
  export declare function useMergedRef<T>(...refs: React.Ref<T>[]): React.RefCallback<T>;
928
981
 
929
982
  /**
@@ -937,6 +990,8 @@ export declare function useMethods<TSchema extends ZodTypeAny>(schema: TSchema,
937
990
 
938
991
  export declare const useModals: () => ModalsContextType;
939
992
 
993
+ export declare const useNetwork: () => boolean;
994
+
940
995
  export declare const useOverflow: <T extends HTMLElement>({ onOverflow, trackScroll, withObserver, enabled, deps, }?: {
941
996
  onOverflow?: (info: OverflowInfo) => void;
942
997
  trackScroll?: boolean;