@koine/react 1.0.10 → 1.0.13

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 (445) hide show
  1. package/Alert/Alert.d.ts +5 -0
  2. package/Alert/Alert.js +10 -0
  3. package/Alert/index.d.ts +1 -0
  4. package/Alert/index.js +1 -0
  5. package/Alert/package.json +6 -0
  6. package/Animations/Reveal.d.ts +4 -0
  7. package/Animations/Reveal.js +17 -0
  8. package/Animations/Underline.d.ts +1 -0
  9. package/Animations/Underline.js +5 -0
  10. package/Animations/index.d.ts +3 -0
  11. package/Animations/index.js +3 -0
  12. package/Animations/package.json +6 -0
  13. package/Animations/useReveal.d.ts +33 -0
  14. package/Animations/useReveal.js +71 -0
  15. package/Autocomplete/AutocompleteDownshift.d.ts +1 -0
  16. package/Autocomplete/AutocompleteDownshift.js +158 -0
  17. package/Autocomplete/AutocompleteDownshiftMultiselect.d.ts +1 -0
  18. package/Autocomplete/AutocompleteDownshiftMultiselect.js +353 -0
  19. package/Autocomplete/AutocompleteMui.d.ts +47 -0
  20. package/Autocomplete/AutocompleteMui.js +182 -0
  21. package/Autocomplete/AutocompleteReach.d.ts +1 -0
  22. package/Autocomplete/AutocompleteReach.js +112 -0
  23. package/Autocomplete/components.d.ts +21 -0
  24. package/Autocomplete/components.js +34 -0
  25. package/Autocomplete/helpers.d.ts +3 -0
  26. package/Autocomplete/helpers.js +28 -0
  27. package/Autocomplete/index.d.ts +2 -0
  28. package/Autocomplete/index.js +3 -0
  29. package/Autocomplete/package.json +6 -0
  30. package/Bg/BgColor.d.ts +36 -0
  31. package/Bg/BgColor.js +21 -0
  32. package/Bg/BgPhoto.d.ts +13 -0
  33. package/Bg/BgPhoto.js +16 -0
  34. package/Bg/BgSvg.d.ts +7 -0
  35. package/Bg/BgSvg.js +12 -0
  36. package/Bg/index.d.ts +3 -0
  37. package/Bg/index.js +3 -0
  38. package/Bg/package.json +6 -0
  39. package/Breadcrumbs/Breadcrumbs.d.ts +13 -0
  40. package/Breadcrumbs/Breadcrumbs.js +27 -0
  41. package/Breadcrumbs/index.d.ts +1 -0
  42. package/Breadcrumbs/index.js +1 -0
  43. package/Breadcrumbs/package.json +6 -0
  44. package/Buttons/Button.d.ts +18 -0
  45. package/Buttons/Button.js +14 -0
  46. package/Buttons/ButtonComposite.d.ts +23 -0
  47. package/Buttons/ButtonComposite.js +28 -0
  48. package/Buttons/ButtonFab.d.ts +7 -0
  49. package/Buttons/ButtonFab.js +6 -0
  50. package/Buttons/ButtonLink.d.ts +8 -0
  51. package/Buttons/ButtonLink.js +11 -0
  52. package/Buttons/IconButton.d.ts +11 -0
  53. package/Buttons/IconButton.js +7 -0
  54. package/Buttons/index.d.ts +5 -0
  55. package/Buttons/index.js +5 -0
  56. package/Buttons/package.json +6 -0
  57. package/Calendar/CalendarDaygridCell.d.ts +36 -0
  58. package/Calendar/CalendarDaygridCell.js +57 -0
  59. package/Calendar/CalendarDaygridNav.d.ts +27 -0
  60. package/Calendar/CalendarDaygridNav.js +23 -0
  61. package/Calendar/CalendarDaygridTable.d.ts +25 -0
  62. package/Calendar/CalendarDaygridTable.js +57 -0
  63. package/Calendar/CalendarLegend.d.ts +19 -0
  64. package/Calendar/CalendarLegend.js +16 -0
  65. package/Calendar/calendar-api-google.d.ts +18 -0
  66. package/Calendar/calendar-api-google.js +127 -0
  67. package/Calendar/index.d.ts +6 -0
  68. package/Calendar/index.js +6 -0
  69. package/Calendar/package.json +6 -0
  70. package/Calendar/types.d.ts +81 -0
  71. package/Calendar/types.js +1 -0
  72. package/Calendar/useCalendar.d.ts +49 -0
  73. package/Calendar/useCalendar.js +183 -0
  74. package/Calendar/utils.d.ts +11 -0
  75. package/Calendar/utils.js +202 -0
  76. package/Carousel/Carousel.d.ts +1 -0
  77. package/Carousel/Carousel.js +378 -0
  78. package/Carousel/CarouselCss.d.ts +47 -0
  79. package/Carousel/CarouselCss.js +23 -0
  80. package/Carousel/index.d.ts +1 -0
  81. package/Carousel/index.js +1 -0
  82. package/Carousel/package.json +6 -0
  83. package/Collapsable/Collapsable.d.ts +1 -0
  84. package/Collapsable/Collapsable.js +1 -0
  85. package/Collapsable/CollapsableReach.d.ts +6 -0
  86. package/Collapsable/CollapsableReach.js +253 -0
  87. package/Collapsable/index.d.ts +1 -0
  88. package/Collapsable/index.js +2 -0
  89. package/Collapsable/package.json +6 -0
  90. package/Debug/Debug.d.ts +4 -0
  91. package/Debug/Debug.js +9 -0
  92. package/Debug/index.d.ts +1 -0
  93. package/Debug/index.js +1 -0
  94. package/Debug/package.json +6 -0
  95. package/Details/Details.d.ts +114 -0
  96. package/Details/Details.js +65 -0
  97. package/Details/index.d.ts +1 -0
  98. package/Details/index.js +1 -0
  99. package/Details/package.json +6 -0
  100. package/Dialog/DialogMui.d.ts +139 -0
  101. package/Dialog/DialogMui.js +80 -0
  102. package/Dialog/css/bare.d.ts +145 -0
  103. package/Dialog/css/bare.js +21 -0
  104. package/Dialog/index.d.ts +2 -0
  105. package/Dialog/index.js +1 -0
  106. package/Dialog/m/bare.d.ts +56 -0
  107. package/Dialog/m/bare.js +52 -0
  108. package/Dialog/m/basic.d.ts +4 -0
  109. package/Dialog/m/basic.js +31 -0
  110. package/Dialog/m/index.d.ts +2 -0
  111. package/Dialog/m/index.js +4 -0
  112. package/Dialog/m/package.json +6 -0
  113. package/Dialog/package.json +6 -0
  114. package/Dialog/sc/bare.d.ts +105 -0
  115. package/Dialog/sc/bare.js +43 -0
  116. package/Dialog/sc/framer.d.ts +80 -0
  117. package/Dialog/sc/framer.js +16 -0
  118. package/Dialog/sc/framerMaterial.d.ts +79 -0
  119. package/Dialog/sc/framerMaterial.js +16 -0
  120. package/Dialog/sc/material.d.ts +94 -0
  121. package/Dialog/sc/material.js +21 -0
  122. package/Dialog/tw/bare.d.ts +196 -0
  123. package/Dialog/tw/bare.js +42 -0
  124. package/Dialog/tw/elegant.d.ts +244 -0
  125. package/Dialog/tw/elegant.js +20 -0
  126. package/Dialog/tw/framer.d.ts +112 -0
  127. package/Dialog/tw/framer.js +16 -0
  128. package/Dialog/tw/framerMaterial.d.ts +167 -0
  129. package/Dialog/tw/framerMaterial.js +16 -0
  130. package/Dialog/tw/material.d.ts +244 -0
  131. package/Dialog/tw/material.js +20 -0
  132. package/Editor/Editor--tiptap.d.ts +9 -0
  133. package/Editor/Editor--tiptap.js +26 -0
  134. package/Editor/components.d.ts +7 -0
  135. package/Editor/components.js +10 -0
  136. package/Editor/index.d.ts +1 -0
  137. package/Editor/index.js +1 -0
  138. package/Editor/package.json +6 -0
  139. package/Favicon/FaviconTags.d.ts +18 -0
  140. package/Favicon/FaviconTags.js +15 -0
  141. package/Favicon/index.d.ts +1 -0
  142. package/Favicon/index.js +1 -0
  143. package/Favicon/package.json +6 -0
  144. package/Form/Form.d.ts +111 -0
  145. package/Form/Form.js +61 -0
  146. package/Form/index.d.ts +1 -0
  147. package/Form/index.js +1 -0
  148. package/Form/package.json +6 -0
  149. package/Form/sc/bare.d.ts +33 -0
  150. package/Form/sc/bare.js +20 -0
  151. package/Forms/Checkbox/Checkbox.d.ts +11 -0
  152. package/Forms/Checkbox/Checkbox.js +18 -0
  153. package/Forms/Checkbox/index.d.ts +1 -0
  154. package/Forms/Checkbox/index.js +1 -0
  155. package/Forms/Checkbox/package.json +6 -0
  156. package/Forms/Feedback/Feedback.d.ts +5 -0
  157. package/Forms/Feedback/Feedback.js +9 -0
  158. package/Forms/Feedback/index.d.ts +1 -0
  159. package/Forms/Feedback/index.js +1 -0
  160. package/Forms/Feedback/package.json +6 -0
  161. package/Forms/Field/Field.d.ts +15 -0
  162. package/Forms/Field/Field.js +48 -0
  163. package/Forms/Field/FieldControl.d.ts +26 -0
  164. package/Forms/Field/FieldControl.js +47 -0
  165. package/Forms/Field/FieldHint.d.ts +1 -0
  166. package/Forms/Field/FieldHint.js +4 -0
  167. package/Forms/Field/index.d.ts +2 -0
  168. package/Forms/Field/index.js +2 -0
  169. package/Forms/Field/package.json +6 -0
  170. package/Forms/Input/Input.d.ts +9 -0
  171. package/Forms/Input/Input.js +17 -0
  172. package/Forms/Input/index.d.ts +1 -0
  173. package/Forms/Input/index.js +1 -0
  174. package/Forms/Input/package.json +6 -0
  175. package/Forms/InputGroup/InputGroup.d.ts +13 -0
  176. package/Forms/InputGroup/InputGroup.js +15 -0
  177. package/Forms/InputGroup/index.d.ts +1 -0
  178. package/Forms/InputGroup/index.js +1 -0
  179. package/Forms/InputGroup/package.json +6 -0
  180. package/Forms/Label/Label.d.ts +3 -0
  181. package/Forms/Label/Label.js +6 -0
  182. package/Forms/Label/index.d.ts +1 -0
  183. package/Forms/Label/index.js +1 -0
  184. package/Forms/Label/package.json +6 -0
  185. package/Forms/Password/Password.d.ts +5 -0
  186. package/Forms/Password/Password.js +17 -0
  187. package/Forms/Password/index.d.ts +1 -0
  188. package/Forms/Password/index.js +1 -0
  189. package/Forms/Password/package.json +6 -0
  190. package/Forms/Radio/Radio.d.ts +12 -0
  191. package/Forms/Radio/Radio.js +25 -0
  192. package/Forms/Radio/index.d.ts +1 -0
  193. package/Forms/Radio/index.js +1 -0
  194. package/Forms/Radio/package.json +6 -0
  195. package/Forms/Switch/Switch.d.ts +9 -0
  196. package/Forms/Switch/Switch.js +20 -0
  197. package/Forms/Switch/index.d.ts +1 -0
  198. package/Forms/Switch/index.js +1 -0
  199. package/Forms/Switch/package.json +6 -0
  200. package/Forms/Textarea/Textarea.d.ts +5 -0
  201. package/Forms/Textarea/Textarea.js +12 -0
  202. package/Forms/Textarea/TextareaRich.d.ts +6 -0
  203. package/Forms/Textarea/TextareaRich.js +28 -0
  204. package/Forms/Textarea/index.d.ts +2 -0
  205. package/Forms/Textarea/index.js +2 -0
  206. package/Forms/Textarea/package.json +6 -0
  207. package/Forms/Toggle/Toggle.d.ts +19 -0
  208. package/Forms/Toggle/Toggle.js +32 -0
  209. package/Forms/Toggle/index.d.ts +1 -0
  210. package/Forms/Toggle/index.js +1 -0
  211. package/Forms/Toggle/package.json +6 -0
  212. package/Forms/Toggle/useToggle.d.ts +46 -0
  213. package/Forms/Toggle/useToggle.js +145 -0
  214. package/Forms/antispam.d.ts +24 -0
  215. package/Forms/antispam.js +56 -0
  216. package/Forms/helpers.d.ts +26 -0
  217. package/Forms/helpers.js +45 -0
  218. package/Forms/index.d.ts +15 -0
  219. package/Forms/index.js +16 -0
  220. package/Forms/package.json +6 -0
  221. package/Forms/styles.d.ts +19 -0
  222. package/Forms/styles.js +29 -0
  223. package/Gauge/Gauge.d.ts +5 -0
  224. package/Gauge/Gauge.js +102 -0
  225. package/Grid/Grid.d.ts +64 -0
  226. package/Grid/Grid.js +53 -0
  227. package/Grid/index.d.ts +1 -0
  228. package/Grid/index.js +1 -0
  229. package/Grid/package.json +6 -0
  230. package/Hamburger/Hamburger.d.ts +6 -0
  231. package/Hamburger/Hamburger.js +52 -0
  232. package/Hamburger/index.d.ts +1 -0
  233. package/Hamburger/index.js +1 -0
  234. package/Hamburger/package.json +6 -0
  235. package/Header/index.d.ts +1 -0
  236. package/Header/index.js +1 -0
  237. package/Header/package.json +6 -0
  238. package/Header/useHeader.d.ts +24 -0
  239. package/Header/useHeader.js +30 -0
  240. package/Hidden/Hidden.d.ts +6 -0
  241. package/Hidden/Hidden.js +10 -0
  242. package/Hidden/index.d.ts +1 -0
  243. package/Hidden/index.js +1 -0
  244. package/Hidden/package.json +6 -0
  245. package/Img/index.d.ts +1 -0
  246. package/Img/index.js +1 -0
  247. package/Img/package.json +6 -0
  248. package/Img/sc/bare.d.ts +2 -0
  249. package/Img/sc/bare.js +39 -0
  250. package/Img/types.d.ts +9 -0
  251. package/Img/types.js +1 -0
  252. package/Link/Link.d.ts +5 -0
  253. package/Link/Link.js +4 -0
  254. package/Link/LinkBlank.d.ts +8 -0
  255. package/Link/LinkBlank.js +17 -0
  256. package/Link/index.d.ts +2 -0
  257. package/Link/index.js +2 -0
  258. package/Link/package.json +6 -0
  259. package/Menu/Menu.d.ts +1 -0
  260. package/Menu/Menu.js +4 -0
  261. package/Menu/index.d.ts +1 -0
  262. package/Menu/index.js +1 -0
  263. package/Menu/package.json +6 -0
  264. package/MenuItem/MenuItem.d.ts +4 -0
  265. package/MenuItem/MenuItem.js +4 -0
  266. package/MenuItem/index.d.ts +1 -0
  267. package/MenuItem/index.js +1 -0
  268. package/MenuItem/package.json +6 -0
  269. package/Meta/Meta.d.ts +14 -0
  270. package/Meta/Meta.js +5 -0
  271. package/Meta/index.d.ts +1 -0
  272. package/Meta/index.js +1 -0
  273. package/Meta/package.json +6 -0
  274. package/NoJs/NoJs.d.ts +2 -0
  275. package/NoJs/NoJs.js +6 -0
  276. package/NoJs/index.d.ts +1 -0
  277. package/NoJs/index.js +1 -0
  278. package/NoJs/package.json +6 -0
  279. package/Pagination/PaginationNav.d.ts +22 -0
  280. package/Pagination/PaginationNav.js +61 -0
  281. package/Pagination/PaginationResults.d.ts +3 -0
  282. package/Pagination/PaginationResults.js +11 -0
  283. package/Pagination/index.d.ts +2 -0
  284. package/Pagination/index.js +2 -0
  285. package/Pagination/package.json +6 -0
  286. package/Pill/Pill.d.ts +5 -0
  287. package/Pill/Pill.js +7 -0
  288. package/Pill/index.d.ts +1 -0
  289. package/Pill/index.js +1 -0
  290. package/Pill/package.json +6 -0
  291. package/Progress/ProgressCircular.d.ts +19 -0
  292. package/Progress/ProgressCircular.js +15 -0
  293. package/Progress/ProgressLinear.d.ts +22 -0
  294. package/Progress/ProgressLinear.js +24 -0
  295. package/Progress/ProgressOverlay.d.ts +4 -0
  296. package/Progress/ProgressOverlay.js +24 -0
  297. package/Progress/index.d.ts +3 -0
  298. package/Progress/index.js +3 -0
  299. package/Progress/package.json +6 -0
  300. package/Rating/Rating.d.ts +35 -0
  301. package/Rating/Rating.js +71 -0
  302. package/Rating/index.d.ts +11 -0
  303. package/Rating/index.js +49 -0
  304. package/Rating/package.json +6 -0
  305. package/Select/SelectDownshift.d.ts +5 -0
  306. package/Select/SelectDownshift.js +38 -0
  307. package/Select/components.d.ts +6 -0
  308. package/Select/components.js +12 -0
  309. package/Select/index.d.ts +2 -0
  310. package/Select/index.js +3 -0
  311. package/Select/package.json +6 -0
  312. package/Sidebar/Sidebar.d.ts +3 -0
  313. package/Sidebar/Sidebar.js +23 -0
  314. package/Sidebar/index.d.ts +1 -0
  315. package/Sidebar/index.js +1 -0
  316. package/Sidebar/package.json +6 -0
  317. package/Spacing/Spacing.d.ts +30 -0
  318. package/Spacing/Spacing.js +45 -0
  319. package/Spacing/index.d.ts +1 -0
  320. package/Spacing/index.js +1 -0
  321. package/Spacing/package.json +6 -0
  322. package/Sticky/Sticky.d.ts +2 -0
  323. package/Sticky/Sticky.js +219 -0
  324. package/Sticky/StickyCss.d.ts +5 -0
  325. package/Sticky/StickyCss.js +6 -0
  326. package/Sticky/index.d.ts +1 -0
  327. package/Sticky/index.js +1 -0
  328. package/Sticky/package.json +6 -0
  329. package/Tabs/TabsMui.d.ts +244 -0
  330. package/Tabs/TabsMui.js +46 -0
  331. package/Tabs/index.d.ts +1 -0
  332. package/Tabs/index.js +1 -0
  333. package/Tabs/package.json +6 -0
  334. package/Tabs/sc/bare.d.ts +5 -0
  335. package/Tabs/sc/bare.js +87 -0
  336. package/Tabs/tw/bare.d.ts +248 -0
  337. package/Tabs/tw/bare.js +17 -0
  338. package/Tabs/tw/material.d.ts +472 -0
  339. package/Tabs/tw/material.js +18 -0
  340. package/Tabs/useTabs.d.ts +43 -0
  341. package/Tabs/useTabs.js +44 -0
  342. package/Typography/CopyPasteVisible.d.ts +1 -0
  343. package/Typography/CopyPasteVisible.js +4 -0
  344. package/Typography/Native.d.ts +10 -0
  345. package/Typography/Native.js +14 -0
  346. package/Typography/ReadMore.d.ts +12 -0
  347. package/Typography/ReadMore.js +43 -0
  348. package/Typography/TextLoop.d.ts +16 -0
  349. package/Typography/TextLoop.js +46 -0
  350. package/Typography/TypeStairs.d.ts +6 -0
  351. package/Typography/TypeStairs.js +50 -0
  352. package/Typography/index.d.ts +5 -0
  353. package/Typography/index.js +5 -0
  354. package/Typography/package.json +6 -0
  355. package/css/index.d.ts +2 -0
  356. package/css/index.js +31 -0
  357. package/css/package.json +6 -0
  358. package/helpers/classed.d.ts +22 -0
  359. package/helpers/classed.js +68 -0
  360. package/helpers/extend-component.d.ts +28 -0
  361. package/helpers/extend-component.js +12 -0
  362. package/helpers/index.d.ts +3 -0
  363. package/helpers/index.js +2 -0
  364. package/helpers/package.json +6 -0
  365. package/hooks/index.d.ts +14 -0
  366. package/hooks/index.js +15 -0
  367. package/hooks/package.json +6 -0
  368. package/hooks/types.d.ts +8 -0
  369. package/hooks/types.js +1 -0
  370. package/hooks/useAsyncFn.d.ts +26 -0
  371. package/hooks/useAsyncFn.js +36 -0
  372. package/hooks/useDateLocale.d.ts +7 -0
  373. package/hooks/useDateLocale.js +38 -0
  374. package/hooks/useEffectOnce.d.ts +5 -0
  375. package/hooks/useEffectOnce.js +8 -0
  376. package/hooks/useFirstMountState.d.ts +4 -0
  377. package/hooks/useFirstMountState.js +12 -0
  378. package/hooks/useFocus.d.ts +4 -0
  379. package/hooks/useFocus.js +11 -0
  380. package/hooks/useId.d.ts +4 -0
  381. package/hooks/useId.js +8 -0
  382. package/hooks/useIsomorphicLayoutEffect.d.ts +5 -0
  383. package/hooks/useIsomorphicLayoutEffect.js +8 -0
  384. package/hooks/useMount.d.ts +4 -0
  385. package/hooks/useMount.js +9 -0
  386. package/hooks/useMountedState.d.ts +4 -0
  387. package/hooks/useMountedState.js +15 -0
  388. package/hooks/usePrevious.d.ts +1 -0
  389. package/hooks/usePrevious.js +8 -0
  390. package/hooks/useScrollPosition.d.ts +15 -0
  391. package/hooks/useScrollPosition.js +80 -0
  392. package/hooks/useScrollTo.d.ts +1 -0
  393. package/hooks/useScrollTo.js +21 -0
  394. package/hooks/useTraceUpdate.d.ts +4 -0
  395. package/hooks/useTraceUpdate.js +21 -0
  396. package/hooks/useUpdateEffect.d.ts +5 -0
  397. package/hooks/useUpdateEffect.js +14 -0
  398. package/hooks/useWindowSize.d.ts +1 -0
  399. package/hooks/useWindowSize.js +13 -0
  400. package/index.d.ts +1 -0
  401. package/index.js +5 -0
  402. package/m/MotionProvider.d.ts +37 -0
  403. package/m/MotionProvider.js +39 -0
  404. package/m/index.d.ts +6 -0
  405. package/m/index.js +6 -0
  406. package/m/lite.d.ts +2 -0
  407. package/m/lite.js +2 -0
  408. package/m/max.d.ts +2 -0
  409. package/m/max.js +2 -0
  410. package/m/package.json +6 -0
  411. package/package.json +6 -9
  412. package/sc/index.d.ts +30 -0
  413. package/sc/index.js +31 -0
  414. package/sc/package.json +6 -0
  415. package/scm/index.d.ts +29 -0
  416. package/scm/index.js +31 -0
  417. package/scm/package.json +6 -0
  418. package/shared/index.d.ts +8 -0
  419. package/shared/index.js +8 -0
  420. package/shared/package.json +6 -0
  421. package/styles/Body.d.ts +10 -0
  422. package/styles/Body.js +13 -0
  423. package/styles/Global.d.ts +15 -0
  424. package/styles/Global.js +18 -0
  425. package/styles/index.d.ts +7 -0
  426. package/styles/index.js +7 -0
  427. package/styles/media.d.ts +67 -0
  428. package/styles/media.js +155 -0
  429. package/styles/package.json +6 -0
  430. package/styles/spacing.d.ts +13 -0
  431. package/styles/spacing.js +45 -0
  432. package/styles/styled.d.ts +12 -0
  433. package/styles/styled.js +13 -0
  434. package/styles/theme--vanilla.d.ts +18 -0
  435. package/styles/theme--vanilla.js +55 -0
  436. package/styles/theme.d.ts +82 -0
  437. package/styles/theme.js +41 -0
  438. package/tw/index.d.ts +2 -0
  439. package/tw/index.js +31 -0
  440. package/tw/package.json +6 -0
  441. package/twm/index.d.ts +2 -0
  442. package/twm/index.js +31 -0
  443. package/twm/package.json +6 -0
  444. package/types.d.ts +10 -0
  445. package/types.js +1 -0
package/scm/index.d.ts ADDED
@@ -0,0 +1,29 @@
1
+ export * from "../shared";
2
+ export * from "../Alert";
3
+ export * from "../Animations";
4
+ export * from "../Autocomplete";
5
+ export * from "../Bg";
6
+ export * from "../Breadcrumbs";
7
+ export * from "../Buttons";
8
+ export * from "../Carousel";
9
+ export * from "../Collapsable";
10
+ export * from "../Debug";
11
+ export { KoineDialog, type KoineDialogProps } from "../Dialog/sc/framer";
12
+ export * from "../Forms";
13
+ export * from "../Grid";
14
+ export * from "../Hamburger";
15
+ export * from "../Header";
16
+ export * from "../Hidden";
17
+ export * from "../Img";
18
+ export * from "../Link";
19
+ export * from "../MenuItem";
20
+ export * from "../Pagination";
21
+ export * from "../Pill";
22
+ export * from "../Progress";
23
+ export * from "../Rating";
24
+ export * from "../Sidebar";
25
+ export * from "../Spacing";
26
+ export * from "../Sticky";
27
+ export * from "../styles";
28
+ export * from "../Tabs";
29
+ export * from "../Typography";
package/scm/index.js ADDED
@@ -0,0 +1,31 @@
1
+ export * from "../shared";
2
+ export * from "../Alert";
3
+ export * from "../Animations";
4
+ export * from "../Autocomplete";
5
+ export * from "../Bg";
6
+ export * from "../Breadcrumbs";
7
+ export * from "../Buttons";
8
+ export * from "../Carousel";
9
+ export * from "../Collapsable";
10
+ export * from "../Debug";
11
+ export { KoineDialog } from "../Dialog/sc/framer";
12
+ // export { KoineForm, type KoineFormProps} from "../Form/sc/framer";
13
+ export * from "../Forms";
14
+ export * from "../Grid";
15
+ export * from "../Hamburger";
16
+ export * from "../Header";
17
+ export * from "../Hidden";
18
+ export * from "../Img";
19
+ export * from "../Link";
20
+ export * from "../MenuItem";
21
+ export * from "../Pagination";
22
+ export * from "../Pill";
23
+ export * from "../Progress";
24
+ export * from "../Rating";
25
+ // export * from "../Select";
26
+ export * from "../Sidebar";
27
+ export * from "../Spacing";
28
+ export * from "../Sticky";
29
+ export * from "../styles";
30
+ export * from "../Tabs";
31
+ export * from "../Typography";
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "./index.js",
4
+ "main": "../node/scm/index.js",
5
+ "types": "./index.d.ts"
6
+ }
@@ -0,0 +1,8 @@
1
+ export * from "../Calendar";
2
+ export * from "../Dialog";
3
+ export * from "../Favicon";
4
+ export * from "../helpers";
5
+ export * from "../hooks";
6
+ export * from "../Meta";
7
+ export * from "../NoJs";
8
+ export * from "../types";
@@ -0,0 +1,8 @@
1
+ export * from "../Calendar";
2
+ export * from "../Dialog";
3
+ export * from "../Favicon";
4
+ export * from "../helpers";
5
+ export * from "../hooks";
6
+ export * from "../Meta";
7
+ export * from "../NoJs";
8
+ export * from "../types";
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "./index.js",
4
+ "main": "../node/shared/index.js",
5
+ "types": "./index.d.ts"
6
+ }
@@ -0,0 +1,10 @@
1
+ export declare const BodyRoot: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
2
+ /**
3
+ * If you have background graphics to overlap you might need to add:
4
+ *
5
+ * ```css
6
+ * z-index: 1;
7
+ * position: relative;
8
+ * ```
9
+ */
10
+ export declare const BodyMain: import("styled-components").StyledComponent<"main", import("styled-components").DefaultTheme, {}, never>;
package/styles/Body.js ADDED
@@ -0,0 +1,13 @@
1
+ import { __makeTemplateObject } from "tslib";
2
+ import styled from "styled-components";
3
+ export var BodyRoot = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n"], ["\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n"])));
4
+ /**
5
+ * If you have background graphics to overlap you might need to add:
6
+ *
7
+ * ```css
8
+ * z-index: 1;
9
+ * position: relative;
10
+ * ```
11
+ */
12
+ export var BodyMain = styled.main(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n flex: 1;\n"], ["\n flex: 1;\n"])));
13
+ var templateObject_1, templateObject_2;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * App global style
3
+ *
4
+ * For examples of what to do here take a look at [Bootstrap's reset](https://github.com/twbs/bootstrap/blob/main/scss/_reboot.scss)
5
+ * and similar.
6
+ *
7
+ * What we do here:
8
+ * - set the base font family on all possible elements including placeholders prevent Chrome showing a standard font when using the autofill feature
9
+ * - @see https://stackoverflow.com/a/60987373/1938970
10
+ * - set the base font size on all possible elements to prevent weird zooming on input fields on iPhone iOS devices.
11
+ * - @see https://www.warrenchandler.com/2019/04/02/stop-iphones-from-zooming-in-on-form-fields/
12
+ * - @see https://css-tricks.com/16px-or-larger-text-prevents-ios-form-zoom/
13
+ */
14
+ export declare const stylesGlobal = "\n body {\n margin: 0;\n padding: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n }\n\n body,\n button,\n input,\n textarea,\n select,\n select:-webkit-autofill::first-line,\n input:-webkit-autofill::first-line {\n font-family: var(--font), -apple-system, BlinkMacSystemFont, \"Segoe UI\",\n Roboto, Oxygen, Ubuntu, Cantarell, \"Open Sans\", \"Helvetica Neue\",\n sans-serif;\n font-size: var(--fontSize);\n }\n\n html {\n box-sizing: border-box;\n @media (prefers-reduced-motion: no-preference) {\n scroll-behavior: smooth;\n }\n }\n\n *,\n *:before,\n *:after {\n box-sizing: inherit;\n -webkit-tap-highlight-color: transparent;\n }\n";
15
+ export declare const StylesGlobal: import("styled-components").GlobalStyleComponent<{}, import("styled-components").DefaultTheme>;
@@ -0,0 +1,18 @@
1
+ import { __makeTemplateObject } from "tslib";
2
+ import { createGlobalStyle } from "styled-components";
3
+ /**
4
+ * App global style
5
+ *
6
+ * For examples of what to do here take a look at [Bootstrap's reset](https://github.com/twbs/bootstrap/blob/main/scss/_reboot.scss)
7
+ * and similar.
8
+ *
9
+ * What we do here:
10
+ * - set the base font family on all possible elements including placeholders prevent Chrome showing a standard font when using the autofill feature
11
+ * - @see https://stackoverflow.com/a/60987373/1938970
12
+ * - set the base font size on all possible elements to prevent weird zooming on input fields on iPhone iOS devices.
13
+ * - @see https://www.warrenchandler.com/2019/04/02/stop-iphones-from-zooming-in-on-form-fields/
14
+ * - @see https://css-tricks.com/16px-or-larger-text-prevents-ios-form-zoom/
15
+ */
16
+ export var stylesGlobal = "\n body {\n margin: 0;\n padding: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n }\n\n body,\n button,\n input,\n textarea,\n select,\n select:-webkit-autofill::first-line,\n input:-webkit-autofill::first-line {\n font-family: var(--font), -apple-system, BlinkMacSystemFont, \"Segoe UI\",\n Roboto, Oxygen, Ubuntu, Cantarell, \"Open Sans\", \"Helvetica Neue\",\n sans-serif;\n font-size: var(--fontSize);\n }\n\n html {\n box-sizing: border-box;\n @media (prefers-reduced-motion: no-preference) {\n scroll-behavior: smooth;\n }\n }\n\n *,\n *:before,\n *:after {\n box-sizing: inherit;\n -webkit-tap-highlight-color: transparent;\n }\n";
17
+ export var StylesGlobal = createGlobalStyle(templateObject_1 || (templateObject_1 = __makeTemplateObject(["", ""], ["", ""])), stylesGlobal);
18
+ var templateObject_1;
@@ -0,0 +1,7 @@
1
+ export * from "./Body";
2
+ export * from "./Global";
3
+ export * from "./media";
4
+ export * from "./spacing";
5
+ export * from "./styled";
6
+ export * from "./theme";
7
+ export * from "./theme--vanilla";
@@ -0,0 +1,7 @@
1
+ export * from "./Body";
2
+ export * from "./Global";
3
+ export * from "./media";
4
+ export * from "./spacing";
5
+ export * from "./styled";
6
+ export * from "./theme";
7
+ export * from "./theme--vanilla";
@@ -0,0 +1,67 @@
1
+ import { Breakpoint, Breakpoints } from "./theme";
2
+ export declare const min: MediaQueryFunction, max: MediaQueryFunction, up: MediaQueryFunction, down: (br: Breakpoint) => string, between: (br1: Breakpoint, br2: Breakpoint) => string, only: (br: Breakpoint) => string;
3
+ export declare type MediaDirection = "min" | "max";
4
+ export declare type MediaQuery = `${MediaDirection}:${Breakpoint}`;
5
+ export declare type MediaQueryFunction = {
6
+ [Breakpoint in keyof Breakpoints]: string;
7
+ } & {
8
+ (breakpoint: Breakpoint): string;
9
+ };
10
+ export declare function useMedia(media: MediaQuery): boolean;
11
+ /**
12
+ * Generate media queries helpers
13
+ *
14
+ * Usage:
15
+ * ```jsx
16
+ * import { generateMediaQueries } from "@koine/react";
17
+ *
18
+ * export const breakpoints = {
19
+ * xs: 0,
20
+ * sm: 440,
21
+ * md: 768,
22
+ * lg: 1024,
23
+ * xl: 1368,
24
+ * xxl: 1690,
25
+ * } as const;
26
+ *
27
+ * export const { min, max, up, down, between, only } = generateMediaQueries(breakpoints);
28
+ * ```
29
+ *
30
+ * Consider the following syntaxes, using normal CSS is just slightly
31
+ * longer but it aovid js imports, reduce the js overhead and improve CSS
32
+ * highlighting in the editor.
33
+ *
34
+ * Even if we would reduce the function signature to the bare minimum the advantage
35
+ * in terms of typing would not be much, also loosing in readability.
36
+ *
37
+ * ```css
38
+ * // but unfortunately this does not work
39
+ * @media (min-width: var(--b-sm)) {}
40
+ * @media (min-width: 480px) {}
41
+ *
42
+ * ${media("min", "sm")} {}
43
+ * ${mediaMin("sm")} {}
44
+ * ${min.sm} {}
45
+ * ${p => p.theme.min.sm}``
46
+ * ```
47
+ *
48
+ * Related projects:
49
+ * @see https://github.com/mg901/styled-breakpoints
50
+ * @see https://github.com/morajabi/styled-media-query
51
+ *
52
+ * @see https://www.w3.org/TR/mediaqueries-5/#custom-mq The spec would allow for
53
+ * something like this syntax
54
+ *
55
+ * ```css
56
+ * @custom-media --narrow-window (max-width: 30em);
57
+ * @media (--narrow-window) {}
58
+ * ```
59
+ */
60
+ export declare function generateMediaQueries(breakpoints: Breakpoints): {
61
+ min: MediaQueryFunction;
62
+ max: MediaQueryFunction;
63
+ up: MediaQueryFunction;
64
+ down: (br: Breakpoint) => string;
65
+ between: (br1: Breakpoint, br2: Breakpoint) => string;
66
+ only: (br: Breakpoint) => string;
67
+ };
@@ -0,0 +1,155 @@
1
+ var _a;
2
+ import { useState, useEffect } from "react";
3
+ import { useTheme, breakpoints } from "./theme";
4
+ export var min = (_a = generateMediaQueries(breakpoints), _a.min), max = _a.max, up = _a.up, down = _a.down, between = _a.between, only = _a.only;
5
+ export function useMedia(media) {
6
+ var breakpoints = useTheme().breakpoints;
7
+ var _a = useState(false), matches = _a[0], setMatches = _a[1];
8
+ var _b = media.split(":"), _c = _b[0], direction = _c === void 0 ? "min" : _c, breakpoint = _b[1];
9
+ var px = breakpoints[breakpoint];
10
+ if (direction === "max") {
11
+ px = px - 0.02;
12
+ }
13
+ var query = "(".concat(direction, "-width: ").concat(px, "px)");
14
+ useEffect(function () {
15
+ var mq = window.matchMedia(query);
16
+ var handleChange = function (event) {
17
+ setMatches(event.matches);
18
+ };
19
+ setMatches(mq.matches);
20
+ // Safari < 14 can't use addEventListener on a MediaQueryList
21
+ // https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList#Browser_compatibility
22
+ if (!mq.addEventListener) {
23
+ // Update the state whenever the media query match state changes
24
+ mq.addListener(handleChange);
25
+ // Clean up on unmount and if the query changes
26
+ return function () {
27
+ mq.removeListener(handleChange);
28
+ };
29
+ }
30
+ mq.addEventListener("change", handleChange);
31
+ return function () {
32
+ mq.removeEventListener("change", handleChange);
33
+ };
34
+ }, [query]);
35
+ return matches;
36
+ }
37
+ /**
38
+ * Generate media queries helpers
39
+ *
40
+ * Usage:
41
+ * ```jsx
42
+ * import { generateMediaQueries } from "@koine/react";
43
+ *
44
+ * export const breakpoints = {
45
+ * xs: 0,
46
+ * sm: 440,
47
+ * md: 768,
48
+ * lg: 1024,
49
+ * xl: 1368,
50
+ * xxl: 1690,
51
+ * } as const;
52
+ *
53
+ * export const { min, max, up, down, between, only } = generateMediaQueries(breakpoints);
54
+ * ```
55
+ *
56
+ * Consider the following syntaxes, using normal CSS is just slightly
57
+ * longer but it aovid js imports, reduce the js overhead and improve CSS
58
+ * highlighting in the editor.
59
+ *
60
+ * Even if we would reduce the function signature to the bare minimum the advantage
61
+ * in terms of typing would not be much, also loosing in readability.
62
+ *
63
+ * ```css
64
+ * // but unfortunately this does not work
65
+ * @media (min-width: var(--b-sm)) {}
66
+ * @media (min-width: 480px) {}
67
+ *
68
+ * ${media("min", "sm")} {}
69
+ * ${mediaMin("sm")} {}
70
+ * ${min.sm} {}
71
+ * ${p => p.theme.min.sm}``
72
+ * ```
73
+ *
74
+ * Related projects:
75
+ * @see https://github.com/mg901/styled-breakpoints
76
+ * @see https://github.com/morajabi/styled-media-query
77
+ *
78
+ * @see https://www.w3.org/TR/mediaqueries-5/#custom-mq The spec would allow for
79
+ * something like this syntax
80
+ *
81
+ * ```css
82
+ * @custom-media --narrow-window (max-width: 30em);
83
+ * @media (--narrow-window) {}
84
+ * ```
85
+ */
86
+ export function generateMediaQueries(breakpoints) {
87
+ var temp = Object.keys(breakpoints).map(function (key) {
88
+ var br = key;
89
+ return [br, breakpoints[br]];
90
+ });
91
+ var sortedKeys = temp.sort(function (a, b) { return a[1] - b[1]; }).map(function (item) { return item[0]; });
92
+ var getNext = function (breakpoint) {
93
+ var index = sortedKeys.indexOf(breakpoint);
94
+ return sortedKeys[index + 1];
95
+ };
96
+ /**
97
+ * It behaves the same as `@media (min-width: ${value}px)`
98
+ * where value is the given breakpoint value.
99
+ * For ease of use this can be used both as a function `min("md")` and as an
100
+ * object literal `min.md`.
101
+ */ // @ts-expect-error FIXME: at some point
102
+ var min = function (br) {
103
+ return "@media (min-width: ".concat(breakpoints[br], "px)");
104
+ };
105
+ /**
106
+ * It behaves the same as `@media (max-width: ${value}px)`
107
+ * where value is the given breakpoint value.
108
+ * For ease of use this can be used both as a function `max("md")` and as an
109
+ * object literal `max.md`.
110
+ */ // @ts-expect-error FIXME: at some point
111
+ var max = function (br) {
112
+ return "@media (max-width: ".concat(breakpoints[br] - 0.02, "px)");
113
+ };
114
+ for (var br in breakpoints) {
115
+ var _br = br;
116
+ min[_br] = "@media (min-width: ".concat(breakpoints[_br], "px)");
117
+ max[_br] = "@media (max-width: ".concat(breakpoints[_br] - 0.02, "px)");
118
+ }
119
+ /**
120
+ * It behaves the same as `min`
121
+ * @inheritdoc {max}
122
+ */
123
+ var up = min;
124
+ /**
125
+ * It behaves similarly to `max` but you will use the "next" breakpoint,
126
+ * specifying CSS that will apply from the given breakpoint and down.
127
+ */
128
+ var down = function (br) {
129
+ var brNext = getNext(br);
130
+ // TODO: if br does not exists otherwise throw Error
131
+ return brNext && "@media (max-width: ".concat(breakpoints[brNext] - 0.02, "px)");
132
+ };
133
+ /**
134
+ * Media query between the two given breakpoints
135
+ */
136
+ var between = function (br1, br2) {
137
+ return "@media (min-width: ".concat(breakpoints[br1], "px) and (max-width: ").concat(breakpoints[br2] - 0.02, "px)");
138
+ };
139
+ /**
140
+ * Media query to apply from the given breakpoint until the next, just for its
141
+ * full range
142
+ */
143
+ var only = function (br) {
144
+ var brNext = getNext(br);
145
+ return brNext ? between(br, brNext) : min(br);
146
+ };
147
+ return {
148
+ min: min,
149
+ max: max,
150
+ up: up,
151
+ down: down,
152
+ between: between,
153
+ only: only,
154
+ };
155
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "./index.js",
4
+ "main": "../node/styles/index.js",
5
+ "types": "./index.d.ts"
6
+ }
@@ -0,0 +1,13 @@
1
+ import type { Theme } from "./theme";
2
+ export declare type SpacingSize = "sm" | "md" | "lg";
3
+ export declare type SpacingProperty = "padding" | "margin";
4
+ /** @default 1 */
5
+ export declare type SpacingFactor = number;
6
+ export declare type SpacingDirection = "top" | "bottom";
7
+ export declare type SpacingDirectionAxis = "vertical" | SpacingDirection;
8
+ export declare type SpacingDevices = keyof Theme["devices"];
9
+ export declare type SpacingArgs = Parameters<typeof spacing>;
10
+ export declare function spacing(this: Theme, size?: SpacingSize, factor?: SpacingFactor, property?: SpacingProperty, direction?: SpacingDirectionAxis, devices?: SpacingDevices[]): string;
11
+ export declare function spacingTop(this: Theme, size?: SpacingSize, factor?: SpacingFactor, property?: SpacingProperty, devices?: SpacingDevices[]): string;
12
+ export declare function spacingBottom(this: Theme, size?: SpacingSize, factor?: SpacingFactor, property?: SpacingProperty, devices?: SpacingDevices[]): string;
13
+ export declare function spacingVertical(this: Theme, size?: SpacingSize, factor?: SpacingFactor, property?: SpacingProperty, devices?: SpacingDevices[]): string;
@@ -0,0 +1,45 @@
1
+ function _spacing(theme, size, factor, property, direction, devices) {
2
+ if (size === void 0) { size = "md"; }
3
+ if (factor === void 0) { factor = 1; }
4
+ if (property === void 0) { property = "padding"; }
5
+ if (direction === void 0) { direction = "top"; }
6
+ if (devices === void 0) { devices = ["mobile", "tablet", "desktop"]; }
7
+ var breakpoints = theme.breakpoints, DEVICES = theme.devices, SPACES = theme.spaces;
8
+ var css = "";
9
+ var prop = "".concat(property, "-").concat(direction);
10
+ if (!devices.length || devices[0] === "mobile") {
11
+ css += "@media(max-width: ".concat(breakpoints[DEVICES.mobile], "px){\n ").concat(prop, ": ").concat(SPACES["mobile"][size] * factor, "px;\n }");
12
+ }
13
+ else {
14
+ for (var index = 0; index < devices.length; index++) {
15
+ var device = devices[index];
16
+ if (device === "mobile") {
17
+ css += "".concat(prop, ": ").concat(SPACES[device][size] * factor, "px;");
18
+ }
19
+ else if (device === "tablet") {
20
+ css += "@media(min-width: ".concat(breakpoints[DEVICES.tablet], "px){\n ").concat(prop, ": ").concat(SPACES["tablet"][size] * factor, "px;\n }");
21
+ }
22
+ else if (device === "desktop") {
23
+ css += "@media(min-width: ".concat(breakpoints[DEVICES.desktop], "px){\n ").concat(prop, ": ").concat(SPACES["desktop"][size] * factor, "px;\n }");
24
+ }
25
+ }
26
+ }
27
+ return css;
28
+ }
29
+ export function spacing(size, factor, property, direction, devices) {
30
+ if (direction === "vertical") {
31
+ return (_spacing(this, size, factor, property, "top", devices) +
32
+ _spacing(this, size, factor, property, "bottom", devices));
33
+ }
34
+ return _spacing(this, size, factor, property, direction, devices);
35
+ }
36
+ export function spacingTop(size, factor, property, devices) {
37
+ return _spacing(this, size, factor, property, "top", devices);
38
+ }
39
+ export function spacingBottom(size, factor, property, devices) {
40
+ return _spacing(this, size, factor, property, "bottom", devices);
41
+ }
42
+ export function spacingVertical(size, factor, property, devices) {
43
+ return (_spacing(this, size, factor, property, "top", devices) +
44
+ _spacing(this, size, factor, property, "bottom", devices));
45
+ }
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ export declare function colStretch(direction: "left" | "right", bg: React.CSSProperties["background"]): string;
3
+ /** @see https://caniuse.com/?search=inset */
4
+ export declare const inset0 = "top:0;left:0;right:0;bottom:0;";
5
+ export declare const overlay: string;
6
+ export declare const centered = "display: flex;align-items: center;justify-content: center;";
7
+ export declare const ellipsis = "overflow: hidden;text-overflow: ellipsis;white-space: nowrap;";
8
+ /**
9
+ * @see import("@mui/utils").visuallyHidden https://github.com/mui-org/material-ui/blob/master/packages/mui-utils/src/visuallyHidden.ts
10
+ */
11
+ export declare const invisible = "border: 0;clip: rect(0 0 0 0);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;white-space: nowrap;width: 1px;";
12
+ export declare const stateFocus = "outline: 0px;box-shadow: 0 0 0 0.2rem rgba(200, 200, 200, 0.25);";
@@ -0,0 +1,13 @@
1
+ export function colStretch(direction, bg) {
2
+ return "\n background: ".concat(bg, ";\n position: relative;\n\n &:before{\n z-index: -1;\n content: '';\n position: absolute;\n right: ").concat(direction === "left" ? "100%" : "-100vw", ";\n left: ").concat(direction === "right" ? "100%" : "-100vw", ";\n top: 0;\n bottom: 0;\n background: ").concat(bg, ";\n }\n ");
3
+ }
4
+ /** @see https://caniuse.com/?search=inset */
5
+ export var inset0 = "top:0;left:0;right:0;bottom:0;";
6
+ export var overlay = "position: absolute;".concat(inset0);
7
+ export var centered = "display: flex;align-items: center;justify-content: center;";
8
+ export var ellipsis = "overflow: hidden;text-overflow: ellipsis;white-space: nowrap;";
9
+ /**
10
+ * @see import("@mui/utils").visuallyHidden https://github.com/mui-org/material-ui/blob/master/packages/mui-utils/src/visuallyHidden.ts
11
+ */
12
+ export var invisible = "border: 0;clip: rect(0 0 0 0);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;white-space: nowrap;width: 1px;";
13
+ export var stateFocus = "outline: 0px;box-shadow: 0 0 0 0.2rem rgba(200, 200, 200, 0.25);";
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ export declare const THEME_KEY = "theme";
3
+ export declare const THEME_DEFAULT: ThemeVanillaValue;
4
+ export declare const getInitialThemeFromRequest: (cookie?: string | undefined) => ThemeVanillaValue;
5
+ export declare const getInitialThemeFromClient: () => ThemeVanillaValue;
6
+ export declare type ThemeCookie = {
7
+ [THEME_KEY]: ThemeVanillaValue;
8
+ };
9
+ export declare type ThemeVanillaValue = "light" | "dark";
10
+ export declare type ThemeVanillaContextType = {
11
+ theme: ThemeVanillaValue;
12
+ setTheme?: React.Dispatch<React.SetStateAction<ThemeVanillaValue>>;
13
+ };
14
+ export declare const ThemeVanillaContext: import("react").Context<ThemeVanillaContextType>;
15
+ export declare type ThemeVanillaProviderProps = React.PropsWithChildren<{
16
+ initialTheme: ThemeVanillaValue;
17
+ }>;
18
+ export declare const ThemeVanillaProvider: ({ initialTheme, children, }: ThemeVanillaProviderProps) => JSX.Element;
@@ -0,0 +1,55 @@
1
+ import { __assign } from "tslib";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { createContext, useState } from "react";
4
+ import { isBrowser, setCookie, parseCookie } from "@koine/utils";
5
+ import { useMount, useUpdateEffect } from "../hooks";
6
+ export var THEME_KEY = "theme";
7
+ export var THEME_DEFAULT = "light";
8
+ export var getInitialThemeFromRequest = function (cookie) {
9
+ if (cookie) {
10
+ var parsed = parseCookie(cookie);
11
+ return parsed === null || parsed === void 0 ? void 0 : parsed.theme;
12
+ }
13
+ return THEME_DEFAULT;
14
+ };
15
+ export var getInitialThemeFromClient = function () {
16
+ if (typeof window !== "undefined" && window.localStorage) {
17
+ var storedPrefs = window.localStorage.getItem(THEME_KEY);
18
+ if (typeof storedPrefs === "string") {
19
+ return storedPrefs;
20
+ }
21
+ var userMedia = window.matchMedia("(prefers-color-scheme: dark)");
22
+ if (userMedia.matches) {
23
+ return "dark";
24
+ }
25
+ }
26
+ return THEME_DEFAULT;
27
+ };
28
+ export var ThemeVanillaContext = createContext({
29
+ theme: "light",
30
+ setTheme: undefined,
31
+ });
32
+ export var ThemeVanillaProvider = function (_a) {
33
+ var initialTheme = _a.initialTheme, children = _a.children;
34
+ var _b = useState(initialTheme), theme = _b[0], setTheme = _b[1];
35
+ var rawSetTheme = function (rawTheme) {
36
+ if (!rawTheme || !isBrowser) {
37
+ return;
38
+ }
39
+ var root = window.document.documentElement;
40
+ var isDark = rawTheme === "dark";
41
+ root.classList.remove(isDark ? "light" : "dark");
42
+ root.classList.add(rawTheme);
43
+ localStorage.setItem(THEME_KEY, rawTheme);
44
+ setCookie(THEME_KEY, rawTheme);
45
+ };
46
+ useMount(function () {
47
+ var theme = getInitialThemeFromClient();
48
+ setTheme(theme);
49
+ rawSetTheme(theme);
50
+ });
51
+ useUpdateEffect(function () {
52
+ rawSetTheme(theme);
53
+ }, [theme]);
54
+ return (_jsx(ThemeVanillaContext.Provider, __assign({ value: { theme: theme, setTheme: setTheme } }, { children: children })));
55
+ };
@@ -0,0 +1,82 @@
1
+ export declare type Breakpoint = "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
2
+ export declare type Breakpoints = Record<Breakpoint, number>;
3
+ /**
4
+ * You can override the default breakpoints through the .env variable
5
+ *
6
+ * FIXME: find a better way to configure it, the problem is that we use the media
7
+ * queries within this pre-compiled library and thrught it was better to avoid
8
+ * using theming props for a more ergonomic usage.
9
+ *
10
+ * ```.env
11
+ * BREAKPOINTS=xs:0,sm:440,md:768,lg:1024,xl:1368,xxl:1690
12
+ * ```
13
+ */
14
+ export declare const breakpoints: Breakpoints;
15
+ export declare const createTheme: (options: ThemeOptions) => Theme;
16
+ export declare const useTheme: () => Theme;
17
+ export declare type Theme = {
18
+ maxWidth: number;
19
+ gutter: {
20
+ quarter: number;
21
+ third: number;
22
+ half: number;
23
+ /** @default 60 */
24
+ normal: number;
25
+ double: number;
26
+ triple: number;
27
+ };
28
+ breakpoints: Breakpoints;
29
+ devices: {
30
+ /** @default "sm" */
31
+ mobile: keyof Breakpoints;
32
+ /** @default "md" */
33
+ tablet: keyof Breakpoints;
34
+ /** @default "lg" */
35
+ desktop: keyof Breakpoints;
36
+ };
37
+ spaces: {
38
+ mobile: {
39
+ /** @default 10 */
40
+ sm: number;
41
+ /** @default 20 */
42
+ md: number;
43
+ /** @default 40 */
44
+ lg: number;
45
+ };
46
+ tablet: {
47
+ /** @default 15 */
48
+ sm: number;
49
+ /** @default 30 */
50
+ md: number;
51
+ /** @default 60 */
52
+ lg: number;
53
+ };
54
+ desktop: {
55
+ /** @default 20 */
56
+ sm: number;
57
+ /** @default 40 */
58
+ md: number;
59
+ /** @default 80 */
60
+ lg: number;
61
+ };
62
+ };
63
+ header: {
64
+ /** @default "lg" */
65
+ breakpoint: keyof Breakpoints;
66
+ /** @default [82, 134] */
67
+ height: [number, number];
68
+ /** @default [60, 90] */
69
+ heightSticky: [number, number];
70
+ /** @default [76, 76] */
71
+ logoWidth: [number, number];
72
+ /** @default [70, 70] */
73
+ logoWidthSticky: [number, number];
74
+ };
75
+ };
76
+ export declare type ThemeOptions = {
77
+ maxWidth?: number;
78
+ gutter: NonNullable<Theme["gutter"]>;
79
+ devices?: Theme["devices"];
80
+ spaces: NonNullable<Theme["spaces"]>;
81
+ header: NonNullable<Theme["header"]>;
82
+ };