@koine/react 2.0.0-beta.38 → 2.0.0-beta.39

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 (470) hide show
  1. package/README.md +1 -0
  2. package/calendar/CalendarDaygridCell.d.ts +4 -4
  3. package/calendar/CalendarDaygridNav.d.ts +3 -3
  4. package/calendar/CalendarDaygridTable.d.ts +4 -4
  5. package/calendar/CalendarLegend.d.ts +3 -3
  6. package/calendar/calendar-api-google.d.ts +2 -2
  7. package/calendar/useCalendar.d.ts +5 -5
  8. package/calendar/useDateLocale.d.ts +2 -0
  9. package/calendar/utils.d.ts +11 -11
  10. package/calendar.cjs.d.ts +1 -0
  11. package/calendar.cjs.default.js +1 -0
  12. package/calendar.cjs.js +62 -0
  13. package/calendar.cjs.mjs +2 -0
  14. package/calendar.d.ts +7 -0
  15. package/calendar.esm.js +35 -0
  16. package/components/FaviconTags.d.ts +8 -0
  17. package/components/Meta.d.ts +4 -0
  18. package/components/NoJs.d.ts +2 -0
  19. package/forms/antispam.d.ts +6 -6
  20. package/forms.cjs.d.ts +1 -0
  21. package/forms.cjs.default.js +1 -0
  22. package/forms.cjs.js +11 -0
  23. package/forms.cjs.mjs +2 -0
  24. package/forms.d.ts +1 -0
  25. package/forms.esm.js +6 -0
  26. package/hooks/index.d.ts +19 -0
  27. package/{useAsyncFn.d.ts → hooks/useAsyncFn.d.ts} +3 -3
  28. package/hooks/useFirstMountState.d.ts +1 -0
  29. package/hooks/useFixedOffset.d.ts +1 -0
  30. package/hooks/useFocus.d.ts +1 -0
  31. package/hooks/useInterval.d.ts +1 -0
  32. package/hooks/useIsomorphicLayoutEffect.d.ts +2 -0
  33. package/hooks/useKeyUp.d.ts +1 -0
  34. package/{useMeasure.d.ts → hooks/useMeasure.d.ts} +2 -2
  35. package/hooks/useMountedState.d.ts +1 -0
  36. package/hooks/useNavigateAway.d.ts +2 -0
  37. package/hooks/usePrevious.d.ts +1 -0
  38. package/hooks/usePreviousRef.d.ts +1 -0
  39. package/{useReveal.d.ts → hooks/useReveal.d.ts} +1 -1
  40. package/hooks/useScrollPosition.d.ts +7 -0
  41. package/hooks/useScrollThreshold.d.ts +1 -0
  42. package/hooks/useScrollTo.d.ts +1 -0
  43. package/hooks/useSmoothScroll.d.ts +1 -0
  44. package/hooks/useSpinDelay.d.ts +1 -0
  45. package/hooks/useTraceUpdate.d.ts +1 -0
  46. package/hooks/useUpdateEffect.d.ts +2 -0
  47. package/hooks/useWindowSize.d.ts +2 -0
  48. package/index.cjs.d.ts +1 -0
  49. package/index.cjs.default.js +1 -0
  50. package/index.cjs.js +77 -0
  51. package/index.cjs.mjs +2 -0
  52. package/index.d.ts +3 -26
  53. package/index.esm.js +51 -0
  54. package/package.json +21 -639
  55. package/utils/classed.d.ts +8 -0
  56. package/{createUseMediaQueryWidth.d.ts → utils/createUseMediaQueryWidth.d.ts} +2 -2
  57. package/{extendComponent.d.ts → utils/extendComponent.d.ts} +2 -3
  58. package/utils/index.d.ts +5 -0
  59. package/utils/mergeRefs.d.ts +1 -0
  60. package/Alert/Alert.d.ts +0 -5
  61. package/Alert/Alert.js +0 -10
  62. package/Alert/index.d.ts +0 -1
  63. package/Alert/index.js +0 -1
  64. package/Animations/Reveal.d.ts +0 -3
  65. package/Animations/Reveal.js +0 -16
  66. package/Animations/Underline.d.ts +0 -1
  67. package/Animations/Underline.js +0 -5
  68. package/Animations/index.d.ts +0 -3
  69. package/Animations/index.js +0 -3
  70. package/Animations/useReveal.d.ts +0 -13
  71. package/Animations/useReveal.js +0 -43
  72. package/Autocomplete/AutocompleteDownshift.d.ts +0 -1
  73. package/Autocomplete/AutocompleteDownshift.js +0 -1
  74. package/Autocomplete/AutocompleteDownshiftMultiselect.d.ts +0 -1
  75. package/Autocomplete/AutocompleteDownshiftMultiselect.js +0 -1
  76. package/Autocomplete/AutocompleteMui.d.ts +0 -22
  77. package/Autocomplete/AutocompleteMui.js +0 -93
  78. package/Autocomplete/AutocompleteReach.d.ts +0 -1
  79. package/Autocomplete/AutocompleteReach.js +0 -1
  80. package/Autocomplete/components.d.ts +0 -12
  81. package/Autocomplete/components.js +0 -26
  82. package/Autocomplete/helpers.d.ts +0 -3
  83. package/Autocomplete/helpers.js +0 -16
  84. package/Autocomplete/index.d.ts +0 -2
  85. package/Autocomplete/index.js +0 -1
  86. package/Bg/BgColor.d.ts +0 -12
  87. package/Bg/BgColor.js +0 -16
  88. package/Bg/BgPhoto.d.ts +0 -8
  89. package/Bg/BgPhoto.js +0 -16
  90. package/Bg/BgSvg.d.ts +0 -4
  91. package/Bg/BgSvg.js +0 -9
  92. package/Bg/index.d.ts +0 -3
  93. package/Bg/index.js +0 -3
  94. package/Breadcrumbs/Breadcrumbs.d.ts +0 -13
  95. package/Breadcrumbs/Breadcrumbs.js +0 -27
  96. package/Breadcrumbs/index.d.ts +0 -1
  97. package/Breadcrumbs/index.js +0 -1
  98. package/Buttons/Button.d.ts +0 -14
  99. package/Buttons/Button.js +0 -10
  100. package/Buttons/ButtonComposite.d.ts +0 -22
  101. package/Buttons/ButtonComposite.js +0 -28
  102. package/Buttons/ButtonFab.d.ts +0 -4
  103. package/Buttons/ButtonFab.js +0 -6
  104. package/Buttons/ButtonLink.d.ts +0 -8
  105. package/Buttons/ButtonLink.js +0 -11
  106. package/Buttons/IconButton.d.ts +0 -8
  107. package/Buttons/IconButton.js +0 -7
  108. package/Buttons/index.d.ts +0 -5
  109. package/Buttons/index.js +0 -5
  110. package/Calendar/CalendarDaygridCell.d.ts +0 -35
  111. package/Calendar/CalendarDaygridCell.js +0 -46
  112. package/Calendar/CalendarDaygridNav.d.ts +0 -27
  113. package/Calendar/CalendarDaygridNav.js +0 -24
  114. package/Calendar/CalendarDaygridTable.d.ts +0 -25
  115. package/Calendar/CalendarDaygridTable.js +0 -45
  116. package/Calendar/CalendarLegend.d.ts +0 -18
  117. package/Calendar/CalendarLegend.js +0 -9
  118. package/Calendar/calendar-api-google.d.ts +0 -10
  119. package/Calendar/calendar-api-google.js +0 -124
  120. package/Calendar/index.d.ts +0 -6
  121. package/Calendar/index.js +0 -6
  122. package/Calendar/types.d.ts +0 -62
  123. package/Calendar/types.js +0 -1
  124. package/Calendar/useCalendar.d.ts +0 -35
  125. package/Calendar/useCalendar.js +0 -176
  126. package/Calendar/utils.d.ts +0 -11
  127. package/Calendar/utils.js +0 -185
  128. package/Carousel/Carousel.d.ts +0 -1
  129. package/Carousel/Carousel.js +0 -1
  130. package/Carousel/CarouselCss.d.ts +0 -13
  131. package/Carousel/CarouselCss.js +0 -19
  132. package/Carousel/index.d.ts +0 -1
  133. package/Carousel/index.js +0 -1
  134. package/Collapsable/Collapsable.d.ts +0 -1
  135. package/Collapsable/Collapsable.js +0 -1
  136. package/Collapsable/CollapsableReach.d.ts +0 -0
  137. package/Collapsable/CollapsableReach.js +0 -1
  138. package/Collapsable/index.d.ts +0 -1
  139. package/Collapsable/index.js +0 -1
  140. package/Debug/Debug.d.ts +0 -4
  141. package/Debug/Debug.js +0 -9
  142. package/Debug/index.d.ts +0 -1
  143. package/Debug/index.js +0 -1
  144. package/Details/Details.d.ts +0 -398
  145. package/Details/Details.js +0 -52
  146. package/Details/index.d.ts +0 -1
  147. package/Details/index.js +0 -1
  148. package/Dialog/DialogMui.d.ts +0 -165
  149. package/Dialog/DialogMui.js +0 -39
  150. package/Dialog/css/bare.d.ts +0 -171
  151. package/Dialog/css/bare.js +0 -21
  152. package/Dialog/index.d.ts +0 -2
  153. package/Dialog/index.js +0 -1
  154. package/Dialog/m/bare.d.ts +0 -4
  155. package/Dialog/m/bare.js +0 -3
  156. package/Dialog/m/basic.d.ts +0 -4
  157. package/Dialog/m/basic.js +0 -28
  158. package/Dialog/m/index.d.ts +0 -2
  159. package/Dialog/m/index.js +0 -4
  160. package/Dialog/sc/bare.d.ts +0 -61
  161. package/Dialog/sc/bare.js +0 -31
  162. package/Dialog/sc/framer.d.ts +0 -24
  163. package/Dialog/sc/framer.js +0 -16
  164. package/Dialog/sc/framerMaterial.d.ts +0 -24
  165. package/Dialog/sc/framerMaterial.js +0 -16
  166. package/Dialog/sc/material.d.ts +0 -60
  167. package/Dialog/sc/material.js +0 -21
  168. package/Dialog/tw/bare.d.ts +0 -208
  169. package/Dialog/tw/bare.js +0 -29
  170. package/Dialog/tw/elegant.d.ts +0 -270
  171. package/Dialog/tw/elegant.js +0 -21
  172. package/Dialog/tw/framer.d.ts +0 -108
  173. package/Dialog/tw/framer.js +0 -16
  174. package/Dialog/tw/framerMaterial.d.ts +0 -164
  175. package/Dialog/tw/framerMaterial.js +0 -16
  176. package/Dialog/tw/material.d.ts +0 -270
  177. package/Dialog/tw/material.js +0 -21
  178. package/Editor/Editor--tiptap.d.ts +0 -9
  179. package/Editor/Editor--tiptap.js +0 -26
  180. package/Editor/components.d.ts +0 -5
  181. package/Editor/components.js +0 -10
  182. package/Editor/index.d.ts +0 -1
  183. package/Editor/index.js +0 -1
  184. package/FaviconTags.d.ts +0 -9
  185. package/FaviconTags.js +0 -6
  186. package/Form/Form.d.ts +0 -125
  187. package/Form/Form.js +0 -60
  188. package/Form/index.d.ts +0 -1
  189. package/Form/index.js +0 -1
  190. package/Form/sc/bare.d.ts +0 -57
  191. package/Form/sc/bare.js +0 -20
  192. package/Forms/Checkbox/Checkbox.d.ts +0 -7
  193. package/Forms/Checkbox/Checkbox.js +0 -15
  194. package/Forms/Checkbox/index.d.ts +0 -1
  195. package/Forms/Checkbox/index.js +0 -1
  196. package/Forms/Feedback/Feedback.d.ts +0 -5
  197. package/Forms/Feedback/Feedback.js +0 -9
  198. package/Forms/Feedback/index.d.ts +0 -1
  199. package/Forms/Feedback/index.js +0 -1
  200. package/Forms/Field/Field.d.ts +0 -18
  201. package/Forms/Field/Field.js +0 -25
  202. package/Forms/Field/FieldControl.d.ts +0 -14
  203. package/Forms/Field/FieldControl.js +0 -35
  204. package/Forms/Field/FieldHint.d.ts +0 -1
  205. package/Forms/Field/FieldHint.js +0 -4
  206. package/Forms/Field/index.d.ts +0 -2
  207. package/Forms/Field/index.js +0 -2
  208. package/Forms/Input/Input.d.ts +0 -8
  209. package/Forms/Input/Input.js +0 -16
  210. package/Forms/Input/index.d.ts +0 -1
  211. package/Forms/Input/index.js +0 -1
  212. package/Forms/InputGroup/InputGroup.d.ts +0 -12
  213. package/Forms/InputGroup/InputGroup.js +0 -15
  214. package/Forms/InputGroup/index.d.ts +0 -1
  215. package/Forms/InputGroup/index.js +0 -1
  216. package/Forms/Label/Label.d.ts +0 -3
  217. package/Forms/Label/Label.js +0 -6
  218. package/Forms/Label/index.d.ts +0 -1
  219. package/Forms/Label/index.js +0 -1
  220. package/Forms/Password/Password.d.ts +0 -4
  221. package/Forms/Password/Password.js +0 -17
  222. package/Forms/Password/index.d.ts +0 -1
  223. package/Forms/Password/index.js +0 -1
  224. package/Forms/Radio/Radio.d.ts +0 -11
  225. package/Forms/Radio/Radio.js +0 -25
  226. package/Forms/Radio/index.d.ts +0 -1
  227. package/Forms/Radio/index.js +0 -1
  228. package/Forms/Switch/Switch.d.ts +0 -5
  229. package/Forms/Switch/Switch.js +0 -17
  230. package/Forms/Switch/index.d.ts +0 -1
  231. package/Forms/Switch/index.js +0 -1
  232. package/Forms/Textarea/Textarea.d.ts +0 -4
  233. package/Forms/Textarea/Textarea.js +0 -12
  234. package/Forms/Textarea/TextareaRich.d.ts +0 -5
  235. package/Forms/Textarea/TextareaRich.js +0 -26
  236. package/Forms/Textarea/index.d.ts +0 -2
  237. package/Forms/Textarea/index.js +0 -2
  238. package/Forms/Toggle/Toggle-tailwind.d.ts +0 -0
  239. package/Forms/Toggle/Toggle-tailwind.js +0 -1
  240. package/Forms/Toggle/Toggle.d.ts +0 -18
  241. package/Forms/Toggle/Toggle.js +0 -25
  242. package/Forms/Toggle/index.d.ts +0 -1
  243. package/Forms/Toggle/index.js +0 -1
  244. package/Forms/Toggle/useToggle-tailwind.d.ts +0 -0
  245. package/Forms/Toggle/useToggle-tailwind.js +0 -1
  246. package/Forms/Toggle/useToggle.d.ts +0 -16
  247. package/Forms/Toggle/useToggle.js +0 -85
  248. package/Forms/antispam.d.ts +0 -27
  249. package/Forms/antispam.js +0 -29
  250. package/Forms/helpers.d.ts +0 -18
  251. package/Forms/helpers.js +0 -35
  252. package/Forms/index.d.ts +0 -15
  253. package/Forms/index.js +0 -15
  254. package/Forms/styles.d.ts +0 -9
  255. package/Forms/styles.js +0 -19
  256. package/Gauge/Gauge.d.ts +0 -4
  257. package/Gauge/Gauge.js +0 -1
  258. package/Grid/Grid.d.ts +0 -32
  259. package/Grid/Grid.js +0 -52
  260. package/Grid/index.d.ts +0 -1
  261. package/Grid/index.js +0 -1
  262. package/Hamburger/Hamburger.d.ts +0 -5
  263. package/Hamburger/Hamburger.js +0 -47
  264. package/Hamburger/index.d.ts +0 -1
  265. package/Hamburger/index.js +0 -1
  266. package/Header/index.d.ts +0 -1
  267. package/Header/index.js +0 -1
  268. package/Header/useHeader.d.ts +0 -20
  269. package/Header/useHeader.js +0 -32
  270. package/Hidden/Hidden.d.ts +0 -6
  271. package/Hidden/Hidden.js +0 -10
  272. package/Hidden/index.d.ts +0 -1
  273. package/Hidden/index.js +0 -1
  274. package/Img/index.d.ts +0 -1
  275. package/Img/index.js +0 -1
  276. package/Img/sc/bare.d.ts +0 -2
  277. package/Img/sc/bare.js +0 -4
  278. package/Img/types.d.ts +0 -9
  279. package/Img/types.js +0 -1
  280. package/Link/Link.d.ts +0 -3
  281. package/Link/Link.js +0 -4
  282. package/Link/LinkBlank.d.ts +0 -5
  283. package/Link/LinkBlank.js +0 -15
  284. package/Link/index.d.ts +0 -2
  285. package/Link/index.js +0 -2
  286. package/Menu/Menu.d.ts +0 -1
  287. package/Menu/Menu.js +0 -4
  288. package/Menu/MenuMui.d.ts +0 -0
  289. package/Menu/MenuMui.js +0 -1
  290. package/Menu/index.d.ts +0 -1
  291. package/Menu/index.js +0 -1
  292. package/MenuItem/MenuItem.d.ts +0 -1
  293. package/MenuItem/MenuItem.js +0 -4
  294. package/MenuItem/MenuItemMui.d.ts +0 -0
  295. package/MenuItem/MenuItemMui.js +0 -1
  296. package/MenuItem/index.d.ts +0 -1
  297. package/MenuItem/index.js +0 -1
  298. package/MenuItem/useMenuItem.d.ts +0 -9
  299. package/MenuItem/useMenuItem.js +0 -42
  300. package/Meta.d.ts +0 -5
  301. package/Meta.js +0 -6
  302. package/NoJs.d.ts +0 -3
  303. package/NoJs.js +0 -7
  304. package/Pagination/PaginationNav.d.ts +0 -14
  305. package/Pagination/PaginationNav.js +0 -48
  306. package/Pagination/PaginationResults.d.ts +0 -3
  307. package/Pagination/PaginationResults.js +0 -11
  308. package/Pagination/index.d.ts +0 -2
  309. package/Pagination/index.js +0 -2
  310. package/Pill/Pill.d.ts +0 -5
  311. package/Pill/Pill.js +0 -7
  312. package/Pill/index.d.ts +0 -1
  313. package/Pill/index.js +0 -1
  314. package/Polymorphic.js +0 -1
  315. package/Progress/ProgressCircular.d.ts +0 -13
  316. package/Progress/ProgressCircular.js +0 -12
  317. package/Progress/ProgressLinear.d.ts +0 -15
  318. package/Progress/ProgressLinear.js +0 -21
  319. package/Progress/ProgressOverlay.d.ts +0 -4
  320. package/Progress/ProgressOverlay.js +0 -23
  321. package/Progress/index.d.ts +0 -3
  322. package/Progress/index.js +0 -3
  323. package/Rating/Rating.d.ts +0 -27
  324. package/Rating/Rating.js +0 -43
  325. package/Rating/index.d.ts +0 -8
  326. package/Rating/index.js +0 -45
  327. package/Select/SelectDownshift.d.ts +0 -5
  328. package/Select/SelectDownshift.js +0 -1
  329. package/Select/components.d.ts +0 -6
  330. package/Select/components.js +0 -12
  331. package/Select/index.d.ts +0 -2
  332. package/Select/index.js +0 -1
  333. package/Sidebar/Sidebar.d.ts +0 -3
  334. package/Sidebar/Sidebar.js +0 -23
  335. package/Sidebar/index.d.ts +0 -1
  336. package/Sidebar/index.js +0 -1
  337. package/Spacing/Spacing.d.ts +0 -17
  338. package/Spacing/Spacing.js +0 -32
  339. package/Spacing/index.d.ts +0 -1
  340. package/Spacing/index.js +0 -1
  341. package/Sticky/Sticky.d.ts +0 -2
  342. package/Sticky/Sticky.js +0 -1
  343. package/Sticky/StickyCss.d.ts +0 -5
  344. package/Sticky/StickyCss.js +0 -6
  345. package/Sticky/index.d.ts +0 -1
  346. package/Sticky/index.js +0 -1
  347. package/Tabs/TabsMui.d.ts +0 -84
  348. package/Tabs/TabsMui.js +0 -30
  349. package/Tabs/index.d.ts +0 -1
  350. package/Tabs/index.js +0 -1
  351. package/Tabs/sc/bare.d.ts +0 -0
  352. package/Tabs/sc/bare.js +0 -1
  353. package/Tabs/tw/bare.d.ts +0 -85
  354. package/Tabs/tw/bare.js +0 -17
  355. package/Tabs/tw/material.d.ts +0 -118
  356. package/Tabs/tw/material.js +0 -19
  357. package/Tabs/useTabs.d.ts +0 -21
  358. package/Tabs/useTabs.js +0 -44
  359. package/Typography/CopyPasteVisible.d.ts +0 -1
  360. package/Typography/CopyPasteVisible.js +0 -4
  361. package/Typography/Native.d.ts +0 -10
  362. package/Typography/Native.js +0 -14
  363. package/Typography/ReadMore.d.ts +0 -10
  364. package/Typography/ReadMore.js +0 -42
  365. package/Typography/TextLoop.d.ts +0 -16
  366. package/Typography/TextLoop.js +0 -45
  367. package/Typography/TypeStairs.d.ts +0 -6
  368. package/Typography/TypeStairs.js +0 -42
  369. package/Typography/index.d.ts +0 -5
  370. package/Typography/index.js +0 -5
  371. package/calendar/CalendarDaygridCell.js +0 -48
  372. package/calendar/CalendarDaygridNav.js +0 -24
  373. package/calendar/CalendarDaygridTable.js +0 -45
  374. package/calendar/CalendarLegend.js +0 -9
  375. package/calendar/calendar-api-google.js +0 -124
  376. package/calendar/index.d.ts +0 -6
  377. package/calendar/index.js +0 -6
  378. package/calendar/types.js +0 -1
  379. package/calendar/useCalendar.js +0 -176
  380. package/calendar/utils.js +0 -185
  381. package/classed.d.ts +0 -8
  382. package/classed.js +0 -43
  383. package/createUseMediaQueryWidth.js +0 -39
  384. package/css/index.d.ts +0 -1
  385. package/css/index.js +0 -1
  386. package/extendComponent.js +0 -9
  387. package/forms/antispam.js +0 -29
  388. package/forms/index.d.ts +0 -1
  389. package/forms/index.js +0 -1
  390. package/index.js +0 -24
  391. package/m/MotionProvider.d.ts +0 -6
  392. package/m/MotionProvider.js +0 -7
  393. package/m/index.d.ts +0 -1
  394. package/m/index.js +0 -1
  395. package/m/lite.d.ts +0 -2
  396. package/m/lite.js +0 -2
  397. package/m/max.d.ts +0 -2
  398. package/m/max.js +0 -2
  399. package/mergeRefs.d.ts +0 -2
  400. package/mergeRefs.js +0 -13
  401. package/sc/index.d.ts +0 -29
  402. package/sc/index.js +0 -29
  403. package/scm/index.d.ts +0 -28
  404. package/scm/index.js +0 -28
  405. package/shared/index.d.ts +0 -7
  406. package/shared/index.js +0 -7
  407. package/styles/Body.d.ts +0 -2
  408. package/styles/Body.js +0 -5
  409. package/styles/Global.d.ts +0 -2
  410. package/styles/Global.js +0 -5
  411. package/styles/index.d.ts +0 -7
  412. package/styles/index.js +0 -7
  413. package/styles/media.d.ts +0 -18
  414. package/styles/media.js +0 -75
  415. package/styles/spacing.d.ts +0 -12
  416. package/styles/spacing.js +0 -45
  417. package/styles/styled.d.ts +0 -8
  418. package/styles/styled.js +0 -9
  419. package/styles/theme--vanilla.d.ts +0 -17
  420. package/styles/theme--vanilla.js +0 -47
  421. package/styles/theme.d.ts +0 -53
  422. package/styles/theme.js +0 -30
  423. package/tw/index.d.ts +0 -1
  424. package/tw/index.js +0 -1
  425. package/twm/index.d.ts +0 -1
  426. package/twm/index.js +0 -1
  427. package/types.js +0 -1
  428. package/typings.d.ts +0 -6
  429. package/useAsyncFn.js +0 -33
  430. package/useDateLocale.d.ts +0 -3
  431. package/useDateLocale.js +0 -28
  432. package/useFirstMountState.d.ts +0 -2
  433. package/useFirstMountState.js +0 -10
  434. package/useFixedOffset.d.ts +0 -2
  435. package/useFixedOffset.js +0 -42
  436. package/useFocus.d.ts +0 -2
  437. package/useFocus.js +0 -9
  438. package/useInterval.d.ts +0 -2
  439. package/useInterval.js +0 -22
  440. package/useIsomorphicLayoutEffect.d.ts +0 -3
  441. package/useIsomorphicLayoutEffect.js +0 -6
  442. package/useKeyUp.d.ts +0 -2
  443. package/useKeyUp.js +0 -18
  444. package/useMeasure.js +0 -130
  445. package/useMountedState.d.ts +0 -2
  446. package/useMountedState.js +0 -13
  447. package/useNavigateAway.d.ts +0 -3
  448. package/useNavigateAway.js +0 -25
  449. package/usePrevious.d.ts +0 -2
  450. package/usePrevious.js +0 -10
  451. package/usePreviousRef.d.ts +0 -2
  452. package/usePreviousRef.js +0 -9
  453. package/useReveal.js +0 -43
  454. package/useScrollPosition.d.ts +0 -7
  455. package/useScrollPosition.js +0 -61
  456. package/useScrollThreshold.d.ts +0 -2
  457. package/useScrollThreshold.js +0 -27
  458. package/useScrollTo.d.ts +0 -2
  459. package/useScrollTo.js +0 -20
  460. package/useSmoothScroll.d.ts +0 -2
  461. package/useSmoothScroll.js +0 -32
  462. package/useSpinDelay.d.ts +0 -2
  463. package/useSpinDelay.js +0 -39
  464. package/useTraceUpdate.d.ts +0 -2
  465. package/useTraceUpdate.js +0 -19
  466. package/useUpdateEffect.d.ts +0 -3
  467. package/useUpdateEffect.js +0 -11
  468. package/useWindowSize.d.ts +0 -3
  469. package/useWindowSize.js +0 -20
  470. /package/{Polymorphic.d.ts → utils/Polymorphic.d.ts} +0 -0
@@ -1,28 +0,0 @@
1
- import { __assign, __makeTemplateObject, __rest } from "tslib";
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { memo } from "react";
4
- import styled from "styled-components";
5
- var Root = styled.span(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n min-width: 0;\n\n & svg {\n font-size: 2em !important;\n margin: 0 0.33em 0 0 !important;\n }\n"], ["\n ", "\n min-width: 0;\n\n & svg {\n font-size: 2em !important;\n margin: 0 0.33em 0 0 !important;\n }\n"])), function (p) {
6
- return p.$icon ? "display: flex;" : "display: inline-block; text-align: left;";
7
- });
8
- var ButtonCompositeIcon = styled.svg(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n float: left;\n"], ["\n float: left;\n"])));
9
- var BesidesIcon = styled.span(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n text-align: left;\n line-height: 1.2;\n"], ["\n text-align: left;\n line-height: 1.2;\n"])));
10
- var Main = styled.span(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: block;\n font-size: 0.9em;\n\n &:last-child {\n margin-top: ", ";\n }\n"], ["\n display: block;\n font-size: 0.9em;\n\n &:last-child {\n margin-top: ", ";\n }\n"])), function (p) { return (p.$reverse && !p.$icon ? "0.5em" : "0"); });
11
- var Sub = styled.span(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: block;\n text-transform: none;\n font-size: 0.7em;\n font-weight: 500;\n\n ", " + & {\n margin-top: ", ";\n }\n"], ["\n display: block;\n text-transform: none;\n font-size: 0.7em;\n font-weight: 500;\n\n ", " + & {\n margin-top: ", ";\n }\n"])), Main, function (p) { return (p.$reverse && !p.$icon ? "0.5em" : "0"); });
12
- var Text = styled.span(templateObject_6 || (templateObject_6 = __makeTemplateObject([""], [""])));
13
- var Inner = memo(function (_a) {
14
- var textMain = _a.textMain, textSub = _a.textSub, text = _a.text, $reverse = _a.$reverse, $icon = _a.$icon;
15
- return (_jsxs(_Fragment, { children: [$reverse ? (_jsxs(_Fragment, { children: [textSub && (_jsx(Sub, { "$icon": $icon, "$reverse": $reverse, children: textSub })), textMain && (_jsx(Main, { "$icon": $icon, "$reverse": $reverse, children: textMain }))] })) : (_jsxs(_Fragment, { children: [textMain && (_jsx(Main, { "$icon": $icon, "$reverse": $reverse, children: textMain })), textSub && (_jsx(Sub, { "$icon": $icon, "$reverse": $reverse, children: textSub }))] })), text && _jsx(Text, { children: text })] }));
16
- });
17
- export var KoineButtonComposite = function (_a) {
18
- var Icon = _a.Icon, _b = _a.iconProps, iconProps = _b === void 0 ? {} : _b, textMain = _a.textMain, textSub = _a.textSub, textReverse = _a.textReverse, text = _a.text, _c = _a.Button, Button = _c === void 0 ? "button" : _c, _d = _a.ButtonLink, ButtonLink = _d === void 0 ? "a" : _d, props = __rest(_a, ["Icon", "iconProps", "textMain", "textSub", "textReverse", "text", "Button", "ButtonLink"]);
19
- var Btn = props.href ? ButtonLink : Button;
20
- var styledProps = {
21
- $icon: !!Icon,
22
- $reverse: textReverse,
23
- $twoLines: !!(textMain && textSub && !Icon),
24
- };
25
- var innerProps = __assign({ textMain: textMain, textSub: textSub, text: text }, styledProps);
26
- return (_jsxs(Root, __assign({ as: Btn }, props, styledProps, { children: [Icon && _jsx(ButtonCompositeIcon, __assign({ as: Icon }, iconProps)), Icon ? (_jsx(BesidesIcon, __assign({}, styledProps, { children: _jsx(Inner, __assign({}, innerProps)) }))) : (_jsx(Inner, __assign({}, innerProps)))] })));
27
- };
28
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
@@ -1,4 +0,0 @@
1
- import { IconButtonProps } from "./IconButton.js";
2
- export declare const buttonFab: import("styled-components").FlattenSimpleInterpolation;
3
- export declare const IconButtonFab: any;
4
- export type IconButtonFabProps = IconButtonProps & React.ComponentPropsWithRef<"button">;
@@ -1,6 +0,0 @@
1
- import { __makeTemplateObject } from "tslib";
2
- import styled, { css } from "styled-components";
3
- import { IconButton } from "./IconButton.js";
4
- export var buttonFab = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n box-shadow: 3px 3px 6px -4px rgb(0, 0, 0, 0.5);\n"], ["\n box-shadow: 3px 3px 6px -4px rgb(0, 0, 0, 0.5);\n"])));
5
- export var IconButtonFab = styled(IconButton)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), buttonFab);
6
- var templateObject_1, templateObject_2;
@@ -1,8 +0,0 @@
1
- import { KoineLinkProps } from "../Link/index.js";
2
- import { KoineComponent, KoineComponentProps } from "../types.js";
3
- import { KoineButtonUiProps } from "./Button.js";
4
- export type KoineButtonLinkProps = KoineButtonUiProps & KoineLinkProps;
5
- export type ButtonLinkProps = KoineComponentProps<KoineButtonLinkProps, {
6
- Link?: KoineComponent;
7
- }>;
8
- export declare const KoineButtonLink: ({ href, Link, ...props }: React.PropsWithChildren<ButtonLinkProps>) => import("react/jsx-runtime").JSX.Element;
@@ -1,11 +0,0 @@
1
- import { __assign, __makeTemplateObject, __rest } from "tslib";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import styled from "styled-components";
4
- import { KoineButton } from "./Button.js";
5
- var Root = styled(KoineButton)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n text-decoration: none;\n"], ["\n text-decoration: none;\n"])));
6
- export var KoineButtonLink = function (_a) {
7
- var href = _a.href, _b = _a.Link, Link = _b === void 0 ? "a" : _b, props = __rest(_a, ["href", "Link"]);
8
- var isRelative = href && href.startsWith("/");
9
- return isRelative ? (_jsx(Root, __assign({ href: href }, props, { as: Link }))) : (_jsx(Root, __assign({ href: href }, props, { as: "a" })));
10
- };
11
- var templateObject_1;
@@ -1,8 +0,0 @@
1
- import { KoineButtonUiProps } from "./Button.js";
2
- export declare const iconBtnStyleReset: import("styled-components").FlattenSimpleInterpolation;
3
- export declare const iconBtnStyleBase: import("styled-components").FlattenSimpleInterpolation;
4
- export declare const IconButton: any;
5
- export type IconButtonUiProps = KoineButtonUiProps & {
6
- disabled?: boolean;
7
- };
8
- export type IconButtonProps = IconButtonUiProps & React.ComponentPropsWithRef<"button">;
@@ -1,7 +0,0 @@
1
- import { __makeTemplateObject } from "tslib";
2
- import styled, { css } from "styled-components";
3
- import { btnStyleContained, btnStyleOutlined, btnStyleReset, } from "./Button.js";
4
- export var iconBtnStyleReset = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 44px;\n height: 44px;\n border-radius: 100%;\n ", "\n"], ["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 44px;\n height: 44px;\n border-radius: 100%;\n ", "\n"])), btnStyleReset);
5
- export var iconBtnStyleBase = css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), iconBtnStyleReset);
6
- export var IconButton = styled.button(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n"], ["\n ", "\n ", "\n ", "\n"])), iconBtnStyleBase, function (p) { return p.$variant === "outlined" && btnStyleOutlined; }, function (p) { return p.$variant === "contained" && btnStyleContained; });
7
- var templateObject_1, templateObject_2, templateObject_3;
@@ -1,5 +0,0 @@
1
- export * from "./Button.js";
2
- export * from "./ButtonComposite.js";
3
- export * from "./ButtonFab.js";
4
- export * from "./ButtonLink.js";
5
- export * from "./IconButton.js";
package/Buttons/index.js DELETED
@@ -1,5 +0,0 @@
1
- export * from "./Button.js";
2
- export * from "./ButtonComposite.js";
3
- export * from "./ButtonFab.js";
4
- export * from "./ButtonLink.js";
5
- export * from "./IconButton.js";
@@ -1,35 +0,0 @@
1
- import type { KoineComponent, KoineComponentProps } from "../types.js";
2
- import type { CalendarView, CalendarViewDayProps, CalendarViewEvent, CalendarsMap } from "./types.js";
3
- import { UseCalendarReturn } from "./useCalendar.js";
4
- export type KoineCalendarDaygridCellProps = {
5
- eventClicked?: UseCalendarReturn["eventClicked"];
6
- setEventClicked: UseCalendarReturn["setEventClicked"];
7
- eventHovered?: UseCalendarReturn["eventHovered"];
8
- setEventHovered: UseCalendarReturn["setEventHovered"];
9
- view: CalendarView;
10
- maxEvents: number;
11
- events: CalendarViewEvent[];
12
- calendarsMap: CalendarsMap;
13
- };
14
- export type CalendarDaygridCellStyledProps = CalendarViewDayProps & {
15
- $view: CalendarView;
16
- $selected?: boolean;
17
- $past?: boolean;
18
- $color: string;
19
- };
20
- export type CalendarDaygridCellEventProps = React.ComponentPropsWithoutRef<"div"> & ((CalendarDaygridCellStyledProps & {
21
- $placeholder?: false;
22
- }) | {
23
- $placeholder: true;
24
- });
25
- export type CalendarDaygridCellEventBtnProps = CalendarDaygridCellEventProps;
26
- export type CalendarDaygridCellComponents = {
27
- Cell?: KoineComponent;
28
- CellOverflow?: KoineComponent;
29
- CellEvent?: KoineComponent<CalendarDaygridCellEventProps>;
30
- CellEventBtn?: KoineComponent<CalendarDaygridCellEventBtnProps>;
31
- CellEventTitle?: KoineComponent;
32
- CellEventStart?: KoineComponent;
33
- };
34
- export type CalendarDaygridCellProps = KoineComponentProps<KoineCalendarDaygridCellProps, CalendarDaygridCellComponents>;
35
- export declare const CalendarDaygridCell: ({ eventClicked, setEventClicked, setEventHovered, view, maxEvents, events, calendarsMap, Cell, CellOverflow, CellEvent, CellEventBtn, CellEventTitle, CellEventStart, }: CalendarDaygridCellProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,46 +0,0 @@
1
- import { __assign, __read } from "tslib";
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { Fragment, useState } from "react";
4
- import { MdAdd as IconExpand, } from "react-icons/md";
5
- import { getDisplayTime } from "./utils.js";
6
- var styleBtn = {
7
- overflow: "hidden",
8
- whiteSpace: "nowrap",
9
- textOverflow: "ellipsis",
10
- };
11
- export var CalendarDaygridCell = function (_a) {
12
- var eventClicked = _a.eventClicked, setEventClicked = _a.setEventClicked, setEventHovered = _a.setEventHovered, view = _a.view, maxEvents = _a.maxEvents, events = _a.events, calendarsMap = _a.calendarsMap, _b = _a.Cell, Cell = _b === void 0 ? "div" : _b, _c = _a.CellOverflow, CellOverflow = _c === void 0 ? "div" : _c, _d = _a.CellEvent, CellEvent = _d === void 0 ? "div" : _d, _e = _a.CellEventBtn, CellEventBtn = _e === void 0 ? "div" : _e, _f = _a.CellEventTitle, CellEventTitle = _f === void 0 ? "span" : _f, _g = _a.CellEventStart, CellEventStart = _g === void 0 ? "span" : _g;
13
- var _h = __read(useState(false), 2), isExpanded = _h[0], expand = _h[1];
14
- var eventsWithoutPlaceholders = events.filter(function (event) { return !event.placeholder; });
15
- return (_jsx(Cell, { children: events.map(function (event, i) {
16
- if (i === maxEvents && !isExpanded) {
17
- return (_jsxs(CellOverflow, { onClick: function () { return expand(true); }, children: [_jsx(IconExpand, {}), eventsWithoutPlaceholders.length - maxEvents] }, "overflowMessage" + i));
18
- }
19
- if (i > maxEvents && !isExpanded)
20
- return null;
21
- if (event.placeholder) {
22
- return (_jsx(Fragment, { children: _jsx(CellEvent, { "$placeholder": true, children: _jsx(CellEventBtn, { "aria-hidden": "true", style: { visibility: "hidden" }, "$placeholder": true, children: _jsx(CellEventTitle, { children: "\u00A0" }) }) }) }, event.key));
23
- }
24
- var styleEvent = {
25
- zIndex: event.firstOfMulti ? 1 : 0,
26
- position: "relative",
27
- width: event.firstOfMulti ? "".concat(100 * event.width, "%") : "100%",
28
- };
29
- if (!calendarsMap[event.calendar.id].on) {
30
- styleBtn.display = "none";
31
- }
32
- var styledProps = {
33
- $view: view,
34
- $selected: (eventClicked === null || eventClicked === void 0 ? void 0 : eventClicked.uid) === event.uid,
35
- $past: event.isPast,
36
- $color: event.color,
37
- $isOutOfRange: event.$isOutOfRange,
38
- $isToday: event.$isToday,
39
- };
40
- return (_jsx(Fragment, { children: _jsx(CellEvent, __assign({ style: styleEvent }, styledProps, { children: _jsx(CellEventBtn, __assign({ role: "button", style: styleBtn }, styledProps, { onClick: function () {
41
- return setEventClicked(function (prev) {
42
- return (prev === null || prev === void 0 ? void 0 : prev.uid) === event.uid ? null : event;
43
- });
44
- }, onMouseEnter: function () { return setEventHovered(event); }, onMouseLeave: function () { return setEventHovered(null); }, children: event.allDay ? (_jsx(CellEventTitle, { children: event.title })) : (_jsxs(_Fragment, { children: [_jsx(CellEventStart, { children: getDisplayTime(event.start) }), _jsx(CellEventTitle, { children: event.title })] })) })) })) }, event.key));
45
- }) }));
46
- };
@@ -1,27 +0,0 @@
1
- import type { KoineComponent, KoineComponentProps } from "../types.js";
2
- import type { CalendarRange, CalendarView } from "./types.js";
3
- export type KoineCalendarDaygridNavProps = {
4
- locale: string;
5
- range: CalendarRange;
6
- view: CalendarView;
7
- todayInView?: boolean;
8
- handlePrev: () => any;
9
- handleNext: () => any;
10
- handleToday: () => any;
11
- handleView: (view: CalendarView) => any;
12
- };
13
- export type CalendarDaygridNavTitleProps = {
14
- range: CalendarRange;
15
- formatted: string;
16
- };
17
- export type CalendarDaygridNavProps = KoineComponentProps<KoineCalendarDaygridNavProps, {
18
- NavRoot?: KoineComponent;
19
- NavTitle?: KoineComponent<CalendarDaygridNavTitleProps>;
20
- NavBtns?: KoineComponent;
21
- NavBtnPrev?: KoineComponent;
22
- NavBtnNext?: KoineComponent;
23
- NavBtnToday?: KoineComponent;
24
- NavBtnViewMonth?: KoineComponent;
25
- NavBtnViewWeek?: KoineComponent;
26
- }>;
27
- export declare const KoineCalendarDaygridNav: ({ range, view, todayInView, handlePrev, handleNext, handleToday, handleView, locale: localeCode, NavRoot, NavTitle, NavBtns, NavBtnPrev, NavBtnNext, NavBtnToday, NavBtnViewMonth, NavBtnViewWeek, }: CalendarDaygridNavProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,24 +0,0 @@
1
- import { __read } from "tslib";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import format from "date-fns/format";
4
- import { useDateLocale } from "../useDateLocale.js";
5
- export var KoineCalendarDaygridNav = function (_a) {
6
- var range = _a.range, view = _a.view, todayInView = _a.todayInView, handlePrev = _a.handlePrev, handleNext = _a.handleNext, handleToday = _a.handleToday, handleView = _a.handleView, localeCode = _a.locale, _b = _a.NavRoot, NavRoot = _b === void 0 ? "nav" : _b, _c = _a.NavTitle, NavTitle = _c === void 0 ? "div" : _c, _d = _a.NavBtns, NavBtns = _d === void 0 ? "div" : _d, _e = _a.NavBtnPrev, NavBtnPrev = _e === void 0 ? "button" : _e, _f = _a.NavBtnNext, NavBtnNext = _f === void 0 ? "button" : _f, _g = _a.NavBtnToday, NavBtnToday = _g === void 0 ? "button" : _g, _h = _a.NavBtnViewMonth, NavBtnViewMonth = _h === void 0 ? "button" : _h, _j = _a.NavBtnViewWeek, NavBtnViewWeek = _j === void 0 ? "button" : _j;
7
- var _k = __read(range, 2), start = _k[0], end = _k[1];
8
- var locale = useDateLocale(localeCode);
9
- var opts = { locale: locale };
10
- var formatted = "";
11
- if (view === "month") {
12
- formatted = format(start, "MMMM yyyy", opts);
13
- }
14
- if (view === "week") {
15
- var inSameMonth = start.getMonth() === end.getMonth();
16
- if (inSameMonth) {
17
- formatted = format(start, "# MMMM yyyy", opts).replace("#", "".concat(start.getDate(), "-").concat(end.getDate()));
18
- }
19
- else {
20
- formatted = "".concat(format(start, "d MMMM", opts), " - ").concat(format(end, "d MMMM yyyy", opts));
21
- }
22
- }
23
- return (_jsxs(NavRoot, { children: [_jsxs(NavBtns, { children: [_jsx(NavBtnPrev, { onClick: handlePrev }), _jsx(NavBtnNext, { onClick: handleNext }), _jsx(NavBtnToday, { onClick: handleToday, disabled: todayInView }), _jsx(NavBtnViewMonth, { onClick: function () { return handleView("month"); }, disabled: view === "month" }), _jsx(NavBtnViewWeek, { onClick: function () { return handleView("week"); }, disabled: view === "week" })] }), _jsx(NavTitle, { range: range, formatted: formatted })] }));
24
- };
@@ -1,25 +0,0 @@
1
- import type { KoineComponent, KoineComponentProps } from "../types.js";
2
- import { CalendarDaygridCellComponents, CalendarDaygridCellProps } from "./CalendarDaygridCell.js";
3
- import type { CalendarEventsMap, CalendarRange, CalendarView, CalendarViewDayProps } from "./types.js";
4
- export type CalendarDaygridTableBodyCellProps = CalendarViewDayProps;
5
- export type CalendarDaygridTableBodyCellDateProps = CalendarViewDayProps;
6
- export type KoineCalendarDaygridTableProps = {
7
- maxEvents?: CalendarDaygridCellProps["maxEvents"];
8
- locale: string;
9
- events: CalendarEventsMap;
10
- handlePrev: () => any;
11
- handleNext: () => any;
12
- view: CalendarView;
13
- range: CalendarRange;
14
- dayLabels?: string[];
15
- } & Pick<CalendarDaygridCellProps, "eventClicked" | "setEventClicked" | "eventHovered" | "setEventHovered" | "calendarsMap">;
16
- export type CalendarDaygridTableProps = KoineComponentProps<KoineCalendarDaygridTableProps, {
17
- Table?: KoineComponent;
18
- TableHead?: KoineComponent;
19
- TableHeadCell?: KoineComponent;
20
- TableBody?: KoineComponent;
21
- TableBodyCell?: KoineComponent<CalendarDaygridTableBodyCellProps>;
22
- TableBodyCellDate?: KoineComponent<CalendarDaygridTableBodyCellDateProps>;
23
- TableBodyRow?: KoineComponent;
24
- } & CalendarDaygridCellComponents>;
25
- export declare const KoineCalendarDaygridTable: ({ locale: localeCode, handlePrev, handleNext, events, dayLabels, view, range, eventClicked, setEventClicked, eventHovered, setEventHovered, calendarsMap, maxEvents, Table, TableHead, TableHeadCell, TableBody, TableBodyRow, TableBodyCell, TableBodyCellDate, Cell, CellOverflow, CellEvent, CellEventBtn, CellEventTitle, CellEventStart, }: CalendarDaygridTableProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,45 +0,0 @@
1
- import { __assign, __read } from "tslib";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import eachWeekOfInterval from "date-fns/eachWeekOfInterval";
4
- import { useEffect, useMemo, useState } from "react";
5
- import { useSwipeable } from "react-swipeable";
6
- import { useDateLocale } from "../useDateLocale.js";
7
- import { CalendarDaygridCell, } from "./CalendarDaygridCell.js";
8
- import { processEventsInView } from "./utils.js";
9
- function getView(range) {
10
- var _a = __read(range, 2), start = _a[0], end = _a[1];
11
- var weeks = eachWeekOfInterval({ start: start, end: end }, { weekStartsOn: 1 });
12
- return {
13
- month: start.getMonth(),
14
- weeks: weeks,
15
- };
16
- }
17
- export var KoineCalendarDaygridTable = function (_a) {
18
- var localeCode = _a.locale, handlePrev = _a.handlePrev, handleNext = _a.handleNext, events = _a.events, dayLabels = _a.dayLabels, view = _a.view, range = _a.range, eventClicked = _a.eventClicked, setEventClicked = _a.setEventClicked, eventHovered = _a.eventHovered, setEventHovered = _a.setEventHovered, _b = _a.calendarsMap, calendarsMap = _b === void 0 ? {} : _b, _c = _a.maxEvents, maxEvents = _c === void 0 ? 5 : _c, _d = _a.Table, Table = _d === void 0 ? "table" : _d, _e = _a.TableHead, TableHead = _e === void 0 ? "thead" : _e, _f = _a.TableHeadCell, TableHeadCell = _f === void 0 ? "th" : _f, _g = _a.TableBody, TableBody = _g === void 0 ? "tbody" : _g, _h = _a.TableBodyRow, TableBodyRow = _h === void 0 ? "tr" : _h, _j = _a.TableBodyCell, TableBodyCell = _j === void 0 ? "td" : _j, _k = _a.TableBodyCellDate, TableBodyCellDate = _k === void 0 ? "div" : _k, Cell = _a.Cell, CellOverflow = _a.CellOverflow, CellEvent = _a.CellEvent, CellEventBtn = _a.CellEventBtn, CellEventTitle = _a.CellEventTitle, CellEventStart = _a.CellEventStart;
19
- var restKoine = {
20
- Cell: Cell,
21
- CellOverflow: CellOverflow,
22
- CellEvent: CellEvent,
23
- CellEventBtn: CellEventBtn,
24
- CellEventTitle: CellEventTitle,
25
- CellEventStart: CellEventStart,
26
- };
27
- var _l = __read(useState(dayLabels || [0, 1, 2, 3, 4, 5, 6]), 2), days = _l[0], setDays = _l[1];
28
- var _m = __read(useState([]), 2), weeksEvents = _m[0], setWeeksEvents = _m[1];
29
- var locale = useDateLocale(localeCode);
30
- var _o = useMemo(function () { return getView(range); }, [range]), month = _o.month, weeks = _o.weeks;
31
- var swipeableHandlers = useSwipeable({
32
- onSwipedLeft: handleNext,
33
- onSwipedRight: handlePrev,
34
- });
35
- useEffect(function () {
36
- setWeeksEvents(processEventsInView(events, view, month, weeks));
37
- }, [events, view, month, weeks]);
38
- useEffect(function () {
39
- if (locale && locale.localize && !dayLabels) {
40
- setDays([1, 2, 3, 4, 5, 6, 0].map(function (i) { return locale.localize.day(i, { width: "abbreviated" }); }));
41
- }
42
- }, [locale, dayLabels]);
43
- return (_jsxs(Table, __assign({}, swipeableHandlers, { children: [_jsx(TableHead, { children: _jsx("tr", { children: days.map(function (day) { return (_jsx(TableHeadCell, { scope: "column", children: day }, day)); }) }) }), _jsx(TableBody, { children: weeksEvents.map(function (week, i) { return (_jsx(TableBodyRow, __assign({}, week.props, { children: week.days.map(function (day) { return (_jsxs(TableBodyCell, __assign({}, day.props, { children: [_jsx(TableBodyCellDate, __assign({}, day.props, { children: day.label })), day.events.length > 0 && (_jsx(CalendarDaygridCell, __assign({ eventClicked: eventClicked, setEventClicked: setEventClicked, eventHovered: eventHovered, setEventHovered: setEventHovered, view: view, maxEvents: maxEvents, events: day.events,
44
- timestamp: day.timestamp, calendarsMap: calendarsMap }, restKoine)))] }))); }) }))); }) })] })));
45
- };
@@ -1,18 +0,0 @@
1
- import type { KoineComponent, KoineComponentProps } from "../types.js";
2
- import type { CalendarsMap } from "./types.js";
3
- export type KoineCalendarLegendProps = {
4
- toggleCalendarVisibility: (id: string) => void;
5
- calendarsMap: CalendarsMap;
6
- };
7
- export type CalendarLegendItemProps = React.ComponentPropsWithoutRef<"div"> & {
8
- $color: string;
9
- $empty: boolean;
10
- disabled: boolean;
11
- };
12
- export type CalendarLegendProps = KoineComponentProps<KoineCalendarLegendProps, {
13
- LegendItem?: KoineComponent<CalendarLegendItemProps>;
14
- LegendItemStatus?: KoineComponent;
15
- LegendItemLabel?: KoineComponent;
16
- LegendItemEvents?: KoineComponent;
17
- }>;
18
- export declare const KoineCalendarLegend: ({ calendarsMap, toggleCalendarVisibility, LegendItem, LegendItemStatus, LegendItemLabel, LegendItemEvents, }: CalendarLegendProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,9 +0,0 @@
1
- import { __read } from "tslib";
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- export var KoineCalendarLegend = function (_a) {
4
- var _b = _a.calendarsMap, calendarsMap = _b === void 0 ? {} : _b, toggleCalendarVisibility = _a.toggleCalendarVisibility, _c = _a.LegendItem, LegendItem = _c === void 0 ? "div" : _c, _d = _a.LegendItemStatus, LegendItemStatus = _d === void 0 ? "span" : _d, _e = _a.LegendItemLabel, LegendItemLabel = _e === void 0 ? "span" : _e, _f = _a.LegendItemEvents, LegendItemEvents = _f === void 0 ? "span" : _f;
5
- return (_jsx(_Fragment, { children: Object.entries(calendarsMap).map(function (_a) {
6
- var _b = __read(_a, 2), id = _b[0], calendar = _b[1];
7
- return (_jsxs(LegendItem, { onClick: function () { return toggleCalendarVisibility(id); }, "$color": calendar.color, "$empty": calendar.events === 0, disabled: calendar.events === 0, children: [_jsx(LegendItemStatus, { children: calendar.on ? "\u2b24" : "\u2b58" }), _jsx(LegendItemLabel, { children: calendar.name }), _jsx(LegendItemEvents, { children: calendar.events })] }, "CalendarLegend." + id));
8
- }) }));
9
- };
@@ -1,10 +0,0 @@
1
- import type { CalendarEventsMap, Calendars } from "./types.js";
2
- type GetCalendarsEventsFromGoogleOptions = {
3
- apiKey?: string;
4
- start: Date;
5
- end: Date;
6
- timeZone?: string;
7
- calendars: Calendars;
8
- };
9
- export declare function getCalendarsEventsFromGoogle({ calendars, ...options }: GetCalendarsEventsFromGoogleOptions): Promise<CalendarEventsMap>;
10
- export {};
@@ -1,124 +0,0 @@
1
- import { __assign, __awaiter, __generator, __rest } from "tslib";
2
- import differenceInDays from "date-fns/differenceInDays";
3
- import subDays from "date-fns/subDays";
4
- import { arrayToLookup, isString, isUndefined } from "@koine/utils";
5
- import { addCalendarEvents, getEventTimestamp } from "./utils.js";
6
- var baseURL = "https://www.googleapis.com/calendar/v3/calendars/";
7
- export function getCalendarsEventsFromGoogle(_a) {
8
- var calendars = _a.calendars, options = __rest(_a, ["calendars"]);
9
- return __awaiter(this, void 0, void 0, function () {
10
- var allEvents;
11
- var _this = this;
12
- return __generator(this, function (_b) {
13
- switch (_b.label) {
14
- case 0:
15
- allEvents = {};
16
- return [4, Promise.all(calendars.map(function (calendar) { return __awaiter(_this, void 0, void 0, function () {
17
- var events;
18
- return __generator(this, function (_a) {
19
- switch (_a.label) {
20
- case 0: return [4, getCalendarEventsFromGoogle(__assign({ calendar: calendar }, options))];
21
- case 1:
22
- events = _a.sent();
23
- addCalendarEvents(events, allEvents);
24
- return [2];
25
- }
26
- });
27
- }); }))];
28
- case 1:
29
- _b.sent();
30
- return [2, allEvents];
31
- }
32
- });
33
- });
34
- }
35
- function getCalendarEventsFromGoogle(_a) {
36
- var apiKey = _a.apiKey, calendar = _a.calendar, _b = _a.timeZone, timeZone = _b === void 0 ? "" : _b, start = _a.start, end = _a.end;
37
- return __awaiter(this, void 0, void 0, function () {
38
- var events, params, url, response, data, e_1;
39
- return __generator(this, function (_c) {
40
- switch (_c.label) {
41
- case 0:
42
- events = {};
43
- params = new URLSearchParams({
44
- calendarId: calendar.id,
45
- timeZone: timeZone,
46
- singleEvents: "true",
47
- maxAttendees: "1",
48
- maxResults: "9999",
49
- sanitizeHtml: "true",
50
- timeMin: start.toISOString(),
51
- timeMax: end.toISOString(),
52
- key: apiKey || process.env["GOOGLE_CALENDAR_API_KEY"] || "",
53
- }).toString();
54
- url = baseURL + calendar.id + "/events?" + params;
55
- _c.label = 1;
56
- case 1:
57
- _c.trys.push([1, 4, , 5]);
58
- return [4, fetch(url, { method: "GET" })];
59
- case 2:
60
- response = _c.sent();
61
- return [4, response.json()];
62
- case 3:
63
- data = (_c.sent());
64
- calendar.name = calendar.name || data.summary;
65
- data.items.forEach(function (googleEvent) {
66
- var event = transformCalendarEventFromGoogle(googleEvent, calendar);
67
- events[event.uid] = event;
68
- });
69
- return [3, 5];
70
- case 4:
71
- e_1 = _c.sent();
72
- return [3, 5];
73
- case 5: return [2, events];
74
- }
75
- });
76
- });
77
- }
78
- function transformCalendarEventFromGoogle(event, calendar) {
79
- var created = new Date(event.created);
80
- var link = event.htmlLink;
81
- var title = event.summary;
82
- var status = event.status;
83
- var start = new Date(event.start.date || event.start.dateTime);
84
- var end = new Date(event.end.date || event.end.dateTime);
85
- var color = calendar.color;
86
- var allDay = isUndefined(event.end.dateTime) && isString(event.end.date);
87
- var location = event.location || "";
88
- var description = event.description || "";
89
- var uid = created.getTime() + "" + start.getTime();
90
- if (allDay && end > start) {
91
- end = subDays(end, 1);
92
- end.setHours(23, 59, 59);
93
- }
94
- var days = getDays();
95
- var daysMap = arrayToLookup(days);
96
- var multi = days.length > 1;
97
- function getDays() {
98
- var from = new Date(start);
99
- var to = new Date(end);
100
- var days = [getEventTimestamp(from)];
101
- while (differenceInDays(to, from)) {
102
- from.setDate(from.getDate() + 1);
103
- days.push(getEventTimestamp(from));
104
- }
105
- return days;
106
- }
107
- return {
108
- calendar: calendar,
109
- created: created,
110
- link: link,
111
- title: title,
112
- status: status,
113
- start: start,
114
- end: end,
115
- days: days,
116
- daysMap: daysMap,
117
- multi: multi,
118
- color: color,
119
- allDay: allDay,
120
- location: location,
121
- description: description,
122
- uid: uid,
123
- };
124
- }
@@ -1,6 +0,0 @@
1
- export * from "./CalendarDaygridCell.js";
2
- export * from "./CalendarDaygridNav.js";
3
- export * from "./CalendarDaygridTable.js";
4
- export * from "./CalendarLegend.js";
5
- export * from "./useCalendar.js";
6
- export * from "./types.js";
package/Calendar/index.js DELETED
@@ -1,6 +0,0 @@
1
- export * from "./CalendarDaygridCell.js";
2
- export * from "./CalendarDaygridNav.js";
3
- export * from "./CalendarDaygridTable.js";
4
- export * from "./CalendarLegend.js";
5
- export * from "./useCalendar.js";
6
- export * from "./types.js";
@@ -1,62 +0,0 @@
1
- export type Calendar = {
2
- id: string;
3
- color: string;
4
- name?: string;
5
- };
6
- export type Calendars = Calendar[];
7
- export type CalendarsMap = Record<Calendar["id"], Required<Calendar> & {
8
- on?: boolean;
9
- events?: number;
10
- }>;
11
- export type CalendarRange = [Date, Date];
12
- export type CalendarView = "month" | "week";
13
- export type CalendarEvent = {
14
- calendar: Calendar;
15
- days: number[];
16
- daysMap: Record<number, 1>;
17
- multi: boolean;
18
- allDay: boolean;
19
- link: string;
20
- title: string;
21
- status: string;
22
- created: Date;
23
- start: Date;
24
- end: Date;
25
- color: string;
26
- location: string;
27
- description: string;
28
- uid: string;
29
- };
30
- export type CalendarEventsByTimestamp = Record<number, CalendarEventsMap>;
31
- export type CalendarEventsMap = Record<CalendarEvent["uid"], CalendarEvent>;
32
- export type CalendarViewWeeks = CalendarViewWeek[];
33
- export type CalendarViewWeek = {
34
- props: {
35
- key: string;
36
- };
37
- days: CalendarViewDay[];
38
- };
39
- export type CalendarViewDay = {
40
- props: {
41
- key: string;
42
- } & CalendarViewDayProps;
43
- label: string;
44
- timestamp: string;
45
- events: CalendarViewEvent[];
46
- };
47
- export type CalendarViewDayProps = {
48
- $isToday?: boolean;
49
- $isOutOfRange?: boolean;
50
- };
51
- export type CalendarViewEvent = {
52
- key: string;
53
- placeholder: true;
54
- top: number;
55
- } | (CalendarEvent & CalendarViewDayProps & {
56
- key: string;
57
- placeholder?: false;
58
- top: number;
59
- width: number;
60
- firstOfMulti?: boolean;
61
- isPast?: boolean;
62
- });
package/Calendar/types.js DELETED
@@ -1 +0,0 @@
1
- export {};
@@ -1,35 +0,0 @@
1
- import type { KoineCalendarDaygridNavProps } from "./CalendarDaygridNav.js";
2
- import type { KoineCalendarDaygridTableProps } from "./CalendarDaygridTable.js";
3
- import type { KoineCalendarLegendProps } from "./CalendarLegend.js";
4
- import type { CalendarEvent, CalendarEventsMap, CalendarView, Calendars } from "./types.js";
5
- export type UseCalendarProps = {
6
- locale: string;
7
- calendars: Calendars;
8
- apiKey?: string;
9
- events?: CalendarEventsMap;
10
- start?: Date;
11
- end?: Date;
12
- view?: CalendarView;
13
- timeZone?: string;
14
- onError?: (e: any) => void;
15
- };
16
- export type UseCalendarReturn = ReturnType<typeof useCalendar>;
17
- export type CalendarsUpdateActionEvents = {
18
- type: "events";
19
- payload: Record<string, number>;
20
- };
21
- export type CalendarsUpdateActionVisibility = {
22
- type: "visibility";
23
- payload: string | string[];
24
- };
25
- export type CalendarsUpdateAction = CalendarsUpdateActionEvents | CalendarsUpdateActionVisibility;
26
- export declare function useCalendar({ locale, apiKey, calendars, events: initialEvents, start: initialStart, end: initialEnd, view: initialView, timeZone, onError, }: UseCalendarProps): {
27
- view: "month" | "week";
28
- eventClicked: CalendarEvent | null;
29
- setEventClicked: import("react").Dispatch<import("react").SetStateAction<CalendarEvent | null>>;
30
- eventHovered: CalendarEvent | null;
31
- setEventHovered: import("react").Dispatch<import("react").SetStateAction<CalendarEvent | null>>;
32
- getDaygridNavProps: () => KoineCalendarDaygridNavProps;
33
- getDaygridTableProps: () => KoineCalendarDaygridTableProps;
34
- getLegendProps: () => KoineCalendarLegendProps;
35
- };