@siberiacancode/reactuse 0.2.25 → 0.2.26

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 (270) hide show
  1. package/dist/cjs/helpers/createStore/createStore.cjs +1 -1
  2. package/dist/cjs/helpers/createStore/createStore.cjs.map +1 -1
  3. package/dist/cjs/hooks/useActiveElement/useActiveElement.cjs +1 -1
  4. package/dist/cjs/hooks/useActiveElement/useActiveElement.cjs.map +1 -1
  5. package/dist/cjs/hooks/useAsync/useAsync.cjs.map +1 -1
  6. package/dist/cjs/hooks/useAutoScroll/useAutoScroll.cjs.map +1 -1
  7. package/dist/cjs/hooks/useBoolean/useBoolean.cjs.map +1 -1
  8. package/dist/cjs/hooks/useBrowserLanguage/useBrowserLanguage.cjs.map +1 -1
  9. package/dist/cjs/hooks/useClickOutside/useClickOutside.cjs.map +1 -1
  10. package/dist/cjs/hooks/useCookie/useCookie.cjs.map +1 -1
  11. package/dist/cjs/hooks/useCookies/useCookies.cjs.map +1 -1
  12. package/dist/cjs/hooks/useCounter/useCounter.cjs.map +1 -1
  13. package/dist/cjs/hooks/useCssVar/useCssVar.cjs +1 -1
  14. package/dist/cjs/hooks/useCssVar/useCssVar.cjs.map +1 -1
  15. package/dist/cjs/hooks/useDefault/useDefault.cjs.map +1 -1
  16. package/dist/cjs/hooks/useDisclosure/useDisclosure.cjs.map +1 -1
  17. package/dist/cjs/hooks/useDisplayMedia/useDisplayMedia.cjs.map +1 -1
  18. package/dist/cjs/hooks/useDocumentTitle/useDocumentTitle.cjs.map +1 -1
  19. package/dist/cjs/hooks/useDoubleClick/useDoubleClick.cjs.map +1 -1
  20. package/dist/cjs/hooks/useElementSize/useElementSize.cjs.map +1 -1
  21. package/dist/cjs/hooks/useEvent/useEvent.cjs.map +1 -1
  22. package/dist/cjs/hooks/useEventSource/useEventSource.cjs.map +1 -1
  23. package/dist/cjs/hooks/useField/useField.cjs.map +1 -1
  24. package/dist/cjs/hooks/useFileDialog/useFileDialog.cjs.map +1 -1
  25. package/dist/cjs/hooks/useFocus/useFocus.cjs.map +1 -1
  26. package/dist/cjs/hooks/useFps/useFps.cjs.map +1 -1
  27. package/dist/cjs/hooks/useHash/useHash.cjs.map +1 -1
  28. package/dist/cjs/hooks/useHover/useHover.cjs.map +1 -1
  29. package/dist/cjs/hooks/useImage/useImage.cjs.map +1 -1
  30. package/dist/cjs/hooks/useInfiniteScroll/useInfiniteScroll.cjs +1 -1
  31. package/dist/cjs/hooks/useInfiniteScroll/useInfiniteScroll.cjs.map +1 -1
  32. package/dist/cjs/hooks/useIntersectionObserver/useIntersectionObserver.cjs +1 -1
  33. package/dist/cjs/hooks/useIntersectionObserver/useIntersectionObserver.cjs.map +1 -1
  34. package/dist/cjs/hooks/useLastChanged/useLastChanged.cjs.map +1 -1
  35. package/dist/cjs/hooks/useList/useList.cjs.map +1 -1
  36. package/dist/cjs/hooks/useLocalStorage/useLocalStorage.cjs.map +1 -1
  37. package/dist/cjs/hooks/useLockCallback/useLockCallback.cjs.map +1 -1
  38. package/dist/cjs/hooks/useLockScroll/useLockScroll.cjs +2 -0
  39. package/dist/cjs/hooks/useLockScroll/useLockScroll.cjs.map +1 -0
  40. package/dist/cjs/hooks/useLogger/useLogger.cjs.map +1 -1
  41. package/dist/cjs/hooks/useLongPress/useLongPress.cjs.map +1 -1
  42. package/dist/cjs/hooks/useMap/useMap.cjs.map +1 -1
  43. package/dist/cjs/hooks/useMutation/useMutation.cjs.map +1 -1
  44. package/dist/cjs/hooks/useMutationObserver/useMutationObserver.cjs.map +1 -1
  45. package/dist/cjs/hooks/useNetwork/useNetwork.cjs.map +1 -1
  46. package/dist/cjs/hooks/useOffsetPagination/useOffsetPagination.cjs.map +1 -1
  47. package/dist/cjs/hooks/useOnline/useOnline.cjs.map +1 -1
  48. package/dist/cjs/hooks/useOperatingSystem/useOperatingSystem.cjs.map +1 -1
  49. package/dist/cjs/hooks/useOptimistic/useOptimistic.cjs.map +1 -1
  50. package/dist/cjs/hooks/useOrientation/useOrientation.cjs +1 -1
  51. package/dist/cjs/hooks/useOrientation/useOrientation.cjs.map +1 -1
  52. package/dist/cjs/hooks/usePaint/usePaint.cjs.map +1 -1
  53. package/dist/cjs/hooks/useParallax/useParallax.cjs +1 -1
  54. package/dist/cjs/hooks/useParallax/useParallax.cjs.map +1 -1
  55. package/dist/cjs/hooks/usePointerLock/usePointerLock.cjs.map +1 -1
  56. package/dist/cjs/hooks/usePreferredColorScheme/usePreferredColorScheme.cjs.map +1 -1
  57. package/dist/cjs/hooks/usePreferredContrast/usePreferredContrast.cjs.map +1 -1
  58. package/dist/cjs/hooks/usePreferredDark/usePreferredDark.cjs.map +1 -1
  59. package/dist/cjs/hooks/usePreferredLanguages/usePreferredLanguages.cjs.map +1 -1
  60. package/dist/cjs/hooks/usePreferredReducedMotion/usePreferredReducedMotion.cjs.map +1 -1
  61. package/dist/cjs/hooks/useQuery/useQuery.cjs.map +1 -1
  62. package/dist/cjs/hooks/useQueue/useQueue.cjs.map +1 -1
  63. package/dist/cjs/hooks/useRaf/useRaf.cjs.map +1 -1
  64. package/dist/cjs/hooks/{useRafValue/useRafValue.cjs → useRafState/useRafState.cjs} +2 -2
  65. package/dist/cjs/hooks/useRafState/useRafState.cjs.map +1 -0
  66. package/dist/cjs/hooks/useRefState/useRefState.cjs.map +1 -1
  67. package/dist/cjs/hooks/useRenderCount/useRenderCount.cjs.map +1 -1
  68. package/dist/cjs/hooks/useRenderInfo/useRenderInfo.cjs.map +1 -1
  69. package/dist/cjs/hooks/useRerender/useRerender.cjs.map +1 -1
  70. package/dist/cjs/hooks/useResizeObserver/useResizeObserver.cjs.map +1 -1
  71. package/dist/cjs/hooks/useScript/useScript.cjs.map +1 -1
  72. package/dist/cjs/hooks/useScroll/useScroll.cjs.map +1 -1
  73. package/dist/cjs/hooks/useSessionStorage/useSessionStorage.cjs.map +1 -1
  74. package/dist/cjs/hooks/useSet/useSet.cjs.map +1 -1
  75. package/dist/cjs/hooks/useSpeechRecognition/useSpeechRecognition.cjs.map +1 -1
  76. package/dist/cjs/hooks/useSpeechSynthesis/useSpeechSynthesis.cjs.map +1 -1
  77. package/dist/cjs/hooks/useStateHistory/useStateHistory.cjs.map +1 -1
  78. package/dist/cjs/hooks/useStep/useStep.cjs.map +1 -1
  79. package/dist/cjs/hooks/useSticky/useSticky.cjs.map +1 -1
  80. package/dist/cjs/hooks/useStorage/useStorage.cjs.map +1 -1
  81. package/dist/cjs/hooks/useTextDirection/useTextDirection.cjs +1 -1
  82. package/dist/cjs/hooks/useTextDirection/useTextDirection.cjs.map +1 -1
  83. package/dist/cjs/hooks/useToggle/useToggle.cjs.map +1 -1
  84. package/dist/cjs/hooks/useUrlSearchParam/useUrlSearchParam.cjs.map +1 -1
  85. package/dist/cjs/hooks/useUrlSearchParams/useUrlSearchParams.cjs.map +1 -1
  86. package/dist/cjs/hooks/useWizard/useWizard.cjs.map +1 -1
  87. package/dist/cjs/index.cjs +1 -1
  88. package/dist/esm/helpers/createStore/createStore.mjs +16 -16
  89. package/dist/esm/helpers/createStore/createStore.mjs.map +1 -1
  90. package/dist/esm/hooks/useActiveElement/useActiveElement.mjs +9 -10
  91. package/dist/esm/hooks/useActiveElement/useActiveElement.mjs.map +1 -1
  92. package/dist/esm/hooks/useAsync/useAsync.mjs.map +1 -1
  93. package/dist/esm/hooks/useAutoScroll/useAutoScroll.mjs.map +1 -1
  94. package/dist/esm/hooks/useBoolean/useBoolean.mjs.map +1 -1
  95. package/dist/esm/hooks/useBrowserLanguage/useBrowserLanguage.mjs.map +1 -1
  96. package/dist/esm/hooks/useClickOutside/useClickOutside.mjs.map +1 -1
  97. package/dist/esm/hooks/useCookie/useCookie.mjs.map +1 -1
  98. package/dist/esm/hooks/useCookies/useCookies.mjs.map +1 -1
  99. package/dist/esm/hooks/useCounter/useCounter.mjs.map +1 -1
  100. package/dist/esm/hooks/useCssVar/useCssVar.mjs +27 -24
  101. package/dist/esm/hooks/useCssVar/useCssVar.mjs.map +1 -1
  102. package/dist/esm/hooks/useDefault/useDefault.mjs.map +1 -1
  103. package/dist/esm/hooks/useDisclosure/useDisclosure.mjs.map +1 -1
  104. package/dist/esm/hooks/useDisplayMedia/useDisplayMedia.mjs.map +1 -1
  105. package/dist/esm/hooks/useDocumentTitle/useDocumentTitle.mjs +3 -1
  106. package/dist/esm/hooks/useDocumentTitle/useDocumentTitle.mjs.map +1 -1
  107. package/dist/esm/hooks/useDoubleClick/useDoubleClick.mjs.map +1 -1
  108. package/dist/esm/hooks/useElementSize/useElementSize.mjs.map +1 -1
  109. package/dist/esm/hooks/useEvent/useEvent.mjs.map +1 -1
  110. package/dist/esm/hooks/useEventSource/useEventSource.mjs +3 -1
  111. package/dist/esm/hooks/useEventSource/useEventSource.mjs.map +1 -1
  112. package/dist/esm/hooks/useField/useField.mjs.map +1 -1
  113. package/dist/esm/hooks/useFileDialog/useFileDialog.mjs.map +1 -1
  114. package/dist/esm/hooks/useFocus/useFocus.mjs.map +1 -1
  115. package/dist/esm/hooks/useFps/useFps.mjs.map +1 -1
  116. package/dist/esm/hooks/useHash/useHash.mjs.map +1 -1
  117. package/dist/esm/hooks/useHover/useHover.mjs.map +1 -1
  118. package/dist/esm/hooks/useImage/useImage.mjs.map +1 -1
  119. package/dist/esm/hooks/useInfiniteScroll/useInfiniteScroll.mjs +27 -27
  120. package/dist/esm/hooks/useInfiniteScroll/useInfiniteScroll.mjs.map +1 -1
  121. package/dist/esm/hooks/useIntersectionObserver/useIntersectionObserver.mjs +5 -5
  122. package/dist/esm/hooks/useIntersectionObserver/useIntersectionObserver.mjs.map +1 -1
  123. package/dist/esm/hooks/useLastChanged/useLastChanged.mjs.map +1 -1
  124. package/dist/esm/hooks/useList/useList.mjs +15 -6
  125. package/dist/esm/hooks/useList/useList.mjs.map +1 -1
  126. package/dist/esm/hooks/useLocalStorage/useLocalStorage.mjs.map +1 -1
  127. package/dist/esm/hooks/useLockCallback/useLockCallback.mjs.map +1 -1
  128. package/dist/esm/hooks/useLockScroll/useLockScroll.mjs +44 -0
  129. package/dist/esm/hooks/useLockScroll/useLockScroll.mjs.map +1 -0
  130. package/dist/esm/hooks/useLogger/useLogger.mjs.map +1 -1
  131. package/dist/esm/hooks/useLongPress/useLongPress.mjs.map +1 -1
  132. package/dist/esm/hooks/useMap/useMap.mjs.map +1 -1
  133. package/dist/esm/hooks/useMutation/useMutation.mjs.map +1 -1
  134. package/dist/esm/hooks/useMutationObserver/useMutationObserver.mjs.map +1 -1
  135. package/dist/esm/hooks/useNetwork/useNetwork.mjs.map +1 -1
  136. package/dist/esm/hooks/useOffsetPagination/useOffsetPagination.mjs.map +1 -1
  137. package/dist/esm/hooks/useOnline/useOnline.mjs.map +1 -1
  138. package/dist/esm/hooks/useOperatingSystem/useOperatingSystem.mjs.map +1 -1
  139. package/dist/esm/hooks/useOptimistic/useOptimistic.mjs.map +1 -1
  140. package/dist/esm/hooks/useOrientation/useOrientation.mjs +25 -9
  141. package/dist/esm/hooks/useOrientation/useOrientation.mjs.map +1 -1
  142. package/dist/esm/hooks/usePaint/usePaint.mjs +14 -2
  143. package/dist/esm/hooks/usePaint/usePaint.mjs.map +1 -1
  144. package/dist/esm/hooks/useParallax/useParallax.mjs +9 -9
  145. package/dist/esm/hooks/useParallax/useParallax.mjs.map +1 -1
  146. package/dist/esm/hooks/usePointerLock/usePointerLock.mjs.map +1 -1
  147. package/dist/esm/hooks/usePreferredColorScheme/usePreferredColorScheme.mjs.map +1 -1
  148. package/dist/esm/hooks/usePreferredContrast/usePreferredContrast.mjs.map +1 -1
  149. package/dist/esm/hooks/usePreferredDark/usePreferredDark.mjs.map +1 -1
  150. package/dist/esm/hooks/usePreferredLanguages/usePreferredLanguages.mjs.map +1 -1
  151. package/dist/esm/hooks/usePreferredReducedMotion/usePreferredReducedMotion.mjs.map +1 -1
  152. package/dist/esm/hooks/useQuery/useQuery.mjs.map +1 -1
  153. package/dist/esm/hooks/useQueue/useQueue.mjs.map +1 -1
  154. package/dist/esm/hooks/useRaf/useRaf.mjs.map +1 -1
  155. package/dist/esm/hooks/{useRafValue/useRafValue.mjs → useRafState/useRafState.mjs} +2 -2
  156. package/dist/esm/hooks/useRafState/useRafState.mjs.map +1 -0
  157. package/dist/esm/hooks/useRefState/useRefState.mjs.map +1 -1
  158. package/dist/esm/hooks/useRenderCount/useRenderCount.mjs.map +1 -1
  159. package/dist/esm/hooks/useRenderInfo/useRenderInfo.mjs.map +1 -1
  160. package/dist/esm/hooks/useRerender/useRerender.mjs.map +1 -1
  161. package/dist/esm/hooks/useResizeObserver/useResizeObserver.mjs.map +1 -1
  162. package/dist/esm/hooks/useScript/useScript.mjs.map +1 -1
  163. package/dist/esm/hooks/useScroll/useScroll.mjs.map +1 -1
  164. package/dist/esm/hooks/useSessionStorage/useSessionStorage.mjs.map +1 -1
  165. package/dist/esm/hooks/useSet/useSet.mjs.map +1 -1
  166. package/dist/esm/hooks/useSpeechRecognition/useSpeechRecognition.mjs +14 -4
  167. package/dist/esm/hooks/useSpeechRecognition/useSpeechRecognition.mjs.map +1 -1
  168. package/dist/esm/hooks/useSpeechSynthesis/useSpeechSynthesis.mjs.map +1 -1
  169. package/dist/esm/hooks/useStateHistory/useStateHistory.mjs.map +1 -1
  170. package/dist/esm/hooks/useStep/useStep.mjs.map +1 -1
  171. package/dist/esm/hooks/useSticky/useSticky.mjs.map +1 -1
  172. package/dist/esm/hooks/useStorage/useStorage.mjs.map +1 -1
  173. package/dist/esm/hooks/useTextDirection/useTextDirection.mjs +19 -20
  174. package/dist/esm/hooks/useTextDirection/useTextDirection.mjs.map +1 -1
  175. package/dist/esm/hooks/useToggle/useToggle.mjs.map +1 -1
  176. package/dist/esm/hooks/useUrlSearchParam/useUrlSearchParam.mjs.map +1 -1
  177. package/dist/esm/hooks/useUrlSearchParams/useUrlSearchParams.mjs.map +1 -1
  178. package/dist/esm/hooks/useWizard/useWizard.mjs.map +1 -1
  179. package/dist/esm/index.mjs +323 -323
  180. package/dist/types/helpers/createStore/createStore.d.ts +1 -1
  181. package/dist/types/hooks/async.d.ts +5 -0
  182. package/dist/types/hooks/browser.d.ts +32 -0
  183. package/dist/types/hooks/debug.d.ts +4 -0
  184. package/dist/types/hooks/elements.d.ts +14 -0
  185. package/dist/types/hooks/fun.d.ts +3 -0
  186. package/dist/types/hooks/index.d.ts +11 -143
  187. package/dist/types/hooks/lifecycle.d.ts +6 -0
  188. package/dist/types/hooks/sensors.d.ts +34 -0
  189. package/dist/types/hooks/state.d.ts +25 -0
  190. package/dist/types/hooks/time.d.ts +5 -0
  191. package/dist/types/hooks/useAsync/useAsync.d.ts +1 -1
  192. package/dist/types/hooks/useAutoScroll/useAutoScroll.d.ts +1 -1
  193. package/dist/types/hooks/useBoolean/useBoolean.d.ts +1 -1
  194. package/dist/types/hooks/useBrowserLanguage/useBrowserLanguage.d.ts +1 -1
  195. package/dist/types/hooks/useClickOutside/useClickOutside.d.ts +1 -1
  196. package/dist/types/hooks/useCookie/useCookie.d.ts +1 -1
  197. package/dist/types/hooks/useCookies/useCookies.d.ts +1 -1
  198. package/dist/types/hooks/useCounter/useCounter.d.ts +1 -1
  199. package/dist/types/hooks/useCssVar/useCssVar.d.ts +1 -1
  200. package/dist/types/hooks/useDefault/useDefault.d.ts +1 -1
  201. package/dist/types/hooks/useDisclosure/useDisclosure.d.ts +1 -1
  202. package/dist/types/hooks/useDocumentTitle/useDocumentTitle.d.ts +2 -0
  203. package/dist/types/hooks/useDoubleClick/useDoubleClick.d.ts +1 -1
  204. package/dist/types/hooks/useEvent/useEvent.d.ts +1 -1
  205. package/dist/types/hooks/useField/useField.d.ts +1 -1
  206. package/dist/types/hooks/useFileDialog/useFileDialog.d.ts +1 -1
  207. package/dist/types/hooks/useFocus/useFocus.d.ts +1 -1
  208. package/dist/types/hooks/useFps/useFps.d.ts +1 -1
  209. package/dist/types/hooks/useHash/useHash.d.ts +1 -1
  210. package/dist/types/hooks/useHover/useHover.d.ts +1 -1
  211. package/dist/types/hooks/useImage/useImage.d.ts +1 -1
  212. package/dist/types/hooks/useIntersectionObserver/useIntersectionObserver.d.ts +7 -6
  213. package/dist/types/hooks/useLastChanged/useLastChanged.d.ts +1 -1
  214. package/dist/types/hooks/useList/useList.d.ts +1 -1
  215. package/dist/types/hooks/useLocalStorage/useLocalStorage.d.ts +1 -1
  216. package/dist/types/hooks/useLockCallback/useLockCallback.d.ts +1 -1
  217. package/dist/types/hooks/useLockScroll/useLockScroll.d.ts +49 -0
  218. package/dist/types/hooks/useLogger/useLogger.d.ts +1 -1
  219. package/dist/types/hooks/useLongPress/useLongPress.d.ts +1 -1
  220. package/dist/types/hooks/useMap/useMap.d.ts +1 -1
  221. package/dist/types/hooks/useMutation/useMutation.d.ts +1 -1
  222. package/dist/types/hooks/useMutationObserver/useMutationObserver.d.ts +1 -1
  223. package/dist/types/hooks/useNetwork/useNetwork.d.ts +1 -1
  224. package/dist/types/hooks/useOffsetPagination/useOffsetPagination.d.ts +1 -1
  225. package/dist/types/hooks/useOnline/useOnline.d.ts +1 -1
  226. package/dist/types/hooks/useOperatingSystem/useOperatingSystem.d.ts +1 -1
  227. package/dist/types/hooks/useOptimistic/useOptimistic.d.ts +1 -1
  228. package/dist/types/hooks/useOrientation/useOrientation.d.ts +26 -11
  229. package/dist/types/hooks/usePaint/usePaint.d.ts +1 -1
  230. package/dist/types/hooks/usePointerLock/usePointerLock.d.ts +1 -1
  231. package/dist/types/hooks/usePreferredColorScheme/usePreferredColorScheme.d.ts +1 -1
  232. package/dist/types/hooks/usePreferredContrast/usePreferredContrast.d.ts +1 -1
  233. package/dist/types/hooks/usePreferredDark/usePreferredDark.d.ts +1 -1
  234. package/dist/types/hooks/usePreferredLanguages/usePreferredLanguages.d.ts +1 -1
  235. package/dist/types/hooks/usePreferredReducedMotion/usePreferredReducedMotion.d.ts +1 -1
  236. package/dist/types/hooks/useQuery/useQuery.d.ts +1 -1
  237. package/dist/types/hooks/useQueue/useQueue.d.ts +1 -1
  238. package/dist/types/hooks/useRaf/useRaf.d.ts +1 -1
  239. package/dist/types/hooks/{useRafValue/useRafValue.d.ts → useRafState/useRafState.d.ts} +6 -6
  240. package/dist/types/hooks/useRefState/useRefState.d.ts +1 -1
  241. package/dist/types/hooks/useRenderCount/useRenderCount.d.ts +1 -1
  242. package/dist/types/hooks/useRenderInfo/useRenderInfo.d.ts +6 -1
  243. package/dist/types/hooks/useRerender/useRerender.d.ts +1 -1
  244. package/dist/types/hooks/useResizeObserver/useResizeObserver.d.ts +1 -1
  245. package/dist/types/hooks/useRightClick/useRightClick.d.ts +37 -0
  246. package/dist/types/hooks/useScript/useScript.d.ts +1 -1
  247. package/dist/types/hooks/useSessionStorage/useSessionStorage.d.ts +1 -1
  248. package/dist/types/hooks/useSet/useSet.d.ts +1 -1
  249. package/dist/types/hooks/useSpeechRecognition/useSpeechRecognition.d.ts +1 -1
  250. package/dist/types/hooks/useSpeechSynthesis/useSpeechSynthesis.d.ts +1 -1
  251. package/dist/types/hooks/useStateHistory/useStateHistory.d.ts +1 -1
  252. package/dist/types/hooks/useStep/useStep.d.ts +1 -1
  253. package/dist/types/hooks/useSticky/useSticky.d.ts +1 -1
  254. package/dist/types/hooks/useStorage/useStorage.d.ts +1 -1
  255. package/dist/types/hooks/useTextDirection/useTextDirection.d.ts +2 -2
  256. package/dist/types/hooks/useToggle/useToggle.d.ts +1 -1
  257. package/dist/types/hooks/useUrlSearchParam/useUrlSearchParam.d.ts +1 -1
  258. package/dist/types/hooks/useUrlSearchParams/useUrlSearchParams.d.ts +1 -1
  259. package/dist/types/hooks/useWizard/useWizard.d.ts +1 -1
  260. package/dist/types/hooks/user.d.ts +7 -0
  261. package/dist/types/hooks/utilities.d.ts +9 -0
  262. package/dist/types/utils/helpers/getElement.d.ts +1 -1
  263. package/package.json +89 -89
  264. package/dist/cjs/hooks/useRafValue/useRafValue.cjs.map +0 -1
  265. package/dist/cjs/hooks/useScreenOrientation/useScreenOrientation.cjs +0 -2
  266. package/dist/cjs/hooks/useScreenOrientation/useScreenOrientation.cjs.map +0 -1
  267. package/dist/esm/hooks/useRafValue/useRafValue.mjs.map +0 -1
  268. package/dist/esm/hooks/useScreenOrientation/useScreenOrientation.mjs +0 -31
  269. package/dist/esm/hooks/useScreenOrientation/useScreenOrientation.mjs.map +0 -1
  270. package/dist/types/hooks/useScreenOrientation/useScreenOrientation.d.ts +0 -35
@@ -0,0 +1,49 @@
1
+ import { HookTarget } from '../../utils/helpers';
2
+ import { StateRef } from '../useRefState/useRefState';
3
+ /** The use lock scroll options type */
4
+ export interface UseLockScrollOptions {
5
+ /** Enable or disable scroll locking. Default: true */
6
+ enabled?: boolean;
7
+ }
8
+ /** The use lock scroll return type */
9
+ export interface UseLockScrollReturn<Target extends Element> {
10
+ /** The ref to attach to the element */
11
+ ref: StateRef<Target>;
12
+ /** The value of the lock state */
13
+ value: boolean;
14
+ /** Lock the scroll */
15
+ lock: () => void;
16
+ /** Toggle the scroll lock */
17
+ toggle: () => void;
18
+ /** Unlock the scroll */
19
+ unlock: () => void;
20
+ }
21
+ export interface UseLockScroll {
22
+ (target: HookTarget, options?: UseLockScrollOptions): UseLockScrollReturn<Element>;
23
+ <Target extends Element>(options?: UseLockScrollOptions, target?: never): UseLockScrollReturn<Target> & {
24
+ ref: StateRef<Target>;
25
+ };
26
+ }
27
+ /**
28
+ * @name useLockScroll
29
+ * @description - Hook that locks scroll on an element or document body
30
+ * @category Elements
31
+ *
32
+ *
33
+ * @overload
34
+ * @param {HookTarget} [target=document.body] The target element to lock scroll on
35
+ * @param {UseLockScrollOptions} [options] The options for scroll locking
36
+ * @returns {void}
37
+ *
38
+ * @example
39
+ * const { lock, unlock, value, toggle } = useLockScroll(ref);
40
+ *
41
+ * @overload
42
+ * @template Target The target element
43
+ * @param {UseLockScrollOptions} [options] The options for scroll locking
44
+ * @returns {StateRef<Target>} Ref to attach to element, or locks body scroll by default
45
+ *
46
+ * @example
47
+ * const { ref, lock, unlock, value, toggle } = useLockScroll();
48
+ */
49
+ export declare const useLockScroll: UseLockScroll;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @name useLogger
3
3
  * @description - Hook for debugging lifecycle
4
- * @category Lifecycle
4
+ * @category Debug
5
5
  *
6
6
  * @param {string} name The name or identifier for the logger
7
7
  * @param {unknown[]} params Additional arguments to be logged
@@ -17,7 +17,7 @@ export interface UseLongPress {
17
17
  /**
18
18
  * @name useLongPress
19
19
  * @description - Hook that defines the logic when long pressing an element
20
- * @category Sensors
20
+ * @category Elements
21
21
  *
22
22
  * @overload
23
23
  * @param {HookTarget} target The target element to be long pressed
@@ -18,7 +18,7 @@ export interface UseMapReturn<Key, Value> {
18
18
  /**
19
19
  * @name useMap
20
20
  * @description - Hook that manages a map structure
21
- * @category Utilities
21
+ * @category State
22
22
  *
23
23
  * @template Value The type of the value
24
24
  * @param {Value[]} [values] The initial array of the map
@@ -19,7 +19,7 @@ export interface RequestOptions<Data> extends UseMutationOptions<Data> {
19
19
  /**
20
20
  * @name useMutation
21
21
  * @description - Hook that defines the logic when mutate data
22
- * @category Utilities
22
+ * @category Async
23
23
  *
24
24
  * @template Body The type of the body
25
25
  * @template Data The type of the data
@@ -23,7 +23,7 @@ export interface UseMutationObserver {
23
23
  /**
24
24
  * @name useMutationObserver
25
25
  * @description - Hook that gives you mutation observer state
26
- * @category Browser
26
+ * @category Sensors
27
27
  *
28
28
  * @overload
29
29
  * @template Target The target element
@@ -39,7 +39,7 @@ export declare const getConnection: () => Connection;
39
39
  /**
40
40
  * @name useNetwork
41
41
  * @description - Hook to track network status
42
- * @category Sensors
42
+ * @category Browser
43
43
  *
44
44
  * @browserapi navigator.connection https://developer.mozilla.org/en-US/docs/Web/API/Navigator/connection
45
45
  *
@@ -44,7 +44,7 @@ export interface UseOffsetPaginationReturn {
44
44
  /**
45
45
  * @name useOffsetPagination
46
46
  * @description - Hook that defines the logic when pagination
47
- * @category Utilities
47
+ * @category State
48
48
  *
49
49
  * @param {UseOffsetPaginationOptions} options - The options for the hook
50
50
  * @param {number} [options.total] - The total number of items
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @name useOnline
3
3
  * @description - Hook that manages if the user is online
4
- * @category Sensors
4
+ * @category Browser
5
5
  *
6
6
  * @browserapi navigator.onLine https://developer.mozilla.org/en-US/docs/Web/API/Navigator/onLine
7
7
  *
@@ -4,7 +4,7 @@ export declare const getOperatingSystem: () => OperatingSystem;
4
4
  /**
5
5
  * @name useOperatingSystem
6
6
  * @description - Hook that returns the operating system of the current browser
7
- * @category Browser
7
+ * @category User
8
8
  *
9
9
  * @returns {OperatingSystem} The operating system
10
10
  *
@@ -5,7 +5,7 @@ export type UseOptimisticReturn<State> = [
5
5
  /**
6
6
  * @name useOptimistic
7
7
  * @description - Hook that allows get optimistic value before its update
8
- * @category Utilities
8
+ * @category Async
9
9
  *
10
10
  * @template State The type of the state
11
11
  * @param {State} state The value to be returned initially and whenever no action is pending
@@ -1,20 +1,35 @@
1
- /** The use orientation return type */
2
- export interface UseOrientationReturn {
3
- /** The current screen orientation angle */
1
+ declare global {
2
+ interface ScreenOrientation {
3
+ lock: (orientation: OrientationLockType) => Promise<void>;
4
+ }
5
+ }
6
+ export interface UseOrientationValue {
7
+ /** The current angle */
4
8
  angle: number;
5
- /** The screen orientation type */
6
- type: OrientationType;
9
+ /** The current orientation type */
10
+ orientationType: OrientationType;
11
+ }
12
+ export type OrientationLockType = 'any' | 'landscape-primary' | 'landscape-secondary' | 'landscape' | 'natural' | 'portrait-primary' | 'portrait-secondary' | 'portrait';
13
+ export interface useOrientationReturn {
14
+ /** Whether the screen orientation is supported */
15
+ supported: boolean;
16
+ /** The current screen orientation value */
17
+ value: UseOrientationValue;
18
+ /** Lock the screen orientation */
19
+ lock: (orientation: OrientationLockType) => void;
20
+ /** Unlock the screen orientation */
21
+ unlock: () => void;
7
22
  }
8
23
  /**
9
24
  * @name useOrientation
10
- * @description - Hook that returns the current screen orientation
11
- * @category Browser
25
+ * @description - Hook that provides the current screen orientation
26
+ * @category Sensors
12
27
  *
13
- * @browserapi window.screen.orientation https://developer.mozilla.org/en-US/docs/Web/API/Screen/orientation
28
+ * @browserapi screen.orientation https://developer.mozilla.org/en-US/docs/Web/API/Screen/orientation
14
29
  *
15
- * @returns {UseOrientationReturn} An object containing the current screen orientation
30
+ * @returns {useOrientationReturn} The current screen orientation
16
31
  *
17
32
  * @example
18
- * const { angle, type } = useOrientation();
33
+ * const { supported, value, lock, unlock } = useOrientation();
19
34
  */
20
- export declare const useOrientation: () => UseOrientationReturn;
35
+ export declare const useOrientation: () => useOrientationReturn;
@@ -77,7 +77,7 @@ export interface UsePaint {
77
77
  /**
78
78
  * @name usePaint
79
79
  * @description - Hook that allows you to draw in a specific area
80
- * @category Browser
80
+ * @category Elements
81
81
  *
82
82
  * @overload
83
83
  * @param {HookTarget} target The target element to be painted
@@ -13,7 +13,7 @@ interface UsePointerLockReturn {
13
13
  /**
14
14
  * @name usePointerLock
15
15
  * @description - Hook that provides reactive pointer lock
16
- * @category Sensors
16
+ * @category Browser
17
17
  *
18
18
  * @browserapi pointerLockElement https://developer.mozilla.org/en-US/docs/Web/API/Document/pointerLockElement
19
19
  *
@@ -3,7 +3,7 @@ export type UsePreferredColorSchemeReturn = 'dark' | 'light' | 'no-preference';
3
3
  /**
4
4
  * @name usePreferredColorScheme
5
5
  * @description - Hook that returns user preferred color scheme
6
- * @category Browser
6
+ * @category User
7
7
  *
8
8
  * @returns {UsePreferredColorSchemeReturn} String of preferred color scheme
9
9
  *
@@ -3,7 +3,7 @@ export type UsePreferredContrastReturn = 'custom' | 'less' | 'more' | 'no-prefer
3
3
  /**
4
4
  * @name usePreferredContrast
5
5
  * @description - Hook that returns the contrast preference
6
- * @category Browser
6
+ * @category User
7
7
  *
8
8
  * @returns {UsePreferredContrastReturn} The contrast preference
9
9
  *
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @name usePreferredDark
3
3
  * @description - Hook that returns if the user prefers dark mode
4
- * @category Browser
4
+ * @category User
5
5
  *
6
6
  * @example
7
7
  * const isDark = usePreferredDark();
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @name usePreferredLanguages
3
3
  * @description Hook that returns a browser preferred languages from navigator
4
- * @category Browser
4
+ * @category User
5
5
  *
6
6
  * @browserapi navigator.languages https://developer.mozilla.org/en-US/docs/Web/API/Navigator/languages
7
7
  *
@@ -3,7 +3,7 @@ export type UsePreferredReducedMotionReturn = 'no-preference' | 'reduce';
3
3
  /**
4
4
  * @name usePreferredReducedMotion
5
5
  * @description - Hook that returns the reduced motion preference
6
- * @category Browser
6
+ * @category User
7
7
  *
8
8
  * @returns {UsePreferredReducedMotionReturn} The reduced motion preference
9
9
  *
@@ -28,7 +28,7 @@ export interface UseQueryReturn<Data> {
28
28
  /**
29
29
  * @name useQuery
30
30
  * @description - Hook that defines the logic when query data
31
- * @category Utilities
31
+ * @category Async
32
32
  *
33
33
  * @template Data The type of the data
34
34
  * @param {() => Promise<Data>} callback The callback function to be invoked
@@ -18,7 +18,7 @@ export interface UseQueueReturn<Value> {
18
18
  /**
19
19
  * @name useQueue
20
20
  * @description - Hook that manages a queue
21
- * @category Utilities
21
+ * @category State
22
22
  *
23
23
  * @template Value The type of the value
24
24
  * @param {Value[]} [initialValue=[]] The initial value of the queue
@@ -22,7 +22,7 @@ export interface UseRafReturn {
22
22
  /**
23
23
  * @name useRaf
24
24
  * @description - Hook that defines the logic for raf callback
25
- * @category Utilities
25
+ * @category Browser
26
26
  *
27
27
  * @browserapi requestAnimationFrame https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame
28
28
  *
@@ -1,14 +1,14 @@
1
- export type UseRafValueReturn<Value> = [Value, (value: Value) => void];
1
+ export type UseRafStateReturn<Value> = [Value, (value: Value) => void];
2
2
  /**
3
- * @name useRafValue
3
+ * @name useRafState
4
4
  * @description - Hook that returns the value and a function to set the value
5
- * @category Utilities
5
+ * @category State
6
6
  *
7
7
  * @template Value The type of the value
8
8
  * @param {Value} initialValue The initial value
9
- * @returns {UseRafValueReturn<Value>} An array containing the value and a function to set the value
9
+ * @returns {UseRafStateReturn<Value>} An array containing the value and a function to set the value
10
10
  *
11
11
  * @example
12
- * const [value, setValue] = useRafValue(initialValue);
12
+ * const [value, setValue] = useRafState(initialValue);
13
13
  */
14
- export declare const useRafValue: <Value>(initialValue: (() => Value) | Value) => readonly [Value, (value: Value) => void];
14
+ export declare const useRafState: <Value>(initialValue: (() => Value) | Value) => readonly [Value, (value: Value) => void];
@@ -6,7 +6,7 @@ export interface StateRef<Value> {
6
6
  /**
7
7
  * @name useRefState
8
8
  * @description - Hook that returns the state reference of the value
9
- * @category Utilities
9
+ * @category State
10
10
  *
11
11
  * @template Value The type of the value
12
12
  * @param {Value} [initialValue] The initial value
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @name useRenderCount
3
3
  * @description - Hook returns count component render times
4
- * @category Lifecycle
4
+ * @category Debug
5
5
  *
6
6
  * @returns {number} A number which determines how many times component renders
7
7
  *
@@ -1,13 +1,18 @@
1
+ /** The use render info return type */
1
2
  export interface UseRenderInfoReturn {
3
+ /** The name of the component */
2
4
  component: string;
5
+ /** The number of renders */
3
6
  renders: number;
7
+ /** The time since the last render */
4
8
  sinceLast: number;
9
+ /** The timestamp of the render */
5
10
  timestamp: number | null;
6
11
  }
7
12
  /**
8
13
  * @name useRenderInfo
9
14
  * @description - Hook for getting information about component rerender
10
- * @category Lifecycle
15
+ * @category Debug
11
16
  *
12
17
  * @param {string} [name='Unknown'] Component name
13
18
  * @param {boolean} [log=true] Toggle logging
@@ -3,7 +3,7 @@ type UseRerenderReturn = () => void;
3
3
  /**
4
4
  * @name useRerender
5
5
  * @description - Hook that defines the logic to force rerender a component
6
- * @category Lifecycle
6
+ * @category Debug
7
7
  *
8
8
  * @returns {UseRerenderReturn} The rerender function
9
9
  *
@@ -21,7 +21,7 @@ export interface UseResizeObserver {
21
21
  /**
22
22
  * @name useResizeObserver
23
23
  * @description - Hook that gives you resize observer state
24
- * @category Browser
24
+ * @category Sensors
25
25
  *
26
26
  * @browserapi ResizeObserver https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver
27
27
  *
@@ -0,0 +1,37 @@
1
+ import { HookTarget } from '../../utils/helpers';
2
+ import { StateRef } from '../useRefState/useRefState';
3
+ export type RightClickEvent = MouseEvent | TouchEvent;
4
+ export interface RightClickPositions {
5
+ x: number;
6
+ y: number;
7
+ }
8
+ export interface UseRightClickOptions {
9
+ onEnd?: (event: RightClickEvent) => void;
10
+ onStart?: (event: RightClickEvent) => void;
11
+ }
12
+ export interface UseRightClick {
13
+ (target: HookTarget, callback: (event: Event) => void, options?: UseRightClickOptions): void;
14
+ <Target extends Element>(callback: (positions: RightClickPositions, event: Event) => void, options?: UseRightClickOptions, target?: never): StateRef<Target>;
15
+ }
16
+ /**
17
+ * @name useRightClick
18
+ * @description - Hook that handles right-click events and long press on mobile devices
19
+ * @category Elements
20
+ *
21
+ * @overload
22
+ * @param {HookTarget} target The target element for right-click handling
23
+ * @param {(event: RightClickEvents) => void} callback The callback function to be invoked on right click
24
+ * @returns {void}
25
+ *
26
+ * @example
27
+ * useRightClick(ref, () => console.log('clicked'));
28
+ *
29
+ * @overload
30
+ * @template Target The target element
31
+ * @param {(event: RightClickEvents) => void} callback The callback function to be invoked on right click
32
+ * @returns {StateRef<Target>} Ref to attach to the element
33
+ *
34
+ * @example
35
+ * const ref = useRightClick(() => console.log('clicked'));
36
+ */
37
+ export declare const useRightClick: UseRightClick;
@@ -10,7 +10,7 @@ export interface UseScriptOptions extends ComponentProps<'script'> {
10
10
  /**
11
11
  * @name useScript
12
12
  * @description - Hook that manages a script with onLoad, onError, and removeOnUnmount functionalities
13
- * @category Browser
13
+ * @category Elements
14
14
  *
15
15
  * @param {string} src The source of the script
16
16
  * @param {UseScriptOptions} [options] The options of the script extends from attributes script tag
@@ -2,7 +2,7 @@ import { UseStorageInitialValue, UseStorageOptions } from '../useStorage/useStor
2
2
  /**
3
3
  * @name useSessionStorage
4
4
  * @description - Hook that manages session storage value
5
- * @category Browser
5
+ * @category State
6
6
  *
7
7
  * @browserapi sessionStorage https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage
8
8
  *
@@ -28,7 +28,7 @@ interface UseSetReturn<Value> {
28
28
  /**
29
29
  * @name useSet
30
30
  * @description - Hook that manages a set structure
31
- * @category Utilities
31
+ * @category State
32
32
  *
33
33
  * @template Value The type of the value
34
34
  * @param {Value[]} [values] The initial array of the set
@@ -47,7 +47,7 @@ export declare const getSpeechRecognition: () => {
47
47
  /**
48
48
  * @name useSpeechRecognition
49
49
  * @description - Hook that provides a streamlined interface for incorporating speech-to-text functionality
50
- * @category Sensors
50
+ * @category Browser
51
51
  *
52
52
  * @browserapi window.SpeechRecognition https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition
53
53
  *
@@ -41,7 +41,7 @@ export interface UseSpeechSynthesisReturn {
41
41
  /**
42
42
  * @name useSpeechSynthesis
43
43
  * @description - Hook that provides speech synthesis functionality
44
- * @category Sensors
44
+ * @category Browser
45
45
  *
46
46
  * @browserapi SpeechSynthesis https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis
47
47
  *
@@ -60,7 +60,7 @@ export declare const stateHistoryReducer: <Value>(state: StateHistory<Value>, ac
60
60
  /**
61
61
  * @name useStateHistory
62
62
  * @description - Hook that manages state with history functionality
63
- * @category Utilities
63
+ * @category State
64
64
  *
65
65
  * @param {Value} initialValue - The initial value to start the history with
66
66
  * @param {number} [capacity=10] - Maximum number of history entries and undo actions to keep
@@ -27,7 +27,7 @@ export interface UseStepReturn {
27
27
  /**
28
28
  * @name useStep
29
29
  * @description - Hook that create stepper
30
- * @category Utilities
30
+ * @category State
31
31
  *
32
32
  * @overload
33
33
  * @param {number} max Maximum number of steps
@@ -20,7 +20,7 @@ export interface UseSticky {
20
20
  /**
21
21
  * @name UseSticky
22
22
  * @description - Hook that allows you to detect that your sticky component is stuck
23
- * @category Browser
23
+ * @category Elements
24
24
  *
25
25
  * @overload
26
26
  * @param {HookTarget} target The target sticky element
@@ -19,7 +19,7 @@ export declare const dispatchStorageEvent: (params: Partial<StorageEvent>) => bo
19
19
  /**
20
20
  * @name useStorage
21
21
  * @description - Hook that manages storage value
22
- * @category Browser
22
+ * @category State
23
23
  *
24
24
  * @overload
25
25
  * @param {string} key The key of the storage
@@ -20,10 +20,10 @@ export interface UseTextDirection {
20
20
  /**
21
21
  * @name useTextDirection
22
22
  * @description - Hook that can get and set the direction of the element
23
- * @category Browser
23
+ * @category Elements
24
24
  *
25
25
  * @overload
26
- * @param {HookTarget} target The target element to observe
26
+ * @param {HookTarget} [target=document.querySelector('html')] The target element to observe
27
27
  * @param {UseTextDirectionValue} [initialValue = 'ltr'] The initial direction of the element
28
28
  * @returns {UseTextDirectionReturn} An object containing the current text direction of the element
29
29
  *
@@ -4,7 +4,7 @@ export type UseToggleReturn<Value> = readonly [Value, (value?: Value) => void];
4
4
  /**
5
5
  * @name useToggle
6
6
  * @description - Hook that create toggle
7
- * @category Utilities
7
+ * @category State
8
8
  *
9
9
  * @template Value The type of the value
10
10
  * @param {Value[]} [values=[false, true]] The values to toggle
@@ -42,7 +42,7 @@ export interface UseUrlSearchParam {
42
42
  /**
43
43
  * @name useUrlSearchParam
44
44
  * @description - Hook that provides reactive URLSearchParams for a single key
45
- * @category Browser
45
+ * @category State
46
46
  *
47
47
  * @overload
48
48
  * @template Value The type of the url param values
@@ -37,7 +37,7 @@ export interface UseUrlSearchParams {
37
37
  /**
38
38
  * @name useUrlSearchParams
39
39
  * @description - Hook that provides reactive URLSearchParams
40
- * @category Browser
40
+ * @category State
41
41
  *
42
42
  * @overload
43
43
  * @template Value The type of the url param values
@@ -5,7 +5,7 @@ export interface WizardItem<WizardStepId> {
5
5
  /**
6
6
  * @name useWizard
7
7
  * @description - Hook that manages a wizard
8
- * @category Utilities
8
+ * @category State
9
9
  *
10
10
  * @param {WizardItem<WizardStepId>[]} map The map of the wizard
11
11
  * @param {WizardStepId} [initialStepId] The initial step id
@@ -0,0 +1,7 @@
1
+ export * from './useBrowserLanguage/useBrowserLanguage';
2
+ export * from './useOperatingSystem/useOperatingSystem';
3
+ export * from './usePreferredColorScheme/usePreferredColorScheme';
4
+ export * from './usePreferredContrast/usePreferredContrast';
5
+ export * from './usePreferredDark/usePreferredDark';
6
+ export * from './usePreferredLanguages/usePreferredLanguages';
7
+ export * from './usePreferredReducedMotion/usePreferredReducedMotion';
@@ -0,0 +1,9 @@
1
+ export * from './useConst/useConst';
2
+ export * from './useDebounceCallback/useDebounceCallback';
3
+ export * from './useDebounceValue/useDebounceValue';
4
+ export * from './useEvent/useEvent';
5
+ export * from './useLastChanged/useLastChanged';
6
+ export * from './useLatest/useLatest';
7
+ export * from './usePrevious/usePrevious';
8
+ export * from './useThrottleCallback/useThrottleCallback';
9
+ export * from './useThrottleValue/useThrottleValue';
@@ -9,4 +9,4 @@ export declare const target: (target: Target) => {
9
9
  value: Target;
10
10
  type: symbol;
11
11
  };
12
- export declare const getElement: (target: HookTarget) => Document | Element | Window | null | undefined;
12
+ export declare const getElement: (target: HookTarget) => Window | Document | Element | null | undefined;