@mantine/hooks 8.0.2 → 8.1.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 (229) hide show
  1. package/cjs/index.cjs +3 -1
  2. package/cjs/index.cjs.map +1 -1
  3. package/cjs/use-clipboard/use-clipboard.cjs +4 -4
  4. package/cjs/use-clipboard/use-clipboard.cjs.map +1 -1
  5. package/cjs/use-color-scheme/use-color-scheme.cjs.map +1 -1
  6. package/cjs/use-counter/use-counter.cjs +13 -4
  7. package/cjs/use-counter/use-counter.cjs.map +1 -1
  8. package/cjs/use-debounced-callback/use-debounced-callback.cjs +1 -1
  9. package/cjs/use-debounced-callback/use-debounced-callback.cjs.map +1 -1
  10. package/cjs/use-debounced-state/use-debounced-state.cjs.map +1 -1
  11. package/cjs/use-debounced-value/use-debounced-value.cjs.map +1 -1
  12. package/cjs/use-disclosure/use-disclosure.cjs +5 -6
  13. package/cjs/use-disclosure/use-disclosure.cjs.map +1 -1
  14. package/cjs/use-event-listener/use-event-listener.cjs +24 -9
  15. package/cjs/use-event-listener/use-event-listener.cjs.map +1 -1
  16. package/cjs/use-eye-dropper/use-eye-dropper.cjs +3 -3
  17. package/cjs/use-eye-dropper/use-eye-dropper.cjs.map +1 -1
  18. package/cjs/use-fetch/use-fetch.cjs +0 -3
  19. package/cjs/use-fetch/use-fetch.cjs.map +1 -1
  20. package/cjs/use-file-dialog/use-file-dialog.cjs.map +1 -1
  21. package/cjs/use-focus-return/use-focus-return.cjs +4 -1
  22. package/cjs/use-focus-return/use-focus-return.cjs.map +1 -1
  23. package/cjs/use-focus-trap/use-focus-trap.cjs.map +1 -1
  24. package/cjs/use-focus-within/use-focus-within.cjs +43 -26
  25. package/cjs/use-focus-within/use-focus-within.cjs.map +1 -1
  26. package/cjs/use-fullscreen/use-fullscreen.cjs.map +1 -1
  27. package/cjs/use-hash/use-hash.cjs +3 -1
  28. package/cjs/use-hash/use-hash.cjs.map +1 -1
  29. package/cjs/use-headroom/use-headroom.cjs +1 -1
  30. package/cjs/use-headroom/use-headroom.cjs.map +1 -1
  31. package/cjs/use-hover/use-hover.cjs +21 -15
  32. package/cjs/use-hover/use-hover.cjs.map +1 -1
  33. package/cjs/use-idle/use-idle.cjs +3 -9
  34. package/cjs/use-idle/use-idle.cjs.map +1 -1
  35. package/cjs/use-in-viewport/use-in-viewport.cjs.map +1 -1
  36. package/cjs/use-input-state/use-input-state.cjs.map +1 -1
  37. package/cjs/use-intersection/use-intersection.cjs.map +1 -1
  38. package/cjs/use-interval/use-interval.cjs +6 -6
  39. package/cjs/use-interval/use-interval.cjs.map +1 -1
  40. package/cjs/use-list-state/use-list-state.cjs.map +1 -1
  41. package/cjs/use-local-storage/create-storage.cjs.map +1 -1
  42. package/cjs/use-local-storage/use-local-storage.cjs.map +1 -1
  43. package/cjs/use-long-press/use-long-press.cjs +65 -0
  44. package/cjs/use-long-press/use-long-press.cjs.map +1 -0
  45. package/cjs/use-media-query/use-media-query.cjs +1 -1
  46. package/cjs/use-media-query/use-media-query.cjs.map +1 -1
  47. package/cjs/use-merged-ref/use-merged-ref.cjs.map +1 -1
  48. package/cjs/use-mouse/use-mouse.cjs +2 -2
  49. package/cjs/use-mouse/use-mouse.cjs.map +1 -1
  50. package/cjs/use-move/use-move.cjs +76 -75
  51. package/cjs/use-move/use-move.cjs.map +1 -1
  52. package/cjs/use-network/use-network.cjs +1 -3
  53. package/cjs/use-network/use-network.cjs.map +1 -1
  54. package/cjs/use-orientation/use-orientation.cjs.map +1 -1
  55. package/cjs/use-os/use-os.cjs +3 -1
  56. package/cjs/use-os/use-os.cjs.map +1 -1
  57. package/cjs/use-pagination/use-pagination.cjs.map +1 -1
  58. package/cjs/use-queue/use-queue.cjs +4 -1
  59. package/cjs/use-queue/use-queue.cjs.map +1 -1
  60. package/cjs/use-radial-move/use-radial-move.cjs +63 -62
  61. package/cjs/use-radial-move/use-radial-move.cjs.map +1 -1
  62. package/cjs/use-scroll-into-view/use-scroll-into-view.cjs +84 -8
  63. package/cjs/use-scroll-into-view/use-scroll-into-view.cjs.map +1 -1
  64. package/cjs/use-session-storage/use-session-storage.cjs.map +1 -1
  65. package/cjs/use-set-state/use-set-state.cjs.map +1 -1
  66. package/cjs/use-state-history/use-state-history.cjs.map +1 -1
  67. package/cjs/use-throttled-callback/use-throttled-callback.cjs +1 -1
  68. package/cjs/use-throttled-callback/use-throttled-callback.cjs.map +1 -1
  69. package/cjs/use-timeout/use-timeout.cjs +2 -2
  70. package/cjs/use-timeout/use-timeout.cjs.map +1 -1
  71. package/cjs/use-toggle/use-toggle.cjs.map +1 -1
  72. package/cjs/use-uncontrolled/use-uncontrolled.cjs.map +1 -1
  73. package/cjs/use-validated-state/use-validated-state.cjs +4 -4
  74. package/cjs/use-validated-state/use-validated-state.cjs.map +1 -1
  75. package/cjs/use-window-scroll/use-window-scroll.cjs +1 -1
  76. package/cjs/use-window-scroll/use-window-scroll.cjs.map +1 -1
  77. package/cjs/utils/use-callback-ref/use-callback-ref.cjs.map +1 -0
  78. package/esm/index.mjs +2 -1
  79. package/esm/index.mjs.map +1 -1
  80. package/esm/use-clipboard/use-clipboard.mjs +4 -4
  81. package/esm/use-clipboard/use-clipboard.mjs.map +1 -1
  82. package/esm/use-color-scheme/use-color-scheme.mjs.map +1 -1
  83. package/esm/use-counter/use-counter.mjs +14 -5
  84. package/esm/use-counter/use-counter.mjs.map +1 -1
  85. package/esm/use-debounced-callback/use-debounced-callback.mjs +1 -1
  86. package/esm/use-debounced-callback/use-debounced-callback.mjs.map +1 -1
  87. package/esm/use-debounced-state/use-debounced-state.mjs.map +1 -1
  88. package/esm/use-debounced-value/use-debounced-value.mjs.map +1 -1
  89. package/esm/use-disclosure/use-disclosure.mjs +5 -6
  90. package/esm/use-disclosure/use-disclosure.mjs.map +1 -1
  91. package/esm/use-event-listener/use-event-listener.mjs +25 -10
  92. package/esm/use-event-listener/use-event-listener.mjs.map +1 -1
  93. package/esm/use-eye-dropper/use-eye-dropper.mjs +3 -3
  94. package/esm/use-eye-dropper/use-eye-dropper.mjs.map +1 -1
  95. package/esm/use-fetch/use-fetch.mjs +0 -3
  96. package/esm/use-fetch/use-fetch.mjs.map +1 -1
  97. package/esm/use-file-dialog/use-file-dialog.mjs.map +1 -1
  98. package/esm/use-focus-return/use-focus-return.mjs +4 -1
  99. package/esm/use-focus-return/use-focus-return.mjs.map +1 -1
  100. package/esm/use-focus-trap/use-focus-trap.mjs.map +1 -1
  101. package/esm/use-focus-within/use-focus-within.mjs +44 -27
  102. package/esm/use-focus-within/use-focus-within.mjs.map +1 -1
  103. package/esm/use-fullscreen/use-fullscreen.mjs.map +1 -1
  104. package/esm/use-hash/use-hash.mjs +3 -1
  105. package/esm/use-hash/use-hash.mjs.map +1 -1
  106. package/esm/use-headroom/use-headroom.mjs +1 -1
  107. package/esm/use-headroom/use-headroom.mjs.map +1 -1
  108. package/esm/use-hover/use-hover.mjs +22 -16
  109. package/esm/use-hover/use-hover.mjs.map +1 -1
  110. package/esm/use-idle/use-idle.mjs +3 -9
  111. package/esm/use-idle/use-idle.mjs.map +1 -1
  112. package/esm/use-in-viewport/use-in-viewport.mjs.map +1 -1
  113. package/esm/use-input-state/use-input-state.mjs.map +1 -1
  114. package/esm/use-intersection/use-intersection.mjs.map +1 -1
  115. package/esm/use-interval/use-interval.mjs +7 -7
  116. package/esm/use-interval/use-interval.mjs.map +1 -1
  117. package/esm/use-list-state/use-list-state.mjs.map +1 -1
  118. package/esm/use-local-storage/create-storage.mjs.map +1 -1
  119. package/esm/use-local-storage/use-local-storage.mjs.map +1 -1
  120. package/esm/use-long-press/use-long-press.mjs +63 -0
  121. package/esm/use-long-press/use-long-press.mjs.map +1 -0
  122. package/esm/use-media-query/use-media-query.mjs +1 -1
  123. package/esm/use-media-query/use-media-query.mjs.map +1 -1
  124. package/esm/use-merged-ref/use-merged-ref.mjs.map +1 -1
  125. package/esm/use-mouse/use-mouse.mjs +2 -2
  126. package/esm/use-mouse/use-mouse.mjs.map +1 -1
  127. package/esm/use-move/use-move.mjs +77 -76
  128. package/esm/use-move/use-move.mjs.map +1 -1
  129. package/esm/use-network/use-network.mjs +1 -3
  130. package/esm/use-network/use-network.mjs.map +1 -1
  131. package/esm/use-orientation/use-orientation.mjs.map +1 -1
  132. package/esm/use-os/use-os.mjs +3 -1
  133. package/esm/use-os/use-os.mjs.map +1 -1
  134. package/esm/use-pagination/use-pagination.mjs.map +1 -1
  135. package/esm/use-queue/use-queue.mjs +4 -1
  136. package/esm/use-queue/use-queue.mjs.map +1 -1
  137. package/esm/use-radial-move/use-radial-move.mjs +64 -63
  138. package/esm/use-radial-move/use-radial-move.mjs.map +1 -1
  139. package/esm/use-scroll-into-view/use-scroll-into-view.mjs +80 -4
  140. package/esm/use-scroll-into-view/use-scroll-into-view.mjs.map +1 -1
  141. package/esm/use-session-storage/use-session-storage.mjs.map +1 -1
  142. package/esm/use-set-state/use-set-state.mjs.map +1 -1
  143. package/esm/use-state-history/use-state-history.mjs.map +1 -1
  144. package/esm/use-throttled-callback/use-throttled-callback.mjs +1 -1
  145. package/esm/use-throttled-callback/use-throttled-callback.mjs.map +1 -1
  146. package/esm/use-timeout/use-timeout.mjs +2 -2
  147. package/esm/use-timeout/use-timeout.mjs.map +1 -1
  148. package/esm/use-toggle/use-toggle.mjs.map +1 -1
  149. package/esm/use-uncontrolled/use-uncontrolled.mjs.map +1 -1
  150. package/esm/use-validated-state/use-validated-state.mjs +4 -4
  151. package/esm/use-validated-state/use-validated-state.mjs.map +1 -1
  152. package/esm/use-window-scroll/use-window-scroll.mjs +1 -1
  153. package/esm/use-window-scroll/use-window-scroll.mjs.map +1 -1
  154. package/esm/utils/use-callback-ref/use-callback-ref.mjs.map +1 -0
  155. package/lib/index.d.mts +41 -8
  156. package/lib/index.d.ts +41 -8
  157. package/lib/use-clipboard/use-clipboard.d.ts +12 -5
  158. package/lib/use-color-scheme/use-color-scheme.d.ts +2 -1
  159. package/lib/use-counter/use-counter.d.ts +12 -9
  160. package/lib/use-debounced-callback/use-debounced-callback.d.ts +6 -2
  161. package/lib/use-debounced-state/use-debounced-state.d.ts +5 -3
  162. package/lib/use-debounced-value/use-debounced-value.d.ts +5 -3
  163. package/lib/use-disclosure/use-disclosure.d.ts +9 -6
  164. package/lib/use-event-listener/use-event-listener.d.ts +1 -1
  165. package/lib/use-eye-dropper/use-eye-dropper.d.ts +4 -4
  166. package/lib/use-fetch/use-fetch.d.ts +4 -3
  167. package/lib/use-file-dialog/use-file-dialog.d.ts +3 -2
  168. package/lib/use-focus-return/use-focus-return.d.ts +3 -4
  169. package/lib/use-focus-trap/use-focus-trap.d.ts +1 -1
  170. package/lib/use-focus-within/use-focus-within.d.ts +4 -3
  171. package/lib/use-fullscreen/use-fullscreen.d.ts +6 -5
  172. package/lib/use-hash/use-hash.d.ts +3 -3
  173. package/lib/use-headroom/use-headroom.d.ts +3 -4
  174. package/lib/use-hover/use-hover.d.ts +4 -3
  175. package/lib/use-idle/use-idle.d.ts +5 -4
  176. package/lib/use-in-viewport/use-in-viewport.d.ts +4 -3
  177. package/lib/use-input-state/use-input-state.d.ts +5 -1
  178. package/lib/use-intersection/use-intersection.d.ts +4 -3
  179. package/lib/use-interval/use-interval.d.ts +8 -4
  180. package/lib/use-list-state/use-list-state.d.ts +2 -2
  181. package/lib/use-local-storage/create-storage.d.ts +8 -3
  182. package/lib/use-local-storage/use-local-storage.d.ts +3 -3
  183. package/lib/use-long-press/use-long-press.d.ts +19 -0
  184. package/lib/use-media-query/use-media-query.d.ts +1 -1
  185. package/lib/use-merged-ref/use-merged-ref.d.ts +2 -2
  186. package/lib/use-move/use-move.d.ts +5 -5
  187. package/lib/use-network/use-network.d.ts +3 -5
  188. package/lib/use-orientation/use-orientation.d.ts +2 -3
  189. package/lib/use-os/use-os.d.ts +3 -4
  190. package/lib/use-pagination/use-pagination.d.ts +13 -5
  191. package/lib/use-queue/use-queue.d.ts +13 -4
  192. package/lib/use-radial-move/use-radial-move.d.ts +6 -3
  193. package/lib/use-reduced-motion/use-reduced-motion.d.ts +1 -1
  194. package/lib/use-scroll-into-view/use-scroll-into-view.d.ts +7 -7
  195. package/lib/use-session-storage/use-session-storage.d.ts +3 -3
  196. package/lib/use-set-state/use-set-state.d.ts +3 -1
  197. package/lib/use-state-history/use-state-history.d.ts +7 -2
  198. package/lib/use-timeout/use-timeout.d.ts +6 -4
  199. package/lib/use-toggle/use-toggle.d.ts +4 -1
  200. package/lib/use-uncontrolled/use-uncontrolled.d.ts +10 -3
  201. package/lib/use-validated-state/use-validated-state.d.ts +15 -5
  202. package/lib/use-window-scroll/use-window-scroll.d.ts +4 -4
  203. package/lib/utils/index.d.ts +1 -0
  204. package/package.json +1 -1
  205. package/cjs/use-callback-ref/use-callback-ref.cjs.map +0 -1
  206. package/cjs/use-scroll-into-view/utils/ease-in-out-quad.cjs +0 -7
  207. package/cjs/use-scroll-into-view/utils/ease-in-out-quad.cjs.map +0 -1
  208. package/cjs/use-scroll-into-view/utils/get-relative-position.cjs +0 -66
  209. package/cjs/use-scroll-into-view/utils/get-relative-position.cjs.map +0 -1
  210. package/cjs/use-scroll-into-view/utils/get-scroll-start.cjs +0 -17
  211. package/cjs/use-scroll-into-view/utils/get-scroll-start.cjs.map +0 -1
  212. package/cjs/use-scroll-into-view/utils/set-scroll-param.cjs +0 -19
  213. package/cjs/use-scroll-into-view/utils/set-scroll-param.cjs.map +0 -1
  214. package/esm/use-callback-ref/use-callback-ref.mjs.map +0 -1
  215. package/esm/use-scroll-into-view/utils/ease-in-out-quad.mjs +0 -5
  216. package/esm/use-scroll-into-view/utils/ease-in-out-quad.mjs.map +0 -1
  217. package/esm/use-scroll-into-view/utils/get-relative-position.mjs +0 -64
  218. package/esm/use-scroll-into-view/utils/get-relative-position.mjs.map +0 -1
  219. package/esm/use-scroll-into-view/utils/get-scroll-start.mjs +0 -15
  220. package/esm/use-scroll-into-view/utils/get-scroll-start.mjs.map +0 -1
  221. package/esm/use-scroll-into-view/utils/set-scroll-param.mjs +0 -17
  222. package/esm/use-scroll-into-view/utils/set-scroll-param.mjs.map +0 -1
  223. package/lib/use-scroll-into-view/utils/ease-in-out-quad.d.ts +0 -1
  224. package/lib/use-scroll-into-view/utils/get-relative-position.d.ts +0 -1
  225. package/lib/use-scroll-into-view/utils/get-scroll-start.d.ts +0 -1
  226. package/lib/use-scroll-into-view/utils/set-scroll-param.d.ts +0 -1
  227. /package/cjs/{use-callback-ref → utils/use-callback-ref}/use-callback-ref.cjs +0 -0
  228. /package/esm/{use-callback-ref → utils/use-callback-ref}/use-callback-ref.mjs +0 -0
  229. /package/lib/{use-callback-ref → utils/use-callback-ref}/use-callback-ref.d.ts +0 -0
@@ -1 +1 @@
1
- export declare function useEventListener<K extends keyof HTMLElementEventMap, T extends HTMLElement = any>(type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): import("react").RefObject<T | null>;
1
+ export declare function useEventListener<K extends keyof HTMLElementEventMap, T extends HTMLElement = any>(type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): React.RefCallback<T | null>;
@@ -1,11 +1,11 @@
1
- interface EyeDropperOpenOptions {
1
+ export interface EyeDropperOpenOptions {
2
2
  signal?: AbortSignal;
3
3
  }
4
4
  export interface EyeDropperOpenReturnType {
5
5
  sRGBHex: string;
6
6
  }
7
- export declare function useEyeDropper(): {
7
+ export interface UseEyeDropperReturnValue {
8
8
  supported: boolean;
9
9
  open: (options?: EyeDropperOpenOptions) => Promise<EyeDropperOpenReturnType | undefined>;
10
- };
11
- export {};
10
+ }
11
+ export declare function useEyeDropper(): UseEyeDropperReturnValue;
@@ -1,10 +1,11 @@
1
1
  export interface UseFetchOptions extends RequestInit {
2
2
  autoInvoke?: boolean;
3
3
  }
4
- export declare function useFetch<T>(url: string, { autoInvoke, ...options }?: UseFetchOptions): {
4
+ export interface UseFetchReturnValue<T> {
5
5
  data: T | null;
6
6
  loading: boolean;
7
7
  error: Error | null;
8
- refetch: () => Promise<any> | undefined;
8
+ refetch: () => Promise<any>;
9
9
  abort: () => void;
10
- };
10
+ }
11
+ export declare function useFetch<T>(url: string, { autoInvoke, ...options }?: UseFetchOptions): UseFetchReturnValue<T>;
@@ -16,8 +16,9 @@ export interface UseFileDialogOptions {
16
16
  /** Called when file dialog is canceled */
17
17
  onCancel?: () => void;
18
18
  }
19
- export declare function useFileDialog(input?: UseFileDialogOptions): {
19
+ export interface UseFileDialogReturnValue {
20
20
  files: FileList | null;
21
21
  open: () => void;
22
22
  reset: () => void;
23
- };
23
+ }
24
+ export declare function useFileDialog(input?: UseFileDialogOptions): UseFileDialogReturnValue;
@@ -1,7 +1,6 @@
1
- interface UseFocusReturn {
1
+ export interface UseFocusReturnOptions {
2
2
  opened: boolean;
3
3
  shouldReturnFocus?: boolean;
4
4
  }
5
- /** Returns focus to last active element, used in Modal and Drawer */
6
- export declare function useFocusReturn({ opened, shouldReturnFocus }: UseFocusReturn): () => void;
7
- export {};
5
+ export type UseFocusReturnReturnValue = () => void;
6
+ export declare function useFocusReturn({ opened, shouldReturnFocus, }: UseFocusReturnOptions): UseFocusReturnReturnValue;
@@ -1 +1 @@
1
- export declare function useFocusTrap(active?: boolean): (instance: HTMLElement | null) => void;
1
+ export declare function useFocusTrap(active?: boolean): React.RefCallback<HTMLElement | null>;
@@ -2,7 +2,8 @@ export interface UseFocusWithinOptions {
2
2
  onFocus?: (event: FocusEvent) => void;
3
3
  onBlur?: (event: FocusEvent) => void;
4
4
  }
5
- export declare function useFocusWithin<T extends HTMLElement = any>({ onBlur, onFocus, }?: UseFocusWithinOptions): {
6
- ref: React.RefObject<T>;
5
+ export interface UseFocusWithinReturnValue<T extends HTMLElement = any> {
6
+ ref: React.RefCallback<T | null>;
7
7
  focused: boolean;
8
- };
8
+ }
9
+ export declare function useFocusWithin<T extends HTMLElement = any>({ onBlur, onFocus, }?: UseFocusWithinOptions): UseFocusWithinReturnValue<T>;
@@ -1,5 +1,6 @@
1
- export declare function useFullscreen<T extends HTMLElement = any>(): {
2
- readonly ref: (element: T | null) => void;
3
- readonly toggle: () => Promise<void>;
4
- readonly fullscreen: boolean;
5
- };
1
+ export interface UseFullscreenReturnValue<T extends HTMLElement = any> {
2
+ ref: React.RefCallback<T | null>;
3
+ toggle: () => Promise<void>;
4
+ fullscreen: boolean;
5
+ }
6
+ export declare function useFullscreen<T extends HTMLElement = any>(): UseFullscreenReturnValue<T>;
@@ -1,5 +1,5 @@
1
- interface UseHashOptions {
1
+ export interface UseHashOptions {
2
2
  getInitialValueInEffect?: boolean;
3
3
  }
4
- export declare function useHash({ getInitialValueInEffect }?: UseHashOptions): readonly [string, (value: string) => void];
5
- export {};
4
+ export type UseHashReturnValue = [string, (value: string) => void];
5
+ export declare function useHash({ getInitialValueInEffect, }?: UseHashOptions): UseHashReturnValue;
@@ -1,9 +1,9 @@
1
1
  export declare const isFixed: (current: number, fixedAt: number) => boolean;
2
2
  export declare const isPinned: (current: number, previous: number) => boolean;
3
3
  export declare const isReleased: (current: number, previous: number, fixedAt: number) => boolean;
4
- export declare const isPinnedOrReleased: (current: number, fixedAt: number, isCurrentlyPinnedRef: React.MutableRefObject<boolean>, isScrollingUp: boolean, onPin?: () => void, onRelease?: () => void) => void;
4
+ export declare const isPinnedOrReleased: (current: number, fixedAt: number, isCurrentlyPinnedRef: React.RefObject<boolean>, isScrollingUp: boolean, onPin?: () => void, onRelease?: () => void) => void;
5
5
  export declare const useScrollDirection: () => boolean;
6
- interface UseHeadroomInput {
6
+ export interface UseHeadroomOptions {
7
7
  /** Number in px at which element should be fixed */
8
8
  fixedAt?: number;
9
9
  /** Called when element is pinned */
@@ -13,5 +13,4 @@ interface UseHeadroomInput {
13
13
  /** Called when element is unpinned */
14
14
  onRelease?: () => void;
15
15
  }
16
- export declare function useHeadroom({ fixedAt, onPin, onFix, onRelease }?: UseHeadroomInput): boolean;
17
- export {};
16
+ export declare function useHeadroom({ fixedAt, onPin, onFix, onRelease }?: UseHeadroomOptions): boolean;
@@ -1,4 +1,5 @@
1
- export declare function useHover<T extends HTMLElement = any>(): {
2
- ref: import("react").RefObject<T | null>;
1
+ export interface UseHoverReturnValue<T extends HTMLElement = any> {
3
2
  hovered: boolean;
4
- };
3
+ ref: React.RefCallback<T | null>;
4
+ }
5
+ export declare function useHover<T extends HTMLElement = any>(): UseHoverReturnValue<T>;
@@ -1,4 +1,5 @@
1
- export declare function useIdle(timeout: number, options?: Partial<{
2
- events: (keyof DocumentEventMap)[];
3
- initialState: boolean;
4
- }>): boolean;
1
+ export interface UseIdleOptions {
2
+ events?: (keyof DocumentEventMap)[];
3
+ initialState?: boolean;
4
+ }
5
+ export declare function useIdle(timeout: number, options?: UseIdleOptions): boolean;
@@ -1,4 +1,5 @@
1
- export declare function useInViewport<T extends HTMLElement = any>(): {
2
- ref: (node: T | null) => void;
1
+ export interface UseInViewportReturnValue<T extends HTMLElement = any> {
3
2
  inViewport: boolean;
4
- };
3
+ ref: React.RefCallback<T | null>;
4
+ }
5
+ export declare function useInViewport<T extends HTMLElement = any>(): UseInViewportReturnValue<T>;
@@ -1,2 +1,6 @@
1
1
  export declare function getInputOnChange<T>(setValue: (value: null | undefined | T | ((current: T) => T)) => void): (val: null | undefined | T | React.ChangeEvent<any> | ((current: T) => T)) => void;
2
- export declare function useInputState<T>(initialState: T): [T, (value: null | undefined | T | React.ChangeEvent<any>) => void];
2
+ export type UseInputStateReturnValue<T> = [
3
+ T,
4
+ (value: null | undefined | T | React.ChangeEvent<any>) => void
5
+ ];
6
+ export declare function useInputState<T>(initialState: T): UseInputStateReturnValue<T>;
@@ -1,4 +1,5 @@
1
- export declare function useIntersection<T extends HTMLElement = any>(options?: ConstructorParameters<typeof IntersectionObserver>[1]): {
2
- ref: (element: T | null) => void;
1
+ export interface UseIntersectionReturnValue<T> {
2
+ ref: React.RefCallback<T | null>;
3
3
  entry: IntersectionObserverEntry | null;
4
- };
4
+ }
5
+ export declare function useIntersection<T extends HTMLElement = any>(options?: IntersectionObserverInit): UseIntersectionReturnValue<T>;
@@ -1,11 +1,15 @@
1
- interface UseIntervalOptions {
1
+ export interface UseIntervalOptions {
2
2
  /** If set, the interval will start automatically when the component is mounted, `false` by default */
3
3
  autoInvoke?: boolean;
4
4
  }
5
- export declare function useInterval(fn: () => void, interval: number, { autoInvoke }?: UseIntervalOptions): {
5
+ export interface UseIntervalReturnValue {
6
+ /** Starts the interval */
6
7
  start: () => void;
8
+ /** Stops the interval */
7
9
  stop: () => void;
10
+ /** Toggles the interval */
8
11
  toggle: () => void;
12
+ /** Indicates if the interval is active */
9
13
  active: boolean;
10
- };
11
- export {};
14
+ }
15
+ export declare function useInterval(fn: () => void, interval: number, { autoInvoke }?: UseIntervalOptions): UseIntervalReturnValue;
@@ -20,5 +20,5 @@ export interface UseListStateHandlers<T> {
20
20
  setItemProp: <K extends keyof T, U extends T[K]>(index: number, prop: K, value: U) => void;
21
21
  filter: (fn: (item: T, i: number) => boolean) => void;
22
22
  }
23
- export type UseListState<T> = [T[], UseListStateHandlers<T>];
24
- export declare function useListState<T>(initialValue?: T[]): UseListState<T>;
23
+ export type UseListStateReturnValue<T> = [T[], UseListStateHandlers<T>];
24
+ export declare function useListState<T>(initialValue?: T[]): UseListStateReturnValue<T>;
@@ -1,5 +1,5 @@
1
1
  export type StorageType = 'localStorage' | 'sessionStorage';
2
- export interface StorageProperties<T> {
2
+ export interface UseStorageOptions<T> {
3
3
  /** Storage key */
4
4
  key: string;
5
5
  /** Default value that will be set if value is not found in storage */
@@ -13,5 +13,10 @@ export interface StorageProperties<T> {
13
13
  /** Function to deserialize string value from storage to value */
14
14
  deserialize?: (value: string | undefined) => T;
15
15
  }
16
- export declare function createStorage<T>(type: StorageType, hookName: string): ({ key, defaultValue, getInitialValueInEffect, sync, deserialize, serialize, }: StorageProperties<T>) => [T, (val: T | ((prevState: T) => T)) => void, () => void];
17
- export declare function readValue(type: StorageType): <T>({ key, defaultValue, deserialize, }: StorageProperties<T>) => T;
16
+ export type UseStorageReturnValue<T> = [
17
+ T,
18
+ (val: T | ((prevState: T) => T)) => void,
19
+ () => void
20
+ ];
21
+ export declare function createStorage<T>(type: StorageType, hookName: string): ({ key, defaultValue, getInitialValueInEffect, sync, deserialize, serialize, }: UseStorageOptions<T>) => UseStorageReturnValue<T>;
22
+ export declare function readValue(type: StorageType): <T>({ key, defaultValue, deserialize, }: UseStorageOptions<T>) => T;
@@ -1,3 +1,3 @@
1
- import { StorageProperties } from './create-storage';
2
- export declare function useLocalStorage<T = string>(props: StorageProperties<T>): [T, (val: T | ((prevState: T) => T)) => void, () => void];
3
- export declare const readLocalStorageValue: <T>({ key, defaultValue, deserialize, }: StorageProperties<T>) => T;
1
+ import { UseStorageOptions } from './create-storage';
2
+ export declare function useLocalStorage<T = string>(props: UseStorageOptions<T>): import("./create-storage").UseStorageReturnValue<T>;
3
+ export declare const readLocalStorageValue: <T>({ key, defaultValue, deserialize, }: UseStorageOptions<T>) => T;
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ export interface UseLongPressOptions {
3
+ /** Time in milliseconds to trigger the long press, default is 400ms */
4
+ threshold?: number;
5
+ /** Callback triggered when the long press starts */
6
+ onStart?: (event: React.MouseEvent | React.TouchEvent) => void;
7
+ /** Callback triggered when the long press finishes */
8
+ onFinish?: (event: React.MouseEvent | React.TouchEvent) => void;
9
+ /** Callback triggered when the long press is canceled */
10
+ onCancel?: (event: React.MouseEvent | React.TouchEvent) => void;
11
+ }
12
+ export interface UseLongPressReturnValue {
13
+ onMouseDown: (event: React.MouseEvent) => void;
14
+ onMouseUp: (event: React.MouseEvent) => void;
15
+ onMouseLeave: (event: React.MouseEvent) => void;
16
+ onTouchStart: (event: React.TouchEvent) => void;
17
+ onTouchEnd: (event: React.TouchEvent) => void;
18
+ }
19
+ export declare function useLongPress(onLongPress: (event: React.MouseEvent | React.TouchEvent) => void, options?: UseLongPressOptions): UseLongPressReturnValue;
@@ -1,4 +1,4 @@
1
1
  export interface UseMediaQueryOptions {
2
2
  getInitialValueInEffect: boolean;
3
3
  }
4
- export declare function useMediaQuery(query: string, initialValue?: boolean, { getInitialValueInEffect }?: UseMediaQueryOptions): boolean | undefined;
4
+ export declare function useMediaQuery(query: string, initialValue?: boolean, { getInitialValueInEffect }?: UseMediaQueryOptions): boolean;
@@ -2,6 +2,6 @@ import { Ref, type RefCallback } from 'react';
2
2
  type PossibleRef<T> = Ref<T> | undefined;
3
3
  type RefCleanup<T> = ReturnType<RefCallback<T>>;
4
4
  export declare function assignRef<T>(ref: PossibleRef<T>, value: T): RefCleanup<T>;
5
- export declare function mergeRefs<T>(...refs: PossibleRef<T>[]): (node: T | null) => (() => void) | undefined;
6
- export declare function useMergedRef<T>(...refs: PossibleRef<T>[]): (node: T | null) => (() => void) | undefined;
5
+ export declare function mergeRefs<T>(...refs: PossibleRef<T>[]): RefCallback<T>;
6
+ export declare function useMergedRef<T>(...refs: PossibleRef<T>[]): RefCallback<T>;
7
7
  export {};
@@ -6,12 +6,12 @@ export declare function clampUseMovePosition(position: UseMovePosition): {
6
6
  x: number;
7
7
  y: number;
8
8
  };
9
- interface useMoveHandlers {
9
+ export interface UseMoveHandlers {
10
10
  onScrubStart?: () => void;
11
11
  onScrubEnd?: () => void;
12
12
  }
13
- export declare function useMove<T extends HTMLElement = any>(onChange: (value: UseMovePosition) => void, handlers?: useMoveHandlers, dir?: 'ltr' | 'rtl'): {
14
- ref: import("react").RefObject<T | null>;
13
+ export interface UseMoveReturnValue<T extends HTMLElement = any> {
14
+ ref: React.RefCallback<T | null>;
15
15
  active: boolean;
16
- };
17
- export {};
16
+ }
17
+ export declare function useMove<T extends HTMLElement = any>(onChange: (value: UseMovePosition) => void, handlers?: UseMoveHandlers, dir?: 'ltr' | 'rtl'): UseMoveReturnValue<T>;
@@ -1,4 +1,5 @@
1
- interface NetworkStatus {
1
+ export interface UserNetworkReturnValue {
2
+ online: boolean;
2
3
  downlink?: number;
3
4
  downlinkMax?: number;
4
5
  effectiveType?: 'slow-2g' | '2g' | '3g' | '4g';
@@ -6,7 +7,4 @@ interface NetworkStatus {
6
7
  saveData?: boolean;
7
8
  type?: 'bluetooth' | 'cellular' | 'ethernet' | 'wifi' | 'wimax' | 'none' | 'other' | 'unknown';
8
9
  }
9
- export declare function useNetwork(): {
10
- online: boolean;
11
- } & NetworkStatus;
12
- export {};
10
+ export declare function useNetwork(): UserNetworkReturnValue;
@@ -1,4 +1,4 @@
1
- interface UseOrientationOptions {
1
+ export interface UseOrientationOptions {
2
2
  /** Default angle value, used until the real can be retrieved
3
3
  * (during server side rendering and before js executes on the page)
4
4
  * If not provided, the default value is `0`
@@ -15,9 +15,8 @@ interface UseOrientationOptions {
15
15
  */
16
16
  getInitialValueInEffect?: boolean;
17
17
  }
18
- interface UseOrientationReturnType {
18
+ export interface UseOrientationReturnType {
19
19
  angle: number;
20
20
  type: OrientationType;
21
21
  }
22
22
  export declare function useOrientation({ defaultAngle, defaultType, getInitialValueInEffect, }?: UseOrientationOptions): UseOrientationReturnType;
23
- export {};
@@ -1,6 +1,5 @@
1
- export type OS = 'undetermined' | 'macos' | 'ios' | 'windows' | 'android' | 'linux' | 'chromeos';
2
- interface UseOsOptions {
1
+ export type UseOSReturnValue = 'undetermined' | 'macos' | 'ios' | 'windows' | 'android' | 'linux' | 'chromeos';
2
+ export interface UseOsOptions {
3
3
  getValueInEffect: boolean;
4
4
  }
5
- export declare function useOs(options?: UseOsOptions): OS;
6
- export {};
5
+ export declare function useOs(options?: UseOsOptions): UseOSReturnValue;
@@ -1,5 +1,5 @@
1
1
  export declare const DOTS = "dots";
2
- export interface PaginationParams {
2
+ export interface UsePaginationOptions {
3
3
  /** Page selected on initial render, defaults to 1 */
4
4
  initialPage?: number;
5
5
  /** Controlled active page number */
@@ -13,12 +13,20 @@ export interface PaginationParams {
13
13
  /** Callback fired after change of each page */
14
14
  onChange?: (page: number) => void;
15
15
  }
16
- export declare function usePagination({ total, siblings, boundaries, page, initialPage, onChange, }: PaginationParams): {
17
- range: (number | "dots")[];
16
+ export interface UsePaginationReturnValue {
17
+ /** Array of page numbers and dots */
18
+ range: (number | 'dots')[];
19
+ /** Active page number */
18
20
  active: number;
19
- setPage: (pageNumber: number) => void;
21
+ /** Function to set active page */
22
+ setPage: (page: number) => void;
23
+ /** Function to go to next page */
20
24
  next: () => void;
25
+ /** Function to go to previous page */
21
26
  previous: () => void;
27
+ /** Function to go to first page */
22
28
  first: () => void;
29
+ /** Function to go to last page */
23
30
  last: () => void;
24
- };
31
+ }
32
+ export declare function usePagination({ total, siblings, boundaries, page, initialPage, onChange, }: UsePaginationOptions): UsePaginationReturnValue;
@@ -1,10 +1,19 @@
1
- export declare function useQueue<T>({ initialValues, limit }: {
1
+ export interface UseQueueOptions<T> {
2
+ /** Initial values to be added to the queue */
2
3
  initialValues?: T[];
4
+ /** Maximum number of items in the state */
3
5
  limit: number;
4
- }): {
5
- state: T[];
6
+ }
7
+ export interface UseQueueReturnValue<T> {
8
+ /** Array of items in the queue */
6
9
  queue: T[];
10
+ /** Array of items in the state */
11
+ state: T[];
12
+ /** Function to add items to state or queue */
7
13
  add: (...items: T[]) => void;
14
+ /** Function to apply updates to current items */
8
15
  update: (fn: (state: T[]) => T[]) => void;
16
+ /** Function to clear the queue */
9
17
  cleanQueue: () => void;
10
- };
18
+ }
19
+ export declare function useQueue<T>({ initialValues, limit, }: UseQueueOptions<T>): UseQueueReturnValue<T>;
@@ -9,7 +9,10 @@ export interface UseRadialMoveOptions {
9
9
  /** Called in `onMouseUp` and `onTouchEnd` events */
10
10
  onScrubEnd?: () => void;
11
11
  }
12
- export declare function useRadialMove<T extends HTMLElement = any>(onChange: (value: number) => void, { step, onChangeEnd, onScrubStart, onScrubEnd }?: UseRadialMoveOptions): {
13
- ref: import("react").RefObject<T | null>;
12
+ export interface UseRadialMoveReturnValue<T extends HTMLElement = any> {
13
+ /** Ref to be passed to the element that should be used for radial move */
14
+ ref: React.RefCallback<T | null>;
15
+ /** Indicates whether the radial move is active */
14
16
  active: boolean;
15
- };
17
+ }
18
+ export declare function useRadialMove<T extends HTMLElement = any>(onChange: (value: number) => void, { step, onChangeEnd, onScrubStart, onScrubEnd }?: UseRadialMoveOptions): UseRadialMoveReturnValue<T>;
@@ -1,2 +1,2 @@
1
1
  import { UseMediaQueryOptions } from '../use-media-query/use-media-query';
2
- export declare function useReducedMotion(initialValue?: boolean, options?: UseMediaQueryOptions): boolean | undefined;
2
+ export declare function useReducedMotion(initialValue?: boolean, options?: UseMediaQueryOptions): boolean;
@@ -1,8 +1,8 @@
1
- interface ScrollIntoViewAnimation {
1
+ interface UseScrollIntoViewAnimation {
2
2
  /** Target element alignment relatively to parent based on current axis */
3
3
  alignment?: 'start' | 'end' | 'center';
4
4
  }
5
- interface ScrollIntoViewParams {
5
+ export interface UseScrollIntoViewOptions {
6
6
  /** Callback fired after scroll */
7
7
  onScrollFinish?: () => void;
8
8
  /** Duration of scroll in milliseconds */
@@ -18,11 +18,11 @@ interface ScrollIntoViewParams {
18
18
  /** Prevents content jumping in scrolling lists with multiple targets */
19
19
  isList?: boolean;
20
20
  }
21
- interface ScrollIntoViewReturnType<Target extends HTMLElement = any, Parent extends HTMLElement | null = null> {
22
- scrollableRef: React.RefObject<Parent>;
23
- targetRef: React.RefObject<Target>;
24
- scrollIntoView: (params?: ScrollIntoViewAnimation) => void;
21
+ export interface UseScrollIntoViewReturnValue<Target extends HTMLElement = any, Parent extends HTMLElement | null = null> {
22
+ scrollableRef: React.RefObject<Parent | null>;
23
+ targetRef: React.RefObject<Target | null>;
24
+ scrollIntoView: (params?: UseScrollIntoViewAnimation) => void;
25
25
  cancel: () => void;
26
26
  }
27
- export declare function useScrollIntoView<Target extends HTMLElement = any, Parent extends HTMLElement | null = null>({ duration, axis, onScrollFinish, easing, offset, cancelable, isList, }?: ScrollIntoViewParams): ScrollIntoViewReturnType<Target, Parent>;
27
+ export declare function useScrollIntoView<Target extends HTMLElement = any, Parent extends HTMLElement | null = null>({ duration, axis, onScrollFinish, easing, offset, cancelable, isList, }?: UseScrollIntoViewOptions): UseScrollIntoViewReturnValue<Target, Parent>;
28
28
  export {};
@@ -1,3 +1,3 @@
1
- import { StorageProperties } from '../use-local-storage/create-storage';
2
- export declare function useSessionStorage<T = string>(props: StorageProperties<T>): [T, (val: T | ((prevState: T) => T)) => void, () => void];
3
- export declare const readSessionStorageValue: <T>({ key, defaultValue, deserialize, }: StorageProperties<T>) => T;
1
+ import { UseStorageOptions } from '../use-local-storage/create-storage';
2
+ export declare function useSessionStorage<T = string>(props: UseStorageOptions<T>): import("../use-local-storage/create-storage").UseStorageReturnValue<T>;
3
+ export declare const readSessionStorageValue: <T>({ key, defaultValue, deserialize, }: UseStorageOptions<T>) => T;
@@ -1 +1,3 @@
1
- export declare function useSetState<T extends Record<string, any>>(initialState: T): readonly [T, (statePartial: Partial<T> | ((currentState: T) => Partial<T>)) => void];
1
+ export type UseSetStateCallback<T> = (state: Partial<T> | ((currentState: T) => Partial<T>)) => void;
2
+ export type UseSetStateReturnValue<T> = [T, UseSetStateCallback<T>];
3
+ export declare function useSetState<T extends Record<string, any>>(initialState: T): UseSetStateReturnValue<T>;
@@ -4,8 +4,13 @@ export interface UseStateHistoryHandlers<T> {
4
4
  forward: (steps?: number) => void;
5
5
  reset: () => void;
6
6
  }
7
- export interface StateHistory<T> {
7
+ export interface UseStateHistoryValue<T> {
8
8
  history: T[];
9
9
  current: number;
10
10
  }
11
- export declare function useStateHistory<T>(initialValue: T): [T, UseStateHistoryHandlers<T>, StateHistory<T>];
11
+ export type UseStateHistoryReturnValue<T> = [
12
+ T,
13
+ UseStateHistoryHandlers<T>,
14
+ UseStateHistoryValue<T>
15
+ ];
16
+ export declare function useStateHistory<T>(initialValue: T): UseStateHistoryReturnValue<T>;
@@ -1,6 +1,8 @@
1
- export declare function useTimeout(callback: (...callbackParams: any[]) => void, delay: number, options?: {
1
+ export interface UseTimeoutOptions {
2
2
  autoInvoke: boolean;
3
- }): {
4
- start: (...callbackParams: any[]) => void;
3
+ }
4
+ export interface UseTimeoutReturnValue {
5
+ start: (...args: any[]) => void;
5
6
  clear: () => void;
6
- };
7
+ }
8
+ export declare function useTimeout(callback: (...args: any[]) => void, delay: number, options?: UseTimeoutOptions): UseTimeoutReturnValue;
@@ -1 +1,4 @@
1
- export declare function useToggle<T = boolean>(options?: readonly T[]): readonly [T, (value?: React.SetStateAction<T>) => void];
1
+ type UseToggleAction<T> = (value?: React.SetStateAction<T>) => void;
2
+ export type UseToggleReturnValue<T> = [T, UseToggleAction<T>];
3
+ export declare function useToggle<T = boolean>(options?: readonly T[]): UseToggleReturnValue<T>;
4
+ export {};
@@ -1,4 +1,4 @@
1
- interface UseUncontrolledInput<T> {
1
+ export interface UseUncontrolledOptions<T> {
2
2
  /** Value for controlled state */
3
3
  value?: T;
4
4
  /** Initial value for uncontrolled state */
@@ -8,5 +8,12 @@ interface UseUncontrolledInput<T> {
8
8
  /** Controlled state onChange handler */
9
9
  onChange?: (value: T, ...payload: any[]) => void;
10
10
  }
11
- export declare function useUncontrolled<T>({ value, defaultValue, finalValue, onChange, }: UseUncontrolledInput<T>): [T, (value: T, ...payload: any[]) => void, boolean];
12
- export {};
11
+ export type UseUncontrolledReturnValue<T> = [
12
+ /** Current value */
13
+ T,
14
+ /** Handler to update the state, passes `value` and `payload` to `onChange` */
15
+ (value: T, ...payload: any[]) => void,
16
+ /** True if the state is controlled, false if uncontrolled */
17
+ boolean
18
+ ];
19
+ export declare function useUncontrolled<T>({ value, defaultValue, finalValue, onChange, }: UseUncontrolledOptions<T>): UseUncontrolledReturnValue<T>;
@@ -1,5 +1,15 @@
1
- export declare function useValidatedState<T>(initialValue: T, validation: (value: T) => boolean, initialValidationState?: boolean): readonly [{
2
- readonly value: T;
3
- readonly lastValidValue: T | undefined;
4
- readonly valid: boolean;
5
- }, (val: T) => void];
1
+ export interface UseValidatedStateValue<T> {
2
+ /** Current value */
3
+ value: T;
4
+ /** Last valid value */
5
+ lastValidValue: T | undefined;
6
+ /** True if the current value is valid, false otherwise */
7
+ valid: boolean;
8
+ }
9
+ export type UseValidatedStateReturnValue<T> = [
10
+ /** Current value */
11
+ UseValidatedStateValue<T>,
12
+ /** Handler to update the state, passes `value` and `payload` to `onChange` */
13
+ (value: T) => void
14
+ ];
15
+ export declare function useValidatedState<T>(initialValue: T, validate: (value: T) => boolean, initialValidationState?: boolean): UseValidatedStateReturnValue<T>;
@@ -1,7 +1,7 @@
1
- interface ScrollPosition {
1
+ export interface UseWindowScrollPosition {
2
2
  x: number;
3
3
  y: number;
4
4
  }
5
- declare function scrollTo({ x, y }: Partial<ScrollPosition>): void;
6
- export declare function useWindowScroll(): readonly [ScrollPosition, typeof scrollTo];
7
- export {};
5
+ export type UseWindowScrollTo = (position: Partial<UseWindowScrollPosition>) => void;
6
+ export type UseWindowScrollReturnValue = [UseWindowScrollPosition, UseWindowScrollTo];
7
+ export declare function useWindowScroll(): UseWindowScrollReturnValue;
@@ -4,3 +4,4 @@ export { randomId } from './random-id/random-id';
4
4
  export { range } from './range/range';
5
5
  export { shallowEqual } from './shallow-equal/shallow-equal';
6
6
  export { upperFirst } from './upper-first/upper-first';
7
+ export { useCallbackRef } from './use-callback-ref/use-callback-ref';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mantine/hooks",
3
- "version": "8.0.2",
3
+ "version": "8.1.0",
4
4
  "description": "A collection of 50+ hooks for state and UI management",
5
5
  "homepage": "https://mantine.dev",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-callback-ref.cjs","sources":["../../src/use-callback-ref/use-callback-ref.ts"],"sourcesContent":["import { useEffect, useMemo, useRef } from 'react';\n\nexport function useCallbackRef<T extends (...args: any[]) => any>(callback: T | undefined): T {\n const callbackRef = useRef(callback);\n\n useEffect(() => {\n callbackRef.current = callback;\n });\n\n return useMemo(() => ((...args) => callbackRef.current?.(...args)) as T, []);\n}\n"],"names":["useRef","useEffect","useMemo"],"mappings":";;;;;AAEO,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAkD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA4B,CAAA,CAAA,CAAA;AAC5F,CAAA,CAAM,MAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAcA,aAAO,QAAQ,CAAA,CAAA;AAEnC,CAAAC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA,CAAU,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACd,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA,CACvB,CAAA,CAAA;AAED,CAAA,CAAO,OAAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAI,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,QAAU,CAAA,CAAA,CAAA,CAAA,CAAG,IAAI,CAAS,CAAA,CAAA,EAAE,CAAA,CAAA;AAC7E,CAAA;;"}
@@ -1,7 +0,0 @@
1
- 'use client';
2
- 'use strict';
3
-
4
- const easeInOutQuad = (t) => t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
5
-
6
- exports.easeInOutQuad = easeInOutQuad;
7
- //# sourceMappingURL=ease-in-out-quad.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ease-in-out-quad.cjs","sources":["../../../src/use-scroll-into-view/utils/ease-in-out-quad.ts"],"sourcesContent":["export const easeInOutQuad = (t: number) => (t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t);\n"],"names":[],"mappings":";;;AAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,CAAA,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,GAAI,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAI,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;"}