@forgedevstack/bear 1.0.2 → 1.0.4-alpha

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 (352) hide show
  1. package/dist/components/Accordion/Accordion.cjs +1 -1
  2. package/dist/components/Accordion/Accordion.const.cjs +1 -0
  3. package/dist/components/Accordion/Accordion.const.d.ts +10 -0
  4. package/dist/components/Accordion/Accordion.const.js +8 -0
  5. package/dist/components/Accordion/Accordion.d.ts +1 -0
  6. package/dist/components/Accordion/Accordion.js +49 -44
  7. package/dist/components/Accordion/Accordion.types.d.ts +2 -0
  8. package/dist/components/Accordion/index.d.ts +3 -2
  9. package/dist/components/ActiveBar/ActiveBar.cjs +8 -0
  10. package/dist/components/ActiveBar/ActiveBar.d.ts +2 -0
  11. package/dist/components/ActiveBar/ActiveBar.js +90 -0
  12. package/dist/components/ActiveBar/ActiveBar.types.d.ts +16 -0
  13. package/dist/components/ActiveBar/index.d.ts +2 -0
  14. package/dist/components/ActivityItem/ActivityItem.cjs +1 -0
  15. package/dist/components/ActivityItem/ActivityItem.d.ts +7 -0
  16. package/dist/components/ActivityItem/ActivityItem.js +44 -0
  17. package/dist/components/ActivityItem/ActivityItem.types.d.ts +17 -0
  18. package/dist/components/ActivityItem/index.d.ts +2 -0
  19. package/dist/components/Alert/Alert.cjs +1 -1
  20. package/dist/components/Alert/Alert.const.cjs +1 -0
  21. package/dist/components/Alert/Alert.const.d.ts +14 -0
  22. package/dist/components/Alert/Alert.const.js +27 -0
  23. package/dist/components/Alert/Alert.js +54 -63
  24. package/dist/components/Alert/Alert.types.d.ts +3 -1
  25. package/dist/components/Avatar/Avatar.cjs +1 -1
  26. package/dist/components/Avatar/Avatar.const.cjs +1 -0
  27. package/dist/components/Avatar/Avatar.const.d.ts +28 -0
  28. package/dist/components/Avatar/Avatar.const.js +28 -0
  29. package/dist/components/Avatar/Avatar.js +49 -60
  30. package/dist/components/Avatar/index.d.ts +1 -0
  31. package/dist/components/Badge/Badge.cjs +1 -1
  32. package/dist/components/Badge/Badge.js +24 -22
  33. package/dist/components/BearLogo/EmberLogo.cjs +17 -0
  34. package/dist/components/BearLogo/EmberLogo.js +91 -0
  35. package/dist/components/BearLogo/index.d.ts +2 -0
  36. package/dist/components/Box/Box.cjs +1 -0
  37. package/dist/components/Box/Box.d.ts +2 -0
  38. package/dist/components/Box/Box.js +64 -0
  39. package/dist/components/Box/Box.types.d.ts +24 -0
  40. package/dist/components/Box/Box.utils.cjs +1 -0
  41. package/dist/components/Box/Box.utils.d.ts +3 -0
  42. package/dist/components/Box/Box.utils.js +21 -0
  43. package/dist/components/Box/index.d.ts +2 -0
  44. package/dist/components/Breadcrumbs/Breadcrumbs.cjs +1 -1
  45. package/dist/components/Breadcrumbs/Breadcrumbs.const.cjs +1 -0
  46. package/dist/components/Breadcrumbs/Breadcrumbs.const.d.ts +16 -0
  47. package/dist/components/Breadcrumbs/Breadcrumbs.const.js +19 -0
  48. package/dist/components/Breadcrumbs/Breadcrumbs.js +49 -34
  49. package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +8 -1
  50. package/dist/components/Button/Button.cjs +1 -1
  51. package/dist/components/Button/Button.constants.cjs +1 -1
  52. package/dist/components/Button/Button.constants.d.ts +2 -2
  53. package/dist/components/Button/Button.constants.js +2 -2
  54. package/dist/components/Button/Button.js +41 -46
  55. package/dist/components/Calendar/Calendar.cjs +1 -1
  56. package/dist/components/Calendar/Calendar.const.cjs +1 -0
  57. package/dist/components/Calendar/Calendar.const.d.ts +18 -0
  58. package/dist/components/Calendar/Calendar.const.js +27 -0
  59. package/dist/components/Calendar/Calendar.helpers.cjs +1 -0
  60. package/dist/components/Calendar/Calendar.helpers.d.ts +10 -0
  61. package/dist/components/Calendar/Calendar.helpers.js +9 -0
  62. package/dist/components/Calendar/Calendar.js +132 -149
  63. package/dist/components/Calendar/Calendar.types.d.ts +4 -0
  64. package/dist/components/Calendar/Calendar.utils.cjs +1 -0
  65. package/dist/components/Calendar/Calendar.utils.d.ts +41 -0
  66. package/dist/components/Calendar/Calendar.utils.js +33 -0
  67. package/dist/components/Calendar/index.d.ts +2 -0
  68. package/dist/components/Card/Card.cjs +1 -1
  69. package/dist/components/Card/Card.const.cjs +1 -0
  70. package/dist/components/Card/Card.const.d.ts +13 -0
  71. package/dist/components/Card/Card.const.js +32 -0
  72. package/dist/components/Card/Card.d.ts +1 -0
  73. package/dist/components/Card/Card.js +101 -105
  74. package/dist/components/Card/index.d.ts +3 -2
  75. package/dist/components/Chart/Chart.cjs +1 -0
  76. package/dist/components/Chart/Chart.const.d.ts +15 -0
  77. package/dist/components/Chart/Chart.d.ts +18 -0
  78. package/dist/components/Chart/Chart.js +225 -0
  79. package/dist/components/Chart/Chart.types.d.ts +51 -0
  80. package/dist/components/Chart/Chart.utils.d.ts +31 -0
  81. package/dist/components/Chart/index.d.ts +2 -0
  82. package/dist/components/CodeBlock/CodeBlock.cjs +2 -0
  83. package/dist/components/CodeBlock/CodeBlock.d.ts +2 -0
  84. package/dist/components/CodeBlock/CodeBlock.js +68 -0
  85. package/dist/components/CodeBlock/CodeBlock.types.d.ts +21 -0
  86. package/dist/components/CodeBlock/index.d.ts +2 -0
  87. package/dist/components/Columns/Columns.cjs +1 -0
  88. package/dist/components/Columns/Columns.d.ts +5 -0
  89. package/dist/components/Columns/Columns.js +54 -0
  90. package/dist/components/Columns/Columns.types.d.ts +17 -0
  91. package/dist/components/Columns/index.d.ts +2 -0
  92. package/dist/components/DateTimePicker/DateTimePicker.cjs +1 -1
  93. package/dist/components/DateTimePicker/DateTimePicker.js +28 -28
  94. package/dist/components/Editable/Editable.cjs +1 -0
  95. package/dist/components/Editable/Editable.d.ts +10 -0
  96. package/dist/components/Editable/Editable.js +194 -0
  97. package/dist/components/Editable/Editable.types.d.ts +39 -0
  98. package/dist/components/Editable/index.d.ts +2 -0
  99. package/dist/components/Em/Em.cjs +1 -0
  100. package/dist/components/Em/Em.d.ts +2 -0
  101. package/dist/components/Em/Em.js +24 -0
  102. package/dist/components/Em/Em.types.d.ts +5 -0
  103. package/dist/components/Em/index.d.ts +2 -0
  104. package/dist/components/Fab/Fab.cjs +1 -1
  105. package/dist/components/Fab/Fab.js +9 -9
  106. package/dist/components/Gauge/Gauge.cjs +1 -0
  107. package/dist/components/Gauge/Gauge.d.ts +3 -0
  108. package/dist/components/Gauge/Gauge.js +92 -0
  109. package/dist/components/Gauge/Gauge.types.d.ts +27 -0
  110. package/dist/components/Gauge/index.d.ts +2 -0
  111. package/dist/components/Highlight/Highlight.cjs +1 -0
  112. package/dist/components/Highlight/Highlight.d.ts +2 -0
  113. package/dist/components/Highlight/Highlight.js +28 -0
  114. package/dist/components/Highlight/Highlight.types.d.ts +6 -0
  115. package/dist/components/Highlight/index.d.ts +2 -0
  116. package/dist/components/HoverCard/HoverCard.cjs +6 -0
  117. package/dist/components/HoverCard/HoverCard.d.ts +2 -0
  118. package/dist/components/HoverCard/HoverCard.js +68 -0
  119. package/dist/components/HoverCard/HoverCard.types.d.ts +13 -0
  120. package/dist/components/HoverCard/HoverCard.utils.cjs +1 -0
  121. package/dist/components/HoverCard/HoverCard.utils.d.ts +2 -0
  122. package/dist/components/HoverCard/HoverCard.utils.js +23 -0
  123. package/dist/components/HoverCard/index.d.ts +2 -0
  124. package/dist/components/Icon/icons/editor.cjs +1 -1
  125. package/dist/components/Icon/icons/editor.d.ts +1 -0
  126. package/dist/components/Icon/icons/editor.js +66 -61
  127. package/dist/components/Icon/icons/misc.cjs +1 -1
  128. package/dist/components/Icon/icons/misc.d.ts +13 -0
  129. package/dist/components/Icon/icons/misc.js +157 -88
  130. package/dist/components/Icon/icons/status.js +1 -1
  131. package/dist/components/Icon/index.cjs +1 -1
  132. package/dist/components/Icon/index.d.ts +27 -0
  133. package/dist/components/Icon/index.js +28 -21
  134. package/dist/components/Input/Input.cjs +1 -1
  135. package/dist/components/Input/Input.js +36 -35
  136. package/dist/components/Mark/Mark.cjs +1 -0
  137. package/dist/components/Mark/Mark.d.ts +2 -0
  138. package/dist/components/Mark/Mark.js +26 -0
  139. package/dist/components/Mark/Mark.types.d.ts +5 -0
  140. package/dist/components/Mark/index.d.ts +2 -0
  141. package/dist/components/Modal/Modal.cjs +1 -1
  142. package/dist/components/Modal/Modal.const.cjs +1 -0
  143. package/dist/components/Modal/Modal.const.d.ts +10 -0
  144. package/dist/components/Modal/Modal.const.js +17 -0
  145. package/dist/components/Modal/Modal.d.ts +11 -0
  146. package/dist/components/Modal/Modal.js +80 -77
  147. package/dist/components/Modal/Modal.types.d.ts +6 -1
  148. package/dist/components/Modal/index.d.ts +3 -2
  149. package/dist/components/Rating/Rating.cjs +1 -1
  150. package/dist/components/Rating/Rating.const.cjs +1 -0
  151. package/dist/components/Rating/Rating.const.d.ts +14 -0
  152. package/dist/components/Rating/Rating.const.js +22 -0
  153. package/dist/components/Rating/Rating.d.ts +5 -10
  154. package/dist/components/Rating/Rating.js +135 -93
  155. package/dist/components/Rating/Rating.types.d.ts +27 -25
  156. package/dist/components/Rating/index.d.ts +2 -2
  157. package/dist/components/RichEditor/RichEditor.cjs +1 -0
  158. package/dist/components/RichEditor/RichEditor.const.cjs +141 -0
  159. package/dist/components/RichEditor/RichEditor.const.d.ts +137 -0
  160. package/dist/components/RichEditor/RichEditor.const.js +279 -0
  161. package/dist/components/RichEditor/RichEditor.d.ts +18 -0
  162. package/dist/components/RichEditor/RichEditor.js +363 -0
  163. package/dist/components/RichEditor/RichEditor.types.d.ts +57 -0
  164. package/dist/components/RichEditor/components/ToolbarButton/ToolbarButton.cjs +1 -0
  165. package/dist/components/RichEditor/components/ToolbarButton/ToolbarButton.d.ts +4 -0
  166. package/dist/components/RichEditor/components/ToolbarButton/ToolbarButton.js +25 -0
  167. package/dist/components/RichEditor/components/ToolbarButton/index.d.ts +1 -0
  168. package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.cjs +1 -0
  169. package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.d.ts +4 -0
  170. package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.js +126 -0
  171. package/dist/components/RichEditor/components/ToolbarColorPicker/index.d.ts +1 -0
  172. package/dist/components/RichEditor/components/ToolbarDropdown/ToolbarDropdown.cjs +1 -0
  173. package/dist/components/RichEditor/components/ToolbarDropdown/ToolbarDropdown.d.ts +4 -0
  174. package/dist/components/RichEditor/components/ToolbarDropdown/ToolbarDropdown.js +57 -0
  175. package/dist/components/RichEditor/components/ToolbarDropdown/index.d.ts +1 -0
  176. package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.cjs +1 -0
  177. package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.d.ts +7 -0
  178. package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.js +45 -0
  179. package/dist/components/RichEditor/components/ToolbarMore/index.d.ts +2 -0
  180. package/dist/components/RichEditor/components/index.d.ts +4 -0
  181. package/dist/components/RichEditor/helpers/formatHelpers.cjs +1 -0
  182. package/dist/components/RichEditor/helpers/formatHelpers.d.ts +57 -0
  183. package/dist/components/RichEditor/helpers/formatHelpers.js +26 -0
  184. package/dist/components/RichEditor/helpers/index.d.ts +1 -0
  185. package/dist/components/RichEditor/index.d.ts +4 -0
  186. package/dist/components/Sidebar/Sidebar.cjs +1 -0
  187. package/dist/components/Sidebar/Sidebar.const.cjs +1 -0
  188. package/dist/components/Sidebar/Sidebar.const.d.ts +16 -0
  189. package/dist/components/Sidebar/Sidebar.const.js +22 -0
  190. package/dist/components/Sidebar/Sidebar.d.ts +17 -0
  191. package/dist/components/Sidebar/Sidebar.js +70 -0
  192. package/dist/components/Sidebar/Sidebar.types.d.ts +44 -0
  193. package/dist/components/Sidebar/components/SidebarGroup/SidebarGroup.cjs +1 -0
  194. package/dist/components/Sidebar/components/SidebarGroup/SidebarGroup.d.ts +4 -0
  195. package/dist/components/Sidebar/components/SidebarGroup/SidebarGroup.js +45 -0
  196. package/dist/components/Sidebar/components/SidebarGroup/index.d.ts +2 -0
  197. package/dist/components/Sidebar/components/SidebarItem/SidebarItem.cjs +1 -0
  198. package/dist/components/Sidebar/components/SidebarItem/SidebarItem.d.ts +4 -0
  199. package/dist/components/Sidebar/components/SidebarItem/SidebarItem.js +66 -0
  200. package/dist/components/Sidebar/components/SidebarItem/index.d.ts +2 -0
  201. package/dist/components/Sidebar/components/index.d.ts +2 -0
  202. package/dist/components/Sidebar/index.d.ts +5 -0
  203. package/dist/components/SignPad/SignPad.cjs +1 -0
  204. package/dist/components/SignPad/SignPad.const.cjs +1 -0
  205. package/dist/components/SignPad/SignPad.const.d.ts +19 -0
  206. package/dist/components/SignPad/SignPad.const.js +20 -0
  207. package/dist/components/SignPad/SignPad.d.ts +17 -0
  208. package/dist/components/SignPad/SignPad.js +161 -0
  209. package/dist/components/SignPad/SignPad.types.d.ts +37 -0
  210. package/dist/components/SignPad/index.d.ts +3 -0
  211. package/dist/components/Skeleton/Skeleton.cjs +1 -1
  212. package/dist/components/Skeleton/Skeleton.const.cjs +36 -0
  213. package/dist/components/Skeleton/Skeleton.const.d.ts +12 -0
  214. package/dist/components/Skeleton/Skeleton.const.js +58 -0
  215. package/dist/components/Skeleton/Skeleton.d.ts +15 -24
  216. package/dist/components/Skeleton/Skeleton.js +132 -103
  217. package/dist/components/Skeleton/Skeleton.types.d.ts +18 -8
  218. package/dist/components/Skeleton/index.d.ts +2 -2
  219. package/dist/components/Slider/Slider.cjs +1 -1
  220. package/dist/components/Slider/Slider.js +8 -8
  221. package/dist/components/Sparkline/Sparkline.cjs +1 -0
  222. package/dist/components/Sparkline/Sparkline.const.cjs +1 -0
  223. package/dist/components/Sparkline/Sparkline.const.d.ts +16 -0
  224. package/dist/components/Sparkline/Sparkline.const.js +16 -0
  225. package/dist/components/Sparkline/Sparkline.d.ts +3 -0
  226. package/dist/components/Sparkline/Sparkline.js +80 -0
  227. package/dist/components/Sparkline/Sparkline.types.d.ts +19 -0
  228. package/dist/components/Sparkline/Sparkline.utils.cjs +1 -0
  229. package/dist/components/Sparkline/Sparkline.utils.d.ts +27 -0
  230. package/dist/components/Sparkline/Sparkline.utils.js +30 -0
  231. package/dist/components/Sparkline/index.d.ts +5 -0
  232. package/dist/components/SpeedDial/SpeedDial.cjs +12 -1
  233. package/dist/components/SpeedDial/SpeedDial.const.cjs +1 -0
  234. package/dist/components/SpeedDial/SpeedDial.const.d.ts +22 -0
  235. package/dist/components/SpeedDial/SpeedDial.const.js +26 -0
  236. package/dist/components/SpeedDial/SpeedDial.d.ts +5 -7
  237. package/dist/components/SpeedDial/SpeedDial.js +154 -144
  238. package/dist/components/SpeedDial/SpeedDial.types.d.ts +26 -29
  239. package/dist/components/SpeedDial/index.d.ts +1 -1
  240. package/dist/components/Spinner/Spinner.cjs +1 -1
  241. package/dist/components/Spinner/Spinner.js +17 -15
  242. package/dist/components/StatCard/StatCard.cjs +1 -0
  243. package/dist/components/StatCard/StatCard.d.ts +7 -0
  244. package/dist/components/StatCard/StatCard.js +36 -0
  245. package/dist/components/StatCard/StatCard.types.d.ts +13 -0
  246. package/dist/components/StatCard/index.d.ts +2 -0
  247. package/dist/components/Stepper/Stepper.cjs +1 -1
  248. package/dist/components/Stepper/Stepper.const.cjs +1 -0
  249. package/dist/components/Stepper/Stepper.const.d.ts +29 -0
  250. package/dist/components/Stepper/Stepper.const.js +46 -0
  251. package/dist/components/Stepper/Stepper.d.ts +10 -3
  252. package/dist/components/Stepper/Stepper.js +143 -92
  253. package/dist/components/Stepper/Stepper.types.d.ts +63 -13
  254. package/dist/components/Stepper/index.d.ts +2 -2
  255. package/dist/components/Switch/Switch.cjs +1 -1
  256. package/dist/components/Switch/Switch.js +74 -47
  257. package/dist/components/Switch/Switch.types.d.ts +11 -1
  258. package/dist/components/Tabs/Tabs.cjs +1 -1
  259. package/dist/components/Tabs/Tabs.js +33 -29
  260. package/dist/components/TimePicker/TimePicker.cjs +1 -1
  261. package/dist/components/TimePicker/TimePicker.constants.cjs +1 -1
  262. package/dist/components/TimePicker/TimePicker.constants.d.ts +14 -0
  263. package/dist/components/TimePicker/TimePicker.constants.js +18 -4
  264. package/dist/components/TimePicker/TimePicker.js +92 -91
  265. package/dist/components/Timeline/Timeline.cjs +1 -1
  266. package/dist/components/Timeline/Timeline.const.cjs +1 -0
  267. package/dist/components/Timeline/Timeline.const.d.ts +40 -0
  268. package/dist/components/Timeline/Timeline.const.js +58 -0
  269. package/dist/components/Timeline/Timeline.d.ts +16 -2
  270. package/dist/components/Timeline/Timeline.js +131 -63
  271. package/dist/components/Timeline/Timeline.types.d.ts +30 -11
  272. package/dist/components/Timeline/index.d.ts +1 -1
  273. package/dist/components/Tooltip/Tooltip.cjs +1 -1
  274. package/dist/components/Tooltip/Tooltip.js +37 -35
  275. package/dist/components/Typography/Typography.cjs +1 -1
  276. package/dist/components/Typography/Typography.js +38 -36
  277. package/dist/components/index.cjs +1 -1
  278. package/dist/components/index.d.ts +38 -4
  279. package/dist/components/index.js +213 -168
  280. package/dist/hooks/index.cjs +1 -1
  281. package/dist/hooks/index.d.ts +24 -0
  282. package/dist/hooks/index.js +42 -14
  283. package/dist/hooks/useBounce/index.d.ts +2 -0
  284. package/dist/hooks/useBounce/useBounce.cjs +1 -0
  285. package/dist/hooks/useBounce/useBounce.d.ts +2 -0
  286. package/dist/hooks/useBounce/useBounce.js +36 -0
  287. package/dist/hooks/useBounce/useBounce.types.d.ts +27 -0
  288. package/dist/hooks/useClickOutside/index.d.ts +2 -0
  289. package/dist/hooks/useClickOutside/useClickOutside.d.ts +22 -0
  290. package/dist/hooks/useClickOutside/useClickOutside.types.d.ts +10 -0
  291. package/dist/hooks/useClipboard/index.d.ts +2 -0
  292. package/dist/hooks/useClipboard/useClipboard.cjs +1 -0
  293. package/dist/hooks/useClipboard/useClipboard.d.ts +15 -0
  294. package/dist/hooks/useClipboard/useClipboard.js +22 -0
  295. package/dist/hooks/useClipboard/useClipboard.types.d.ts +20 -0
  296. package/dist/hooks/useDebounce/index.d.ts +2 -0
  297. package/dist/hooks/useDebounce/useDebounce.cjs +1 -0
  298. package/dist/hooks/useDebounce/useDebounce.d.ts +32 -0
  299. package/dist/hooks/useDebounce/useDebounce.js +39 -0
  300. package/dist/hooks/useDebounce/useDebounce.types.d.ts +20 -0
  301. package/dist/hooks/useFloat/index.d.ts +2 -0
  302. package/dist/hooks/useFloat/useFloat.cjs +1 -0
  303. package/dist/hooks/useFloat/useFloat.d.ts +2 -0
  304. package/dist/hooks/useFloat/useFloat.js +37 -0
  305. package/dist/hooks/useFloat/useFloat.types.d.ts +25 -0
  306. package/dist/hooks/useIntersectionObserver/index.d.ts +2 -0
  307. package/dist/hooks/useIntersectionObserver/useIntersectionObserver.cjs +1 -0
  308. package/dist/hooks/useIntersectionObserver/useIntersectionObserver.d.ts +25 -0
  309. package/dist/hooks/useIntersectionObserver/useIntersectionObserver.js +39 -0
  310. package/dist/hooks/useIntersectionObserver/useIntersectionObserver.types.d.ts +22 -0
  311. package/dist/hooks/useKeyPress/index.d.ts +2 -0
  312. package/dist/hooks/useKeyPress/useKeyPress.cjs +1 -0
  313. package/dist/hooks/useKeyPress/useKeyPress.d.ts +22 -0
  314. package/dist/hooks/useKeyPress/useKeyPress.js +39 -0
  315. package/dist/hooks/useKeyPress/useKeyPress.types.d.ts +19 -0
  316. package/dist/hooks/useLocalStorage/index.d.ts +2 -0
  317. package/dist/hooks/useLocalStorage/useLocalStorage.cjs +1 -0
  318. package/dist/hooks/useLocalStorage/useLocalStorage.d.ts +11 -0
  319. package/dist/hooks/useLocalStorage/useLocalStorage.js +47 -0
  320. package/dist/hooks/useLocalStorage/useLocalStorage.types.d.ts +16 -0
  321. package/dist/hooks/useMediaQuery/index.d.ts +3 -0
  322. package/dist/hooks/useMediaQuery/useMediaQuery.d.ts +12 -0
  323. package/dist/hooks/useMediaQuery/useMediaQuery.types.d.ts +21 -0
  324. package/dist/hooks/useParallax/index.d.ts +2 -0
  325. package/dist/hooks/useParallax/useParallax.cjs +1 -0
  326. package/dist/hooks/useParallax/useParallax.d.ts +2 -0
  327. package/dist/hooks/useParallax/useParallax.js +36 -0
  328. package/dist/hooks/useParallax/useParallax.types.d.ts +19 -0
  329. package/dist/hooks/usePulse/index.d.ts +2 -0
  330. package/dist/hooks/usePulse/usePulse.cjs +1 -0
  331. package/dist/hooks/usePulse/usePulse.d.ts +2 -0
  332. package/dist/hooks/usePulse/usePulse.js +38 -0
  333. package/dist/hooks/usePulse/usePulse.types.d.ts +29 -0
  334. package/dist/hooks/useShake/index.d.ts +2 -0
  335. package/dist/hooks/useShake/useShake.cjs +1 -0
  336. package/dist/hooks/useShake/useShake.d.ts +2 -0
  337. package/dist/hooks/useShake/useShake.js +14 -0
  338. package/dist/hooks/useShake/useShake.types.d.ts +19 -0
  339. package/dist/hooks/useSlide/index.d.ts +2 -0
  340. package/dist/hooks/useSlide/useSlide.cjs +1 -0
  341. package/dist/hooks/useSlide/useSlide.d.ts +2 -0
  342. package/dist/hooks/useSlide/useSlide.js +68 -0
  343. package/dist/hooks/useSlide/useSlide.types.d.ts +36 -0
  344. package/dist/hooks/useThrottle/index.d.ts +2 -0
  345. package/dist/hooks/useThrottle/useThrottle.cjs +1 -0
  346. package/dist/hooks/useThrottle/useThrottle.d.ts +26 -0
  347. package/dist/hooks/useThrottle/useThrottle.js +44 -0
  348. package/dist/hooks/useThrottle/useThrottle.types.d.ts +8 -0
  349. package/dist/index.cjs +1 -1
  350. package/dist/index.js +275 -202
  351. package/dist/styles.css +1 -1
  352. package/package.json +15 -22
@@ -0,0 +1,36 @@
1
+ import { useRef as d, useState as m, useCallback as i, useEffect as g } from "react";
2
+ function y(h = {}) {
3
+ const {
4
+ height: C = 20,
5
+ duration: n = 600,
6
+ count: o = 0,
7
+ delay: a = 0,
8
+ autoStart: l = !0
9
+ } = h, b = d(null), [e, u] = m(!1), [p, f] = m(0), s = i(() => {
10
+ f(0), u(!0);
11
+ }, []), r = i(() => {
12
+ u(!1);
13
+ }, []), v = i(() => {
14
+ u((t) => !t);
15
+ }, []);
16
+ g(() => {
17
+ if (l) {
18
+ const t = setTimeout(s, a);
19
+ return () => clearTimeout(t);
20
+ }
21
+ }, [l, a, s]), g(() => {
22
+ if (!e || o === 0) return;
23
+ const t = setInterval(() => {
24
+ f((c) => c + 1 >= o ? (r(), c) : c + 1);
25
+ }, n);
26
+ return () => clearInterval(t);
27
+ }, [e, o, n, r]);
28
+ const I = e ? {
29
+ animation: `bounce-custom ${n}ms ease-in-out infinite`,
30
+ "--bounce-height": `-${C}px`
31
+ } : {};
32
+ return { ref: b, style: I, isActive: e, start: s, stop: r, toggle: v };
33
+ }
34
+ export {
35
+ y as useBounce
36
+ };
@@ -0,0 +1,27 @@
1
+ import { RefObject, CSSProperties } from 'react';
2
+ export interface UseBounceOptions {
3
+ /** Bounce height in pixels */
4
+ height?: number;
5
+ /** Duration of one bounce cycle (in ms) */
6
+ duration?: number;
7
+ /** Number of bounces (0 for infinite) */
8
+ count?: number;
9
+ /** Delay before starting (in ms) */
10
+ delay?: number;
11
+ /** Start animation on mount */
12
+ autoStart?: boolean;
13
+ }
14
+ export interface UseBounceReturn<T extends HTMLElement> {
15
+ /** Ref to attach to the element */
16
+ ref: RefObject<T>;
17
+ /** Style object to apply */
18
+ style: CSSProperties;
19
+ /** Whether bouncing is active */
20
+ isActive: boolean;
21
+ /** Start bouncing */
22
+ start: () => void;
23
+ /** Stop bouncing */
24
+ stop: () => void;
25
+ /** Toggle bouncing */
26
+ toggle: () => void;
27
+ }
@@ -0,0 +1,2 @@
1
+ export { useClickOutside, useClickOutsideMultiple } from './useClickOutside';
2
+ export type { UseClickOutsideOptions, UseClickOutsideRef } from './useClickOutside.types';
@@ -0,0 +1,22 @@
1
+ import { RefObject } from 'react';
2
+ import { UseClickOutsideOptions } from './useClickOutside.types';
3
+ /**
4
+ * useClickOutside - Detect clicks outside an element
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * const ref = useRef<HTMLDivElement>(null);
9
+ *
10
+ * useClickOutside(ref, () => {
11
+ * closeDropdown();
12
+ * });
13
+ *
14
+ * return <div ref={ref}>Dropdown content</div>;
15
+ * ```
16
+ */
17
+ export declare const useClickOutside: <T extends HTMLElement>(ref: RefObject<T>, callback: (event: MouseEvent | TouchEvent) => void, options?: UseClickOutsideOptions) => void;
18
+ /**
19
+ * useClickOutsideMultiple - Detect clicks outside multiple elements
20
+ */
21
+ export declare const useClickOutsideMultiple: <T extends HTMLElement>(refs: RefObject<T>[], callback: (event: MouseEvent | TouchEvent) => void, options?: UseClickOutsideOptions) => void;
22
+ export default useClickOutside;
@@ -0,0 +1,10 @@
1
+ import { RefObject } from 'react';
2
+ export interface UseClickOutsideOptions {
3
+ /** Event type to listen for */
4
+ events?: ('mousedown' | 'mouseup' | 'touchstart' | 'touchend')[];
5
+ /** Ignore elements with these selectors */
6
+ ignoreSelectors?: string[];
7
+ /** Whether the hook is enabled */
8
+ enabled?: boolean;
9
+ }
10
+ export type UseClickOutsideRef<T extends HTMLElement> = RefObject<T>;
@@ -0,0 +1,2 @@
1
+ export { useClipboard } from './useClipboard';
2
+ export type { UseClipboardOptions, UseClipboardReturn } from './useClipboard.types';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),T=2e3,C=(p={})=>{const{timeout:u=T,onSuccess:r,onError:t}=p,[b,a]=e.useState(!1),[d,f]=e.useState(null),[y,s]=e.useState(null),o=e.useRef(null),l=e.useCallback(()=>{a(!1),s(null),o.current&&(clearTimeout(o.current),o.current=null)},[]);return{copy:e.useCallback(async n=>{l();try{if(!(navigator!=null&&navigator.clipboard))throw new Error("Clipboard API not available");return await navigator.clipboard.writeText(n),f(n),a(!0),r==null||r(n),o.current=setTimeout(()=>{a(!1)},u),!0}catch(c){const i=c instanceof Error?c:new Error("Failed to copy");return s(i),t==null||t(i),!1}},[u,r,t,l]),copied:b,value:d,reset:l,error:y}};exports.useClipboard=C;
@@ -0,0 +1,15 @@
1
+ import { UseClipboardOptions, UseClipboardReturn } from './useClipboard.types';
2
+ /**
3
+ * useClipboard - Copy text to clipboard with status tracking
4
+ *
5
+ * @example
6
+ * ```tsx
7
+ * const { copy, copied } = useClipboard();
8
+ *
9
+ * <Button onClick={() => copy('Hello!')}>
10
+ * {copied ? 'Copied!' : 'Copy'}
11
+ * </Button>
12
+ * ```
13
+ */
14
+ export declare const useClipboard: (options?: UseClipboardOptions) => UseClipboardReturn;
15
+ export default useClipboard;
@@ -0,0 +1,22 @@
1
+ import { useState as l, useRef as w, useCallback as p } from "react";
2
+ const y = 2e3, C = (f = {}) => {
3
+ const { timeout: c = y, onSuccess: r, onError: e } = f, [d, o] = l(!1), [b, m] = l(null), [T, s] = l(null), t = w(null), n = p(() => {
4
+ o(!1), s(null), t.current && (clearTimeout(t.current), t.current = null);
5
+ }, []);
6
+ return { copy: p(async (a) => {
7
+ n();
8
+ try {
9
+ if (!(navigator != null && navigator.clipboard))
10
+ throw new Error("Clipboard API not available");
11
+ return await navigator.clipboard.writeText(a), m(a), o(!0), r == null || r(a), t.current = setTimeout(() => {
12
+ o(!1);
13
+ }, c), !0;
14
+ } catch (u) {
15
+ const i = u instanceof Error ? u : new Error("Failed to copy");
16
+ return s(i), e == null || e(i), !1;
17
+ }
18
+ }, [c, r, e, n]), copied: d, value: b, reset: n, error: T };
19
+ };
20
+ export {
21
+ C as useClipboard
22
+ };
@@ -0,0 +1,20 @@
1
+ export interface UseClipboardOptions {
2
+ /** Timeout in ms before resetting copied state */
3
+ timeout?: number;
4
+ /** Callback when copy succeeds */
5
+ onSuccess?: (value: string) => void;
6
+ /** Callback when copy fails */
7
+ onError?: (error: Error) => void;
8
+ }
9
+ export interface UseClipboardReturn {
10
+ /** Copy text to clipboard */
11
+ copy: (value: string) => Promise<boolean>;
12
+ /** Whether text was recently copied */
13
+ copied: boolean;
14
+ /** Last copied value */
15
+ value: string | null;
16
+ /** Reset copied state */
17
+ reset: () => void;
18
+ /** Error if copy failed */
19
+ error: Error | null;
20
+ }
@@ -0,0 +1,2 @@
1
+ export { useDebounce, useDebouncedCallback } from './useDebounce';
2
+ export type { UseDebounceOptions, UseDebouncedCallbackReturn } from './useDebounce.types';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),R=300;function k(n,c=R){const[a,i]=e.useState(n);return e.useEffect(()=>{const l=setTimeout(()=>{i(n)},c);return()=>{clearTimeout(l)}},[n,c]),a}function g(n,c=R,a={}){const{leading:i=!1,trailing:l=!0,maxWait:f}=a,s=e.useRef(n),t=e.useRef(null),o=e.useRef(null),u=e.useRef(null),b=e.useRef(null);e.useEffect(()=>{s.current=n},[n]);const r=e.useCallback(()=>{t.current&&(clearTimeout(t.current),t.current=null),o.current&&(clearTimeout(o.current),o.current=null),u.current=null,b.current=null},[]),T=e.useCallback(()=>{u.current&&(s.current(...u.current),r())},[r]),d=e.useCallback(()=>t.current!==null,[]),C=e.useCallback((...m)=>{u.current=m;const D=Date.now();i&&!t.current&&s.current(...m),t.current&&clearTimeout(t.current),l&&(t.current=setTimeout(()=>{u.current&&l&&s.current(...u.current),r()},c)),f!==void 0&&!o.current&&(b.current=D,o.current=setTimeout(()=>{u.current&&s.current(...u.current),r()},f))},[c,i,l,f,r]);return e.useEffect(()=>()=>{r()},[r]),{callback:C,cancel:r,flush:T,isPending:d}}exports.useDebounce=k;exports.useDebouncedCallback=g;
@@ -0,0 +1,32 @@
1
+ import { UseDebounceOptions } from './useDebounce.types';
2
+ /**
3
+ * useDebounce - Debounce a value
4
+ *
5
+ * @example
6
+ * ```tsx
7
+ * const [search, setSearch] = useState('');
8
+ * const debouncedSearch = useDebounce(search, 500);
9
+ *
10
+ * useEffect(() => {
11
+ * fetchResults(debouncedSearch);
12
+ * }, [debouncedSearch]);
13
+ * ```
14
+ */
15
+ export declare function useDebounce<T>(value: T, delay?: number): T;
16
+ /**
17
+ * useDebouncedCallback - Debounce a callback function
18
+ *
19
+ * @example
20
+ * ```tsx
21
+ * const debouncedSave = useDebouncedCallback((value) => {
22
+ * saveToServer(value);
23
+ * }, 500);
24
+ * ```
25
+ */
26
+ export declare function useDebouncedCallback<T extends (...args: unknown[]) => unknown>(callback: T, delay?: number, options?: UseDebounceOptions): {
27
+ callback: (...args: Parameters<T>) => void;
28
+ cancel: () => void;
29
+ flush: () => void;
30
+ isPending: () => boolean;
31
+ };
32
+ export default useDebounce;
@@ -0,0 +1,39 @@
1
+ import { useState as x, useEffect as T, useRef as i, useCallback as f } from "react";
2
+ const D = 300;
3
+ function E(n, u = D) {
4
+ const [a, s] = x(n);
5
+ return T(() => {
6
+ const c = setTimeout(() => {
7
+ s(n);
8
+ }, u);
9
+ return () => {
10
+ clearTimeout(c);
11
+ };
12
+ }, [n, u]), a;
13
+ }
14
+ function p(n, u = D, a = {}) {
15
+ const { leading: s = !1, trailing: c = !0, maxWait: m } = a, o = i(n), e = i(null), l = i(null), r = i(null), b = i(null);
16
+ T(() => {
17
+ o.current = n;
18
+ }, [n]);
19
+ const t = f(() => {
20
+ e.current && (clearTimeout(e.current), e.current = null), l.current && (clearTimeout(l.current), l.current = null), r.current = null, b.current = null;
21
+ }, []), R = f(() => {
22
+ r.current && (o.current(...r.current), t());
23
+ }, [t]), C = f(() => e.current !== null, []), g = f((...d) => {
24
+ r.current = d;
25
+ const k = Date.now();
26
+ s && !e.current && o.current(...d), e.current && clearTimeout(e.current), c && (e.current = setTimeout(() => {
27
+ r.current && c && o.current(...r.current), t();
28
+ }, u)), m !== void 0 && !l.current && (b.current = k, l.current = setTimeout(() => {
29
+ r.current && o.current(...r.current), t();
30
+ }, m));
31
+ }, [u, s, c, m, t]);
32
+ return T(() => () => {
33
+ t();
34
+ }, [t]), { callback: g, cancel: t, flush: R, isPending: C };
35
+ }
36
+ export {
37
+ E as useDebounce,
38
+ p as useDebouncedCallback
39
+ };
@@ -0,0 +1,20 @@
1
+ export interface UseDebounceOptions {
2
+ /** Delay in milliseconds */
3
+ delay?: number;
4
+ /** Execute on leading edge */
5
+ leading?: boolean;
6
+ /** Execute on trailing edge */
7
+ trailing?: boolean;
8
+ /** Maximum time to wait */
9
+ maxWait?: number;
10
+ }
11
+ export interface UseDebouncedCallbackReturn<T extends (...args: unknown[]) => unknown> {
12
+ /** Debounced function */
13
+ callback: T;
14
+ /** Cancel pending execution */
15
+ cancel: () => void;
16
+ /** Flush pending execution immediately */
17
+ flush: () => void;
18
+ /** Check if pending */
19
+ isPending: () => boolean;
20
+ }
@@ -0,0 +1,2 @@
1
+ export { useFloat } from './useFloat';
2
+ export type { UseFloatOptions, UseFloatReturn } from './useFloat.types';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react");function g(s={}){const{distance:r=10,duration:c=3e3,delay:a=0,direction:l="vertical",autoStart:o=!0}=s,u=t.useRef(null),[n,i]=t.useState(!1),e=t.useCallback(()=>{i(!0)},[]),f=t.useCallback(()=>{i(!1)},[]);t.useEffect(()=>{if(o){const m=setTimeout(e,a);return()=>clearTimeout(m)}},[o,a,e]);const d=n?{animation:`${(()=>{switch(l){case"horizontal":return"float-horizontal";case"diagonal":return"float-diagonal";default:return"float-vertical"}})()} ${c}ms ease-in-out infinite`,"--float-distance":`${r}px`}:{};return{ref:u,style:d,isActive:n,start:e,stop:f}}exports.useFloat=g;
@@ -0,0 +1,2 @@
1
+ import { UseFloatOptions, UseFloatReturn } from './useFloat.types';
2
+ export declare function useFloat<T extends HTMLElement = HTMLDivElement>(options?: UseFloatOptions): UseFloatReturn<T>;
@@ -0,0 +1,37 @@
1
+ import { useRef as g, useState as p, useCallback as i, useEffect as v } from "react";
2
+ function $(s = {}) {
3
+ const {
4
+ distance: r = 10,
5
+ duration: c = 3e3,
6
+ delay: e = 0,
7
+ direction: l = "vertical",
8
+ autoStart: a = !0
9
+ } = s, u = g(null), [o, n] = p(!1), t = i(() => {
10
+ n(!0);
11
+ }, []), f = i(() => {
12
+ n(!1);
13
+ }, []);
14
+ v(() => {
15
+ if (a) {
16
+ const d = setTimeout(t, e);
17
+ return () => clearTimeout(d);
18
+ }
19
+ }, [a, e, t]);
20
+ const m = o ? {
21
+ animation: `${(() => {
22
+ switch (l) {
23
+ case "horizontal":
24
+ return "float-horizontal";
25
+ case "diagonal":
26
+ return "float-diagonal";
27
+ default:
28
+ return "float-vertical";
29
+ }
30
+ })()} ${c}ms ease-in-out infinite`,
31
+ "--float-distance": `${r}px`
32
+ } : {};
33
+ return { ref: u, style: m, isActive: o, start: t, stop: f };
34
+ }
35
+ export {
36
+ $ as useFloat
37
+ };
@@ -0,0 +1,25 @@
1
+ import { RefObject, CSSProperties } from 'react';
2
+ export interface UseFloatOptions {
3
+ /** Float distance in pixels */
4
+ distance?: number;
5
+ /** Duration of one float cycle (in ms) */
6
+ duration?: number;
7
+ /** Delay before starting (in ms) */
8
+ delay?: number;
9
+ /** Direction of float */
10
+ direction?: 'vertical' | 'horizontal' | 'diagonal';
11
+ /** Start animation on mount */
12
+ autoStart?: boolean;
13
+ }
14
+ export interface UseFloatReturn<T extends HTMLElement> {
15
+ /** Ref to attach to the element */
16
+ ref: RefObject<T>;
17
+ /** Style object to apply */
18
+ style: CSSProperties;
19
+ /** Whether floating is active */
20
+ isActive: boolean;
21
+ /** Start floating */
22
+ start: () => void;
23
+ /** Stop floating */
24
+ stop: () => void;
25
+ }
@@ -0,0 +1,2 @@
1
+ export { useIntersectionObserver, useInView } from './useIntersectionObserver';
2
+ export type { UseIntersectionObserverOptions, UseIntersectionObserverReturn } from './useIntersectionObserver.types';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),b=(t,s={})=>{const{threshold:n=0,root:l=null,rootMargin:f="0px",freezeOnceVisible:i=!1,enabled:a=!0,onChange:r}=s,[e,d]=u.useState(null),I=u.useRef(!1);return u.useEffect(()=>{if(!a||!t.current||typeof IntersectionObserver>"u"||I.current&&i)return;const c=new IntersectionObserver(([o])=>{d(o),r==null||r(o),i&&o.isIntersecting&&(I.current=!0,c.disconnect())},{threshold:n,root:l,rootMargin:f});return c.observe(t.current),()=>{c.disconnect()}},[t,n,l,f,i,a,r]),{isIntersecting:(e==null?void 0:e.isIntersecting)??!1,entry:e,intersectionRatio:(e==null?void 0:e.intersectionRatio)??0}},g=(t,s={})=>{const{isIntersecting:n}=b(t,s);return n};exports.useInView=g;exports.useIntersectionObserver=b;
@@ -0,0 +1,25 @@
1
+ import { RefObject } from 'react';
2
+ import { UseIntersectionObserverOptions, UseIntersectionObserverReturn } from './useIntersectionObserver.types';
3
+ /**
4
+ * useIntersectionObserver - Detect when an element enters/leaves the viewport
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * const ref = useRef<HTMLDivElement>(null);
9
+ * const { isIntersecting, intersectionRatio } = useIntersectionObserver(ref, {
10
+ * threshold: 0.5,
11
+ * });
12
+ *
13
+ * return (
14
+ * <div ref={ref} style={{ opacity: isIntersecting ? 1 : 0.5 }}>
15
+ * {isIntersecting ? 'Visible!' : 'Not visible'}
16
+ * </div>
17
+ * );
18
+ * ```
19
+ */
20
+ export declare const useIntersectionObserver: <T extends HTMLElement>(ref: RefObject<T>, options?: UseIntersectionObserverOptions) => UseIntersectionObserverReturn;
21
+ /**
22
+ * useInView - Simple boolean for whether element is in view
23
+ */
24
+ export declare const useInView: <T extends HTMLElement>(ref: RefObject<T>, options?: Omit<UseIntersectionObserverOptions, "onChange">) => boolean;
25
+ export default useIntersectionObserver;
@@ -0,0 +1,39 @@
1
+ import { useState as d, useRef as b, useEffect as g } from "react";
2
+ const p = (t, s = {}) => {
3
+ const {
4
+ threshold: n = 0,
5
+ root: u = null,
6
+ rootMargin: f = "0px",
7
+ freezeOnceVisible: i = !1,
8
+ enabled: l = !0,
9
+ onChange: r
10
+ } = s, [e, a] = d(null), I = b(!1);
11
+ return g(() => {
12
+ if (!l || !t.current || typeof IntersectionObserver > "u" || I.current && i)
13
+ return;
14
+ const c = new IntersectionObserver(
15
+ ([o]) => {
16
+ a(o), r == null || r(o), i && o.isIntersecting && (I.current = !0, c.disconnect());
17
+ },
18
+ {
19
+ threshold: n,
20
+ root: u,
21
+ rootMargin: f
22
+ }
23
+ );
24
+ return c.observe(t.current), () => {
25
+ c.disconnect();
26
+ };
27
+ }, [t, n, u, f, i, l, r]), {
28
+ isIntersecting: (e == null ? void 0 : e.isIntersecting) ?? !1,
29
+ entry: e,
30
+ intersectionRatio: (e == null ? void 0 : e.intersectionRatio) ?? 0
31
+ };
32
+ }, v = (t, s = {}) => {
33
+ const { isIntersecting: n } = p(t, s);
34
+ return n;
35
+ };
36
+ export {
37
+ v as useInView,
38
+ p as useIntersectionObserver
39
+ };
@@ -0,0 +1,22 @@
1
+ export interface UseIntersectionObserverOptions {
2
+ /** Threshold(s) at which to trigger callback */
3
+ threshold?: number | number[];
4
+ /** Root element for intersection */
5
+ root?: Element | Document | null;
6
+ /** Margin around root */
7
+ rootMargin?: string;
8
+ /** Freeze updates after first intersection */
9
+ freezeOnceVisible?: boolean;
10
+ /** Whether the hook is enabled */
11
+ enabled?: boolean;
12
+ /** Callback when intersection changes */
13
+ onChange?: (entry: IntersectionObserverEntry) => void;
14
+ }
15
+ export interface UseIntersectionObserverReturn {
16
+ /** Whether element is visible */
17
+ isIntersecting: boolean;
18
+ /** Current intersection entry */
19
+ entry: IntersectionObserverEntry | null;
20
+ /** Intersection ratio (0-1) */
21
+ intersectionRatio: number;
22
+ }
@@ -0,0 +1,2 @@
1
+ export { useKeyPress, useKeyPressState } from './useKeyPress';
2
+ export type { UseKeyPressOptions, KeyFilter } from './useKeyPress.types';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),P=(r,e)=>typeof e=="function"?e(r):(Array.isArray(e)?e:[e]).some(o=>{const s=o.toLowerCase();return r.key.toLowerCase()===s||r.code.toLowerCase()===s}),a=(r,e,f={})=>{const{target:o,event:s="keydown",preventDefault:c=!1,stopPropagation:i=!1,metaKey:l=!1,ctrlKey:y=!1,shiftKey:K=!1,altKey:d=!1}=f,p=n.useRef(e);n.useEffect(()=>{p.current=e},[e]);const u=n.useCallback(t=>{l&&!t.metaKey||y&&!t.ctrlKey||K&&!t.shiftKey||d&&!t.altKey||P(t,r)&&(c&&t.preventDefault(),i&&t.stopPropagation(),p.current(t))},[r,l,y,K,d,c,i]);n.useEffect(()=>{const t=o||document;return t.addEventListener(s,u),()=>{t.removeEventListener(s,u)}},[o,s,u])},m=r=>{const e=n.useRef(!1);return a(r,()=>{e.current=!0},{event:"keydown"}),a(r,()=>{e.current=!1},{event:"keyup"}),e.current};exports.useKeyPress=a;exports.useKeyPressState=m;
@@ -0,0 +1,22 @@
1
+ import { UseKeyPressOptions, KeyFilter } from './useKeyPress.types';
2
+ /**
3
+ * useKeyPress - Detect when a key is pressed
4
+ *
5
+ * @example
6
+ * ```tsx
7
+ * // Single key
8
+ * useKeyPress('Escape', () => closeModal());
9
+ *
10
+ * // Multiple keys
11
+ * useKeyPress(['ArrowUp', 'ArrowDown'], (e) => handleArrow(e));
12
+ *
13
+ * // With modifiers
14
+ * useKeyPress('k', () => openSearch(), { metaKey: true });
15
+ * ```
16
+ */
17
+ export declare const useKeyPress: (key: KeyFilter, callback: (event: KeyboardEvent) => void, options?: UseKeyPressOptions) => void;
18
+ /**
19
+ * useKeyPressState - Track if a key is currently pressed
20
+ */
21
+ export declare const useKeyPressState: (key: KeyFilter) => boolean;
22
+ export default useKeyPress;
@@ -0,0 +1,39 @@
1
+ import { useRef as m, useEffect as p, useCallback as v } from "react";
2
+ const w = (r, e) => typeof e == "function" ? e(r) : (Array.isArray(e) ? e : [e]).some((n) => {
3
+ const s = n.toLowerCase();
4
+ return r.key.toLowerCase() === s || r.code.toLowerCase() === s;
5
+ }), d = (r, e, a = {}) => {
6
+ const {
7
+ target: n,
8
+ event: s = "keydown",
9
+ preventDefault: f = !1,
10
+ stopPropagation: u = !1,
11
+ metaKey: c = !1,
12
+ ctrlKey: i = !1,
13
+ shiftKey: l = !1,
14
+ altKey: y = !1
15
+ } = a, K = m(e);
16
+ p(() => {
17
+ K.current = e;
18
+ }, [e]);
19
+ const o = v((t) => {
20
+ c && !t.metaKey || i && !t.ctrlKey || l && !t.shiftKey || y && !t.altKey || w(t, r) && (f && t.preventDefault(), u && t.stopPropagation(), K.current(t));
21
+ }, [r, c, i, l, y, f, u]);
22
+ p(() => {
23
+ const t = n || document;
24
+ return t.addEventListener(s, o), () => {
25
+ t.removeEventListener(s, o);
26
+ };
27
+ }, [n, s, o]);
28
+ }, P = (r) => {
29
+ const e = m(!1);
30
+ return d(r, () => {
31
+ e.current = !0;
32
+ }, { event: "keydown" }), d(r, () => {
33
+ e.current = !1;
34
+ }, { event: "keyup" }), e.current;
35
+ };
36
+ export {
37
+ d as useKeyPress,
38
+ P as useKeyPressState
39
+ };
@@ -0,0 +1,19 @@
1
+ export interface UseKeyPressOptions {
2
+ /** Target element (defaults to document) */
3
+ target?: HTMLElement | null;
4
+ /** Event type */
5
+ event?: 'keydown' | 'keyup' | 'keypress';
6
+ /** Prevent default behavior */
7
+ preventDefault?: boolean;
8
+ /** Stop propagation */
9
+ stopPropagation?: boolean;
10
+ /** Only trigger when meta key is pressed */
11
+ metaKey?: boolean;
12
+ /** Only trigger when ctrl key is pressed */
13
+ ctrlKey?: boolean;
14
+ /** Only trigger when shift key is pressed */
15
+ shiftKey?: boolean;
16
+ /** Only trigger when alt key is pressed */
17
+ altKey?: boolean;
18
+ }
19
+ export type KeyFilter = string | string[] | ((event: KeyboardEvent) => boolean);
@@ -0,0 +1,2 @@
1
+ export { useLocalStorage } from './useLocalStorage';
2
+ export type { UseLocalStorageOptions, UseLocalStorageReturn } from './useLocalStorage.types';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),g=e=>JSON.stringify(e),S=e=>JSON.parse(e);function m(e,t,u={}){const{serializer:l=g,deserializer:c=S,syncTabs:d=!0}=u,[s,n]=a.useState(()=>{if(typeof window>"u")return t;try{const r=window.localStorage.getItem(e);return r?c(r):t}catch(r){return console.warn(`Error reading localStorage key "${e}":`,r),t}}),i=a.useCallback(r=>{try{const o=r instanceof Function?r(s):r;n(o),typeof window<"u"&&window.localStorage.setItem(e,l(o))}catch(o){console.warn(`Error setting localStorage key "${e}":`,o)}},[e,s,l]),w=a.useCallback(()=>{try{n(t),typeof window<"u"&&window.localStorage.removeItem(e)}catch(r){console.warn(`Error removing localStorage key "${e}":`,r)}},[e,t]);return a.useEffect(()=>{if(!d||typeof window>"u")return;const r=o=>{if(o.key===e&&o.newValue!==null)try{n(c(o.newValue))}catch(f){console.warn(`Error syncing localStorage key "${e}":`,f)}else o.key===e&&o.newValue===null&&n(t)};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)},[e,t,c,d]),[s,i,w]}exports.useLocalStorage=m;
@@ -0,0 +1,11 @@
1
+ import { UseLocalStorageOptions, UseLocalStorageReturn } from './useLocalStorage.types';
2
+ /**
3
+ * useLocalStorage - Persist state in localStorage
4
+ *
5
+ * @example
6
+ * ```tsx
7
+ * const [theme, setTheme, removeTheme] = useLocalStorage('theme', 'light');
8
+ * ```
9
+ */
10
+ export declare function useLocalStorage<T>(key: string, initialValue: T, options?: UseLocalStorageOptions<T>): UseLocalStorageReturn<T>;
11
+ export default useLocalStorage;
@@ -0,0 +1,47 @@
1
+ import { useState as g, useCallback as d, useEffect as S } from "react";
2
+ const m = (e) => JSON.stringify(e), p = (e) => JSON.parse(e);
3
+ function h(e, t, w = {}) {
4
+ const {
5
+ serializer: s = m,
6
+ deserializer: a = p,
7
+ syncTabs: l = !0
8
+ } = w, [c, n] = g(() => {
9
+ if (typeof window > "u")
10
+ return t;
11
+ try {
12
+ const r = window.localStorage.getItem(e);
13
+ return r ? a(r) : t;
14
+ } catch (r) {
15
+ return console.warn(`Error reading localStorage key "${e}":`, r), t;
16
+ }
17
+ }), f = d((r) => {
18
+ try {
19
+ const o = r instanceof Function ? r(c) : r;
20
+ n(o), typeof window < "u" && window.localStorage.setItem(e, s(o));
21
+ } catch (o) {
22
+ console.warn(`Error setting localStorage key "${e}":`, o);
23
+ }
24
+ }, [e, c, s]), i = d(() => {
25
+ try {
26
+ n(t), typeof window < "u" && window.localStorage.removeItem(e);
27
+ } catch (r) {
28
+ console.warn(`Error removing localStorage key "${e}":`, r);
29
+ }
30
+ }, [e, t]);
31
+ return S(() => {
32
+ if (!l || typeof window > "u") return;
33
+ const r = (o) => {
34
+ if (o.key === e && o.newValue !== null)
35
+ try {
36
+ n(a(o.newValue));
37
+ } catch (u) {
38
+ console.warn(`Error syncing localStorage key "${e}":`, u);
39
+ }
40
+ else o.key === e && o.newValue === null && n(t);
41
+ };
42
+ return window.addEventListener("storage", r), () => window.removeEventListener("storage", r);
43
+ }, [e, t, a, l]), [c, f, i];
44
+ }
45
+ export {
46
+ h as useLocalStorage
47
+ };
@@ -0,0 +1,16 @@
1
+ export interface UseLocalStorageOptions<T> {
2
+ /** Serializer function */
3
+ serializer?: (value: T) => string;
4
+ /** Deserializer function */
5
+ deserializer?: (value: string) => T;
6
+ /** Sync across tabs */
7
+ syncTabs?: boolean;
8
+ }
9
+ export type UseLocalStorageReturn<T> = [
10
+ /** Current value */
11
+ T,
12
+ /** Set value */
13
+ (value: T | ((prev: T) => T)) => void,
14
+ /** Remove value */
15
+ () => void
16
+ ];
@@ -0,0 +1,3 @@
1
+ export { useMediaQuery } from './useMediaQuery';
2
+ export { BREAKPOINTS } from './useMediaQuery.types';
3
+ export type { UseMediaQueryOptions, UseMediaQueryReturn, BreakpointKey } from './useMediaQuery.types';
@@ -0,0 +1,12 @@
1
+ import { UseMediaQueryOptions, UseMediaQueryReturn, BreakpointKey } from './useMediaQuery.types';
2
+ /**
3
+ * useMediaQuery - Track media query matches
4
+ *
5
+ * @example
6
+ * ```tsx
7
+ * const isMobile = useMediaQuery('(max-width: 768px)');
8
+ * const isDark = useMediaQuery('dark'); // Uses predefined breakpoint
9
+ * ```
10
+ */
11
+ export declare const useMediaQuery: (query: string | BreakpointKey, options?: UseMediaQueryOptions) => UseMediaQueryReturn;
12
+ export default useMediaQuery;