yet-another-react-lightbox 3.5.4 → 3.7.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.
Files changed (204) hide show
  1. package/README.md +3 -3
  2. package/dist/index.d.ts +240 -4
  3. package/dist/index.js +1368 -4
  4. package/dist/plugins/captions/captions.css +1 -33
  5. package/dist/plugins/captions/captions.css.d.ts +2 -0
  6. package/dist/plugins/captions/index.d.ts +8 -4
  7. package/dist/plugins/captions/index.js +104 -3
  8. package/dist/plugins/counter/counter.css +1 -16
  9. package/dist/plugins/counter/counter.css.d.ts +2 -0
  10. package/dist/plugins/counter/index.d.ts +8 -3
  11. package/dist/plugins/counter/index.js +18 -2
  12. package/dist/plugins/download/index.d.ts +6 -3
  13. package/dist/plugins/download/index.js +90 -3
  14. package/dist/plugins/fullscreen/index.d.ts +8 -4
  15. package/dist/plugins/fullscreen/index.js +128 -3
  16. package/dist/plugins/index.d.ts +9 -9
  17. package/dist/plugins/index.js +9 -9
  18. package/dist/plugins/inline/index.d.ts +8 -3
  19. package/dist/plugins/inline/index.js +26 -2
  20. package/dist/plugins/slideshow/index.d.ts +8 -4
  21. package/dist/plugins/slideshow/index.js +113 -3
  22. package/dist/plugins/thumbnails/index.d.ts +7 -4
  23. package/dist/plugins/thumbnails/index.js +261 -3
  24. package/dist/plugins/thumbnails/thumbnails.css +1 -139
  25. package/dist/plugins/thumbnails/thumbnails.css.d.ts +2 -0
  26. package/dist/plugins/video/index.d.ts +7 -2
  27. package/dist/plugins/video/index.js +109 -2
  28. package/dist/plugins/zoom/index.d.ts +7 -4
  29. package/dist/plugins/zoom/index.js +500 -3
  30. package/dist/styles.css +1 -281
  31. package/dist/styles.css.d.ts +2 -0
  32. package/dist/types.d.ts +125 -47
  33. package/dist/types.js +51 -1
  34. package/package.json +34 -10
  35. package/dist/Lightbox.d.ts +0 -4
  36. package/dist/Lightbox.js +0 -46
  37. package/dist/core/components/IconButton.d.ts +0 -7
  38. package/dist/core/components/IconButton.js +0 -8
  39. package/dist/core/components/Icons.d.ts +0 -29
  40. package/dist/core/components/Icons.js +0 -27
  41. package/dist/core/components/ImageSlide.d.ts +0 -13
  42. package/dist/core/components/ImageSlide.js +0 -68
  43. package/dist/core/components/index.d.ts +0 -3
  44. package/dist/core/components/index.js +0 -3
  45. package/dist/core/config.d.ts +0 -7
  46. package/dist/core/config.js +0 -93
  47. package/dist/core/consts.d.ts +0 -50
  48. package/dist/core/consts.js +0 -49
  49. package/dist/core/contexts/Events.d.ts +0 -17
  50. package/dist/core/contexts/Events.js +0 -29
  51. package/dist/core/contexts/LightboxProps.d.ts +0 -6
  52. package/dist/core/contexts/LightboxProps.js +0 -7
  53. package/dist/core/contexts/LightboxState.d.ts +0 -27
  54. package/dist/core/contexts/LightboxState.js +0 -49
  55. package/dist/core/contexts/Timeouts.d.ts +0 -8
  56. package/dist/core/contexts/Timeouts.js +0 -32
  57. package/dist/core/contexts/index.d.ts +0 -4
  58. package/dist/core/contexts/index.js +0 -4
  59. package/dist/core/hooks/index.d.ts +0 -11
  60. package/dist/core/hooks/index.js +0 -11
  61. package/dist/core/hooks/useAnimation.d.ts +0 -15
  62. package/dist/core/hooks/useAnimation.js +0 -57
  63. package/dist/core/hooks/useContainerRect.d.ts +0 -7
  64. package/dist/core/hooks/useContainerRect.js +0 -36
  65. package/dist/core/hooks/useDelay.d.ts +0 -1
  66. package/dist/core/hooks/useDelay.js +0 -10
  67. package/dist/core/hooks/useEventCallback.d.ts +0 -1
  68. package/dist/core/hooks/useEventCallback.js +0 -9
  69. package/dist/core/hooks/useForkRef.d.ts +0 -3
  70. package/dist/core/hooks/useForkRef.js +0 -17
  71. package/dist/core/hooks/useLayoutEffect.d.ts +0 -2
  72. package/dist/core/hooks/useLayoutEffect.js +0 -3
  73. package/dist/core/hooks/useLoseFocus.d.ts +0 -4
  74. package/dist/core/hooks/useLoseFocus.js +0 -19
  75. package/dist/core/hooks/useMotionPreference.d.ts +0 -1
  76. package/dist/core/hooks/useMotionPreference.js +0 -13
  77. package/dist/core/hooks/useRTL.d.ts +0 -1
  78. package/dist/core/hooks/useRTL.js +0 -9
  79. package/dist/core/hooks/useSensors.d.ts +0 -14
  80. package/dist/core/hooks/useSensors.js +0 -38
  81. package/dist/core/hooks/useThrottle.d.ts +0 -1
  82. package/dist/core/hooks/useThrottle.js +0 -16
  83. package/dist/core/index.d.ts +0 -7
  84. package/dist/core/index.js +0 -7
  85. package/dist/core/modules/Carousel.d.ts +0 -4
  86. package/dist/core/modules/Carousel.js +0 -72
  87. package/dist/core/modules/Controller.d.ts +0 -31
  88. package/dist/core/modules/Controller.js +0 -215
  89. package/dist/core/modules/Navigation.d.ts +0 -13
  90. package/dist/core/modules/Navigation.js +0 -35
  91. package/dist/core/modules/NoScroll.d.ts +0 -4
  92. package/dist/core/modules/NoScroll.js +0 -52
  93. package/dist/core/modules/Portal.d.ts +0 -4
  94. package/dist/core/modules/Portal.js +0 -92
  95. package/dist/core/modules/Root.d.ts +0 -4
  96. package/dist/core/modules/Root.js +0 -7
  97. package/dist/core/modules/Toolbar.d.ts +0 -4
  98. package/dist/core/modules/Toolbar.js +0 -25
  99. package/dist/core/modules/controller/index.d.ts +0 -8
  100. package/dist/core/modules/controller/index.js +0 -9
  101. package/dist/core/modules/controller/usePointerSwipe.d.ts +0 -2
  102. package/dist/core/modules/controller/usePointerSwipe.js +0 -72
  103. package/dist/core/modules/controller/usePreventSwipeNavigation.d.ts +0 -3
  104. package/dist/core/modules/controller/usePreventSwipeNavigation.js +0 -20
  105. package/dist/core/modules/controller/useWheelSwipe.d.ts +0 -3
  106. package/dist/core/modules/controller/useWheelSwipe.js +0 -92
  107. package/dist/core/modules/index.d.ts +0 -7
  108. package/dist/core/modules/index.js +0 -7
  109. package/dist/core/utils.d.ts +0 -36
  110. package/dist/core/utils.js +0 -70
  111. package/dist/plugins/captions/Captions.d.ts +0 -3
  112. package/dist/plugins/captions/Captions.js +0 -25
  113. package/dist/plugins/captions/CaptionsButton.d.ts +0 -2
  114. package/dist/plugins/captions/CaptionsButton.js +0 -16
  115. package/dist/plugins/captions/CaptionsContext.d.ts +0 -5
  116. package/dist/plugins/captions/CaptionsContext.js +0 -16
  117. package/dist/plugins/captions/Description.d.ts +0 -4
  118. package/dist/plugins/captions/Description.js +0 -27
  119. package/dist/plugins/captions/Title.d.ts +0 -4
  120. package/dist/plugins/captions/Title.js +0 -16
  121. package/dist/plugins/captions/props.d.ts +0 -19
  122. package/dist/plugins/captions/props.js +0 -14
  123. package/dist/plugins/captions/utils.d.ts +0 -1
  124. package/dist/plugins/captions/utils.js +0 -2
  125. package/dist/plugins/counter/Counter.d.ts +0 -5
  126. package/dist/plugins/counter/Counter.js +0 -14
  127. package/dist/plugins/download/Download.d.ts +0 -2
  128. package/dist/plugins/download/Download.js +0 -9
  129. package/dist/plugins/download/DownloadButton.d.ts +0 -2
  130. package/dist/plugins/download/DownloadButton.js +0 -19
  131. package/dist/plugins/download/FileSaver.d.ts +0 -1
  132. package/dist/plugins/download/FileSaver.js +0 -60
  133. package/dist/plugins/fullscreen/Fullscreen.d.ts +0 -3
  134. package/dist/plugins/fullscreen/Fullscreen.js +0 -13
  135. package/dist/plugins/fullscreen/FullscreenButton.d.ts +0 -3
  136. package/dist/plugins/fullscreen/FullscreenButton.js +0 -16
  137. package/dist/plugins/fullscreen/FullscreenContext.d.ts +0 -5
  138. package/dist/plugins/fullscreen/FullscreenContext.js +0 -93
  139. package/dist/plugins/fullscreen/props.d.ts +0 -10
  140. package/dist/plugins/fullscreen/props.js +0 -8
  141. package/dist/plugins/inline/Inline.d.ts +0 -3
  142. package/dist/plugins/inline/Inline.js +0 -18
  143. package/dist/plugins/inline/InlineContainer.d.ts +0 -4
  144. package/dist/plugins/inline/InlineContainer.js +0 -5
  145. package/dist/plugins/slideshow/Slideshow.d.ts +0 -3
  146. package/dist/plugins/slideshow/Slideshow.js +0 -13
  147. package/dist/plugins/slideshow/SlideshowButton.d.ts +0 -2
  148. package/dist/plugins/slideshow/SlideshowButton.js +0 -14
  149. package/dist/plugins/slideshow/SlideshowContext.d.ts +0 -5
  150. package/dist/plugins/slideshow/SlideshowContext.js +0 -79
  151. package/dist/plugins/slideshow/props.d.ts +0 -12
  152. package/dist/plugins/slideshow/props.js +0 -9
  153. package/dist/plugins/thumbnails/Thumbnail.d.ts +0 -15
  154. package/dist/plugins/thumbnails/Thumbnail.js +0 -51
  155. package/dist/plugins/thumbnails/Thumbnails.d.ts +0 -3
  156. package/dist/plugins/thumbnails/Thumbnails.js +0 -22
  157. package/dist/plugins/thumbnails/ThumbnailsButton.d.ts +0 -2
  158. package/dist/plugins/thumbnails/ThumbnailsButton.js +0 -16
  159. package/dist/plugins/thumbnails/ThumbnailsContext.d.ts +0 -6
  160. package/dist/plugins/thumbnails/ThumbnailsContext.js +0 -24
  161. package/dist/plugins/thumbnails/ThumbnailsTrack.d.ts +0 -5
  162. package/dist/plugins/thumbnails/ThumbnailsTrack.js +0 -141
  163. package/dist/plugins/thumbnails/props.d.ts +0 -40
  164. package/dist/plugins/thumbnails/props.js +0 -21
  165. package/dist/plugins/thumbnails/utils.d.ts +0 -2
  166. package/dist/plugins/thumbnails/utils.js +0 -4
  167. package/dist/plugins/video/Video.d.ts +0 -3
  168. package/dist/plugins/video/Video.js +0 -21
  169. package/dist/plugins/video/VideoSlide.d.ts +0 -8
  170. package/dist/plugins/video/VideoSlide.js +0 -74
  171. package/dist/plugins/video/props.d.ts +0 -29
  172. package/dist/plugins/video/props.js +0 -13
  173. package/dist/plugins/zoom/ResponsiveImage.d.ts +0 -11
  174. package/dist/plugins/zoom/ResponsiveImage.js +0 -58
  175. package/dist/plugins/zoom/Zoom.d.ts +0 -3
  176. package/dist/plugins/zoom/Zoom.js +0 -18
  177. package/dist/plugins/zoom/ZoomButton.d.ts +0 -8
  178. package/dist/plugins/zoom/ZoomButton.js +0 -27
  179. package/dist/plugins/zoom/ZoomButtonsGroup.d.ts +0 -2
  180. package/dist/plugins/zoom/ZoomButtonsGroup.js +0 -22
  181. package/dist/plugins/zoom/ZoomController.d.ts +0 -12
  182. package/dist/plugins/zoom/ZoomController.js +0 -17
  183. package/dist/plugins/zoom/ZoomToolbarControl.d.ts +0 -2
  184. package/dist/plugins/zoom/ZoomToolbarControl.js +0 -12
  185. package/dist/plugins/zoom/ZoomWrapper.d.ts +0 -5
  186. package/dist/plugins/zoom/ZoomWrapper.js +0 -36
  187. package/dist/plugins/zoom/hooks/index.d.ts +0 -6
  188. package/dist/plugins/zoom/hooks/index.js +0 -6
  189. package/dist/plugins/zoom/hooks/useZoomAnimation.d.ts +0 -2
  190. package/dist/plugins/zoom/hooks/useZoomAnimation.js +0 -39
  191. package/dist/plugins/zoom/hooks/useZoomCallback.d.ts +0 -1
  192. package/dist/plugins/zoom/hooks/useZoomCallback.js +0 -12
  193. package/dist/plugins/zoom/hooks/useZoomImageRect.d.ts +0 -5
  194. package/dist/plugins/zoom/hooks/useZoomImageRect.js +0 -41
  195. package/dist/plugins/zoom/hooks/useZoomProps.d.ts +0 -13
  196. package/dist/plugins/zoom/hooks/useZoomProps.js +0 -6
  197. package/dist/plugins/zoom/hooks/useZoomSensors.d.ts +0 -3
  198. package/dist/plugins/zoom/hooks/useZoomSensors.js +0 -154
  199. package/dist/plugins/zoom/hooks/useZoomState.d.ts +0 -12
  200. package/dist/plugins/zoom/hooks/useZoomState.js +0 -63
  201. package/dist/plugins/zoom/props.d.ts +0 -25
  202. package/dist/plugins/zoom/props.js +0 -15
  203. package/dist/props.d.ts +0 -2
  204. package/dist/props.js +0 -38
package/README.md CHANGED
@@ -123,16 +123,16 @@ See [examples](https://yet-another-react-lightbox.com/examples) on the documenta
123
123
 
124
124
  ## Plugins
125
125
 
126
- Yet Another React Lightbox allows you to add optional features based on your requirements via plugins.
126
+ Yet Another React Lightbox allows you to add optional features to your project based on your requirements via plugins.
127
127
 
128
- The following plugins come bundled in the package:
128
+ The following plugins are bundled in the package:
129
129
 
130
130
  - [Captions](https://yet-another-react-lightbox.com/plugins/captions) - adds support for slide title and
131
131
  description
132
132
  - [Counter](https://yet-another-react-lightbox.com/plugins/counter) - adds slides counter
133
133
  - [Download](https://yet-another-react-lightbox.com/plugins/download) - adds download button
134
134
  - [Fullscreen](https://yet-another-react-lightbox.com/plugins/fullscreen) - adds support for fullscreen mode
135
- - [Inline](https://yet-another-react-lightbox.com/plugins/inline) - adds support for inline rendering mode
135
+ - [Inline](https://yet-another-react-lightbox.com/plugins/inline) - transforms the lightbox into an image carousel
136
136
  - [Slideshow](https://yet-another-react-lightbox.com/plugins/slideshow) - adds slideshow autoplay feature
137
137
  - [Thumbnails](https://yet-another-react-lightbox.com/plugins/thumbnails) - adds thumbnails track
138
138
  - [Video](https://yet-another-react-lightbox.com/plugins/video) - adds support for video slides
package/dist/index.d.ts CHANGED
@@ -1,4 +1,240 @@
1
- import { Lightbox } from "./Lightbox.js";
2
- export * from "./types.js";
3
- export * from "./Lightbox.js";
4
- export default Lightbox;
1
+ import * as React from 'react';
2
+ import { LightboxExternalProps, LightboxProps, Labels, Slide, SlideImage, LengthOrPercentage, ContainerRect, ToolbarSettings, Component, Module, Node, Plugin, Augmentation, EventTypes, ComponentProps, LightboxStateSwipeAction, LightboxStateUpdateAction, LightboxState, Render, ImageFit, ControllerRef, Callback, RenderFunction } from './types.js';
3
+ export { ACTION_CLOSE, ACTION_NEXT, ACTION_PREV, ACTION_SWIPE, ACTIVE_SLIDE_COMPLETE, ACTIVE_SLIDE_ERROR, ACTIVE_SLIDE_LOADING, ACTIVE_SLIDE_PLAYING, AnimationSettings, CLASS_FLEX_CENTER, CLASS_FULLSIZE, CLASS_NO_SCROLL, CLASS_NO_SCROLL_PADDING, Callbacks, CarouselSettings, ClickCallbackProps, ControllerSettings, DeepNonNullable, DeepPartial, DeepPartialValue, ELEMENT_BUTTON, ELEMENT_ICON, EVENT_ON_KEY_DOWN, EVENT_ON_KEY_UP, EVENT_ON_POINTER_CANCEL, EVENT_ON_POINTER_DOWN, EVENT_ON_POINTER_LEAVE, EVENT_ON_POINTER_MOVE, EVENT_ON_POINTER_UP, EVENT_ON_WHEEL, GenericSlide, IMAGE_FIT_CONTAIN, IMAGE_FIT_COVER, ImageSource, MODULE_CAROUSEL, MODULE_CONTROLLER, MODULE_NAVIGATION, MODULE_NO_SCROLL, MODULE_PORTAL, MODULE_ROOT, MODULE_TOOLBAR, NavigationAction, PLUGIN_CAPTIONS, PLUGIN_COUNTER, PLUGIN_DOWNLOAD, PLUGIN_FULLSCREEN, PLUGIN_INLINE, PLUGIN_SLIDESHOW, PLUGIN_THUMBNAILS, PLUGIN_ZOOM, PluginProps, PortalSettings, RenderSlideContainerProps, RenderSlideFooterProps, RenderSlideHeaderProps, RenderSlideProps, SLIDE_STATUS_COMPLETE, SLIDE_STATUS_ERROR, SLIDE_STATUS_LOADING, SLIDE_STATUS_PLACEHOLDER, SLIDE_STATUS_PLAYING, SlideStatus, SlideTypeKey, SlideTypes, Slot, SlotStyles, SlotType, ToolbarButtonKey, ToolbarButtonKeys, UNKNOWN_ACTION_TYPE, VK_ARROW_LEFT, VK_ARROW_RIGHT, VK_ESCAPE, ViewCallbackProps, activeSlideStatus } from './types.js';
4
+
5
+ /** Lightbox component */
6
+ declare function Lightbox({ carousel, animation, render, toolbar, controller, on, plugins, slides, index, ...restProps }: LightboxExternalProps): React.JSX.Element | null;
7
+
8
+ declare const LightboxDefaultProps: LightboxProps;
9
+
10
+ declare const clsx: (...classes: (string | boolean | undefined)[]) => string;
11
+ declare const cssClass: (name: string) => string;
12
+ declare const cssVar: (name: string) => string;
13
+ declare const composePrefix: (base: string, prefix?: string) => string;
14
+ declare const makeComposePrefix: (base: string) => (prefix?: string) => string;
15
+ declare const label: (labels: Labels | undefined, lbl: string) => string;
16
+ declare const cleanup: (...cleaners: (() => void)[]) => () => void;
17
+ declare const makeUseContext: <T>(name: string, contextName: string, context: React.Context<T | null>) => () => NonNullable<T>;
18
+ declare const hasWindow: () => boolean;
19
+ declare function round(value: number, decimals?: number): number;
20
+ declare const isImageSlide: (slide: Slide) => slide is SlideImage;
21
+ declare const isImageFitCover: (image: SlideImage, imageFit?: LightboxProps["carousel"]["imageFit"]) => boolean;
22
+ declare function parseLengthPercentage(input: LengthOrPercentage): {
23
+ pixel: number;
24
+ percent?: undefined;
25
+ } | {
26
+ percent: number;
27
+ pixel?: undefined;
28
+ };
29
+ declare function computeSlideRect(containerRect: ContainerRect, padding: LengthOrPercentage): {
30
+ width: number;
31
+ height: number;
32
+ };
33
+ declare const devicePixelRatio: () => number;
34
+ declare const getSlideIndex: (index: number, slidesCount: number) => number;
35
+ declare const hasSlides: (slides: Slide[]) => slides is [SlideImage, ...SlideImage[]];
36
+ declare const getSlide: (slides: [Slide, ...Slide[]], index: number) => SlideImage;
37
+ declare const getSlideIfPresent: (slides: Slide[], index: number) => SlideImage | undefined;
38
+ declare function addToolbarButton(toolbar: ToolbarSettings, key: string, button: React.ReactNode): ToolbarSettings;
39
+ declare function stopNavigationEventsPropagation(): {
40
+ onPointerDown: (event: React.PointerEvent | React.KeyboardEvent | React.WheelEvent) => void;
41
+ onKeyDown: (event: React.PointerEvent | React.KeyboardEvent | React.WheelEvent) => void;
42
+ onWheel: (event: React.PointerEvent | React.KeyboardEvent | React.WheelEvent) => void;
43
+ };
44
+
45
+ declare function createModule(name: string, component: Component): Module;
46
+ declare function createNode(module: Module, children?: Node[]): Node;
47
+ declare function withPlugins(root: Node[], plugins?: Plugin[], augmentations?: Augmentation[]): {
48
+ config: Node[];
49
+ augmentation: Augmentation;
50
+ };
51
+
52
+ type ComputeAnimation<T> = (snapshot: T, rect: DOMRect, translate: {
53
+ x: number;
54
+ y: number;
55
+ z: number;
56
+ }) => {
57
+ keyframes: Keyframe[];
58
+ duration: number;
59
+ easing?: string;
60
+ onfinish?: () => void;
61
+ } | undefined;
62
+ declare function useAnimation<T>(nodeRef: React.RefObject<HTMLElement | null>, computeAnimation: ComputeAnimation<T>): {
63
+ prepareAnimation: (currentSnapshot: T | undefined) => void;
64
+ isAnimationPlaying: () => boolean;
65
+ };
66
+
67
+ declare function useContainerRect<T extends HTMLElement = HTMLElement>(): {
68
+ setContainerRef: (node: T | null) => void;
69
+ containerRef: React.MutableRefObject<T | null>;
70
+ containerRect: ContainerRect | undefined;
71
+ };
72
+
73
+ declare function useDelay(): (callback: () => void, delay: number) => void;
74
+
75
+ declare function useEventCallback<Args extends unknown[], Return>(fn: (...args: Args) => Return): (...args: Args) => Return;
76
+
77
+ declare function setRef<T>(ref: React.MutableRefObject<T | null> | ((instance: T | null) => void) | null | undefined, value: T | null): void;
78
+ declare function useForkRef<InstanceA, InstanceB>(refA: React.Ref<InstanceA> | null | undefined, refB: React.Ref<InstanceB> | null | undefined): React.Ref<InstanceA & InstanceB> | null;
79
+
80
+ declare const useLayoutEffect: typeof React.useEffect;
81
+
82
+ declare function useLoseFocus(focus: () => void, disabled?: boolean): {
83
+ onFocus: () => void;
84
+ onBlur: () => void;
85
+ };
86
+
87
+ declare function useMotionPreference(): boolean;
88
+
89
+ declare function useRTL(): boolean;
90
+
91
+ type PointerEventType = "onPointerDown" | "onPointerMove" | "onPointerUp" | "onPointerLeave" | "onPointerCancel";
92
+ type KeyboardEventType = "onKeyDown" | "onKeyUp";
93
+ type WheelEventType = "onWheel";
94
+ type SupportedEventType = PointerEventType | KeyboardEventType | WheelEventType;
95
+ type ReactEventType<T, K> = K extends KeyboardEventType ? React.KeyboardEvent<T> : K extends WheelEventType ? React.WheelEvent<T> : K extends PointerEventType ? React.PointerEvent<T> : never;
96
+ type SensorCallback<T, P extends React.PointerEvent<T> | React.KeyboardEvent<T> | React.WheelEvent<T>> = (event: P) => void;
97
+ type SubscribeSensors<T> = <ET extends SupportedEventType>(type: ET, callback: SensorCallback<T, ReactEventType<T, ET>>) => () => void;
98
+ type RegisterSensors<T> = Required<Pick<React.HTMLAttributes<T>, PointerEventType>> & Required<Pick<React.HTMLAttributes<T>, KeyboardEventType>> & Required<Pick<React.HTMLAttributes<T>, WheelEventType>>;
99
+ type UseSensors<T> = {
100
+ registerSensors: RegisterSensors<T>;
101
+ subscribeSensors: SubscribeSensors<T>;
102
+ };
103
+ declare function useSensors<T extends Element>(): UseSensors<T>;
104
+
105
+ declare function useThrottle(callback: (...args: any[]) => void, delay: number): (...args: any[]) => void;
106
+
107
+ type Topic = keyof EventTypes;
108
+ type Event<T extends Topic> = EventTypes[T];
109
+ type EventCallback<T extends Topic> = (...args: Event<T> extends void ? [] : [event: Event<T>]) => void;
110
+ type Subscribe = <T extends Topic>(topic: T, callback: EventCallback<T>) => () => void;
111
+ type Unsubscribe = <T extends Topic>(topic: T, callback: EventCallback<T>) => void;
112
+ type Publish = <T extends Topic>(...args: Event<T> extends void ? [topic: T] : [topic: T, event: Event<T>]) => void;
113
+ type EventsContextType = {
114
+ subscribe: Subscribe;
115
+ unsubscribe: Unsubscribe;
116
+ publish: Publish;
117
+ };
118
+ declare const EventsContext: React.Context<EventsContextType | null>;
119
+ declare const useEvents: () => EventsContextType;
120
+ declare function EventsProvider({ children }: React.PropsWithChildren): React.JSX.Element;
121
+
122
+ type LightboxPropsContextType = Omit<ComponentProps, "children">;
123
+ declare const LightboxPropsContext: React.Context<LightboxPropsContextType | null>;
124
+ declare const useLightboxProps: () => LightboxPropsContextType;
125
+ declare function LightboxPropsProvider({ children, ...props }: ComponentProps): React.JSX.Element;
126
+
127
+ type LightboxStateAction = LightboxStateSwipeAction | LightboxStateUpdateAction;
128
+ type LightboxStateContextType = LightboxState & {
129
+ /** @deprecated - use `useLightboxState` props directly */
130
+ state: LightboxState;
131
+ /** @deprecated - use `useLightboxDispatch` instead */
132
+ dispatch: React.Dispatch<LightboxStateAction>;
133
+ };
134
+ declare const LightboxStateContext: React.Context<LightboxStateContextType | null>;
135
+ declare const useLightboxState: () => NonNullable<LightboxStateContextType>;
136
+ type LightboxDispatchContextType = React.Dispatch<LightboxStateAction>;
137
+ declare const LightboxDispatchContext: React.Context<LightboxDispatchContextType | null>;
138
+ declare const useLightboxDispatch: () => LightboxDispatchContextType;
139
+ type LightboxStateProviderProps = React.PropsWithChildren<Pick<LightboxProps, "slides" | "index">>;
140
+ declare function LightboxStateProvider({ slides, index, children }: LightboxStateProviderProps): React.JSX.Element;
141
+
142
+ type TimeoutsContextType = {
143
+ setTimeout: (fn: () => void, delay?: number) => number;
144
+ clearTimeout: (id?: number) => void;
145
+ };
146
+ declare const TimeoutsContext: React.Context<TimeoutsContextType | null>;
147
+ declare const useTimeouts: () => TimeoutsContextType;
148
+ declare function TimeoutsProvider({ children }: React.PropsWithChildren): React.JSX.Element;
149
+
150
+ type IconButtonProps = Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "type" | "aria-label"> & {
151
+ label: string;
152
+ icon: React.ElementType;
153
+ renderIcon?: () => React.ReactNode;
154
+ };
155
+ declare const IconButton: React.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
156
+
157
+ declare function createIcon(name: string, glyph: React.ReactNode): {
158
+ (props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
159
+ displayName: string;
160
+ };
161
+ declare function createIconDisabled(name: string, glyph: React.ReactNode): {
162
+ (props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
163
+ displayName: string;
164
+ };
165
+ declare const CloseIcon: {
166
+ (props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
167
+ displayName: string;
168
+ };
169
+ declare const PreviousIcon: {
170
+ (props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
171
+ displayName: string;
172
+ };
173
+ declare const NextIcon: {
174
+ (props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
175
+ displayName: string;
176
+ };
177
+ declare const LoadingIcon: {
178
+ (props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
179
+ displayName: string;
180
+ };
181
+ declare const ErrorIcon: {
182
+ (props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
183
+ displayName: string;
184
+ };
185
+
186
+ type ImageSlideProps = {
187
+ slide: SlideImage;
188
+ offset?: number;
189
+ render?: Render;
190
+ rect?: ContainerRect;
191
+ imageFit?: ImageFit;
192
+ onClick?: () => void;
193
+ onLoad?: (image: HTMLImageElement) => void;
194
+ style?: React.CSSProperties;
195
+ };
196
+ declare function ImageSlide({ slide: image, offset, render, rect, imageFit, onClick, onLoad, style }: ImageSlideProps): React.JSX.Element;
197
+
198
+ declare function Carousel({ carousel: { finite, preload, padding, spacing } }: ComponentProps): React.JSX.Element;
199
+ declare const CarouselModule: Module;
200
+
201
+ type ControllerContextType = Pick<ControllerRef, "prev" | "next" | "close"> & {
202
+ focus: Callback;
203
+ slideRect: ContainerRect;
204
+ containerRect: ContainerRect;
205
+ subscribeSensors: SubscribeSensors<HTMLDivElement>;
206
+ containerRef: React.RefObject<HTMLDivElement>;
207
+ setCarouselRef: React.Ref<HTMLDivElement>;
208
+ toolbarWidth: number | undefined;
209
+ setToolbarWidth: (width: number | undefined) => void;
210
+ };
211
+ declare const ControllerContext: React.Context<ControllerContextType | null>;
212
+ declare const useController: () => NonNullable<ControllerContextType>;
213
+ declare function Controller({ children, ...props }: ComponentProps): React.JSX.Element;
214
+ declare const ControllerModule: Module;
215
+
216
+ type NavigationButtonProps = {
217
+ label: string;
218
+ icon: React.ElementType;
219
+ renderIcon?: RenderFunction;
220
+ action: "prev" | "next";
221
+ onClick: () => void;
222
+ disabled?: boolean;
223
+ };
224
+ declare function NavigationButton({ label, icon, renderIcon, action, onClick, disabled }: NavigationButtonProps): React.JSX.Element;
225
+ declare function Navigation({ carousel: { finite }, animation, render: { buttonPrev, buttonNext, iconPrev, iconNext }, }: ComponentProps): React.JSX.Element;
226
+ declare const NavigationModule: Module;
227
+
228
+ declare function NoScroll({ children }: ComponentProps): React.JSX.Element;
229
+ declare const NoScrollModule: Module;
230
+
231
+ declare function Portal({ children, animation, styles, className, on, portal, close }: ComponentProps): React.ReactPortal | null;
232
+ declare const PortalModule: Module;
233
+
234
+ declare function Root({ children }: ComponentProps): React.JSX.Element;
235
+ declare const RootModule: Module;
236
+
237
+ declare function Toolbar({ toolbar: { buttons }, render: { buttonClose, iconClose } }: ComponentProps): React.JSX.Element;
238
+ declare const ToolbarModule: Module;
239
+
240
+ export { Augmentation, Callback, Carousel, CarouselModule, CloseIcon, Component, ComponentProps, ComputeAnimation, ContainerRect, Controller, ControllerContext, ControllerContextType, ControllerModule, ControllerRef, ErrorIcon, Event, EventCallback, EventTypes, EventsContext, EventsContextType, EventsProvider, IconButton, IconButtonProps, ImageFit, ImageSlide, ImageSlideProps, KeyboardEventType, Labels, LengthOrPercentage, Lightbox, LightboxDefaultProps, LightboxDispatchContext, LightboxDispatchContextType, LightboxExternalProps, LightboxProps, LightboxPropsContext, LightboxPropsContextType, LightboxPropsProvider, LightboxState, LightboxStateAction, LightboxStateContext, LightboxStateContextType, LightboxStateProvider, LightboxStateProviderProps, LightboxStateSwipeAction, LightboxStateUpdateAction, LoadingIcon, Module, Navigation, NavigationButton, NavigationButtonProps, NavigationModule, NextIcon, NoScroll, NoScrollModule, Node, Plugin, PointerEventType, Portal, PortalModule, PreviousIcon, Publish, ReactEventType, RegisterSensors, Render, RenderFunction, Root, RootModule, SensorCallback, Slide, SlideImage, Subscribe, SubscribeSensors, SupportedEventType, TimeoutsContext, TimeoutsContextType, TimeoutsProvider, Toolbar, ToolbarModule, ToolbarSettings, Topic, Unsubscribe, UseSensors, WheelEventType, addToolbarButton, cleanup, clsx, composePrefix, computeSlideRect, createIcon, createIconDisabled, createModule, createNode, cssClass, cssVar, Lightbox as default, devicePixelRatio, getSlide, getSlideIfPresent, getSlideIndex, hasSlides, hasWindow, isImageFitCover, isImageSlide, label, makeComposePrefix, makeUseContext, parseLengthPercentage, round, setRef, stopNavigationEventsPropagation, useAnimation, useContainerRect, useController, useDelay, useEventCallback, useEvents, useForkRef, useLayoutEffect, useLightboxDispatch, useLightboxProps, useLightboxState, useLoseFocus, useMotionPreference, useRTL, useSensors, useThrottle, useTimeouts, withPlugins };