@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,46 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.KoinePaginationNav = void 0;
4
- const tslib_1 = require("tslib");
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const styled_components_1 = tslib_1.__importDefault(require("styled-components"));
7
- const cg_1 = require("react-icons/cg");
8
- const utils_1 = require("@koine/utils");
9
- const Root = styled_components_1.default.nav `
10
- display: flex;
11
- align-items: center;
12
- justify-content: center;
13
- padding: 20px 0 40px;
14
- font-weight: 600;
15
-
16
- & a {
17
- text-decoration: none;
18
- }
19
- `;
20
- const item = `
21
- display: block;
22
- padding: 5px 10px;
23
- `;
24
- const ItemCurrent = styled_components_1.default.span `
25
- ${item}
26
- background: var(--accent400);
27
- border-radius: 2px;
28
- `;
29
- const ItemLink = styled_components_1.default.a `
30
- ${item}
31
-
32
- ${(props) => (props.prev ? "color: var(--grey100);" : "")}
33
- `;
34
- const DotsSeparator = styled_components_1.default.span `
35
- color: var(--grey100);
36
- `;
37
- const arrow = `display: flex; font-size: 20px;`;
38
- const ItemPrev = styled_components_1.default.a `
39
- ${arrow}
40
- `;
41
- const ItemNext = styled_components_1.default.a `
42
- ${arrow}
43
- `;
4
+ var tslib_1 = require("tslib");
5
+ var jsx_runtime_1 = require("react/jsx-runtime");
6
+ var styled_components_1 = tslib_1.__importDefault(require("styled-components"));
7
+ var cg_1 = require("react-icons/cg");
8
+ var utils_1 = require("@koine/utils");
9
+ var Root = styled_components_1.default.nav(templateObject_1 || (templateObject_1 = tslib_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"])));
10
+ var item = "\n display: block;\n padding: 5px 10px;\n";
11
+ var ItemCurrent = styled_components_1.default.span(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n ", "\n background: var(--accent400);\n border-radius: 2px;\n"], ["\n ", "\n background: var(--accent400);\n border-radius: 2px;\n"])), item);
12
+ var ItemLink = styled_components_1.default.a(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["\n ", "\n\n ", "\n"], ["\n ", "\n\n ", "\n"])), item, function (props) { return (props.prev ? "color: var(--grey100);" : ""); });
13
+ var DotsSeparator = styled_components_1.default.span(templateObject_4 || (templateObject_4 = tslib_1.__makeTemplateObject(["\n color: var(--grey100);\n"], ["\n color: var(--grey100);\n"])));
14
+ var arrow = "display: flex; font-size: 20px;";
15
+ var ItemPrev = styled_components_1.default.a(templateObject_5 || (templateObject_5 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), arrow);
16
+ var ItemNext = styled_components_1.default.a(templateObject_6 || (templateObject_6 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), arrow);
44
17
  /*
45
18
  * Possible outcomes:
46
19
  * [1] 2 3 ... 78 >
@@ -49,7 +22,8 @@ const ItemNext = styled_components_1.default.a `
49
22
  * < 1 ... 75 76 [77] 78 >
50
23
  * < 1 ... 76 77 [78]
51
24
  */
52
- const KoinePaginationNav = ({ total, perPage, currentPage, baseUrl, showOffset = 2, currentUrl = "/", Link = "a", }) => {
25
+ var KoinePaginationNav = function (_a) {
26
+ 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;
53
27
  total = (0, utils_1.ensureInt)(total);
54
28
  currentPage = (0, utils_1.ensureInt)(currentPage);
55
29
  perPage = (0, utils_1.ensureInt)(perPage);
@@ -60,15 +34,15 @@ const KoinePaginationNav = ({ total, perPage, currentPage, baseUrl, showOffset =
60
34
  if (total < perPage) {
61
35
  return null;
62
36
  }
63
- const firstPage = 1;
64
- const lastPage = Math.ceil(total / perPage);
65
- const prevPage = currentPage - 1 > firstPage ? currentPage - 1 : "";
66
- const nextPage = currentPage + 1 < lastPage ? currentPage + 1 : lastPage;
67
- const prevArrow = currentPage > firstPage;
68
- const nextArrow = currentPage < lastPage;
69
- const pages = [];
37
+ var firstPage = 1;
38
+ var lastPage = Math.ceil(total / perPage);
39
+ var prevPage = currentPage - 1 > firstPage ? currentPage - 1 : "";
40
+ var nextPage = currentPage + 1 < lastPage ? currentPage + 1 : lastPage;
41
+ var prevArrow = currentPage > firstPage;
42
+ var nextArrow = currentPage < lastPage;
43
+ var pages = [];
70
44
  // fill the pages before the current
71
- for (let i = currentPage - showOffset; i < currentPage; i++) {
45
+ for (var i = currentPage - showOffset; i < currentPage; i++) {
72
46
  if (i > 1) {
73
47
  pages.push(i);
74
48
  }
@@ -76,13 +50,16 @@ const KoinePaginationNav = ({ total, perPage, currentPage, baseUrl, showOffset =
76
50
  // add the current
77
51
  pages.push(currentPage);
78
52
  // fill the pages after the current
79
- for (let i = currentPage + 1; i < currentPage + 1 + showOffset; i++) {
53
+ for (var i = currentPage + 1; i < currentPage + 1 + showOffset; i++) {
80
54
  if (i < lastPage) {
81
55
  pages.push(i);
82
56
  }
83
57
  }
84
- const prevDots = pages[0] > firstPage + 1;
85
- const nextDots = pages[pages.length - 1] < lastPage - 1;
86
- return ((0, jsx_runtime_1.jsxs)(Root, { children: [prevArrow && ((0, jsx_runtime_1.jsx)(ItemPrev, { as: Link, href: `${baseUrl}/${prevPage}`, children: (0, jsx_runtime_1.jsx)(cg_1.CgArrowLeftR, {}) })), firstPage !== currentPage && ((0, jsx_runtime_1.jsx)(ItemLink, { as: Link, href: `${baseUrl}`, prev: true, children: firstPage })), prevDots && (0, jsx_runtime_1.jsx)(DotsSeparator, { children: "..." }), pages.map((page) => page === currentPage ? ((0, jsx_runtime_1.jsx)(ItemCurrent, { children: page }, page)) : ((0, jsx_runtime_1.jsx)(ItemLink, { as: Link, href: `${baseUrl}/${page}`, prev: page < currentPage, next: page > currentPage, children: page }, `pagination-${page}`))), nextDots && (0, jsx_runtime_1.jsx)(DotsSeparator, { children: "..." }), lastPage !== currentPage && ((0, jsx_runtime_1.jsx)(ItemLink, { as: Link, href: `${baseUrl}/${lastPage}`, next: true, children: lastPage })), nextArrow && ((0, jsx_runtime_1.jsx)(ItemNext, { as: Link, href: `${baseUrl}/${nextPage}`, children: (0, jsx_runtime_1.jsx)(cg_1.CgArrowRightR, {}) }))] }));
58
+ var prevDots = pages[0] > firstPage + 1;
59
+ var nextDots = pages[pages.length - 1] < lastPage - 1;
60
+ return ((0, jsx_runtime_1.jsxs)(Root, { children: [prevArrow && ((0, jsx_runtime_1.jsx)(ItemPrev, tslib_1.__assign({ as: Link, href: "".concat(baseUrl, "/").concat(prevPage) }, { children: (0, jsx_runtime_1.jsx)(cg_1.CgArrowLeftR, {}) }))), firstPage !== currentPage && ((0, jsx_runtime_1.jsx)(ItemLink, tslib_1.__assign({ as: Link, href: "".concat(baseUrl), prev: true }, { children: firstPage }))), prevDots && (0, jsx_runtime_1.jsx)(DotsSeparator, { children: "..." }), pages.map(function (page) {
61
+ return page === currentPage ? ((0, jsx_runtime_1.jsx)(ItemCurrent, { children: page }, page)) : ((0, jsx_runtime_1.jsx)(ItemLink, tslib_1.__assign({ as: Link, href: "".concat(baseUrl, "/").concat(page), prev: page < currentPage, next: page > currentPage }, { children: page }), "pagination-".concat(page)));
62
+ }), nextDots && (0, jsx_runtime_1.jsx)(DotsSeparator, { children: "..." }), lastPage !== currentPage && ((0, jsx_runtime_1.jsx)(ItemLink, tslib_1.__assign({ as: Link, href: "".concat(baseUrl, "/").concat(lastPage), next: true }, { children: lastPage }))), nextArrow && ((0, jsx_runtime_1.jsx)(ItemNext, tslib_1.__assign({ as: Link, href: "".concat(baseUrl, "/").concat(nextPage) }, { children: (0, jsx_runtime_1.jsx)(cg_1.CgArrowRightR, {}) })))] }));
87
63
  };
88
64
  exports.KoinePaginationNav = KoinePaginationNav;
65
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PaginationResults = void 0;
4
- const tslib_1 = require("tslib");
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const styled_components_1 = tslib_1.__importDefault(require("styled-components"));
7
- const framer_motion_1 = require("framer-motion");
8
- const Root = styled_components_1.default.div `
9
- // overflow: hidden;
10
- `;
11
- const Inner = (0, styled_components_1.default)(framer_motion_1.m.div) ``;
12
- const PaginationResults = ({ children }) => {
13
- return ((0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, { exitBeforeEnter: true, initial: true, children: (0, jsx_runtime_1.jsx)(Root, { children: (0, jsx_runtime_1.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 }) }) }));
4
+ var tslib_1 = require("tslib");
5
+ var jsx_runtime_1 = require("react/jsx-runtime");
6
+ var styled_components_1 = tslib_1.__importDefault(require("styled-components"));
7
+ var framer_motion_1 = require("framer-motion");
8
+ var Root = styled_components_1.default.div(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n // overflow: hidden;\n"], ["\n // overflow: hidden;\n"])));
9
+ var Inner = (0, styled_components_1.default)(framer_motion_1.m.div)(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject([""], [""])));
10
+ var PaginationResults = function (_a) {
11
+ var children = _a.children;
12
+ return ((0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, tslib_1.__assign({ exitBeforeEnter: true, initial: true }, { children: (0, jsx_runtime_1.jsx)(Root, { children: (0, jsx_runtime_1.jsx)(Inner, tslib_1.__assign({ initial: { opacity: 0, x: -100 }, animate: { opacity: 1, x: 0 }, exit: { opacity: 0, x: 100 }, transition: { type: "linear", staggerChildren: 0.3 } }, { children: children })) }) })));
14
13
  };
15
14
  exports.PaginationResults = PaginationResults;
15
+ var templateObject_1, templateObject_2;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
3
+ var tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./PaginationNav"), exports);
5
5
  tslib_1.__exportStar(require("./PaginationResults"), exports);
package/node/Pill/Pill.js CHANGED
@@ -1,41 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PillAccentLightOutlined = exports.PillAccentLight = exports.PillGreyLight = exports.Pill = void 0;
4
- const tslib_1 = require("tslib");
5
- const styled_components_1 = tslib_1.__importDefault(require("styled-components"));
6
- exports.Pill = styled_components_1.default.div `
7
- display: inline-block;
8
- padding: 5px 10px;
9
- margin: 0 0.5em 0.5em 0;
10
- border-radius: 2px;
11
- text-decoration: none;
12
- font-size: 13px;
13
- font-weight: 600;
14
- `;
15
- exports.PillGreyLight = (0, styled_components_1.default)(exports.Pill) `
16
- background: var(--grey800);
17
- color: var(--grey100);
18
-
19
- &:hover {
20
- color: white;
21
- background: var(--grey300);
22
- }
23
- `;
24
- exports.PillAccentLight = (0, styled_components_1.default)(exports.Pill) `
25
- background: var(--accent400);
26
- color: var(--grey100);
27
-
28
- &:hover {
29
- color: #fff;
30
- background: var(--accent300);
31
- }
32
- `;
33
- exports.PillAccentLightOutlined = (0, styled_components_1.default)(exports.Pill) `
34
- border: 1px solid var(--accent300);
35
- color: var(--accent200);
36
-
37
- &:hover {
38
- color: #fff;
39
- background: var(--accent300);
40
- }
41
- `;
4
+ var tslib_1 = require("tslib");
5
+ var styled_components_1 = tslib_1.__importDefault(require("styled-components"));
6
+ exports.Pill = styled_components_1.default.div(templateObject_1 || (templateObject_1 = tslib_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"])));
7
+ exports.PillGreyLight = (0, styled_components_1.default)(exports.Pill)(templateObject_2 || (templateObject_2 = tslib_1.__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"])));
8
+ exports.PillAccentLight = (0, styled_components_1.default)(exports.Pill)(templateObject_3 || (templateObject_3 = tslib_1.__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"])));
9
+ exports.PillAccentLightOutlined = (0, styled_components_1.default)(exports.Pill)(templateObject_4 || (templateObject_4 = tslib_1.__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"])));
10
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
3
+ var tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./Pill"), exports);
@@ -1,41 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ProgressCircular = void 0;
4
- const tslib_1 = require("tslib");
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const styled_components_1 = tslib_1.__importStar(require("styled-components"));
7
- const animationRotation = (0, styled_components_1.keyframes) `
8
- 0% {
9
- transform: rotate(0deg);
10
- }
11
- 100% {
12
- transform: rotate(360deg);
13
- }
14
- `;
15
- const animationCircle = (0, styled_components_1.keyframes) `
16
- 0% {
17
- stroke-dasharray: 1px, 200px;
18
- stroke-dashoffset: 0;
19
- }
20
- 50% {
21
- stroke-dasharray: 100px, 200px;
22
- stroke-dashoffset: -15px;
23
- }
24
- 100% {
25
- stroke-dasharray: 100px, 200px;
26
- stroke-dashoffset: -125px;
27
- }
28
- `;
29
- const ProgressCircularSvg = styled_components_1.default.svg `
30
- animation: ${animationRotation} 1.5s linear infinite;
31
- `;
32
- const ProgressCircularCircle = styled_components_1.default.circle `
33
- animation: ${animationCircle} 1.5s linear infinite;
34
- `;
4
+ var tslib_1 = require("tslib");
5
+ var jsx_runtime_1 = require("react/jsx-runtime");
6
+ var styled_components_1 = tslib_1.__importStar(require("styled-components"));
7
+ var animationRotation = (0, styled_components_1.keyframes)(templateObject_1 || (templateObject_1 = tslib_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"])));
8
+ var animationCircle = (0, styled_components_1.keyframes)(templateObject_2 || (templateObject_2 = tslib_1.__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"])));
9
+ var ProgressCircularSvg = styled_components_1.default.svg(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["\n animation: ", " 1.5s linear infinite;\n"], ["\n animation: ", " 1.5s linear infinite;\n"])), animationRotation);
10
+ var ProgressCircularCircle = styled_components_1.default.circle(templateObject_4 || (templateObject_4 = tslib_1.__makeTemplateObject(["\n animation: ", " 1.5s linear infinite;\n"], ["\n animation: ", " 1.5s linear infinite;\n"])), animationCircle);
35
11
  /**
36
12
  * @see https://mui.com/components/progress/
37
13
  */
38
- const ProgressCircular = ({ size = "1em", thickness = 1, color = "currentColor", ...props }) => {
39
- return ((0, jsx_runtime_1.jsx)(ProgressCircularSvg, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 44 44", style: { width: size, height: size }, ...props, children: (0, jsx_runtime_1.jsx)(ProgressCircularCircle, { cx: "22", cy: "22", r: "20", fill: "none", strokeWidth: thickness, style: { stroke: color } }) }));
14
+ var ProgressCircular = function (_a) {
15
+ 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 = tslib_1.__rest(_a, ["size", "thickness", "color"]);
16
+ return ((0, jsx_runtime_1.jsx)(ProgressCircularSvg, tslib_1.__assign({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 44 44", style: { width: size, height: size } }, props, { children: (0, jsx_runtime_1.jsx)(ProgressCircularCircle, { cx: "22", cy: "22", r: "20", fill: "none", strokeWidth: thickness, style: { stroke: color } }) })));
40
17
  };
41
18
  exports.ProgressCircular = ProgressCircular;
19
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
@@ -1,28 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ProgressLinear = void 0;
4
- const tslib_1 = require("tslib");
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const styled_components_1 = tslib_1.__importDefault(require("styled-components"));
7
- const framer_motion_1 = require("framer-motion");
8
- const ProgressLinearBg = styled_components_1.default.span `
9
- position: relative;
10
- overflow: hidden;
11
- display: block;
12
- height: 4px;
13
- `;
14
- const ProgressLinearFg = (0, styled_components_1.default)(framer_motion_1.m.span) `
15
- position: absolute;
16
- top: 0;
17
- bottom: 0;
18
- left: 0;
19
- width: 100%;
20
- `;
4
+ var tslib_1 = require("tslib");
5
+ var jsx_runtime_1 = require("react/jsx-runtime");
6
+ var styled_components_1 = tslib_1.__importDefault(require("styled-components"));
7
+ var framer_motion_1 = require("framer-motion");
8
+ var ProgressLinearBg = styled_components_1.default.span(templateObject_1 || (templateObject_1 = tslib_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"])));
9
+ var ProgressLinearFg = (0, styled_components_1.default)(framer_motion_1.m.span)(templateObject_2 || (templateObject_2 = tslib_1.__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"])));
21
10
  /**
22
11
  * @see https://mui.com/components/progress/#linear
23
12
  */
24
- const ProgressLinear = ({ done = false, height = "2px", bg = "transparent", fg = "currentColor", ...props }) => {
25
- return ((0, jsx_runtime_1.jsx)(ProgressLinearBg, { style: { height, background: bg }, ...props, children: (0, jsx_runtime_1.jsx)(ProgressLinearFg, { style: { height, background: fg }, initial: {
13
+ var ProgressLinear = function (_a) {
14
+ 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 = tslib_1.__rest(_a, ["done", "height", "bg", "fg"]);
15
+ return ((0, jsx_runtime_1.jsx)(ProgressLinearBg, tslib_1.__assign({ style: { height: height, background: bg } }, props, { children: (0, jsx_runtime_1.jsx)(ProgressLinearFg, { style: { height: height, background: fg }, initial: {
26
16
  x: "-100%",
27
17
  }, animate: {
28
18
  x: done ? "-100%" : "0%",
@@ -32,6 +22,7 @@ const ProgressLinear = ({ done = false, height = "2px", bg = "transparent", fg =
32
22
  repeat: Infinity,
33
23
  repeatType: "reverse",
34
24
  duration: 2,
35
- } }) }));
25
+ } }) })));
36
26
  };
37
27
  exports.ProgressLinear = ProgressLinear;
28
+ var templateObject_1, templateObject_2;
@@ -1,45 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ProgressOverlay = void 0;
4
- const tslib_1 = require("tslib");
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const react_1 = require("react");
7
- const styled_components_1 = tslib_1.__importDefault(require("styled-components"));
8
- const framer_motion_1 = require("framer-motion");
9
- const ProgressCircular_1 = require("./ProgressCircular");
10
- const ProgressLinear_1 = require("./ProgressLinear");
11
- const Header_1 = require("../Header");
12
- const ProgressOverlayWrap = (0, styled_components_1.default)(framer_motion_1.m.div) `
13
- z-index: 10000;
14
- position: fixed;
15
- top: 0;
16
- left: 0;
17
- right: 0;
18
- bottom: 0;
19
- pointer-events: none;
20
- cursor: wait;
21
- `;
22
- const ProgressOverlayCenterer = styled_components_1.default.div `
23
- position: absolute;
24
- top: 0;
25
- left: 0;
26
- right: 0;
27
- bottom: 0;
28
- display: flex;
29
- align-items: center;
30
- justify-content: center;
31
- background: var(--progress-overlay-bg);
32
- `;
33
- const ProgressOverlay = ({ running }) => {
34
- const [, , headerHeight] = (0, Header_1.useHeader)();
4
+ var tslib_1 = require("tslib");
5
+ var jsx_runtime_1 = require("react/jsx-runtime");
6
+ var react_1 = require("react");
7
+ var styled_components_1 = tslib_1.__importDefault(require("styled-components"));
8
+ var framer_motion_1 = require("framer-motion");
9
+ var ProgressCircular_1 = require("./ProgressCircular");
10
+ var ProgressLinear_1 = require("./ProgressLinear");
11
+ var Header_1 = require("../Header");
12
+ var ProgressOverlayWrap = (0, styled_components_1.default)(framer_motion_1.m.div)(templateObject_1 || (templateObject_1 = tslib_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"])));
13
+ var ProgressOverlayCenterer = styled_components_1.default.div(templateObject_2 || (templateObject_2 = tslib_1.__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"])));
14
+ var ProgressOverlay = function (_a) {
15
+ var running = _a.running;
16
+ var _b = (0, Header_1.useHeader)(), headerHeight = _b[2];
35
17
  // const [progress, setProgress] = useState(0);
36
- (0, react_1.useEffect)(() => {
18
+ (0, react_1.useEffect)(function () {
37
19
  document.body.style.cursor = running ? "wait" : "";
38
20
  }, [running]);
39
- return ((0, jsx_runtime_1.jsxs)(ProgressOverlayWrap, { animate: {
21
+ return ((0, jsx_runtime_1.jsxs)(ProgressOverlayWrap, tslib_1.__assign({ animate: {
40
22
  opacity: running ? 1 : 0,
41
- }, initial: { opacity: 0 }, transition: { type: "easeInOut" }, children: [(0, jsx_runtime_1.jsx)(ProgressLinear_1.ProgressLinear, { bg: "var(--accent400)", fg: "var(--accent300)", done: !running }), (0, jsx_runtime_1.jsx)(ProgressOverlayCenterer, { style: {
23
+ }, initial: { opacity: 0 }, transition: { type: "easeInOut" } }, { children: [(0, jsx_runtime_1.jsx)(ProgressLinear_1.ProgressLinear, { bg: "var(--accent400)", fg: "var(--accent300)", done: !running }), (0, jsx_runtime_1.jsx)(ProgressOverlayCenterer, tslib_1.__assign({ style: {
42
24
  top: headerHeight + "px",
43
- }, children: (0, jsx_runtime_1.jsx)(ProgressCircular_1.ProgressCircular, { size: "50px", color: "var(--accent300)" }) })] }));
25
+ } }, { children: (0, jsx_runtime_1.jsx)(ProgressCircular_1.ProgressCircular, { size: "50px", color: "var(--accent300)" }) }))] })));
44
26
  };
45
27
  exports.ProgressOverlay = ProgressOverlay;
28
+ var templateObject_1, templateObject_2;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
3
+ var tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./ProgressCircular"), exports);
5
5
  tslib_1.__exportStar(require("./ProgressLinear"), exports);
6
6
  tslib_1.__exportStar(require("./ProgressOverlay"), exports);
@@ -1,53 +1,32 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Rating = exports.RatingRoot = exports.RatingValue = exports.RatingCount = exports.RatingDetails = exports.RatingStar = exports.RatingStarRoot = void 0;
4
- const tslib_1 = require("tslib");
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const react_1 = require("react");
7
- const styled_components_1 = tslib_1.__importDefault(require("styled-components"));
8
- exports.RatingStarRoot = styled_components_1.default.svg `
9
- display: inline-block;
10
- vertical-align: middle;
11
- margin-right: 1px;
12
- `;
13
- const RatingStar = ({ value, colorBg = "#FFD84C", colorStroke = "#947813", size, ...props }) => {
14
- const id = (0, react_1.useId)();
15
- return ((0, jsx_runtime_1.jsxs)(exports.RatingStarRoot, { viewBox: "0 0 16 16", "data-value": value, width: size + "px", height: size + "px", ...props, children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsxs)("linearGradient", { id: id, x1: "0", y1: "0", x2: "1", y2: "0", children: [(0, jsx_runtime_1.jsx)("stop", { offset: "0", stopColor: colorBg }), (0, jsx_runtime_1.jsx)("stop", { offset: value, stopColor: colorBg }), (0, jsx_runtime_1.jsx)("stop", { offset: value, stopColor: "rgba(255, 255, 255, 0)" })] }) }), (0, jsx_runtime_1.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" })] }));
4
+ var tslib_1 = require("tslib");
5
+ var jsx_runtime_1 = require("react/jsx-runtime");
6
+ var react_1 = require("react");
7
+ var styled_components_1 = tslib_1.__importDefault(require("styled-components"));
8
+ var useId_1 = require("../hooks/useId");
9
+ exports.RatingStarRoot = styled_components_1.default.svg(templateObject_1 || (templateObject_1 = tslib_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"])));
10
+ var RatingStar = function (_a) {
11
+ 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 = tslib_1.__rest(_a, ["value", "colorBg", "colorStroke", "size"]);
12
+ var id = (0, useId_1.useId)();
13
+ return ((0, jsx_runtime_1.jsxs)(exports.RatingStarRoot, tslib_1.__assign({ viewBox: "0 0 16 16", "data-value": value, width: size + "px", height: size + "px" }, props, { children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsxs)("linearGradient", tslib_1.__assign({ id: id, x1: "0", y1: "0", x2: "1", y2: "0" }, { children: [(0, jsx_runtime_1.jsx)("stop", { offset: "0", stopColor: colorBg }), (0, jsx_runtime_1.jsx)("stop", { offset: value, stopColor: colorBg }), (0, jsx_runtime_1.jsx)("stop", { offset: value, stopColor: "rgba(255, 255, 255, 0)" })] })) }), (0, jsx_runtime_1.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" })] })));
16
14
  };
17
15
  exports.RatingStar = RatingStar;
18
- exports.RatingDetails = styled_components_1.default.span `
19
- padding-left: 0.5em;
20
- font-size: 12px;
21
- color: var(--grey100);
22
-
23
- &:before {
24
- content: "(";
25
- }
26
- &:after {
27
- content: ")";
28
- }
29
- `;
30
- exports.RatingCount = styled_components_1.default.span ``;
31
- exports.RatingValue = styled_components_1.default.span `
32
- display: none;
33
- `;
34
- exports.RatingRoot = styled_components_1.default.div `
35
- display: flex;
36
- align-items: center;
37
-
38
- &:hover ${exports.RatingValue} {
39
- display: inline-block;
40
- }
41
- `;
42
- const Rating = ({ value = 0, count, min = 0, max = 5, showDetails = true, colorBg, colorStroke, starSize = 16, }) => {
43
- const id = (0, react_1.useId)();
44
- const [currentValue /* , _setCurrentValue */] = (0, react_1.useState)(value);
45
- const [stars, setStars] = (0, react_1.useState)([]);
46
- const getStars = (0, react_1.useCallback)((activeCount) => {
47
- const stars = [];
48
- for (let currentStar = min + 1; currentStar < max + 1; currentStar++) {
49
- let starValue;
50
- const roundedActiveCount = Math.floor(activeCount);
16
+ exports.RatingDetails = styled_components_1.default.span(templateObject_2 || (templateObject_2 = tslib_1.__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"])));
17
+ exports.RatingCount = styled_components_1.default.span(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject([""], [""])));
18
+ exports.RatingValue = styled_components_1.default.span(templateObject_4 || (templateObject_4 = tslib_1.__makeTemplateObject(["\n display: none;\n"], ["\n display: none;\n"])));
19
+ exports.RatingRoot = styled_components_1.default.div(templateObject_5 || (templateObject_5 = tslib_1.__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"])), exports.RatingValue);
20
+ var Rating = function (_a) {
21
+ 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;
22
+ var id = (0, useId_1.useId)();
23
+ var currentValue = (0, react_1.useState)(value)[0] /* , _setCurrentValue */;
24
+ var _g = (0, react_1.useState)([]), stars = _g[0], setStars = _g[1];
25
+ var getStars = (0, react_1.useCallback)(function (activeCount) {
26
+ var stars = [];
27
+ for (var currentStar = min + 1; currentStar < max + 1; currentStar++) {
28
+ var starValue = void 0;
29
+ var roundedActiveCount = Math.floor(activeCount);
51
30
  // we have a rating of 3.4, when we get to the 4th star:
52
31
  if (roundedActiveCount === currentStar - 1) {
53
32
  starValue = 1 - (currentStar - activeCount);
@@ -62,7 +41,7 @@ const Rating = ({ value = 0, count, min = 0, max = 5, showDetails = true, colorB
62
41
  }
63
42
  return stars;
64
43
  }, [min, max]);
65
- (0, react_1.useEffect)(() => {
44
+ (0, react_1.useEffect)(function () {
66
45
  setStars(getStars(currentValue));
67
46
  }, [currentValue, getStars]);
68
47
  // function updateStars(index) {
@@ -87,10 +66,11 @@ const Rating = ({ value = 0, count, min = 0, max = 5, showDetails = true, colorB
87
66
  // onChange(value);
88
67
  // }
89
68
  // }, [onChange];
90
- return ((0, jsx_runtime_1.jsxs)(exports.RatingRoot, { children: [stars.map((star, idx) => ((0, jsx_runtime_1.jsx)(exports.RatingStar, { idx: idx, dataIdx: idx, size: starSize,
69
+ return ((0, jsx_runtime_1.jsxs)(exports.RatingRoot, { children: [stars.map(function (star, idx) { return ((0, jsx_runtime_1.jsx)(exports.RatingStar, { idx: idx, dataIdx: idx, size: starSize,
91
70
  // onMouseOver={handleMouseOver}
92
71
  // onMouseLeave={handleMouseLeave}
93
72
  // onClick={handleClick}
94
- value: star.value, colorBg: colorBg, colorStroke: colorStroke }, id + idx))), " ", showDetails && count && ((0, jsx_runtime_1.jsxs)(exports.RatingDetails, { children: [(0, jsx_runtime_1.jsx)(exports.RatingCount, { children: count }), (0, jsx_runtime_1.jsx)(exports.RatingValue, { children: ` - ${value}` })] }))] }));
73
+ value: star.value, colorBg: colorBg, colorStroke: colorStroke }, id + idx)); }), " ", showDetails && count && ((0, jsx_runtime_1.jsxs)(exports.RatingDetails, { children: [(0, jsx_runtime_1.jsx)(exports.RatingCount, { children: count }), (0, jsx_runtime_1.jsx)(exports.RatingValue, { children: " - ".concat(value) })] }))] }));
95
74
  };
96
75
  exports.Rating = Rating;
76
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deriveRating = exports.convertRange = exports.getRatingValue = exports.getRatingWord = void 0;
4
- const tslib_1 = require("tslib");
4
+ var tslib_1 = require("tslib");
5
5
  tslib_1.__exportStar(require("./Rating"), exports);
6
- const RATING_WORDS = {
6
+ var RATING_WORDS = {
7
7
  0: "Worst",
8
8
  1: "Bad",
9
9
  2: "Mediocre",
@@ -12,9 +12,10 @@ const RATING_WORDS = {
12
12
  4.5: "Excellent",
13
13
  5: "Best",
14
14
  };
15
- const getRatingWord = (value, precision = 0.5) => {
16
- let buffer = 0;
17
- let word;
15
+ var getRatingWord = function (value, precision) {
16
+ if (precision === void 0) { precision = 0.5; }
17
+ var buffer = 0;
18
+ var word;
18
19
  while (buffer < value) {
19
20
  // @ts-expect-error can't remember
20
21
  word = RATING_WORDS[buffer];
@@ -23,8 +24,8 @@ const getRatingWord = (value, precision = 0.5) => {
23
24
  return word;
24
25
  };
25
26
  exports.getRatingWord = getRatingWord;
26
- const getRatingValue = (value) => {
27
- const converted = convertRange(value, [0, 5], [0, 10]);
27
+ var getRatingValue = function (value) {
28
+ var converted = convertRange(value, [0, 5], [0, 10]);
28
29
  if (converted % 1 === 0) {
29
30
  return converted;
30
31
  }
@@ -38,16 +39,19 @@ function convertRange(value, r1, r2) {
38
39
  return ((value - r1[0]) * (r2[1] - r2[0])) / (r1[1] - r1[0]) + r2[0];
39
40
  }
40
41
  exports.convertRange = convertRange;
41
- const deriveRating = (title, date, minValue = 3.8, maxValue = 5, minQuantity = 9) => {
42
- const entityTime = date.getTime();
43
- const nowTime = new Date().getTime();
44
- const length = title.length;
45
- const value = Number(convertRange(length, [0, 90], [minValue, maxValue]).toFixed(2));
46
- const timeDifference = convertRange(nowTime - entityTime, [0, 10000000000000], [minQuantity, 999999]);
47
- const count = Math.round(timeDifference / length);
42
+ var deriveRating = function (title, date, minValue, maxValue, minQuantity) {
43
+ if (minValue === void 0) { minValue = 3.8; }
44
+ if (maxValue === void 0) { maxValue = 5; }
45
+ if (minQuantity === void 0) { minQuantity = 9; }
46
+ var entityTime = date.getTime();
47
+ var nowTime = new Date().getTime();
48
+ var length = title.length;
49
+ var value = Number(convertRange(length, [0, 90], [minValue, maxValue]).toFixed(2));
50
+ var timeDifference = convertRange(nowTime - entityTime, [0, 10000000000000], [minQuantity, 999999]);
51
+ var count = Math.round(timeDifference / length);
48
52
  return {
49
- value,
50
- count,
53
+ value: value,
54
+ count: count,
51
55
  };
52
56
  };
53
57
  exports.deriveRating = deriveRating;
@@ -1,22 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SelectArrow = exports.SelectArrowStyled = void 0;
4
- const tslib_1 = require("tslib");
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const react_1 = require("react");
7
- const styled_components_1 = tslib_1.__importDefault(require("styled-components"));
8
- const framer_motion_1 = require("framer-motion");
9
- const bs_1 = require("react-icons/bs");
10
- exports.SelectArrowStyled = (0, styled_components_1.default)(framer_motion_1.m.span) `
11
- display: inline-flex;
12
- align-items: center;
13
- justify-content: center;
14
- width: 2em;
15
-
16
- &:not([disabled]) {
17
- cursor: pointer;
18
- }
19
- `;
20
- exports.SelectArrow = (0, react_1.forwardRef)(function SelectArrow({ isOpen, ...props }, ref) {
21
- return ((0, jsx_runtime_1.jsx)(exports.SelectArrowStyled, { animate: { rotate: isOpen ? 180 : 0 }, ref: ref, ...props, children: (0, jsx_runtime_1.jsx)(bs_1.BsBoxArrowInDown, {}) }));
4
+ var tslib_1 = require("tslib");
5
+ var jsx_runtime_1 = require("react/jsx-runtime");
6
+ var react_1 = require("react");
7
+ var styled_components_1 = tslib_1.__importDefault(require("styled-components"));
8
+ var framer_motion_1 = require("framer-motion");
9
+ var bs_1 = require("react-icons/bs");
10
+ exports.SelectArrowStyled = (0, styled_components_1.default)(framer_motion_1.m.span)(templateObject_1 || (templateObject_1 = tslib_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"])));
11
+ exports.SelectArrow = (0, react_1.forwardRef)(function SelectArrow(_a, ref) {
12
+ var isOpen = _a.isOpen, props = tslib_1.__rest(_a, ["isOpen"]);
13
+ return ((0, jsx_runtime_1.jsx)(exports.SelectArrowStyled, tslib_1.__assign({ animate: { rotate: isOpen ? 180 : 0 }, ref: ref }, props, { children: (0, jsx_runtime_1.jsx)(bs_1.BsBoxArrowInDown, {}) })));
22
14
  });
15
+ var templateObject_1;