@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
@@ -1,24 +1,15 @@
1
+ import { __assign, __makeTemplateObject, __rest } from "tslib";
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import styled from "styled-components";
3
4
  import { m } from "framer-motion";
4
- const ProgressLinearBg = styled.span `
5
- position: relative;
6
- overflow: hidden;
7
- display: block;
8
- height: 4px;
9
- `;
10
- const ProgressLinearFg = styled(m.span) `
11
- position: absolute;
12
- top: 0;
13
- bottom: 0;
14
- left: 0;
15
- width: 100%;
16
- `;
5
+ var ProgressLinearBg = styled.span(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n overflow: hidden;\n display: block;\n height: 4px;\n"], ["\n position: relative;\n overflow: hidden;\n display: block;\n height: 4px;\n"])));
6
+ var ProgressLinearFg = styled(m.span)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n"], ["\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n"])));
17
7
  /**
18
8
  * @see https://mui.com/components/progress/#linear
19
9
  */
20
- export const ProgressLinear = ({ done = false, height = "2px", bg = "transparent", fg = "currentColor", ...props }) => {
21
- return (_jsx(ProgressLinearBg, { style: { height, background: bg }, ...props, children: _jsx(ProgressLinearFg, { style: { height, background: fg }, initial: {
10
+ export var ProgressLinear = function (_a) {
11
+ var _b = _a.done, done = _b === void 0 ? false : _b, _c = _a.height, height = _c === void 0 ? "2px" : _c, _d = _a.bg, bg = _d === void 0 ? "transparent" : _d, _e = _a.fg, fg = _e === void 0 ? "currentColor" : _e, props = __rest(_a, ["done", "height", "bg", "fg"]);
12
+ return (_jsx(ProgressLinearBg, __assign({ style: { height: height, background: bg } }, props, { children: _jsx(ProgressLinearFg, { style: { height: height, background: fg }, initial: {
22
13
  x: "-100%",
23
14
  }, animate: {
24
15
  x: done ? "-100%" : "0%",
@@ -28,5 +19,6 @@ export const ProgressLinear = ({ done = false, height = "2px", bg = "transparent
28
19
  repeat: Infinity,
29
20
  repeatType: "reverse",
30
21
  duration: 2,
31
- } }) }));
22
+ } }) })));
32
23
  };
24
+ var templateObject_1, templateObject_2;
@@ -1,3 +1,4 @@
1
+ import { __assign, __makeTemplateObject } from "tslib";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useEffect } from "react";
3
4
  import styled from "styled-components";
@@ -5,36 +6,19 @@ import { m } from "framer-motion";
5
6
  import { ProgressCircular } from "./ProgressCircular";
6
7
  import { ProgressLinear } from "./ProgressLinear";
7
8
  import { useHeader } from "../Header";
8
- const ProgressOverlayWrap = styled(m.div) `
9
- z-index: 10000;
10
- position: fixed;
11
- top: 0;
12
- left: 0;
13
- right: 0;
14
- bottom: 0;
15
- pointer-events: none;
16
- cursor: wait;
17
- `;
18
- const ProgressOverlayCenterer = styled.div `
19
- position: absolute;
20
- top: 0;
21
- left: 0;
22
- right: 0;
23
- bottom: 0;
24
- display: flex;
25
- align-items: center;
26
- justify-content: center;
27
- background: var(--progress-overlay-bg);
28
- `;
29
- export const ProgressOverlay = ({ running }) => {
30
- const [, , headerHeight] = useHeader();
9
+ var ProgressOverlayWrap = styled(m.div)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n z-index: 10000;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n cursor: wait;\n"], ["\n z-index: 10000;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n cursor: wait;\n"])));
10
+ var ProgressOverlayCenterer = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--progress-overlay-bg);\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--progress-overlay-bg);\n"])));
11
+ export var ProgressOverlay = function (_a) {
12
+ var running = _a.running;
13
+ var _b = useHeader(), headerHeight = _b[2];
31
14
  // const [progress, setProgress] = useState(0);
32
- useEffect(() => {
15
+ useEffect(function () {
33
16
  document.body.style.cursor = running ? "wait" : "";
34
17
  }, [running]);
35
- return (_jsxs(ProgressOverlayWrap, { animate: {
18
+ return (_jsxs(ProgressOverlayWrap, __assign({ animate: {
36
19
  opacity: running ? 1 : 0,
37
- }, initial: { opacity: 0 }, transition: { type: "easeInOut" }, children: [_jsx(ProgressLinear, { bg: "var(--accent400)", fg: "var(--accent300)", done: !running }), _jsx(ProgressOverlayCenterer, { style: {
20
+ }, initial: { opacity: 0 }, transition: { type: "easeInOut" } }, { children: [_jsx(ProgressLinear, { bg: "var(--accent400)", fg: "var(--accent300)", done: !running }), _jsx(ProgressOverlayCenterer, __assign({ style: {
38
21
  top: headerHeight + "px",
39
- }, children: _jsx(ProgressCircular, { size: "50px", color: "var(--accent300)" }) })] }));
22
+ } }, { children: _jsx(ProgressCircular, { size: "50px", color: "var(--accent300)" }) }))] })));
40
23
  };
24
+ var templateObject_1, templateObject_2;
package/Rating/Rating.js CHANGED
@@ -1,48 +1,28 @@
1
+ import { __assign, __makeTemplateObject, __rest } from "tslib";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useCallback, useEffect, useId, useState } from "react";
3
+ import { useCallback, useEffect, /* useId, */ useState } from "react";
3
4
  import styled from "styled-components";
4
- export const RatingStarRoot = styled.svg `
5
- display: inline-block;
6
- vertical-align: middle;
7
- margin-right: 1px;
8
- `;
9
- export const RatingStar = ({ value, colorBg = "#FFD84C", colorStroke = "#947813", size, ...props }) => {
10
- const id = useId();
11
- return (_jsxs(RatingStarRoot, { viewBox: "0 0 16 16", "data-value": value, width: size + "px", height: size + "px", ...props, children: [_jsx("defs", { children: _jsxs("linearGradient", { id: id, x1: "0", y1: "0", x2: "1", y2: "0", children: [_jsx("stop", { offset: "0", stopColor: colorBg }), _jsx("stop", { offset: value, stopColor: colorBg }), _jsx("stop", { offset: value, stopColor: "rgba(255, 255, 255, 0)" })] }) }), _jsx("path", { stroke: colorStroke, strokeWidth: "0.5", fill: `url(#${id})`, d: "M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.283.95l-3.523 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z" })] }));
5
+ import { useId } from "../hooks/useId";
6
+ export var RatingStarRoot = styled.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-block;\n vertical-align: middle;\n margin-right: 1px;\n"], ["\n display: inline-block;\n vertical-align: middle;\n margin-right: 1px;\n"])));
7
+ export var RatingStar = function (_a) {
8
+ var value = _a.value, _b = _a.colorBg, colorBg = _b === void 0 ? "#FFD84C" : _b, _c = _a.colorStroke, colorStroke = _c === void 0 ? "#947813" : _c, size = _a.size, props = __rest(_a, ["value", "colorBg", "colorStroke", "size"]);
9
+ var id = useId();
10
+ return (_jsxs(RatingStarRoot, __assign({ viewBox: "0 0 16 16", "data-value": value, width: size + "px", height: size + "px" }, props, { children: [_jsx("defs", { children: _jsxs("linearGradient", __assign({ id: id, x1: "0", y1: "0", x2: "1", y2: "0" }, { children: [_jsx("stop", { offset: "0", stopColor: colorBg }), _jsx("stop", { offset: value, stopColor: colorBg }), _jsx("stop", { offset: value, stopColor: "rgba(255, 255, 255, 0)" })] })) }), _jsx("path", { stroke: colorStroke, strokeWidth: "0.5", fill: "url(#".concat(id, ")"), d: "M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.283.95l-3.523 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z" })] })));
12
11
  };
13
- export const RatingDetails = styled.span `
14
- padding-left: 0.5em;
15
- font-size: 12px;
16
- color: var(--grey100);
17
-
18
- &:before {
19
- content: "(";
20
- }
21
- &:after {
22
- content: ")";
23
- }
24
- `;
25
- export const RatingCount = styled.span ``;
26
- export const RatingValue = styled.span `
27
- display: none;
28
- `;
29
- export const RatingRoot = styled.div `
30
- display: flex;
31
- align-items: center;
32
-
33
- &:hover ${RatingValue} {
34
- display: inline-block;
35
- }
36
- `;
37
- export const Rating = ({ value = 0, count, min = 0, max = 5, showDetails = true, colorBg, colorStroke, starSize = 16, }) => {
38
- const id = useId();
39
- const [currentValue /* , _setCurrentValue */] = useState(value);
40
- const [stars, setStars] = useState([]);
41
- const getStars = useCallback((activeCount) => {
42
- const stars = [];
43
- for (let currentStar = min + 1; currentStar < max + 1; currentStar++) {
44
- let starValue;
45
- const roundedActiveCount = Math.floor(activeCount);
12
+ export var RatingDetails = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-left: 0.5em;\n font-size: 12px;\n color: var(--grey100);\n\n &:before {\n content: \"(\";\n }\n &:after {\n content: \")\";\n }\n"], ["\n padding-left: 0.5em;\n font-size: 12px;\n color: var(--grey100);\n\n &:before {\n content: \"(\";\n }\n &:after {\n content: \")\";\n }\n"])));
13
+ export var RatingCount = styled.span(templateObject_3 || (templateObject_3 = __makeTemplateObject([""], [""])));
14
+ export var RatingValue = styled.span(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: none;\n"], ["\n display: none;\n"])));
15
+ export var RatingRoot = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n\n &:hover ", " {\n display: inline-block;\n }\n"], ["\n display: flex;\n align-items: center;\n\n &:hover ", " {\n display: inline-block;\n }\n"])), RatingValue);
16
+ export var Rating = function (_a) {
17
+ var _b = _a.value, value = _b === void 0 ? 0 : _b, count = _a.count, _c = _a.min, min = _c === void 0 ? 0 : _c, _d = _a.max, max = _d === void 0 ? 5 : _d, _e = _a.showDetails, showDetails = _e === void 0 ? true : _e, colorBg = _a.colorBg, colorStroke = _a.colorStroke, _f = _a.starSize, starSize = _f === void 0 ? 16 : _f;
18
+ var id = useId();
19
+ var currentValue = useState(value)[0] /* , _setCurrentValue */;
20
+ var _g = useState([]), stars = _g[0], setStars = _g[1];
21
+ var getStars = useCallback(function (activeCount) {
22
+ var stars = [];
23
+ for (var currentStar = min + 1; currentStar < max + 1; currentStar++) {
24
+ var starValue = void 0;
25
+ var roundedActiveCount = Math.floor(activeCount);
46
26
  // we have a rating of 3.4, when we get to the 4th star:
47
27
  if (roundedActiveCount === currentStar - 1) {
48
28
  starValue = 1 - (currentStar - activeCount);
@@ -57,7 +37,7 @@ export const Rating = ({ value = 0, count, min = 0, max = 5, showDetails = true,
57
37
  }
58
38
  return stars;
59
39
  }, [min, max]);
60
- useEffect(() => {
40
+ useEffect(function () {
61
41
  setStars(getStars(currentValue));
62
42
  }, [currentValue, getStars]);
63
43
  // function updateStars(index) {
@@ -82,9 +62,10 @@ export const Rating = ({ value = 0, count, min = 0, max = 5, showDetails = true,
82
62
  // onChange(value);
83
63
  // }
84
64
  // }, [onChange];
85
- return (_jsxs(RatingRoot, { children: [stars.map((star, idx) => (_jsx(RatingStar, { idx: idx, dataIdx: idx, size: starSize,
65
+ return (_jsxs(RatingRoot, { children: [stars.map(function (star, idx) { return (_jsx(RatingStar, { idx: idx, dataIdx: idx, size: starSize,
86
66
  // onMouseOver={handleMouseOver}
87
67
  // onMouseLeave={handleMouseLeave}
88
68
  // onClick={handleClick}
89
- value: star.value, colorBg: colorBg, colorStroke: colorStroke }, id + idx))), " ", showDetails && count && (_jsxs(RatingDetails, { children: [_jsx(RatingCount, { children: count }), _jsx(RatingValue, { children: ` - ${value}` })] }))] }));
69
+ value: star.value, colorBg: colorBg, colorStroke: colorStroke }, id + idx)); }), " ", showDetails && count && (_jsxs(RatingDetails, { children: [_jsx(RatingCount, { children: count }), _jsx(RatingValue, { children: " - ".concat(value) })] }))] }));
90
70
  };
71
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
package/Rating/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "./Rating";
2
- const RATING_WORDS = {
2
+ var RATING_WORDS = {
3
3
  0: "Worst",
4
4
  1: "Bad",
5
5
  2: "Mediocre",
@@ -8,9 +8,10 @@ const RATING_WORDS = {
8
8
  4.5: "Excellent",
9
9
  5: "Best",
10
10
  };
11
- export const getRatingWord = (value, precision = 0.5) => {
12
- let buffer = 0;
13
- let word;
11
+ export var getRatingWord = function (value, precision) {
12
+ if (precision === void 0) { precision = 0.5; }
13
+ var buffer = 0;
14
+ var word;
14
15
  while (buffer < value) {
15
16
  // @ts-expect-error can't remember
16
17
  word = RATING_WORDS[buffer];
@@ -18,8 +19,8 @@ export const getRatingWord = (value, precision = 0.5) => {
18
19
  }
19
20
  return word;
20
21
  };
21
- export const getRatingValue = (value) => {
22
- const converted = convertRange(value, [0, 5], [0, 10]);
22
+ export var getRatingValue = function (value) {
23
+ var converted = convertRange(value, [0, 5], [0, 10]);
23
24
  if (converted % 1 === 0) {
24
25
  return converted;
25
26
  }
@@ -31,15 +32,18 @@ export const getRatingValue = (value) => {
31
32
  export function convertRange(value, r1, r2) {
32
33
  return ((value - r1[0]) * (r2[1] - r2[0])) / (r1[1] - r1[0]) + r2[0];
33
34
  }
34
- export const deriveRating = (title, date, minValue = 3.8, maxValue = 5, minQuantity = 9) => {
35
- const entityTime = date.getTime();
36
- const nowTime = new Date().getTime();
37
- const length = title.length;
38
- const value = Number(convertRange(length, [0, 90], [minValue, maxValue]).toFixed(2));
39
- const timeDifference = convertRange(nowTime - entityTime, [0, 10000000000000], [minQuantity, 999999]);
40
- const count = Math.round(timeDifference / length);
35
+ export var deriveRating = function (title, date, minValue, maxValue, minQuantity) {
36
+ if (minValue === void 0) { minValue = 3.8; }
37
+ if (maxValue === void 0) { maxValue = 5; }
38
+ if (minQuantity === void 0) { minQuantity = 9; }
39
+ var entityTime = date.getTime();
40
+ var nowTime = new Date().getTime();
41
+ var length = title.length;
42
+ var value = Number(convertRange(length, [0, 90], [minValue, maxValue]).toFixed(2));
43
+ var timeDifference = convertRange(nowTime - entityTime, [0, 10000000000000], [minQuantity, 999999]);
44
+ var count = Math.round(timeDifference / length);
41
45
  return {
42
- value,
43
- count,
46
+ value: value,
47
+ count: count,
44
48
  };
45
49
  };
@@ -1,4 +1,4 @@
1
- export const Select = null;
1
+ export var Select = null;
2
2
  // import { useSelect } from "downshift";
3
3
  // export type SelectProps = {
4
4
  // options?: Option[];
@@ -1,18 +1,12 @@
1
+ import { __assign, __makeTemplateObject, __rest } from "tslib";
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import { forwardRef } from "react";
3
4
  import styled from "styled-components";
4
5
  import { m } from "framer-motion";
5
6
  import { BsBoxArrowInDown as IconCollapse } from "react-icons/bs";
6
- export const SelectArrowStyled = styled(m.span) `
7
- display: inline-flex;
8
- align-items: center;
9
- justify-content: center;
10
- width: 2em;
11
-
12
- &:not([disabled]) {
13
- cursor: pointer;
14
- }
15
- `;
16
- export const SelectArrow = forwardRef(function SelectArrow({ isOpen, ...props }, ref) {
17
- return (_jsx(SelectArrowStyled, { animate: { rotate: isOpen ? 180 : 0 }, ref: ref, ...props, children: _jsx(IconCollapse, {}) }));
7
+ export var SelectArrowStyled = styled(m.span)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 2em;\n\n &:not([disabled]) {\n cursor: pointer;\n }\n"], ["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 2em;\n\n &:not([disabled]) {\n cursor: pointer;\n }\n"])));
8
+ export var SelectArrow = forwardRef(function SelectArrow(_a, ref) {
9
+ var isOpen = _a.isOpen, props = __rest(_a, ["isOpen"]);
10
+ return (_jsx(SelectArrowStyled, __assign({ animate: { rotate: isOpen ? 180 : 0 }, ref: ref }, props, { children: _jsx(IconCollapse, {}) })));
18
11
  });
12
+ var templateObject_1;
@@ -1,3 +1,4 @@
1
+ import { __assign, __makeTemplateObject } from "tslib";
1
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useCallback, useState } from "react";
3
4
  import styled from "styled-components";
@@ -6,43 +7,17 @@ import { CgCloseR as IconClose } from "react-icons/cg";
6
7
  import { max, min } from "../styles/media";
7
8
  import { IconButtonFab } from "../Buttons";
8
9
  import { useHeader } from "../Header";
9
- const SidebarWrapper = styled.div `
10
- ${(p) => `${max.md} {
11
- z-index: 20;
12
- display: flex;
13
- flex-direction: column;
14
- position: fixed;
15
- right: 0;
16
- left: var(--gutter-half);
17
- top: ${p.$top || 0}px;
18
- bottom: 0;
19
- padding: var(--gutter-half);
20
- transform: ${p.$open ? `translateX(0)` : `translateX(100%)`};
21
- transition: transform .18s ease-in-out, box-shadow .18s ease-in-out;
22
- background: white;
23
- box-shadow: ${p.$open ? `0 0 0 100vh rgba(0, 0, 0, .3)` : `0 0 100vh rgba(0, 0, 0, 0)`};
24
- will-change: transform, box-shadow;
25
- pointer-events: ${p.$open ? "all" : "none"}
26
- }`}
27
- `;
28
- const SidebarToggle = styled.span `
29
- z-index: 21;
30
- position: fixed;
31
- right: var(--gutter-half);
32
- bottom: var(--gutter-half);
33
- ${min.md} {
34
- display: none;
35
- }
36
-
37
- path {
38
- stroke: currentColor;
39
- }
40
- `;
41
- export const Sidebar = ({ children }) => {
42
- const [open, setOpen] = useState(false);
43
- const [, , headerHeight] = useHeader();
44
- const handleClickToggle = useCallback(() => {
45
- setOpen((prevOpen) => !prevOpen);
10
+ var SidebarWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (p) {
11
+ return "".concat(max.md, " {\n z-index: 20;\n display: flex;\n flex-direction: column;\n position: fixed;\n right: 0;\n left: var(--gutter-half);\n top: ").concat(p.$top || 0, "px;\n bottom: 0;\n padding: var(--gutter-half);\n transform: ").concat(p.$open ? "translateX(0)" : "translateX(100%)", ";\n transition: transform .18s ease-in-out, box-shadow .18s ease-in-out;\n background: white;\n box-shadow: ").concat(p.$open ? "0 0 0 100vh rgba(0, 0, 0, .3)" : "0 0 100vh rgba(0, 0, 0, 0)", ";\n will-change: transform, box-shadow;\n pointer-events: ").concat(p.$open ? "all" : "none", "\n }");
12
+ });
13
+ var SidebarToggle = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n z-index: 21;\n position: fixed;\n right: var(--gutter-half);\n bottom: var(--gutter-half);\n ", " {\n display: none;\n }\n\n path {\n stroke: currentColor;\n }\n"], ["\n z-index: 21;\n position: fixed;\n right: var(--gutter-half);\n bottom: var(--gutter-half);\n ", " {\n display: none;\n }\n\n path {\n stroke: currentColor;\n }\n"])), min.md);
14
+ export var Sidebar = function (_a) {
15
+ var children = _a.children;
16
+ var _b = useState(false), open = _b[0], setOpen = _b[1];
17
+ var _c = useHeader(), headerHeight = _c[2];
18
+ var handleClickToggle = useCallback(function () {
19
+ setOpen(function (prevOpen) { return !prevOpen; });
46
20
  }, []);
47
- return (_jsxs(_Fragment, { children: [_jsx(SidebarToggle, { onClick: handleClickToggle, children: _jsx(IconButtonFab, { "$variant": "contained", children: open ? _jsx(IconClose, {}) : _jsx(IconOpen, {}) }) }), _jsx(SidebarWrapper, { "$open": open, "$top": headerHeight, children: children })] }));
21
+ return (_jsxs(_Fragment, { children: [_jsx(SidebarToggle, __assign({ onClick: handleClickToggle }, { children: _jsx(IconButtonFab, __assign({ "$variant": "contained" }, { children: open ? _jsx(IconClose, {}) : _jsx(IconOpen, {}) })) })), _jsx(SidebarWrapper, __assign({ "$open": open, "$top": headerHeight }, { children: children }))] }));
48
22
  };
23
+ var templateObject_1, templateObject_2;
@@ -1,15 +1,13 @@
1
+ import { __assign, __makeTemplateObject, __rest, __spreadArray } from "tslib";
1
2
  import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
3
  import styled from "styled-components";
3
4
  import { isUndefined } from "@koine/utils";
4
5
  import { spacingTop, spacingBottom, } from "../styles/spacing";
5
- const Root = styled.div `
6
- ${(p) => p.$top && spacingTop.call(p.theme, ...p.$top)}
7
- ${(p) => p.$bottom && spacingBottom.call(p.theme, ...p.$bottom)}
8
- `;
9
- const extractDirectionArgs = (raw) => {
10
- const [size, factor, property, devices] = raw.split(":");
11
- const factorArg = isUndefined(factor) ? undefined : parseFloat(factor);
12
- const devicesArg = devices?.split(",");
6
+ var Root = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n ", "\n"], ["\n ", "\n ", "\n"])), function (p) { return p.$top && spacingTop.call.apply(spacingTop, __spreadArray([p.theme], p.$top, false)); }, function (p) { return p.$bottom && spacingBottom.call.apply(spacingBottom, __spreadArray([p.theme], p.$bottom, false)); });
7
+ var extractDirectionArgs = function (raw) {
8
+ var _a = raw.split(":"), size = _a[0], factor = _a[1], property = _a[2], devices = _a[3];
9
+ var factorArg = isUndefined(factor) ? undefined : parseFloat(factor);
10
+ var devicesArg = devices === null || devices === void 0 ? void 0 : devices.split(",");
13
11
  return [size, factorArg, property, devicesArg];
14
12
  };
15
13
  /**
@@ -24,9 +22,10 @@ const extractDirectionArgs = (raw) => {
24
22
  * <Spacing top="sm:2:padding:tablet,desktop" />
25
23
  * ```
26
24
  */
27
- export const Spacing = ({ top, bottom, vertical, ...props }) => {
28
- let $top;
29
- let $bottom;
25
+ export var Spacing = function (_a) {
26
+ var top = _a.top, bottom = _a.bottom, vertical = _a.vertical, props = __rest(_a, ["top", "bottom", "vertical"]);
27
+ var $top;
28
+ var $bottom;
30
29
  if (top) {
31
30
  $top = extractDirectionArgs(top);
32
31
  }
@@ -41,5 +40,6 @@ export const Spacing = ({ top, bottom, vertical, ...props }) => {
41
40
  // eslint-disable-next-line react/jsx-no-useless-fragment
42
41
  return _jsx(_Fragment, { children: props.children });
43
42
  }
44
- return _jsx(Root, { "$top": $top, "$bottom": $bottom, ...props });
43
+ return _jsx(Root, __assign({ "$top": $top, "$bottom": $bottom }, props));
45
44
  };
45
+ var templateObject_1;
package/Sticky/Sticky.js CHANGED
@@ -1,4 +1,4 @@
1
- export const Sticky = null;
1
+ export var Sticky = null;
2
2
  // import {
3
3
  // Ref,
4
4
  // CSSProperties,
@@ -1,4 +1,6 @@
1
+ import { __assign, __rest } from "tslib";
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
- export const StickyCss = ({ top, ...props }) => {
3
- return _jsx("div", { style: { position: "sticky", top: 100 }, ...props });
3
+ export var StickyCss = function (_a) {
4
+ var top = _a.top, props = __rest(_a, ["top"]);
5
+ return _jsx("div", __assign({ style: { position: "sticky", top: 100 } }, props));
4
6
  };