@oneplatformdev/ui 0.1.0-5 → 0.1.0-8

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 (625) hide show
  1. package/.babelrc +12 -0
  2. package/.storybook/main.ts +48 -0
  3. package/.storybook/manager.ts +6 -0
  4. package/.storybook/preview.ts +29 -0
  5. package/CHANGELOG.md +38 -0
  6. package/dist/CHANGELOG.md +14 -0
  7. package/dist/index.js +14 -13
  8. package/dist/package.json +2 -1
  9. package/external.ts +78 -0
  10. package/kit/MultiSelectCombobox/MultiSelectCombobox.tsx +211 -0
  11. package/kit/MultiSelectCombobox/index.tsx +2 -0
  12. package/kit/MultiSelectCombobox/types.ts +22 -0
  13. package/kit/NLTDateRangePicker/index.tsx +85 -0
  14. package/kit/NLTFilesDropZone/imageList/index.tsx +86 -0
  15. package/kit/NLTFilesDropZone/index.tsx +52 -0
  16. package/kit/NLTFormDateRangePicker/index.tsx +29 -0
  17. package/kit/NLTFormFilesDropZone/index.tsx +73 -0
  18. package/kit/NLTFormPhoneField/index.tsx +36 -0
  19. package/kit/NLTFormPhoneInput/index.tsx +32 -0
  20. package/kit/NLTImageDropZone/index.tsx +105 -0
  21. package/kit/NLTModal/index.tsx +36 -0
  22. package/kit/NLTModal/useModal.ts +10 -0
  23. package/kit/NLTModalHeader/index.tsx +48 -0
  24. package/kit/NLTModalHeader/useModal.ts +10 -0
  25. package/kit/NLTMonthYearPicker/index.tsx +66 -0
  26. package/kit/NLTMonthYearPicker/useMonthYearPicker.ts +37 -0
  27. package/kit/NLTPhoneInput/index.tsx +153 -0
  28. package/kit/NLTPieChart/index.tsx +62 -0
  29. package/kit/NLTSidebar/app-sidebar.tsx +39 -0
  30. package/kit/NLTSidebar/nav-main.tsx +68 -0
  31. package/kit/NLTSidebar/nav-projects.tsx +89 -0
  32. package/kit/NLTSidebar/nav-user.tsx +114 -0
  33. package/kit/NLTSidebar/team-switcher.tsx +89 -0
  34. package/kit/NLTTable/NLTTable.tsx +50 -0
  35. package/kit/NLTTable/index.tsx +1 -0
  36. package/kit/NLTTablePagination/index.tsx +75 -0
  37. package/kit/Sidebar/SidebarNav/SidebarNavGroup.tsx +27 -0
  38. package/kit/Sidebar/SidebarNav/SidebarNavGroupItem.tsx +120 -0
  39. package/kit/Sidebar/SidebarNav/index.ts +3 -0
  40. package/kit/Sidebar/SidebarNav/types.ts +19 -0
  41. package/kit/Sidebar/index.ts +1 -0
  42. package/kit/Stepper/LinearStepper.tsx +91 -0
  43. package/kit/Stepper/Stepper.tsx +17 -0
  44. package/kit/Stepper/VerticalStepper.tsx +91 -0
  45. package/kit/Stepper/index.ts +1 -0
  46. package/kit/Stepper/types.ts +21 -0
  47. package/kit/Stepper/useStepper.ts +40 -0
  48. package/node_modules/@oneplatformdev/hooks/.babelrc +12 -0
  49. package/node_modules/@oneplatformdev/hooks/CHANGELOG.md +23 -0
  50. package/node_modules/@oneplatformdev/hooks/LICENSE +21 -0
  51. package/node_modules/@oneplatformdev/hooks/README.md +7 -0
  52. package/node_modules/@oneplatformdev/hooks/dist/CHANGELOG.md +19 -0
  53. package/node_modules/@oneplatformdev/hooks/dist/LICENSE +21 -0
  54. package/node_modules/@oneplatformdev/hooks/dist/README.md +7 -0
  55. package/node_modules/@oneplatformdev/hooks/dist/index.d.ts +37 -0
  56. package/node_modules/@oneplatformdev/hooks/dist/index.d.ts.map +1 -0
  57. package/node_modules/@oneplatformdev/hooks/dist/index.js +74 -0
  58. package/node_modules/@oneplatformdev/hooks/dist/package.json +68 -0
  59. package/node_modules/@oneplatformdev/hooks/dist/useBoolean/index.d.ts +2 -0
  60. package/node_modules/@oneplatformdev/hooks/dist/useBoolean/index.d.ts.map +1 -0
  61. package/node_modules/@oneplatformdev/hooks/dist/useBoolean/index.js +4 -0
  62. package/node_modules/@oneplatformdev/hooks/dist/useBoolean/useBoolean.d.ts +29 -0
  63. package/node_modules/@oneplatformdev/hooks/dist/useBoolean/useBoolean.d.ts.map +1 -0
  64. package/node_modules/@oneplatformdev/hooks/dist/useBoolean/useBoolean.js +16 -0
  65. package/node_modules/@oneplatformdev/hooks/dist/useClickAnyWhere/index.d.ts +2 -0
  66. package/node_modules/@oneplatformdev/hooks/dist/useClickAnyWhere/index.d.ts.map +1 -0
  67. package/node_modules/@oneplatformdev/hooks/dist/useClickAnyWhere/index.js +4 -0
  68. package/node_modules/@oneplatformdev/hooks/dist/useClickAnyWhere/useClickAnyWhere.d.ts +17 -0
  69. package/node_modules/@oneplatformdev/hooks/dist/useClickAnyWhere/useClickAnyWhere.d.ts.map +1 -0
  70. package/node_modules/@oneplatformdev/hooks/dist/useClickAnyWhere/useClickAnyWhere.js +9 -0
  71. package/node_modules/@oneplatformdev/hooks/dist/useCopyToClipboard/index.d.ts +2 -0
  72. package/node_modules/@oneplatformdev/hooks/dist/useCopyToClipboard/index.d.ts.map +1 -0
  73. package/node_modules/@oneplatformdev/hooks/dist/useCopyToClipboard/index.js +4 -0
  74. package/node_modules/@oneplatformdev/hooks/dist/useCopyToClipboard/useCopyToClipboard.d.ts +34 -0
  75. package/node_modules/@oneplatformdev/hooks/dist/useCopyToClipboard/useCopyToClipboard.d.ts.map +1 -0
  76. package/node_modules/@oneplatformdev/hooks/dist/useCopyToClipboard/useCopyToClipboard.js +16 -0
  77. package/node_modules/@oneplatformdev/hooks/dist/useCountdown/index.d.ts +2 -0
  78. package/node_modules/@oneplatformdev/hooks/dist/useCountdown/index.d.ts.map +1 -0
  79. package/node_modules/@oneplatformdev/hooks/dist/useCountdown/index.js +4 -0
  80. package/node_modules/@oneplatformdev/hooks/dist/useCountdown/useCountdown.d.ts +47 -0
  81. package/node_modules/@oneplatformdev/hooks/dist/useCountdown/useCountdown.d.ts.map +1 -0
  82. package/node_modules/@oneplatformdev/hooks/dist/useCountdown/useCountdown.js +33 -0
  83. package/node_modules/@oneplatformdev/hooks/dist/useCounter/index.d.ts +2 -0
  84. package/node_modules/@oneplatformdev/hooks/dist/useCounter/index.d.ts.map +1 -0
  85. package/node_modules/@oneplatformdev/hooks/dist/useCounter/index.js +4 -0
  86. package/node_modules/@oneplatformdev/hooks/dist/useCounter/useCounter.d.ts +28 -0
  87. package/node_modules/@oneplatformdev/hooks/dist/useCounter/useCounter.d.ts.map +1 -0
  88. package/node_modules/@oneplatformdev/hooks/dist/useCounter/useCounter.js +20 -0
  89. package/node_modules/@oneplatformdev/hooks/dist/useDarkMode/index.d.ts +2 -0
  90. package/node_modules/@oneplatformdev/hooks/dist/useDarkMode/index.d.ts.map +1 -0
  91. package/node_modules/@oneplatformdev/hooks/dist/useDarkMode/index.js +4 -0
  92. package/node_modules/@oneplatformdev/hooks/dist/useDarkMode/useDarkMode.d.ts +46 -0
  93. package/node_modules/@oneplatformdev/hooks/dist/useDarkMode/useDarkMode.d.ts.map +1 -0
  94. package/node_modules/@oneplatformdev/hooks/dist/useDarkMode/useDarkMode.js +38 -0
  95. package/node_modules/@oneplatformdev/hooks/dist/useDebounceCallback/index.d.ts +3 -0
  96. package/node_modules/@oneplatformdev/hooks/dist/useDebounceCallback/index.d.ts.map +1 -0
  97. package/node_modules/@oneplatformdev/hooks/dist/useDebounceCallback/index.js +5 -0
  98. package/node_modules/@oneplatformdev/hooks/dist/useDebounceCallback/useDebounceCallback.d.ts +62 -0
  99. package/node_modules/@oneplatformdev/hooks/dist/useDebounceCallback/useDebounceCallback.d.ts.map +1 -0
  100. package/node_modules/@oneplatformdev/hooks/dist/useDebounceCallback/useDebounceCallback.js +21 -0
  101. package/node_modules/@oneplatformdev/hooks/dist/useDebounceValue/index.d.ts +2 -0
  102. package/node_modules/@oneplatformdev/hooks/dist/useDebounceValue/index.d.ts.map +1 -0
  103. package/node_modules/@oneplatformdev/hooks/dist/useDebounceValue/index.js +4 -0
  104. package/node_modules/@oneplatformdev/hooks/dist/useDebounceValue/useDebounceValue.d.ts +40 -0
  105. package/node_modules/@oneplatformdev/hooks/dist/useDebounceValue/useDebounceValue.d.ts.map +1 -0
  106. package/node_modules/@oneplatformdev/hooks/dist/useDebounceValue/useDebounceValue.js +13 -0
  107. package/node_modules/@oneplatformdev/hooks/dist/useDocumentTitle/index.d.ts +2 -0
  108. package/node_modules/@oneplatformdev/hooks/dist/useDocumentTitle/index.d.ts.map +1 -0
  109. package/node_modules/@oneplatformdev/hooks/dist/useDocumentTitle/index.js +4 -0
  110. package/node_modules/@oneplatformdev/hooks/dist/useDocumentTitle/useDocumentTitle.d.ts +19 -0
  111. package/node_modules/@oneplatformdev/hooks/dist/useDocumentTitle/useDocumentTitle.d.ts.map +1 -0
  112. package/node_modules/@oneplatformdev/hooks/dist/useDocumentTitle/useDocumentTitle.js +16 -0
  113. package/node_modules/@oneplatformdev/hooks/dist/useEventCallback/index.d.ts +2 -0
  114. package/node_modules/@oneplatformdev/hooks/dist/useEventCallback/index.d.ts.map +1 -0
  115. package/node_modules/@oneplatformdev/hooks/dist/useEventCallback/index.js +4 -0
  116. package/node_modules/@oneplatformdev/hooks/dist/useEventCallback/useEventCallback.d.ts +18 -0
  117. package/node_modules/@oneplatformdev/hooks/dist/useEventCallback/useEventCallback.d.ts.map +1 -0
  118. package/node_modules/@oneplatformdev/hooks/dist/useEventCallback/useEventCallback.js +13 -0
  119. package/node_modules/@oneplatformdev/hooks/dist/useEventListener/index.d.ts +2 -0
  120. package/node_modules/@oneplatformdev/hooks/dist/useEventListener/index.d.ts.map +1 -0
  121. package/node_modules/@oneplatformdev/hooks/dist/useEventListener/index.js +4 -0
  122. package/node_modules/@oneplatformdev/hooks/dist/useEventListener/useEventListener.d.ts +7 -0
  123. package/node_modules/@oneplatformdev/hooks/dist/useEventListener/useEventListener.d.ts.map +1 -0
  124. package/node_modules/@oneplatformdev/hooks/dist/useEventListener/useEventListener.js +20 -0
  125. package/node_modules/@oneplatformdev/hooks/dist/useHover/index.d.ts +2 -0
  126. package/node_modules/@oneplatformdev/hooks/dist/useHover/index.d.ts.map +1 -0
  127. package/node_modules/@oneplatformdev/hooks/dist/useHover/index.js +4 -0
  128. package/node_modules/@oneplatformdev/hooks/dist/useHover/useHover.d.ts +17 -0
  129. package/node_modules/@oneplatformdev/hooks/dist/useHover/useHover.d.ts.map +1 -0
  130. package/node_modules/@oneplatformdev/hooks/dist/useHover/useHover.js +13 -0
  131. package/node_modules/@oneplatformdev/hooks/dist/useIntersectionObserver/index.d.ts +2 -0
  132. package/node_modules/@oneplatformdev/hooks/dist/useIntersectionObserver/index.d.ts.map +1 -0
  133. package/node_modules/@oneplatformdev/hooks/dist/useIntersectionObserver/index.js +4 -0
  134. package/node_modules/@oneplatformdev/hooks/dist/useIntersectionObserver/useIntersectionObserver.d.ts +72 -0
  135. package/node_modules/@oneplatformdev/hooks/dist/useIntersectionObserver/useIntersectionObserver.d.ts.map +1 -0
  136. package/node_modules/@oneplatformdev/hooks/dist/useIntersectionObserver/useIntersectionObserver.js +53 -0
  137. package/node_modules/@oneplatformdev/hooks/dist/useInterval/index.d.ts +2 -0
  138. package/node_modules/@oneplatformdev/hooks/dist/useInterval/index.d.ts.map +1 -0
  139. package/node_modules/@oneplatformdev/hooks/dist/useInterval/index.js +4 -0
  140. package/node_modules/@oneplatformdev/hooks/dist/useInterval/useInterval.d.ts +16 -0
  141. package/node_modules/@oneplatformdev/hooks/dist/useInterval/useInterval.d.ts.map +1 -0
  142. package/node_modules/@oneplatformdev/hooks/dist/useInterval/useInterval.js +20 -0
  143. package/node_modules/@oneplatformdev/hooks/dist/useIsClient/index.d.ts +2 -0
  144. package/node_modules/@oneplatformdev/hooks/dist/useIsClient/index.d.ts.map +1 -0
  145. package/node_modules/@oneplatformdev/hooks/dist/useIsClient/index.js +4 -0
  146. package/node_modules/@oneplatformdev/hooks/dist/useIsClient/useIsClient.d.ts +13 -0
  147. package/node_modules/@oneplatformdev/hooks/dist/useIsClient/useIsClient.d.ts.map +1 -0
  148. package/node_modules/@oneplatformdev/hooks/dist/useIsClient/useIsClient.js +10 -0
  149. package/node_modules/@oneplatformdev/hooks/dist/useIsMobile/index.d.ts +3 -0
  150. package/node_modules/@oneplatformdev/hooks/dist/useIsMobile/index.d.ts.map +1 -0
  151. package/node_modules/@oneplatformdev/hooks/dist/useIsMobile/index.js +4 -0
  152. package/node_modules/@oneplatformdev/hooks/dist/useIsMobile/types.d.ts +4 -0
  153. package/node_modules/@oneplatformdev/hooks/dist/useIsMobile/types.d.ts.map +1 -0
  154. package/node_modules/@oneplatformdev/hooks/dist/useIsMobile/types.js +1 -0
  155. package/node_modules/@oneplatformdev/hooks/dist/useIsMobile/useIsMobile.d.ts +3 -0
  156. package/node_modules/@oneplatformdev/hooks/dist/useIsMobile/useIsMobile.d.ts.map +1 -0
  157. package/node_modules/@oneplatformdev/hooks/dist/useIsMobile/useIsMobile.js +16 -0
  158. package/node_modules/@oneplatformdev/hooks/dist/useIsMounted/index.d.ts +2 -0
  159. package/node_modules/@oneplatformdev/hooks/dist/useIsMounted/index.d.ts.map +1 -0
  160. package/node_modules/@oneplatformdev/hooks/dist/useIsMounted/index.js +4 -0
  161. package/node_modules/@oneplatformdev/hooks/dist/useIsMounted/useIsMounted.d.ts +2 -0
  162. package/node_modules/@oneplatformdev/hooks/dist/useIsMounted/useIsMounted.d.ts.map +1 -0
  163. package/node_modules/@oneplatformdev/hooks/dist/useIsMounted/useIsMounted.js +10 -0
  164. package/node_modules/@oneplatformdev/hooks/dist/useIsomorphicLayoutEffect/index.d.ts +2 -0
  165. package/node_modules/@oneplatformdev/hooks/dist/useIsomorphicLayoutEffect/index.d.ts.map +1 -0
  166. package/node_modules/@oneplatformdev/hooks/dist/useIsomorphicLayoutEffect/index.js +4 -0
  167. package/node_modules/@oneplatformdev/hooks/dist/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts +16 -0
  168. package/node_modules/@oneplatformdev/hooks/dist/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts.map +1 -0
  169. package/node_modules/@oneplatformdev/hooks/dist/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +5 -0
  170. package/node_modules/@oneplatformdev/hooks/dist/useLocalStorage/index.d.ts +2 -0
  171. package/node_modules/@oneplatformdev/hooks/dist/useLocalStorage/index.d.ts.map +1 -0
  172. package/node_modules/@oneplatformdev/hooks/dist/useLocalStorage/index.js +4 -0
  173. package/node_modules/@oneplatformdev/hooks/dist/useLocalStorage/useLocalStorage.d.ts +39 -0
  174. package/node_modules/@oneplatformdev/hooks/dist/useLocalStorage/useLocalStorage.d.ts.map +1 -0
  175. package/node_modules/@oneplatformdev/hooks/dist/useLocalStorage/useLocalStorage.js +65 -0
  176. package/node_modules/@oneplatformdev/hooks/dist/useLockBody/index.d.ts +2 -0
  177. package/node_modules/@oneplatformdev/hooks/dist/useLockBody/index.d.ts.map +1 -0
  178. package/node_modules/@oneplatformdev/hooks/dist/useLockBody/index.js +4 -0
  179. package/node_modules/@oneplatformdev/hooks/dist/useLockBody/useLockBody.d.ts +2 -0
  180. package/node_modules/@oneplatformdev/hooks/dist/useLockBody/useLockBody.d.ts.map +1 -0
  181. package/node_modules/@oneplatformdev/hooks/dist/useLockBody/useLockBody.js +12 -0
  182. package/node_modules/@oneplatformdev/hooks/dist/useMap/index.d.ts +2 -0
  183. package/node_modules/@oneplatformdev/hooks/dist/useMap/index.d.ts.map +1 -0
  184. package/node_modules/@oneplatformdev/hooks/dist/useMap/index.js +4 -0
  185. package/node_modules/@oneplatformdev/hooks/dist/useMap/useMap.d.ts +48 -0
  186. package/node_modules/@oneplatformdev/hooks/dist/useMap/useMap.d.ts.map +1 -0
  187. package/node_modules/@oneplatformdev/hooks/dist/useMap/useMap.js +27 -0
  188. package/node_modules/@oneplatformdev/hooks/dist/useMediaQuery/index.d.ts +2 -0
  189. package/node_modules/@oneplatformdev/hooks/dist/useMediaQuery/index.d.ts.map +1 -0
  190. package/node_modules/@oneplatformdev/hooks/dist/useMediaQuery/index.js +4 -0
  191. package/node_modules/@oneplatformdev/hooks/dist/useMediaQuery/useMediaQuery.d.ts +29 -0
  192. package/node_modules/@oneplatformdev/hooks/dist/useMediaQuery/useMediaQuery.d.ts.map +1 -0
  193. package/node_modules/@oneplatformdev/hooks/dist/useMediaQuery/useMediaQuery.js +21 -0
  194. package/node_modules/@oneplatformdev/hooks/dist/useOnClickOutside/index.d.ts +2 -0
  195. package/node_modules/@oneplatformdev/hooks/dist/useOnClickOutside/index.d.ts.map +1 -0
  196. package/node_modules/@oneplatformdev/hooks/dist/useOnClickOutside/index.js +4 -0
  197. package/node_modules/@oneplatformdev/hooks/dist/useOnClickOutside/useOnClickOutside.d.ts +24 -0
  198. package/node_modules/@oneplatformdev/hooks/dist/useOnClickOutside/useOnClickOutside.d.ts.map +1 -0
  199. package/node_modules/@oneplatformdev/hooks/dist/useOnClickOutside/useOnClickOutside.js +17 -0
  200. package/node_modules/@oneplatformdev/hooks/dist/useQueryString/index.d.ts +2 -0
  201. package/node_modules/@oneplatformdev/hooks/dist/useQueryString/index.d.ts.map +1 -0
  202. package/node_modules/@oneplatformdev/hooks/dist/useQueryString/index.js +4 -0
  203. package/node_modules/@oneplatformdev/hooks/dist/useQueryString/useQueryString.d.ts +10 -0
  204. package/node_modules/@oneplatformdev/hooks/dist/useQueryString/useQueryString.d.ts.map +1 -0
  205. package/node_modules/@oneplatformdev/hooks/dist/useQueryString/useQueryString.js +10 -0
  206. package/node_modules/@oneplatformdev/hooks/dist/useReadLocalStorage/index.d.ts +2 -0
  207. package/node_modules/@oneplatformdev/hooks/dist/useReadLocalStorage/index.d.ts.map +1 -0
  208. package/node_modules/@oneplatformdev/hooks/dist/useReadLocalStorage/index.js +4 -0
  209. package/node_modules/@oneplatformdev/hooks/dist/useReadLocalStorage/useReadLocalStorage.d.ts +14 -0
  210. package/node_modules/@oneplatformdev/hooks/dist/useReadLocalStorage/useReadLocalStorage.d.ts.map +1 -0
  211. package/node_modules/@oneplatformdev/hooks/dist/useReadLocalStorage/useReadLocalStorage.js +48 -0
  212. package/node_modules/@oneplatformdev/hooks/dist/useResizeObserver/index.d.ts +2 -0
  213. package/node_modules/@oneplatformdev/hooks/dist/useResizeObserver/index.d.ts.map +1 -0
  214. package/node_modules/@oneplatformdev/hooks/dist/useResizeObserver/index.js +4 -0
  215. package/node_modules/@oneplatformdev/hooks/dist/useResizeObserver/useResizeObserver.d.ts +44 -0
  216. package/node_modules/@oneplatformdev/hooks/dist/useResizeObserver/useResizeObserver.d.ts.map +1 -0
  217. package/node_modules/@oneplatformdev/hooks/dist/useResizeObserver/useResizeObserver.js +31 -0
  218. package/node_modules/@oneplatformdev/hooks/dist/useScreen/index.d.ts +2 -0
  219. package/node_modules/@oneplatformdev/hooks/dist/useScreen/index.d.ts.map +1 -0
  220. package/node_modules/@oneplatformdev/hooks/dist/useScreen/index.js +4 -0
  221. package/node_modules/@oneplatformdev/hooks/dist/useScreen/useScreen.d.ts +20 -0
  222. package/node_modules/@oneplatformdev/hooks/dist/useScreen/useScreen.d.ts.map +1 -0
  223. package/node_modules/@oneplatformdev/hooks/dist/useScreen/useScreen.js +48 -0
  224. package/node_modules/@oneplatformdev/hooks/dist/useScript/index.d.ts +2 -0
  225. package/node_modules/@oneplatformdev/hooks/dist/useScript/index.d.ts.map +1 -0
  226. package/node_modules/@oneplatformdev/hooks/dist/useScript/index.js +4 -0
  227. package/node_modules/@oneplatformdev/hooks/dist/useScript/useScript.d.ts +24 -0
  228. package/node_modules/@oneplatformdev/hooks/dist/useScript/useScript.d.ts.map +1 -0
  229. package/node_modules/@oneplatformdev/hooks/dist/useScript/useScript.js +45 -0
  230. package/node_modules/@oneplatformdev/hooks/dist/useScrollLock/index.d.ts +2 -0
  231. package/node_modules/@oneplatformdev/hooks/dist/useScrollLock/index.d.ts.map +1 -0
  232. package/node_modules/@oneplatformdev/hooks/dist/useScrollLock/index.js +4 -0
  233. package/node_modules/@oneplatformdev/hooks/dist/useScrollLock/useScrollLock.d.ts +54 -0
  234. package/node_modules/@oneplatformdev/hooks/dist/useScrollLock/useScrollLock.d.ts.map +1 -0
  235. package/node_modules/@oneplatformdev/hooks/dist/useScrollLock/useScrollLock.js +26 -0
  236. package/node_modules/@oneplatformdev/hooks/dist/useSessionStorage/index.d.ts +2 -0
  237. package/node_modules/@oneplatformdev/hooks/dist/useSessionStorage/index.d.ts.map +1 -0
  238. package/node_modules/@oneplatformdev/hooks/dist/useSessionStorage/index.js +4 -0
  239. package/node_modules/@oneplatformdev/hooks/dist/useSessionStorage/useSessionStorage.d.ts +39 -0
  240. package/node_modules/@oneplatformdev/hooks/dist/useSessionStorage/useSessionStorage.d.ts.map +1 -0
  241. package/node_modules/@oneplatformdev/hooks/dist/useSessionStorage/useSessionStorage.js +65 -0
  242. package/node_modules/@oneplatformdev/hooks/dist/useStep/index.d.ts +2 -0
  243. package/node_modules/@oneplatformdev/hooks/dist/useStep/index.d.ts.map +1 -0
  244. package/node_modules/@oneplatformdev/hooks/dist/useStep/index.js +4 -0
  245. package/node_modules/@oneplatformdev/hooks/dist/useStep/useStep.d.ts +31 -0
  246. package/node_modules/@oneplatformdev/hooks/dist/useStep/useStep.d.ts.map +1 -0
  247. package/node_modules/@oneplatformdev/hooks/dist/useStep/useStep.js +34 -0
  248. package/node_modules/@oneplatformdev/hooks/dist/useTernaryDarkMode/index.d.ts +2 -0
  249. package/node_modules/@oneplatformdev/hooks/dist/useTernaryDarkMode/index.d.ts.map +1 -0
  250. package/node_modules/@oneplatformdev/hooks/dist/useTernaryDarkMode/index.js +4 -0
  251. package/node_modules/@oneplatformdev/hooks/dist/useTernaryDarkMode/useTernaryDarkMode.d.ts +46 -0
  252. package/node_modules/@oneplatformdev/hooks/dist/useTernaryDarkMode/useTernaryDarkMode.d.ts.map +1 -0
  253. package/node_modules/@oneplatformdev/hooks/dist/useTernaryDarkMode/useTernaryDarkMode.js +27 -0
  254. package/node_modules/@oneplatformdev/hooks/dist/useTimeout/index.d.ts +2 -0
  255. package/node_modules/@oneplatformdev/hooks/dist/useTimeout/index.d.ts.map +1 -0
  256. package/node_modules/@oneplatformdev/hooks/dist/useTimeout/index.js +4 -0
  257. package/node_modules/@oneplatformdev/hooks/dist/useTimeout/useTimeout.d.ts +17 -0
  258. package/node_modules/@oneplatformdev/hooks/dist/useTimeout/useTimeout.d.ts.map +1 -0
  259. package/node_modules/@oneplatformdev/hooks/dist/useTimeout/useTimeout.js +20 -0
  260. package/node_modules/@oneplatformdev/hooks/dist/useToggle/index.d.ts +2 -0
  261. package/node_modules/@oneplatformdev/hooks/dist/useToggle/index.d.ts.map +1 -0
  262. package/node_modules/@oneplatformdev/hooks/dist/useToggle/index.js +4 -0
  263. package/node_modules/@oneplatformdev/hooks/dist/useToggle/useToggle.d.ts +18 -0
  264. package/node_modules/@oneplatformdev/hooks/dist/useToggle/useToggle.d.ts.map +1 -0
  265. package/node_modules/@oneplatformdev/hooks/dist/useToggle/useToggle.js +10 -0
  266. package/node_modules/@oneplatformdev/hooks/dist/useUnmount/index.d.ts +2 -0
  267. package/node_modules/@oneplatformdev/hooks/dist/useUnmount/index.d.ts.map +1 -0
  268. package/node_modules/@oneplatformdev/hooks/dist/useUnmount/index.js +4 -0
  269. package/node_modules/@oneplatformdev/hooks/dist/useUnmount/useUnmount.d.ts +14 -0
  270. package/node_modules/@oneplatformdev/hooks/dist/useUnmount/useUnmount.d.ts.map +1 -0
  271. package/node_modules/@oneplatformdev/hooks/dist/useUnmount/useUnmount.js +13 -0
  272. package/node_modules/@oneplatformdev/hooks/dist/useWindowSize/index.d.ts +2 -0
  273. package/node_modules/@oneplatformdev/hooks/dist/useWindowSize/index.d.ts.map +1 -0
  274. package/node_modules/@oneplatformdev/hooks/dist/useWindowSize/index.js +4 -0
  275. package/node_modules/@oneplatformdev/hooks/dist/useWindowSize/useWindowSize.d.ts +30 -0
  276. package/node_modules/@oneplatformdev/hooks/dist/useWindowSize/useWindowSize.d.ts.map +1 -0
  277. package/node_modules/@oneplatformdev/hooks/dist/useWindowSize/useWindowSize.js +31 -0
  278. package/node_modules/@oneplatformdev/hooks/package.json +68 -0
  279. package/node_modules/@oneplatformdev/hooks/src/index.ts +36 -0
  280. package/node_modules/@oneplatformdev/hooks/src/useBoolean/index.ts +1 -0
  281. package/node_modules/@oneplatformdev/hooks/src/useBoolean/useBoolean.ts +50 -0
  282. package/node_modules/@oneplatformdev/hooks/src/useClickAnyWhere/index.ts +1 -0
  283. package/node_modules/@oneplatformdev/hooks/src/useClickAnyWhere/useClickAnyWhere.ts +22 -0
  284. package/node_modules/@oneplatformdev/hooks/src/useCopyToClipboard/index.ts +1 -0
  285. package/node_modules/@oneplatformdev/hooks/src/useCopyToClipboard/useCopyToClipboard.ts +58 -0
  286. package/node_modules/@oneplatformdev/hooks/src/useCountdown/index.ts +1 -0
  287. package/node_modules/@oneplatformdev/hooks/src/useCountdown/useCountdown.ts +102 -0
  288. package/node_modules/@oneplatformdev/hooks/src/useCounter/index.ts +1 -0
  289. package/node_modules/@oneplatformdev/hooks/src/useCounter/useCounter.ts +52 -0
  290. package/node_modules/@oneplatformdev/hooks/src/useDarkMode/index.ts +1 -0
  291. package/node_modules/@oneplatformdev/hooks/src/useDarkMode/useDarkMode.ts +92 -0
  292. package/node_modules/@oneplatformdev/hooks/src/useDebounceCallback/index.ts +2 -0
  293. package/node_modules/@oneplatformdev/hooks/src/useDebounceCallback/useDebounceCallback.ts +115 -0
  294. package/node_modules/@oneplatformdev/hooks/src/useDebounceValue/index.ts +1 -0
  295. package/node_modules/@oneplatformdev/hooks/src/useDebounceValue/useDebounceValue.ts +67 -0
  296. package/node_modules/@oneplatformdev/hooks/src/useDocumentTitle/index.ts +1 -0
  297. package/node_modules/@oneplatformdev/hooks/src/useDocumentTitle/useDocumentTitle.ts +43 -0
  298. package/node_modules/@oneplatformdev/hooks/src/useEventCallback/index.ts +1 -0
  299. package/node_modules/@oneplatformdev/hooks/src/useEventCallback/useEventCallback.ts +40 -0
  300. package/node_modules/@oneplatformdev/hooks/src/useEventListener/index.ts +1 -0
  301. package/node_modules/@oneplatformdev/hooks/src/useEventListener/useEventListener.ts +121 -0
  302. package/node_modules/@oneplatformdev/hooks/src/useHover/index.ts +1 -0
  303. package/node_modules/@oneplatformdev/hooks/src/useHover/useHover.ts +37 -0
  304. package/node_modules/@oneplatformdev/hooks/src/useIntersectionObserver/index.ts +1 -0
  305. package/node_modules/@oneplatformdev/hooks/src/useIntersectionObserver/useIntersectionObserver.ts +186 -0
  306. package/node_modules/@oneplatformdev/hooks/src/useInterval/index.ts +1 -0
  307. package/node_modules/@oneplatformdev/hooks/src/useInterval/useInterval.ts +43 -0
  308. package/node_modules/@oneplatformdev/hooks/src/useIsClient/index.ts +1 -0
  309. package/node_modules/@oneplatformdev/hooks/src/useIsClient/useIsClient.ts +22 -0
  310. package/node_modules/@oneplatformdev/hooks/src/useIsMobile/index.ts +2 -0
  311. package/node_modules/@oneplatformdev/hooks/src/useIsMobile/types.ts +3 -0
  312. package/node_modules/@oneplatformdev/hooks/src/useIsMobile/useIsMobile.tsx +23 -0
  313. package/node_modules/@oneplatformdev/hooks/src/useIsMounted/index.ts +1 -0
  314. package/node_modules/@oneplatformdev/hooks/src/useIsMounted/useIsMounted.ts +15 -0
  315. package/node_modules/@oneplatformdev/hooks/src/useIsomorphicLayoutEffect/index.ts +1 -0
  316. package/node_modules/@oneplatformdev/hooks/src/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.ts +17 -0
  317. package/node_modules/@oneplatformdev/hooks/src/useLocalStorage/index.ts +1 -0
  318. package/node_modules/@oneplatformdev/hooks/src/useLocalStorage/useLocalStorage.ts +191 -0
  319. package/node_modules/@oneplatformdev/hooks/src/useLockBody/index.ts +1 -0
  320. package/node_modules/@oneplatformdev/hooks/src/useLockBody/useLockBody.tsx +12 -0
  321. package/node_modules/@oneplatformdev/hooks/src/useMap/index.ts +1 -0
  322. package/node_modules/@oneplatformdev/hooks/src/useMap/useMap.ts +83 -0
  323. package/node_modules/@oneplatformdev/hooks/src/useMediaQuery/index.ts +1 -0
  324. package/node_modules/@oneplatformdev/hooks/src/useMediaQuery/useMediaQuery.ts +83 -0
  325. package/node_modules/@oneplatformdev/hooks/src/useOnClickOutside/index.ts +1 -0
  326. package/node_modules/@oneplatformdev/hooks/src/useOnClickOutside/useOnClickOutside.ts +61 -0
  327. package/node_modules/@oneplatformdev/hooks/src/useQueryString/index.ts +1 -0
  328. package/node_modules/@oneplatformdev/hooks/src/useQueryString/useQueryString.ts +26 -0
  329. package/node_modules/@oneplatformdev/hooks/src/useReadLocalStorage/index.ts +1 -0
  330. package/node_modules/@oneplatformdev/hooks/src/useReadLocalStorage/useReadLocalStorage.ts +122 -0
  331. package/node_modules/@oneplatformdev/hooks/src/useResizeObserver/index.ts +1 -0
  332. package/node_modules/@oneplatformdev/hooks/src/useResizeObserver/useResizeObserver.ts +131 -0
  333. package/node_modules/@oneplatformdev/hooks/src/useScreen/index.ts +1 -0
  334. package/node_modules/@oneplatformdev/hooks/src/useScreen/useScreen.ts +106 -0
  335. package/node_modules/@oneplatformdev/hooks/src/useScript/index.ts +1 -0
  336. package/node_modules/@oneplatformdev/hooks/src/useScript/useScript.ts +142 -0
  337. package/node_modules/@oneplatformdev/hooks/src/useScrollLock/index.ts +1 -0
  338. package/node_modules/@oneplatformdev/hooks/src/useScrollLock/useScrollLock.ts +141 -0
  339. package/node_modules/@oneplatformdev/hooks/src/useSessionStorage/index.ts +1 -0
  340. package/node_modules/@oneplatformdev/hooks/src/useSessionStorage/useSessionStorage.ts +191 -0
  341. package/node_modules/@oneplatformdev/hooks/src/useStep/index.ts +1 -0
  342. package/node_modules/@oneplatformdev/hooks/src/useStep/useStep.ts +83 -0
  343. package/node_modules/@oneplatformdev/hooks/src/useTernaryDarkMode/index.ts +1 -0
  344. package/node_modules/@oneplatformdev/hooks/src/useTernaryDarkMode/useTernaryDarkMode.ts +81 -0
  345. package/node_modules/@oneplatformdev/hooks/src/useTimeout/index.ts +1 -0
  346. package/node_modules/@oneplatformdev/hooks/src/useTimeout/useTimeout.ts +44 -0
  347. package/node_modules/@oneplatformdev/hooks/src/useToggle/index.ts +1 -0
  348. package/node_modules/@oneplatformdev/hooks/src/useToggle/useToggle.ts +30 -0
  349. package/node_modules/@oneplatformdev/hooks/src/useUnmount/index.ts +1 -0
  350. package/node_modules/@oneplatformdev/hooks/src/useUnmount/useUnmount.ts +26 -0
  351. package/node_modules/@oneplatformdev/hooks/src/useWindowSize/index.ts +1 -0
  352. package/node_modules/@oneplatformdev/hooks/src/useWindowSize/useWindowSize.ts +100 -0
  353. package/node_modules/@oneplatformdev/hooks/tsconfig.json +10 -0
  354. package/node_modules/@oneplatformdev/hooks/tsconfig.lib.json +33 -0
  355. package/node_modules/@oneplatformdev/hooks/vite.config.ts +62 -0
  356. package/node_modules/@oneplatformdev/utils/.babelrc +12 -0
  357. package/node_modules/@oneplatformdev/utils/CHANGELOG.md +23 -0
  358. package/node_modules/@oneplatformdev/utils/LICENSE +21 -0
  359. package/node_modules/@oneplatformdev/utils/README.md +7 -0
  360. package/node_modules/@oneplatformdev/utils/dist/CHANGELOG.md +19 -0
  361. package/node_modules/@oneplatformdev/utils/dist/LICENSE +21 -0
  362. package/node_modules/@oneplatformdev/utils/dist/README.md +7 -0
  363. package/node_modules/@oneplatformdev/utils/dist/cn/cn.d.ts +4 -0
  364. package/node_modules/@oneplatformdev/utils/dist/cn/cn.d.ts.map +1 -0
  365. package/node_modules/@oneplatformdev/utils/dist/cn/cn.js +9 -0
  366. package/node_modules/@oneplatformdev/utils/dist/cn/index.d.ts +2 -0
  367. package/node_modules/@oneplatformdev/utils/dist/cn/index.d.ts.map +1 -0
  368. package/node_modules/@oneplatformdev/utils/dist/cn/index.js +5 -0
  369. package/node_modules/@oneplatformdev/utils/dist/composeRefs/composeRefs.d.ts +4 -0
  370. package/node_modules/@oneplatformdev/utils/dist/composeRefs/composeRefs.d.ts.map +1 -0
  371. package/node_modules/@oneplatformdev/utils/dist/composeRefs/composeRefs.js +10 -0
  372. package/node_modules/@oneplatformdev/utils/dist/composeRefs/index.d.ts +2 -0
  373. package/node_modules/@oneplatformdev/utils/dist/composeRefs/index.d.ts.map +1 -0
  374. package/node_modules/@oneplatformdev/utils/dist/composeRefs/index.js +5 -0
  375. package/node_modules/@oneplatformdev/utils/dist/index.d.ts +4 -0
  376. package/node_modules/@oneplatformdev/utils/dist/index.d.ts.map +1 -0
  377. package/node_modules/@oneplatformdev/utils/dist/index.js +6 -0
  378. package/node_modules/@oneplatformdev/utils/dist/package.json +64 -0
  379. package/node_modules/@oneplatformdev/utils/dist/types/PartialOne.d.ts +2 -0
  380. package/node_modules/@oneplatformdev/utils/dist/types/PartialOne.d.ts.map +1 -0
  381. package/node_modules/@oneplatformdev/utils/dist/types/PartialOne.js +1 -0
  382. package/node_modules/@oneplatformdev/utils/dist/types/index.d.ts +2 -0
  383. package/node_modules/@oneplatformdev/utils/dist/types/index.d.ts.map +1 -0
  384. package/node_modules/@oneplatformdev/utils/dist/types/index.js +1 -0
  385. package/node_modules/@oneplatformdev/utils/package.json +64 -0
  386. package/node_modules/@oneplatformdev/utils/src/cn/cn.ts +7 -0
  387. package/node_modules/@oneplatformdev/utils/src/cn/index.ts +1 -0
  388. package/node_modules/@oneplatformdev/utils/src/composeRefs/composeRefs.ts +12 -0
  389. package/node_modules/@oneplatformdev/utils/src/composeRefs/index.ts +1 -0
  390. package/node_modules/@oneplatformdev/utils/src/index.ts +3 -0
  391. package/node_modules/@oneplatformdev/utils/src/types/PartialOne.ts +1 -0
  392. package/node_modules/@oneplatformdev/utils/src/types/index.ts +1 -0
  393. package/node_modules/@oneplatformdev/utils/tsconfig.json +10 -0
  394. package/node_modules/@oneplatformdev/utils/tsconfig.lib.json +34 -0
  395. package/node_modules/@oneplatformdev/utils/vite.config.ts +60 -0
  396. package/node_modules/@radix-ui/react-slot/README.md +13 -0
  397. package/node_modules/@radix-ui/react-slot/dist/index.d.mts +13 -0
  398. package/node_modules/@radix-ui/react-slot/dist/index.d.ts +13 -0
  399. package/node_modules/@radix-ui/react-slot/dist/index.js +118 -0
  400. package/node_modules/@radix-ui/react-slot/dist/index.js.map +7 -0
  401. package/node_modules/@radix-ui/react-slot/dist/index.mjs +85 -0
  402. package/node_modules/@radix-ui/react-slot/dist/index.mjs.map +7 -0
  403. package/node_modules/@radix-ui/react-slot/package.json +50 -0
  404. package/node_modules/@radix-ui/react-tooltip/LICENSE +21 -0
  405. package/node_modules/@radix-ui/react-tooltip/README.md +3 -0
  406. package/node_modules/@radix-ui/react-tooltip/dist/index.d.mts +101 -0
  407. package/node_modules/@radix-ui/react-tooltip/dist/index.d.ts +101 -0
  408. package/node_modules/@radix-ui/react-tooltip/dist/index.js +540 -0
  409. package/node_modules/@radix-ui/react-tooltip/dist/index.js.map +7 -0
  410. package/node_modules/@radix-ui/react-tooltip/dist/index.mjs +508 -0
  411. package/node_modules/@radix-ui/react-tooltip/dist/index.mjs.map +7 -0
  412. package/node_modules/@radix-ui/react-tooltip/package.json +79 -0
  413. package/package.json +4 -3
  414. package/src/Button/Button.stories.tsx +33 -0
  415. package/src/Button/Button.tsx +33 -0
  416. package/src/Button/Button.types.ts +11 -0
  417. package/src/Button/buttonVariants.ts +38 -0
  418. package/src/Button/index.ts +3 -0
  419. package/src/ButtonIcon/ButtonIcon.stories.tsx +186 -0
  420. package/src/ButtonIcon/ButtonIcon.tsx +28 -0
  421. package/src/ButtonIcon/ButtonIcon.types.ts +10 -0
  422. package/src/ButtonIcon/buttonIconVariants.ts +137 -0
  423. package/src/ButtonIcon/index.ts +3 -0
  424. package/src/Tooltip/Tooltip.tsx +20 -0
  425. package/src/Tooltip/Tooltip.types.tsx +9 -0
  426. package/src/Tooltip/TooltipRoot.tsx +32 -0
  427. package/src/Tooltip/index.ts +3 -0
  428. package/src/global.css +123 -0
  429. package/src/index.ts +5 -0
  430. package/src_old/Accordion/Accordion.tsx +62 -0
  431. package/src_old/Accordion/index.ts +1 -0
  432. package/src_old/Alert/Alert.tsx +42 -0
  433. package/src_old/Alert/alertVariants.ts +19 -0
  434. package/src_old/Alert/index.ts +1 -0
  435. package/src_old/AlertDialog/AlertDialog.stories.tsx +131 -0
  436. package/src_old/AlertDialog/AlertDialog.tsx +257 -0
  437. package/src_old/AlertDialog/AlertDialog.types.tsx +66 -0
  438. package/src_old/AlertDialog/AlertDialogRoot.tsx +141 -0
  439. package/src_old/AlertDialog/index.ts +15 -0
  440. package/src_old/AreaChart/AreaChart.tsx +39 -0
  441. package/src_old/AreaChart/AreaChart.types.ts +18 -0
  442. package/src_old/AreaChart/index.tsx +2 -0
  443. package/src_old/Aside/Aside.tsx +26 -0
  444. package/src_old/Aside/Aside.types.ts +21 -0
  445. package/src_old/Aside/AsideSidebar.tsx +78 -0
  446. package/src_old/Aside/index.ts +3 -0
  447. package/src_old/AspectRatio/AspectRatio.tsx +5 -0
  448. package/src_old/AspectRatio/index.ts +1 -0
  449. package/src_old/Avatar/Avatar.tsx +48 -0
  450. package/src_old/Avatar/index.ts +1 -0
  451. package/src_old/Badge/Badge.tsx +13 -0
  452. package/src_old/Badge/Badge.types.ts +8 -0
  453. package/src_old/Badge/badgeVariants.ts +21 -0
  454. package/src_old/Badge/index.ts +3 -0
  455. package/src_old/Breadcrumb/Breadcrumb.tsx +115 -0
  456. package/src_old/Breadcrumb/index.ts +1 -0
  457. package/src_old/Calendar/Calendar.tsx +77 -0
  458. package/src_old/Calendar/index.ts +1 -0
  459. package/src_old/Card/Card.tsx +77 -0
  460. package/src_old/Card/index.ts +1 -0
  461. package/src_old/Carousel/Carousel.tsx +262 -0
  462. package/src_old/Carousel/index.ts +1 -0
  463. package/src_old/Chart/Chart.tsx +365 -0
  464. package/src_old/Chart/index.ts +1 -0
  465. package/src_old/Checkbox/Checkbox.tsx +62 -0
  466. package/src_old/Checkbox/Checkbox.types.ts +15 -0
  467. package/src_old/Checkbox/index.ts +2 -0
  468. package/src_old/Collapsible/Collapsible.tsx +11 -0
  469. package/src_old/Collapsible/index.ts +1 -0
  470. package/src_old/Combobox/Combobox.tsx +256 -0
  471. package/src_old/Combobox/Combobox.types.ts +55 -0
  472. package/src_old/Combobox/ComboboxOptionItem.tsx +46 -0
  473. package/src_old/Combobox/ComboboxOptions.tsx +90 -0
  474. package/src_old/Combobox/index.tsx +2 -0
  475. package/src_old/Command/Command.tsx +161 -0
  476. package/src_old/Command/index.ts +1 -0
  477. package/src_old/DataTable/DataTable.tsx +118 -0
  478. package/src_old/DataTable/DataTable.types.tsx +14 -0
  479. package/src_old/DataTable/DataTableColumnFilter.tsx +57 -0
  480. package/src_old/DataTable/index.tsx +2 -0
  481. package/src_old/DataTable/useDataTable.ts +44 -0
  482. package/src_old/DatePicker/DatePicker.tsx +56 -0
  483. package/src_old/DatePicker/DatePicker.types.tsx +7 -0
  484. package/src_old/DatePicker/index.tsx +3 -0
  485. package/src_old/Dialog/Dialog.tsx +182 -0
  486. package/src_old/Dialog/DialogOverlayScope.tsx +19 -0
  487. package/src_old/Dialog/index.ts +2 -0
  488. package/src_old/Drawer/Drawer.tsx +118 -0
  489. package/src_old/Drawer/index.ts +1 -0
  490. package/src_old/DropdownMenu/DropdownMenu.tsx +206 -0
  491. package/src_old/DropdownMenu/index.ts +1 -0
  492. package/src_old/Dropzone/Dropzone.tsx +229 -0
  493. package/src_old/Dropzone/Dropzone.types.tsx +69 -0
  494. package/src_old/Dropzone/DropzoneFilePreview.tsx +69 -0
  495. package/src_old/Dropzone/DropzoneSinglePickPreview.tsx +64 -0
  496. package/src_old/Dropzone/DropzoneUtils.tsx +31 -0
  497. package/src_old/Dropzone/index.tsx +2 -0
  498. package/src_old/Form/Form.tsx +181 -0
  499. package/src_old/Form/FormRenderControl.tsx +23 -0
  500. package/src_old/Form/FormRenderControl.types.tsx +29 -0
  501. package/src_old/Form/index.ts +4 -0
  502. package/src_old/FormCheckbox/FormCheckbox.tsx +34 -0
  503. package/src_old/FormCheckbox/FormCheckbox.types.tsx +10 -0
  504. package/src_old/FormCheckbox/index.tsx +2 -0
  505. package/src_old/FormCombobox/FormCombobox.tsx +27 -0
  506. package/src_old/FormCombobox/FormCombobox.types.ts +7 -0
  507. package/src_old/FormCombobox/index.tsx +2 -0
  508. package/src_old/FormDatePicker/FormDatePicker.tsx +33 -0
  509. package/src_old/FormDatePicker/FormDatePicker.types.ts +9 -0
  510. package/src_old/FormDatePicker/index.tsx +3 -0
  511. package/src_old/FormDropzone/FormDropzone.tsx +23 -0
  512. package/src_old/FormDropzone/FormDropzone.types.ts +7 -0
  513. package/src_old/FormDropzone/index.tsx +2 -0
  514. package/src_old/FormInput/FormInput.tsx +109 -0
  515. package/src_old/FormInput/FormInput.types.tsx +7 -0
  516. package/src_old/FormInput/index.tsx +2 -0
  517. package/src_old/FormRadio/FormRadio.tsx +54 -0
  518. package/src_old/FormRadio/FormRadio.types.ts +11 -0
  519. package/src_old/FormRadio/index.ts +2 -0
  520. package/src_old/FormSelect/FormSelect.tsx +44 -0
  521. package/src_old/FormSelect/FormSelect.types.ts +8 -0
  522. package/src_old/FormSelect/index.tsx +2 -0
  523. package/src_old/FormTextarea/FormTextarea.tsx +28 -0
  524. package/src_old/FormTextarea/FormTextarea.types.tsx +7 -0
  525. package/src_old/FormTextarea/index.tsx +2 -0
  526. package/src_old/Header/Header.tsx +34 -0
  527. package/src_old/Header/Header.types.tsx +3 -0
  528. package/src_old/Header/index.ts +2 -0
  529. package/src_old/HoverCard/HoverCard.tsx +29 -0
  530. package/src_old/HoverCard/index.ts +1 -0
  531. package/src_old/Input/Input.tsx +95 -0
  532. package/src_old/Input/Input.types.ts +26 -0
  533. package/src_old/Input/index.ts +3 -0
  534. package/src_old/Input/inputVariants.tsx +22 -0
  535. package/src_old/InputOTP/InputOTP.tsx +71 -0
  536. package/src_old/InputOTP/index.ts +1 -0
  537. package/src_old/Label/Label.tsx +23 -0
  538. package/src_old/Label/index.ts +2 -0
  539. package/src_old/Label/labelVariants.ts +8 -0
  540. package/src_old/LazyLoader/LazyLoader.tsx +30 -0
  541. package/src_old/LazyLoader/index.ts +1 -0
  542. package/src_old/LoadedIcon/LoadedIcon.tsx +36 -0
  543. package/src_old/LoadedIcon/index.ts +1 -0
  544. package/src_old/LoadingMask/LoadingMask.tsx +21 -0
  545. package/src_old/LoadingMask/LoadingMask.types.ts +5 -0
  546. package/src_old/LoadingMask/RenderLoadingMask.tsx +80 -0
  547. package/src_old/LoadingMask/index.ts +3 -0
  548. package/src_old/LoadingProgress/LoadingProgress.tsx +36 -0
  549. package/src_old/LoadingProgress/LoadingProgress.types.tsx +8 -0
  550. package/src_old/LoadingProgress/index.ts +3 -0
  551. package/src_old/LoadingProgress/loadingProgressVariants.ts +22 -0
  552. package/src_old/Menubar/Menubar.tsx +232 -0
  553. package/src_old/Menubar/index.ts +1 -0
  554. package/src_old/NavigationMenu/NavigationMenu.tsx +123 -0
  555. package/src_old/NavigationMenu/index.ts +2 -0
  556. package/src_old/NavigationMenu/navigationMenuVariants.ts +5 -0
  557. package/src_old/Pagination/Pagination.tsx +117 -0
  558. package/src_old/Pagination/index.ts +1 -0
  559. package/src_old/Popover/Popover.tsx +47 -0
  560. package/src_old/Popover/index.ts +1 -0
  561. package/src_old/Progress/Progress.tsx +28 -0
  562. package/src_old/Progress/index.ts +1 -0
  563. package/src_old/Radio/Radio.tsx +23 -0
  564. package/src_old/Radio/Radio.types.ts +17 -0
  565. package/src_old/Radio/index.ts +2 -0
  566. package/src_old/RadioGroup/RadioGroup.tsx +67 -0
  567. package/src_old/RadioGroup/index.ts +1 -0
  568. package/src_old/Resizable/Resizable.tsx +45 -0
  569. package/src_old/Resizable/index.ts +1 -0
  570. package/src_old/ScrollArea/ScrollArea.tsx +58 -0
  571. package/src_old/ScrollArea/index.ts +1 -0
  572. package/src_old/Search/Search.tsx +57 -0
  573. package/src_old/Search/Search.types.tsx +9 -0
  574. package/src_old/Search/index.tsx +3 -0
  575. package/src_old/Select/Select.stories.tsx +45 -0
  576. package/src_old/Select/Select.tsx +171 -0
  577. package/src_old/Select/Select.types.ts +46 -0
  578. package/src_old/Select/SelectRoot.tsx +164 -0
  579. package/src_old/Select/index.ts +3 -0
  580. package/src_old/Separator/Separator.tsx +31 -0
  581. package/src_old/Separator/index.ts +1 -0
  582. package/src_old/Sheet/Sheet.tsx +144 -0
  583. package/src_old/Sheet/index.ts +1 -0
  584. package/src_old/Sidebar/Sidebar.tsx +763 -0
  585. package/src_old/Sidebar/index.ts +1 -0
  586. package/src_old/Skeleton/Skeleton.tsx +17 -0
  587. package/src_old/Skeleton/index.ts +1 -0
  588. package/src_old/Slider/Slider.tsx +28 -0
  589. package/src_old/Slider/index.ts +1 -0
  590. package/src_old/Sonner/Sonner.tsx +31 -0
  591. package/src_old/Sonner/index.ts +1 -0
  592. package/src_old/Switch/Switch.tsx +29 -0
  593. package/src_old/Switch/index.ts +1 -0
  594. package/src_old/Table/Table.tsx +120 -0
  595. package/src_old/Table/index.ts +1 -0
  596. package/src_old/TablePagination/TablePagination.tsx +96 -0
  597. package/src_old/TablePagination/index.ts +1 -0
  598. package/src_old/Tabs/Tabs.tsx +35 -0
  599. package/src_old/Tabs/Tabs.types.tsx +13 -0
  600. package/src_old/Tabs/TabsRoot.tsx +55 -0
  601. package/src_old/Tabs/index.ts +2 -0
  602. package/src_old/Textarea/Textarea.tsx +78 -0
  603. package/src_old/Textarea/Textarea.types.tsx +21 -0
  604. package/src_old/Textarea/index.ts +2 -0
  605. package/src_old/Textarea/useAutosizeTextArea.ts +33 -0
  606. package/src_old/Theme/ThemeModeToggle.tsx +71 -0
  607. package/src_old/Theme/ThemeProvider.tsx +29 -0
  608. package/src_old/Theme/index.ts +2 -0
  609. package/src_old/Toast/Toast.tsx +109 -0
  610. package/src_old/Toast/Toast.types.tsx +45 -0
  611. package/src_old/Toast/index.ts +3 -0
  612. package/src_old/Toast/toast.constants.tsx +6 -0
  613. package/src_old/Toast/toastVariants.ts +20 -0
  614. package/src_old/Toast/useToast.ts +156 -0
  615. package/src_old/Toaster/Toaster.tsx +35 -0
  616. package/src_old/Toaster/index.ts +1 -0
  617. package/src_old/Toggle/Toggle.tsx +45 -0
  618. package/src_old/Toggle/index.ts +1 -0
  619. package/src_old/ToggleGroup/ToggleGroup.tsx +61 -0
  620. package/src_old/ToggleGroup/index.ts +1 -0
  621. package/src_old/global.css +275 -0
  622. package/src_old/index.ts +72 -0
  623. package/tsconfig.json +16 -0
  624. package/tsconfig.lib.json +41 -0
  625. package/vite.config.ts +67 -0
@@ -0,0 +1,186 @@
1
+ import { useEffect, useRef, useState } from 'react'
2
+
3
+ /** The hook internal state. */
4
+ type State = {
5
+ /** A boolean indicating if the element is intersecting. */
6
+ isIntersecting: boolean
7
+ /** The intersection observer entry. */
8
+ entry?: IntersectionObserverEntry
9
+ }
10
+
11
+ /** Represents the options for configuring the Intersection Observer. */
12
+ type UseIntersectionObserverOptions = {
13
+ /**
14
+ * The element that is used as the viewport for checking visibility of the target.
15
+ * @default null
16
+ */
17
+ root?: Element | Document | null
18
+ /**
19
+ * A margin around the root.
20
+ * @default '0%'
21
+ */
22
+ rootMargin?: string
23
+ /**
24
+ * A threshold indicating the percentage of the target's visibility needed to trigger the callback.
25
+ * @default 0
26
+ */
27
+ threshold?: number | number[]
28
+ /**
29
+ * If true, freezes the intersection state once the element becomes visible.
30
+ * @default false
31
+ */
32
+ freezeOnceVisible?: boolean
33
+ /**
34
+ * A callback function to be invoked when the intersection state changes.
35
+ * @param {boolean} isIntersecting - A boolean indicating if the element is intersecting.
36
+ * @param {IntersectionObserverEntry} entry - The intersection observer Entry.
37
+ * @default undefined
38
+ */
39
+ onChange?: (isIntersecting: boolean, entry: IntersectionObserverEntry) => void
40
+ /**
41
+ * The initial state of the intersection.
42
+ * @default false
43
+ */
44
+ initialIsIntersecting?: boolean
45
+ }
46
+
47
+ /**
48
+ * The return type of the useIntersectionObserver hook.
49
+ *
50
+ * Supports both tuple and object destructing.
51
+ * @param {(node: Element | null) => void} ref - The ref callback function.
52
+ * @param {boolean} isIntersecting - A boolean indicating if the element is intersecting.
53
+ * @param {IntersectionObserverEntry | undefined} entry - The intersection observer Entry.
54
+ */
55
+ type IntersectionReturn = [
56
+ (node?: Element | null) => void,
57
+ boolean,
58
+ IntersectionObserverEntry | undefined,
59
+ ] & {
60
+ ref: (node?: Element | null) => void
61
+ isIntersecting: boolean
62
+ entry?: IntersectionObserverEntry
63
+ }
64
+
65
+ /**
66
+ * Custom hook that tracks the intersection of a DOM element with its containing element or the viewport using the [`Intersection Observer API`](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API).
67
+ * @param {UseIntersectionObserverOptions} options - The options for the Intersection Observer.
68
+ * @returns {IntersectionReturn} The ref callback, a boolean indicating if the element is intersecting, and the intersection observer entry.
69
+ * @public
70
+ * @see [Documentation](https://usehooks-ts.com/react-hook/use-intersection-observer)
71
+ * @example
72
+ * ```tsx
73
+ * // Example 1
74
+ * const [ref, isIntersecting, entry] = useIntersectionObserver({ threshold: 0.5 });
75
+ * ```
76
+ *
77
+ * ```tsx
78
+ * // Example 2
79
+ * const { ref, isIntersecting, entry } = useIntersectionObserver({ threshold: 0.5 });
80
+ * ```
81
+ */
82
+ export function useIntersectionObserver({
83
+ threshold = 0,
84
+ root = null,
85
+ rootMargin = '0%',
86
+ freezeOnceVisible = false,
87
+ initialIsIntersecting = false,
88
+ onChange,
89
+ }: UseIntersectionObserverOptions = {}): IntersectionReturn {
90
+ const [ref, setRef] = useState<Element | null>(null)
91
+
92
+ const [state, setState] = useState<State>(() => ({
93
+ isIntersecting: initialIsIntersecting,
94
+ entry: undefined,
95
+ }))
96
+
97
+ const callbackRef = useRef<UseIntersectionObserverOptions['onChange']>(null)
98
+
99
+ callbackRef.current = onChange
100
+
101
+ const frozen = state.entry?.isIntersecting && freezeOnceVisible
102
+
103
+ useEffect(() => {
104
+ // Ensure we have a ref to observe
105
+ if (!ref) return
106
+
107
+ // Ensure the browser supports the Intersection Observer API
108
+ if (!('IntersectionObserver' in window)) return
109
+
110
+ // Skip if frozen
111
+ if (frozen) return
112
+
113
+ let unobserve: (() => void) | undefined
114
+
115
+ const observer = new IntersectionObserver(
116
+ (entries: IntersectionObserverEntry[]): void => {
117
+ const thresholds = Array.isArray(observer.thresholds)
118
+ ? observer.thresholds
119
+ : [observer.thresholds]
120
+
121
+ entries.forEach(entry => {
122
+ const isIntersecting =
123
+ entry.isIntersecting &&
124
+ thresholds.some(threshold => entry.intersectionRatio >= threshold)
125
+
126
+ setState({ isIntersecting, entry })
127
+
128
+ if (callbackRef.current) {
129
+ callbackRef.current(isIntersecting, entry)
130
+ }
131
+
132
+ if (isIntersecting && freezeOnceVisible && unobserve) {
133
+ unobserve()
134
+ unobserve = undefined
135
+ }
136
+ })
137
+ },
138
+ { threshold, root, rootMargin },
139
+ )
140
+
141
+ observer.observe(ref)
142
+
143
+ return () => {
144
+ observer.disconnect()
145
+ }
146
+
147
+ // eslint-disable-next-line react-hooks/exhaustive-deps
148
+ }, [
149
+ ref,
150
+ // eslint-disable-next-line react-hooks/exhaustive-deps
151
+ JSON.stringify(threshold),
152
+ root,
153
+ rootMargin,
154
+ frozen,
155
+ freezeOnceVisible,
156
+ ])
157
+
158
+ // ensures that if the observed element changes, the intersection observer is reinitialized
159
+ const prevRef = useRef<Element | null>(null)
160
+
161
+ useEffect(() => {
162
+ if (
163
+ !ref &&
164
+ state.entry?.target &&
165
+ !freezeOnceVisible &&
166
+ !frozen &&
167
+ prevRef.current !== state.entry.target
168
+ ) {
169
+ prevRef.current = state.entry.target
170
+ setState({ isIntersecting: initialIsIntersecting, entry: undefined })
171
+ }
172
+ }, [ref, state.entry, freezeOnceVisible, frozen, initialIsIntersecting])
173
+
174
+ const result = [
175
+ setRef,
176
+ !!state.isIntersecting,
177
+ state.entry,
178
+ ] as IntersectionReturn
179
+
180
+ // Support object destructuring, by adding the specific values.
181
+ result.ref = result[0]
182
+ result.isIntersecting = result[1]
183
+ result.entry = result[2]
184
+
185
+ return result
186
+ }
@@ -0,0 +1 @@
1
+ export * from './useInterval'
@@ -0,0 +1,43 @@
1
+ import { useEffect, useRef } from 'react'
2
+
3
+ import { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect'
4
+
5
+ /**
6
+ * Custom hook that creates an interval that invokes a callback function at a specified delay using the [`setInterval API`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval).
7
+ * @param {() => void} callback - The function to be invoked at each interval.
8
+ * @param {number | null} delay - The time, in milliseconds, between each invocation of the callback. Use `null` to clear the interval.
9
+ * @public
10
+ * @see [Documentation](https://usehooks-ts.com/react-hook/use-interval)
11
+ * @example
12
+ * ```tsx
13
+ * const handleInterval = () => {
14
+ * // Code to be executed at each interval
15
+ * };
16
+ * useInterval(handleInterval, 1000);
17
+ * ```
18
+ */
19
+ export function useInterval(callback: () => void, delay: number | null) {
20
+ const savedCallback = useRef(callback)
21
+
22
+ // Remember the latest callback if it changes.
23
+ useIsomorphicLayoutEffect(() => {
24
+ savedCallback.current = callback
25
+ }, [callback])
26
+
27
+ // Set up the interval.
28
+ useEffect(() => {
29
+ // Don't schedule if no delay is specified.
30
+ // Note: 0 is a valid value for delay.
31
+ if (delay === null) {
32
+ return
33
+ }
34
+
35
+ const id = setInterval(() => {
36
+ savedCallback.current()
37
+ }, delay)
38
+
39
+ return () => {
40
+ clearInterval(id)
41
+ }
42
+ }, [delay])
43
+ }
@@ -0,0 +1 @@
1
+ export * from './useIsClient'
@@ -0,0 +1,22 @@
1
+ import { useEffect, useState } from 'react'
2
+
3
+ /**
4
+ * Custom hook that determines if the code is running on the client side (in the browser).
5
+ * @returns {boolean} A boolean value indicating whether the code is running on the client side.
6
+ * @public
7
+ * @see [Documentation](https://usehooks-ts.com/react-hook/use-is-client)
8
+ * @example
9
+ * ```tsx
10
+ * const isClient = useIsClient();
11
+ * // Use isClient to conditionally render or execute code specific to the client side.
12
+ * ```
13
+ */
14
+ export function useIsClient() {
15
+ const [isClient, setClient] = useState(false)
16
+
17
+ useEffect(() => {
18
+ setClient(true)
19
+ }, [])
20
+
21
+ return isClient
22
+ }
@@ -0,0 +1,2 @@
1
+ export * from './useIsMobile'
2
+ export type * from './types'
@@ -0,0 +1,3 @@
1
+ export interface IUseIsMobileParams {
2
+ mobileBreakpoint?: number;
3
+ }
@@ -0,0 +1,23 @@
1
+ import * as React from "react"
2
+ import { IUseIsMobileParams } from './types';
3
+
4
+ const DEFAULT_MOBILE_BREAKPOINT = 768
5
+
6
+ export function useIsMobile(params: IUseIsMobileParams = {}) {
7
+ const {
8
+ mobileBreakpoint = DEFAULT_MOBILE_BREAKPOINT
9
+ } = params;
10
+ const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)
11
+
12
+ React.useEffect(() => {
13
+ const mql = window.matchMedia(`(max-width: ${mobileBreakpoint - 1}px)`)
14
+ const onChange = () => {
15
+ setIsMobile(window.innerWidth < mobileBreakpoint)
16
+ }
17
+ mql.addEventListener("change", onChange)
18
+ setIsMobile(window.innerWidth < mobileBreakpoint)
19
+ return () => mql.removeEventListener("change", onChange)
20
+ }, [mobileBreakpoint])
21
+
22
+ return !!isMobile
23
+ }
@@ -0,0 +1 @@
1
+ export * from './useIsMounted'
@@ -0,0 +1,15 @@
1
+ import { useCallback, useEffect, useRef } from 'react'
2
+
3
+ export function useIsMounted(): () => boolean {
4
+ const isMounted = useRef(false)
5
+
6
+ useEffect(() => {
7
+ isMounted.current = true
8
+
9
+ return () => {
10
+ isMounted.current = false
11
+ }
12
+ }, [])
13
+
14
+ return useCallback(() => isMounted.current, [])
15
+ }
@@ -0,0 +1 @@
1
+ export * from './useIsomorphicLayoutEffect'
@@ -0,0 +1,17 @@
1
+ import { useEffect, useLayoutEffect } from 'react'
2
+
3
+ /**
4
+ * Custom hook that uses either `useLayoutEffect` or `useEffect` based on the environment (client-side or server-side).
5
+ * @param {Function} effect - The effect function to be executed.
6
+ * @param {Array<any>} [dependencies] - An array of dependencies for the effect (optional).
7
+ * @public
8
+ * @see [Documentation](https://usehooks-ts.com/react-hook/use-isomorphic-layout-effect)
9
+ * @example
10
+ * ```tsx
11
+ * useIsomorphicLayoutEffect(() => {
12
+ * // Code to be executed during the layout phase on the client side
13
+ * }, [dependency1, dependency2]);
14
+ * ```
15
+ */
16
+ export const useIsomorphicLayoutEffect =
17
+ typeof window !== 'undefined' ? useLayoutEffect : useEffect
@@ -0,0 +1 @@
1
+ export * from './useLocalStorage'
@@ -0,0 +1,191 @@
1
+ import { useCallback, useEffect, useState } from 'react'
2
+
3
+ import type { Dispatch, SetStateAction } from 'react'
4
+
5
+ import { useEventCallback } from '../useEventCallback'
6
+ import { useEventListener } from '../useEventListener'
7
+
8
+ declare global {
9
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
10
+ interface WindowEventMap {
11
+ 'local-storage': CustomEvent
12
+ }
13
+ }
14
+
15
+ /**
16
+ * Options for customizing the behavior of serialization and deserialization.
17
+ * @template T - The type of the state to be stored in local storage.
18
+ */
19
+ type UseLocalStorageOptions<T> = {
20
+ /** A function to serialize the value before storing it. */
21
+ serializer?: (value: T) => string
22
+ /** A function to deserialize the stored value. */
23
+ deserializer?: (value: string) => T
24
+ /**
25
+ * If `true` (default), the hook will initialize reading the local storage. In SSR, you should set it to `false`, returning the initial value initially.
26
+ * @default true
27
+ */
28
+ initializeWithValue?: boolean
29
+ }
30
+
31
+ const IS_SERVER = typeof window === 'undefined'
32
+
33
+ /**
34
+ * Custom hook that uses the [`localStorage API`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) to persist state across page reloads.
35
+ * @template T - The type of the state to be stored in local storage.
36
+ * @param {string} key - The key under which the value will be stored in local storage.
37
+ * @param {T | (() => T)} initialValue - The initial value of the state or a function that returns the initial value.
38
+ * @param {UseLocalStorageOptions<T>} [options] - Options for customizing the behavior of serialization and deserialization (optional).
39
+ * @returns {[T, Dispatch<SetStateAction<T>>, () => void]} A tuple containing the stored value, a function to set the value and a function to remove the key from storage.
40
+ * @public
41
+ * @see [Documentation](https://usehooks-ts.com/react-hook/use-local-storage)
42
+ * @example
43
+ * ```tsx
44
+ * const [count, setCount, removeCount] = useLocalStorage('count', 0);
45
+ * // Access the `count` value, the `setCount` function to update it and `removeCount` function to remove the key from storage.
46
+ * ```
47
+ */
48
+ export function useLocalStorage<T>(
49
+ key: string,
50
+ initialValue: T | (() => T),
51
+ options: UseLocalStorageOptions<T> = {},
52
+ ): [T, Dispatch<SetStateAction<T>>, () => void] {
53
+ const { initializeWithValue = true } = options
54
+
55
+ const serializer = useCallback<(value: T) => string>(
56
+ value => {
57
+ if (options.serializer) {
58
+ return options.serializer(value)
59
+ }
60
+
61
+ return JSON.stringify(value)
62
+ },
63
+ [options],
64
+ )
65
+
66
+ const deserializer = useCallback<(value: string) => T>(
67
+ value => {
68
+ if (options.deserializer) {
69
+ return options.deserializer(value)
70
+ }
71
+ // Support 'undefined' as a value
72
+ if (value === 'undefined') {
73
+ return undefined as unknown as T
74
+ }
75
+
76
+ const defaultValue =
77
+ initialValue instanceof Function ? initialValue() : initialValue
78
+
79
+ let parsed: unknown
80
+ try {
81
+ parsed = JSON.parse(value)
82
+ } catch (error) {
83
+ console.error('Error parsing JSON:', error)
84
+ return defaultValue // Return initialValue if parsing fails
85
+ }
86
+
87
+ return parsed as T
88
+ },
89
+ [options, initialValue],
90
+ )
91
+
92
+ // Get from local storage then
93
+ // parse stored json or return initialValue
94
+ const readValue = useCallback((): T => {
95
+ const initialValueToUse =
96
+ initialValue instanceof Function ? initialValue() : initialValue
97
+
98
+ // Prevent build error "window is undefined" but keep working
99
+ if (IS_SERVER) {
100
+ return initialValueToUse
101
+ }
102
+
103
+ try {
104
+ const raw = window.localStorage.getItem(key)
105
+ return raw ? deserializer(raw) : initialValueToUse
106
+ } catch (error) {
107
+ console.warn(`Error reading localStorage key “${key}”:`, error)
108
+ return initialValueToUse
109
+ }
110
+ }, [initialValue, key, deserializer])
111
+
112
+ const [storedValue, setStoredValue] = useState(() => {
113
+ if (initializeWithValue) {
114
+ return readValue()
115
+ }
116
+
117
+ return initialValue instanceof Function ? initialValue() : initialValue
118
+ })
119
+
120
+ // Return a wrapped version of useState's setter function that ...
121
+ // ... persists the new value to localStorage.
122
+ const setValue: Dispatch<SetStateAction<T>> = useEventCallback(value => {
123
+ // Prevent build error "window is undefined" but keeps working
124
+ if (IS_SERVER) {
125
+ console.warn(
126
+ `Tried setting localStorage key “${key}” even though environment is not a client`,
127
+ )
128
+ }
129
+
130
+ try {
131
+ // Allow value to be a function so we have the same API as useState
132
+ const newValue = value instanceof Function ? value(readValue()) : value
133
+
134
+ // Save to local storage
135
+ window.localStorage.setItem(key, serializer(newValue))
136
+
137
+ // Save state
138
+ setStoredValue(newValue)
139
+
140
+ // We dispatch a custom event so every similar useLocalStorage hook is notified
141
+ window.dispatchEvent(new StorageEvent('local-storage', { key }))
142
+ } catch (error) {
143
+ console.warn(`Error setting localStorage key “${key}”:`, error)
144
+ }
145
+ })
146
+
147
+ const removeValue = useEventCallback(() => {
148
+ // Prevent build error "window is undefined" but keeps working
149
+ if (IS_SERVER) {
150
+ console.warn(
151
+ `Tried removing localStorage key “${key}” even though environment is not a client`,
152
+ )
153
+ }
154
+
155
+ const defaultValue =
156
+ initialValue instanceof Function ? initialValue() : initialValue
157
+
158
+ // Remove the key from local storage
159
+ window.localStorage.removeItem(key)
160
+
161
+ // Save state with default value
162
+ setStoredValue(defaultValue)
163
+
164
+ // We dispatch a custom event so every similar useLocalStorage hook is notified
165
+ window.dispatchEvent(new StorageEvent('local-storage', { key }))
166
+ })
167
+
168
+ useEffect(() => {
169
+ setStoredValue(readValue())
170
+ // eslint-disable-next-line react-hooks/exhaustive-deps
171
+ }, [key])
172
+
173
+ const handleStorageChange = useCallback(
174
+ (event: StorageEvent | CustomEvent) => {
175
+ if ((event as StorageEvent).key && (event as StorageEvent).key !== key) {
176
+ return
177
+ }
178
+ setStoredValue(readValue())
179
+ },
180
+ [key, readValue],
181
+ )
182
+
183
+ // this only works for other documents, not the current one
184
+ useEventListener('storage', handleStorageChange)
185
+
186
+ // this is a custom event, triggered in writeValueToLocalStorage
187
+ // See: useLocalStorage()
188
+ useEventListener('local-storage', handleStorageChange)
189
+
190
+ return [storedValue, setValue, removeValue]
191
+ }
@@ -0,0 +1 @@
1
+ export * from './useLockBody'
@@ -0,0 +1,12 @@
1
+ import * as React from "react"
2
+
3
+ // @see https://usehooks.com/useLockBodyScroll.
4
+ export function useLockBody() {
5
+ React.useLayoutEffect((): (() => void) => {
6
+ const originalStyle: string = window.getComputedStyle(
7
+ document.body
8
+ ).overflow
9
+ document.body.style.overflow = "hidden"
10
+ return () => (document.body.style.overflow = originalStyle)
11
+ }, [])
12
+ }
@@ -0,0 +1 @@
1
+ export * from './useMap'
@@ -0,0 +1,83 @@
1
+ import { useCallback, useState } from 'react'
2
+
3
+ /**
4
+ * Represents the type for either a Map or an array of key-value pairs.
5
+ * @template K - The type of keys in the map.
6
+ * @template V - The type of values in the map.
7
+ */
8
+ type MapOrEntries<K, V> = Map<K, V> | [K, V][]
9
+
10
+ /**
11
+ * Represents the actions available to interact with the map state.
12
+ * @template K - The type of keys in the map.
13
+ * @template V - The type of values in the map.
14
+ */
15
+ type UseMapActions<K, V> = {
16
+ /** Set a key-value pair in the map. */
17
+ set: (key: K, value: V) => void
18
+ /** Set all key-value pairs in the map. */
19
+ setAll: (entries: MapOrEntries<K, V>) => void
20
+ /** Remove a key-value pair from the map. */
21
+ remove: (key: K) => void
22
+ /** Reset the map to an empty state. */
23
+ reset: Map<K, V>['clear']
24
+ }
25
+
26
+ /**
27
+ * Represents the return type of the `useMap` hook.
28
+ * We hide some setters from the returned map to disable autocompletion.
29
+ * @template K - The type of keys in the map.
30
+ * @template V - The type of values in the map.
31
+ */
32
+ type UseMapReturn<K, V> = [
33
+ Omit<Map<K, V>, 'set' | 'clear' | 'delete'>,
34
+ UseMapActions<K, V>,
35
+ ]
36
+
37
+ /**
38
+ * Custom hook that manages a key-value [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) state with setter actions.
39
+ * @template K - The type of keys in the map.
40
+ * @template V - The type of values in the map.
41
+ * @param {MapOrEntries<K, V>} [initialState] - The initial state of the map as a Map or an array of key-value pairs (optional).
42
+ * @returns {UseMapReturn<K, V>} A tuple containing the map state and actions to interact with the map.
43
+ * @public
44
+ * @see [Documentation](https://usehooks-ts.com/react-hook/use-map)
45
+ * @example
46
+ * ```tsx
47
+ * const [map, mapActions] = useMap();
48
+ * // Access the `map` state and use `mapActions` to set, remove, or reset entries.
49
+ * ```
50
+ */
51
+ export function useMap<K, V>(
52
+ initialState: MapOrEntries<K, V> = new Map(),
53
+ ): UseMapReturn<K, V> {
54
+ const [map, setMap] = useState(new Map(initialState))
55
+
56
+ const actions: UseMapActions<K, V> = {
57
+ set: useCallback((key, value) => {
58
+ setMap(prev => {
59
+ const copy = new Map(prev)
60
+ copy.set(key, value)
61
+ return copy
62
+ })
63
+ }, []),
64
+
65
+ setAll: useCallback(entries => {
66
+ setMap(() => new Map(entries))
67
+ }, []),
68
+
69
+ remove: useCallback(key => {
70
+ setMap(prev => {
71
+ const copy = new Map(prev)
72
+ copy.delete(key)
73
+ return copy
74
+ })
75
+ }, []),
76
+
77
+ reset: useCallback(() => {
78
+ setMap(() => new Map())
79
+ }, []),
80
+ }
81
+
82
+ return [map, actions]
83
+ }
@@ -0,0 +1 @@
1
+ export * from './useMediaQuery'