@koine/react 1.1.9 → 1.1.11

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