@mateosuarezdev/react-ui 1.0.9 → 1.0.13

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
@@ -215,7 +215,7 @@ export declare const FormTextArea: ({ name, customRead, customSet, ...others }:
215
215
 
216
216
  declare type FormWrapperProps<T extends FieldValues> = {
217
217
  methods: UseFormReturn<T>;
218
- onSubmit: RHFSubmitHandler<T>;
218
+ onSubmit: SubmitHandler<T>;
219
219
  onError?: (errors: FieldErrors<T>) => void;
220
220
  children: default_2.ReactNode;
221
221
  logErrors?: boolean;
@@ -303,6 +303,10 @@ declare type KeepAliveProps = React.HTMLAttributes<HTMLDivElement> & {
303
303
  enabled?: boolean;
304
304
  };
305
305
 
306
+ declare type KeyMapping = {
307
+ [key: string]: (event: KeyboardEvent) => void;
308
+ };
309
+
306
310
  export declare const MultiSelect: <T>({ label, labelPosition, options, selectedValues, onChange, idExtractor, labelExtractor, customSetter, valid, error, placeholder, maxSelections, searchable, disabled, className, }: MultiSelectProps<T>) => JSX.Element;
307
311
 
308
312
  declare interface MultiSelectProps<T> {
@@ -480,6 +484,34 @@ declare interface UseClickOutsideOptions {
480
484
 
481
485
  export declare const useKeepAlive: () => KeepAliveContextType;
482
486
 
487
+ /**
488
+ * Custom hook for handling keyboard events in React
489
+ *
490
+ * @param keyMap - Object mapping keys to callback functions
491
+ * @param options - Additional options for event handling
492
+ *
493
+ * @example
494
+ * useKeyListener({
495
+ * 'Escape': (e) => {
496
+ * e.preventDefault();
497
+ * setIsOpen(false);
498
+ * },
499
+ * 'Tab': (e) => {
500
+ * if (document.activeElement === inputRef.current) {
501
+ * e.preventDefault();
502
+ * // Custom tab handling logic
503
+ * }
504
+ * }
505
+ * });
506
+ */
507
+ export declare function useKeyListener(keyMap: KeyMapping, { target, event, enabled }?: UseKeyListenerOptions): void;
508
+
509
+ declare type UseKeyListenerOptions = {
510
+ target?: EventTarget | HTMLElement;
511
+ event?: "keydown" | "keyup" | "keypress";
512
+ enabled?: boolean;
513
+ };
514
+
483
515
  /**
484
516
  * Custom hook that returns whether the current viewport is larger than the 'lg' breakpoint.
485
517
  *