@koine/react 1.0.9 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (359) hide show
  1. package/Alert/Alert.js +7 -13
  2. package/Animations/Reveal.js +12 -10
  3. package/Animations/Underline.js +3 -13
  4. package/Animations/useReveal.js +18 -17
  5. package/Autocomplete/AutocompleteDownshift.js +1 -1
  6. package/Autocomplete/AutocompleteDownshiftMultiselect.js +1 -1
  7. package/Autocomplete/AutocompleteMui.js +61 -56
  8. package/Autocomplete/AutocompleteReach.js +1 -1
  9. package/Autocomplete/components.js +17 -72
  10. package/Autocomplete/helpers.js +1 -1
  11. package/Bg/BgColor.js +14 -24
  12. package/Bg/BgPhoto.js +11 -54
  13. package/Bg/BgSvg.js +6 -9
  14. package/Breadcrumbs/Breadcrumbs.js +14 -54
  15. package/Buttons/Button.js +8 -73
  16. package/Buttons/ButtonComposite.js +20 -41
  17. package/Buttons/ButtonFab.js +4 -6
  18. package/Buttons/ButtonLink.js +7 -6
  19. package/Buttons/IconButton.js +5 -17
  20. package/Calendar/CalendarDaygridCell.js +20 -14
  21. package/Calendar/CalendarDaygridNav.js +10 -9
  22. package/Calendar/CalendarDaygridTable.js +32 -30
  23. package/Calendar/CalendarLegend.js +7 -2
  24. package/Calendar/calendar-api-google.js +101 -68
  25. package/Calendar/useCalendar.js +114 -113
  26. package/Calendar/utils.js +73 -74
  27. package/Carousel/Carousel.js +1 -1
  28. package/Carousel/CarouselCss.js +14 -27
  29. package/Collapsable/Collapsable.d.ts +1 -1
  30. package/Collapsable/Collapsable.js +1 -1
  31. package/Collapsable/CollapsableReach.d.ts +4 -64
  32. package/Collapsable/CollapsableReach.js +247 -129
  33. package/Collapsable/index.d.ts +1 -1
  34. package/Collapsable/index.js +2 -1
  35. package/Debug/Debug.js +5 -17
  36. package/Details/Details.d.ts +114 -0
  37. package/Details/Details.js +65 -0
  38. package/Details/index.d.ts +1 -0
  39. package/Details/index.js +1 -0
  40. package/{Forms/Form → Details}/package.json +1 -1
  41. package/Dialog/DialogMui.d.ts +1 -1
  42. package/Dialog/DialogMui.js +22 -20
  43. package/Dialog/css/bare.js +17 -15
  44. package/Dialog/m/bare.js +17 -13
  45. package/Dialog/m/basic.js +2 -2
  46. package/Dialog/m/index.js +4 -4
  47. package/Dialog/sc/bare.js +25 -43
  48. package/Dialog/sc/framer.js +6 -6
  49. package/Dialog/sc/framerMaterial.js +6 -6
  50. package/Dialog/sc/material.js +17 -37
  51. package/Dialog/tw/bare.js +25 -19
  52. package/Dialog/tw/elegant.js +17 -15
  53. package/Dialog/tw/framer.js +6 -6
  54. package/Dialog/tw/framerMaterial.js +6 -6
  55. package/Dialog/tw/material.js +17 -15
  56. package/Editor/Editor--tiptap.js +14 -11
  57. package/Editor/components.js +6 -24
  58. package/Favicon/FaviconTags.js +2 -1
  59. package/Form/Form.d.ts +111 -0
  60. package/Form/Form.js +61 -0
  61. package/{Forms/Form → Form}/index.d.ts +0 -0
  62. package/{Forms/Form → Form}/index.js +0 -0
  63. package/Form/package.json +6 -0
  64. package/Form/sc/bare.d.ts +33 -0
  65. package/Form/sc/bare.js +20 -0
  66. package/Forms/Checkbox/Checkbox.js +9 -15
  67. package/Forms/Feedback/Feedback.js +6 -7
  68. package/Forms/Field/Field.js +15 -26
  69. package/Forms/Field/FieldControl.js +19 -15
  70. package/Forms/Field/FieldHint.js +3 -5
  71. package/Forms/Input/Input.js +10 -16
  72. package/Forms/InputGroup/InputGroup.js +9 -36
  73. package/Forms/Label/Label.js +5 -23
  74. package/Forms/Password/Password.js +10 -23
  75. package/Forms/Radio/Radio.js +15 -18
  76. package/Forms/Switch/Switch.js +9 -39
  77. package/Forms/Textarea/Textarea.js +6 -7
  78. package/Forms/Textarea/TextareaRich.js +10 -24
  79. package/Forms/Toggle/Toggle.js +21 -68
  80. package/Forms/Toggle/useToggle.js +29 -29
  81. package/Forms/antispam.js +12 -12
  82. package/Forms/helpers.js +8 -7
  83. package/Forms/index.d.ts +0 -1
  84. package/Forms/index.js +0 -1
  85. package/Forms/styles.js +12 -43
  86. package/Gauge/Gauge.js +1 -1
  87. package/Grid/Grid.js +25 -51
  88. package/Hamburger/Hamburger.js +35 -47
  89. package/Header/useHeader.js +12 -12
  90. package/Hidden/Hidden.js +9 -13
  91. package/Img/sc/bare.js +3 -1
  92. package/Link/Link.js +3 -1
  93. package/Link/LinkBlank.js +8 -17
  94. package/Menu/Menu.js +3 -10
  95. package/MenuItem/MenuItem.js +3 -19
  96. package/Meta/Meta.js +3 -2
  97. package/NoJs/NoJs.js +2 -2
  98. package/Pagination/PaginationNav.js +26 -48
  99. package/Pagination/PaginationResults.js +7 -6
  100. package/Pill/Pill.js +6 -36
  101. package/Progress/ProgressCircular.js +9 -30
  102. package/Progress/ProgressLinear.js +8 -16
  103. package/Progress/ProgressOverlay.js +11 -27
  104. package/Rating/Rating.js +26 -45
  105. package/Rating/index.js +19 -15
  106. package/Select/SelectDownshift.js +1 -1
  107. package/Select/components.js +6 -12
  108. package/Sidebar/Sidebar.js +13 -38
  109. package/Spacing/Spacing.js +12 -12
  110. package/Sticky/Sticky.js +1 -1
  111. package/Sticky/StickyCss.js +4 -2
  112. package/Tabs/TabsMui.d.ts +244 -0
  113. package/Tabs/TabsMui.js +46 -0
  114. package/Tabs/index.d.ts +1 -1
  115. package/Tabs/index.js +1 -1
  116. package/Tabs/sc/bare.d.ts +5 -0
  117. package/Tabs/sc/bare.js +87 -0
  118. package/Tabs/tw/bare.d.ts +248 -0
  119. package/Tabs/tw/bare.js +17 -0
  120. package/Tabs/tw/material.d.ts +472 -0
  121. package/Tabs/tw/material.js +18 -0
  122. package/Tabs/useTabs.d.ts +43 -0
  123. package/Tabs/useTabs.js +44 -0
  124. package/Typography/CopyPasteVisible.js +3 -5
  125. package/Typography/Native.js +12 -45
  126. package/Typography/ReadMore.js +26 -52
  127. package/Typography/TextLoop.js +19 -22
  128. package/Typography/TypeStairs.js +20 -16
  129. package/css/index.js +1 -0
  130. package/helpers/classed.js +22 -18
  131. package/helpers/extend-component.js +6 -6
  132. package/hooks/index.d.ts +8 -0
  133. package/hooks/index.js +8 -0
  134. package/hooks/types.d.ts +8 -0
  135. package/hooks/types.js +1 -0
  136. package/hooks/useAsyncFn.d.ts +26 -0
  137. package/hooks/useAsyncFn.js +36 -0
  138. package/hooks/useDateLocale.js +22 -13
  139. package/hooks/useEffectOnce.d.ts +5 -0
  140. package/hooks/useEffectOnce.js +8 -0
  141. package/hooks/useFirstMountState.d.ts +4 -0
  142. package/hooks/useFirstMountState.js +12 -0
  143. package/hooks/useFocus.js +3 -3
  144. package/hooks/useId.d.ts +4 -0
  145. package/hooks/useId.js +8 -0
  146. package/hooks/useIsomorphicLayoutEffect.d.ts +5 -0
  147. package/hooks/useIsomorphicLayoutEffect.js +8 -0
  148. package/hooks/useMount.d.ts +4 -0
  149. package/hooks/useMount.js +9 -0
  150. package/hooks/useMountedState.d.ts +4 -0
  151. package/hooks/useMountedState.js +15 -0
  152. package/hooks/usePrevious.js +2 -2
  153. package/hooks/useScrollPosition.js +21 -16
  154. package/hooks/useScrollTo.js +7 -5
  155. package/hooks/useTraceUpdate.js +4 -3
  156. package/hooks/useUpdateEffect.d.ts +5 -0
  157. package/hooks/useUpdateEffect.js +14 -0
  158. package/hooks/useWindowSize.js +3 -3
  159. package/m/MotionProvider.js +4 -2
  160. package/node/Alert/Alert.js +9 -16
  161. package/node/Alert/index.js +1 -1
  162. package/node/Animations/Reveal.js +15 -13
  163. package/node/Animations/Underline.js +5 -16
  164. package/node/Animations/index.js +1 -1
  165. package/node/Animations/useReveal.js +19 -18
  166. package/node/Autocomplete/AutocompleteMui.js +69 -64
  167. package/node/Autocomplete/components.js +26 -82
  168. package/node/Autocomplete/helpers.js +2 -2
  169. package/node/Bg/BgColor.js +18 -29
  170. package/node/Bg/BgPhoto.js +15 -59
  171. package/node/Bg/BgSvg.js +8 -12
  172. package/node/Bg/index.js +1 -1
  173. package/node/Breadcrumbs/Breadcrumbs.js +20 -61
  174. package/node/Breadcrumbs/index.js +1 -1
  175. package/node/Buttons/Button.js +10 -76
  176. package/node/Buttons/ButtonComposite.js +23 -45
  177. package/node/Buttons/ButtonFab.js +6 -9
  178. package/node/Buttons/ButtonLink.js +10 -10
  179. package/node/Buttons/IconButton.js +7 -20
  180. package/node/Buttons/index.js +1 -1
  181. package/node/Calendar/CalendarDaygridCell.js +24 -18
  182. package/node/Calendar/CalendarDaygridNav.js +14 -13
  183. package/node/Calendar/CalendarDaygridTable.js +39 -38
  184. package/node/Calendar/CalendarLegend.js +8 -3
  185. package/node/Calendar/calendar-api-google.js +105 -73
  186. package/node/Calendar/index.js +1 -1
  187. package/node/Calendar/useCalendar.js +117 -116
  188. package/node/Calendar/utils.js +82 -84
  189. package/node/Carousel/CarouselCss.js +17 -31
  190. package/node/Carousel/index.js +1 -1
  191. package/node/Collapsable/Collapsable.js +2 -2
  192. package/node/Collapsable/CollapsableReach.js +246 -134
  193. package/node/Collapsable/index.js +3 -2
  194. package/node/Debug/Debug.js +7 -20
  195. package/node/Debug/index.js +1 -1
  196. package/node/Details/Details.js +67 -0
  197. package/node/Details/index.js +4 -0
  198. package/node/Dialog/DialogMui.js +12 -11
  199. package/node/Dialog/css/bare.js +11 -10
  200. package/node/Dialog/m/bare.js +18 -14
  201. package/node/Dialog/m/basic.js +1 -1
  202. package/node/Dialog/m/index.js +4 -4
  203. package/node/Dialog/sc/bare.js +22 -41
  204. package/node/Dialog/sc/framer.js +5 -5
  205. package/node/Dialog/sc/framerMaterial.js +5 -5
  206. package/node/Dialog/sc/material.js +12 -33
  207. package/node/Dialog/tw/bare.js +19 -14
  208. package/node/Dialog/tw/elegant.js +11 -9
  209. package/node/Dialog/tw/framer.js +5 -5
  210. package/node/Dialog/tw/framerMaterial.js +5 -5
  211. package/node/Dialog/tw/material.js +11 -9
  212. package/node/Editor/Editor--tiptap.js +19 -17
  213. package/node/Editor/components.js +9 -28
  214. package/node/Editor/index.js +1 -1
  215. package/node/Favicon/FaviconTags.js +3 -2
  216. package/node/Favicon/index.js +1 -1
  217. package/node/Form/Form.js +65 -0
  218. package/node/{Forms/Form → Form}/index.js +1 -1
  219. package/node/Form/sc/bare.js +23 -0
  220. package/node/Forms/Checkbox/Checkbox.js +13 -20
  221. package/node/Forms/Checkbox/index.js +1 -1
  222. package/node/Forms/Feedback/Feedback.js +8 -10
  223. package/node/Forms/Feedback/index.js +1 -1
  224. package/node/Forms/Field/Field.js +18 -30
  225. package/node/Forms/Field/FieldControl.js +26 -22
  226. package/node/Forms/Field/FieldHint.js +4 -7
  227. package/node/Forms/Field/index.js +1 -1
  228. package/node/Forms/Input/Input.js +15 -22
  229. package/node/Forms/Input/index.js +1 -1
  230. package/node/Forms/InputGroup/InputGroup.js +14 -42
  231. package/node/Forms/InputGroup/index.js +1 -1
  232. package/node/Forms/Label/Label.js +6 -25
  233. package/node/Forms/Label/index.js +1 -1
  234. package/node/Forms/Password/Password.js +16 -30
  235. package/node/Forms/Password/index.js +1 -1
  236. package/node/Forms/Radio/Radio.js +21 -25
  237. package/node/Forms/Radio/index.js +1 -1
  238. package/node/Forms/Switch/Switch.js +15 -46
  239. package/node/Forms/Switch/index.js +1 -1
  240. package/node/Forms/Textarea/Textarea.js +11 -13
  241. package/node/Forms/Textarea/TextareaRich.js +16 -31
  242. package/node/Forms/Textarea/index.js +1 -1
  243. package/node/Forms/Toggle/Toggle.js +24 -72
  244. package/node/Forms/Toggle/index.js +1 -1
  245. package/node/Forms/Toggle/useToggle.js +33 -33
  246. package/node/Forms/antispam.js +14 -14
  247. package/node/Forms/helpers.js +9 -8
  248. package/node/Forms/index.js +1 -2
  249. package/node/Forms/styles.js +16 -48
  250. package/node/Gauge/Gauge.js +1 -1
  251. package/node/Grid/Grid.js +24 -51
  252. package/node/Grid/index.js +1 -1
  253. package/node/Hamburger/Hamburger.js +37 -50
  254. package/node/Hamburger/index.js +1 -1
  255. package/node/Header/index.js +1 -1
  256. package/node/Header/useHeader.js +16 -16
  257. package/node/Hidden/Hidden.js +10 -15
  258. package/node/Hidden/index.js +1 -1
  259. package/node/Img/index.js +1 -1
  260. package/node/Img/sc/bare.js +4 -3
  261. package/node/Link/Link.js +4 -3
  262. package/node/Link/LinkBlank.js +11 -21
  263. package/node/Link/index.js +1 -1
  264. package/node/Menu/Menu.js +4 -12
  265. package/node/Menu/index.js +1 -1
  266. package/node/MenuItem/MenuItem.js +4 -21
  267. package/node/MenuItem/index.js +1 -1
  268. package/node/Meta/Meta.js +4 -3
  269. package/node/Meta/index.js +1 -1
  270. package/node/NoJs/NoJs.js +3 -3
  271. package/node/NoJs/index.js +1 -1
  272. package/node/Pagination/PaginationNav.js +30 -53
  273. package/node/Pagination/PaginationResults.js +10 -10
  274. package/node/Pagination/index.js +1 -1
  275. package/node/Pill/Pill.js +7 -38
  276. package/node/Pill/index.js +1 -1
  277. package/node/Progress/ProgressCircular.js +11 -33
  278. package/node/Progress/ProgressLinear.js +11 -20
  279. package/node/Progress/ProgressOverlay.js +18 -35
  280. package/node/Progress/index.js +1 -1
  281. package/node/Rating/Rating.js +28 -48
  282. package/node/Rating/index.js +20 -16
  283. package/node/Select/components.js +11 -18
  284. package/node/Sidebar/Sidebar.js +21 -47
  285. package/node/Sidebar/index.js +1 -1
  286. package/node/Spacing/Spacing.js +16 -17
  287. package/node/Spacing/index.js +1 -1
  288. package/node/Sticky/StickyCss.js +5 -3
  289. package/node/Sticky/index.js +1 -1
  290. package/node/Tabs/TabsMui.js +49 -0
  291. package/node/Tabs/index.js +2 -2
  292. package/node/Tabs/sc/bare.js +87 -0
  293. package/node/Tabs/tw/bare.js +20 -0
  294. package/node/Tabs/tw/material.js +21 -0
  295. package/node/Tabs/useTabs.js +48 -0
  296. package/node/Typography/CopyPasteVisible.js +4 -7
  297. package/node/Typography/Native.js +14 -48
  298. package/node/Typography/ReadMore.js +30 -57
  299. package/node/Typography/TextLoop.js +22 -25
  300. package/node/Typography/TypeStairs.js +22 -18
  301. package/node/Typography/index.js +1 -1
  302. package/node/css/index.js +2 -1
  303. package/node/helpers/classed.js +23 -19
  304. package/node/helpers/extend-component.js +7 -7
  305. package/node/helpers/index.js +1 -1
  306. package/node/hooks/index.js +9 -1
  307. package/node/hooks/types.js +2 -0
  308. package/node/hooks/useAsyncFn.js +40 -0
  309. package/node/hooks/useDateLocale.js +23 -37
  310. package/node/hooks/useEffectOnce.js +12 -0
  311. package/node/hooks/useFirstMountState.js +16 -0
  312. package/node/hooks/useFocus.js +4 -4
  313. package/node/hooks/useId.js +12 -0
  314. package/node/hooks/useIsomorphicLayoutEffect.js +11 -0
  315. package/node/hooks/useMount.js +13 -0
  316. package/node/hooks/useMountedState.js +19 -0
  317. package/node/hooks/usePrevious.js +3 -3
  318. package/node/hooks/useScrollPosition.js +23 -19
  319. package/node/hooks/useScrollTo.js +9 -7
  320. package/node/hooks/useTraceUpdate.js +5 -4
  321. package/node/hooks/useUpdateEffect.js +18 -0
  322. package/node/hooks/useWindowSize.js +4 -4
  323. package/node/index.js +1 -1
  324. package/node/m/MotionProvider.js +6 -4
  325. package/node/m/index.js +1 -1
  326. package/node/m/lite.js +1 -1
  327. package/node/m/max.js +1 -1
  328. package/node/sc/index.js +4 -2
  329. package/node/scm/index.js +2 -1
  330. package/node/shared/index.js +1 -1
  331. package/node/styles/Body.js +5 -10
  332. package/node/styles/Global.js +5 -37
  333. package/node/styles/index.js +1 -1
  334. package/node/styles/media.js +42 -38
  335. package/node/styles/spacing.js +15 -16
  336. package/node/styles/styled.js +7 -21
  337. package/node/styles/theme--vanilla.js +21 -19
  338. package/node/styles/theme.js +9 -9
  339. package/node/tw/index.js +2 -1
  340. package/node/twm/index.js +2 -1
  341. package/package.json +20 -9
  342. package/sc/index.d.ts +1 -0
  343. package/sc/index.js +1 -0
  344. package/scm/index.js +1 -0
  345. package/styles/Body.js +4 -8
  346. package/styles/Global.js +4 -36
  347. package/styles/media.js +41 -36
  348. package/styles/spacing.js +15 -16
  349. package/styles/styled.js +7 -21
  350. package/styles/theme--vanilla.js +21 -19
  351. package/styles/theme.js +11 -11
  352. package/tw/index.js +1 -0
  353. package/twm/index.js +1 -0
  354. package/Forms/Form/Form.d.ts +0 -31
  355. package/Forms/Form/Form.js +0 -62
  356. package/Tabs/Tabs.d.ts +0 -27
  357. package/Tabs/Tabs.js +0 -62
  358. package/node/Forms/Form/Form.js +0 -67
  359. package/node/Tabs/Tabs.js +0 -67
package/Calendar/utils.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { __assign } from "tslib";
1
2
  import isWithinInterval from "date-fns/isWithinInterval";
2
3
  import endOfMonth from "date-fns/endOfMonth";
3
4
  import startOfWeek from "date-fns/startOfWeek";
@@ -8,7 +9,7 @@ import subWeeks from "date-fns/subWeeks";
8
9
  import addWeeks from "date-fns/addWeeks";
9
10
  import addDays from "date-fns/addDays";
10
11
  export function getEventTimestamp(dateLike) {
11
- const date = new Date(dateLike);
12
+ var date = new Date(dateLike);
12
13
  date.setHours(0, 0, 0, 0);
13
14
  return date.valueOf() / 1000;
14
15
  }
@@ -29,7 +30,7 @@ export function getStartDate(date, view) {
29
30
  return date;
30
31
  }
31
32
  export function getEndDate(start, view) {
32
- let end = start;
33
+ var end = start;
33
34
  if (view === "month") {
34
35
  end = endOfMonth(start);
35
36
  }
@@ -52,152 +53,150 @@ export function getNextDate(date, view) {
52
53
  return addWeeks(date, 1);
53
54
  }
54
55
  export function isTodayInView(start, end) {
55
- return isWithinInterval(new Date(), { start, end });
56
+ return isWithinInterval(new Date(), { start: start, end: end });
56
57
  }
57
58
  export function mergeCalendarEvents(first, second) {
58
- const all = {};
59
+ var all = {};
59
60
  addCalendarEvents(first, all);
60
61
  addCalendarEvents(second, all);
61
62
  return all;
62
63
  }
63
64
  export function addCalendarEvents(toAdd, toExtend) {
64
- for (const id in toAdd) {
65
- const event = toAdd[id];
66
- toExtend[id] = event;
65
+ for (var id in toAdd) {
66
+ var event_1 = toAdd[id];
67
+ toExtend[id] = event_1;
67
68
  }
68
69
  return toExtend;
69
70
  }
70
71
  function getEventsByTimestamp(events) {
71
- const output = {};
72
- for (const uid in events) {
73
- const event = events[uid];
74
- event.days.forEach((timestamp) => {
72
+ var output = {};
73
+ var _loop_1 = function (uid) {
74
+ var event_2 = events[uid];
75
+ event_2.days.forEach(function (timestamp) {
75
76
  output[timestamp] = (output[timestamp] || {});
76
- output[timestamp][uid] = event;
77
+ output[timestamp][uid] = event_2;
77
78
  });
79
+ };
80
+ for (var uid in events) {
81
+ _loop_1(uid);
78
82
  }
79
83
  return output;
80
84
  }
81
85
  function getSortedEvents(events) {
82
- const output = [];
83
- for (const uid in events) {
86
+ var output = [];
87
+ for (var uid in events) {
84
88
  output.push(events[uid]);
85
89
  }
86
90
  // sort events first multi, then all day then by start then by created date
87
- output.sort((a, b) => {
88
- const multi = Number(b.multi) - Number(a.multi);
89
- const allDay = Number(b.allDay) - Number(a.allDay);
90
- const start = a.start.getTime() - b.start.getTime();
91
- const created = a.created.getTime() - b.created.getTime();
91
+ output.sort(function (a, b) {
92
+ var multi = Number(b.multi) - Number(a.multi);
93
+ var allDay = Number(b.allDay) - Number(a.allDay);
94
+ var start = a.start.getTime() - b.start.getTime();
95
+ var created = a.created.getTime() - b.created.getTime();
92
96
  return multi || allDay || start || created;
93
97
  });
94
98
  return output;
95
99
  }
96
- const FREE_SLOT = 0;
97
- const BUSY_SLOT = 1;
100
+ var FREE_SLOT = 0;
101
+ var BUSY_SLOT = 1;
98
102
  export function processEventsInView(eventsMap, calendarView, month, weeks) {
99
- const eventsByTimestamp = getEventsByTimestamp(eventsMap);
100
- const eventsList = getSortedEvents(eventsMap);
101
- const todayDate = new Date();
102
- const todayTimestamp = getEventTimestamp(todayDate);
103
- const startedAtTopMap = {};
104
- const viewWeeks = [];
105
- for (let weekIdx = 0; weekIdx < weeks.length; weekIdx++) {
106
- const viewWeek = {
107
- props: { key: `week.${weekIdx}` },
103
+ var eventsByTimestamp = getEventsByTimestamp(eventsMap);
104
+ var eventsList = getSortedEvents(eventsMap);
105
+ var todayDate = new Date();
106
+ var todayTimestamp = getEventTimestamp(todayDate);
107
+ var startedAtTopMap = {};
108
+ var viewWeeks = [];
109
+ var _loop_2 = function (weekIdx) {
110
+ var viewWeek = {
111
+ props: { key: "week.".concat(weekIdx) },
108
112
  days: [],
109
113
  };
110
- const weekStartDate = weeks[weekIdx];
111
- const weekStartDay = weekStartDate.getDate();
112
- const weekStartTimestamp = getEventTimestamp(new Date(weekStartDate));
113
- const weekEndTimestamp = getEventTimestamp(addDays(new Date(weekStartDate), 6));
114
- for (let dayNumber = 0; dayNumber < 7; dayNumber++) {
115
- const dayDate = new Date(new Date(weekStartDate).setDate(weekStartDay + dayNumber));
116
- const dayTimestamp = getEventTimestamp(dayDate);
117
- const $isToday = todayTimestamp === dayTimestamp;
118
- const $isOutOfRange = calendarView === "month" && dayDate.getMonth() !== month;
119
- const contextualProps = {
120
- $isToday,
121
- $isOutOfRange,
114
+ var weekStartDate = weeks[weekIdx];
115
+ var weekStartDay = weekStartDate.getDate();
116
+ var weekStartTimestamp = getEventTimestamp(new Date(weekStartDate));
117
+ var weekEndTimestamp = getEventTimestamp(addDays(new Date(weekStartDate), 6));
118
+ for (var dayNumber = 0; dayNumber < 7; dayNumber++) {
119
+ var dayDate = new Date(new Date(weekStartDate).setDate(weekStartDay + dayNumber));
120
+ var dayTimestamp = getEventTimestamp(dayDate);
121
+ var $isToday = todayTimestamp === dayTimestamp;
122
+ var $isOutOfRange = calendarView === "month" && dayDate.getMonth() !== month;
123
+ var contextualProps = {
124
+ $isToday: $isToday,
125
+ $isOutOfRange: $isOutOfRange,
122
126
  };
123
- const viewDay = {
124
- props: { key: `day.${dayTimestamp}`, ...contextualProps },
127
+ var viewDay = {
128
+ props: __assign({ key: "day.".concat(dayTimestamp) }, contextualProps),
125
129
  timestamp: dayTimestamp + "",
126
130
  label: dayDate.getDate() + "",
127
131
  events: [],
128
132
  };
129
133
  // check that we have events in this day
130
- if (eventsByTimestamp?.[dayTimestamp]) {
131
- const verticalSlots = Object.keys(eventsByTimestamp[dayTimestamp]).map(() => FREE_SLOT);
132
- for (let eventIdx = 0; eventIdx < eventsList.length; eventIdx++) {
133
- const event = eventsList[eventIdx];
134
- let width = 1;
135
- let top = 0;
136
- let firstOfMulti;
137
- if (!event.daysMap[dayTimestamp]) {
134
+ if (eventsByTimestamp === null || eventsByTimestamp === void 0 ? void 0 : eventsByTimestamp[dayTimestamp]) {
135
+ var verticalSlots = Object.keys(eventsByTimestamp[dayTimestamp]).map(function () { return FREE_SLOT; });
136
+ for (var eventIdx = 0; eventIdx < eventsList.length; eventIdx++) {
137
+ var event_3 = eventsList[eventIdx];
138
+ var width = 1;
139
+ var top_1 = 0;
140
+ var firstOfMulti = void 0;
141
+ if (!event_3.daysMap[dayTimestamp]) {
138
142
  continue;
139
143
  }
140
144
  // only for multi days events:
141
- if (event.multi) {
145
+ if (event_3.multi) {
142
146
  // filter out the days outside of the current week view to avoid
143
147
  // making a multi-days event chip wider than the week row or shorter
144
148
  // than it should be (when event spans across weeks)
145
- width = event.days.filter((t) => t >= weekStartTimestamp && t <= weekEndTimestamp).length;
149
+ width = event_3.days.filter(function (t) { return t >= weekStartTimestamp && t <= weekEndTimestamp; }).length;
146
150
  // flag the first day of multi-days events, consider that an event
147
151
  // might start in a day earlier (hence outside) of the current
148
152
  // week/month view, so we always check for Mondays (dayNumber === 0)
149
- if (event.days.indexOf(dayTimestamp) === 0 || dayNumber === 0) {
153
+ if (event_3.days.indexOf(dayTimestamp) === 0 || dayNumber === 0) {
150
154
  firstOfMulti = true;
151
155
  }
152
156
  }
153
157
  // if we already have the information on when the event has been
154
158
  // vertically positioned use that index
155
- if (startedAtTopMap[event.uid]) {
156
- top = startedAtTopMap[event.uid];
159
+ if (startedAtTopMap[event_3.uid]) {
160
+ top_1 = startedAtTopMap[event_3.uid];
157
161
  }
158
162
  else {
159
163
  // now look for a free slot and use its index as `top`
160
- for (let verticalIdx = 0; verticalIdx < verticalSlots.length; verticalIdx++) {
161
- const freeOrBusy = verticalSlots[verticalIdx];
164
+ for (var verticalIdx = 0; verticalIdx < verticalSlots.length; verticalIdx++) {
165
+ var freeOrBusy = verticalSlots[verticalIdx];
162
166
  if (freeOrBusy !== BUSY_SLOT) {
163
- top = verticalIdx;
167
+ top_1 = verticalIdx;
164
168
  break;
165
169
  }
166
170
  }
167
171
  }
168
172
  // now mark the slot as busy
169
- verticalSlots[top] = BUSY_SLOT;
173
+ verticalSlots[top_1] = BUSY_SLOT;
170
174
  // store the slot vertical position consistently for multi-days events
171
175
  if (firstOfMulti) {
172
- startedAtTopMap[event.uid] = top;
176
+ startedAtTopMap[event_3.uid] = top_1;
173
177
  }
174
178
  // push the event, they will be sorted later
175
- viewDay.events.push({
176
- key: `event.${dayTimestamp}-${top}`,
177
- ...contextualProps,
178
- ...event,
179
- isPast: todayDate > event.end,
180
- firstOfMulti,
181
- top,
182
- width,
183
- });
179
+ viewDay.events.push(__assign(__assign(__assign({ key: "event.".concat(dayTimestamp, "-").concat(top_1) }, contextualProps), event_3), { isPast: todayDate > event_3.end, firstOfMulti: firstOfMulti, top: top_1, width: width }));
184
180
  }
185
181
  // fill the empty slots with events' placeholders
186
- for (let i = 0; i < verticalSlots.length; i++) {
182
+ for (var i = 0; i < verticalSlots.length; i++) {
187
183
  if (verticalSlots[i] !== BUSY_SLOT) {
188
184
  viewDay.events.push({
189
- key: `event.${dayTimestamp}-${i}}`,
185
+ key: "event.".concat(dayTimestamp, "-").concat(i, "}"),
190
186
  placeholder: true,
191
187
  top: i,
192
188
  });
193
189
  }
194
190
  }
195
191
  // sort events and events placeholders by top position
196
- viewDay.events.sort((a, b) => a.top - b.top);
192
+ viewDay.events.sort(function (a, b) { return a.top - b.top; });
197
193
  }
198
194
  viewWeek.days.push(viewDay);
199
195
  }
200
196
  viewWeeks.push(viewWeek);
197
+ };
198
+ for (var weekIdx = 0; weekIdx < weeks.length; weekIdx++) {
199
+ _loop_2(weekIdx);
201
200
  }
202
201
  return viewWeeks;
203
202
  }
@@ -1,4 +1,4 @@
1
- export const KoineCarousel = null;
1
+ export var KoineCarousel = null;
2
2
  // import React, { useEffect, useState, useRef } from 'react';
3
3
  // import Slide from './slide';
4
4
  // import { getSliderListStyles } from './slider-list';
@@ -1,36 +1,23 @@
1
+ import { __assign, __makeTemplateObject, __rest } from "tslib";
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Children, useId } from "react";
3
+ import { Children /* , useId */ } from "react";
3
4
  import styled from "styled-components";
4
5
  import { Row, Col, GRID_GUTTER_DEFAULT as DF, } from "../Grid";
5
- export const CarouselCssRow = styled(Row) `
6
- ${({ $gutter: cs, theme: { gutter } }) => `
7
- margin-left: -${cs === DF ? gutter[DF] : (gutter[DF] - gutter[cs]) * 2}px;
8
- margin-right: -${cs === DF ? gutter[DF] : (gutter[DF] - gutter[cs]) * 2}px;
9
- padding-left: ${cs === DF ? gutter[DF] : gutter[DF] - gutter[cs]}px;
10
- padding-right: ${cs === DF ? gutter[DF] : gutter[DF] - gutter[cs]}px;
11
- `}
12
-
13
- scroll-behavior: smooth;
14
- scroll-snap-type: x;
15
- -ms-overflow-style: none;
16
- scrollbar-width: none;
17
-
18
- &::-webkit-scrollbar {
19
- display: none;
20
- }
21
- `;
22
- export const CarouselCssCol = styled(Col) `
23
- ${(p) => p.$width && `flex-basis: ${p.$width}px; min-width: ${p.$width}px;`}
24
- position: relative;
25
- scroll-snap-align: ${(p) => p.$snap};
26
- `;
6
+ import { useId } from "../hooks/useId";
7
+ export var CarouselCssRow = styled(Row)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n\n scroll-behavior: smooth;\n scroll-snap-type: x;\n -ms-overflow-style: none;\n scrollbar-width: none;\n\n &::-webkit-scrollbar {\n display: none;\n }\n"], ["\n ", "\n\n scroll-behavior: smooth;\n scroll-snap-type: x;\n -ms-overflow-style: none;\n scrollbar-width: none;\n\n &::-webkit-scrollbar {\n display: none;\n }\n"])), function (_a) {
8
+ var cs = _a.$gutter, gutter = _a.theme.gutter;
9
+ return "\n margin-left: -".concat(cs === DF ? gutter[DF] : (gutter[DF] - gutter[cs]) * 2, "px;\n margin-right: -").concat(cs === DF ? gutter[DF] : (gutter[DF] - gutter[cs]) * 2, "px;\n padding-left: ").concat(cs === DF ? gutter[DF] : gutter[DF] - gutter[cs], "px;\n padding-right: ").concat(cs === DF ? gutter[DF] : gutter[DF] - gutter[cs], "px;\n ");
10
+ });
11
+ export var CarouselCssCol = styled(Col)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n position: relative;\n scroll-snap-align: ", ";\n"], ["\n ", "\n position: relative;\n scroll-snap-align: ", ";\n"])), function (p) { return p.$width && "flex-basis: ".concat(p.$width, "px; min-width: ").concat(p.$width, "px;"); }, function (p) { return p.$snap; });
27
12
  /**
28
13
  * For programmatic usage an example here @see https://stackoverflow.com/a/65902068/9122820
29
14
  */
30
- export const KoineCarouselCss = ({ items, $gutterRow, $gutterCol, $gutter = "quarter", $proportion, $snap = "center", width, children, ...colProps }) => {
31
- const slides = children ? Children.toArray(children) : items;
32
- const id = useId();
15
+ export var KoineCarouselCss = function (_a) {
16
+ var items = _a.items, $gutterRow = _a.$gutterRow, $gutterCol = _a.$gutterCol, _b = _a.$gutter, $gutter = _b === void 0 ? "quarter" : _b, $proportion = _a.$proportion, _c = _a.$snap, $snap = _c === void 0 ? "center" : _c, width = _a.width, children = _a.children, colProps = __rest(_a, ["items", "$gutterRow", "$gutterCol", "$gutter", "$proportion", "$snap", "width", "children"]);
17
+ var slides = children ? Children.toArray(children) : items;
18
+ var id = useId();
33
19
  if (!slides)
34
20
  return null;
35
- return (_jsx(CarouselCssRow, { "$noWrap": true, "$gutter": $gutterRow || $gutter, children: slides.map((_slide, idx) => (_jsx(CarouselCssCol, { ...colProps, "$gutter": $gutterCol || $gutter, "$width": width, children: slides[idx] }, `CarouselCssCol-${id}-${idx}`))) }));
21
+ return (_jsx(CarouselCssRow, __assign({ "$noWrap": true, "$gutter": $gutterRow || $gutter }, { children: slides.map(function (_slide, idx) { return (_jsx(CarouselCssCol, __assign({}, colProps, { "$gutter": $gutterCol || $gutter, "$width": width }, { children: slides[idx] }), "CarouselCssCol-".concat(id, "-").concat(idx))); }) })));
36
22
  };
23
+ var templateObject_1, templateObject_2;
@@ -1 +1 @@
1
- export declare const Collasable: null;
1
+ export declare const Collapsable: null;
@@ -1 +1 @@
1
- export const Collasable = null;
1
+ export var Collapsable = null;
@@ -1,66 +1,6 @@
1
- /// <reference types="react" />
2
- /// <reference types="@reach/utils/dist/declarations/src/polymorphic" />
3
- import { MotionProps } from "framer-motion";
4
- export declare type CollapsableStyledProps = {
5
- $expanded?: boolean;
6
- };
7
1
  /**
8
- * `overflow-anchor: none;` keeps the same scrolling position
9
- * @see https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Accordion/Accordion.js#L54
2
+ * @file
3
+ *
4
+ * Maybe do a simplified version following this example:
5
+ * https://codesandbox.io/s/framer-motion-accordion-qx958?file=/src/Example.tsx
10
6
  */
11
- export declare const CollapsableRoot: import("styled-components").StyledComponent<import("react").FC<import("@reach/disclosure/dist/declarations/src").DisclosureProps>, import("styled-components").DefaultTheme, {}, never>;
12
- export declare const CollapsableHeadRoot: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLLabelElement, import("framer-motion").HTMLMotionProps<"label">>, import("styled-components").DefaultTheme, {
13
- htmlFor: `${string}-input`;
14
- } & Pick<CollapsableStyledProps, "$expanded">, "htmlFor">;
15
- export declare const CollapsableHeadSpace: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
16
- export declare const CollapsableHeadAction: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
17
- export declare const CollaspableHeadLine: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, import("styled-components").DefaultTheme, {}, never>;
18
- export declare const collapsableHeadLineMotion: {
19
- hover: {
20
- width: string;
21
- transition: {
22
- duration: number;
23
- };
24
- };
25
- };
26
- export declare const CollapsableHeadText: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
27
- export declare const CollapsableHeadIcon: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, import("styled-components").DefaultTheme, {}, never>;
28
- export declare type CollapsableHeadProps = React.PropsWithChildren<Pick<CollapsableStyledProps, "$expanded"> & CollapsableComponents & {
29
- id: CollapsableProps["id"];
30
- onClick: (...args: any) => any;
31
- }>;
32
- export declare const CollapsableHead: ({ $expanded, id, onClick, HeadRoot, HeadAction, HeadIcon, children, }: CollapsableHeadProps) => JSX.Element;
33
- export declare const CollapsableInput: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, {
34
- type: "checkbox";
35
- }, "type">;
36
- export declare const CollasableBodyWrap: import("styled-components").StyledComponent<import("@reach/utils/dist/declarations/src/polymorphic").ForwardRefComponent<"div", import("@reach/disclosure/dist/declarations/src").DisclosurePanelProps>, import("styled-components").DefaultTheme, CollapsableStyledProps, never>;
37
- export declare const CollapsableBodyRoot: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, import("styled-components").DefaultTheme, {}, never>;
38
- export declare type CollapsableBodyProps = MotionProps & Pick<CollapsableStyledProps, "$expanded"> & {
39
- children?: React.ReactNode;
40
- style?: React.CSSProperties;
41
- };
42
- export declare const CollapsableBody: import("react").ForwardRefExoticComponent<MotionProps & Pick<CollapsableStyledProps, "$expanded"> & {
43
- children?: React.ReactNode;
44
- style?: import("react").CSSProperties | undefined;
45
- } & import("react").RefAttributes<HTMLDivElement>>;
46
- export declare type CollapsableComponents = {
47
- HeadRoot?: typeof CollapsableHeadRoot;
48
- HeadAction?: null | typeof CollapsableHeadAction | React.FC<any>;
49
- HeadIcon?: null | typeof CollapsableHeadIcon | React.FC<any>;
50
- };
51
- export declare type CollapsableProps = React.ComponentPropsWithoutRef<"div"> & {
52
- id?: string;
53
- expanded?: boolean;
54
- /** Used to trigger a recalculation effect */
55
- recalc?: any;
56
- onChange?: () => any;
57
- head: null | React.ReactNode;
58
- body: React.ReactNode;
59
- /** Amount of milliseconds after which the component collapses */
60
- components?: CollapsableComponents;
61
- /** @default "Expand" */
62
- ariaExpand?: string;
63
- /** @default "Collapse" */
64
- ariaCollapse?: string;
65
- };
66
- export declare const Collapsable: ({ expanded: propExpanded, recalc, onChange, id, head, body, components, ariaExpand, ariaCollapse, ...props }: CollapsableProps) => JSX.Element;