@mateosuarezdev/react-ui 1.0.49 → 1.0.51

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,6 +13,7 @@ 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 { EventEmitter as EventEmitter_2 } from '@mateosuarezdev/event-emitter';
16
17
  import { FieldErrors } from 'react-hook-form';
17
18
  import { FieldValues } from 'react-hook-form';
18
19
  import { ForwardRefExoticComponent } from 'react';
@@ -244,6 +245,14 @@ export declare const ElasticHeader: ({ scrollY, height, className, children, }:
244
245
  children?: React.ReactNode;
245
246
  }) => JSX.Element;
246
247
 
248
+ export declare class EventEmitter {
249
+ private listeners;
250
+ emit<T>(eventName: string, data?: T): void;
251
+ listen<T>(eventName: string, listener: Listener<T>): () => void;
252
+ }
253
+
254
+ export declare const eventEmitter: EventEmitter_2;
255
+
247
256
  /**
248
257
  * Extracts only the dirty fields from form data
249
258
  * @param data The complete form data
@@ -421,6 +430,8 @@ export declare const List: ({ lightSolid, className, children, ...others }: {
421
430
  others?: any;
422
431
  }) => JSX.Element;
423
432
 
433
+ export declare type Listener<T> = (data: T) => void;
434
+
424
435
  export declare const ListItem: ({ onClick, lightSolid, className, children, }: {
425
436
  onClick?: MouseEventHandler<HTMLButtonElement>;
426
437
  lightSolid?: boolean;
@@ -828,6 +839,8 @@ declare interface UseClickOutsideOptions {
828
839
  excludeRefs?: React.RefObject<HTMLElement>[];
829
840
  }
830
841
 
842
+ export declare function useEventListener<T>(eventName: string, callback: (data: T) => void, activeCondition?: boolean): void;
843
+
831
844
  export declare const useKeepAlive: () => KeepAliveContextType;
832
845
 
833
846
  /**