@koine/react 1.0.11 → 1.0.14

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 (323) 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 +12 -26
  29. package/Collapsable/Collapsable.js +1 -1
  30. package/Debug/Debug.js +5 -17
  31. package/Details/Details.js +30 -27
  32. package/Dialog/DialogMui.js +22 -20
  33. package/Dialog/css/bare.js +17 -15
  34. package/Dialog/m/bare.js +17 -13
  35. package/Dialog/m/basic.js +2 -2
  36. package/Dialog/m/index.js +4 -4
  37. package/Dialog/sc/bare.js +25 -43
  38. package/Dialog/sc/framer.js +6 -6
  39. package/Dialog/sc/framerMaterial.js +6 -6
  40. package/Dialog/sc/material.js +17 -37
  41. package/Dialog/tw/bare.js +25 -19
  42. package/Dialog/tw/elegant.js +17 -15
  43. package/Dialog/tw/framer.js +6 -6
  44. package/Dialog/tw/framerMaterial.js +6 -6
  45. package/Dialog/tw/material.js +17 -15
  46. package/Editor/Editor--tiptap.js +14 -11
  47. package/Editor/components.js +6 -24
  48. package/Favicon/FaviconTags.js +2 -1
  49. package/Form/Form.js +30 -28
  50. package/Form/sc/bare.js +9 -18
  51. package/Forms/Checkbox/Checkbox.js +9 -15
  52. package/Forms/Feedback/Feedback.js +6 -7
  53. package/Forms/Field/Field.js +15 -26
  54. package/Forms/Field/FieldControl.js +19 -15
  55. package/Forms/Field/FieldHint.js +3 -5
  56. package/Forms/Input/Input.js +10 -16
  57. package/Forms/InputGroup/InputGroup.js +9 -36
  58. package/Forms/Label/Label.js +5 -23
  59. package/Forms/Password/Password.js +10 -23
  60. package/Forms/Radio/Radio.js +15 -18
  61. package/Forms/Switch/Switch.js +9 -39
  62. package/Forms/Textarea/Textarea.js +6 -7
  63. package/Forms/Textarea/TextareaRich.js +10 -24
  64. package/Forms/Toggle/Toggle.js +19 -67
  65. package/Forms/Toggle/useToggle.d.ts +1 -1
  66. package/Forms/Toggle/useToggle.js +30 -30
  67. package/Forms/antispam.js +12 -12
  68. package/Forms/helpers.js +7 -6
  69. package/Forms/styles.js +12 -43
  70. package/Gauge/Gauge.js +1 -1
  71. package/Grid/Grid.js +25 -51
  72. package/Hamburger/Hamburger.js +35 -47
  73. package/Header/useHeader.js +12 -12
  74. package/Hidden/Hidden.js +9 -13
  75. package/Img/sc/bare.js +3 -1
  76. package/Link/Link.js +3 -1
  77. package/Link/LinkBlank.js +8 -17
  78. package/Menu/Menu.js +3 -10
  79. package/MenuItem/MenuItem.js +3 -19
  80. package/Meta/Meta.js +3 -2
  81. package/NoJs/NoJs.js +2 -2
  82. package/Pagination/PaginationNav.js +26 -48
  83. package/Pagination/PaginationResults.js +7 -6
  84. package/Pill/Pill.js +6 -36
  85. package/Progress/ProgressCircular.js +9 -30
  86. package/Progress/ProgressLinear.js +8 -16
  87. package/Progress/ProgressOverlay.js +11 -27
  88. package/Rating/Rating.js +24 -44
  89. package/Rating/index.js +19 -15
  90. package/Select/SelectDownshift.js +1 -1
  91. package/Select/components.js +6 -12
  92. package/Sidebar/Sidebar.js +13 -38
  93. package/Spacing/Spacing.js +12 -12
  94. package/Sticky/Sticky.js +1 -1
  95. package/Sticky/StickyCss.js +4 -2
  96. package/Tabs/TabsMui.js +19 -16
  97. package/Tabs/tw/bare.js +13 -11
  98. package/Tabs/tw/material.js +15 -11
  99. package/Tabs/useTabs.js +16 -16
  100. package/Typography/CopyPasteVisible.js +3 -5
  101. package/Typography/Native.js +12 -45
  102. package/Typography/ReadMore.js +25 -51
  103. package/Typography/TextLoop.js +19 -22
  104. package/Typography/TypeStairs.js +20 -16
  105. package/helpers/classed.js +21 -18
  106. package/helpers/extend-component.js +6 -6
  107. package/hooks/useAsyncFn.js +18 -11
  108. package/hooks/useDateLocale.js +22 -13
  109. package/hooks/useEffectOnce.js +1 -1
  110. package/hooks/useFirstMountState.js +1 -1
  111. package/hooks/useFocus.js +3 -3
  112. package/hooks/useId.js +3 -2
  113. package/hooks/useIsomorphicLayoutEffect.js +1 -1
  114. package/hooks/useMount.js +2 -2
  115. package/hooks/useMountedState.js +4 -4
  116. package/hooks/usePrevious.js +2 -2
  117. package/hooks/useScrollPosition.js +20 -15
  118. package/hooks/useScrollTo.js +7 -5
  119. package/hooks/useTraceUpdate.js +4 -3
  120. package/hooks/useUpdateEffect.js +3 -3
  121. package/hooks/useWindowSize.js +3 -3
  122. package/m/MotionProvider.js +4 -2
  123. package/package.json +8 -7
  124. package/styles/Body.js +4 -8
  125. package/styles/Global.js +4 -36
  126. package/styles/media.js +41 -36
  127. package/styles/spacing.js +15 -16
  128. package/styles/styled.js +7 -21
  129. package/styles/theme--vanilla.js +20 -18
  130. package/styles/theme.js +11 -11
  131. package/node/Alert/Alert.js +0 -21
  132. package/node/Alert/index.js +0 -4
  133. package/node/Animations/Reveal.js +0 -19
  134. package/node/Animations/Underline.js +0 -19
  135. package/node/Animations/index.js +0 -6
  136. package/node/Animations/useReveal.js +0 -74
  137. package/node/Autocomplete/AutocompleteDownshift.js +0 -161
  138. package/node/Autocomplete/AutocompleteDownshiftMultiselect.js +0 -356
  139. package/node/Autocomplete/AutocompleteMui.js +0 -175
  140. package/node/Autocomplete/AutocompleteReach.js +0 -115
  141. package/node/Autocomplete/components.js +0 -93
  142. package/node/Autocomplete/helpers.js +0 -32
  143. package/node/Autocomplete/index.js +0 -7
  144. package/node/Bg/BgColor.js +0 -36
  145. package/node/Bg/BgPhoto.js +0 -64
  146. package/node/Bg/BgSvg.js +0 -20
  147. package/node/Bg/index.js +0 -6
  148. package/node/Breadcrumbs/Breadcrumbs.js +0 -72
  149. package/node/Breadcrumbs/index.js +0 -4
  150. package/node/Buttons/Button.js +0 -83
  151. package/node/Buttons/ButtonComposite.js +0 -54
  152. package/node/Buttons/ButtonFab.js +0 -12
  153. package/node/Buttons/ButtonLink.js +0 -15
  154. package/node/Buttons/IconButton.js +0 -23
  155. package/node/Buttons/index.js +0 -8
  156. package/node/Calendar/CalendarDaygridCell.js +0 -55
  157. package/node/Calendar/CalendarDaygridNav.js +0 -27
  158. package/node/Calendar/CalendarDaygridTable.js +0 -60
  159. package/node/Calendar/CalendarLegend.js +0 -15
  160. package/node/Calendar/calendar-api-google.js +0 -99
  161. package/node/Calendar/index.js +0 -9
  162. package/node/Calendar/types.js +0 -2
  163. package/node/Calendar/useCalendar.js +0 -186
  164. package/node/Calendar/utils.js +0 -217
  165. package/node/Carousel/Carousel.js +0 -381
  166. package/node/Carousel/CarouselCss.js +0 -42
  167. package/node/Carousel/index.js +0 -4
  168. package/node/Collapsable/Collapsable.js +0 -4
  169. package/node/Collapsable/CollapsableReach.js +0 -253
  170. package/node/Collapsable/index.js +0 -5
  171. package/node/Debug/Debug.js +0 -26
  172. package/node/Debug/index.js +0 -4
  173. package/node/Details/Details.js +0 -65
  174. package/node/Details/index.js +0 -4
  175. package/node/Dialog/DialogMui.js +0 -82
  176. package/node/Dialog/css/bare.js +0 -23
  177. package/node/Dialog/index.js +0 -5
  178. package/node/Dialog/m/bare.js +0 -51
  179. package/node/Dialog/m/basic.js +0 -35
  180. package/node/Dialog/m/index.js +0 -8
  181. package/node/Dialog/sc/bare.js +0 -65
  182. package/node/Dialog/sc/framer.js +0 -19
  183. package/node/Dialog/sc/framerMaterial.js +0 -19
  184. package/node/Dialog/sc/material.js +0 -45
  185. package/node/Dialog/tw/bare.js +0 -40
  186. package/node/Dialog/tw/elegant.js +0 -21
  187. package/node/Dialog/tw/framer.js +0 -19
  188. package/node/Dialog/tw/framerMaterial.js +0 -19
  189. package/node/Dialog/tw/material.js +0 -21
  190. package/node/Editor/Editor--tiptap.js +0 -29
  191. package/node/Editor/components.js +0 -34
  192. package/node/Editor/index.js +0 -4
  193. package/node/Favicon/FaviconTags.js +0 -18
  194. package/node/Favicon/index.js +0 -4
  195. package/node/Form/Form.js +0 -63
  196. package/node/Form/index.js +0 -4
  197. package/node/Form/sc/bare.js +0 -33
  198. package/node/Forms/Checkbox/Checkbox.js +0 -28
  199. package/node/Forms/Checkbox/index.js +0 -4
  200. package/node/Forms/Feedback/Feedback.js +0 -15
  201. package/node/Forms/Feedback/index.js +0 -4
  202. package/node/Forms/Field/Field.js +0 -64
  203. package/node/Forms/Field/FieldControl.js +0 -47
  204. package/node/Forms/Field/FieldHint.js +0 -10
  205. package/node/Forms/Field/index.js +0 -5
  206. package/node/Forms/Input/Input.js +0 -27
  207. package/node/Forms/Input/index.js +0 -4
  208. package/node/Forms/InputGroup/InputGroup.js +0 -47
  209. package/node/Forms/InputGroup/index.js +0 -4
  210. package/node/Forms/Label/Label.js +0 -28
  211. package/node/Forms/Label/index.js +0 -4
  212. package/node/Forms/Password/Password.js +0 -34
  213. package/node/Forms/Password/index.js +0 -4
  214. package/node/Forms/Radio/Radio.js +0 -32
  215. package/node/Forms/Radio/index.js +0 -4
  216. package/node/Forms/Switch/Switch.js +0 -54
  217. package/node/Forms/Switch/index.js +0 -4
  218. package/node/Forms/Textarea/Textarea.js +0 -17
  219. package/node/Forms/Textarea/TextareaRich.js +0 -46
  220. package/node/Forms/Textarea/index.js +0 -5
  221. package/node/Forms/Toggle/Toggle.js +0 -86
  222. package/node/Forms/Toggle/index.js +0 -4
  223. package/node/Forms/Toggle/useToggle.js +0 -149
  224. package/node/Forms/antispam.js +0 -61
  225. package/node/Forms/helpers.js +0 -51
  226. package/node/Forms/index.js +0 -19
  227. package/node/Forms/styles.js +0 -64
  228. package/node/Gauge/Gauge.js +0 -106
  229. package/node/Grid/Grid.js +0 -83
  230. package/node/Grid/index.js +0 -4
  231. package/node/Hamburger/Hamburger.js +0 -69
  232. package/node/Hamburger/index.js +0 -4
  233. package/node/Header/index.js +0 -4
  234. package/node/Header/useHeader.js +0 -34
  235. package/node/Hidden/Hidden.js +0 -18
  236. package/node/Hidden/index.js +0 -4
  237. package/node/Img/index.js +0 -4
  238. package/node/Img/sc/bare.js +0 -41
  239. package/node/Img/types.js +0 -2
  240. package/node/Link/Link.js +0 -6
  241. package/node/Link/LinkBlank.js +0 -31
  242. package/node/Link/index.js +0 -5
  243. package/node/Menu/Menu.js +0 -15
  244. package/node/Menu/index.js +0 -4
  245. package/node/MenuItem/MenuItem.js +0 -24
  246. package/node/MenuItem/index.js +0 -4
  247. package/node/Meta/Meta.js +0 -8
  248. package/node/Meta/index.js +0 -4
  249. package/node/NoJs/NoJs.js +0 -10
  250. package/node/NoJs/index.js +0 -4
  251. package/node/Pagination/PaginationNav.js +0 -88
  252. package/node/Pagination/PaginationResults.js +0 -15
  253. package/node/Pagination/index.js +0 -5
  254. package/node/Pill/Pill.js +0 -41
  255. package/node/Pill/index.js +0 -4
  256. package/node/Progress/ProgressCircular.js +0 -41
  257. package/node/Progress/ProgressLinear.js +0 -37
  258. package/node/Progress/ProgressOverlay.js +0 -45
  259. package/node/Progress/index.js +0 -6
  260. package/node/Rating/Rating.js +0 -97
  261. package/node/Rating/index.js +0 -53
  262. package/node/Select/SelectDownshift.js +0 -41
  263. package/node/Select/components.js +0 -22
  264. package/node/Select/index.js +0 -7
  265. package/node/Sidebar/Sidebar.js +0 -53
  266. package/node/Sidebar/index.js +0 -4
  267. package/node/Spacing/Spacing.js +0 -50
  268. package/node/Spacing/index.js +0 -4
  269. package/node/Sticky/Sticky.js +0 -222
  270. package/node/Sticky/StickyCss.js +0 -8
  271. package/node/Sticky/index.js +0 -4
  272. package/node/Tabs/TabsMui.js +0 -47
  273. package/node/Tabs/index.js +0 -4
  274. package/node/Tabs/sc/bare.js +0 -87
  275. package/node/Tabs/tw/bare.js +0 -19
  276. package/node/Tabs/tw/material.js +0 -17
  277. package/node/Tabs/useTabs.js +0 -48
  278. package/node/Typography/CopyPasteVisible.js +0 -10
  279. package/node/Typography/Native.js +0 -51
  280. package/node/Typography/ReadMore.js +0 -74
  281. package/node/Typography/TextLoop.js +0 -54
  282. package/node/Typography/TypeStairs.js +0 -49
  283. package/node/Typography/index.js +0 -8
  284. package/node/css/index.js +0 -36
  285. package/node/helpers/classed.js +0 -69
  286. package/node/helpers/extend-component.js +0 -16
  287. package/node/helpers/index.js +0 -5
  288. package/node/hooks/index.js +0 -18
  289. package/node/hooks/types.js +0 -2
  290. package/node/hooks/useAsyncFn.js +0 -33
  291. package/node/hooks/useDateLocale.js +0 -56
  292. package/node/hooks/useEffectOnce.js +0 -12
  293. package/node/hooks/useFirstMountState.js +0 -16
  294. package/node/hooks/useFocus.js +0 -15
  295. package/node/hooks/useId.js +0 -11
  296. package/node/hooks/useIsomorphicLayoutEffect.js +0 -11
  297. package/node/hooks/useMount.js +0 -13
  298. package/node/hooks/useMountedState.js +0 -19
  299. package/node/hooks/usePrevious.js +0 -12
  300. package/node/hooks/useScrollPosition.js +0 -79
  301. package/node/hooks/useScrollTo.js +0 -23
  302. package/node/hooks/useTraceUpdate.js +0 -24
  303. package/node/hooks/useUpdateEffect.js +0 -18
  304. package/node/hooks/useWindowSize.js +0 -17
  305. package/node/index.js +0 -8
  306. package/node/m/MotionProvider.js +0 -41
  307. package/node/m/index.js +0 -9
  308. package/node/m/lite.js +0 -4
  309. package/node/m/max.js +0 -4
  310. package/node/sc/index.js +0 -37
  311. package/node/scm/index.js +0 -36
  312. package/node/shared/index.js +0 -11
  313. package/node/styles/Body.js +0 -21
  314. package/node/styles/Global.js +0 -53
  315. package/node/styles/index.js +0 -10
  316. package/node/styles/media.js +0 -156
  317. package/node/styles/spacing.js +0 -53
  318. package/node/styles/styled.js +0 -31
  319. package/node/styles/theme--vanilla.js +0 -59
  320. package/node/styles/theme.js +0 -45
  321. package/node/tw/index.js +0 -36
  322. package/node/twm/index.js +0 -36
  323. package/node/types.js +0 -2
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,37 +1,23 @@
1
+ import { __assign, __makeTemplateObject, __rest } from "tslib";
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
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
6
  import { useId } from "../hooks/useId";
6
- export const CarouselCssRow = styled(Row) `
7
- ${({ $gutter: cs, theme: { gutter } }) => `
8
- margin-left: -${cs === DF ? gutter[DF] : (gutter[DF] - gutter[cs]) * 2}px;
9
- margin-right: -${cs === DF ? gutter[DF] : (gutter[DF] - gutter[cs]) * 2}px;
10
- padding-left: ${cs === DF ? gutter[DF] : gutter[DF] - gutter[cs]}px;
11
- padding-right: ${cs === DF ? gutter[DF] : gutter[DF] - gutter[cs]}px;
12
- `}
13
-
14
- scroll-behavior: smooth;
15
- scroll-snap-type: x;
16
- -ms-overflow-style: none;
17
- scrollbar-width: none;
18
-
19
- &::-webkit-scrollbar {
20
- display: none;
21
- }
22
- `;
23
- export const CarouselCssCol = styled(Col) `
24
- ${(p) => p.$width && `flex-basis: ${p.$width}px; min-width: ${p.$width}px;`}
25
- position: relative;
26
- scroll-snap-align: ${(p) => p.$snap};
27
- `;
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; });
28
12
  /**
29
13
  * For programmatic usage an example here @see https://stackoverflow.com/a/65902068/9122820
30
14
  */
31
- export const KoineCarouselCss = ({ items, $gutterRow, $gutterCol, $gutter = "quarter", $proportion, $snap = "center", width, children, ...colProps }) => {
32
- const slides = children ? Children.toArray(children) : items;
33
- 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();
34
19
  if (!slides)
35
20
  return null;
36
- 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))); }) })));
37
22
  };
23
+ var templateObject_1, templateObject_2;
@@ -1 +1 @@
1
- export const Collapsable = null;
1
+ export var Collapsable = null;
package/Debug/Debug.js CHANGED
@@ -1,21 +1,9 @@
1
+ import { __makeTemplateObject } from "tslib";
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import styled from "styled-components";
3
- const Root = styled.div `
4
- background: #f4f4f4;
5
- border: 1px solid #ddd;
6
- border-left: 3px solid #f36d33;
7
- color: #666;
8
- page-break-inside: avoid;
9
- font-family: monospace;
10
- font-size: small;
11
- line-height: 1.6;
12
- margin-bottom: 1.6em;
13
- max-width: 100%;
14
- overflow: auto;
15
- padding: 1em 1.5em;
16
- display: block;
17
- word-wrap: break-word;
18
- `;
19
- export const Debug = ({ data }) => {
4
+ var Root = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background: #f4f4f4;\n border: 1px solid #ddd;\n border-left: 3px solid #f36d33;\n color: #666;\n page-break-inside: avoid;\n font-family: monospace;\n font-size: small;\n line-height: 1.6;\n margin-bottom: 1.6em;\n max-width: 100%;\n overflow: auto;\n padding: 1em 1.5em;\n display: block;\n word-wrap: break-word;\n"], ["\n background: #f4f4f4;\n border: 1px solid #ddd;\n border-left: 3px solid #f36d33;\n color: #666;\n page-break-inside: avoid;\n font-family: monospace;\n font-size: small;\n line-height: 1.6;\n margin-bottom: 1.6em;\n max-width: 100%;\n overflow: auto;\n padding: 1em 1.5em;\n display: block;\n word-wrap: break-word;\n"])));
5
+ export var Debug = function (_a) {
6
+ var data = _a.data;
20
7
  return _jsx(Root, { children: JSON.stringify(data, undefined, 2) });
21
8
  };
9
+ var templateObject_1;
@@ -1,29 +1,32 @@
1
+ import { __assign, __rest } from "tslib";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, useCallback, useEffect, /* useId, */ useRef, useState } from "react";
3
+ import { forwardRef, useCallback, useEffect,
4
+ /* useId, */ useRef, useState, } from "react";
3
5
  import { useWindowSize } from "../hooks/useWindowSize";
4
6
  import { extendComponent, } from "../helpers";
5
7
  import { useId } from "../hooks/useId";
6
- export const Root = "details";
7
- export const Summary = "summary";
8
- export const Body = "div";
9
- export const Content = "div";
8
+ export var Root = "details";
9
+ export var Summary = "summary";
10
+ export var Body = "div";
11
+ export var Content = "div";
10
12
  /**
11
13
  * FIXME: it actually works even without forwardRef, check if we do need it
12
14
  *
13
15
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details
14
16
  */
15
- const DetailsWithRef = forwardRef(function Details({ id, open: propOpen, recalc, summary, children, Root: _Root, Summary: _Summary, Body: _Body, Content: _Content, onChange, ...props }, ref) {
16
- const isControlled = typeof propOpen !== "undefined";
17
- const [stateOpen, setStateOpen] = useState(propOpen);
18
- const [height, setHeight] = useState(0);
19
- const hash = id ? `#${id}` : "";
20
- const winSize = useWindowSize();
21
- const open = isControlled ? propOpen : stateOpen;
22
- const [overflow, setOverflow] = useState(open ? "unset" : "hidden");
23
- const content = useRef(null);
24
- const defaultId = useId();
17
+ var DetailsWithRef = forwardRef(function Details(_a, ref) {
18
+ var id = _a.id, propOpen = _a.open, recalc = _a.recalc, summary = _a.summary, children = _a.children, _Root = _a.Root, _Summary = _a.Summary, _Body = _a.Body, _Content = _a.Content, onChange = _a.onChange, props = __rest(_a, ["id", "open", "recalc", "summary", "children", "Root", "Summary", "Body", "Content", "onChange"]);
19
+ var isControlled = typeof propOpen !== "undefined";
20
+ var _b = useState(propOpen), stateOpen = _b[0], setStateOpen = _b[1];
21
+ var _c = useState(0), height = _c[0], setHeight = _c[1];
22
+ var hash = id ? "#".concat(id) : "";
23
+ var winSize = useWindowSize();
24
+ var open = isControlled ? propOpen : stateOpen;
25
+ var _d = useState(open ? "unset" : "hidden"), overflow = _d[0], setOverflow = _d[1];
26
+ var content = useRef(null);
27
+ var defaultId = useId();
25
28
  id = id || defaultId;
26
- const handleClick = useCallback(() => {
29
+ var handleClick = useCallback(function () {
27
30
  if (hash) {
28
31
  window.history.replaceState(null, "", open ? window.location.pathname + window.location.search : hash);
29
32
  }
@@ -31,32 +34,32 @@ const DetailsWithRef = forwardRef(function Details({ id, open: propOpen, recalc,
31
34
  onChange();
32
35
  }
33
36
  if (!isControlled) {
34
- setStateOpen((prevOpen) => !prevOpen);
37
+ setStateOpen(function (prevOpen) { return !prevOpen; });
35
38
  }
36
39
  }, [open, hash, onChange, isControlled]);
37
- useEffect(() => {
40
+ useEffect(function () {
38
41
  if (content.current) {
39
42
  setHeight(Math.ceil(content.current.offsetHeight));
40
43
  }
41
44
  }, [winSize, recalc]);
42
45
  // deeplink on mount
43
- useEffect(() => {
46
+ useEffect(function () {
44
47
  if (!isControlled && hash && window.location.hash === hash) {
45
48
  setStateOpen(true);
46
49
  }
47
50
  }, [hash, isControlled]);
48
- return (_jsxs(Root, { ...props, open: open || false, children: [_jsx(Summary, { "$open": open, onClick: handleClick, children: summary || " " }), _jsx(Body, { "$open": open, style: { overflow }, children: _jsx(Content
51
+ return (_jsxs(Root, __assign({}, props, { open: open || false }, { children: [_jsx(Summary, __assign({ "$open": open, onClick: handleClick }, { children: summary || " " })), _jsx(Body, __assign({ "$open": open, style: { overflow: overflow } }, { children: _jsx(Content
49
52
  // ref={content}
50
- , { "$open": open,
53
+ , __assign({ "$open": open,
51
54
  // aria-expanded={open}
52
55
  // aria-label={open ? ariaCollapse : ariaExpand}
53
56
  style: {
54
57
  pointerEvents: open ? "all" : "none",
55
- }, children: children }) })] }));
58
+ } }, { children: children })) }))] })));
56
59
  });
57
- export const KoineDetails = extendComponent(DetailsWithRef, {
58
- Root,
59
- Summary,
60
- Body,
61
- Content,
60
+ export var KoineDetails = extendComponent(DetailsWithRef, {
61
+ Root: Root,
62
+ Summary: Summary,
63
+ Body: Body,
64
+ Content: Content,
62
65
  });
@@ -1,15 +1,16 @@
1
+ import { __assign, __rest } from "tslib";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { forwardRef, useRef } from "react";
3
4
  import ModalUnstyled from "@mui/base/ModalUnstyled";
4
5
  import { MdClear as IconClose } from "react-icons/md";
5
6
  import { extendComponent, } from "../helpers";
6
- export const Root = ModalUnstyled;
7
- export const Backdrop = "div";
8
- export const Container = "div";
9
- export const Paper = "div";
10
- export const Close = "button";
11
- export const Header = "div";
12
- export const Body = "div";
7
+ export var Root = ModalUnstyled;
8
+ export var Backdrop = "div";
9
+ export var Container = "div";
10
+ export var Paper = "div";
11
+ export var Close = "button";
12
+ export var Header = "div";
13
+ export var Body = "div";
13
14
  // const Dialog = ({
14
15
  // children,
15
16
  // title,
@@ -45,16 +46,17 @@ export const Body = "div";
45
46
  *
46
47
  * FIXME: it actually works even without forwardRef, check if we do need it
47
48
  */
48
- const DialogWithRef = forwardRef(function Dialog({ children, title, $scrollPaper, Root: _Root, Backdrop: _Backdrop, Container: _Container, Paper: _Paper, Close: _Close, Header: _Header, Body: _Body, onClose, ...props }, ref) {
49
+ var DialogWithRef = forwardRef(function Dialog(_a, ref) {
50
+ var children = _a.children, title = _a.title, $scrollPaper = _a.$scrollPaper, _Root = _a.Root, _Backdrop = _a.Backdrop, _Container = _a.Container, _Paper = _a.Paper, _Close = _a.Close, _Header = _a.Header, _Body = _a.Body, onClose = _a.onClose, props = __rest(_a, ["children", "title", "$scrollPaper", "Root", "Backdrop", "Container", "Paper", "Close", "Header", "Body", "onClose"]);
49
51
  // click handling is taken from
50
52
  // @see https://github.com/mui/material-ui/blob/c758b6c0b30f0831110458a746690b33147c45df/packages/mui-material/src/Dialog/Dialog.js#L205-L226
51
- const backdropClick = useRef();
52
- const handleMouseDown = (event) => {
53
+ var backdropClick = useRef();
54
+ var handleMouseDown = function (event) {
53
55
  // We don't want to close the dialog when clicking the dialog content.
54
56
  // Make sure the event starts and ends on the same DOM element.
55
57
  backdropClick.current = event.target === event.currentTarget;
56
58
  };
57
- const handleBackdropClick = (event) => {
59
+ var handleBackdropClick = function (event) {
58
60
  // Ignore the events not coming from the "backdrop".
59
61
  if (!backdropClick.current) {
60
62
  return;
@@ -65,14 +67,14 @@ const DialogWithRef = forwardRef(function Dialog({ children, title, $scrollPaper
65
67
  onClose(event, "backdropClick");
66
68
  }
67
69
  };
68
- return (_jsx(Root, { BackdropComponent: Backdrop, onClick: handleBackdropClick, onClose: onClose, ref: ref, ...props, children: _jsx(Container, { "$scrollPaper": $scrollPaper, onMouseDown: handleMouseDown, children: _jsxs(Paper, { "aria-label": title || "", "$scrollPaper": $scrollPaper, children: [title && _jsx(Header, { children: title }), _jsx(Close, { onClick: onClose, children: _jsx(IconClose, {}) }), _jsx(Body, { children: children })] }) }) }));
70
+ return (_jsx(Root, __assign({ BackdropComponent: Backdrop, onClick: handleBackdropClick, onClose: onClose, ref: ref }, props, { children: _jsx(Container, __assign({ "$scrollPaper": $scrollPaper, onMouseDown: handleMouseDown }, { children: _jsxs(Paper, __assign({ "aria-label": title || "", "$scrollPaper": $scrollPaper }, { children: [title && _jsx(Header, { children: title }), _jsx(Close, __assign({ onClick: onClose }, { children: _jsx(IconClose, {}) })), _jsx(Body, { children: children })] })) })) })));
69
71
  });
70
- export const KoineDialog = extendComponent(DialogWithRef, {
71
- Root,
72
- Backdrop,
73
- Container,
74
- Paper,
75
- Close,
76
- Header,
77
- Body,
72
+ export var KoineDialog = extendComponent(DialogWithRef, {
73
+ Root: Root,
74
+ Backdrop: Backdrop,
75
+ Container: Container,
76
+ Paper: Paper,
77
+ Close: Close,
78
+ Header: Header,
79
+ Body: Body,
78
80
  });
@@ -1,19 +1,21 @@
1
+ import { __makeTemplateObject } from "tslib";
1
2
  import { classed, extendComponent } from "../../helpers";
2
3
  import * as _ from "../DialogMui";
3
4
  // export type { KoineDialogProps } from "../DialogMui";
4
- export const Root = classed(_.Root) `dialog`;
5
- export const Backdrop = classed(_.Backdrop) `dialogBackdrop`;
6
- export const Container = classed(_.Container) `dialogContainer`;
7
- export const Paper = classed(_.Paper) `dialogPaper`;
8
- export const Close = classed(_.Close) `"dialogClose`;
9
- export const Header = classed(_.Header) `dialogHeader`;
10
- export const Body = classed(_.Body) `dialogBody`;
11
- export const KoineDialog = extendComponent(_.KoineDialog, {
12
- Root,
13
- Backdrop,
14
- Container,
15
- Paper,
16
- Close,
17
- Header,
18
- Body,
5
+ export var Root = classed(_.Root)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["dialog"], ["dialog"])));
6
+ export var Backdrop = classed(_.Backdrop)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["dialogBackdrop"], ["dialogBackdrop"])));
7
+ export var Container = classed(_.Container)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["dialogContainer"], ["dialogContainer"])));
8
+ export var Paper = classed(_.Paper)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["dialogPaper"], ["dialogPaper"])));
9
+ export var Close = classed(_.Close)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\"dialogClose"], ["\"dialogClose"])));
10
+ export var Header = classed(_.Header)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["dialogHeader"], ["dialogHeader"])));
11
+ export var Body = classed(_.Body)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["dialogBody"], ["dialogBody"])));
12
+ export var KoineDialog = extendComponent(_.KoineDialog, {
13
+ Root: Root,
14
+ Backdrop: Backdrop,
15
+ Container: Container,
16
+ Paper: Paper,
17
+ Close: Close,
18
+ Header: Header,
19
+ Body: Body,
19
20
  });
21
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
package/Dialog/m/bare.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { __assign, __rest } from "tslib";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { forwardRef, useMemo, useRef } from "react";
3
4
  import { MdClear as IconClose } from "react-icons/md";
@@ -11,18 +12,21 @@ import { Root, Backdrop, Container, Paper, Close, Header, Body, } from "../Dialo
11
12
  * - https://github.com/framer/motion/issues/478
12
13
  * - https://codesandbox.io/s/clever-banzai-7km49?file=/src/Modal.js
13
14
  */
14
- const Dialog = forwardRef(function Dialog({ children, title, $scrollPaper, Root, Backdrop, Container, Paper, Close, Header, Body, mBackdrop, mPaper, onClose, ...props }, ref) {
15
- const BackdropMotion = useMemo(() => (props) => (_jsx(AnimatePresence, { children: props.open && _jsx(Backdrop, { ...mBackdrop, ...props }) })), [Backdrop, mBackdrop]);
15
+ var Dialog = forwardRef(function Dialog(_a, ref) {
16
+ var children = _a.children, title = _a.title, $scrollPaper = _a.$scrollPaper, Root = _a.Root, Backdrop = _a.Backdrop, Container = _a.Container, Paper = _a.Paper, Close = _a.Close, Header = _a.Header, Body = _a.Body, mBackdrop = _a.mBackdrop, mPaper = _a.mPaper, onClose = _a.onClose, props = __rest(_a, ["children", "title", "$scrollPaper", "Root", "Backdrop", "Container", "Paper", "Close", "Header", "Body", "mBackdrop", "mPaper", "onClose"]);
17
+ var BackdropMotion = useMemo(function () { return function (props) {
18
+ return (_jsx(AnimatePresence, { children: props.open && _jsx(Backdrop, __assign({}, mBackdrop, props)) }));
19
+ }; }, [Backdrop, mBackdrop]);
16
20
  // FIXME: extract this logic either in a useDialog hook or in a useclickOutside hook
17
21
  // click handling is taken from
18
22
  // @see https://github.com/mui/material-ui/blob/c758b6c0b30f0831110458a746690b33147c45df/packages/mui-material/src/Dialog/Dialog.js#L205-L226
19
- const backdropClick = useRef();
20
- const handleMouseDown = (event) => {
23
+ var backdropClick = useRef();
24
+ var handleMouseDown = function (event) {
21
25
  // We don't want to close the dialog when clicking the dialog content.
22
26
  // Make sure the event starts and ends on the same DOM element.
23
27
  backdropClick.current = event.target === event.currentTarget;
24
28
  };
25
- const handleBackdropClick = (event) => {
29
+ var handleBackdropClick = function (event) {
26
30
  // Ignore the events not coming from the "backdrop".
27
31
  if (!backdropClick.current) {
28
32
  return;
@@ -33,16 +37,16 @@ const Dialog = forwardRef(function Dialog({ children, title, $scrollPaper, Root,
33
37
  onClose(event, "backdropClick");
34
38
  }
35
39
  };
36
- return (_jsx(Root, { keepMounted: true, BackdropComponent: BackdropMotion, onClick: handleBackdropClick, onClose: onClose, ref: ref, ...props, style: mRootStyle(props), children: _jsx(Container, { "$scrollPaper": $scrollPaper, onMouseDown: handleMouseDown, children: _jsx(AnimatePresence, { children: props.open && (
40
+ return (_jsx(Root, __assign({ keepMounted: true, BackdropComponent: BackdropMotion, onClick: handleBackdropClick, onClose: onClose, ref: ref }, props, { style: mRootStyle(props) }, { children: _jsx(Container, __assign({ "$scrollPaper": $scrollPaper, onMouseDown: handleMouseDown }, { children: _jsx(AnimatePresence, { children: props.open && (
37
41
  // @ts-expect-error framer props collision...
38
- _jsxs(Paper, { ...mPaper, "aria-label": title || "", "$scrollPaper": $scrollPaper, children: [title && _jsx(Header, { children: title }), _jsx(Close, { onClick: onClose, children: _jsx(IconClose, {}) }), _jsx(Body, { children: children })] })) }) }) }));
42
+ _jsxs(Paper, __assign({}, mPaper, { "aria-label": title || "", "$scrollPaper": $scrollPaper }, { children: [title && _jsx(Header, { children: title }), _jsx(Close, __assign({ onClick: onClose }, { children: _jsx(IconClose, {}) })), _jsx(Body, { children: children })] }))) }) })) })));
39
43
  });
40
- export const KoineDialog = extendComponent(Dialog, {
41
- Root,
44
+ export var KoineDialog = extendComponent(Dialog, {
45
+ Root: Root,
42
46
  Backdrop: m(Backdrop),
43
- Container,
47
+ Container: Container,
44
48
  Paper: m(Paper),
45
- Close,
46
- Header,
47
- Body,
49
+ Close: Close,
50
+ Header: Header,
51
+ Body: Body,
48
52
  });
package/Dialog/m/basic.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "./index";
2
- export const dialogBackdropMotion = {
2
+ export var dialogBackdropMotion = {
3
3
  initial: {
4
4
  opacity: 0,
5
5
  },
@@ -12,7 +12,7 @@ export const dialogBackdropMotion = {
12
12
  opacity: 0,
13
13
  },
14
14
  };
15
- export const dialogPaperMotion = {
15
+ export var dialogPaperMotion = {
16
16
  initial: {
17
17
  // scale: .9,
18
18
  translateY: -60,
package/Dialog/m/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export const mRootStyle = (props) => ({
2
- pointerEvents: props.open ? "all" : "none",
3
- ...(props.style || {}),
4
- });
1
+ import { __assign } from "tslib";
2
+ export var mRootStyle = function (props) {
3
+ return (__assign({ pointerEvents: props.open ? "all" : "none" }, (props.style || {})));
4
+ };