@koine/react 1.1.10 → 1.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (656) hide show
  1. package/Alert/Alert.js +12 -8
  2. package/Alert/Alert.mjs +10 -0
  3. package/Alert/index.js +4 -1
  4. package/Alert/index.mjs +1 -0
  5. package/Alert/package.json +2 -2
  6. package/Animations/Reveal.js +18 -14
  7. package/Animations/Reveal.mjs +17 -0
  8. package/Animations/Underline.js +7 -4
  9. package/Animations/Underline.mjs +5 -0
  10. package/Animations/index.js +6 -3
  11. package/Animations/index.mjs +3 -0
  12. package/Animations/package.json +2 -2
  13. package/Animations/useReveal.js +11 -7
  14. package/{node/Animations/useReveal.js → Animations/useReveal.mjs} +7 -11
  15. package/Autocomplete/AutocompleteDownshift.js +4 -1
  16. package/{node/Autocomplete/AutocompleteDownshift.js → Autocomplete/AutocompleteDownshift.mjs} +1 -4
  17. package/Autocomplete/AutocompleteDownshiftMultiselect.js +4 -1
  18. package/{node/Autocomplete/AutocompleteDownshiftMultiselect.js → Autocomplete/AutocompleteDownshiftMultiselect.mjs} +1 -4
  19. package/Autocomplete/AutocompleteMui.js +33 -35
  20. package/{node/Autocomplete/AutocompleteMui.js → Autocomplete/AutocompleteMui.mjs} +35 -33
  21. package/Autocomplete/AutocompleteReach.js +4 -1
  22. package/{node/Autocomplete/AutocompleteReach.js → Autocomplete/AutocompleteReach.mjs} +1 -4
  23. package/Autocomplete/components.js +25 -22
  24. package/Autocomplete/components.mjs +34 -0
  25. package/Autocomplete/helpers.js +11 -6
  26. package/{node/Autocomplete/helpers.js → Autocomplete/helpers.mjs} +6 -11
  27. package/Autocomplete/index.js +5 -1
  28. package/Autocomplete/index.mjs +3 -0
  29. package/Autocomplete/package.json +2 -2
  30. package/Bg/BgColor.js +14 -10
  31. package/Bg/BgColor.mjs +21 -0
  32. package/Bg/BgPhoto.js +13 -9
  33. package/Bg/BgPhoto.mjs +16 -0
  34. package/Bg/BgSvg.js +10 -6
  35. package/Bg/BgSvg.mjs +12 -0
  36. package/Bg/index.js +6 -3
  37. package/Bg/index.mjs +3 -0
  38. package/Bg/package.json +2 -2
  39. package/Breadcrumbs/Breadcrumbs.js +22 -18
  40. package/Breadcrumbs/Breadcrumbs.mjs +27 -0
  41. package/Breadcrumbs/index.js +4 -1
  42. package/Breadcrumbs/index.mjs +1 -0
  43. package/Breadcrumbs/package.json +2 -2
  44. package/Buttons/Button.js +12 -9
  45. package/Buttons/Button.mjs +14 -0
  46. package/Buttons/ButtonComposite.js +20 -16
  47. package/Buttons/ButtonComposite.mjs +28 -0
  48. package/Buttons/ButtonFab.js +8 -5
  49. package/Buttons/ButtonFab.mjs +6 -0
  50. package/Buttons/ButtonLink.js +12 -8
  51. package/Buttons/ButtonLink.mjs +11 -0
  52. package/Buttons/IconButton.js +9 -6
  53. package/Buttons/IconButton.mjs +7 -0
  54. package/Buttons/index.js +8 -5
  55. package/Buttons/index.mjs +5 -0
  56. package/Buttons/package.json +2 -2
  57. package/Calendar/CalendarDaygridCell.js +16 -12
  58. package/{node/Calendar/CalendarDaygridCell.js → Calendar/CalendarDaygridCell.mjs} +12 -16
  59. package/Calendar/CalendarDaygridNav.js +14 -9
  60. package/Calendar/CalendarDaygridNav.mjs +23 -0
  61. package/Calendar/CalendarDaygridTable.js +23 -19
  62. package/{node/Calendar/CalendarDaygridTable.js → Calendar/CalendarDaygridTable.mjs} +19 -23
  63. package/Calendar/CalendarLegend.js +9 -5
  64. package/Calendar/CalendarLegend.mjs +16 -0
  65. package/Calendar/calendar-api-google.js +27 -23
  66. package/{node/Calendar/calendar-api-google.js → Calendar/calendar-api-google.mjs} +23 -27
  67. package/Calendar/index.js +9 -6
  68. package/Calendar/index.mjs +6 -0
  69. package/Calendar/package.json +2 -2
  70. package/Calendar/types.js +2 -1
  71. package/Calendar/types.mjs +1 -0
  72. package/Calendar/useCalendar.js +43 -39
  73. package/{node/Calendar/useCalendar.js → Calendar/useCalendar.mjs} +39 -43
  74. package/Calendar/utils.js +44 -31
  75. package/{node/Calendar/utils.js → Calendar/utils.mjs} +31 -44
  76. package/Carousel/Carousel.js +4 -1
  77. package/{node/Carousel/Carousel.js → Carousel/Carousel.mjs} +1 -4
  78. package/Carousel/CarouselCss.d.ts +6 -1
  79. package/Carousel/CarouselCss.js +17 -13
  80. package/Carousel/CarouselCss.mjs +22 -0
  81. package/Carousel/index.js +4 -1
  82. package/Carousel/index.mjs +1 -0
  83. package/Carousel/package.json +2 -2
  84. package/Collapsable/Collapsable.js +4 -1
  85. package/Collapsable/Collapsable.mjs +1 -0
  86. package/{node/Collapsable/CollapsableReach.js → Collapsable/CollapsableReach.mjs} +0 -0
  87. package/Collapsable/index.js +4 -1
  88. package/Collapsable/index.mjs +2 -0
  89. package/Collapsable/package.json +2 -2
  90. package/Debug/Debug.js +10 -6
  91. package/Debug/Debug.mjs +9 -0
  92. package/Debug/index.js +4 -1
  93. package/Debug/index.mjs +1 -0
  94. package/Debug/package.json +2 -2
  95. package/Details/Details.d.ts +298 -13
  96. package/Details/Details.js +30 -27
  97. package/Details/Details.mjs +63 -0
  98. package/Details/index.js +4 -1
  99. package/Details/index.mjs +1 -0
  100. package/Details/package.json +2 -2
  101. package/Dialog/DialogMui.d.ts +328 -19
  102. package/Dialog/DialogMui.js +28 -25
  103. package/{node/Dialog/DialogMui.js → Dialog/DialogMui.mjs} +25 -28
  104. package/Dialog/css/bare.d.ts +352 -43
  105. package/Dialog/css/bare.js +21 -18
  106. package/Dialog/css/bare.mjs +21 -0
  107. package/Dialog/index.js +5 -1
  108. package/Dialog/index.mjs +1 -0
  109. package/Dialog/m/bare.d.ts +322 -13
  110. package/Dialog/m/bare.js +26 -23
  111. package/Dialog/m/bare.mjs +52 -0
  112. package/Dialog/m/basic.js +7 -3
  113. package/{node/Dialog/m/basic.js → Dialog/m/basic.mjs} +3 -7
  114. package/Dialog/m/index.js +7 -3
  115. package/Dialog/m/index.mjs +4 -0
  116. package/Dialog/m/package.json +2 -2
  117. package/Dialog/package.json +2 -2
  118. package/Dialog/sc/bare.d.ts +325 -17
  119. package/Dialog/sc/bare.js +24 -21
  120. package/Dialog/sc/bare.mjs +43 -0
  121. package/Dialog/sc/framer.d.ts +316 -7
  122. package/Dialog/sc/framer.js +18 -15
  123. package/Dialog/sc/framer.mjs +16 -0
  124. package/Dialog/sc/framerMaterial.d.ts +316 -7
  125. package/Dialog/sc/framerMaterial.js +18 -15
  126. package/Dialog/sc/framerMaterial.mjs +16 -0
  127. package/Dialog/sc/material.d.ts +325 -16
  128. package/Dialog/sc/material.js +22 -19
  129. package/Dialog/sc/material.mjs +21 -0
  130. package/Dialog/tw/bare.d.ts +358 -49
  131. package/Dialog/tw/bare.js +21 -18
  132. package/Dialog/tw/bare.mjs +42 -0
  133. package/Dialog/tw/elegant.d.ts +379 -70
  134. package/Dialog/tw/elegant.js +21 -18
  135. package/Dialog/tw/elegant.mjs +20 -0
  136. package/Dialog/tw/framer.d.ts +340 -31
  137. package/Dialog/tw/framer.js +18 -15
  138. package/Dialog/tw/framer.mjs +16 -0
  139. package/Dialog/tw/framerMaterial.d.ts +356 -47
  140. package/Dialog/tw/framerMaterial.js +18 -15
  141. package/Dialog/tw/framerMaterial.mjs +16 -0
  142. package/Dialog/tw/material.d.ts +379 -70
  143. package/Dialog/tw/material.js +21 -18
  144. package/Dialog/tw/material.mjs +20 -0
  145. package/Editor/Editor--tiptap.js +20 -15
  146. package/Editor/Editor--tiptap.mjs +26 -0
  147. package/Editor/components.js +14 -9
  148. package/Editor/components.mjs +10 -0
  149. package/Editor/index.js +4 -1
  150. package/Editor/index.mjs +1 -0
  151. package/Editor/package.json +2 -2
  152. package/FaviconTags/FaviconTags.js +8 -4
  153. package/FaviconTags/FaviconTags.mjs +16 -0
  154. package/FaviconTags/index.js +7 -2
  155. package/FaviconTags/index.mjs +2 -0
  156. package/FaviconTags/package.json +2 -2
  157. package/Form/Form.d.ts +45 -19
  158. package/Form/Form.js +27 -23
  159. package/Form/Form.mjs +61 -0
  160. package/Form/index.js +4 -1
  161. package/Form/index.mjs +1 -0
  162. package/Form/package.json +2 -2
  163. package/Form/sc/bare.d.ts +33 -8
  164. package/Form/sc/bare.js +21 -18
  165. package/Form/sc/bare.mjs +20 -0
  166. package/Forms/Checkbox/Checkbox.d.ts +1 -1
  167. package/Forms/Checkbox/Checkbox.js +16 -13
  168. package/Forms/Checkbox/Checkbox.mjs +18 -0
  169. package/Forms/Checkbox/index.js +4 -1
  170. package/Forms/Checkbox/index.mjs +1 -0
  171. package/Forms/Checkbox/package.json +2 -2
  172. package/Forms/Feedback/Feedback.js +10 -6
  173. package/Forms/Feedback/Feedback.mjs +9 -0
  174. package/Forms/Feedback/index.js +4 -1
  175. package/Forms/Feedback/index.mjs +1 -0
  176. package/Forms/Feedback/package.json +2 -2
  177. package/Forms/Field/Field.js +14 -10
  178. package/Forms/Field/Field.mjs +31 -0
  179. package/Forms/Field/FieldControl.js +18 -14
  180. package/Forms/Field/FieldControl.mjs +47 -0
  181. package/Forms/Field/FieldHint.js +6 -3
  182. package/Forms/Field/FieldHint.mjs +4 -0
  183. package/Forms/Field/index.js +5 -2
  184. package/Forms/Field/index.mjs +2 -0
  185. package/Forms/Field/package.json +2 -2
  186. package/Forms/Input/Input.d.ts +1 -1
  187. package/Forms/Input/Input.js +17 -14
  188. package/Forms/Input/Input.mjs +17 -0
  189. package/Forms/Input/index.js +4 -1
  190. package/Forms/Input/index.mjs +1 -0
  191. package/Forms/Input/package.json +2 -2
  192. package/Forms/InputGroup/InputGroup.js +17 -13
  193. package/Forms/InputGroup/InputGroup.mjs +15 -0
  194. package/Forms/InputGroup/index.js +4 -1
  195. package/Forms/InputGroup/index.mjs +1 -0
  196. package/Forms/InputGroup/package.json +2 -2
  197. package/Forms/Label/Label.js +8 -5
  198. package/Forms/Label/Label.mjs +6 -0
  199. package/Forms/Label/index.js +4 -1
  200. package/Forms/Label/index.mjs +1 -0
  201. package/Forms/Label/package.json +2 -2
  202. package/Forms/Password/Password.d.ts +1 -1
  203. package/Forms/Password/Password.js +17 -14
  204. package/Forms/Password/Password.mjs +17 -0
  205. package/Forms/Password/index.js +4 -1
  206. package/Forms/Password/index.mjs +1 -0
  207. package/Forms/Password/package.json +2 -2
  208. package/Forms/Radio/Radio.d.ts +1 -1
  209. package/Forms/Radio/Radio.js +22 -19
  210. package/Forms/Radio/Radio.mjs +25 -0
  211. package/Forms/Radio/index.js +4 -1
  212. package/Forms/Radio/index.mjs +1 -0
  213. package/Forms/Radio/package.json +2 -2
  214. package/Forms/Switch/Switch.d.ts +1 -1
  215. package/Forms/Switch/Switch.js +16 -13
  216. package/Forms/Switch/Switch.mjs +20 -0
  217. package/Forms/Switch/index.js +4 -1
  218. package/Forms/Switch/index.mjs +1 -0
  219. package/Forms/Switch/package.json +2 -2
  220. package/Forms/Textarea/Textarea.d.ts +1 -1
  221. package/Forms/Textarea/Textarea.js +13 -10
  222. package/Forms/Textarea/Textarea.mjs +12 -0
  223. package/Forms/Textarea/TextareaRich.d.ts +1 -1
  224. package/Forms/Textarea/TextareaRich.js +15 -12
  225. package/Forms/Textarea/TextareaRich.mjs +28 -0
  226. package/Forms/Textarea/index.js +5 -2
  227. package/Forms/Textarea/index.mjs +2 -0
  228. package/Forms/Textarea/package.json +2 -2
  229. package/{node/Forms/Toggle/Toggle-tailwind.js → Forms/Toggle/Toggle-tailwind.mjs} +0 -0
  230. package/Forms/Toggle/Toggle.js +26 -21
  231. package/Forms/Toggle/Toggle.mjs +31 -0
  232. package/Forms/Toggle/index.js +4 -1
  233. package/Forms/Toggle/index.mjs +1 -0
  234. package/Forms/Toggle/package.json +2 -2
  235. package/{node/Forms/Toggle/useToggle-tailwind.js → Forms/Toggle/useToggle-tailwind.mjs} +0 -0
  236. package/Forms/Toggle/useToggle.js +19 -15
  237. package/{node/Forms/Toggle/useToggle.js → Forms/Toggle/useToggle.mjs} +15 -19
  238. package/Forms/antispam.js +16 -10
  239. package/{node/Forms/antispam.js → Forms/antispam.mjs} +10 -16
  240. package/Forms/helpers.js +16 -8
  241. package/{node/Forms/helpers.js → Forms/helpers.mjs} +8 -16
  242. package/Forms/index.js +18 -15
  243. package/Forms/index.mjs +16 -0
  244. package/Forms/package.json +2 -2
  245. package/Forms/styles.js +19 -16
  246. package/Forms/styles.mjs +29 -0
  247. package/Gauge/Gauge.js +5 -1
  248. package/{node/Gauge/Gauge.js → Gauge/Gauge.mjs} +1 -5
  249. package/Grid/Grid.js +13 -10
  250. package/Grid/Grid.mjs +53 -0
  251. package/Grid/index.js +4 -1
  252. package/Grid/index.mjs +1 -0
  253. package/Grid/package.json +2 -2
  254. package/Hamburger/Hamburger.js +11 -7
  255. package/Hamburger/Hamburger.mjs +52 -0
  256. package/Hamburger/index.js +4 -1
  257. package/Hamburger/index.mjs +1 -0
  258. package/Hamburger/package.json +2 -2
  259. package/Header/index.js +4 -1
  260. package/Header/index.mjs +1 -0
  261. package/Header/package.json +2 -2
  262. package/Header/useHeader.js +18 -14
  263. package/Header/useHeader.mjs +31 -0
  264. package/Hidden/Hidden.js +6 -3
  265. package/Hidden/Hidden.mjs +10 -0
  266. package/Hidden/index.js +4 -1
  267. package/Hidden/index.mjs +1 -0
  268. package/Hidden/package.json +2 -2
  269. package/Img/index.js +4 -1
  270. package/Img/index.mjs +1 -0
  271. package/Img/package.json +2 -2
  272. package/Img/sc/bare.js +6 -3
  273. package/{node/Img/sc/bare.js → Img/sc/bare.mjs} +3 -6
  274. package/Img/types.js +2 -1
  275. package/Img/types.mjs +1 -0
  276. package/Link/Link.d.ts +1 -1
  277. package/Link/Link.js +6 -3
  278. package/Link/Link.mjs +4 -0
  279. package/Link/LinkBlank.js +15 -11
  280. package/Link/LinkBlank.mjs +17 -0
  281. package/Link/index.js +5 -2
  282. package/Link/index.mjs +2 -0
  283. package/Link/package.json +2 -2
  284. package/Menu/Menu.js +6 -3
  285. package/Menu/Menu.mjs +4 -0
  286. package/Menu/MenuMui.d.ts +0 -35
  287. package/Menu/MenuMui.js +165 -75
  288. package/Menu/MenuMui.mjs +165 -0
  289. package/Menu/index.js +4 -1
  290. package/Menu/index.mjs +1 -0
  291. package/Menu/package.json +2 -2
  292. package/MenuItem/MenuItem.js +6 -3
  293. package/MenuItem/MenuItem.mjs +4 -0
  294. package/MenuItem/MenuItemMui.d.ts +0 -6
  295. package/MenuItem/MenuItemMui.js +32 -15
  296. package/MenuItem/MenuItemMui.mjs +32 -0
  297. package/MenuItem/index.js +4 -1
  298. package/MenuItem/index.mjs +1 -0
  299. package/MenuItem/package.json +2 -2
  300. package/MenuItem/useMenuItem.js +20 -16
  301. package/{node/MenuItem/useMenuItem.js → MenuItem/useMenuItem.mjs} +16 -20
  302. package/Meta/Meta.js +8 -4
  303. package/Meta/Meta.mjs +6 -0
  304. package/Meta/index.js +7 -2
  305. package/Meta/index.mjs +2 -0
  306. package/Meta/package.json +2 -2
  307. package/NoJs/NoJs.js +8 -4
  308. package/NoJs/NoJs.mjs +7 -0
  309. package/NoJs/index.js +7 -2
  310. package/NoJs/index.mjs +2 -0
  311. package/NoJs/package.json +2 -2
  312. package/Pagination/PaginationNav.js +22 -18
  313. package/Pagination/PaginationNav.mjs +61 -0
  314. package/Pagination/PaginationResults.js +12 -8
  315. package/Pagination/PaginationResults.mjs +11 -0
  316. package/Pagination/index.js +5 -2
  317. package/Pagination/index.mjs +2 -0
  318. package/Pagination/package.json +2 -2
  319. package/Pill/Pill.js +9 -6
  320. package/Pill/Pill.mjs +7 -0
  321. package/Pill/index.js +4 -1
  322. package/Pill/index.mjs +1 -0
  323. package/Pill/package.json +2 -2
  324. package/Progress/ProgressCircular.js +14 -10
  325. package/Progress/ProgressCircular.mjs +15 -0
  326. package/Progress/ProgressLinear.js +13 -9
  327. package/Progress/ProgressLinear.mjs +24 -0
  328. package/Progress/ProgressOverlay.js +20 -16
  329. package/Progress/ProgressOverlay.mjs +24 -0
  330. package/Progress/index.js +6 -3
  331. package/Progress/index.mjs +3 -0
  332. package/Progress/package.json +2 -2
  333. package/Rating/Rating.js +26 -21
  334. package/Rating/Rating.mjs +70 -0
  335. package/Rating/index.js +13 -5
  336. package/{node/Rating/index.js → Rating/index.mjs} +5 -13
  337. package/Rating/package.json +2 -2
  338. package/Select/SelectDownshift.js +4 -1
  339. package/{node/Select/SelectDownshift.js → Select/SelectDownshift.mjs} +1 -4
  340. package/Select/components.js +13 -10
  341. package/Select/components.mjs +12 -0
  342. package/Select/index.js +5 -1
  343. package/Select/index.mjs +3 -0
  344. package/Select/package.json +2 -2
  345. package/Sidebar/Sidebar.js +21 -17
  346. package/Sidebar/Sidebar.mjs +23 -0
  347. package/Sidebar/index.js +4 -1
  348. package/Sidebar/index.mjs +1 -0
  349. package/Sidebar/package.json +2 -2
  350. package/Spacing/Spacing.js +15 -11
  351. package/Spacing/Spacing.mjs +45 -0
  352. package/Spacing/index.js +4 -1
  353. package/Spacing/index.mjs +1 -0
  354. package/Spacing/package.json +2 -2
  355. package/Sticky/Sticky.js +4 -1
  356. package/{node/Sticky/Sticky.js → Sticky/Sticky.mjs} +1 -4
  357. package/Sticky/StickyCss.js +9 -5
  358. package/Sticky/StickyCss.mjs +6 -0
  359. package/Sticky/index.js +4 -1
  360. package/Sticky/index.mjs +1 -0
  361. package/Sticky/package.json +2 -2
  362. package/Tabs/TabsMui.d.ts +287 -55
  363. package/Tabs/TabsMui.js +28 -25
  364. package/Tabs/TabsMui.mjs +46 -0
  365. package/Tabs/index.js +4 -1
  366. package/Tabs/index.mjs +1 -0
  367. package/Tabs/package.json +2 -2
  368. package/{node/Tabs/sc/bare.js → Tabs/sc/bare.mjs} +0 -0
  369. package/Tabs/tw/bare.d.ts +311 -80
  370. package/Tabs/tw/bare.js +17 -14
  371. package/Tabs/tw/bare.mjs +17 -0
  372. package/Tabs/tw/material.d.ts +326 -136
  373. package/Tabs/tw/material.js +17 -14
  374. package/Tabs/tw/material.mjs +18 -0
  375. package/Tabs/useTabs.js +12 -8
  376. package/{node/Tabs/useTabs.js → Tabs/useTabs.mjs} +8 -12
  377. package/Typography/CopyPasteVisible.js +6 -3
  378. package/Typography/CopyPasteVisible.mjs +4 -0
  379. package/Typography/Native.js +16 -13
  380. package/Typography/Native.mjs +14 -0
  381. package/Typography/ReadMore.js +28 -24
  382. package/Typography/ReadMore.mjs +43 -0
  383. package/Typography/TextLoop.js +21 -16
  384. package/{node/Typography/TextLoop.js → Typography/TextLoop.mjs} +16 -21
  385. package/Typography/TypeStairs.js +11 -8
  386. package/{node/Typography/TypeStairs.js → Typography/TypeStairs.mjs} +8 -11
  387. package/Typography/index.js +8 -5
  388. package/Typography/index.mjs +5 -0
  389. package/Typography/package.json +2 -2
  390. package/css/index.js +7 -2
  391. package/{node/tw/index.js → css/index.mjs} +2 -7
  392. package/css/package.json +2 -2
  393. package/helpers/classed.js +10 -6
  394. package/{node/helpers/classed.js → helpers/classed.mjs} +6 -10
  395. package/helpers/createUseMediaQueryWidth.js +16 -11
  396. package/{node/helpers/createUseMediaQueryWidth.js → helpers/createUseMediaQueryWidth.mjs} +11 -16
  397. package/helpers/extend-component.js +10 -6
  398. package/helpers/extend-component.mjs +13 -0
  399. package/helpers/index.js +7 -4
  400. package/helpers/index.mjs +4 -0
  401. package/helpers/mergeRefs.js +6 -2
  402. package/{node/helpers/mergeRefs.js → helpers/mergeRefs.mjs} +2 -6
  403. package/helpers/package.json +2 -2
  404. package/hooks/index.js +24 -21
  405. package/hooks/index.mjs +22 -0
  406. package/hooks/package.json +2 -2
  407. package/hooks/types.js +2 -1
  408. package/hooks/types.mjs +1 -0
  409. package/hooks/useAsyncFn.js +14 -10
  410. package/{node/hooks/useAsyncFn.js → hooks/useAsyncFn.mjs} +10 -14
  411. package/hooks/useDateLocale.js +14 -12
  412. package/{node/hooks/useDateLocale.js → hooks/useDateLocale.mjs} +10 -17
  413. package/hooks/useEffectOnce.js +8 -4
  414. package/hooks/useEffectOnce.mjs +9 -0
  415. package/hooks/useFirstMountState.js +8 -4
  416. package/hooks/useFirstMountState.mjs +13 -0
  417. package/hooks/useFixedOffset.js +21 -16
  418. package/hooks/useFixedOffset.mjs +57 -0
  419. package/hooks/useFocus.js +8 -4
  420. package/hooks/useFocus.mjs +12 -0
  421. package/hooks/useInterval.js +14 -10
  422. package/{node/hooks/useInterval.js → hooks/useInterval.mjs} +10 -14
  423. package/hooks/useIsomorphicLayoutEffect.js +10 -6
  424. package/hooks/useIsomorphicLayoutEffect.mjs +9 -0
  425. package/hooks/useKeyUp.js +12 -8
  426. package/{node/hooks/useKeyUp.js → hooks/useKeyUp.mjs} +8 -12
  427. package/hooks/useMeasure.js +30 -26
  428. package/{node/hooks/useMeasure.js → hooks/useMeasure.mjs} +26 -30
  429. package/hooks/useMount.js +8 -4
  430. package/hooks/useMount.mjs +10 -0
  431. package/hooks/useMountedState.js +10 -6
  432. package/hooks/useMountedState.mjs +16 -0
  433. package/hooks/useNavigateAway.js +13 -8
  434. package/{node/hooks/useNavigateAway.js → hooks/useNavigateAway.mjs} +8 -13
  435. package/hooks/usePrevious.js +8 -4
  436. package/hooks/usePrevious.mjs +12 -0
  437. package/hooks/usePreviousRef.js +9 -5
  438. package/hooks/usePreviousRef.mjs +9 -0
  439. package/hooks/useScrollPosition.js +16 -11
  440. package/{node/hooks/useScrollPosition.js → hooks/useScrollPosition.mjs} +11 -16
  441. package/hooks/useScrollThreshold.js +15 -10
  442. package/hooks/useScrollThreshold.mjs +28 -0
  443. package/hooks/useScrollTo.js +11 -6
  444. package/hooks/useScrollTo.mjs +22 -0
  445. package/hooks/useSmoothScroll.js +18 -13
  446. package/hooks/useSmoothScroll.mjs +39 -0
  447. package/hooks/useTraceUpdate.js +9 -5
  448. package/{node/hooks/useTraceUpdate.js → hooks/useTraceUpdate.mjs} +5 -9
  449. package/hooks/useUpdateEffect.js +10 -6
  450. package/hooks/useUpdateEffect.mjs +15 -0
  451. package/hooks/useWindowSize.js +15 -10
  452. package/hooks/useWindowSize.mjs +29 -0
  453. package/index.js +4 -1
  454. package/{node/index.js → index.mjs} +1 -4
  455. package/m/MotionProvider.js +10 -6
  456. package/{node/m/MotionProvider.js → m/MotionProvider.mjs} +6 -10
  457. package/m/index.js +4 -1
  458. package/m/index.mjs +6 -0
  459. package/m/lite.js +4 -2
  460. package/m/lite.mjs +2 -0
  461. package/m/max.js +4 -2
  462. package/m/max.mjs +2 -0
  463. package/m/package.json +2 -2
  464. package/package.json +26 -22
  465. package/sc/index.js +36 -30
  466. package/sc/index.mjs +31 -0
  467. package/sc/package.json +2 -2
  468. package/scm/index.js +34 -29
  469. package/scm/index.mjs +31 -0
  470. package/scm/package.json +2 -2
  471. package/shared/index.js +11 -8
  472. package/shared/index.mjs +8 -0
  473. package/shared/package.json +2 -2
  474. package/styles/Body.js +7 -4
  475. package/styles/Body.mjs +13 -0
  476. package/styles/Global.js +7 -4
  477. package/styles/Global.mjs +18 -0
  478. package/styles/index.js +10 -7
  479. package/styles/index.mjs +7 -0
  480. package/styles/media.js +13 -8
  481. package/{node/styles/media.js → styles/media.mjs} +8 -13
  482. package/styles/package.json +2 -2
  483. package/styles/spacing.js +11 -4
  484. package/{node/styles/spacing.js → styles/spacing.mjs} +4 -11
  485. package/styles/styled.js +11 -7
  486. package/styles/styled.mjs +13 -0
  487. package/styles/theme--vanilla.js +32 -26
  488. package/styles/theme--vanilla.mjs +58 -0
  489. package/styles/theme.js +12 -8
  490. package/{node/styles/theme.js → styles/theme.mjs} +8 -12
  491. package/tw/index.js +7 -2
  492. package/{node/css/index.js → tw/index.mjs} +2 -7
  493. package/tw/package.json +2 -2
  494. package/twm/index.js +7 -2
  495. package/{node/twm/index.js → twm/index.mjs} +2 -7
  496. package/twm/package.json +2 -2
  497. package/types.js +2 -1
  498. package/types.mjs +1 -0
  499. package/node/Alert/Alert.js +0 -14
  500. package/node/Alert/index.js +0 -4
  501. package/node/Animations/Reveal.js +0 -21
  502. package/node/Animations/Underline.js +0 -8
  503. package/node/Animations/index.js +0 -6
  504. package/node/Autocomplete/components.js +0 -37
  505. package/node/Autocomplete/index.js +0 -7
  506. package/node/Bg/BgColor.js +0 -25
  507. package/node/Bg/BgPhoto.js +0 -20
  508. package/node/Bg/BgSvg.js +0 -16
  509. package/node/Bg/index.js +0 -6
  510. package/node/Breadcrumbs/Breadcrumbs.js +0 -31
  511. package/node/Breadcrumbs/index.js +0 -4
  512. package/node/Buttons/Button.js +0 -17
  513. package/node/Buttons/ButtonComposite.js +0 -32
  514. package/node/Buttons/ButtonFab.js +0 -9
  515. package/node/Buttons/ButtonLink.js +0 -15
  516. package/node/Buttons/IconButton.js +0 -10
  517. package/node/Buttons/index.js +0 -8
  518. package/node/Calendar/CalendarDaygridNav.js +0 -28
  519. package/node/Calendar/CalendarLegend.js +0 -20
  520. package/node/Calendar/index.js +0 -9
  521. package/node/Calendar/types.js +0 -2
  522. package/node/Carousel/CarouselCss.js +0 -26
  523. package/node/Carousel/index.js +0 -4
  524. package/node/Collapsable/Collapsable.js +0 -4
  525. package/node/Collapsable/index.js +0 -5
  526. package/node/Debug/Debug.js +0 -13
  527. package/node/Debug/index.js +0 -4
  528. package/node/Details/Details.js +0 -66
  529. package/node/Details/index.js +0 -4
  530. package/node/Dialog/css/bare.js +0 -24
  531. package/node/Dialog/index.js +0 -5
  532. package/node/Dialog/m/bare.js +0 -55
  533. package/node/Dialog/m/index.js +0 -8
  534. package/node/Dialog/sc/bare.js +0 -46
  535. package/node/Dialog/sc/framer.js +0 -19
  536. package/node/Dialog/sc/framerMaterial.js +0 -19
  537. package/node/Dialog/sc/material.js +0 -24
  538. package/node/Dialog/tw/bare.js +0 -45
  539. package/node/Dialog/tw/elegant.js +0 -23
  540. package/node/Dialog/tw/framer.js +0 -19
  541. package/node/Dialog/tw/framerMaterial.js +0 -19
  542. package/node/Dialog/tw/material.js +0 -23
  543. package/node/Editor/Editor--tiptap.js +0 -31
  544. package/node/Editor/components.js +0 -15
  545. package/node/Editor/index.js +0 -4
  546. package/node/FaviconTags/FaviconTags.js +0 -20
  547. package/node/FaviconTags/index.js +0 -7
  548. package/node/Form/Form.js +0 -65
  549. package/node/Form/index.js +0 -4
  550. package/node/Form/sc/bare.js +0 -23
  551. package/node/Forms/Checkbox/Checkbox.js +0 -21
  552. package/node/Forms/Checkbox/index.js +0 -4
  553. package/node/Forms/Feedback/Feedback.js +0 -13
  554. package/node/Forms/Feedback/index.js +0 -4
  555. package/node/Forms/Field/Field.js +0 -35
  556. package/node/Forms/Field/FieldControl.js +0 -51
  557. package/node/Forms/Field/FieldHint.js +0 -7
  558. package/node/Forms/Field/index.js +0 -5
  559. package/node/Forms/Input/Input.js +0 -20
  560. package/node/Forms/Input/index.js +0 -4
  561. package/node/Forms/InputGroup/InputGroup.js +0 -19
  562. package/node/Forms/InputGroup/index.js +0 -4
  563. package/node/Forms/Label/Label.js +0 -9
  564. package/node/Forms/Label/index.js +0 -4
  565. package/node/Forms/Password/Password.js +0 -20
  566. package/node/Forms/Password/index.js +0 -4
  567. package/node/Forms/Radio/Radio.js +0 -28
  568. package/node/Forms/Radio/index.js +0 -4
  569. package/node/Forms/Switch/Switch.js +0 -23
  570. package/node/Forms/Switch/index.js +0 -4
  571. package/node/Forms/Textarea/Textarea.js +0 -15
  572. package/node/Forms/Textarea/TextareaRich.js +0 -31
  573. package/node/Forms/Textarea/index.js +0 -5
  574. package/node/Forms/Toggle/Toggle.js +0 -36
  575. package/node/Forms/Toggle/index.js +0 -4
  576. package/node/Forms/index.js +0 -19
  577. package/node/Forms/styles.js +0 -32
  578. package/node/Grid/Grid.js +0 -56
  579. package/node/Grid/index.js +0 -4
  580. package/node/Hamburger/Hamburger.js +0 -56
  581. package/node/Hamburger/index.js +0 -4
  582. package/node/Header/index.js +0 -4
  583. package/node/Header/useHeader.js +0 -35
  584. package/node/Hidden/Hidden.js +0 -13
  585. package/node/Hidden/index.js +0 -4
  586. package/node/Img/index.js +0 -4
  587. package/node/Img/types.js +0 -2
  588. package/node/Link/Link.js +0 -7
  589. package/node/Link/LinkBlank.js +0 -21
  590. package/node/Link/index.js +0 -5
  591. package/node/Menu/Menu.js +0 -7
  592. package/node/Menu/MenuMui.js +0 -78
  593. package/node/Menu/index.js +0 -4
  594. package/node/MenuItem/MenuItem.js +0 -7
  595. package/node/MenuItem/MenuItemMui.js +0 -18
  596. package/node/MenuItem/index.js +0 -4
  597. package/node/Meta/Meta.js +0 -10
  598. package/node/Meta/index.js +0 -7
  599. package/node/NoJs/NoJs.js +0 -11
  600. package/node/NoJs/index.js +0 -7
  601. package/node/Pagination/PaginationNav.js +0 -65
  602. package/node/Pagination/PaginationResults.js +0 -15
  603. package/node/Pagination/index.js +0 -5
  604. package/node/Pill/Pill.js +0 -10
  605. package/node/Pill/index.js +0 -4
  606. package/node/Progress/ProgressCircular.js +0 -19
  607. package/node/Progress/ProgressLinear.js +0 -28
  608. package/node/Progress/ProgressOverlay.js +0 -28
  609. package/node/Progress/index.js +0 -6
  610. package/node/Rating/Rating.js +0 -75
  611. package/node/Select/components.js +0 -15
  612. package/node/Select/index.js +0 -7
  613. package/node/Sidebar/Sidebar.js +0 -27
  614. package/node/Sidebar/index.js +0 -4
  615. package/node/Spacing/Spacing.js +0 -49
  616. package/node/Spacing/index.js +0 -4
  617. package/node/Sticky/StickyCss.js +0 -10
  618. package/node/Sticky/index.js +0 -4
  619. package/node/Tabs/TabsMui.js +0 -49
  620. package/node/Tabs/index.js +0 -4
  621. package/node/Tabs/tw/bare.js +0 -20
  622. package/node/Tabs/tw/material.js +0 -21
  623. package/node/Typography/CopyPasteVisible.js +0 -7
  624. package/node/Typography/Native.js +0 -17
  625. package/node/Typography/ReadMore.js +0 -47
  626. package/node/Typography/index.js +0 -8
  627. package/node/helpers/extend-component.js +0 -17
  628. package/node/helpers/index.js +0 -7
  629. package/node/hooks/index.js +0 -25
  630. package/node/hooks/types.js +0 -2
  631. package/node/hooks/useEffectOnce.js +0 -13
  632. package/node/hooks/useFirstMountState.js +0 -17
  633. package/node/hooks/useFixedOffset.js +0 -62
  634. package/node/hooks/useFocus.js +0 -16
  635. package/node/hooks/useIsomorphicLayoutEffect.js +0 -13
  636. package/node/hooks/useMount.js +0 -14
  637. package/node/hooks/useMountedState.js +0 -20
  638. package/node/hooks/usePrevious.js +0 -16
  639. package/node/hooks/usePreviousRef.js +0 -13
  640. package/node/hooks/useScrollThreshold.js +0 -33
  641. package/node/hooks/useScrollTo.js +0 -27
  642. package/node/hooks/useSmoothScroll.js +0 -44
  643. package/node/hooks/useUpdateEffect.js +0 -19
  644. package/node/hooks/useWindowSize.js +0 -34
  645. package/node/m/index.js +0 -9
  646. package/node/m/lite.js +0 -4
  647. package/node/m/max.js +0 -4
  648. package/node/sc/index.js +0 -37
  649. package/node/scm/index.js +0 -36
  650. package/node/shared/index.js +0 -11
  651. package/node/styles/Body.js +0 -16
  652. package/node/styles/Global.js +0 -21
  653. package/node/styles/index.js +0 -10
  654. package/node/styles/styled.js +0 -17
  655. package/node/styles/theme--vanilla.js +0 -64
  656. package/node/types.js +0 -2
@@ -3,4 +3,4 @@ import { FormControl } from "../helpers";
3
3
  export type TextareaRichProps = FormControl<"textarea"> & {
4
4
  defaultValue?: string;
5
5
  };
6
- export declare const TextareaRich: import("react").ForwardRefExoticComponent<Pick<TextareaRichProps, "key" | "value" | "id" | "title" | "color" | "form" | "slot" | "style" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "disabled" | "autoFocus" | "autoComplete" | "maxLength" | "minLength" | "readOnly" | "required" | "cols" | "dirName" | "rows" | "wrap" | keyof import("../helpers").FormControlProps<any>> & import("react").RefAttributes<HTMLTextAreaElement>>;
6
+ export declare const TextareaRich: import("react").ForwardRefExoticComponent<Omit<TextareaRichProps, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
@@ -1,17 +1,20 @@
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";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TextareaRich = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var jsx_runtime_1 = require("react/jsx-runtime");
6
+ var react_1 = require("react");
7
+ var styled_components_1 = tslib_1.__importDefault(require("styled-components"));
5
8
  // import TextareaAutosize from "@mui/base/TextareaAutosize";
6
- import { Label } from "../Label/Label";
7
- import { Editor } from "../../Editor";
8
- import { triggerOnChange } from "../helpers";
9
- 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"])));
10
- export var TextareaRich = forwardRef(function TextareaRich(_a, ref) {
11
- 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"]);
9
+ var Label_1 = require("../Label/Label");
10
+ var Editor_1 = require("../../Editor");
11
+ var helpers_1 = require("../helpers");
12
+ var Root = styled_components_1.default.div(templateObject_1 || (templateObject_1 = tslib_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"])));
13
+ exports.TextareaRich = (0, react_1.forwardRef)(function TextareaRich(_a, ref) {
14
+ 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 = tslib_1.__rest(_a, ["register", "setValue", "name", "label", "defaultValue", "onChange"]);
12
15
  if (register)
13
16
  register(name);
14
- return (_jsxs(Root, { children: [label && _jsx(Label, { children: label }), _jsx(Editor, __assign({ options: {
17
+ return ((0, jsx_runtime_1.jsxs)(Root, { children: [label && (0, jsx_runtime_1.jsx)(Label_1.Label, { children: label }), (0, jsx_runtime_1.jsx)(Editor_1.Editor, tslib_1.__assign({ options: {
15
18
  // element: <TextareaAutosize />,
16
19
  content: defaultValue,
17
20
  onUpdate: (onChange || setValue) && name
@@ -20,7 +23,7 @@ export var TextareaRich = forwardRef(function TextareaRich(_a, ref) {
20
23
  var value = editor.getHTML();
21
24
  if (setValue)
22
25
  setValue(name, value);
23
- triggerOnChange(onChange, name, value);
26
+ (0, helpers_1.triggerOnChange)(onChange, name, value);
24
27
  }
25
28
  : undefined,
26
29
  } }, props))] }));
@@ -0,0 +1,28 @@
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 TextareaAutosize from "@mui/base/TextareaAutosize";
6
+ import { Label } from "../Label/Label";
7
+ import { Editor } from "../../Editor";
8
+ import { triggerOnChange } from "../helpers";
9
+ 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"])));
10
+ export var TextareaRich = forwardRef(function TextareaRich(_a, ref) {
11
+ 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"]);
12
+ if (register)
13
+ register(name);
14
+ return (_jsxs(Root, { children: [label && _jsx(Label, { children: label }), _jsx(Editor, __assign({ options: {
15
+ // element: <TextareaAutosize />,
16
+ content: defaultValue,
17
+ onUpdate: (onChange || setValue) && name
18
+ ? function (_a) {
19
+ var editor = _a.editor;
20
+ var value = editor.getHTML();
21
+ if (setValue)
22
+ setValue(name, value);
23
+ triggerOnChange(onChange, name, value);
24
+ }
25
+ : undefined,
26
+ } }, props))] }));
27
+ });
28
+ var templateObject_1;
@@ -1,2 +1,5 @@
1
- export * from "./Textarea";
2
- export * from "./TextareaRich";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./Textarea"), exports);
5
+ tslib_1.__exportStar(require("./TextareaRich"), exports);
@@ -0,0 +1,2 @@
1
+ export * from "./Textarea";
2
+ export * from "./TextareaRich";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "sideEffects": false,
3
- "module": "./index.js",
4
- "main": "../../node/Forms/Textarea/index.js",
3
+ "module": "./index.mjs",
4
+ "main": "./index.js",
5
5
  "types": "./index.d.ts"
6
6
  }
@@ -1,31 +1,36 @@
1
- import { __assign, __makeTemplateObject } from "tslib";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ToggleIndicatorRounded = exports.ToggleIndicatorSquared = exports.ToggleIndicatorFg = exports.ToggleIndicatorBgCircle = exports.ToggleIndicatorBgSquare = exports.ToggleIndicatorHolder = exports.ToggleLabelSub = exports.ToggleLabel = exports.Toggle = exports.toggleIndicatorFg = exports.toggleIndicatorBgShape = exports.toggleIndicatorBg = exports.toggleBase = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var jsx_runtime_1 = require("react/jsx-runtime");
3
6
  /**
4
7
  * @file
5
8
  *
6
9
  * About accessibility:
7
10
  * - minimum target size of 44px https://www.w3.org/TR/WCAG21/#target-size
8
11
  */
9
- import { useId } from "react";
10
- import styled from "styled-components";
11
- import { stateFocus } from "../../styles/styled";
12
- export var toggleBase = "\n border: 1px solid var(--forms-border-color);\n";
13
- export var toggleIndicatorBg = "\n display: inline-block;\n flex-shrink: 0;\n width: 100%;\n height: 100%;\n";
14
- export var toggleIndicatorBgShape = "\n ".concat(toggleIndicatorBg, "\n fill: none;\n stroke-width: 2px;\n stroke: var(--forms-border-color);\n");
15
- export var toggleIndicatorFg = "\n position: absolute;\n left: 0;\n width: 100%;\n height: 100%;\n fill: currentcolor;\n";
16
- 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"])));
17
- export var ToggleLabel = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-left: 0.6em; /* rtl */\n"], ["\n margin-left: 0.6em; /* rtl */\n"])));
18
- 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"])));
19
- 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);
20
- export var ToggleIndicatorBgSquare = styled.svg(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), toggleIndicatorBgShape);
21
- export var ToggleIndicatorBgCircle = styled.svg(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), toggleIndicatorBgShape);
22
- 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);
23
- export var ToggleIndicatorSquared = function (props) {
24
- return (_jsxs(ToggleIndicatorHolder, { children: [_jsx(ToggleIndicatorBgSquare, __assign({ viewBox: "0 0 24 24" }, { children: _jsx("rect", { width: "24", height: "24" }) })), _jsx(ToggleIndicatorFg, __assign({ 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" }) }))] }));
12
+ var react_1 = require("react");
13
+ var styled_components_1 = tslib_1.__importDefault(require("styled-components"));
14
+ var styled_1 = require("../../styles/styled");
15
+ exports.toggleBase = "\n border: 1px solid var(--forms-border-color);\n";
16
+ exports.toggleIndicatorBg = "\n display: inline-block;\n flex-shrink: 0;\n width: 100%;\n height: 100%;\n";
17
+ exports.toggleIndicatorBgShape = "\n ".concat(exports.toggleIndicatorBg, "\n fill: none;\n stroke-width: 2px;\n stroke: var(--forms-border-color);\n");
18
+ exports.toggleIndicatorFg = "\n position: absolute;\n left: 0;\n width: 100%;\n height: 100%;\n fill: currentcolor;\n";
19
+ exports.Toggle = styled_components_1.default.span(templateObject_1 || (templateObject_1 = tslib_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"])));
20
+ exports.ToggleLabel = styled_components_1.default.span(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n margin-left: 0.6em; /* rtl */\n"], ["\n margin-left: 0.6em; /* rtl */\n"])));
21
+ exports.ToggleLabelSub = styled_components_1.default.small(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["\n opacity: 0.7;\n font-size: 0.7em; ;\n"], ["\n opacity: 0.7;\n font-size: 0.7em; ;\n"])));
22
+ exports.ToggleIndicatorHolder = styled_components_1.default.span(templateObject_4 || (templateObject_4 = tslib_1.__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"])), styled_1.stateFocus);
23
+ exports.ToggleIndicatorBgSquare = styled_components_1.default.svg(templateObject_5 || (templateObject_5 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), exports.toggleIndicatorBgShape);
24
+ exports.ToggleIndicatorBgCircle = styled_components_1.default.svg(templateObject_6 || (templateObject_6 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), exports.toggleIndicatorBgShape);
25
+ exports.ToggleIndicatorFg = styled_components_1.default.svg(templateObject_7 || (templateObject_7 = tslib_1.__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"])), exports.toggleIndicatorFg, exports.ToggleIndicatorHolder);
26
+ var ToggleIndicatorSquared = function (props) {
27
+ return ((0, jsx_runtime_1.jsxs)(exports.ToggleIndicatorHolder, { children: [(0, jsx_runtime_1.jsx)(exports.ToggleIndicatorBgSquare, tslib_1.__assign({ viewBox: "0 0 24 24" }, { children: (0, jsx_runtime_1.jsx)("rect", { width: "24", height: "24" }) })), (0, jsx_runtime_1.jsx)(exports.ToggleIndicatorFg, tslib_1.__assign({ viewBox: "0 0 24 24" }, { children: (0, jsx_runtime_1.jsx)("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" }) }))] }));
25
28
  };
26
- export var ToggleIndicatorRounded = function (_a) {
29
+ exports.ToggleIndicatorSquared = ToggleIndicatorSquared;
30
+ var ToggleIndicatorRounded = function (_a) {
27
31
  var _b = _a.r, r = _b === void 0 ? 6 : _b;
28
- var id = useId();
29
- return (_jsxs(ToggleIndicatorHolder, { children: [_jsxs(ToggleIndicatorBgCircle, __assign({ 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", __assign({ id: "c_".concat(id) }, { children: _jsx("use", { xlinkHref: "#r_".concat(id) }) }))] })), _jsx(ToggleIndicatorFg, __assign({ viewBox: "0 0 24 24" }, { children: _jsx("circle", { r: r, cx: "12", cy: "12" }) }))] }));
32
+ var id = (0, react_1.useId)();
33
+ return ((0, jsx_runtime_1.jsxs)(exports.ToggleIndicatorHolder, { children: [(0, jsx_runtime_1.jsxs)(exports.ToggleIndicatorBgCircle, tslib_1.__assign({ viewBox: "0 0 24 24" }, { children: [(0, jsx_runtime_1.jsx)("circle", { cy: "12", cx: "12", r: "12", id: "r_".concat(id), clipPath: "url(#c_".concat(id, ")") }), (0, jsx_runtime_1.jsx)("clipPath", tslib_1.__assign({ id: "c_".concat(id) }, { children: (0, jsx_runtime_1.jsx)("use", { xlinkHref: "#r_".concat(id) }) }))] })), (0, jsx_runtime_1.jsx)(exports.ToggleIndicatorFg, tslib_1.__assign({ viewBox: "0 0 24 24" }, { children: (0, jsx_runtime_1.jsx)("circle", { r: r, cx: "12", cy: "12" }) }))] }));
30
34
  };
35
+ exports.ToggleIndicatorRounded = ToggleIndicatorRounded;
31
36
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
@@ -0,0 +1,31 @@
1
+ import { __assign, __makeTemplateObject } from "tslib";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * @file
5
+ *
6
+ * About accessibility:
7
+ * - minimum target size of 44px https://www.w3.org/TR/WCAG21/#target-size
8
+ */
9
+ import { useId } from "react";
10
+ import styled from "styled-components";
11
+ import { stateFocus } from "../../styles/styled";
12
+ export var toggleBase = "\n border: 1px solid var(--forms-border-color);\n";
13
+ export var toggleIndicatorBg = "\n display: inline-block;\n flex-shrink: 0;\n width: 100%;\n height: 100%;\n";
14
+ export var toggleIndicatorBgShape = "\n ".concat(toggleIndicatorBg, "\n fill: none;\n stroke-width: 2px;\n stroke: var(--forms-border-color);\n");
15
+ export var toggleIndicatorFg = "\n position: absolute;\n left: 0;\n width: 100%;\n height: 100%;\n fill: currentcolor;\n";
16
+ 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"])));
17
+ export var ToggleLabel = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-left: 0.6em; /* rtl */\n"], ["\n margin-left: 0.6em; /* rtl */\n"])));
18
+ 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"])));
19
+ 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);
20
+ export var ToggleIndicatorBgSquare = styled.svg(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), toggleIndicatorBgShape);
21
+ export var ToggleIndicatorBgCircle = styled.svg(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), toggleIndicatorBgShape);
22
+ 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);
23
+ export var ToggleIndicatorSquared = function (props) {
24
+ return (_jsxs(ToggleIndicatorHolder, { children: [_jsx(ToggleIndicatorBgSquare, __assign({ viewBox: "0 0 24 24" }, { children: _jsx("rect", { width: "24", height: "24" }) })), _jsx(ToggleIndicatorFg, __assign({ 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" }) }))] }));
25
+ };
26
+ export var ToggleIndicatorRounded = function (_a) {
27
+ var _b = _a.r, r = _b === void 0 ? 6 : _b;
28
+ var id = useId();
29
+ return (_jsxs(ToggleIndicatorHolder, { children: [_jsxs(ToggleIndicatorBgCircle, __assign({ 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", __assign({ id: "c_".concat(id) }, { children: _jsx("use", { xlinkHref: "#r_".concat(id) }) }))] })), _jsx(ToggleIndicatorFg, __assign({ viewBox: "0 0 24 24" }, { children: _jsx("circle", { r: r, cx: "12", cy: "12" }) }))] }));
30
+ };
31
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
@@ -1 +1,4 @@
1
- export * from "./Toggle";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./Toggle"), exports);
@@ -0,0 +1 @@
1
+ export * from "./Toggle";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "sideEffects": false,
3
- "module": "./index.js",
4
- "main": "../../node/Forms/Toggle/index.js",
3
+ "module": "./index.mjs",
4
+ "main": "./index.js",
5
5
  "types": "./index.d.ts"
6
6
  }
@@ -1,8 +1,11 @@
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";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useToggle = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var jsx_runtime_1 = require("react/jsx-runtime");
6
+ var react_1 = require("react");
7
+ var react_hook_form_1 = require("react-hook-form");
8
+ var styles_1 = require("../styles");
6
9
  /**
7
10
  * This hook is meant to power Checkboxes, Switches and checkbox-like Radios
8
11
  * components, it works in fact in two modes:
@@ -32,13 +35,13 @@ import { InputInvisible } from "../styles";
32
35
  * To enable this mode either pass the props `valueTrue` and `valueFalse` or
33
36
  * an array of options with the shape of `Option`
34
37
  */
35
- export function useToggle(props, ref) {
36
- 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"]);
38
+ function useToggle(props, ref) {
39
+ var name = props.name, control = props.control, register = props.register, label = props.label, options = props.options, propValue = props.value, restProps = tslib_1.__rest(props, ["name", "control", "register", "label", "options", "value"]);
37
40
  var id = restProps.id, valueTrue = restProps.valueTrue, valueFalse = restProps.valueFalse,
38
41
  // defaultChecked,
39
42
  // defaultValue,
40
43
  // eslint-disable-next-line prefer-const
41
- remainingInputProps = __rest(restProps, ["id", "valueTrue", "valueFalse"]);
44
+ remainingInputProps = tslib_1.__rest(restProps, ["id", "valueTrue", "valueFalse"]);
42
45
  // use options data convention to pass on the true/false values
43
46
  if (options) {
44
47
  valueTrue = options
@@ -62,7 +65,7 @@ export function useToggle(props, ref) {
62
65
  // : valueFalse;
63
66
  // get the value either from the uncontrolled watched input or from the given
64
67
  // prop to control the component
65
- var value = useWatch({
68
+ var value = (0, react_hook_form_1.useWatch)({
66
69
  name: name,
67
70
  control: control,
68
71
  // defaultValue: isRadio ? defaultValue : defaultChecked,
@@ -74,7 +77,7 @@ export function useToggle(props, ref) {
74
77
  // a `register` function, then check if we have a `control` object or just
75
78
  // rely on the `name` prop and `ref`, they probably would be passed alongside
76
79
  // an `onChange` prop that is spreaded on the inputs
77
- var inputProps = useMemo(function () {
80
+ var inputProps = (0, react_1.useMemo)(function () {
78
81
  return register
79
82
  ? register(name)
80
83
  : control
@@ -90,7 +93,7 @@ export function useToggle(props, ref) {
90
93
  * Fake the spacebar keyboard behaviour on the radio mode of the checkbox.
91
94
  * Without this *only* the arrow keys would change the checkbox state
92
95
  */
93
- var handleKeyDown = useCallback(function (event) {
96
+ var handleKeyDown = (0, react_1.useCallback)(function (event) {
94
97
  if (event.key === " ") {
95
98
  event.preventDefault();
96
99
  event.stopPropagation();
@@ -114,7 +117,7 @@ export function useToggle(props, ref) {
114
117
  }, [valueTrue]);
115
118
  // collect all the return values that are dependent on the current value
116
119
  // of the input
117
- var valueDependentProps = useMemo(function () { return ({
120
+ var valueDependentProps = (0, react_1.useMemo)(function () { return ({
118
121
  rootProps: {
119
122
  htmlFor: isRadio
120
123
  ? !value || value === valueFalse
@@ -125,8 +128,8 @@ export function useToggle(props, ref) {
125
128
  label: label ? label : value,
126
129
  value: value,
127
130
  }); }, [value, valueFalse, isRadio, id, idTrue, idFalse, label]);
128
- var Inputs = useMemo(function () {
129
- 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)));
131
+ var Inputs = (0, react_1.useMemo)(function () {
132
+ return isRadio ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(styles_1.InputInvisible, tslib_1.__assign({ id: idFalse }, inputProps, remainingInputProps, { onKeyDown: handleKeyDown, type: "radio", value: valueFalse })), (0, jsx_runtime_1.jsx)(styles_1.InputInvisible, tslib_1.__assign({ id: idTrue }, inputProps, remainingInputProps, { onKeyDown: handleKeyDown, type: "radio", value: valueTrue }))] })) : ((0, jsx_runtime_1.jsx)(styles_1.InputInvisible, tslib_1.__assign({ id: id, type: "checkbox" }, inputProps, remainingInputProps)));
130
133
  }, [
131
134
  inputProps,
132
135
  remainingInputProps,
@@ -141,5 +144,6 @@ export function useToggle(props, ref) {
141
144
  // defaultValue,
142
145
  ]);
143
146
  // console.log("useToggle: render", value);
144
- return __assign(__assign({}, valueDependentProps), { Inputs: Inputs });
147
+ return tslib_1.__assign(tslib_1.__assign({}, valueDependentProps), { Inputs: Inputs });
145
148
  }
149
+ exports.useToggle = useToggle;
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useToggle = void 0;
4
- var tslib_1 = require("tslib");
5
- var jsx_runtime_1 = require("react/jsx-runtime");
6
- var react_1 = require("react");
7
- var react_hook_form_1 = require("react-hook-form");
8
- var styles_1 = require("../styles");
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";
9
6
  /**
10
7
  * This hook is meant to power Checkboxes, Switches and checkbox-like Radios
11
8
  * components, it works in fact in two modes:
@@ -35,13 +32,13 @@ var styles_1 = require("../styles");
35
32
  * To enable this mode either pass the props `valueTrue` and `valueFalse` or
36
33
  * an array of options with the shape of `Option`
37
34
  */
38
- function useToggle(props, ref) {
39
- var name = props.name, control = props.control, register = props.register, label = props.label, options = props.options, propValue = props.value, restProps = tslib_1.__rest(props, ["name", "control", "register", "label", "options", "value"]);
35
+ export function useToggle(props, ref) {
36
+ 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"]);
40
37
  var id = restProps.id, valueTrue = restProps.valueTrue, valueFalse = restProps.valueFalse,
41
38
  // defaultChecked,
42
39
  // defaultValue,
43
40
  // eslint-disable-next-line prefer-const
44
- remainingInputProps = tslib_1.__rest(restProps, ["id", "valueTrue", "valueFalse"]);
41
+ remainingInputProps = __rest(restProps, ["id", "valueTrue", "valueFalse"]);
45
42
  // use options data convention to pass on the true/false values
46
43
  if (options) {
47
44
  valueTrue = options
@@ -65,7 +62,7 @@ function useToggle(props, ref) {
65
62
  // : valueFalse;
66
63
  // get the value either from the uncontrolled watched input or from the given
67
64
  // prop to control the component
68
- var value = (0, react_hook_form_1.useWatch)({
65
+ var value = useWatch({
69
66
  name: name,
70
67
  control: control,
71
68
  // defaultValue: isRadio ? defaultValue : defaultChecked,
@@ -77,7 +74,7 @@ function useToggle(props, ref) {
77
74
  // a `register` function, then check if we have a `control` object or just
78
75
  // rely on the `name` prop and `ref`, they probably would be passed alongside
79
76
  // an `onChange` prop that is spreaded on the inputs
80
- var inputProps = (0, react_1.useMemo)(function () {
77
+ var inputProps = useMemo(function () {
81
78
  return register
82
79
  ? register(name)
83
80
  : control
@@ -93,7 +90,7 @@ function useToggle(props, ref) {
93
90
  * Fake the spacebar keyboard behaviour on the radio mode of the checkbox.
94
91
  * Without this *only* the arrow keys would change the checkbox state
95
92
  */
96
- var handleKeyDown = (0, react_1.useCallback)(function (event) {
93
+ var handleKeyDown = useCallback(function (event) {
97
94
  if (event.key === " ") {
98
95
  event.preventDefault();
99
96
  event.stopPropagation();
@@ -117,7 +114,7 @@ function useToggle(props, ref) {
117
114
  }, [valueTrue]);
118
115
  // collect all the return values that are dependent on the current value
119
116
  // of the input
120
- var valueDependentProps = (0, react_1.useMemo)(function () { return ({
117
+ var valueDependentProps = useMemo(function () { return ({
121
118
  rootProps: {
122
119
  htmlFor: isRadio
123
120
  ? !value || value === valueFalse
@@ -128,8 +125,8 @@ function useToggle(props, ref) {
128
125
  label: label ? label : value,
129
126
  value: value,
130
127
  }); }, [value, valueFalse, isRadio, id, idTrue, idFalse, label]);
131
- var Inputs = (0, react_1.useMemo)(function () {
132
- return isRadio ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(styles_1.InputInvisible, tslib_1.__assign({ id: idFalse }, inputProps, remainingInputProps, { onKeyDown: handleKeyDown, type: "radio", value: valueFalse })), (0, jsx_runtime_1.jsx)(styles_1.InputInvisible, tslib_1.__assign({ id: idTrue }, inputProps, remainingInputProps, { onKeyDown: handleKeyDown, type: "radio", value: valueTrue }))] })) : ((0, jsx_runtime_1.jsx)(styles_1.InputInvisible, tslib_1.__assign({ id: id, type: "checkbox" }, inputProps, remainingInputProps)));
128
+ var Inputs = useMemo(function () {
129
+ 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)));
133
130
  }, [
134
131
  inputProps,
135
132
  remainingInputProps,
@@ -144,6 +141,5 @@ function useToggle(props, ref) {
144
141
  // defaultValue,
145
142
  ]);
146
143
  // console.log("useToggle: render", value);
147
- return tslib_1.__assign(tslib_1.__assign({}, valueDependentProps), { Inputs: Inputs });
144
+ return __assign(__assign({}, valueDependentProps), { Inputs: Inputs });
148
145
  }
149
- exports.useToggle = useToggle;
package/Forms/antispam.js CHANGED
@@ -1,7 +1,11 @@
1
- import { object } from "@kuus/yup";
2
- import encode from "@koine/utils/encode";
3
- import decode from "@koine/utils/decode";
4
- import isUndefined from "@koine/utils/isUndefined";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.decodeForm = exports.encodeForm = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var yup_1 = require("@kuus/yup");
6
+ var encode_1 = tslib_1.__importDefault(require("@koine/utils/encode"));
7
+ var decode_1 = tslib_1.__importDefault(require("@koine/utils/decode"));
8
+ var isUndefined_1 = tslib_1.__importDefault(require("@koine/utils/isUndefined"));
5
9
  /**
6
10
  * Encode form
7
11
  *
@@ -13,21 +17,22 @@ import isUndefined from "@koine/utils/isUndefined";
13
17
  *
14
18
  * FIXME: types https://github.com/jquense/yup/issues/1700
15
19
  */
16
- export function encodeForm(validationRules) {
20
+ function encodeForm(validationRules) {
17
21
  var encoded = {};
18
22
  var encodedNames = {};
19
23
  for (var name_1 in validationRules) {
20
24
  if (!name_1.startsWith("_")) {
21
- var encodedName = encode(name_1);
25
+ var encodedName = (0, encode_1.default)(name_1);
22
26
  encoded[encodedName] = validationRules[name_1];
23
27
  encodedNames[name_1] = encodedName;
24
28
  }
25
29
  }
26
30
  // we need `.required()` to correctly infer the type @see
27
31
  // https://github.com/jquense/yup/issues/946
28
- var encodedSchema = object(encoded).required();
32
+ var encodedSchema = (0, yup_1.object)(encoded).required();
29
33
  return { encodedSchema: encodedSchema, encodedNames: encodedNames };
30
34
  }
35
+ exports.encodeForm = encodeForm;
31
36
  /**
32
37
  * Decode form data
33
38
  *
@@ -37,10 +42,10 @@ export function encodeForm(validationRules) {
37
42
  * Here too we skip encoding/decoding process for names prefixed wth an underscore
38
43
  * which are considered programmatic form data not created by user input.
39
44
  */
40
- export function decodeForm(formData) {
45
+ function decodeForm(formData) {
41
46
  var json = {};
42
47
  for (var encodedName in formData) {
43
- var decodedName = decode(encodedName);
48
+ var decodedName = (0, decode_1.default)(encodedName);
44
49
  // always add underscore prefixed names as they are treated as internal
45
50
  // private inputs outside of the honeypot system, normalise them here removing
46
51
  // the underscore prefix
@@ -49,7 +54,7 @@ export function decodeForm(formData) {
49
54
  json[encodedName.substring(1)] = formData[encodedName];
50
55
  }
51
56
  // if the decoded `name` is empty and the encoded `name` is defined honeypot passed
52
- else if (!isUndefined(formData[encodedName]) &&
57
+ else if (!(0, isUndefined_1.default)(formData[encodedName]) &&
53
58
  formData[decodedName] === "") {
54
59
  // @ts-expect-error nevermind
55
60
  json[decodedName] = formData[encodedName];
@@ -58,3 +63,4 @@ export function decodeForm(formData) {
58
63
  // console.log(formData, decoded, json);
59
64
  return json;
60
65
  }
66
+ exports.decodeForm = decodeForm;
@@ -1,11 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.decodeForm = exports.encodeForm = void 0;
4
- var tslib_1 = require("tslib");
5
- var yup_1 = require("@kuus/yup");
6
- var encode_1 = tslib_1.__importDefault(require("@koine/utils/encode"));
7
- var decode_1 = tslib_1.__importDefault(require("@koine/utils/decode"));
8
- var isUndefined_1 = tslib_1.__importDefault(require("@koine/utils/isUndefined"));
1
+ import { object } from "@kuus/yup";
2
+ import encode from "@koine/utils/encode";
3
+ import decode from "@koine/utils/decode";
4
+ import isUndefined from "@koine/utils/isUndefined";
9
5
  /**
10
6
  * Encode form
11
7
  *
@@ -17,22 +13,21 @@ var isUndefined_1 = tslib_1.__importDefault(require("@koine/utils/isUndefined"))
17
13
  *
18
14
  * FIXME: types https://github.com/jquense/yup/issues/1700
19
15
  */
20
- function encodeForm(validationRules) {
16
+ export function encodeForm(validationRules) {
21
17
  var encoded = {};
22
18
  var encodedNames = {};
23
19
  for (var name_1 in validationRules) {
24
20
  if (!name_1.startsWith("_")) {
25
- var encodedName = (0, encode_1.default)(name_1);
21
+ var encodedName = encode(name_1);
26
22
  encoded[encodedName] = validationRules[name_1];
27
23
  encodedNames[name_1] = encodedName;
28
24
  }
29
25
  }
30
26
  // we need `.required()` to correctly infer the type @see
31
27
  // https://github.com/jquense/yup/issues/946
32
- var encodedSchema = (0, yup_1.object)(encoded).required();
28
+ var encodedSchema = object(encoded).required();
33
29
  return { encodedSchema: encodedSchema, encodedNames: encodedNames };
34
30
  }
35
- exports.encodeForm = encodeForm;
36
31
  /**
37
32
  * Decode form data
38
33
  *
@@ -42,10 +37,10 @@ exports.encodeForm = encodeForm;
42
37
  * Here too we skip encoding/decoding process for names prefixed wth an underscore
43
38
  * which are considered programmatic form data not created by user input.
44
39
  */
45
- function decodeForm(formData) {
40
+ export function decodeForm(formData) {
46
41
  var json = {};
47
42
  for (var encodedName in formData) {
48
- var decodedName = (0, decode_1.default)(encodedName);
43
+ var decodedName = decode(encodedName);
49
44
  // always add underscore prefixed names as they are treated as internal
50
45
  // private inputs outside of the honeypot system, normalise them here removing
51
46
  // the underscore prefix
@@ -54,7 +49,7 @@ function decodeForm(formData) {
54
49
  json[encodedName.substring(1)] = formData[encodedName];
55
50
  }
56
51
  // if the decoded `name` is empty and the encoded `name` is defined honeypot passed
57
- else if (!(0, isUndefined_1.default)(formData[encodedName]) &&
52
+ else if (!isUndefined(formData[encodedName]) &&
58
53
  formData[decodedName] === "") {
59
54
  // @ts-expect-error nevermind
60
55
  json[decodedName] = formData[encodedName];
@@ -63,4 +58,3 @@ function decodeForm(formData) {
63
58
  // console.log(formData, decoded, json);
64
59
  return json;
65
60
  }
66
- exports.decodeForm = decodeForm;