@koine/react 1.1.10 → 1.1.12

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 (656) hide show
  1. package/Alert/Alert.js +12 -8
  2. package/Alert/Alert.mjs +10 -0
  3. package/Alert/index.js +4 -1
  4. package/Alert/index.mjs +1 -0
  5. package/Alert/package.json +2 -2
  6. package/Animations/Reveal.js +18 -14
  7. package/Animations/Reveal.mjs +17 -0
  8. package/Animations/Underline.js +7 -4
  9. package/Animations/Underline.mjs +5 -0
  10. package/Animations/index.js +6 -3
  11. package/Animations/index.mjs +3 -0
  12. package/Animations/package.json +2 -2
  13. package/Animations/useReveal.js +11 -7
  14. package/{node/Animations/useReveal.js → Animations/useReveal.mjs} +7 -11
  15. package/Autocomplete/AutocompleteDownshift.js +4 -1
  16. package/{node/Autocomplete/AutocompleteDownshift.js → Autocomplete/AutocompleteDownshift.mjs} +1 -4
  17. package/Autocomplete/AutocompleteDownshiftMultiselect.js +4 -1
  18. package/{node/Autocomplete/AutocompleteDownshiftMultiselect.js → Autocomplete/AutocompleteDownshiftMultiselect.mjs} +1 -4
  19. package/Autocomplete/AutocompleteMui.js +33 -35
  20. package/{node/Autocomplete/AutocompleteMui.js → Autocomplete/AutocompleteMui.mjs} +35 -33
  21. package/Autocomplete/AutocompleteReach.js +4 -1
  22. package/{node/Autocomplete/AutocompleteReach.js → Autocomplete/AutocompleteReach.mjs} +1 -4
  23. package/Autocomplete/components.js +25 -22
  24. package/Autocomplete/components.mjs +34 -0
  25. package/Autocomplete/helpers.js +11 -6
  26. package/{node/Autocomplete/helpers.js → Autocomplete/helpers.mjs} +6 -11
  27. package/Autocomplete/index.js +5 -1
  28. package/Autocomplete/index.mjs +3 -0
  29. package/Autocomplete/package.json +2 -2
  30. package/Bg/BgColor.js +14 -10
  31. package/Bg/BgColor.mjs +21 -0
  32. package/Bg/BgPhoto.js +13 -9
  33. package/Bg/BgPhoto.mjs +16 -0
  34. package/Bg/BgSvg.js +10 -6
  35. package/Bg/BgSvg.mjs +12 -0
  36. package/Bg/index.js +6 -3
  37. package/Bg/index.mjs +3 -0
  38. package/Bg/package.json +2 -2
  39. package/Breadcrumbs/Breadcrumbs.js +22 -18
  40. package/Breadcrumbs/Breadcrumbs.mjs +27 -0
  41. package/Breadcrumbs/index.js +4 -1
  42. package/Breadcrumbs/index.mjs +1 -0
  43. package/Breadcrumbs/package.json +2 -2
  44. package/Buttons/Button.js +12 -9
  45. package/Buttons/Button.mjs +14 -0
  46. package/Buttons/ButtonComposite.js +20 -16
  47. package/Buttons/ButtonComposite.mjs +28 -0
  48. package/Buttons/ButtonFab.js +8 -5
  49. package/Buttons/ButtonFab.mjs +6 -0
  50. package/Buttons/ButtonLink.js +12 -8
  51. package/Buttons/ButtonLink.mjs +11 -0
  52. package/Buttons/IconButton.js +9 -6
  53. package/Buttons/IconButton.mjs +7 -0
  54. package/Buttons/index.js +8 -5
  55. package/Buttons/index.mjs +5 -0
  56. package/Buttons/package.json +2 -2
  57. package/Calendar/CalendarDaygridCell.js +16 -12
  58. package/{node/Calendar/CalendarDaygridCell.js → Calendar/CalendarDaygridCell.mjs} +12 -16
  59. package/Calendar/CalendarDaygridNav.js +14 -9
  60. package/Calendar/CalendarDaygridNav.mjs +23 -0
  61. package/Calendar/CalendarDaygridTable.js +23 -19
  62. package/{node/Calendar/CalendarDaygridTable.js → Calendar/CalendarDaygridTable.mjs} +19 -23
  63. package/Calendar/CalendarLegend.js +9 -5
  64. package/Calendar/CalendarLegend.mjs +16 -0
  65. package/Calendar/calendar-api-google.js +27 -23
  66. package/{node/Calendar/calendar-api-google.js → Calendar/calendar-api-google.mjs} +23 -27
  67. package/Calendar/index.js +9 -6
  68. package/Calendar/index.mjs +6 -0
  69. package/Calendar/package.json +2 -2
  70. package/Calendar/types.js +2 -1
  71. package/Calendar/types.mjs +1 -0
  72. package/Calendar/useCalendar.js +43 -39
  73. package/{node/Calendar/useCalendar.js → Calendar/useCalendar.mjs} +39 -43
  74. package/Calendar/utils.js +44 -31
  75. package/{node/Calendar/utils.js → Calendar/utils.mjs} +31 -44
  76. package/Carousel/Carousel.js +4 -1
  77. package/{node/Carousel/Carousel.js → Carousel/Carousel.mjs} +1 -4
  78. package/Carousel/CarouselCss.d.ts +6 -1
  79. package/Carousel/CarouselCss.js +17 -13
  80. package/Carousel/CarouselCss.mjs +22 -0
  81. package/Carousel/index.js +4 -1
  82. package/Carousel/index.mjs +1 -0
  83. package/Carousel/package.json +2 -2
  84. package/Collapsable/Collapsable.js +4 -1
  85. package/Collapsable/Collapsable.mjs +1 -0
  86. package/{node/Collapsable/CollapsableReach.js → Collapsable/CollapsableReach.mjs} +0 -0
  87. package/Collapsable/index.js +4 -1
  88. package/Collapsable/index.mjs +2 -0
  89. package/Collapsable/package.json +2 -2
  90. package/Debug/Debug.js +10 -6
  91. package/Debug/Debug.mjs +9 -0
  92. package/Debug/index.js +4 -1
  93. package/Debug/index.mjs +1 -0
  94. package/Debug/package.json +2 -2
  95. package/Details/Details.d.ts +298 -13
  96. package/Details/Details.js +30 -27
  97. package/Details/Details.mjs +63 -0
  98. package/Details/index.js +4 -1
  99. package/Details/index.mjs +1 -0
  100. package/Details/package.json +2 -2
  101. package/Dialog/DialogMui.d.ts +328 -19
  102. package/Dialog/DialogMui.js +28 -25
  103. package/{node/Dialog/DialogMui.js → Dialog/DialogMui.mjs} +25 -28
  104. package/Dialog/css/bare.d.ts +352 -43
  105. package/Dialog/css/bare.js +21 -18
  106. package/Dialog/css/bare.mjs +21 -0
  107. package/Dialog/index.js +5 -1
  108. package/Dialog/index.mjs +1 -0
  109. package/Dialog/m/bare.d.ts +322 -13
  110. package/Dialog/m/bare.js +26 -23
  111. package/Dialog/m/bare.mjs +52 -0
  112. package/Dialog/m/basic.js +7 -3
  113. package/{node/Dialog/m/basic.js → Dialog/m/basic.mjs} +3 -7
  114. package/Dialog/m/index.js +7 -3
  115. package/Dialog/m/index.mjs +4 -0
  116. package/Dialog/m/package.json +2 -2
  117. package/Dialog/package.json +2 -2
  118. package/Dialog/sc/bare.d.ts +325 -17
  119. package/Dialog/sc/bare.js +24 -21
  120. package/Dialog/sc/bare.mjs +43 -0
  121. package/Dialog/sc/framer.d.ts +316 -7
  122. package/Dialog/sc/framer.js +18 -15
  123. package/Dialog/sc/framer.mjs +16 -0
  124. package/Dialog/sc/framerMaterial.d.ts +316 -7
  125. package/Dialog/sc/framerMaterial.js +18 -15
  126. package/Dialog/sc/framerMaterial.mjs +16 -0
  127. package/Dialog/sc/material.d.ts +325 -16
  128. package/Dialog/sc/material.js +22 -19
  129. package/Dialog/sc/material.mjs +21 -0
  130. package/Dialog/tw/bare.d.ts +358 -49
  131. package/Dialog/tw/bare.js +21 -18
  132. package/Dialog/tw/bare.mjs +42 -0
  133. package/Dialog/tw/elegant.d.ts +379 -70
  134. package/Dialog/tw/elegant.js +21 -18
  135. package/Dialog/tw/elegant.mjs +20 -0
  136. package/Dialog/tw/framer.d.ts +340 -31
  137. package/Dialog/tw/framer.js +18 -15
  138. package/Dialog/tw/framer.mjs +16 -0
  139. package/Dialog/tw/framerMaterial.d.ts +356 -47
  140. package/Dialog/tw/framerMaterial.js +18 -15
  141. package/Dialog/tw/framerMaterial.mjs +16 -0
  142. package/Dialog/tw/material.d.ts +379 -70
  143. package/Dialog/tw/material.js +21 -18
  144. package/Dialog/tw/material.mjs +20 -0
  145. package/Editor/Editor--tiptap.js +20 -15
  146. package/Editor/Editor--tiptap.mjs +26 -0
  147. package/Editor/components.js +14 -9
  148. package/Editor/components.mjs +10 -0
  149. package/Editor/index.js +4 -1
  150. package/Editor/index.mjs +1 -0
  151. package/Editor/package.json +2 -2
  152. package/FaviconTags/FaviconTags.js +8 -4
  153. package/FaviconTags/FaviconTags.mjs +16 -0
  154. package/FaviconTags/index.js +7 -2
  155. package/FaviconTags/index.mjs +2 -0
  156. package/FaviconTags/package.json +2 -2
  157. package/Form/Form.d.ts +45 -19
  158. package/Form/Form.js +27 -23
  159. package/Form/Form.mjs +61 -0
  160. package/Form/index.js +4 -1
  161. package/Form/index.mjs +1 -0
  162. package/Form/package.json +2 -2
  163. package/Form/sc/bare.d.ts +33 -8
  164. package/Form/sc/bare.js +21 -18
  165. package/Form/sc/bare.mjs +20 -0
  166. package/Forms/Checkbox/Checkbox.d.ts +1 -1
  167. package/Forms/Checkbox/Checkbox.js +16 -13
  168. package/Forms/Checkbox/Checkbox.mjs +18 -0
  169. package/Forms/Checkbox/index.js +4 -1
  170. package/Forms/Checkbox/index.mjs +1 -0
  171. package/Forms/Checkbox/package.json +2 -2
  172. package/Forms/Feedback/Feedback.js +10 -6
  173. package/Forms/Feedback/Feedback.mjs +9 -0
  174. package/Forms/Feedback/index.js +4 -1
  175. package/Forms/Feedback/index.mjs +1 -0
  176. package/Forms/Feedback/package.json +2 -2
  177. package/Forms/Field/Field.js +14 -10
  178. package/Forms/Field/Field.mjs +31 -0
  179. package/Forms/Field/FieldControl.js +18 -14
  180. package/Forms/Field/FieldControl.mjs +47 -0
  181. package/Forms/Field/FieldHint.js +6 -3
  182. package/Forms/Field/FieldHint.mjs +4 -0
  183. package/Forms/Field/index.js +5 -2
  184. package/Forms/Field/index.mjs +2 -0
  185. package/Forms/Field/package.json +2 -2
  186. package/Forms/Input/Input.d.ts +1 -1
  187. package/Forms/Input/Input.js +17 -14
  188. package/Forms/Input/Input.mjs +17 -0
  189. package/Forms/Input/index.js +4 -1
  190. package/Forms/Input/index.mjs +1 -0
  191. package/Forms/Input/package.json +2 -2
  192. package/Forms/InputGroup/InputGroup.js +17 -13
  193. package/Forms/InputGroup/InputGroup.mjs +15 -0
  194. package/Forms/InputGroup/index.js +4 -1
  195. package/Forms/InputGroup/index.mjs +1 -0
  196. package/Forms/InputGroup/package.json +2 -2
  197. package/Forms/Label/Label.js +8 -5
  198. package/Forms/Label/Label.mjs +6 -0
  199. package/Forms/Label/index.js +4 -1
  200. package/Forms/Label/index.mjs +1 -0
  201. package/Forms/Label/package.json +2 -2
  202. package/Forms/Password/Password.d.ts +1 -1
  203. package/Forms/Password/Password.js +17 -14
  204. package/Forms/Password/Password.mjs +17 -0
  205. package/Forms/Password/index.js +4 -1
  206. package/Forms/Password/index.mjs +1 -0
  207. package/Forms/Password/package.json +2 -2
  208. package/Forms/Radio/Radio.d.ts +1 -1
  209. package/Forms/Radio/Radio.js +22 -19
  210. package/Forms/Radio/Radio.mjs +25 -0
  211. package/Forms/Radio/index.js +4 -1
  212. package/Forms/Radio/index.mjs +1 -0
  213. package/Forms/Radio/package.json +2 -2
  214. package/Forms/Switch/Switch.d.ts +1 -1
  215. package/Forms/Switch/Switch.js +16 -13
  216. package/Forms/Switch/Switch.mjs +20 -0
  217. package/Forms/Switch/index.js +4 -1
  218. package/Forms/Switch/index.mjs +1 -0
  219. package/Forms/Switch/package.json +2 -2
  220. package/Forms/Textarea/Textarea.d.ts +1 -1
  221. package/Forms/Textarea/Textarea.js +13 -10
  222. package/Forms/Textarea/Textarea.mjs +12 -0
  223. package/Forms/Textarea/TextareaRich.d.ts +1 -1
  224. package/Forms/Textarea/TextareaRich.js +15 -12
  225. package/Forms/Textarea/TextareaRich.mjs +28 -0
  226. package/Forms/Textarea/index.js +5 -2
  227. package/Forms/Textarea/index.mjs +2 -0
  228. package/Forms/Textarea/package.json +2 -2
  229. package/{node/Forms/Toggle/Toggle-tailwind.js → Forms/Toggle/Toggle-tailwind.mjs} +0 -0
  230. package/Forms/Toggle/Toggle.js +26 -21
  231. package/Forms/Toggle/Toggle.mjs +31 -0
  232. package/Forms/Toggle/index.js +4 -1
  233. package/Forms/Toggle/index.mjs +1 -0
  234. package/Forms/Toggle/package.json +2 -2
  235. package/{node/Forms/Toggle/useToggle-tailwind.js → Forms/Toggle/useToggle-tailwind.mjs} +0 -0
  236. package/Forms/Toggle/useToggle.js +19 -15
  237. package/{node/Forms/Toggle/useToggle.js → Forms/Toggle/useToggle.mjs} +15 -19
  238. package/Forms/antispam.js +16 -10
  239. package/{node/Forms/antispam.js → Forms/antispam.mjs} +10 -16
  240. package/Forms/helpers.js +16 -8
  241. package/{node/Forms/helpers.js → Forms/helpers.mjs} +8 -16
  242. package/Forms/index.js +18 -15
  243. package/Forms/index.mjs +16 -0
  244. package/Forms/package.json +2 -2
  245. package/Forms/styles.js +19 -16
  246. package/Forms/styles.mjs +29 -0
  247. package/Gauge/Gauge.js +5 -1
  248. package/{node/Gauge/Gauge.js → Gauge/Gauge.mjs} +1 -5
  249. package/Grid/Grid.js +13 -10
  250. package/Grid/Grid.mjs +53 -0
  251. package/Grid/index.js +4 -1
  252. package/Grid/index.mjs +1 -0
  253. package/Grid/package.json +2 -2
  254. package/Hamburger/Hamburger.js +11 -7
  255. package/Hamburger/Hamburger.mjs +52 -0
  256. package/Hamburger/index.js +4 -1
  257. package/Hamburger/index.mjs +1 -0
  258. package/Hamburger/package.json +2 -2
  259. package/Header/index.js +4 -1
  260. package/Header/index.mjs +1 -0
  261. package/Header/package.json +2 -2
  262. package/Header/useHeader.js +18 -14
  263. package/Header/useHeader.mjs +31 -0
  264. package/Hidden/Hidden.js +6 -3
  265. package/Hidden/Hidden.mjs +10 -0
  266. package/Hidden/index.js +4 -1
  267. package/Hidden/index.mjs +1 -0
  268. package/Hidden/package.json +2 -2
  269. package/Img/index.js +4 -1
  270. package/Img/index.mjs +1 -0
  271. package/Img/package.json +2 -2
  272. package/Img/sc/bare.js +6 -3
  273. package/{node/Img/sc/bare.js → Img/sc/bare.mjs} +3 -6
  274. package/Img/types.js +2 -1
  275. package/Img/types.mjs +1 -0
  276. package/Link/Link.d.ts +1 -1
  277. package/Link/Link.js +6 -3
  278. package/Link/Link.mjs +4 -0
  279. package/Link/LinkBlank.js +15 -11
  280. package/Link/LinkBlank.mjs +17 -0
  281. package/Link/index.js +5 -2
  282. package/Link/index.mjs +2 -0
  283. package/Link/package.json +2 -2
  284. package/Menu/Menu.js +6 -3
  285. package/Menu/Menu.mjs +4 -0
  286. package/Menu/MenuMui.d.ts +0 -35
  287. package/Menu/MenuMui.js +165 -75
  288. package/Menu/MenuMui.mjs +165 -0
  289. package/Menu/index.js +4 -1
  290. package/Menu/index.mjs +1 -0
  291. package/Menu/package.json +2 -2
  292. package/MenuItem/MenuItem.js +6 -3
  293. package/MenuItem/MenuItem.mjs +4 -0
  294. package/MenuItem/MenuItemMui.d.ts +0 -6
  295. package/MenuItem/MenuItemMui.js +32 -15
  296. package/MenuItem/MenuItemMui.mjs +32 -0
  297. package/MenuItem/index.js +4 -1
  298. package/MenuItem/index.mjs +1 -0
  299. package/MenuItem/package.json +2 -2
  300. package/MenuItem/useMenuItem.js +20 -16
  301. package/{node/MenuItem/useMenuItem.js → MenuItem/useMenuItem.mjs} +16 -20
  302. package/Meta/Meta.js +8 -4
  303. package/Meta/Meta.mjs +6 -0
  304. package/Meta/index.js +7 -2
  305. package/Meta/index.mjs +2 -0
  306. package/Meta/package.json +2 -2
  307. package/NoJs/NoJs.js +8 -4
  308. package/NoJs/NoJs.mjs +7 -0
  309. package/NoJs/index.js +7 -2
  310. package/NoJs/index.mjs +2 -0
  311. package/NoJs/package.json +2 -2
  312. package/Pagination/PaginationNav.js +22 -18
  313. package/Pagination/PaginationNav.mjs +61 -0
  314. package/Pagination/PaginationResults.js +12 -8
  315. package/Pagination/PaginationResults.mjs +11 -0
  316. package/Pagination/index.js +5 -2
  317. package/Pagination/index.mjs +2 -0
  318. package/Pagination/package.json +2 -2
  319. package/Pill/Pill.js +9 -6
  320. package/Pill/Pill.mjs +7 -0
  321. package/Pill/index.js +4 -1
  322. package/Pill/index.mjs +1 -0
  323. package/Pill/package.json +2 -2
  324. package/Progress/ProgressCircular.js +14 -10
  325. package/Progress/ProgressCircular.mjs +15 -0
  326. package/Progress/ProgressLinear.js +13 -9
  327. package/Progress/ProgressLinear.mjs +24 -0
  328. package/Progress/ProgressOverlay.js +20 -16
  329. package/Progress/ProgressOverlay.mjs +24 -0
  330. package/Progress/index.js +6 -3
  331. package/Progress/index.mjs +3 -0
  332. package/Progress/package.json +2 -2
  333. package/Rating/Rating.js +26 -21
  334. package/Rating/Rating.mjs +70 -0
  335. package/Rating/index.js +13 -5
  336. package/{node/Rating/index.js → Rating/index.mjs} +5 -13
  337. package/Rating/package.json +2 -2
  338. package/Select/SelectDownshift.js +4 -1
  339. package/{node/Select/SelectDownshift.js → Select/SelectDownshift.mjs} +1 -4
  340. package/Select/components.js +13 -10
  341. package/Select/components.mjs +12 -0
  342. package/Select/index.js +5 -1
  343. package/Select/index.mjs +3 -0
  344. package/Select/package.json +2 -2
  345. package/Sidebar/Sidebar.js +21 -17
  346. package/Sidebar/Sidebar.mjs +23 -0
  347. package/Sidebar/index.js +4 -1
  348. package/Sidebar/index.mjs +1 -0
  349. package/Sidebar/package.json +2 -2
  350. package/Spacing/Spacing.js +15 -11
  351. package/Spacing/Spacing.mjs +45 -0
  352. package/Spacing/index.js +4 -1
  353. package/Spacing/index.mjs +1 -0
  354. package/Spacing/package.json +2 -2
  355. package/Sticky/Sticky.js +4 -1
  356. package/{node/Sticky/Sticky.js → Sticky/Sticky.mjs} +1 -4
  357. package/Sticky/StickyCss.js +9 -5
  358. package/Sticky/StickyCss.mjs +6 -0
  359. package/Sticky/index.js +4 -1
  360. package/Sticky/index.mjs +1 -0
  361. package/Sticky/package.json +2 -2
  362. package/Tabs/TabsMui.d.ts +287 -55
  363. package/Tabs/TabsMui.js +28 -25
  364. package/Tabs/TabsMui.mjs +46 -0
  365. package/Tabs/index.js +4 -1
  366. package/Tabs/index.mjs +1 -0
  367. package/Tabs/package.json +2 -2
  368. package/{node/Tabs/sc/bare.js → Tabs/sc/bare.mjs} +0 -0
  369. package/Tabs/tw/bare.d.ts +311 -80
  370. package/Tabs/tw/bare.js +17 -14
  371. package/Tabs/tw/bare.mjs +17 -0
  372. package/Tabs/tw/material.d.ts +326 -136
  373. package/Tabs/tw/material.js +17 -14
  374. package/Tabs/tw/material.mjs +18 -0
  375. package/Tabs/useTabs.js +12 -8
  376. package/{node/Tabs/useTabs.js → Tabs/useTabs.mjs} +8 -12
  377. package/Typography/CopyPasteVisible.js +6 -3
  378. package/Typography/CopyPasteVisible.mjs +4 -0
  379. package/Typography/Native.js +16 -13
  380. package/Typography/Native.mjs +14 -0
  381. package/Typography/ReadMore.js +28 -24
  382. package/Typography/ReadMore.mjs +43 -0
  383. package/Typography/TextLoop.js +21 -16
  384. package/{node/Typography/TextLoop.js → Typography/TextLoop.mjs} +16 -21
  385. package/Typography/TypeStairs.js +11 -8
  386. package/{node/Typography/TypeStairs.js → Typography/TypeStairs.mjs} +8 -11
  387. package/Typography/index.js +8 -5
  388. package/Typography/index.mjs +5 -0
  389. package/Typography/package.json +2 -2
  390. package/css/index.js +7 -2
  391. package/{node/tw/index.js → css/index.mjs} +2 -7
  392. package/css/package.json +2 -2
  393. package/helpers/classed.js +10 -6
  394. package/{node/helpers/classed.js → helpers/classed.mjs} +6 -10
  395. package/helpers/createUseMediaQueryWidth.js +16 -11
  396. package/{node/helpers/createUseMediaQueryWidth.js → helpers/createUseMediaQueryWidth.mjs} +11 -16
  397. package/helpers/extend-component.js +10 -6
  398. package/helpers/extend-component.mjs +13 -0
  399. package/helpers/index.js +7 -4
  400. package/helpers/index.mjs +4 -0
  401. package/helpers/mergeRefs.js +6 -2
  402. package/{node/helpers/mergeRefs.js → helpers/mergeRefs.mjs} +2 -6
  403. package/helpers/package.json +2 -2
  404. package/hooks/index.js +24 -21
  405. package/hooks/index.mjs +22 -0
  406. package/hooks/package.json +2 -2
  407. package/hooks/types.js +2 -1
  408. package/hooks/types.mjs +1 -0
  409. package/hooks/useAsyncFn.js +14 -10
  410. package/{node/hooks/useAsyncFn.js → hooks/useAsyncFn.mjs} +10 -14
  411. package/hooks/useDateLocale.js +14 -12
  412. package/{node/hooks/useDateLocale.js → hooks/useDateLocale.mjs} +10 -17
  413. package/hooks/useEffectOnce.js +8 -4
  414. package/hooks/useEffectOnce.mjs +9 -0
  415. package/hooks/useFirstMountState.js +8 -4
  416. package/hooks/useFirstMountState.mjs +13 -0
  417. package/hooks/useFixedOffset.js +21 -16
  418. package/hooks/useFixedOffset.mjs +57 -0
  419. package/hooks/useFocus.js +8 -4
  420. package/hooks/useFocus.mjs +12 -0
  421. package/hooks/useInterval.js +14 -10
  422. package/{node/hooks/useInterval.js → hooks/useInterval.mjs} +10 -14
  423. package/hooks/useIsomorphicLayoutEffect.js +10 -6
  424. package/hooks/useIsomorphicLayoutEffect.mjs +9 -0
  425. package/hooks/useKeyUp.js +12 -8
  426. package/{node/hooks/useKeyUp.js → hooks/useKeyUp.mjs} +8 -12
  427. package/hooks/useMeasure.js +30 -26
  428. package/{node/hooks/useMeasure.js → hooks/useMeasure.mjs} +26 -30
  429. package/hooks/useMount.js +8 -4
  430. package/hooks/useMount.mjs +10 -0
  431. package/hooks/useMountedState.js +10 -6
  432. package/hooks/useMountedState.mjs +16 -0
  433. package/hooks/useNavigateAway.js +13 -8
  434. package/{node/hooks/useNavigateAway.js → hooks/useNavigateAway.mjs} +8 -13
  435. package/hooks/usePrevious.js +8 -4
  436. package/hooks/usePrevious.mjs +12 -0
  437. package/hooks/usePreviousRef.js +9 -5
  438. package/hooks/usePreviousRef.mjs +9 -0
  439. package/hooks/useScrollPosition.js +16 -11
  440. package/{node/hooks/useScrollPosition.js → hooks/useScrollPosition.mjs} +11 -16
  441. package/hooks/useScrollThreshold.js +15 -10
  442. package/hooks/useScrollThreshold.mjs +28 -0
  443. package/hooks/useScrollTo.js +11 -6
  444. package/hooks/useScrollTo.mjs +22 -0
  445. package/hooks/useSmoothScroll.js +18 -13
  446. package/hooks/useSmoothScroll.mjs +39 -0
  447. package/hooks/useTraceUpdate.js +9 -5
  448. package/{node/hooks/useTraceUpdate.js → hooks/useTraceUpdate.mjs} +5 -9
  449. package/hooks/useUpdateEffect.js +10 -6
  450. package/hooks/useUpdateEffect.mjs +15 -0
  451. package/hooks/useWindowSize.js +15 -10
  452. package/hooks/useWindowSize.mjs +29 -0
  453. package/index.js +4 -1
  454. package/{node/index.js → index.mjs} +1 -4
  455. package/m/MotionProvider.js +10 -6
  456. package/{node/m/MotionProvider.js → m/MotionProvider.mjs} +6 -10
  457. package/m/index.js +4 -1
  458. package/m/index.mjs +6 -0
  459. package/m/lite.js +4 -2
  460. package/m/lite.mjs +2 -0
  461. package/m/max.js +4 -2
  462. package/m/max.mjs +2 -0
  463. package/m/package.json +2 -2
  464. package/package.json +26 -22
  465. package/sc/index.js +36 -30
  466. package/sc/index.mjs +31 -0
  467. package/sc/package.json +2 -2
  468. package/scm/index.js +34 -29
  469. package/scm/index.mjs +31 -0
  470. package/scm/package.json +2 -2
  471. package/shared/index.js +11 -8
  472. package/shared/index.mjs +8 -0
  473. package/shared/package.json +2 -2
  474. package/styles/Body.js +7 -4
  475. package/styles/Body.mjs +13 -0
  476. package/styles/Global.js +7 -4
  477. package/styles/Global.mjs +18 -0
  478. package/styles/index.js +10 -7
  479. package/styles/index.mjs +7 -0
  480. package/styles/media.js +13 -8
  481. package/{node/styles/media.js → styles/media.mjs} +8 -13
  482. package/styles/package.json +2 -2
  483. package/styles/spacing.js +11 -4
  484. package/{node/styles/spacing.js → styles/spacing.mjs} +4 -11
  485. package/styles/styled.js +11 -7
  486. package/styles/styled.mjs +13 -0
  487. package/styles/theme--vanilla.js +32 -26
  488. package/styles/theme--vanilla.mjs +58 -0
  489. package/styles/theme.js +12 -8
  490. package/{node/styles/theme.js → styles/theme.mjs} +8 -12
  491. package/tw/index.js +7 -2
  492. package/{node/css/index.js → tw/index.mjs} +2 -7
  493. package/tw/package.json +2 -2
  494. package/twm/index.js +7 -2
  495. package/{node/twm/index.js → twm/index.mjs} +2 -7
  496. package/twm/package.json +2 -2
  497. package/types.js +2 -1
  498. package/types.mjs +1 -0
  499. package/node/Alert/Alert.js +0 -14
  500. package/node/Alert/index.js +0 -4
  501. package/node/Animations/Reveal.js +0 -21
  502. package/node/Animations/Underline.js +0 -8
  503. package/node/Animations/index.js +0 -6
  504. package/node/Autocomplete/components.js +0 -37
  505. package/node/Autocomplete/index.js +0 -7
  506. package/node/Bg/BgColor.js +0 -25
  507. package/node/Bg/BgPhoto.js +0 -20
  508. package/node/Bg/BgSvg.js +0 -16
  509. package/node/Bg/index.js +0 -6
  510. package/node/Breadcrumbs/Breadcrumbs.js +0 -31
  511. package/node/Breadcrumbs/index.js +0 -4
  512. package/node/Buttons/Button.js +0 -17
  513. package/node/Buttons/ButtonComposite.js +0 -32
  514. package/node/Buttons/ButtonFab.js +0 -9
  515. package/node/Buttons/ButtonLink.js +0 -15
  516. package/node/Buttons/IconButton.js +0 -10
  517. package/node/Buttons/index.js +0 -8
  518. package/node/Calendar/CalendarDaygridNav.js +0 -28
  519. package/node/Calendar/CalendarLegend.js +0 -20
  520. package/node/Calendar/index.js +0 -9
  521. package/node/Calendar/types.js +0 -2
  522. package/node/Carousel/CarouselCss.js +0 -26
  523. package/node/Carousel/index.js +0 -4
  524. package/node/Collapsable/Collapsable.js +0 -4
  525. package/node/Collapsable/index.js +0 -5
  526. package/node/Debug/Debug.js +0 -13
  527. package/node/Debug/index.js +0 -4
  528. package/node/Details/Details.js +0 -66
  529. package/node/Details/index.js +0 -4
  530. package/node/Dialog/css/bare.js +0 -24
  531. package/node/Dialog/index.js +0 -5
  532. package/node/Dialog/m/bare.js +0 -55
  533. package/node/Dialog/m/index.js +0 -8
  534. package/node/Dialog/sc/bare.js +0 -46
  535. package/node/Dialog/sc/framer.js +0 -19
  536. package/node/Dialog/sc/framerMaterial.js +0 -19
  537. package/node/Dialog/sc/material.js +0 -24
  538. package/node/Dialog/tw/bare.js +0 -45
  539. package/node/Dialog/tw/elegant.js +0 -23
  540. package/node/Dialog/tw/framer.js +0 -19
  541. package/node/Dialog/tw/framerMaterial.js +0 -19
  542. package/node/Dialog/tw/material.js +0 -23
  543. package/node/Editor/Editor--tiptap.js +0 -31
  544. package/node/Editor/components.js +0 -15
  545. package/node/Editor/index.js +0 -4
  546. package/node/FaviconTags/FaviconTags.js +0 -20
  547. package/node/FaviconTags/index.js +0 -7
  548. package/node/Form/Form.js +0 -65
  549. package/node/Form/index.js +0 -4
  550. package/node/Form/sc/bare.js +0 -23
  551. package/node/Forms/Checkbox/Checkbox.js +0 -21
  552. package/node/Forms/Checkbox/index.js +0 -4
  553. package/node/Forms/Feedback/Feedback.js +0 -13
  554. package/node/Forms/Feedback/index.js +0 -4
  555. package/node/Forms/Field/Field.js +0 -35
  556. package/node/Forms/Field/FieldControl.js +0 -51
  557. package/node/Forms/Field/FieldHint.js +0 -7
  558. package/node/Forms/Field/index.js +0 -5
  559. package/node/Forms/Input/Input.js +0 -20
  560. package/node/Forms/Input/index.js +0 -4
  561. package/node/Forms/InputGroup/InputGroup.js +0 -19
  562. package/node/Forms/InputGroup/index.js +0 -4
  563. package/node/Forms/Label/Label.js +0 -9
  564. package/node/Forms/Label/index.js +0 -4
  565. package/node/Forms/Password/Password.js +0 -20
  566. package/node/Forms/Password/index.js +0 -4
  567. package/node/Forms/Radio/Radio.js +0 -28
  568. package/node/Forms/Radio/index.js +0 -4
  569. package/node/Forms/Switch/Switch.js +0 -23
  570. package/node/Forms/Switch/index.js +0 -4
  571. package/node/Forms/Textarea/Textarea.js +0 -15
  572. package/node/Forms/Textarea/TextareaRich.js +0 -31
  573. package/node/Forms/Textarea/index.js +0 -5
  574. package/node/Forms/Toggle/Toggle.js +0 -36
  575. package/node/Forms/Toggle/index.js +0 -4
  576. package/node/Forms/index.js +0 -19
  577. package/node/Forms/styles.js +0 -32
  578. package/node/Grid/Grid.js +0 -56
  579. package/node/Grid/index.js +0 -4
  580. package/node/Hamburger/Hamburger.js +0 -56
  581. package/node/Hamburger/index.js +0 -4
  582. package/node/Header/index.js +0 -4
  583. package/node/Header/useHeader.js +0 -35
  584. package/node/Hidden/Hidden.js +0 -13
  585. package/node/Hidden/index.js +0 -4
  586. package/node/Img/index.js +0 -4
  587. package/node/Img/types.js +0 -2
  588. package/node/Link/Link.js +0 -7
  589. package/node/Link/LinkBlank.js +0 -21
  590. package/node/Link/index.js +0 -5
  591. package/node/Menu/Menu.js +0 -7
  592. package/node/Menu/MenuMui.js +0 -78
  593. package/node/Menu/index.js +0 -4
  594. package/node/MenuItem/MenuItem.js +0 -7
  595. package/node/MenuItem/MenuItemMui.js +0 -18
  596. package/node/MenuItem/index.js +0 -4
  597. package/node/Meta/Meta.js +0 -10
  598. package/node/Meta/index.js +0 -7
  599. package/node/NoJs/NoJs.js +0 -11
  600. package/node/NoJs/index.js +0 -7
  601. package/node/Pagination/PaginationNav.js +0 -65
  602. package/node/Pagination/PaginationResults.js +0 -15
  603. package/node/Pagination/index.js +0 -5
  604. package/node/Pill/Pill.js +0 -10
  605. package/node/Pill/index.js +0 -4
  606. package/node/Progress/ProgressCircular.js +0 -19
  607. package/node/Progress/ProgressLinear.js +0 -28
  608. package/node/Progress/ProgressOverlay.js +0 -28
  609. package/node/Progress/index.js +0 -6
  610. package/node/Rating/Rating.js +0 -75
  611. package/node/Select/components.js +0 -15
  612. package/node/Select/index.js +0 -7
  613. package/node/Sidebar/Sidebar.js +0 -27
  614. package/node/Sidebar/index.js +0 -4
  615. package/node/Spacing/Spacing.js +0 -49
  616. package/node/Spacing/index.js +0 -4
  617. package/node/Sticky/StickyCss.js +0 -10
  618. package/node/Sticky/index.js +0 -4
  619. package/node/Tabs/TabsMui.js +0 -49
  620. package/node/Tabs/index.js +0 -4
  621. package/node/Tabs/tw/bare.js +0 -20
  622. package/node/Tabs/tw/material.js +0 -21
  623. package/node/Typography/CopyPasteVisible.js +0 -7
  624. package/node/Typography/Native.js +0 -17
  625. package/node/Typography/ReadMore.js +0 -47
  626. package/node/Typography/index.js +0 -8
  627. package/node/helpers/extend-component.js +0 -17
  628. package/node/helpers/index.js +0 -7
  629. package/node/hooks/index.js +0 -25
  630. package/node/hooks/types.js +0 -2
  631. package/node/hooks/useEffectOnce.js +0 -13
  632. package/node/hooks/useFirstMountState.js +0 -17
  633. package/node/hooks/useFixedOffset.js +0 -62
  634. package/node/hooks/useFocus.js +0 -16
  635. package/node/hooks/useIsomorphicLayoutEffect.js +0 -13
  636. package/node/hooks/useMount.js +0 -14
  637. package/node/hooks/useMountedState.js +0 -20
  638. package/node/hooks/usePrevious.js +0 -16
  639. package/node/hooks/usePreviousRef.js +0 -13
  640. package/node/hooks/useScrollThreshold.js +0 -33
  641. package/node/hooks/useScrollTo.js +0 -27
  642. package/node/hooks/useSmoothScroll.js +0 -44
  643. package/node/hooks/useUpdateEffect.js +0 -19
  644. package/node/hooks/useWindowSize.js +0 -34
  645. package/node/m/index.js +0 -9
  646. package/node/m/lite.js +0 -4
  647. package/node/m/max.js +0 -4
  648. package/node/sc/index.js +0 -37
  649. package/node/scm/index.js +0 -36
  650. package/node/shared/index.js +0 -11
  651. package/node/styles/Body.js +0 -16
  652. package/node/styles/Global.js +0 -21
  653. package/node/styles/index.js +0 -10
  654. package/node/styles/styled.js +0 -17
  655. package/node/styles/theme--vanilla.js +0 -64
  656. package/node/types.js +0 -2
@@ -1,14 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useMeasure = void 0;
4
- var tslib_1 = require("tslib");
5
- var react_1 = require("react");
6
- var debounce_1 = tslib_1.__importDefault(require("@koine/utils/debounce"));
7
- var noop_1 = tslib_1.__importDefault(require("@koine/utils/noop"));
8
- var listenResizeDebounced_1 = tslib_1.__importDefault(require("@koine/dom/listenResizeDebounced"));
9
- var listenScrollDebounced_1 = tslib_1.__importDefault(require("@koine/dom/listenScrollDebounced"));
10
- var on_1 = tslib_1.__importDefault(require("@koine/dom/on"));
11
- var off_1 = tslib_1.__importDefault(require("@koine/dom/off"));
1
+ import { __spreadArray } from "tslib";
2
+ import { useEffect, useState, useRef, useMemo } from "react";
3
+ import debounce from "@koine/utils/debounce";
4
+ import noop from "@koine/utils/noop";
5
+ import listenResizeDebounced from "@koine/dom/listenResizeDebounced";
6
+ import listenScrollDebounced from "@koine/dom/listenScrollDebounced";
7
+ import on from "@koine/dom/on";
8
+ import off from "@koine/dom/off";
12
9
  var observer;
13
10
  // Returns a list of scroll offsets
14
11
  function findScrollContainers(element) {
@@ -18,7 +15,7 @@ function findScrollContainers(element) {
18
15
  var _a = window.getComputedStyle(element), overflow = _a.overflow, overflowX = _a.overflowX, overflowY = _a.overflowY;
19
16
  if ([overflow, overflowX, overflowY].some(function (prop) { return prop === "auto" || prop === "scroll"; }))
20
17
  result.push(element);
21
- return tslib_1.__spreadArray(tslib_1.__spreadArray([], result, true), findScrollContainers(element.parentElement), true);
18
+ return __spreadArray(__spreadArray([], result, true), findScrollContainers(element.parentElement), true);
22
19
  }
23
20
  var keys = [
24
21
  "x",
@@ -38,9 +35,9 @@ var areBoundsEqual = function (a, b) {
38
35
  *
39
36
  * @borrows [pmndrs/react-use-measure](https://github.com/pmndrs/react-use-measure)
40
37
  */
41
- function useMeasure(options) {
38
+ export function useMeasure(options) {
42
39
  var _a = (options || {}).scroll /* offsetSize = false */, scroll = _a === void 0 ? false : _a /* offsetSize = false */;
43
- var _b = (0, react_1.useState)({
40
+ var _b = useState({
44
41
  left: 0,
45
42
  top: 0,
46
43
  width: 0,
@@ -51,7 +48,7 @@ function useMeasure(options) {
51
48
  y: 0,
52
49
  }), bounds = _b[0], setBounds = _b[1];
53
50
  // keep all state in a ref
54
- var state = (0, react_1.useRef)([
51
+ var state = useRef([
55
52
  // element
56
53
  null,
57
54
  // scrollContainers
@@ -62,13 +59,13 @@ function useMeasure(options) {
62
59
  bounds,
63
60
  ]);
64
61
  // make sure to update state only as long as the component is truly mounted
65
- var mounted = (0, react_1.useRef)(false);
66
- (0, react_1.useEffect)(function () {
62
+ var mounted = useRef(false);
63
+ useEffect(function () {
67
64
  mounted.current = true;
68
65
  return function () { return void (mounted.current = false); };
69
66
  }, []);
70
67
  // memoize handlers, so event-listeners know when they should update
71
- var _c = (0, react_1.useMemo)(function () {
68
+ var _c = useMemo(function () {
72
69
  var callback = function () {
73
70
  var _args = [];
74
71
  for (var _i = 0; _i < arguments.length; _i++) {
@@ -88,7 +85,7 @@ function useMeasure(options) {
88
85
  setBounds(size);
89
86
  }
90
87
  };
91
- var debouncedCallback = (0, debounce_1.default)(callback);
88
+ var debouncedCallback = debounce(callback);
92
89
  return [callback, debouncedCallback, debouncedCallback];
93
90
  }, [setBounds /* , offsetSize */]), forceRefresh = _c[0] /* resizeChange */, scrollChange = _c[2];
94
91
  // cleanup current scroll-listeners / observers
@@ -96,7 +93,7 @@ function useMeasure(options) {
96
93
  var _a = state.current, scrollContainers = _a[1], resizeObserver = _a[2];
97
94
  if (scrollContainers) {
98
95
  scrollContainers.forEach(function (element) {
99
- return (0, off_1.default)(element, "scroll", scrollChange);
96
+ return off(element, "scroll", scrollChange);
100
97
  });
101
98
  state.current[1] = null;
102
99
  }
@@ -116,7 +113,7 @@ function useMeasure(options) {
116
113
  observer.observe(element);
117
114
  if (scroll && scrollContainers) {
118
115
  scrollContainers.forEach(function (scrollContainer) {
119
- return (0, on_1.default)(scrollContainer, "scroll", scrollChange, {
116
+ return on(scrollContainer, "scroll", scrollChange, {
120
117
  capture: true,
121
118
  passive: true,
122
119
  });
@@ -139,26 +136,26 @@ function useMeasure(options) {
139
136
  // debugger;
140
137
  // forceRefresh();
141
138
  // });
142
- (0, react_1.useEffect)(function () {
139
+ useEffect(function () {
143
140
  if (scroll) {
144
- var listener = (0, listenScrollDebounced_1.default)(0, forceRefresh, 100);
141
+ var listener = listenScrollDebounced(0, forceRefresh, 100);
145
142
  return listener;
146
143
  }
147
- return noop_1.default;
144
+ return noop;
148
145
  }, [scroll, forceRefresh]);
149
- (0, react_1.useEffect)(function () {
146
+ useEffect(function () {
150
147
  // const listener = listenResizeDebounced(onWindowResize);
151
148
  // return listener;
152
- var listener = (0, listenResizeDebounced_1.default)(0, forceRefresh, 100);
149
+ var listener = listenResizeDebounced(0, forceRefresh, 100);
153
150
  return listener;
154
151
  }, [forceRefresh]);
155
152
  // respond to changes that are relevant for the listeners
156
- (0, react_1.useEffect)(function () {
153
+ useEffect(function () {
157
154
  removeListeners();
158
155
  addListeners();
159
156
  // eslint-disable-next-line react-hooks/exhaustive-deps
160
157
  }, [scroll /* , scrollChange, resizeChange */]);
161
- (0, react_1.useEffect)(function () {
158
+ useEffect(function () {
162
159
  // operate on mount, @kuus on the original version there is no call on mount?
163
160
  forceRefresh();
164
161
  // remove all listeners when the components unmounts
@@ -167,5 +164,4 @@ function useMeasure(options) {
167
164
  }, []);
168
165
  return [ref, bounds, forceRefresh];
169
166
  }
170
- exports.useMeasure = useMeasure;
171
- exports.default = useMeasure;
167
+ export default useMeasure;
package/hooks/useMount.js CHANGED
@@ -1,10 +1,14 @@
1
- import { useEffectOnce } from "./useEffectOnce";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useMount = void 0;
4
+ var useEffectOnce_1 = require("./useEffectOnce");
2
5
  /**
3
6
  * @borrows [streamich/react-use](https://github.com/streamich/react-use/blob/master/src/useMount.ts)
4
7
  */
5
- export var useMount = function (fn) {
6
- useEffectOnce(function () {
8
+ var useMount = function (fn) {
9
+ (0, useEffectOnce_1.useEffectOnce)(function () {
7
10
  fn();
8
11
  });
9
12
  };
10
- export default useMount;
13
+ exports.useMount = useMount;
14
+ exports.default = exports.useMount;
@@ -0,0 +1,10 @@
1
+ import { useEffectOnce } from "./useEffectOnce";
2
+ /**
3
+ * @borrows [streamich/react-use](https://github.com/streamich/react-use/blob/master/src/useMount.ts)
4
+ */
5
+ export var useMount = function (fn) {
6
+ useEffectOnce(function () {
7
+ fn();
8
+ });
9
+ };
10
+ export default useMount;
@@ -1,11 +1,14 @@
1
- import { useCallback, useEffect, useRef } from "react";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useMountedState = void 0;
4
+ var react_1 = require("react");
2
5
  /**
3
6
  * @borrows [streamich/react-use](https://github.com/streamich/react-use/blob/master/src/useMountedState.ts)
4
7
  */
5
- export function useMountedState() {
6
- var mountedRef = useRef(false);
7
- var get = useCallback(function () { return mountedRef.current; }, []);
8
- useEffect(function () {
8
+ function useMountedState() {
9
+ var mountedRef = (0, react_1.useRef)(false);
10
+ var get = (0, react_1.useCallback)(function () { return mountedRef.current; }, []);
11
+ (0, react_1.useEffect)(function () {
9
12
  mountedRef.current = true;
10
13
  return function () {
11
14
  mountedRef.current = false;
@@ -13,4 +16,5 @@ export function useMountedState() {
13
16
  }, []);
14
17
  return get;
15
18
  }
16
- export default useMountedState;
19
+ exports.useMountedState = useMountedState;
20
+ exports.default = useMountedState;
@@ -0,0 +1,16 @@
1
+ import { useCallback, useEffect, useRef } from "react";
2
+ /**
3
+ * @borrows [streamich/react-use](https://github.com/streamich/react-use/blob/master/src/useMountedState.ts)
4
+ */
5
+ export function useMountedState() {
6
+ var mountedRef = useRef(false);
7
+ var get = useCallback(function () { return mountedRef.current; }, []);
8
+ useEffect(function () {
9
+ mountedRef.current = true;
10
+ return function () {
11
+ mountedRef.current = false;
12
+ };
13
+ }, []);
14
+ return get;
15
+ }
16
+ export default useMountedState;
@@ -1,5 +1,9 @@
1
- import { useEffect, useRef } from "react";
2
- import on from "@koine/dom/on";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useNavigateAway = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var react_1 = require("react");
6
+ var on_1 = tslib_1.__importDefault(require("@koine/dom/on"));
3
7
  // type UseNavigateAwayPagehideHandler = (event: PageTransitionEvent) => unknown;
4
8
  /**
5
9
  * @resources
@@ -20,10 +24,10 @@ import on from "@koine/dom/on";
20
24
  * For the callback technique see:
21
25
  * - https://stackoverflow.com/a/11835394/1938970
22
26
  */
23
- export var useNavigateAway = function (handler) {
24
- var beforeUnloadHandlerRef = useRef();
27
+ var useNavigateAway = function (handler) {
28
+ var beforeUnloadHandlerRef = (0, react_1.useRef)();
25
29
  // const pagehideHandlerRef = useRef<UseNavigateAwayPagehideHandler | undefined>();
26
- useEffect(function () {
30
+ (0, react_1.useEffect)(function () {
27
31
  beforeUnloadHandlerRef.current = function (event) {
28
32
  var customMessageOrCondition = handler(event);
29
33
  if (customMessageOrCondition) {
@@ -53,8 +57,8 @@ export var useNavigateAway = function (handler) {
53
57
  // }
54
58
  // };
55
59
  }, [handler]);
56
- useEffect(function () {
57
- var listenerBeforeunload = on(window, "beforeunload", function (event) { var _a; return (_a = beforeUnloadHandlerRef.current) === null || _a === void 0 ? void 0 : _a.call(beforeUnloadHandlerRef, event); });
60
+ (0, react_1.useEffect)(function () {
61
+ var listenerBeforeunload = (0, on_1.default)(window, "beforeunload", function (event) { var _a; return (_a = beforeUnloadHandlerRef.current) === null || _a === void 0 ? void 0 : _a.call(beforeUnloadHandlerRef, event); });
58
62
  // const listenerPagehide = on(window, "pagehide", (event) =>
59
63
  // pagehideHandlerRef.current?.(event)
60
64
  // );
@@ -65,4 +69,5 @@ export var useNavigateAway = function (handler) {
65
69
  // };
66
70
  }, []);
67
71
  };
68
- export default useNavigateAway;
72
+ exports.useNavigateAway = useNavigateAway;
73
+ exports.default = exports.useNavigateAway;
@@ -1,9 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useNavigateAway = void 0;
4
- var tslib_1 = require("tslib");
5
- var react_1 = require("react");
6
- var on_1 = tslib_1.__importDefault(require("@koine/dom/on"));
1
+ import { useEffect, useRef } from "react";
2
+ import on from "@koine/dom/on";
7
3
  // type UseNavigateAwayPagehideHandler = (event: PageTransitionEvent) => unknown;
8
4
  /**
9
5
  * @resources
@@ -24,10 +20,10 @@ var on_1 = tslib_1.__importDefault(require("@koine/dom/on"));
24
20
  * For the callback technique see:
25
21
  * - https://stackoverflow.com/a/11835394/1938970
26
22
  */
27
- var useNavigateAway = function (handler) {
28
- var beforeUnloadHandlerRef = (0, react_1.useRef)();
23
+ export var useNavigateAway = function (handler) {
24
+ var beforeUnloadHandlerRef = useRef();
29
25
  // const pagehideHandlerRef = useRef<UseNavigateAwayPagehideHandler | undefined>();
30
- (0, react_1.useEffect)(function () {
26
+ useEffect(function () {
31
27
  beforeUnloadHandlerRef.current = function (event) {
32
28
  var customMessageOrCondition = handler(event);
33
29
  if (customMessageOrCondition) {
@@ -57,8 +53,8 @@ var useNavigateAway = function (handler) {
57
53
  // }
58
54
  // };
59
55
  }, [handler]);
60
- (0, react_1.useEffect)(function () {
61
- var listenerBeforeunload = (0, on_1.default)(window, "beforeunload", function (event) { var _a; return (_a = beforeUnloadHandlerRef.current) === null || _a === void 0 ? void 0 : _a.call(beforeUnloadHandlerRef, event); });
56
+ useEffect(function () {
57
+ var listenerBeforeunload = on(window, "beforeunload", function (event) { var _a; return (_a = beforeUnloadHandlerRef.current) === null || _a === void 0 ? void 0 : _a.call(beforeUnloadHandlerRef, event); });
62
58
  // const listenerPagehide = on(window, "pagehide", (event) =>
63
59
  // pagehideHandlerRef.current?.(event)
64
60
  // );
@@ -69,5 +65,4 @@ var useNavigateAway = function (handler) {
69
65
  // };
70
66
  }, []);
71
67
  };
72
- exports.useNavigateAway = useNavigateAway;
73
- exports.default = exports.useNavigateAway;
68
+ export default useNavigateAway;
@@ -1,12 +1,16 @@
1
- import { useState } from "react";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.usePrevious = void 0;
4
+ var react_1 = require("react");
2
5
  /**
3
6
  * @borrows [samselikoff/animated-carousel](https://github.com/samselikoff/2022-06-02-animated-carousel/blob/main/pages/final.jsx)
4
7
  */
5
- export function usePrevious(state, defaulValue) {
6
- var _a = useState([state, defaulValue]), tuple = _a[0], setTuple = _a[1];
8
+ function usePrevious(state, defaulValue) {
9
+ var _a = (0, react_1.useState)([state, defaulValue]), tuple = _a[0], setTuple = _a[1];
7
10
  if (tuple[1] !== state) {
8
11
  setTuple([tuple[1], state]);
9
12
  }
10
13
  return tuple[0];
11
14
  }
12
- export default usePrevious;
15
+ exports.usePrevious = usePrevious;
16
+ exports.default = usePrevious;
@@ -0,0 +1,12 @@
1
+ import { useState } from "react";
2
+ /**
3
+ * @borrows [samselikoff/animated-carousel](https://github.com/samselikoff/2022-06-02-animated-carousel/blob/main/pages/final.jsx)
4
+ */
5
+ export function usePrevious(state, defaulValue) {
6
+ var _a = useState([state, defaulValue]), tuple = _a[0], setTuple = _a[1];
7
+ if (tuple[1] !== state) {
8
+ setTuple([tuple[1], state]);
9
+ }
10
+ return tuple[0];
11
+ }
12
+ export default usePrevious;
@@ -1,9 +1,13 @@
1
- import { useEffect, useRef } from "react";
2
- export function usePreviousRef(value) {
3
- var ref = useRef();
4
- useEffect(function () {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.usePreviousRef = void 0;
4
+ var react_1 = require("react");
5
+ function usePreviousRef(value) {
6
+ var ref = (0, react_1.useRef)();
7
+ (0, react_1.useEffect)(function () {
5
8
  ref.current = value;
6
9
  });
7
10
  return ref.current;
8
11
  }
9
- export default usePreviousRef;
12
+ exports.usePreviousRef = usePreviousRef;
13
+ exports.default = usePreviousRef;
@@ -0,0 +1,9 @@
1
+ import { useEffect, useRef } from "react";
2
+ export function usePreviousRef(value) {
3
+ var ref = useRef();
4
+ useEffect(function () {
5
+ ref.current = value;
6
+ });
7
+ return ref.current;
8
+ }
9
+ export default usePreviousRef;
@@ -1,13 +1,17 @@
1
- import { useRef } from "react";
2
- import isBrowser from "@koine/utils/isBrowser";
3
- import listenScroll from "@koine/dom/listenScroll";
4
- import useIsomorphicLayoutEffect from "./useIsomorphicLayoutEffect";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useScrollPosition = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var react_1 = require("react");
6
+ var isBrowser_1 = tslib_1.__importDefault(require("@koine/utils/isBrowser"));
7
+ var listenScroll_1 = tslib_1.__importDefault(require("@koine/dom/listenScroll"));
8
+ var useIsomorphicLayoutEffect_1 = tslib_1.__importDefault(require("./useIsomorphicLayoutEffect"));
5
9
  var zeroPosition = { x: 0, y: 0 };
6
10
  var getClientRect = function (element) {
7
11
  return element === null || element === void 0 ? void 0 : element.getBoundingClientRect();
8
12
  };
9
13
  var getScrollPosition = function (element, boundingElement) {
10
- if (!isBrowser) {
14
+ if (!isBrowser_1.default) {
11
15
  return zeroPosition;
12
16
  }
13
17
  if (!boundingElement) {
@@ -32,9 +36,9 @@ var getScrollPosition = function (element, boundingElement) {
32
36
  * - reused internal helper functions
33
37
  * - compacted object arguments in functions as plain argument list to improve compression
34
38
  */
35
- export var useScrollPosition = function (effect, deps, element, boundingElement, wait) {
39
+ var useScrollPosition = function (effect, deps, element, boundingElement, wait) {
36
40
  if (deps === void 0) { deps = []; }
37
- var position = useRef(getScrollPosition(null, boundingElement));
41
+ var position = (0, react_1.useRef)(getScrollPosition(null, boundingElement));
38
42
  var throttleTimeout = null;
39
43
  var callBack = function () {
40
44
  var current = getScrollPosition(element, boundingElement);
@@ -42,8 +46,8 @@ export var useScrollPosition = function (effect, deps, element, boundingElement,
42
46
  position.current = current;
43
47
  throttleTimeout = null;
44
48
  };
45
- useIsomorphicLayoutEffect(function () {
46
- if (!isBrowser) {
49
+ (0, useIsomorphicLayoutEffect_1.default)(function () {
50
+ if (!isBrowser_1.default) {
47
51
  return undefined;
48
52
  }
49
53
  var handleScroll = function () {
@@ -56,7 +60,7 @@ export var useScrollPosition = function (effect, deps, element, boundingElement,
56
60
  callBack();
57
61
  }
58
62
  };
59
- var listener = listenScroll(handleScroll, boundingElement === null || boundingElement === void 0 ? void 0 : boundingElement.current);
63
+ var listener = (0, listenScroll_1.default)(handleScroll, boundingElement === null || boundingElement === void 0 ? void 0 : boundingElement.current);
60
64
  return function () {
61
65
  listener();
62
66
  if (throttleTimeout) {
@@ -65,4 +69,5 @@ export var useScrollPosition = function (effect, deps, element, boundingElement,
65
69
  };
66
70
  }, deps);
67
71
  };
68
- export default useScrollPosition;
72
+ exports.useScrollPosition = useScrollPosition;
73
+ exports.default = exports.useScrollPosition;
@@ -1,17 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useScrollPosition = void 0;
4
- var tslib_1 = require("tslib");
5
- var react_1 = require("react");
6
- var isBrowser_1 = tslib_1.__importDefault(require("@koine/utils/isBrowser"));
7
- var listenScroll_1 = tslib_1.__importDefault(require("@koine/dom/listenScroll"));
8
- var useIsomorphicLayoutEffect_1 = tslib_1.__importDefault(require("./useIsomorphicLayoutEffect"));
1
+ import { useRef } from "react";
2
+ import isBrowser from "@koine/utils/isBrowser";
3
+ import listenScroll from "@koine/dom/listenScroll";
4
+ import useIsomorphicLayoutEffect from "./useIsomorphicLayoutEffect";
9
5
  var zeroPosition = { x: 0, y: 0 };
10
6
  var getClientRect = function (element) {
11
7
  return element === null || element === void 0 ? void 0 : element.getBoundingClientRect();
12
8
  };
13
9
  var getScrollPosition = function (element, boundingElement) {
14
- if (!isBrowser_1.default) {
10
+ if (!isBrowser) {
15
11
  return zeroPosition;
16
12
  }
17
13
  if (!boundingElement) {
@@ -36,9 +32,9 @@ var getScrollPosition = function (element, boundingElement) {
36
32
  * - reused internal helper functions
37
33
  * - compacted object arguments in functions as plain argument list to improve compression
38
34
  */
39
- var useScrollPosition = function (effect, deps, element, boundingElement, wait) {
35
+ export var useScrollPosition = function (effect, deps, element, boundingElement, wait) {
40
36
  if (deps === void 0) { deps = []; }
41
- var position = (0, react_1.useRef)(getScrollPosition(null, boundingElement));
37
+ var position = useRef(getScrollPosition(null, boundingElement));
42
38
  var throttleTimeout = null;
43
39
  var callBack = function () {
44
40
  var current = getScrollPosition(element, boundingElement);
@@ -46,8 +42,8 @@ var useScrollPosition = function (effect, deps, element, boundingElement, wait)
46
42
  position.current = current;
47
43
  throttleTimeout = null;
48
44
  };
49
- (0, useIsomorphicLayoutEffect_1.default)(function () {
50
- if (!isBrowser_1.default) {
45
+ useIsomorphicLayoutEffect(function () {
46
+ if (!isBrowser) {
51
47
  return undefined;
52
48
  }
53
49
  var handleScroll = function () {
@@ -60,7 +56,7 @@ var useScrollPosition = function (effect, deps, element, boundingElement, wait)
60
56
  callBack();
61
57
  }
62
58
  };
63
- var listener = (0, listenScroll_1.default)(handleScroll, boundingElement === null || boundingElement === void 0 ? void 0 : boundingElement.current);
59
+ var listener = listenScroll(handleScroll, boundingElement === null || boundingElement === void 0 ? void 0 : boundingElement.current);
64
60
  return function () {
65
61
  listener();
66
62
  if (throttleTimeout) {
@@ -69,5 +65,4 @@ var useScrollPosition = function (effect, deps, element, boundingElement, wait)
69
65
  };
70
66
  }, deps);
71
67
  };
72
- exports.useScrollPosition = useScrollPosition;
73
- exports.default = exports.useScrollPosition;
68
+ export default useScrollPosition;
@@ -1,9 +1,13 @@
1
- import { useCallback, useEffect, useState } from "react";
2
- import noop from "@koine/utils/noop";
3
- import listenScroll from "@koine/dom/listenScroll";
4
- export var useScrollThreshold = function (threshold, callback) {
5
- var _a = useState(false), isBelow = _a[0], setIsBelow = _a[1];
6
- var handler = useCallback(function () {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useScrollThreshold = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var react_1 = require("react");
6
+ var noop_1 = tslib_1.__importDefault(require("@koine/utils/noop"));
7
+ var listenScroll_1 = tslib_1.__importDefault(require("@koine/dom/listenScroll"));
8
+ var useScrollThreshold = function (threshold, callback) {
9
+ var _a = (0, react_1.useState)(false), isBelow = _a[0], setIsBelow = _a[1];
10
+ var handler = (0, react_1.useCallback)(function () {
7
11
  if (threshold) {
8
12
  var posY = window.scrollY; // * -1;
9
13
  var isAbove = posY < threshold;
@@ -14,15 +18,16 @@ export var useScrollThreshold = function (threshold, callback) {
14
18
  callback(isAbove, isBelow_1);
15
19
  }
16
20
  }, [threshold, callback]);
17
- useEffect(function () {
21
+ (0, react_1.useEffect)(function () {
18
22
  if (threshold) {
19
23
  // const listener = listenScrollThrottled(0, handler, 50);
20
- var listener = listenScroll(handler);
24
+ var listener = (0, listenScroll_1.default)(handler);
21
25
  handler();
22
26
  return listener;
23
27
  }
24
- return noop;
28
+ return noop_1.default;
25
29
  }, [threshold, handler]);
26
30
  return isBelow;
27
31
  };
28
- export default useScrollThreshold;
32
+ exports.useScrollThreshold = useScrollThreshold;
33
+ exports.default = exports.useScrollThreshold;
@@ -0,0 +1,28 @@
1
+ import { useCallback, useEffect, useState } from "react";
2
+ import noop from "@koine/utils/noop";
3
+ import listenScroll from "@koine/dom/listenScroll";
4
+ export var useScrollThreshold = function (threshold, callback) {
5
+ var _a = useState(false), isBelow = _a[0], setIsBelow = _a[1];
6
+ var handler = useCallback(function () {
7
+ if (threshold) {
8
+ var posY = window.scrollY; // * -1;
9
+ var isAbove = posY < threshold;
10
+ var isBelow_1 = posY > threshold;
11
+ // console.log("useScrollThreshold setIsBelow", isBelow, posY, threshold);
12
+ setIsBelow(isBelow_1);
13
+ if (callback)
14
+ callback(isAbove, isBelow_1);
15
+ }
16
+ }, [threshold, callback]);
17
+ useEffect(function () {
18
+ if (threshold) {
19
+ // const listener = listenScrollThrottled(0, handler, 50);
20
+ var listener = listenScroll(handler);
21
+ handler();
22
+ return listener;
23
+ }
24
+ return noop;
25
+ }, [threshold, handler]);
26
+ return isBelow;
27
+ };
28
+ export default useScrollThreshold;
@@ -1,10 +1,14 @@
1
- import isBrowser from "@koine/utils/isBrowser";
2
- import useHeader from "../Header/useHeader";
3
- export function useScrollTo(id, offset) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useScrollTo = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var isBrowser_1 = tslib_1.__importDefault(require("@koine/utils/isBrowser"));
6
+ var useHeader_1 = tslib_1.__importDefault(require("../Header/useHeader"));
7
+ function useScrollTo(id, offset) {
4
8
  if (id === void 0) { id = ""; }
5
9
  if (offset === void 0) { offset = 0; }
6
- var _a = useHeader(), headerHeight = _a[2];
7
- if (!isBrowser) {
10
+ var _a = (0, useHeader_1.default)(), headerHeight = _a[2];
11
+ if (!isBrowser_1.default) {
8
12
  return;
9
13
  }
10
14
  var headerOffset = headerHeight || 0;
@@ -19,4 +23,5 @@ export function useScrollTo(id, offset) {
19
23
  top -= headerOffset;
20
24
  window.scroll(0, top);
21
25
  }
22
- export default useScrollTo;
26
+ exports.useScrollTo = useScrollTo;
27
+ exports.default = useScrollTo;
@@ -0,0 +1,22 @@
1
+ import isBrowser from "@koine/utils/isBrowser";
2
+ import useHeader from "../Header/useHeader";
3
+ export function useScrollTo(id, offset) {
4
+ if (id === void 0) { id = ""; }
5
+ if (offset === void 0) { offset = 0; }
6
+ var _a = useHeader(), headerHeight = _a[2];
7
+ if (!isBrowser) {
8
+ return;
9
+ }
10
+ var headerOffset = headerHeight || 0;
11
+ var element = document.getElementById(id);
12
+ var top = 0;
13
+ if (element && element.offsetParent) {
14
+ do {
15
+ top += element.offsetTop;
16
+ } while ((element = element.offsetParent));
17
+ }
18
+ top -= offset;
19
+ top -= headerOffset;
20
+ window.scroll(0, top);
21
+ }
22
+ export default useScrollTo;