@aic-kits/react 0.22.1 → 0.23.0

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.
@@ -1,6 +1,6 @@
1
1
  import { ForwardedRef } from 'react';
2
2
  import { CarouselHandle, CarouselProps } from './types';
3
- declare function PlainCarousel<T>({ items, renderItem, showPagination, showNavigation, autoPlay, autoScroll, initialIndex, onIndexChange, keyExtractor, itemSpacing, itemsPerView, itemWidth, ...rest }: CarouselProps<T>, ref: React.Ref<CarouselHandle>): import("react/jsx-runtime").JSX.Element;
3
+ declare function PlainCarousel<T>({ items, renderItem, showPagination, showNavigation, autoPlay, autoScroll, initialIndex, onIndexChange, keyExtractor, itemSpacing, itemsPerView, itemWidth, infiniteLoop, ...rest }: CarouselProps<T>, ref: React.Ref<CarouselHandle>): import("react/jsx-runtime").JSX.Element;
4
4
  export declare const Carousel: <T>(props: CarouselProps<T> & {
5
5
  ref?: ForwardedRef<CarouselHandle>;
6
6
  }) => ReturnType<typeof PlainCarousel<T>>;
@@ -71,6 +71,12 @@ export interface CarouselProps<T = any> extends BoxProps {
71
71
  * Has no effect when `autoScroll` is enabled.
72
72
  */
73
73
  itemWidth?: Size | string | number;
74
+ /**
75
+ * If true, enables infinite looping for manual navigation.
76
+ * When the user navigates past the last item, it goes to the first, and vice-versa.
77
+ * @default false
78
+ */
79
+ infiniteLoop?: boolean;
74
80
  }
75
81
  export interface CarouselHandle {
76
82
  goToIndex: (index: number) => void;
@@ -0,0 +1,6 @@
1
+ import { RefObject } from 'react';
2
+ declare function useEventListener<K extends keyof MediaQueryListEventMap>(eventName: K, handler: (event: MediaQueryListEventMap[K]) => void, element: RefObject<MediaQueryList>, options?: boolean | AddEventListenerOptions): void;
3
+ declare function useEventListener<K extends keyof WindowEventMap>(eventName: K, handler: (event: WindowEventMap[K]) => void, element?: undefined, options?: boolean | AddEventListenerOptions): void;
4
+ declare function useEventListener<K extends keyof HTMLElementEventMap & keyof SVGElementEventMap, T extends Element = K extends keyof HTMLElementEventMap ? HTMLDivElement : SVGElement>(eventName: K, handler: ((event: HTMLElementEventMap[K]) => void) | ((event: SVGElementEventMap[K]) => void), element: RefObject<T>, options?: boolean | AddEventListenerOptions): void;
5
+ declare function useEventListener<K extends keyof DocumentEventMap>(eventName: K, handler: (event: DocumentEventMap[K]) => void, element: RefObject<Document>, options?: boolean | AddEventListenerOptions): void;
6
+ export { useEventListener };
@@ -0,0 +1,2 @@
1
+ import { RefObject } from 'react';
2
+ export declare function useHover<T extends HTMLElement = HTMLElement>(elementRef: RefObject<T>): boolean;
@@ -0,0 +1,2 @@
1
+ import { useEffect } from 'react';
2
+ export declare const useIsomorphicLayoutEffect: typeof useEffect;