@fuf-stack/uniform 1.22.2 → 1.22.4

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 (202) hide show
  1. package/dist/Checkboxes/index.cjs +1 -1
  2. package/dist/{Checkboxes-Ce7gp6L_.cjs → Checkboxes-DHk09GmH.cjs} +3 -3
  3. package/dist/{Checkboxes-Ce7gp6L_.cjs.map → Checkboxes-DHk09GmH.cjs.map} +1 -1
  4. package/dist/DatePicker/index.cjs +1 -1
  5. package/dist/{DatePicker-BAe4t169.cjs → DatePicker-DuBjvS5g.cjs} +2 -2
  6. package/dist/{DatePicker-BAe4t169.cjs.map → DatePicker-DuBjvS5g.cjs.map} +1 -1
  7. package/dist/FieldArray/index.cjs +1 -1
  8. package/dist/{FieldArray-iHmWagv3.cjs → FieldArray-DgiQpIdr.cjs} +4 -4
  9. package/dist/{FieldArray-iHmWagv3.cjs.map → FieldArray-DgiQpIdr.cjs.map} +1 -1
  10. package/dist/FieldCard/index.cjs +1 -1
  11. package/dist/FieldCard/index.js +1 -1
  12. package/dist/{FieldCard-x142VXrR.js → FieldCard-BK6SNqFY.js} +2 -2
  13. package/dist/{FieldCard-x142VXrR.js.map → FieldCard-BK6SNqFY.js.map} +1 -1
  14. package/dist/{FieldCard-D9c1j_RX.cjs → FieldCard-C-DZ5ARr.cjs} +4 -4
  15. package/dist/{FieldCard-D9c1j_RX.cjs.map → FieldCard-C-DZ5ARr.cjs.map} +1 -1
  16. package/dist/{FieldCopyTestIdButton-slAdYh6I.cjs → FieldCopyTestIdButton-ptoB1F75.cjs} +2 -2
  17. package/dist/{FieldCopyTestIdButton-slAdYh6I.cjs.map → FieldCopyTestIdButton-ptoB1F75.cjs.map} +1 -1
  18. package/dist/{FieldValidationError-BWrQN-Im.cjs → FieldValidationError-BQcvvU9i.cjs} +2 -2
  19. package/dist/{FieldValidationError-BWrQN-Im.cjs.map → FieldValidationError-BQcvvU9i.cjs.map} +1 -1
  20. package/dist/Form/index.cjs +1 -1
  21. package/dist/Form/index.d.cts +1 -1
  22. package/dist/Form/index.d.ts +1 -1
  23. package/dist/Form/index.js +1 -1
  24. package/dist/{Form-qbwbBna_.cjs → Form-CYlsIABv.cjs} +3 -3
  25. package/dist/{Form-qbwbBna_.cjs.map → Form-CYlsIABv.cjs.map} +1 -1
  26. package/dist/{Form-CwzO0-Wf.js → Form-D3yfDu4L.js} +3 -3
  27. package/dist/{Form-CwzO0-Wf.js.map → Form-D3yfDu4L.js.map} +1 -1
  28. package/dist/{FormContext-BuG3xZFe.d.cts → FormContext-3kamRn2C.d.cts} +4 -2
  29. package/dist/FormContext-3kamRn2C.d.cts.map +1 -0
  30. package/dist/{FormContext-Fwnjz-qH.js → FormContext-BQeKOV-0.js} +25 -1
  31. package/dist/FormContext-BQeKOV-0.js.map +1 -0
  32. package/dist/{FormContext-CjDd8Zej.cjs → FormContext-DsmS_mkO.cjs} +25 -1
  33. package/dist/FormContext-DsmS_mkO.cjs.map +1 -0
  34. package/dist/{FormContext-qrel_XTj.d.ts → FormContext-i66vM5f1.d.ts} +4 -2
  35. package/dist/FormContext-i66vM5f1.d.ts.map +1 -0
  36. package/dist/Grid/index.cjs +1 -1
  37. package/dist/{Grid-RbL6tNfn.cjs → Grid-D-VcRGi9.cjs} +2 -2
  38. package/dist/{Grid-RbL6tNfn.cjs.map → Grid-D-VcRGi9.cjs.map} +1 -1
  39. package/dist/Input/index.cjs +1 -1
  40. package/dist/{Input-CoY-URbn.cjs → Input-DvVViuWH.cjs} +2 -2
  41. package/dist/{Input-CoY-URbn.cjs.map → Input-DvVViuWH.cjs.map} +1 -1
  42. package/dist/RadioBoxes/index.cjs +1 -1
  43. package/dist/{RadioBoxes-D1hnc1Ri.cjs → RadioBoxes-CR--FBhQ.cjs} +2 -2
  44. package/dist/{RadioBoxes-D1hnc1Ri.cjs.map → RadioBoxes-CR--FBhQ.cjs.map} +1 -1
  45. package/dist/RadioTabs/index.cjs +1 -1
  46. package/dist/{RadioTabs-cOxm4bUG.cjs → RadioTabs-Btt582Nl.cjs} +2 -2
  47. package/dist/{RadioTabs-cOxm4bUG.cjs.map → RadioTabs-Btt582Nl.cjs.map} +1 -1
  48. package/dist/Radios/index.cjs +1 -1
  49. package/dist/{Radios-2ItHXQvj.cjs → Radios-Jg9mwE0B.cjs} +2 -2
  50. package/dist/{Radios-2ItHXQvj.cjs.map → Radios-Jg9mwE0B.cjs.map} +1 -1
  51. package/dist/Select/index.cjs +1 -1
  52. package/dist/Select/index.d.cts +1 -1
  53. package/dist/Select/index.d.ts +1 -1
  54. package/dist/Select/index.js +1 -1
  55. package/dist/{Select-B_4WR3xS.cjs → Select-CZwuEAB5.cjs} +3 -3
  56. package/dist/{Select-B_4WR3xS.cjs.map → Select-CZwuEAB5.cjs.map} +1 -1
  57. package/dist/{Select-CJm6d_2K.js → Select-CgeqhZIC.js} +2 -2
  58. package/dist/{Select-CJm6d_2K.js.map → Select-CgeqhZIC.js.map} +1 -1
  59. package/dist/Slider/index.cjs +1 -1
  60. package/dist/Slider/index.d.cts +1 -1
  61. package/dist/Slider/index.d.ts +1 -1
  62. package/dist/{Slider-BC5TEf2D.cjs → Slider-Bpxt-Qgj.cjs} +2 -2
  63. package/dist/{Slider-BC5TEf2D.cjs.map → Slider-Bpxt-Qgj.cjs.map} +1 -1
  64. package/dist/SubmitButton/index.cjs +1 -1
  65. package/dist/SubmitButton/index.js +1 -1
  66. package/dist/{SubmitButton-BeHeUxQw.cjs → SubmitButton-D-wn1PJV.cjs} +3 -3
  67. package/dist/{SubmitButton-BeHeUxQw.cjs.map → SubmitButton-D-wn1PJV.cjs.map} +1 -1
  68. package/dist/{SubmitButton-DULHEFre.js → SubmitButton-D6aU7IgC.js} +2 -2
  69. package/dist/{SubmitButton-DULHEFre.js.map → SubmitButton-D6aU7IgC.js.map} +1 -1
  70. package/dist/Switch/index.cjs +1 -1
  71. package/dist/Switch/index.d.cts +1 -1
  72. package/dist/Switch/index.d.ts +1 -1
  73. package/dist/{Switch-CEiKCrNc.cjs → Switch-hjjy34QB.cjs} +2 -2
  74. package/dist/{Switch-CEiKCrNc.cjs.map → Switch-hjjy34QB.cjs.map} +1 -1
  75. package/dist/SwitchBox/index.cjs +1 -1
  76. package/dist/{SwitchBox-D_wdu74r.cjs → SwitchBox-Dl-F5y2m.cjs} +2 -2
  77. package/dist/{SwitchBox-D_wdu74r.cjs.map → SwitchBox-Dl-F5y2m.cjs.map} +1 -1
  78. package/dist/TextArea/index.cjs +1 -1
  79. package/dist/{TextArea-euLXwb_s.cjs → TextArea-CMXm-kTK.cjs} +2 -2
  80. package/dist/{TextArea-euLXwb_s.cjs.map → TextArea-CMXm-kTK.cjs.map} +1 -1
  81. package/dist/Time/index.cjs +1 -1
  82. package/dist/{Time-mmSE7FJg.cjs → Time-WKgbji5k.cjs} +2 -2
  83. package/dist/{Time-mmSE7FJg.cjs.map → Time-WKgbji5k.cjs.map} +1 -1
  84. package/dist/helpers/index.cjs +1 -1
  85. package/dist/hooks/useClientValidation/index.cjs +1 -1
  86. package/dist/hooks/useClientValidation/index.js +1 -1
  87. package/dist/hooks/useController/index.cjs +1 -1
  88. package/dist/hooks/useController/index.js +1 -1
  89. package/dist/hooks/useFormContext/index.cjs +1 -1
  90. package/dist/hooks/useFormContext/index.d.cts +1 -1
  91. package/dist/hooks/useFormContext/index.d.ts +1 -1
  92. package/dist/hooks/useFormContext/index.js +1 -1
  93. package/dist/hooks/useInput/index.cjs +1 -1
  94. package/dist/hooks/useInputValueDebounce/index.cjs +2 -2
  95. package/dist/hooks/useInputValueDebounce/index.js +1 -1
  96. package/dist/hooks/useInputValueTransform/index.cjs +1 -1
  97. package/dist/hooks/useUniformField/index.cjs +6 -6
  98. package/dist/hooks/useUniformField/index.d.cts +1 -1
  99. package/dist/hooks/useUniformField/index.d.ts +1 -1
  100. package/dist/hooks/useUniformField/index.js +2 -2
  101. package/dist/hooks/useUniformFieldArray/index.cjs +23 -4
  102. package/dist/hooks/useUniformFieldArray/index.cjs.map +1 -1
  103. package/dist/hooks/useUniformFieldArray/index.d.cts +1 -1
  104. package/dist/hooks/useUniformFieldArray/index.d.ts +1 -1
  105. package/dist/hooks/useUniformFieldArray/index.js +23 -4
  106. package/dist/hooks/useUniformFieldArray/index.js.map +1 -1
  107. package/dist/hooks/useWatchFormReset/index.cjs +39 -0
  108. package/dist/hooks/useWatchFormReset/index.cjs.map +1 -0
  109. package/dist/hooks/useWatchFormReset/index.d.cts +2 -0
  110. package/dist/hooks/useWatchFormReset/index.d.ts +2 -0
  111. package/dist/hooks/useWatchFormReset/index.js +37 -0
  112. package/dist/hooks/useWatchFormReset/index.js.map +1 -0
  113. package/dist/hooks/useWatchUserChange/index.cjs +1 -1
  114. package/dist/hooks/useWatchUserChange/index.d.cts +1 -1
  115. package/dist/hooks/useWatchUserChange/index.d.ts +1 -1
  116. package/dist/hooks/useWatchUserChange/index.js +1 -1
  117. package/dist/{index-B3JBVqnz.d.ts → index-54OZEaUU.d.ts} +2 -2
  118. package/dist/{index-B3JBVqnz.d.ts.map → index-54OZEaUU.d.ts.map} +1 -1
  119. package/dist/{index-BSwiB7ug.d.ts → index-B7gQppgQ.d.ts} +7 -7
  120. package/dist/{index-BSwiB7ug.d.ts.map → index-B7gQppgQ.d.ts.map} +1 -1
  121. package/dist/{index-CJEqtwN7.d.cts → index-Bzs7_gnk.d.cts} +7 -7
  122. package/dist/{index-CJEqtwN7.d.cts.map → index-Bzs7_gnk.d.cts.map} +1 -1
  123. package/dist/{index-D76g-bjx.d.cts → index-C3-TV4Up.d.cts} +2 -2
  124. package/dist/{index-D76g-bjx.d.cts.map → index-C3-TV4Up.d.cts.map} +1 -1
  125. package/dist/{index-CbGiXZQv.d.ts → index-C4GJH8Xv.d.ts} +7 -7
  126. package/dist/{index-CbGiXZQv.d.ts.map → index-C4GJH8Xv.d.ts.map} +1 -1
  127. package/dist/{index-kBbApopL.d.ts → index-CE8fnXuQ.d.ts} +16 -16
  128. package/dist/{index-kBbApopL.d.ts.map → index-CE8fnXuQ.d.ts.map} +1 -1
  129. package/dist/{index-9jGNsUbr2.d.ts → index-CEJxjf5R.d.ts} +1 -1
  130. package/dist/index-CEJxjf5R.d.ts.map +1 -0
  131. package/dist/{index-Bf_19w5d2.d.ts → index-CHQKk_fN2.d.ts} +1 -1
  132. package/dist/{index-BM4O3yE9.d.cts.map → index-CHQKk_fN2.d.ts.map} +1 -1
  133. package/dist/{index-BM4O3yE9.d.cts → index-CXvUaeCL.d.cts} +1 -1
  134. package/dist/{index-Bf_19w5d2.d.ts.map → index-CXvUaeCL.d.cts.map} +1 -1
  135. package/dist/{index-CaqBRMFF.d.cts → index-D8udSkgA.d.cts} +16 -16
  136. package/dist/{index-CaqBRMFF.d.cts.map → index-D8udSkgA.d.cts.map} +1 -1
  137. package/dist/{index-DZaZ82uM.d.cts → index-DNADTCoc.d.cts} +7 -7
  138. package/dist/{index-DZaZ82uM.d.cts.map → index-DNADTCoc.d.cts.map} +1 -1
  139. package/dist/{index-6mOo2unD.d.cts → index-P30z4VRT.d.cts} +1 -1
  140. package/dist/{index-6mOo2unD.d.cts.map → index-P30z4VRT.d.cts.map} +1 -1
  141. package/dist/index.cjs +27 -25
  142. package/dist/index.cjs.map +1 -1
  143. package/dist/index.d.cts +12 -11
  144. package/dist/index.d.ts +12 -11
  145. package/dist/index.js +10 -9
  146. package/dist/index.js.map +1 -1
  147. package/dist/partials/FieldCopyTestIdButton/index.cjs +1 -1
  148. package/dist/partials/FieldCopyTestIdButton/index.d.cts +1 -1
  149. package/dist/partials/FieldCopyTestIdButton/index.d.ts +1 -1
  150. package/dist/partials/FieldValidationError/index.cjs +1 -1
  151. package/dist/partials/FieldValidationError/index.d.cts +1 -1
  152. package/dist/partials/FieldValidationError/index.d.ts +1 -1
  153. package/dist/{useClientValidation-THb-oOkO.cjs → useClientValidation-BRfhqRom.cjs} +3 -3
  154. package/dist/{useClientValidation-THb-oOkO.cjs.map → useClientValidation-BRfhqRom.cjs.map} +1 -1
  155. package/dist/{useClientValidation-DJLKWU1v.js → useClientValidation-DpLdzIAb.js} +2 -2
  156. package/dist/{useClientValidation-DJLKWU1v.js.map → useClientValidation-DpLdzIAb.js.map} +1 -1
  157. package/dist/{useController-BCvnjoe0.cjs → useController--lRPWBuD.cjs} +2 -2
  158. package/dist/{useController-BCvnjoe0.cjs.map → useController--lRPWBuD.cjs.map} +1 -1
  159. package/dist/{useController-DVF2y3O3.js → useController-B287flU_.js} +2 -2
  160. package/dist/{useController-DVF2y3O3.js.map → useController-B287flU_.js.map} +1 -1
  161. package/dist/{useFormContext-DJ-9hs8X.js → useFormContext-CT8H8xIe.js} +14 -3
  162. package/dist/useFormContext-CT8H8xIe.js.map +1 -0
  163. package/dist/{useFormContext-BbTP0PIW.d.ts → useFormContext-CpLVpNAf.d.ts} +9 -5
  164. package/dist/useFormContext-CpLVpNAf.d.ts.map +1 -0
  165. package/dist/{useFormContext-C_EQr8dV.cjs → useFormContext-CrXwNYiB.cjs} +14 -3
  166. package/dist/useFormContext-CrXwNYiB.cjs.map +1 -0
  167. package/dist/{useFormContext-BSDtq3J5.d.cts → useFormContext-Ddc1HWKv.d.cts} +9 -5
  168. package/dist/useFormContext-Ddc1HWKv.d.cts.map +1 -0
  169. package/dist/{useInputValueTransform-f50WxOkF.cjs → useInputValueTransform-Bm65K8LX.cjs} +2 -2
  170. package/dist/{useInputValueTransform-f50WxOkF.cjs.map → useInputValueTransform-Bm65K8LX.cjs.map} +1 -1
  171. package/dist/{useUniformField-DAUNqJiM.d.cts → useUniformField-CmAYcGER.d.cts} +2 -2
  172. package/dist/{useUniformField-DAUNqJiM.d.cts.map → useUniformField-CmAYcGER.d.cts.map} +1 -1
  173. package/dist/{useUniformField-CFonAaLK.d.ts → useUniformField-DJDpQzRo.d.ts} +2 -2
  174. package/dist/{useUniformField-CFonAaLK.d.ts.map → useUniformField-DJDpQzRo.d.ts.map} +1 -1
  175. package/dist/{useUniformFieldArray-CuZB9JPM.d.cts → useUniformFieldArray-D3fdzwzD.d.cts} +5 -3
  176. package/dist/useUniformFieldArray-D3fdzwzD.d.cts.map +1 -0
  177. package/dist/{useUniformFieldArray-CzUfdsFB.d.ts → useUniformFieldArray-zGcIhwhF.d.ts} +5 -3
  178. package/dist/useUniformFieldArray-zGcIhwhF.d.ts.map +1 -0
  179. package/dist/useWatchFormReset-BSd6jMxU.d.cts +38 -0
  180. package/dist/useWatchFormReset-BSd6jMxU.d.cts.map +1 -0
  181. package/dist/useWatchFormReset-C7YJ-I3N.d.ts +38 -0
  182. package/dist/useWatchFormReset-C7YJ-I3N.d.ts.map +1 -0
  183. package/dist/{useWatchUserChange-YtVWYw_E.cjs → useWatchUserChange-C1xWHtFG.cjs} +3 -3
  184. package/dist/{useWatchUserChange-YtVWYw_E.cjs.map → useWatchUserChange-C1xWHtFG.cjs.map} +1 -1
  185. package/dist/{useWatchUserChange-CpQ-pWRM.d.ts → useWatchUserChange-CpyZz2i7.d.ts} +1 -1
  186. package/dist/{useWatchUserChange-CpQ-pWRM.d.ts.map → useWatchUserChange-CpyZz2i7.d.ts.map} +1 -1
  187. package/dist/{useWatchUserChange-BgO4melQ.d.cts → useWatchUserChange-DSAboNCs.d.cts} +1 -1
  188. package/dist/{useWatchUserChange-BgO4melQ.d.cts.map → useWatchUserChange-DSAboNCs.d.cts.map} +1 -1
  189. package/dist/{useWatchUserChange-Bnx3tOOR.js → useWatchUserChange-DSQGsl1R.js} +2 -2
  190. package/dist/{useWatchUserChange-Bnx3tOOR.js.map → useWatchUserChange-DSQGsl1R.js.map} +1 -1
  191. package/package.json +6 -2
  192. package/dist/FormContext-BuG3xZFe.d.cts.map +0 -1
  193. package/dist/FormContext-CjDd8Zej.cjs.map +0 -1
  194. package/dist/FormContext-Fwnjz-qH.js.map +0 -1
  195. package/dist/FormContext-qrel_XTj.d.ts.map +0 -1
  196. package/dist/index-9jGNsUbr2.d.ts.map +0 -1
  197. package/dist/useFormContext-BSDtq3J5.d.cts.map +0 -1
  198. package/dist/useFormContext-BbTP0PIW.d.ts.map +0 -1
  199. package/dist/useFormContext-C_EQr8dV.cjs.map +0 -1
  200. package/dist/useFormContext-DJ-9hs8X.js.map +0 -1
  201. package/dist/useUniformFieldArray-CuZB9JPM.d.cts.map +0 -1
  202. package/dist/useUniformFieldArray-CzUfdsFB.d.ts.map +0 -1
@@ -1,8 +1,8 @@
1
1
  import { isValueEmpty } from "../../helpers/index.js";
2
2
  import { n as FieldCopyTestIdButton } from "../../FieldCopyTestIdButton-Dpmo0uBV.js";
3
3
  import { n as FieldValidationError } from "../../FieldValidationError-ktTyyyip.js";
4
- import { t as useController } from "../../useController-DVF2y3O3.js";
5
- import { n as useFormContext } from "../../useFormContext-DJ-9hs8X.js";
4
+ import { t as useController } from "../../useController-B287flU_.js";
5
+ import { n as useFormContext } from "../../useFormContext-CT8H8xIe.js";
6
6
  import { t as useInput } from "../../useInput-CVm3tP78.js";
7
7
  import { t as useInputValueTransform } from "../../useInputValueTransform-CXdmtc0Q.js";
8
8
  import "react";
@@ -1,8 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- require("../../FormContext-CjDd8Zej.cjs");
2
+ require("../../FormContext-DsmS_mkO.cjs");
3
3
  const require_helpers_index = require("../../helpers/index.cjs");
4
- const require_useFormContext = require("../../useFormContext-C_EQr8dV.cjs");
4
+ const require_useFormContext = require("../../useFormContext-CrXwNYiB.cjs");
5
5
  const require_hooks_useUniformField_index = require("../useUniformField/index.cjs");
6
+ const require_hooks_useWatchFormReset_index = require("../useWatchFormReset/index.cjs");
6
7
  let react = require("react");
7
8
  let _fuf_stack_pixel_motion = require("@fuf-stack/pixel-motion");
8
9
  let react_hook_form = require("react-hook-form");
@@ -11,7 +12,9 @@ let react_hook_form = require("react-hook-form");
11
12
  * Enhanced useFieldArray hook with initialization and animation logic.
12
13
  * Based on React Hook Form's useFieldArray with additional features:
13
14
  * - Automatic initialization when lastElementNotRemovable is set
15
+ * - Reset-only normalization for stale empty placeholder rows (via useWatchFormReset)
14
16
  * - Animation control (disabled during initialization)
17
+ * - Temporary animation disable during reset normalization collapse
15
18
  * - Support for flat arrays (arrays of primitives)
16
19
  *
17
20
  * Note: Automatic validation triggering on length change is disabled to prevent
@@ -27,11 +30,11 @@ const useUniformFieldArray = ({ name, flat = false, elementInitialValue: _elemen
27
30
  label
28
31
  });
29
32
  const { control } = uniformField;
30
- const { fields, append, remove, insert, move } = (0, react_hook_form.useFieldArray)({
33
+ const { fields, append, remove, insert, move, replace } = (0, react_hook_form.useFieldArray)({
31
34
  control,
32
35
  name
33
36
  });
34
- const { trigger, setValue } = require_useFormContext.useFormContext();
37
+ const { trigger, setValue, getValues } = require_useFormContext.useFormContext();
35
38
  const needsInitialize = (0, react.useMemo)(() => {
36
39
  return lastElementNotRemovable && fields.length === 0;
37
40
  }, [lastElementNotRemovable, fields.length]);
@@ -52,6 +55,22 @@ const useUniformFieldArray = ({ name, flat = false, elementInitialValue: _elemen
52
55
  const elementInitialValue = (0, react.useMemo)(() => {
53
56
  return flat ? { [require_helpers_index.flatArrayKey]: _elementInitialValue ?? null } : _elementInitialValue ?? {};
54
57
  }, [flat, _elementInitialValue]);
58
+ require_hooks_useWatchFormReset_index.useWatchFormReset({ onReset: () => {
59
+ const currentValue = getValues(name);
60
+ const valueIsArray = Array.isArray(currentValue);
61
+ const arrayValue = valueIsArray ? currentValue : [];
62
+ const normalizedLength = lastElementNotRemovable ? 1 : 0;
63
+ const alreadyNormalized = valueIsArray && arrayValue.length === normalizedLength;
64
+ if (!(!valueIsArray || arrayValue.length === 0 || arrayValue.every((entry) => {
65
+ return require_helpers_index.isValueEmpty(entry);
66
+ }))) return;
67
+ if (alreadyNormalized) return;
68
+ setDisableAnimation(true);
69
+ replace(lastElementNotRemovable ? [elementInitialValue] : []);
70
+ if (!prefersReducedMotion) setTimeout(() => {
71
+ setDisableAnimation(false);
72
+ }, 1);
73
+ } });
55
74
  (0, react.useEffect)(() => {
56
75
  if (needsInitialize) {
57
76
  setValue(name, [elementInitialValue], {
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["useUniformField","useFormContext","flatArrayKey"],"sources":["../../../src/hooks/useUniformFieldArray/useUniformFieldArray.ts","../../../src/hooks/useUniformFieldArray/index.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { ArrayPath, FieldValues, Path } from 'react-hook-form';\n\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { useFieldArray as useRHFFieldArray } from 'react-hook-form';\n\nimport { useReducedMotion } from '@fuf-stack/pixel-motion';\n\nimport { flatArrayKey } from '../../helpers';\nimport { useFormContext } from '../useFormContext';\nimport { useUniformField } from '../useUniformField';\n\nexport interface UseUniformFieldArrayProps<\n TFieldValues extends FieldValues = FieldValues,\n> {\n /** Field name for the array */\n name: ArrayPath<TFieldValues>;\n /** Whether this is a flat array (array of primitives) */\n flat?: boolean;\n /** Initial value for new array elements */\n elementInitialValue?: unknown;\n /** Whether the last element cannot be removed (always maintain at least one element) */\n lastElementNotRemovable?: boolean;\n /** Disable the field */\n disabled?: boolean;\n /** Optional explicit test id used to build stable test ids */\n testId?: string;\n /** Optional label content */\n label?: ReactNode;\n}\n\n/**\n * Enhanced useFieldArray hook with initialization and animation logic.\n * Based on React Hook Form's useFieldArray with additional features:\n * - Automatic initialization when lastElementNotRemovable is set\n * - Animation control (disabled during initialization)\n * - Support for flat arrays (arrays of primitives)\n *\n * Note: Automatic validation triggering on length change is disabled to prevent\n * triggering form-wide validation. Array validation still runs on form submission.\n *\n * @see https://react-hook-form.com/docs/usefieldarray\n */\nexport const useUniformFieldArray = <\n TFieldValues extends FieldValues = FieldValues,\n>({\n name,\n flat = false,\n elementInitialValue: _elementInitialValue = null,\n lastElementNotRemovable = false,\n disabled,\n testId: explicitTestId,\n label,\n}: UseUniformFieldArrayProps<TFieldValues>) => {\n // Get uniform field state and utilities\n const uniformField = useUniformField<TFieldValues>({\n name: name as Path<TFieldValues> & string,\n disabled,\n testId: explicitTestId,\n label,\n });\n\n const { control } = uniformField;\n\n const { fields, append, remove, insert, move } = useRHFFieldArray({\n control,\n name,\n });\n\n const { trigger, setValue } = useFormContext<TFieldValues>();\n\n // Determine if initialization is needed (initially or after reset).\n // This flag automatically handles both scenarios:\n // - Initial mount: fields.length starts at 0\n // - Form reset: fields.length becomes 0 again\n // Additional initialization conditions can be added here later (e.g., minElements > 0)\n // Using useMemo ensures this value is properly tracked by React and effects can depend on it\n const needsInitialize = useMemo(() => {\n return lastElementNotRemovable && fields.length === 0;\n }, [lastElementNotRemovable, fields.length]);\n\n // Track whether initialization has completed. Initialized contextually:\n // - If initialization IS needed (needsInitialize = true): starts as false, set to true after init\n // - If initialization is NOT needed (needsInitialize = false): starts as true (already initialized)\n // This ref is used to:\n // 1. Skip validation during initialization/re-initialization\n // 2. Gate animation enabling until after initialization\n // 3. Gate motion preference effect until after initialization\n const hasInitialized = useRef(!needsInitialize);\n\n // Reset initialization flag when needsInitialize changes to true.\n // This handles form reset: when fields become empty (needsInitialize becomes true),\n // hasInitialized is reset to false, triggering re-initialization in the effect below.\n useEffect(() => {\n if (needsInitialize) {\n hasInitialized.current = false;\n }\n }, [needsInitialize]);\n\n // Validate array-level constraints (min/max items) when length changes.\n // This ensures min/max errors appear instantly when user adds/removes items.\n // Note: Child field validation also runs, but new empty fields won't show as invalid\n // because useFormContext only sets invalid=true for touched fields or after form submission.\n // Skip validation during initialization/re-initialization to avoid showing errors prematurely.\n useEffect(() => {\n if (hasInitialized.current) {\n setTimeout(() => {\n trigger(name as Path<TFieldValues>);\n }, 200);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [fields.length]);\n\n // Animation control: Start with animations disabled to prevent animating in initial elements.\n // Will be enabled after initialization completes (unless user prefers reduced motion).\n const [disableAnimation, setDisableAnimation] = useState(true);\n\n // Respond to user's motion preference changes (after initialization).\n // During initialization, animations stay disabled regardless of preference.\n const prefersReducedMotion = useReducedMotion();\n useEffect(() => {\n if (hasInitialized.current) {\n setDisableAnimation(!!prefersReducedMotion);\n }\n }, [prefersReducedMotion]);\n\n // Prepare initial element value based on mode\n // - flat=true: arrays of primitives → object with flatArrayKey and null value by default\n // - flat=false: arrays of objects → empty object by default\n const elementInitialValue = useMemo(() => {\n return flat\n ? { [flatArrayKey]: _elementInitialValue ?? null }\n : (_elementInitialValue ?? {});\n }, [flat, _elementInitialValue]);\n\n // Initialization/Re-initialization: Add initial element when needed.\n // This handles both initial mount and form reset scenarios by reacting to needsInitialize.\n // CRITICAL: This effect MUST be the LAST hook in this component.\n // It sets hasInitialized.current = true, which acts as a gate for other effects.\n // If this runs before other effects, hasInitialized will be true during their first run,\n // causing them to execute logic meant only for post-initialization (e.g., validation,\n // animation enabling). By placing this last, all other effects run first with\n // hasInitialized = false, allowing them to skip initialization-phase logic.\n useEffect(\n () => {\n if (needsInitialize) {\n // use setValue instead of append to avoid focusing the added element\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setValue(name as Path<TFieldValues>, [elementInitialValue] as any, {\n shouldDirty: false,\n shouldTouch: false,\n });\n\n // Mark initialization as complete\n hasInitialized.current = true;\n\n // Enable animations after a brief delay (unless user prefers reduced motion or animations are already enabled).\n // This only runs on initial mount when animations start disabled.\n // On reset, disableAnimation is typically false, so this setTimeout won't run and animations stay enabled.\n if (!prefersReducedMotion && disableAnimation) {\n setTimeout(() => {\n setDisableAnimation(false);\n }, 1);\n }\n }\n },\n // Run when needsInitialize changes (initial mount or reset)\n // needsInitialize is memoized based on fields.length and lastElementNotRemovable\n // Other dependencies are intentionally omitted:\n // - append, setValue, trigger, setDisableAnimation are stable refs/functions\n // - elementInitialValue, name, flat, prefersReducedMotion, disableAnimation are props/stable values\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [needsInitialize],\n );\n\n return {\n // Field array methods and state\n fields,\n append,\n remove,\n insert,\n move,\n disableAnimation,\n elementInitialValue,\n // Uniform field state and utilities (spread all)\n ...uniformField,\n };\n};\n","/* v8 ignore start */\n\nexport * from './useUniformFieldArray';\n\n/* v8 ignore stop */\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA2CA,MAAa,wBAEX,EACA,MACA,OAAO,OACP,qBAAqB,uBAAuB,MAC5C,0BAA0B,OAC1B,UACA,QAAQ,gBACR,YAC6C;CAE7C,MAAM,eAAeA,oCAAAA,gBAA8B;EAC3C;EACN;EACA,QAAQ;EACR;CACF,CAAC;CAED,MAAM,EAAE,YAAY;CAEpB,MAAM,EAAE,QAAQ,QAAQ,QAAQ,QAAQ,UAAA,GAAA,gBAAA,eAA0B;EAChE;EACA;CACF,CAAC;CAED,MAAM,EAAE,SAAS,aAAaC,uBAAAA,eAA6B;CAQ3D,MAAM,mBAAA,GAAA,MAAA,eAAgC;EACpC,OAAO,2BAA2B,OAAO,WAAW;CACtD,GAAG,CAAC,yBAAyB,OAAO,MAAM,CAAC;CAS3C,MAAM,kBAAA,GAAA,MAAA,QAAwB,CAAC,eAAe;CAK9C,CAAA,GAAA,MAAA,iBAAgB;EACd,IAAI,iBACF,eAAe,UAAU;CAE7B,GAAG,CAAC,eAAe,CAAC;CAOpB,CAAA,GAAA,MAAA,iBAAgB;EACd,IAAI,eAAe,SACjB,iBAAiB;GACf,QAAQ,IAA0B;EACpC,GAAG,GAAG;CAGV,GAAG,CAAC,OAAO,MAAM,CAAC;CAIlB,MAAM,CAAC,kBAAkB,wBAAA,GAAA,MAAA,UAAgC,IAAI;CAI7D,MAAM,wBAAA,GAAA,wBAAA,kBAAwC;CAC9C,CAAA,GAAA,MAAA,iBAAgB;EACd,IAAI,eAAe,SACjB,oBAAoB,CAAC,CAAC,oBAAoB;CAE9C,GAAG,CAAC,oBAAoB,CAAC;CAKzB,MAAM,uBAAA,GAAA,MAAA,eAAoC;EACxC,OAAO,OACH,GAAGC,sBAAAA,eAAe,wBAAwB,KAAK,IAC9C,wBAAwB,CAAC;CAChC,GAAG,CAAC,MAAM,oBAAoB,CAAC;CAU/B,CAAA,GAAA,MAAA,iBACQ;EACJ,IAAI,iBAAiB;GAGnB,SAAS,MAA4B,CAAC,mBAAmB,GAAU;IACjE,aAAa;IACb,aAAa;GACf,CAAC;GAGD,eAAe,UAAU;GAKzB,IAAI,CAAC,wBAAwB,kBAC3B,iBAAiB;IACf,oBAAoB,KAAK;GAC3B,GAAG,CAAC;EAER;CACF,GAOA,CAAC,eAAe,CAClB;CAEA,OAAO;EAEL;EACA;EACA;EACA;EACA;EACA;EACA;EAEA,GAAG;CACL;AACF"}
1
+ {"version":3,"file":"index.cjs","names":["useUniformField","useFormContext","flatArrayKey","isValueEmpty"],"sources":["../../../src/hooks/useUniformFieldArray/useUniformFieldArray.ts","../../../src/hooks/useUniformFieldArray/index.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { ArrayPath, FieldValues, Path } from 'react-hook-form';\n\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { useFieldArray as useRHFFieldArray } from 'react-hook-form';\n\nimport { useReducedMotion } from '@fuf-stack/pixel-motion';\n\nimport { flatArrayKey, isValueEmpty } from '../../helpers';\nimport { useFormContext } from '../useFormContext';\nimport { useUniformField } from '../useUniformField';\nimport { useWatchFormReset } from '../useWatchFormReset';\n\nexport interface UseUniformFieldArrayProps<\n TFieldValues extends FieldValues = FieldValues,\n> {\n /** Field name for the array */\n name: ArrayPath<TFieldValues>;\n /** Whether this is a flat array (array of primitives) */\n flat?: boolean;\n /** Initial value for new array elements */\n elementInitialValue?: unknown;\n /** Whether the last element cannot be removed (always maintain at least one element) */\n lastElementNotRemovable?: boolean;\n /** Disable the field */\n disabled?: boolean;\n /** Optional explicit test id used to build stable test ids */\n testId?: string;\n /** Optional label content */\n label?: ReactNode;\n}\n\n/**\n * Enhanced useFieldArray hook with initialization and animation logic.\n * Based on React Hook Form's useFieldArray with additional features:\n * - Automatic initialization when lastElementNotRemovable is set\n * - Reset-only normalization for stale empty placeholder rows (via useWatchFormReset)\n * - Animation control (disabled during initialization)\n * - Temporary animation disable during reset normalization collapse\n * - Support for flat arrays (arrays of primitives)\n *\n * Note: Automatic validation triggering on length change is disabled to prevent\n * triggering form-wide validation. Array validation still runs on form submission.\n *\n * @see https://react-hook-form.com/docs/usefieldarray\n */\nexport const useUniformFieldArray = <\n TFieldValues extends FieldValues = FieldValues,\n>({\n name,\n flat = false,\n elementInitialValue: _elementInitialValue = null,\n lastElementNotRemovable = false,\n disabled,\n testId: explicitTestId,\n label,\n}: UseUniformFieldArrayProps<TFieldValues>) => {\n // Get uniform field state and utilities\n const uniformField = useUniformField<TFieldValues>({\n name: name as Path<TFieldValues> & string,\n disabled,\n testId: explicitTestId,\n label,\n });\n\n const { control } = uniformField;\n\n const { fields, append, remove, insert, move, replace } = useRHFFieldArray({\n control,\n name,\n });\n\n const { trigger, setValue, getValues } = useFormContext<TFieldValues>();\n\n // Determine if initialization is needed (initially or after reset).\n // lastElementNotRemovable is purely a minimum-count guarantee: when there are\n // no rows, add one. This handles both:\n // - Initial mount: fields.length starts at 0\n // - Form reset to an empty array: fields.length becomes 0 again\n // It intentionally does NOT inspect row contents, so manually added empty rows\n // are never collapsed.\n const needsInitialize = useMemo(() => {\n return lastElementNotRemovable && fields.length === 0;\n }, [lastElementNotRemovable, fields.length]);\n\n // Track whether initialization has completed. Initialized contextually:\n // - If initialization IS needed (needsInitialize = true): starts as false, set to true after init\n // - If initialization is NOT needed (needsInitialize = false): starts as true (already initialized)\n // This ref is used to:\n // 1. Skip validation during initialization/re-initialization\n // 2. Gate animation enabling until after initialization\n // 3. Gate motion preference effect until after initialization\n const hasInitialized = useRef(!needsInitialize);\n\n // Reset initialization flag when needsInitialize changes to true.\n // This handles form reset: when fields become empty (needsInitialize becomes true),\n // hasInitialized is reset to false, triggering re-initialization in the effect below.\n useEffect(() => {\n if (needsInitialize) {\n hasInitialized.current = false;\n }\n }, [needsInitialize]);\n\n // Validate array-level constraints (min/max items) when length changes.\n // This ensures min/max errors appear instantly when user adds/removes items.\n // Note: Child field validation also runs, but new empty fields won't show as invalid\n // because useFormContext only sets invalid=true for touched fields or after form submission.\n // Skip validation during initialization/re-initialization to avoid showing errors prematurely.\n useEffect(() => {\n if (hasInitialized.current) {\n setTimeout(() => {\n trigger(name as Path<TFieldValues>);\n }, 200);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [fields.length]);\n\n // Animation control: Start with animations disabled to prevent animating in initial elements.\n // Will be enabled after initialization completes (unless user prefers reduced motion).\n const [disableAnimation, setDisableAnimation] = useState(true);\n\n // Respond to user's motion preference changes (after initialization).\n // During initialization, animations stay disabled regardless of preference.\n const prefersReducedMotion = useReducedMotion();\n useEffect(() => {\n if (hasInitialized.current) {\n setDisableAnimation(!!prefersReducedMotion);\n }\n }, [prefersReducedMotion]);\n\n // Prepare initial element value based on mode\n // - flat=true: arrays of primitives → object with flatArrayKey and null value by default\n // - flat=false: arrays of objects → empty object by default\n const elementInitialValue = useMemo(() => {\n return flat\n ? { [flatArrayKey]: _elementInitialValue ?? null }\n : (_elementInitialValue ?? {});\n }, [flat, _elementInitialValue]);\n\n // Reset normalization:\n // Run ONLY when an actual form reset is emitted (via useWatchFormReset), not\n // on regular field edits. This does not collapse rows users add manually.\n //\n // Why this exists:\n // RHF can keep stale field-array rows after reset when array defaults are\n // missing (e.g. value becomes undefined or [null, null] while UI still has\n // multiple rows). We normalize this reset-only state to:\n // - one row when lastElementNotRemovable is enabled\n // - zero rows otherwise\n useWatchFormReset({\n onReset: () => {\n const currentValue = getValues(name as Path<TFieldValues>) as unknown;\n const valueIsArray = Array.isArray(currentValue);\n const arrayValue = valueIsArray ? (currentValue as unknown[]) : [];\n const normalizedLength = lastElementNotRemovable ? 1 : 0;\n const alreadyNormalized =\n valueIsArray && arrayValue.length === normalizedLength;\n\n // Treat these as \"effectively empty after reset\":\n // - value missing/not-array\n // - empty array\n // - array where all entries are empty placeholders\n const isEffectivelyEmptyAfterReset =\n !valueIsArray ||\n arrayValue.length === 0 ||\n arrayValue.every((entry) => {\n return isValueEmpty(entry);\n });\n\n // Nothing to fix when the reset restored real values (e.g. from defaults).\n if (!isEffectivelyEmptyAfterReset) {\n return;\n }\n\n // Already normalized to the target row count.\n if (alreadyNormalized) {\n return;\n }\n\n // Avoid collapse animation flicker during reset normalization.\n setDisableAnimation(true);\n\n // use replace so the RHF field-array length actually matches the target.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n replace((lastElementNotRemovable ? [elementInitialValue] : []) as any);\n\n // Restore normal animation state right after normalization.\n if (!prefersReducedMotion) {\n setTimeout(() => {\n setDisableAnimation(false);\n }, 1);\n }\n },\n });\n\n // Initialization/Re-initialization: add one element only when array length is 0.\n // This is the min-count behavior for lastElementNotRemovable and is intentionally\n // separate from reset normalization above.\n //\n // Reset behavior in this hook is split into two phases:\n // 1) Reset normalization (useWatchFormReset): collapse stale placeholder rows\n // left by reset edge cases.\n // 2) Length-based initialization (this effect): ensure a min-one array when\n // the field array is truly empty.\n // CRITICAL: This effect MUST be the LAST hook in this component.\n // It sets hasInitialized.current = true, which acts as a gate for other effects.\n // If this runs before other effects, hasInitialized will be true during their first run,\n // causing them to execute logic meant only for post-initialization (e.g., validation,\n // animation enabling). By placing this last, all other effects run first with\n // hasInitialized = false, allowing them to skip initialization-phase logic.\n useEffect(\n () => {\n if (needsInitialize) {\n // use setValue instead of append to avoid focusing the added element\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setValue(name as Path<TFieldValues>, [elementInitialValue] as any, {\n shouldDirty: false,\n shouldTouch: false,\n });\n\n // Mark initialization as complete\n hasInitialized.current = true;\n\n // Enable animations after a brief delay (unless user prefers reduced motion or animations are already enabled).\n // This only runs on initial mount when animations start disabled.\n // On reset, disableAnimation is typically false, so this setTimeout won't run and animations stay enabled.\n if (!prefersReducedMotion && disableAnimation) {\n setTimeout(() => {\n setDisableAnimation(false);\n }, 1);\n }\n }\n },\n // Run when needsInitialize changes (initial mount or reset)\n // needsInitialize is memoized based on fields.length and lastElementNotRemovable\n // Other dependencies are intentionally omitted:\n // - append, setValue, trigger, setDisableAnimation are stable refs/functions\n // - elementInitialValue, name, flat, prefersReducedMotion, disableAnimation are props/stable values\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [needsInitialize],\n );\n\n return {\n // Field array methods and state\n fields,\n append,\n remove,\n insert,\n move,\n disableAnimation,\n elementInitialValue,\n // Uniform field state and utilities (spread all)\n ...uniformField,\n };\n};\n","/* v8 ignore start */\n\nexport * from './useUniformFieldArray';\n\n/* v8 ignore stop */\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA8CA,MAAa,wBAEX,EACA,MACA,OAAO,OACP,qBAAqB,uBAAuB,MAC5C,0BAA0B,OAC1B,UACA,QAAQ,gBACR,YAC6C;CAE7C,MAAM,eAAeA,oCAAAA,gBAA8B;EAC3C;EACN;EACA,QAAQ;EACR;CACF,CAAC;CAED,MAAM,EAAE,YAAY;CAEpB,MAAM,EAAE,QAAQ,QAAQ,QAAQ,QAAQ,MAAM,aAAA,GAAA,gBAAA,eAA6B;EACzE;EACA;CACF,CAAC;CAED,MAAM,EAAE,SAAS,UAAU,cAAcC,uBAAAA,eAA6B;CAStE,MAAM,mBAAA,GAAA,MAAA,eAAgC;EACpC,OAAO,2BAA2B,OAAO,WAAW;CACtD,GAAG,CAAC,yBAAyB,OAAO,MAAM,CAAC;CAS3C,MAAM,kBAAA,GAAA,MAAA,QAAwB,CAAC,eAAe;CAK9C,CAAA,GAAA,MAAA,iBAAgB;EACd,IAAI,iBACF,eAAe,UAAU;CAE7B,GAAG,CAAC,eAAe,CAAC;CAOpB,CAAA,GAAA,MAAA,iBAAgB;EACd,IAAI,eAAe,SACjB,iBAAiB;GACf,QAAQ,IAA0B;EACpC,GAAG,GAAG;CAGV,GAAG,CAAC,OAAO,MAAM,CAAC;CAIlB,MAAM,CAAC,kBAAkB,wBAAA,GAAA,MAAA,UAAgC,IAAI;CAI7D,MAAM,wBAAA,GAAA,wBAAA,kBAAwC;CAC9C,CAAA,GAAA,MAAA,iBAAgB;EACd,IAAI,eAAe,SACjB,oBAAoB,CAAC,CAAC,oBAAoB;CAE9C,GAAG,CAAC,oBAAoB,CAAC;CAKzB,MAAM,uBAAA,GAAA,MAAA,eAAoC;EACxC,OAAO,OACH,GAAGC,sBAAAA,eAAe,wBAAwB,KAAK,IAC9C,wBAAwB,CAAC;CAChC,GAAG,CAAC,MAAM,oBAAoB,CAAC;CAY/B,sCAAA,kBAAkB,EAChB,eAAe;EACb,MAAM,eAAe,UAAU,IAA0B;EACzD,MAAM,eAAe,MAAM,QAAQ,YAAY;EAC/C,MAAM,aAAa,eAAgB,eAA6B,CAAC;EACjE,MAAM,mBAAmB,0BAA0B,IAAI;EACvD,MAAM,oBACJ,gBAAgB,WAAW,WAAW;EAcxC,IAAI,EAPF,CAAC,gBACD,WAAW,WAAW,KACtB,WAAW,OAAO,UAAU;GAC1B,OAAOC,sBAAAA,aAAa,KAAK;EAC3B,CAAC,IAID;EAIF,IAAI,mBACF;EAIF,oBAAoB,IAAI;EAIxB,QAAS,0BAA0B,CAAC,mBAAmB,IAAI,CAAC,CAAS;EAGrE,IAAI,CAAC,sBACH,iBAAiB;GACf,oBAAoB,KAAK;EAC3B,GAAG,CAAC;CAER,EACF,CAAC;CAiBD,CAAA,GAAA,MAAA,iBACQ;EACJ,IAAI,iBAAiB;GAGnB,SAAS,MAA4B,CAAC,mBAAmB,GAAU;IACjE,aAAa;IACb,aAAa;GACf,CAAC;GAGD,eAAe,UAAU;GAKzB,IAAI,CAAC,wBAAwB,kBAC3B,iBAAiB;IACf,oBAAoB,KAAK;GAC3B,GAAG,CAAC;EAER;CACF,GAOA,CAAC,eAAe,CAClB;CAEA,OAAO;EAEL;EACA;EACA;EACA;EACA;EACA;EACA;EAEA,GAAG;CACL;AACF"}
@@ -1,2 +1,2 @@
1
- import { n as useUniformFieldArray, t as UseUniformFieldArrayProps } from "../../useUniformFieldArray-CuZB9JPM.cjs";
1
+ import { n as useUniformFieldArray, t as UseUniformFieldArrayProps } from "../../useUniformFieldArray-D3fdzwzD.cjs";
2
2
  export { UseUniformFieldArrayProps, useUniformFieldArray };
@@ -1,2 +1,2 @@
1
- import { n as useUniformFieldArray, t as UseUniformFieldArrayProps } from "../../useUniformFieldArray-CzUfdsFB.js";
1
+ import { n as useUniformFieldArray, t as UseUniformFieldArrayProps } from "../../useUniformFieldArray-zGcIhwhF.js";
2
2
  export { UseUniformFieldArrayProps, useUniformFieldArray };
@@ -1,6 +1,7 @@
1
- import { flatArrayKey } from "../../helpers/index.js";
2
- import { n as useFormContext$1 } from "../../useFormContext-DJ-9hs8X.js";
1
+ import { flatArrayKey, isValueEmpty } from "../../helpers/index.js";
2
+ import { n as useFormContext$1 } from "../../useFormContext-CT8H8xIe.js";
3
3
  import { useUniformField } from "../useUniformField/index.js";
4
+ import { useWatchFormReset } from "../useWatchFormReset/index.js";
4
5
  import { useEffect, useMemo, useRef, useState } from "react";
5
6
  import { useReducedMotion } from "@fuf-stack/pixel-motion";
6
7
  import { useFieldArray } from "react-hook-form";
@@ -9,7 +10,9 @@ import { useFieldArray } from "react-hook-form";
9
10
  * Enhanced useFieldArray hook with initialization and animation logic.
10
11
  * Based on React Hook Form's useFieldArray with additional features:
11
12
  * - Automatic initialization when lastElementNotRemovable is set
13
+ * - Reset-only normalization for stale empty placeholder rows (via useWatchFormReset)
12
14
  * - Animation control (disabled during initialization)
15
+ * - Temporary animation disable during reset normalization collapse
13
16
  * - Support for flat arrays (arrays of primitives)
14
17
  *
15
18
  * Note: Automatic validation triggering on length change is disabled to prevent
@@ -25,11 +28,11 @@ const useUniformFieldArray = ({ name, flat = false, elementInitialValue: _elemen
25
28
  label
26
29
  });
27
30
  const { control } = uniformField;
28
- const { fields, append, remove, insert, move } = useFieldArray({
31
+ const { fields, append, remove, insert, move, replace } = useFieldArray({
29
32
  control,
30
33
  name
31
34
  });
32
- const { trigger, setValue } = useFormContext$1();
35
+ const { trigger, setValue, getValues } = useFormContext$1();
33
36
  const needsInitialize = useMemo(() => {
34
37
  return lastElementNotRemovable && fields.length === 0;
35
38
  }, [lastElementNotRemovable, fields.length]);
@@ -50,6 +53,22 @@ const useUniformFieldArray = ({ name, flat = false, elementInitialValue: _elemen
50
53
  const elementInitialValue = useMemo(() => {
51
54
  return flat ? { [flatArrayKey]: _elementInitialValue ?? null } : _elementInitialValue ?? {};
52
55
  }, [flat, _elementInitialValue]);
56
+ useWatchFormReset({ onReset: () => {
57
+ const currentValue = getValues(name);
58
+ const valueIsArray = Array.isArray(currentValue);
59
+ const arrayValue = valueIsArray ? currentValue : [];
60
+ const normalizedLength = lastElementNotRemovable ? 1 : 0;
61
+ const alreadyNormalized = valueIsArray && arrayValue.length === normalizedLength;
62
+ if (!(!valueIsArray || arrayValue.length === 0 || arrayValue.every((entry) => {
63
+ return isValueEmpty(entry);
64
+ }))) return;
65
+ if (alreadyNormalized) return;
66
+ setDisableAnimation(true);
67
+ replace(lastElementNotRemovable ? [elementInitialValue] : []);
68
+ if (!prefersReducedMotion) setTimeout(() => {
69
+ setDisableAnimation(false);
70
+ }, 1);
71
+ } });
53
72
  useEffect(() => {
54
73
  if (needsInitialize) {
55
74
  setValue(name, [elementInitialValue], {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["useRHFFieldArray","useFormContext"],"sources":["../../../src/hooks/useUniformFieldArray/useUniformFieldArray.ts","../../../src/hooks/useUniformFieldArray/index.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { ArrayPath, FieldValues, Path } from 'react-hook-form';\n\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { useFieldArray as useRHFFieldArray } from 'react-hook-form';\n\nimport { useReducedMotion } from '@fuf-stack/pixel-motion';\n\nimport { flatArrayKey } from '../../helpers';\nimport { useFormContext } from '../useFormContext';\nimport { useUniformField } from '../useUniformField';\n\nexport interface UseUniformFieldArrayProps<\n TFieldValues extends FieldValues = FieldValues,\n> {\n /** Field name for the array */\n name: ArrayPath<TFieldValues>;\n /** Whether this is a flat array (array of primitives) */\n flat?: boolean;\n /** Initial value for new array elements */\n elementInitialValue?: unknown;\n /** Whether the last element cannot be removed (always maintain at least one element) */\n lastElementNotRemovable?: boolean;\n /** Disable the field */\n disabled?: boolean;\n /** Optional explicit test id used to build stable test ids */\n testId?: string;\n /** Optional label content */\n label?: ReactNode;\n}\n\n/**\n * Enhanced useFieldArray hook with initialization and animation logic.\n * Based on React Hook Form's useFieldArray with additional features:\n * - Automatic initialization when lastElementNotRemovable is set\n * - Animation control (disabled during initialization)\n * - Support for flat arrays (arrays of primitives)\n *\n * Note: Automatic validation triggering on length change is disabled to prevent\n * triggering form-wide validation. Array validation still runs on form submission.\n *\n * @see https://react-hook-form.com/docs/usefieldarray\n */\nexport const useUniformFieldArray = <\n TFieldValues extends FieldValues = FieldValues,\n>({\n name,\n flat = false,\n elementInitialValue: _elementInitialValue = null,\n lastElementNotRemovable = false,\n disabled,\n testId: explicitTestId,\n label,\n}: UseUniformFieldArrayProps<TFieldValues>) => {\n // Get uniform field state and utilities\n const uniformField = useUniformField<TFieldValues>({\n name: name as Path<TFieldValues> & string,\n disabled,\n testId: explicitTestId,\n label,\n });\n\n const { control } = uniformField;\n\n const { fields, append, remove, insert, move } = useRHFFieldArray({\n control,\n name,\n });\n\n const { trigger, setValue } = useFormContext<TFieldValues>();\n\n // Determine if initialization is needed (initially or after reset).\n // This flag automatically handles both scenarios:\n // - Initial mount: fields.length starts at 0\n // - Form reset: fields.length becomes 0 again\n // Additional initialization conditions can be added here later (e.g., minElements > 0)\n // Using useMemo ensures this value is properly tracked by React and effects can depend on it\n const needsInitialize = useMemo(() => {\n return lastElementNotRemovable && fields.length === 0;\n }, [lastElementNotRemovable, fields.length]);\n\n // Track whether initialization has completed. Initialized contextually:\n // - If initialization IS needed (needsInitialize = true): starts as false, set to true after init\n // - If initialization is NOT needed (needsInitialize = false): starts as true (already initialized)\n // This ref is used to:\n // 1. Skip validation during initialization/re-initialization\n // 2. Gate animation enabling until after initialization\n // 3. Gate motion preference effect until after initialization\n const hasInitialized = useRef(!needsInitialize);\n\n // Reset initialization flag when needsInitialize changes to true.\n // This handles form reset: when fields become empty (needsInitialize becomes true),\n // hasInitialized is reset to false, triggering re-initialization in the effect below.\n useEffect(() => {\n if (needsInitialize) {\n hasInitialized.current = false;\n }\n }, [needsInitialize]);\n\n // Validate array-level constraints (min/max items) when length changes.\n // This ensures min/max errors appear instantly when user adds/removes items.\n // Note: Child field validation also runs, but new empty fields won't show as invalid\n // because useFormContext only sets invalid=true for touched fields or after form submission.\n // Skip validation during initialization/re-initialization to avoid showing errors prematurely.\n useEffect(() => {\n if (hasInitialized.current) {\n setTimeout(() => {\n trigger(name as Path<TFieldValues>);\n }, 200);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [fields.length]);\n\n // Animation control: Start with animations disabled to prevent animating in initial elements.\n // Will be enabled after initialization completes (unless user prefers reduced motion).\n const [disableAnimation, setDisableAnimation] = useState(true);\n\n // Respond to user's motion preference changes (after initialization).\n // During initialization, animations stay disabled regardless of preference.\n const prefersReducedMotion = useReducedMotion();\n useEffect(() => {\n if (hasInitialized.current) {\n setDisableAnimation(!!prefersReducedMotion);\n }\n }, [prefersReducedMotion]);\n\n // Prepare initial element value based on mode\n // - flat=true: arrays of primitives → object with flatArrayKey and null value by default\n // - flat=false: arrays of objects → empty object by default\n const elementInitialValue = useMemo(() => {\n return flat\n ? { [flatArrayKey]: _elementInitialValue ?? null }\n : (_elementInitialValue ?? {});\n }, [flat, _elementInitialValue]);\n\n // Initialization/Re-initialization: Add initial element when needed.\n // This handles both initial mount and form reset scenarios by reacting to needsInitialize.\n // CRITICAL: This effect MUST be the LAST hook in this component.\n // It sets hasInitialized.current = true, which acts as a gate for other effects.\n // If this runs before other effects, hasInitialized will be true during their first run,\n // causing them to execute logic meant only for post-initialization (e.g., validation,\n // animation enabling). By placing this last, all other effects run first with\n // hasInitialized = false, allowing them to skip initialization-phase logic.\n useEffect(\n () => {\n if (needsInitialize) {\n // use setValue instead of append to avoid focusing the added element\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setValue(name as Path<TFieldValues>, [elementInitialValue] as any, {\n shouldDirty: false,\n shouldTouch: false,\n });\n\n // Mark initialization as complete\n hasInitialized.current = true;\n\n // Enable animations after a brief delay (unless user prefers reduced motion or animations are already enabled).\n // This only runs on initial mount when animations start disabled.\n // On reset, disableAnimation is typically false, so this setTimeout won't run and animations stay enabled.\n if (!prefersReducedMotion && disableAnimation) {\n setTimeout(() => {\n setDisableAnimation(false);\n }, 1);\n }\n }\n },\n // Run when needsInitialize changes (initial mount or reset)\n // needsInitialize is memoized based on fields.length and lastElementNotRemovable\n // Other dependencies are intentionally omitted:\n // - append, setValue, trigger, setDisableAnimation are stable refs/functions\n // - elementInitialValue, name, flat, prefersReducedMotion, disableAnimation are props/stable values\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [needsInitialize],\n );\n\n return {\n // Field array methods and state\n fields,\n append,\n remove,\n insert,\n move,\n disableAnimation,\n elementInitialValue,\n // Uniform field state and utilities (spread all)\n ...uniformField,\n };\n};\n","/* v8 ignore start */\n\nexport * from './useUniformFieldArray';\n\n/* v8 ignore stop */\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA2CA,MAAa,wBAEX,EACA,MACA,OAAO,OACP,qBAAqB,uBAAuB,MAC5C,0BAA0B,OAC1B,UACA,QAAQ,gBACR,YAC6C;CAE7C,MAAM,eAAe,gBAA8B;EAC3C;EACN;EACA,QAAQ;EACR;CACF,CAAC;CAED,MAAM,EAAE,YAAY;CAEpB,MAAM,EAAE,QAAQ,QAAQ,QAAQ,QAAQ,SAASA,cAAiB;EAChE;EACA;CACF,CAAC;CAED,MAAM,EAAE,SAAS,aAAaC,iBAA6B;CAQ3D,MAAM,kBAAkB,cAAc;EACpC,OAAO,2BAA2B,OAAO,WAAW;CACtD,GAAG,CAAC,yBAAyB,OAAO,MAAM,CAAC;CAS3C,MAAM,iBAAiB,OAAO,CAAC,eAAe;CAK9C,gBAAgB;EACd,IAAI,iBACF,eAAe,UAAU;CAE7B,GAAG,CAAC,eAAe,CAAC;CAOpB,gBAAgB;EACd,IAAI,eAAe,SACjB,iBAAiB;GACf,QAAQ,IAA0B;EACpC,GAAG,GAAG;CAGV,GAAG,CAAC,OAAO,MAAM,CAAC;CAIlB,MAAM,CAAC,kBAAkB,uBAAuB,SAAS,IAAI;CAI7D,MAAM,uBAAuB,iBAAiB;CAC9C,gBAAgB;EACd,IAAI,eAAe,SACjB,oBAAoB,CAAC,CAAC,oBAAoB;CAE9C,GAAG,CAAC,oBAAoB,CAAC;CAKzB,MAAM,sBAAsB,cAAc;EACxC,OAAO,OACH,GAAG,eAAe,wBAAwB,KAAK,IAC9C,wBAAwB,CAAC;CAChC,GAAG,CAAC,MAAM,oBAAoB,CAAC;CAU/B,gBACQ;EACJ,IAAI,iBAAiB;GAGnB,SAAS,MAA4B,CAAC,mBAAmB,GAAU;IACjE,aAAa;IACb,aAAa;GACf,CAAC;GAGD,eAAe,UAAU;GAKzB,IAAI,CAAC,wBAAwB,kBAC3B,iBAAiB;IACf,oBAAoB,KAAK;GAC3B,GAAG,CAAC;EAER;CACF,GAOA,CAAC,eAAe,CAClB;CAEA,OAAO;EAEL;EACA;EACA;EACA;EACA;EACA;EACA;EAEA,GAAG;CACL;AACF"}
1
+ {"version":3,"file":"index.js","names":["useRHFFieldArray","useFormContext"],"sources":["../../../src/hooks/useUniformFieldArray/useUniformFieldArray.ts","../../../src/hooks/useUniformFieldArray/index.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { ArrayPath, FieldValues, Path } from 'react-hook-form';\n\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { useFieldArray as useRHFFieldArray } from 'react-hook-form';\n\nimport { useReducedMotion } from '@fuf-stack/pixel-motion';\n\nimport { flatArrayKey, isValueEmpty } from '../../helpers';\nimport { useFormContext } from '../useFormContext';\nimport { useUniformField } from '../useUniformField';\nimport { useWatchFormReset } from '../useWatchFormReset';\n\nexport interface UseUniformFieldArrayProps<\n TFieldValues extends FieldValues = FieldValues,\n> {\n /** Field name for the array */\n name: ArrayPath<TFieldValues>;\n /** Whether this is a flat array (array of primitives) */\n flat?: boolean;\n /** Initial value for new array elements */\n elementInitialValue?: unknown;\n /** Whether the last element cannot be removed (always maintain at least one element) */\n lastElementNotRemovable?: boolean;\n /** Disable the field */\n disabled?: boolean;\n /** Optional explicit test id used to build stable test ids */\n testId?: string;\n /** Optional label content */\n label?: ReactNode;\n}\n\n/**\n * Enhanced useFieldArray hook with initialization and animation logic.\n * Based on React Hook Form's useFieldArray with additional features:\n * - Automatic initialization when lastElementNotRemovable is set\n * - Reset-only normalization for stale empty placeholder rows (via useWatchFormReset)\n * - Animation control (disabled during initialization)\n * - Temporary animation disable during reset normalization collapse\n * - Support for flat arrays (arrays of primitives)\n *\n * Note: Automatic validation triggering on length change is disabled to prevent\n * triggering form-wide validation. Array validation still runs on form submission.\n *\n * @see https://react-hook-form.com/docs/usefieldarray\n */\nexport const useUniformFieldArray = <\n TFieldValues extends FieldValues = FieldValues,\n>({\n name,\n flat = false,\n elementInitialValue: _elementInitialValue = null,\n lastElementNotRemovable = false,\n disabled,\n testId: explicitTestId,\n label,\n}: UseUniformFieldArrayProps<TFieldValues>) => {\n // Get uniform field state and utilities\n const uniformField = useUniformField<TFieldValues>({\n name: name as Path<TFieldValues> & string,\n disabled,\n testId: explicitTestId,\n label,\n });\n\n const { control } = uniformField;\n\n const { fields, append, remove, insert, move, replace } = useRHFFieldArray({\n control,\n name,\n });\n\n const { trigger, setValue, getValues } = useFormContext<TFieldValues>();\n\n // Determine if initialization is needed (initially or after reset).\n // lastElementNotRemovable is purely a minimum-count guarantee: when there are\n // no rows, add one. This handles both:\n // - Initial mount: fields.length starts at 0\n // - Form reset to an empty array: fields.length becomes 0 again\n // It intentionally does NOT inspect row contents, so manually added empty rows\n // are never collapsed.\n const needsInitialize = useMemo(() => {\n return lastElementNotRemovable && fields.length === 0;\n }, [lastElementNotRemovable, fields.length]);\n\n // Track whether initialization has completed. Initialized contextually:\n // - If initialization IS needed (needsInitialize = true): starts as false, set to true after init\n // - If initialization is NOT needed (needsInitialize = false): starts as true (already initialized)\n // This ref is used to:\n // 1. Skip validation during initialization/re-initialization\n // 2. Gate animation enabling until after initialization\n // 3. Gate motion preference effect until after initialization\n const hasInitialized = useRef(!needsInitialize);\n\n // Reset initialization flag when needsInitialize changes to true.\n // This handles form reset: when fields become empty (needsInitialize becomes true),\n // hasInitialized is reset to false, triggering re-initialization in the effect below.\n useEffect(() => {\n if (needsInitialize) {\n hasInitialized.current = false;\n }\n }, [needsInitialize]);\n\n // Validate array-level constraints (min/max items) when length changes.\n // This ensures min/max errors appear instantly when user adds/removes items.\n // Note: Child field validation also runs, but new empty fields won't show as invalid\n // because useFormContext only sets invalid=true for touched fields or after form submission.\n // Skip validation during initialization/re-initialization to avoid showing errors prematurely.\n useEffect(() => {\n if (hasInitialized.current) {\n setTimeout(() => {\n trigger(name as Path<TFieldValues>);\n }, 200);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [fields.length]);\n\n // Animation control: Start with animations disabled to prevent animating in initial elements.\n // Will be enabled after initialization completes (unless user prefers reduced motion).\n const [disableAnimation, setDisableAnimation] = useState(true);\n\n // Respond to user's motion preference changes (after initialization).\n // During initialization, animations stay disabled regardless of preference.\n const prefersReducedMotion = useReducedMotion();\n useEffect(() => {\n if (hasInitialized.current) {\n setDisableAnimation(!!prefersReducedMotion);\n }\n }, [prefersReducedMotion]);\n\n // Prepare initial element value based on mode\n // - flat=true: arrays of primitives → object with flatArrayKey and null value by default\n // - flat=false: arrays of objects → empty object by default\n const elementInitialValue = useMemo(() => {\n return flat\n ? { [flatArrayKey]: _elementInitialValue ?? null }\n : (_elementInitialValue ?? {});\n }, [flat, _elementInitialValue]);\n\n // Reset normalization:\n // Run ONLY when an actual form reset is emitted (via useWatchFormReset), not\n // on regular field edits. This does not collapse rows users add manually.\n //\n // Why this exists:\n // RHF can keep stale field-array rows after reset when array defaults are\n // missing (e.g. value becomes undefined or [null, null] while UI still has\n // multiple rows). We normalize this reset-only state to:\n // - one row when lastElementNotRemovable is enabled\n // - zero rows otherwise\n useWatchFormReset({\n onReset: () => {\n const currentValue = getValues(name as Path<TFieldValues>) as unknown;\n const valueIsArray = Array.isArray(currentValue);\n const arrayValue = valueIsArray ? (currentValue as unknown[]) : [];\n const normalizedLength = lastElementNotRemovable ? 1 : 0;\n const alreadyNormalized =\n valueIsArray && arrayValue.length === normalizedLength;\n\n // Treat these as \"effectively empty after reset\":\n // - value missing/not-array\n // - empty array\n // - array where all entries are empty placeholders\n const isEffectivelyEmptyAfterReset =\n !valueIsArray ||\n arrayValue.length === 0 ||\n arrayValue.every((entry) => {\n return isValueEmpty(entry);\n });\n\n // Nothing to fix when the reset restored real values (e.g. from defaults).\n if (!isEffectivelyEmptyAfterReset) {\n return;\n }\n\n // Already normalized to the target row count.\n if (alreadyNormalized) {\n return;\n }\n\n // Avoid collapse animation flicker during reset normalization.\n setDisableAnimation(true);\n\n // use replace so the RHF field-array length actually matches the target.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n replace((lastElementNotRemovable ? [elementInitialValue] : []) as any);\n\n // Restore normal animation state right after normalization.\n if (!prefersReducedMotion) {\n setTimeout(() => {\n setDisableAnimation(false);\n }, 1);\n }\n },\n });\n\n // Initialization/Re-initialization: add one element only when array length is 0.\n // This is the min-count behavior for lastElementNotRemovable and is intentionally\n // separate from reset normalization above.\n //\n // Reset behavior in this hook is split into two phases:\n // 1) Reset normalization (useWatchFormReset): collapse stale placeholder rows\n // left by reset edge cases.\n // 2) Length-based initialization (this effect): ensure a min-one array when\n // the field array is truly empty.\n // CRITICAL: This effect MUST be the LAST hook in this component.\n // It sets hasInitialized.current = true, which acts as a gate for other effects.\n // If this runs before other effects, hasInitialized will be true during their first run,\n // causing them to execute logic meant only for post-initialization (e.g., validation,\n // animation enabling). By placing this last, all other effects run first with\n // hasInitialized = false, allowing them to skip initialization-phase logic.\n useEffect(\n () => {\n if (needsInitialize) {\n // use setValue instead of append to avoid focusing the added element\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setValue(name as Path<TFieldValues>, [elementInitialValue] as any, {\n shouldDirty: false,\n shouldTouch: false,\n });\n\n // Mark initialization as complete\n hasInitialized.current = true;\n\n // Enable animations after a brief delay (unless user prefers reduced motion or animations are already enabled).\n // This only runs on initial mount when animations start disabled.\n // On reset, disableAnimation is typically false, so this setTimeout won't run and animations stay enabled.\n if (!prefersReducedMotion && disableAnimation) {\n setTimeout(() => {\n setDisableAnimation(false);\n }, 1);\n }\n }\n },\n // Run when needsInitialize changes (initial mount or reset)\n // needsInitialize is memoized based on fields.length and lastElementNotRemovable\n // Other dependencies are intentionally omitted:\n // - append, setValue, trigger, setDisableAnimation are stable refs/functions\n // - elementInitialValue, name, flat, prefersReducedMotion, disableAnimation are props/stable values\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [needsInitialize],\n );\n\n return {\n // Field array methods and state\n fields,\n append,\n remove,\n insert,\n move,\n disableAnimation,\n elementInitialValue,\n // Uniform field state and utilities (spread all)\n ...uniformField,\n };\n};\n","/* v8 ignore start */\n\nexport * from './useUniformFieldArray';\n\n/* v8 ignore stop */\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA8CA,MAAa,wBAEX,EACA,MACA,OAAO,OACP,qBAAqB,uBAAuB,MAC5C,0BAA0B,OAC1B,UACA,QAAQ,gBACR,YAC6C;CAE7C,MAAM,eAAe,gBAA8B;EAC3C;EACN;EACA,QAAQ;EACR;CACF,CAAC;CAED,MAAM,EAAE,YAAY;CAEpB,MAAM,EAAE,QAAQ,QAAQ,QAAQ,QAAQ,MAAM,YAAYA,cAAiB;EACzE;EACA;CACF,CAAC;CAED,MAAM,EAAE,SAAS,UAAU,cAAcC,iBAA6B;CAStE,MAAM,kBAAkB,cAAc;EACpC,OAAO,2BAA2B,OAAO,WAAW;CACtD,GAAG,CAAC,yBAAyB,OAAO,MAAM,CAAC;CAS3C,MAAM,iBAAiB,OAAO,CAAC,eAAe;CAK9C,gBAAgB;EACd,IAAI,iBACF,eAAe,UAAU;CAE7B,GAAG,CAAC,eAAe,CAAC;CAOpB,gBAAgB;EACd,IAAI,eAAe,SACjB,iBAAiB;GACf,QAAQ,IAA0B;EACpC,GAAG,GAAG;CAGV,GAAG,CAAC,OAAO,MAAM,CAAC;CAIlB,MAAM,CAAC,kBAAkB,uBAAuB,SAAS,IAAI;CAI7D,MAAM,uBAAuB,iBAAiB;CAC9C,gBAAgB;EACd,IAAI,eAAe,SACjB,oBAAoB,CAAC,CAAC,oBAAoB;CAE9C,GAAG,CAAC,oBAAoB,CAAC;CAKzB,MAAM,sBAAsB,cAAc;EACxC,OAAO,OACH,GAAG,eAAe,wBAAwB,KAAK,IAC9C,wBAAwB,CAAC;CAChC,GAAG,CAAC,MAAM,oBAAoB,CAAC;CAY/B,kBAAkB,EAChB,eAAe;EACb,MAAM,eAAe,UAAU,IAA0B;EACzD,MAAM,eAAe,MAAM,QAAQ,YAAY;EAC/C,MAAM,aAAa,eAAgB,eAA6B,CAAC;EACjE,MAAM,mBAAmB,0BAA0B,IAAI;EACvD,MAAM,oBACJ,gBAAgB,WAAW,WAAW;EAcxC,IAAI,EAPF,CAAC,gBACD,WAAW,WAAW,KACtB,WAAW,OAAO,UAAU;GAC1B,OAAO,aAAa,KAAK;EAC3B,CAAC,IAID;EAIF,IAAI,mBACF;EAIF,oBAAoB,IAAI;EAIxB,QAAS,0BAA0B,CAAC,mBAAmB,IAAI,CAAC,CAAS;EAGrE,IAAI,CAAC,sBACH,iBAAiB;GACf,oBAAoB,KAAK;EAC3B,GAAG,CAAC;CAER,EACF,CAAC;CAiBD,gBACQ;EACJ,IAAI,iBAAiB;GAGnB,SAAS,MAA4B,CAAC,mBAAmB,GAAU;IACjE,aAAa;IACb,aAAa;GACf,CAAC;GAGD,eAAe,UAAU;GAKzB,IAAI,CAAC,wBAAwB,kBAC3B,iBAAiB;IACf,oBAAoB,KAAK;GAC3B,GAAG,CAAC;EAER;CACF,GAOA,CAAC,eAAe,CAClB;CAEA,OAAO;EAEL;EACA;EACA;EACA;EACA;EACA;EACA;EAEA,GAAG;CACL;AACF"}
@@ -0,0 +1,39 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ require("../../FormContext-DsmS_mkO.cjs");
3
+ const require_useFormContext = require("../../useFormContext-CrXwNYiB.cjs");
4
+ let react = require("react");
5
+ //#region src/hooks/useWatchFormReset/useWatchFormReset.ts
6
+ /**
7
+ * Hook that watches for programmatic form reset events.
8
+ *
9
+ * It lets consumers run a callback when a programmatic form reset is triggered
10
+ * through the wrapped `reset()` from `useFormContext`.
11
+ *
12
+ * Why this exists:
13
+ * - Components should not infer "a reset happened" from field values alone.
14
+ * Value-based heuristics can conflict with valid user interactions.
15
+ * - This hook provides an explicit reset signal so components can run
16
+ * reset-only logic safely.
17
+ *
18
+ * Current usage:
19
+ * - `useUniformFieldArray` uses this hook to handle resets when no default
20
+ * array value was provided. In that case, RHF can leave stale empty
21
+ * placeholder rows. It normalizes only on reset and does not collapse rows
22
+ * during normal editing.
23
+ */
24
+ const useWatchFormReset = ({ onReset }) => {
25
+ const { formReset } = require_useFormContext.useFormContext();
26
+ (0, react.useEffect)(() => {
27
+ const listener = () => {
28
+ onReset();
29
+ };
30
+ return formReset.subscribe(listener);
31
+ }, [formReset, onReset]);
32
+ };
33
+ //#endregion
34
+ //#region src/hooks/useWatchFormReset/index.ts
35
+ /* v8 ignore stop */
36
+ //#endregion
37
+ exports.useWatchFormReset = useWatchFormReset;
38
+
39
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":["useFormContext"],"sources":["../../../src/hooks/useWatchFormReset/useWatchFormReset.ts","../../../src/hooks/useWatchFormReset/index.ts"],"sourcesContent":["import { useEffect } from 'react';\n\nimport { useFormContext } from '../useFormContext/useFormContext';\n\nexport interface UseWatchFormResetOptions {\n /**\n * Callback that runs whenever a programmatic form reset is observed.\n *\n * Resets are signalled via the uniform `formReset` pub/sub channel. The event\n * is emitted by the wrapped `reset()` method in `useFormContext`.\n *\n * Current primary use case:\n * - `useUniformFieldArray` listens for reset events to normalize stale\n * placeholder rows left by RHF after reset when array defaults are missing.\n */\n onReset: () => void;\n}\n\n/**\n * Hook that watches for programmatic form reset events.\n *\n * It lets consumers run a callback when a programmatic form reset is triggered\n * through the wrapped `reset()` from `useFormContext`.\n *\n * Why this exists:\n * - Components should not infer \"a reset happened\" from field values alone.\n * Value-based heuristics can conflict with valid user interactions.\n * - This hook provides an explicit reset signal so components can run\n * reset-only logic safely.\n *\n * Current usage:\n * - `useUniformFieldArray` uses this hook to handle resets when no default\n * array value was provided. In that case, RHF can leave stale empty\n * placeholder rows. It normalizes only on reset and does not collapse rows\n * during normal editing.\n */\nexport const useWatchFormReset = ({ onReset }: UseWatchFormResetOptions) => {\n const { formReset } = useFormContext();\n\n useEffect(() => {\n const listener = () => {\n onReset();\n };\n\n const unsubscribe = formReset.subscribe(listener);\n return unsubscribe;\n }, [formReset, onReset]);\n};\n","/* v8 ignore start */\n\nexport * from './useWatchFormReset';\n\n/* v8 ignore stop */\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAa,qBAAqB,EAAE,cAAwC;CAC1E,MAAM,EAAE,cAAcA,uBAAAA,eAAe;CAErC,CAAA,GAAA,MAAA,iBAAgB;EACd,MAAM,iBAAiB;GACrB,QAAQ;EACV;EAGA,OADoB,UAAU,UAAU,QACvB;CACnB,GAAG,CAAC,WAAW,OAAO,CAAC;AACzB"}
@@ -0,0 +1,2 @@
1
+ import { n as useWatchFormReset, t as UseWatchFormResetOptions } from "../../useWatchFormReset-BSd6jMxU.cjs";
2
+ export { UseWatchFormResetOptions, useWatchFormReset };
@@ -0,0 +1,2 @@
1
+ import { n as useWatchFormReset, t as UseWatchFormResetOptions } from "../../useWatchFormReset-C7YJ-I3N.js";
2
+ export { UseWatchFormResetOptions, useWatchFormReset };
@@ -0,0 +1,37 @@
1
+ import { n as useFormContext } from "../../useFormContext-CT8H8xIe.js";
2
+ import { useEffect } from "react";
3
+ //#region src/hooks/useWatchFormReset/useWatchFormReset.ts
4
+ /**
5
+ * Hook that watches for programmatic form reset events.
6
+ *
7
+ * It lets consumers run a callback when a programmatic form reset is triggered
8
+ * through the wrapped `reset()` from `useFormContext`.
9
+ *
10
+ * Why this exists:
11
+ * - Components should not infer "a reset happened" from field values alone.
12
+ * Value-based heuristics can conflict with valid user interactions.
13
+ * - This hook provides an explicit reset signal so components can run
14
+ * reset-only logic safely.
15
+ *
16
+ * Current usage:
17
+ * - `useUniformFieldArray` uses this hook to handle resets when no default
18
+ * array value was provided. In that case, RHF can leave stale empty
19
+ * placeholder rows. It normalizes only on reset and does not collapse rows
20
+ * during normal editing.
21
+ */
22
+ const useWatchFormReset = ({ onReset }) => {
23
+ const { formReset } = useFormContext();
24
+ useEffect(() => {
25
+ const listener = () => {
26
+ onReset();
27
+ };
28
+ return formReset.subscribe(listener);
29
+ }, [formReset, onReset]);
30
+ };
31
+ //#endregion
32
+ //#region src/hooks/useWatchFormReset/index.ts
33
+ /* v8 ignore stop */
34
+ //#endregion
35
+ export { useWatchFormReset };
36
+
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/hooks/useWatchFormReset/useWatchFormReset.ts","../../../src/hooks/useWatchFormReset/index.ts"],"sourcesContent":["import { useEffect } from 'react';\n\nimport { useFormContext } from '../useFormContext/useFormContext';\n\nexport interface UseWatchFormResetOptions {\n /**\n * Callback that runs whenever a programmatic form reset is observed.\n *\n * Resets are signalled via the uniform `formReset` pub/sub channel. The event\n * is emitted by the wrapped `reset()` method in `useFormContext`.\n *\n * Current primary use case:\n * - `useUniformFieldArray` listens for reset events to normalize stale\n * placeholder rows left by RHF after reset when array defaults are missing.\n */\n onReset: () => void;\n}\n\n/**\n * Hook that watches for programmatic form reset events.\n *\n * It lets consumers run a callback when a programmatic form reset is triggered\n * through the wrapped `reset()` from `useFormContext`.\n *\n * Why this exists:\n * - Components should not infer \"a reset happened\" from field values alone.\n * Value-based heuristics can conflict with valid user interactions.\n * - This hook provides an explicit reset signal so components can run\n * reset-only logic safely.\n *\n * Current usage:\n * - `useUniformFieldArray` uses this hook to handle resets when no default\n * array value was provided. In that case, RHF can leave stale empty\n * placeholder rows. It normalizes only on reset and does not collapse rows\n * during normal editing.\n */\nexport const useWatchFormReset = ({ onReset }: UseWatchFormResetOptions) => {\n const { formReset } = useFormContext();\n\n useEffect(() => {\n const listener = () => {\n onReset();\n };\n\n const unsubscribe = formReset.subscribe(listener);\n return unsubscribe;\n }, [formReset, onReset]);\n};\n","/* v8 ignore start */\n\nexport * from './useWatchFormReset';\n\n/* v8 ignore stop */\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoCA,MAAa,qBAAqB,EAAE,cAAwC;CAC1E,MAAM,EAAE,cAAc,eAAe;CAErC,gBAAgB;EACd,MAAM,iBAAiB;GACrB,QAAQ;EACV;EAGA,OADoB,UAAU,UAAU,QACvB;CACnB,GAAG,CAAC,WAAW,OAAO,CAAC;AACzB"}
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_useWatchUserChange = require("../../useWatchUserChange-YtVWYw_E.cjs");
2
+ const require_useWatchUserChange = require("../../useWatchUserChange-C1xWHtFG.cjs");
3
3
  //#region src/hooks/useWatchUserChange/index.ts
4
4
  /* v8 ignore stop */
5
5
  //#endregion
@@ -1,2 +1,2 @@
1
- import { n as useWatchUserChange, t as UseWatchUserChangeOptions } from "../../useWatchUserChange-BgO4melQ.cjs";
1
+ import { n as useWatchUserChange, t as UseWatchUserChangeOptions } from "../../useWatchUserChange-DSAboNCs.cjs";
2
2
  export { UseWatchUserChangeOptions, useWatchUserChange };
@@ -1,2 +1,2 @@
1
- import { n as useWatchUserChange, t as UseWatchUserChangeOptions } from "../../useWatchUserChange-CpQ-pWRM.js";
1
+ import { n as useWatchUserChange, t as UseWatchUserChangeOptions } from "../../useWatchUserChange-CpyZz2i7.js";
2
2
  export { UseWatchUserChangeOptions, useWatchUserChange };
@@ -1,4 +1,4 @@
1
- import { t as useWatchUserChange } from "../../useWatchUserChange-Bnx3tOOR.js";
1
+ import { t as useWatchUserChange } from "../../useWatchUserChange-DSQGsl1R.js";
2
2
  //#region src/hooks/useWatchUserChange/index.ts
3
3
  /* v8 ignore stop */
4
4
  //#endregion
@@ -1,4 +1,4 @@
1
- import { t as DebugModeSettings } from "./FormContext-qrel_XTj.js";
1
+ import { t as DebugModeSettings } from "./FormContext-i66vM5f1.js";
2
2
  import { ReactNode } from "react";
3
3
  import { FieldValues, SubmitHandler } from "react-hook-form";
4
4
  import { VetoInstance } from "@fuf-stack/veto";
@@ -40,4 +40,4 @@ declare const Form: ({
40
40
  }: FormProps) => import("react/jsx-runtime").JSX.Element;
41
41
  //#endregion
42
42
  export { FormProps as n, Form as t };
43
- //# sourceMappingURL=index-B3JBVqnz.d.ts.map
43
+ //# sourceMappingURL=index-54OZEaUU.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-B3JBVqnz.d.ts","names":[],"sources":["../src/Form/Form.tsx"],"mappings":";;;;;;UAYiB,SAAA;;EAEf,QAAA,EAAU,SAAA,GAAY,SAAA;EAFE;EAIxB,SAAA;EAFU;EAIV,KAAA,GAAQ,iBAAA;EAAA;EAER,aAAA,GAAgB,WAAA;EAIQ;EAFxB,IAAA;EAMa;EAJb,QAAA,EAAU,aAAA,CAAc,WAAA;EAIC;EAFzB,MAAA;EAZU;EAcV,UAAA,GAAa,YAAA;EAZb;EAcA,iBAAA;AAAA;;;;cAMI,IAAA;EAAQ,QAAA;EAAA,SAAA;EAAA,KAAA;EAAA,aAAA;EAAA,IAAA;EAAA,QAAA;EAAA,MAAA;EAAA,UAAA;EAAA;AAAA,GAUX,SAAA,iCAAS,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"index-54OZEaUU.d.ts","names":[],"sources":["../src/Form/Form.tsx"],"mappings":";;;;;;UAYiB,SAAA;;EAEf,QAAA,EAAU,SAAA,GAAY,SAAA;EAFE;EAIxB,SAAA;EAFU;EAIV,KAAA,GAAQ,iBAAA;EAAA;EAER,aAAA,GAAgB,WAAA;EAIQ;EAFxB,IAAA;EAMa;EAJb,QAAA,EAAU,aAAA,CAAc,WAAA;EAIC;EAFzB,MAAA;EAZU;EAcV,UAAA,GAAa,YAAA;EAZb;EAcA,iBAAA;AAAA;;;;cAMI,IAAA;EAAQ,QAAA;EAAA,SAAA;EAAA,KAAA;EAAA,aAAA;EAAA,IAAA;EAAA,QAAA;EAAA,MAAA;EAAA,UAAA;EAAA;AAAA,GAUX,SAAA,iCAAS,GAAA,CAAA,OAAA"}
@@ -7,9 +7,9 @@ declare const switchVariants: import("tailwind-variants").TVReturnType<{
7
7
  [key: string]: {
8
8
  [key: string]: import("tailwind-merge").ClassNameValue | {
9
9
  base?: import("tailwind-merge").ClassNameValue;
10
- endContent?: import("tailwind-merge").ClassNameValue;
11
- errorMessage?: import("tailwind-merge").ClassNameValue;
12
10
  label?: import("tailwind-merge").ClassNameValue;
11
+ errorMessage?: import("tailwind-merge").ClassNameValue;
12
+ endContent?: import("tailwind-merge").ClassNameValue;
13
13
  outerWrapper?: import("tailwind-merge").ClassNameValue;
14
14
  startContent?: import("tailwind-merge").ClassNameValue;
15
15
  thumb?: import("tailwind-merge").ClassNameValue;
@@ -21,9 +21,9 @@ declare const switchVariants: import("tailwind-variants").TVReturnType<{
21
21
  [x: string]: {
22
22
  [x: string]: import("tailwind-merge").ClassNameValue | {
23
23
  base?: import("tailwind-merge").ClassNameValue;
24
- endContent?: import("tailwind-merge").ClassNameValue;
25
- errorMessage?: import("tailwind-merge").ClassNameValue;
26
24
  label?: import("tailwind-merge").ClassNameValue;
25
+ errorMessage?: import("tailwind-merge").ClassNameValue;
26
+ endContent?: import("tailwind-merge").ClassNameValue;
27
27
  outerWrapper?: import("tailwind-merge").ClassNameValue;
28
28
  startContent?: import("tailwind-merge").ClassNameValue;
29
29
  thumb?: import("tailwind-merge").ClassNameValue;
@@ -45,9 +45,9 @@ declare const switchVariants: import("tailwind-variants").TVReturnType<{
45
45
  [key: string]: {
46
46
  [key: string]: import("tailwind-merge").ClassNameValue | {
47
47
  base?: import("tailwind-merge").ClassNameValue;
48
- endContent?: import("tailwind-merge").ClassNameValue;
49
- errorMessage?: import("tailwind-merge").ClassNameValue;
50
48
  label?: import("tailwind-merge").ClassNameValue;
49
+ errorMessage?: import("tailwind-merge").ClassNameValue;
50
+ endContent?: import("tailwind-merge").ClassNameValue;
51
51
  outerWrapper?: import("tailwind-merge").ClassNameValue;
52
52
  startContent?: import("tailwind-merge").ClassNameValue;
53
53
  thumb?: import("tailwind-merge").ClassNameValue;
@@ -113,4 +113,4 @@ declare const Switch$1: ({
113
113
  }: SwitchProps$1) => import("react/jsx-runtime").JSX.Element;
114
114
  //#endregion
115
115
  export { SwitchProps$1 as n, Switch$1 as t };
116
- //# sourceMappingURL=index-BSwiB7ug.d.ts.map
116
+ //# sourceMappingURL=index-B7gQppgQ.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-BSwiB7ug.d.ts","names":[],"sources":["../src/Switch/Switch.tsx"],"mappings":";;;;;cAaa,cAAA,8BAAc,YAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiBtB,YAAA,GAAe,OAAO,QAAQ,cAAA;AAAA,KAC9B,SAAA,GAAY,WAAW,QAAQ,cAAA;AAAA,UAEnB,aAAA,SAAoB,YAAA;;EAEnC,SAAA;;EAEA,SAAA,GAAY,SAAA;;EAEZ,QAAA;;EAEA,UAAA,GAAa,SAAA;;EAEb,KAAA,GAAQ,SAAA;;EAER,IAAA;EAEA,IAAA;;EAEA,YAAA,GAAe,SAAA;;EAEf,MAAA;;EAEA,SAAA,GAAY,WAAA;AAAA;;;;cAMR,QAAA;EAAU,SAAA;EAAA,UAAA;EAAA,IAAA;EAAA,IAAA;EAAA,YAAA;EAAA,SAAA;EAAA,GAAA;AAAA,GAQb,aAAA,iCAAW,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"index-B7gQppgQ.d.ts","names":[],"sources":["../src/Switch/Switch.tsx"],"mappings":";;;;;cAaa,cAAA,8BAAc,YAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiBtB,YAAA,GAAe,OAAO,QAAQ,cAAA;AAAA,KAC9B,SAAA,GAAY,WAAW,QAAQ,cAAA;AAAA,UAEnB,aAAA,SAAoB,YAAA;;EAEnC,SAAA;;EAEA,SAAA,GAAY,SAAA;;EAEZ,QAAA;;EAEA,UAAA,GAAa,SAAA;;EAEb,KAAA,GAAQ,SAAA;;EAER,IAAA;EAEA,IAAA;;EAEA,YAAA,GAAe,SAAA;;EAEf,MAAA;;EAEA,SAAA,GAAY,WAAA;AAAA;;;;cAMR,QAAA;EAAU,SAAA;EAAA,UAAA;EAAA,IAAA;EAAA,IAAA;EAAA,YAAA;EAAA,SAAA;EAAA,GAAA;AAAA,GAQb,aAAA,iCAAW,GAAA,CAAA,OAAA"}
@@ -7,9 +7,9 @@ declare const switchVariants: import("tailwind-variants").TVReturnType<{
7
7
  [key: string]: {
8
8
  [key: string]: import("tailwind-merge").ClassNameValue | {
9
9
  base?: import("tailwind-merge").ClassNameValue;
10
- endContent?: import("tailwind-merge").ClassNameValue;
11
- errorMessage?: import("tailwind-merge").ClassNameValue;
12
10
  label?: import("tailwind-merge").ClassNameValue;
11
+ errorMessage?: import("tailwind-merge").ClassNameValue;
12
+ endContent?: import("tailwind-merge").ClassNameValue;
13
13
  outerWrapper?: import("tailwind-merge").ClassNameValue;
14
14
  startContent?: import("tailwind-merge").ClassNameValue;
15
15
  thumb?: import("tailwind-merge").ClassNameValue;
@@ -21,9 +21,9 @@ declare const switchVariants: import("tailwind-variants").TVReturnType<{
21
21
  [x: string]: {
22
22
  [x: string]: import("tailwind-merge").ClassNameValue | {
23
23
  base?: import("tailwind-merge").ClassNameValue;
24
- endContent?: import("tailwind-merge").ClassNameValue;
25
- errorMessage?: import("tailwind-merge").ClassNameValue;
26
24
  label?: import("tailwind-merge").ClassNameValue;
25
+ errorMessage?: import("tailwind-merge").ClassNameValue;
26
+ endContent?: import("tailwind-merge").ClassNameValue;
27
27
  outerWrapper?: import("tailwind-merge").ClassNameValue;
28
28
  startContent?: import("tailwind-merge").ClassNameValue;
29
29
  thumb?: import("tailwind-merge").ClassNameValue;
@@ -45,9 +45,9 @@ declare const switchVariants: import("tailwind-variants").TVReturnType<{
45
45
  [key: string]: {
46
46
  [key: string]: import("tailwind-merge").ClassNameValue | {
47
47
  base?: import("tailwind-merge").ClassNameValue;
48
- endContent?: import("tailwind-merge").ClassNameValue;
49
- errorMessage?: import("tailwind-merge").ClassNameValue;
50
48
  label?: import("tailwind-merge").ClassNameValue;
49
+ errorMessage?: import("tailwind-merge").ClassNameValue;
50
+ endContent?: import("tailwind-merge").ClassNameValue;
51
51
  outerWrapper?: import("tailwind-merge").ClassNameValue;
52
52
  startContent?: import("tailwind-merge").ClassNameValue;
53
53
  thumb?: import("tailwind-merge").ClassNameValue;
@@ -113,4 +113,4 @@ declare const Switch: ({
113
113
  }: SwitchProps$1) => import("react/jsx-runtime").JSX.Element;
114
114
  //#endregion
115
115
  export { SwitchProps$1 as n, Switch as t };
116
- //# sourceMappingURL=index-CJEqtwN7.d.cts.map
116
+ //# sourceMappingURL=index-Bzs7_gnk.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-CJEqtwN7.d.cts","names":[],"sources":["../src/Switch/Switch.tsx"],"mappings":";;;;;cAaa,cAAA,8BAAc,YAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiBtB,YAAA,GAAe,OAAO,QAAQ,cAAA;AAAA,KAC9B,SAAA,GAAY,WAAW,QAAQ,cAAA;AAAA,UAEnB,aAAA,SAAoB,YAAA;;EAEnC,SAAA;;EAEA,SAAA,GAAY,SAAA;;EAEZ,QAAA;;EAEA,UAAA,GAAa,SAAA;;EAEb,KAAA,GAAQ,SAAA;;EAER,IAAA;EAEA,IAAA;;EAEA,YAAA,GAAe,SAAA;;EAEf,MAAA;;EAEA,SAAA,GAAY,WAAA;AAAA;;;;cAMR,MAAA;EAAU,SAAA;EAAA,UAAA;EAAA,IAAA;EAAA,IAAA;EAAA,YAAA;EAAA,SAAA;EAAA,GAAA;AAAA,GAQb,aAAA,iCAAW,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"index-Bzs7_gnk.d.cts","names":[],"sources":["../src/Switch/Switch.tsx"],"mappings":";;;;;cAaa,cAAA,8BAAc,YAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiBtB,YAAA,GAAe,OAAO,QAAQ,cAAA;AAAA,KAC9B,SAAA,GAAY,WAAW,QAAQ,cAAA;AAAA,UAEnB,aAAA,SAAoB,YAAA;;EAEnC,SAAA;;EAEA,SAAA,GAAY,SAAA;;EAEZ,QAAA;;EAEA,UAAA,GAAa,SAAA;;EAEb,KAAA,GAAQ,SAAA;;EAER,IAAA;EAEA,IAAA;;EAEA,YAAA,GAAe,SAAA;;EAEf,MAAA;;EAEA,SAAA,GAAY,WAAA;AAAA;;;;cAMR,MAAA;EAAU,SAAA;EAAA,UAAA;EAAA,IAAA;EAAA,IAAA;EAAA,YAAA;EAAA,SAAA;EAAA,GAAA;AAAA,GAQb,aAAA,iCAAW,GAAA,CAAA,OAAA"}
@@ -1,4 +1,4 @@
1
- import { t as DebugModeSettings } from "./FormContext-BuG3xZFe.cjs";
1
+ import { t as DebugModeSettings } from "./FormContext-3kamRn2C.cjs";
2
2
  import { ReactNode } from "react";
3
3
  import { VetoInstance } from "@fuf-stack/veto";
4
4
  import { FieldValues, SubmitHandler } from "react-hook-form";
@@ -40,4 +40,4 @@ declare const Form: ({
40
40
  }: FormProps) => import("react/jsx-runtime").JSX.Element;
41
41
  //#endregion
42
42
  export { FormProps as n, Form as t };
43
- //# sourceMappingURL=index-D76g-bjx.d.cts.map
43
+ //# sourceMappingURL=index-C3-TV4Up.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-D76g-bjx.d.cts","names":[],"sources":["../src/Form/Form.tsx"],"mappings":";;;;;;UAYiB,SAAA;;EAEf,QAAA,EAAU,SAAA,GAAY,SAAA;EAFE;EAIxB,SAAA;EAFU;EAIV,KAAA,GAAQ,iBAAA;EAAA;EAER,aAAA,GAAgB,WAAA;EAIQ;EAFxB,IAAA;EAMa;EAJb,QAAA,EAAU,aAAA,CAAc,WAAA;EAIC;EAFzB,MAAA;EAZU;EAcV,UAAA,GAAa,YAAA;EAZb;EAcA,iBAAA;AAAA;;;;cAMI,IAAA;EAAQ,QAAA;EAAA,SAAA;EAAA,KAAA;EAAA,aAAA;EAAA,IAAA;EAAA,QAAA;EAAA,MAAA;EAAA,UAAA;EAAA;AAAA,GAUX,SAAA,iCAAS,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"index-C3-TV4Up.d.cts","names":[],"sources":["../src/Form/Form.tsx"],"mappings":";;;;;;UAYiB,SAAA;;EAEf,QAAA,EAAU,SAAA,GAAY,SAAA;EAFE;EAIxB,SAAA;EAFU;EAIV,KAAA,GAAQ,iBAAA;EAAA;EAER,aAAA,GAAgB,WAAA;EAIQ;EAFxB,IAAA;EAMa;EAJb,QAAA,EAAU,aAAA,CAAc,WAAA;EAIC;EAFzB,MAAA;EAZU;EAcV,UAAA,GAAa,YAAA;EAZb;EAcA,iBAAA;AAAA;;;;cAMI,IAAA;EAAQ,QAAA;EAAA,SAAA;EAAA,KAAA;EAAA,aAAA;EAAA,IAAA;EAAA,QAAA;EAAA,MAAA;EAAA,UAAA;EAAA;AAAA,GAUX,SAAA,iCAAS,GAAA,CAAA,OAAA"}
@@ -9,10 +9,10 @@ declare const selectVariants: import("tailwind-variants").TVReturnType<{
9
9
  base?: import("tailwind-merge").ClassNameValue;
10
10
  label?: import("tailwind-merge").ClassNameValue;
11
11
  input?: import("tailwind-merge").ClassNameValue;
12
+ control?: import("tailwind-merge").ClassNameValue;
13
+ placeholder?: import("tailwind-merge").ClassNameValue;
12
14
  menu?: import("tailwind-merge").ClassNameValue;
13
15
  option?: import("tailwind-merge").ClassNameValue;
14
- placeholder?: import("tailwind-merge").ClassNameValue;
15
- control?: import("tailwind-merge").ClassNameValue;
16
16
  group?: import("tailwind-merge").ClassNameValue;
17
17
  clearIndicator?: import("tailwind-merge").ClassNameValue;
18
18
  control_focused?: import("tailwind-merge").ClassNameValue;
@@ -45,10 +45,10 @@ declare const selectVariants: import("tailwind-variants").TVReturnType<{
45
45
  base?: import("tailwind-merge").ClassNameValue;
46
46
  label?: import("tailwind-merge").ClassNameValue;
47
47
  input?: import("tailwind-merge").ClassNameValue;
48
+ control?: import("tailwind-merge").ClassNameValue;
49
+ placeholder?: import("tailwind-merge").ClassNameValue;
48
50
  menu?: import("tailwind-merge").ClassNameValue;
49
51
  option?: import("tailwind-merge").ClassNameValue;
50
- placeholder?: import("tailwind-merge").ClassNameValue;
51
- control?: import("tailwind-merge").ClassNameValue;
52
52
  group?: import("tailwind-merge").ClassNameValue;
53
53
  clearIndicator?: import("tailwind-merge").ClassNameValue;
54
54
  control_focused?: import("tailwind-merge").ClassNameValue;
@@ -113,10 +113,10 @@ declare const selectVariants: import("tailwind-variants").TVReturnType<{
113
113
  base?: import("tailwind-merge").ClassNameValue;
114
114
  label?: import("tailwind-merge").ClassNameValue;
115
115
  input?: import("tailwind-merge").ClassNameValue;
116
+ control?: import("tailwind-merge").ClassNameValue;
117
+ placeholder?: import("tailwind-merge").ClassNameValue;
116
118
  menu?: import("tailwind-merge").ClassNameValue;
117
119
  option?: import("tailwind-merge").ClassNameValue;
118
- placeholder?: import("tailwind-merge").ClassNameValue;
119
- control?: import("tailwind-merge").ClassNameValue;
120
120
  group?: import("tailwind-merge").ClassNameValue;
121
121
  clearIndicator?: import("tailwind-merge").ClassNameValue;
122
122
  control_focused?: import("tailwind-merge").ClassNameValue;
@@ -287,4 +287,4 @@ declare const Select: ({
287
287
  }: SelectProps) => import("react/jsx-runtime").JSX.Element;
288
288
  //#endregion
289
289
  export { SelectProps as n, Select as t };
290
- //# sourceMappingURL=index-CbGiXZQv.d.ts.map
290
+ //# sourceMappingURL=index-C4GJH8Xv.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-CbGiXZQv.d.ts","names":[],"sources":["../src/Select/Select.tsx"],"mappings":";;;;;cAea,cAAA,8BAAc,YAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8CjB,YAAA;;EAER,QAAA;;;;;EAKA,UAAA;;EAEA,KAAA,GAAQ,SAAS;;EAEjB,KAAA;AAAA;AAAA,KAGG,YAAA,GAAe,OAAO,QAAQ,cAAA;AAAA,KAC9B,SAAA,GAAY,WAAW,QAAQ,cAAA;AAAA,UAEnB,WAAA,SAAoB,YAAA;;EAEnC,SAAA;;EAEA,SAAA,GAAY,SAAA;;EAEZ,SAAA;;EAEA,QAAA;;EAEA,aAAA;;EAEA,YAAA,iBAEM,MAAA,GAAS,YAAA,EAAc,UAAA;;EAE7B,UAAA;;EAEA,KAAA,GAAQ,SAAA;;EAER,OAAA;;EAEA,WAAA;;EAEA,IAAA;;EAEA,WAAA;;EAEA,aAAA,GAAgB,KAAA;;EAEhB,OAAA,EAAS,YAAA;;EAET,kBAAA,GAAqB,KAAA;;EAErB,iBAAA,eAAgC,KAAA;;;;;;;;EAQhC,sBAAA,GAAyB,YAAA,GAAe,YAAA;;EAExC,MAAA;AAAA;;cA8CI,MAAA;EAAU,SAAA;EAAA,SAAA;EAAA,aAAA;EAAA,YAAA;EAAA,UAAA;EAAA,OAAA;EAAA,WAAA;EAAA,IAAA;EAAA,aAAA;EAAA,OAAA;EAAA,WAAA;EAAA,kBAAA;EAAA,iBAAA;EAAA,sBAAA;EAAA,GAAA;AAAA,GAgBb,WAAA,iCAAW,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"index-C4GJH8Xv.d.ts","names":[],"sources":["../src/Select/Select.tsx"],"mappings":";;;;;cAea,cAAA,8BAAc,YAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8CjB,YAAA;;EAER,QAAA;;;;;EAKA,UAAA;;EAEA,KAAA,GAAQ,SAAS;;EAEjB,KAAA;AAAA;AAAA,KAGG,YAAA,GAAe,OAAO,QAAQ,cAAA;AAAA,KAC9B,SAAA,GAAY,WAAW,QAAQ,cAAA;AAAA,UAEnB,WAAA,SAAoB,YAAA;;EAEnC,SAAA;;EAEA,SAAA,GAAY,SAAA;;EAEZ,SAAA;;EAEA,QAAA;;EAEA,aAAA;;EAEA,YAAA,iBAEM,MAAA,GAAS,YAAA,EAAc,UAAA;;EAE7B,UAAA;;EAEA,KAAA,GAAQ,SAAA;;EAER,OAAA;;EAEA,WAAA;;EAEA,IAAA;;EAEA,WAAA;;EAEA,aAAA,GAAgB,KAAA;;EAEhB,OAAA,EAAS,YAAA;;EAET,kBAAA,GAAqB,KAAA;;EAErB,iBAAA,eAAgC,KAAA;;;;;;;;EAQhC,sBAAA,GAAyB,YAAA,GAAe,YAAA;;EAExC,MAAA;AAAA;;cA8CI,MAAA;EAAU,SAAA;EAAA,SAAA;EAAA,aAAA;EAAA,YAAA;EAAA,UAAA;EAAA,OAAA;EAAA,WAAA;EAAA,IAAA;EAAA,aAAA;EAAA,OAAA;EAAA,WAAA;EAAA,kBAAA;EAAA,iBAAA;EAAA,sBAAA;EAAA,GAAA;AAAA,GAgBb,WAAA,iCAAW,GAAA,CAAA,OAAA"}