@fuf-stack/uniform 1.11.0 → 1.11.2

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 (311) 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-CGWhnpBp.js → Checkboxes-BY4UK0Xf.js} +6 -6
  6. package/dist/Checkboxes-BY4UK0Xf.js.map +1 -0
  7. package/dist/{Checkboxes-Ds6bzl6p.cjs → Checkboxes-DgCK-Wq-.cjs} +18 -18
  8. package/dist/Checkboxes-DgCK-Wq-.cjs.map +1 -0
  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-D3iUaRLo.js → FieldArray-CDLaGvNj.js} +8 -8
  14. package/dist/FieldArray-CDLaGvNj.js.map +1 -0
  15. package/dist/{FieldArray-BexXN9bO.cjs → FieldArray-DBsyUQkU.cjs} +49 -49
  16. package/dist/FieldArray-DBsyUQkU.cjs.map +1 -0
  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-mpmErfDK.js → FieldCard-C1MCSbPW.js} +3 -3
  22. package/dist/{FieldCard-mpmErfDK.js.map → FieldCard-C1MCSbPW.js.map} +1 -1
  23. package/dist/{FieldCard-pP7aniZU.cjs → FieldCard-NKF358fO.cjs} +13 -13
  24. package/dist/{FieldCard-pP7aniZU.cjs.map → FieldCard-NKF358fO.cjs.map} +1 -1
  25. package/dist/{FieldCopyTestIdButton-AaLwu_8y.cjs → FieldCopyTestIdButton-BSYcSo2o.cjs} +10 -10
  26. package/dist/{FieldCopyTestIdButton-AaLwu_8y.cjs.map → FieldCopyTestIdButton-BSYcSo2o.cjs.map} +1 -1
  27. package/dist/{FieldCopyTestIdButton-Cx8AXJhO.js → FieldCopyTestIdButton-DWPCDJ-s.js} +4 -4
  28. package/dist/{FieldCopyTestIdButton-Cx8AXJhO.js.map → FieldCopyTestIdButton-DWPCDJ-s.js.map} +1 -1
  29. package/dist/{FieldValidationError-D86DPSOH.js → FieldValidationError-1hiDEFew.js} +4 -4
  30. package/dist/{FieldValidationError-D86DPSOH.js.map → FieldValidationError-1hiDEFew.js.map} +1 -1
  31. package/dist/{FieldValidationError-Cq6aI0tE.cjs → FieldValidationError-CE8R8qry.cjs} +13 -13
  32. package/dist/{FieldValidationError-Cq6aI0tE.cjs.map → FieldValidationError-CE8R8qry.cjs.map} +1 -1
  33. package/dist/Form/index.cjs +1 -1
  34. package/dist/Form/index.d.ts +1 -1
  35. package/dist/Form/index.js +1 -1
  36. package/dist/{Form-FvN3SXfF.cjs → Form-BsD69fql.cjs} +19 -19
  37. package/dist/{Form-FvN3SXfF.cjs.map → Form-BsD69fql.cjs.map} +1 -1
  38. package/dist/{Form-CFmCTl60.js → Form-DRNEwHsi.js} +4 -4
  39. package/dist/{Form-CFmCTl60.js.map → Form-DRNEwHsi.js.map} +1 -1
  40. package/dist/{FormContext-C3GymQOA.cjs → FormContext-Bb6d8hdG.cjs} +8 -8
  41. package/dist/FormContext-Bb6d8hdG.cjs.map +1 -0
  42. package/dist/FormContext-CN9n_KdE.js.map +1 -1
  43. package/dist/Grid/index.cjs +1 -1
  44. package/dist/Grid/index.d.cts +1 -1
  45. package/dist/Grid/index.d.ts +1 -1
  46. package/dist/Grid/index.js +1 -1
  47. package/dist/{Grid-DG60vYYG.cjs → Grid-D84e76CE.cjs} +8 -8
  48. package/dist/{Grid-DG60vYYG.cjs.map → Grid-D84e76CE.cjs.map} +1 -1
  49. package/dist/{Grid-DEH7Sezi.js → Grid-LRjQlZms.js} +4 -4
  50. package/dist/{Grid-DEH7Sezi.js.map → Grid-LRjQlZms.js.map} +1 -1
  51. package/dist/Input/index.cjs +1 -1
  52. package/dist/Input/index.d.cts +1 -1
  53. package/dist/Input/index.d.ts +1 -1
  54. package/dist/Input/index.js +1 -1
  55. package/dist/{Input--h5t7Sbl.js → Input-DXMWGTBh.js} +5 -5
  56. package/dist/Input-DXMWGTBh.js.map +1 -0
  57. package/dist/{Input-DKfFFOpo.cjs → Input-DeTpxiK_.cjs} +15 -15
  58. package/dist/Input-DeTpxiK_.cjs.map +1 -0
  59. package/dist/RadioBoxes/index.cjs +1 -1
  60. package/dist/RadioBoxes/index.d.cts +1 -1
  61. package/dist/RadioBoxes/index.d.ts +1 -1
  62. package/dist/RadioBoxes/index.js +1 -1
  63. package/dist/{RadioBoxes-7qdHj3ti.js → RadioBoxes-BEln4a-B.js} +5 -5
  64. package/dist/RadioBoxes-BEln4a-B.js.map +1 -0
  65. package/dist/{RadioBoxes-Bd9ahl4i.cjs → RadioBoxes-gsQGqQCd.cjs} +22 -22
  66. package/dist/RadioBoxes-gsQGqQCd.cjs.map +1 -0
  67. package/dist/RadioTabs/index.cjs +1 -1
  68. package/dist/RadioTabs/index.d.cts +1 -1
  69. package/dist/RadioTabs/index.d.ts +1 -1
  70. package/dist/RadioTabs/index.js +1 -1
  71. package/dist/{RadioTabs-DcEUdW7r.cjs → RadioTabs-BYpP0tKA.cjs} +18 -18
  72. package/dist/RadioTabs-BYpP0tKA.cjs.map +1 -0
  73. package/dist/{RadioTabs-DXs98jng.js → RadioTabs-DLr9QiXI.js} +5 -5
  74. package/dist/RadioTabs-DLr9QiXI.js.map +1 -0
  75. package/dist/Radios/index.cjs +1 -1
  76. package/dist/Radios/index.d.cts +1 -1
  77. package/dist/Radios/index.d.ts +1 -1
  78. package/dist/Radios/index.js +1 -1
  79. package/dist/{Radios-CIPNqPzi.cjs → Radios-BCOfnTke.cjs} +14 -14
  80. package/dist/{Radios-CIPNqPzi.cjs.map → Radios-BCOfnTke.cjs.map} +1 -1
  81. package/dist/{Radios-BIx06mzU.js → Radios-DCXI2kMf.js} +5 -5
  82. package/dist/{Radios-BIx06mzU.js.map → Radios-DCXI2kMf.js.map} +1 -1
  83. package/dist/Select/index.cjs +1 -1
  84. package/dist/Select/index.d.cts +1 -1
  85. package/dist/Select/index.d.ts +1 -1
  86. package/dist/Select/index.js +1 -1
  87. package/dist/{Select-CBjqYDcs.js → Select-CyfEmWiD.js} +5 -5
  88. package/dist/Select-CyfEmWiD.js.map +1 -0
  89. package/dist/{Select-BsL7qn2v.cjs → Select-KnPGOO27.cjs} +19 -19
  90. package/dist/Select-KnPGOO27.cjs.map +1 -0
  91. package/dist/Slider/index.cjs +1 -1
  92. package/dist/Slider/index.d.cts +1 -1
  93. package/dist/Slider/index.d.ts +1 -1
  94. package/dist/Slider/index.js +1 -1
  95. package/dist/{Slider-BDLbD7d5.cjs → Slider-C7xxYPgR.cjs} +15 -15
  96. package/dist/{Slider-BDLbD7d5.cjs.map → Slider-C7xxYPgR.cjs.map} +1 -1
  97. package/dist/{Slider-BHjHSoIk.js → Slider-Dlhb-9hC.js} +5 -5
  98. package/dist/{Slider-BHjHSoIk.js.map → Slider-Dlhb-9hC.js.map} +1 -1
  99. package/dist/SubmitButton/index.cjs +1 -1
  100. package/dist/SubmitButton/index.d.cts +1 -1
  101. package/dist/SubmitButton/index.d.ts +1 -1
  102. package/dist/SubmitButton/index.js +1 -1
  103. package/dist/{SubmitButton-7iOaKzhB.js → SubmitButton-C5f6j0N4.js} +4 -4
  104. package/dist/{SubmitButton-7iOaKzhB.js.map → SubmitButton-C5f6j0N4.js.map} +1 -1
  105. package/dist/{SubmitButton-DhtPJuro.cjs → SubmitButton-CUBItcBn.cjs} +12 -12
  106. package/dist/{SubmitButton-DhtPJuro.cjs.map → SubmitButton-CUBItcBn.cjs.map} +1 -1
  107. package/dist/Switch/index.cjs +1 -1
  108. package/dist/Switch/index.d.cts +1 -1
  109. package/dist/Switch/index.d.ts +1 -1
  110. package/dist/Switch/index.js +1 -1
  111. package/dist/{Switch-DCxAgt_L.js → Switch--m02Xcq8.js} +5 -5
  112. package/dist/{Switch-DCxAgt_L.js.map → Switch--m02Xcq8.js.map} +1 -1
  113. package/dist/{Switch-Dczzog3v.cjs → Switch-6LyeZHJh.cjs} +15 -15
  114. package/dist/{Switch-Dczzog3v.cjs.map → Switch-6LyeZHJh.cjs.map} +1 -1
  115. package/dist/SwitchBox/index.cjs +1 -1
  116. package/dist/SwitchBox/index.d.cts +1 -1
  117. package/dist/SwitchBox/index.d.ts +1 -1
  118. package/dist/SwitchBox/index.js +1 -1
  119. package/dist/{SwitchBox-DqVmZYId.cjs → SwitchBox-CtGiQdys.cjs} +19 -19
  120. package/dist/{SwitchBox-DqVmZYId.cjs.map → SwitchBox-CtGiQdys.cjs.map} +1 -1
  121. package/dist/{SwitchBox-DPHryDOM.js → SwitchBox-D0-e-pbM.js} +5 -5
  122. package/dist/{SwitchBox-DPHryDOM.js.map → SwitchBox-D0-e-pbM.js.map} +1 -1
  123. package/dist/TextArea/index.cjs +1 -1
  124. package/dist/TextArea/index.d.cts +1 -1
  125. package/dist/TextArea/index.d.ts +1 -1
  126. package/dist/TextArea/index.js +1 -1
  127. package/dist/{TextArea-BR6e-Fio.js → TextArea-BiSnvJ69.js} +5 -5
  128. package/dist/{TextArea-BR6e-Fio.js.map → TextArea-BiSnvJ69.js.map} +1 -1
  129. package/dist/{TextArea-CH-F6_ax.cjs → TextArea-PtdSABZS.cjs} +13 -13
  130. package/dist/{TextArea-CH-F6_ax.cjs.map → TextArea-PtdSABZS.cjs.map} +1 -1
  131. package/dist/helpers/index.cjs +1 -1
  132. package/dist/helpers-B-CJOBt3.js.map +1 -1
  133. package/dist/{helpers-KTgXi0lA.cjs → helpers-B84E9vHd.cjs} +4 -4
  134. package/dist/helpers-B84E9vHd.cjs.map +1 -0
  135. package/dist/hooks/useClientValidation/index.cjs +1 -1
  136. package/dist/hooks/useClientValidation/index.d.cts +1 -1
  137. package/dist/hooks/useClientValidation/index.d.ts +1 -1
  138. package/dist/hooks/useController/index.cjs +1 -1
  139. package/dist/hooks/useController/index.d.ts +0 -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 +2 -2
  143. package/dist/hooks/useInput/index.cjs +3 -3
  144. package/dist/hooks/useInput/index.d.cts +1 -1
  145. package/dist/hooks/useInput/index.d.ts +1 -1
  146. package/dist/hooks/useInputValueDebounce/index.cjs +1 -1
  147. package/dist/hooks/useInputValueDebounce/index.d.cts +1 -1
  148. package/dist/hooks/useInputValueDebounce/index.d.ts +1 -1
  149. package/dist/hooks/useInputValueTransform/index.cjs +1 -1
  150. package/dist/hooks/useUniformField/index.cjs +1 -1
  151. package/dist/hooks/useUniformField/index.d.cts +1 -1
  152. package/dist/hooks/useUniformField/index.d.ts +3 -3
  153. package/dist/hooks/useUniformField/index.js +1 -1
  154. package/dist/hooks/useUniformFieldArray/index.cjs +1 -1
  155. package/dist/hooks/useUniformFieldArray/index.d.cts +1 -1
  156. package/dist/hooks/useUniformFieldArray/index.d.ts +24 -4
  157. package/dist/hooks/useUniformFieldArray/index.js +1 -1
  158. package/dist/hooks/useWatchUserChange/index.cjs +1 -1
  159. package/dist/{index-CzypMcVS.d.cts → index--E2ZsMya.d.ts} +6 -6
  160. package/dist/{index-C_ATGeaX.d.ts.map → index--E2ZsMya.d.ts.map} +1 -1
  161. package/dist/{index-C56I3SOi.d.cts → index-BITJ-CZL.d.cts} +4 -4
  162. package/dist/{index-C56I3SOi.d.cts.map → index-BITJ-CZL.d.cts.map} +1 -1
  163. package/dist/{index-CVY05bZf.d.ts → index-BL0DnIzh.d.ts} +3 -3
  164. package/dist/{index-CVY05bZf.d.ts.map → index-BL0DnIzh.d.ts.map} +1 -1
  165. package/dist/{index-CHmS3ri3.d.ts → index-BQDEnYTq.d.ts} +1 -1
  166. package/dist/{index-CHmS3ri3.d.ts.map → index-BQDEnYTq.d.ts.map} +1 -1
  167. package/dist/{index-DHHBSmJb.d.ts → index-BTTo_ufh.d.ts} +1 -1
  168. package/dist/{index-DHHBSmJb.d.ts.map → index-BTTo_ufh.d.ts.map} +1 -1
  169. package/dist/{index-B74QlCAy.d.cts → index-BWNJdLDV.d.ts} +48 -48
  170. package/dist/{index-B4Wkijem.d.ts.map → index-BWNJdLDV.d.ts.map} +1 -1
  171. package/dist/{index-CraZe1qS.d.ts → index-Bj_lpc5r.d.cts} +21 -21
  172. package/dist/{index-CI9QBUoM.d.cts.map → index-Bj_lpc5r.d.cts.map} +1 -1
  173. package/dist/{index-B4Wkijem.d.ts → index-Bo_n9sse.d.cts} +47 -47
  174. package/dist/{index-B74QlCAy.d.cts.map → index-Bo_n9sse.d.cts.map} +1 -1
  175. package/dist/{index-iuLEYAix.d.cts → index-BxA_pJWn.d.cts} +21 -21
  176. package/dist/{index-iuLEYAix.d.cts.map → index-BxA_pJWn.d.cts.map} +1 -1
  177. package/dist/{index-Drl7euco.d.ts → index-C-2nxT8D.d.ts} +21 -21
  178. package/dist/{index-Drl7euco.d.ts.map → index-C-2nxT8D.d.ts.map} +1 -1
  179. package/dist/{index-C1fYmoY0.d.ts → index-C0L7GvgN.d.cts} +34 -34
  180. package/dist/index-C0L7GvgN.d.cts.map +1 -0
  181. package/dist/{index-DzuP5q-2.d.ts → index-C1PUx1tH.d.ts} +6 -6
  182. package/dist/index-C1PUx1tH.d.ts.map +1 -0
  183. package/dist/index-CADnFWHq.d.ts +264 -0
  184. package/dist/{index-BTEsKen4.d.ts.map → index-CADnFWHq.d.ts.map} +1 -1
  185. package/dist/{index-BM4XWo1K.d.ts → index-CGnr_e53.d.ts} +36 -36
  186. package/dist/{index-BM4XWo1K.d.ts.map → index-CGnr_e53.d.ts.map} +1 -1
  187. package/dist/{index-DhMSgdwM.d.ts → index-CSBE6Et0.d.cts} +6 -6
  188. package/dist/{index-Dklb-p_1.d.cts.map → index-CSBE6Et0.d.cts.map} +1 -1
  189. package/dist/{index-D6RB3b5L.d.ts → index-CVnn6mEI.d.ts} +4 -4
  190. package/dist/{index-D6RB3b5L.d.ts.map → index-CVnn6mEI.d.ts.map} +1 -1
  191. package/dist/{index-BMN2XNyT.d.cts → index-CYdvpGJF.d.cts} +3 -3
  192. package/dist/{index-BMN2XNyT.d.cts.map → index-CYdvpGJF.d.cts.map} +1 -1
  193. package/dist/{index-CbAh0Kfo.d.cts → index-Cb0AgRRa.d.cts} +3 -3
  194. package/dist/{index-CbAh0Kfo.d.cts.map → index-Cb0AgRRa.d.cts.map} +1 -1
  195. package/dist/{index-DA5um0u6.d.cts → index-D38wOL-M.d.ts} +34 -34
  196. package/dist/index-D38wOL-M.d.ts.map +1 -0
  197. package/dist/{index-DpD4MxGD.d.cts → index-DG9C0kHA.d.ts} +35 -34
  198. package/dist/{index-RvYO46Vg.d.ts.map → index-DG9C0kHA.d.ts.map} +1 -1
  199. package/dist/{index-RvYO46Vg.d.ts → index-DNkZrb7P.d.cts} +35 -36
  200. package/dist/{index-DpD4MxGD.d.cts.map → index-DNkZrb7P.d.cts.map} +1 -1
  201. package/dist/{index-C_ATGeaX.d.ts → index-DRij_w43.d.cts} +5 -5
  202. package/dist/{index-CzypMcVS.d.cts.map → index-DRij_w43.d.cts.map} +1 -1
  203. package/dist/{index-Dklb-p_1.d.cts → index-DmMenZfj.d.ts} +5 -5
  204. package/dist/{index-DhMSgdwM.d.ts.map → index-DmMenZfj.d.ts.map} +1 -1
  205. package/dist/{index-CI9QBUoM.d.cts → index-DnzC0GCS.d.ts} +3 -3
  206. package/dist/index-DnzC0GCS.d.ts.map +1 -0
  207. package/dist/{index-BOI0cy-n.d.cts → index-DoS0lVRe.d.cts} +34 -34
  208. package/dist/index-DoS0lVRe.d.cts.map +1 -0
  209. package/dist/{index-aHcGnXHf.d.ts → index-DvB46QAb.d.ts} +3 -3
  210. package/dist/{index-aHcGnXHf.d.ts.map → index-DvB46QAb.d.ts.map} +1 -1
  211. package/dist/{index-BW9EUWZE.d.cts → index-DxdaxM3o.d.cts} +3 -3
  212. package/dist/{index-BW9EUWZE.d.cts.map → index-DxdaxM3o.d.cts.map} +1 -1
  213. package/dist/{index-CQWoxgWk.d.ts → index-Edx7MxXu.d.ts} +3 -3
  214. package/dist/{index-CQWoxgWk.d.ts.map → index-Edx7MxXu.d.ts.map} +1 -1
  215. package/dist/{index-BaBZGCqS.d.cts → index-F11geOHD.d.ts} +6 -6
  216. package/dist/{index-CvA5yKx9.d.ts.map → index-F11geOHD.d.ts.map} +1 -1
  217. package/dist/{index-1gPh6Uoh.d.cts → index-PU5WNOH9.d.cts} +3 -3
  218. package/dist/{index-1gPh6Uoh.d.cts.map → index-PU5WNOH9.d.cts.map} +1 -1
  219. package/dist/{index-CO-l7RmT.d.cts → index-WogV9uVV.d.cts} +6 -6
  220. package/dist/{index-CO-l7RmT.d.cts.map → index-WogV9uVV.d.cts.map} +1 -1
  221. package/dist/{index-CvA5yKx9.d.ts → index-oyX8xu0F.d.cts} +4 -4
  222. package/dist/{index-BaBZGCqS.d.cts.map → index-oyX8xu0F.d.cts.map} +1 -1
  223. package/dist/index-sJZ434Sg.d.cts +264 -0
  224. package/dist/index-sJZ434Sg.d.cts.map +1 -0
  225. package/dist/index.cjs +29 -29
  226. package/dist/index.d.cts +22 -22
  227. package/dist/index.d.ts +24 -25
  228. package/dist/index.js +19 -19
  229. package/dist/partials/FieldCopyTestIdButton/index.cjs +1 -1
  230. package/dist/partials/FieldCopyTestIdButton/index.d.cts +1 -1
  231. package/dist/partials/FieldCopyTestIdButton/index.d.ts +1 -1
  232. package/dist/partials/FieldCopyTestIdButton/index.js +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/partials/FieldValidationError/index.js +1 -1
  237. package/dist/{useClientValidation-CkBtUSco.d.ts → useClientValidation-BQqwz628.d.cts} +3 -3
  238. package/dist/{useClientValidation-C3Q5UCy9.d.cts.map → useClientValidation-BQqwz628.d.cts.map} +1 -1
  239. package/dist/useClientValidation-BnnscAEe.js.map +1 -1
  240. package/dist/{useClientValidation-oZd4_ocQ.cjs → useClientValidation-CmYVGlLr.cjs} +7 -7
  241. package/dist/useClientValidation-CmYVGlLr.cjs.map +1 -0
  242. package/dist/{useClientValidation-C3Q5UCy9.d.cts → useClientValidation-DJ4JuN_9.d.ts} +3 -3
  243. package/dist/{useClientValidation-CkBtUSco.d.ts.map → useClientValidation-DJ4JuN_9.d.ts.map} +1 -1
  244. package/dist/{useController-BzkCcbSo.cjs → useController-CkmO5CLh.cjs} +3 -3
  245. package/dist/{useController-BzkCcbSo.cjs.map → useController-CkmO5CLh.cjs.map} +1 -1
  246. package/dist/{useFormContext-CZh7pv8f.d.cts → useFormContext-B083Y-kw.d.cts} +17 -17
  247. package/dist/{useFormContext-CZh7pv8f.d.cts.map → useFormContext-B083Y-kw.d.cts.map} +1 -1
  248. package/dist/{useFormContext-3AAPT6eZ.d.ts → useFormContext-B2TS6xq0.d.ts} +1 -1
  249. package/dist/{useFormContext-3AAPT6eZ.d.ts.map → useFormContext-B2TS6xq0.d.ts.map} +1 -1
  250. package/dist/{useFormContext-CWuN-_7P.cjs → useFormContext-Bp0EODoO.cjs} +3 -3
  251. package/dist/useFormContext-Bp0EODoO.cjs.map +1 -0
  252. package/dist/useFormContext-JCm1UR_e.js.map +1 -1
  253. package/dist/{useInputValueDebounce-B2RzCWty.d.cts → useInputValueDebounce-B5b-v8Hc.d.cts} +1 -1
  254. package/dist/{useInputValueDebounce-B2RzCWty.d.cts.map → useInputValueDebounce-B5b-v8Hc.d.cts.map} +1 -1
  255. package/dist/{useInputValueDebounce-tL8maIp8.cjs → useInputValueDebounce-BcUyaS94.cjs} +2 -2
  256. package/dist/{useInputValueDebounce-tL8maIp8.cjs.map → useInputValueDebounce-BcUyaS94.cjs.map} +1 -1
  257. package/dist/{useInputValueDebounce-C7_bvNGH.d.ts → useInputValueDebounce-DoRuSF6R.d.ts} +1 -1
  258. package/dist/{useInputValueDebounce-C7_bvNGH.d.ts.map → useInputValueDebounce-DoRuSF6R.d.ts.map} +1 -1
  259. package/dist/{useInputValueTransform-C-uSW8Y3.cjs → useInputValueTransform-DFPA3KVy.cjs} +2 -2
  260. package/dist/{useInputValueTransform-C-uSW8Y3.cjs.map → useInputValueTransform-DFPA3KVy.cjs.map} +1 -1
  261. package/dist/{useUniformField-Be3kdnhK.d.cts → useUniformField-B2OZ-Z1G.d.cts} +3 -3
  262. package/dist/{useUniformField-Be3kdnhK.d.cts.map → useUniformField-B2OZ-Z1G.d.cts.map} +1 -1
  263. package/dist/{useUniformField-BMvnRC_r.cjs → useUniformField-Bj23Kvbs.cjs} +13 -13
  264. package/dist/useUniformField-Bj23Kvbs.cjs.map +1 -0
  265. package/dist/{useUniformField-DDHQ5B11.d.ts → useUniformField-CwEHonNe.d.ts} +3 -3
  266. package/dist/{useUniformField-DDHQ5B11.d.ts.map → useUniformField-CwEHonNe.d.ts.map} +1 -1
  267. package/dist/{useUniformField-ClprfrES.js → useUniformField-gU4qYUwL.js} +3 -3
  268. package/dist/useUniformField-gU4qYUwL.js.map +1 -0
  269. package/dist/{useUniformFieldArray-C-0OXG3N.js → useUniformFieldArray-B5PyxL1P.js} +2 -2
  270. package/dist/{useUniformFieldArray-C-0OXG3N.js.map → useUniformFieldArray-B5PyxL1P.js.map} +1 -1
  271. package/dist/{useUniformFieldArray-BhPi3gPv.d.ts → useUniformFieldArray-CXoWvu6m.d.ts} +3 -3
  272. package/dist/{useUniformFieldArray-BhPi3gPv.d.ts.map → useUniformFieldArray-CXoWvu6m.d.ts.map} +1 -1
  273. package/dist/{useUniformFieldArray-btjvJdZ6.cjs → useUniformFieldArray-G1lokW7x.cjs} +7 -7
  274. package/dist/{useUniformFieldArray-btjvJdZ6.cjs.map → useUniformFieldArray-G1lokW7x.cjs.map} +1 -1
  275. package/dist/{useUniformFieldArray-BBFw08qL.d.cts → useUniformFieldArray-qtJMEosJ.d.cts} +13 -13
  276. package/dist/{useUniformFieldArray-BBFw08qL.d.cts.map → useUniformFieldArray-qtJMEosJ.d.cts.map} +1 -1
  277. package/dist/{useWatchUserChange-C5dr12By.cjs → useWatchUserChange-BnxYE-0b.cjs} +3 -3
  278. package/dist/{useWatchUserChange-C5dr12By.cjs.map → useWatchUserChange-BnxYE-0b.cjs.map} +1 -1
  279. package/package.json +10 -10
  280. package/dist/Checkboxes-CGWhnpBp.js.map +0 -1
  281. package/dist/Checkboxes-Ds6bzl6p.cjs.map +0 -1
  282. package/dist/FieldArray-BexXN9bO.cjs.map +0 -1
  283. package/dist/FieldArray-D3iUaRLo.js.map +0 -1
  284. package/dist/FormContext-C3GymQOA.cjs.map +0 -1
  285. package/dist/Input--h5t7Sbl.js.map +0 -1
  286. package/dist/Input-DKfFFOpo.cjs.map +0 -1
  287. package/dist/RadioBoxes-7qdHj3ti.js.map +0 -1
  288. package/dist/RadioBoxes-Bd9ahl4i.cjs.map +0 -1
  289. package/dist/RadioTabs-DXs98jng.js.map +0 -1
  290. package/dist/RadioTabs-DcEUdW7r.cjs.map +0 -1
  291. package/dist/Select-BsL7qn2v.cjs.map +0 -1
  292. package/dist/Select-CBjqYDcs.js.map +0 -1
  293. package/dist/helpers-KTgXi0lA.cjs.map +0 -1
  294. package/dist/index-BOI0cy-n.d.cts.map +0 -1
  295. package/dist/index-BTEsKen4.d.ts +0 -264
  296. package/dist/index-C1fYmoY0.d.ts.map +0 -1
  297. package/dist/index-CJNLQVjx.d.ts +0 -1
  298. package/dist/index-CqV2Q3da.d.cts +0 -264
  299. package/dist/index-CqV2Q3da.d.cts.map +0 -1
  300. package/dist/index-CraZe1qS.d.ts.map +0 -1
  301. package/dist/index-CwSIy_W-.d.cts +0 -1
  302. package/dist/index-DA5um0u6.d.cts.map +0 -1
  303. package/dist/index-DzuP5q-2.d.ts.map +0 -1
  304. package/dist/useClientValidation-oZd4_ocQ.cjs.map +0 -1
  305. package/dist/useFormContext-CWuN-_7P.cjs.map +0 -1
  306. package/dist/useUniformField-BMvnRC_r.cjs.map +0 -1
  307. package/dist/useUniformField-ClprfrES.js.map +0 -1
  308. /package/dist/{index-B3Z8gdjC.d.ts → index-BRLjimYW.d.ts} +0 -0
  309. /package/dist/{index-BXpMZvwA.d.cts → index-DpEKQcoR.d.cts} +0 -0
  310. /package/dist/{useInput-IGJqJ2tR.d.ts → useInput--wjwIBc5.d.cts} +0 -0
  311. /package/dist/{useInput-NMHJNZ5A.d.cts → useInput-BCdeYOOg.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"Slider-BHjHSoIk.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,qBAAeD;;;;ACzMf,uBAAeE"}
1
+ {"version":3,"file":"Slider-Dlhb-9hC.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-DhtPJuro.cjs');
2
+ const require_SubmitButton = require('../SubmitButton-CUBItcBn.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-CbAh0Kfo.cjs";
1
+ import { n as SubmitButtonProps, t as SubmitButton } from "../index-Cb0AgRRa.cjs";
2
2
  export { SubmitButton, SubmitButton as default, SubmitButtonProps };
@@ -1,2 +1,2 @@
1
- import { n as SubmitButtonProps, t as SubmitButton } from "../index-CVY05bZf.js";
1
+ import { n as SubmitButtonProps, t as SubmitButton } from "../index-BL0DnIzh.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-7iOaKzhB.js";
1
+ import { n as SubmitButton_default, t as SubmitButton_default$1 } from "../SubmitButton-C5f6j0N4.js";
2
2
 
3
3
  export { SubmitButton_default as SubmitButton, SubmitButton_default$1 as default };
@@ -23,12 +23,12 @@ const SubmitButton = ({ ariaLabel = "Submit form", children = "Submit", classNam
23
23
  children
24
24
  });
25
25
  };
26
- var SubmitButton_default = SubmitButton;
26
+ var SubmitButton_default$1 = SubmitButton;
27
27
 
28
28
  //#endregion
29
29
  //#region src/SubmitButton/index.ts
30
- var SubmitButton_default$1 = SubmitButton_default;
30
+ var SubmitButton_default = SubmitButton_default$1;
31
31
 
32
32
  //#endregion
33
- export { SubmitButton_default as n, SubmitButton_default$1 as t };
34
- //# sourceMappingURL=SubmitButton-7iOaKzhB.js.map
33
+ export { SubmitButton_default$1 as n, SubmitButton_default as t };
34
+ //# sourceMappingURL=SubmitButton-C5f6j0N4.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SubmitButton-7iOaKzhB.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,2BAAe;;;;AC5Df,6BAAeA"}
1
+ {"version":3,"file":"SubmitButton-C5f6j0N4.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,7 +1,7 @@
1
- const require_FormContext = require('./FormContext-C3GymQOA.cjs');
2
- const require_useFormContext = require('./useFormContext-CWuN-_7P.cjs');
3
- let __fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
4
- let __fuf_stack_pixels = require("@fuf-stack/pixels");
1
+ const require_FormContext = require('./FormContext-Bb6d8hdG.cjs');
2
+ const require_useFormContext = require('./useFormContext-Bp0EODoO.cjs');
3
+ let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
4
+ let _fuf_stack_pixels = require("@fuf-stack/pixels");
5
5
  let react_jsx_runtime = require("react/jsx-runtime");
6
6
 
7
7
  //#region src/SubmitButton/SubmitButton.tsx
@@ -10,37 +10,37 @@ let react_jsx_runtime = require("react/jsx-runtime");
10
10
  */
11
11
  const SubmitButton = ({ ariaLabel = "Submit form", children = "Submit", className = void 0, color = "success", icon = void 0, loading = false, size = "md", testId = "form_submit_button" }) => {
12
12
  const { formState: { isSubmitting }, triggerSubmit } = require_useFormContext.useFormContext();
13
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__fuf_stack_pixels.Button, {
13
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_fuf_stack_pixels.Button, {
14
14
  ariaLabel,
15
- className: (0, __fuf_stack_pixel_utils.cn)(className),
15
+ className: (0, _fuf_stack_pixel_utils.cn)(className),
16
16
  color,
17
17
  disabled: isSubmitting,
18
18
  icon,
19
19
  loading: loading || isSubmitting,
20
20
  onClick: triggerSubmit,
21
21
  size,
22
- testId: (0, __fuf_stack_pixel_utils.slugify)(testId, { replaceDots: true }),
22
+ testId: (0, _fuf_stack_pixel_utils.slugify)(testId, { replaceDots: true }),
23
23
  type: "submit",
24
24
  children
25
25
  });
26
26
  };
27
- var SubmitButton_default = SubmitButton;
27
+ var SubmitButton_default$1 = SubmitButton;
28
28
 
29
29
  //#endregion
30
30
  //#region src/SubmitButton/index.ts
31
- var SubmitButton_default$1 = SubmitButton_default;
31
+ var SubmitButton_default = SubmitButton_default$1;
32
32
 
33
33
  //#endregion
34
34
  Object.defineProperty(exports, 'SubmitButton_default', {
35
35
  enumerable: true,
36
36
  get: function () {
37
- return SubmitButton_default$1;
37
+ return SubmitButton_default;
38
38
  }
39
39
  });
40
40
  Object.defineProperty(exports, 'SubmitButton_default$1', {
41
41
  enumerable: true,
42
42
  get: function () {
43
- return SubmitButton_default;
43
+ return SubmitButton_default$1;
44
44
  }
45
45
  });
46
- //# sourceMappingURL=SubmitButton-DhtPJuro.cjs.map
46
+ //# sourceMappingURL=SubmitButton-CUBItcBn.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"SubmitButton-DhtPJuro.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,2CAAc,UAAU;EACjB;EACP,UAAU;EACJ;EACN,SAAS,WAAW;EAIpB,SAAS;EACH;EACN,6CAAgB,QAAQ,EAAE,aAAa,MAAM,CAAC;EAC9C,MAAK;EAEJ;GACM;;AAIb,2BAAe;;;;AC5Df,6BAAeC"}
1
+ {"version":3,"file":"SubmitButton-CUBItcBn.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-Dczzog3v.cjs');
2
+ const require_Switch = require('../Switch-6LyeZHJh.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-BOI0cy-n.cjs";
1
+ import { n as SwitchProps, t as Switch } from "../index-DoS0lVRe.cjs";
2
2
  export { Switch, Switch as default, SwitchProps };
@@ -1,2 +1,2 @@
1
- import { n as SwitchProps, t as Switch } from "../index-BM4XWo1K.js";
1
+ import { n as SwitchProps, t as Switch } from "../index-CGnr_e53.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-DCxAgt_L.js";
1
+ import { n as Switch_default, t as Switch_default$1 } from "../Switch--m02Xcq8.js";
2
2
 
3
3
  export { Switch_default as Switch, Switch_default$1 as default };
@@ -1,4 +1,4 @@
1
- import { t as useUniformField } from "./useUniformField-ClprfrES.js";
1
+ import { t as useUniformField } from "./useUniformField-gU4qYUwL.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";
@@ -73,12 +73,12 @@ const Switch$1 = ({ className = void 0, endContent = void 0, name, size = void 0
73
73
  ]
74
74
  });
75
75
  };
76
- var Switch_default = Switch$1;
76
+ var Switch_default$1 = Switch$1;
77
77
 
78
78
  //#endregion
79
79
  //#region src/Switch/index.ts
80
- var Switch_default$1 = Switch_default;
80
+ var Switch_default = Switch_default$1;
81
81
 
82
82
  //#endregion
83
- export { Switch_default as n, Switch_default$1 as t };
84
- //# sourceMappingURL=Switch-DCxAgt_L.js.map
83
+ export { Switch_default$1 as n, Switch_default as t };
84
+ //# sourceMappingURL=Switch--m02Xcq8.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Switch-DCxAgt_L.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,qBAAeD;;;;AClJf,uBAAeE"}
1
+ {"version":3,"file":"Switch--m02Xcq8.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,13 +1,13 @@
1
- const require_FormContext = require('./FormContext-C3GymQOA.cjs');
2
- const require_useUniformField = require('./useUniformField-BMvnRC_r.cjs');
3
- let __fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
1
+ const require_FormContext = require('./FormContext-Bb6d8hdG.cjs');
2
+ const require_useUniformField = require('./useUniformField-Bj23Kvbs.cjs');
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");
6
- let __react_aria_visually_hidden = require("@react-aria/visually-hidden");
7
- let __heroui_switch = require("@heroui/switch");
6
+ let _react_aria_visually_hidden = require("@react-aria/visually-hidden");
7
+ let _heroui_switch = require("@heroui/switch");
8
8
 
9
9
  //#region src/Switch/Switch.tsx
10
- const switchVariants = (0, __fuf_stack_pixel_utils.tv)({ slots: {
10
+ const switchVariants = (0, _fuf_stack_pixel_utils.tv)({ slots: {
11
11
  base: "",
12
12
  endContent: "",
13
13
  errorMessage: "ml-1 mt-1",
@@ -27,11 +27,11 @@ const Switch = ({ className = void 0, endContent = void 0, name, size = void 0,
27
27
  ...uniformFieldProps
28
28
  });
29
29
  const visualSwitchRef = (0, react.useRef)(null);
30
- const classNames = (0, __fuf_stack_pixel_utils.variantsToClassNames)(switchVariants(), className, "outerWrapper");
30
+ const classNames = (0, _fuf_stack_pixel_utils.variantsToClassNames)(switchVariants(), className, "outerWrapper");
31
31
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
32
32
  className: classNames.outerWrapper,
33
33
  children: [
34
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__react_aria_visually_hidden.VisuallyHidden, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
34
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_aria_visually_hidden.VisuallyHidden, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
35
35
  ref,
36
36
  "aria-label": ariaLabel,
37
37
  checked: !!field.value,
@@ -45,7 +45,7 @@ const Switch = ({ className = void 0, endContent = void 0, name, size = void 0,
45
45
  visualSwitchRef.current?.focus();
46
46
  }
47
47
  }) }),
48
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__heroui_switch.Switch, {
48
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_heroui_switch.Switch, {
49
49
  ref: visualSwitchRef,
50
50
  "aria-label": ariaLabel,
51
51
  classNames,
@@ -65,7 +65,7 @@ const Switch = ({ className = void 0, endContent = void 0, name, size = void 0,
65
65
  }),
66
66
  invalid ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
67
67
  ...getHelperWrapperProps(),
68
- className: (0, __fuf_stack_pixel_utils.cn)(getHelperWrapperProps()?.className, "ml-0 block"),
68
+ className: (0, _fuf_stack_pixel_utils.cn)(getHelperWrapperProps()?.className, "ml-0 block"),
69
69
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
70
70
  ...getErrorMessageProps(),
71
71
  children: errorMessage
@@ -74,23 +74,23 @@ const Switch = ({ className = void 0, endContent = void 0, name, size = void 0,
74
74
  ]
75
75
  });
76
76
  };
77
- var Switch_default = Switch;
77
+ var Switch_default$1 = Switch;
78
78
 
79
79
  //#endregion
80
80
  //#region src/Switch/index.ts
81
- var Switch_default$1 = Switch_default;
81
+ var Switch_default = Switch_default$1;
82
82
 
83
83
  //#endregion
84
84
  Object.defineProperty(exports, 'Switch_default', {
85
85
  enumerable: true,
86
86
  get: function () {
87
- return Switch_default$1;
87
+ return Switch_default;
88
88
  }
89
89
  });
90
90
  Object.defineProperty(exports, 'Switch_default$1', {
91
91
  enumerable: true,
92
92
  get: function () {
93
- return Switch_default;
93
+ return Switch_default$1;
94
94
  }
95
95
  });
96
- //# sourceMappingURL=Switch-Dczzog3v.cjs.map
96
+ //# sourceMappingURL=Switch-6LyeZHJh.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Switch-Dczzog3v.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,iDAAoB,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,+DADW,gBAAgB,EACiB,WAAW,eAAe;AAE5E,QACE,4CAAC;EAAI,WAAW,WAAW;;GAEzB,2CAACC,yDACC,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,2CACE,uBAAuB,EAAE,WAEzB,aACD;cAED,2CAAC;KAAI,GAAI,sBAAsB;eAAG;MAAmB;KACjD,GACJ;;GACA;;AAIV,qBAAe;;;;AClJf,uBAAeC"}
1
+ {"version":3,"file":"Switch-6LyeZHJh.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,5 +1,5 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- const require_SwitchBox = require('../SwitchBox-DqVmZYId.cjs');
2
+ const require_SwitchBox = require('../SwitchBox-CtGiQdys.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-Dklb-p_1.cjs";
1
+ import { n as SwitchBoxProps, r as switchBoxVariants, t as SwitchBox } from "../index-CSBE6Et0.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-DhMSgdwM.js";
1
+ import { n as SwitchBoxProps, r as switchBoxVariants, t as SwitchBox } from "../index-DmMenZfj.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-DPHryDOM.js";
1
+ import { n as SwitchBox_default, r as switchBoxVariants, t as SwitchBox_default$1 } from "../SwitchBox-D0-e-pbM.js";
2
2
 
3
3
  export { SwitchBox_default as SwitchBox, SwitchBox_default$1 as default, switchBoxVariants };
@@ -1,13 +1,13 @@
1
- const require_FormContext = require('./FormContext-C3GymQOA.cjs');
2
- const require_useUniformField = require('./useUniformField-BMvnRC_r.cjs');
3
- let __fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
1
+ const require_FormContext = require('./FormContext-Bb6d8hdG.cjs');
2
+ const require_useUniformField = require('./useUniformField-Bj23Kvbs.cjs');
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");
6
- let __react_aria_visually_hidden = require("@react-aria/visually-hidden");
7
- let __heroui_switch = require("@heroui/switch");
6
+ let _react_aria_visually_hidden = require("@react-aria/visually-hidden");
7
+ let _heroui_switch = require("@heroui/switch");
8
8
 
9
9
  //#region src/SwitchBox/SwitchBox.tsx
10
- const switchBoxVariants = (0, __fuf_stack_pixel_utils.tv)({
10
+ const switchBoxVariants = (0, _fuf_stack_pixel_utils.tv)({
11
11
  slots: {
12
12
  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",
13
13
  description: "text-foreground opacity-70",
@@ -52,7 +52,7 @@ const SwitchBox = ({ className = void 0, description = void 0, icon = void 0, na
52
52
  ...uniformFieldProps
53
53
  });
54
54
  const visualSwitchRef = (0, react.useRef)(null);
55
- const { Component, slots, isSelected, getBaseProps, getInputProps, getWrapperProps } = (0, __heroui_switch.useSwitch)({
55
+ const { Component, slots, isSelected, getBaseProps, getInputProps, getWrapperProps } = (0, _heroui_switch.useSwitch)({
56
56
  defaultSelected: !!defaultValue,
57
57
  isDisabled: disabled,
58
58
  isSelected: !!field.value,
@@ -61,7 +61,7 @@ const SwitchBox = ({ className = void 0, description = void 0, icon = void 0, na
61
61
  size,
62
62
  thumbIcon
63
63
  });
64
- const classNames = (0, __fuf_stack_pixel_utils.variantsToClassNames)(switchBoxVariants({
64
+ const classNames = (0, _fuf_stack_pixel_utils.variantsToClassNames)(switchBoxVariants({
65
65
  isDisabled: disabled,
66
66
  isInvalid: invalid,
67
67
  size
@@ -73,7 +73,7 @@ const SwitchBox = ({ className = void 0, description = void 0, icon = void 0, na
73
73
  "data-required": required,
74
74
  "data-testid": testId,
75
75
  children: [
76
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__react_aria_visually_hidden.VisuallyHidden, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
76
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_react_aria_visually_hidden.VisuallyHidden, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
77
77
  ref,
78
78
  "aria-label": typeof label === "string" ? label : name,
79
79
  checked: !!field.value,
@@ -96,9 +96,9 @@ const SwitchBox = ({ className = void 0, description = void 0, icon = void 0, na
96
96
  })] }),
97
97
  !icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
98
98
  ...getWrapperProps(),
99
- className: (0, __fuf_stack_pixel_utils.cn)(getWrapperProps().className, classNames.wrapper),
99
+ className: (0, _fuf_stack_pixel_utils.cn)(getWrapperProps().className, classNames.wrapper),
100
100
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
101
- className: (0, __fuf_stack_pixel_utils.cn)(slots.thumb({ class: classNames.thumb })),
101
+ className: (0, _fuf_stack_pixel_utils.cn)(slots.thumb({ class: classNames.thumb })),
102
102
  children: thumbIcon && typeof thumbIcon === "function" ? thumbIcon({
103
103
  isSelected: !!isSelected,
104
104
  className: slots.thumbIcon({ class: classNames.thumbIcon }),
@@ -124,9 +124,9 @@ const SwitchBox = ({ className = void 0, description = void 0, icon = void 0, na
124
124
  }),
125
125
  icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
126
126
  ...getWrapperProps(),
127
- className: (0, __fuf_stack_pixel_utils.cn)(getWrapperProps().className, classNames.wrapper),
127
+ className: (0, _fuf_stack_pixel_utils.cn)(getWrapperProps().className, classNames.wrapper),
128
128
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
129
- className: (0, __fuf_stack_pixel_utils.cn)(slots.thumb({ class: classNames.thumb })),
129
+ className: (0, _fuf_stack_pixel_utils.cn)(slots.thumb({ class: classNames.thumb })),
130
130
  children: thumbIcon && typeof thumbIcon === "function" ? thumbIcon({
131
131
  isSelected: !!isSelected,
132
132
  className: slots.thumbIcon({ class: classNames.thumbIcon }),
@@ -139,30 +139,30 @@ const SwitchBox = ({ className = void 0, description = void 0, icon = void 0, na
139
139
  ]
140
140
  }), invalid ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
141
141
  ...getHelperWrapperProps(),
142
- className: (0, __fuf_stack_pixel_utils.cn)(getHelperWrapperProps()?.className, "ml-0 block"),
142
+ className: (0, _fuf_stack_pixel_utils.cn)(getHelperWrapperProps()?.className, "ml-0 block"),
143
143
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
144
144
  ...getErrorMessageProps(),
145
145
  children: errorMessage
146
146
  })
147
147
  }) : null] });
148
148
  };
149
- var SwitchBox_default = SwitchBox;
149
+ var SwitchBox_default$1 = SwitchBox;
150
150
 
151
151
  //#endregion
152
152
  //#region src/SwitchBox/index.ts
153
- var SwitchBox_default$1 = SwitchBox_default;
153
+ var SwitchBox_default = SwitchBox_default$1;
154
154
 
155
155
  //#endregion
156
156
  Object.defineProperty(exports, 'SwitchBox_default', {
157
157
  enumerable: true,
158
158
  get: function () {
159
- return SwitchBox_default$1;
159
+ return SwitchBox_default;
160
160
  }
161
161
  });
162
162
  Object.defineProperty(exports, 'SwitchBox_default$1', {
163
163
  enumerable: true,
164
164
  get: function () {
165
- return SwitchBox_default;
165
+ return SwitchBox_default$1;
166
166
  }
167
167
  });
168
168
  Object.defineProperty(exports, 'switchBoxVariants', {
@@ -171,4 +171,4 @@ Object.defineProperty(exports, 'switchBoxVariants', {
171
171
  return switchBoxVariants;
172
172
  }
173
173
  });
174
- //# sourceMappingURL=SwitchBox-DqVmZYId.cjs.map
174
+ //# sourceMappingURL=SwitchBox-CtGiQdys.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"SwitchBox-DqVmZYId.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-CtGiQdys.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-ClprfrES.js";
1
+ import { t as useUniformField } from "./useUniformField-gU4qYUwL.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";
@@ -145,12 +145,12 @@ const SwitchBox = ({ className = void 0, description = void 0, icon = void 0, na
145
145
  })
146
146
  }) : null] });
147
147
  };
148
- var SwitchBox_default = SwitchBox;
148
+ var SwitchBox_default$1 = SwitchBox;
149
149
 
150
150
  //#endregion
151
151
  //#region src/SwitchBox/index.ts
152
- var SwitchBox_default$1 = SwitchBox_default;
152
+ var SwitchBox_default = SwitchBox_default$1;
153
153
 
154
154
  //#endregion
155
- export { SwitchBox_default as n, switchBoxVariants as r, SwitchBox_default$1 as t };
156
- //# sourceMappingURL=SwitchBox-DPHryDOM.js.map
155
+ export { SwitchBox_default$1 as n, switchBoxVariants as r, SwitchBox_default as t };
156
+ //# sourceMappingURL=SwitchBox-D0-e-pbM.js.map