@fuf-stack/uniform 1.22.4 → 1.22.6

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 (442) hide show
  1. package/dist/Checkboxes/index.cjs +113 -3
  2. package/dist/Checkboxes/index.cjs.map +1 -0
  3. package/dist/Checkboxes/index.d.cts +534 -2
  4. package/dist/Checkboxes/index.d.cts.map +1 -0
  5. package/dist/Checkboxes/index.d.ts +534 -2
  6. package/dist/Checkboxes/index.d.ts.map +1 -0
  7. package/dist/Checkboxes/index.js +112 -2
  8. package/dist/Checkboxes/index.js.map +1 -0
  9. package/dist/DatePicker/index.cjs +194 -3
  10. package/dist/DatePicker/index.cjs.map +1 -0
  11. package/dist/DatePicker/index.d.cts +1413 -2
  12. package/dist/DatePicker/index.d.cts.map +1 -0
  13. package/dist/DatePicker/index.d.ts +1413 -2
  14. package/dist/DatePicker/index.d.ts.map +1 -0
  15. package/dist/DatePicker/index.js +193 -2
  16. package/dist/DatePicker/index.js.map +1 -0
  17. package/dist/FieldArray/index.cjs +495 -3
  18. package/dist/FieldArray/index.cjs.map +1 -0
  19. package/dist/FieldArray/index.d.cts +539 -2
  20. package/dist/FieldArray/index.d.cts.map +1 -0
  21. package/dist/FieldArray/index.d.ts +539 -2
  22. package/dist/FieldArray/index.d.ts.map +1 -0
  23. package/dist/FieldArray/index.js +494 -2
  24. package/dist/FieldArray/index.js.map +1 -0
  25. package/dist/FieldCard/index.cjs +230 -4
  26. package/dist/FieldCard/index.cjs.map +1 -0
  27. package/dist/FieldCard/index.d.cts +314 -2
  28. package/dist/FieldCard/index.d.cts.map +1 -0
  29. package/dist/FieldCard/index.d.ts +314 -2
  30. package/dist/FieldCard/index.d.ts.map +1 -0
  31. package/dist/FieldCard/index.js +225 -2
  32. package/dist/FieldCard/index.js.map +1 -0
  33. package/dist/{FieldCopyTestIdButton-Dpmo0uBV.js → FieldCopyTestIdButton-CRJBix9D.js} +2 -2
  34. package/dist/{FieldCopyTestIdButton-Dpmo0uBV.js.map → FieldCopyTestIdButton-CRJBix9D.js.map} +1 -1
  35. package/dist/{FieldCopyTestIdButton-ptoB1F75.cjs → FieldCopyTestIdButton-D3D_LmJh.cjs} +1 -8
  36. package/dist/{FieldCopyTestIdButton-ptoB1F75.cjs.map → FieldCopyTestIdButton-D3D_LmJh.cjs.map} +1 -1
  37. package/dist/{FieldValidationError-ktTyyyip.js → FieldValidationError-ByRoIxaM.js} +5 -5
  38. package/dist/{FieldValidationError-ktTyyyip.js.map → FieldValidationError-ByRoIxaM.js.map} +1 -1
  39. package/dist/{FieldValidationError-BQcvvU9i.cjs → FieldValidationError-CfYKzl7P.cjs} +5 -6
  40. package/dist/{FieldValidationError-BQcvvU9i.cjs.map → FieldValidationError-CfYKzl7P.cjs.map} +1 -1
  41. package/dist/Form/index.cjs +118 -3
  42. package/dist/Form/index.cjs.map +1 -0
  43. package/dist/Form/index.d.cts +43 -2
  44. package/dist/Form/index.d.cts.map +1 -0
  45. package/dist/Form/index.d.ts +43 -2
  46. package/dist/Form/index.d.ts.map +1 -0
  47. package/dist/Form/index.js +118 -2
  48. package/dist/Form/index.js.map +1 -0
  49. package/dist/{FormContext-3kamRn2C.d.cts → FormContext-BLWS7bhO.d.cts} +1 -1
  50. package/dist/{FormContext-3kamRn2C.d.cts.map → FormContext-BLWS7bhO.d.cts.map} +1 -1
  51. package/dist/{FormContext-BQeKOV-0.js → FormContext-DjJOJKxj.js} +1 -1
  52. package/dist/{FormContext-BQeKOV-0.js.map → FormContext-DjJOJKxj.js.map} +1 -1
  53. package/dist/{FormContext-DsmS_mkO.cjs → FormContext-EGH0cVnH.cjs} +1 -1
  54. package/dist/{FormContext-DsmS_mkO.cjs.map → FormContext-EGH0cVnH.cjs.map} +1 -1
  55. package/dist/{FormContext-i66vM5f1.d.ts → FormContext-LgzrDWu1.d.ts} +1 -1
  56. package/dist/{FormContext-i66vM5f1.d.ts.map → FormContext-LgzrDWu1.d.ts.map} +1 -1
  57. package/dist/Grid/index.cjs +1 -2
  58. package/dist/Grid/index.d.cts +22 -2
  59. package/dist/Grid/index.d.cts.map +1 -0
  60. package/dist/Grid/index.d.ts +22 -2
  61. package/dist/Grid/index.d.ts.map +1 -0
  62. package/dist/Grid/index.js +2 -2
  63. package/dist/{Grid-D-VcRGi9.cjs → Grid-BbqCRkuY.cjs} +1 -8
  64. package/dist/{Grid-D-VcRGi9.cjs.map → Grid-BbqCRkuY.cjs.map} +1 -1
  65. package/dist/{Grid-BQpLOB0G.js → Grid-CTs-Rb9G.js} +2 -2
  66. package/dist/{Grid-BQpLOB0G.js.map → Grid-CTs-Rb9G.js.map} +1 -1
  67. package/dist/Input/index.cjs +96 -3
  68. package/dist/Input/index.cjs.map +1 -0
  69. package/dist/Input/index.d.cts +677 -2
  70. package/dist/Input/index.d.cts.map +1 -0
  71. package/dist/Input/index.d.ts +677 -2
  72. package/dist/Input/index.d.ts.map +1 -0
  73. package/dist/Input/index.js +96 -2
  74. package/dist/Input/index.js.map +1 -0
  75. package/dist/RadioBoxes/index.cjs +136 -4
  76. package/dist/RadioBoxes/index.cjs.map +1 -0
  77. package/dist/RadioBoxes/index.d.cts +1477 -2
  78. package/dist/RadioBoxes/index.d.cts.map +1 -0
  79. package/dist/RadioBoxes/index.d.ts +1477 -2
  80. package/dist/RadioBoxes/index.d.ts.map +1 -0
  81. package/dist/RadioBoxes/index.js +135 -2
  82. package/dist/RadioBoxes/index.js.map +1 -0
  83. package/dist/RadioTabs/index.cjs +123 -3
  84. package/dist/RadioTabs/index.cjs.map +1 -0
  85. package/dist/RadioTabs/index.d.cts +585 -2
  86. package/dist/RadioTabs/index.d.cts.map +1 -0
  87. package/dist/RadioTabs/index.d.ts +585 -2
  88. package/dist/RadioTabs/index.d.ts.map +1 -0
  89. package/dist/RadioTabs/index.js +120 -2
  90. package/dist/RadioTabs/index.js.map +1 -0
  91. package/dist/Radios/index.cjs +74 -3
  92. package/dist/Radios/index.cjs.map +1 -0
  93. package/dist/Radios/index.d.cts +1263 -2
  94. package/dist/Radios/index.d.cts.map +1 -0
  95. package/dist/Radios/index.d.ts +1263 -2
  96. package/dist/Radios/index.d.ts.map +1 -0
  97. package/dist/Radios/index.js +73 -2
  98. package/dist/Radios/index.js.map +1 -0
  99. package/dist/Select/index.cjs +286 -3
  100. package/dist/Select/index.cjs.map +1 -0
  101. package/dist/Select/index.d.cts +3917 -2
  102. package/dist/Select/index.d.cts.map +1 -0
  103. package/dist/Select/index.d.ts +3917 -2
  104. package/dist/Select/index.d.ts.map +1 -0
  105. package/dist/Select/index.js +283 -2
  106. package/dist/Select/index.js.map +1 -0
  107. package/dist/Slider/index.cjs +109 -3
  108. package/dist/Slider/index.cjs.map +1 -0
  109. package/dist/Slider/index.d.cts +1760 -2
  110. package/dist/Slider/index.d.cts.map +1 -0
  111. package/dist/Slider/index.d.ts +1760 -2
  112. package/dist/Slider/index.d.ts.map +1 -0
  113. package/dist/Slider/index.js +108 -2
  114. package/dist/Slider/index.js.map +1 -0
  115. package/dist/SubmitButton/index.cjs +31 -3
  116. package/dist/SubmitButton/index.cjs.map +1 -0
  117. package/dist/SubmitButton/index.d.cts +38 -2
  118. package/dist/SubmitButton/index.d.cts.map +1 -0
  119. package/dist/SubmitButton/index.d.ts +38 -2
  120. package/dist/SubmitButton/index.d.ts.map +1 -0
  121. package/dist/SubmitButton/index.js +31 -2
  122. package/dist/SubmitButton/index.js.map +1 -0
  123. package/dist/Switch/index.cjs +82 -3
  124. package/dist/Switch/index.cjs.map +1 -0
  125. package/dist/Switch/index.d.cts +1257 -2
  126. package/dist/Switch/index.d.cts.map +1 -0
  127. package/dist/Switch/index.d.ts +1257 -2
  128. package/dist/Switch/index.d.ts.map +1 -0
  129. package/dist/Switch/index.js +81 -2
  130. package/dist/Switch/index.js.map +1 -0
  131. package/dist/SwitchBox/index.cjs +154 -4
  132. package/dist/SwitchBox/index.cjs.map +1 -0
  133. package/dist/SwitchBox/index.d.cts +473 -2
  134. package/dist/SwitchBox/index.d.cts.map +1 -0
  135. package/dist/SwitchBox/index.d.ts +473 -2
  136. package/dist/SwitchBox/index.d.ts.map +1 -0
  137. package/dist/SwitchBox/index.js +153 -2
  138. package/dist/SwitchBox/index.js.map +1 -0
  139. package/dist/TextArea/index.cjs +66 -3
  140. package/dist/TextArea/index.cjs.map +1 -0
  141. package/dist/TextArea/index.d.cts +659 -2
  142. package/dist/TextArea/index.d.cts.map +1 -0
  143. package/dist/TextArea/index.d.ts +659 -2
  144. package/dist/TextArea/index.d.ts.map +1 -0
  145. package/dist/TextArea/index.js +66 -2
  146. package/dist/TextArea/index.js.map +1 -0
  147. package/dist/Time/index.cjs +221 -3
  148. package/dist/Time/index.cjs.map +1 -0
  149. package/dist/Time/index.d.cts +1028 -2
  150. package/dist/Time/index.d.cts.map +1 -0
  151. package/dist/Time/index.d.ts +1028 -2
  152. package/dist/Time/index.d.ts.map +1 -0
  153. package/dist/Time/index.js +216 -2
  154. package/dist/Time/index.js.map +1 -0
  155. package/dist/helpers/index.cjs +0 -1
  156. package/dist/helpers/index.cjs.map +1 -1
  157. package/dist/helpers/index.js.map +1 -1
  158. package/dist/hooks/useClientValidation/index.cjs +177 -3
  159. package/dist/hooks/useClientValidation/index.cjs.map +1 -1
  160. package/dist/hooks/useClientValidation/index.d.cts +148 -2
  161. package/dist/hooks/useClientValidation/index.d.cts.map +1 -0
  162. package/dist/hooks/useClientValidation/index.d.ts +148 -2
  163. package/dist/hooks/useClientValidation/index.d.ts.map +1 -0
  164. package/dist/hooks/useClientValidation/index.js +175 -1
  165. package/dist/hooks/useClientValidation/index.js.map +1 -1
  166. package/dist/hooks/useController/index.cjs +1 -1
  167. package/dist/hooks/useController/index.d.cts +1 -1
  168. package/dist/hooks/useController/index.d.ts +1 -1
  169. package/dist/hooks/useController/index.js +1 -1
  170. package/dist/hooks/useFormContext/index.cjs +1 -1
  171. package/dist/hooks/useFormContext/index.d.cts +1 -1
  172. package/dist/hooks/useFormContext/index.d.ts +1 -1
  173. package/dist/hooks/useFormContext/index.js +1 -1
  174. package/dist/hooks/useInput/index.cjs +0 -1
  175. package/dist/hooks/useInput/index.d.cts +1 -1
  176. package/dist/hooks/useInput/index.d.ts +1 -1
  177. package/dist/hooks/useInput/index.js +1 -1
  178. package/dist/hooks/useInputValueDebounce/index.cjs +1 -2
  179. package/dist/hooks/useInputValueDebounce/index.cjs.map +1 -1
  180. package/dist/hooks/useInputValueDebounce/index.d.cts +66 -2
  181. package/dist/hooks/useInputValueDebounce/index.d.cts.map +1 -0
  182. package/dist/hooks/useInputValueDebounce/index.d.ts +66 -2
  183. package/dist/hooks/useInputValueDebounce/index.d.ts.map +1 -0
  184. package/dist/hooks/useInputValueDebounce/index.js +1 -1
  185. package/dist/hooks/useInputValueTransform/index.cjs +1 -1
  186. package/dist/hooks/useInputValueTransform/index.d.cts +1 -1
  187. package/dist/hooks/useInputValueTransform/index.d.ts +1 -1
  188. package/dist/hooks/useInputValueTransform/index.js +1 -1
  189. package/dist/hooks/useUniformField/index.cjs +8 -8
  190. package/dist/hooks/useUniformField/index.cjs.map +1 -1
  191. package/dist/hooks/useUniformField/index.d.cts +98 -2
  192. package/dist/hooks/useUniformField/index.d.cts.map +1 -0
  193. package/dist/hooks/useUniformField/index.d.ts +98 -2
  194. package/dist/hooks/useUniformField/index.d.ts.map +1 -0
  195. package/dist/hooks/useUniformField/index.js +8 -8
  196. package/dist/hooks/useUniformField/index.js.map +1 -1
  197. package/dist/hooks/useUniformFieldArray/index.cjs +1 -2
  198. package/dist/hooks/useUniformFieldArray/index.cjs.map +1 -1
  199. package/dist/hooks/useUniformFieldArray/index.d.cts +79 -2
  200. package/dist/hooks/useUniformFieldArray/index.d.cts.map +1 -0
  201. package/dist/hooks/useUniformFieldArray/index.d.ts +79 -2
  202. package/dist/hooks/useUniformFieldArray/index.d.ts.map +1 -0
  203. package/dist/hooks/useUniformFieldArray/index.js +1 -1
  204. package/dist/hooks/useWatchFormReset/index.cjs +1 -2
  205. package/dist/hooks/useWatchFormReset/index.cjs.map +1 -1
  206. package/dist/hooks/useWatchFormReset/index.d.cts +38 -2
  207. package/dist/hooks/useWatchFormReset/index.d.cts.map +1 -0
  208. package/dist/hooks/useWatchFormReset/index.d.ts +38 -2
  209. package/dist/hooks/useWatchFormReset/index.d.ts.map +1 -0
  210. package/dist/hooks/useWatchFormReset/index.js +1 -1
  211. package/dist/hooks/useWatchUserChange/index.cjs +82 -2
  212. package/dist/hooks/useWatchUserChange/index.cjs.map +1 -1
  213. package/dist/hooks/useWatchUserChange/index.d.cts +80 -2
  214. package/dist/hooks/useWatchUserChange/index.d.cts.map +1 -0
  215. package/dist/hooks/useWatchUserChange/index.d.ts +80 -2
  216. package/dist/hooks/useWatchUserChange/index.d.ts.map +1 -0
  217. package/dist/hooks/useWatchUserChange/index.js +81 -1
  218. package/dist/hooks/useWatchUserChange/index.js.map +1 -1
  219. package/dist/partials/FieldCopyTestIdButton/index.cjs +1 -2
  220. package/dist/partials/FieldCopyTestIdButton/index.d.cts +14 -2
  221. package/dist/partials/FieldCopyTestIdButton/index.d.cts.map +1 -0
  222. package/dist/partials/FieldCopyTestIdButton/index.d.ts +14 -2
  223. package/dist/partials/FieldCopyTestIdButton/index.d.ts.map +1 -0
  224. package/dist/partials/FieldCopyTestIdButton/index.js +2 -2
  225. package/dist/partials/FieldValidationError/index.cjs +1 -2
  226. package/dist/partials/FieldValidationError/index.d.cts +22 -2
  227. package/dist/partials/FieldValidationError/index.d.cts.map +1 -0
  228. package/dist/partials/FieldValidationError/index.d.ts +22 -2
  229. package/dist/partials/FieldValidationError/index.d.ts.map +1 -0
  230. package/dist/partials/FieldValidationError/index.js +2 -2
  231. package/dist/{useController-CzP0aVFC.d.ts → useController-CvQqCvFJ.d.ts} +1 -1
  232. package/dist/{useController-CzP0aVFC.d.ts.map → useController-CvQqCvFJ.d.ts.map} +1 -1
  233. package/dist/{useController--lRPWBuD.cjs → useController-Dbe7ADG6.cjs} +2 -2
  234. package/dist/{useController--lRPWBuD.cjs.map → useController-Dbe7ADG6.cjs.map} +1 -1
  235. package/dist/{useController-B287flU_.js → useController-DxFS0u7c.js} +2 -2
  236. package/dist/{useController-B287flU_.js.map → useController-DxFS0u7c.js.map} +1 -1
  237. package/dist/{useController-BT3Fd0IO.d.cts → useController-fblEApv_.d.cts} +1 -1
  238. package/dist/{useController-BT3Fd0IO.d.cts.map → useController-fblEApv_.d.cts.map} +1 -1
  239. package/dist/{useFormContext-CpLVpNAf.d.ts → useFormContext-B1-deU4Z.d.ts} +4 -4
  240. package/dist/{useFormContext-CpLVpNAf.d.ts.map → useFormContext-B1-deU4Z.d.ts.map} +1 -1
  241. package/dist/{useFormContext-CT8H8xIe.js → useFormContext-BJqa1FoT.js} +2 -2
  242. package/dist/{useFormContext-CT8H8xIe.js.map → useFormContext-BJqa1FoT.js.map} +1 -1
  243. package/dist/{useFormContext-Ddc1HWKv.d.cts → useFormContext-D5vrT2sg.d.cts} +4 -4
  244. package/dist/{useFormContext-Ddc1HWKv.d.cts.map → useFormContext-D5vrT2sg.d.cts.map} +1 -1
  245. package/dist/{useFormContext-CrXwNYiB.cjs → useFormContext-kUHonwgu.cjs} +2 -2
  246. package/dist/{useFormContext-CrXwNYiB.cjs.map → useFormContext-kUHonwgu.cjs.map} +1 -1
  247. package/dist/{useInputValueTransform-CNCBU7a9.d.cts → useInputValueTransform-DCXXb2Lp.d.cts} +1 -1
  248. package/dist/{useInputValueTransform-CNCBU7a9.d.cts.map → useInputValueTransform-DCXXb2Lp.d.cts.map} +1 -1
  249. package/dist/{useInputValueTransform-dLfFIYW4.d.ts → useInputValueTransform-DCXXb2Lp.d.ts} +1 -1
  250. package/dist/{useInputValueTransform-dLfFIYW4.d.ts.map → useInputValueTransform-DCXXb2Lp.d.ts.map} +1 -1
  251. package/dist/{useInputValueTransform-CXdmtc0Q.js → useInputValueTransform-DJ5zkqSy.js} +1 -1
  252. package/dist/{useInputValueTransform-CXdmtc0Q.js.map → useInputValueTransform-DJ5zkqSy.js.map} +1 -1
  253. package/dist/{useInputValueTransform-Bm65K8LX.cjs → useInputValueTransform-P62UUZBl.cjs} +1 -2
  254. package/dist/{useInputValueTransform-Bm65K8LX.cjs.map → useInputValueTransform-P62UUZBl.cjs.map} +1 -1
  255. package/package.json +6 -13
  256. package/dist/Checkboxes-D1hppxDE.js +0 -112
  257. package/dist/Checkboxes-D1hppxDE.js.map +0 -1
  258. package/dist/Checkboxes-DHk09GmH.cjs +0 -124
  259. package/dist/Checkboxes-DHk09GmH.cjs.map +0 -1
  260. package/dist/DatePicker-BUSi8SWQ.js +0 -193
  261. package/dist/DatePicker-BUSi8SWQ.js.map +0 -1
  262. package/dist/DatePicker-DuBjvS5g.cjs +0 -205
  263. package/dist/DatePicker-DuBjvS5g.cjs.map +0 -1
  264. package/dist/FieldArray-BxmK1NRd.js +0 -494
  265. package/dist/FieldArray-BxmK1NRd.js.map +0 -1
  266. package/dist/FieldArray-DgiQpIdr.cjs +0 -506
  267. package/dist/FieldArray-DgiQpIdr.cjs.map +0 -1
  268. package/dist/FieldCard-BK6SNqFY.js +0 -222
  269. package/dist/FieldCard-BK6SNqFY.js.map +0 -1
  270. package/dist/FieldCard-C-DZ5ARr.cjs +0 -234
  271. package/dist/FieldCard-C-DZ5ARr.cjs.map +0 -1
  272. package/dist/Form-CYlsIABv.cjs +0 -125
  273. package/dist/Form-CYlsIABv.cjs.map +0 -1
  274. package/dist/Form-D3yfDu4L.js +0 -114
  275. package/dist/Form-D3yfDu4L.js.map +0 -1
  276. package/dist/Input-B5RxbkNS.js +0 -96
  277. package/dist/Input-B5RxbkNS.js.map +0 -1
  278. package/dist/Input-DvVViuWH.cjs +0 -108
  279. package/dist/Input-DvVViuWH.cjs.map +0 -1
  280. package/dist/RadioBoxes-BJz-aJp3.js +0 -135
  281. package/dist/RadioBoxes-BJz-aJp3.js.map +0 -1
  282. package/dist/RadioBoxes-CR--FBhQ.cjs +0 -153
  283. package/dist/RadioBoxes-CR--FBhQ.cjs.map +0 -1
  284. package/dist/RadioTabs-Btt582Nl.cjs +0 -133
  285. package/dist/RadioTabs-Btt582Nl.cjs.map +0 -1
  286. package/dist/RadioTabs-CYmzrPBG.js +0 -120
  287. package/dist/RadioTabs-CYmzrPBG.js.map +0 -1
  288. package/dist/Radios-DZxhrX96.js +0 -73
  289. package/dist/Radios-DZxhrX96.js.map +0 -1
  290. package/dist/Radios-Jg9mwE0B.cjs +0 -85
  291. package/dist/Radios-Jg9mwE0B.cjs.map +0 -1
  292. package/dist/Select-CZwuEAB5.cjs +0 -296
  293. package/dist/Select-CZwuEAB5.cjs.map +0 -1
  294. package/dist/Select-CgeqhZIC.js +0 -283
  295. package/dist/Select-CgeqhZIC.js.map +0 -1
  296. package/dist/Slider-Bpxt-Qgj.cjs +0 -120
  297. package/dist/Slider-Bpxt-Qgj.cjs.map +0 -1
  298. package/dist/Slider-DRfSw0uE.js +0 -108
  299. package/dist/Slider-DRfSw0uE.js.map +0 -1
  300. package/dist/SubmitButton-D-wn1PJV.cjs +0 -43
  301. package/dist/SubmitButton-D-wn1PJV.cjs.map +0 -1
  302. package/dist/SubmitButton-D6aU7IgC.js +0 -31
  303. package/dist/SubmitButton-D6aU7IgC.js.map +0 -1
  304. package/dist/Switch-D9DNrqmj.js +0 -81
  305. package/dist/Switch-D9DNrqmj.js.map +0 -1
  306. package/dist/Switch-hjjy34QB.cjs +0 -93
  307. package/dist/Switch-hjjy34QB.cjs.map +0 -1
  308. package/dist/SwitchBox-BU1XieaZ.js +0 -153
  309. package/dist/SwitchBox-BU1XieaZ.js.map +0 -1
  310. package/dist/SwitchBox-Dl-F5y2m.cjs +0 -171
  311. package/dist/SwitchBox-Dl-F5y2m.cjs.map +0 -1
  312. package/dist/TextArea-CMXm-kTK.cjs +0 -78
  313. package/dist/TextArea-CMXm-kTK.cjs.map +0 -1
  314. package/dist/TextArea-DAg_K-QP.js +0 -66
  315. package/dist/TextArea-DAg_K-QP.js.map +0 -1
  316. package/dist/Time-CDptQ3CK.js +0 -213
  317. package/dist/Time-CDptQ3CK.js.map +0 -1
  318. package/dist/Time-WKgbji5k.cjs +0 -219
  319. package/dist/Time-WKgbji5k.cjs.map +0 -1
  320. package/dist/index-54OZEaUU.d.ts +0 -43
  321. package/dist/index-54OZEaUU.d.ts.map +0 -1
  322. package/dist/index-7UT2Ki5e.d.cts +0 -113
  323. package/dist/index-7UT2Ki5e.d.cts.map +0 -1
  324. package/dist/index-9_3XTDJC.d.cts +0 -174
  325. package/dist/index-9_3XTDJC.d.cts.map +0 -1
  326. package/dist/index-B5SfdA5O.d.cts +0 -99
  327. package/dist/index-B5SfdA5O.d.cts.map +0 -1
  328. package/dist/index-B61zRzeS.d.cts +0 -101
  329. package/dist/index-B61zRzeS.d.cts.map +0 -1
  330. package/dist/index-B7gQppgQ.d.ts +0 -116
  331. package/dist/index-B7gQppgQ.d.ts.map +0 -1
  332. package/dist/index-BDFJDKmz.d.ts +0 -166
  333. package/dist/index-BDFJDKmz.d.ts.map +0 -1
  334. package/dist/index-BPaSE_7b.d.ts +0 -179
  335. package/dist/index-BPaSE_7b.d.ts.map +0 -1
  336. package/dist/index-BSjcTo7A.d.ts +0 -147
  337. package/dist/index-BSjcTo7A.d.ts.map +0 -1
  338. package/dist/index-BmMspnsJ.d.cts +0 -137
  339. package/dist/index-BmMspnsJ.d.cts.map +0 -1
  340. package/dist/index-BqxDWhNr.d.cts +0 -22
  341. package/dist/index-BqxDWhNr.d.cts.map +0 -1
  342. package/dist/index-Bzs7_gnk.d.cts +0 -116
  343. package/dist/index-Bzs7_gnk.d.cts.map +0 -1
  344. package/dist/index-C3-TV4Up.d.cts +0 -43
  345. package/dist/index-C3-TV4Up.d.cts.map +0 -1
  346. package/dist/index-C4GJH8Xv.d.ts +0 -290
  347. package/dist/index-C4GJH8Xv.d.ts.map +0 -1
  348. package/dist/index-CE8fnXuQ.d.ts +0 -167
  349. package/dist/index-CE8fnXuQ.d.ts.map +0 -1
  350. package/dist/index-CEJxjf5R.d.ts +0 -22
  351. package/dist/index-CEJxjf5R.d.ts.map +0 -1
  352. package/dist/index-CHQKk_fN2.d.ts +0 -14
  353. package/dist/index-CHQKk_fN2.d.ts.map +0 -1
  354. package/dist/index-CIiOXrrY.d.ts +0 -99
  355. package/dist/index-CIiOXrrY.d.ts.map +0 -1
  356. package/dist/index-CV7wqRev.d.ts +0 -38
  357. package/dist/index-CV7wqRev.d.ts.map +0 -1
  358. package/dist/index-CXvUaeCL.d.cts +0 -14
  359. package/dist/index-CXvUaeCL.d.cts.map +0 -1
  360. package/dist/index-C_zjtsGM.d.ts +0 -113
  361. package/dist/index-C_zjtsGM.d.ts.map +0 -1
  362. package/dist/index-CbPJiRK2.d.ts +0 -83
  363. package/dist/index-CbPJiRK2.d.ts.map +0 -1
  364. package/dist/index-CvP3tbVV.d.ts +0 -137
  365. package/dist/index-CvP3tbVV.d.ts.map +0 -1
  366. package/dist/index-Cwb7sTO0.d.ts +0 -154
  367. package/dist/index-Cwb7sTO0.d.ts.map +0 -1
  368. package/dist/index-CxY9VWv5.d.cts +0 -154
  369. package/dist/index-CxY9VWv5.d.cts.map +0 -1
  370. package/dist/index-D8udSkgA.d.cts +0 -167
  371. package/dist/index-D8udSkgA.d.cts.map +0 -1
  372. package/dist/index-DBsF7xsq.d.cts +0 -147
  373. package/dist/index-DBsF7xsq.d.cts.map +0 -1
  374. package/dist/index-DNADTCoc.d.cts +0 -290
  375. package/dist/index-DNADTCoc.d.cts.map +0 -1
  376. package/dist/index-DRg0anjB.d.cts +0 -179
  377. package/dist/index-DRg0anjB.d.cts.map +0 -1
  378. package/dist/index-DUmNI6cE.d.cts +0 -83
  379. package/dist/index-DUmNI6cE.d.cts.map +0 -1
  380. package/dist/index-Db0WD4d1.d.cts +0 -166
  381. package/dist/index-Db0WD4d1.d.cts.map +0 -1
  382. package/dist/index-DpXSZCZe.d.cts +0 -38
  383. package/dist/index-DpXSZCZe.d.cts.map +0 -1
  384. package/dist/index-GxTY7aAc.d.ts +0 -174
  385. package/dist/index-GxTY7aAc.d.ts.map +0 -1
  386. package/dist/index-P30z4VRT.d.cts +0 -22
  387. package/dist/index-P30z4VRT.d.cts.map +0 -1
  388. package/dist/index-PMCqBX0t.d.ts +0 -101
  389. package/dist/index-PMCqBX0t.d.ts.map +0 -1
  390. package/dist/index-PWRw2bPH.d.ts +0 -22
  391. package/dist/index-PWRw2bPH.d.ts.map +0 -1
  392. package/dist/index-QgVr4iWX.d.cts +0 -122
  393. package/dist/index-QgVr4iWX.d.cts.map +0 -1
  394. package/dist/index-dgho7gpc.d.ts +0 -122
  395. package/dist/index-dgho7gpc.d.ts.map +0 -1
  396. package/dist/index.cjs +0 -85
  397. package/dist/index.cjs.map +0 -1
  398. package/dist/index.d.cts +0 -31
  399. package/dist/index.d.ts +0 -31
  400. package/dist/index.js +0 -36
  401. package/dist/index.js.map +0 -1
  402. package/dist/useClientValidation-BRfhqRom.cjs +0 -190
  403. package/dist/useClientValidation-BRfhqRom.cjs.map +0 -1
  404. package/dist/useClientValidation-C2dLJnDI.d.cts +0 -148
  405. package/dist/useClientValidation-C2dLJnDI.d.cts.map +0 -1
  406. package/dist/useClientValidation-DpLdzIAb.js +0 -178
  407. package/dist/useClientValidation-DpLdzIAb.js.map +0 -1
  408. package/dist/useClientValidation-qRq2_spX.d.ts +0 -148
  409. package/dist/useClientValidation-qRq2_spX.d.ts.map +0 -1
  410. package/dist/useInputValueDebounce-CfQDiomI.d.cts +0 -66
  411. package/dist/useInputValueDebounce-CfQDiomI.d.cts.map +0 -1
  412. package/dist/useInputValueDebounce-DZgzL7GQ.d.ts +0 -66
  413. package/dist/useInputValueDebounce-DZgzL7GQ.d.ts.map +0 -1
  414. package/dist/useUniformField-CmAYcGER.d.cts +0 -98
  415. package/dist/useUniformField-CmAYcGER.d.cts.map +0 -1
  416. package/dist/useUniformField-DJDpQzRo.d.ts +0 -98
  417. package/dist/useUniformField-DJDpQzRo.d.ts.map +0 -1
  418. package/dist/useUniformFieldArray-D3fdzwzD.d.cts +0 -79
  419. package/dist/useUniformFieldArray-D3fdzwzD.d.cts.map +0 -1
  420. package/dist/useUniformFieldArray-zGcIhwhF.d.ts +0 -79
  421. package/dist/useUniformFieldArray-zGcIhwhF.d.ts.map +0 -1
  422. package/dist/useWatchFormReset-BSd6jMxU.d.cts +0 -38
  423. package/dist/useWatchFormReset-BSd6jMxU.d.cts.map +0 -1
  424. package/dist/useWatchFormReset-C7YJ-I3N.d.ts +0 -38
  425. package/dist/useWatchFormReset-C7YJ-I3N.d.ts.map +0 -1
  426. package/dist/useWatchUserChange-C1xWHtFG.cjs +0 -90
  427. package/dist/useWatchUserChange-C1xWHtFG.cjs.map +0 -1
  428. package/dist/useWatchUserChange-CpyZz2i7.d.ts +0 -80
  429. package/dist/useWatchUserChange-CpyZz2i7.d.ts.map +0 -1
  430. package/dist/useWatchUserChange-DSAboNCs.d.cts +0 -80
  431. package/dist/useWatchUserChange-DSAboNCs.d.cts.map +0 -1
  432. package/dist/useWatchUserChange-DSQGsl1R.js +0 -84
  433. package/dist/useWatchUserChange-DSQGsl1R.js.map +0 -1
  434. /package/dist/{index-BLwMeReG.d.ts → index-BKZ67WMa.d.cts} +0 -0
  435. /package/dist/{index-C2gUMYkE.d.cts → index-BKZ67WMa.d.ts} +0 -0
  436. /package/dist/{index-CJgP-E0M.d.cts → index-BVVgDSdq.d.cts} +0 -0
  437. /package/dist/{index-Cg9utiy0.d.ts → index-BVVgDSdq.d.ts} +0 -0
  438. /package/dist/{index-CspKFJM1.d.cts → index-DmtQKWjk.d.cts} +0 -0
  439. /package/dist/{index-h64gcVNJ.d.ts → index-DmtQKWjk.d.ts} +0 -0
  440. /package/dist/{useInput-CVm3tP78.js → useInput-C0aJaAGe.js} +0 -0
  441. /package/dist/{useInput-BdH8oftG.d.ts → useInput-ClpHDPdr.d.cts} +0 -0
  442. /package/dist/{useInput-DZOmMKcp.d.cts → useInput-ClpHDPdr.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"useController--lRPWBuD.cjs","names":["UniformContext","toNullishString","fromNullishString"],"sources":["../src/hooks/useController/useController.ts"],"sourcesContent":["import type {\n ControllerFieldState,\n ControllerRenderProps,\n UseControllerProps as RHFUseControllerProps,\n UseFormStateReturn,\n} from 'react-hook-form';\n\nimport { useContext } from 'react';\nimport { useController as useRHFController } from 'react-hook-form';\n\nimport { UniformContext } from '../../Form/subcomponents/FormContext';\nimport { fromNullishString, toNullishString } from '../../helpers';\n\nexport type UseControllerProps<TFieldValues extends object = object> =\n RHFUseControllerProps<TFieldValues>;\n\nexport interface UseControllerReturn<TFieldValues extends object = object> {\n field: Omit<ControllerRenderProps<TFieldValues>, 'onChange' | 'value'> & {\n // Using any[] to support both direct value changes and React synthetic events\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange: (...event: any[]) => void;\n value: string;\n };\n formState: UseFormStateReturn<TFieldValues>;\n fieldState: ControllerFieldState;\n}\n\n/**\n * A wrapper around react-hook-form's useController that transparently handles nullish string conversions.\n *\n * Key features:\n * 1. Empty strings ('') in the UI are stored as null in form state\n * 2. Null/undefined values in form state are displayed as empty strings in the UI\n * 3. Handles both direct value changes and React synthetic events\n * 4. Maintains the same API as react-hook-form's useController\n * 5. Notifies UniformContext's userChange listeners on field changes (enables useWatchUserChange hook)\n * 6. No-op when value unchanged: onChange is ignored if the new value equals the current value\n * (prevents unnecessary re-renders and spurious useWatchUserChange triggers)\n *\n * This enables consistent handling of empty/null values while keeping a clean API\n * for form inputs that expect string values.\n *\n * @see https://react-hook-form.com/docs/usecontroller\n */\nexport const useController = <TFieldValues extends object = object>(\n props: UseControllerProps<TFieldValues>,\n): UseControllerReturn<TFieldValues> => {\n const { field, formState, fieldState } = useRHFController(props);\n const { userChange } = useContext(UniformContext);\n\n return {\n field: {\n ...field,\n // Handles both direct values (onChange(\"value\")) and events (onChange(event))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange: (...event: any[]) => {\n const value = event[0]?.target?.value ?? event[0];\n const formattedValue = value === '' ? '' : toNullishString(value);\n\n // Skip if value hasn't changed (e.g., user re-selects same option)\n // We compare formattedValue (the new value after nullish conversion) with\n // field.value (the current stored value, also in nullish format)\n if (formattedValue === field.value) {\n return;\n }\n\n // Update form state first\n field.onChange(formattedValue);\n\n // Then notify userChange listeners (for useWatchUserChange hook)\n // This ensures getValues() in listeners returns the updated value\n // Guard against undefined userChange (when used outside FormProvider)\n // NOTE: We notify with the original value (not formattedValue) so that\n // listeners receive the actual value (false, 0, null) instead of marker\n // strings like '__FALSE__', '__ZERO__', '__NULL__'\n userChange?.notify(field.name, value);\n },\n // Convert null/undefined to empty string for UI display\n value: fromNullishString(field.value) as string,\n },\n formState,\n fieldState,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAa,iBACX,UACsC;CACtC,MAAM,EAAE,OAAO,WAAW,gBAAA,GAAA,gBAAA,eAAgC,KAAK;CAC/D,MAAM,EAAE,gBAAA,GAAA,MAAA,YAA0BA,oBAAAA,cAAc;CAEhD,OAAO;EACL,OAAO;GACL,GAAG;GAGH,WAAW,GAAG,UAAiB;IAC7B,MAAM,QAAQ,MAAM,IAAI,QAAQ,SAAS,MAAM;IAC/C,MAAM,iBAAiB,UAAU,KAAK,KAAKC,sBAAAA,gBAAgB,KAAK;IAKhE,IAAI,mBAAmB,MAAM,OAC3B;IAIF,MAAM,SAAS,cAAc;IAQ7B,YAAY,OAAO,MAAM,MAAM,KAAK;GACtC;GAEA,OAAOC,sBAAAA,kBAAkB,MAAM,KAAK;EACtC;EACA;EACA;CACF;AACF"}
1
+ {"version":3,"file":"useController-Dbe7ADG6.cjs","names":["UniformContext","toNullishString","fromNullishString"],"sources":["../src/hooks/useController/useController.ts"],"sourcesContent":["import type {\n ControllerFieldState,\n ControllerRenderProps,\n UseControllerProps as RHFUseControllerProps,\n UseFormStateReturn,\n} from 'react-hook-form';\n\nimport { useContext } from 'react';\nimport { useController as useRHFController } from 'react-hook-form';\n\nimport { UniformContext } from '../../Form/subcomponents/FormContext';\nimport { fromNullishString, toNullishString } from '../../helpers';\n\nexport type UseControllerProps<TFieldValues extends object = object> =\n RHFUseControllerProps<TFieldValues>;\n\nexport interface UseControllerReturn<TFieldValues extends object = object> {\n field: Omit<ControllerRenderProps<TFieldValues>, 'onChange' | 'value'> & {\n // Using any[] to support both direct value changes and React synthetic events\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange: (...event: any[]) => void;\n value: string;\n };\n formState: UseFormStateReturn<TFieldValues>;\n fieldState: ControllerFieldState;\n}\n\n/**\n * A wrapper around react-hook-form's useController that transparently handles nullish string conversions.\n *\n * Key features:\n * 1. Empty strings ('') in the UI are stored as null in form state\n * 2. Null/undefined values in form state are displayed as empty strings in the UI\n * 3. Handles both direct value changes and React synthetic events\n * 4. Maintains the same API as react-hook-form's useController\n * 5. Notifies UniformContext's userChange listeners on field changes (enables useWatchUserChange hook)\n * 6. No-op when value unchanged: onChange is ignored if the new value equals the current value\n * (prevents unnecessary re-renders and spurious useWatchUserChange triggers)\n *\n * This enables consistent handling of empty/null values while keeping a clean API\n * for form inputs that expect string values.\n *\n * @see https://react-hook-form.com/docs/usecontroller\n */\nexport const useController = <TFieldValues extends object = object>(\n props: UseControllerProps<TFieldValues>,\n): UseControllerReturn<TFieldValues> => {\n const { field, formState, fieldState } = useRHFController(props);\n const { userChange } = useContext(UniformContext);\n\n return {\n field: {\n ...field,\n // Handles both direct values (onChange(\"value\")) and events (onChange(event))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange: (...event: any[]) => {\n const value = event[0]?.target?.value ?? event[0];\n const formattedValue = value === '' ? '' : toNullishString(value);\n\n // Skip if value hasn't changed (e.g., user re-selects same option)\n // We compare formattedValue (the new value after nullish conversion) with\n // field.value (the current stored value, also in nullish format)\n if (formattedValue === field.value) {\n return;\n }\n\n // Update form state first\n field.onChange(formattedValue);\n\n // Then notify userChange listeners (for useWatchUserChange hook)\n // This ensures getValues() in listeners returns the updated value\n // Guard against undefined userChange (when used outside FormProvider)\n // NOTE: We notify with the original value (not formattedValue) so that\n // listeners receive the actual value (false, 0, null) instead of marker\n // strings like '__FALSE__', '__ZERO__', '__NULL__'\n userChange?.notify(field.name, value);\n },\n // Convert null/undefined to empty string for UI display\n value: fromNullishString(field.value) as string,\n },\n formState,\n fieldState,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAa,iBACX,UACsC;CACtC,MAAM,EAAE,OAAO,WAAW,gBAAA,GAAA,gBAAA,eAAgC,KAAK;CAC/D,MAAM,EAAE,gBAAA,GAAA,MAAA,YAA0BA,oBAAAA,cAAc;CAEhD,OAAO;EACL,OAAO;GACL,GAAG;GAGH,WAAW,GAAG,UAAiB;IAC7B,MAAM,QAAQ,MAAM,IAAI,QAAQ,SAAS,MAAM;IAC/C,MAAM,iBAAiB,UAAU,KAAK,KAAKC,sBAAAA,gBAAgB,KAAK;IAKhE,IAAI,mBAAmB,MAAM,OAC3B;IAIF,MAAM,SAAS,cAAc;IAQ7B,YAAY,OAAO,MAAM,MAAM,KAAK;GACtC;GAEA,OAAOC,sBAAAA,kBAAkB,MAAM,KAAK;EACtC;EACA;EACA;CACF;AACF"}
@@ -1,5 +1,5 @@
1
1
  import { fromNullishString, toNullishString } from "./helpers/index.js";
2
- import { n as UniformContext } from "./FormContext-BQeKOV-0.js";
2
+ import { n as UniformContext } from "./FormContext-DjJOJKxj.js";
3
3
  import { useContext } from "react";
4
4
  import { useController } from "react-hook-form";
5
5
  //#region src/hooks/useController/useController.ts
@@ -42,4 +42,4 @@ const useController$1 = (props) => {
42
42
  //#endregion
43
43
  export { useController$1 as t };
44
44
 
45
- //# sourceMappingURL=useController-B287flU_.js.map
45
+ //# sourceMappingURL=useController-DxFS0u7c.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useController-B287flU_.js","names":["useController","useRHFController"],"sources":["../src/hooks/useController/useController.ts"],"sourcesContent":["import type {\n ControllerFieldState,\n ControllerRenderProps,\n UseControllerProps as RHFUseControllerProps,\n UseFormStateReturn,\n} from 'react-hook-form';\n\nimport { useContext } from 'react';\nimport { useController as useRHFController } from 'react-hook-form';\n\nimport { UniformContext } from '../../Form/subcomponents/FormContext';\nimport { fromNullishString, toNullishString } from '../../helpers';\n\nexport type UseControllerProps<TFieldValues extends object = object> =\n RHFUseControllerProps<TFieldValues>;\n\nexport interface UseControllerReturn<TFieldValues extends object = object> {\n field: Omit<ControllerRenderProps<TFieldValues>, 'onChange' | 'value'> & {\n // Using any[] to support both direct value changes and React synthetic events\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange: (...event: any[]) => void;\n value: string;\n };\n formState: UseFormStateReturn<TFieldValues>;\n fieldState: ControllerFieldState;\n}\n\n/**\n * A wrapper around react-hook-form's useController that transparently handles nullish string conversions.\n *\n * Key features:\n * 1. Empty strings ('') in the UI are stored as null in form state\n * 2. Null/undefined values in form state are displayed as empty strings in the UI\n * 3. Handles both direct value changes and React synthetic events\n * 4. Maintains the same API as react-hook-form's useController\n * 5. Notifies UniformContext's userChange listeners on field changes (enables useWatchUserChange hook)\n * 6. No-op when value unchanged: onChange is ignored if the new value equals the current value\n * (prevents unnecessary re-renders and spurious useWatchUserChange triggers)\n *\n * This enables consistent handling of empty/null values while keeping a clean API\n * for form inputs that expect string values.\n *\n * @see https://react-hook-form.com/docs/usecontroller\n */\nexport const useController = <TFieldValues extends object = object>(\n props: UseControllerProps<TFieldValues>,\n): UseControllerReturn<TFieldValues> => {\n const { field, formState, fieldState } = useRHFController(props);\n const { userChange } = useContext(UniformContext);\n\n return {\n field: {\n ...field,\n // Handles both direct values (onChange(\"value\")) and events (onChange(event))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange: (...event: any[]) => {\n const value = event[0]?.target?.value ?? event[0];\n const formattedValue = value === '' ? '' : toNullishString(value);\n\n // Skip if value hasn't changed (e.g., user re-selects same option)\n // We compare formattedValue (the new value after nullish conversion) with\n // field.value (the current stored value, also in nullish format)\n if (formattedValue === field.value) {\n return;\n }\n\n // Update form state first\n field.onChange(formattedValue);\n\n // Then notify userChange listeners (for useWatchUserChange hook)\n // This ensures getValues() in listeners returns the updated value\n // Guard against undefined userChange (when used outside FormProvider)\n // NOTE: We notify with the original value (not formattedValue) so that\n // listeners receive the actual value (false, 0, null) instead of marker\n // strings like '__FALSE__', '__ZERO__', '__NULL__'\n userChange?.notify(field.name, value);\n },\n // Convert null/undefined to empty string for UI display\n value: fromNullishString(field.value) as string,\n },\n formState,\n fieldState,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAaA,mBACX,UACsC;CACtC,MAAM,EAAE,OAAO,WAAW,eAAeC,cAAiB,KAAK;CAC/D,MAAM,EAAE,eAAe,WAAW,cAAc;CAEhD,OAAO;EACL,OAAO;GACL,GAAG;GAGH,WAAW,GAAG,UAAiB;IAC7B,MAAM,QAAQ,MAAM,IAAI,QAAQ,SAAS,MAAM;IAC/C,MAAM,iBAAiB,UAAU,KAAK,KAAK,gBAAgB,KAAK;IAKhE,IAAI,mBAAmB,MAAM,OAC3B;IAIF,MAAM,SAAS,cAAc;IAQ7B,YAAY,OAAO,MAAM,MAAM,KAAK;GACtC;GAEA,OAAO,kBAAkB,MAAM,KAAK;EACtC;EACA;EACA;CACF;AACF"}
1
+ {"version":3,"file":"useController-DxFS0u7c.js","names":["useController","useRHFController"],"sources":["../src/hooks/useController/useController.ts"],"sourcesContent":["import type {\n ControllerFieldState,\n ControllerRenderProps,\n UseControllerProps as RHFUseControllerProps,\n UseFormStateReturn,\n} from 'react-hook-form';\n\nimport { useContext } from 'react';\nimport { useController as useRHFController } from 'react-hook-form';\n\nimport { UniformContext } from '../../Form/subcomponents/FormContext';\nimport { fromNullishString, toNullishString } from '../../helpers';\n\nexport type UseControllerProps<TFieldValues extends object = object> =\n RHFUseControllerProps<TFieldValues>;\n\nexport interface UseControllerReturn<TFieldValues extends object = object> {\n field: Omit<ControllerRenderProps<TFieldValues>, 'onChange' | 'value'> & {\n // Using any[] to support both direct value changes and React synthetic events\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange: (...event: any[]) => void;\n value: string;\n };\n formState: UseFormStateReturn<TFieldValues>;\n fieldState: ControllerFieldState;\n}\n\n/**\n * A wrapper around react-hook-form's useController that transparently handles nullish string conversions.\n *\n * Key features:\n * 1. Empty strings ('') in the UI are stored as null in form state\n * 2. Null/undefined values in form state are displayed as empty strings in the UI\n * 3. Handles both direct value changes and React synthetic events\n * 4. Maintains the same API as react-hook-form's useController\n * 5. Notifies UniformContext's userChange listeners on field changes (enables useWatchUserChange hook)\n * 6. No-op when value unchanged: onChange is ignored if the new value equals the current value\n * (prevents unnecessary re-renders and spurious useWatchUserChange triggers)\n *\n * This enables consistent handling of empty/null values while keeping a clean API\n * for form inputs that expect string values.\n *\n * @see https://react-hook-form.com/docs/usecontroller\n */\nexport const useController = <TFieldValues extends object = object>(\n props: UseControllerProps<TFieldValues>,\n): UseControllerReturn<TFieldValues> => {\n const { field, formState, fieldState } = useRHFController(props);\n const { userChange } = useContext(UniformContext);\n\n return {\n field: {\n ...field,\n // Handles both direct values (onChange(\"value\")) and events (onChange(event))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange: (...event: any[]) => {\n const value = event[0]?.target?.value ?? event[0];\n const formattedValue = value === '' ? '' : toNullishString(value);\n\n // Skip if value hasn't changed (e.g., user re-selects same option)\n // We compare formattedValue (the new value after nullish conversion) with\n // field.value (the current stored value, also in nullish format)\n if (formattedValue === field.value) {\n return;\n }\n\n // Update form state first\n field.onChange(formattedValue);\n\n // Then notify userChange listeners (for useWatchUserChange hook)\n // This ensures getValues() in listeners returns the updated value\n // Guard against undefined userChange (when used outside FormProvider)\n // NOTE: We notify with the original value (not formattedValue) so that\n // listeners receive the actual value (false, 0, null) instead of marker\n // strings like '__FALSE__', '__ZERO__', '__NULL__'\n userChange?.notify(field.name, value);\n },\n // Convert null/undefined to empty string for UI display\n value: fromNullishString(field.value) as string,\n },\n formState,\n fieldState,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAaA,mBACX,UACsC;CACtC,MAAM,EAAE,OAAO,WAAW,eAAeC,cAAiB,KAAK;CAC/D,MAAM,EAAE,eAAe,WAAW,cAAc;CAEhD,OAAO;EACL,OAAO;GACL,GAAG;GAGH,WAAW,GAAG,UAAiB;IAC7B,MAAM,QAAQ,MAAM,IAAI,QAAQ,SAAS,MAAM;IAC/C,MAAM,iBAAiB,UAAU,KAAK,KAAK,gBAAgB,KAAK;IAKhE,IAAI,mBAAmB,MAAM,OAC3B;IAIF,MAAM,SAAS,cAAc;IAQ7B,YAAY,OAAO,MAAM,MAAM,KAAK;GACtC;GAEA,OAAO,kBAAkB,MAAM,KAAK;EACtC;EACA;EACA;CACF;AACF"}
@@ -30,4 +30,4 @@ interface UseControllerReturn<TFieldValues extends object = object> {
30
30
  declare const useController: <TFieldValues extends object = object>(props: UseControllerProps$1<TFieldValues>) => UseControllerReturn<TFieldValues>;
31
31
  //#endregion
32
32
  export { UseControllerReturn as n, useController as r, UseControllerProps$1 as t };
33
- //# sourceMappingURL=useController-BT3Fd0IO.d.cts.map
33
+ //# sourceMappingURL=useController-fblEApv_.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useController-BT3Fd0IO.d.cts","names":[],"sources":["../src/hooks/useController/useController.ts"],"mappings":";;;KAaY,oBAAA,yCACV,kBAAqB,CAAC,YAAA;AAAA,UAEP,mBAAA;EACf,KAAA,EAAO,IAAA,CAAK,qBAAA,CAAsB,YAAA;IAGhC,QAAA,MAAc,KAAA;IACd,KAAA;EAAA;EAEF,SAAA,EAAW,kBAAA,CAAmB,YAAA;EAC9B,UAAA,EAAY,oBAAA;AAAA;;AAVsB;AAEpC;;;;;;;;;;;;;;;cA4Ba,aAAA,yCACX,KAAA,EAAO,oBAAA,CAAmB,YAAA,MACzB,mBAAA,CAAoB,YAAA"}
1
+ {"version":3,"file":"useController-fblEApv_.d.cts","names":[],"sources":["../src/hooks/useController/useController.ts"],"mappings":";;;KAaY,oBAAA,yCACV,kBAAqB,CAAC,YAAA;AAAA,UAEP,mBAAA;EACf,KAAA,EAAO,IAAA,CAAK,qBAAA,CAAsB,YAAA;IAGhC,QAAA,MAAc,KAAA;IACd,KAAA;EAAA;EAEF,SAAA,EAAW,kBAAA,CAAmB,YAAA;EAC9B,UAAA,EAAY,oBAAA;AAAA;;AAVsB;AAEpC;;;;;;;;;;;;;;;cA4Ba,aAAA,yCACX,KAAA,EAAO,oBAAA,CAAmB,YAAA,MACzB,mBAAA,CAAoB,YAAA"}
@@ -1,4 +1,4 @@
1
- import { n as FormResetListener, r as UserChangeListener, t as DebugModeSettings } from "./FormContext-i66vM5f1.js";
1
+ import { n as FormResetListener, r as UserChangeListener, t as DebugModeSettings } from "./FormContext-LgzrDWu1.js";
2
2
  import { FieldError, FieldValues, Path } from "react-hook-form";
3
3
  import { VetoFormattedError, VetoInstance } from "@fuf-stack/veto";
4
4
 
@@ -30,14 +30,14 @@ declare const useFormContext$1: <TFieldValues extends FieldValues = FieldValues,
30
30
  reset: import("react-hook-form").UseFormReset<TFieldValues>;
31
31
  subscribe: import("react-hook-form").UseFormSubscribe<TFieldValues>;
32
32
  watch: import("react-hook-form").UseFormWatch<TFieldValues>;
33
- debugMode: "debug" | "disabled" | "debug-testids" | "off";
33
+ debugMode: "disabled" | "debug" | "debug-testids" | "off";
34
34
  debugModeSettings?: DebugModeSettings;
35
35
  formReset: {
36
36
  subscribe: (listener: FormResetListener) => () => void;
37
37
  notify: () => void;
38
38
  };
39
39
  preventSubmit: (prevent: boolean) => void;
40
- setDebugMode: (debugMode: "debug" | "disabled" | "debug-testids" | "off") => void;
40
+ setDebugMode: (debugMode: "disabled" | "debug" | "debug-testids" | "off") => void;
41
41
  triggerSubmit: (e?: import("react").BaseSyntheticEvent) => Promise<void> | void;
42
42
  userChange: {
43
43
  subscribe: (listener: UserChangeListener) => () => void;
@@ -63,4 +63,4 @@ declare const useFormContext$1: <TFieldValues extends FieldValues = FieldValues,
63
63
  };
64
64
  //#endregion
65
65
  export { useFormContext$1 as n, checkFieldIsRequired as t };
66
- //# sourceMappingURL=useFormContext-CpLVpNAf.d.ts.map
66
+ //# sourceMappingURL=useFormContext-B1-deU4Z.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFormContext-CpLVpNAf.d.ts","names":[],"sources":["../src/hooks/useFormContext/useFormContext.ts"],"mappings":";;;;;;cAYa,oBAAA,GACX,UAAA,EAAY,YAAY,EACxB,IAAA;;AAFF;;;;;;;;AAEgB;cAmEH,gBAAA,wBACU,WAAA,GAAc,WAAA,uCAEd,YAAA;;wBAoCQ,IAAA,CAAK,YAAA,GAAa,MAAA;;;;;;;;;;;;;;;;;;;;;sCAwB3C,kBAAA,KAAA,OAAA;;0BAAA,kBAAA;;;;mBAiBa,YAAA;eAEE,YAAA;aAC6B,kBAAA"}
1
+ {"version":3,"file":"useFormContext-B1-deU4Z.d.ts","names":[],"sources":["../src/hooks/useFormContext/useFormContext.ts"],"mappings":";;;;;;cAYa,oBAAA,GACX,UAAA,EAAY,YAAY,EACxB,IAAA;;AAFF;;;;;;;;AAEgB;cAmEH,gBAAA,wBACU,WAAA,GAAc,WAAA,uCAEd,YAAA;;wBAoCQ,IAAA,CAAK,YAAA,GAAa,MAAA;;;;;;;;;;;;;;;;;;;;;sCAwB3C,kBAAA,KAAA,OAAA;;0BAAA,kBAAA;;;;mBAiBa,YAAA;eAEE,YAAA;aAC6B,kBAAA"}
@@ -1,5 +1,5 @@
1
1
  import { flatArrayKey, nameToTestId, toValidationFormat } from "./helpers/index.js";
2
- import { n as UniformContext } from "./FormContext-BQeKOV-0.js";
2
+ import { n as UniformContext } from "./FormContext-DjJOJKxj.js";
3
3
  import { useContext } from "react";
4
4
  import { useFormContext } from "react-hook-form";
5
5
  //#region src/hooks/useFormContext/useFormContext.ts
@@ -130,4 +130,4 @@ const useFormContext$1 = () => {
130
130
  //#endregion
131
131
  export { useFormContext$1 as n, checkFieldIsRequired as t };
132
132
 
133
- //# sourceMappingURL=useFormContext-CT8H8xIe.js.map
133
+ //# sourceMappingURL=useFormContext-BJqa1FoT.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFormContext-CT8H8xIe.js","names":["useFormContext","useHookFormContext"],"sources":["../src/hooks/useFormContext/useFormContext.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { VetoFormattedError, VetoInstance } from '@fuf-stack/veto';\nimport type { FieldError, FieldValues, Path } from 'react-hook-form';\n\nimport { useContext } from 'react';\nimport { useFormContext as useHookFormContext } from 'react-hook-form';\n\nimport { UniformContext } from '../../Form/subcomponents/FormContext';\nimport { flatArrayKey, nameToTestId, toValidationFormat } from '../../helpers';\n\n/** Schema check whether a field is required or optional */\nexport const checkFieldIsRequired = (\n validation: VetoInstance,\n path: string[],\n): boolean => {\n // Handle flat array paths: strip the flatArrayKey to check the array element schema\n // e.g., ['arrayField', '0', '__FLAT__'] -> check schema at ['arrayField', '0']\n const checkPath =\n path[path.length - 1] === flatArrayKey ? path.slice(0, -1) : path;\n\n const checkRequired = (schema: any) => {\n // arrays ...\n if (schema.type === 'array') {\n // ... if array is optional or nullable it is not required\n if (schema.isOptional || schema.isNullable) {\n return false;\n }\n // ... otherwise arrays are required (display logic wise -> no asterisk in the label)\n return true;\n }\n\n // all other fields are required if they are\n // not optional and not nullable\n return !schema.isOptional && !schema.isNullable;\n };\n\n return validation.checkSchemaPath(checkRequired, checkPath);\n};\n\n/**\n * Resolve validation errors for a given field path.\n *\n * Traverses a nested `VetoFormattedError` structure using a dotted path\n * (for example: \"user.address.0.street\") and returns the matching\n * `FieldError[]` if present. If no error exists at the path, returns\n * `undefined`.\n *\n * @param errors - The formatted validation errors from Uniform's context\n * @param name - The dotted field path to resolve\n * @returns An array of `FieldError` entries for the field, or `undefined`\n */\nconst getValidationErrorsByName = (\n errors: VetoFormattedError,\n name: string,\n) => {\n // Traverse nested error structure; ignore flat array wrapper key\n const keys = name.split('.').filter((k) => {\n return k !== flatArrayKey;\n });\n let current: unknown = errors;\n keys.forEach((key) => {\n if (current && typeof current === 'object') {\n current = (current as Record<string, unknown>)[key];\n } else {\n current = undefined;\n }\n });\n return current as FieldError[] | undefined;\n};\n\n/**\n * Custom hook that extends react-hook-form's useFormContext to add validation and state management.\n *\n * Key features:\n * - Enhanced `getFieldState` that includes validation schema-based \"required\" status and testId generation\n * - Automatic conversion of form values via `getValues`, `watch`, and `subscribe`:\n * - Unwraps flat array wrappers (`{ __FLAT__: value }` → `value`)\n * - Converts nullish string markers (`__NULL__` → `null`, `__FALSE__` → `false`, `__ZERO__` → `0`)\n * - Filters out empty/null values\n */\nexport const useFormContext = <\n TFieldValues extends FieldValues = FieldValues,\n TContext = any,\n TTransformedValues = TFieldValues,\n>() => {\n const {\n formState,\n // some methods that will be enhanced below\n getFieldState: getFieldStateOrig,\n getValues: getValuesOrig,\n watch: watchOrig,\n subscribe: subscribeOrig,\n reset: resetOrig,\n // the rest of the methods pass through unchanged\n ...otherMethods\n } = useHookFormContext<TFieldValues, TContext, TTransformedValues>();\n\n const uniformContext = useContext(UniformContext);\n\n /**\n * Wrap react-hook-form's `reset` so the uniform context is notified about\n * programmatic resets. Field components (e.g. FieldArray) use this signal to\n * normalize their state on reset instead of inferring it from field contents.\n */\n const notifyReset = uniformContext?.formReset?.notify;\n const reset = ((...args: Parameters<typeof resetOrig>) => {\n resetOrig(...args);\n notifyReset?.();\n }) as typeof resetOrig;\n\n /**\n * Updated getFieldState method which returns:\n * - Whether the field is required by checking the validation schema\n * - Existing field state information (errors, etc.)\n * - A testId generated from the field name (with flat array keys removed and slugified)\n *\n * @param name - The field path (string or array)\n * @param testId - Optional explicit testId. If provided, will be slugified. If not provided, generated from name.\n */\n const getFieldState = (name: Path<TFieldValues>, testId?: string) => {\n const fieldPath =\n typeof name === 'string' ? name.replace(/\\[\\d+\\]/g, '').split('.') : name;\n\n // Use base validation instance for checking \"required\" status\n // Client validation often uses .nullish() which would incorrectly mark fields as optional\n const validationInstance =\n uniformContext?.validation.baseInstance ??\n uniformContext?.validation.instance;\n\n // Check if the field is required using the validation schema\n const required = validationInstance\n ? checkFieldIsRequired(validationInstance, fieldPath)\n : false;\n\n const error = getValidationErrorsByName(\n uniformContext?.validation.errors ?? {},\n name,\n );\n\n // Get everything but the error from the original field state\n const fieldState = getFieldStateOrig(name, formState);\n\n return {\n ...fieldState,\n error,\n invalid: !!error,\n required,\n testId: nameToTestId(testId ?? name),\n };\n };\n\n /**\n * Wrap form value accessor methods to automatically convert from internal storage format\n * to component-friendly format:\n *\n * - Unwrap flat array wrappers: `{ __FLAT__: value }` → `value`\n * - Convert nullish string markers: `__NULL__` → `null`, `__FALSE__` → `false`, `__ZERO__` → `0`\n * - Filter out empty/null values: fields with converted null/empty values are removed entirely\n *\n * This ensures components receive clean, predictable data without needing to handle\n * the internal nullish string conversion system or flat array wrapping manually.\n */\n const getValues = ((...args: any[]) => {\n const result = (getValuesOrig as any)(...args);\n return toValidationFormat(result);\n }) as typeof getValuesOrig;\n\n const watch = ((...args: any[]) => {\n const result = (watchOrig as any)(...args);\n return toValidationFormat(result);\n }) as typeof watchOrig;\n\n const subscribe = ((...args: any[]) => {\n // For subscribe, we need to wrap the callback to convert the values property\n const [options] = args;\n if (options?.callback) {\n const originalCallback = options.callback;\n const wrappedOptions = {\n ...options,\n callback: (subscribeFormState: any) => {\n // Convert the values property if it exists\n const convertedFormState = {\n ...subscribeFormState,\n ...(subscribeFormState.values && {\n values: toValidationFormat(subscribeFormState.values),\n }),\n };\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return originalCallback(convertedFormState);\n },\n };\n return subscribeOrig(wrappedOptions);\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return (subscribeOrig as any)(...args);\n }) as typeof subscribeOrig;\n\n return {\n ...otherMethods,\n ...uniformContext,\n formState,\n getFieldState,\n getValues,\n reset,\n subscribe,\n watch,\n };\n};\n"],"mappings":";;;;;;AAYA,MAAa,wBACX,YACA,SACY;CAGZ,MAAM,YACJ,KAAK,KAAK,SAAS,OAAA,aAAsB,KAAK,MAAM,GAAG,EAAE,IAAI;CAE/D,MAAM,iBAAiB,WAAgB;EAErC,IAAI,OAAO,SAAS,SAAS;GAE3B,IAAI,OAAO,cAAc,OAAO,YAC9B,OAAO;GAGT,OAAO;EACT;EAIA,OAAO,CAAC,OAAO,cAAc,CAAC,OAAO;CACvC;CAEA,OAAO,WAAW,gBAAgB,eAAe,SAAS;AAC5D;;;;;;;;;;;;;AAcA,MAAM,6BACJ,QACA,SACG;CAEH,MAAM,OAAO,KAAK,MAAM,GAAG,EAAE,QAAQ,MAAM;EACzC,OAAO,MAAM;CACf,CAAC;CACD,IAAI,UAAmB;CACvB,KAAK,SAAS,QAAQ;EACpB,IAAI,WAAW,OAAO,YAAY,UAChC,UAAW,QAAoC;OAE/C,UAAU,KAAA;CAEd,CAAC;CACD,OAAO;AACT;;;;;;;;;;;AAYA,MAAaA,yBAIN;CACL,MAAM,EACJ,WAEA,eAAe,mBACf,WAAW,eACX,OAAO,WACP,WAAW,eACX,OAAO,WAEP,GAAG,iBACDC,eAA+D;CAEnE,MAAM,iBAAiB,WAAW,cAAc;;;;;;CAOhD,MAAM,cAAc,gBAAgB,WAAW;CAC/C,MAAM,UAAU,GAAG,SAAuC;EACxD,UAAU,GAAG,IAAI;EACjB,cAAc;CAChB;;;;;;;;;;CAWA,MAAM,iBAAiB,MAA0B,WAAoB;EACnE,MAAM,YACJ,OAAO,SAAS,WAAW,KAAK,QAAQ,YAAY,EAAE,EAAE,MAAM,GAAG,IAAI;EAIvE,MAAM,qBACJ,gBAAgB,WAAW,gBAC3B,gBAAgB,WAAW;EAG7B,MAAM,WAAW,qBACb,qBAAqB,oBAAoB,SAAS,IAClD;EAEJ,MAAM,QAAQ,0BACZ,gBAAgB,WAAW,UAAU,CAAC,GACtC,IACF;EAKA,OAAO;GACL,GAHiB,kBAAkB,MAAM,SAG7B;GACZ;GACA,SAAS,CAAC,CAAC;GACX;GACA,QAAQ,aAAa,UAAU,IAAI;EACrC;CACF;;;;;;;;;;;;CAaA,MAAM,cAAc,GAAG,SAAgB;EAErC,OAAO,mBADS,cAAsB,GAAG,IACV,CAAC;CAClC;CAEA,MAAM,UAAU,GAAG,SAAgB;EAEjC,OAAO,mBADS,UAAkB,GAAG,IACN,CAAC;CAClC;CAEA,MAAM,cAAc,GAAG,SAAgB;EAErC,MAAM,CAAC,WAAW;EAClB,IAAI,SAAS,UAAU;GACrB,MAAM,mBAAmB,QAAQ;GAejC,OAAO,cAAc;IAbnB,GAAG;IACH,WAAW,uBAA4B;KASrC,OAAO,iBAAiB;MANtB,GAAG;MACH,GAAI,mBAAmB,UAAU,EAC/B,QAAQ,mBAAmB,mBAAmB,MAAM,EACtD;KAGuC,CAAC;IAC5C;GAEgC,CAAC;EACrC;EAEA,OAAQ,cAAsB,GAAG,IAAI;CACvC;CAEA,OAAO;EACL,GAAG;EACH,GAAG;EACH;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
1
+ {"version":3,"file":"useFormContext-BJqa1FoT.js","names":["useFormContext","useHookFormContext"],"sources":["../src/hooks/useFormContext/useFormContext.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { VetoFormattedError, VetoInstance } from '@fuf-stack/veto';\nimport type { FieldError, FieldValues, Path } from 'react-hook-form';\n\nimport { useContext } from 'react';\nimport { useFormContext as useHookFormContext } from 'react-hook-form';\n\nimport { UniformContext } from '../../Form/subcomponents/FormContext';\nimport { flatArrayKey, nameToTestId, toValidationFormat } from '../../helpers';\n\n/** Schema check whether a field is required or optional */\nexport const checkFieldIsRequired = (\n validation: VetoInstance,\n path: string[],\n): boolean => {\n // Handle flat array paths: strip the flatArrayKey to check the array element schema\n // e.g., ['arrayField', '0', '__FLAT__'] -> check schema at ['arrayField', '0']\n const checkPath =\n path[path.length - 1] === flatArrayKey ? path.slice(0, -1) : path;\n\n const checkRequired = (schema: any) => {\n // arrays ...\n if (schema.type === 'array') {\n // ... if array is optional or nullable it is not required\n if (schema.isOptional || schema.isNullable) {\n return false;\n }\n // ... otherwise arrays are required (display logic wise -> no asterisk in the label)\n return true;\n }\n\n // all other fields are required if they are\n // not optional and not nullable\n return !schema.isOptional && !schema.isNullable;\n };\n\n return validation.checkSchemaPath(checkRequired, checkPath);\n};\n\n/**\n * Resolve validation errors for a given field path.\n *\n * Traverses a nested `VetoFormattedError` structure using a dotted path\n * (for example: \"user.address.0.street\") and returns the matching\n * `FieldError[]` if present. If no error exists at the path, returns\n * `undefined`.\n *\n * @param errors - The formatted validation errors from Uniform's context\n * @param name - The dotted field path to resolve\n * @returns An array of `FieldError` entries for the field, or `undefined`\n */\nconst getValidationErrorsByName = (\n errors: VetoFormattedError,\n name: string,\n) => {\n // Traverse nested error structure; ignore flat array wrapper key\n const keys = name.split('.').filter((k) => {\n return k !== flatArrayKey;\n });\n let current: unknown = errors;\n keys.forEach((key) => {\n if (current && typeof current === 'object') {\n current = (current as Record<string, unknown>)[key];\n } else {\n current = undefined;\n }\n });\n return current as FieldError[] | undefined;\n};\n\n/**\n * Custom hook that extends react-hook-form's useFormContext to add validation and state management.\n *\n * Key features:\n * - Enhanced `getFieldState` that includes validation schema-based \"required\" status and testId generation\n * - Automatic conversion of form values via `getValues`, `watch`, and `subscribe`:\n * - Unwraps flat array wrappers (`{ __FLAT__: value }` → `value`)\n * - Converts nullish string markers (`__NULL__` → `null`, `__FALSE__` → `false`, `__ZERO__` → `0`)\n * - Filters out empty/null values\n */\nexport const useFormContext = <\n TFieldValues extends FieldValues = FieldValues,\n TContext = any,\n TTransformedValues = TFieldValues,\n>() => {\n const {\n formState,\n // some methods that will be enhanced below\n getFieldState: getFieldStateOrig,\n getValues: getValuesOrig,\n watch: watchOrig,\n subscribe: subscribeOrig,\n reset: resetOrig,\n // the rest of the methods pass through unchanged\n ...otherMethods\n } = useHookFormContext<TFieldValues, TContext, TTransformedValues>();\n\n const uniformContext = useContext(UniformContext);\n\n /**\n * Wrap react-hook-form's `reset` so the uniform context is notified about\n * programmatic resets. Field components (e.g. FieldArray) use this signal to\n * normalize their state on reset instead of inferring it from field contents.\n */\n const notifyReset = uniformContext?.formReset?.notify;\n const reset = ((...args: Parameters<typeof resetOrig>) => {\n resetOrig(...args);\n notifyReset?.();\n }) as typeof resetOrig;\n\n /**\n * Updated getFieldState method which returns:\n * - Whether the field is required by checking the validation schema\n * - Existing field state information (errors, etc.)\n * - A testId generated from the field name (with flat array keys removed and slugified)\n *\n * @param name - The field path (string or array)\n * @param testId - Optional explicit testId. If provided, will be slugified. If not provided, generated from name.\n */\n const getFieldState = (name: Path<TFieldValues>, testId?: string) => {\n const fieldPath =\n typeof name === 'string' ? name.replace(/\\[\\d+\\]/g, '').split('.') : name;\n\n // Use base validation instance for checking \"required\" status\n // Client validation often uses .nullish() which would incorrectly mark fields as optional\n const validationInstance =\n uniformContext?.validation.baseInstance ??\n uniformContext?.validation.instance;\n\n // Check if the field is required using the validation schema\n const required = validationInstance\n ? checkFieldIsRequired(validationInstance, fieldPath)\n : false;\n\n const error = getValidationErrorsByName(\n uniformContext?.validation.errors ?? {},\n name,\n );\n\n // Get everything but the error from the original field state\n const fieldState = getFieldStateOrig(name, formState);\n\n return {\n ...fieldState,\n error,\n invalid: !!error,\n required,\n testId: nameToTestId(testId ?? name),\n };\n };\n\n /**\n * Wrap form value accessor methods to automatically convert from internal storage format\n * to component-friendly format:\n *\n * - Unwrap flat array wrappers: `{ __FLAT__: value }` → `value`\n * - Convert nullish string markers: `__NULL__` → `null`, `__FALSE__` → `false`, `__ZERO__` → `0`\n * - Filter out empty/null values: fields with converted null/empty values are removed entirely\n *\n * This ensures components receive clean, predictable data without needing to handle\n * the internal nullish string conversion system or flat array wrapping manually.\n */\n const getValues = ((...args: any[]) => {\n const result = (getValuesOrig as any)(...args);\n return toValidationFormat(result);\n }) as typeof getValuesOrig;\n\n const watch = ((...args: any[]) => {\n const result = (watchOrig as any)(...args);\n return toValidationFormat(result);\n }) as typeof watchOrig;\n\n const subscribe = ((...args: any[]) => {\n // For subscribe, we need to wrap the callback to convert the values property\n const [options] = args;\n if (options?.callback) {\n const originalCallback = options.callback;\n const wrappedOptions = {\n ...options,\n callback: (subscribeFormState: any) => {\n // Convert the values property if it exists\n const convertedFormState = {\n ...subscribeFormState,\n ...(subscribeFormState.values && {\n values: toValidationFormat(subscribeFormState.values),\n }),\n };\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return originalCallback(convertedFormState);\n },\n };\n return subscribeOrig(wrappedOptions);\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return (subscribeOrig as any)(...args);\n }) as typeof subscribeOrig;\n\n return {\n ...otherMethods,\n ...uniformContext,\n formState,\n getFieldState,\n getValues,\n reset,\n subscribe,\n watch,\n };\n};\n"],"mappings":";;;;;;AAYA,MAAa,wBACX,YACA,SACY;CAGZ,MAAM,YACJ,KAAK,KAAK,SAAS,OAAA,aAAsB,KAAK,MAAM,GAAG,EAAE,IAAI;CAE/D,MAAM,iBAAiB,WAAgB;EAErC,IAAI,OAAO,SAAS,SAAS;GAE3B,IAAI,OAAO,cAAc,OAAO,YAC9B,OAAO;GAGT,OAAO;EACT;EAIA,OAAO,CAAC,OAAO,cAAc,CAAC,OAAO;CACvC;CAEA,OAAO,WAAW,gBAAgB,eAAe,SAAS;AAC5D;;;;;;;;;;;;;AAcA,MAAM,6BACJ,QACA,SACG;CAEH,MAAM,OAAO,KAAK,MAAM,GAAG,EAAE,QAAQ,MAAM;EACzC,OAAO,MAAM;CACf,CAAC;CACD,IAAI,UAAmB;CACvB,KAAK,SAAS,QAAQ;EACpB,IAAI,WAAW,OAAO,YAAY,UAChC,UAAW,QAAoC;OAE/C,UAAU,KAAA;CAEd,CAAC;CACD,OAAO;AACT;;;;;;;;;;;AAYA,MAAaA,yBAIN;CACL,MAAM,EACJ,WAEA,eAAe,mBACf,WAAW,eACX,OAAO,WACP,WAAW,eACX,OAAO,WAEP,GAAG,iBACDC,eAA+D;CAEnE,MAAM,iBAAiB,WAAW,cAAc;;;;;;CAOhD,MAAM,cAAc,gBAAgB,WAAW;CAC/C,MAAM,UAAU,GAAG,SAAuC;EACxD,UAAU,GAAG,IAAI;EACjB,cAAc;CAChB;;;;;;;;;;CAWA,MAAM,iBAAiB,MAA0B,WAAoB;EACnE,MAAM,YACJ,OAAO,SAAS,WAAW,KAAK,QAAQ,YAAY,EAAE,EAAE,MAAM,GAAG,IAAI;EAIvE,MAAM,qBACJ,gBAAgB,WAAW,gBAC3B,gBAAgB,WAAW;EAG7B,MAAM,WAAW,qBACb,qBAAqB,oBAAoB,SAAS,IAClD;EAEJ,MAAM,QAAQ,0BACZ,gBAAgB,WAAW,UAAU,CAAC,GACtC,IACF;EAKA,OAAO;GACL,GAHiB,kBAAkB,MAAM,SAG7B;GACZ;GACA,SAAS,CAAC,CAAC;GACX;GACA,QAAQ,aAAa,UAAU,IAAI;EACrC;CACF;;;;;;;;;;;;CAaA,MAAM,cAAc,GAAG,SAAgB;EAErC,OAAO,mBADS,cAAsB,GAAG,IACV,CAAC;CAClC;CAEA,MAAM,UAAU,GAAG,SAAgB;EAEjC,OAAO,mBADS,UAAkB,GAAG,IACN,CAAC;CAClC;CAEA,MAAM,cAAc,GAAG,SAAgB;EAErC,MAAM,CAAC,WAAW;EAClB,IAAI,SAAS,UAAU;GACrB,MAAM,mBAAmB,QAAQ;GAejC,OAAO,cAAc;IAbnB,GAAG;IACH,WAAW,uBAA4B;KASrC,OAAO,iBAAiB;MANtB,GAAG;MACH,GAAI,mBAAmB,UAAU,EAC/B,QAAQ,mBAAmB,mBAAmB,MAAM,EACtD;KAGuC,CAAC;IAC5C;GAEgC,CAAC;EACrC;EAEA,OAAQ,cAAsB,GAAG,IAAI;CACvC;CAEA,OAAO;EACL,GAAG;EACH,GAAG;EACH;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
@@ -1,4 +1,4 @@
1
- import { n as FormResetListener, r as UserChangeListener, t as DebugModeSettings } from "./FormContext-3kamRn2C.cjs";
1
+ import { n as FormResetListener, r as UserChangeListener, t as DebugModeSettings } from "./FormContext-BLWS7bhO.cjs";
2
2
  import { VetoFormattedError, VetoInstance } from "@fuf-stack/veto";
3
3
  import { FieldError, FieldValues, Path } from "react-hook-form";
4
4
 
@@ -30,14 +30,14 @@ declare const useFormContext: <TFieldValues extends FieldValues = FieldValues, T
30
30
  reset: import("react-hook-form").UseFormReset<TFieldValues>;
31
31
  subscribe: import("react-hook-form").UseFormSubscribe<TFieldValues>;
32
32
  watch: import("react-hook-form").UseFormWatch<TFieldValues>;
33
- debugMode: "debug" | "disabled" | "debug-testids" | "off";
33
+ debugMode: "disabled" | "debug" | "debug-testids" | "off";
34
34
  debugModeSettings?: DebugModeSettings;
35
35
  formReset: {
36
36
  subscribe: (listener: FormResetListener) => () => void;
37
37
  notify: () => void;
38
38
  };
39
39
  preventSubmit: (prevent: boolean) => void;
40
- setDebugMode: (debugMode: "debug" | "disabled" | "debug-testids" | "off") => void;
40
+ setDebugMode: (debugMode: "disabled" | "debug" | "debug-testids" | "off") => void;
41
41
  triggerSubmit: (e?: import("react").BaseSyntheticEvent) => Promise<void> | void;
42
42
  userChange: {
43
43
  subscribe: (listener: UserChangeListener) => () => void;
@@ -63,4 +63,4 @@ declare const useFormContext: <TFieldValues extends FieldValues = FieldValues, T
63
63
  };
64
64
  //#endregion
65
65
  export { useFormContext as n, checkFieldIsRequired as t };
66
- //# sourceMappingURL=useFormContext-Ddc1HWKv.d.cts.map
66
+ //# sourceMappingURL=useFormContext-D5vrT2sg.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFormContext-Ddc1HWKv.d.cts","names":[],"sources":["../src/hooks/useFormContext/useFormContext.ts"],"mappings":";;;;;;cAYa,oBAAA,GACX,UAAA,EAAY,YAAY,EACxB,IAAA;;AAFF;;;;;;;;AAEgB;cAmEH,cAAA,wBACU,WAAA,GAAc,WAAA,uCAEd,YAAA;;wBAoCQ,IAAA,CAAK,YAAA,GAAa,MAAA;;;;;;;;;;;;;;;;;;;;;sCAwB3C,kBAAA,KAAA,OAAA;;0BAAA,kBAAA;;;;mBAiBa,YAAA;eAEE,YAAA;aAC6B,kBAAA"}
1
+ {"version":3,"file":"useFormContext-D5vrT2sg.d.cts","names":[],"sources":["../src/hooks/useFormContext/useFormContext.ts"],"mappings":";;;;;;cAYa,oBAAA,GACX,UAAA,EAAY,YAAY,EACxB,IAAA;;AAFF;;;;;;;;AAEgB;cAmEH,cAAA,wBACU,WAAA,GAAc,WAAA,uCAEd,YAAA;;wBAoCQ,IAAA,CAAK,YAAA,GAAa,MAAA;;;;;;;;;;;;;;;;;;;;;sCAwB3C,kBAAA,KAAA,OAAA;;0BAAA,kBAAA;;;;mBAiBa,YAAA;eAEE,YAAA;aAC6B,kBAAA"}
@@ -1,4 +1,4 @@
1
- const require_FormContext = require("./FormContext-DsmS_mkO.cjs");
1
+ const require_FormContext = require("./FormContext-EGH0cVnH.cjs");
2
2
  const require_helpers_index = require("./helpers/index.cjs");
3
3
  let react = require("react");
4
4
  let react_hook_form = require("react-hook-form");
@@ -141,4 +141,4 @@ Object.defineProperty(exports, "useFormContext", {
141
141
  }
142
142
  });
143
143
 
144
- //# sourceMappingURL=useFormContext-CrXwNYiB.cjs.map
144
+ //# sourceMappingURL=useFormContext-kUHonwgu.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFormContext-CrXwNYiB.cjs","names":["flatArrayKey","UniformContext","nameToTestId","toValidationFormat"],"sources":["../src/hooks/useFormContext/useFormContext.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { VetoFormattedError, VetoInstance } from '@fuf-stack/veto';\nimport type { FieldError, FieldValues, Path } from 'react-hook-form';\n\nimport { useContext } from 'react';\nimport { useFormContext as useHookFormContext } from 'react-hook-form';\n\nimport { UniformContext } from '../../Form/subcomponents/FormContext';\nimport { flatArrayKey, nameToTestId, toValidationFormat } from '../../helpers';\n\n/** Schema check whether a field is required or optional */\nexport const checkFieldIsRequired = (\n validation: VetoInstance,\n path: string[],\n): boolean => {\n // Handle flat array paths: strip the flatArrayKey to check the array element schema\n // e.g., ['arrayField', '0', '__FLAT__'] -> check schema at ['arrayField', '0']\n const checkPath =\n path[path.length - 1] === flatArrayKey ? path.slice(0, -1) : path;\n\n const checkRequired = (schema: any) => {\n // arrays ...\n if (schema.type === 'array') {\n // ... if array is optional or nullable it is not required\n if (schema.isOptional || schema.isNullable) {\n return false;\n }\n // ... otherwise arrays are required (display logic wise -> no asterisk in the label)\n return true;\n }\n\n // all other fields are required if they are\n // not optional and not nullable\n return !schema.isOptional && !schema.isNullable;\n };\n\n return validation.checkSchemaPath(checkRequired, checkPath);\n};\n\n/**\n * Resolve validation errors for a given field path.\n *\n * Traverses a nested `VetoFormattedError` structure using a dotted path\n * (for example: \"user.address.0.street\") and returns the matching\n * `FieldError[]` if present. If no error exists at the path, returns\n * `undefined`.\n *\n * @param errors - The formatted validation errors from Uniform's context\n * @param name - The dotted field path to resolve\n * @returns An array of `FieldError` entries for the field, or `undefined`\n */\nconst getValidationErrorsByName = (\n errors: VetoFormattedError,\n name: string,\n) => {\n // Traverse nested error structure; ignore flat array wrapper key\n const keys = name.split('.').filter((k) => {\n return k !== flatArrayKey;\n });\n let current: unknown = errors;\n keys.forEach((key) => {\n if (current && typeof current === 'object') {\n current = (current as Record<string, unknown>)[key];\n } else {\n current = undefined;\n }\n });\n return current as FieldError[] | undefined;\n};\n\n/**\n * Custom hook that extends react-hook-form's useFormContext to add validation and state management.\n *\n * Key features:\n * - Enhanced `getFieldState` that includes validation schema-based \"required\" status and testId generation\n * - Automatic conversion of form values via `getValues`, `watch`, and `subscribe`:\n * - Unwraps flat array wrappers (`{ __FLAT__: value }` → `value`)\n * - Converts nullish string markers (`__NULL__` → `null`, `__FALSE__` → `false`, `__ZERO__` → `0`)\n * - Filters out empty/null values\n */\nexport const useFormContext = <\n TFieldValues extends FieldValues = FieldValues,\n TContext = any,\n TTransformedValues = TFieldValues,\n>() => {\n const {\n formState,\n // some methods that will be enhanced below\n getFieldState: getFieldStateOrig,\n getValues: getValuesOrig,\n watch: watchOrig,\n subscribe: subscribeOrig,\n reset: resetOrig,\n // the rest of the methods pass through unchanged\n ...otherMethods\n } = useHookFormContext<TFieldValues, TContext, TTransformedValues>();\n\n const uniformContext = useContext(UniformContext);\n\n /**\n * Wrap react-hook-form's `reset` so the uniform context is notified about\n * programmatic resets. Field components (e.g. FieldArray) use this signal to\n * normalize their state on reset instead of inferring it from field contents.\n */\n const notifyReset = uniformContext?.formReset?.notify;\n const reset = ((...args: Parameters<typeof resetOrig>) => {\n resetOrig(...args);\n notifyReset?.();\n }) as typeof resetOrig;\n\n /**\n * Updated getFieldState method which returns:\n * - Whether the field is required by checking the validation schema\n * - Existing field state information (errors, etc.)\n * - A testId generated from the field name (with flat array keys removed and slugified)\n *\n * @param name - The field path (string or array)\n * @param testId - Optional explicit testId. If provided, will be slugified. If not provided, generated from name.\n */\n const getFieldState = (name: Path<TFieldValues>, testId?: string) => {\n const fieldPath =\n typeof name === 'string' ? name.replace(/\\[\\d+\\]/g, '').split('.') : name;\n\n // Use base validation instance for checking \"required\" status\n // Client validation often uses .nullish() which would incorrectly mark fields as optional\n const validationInstance =\n uniformContext?.validation.baseInstance ??\n uniformContext?.validation.instance;\n\n // Check if the field is required using the validation schema\n const required = validationInstance\n ? checkFieldIsRequired(validationInstance, fieldPath)\n : false;\n\n const error = getValidationErrorsByName(\n uniformContext?.validation.errors ?? {},\n name,\n );\n\n // Get everything but the error from the original field state\n const fieldState = getFieldStateOrig(name, formState);\n\n return {\n ...fieldState,\n error,\n invalid: !!error,\n required,\n testId: nameToTestId(testId ?? name),\n };\n };\n\n /**\n * Wrap form value accessor methods to automatically convert from internal storage format\n * to component-friendly format:\n *\n * - Unwrap flat array wrappers: `{ __FLAT__: value }` → `value`\n * - Convert nullish string markers: `__NULL__` → `null`, `__FALSE__` → `false`, `__ZERO__` → `0`\n * - Filter out empty/null values: fields with converted null/empty values are removed entirely\n *\n * This ensures components receive clean, predictable data without needing to handle\n * the internal nullish string conversion system or flat array wrapping manually.\n */\n const getValues = ((...args: any[]) => {\n const result = (getValuesOrig as any)(...args);\n return toValidationFormat(result);\n }) as typeof getValuesOrig;\n\n const watch = ((...args: any[]) => {\n const result = (watchOrig as any)(...args);\n return toValidationFormat(result);\n }) as typeof watchOrig;\n\n const subscribe = ((...args: any[]) => {\n // For subscribe, we need to wrap the callback to convert the values property\n const [options] = args;\n if (options?.callback) {\n const originalCallback = options.callback;\n const wrappedOptions = {\n ...options,\n callback: (subscribeFormState: any) => {\n // Convert the values property if it exists\n const convertedFormState = {\n ...subscribeFormState,\n ...(subscribeFormState.values && {\n values: toValidationFormat(subscribeFormState.values),\n }),\n };\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return originalCallback(convertedFormState);\n },\n };\n return subscribeOrig(wrappedOptions);\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return (subscribeOrig as any)(...args);\n }) as typeof subscribeOrig;\n\n return {\n ...otherMethods,\n ...uniformContext,\n formState,\n getFieldState,\n getValues,\n reset,\n subscribe,\n watch,\n };\n};\n"],"mappings":";;;;;;AAYA,MAAa,wBACX,YACA,SACY;CAGZ,MAAM,YACJ,KAAK,KAAK,SAAS,OAAA,aAAsB,KAAK,MAAM,GAAG,EAAE,IAAI;CAE/D,MAAM,iBAAiB,WAAgB;EAErC,IAAI,OAAO,SAAS,SAAS;GAE3B,IAAI,OAAO,cAAc,OAAO,YAC9B,OAAO;GAGT,OAAO;EACT;EAIA,OAAO,CAAC,OAAO,cAAc,CAAC,OAAO;CACvC;CAEA,OAAO,WAAW,gBAAgB,eAAe,SAAS;AAC5D;;;;;;;;;;;;;AAcA,MAAM,6BACJ,QACA,SACG;CAEH,MAAM,OAAO,KAAK,MAAM,GAAG,EAAE,QAAQ,MAAM;EACzC,OAAO,MAAMA,sBAAAA;CACf,CAAC;CACD,IAAI,UAAmB;CACvB,KAAK,SAAS,QAAQ;EACpB,IAAI,WAAW,OAAO,YAAY,UAChC,UAAW,QAAoC;OAE/C,UAAU,KAAA;CAEd,CAAC;CACD,OAAO;AACT;;;;;;;;;;;AAYA,MAAa,uBAIN;CACL,MAAM,EACJ,WAEA,eAAe,mBACf,WAAW,eACX,OAAO,WACP,WAAW,eACX,OAAO,WAEP,GAAG,kBAAA,GAAA,gBAAA,gBAC8D;CAEnE,MAAM,kBAAA,GAAA,MAAA,YAA4BC,oBAAAA,cAAc;;;;;;CAOhD,MAAM,cAAc,gBAAgB,WAAW;CAC/C,MAAM,UAAU,GAAG,SAAuC;EACxD,UAAU,GAAG,IAAI;EACjB,cAAc;CAChB;;;;;;;;;;CAWA,MAAM,iBAAiB,MAA0B,WAAoB;EACnE,MAAM,YACJ,OAAO,SAAS,WAAW,KAAK,QAAQ,YAAY,EAAE,EAAE,MAAM,GAAG,IAAI;EAIvE,MAAM,qBACJ,gBAAgB,WAAW,gBAC3B,gBAAgB,WAAW;EAG7B,MAAM,WAAW,qBACb,qBAAqB,oBAAoB,SAAS,IAClD;EAEJ,MAAM,QAAQ,0BACZ,gBAAgB,WAAW,UAAU,CAAC,GACtC,IACF;EAKA,OAAO;GACL,GAHiB,kBAAkB,MAAM,SAG7B;GACZ;GACA,SAAS,CAAC,CAAC;GACX;GACA,QAAQC,sBAAAA,aAAa,UAAU,IAAI;EACrC;CACF;;;;;;;;;;;;CAaA,MAAM,cAAc,GAAG,SAAgB;EAErC,OAAOC,sBAAAA,mBADS,cAAsB,GAAG,IACV,CAAC;CAClC;CAEA,MAAM,UAAU,GAAG,SAAgB;EAEjC,OAAOA,sBAAAA,mBADS,UAAkB,GAAG,IACN,CAAC;CAClC;CAEA,MAAM,cAAc,GAAG,SAAgB;EAErC,MAAM,CAAC,WAAW;EAClB,IAAI,SAAS,UAAU;GACrB,MAAM,mBAAmB,QAAQ;GAejC,OAAO,cAAc;IAbnB,GAAG;IACH,WAAW,uBAA4B;KASrC,OAAO,iBAAiB;MANtB,GAAG;MACH,GAAI,mBAAmB,UAAU,EAC/B,QAAQA,sBAAAA,mBAAmB,mBAAmB,MAAM,EACtD;KAGuC,CAAC;IAC5C;GAEgC,CAAC;EACrC;EAEA,OAAQ,cAAsB,GAAG,IAAI;CACvC;CAEA,OAAO;EACL,GAAG;EACH,GAAG;EACH;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
1
+ {"version":3,"file":"useFormContext-kUHonwgu.cjs","names":["flatArrayKey","UniformContext","nameToTestId","toValidationFormat"],"sources":["../src/hooks/useFormContext/useFormContext.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { VetoFormattedError, VetoInstance } from '@fuf-stack/veto';\nimport type { FieldError, FieldValues, Path } from 'react-hook-form';\n\nimport { useContext } from 'react';\nimport { useFormContext as useHookFormContext } from 'react-hook-form';\n\nimport { UniformContext } from '../../Form/subcomponents/FormContext';\nimport { flatArrayKey, nameToTestId, toValidationFormat } from '../../helpers';\n\n/** Schema check whether a field is required or optional */\nexport const checkFieldIsRequired = (\n validation: VetoInstance,\n path: string[],\n): boolean => {\n // Handle flat array paths: strip the flatArrayKey to check the array element schema\n // e.g., ['arrayField', '0', '__FLAT__'] -> check schema at ['arrayField', '0']\n const checkPath =\n path[path.length - 1] === flatArrayKey ? path.slice(0, -1) : path;\n\n const checkRequired = (schema: any) => {\n // arrays ...\n if (schema.type === 'array') {\n // ... if array is optional or nullable it is not required\n if (schema.isOptional || schema.isNullable) {\n return false;\n }\n // ... otherwise arrays are required (display logic wise -> no asterisk in the label)\n return true;\n }\n\n // all other fields are required if they are\n // not optional and not nullable\n return !schema.isOptional && !schema.isNullable;\n };\n\n return validation.checkSchemaPath(checkRequired, checkPath);\n};\n\n/**\n * Resolve validation errors for a given field path.\n *\n * Traverses a nested `VetoFormattedError` structure using a dotted path\n * (for example: \"user.address.0.street\") and returns the matching\n * `FieldError[]` if present. If no error exists at the path, returns\n * `undefined`.\n *\n * @param errors - The formatted validation errors from Uniform's context\n * @param name - The dotted field path to resolve\n * @returns An array of `FieldError` entries for the field, or `undefined`\n */\nconst getValidationErrorsByName = (\n errors: VetoFormattedError,\n name: string,\n) => {\n // Traverse nested error structure; ignore flat array wrapper key\n const keys = name.split('.').filter((k) => {\n return k !== flatArrayKey;\n });\n let current: unknown = errors;\n keys.forEach((key) => {\n if (current && typeof current === 'object') {\n current = (current as Record<string, unknown>)[key];\n } else {\n current = undefined;\n }\n });\n return current as FieldError[] | undefined;\n};\n\n/**\n * Custom hook that extends react-hook-form's useFormContext to add validation and state management.\n *\n * Key features:\n * - Enhanced `getFieldState` that includes validation schema-based \"required\" status and testId generation\n * - Automatic conversion of form values via `getValues`, `watch`, and `subscribe`:\n * - Unwraps flat array wrappers (`{ __FLAT__: value }` → `value`)\n * - Converts nullish string markers (`__NULL__` → `null`, `__FALSE__` → `false`, `__ZERO__` → `0`)\n * - Filters out empty/null values\n */\nexport const useFormContext = <\n TFieldValues extends FieldValues = FieldValues,\n TContext = any,\n TTransformedValues = TFieldValues,\n>() => {\n const {\n formState,\n // some methods that will be enhanced below\n getFieldState: getFieldStateOrig,\n getValues: getValuesOrig,\n watch: watchOrig,\n subscribe: subscribeOrig,\n reset: resetOrig,\n // the rest of the methods pass through unchanged\n ...otherMethods\n } = useHookFormContext<TFieldValues, TContext, TTransformedValues>();\n\n const uniformContext = useContext(UniformContext);\n\n /**\n * Wrap react-hook-form's `reset` so the uniform context is notified about\n * programmatic resets. Field components (e.g. FieldArray) use this signal to\n * normalize their state on reset instead of inferring it from field contents.\n */\n const notifyReset = uniformContext?.formReset?.notify;\n const reset = ((...args: Parameters<typeof resetOrig>) => {\n resetOrig(...args);\n notifyReset?.();\n }) as typeof resetOrig;\n\n /**\n * Updated getFieldState method which returns:\n * - Whether the field is required by checking the validation schema\n * - Existing field state information (errors, etc.)\n * - A testId generated from the field name (with flat array keys removed and slugified)\n *\n * @param name - The field path (string or array)\n * @param testId - Optional explicit testId. If provided, will be slugified. If not provided, generated from name.\n */\n const getFieldState = (name: Path<TFieldValues>, testId?: string) => {\n const fieldPath =\n typeof name === 'string' ? name.replace(/\\[\\d+\\]/g, '').split('.') : name;\n\n // Use base validation instance for checking \"required\" status\n // Client validation often uses .nullish() which would incorrectly mark fields as optional\n const validationInstance =\n uniformContext?.validation.baseInstance ??\n uniformContext?.validation.instance;\n\n // Check if the field is required using the validation schema\n const required = validationInstance\n ? checkFieldIsRequired(validationInstance, fieldPath)\n : false;\n\n const error = getValidationErrorsByName(\n uniformContext?.validation.errors ?? {},\n name,\n );\n\n // Get everything but the error from the original field state\n const fieldState = getFieldStateOrig(name, formState);\n\n return {\n ...fieldState,\n error,\n invalid: !!error,\n required,\n testId: nameToTestId(testId ?? name),\n };\n };\n\n /**\n * Wrap form value accessor methods to automatically convert from internal storage format\n * to component-friendly format:\n *\n * - Unwrap flat array wrappers: `{ __FLAT__: value }` → `value`\n * - Convert nullish string markers: `__NULL__` → `null`, `__FALSE__` → `false`, `__ZERO__` → `0`\n * - Filter out empty/null values: fields with converted null/empty values are removed entirely\n *\n * This ensures components receive clean, predictable data without needing to handle\n * the internal nullish string conversion system or flat array wrapping manually.\n */\n const getValues = ((...args: any[]) => {\n const result = (getValuesOrig as any)(...args);\n return toValidationFormat(result);\n }) as typeof getValuesOrig;\n\n const watch = ((...args: any[]) => {\n const result = (watchOrig as any)(...args);\n return toValidationFormat(result);\n }) as typeof watchOrig;\n\n const subscribe = ((...args: any[]) => {\n // For subscribe, we need to wrap the callback to convert the values property\n const [options] = args;\n if (options?.callback) {\n const originalCallback = options.callback;\n const wrappedOptions = {\n ...options,\n callback: (subscribeFormState: any) => {\n // Convert the values property if it exists\n const convertedFormState = {\n ...subscribeFormState,\n ...(subscribeFormState.values && {\n values: toValidationFormat(subscribeFormState.values),\n }),\n };\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return originalCallback(convertedFormState);\n },\n };\n return subscribeOrig(wrappedOptions);\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return (subscribeOrig as any)(...args);\n }) as typeof subscribeOrig;\n\n return {\n ...otherMethods,\n ...uniformContext,\n formState,\n getFieldState,\n getValues,\n reset,\n subscribe,\n watch,\n };\n};\n"],"mappings":";;;;;;AAYA,MAAa,wBACX,YACA,SACY;CAGZ,MAAM,YACJ,KAAK,KAAK,SAAS,OAAA,aAAsB,KAAK,MAAM,GAAG,EAAE,IAAI;CAE/D,MAAM,iBAAiB,WAAgB;EAErC,IAAI,OAAO,SAAS,SAAS;GAE3B,IAAI,OAAO,cAAc,OAAO,YAC9B,OAAO;GAGT,OAAO;EACT;EAIA,OAAO,CAAC,OAAO,cAAc,CAAC,OAAO;CACvC;CAEA,OAAO,WAAW,gBAAgB,eAAe,SAAS;AAC5D;;;;;;;;;;;;;AAcA,MAAM,6BACJ,QACA,SACG;CAEH,MAAM,OAAO,KAAK,MAAM,GAAG,EAAE,QAAQ,MAAM;EACzC,OAAO,MAAMA,sBAAAA;CACf,CAAC;CACD,IAAI,UAAmB;CACvB,KAAK,SAAS,QAAQ;EACpB,IAAI,WAAW,OAAO,YAAY,UAChC,UAAW,QAAoC;OAE/C,UAAU,KAAA;CAEd,CAAC;CACD,OAAO;AACT;;;;;;;;;;;AAYA,MAAa,uBAIN;CACL,MAAM,EACJ,WAEA,eAAe,mBACf,WAAW,eACX,OAAO,WACP,WAAW,eACX,OAAO,WAEP,GAAG,kBAAA,GAAA,gBAAA,gBAC8D;CAEnE,MAAM,kBAAA,GAAA,MAAA,YAA4BC,oBAAAA,cAAc;;;;;;CAOhD,MAAM,cAAc,gBAAgB,WAAW;CAC/C,MAAM,UAAU,GAAG,SAAuC;EACxD,UAAU,GAAG,IAAI;EACjB,cAAc;CAChB;;;;;;;;;;CAWA,MAAM,iBAAiB,MAA0B,WAAoB;EACnE,MAAM,YACJ,OAAO,SAAS,WAAW,KAAK,QAAQ,YAAY,EAAE,EAAE,MAAM,GAAG,IAAI;EAIvE,MAAM,qBACJ,gBAAgB,WAAW,gBAC3B,gBAAgB,WAAW;EAG7B,MAAM,WAAW,qBACb,qBAAqB,oBAAoB,SAAS,IAClD;EAEJ,MAAM,QAAQ,0BACZ,gBAAgB,WAAW,UAAU,CAAC,GACtC,IACF;EAKA,OAAO;GACL,GAHiB,kBAAkB,MAAM,SAG7B;GACZ;GACA,SAAS,CAAC,CAAC;GACX;GACA,QAAQC,sBAAAA,aAAa,UAAU,IAAI;EACrC;CACF;;;;;;;;;;;;CAaA,MAAM,cAAc,GAAG,SAAgB;EAErC,OAAOC,sBAAAA,mBADS,cAAsB,GAAG,IACV,CAAC;CAClC;CAEA,MAAM,UAAU,GAAG,SAAgB;EAEjC,OAAOA,sBAAAA,mBADS,UAAkB,GAAG,IACN,CAAC;CAClC;CAEA,MAAM,cAAc,GAAG,SAAgB;EAErC,MAAM,CAAC,WAAW;EAClB,IAAI,SAAS,UAAU;GACrB,MAAM,mBAAmB,QAAQ;GAejC,OAAO,cAAc;IAbnB,GAAG;IACH,WAAW,uBAA4B;KASrC,OAAO,iBAAiB;MANtB,GAAG;MACH,GAAI,mBAAmB,UAAU,EAC/B,QAAQA,sBAAAA,mBAAmB,mBAAmB,MAAM,EACtD;KAGuC,CAAC;IAC5C;GAEgC,CAAC;EACrC;EAEA,OAAQ,cAAsB,GAAG,IAAI;CACvC;CAEA,OAAO;EACL,GAAG;EACH,GAAG;EACH;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
@@ -105,4 +105,4 @@ declare const useInputValueTransform: <TDisplay = unknown>({
105
105
  }: UseInputValueTransformOptions<TDisplay>) => UseInputValueTransformReturn<TDisplay>;
106
106
  //#endregion
107
107
  export { useInputValueTransform as i, UseInputValueTransformOptions as n, UseInputValueTransformReturn as r, InputValueTransform as t };
108
- //# sourceMappingURL=useInputValueTransform-CNCBU7a9.d.cts.map
108
+ //# sourceMappingURL=useInputValueTransform-DCXXb2Lp.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useInputValueTransform-CNCBU7a9.d.cts","names":[],"sources":["../src/hooks/useInputValueTransform/useInputValueTransform.ts"],"mappings":";UAEiB,mBAAA;EAAA;EAEf,cAAA,GAAiB,KAAA,cAAmB,QAAA;EAFF;EAIlC,WAAA,GAAc,KAAA,EAAO,QAAQ;AAAA;AAAA,UAGd,6BAAA;EALE;EAOjB,IAAA;EALA;EAOA,SAAA,GAAY,mBAAmB,CAAC,QAAA;AAAA;AAAA,UAGjB,4BAAA;EAVc;EAY7B,cAAA,GAAiB,SAAA,cAAuB,QAAA;EATI;EAW5C,WAAA,GAAc,YAAA,EAAc,QAAQ;AAAA;;;;;;;AAPI;AAG1C;;;;;;;;;;;;AAIsC;AAqFtC;;;;;;;;;;;;;;;;;;;;;AAGkF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAHrE,sBAAA;EAA8C,IAAA;EAAA;AAAA,GAGxD,6BAAA,CAA8B,QAAA,MAAY,4BAAA,CAA6B,QAAA"}
1
+ {"version":3,"file":"useInputValueTransform-DCXXb2Lp.d.cts","names":[],"sources":["../src/hooks/useInputValueTransform/useInputValueTransform.ts"],"mappings":";UAEiB,mBAAA;EAAA;EAEf,cAAA,GAAiB,KAAA,cAAmB,QAAA;EAFF;EAIlC,WAAA,GAAc,KAAA,EAAO,QAAQ;AAAA;AAAA,UAGd,6BAAA;EALE;EAOjB,IAAA;EALA;EAOA,SAAA,GAAY,mBAAmB,CAAC,QAAA;AAAA;AAAA,UAGjB,4BAAA;EAVc;EAY7B,cAAA,GAAiB,SAAA,cAAuB,QAAA;EATI;EAW5C,WAAA,GAAc,YAAA,EAAc,QAAQ;AAAA;;;;;;;AAPI;AAG1C;;;;;;;;;;;;AAIsC;AAqFtC;;;;;;;;;;;;;;;;;;;;;AAGkF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAHrE,sBAAA;EAA8C,IAAA;EAAA;AAAA,GAGxD,6BAAA,CAA8B,QAAA,MAAY,4BAAA,CAA6B,QAAA"}
@@ -105,4 +105,4 @@ declare const useInputValueTransform: <TDisplay = unknown>({
105
105
  }: UseInputValueTransformOptions<TDisplay>) => UseInputValueTransformReturn<TDisplay>;
106
106
  //#endregion
107
107
  export { useInputValueTransform as i, UseInputValueTransformOptions as n, UseInputValueTransformReturn as r, InputValueTransform as t };
108
- //# sourceMappingURL=useInputValueTransform-dLfFIYW4.d.ts.map
108
+ //# sourceMappingURL=useInputValueTransform-DCXXb2Lp.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useInputValueTransform-dLfFIYW4.d.ts","names":[],"sources":["../src/hooks/useInputValueTransform/useInputValueTransform.ts"],"mappings":";UAEiB,mBAAA;EAAA;EAEf,cAAA,GAAiB,KAAA,cAAmB,QAAA;EAFF;EAIlC,WAAA,GAAc,KAAA,EAAO,QAAQ;AAAA;AAAA,UAGd,6BAAA;EALE;EAOjB,IAAA;EALA;EAOA,SAAA,GAAY,mBAAmB,CAAC,QAAA;AAAA;AAAA,UAGjB,4BAAA;EAVc;EAY7B,cAAA,GAAiB,SAAA,cAAuB,QAAA;EATI;EAW5C,WAAA,GAAc,YAAA,EAAc,QAAQ;AAAA;;;;;;;AAPI;AAG1C;;;;;;;;;;;;AAIsC;AAqFtC;;;;;;;;;;;;;;;;;;;;;AAGkF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAHrE,sBAAA;EAA8C,IAAA;EAAA;AAAA,GAGxD,6BAAA,CAA8B,QAAA,MAAY,4BAAA,CAA6B,QAAA"}
1
+ {"version":3,"file":"useInputValueTransform-DCXXb2Lp.d.ts","names":[],"sources":["../src/hooks/useInputValueTransform/useInputValueTransform.ts"],"mappings":";UAEiB,mBAAA;EAAA;EAEf,cAAA,GAAiB,KAAA,cAAmB,QAAA;EAFF;EAIlC,WAAA,GAAc,KAAA,EAAO,QAAQ;AAAA;AAAA,UAGd,6BAAA;EALE;EAOjB,IAAA;EALA;EAOA,SAAA,GAAY,mBAAmB,CAAC,QAAA;AAAA;AAAA,UAGjB,4BAAA;EAVc;EAY7B,cAAA,GAAiB,SAAA,cAAuB,QAAA;EATI;EAW5C,WAAA,GAAc,YAAA,EAAc,QAAQ;AAAA;;;;;;;AAPI;AAG1C;;;;;;;;;;;;AAIsC;AAqFtC;;;;;;;;;;;;;;;;;;;;;AAGkF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAHrE,sBAAA;EAA8C,IAAA;EAAA;AAAA,GAGxD,6BAAA,CAA8B,QAAA,MAAY,4BAAA,CAA6B,QAAA"}
@@ -107,4 +107,4 @@ const useInputValueTransform = ({ type, transform }) => {
107
107
  //#endregion
108
108
  export { useInputValueTransform as t };
109
109
 
110
- //# sourceMappingURL=useInputValueTransform-CXdmtc0Q.js.map
110
+ //# sourceMappingURL=useInputValueTransform-DJ5zkqSy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useInputValueTransform-CXdmtc0Q.js","names":[],"sources":["../src/hooks/useInputValueTransform/useInputValueTransform.ts"],"sourcesContent":["import { useCallback } from 'react';\n\nexport interface InputValueTransform<TDisplay = unknown> {\n /** Transforms the form value to display value (e.g., 1000 → \"$1,000\" or 'a' → ['a']) */\n toDisplayValue: (value: unknown) => TDisplay;\n /** Transforms the display value to form value (e.g., \"$1,000\" → 1000 or ['a'] → 'a') */\n toFormValue: (value: TDisplay) => unknown;\n}\n\nexport interface UseInputValueTransformOptions<TDisplay = unknown> {\n /** Input type for special number handling */\n type?: 'text' | 'number' | 'password';\n /** Value transformation functions */\n transform?: InputValueTransform<TDisplay>;\n}\n\nexport interface UseInputValueTransformReturn<TDisplay = unknown> {\n /** Converts any form value to display value */\n toDisplayValue: (formValue: unknown) => TDisplay;\n /** Converts any display value to form value */\n toFormValue: (displayValue: TDisplay) => unknown;\n}\n\n/**\n * Custom hook providing utility functions for value transformations between display and form values.\n *\n * This hook provides pure conversion functions without any state management. It's useful for:\n * - Currency formatting ($1,000 display vs 1000 stored)\n * - Number inputs with special handling\n * - Date formatting (MM/DD/YYYY display vs ISO date stored)\n * - Phone number formatting ((555) 123-4567 display vs 5551234567 stored)\n * - Array/Object transformations (single value ↔ array, nested structures)\n *\n * **Key Features:**\n * - Pure conversion functions (no state)\n * - Generic support for any data type (strings, numbers, arrays, objects)\n * - Special number input handling (empty string preservation)\n * - Bidirectional value transformations\n * - Memoized functions for performance\n *\n * @param options Configuration for value transformation\n * @returns Pure conversion utility functions\n *\n * @example\n * ```tsx\n * // Currency formatting\n * const currencyTransform = {\n * toDisplayValue: (val) => val ? `$${Number(val).toLocaleString()}` : '',\n * toFormValue: (val) => parseFloat(val.replace(/[$,]/g, '')) || 0\n * };\n *\n * const { toDisplayValue, toFormValue } = useInputValueTransform({\n * transform: currencyTransform\n * });\n *\n * const displayVal = toDisplayValue(1000); // \"$1,000\"\n * const formVal = toFormValue(\"$1,500\"); // 1500\n * ```\n *\n * @example\n * ```tsx\n * // Number input (no transforms needed)\n * const { toDisplayValue, toFormValue } = useInputValueTransform({\n * type: 'number'\n * });\n *\n * // Handles empty string → empty string (not NaN)\n * // Handles \"123\" → 123 (string to number conversion)\n * ```\n *\n * @example\n * ```tsx\n * // Array to single value (for single checkbox)\n * const singleValueTransform = {\n * toDisplayValue: (val: string[]) => val?.[0] || '',\n * toFormValue: (val: string) => val ? [val] : []\n * };\n *\n * const { toDisplayValue, toFormValue } = useInputValueTransform({\n * transform: singleValueTransform\n * });\n *\n * const displayVal = toDisplayValue(['option1']); // \"option1\"\n * const formVal = toFormValue(\"option2\"); // [\"option2\"]\n * ```\n *\n * @example\n * ```tsx\n * // Integration with debouncing\n * const MyInput = ({ field, transform }) => {\n * const transform = useInputValueTransform({ transform });\n *\n * const { onChange, onBlur, value } = useInputValueDebounce({\n * ...transform,\n * debounceDelay: 300,\n * name: 'fieldName',\n * onBlur: field.onBlur,\n * onChange: field.onChange,\n * value: field.value,\n * });\n *\n * return <input value={value} onChange={onChange} onBlur={onBlur} />;\n * };\n * ```\n */\nexport const useInputValueTransform = <TDisplay = unknown>({\n type,\n transform,\n}: UseInputValueTransformOptions<TDisplay>): UseInputValueTransformReturn<TDisplay> => {\n /**\n * Converts any form value to display value\n */\n const toDisplayValue = useCallback(\n (formValue: unknown): TDisplay => {\n if (transform?.toDisplayValue) {\n return transform.toDisplayValue(formValue);\n }\n\n // For number type, convert valid strings to numbers for display\n if (type === 'number') {\n if (formValue === '') {\n return '' as TDisplay;\n }\n const numValue = Number(formValue);\n return (Number.isNaN(numValue) ? formValue : numValue) as TDisplay;\n }\n\n // Default: pass through (handles primitives, arrays, objects, etc.)\n return (formValue ?? '') as TDisplay;\n },\n [type, transform],\n );\n\n /**\n * Converts any display value to form value\n */\n const toFormValue = useCallback(\n (displayValue: TDisplay): unknown => {\n if (transform?.toFormValue) {\n return transform.toFormValue(displayValue);\n }\n\n // For number type, convert strings to numbers\n if (type === 'number') {\n if (displayValue === '') {\n return '';\n }\n const numValue = Number(displayValue);\n return Number.isNaN(numValue) ? displayValue : numValue;\n }\n\n // Default: pass through (handles primitives, arrays, objects, etc.)\n return displayValue;\n },\n [type, transform],\n );\n\n return {\n toDisplayValue,\n toFormValue,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyGA,MAAa,0BAA8C,EACzD,MACA,gBACqF;CAiDrF,OAAO;EACL,gBA9CqB,aACpB,cAAiC;GAChC,IAAI,WAAW,gBACb,OAAO,UAAU,eAAe,SAAS;GAI3C,IAAI,SAAS,UAAU;IACrB,IAAI,cAAc,IAChB,OAAO;IAET,MAAM,WAAW,OAAO,SAAS;IACjC,OAAQ,OAAO,MAAM,QAAQ,IAAI,YAAY;GAC/C;GAGA,OAAQ,aAAa;EACvB,GACA,CAAC,MAAM,SAAS,CA4BH;EACb,aAvBkB,aACjB,iBAAoC;GACnC,IAAI,WAAW,aACb,OAAO,UAAU,YAAY,YAAY;GAI3C,IAAI,SAAS,UAAU;IACrB,IAAI,iBAAiB,IACnB,OAAO;IAET,MAAM,WAAW,OAAO,YAAY;IACpC,OAAO,OAAO,MAAM,QAAQ,IAAI,eAAe;GACjD;GAGA,OAAO;EACT,GACA,CAAC,MAAM,SAAS,CAKN;CACZ;AACF"}
1
+ {"version":3,"file":"useInputValueTransform-DJ5zkqSy.js","names":[],"sources":["../src/hooks/useInputValueTransform/useInputValueTransform.ts"],"sourcesContent":["import { useCallback } from 'react';\n\nexport interface InputValueTransform<TDisplay = unknown> {\n /** Transforms the form value to display value (e.g., 1000 → \"$1,000\" or 'a' → ['a']) */\n toDisplayValue: (value: unknown) => TDisplay;\n /** Transforms the display value to form value (e.g., \"$1,000\" → 1000 or ['a'] → 'a') */\n toFormValue: (value: TDisplay) => unknown;\n}\n\nexport interface UseInputValueTransformOptions<TDisplay = unknown> {\n /** Input type for special number handling */\n type?: 'text' | 'number' | 'password';\n /** Value transformation functions */\n transform?: InputValueTransform<TDisplay>;\n}\n\nexport interface UseInputValueTransformReturn<TDisplay = unknown> {\n /** Converts any form value to display value */\n toDisplayValue: (formValue: unknown) => TDisplay;\n /** Converts any display value to form value */\n toFormValue: (displayValue: TDisplay) => unknown;\n}\n\n/**\n * Custom hook providing utility functions for value transformations between display and form values.\n *\n * This hook provides pure conversion functions without any state management. It's useful for:\n * - Currency formatting ($1,000 display vs 1000 stored)\n * - Number inputs with special handling\n * - Date formatting (MM/DD/YYYY display vs ISO date stored)\n * - Phone number formatting ((555) 123-4567 display vs 5551234567 stored)\n * - Array/Object transformations (single value ↔ array, nested structures)\n *\n * **Key Features:**\n * - Pure conversion functions (no state)\n * - Generic support for any data type (strings, numbers, arrays, objects)\n * - Special number input handling (empty string preservation)\n * - Bidirectional value transformations\n * - Memoized functions for performance\n *\n * @param options Configuration for value transformation\n * @returns Pure conversion utility functions\n *\n * @example\n * ```tsx\n * // Currency formatting\n * const currencyTransform = {\n * toDisplayValue: (val) => val ? `$${Number(val).toLocaleString()}` : '',\n * toFormValue: (val) => parseFloat(val.replace(/[$,]/g, '')) || 0\n * };\n *\n * const { toDisplayValue, toFormValue } = useInputValueTransform({\n * transform: currencyTransform\n * });\n *\n * const displayVal = toDisplayValue(1000); // \"$1,000\"\n * const formVal = toFormValue(\"$1,500\"); // 1500\n * ```\n *\n * @example\n * ```tsx\n * // Number input (no transforms needed)\n * const { toDisplayValue, toFormValue } = useInputValueTransform({\n * type: 'number'\n * });\n *\n * // Handles empty string → empty string (not NaN)\n * // Handles \"123\" → 123 (string to number conversion)\n * ```\n *\n * @example\n * ```tsx\n * // Array to single value (for single checkbox)\n * const singleValueTransform = {\n * toDisplayValue: (val: string[]) => val?.[0] || '',\n * toFormValue: (val: string) => val ? [val] : []\n * };\n *\n * const { toDisplayValue, toFormValue } = useInputValueTransform({\n * transform: singleValueTransform\n * });\n *\n * const displayVal = toDisplayValue(['option1']); // \"option1\"\n * const formVal = toFormValue(\"option2\"); // [\"option2\"]\n * ```\n *\n * @example\n * ```tsx\n * // Integration with debouncing\n * const MyInput = ({ field, transform }) => {\n * const transform = useInputValueTransform({ transform });\n *\n * const { onChange, onBlur, value } = useInputValueDebounce({\n * ...transform,\n * debounceDelay: 300,\n * name: 'fieldName',\n * onBlur: field.onBlur,\n * onChange: field.onChange,\n * value: field.value,\n * });\n *\n * return <input value={value} onChange={onChange} onBlur={onBlur} />;\n * };\n * ```\n */\nexport const useInputValueTransform = <TDisplay = unknown>({\n type,\n transform,\n}: UseInputValueTransformOptions<TDisplay>): UseInputValueTransformReturn<TDisplay> => {\n /**\n * Converts any form value to display value\n */\n const toDisplayValue = useCallback(\n (formValue: unknown): TDisplay => {\n if (transform?.toDisplayValue) {\n return transform.toDisplayValue(formValue);\n }\n\n // For number type, convert valid strings to numbers for display\n if (type === 'number') {\n if (formValue === '') {\n return '' as TDisplay;\n }\n const numValue = Number(formValue);\n return (Number.isNaN(numValue) ? formValue : numValue) as TDisplay;\n }\n\n // Default: pass through (handles primitives, arrays, objects, etc.)\n return (formValue ?? '') as TDisplay;\n },\n [type, transform],\n );\n\n /**\n * Converts any display value to form value\n */\n const toFormValue = useCallback(\n (displayValue: TDisplay): unknown => {\n if (transform?.toFormValue) {\n return transform.toFormValue(displayValue);\n }\n\n // For number type, convert strings to numbers\n if (type === 'number') {\n if (displayValue === '') {\n return '';\n }\n const numValue = Number(displayValue);\n return Number.isNaN(numValue) ? displayValue : numValue;\n }\n\n // Default: pass through (handles primitives, arrays, objects, etc.)\n return displayValue;\n },\n [type, transform],\n );\n\n return {\n toDisplayValue,\n toFormValue,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyGA,MAAa,0BAA8C,EACzD,MACA,gBACqF;CAiDrF,OAAO;EACL,gBA9CqB,aACpB,cAAiC;GAChC,IAAI,WAAW,gBACb,OAAO,UAAU,eAAe,SAAS;GAI3C,IAAI,SAAS,UAAU;IACrB,IAAI,cAAc,IAChB,OAAO;IAET,MAAM,WAAW,OAAO,SAAS;IACjC,OAAQ,OAAO,MAAM,QAAQ,IAAI,YAAY;GAC/C;GAGA,OAAQ,aAAa;EACvB,GACA,CAAC,MAAM,SAAS,CA4BH;EACb,aAvBkB,aACjB,iBAAoC;GACnC,IAAI,WAAW,aACb,OAAO,UAAU,YAAY,YAAY;GAI3C,IAAI,SAAS,UAAU;IACrB,IAAI,iBAAiB,IACnB,OAAO;IAET,MAAM,WAAW,OAAO,YAAY;IACpC,OAAO,OAAO,MAAM,QAAQ,IAAI,eAAe;GACjD;GAGA,OAAO;EACT,GACA,CAAC,MAAM,SAAS,CAKN;CACZ;AACF"}
@@ -1,4 +1,3 @@
1
- require("./FormContext-DsmS_mkO.cjs");
2
1
  let react = require("react");
3
2
  //#region src/hooks/useInputValueTransform/useInputValueTransform.ts
4
3
  /**
@@ -113,4 +112,4 @@ Object.defineProperty(exports, "useInputValueTransform", {
113
112
  }
114
113
  });
115
114
 
116
- //# sourceMappingURL=useInputValueTransform-Bm65K8LX.cjs.map
115
+ //# sourceMappingURL=useInputValueTransform-P62UUZBl.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useInputValueTransform-Bm65K8LX.cjs","names":[],"sources":["../src/hooks/useInputValueTransform/useInputValueTransform.ts"],"sourcesContent":["import { useCallback } from 'react';\n\nexport interface InputValueTransform<TDisplay = unknown> {\n /** Transforms the form value to display value (e.g., 1000 → \"$1,000\" or 'a' → ['a']) */\n toDisplayValue: (value: unknown) => TDisplay;\n /** Transforms the display value to form value (e.g., \"$1,000\" → 1000 or ['a'] → 'a') */\n toFormValue: (value: TDisplay) => unknown;\n}\n\nexport interface UseInputValueTransformOptions<TDisplay = unknown> {\n /** Input type for special number handling */\n type?: 'text' | 'number' | 'password';\n /** Value transformation functions */\n transform?: InputValueTransform<TDisplay>;\n}\n\nexport interface UseInputValueTransformReturn<TDisplay = unknown> {\n /** Converts any form value to display value */\n toDisplayValue: (formValue: unknown) => TDisplay;\n /** Converts any display value to form value */\n toFormValue: (displayValue: TDisplay) => unknown;\n}\n\n/**\n * Custom hook providing utility functions for value transformations between display and form values.\n *\n * This hook provides pure conversion functions without any state management. It's useful for:\n * - Currency formatting ($1,000 display vs 1000 stored)\n * - Number inputs with special handling\n * - Date formatting (MM/DD/YYYY display vs ISO date stored)\n * - Phone number formatting ((555) 123-4567 display vs 5551234567 stored)\n * - Array/Object transformations (single value ↔ array, nested structures)\n *\n * **Key Features:**\n * - Pure conversion functions (no state)\n * - Generic support for any data type (strings, numbers, arrays, objects)\n * - Special number input handling (empty string preservation)\n * - Bidirectional value transformations\n * - Memoized functions for performance\n *\n * @param options Configuration for value transformation\n * @returns Pure conversion utility functions\n *\n * @example\n * ```tsx\n * // Currency formatting\n * const currencyTransform = {\n * toDisplayValue: (val) => val ? `$${Number(val).toLocaleString()}` : '',\n * toFormValue: (val) => parseFloat(val.replace(/[$,]/g, '')) || 0\n * };\n *\n * const { toDisplayValue, toFormValue } = useInputValueTransform({\n * transform: currencyTransform\n * });\n *\n * const displayVal = toDisplayValue(1000); // \"$1,000\"\n * const formVal = toFormValue(\"$1,500\"); // 1500\n * ```\n *\n * @example\n * ```tsx\n * // Number input (no transforms needed)\n * const { toDisplayValue, toFormValue } = useInputValueTransform({\n * type: 'number'\n * });\n *\n * // Handles empty string → empty string (not NaN)\n * // Handles \"123\" → 123 (string to number conversion)\n * ```\n *\n * @example\n * ```tsx\n * // Array to single value (for single checkbox)\n * const singleValueTransform = {\n * toDisplayValue: (val: string[]) => val?.[0] || '',\n * toFormValue: (val: string) => val ? [val] : []\n * };\n *\n * const { toDisplayValue, toFormValue } = useInputValueTransform({\n * transform: singleValueTransform\n * });\n *\n * const displayVal = toDisplayValue(['option1']); // \"option1\"\n * const formVal = toFormValue(\"option2\"); // [\"option2\"]\n * ```\n *\n * @example\n * ```tsx\n * // Integration with debouncing\n * const MyInput = ({ field, transform }) => {\n * const transform = useInputValueTransform({ transform });\n *\n * const { onChange, onBlur, value } = useInputValueDebounce({\n * ...transform,\n * debounceDelay: 300,\n * name: 'fieldName',\n * onBlur: field.onBlur,\n * onChange: field.onChange,\n * value: field.value,\n * });\n *\n * return <input value={value} onChange={onChange} onBlur={onBlur} />;\n * };\n * ```\n */\nexport const useInputValueTransform = <TDisplay = unknown>({\n type,\n transform,\n}: UseInputValueTransformOptions<TDisplay>): UseInputValueTransformReturn<TDisplay> => {\n /**\n * Converts any form value to display value\n */\n const toDisplayValue = useCallback(\n (formValue: unknown): TDisplay => {\n if (transform?.toDisplayValue) {\n return transform.toDisplayValue(formValue);\n }\n\n // For number type, convert valid strings to numbers for display\n if (type === 'number') {\n if (formValue === '') {\n return '' as TDisplay;\n }\n const numValue = Number(formValue);\n return (Number.isNaN(numValue) ? formValue : numValue) as TDisplay;\n }\n\n // Default: pass through (handles primitives, arrays, objects, etc.)\n return (formValue ?? '') as TDisplay;\n },\n [type, transform],\n );\n\n /**\n * Converts any display value to form value\n */\n const toFormValue = useCallback(\n (displayValue: TDisplay): unknown => {\n if (transform?.toFormValue) {\n return transform.toFormValue(displayValue);\n }\n\n // For number type, convert strings to numbers\n if (type === 'number') {\n if (displayValue === '') {\n return '';\n }\n const numValue = Number(displayValue);\n return Number.isNaN(numValue) ? displayValue : numValue;\n }\n\n // Default: pass through (handles primitives, arrays, objects, etc.)\n return displayValue;\n },\n [type, transform],\n );\n\n return {\n toDisplayValue,\n toFormValue,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyGA,MAAa,0BAA8C,EACzD,MACA,gBACqF;CAiDrF,OAAO;EACL,iBAAA,GAAA,MAAA,cA7CC,cAAiC;GAChC,IAAI,WAAW,gBACb,OAAO,UAAU,eAAe,SAAS;GAI3C,IAAI,SAAS,UAAU;IACrB,IAAI,cAAc,IAChB,OAAO;IAET,MAAM,WAAW,OAAO,SAAS;IACjC,OAAQ,OAAO,MAAM,QAAQ,IAAI,YAAY;GAC/C;GAGA,OAAQ,aAAa;EACvB,GACA,CAAC,MAAM,SAAS,CA4BH;EACb,cAAA,GAAA,MAAA,cAtBC,iBAAoC;GACnC,IAAI,WAAW,aACb,OAAO,UAAU,YAAY,YAAY;GAI3C,IAAI,SAAS,UAAU;IACrB,IAAI,iBAAiB,IACnB,OAAO;IAET,MAAM,WAAW,OAAO,YAAY;IACpC,OAAO,OAAO,MAAM,QAAQ,IAAI,eAAe;GACjD;GAGA,OAAO;EACT,GACA,CAAC,MAAM,SAAS,CAKN;CACZ;AACF"}
1
+ {"version":3,"file":"useInputValueTransform-P62UUZBl.cjs","names":[],"sources":["../src/hooks/useInputValueTransform/useInputValueTransform.ts"],"sourcesContent":["import { useCallback } from 'react';\n\nexport interface InputValueTransform<TDisplay = unknown> {\n /** Transforms the form value to display value (e.g., 1000 → \"$1,000\" or 'a' → ['a']) */\n toDisplayValue: (value: unknown) => TDisplay;\n /** Transforms the display value to form value (e.g., \"$1,000\" → 1000 or ['a'] → 'a') */\n toFormValue: (value: TDisplay) => unknown;\n}\n\nexport interface UseInputValueTransformOptions<TDisplay = unknown> {\n /** Input type for special number handling */\n type?: 'text' | 'number' | 'password';\n /** Value transformation functions */\n transform?: InputValueTransform<TDisplay>;\n}\n\nexport interface UseInputValueTransformReturn<TDisplay = unknown> {\n /** Converts any form value to display value */\n toDisplayValue: (formValue: unknown) => TDisplay;\n /** Converts any display value to form value */\n toFormValue: (displayValue: TDisplay) => unknown;\n}\n\n/**\n * Custom hook providing utility functions for value transformations between display and form values.\n *\n * This hook provides pure conversion functions without any state management. It's useful for:\n * - Currency formatting ($1,000 display vs 1000 stored)\n * - Number inputs with special handling\n * - Date formatting (MM/DD/YYYY display vs ISO date stored)\n * - Phone number formatting ((555) 123-4567 display vs 5551234567 stored)\n * - Array/Object transformations (single value ↔ array, nested structures)\n *\n * **Key Features:**\n * - Pure conversion functions (no state)\n * - Generic support for any data type (strings, numbers, arrays, objects)\n * - Special number input handling (empty string preservation)\n * - Bidirectional value transformations\n * - Memoized functions for performance\n *\n * @param options Configuration for value transformation\n * @returns Pure conversion utility functions\n *\n * @example\n * ```tsx\n * // Currency formatting\n * const currencyTransform = {\n * toDisplayValue: (val) => val ? `$${Number(val).toLocaleString()}` : '',\n * toFormValue: (val) => parseFloat(val.replace(/[$,]/g, '')) || 0\n * };\n *\n * const { toDisplayValue, toFormValue } = useInputValueTransform({\n * transform: currencyTransform\n * });\n *\n * const displayVal = toDisplayValue(1000); // \"$1,000\"\n * const formVal = toFormValue(\"$1,500\"); // 1500\n * ```\n *\n * @example\n * ```tsx\n * // Number input (no transforms needed)\n * const { toDisplayValue, toFormValue } = useInputValueTransform({\n * type: 'number'\n * });\n *\n * // Handles empty string → empty string (not NaN)\n * // Handles \"123\" → 123 (string to number conversion)\n * ```\n *\n * @example\n * ```tsx\n * // Array to single value (for single checkbox)\n * const singleValueTransform = {\n * toDisplayValue: (val: string[]) => val?.[0] || '',\n * toFormValue: (val: string) => val ? [val] : []\n * };\n *\n * const { toDisplayValue, toFormValue } = useInputValueTransform({\n * transform: singleValueTransform\n * });\n *\n * const displayVal = toDisplayValue(['option1']); // \"option1\"\n * const formVal = toFormValue(\"option2\"); // [\"option2\"]\n * ```\n *\n * @example\n * ```tsx\n * // Integration with debouncing\n * const MyInput = ({ field, transform }) => {\n * const transform = useInputValueTransform({ transform });\n *\n * const { onChange, onBlur, value } = useInputValueDebounce({\n * ...transform,\n * debounceDelay: 300,\n * name: 'fieldName',\n * onBlur: field.onBlur,\n * onChange: field.onChange,\n * value: field.value,\n * });\n *\n * return <input value={value} onChange={onChange} onBlur={onBlur} />;\n * };\n * ```\n */\nexport const useInputValueTransform = <TDisplay = unknown>({\n type,\n transform,\n}: UseInputValueTransformOptions<TDisplay>): UseInputValueTransformReturn<TDisplay> => {\n /**\n * Converts any form value to display value\n */\n const toDisplayValue = useCallback(\n (formValue: unknown): TDisplay => {\n if (transform?.toDisplayValue) {\n return transform.toDisplayValue(formValue);\n }\n\n // For number type, convert valid strings to numbers for display\n if (type === 'number') {\n if (formValue === '') {\n return '' as TDisplay;\n }\n const numValue = Number(formValue);\n return (Number.isNaN(numValue) ? formValue : numValue) as TDisplay;\n }\n\n // Default: pass through (handles primitives, arrays, objects, etc.)\n return (formValue ?? '') as TDisplay;\n },\n [type, transform],\n );\n\n /**\n * Converts any display value to form value\n */\n const toFormValue = useCallback(\n (displayValue: TDisplay): unknown => {\n if (transform?.toFormValue) {\n return transform.toFormValue(displayValue);\n }\n\n // For number type, convert strings to numbers\n if (type === 'number') {\n if (displayValue === '') {\n return '';\n }\n const numValue = Number(displayValue);\n return Number.isNaN(numValue) ? displayValue : numValue;\n }\n\n // Default: pass through (handles primitives, arrays, objects, etc.)\n return displayValue;\n },\n [type, transform],\n );\n\n return {\n toDisplayValue,\n toFormValue,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyGA,MAAa,0BAA8C,EACzD,MACA,gBACqF;CAiDrF,OAAO;EACL,iBAAA,GAAA,MAAA,cA7CC,cAAiC;GAChC,IAAI,WAAW,gBACb,OAAO,UAAU,eAAe,SAAS;GAI3C,IAAI,SAAS,UAAU;IACrB,IAAI,cAAc,IAChB,OAAO;IAET,MAAM,WAAW,OAAO,SAAS;IACjC,OAAQ,OAAO,MAAM,QAAQ,IAAI,YAAY;GAC/C;GAGA,OAAQ,aAAa;EACvB,GACA,CAAC,MAAM,SAAS,CA4BH;EACb,cAAA,GAAA,MAAA,cAtBC,iBAAoC;GACnC,IAAI,WAAW,aACb,OAAO,UAAU,YAAY,YAAY;GAI3C,IAAI,SAAS,UAAU;IACrB,IAAI,iBAAiB,IACnB,OAAO;IAET,MAAM,WAAW,OAAO,YAAY;IACpC,OAAO,OAAO,MAAM,QAAQ,IAAI,eAAe;GACjD;GAGA,OAAO;EACT,GACA,CAAC,MAAM,SAAS,CAKN;CACZ;AACF"}
package/package.json CHANGED
@@ -1,20 +1,13 @@
1
1
  {
2
2
  "name": "@fuf-stack/uniform",
3
- "version": "1.22.4",
3
+ "version": "1.22.6",
4
4
  "description": "fuf react form library",
5
5
  "author": "Fröhlich ∧ Frei",
6
6
  "homepage": "https://github.com/fuf-stack/pixels#readme",
7
7
  "license": "MIT",
8
8
  "type": "module",
9
- "main": "./dist/index.cjs",
10
- "module": "./dist/index.js",
11
- "types": "./dist/index.d.cts",
12
9
  "sideEffects": false,
13
10
  "exports": {
14
- ".": {
15
- "import": "./dist/index.js",
16
- "require": "./dist/index.cjs"
17
- },
18
11
  "./Checkboxes": {
19
12
  "import": "./dist/Checkboxes/index.js",
20
13
  "require": "./dist/Checkboxes/index.cjs"
@@ -165,10 +158,10 @@
165
158
  "@dnd-kit/modifiers": "9.0.0",
166
159
  "@dnd-kit/sortable": "10.0.0",
167
160
  "@dnd-kit/utilities": "3.2.2",
168
- "@fuf-stack/pixel-motion": "1.2.1",
169
- "@fuf-stack/pixel-utils": "1.3.0",
170
- "@fuf-stack/pixels": "1.11.0",
171
- "@fuf-stack/veto": "1.7.1",
161
+ "@fuf-stack/pixel-motion": "1.2.2",
162
+ "@fuf-stack/pixel-utils": "1.3.2",
163
+ "@fuf-stack/pixels": "1.11.2",
164
+ "@fuf-stack/veto": "1.7.3",
172
165
  "@heroui/button": "2.2.32",
173
166
  "@heroui/checkbox": "2.3.32",
174
167
  "@heroui/date-input": "2.3.32",
@@ -196,5 +189,5 @@
196
189
  "react": "19.2.6",
197
190
  "react-dom": "19.2.6"
198
191
  },
199
- "gitHead": "19dc5f79b48758bc16ddf97532f840be34818c09"
192
+ "gitHead": "92bdba62f9d7284ad73a2837122ebd324ca57adc"
200
193
  }
@@ -1,112 +0,0 @@
1
- import { n as FieldValidationError } from "./FieldValidationError-ktTyyyip.js";
2
- import { useUniformField } from "./hooks/useUniformField/index.js";
3
- import { Checkbox, CheckboxGroup } from "@heroui/checkbox";
4
- import { checkbox } from "@heroui/theme";
5
- import { slugify, tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
6
- import { jsx, jsxs } from "react/jsx-runtime";
7
- //#region src/Checkboxes/Checkboxes.tsx
8
- const checkboxesVariants = tv({
9
- slots: {
10
- base: "group",
11
- errorMessage: "text-tiny",
12
- label: "inline-flex text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger",
13
- optionBase: "",
14
- optionIcon: "",
15
- optionLabel: "",
16
- optionLabelSubline: "text-foreground-400 !text-small",
17
- optionWrapper: "",
18
- wrapper: ""
19
- },
20
- variants: {
21
- color: {
22
- info: { wrapper: "text-info-foreground after:bg-info after:text-info-foreground" },
23
- ...checkbox.variants.color
24
- },
25
- lineThrough: { true: {
26
- optionLabel: [...checkbox.variants.lineThrough.true.label, "relative before:transition-all before:duration-200"],
27
- optionLabelSubline: "group-data-[selected=true]:opacity-60"
28
- } }
29
- }
30
- });
31
- /**
32
- * Checkboxes component based on [HeroUI CheckboxGroup](https://www.heroui.com//docs/components/checkbox-group)
33
- */
34
- const Checkboxes = ({ className = void 0, color = "primary", inline = false, lineThrough = false, options, name, ...uniformFieldProps }) => {
35
- const { ariaLabel, disabled, error: _error, field: { onChange, value: fieldValue, ref, onBlur }, invalid, label, required, testId } = useUniformField({
36
- name,
37
- ...uniformFieldProps
38
- });
39
- const value = Array.isArray(fieldValue) ? fieldValue : [];
40
- const errorMessage = /* @__PURE__ */ jsx(FieldValidationError, {
41
- error: (_error && Object.values(_error).flat()) ?? [],
42
- testId
43
- });
44
- const classNames = variantsToClassNames(checkboxesVariants({ lineThrough }), className, "base");
45
- const heroCheckboxGroupClassNames = {
46
- base: classNames.base,
47
- label: classNames.label,
48
- wrapper: classNames.wrapper
49
- };
50
- const heroCheckboxClassNames = {
51
- base: classNames.optionBase,
52
- icon: classNames.optionIcon,
53
- label: classNames.optionLabel,
54
- wrapper: classNames.optionWrapper
55
- };
56
- return /* @__PURE__ */ jsx(CheckboxGroup, {
57
- ref,
58
- "aria-label": ariaLabel,
59
- classNames: heroCheckboxGroupClassNames,
60
- color: color === "info" ? "primary" : color,
61
- "data-invalid": invalid,
62
- "data-testid": testId,
63
- errorMessage,
64
- isDisabled: disabled,
65
- isInvalid: invalid,
66
- isRequired: required,
67
- label: label ? /* @__PURE__ */ jsx("legend", { children: label }) : null,
68
- name,
69
- onBlur,
70
- onChange,
71
- orientation: inline ? "horizontal" : "vertical",
72
- value,
73
- children: options?.map((option) => {
74
- const optionTestId = slugify(`${testId}_option_${option?.testId ?? option?.value}`, { replaceDots: true });
75
- const hasSubline = !!option.labelSubline;
76
- let labelContent;
77
- let optionClassNames = heroCheckboxClassNames;
78
- if (hasSubline) {
79
- labelContent = /* @__PURE__ */ jsxs("div", {
80
- className: "flex grow flex-col items-start",
81
- children: [/* @__PURE__ */ jsx("span", {
82
- className: classNames.optionLabel,
83
- children: option.label
84
- }), /* @__PURE__ */ jsx("span", {
85
- className: classNames.optionLabelSubline,
86
- children: option.labelSubline
87
- })]
88
- });
89
- optionClassNames = {
90
- ...optionClassNames,
91
- label: ""
92
- };
93
- } else labelContent = option.label;
94
- return /* @__PURE__ */ jsx(Checkbox, {
95
- classNames: optionClassNames,
96
- "data-invalid": invalid,
97
- "data-testid": optionTestId,
98
- isDisabled: !!disabled || option.disabled,
99
- value: option?.value,
100
- "aria-label": typeof option.label === "string" ? option.label : option.value,
101
- children: labelContent
102
- }, `index_${option.value}`);
103
- })
104
- });
105
- };
106
- //#endregion
107
- //#region src/Checkboxes/index.ts
108
- var Checkboxes_default = Checkboxes;
109
- //#endregion
110
- export { Checkboxes as n, Checkboxes_default as t };
111
-
112
- //# sourceMappingURL=Checkboxes-D1hppxDE.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Checkboxes-D1hppxDE.js","names":["heroCheckboxVariants","HeroCheckboxGroup","HeroCheckbox"],"sources":["../src/Checkboxes/Checkboxes.tsx","../src/Checkboxes/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type {\n CheckboxGroupProps as HeroCheckboxGroupProps,\n CheckboxProps as HeroCheckboxProps,\n} from '@heroui/checkbox';\nimport type { ReactNode } from 'react';\nimport type { FieldError } from 'react-hook-form';\nimport type { InputValueTransform } from '../hooks/useInputValueTransform';\n\nimport {\n Checkbox as HeroCheckbox,\n CheckboxGroup as HeroCheckboxGroup,\n} from '@heroui/checkbox';\nimport { checkbox as heroCheckboxVariants } from '@heroui/theme';\n\nimport { slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\nimport { FieldValidationError } from '../partials/FieldValidationError';\n\nexport const checkboxesVariants = tv({\n slots: {\n base: 'group', // Needs group for group-data condition\n errorMessage: 'text-tiny',\n // see HeroUI styles for group-data condition,\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/select.ts\n label:\n 'inline-flex text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger',\n optionBase: '',\n optionIcon: '',\n optionLabel: '',\n optionLabelSubline: 'text-foreground-400 !text-small',\n optionWrapper: '',\n wrapper: '',\n },\n variants: {\n // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/checkbox.ts\n color: {\n info: {\n wrapper:\n 'text-info-foreground after:bg-info after:text-info-foreground',\n },\n ...heroCheckboxVariants.variants.color,\n } as const,\n lineThrough: {\n true: {\n optionLabel: [\n ...heroCheckboxVariants.variants.lineThrough.true.label,\n // fix stroke position when used with subline and enable animation\n 'relative before:transition-all before:duration-200',\n ],\n optionLabelSubline: 'group-data-[selected=true]:opacity-60',\n },\n },\n },\n});\n\ntype VariantProps = TVProps<typeof checkboxesVariants>;\ntype ClassName = TVClassName<typeof checkboxesVariants>;\n\nexport interface CheckboxOption {\n /** option label */\n label?: ReactNode;\n /** subline displayed below the label */\n labelSubline?: ReactNode;\n /** option value */\n value: string;\n /** disables the option */\n disabled?: boolean;\n /** HTML data-testid attribute of the option */\n testId?: string;\n}\n\nexport interface CheckboxesProps extends VariantProps {\n /** Custom aria-label for accessibility. If not provided, falls back to field name when no visible label exists */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName;\n /** Color scheme of the checkboxes */\n color?: VariantProps['color'];\n /** Sets all checkboxes disabled */\n disabled?: boolean;\n /** Orientation of the checkboxes */\n inline?: boolean;\n /** Label displayed above the checkboxes */\n label?: ReactNode;\n /** Whether the checkboxes label should be crossed out */\n lineThrough?: boolean;\n /** Name the Field is registered on the form */\n name: string;\n /** Checkboxes that should be displayed. */\n options: CheckboxOption[];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** allows disentangled display and form values for a field */\n transform?: InputValueTransform<string[]>;\n}\n\n/**\n * Checkboxes component based on [HeroUI CheckboxGroup](https://www.heroui.com//docs/components/checkbox-group)\n */\nconst Checkboxes = ({\n className = undefined,\n color = 'primary',\n inline = false,\n lineThrough = false,\n options,\n name,\n ...uniformFieldProps\n}: CheckboxesProps) => {\n const {\n ariaLabel,\n disabled,\n error: _error,\n field: { onChange, value: fieldValue, ref, onBlur },\n invalid,\n label,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ensure value is always an array (checkboxes need arrays)\n const value = Array.isArray(fieldValue) ? fieldValue : [];\n\n // Convert React Hook Form's nested error object structure to a flat array\n // RHF errors can be nested like: checkboxField.0 (individual checkbox errors)\n // and checkboxField._error (global field errors) - this flattens all\n // error values into a single array for rendering with FieldValidationError\n const errorFlat: FieldError[] =\n (_error &&\n Object.values(\n _error as unknown as Record<string, FieldError[]>,\n ).flat()) ??\n [];\n const errorMessage = (\n <FieldValidationError error={errorFlat} testId={testId} />\n );\n\n // classNames from slots\n const variants = checkboxesVariants({ lineThrough });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // map slots to HeroUI class names\n const heroCheckboxGroupClassNames: HeroCheckboxGroupProps['classNames'] = {\n base: classNames.base,\n label: classNames.label,\n wrapper: classNames.wrapper,\n };\n const heroCheckboxClassNames: HeroCheckboxProps['classNames'] = {\n base: classNames.optionBase,\n icon: classNames.optionIcon,\n label: classNames.optionLabel,\n wrapper: classNames.optionWrapper,\n };\n\n return (\n <HeroCheckboxGroup\n ref={ref}\n aria-label={ariaLabel}\n classNames={heroCheckboxGroupClassNames}\n color={color === 'info' ? 'primary' : color}\n // see HeroUI styles for group-data condition (data-invalid),\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/components/select/src/use-select.ts\n data-invalid={invalid}\n data-testid={testId}\n errorMessage={errorMessage}\n isDisabled={disabled}\n isInvalid={invalid}\n isRequired={required}\n label={label ? <legend>{label}</legend> : null}\n name={name}\n onBlur={onBlur}\n onChange={onChange}\n orientation={inline ? 'horizontal' : 'vertical'}\n value={value}\n >\n {options?.map((option) => {\n const optionTestId = slugify(\n `${testId}_option_${option?.testId ?? option?.value}`,\n { replaceDots: true },\n );\n\n // set content and classes depending option has subline\n const hasSubline = !!option.labelSubline;\n let labelContent: ReactNode;\n let optionClassNames = heroCheckboxClassNames;\n if (hasSubline) {\n labelContent = (\n <div className=\"flex grow flex-col items-start\">\n <span className={classNames.optionLabel}>{option.label}</span>\n <span className={classNames.optionLabelSubline}>\n {option.labelSubline}\n </span>\n </div>\n );\n // remove label classes from outer label when subline is used\n optionClassNames = { ...optionClassNames, label: '' };\n } else {\n labelContent = option.label;\n }\n\n return (\n <HeroCheckbox\n key={`index_${option.value}`}\n classNames={optionClassNames}\n data-invalid={invalid}\n data-testid={optionTestId}\n isDisabled={!!disabled || option.disabled}\n value={option?.value}\n aria-label={\n typeof option.label === 'string' ? option.label : option.value\n }\n >\n {labelContent}\n </HeroCheckbox>\n );\n })}\n </HeroCheckboxGroup>\n );\n};\n\nexport default Checkboxes;\n","import Checkboxes from './Checkboxes';\n\nexport type { CheckboxesProps, CheckboxOption } from './Checkboxes';\n\nexport { Checkboxes };\n\nexport default Checkboxes;\n"],"mappings":";;;;;;;AAoBA,MAAa,qBAAqB,GAAG;CACnC,OAAO;EACL,MAAM;EACN,cAAc;EAGd,OACE;EACF,YAAY;EACZ,YAAY;EACZ,aAAa;EACb,oBAAoB;EACpB,eAAe;EACf,SAAS;CACX;CACA,UAAU;EAER,OAAO;GACL,MAAM,EACJ,SACE,gEACJ;GACA,GAAGA,SAAqB,SAAS;EACnC;EACA,aAAa,EACX,MAAM;GACJ,aAAa,CACX,GAAGA,SAAqB,SAAS,YAAY,KAAK,OAElD,oDACF;GACA,oBAAoB;EACtB,EACF;CACF;AACF,CAAC;;;;AA8CD,MAAM,cAAc,EAClB,YAAY,KAAA,GACZ,QAAQ,WACR,SAAS,OACT,cAAc,OACd,SACA,MACA,GAAG,wBACkB;CACrB,MAAM,EACJ,WACA,UACA,OAAO,QACP,OAAO,EAAE,UAAU,OAAO,YAAY,KAAK,UAC3C,SACA,OACA,UACA,WACE,gBAAgB;EAClB;EACA,GAAG;CACL,CAAC;CAGD,MAAM,QAAQ,MAAM,QAAQ,UAAU,IAAI,aAAa,CAAC;CAYxD,MAAM,eACJ,oBAAC,sBAAD;EAAsB,QANrB,UACC,OAAO,OACL,MACF,EAAE,KAAK,MACT,CAAC;EAE+C;CAAS,CAAA;CAK3D,MAAM,aAAa,qBADF,mBAAmB,EAAE,YAAY,CACH,GAAG,WAAW,MAAM;CAGnE,MAAM,8BAAoE;EACxE,MAAM,WAAW;EACjB,OAAO,WAAW;EAClB,SAAS,WAAW;CACtB;CACA,MAAM,yBAA0D;EAC9D,MAAM,WAAW;EACjB,MAAM,WAAW;EACjB,OAAO,WAAW;EAClB,SAAS,WAAW;CACtB;CAEA,OACE,oBAACC,eAAD;EACO;EACL,cAAY;EACZ,YAAY;EACZ,OAAO,UAAU,SAAS,YAAY;EAGtC,gBAAc;EACd,eAAa;EACC;EACd,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,OAAO,QAAQ,oBAAC,UAAD,EAAA,UAAS,MAAc,CAAA,IAAI;EACpC;EACE;EACE;EACV,aAAa,SAAS,eAAe;EAC9B;YAEN,SAAS,KAAK,WAAW;GACxB,MAAM,eAAe,QACnB,GAAG,OAAO,UAAU,QAAQ,UAAU,QAAQ,SAC9C,EAAE,aAAa,KAAK,CACtB;GAGA,MAAM,aAAa,CAAC,CAAC,OAAO;GAC5B,IAAI;GACJ,IAAI,mBAAmB;GACvB,IAAI,YAAY;IACd,eACE,qBAAC,OAAD;KAAK,WAAU;eAAf,CACE,oBAAC,QAAD;MAAM,WAAW,WAAW;gBAAc,OAAO;KAAY,CAAA,GAC7D,oBAAC,QAAD;MAAM,WAAW,WAAW;gBACzB,OAAO;KACJ,CAAA,CACH;;IAGP,mBAAmB;KAAE,GAAG;KAAkB,OAAO;IAAG;GACtD,OACE,eAAe,OAAO;GAGxB,OACE,oBAACC,UAAD;IAEE,YAAY;IACZ,gBAAc;IACd,eAAa;IACb,YAAY,CAAC,CAAC,YAAY,OAAO;IACjC,OAAO,QAAQ;IACf,cACE,OAAO,OAAO,UAAU,WAAW,OAAO,QAAQ,OAAO;cAG1D;GACW,GAXP,SAAS,OAAO,OAWT;EAElB,CAAC;CACgB,CAAA;AAEvB;;;ACxNA,IAAA,qBAAe"}