@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/Menu/Menu.js CHANGED
@@ -1,11 +1,4 @@
1
+ import { __makeTemplateObject } from "tslib";
1
2
  import styled from "styled-components";
2
- export const Menu = styled.ul `
3
- z-index: 3;
4
- position: absolute;
5
- list-style-type: none;
6
- margin: 0;
7
- padding: 0;
8
- background: #fff;
9
- width: 100%;
10
- box-shadow: var(--shadow);
11
- `;
3
+ export var Menu = styled.ul(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n z-index: 3;\n position: absolute;\n list-style-type: none;\n margin: 0;\n padding: 0;\n background: #fff;\n width: 100%;\n box-shadow: var(--shadow);\n"], ["\n z-index: 3;\n position: absolute;\n list-style-type: none;\n margin: 0;\n padding: 0;\n background: #fff;\n width: 100%;\n box-shadow: var(--shadow);\n"])));
4
+ var templateObject_1;
@@ -1,20 +1,4 @@
1
+ import { __makeTemplateObject } from "tslib";
1
2
  import styled from "styled-components";
2
- export const MenuItem = styled.li `
3
- padding: 8px 16px;
4
-
5
- &[aria-selected="true"] {
6
- background: var(--accent400);
7
- }
8
-
9
- /** DEP: this is just for MultiselectMui? */
10
- &.Mui-focused,
11
- &[data-focus="true"] {
12
- background: var(--accent300);
13
- color: white;
14
- }
15
-
16
- &:not([disabled]):hover {
17
- cursor: pointer;
18
- background: var(--accent300);
19
- }
20
- `;
3
+ export var MenuItem = styled.li(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 8px 16px;\n\n &[aria-selected=\"true\"] {\n background: var(--accent400);\n }\n\n /** DEP: this is just for MultiselectMui? */\n &.Mui-focused,\n &[data-focus=\"true\"] {\n background: var(--accent300);\n color: white;\n }\n\n &:not([disabled]):hover {\n cursor: pointer;\n background: var(--accent300);\n }\n"], ["\n padding: 8px 16px;\n\n &[aria-selected=\"true\"] {\n background: var(--accent400);\n }\n\n /** DEP: this is just for MultiselectMui? */\n &.Mui-focused,\n &[data-focus=\"true\"] {\n background: var(--accent300);\n color: white;\n }\n\n &:not([disabled]):hover {\n cursor: pointer;\n background: var(--accent300);\n }\n"])));
4
+ var templateObject_1;
package/Meta/Meta.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- export const Meta = ({ zoom }) => {
3
- return (_jsx("meta", { name: "viewport", content: `width=device-width, initial-scale=1, maximum-scale=1${zoom ? "" : ", user-scalable=0"}` }));
2
+ export var Meta = function (_a) {
3
+ var zoom = _a.zoom;
4
+ return (_jsx("meta", { name: "viewport", content: "width=device-width, initial-scale=1, maximum-scale=1".concat(zoom ? "" : ", user-scalable=0") }));
4
5
  };
package/NoJs/NoJs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- export const NoJs = (_props) => {
2
+ export var NoJs = function (_props) {
3
3
  return (_jsx("script", { id: "no-js", dangerouslySetInnerHTML: {
4
- __html: `document.querySelector("html").className=document.querySelector("html").className.replace(/no-js/,"") + "js";`,
4
+ __html: "document.querySelector(\"html\").className=document.querySelector(\"html\").className.replace(/no-js/,\"\") + \"js\";",
5
5
  } }));
6
6
  };
@@ -1,42 +1,16 @@
1
+ import { __assign, __makeTemplateObject } from "tslib";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import styled from "styled-components";
3
4
  import { CgArrowRightR as IconArrowRight, CgArrowLeftR as IconArrowLeft, } from "react-icons/cg";
4
5
  import { ensureInt } from "@koine/utils";
5
- const Root = styled.nav `
6
- display: flex;
7
- align-items: center;
8
- justify-content: center;
9
- padding: 20px 0 40px;
10
- font-weight: 600;
11
-
12
- & a {
13
- text-decoration: none;
14
- }
15
- `;
16
- const item = `
17
- display: block;
18
- padding: 5px 10px;
19
- `;
20
- const ItemCurrent = styled.span `
21
- ${item}
22
- background: var(--accent400);
23
- border-radius: 2px;
24
- `;
25
- const ItemLink = styled.a `
26
- ${item}
27
-
28
- ${(props) => (props.prev ? "color: var(--grey100);" : "")}
29
- `;
30
- const DotsSeparator = styled.span `
31
- color: var(--grey100);
32
- `;
33
- const arrow = `display: flex; font-size: 20px;`;
34
- const ItemPrev = styled.a `
35
- ${arrow}
36
- `;
37
- const ItemNext = styled.a `
38
- ${arrow}
39
- `;
6
+ var Root = styled.nav(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 20px 0 40px;\n font-weight: 600;\n\n & a {\n text-decoration: none;\n }\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 20px 0 40px;\n font-weight: 600;\n\n & a {\n text-decoration: none;\n }\n"])));
7
+ var item = "\n display: block;\n padding: 5px 10px;\n";
8
+ var ItemCurrent = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n background: var(--accent400);\n border-radius: 2px;\n"], ["\n ", "\n background: var(--accent400);\n border-radius: 2px;\n"])), item);
9
+ var ItemLink = styled.a(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", "\n\n ", "\n"], ["\n ", "\n\n ", "\n"])), item, function (props) { return (props.prev ? "color: var(--grey100);" : ""); });
10
+ var DotsSeparator = styled.span(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: var(--grey100);\n"], ["\n color: var(--grey100);\n"])));
11
+ var arrow = "display: flex; font-size: 20px;";
12
+ var ItemPrev = styled.a(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), arrow);
13
+ var ItemNext = styled.a(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), arrow);
40
14
  /*
41
15
  * Possible outcomes:
42
16
  * [1] 2 3 ... 78 >
@@ -45,7 +19,8 @@ const ItemNext = styled.a `
45
19
  * < 1 ... 75 76 [77] 78 >
46
20
  * < 1 ... 76 77 [78]
47
21
  */
48
- export const KoinePaginationNav = ({ total, perPage, currentPage, baseUrl, showOffset = 2, currentUrl = "/", Link = "a", }) => {
22
+ export var KoinePaginationNav = function (_a) {
23
+ var total = _a.total, perPage = _a.perPage, currentPage = _a.currentPage, baseUrl = _a.baseUrl, _b = _a.showOffset, showOffset = _b === void 0 ? 2 : _b, _c = _a.currentUrl, currentUrl = _c === void 0 ? "/" : _c, _d = _a.Link, Link = _d === void 0 ? "a" : _d;
49
24
  total = ensureInt(total);
50
25
  currentPage = ensureInt(currentPage);
51
26
  perPage = ensureInt(perPage);
@@ -56,15 +31,15 @@ export const KoinePaginationNav = ({ total, perPage, currentPage, baseUrl, showO
56
31
  if (total < perPage) {
57
32
  return null;
58
33
  }
59
- const firstPage = 1;
60
- const lastPage = Math.ceil(total / perPage);
61
- const prevPage = currentPage - 1 > firstPage ? currentPage - 1 : "";
62
- const nextPage = currentPage + 1 < lastPage ? currentPage + 1 : lastPage;
63
- const prevArrow = currentPage > firstPage;
64
- const nextArrow = currentPage < lastPage;
65
- const pages = [];
34
+ var firstPage = 1;
35
+ var lastPage = Math.ceil(total / perPage);
36
+ var prevPage = currentPage - 1 > firstPage ? currentPage - 1 : "";
37
+ var nextPage = currentPage + 1 < lastPage ? currentPage + 1 : lastPage;
38
+ var prevArrow = currentPage > firstPage;
39
+ var nextArrow = currentPage < lastPage;
40
+ var pages = [];
66
41
  // fill the pages before the current
67
- for (let i = currentPage - showOffset; i < currentPage; i++) {
42
+ for (var i = currentPage - showOffset; i < currentPage; i++) {
68
43
  if (i > 1) {
69
44
  pages.push(i);
70
45
  }
@@ -72,12 +47,15 @@ export const KoinePaginationNav = ({ total, perPage, currentPage, baseUrl, showO
72
47
  // add the current
73
48
  pages.push(currentPage);
74
49
  // fill the pages after the current
75
- for (let i = currentPage + 1; i < currentPage + 1 + showOffset; i++) {
50
+ for (var i = currentPage + 1; i < currentPage + 1 + showOffset; i++) {
76
51
  if (i < lastPage) {
77
52
  pages.push(i);
78
53
  }
79
54
  }
80
- const prevDots = pages[0] > firstPage + 1;
81
- const nextDots = pages[pages.length - 1] < lastPage - 1;
82
- return (_jsxs(Root, { children: [prevArrow && (_jsx(ItemPrev, { as: Link, href: `${baseUrl}/${prevPage}`, children: _jsx(IconArrowLeft, {}) })), firstPage !== currentPage && (_jsx(ItemLink, { as: Link, href: `${baseUrl}`, prev: true, children: firstPage })), prevDots && _jsx(DotsSeparator, { children: "..." }), pages.map((page) => page === currentPage ? (_jsx(ItemCurrent, { children: page }, page)) : (_jsx(ItemLink, { as: Link, href: `${baseUrl}/${page}`, prev: page < currentPage, next: page > currentPage, children: page }, `pagination-${page}`))), nextDots && _jsx(DotsSeparator, { children: "..." }), lastPage !== currentPage && (_jsx(ItemLink, { as: Link, href: `${baseUrl}/${lastPage}`, next: true, children: lastPage })), nextArrow && (_jsx(ItemNext, { as: Link, href: `${baseUrl}/${nextPage}`, children: _jsx(IconArrowRight, {}) }))] }));
55
+ var prevDots = pages[0] > firstPage + 1;
56
+ var nextDots = pages[pages.length - 1] < lastPage - 1;
57
+ return (_jsxs(Root, { children: [prevArrow && (_jsx(ItemPrev, __assign({ as: Link, href: "".concat(baseUrl, "/").concat(prevPage) }, { children: _jsx(IconArrowLeft, {}) }))), firstPage !== currentPage && (_jsx(ItemLink, __assign({ as: Link, href: "".concat(baseUrl), prev: true }, { children: firstPage }))), prevDots && _jsx(DotsSeparator, { children: "..." }), pages.map(function (page) {
58
+ return page === currentPage ? (_jsx(ItemCurrent, { children: page }, page)) : (_jsx(ItemLink, __assign({ as: Link, href: "".concat(baseUrl, "/").concat(page), prev: page < currentPage, next: page > currentPage }, { children: page }), "pagination-".concat(page)));
59
+ }), nextDots && _jsx(DotsSeparator, { children: "..." }), lastPage !== currentPage && (_jsx(ItemLink, __assign({ as: Link, href: "".concat(baseUrl, "/").concat(lastPage), next: true }, { children: lastPage }))), nextArrow && (_jsx(ItemNext, __assign({ as: Link, href: "".concat(baseUrl, "/").concat(nextPage) }, { children: _jsx(IconArrowRight, {}) })))] }));
83
60
  };
61
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
@@ -1,10 +1,11 @@
1
+ import { __assign, __makeTemplateObject } from "tslib";
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import styled from "styled-components";
3
4
  import { AnimatePresence, m } from "framer-motion";
4
- const Root = styled.div `
5
- // overflow: hidden;
6
- `;
7
- const Inner = styled(m.div) ``;
8
- export const PaginationResults = ({ children }) => {
9
- return (_jsx(AnimatePresence, { exitBeforeEnter: true, initial: true, children: _jsx(Root, { children: _jsx(Inner, { initial: { opacity: 0, x: -100 }, animate: { opacity: 1, x: 0 }, exit: { opacity: 0, x: 100 }, transition: { type: "linear", staggerChildren: 0.3 }, children: children }) }) }));
5
+ var Root = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n // overflow: hidden;\n"], ["\n // overflow: hidden;\n"])));
6
+ var Inner = styled(m.div)(templateObject_2 || (templateObject_2 = __makeTemplateObject([""], [""])));
7
+ export var PaginationResults = function (_a) {
8
+ var children = _a.children;
9
+ return (_jsx(AnimatePresence, __assign({ exitBeforeEnter: true, initial: true }, { children: _jsx(Root, { children: _jsx(Inner, __assign({ initial: { opacity: 0, x: -100 }, animate: { opacity: 1, x: 0 }, exit: { opacity: 0, x: 100 }, transition: { type: "linear", staggerChildren: 0.3 } }, { children: children })) }) })));
10
10
  };
11
+ var templateObject_1, templateObject_2;
package/Pill/Pill.js CHANGED
@@ -1,37 +1,7 @@
1
+ import { __makeTemplateObject } from "tslib";
1
2
  import styled from "styled-components";
2
- export const Pill = styled.div `
3
- display: inline-block;
4
- padding: 5px 10px;
5
- margin: 0 0.5em 0.5em 0;
6
- border-radius: 2px;
7
- text-decoration: none;
8
- font-size: 13px;
9
- font-weight: 600;
10
- `;
11
- export const PillGreyLight = styled(Pill) `
12
- background: var(--grey800);
13
- color: var(--grey100);
14
-
15
- &:hover {
16
- color: white;
17
- background: var(--grey300);
18
- }
19
- `;
20
- export const PillAccentLight = styled(Pill) `
21
- background: var(--accent400);
22
- color: var(--grey100);
23
-
24
- &:hover {
25
- color: #fff;
26
- background: var(--accent300);
27
- }
28
- `;
29
- export const PillAccentLightOutlined = styled(Pill) `
30
- border: 1px solid var(--accent300);
31
- color: var(--accent200);
32
-
33
- &:hover {
34
- color: #fff;
35
- background: var(--accent300);
36
- }
37
- `;
3
+ export var Pill = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-block;\n padding: 5px 10px;\n margin: 0 0.5em 0.5em 0;\n border-radius: 2px;\n text-decoration: none;\n font-size: 13px;\n font-weight: 600;\n"], ["\n display: inline-block;\n padding: 5px 10px;\n margin: 0 0.5em 0.5em 0;\n border-radius: 2px;\n text-decoration: none;\n font-size: 13px;\n font-weight: 600;\n"])));
4
+ export var PillGreyLight = styled(Pill)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: var(--grey800);\n color: var(--grey100);\n\n &:hover {\n color: white;\n background: var(--grey300);\n }\n"], ["\n background: var(--grey800);\n color: var(--grey100);\n\n &:hover {\n color: white;\n background: var(--grey300);\n }\n"])));
5
+ export var PillAccentLight = styled(Pill)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background: var(--accent400);\n color: var(--grey100);\n\n &:hover {\n color: #fff;\n background: var(--accent300);\n }\n"], ["\n background: var(--accent400);\n color: var(--grey100);\n\n &:hover {\n color: #fff;\n background: var(--accent300);\n }\n"])));
6
+ export var PillAccentLightOutlined = styled(Pill)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border: 1px solid var(--accent300);\n color: var(--accent200);\n\n &:hover {\n color: #fff;\n background: var(--accent300);\n }\n"], ["\n border: 1px solid var(--accent300);\n color: var(--accent200);\n\n &:hover {\n color: #fff;\n background: var(--accent300);\n }\n"])));
7
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
@@ -1,36 +1,15 @@
1
+ import { __assign, __makeTemplateObject, __rest } from "tslib";
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import styled, { keyframes } from "styled-components";
3
- const animationRotation = keyframes `
4
- 0% {
5
- transform: rotate(0deg);
6
- }
7
- 100% {
8
- transform: rotate(360deg);
9
- }
10
- `;
11
- const animationCircle = keyframes `
12
- 0% {
13
- stroke-dasharray: 1px, 200px;
14
- stroke-dashoffset: 0;
15
- }
16
- 50% {
17
- stroke-dasharray: 100px, 200px;
18
- stroke-dashoffset: -15px;
19
- }
20
- 100% {
21
- stroke-dasharray: 100px, 200px;
22
- stroke-dashoffset: -125px;
23
- }
24
- `;
25
- const ProgressCircularSvg = styled.svg `
26
- animation: ${animationRotation} 1.5s linear infinite;
27
- `;
28
- const ProgressCircularCircle = styled.circle `
29
- animation: ${animationCircle} 1.5s linear infinite;
30
- `;
4
+ var animationRotation = keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n"], ["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n"])));
5
+ var animationCircle = keyframes(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n 0% {\n stroke-dasharray: 1px, 200px;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -15px;\n }\n 100% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -125px;\n }\n"], ["\n 0% {\n stroke-dasharray: 1px, 200px;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -15px;\n }\n 100% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -125px;\n }\n"])));
6
+ var ProgressCircularSvg = styled.svg(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n animation: ", " 1.5s linear infinite;\n"], ["\n animation: ", " 1.5s linear infinite;\n"])), animationRotation);
7
+ var ProgressCircularCircle = styled.circle(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n animation: ", " 1.5s linear infinite;\n"], ["\n animation: ", " 1.5s linear infinite;\n"])), animationCircle);
31
8
  /**
32
9
  * @see https://mui.com/components/progress/
33
10
  */
34
- export const ProgressCircular = ({ size = "1em", thickness = 1, color = "currentColor", ...props }) => {
35
- return (_jsx(ProgressCircularSvg, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 44 44", style: { width: size, height: size }, ...props, children: _jsx(ProgressCircularCircle, { cx: "22", cy: "22", r: "20", fill: "none", strokeWidth: thickness, style: { stroke: color } }) }));
11
+ export var ProgressCircular = function (_a) {
12
+ var _b = _a.size, size = _b === void 0 ? "1em" : _b, _c = _a.thickness, thickness = _c === void 0 ? 1 : _c, _d = _a.color, color = _d === void 0 ? "currentColor" : _d, props = __rest(_a, ["size", "thickness", "color"]);
13
+ return (_jsx(ProgressCircularSvg, __assign({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 44 44", style: { width: size, height: size } }, props, { children: _jsx(ProgressCircularCircle, { cx: "22", cy: "22", r: "20", fill: "none", strokeWidth: thickness, style: { stroke: color } }) })));
36
14
  };
15
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
@@ -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,49 +1,28 @@
1
+ import { __assign, __makeTemplateObject, __rest } from "tslib";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useCallback, useEffect, /* useId, */ useState } from "react";
3
4
  import styled from "styled-components";
4
5
  import { useId } from "../hooks/useId";
5
- export const RatingStarRoot = styled.svg `
6
- display: inline-block;
7
- vertical-align: middle;
8
- margin-right: 1px;
9
- `;
10
- export const RatingStar = ({ value, colorBg = "#FFD84C", colorStroke = "#947813", size, ...props }) => {
11
- const id = useId();
12
- 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" })] }));
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" })] })));
13
11
  };
14
- export const RatingDetails = styled.span `
15
- padding-left: 0.5em;
16
- font-size: 12px;
17
- color: var(--grey100);
18
-
19
- &:before {
20
- content: "(";
21
- }
22
- &:after {
23
- content: ")";
24
- }
25
- `;
26
- export const RatingCount = styled.span ``;
27
- export const RatingValue = styled.span `
28
- display: none;
29
- `;
30
- export const RatingRoot = styled.div `
31
- display: flex;
32
- align-items: center;
33
-
34
- &:hover ${RatingValue} {
35
- display: inline-block;
36
- }
37
- `;
38
- export const Rating = ({ value = 0, count, min = 0, max = 5, showDetails = true, colorBg, colorStroke, starSize = 16, }) => {
39
- const id = useId();
40
- const [currentValue /* , _setCurrentValue */] = useState(value);
41
- const [stars, setStars] = useState([]);
42
- const getStars = useCallback((activeCount) => {
43
- const stars = [];
44
- for (let currentStar = min + 1; currentStar < max + 1; currentStar++) {
45
- let starValue;
46
- 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);
47
26
  // we have a rating of 3.4, when we get to the 4th star:
48
27
  if (roundedActiveCount === currentStar - 1) {
49
28
  starValue = 1 - (currentStar - activeCount);
@@ -58,7 +37,7 @@ export const Rating = ({ value = 0, count, min = 0, max = 5, showDetails = true,
58
37
  }
59
38
  return stars;
60
39
  }, [min, max]);
61
- useEffect(() => {
40
+ useEffect(function () {
62
41
  setStars(getStars(currentValue));
63
42
  }, [currentValue, getStars]);
64
43
  // function updateStars(index) {
@@ -83,9 +62,10 @@ export const Rating = ({ value = 0, count, min = 0, max = 5, showDetails = true,
83
62
  // onChange(value);
84
63
  // }
85
64
  // }, [onChange];
86
- 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,
87
66
  // onMouseOver={handleMouseOver}
88
67
  // onMouseLeave={handleMouseLeave}
89
68
  // onClick={handleClick}
90
- 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) })] }))] }));
91
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;