@koine/react 2.0.0-beta.38 → 2.0.0-beta.39

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 (470) hide show
  1. package/README.md +1 -0
  2. package/calendar/CalendarDaygridCell.d.ts +4 -4
  3. package/calendar/CalendarDaygridNav.d.ts +3 -3
  4. package/calendar/CalendarDaygridTable.d.ts +4 -4
  5. package/calendar/CalendarLegend.d.ts +3 -3
  6. package/calendar/calendar-api-google.d.ts +2 -2
  7. package/calendar/useCalendar.d.ts +5 -5
  8. package/calendar/useDateLocale.d.ts +2 -0
  9. package/calendar/utils.d.ts +11 -11
  10. package/calendar.cjs.d.ts +1 -0
  11. package/calendar.cjs.default.js +1 -0
  12. package/calendar.cjs.js +62 -0
  13. package/calendar.cjs.mjs +2 -0
  14. package/calendar.d.ts +7 -0
  15. package/calendar.esm.js +35 -0
  16. package/components/FaviconTags.d.ts +8 -0
  17. package/components/Meta.d.ts +4 -0
  18. package/components/NoJs.d.ts +2 -0
  19. package/forms/antispam.d.ts +6 -6
  20. package/forms.cjs.d.ts +1 -0
  21. package/forms.cjs.default.js +1 -0
  22. package/forms.cjs.js +11 -0
  23. package/forms.cjs.mjs +2 -0
  24. package/forms.d.ts +1 -0
  25. package/forms.esm.js +6 -0
  26. package/hooks/index.d.ts +19 -0
  27. package/{useAsyncFn.d.ts → hooks/useAsyncFn.d.ts} +3 -3
  28. package/hooks/useFirstMountState.d.ts +1 -0
  29. package/hooks/useFixedOffset.d.ts +1 -0
  30. package/hooks/useFocus.d.ts +1 -0
  31. package/hooks/useInterval.d.ts +1 -0
  32. package/hooks/useIsomorphicLayoutEffect.d.ts +2 -0
  33. package/hooks/useKeyUp.d.ts +1 -0
  34. package/{useMeasure.d.ts → hooks/useMeasure.d.ts} +2 -2
  35. package/hooks/useMountedState.d.ts +1 -0
  36. package/hooks/useNavigateAway.d.ts +2 -0
  37. package/hooks/usePrevious.d.ts +1 -0
  38. package/hooks/usePreviousRef.d.ts +1 -0
  39. package/{useReveal.d.ts → hooks/useReveal.d.ts} +1 -1
  40. package/hooks/useScrollPosition.d.ts +7 -0
  41. package/hooks/useScrollThreshold.d.ts +1 -0
  42. package/hooks/useScrollTo.d.ts +1 -0
  43. package/hooks/useSmoothScroll.d.ts +1 -0
  44. package/hooks/useSpinDelay.d.ts +1 -0
  45. package/hooks/useTraceUpdate.d.ts +1 -0
  46. package/hooks/useUpdateEffect.d.ts +2 -0
  47. package/hooks/useWindowSize.d.ts +2 -0
  48. package/index.cjs.d.ts +1 -0
  49. package/index.cjs.default.js +1 -0
  50. package/index.cjs.js +77 -0
  51. package/index.cjs.mjs +2 -0
  52. package/index.d.ts +3 -26
  53. package/index.esm.js +51 -0
  54. package/package.json +21 -639
  55. package/utils/classed.d.ts +8 -0
  56. package/{createUseMediaQueryWidth.d.ts → utils/createUseMediaQueryWidth.d.ts} +2 -2
  57. package/{extendComponent.d.ts → utils/extendComponent.d.ts} +2 -3
  58. package/utils/index.d.ts +5 -0
  59. package/utils/mergeRefs.d.ts +1 -0
  60. package/Alert/Alert.d.ts +0 -5
  61. package/Alert/Alert.js +0 -10
  62. package/Alert/index.d.ts +0 -1
  63. package/Alert/index.js +0 -1
  64. package/Animations/Reveal.d.ts +0 -3
  65. package/Animations/Reveal.js +0 -16
  66. package/Animations/Underline.d.ts +0 -1
  67. package/Animations/Underline.js +0 -5
  68. package/Animations/index.d.ts +0 -3
  69. package/Animations/index.js +0 -3
  70. package/Animations/useReveal.d.ts +0 -13
  71. package/Animations/useReveal.js +0 -43
  72. package/Autocomplete/AutocompleteDownshift.d.ts +0 -1
  73. package/Autocomplete/AutocompleteDownshift.js +0 -1
  74. package/Autocomplete/AutocompleteDownshiftMultiselect.d.ts +0 -1
  75. package/Autocomplete/AutocompleteDownshiftMultiselect.js +0 -1
  76. package/Autocomplete/AutocompleteMui.d.ts +0 -22
  77. package/Autocomplete/AutocompleteMui.js +0 -93
  78. package/Autocomplete/AutocompleteReach.d.ts +0 -1
  79. package/Autocomplete/AutocompleteReach.js +0 -1
  80. package/Autocomplete/components.d.ts +0 -12
  81. package/Autocomplete/components.js +0 -26
  82. package/Autocomplete/helpers.d.ts +0 -3
  83. package/Autocomplete/helpers.js +0 -16
  84. package/Autocomplete/index.d.ts +0 -2
  85. package/Autocomplete/index.js +0 -1
  86. package/Bg/BgColor.d.ts +0 -12
  87. package/Bg/BgColor.js +0 -16
  88. package/Bg/BgPhoto.d.ts +0 -8
  89. package/Bg/BgPhoto.js +0 -16
  90. package/Bg/BgSvg.d.ts +0 -4
  91. package/Bg/BgSvg.js +0 -9
  92. package/Bg/index.d.ts +0 -3
  93. package/Bg/index.js +0 -3
  94. package/Breadcrumbs/Breadcrumbs.d.ts +0 -13
  95. package/Breadcrumbs/Breadcrumbs.js +0 -27
  96. package/Breadcrumbs/index.d.ts +0 -1
  97. package/Breadcrumbs/index.js +0 -1
  98. package/Buttons/Button.d.ts +0 -14
  99. package/Buttons/Button.js +0 -10
  100. package/Buttons/ButtonComposite.d.ts +0 -22
  101. package/Buttons/ButtonComposite.js +0 -28
  102. package/Buttons/ButtonFab.d.ts +0 -4
  103. package/Buttons/ButtonFab.js +0 -6
  104. package/Buttons/ButtonLink.d.ts +0 -8
  105. package/Buttons/ButtonLink.js +0 -11
  106. package/Buttons/IconButton.d.ts +0 -8
  107. package/Buttons/IconButton.js +0 -7
  108. package/Buttons/index.d.ts +0 -5
  109. package/Buttons/index.js +0 -5
  110. package/Calendar/CalendarDaygridCell.d.ts +0 -35
  111. package/Calendar/CalendarDaygridCell.js +0 -46
  112. package/Calendar/CalendarDaygridNav.d.ts +0 -27
  113. package/Calendar/CalendarDaygridNav.js +0 -24
  114. package/Calendar/CalendarDaygridTable.d.ts +0 -25
  115. package/Calendar/CalendarDaygridTable.js +0 -45
  116. package/Calendar/CalendarLegend.d.ts +0 -18
  117. package/Calendar/CalendarLegend.js +0 -9
  118. package/Calendar/calendar-api-google.d.ts +0 -10
  119. package/Calendar/calendar-api-google.js +0 -124
  120. package/Calendar/index.d.ts +0 -6
  121. package/Calendar/index.js +0 -6
  122. package/Calendar/types.d.ts +0 -62
  123. package/Calendar/types.js +0 -1
  124. package/Calendar/useCalendar.d.ts +0 -35
  125. package/Calendar/useCalendar.js +0 -176
  126. package/Calendar/utils.d.ts +0 -11
  127. package/Calendar/utils.js +0 -185
  128. package/Carousel/Carousel.d.ts +0 -1
  129. package/Carousel/Carousel.js +0 -1
  130. package/Carousel/CarouselCss.d.ts +0 -13
  131. package/Carousel/CarouselCss.js +0 -19
  132. package/Carousel/index.d.ts +0 -1
  133. package/Carousel/index.js +0 -1
  134. package/Collapsable/Collapsable.d.ts +0 -1
  135. package/Collapsable/Collapsable.js +0 -1
  136. package/Collapsable/CollapsableReach.d.ts +0 -0
  137. package/Collapsable/CollapsableReach.js +0 -1
  138. package/Collapsable/index.d.ts +0 -1
  139. package/Collapsable/index.js +0 -1
  140. package/Debug/Debug.d.ts +0 -4
  141. package/Debug/Debug.js +0 -9
  142. package/Debug/index.d.ts +0 -1
  143. package/Debug/index.js +0 -1
  144. package/Details/Details.d.ts +0 -398
  145. package/Details/Details.js +0 -52
  146. package/Details/index.d.ts +0 -1
  147. package/Details/index.js +0 -1
  148. package/Dialog/DialogMui.d.ts +0 -165
  149. package/Dialog/DialogMui.js +0 -39
  150. package/Dialog/css/bare.d.ts +0 -171
  151. package/Dialog/css/bare.js +0 -21
  152. package/Dialog/index.d.ts +0 -2
  153. package/Dialog/index.js +0 -1
  154. package/Dialog/m/bare.d.ts +0 -4
  155. package/Dialog/m/bare.js +0 -3
  156. package/Dialog/m/basic.d.ts +0 -4
  157. package/Dialog/m/basic.js +0 -28
  158. package/Dialog/m/index.d.ts +0 -2
  159. package/Dialog/m/index.js +0 -4
  160. package/Dialog/sc/bare.d.ts +0 -61
  161. package/Dialog/sc/bare.js +0 -31
  162. package/Dialog/sc/framer.d.ts +0 -24
  163. package/Dialog/sc/framer.js +0 -16
  164. package/Dialog/sc/framerMaterial.d.ts +0 -24
  165. package/Dialog/sc/framerMaterial.js +0 -16
  166. package/Dialog/sc/material.d.ts +0 -60
  167. package/Dialog/sc/material.js +0 -21
  168. package/Dialog/tw/bare.d.ts +0 -208
  169. package/Dialog/tw/bare.js +0 -29
  170. package/Dialog/tw/elegant.d.ts +0 -270
  171. package/Dialog/tw/elegant.js +0 -21
  172. package/Dialog/tw/framer.d.ts +0 -108
  173. package/Dialog/tw/framer.js +0 -16
  174. package/Dialog/tw/framerMaterial.d.ts +0 -164
  175. package/Dialog/tw/framerMaterial.js +0 -16
  176. package/Dialog/tw/material.d.ts +0 -270
  177. package/Dialog/tw/material.js +0 -21
  178. package/Editor/Editor--tiptap.d.ts +0 -9
  179. package/Editor/Editor--tiptap.js +0 -26
  180. package/Editor/components.d.ts +0 -5
  181. package/Editor/components.js +0 -10
  182. package/Editor/index.d.ts +0 -1
  183. package/Editor/index.js +0 -1
  184. package/FaviconTags.d.ts +0 -9
  185. package/FaviconTags.js +0 -6
  186. package/Form/Form.d.ts +0 -125
  187. package/Form/Form.js +0 -60
  188. package/Form/index.d.ts +0 -1
  189. package/Form/index.js +0 -1
  190. package/Form/sc/bare.d.ts +0 -57
  191. package/Form/sc/bare.js +0 -20
  192. package/Forms/Checkbox/Checkbox.d.ts +0 -7
  193. package/Forms/Checkbox/Checkbox.js +0 -15
  194. package/Forms/Checkbox/index.d.ts +0 -1
  195. package/Forms/Checkbox/index.js +0 -1
  196. package/Forms/Feedback/Feedback.d.ts +0 -5
  197. package/Forms/Feedback/Feedback.js +0 -9
  198. package/Forms/Feedback/index.d.ts +0 -1
  199. package/Forms/Feedback/index.js +0 -1
  200. package/Forms/Field/Field.d.ts +0 -18
  201. package/Forms/Field/Field.js +0 -25
  202. package/Forms/Field/FieldControl.d.ts +0 -14
  203. package/Forms/Field/FieldControl.js +0 -35
  204. package/Forms/Field/FieldHint.d.ts +0 -1
  205. package/Forms/Field/FieldHint.js +0 -4
  206. package/Forms/Field/index.d.ts +0 -2
  207. package/Forms/Field/index.js +0 -2
  208. package/Forms/Input/Input.d.ts +0 -8
  209. package/Forms/Input/Input.js +0 -16
  210. package/Forms/Input/index.d.ts +0 -1
  211. package/Forms/Input/index.js +0 -1
  212. package/Forms/InputGroup/InputGroup.d.ts +0 -12
  213. package/Forms/InputGroup/InputGroup.js +0 -15
  214. package/Forms/InputGroup/index.d.ts +0 -1
  215. package/Forms/InputGroup/index.js +0 -1
  216. package/Forms/Label/Label.d.ts +0 -3
  217. package/Forms/Label/Label.js +0 -6
  218. package/Forms/Label/index.d.ts +0 -1
  219. package/Forms/Label/index.js +0 -1
  220. package/Forms/Password/Password.d.ts +0 -4
  221. package/Forms/Password/Password.js +0 -17
  222. package/Forms/Password/index.d.ts +0 -1
  223. package/Forms/Password/index.js +0 -1
  224. package/Forms/Radio/Radio.d.ts +0 -11
  225. package/Forms/Radio/Radio.js +0 -25
  226. package/Forms/Radio/index.d.ts +0 -1
  227. package/Forms/Radio/index.js +0 -1
  228. package/Forms/Switch/Switch.d.ts +0 -5
  229. package/Forms/Switch/Switch.js +0 -17
  230. package/Forms/Switch/index.d.ts +0 -1
  231. package/Forms/Switch/index.js +0 -1
  232. package/Forms/Textarea/Textarea.d.ts +0 -4
  233. package/Forms/Textarea/Textarea.js +0 -12
  234. package/Forms/Textarea/TextareaRich.d.ts +0 -5
  235. package/Forms/Textarea/TextareaRich.js +0 -26
  236. package/Forms/Textarea/index.d.ts +0 -2
  237. package/Forms/Textarea/index.js +0 -2
  238. package/Forms/Toggle/Toggle-tailwind.d.ts +0 -0
  239. package/Forms/Toggle/Toggle-tailwind.js +0 -1
  240. package/Forms/Toggle/Toggle.d.ts +0 -18
  241. package/Forms/Toggle/Toggle.js +0 -25
  242. package/Forms/Toggle/index.d.ts +0 -1
  243. package/Forms/Toggle/index.js +0 -1
  244. package/Forms/Toggle/useToggle-tailwind.d.ts +0 -0
  245. package/Forms/Toggle/useToggle-tailwind.js +0 -1
  246. package/Forms/Toggle/useToggle.d.ts +0 -16
  247. package/Forms/Toggle/useToggle.js +0 -85
  248. package/Forms/antispam.d.ts +0 -27
  249. package/Forms/antispam.js +0 -29
  250. package/Forms/helpers.d.ts +0 -18
  251. package/Forms/helpers.js +0 -35
  252. package/Forms/index.d.ts +0 -15
  253. package/Forms/index.js +0 -15
  254. package/Forms/styles.d.ts +0 -9
  255. package/Forms/styles.js +0 -19
  256. package/Gauge/Gauge.d.ts +0 -4
  257. package/Gauge/Gauge.js +0 -1
  258. package/Grid/Grid.d.ts +0 -32
  259. package/Grid/Grid.js +0 -52
  260. package/Grid/index.d.ts +0 -1
  261. package/Grid/index.js +0 -1
  262. package/Hamburger/Hamburger.d.ts +0 -5
  263. package/Hamburger/Hamburger.js +0 -47
  264. package/Hamburger/index.d.ts +0 -1
  265. package/Hamburger/index.js +0 -1
  266. package/Header/index.d.ts +0 -1
  267. package/Header/index.js +0 -1
  268. package/Header/useHeader.d.ts +0 -20
  269. package/Header/useHeader.js +0 -32
  270. package/Hidden/Hidden.d.ts +0 -6
  271. package/Hidden/Hidden.js +0 -10
  272. package/Hidden/index.d.ts +0 -1
  273. package/Hidden/index.js +0 -1
  274. package/Img/index.d.ts +0 -1
  275. package/Img/index.js +0 -1
  276. package/Img/sc/bare.d.ts +0 -2
  277. package/Img/sc/bare.js +0 -4
  278. package/Img/types.d.ts +0 -9
  279. package/Img/types.js +0 -1
  280. package/Link/Link.d.ts +0 -3
  281. package/Link/Link.js +0 -4
  282. package/Link/LinkBlank.d.ts +0 -5
  283. package/Link/LinkBlank.js +0 -15
  284. package/Link/index.d.ts +0 -2
  285. package/Link/index.js +0 -2
  286. package/Menu/Menu.d.ts +0 -1
  287. package/Menu/Menu.js +0 -4
  288. package/Menu/MenuMui.d.ts +0 -0
  289. package/Menu/MenuMui.js +0 -1
  290. package/Menu/index.d.ts +0 -1
  291. package/Menu/index.js +0 -1
  292. package/MenuItem/MenuItem.d.ts +0 -1
  293. package/MenuItem/MenuItem.js +0 -4
  294. package/MenuItem/MenuItemMui.d.ts +0 -0
  295. package/MenuItem/MenuItemMui.js +0 -1
  296. package/MenuItem/index.d.ts +0 -1
  297. package/MenuItem/index.js +0 -1
  298. package/MenuItem/useMenuItem.d.ts +0 -9
  299. package/MenuItem/useMenuItem.js +0 -42
  300. package/Meta.d.ts +0 -5
  301. package/Meta.js +0 -6
  302. package/NoJs.d.ts +0 -3
  303. package/NoJs.js +0 -7
  304. package/Pagination/PaginationNav.d.ts +0 -14
  305. package/Pagination/PaginationNav.js +0 -48
  306. package/Pagination/PaginationResults.d.ts +0 -3
  307. package/Pagination/PaginationResults.js +0 -11
  308. package/Pagination/index.d.ts +0 -2
  309. package/Pagination/index.js +0 -2
  310. package/Pill/Pill.d.ts +0 -5
  311. package/Pill/Pill.js +0 -7
  312. package/Pill/index.d.ts +0 -1
  313. package/Pill/index.js +0 -1
  314. package/Polymorphic.js +0 -1
  315. package/Progress/ProgressCircular.d.ts +0 -13
  316. package/Progress/ProgressCircular.js +0 -12
  317. package/Progress/ProgressLinear.d.ts +0 -15
  318. package/Progress/ProgressLinear.js +0 -21
  319. package/Progress/ProgressOverlay.d.ts +0 -4
  320. package/Progress/ProgressOverlay.js +0 -23
  321. package/Progress/index.d.ts +0 -3
  322. package/Progress/index.js +0 -3
  323. package/Rating/Rating.d.ts +0 -27
  324. package/Rating/Rating.js +0 -43
  325. package/Rating/index.d.ts +0 -8
  326. package/Rating/index.js +0 -45
  327. package/Select/SelectDownshift.d.ts +0 -5
  328. package/Select/SelectDownshift.js +0 -1
  329. package/Select/components.d.ts +0 -6
  330. package/Select/components.js +0 -12
  331. package/Select/index.d.ts +0 -2
  332. package/Select/index.js +0 -1
  333. package/Sidebar/Sidebar.d.ts +0 -3
  334. package/Sidebar/Sidebar.js +0 -23
  335. package/Sidebar/index.d.ts +0 -1
  336. package/Sidebar/index.js +0 -1
  337. package/Spacing/Spacing.d.ts +0 -17
  338. package/Spacing/Spacing.js +0 -32
  339. package/Spacing/index.d.ts +0 -1
  340. package/Spacing/index.js +0 -1
  341. package/Sticky/Sticky.d.ts +0 -2
  342. package/Sticky/Sticky.js +0 -1
  343. package/Sticky/StickyCss.d.ts +0 -5
  344. package/Sticky/StickyCss.js +0 -6
  345. package/Sticky/index.d.ts +0 -1
  346. package/Sticky/index.js +0 -1
  347. package/Tabs/TabsMui.d.ts +0 -84
  348. package/Tabs/TabsMui.js +0 -30
  349. package/Tabs/index.d.ts +0 -1
  350. package/Tabs/index.js +0 -1
  351. package/Tabs/sc/bare.d.ts +0 -0
  352. package/Tabs/sc/bare.js +0 -1
  353. package/Tabs/tw/bare.d.ts +0 -85
  354. package/Tabs/tw/bare.js +0 -17
  355. package/Tabs/tw/material.d.ts +0 -118
  356. package/Tabs/tw/material.js +0 -19
  357. package/Tabs/useTabs.d.ts +0 -21
  358. package/Tabs/useTabs.js +0 -44
  359. package/Typography/CopyPasteVisible.d.ts +0 -1
  360. package/Typography/CopyPasteVisible.js +0 -4
  361. package/Typography/Native.d.ts +0 -10
  362. package/Typography/Native.js +0 -14
  363. package/Typography/ReadMore.d.ts +0 -10
  364. package/Typography/ReadMore.js +0 -42
  365. package/Typography/TextLoop.d.ts +0 -16
  366. package/Typography/TextLoop.js +0 -45
  367. package/Typography/TypeStairs.d.ts +0 -6
  368. package/Typography/TypeStairs.js +0 -42
  369. package/Typography/index.d.ts +0 -5
  370. package/Typography/index.js +0 -5
  371. package/calendar/CalendarDaygridCell.js +0 -48
  372. package/calendar/CalendarDaygridNav.js +0 -24
  373. package/calendar/CalendarDaygridTable.js +0 -45
  374. package/calendar/CalendarLegend.js +0 -9
  375. package/calendar/calendar-api-google.js +0 -124
  376. package/calendar/index.d.ts +0 -6
  377. package/calendar/index.js +0 -6
  378. package/calendar/types.js +0 -1
  379. package/calendar/useCalendar.js +0 -176
  380. package/calendar/utils.js +0 -185
  381. package/classed.d.ts +0 -8
  382. package/classed.js +0 -43
  383. package/createUseMediaQueryWidth.js +0 -39
  384. package/css/index.d.ts +0 -1
  385. package/css/index.js +0 -1
  386. package/extendComponent.js +0 -9
  387. package/forms/antispam.js +0 -29
  388. package/forms/index.d.ts +0 -1
  389. package/forms/index.js +0 -1
  390. package/index.js +0 -24
  391. package/m/MotionProvider.d.ts +0 -6
  392. package/m/MotionProvider.js +0 -7
  393. package/m/index.d.ts +0 -1
  394. package/m/index.js +0 -1
  395. package/m/lite.d.ts +0 -2
  396. package/m/lite.js +0 -2
  397. package/m/max.d.ts +0 -2
  398. package/m/max.js +0 -2
  399. package/mergeRefs.d.ts +0 -2
  400. package/mergeRefs.js +0 -13
  401. package/sc/index.d.ts +0 -29
  402. package/sc/index.js +0 -29
  403. package/scm/index.d.ts +0 -28
  404. package/scm/index.js +0 -28
  405. package/shared/index.d.ts +0 -7
  406. package/shared/index.js +0 -7
  407. package/styles/Body.d.ts +0 -2
  408. package/styles/Body.js +0 -5
  409. package/styles/Global.d.ts +0 -2
  410. package/styles/Global.js +0 -5
  411. package/styles/index.d.ts +0 -7
  412. package/styles/index.js +0 -7
  413. package/styles/media.d.ts +0 -18
  414. package/styles/media.js +0 -75
  415. package/styles/spacing.d.ts +0 -12
  416. package/styles/spacing.js +0 -45
  417. package/styles/styled.d.ts +0 -8
  418. package/styles/styled.js +0 -9
  419. package/styles/theme--vanilla.d.ts +0 -17
  420. package/styles/theme--vanilla.js +0 -47
  421. package/styles/theme.d.ts +0 -53
  422. package/styles/theme.js +0 -30
  423. package/tw/index.d.ts +0 -1
  424. package/tw/index.js +0 -1
  425. package/twm/index.d.ts +0 -1
  426. package/twm/index.js +0 -1
  427. package/types.js +0 -1
  428. package/typings.d.ts +0 -6
  429. package/useAsyncFn.js +0 -33
  430. package/useDateLocale.d.ts +0 -3
  431. package/useDateLocale.js +0 -28
  432. package/useFirstMountState.d.ts +0 -2
  433. package/useFirstMountState.js +0 -10
  434. package/useFixedOffset.d.ts +0 -2
  435. package/useFixedOffset.js +0 -42
  436. package/useFocus.d.ts +0 -2
  437. package/useFocus.js +0 -9
  438. package/useInterval.d.ts +0 -2
  439. package/useInterval.js +0 -22
  440. package/useIsomorphicLayoutEffect.d.ts +0 -3
  441. package/useIsomorphicLayoutEffect.js +0 -6
  442. package/useKeyUp.d.ts +0 -2
  443. package/useKeyUp.js +0 -18
  444. package/useMeasure.js +0 -130
  445. package/useMountedState.d.ts +0 -2
  446. package/useMountedState.js +0 -13
  447. package/useNavigateAway.d.ts +0 -3
  448. package/useNavigateAway.js +0 -25
  449. package/usePrevious.d.ts +0 -2
  450. package/usePrevious.js +0 -10
  451. package/usePreviousRef.d.ts +0 -2
  452. package/usePreviousRef.js +0 -9
  453. package/useReveal.js +0 -43
  454. package/useScrollPosition.d.ts +0 -7
  455. package/useScrollPosition.js +0 -61
  456. package/useScrollThreshold.d.ts +0 -2
  457. package/useScrollThreshold.js +0 -27
  458. package/useScrollTo.d.ts +0 -2
  459. package/useScrollTo.js +0 -20
  460. package/useSmoothScroll.d.ts +0 -2
  461. package/useSmoothScroll.js +0 -32
  462. package/useSpinDelay.d.ts +0 -2
  463. package/useSpinDelay.js +0 -39
  464. package/useTraceUpdate.d.ts +0 -2
  465. package/useTraceUpdate.js +0 -19
  466. package/useUpdateEffect.d.ts +0 -3
  467. package/useUpdateEffect.js +0 -11
  468. package/useWindowSize.d.ts +0 -3
  469. package/useWindowSize.js +0 -20
  470. /package/{Polymorphic.d.ts → utils/Polymorphic.d.ts} +0 -0
@@ -1,4 +0,0 @@
1
- import type { FormControl } from "../helpers.js";
2
- export declare const PasswordInputNative: any;
3
- export type PasswordProps = FormControl;
4
- export declare const Password: import("react").ForwardRefExoticComponent<Omit<PasswordProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
@@ -1,17 +0,0 @@
1
- import { __assign, __makeTemplateObject, __read, __rest } from "tslib";
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { forwardRef, useState } from "react";
4
- import { ImEyeBlocked as IconInvisible, ImEye as IconVisible, } from "react-icons/im";
5
- import styled from "styled-components";
6
- import { InputNative } from "../Input/Input.js";
7
- import { Label } from "../Label/Label.js";
8
- var ICON_WIDTH = "2em";
9
- var PasswordInputWrap = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
10
- export var PasswordInputNative = styled(InputNative)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n padding-right: ", ";\n"], ["\n position: relative;\n padding-right: ", ";\n"])), ICON_WIDTH);
11
- var PasswordIcon = styled.span(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n width: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n opacity: 0.5;\n"], ["\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n width: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n opacity: 0.5;\n"])), ICON_WIDTH);
12
- export var Password = forwardRef(function Password(_a, ref) {
13
- var register = _a.register, name = _a.name, label = _a.label, props = __rest(_a, ["register", "name", "label"]);
14
- var _b = __read(useState(false), 2), visible = _b[0], setVisible = _b[1];
15
- return (_jsxs(_Fragment, { children: [label && _jsx(Label, { children: label }), _jsxs(PasswordInputWrap, { children: [_jsx(PasswordInputNative, __assign({ type: visible ? "text" : "password", autoComplete: "new-password" }, (register ? register(name) : { name: name, ref: ref }), props)), _jsx(PasswordIcon, { onClick: function () { return setVisible(function (prev) { return !prev; }); }, children: visible ? _jsx(IconInvisible, {}) : _jsx(IconVisible, {}) })] })] }));
16
- });
17
- var templateObject_1, templateObject_2, templateObject_3;
@@ -1 +0,0 @@
1
- export * from "./Password.js";
@@ -1 +0,0 @@
1
- export * from "./Password.js";
@@ -1,11 +0,0 @@
1
- import type { Option } from "../../types.js";
2
- import { FormControl } from "../helpers";
3
- type RadioOptionProps = Omit<FormControl, "value"> & Option & {
4
- $ref: React.ForwardedRef<HTMLInputElement>;
5
- };
6
- export type RadioProps = Omit<FormControl, "value"> & {
7
- value?: string;
8
- options?: Pick<RadioOptionProps, "label" | "value">[];
9
- };
10
- export declare const Radio: import("react").ForwardRefExoticComponent<Omit<RadioProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
11
- export {};
@@ -1,25 +0,0 @@
1
- import { __assign, __makeTemplateObject, __rest } from "tslib";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { forwardRef } from "react";
4
- import styled from "styled-components";
5
- import { label } from "../Label/Label.js";
6
- import { Toggle, ToggleIndicatorSquared, ToggleLabel } from "../Toggle/index.js";
7
- import { InputInvisible } from "../styles.js";
8
- var RadioRoot = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
9
- var RadioLabel = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), label);
10
- var RadioOptionRoot = styled.label(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n padding: 0.05em;\n cursor: pointer;\n"], ["\n display: flex;\n align-items: center;\n padding: 0.05em;\n cursor: pointer;\n"])));
11
- var RadioToggle = styled(Toggle)(templateObject_4 || (templateObject_4 = __makeTemplateObject([""], [""])));
12
- var RadioIndicator = styled(ToggleIndicatorSquared)(templateObject_5 || (templateObject_5 = __makeTemplateObject([""], [""])));
13
- var RadioOptionLabel = styled(ToggleLabel)(templateObject_6 || (templateObject_6 = __makeTemplateObject([""], [""])));
14
- var RadioOption = forwardRef(function RadioOption(_a, ref) {
15
- var register = _a.register, name = _a.name, label = _a.label, $ref = _a.$ref, props = __rest(_a, ["register", "name", "label", "$ref"]);
16
- var inputProps = register ? register(name) : { name: name, ref: $ref || ref };
17
- return (_jsxs(RadioOptionRoot, { children: [_jsxs(RadioToggle, { children: [_jsx(InputInvisible, __assign({ type: "radio" }, inputProps, props)), _jsx(RadioIndicator, {})] }), _jsx(RadioOptionLabel, { children: label })] }));
18
- });
19
- export var Radio = forwardRef(function Radio(_a, ref) {
20
- var label = _a.label, options = _a.options, props = __rest(_a, ["label", "options"]);
21
- if (!options)
22
- return null;
23
- return (_jsxs(RadioRoot, { children: [label && _jsx(RadioLabel, { children: label }), options.map(function (option, idx) { return (_jsx(RadioOption, __assign({}, option, props, { "$ref": ref }), idx)); })] }));
24
- });
25
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
@@ -1 +0,0 @@
1
- export * from "./Radio.js";
@@ -1 +0,0 @@
1
- export * from "./Radio.js";
@@ -1,5 +0,0 @@
1
- import { UseToggleProps } from "../Toggle/useToggle.js";
2
- export declare const SwitchTrack: any;
3
- export declare const SwitchHandle: any;
4
- export type SwitchProps = UseToggleProps;
5
- export declare const Switch: import("react").ForwardRefExoticComponent<Omit<UseToggleProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
@@ -1,17 +0,0 @@
1
- import { __assign, __makeTemplateObject } from "tslib";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { forwardRef } from "react";
4
- import styled from "styled-components";
5
- import { stateFocus } from "../../styles/styled.js";
6
- import { CheckboxLabel, CheckboxRoot } from "../Checkbox/index.js";
7
- import { toggleBase } from "../Toggle/index.js";
8
- import { useToggle } from "../Toggle/useToggle.js";
9
- var SWITCH_GUTTER = 0.25;
10
- var SWITCH_HANDLE_SIZE = 1;
11
- export var SwitchTrack = styled.span(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n width: ", "em;\n height: ", "em;\n padding: ", "em;\n border-radius: ", "em;\n ", "\n\n input:focus ~ & {\n ", "\n }\n\n input:disabled ~ & {\n opacity: 0.5;\n cursor: not-allowed;\n }\n"], ["\n position: relative;\n width: ", "em;\n height: ", "em;\n padding: ", "em;\n border-radius: ", "em;\n ", "\n\n input:focus ~ & {\n ", "\n }\n\n input:disabled ~ & {\n opacity: 0.5;\n cursor: not-allowed;\n }\n"])), SWITCH_HANDLE_SIZE * 3, SWITCH_HANDLE_SIZE * 1.5, SWITCH_GUTTER, SWITCH_HANDLE_SIZE, toggleBase, stateFocus);
12
- export var SwitchHandle = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: absolute;\n width: ", "em;\n height: ", "em;\n left: ", "em;\n margin-top: -1px;\n /* border: 1px solid currentColor; */\n background: currentColor;\n opacity: 0.5;\n border-radius: 100%;\n transition: all 0.18s ease-in-out;\n\n input:checked + ", " & {\n opacity: 1;\n left: calc(100% - ", "em - ", "em);\n }\n"], ["\n position: absolute;\n width: ", "em;\n height: ", "em;\n left: ", "em;\n margin-top: -1px;\n /* border: 1px solid currentColor; */\n background: currentColor;\n opacity: 0.5;\n border-radius: 100%;\n transition: all 0.18s ease-in-out;\n\n input:checked + ", " & {\n opacity: 1;\n left: calc(100% - ", "em - ", "em);\n }\n"])), SWITCH_HANDLE_SIZE, SWITCH_HANDLE_SIZE, SWITCH_GUTTER, SwitchTrack, SWITCH_HANDLE_SIZE, SWITCH_GUTTER);
13
- export var Switch = forwardRef(function Switch(props, ref) {
14
- var _a = useToggle(props, ref), rootProps = _a.rootProps, Inputs = _a.Inputs, label = _a.label;
15
- return (_jsxs(CheckboxRoot, __assign({}, rootProps, { children: [Inputs, _jsx(SwitchTrack, { children: _jsx(SwitchHandle, {}) }), label && _jsx(CheckboxLabel, { children: label })] })));
16
- });
17
- var templateObject_1, templateObject_2;
@@ -1 +0,0 @@
1
- export * from "./Switch.js";
@@ -1 +0,0 @@
1
- export * from "./Switch.js";
@@ -1,4 +0,0 @@
1
- import { FormControl } from "../helpers.js";
2
- export declare const TextareaNative: any;
3
- export type TextareaProps = FormControl<"textarea">;
4
- export declare const Textarea: import("react").ForwardRefExoticComponent<Omit<TextareaProps, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
@@ -1,12 +0,0 @@
1
- import { __assign, __makeTemplateObject, __rest } from "tslib";
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { forwardRef } from "react";
4
- import styled from "styled-components";
5
- import { Label } from "../Label/Label.js";
6
- import { inputBase, inputFocus } from "../styles.js";
7
- export var TextareaNative = styled.textarea(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n ", "\n resize: vertical;\n"], ["\n ", "\n ", "\n resize: vertical;\n"])), inputBase, inputFocus);
8
- export var Textarea = forwardRef(function Textarea(_a, ref) {
9
- var register = _a.register, name = _a.name, label = _a.label, props = __rest(_a, ["register", "name", "label"]);
10
- return (_jsxs(_Fragment, { children: [label && _jsx(Label, { children: label }), _jsx(TextareaNative, __assign({}, (register ? register(name) : { name: name, ref: ref }), props))] }));
11
- });
12
- var templateObject_1;
@@ -1,5 +0,0 @@
1
- import { FormControl } from "../helpers.js";
2
- export type TextareaRichProps = FormControl<"textarea"> & {
3
- defaultValue?: string;
4
- };
5
- export declare const TextareaRich: import("react").ForwardRefExoticComponent<Omit<TextareaRichProps, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
@@ -1,26 +0,0 @@
1
- import { __assign, __makeTemplateObject, __rest } from "tslib";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { forwardRef } from "react";
4
- import styled from "styled-components";
5
- import { Editor } from "../../Editor/index.js";
6
- import { Label } from "../Label/Label.js";
7
- import { triggerOnChange } from "../helpers.js";
8
- var Root = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .ProseMirror {\n max-height: 160px;\n overflow: auto;\n }\n .EditorContent {\n position: relative;\n &:after {\n position: absolute;\n content: \"\";\n bottom: 0;\n left: 0;\n right: 16px; /* scrollbar width? */\n height: 3em;\n background: linear-gradient(0deg, white, white 33%, transparent);\n pointer-events: none;\n }\n }\n"], ["\n .ProseMirror {\n max-height: 160px;\n overflow: auto;\n }\n .EditorContent {\n position: relative;\n &:after {\n position: absolute;\n content: \"\";\n bottom: 0;\n left: 0;\n right: 16px; /* scrollbar width? */\n height: 3em;\n background: linear-gradient(0deg, white, white 33%, transparent);\n pointer-events: none;\n }\n }\n"])));
9
- export var TextareaRich = forwardRef(function TextareaRich(_a, ref) {
10
- var register = _a.register, setValue = _a.setValue, name = _a.name, label = _a.label, _b = _a.defaultValue, defaultValue = _b === void 0 ? "" : _b, onChange = _a.onChange, props = __rest(_a, ["register", "setValue", "name", "label", "defaultValue", "onChange"]);
11
- if (register)
12
- register(name);
13
- return (_jsxs(Root, { children: [label && _jsx(Label, { children: label }), _jsx(Editor, __assign({ options: {
14
- content: defaultValue,
15
- onUpdate: (onChange || setValue) && name
16
- ? function (_a) {
17
- var editor = _a.editor;
18
- var value = editor.getHTML();
19
- if (setValue)
20
- setValue(name, value);
21
- triggerOnChange(onChange, name, value);
22
- }
23
- : undefined,
24
- } }, props))] }));
25
- });
26
- var templateObject_1;
@@ -1,2 +0,0 @@
1
- export * from "./Textarea.js";
2
- export * from "./TextareaRich.js";
@@ -1,2 +0,0 @@
1
- export * from "./Textarea.js";
2
- export * from "./TextareaRich.js";
File without changes
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,18 +0,0 @@
1
- export declare const toggleBase = "\n border: 1px solid var(--forms-border-color);\n";
2
- export declare const toggleIndicatorBg = "\n display: inline-block;\n flex-shrink: 0;\n width: 100%;\n height: 100%;\n";
3
- export declare const toggleIndicatorBgShape: string;
4
- export declare const toggleIndicatorFg = "\n position: absolute;\n left: 0;\n width: 100%;\n height: 100%;\n fill: currentcolor;\n";
5
- export declare const Toggle: any;
6
- export declare const ToggleLabel: any;
7
- export declare const ToggleLabelSub: any;
8
- export declare const ToggleIndicatorHolder: any;
9
- export declare const ToggleIndicatorBgSquare: any;
10
- export declare const ToggleIndicatorBgCircle: any;
11
- export declare const ToggleIndicatorFg: any;
12
- export type ToggleIndicatorProps = unknown;
13
- export type ToggleIndicatorSquaredProps = ToggleIndicatorProps;
14
- export declare const ToggleIndicatorSquared: (props: ToggleIndicatorSquaredProps) => import("react/jsx-runtime").JSX.Element;
15
- export type ToggleIndicatorRoundedProps = ToggleIndicatorProps & {
16
- r?: number;
17
- };
18
- export declare const ToggleIndicatorRounded: ({ r, }: ToggleIndicatorRoundedProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,25 +0,0 @@
1
- import { __makeTemplateObject } from "tslib";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useId } from "react";
4
- import styled from "styled-components";
5
- import { stateFocus } from "../../styles/styled.js";
6
- export var toggleBase = "\n border: 1px solid var(--forms-border-color);\n";
7
- export var toggleIndicatorBg = "\n display: inline-block;\n flex-shrink: 0;\n width: 100%;\n height: 100%;\n";
8
- export var toggleIndicatorBgShape = "\n ".concat(toggleIndicatorBg, "\n fill: none;\n stroke-width: 2px;\n stroke: var(--forms-border-color);\n");
9
- export var toggleIndicatorFg = "\n position: absolute;\n left: 0;\n width: 100%;\n height: 100%;\n fill: currentcolor;\n";
10
- export var Toggle = styled.span(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 2em;\n height: 2em;\n margin: 0 -0.3em; /* rtl */\n padding: 0.3em;\n"], ["\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 2em;\n height: 2em;\n margin: 0 -0.3em; /* rtl */\n padding: 0.3em;\n"])));
11
- export var ToggleLabel = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-left: 0.6em; /* rtl */\n"], ["\n margin-left: 0.6em; /* rtl */\n"])));
12
- export var ToggleLabelSub = styled.small(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n opacity: 0.7;\n font-size: 0.7em;\n"], ["\n opacity: 0.7;\n font-size: 0.7em;\n"])));
13
- export var ToggleIndicatorHolder = styled.span(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: relative;\n display: flex;\n\n input:focus ~ & {\n ", "\n }\n"], ["\n position: relative;\n display: flex;\n\n input:focus ~ & {\n ", "\n }\n"])), stateFocus);
14
- export var ToggleIndicatorBgSquare = styled.svg(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), toggleIndicatorBgShape);
15
- export var ToggleIndicatorBgCircle = styled.svg(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), toggleIndicatorBgShape);
16
- export var ToggleIndicatorFg = styled.svg(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n ", "\n transform: scale(0);\n transition: transform 0.18s ease;\n\n input:checked + ", " & {\n transform: scale(1);\n }\n"], ["\n ", "\n transform: scale(0);\n transition: transform 0.18s ease;\n\n input:checked + ", " & {\n transform: scale(1);\n }\n"])), toggleIndicatorFg, ToggleIndicatorHolder);
17
- export var ToggleIndicatorSquared = function (props) {
18
- return (_jsxs(ToggleIndicatorHolder, { children: [_jsx(ToggleIndicatorBgSquare, { viewBox: "0 0 24 24", children: _jsx("rect", { width: "24", height: "24" }) }), _jsx(ToggleIndicatorFg, { viewBox: "0 0 24 24", children: _jsx("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" }) })] }));
19
- };
20
- export var ToggleIndicatorRounded = function (_a) {
21
- var _b = _a.r, r = _b === void 0 ? 6 : _b;
22
- var id = useId();
23
- return (_jsxs(ToggleIndicatorHolder, { children: [_jsxs(ToggleIndicatorBgCircle, { viewBox: "0 0 24 24", children: [_jsx("circle", { cy: "12", cx: "12", r: "12", id: "r_".concat(id), clipPath: "url(#c_".concat(id, ")") }), _jsx("clipPath", { id: "c_".concat(id), children: _jsx("use", { xlinkHref: "#r_".concat(id) }) })] }), _jsx(ToggleIndicatorFg, { viewBox: "0 0 24 24", children: _jsx("circle", { r: r, cx: "12", cy: "12" }) })] }));
24
- };
25
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
@@ -1 +0,0 @@
1
- export * from "./Toggle.js";
@@ -1 +0,0 @@
1
- export * from "./Toggle.js";
File without changes
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,16 +0,0 @@
1
- import type { Option } from "../../types.js";
2
- import { FormControl } from "../helpers";
3
- export type UseToggleProps = Omit<FormControl, "value"> & {
4
- value?: boolean;
5
- valueTrue?: string;
6
- valueFalse?: string;
7
- options?: Option[];
8
- };
9
- export declare function useToggle(props: UseToggleProps, ref: React.ForwardedRef<HTMLInputElement>): {
10
- Inputs: import("react/jsx-runtime").JSX.Element;
11
- rootProps: {
12
- htmlFor: string | undefined;
13
- };
14
- label: any;
15
- value: any;
16
- };
@@ -1,85 +0,0 @@
1
- import { __assign, __rest } from "tslib";
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useCallback, useMemo } from "react";
4
- import { useWatch } from "react-hook-form";
5
- import { InputInvisible } from "../styles.js";
6
- export function useToggle(props, ref) {
7
- var name = props.name, control = props.control, register = props.register, label = props.label, options = props.options, propValue = props.value, restProps = __rest(props, ["name", "control", "register", "label", "options", "value"]);
8
- var id = restProps.id, valueTrue = restProps.valueTrue, valueFalse = restProps.valueFalse, remainingInputProps = __rest(restProps, ["id", "valueTrue", "valueFalse"]);
9
- if (options) {
10
- valueTrue = options
11
- .filter(function (opt) { return opt.value === "true"; })[0]
12
- .label.toString();
13
- valueFalse = options
14
- .filter(function (opt) { return opt.value === "false"; })[0]
15
- .label.toString();
16
- }
17
- id = "switch-".concat(name);
18
- var idTrue = "".concat(id, "-true");
19
- var idFalse = "".concat(id, "-false");
20
- var isRadio = !!(valueTrue && valueFalse);
21
- var value = useWatch({
22
- name: name,
23
- control: control,
24
- });
25
- if (propValue) {
26
- value = propValue;
27
- }
28
- var inputProps = useMemo(function () {
29
- return register
30
- ? register(name)
31
- : control
32
- ? control.register(name)
33
- : {
34
- name: name,
35
- ref: ref,
36
- };
37
- }, [register, control, name, ref]);
38
- var handleKeyDown = useCallback(function (event) {
39
- if (event.key === " ") {
40
- event.preventDefault();
41
- event.stopPropagation();
42
- var firstInput = event.target;
43
- var next = firstInput.nextElementSibling;
44
- var prev = firstInput.previousElementSibling;
45
- var secondInput = (next === null || next === void 0 ? void 0 : next.tagName) === "INPUT" ? next : prev;
46
- var target = firstInput;
47
- if (firstInput.checked) {
48
- target = secondInput;
49
- }
50
- else {
51
- if (!secondInput.checked) {
52
- target =
53
- firstInput.value === valueTrue ? firstInput : secondInput;
54
- }
55
- }
56
- if (target)
57
- target.click();
58
- }
59
- }, [valueTrue]);
60
- var valueDependentProps = useMemo(function () { return ({
61
- rootProps: {
62
- htmlFor: isRadio
63
- ? !value || value === valueFalse
64
- ? idTrue
65
- : idFalse
66
- : id,
67
- },
68
- label: label ? label : value,
69
- value: value,
70
- }); }, [value, valueFalse, isRadio, id, idTrue, idFalse, label]);
71
- var Inputs = useMemo(function () {
72
- return isRadio ? (_jsxs(_Fragment, { children: [_jsx(InputInvisible, __assign({ id: idFalse }, inputProps, remainingInputProps, { onKeyDown: handleKeyDown, type: "radio", value: valueFalse })), _jsx(InputInvisible, __assign({ id: idTrue }, inputProps, remainingInputProps, { onKeyDown: handleKeyDown, type: "radio", value: valueTrue }))] })) : (_jsx(InputInvisible, __assign({ id: id, type: "checkbox" }, inputProps, remainingInputProps)));
73
- }, [
74
- inputProps,
75
- remainingInputProps,
76
- handleKeyDown,
77
- isRadio,
78
- idFalse,
79
- idTrue,
80
- valueFalse,
81
- valueTrue,
82
- id,
83
- ]);
84
- return __assign(__assign({}, valueDependentProps), { Inputs: Inputs });
85
- }
@@ -1,27 +0,0 @@
1
- import { type ObjectShape } from "@kuus/yup";
2
- export declare function encodeForm<T extends ObjectShape = {}>(validationRules: T): {
3
- encodedSchema: import("@kuus/yup").ObjectSchema<{
4
- [x: string]: T[keyof T] extends import("@kuus/yup").ISchema<any, any, any, any> ? T[keyof T]["__outputType"] : T[keyof T] extends {
5
- readonly key: string;
6
- readonly isContext: boolean;
7
- readonly isValue: boolean;
8
- readonly isSibling: boolean;
9
- readonly path: any;
10
- readonly getter: (data: unknown) => unknown;
11
- readonly map?: ((value: unknown) => infer T) | undefined;
12
- readonly __isYupRef: boolean;
13
- getValue(value: any, parent?: {} | undefined, context?: {} | undefined): infer T;
14
- cast(value: any, options?: {
15
- parent?: {} | undefined;
16
- context?: {} | undefined;
17
- } | undefined): infer T;
18
- resolve(): any;
19
- describe(): import("@kuus/yup").SchemaRefDescription;
20
- toString(): string;
21
- } ? T : unknown;
22
- }, import("@kuus/yup").AnyObject, {
23
- [x: string]: T[keyof T] extends import("@kuus/yup").ISchema<any, import("@kuus/yup").AnyObject, any, any> ? T[keyof T]["__default"] : undefined;
24
- }, "">;
25
- encodedNames: Record<keyof T, string>;
26
- };
27
- export declare function decodeForm<ReturnAs extends Record<string, unknown> = {}, FormData extends Record<string, unknown> = {}>(formData: FormData): ReturnAs;
package/Forms/antispam.js DELETED
@@ -1,29 +0,0 @@
1
- import { object } from "@kuus/yup";
2
- import { decode, encode, isUndefined } from "@koine/utils";
3
- export function encodeForm(validationRules) {
4
- var encoded = {};
5
- var encodedNames = {};
6
- for (var name_1 in validationRules) {
7
- if (!name_1.startsWith("_")) {
8
- var encodedName = encode(name_1);
9
- encoded[encodedName] = validationRules[name_1];
10
- encodedNames[name_1] = encodedName;
11
- }
12
- }
13
- var encodedSchema = object(encoded).required();
14
- return { encodedSchema: encodedSchema, encodedNames: encodedNames };
15
- }
16
- export function decodeForm(formData) {
17
- var json = {};
18
- for (var encodedName in formData) {
19
- var decodedName = decode(encodedName);
20
- if (encodedName.startsWith("_")) {
21
- json[encodedName.substring(1)] = formData[encodedName];
22
- }
23
- else if (!isUndefined(formData[encodedName]) &&
24
- formData[decodedName] === "") {
25
- json[decodedName] = formData[encodedName];
26
- }
27
- }
28
- return json;
29
- }
@@ -1,18 +0,0 @@
1
- import type { Control, UseFormRegister, UseFormSetValue } from "react-hook-form";
2
- import type { Option } from "../types";
3
- type FormControlNativeType = "input" | "select" | "textarea";
4
- type FormControlFieldValues = Record<string, any>;
5
- export type FormControlNative<T extends FormControlNativeType = "input"> = Omit<React.ComponentPropsWithRef<T>, "name">;
6
- export type FormControlProps<T extends FormControlFieldValues = any> = {
7
- label?: React.ReactNode;
8
- name: string;
9
- control?: Control<T>;
10
- register?: UseFormRegister<T>;
11
- setValue?: UseFormSetValue<T>;
12
- };
13
- export type FormControl<TControlType extends FormControlNativeType = "input", TFieldValues extends FormControlFieldValues = any> = FormControlNative<TControlType> & FormControlProps<TFieldValues>;
14
- export declare const normaliseOptions: (options?: (string | Option)[]) => Option[];
15
- export declare function defaultOptionsFilterFn(options: Option[], inputValue?: string): Option[];
16
- export declare function triggerOnChange<T extends HTMLElement = HTMLInputElement>(onChange?: React.ChangeEventHandler<T>, name?: string, value?: any): void;
17
- export declare function triggerChange(input: HTMLInputElement, value?: string): void;
18
- export {};
package/Forms/helpers.js DELETED
@@ -1,35 +0,0 @@
1
- import { isString, matchSorter } from "@koine/utils";
2
- export var normaliseOptions = function (options) {
3
- if (options === void 0) { options = []; }
4
- return options.map(function (option) {
5
- return isString(option)
6
- ? {
7
- label: option,
8
- value: option,
9
- }
10
- : option;
11
- });
12
- };
13
- export function defaultOptionsFilterFn(options, inputValue) {
14
- if (!inputValue) {
15
- return options;
16
- }
17
- return matchSorter(options, inputValue, { keys: ["value", "label"] });
18
- }
19
- export function triggerOnChange(onChange, name, value) {
20
- if (onChange)
21
- onChange({ target: { name: name, value: value } });
22
- }
23
- export function triggerChange(input, value) {
24
- var obj = window.Object;
25
- if (!obj) {
26
- if (process.env["NODE_ENV"] === "development") {
27
- console.warn("[@koine/react:Forms:triggerChange] window.Object does not exists, bailing.");
28
- }
29
- return;
30
- }
31
- var nativeInputValueSetter = obj.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value").set;
32
- nativeInputValueSetter.call(input, value);
33
- var inputEvent = new Event("input", { bubbles: true });
34
- input.dispatchEvent(inputEvent);
35
- }
package/Forms/index.d.ts DELETED
@@ -1,15 +0,0 @@
1
- export * from "./antispam.js";
2
- export * from "./Checkbox/index.js";
3
- export * from "./Input/index.js";
4
- export * from "./InputGroup/index.js";
5
- export * from "./Feedback/index.js";
6
- export * from "./Field/index.js";
7
- export * from "./InputGroup/index.js";
8
- export * from "./Label/index.js";
9
- export * from "./Password/index.js";
10
- export * from "./Radio/index.js";
11
- export * from "./Switch/index.js";
12
- export * from "./Textarea/index.js";
13
- export * from "./Toggle/index.js";
14
- export * from "./helpers.js";
15
- export * from "./styles.js";
package/Forms/index.js DELETED
@@ -1,15 +0,0 @@
1
- export * from "./antispam.js";
2
- export * from "./Checkbox/index.js";
3
- export * from "./Input/index.js";
4
- export * from "./InputGroup/index.js";
5
- export * from "./Feedback/index.js";
6
- export * from "./Field/index.js";
7
- export * from "./InputGroup/index.js";
8
- export * from "./Label/index.js";
9
- export * from "./Password/index.js";
10
- export * from "./Radio/index.js";
11
- export * from "./Switch/index.js";
12
- export * from "./Textarea/index.js";
13
- export * from "./Toggle/index.js";
14
- export * from "./helpers.js";
15
- export * from "./styles.js";
package/Forms/styles.d.ts DELETED
@@ -1,9 +0,0 @@
1
- export declare const InputInvisible: any;
2
- export declare const InputHoneypot: any;
3
- export declare const InputProgress: any;
4
- export declare const inputResetAutofill = "\n &:-webkit-autofill,\n &:-webkit-autofill:hover,\n &:-webkit-autofill:focus,\n &:-webkit-autofill:active {\n -webkit-background-clip: text;\n }\n";
5
- export declare const inputBorder = "\n border: 1px solid var(--forms-border-color);\n";
6
- export declare const inputPadding = "\n padding: var(--forms-gutter-y) var(--forms-gutter-x);\n";
7
- export declare const inputReset: string;
8
- export declare const inputBase: string;
9
- export declare const inputFocus: string;
package/Forms/styles.js DELETED
@@ -1,19 +0,0 @@
1
- import { __assign, __makeTemplateObject } from "tslib";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import styled from "styled-components";
4
- import { ProgressLinear } from "../Progress/ProgressLinear.js";
5
- import { invisible, stateFocus } from "../styles/styled.js";
6
- export var InputInvisible = styled.input(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), invisible);
7
- export var InputHoneypot = styled(InputInvisible).attrs({
8
- type: "text",
9
- autoComplete: "new-password",
10
- tabIndex: -1,
11
- })(templateObject_2 || (templateObject_2 = __makeTemplateObject([""], [""])));
12
- export var InputProgress = styled(function (p) { return (_jsx(ProgressLinear, __assign({ fg: "var(--accent300)", bg: "var(--accent400)" }, p))); })(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n"], ["\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n"])));
13
- export var inputResetAutofill = "\n &:-webkit-autofill,\n &:-webkit-autofill:hover,\n &:-webkit-autofill:focus,\n &:-webkit-autofill:active {\n -webkit-background-clip: text;\n }\n";
14
- export var inputBorder = "\n border: 1px solid var(--forms-border-color);\n";
15
- export var inputPadding = "\n padding: var(--forms-gutter-y) var(--forms-gutter-x);\n";
16
- export var inputReset = "\n width: 100%;\n min-height: 44px;\n ".concat(inputBorder, "\n ").concat(inputPadding, "\n");
17
- export var inputBase = "\n ".concat(inputReset, "\n ").concat(inputResetAutofill, "\n background: transparent;\n");
18
- export var inputFocus = "\n &:focus {\n outline: 0px;\n appearance: none;\n ".concat(stateFocus, "\n }\n");
19
- var templateObject_1, templateObject_2, templateObject_3;
package/Gauge/Gauge.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export type GaugeProps = {
2
- value: number;
3
- };
4
- export declare const Gauge: (_props: GaugeProps) => null;
package/Gauge/Gauge.js DELETED
@@ -1 +0,0 @@
1
- export var Gauge = function (_props) { return null; };
package/Grid/Grid.d.ts DELETED
@@ -1,32 +0,0 @@
1
- import { CSSProperties } from "styled-components";
2
- import type { Breakpoint, Theme } from "../styles/theme.js";
3
- export declare const GRID_COLUMNS = 12;
4
- export declare const GRID_GUTTER_DEFAULT: keyof Theme["gutter"];
5
- export type GridProps = {
6
- $gutter?: keyof Theme["gutter"];
7
- };
8
- export type ContainerProps = React.PropsWithChildren<GridProps & {
9
- size: Breakpoint;
10
- clamp?: boolean;
11
- }>;
12
- export declare const Container: any;
13
- export type ContainerFluidProps = React.PropsWithChildren<GridProps & {
14
- size: Breakpoint;
15
- }>;
16
- export declare const ContainerFluid: any;
17
- type Direction = "min" | "max";
18
- export type RowProps = GridProps & {
19
- $valign?: CSSProperties["alignItems"];
20
- $reverse?: `${Direction}:${Breakpoint}`;
21
- $noWrap?: boolean;
22
- };
23
- export declare const Row: any;
24
- export type ColProps = GridProps & Partial<Record<Breakpoint, number>> & {
25
- $width?: number;
26
- $flex?: boolean;
27
- $valign?: React.CSSProperties["alignItems"];
28
- $auto?: boolean;
29
- $offset?: string;
30
- };
31
- export declare const Col: any;
32
- export {};
package/Grid/Grid.js DELETED
@@ -1,52 +0,0 @@
1
- import { __makeTemplateObject, __read } from "tslib";
2
- import styled from "styled-components";
3
- export var GRID_COLUMNS = 12;
4
- export var GRID_GUTTER_DEFAULT = "half";
5
- export var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n max-width: ", "px;\n margin: 0 auto;\n padding: 0 ", "px;\n ", "\n"], ["\n max-width: ", "px;\n margin: 0 auto;\n padding: 0 ", "px;\n ", "\n"])), function (p) { return p.theme.breakpoints[p.size]; }, function (p) { return p.theme.gutter[p.$gutter || GRID_GUTTER_DEFAULT]; }, function (p) { return (p.clamp ? "overflow: hidden;" : ""); });
6
- export var ContainerFluid = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 0 ", "px;\n"], ["\n padding: 0 ", "px;\n"])), function (p) { return p.theme.gutter[p.$gutter || GRID_GUTTER_DEFAULT]; });
7
- export var Row = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n margin: 0 -", "px;\n display: flex;\n ", "\n ", ";\n ", "\n"], ["\n margin: 0 -", "px;\n display: flex;\n ", "\n ", ";\n ", "\n"])), function (p) { return p.theme.gutter[p.$gutter || GRID_GUTTER_DEFAULT]; }, function (p) { return (p.$noWrap ? "overflow: auto;" : "flex-wrap: wrap;"); }, function (p) { return (p.$valign ? "align-items: ".concat(p.$valign) : ""); }, function (p) {
8
- return p.$reverse &&
9
- "@media (".concat(p.$reverse.split(":")[0], "-width: ").concat(p.$reverse.split(":")[1], "px) {\n flex-direction: row-reverse;\n }");
10
- });
11
- export var Col = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n padding: 0 ", "px;\n display: ", ";\n ", ";\n ", ";\n"], ["\n padding: 0 ", "px;\n display: ", ";\n ", ";\n ", ";\n"])), function (p) { return p.theme.gutter[p.$gutter || GRID_GUTTER_DEFAULT]; }, function (p) { return (p.$flex ? "flex" : "block"); }, function (p) { return (p.$valign ? "align-items: " + p.$valign : ""); }, function (p) { return getColCss(p); });
12
- function getColWidth(breakpoints, breakpoint, value) {
13
- var breakpointValue = breakpoints[breakpoint] + "px";
14
- var width = (value * 100) / GRID_COLUMNS;
15
- var cssValue = "\n min-width: ".concat(width, "%;\n flex: 0 0 ").concat(width, "%;\n");
16
- if (breakpoint === Object.keys(breakpoints)[0]) {
17
- return cssValue;
18
- }
19
- return "\n @media (min-width: ".concat(breakpointValue, "){\n ").concat(cssValue, "\n }");
20
- }
21
- function getColCss(props) {
22
- var $auto = props.$auto, $offset = props.$offset, $width = props.$width;
23
- var breakpoints = props.theme.breakpoints;
24
- var css = "";
25
- if ($offset) {
26
- var offsets = $offset.split(",");
27
- for (var i = 0; i <= offsets.length; i++) {
28
- if (offsets[i]) {
29
- var _a = __read(offsets[i].split(":"), 2), offsetBreakpoint = _a[0], offsetSize = _a[1];
30
- css += " \n @media(min-width: ".concat(breakpoints[offsetBreakpoint], "px){\n margin-left: ").concat((100 * offsetSize) / GRID_COLUMNS, "%;\n }\n ");
31
- }
32
- }
33
- }
34
- if ($width) {
35
- }
36
- else if ($auto) {
37
- css += "flex: 0 0 auto; width: auto; max-width: none;";
38
- }
39
- else {
40
- for (var breakpoint in breakpoints) {
41
- var value = props[breakpoint];
42
- if (typeof value !== "undefined") {
43
- css += getColWidth(breakpoints, breakpoint, value);
44
- }
45
- else if (breakpoint === "xs") {
46
- css += getColWidth(breakpoints, breakpoint, 12);
47
- }
48
- }
49
- }
50
- return css;
51
- }
52
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4;