@fuf-stack/uniform 1.11.3 → 1.13.0

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 (304) hide show
  1. package/dist/Checkboxes/index.cjs +1 -1
  2. package/dist/Checkboxes/index.d.cts +1 -1
  3. package/dist/Checkboxes/index.d.ts +1 -1
  4. package/dist/Checkboxes/index.js +1 -1
  5. package/dist/{Checkboxes-BvW4D5Nm.js → Checkboxes-BQI2kTIb.js} +2 -2
  6. package/dist/{Checkboxes-BvW4D5Nm.js.map → Checkboxes-BQI2kTIb.js.map} +1 -1
  7. package/dist/{Checkboxes-Cvdazf25.cjs → Checkboxes-mc1ZItR5.cjs} +4 -4
  8. package/dist/{Checkboxes-Cvdazf25.cjs.map → Checkboxes-mc1ZItR5.cjs.map} +1 -1
  9. package/dist/FieldArray/index.cjs +1 -1
  10. package/dist/FieldArray/index.d.cts +1 -1
  11. package/dist/FieldArray/index.d.ts +1 -1
  12. package/dist/FieldArray/index.js +1 -1
  13. package/dist/{FieldArray-CJpDgK_t.cjs → FieldArray-CsAyIsw9.cjs} +7 -7
  14. package/dist/{FieldArray-CJpDgK_t.cjs.map → FieldArray-CsAyIsw9.cjs.map} +1 -1
  15. package/dist/{FieldArray-omRNwxgy.js → FieldArray-D4eGdGXA.js} +4 -4
  16. package/dist/{FieldArray-omRNwxgy.js.map → FieldArray-D4eGdGXA.js.map} +1 -1
  17. package/dist/FieldCard/index.cjs +1 -1
  18. package/dist/FieldCard/index.d.cts +1 -1
  19. package/dist/FieldCard/index.d.ts +1 -1
  20. package/dist/FieldCard/index.js +1 -1
  21. package/dist/{FieldCard-Dyi-2qr6.js → FieldCard-BPQIqqW5.js} +2 -2
  22. package/dist/{FieldCard-Dyi-2qr6.js.map → FieldCard-BPQIqqW5.js.map} +1 -1
  23. package/dist/{FieldCard-Dt6QU7o7.cjs → FieldCard-CgWjzrRD.cjs} +4 -4
  24. package/dist/{FieldCard-Dt6QU7o7.cjs.map → FieldCard-CgWjzrRD.cjs.map} +1 -1
  25. package/dist/{FieldCopyTestIdButton-By-hEZgA.cjs → FieldCopyTestIdButton-DxJYKqrz.cjs} +2 -2
  26. package/dist/{FieldCopyTestIdButton-By-hEZgA.cjs.map → FieldCopyTestIdButton-DxJYKqrz.cjs.map} +1 -1
  27. package/dist/{FieldValidationError-D64j5gnH.cjs → FieldValidationError-A384-L3Y.cjs} +2 -2
  28. package/dist/{FieldValidationError-D64j5gnH.cjs.map → FieldValidationError-A384-L3Y.cjs.map} +1 -1
  29. package/dist/Form/index.cjs +1 -1
  30. package/dist/Form/index.d.cts +1 -1
  31. package/dist/Form/index.d.ts +1 -1
  32. package/dist/Form/index.js +1 -1
  33. package/dist/{Form-B1fvbnxi.js → Form-B7bv9fDO.js} +3 -3
  34. package/dist/{Form-B1fvbnxi.js.map → Form-B7bv9fDO.js.map} +1 -1
  35. package/dist/{Form-CvnnGF45.cjs → Form-Ca3RxssB.cjs} +3 -3
  36. package/dist/{Form-CvnnGF45.cjs.map → Form-Ca3RxssB.cjs.map} +1 -1
  37. package/dist/{FormContext-Lw4YL4-B.cjs → FormContext-CeFKQmVH.cjs} +2 -2
  38. package/dist/{FormContext-Lw4YL4-B.cjs.map → FormContext-CeFKQmVH.cjs.map} +1 -1
  39. package/dist/{FormContext-Dl3k1r_k.js → FormContext-DHYlCZ2u.js} +2 -2
  40. package/dist/{FormContext-Dl3k1r_k.js.map → FormContext-DHYlCZ2u.js.map} +1 -1
  41. package/dist/Grid/index.cjs +1 -1
  42. package/dist/Grid/index.d.cts +1 -1
  43. package/dist/Grid/index.d.ts +1 -1
  44. package/dist/{Grid-DezBAZbx.cjs → Grid-CRURvciu.cjs} +2 -2
  45. package/dist/{Grid-DezBAZbx.cjs.map → Grid-CRURvciu.cjs.map} +1 -1
  46. package/dist/Input/index.cjs +1 -1
  47. package/dist/Input/index.d.cts +1 -1
  48. package/dist/Input/index.d.ts +1 -1
  49. package/dist/Input/index.js +1 -1
  50. package/dist/{Input-DR0gCf9q.cjs → Input-7TmTrrV7.cjs} +4 -4
  51. package/dist/{Input-DR0gCf9q.cjs.map → Input-7TmTrrV7.cjs.map} +1 -1
  52. package/dist/{Input-DksaHK1Y.js → Input-BUfOTtDR.js} +3 -3
  53. package/dist/{Input-DksaHK1Y.js.map → Input-BUfOTtDR.js.map} +1 -1
  54. package/dist/RadioBoxes/index.cjs +1 -1
  55. package/dist/RadioBoxes/index.d.cts +1 -1
  56. package/dist/RadioBoxes/index.d.ts +1 -1
  57. package/dist/RadioBoxes/index.js +1 -1
  58. package/dist/{RadioBoxes-h-VLhJ9d.cjs → RadioBoxes-CjxWldIR.cjs} +11 -7
  59. package/dist/RadioBoxes-CjxWldIR.cjs.map +1 -0
  60. package/dist/{RadioBoxes-DdIHH6B5.js → RadioBoxes-Dpd71z1S.js} +10 -6
  61. package/dist/RadioBoxes-Dpd71z1S.js.map +1 -0
  62. package/dist/RadioTabs/index.cjs +1 -1
  63. package/dist/RadioTabs/index.d.cts +1 -1
  64. package/dist/RadioTabs/index.d.ts +1 -1
  65. package/dist/RadioTabs/index.js +1 -1
  66. package/dist/{RadioTabs-D6yF9jE3.cjs → RadioTabs-BA-EMFRc.cjs} +11 -7
  67. package/dist/RadioTabs-BA-EMFRc.cjs.map +1 -0
  68. package/dist/{RadioTabs-dLdlF91p.js → RadioTabs-BZlC19z0.js} +10 -6
  69. package/dist/RadioTabs-BZlC19z0.js.map +1 -0
  70. package/dist/Radios/index.cjs +1 -1
  71. package/dist/Radios/index.d.cts +1 -1
  72. package/dist/Radios/index.d.ts +1 -1
  73. package/dist/Radios/index.js +1 -1
  74. package/dist/{Radios-D8alyG2f.cjs → Radios-Bfxy-Vnf.cjs} +11 -7
  75. package/dist/Radios-Bfxy-Vnf.cjs.map +1 -0
  76. package/dist/{Radios-DiZ0Dfmp.js → Radios-ClBrO7QR.js} +10 -6
  77. package/dist/Radios-ClBrO7QR.js.map +1 -0
  78. package/dist/Select/index.cjs +1 -1
  79. package/dist/Select/index.d.cts +1 -1
  80. package/dist/Select/index.d.ts +1 -1
  81. package/dist/Select/index.js +1 -1
  82. package/dist/{Select-C9otN8uu.js → Select-9MyYYGeZ.js} +12 -7
  83. package/dist/Select-9MyYYGeZ.js.map +1 -0
  84. package/dist/{Select-DQVskslz.cjs → Select-CdTgOiUU.cjs} +13 -8
  85. package/dist/Select-CdTgOiUU.cjs.map +1 -0
  86. package/dist/Slider/index.cjs +1 -1
  87. package/dist/Slider/index.d.cts +1 -1
  88. package/dist/Slider/index.d.ts +1 -1
  89. package/dist/Slider/index.js +1 -1
  90. package/dist/{Slider-DwfyCQDM.cjs → Slider-CK9n0ryX.cjs} +3 -3
  91. package/dist/{Slider-DwfyCQDM.cjs.map → Slider-CK9n0ryX.cjs.map} +1 -1
  92. package/dist/{Slider-meuLEC2k.js → Slider-Cy5vz5as.js} +2 -2
  93. package/dist/{Slider-meuLEC2k.js.map → Slider-Cy5vz5as.js.map} +1 -1
  94. package/dist/SubmitButton/index.cjs +1 -1
  95. package/dist/SubmitButton/index.d.cts +1 -1
  96. package/dist/SubmitButton/index.d.ts +1 -1
  97. package/dist/SubmitButton/index.js +1 -1
  98. package/dist/{SubmitButton-BHP9J9ml.js → SubmitButton-BrbHJcb4.js} +2 -2
  99. package/dist/{SubmitButton-BHP9J9ml.js.map → SubmitButton-BrbHJcb4.js.map} +1 -1
  100. package/dist/{SubmitButton-B0kvUqkd.cjs → SubmitButton-C6sgPR8K.cjs} +3 -3
  101. package/dist/{SubmitButton-B0kvUqkd.cjs.map → SubmitButton-C6sgPR8K.cjs.map} +1 -1
  102. package/dist/Switch/index.cjs +1 -1
  103. package/dist/Switch/index.d.cts +1 -1
  104. package/dist/Switch/index.d.ts +1 -1
  105. package/dist/Switch/index.js +1 -1
  106. package/dist/{Switch-Ds0gDzjR.cjs → Switch-BBhxgBHh.cjs} +3 -3
  107. package/dist/{Switch-Ds0gDzjR.cjs.map → Switch-BBhxgBHh.cjs.map} +1 -1
  108. package/dist/{Switch-DkciIYnD.js → Switch-s64WUP5i.js} +2 -2
  109. package/dist/{Switch-DkciIYnD.js.map → Switch-s64WUP5i.js.map} +1 -1
  110. package/dist/SwitchBox/index.cjs +1 -1
  111. package/dist/SwitchBox/index.d.cts +1 -1
  112. package/dist/SwitchBox/index.d.ts +1 -1
  113. package/dist/SwitchBox/index.js +1 -1
  114. package/dist/{SwitchBox-B9JqwDtN.cjs → SwitchBox-BwdvgHpG.cjs} +3 -3
  115. package/dist/{SwitchBox-B9JqwDtN.cjs.map → SwitchBox-BwdvgHpG.cjs.map} +1 -1
  116. package/dist/{SwitchBox-B6Z4rtWt.js → SwitchBox-CMw1MGJ0.js} +2 -2
  117. package/dist/{SwitchBox-B6Z4rtWt.js.map → SwitchBox-CMw1MGJ0.js.map} +1 -1
  118. package/dist/TextArea/index.cjs +1 -1
  119. package/dist/TextArea/index.d.cts +1 -1
  120. package/dist/TextArea/index.d.ts +1 -1
  121. package/dist/TextArea/index.js +1 -1
  122. package/dist/{TextArea-BqQtlPSV.cjs → TextArea-COe8XP7f.cjs} +4 -4
  123. package/dist/{TextArea-BqQtlPSV.cjs.map → TextArea-COe8XP7f.cjs.map} +1 -1
  124. package/dist/{TextArea-DAx49KI6.js → TextArea-DTkDJr6g.js} +3 -3
  125. package/dist/{TextArea-DAx49KI6.js.map → TextArea-DTkDJr6g.js.map} +1 -1
  126. package/dist/helpers/index.cjs +2 -1
  127. package/dist/helpers/index.d.cts +23 -1
  128. package/dist/helpers/index.d.cts.map +1 -1
  129. package/dist/helpers/index.d.ts +23 -1
  130. package/dist/helpers/index.d.ts.map +1 -1
  131. package/dist/helpers/index.js +2 -2
  132. package/dist/{helpers-nYTmL2gX.cjs → helpers-CncbgvW_.cjs} +52 -2
  133. package/dist/helpers-CncbgvW_.cjs.map +1 -0
  134. package/dist/{helpers-CCINRgQk.js → helpers-D3A5d3M1.js} +46 -2
  135. package/dist/helpers-D3A5d3M1.js.map +1 -0
  136. package/dist/hooks/useClientValidation/index.cjs +1 -1
  137. package/dist/hooks/useClientValidation/index.js +1 -1
  138. package/dist/hooks/useController/index.cjs +1 -1
  139. package/dist/hooks/useController/index.js +1 -1
  140. package/dist/hooks/useFormContext/index.cjs +1 -1
  141. package/dist/hooks/useFormContext/index.d.cts +1 -1
  142. package/dist/hooks/useFormContext/index.d.ts +1 -1
  143. package/dist/hooks/useFormContext/index.js +1 -1
  144. package/dist/hooks/useInput/index.cjs +1 -1
  145. package/dist/hooks/useInputValueDebounce/index.cjs +1 -1
  146. package/dist/hooks/useInputValueDebounce/index.js +1 -1
  147. package/dist/hooks/useInputValueTransform/index.cjs +1 -1
  148. package/dist/hooks/useUniformField/index.cjs +1 -1
  149. package/dist/hooks/useUniformField/index.d.cts +1 -1
  150. package/dist/hooks/useUniformField/index.d.ts +2 -2
  151. package/dist/hooks/useUniformField/index.js +1 -1
  152. package/dist/hooks/useUniformFieldArray/index.cjs +1 -1
  153. package/dist/hooks/useUniformFieldArray/index.d.cts +1 -1
  154. package/dist/hooks/useUniformFieldArray/index.d.ts +2 -2
  155. package/dist/hooks/useUniformFieldArray/index.js +1 -1
  156. package/dist/hooks/useWatchUserChange/index.cjs +1 -1
  157. package/dist/hooks/useWatchUserChange/index.js +1 -1
  158. package/dist/{index-BGXgvZKr.d.ts → index--J1-cUWg.d.cts} +8 -9
  159. package/dist/index--J1-cUWg.d.cts.map +1 -0
  160. package/dist/{index-BDV3JVoX.d.cts → index-7C539UUH.d.cts} +6 -6
  161. package/dist/{index-BDV3JVoX.d.cts.map → index-7C539UUH.d.cts.map} +1 -1
  162. package/dist/{index-CUn9q5KD.d.ts → index-BFeKALeM.d.ts} +4 -4
  163. package/dist/{index-CUn9q5KD.d.ts.map → index-BFeKALeM.d.ts.map} +1 -1
  164. package/dist/{index-CZyNkPDq.d.ts → index-BHmMP-ps.d.ts} +21 -21
  165. package/dist/{index-CZyNkPDq.d.ts.map → index-BHmMP-ps.d.ts.map} +1 -1
  166. package/dist/{index-B_aIzCcx.d.cts → index-BNu0EV5x.d.cts} +3 -3
  167. package/dist/{index-B_aIzCcx.d.cts.map → index-BNu0EV5x.d.cts.map} +1 -1
  168. package/dist/{index-CHXv_rNR.d.ts → index-Bd7H1tdb.d.cts} +3 -3
  169. package/dist/{index-cadUZZIY.d.cts.map → index-Bd7H1tdb.d.cts.map} +1 -1
  170. package/dist/{index-D_WidR7r.d.cts → index-BhqOFcsS.d.cts} +6 -6
  171. package/dist/{index-D_WidR7r.d.cts.map → index-BhqOFcsS.d.cts.map} +1 -1
  172. package/dist/{index-DnzC0GCS.d.ts → index-CASoDHjE.d.cts} +21 -21
  173. package/dist/{index-C2A_i57R.d.cts.map → index-CASoDHjE.d.cts.map} +1 -1
  174. package/dist/index-CNFk4ygb.d.ts +264 -0
  175. package/dist/index-CNFk4ygb.d.ts.map +1 -0
  176. package/dist/{index-C2A_i57R.d.cts → index-CPbrUN5A.d.ts} +20 -20
  177. package/dist/{index-DnzC0GCS.d.ts.map → index-CPbrUN5A.d.ts.map} +1 -1
  178. package/dist/{index-cadUZZIY.d.cts → index-CVY05bZf.d.ts} +2 -2
  179. package/dist/{index-CHXv_rNR.d.ts.map → index-CVY05bZf.d.ts.map} +1 -1
  180. package/dist/{index-DVRtBywt.d.ts → index-CXkSuHEL.d.ts} +3 -3
  181. package/dist/{index-DVRtBywt.d.ts.map → index-CXkSuHEL.d.ts.map} +1 -1
  182. package/dist/{index-CHNp5R5N.d.cts → index-CrpdF1Xw.d.cts} +6 -6
  183. package/dist/{index-CHNp5R5N.d.cts.map → index-CrpdF1Xw.d.cts.map} +1 -1
  184. package/dist/{index-CuvvZMop.d.cts → index-Cs-7Ptqc.d.cts} +3 -3
  185. package/dist/{index-CuvvZMop.d.cts.map → index-Cs-7Ptqc.d.cts.map} +1 -1
  186. package/dist/{index-CqGabrzW.d.cts → index-D3o2YTBb.d.ts} +38 -38
  187. package/dist/index-D3o2YTBb.d.ts.map +1 -0
  188. package/dist/{index-CeYRsehb.d.cts → index-D9VXD1rv.d.cts} +21 -21
  189. package/dist/index-D9VXD1rv.d.cts.map +1 -0
  190. package/dist/{index-yVkU2v6b.d.ts → index-DCZwOjSs.d.cts} +37 -37
  191. package/dist/index-DCZwOjSs.d.cts.map +1 -0
  192. package/dist/{index-op7zETAQ.d.ts → index-DEtF7ckd.d.ts} +35 -35
  193. package/dist/index-DEtF7ckd.d.ts.map +1 -0
  194. package/dist/{index-DcYFLiul.d.cts → index-DMVoX5pj.d.cts} +48 -48
  195. package/dist/{index-DcYFLiul.d.cts.map → index-DMVoX5pj.d.cts.map} +1 -1
  196. package/dist/{index-DNFUttM8.d.ts → index-DMojDmML.d.ts} +48 -48
  197. package/dist/index-DMojDmML.d.ts.map +1 -0
  198. package/dist/{index-0wXxS5M7.d.ts → index-DsuMjcQk.d.ts} +6 -6
  199. package/dist/{index-0wXxS5M7.d.ts.map → index-DsuMjcQk.d.ts.map} +1 -1
  200. package/dist/{index-g9TZhGnE.d.cts → index-DsyY9X04.d.cts} +3 -3
  201. package/dist/{index-g9TZhGnE.d.cts.map → index-DsyY9X04.d.cts.map} +1 -1
  202. package/dist/index-DtWIiEFa.d.cts +264 -0
  203. package/dist/index-DtWIiEFa.d.cts.map +1 -0
  204. package/dist/{index-1Egh73pR.d.ts → index-DvB46QAb.d.ts} +3 -3
  205. package/dist/{index-1Egh73pR.d.ts.map → index-DvB46QAb.d.ts.map} +1 -1
  206. package/dist/{index-3v_vja2i.d.ts → index-JdksqsGh.d.ts} +4 -4
  207. package/dist/{index-3v_vja2i.d.ts.map → index-JdksqsGh.d.ts.map} +1 -1
  208. package/dist/{index-CnsR8nkm.d.cts → index-JfAmWj81.d.cts} +35 -35
  209. package/dist/index-JfAmWj81.d.cts.map +1 -0
  210. package/dist/{index-BFLKkqA3.d.ts → index-KgMMIPyM.d.cts} +3 -3
  211. package/dist/{index-DvF_C1Bz.d.cts.map → index-KgMMIPyM.d.cts.map} +1 -1
  212. package/dist/{index-Bcppi5O7.d.ts → index-OwPGP648.d.ts} +5 -5
  213. package/dist/{index-BSjUaHEO.d.cts.map → index-OwPGP648.d.ts.map} +1 -1
  214. package/dist/{index-DvF_C1Bz.d.cts → index-TbDhDIfv.d.ts} +3 -3
  215. package/dist/{index-BFLKkqA3.d.ts.map → index-TbDhDIfv.d.ts.map} +1 -1
  216. package/dist/{index-7mx-IcDp.d.ts → index-Z0IxHoXS.d.ts} +3 -3
  217. package/dist/{index-7mx-IcDp.d.ts.map → index-Z0IxHoXS.d.ts.map} +1 -1
  218. package/dist/{index-CiF2KXB7.d.cts → index-_njc33cQ.d.cts} +6 -6
  219. package/dist/{index-CiF2KXB7.d.cts.map → index-_njc33cQ.d.cts.map} +1 -1
  220. package/dist/{index-CjJHVJwD.d.cts → index-_zWAtv8G.d.ts} +37 -36
  221. package/dist/index-_zWAtv8G.d.ts.map +1 -0
  222. package/dist/{index-BSjUaHEO.d.cts → index-acwVBMcR.d.cts} +5 -5
  223. package/dist/index-acwVBMcR.d.cts.map +1 -0
  224. package/dist/{index-CTp4vdDb.d.ts → index-rK5GxEPh.d.ts} +6 -6
  225. package/dist/{index-CTp4vdDb.d.ts.map → index-rK5GxEPh.d.ts.map} +1 -1
  226. package/dist/index.cjs +28 -27
  227. package/dist/index.d.cts +22 -22
  228. package/dist/index.d.ts +22 -22
  229. package/dist/index.js +23 -23
  230. package/dist/partials/FieldCopyTestIdButton/index.cjs +1 -1
  231. package/dist/partials/FieldCopyTestIdButton/index.d.cts +1 -1
  232. package/dist/partials/FieldCopyTestIdButton/index.d.ts +1 -1
  233. package/dist/partials/FieldValidationError/index.cjs +1 -1
  234. package/dist/partials/FieldValidationError/index.d.cts +1 -1
  235. package/dist/partials/FieldValidationError/index.d.ts +1 -1
  236. package/dist/{useClientValidation-BrTtRnqi.js → useClientValidation-C6Daq53C.js} +3 -3
  237. package/dist/{useClientValidation-BrTtRnqi.js.map → useClientValidation-C6Daq53C.js.map} +1 -1
  238. package/dist/{useClientValidation-CdC7lEYP.cjs → useClientValidation-DzomULfo.cjs} +4 -4
  239. package/dist/{useClientValidation-CdC7lEYP.cjs.map → useClientValidation-DzomULfo.cjs.map} +1 -1
  240. package/dist/useController-BArZd2Vp.d.cts.map +1 -1
  241. package/dist/{useController-g0AlWM__.js → useController-BPDcwfTj.js} +3 -3
  242. package/dist/{useController-g0AlWM__.js.map → useController-BPDcwfTj.js.map} +1 -1
  243. package/dist/{useController-BBxji1nQ.cjs → useController-DHRkSHem.cjs} +3 -3
  244. package/dist/{useController-BBxji1nQ.cjs.map → useController-DHRkSHem.cjs.map} +1 -1
  245. package/dist/{useFormContext-Cw6aAhos.d.ts → useFormContext-B2TS6xq0.d.ts} +3 -3
  246. package/dist/useFormContext-B2TS6xq0.d.ts.map +1 -0
  247. package/dist/{useFormContext-CEr3zcL6.cjs → useFormContext-DJiJlfGJ.cjs} +3 -3
  248. package/dist/{useFormContext-CEr3zcL6.cjs.map → useFormContext-DJiJlfGJ.cjs.map} +1 -1
  249. package/dist/{useFormContext-BFoXZNkp.js → useFormContext-UFBqUfOr.js} +3 -3
  250. package/dist/{useFormContext-BFoXZNkp.js.map → useFormContext-UFBqUfOr.js.map} +1 -1
  251. package/dist/{useFormContext--yod5xzQ.d.cts → useFormContext-n3WYgGkW.d.cts} +19 -19
  252. package/dist/useFormContext-n3WYgGkW.d.cts.map +1 -0
  253. package/dist/{useInputValueDebounce-Dop_8_OK.js → useInputValueDebounce-D9wArTKz.js} +2 -2
  254. package/dist/{useInputValueDebounce-Dop_8_OK.js.map → useInputValueDebounce-D9wArTKz.js.map} +1 -1
  255. package/dist/{useInputValueDebounce-TiNR4jtG.cjs → useInputValueDebounce-KIKsvSLm.cjs} +3 -3
  256. package/dist/{useInputValueDebounce-TiNR4jtG.cjs.map → useInputValueDebounce-KIKsvSLm.cjs.map} +1 -1
  257. package/dist/{useInputValueTransform-BNmfaj5D.cjs → useInputValueTransform-DuhPVE4L.cjs} +2 -2
  258. package/dist/{useInputValueTransform-BNmfaj5D.cjs.map → useInputValueTransform-DuhPVE4L.cjs.map} +1 -1
  259. package/dist/{useUniformField-RxZqXMuD.d.ts → useUniformField-Bzv-6MG1.d.ts} +2 -2
  260. package/dist/{useUniformField-RxZqXMuD.d.ts.map → useUniformField-Bzv-6MG1.d.ts.map} +1 -1
  261. package/dist/{useUniformField-D6fwSjrH.cjs → useUniformField-CGiibqg4.cjs} +8 -8
  262. package/dist/{useUniformField-D6fwSjrH.cjs.map → useUniformField-CGiibqg4.cjs.map} +1 -1
  263. package/dist/{useUniformField-B2zQtEbr.d.cts → useUniformField-CrEz5lkV.d.cts} +2 -2
  264. package/dist/{useUniformField-B2zQtEbr.d.cts.map → useUniformField-CrEz5lkV.d.cts.map} +1 -1
  265. package/dist/{useUniformField-BKVVns0E.js → useUniformField-D2NgevBI.js} +4 -4
  266. package/dist/{useUniformField-BKVVns0E.js.map → useUniformField-D2NgevBI.js.map} +1 -1
  267. package/dist/{useUniformFieldArray-WRuIMhw6.d.cts → useUniformFieldArray-B2-Bfl74.d.cts} +13 -13
  268. package/dist/{useUniformFieldArray-WRuIMhw6.d.cts.map → useUniformFieldArray-B2-Bfl74.d.cts.map} +1 -1
  269. package/dist/{useUniformFieldArray-Byfmzq97.cjs → useUniformFieldArray-Ct8jD7JJ.cjs} +5 -5
  270. package/dist/{useUniformFieldArray-Byfmzq97.cjs.map → useUniformFieldArray-Ct8jD7JJ.cjs.map} +1 -1
  271. package/dist/{useUniformFieldArray-BwE634m6.js → useUniformFieldArray-DcoVYtqx.js} +4 -4
  272. package/dist/{useUniformFieldArray-BwE634m6.js.map → useUniformFieldArray-DcoVYtqx.js.map} +1 -1
  273. package/dist/{useUniformFieldArray-B_c55CnX.d.ts → useUniformFieldArray-jUCzsveX.d.ts} +2 -2
  274. package/dist/{useUniformFieldArray-B_c55CnX.d.ts.map → useUniformFieldArray-jUCzsveX.d.ts.map} +1 -1
  275. package/dist/{useWatchUserChange-fZy6nGtD.js → useWatchUserChange-1ELFYX_F.js} +2 -2
  276. package/dist/{useWatchUserChange-fZy6nGtD.js.map → useWatchUserChange-1ELFYX_F.js.map} +1 -1
  277. package/dist/{useWatchUserChange-TMfaTCcp.cjs → useWatchUserChange-C1zOvSSU.cjs} +3 -3
  278. package/dist/{useWatchUserChange-TMfaTCcp.cjs.map → useWatchUserChange-C1zOvSSU.cjs.map} +1 -1
  279. package/package.json +5 -5
  280. package/dist/RadioBoxes-DdIHH6B5.js.map +0 -1
  281. package/dist/RadioBoxes-h-VLhJ9d.cjs.map +0 -1
  282. package/dist/RadioTabs-D6yF9jE3.cjs.map +0 -1
  283. package/dist/RadioTabs-dLdlF91p.js.map +0 -1
  284. package/dist/Radios-D8alyG2f.cjs.map +0 -1
  285. package/dist/Radios-DiZ0Dfmp.js.map +0 -1
  286. package/dist/Select-C9otN8uu.js.map +0 -1
  287. package/dist/Select-DQVskslz.cjs.map +0 -1
  288. package/dist/helpers-CCINRgQk.js.map +0 -1
  289. package/dist/helpers-nYTmL2gX.cjs.map +0 -1
  290. package/dist/index-BGXgvZKr.d.ts.map +0 -1
  291. package/dist/index-Bcppi5O7.d.ts.map +0 -1
  292. package/dist/index-CeYRsehb.d.cts.map +0 -1
  293. package/dist/index-CjJHVJwD.d.cts.map +0 -1
  294. package/dist/index-CnsR8nkm.d.cts.map +0 -1
  295. package/dist/index-CqGabrzW.d.cts.map +0 -1
  296. package/dist/index-DNFUttM8.d.ts.map +0 -1
  297. package/dist/index-D_egu-QT.d.cts +0 -264
  298. package/dist/index-D_egu-QT.d.cts.map +0 -1
  299. package/dist/index-DajjPPWM.d.ts +0 -264
  300. package/dist/index-DajjPPWM.d.ts.map +0 -1
  301. package/dist/index-op7zETAQ.d.ts.map +0 -1
  302. package/dist/index-yVkU2v6b.d.ts.map +0 -1
  303. package/dist/useFormContext--yod5xzQ.d.cts.map +0 -1
  304. package/dist/useFormContext-Cw6aAhos.d.ts.map +0 -1
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- const require_Slider = require('../Slider-DwfyCQDM.cjs');
2
+ const require_Slider = require('../Slider-CK9n0ryX.cjs');
3
3
 
4
4
  exports.Slider = require_Slider.Slider_default$1;
5
5
  exports.default = require_Slider.Slider_default;
@@ -1,2 +1,2 @@
1
- import { n as SliderProps, t as Slider } from "../index-DcYFLiul.cjs";
1
+ import { n as SliderProps, t as Slider } from "../index-DMVoX5pj.cjs";
2
2
  export { Slider, Slider as default, SliderProps };
@@ -1,2 +1,2 @@
1
- import { n as SliderProps, t as Slider } from "../index-DNFUttM8.js";
1
+ import { n as SliderProps, t as Slider } from "../index-DMojDmML.js";
2
2
  export { Slider, Slider as default, SliderProps };
@@ -1,3 +1,3 @@
1
- import { n as Slider_default, t as Slider_default$1 } from "../Slider-meuLEC2k.js";
1
+ import { n as Slider_default, t as Slider_default$1 } from "../Slider-Cy5vz5as.js";
2
2
 
3
3
  export { Slider_default as Slider, Slider_default$1 as default };
@@ -1,5 +1,5 @@
1
- const require_FormContext = require('./FormContext-Lw4YL4-B.cjs');
2
- const require_useUniformField = require('./useUniformField-D6fwSjrH.cjs');
1
+ const require_FormContext = require('./FormContext-CeFKQmVH.cjs');
2
+ const require_useUniformField = require('./useUniformField-CGiibqg4.cjs');
3
3
  let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
4
4
  let react = require("react");
5
5
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -120,4 +120,4 @@ Object.defineProperty(exports, 'Slider_default$1', {
120
120
  return Slider_default$1;
121
121
  }
122
122
  });
123
- //# sourceMappingURL=Slider-DwfyCQDM.cjs.map
123
+ //# sourceMappingURL=Slider-CK9n0ryX.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Slider-DwfyCQDM.cjs","names":["useUniformField","VisuallyHidden","HeroUISlider","Slider"],"sources":["../src/Slider/Slider.tsx","../src/Slider/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { Slider as HeroUISlider } from '@heroui/slider';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const sliderVariants = tv({\n slots: {\n base: 'group',\n endContent: '',\n errorMessage: 'ml-1 mt-1',\n filler: '',\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 'text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n labelWrapper: '',\n mark: '',\n startContent: '',\n step: '',\n thumb: '',\n track: '',\n trackWrapper: '',\n value: '',\n },\n});\n\ntype VariantProps = TVProps<typeof sliderVariants>;\ntype ClassName = TVClassName<typeof sliderVariants>;\n\nexport interface SliderProps 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 /** input field is disabled */\n disabled?: boolean;\n /** Content to display at the end of the slider */\n endContent?: ReactNode;\n /** The offset from where the fill should start */\n fillOffset?: number;\n /** form field label */\n label?: string;\n /** form field name */\n name: string;\n /**\n * Whether to show step dots on the slider\n * @default false\n */\n showSteps?: boolean;\n /**\n * The size of the slider\n * @default \"md\"\n */\n size?: 'sm' | 'md' | 'lg';\n /** Content to display at the start of the slider */\n startContent?: ReactNode;\n /**\n * The step value of the slider\n * @default 1\n */\n step?: number;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /**\n * The minimum value of the slider\n * @default 0\n */\n minValue?: number;\n /**\n * The maximum value of the slider\n * @default 100\n */\n maxValue?: number;\n}\n\n/**\n * Slider component based on [HeroUI Slider](https://www.heroui.com//docs/components/slider)\n */\nconst Slider = ({\n className = undefined,\n endContent = undefined,\n fillOffset = undefined,\n name,\n showSteps = false,\n size = 'md',\n startContent = undefined,\n step = 1,\n minValue = 0,\n maxValue = 100,\n ...uniformFieldProps\n}: SliderProps) => {\n const {\n ariaLabel,\n disabled,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n errorMessage,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual slider to forward focus\n const visualSliderRef = useRef<HTMLDivElement>(null);\n\n // classNames from slots\n const variants = sliderVariants();\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // Get the current value, defaulting to minValue if null/undefined\n const currentValue = field.value != null ? Number(field.value) : minValue;\n\n return (\n <div\n className={classNames.base}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n >\n {/* Visually hidden input for form accessibility and focus management */}\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={ariaLabel}\n disabled={disabled}\n max={maxValue}\n min={minValue}\n name={name}\n onBlur={onBlur}\n step={step}\n tabIndex={-1}\n type=\"range\"\n value={currentValue}\n onChange={(e) => {\n onChange(Number(e.target.value));\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual slider to show focus ring\n visualSliderRef.current?.focus();\n }}\n />\n </VisuallyHidden>\n {/* Visual HeroUISlider component */}\n <HeroUISlider\n ref={visualSliderRef}\n aria-label={ariaLabel}\n color={invalid ? 'danger' : 'primary'}\n endContent={endContent}\n fillOffset={fillOffset}\n isDisabled={disabled}\n label={label}\n maxValue={maxValue}\n minValue={minValue}\n name={`${name}_slider`}\n onBlur={onBlur}\n onChange={onChange}\n showSteps={showSteps}\n size={size}\n startContent={startContent}\n step={step}\n value={currentValue}\n classNames={{\n endContent: classNames.endContent,\n filler: classNames.filler,\n label: classNames.label,\n labelWrapper: classNames.labelWrapper,\n mark: classNames.mark,\n startContent: classNames.startContent,\n step: classNames.step,\n thumb: classNames.thumb,\n track: classNames.track,\n trackWrapper: classNames.trackWrapper,\n value: classNames.value,\n }}\n />\n {invalid ? (\n <div\n {...getHelperWrapperProps()}\n className={cn(\n getHelperWrapperProps()?.className,\n // force helper to be visible (for some reason it's hidden by default) and remove margin\n 'ml-0 block',\n )}\n >\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default Slider;\n","import Slider from './Slider';\n\nexport type { SliderProps } from './Slider';\n\nexport { Slider };\n\nexport default Slider;\n"],"mappings":";;;;;;;;;AAYA,MAAa,gDAAoB,EAC/B,OAAO;CACL,MAAM;CACN,YAAY;CACZ,cAAc;CACd,QAAQ;CAGR,OACE;CACF,cAAc;CACd,MAAM;CACN,cAAc;CACd,MAAM;CACN,OAAO;CACP,OAAO;CACP,cAAc;CACd,OAAO;CACR,EACF,CAAC;;;;AAsDF,MAAM,UAAU,EACd,YAAY,QACZ,aAAa,QACb,aAAa,QACb,MACA,YAAY,OACZ,OAAO,MACP,eAAe,QACf,OAAO,GACP,WAAW,GACX,WAAW,KACX,GAAG,wBACc;CACjB,MAAM,EACJ,WACA,UACA,OACA,sBACA,uBACA,SACA,OACA,QACA,UACA,KACA,UACA,cACA,WACEA,wCAAgB;EAClB;EACA,GAAG;EACJ,CAAC;CAGF,MAAM,oCAAyC,KAAK;CAIpD,MAAM,8DADW,gBAAgB,EACiB,WAAW,OAAO;CAGpE,MAAM,eAAe,MAAM,SAAS,OAAO,OAAO,MAAM,MAAM,GAAG;AAEjE,QACE,4CAAC;EACC,WAAW,WAAW;EACtB,gBAAc;EACd,iBAAe;EACf,eAAa;;GAGb,2CAACC,wDACC,2CAAC;IACM;IACL,cAAY;IACF;IACV,KAAK;IACL,KAAK;IACC;IACE;IACF;IACN,UAAU;IACV,MAAK;IACL,OAAO;IACP,WAAW,MAAM;AACf,cAAS,OAAO,EAAE,OAAO,MAAM,CAAC;;IAElC,eAAe;AAGb,qBAAgB,SAAS,OAAO;;KAElC,GACa;GAEjB,2CAACC;IACC,KAAK;IACL,cAAY;IACZ,OAAO,UAAU,WAAW;IAChB;IACA;IACZ,YAAY;IACL;IACG;IACA;IACV,MAAM,GAAG,KAAK;IACN;IACE;IACC;IACL;IACQ;IACR;IACN,OAAO;IACP,YAAY;KACV,YAAY,WAAW;KACvB,QAAQ,WAAW;KACnB,OAAO,WAAW;KAClB,cAAc,WAAW;KACzB,MAAM,WAAW;KACjB,cAAc,WAAW;KACzB,MAAM,WAAW;KACjB,OAAO,WAAW;KAClB,OAAO,WAAW;KAClB,cAAc,WAAW;KACzB,OAAO,WAAW;KACnB;KACD;GACD,UACC,2CAAC;IACC,GAAI,uBAAuB;IAC3B,0CACE,uBAAuB,EAAE,WAEzB,aACD;cAED,2CAAC;KAAI,GAAI,sBAAsB;eAAG;MAAmB;KACjD,GACJ;;GACA;;AAIV,uBAAe;;;;ACzMf,qBAAeC"}
1
+ {"version":3,"file":"Slider-CK9n0ryX.cjs","names":["useUniformField","VisuallyHidden","HeroUISlider","Slider"],"sources":["../src/Slider/Slider.tsx","../src/Slider/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { Slider as HeroUISlider } from '@heroui/slider';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const sliderVariants = tv({\n slots: {\n base: 'group',\n endContent: '',\n errorMessage: 'ml-1 mt-1',\n filler: '',\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 'text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n labelWrapper: '',\n mark: '',\n startContent: '',\n step: '',\n thumb: '',\n track: '',\n trackWrapper: '',\n value: '',\n },\n});\n\ntype VariantProps = TVProps<typeof sliderVariants>;\ntype ClassName = TVClassName<typeof sliderVariants>;\n\nexport interface SliderProps 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 /** input field is disabled */\n disabled?: boolean;\n /** Content to display at the end of the slider */\n endContent?: ReactNode;\n /** The offset from where the fill should start */\n fillOffset?: number;\n /** form field label */\n label?: string;\n /** form field name */\n name: string;\n /**\n * Whether to show step dots on the slider\n * @default false\n */\n showSteps?: boolean;\n /**\n * The size of the slider\n * @default \"md\"\n */\n size?: 'sm' | 'md' | 'lg';\n /** Content to display at the start of the slider */\n startContent?: ReactNode;\n /**\n * The step value of the slider\n * @default 1\n */\n step?: number;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /**\n * The minimum value of the slider\n * @default 0\n */\n minValue?: number;\n /**\n * The maximum value of the slider\n * @default 100\n */\n maxValue?: number;\n}\n\n/**\n * Slider component based on [HeroUI Slider](https://www.heroui.com//docs/components/slider)\n */\nconst Slider = ({\n className = undefined,\n endContent = undefined,\n fillOffset = undefined,\n name,\n showSteps = false,\n size = 'md',\n startContent = undefined,\n step = 1,\n minValue = 0,\n maxValue = 100,\n ...uniformFieldProps\n}: SliderProps) => {\n const {\n ariaLabel,\n disabled,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n errorMessage,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual slider to forward focus\n const visualSliderRef = useRef<HTMLDivElement>(null);\n\n // classNames from slots\n const variants = sliderVariants();\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // Get the current value, defaulting to minValue if null/undefined\n const currentValue = field.value != null ? Number(field.value) : minValue;\n\n return (\n <div\n className={classNames.base}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n >\n {/* Visually hidden input for form accessibility and focus management */}\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={ariaLabel}\n disabled={disabled}\n max={maxValue}\n min={minValue}\n name={name}\n onBlur={onBlur}\n step={step}\n tabIndex={-1}\n type=\"range\"\n value={currentValue}\n onChange={(e) => {\n onChange(Number(e.target.value));\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual slider to show focus ring\n visualSliderRef.current?.focus();\n }}\n />\n </VisuallyHidden>\n {/* Visual HeroUISlider component */}\n <HeroUISlider\n ref={visualSliderRef}\n aria-label={ariaLabel}\n color={invalid ? 'danger' : 'primary'}\n endContent={endContent}\n fillOffset={fillOffset}\n isDisabled={disabled}\n label={label}\n maxValue={maxValue}\n minValue={minValue}\n name={`${name}_slider`}\n onBlur={onBlur}\n onChange={onChange}\n showSteps={showSteps}\n size={size}\n startContent={startContent}\n step={step}\n value={currentValue}\n classNames={{\n endContent: classNames.endContent,\n filler: classNames.filler,\n label: classNames.label,\n labelWrapper: classNames.labelWrapper,\n mark: classNames.mark,\n startContent: classNames.startContent,\n step: classNames.step,\n thumb: classNames.thumb,\n track: classNames.track,\n trackWrapper: classNames.trackWrapper,\n value: classNames.value,\n }}\n />\n {invalid ? (\n <div\n {...getHelperWrapperProps()}\n className={cn(\n getHelperWrapperProps()?.className,\n // force helper to be visible (for some reason it's hidden by default) and remove margin\n 'ml-0 block',\n )}\n >\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default Slider;\n","import Slider from './Slider';\n\nexport type { SliderProps } from './Slider';\n\nexport { Slider };\n\nexport default Slider;\n"],"mappings":";;;;;;;;;AAYA,MAAa,gDAAoB,EAC/B,OAAO;CACL,MAAM;CACN,YAAY;CACZ,cAAc;CACd,QAAQ;CAGR,OACE;CACF,cAAc;CACd,MAAM;CACN,cAAc;CACd,MAAM;CACN,OAAO;CACP,OAAO;CACP,cAAc;CACd,OAAO;CACR,EACF,CAAC;;;;AAsDF,MAAM,UAAU,EACd,YAAY,QACZ,aAAa,QACb,aAAa,QACb,MACA,YAAY,OACZ,OAAO,MACP,eAAe,QACf,OAAO,GACP,WAAW,GACX,WAAW,KACX,GAAG,wBACc;CACjB,MAAM,EACJ,WACA,UACA,OACA,sBACA,uBACA,SACA,OACA,QACA,UACA,KACA,UACA,cACA,WACEA,wCAAgB;EAClB;EACA,GAAG;EACJ,CAAC;CAGF,MAAM,oCAAyC,KAAK;CAIpD,MAAM,8DADW,gBAAgB,EACiB,WAAW,OAAO;CAGpE,MAAM,eAAe,MAAM,SAAS,OAAO,OAAO,MAAM,MAAM,GAAG;AAEjE,QACE,4CAAC;EACC,WAAW,WAAW;EACtB,gBAAc;EACd,iBAAe;EACf,eAAa;;GAGb,2CAACC,wDACC,2CAAC;IACM;IACL,cAAY;IACF;IACV,KAAK;IACL,KAAK;IACC;IACE;IACF;IACN,UAAU;IACV,MAAK;IACL,OAAO;IACP,WAAW,MAAM;AACf,cAAS,OAAO,EAAE,OAAO,MAAM,CAAC;;IAElC,eAAe;AAGb,qBAAgB,SAAS,OAAO;;KAElC,GACa;GAEjB,2CAACC;IACC,KAAK;IACL,cAAY;IACZ,OAAO,UAAU,WAAW;IAChB;IACA;IACZ,YAAY;IACL;IACG;IACA;IACV,MAAM,GAAG,KAAK;IACN;IACE;IACC;IACL;IACQ;IACR;IACN,OAAO;IACP,YAAY;KACV,YAAY,WAAW;KACvB,QAAQ,WAAW;KACnB,OAAO,WAAW;KAClB,cAAc,WAAW;KACzB,MAAM,WAAW;KACjB,cAAc,WAAW;KACzB,MAAM,WAAW;KACjB,OAAO,WAAW;KAClB,OAAO,WAAW;KAClB,cAAc,WAAW;KACzB,OAAO,WAAW;KACnB;KACD;GACD,UACC,2CAAC;IACC,GAAI,uBAAuB;IAC3B,0CACE,uBAAuB,EAAE,WAEzB,aACD;cAED,2CAAC;KAAI,GAAI,sBAAsB;eAAG;MAAmB;KACjD,GACJ;;GACA;;AAIV,uBAAe;;;;ACzMf,qBAAeC"}
@@ -1,4 +1,4 @@
1
- import { t as useUniformField } from "./useUniformField-BKVVns0E.js";
1
+ import { t as useUniformField } from "./useUniformField-D2NgevBI.js";
2
2
  import { cn, tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
3
3
  import { useRef } from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -108,4 +108,4 @@ var Slider_default = Slider_default$1;
108
108
 
109
109
  //#endregion
110
110
  export { Slider_default$1 as n, Slider_default as t };
111
- //# sourceMappingURL=Slider-meuLEC2k.js.map
111
+ //# sourceMappingURL=Slider-Cy5vz5as.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Slider-meuLEC2k.js","names":["Slider","HeroUISlider","Slider"],"sources":["../src/Slider/Slider.tsx","../src/Slider/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { Slider as HeroUISlider } from '@heroui/slider';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const sliderVariants = tv({\n slots: {\n base: 'group',\n endContent: '',\n errorMessage: 'ml-1 mt-1',\n filler: '',\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 'text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n labelWrapper: '',\n mark: '',\n startContent: '',\n step: '',\n thumb: '',\n track: '',\n trackWrapper: '',\n value: '',\n },\n});\n\ntype VariantProps = TVProps<typeof sliderVariants>;\ntype ClassName = TVClassName<typeof sliderVariants>;\n\nexport interface SliderProps 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 /** input field is disabled */\n disabled?: boolean;\n /** Content to display at the end of the slider */\n endContent?: ReactNode;\n /** The offset from where the fill should start */\n fillOffset?: number;\n /** form field label */\n label?: string;\n /** form field name */\n name: string;\n /**\n * Whether to show step dots on the slider\n * @default false\n */\n showSteps?: boolean;\n /**\n * The size of the slider\n * @default \"md\"\n */\n size?: 'sm' | 'md' | 'lg';\n /** Content to display at the start of the slider */\n startContent?: ReactNode;\n /**\n * The step value of the slider\n * @default 1\n */\n step?: number;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /**\n * The minimum value of the slider\n * @default 0\n */\n minValue?: number;\n /**\n * The maximum value of the slider\n * @default 100\n */\n maxValue?: number;\n}\n\n/**\n * Slider component based on [HeroUI Slider](https://www.heroui.com//docs/components/slider)\n */\nconst Slider = ({\n className = undefined,\n endContent = undefined,\n fillOffset = undefined,\n name,\n showSteps = false,\n size = 'md',\n startContent = undefined,\n step = 1,\n minValue = 0,\n maxValue = 100,\n ...uniformFieldProps\n}: SliderProps) => {\n const {\n ariaLabel,\n disabled,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n errorMessage,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual slider to forward focus\n const visualSliderRef = useRef<HTMLDivElement>(null);\n\n // classNames from slots\n const variants = sliderVariants();\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // Get the current value, defaulting to minValue if null/undefined\n const currentValue = field.value != null ? Number(field.value) : minValue;\n\n return (\n <div\n className={classNames.base}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n >\n {/* Visually hidden input for form accessibility and focus management */}\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={ariaLabel}\n disabled={disabled}\n max={maxValue}\n min={minValue}\n name={name}\n onBlur={onBlur}\n step={step}\n tabIndex={-1}\n type=\"range\"\n value={currentValue}\n onChange={(e) => {\n onChange(Number(e.target.value));\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual slider to show focus ring\n visualSliderRef.current?.focus();\n }}\n />\n </VisuallyHidden>\n {/* Visual HeroUISlider component */}\n <HeroUISlider\n ref={visualSliderRef}\n aria-label={ariaLabel}\n color={invalid ? 'danger' : 'primary'}\n endContent={endContent}\n fillOffset={fillOffset}\n isDisabled={disabled}\n label={label}\n maxValue={maxValue}\n minValue={minValue}\n name={`${name}_slider`}\n onBlur={onBlur}\n onChange={onChange}\n showSteps={showSteps}\n size={size}\n startContent={startContent}\n step={step}\n value={currentValue}\n classNames={{\n endContent: classNames.endContent,\n filler: classNames.filler,\n label: classNames.label,\n labelWrapper: classNames.labelWrapper,\n mark: classNames.mark,\n startContent: classNames.startContent,\n step: classNames.step,\n thumb: classNames.thumb,\n track: classNames.track,\n trackWrapper: classNames.trackWrapper,\n value: classNames.value,\n }}\n />\n {invalid ? (\n <div\n {...getHelperWrapperProps()}\n className={cn(\n getHelperWrapperProps()?.className,\n // force helper to be visible (for some reason it's hidden by default) and remove margin\n 'ml-0 block',\n )}\n >\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default Slider;\n","import Slider from './Slider';\n\nexport type { SliderProps } from './Slider';\n\nexport { Slider };\n\nexport default Slider;\n"],"mappings":";;;;;;;;AAYA,MAAa,iBAAiB,GAAG,EAC/B,OAAO;CACL,MAAM;CACN,YAAY;CACZ,cAAc;CACd,QAAQ;CAGR,OACE;CACF,cAAc;CACd,MAAM;CACN,cAAc;CACd,MAAM;CACN,OAAO;CACP,OAAO;CACP,cAAc;CACd,OAAO;CACR,EACF,CAAC;;;;AAsDF,MAAMA,YAAU,EACd,YAAY,QACZ,aAAa,QACb,aAAa,QACb,MACA,YAAY,OACZ,OAAO,MACP,eAAe,QACf,OAAO,GACP,WAAW,GACX,WAAW,KACX,GAAG,wBACc;CACjB,MAAM,EACJ,WACA,UACA,OACA,sBACA,uBACA,SACA,OACA,QACA,UACA,KACA,UACA,cACA,WACE,gBAAgB;EAClB;EACA,GAAG;EACJ,CAAC;CAGF,MAAM,kBAAkB,OAAuB,KAAK;CAIpD,MAAM,aAAa,qBADF,gBAAgB,EACiB,WAAW,OAAO;CAGpE,MAAM,eAAe,MAAM,SAAS,OAAO,OAAO,MAAM,MAAM,GAAG;AAEjE,QACE,qBAAC;EACC,WAAW,WAAW;EACtB,gBAAc;EACd,iBAAe;EACf,eAAa;;GAGb,oBAAC,4BACC,oBAAC;IACM;IACL,cAAY;IACF;IACV,KAAK;IACL,KAAK;IACC;IACE;IACF;IACN,UAAU;IACV,MAAK;IACL,OAAO;IACP,WAAW,MAAM;AACf,cAAS,OAAO,EAAE,OAAO,MAAM,CAAC;;IAElC,eAAe;AAGb,qBAAgB,SAAS,OAAO;;KAElC,GACa;GAEjB,oBAACC;IACC,KAAK;IACL,cAAY;IACZ,OAAO,UAAU,WAAW;IAChB;IACA;IACZ,YAAY;IACL;IACG;IACA;IACV,MAAM,GAAG,KAAK;IACN;IACE;IACC;IACL;IACQ;IACR;IACN,OAAO;IACP,YAAY;KACV,YAAY,WAAW;KACvB,QAAQ,WAAW;KACnB,OAAO,WAAW;KAClB,cAAc,WAAW;KACzB,MAAM,WAAW;KACjB,cAAc,WAAW;KACzB,MAAM,WAAW;KACjB,OAAO,WAAW;KAClB,OAAO,WAAW;KAClB,cAAc,WAAW;KACzB,OAAO,WAAW;KACnB;KACD;GACD,UACC,oBAAC;IACC,GAAI,uBAAuB;IAC3B,WAAW,GACT,uBAAuB,EAAE,WAEzB,aACD;cAED,oBAAC;KAAI,GAAI,sBAAsB;eAAG;MAAmB;KACjD,GACJ;;GACA;;AAIV,uBAAeD;;;;ACzMf,qBAAeE"}
1
+ {"version":3,"file":"Slider-Cy5vz5as.js","names":["Slider","HeroUISlider","Slider"],"sources":["../src/Slider/Slider.tsx","../src/Slider/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { Slider as HeroUISlider } from '@heroui/slider';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const sliderVariants = tv({\n slots: {\n base: 'group',\n endContent: '',\n errorMessage: 'ml-1 mt-1',\n filler: '',\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 'text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n labelWrapper: '',\n mark: '',\n startContent: '',\n step: '',\n thumb: '',\n track: '',\n trackWrapper: '',\n value: '',\n },\n});\n\ntype VariantProps = TVProps<typeof sliderVariants>;\ntype ClassName = TVClassName<typeof sliderVariants>;\n\nexport interface SliderProps 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 /** input field is disabled */\n disabled?: boolean;\n /** Content to display at the end of the slider */\n endContent?: ReactNode;\n /** The offset from where the fill should start */\n fillOffset?: number;\n /** form field label */\n label?: string;\n /** form field name */\n name: string;\n /**\n * Whether to show step dots on the slider\n * @default false\n */\n showSteps?: boolean;\n /**\n * The size of the slider\n * @default \"md\"\n */\n size?: 'sm' | 'md' | 'lg';\n /** Content to display at the start of the slider */\n startContent?: ReactNode;\n /**\n * The step value of the slider\n * @default 1\n */\n step?: number;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /**\n * The minimum value of the slider\n * @default 0\n */\n minValue?: number;\n /**\n * The maximum value of the slider\n * @default 100\n */\n maxValue?: number;\n}\n\n/**\n * Slider component based on [HeroUI Slider](https://www.heroui.com//docs/components/slider)\n */\nconst Slider = ({\n className = undefined,\n endContent = undefined,\n fillOffset = undefined,\n name,\n showSteps = false,\n size = 'md',\n startContent = undefined,\n step = 1,\n minValue = 0,\n maxValue = 100,\n ...uniformFieldProps\n}: SliderProps) => {\n const {\n ariaLabel,\n disabled,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n errorMessage,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual slider to forward focus\n const visualSliderRef = useRef<HTMLDivElement>(null);\n\n // classNames from slots\n const variants = sliderVariants();\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // Get the current value, defaulting to minValue if null/undefined\n const currentValue = field.value != null ? Number(field.value) : minValue;\n\n return (\n <div\n className={classNames.base}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n >\n {/* Visually hidden input for form accessibility and focus management */}\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={ariaLabel}\n disabled={disabled}\n max={maxValue}\n min={minValue}\n name={name}\n onBlur={onBlur}\n step={step}\n tabIndex={-1}\n type=\"range\"\n value={currentValue}\n onChange={(e) => {\n onChange(Number(e.target.value));\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual slider to show focus ring\n visualSliderRef.current?.focus();\n }}\n />\n </VisuallyHidden>\n {/* Visual HeroUISlider component */}\n <HeroUISlider\n ref={visualSliderRef}\n aria-label={ariaLabel}\n color={invalid ? 'danger' : 'primary'}\n endContent={endContent}\n fillOffset={fillOffset}\n isDisabled={disabled}\n label={label}\n maxValue={maxValue}\n minValue={minValue}\n name={`${name}_slider`}\n onBlur={onBlur}\n onChange={onChange}\n showSteps={showSteps}\n size={size}\n startContent={startContent}\n step={step}\n value={currentValue}\n classNames={{\n endContent: classNames.endContent,\n filler: classNames.filler,\n label: classNames.label,\n labelWrapper: classNames.labelWrapper,\n mark: classNames.mark,\n startContent: classNames.startContent,\n step: classNames.step,\n thumb: classNames.thumb,\n track: classNames.track,\n trackWrapper: classNames.trackWrapper,\n value: classNames.value,\n }}\n />\n {invalid ? (\n <div\n {...getHelperWrapperProps()}\n className={cn(\n getHelperWrapperProps()?.className,\n // force helper to be visible (for some reason it's hidden by default) and remove margin\n 'ml-0 block',\n )}\n >\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default Slider;\n","import Slider from './Slider';\n\nexport type { SliderProps } from './Slider';\n\nexport { Slider };\n\nexport default Slider;\n"],"mappings":";;;;;;;;AAYA,MAAa,iBAAiB,GAAG,EAC/B,OAAO;CACL,MAAM;CACN,YAAY;CACZ,cAAc;CACd,QAAQ;CAGR,OACE;CACF,cAAc;CACd,MAAM;CACN,cAAc;CACd,MAAM;CACN,OAAO;CACP,OAAO;CACP,cAAc;CACd,OAAO;CACR,EACF,CAAC;;;;AAsDF,MAAMA,YAAU,EACd,YAAY,QACZ,aAAa,QACb,aAAa,QACb,MACA,YAAY,OACZ,OAAO,MACP,eAAe,QACf,OAAO,GACP,WAAW,GACX,WAAW,KACX,GAAG,wBACc;CACjB,MAAM,EACJ,WACA,UACA,OACA,sBACA,uBACA,SACA,OACA,QACA,UACA,KACA,UACA,cACA,WACE,gBAAgB;EAClB;EACA,GAAG;EACJ,CAAC;CAGF,MAAM,kBAAkB,OAAuB,KAAK;CAIpD,MAAM,aAAa,qBADF,gBAAgB,EACiB,WAAW,OAAO;CAGpE,MAAM,eAAe,MAAM,SAAS,OAAO,OAAO,MAAM,MAAM,GAAG;AAEjE,QACE,qBAAC;EACC,WAAW,WAAW;EACtB,gBAAc;EACd,iBAAe;EACf,eAAa;;GAGb,oBAAC,4BACC,oBAAC;IACM;IACL,cAAY;IACF;IACV,KAAK;IACL,KAAK;IACC;IACE;IACF;IACN,UAAU;IACV,MAAK;IACL,OAAO;IACP,WAAW,MAAM;AACf,cAAS,OAAO,EAAE,OAAO,MAAM,CAAC;;IAElC,eAAe;AAGb,qBAAgB,SAAS,OAAO;;KAElC,GACa;GAEjB,oBAACC;IACC,KAAK;IACL,cAAY;IACZ,OAAO,UAAU,WAAW;IAChB;IACA;IACZ,YAAY;IACL;IACG;IACA;IACV,MAAM,GAAG,KAAK;IACN;IACE;IACC;IACL;IACQ;IACR;IACN,OAAO;IACP,YAAY;KACV,YAAY,WAAW;KACvB,QAAQ,WAAW;KACnB,OAAO,WAAW;KAClB,cAAc,WAAW;KACzB,MAAM,WAAW;KACjB,cAAc,WAAW;KACzB,MAAM,WAAW;KACjB,OAAO,WAAW;KAClB,OAAO,WAAW;KAClB,cAAc,WAAW;KACzB,OAAO,WAAW;KACnB;KACD;GACD,UACC,oBAAC;IACC,GAAI,uBAAuB;IAC3B,WAAW,GACT,uBAAuB,EAAE,WAEzB,aACD;cAED,oBAAC;KAAI,GAAI,sBAAsB;eAAG;MAAmB;KACjD,GACJ;;GACA;;AAIV,uBAAeD;;;;ACzMf,qBAAeE"}
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- const require_SubmitButton = require('../SubmitButton-B0kvUqkd.cjs');
2
+ const require_SubmitButton = require('../SubmitButton-C6sgPR8K.cjs');
3
3
 
4
4
  exports.SubmitButton = require_SubmitButton.SubmitButton_default$1;
5
5
  exports.default = require_SubmitButton.SubmitButton_default;
@@ -1,2 +1,2 @@
1
- import { n as SubmitButtonProps, t as SubmitButton } from "../index-cadUZZIY.cjs";
1
+ import { n as SubmitButtonProps, t as SubmitButton } from "../index-Bd7H1tdb.cjs";
2
2
  export { SubmitButton, SubmitButton as default, SubmitButtonProps };
@@ -1,2 +1,2 @@
1
- import { n as SubmitButtonProps, t as SubmitButton } from "../index-CHXv_rNR.js";
1
+ import { n as SubmitButtonProps, t as SubmitButton } from "../index-CVY05bZf.js";
2
2
  export { SubmitButton, SubmitButton as default, SubmitButtonProps };
@@ -1,3 +1,3 @@
1
- import { n as SubmitButton_default, t as SubmitButton_default$1 } from "../SubmitButton-BHP9J9ml.js";
1
+ import { n as SubmitButton_default, t as SubmitButton_default$1 } from "../SubmitButton-BrbHJcb4.js";
2
2
 
3
3
  export { SubmitButton_default as SubmitButton, SubmitButton_default$1 as default };
@@ -1,4 +1,4 @@
1
- import { n as useFormContext } from "./useFormContext-BFoXZNkp.js";
1
+ import { n as useFormContext } from "./useFormContext-UFBqUfOr.js";
2
2
  import { cn, slugify } from "@fuf-stack/pixel-utils";
3
3
  import { Button } from "@fuf-stack/pixels";
4
4
  import { jsx } from "react/jsx-runtime";
@@ -31,4 +31,4 @@ var SubmitButton_default = SubmitButton_default$1;
31
31
 
32
32
  //#endregion
33
33
  export { SubmitButton_default$1 as n, SubmitButton_default as t };
34
- //# sourceMappingURL=SubmitButton-BHP9J9ml.js.map
34
+ //# sourceMappingURL=SubmitButton-BrbHJcb4.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SubmitButton-BHP9J9ml.js","names":["SubmitButton"],"sources":["../src/SubmitButton/SubmitButton.tsx","../src/SubmitButton/index.ts"],"sourcesContent":["import type { ButtonProps } from '@fuf-stack/pixels';\nimport type { ReactNode } from 'react';\n\nimport { cn, slugify } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\nimport { useFormContext } from '../hooks/useFormContext';\n\nexport interface SubmitButtonProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** child components */\n children?: ReactNode;\n /** CSS class name */\n className?: string;\n /** color of the submit button */\n color?: ButtonProps['color'];\n /** icon of the submit button */\n icon?: ButtonProps['icon'];\n /** If set loading animation is shown */\n loading?: boolean;\n /** size of the submit button */\n size?: ButtonProps['size'];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * From SubmitButton\n */\nconst SubmitButton = ({\n ariaLabel = 'Submit form',\n children = 'Submit',\n className = undefined,\n color = 'success',\n icon = undefined,\n loading = false,\n size = 'md',\n testId = 'form_submit_button',\n}: SubmitButtonProps) => {\n const {\n formState: { isSubmitting },\n triggerSubmit,\n } = useFormContext();\n\n return (\n <Button\n ariaLabel={ariaLabel}\n className={cn(className)}\n color={color}\n disabled={isSubmitting}\n icon={icon}\n loading={loading || isSubmitting}\n // @ts-expect-error we use form context triggerSubmit\n // here so that submit button also works in special\n // scenarios (e.g. when used in modal)\n onClick={triggerSubmit}\n size={size}\n testId={slugify(testId, { replaceDots: true })}\n type=\"submit\"\n >\n {children}\n </Button>\n );\n};\n\nexport default SubmitButton;\n","import SubmitButton from './SubmitButton';\n\nexport type { SubmitButtonProps } from './SubmitButton';\n\nexport { SubmitButton };\n\nexport default SubmitButton;\n"],"mappings":";;;;;;;;;AA8BA,MAAM,gBAAgB,EACpB,YAAY,eACZ,WAAW,UACX,YAAY,QACZ,QAAQ,WACR,OAAO,QACP,UAAU,OACV,OAAO,MACP,SAAS,2BACc;CACvB,MAAM,EACJ,WAAW,EAAE,gBACb,kBACE,gBAAgB;AAEpB,QACE,oBAAC;EACY;EACX,WAAW,GAAG,UAAU;EACjB;EACP,UAAU;EACJ;EACN,SAAS,WAAW;EAIpB,SAAS;EACH;EACN,QAAQ,QAAQ,QAAQ,EAAE,aAAa,MAAM,CAAC;EAC9C,MAAK;EAEJ;GACM;;AAIb,6BAAe;;;;AC5Df,2BAAeA"}
1
+ {"version":3,"file":"SubmitButton-BrbHJcb4.js","names":["SubmitButton"],"sources":["../src/SubmitButton/SubmitButton.tsx","../src/SubmitButton/index.ts"],"sourcesContent":["import type { ButtonProps } from '@fuf-stack/pixels';\nimport type { ReactNode } from 'react';\n\nimport { cn, slugify } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\nimport { useFormContext } from '../hooks/useFormContext';\n\nexport interface SubmitButtonProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** child components */\n children?: ReactNode;\n /** CSS class name */\n className?: string;\n /** color of the submit button */\n color?: ButtonProps['color'];\n /** icon of the submit button */\n icon?: ButtonProps['icon'];\n /** If set loading animation is shown */\n loading?: boolean;\n /** size of the submit button */\n size?: ButtonProps['size'];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * From SubmitButton\n */\nconst SubmitButton = ({\n ariaLabel = 'Submit form',\n children = 'Submit',\n className = undefined,\n color = 'success',\n icon = undefined,\n loading = false,\n size = 'md',\n testId = 'form_submit_button',\n}: SubmitButtonProps) => {\n const {\n formState: { isSubmitting },\n triggerSubmit,\n } = useFormContext();\n\n return (\n <Button\n ariaLabel={ariaLabel}\n className={cn(className)}\n color={color}\n disabled={isSubmitting}\n icon={icon}\n loading={loading || isSubmitting}\n // @ts-expect-error we use form context triggerSubmit\n // here so that submit button also works in special\n // scenarios (e.g. when used in modal)\n onClick={triggerSubmit}\n size={size}\n testId={slugify(testId, { replaceDots: true })}\n type=\"submit\"\n >\n {children}\n </Button>\n );\n};\n\nexport default SubmitButton;\n","import SubmitButton from './SubmitButton';\n\nexport type { SubmitButtonProps } from './SubmitButton';\n\nexport { SubmitButton };\n\nexport default SubmitButton;\n"],"mappings":";;;;;;;;;AA8BA,MAAM,gBAAgB,EACpB,YAAY,eACZ,WAAW,UACX,YAAY,QACZ,QAAQ,WACR,OAAO,QACP,UAAU,OACV,OAAO,MACP,SAAS,2BACc;CACvB,MAAM,EACJ,WAAW,EAAE,gBACb,kBACE,gBAAgB;AAEpB,QACE,oBAAC;EACY;EACX,WAAW,GAAG,UAAU;EACjB;EACP,UAAU;EACJ;EACN,SAAS,WAAW;EAIpB,SAAS;EACH;EACN,QAAQ,QAAQ,QAAQ,EAAE,aAAa,MAAM,CAAC;EAC9C,MAAK;EAEJ;GACM;;AAIb,6BAAe;;;;AC5Df,2BAAeA"}
@@ -1,5 +1,5 @@
1
- const require_FormContext = require('./FormContext-Lw4YL4-B.cjs');
2
- const require_useFormContext = require('./useFormContext-CEr3zcL6.cjs');
1
+ const require_FormContext = require('./FormContext-CeFKQmVH.cjs');
2
+ const require_useFormContext = require('./useFormContext-DJiJlfGJ.cjs');
3
3
  let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
4
4
  let _fuf_stack_pixels = require("@fuf-stack/pixels");
5
5
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -43,4 +43,4 @@ Object.defineProperty(exports, 'SubmitButton_default$1', {
43
43
  return SubmitButton_default$1;
44
44
  }
45
45
  });
46
- //# sourceMappingURL=SubmitButton-B0kvUqkd.cjs.map
46
+ //# sourceMappingURL=SubmitButton-C6sgPR8K.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"SubmitButton-B0kvUqkd.cjs","names":["useFormContext","Button","SubmitButton"],"sources":["../src/SubmitButton/SubmitButton.tsx","../src/SubmitButton/index.ts"],"sourcesContent":["import type { ButtonProps } from '@fuf-stack/pixels';\nimport type { ReactNode } from 'react';\n\nimport { cn, slugify } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\nimport { useFormContext } from '../hooks/useFormContext';\n\nexport interface SubmitButtonProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** child components */\n children?: ReactNode;\n /** CSS class name */\n className?: string;\n /** color of the submit button */\n color?: ButtonProps['color'];\n /** icon of the submit button */\n icon?: ButtonProps['icon'];\n /** If set loading animation is shown */\n loading?: boolean;\n /** size of the submit button */\n size?: ButtonProps['size'];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * From SubmitButton\n */\nconst SubmitButton = ({\n ariaLabel = 'Submit form',\n children = 'Submit',\n className = undefined,\n color = 'success',\n icon = undefined,\n loading = false,\n size = 'md',\n testId = 'form_submit_button',\n}: SubmitButtonProps) => {\n const {\n formState: { isSubmitting },\n triggerSubmit,\n } = useFormContext();\n\n return (\n <Button\n ariaLabel={ariaLabel}\n className={cn(className)}\n color={color}\n disabled={isSubmitting}\n icon={icon}\n loading={loading || isSubmitting}\n // @ts-expect-error we use form context triggerSubmit\n // here so that submit button also works in special\n // scenarios (e.g. when used in modal)\n onClick={triggerSubmit}\n size={size}\n testId={slugify(testId, { replaceDots: true })}\n type=\"submit\"\n >\n {children}\n </Button>\n );\n};\n\nexport default SubmitButton;\n","import SubmitButton from './SubmitButton';\n\nexport type { SubmitButtonProps } from './SubmitButton';\n\nexport { SubmitButton };\n\nexport default SubmitButton;\n"],"mappings":";;;;;;;;;;AA8BA,MAAM,gBAAgB,EACpB,YAAY,eACZ,WAAW,UACX,YAAY,QACZ,QAAQ,WACR,OAAO,QACP,UAAU,OACV,OAAO,MACP,SAAS,2BACc;CACvB,MAAM,EACJ,WAAW,EAAE,gBACb,kBACEA,uCAAgB;AAEpB,QACE,2CAACC;EACY;EACX,0CAAc,UAAU;EACjB;EACP,UAAU;EACJ;EACN,SAAS,WAAW;EAIpB,SAAS;EACH;EACN,4CAAgB,QAAQ,EAAE,aAAa,MAAM,CAAC;EAC9C,MAAK;EAEJ;GACM;;AAIb,6BAAe;;;;AC5Df,2BAAeC"}
1
+ {"version":3,"file":"SubmitButton-C6sgPR8K.cjs","names":["useFormContext","Button","SubmitButton"],"sources":["../src/SubmitButton/SubmitButton.tsx","../src/SubmitButton/index.ts"],"sourcesContent":["import type { ButtonProps } from '@fuf-stack/pixels';\nimport type { ReactNode } from 'react';\n\nimport { cn, slugify } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\nimport { useFormContext } from '../hooks/useFormContext';\n\nexport interface SubmitButtonProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** child components */\n children?: ReactNode;\n /** CSS class name */\n className?: string;\n /** color of the submit button */\n color?: ButtonProps['color'];\n /** icon of the submit button */\n icon?: ButtonProps['icon'];\n /** If set loading animation is shown */\n loading?: boolean;\n /** size of the submit button */\n size?: ButtonProps['size'];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * From SubmitButton\n */\nconst SubmitButton = ({\n ariaLabel = 'Submit form',\n children = 'Submit',\n className = undefined,\n color = 'success',\n icon = undefined,\n loading = false,\n size = 'md',\n testId = 'form_submit_button',\n}: SubmitButtonProps) => {\n const {\n formState: { isSubmitting },\n triggerSubmit,\n } = useFormContext();\n\n return (\n <Button\n ariaLabel={ariaLabel}\n className={cn(className)}\n color={color}\n disabled={isSubmitting}\n icon={icon}\n loading={loading || isSubmitting}\n // @ts-expect-error we use form context triggerSubmit\n // here so that submit button also works in special\n // scenarios (e.g. when used in modal)\n onClick={triggerSubmit}\n size={size}\n testId={slugify(testId, { replaceDots: true })}\n type=\"submit\"\n >\n {children}\n </Button>\n );\n};\n\nexport default SubmitButton;\n","import SubmitButton from './SubmitButton';\n\nexport type { SubmitButtonProps } from './SubmitButton';\n\nexport { SubmitButton };\n\nexport default SubmitButton;\n"],"mappings":";;;;;;;;;;AA8BA,MAAM,gBAAgB,EACpB,YAAY,eACZ,WAAW,UACX,YAAY,QACZ,QAAQ,WACR,OAAO,QACP,UAAU,OACV,OAAO,MACP,SAAS,2BACc;CACvB,MAAM,EACJ,WAAW,EAAE,gBACb,kBACEA,uCAAgB;AAEpB,QACE,2CAACC;EACY;EACX,0CAAc,UAAU;EACjB;EACP,UAAU;EACJ;EACN,SAAS,WAAW;EAIpB,SAAS;EACH;EACN,4CAAgB,QAAQ,EAAE,aAAa,MAAM,CAAC;EAC9C,MAAK;EAEJ;GACM;;AAIb,6BAAe;;;;AC5Df,2BAAeC"}
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- const require_Switch = require('../Switch-Ds0gDzjR.cjs');
2
+ const require_Switch = require('../Switch-BBhxgBHh.cjs');
3
3
 
4
4
  exports.Switch = require_Switch.Switch_default$1;
5
5
  exports.default = require_Switch.Switch_default;
@@ -1,2 +1,2 @@
1
- import { n as SwitchProps, t as Switch } from "../index-CqGabrzW.cjs";
1
+ import { n as SwitchProps, t as Switch } from "../index-DCZwOjSs.cjs";
2
2
  export { Switch, Switch as default, SwitchProps };
@@ -1,2 +1,2 @@
1
- import { n as SwitchProps, t as Switch } from "../index-yVkU2v6b.js";
1
+ import { n as SwitchProps, t as Switch } from "../index-D3o2YTBb.js";
2
2
  export { Switch, Switch as default, SwitchProps };
@@ -1,3 +1,3 @@
1
- import { n as Switch_default, t as Switch_default$1 } from "../Switch-DkciIYnD.js";
1
+ import { n as Switch_default, t as Switch_default$1 } from "../Switch-s64WUP5i.js";
2
2
 
3
3
  export { Switch_default as Switch, Switch_default$1 as default };
@@ -1,5 +1,5 @@
1
- const require_FormContext = require('./FormContext-Lw4YL4-B.cjs');
2
- const require_useUniformField = require('./useUniformField-D6fwSjrH.cjs');
1
+ const require_FormContext = require('./FormContext-CeFKQmVH.cjs');
2
+ const require_useUniformField = require('./useUniformField-CGiibqg4.cjs');
3
3
  let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
4
4
  let react = require("react");
5
5
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -93,4 +93,4 @@ Object.defineProperty(exports, 'Switch_default$1', {
93
93
  return Switch_default$1;
94
94
  }
95
95
  });
96
- //# sourceMappingURL=Switch-Ds0gDzjR.cjs.map
96
+ //# sourceMappingURL=Switch-BBhxgBHh.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Switch-Ds0gDzjR.cjs","names":["useUniformField","VisuallyHidden","HeroSwitch","Switch"],"sources":["../src/Switch/Switch.tsx","../src/Switch/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { SwitchProps as HeroSwitchProps } from '@heroui/switch';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { Switch as HeroSwitch } from '@heroui/switch';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const switchVariants = tv({\n slots: {\n base: '',\n endContent: '',\n errorMessage: 'ml-1 mt-1',\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 'text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n outerWrapper: 'place-content-center',\n startContent: '',\n thumb: '',\n thumbIcon: '',\n wrapper: '',\n },\n});\n\ntype VariantProps = TVProps<typeof switchVariants>;\ntype ClassName = TVClassName<typeof switchVariants>;\n\nexport interface SwitchProps 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 /** whether the select should be disabled */\n disabled?: boolean;\n /** Icon to be displayed at the end of the switch (when enabled) */\n endContent?: ReactNode;\n /** component displayed next to the switch */\n label?: ReactNode;\n /** name the field is registered under */\n name: string;\n /* Size of the switch */\n size?: 'sm' | 'md' | 'lg';\n /** Icon to be displayed at the start of the switch (when disabled) */\n startContent?: ReactNode;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Icon to be displayed inside the thumb */\n thumbIcon?: HeroSwitchProps['thumbIcon'];\n}\n\n/**\n * Switch component based on [HeroUI Switch](https://www.heroui.com//docs/components/switch)\n */\nconst Switch = ({\n className = undefined,\n endContent = undefined,\n name,\n size = undefined,\n startContent = undefined,\n thumbIcon = undefined,\n ...uniformFieldProps\n}: SwitchProps) => {\n const {\n ariaLabel,\n defaultValue,\n disabled,\n errorMessage,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual switch to forward focus\n const visualSwitchRef = useRef<HTMLInputElement>(null);\n\n // classNames from slots\n const variants = switchVariants();\n const classNames = variantsToClassNames(variants, className, 'outerWrapper');\n\n return (\n <div className={classNames.outerWrapper}>\n {/* Visually hidden input for form accessibility and focus management */}\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={ariaLabel}\n checked={!!field.value}\n name={name}\n onBlur={onBlur}\n type=\"checkbox\"\n onChange={(e) => {\n onChange(e.target.checked);\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual switch to show focus ring\n visualSwitchRef.current?.focus();\n }}\n />\n </VisuallyHidden>\n {/* Visual HeroSwitch component */}\n <HeroSwitch\n ref={visualSwitchRef}\n aria-label={ariaLabel}\n classNames={classNames}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n defaultSelected={!!defaultValue}\n endContent={endContent}\n isDisabled={disabled}\n isSelected={!!field.value}\n name={`${name}_switch`}\n onValueChange={onChange}\n size={size}\n startContent={startContent}\n thumbIcon={thumbIcon}\n >\n {label}\n </HeroSwitch>\n {invalid ? (\n <div\n {...getHelperWrapperProps()}\n className={cn(\n getHelperWrapperProps()?.className,\n // force helper to be visible (for some reason it's hidden by default) and remove margin\n 'ml-0 block',\n )}\n >\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default Switch;\n","import Switch from './Switch';\n\nexport type { SwitchProps } from './Switch';\n\nexport { Switch };\n\nexport default Switch;\n"],"mappings":";;;;;;;;;AAaA,MAAa,gDAAoB,EAC/B,OAAO;CACL,MAAM;CACN,YAAY;CACZ,cAAc;CAGd,OACE;CACF,cAAc;CACd,cAAc;CACd,OAAO;CACP,WAAW;CACX,SAAS;CACV,EACF,CAAC;;;;AA+BF,MAAM,UAAU,EACd,YAAY,QACZ,aAAa,QACb,MACA,OAAO,QACP,eAAe,QACf,YAAY,QACZ,GAAG,wBACc;CACjB,MAAM,EACJ,WACA,cACA,UACA,cACA,OACA,sBACA,uBACA,SACA,OACA,QACA,UACA,KACA,UACA,WACEA,wCAAgB;EAClB;EACA,GAAG;EACJ,CAAC;CAGF,MAAM,oCAA2C,KAAK;CAItD,MAAM,8DADW,gBAAgB,EACiB,WAAW,eAAe;AAE5E,QACE,4CAAC;EAAI,WAAW,WAAW;;GAEzB,2CAACC,wDACC,2CAAC;IACM;IACL,cAAY;IACZ,SAAS,CAAC,CAAC,MAAM;IACX;IACE;IACR,MAAK;IACL,WAAW,MAAM;AACf,cAAS,EAAE,OAAO,QAAQ;;IAE5B,eAAe;AAGb,qBAAgB,SAAS,OAAO;;KAElC,GACa;GAEjB,2CAACC;IACC,KAAK;IACL,cAAY;IACA;IACZ,gBAAc;IACd,iBAAe;IACf,eAAa;IACb,iBAAiB,CAAC,CAAC;IACP;IACZ,YAAY;IACZ,YAAY,CAAC,CAAC,MAAM;IACpB,MAAM,GAAG,KAAK;IACd,eAAe;IACT;IACQ;IACH;cAEV;KACU;GACZ,UACC,2CAAC;IACC,GAAI,uBAAuB;IAC3B,0CACE,uBAAuB,EAAE,WAEzB,aACD;cAED,2CAAC;KAAI,GAAI,sBAAsB;eAAG;MAAmB;KACjD,GACJ;;GACA;;AAIV,uBAAe;;;;AClJf,qBAAeC"}
1
+ {"version":3,"file":"Switch-BBhxgBHh.cjs","names":["useUniformField","VisuallyHidden","HeroSwitch","Switch"],"sources":["../src/Switch/Switch.tsx","../src/Switch/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { SwitchProps as HeroSwitchProps } from '@heroui/switch';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { Switch as HeroSwitch } from '@heroui/switch';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const switchVariants = tv({\n slots: {\n base: '',\n endContent: '',\n errorMessage: 'ml-1 mt-1',\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 'text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n outerWrapper: 'place-content-center',\n startContent: '',\n thumb: '',\n thumbIcon: '',\n wrapper: '',\n },\n});\n\ntype VariantProps = TVProps<typeof switchVariants>;\ntype ClassName = TVClassName<typeof switchVariants>;\n\nexport interface SwitchProps 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 /** whether the select should be disabled */\n disabled?: boolean;\n /** Icon to be displayed at the end of the switch (when enabled) */\n endContent?: ReactNode;\n /** component displayed next to the switch */\n label?: ReactNode;\n /** name the field is registered under */\n name: string;\n /* Size of the switch */\n size?: 'sm' | 'md' | 'lg';\n /** Icon to be displayed at the start of the switch (when disabled) */\n startContent?: ReactNode;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Icon to be displayed inside the thumb */\n thumbIcon?: HeroSwitchProps['thumbIcon'];\n}\n\n/**\n * Switch component based on [HeroUI Switch](https://www.heroui.com//docs/components/switch)\n */\nconst Switch = ({\n className = undefined,\n endContent = undefined,\n name,\n size = undefined,\n startContent = undefined,\n thumbIcon = undefined,\n ...uniformFieldProps\n}: SwitchProps) => {\n const {\n ariaLabel,\n defaultValue,\n disabled,\n errorMessage,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual switch to forward focus\n const visualSwitchRef = useRef<HTMLInputElement>(null);\n\n // classNames from slots\n const variants = switchVariants();\n const classNames = variantsToClassNames(variants, className, 'outerWrapper');\n\n return (\n <div className={classNames.outerWrapper}>\n {/* Visually hidden input for form accessibility and focus management */}\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={ariaLabel}\n checked={!!field.value}\n name={name}\n onBlur={onBlur}\n type=\"checkbox\"\n onChange={(e) => {\n onChange(e.target.checked);\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual switch to show focus ring\n visualSwitchRef.current?.focus();\n }}\n />\n </VisuallyHidden>\n {/* Visual HeroSwitch component */}\n <HeroSwitch\n ref={visualSwitchRef}\n aria-label={ariaLabel}\n classNames={classNames}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n defaultSelected={!!defaultValue}\n endContent={endContent}\n isDisabled={disabled}\n isSelected={!!field.value}\n name={`${name}_switch`}\n onValueChange={onChange}\n size={size}\n startContent={startContent}\n thumbIcon={thumbIcon}\n >\n {label}\n </HeroSwitch>\n {invalid ? (\n <div\n {...getHelperWrapperProps()}\n className={cn(\n getHelperWrapperProps()?.className,\n // force helper to be visible (for some reason it's hidden by default) and remove margin\n 'ml-0 block',\n )}\n >\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default Switch;\n","import Switch from './Switch';\n\nexport type { SwitchProps } from './Switch';\n\nexport { Switch };\n\nexport default Switch;\n"],"mappings":";;;;;;;;;AAaA,MAAa,gDAAoB,EAC/B,OAAO;CACL,MAAM;CACN,YAAY;CACZ,cAAc;CAGd,OACE;CACF,cAAc;CACd,cAAc;CACd,OAAO;CACP,WAAW;CACX,SAAS;CACV,EACF,CAAC;;;;AA+BF,MAAM,UAAU,EACd,YAAY,QACZ,aAAa,QACb,MACA,OAAO,QACP,eAAe,QACf,YAAY,QACZ,GAAG,wBACc;CACjB,MAAM,EACJ,WACA,cACA,UACA,cACA,OACA,sBACA,uBACA,SACA,OACA,QACA,UACA,KACA,UACA,WACEA,wCAAgB;EAClB;EACA,GAAG;EACJ,CAAC;CAGF,MAAM,oCAA2C,KAAK;CAItD,MAAM,8DADW,gBAAgB,EACiB,WAAW,eAAe;AAE5E,QACE,4CAAC;EAAI,WAAW,WAAW;;GAEzB,2CAACC,wDACC,2CAAC;IACM;IACL,cAAY;IACZ,SAAS,CAAC,CAAC,MAAM;IACX;IACE;IACR,MAAK;IACL,WAAW,MAAM;AACf,cAAS,EAAE,OAAO,QAAQ;;IAE5B,eAAe;AAGb,qBAAgB,SAAS,OAAO;;KAElC,GACa;GAEjB,2CAACC;IACC,KAAK;IACL,cAAY;IACA;IACZ,gBAAc;IACd,iBAAe;IACf,eAAa;IACb,iBAAiB,CAAC,CAAC;IACP;IACZ,YAAY;IACZ,YAAY,CAAC,CAAC,MAAM;IACpB,MAAM,GAAG,KAAK;IACd,eAAe;IACT;IACQ;IACH;cAEV;KACU;GACZ,UACC,2CAAC;IACC,GAAI,uBAAuB;IAC3B,0CACE,uBAAuB,EAAE,WAEzB,aACD;cAED,2CAAC;KAAI,GAAI,sBAAsB;eAAG;MAAmB;KACjD,GACJ;;GACA;;AAIV,uBAAe;;;;AClJf,qBAAeC"}
@@ -1,4 +1,4 @@
1
- import { t as useUniformField } from "./useUniformField-BKVVns0E.js";
1
+ import { t as useUniformField } from "./useUniformField-D2NgevBI.js";
2
2
  import { cn, tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
3
3
  import { useRef } from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -81,4 +81,4 @@ var Switch_default = Switch_default$1;
81
81
 
82
82
  //#endregion
83
83
  export { Switch_default$1 as n, Switch_default as t };
84
- //# sourceMappingURL=Switch-DkciIYnD.js.map
84
+ //# sourceMappingURL=Switch-s64WUP5i.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Switch-DkciIYnD.js","names":["Switch","HeroSwitch","Switch"],"sources":["../src/Switch/Switch.tsx","../src/Switch/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { SwitchProps as HeroSwitchProps } from '@heroui/switch';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { Switch as HeroSwitch } from '@heroui/switch';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const switchVariants = tv({\n slots: {\n base: '',\n endContent: '',\n errorMessage: 'ml-1 mt-1',\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 'text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n outerWrapper: 'place-content-center',\n startContent: '',\n thumb: '',\n thumbIcon: '',\n wrapper: '',\n },\n});\n\ntype VariantProps = TVProps<typeof switchVariants>;\ntype ClassName = TVClassName<typeof switchVariants>;\n\nexport interface SwitchProps 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 /** whether the select should be disabled */\n disabled?: boolean;\n /** Icon to be displayed at the end of the switch (when enabled) */\n endContent?: ReactNode;\n /** component displayed next to the switch */\n label?: ReactNode;\n /** name the field is registered under */\n name: string;\n /* Size of the switch */\n size?: 'sm' | 'md' | 'lg';\n /** Icon to be displayed at the start of the switch (when disabled) */\n startContent?: ReactNode;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Icon to be displayed inside the thumb */\n thumbIcon?: HeroSwitchProps['thumbIcon'];\n}\n\n/**\n * Switch component based on [HeroUI Switch](https://www.heroui.com//docs/components/switch)\n */\nconst Switch = ({\n className = undefined,\n endContent = undefined,\n name,\n size = undefined,\n startContent = undefined,\n thumbIcon = undefined,\n ...uniformFieldProps\n}: SwitchProps) => {\n const {\n ariaLabel,\n defaultValue,\n disabled,\n errorMessage,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual switch to forward focus\n const visualSwitchRef = useRef<HTMLInputElement>(null);\n\n // classNames from slots\n const variants = switchVariants();\n const classNames = variantsToClassNames(variants, className, 'outerWrapper');\n\n return (\n <div className={classNames.outerWrapper}>\n {/* Visually hidden input for form accessibility and focus management */}\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={ariaLabel}\n checked={!!field.value}\n name={name}\n onBlur={onBlur}\n type=\"checkbox\"\n onChange={(e) => {\n onChange(e.target.checked);\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual switch to show focus ring\n visualSwitchRef.current?.focus();\n }}\n />\n </VisuallyHidden>\n {/* Visual HeroSwitch component */}\n <HeroSwitch\n ref={visualSwitchRef}\n aria-label={ariaLabel}\n classNames={classNames}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n defaultSelected={!!defaultValue}\n endContent={endContent}\n isDisabled={disabled}\n isSelected={!!field.value}\n name={`${name}_switch`}\n onValueChange={onChange}\n size={size}\n startContent={startContent}\n thumbIcon={thumbIcon}\n >\n {label}\n </HeroSwitch>\n {invalid ? (\n <div\n {...getHelperWrapperProps()}\n className={cn(\n getHelperWrapperProps()?.className,\n // force helper to be visible (for some reason it's hidden by default) and remove margin\n 'ml-0 block',\n )}\n >\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default Switch;\n","import Switch from './Switch';\n\nexport type { SwitchProps } from './Switch';\n\nexport { Switch };\n\nexport default Switch;\n"],"mappings":";;;;;;;;AAaA,MAAa,iBAAiB,GAAG,EAC/B,OAAO;CACL,MAAM;CACN,YAAY;CACZ,cAAc;CAGd,OACE;CACF,cAAc;CACd,cAAc;CACd,OAAO;CACP,WAAW;CACX,SAAS;CACV,EACF,CAAC;;;;AA+BF,MAAMA,YAAU,EACd,YAAY,QACZ,aAAa,QACb,MACA,OAAO,QACP,eAAe,QACf,YAAY,QACZ,GAAG,wBACc;CACjB,MAAM,EACJ,WACA,cACA,UACA,cACA,OACA,sBACA,uBACA,SACA,OACA,QACA,UACA,KACA,UACA,WACE,gBAAgB;EAClB;EACA,GAAG;EACJ,CAAC;CAGF,MAAM,kBAAkB,OAAyB,KAAK;CAItD,MAAM,aAAa,qBADF,gBAAgB,EACiB,WAAW,eAAe;AAE5E,QACE,qBAAC;EAAI,WAAW,WAAW;;GAEzB,oBAAC,4BACC,oBAAC;IACM;IACL,cAAY;IACZ,SAAS,CAAC,CAAC,MAAM;IACX;IACE;IACR,MAAK;IACL,WAAW,MAAM;AACf,cAAS,EAAE,OAAO,QAAQ;;IAE5B,eAAe;AAGb,qBAAgB,SAAS,OAAO;;KAElC,GACa;GAEjB,oBAACC;IACC,KAAK;IACL,cAAY;IACA;IACZ,gBAAc;IACd,iBAAe;IACf,eAAa;IACb,iBAAiB,CAAC,CAAC;IACP;IACZ,YAAY;IACZ,YAAY,CAAC,CAAC,MAAM;IACpB,MAAM,GAAG,KAAK;IACd,eAAe;IACT;IACQ;IACH;cAEV;KACU;GACZ,UACC,oBAAC;IACC,GAAI,uBAAuB;IAC3B,WAAW,GACT,uBAAuB,EAAE,WAEzB,aACD;cAED,oBAAC;KAAI,GAAI,sBAAsB;eAAG;MAAmB;KACjD,GACJ;;GACA;;AAIV,uBAAeD;;;;AClJf,qBAAeE"}
1
+ {"version":3,"file":"Switch-s64WUP5i.js","names":["Switch","HeroSwitch","Switch"],"sources":["../src/Switch/Switch.tsx","../src/Switch/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { SwitchProps as HeroSwitchProps } from '@heroui/switch';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { Switch as HeroSwitch } from '@heroui/switch';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const switchVariants = tv({\n slots: {\n base: '',\n endContent: '',\n errorMessage: 'ml-1 mt-1',\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 'text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n outerWrapper: 'place-content-center',\n startContent: '',\n thumb: '',\n thumbIcon: '',\n wrapper: '',\n },\n});\n\ntype VariantProps = TVProps<typeof switchVariants>;\ntype ClassName = TVClassName<typeof switchVariants>;\n\nexport interface SwitchProps 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 /** whether the select should be disabled */\n disabled?: boolean;\n /** Icon to be displayed at the end of the switch (when enabled) */\n endContent?: ReactNode;\n /** component displayed next to the switch */\n label?: ReactNode;\n /** name the field is registered under */\n name: string;\n /* Size of the switch */\n size?: 'sm' | 'md' | 'lg';\n /** Icon to be displayed at the start of the switch (when disabled) */\n startContent?: ReactNode;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Icon to be displayed inside the thumb */\n thumbIcon?: HeroSwitchProps['thumbIcon'];\n}\n\n/**\n * Switch component based on [HeroUI Switch](https://www.heroui.com//docs/components/switch)\n */\nconst Switch = ({\n className = undefined,\n endContent = undefined,\n name,\n size = undefined,\n startContent = undefined,\n thumbIcon = undefined,\n ...uniformFieldProps\n}: SwitchProps) => {\n const {\n ariaLabel,\n defaultValue,\n disabled,\n errorMessage,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual switch to forward focus\n const visualSwitchRef = useRef<HTMLInputElement>(null);\n\n // classNames from slots\n const variants = switchVariants();\n const classNames = variantsToClassNames(variants, className, 'outerWrapper');\n\n return (\n <div className={classNames.outerWrapper}>\n {/* Visually hidden input for form accessibility and focus management */}\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={ariaLabel}\n checked={!!field.value}\n name={name}\n onBlur={onBlur}\n type=\"checkbox\"\n onChange={(e) => {\n onChange(e.target.checked);\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual switch to show focus ring\n visualSwitchRef.current?.focus();\n }}\n />\n </VisuallyHidden>\n {/* Visual HeroSwitch component */}\n <HeroSwitch\n ref={visualSwitchRef}\n aria-label={ariaLabel}\n classNames={classNames}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n defaultSelected={!!defaultValue}\n endContent={endContent}\n isDisabled={disabled}\n isSelected={!!field.value}\n name={`${name}_switch`}\n onValueChange={onChange}\n size={size}\n startContent={startContent}\n thumbIcon={thumbIcon}\n >\n {label}\n </HeroSwitch>\n {invalid ? (\n <div\n {...getHelperWrapperProps()}\n className={cn(\n getHelperWrapperProps()?.className,\n // force helper to be visible (for some reason it's hidden by default) and remove margin\n 'ml-0 block',\n )}\n >\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default Switch;\n","import Switch from './Switch';\n\nexport type { SwitchProps } from './Switch';\n\nexport { Switch };\n\nexport default Switch;\n"],"mappings":";;;;;;;;AAaA,MAAa,iBAAiB,GAAG,EAC/B,OAAO;CACL,MAAM;CACN,YAAY;CACZ,cAAc;CAGd,OACE;CACF,cAAc;CACd,cAAc;CACd,OAAO;CACP,WAAW;CACX,SAAS;CACV,EACF,CAAC;;;;AA+BF,MAAMA,YAAU,EACd,YAAY,QACZ,aAAa,QACb,MACA,OAAO,QACP,eAAe,QACf,YAAY,QACZ,GAAG,wBACc;CACjB,MAAM,EACJ,WACA,cACA,UACA,cACA,OACA,sBACA,uBACA,SACA,OACA,QACA,UACA,KACA,UACA,WACE,gBAAgB;EAClB;EACA,GAAG;EACJ,CAAC;CAGF,MAAM,kBAAkB,OAAyB,KAAK;CAItD,MAAM,aAAa,qBADF,gBAAgB,EACiB,WAAW,eAAe;AAE5E,QACE,qBAAC;EAAI,WAAW,WAAW;;GAEzB,oBAAC,4BACC,oBAAC;IACM;IACL,cAAY;IACZ,SAAS,CAAC,CAAC,MAAM;IACX;IACE;IACR,MAAK;IACL,WAAW,MAAM;AACf,cAAS,EAAE,OAAO,QAAQ;;IAE5B,eAAe;AAGb,qBAAgB,SAAS,OAAO;;KAElC,GACa;GAEjB,oBAACC;IACC,KAAK;IACL,cAAY;IACA;IACZ,gBAAc;IACd,iBAAe;IACf,eAAa;IACb,iBAAiB,CAAC,CAAC;IACP;IACZ,YAAY;IACZ,YAAY,CAAC,CAAC,MAAM;IACpB,MAAM,GAAG,KAAK;IACd,eAAe;IACT;IACQ;IACH;cAEV;KACU;GACZ,UACC,oBAAC;IACC,GAAI,uBAAuB;IAC3B,WAAW,GACT,uBAAuB,EAAE,WAEzB,aACD;cAED,oBAAC;KAAI,GAAI,sBAAsB;eAAG;MAAmB;KACjD,GACJ;;GACA;;AAIV,uBAAeD;;;;AClJf,qBAAeE"}
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- const require_SwitchBox = require('../SwitchBox-B9JqwDtN.cjs');
2
+ const require_SwitchBox = require('../SwitchBox-BwdvgHpG.cjs');
3
3
 
4
4
  exports.SwitchBox = require_SwitchBox.SwitchBox_default$1;
5
5
  exports.default = require_SwitchBox.SwitchBox_default;
@@ -1,2 +1,2 @@
1
- import { n as SwitchBoxProps, r as switchBoxVariants, t as SwitchBox } from "../index-CHNp5R5N.cjs";
1
+ import { n as SwitchBoxProps, r as switchBoxVariants, t as SwitchBox } from "../index-CrpdF1Xw.cjs";
2
2
  export { SwitchBox, SwitchBox as default, SwitchBoxProps, switchBoxVariants };
@@ -1,2 +1,2 @@
1
- import { n as SwitchBoxProps, r as switchBoxVariants, t as SwitchBox } from "../index-3v_vja2i.js";
1
+ import { n as SwitchBoxProps, r as switchBoxVariants, t as SwitchBox } from "../index-JdksqsGh.js";
2
2
  export { SwitchBox, SwitchBox as default, SwitchBoxProps, switchBoxVariants };
@@ -1,3 +1,3 @@
1
- import { n as SwitchBox_default, r as switchBoxVariants, t as SwitchBox_default$1 } from "../SwitchBox-B6Z4rtWt.js";
1
+ import { n as SwitchBox_default, r as switchBoxVariants, t as SwitchBox_default$1 } from "../SwitchBox-CMw1MGJ0.js";
2
2
 
3
3
  export { SwitchBox_default as SwitchBox, SwitchBox_default$1 as default, switchBoxVariants };
@@ -1,5 +1,5 @@
1
- const require_FormContext = require('./FormContext-Lw4YL4-B.cjs');
2
- const require_useUniformField = require('./useUniformField-D6fwSjrH.cjs');
1
+ const require_FormContext = require('./FormContext-CeFKQmVH.cjs');
2
+ const require_useUniformField = require('./useUniformField-CGiibqg4.cjs');
3
3
  let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
4
4
  let react = require("react");
5
5
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -171,4 +171,4 @@ Object.defineProperty(exports, 'switchBoxVariants', {
171
171
  return switchBoxVariants;
172
172
  }
173
173
  });
174
- //# sourceMappingURL=SwitchBox-B9JqwDtN.cjs.map
174
+ //# sourceMappingURL=SwitchBox-BwdvgHpG.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"SwitchBox-B9JqwDtN.cjs","names":["useUniformField","VisuallyHidden","SwitchBox"],"sources":["../src/SwitchBox/SwitchBox.tsx","../src/SwitchBox/index.ts"],"sourcesContent":["import type { TVClassName } from '@fuf-stack/pixel-utils';\nimport type { SwitchProps as HeroSwitchProps } from '@heroui/switch';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { useSwitch } from '@heroui/switch';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const switchBoxVariants = tv({\n slots: {\n box: 'group inline-flex w-full cursor-pointer items-center justify-between rounded-lg border-2 border-default hover:bg-content2 data-[selected=true]:border-focus',\n description: 'text-foreground opacity-70',\n icon: '',\n label:\n 'font-medium text-foreground group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n wrapper: '',\n thumb: '',\n thumbIcon: '',\n },\n variants: {\n isDisabled: {\n true: {\n box: 'pointer-events-none opacity-disabled',\n },\n },\n isInvalid: {\n true: {\n box: '!border-danger',\n label: '!text-danger',\n },\n },\n size: {\n sm: {\n box: 'gap-2 p-3',\n description: 'text-xs',\n label: 'text-xs',\n },\n md: {\n box: 'gap-4 p-4',\n description: 'text-small',\n label: 'text-sm',\n },\n lg: {\n box: 'gap-4 p-5',\n description: 'text-small',\n label: 'text-base',\n },\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\ntype ClassName = TVClassName<typeof switchBoxVariants>;\n\nexport interface SwitchBoxProps {\n /** CSS class name */\n className?: ClassName;\n /** Description text displayed below the label */\n description?: ReactNode;\n /** whether the switch should be disabled */\n disabled?: boolean;\n /** Icon to be displayed in the box */\n icon?: ReactNode;\n /** component displayed as the label */\n label?: ReactNode;\n /** name the field is registered under */\n name: string;\n /** whether the field is required */\n required?: boolean;\n /* Size of the switch */\n size?: 'sm' | 'md' | 'lg';\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Icon to be displayed inside the thumb */\n thumbIcon?: HeroSwitchProps['thumbIcon'];\n}\n\n/**\n * SwitchBox component - A card-like box with a switch control\n */\nconst SwitchBox = ({\n className = undefined,\n description = undefined,\n icon = undefined,\n name,\n size = undefined,\n thumbIcon = undefined,\n ...uniformFieldProps\n}: SwitchBoxProps) => {\n const {\n defaultValue,\n disabled,\n errorMessage,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual switch to forward focus\n const visualSwitchRef = useRef<HTMLInputElement>(null);\n\n // Use the useSwitch hook to get access to all the necessary props\n const {\n Component,\n slots,\n isSelected,\n getBaseProps,\n getInputProps,\n getWrapperProps,\n } = useSwitch({\n defaultSelected: !!defaultValue,\n isDisabled: disabled,\n isSelected: !!field.value,\n name: `${name}_switch`,\n onValueChange: onChange,\n size,\n thumbIcon,\n });\n\n // classNames from slots\n const variants = switchBoxVariants({\n isDisabled: disabled,\n isInvalid: invalid,\n size,\n });\n const classNames = variantsToClassNames(variants, className, 'box');\n\n return (\n <div>\n <Component\n {...getBaseProps()}\n className={classNames.box}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n >\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={typeof label === 'string' ? label : name}\n checked={!!field.value}\n name={name}\n tabIndex={-1}\n type=\"checkbox\"\n onChange={(e) => {\n onChange(e.target.checked);\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual switch to show focus ring\n visualSwitchRef.current?.focus();\n }}\n />\n {/* Visual switch input for focus ring */}\n <input\n ref={visualSwitchRef}\n {...getInputProps()}\n onBlur={(e) => {\n // Call HeroUI's internal onBlur to clear focus state and remove focus ring\n getInputProps().onBlur?.(e);\n // Then call RHF's onBlur to mark field as touched\n onBlur();\n }}\n />\n </VisuallyHidden>\n {!icon ? (\n <span\n {...getWrapperProps()}\n className={cn(getWrapperProps().className, classNames.wrapper)}\n >\n <span className={cn(slots.thumb({ class: classNames.thumb }))}>\n {thumbIcon && typeof thumbIcon === 'function'\n ? thumbIcon({\n isSelected: !!isSelected,\n className: slots.thumbIcon({ class: classNames.thumbIcon }),\n width: '1em',\n height: '1em',\n 'data-checked': isSelected ? 'true' : 'false',\n })\n : thumbIcon}\n </span>\n </span>\n ) : null}\n {icon ? <div className={classNames.icon}>{icon}</div> : null}\n <div className=\"grow\">\n {label ? <div className={classNames.label}>{label}</div> : null}\n {description ? (\n <div className={classNames.description}>{description}</div>\n ) : null}\n </div>\n {icon ? (\n <span\n {...getWrapperProps()}\n className={cn(getWrapperProps().className, classNames.wrapper)}\n >\n <span className={cn(slots.thumb({ class: classNames.thumb }))}>\n {thumbIcon && typeof thumbIcon === 'function'\n ? thumbIcon({\n isSelected: !!isSelected,\n className: slots.thumbIcon({ class: classNames.thumbIcon }),\n width: '1em',\n height: '1em',\n 'data-checked': isSelected ? 'true' : 'false',\n })\n : thumbIcon}\n </span>\n </span>\n ) : null}\n </Component>\n {invalid ? (\n <div\n {...getHelperWrapperProps()}\n className={cn(\n getHelperWrapperProps()?.className,\n // force helper to be visible (for some reason it's hidden by default) and remove margin\n 'ml-0 block',\n )}\n >\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default SwitchBox;\n","import SwitchBox from './SwitchBox';\n\nexport type { SwitchBoxProps } from './SwitchBox';\n\nexport { switchBoxVariants } from './SwitchBox';\nexport { SwitchBox };\n\nexport default SwitchBox;\n"],"mappings":"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"}
1
+ {"version":3,"file":"SwitchBox-BwdvgHpG.cjs","names":["useUniformField","VisuallyHidden","SwitchBox"],"sources":["../src/SwitchBox/SwitchBox.tsx","../src/SwitchBox/index.ts"],"sourcesContent":["import type { TVClassName } from '@fuf-stack/pixel-utils';\nimport type { SwitchProps as HeroSwitchProps } from '@heroui/switch';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { useSwitch } from '@heroui/switch';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const switchBoxVariants = tv({\n slots: {\n box: 'group inline-flex w-full cursor-pointer items-center justify-between rounded-lg border-2 border-default hover:bg-content2 data-[selected=true]:border-focus',\n description: 'text-foreground opacity-70',\n icon: '',\n label:\n 'font-medium text-foreground group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n wrapper: '',\n thumb: '',\n thumbIcon: '',\n },\n variants: {\n isDisabled: {\n true: {\n box: 'pointer-events-none opacity-disabled',\n },\n },\n isInvalid: {\n true: {\n box: '!border-danger',\n label: '!text-danger',\n },\n },\n size: {\n sm: {\n box: 'gap-2 p-3',\n description: 'text-xs',\n label: 'text-xs',\n },\n md: {\n box: 'gap-4 p-4',\n description: 'text-small',\n label: 'text-sm',\n },\n lg: {\n box: 'gap-4 p-5',\n description: 'text-small',\n label: 'text-base',\n },\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\ntype ClassName = TVClassName<typeof switchBoxVariants>;\n\nexport interface SwitchBoxProps {\n /** CSS class name */\n className?: ClassName;\n /** Description text displayed below the label */\n description?: ReactNode;\n /** whether the switch should be disabled */\n disabled?: boolean;\n /** Icon to be displayed in the box */\n icon?: ReactNode;\n /** component displayed as the label */\n label?: ReactNode;\n /** name the field is registered under */\n name: string;\n /** whether the field is required */\n required?: boolean;\n /* Size of the switch */\n size?: 'sm' | 'md' | 'lg';\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Icon to be displayed inside the thumb */\n thumbIcon?: HeroSwitchProps['thumbIcon'];\n}\n\n/**\n * SwitchBox component - A card-like box with a switch control\n */\nconst SwitchBox = ({\n className = undefined,\n description = undefined,\n icon = undefined,\n name,\n size = undefined,\n thumbIcon = undefined,\n ...uniformFieldProps\n}: SwitchBoxProps) => {\n const {\n defaultValue,\n disabled,\n errorMessage,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual switch to forward focus\n const visualSwitchRef = useRef<HTMLInputElement>(null);\n\n // Use the useSwitch hook to get access to all the necessary props\n const {\n Component,\n slots,\n isSelected,\n getBaseProps,\n getInputProps,\n getWrapperProps,\n } = useSwitch({\n defaultSelected: !!defaultValue,\n isDisabled: disabled,\n isSelected: !!field.value,\n name: `${name}_switch`,\n onValueChange: onChange,\n size,\n thumbIcon,\n });\n\n // classNames from slots\n const variants = switchBoxVariants({\n isDisabled: disabled,\n isInvalid: invalid,\n size,\n });\n const classNames = variantsToClassNames(variants, className, 'box');\n\n return (\n <div>\n <Component\n {...getBaseProps()}\n className={classNames.box}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n >\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={typeof label === 'string' ? label : name}\n checked={!!field.value}\n name={name}\n tabIndex={-1}\n type=\"checkbox\"\n onChange={(e) => {\n onChange(e.target.checked);\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual switch to show focus ring\n visualSwitchRef.current?.focus();\n }}\n />\n {/* Visual switch input for focus ring */}\n <input\n ref={visualSwitchRef}\n {...getInputProps()}\n onBlur={(e) => {\n // Call HeroUI's internal onBlur to clear focus state and remove focus ring\n getInputProps().onBlur?.(e);\n // Then call RHF's onBlur to mark field as touched\n onBlur();\n }}\n />\n </VisuallyHidden>\n {!icon ? (\n <span\n {...getWrapperProps()}\n className={cn(getWrapperProps().className, classNames.wrapper)}\n >\n <span className={cn(slots.thumb({ class: classNames.thumb }))}>\n {thumbIcon && typeof thumbIcon === 'function'\n ? thumbIcon({\n isSelected: !!isSelected,\n className: slots.thumbIcon({ class: classNames.thumbIcon }),\n width: '1em',\n height: '1em',\n 'data-checked': isSelected ? 'true' : 'false',\n })\n : thumbIcon}\n </span>\n </span>\n ) : null}\n {icon ? <div className={classNames.icon}>{icon}</div> : null}\n <div className=\"grow\">\n {label ? <div className={classNames.label}>{label}</div> : null}\n {description ? (\n <div className={classNames.description}>{description}</div>\n ) : null}\n </div>\n {icon ? (\n <span\n {...getWrapperProps()}\n className={cn(getWrapperProps().className, classNames.wrapper)}\n >\n <span className={cn(slots.thumb({ class: classNames.thumb }))}>\n {thumbIcon && typeof thumbIcon === 'function'\n ? thumbIcon({\n isSelected: !!isSelected,\n className: slots.thumbIcon({ class: classNames.thumbIcon }),\n width: '1em',\n height: '1em',\n 'data-checked': isSelected ? 'true' : 'false',\n })\n : thumbIcon}\n </span>\n </span>\n ) : null}\n </Component>\n {invalid ? (\n <div\n {...getHelperWrapperProps()}\n className={cn(\n getHelperWrapperProps()?.className,\n // force helper to be visible (for some reason it's hidden by default) and remove margin\n 'ml-0 block',\n )}\n >\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default SwitchBox;\n","import SwitchBox from './SwitchBox';\n\nexport type { SwitchBoxProps } from './SwitchBox';\n\nexport { switchBoxVariants } from './SwitchBox';\nexport { SwitchBox };\n\nexport default SwitchBox;\n"],"mappings":"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"}
@@ -1,4 +1,4 @@
1
- import { t as useUniformField } from "./useUniformField-BKVVns0E.js";
1
+ import { t as useUniformField } from "./useUniformField-D2NgevBI.js";
2
2
  import { cn, tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
3
3
  import { useRef } from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -153,4 +153,4 @@ var SwitchBox_default = SwitchBox_default$1;
153
153
 
154
154
  //#endregion
155
155
  export { SwitchBox_default$1 as n, switchBoxVariants as r, SwitchBox_default as t };
156
- //# sourceMappingURL=SwitchBox-B6Z4rtWt.js.map
156
+ //# sourceMappingURL=SwitchBox-CMw1MGJ0.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SwitchBox-B6Z4rtWt.js","names":["SwitchBox"],"sources":["../src/SwitchBox/SwitchBox.tsx","../src/SwitchBox/index.ts"],"sourcesContent":["import type { TVClassName } from '@fuf-stack/pixel-utils';\nimport type { SwitchProps as HeroSwitchProps } from '@heroui/switch';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { useSwitch } from '@heroui/switch';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const switchBoxVariants = tv({\n slots: {\n box: 'group inline-flex w-full cursor-pointer items-center justify-between rounded-lg border-2 border-default hover:bg-content2 data-[selected=true]:border-focus',\n description: 'text-foreground opacity-70',\n icon: '',\n label:\n 'font-medium text-foreground group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n wrapper: '',\n thumb: '',\n thumbIcon: '',\n },\n variants: {\n isDisabled: {\n true: {\n box: 'pointer-events-none opacity-disabled',\n },\n },\n isInvalid: {\n true: {\n box: '!border-danger',\n label: '!text-danger',\n },\n },\n size: {\n sm: {\n box: 'gap-2 p-3',\n description: 'text-xs',\n label: 'text-xs',\n },\n md: {\n box: 'gap-4 p-4',\n description: 'text-small',\n label: 'text-sm',\n },\n lg: {\n box: 'gap-4 p-5',\n description: 'text-small',\n label: 'text-base',\n },\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\ntype ClassName = TVClassName<typeof switchBoxVariants>;\n\nexport interface SwitchBoxProps {\n /** CSS class name */\n className?: ClassName;\n /** Description text displayed below the label */\n description?: ReactNode;\n /** whether the switch should be disabled */\n disabled?: boolean;\n /** Icon to be displayed in the box */\n icon?: ReactNode;\n /** component displayed as the label */\n label?: ReactNode;\n /** name the field is registered under */\n name: string;\n /** whether the field is required */\n required?: boolean;\n /* Size of the switch */\n size?: 'sm' | 'md' | 'lg';\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Icon to be displayed inside the thumb */\n thumbIcon?: HeroSwitchProps['thumbIcon'];\n}\n\n/**\n * SwitchBox component - A card-like box with a switch control\n */\nconst SwitchBox = ({\n className = undefined,\n description = undefined,\n icon = undefined,\n name,\n size = undefined,\n thumbIcon = undefined,\n ...uniformFieldProps\n}: SwitchBoxProps) => {\n const {\n defaultValue,\n disabled,\n errorMessage,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual switch to forward focus\n const visualSwitchRef = useRef<HTMLInputElement>(null);\n\n // Use the useSwitch hook to get access to all the necessary props\n const {\n Component,\n slots,\n isSelected,\n getBaseProps,\n getInputProps,\n getWrapperProps,\n } = useSwitch({\n defaultSelected: !!defaultValue,\n isDisabled: disabled,\n isSelected: !!field.value,\n name: `${name}_switch`,\n onValueChange: onChange,\n size,\n thumbIcon,\n });\n\n // classNames from slots\n const variants = switchBoxVariants({\n isDisabled: disabled,\n isInvalid: invalid,\n size,\n });\n const classNames = variantsToClassNames(variants, className, 'box');\n\n return (\n <div>\n <Component\n {...getBaseProps()}\n className={classNames.box}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n >\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={typeof label === 'string' ? label : name}\n checked={!!field.value}\n name={name}\n tabIndex={-1}\n type=\"checkbox\"\n onChange={(e) => {\n onChange(e.target.checked);\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual switch to show focus ring\n visualSwitchRef.current?.focus();\n }}\n />\n {/* Visual switch input for focus ring */}\n <input\n ref={visualSwitchRef}\n {...getInputProps()}\n onBlur={(e) => {\n // Call HeroUI's internal onBlur to clear focus state and remove focus ring\n getInputProps().onBlur?.(e);\n // Then call RHF's onBlur to mark field as touched\n onBlur();\n }}\n />\n </VisuallyHidden>\n {!icon ? (\n <span\n {...getWrapperProps()}\n className={cn(getWrapperProps().className, classNames.wrapper)}\n >\n <span className={cn(slots.thumb({ class: classNames.thumb }))}>\n {thumbIcon && typeof thumbIcon === 'function'\n ? thumbIcon({\n isSelected: !!isSelected,\n className: slots.thumbIcon({ class: classNames.thumbIcon }),\n width: '1em',\n height: '1em',\n 'data-checked': isSelected ? 'true' : 'false',\n })\n : thumbIcon}\n </span>\n </span>\n ) : null}\n {icon ? <div className={classNames.icon}>{icon}</div> : null}\n <div className=\"grow\">\n {label ? <div className={classNames.label}>{label}</div> : null}\n {description ? (\n <div className={classNames.description}>{description}</div>\n ) : null}\n </div>\n {icon ? (\n <span\n {...getWrapperProps()}\n className={cn(getWrapperProps().className, classNames.wrapper)}\n >\n <span className={cn(slots.thumb({ class: classNames.thumb }))}>\n {thumbIcon && typeof thumbIcon === 'function'\n ? thumbIcon({\n isSelected: !!isSelected,\n className: slots.thumbIcon({ class: classNames.thumbIcon }),\n width: '1em',\n height: '1em',\n 'data-checked': isSelected ? 'true' : 'false',\n })\n : thumbIcon}\n </span>\n </span>\n ) : null}\n </Component>\n {invalid ? (\n <div\n {...getHelperWrapperProps()}\n className={cn(\n getHelperWrapperProps()?.className,\n // force helper to be visible (for some reason it's hidden by default) and remove margin\n 'ml-0 block',\n )}\n >\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default SwitchBox;\n","import SwitchBox from './SwitchBox';\n\nexport type { SwitchBoxProps } from './SwitchBox';\n\nexport { switchBoxVariants } from './SwitchBox';\nexport { SwitchBox };\n\nexport default SwitchBox;\n"],"mappings":"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"}
1
+ {"version":3,"file":"SwitchBox-CMw1MGJ0.js","names":["SwitchBox"],"sources":["../src/SwitchBox/SwitchBox.tsx","../src/SwitchBox/index.ts"],"sourcesContent":["import type { TVClassName } from '@fuf-stack/pixel-utils';\nimport type { SwitchProps as HeroSwitchProps } from '@heroui/switch';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { useSwitch } from '@heroui/switch';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const switchBoxVariants = tv({\n slots: {\n box: 'group inline-flex w-full cursor-pointer items-center justify-between rounded-lg border-2 border-default hover:bg-content2 data-[selected=true]:border-focus',\n description: 'text-foreground opacity-70',\n icon: '',\n label:\n 'font-medium text-foreground group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n wrapper: '',\n thumb: '',\n thumbIcon: '',\n },\n variants: {\n isDisabled: {\n true: {\n box: 'pointer-events-none opacity-disabled',\n },\n },\n isInvalid: {\n true: {\n box: '!border-danger',\n label: '!text-danger',\n },\n },\n size: {\n sm: {\n box: 'gap-2 p-3',\n description: 'text-xs',\n label: 'text-xs',\n },\n md: {\n box: 'gap-4 p-4',\n description: 'text-small',\n label: 'text-sm',\n },\n lg: {\n box: 'gap-4 p-5',\n description: 'text-small',\n label: 'text-base',\n },\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\ntype ClassName = TVClassName<typeof switchBoxVariants>;\n\nexport interface SwitchBoxProps {\n /** CSS class name */\n className?: ClassName;\n /** Description text displayed below the label */\n description?: ReactNode;\n /** whether the switch should be disabled */\n disabled?: boolean;\n /** Icon to be displayed in the box */\n icon?: ReactNode;\n /** component displayed as the label */\n label?: ReactNode;\n /** name the field is registered under */\n name: string;\n /** whether the field is required */\n required?: boolean;\n /* Size of the switch */\n size?: 'sm' | 'md' | 'lg';\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Icon to be displayed inside the thumb */\n thumbIcon?: HeroSwitchProps['thumbIcon'];\n}\n\n/**\n * SwitchBox component - A card-like box with a switch control\n */\nconst SwitchBox = ({\n className = undefined,\n description = undefined,\n icon = undefined,\n name,\n size = undefined,\n thumbIcon = undefined,\n ...uniformFieldProps\n}: SwitchBoxProps) => {\n const {\n defaultValue,\n disabled,\n errorMessage,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual switch to forward focus\n const visualSwitchRef = useRef<HTMLInputElement>(null);\n\n // Use the useSwitch hook to get access to all the necessary props\n const {\n Component,\n slots,\n isSelected,\n getBaseProps,\n getInputProps,\n getWrapperProps,\n } = useSwitch({\n defaultSelected: !!defaultValue,\n isDisabled: disabled,\n isSelected: !!field.value,\n name: `${name}_switch`,\n onValueChange: onChange,\n size,\n thumbIcon,\n });\n\n // classNames from slots\n const variants = switchBoxVariants({\n isDisabled: disabled,\n isInvalid: invalid,\n size,\n });\n const classNames = variantsToClassNames(variants, className, 'box');\n\n return (\n <div>\n <Component\n {...getBaseProps()}\n className={classNames.box}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n >\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={typeof label === 'string' ? label : name}\n checked={!!field.value}\n name={name}\n tabIndex={-1}\n type=\"checkbox\"\n onChange={(e) => {\n onChange(e.target.checked);\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual switch to show focus ring\n visualSwitchRef.current?.focus();\n }}\n />\n {/* Visual switch input for focus ring */}\n <input\n ref={visualSwitchRef}\n {...getInputProps()}\n onBlur={(e) => {\n // Call HeroUI's internal onBlur to clear focus state and remove focus ring\n getInputProps().onBlur?.(e);\n // Then call RHF's onBlur to mark field as touched\n onBlur();\n }}\n />\n </VisuallyHidden>\n {!icon ? (\n <span\n {...getWrapperProps()}\n className={cn(getWrapperProps().className, classNames.wrapper)}\n >\n <span className={cn(slots.thumb({ class: classNames.thumb }))}>\n {thumbIcon && typeof thumbIcon === 'function'\n ? thumbIcon({\n isSelected: !!isSelected,\n className: slots.thumbIcon({ class: classNames.thumbIcon }),\n width: '1em',\n height: '1em',\n 'data-checked': isSelected ? 'true' : 'false',\n })\n : thumbIcon}\n </span>\n </span>\n ) : null}\n {icon ? <div className={classNames.icon}>{icon}</div> : null}\n <div className=\"grow\">\n {label ? <div className={classNames.label}>{label}</div> : null}\n {description ? (\n <div className={classNames.description}>{description}</div>\n ) : null}\n </div>\n {icon ? (\n <span\n {...getWrapperProps()}\n className={cn(getWrapperProps().className, classNames.wrapper)}\n >\n <span className={cn(slots.thumb({ class: classNames.thumb }))}>\n {thumbIcon && typeof thumbIcon === 'function'\n ? thumbIcon({\n isSelected: !!isSelected,\n className: slots.thumbIcon({ class: classNames.thumbIcon }),\n width: '1em',\n height: '1em',\n 'data-checked': isSelected ? 'true' : 'false',\n })\n : thumbIcon}\n </span>\n </span>\n ) : null}\n </Component>\n {invalid ? (\n <div\n {...getHelperWrapperProps()}\n className={cn(\n getHelperWrapperProps()?.className,\n // force helper to be visible (for some reason it's hidden by default) and remove margin\n 'ml-0 block',\n )}\n >\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default SwitchBox;\n","import SwitchBox from './SwitchBox';\n\nexport type { SwitchBoxProps } from './SwitchBox';\n\nexport { switchBoxVariants } from './SwitchBox';\nexport { SwitchBox };\n\nexport default SwitchBox;\n"],"mappings":"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"}
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- const require_TextArea = require('../TextArea-BqQtlPSV.cjs');
2
+ const require_TextArea = require('../TextArea-COe8XP7f.cjs');
3
3
 
4
4
  exports.TextArea = require_TextArea.TextArea_default$1;
5
5
  exports.default = require_TextArea.TextArea_default;
@@ -1,2 +1,2 @@
1
- import { n as TextAreaProps, t as TextArea } from "../index-C2A_i57R.cjs";
1
+ import { n as TextAreaProps, t as TextArea } from "../index-CASoDHjE.cjs";
2
2
  export { TextArea, TextArea as default, TextAreaProps };
@@ -1,2 +1,2 @@
1
- import { n as TextAreaProps, t as TextArea } from "../index-DnzC0GCS.js";
1
+ import { n as TextAreaProps, t as TextArea } from "../index-CPbrUN5A.js";
2
2
  export { TextArea, TextArea as default, TextAreaProps };
@@ -1,3 +1,3 @@
1
- import { n as TextArea_default, t as TextArea_default$1 } from "../TextArea-DAx49KI6.js";
1
+ import { n as TextArea_default, t as TextArea_default$1 } from "../TextArea-DTkDJr6g.js";
2
2
 
3
3
  export { TextArea_default as TextArea, TextArea_default$1 as default };
@@ -1,6 +1,6 @@
1
- const require_FormContext = require('./FormContext-Lw4YL4-B.cjs');
2
- const require_useUniformField = require('./useUniformField-D6fwSjrH.cjs');
3
- const require_useInputValueDebounce = require('./useInputValueDebounce-TiNR4jtG.cjs');
1
+ const require_FormContext = require('./FormContext-CeFKQmVH.cjs');
2
+ const require_useUniformField = require('./useUniformField-CGiibqg4.cjs');
3
+ const require_useInputValueDebounce = require('./useInputValueDebounce-KIKsvSLm.cjs');
4
4
  let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
5
5
  let react_jsx_runtime = require("react/jsx-runtime");
6
6
  let _heroui_input = require("@heroui/input");
@@ -74,4 +74,4 @@ Object.defineProperty(exports, 'TextArea_default$1', {
74
74
  return TextArea_default$1;
75
75
  }
76
76
  });
77
- //# sourceMappingURL=TextArea-BqQtlPSV.cjs.map
77
+ //# sourceMappingURL=TextArea-COe8XP7f.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextArea-BqQtlPSV.cjs","names":["useUniformField","useInputValueDebounce","HeroTextArea","TextArea"],"sources":["../src/TextArea/TextArea.tsx","../src/TextArea/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { Textarea as HeroTextArea } from '@heroui/input';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useInputValueDebounce } from '../hooks/useInputValueDebounce';\nimport { useUniformField } from '../hooks/useUniformField';\n\n// input variants\nexport const textAreaVariants = tv({\n slots: {\n /** wrapper around the whole input */\n base: '',\n /** clear button */\n clearButton: '',\n /** actual input element */\n input: '',\n /** inner wrapper (HeroUI inputWrapper slot) */\n inputWrapper: 'bg-content1 group-data-[focus=true]:border-focus',\n },\n});\n\ntype VariantProps = TVProps<typeof textAreaVariants>;\ntype ClassName = TVClassName<typeof textAreaVariants>;\n\nexport interface TextAreaProps 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 /** Child components. The content of the textarea. */\n children?: ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** debounce delay in milliseconds for form state updates (default: 300ms) */\n debounceDelay?: number;\n /** Determines if the TextArea is disabled or not. */\n disabled?: boolean;\n /** Label displayed above the TextArea. */\n label?: ReactNode;\n /** Name the TextArea is registered at in HTML forms (react-hook-form). */\n name: string;\n /** placeholder for the textArea content. */\n placeholder?: string;\n /** Id to grab element in internal tests. */\n testId?: string;\n}\n\n/**\n * TextArea component based on [HeroUI TextArea](https://www.heroui.com//docs/components/textarea)\n */\nconst TextArea = ({\n children = null,\n className: _className = undefined,\n debounceDelay = 300,\n name,\n placeholder = ' ',\n ...uniformFieldProps\n}: TextAreaProps) => {\n const {\n ariaLabel,\n disabled,\n errorMessage,\n field: {\n onChange: fieldOnChange,\n onBlur: fieldOnBlur,\n value: fieldValue,\n ref,\n },\n invalid,\n label,\n required,\n testId,\n } = useUniformField({ name, ...uniformFieldProps });\n\n // Use debounced handlers for form updates\n const { onChange, onBlur, value } = useInputValueDebounce({\n debounceDelay,\n name,\n onBlur: fieldOnBlur,\n onChange: fieldOnChange,\n value: fieldValue,\n });\n\n // classNames from slots\n const variants = textAreaVariants();\n const classNames = variantsToClassNames(variants, _className, 'base');\n\n return (\n <HeroTextArea\n ref={ref}\n data-testid={testId}\n errorMessage={errorMessage}\n id={testId}\n isDisabled={disabled}\n isInvalid={invalid}\n isRequired={required}\n label={label}\n labelPlacement=\"outside\"\n name={name}\n onBlur={onBlur}\n onChange={onChange}\n placeholder={placeholder}\n value={value}\n variant=\"bordered\"\n // Only add aria-label if there's no meaningful placeholder (HeroUI uses placeholder as aria-label)\n aria-label={\n !placeholder || placeholder.trim() === '' ? ariaLabel : undefined\n }\n classNames={{\n base: classNames.base,\n clearButton: classNames.clearButton,\n // set padding to 0 for error message exit animation\n helperWrapper: 'p-0',\n input: classNames.input,\n inputWrapper: classNames.inputWrapper,\n }}\n >\n {children}\n </HeroTextArea>\n );\n};\n\nexport default TextArea;\n","import TextArea from './TextArea';\n\nexport type { TextAreaProps } from './TextArea';\n\nexport { TextArea };\n\nexport default TextArea;\n"],"mappings":";;;;;;;;AAWA,MAAa,kDAAsB,EACjC,OAAO;CAEL,MAAM;CAEN,aAAa;CAEb,OAAO;CAEP,cAAc;CACf,EACF,CAAC;;;;AA6BF,MAAM,YAAY,EAChB,WAAW,MACX,WAAW,aAAa,QACxB,gBAAgB,KAChB,MACA,cAAc,KACd,GAAG,wBACgB;CACnB,MAAM,EACJ,WACA,UACA,cACA,OAAO,EACL,UAAU,eACV,QAAQ,aACR,OAAO,YACP,OAEF,SACA,OACA,UACA,WACEA,wCAAgB;EAAE;EAAM,GAAG;EAAmB,CAAC;CAGnD,MAAM,EAAE,UAAU,QAAQ,UAAUC,oDAAsB;EACxD;EACA;EACA,QAAQ;EACR,UAAU;EACV,OAAO;EACR,CAAC;CAIF,MAAM,8DADW,kBAAkB,EACe,YAAY,OAAO;AAErE,QACE,2CAACC;EACM;EACL,eAAa;EACC;EACd,IAAI;EACJ,YAAY;EACZ,WAAW;EACX,YAAY;EACL;EACP,gBAAe;EACT;EACE;EACE;EACG;EACN;EACP,SAAQ;EAER,cACE,CAAC,eAAe,YAAY,MAAM,KAAK,KAAK,YAAY;EAE1D,YAAY;GACV,MAAM,WAAW;GACjB,aAAa,WAAW;GAExB,eAAe;GACf,OAAO,WAAW;GAClB,cAAc,WAAW;GAC1B;EAEA;GACY;;AAInB,yBAAe;;;;ACrHf,uBAAeC"}
1
+ {"version":3,"file":"TextArea-COe8XP7f.cjs","names":["useUniformField","useInputValueDebounce","HeroTextArea","TextArea"],"sources":["../src/TextArea/TextArea.tsx","../src/TextArea/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { Textarea as HeroTextArea } from '@heroui/input';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useInputValueDebounce } from '../hooks/useInputValueDebounce';\nimport { useUniformField } from '../hooks/useUniformField';\n\n// input variants\nexport const textAreaVariants = tv({\n slots: {\n /** wrapper around the whole input */\n base: '',\n /** clear button */\n clearButton: '',\n /** actual input element */\n input: '',\n /** inner wrapper (HeroUI inputWrapper slot) */\n inputWrapper: 'bg-content1 group-data-[focus=true]:border-focus',\n },\n});\n\ntype VariantProps = TVProps<typeof textAreaVariants>;\ntype ClassName = TVClassName<typeof textAreaVariants>;\n\nexport interface TextAreaProps 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 /** Child components. The content of the textarea. */\n children?: ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** debounce delay in milliseconds for form state updates (default: 300ms) */\n debounceDelay?: number;\n /** Determines if the TextArea is disabled or not. */\n disabled?: boolean;\n /** Label displayed above the TextArea. */\n label?: ReactNode;\n /** Name the TextArea is registered at in HTML forms (react-hook-form). */\n name: string;\n /** placeholder for the textArea content. */\n placeholder?: string;\n /** Id to grab element in internal tests. */\n testId?: string;\n}\n\n/**\n * TextArea component based on [HeroUI TextArea](https://www.heroui.com//docs/components/textarea)\n */\nconst TextArea = ({\n children = null,\n className: _className = undefined,\n debounceDelay = 300,\n name,\n placeholder = ' ',\n ...uniformFieldProps\n}: TextAreaProps) => {\n const {\n ariaLabel,\n disabled,\n errorMessage,\n field: {\n onChange: fieldOnChange,\n onBlur: fieldOnBlur,\n value: fieldValue,\n ref,\n },\n invalid,\n label,\n required,\n testId,\n } = useUniformField({ name, ...uniformFieldProps });\n\n // Use debounced handlers for form updates\n const { onChange, onBlur, value } = useInputValueDebounce({\n debounceDelay,\n name,\n onBlur: fieldOnBlur,\n onChange: fieldOnChange,\n value: fieldValue,\n });\n\n // classNames from slots\n const variants = textAreaVariants();\n const classNames = variantsToClassNames(variants, _className, 'base');\n\n return (\n <HeroTextArea\n ref={ref}\n data-testid={testId}\n errorMessage={errorMessage}\n id={testId}\n isDisabled={disabled}\n isInvalid={invalid}\n isRequired={required}\n label={label}\n labelPlacement=\"outside\"\n name={name}\n onBlur={onBlur}\n onChange={onChange}\n placeholder={placeholder}\n value={value}\n variant=\"bordered\"\n // Only add aria-label if there's no meaningful placeholder (HeroUI uses placeholder as aria-label)\n aria-label={\n !placeholder || placeholder.trim() === '' ? ariaLabel : undefined\n }\n classNames={{\n base: classNames.base,\n clearButton: classNames.clearButton,\n // set padding to 0 for error message exit animation\n helperWrapper: 'p-0',\n input: classNames.input,\n inputWrapper: classNames.inputWrapper,\n }}\n >\n {children}\n </HeroTextArea>\n );\n};\n\nexport default TextArea;\n","import TextArea from './TextArea';\n\nexport type { TextAreaProps } from './TextArea';\n\nexport { TextArea };\n\nexport default TextArea;\n"],"mappings":";;;;;;;;AAWA,MAAa,kDAAsB,EACjC,OAAO;CAEL,MAAM;CAEN,aAAa;CAEb,OAAO;CAEP,cAAc;CACf,EACF,CAAC;;;;AA6BF,MAAM,YAAY,EAChB,WAAW,MACX,WAAW,aAAa,QACxB,gBAAgB,KAChB,MACA,cAAc,KACd,GAAG,wBACgB;CACnB,MAAM,EACJ,WACA,UACA,cACA,OAAO,EACL,UAAU,eACV,QAAQ,aACR,OAAO,YACP,OAEF,SACA,OACA,UACA,WACEA,wCAAgB;EAAE;EAAM,GAAG;EAAmB,CAAC;CAGnD,MAAM,EAAE,UAAU,QAAQ,UAAUC,oDAAsB;EACxD;EACA;EACA,QAAQ;EACR,UAAU;EACV,OAAO;EACR,CAAC;CAIF,MAAM,8DADW,kBAAkB,EACe,YAAY,OAAO;AAErE,QACE,2CAACC;EACM;EACL,eAAa;EACC;EACd,IAAI;EACJ,YAAY;EACZ,WAAW;EACX,YAAY;EACL;EACP,gBAAe;EACT;EACE;EACE;EACG;EACN;EACP,SAAQ;EAER,cACE,CAAC,eAAe,YAAY,MAAM,KAAK,KAAK,YAAY;EAE1D,YAAY;GACV,MAAM,WAAW;GACjB,aAAa,WAAW;GAExB,eAAe;GACf,OAAO,WAAW;GAClB,cAAc,WAAW;GAC1B;EAEA;GACY;;AAInB,yBAAe;;;;ACrHf,uBAAeC"}